From 57c70f83b8604b7eabc2c69a4cf5f1bcd56b1369 Mon Sep 17 00:00:00 2001 From: Jovica Zoric Date: Tue, 26 Sep 2017 13:29:50 +0200 Subject: [PATCH 0001/2153] fix(react-sortable-tree): Add missing prop Add missing dndType prop. --- types/react-sortable-tree/index.d.ts | 2 ++ types/react-sortable-tree/react-sortable-tree-tests.tsx | 1 + 2 files changed, 3 insertions(+) diff --git a/types/react-sortable-tree/index.d.ts b/types/react-sortable-tree/index.d.ts index a6a04f4968..dfed930e2f 100644 --- a/types/react-sortable-tree/index.d.ts +++ b/types/react-sortable-tree/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for react-sortable-tree 0.1 // Project: https://fritz-c.github.io/react-sortable-tree // Definitions by: Wouter Hardeman +// Jovica Zoric // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -111,6 +112,7 @@ export interface ReactSortableTreeProps { scaffoldBlockPxWidth?: number; isVirtualized?: boolean; nodeContentRenderer?: NodeRenderer; + dndType?: string; } declare const SortableTree: React.ComponentClass; diff --git a/types/react-sortable-tree/react-sortable-tree-tests.tsx b/types/react-sortable-tree/react-sortable-tree-tests.tsx index 1a5e2dfcd0..106415744b 100644 --- a/types/react-sortable-tree/react-sortable-tree-tests.tsx +++ b/types/react-sortable-tree/react-sortable-tree-tests.tsx @@ -54,6 +54,7 @@ class Test extends React.Component { scaffoldBlockPxWidth={44} isVirtualized={true} nodeContentRenderer={nodeRenderer} + dndType="testNodeType" /> Date: Sat, 23 Dec 2017 12:34:07 -0500 Subject: [PATCH 0002/2153] lodash: _.get should with numeric keys, too. Also added some better tests. --- types/lodash/index.d.ts | 51 ++++++++++++++++++++++++++++++++++++ types/lodash/lodash-tests.ts | 20 ++++++++++++-- 2 files changed, 69 insertions(+), 2 deletions(-) diff --git a/types/lodash/index.d.ts b/types/lodash/index.d.ts index caa92006b8..cc90e15559 100644 --- a/types/lodash/index.d.ts +++ b/types/lodash/index.d.ts @@ -13372,6 +13372,23 @@ declare namespace _ { defaultValue: TDefault ): TObject[TKey] | TDefault; + /** + * @see _.get + */ + get( + object: NumericDictionary | null | undefined, + path: number + ): T | undefined; + + /** + * @see _.get + */ + get( + object: NumericDictionary | null | undefined, + path: number, + defaultValue: TDefault + ): T | TDefault; + /** * @see _.get */ @@ -13424,6 +13441,23 @@ declare namespace _ { defaultValue: TDefault ): TObject[TKey] | TDefault; + /** + * @see _.get + */ + get( + this: LoDashImplicitWrapper | null | undefined>, + path: number + ): T | undefined; + + /** + * @see _.get + */ + get( + this: LoDashImplicitWrapper | null | undefined>, + path: number, + defaultValue: TDefault + ): T | TDefault; + /** * @see _.get */ @@ -13475,6 +13509,23 @@ declare namespace _ { defaultValue: TDefault ): LoDashExplicitWrapper; + /** + * @see _.get + */ + get( + this: LoDashExplicitWrapper | null | undefined>, + path: number + ): LoDashExplicitWrapper; + + /** + * @see _.get + */ + get( + this: LoDashExplicitWrapper | null | undefined>, + path: number, + defaultValue: TDefault + ): LoDashExplicitWrapper; + /** * @see _.get */ diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 774e58ef9f..fe1f1eb9ca 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -11266,6 +11266,22 @@ namespace TestGet { _.get([], Symbol.iterator); _.get([], [Symbol.iterator]); + _.get('abc', 4); // $ExpectType string | undefined + _('abc').get(4); // $ExpectType string | undefined + _.chain('abc').get(4); // $ExpectType LoDashExplicitWrapper + + _.get({ a: { b: true } }, "a"); // $ExpectType { b: boolean; } + _({ a: { b: true } }).get("a"); // $ExpectType { b: boolean; } + _.chain({ a: { b: true } }).get("a"); // $ExpectType LoDashExplicitWrapper<{ b: boolean; }> + + _.get({ a: { b: true } }, ["a"]); // $ExpectType { b: boolean; } + _({ a: { b: true } }).get(["a"]); // $ExpectType { b: boolean; } + _.chain({ a: { b: true } }).get(["a"]); // $ExpectType LoDashExplicitWrapper<{ b: boolean; }> + + _.get({ a: { b: true } }, ["a", "b"]); // $ExpectType any + _({ a: { b: true } }).get(["a", "b"]); // $ExpectType any + _.chain({ a: { b: true } }).get(["a", "b"]); // $ExpectType LoDashExplicitWrapper + { let result: string; @@ -11322,7 +11338,7 @@ namespace TestGet { result = _({a: true}).get(['a']); result = _({a: true}).get(['a'], false); } - +/* { let result: _.LoDashExplicitWrapper; @@ -11348,7 +11364,7 @@ namespace TestGet { result = _({a: true}).chain().get('a', false); result = _({a: true}).chain().get(['a']); result = _({a: true}).chain().get(['a'], false); - } + }*/ } // _.has From 34b42dbf696847ce0dd1282f5dc3d872cb0f79a0 Mon Sep 17 00:00:00 2001 From: Craig Kovatch Date: Fri, 29 Dec 2017 17:44:19 -0800 Subject: [PATCH 0003/2153] Add WAI-ARIA 1.1 attributes to React typings --- types/react/index.d.ts | 136 +++++++++++++++++++++++++++++++++++++ types/react/v15/index.d.ts | 136 +++++++++++++++++++++++++++++++++++++ 2 files changed, 272 insertions(+) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index c5c1c76d17..a4784caa41 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -2498,6 +2498,142 @@ declare namespace React { unselectable?: boolean; } + // All the WAI-ARIA 1.1 attributes + // https://www.w3.org/TR/wai-aria-1.1/ + interface HTMLAttributes extends DOMAttributes { + /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */ + 'aria-activedescendant'?: string; + /** Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change + * notifications defined by the aria-relevant attribute. */ + 'aria-atomic'?: boolean; + /** Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for + * an input and specifies how predictions would be presented if they are made. */ + 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both'; + /** Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are + * complete before exposing them to the user. */ + 'aria-busy'?: boolean; + /** Indicates the current "checked" state of checkboxes, radio buttons, and other widgets. + * @see aria-pressed @see aria-selected. */ + 'aria-checked'?: boolean | 'false' | 'mixed' | 'true'; + /** Defines the total number of columns in a table, grid, or treegrid. + * @see aria-colindex. */ + 'aria-colcount'?: number; + /** Defines an element's column index or position with respect to the total number of columns within a table, grid, or + * treegrid. + * @see aria-colcount @see aria-colspan. */ + 'aria-colindex'?: number; + /** Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. + * @see aria-colindex @see aria-rowspan. */ + 'aria-colspan'?: number; + /** Indicates the element that represents the current item within a container or set of related elements. */ + 'aria-current'?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time'; + /** Identifies the element (or elements) that describes the object. + * @see aria-labelledby */ + 'aria-describedby'?: string; + /** Identifies the element that provides a detailed, extended description for the object. + * @see aria-describedby. */ + 'aria-details'?: string; + /** Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. + * @see aria-hidden @see aria-readonly. */ + 'aria-disabled'?: boolean; + /** Indicates what functions can be performed when a dragged object is released on the drop target. + * @deprecated in ARIA 1.1 */ + 'aria-dropeffect'?: 'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup'; + /** Identifies the element that provides an error message for the object. + * @see aria-invalid @see aria-describedby. */ + 'aria-errormessage'?: string; + /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */ + 'aria-expanded'?: boolean; + /** Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, + * allows assistive technology to override the general default of reading in document source order. */ + 'aria-flowto'?: string; + /** Indicates an element's "grabbed" state in a drag-and-drop operation. + * @deprecated in ARIA 1.1 */ + 'aria-grabbed'?: boolean; + /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an + * element. */ + 'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'; + /** Indicates whether the element is exposed to an accessibility API. + * @see aria-disabled. */ + 'aria-hidden'?: boolean; + /** Indicates the entered value does not conform to the format expected by the application. + * @see aria-errormessage. */ + 'aria-invalid'?: boolean | 'false' | 'true' | 'grammar' | 'spelling'; + /** Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. */ + 'aria-keyshortcuts'?: string; + /** Defines a string value that labels the current element. + * @see aria-labelledby. */ + 'aria-label'?: string; + /** Identifies the element (or elements) that labels the current element. + * @see aria-describedby. */ + 'aria-labelledby'?: string; + /** Defines the hierarchical level of an element within a structure. */ + 'aria-level'?: number; + /** Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, + * and user can expect from the live region. */ + 'aria-live'?: 'off' | 'assertive' | 'polite'; + /** Indicates whether an element is modal when displayed. */ + 'aria-modal'?: boolean; + /** Indicates whether a text box accepts multiple lines of input or only a single line. */ + 'aria-multiline'?: boolean; + /** Indicates that the user may select more than one item from the current selectable descendants. */ + 'aria-multiselectable'?: boolean; + /** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */ + 'aria-orientation'?: 'undefined' | 'horizontal' | 'vertical'; + /** Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship + * between DOM + * elements where the DOM hierarchy cannot be used to represent the relationship. + * @see aria-controls. */ + 'aria-owns'?: string; + /** Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. + * A hint could be a sample value or a brief description of the expected format. */ + 'aria-placeholder'?: string; + /** Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in + * the set are present in the DOM. + * @see aria-setsize. */ + 'aria-posinset'?: number; + /** Indicates the current "pressed" state of toggle buttons. + * @see aria-checked @see aria-selected. */ + 'aria-pressed'?: boolean | 'undefined' | 'false' | 'mixed' | 'true'; + /** Indicates that the element is not editable, but is otherwise operable. + * @see aria-disabled. */ + 'aria-readonly'?: boolean; + /** Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified. + * @see aria-atomic. */ + 'aria-relevant'?: 'additions' | 'additions text' | 'all' | 'removals' | 'text'; + /** Indicates that user input is required on the element before a form may be submitted. */ + 'aria-required'?: boolean; + /** Defines a human-readable, author-localized description for the role of an element. */ + 'aria-roledescription'?: string; + /** Defines the total number of rows in a table, grid, or treegrid. + * @see aria-rowindex. */ + 'aria-rowcount'?: number; + /** Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid. + * @see aria-rowcount @see aria-rowspan. */ + 'aria-rowindex'?: number; + /** Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid. + * @see aria-rowindex @see aria-colspan. */ + 'aria-rowspan'?: number; + /** Indicates the current "selected" state of various widgets. + * @see aria-checked @see aria-pressed. */ + 'aria-selected'?: boolean | 'undefined' | 'false' | 'true'; + /** Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are + * present in the DOM. + * @see aria-posinset. */ + 'aria-setsize'?: number; + /** Indicates if items in a table or grid are sorted in ascending or descending order. */ + 'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other'; + /** Defines the maximum allowed value for a range widget. */ + 'aria-valuemax'?: number; + /** Defines the minimum allowed value for a range widget. */ + 'aria-valuemin'?: number; + /** Defines the current value for a range widget. + * @see aria-valuetext. */ + 'aria-valuenow'?: number; + /** Defines the human readable text alternative of aria-valuenow for a range widget. */ + 'aria-valuetext'?: string; + } + interface AllHTMLAttributes extends HTMLAttributes { // Standard HTML Attributes accept?: string; diff --git a/types/react/v15/index.d.ts b/types/react/v15/index.d.ts index 12b25439aa..72a14d9abb 100644 --- a/types/react/v15/index.d.ts +++ b/types/react/v15/index.d.ts @@ -2428,6 +2428,142 @@ declare namespace React { unselectable?: boolean; } + // All the WAI-ARIA 1.1 attributes + // https://www.w3.org/TR/wai-aria-1.1/ + interface HTMLAttributes extends DOMAttributes { + /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */ + 'aria-activedescendant'?: string; + /** Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change + * notifications defined by the aria-relevant attribute. */ + 'aria-atomic'?: boolean; + /** Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for + * an input and specifies how predictions would be presented if they are made. */ + 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both'; + /** Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are + * complete before exposing them to the user. */ + 'aria-busy'?: boolean; + /** Indicates the current "checked" state of checkboxes, radio buttons, and other widgets. + * @see aria-pressed @see aria-selected. */ + 'aria-checked'?: boolean | 'false' | 'mixed' | 'true'; + /** Defines the total number of columns in a table, grid, or treegrid. + * @see aria-colindex. */ + 'aria-colcount'?: number; + /** Defines an element's column index or position with respect to the total number of columns within a table, grid, or + * treegrid. + * @see aria-colcount @see aria-colspan. */ + 'aria-colindex'?: number; + /** Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. + * @see aria-colindex @see aria-rowspan. */ + 'aria-colspan'?: number; + /** Indicates the element that represents the current item within a container or set of related elements. */ + 'aria-current'?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time'; + /** Identifies the element (or elements) that describes the object. + * @see aria-labelledby */ + 'aria-describedby'?: string; + /** Identifies the element that provides a detailed, extended description for the object. + * @see aria-describedby. */ + 'aria-details'?: string; + /** Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. + * @see aria-hidden @see aria-readonly. */ + 'aria-disabled'?: boolean; + /** Indicates what functions can be performed when a dragged object is released on the drop target. + * @deprecated in ARIA 1.1 */ + 'aria-dropeffect'?: 'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup'; + /** Identifies the element that provides an error message for the object. + * @see aria-invalid @see aria-describedby. */ + 'aria-errormessage'?: string; + /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */ + 'aria-expanded'?: boolean; + /** Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, + * allows assistive technology to override the general default of reading in document source order. */ + 'aria-flowto'?: string; + /** Indicates an element's "grabbed" state in a drag-and-drop operation. + * @deprecated in ARIA 1.1 */ + 'aria-grabbed'?: boolean; + /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an + * element. */ + 'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'; + /** Indicates whether the element is exposed to an accessibility API. + * @see aria-disabled. */ + 'aria-hidden'?: boolean; + /** Indicates the entered value does not conform to the format expected by the application. + * @see aria-errormessage. */ + 'aria-invalid'?: boolean | 'false' | 'true' | 'grammar' | 'spelling'; + /** Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. */ + 'aria-keyshortcuts'?: string; + /** Defines a string value that labels the current element. + * @see aria-labelledby. */ + 'aria-label'?: string; + /** Identifies the element (or elements) that labels the current element. + * @see aria-describedby. */ + 'aria-labelledby'?: string; + /** Defines the hierarchical level of an element within a structure. */ + 'aria-level'?: number; + /** Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, + * and user can expect from the live region. */ + 'aria-live'?: 'off' | 'assertive' | 'polite'; + /** Indicates whether an element is modal when displayed. */ + 'aria-modal'?: boolean; + /** Indicates whether a text box accepts multiple lines of input or only a single line. */ + 'aria-multiline'?: boolean; + /** Indicates that the user may select more than one item from the current selectable descendants. */ + 'aria-multiselectable'?: boolean; + /** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */ + 'aria-orientation'?: 'undefined' | 'horizontal' | 'vertical'; + /** Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship + * between DOM + * elements where the DOM hierarchy cannot be used to represent the relationship. + * @see aria-controls. */ + 'aria-owns'?: string; + /** Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. + * A hint could be a sample value or a brief description of the expected format. */ + 'aria-placeholder'?: string; + /** Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in + * the set are present in the DOM. + * @see aria-setsize. */ + 'aria-posinset'?: number; + /** Indicates the current "pressed" state of toggle buttons. + * @see aria-checked @see aria-selected. */ + 'aria-pressed'?: boolean | 'undefined' | 'false' | 'mixed' | 'true'; + /** Indicates that the element is not editable, but is otherwise operable. + * @see aria-disabled. */ + 'aria-readonly'?: boolean; + /** Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified. + * @see aria-atomic. */ + 'aria-relevant'?: 'additions' | 'additions text' | 'all' | 'removals' | 'text'; + /** Indicates that user input is required on the element before a form may be submitted. */ + 'aria-required'?: boolean; + /** Defines a human-readable, author-localized description for the role of an element. */ + 'aria-roledescription'?: string; + /** Defines the total number of rows in a table, grid, or treegrid. + * @see aria-rowindex. */ + 'aria-rowcount'?: number; + /** Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid. + * @see aria-rowcount @see aria-rowspan. */ + 'aria-rowindex'?: number; + /** Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid. + * @see aria-rowindex @see aria-colspan. */ + 'aria-rowspan'?: number; + /** Indicates the current "selected" state of various widgets. + * @see aria-checked @see aria-pressed. */ + 'aria-selected'?: boolean | 'undefined' | 'false' | 'true'; + /** Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are + * present in the DOM. + * @see aria-posinset. */ + 'aria-setsize'?: number; + /** Indicates if items in a table or grid are sorted in ascending or descending order. */ + 'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other'; + /** Defines the maximum allowed value for a range widget. */ + 'aria-valuemax'?: number; + /** Defines the minimum allowed value for a range widget. */ + 'aria-valuemin'?: number; + /** Defines the current value for a range widget. + * @see aria-valuetext. */ + 'aria-valuenow'?: number; + /** Defines the human readable text alternative of aria-valuenow for a range widget. */ + 'aria-valuetext'?: string; + } + interface AllHTMLAttributes extends HTMLAttributes { // Standard HTML Attributes accept?: string; From 8ffe91a4d8eb3f647c6548a7c91ed0f180f37225 Mon Sep 17 00:00:00 2001 From: Craig Kovatch Date: Fri, 29 Dec 2017 18:05:53 -0800 Subject: [PATCH 0004/2153] Fix linting errors --- types/react/index.d.ts | 191 +++++++++++++--------- types/react/v15/index.d.ts | 313 +++++++++++++++++++++---------------- 2 files changed, 299 insertions(+), 205 deletions(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index a4784caa41..e3c3f53bb8 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -2498,79 +2498,105 @@ declare namespace React { unselectable?: boolean; } - // All the WAI-ARIA 1.1 attributes - // https://www.w3.org/TR/wai-aria-1.1/ + // All the WAI-ARIA 1.1 attributes from https://www.w3.org/TR/wai-aria-1.1/ interface HTMLAttributes extends DOMAttributes { - /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */ + /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */ 'aria-activedescendant'?: string; - /** Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change - * notifications defined by the aria-relevant attribute. */ + /** Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute. */ 'aria-atomic'?: boolean; - /** Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for - * an input and specifies how predictions would be presented if they are made. */ + /** + * Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be + * presented if they are made. + */ 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both'; - /** Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are - * complete before exposing them to the user. */ + /** Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user. */ 'aria-busy'?: boolean; - /** Indicates the current "checked" state of checkboxes, radio buttons, and other widgets. - * @see aria-pressed @see aria-selected. */ + /** + * Indicates the current "checked" state of checkboxes, radio buttons, and other widgets. + * @see aria-pressed @see aria-selected. + */ 'aria-checked'?: boolean | 'false' | 'mixed' | 'true'; - /** Defines the total number of columns in a table, grid, or treegrid. - * @see aria-colindex. */ + /** + * Defines the total number of columns in a table, grid, or treegrid. + * @see aria-colindex. + */ 'aria-colcount'?: number; - /** Defines an element's column index or position with respect to the total number of columns within a table, grid, or - * treegrid. - * @see aria-colcount @see aria-colspan. */ + /** + * Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid. + * @see aria-colcount @see aria-colspan. + */ 'aria-colindex'?: number; - /** Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. - * @see aria-colindex @see aria-rowspan. */ + /** + * Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. + * @see aria-colindex @see aria-rowspan. + */ 'aria-colspan'?: number; /** Indicates the element that represents the current item within a container or set of related elements. */ 'aria-current'?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time'; - /** Identifies the element (or elements) that describes the object. - * @see aria-labelledby */ + /** + * Identifies the element (or elements) that describes the object. + * @see aria-labelledby + */ 'aria-describedby'?: string; - /** Identifies the element that provides a detailed, extended description for the object. - * @see aria-describedby. */ + /** + * Identifies the element that provides a detailed, extended description for the object. + * @see aria-describedby. + */ 'aria-details'?: string; - /** Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. - * @see aria-hidden @see aria-readonly. */ + /** + * Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. + * @see aria-hidden @see aria-readonly. + */ 'aria-disabled'?: boolean; - /** Indicates what functions can be performed when a dragged object is released on the drop target. - * @deprecated in ARIA 1.1 */ + /** + * Indicates what functions can be performed when a dragged object is released on the drop target. + * @deprecated in ARIA 1.1 + */ 'aria-dropeffect'?: 'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup'; - /** Identifies the element that provides an error message for the object. - * @see aria-invalid @see aria-describedby. */ + /** + * Identifies the element that provides an error message for the object. + * @see aria-invalid @see aria-describedby. + */ 'aria-errormessage'?: string; /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */ 'aria-expanded'?: boolean; - /** Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, - * allows assistive technology to override the general default of reading in document source order. */ + /** + * Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, + * allows assistive technology to override the general default of reading in document source order. + */ 'aria-flowto'?: string; - /** Indicates an element's "grabbed" state in a drag-and-drop operation. - * @deprecated in ARIA 1.1 */ + /** + * Indicates an element's "grabbed" state in a drag-and-drop operation. + * @deprecated in ARIA 1.1 + */ 'aria-grabbed'?: boolean; - /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an - * element. */ + /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */ 'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'; - /** Indicates whether the element is exposed to an accessibility API. - * @see aria-disabled. */ + /** + * Indicates whether the element is exposed to an accessibility API. + * @see aria-disabled. + */ 'aria-hidden'?: boolean; - /** Indicates the entered value does not conform to the format expected by the application. - * @see aria-errormessage. */ + /** + * Indicates the entered value does not conform to the format expected by the application. + * @see aria-errormessage. + */ 'aria-invalid'?: boolean | 'false' | 'true' | 'grammar' | 'spelling'; /** Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. */ 'aria-keyshortcuts'?: string; - /** Defines a string value that labels the current element. - * @see aria-labelledby. */ + /** + * Defines a string value that labels the current element. + * @see aria-labelledby. + */ 'aria-label'?: string; - /** Identifies the element (or elements) that labels the current element. - * @see aria-describedby. */ + /** + * Identifies the element (or elements) that labels the current element. + * @see aria-describedby. + */ 'aria-labelledby'?: string; /** Defines the hierarchical level of an element within a structure. */ 'aria-level'?: number; - /** Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, - * and user can expect from the live region. */ + /** Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region. */ 'aria-live'?: 'off' | 'assertive' | 'polite'; /** Indicates whether an element is modal when displayed. */ 'aria-modal'?: boolean; @@ -2580,46 +2606,65 @@ declare namespace React { 'aria-multiselectable'?: boolean; /** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */ 'aria-orientation'?: 'undefined' | 'horizontal' | 'vertical'; - /** Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship - * between DOM - * elements where the DOM hierarchy cannot be used to represent the relationship. - * @see aria-controls. */ + /** + * Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship + * between DOM elements where the DOM hierarchy cannot be used to represent the relationship. + * @see aria-controls. + */ 'aria-owns'?: string; - /** Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. - * A hint could be a sample value or a brief description of the expected format. */ + /** + * Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. + * A hint could be a sample value or a brief description of the expected format. + */ 'aria-placeholder'?: string; - /** Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in - * the set are present in the DOM. - * @see aria-setsize. */ + /** + * Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. + * @see aria-setsize. + */ 'aria-posinset'?: number; - /** Indicates the current "pressed" state of toggle buttons. - * @see aria-checked @see aria-selected. */ + /** + * Indicates the current "pressed" state of toggle buttons. + * @see aria-checked @see aria-selected. + */ 'aria-pressed'?: boolean | 'undefined' | 'false' | 'mixed' | 'true'; - /** Indicates that the element is not editable, but is otherwise operable. - * @see aria-disabled. */ + /** + * Indicates that the element is not editable, but is otherwise operable. + * @see aria-disabled. + */ 'aria-readonly'?: boolean; - /** Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified. - * @see aria-atomic. */ + /** + * Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified. + * @see aria-atomic. + */ 'aria-relevant'?: 'additions' | 'additions text' | 'all' | 'removals' | 'text'; /** Indicates that user input is required on the element before a form may be submitted. */ 'aria-required'?: boolean; /** Defines a human-readable, author-localized description for the role of an element. */ 'aria-roledescription'?: string; - /** Defines the total number of rows in a table, grid, or treegrid. - * @see aria-rowindex. */ + /** + * Defines the total number of rows in a table, grid, or treegrid. + * @see aria-rowindex. + */ 'aria-rowcount'?: number; - /** Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid. - * @see aria-rowcount @see aria-rowspan. */ + /** + * Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid. + * @see aria-rowcount @see aria-rowspan. + */ 'aria-rowindex'?: number; - /** Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid. - * @see aria-rowindex @see aria-colspan. */ + /** + * Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid. + * @see aria-rowindex @see aria-colspan. + */ 'aria-rowspan'?: number; - /** Indicates the current "selected" state of various widgets. - * @see aria-checked @see aria-pressed. */ + /** + * Indicates the current "selected" state of various widgets. + * @see aria-checked @see aria-pressed. + */ 'aria-selected'?: boolean | 'undefined' | 'false' | 'true'; - /** Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are - * present in the DOM. - * @see aria-posinset. */ + /** + * Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. + * @see aria-posinset. + */ 'aria-setsize'?: number; /** Indicates if items in a table or grid are sorted in ascending or descending order. */ 'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other'; @@ -2627,8 +2672,10 @@ declare namespace React { 'aria-valuemax'?: number; /** Defines the minimum allowed value for a range widget. */ 'aria-valuemin'?: number; - /** Defines the current value for a range widget. - * @see aria-valuetext. */ + /** + * Defines the current value for a range widget. + * @see aria-valuetext. + */ 'aria-valuenow'?: number; /** Defines the human readable text alternative of aria-valuenow for a range widget. */ 'aria-valuetext'?: string; diff --git a/types/react/v15/index.d.ts b/types/react/v15/index.d.ts index 72a14d9abb..5169c8d2e8 100644 --- a/types/react/v15/index.d.ts +++ b/types/react/v15/index.d.ts @@ -2428,141 +2428,188 @@ declare namespace React { unselectable?: boolean; } - // All the WAI-ARIA 1.1 attributes - // https://www.w3.org/TR/wai-aria-1.1/ + // All the WAI-ARIA 1.1 attributes from https://www.w3.org/TR/wai-aria-1.1/ interface HTMLAttributes extends DOMAttributes { /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */ - 'aria-activedescendant'?: string; - /** Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change - * notifications defined by the aria-relevant attribute. */ - 'aria-atomic'?: boolean; - /** Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for - * an input and specifies how predictions would be presented if they are made. */ - 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both'; - /** Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are - * complete before exposing them to the user. */ - 'aria-busy'?: boolean; - /** Indicates the current "checked" state of checkboxes, radio buttons, and other widgets. - * @see aria-pressed @see aria-selected. */ - 'aria-checked'?: boolean | 'false' | 'mixed' | 'true'; - /** Defines the total number of columns in a table, grid, or treegrid. - * @see aria-colindex. */ - 'aria-colcount'?: number; - /** Defines an element's column index or position with respect to the total number of columns within a table, grid, or - * treegrid. - * @see aria-colcount @see aria-colspan. */ - 'aria-colindex'?: number; - /** Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. - * @see aria-colindex @see aria-rowspan. */ - 'aria-colspan'?: number; - /** Indicates the element that represents the current item within a container or set of related elements. */ - 'aria-current'?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time'; - /** Identifies the element (or elements) that describes the object. - * @see aria-labelledby */ - 'aria-describedby'?: string; - /** Identifies the element that provides a detailed, extended description for the object. - * @see aria-describedby. */ - 'aria-details'?: string; - /** Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. - * @see aria-hidden @see aria-readonly. */ - 'aria-disabled'?: boolean; - /** Indicates what functions can be performed when a dragged object is released on the drop target. - * @deprecated in ARIA 1.1 */ - 'aria-dropeffect'?: 'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup'; - /** Identifies the element that provides an error message for the object. - * @see aria-invalid @see aria-describedby. */ - 'aria-errormessage'?: string; - /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */ - 'aria-expanded'?: boolean; - /** Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, - * allows assistive technology to override the general default of reading in document source order. */ - 'aria-flowto'?: string; - /** Indicates an element's "grabbed" state in a drag-and-drop operation. - * @deprecated in ARIA 1.1 */ - 'aria-grabbed'?: boolean; - /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an - * element. */ - 'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'; - /** Indicates whether the element is exposed to an accessibility API. - * @see aria-disabled. */ - 'aria-hidden'?: boolean; - /** Indicates the entered value does not conform to the format expected by the application. - * @see aria-errormessage. */ - 'aria-invalid'?: boolean | 'false' | 'true' | 'grammar' | 'spelling'; - /** Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. */ - 'aria-keyshortcuts'?: string; - /** Defines a string value that labels the current element. - * @see aria-labelledby. */ - 'aria-label'?: string; - /** Identifies the element (or elements) that labels the current element. - * @see aria-describedby. */ - 'aria-labelledby'?: string; - /** Defines the hierarchical level of an element within a structure. */ - 'aria-level'?: number; - /** Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, - * and user can expect from the live region. */ - 'aria-live'?: 'off' | 'assertive' | 'polite'; - /** Indicates whether an element is modal when displayed. */ - 'aria-modal'?: boolean; - /** Indicates whether a text box accepts multiple lines of input or only a single line. */ - 'aria-multiline'?: boolean; - /** Indicates that the user may select more than one item from the current selectable descendants. */ - 'aria-multiselectable'?: boolean; - /** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */ - 'aria-orientation'?: 'undefined' | 'horizontal' | 'vertical'; - /** Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship - * between DOM - * elements where the DOM hierarchy cannot be used to represent the relationship. - * @see aria-controls. */ - 'aria-owns'?: string; - /** Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. - * A hint could be a sample value or a brief description of the expected format. */ - 'aria-placeholder'?: string; - /** Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in - * the set are present in the DOM. - * @see aria-setsize. */ - 'aria-posinset'?: number; - /** Indicates the current "pressed" state of toggle buttons. - * @see aria-checked @see aria-selected. */ - 'aria-pressed'?: boolean | 'undefined' | 'false' | 'mixed' | 'true'; - /** Indicates that the element is not editable, but is otherwise operable. - * @see aria-disabled. */ - 'aria-readonly'?: boolean; - /** Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified. - * @see aria-atomic. */ - 'aria-relevant'?: 'additions' | 'additions text' | 'all' | 'removals' | 'text'; - /** Indicates that user input is required on the element before a form may be submitted. */ - 'aria-required'?: boolean; - /** Defines a human-readable, author-localized description for the role of an element. */ - 'aria-roledescription'?: string; - /** Defines the total number of rows in a table, grid, or treegrid. - * @see aria-rowindex. */ - 'aria-rowcount'?: number; - /** Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid. - * @see aria-rowcount @see aria-rowspan. */ - 'aria-rowindex'?: number; - /** Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid. - * @see aria-rowindex @see aria-colspan. */ - 'aria-rowspan'?: number; - /** Indicates the current "selected" state of various widgets. - * @see aria-checked @see aria-pressed. */ - 'aria-selected'?: boolean | 'undefined' | 'false' | 'true'; - /** Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are - * present in the DOM. - * @see aria-posinset. */ - 'aria-setsize'?: number; - /** Indicates if items in a table or grid are sorted in ascending or descending order. */ - 'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other'; - /** Defines the maximum allowed value for a range widget. */ - 'aria-valuemax'?: number; - /** Defines the minimum allowed value for a range widget. */ - 'aria-valuemin'?: number; - /** Defines the current value for a range widget. - * @see aria-valuetext. */ - 'aria-valuenow'?: number; - /** Defines the human readable text alternative of aria-valuenow for a range widget. */ - 'aria-valuetext'?: string; - } + 'aria-activedescendant'?: string; + /** Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute. */ + 'aria-atomic'?: boolean; + /** + * Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be + * presented if they are made. + */ + 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both'; + /** Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user. */ + 'aria-busy'?: boolean; + /** + * Indicates the current "checked" state of checkboxes, radio buttons, and other widgets. + * @see aria-pressed @see aria-selected. + */ + 'aria-checked'?: boolean | 'false' | 'mixed' | 'true'; + /** + * Defines the total number of columns in a table, grid, or treegrid. + * @see aria-colindex. + */ + 'aria-colcount'?: number; + /** + * Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid. + * @see aria-colcount @see aria-colspan. + */ + 'aria-colindex'?: number; + /** + * Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. + * @see aria-colindex @see aria-rowspan. + */ + 'aria-colspan'?: number; + /** Indicates the element that represents the current item within a container or set of related elements. */ + 'aria-current'?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time'; + /** + * Identifies the element (or elements) that describes the object. + * @see aria-labelledby + */ + 'aria-describedby'?: string; + /** + * Identifies the element that provides a detailed, extended description for the object. + * @see aria-describedby. + */ + 'aria-details'?: string; + /** + * Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. + * @see aria-hidden @see aria-readonly. + */ + 'aria-disabled'?: boolean; + /** + * Indicates what functions can be performed when a dragged object is released on the drop target. + * @deprecated in ARIA 1.1 + */ + 'aria-dropeffect'?: 'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup'; + /** + * Identifies the element that provides an error message for the object. + * @see aria-invalid @see aria-describedby. + */ + 'aria-errormessage'?: string; + /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */ + 'aria-expanded'?: boolean; + /** + * Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, + * allows assistive technology to override the general default of reading in document source order. + */ + 'aria-flowto'?: string; + /** + * Indicates an element's "grabbed" state in a drag-and-drop operation. + * @deprecated in ARIA 1.1 + */ + 'aria-grabbed'?: boolean; + /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */ + 'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'; + /** + * Indicates whether the element is exposed to an accessibility API. + * @see aria-disabled. + */ + 'aria-hidden'?: boolean; + /** + * Indicates the entered value does not conform to the format expected by the application. + * @see aria-errormessage. + */ + 'aria-invalid'?: boolean | 'false' | 'true' | 'grammar' | 'spelling'; + /** Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. */ + 'aria-keyshortcuts'?: string; + /** + * Defines a string value that labels the current element. + * @see aria-labelledby. + */ + 'aria-label'?: string; + /** + * Identifies the element (or elements) that labels the current element. + * @see aria-describedby. + */ + 'aria-labelledby'?: string; + /** Defines the hierarchical level of an element within a structure. */ + 'aria-level'?: number; + /** Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region. */ + 'aria-live'?: 'off' | 'assertive' | 'polite'; + /** Indicates whether an element is modal when displayed. */ + 'aria-modal'?: boolean; + /** Indicates whether a text box accepts multiple lines of input or only a single line. */ + 'aria-multiline'?: boolean; + /** Indicates that the user may select more than one item from the current selectable descendants. */ + 'aria-multiselectable'?: boolean; + /** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */ + 'aria-orientation'?: 'undefined' | 'horizontal' | 'vertical'; + /** + * Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship + * between DOM elements where the DOM hierarchy cannot be used to represent the relationship. + * @see aria-controls. + */ + 'aria-owns'?: string; + /** + * Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. + * A hint could be a sample value or a brief description of the expected format. + */ + 'aria-placeholder'?: string; + /** + * Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. + * @see aria-setsize. + */ + 'aria-posinset'?: number; + /** + * Indicates the current "pressed" state of toggle buttons. + * @see aria-checked @see aria-selected. + */ + 'aria-pressed'?: boolean | 'undefined' | 'false' | 'mixed' | 'true'; + /** + * Indicates that the element is not editable, but is otherwise operable. + * @see aria-disabled. + */ + 'aria-readonly'?: boolean; + /** + * Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified. + * @see aria-atomic. + */ + 'aria-relevant'?: 'additions' | 'additions text' | 'all' | 'removals' | 'text'; + /** Indicates that user input is required on the element before a form may be submitted. */ + 'aria-required'?: boolean; + /** Defines a human-readable, author-localized description for the role of an element. */ + 'aria-roledescription'?: string; + /** + * Defines the total number of rows in a table, grid, or treegrid. + * @see aria-rowindex. + */ + 'aria-rowcount'?: number; + /** + * Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid. + * @see aria-rowcount @see aria-rowspan. + */ + 'aria-rowindex'?: number; + /** + * Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid. + * @see aria-rowindex @see aria-colspan. + */ + 'aria-rowspan'?: number; + /** + * Indicates the current "selected" state of various widgets. + * @see aria-checked @see aria-pressed. + */ + 'aria-selected'?: boolean | 'undefined' | 'false' | 'true'; + /** + * Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. + * @see aria-posinset. + */ + 'aria-setsize'?: number; + /** Indicates if items in a table or grid are sorted in ascending or descending order. */ + 'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other'; + /** Defines the maximum allowed value for a range widget. */ + 'aria-valuemax'?: number; + /** Defines the minimum allowed value for a range widget. */ + 'aria-valuemin'?: number; + /** + * Defines the current value for a range widget. + * @see aria-valuetext. + */ + 'aria-valuenow'?: number; + /** Defines the human readable text alternative of aria-valuenow for a range widget. */ + 'aria-valuetext'?: string; + } interface AllHTMLAttributes extends HTMLAttributes { // Standard HTML Attributes From 6e0532c130119f75734ccb934baf22974b889749 Mon Sep 17 00:00:00 2001 From: AJ Richardson Date: Tue, 2 Jan 2018 09:06:13 -0500 Subject: [PATCH 0005/2153] lodash: add one more NumericDictionary overload for _.get --- types/lodash/index.d.ts | 24 ++++++++++++++++++++++++ types/lodash/lodash-tests.ts | 10 +++++----- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/types/lodash/index.d.ts b/types/lodash/index.d.ts index cc90e15559..00a1cd63b2 100644 --- a/types/lodash/index.d.ts +++ b/types/lodash/index.d.ts @@ -13372,6 +13372,14 @@ declare namespace _ { defaultValue: TDefault ): TObject[TKey] | TDefault; + /** + * @see _.get + */ + get( + object: NumericDictionary, + path: number + ): T; + /** * @see _.get */ @@ -13441,6 +13449,14 @@ declare namespace _ { defaultValue: TDefault ): TObject[TKey] | TDefault; + /** + * @see _.get + */ + get( + this: LoDashImplicitWrapper>, + path: number + ): T; + /** * @see _.get */ @@ -13509,6 +13525,14 @@ declare namespace _ { defaultValue: TDefault ): LoDashExplicitWrapper; + /** + * @see _.get + */ + get( + this: LoDashExplicitWrapper>, + path: number + ): LoDashExplicitWrapper; + /** * @see _.get */ diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index fe1f1eb9ca..d3886537a1 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -11266,9 +11266,9 @@ namespace TestGet { _.get([], Symbol.iterator); _.get([], [Symbol.iterator]); - _.get('abc', 4); // $ExpectType string | undefined - _('abc').get(4); // $ExpectType string | undefined - _.chain('abc').get(4); // $ExpectType LoDashExplicitWrapper + _.get('abc', 4); // $ExpectType string + _('abc').get(4); // $ExpectType string + _.chain('abc').get(4); // $ExpectType LoDashExplicitWrapper _.get({ a: { b: true } }, "a"); // $ExpectType { b: boolean; } _({ a: { b: true } }).get("a"); // $ExpectType { b: boolean; } @@ -11338,7 +11338,7 @@ namespace TestGet { result = _({a: true}).get(['a']); result = _({a: true}).get(['a'], false); } -/* + { let result: _.LoDashExplicitWrapper; @@ -11364,7 +11364,7 @@ namespace TestGet { result = _({a: true}).chain().get('a', false); result = _({a: true}).chain().get(['a']); result = _({a: true}).chain().get(['a'], false); - }*/ + } } // _.has From 5b606cac973d358d6c5141fea915a03b124b16d3 Mon Sep 17 00:00:00 2001 From: AJ Richardson Date: Wed, 3 Jan 2018 18:46:29 -0500 Subject: [PATCH 0006/2153] lodash: more reasonable index for _.get tests --- types/lodash/lodash-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index d3886537a1..69fe88b341 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -11266,9 +11266,9 @@ namespace TestGet { _.get([], Symbol.iterator); _.get([], [Symbol.iterator]); - _.get('abc', 4); // $ExpectType string - _('abc').get(4); // $ExpectType string - _.chain('abc').get(4); // $ExpectType LoDashExplicitWrapper + _.get('abc', 1); // $ExpectType string + _('abc').get(1); // $ExpectType string + _.chain('abc').get(1); // $ExpectType LoDashExplicitWrapper _.get({ a: { b: true } }, "a"); // $ExpectType { b: boolean; } _({ a: { b: true } }).get("a"); // $ExpectType { b: boolean; } From eebfcef80eec96a3c823b0e73e32f297050241bf Mon Sep 17 00:00:00 2001 From: Craig Kovatch Date: Thu, 4 Jan 2018 14:23:28 -0800 Subject: [PATCH 0007/2153] Add 'true' and 'false' options to boolean attributes, remove incorrect 'undefined' options --- types/react/index.d.ts | 28 ++++++++++++++-------------- types/react/v15/index.d.ts | 28 ++++++++++++++-------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index e3c3f53bb8..9277ed2986 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -2503,14 +2503,14 @@ declare namespace React { /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */ 'aria-activedescendant'?: string; /** Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute. */ - 'aria-atomic'?: boolean; + 'aria-atomic'?: boolean | 'false' | 'true'; /** * Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be * presented if they are made. */ 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both'; /** Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user. */ - 'aria-busy'?: boolean; + 'aria-busy'?: boolean | 'false' | 'true'; /** * Indicates the current "checked" state of checkboxes, radio buttons, and other widgets. * @see aria-pressed @see aria-selected. @@ -2547,7 +2547,7 @@ declare namespace React { * Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. * @see aria-hidden @see aria-readonly. */ - 'aria-disabled'?: boolean; + 'aria-disabled'?: boolean | 'false' | 'true'; /** * Indicates what functions can be performed when a dragged object is released on the drop target. * @deprecated in ARIA 1.1 @@ -2559,7 +2559,7 @@ declare namespace React { */ 'aria-errormessage'?: string; /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */ - 'aria-expanded'?: boolean; + 'aria-expanded'?: boolean | 'false' | 'true'; /** * Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, * allows assistive technology to override the general default of reading in document source order. @@ -2569,14 +2569,14 @@ declare namespace React { * Indicates an element's "grabbed" state in a drag-and-drop operation. * @deprecated in ARIA 1.1 */ - 'aria-grabbed'?: boolean; + 'aria-grabbed'?: boolean | 'false' | 'true'; /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */ 'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'; /** * Indicates whether the element is exposed to an accessibility API. * @see aria-disabled. */ - 'aria-hidden'?: boolean; + 'aria-hidden'?: boolean | 'false' | 'true'; /** * Indicates the entered value does not conform to the format expected by the application. * @see aria-errormessage. @@ -2599,13 +2599,13 @@ declare namespace React { /** Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region. */ 'aria-live'?: 'off' | 'assertive' | 'polite'; /** Indicates whether an element is modal when displayed. */ - 'aria-modal'?: boolean; + 'aria-modal'?: boolean | 'false' | 'true'; /** Indicates whether a text box accepts multiple lines of input or only a single line. */ - 'aria-multiline'?: boolean; + 'aria-multiline'?: boolean | 'false' | 'true'; /** Indicates that the user may select more than one item from the current selectable descendants. */ - 'aria-multiselectable'?: boolean; + 'aria-multiselectable'?: boolean | 'false' | 'true'; /** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */ - 'aria-orientation'?: 'undefined' | 'horizontal' | 'vertical'; + 'aria-orientation'?: 'horizontal' | 'vertical'; /** * Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship * between DOM elements where the DOM hierarchy cannot be used to represent the relationship. @@ -2626,19 +2626,19 @@ declare namespace React { * Indicates the current "pressed" state of toggle buttons. * @see aria-checked @see aria-selected. */ - 'aria-pressed'?: boolean | 'undefined' | 'false' | 'mixed' | 'true'; + 'aria-pressed'?: boolean | 'false' | 'mixed' | 'true'; /** * Indicates that the element is not editable, but is otherwise operable. * @see aria-disabled. */ - 'aria-readonly'?: boolean; + 'aria-readonly'?: boolean | 'false' | 'true'; /** * Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified. * @see aria-atomic. */ 'aria-relevant'?: 'additions' | 'additions text' | 'all' | 'removals' | 'text'; /** Indicates that user input is required on the element before a form may be submitted. */ - 'aria-required'?: boolean; + 'aria-required'?: boolean | 'false' | 'true'; /** Defines a human-readable, author-localized description for the role of an element. */ 'aria-roledescription'?: string; /** @@ -2660,7 +2660,7 @@ declare namespace React { * Indicates the current "selected" state of various widgets. * @see aria-checked @see aria-pressed. */ - 'aria-selected'?: boolean | 'undefined' | 'false' | 'true'; + 'aria-selected'?: boolean | 'false' | 'true'; /** * Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. * @see aria-posinset. diff --git a/types/react/v15/index.d.ts b/types/react/v15/index.d.ts index 5169c8d2e8..797d21f0d8 100644 --- a/types/react/v15/index.d.ts +++ b/types/react/v15/index.d.ts @@ -2433,14 +2433,14 @@ declare namespace React { /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */ 'aria-activedescendant'?: string; /** Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute. */ - 'aria-atomic'?: boolean; + 'aria-atomic'?: boolean | 'false' | 'true'; /** * Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be * presented if they are made. */ 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both'; /** Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user. */ - 'aria-busy'?: boolean; + 'aria-busy'?: boolean | 'false' | 'true'; /** * Indicates the current "checked" state of checkboxes, radio buttons, and other widgets. * @see aria-pressed @see aria-selected. @@ -2477,7 +2477,7 @@ declare namespace React { * Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. * @see aria-hidden @see aria-readonly. */ - 'aria-disabled'?: boolean; + 'aria-disabled'?: boolean | 'false' | 'true'; /** * Indicates what functions can be performed when a dragged object is released on the drop target. * @deprecated in ARIA 1.1 @@ -2489,7 +2489,7 @@ declare namespace React { */ 'aria-errormessage'?: string; /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */ - 'aria-expanded'?: boolean; + 'aria-expanded'?: boolean | 'false' | 'true'; /** * Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, * allows assistive technology to override the general default of reading in document source order. @@ -2499,14 +2499,14 @@ declare namespace React { * Indicates an element's "grabbed" state in a drag-and-drop operation. * @deprecated in ARIA 1.1 */ - 'aria-grabbed'?: boolean; + 'aria-grabbed'?: boolean | 'false' | 'true'; /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */ 'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'; /** * Indicates whether the element is exposed to an accessibility API. * @see aria-disabled. */ - 'aria-hidden'?: boolean; + 'aria-hidden'?: boolean | 'false' | 'true'; /** * Indicates the entered value does not conform to the format expected by the application. * @see aria-errormessage. @@ -2529,13 +2529,13 @@ declare namespace React { /** Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region. */ 'aria-live'?: 'off' | 'assertive' | 'polite'; /** Indicates whether an element is modal when displayed. */ - 'aria-modal'?: boolean; + 'aria-modal'?: boolean | 'false' | 'true'; /** Indicates whether a text box accepts multiple lines of input or only a single line. */ - 'aria-multiline'?: boolean; + 'aria-multiline'?: boolean | 'false' | 'true'; /** Indicates that the user may select more than one item from the current selectable descendants. */ - 'aria-multiselectable'?: boolean; + 'aria-multiselectable'?: boolean | 'false' | 'true'; /** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */ - 'aria-orientation'?: 'undefined' | 'horizontal' | 'vertical'; + 'aria-orientation'?: 'horizontal' | 'vertical'; /** * Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship * between DOM elements where the DOM hierarchy cannot be used to represent the relationship. @@ -2556,19 +2556,19 @@ declare namespace React { * Indicates the current "pressed" state of toggle buttons. * @see aria-checked @see aria-selected. */ - 'aria-pressed'?: boolean | 'undefined' | 'false' | 'mixed' | 'true'; + 'aria-pressed'?: boolean | 'false' | 'mixed' | 'true'; /** * Indicates that the element is not editable, but is otherwise operable. * @see aria-disabled. */ - 'aria-readonly'?: boolean; + 'aria-readonly'?: boolean | 'false' | 'true'; /** * Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified. * @see aria-atomic. */ 'aria-relevant'?: 'additions' | 'additions text' | 'all' | 'removals' | 'text'; /** Indicates that user input is required on the element before a form may be submitted. */ - 'aria-required'?: boolean; + 'aria-required'?: boolean | 'false' | 'true'; /** Defines a human-readable, author-localized description for the role of an element. */ 'aria-roledescription'?: string; /** @@ -2590,7 +2590,7 @@ declare namespace React { * Indicates the current "selected" state of various widgets. * @see aria-checked @see aria-pressed. */ - 'aria-selected'?: boolean | 'undefined' | 'false' | 'true'; + 'aria-selected'?: boolean | 'false' | 'true'; /** * Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. * @see aria-posinset. From 0565f573b66721dd76b625ed3696ecc561d8b95d Mon Sep 17 00:00:00 2001 From: Craig Kovatch Date: Sat, 6 Jan 2018 11:11:44 -0800 Subject: [PATCH 0008/2153] Add tests --- types/react/test/index.ts | 6 +++++- types/react/test/tsx.tsx | 11 +++++++++++ types/react/v15/test/index.ts | 6 +++++- types/react/v15/test/tsx.tsx | 11 +++++++++++ 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/types/react/test/index.ts b/types/react/test/index.ts index e8aabfa35c..06a72c2bcb 100644 --- a/types/react/test/index.ts +++ b/types/react/test/index.ts @@ -307,7 +307,11 @@ const htmlAttr: React.HTMLProps = { }, dangerouslySetInnerHTML: { __html: "STRONG" - } + }, + 'aria-atomic': false, + 'aria-checked': 'true', + 'aria-colcount': 7, + 'aria-label': 'test' }; DOM.div(htmlAttr); DOM.span(htmlAttr); diff --git a/types/react/test/tsx.tsx b/types/react/test/tsx.tsx index 38d902c387..26c2ff9d41 100644 --- a/types/react/test/tsx.tsx +++ b/types/react/test/tsx.tsx @@ -41,6 +41,17 @@ StatelessComponent2.defaultProps = { foo ; +// WAI-ARIA 1.1 Attributes +
+ bar +
; + interface Props { hello: string; } diff --git a/types/react/v15/test/index.ts b/types/react/v15/test/index.ts index 340ea94ec2..e4b324916d 100644 --- a/types/react/v15/test/index.ts +++ b/types/react/v15/test/index.ts @@ -346,7 +346,11 @@ const htmlAttr: React.HTMLProps = { }, dangerouslySetInnerHTML: { __html: "STRONG" - } + }, + 'aria-atomic': false, + 'aria-checked': 'true', + 'aria-colcount': 7, + 'aria-label': 'test' }; React.DOM.div(htmlAttr); React.DOM.span(htmlAttr); diff --git a/types/react/v15/test/tsx.tsx b/types/react/v15/test/tsx.tsx index 8afb75d9a8..7f781cb8fc 100644 --- a/types/react/v15/test/tsx.tsx +++ b/types/react/v15/test/tsx.tsx @@ -41,6 +41,17 @@ StatelessComponent2.defaultProps = { foo ; +// WAI-ARIA 1.1 Attributes +
+ bar +
; + interface Props { hello: string; } From b540b2e9e0f95ebb59798bbf4dff5d8c36dd5041 Mon Sep 17 00:00:00 2001 From: Craig Kovatch Date: Sat, 6 Jan 2018 11:13:19 -0800 Subject: [PATCH 0009/2153] Revert incorrect use of $ExpectError --- types/react/test/tsx.tsx | 1 - types/react/v15/test/tsx.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/types/react/test/tsx.tsx b/types/react/test/tsx.tsx index 26c2ff9d41..bc48add9a4 100644 --- a/types/react/test/tsx.tsx +++ b/types/react/test/tsx.tsx @@ -47,7 +47,6 @@ StatelessComponent2.defaultProps = { aria-checked='true' aria-colcount={7} aria-label='test' - ariaExpanded='false' // $ExpectError > bar ; diff --git a/types/react/v15/test/tsx.tsx b/types/react/v15/test/tsx.tsx index 7f781cb8fc..289a912a3f 100644 --- a/types/react/v15/test/tsx.tsx +++ b/types/react/v15/test/tsx.tsx @@ -47,7 +47,6 @@ StatelessComponent2.defaultProps = { aria-checked='true' aria-colcount={7} aria-label='test' - ariaExpanded='false' // $ExpectError > bar ; From 3cda7bec3b72d0fb0b2d1ca554939856c620c512 Mon Sep 17 00:00:00 2001 From: Jovica Zoric Date: Thu, 11 Jan 2018 15:14:01 +0100 Subject: [PATCH 0010/2153] Add missing placeholderRenderer prop --- types/react-sortable-tree/index.d.ts | 9 +++++++++ .../react-sortable-tree/react-sortable-tree-tests.tsx | 11 ++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/types/react-sortable-tree/index.d.ts b/types/react-sortable-tree/index.d.ts index dfed930e2f..2b9d1d1a6c 100644 --- a/types/react-sortable-tree/index.d.ts +++ b/types/react-sortable-tree/index.d.ts @@ -87,6 +87,14 @@ export interface NodeRendererProps { canDrop?: boolean; } +export type PlaceholderRenderer = React.ComponentClass; + +export interface PlaceholderRendererProps { + isOver: boolean; + canDrop: boolean; + draggedNode: {[index: string]: any}; +} + type NumberArrayOrStringArray = string[] | number[]; export interface ReactSortableTreeProps { @@ -113,6 +121,7 @@ export interface ReactSortableTreeProps { isVirtualized?: boolean; nodeContentRenderer?: NodeRenderer; dndType?: string; + placeholderRenderer?: PlaceholderRenderer; } declare const SortableTree: React.ComponentClass; diff --git a/types/react-sortable-tree/react-sortable-tree-tests.tsx b/types/react-sortable-tree/react-sortable-tree-tests.tsx index 106415744b..154a7284c6 100644 --- a/types/react-sortable-tree/react-sortable-tree-tests.tsx +++ b/types/react-sortable-tree/react-sortable-tree-tests.tsx @@ -11,10 +11,18 @@ import SortableTree, ExtendedNodeData, FullTree, OnVisibilityToggleData, - PreviousAnNextLocation + PreviousAnNextLocation, + PlaceholderRendererProps } from "react-sortable-tree"; import { ListProps, ListRowRenderer } from "react-virtualized"; +class PlaceholderRenderer extends React.Component { + render() { + const backgroundColor = this.props.isOver ? 'green' : 'red'; + return
Custom Placeholder class
; + } +} + class Test extends React.Component { render() { const treeData = [ @@ -55,6 +63,7 @@ class Test extends React.Component { isVirtualized={true} nodeContentRenderer={nodeRenderer} dndType="testNodeType" + placeholderRenderer={PlaceholderRenderer} /> Date: Wed, 17 Jan 2018 16:39:49 +0900 Subject: [PATCH 0011/2153] Adding definition for Database#configure --- types/sqlite3/index.d.ts | 2 ++ types/sqlite3/sqlite3-tests.ts | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/types/sqlite3/index.d.ts b/types/sqlite3/index.d.ts index 921845e5a0..26f69d526d 100644 --- a/types/sqlite3/index.d.ts +++ b/types/sqlite3/index.d.ts @@ -83,6 +83,8 @@ export class Database extends events.EventEmitter { on(event: "error", listener: (err: Error) => void): this; on(event: "open" | "close", listener: () => void): this; on(event: string, listener: (...args: any[]) => void): this; + + configure(option: "busyTimeout", value: number): void; } export function verbose(): void; diff --git a/types/sqlite3/sqlite3-tests.ts b/types/sqlite3/sqlite3-tests.ts index 4ddfa0a502..ee5e4b17d7 100644 --- a/types/sqlite3/sqlite3-tests.ts +++ b/types/sqlite3/sqlite3-tests.ts @@ -5,7 +5,8 @@ let db: sqlite3.Database = new sqlite3.Database('chain.sqlite3', () => {}); function createDb() { console.log("createDb chain"); - db = new sqlite3.Database('chain.sqlite3', createTable); + db = new sqlite3.Database('chain.sqlite3', createTable); + db.configure("busyTimeout", 1000); } function createTable() { From 1621caf0dfdceac25e5ecc5748184c9edcefb079 Mon Sep 17 00:00:00 2001 From: Mathieu Masy Date: Mon, 5 Feb 2018 16:57:56 -0500 Subject: [PATCH 0012/2153] [react-form] Updated typings --- types/react-form/index.d.ts | 9 ++++-- types/react-form/react-form-tests.tsx | 44 +++++++++++++++++++++++++++ types/react-form/tsconfig.json | 2 +- 3 files changed, 52 insertions(+), 3 deletions(-) diff --git a/types/react-form/index.d.ts b/types/react-form/index.d.ts index 965f55e7e7..debc89488c 100644 --- a/types/react-form/index.d.ts +++ b/types/react-form/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for react-form 2.12 +// Type definitions for react-form 2.16 // Project: https://github.com/tannerlinsley/react-form#readme // Definitions by: Cameron McAteer +// Mathieu Masy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -18,7 +19,7 @@ export interface FormErrors { [key: string]: FormError; } export type NestedErrors = Nested; -export type RenderReturn = JSX.Element | false | null; +export type RenderReturn = JSX.Element | false | null | never[]; export interface FormState { values: FormValues; @@ -29,7 +30,10 @@ export interface FormState { } export interface FormProps { + component?: React.ReactType<{ formApi: FormApi }>; + render?: (formApi: FormApi) => RenderReturn; dontValidateOnMount?: boolean; + validateOnSubmit?: boolean; defaultValues?: FormValues; onSubmit?(values: FormValues, submissionEvent: React.SyntheticEvent, formApi: FormApi): void; preSubmit?(values: FormValues, formApi: FormApi): FormValues; @@ -43,6 +47,7 @@ export interface FormProps { [field: string]: (value: FormValue) => Promise }; dontPreventDefault?: boolean; + getApi?: (formApi: FormApi) => void; } export interface FormApi { diff --git a/types/react-form/react-form-tests.tsx b/types/react-form/react-form-tests.tsx index 2d08cc4b8a..36aa86db94 100644 --- a/types/react-form/react-form-tests.tsx +++ b/types/react-form/react-form-tests.tsx @@ -21,6 +21,50 @@ import { FormApi } from 'react-form'; +// Form Api +class FormApiMethods extends React.Component { + constructor(props: {}) { + super(props); + this.state = {}; + } + + render() { + const FormContent = (props: { formApi?: FormApi }) => ( +
{}}> + + + + ); + + return ( +
+
+ { formApi => ( + + + + + )} + + +
( + + + + + )}> + + +
+ + + +
+
+ ); + } +} + // Basic Form Example const statusOptions = [ { diff --git a/types/react-form/tsconfig.json b/types/react-form/tsconfig.json index cc5dcb26ba..43d05d6dc6 100644 --- a/types/react-form/tsconfig.json +++ b/types/react-form/tsconfig.json @@ -23,4 +23,4 @@ "index.d.ts", "react-form-tests.tsx" ] -} \ No newline at end of file +} From 3eb8d0c31adb111d48011296ae2ddaec327143fa Mon Sep 17 00:00:00 2001 From: Mathieu Masy Date: Wed, 7 Feb 2018 14:20:16 -0500 Subject: [PATCH 0013/2153] [react-form] Added placeholder prop on Select component --- types/react-form/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react-form/index.d.ts b/types/react-form/index.d.ts index debc89488c..4dc7e4b1b2 100644 --- a/types/react-form/index.d.ts +++ b/types/react-form/index.d.ts @@ -142,6 +142,7 @@ export type SelectOptions = Array<{ export interface SelectProps extends FieldProps, React.SelectHTMLAttributes { options: SelectOptions; + placeholder: string; } export const Select: React.StatelessComponent; From 4c8fb4edcb6567474e00564e0431cbffa8e93b1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B8is=C3=A6ther=20Rasch?= Date: Tue, 13 Feb 2018 22:03:10 +0100 Subject: [PATCH 0014/2153] add new chrome.devtools.inspectedWindow.eval overload Additional Overload accepts the new optional options parameter. fixes https://github.com/DefinitelyTyped/DefinitelyTyped/issues/23597 --- types/chrome/index.d.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index cd12179213..8d3a8a80ab 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -1678,6 +1678,17 @@ declare namespace chrome.devtools.inspectedWindow { * Parameter exceptionInfo: An object providing details if an exception occurred while evaluating the expression. */ export function eval(expression: string, callback?: (result: T, exceptionInfo: EvaluationExceptionInfo) => void): void; + /** + * Evaluates a JavaScript expression in the context of the main frame of the inspected page. The expression must evaluate to a JSON-compliant object, otherwise an exception is thrown. The eval function can report either a DevTools-side error or a JavaScript exception that occurs during evaluation. In either case, the result parameter of the callback is undefined. In the case of a DevTools-side error, the isException parameter is non-null and has isError set to true and code set to an error code. In the case of a JavaScript error, isException is set to true and value is set to the string value of thrown object. + * @param expression An expression to evaluate. + * @param options The options parameter can contain one or more options. + * @param callback A function called when evaluation completes. + * If you specify the callback parameter, it should be a function that looks like this: + * function(object result, object exceptionInfo) {...}; + * Parameter result: The result of evaluation. + * Parameter exceptionInfo: An object providing details if an exception occurred while evaluating the expression. + */ + export function eval(expression: string, options: EvalOptions, callback?: (result: T, exceptionInfo: EvaluationExceptionInfo) => void): void; /** * Retrieves the list of resources from the inspected page. * @param callback A function that receives the list of resources when the request completes. @@ -1690,6 +1701,15 @@ declare namespace chrome.devtools.inspectedWindow { export var onResourceAdded: ResourceAddedEvent; /** Fired when a new revision of the resource is committed (e.g. user saves an edited version of the resource in the Developer Tools). */ export var onResourceContentCommitted: ResourceContentCommittedEvent; + + export interface EvalOptions { + /** If specified, the expression is evaluated on the iframe whose URL matches the one specified. By default, the expression is evaluated in the top frame of the inspected page. */ + frameURL?: string; + /** Evaluate the expression in the context of the content script of the calling extension, provided that the content script is already injected into the inspected page. If not, the expression is not evaluated and the callback is invoked with the exception parameter set to an object that has the isError field set to true and the code field set to E_NOTFOUND. */ + useContentScriptContext?: boolean; + /** Evaluate the expression in the context of a content script of an extension that matches the specified origin. If given, contextSecurityOrigin overrides the 'true' setting on userContentScriptContext. */ + contextSecurityOrigin?: string; + } } //////////////////// From 27e5506ee39a823938aeaf9acd3b579e8716e2a6 Mon Sep 17 00:00:00 2001 From: Kristofer Sommestad Date: Fri, 16 Feb 2018 09:23:24 +0100 Subject: [PATCH 0015/2153] fix(sinon): update typing for `useFakeTimers` The parameters for `useFakeTimers()` changed in Sinon 3.0.0. It now expects a `config` property instead. See http://sinonjs.org/releases/v4.3.0/fake-timers/ for more details. --- types/sinon/index.d.ts | 4 ++-- types/sinon/sinon-tests.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/types/sinon/index.d.ts b/types/sinon/index.d.ts index f0433a694e..24c809a71f 100644 --- a/types/sinon/index.d.ts +++ b/types/sinon/index.d.ts @@ -234,8 +234,8 @@ declare namespace Sinon { interface SinonFakeTimersStatic { (): SinonFakeTimers; - (...timers: string[]): SinonFakeTimers; - (now: number, ...timers: string[]): SinonFakeTimers; + (now?: number | Date): SinonFakeTimers; + (config: { now?: number | Date, toFake?: string[], shouldAdvanceTime?: boolean }): SinonFakeTimers; } interface SinonStatic { diff --git a/types/sinon/sinon-tests.ts b/types/sinon/sinon-tests.ts index 2e2286e538..838972798f 100644 --- a/types/sinon/sinon-tests.ts +++ b/types/sinon/sinon-tests.ts @@ -121,6 +121,10 @@ function testSandbox() { sandbox.mock(objectUnderTest).expects("process").once(); } sandbox.useFakeTimers(); + sandbox.useFakeTimers({ + now: 1, + toFake: ['Date'] + }); sandbox.useFakeXMLHttpRequest(); sandbox.useFakeServer(); sandbox.restore(); From 480c8a8ba81b38b71c7cf57b800ea0c6cdefa44d Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 20 Feb 2018 15:30:53 -0500 Subject: [PATCH 0016/2153] Removed "dom" from React types tsconfig.json --- types/react/global.d.ts | 5 ++++- types/react/index.d.ts | 1 + types/react/test/index.ts | 16 +++++++++------- types/react/tsconfig.json | 3 +-- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/types/react/global.d.ts b/types/react/global.d.ts index 23af6dc7a3..c647e7239b 100644 --- a/types/react/global.d.ts +++ b/types/react/global.d.ts @@ -1,5 +1,5 @@ /* -React projects that don't include the DOM library need these interfaces to compile. +React projects that don't include the DOM library these interfaces need to compile. React Native applications use React, but there is no DOM available. The JavaScript runtime is ES6/ES2015 only. These definitions allow such projects to compile with only `--lib ES6`. */ @@ -33,6 +33,7 @@ interface HTMLBodyElement extends HTMLElement { } interface HTMLBRElement extends HTMLElement { } interface HTMLButtonElement extends HTMLElement { } interface HTMLCanvasElement extends HTMLElement { } +interface HTMLDialogElement extends HTMLElement { } interface HTMLDivElement extends HTMLElement { } interface HTMLDListElement extends HTMLElement { } interface HTMLEmbedElement extends HTMLElement { } @@ -175,3 +176,5 @@ interface SVGTextPathElement extends SVGElement { } interface SVGTSpanElement extends SVGElement { } interface SVGUseElement extends SVGElement { } interface SVGViewElement extends SVGElement { } + +interface TouchList { } diff --git a/types/react/index.d.ts b/types/react/index.d.ts index c39e5eeb6c..24884576ff 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -14,6 +14,7 @@ // Stéphane Goetz // Rich Seviora // Josh Rutherford +// Josh Goldberg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 diff --git a/types/react/test/index.ts b/types/react/test/index.ts index 757a1da669..e0e4a09065 100644 --- a/types/react/test/index.ts +++ b/types/react/test/index.ts @@ -44,7 +44,7 @@ const props: Props & React.ClassAttributes<{}> = { foo: 42 }; -const container: Element = document.createElement("div"); +declare const container: Element; // // Top-Level API @@ -226,9 +226,9 @@ const clonedSvgElement: React.ReactSVGElement = const component: ModernComponent = ReactDOM.render(element, container); const componentNullContainer: ModernComponent = ReactDOM.render(element, null); -const componentElementOrNull: ModernComponent = ReactDOM.render(element, document.getElementById("anelement")); +const componentElementOrNull: ModernComponent = ReactDOM.render(element, container); const componentNoState: ModernComponentNoState = ReactDOM.render(elementNoState, container); -const componentNoStateElementOrNull: ModernComponentNoState = ReactDOM.render(elementNoState, document.getElementById("anelement")); +const componentNoStateElementOrNull: ModernComponentNoState = ReactDOM.render(elementNoState, container); const domComponent: Element = ReactDOM.render(domElement, container); // Other Top-Level API @@ -313,7 +313,7 @@ const htmlAttr: React.HTMLProps = { event.stopPropagation(); }, onAnimationStart: event => { - console.log(event.currentTarget.className); + const currentTarget: EventTarget & HTMLElement = event.currentTarget; }, dangerouslySetInnerHTML: { __html: "STRONG" @@ -624,7 +624,7 @@ if (TestUtils.isElementOfType(emptyElement2, StatelessComponent)) { } if (TestUtils.isDOMComponent(container)) { - container.getAttribute("className"); + const reassignedContainer: Element = container; } else if (TestUtils.isCompositeComponent(new ModernComponent({ hello: 'hi', foo: 3 }))) { new ModernComponent({ hello: 'hi', foo: 3 }).props; } @@ -670,7 +670,9 @@ class SyntheticEventTargetValue extends React.Component<{}, { value: string }> { render() { return DOM.textarea({ value: this.state.value, - onChange: e => this.setState({ value: e.target.value }) + onChange: e => { + const target: HTMLTextAreaElement = e.target; + } }); } } @@ -678,7 +680,7 @@ class SyntheticEventTargetValue extends React.Component<{}, { value: string }> { DOM.input({ onChange: event => { // `event.target` is guaranteed to be HTMLInputElement - event.target.value; + const target: HTMLInputElement = event.target; } }); diff --git a/types/react/tsconfig.json b/types/react/tsconfig.json index 1b79768acc..b999a338b3 100644 --- a/types/react/tsconfig.json +++ b/types/react/tsconfig.json @@ -8,8 +8,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6", - "dom" + "es6" ], "noImplicitAny": true, "noImplicitThis": false, From e327a3e895003b3ab3dd2cc055261b1094bd9724 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 26 Feb 2018 12:12:31 -0800 Subject: [PATCH 0017/2153] Sentence fragment --- types/react/global.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react/global.d.ts b/types/react/global.d.ts index c647e7239b..8d6062b4bc 100644 --- a/types/react/global.d.ts +++ b/types/react/global.d.ts @@ -1,5 +1,5 @@ /* -React projects that don't include the DOM library these interfaces need to compile. +React projects that don't include the DOM library need these interfaces to compile. React Native applications use React, but there is no DOM available. The JavaScript runtime is ES6/ES2015 only. These definitions allow such projects to compile with only `--lib ES6`. */ From 8434f97c667c7486181b2cdb8b11594943e2b688 Mon Sep 17 00:00:00 2001 From: Tom Crockett Date: Mon, 22 Jan 2018 22:22:44 -0800 Subject: [PATCH 0018/2153] Make JSS use a Name type parameter consistently, more accurate Style type --- types/jss/index.d.ts | 255 ++++++++++++++++++++++++++++++++++------- types/jss/jss-tests.ts | 9 +- 2 files changed, 221 insertions(+), 43 deletions(-) diff --git a/types/jss/index.d.ts b/types/jss/index.d.ts index d0136216ed..89c38d5223 100644 --- a/types/jss/index.d.ts +++ b/types/jss/index.d.ts @@ -3,7 +3,187 @@ // Definitions by: Brenton Simpson // Oleg Slobodskoi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 + +import { CSSProperties } from 'react'; + +export type PseudoCssKey = + | ':active' + | ':any' + | ':checked' + | ':default' + | ':disabled' + | ':empty' + | ':enabled' + | ':first' + | ':first-child' + | ':first-of-type' + | ':fullscreen' + | ':focus' + | ':hover' + | ':indeterminate' + | ':in-range' + | ':invalid' + | ':last-child' + | ':last-of-type' + | ':left' + | ':link' + | ':only-child' + | ':only-of-type' + | ':optional' + | ':out-of-range' + | ':read-only' + | ':read-write' + | ':required' + | ':right' + | ':root' + | ':scope' + | ':target' + | ':valid' + | ':visited' + // TODO + // | ':dir()' + // | ':lang()' + // | ':not()' + // | ':nth-child()' + // | ':nth-last-child()' + // | ':nth-last-of-type()' + // | ':nth-of-type()' + | '::after' + | '::before' + | '::cue' + | '::first-letter' + | '::first-line' + | '::selection' + | '::backdrop ' + | '::placeholder ' + | '::marker ' + | '::spelling-error ' + | '::grammar-error '; + +export type PseudoCss = Partial>; + +export interface JssProps { + '@global'?: React.CSSProperties & PseudoCss; + extend?: string; + composes?: string | string[]; +} + +export type css = React.CSSProperties; + +export interface JssExpand { + animation: + | { + delay: css['animationDelay']; + direction: css['animationDirection']; + duration: css['animationDuration']; + iterationCount: css['animationIterationCount']; + name: css['animationName']; + playState: css['animationPlayState']; + timingFunction: any; + } + | css['animation']; + background: + | { + attachment: css['backgroundAttachment']; + color: css['backgroundColor']; + image: css['backgroundImage']; + position: css['backgroundPosition'] | number[]; // Can be written using array e.g. `[0 0]` + repeat: css['backgroundRepeat']; + size: Array; // Can be written using array e.g. `['center' 'center']` + } + | css['background']; + border: + | { + color: css['borderColor']; + style: css['borderStyle']; + width: css['borderWidth']; + } + | css['border']; + boxShadow: + | { + x: any; + y: any; + blur: any; + spread: any; + color: css['color']; + inset?: 'inset'; // If you want to add inset you need to write "inset: 'inset'" + } + | css['boxShadow']; + flex: + | { + basis: css['flexBasis']; + direction: css['flexDirection']; + flow: css['flexFlow']; + grow: css['flexGrow']; + shrink: css['flexShrink']; + wrap: css['flexWrap']; + } + | css['flex']; + font: + | { + family: css['fontFamily']; + size: css['fontSize']; + stretch: css['fontStretch']; + style: css['fontStyle']; + variant: css['fontVariant']; + weight: css['fontWeight']; + } + | css['font']; + listStyle: + | { + image: css['listStyleImage']; + position: css['listStylePosition']; + type: css['listStyleType']; + } + | css['listStyle']; + margin: + | { + bottom: css['marginBottom']; + left: css['marginLeft']; + right: css['marginRight']; + top: css['marginTop']; + } + | css['margin']; + padding: + | { + bottom: css['paddingBottom']; + left: css['paddingLeft']; + right: css['paddingRight']; + top: css['paddingTop']; + } + | css['padding']; + outline: + | { + color: css['outlineColor']; + style: 'none' | 'hidden' | 'dotted' | 'dashed' | 'solid' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset'; + width: any; + } + | css['outline']; + textShadow: + | { + x: any; + y: any; + blur: any; + color: css['color']; + } + | css['textShadow']; + transition: + | { + delay: css['transitionDelay']; + duration: css['transitionDuration']; + property: css['transitionProperty']; + timingFunction: css['transitionTimingFunction']; + } + | css['transition']; +} + +export type JssExpandArr = { [k in keyof JssExpand]?: JssExpand[k] | Array }; + +export type Style = React.CSSProperties & PseudoCss & JssProps & JssExpandArr; + +export type Styles = Record; +export type Classes = Record; export interface Rule { className: string; @@ -13,13 +193,12 @@ export interface Rule { prop(key: string, value: any): this; toJSON(): string; } -export interface StyleSheet { + +export interface StyleSheet { // Gives auto-completion on the rules declared in `createStyleSheet` without // causing errors for rules added dynamically after creation. - classes: { - [K in keyof T]: string; - } & { [key: string]: string }; - options: any; + classes: Classes; + options: RuleOptions; linked: boolean; attached: boolean; /** @@ -35,21 +214,21 @@ export interface StyleSheet { * Will insert a rule also after the stylesheet has been rendered first time. */ addRule(style: Style, options?: Partial): Rule; - addRule(name: string, style: Style, options?: Partial): Rule; + addRule(name: Name, style: Style, options?: Partial): Rule; /** * Create and add rules. * Will render also after Style Sheet was rendered the first time. */ - addRules(styles: { [key: string]: Style }, options?: Partial): Rule[]; + addRules(styles: Partial>, options?: Partial): Rule[]; /** * Get a rule by name. */ - getRule(name: string): Rule; + getRule(name: Name): Rule; /** * Delete a rule by name. * Returns `true`: if rule has been deleted from the DOM. */ - deleteRule(name: string): boolean; + deleteRule(name: Name): boolean; /** * Get index of a rule. */ @@ -58,39 +237,37 @@ export interface StyleSheet { * Update the function values with a new data. */ update(data?: {}): this; - update(name: string, data: {}): this; + update(name: Name, data: {}): this; /** * Convert rules to a CSS string. */ toString(options?: { indent?: number }): string; } -export type GenerateClassName = (rule: Rule, sheet?: StyleSheet) => string; -export interface Style { - [key: string]: any; -} +export type GenerateClassName = (rule: Rule, sheet?: StyleSheet) => string; + export interface JSSPlugin { [key: string]: () => Partial<{ - onCreateRule(name: string, style: Style, options: RuleOptions): Rule, - onProcessRule(rule: Rule, sheet: StyleSheet): void, - onProcessStyle(style: Style, rule: Rule, sheet: StyleSheet): Style, - onProcessSheet(sheet: StyleSheet): void, - onChangeValue(value: any, prop: string, rule: Rule): any, - onUpdate(data: {}, rule: Rule, sheet: StyleSheet): void, + onCreateRule(name: string, style: Style, options: RuleOptions): Rule; + onProcessRule(rule: Rule, sheet: StyleSheet): void; + onProcessStyle(style: Style, rule: Rule, sheet: StyleSheet): Style; + onProcessSheet(sheet: StyleSheet): void; + onChangeValue(value: any, prop: string, rule: Rule): any; + onUpdate(data: {}, rule: Rule, sheet: StyleSheet): void; }>; } export interface JSSOptions { - createGenerateClassName(): GenerateClassName; + createGenerateClassName(): GenerateClassName; plugins: ReadonlyArray; virtual: boolean; insertionPoint: string | HTMLElement; } -export interface RuleFactoryOptions { +export interface RuleFactoryOptions { selector: string; - classes: { [key: string]: string }; - sheet: StyleSheet; + classes: Classes; + sheet: StyleSheet; index: number; jss: JSS; - generateClassName: GenerateClassName; + generateClassName: GenerateClassName; } export interface RuleOptions { index: number; @@ -98,23 +275,23 @@ export interface RuleOptions { } declare class JSS { constructor(options?: Partial); - createStyleSheet( - styles: T, + createStyleSheet( + styles: Partial>, options?: Partial<{ - media: string, - meta: string, - link: boolean, - element: HTMLStyleElement, - index: number, - generateClassName: GenerateClassName, - classNamePrefix: string, + media: string; + meta: string; + link: boolean; + element: HTMLStyleElement; + index: number; + generateClassName: GenerateClassName; + classNamePrefix: string; }>, - ): StyleSheet; - removeStyleSheet(sheet: StyleSheet): this; + ): StyleSheet; + removeStyleSheet(sheet: StyleSheet): this; setup(options?: Partial): this; use(plugin: JSSPlugin): this; - createRule(style: Style, options?: Partial): Rule; - createRule(name: string, style: Style, options?: Partial): Rule; + createRule(style: Style, options?: RuleFactoryOptions): Rule; + createRule(name: Name, style: Style, options?: RuleFactoryOptions): Rule; } /** * Creates a new instance of JSS. diff --git a/types/jss/jss-tests.ts b/types/jss/jss-tests.ts index 0cf3f51350..cd9387492c 100644 --- a/types/jss/jss-tests.ts +++ b/types/jss/jss-tests.ts @@ -7,10 +7,11 @@ import { const jss = createJSS().setup({}); -const styleSheet = jss.createStyleSheet( +// use because we will be dynamically augmenting +const styleSheet = jss.createStyleSheet( { - ruleWithMockObservable: { - subscribe() {} + root: { + backgroundColor: 'red', }, container: { display: 'flex', @@ -23,8 +24,8 @@ const styleSheet = jss.createStyleSheet( } ).attach(); +styleSheet.classes.root; // $ExpectType string styleSheet.classes.container; // $ExpectType string -styleSheet.classes.ruleWithMockObservable; // $ExpectType string const rule = styleSheet.addRule('dynamicRule', { color: 'indigo' }); rule.prop('border-radius', 5).prop('color'); // $ExpectType string From 5c8383cb8cfb9565c99ba935e1b8104d60bd95a8 Mon Sep 17 00:00:00 2001 From: Tom Crockett Date: Mon, 22 Jan 2018 23:47:53 -0800 Subject: [PATCH 0019/2153] Allow Style to be an Observable --- types/jss/index.d.ts | 4 +++- types/jss/jss-tests.ts | 8 ++++---- types/jss/package.json | 6 ++++++ 3 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 types/jss/package.json diff --git a/types/jss/index.d.ts b/types/jss/index.d.ts index 89c38d5223..40af88ea8b 100644 --- a/types/jss/index.d.ts +++ b/types/jss/index.d.ts @@ -6,6 +6,7 @@ // TypeScript Version: 2.3 import { CSSProperties } from 'react'; +import { Observable } from 'rxjs'; export type PseudoCssKey = | ':active' @@ -180,7 +181,8 @@ export interface JssExpand { export type JssExpandArr = { [k in keyof JssExpand]?: JssExpand[k] | Array }; -export type Style = React.CSSProperties & PseudoCss & JssProps & JssExpandArr; +export type SimpleStyle = React.CSSProperties & PseudoCss & JssProps & JssExpandArr; +export type Style = Observable | SimpleStyle export type Styles = Record; export type Classes = Record; diff --git a/types/jss/jss-tests.ts b/types/jss/jss-tests.ts index cd9387492c..c40d024040 100644 --- a/types/jss/jss-tests.ts +++ b/types/jss/jss-tests.ts @@ -4,15 +4,15 @@ import { create as createJSS, default as sharedInstance } from 'jss'; +import { Observable } from 'rxjs'; const jss = createJSS().setup({}); -// use because we will be dynamically augmenting const styleSheet = jss.createStyleSheet( { - root: { + ruleWithMockObservable: Observable.of({ backgroundColor: 'red', - }, + }), container: { display: 'flex', width: 100, @@ -24,8 +24,8 @@ const styleSheet = jss.createStyleSheet( } ).attach(); -styleSheet.classes.root; // $ExpectType string styleSheet.classes.container; // $ExpectType string +styleSheet.classes.ruleWithMockObservable; // $ExpectType string const rule = styleSheet.addRule('dynamicRule', { color: 'indigo' }); rule.prop('border-radius', 5).prop('color'); // $ExpectType string diff --git a/types/jss/package.json b/types/jss/package.json new file mode 100644 index 0000000000..33ba8bf22b --- /dev/null +++ b/types/jss/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "rxjs": "*" + } +} From 255cd1aa0c806eb1ec6f6a3fb7d5626954996caa Mon Sep 17 00:00:00 2001 From: Tom Crockett Date: Tue, 23 Jan 2018 00:00:12 -0800 Subject: [PATCH 0020/2153] Use TypeStyle's CSSProperties --- types/jss/index.d.ts | 10 +++++----- types/jss/package.json | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/types/jss/index.d.ts b/types/jss/index.d.ts index 40af88ea8b..f923ab0976 100644 --- a/types/jss/index.d.ts +++ b/types/jss/index.d.ts @@ -5,7 +5,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -import { CSSProperties } from 'react'; +import { types } from 'typestyle'; import { Observable } from 'rxjs'; export type PseudoCssKey = @@ -62,15 +62,15 @@ export type PseudoCssKey = | '::spelling-error ' | '::grammar-error '; -export type PseudoCss = Partial>; +export type PseudoCss = Partial>; export interface JssProps { - '@global'?: React.CSSProperties & PseudoCss; + '@global'?: types.CSSProperties & PseudoCss; extend?: string; composes?: string | string[]; } -export type css = React.CSSProperties; +export type css = types.CSSProperties; export interface JssExpand { animation: @@ -181,7 +181,7 @@ export interface JssExpand { export type JssExpandArr = { [k in keyof JssExpand]?: JssExpand[k] | Array }; -export type SimpleStyle = React.CSSProperties & PseudoCss & JssProps & JssExpandArr; +export type SimpleStyle = types.CSSProperties & PseudoCss & JssProps & JssExpandArr; export type Style = Observable | SimpleStyle export type Styles = Record; diff --git a/types/jss/package.json b/types/jss/package.json index 33ba8bf22b..2605ce6189 100644 --- a/types/jss/package.json +++ b/types/jss/package.json @@ -1,6 +1,7 @@ { "private": true, "dependencies": { - "rxjs": "*" + "rxjs": "*", + "typestyle": "*" } } From c0928c641784b74d98034084d0fa8c1caf772834 Mon Sep 17 00:00:00 2001 From: Tom Crockett Date: Tue, 23 Jan 2018 00:11:13 -0800 Subject: [PATCH 0021/2153] Remove rxjs dependency, use observable defn from flow --- types/jss/index.d.ts | 4 ++-- types/jss/jss-tests.ts | 9 +++++---- types/jss/observable.d.ts | 17 +++++++++++++++++ types/jss/package.json | 1 - 4 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 types/jss/observable.d.ts diff --git a/types/jss/index.d.ts b/types/jss/index.d.ts index f923ab0976..8054d7f6a6 100644 --- a/types/jss/index.d.ts +++ b/types/jss/index.d.ts @@ -6,7 +6,7 @@ // TypeScript Version: 2.3 import { types } from 'typestyle'; -import { Observable } from 'rxjs'; +import { Observable } from './observable'; export type PseudoCssKey = | ':active' @@ -182,7 +182,7 @@ export interface JssExpand { export type JssExpandArr = { [k in keyof JssExpand]?: JssExpand[k] | Array }; export type SimpleStyle = types.CSSProperties & PseudoCss & JssProps & JssExpandArr; -export type Style = Observable | SimpleStyle +export type Style = Observable | SimpleStyle; export type Styles = Record; export type Classes = Record; diff --git a/types/jss/jss-tests.ts b/types/jss/jss-tests.ts index c40d024040..fab2665bed 100644 --- a/types/jss/jss-tests.ts +++ b/types/jss/jss-tests.ts @@ -4,15 +4,16 @@ import { create as createJSS, default as sharedInstance } from 'jss'; -import { Observable } from 'rxjs'; const jss = createJSS().setup({}); const styleSheet = jss.createStyleSheet( { - ruleWithMockObservable: Observable.of({ - backgroundColor: 'red', - }), + ruleWithMockObservable: { + subscribe: () => ({ + unsubscribe() {} + }) + }, container: { display: 'flex', width: 100, diff --git a/types/jss/observable.d.ts b/types/jss/observable.d.ts new file mode 100644 index 0000000000..ff6a5f0219 --- /dev/null +++ b/types/jss/observable.d.ts @@ -0,0 +1,17 @@ +// Copied from https://github.com/cssinjs/jss/blob/6ed7963786d5ef899075e95f81efc9530342154f/src/types.js + +export type Observable = { + subscribe(observerOrNext: ObserverOrNext): Subscription +} + +export type Observer = { + next: NextChannel +} + +export type NextChannel = (value: T) => void +export type ObserverOrNext = Observer | NextChannel + +export type Unsubscribe = () => void +export type Subscription = { + unsubscribe: Unsubscribe +} diff --git a/types/jss/package.json b/types/jss/package.json index 2605ce6189..a85944f70e 100644 --- a/types/jss/package.json +++ b/types/jss/package.json @@ -1,7 +1,6 @@ { "private": true, "dependencies": { - "rxjs": "*", "typestyle": "*" } } From d265ffc5449e970d732763336d96c24158ee86f3 Mon Sep 17 00:00:00 2001 From: Tom Crockett Date: Tue, 23 Jan 2018 00:25:00 -0800 Subject: [PATCH 0022/2153] Adapt TypeStyle's CSS typings to JSS --- types/jss/css.d.ts | 2880 ++++++++++++++++++++++++++++++++++++++++ types/jss/index.d.ts | 179 +-- types/jss/package.json | 6 - 3 files changed, 2881 insertions(+), 184 deletions(-) create mode 100644 types/jss/css.d.ts delete mode 100644 types/jss/package.json diff --git a/types/jss/css.d.ts b/types/jss/css.d.ts new file mode 100644 index 0000000000..348948f814 --- /dev/null +++ b/types/jss/css.d.ts @@ -0,0 +1,2880 @@ +// These CSS typings adapted from TypeStyle: https://github.com/typestyle/typestyle + +import { Observable } from './observable' + +/** + * Value of a CSS Property. Could be a single value or a list of fallbacks + * NOTE: array is for fallbacks + */ +export type CSSValue = T | Observable; + +/** + * For general purpose CSS values + **/ +export type CSSValueGeneral = CSSValue; + +/** + * When you are sure that the value must be a string + **/ +export type CSSValueString = CSSValue; + +/** + * CSS properties that cascade also support these + * @see https://drafts.csswg.org/css-cascade/#defaulting-keywords + */ +export type CSSGlobalValues + = 'initial' + | 'inherit' + | /** combination of `initial` and `inherit` */ 'unset' + | 'revert'; + +export interface FontFace { + fontFamily?: string; + + /** + * Location of a font-face. Used with the @font-face at rule + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src + */ + src?: CSSValueString; + unicodeRange?: any; + fontVariant?: 'common-ligatures' | 'small-caps' | CSSGlobalValues; + fontFeatureSettings?: string; + fontWeight?: CSSFontWeight; + fontStyle?: 'normal' | 'italic' | 'oblique' | CSSGlobalValues; +} + +/** + * Absolute size keywords + * @see https://drafts.csswg.org/css-fonts-3/#absolute-size-value + */ +export type CSSAbsoluteSize = 'xx-small' | 'x-small' | 'small' | 'medium' | 'large' + | 'x-large' | 'xx-large'; + +/** + * an angle; 0' | '0deg' | '0grad' | '0rad' | '0turn' | 'etc. + * @see https://drafts.csswg.org/css-values-3/#angles + */ +export type CSSAngle = CSSGlobalValues | string | 0; + +/** + * initial state of an animation. + * @see https://drafts.csswg.org/css-animations/#animation-play-state + */ +export type CSSAnimationPlayState = CSSGlobalValues | string | 'paused' | 'running'; + +/** + * blend mode + * @see https://drafts.fxtf.org/compositing-1/#ltblendmodegt + */ +export type CSSBlendMode = 'normal' | 'multiply' | 'screen' | 'overlay' | 'darken' | 'lighten' | 'color-dodge' | 'color-burn' + | 'hard-light' | 'soft-light' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity'; + +/** + * border shorthand for style color and width + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-left + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-right + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-top + */ +export type CSSBorderShorthand = CSSGlobalValues | CSSColor | CSSLength | CSSLineStyleSet | string; + +/** + * Determines the area within which the background is painted. + * @see https://drafts.csswg.org/css-backgrounds/#box + */ +export type CSSBox = CSSGlobalValues | string | 'border-box' | 'padding-box' | 'content-box'; + +/** + * Color can be a named color, transparent, or a color function + * @see https://drafts.csswg.org/css-color-3/#valuea-def-color + */ +export type CSSColor = CSSNamedColor | CSSGlobalValues | 'currentColor' | string; + +export type CSSNamedColor = + 'aliceblue' | 'antiquewhite' | 'aqua' | 'aquamarine' | 'azure' | 'beige' | 'bisque' | 'black' | 'blanchedalmond' | 'blue' + | 'blueviolet' | 'brown' | 'burlywood' | 'cadetblue' | 'chartreuse' | 'chocolate' | 'coral' | 'cornflowerblue' | 'cornsilk' + | 'crimson' | 'cyan' | 'darkblue' | 'darkcyan' | 'darkgoldenrod' | 'darkgray' | 'darkgreen' | 'darkgrey' | 'darkkhaki' + | 'darkmagenta' | 'darkolivegreen' | 'darkorange' | 'darkorchid' | 'darkred' | 'darksalmon' | 'darkseagreen' + | 'darkslateblue' | 'darkslategray' | 'darkslategrey' | 'darkturquoise' | 'darkviolet' | 'deeppink' | 'deepskyblue' + | 'dimgray' | 'dimgrey' | 'dodgerblue' | 'firebrick' | 'floralwhite' | 'forestgreen' | 'fuchsia' | 'gainsboro' + | 'ghostwhite' | 'gold' | 'goldenrod' | 'gray' | 'green' | 'greenyellow' | 'grey' | 'honeydew' | 'hotpink' | 'indianred' + | 'indigo' | 'ivory' | 'khaki' | 'lavender' | 'lavenderblush' | 'lawngreen' | 'lemonchiffon' | 'lightblue' | 'lightcoral' + | 'lightcyan' | 'lightgoldenrodyellow' | 'lightgray' | 'lightgreen' | 'lightgrey' | 'lightpink' | 'lightsalmon' + | 'lightseagreen' | 'lightskyblue' | 'lightslategray' | 'lightslategrey' | 'lightsteelblue' | 'lightyellow' | 'lime' + | 'limegreen' | 'linen' | 'maroon' | 'mediumaquamarine' | 'mediumblue' | 'mediumorchid' | 'mediumpurple' | 'mediumseagreen' + | 'mediumslateblue' | 'mediumspringgreen' | 'mediumturquoise' | 'mediumvioletred' | 'midnightblue' | 'mintcream' + | 'mistyrose' | 'moccasin' | 'navajowhite' | 'navy' | 'oldlace' | 'olive' | 'olivedrab' | 'orange' | 'purple' + | 'rebeccapurple' | 'red' | 'silver' | 'teal' | 'transparent' | 'white' | 'yellow'; + +/** + * Special type for border-color which can use 1 or 4 colors + * @see https://drafts.csswg.org/css-backgrounds-3/#border-color + */ +export type CSSColorSet = string | CSSColor; + +/** + * This property specifies the type of rendering box used for an element. It is a shorthand property for many other display properties. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/display + */ +export type CSSDisplay = + /* values */ + 'block' | 'inline' | 'run-in' + /* values */ + | 'flow' | 'flow-root' | 'table' | 'flex' | 'grid' | 'ruby' | 'subgrid' + /* plus values */ + | 'block flow' | 'inline table' | 'flex run-in' + /* values */ + | 'list-item' | 'list-item block' | 'list-item inline' | 'list-item flow' | 'list-item flow-root' + | 'list-item block flow' | 'list-item block flow-root' | 'flow list-item block' + /* values */ + | 'table-row-group' | 'table-header-group' | 'table-footer-group' | 'table-row' | 'table-cell' + | 'table-column-group' | 'table-column' | 'table-caption' | 'ruby-base' | 'ruby-text' + | 'ruby-base-container' | 'ruby-text-container' + /* values */ + | 'contents' | 'none' + /* values */ + | 'inline-block' | 'inline-list-item' | 'inline-table' | 'inline-flex' | 'inline-grid'; + +/** + * CSS Type of Box Alignment + * @see https://www.w3.org/TR/css-align-3/#typedef-baseline-position + */ +export type CSSBoxAlignmentBaselinePosition = 'baseline' | 'first baseline' | 'last baseline'; + +/** + * CSS Type of Box Alignment + * @see https://www.w3.org/TR/css-align-3/#typedef-content-distribution + */ +export type CSSBoxAlignmentContentDistribution = 'space-between' | 'space-around' | 'space-evenly' | 'stretch'; + +export type CSSBoxAlignmentContentPositionWithOverflow = + | 'center' | 'start' | 'end' | 'flex-start' | 'flex-end' + | 'unsafe center' | 'unsafe start' | 'unsafe end' | 'unsafe flex-start' | 'unsafe flex-end' + | 'safe center' | 'safe start' | 'safe end' | 'safe flex-start' | 'safe flex-end'; + +export type CSSBoxAlignmentSelfPositionWithOverflow = + | 'center' | 'start' | 'end' | 'self-start' | 'self-end' | 'flex-start' | 'flex-end' + | 'unsafe center' | 'unsafe start' | 'unsafe end' | 'unsafe self-start' | 'unsafe self-end' | 'unsafe flex-start' | 'unsafe flex-end' + | 'safe center' | 'safe start' | 'safe end' | 'safe self-start' | 'safe self-end' | 'safe flex-start' | 'safe flex-end'; + +export type CSSBoxAlignmentLeftRightWithOverflow = 'left' | 'right' | 'unsafe left' | 'unsafe right' | 'safe left' | 'safe right'; + +/** + * Type for justify-content in flex or grid + * @see https://www.w3.org/TR/css-align-3/#propdef-justify-content + */ +export type JustifyContent = + | 'normal' + | CSSBoxAlignmentContentDistribution + | CSSBoxAlignmentContentPositionWithOverflow + | 'left' + | 'right'; + +/** + * Type for align-content in flex or grid + * @see https://www.w3.org/TR/css-align-3/#propdef-align-content + */ +export type AlignContent = + | 'normal' + | CSSBoxAlignmentBaselinePosition + | CSSBoxAlignmentContentDistribution + | CSSBoxAlignmentContentPositionWithOverflow; + +/** + * Type for justify-items in flex or grid + * @see https://www.w3.org/TR/css-align-3/#propdef-justify-items + */ +export type JustifyItems = + | 'normal' + | 'stretch' + | CSSBoxAlignmentBaselinePosition + | CSSBoxAlignmentSelfPositionWithOverflow + | 'left' + | 'right' + | 'center' + | 'legacy left' + | 'legacy right' + | 'legacy center'; + +/** + * Type for align-items in flex or grid + * @see https://www.w3.org/TR/css-align-3/#propdef-align-items + */ +export type AlignItems = + | 'normal' + | 'stretch' + | CSSBoxAlignmentBaselinePosition + | CSSBoxAlignmentSelfPositionWithOverflow; + +/** + * Type for justify-self in flex or grid + * @see https://www.w3.org/TR/css-align-3/#propdef-justify-self + */ +export type JustifySelf = + | 'auto' + | 'normal' + | 'stretch' + | CSSBoxAlignmentBaselinePosition + | CSSBoxAlignmentSelfPositionWithOverflow + | CSSBoxAlignmentLeftRightWithOverflow; + +/** + * Type for align-self in flex or grid + * @see https://www.w3.org/TR/css-align-3/#propdef-align-self + */ +export type AlignSelf = + | 'auto' + | 'normal' + | 'stretch' + | CSSBoxAlignmentBaselinePosition + | CSSBoxAlignmentSelfPositionWithOverflow; + +/** + * a gradient function like linear-gradient + * @see https://drafts.csswg.org/css-images-3/#gradients + */ +export type CSSGradient = CSSGlobalValues | string; + +/** + * complex type that describes the size of fonts + * @see https://drafts.csswg.org/css-fonts-3/#propdef-font-size + */ +export type CSSFontSize = CSSGlobalValues | CSSLength | CSSPercentage | CSSAbsoluteSize | CSSRelativeSize; + +/** + * a value that serves as an image + * @see https://drafts.csswg.org/css-images-3/#typedef-image + */ +export type CSSImage = CSSGlobalValues | string | CSSGradient | CSSUrl; + +/** + * an length; 0 | '0px' | '0em' etc. + * @see https://drafts.csswg.org/css-values-3/#lengths + */ +export type CSSLength = CSSGlobalValues | string | number; + +/** + * Style of a line (e.g. border-style) + * @see https://drafts.csswg.org/css-backgrounds-3/#line-style + */ +export type CSSLineStyle = string | 'none' | 'hidden' | 'dotted' + | 'dashed' | 'solid' | 'double' | 'groove' | 'ridge' | 'inset' + | 'outset'; + +/** + * Special type for border-style which can use 1 or 4 line-style + * @see https://drafts.csswg.org/css-backgrounds-3/#border-style + */ +export type CSSLineStyleSet = string | CSSLineStyle; + +/** + * Specifies how the contents of a replaced element should be fitted to the box established by its used height and width. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit + */ +export type CSSObjectFit = "fill" | "contain" | "cover" | "none" | "scale-down" | CSSGlobalValues; + +/** + * Overflow modes + * @see https://drafts.csswg.org/css-overflow-3/#propdef-overflow + */ +export type CSSOverflow = 'visible' | 'hidden' | 'scroll' | 'clip' | 'auto'; + +/** + * a percentage; 0 | '0%' etc. + * @see https://drafts.csswg.org/css-values-3/#percentage + */ +export type CSSPercentage = CSSGlobalValues | string | 0; + +/** + * Defines a position (e.g. background-position) + * @see https://drafts.csswg.org/css-backgrounds-3/#position + */ +export type CSSPosition = CSSAngle | string; + +/** + * Relative size keywords + * @see https://drafts.csswg.org/css-fonts-3/#relative-size-value + */ +export type CSSRelativeSize = 'larger' | 'smaller'; + +/** + * Specifies how background images are tiled after they have been sized and positioned + * @see https://drafts.csswg.org/css-backgrounds/#repeat-style + */ +export type CSSRepeatStyle = 'repeat-x' + | 'repeat-y' + | 'repeat' + | 'space' + | 'round' + | 'no-repeat' + | 'repeat repeat' + | 'repeat space' + | 'repeat round' + | 'repeat no-repeat' + | 'space repeat' + | 'space space' + | 'space round' + | 'space no-repeat' + | 'round repeat' + | 'round space' + | 'round round' + | 'round no-repeat' + | 'no-repeat repeat' + | 'no-repeat space' + | 'no-repeat round' + | 'no-repeat no-repeat'; + +/** + * Tranform list for the element. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function + */ +export type CSSTransformFunction = string | 'none'; + +/** + * Starting position for many gradients + * @see https://drafts.csswg.org/css-images-3/#typedef-side-or-corner + */ +export type CSSSideOrCorner = CSSAngle + | 'left' | 'right' | 'top' | 'bottom' + | 'to left' | 'to right' | 'to top' | 'to bottom' + | 'left top' | 'right top' | 'left bottom' | 'right bottom' + | 'top left' | 'top right' | 'bottom left' | 'bottom right' + | 'to left top' | 'to right top' | 'to left bottom' | 'to right bottom' + | 'to top left' | 'to top right' | 'to bottom left' | 'to bottom right'; + +export type CSSRadialGradientEndingShape = 'circle' | 'ellipse'; + +/** + * Radial Gradient Size. + * @see https://drafts.csswg.org/css-images-3/#ending-shape + */ +export type CSSRadialGradientSize = CSSLength | Array + | 'closest-side' | 'farthest-side' + | 'closest-corner' | 'closest-side' + ; + +/** Supporting by `-timing-function` properties */ +export type CSSTimingFunction + = /** e.g. steps(int,start|end)|cubic-bezier(n,n,n,n) */ string + | CSSGlobalValues + | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear' | 'step-start' | 'step-end'; + +/** + * Expressed as url('protocol://') + * @see https://drafts.csswg.org/css-values-3/#urls + */ +export type CSSUrl = string; + +/** + * Font weights + */ +export type CSSFontWeight = 'normal' | 'bold' | 'bolder' | 'lighter' | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | number | CSSGlobalValues; + +/** + * This interface documents key CSS properties for autocomplete + */ +export interface CSSProperties { + /** + * Typestyle configuration options + **/ + /** + * The generated CSS selector gets its own unique location in the generated CSS (disables deduping). + * So instead of `.classA,.classB{same properties}` + * you get `.classA {same properties} .classB {same properties}` + * This is needed for certain browser edge cases like placeholder styling + **/ + $unique?: boolean; + + /** + * Smooth scrolling on an iPhone. Specifies whether to use native-style scrolling in an element. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-overflow-scrolling + */ + '-webkit-overflow-scrolling'?: 'auto' | 'touch'; + + /** + * Aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how justify-content aligns individual items within the main-axis. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/align-content + */ + alignContent?: AlignContent; + + /** + * Sets the default alignment in the cross axis for all of the flex container's items, including anonymous flex items, similarly to how justify-content aligns items along the main axis. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/align-items + */ + alignItems?: CSSValue; + '-ms-align-items'?: CSSValue; + '-webkit-align-items'?: CSSValue; + + /** + * Allows the default alignment to be overridden for individual flex items. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/align-self + */ + alignSelf?: CSSValue; + '-webkit-align-self'?: CSSValue; + '-ms-flex-item-align'?: string; + + /** + * This property allows precise alignment of elements, such as graphics, that do not have a baseline-table or lack the desired baseline in their baseline-table. With the alignment-adjust property, the position of the baseline identified by the alignment-baseline can be explicitly determined. It also determines precisely the alignment point for each glyph within a textual element. + */ + alignmentAdjust?: any; + + /** + * The alignment-baseline attribute specifies how an object is aligned with respect to its parent. + * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/alignment-baseline + */ + alignmentBaseline?: 'auto' | 'baseline' | 'before-edge' | 'text-before-edge' | 'middle' | 'central' | 'after-edge' | 'text-after-edge' | 'ideographic' | 'alphabetic' | 'hanging' | 'mathematical' | 'inherit'; + + /** + * Shorthand property for animation-name, animation-duration, animation-timing-function, animation-delay, + * animation-iteration-count, animation-direction, animation-fill-mode, and animation-play-state. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation + */ + animation?: CSSValueString; + + /** + * Defines a length of time to elapse before an animation starts, allowing an animation to begin execution some time after it is applied. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation-delay + */ + animationDelay?: any; + + /** + * Defines whether an animation should run in reverse on some or all cycles. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation-direction + */ + animationDirection?: CSSGlobalValues | 'normal' | 'alternate' | 'reverse' | 'alternate-reverse'; + + /** + * The animation-duration CSS property specifies the length of time that an animation should take to complete one cycle. + * A value of '0s', which is the default value, indicates that no animation should occur. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation-duration + */ + animationDuration?: CSSValue; + + /** + * Specifies how a CSS animation should apply styles to its target before and after it is executing. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation-fill-mode + */ + animationFillMode?: 'none' | 'forwards' | 'backwards' | 'both'; + + /** + * Specifies how many times an animation cycle should play. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation-iteration-count + */ + animationIterationCount?: CSSValue; + + /** + * Defines the list of animations that apply to the element. + * Note: You probably want animationDuration as well + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation-name + */ + animationName?: CSSValue; + + /** + * Defines whether an animation is running or paused. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation-play-state + */ + animationPlayState?: CSSValue; + + /** + * Sets the pace of an animation + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timing-function + */ + animationTimingFunction?: CSSValue; + + /** + * Allows changing the style of any element to platform-based interface elements or vice versa. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/appearance + */ + appearance?: CSSValue<'auto' | 'none'>; + + /** + * Determines whether or not the “back” side of a transformed element is visible when facing the viewer. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/backface-visibility + */ + backfaceVisibility?: CSSGlobalValues | 'visible' | 'hidden'; + + /** + * Shorthand property to set the values for one or more of: + * background-clip, background-color, background-image, + * background-origin, background-position, background-repeat, + * background-size, and background-attachment. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/background + */ + background?: any; + + /** + * If a background-image is specified, this property determines + * whether that image's position is fixed within the viewport, + * or scrolls along with its containing block. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/background-attachment + */ + backgroundAttachment?: 'scroll' | 'fixed' | 'local'; + + /** + * This property describes how the element's background images should blend with each other and the element's background color. + * The value is a list of blend modes that corresponds to each background image. Each element in the list will apply to the corresponding element of background-image. If a property doesn’t have enough comma-separated values to match the number of layers, the UA must calculate its used value by repeating the list of values until there are enough. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/background-blend-mode + */ + backgroundBlendMode?: CSSValue; + + /** + * Specifies whether an element's background, either the color or image, extends underneath its border. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/background-clip + */ + backgroundClip?: CSSValue; + + /** + * Sets the background color of an element. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/background-color + */ + backgroundColor?: CSSValue; + + /** + * Sets a compositing style for background images and colors. + */ + backgroundComposite?: any; + + /** + * Applies one or more background images to an element. These can be any valid CSS image, including url() paths to image files or CSS gradients. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/background-image + */ + backgroundImage?: CSSValue; + + /** + * Specifies what the background-position property is relative to. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/background-origin + */ + backgroundOrigin?: CSSValue; + + /** + * Sets the position of a background image. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/background-position + */ + backgroundPosition?: CSSValue; + + /** + * Background-repeat defines if and how background images will be repeated after they have been sized and positioned + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/background-repeat + */ + backgroundRepeat?: CSSValue; + + /** + * Background-size specifies the size of a background image + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/background-size + */ + backgroundSize?: 'auto' | 'cover' | 'contain' | CSSLength | CSSPercentage | CSSGlobalValues; + + /** + * Obsolete - spec retired, not implemented. + * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/baseline-shift + */ + baselineShift?: any; + + /** + * Non standard. Sets or retrieves the location of the Dynamic HTML (DHTML) behavior. + * @see https://msdn.microsoft.com/en-us/library/ms530723(v=vs.85).aspx + */ + behavior?: any; + + /** + * Shorthand property that defines the different properties of all four sides of an element's border in a single declaration. It can be used to set border-width, border-style and border-color, or a subset of these. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border + */ + border?: any; + + /** + * Shorthand that sets the values of border-bottom-color, + * border-bottom-style, and border-bottom-width. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom + */ + borderBottom?: CSSBorderShorthand; + + /** + * Sets the color of the bottom border of an element. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-color + */ + borderBottomColor?: CSSValue; + + /** + * Defines the shape of the border of the bottom-left corner. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-left-radius + */ + borderBottomLeftRadius?: any; + + /** + * Defines the shape of the border of the bottom-right corner. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-right-radius + */ + borderBottomRightRadius?: any; + + /** + * Sets the line style of the bottom border of a box. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-style + */ + borderBottomStyle?: CSSValue; + + /** + * Sets the width of an element's bottom border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-width + */ + borderBottomWidth?: CSSValue; + + /** + * Border-collapse can be used for collapsing the borders between table cells + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-collapse + */ + borderCollapse?: any; + + /** + * The CSS border-color property sets the color of an element's four borders. This property can have from one to four values, made up of the elementary properties: + * • border-top-color + * • border-right-color + * • border-bottom-color + * • border-left-color The default color is the currentColor of each of these values. + * If you provide one value, it sets the color for the element. Two values set the horizontal and vertical values, respectively. Providing three values sets the top, vertical, and bottom values, in that order. Four values set all for sides: top, right, bottom, and left, in that order. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-color + */ + borderColor?: CSSValue; + + /** + * Specifies different corner clipping effects, such as scoop (inner curves), bevel (straight cuts) or notch (cut-off rectangles). Works along with border-radius to specify the size of each corner effect. + */ + borderCornerShape?: any; + + /** + * The property border-image-source is used to set the image to be used instead of the border style. If this is set to none the border-style is used instead. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-image-source + */ + borderImageSource?: CSSValue; + + /** + * The border-image-width CSS property defines the offset to use for dividing the border image in nine parts, the top-left corner, central top edge, top-right-corner, central right edge, bottom-right corner, central bottom edge, bottom-left corner, and central right edge. They represent inward distance from the top, right, bottom, and left edges. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-image-width + */ + borderImageWidth?: CSSValue; + + /** + * Shorthand property that defines the border-width, border-style and border-color of an element's left border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the left border — border-left-width, border-left-style and border-left-color. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-left + */ + borderLeft?: CSSBorderShorthand; + + /** + * The CSS border-left-color property sets the color of an element's left border. This page explains the border-left-color value, but often you will find it more convenient to fix the border's left color as part of a shorthand set, either border-left or border-color. + * Colors can be defined several ways. For more information, see Usage. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-left-color + */ + borderLeftColor?: CSSValue; + + /** + * Sets the style of an element's left border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-left-style + */ + borderLeftStyle?: CSSValue; + + /** + * Sets the width of an element's left border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-left-width + */ + borderLeftWidth?: CSSValue; + + /** + * Allows Web authors to define how rounded border corners are + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius + */ + borderRadius?: CSSValue; + + /** + * Shorthand property that defines the border-width, border-style and border-color of an element's right border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the right border — border-right-width, border-right-style and border-right-color. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-right + */ + borderRight?: CSSBorderShorthand; + + /** + * Sets the color of an element's right border. This page explains the border-right-color value, but often you will find it more convenient to fix the border's right color as part of a shorthand set, either border-right or border-color. + * Colors can be defined several ways. For more information, see Usage. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-right-color + */ + borderRightColor?: CSSValue; + + /** + * Sets the style of an element's right border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-right-style + */ + borderRightStyle?: CSSValue; + + /** + * Sets the width of an element's right border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-right-width + */ + borderRightWidth?: CSSValue; + + /** + * Specifies the distance between the borders of adjacent cells. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-spacing + */ + borderSpacing?: CSSLength | string | 'inherit'; + + /** + * Sets the style of an element's four borders. This property can have from one to four values. With only one value, the value will be applied to all four borders; otherwise, this works as a shorthand property for each of border-top-style, border-right-style, border-bottom-style, border-left-style, where each border style may be assigned a separate value. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-style + */ + borderStyle?: CSSValue; + + /** + * Shorthand property that defines the border-width, border-style and border-color of an element's top border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the top border — border-top-width, border-top-style and border-top-color. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-top + */ + borderTop?: CSSBorderShorthand; + + /** + * Sets the color of an element's top border. This page explains the border-top-color value, but often you will find it more convenient to fix the border's top color as part of a shorthand set, either border-top or border-color. + * Colors can be defined several ways. For more information, see Usage. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-color + */ + borderTopColor?: CSSValue; + + /** + * Sets the rounding of the top-left corner of the element. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-left-radius + */ + borderTopLeftRadius?: any; + + /** + * Sets the rounding of the top-right corner of the element. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-right-radius + */ + borderTopRightRadius?: any; + + /** + * Sets the style of an element's top border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-style + */ + borderTopStyle?: CSSValue; + + /** + * Sets the width of an element's top border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-width + */ + borderTopWidth?: CSSValue; + + /** + * Sets the width of an element's four borders. This property can have from one to four values. This is a shorthand property for setting values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-width + */ + borderWidth?: CSSValue; + + /** + * This property specifies how far an absolutely positioned box's bottom margin edge is offset above the bottom edge of the box's containing block. For relatively positioned boxes, the offset is with respect to the bottom edges of the box itself (i.e., the box is given a position in the normal flow, then offset from that position according to these properties). + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/bottom + */ + bottom?: CSSValue<'auto' | CSSLength | CSSPercentage | CSSGlobalValues>; + + /** + * Obsolete. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/box-align + */ + boxAlign?: any; + + /** + * Breaks a box into fragments creating new borders, padding and repeating backgrounds or lets it stay as a continuous box on a page break, column break, or, for inline elements, at a line break. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/box-decoration-break + */ + boxDecorationBreak?: any; + + /** + * Deprecated + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/box-direction + */ + boxDirection?: any; + + /** + * Do not use. This property has been replaced by the flex-wrap property. + * Gets or sets a value that specifies the direction to add successive rows or columns when the value of box-lines is set to multiple. + */ + boxLineProgression?: any; + + /** + * Do not use. This property has been replaced by the flex-wrap property. + * Gets or sets a value that specifies whether child elements wrap onto multiple lines or columns based on the space available in the object. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/box-lines + */ + boxLines?: any; + + /** + * Do not use. This property has been replaced by flex-order. + * Specifies the ordinal group that a child element of the object belongs to. This ordinal value identifies the display order (along the axis defined by the box-orient property) for the group. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/box-ordinal-group + */ + boxOrdinalGroup?: any; + + /** + * Deprecated. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/box-flex + */ + boxFlex?: number; + + /** + * box sizing + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing + */ + boxSizing?: CSSGlobalValues | 'content-box' | 'border-box'; + '-moz-box-sizing'?: CSSGlobalValues | 'content-box' | 'border-box'; + '-webkit-box-sizing'?: CSSGlobalValues | 'content-box' | 'border-box'; + + /** + * Box shadow + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow + */ + boxShadow?: CSSValueGeneral; + + /** + * Deprecated. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/box-flex-group + */ + boxFlexGroup?: number; + + /** + * The CSS break-after property allows you to force a break on multi-column layouts. More specifically, it allows you to force a break after an element. It allows you to determine if a break should occur, and what type of break it should be. The break-after CSS property describes how the page, column or region break behaves after the generated box. If there is no generated box, the property is ignored. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/break-after + */ + breakAfter?: 'auto' | 'avoid' | 'avoid-page' | 'page' | 'left' | 'right' | 'recto' | 'verso' | 'avoid-column' | 'column' | 'avoid-region' | 'region'; + + /** + * Control page/column/region breaks that fall above a block of content + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/break-before + */ + breakBefore?: 'auto' | 'avoid' | 'avoid-page' | 'page' | 'left' | 'right' | 'recto' | 'verso' | 'avoid-column' | 'column' | 'avoid-region' | 'region'; + + /** + * Control page/column/region breaks that fall within a block of content + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/break-inside + */ + breakInside?: 'auto' | 'avoid' | 'avoid-page' | 'avoid-column' | 'avoid-region'; + + /** + * The caption-side CSS property positions the content of a table's on the specified side. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/caption-side + */ + captionSide?: CSSGlobalValues | 'top' | 'bottom' | 'block-start' | 'block-end' | 'inline-start' | 'inline-end'; + + /** + * The clear CSS property specifies if an element can be positioned next to or must be positioned below the floating elements that precede it in the markup. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/clear + */ + clear?: CSSGlobalValues | 'none' | 'left' | 'right' | 'both'; + + /** + * Deprecated; see clip-path. + * Lets you specify the dimensions of an absolutely positioned element that should be visible, and the element is clipped into this shape, and displayed. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/clip + */ + clip?: any; + + /** + * Clipping crops an graphic, so that only a portion of the graphic is rendered, or filled. This clip-rule property, when used with the clip-path property, defines which clip rule, or algorithm, to use when filling the different parts of a graphics. + * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/clip-rule + */ + clipRule?: any; + + /** + * The color property sets the color of an element's foreground content (usually text), accepting any standard CSS color from keywords and hex values to RGB(a) and HSL(a). + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/color + */ + color?: CSSValue; + + /** + * Describes the number of columns of the element. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/column-count + */ + columnCount?: number; + + /** + * Specifies how to fill columns (balanced or sequential). + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/column-fill + */ + columnFill?: any; + + /** + * The column-gap property controls the width of the gap between columns in multi-column elements. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/column-gap + */ + columnGap?: any; + + /** + * Sets the width, style, and color of the rule between columns. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/column-rule + */ + columnRule?: any; + + /** + * Specifies the color of the rule between columns. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/column-rule-color + */ + columnRuleColor?: CSSValue; + + /** + * Specifies the width of the rule between columns. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/column-rule-width + */ + columnRuleWidth?: CSSValue; + + /** + * The column-span CSS property makes it possible for an element to span across all columns when its value is set to all. An element that spans more than one column is called a spanning element. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/column-span + */ + columnSpan?: any; + + /** + * Specifies the width of columns in multi-column elements. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/column-width + */ + columnWidth?: CSSValue; + + /** + * This property is a shorthand property for setting column-width and/or column-count. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/columns + */ + columns?: any; + + /** + * The content property is used with the :before and :after pseudo-elements, to insert generated content. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/content + */ + content?: CSSValueString; + + /** + * The counter-increment property accepts one or more names of counters (identifiers), each one optionally followed by an integer which specifies the value by which the counter should be incremented (e.g. if the value is 2, the counter increases by 2 each time it is invoked). + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/counter-increment + */ + counterIncrement?: any; + + /** + * The counter-reset property contains a list of one or more names of counters, each one optionally followed by an integer (otherwise, the integer defaults to 0.) Each time the given element is invoked, the counters specified by the property are set to the given integer. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/counter-reset + */ + counterReset?: any; + + /** + * The cue property specifies sound files (known as an "auditory icon") to be played by speech media agents before and after presenting an element's content; if only one file is specified, it is played both before and after. The volume at which the file(s) should be played, relative to the volume of the main element, may also be specified. The icon files may also be set separately with the cue-before and cue-after properties. + */ + cue?: any; + + /** + * The cue-after property specifies a sound file (known as an "auditory icon") to be played by speech media agents after presenting an element's content; the volume at which the file should be played may also be specified. The shorthand property cue sets cue sounds for both before and after the element is presented. + */ + cueAfter?: any; + + /** + * Specifies the mouse cursor displayed when the mouse pointer is over an element. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/cursor + */ + cursor?: CSSValue; + + /** + * The direction CSS property specifies the text direction/writing direction. The rtl is used for Hebrew or Arabic text, the ltr is for other languages. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/direction + */ + direction?: CSSGlobalValues | 'ltr' | 'rtl'; + + /** + * This property specifies the type of rendering box used for an element. It is a shorthand property for many other display properties. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/display + */ + display?: CSSValue; + + /** + * SVG: Used to determine or re-determine a scaled-baseline-table. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/dominant-baseline + */ + dominantBaseline?: 'auto' | 'use-script' | 'no-change' | 'reset-size' | 'ideographic' | 'alphabetic' | 'hanging' | 'mathematical' | 'central' | 'middle' | 'text-after-edge' | 'text-before-edge' | 'inherit'; + + /** + * The ‘empty-cells’ CSS property specifies how the user agent should render borders and backgrounds around cells that have no visible content. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/empty-cells + */ + emptyCells?: CSSGlobalValues | 'show' | 'hide'; + + /** + * The ‘fill’ property paints the interior of the given graphical element. The area to be painted consists of any areas inside the outline of the shape. To determine the inside of the shape, all subpaths are considered, and the interior is determined according to the rules associated with the current value of the ‘fill-rule’ property. The zero-width geometric outline of a shape is included in the area to be painted. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/fill + */ + fill?: CSSColor | 'context-stroke' | 'context-fill'; + + /** + * SVG: Specifies the opacity of the color or the content the current object is filled with. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/fill-opacity + */ + fillOpacity?: number; + + /** + * The ‘fill-rule’ property indicates the algorithm which is to be used to determine what parts of the canvas are included inside the shape. For a simple, non-intersecting path, it is intuitively clear what region lies "inside"; however, for a more complex path, such as a path that intersects itself or where one subpath encloses another, the interpretation of "inside" is not so obvious. + * The ‘fill-rule’ property provides two options for how the inside of a shape is determined: + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/fill-rule + */ + fillRule?: 'nonzero' | 'evenodd'; + + /** + * Applies various image processing effects. This property is largely unsupported. See Compatibility section for more information. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/filter + */ + filter?: string; + + /** + * Shorthand for `flex-grow`, `flex-shrink`, and `flex-basis`. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex + */ + flex?: number | string; + '-webkit-flex'?: number | string; + '-ms-flex'?: number | string; + + /** + * Obsolete, do not use. This property has been renamed to align-items. + * Specifies the alignment (perpendicular to the layout axis defined by the flex-direction property) of child elements of the object. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-align + */ + flexAlign?: any; + '-ms-flex-align'?: any; + '-webkit-flex-align'?: any; + + /** + * The flex-basis CSS property describes the initial main size of the flex item before any free space is distributed according to the flex factors described in the flex property (flex-grow and flex-shrink). + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis + */ + flexBasis?: any; + + /** + * The flex-direction CSS property describes how flex items are placed in the flex container, by setting the direction of the flex container's main axis. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction + */ + flexDirection?: any; + '-ms-flex-direction'?: any; + '-webkit-flex-direction'?: any; + + /** + * The flex-flow CSS property defines the flex container's main and cross axis. It is a shorthand property for the flex-direction and flex-wrap properties. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-flow + */ + flexFlow?: any; + + /** + * Specifies the flex grow factor of a flex item. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow + */ + flexGrow?: number; + '-ms-flex-grow'?: number; + '-webkit-flex-grow'?: number; + + /** + * Do not use. This property has been renamed to align-self + * Specifies the alignment (perpendicular to the layout axis defined by flex-direction) of child elements of the object. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-item-align + */ + flexItemAlign?: any; + + /** + * Do not use. This property has been renamed to align-content. + * Specifies how a flexbox's lines align within the flexbox when there is extra space along the axis that is perpendicular to the axis defined by the flex-direction property. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-line-pack + */ + flexLinePack?: any; + + flexPositive?: any; + '-ms-flex-positive'?: any; + '-webkit-flex-positive'?: any; + + flexNegative?: any; + '-ms-flex-negative'?: any; + '-webkit-flex-negative'?: any; + + /** + * Gets or sets a value that specifies the ordinal group that a flexbox element belongs to. This ordinal value identifies the display order for the group. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-order + */ + flexOrder?: any; + + /** + * Specifies the flex shrink factor of a flex item. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink + */ + flexShrink?: number; + '-ms-flex-shrink'?: number; + '-webkit-flex-shrink'?: number; + + /** + * Specifies whether flex items are forced into a single line or can be wrapped onto multiple lines. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap + */ + flexWrap?: CSSGlobalValues | 'nowrap' | 'wrap' | 'wrap-reverse'; + '-ms-flex-wrap'?: CSSGlobalValues | 'nowrap' | 'wrap' | 'wrap-reverse'; + '-webkit-flex-wrap'?: CSSGlobalValues | 'nowrap' | 'wrap' | 'wrap-reverse'; + + /** + * Elements which have the style float are floated horizontally. These elements can move as far to the left or right of the containing element. All elements after the floating element will flow around it, but elements before the floating element are not impacted. If several floating elements are placed after each other, they will float next to each other as long as there is room. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/float + */ + float?: CSSGlobalValues | 'left' | 'right' | 'none' | 'inline-start' | 'inline-end'; + + /** + * Flows content from a named flow (specified by a corresponding flow-into) through selected elements to form a dynamic chain of layout regions. + */ + flowFrom?: any; + + /** + * The font property is shorthand that allows you to do one of two things: you can either set up six of the most mature font properties in one line, or you can set one of a choice of keywords to adopt a system font setting. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font + */ + font?: any; + + /** + * The font-family property allows one or more font family names and/or generic family names to be specified for usage on the selected element(s)' text. The browser then goes through the list; for each character in the selection it applies the first font family that has an available glyph for that character. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-family + */ + fontFamily?: any; + + /** + * The font-kerning property allows contextual adjustment of inter-glyph spacing, i.e. the spaces between the characters in text. This property controls metric kerning - that utilizes adjustment data contained in the font. Optical Kerning is not supported as yet. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-kerning + */ + fontKerning?: CSSGlobalValues | 'auto' | 'normal' | 'none'; + + /** + * Specifies the size of the font. Used to compute em and ex units. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-size + */ + fontSize?: CSSValue; + + /** + * The font-size-adjust property adjusts the font-size of the fallback fonts defined with font-family, so that the x-height is the same no matter what font is used. This preserves the readability of the text when fallback happens. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-size-adjust + */ + fontSizeAdjust?: any; + + /** + * Allows you to expand or condense the widths for a normal, condensed, or expanded font face. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-stretch + */ + fontStretch?: CSSGlobalValues | 'normal' | 'ultra-condensed' | 'extra-condensed' | 'condensed' | 'semi-condensed' | 'semi-expanded' | 'expanded' | 'extra-expanded' | 'ultra-expanded'; + + /** + * The font-style property allows normal, italic, or oblique faces to be selected. Italic forms are generally cursive in nature while oblique faces are typically sloped versions of the regular face. Oblique faces can be simulated by artificially sloping the glyphs of the regular face. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-style + */ + fontStyle?: CSSGlobalValues | 'normal' | 'italic' | 'oblique'; + + /** + * This value specifies whether the user agent is allowed to synthesize bold or oblique font faces when a font family lacks bold or italic faces. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-synthesis + */ + fontSynthesis?: any; + + /** + * The font-variant property enables you to select the small-caps font within a font family. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant + */ + fontVariant?: any; + + /** + * Fonts can provide alternate glyphs in addition to default glyph for a character. This property provides control over the selection of these alternate glyphs. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-alternates + */ + fontVariantAlternates?: any; + + /** + * Specifies the weight or boldness of the font. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight + */ + fontWeight?: CSSFontWeight; + + /** + * Lays out one or more grid items bound by 4 grid lines. Shorthand for setting grid-column-start, grid-column-end, grid-row-start, and grid-row-end in a single declaration. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-area + */ + gridArea?: any; + + /** + * Specifies the size of an implicitly-created grid column track. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-columns + */ + gridAutoColumns?: any; + + /** + * Controls how the auto-placement algorithm works, specifying exactly how auto-placed items get flowed into the grid. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-flow + */ + gridAutoFlow?: any; + + /** + * Specifies the size of an implicitly-created grid row track. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-rows + */ + gridAutoRows?: any; + + /** + * Controls a grid item's placement in a grid area, particularly grid position and a grid span. Shorthand for setting grid-column-start and grid-column-end in a single declaration. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column + */ + gridColumn?: any; + + /** + * Specifies the gutter between grid columns. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-gap + */ + gridColumnGap?: any; + + /** + * Controls a grid item's placement in a grid area as well as grid position and a grid span. The grid-column-end property (with grid-row-start, grid-row-end, and grid-column-start) determines a grid item's placement by specifying the grid lines of a grid item's grid area. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-end + */ + gridColumnEnd?: any; + + /** + * Determines a grid item's placement by specifying the starting grid lines of a grid item's grid area . A grid item's placement in a grid area consists of a grid position and a grid span. See also ( grid-row-start, grid-row-end, and grid-column-end) + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-start + */ + gridColumnStart?: any; + + /** + * Specifies the gutters between grid rows and columns, Shorthand for for grid-row-gap and grid-column-gap in a single declaration. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-gap + */ + gridGap?: any; + + /** + * Gets or sets a value that indicates which row an element within a Grid should appear in. Shorthand for setting grid-row-start and grid-row-end in a single declaration. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row + */ + gridRow?: any; + + /** + * Determines a grid item’s placement by specifying the block-end. A grid item's placement in a grid area consists of a grid position and a grid span. The grid-row-end property (with grid-row-start, grid-column-start, and grid-column-end) determines a grid item's placement by specifying the grid lines of a grid item's grid area. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-end + */ + gridRowEnd?: any; + + /** + * Specifies the gutter between grid rows. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-gap + */ + gridRowGap?: any; + + /** + * Determines a grid item’s start position within the grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start edge of its grid area. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-start + */ + gridRowStart?: any; + + /** + * Specifies a row position based upon an integer location, string value, or desired row size. + * css/properties/grid-row is used as short-hand for grid-row-position and grid-row-position + */ + gridRowPosition?: any; + + gridRowSpan?: any; + + /** + * Is a shorthand property for defining grid columns, rows, and areas. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-areas + */ + gridTemplate?: any; + + /** + * Specifies named grid areas which are not associated with any particular grid item, but can be referenced from the grid-placement properties. The syntax of the grid-template-areas property also provides a visualization of the structure of the grid, making the overall layout of the grid container easier to understand. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-areas + */ + gridTemplateAreas?: any; + + /** + * Specifies (with grid-template-rows) the line names and track sizing functions of the grid. Each sizing function can be specified as a length, a percentage of the grid container’s size, a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns + */ + gridTemplateColumns?: any; + + /** + * Specifies (with grid-template-columns) the line names and track sizing functions of the grid. Each sizing function can be specified as a length, a percentage of the grid container’s size, a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-rows + */ + gridTemplateRows?: any; + + /** + * Sets the height of an element. The content area of the element height does not include the padding, border, and margin of the element. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/height + */ + height?: CSSValue<'auto' | CSSLength | CSSPercentage | CSSGlobalValues>; + + /** + * Specifies the minimum number of characters in a hyphenated word + * @see https://msdn.microsoft.com/en-us/library/hh771865(v=vs.85).aspx + */ + hyphenateLimitChars?: any; + + /** + * Indicates the maximum number of successive hyphenated lines in an element. The ‘no-limit’ value means that there is no limit. + * @see https://msdn.microsoft.com/en-us/library/hh771867(v=vs.85).aspx + */ + hyphenateLimitLines?: any; + + /** + * Specifies the maximum amount of trailing whitespace (before justification) that may be left in a line before hyphenation is triggered to pull part of a word from the next line back up into the current one. + * @see https://msdn.microsoft.com/en-us/library/hh771869(v=vs.85).aspx + */ + hyphenateLimitZone?: any; + + /** + * Specifies whether or not words in a sentence can be split by the use of a manual or automatic hyphenation mechanism. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens + */ + hyphens?: CSSGlobalValues | string | 'none' | 'manual' | 'auto'; + + /** + * Controls the state of the input method editor for text fields. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/ime-mode + */ + imeMode?: CSSGlobalValues | 'auto' | 'normal' | 'active' | 'inactive' | 'disabled'; + + /** + * Defines how the browser distributes space between and around flex items + * along the main-axis of their container. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content + */ + justifyContent?: JustifyContent; + '-webkit-justify-content'?: JustifyContent; + '-ms-flex-pack'?: string; + + /** + * Defines the default justify-self for all items of the box, given them the + * default way of justifying each box along the appropriate axis + */ + justifyItems?: JustifyItems; + + /** + * Defines the way of justifying a box inside its container along the appropriate axis. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self + */ + justifySelf?: JustifySelf; + + layoutGrid?: any; + + layoutGridChar?: any; + + layoutGridLine?: any; + + layoutGridMode?: any; + + layoutGridType?: any; + + /** + * Sets the left edge of an element + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/left + */ + left?: CSSValue<'auto' | CSSLength | CSSPercentage | CSSGlobalValues>; + + /** + * The letter-spacing CSS property specifies the spacing behavior between text characters. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/letter-spacing + */ + letterSpacing?: any; + + /** + * Deprecated. Gets or sets line-breaking rules for text in selected languages such as Japanese, Chinese, and Korean. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-break + */ + lineBreak?: any; + + lineClamp?: number; + + /** + * Specifies the height of an inline block level element. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height + */ + lineHeight?: CSSValue; + + /** + * Shorthand property that sets the list-style-type, list-style-position and list-style-image properties in one declaration. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/list-style + */ + listStyle?: any; + + /** + * This property sets the image that will be used as the list item marker. When the image is available, it will replace the marker set with the 'list-style-type' marker. That also means that if the image is not available, it will show the style specified by list-style-property + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-image + */ + listStyleImage?: any; + + /** + * Specifies if the list-item markers should appear inside or outside the content flow. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-position + */ + listStylePosition?: CSSGlobalValues | 'inside' | 'outside'; + + /** + * Specifies the type of list-item marker in a list. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-type + */ + listStyleType?: any; + + /** + * The margin property is shorthand to allow you to set all four margins of an element at once. Its equivalent longhand properties are margin-top, margin-right, margin-bottom and margin-left. Negative values are also allowed. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/margin + */ + margin?: any; + + /** + * margin-bottom sets the bottom margin of an element. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom + */ + marginBottom?: any; + + /** + * margin-left sets the left margin of an element. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left + */ + marginLeft?: any; + + /** + * margin-right sets the right margin of an element. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right + */ + marginRight?: any; + + /** + * margin-top sets the top margin of an element. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top + */ + marginTop?: CSSValueGeneral; + + /** + * The marquee-direction determines the initial direction in which the marquee content moves. + */ + marqueeDirection?: any; + + /** + * The 'marquee-style' property determines a marquee's scrolling behavior. + */ + marqueeStyle?: any; + + /** + * This property is shorthand for setting mask-image, mask-mode, mask-repeat, mask-position, mask-clip, mask-origin, mask-composite and mask-size. Omitted values are set to their original properties' initial values. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/mask + */ + mask?: any; + + /** + * This property is shorthand for setting mask-border-source, mask-border-slice, mask-border-width, mask-border-outset, and mask-border-repeat. Omitted values are set to their original properties' initial values. + */ + maskBorder?: any; + + /** + * This property specifies how the images for the sides and the middle part of the mask image are scaled and tiled. The first keyword applies to the horizontal sides, the second one applies to the vertical ones. If the second keyword is absent, it is assumed to be the same as the first, similar to the CSS border-image-repeat property. + */ + maskBorderRepeat?: any; + + /** + * This property specifies inward offsets from the top, right, bottom, and left edges of the mask image, dividing it into nine regions: four corners, four edges, and a middle. The middle image part is discarded and treated as fully transparent black unless the fill keyword is present. The four values set the top, right, bottom and left offsets in that order, similar to the CSS border-image-slice property. + */ + maskBorderSlice?: any; + + /** + * Specifies an image to be used as a mask. An image that is empty, fails to download, is non-existent, or cannot be displayed is ignored and does not mask the element. + */ + maskBorderSource?: any; + + /** + * This property sets the width of the mask box image, similar to the CSS border-image-width property. + */ + maskBorderWidth?: CSSValue; + + /** + * Determines the mask painting area, which defines the area that is affected by the mask. The painted content of an element may be restricted to this area. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/mask-clip + */ + maskClip?: any; + + /** + * For elements rendered as a single box, specifies the mask positioning area. For elements rendered as multiple boxes (e.g., inline boxes on several lines, boxes on several pages) specifies which boxes box-decoration-break operates on to determine the mask positioning area(s). + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/mask-origin + */ + maskOrigin?: any; + + /** + * This property must not be used. It is no longer included in any standard or standard track specification, nor is it implemented in any browser. It is only used when the text-align-last property is set to size. It controls allowed adjustments of font-size to fit line content. + */ + maxFontSize?: any; + + /** + * Sets the maximum height for an element. It prevents the height of the element to exceed the specified value. If min-height is specified and is greater than max-height, max-height is overridden. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/max-height + */ + maxHeight?: CSSValue; + + /** + * Sets the maximum width for an element. It limits the width property to be larger than the value specified in max-width. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/max-width + */ + maxWidth?: CSSValue; + + /** + * Sets the minimum height for an element. It prevents the height of the element to be smaller than the specified value. The value of min-height overrides both max-height and height. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/min-height + */ + minHeight?: CSSValue; + + /** + * Sets the minimum width of an element. It limits the width property to be not smaller than the value specified in min-width. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/min-width + */ + minWidth?: CSSValue; + + /** + * The blend mode defines the formula that must be used to mix the colors with the backdrop + * @see https://drafts.fxtf.org/compositing-1/#mix-blend-mode + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode + */ + mixBlendMode?: CSSValue; + + /** + * Specifies how the contents of a replaced element should be fitted to the box established by its used height and width. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit + */ + objectFit?: CSSObjectFit; + + /** + * Determines the alignment of the element inside its box. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/object-position + */ + objectPosition?: string | CSSGlobalValues; + + /** + * Specifies the transparency of an element. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/opacity + */ + opacity?: number | CSSGlobalValues; + + /** + * Specifies the order used to lay out flex items in their flex container. + * Elements are laid out in the ascending order of the order value. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/order + */ + order?: number; + + /** + * In paged media, this property defines the minimum number of lines in + * a block container that must be left at the bottom of the page. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/orphans + */ + orphans?: number; + + /** + * The CSS outline property is a shorthand property for setting one or more of the individual outline properties outline-style, outline-width and outline-color in a single rule. In most cases the use of this shortcut is preferable and more convenient. + * Outlines differ from borders in the following ways: • Outlines do not take up space, they are drawn above the content. + * • Outlines may be non-rectangular. They are rectangular in Gecko/Firefox. Internet Explorer attempts to place the smallest contiguous outline around all elements or shapes that are indicated to have an outline. Opera draws a non-rectangular shape around a construct. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/outline + */ + outline?: any; + + /** + * The outline-color property sets the color of the outline of an element. An outline is a line that is drawn around elements, outside the border edge, to make the element stand out. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/outline-color + */ + outlineColor?: CSSValue; + + /** + * The outline-style property sets the style of the outline of an element. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/outline-style + */ + outlineStyle?: CSSGlobalValues | 'auto' | 'none' | 'dotted' | 'dashed' | 'solid' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset'; + + /** + * The outline-offset property offsets the outline and draw it beyond the border edge. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/outline-offset + */ + outlineOffset?: any; + + /** + * The outline-width CSS property is used to set the width of the outline of an element. An outline is a line that is drawn around elements, outside the border edge, to make the element stand out + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/outline-width + */ + outlineWidth?: CSSGlobalValues | 'thin' | 'medium' | 'thick' | CSSLength; + + /** + * The overflow property controls how extra content exceeding the bounding box of an element is rendered. It can be used in conjunction with an element that has a fixed width and height, to eliminate text-induced page distortion. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/overflow + */ + overflow?: CSSValue; + + /** + * Specifies the preferred scrolling methods for elements that overflow. + */ + overflowStyle?: any; + + /** + * The overflow-wrap CSS property specifies whether or not the browser should insert line breaks within words to prevent + * text from overflowing its content box. In contrast to word-break, overflow-wrap will only create a break if an entire + * word cannot be placed on its own line without overflowing. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap + */ + overflowWrap?: CSSGlobalValues | 'normal' | 'break-word'; + + /** + * Controls how extra content exceeding the x-axis of the bounding box of an element is rendered. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-x + */ + overflowX?: CSSValue; + + /** + * Controls how extra content exceeding the y-axis of the bounding box of an element is rendered. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-y + */ + overflowY?: CSSValue; + + /** + * The padding optional CSS property sets the required padding space on one to four sides of an element. The padding area is the space between an element and its border. Negative values are not allowed but decimal values are permitted. The element size is treated as fixed, and the content of the element shifts toward the center as padding is increased. + * The padding property is a shorthand to avoid setting each side separately (padding-top, padding-right, padding-bottom, padding-left). + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/padding + */ + padding?: any; + + /** + * The padding-bottom CSS property of an element sets the padding space required on the bottom of an element. The padding area is the space between the content of the element and its border. Contrary to margin-bottom values, negative values of padding-bottom are invalid. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/padding-bottom + */ + paddingBottom?: CSSValue; + + /** + * The padding-left CSS property of an element sets the padding space required on the left side of an element. The padding area is the space between the content of the element and its border. Contrary to margin-left values, negative values of padding-left are invalid. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/padding-left + */ + paddingLeft?: CSSValue; + + /** + * The padding-right CSS property of an element sets the padding space required on the right side of an element. The padding area is the space between the content of the element and its border. Contrary to margin-right values, negative values of padding-right are invalid. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/padding-right + */ + paddingRight?: CSSValue; + + /** + * The padding-top CSS property of an element sets the padding space required on the top of an element. The padding area is the space between the content of the element and its border. Contrary to margin-top values, negative values of padding-top are invalid. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/padding-top + */ + paddingTop?: CSSValue; + + /** + * The page-break-after property is supported in all major browsers. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/page-break-after + */ + pageBreakAfter?: CSSGlobalValues | 'auto' | 'always' | 'avoid' | 'left' | 'right' | 'recto' | 'verso'; + + /** + * The page-break-before property sets the page-breaking behavior before an element. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/page-break-before + */ + pageBreakBefore?: CSSGlobalValues | 'auto' | 'always' | 'avoid' | 'left' | 'right' | 'recto' | 'verso'; + + /** + * Sets the page-breaking behavior inside an element. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/page-break-inside + */ + pageBreakInside?: CSSGlobalValues | 'auto' | 'avoid'; + + /** + * The pause property determines how long a speech media agent should pause before and after presenting an element. It is a shorthand for the pause-before and pause-after properties. + */ + pause?: any; + + /** + * The pause-after property determines how long a speech media agent should pause after presenting an element. It may be replaced by the shorthand property pause, which sets pause time before and after. + */ + pauseAfter?: any; + + /** + * The pause-before property determines how long a speech media agent should pause before presenting an element. It may be replaced by the shorthand property pause, which sets pause time before and after. + */ + pauseBefore?: any; + + /** + * The perspective property defines how far an element is placed from the view on the z-axis, from the screen to the viewer. + * Perspective defines how an object is viewed. In graphic arts, perspective is the representation on a flat surface of what the viewer's eye would see in a 3D space. (See Wikipedia for more information about graphical perspective and for related illustrations.) + * The illusion of perspective on a flat surface, such as a computer screen, is created by projecting points on the flat surface as they would appear if the flat surface were a window through which the viewer was looking at the object. In discussion of virtual environments, this flat surface is called a projection plane. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/perspective + */ + perspective?: any; + + /** + * The perspective-origin property establishes the origin for the perspective property. It effectively sets the X and Y position at which the viewer appears to be looking at the children of the element. + * When used with perspective, perspective-origin changes the appearance of an object, as if a viewer were looking at it from a different origin. An object appears differently if a viewer is looking directly at it versus looking at it from below, above, or from the side. Thus, the perspective-origin is like a vanishing point. + * The default value of perspective-origin is 50% 50%. This displays an object as if the viewer's eye were positioned directly at the center of the screen, both top-to-bottom and left-to-right. A value of 0% 0% changes the object as if the viewer was looking toward the top left angle. A value of 100% 100% changes the appearance as if viewed toward the bottom right angle. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/perspective-origin + */ + perspectiveOrigin?: any; + + /** + * The pointer-events property allows you to control whether an element can be the target for the pointing device (e.g, mouse, pen) events. + * @see https://developer.mozilla.org/en/docs/Web/CSS/pointer-events + */ + pointerEvents?: CSSGlobalValues | 'auto' | 'none' | 'visiblePainted' | 'visibleFill' | 'visibleStroke' | 'visible' | 'painted' | 'fill' | 'stroke' | 'all'; + + /** + * The position property controls the type of positioning used by an element within its parent elements. The effect of the position property depends on a lot of factors, for example the position property of parent elements. + * @see https://developer.mozilla.org/en/docs/Web/CSS/position + */ + position?: CSSValue; + + /** + * Obsolete: unsupported. + * This property determines whether or not a full-width punctuation mark character should be trimmed if it appears at the beginning of a line, so that its "ink" lines up with the first glyph in the line above and below. + */ + punctuationTrim?: any; + + /** + * Sets the type of quotation marks for embedded quotations. + * @see https://developer.mozilla.org/en/docs/Web/CSS/quotes + */ + quotes?: any; + + /** + * Controls whether the last region in a chain displays additional 'overset' content according its default overflow property, or if it displays a fragment of content as if it were flowing into a subsequent region. + */ + regionFragment?: any; + + /** + * The resize CSS property lets you control the resizability of an element. + * @see https://developer.mozilla.org/en/docs/Web/CSS/resize + */ + resize?: CSSGlobalValues | 'none' | 'both ' | 'horizontal' | 'vertical'; + + /** + * The rest-after property determines how long a speech media agent should pause after presenting an element's main content, before presenting that element's exit cue sound. It may be replaced by the shorthand property rest, which sets rest time before and after. + */ + restAfter?: any; + + /** + * The rest-before property determines how long a speech media agent should pause after presenting an intro cue sound for an element, before presenting that element's main content. It may be replaced by the shorthand property rest, which sets rest time before and after. + */ + restBefore?: any; + + /** + * Specifies the position an element in relation to the right side of the containing element. + * @see https://developer.mozilla.org/en/docs/Web/CSS/right + */ + right?: CSSValue<'auto' | CSSLength | CSSPercentage | CSSGlobalValues>; + + /** + * Specifies the distribution of the different ruby elements over the base. + * @see https://developer.mozilla.org/en/docs/Web/CSS/ruby-align + */ + rubyAlign?: CSSGlobalValues | 'start' | 'center' | 'space-between' | 'space-around'; + + /** + * Specifies the position of a ruby element relatives to its base element. It can be position over the element (over), under it (under), or between the characters, on their right side (inter-character). + * @see https://developer.mozilla.org/en/docs/Web/CSS/ruby-position + */ + rubyPosition?: CSSGlobalValues | 'over' | 'under' | 'inter-character'; + + /** + * SVG: For the element, this attribute defines the x-radius of the element. A value of zero disables rendering of the element. + * https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/rx + */ + rx?: number; + + /** + * SVG: For the element, this attribute defines the y-radius of the element. A value of zero disables rendering of the element. + * https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/ry + */ + ry?: number; + + /** + * Defines the alpha channel threshold used to extract a shape from an image. Can be thought of as a "minimum opacity" threshold; that is, a value of 0.5 means that the shape will enclose all the pixels that are more than 50% opaque. + * @see https://developer.mozilla.org/en/docs/Web/CSS/shape-image-threshold + */ + shapeImageThreshold?: any; + + /** + * A future level of CSS Shapes will define a shape-inside property, which will define a shape to wrap content within the element. See Editor's Draft and CSSWG wiki page on next-level plans + */ + shapeInside?: any; + + /** + * Adds a margin to a shape-outside. In effect, defines a new shape that is the smallest contour around all the points that are the shape-margin distance outward perpendicular to each point on the underlying shape. For points where a perpendicular direction is not defined (e.g., a triangle corner), takes all points on a circle centered at the point and with a radius of the shape-margin distance. This property accepts only non-negative values. + * @see https://developer.mozilla.org/en/docs/Web/CSS/shape-margin + */ + shapeMargin?: any; + + /** + * Declares a shape around which text should be wrapped, with possible modifications from the shape-margin property. The shape defined by shape-outside and shape-margin changes the geometry of a float element's float area. + * @see https://developer.mozilla.org/en/docs/Web/CSS/shape-outside + */ + shapeOutside?: any; + + /** + * The speak property determines whether or not a speech synthesizer will read aloud the contents of an element. + */ + speak?: any; + + /** + * The speak-as property determines how the speech synthesizer interprets the content: words as whole words or as a sequence of letters, numbers as a numerical value or a sequence of digits, punctuation as pauses in speech or named punctuation characters. + */ + speakAs?: any; + + /** + * Location of a font-face. Used with the @font-face at rule + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src + */ + src?: CSSValueString; + + /** + * SVG: Defines the color of the outline on a given graphical element. + * @see https://developer.mozilla.org/en/docs/Web/CSS/stroke + */ + stroke?: string; + + /** + * SVG: Controls the pattern of dashes and gaps used to stroke paths. + * @see https://developer.mozilla.org/en/docs/Web/CSS/stroke-dasharray + */ + strokeDasharray?: number[]; + + /** + * SVG: Specifies the distance into the dash pattern to start the dash + * @see https://developer.mozilla.org/en/docs/Web/SVG/Attribute/stroke-dashoffset + */ + strokeDashoffset?: CSSValue; + + /** + * SVG: Specifies the shape to be used at the end of open subpaths when they are stroked. + * @see https://developer.mozilla.org/en/docs/Web/SVG/Attribute/stroke-linecap + */ + strokeLinecap?: CSSGlobalValues | 'butt' | 'round' | 'square'; + + /** + * SVG: Specifies the opacity of the outline on the current object. + * @see https://developer.mozilla.org/en/docs/Web/CSS/stroke-opacity + */ + strokeOpacity?: number; + + /** + * SVG: Specifies the width of the outline on the current object. + * @see https://developer.mozilla.org/en/docs/Web/CSS/stroke-width + */ + strokeWidth?: CSSValue; + + /** + * The tab-size CSS property is used to customise the width of a tab (U+0009) character. + * @see https://developer.mozilla.org/en/docs/Web/CSS/tab-size + */ + tabSize?: any; + + /** + * The 'table-layout' property controls the algorithm used to lay out the table cells, rows, and columns. + * @see https://developer.mozilla.org/en/docs/Web/CSS/table-layout + */ + tableLayout?: any; + + /** + * SVG: The text-anchor attribute is used to align (start-, middle- or end-alignment) a string of text relative to a given point. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/text-anchor + */ + textAnchor?: 'start' | 'middle' | 'end' | 'inherit'; + + /** + * The text-align CSS property describes how inline content like text is aligned in its parent block element. text-align does not control the alignment of block elements itself, only their inline content. + * @see https://developer.mozilla.org/en/docs/Web/CSS/text-align + */ + textAlign?: CSSGlobalValues | 'start' | 'end' | 'left' | 'right' | 'center' | 'justify' | 'justify-all' | 'match-parent'; + + /** + * The text-align-last CSS property describes how the last line of a block element or a line before line break is aligned in its parent block element. + * @see https://developer.mozilla.org/en/docs/Web/CSS/text-align-last + */ + textAlignLast?: CSSGlobalValues | 'auto' | 'start' | 'end' | 'left' | 'right' | 'center' | 'justify'; + + /** + * The text-decoration CSS property is used to set the text formatting to underline, overline, line-through or blink. + * underline and overline decorations are positioned under the text, line-through over it. + * @see https://developer.mozilla.org/en/docs/Web/CSS/text-decoration + */ + textDecoration?: any; + + /** + * Sets the color of any text decoration, such as underlines, overlines, and strike throughs. + * @see https://developer.mozilla.org/en/docs/Web/CSS/text-decoration-color + */ + textDecorationColor?: CSSValue; + + /** + * Sets what kind of line decorations are added to an element, such as underlines, overlines, etc. + * @see https://developer.mozilla.org/en/docs/Web/CSS/text-decoration-line + */ + textDecorationLine?: any; + + textDecorationLineThrough?: any; + + textDecorationNone?: any; + + textDecorationOverline?: any; + + /** + * Specifies what parts of an element’s content are skipped over when applying any text decoration. + * @see https://developer.mozilla.org/en/docs/Web/CSS/text-decoration-skip + */ + textDecorationSkip?: any; + + /** + * This property specifies the style of the text decoration line drawn on the specified element. The intended meaning for the values are the same as those of the border-style-properties. + * @see https://developer.mozilla.org/en/docs/Web/CSS/text-decoration-style + */ + textDecorationStyle?: CSSGlobalValues | 'solid' | 'double' | 'dotted' | 'dashed' | 'wavy'; + + textDecorationUnderline?: any; + + /** + * The text-emphasis property will apply special emphasis marks to the elements text. Slightly similar to the text-decoration property only that this property can have affect on the line-height. It also is noted that this is shorthand for text-emphasis-style and for text-emphasis-color. + * @see https://developer.mozilla.org/en/docs/Web/CSS/text-emphasis + */ + textEmphasis?: any; + + /** + * The text-emphasis-color property specifies the foreground color of the emphasis marks. + * @see https://developer.mozilla.org/en/docs/Web/CSS/text-emphasis-color + */ + textEmphasisColor?: CSSValue; + + /** + * The text-emphasis-style property applies special emphasis marks to an element's text. + * @see https://developer.mozilla.org/en/docs/Web/CSS/text-emphasis-style + */ + textEmphasisStyle?: any; + + /** + * This property helps determine an inline box's block-progression dimension, derived from the text-height and font-size properties for non-replaced elements, the height or the width for replaced elements, and the stacked block-progression dimension for inline-block elements. The block-progression dimension determines the position of the padding, border and margin for the element. + */ + textHeight?: CSSValue; + + /** + * Specifies the amount of space horizontally that should be left on the first line of the text of an element. This horizontal spacing is at the beginning of the first line and is in respect to the left edge of the containing block box. + * @see https://developer.mozilla.org/en/docs/Web/CSS/text-indent + */ + textIndent?: any; + + textJustifyTrim?: any; + + textKashidaSpace?: any; + + /** + * The text-line-through property is a shorthand property for text-line-through-style, text-line-through-color and text-line-through-mode. (Considered obsolete; use text-decoration instead.) + */ + textLineThrough?: any; + + /** + * Specifies the line colors for the line-through text decoration. + * (Considered obsolete; use text-decoration-color instead.) + */ + textLineThroughColor?: CSSValue; + + /** + * Sets the mode for the line-through text decoration, determining whether the text decoration affects the space characters or not. + * (Considered obsolete; use text-decoration-skip instead.) + */ + textLineThroughMode?: any; + + /** + * Specifies the line style for line-through text decoration. + * (Considered obsolete; use text-decoration-style instead.) + */ + textLineThroughStyle?: any; + + /** + * Specifies the line width for the line-through text decoration. + */ + textLineThroughWidth?: CSSValue; + + /** + * The text-overflow shorthand CSS property determines how overflowed content that is not displayed is signaled to the users. It can be clipped, display an ellipsis ('…', U+2026 HORIZONTAL ELLIPSIS) or a Web author-defined string. It covers the two long-hand properties text-overflow-mode and text-overflow-ellipsis + * @see https://developer.mozilla.org/en/docs/Web/CSS/text-overflow + */ + textOverflow?: CSSGlobalValues | 'clip' | 'ellipsis' | string; + + /** + * The text-overline property is the shorthand for the text-overline-style, text-overline-width, text-overline-color, and text-overline-mode properties. + */ + textOverline?: any; + + /** + * Specifies the line color for the overline text decoration. + */ + textOverlineColor?: CSSValue; + + /** + * Sets the mode for the overline text decoration, determining whether the text decoration affects the space characters or not. + */ + textOverlineMode?: any; + + /** + * Specifies the line style for overline text decoration. + */ + textOverlineStyle?: any; + + /** + * Specifies the line width for the overline text decoration. + */ + textOverlineWidth?: CSSValue; + + /** + * The text-rendering CSS property provides information to the browser about how to optimize when rendering text. Options are: legibility, speed or geometric precision. + * @see https://developer.mozilla.org/en/docs/Web/CSS/text-rendering + */ + textRendering?: CSSGlobalValues | 'auto' | 'optimizeSpeed' | 'optimizeLegibility' | 'geometricPrecision'; + + /** + * Obsolete: unsupported. + */ + textScript?: any; + + /** + * The CSS text-shadow property applies one or more drop shadows to the text and of an element. Each shadow is specified as an offset from the text, along with optional color and blur radius values. + * @see https://developer.mozilla.org/en/docs/Web/CSS/text-shadow + */ + textShadow?: any; + + /** + * This property transforms text for styling purposes. (It has no effect on the underlying content.) + * @see https://developer.mozilla.org/en/docs/Web/CSS/text-transform + */ + textTransform?: CSSGlobalValues | 'none' | 'capitalize' | 'uppercase' | 'lowercase' | 'full-width'; + + /** + * Unsupported. + * This property will add a underline position value to the element that has an underline defined. + */ + textUnderlinePosition?: any; + + /** + * After review this should be replaced by text-decoration should it not? + * This property will set the underline style for text with a line value for underline, overline, and line-through. + */ + textUnderlineStyle?: any; + + /** + * This property specifies how far an absolutely positioned box's top margin edge is offset below the top edge of the box's containing block. For relatively positioned boxes, the offset is with respect to the top edges of the box itself (i.e., the box is given a position in the normal flow, then offset from that position according to these properties). + * @see https://developer.mozilla.org/en/docs/Web/CSS/top + */ + top?: CSSValue<'auto' | CSSLength | CSSPercentage | CSSGlobalValues>; + + /** + * Determines whether touch input may trigger default behavior supplied by the user agent, such as panning or zooming. + * @see https://developer.mozilla.org/en/docs/Web/CSS/touch-action + */ + touchAction?: CSSGlobalValues | 'auto' | 'none' | 'pan-x' | 'pan-left' | 'pan-right' | 'pan-y' | 'pan-up' | 'pan-down' | 'manipulation'; + + /** + * CSS transforms allow elements styled with CSS to be transformed in two-dimensional or three-dimensional space. Using this property, elements can be translated, rotated, scaled, and skewed. The value list may consist of 2D and/or 3D transform values. + * @see https://developer.mozilla.org/en/docs/Web/CSS/transform + */ + transform?: CSSTransformFunction; + + /** + * This property defines the origin of the transformation axes relative to the element to which the transformation is applied. + * @see https://developer.mozilla.org/en/docs/Web/CSS/transform-origin + */ + transformOrigin?: any; + + /** + * This property allows you to define the relative position of the origin of the transformation grid along the z-axis. + */ + transformOriginZ?: any; + + /** + * This property specifies how nested elements are rendered in 3D space relative to their parent. + * @see https://developer.mozilla.org/en/docs/Web/CSS/transform-style + */ + transformStyle?: CSSGlobalValues | 'flat' | 'preserve-3d'; + + /** + * The transition CSS property is a shorthand property for transition-property, transition-duration, transition-timing-function, and transition-delay. It allows to define the transition between two states of an element. + * @see https://developer.mozilla.org/en/docs/Web/CSS/transition + */ + transition?: any; + + /** + * Defines when the transition will start. A value of ‘0s’ means the transition will execute as soon as the property is changed. Otherwise, the value specifies an offset from the moment the property is changed, and the transition will delay execution by that offset. + * @see https://developer.mozilla.org/en/docs/Web/CSS/transition-delay + */ + transitionDelay?: any; + + /** + * The 'transition-duration' property specifies the length of time a transition animation takes to complete. + * @see https://developer.mozilla.org/en/docs/Web/CSS/transition-duration + */ + transitionDuration?: any; + + /** + * The 'transition-property' property specifies the name of the CSS property to which the transition is applied. + * @see https://developer.mozilla.org/en/docs/Web/CSS/transition-property + */ + transitionProperty?: CSSValueString; + + /** + * Sets the pace of action within a transition + * @see https://developer.mozilla.org/en/docs/Web/CSS/transition-timing-function + */ + transitionTimingFunction?: CSSTimingFunction; + + /** + * The unicode-bidi CSS property specifies the level of embedding with respect to the bidirectional algorithm. + * @see https://developer.mozilla.org/en/docs/Web/CSS/unicode-bidi + */ + unicodeBidi?: any; + + /** + * unicode-range allows you to set a specific range of characters to be downloaded from a font (embedded using @font-face) and made available for use on the current page. + * @see https://developer.mozilla.org/en/docs/Web/CSS/unicode-range + */ + unicodeRange?: any; + + /** + * This is for all the high level UX stuff. + */ + userFocus?: any; + + /** + * For inputing user content + */ + userInput?: any; + + /** + * User select + * @see https://developer.mozilla.org/en/docs/Web/CSS/user-select + */ + userSelect?: 'auto' | 'text' | 'none' | 'contain' | 'all'; + '-moz-user-select'?: 'auto' | 'text' | 'none' | 'contain' | 'all'; + '-webkit-user-select'?: 'auto' | 'text' | 'none' | 'contain' | 'all'; + '-ms-user-select'?: 'auto' | 'text' | 'none' | 'contain' | 'all'; + + /** + * The vertical-align property controls how inline elements or text are vertically aligned compared to the baseline. If this property is used on table-cells it controls the vertical alignment of content of the table cell. + * @see https://developer.mozilla.org/en/docs/Web/CSS/vertical-align + */ + verticalAlign?: CSSGlobalValues | 'baseline' | 'sub' | 'super' | 'text-top' | 'text-bottom' | 'middle' | 'top' | 'bottom' | CSSLength | CSSPercentage; + + /** + * The visibility property specifies whether the boxes generated by an element are rendered. + * @see https://developer.mozilla.org/en/docs/Web/CSS/visibility + */ + visibility?: CSSGlobalValues | 'visible' | 'hidden' | 'collapse'; + + /** + * The voice-balance property sets the apparent position (in stereo sound) of the synthesized voice for spoken media. + */ + voiceBalance?: any; + + /** + * The voice-duration property allows the author to explicitly set the amount of time it should take a speech synthesizer to read an element's content, for example to allow the speech to be synchronized with other media. With a value of auto (the default) the length of time it takes to read the content is determined by the content itself and the voice-rate property. + */ + voiceDuration?: any; + + /** + * The voice-family property sets the speaker's voice used by a speech media agent to read an element. The speaker may be specified as a named character (to match a voice option in the speech reading software) or as a generic description of the age and gender of the voice. Similar to the font-family property for visual media, a comma-separated list of fallback options may be given in case the speech reader does not recognize the character name or cannot synthesize the requested combination of generic properties. + */ + voiceFamily?: any; + + /** + * The voice-pitch property sets pitch or tone (high or low) for the synthesized speech when reading an element; the pitch may be specified absolutely or relative to the normal pitch for the voice-family used to read the text. + */ + voicePitch?: any; + + /** + * The voice-range property determines how much variation in pitch or tone will be created by the speech synthesize when reading an element. Emphasized text, grammatical structures and punctuation may all be rendered as changes in pitch, this property determines how strong or obvious those changes are; large ranges are associated with enthusiastic or emotional speech, while small ranges are associated with flat or mechanical speech. + */ + voiceRange?: any; + + /** + * The voice-rate property sets the speed at which the voice synthesized by a speech media agent will read content. + */ + voiceRate?: any; + + /** + * The voice-stress property sets the level of vocal emphasis to be used for synthesized speech reading the element. + */ + voiceStress?: any; + + /** + * The voice-volume property sets the volume for spoken content in speech media. It replaces the deprecated volume property. + */ + voiceVolume?: any; + + /** + * The white-space property controls whether and how white space inside the element is collapsed, and whether lines may wrap at unforced "soft wrap" opportunities. + * @see https://developer.mozilla.org/en/docs/Web/CSS/white-space + */ + whiteSpace?: CSSGlobalValues | 'normal' | 'nowrap' | 'pre' | 'pre-line' | 'pre-wrap'; + + /** + * Obsolete: unsupported. + */ + whiteSpaceTreatment?: any; + + /** + * In paged media, this property defines the mimimum number of lines + * that must be left at the top of the second page. + * @see https://developer.mozilla.org/en/docs/Web/CSS/widows + */ + widows?: number; + + /** + * Specifies the width of the content area of an element. The content area of the element width does not include the padding, border, and margin of the element. + * @see https://developer.mozilla.org/en/docs/Web/CSS/width + */ + width?: CSSValue<'auto' | CSSLength | CSSPercentage | CSSGlobalValues>; + + /** + * The ‘will-change’ CSS property provides a way for authors to hint browsers about the kind of changes to be expected on an element, so that the browser can set up appropriate optimizations ahead of time before the element is actually changed. These kind of optimizations can increase the responsiveness of a page by doing potentially expensive work ahead of time before they are actually required. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/will-change + */ + willChange?: CSSValue<'auto' | 'scroll-position' | 'contents' | CSSValueString>; + + /** + * The word-break property is often used when there is long generated content that is strung together without and spaces or hyphens to beak apart. A common case of this is when there is a long URL that does not have any hyphens. This case could potentially cause the breaking of the layout as it could extend past the parent element. + * @see https://developer.mozilla.org/en/docs/Web/CSS/word-break + */ + wordBreak?: CSSGlobalValues | 'normal' | 'break-all' | 'keep-all'; + + /** + * The word-spacing CSS property specifies the spacing behavior between "words". + * @see https://developer.mozilla.org/en/docs/Web/CSS/word-spacing + */ + wordSpacing?: CSSGlobalValues | 'normal' | CSSLength | CSSPercentage; + + /** + * An alias of css/properties/overflow-wrap, word-wrap defines whether to break words when the content exceeds the boundaries of its container. + * @see https://developer.mozilla.org/en/docs/Web/CSS/word-wrap + */ + wordWrap?: CSSGlobalValues | 'normal' | 'break-word'; + + /** + * Specifies how exclusions affect inline content within block-level elements. Elements lay out their inline content in their content area but wrap around exclusion areas. + */ + wrapFlow?: any; + + /** + * Set the value that is used to offset the inner wrap shape from other shapes. Inline content that intersects a shape with this property will be pushed by this shape's margin. + */ + wrapMargin?: any; + + /** + * Obsolete and unsupported. Do not use. + * This CSS property controls the text when it reaches the end of the block in which it is enclosed. + */ + wrapOption?: any; + + /** + * writing-mode specifies if lines of text are laid out horizontally or vertically, and the direction which lines of text and blocks progress. + * @see https://developer.mozilla.org/en/docs/Web/CSS/writing-mode + */ + writingMode?: CSSGlobalValues | 'horizontal-tb' | 'vertical-rl' | 'vertical-lr' | 'sideways-rl' | 'sideways-lr'; + + /** + * The z-index property specifies the z-order of an element and its descendants. + * When elements overlap, z-order determines which one covers the other. + * @see https://developer.mozilla.org/en/docs/Web/CSS/z-index + */ + zIndex?: CSSGlobalValues | 'auto' | number; + + /** + * Sets the initial zoom factor of a document defined by @viewport. + * @see https://developer.mozilla.org/en/docs/Web/CSS/zoom + */ + zoom?: 'auto' | number; + + // VENDOR prefixes + // non-authoritative source: http://peter.sh/experiments/vendor-prefixed-css-property-overview/ + '-apple-trailing-word'?: CSSValueGeneral; + '-epub-caption-side'?: CSSValueGeneral; + '-epub-hyphens'?: CSSValueGeneral; + '-epub-text-combine'?: CSSValueGeneral; + '-epub-text-emphasis'?: CSSValueGeneral; + '-epub-text-emphasis-color'?: CSSValueGeneral; + '-epub-text-emphasis-style'?: CSSValueGeneral; + '-epub-text-orientation'?: CSSValueGeneral; + '-epub-text-transform'?: CSSValueGeneral; + '-epub-word-break'?: CSSValueGeneral; + '-epub-writing-mode'?: CSSValueGeneral; + '-internal-marquee-direction'?: CSSValueGeneral; + '-internal-marquee-increment'?: CSSValueGeneral; + '-internal-marquee-repetition'?: CSSValueGeneral; + '-internal-marquee-speed'?: CSSValueGeneral; + '-internal-marquee-style'?: CSSValueGeneral; + '-moz-appearance'?: CSSValueGeneral; + '-moz-binding'?: CSSValueGeneral; + '-moz-border-bottom-colors'?: CSSValueGeneral; + '-moz-border-end'?: CSSValueGeneral; + '-moz-border-end-color'?: CSSValueGeneral; + '-moz-border-end-style'?: CSSValueGeneral; + '-moz-border-end-width'?: CSSValueGeneral; + '-moz-border-left-colors'?: CSSValueGeneral; + '-moz-border-right-colors'?: CSSValueGeneral; + '-moz-border-start'?: CSSValueGeneral; + '-moz-border-start-color'?: CSSValueGeneral; + '-moz-border-start-style'?: CSSValueGeneral; + '-moz-border-start-width'?: CSSValueGeneral; + '-moz-border-top-colors'?: CSSValueGeneral; + '-moz-box-align'?: CSSValueGeneral; + '-moz-box-direction'?: CSSValueGeneral; + '-moz-box-flex'?: CSSValueGeneral; + '-moz-box-ordinal-group'?: CSSValueGeneral; + '-moz-box-orient'?: CSSValueGeneral; + '-moz-box-pack'?: CSSValueGeneral; + '-moz-column-count'?: CSSValueGeneral; + '-moz-column-fill'?: CSSValueGeneral; + '-moz-column-gap'?: CSSValueGeneral; + '-moz-column-rule'?: CSSValueGeneral; + '-moz-column-rule-color'?: CSSValueGeneral; + '-moz-column-rule-style'?: CSSValueGeneral; + '-moz-column-rule-width'?: CSSValueGeneral; + '-moz-column-width'?: CSSValueGeneral; + '-moz-columns'?: CSSValueGeneral; + '-moz-control-character-visibility'?: CSSValueGeneral; + '-moz-float-edge'?: CSSValueGeneral; + '-moz-force-broken-image-icon'?: CSSValueGeneral; + '-moz-hyphens'?: CSSValueGeneral; + '-moz-image-region'?: CSSValueGeneral; + '-moz-margin-end'?: CSSValueGeneral; + '-moz-margin-start'?: CSSValueGeneral; + '-moz-math-display'?: CSSValueGeneral; + '-moz-math-variant'?: CSSValueGeneral; + '-moz-min-font-size-ratio'?: CSSValueGeneral; + '-moz-orient'?: CSSValueGeneral; + '-moz-osx-font-smoothing'?: CSSValueGeneral; + '-moz-outline-radius'?: CSSValueGeneral; + '-moz-outline-radius-bottomleft'?: CSSValueGeneral; + '-moz-outline-radius-bottomright'?: CSSValueGeneral; + '-moz-outline-radius-topleft'?: CSSValueGeneral; + '-moz-outline-radius-topright'?: CSSValueGeneral; + '-moz-padding-end'?: CSSValueGeneral; + '-moz-padding-start'?: CSSValueGeneral; + '-moz-script-level'?: CSSValueGeneral; + '-moz-script-min-size'?: CSSValueGeneral; + '-moz-script-size-multiplier'?: CSSValueGeneral; + '-moz-stack-sizing'?: CSSValueGeneral; + '-moz-tab-size'?: CSSValueGeneral; + '-moz-text-align-last'?: CSSValueGeneral; + '-moz-text-decoration-color'?: CSSValueGeneral; + '-moz-text-decoration-line'?: CSSValueGeneral; + '-moz-text-decoration-style'?: CSSValueGeneral; + '-moz-text-size-adjust'?: CSSValueGeneral; + '-moz-top-layer'?: CSSValueGeneral; + '-moz-transform'?: CSSValueGeneral; + '-moz-user-focus'?: CSSValueGeneral; + '-moz-user-input'?: CSSValueGeneral; + '-moz-user-modify'?: CSSValueGeneral; + '-moz-window-dragging'?: CSSValueGeneral; + '-moz-window-shadow'?: CSSValueGeneral; + '-ms-accelerator'?: CSSValueGeneral; + '-ms-animation'?: CSSValueGeneral; + '-ms-animation-delay'?: CSSValueGeneral; + '-ms-animation-direction'?: CSSValueGeneral; + '-ms-animation-duration'?: CSSValueGeneral; + '-ms-animation-fill-mode'?: CSSValueGeneral; + '-ms-animation-iteration-count'?: CSSValueGeneral; + '-ms-animation-name'?: CSSValueGeneral; + '-ms-animation-play-state'?: CSSValueGeneral; + '-ms-animation-timing-function'?: CSSValueGeneral; + '-ms-backface-visibility'?: CSSValueGeneral; + '-ms-background-position-x'?: CSSValueGeneral; + '-ms-background-position-y'?: CSSValueGeneral; + '-ms-behavior'?: CSSValueGeneral; + '-ms-block-progression'?: CSSValueGeneral; + '-ms-content-zoom-chaining'?: CSSValueGeneral; + '-ms-content-zoom-limit'?: CSSValueGeneral; + '-ms-content-zoom-limit-max'?: CSSValueGeneral; + '-ms-content-zoom-limit-min'?: CSSValueGeneral; + '-ms-content-zoom-snap'?: CSSValueGeneral; + '-ms-content-zoom-snap-points'?: CSSValueGeneral; + '-ms-content-zoom-snap-type'?: CSSValueGeneral; + '-ms-content-zooming'?: CSSValueGeneral; + '-ms-filter'?: CSSValueGeneral; + '-ms-flex-flow'?: CSSValueGeneral; + '-ms-flex-line-pack'?: CSSValueGeneral; + '-ms-flex-order'?: CSSValueGeneral; + '-ms-flex-preferred-size'?: CSSValueGeneral; + '-ms-flow-from'?: CSSValueGeneral; + '-ms-flow-into'?: CSSValueGeneral; + '-ms-font-feature-settings'?: CSSValueGeneral; + '-ms-grid-column'?: CSSValueGeneral; + '-ms-grid-column-align'?: CSSValueGeneral; + '-ms-grid-column-span'?: CSSValueGeneral; + '-ms-grid-columns'?: CSSValueGeneral; + '-ms-grid-row'?: CSSValueGeneral; + '-ms-grid-row-align'?: CSSValueGeneral; + '-ms-grid-row-span'?: CSSValueGeneral; + '-ms-grid-rows'?: CSSValueGeneral; + '-ms-high-contrast-adjust'?: CSSValueGeneral; + '-ms-hyphenate-limit-chars'?: CSSValueGeneral; + '-ms-hyphenate-limit-lines'?: CSSValueGeneral; + '-ms-hyphenate-limit-zone'?: CSSValueGeneral; + '-ms-hyphens'?: CSSValueGeneral; + '-ms-ime-align'?: CSSValueGeneral; + '-ms-ime-mode'?: CSSValueGeneral; + '-ms-interpolation-mode'?: CSSValueGeneral; + '-ms-layout-flow'?: CSSValueGeneral; + '-ms-layout-grid'?: CSSValueGeneral; + '-ms-layout-grid-char'?: CSSValueGeneral; + '-ms-layout-grid-line'?: CSSValueGeneral; + '-ms-layout-grid-mode'?: CSSValueGeneral; + '-ms-layout-grid-type'?: CSSValueGeneral; + '-ms-line-break'?: CSSValueGeneral; + '-ms-overflow-style'?: CSSValueGeneral; + '-ms-overflow-x'?: CSSValueGeneral; + '-ms-overflow-y'?: CSSValueGeneral; + '-ms-perspective'?: CSSValueGeneral; + '-ms-perspective-origin'?: CSSValueGeneral; + '-ms-perspective-origin-x'?: CSSValueGeneral; + '-ms-perspective-origin-y'?: CSSValueGeneral; + '-ms-scroll-chaining'?: CSSValueGeneral; + '-ms-scroll-limit'?: CSSValueGeneral; + '-ms-scroll-limit-x-max'?: CSSValueGeneral; + '-ms-scroll-limit-x-min'?: CSSValueGeneral; + '-ms-scroll-limit-y-max'?: CSSValueGeneral; + '-ms-scroll-limit-y-min'?: CSSValueGeneral; + '-ms-scroll-rails'?: CSSValueGeneral; + '-ms-scroll-snap-points-x'?: CSSValueGeneral; + '-ms-scroll-snap-points-y'?: CSSValueGeneral; + '-ms-scroll-snap-type'?: CSSValueGeneral; + '-ms-scroll-snap-x'?: CSSValueGeneral; + '-ms-scroll-snap-y'?: CSSValueGeneral; + '-ms-scroll-translation'?: CSSValueGeneral; + '-ms-scrollbar-3dlight-color'?: CSSValueGeneral; + '-ms-scrollbar-arrow-color'?: CSSValueGeneral; + '-ms-scrollbar-base-color'?: CSSValueGeneral; + '-ms-scrollbar-darkshadow-color'?: CSSValueGeneral; + '-ms-scrollbar-face-color'?: CSSValueGeneral; + '-ms-scrollbar-highlight-color'?: CSSValueGeneral; + '-ms-scrollbar-shadow-color'?: CSSValueGeneral; + '-ms-scrollbar-track-color'?: CSSValueGeneral; + '-ms-text-align-last'?: CSSValueGeneral; + '-ms-text-autospace'?: CSSValueGeneral; + '-ms-text-combine-horizontal'?: CSSValueGeneral; + '-ms-text-justify'?: CSSValueGeneral; + '-ms-text-kashida-space'?: CSSValueGeneral; + '-ms-text-overflow'?: CSSValueGeneral; + '-ms-text-size-adjust'?: CSSValueGeneral; + '-ms-text-underline-position'?: CSSValueGeneral; + '-ms-touch-action'?: CSSValueGeneral; + '-ms-touch-select'?: CSSValueGeneral; + '-ms-transform'?: CSSValueGeneral; + '-ms-transform-origin'?: CSSValueGeneral; + '-ms-transform-origin-x'?: CSSValueGeneral; + '-ms-transform-origin-y'?: CSSValueGeneral; + '-ms-transform-origin-z'?: CSSValueGeneral; + '-ms-transform-style'?: CSSValueGeneral; + '-ms-transition'?: CSSValueGeneral; + '-ms-transition-delay'?: CSSValueGeneral; + '-ms-transition-duration'?: CSSValueGeneral; + '-ms-transition-property'?: CSSValueGeneral; + '-ms-transition-timing-function'?: CSSValueGeneral; + '-ms-word-break'?: CSSValueGeneral; + '-ms-word-wrap'?: CSSValueGeneral; + '-ms-wrap-flow'?: CSSValueGeneral; + '-ms-wrap-margin'?: CSSValueGeneral; + '-ms-wrap-through'?: CSSValueGeneral; + '-ms-writing-mode'?: CSSValueGeneral; + '-ms-zoom'?: CSSValueGeneral; + '-webkit-align-content'?: CSSValueGeneral; + '-webkit-alt'?: CSSValueGeneral; + '-webkit-animation'?: CSSValueGeneral; + '-webkit-animation-delay'?: CSSValueGeneral; + '-webkit-animation-direction'?: CSSValueGeneral; + '-webkit-animation-duration'?: CSSValueGeneral; + '-webkit-animation-fill-mode'?: CSSValueGeneral; + '-webkit-animation-iteration-count'?: CSSValueGeneral; + '-webkit-animation-name'?: CSSValueGeneral; + '-webkit-animation-play-state'?: CSSValueGeneral; + '-webkit-animation-timing-function'?: CSSValueGeneral; + '-webkit-animation-trigger'?: CSSValueGeneral; + '-webkit-app-region'?: CSSValueGeneral; + '-webkit-appearance'?: CSSValueGeneral; + '-webkit-aspect-ratio'?: CSSValueGeneral; + '-webkit-backdrop-filter'?: CSSValueGeneral; + '-webkit-backface-visibility'?: CSSValueGeneral; + '-webkit-background-clip'?: CSSValueGeneral; + '-webkit-background-composite'?: CSSValueGeneral; + '-webkit-background-origin'?: CSSValueGeneral; + '-webkit-background-size'?: CSSValueGeneral; + '-webkit-border-after'?: CSSValueGeneral; + '-webkit-border-after-color'?: CSSValueGeneral; + '-webkit-border-after-style'?: CSSValueGeneral; + '-webkit-border-after-width'?: CSSValueGeneral; + '-webkit-border-before'?: CSSValueGeneral; + '-webkit-border-before-color'?: CSSValueGeneral; + '-webkit-border-before-style'?: CSSValueGeneral; + '-webkit-border-before-width'?: CSSValueGeneral; + '-webkit-border-bottom-left-radius'?: CSSValueGeneral; + '-webkit-border-bottom-right-radius'?: CSSValueGeneral; + '-webkit-border-end'?: CSSValueGeneral; + '-webkit-border-end-color'?: CSSValueGeneral; + '-webkit-border-end-style'?: CSSValueGeneral; + '-webkit-border-end-width'?: CSSValueGeneral; + '-webkit-border-fit'?: CSSValueGeneral; + '-webkit-border-horizontal-spacing'?: CSSValueGeneral; + '-webkit-border-image'?: CSSValueGeneral; + '-webkit-border-radius'?: CSSValueGeneral; + '-webkit-border-start'?: CSSValueGeneral; + '-webkit-border-start-color'?: CSSValueGeneral; + '-webkit-border-start-style'?: CSSValueGeneral; + '-webkit-border-start-width'?: CSSValueGeneral; + '-webkit-border-top-left-radius'?: CSSValueGeneral; + '-webkit-border-top-right-radius'?: CSSValueGeneral; + '-webkit-border-vertical-spacing'?: CSSValueGeneral; + '-webkit-box-align'?: CSSValueGeneral; + '-webkit-box-decoration-break'?: CSSValueGeneral; + '-webkit-box-direction'?: CSSValueGeneral; + '-webkit-box-flex'?: CSSValueGeneral; + '-webkit-box-flex-group'?: CSSValueGeneral; + '-webkit-box-lines'?: CSSValueGeneral; + '-webkit-box-ordinal-group'?: CSSValueGeneral; + '-webkit-box-orient'?: CSSValueGeneral; + '-webkit-box-pack'?: CSSValueGeneral; + '-webkit-box-reflect'?: CSSValueGeneral; + '-webkit-box-shadow'?: CSSValueGeneral; + '-webkit-clip-path'?: CSSValueGeneral; + '-webkit-color-correction'?: CSSValueGeneral; + '-webkit-column-axis'?: CSSValueGeneral; + '-webkit-column-break-after'?: CSSValueGeneral; + '-webkit-column-break-before'?: CSSValueGeneral; + '-webkit-column-break-inside'?: CSSValueGeneral; + '-webkit-column-count'?: CSSValueGeneral; + '-webkit-column-fill'?: CSSValueGeneral; + '-webkit-column-gap'?: CSSValueGeneral; + '-webkit-column-progression'?: CSSValueGeneral; + '-webkit-column-rule'?: CSSValueGeneral; + '-webkit-column-rule-color'?: CSSValueGeneral; + '-webkit-column-rule-style'?: CSSValueGeneral; + '-webkit-column-rule-width'?: CSSValueGeneral; + '-webkit-column-span'?: CSSValueGeneral; + '-webkit-column-width'?: CSSValueGeneral; + '-webkit-columns'?: CSSValueGeneral; + '-webkit-cursor-visibility'?: CSSValueGeneral; + '-webkit-dashboard-region'?: CSSValueGeneral; + '-webkit-filter'?: CSSValueGeneral; + '-webkit-flex-basis'?: CSSValueGeneral; + '-webkit-flex-flow'?: CSSValueGeneral; + '-webkit-flow-from'?: CSSValueGeneral; + '-webkit-flow-into'?: CSSValueGeneral; + '-webkit-font-feature-settings'?: CSSValueGeneral; + '-webkit-font-kerning'?: CSSValueGeneral; + '-webkit-font-size-delta'?: CSSValueGeneral; + '-webkit-font-smoothing'?: CSSValueGeneral; + '-webkit-font-variant-ligatures'?: CSSValueGeneral; + '-webkit-grid'?: CSSValueGeneral; + '-webkit-grid-area'?: CSSValueGeneral; + '-webkit-grid-auto-columns'?: CSSValueGeneral; + '-webkit-grid-auto-flow'?: CSSValueGeneral; + '-webkit-grid-auto-rows'?: CSSValueGeneral; + '-webkit-grid-column'?: CSSValueGeneral; + '-webkit-grid-column-end'?: CSSValueGeneral; + '-webkit-grid-column-gap'?: CSSValueGeneral; + '-webkit-grid-column-start'?: CSSValueGeneral; + '-webkit-grid-gap'?: CSSValueGeneral; + '-webkit-grid-row'?: CSSValueGeneral; + '-webkit-grid-row-end'?: CSSValueGeneral; + '-webkit-grid-row-gap'?: CSSValueGeneral; + '-webkit-grid-row-start'?: CSSValueGeneral; + '-webkit-grid-template'?: CSSValueGeneral; + '-webkit-grid-template-areas'?: CSSValueGeneral; + '-webkit-grid-template-columns'?: CSSValueGeneral; + '-webkit-grid-template-rows'?: CSSValueGeneral; + '-webkit-highlight'?: CSSValueGeneral; + '-webkit-hyphenate-character'?: CSSValueGeneral; + '-webkit-hyphenate-limit-after'?: CSSValueGeneral; + '-webkit-hyphenate-limit-before'?: CSSValueGeneral; + '-webkit-hyphenate-limit-lines'?: CSSValueGeneral; + '-webkit-hyphens'?: CSSValueGeneral; + '-webkit-initial-letter'?: CSSValueGeneral; + '-webkit-justify-items'?: CSSValueGeneral; + '-webkit-justify-self'?: CSSValueGeneral; + '-webkit-line-align'?: CSSValueGeneral; + '-webkit-line-box-contain'?: CSSValueGeneral; + '-webkit-line-break'?: CSSValueGeneral; + '-webkit-line-clamp'?: CSSValueGeneral; + '-webkit-line-grid'?: CSSValueGeneral; + '-webkit-line-snap'?: CSSValueGeneral; + '-webkit-locale'?: CSSValueGeneral; + '-webkit-logical-height'?: CSSValueGeneral; + '-webkit-logical-width'?: CSSValueGeneral; + '-webkit-margin-after'?: CSSValueGeneral; + '-webkit-margin-after-collapse'?: CSSValueGeneral; + '-webkit-margin-before'?: CSSValueGeneral; + '-webkit-margin-before-collapse'?: CSSValueGeneral; + '-webkit-margin-bottom-collapse'?: CSSValueGeneral; + '-webkit-margin-collapse'?: CSSValueGeneral; + '-webkit-margin-end'?: CSSValueGeneral; + '-webkit-margin-start'?: CSSValueGeneral; + '-webkit-margin-top-collapse'?: CSSValueGeneral; + '-webkit-marquee'?: CSSValueGeneral; + '-webkit-marquee-direction'?: CSSValueGeneral; + '-webkit-marquee-increment'?: CSSValueGeneral; + '-webkit-marquee-repetition'?: CSSValueGeneral; + '-webkit-marquee-speed'?: CSSValueGeneral; + '-webkit-marquee-style'?: CSSValueGeneral; + '-webkit-mask'?: CSSValueGeneral; + '-webkit-mask-box-image'?: CSSValueGeneral; + '-webkit-mask-box-image-outset'?: CSSValueGeneral; + '-webkit-mask-box-image-repeat'?: CSSValueGeneral; + '-webkit-mask-box-image-slice'?: CSSValueGeneral; + '-webkit-mask-box-image-source'?: CSSValueGeneral; + '-webkit-mask-box-image-width'?: CSSValueGeneral; + '-webkit-mask-clip'?: CSSValueGeneral; + '-webkit-mask-composite'?: CSSValueGeneral; + '-webkit-mask-image'?: CSSValueGeneral; + '-webkit-mask-origin'?: CSSValueGeneral; + '-webkit-mask-position'?: CSSValueGeneral; + '-webkit-mask-position-x'?: CSSValueGeneral; + '-webkit-mask-position-y'?: CSSValueGeneral; + '-webkit-mask-repeat'?: CSSValueGeneral; + '-webkit-mask-repeat-x'?: CSSValueGeneral; + '-webkit-mask-repeat-y'?: CSSValueGeneral; + '-webkit-mask-size'?: CSSValueGeneral; + '-webkit-mask-source-type'?: CSSValueGeneral; + '-webkit-max-logical-height'?: CSSValueGeneral; + '-webkit-max-logical-width'?: CSSValueGeneral; + '-webkit-min-logical-height'?: CSSValueGeneral; + '-webkit-min-logical-width'?: CSSValueGeneral; + '-webkit-nbsp-mode'?: CSSValueGeneral; + '-webkit-opacity'?: CSSValueGeneral; + '-webkit-order'?: CSSValueGeneral; + '-webkit-padding-after'?: CSSValueGeneral; + '-webkit-padding-before'?: CSSValueGeneral; + '-webkit-padding-end'?: CSSValueGeneral; + '-webkit-padding-start'?: CSSValueGeneral; + '-webkit-perspective'?: CSSValueGeneral; + '-webkit-perspective-origin'?: CSSValueGeneral; + '-webkit-perspective-origin-x'?: CSSValueGeneral; + '-webkit-perspective-origin-y'?: CSSValueGeneral; + '-webkit-print-color-adjust'?: CSSValueGeneral; + '-webkit-region-break-after'?: CSSValueGeneral; + '-webkit-region-break-before'?: CSSValueGeneral; + '-webkit-region-break-inside'?: CSSValueGeneral; + '-webkit-region-fragment'?: CSSValueGeneral; + '-webkit-rtl-ordering'?: CSSValueGeneral; + '-webkit-ruby-position'?: CSSValueGeneral; + '-webkit-scroll-snap-coordinate'?: CSSValueGeneral; + '-webkit-scroll-snap-destination'?: CSSValueGeneral; + '-webkit-scroll-snap-points-x'?: CSSValueGeneral; + '-webkit-scroll-snap-points-y'?: CSSValueGeneral; + '-webkit-scroll-snap-type'?: CSSValueGeneral; + '-webkit-shape-image-threshold'?: CSSValueGeneral; + '-webkit-shape-margin'?: CSSValueGeneral; + '-webkit-shape-outside'?: CSSValueGeneral; + '-webkit-svg-shadow'?: CSSValueGeneral; + '-webkit-tap-highlight-color'?: CSSValueGeneral; + '-webkit-text-align-last'?: CSSValueGeneral; + '-webkit-text-combine'?: CSSValueGeneral; + '-webkit-text-decoration'?: CSSValueGeneral; + '-webkit-text-decoration-color'?: CSSValueGeneral; + '-webkit-text-decoration-line'?: CSSValueGeneral; + '-webkit-text-decoration-skip'?: CSSValueGeneral; + '-webkit-text-decoration-style'?: CSSValueGeneral; + '-webkit-text-decorations-in-effect'?: CSSValueGeneral; + '-webkit-text-emphasis'?: CSSValueGeneral; + '-webkit-text-emphasis-color'?: CSSValueGeneral; + '-webkit-text-emphasis-position'?: CSSValueGeneral; + '-webkit-text-emphasis-style'?: CSSValueGeneral; + '-webkit-text-fill-color'?: CSSValueGeneral; + '-webkit-text-justify'?: CSSValueGeneral; + '-webkit-text-orientation'?: CSSValueGeneral; + '-webkit-text-security'?: CSSValueGeneral; + '-webkit-text-size-adjust'?: CSSValueGeneral; + '-webkit-text-stroke'?: CSSValueGeneral; + '-webkit-text-stroke-color'?: CSSValueGeneral; + '-webkit-text-stroke-width'?: CSSValueGeneral; + '-webkit-text-underline-position'?: CSSValueGeneral; + '-webkit-text-zoom'?: CSSValueGeneral; + '-webkit-touch-callout'?: CSSValueGeneral; + '-webkit-transform'?: CSSValueGeneral; + '-webkit-transform-origin'?: CSSValueGeneral; + '-webkit-transform-origin-x'?: CSSValueGeneral; + '-webkit-transform-origin-y'?: CSSValueGeneral; + '-webkit-transform-origin-z'?: CSSValueGeneral; + '-webkit-transform-style'?: CSSValueGeneral; + '-webkit-transition'?: CSSValueGeneral; + '-webkit-transition-delay'?: CSSValueGeneral; + '-webkit-transition-duration'?: CSSValueGeneral; + '-webkit-transition-property'?: CSSValueGeneral; + '-webkit-transition-timing-function'?: CSSValueGeneral; + '-webkit-user-drag'?: CSSValueGeneral; + '-webkit-user-modify'?: CSSValueGeneral; + '-webkit-writing-mode'?: CSSValueGeneral; +} + + +export type PseudoCssKey = + | ':active' + | ':any' + | ':checked' + | ':default' + | ':disabled' + | ':empty' + | ':enabled' + | ':first' + | ':first-child' + | ':first-of-type' + | ':fullscreen' + | ':focus' + | ':hover' + | ':indeterminate' + | ':in-range' + | ':invalid' + | ':last-child' + | ':last-of-type' + | ':left' + | ':link' + | ':only-child' + | ':only-of-type' + | ':optional' + | ':out-of-range' + | ':read-only' + | ':read-write' + | ':required' + | ':right' + | ':root' + | ':scope' + | ':target' + | ':valid' + | ':visited' + // TODO + // | ':dir()' + // | ':lang()' + // | ':not()' + // | ':nth-child()' + // | ':nth-last-child()' + // | ':nth-last-of-type()' + // | ':nth-of-type()' + | '::after' + | '::before' + | '::cue' + | '::first-letter' + | '::first-line' + | '::selection' + | '::backdrop ' + | '::placeholder ' + | '::marker ' + | '::spelling-error ' + | '::grammar-error '; + +export type PseudoCss = Partial>; + +export interface JssProps { + '@global'?: CSSProperties & PseudoCss; + extend?: string; + composes?: string | string[]; +} + +export interface JssExpand { + animation: + | { + delay: CSSProperties['animationDelay']; + direction: CSSProperties['animationDirection']; + duration: CSSProperties['animationDuration']; + iterationCount: CSSProperties['animationIterationCount']; + name: CSSProperties['animationName']; + playState: CSSProperties['animationPlayState']; + timingFunction: any; + } + | CSSProperties['animation']; + background: + | { + attachment: CSSProperties['backgroundAttachment']; + color: CSSProperties['backgroundColor']; + image: CSSProperties['backgroundImage']; + position: CSSProperties['backgroundPosition'] | number[]; // Can be written using array e.g. `[0 0]` + repeat: CSSProperties['backgroundRepeat']; + size: Array; // Can be written using array e.g. `['center' 'center']` + } + | CSSProperties['background']; + border: + | { + color: CSSProperties['borderColor']; + style: CSSProperties['borderStyle']; + width: CSSProperties['borderWidth']; + } + | CSSProperties['border']; + boxShadow: + | { + x: any; + y: any; + blur: any; + spread: any; + color: CSSProperties['color']; + inset?: 'inset'; // If you want to add inset you need to write "inset: 'inset'" + } + | CSSProperties['boxShadow']; + flex: + | { + basis: CSSProperties['flexBasis']; + direction: CSSProperties['flexDirection']; + flow: CSSProperties['flexFlow']; + grow: CSSProperties['flexGrow']; + shrink: CSSProperties['flexShrink']; + wrap: CSSProperties['flexWrap']; + } + | CSSProperties['flex']; + font: + | { + family: CSSProperties['fontFamily']; + size: CSSProperties['fontSize']; + stretch: CSSProperties['fontStretch']; + style: CSSProperties['fontStyle']; + variant: CSSProperties['fontVariant']; + weight: CSSProperties['fontWeight']; + } + | CSSProperties['font']; + listStyle: + | { + image: CSSProperties['listStyleImage']; + position: CSSProperties['listStylePosition']; + type: CSSProperties['listStyleType']; + } + | CSSProperties['listStyle']; + margin: + | { + bottom: CSSProperties['marginBottom']; + left: CSSProperties['marginLeft']; + right: CSSProperties['marginRight']; + top: CSSProperties['marginTop']; + } + | CSSProperties['margin']; + padding: + | { + bottom: CSSProperties['paddingBottom']; + left: CSSProperties['paddingLeft']; + right: CSSProperties['paddingRight']; + top: CSSProperties['paddingTop']; + } + | CSSProperties['padding']; + outline: + | { + color: CSSProperties['outlineColor']; + style: 'none' | 'hidden' | 'dotted' | 'dashed' | 'solid' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset'; + width: any; + } + | CSSProperties['outline']; + textShadow: + | { + x: any; + y: any; + blur: any; + color: CSSProperties['color']; + } + | CSSProperties['textShadow']; + transition: + | { + delay: CSSProperties['transitionDelay']; + duration: CSSProperties['transitionDuration']; + property: CSSProperties['transitionProperty']; + timingFunction: CSSProperties['transitionTimingFunction']; + } + | CSSProperties['transition']; +} + +export type JssExpandArr = { [k in keyof JssExpand]?: JssExpand[k] | Array }; + +export type SimpleStyle = CSSProperties & PseudoCss & JssProps & JssExpandArr; +export type Style = Observable | SimpleStyle; diff --git a/types/jss/index.d.ts b/types/jss/index.d.ts index 8054d7f6a6..f6ce6999d8 100644 --- a/types/jss/index.d.ts +++ b/types/jss/index.d.ts @@ -5,184 +5,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -import { types } from 'typestyle'; -import { Observable } from './observable'; - -export type PseudoCssKey = - | ':active' - | ':any' - | ':checked' - | ':default' - | ':disabled' - | ':empty' - | ':enabled' - | ':first' - | ':first-child' - | ':first-of-type' - | ':fullscreen' - | ':focus' - | ':hover' - | ':indeterminate' - | ':in-range' - | ':invalid' - | ':last-child' - | ':last-of-type' - | ':left' - | ':link' - | ':only-child' - | ':only-of-type' - | ':optional' - | ':out-of-range' - | ':read-only' - | ':read-write' - | ':required' - | ':right' - | ':root' - | ':scope' - | ':target' - | ':valid' - | ':visited' - // TODO - // | ':dir()' - // | ':lang()' - // | ':not()' - // | ':nth-child()' - // | ':nth-last-child()' - // | ':nth-last-of-type()' - // | ':nth-of-type()' - | '::after' - | '::before' - | '::cue' - | '::first-letter' - | '::first-line' - | '::selection' - | '::backdrop ' - | '::placeholder ' - | '::marker ' - | '::spelling-error ' - | '::grammar-error '; - -export type PseudoCss = Partial>; - -export interface JssProps { - '@global'?: types.CSSProperties & PseudoCss; - extend?: string; - composes?: string | string[]; -} - -export type css = types.CSSProperties; - -export interface JssExpand { - animation: - | { - delay: css['animationDelay']; - direction: css['animationDirection']; - duration: css['animationDuration']; - iterationCount: css['animationIterationCount']; - name: css['animationName']; - playState: css['animationPlayState']; - timingFunction: any; - } - | css['animation']; - background: - | { - attachment: css['backgroundAttachment']; - color: css['backgroundColor']; - image: css['backgroundImage']; - position: css['backgroundPosition'] | number[]; // Can be written using array e.g. `[0 0]` - repeat: css['backgroundRepeat']; - size: Array; // Can be written using array e.g. `['center' 'center']` - } - | css['background']; - border: - | { - color: css['borderColor']; - style: css['borderStyle']; - width: css['borderWidth']; - } - | css['border']; - boxShadow: - | { - x: any; - y: any; - blur: any; - spread: any; - color: css['color']; - inset?: 'inset'; // If you want to add inset you need to write "inset: 'inset'" - } - | css['boxShadow']; - flex: - | { - basis: css['flexBasis']; - direction: css['flexDirection']; - flow: css['flexFlow']; - grow: css['flexGrow']; - shrink: css['flexShrink']; - wrap: css['flexWrap']; - } - | css['flex']; - font: - | { - family: css['fontFamily']; - size: css['fontSize']; - stretch: css['fontStretch']; - style: css['fontStyle']; - variant: css['fontVariant']; - weight: css['fontWeight']; - } - | css['font']; - listStyle: - | { - image: css['listStyleImage']; - position: css['listStylePosition']; - type: css['listStyleType']; - } - | css['listStyle']; - margin: - | { - bottom: css['marginBottom']; - left: css['marginLeft']; - right: css['marginRight']; - top: css['marginTop']; - } - | css['margin']; - padding: - | { - bottom: css['paddingBottom']; - left: css['paddingLeft']; - right: css['paddingRight']; - top: css['paddingTop']; - } - | css['padding']; - outline: - | { - color: css['outlineColor']; - style: 'none' | 'hidden' | 'dotted' | 'dashed' | 'solid' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset'; - width: any; - } - | css['outline']; - textShadow: - | { - x: any; - y: any; - blur: any; - color: css['color']; - } - | css['textShadow']; - transition: - | { - delay: css['transitionDelay']; - duration: css['transitionDuration']; - property: css['transitionProperty']; - timingFunction: css['transitionTimingFunction']; - } - | css['transition']; -} - -export type JssExpandArr = { [k in keyof JssExpand]?: JssExpand[k] | Array }; - -export type SimpleStyle = types.CSSProperties & PseudoCss & JssProps & JssExpandArr; -export type Style = Observable | SimpleStyle; +import { Style } from './css'; export type Styles = Record; export type Classes = Record; diff --git a/types/jss/package.json b/types/jss/package.json deleted file mode 100644 index a85944f70e..0000000000 --- a/types/jss/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "dependencies": { - "typestyle": "*" - } -} From 5acc5ac6154e9e21f62d23b9cc0b06c9ea47583d Mon Sep 17 00:00:00 2001 From: Tom Crockett Date: Tue, 23 Jan 2018 00:33:24 -0800 Subject: [PATCH 0023/2153] Add some type error expectations --- types/jss/jss-tests.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/types/jss/jss-tests.ts b/types/jss/jss-tests.ts index fab2665bed..0b100ddc5f 100644 --- a/types/jss/jss-tests.ts +++ b/types/jss/jss-tests.ts @@ -55,6 +55,14 @@ styleSheet.addRules({ }, }); +styleSheet.addRule('badProperty', { + thisIsNotAValidProperty: 'blah', // $ExpectError +}); + +styleSheet.addRule('badValue', { // $ExpectError + display: 'thisIsNotAValidDisplayValue', +}); + styleSheet.detach(); sharedInstance.createStyleSheet({ From 542a94c964f1d4f899fae54bfe7001310ffcc5fe Mon Sep 17 00:00:00 2001 From: Tom Crockett Date: Tue, 23 Jan 2018 00:36:55 -0800 Subject: [PATCH 0024/2153] Add some more type assertions to the test --- types/jss/jss-tests.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/types/jss/jss-tests.ts b/types/jss/jss-tests.ts index 0b100ddc5f..72974aeaca 100644 --- a/types/jss/jss-tests.ts +++ b/types/jss/jss-tests.ts @@ -70,3 +70,19 @@ sharedInstance.createStyleSheet({ background: '#000099', } }); + +const styleSheet2 = jss.createStyleSheet( + { + foo: { + display: 'flex', + width: 100, + opacity: .5, + }, + }, + { + link: true, + } +); + +styleSheet2.classes.foo; // $ExpectType string +styleSheet2.classes.bar; // $ExpectError From 00b79ed03b32fe60225a7312e74dc88950658574 Mon Sep 17 00:00:00 2001 From: Tom Crockett Date: Tue, 23 Jan 2018 00:39:49 -0800 Subject: [PATCH 0025/2153] Tweak --- types/jss/jss-tests.ts | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/types/jss/jss-tests.ts b/types/jss/jss-tests.ts index 72974aeaca..0ba36b2cfb 100644 --- a/types/jss/jss-tests.ts +++ b/types/jss/jss-tests.ts @@ -65,24 +65,11 @@ styleSheet.addRule('badValue', { // $ExpectError styleSheet.detach(); -sharedInstance.createStyleSheet({ +const styleSheet2 = sharedInstance.createStyleSheet({ container: { background: '#000099', } }); -const styleSheet2 = jss.createStyleSheet( - { - foo: { - display: 'flex', - width: 100, - opacity: .5, - }, - }, - { - link: true, - } -); - -styleSheet2.classes.foo; // $ExpectType string -styleSheet2.classes.bar; // $ExpectError +styleSheet2.classes.container; // $ExpectType string +styleSheet2.classes.notAValidKey; // $ExpectError From 3310f73f729ce2dff583be9c85dfeb6c9dc3ea76 Mon Sep 17 00:00:00 2001 From: Tom Crockett Date: Tue, 23 Jan 2018 08:56:53 -0800 Subject: [PATCH 0026/2153] Bump version number, add author --- types/jss/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/jss/index.d.ts b/types/jss/index.d.ts index f6ce6999d8..767c777bb3 100644 --- a/types/jss/index.d.ts +++ b/types/jss/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for jss 9.3 +// Type definitions for jss 9.5 // Project: https://github.com/cssinjs/jss#readme // Definitions by: Brenton Simpson // Oleg Slobodskoi +// Thomas Crockett // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 From b4b5d78ea1aa9aa6681703c6ae3482f3b2d27e9f Mon Sep 17 00:00:00 2001 From: Tom Crockett Date: Tue, 23 Jan 2018 13:00:24 -0800 Subject: [PATCH 0027/2153] Elaborate on observable testing --- types/jss/jss-tests.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/types/jss/jss-tests.ts b/types/jss/jss-tests.ts index 0ba36b2cfb..06e4ab2eb6 100644 --- a/types/jss/jss-tests.ts +++ b/types/jss/jss-tests.ts @@ -10,9 +10,14 @@ const jss = createJSS().setup({}); const styleSheet = jss.createStyleSheet( { ruleWithMockObservable: { - subscribe: () => ({ - unsubscribe() {} - }) + subscribe: observer => { + const next = typeof observer === 'function' ? observer : observer.next; + next({ background: 'blue', display: 'flex' }); + next({ invalidKey: 'blueish' }); // $ExpectError + return { + unsubscribe() {} + }; + } }, container: { display: 'flex', From 3573402a499f161bc5fd4f7f32650619a11a2fbe Mon Sep 17 00:00:00 2001 From: Tom Crockett Date: Sun, 11 Feb 2018 16:24:17 -0800 Subject: [PATCH 0028/2153] Use csstype --- types/jss/css.d.ts | 2779 +--------------------------------------- types/jss/package.json | 6 + 2 files changed, 38 insertions(+), 2747 deletions(-) create mode 100644 types/jss/package.json diff --git a/types/jss/css.d.ts b/types/jss/css.d.ts index 348948f814..fb886a6a61 100644 --- a/types/jss/css.d.ts +++ b/types/jss/css.d.ts @@ -1,6 +1,7 @@ // These CSS typings adapted from TypeStyle: https://github.com/typestyle/typestyle import { Observable } from './observable' +import * as csstype from 'csstype' /** * Value of a CSS Property. Could be a single value or a list of fallbacks @@ -9,2760 +10,44 @@ import { Observable } from './observable' export type CSSValue = T | Observable; /** - * For general purpose CSS values - **/ -export type CSSValueGeneral = CSSValue; - -/** - * When you are sure that the value must be a string - **/ -export type CSSValueString = CSSValue; - -/** - * CSS properties that cascade also support these - * @see https://drafts.csswg.org/css-cascade/#defaulting-keywords + * Remove the variants of the second union of string literals from + * the first. */ -export type CSSGlobalValues - = 'initial' - | 'inherit' - | /** combination of `initial` and `inherit` */ 'unset' - | 'revert'; +export type Diff = ( + & { [P in T]: P } + & { [P in U]: never } + & { [x: string]: never } +)[T]; -export interface FontFace { - fontFamily?: string; +/** + * Drop keys `K` from `T`. + */ +export type Omit = Pick>; - /** - * Location of a font-face. Used with the @font-face at rule - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src - */ - src?: CSSValueString; - unicodeRange?: any; - fontVariant?: 'common-ligatures' | 'small-caps' | CSSGlobalValues; - fontFeatureSettings?: string; - fontWeight?: CSSFontWeight; - fontStyle?: 'normal' | 'italic' | 'oblique' | CSSGlobalValues; +export interface SimpleProperties extends Omit< + csstype.Properties, + 'display' | 'width' | 'height' +> { + // https://github.com/frenic/csstype/issues/7 + width: number | string; + height: number | string; + // https://github.com/frenic/csstype/issues/8 + display: + | csstype.All + | csstype.DisplayOutside + | csstype.DisplayInside + | csstype.DisplayInternal + | csstype.DisplayBox + | csstype.DisplayLegacy + ; } -/** - * Absolute size keywords - * @see https://drafts.csswg.org/css-fonts-3/#absolute-size-value - */ -export type CSSAbsoluteSize = 'xx-small' | 'x-small' | 'small' | 'medium' | 'large' - | 'x-large' | 'xx-large'; - -/** - * an angle; 0' | '0deg' | '0grad' | '0rad' | '0turn' | 'etc. - * @see https://drafts.csswg.org/css-values-3/#angles - */ -export type CSSAngle = CSSGlobalValues | string | 0; - -/** - * initial state of an animation. - * @see https://drafts.csswg.org/css-animations/#animation-play-state - */ -export type CSSAnimationPlayState = CSSGlobalValues | string | 'paused' | 'running'; - -/** - * blend mode - * @see https://drafts.fxtf.org/compositing-1/#ltblendmodegt - */ -export type CSSBlendMode = 'normal' | 'multiply' | 'screen' | 'overlay' | 'darken' | 'lighten' | 'color-dodge' | 'color-burn' - | 'hard-light' | 'soft-light' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity'; - -/** - * border shorthand for style color and width - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-left - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-right - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-top - */ -export type CSSBorderShorthand = CSSGlobalValues | CSSColor | CSSLength | CSSLineStyleSet | string; - -/** - * Determines the area within which the background is painted. - * @see https://drafts.csswg.org/css-backgrounds/#box - */ -export type CSSBox = CSSGlobalValues | string | 'border-box' | 'padding-box' | 'content-box'; - -/** - * Color can be a named color, transparent, or a color function - * @see https://drafts.csswg.org/css-color-3/#valuea-def-color - */ -export type CSSColor = CSSNamedColor | CSSGlobalValues | 'currentColor' | string; - -export type CSSNamedColor = - 'aliceblue' | 'antiquewhite' | 'aqua' | 'aquamarine' | 'azure' | 'beige' | 'bisque' | 'black' | 'blanchedalmond' | 'blue' - | 'blueviolet' | 'brown' | 'burlywood' | 'cadetblue' | 'chartreuse' | 'chocolate' | 'coral' | 'cornflowerblue' | 'cornsilk' - | 'crimson' | 'cyan' | 'darkblue' | 'darkcyan' | 'darkgoldenrod' | 'darkgray' | 'darkgreen' | 'darkgrey' | 'darkkhaki' - | 'darkmagenta' | 'darkolivegreen' | 'darkorange' | 'darkorchid' | 'darkred' | 'darksalmon' | 'darkseagreen' - | 'darkslateblue' | 'darkslategray' | 'darkslategrey' | 'darkturquoise' | 'darkviolet' | 'deeppink' | 'deepskyblue' - | 'dimgray' | 'dimgrey' | 'dodgerblue' | 'firebrick' | 'floralwhite' | 'forestgreen' | 'fuchsia' | 'gainsboro' - | 'ghostwhite' | 'gold' | 'goldenrod' | 'gray' | 'green' | 'greenyellow' | 'grey' | 'honeydew' | 'hotpink' | 'indianred' - | 'indigo' | 'ivory' | 'khaki' | 'lavender' | 'lavenderblush' | 'lawngreen' | 'lemonchiffon' | 'lightblue' | 'lightcoral' - | 'lightcyan' | 'lightgoldenrodyellow' | 'lightgray' | 'lightgreen' | 'lightgrey' | 'lightpink' | 'lightsalmon' - | 'lightseagreen' | 'lightskyblue' | 'lightslategray' | 'lightslategrey' | 'lightsteelblue' | 'lightyellow' | 'lime' - | 'limegreen' | 'linen' | 'maroon' | 'mediumaquamarine' | 'mediumblue' | 'mediumorchid' | 'mediumpurple' | 'mediumseagreen' - | 'mediumslateblue' | 'mediumspringgreen' | 'mediumturquoise' | 'mediumvioletred' | 'midnightblue' | 'mintcream' - | 'mistyrose' | 'moccasin' | 'navajowhite' | 'navy' | 'oldlace' | 'olive' | 'olivedrab' | 'orange' | 'purple' - | 'rebeccapurple' | 'red' | 'silver' | 'teal' | 'transparent' | 'white' | 'yellow'; - -/** - * Special type for border-color which can use 1 or 4 colors - * @see https://drafts.csswg.org/css-backgrounds-3/#border-color - */ -export type CSSColorSet = string | CSSColor; - -/** - * This property specifies the type of rendering box used for an element. It is a shorthand property for many other display properties. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/display - */ -export type CSSDisplay = - /* values */ - 'block' | 'inline' | 'run-in' - /* values */ - | 'flow' | 'flow-root' | 'table' | 'flex' | 'grid' | 'ruby' | 'subgrid' - /* plus values */ - | 'block flow' | 'inline table' | 'flex run-in' - /* values */ - | 'list-item' | 'list-item block' | 'list-item inline' | 'list-item flow' | 'list-item flow-root' - | 'list-item block flow' | 'list-item block flow-root' | 'flow list-item block' - /* values */ - | 'table-row-group' | 'table-header-group' | 'table-footer-group' | 'table-row' | 'table-cell' - | 'table-column-group' | 'table-column' | 'table-caption' | 'ruby-base' | 'ruby-text' - | 'ruby-base-container' | 'ruby-text-container' - /* values */ - | 'contents' | 'none' - /* values */ - | 'inline-block' | 'inline-list-item' | 'inline-table' | 'inline-flex' | 'inline-grid'; - -/** - * CSS Type of Box Alignment - * @see https://www.w3.org/TR/css-align-3/#typedef-baseline-position - */ -export type CSSBoxAlignmentBaselinePosition = 'baseline' | 'first baseline' | 'last baseline'; - -/** - * CSS Type of Box Alignment - * @see https://www.w3.org/TR/css-align-3/#typedef-content-distribution - */ -export type CSSBoxAlignmentContentDistribution = 'space-between' | 'space-around' | 'space-evenly' | 'stretch'; - -export type CSSBoxAlignmentContentPositionWithOverflow = - | 'center' | 'start' | 'end' | 'flex-start' | 'flex-end' - | 'unsafe center' | 'unsafe start' | 'unsafe end' | 'unsafe flex-start' | 'unsafe flex-end' - | 'safe center' | 'safe start' | 'safe end' | 'safe flex-start' | 'safe flex-end'; - -export type CSSBoxAlignmentSelfPositionWithOverflow = - | 'center' | 'start' | 'end' | 'self-start' | 'self-end' | 'flex-start' | 'flex-end' - | 'unsafe center' | 'unsafe start' | 'unsafe end' | 'unsafe self-start' | 'unsafe self-end' | 'unsafe flex-start' | 'unsafe flex-end' - | 'safe center' | 'safe start' | 'safe end' | 'safe self-start' | 'safe self-end' | 'safe flex-start' | 'safe flex-end'; - -export type CSSBoxAlignmentLeftRightWithOverflow = 'left' | 'right' | 'unsafe left' | 'unsafe right' | 'safe left' | 'safe right'; - -/** - * Type for justify-content in flex or grid - * @see https://www.w3.org/TR/css-align-3/#propdef-justify-content - */ -export type JustifyContent = - | 'normal' - | CSSBoxAlignmentContentDistribution - | CSSBoxAlignmentContentPositionWithOverflow - | 'left' - | 'right'; - -/** - * Type for align-content in flex or grid - * @see https://www.w3.org/TR/css-align-3/#propdef-align-content - */ -export type AlignContent = - | 'normal' - | CSSBoxAlignmentBaselinePosition - | CSSBoxAlignmentContentDistribution - | CSSBoxAlignmentContentPositionWithOverflow; - -/** - * Type for justify-items in flex or grid - * @see https://www.w3.org/TR/css-align-3/#propdef-justify-items - */ -export type JustifyItems = - | 'normal' - | 'stretch' - | CSSBoxAlignmentBaselinePosition - | CSSBoxAlignmentSelfPositionWithOverflow - | 'left' - | 'right' - | 'center' - | 'legacy left' - | 'legacy right' - | 'legacy center'; - -/** - * Type for align-items in flex or grid - * @see https://www.w3.org/TR/css-align-3/#propdef-align-items - */ -export type AlignItems = - | 'normal' - | 'stretch' - | CSSBoxAlignmentBaselinePosition - | CSSBoxAlignmentSelfPositionWithOverflow; - -/** - * Type for justify-self in flex or grid - * @see https://www.w3.org/TR/css-align-3/#propdef-justify-self - */ -export type JustifySelf = - | 'auto' - | 'normal' - | 'stretch' - | CSSBoxAlignmentBaselinePosition - | CSSBoxAlignmentSelfPositionWithOverflow - | CSSBoxAlignmentLeftRightWithOverflow; - -/** - * Type for align-self in flex or grid - * @see https://www.w3.org/TR/css-align-3/#propdef-align-self - */ -export type AlignSelf = - | 'auto' - | 'normal' - | 'stretch' - | CSSBoxAlignmentBaselinePosition - | CSSBoxAlignmentSelfPositionWithOverflow; - -/** - * a gradient function like linear-gradient - * @see https://drafts.csswg.org/css-images-3/#gradients - */ -export type CSSGradient = CSSGlobalValues | string; - -/** - * complex type that describes the size of fonts - * @see https://drafts.csswg.org/css-fonts-3/#propdef-font-size - */ -export type CSSFontSize = CSSGlobalValues | CSSLength | CSSPercentage | CSSAbsoluteSize | CSSRelativeSize; - -/** - * a value that serves as an image - * @see https://drafts.csswg.org/css-images-3/#typedef-image - */ -export type CSSImage = CSSGlobalValues | string | CSSGradient | CSSUrl; - -/** - * an length; 0 | '0px' | '0em' etc. - * @see https://drafts.csswg.org/css-values-3/#lengths - */ -export type CSSLength = CSSGlobalValues | string | number; - -/** - * Style of a line (e.g. border-style) - * @see https://drafts.csswg.org/css-backgrounds-3/#line-style - */ -export type CSSLineStyle = string | 'none' | 'hidden' | 'dotted' - | 'dashed' | 'solid' | 'double' | 'groove' | 'ridge' | 'inset' - | 'outset'; - -/** - * Special type for border-style which can use 1 or 4 line-style - * @see https://drafts.csswg.org/css-backgrounds-3/#border-style - */ -export type CSSLineStyleSet = string | CSSLineStyle; - -/** - * Specifies how the contents of a replaced element should be fitted to the box established by its used height and width. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit - */ -export type CSSObjectFit = "fill" | "contain" | "cover" | "none" | "scale-down" | CSSGlobalValues; - -/** - * Overflow modes - * @see https://drafts.csswg.org/css-overflow-3/#propdef-overflow - */ -export type CSSOverflow = 'visible' | 'hidden' | 'scroll' | 'clip' | 'auto'; - -/** - * a percentage; 0 | '0%' etc. - * @see https://drafts.csswg.org/css-values-3/#percentage - */ -export type CSSPercentage = CSSGlobalValues | string | 0; - -/** - * Defines a position (e.g. background-position) - * @see https://drafts.csswg.org/css-backgrounds-3/#position - */ -export type CSSPosition = CSSAngle | string; - -/** - * Relative size keywords - * @see https://drafts.csswg.org/css-fonts-3/#relative-size-value - */ -export type CSSRelativeSize = 'larger' | 'smaller'; - -/** - * Specifies how background images are tiled after they have been sized and positioned - * @see https://drafts.csswg.org/css-backgrounds/#repeat-style - */ -export type CSSRepeatStyle = 'repeat-x' - | 'repeat-y' - | 'repeat' - | 'space' - | 'round' - | 'no-repeat' - | 'repeat repeat' - | 'repeat space' - | 'repeat round' - | 'repeat no-repeat' - | 'space repeat' - | 'space space' - | 'space round' - | 'space no-repeat' - | 'round repeat' - | 'round space' - | 'round round' - | 'round no-repeat' - | 'no-repeat repeat' - | 'no-repeat space' - | 'no-repeat round' - | 'no-repeat no-repeat'; - -/** - * Tranform list for the element. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function - */ -export type CSSTransformFunction = string | 'none'; - -/** - * Starting position for many gradients - * @see https://drafts.csswg.org/css-images-3/#typedef-side-or-corner - */ -export type CSSSideOrCorner = CSSAngle - | 'left' | 'right' | 'top' | 'bottom' - | 'to left' | 'to right' | 'to top' | 'to bottom' - | 'left top' | 'right top' | 'left bottom' | 'right bottom' - | 'top left' | 'top right' | 'bottom left' | 'bottom right' - | 'to left top' | 'to right top' | 'to left bottom' | 'to right bottom' - | 'to top left' | 'to top right' | 'to bottom left' | 'to bottom right'; - -export type CSSRadialGradientEndingShape = 'circle' | 'ellipse'; - -/** - * Radial Gradient Size. - * @see https://drafts.csswg.org/css-images-3/#ending-shape - */ -export type CSSRadialGradientSize = CSSLength | Array - | 'closest-side' | 'farthest-side' - | 'closest-corner' | 'closest-side' - ; - -/** Supporting by `-timing-function` properties */ -export type CSSTimingFunction - = /** e.g. steps(int,start|end)|cubic-bezier(n,n,n,n) */ string - | CSSGlobalValues - | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear' | 'step-start' | 'step-end'; - -/** - * Expressed as url('protocol://') - * @see https://drafts.csswg.org/css-values-3/#urls - */ -export type CSSUrl = string; - -/** - * Font weights - */ -export type CSSFontWeight = 'normal' | 'bold' | 'bolder' | 'lighter' | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | number | CSSGlobalValues; - -/** - * This interface documents key CSS properties for autocomplete - */ -export interface CSSProperties { - /** - * Typestyle configuration options - **/ - /** - * The generated CSS selector gets its own unique location in the generated CSS (disables deduping). - * So instead of `.classA,.classB{same properties}` - * you get `.classA {same properties} .classB {same properties}` - * This is needed for certain browser edge cases like placeholder styling - **/ - $unique?: boolean; - - /** - * Smooth scrolling on an iPhone. Specifies whether to use native-style scrolling in an element. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-overflow-scrolling - */ - '-webkit-overflow-scrolling'?: 'auto' | 'touch'; - - /** - * Aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how justify-content aligns individual items within the main-axis. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/align-content - */ - alignContent?: AlignContent; - - /** - * Sets the default alignment in the cross axis for all of the flex container's items, including anonymous flex items, similarly to how justify-content aligns items along the main axis. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/align-items - */ - alignItems?: CSSValue; - '-ms-align-items'?: CSSValue; - '-webkit-align-items'?: CSSValue; - - /** - * Allows the default alignment to be overridden for individual flex items. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/align-self - */ - alignSelf?: CSSValue; - '-webkit-align-self'?: CSSValue; - '-ms-flex-item-align'?: string; - - /** - * This property allows precise alignment of elements, such as graphics, that do not have a baseline-table or lack the desired baseline in their baseline-table. With the alignment-adjust property, the position of the baseline identified by the alignment-baseline can be explicitly determined. It also determines precisely the alignment point for each glyph within a textual element. - */ - alignmentAdjust?: any; - - /** - * The alignment-baseline attribute specifies how an object is aligned with respect to its parent. - * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/alignment-baseline - */ - alignmentBaseline?: 'auto' | 'baseline' | 'before-edge' | 'text-before-edge' | 'middle' | 'central' | 'after-edge' | 'text-after-edge' | 'ideographic' | 'alphabetic' | 'hanging' | 'mathematical' | 'inherit'; - - /** - * Shorthand property for animation-name, animation-duration, animation-timing-function, animation-delay, - * animation-iteration-count, animation-direction, animation-fill-mode, and animation-play-state. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation - */ - animation?: CSSValueString; - - /** - * Defines a length of time to elapse before an animation starts, allowing an animation to begin execution some time after it is applied. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation-delay - */ - animationDelay?: any; - - /** - * Defines whether an animation should run in reverse on some or all cycles. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation-direction - */ - animationDirection?: CSSGlobalValues | 'normal' | 'alternate' | 'reverse' | 'alternate-reverse'; - - /** - * The animation-duration CSS property specifies the length of time that an animation should take to complete one cycle. - * A value of '0s', which is the default value, indicates that no animation should occur. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation-duration - */ - animationDuration?: CSSValue; - - /** - * Specifies how a CSS animation should apply styles to its target before and after it is executing. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation-fill-mode - */ - animationFillMode?: 'none' | 'forwards' | 'backwards' | 'both'; - - /** - * Specifies how many times an animation cycle should play. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation-iteration-count - */ - animationIterationCount?: CSSValue; - - /** - * Defines the list of animations that apply to the element. - * Note: You probably want animationDuration as well - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation-name - */ - animationName?: CSSValue; - - /** - * Defines whether an animation is running or paused. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation-play-state - */ - animationPlayState?: CSSValue; - - /** - * Sets the pace of an animation - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timing-function - */ - animationTimingFunction?: CSSValue; - - /** - * Allows changing the style of any element to platform-based interface elements or vice versa. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/appearance - */ - appearance?: CSSValue<'auto' | 'none'>; - - /** - * Determines whether or not the “back” side of a transformed element is visible when facing the viewer. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/backface-visibility - */ - backfaceVisibility?: CSSGlobalValues | 'visible' | 'hidden'; - - /** - * Shorthand property to set the values for one or more of: - * background-clip, background-color, background-image, - * background-origin, background-position, background-repeat, - * background-size, and background-attachment. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/background - */ - background?: any; - - /** - * If a background-image is specified, this property determines - * whether that image's position is fixed within the viewport, - * or scrolls along with its containing block. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/background-attachment - */ - backgroundAttachment?: 'scroll' | 'fixed' | 'local'; - - /** - * This property describes how the element's background images should blend with each other and the element's background color. - * The value is a list of blend modes that corresponds to each background image. Each element in the list will apply to the corresponding element of background-image. If a property doesn’t have enough comma-separated values to match the number of layers, the UA must calculate its used value by repeating the list of values until there are enough. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/background-blend-mode - */ - backgroundBlendMode?: CSSValue; - - /** - * Specifies whether an element's background, either the color or image, extends underneath its border. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/background-clip - */ - backgroundClip?: CSSValue; - - /** - * Sets the background color of an element. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/background-color - */ - backgroundColor?: CSSValue; - - /** - * Sets a compositing style for background images and colors. - */ - backgroundComposite?: any; - - /** - * Applies one or more background images to an element. These can be any valid CSS image, including url() paths to image files or CSS gradients. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/background-image - */ - backgroundImage?: CSSValue; - - /** - * Specifies what the background-position property is relative to. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/background-origin - */ - backgroundOrigin?: CSSValue; - - /** - * Sets the position of a background image. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/background-position - */ - backgroundPosition?: CSSValue; - - /** - * Background-repeat defines if and how background images will be repeated after they have been sized and positioned - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/background-repeat - */ - backgroundRepeat?: CSSValue; - - /** - * Background-size specifies the size of a background image - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/background-size - */ - backgroundSize?: 'auto' | 'cover' | 'contain' | CSSLength | CSSPercentage | CSSGlobalValues; - - /** - * Obsolete - spec retired, not implemented. - * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/baseline-shift - */ - baselineShift?: any; - - /** - * Non standard. Sets or retrieves the location of the Dynamic HTML (DHTML) behavior. - * @see https://msdn.microsoft.com/en-us/library/ms530723(v=vs.85).aspx - */ - behavior?: any; - - /** - * Shorthand property that defines the different properties of all four sides of an element's border in a single declaration. It can be used to set border-width, border-style and border-color, or a subset of these. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border - */ - border?: any; - - /** - * Shorthand that sets the values of border-bottom-color, - * border-bottom-style, and border-bottom-width. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom - */ - borderBottom?: CSSBorderShorthand; - - /** - * Sets the color of the bottom border of an element. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-color - */ - borderBottomColor?: CSSValue; - - /** - * Defines the shape of the border of the bottom-left corner. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-left-radius - */ - borderBottomLeftRadius?: any; - - /** - * Defines the shape of the border of the bottom-right corner. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-right-radius - */ - borderBottomRightRadius?: any; - - /** - * Sets the line style of the bottom border of a box. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-style - */ - borderBottomStyle?: CSSValue; - - /** - * Sets the width of an element's bottom border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-width - */ - borderBottomWidth?: CSSValue; - - /** - * Border-collapse can be used for collapsing the borders between table cells - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-collapse - */ - borderCollapse?: any; - - /** - * The CSS border-color property sets the color of an element's four borders. This property can have from one to four values, made up of the elementary properties: - * • border-top-color - * • border-right-color - * • border-bottom-color - * • border-left-color The default color is the currentColor of each of these values. - * If you provide one value, it sets the color for the element. Two values set the horizontal and vertical values, respectively. Providing three values sets the top, vertical, and bottom values, in that order. Four values set all for sides: top, right, bottom, and left, in that order. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-color - */ - borderColor?: CSSValue; - - /** - * Specifies different corner clipping effects, such as scoop (inner curves), bevel (straight cuts) or notch (cut-off rectangles). Works along with border-radius to specify the size of each corner effect. - */ - borderCornerShape?: any; - - /** - * The property border-image-source is used to set the image to be used instead of the border style. If this is set to none the border-style is used instead. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-image-source - */ - borderImageSource?: CSSValue; - - /** - * The border-image-width CSS property defines the offset to use for dividing the border image in nine parts, the top-left corner, central top edge, top-right-corner, central right edge, bottom-right corner, central bottom edge, bottom-left corner, and central right edge. They represent inward distance from the top, right, bottom, and left edges. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-image-width - */ - borderImageWidth?: CSSValue; - - /** - * Shorthand property that defines the border-width, border-style and border-color of an element's left border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the left border — border-left-width, border-left-style and border-left-color. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-left - */ - borderLeft?: CSSBorderShorthand; - - /** - * The CSS border-left-color property sets the color of an element's left border. This page explains the border-left-color value, but often you will find it more convenient to fix the border's left color as part of a shorthand set, either border-left or border-color. - * Colors can be defined several ways. For more information, see Usage. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-left-color - */ - borderLeftColor?: CSSValue; - - /** - * Sets the style of an element's left border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-left-style - */ - borderLeftStyle?: CSSValue; - - /** - * Sets the width of an element's left border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-left-width - */ - borderLeftWidth?: CSSValue; - - /** - * Allows Web authors to define how rounded border corners are - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius - */ - borderRadius?: CSSValue; - - /** - * Shorthand property that defines the border-width, border-style and border-color of an element's right border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the right border — border-right-width, border-right-style and border-right-color. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-right - */ - borderRight?: CSSBorderShorthand; - - /** - * Sets the color of an element's right border. This page explains the border-right-color value, but often you will find it more convenient to fix the border's right color as part of a shorthand set, either border-right or border-color. - * Colors can be defined several ways. For more information, see Usage. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-right-color - */ - borderRightColor?: CSSValue; - - /** - * Sets the style of an element's right border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-right-style - */ - borderRightStyle?: CSSValue; - - /** - * Sets the width of an element's right border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-right-width - */ - borderRightWidth?: CSSValue; - - /** - * Specifies the distance between the borders of adjacent cells. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-spacing - */ - borderSpacing?: CSSLength | string | 'inherit'; - - /** - * Sets the style of an element's four borders. This property can have from one to four values. With only one value, the value will be applied to all four borders; otherwise, this works as a shorthand property for each of border-top-style, border-right-style, border-bottom-style, border-left-style, where each border style may be assigned a separate value. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-style - */ - borderStyle?: CSSValue; - - /** - * Shorthand property that defines the border-width, border-style and border-color of an element's top border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the top border — border-top-width, border-top-style and border-top-color. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-top - */ - borderTop?: CSSBorderShorthand; - - /** - * Sets the color of an element's top border. This page explains the border-top-color value, but often you will find it more convenient to fix the border's top color as part of a shorthand set, either border-top or border-color. - * Colors can be defined several ways. For more information, see Usage. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-color - */ - borderTopColor?: CSSValue; - - /** - * Sets the rounding of the top-left corner of the element. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-left-radius - */ - borderTopLeftRadius?: any; - - /** - * Sets the rounding of the top-right corner of the element. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-right-radius - */ - borderTopRightRadius?: any; - - /** - * Sets the style of an element's top border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-style - */ - borderTopStyle?: CSSValue; - - /** - * Sets the width of an element's top border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-width - */ - borderTopWidth?: CSSValue; - - /** - * Sets the width of an element's four borders. This property can have from one to four values. This is a shorthand property for setting values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-width - */ - borderWidth?: CSSValue; - - /** - * This property specifies how far an absolutely positioned box's bottom margin edge is offset above the bottom edge of the box's containing block. For relatively positioned boxes, the offset is with respect to the bottom edges of the box itself (i.e., the box is given a position in the normal flow, then offset from that position according to these properties). - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/bottom - */ - bottom?: CSSValue<'auto' | CSSLength | CSSPercentage | CSSGlobalValues>; - - /** - * Obsolete. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/box-align - */ - boxAlign?: any; - - /** - * Breaks a box into fragments creating new borders, padding and repeating backgrounds or lets it stay as a continuous box on a page break, column break, or, for inline elements, at a line break. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/box-decoration-break - */ - boxDecorationBreak?: any; - - /** - * Deprecated - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/box-direction - */ - boxDirection?: any; - - /** - * Do not use. This property has been replaced by the flex-wrap property. - * Gets or sets a value that specifies the direction to add successive rows or columns when the value of box-lines is set to multiple. - */ - boxLineProgression?: any; - - /** - * Do not use. This property has been replaced by the flex-wrap property. - * Gets or sets a value that specifies whether child elements wrap onto multiple lines or columns based on the space available in the object. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/box-lines - */ - boxLines?: any; - - /** - * Do not use. This property has been replaced by flex-order. - * Specifies the ordinal group that a child element of the object belongs to. This ordinal value identifies the display order (along the axis defined by the box-orient property) for the group. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/box-ordinal-group - */ - boxOrdinalGroup?: any; - - /** - * Deprecated. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/box-flex - */ - boxFlex?: number; - - /** - * box sizing - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing - */ - boxSizing?: CSSGlobalValues | 'content-box' | 'border-box'; - '-moz-box-sizing'?: CSSGlobalValues | 'content-box' | 'border-box'; - '-webkit-box-sizing'?: CSSGlobalValues | 'content-box' | 'border-box'; - - /** - * Box shadow - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow - */ - boxShadow?: CSSValueGeneral; - - /** - * Deprecated. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/box-flex-group - */ - boxFlexGroup?: number; - - /** - * The CSS break-after property allows you to force a break on multi-column layouts. More specifically, it allows you to force a break after an element. It allows you to determine if a break should occur, and what type of break it should be. The break-after CSS property describes how the page, column or region break behaves after the generated box. If there is no generated box, the property is ignored. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/break-after - */ - breakAfter?: 'auto' | 'avoid' | 'avoid-page' | 'page' | 'left' | 'right' | 'recto' | 'verso' | 'avoid-column' | 'column' | 'avoid-region' | 'region'; - - /** - * Control page/column/region breaks that fall above a block of content - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/break-before - */ - breakBefore?: 'auto' | 'avoid' | 'avoid-page' | 'page' | 'left' | 'right' | 'recto' | 'verso' | 'avoid-column' | 'column' | 'avoid-region' | 'region'; - - /** - * Control page/column/region breaks that fall within a block of content - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/break-inside - */ - breakInside?: 'auto' | 'avoid' | 'avoid-page' | 'avoid-column' | 'avoid-region'; - - /** - * The caption-side CSS property positions the content of a table's . * The default template is "". + * */ filterDialogFilterTemplate?: string; /** * Custom template for options in condition list in filter dialog. The default template is "". + * */ filterDialogFilterConditionTemplate?: string; /** * Add button width - in the advanced filter dialog. * + * * Valid values: * "string" The dialog Add button width in pixels (100px). * "number" The dialog Add button width in pixels as a number (100). @@ -40954,6 +47488,7 @@ interface IgGridFiltering { /** * Width of the Ok and Cancel buttons in the advanced filtering dialogs. * + * * Valid values: * "string" The advanced filter dialog Ok and Cancel buttons width in pixels (120px). * "number" The advanced filter dialog Ok and Cancel buttons width in pixels as a number (120). @@ -40962,6 +47497,7 @@ interface IgGridFiltering { /** * Maximum number of filter rows in the advanced filtering dialog. If this number is exceeded, an error message will be rendered. + * */ filterDialogMaxFilterCount?: number; @@ -40975,44 +47511,212 @@ interface IgGridFiltering { /** * Enable/disable empty condition visibility in the filter. If true, shows empty and not empty filtering conditions in the dropdowns. + * */ showEmptyConditions?: boolean; /** * Enable/disable visibility of null and not null filtering conditions in the dropdowns. If true, shows null and not null filtering conditions in the dropdowns. + * */ showNullConditions?: boolean; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. + * */ dialogWidget?: string; /** * Enables/disables filtering persistence between states. + * */ persist?: boolean; /** * Enables/disables feature inheritance for the child [layouts](ui.ighierarchicalgrid#options:columnLayouts). NOTE: It only applies for [igHierarchicalGrid](ui.ighierarchicalgrid). + * */ inherit?: boolean; + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + + /** + * Event fired before a filtering operation is executed (remote request or local). + * Return false in order to cancel filtering operation. + */ + dataFiltering?: DataFilteringEvent; + + /** + * Event fired after the filtering has been executed and results are rendered. + */ + dataFiltered?: DataFilteredEvent; + + /** + * Event fired before the filter dropdown is opened for a specific column. + * Return false in order to cancel dropdown opening. + */ + dropDownOpening?: DropDownOpeningEvent; + + /** + * Event fired after the filter dropdown is opened for a specific column. + */ + dropDownOpened?: DropDownOpenedEvent; + + /** + * Event fired before the filter dropdown starts closing. + * Return false in order to cancel dropdown closing. + */ + dropDownClosing?: DropDownClosingEvent; + + /** + * Event fired after a filter column dropdown is completely closed. + */ + dropDownClosed?: DropDownClosedEvent; + + /** + * Event fired before the advanced filtering dialog is opened. + * Return false in order to cancel filter dialog opening. + */ + filterDialogOpening?: FilterDialogOpeningEvent; + + /** + * Event fired after the advanced filter dialog is already opened. + */ + filterDialogOpened?: FilterDialogOpenedEvent; + + /** + * Event fired every time the advanced filter dialog changes its position. + */ + filterDialogMoving?: FilterDialogMovingEvent; + + /** + * Event fired before a filter row is added to the advanced filter dialog. + * Return false in order to cancel filter adding to the advanced filtering dialog. + */ + filterDialogFilterAdding?: FilterDialogFilterAddingEvent; + + /** + * Event fired after a filter row is added to the advanced filter dialog. + */ + filterDialogFilterAdded?: FilterDialogFilterAddedEvent; + + /** + * Event fired before the advanced filter dialog is closed. + * Return false in order to cancel filtering dialog closing. + */ + filterDialogClosing?: FilterDialogClosingEvent; + + /** + * Event fired after the advanced filter dialog has been closed. + */ + filterDialogClosed?: FilterDialogClosedEvent; + + /** + * Event fired before the contents of the advanced filter dialog are rendered. + * Return false in order to cancel filtering dialog rendering. + */ + filterDialogContentsRendering?: FilterDialogContentsRenderingEvent; + + /** + * Event fired after the contents of the advanced filter dialog are rendered. + */ + filterDialogContentsRendered?: FilterDialogContentsRenderedEvent; + + /** + * Event fired when the OK button in the advanced filter dialog is pressed. + */ + filterDialogFiltering?: FilterDialogFilteringEvent; + /** * Option for igGridFiltering */ [optionName: string]: any; } +interface IgGridFilteringMethods { + changeGlobalLanguage(): void; + changeGlobalRegional(): void; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.iggridfiltering#options:language) + * Note that this method is for rare scenarios, see [language](ui.iggridfiltering#options:language) or [locale](ui.iggridfiltering#options:locale) option setter + */ + changeLocale(): void; + + /** + * Changes the the regional settings of widget element to the language specified in [options.regional](ui.iggridfiltering#options:regional) + * Note that this method is for rare scenarios, use [regional](ui.iggridfiltering#options:regional) option setter + */ + changeRegional(): void; + + /** + * Destroys the filtering widget - remove fitler row, unbinds events, returns the grid to its previous state. + */ + destroy(): void; + + /** + * Returns the count of data records that match filtering conditions + */ + getFilteringMatchesCount(): number; + + /** + * Toggle filter row when mode is simple or [advancedModeEditorsVisible](ui.iggridfiltering#options:advancedModeEditorsVisible) is true. Otherwise show/hide advanced dialog. + * + * @param event Column key + */ + toggleFilterRowByFeatureChooser(event: string): void; + + /** + * Applies filtering programmatically and updates the UI by default. + * + * @param expressions An array of filtering expressions, each one having the format {fieldName: , expr: , cond: , logic: } where fieldName is the key of the column, expr is the actual expression string with which we would like to filter, logic is 'AND' or 'OR', and cond is one of the following strings: "equals", "doesNotEqual", "contains", "doesNotContain", "greaterThan", "lessThan", "greaterThanOrEqualTo", "lessThanOrEqualTo", "true", "false", "null", "notNull", "empty", "notEmpty", "startsWith", "endsWith", "today", "yesterday", "on", "notOn", "thisMonth", "lastMonth", "nextMonth", "before", "after", "thisYear", "lastYear", "nextYear". The difference between the empty and null filtering conditions is that empty includes null, NaN, and undefined, as well as the empty string. + * @param updateUI specifies whether the filter row should be also updated once the grid is filtered + * @param addedFromAdvanced + */ + filter(expressions: any[], updateUI?: boolean, addedFromAdvanced?: boolean): void; + + /** + * Check whether filterCondition requires or not filtering expression - e.g. if filterCondition is "lastMonth", "thisMonth", "null", "notNull", "true", "false", etc. then filtering expression is NOT required + * + * @param filterCondition filtering condition - e.g. "true", "false", "yesterday", "empty", "null", etc. + */ + requiresFilteringExpression(filterCondition: string): boolean; +} +interface JQuery { + data(propertyName: "igGridFiltering"): IgGridFilteringMethods; +} interface JQuery { + igGridFiltering(methodName: "changeGlobalLanguage"): void; + igGridFiltering(methodName: "changeGlobalRegional"): void; + igGridFiltering(methodName: "changeLocale"): void; + igGridFiltering(methodName: "changeRegional"): void; + igGridFiltering(methodName: "destroy"): void; + igGridFiltering(methodName: "getFilteringMatchesCount"): number; + igGridFiltering(methodName: "toggleFilterRowByFeatureChooser", event: string): void; + igGridFiltering(methodName: "filter", expressions: any[], updateUI?: boolean, addedFromAdvanced?: boolean): void; + igGridFiltering(methodName: "requiresFilteringExpression", filterCondition: string): boolean; + /** * Enables or disables the filtering case sensitivity. Works only for local filtering. If true, it case sensitive filtering is performed. If false, filtering is case insensitive. + * */ igGridFiltering(optionLiteral: 'option', optionName: "caseSensitive"): boolean; /** * Enables or disables the filtering case sensitivity. Works only for local filtering. If true, it case sensitive filtering is performed. If false, filtering is case insensitive. * + * * @optionValue New value to be set. */ igGridFiltering(optionLiteral: 'option', optionName: "caseSensitive", optionValue: boolean): void; @@ -41021,6 +47725,7 @@ interface JQuery { * Enable/disable footer visibility with summary info about the filter. * When false, the filter summary row (in the footer) will only be visible when paging is enabled (or some other feature that renders a footer). * When true, the filter summary row will only be visible when a filter is applied i.e. it's not visible by default. + * */ igGridFiltering(optionLiteral: 'option', optionName: "filterSummaryAlwaysVisible"): boolean; @@ -41029,18 +47734,21 @@ interface JQuery { * When false, the filter summary row (in the footer) will only be visible when paging is enabled (or some other feature that renders a footer). * When true, the filter summary row will only be visible when a filter is applied i.e. it's not visible by default. * + * * @optionValue New value to be set. */ igGridFiltering(optionLiteral: 'option', optionName: "filterSummaryAlwaysVisible", optionValue: boolean): void; /** * Render in [Feature Chooser](http://www.igniteui.com/help/iggrid-feature-chooser) + * */ igGridFiltering(optionLiteral: 'option', optionName: "renderFC"): boolean; /** * Render in [Feature Chooser](http://www.igniteui.com/help/iggrid-feature-chooser) * + * * @optionValue New value to be set. */ igGridFiltering(optionLiteral: 'option', optionName: "renderFC", optionValue: boolean): void; @@ -41061,6 +47769,7 @@ interface JQuery { /** * Type of animations for the column filter dropdowns. + * */ igGridFiltering(optionLiteral: 'option', optionName: "filterDropDownAnimations"): string; @@ -41068,6 +47777,7 @@ interface JQuery { /** * Type of animations for the column filter dropdowns. * + * * @optionValue New value to be set. */ @@ -41075,18 +47785,21 @@ interface JQuery { /** * Animation duration in milliseconds for the [filterDropDownAnimations](ui.iggridfiltering#options:filterDropDownAnimations). + * */ igGridFiltering(optionLiteral: 'option', optionName: "filterDropDownAnimationDuration"): number; /** * Animation duration in milliseconds for the [filterDropDownAnimations](ui.iggridfiltering#options:filterDropDownAnimations). * + * * @optionValue New value to be set. */ igGridFiltering(optionLiteral: 'option', optionName: "filterDropDownAnimationDuration", optionValue: number): void; /** * Width of the column filter dropdowns. + * */ igGridFiltering(optionLiteral: 'option', optionName: "filterDropDownWidth"): string|number; @@ -41094,6 +47807,7 @@ interface JQuery { /** * Width of the column filter dropdowns. * + * * @optionValue New value to be set. */ @@ -41119,18 +47833,21 @@ interface JQuery { /** * URL key name that specifies how the filtering expressions will be encoded for remote requests, e.g. &filter('col') = startsWith. Default is OData. + * */ igGridFiltering(optionLiteral: 'option', optionName: "filterExprUrlKey"): string; /** * URL key name that specifies how the filtering expressions will be encoded for remote requests, e.g. &filter('col') = startsWith. Default is OData. * + * * @optionValue New value to be set. */ igGridFiltering(optionLiteral: 'option', optionName: "filterExprUrlKey", optionValue: string): void; /** * Enable/disable filter icons visibility. + * */ igGridFiltering(optionLiteral: 'option', optionName: "filterDropDownItemIcons"): boolean; @@ -41138,6 +47855,7 @@ interface JQuery { /** * Enable/disable filter icons visibility. * + * * @optionValue New value to be set. */ @@ -41145,18 +47863,21 @@ interface JQuery { /** * A list of column settings that specifies custom filtering options on a per column basis. + * */ igGridFiltering(optionLiteral: 'option', optionName: "columnSettings"): IgGridFilteringColumnSetting[]; /** * A list of column settings that specifies custom filtering options on a per column basis. * + * * @optionValue New value to be set. */ igGridFiltering(optionLiteral: 'option', optionName: "columnSettings", optionValue: IgGridFilteringColumnSetting[]): void; /** * Type of filtering. Delegates all filtering functionality to the [$.ig.DataSource](ig.datasource). + * */ igGridFiltering(optionLiteral: 'option', optionName: "type"): string; @@ -41164,6 +47885,7 @@ interface JQuery { /** * Type of filtering. Delegates all filtering functionality to the [$.ig.DataSource](ig.datasource). * + * * @optionValue New value to be set. */ @@ -41171,18 +47893,21 @@ interface JQuery { /** * Time in milliseconds for which widget will wait between keystrokes before sending filtering requests. + * */ igGridFiltering(optionLiteral: 'option', optionName: "filterDelay"): number; /** * Time in milliseconds for which widget will wait between keystrokes before sending filtering requests. * + * * @optionValue New value to be set. */ igGridFiltering(optionLiteral: 'option', optionName: "filterDelay", optionValue: number): void; /** * Default is 'simple' for non-virtualized grids, and 'advanced' when [virtualization](ui.iggrid#options:virtualization) is enabled. + * */ igGridFiltering(optionLiteral: 'option', optionName: "mode"): string; @@ -41190,6 +47915,7 @@ interface JQuery { /** * Default is 'simple' for non-virtualized grids, and 'advanced' when [virtualization](ui.iggrid#options:virtualization) is enabled. * + * * @optionValue New value to be set. */ @@ -41197,18 +47923,21 @@ interface JQuery { /** * Defines whether to render editors in advanced [mode](ui.iggridfiltering#options:mode). If false, no editors will be rendered in the advanced [mode](ui.iggridfiltering#options:mode). + * */ igGridFiltering(optionLiteral: 'option', optionName: "advancedModeEditorsVisible"): boolean; /** * Defines whether to render editors in advanced [mode](ui.iggridfiltering#options:mode). If false, no editors will be rendered in the advanced [mode](ui.iggridfiltering#options:mode). * + * * @optionValue New value to be set. */ igGridFiltering(optionLiteral: 'option', optionName: "advancedModeEditorsVisible", optionValue: boolean): void; /** * Location of the advanced filtering button when [advancedModeEditorsVisible](ui.iggridfiltering#options:advancedModeEditorsVisible) is false (i.e. when the button is rendered in the header). + * */ igGridFiltering(optionLiteral: 'option', optionName: "advancedModeHeaderButtonLocation"): string; @@ -41216,6 +47945,7 @@ interface JQuery { /** * Location of the advanced filtering button when [advancedModeEditorsVisible](ui.iggridfiltering#options:advancedModeEditorsVisible) is false (i.e. when the button is rendered in the header). * + * * @optionValue New value to be set. */ @@ -41223,6 +47953,7 @@ interface JQuery { /** * Default filter dialog width (used for Advanced filtering [mode](ui.iggridfiltering#options:mode)). + * */ igGridFiltering(optionLiteral: 'option', optionName: "filterDialogWidth"): string|number; @@ -41230,6 +47961,7 @@ interface JQuery { /** * Default filter dialog width (used for Advanced filtering [mode](ui.iggridfiltering#options:mode)). * + * * @optionValue New value to be set. */ @@ -41237,6 +47969,7 @@ interface JQuery { /** * Default filter dialog height (used for Advanced filtering [mode](ui.iggridfiltering#options:mode)). + * */ igGridFiltering(optionLiteral: 'option', optionName: "filterDialogHeight"): string|number; @@ -41244,6 +47977,7 @@ interface JQuery { /** * Default filter dialog height (used for Advanced filtering [mode](ui.iggridfiltering#options:mode)). * + * * @optionValue New value to be set. */ @@ -41251,6 +47985,7 @@ interface JQuery { /** * Width of the filtering condition dropdowns in the advanced filter dialog. + * */ igGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterDropDownDefaultWidth"): string|number; @@ -41258,6 +47993,7 @@ interface JQuery { /** * Width of the filtering condition dropdowns in the advanced filter dialog. * + * * @optionValue New value to be set. */ @@ -41265,6 +48001,7 @@ interface JQuery { /** * Width of the filtering expression input boxes in the advanced filter dialog. + * */ igGridFiltering(optionLiteral: 'option', optionName: "filterDialogExprInputDefaultWidth"): string|number; @@ -41272,6 +48009,7 @@ interface JQuery { /** * Width of the filtering expression input boxes in the advanced filter dialog. * + * * @optionValue New value to be set. */ @@ -41279,6 +48017,7 @@ interface JQuery { /** * Width of the column chooser dropdowns in the advanced filter dialog. + * */ igGridFiltering(optionLiteral: 'option', optionName: "filterDialogColumnDropDownDefaultWidth"): string|number; @@ -41286,6 +48025,7 @@ interface JQuery { /** * Width of the column chooser dropdowns in the advanced filter dialog. * + * * @optionValue New value to be set. */ @@ -41293,18 +48033,21 @@ interface JQuery { /** * Enable/disable filter button visibility. If false, no filter dropdown buttons will be rendered and a predefined list of filters will not be rendered for the columns. + * */ igGridFiltering(optionLiteral: 'option', optionName: "renderFilterButton"): boolean; /** * Enable/disable filter button visibility. If false, no filter dropdown buttons will be rendered and a predefined list of filters will not be rendered for the columns. * + * * @optionValue New value to be set. */ igGridFiltering(optionLiteral: 'option', optionName: "renderFilterButton", optionValue: boolean): void; /** * The filtering button for filter dropdowns can be rendered either on the left of the filter editor, or on the right. + * */ igGridFiltering(optionLiteral: 'option', optionName: "filterButtonLocation"): string; @@ -41312,6 +48055,7 @@ interface JQuery { /** * The filtering button for filter dropdowns can be rendered either on the left of the filter editor, or on the right. * + * * @optionValue New value to be set. */ @@ -41405,24 +48149,28 @@ interface JQuery { /** * Custom template for add condition area in the filter dialog. The default template is "
${label1}
${label2}
". + * */ igGridFiltering(optionLiteral: 'option', optionName: "filterDialogAddConditionTemplate"): string; /** * Custom template for add condition area in the filter dialog. The default template is "
${label1}
${label2}
". * + * * @optionValue New value to be set. */ igGridFiltering(optionLiteral: 'option', optionName: "filterDialogAddConditionTemplate", optionValue: string): void; /** * Custom template for options in dropdown in add condition area in the filter dialog. The default template is "". + * */ igGridFiltering(optionLiteral: 'option', optionName: "filterDialogAddConditionDropDownTemplate"): string; /** * Custom template for options in dropdown in add condition area in the filter dialog. The default template is "". * + * * @optionValue New value to be set. */ igGridFiltering(optionLiteral: 'option', optionName: "filterDialogAddConditionDropDownTemplate", optionValue: string): void; @@ -41433,6 +48181,7 @@ interface JQuery { * E.g.: DOM element used for selecting column has attribute "data-af-col", for selecting filter condition - "data-af-cond", for filter expression- "data-af-expr". * NOTE: The template is supported only with
. * The default template is "". + * */ igGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterTemplate"): string; @@ -41443,24 +48192,28 @@ interface JQuery { * NOTE: The template is supported only with . * The default template is "". * + * * @optionValue New value to be set. */ igGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterTemplate", optionValue: string): void; /** * Custom template for options in condition list in filter dialog. The default template is "". + * */ igGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterConditionTemplate"): string; /** * Custom template for options in condition list in filter dialog. The default template is "". * + * * @optionValue New value to be set. */ igGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterConditionTemplate", optionValue: string): void; /** * Add button width - in the advanced filter dialog. + * */ igGridFiltering(optionLiteral: 'option', optionName: "filterDialogAddButtonWidth"): string|number; @@ -41468,6 +48221,7 @@ interface JQuery { /** * Add button width - in the advanced filter dialog. * + * * @optionValue New value to be set. */ @@ -41475,6 +48229,7 @@ interface JQuery { /** * Width of the Ok and Cancel buttons in the advanced filtering dialogs. + * */ igGridFiltering(optionLiteral: 'option', optionName: "filterDialogOkCancelButtonWidth"): string|number; @@ -41482,6 +48237,7 @@ interface JQuery { /** * Width of the Ok and Cancel buttons in the advanced filtering dialogs. * + * * @optionValue New value to be set. */ @@ -41489,12 +48245,14 @@ interface JQuery { /** * Maximum number of filter rows in the advanced filtering dialog. If this number is exceeded, an error message will be rendered. + * */ igGridFiltering(optionLiteral: 'option', optionName: "filterDialogMaxFilterCount"): number; /** * Maximum number of filter rows in the advanced filtering dialog. If this number is exceeded, an error message will be rendered. * + * * @optionValue New value to be set. */ igGridFiltering(optionLiteral: 'option', optionName: "filterDialogMaxFilterCount", optionValue: number): void; @@ -41519,63 +48277,309 @@ interface JQuery { /** * Enable/disable empty condition visibility in the filter. If true, shows empty and not empty filtering conditions in the dropdowns. + * */ igGridFiltering(optionLiteral: 'option', optionName: "showEmptyConditions"): boolean; /** * Enable/disable empty condition visibility in the filter. If true, shows empty and not empty filtering conditions in the dropdowns. * + * * @optionValue New value to be set. */ igGridFiltering(optionLiteral: 'option', optionName: "showEmptyConditions", optionValue: boolean): void; /** * Enable/disable visibility of null and not null filtering conditions in the dropdowns. If true, shows null and not null filtering conditions in the dropdowns. + * */ igGridFiltering(optionLiteral: 'option', optionName: "showNullConditions"): boolean; /** * Enable/disable visibility of null and not null filtering conditions in the dropdowns. If true, shows null and not null filtering conditions in the dropdowns. * + * * @optionValue New value to be set. */ igGridFiltering(optionLiteral: 'option', optionName: "showNullConditions", optionValue: boolean): void; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. + * */ igGridFiltering(optionLiteral: 'option', optionName: "dialogWidget"): string; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. * + * * @optionValue New value to be set. */ igGridFiltering(optionLiteral: 'option', optionName: "dialogWidget", optionValue: string): void; /** * Enables/disables filtering persistence between states. + * */ igGridFiltering(optionLiteral: 'option', optionName: "persist"): boolean; /** * Enables/disables filtering persistence between states. * + * * @optionValue New value to be set. */ igGridFiltering(optionLiteral: 'option', optionName: "persist", optionValue: boolean): void; /** * Enables/disables feature inheritance for the child [layouts](ui.ighierarchicalgrid#options:columnLayouts). NOTE: It only applies for [igHierarchicalGrid](ui.ighierarchicalgrid). + * */ igGridFiltering(optionLiteral: 'option', optionName: "inherit"): boolean; /** * Enables/disables feature inheritance for the child [layouts](ui.ighierarchicalgrid#options:columnLayouts). NOTE: It only applies for [igHierarchicalGrid](ui.ighierarchicalgrid). * + * * @optionValue New value to be set. */ igGridFiltering(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igGridFiltering(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igGridFiltering(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igGridFiltering(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igGridFiltering(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + + /** + * Event fired before a filtering operation is executed (remote request or local). + * Return false in order to cancel filtering operation. + */ + igGridFiltering(optionLiteral: 'option', optionName: "dataFiltering"): DataFilteringEvent; + + /** + * Event fired before a filtering operation is executed (remote request or local). + * Return false in order to cancel filtering operation. + * + * @optionValue Define event handler function. + */ + igGridFiltering(optionLiteral: 'option', optionName: "dataFiltering", optionValue: DataFilteringEvent): void; + + /** + * Event fired after the filtering has been executed and results are rendered. + */ + igGridFiltering(optionLiteral: 'option', optionName: "dataFiltered"): DataFilteredEvent; + + /** + * Event fired after the filtering has been executed and results are rendered. + * + * @optionValue Define event handler function. + */ + igGridFiltering(optionLiteral: 'option', optionName: "dataFiltered", optionValue: DataFilteredEvent): void; + + /** + * Event fired before the filter dropdown is opened for a specific column. + * Return false in order to cancel dropdown opening. + */ + igGridFiltering(optionLiteral: 'option', optionName: "dropDownOpening"): DropDownOpeningEvent; + + /** + * Event fired before the filter dropdown is opened for a specific column. + * Return false in order to cancel dropdown opening. + * + * @optionValue Define event handler function. + */ + igGridFiltering(optionLiteral: 'option', optionName: "dropDownOpening", optionValue: DropDownOpeningEvent): void; + + /** + * Event fired after the filter dropdown is opened for a specific column. + */ + igGridFiltering(optionLiteral: 'option', optionName: "dropDownOpened"): DropDownOpenedEvent; + + /** + * Event fired after the filter dropdown is opened for a specific column. + * + * @optionValue Define event handler function. + */ + igGridFiltering(optionLiteral: 'option', optionName: "dropDownOpened", optionValue: DropDownOpenedEvent): void; + + /** + * Event fired before the filter dropdown starts closing. + * Return false in order to cancel dropdown closing. + */ + igGridFiltering(optionLiteral: 'option', optionName: "dropDownClosing"): DropDownClosingEvent; + + /** + * Event fired before the filter dropdown starts closing. + * Return false in order to cancel dropdown closing. + * + * @optionValue Define event handler function. + */ + igGridFiltering(optionLiteral: 'option', optionName: "dropDownClosing", optionValue: DropDownClosingEvent): void; + + /** + * Event fired after a filter column dropdown is completely closed. + */ + igGridFiltering(optionLiteral: 'option', optionName: "dropDownClosed"): DropDownClosedEvent; + + /** + * Event fired after a filter column dropdown is completely closed. + * + * @optionValue Define event handler function. + */ + igGridFiltering(optionLiteral: 'option', optionName: "dropDownClosed", optionValue: DropDownClosedEvent): void; + + /** + * Event fired before the advanced filtering dialog is opened. + * Return false in order to cancel filter dialog opening. + */ + igGridFiltering(optionLiteral: 'option', optionName: "filterDialogOpening"): FilterDialogOpeningEvent; + + /** + * Event fired before the advanced filtering dialog is opened. + * Return false in order to cancel filter dialog opening. + * + * @optionValue Define event handler function. + */ + igGridFiltering(optionLiteral: 'option', optionName: "filterDialogOpening", optionValue: FilterDialogOpeningEvent): void; + + /** + * Event fired after the advanced filter dialog is already opened. + */ + igGridFiltering(optionLiteral: 'option', optionName: "filterDialogOpened"): FilterDialogOpenedEvent; + + /** + * Event fired after the advanced filter dialog is already opened. + * + * @optionValue Define event handler function. + */ + igGridFiltering(optionLiteral: 'option', optionName: "filterDialogOpened", optionValue: FilterDialogOpenedEvent): void; + + /** + * Event fired every time the advanced filter dialog changes its position. + */ + igGridFiltering(optionLiteral: 'option', optionName: "filterDialogMoving"): FilterDialogMovingEvent; + + /** + * Event fired every time the advanced filter dialog changes its position. + * + * @optionValue Define event handler function. + */ + igGridFiltering(optionLiteral: 'option', optionName: "filterDialogMoving", optionValue: FilterDialogMovingEvent): void; + + /** + * Event fired before a filter row is added to the advanced filter dialog. + * Return false in order to cancel filter adding to the advanced filtering dialog. + */ + igGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterAdding"): FilterDialogFilterAddingEvent; + + /** + * Event fired before a filter row is added to the advanced filter dialog. + * Return false in order to cancel filter adding to the advanced filtering dialog. + * + * @optionValue Define event handler function. + */ + igGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterAdding", optionValue: FilterDialogFilterAddingEvent): void; + + /** + * Event fired after a filter row is added to the advanced filter dialog. + */ + igGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterAdded"): FilterDialogFilterAddedEvent; + + /** + * Event fired after a filter row is added to the advanced filter dialog. + * + * @optionValue Define event handler function. + */ + igGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterAdded", optionValue: FilterDialogFilterAddedEvent): void; + + /** + * Event fired before the advanced filter dialog is closed. + * Return false in order to cancel filtering dialog closing. + */ + igGridFiltering(optionLiteral: 'option', optionName: "filterDialogClosing"): FilterDialogClosingEvent; + + /** + * Event fired before the advanced filter dialog is closed. + * Return false in order to cancel filtering dialog closing. + * + * @optionValue Define event handler function. + */ + igGridFiltering(optionLiteral: 'option', optionName: "filterDialogClosing", optionValue: FilterDialogClosingEvent): void; + + /** + * Event fired after the advanced filter dialog has been closed. + */ + igGridFiltering(optionLiteral: 'option', optionName: "filterDialogClosed"): FilterDialogClosedEvent; + + /** + * Event fired after the advanced filter dialog has been closed. + * + * @optionValue Define event handler function. + */ + igGridFiltering(optionLiteral: 'option', optionName: "filterDialogClosed", optionValue: FilterDialogClosedEvent): void; + + /** + * Event fired before the contents of the advanced filter dialog are rendered. + * Return false in order to cancel filtering dialog rendering. + */ + igGridFiltering(optionLiteral: 'option', optionName: "filterDialogContentsRendering"): FilterDialogContentsRenderingEvent; + + /** + * Event fired before the contents of the advanced filter dialog are rendered. + * Return false in order to cancel filtering dialog rendering. + * + * @optionValue Define event handler function. + */ + igGridFiltering(optionLiteral: 'option', optionName: "filterDialogContentsRendering", optionValue: FilterDialogContentsRenderingEvent): void; + + /** + * Event fired after the contents of the advanced filter dialog are rendered. + */ + igGridFiltering(optionLiteral: 'option', optionName: "filterDialogContentsRendered"): FilterDialogContentsRenderedEvent; + + /** + * Event fired after the contents of the advanced filter dialog are rendered. + * + * @optionValue Define event handler function. + */ + igGridFiltering(optionLiteral: 'option', optionName: "filterDialogContentsRendered", optionValue: FilterDialogContentsRenderedEvent): void; + + /** + * Event fired when the OK button in the advanced filter dialog is pressed. + */ + igGridFiltering(optionLiteral: 'option', optionName: "filterDialogFiltering"): FilterDialogFilteringEvent; + + /** + * Event fired when the OK button in the advanced filter dialog is pressed. + * + * @optionValue Define event handler function. + */ + igGridFiltering(optionLiteral: 'option', optionName: "filterDialogFiltering", optionValue: FilterDialogFilteringEvent): void; igGridFiltering(options: IgGridFiltering): JQuery; igGridFiltering(optionLiteral: 'option', optionName: string): any; igGridFiltering(optionLiteral: 'option', options: IgGridFiltering): JQuery; @@ -41585,17 +48589,20 @@ interface JQuery { interface IgGridColumnGroupOptions { /** * Sets whether the group is expanded or collapsed. Applied only if the allowGroupCollapsing is set to true. + * */ expanded?: boolean; /** * Sets whether expansion indicators are visible in the group header. + * */ allowGroupCollapsing?: boolean; /** * Sets when should the group be hidden. Applied only if the allowGroupCollapsing is set to true. * + * * Valid values: * "never" never hide the group * "always" always hide the group @@ -41613,17 +48620,20 @@ interface IgGridColumnGroupOptions { interface IgGridColumn { /** * Header text for the specified column. + * */ headerText?: string; /** * The property in the data source to which the column is bound. Also used to identify the column by, and find specific columns with API methods such as [columnByKey](ui.iggrid#methods:columnByKey). + * */ key?: string; /** * Reference to a function (string or function) which will be used for formatting the cell values. The function should accept a value and return the new formatted value. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) * + * * Valid values: * "string" The name of the function which will be used for formatting the cell values. * "function" Function which will be used for formatting the cell values. The function should accept a value and return the new formatted value. @@ -41644,12 +48654,21 @@ interface IgGridColumn { /** * Data type of the column cell values: string, number, bool, date, object. + * + * + * Valid values: + * "string" Used when the data for the column is of type string + * "number" Used when the data for the column is of type number + * "boolean" Used when the data for the column is of type boolean + * "date" Used when the data for the column is of type date + * "object" Used when the data for the column is of type object */ - dataType?: string|number|boolean|Date|Object; + dataType?: string; /** * Width of the column in pixels or percentage. Can also be set as '*', in which case the width auto-size based on the content of the column cells (including the header text).If width is not defined and [defaultColumnWidth](ui.iggrid#options:defaultColumnWidth) is set, it is assumed for all columns. * + * * Valid values: * "string" The column width can be set in pixels (px), percentage (%) or as '*' in order to auto-size based on the cells and header content. * "number" The column width can be set as a number @@ -41658,32 +48677,38 @@ interface IgGridColumn { /** * Initial visibility of the column. A column can be hidden without the Hiding feature being enabled but there will be no UI for unhiding it. Columns can be defined as hidden in the options of the Hiding feature as well and those definitions take precedence. + * */ hidden?: boolean; /** * Sets a template for an individual column. the contents of the template should be the HTML markup that goes inside the table cell, or the entire table cell markup. [Here's an example of creating a basic column template](http://www.igniteui.com/help/creating-a-basic-column-template-in-the-iggrid) + * */ template?: string; /** * Sets whether column data is derived from the datasource. If set to true, then the cells in this column are not bound to the data source. The data in this column is populated using [formula](ui.iggrid#options:columns.formula), or using [unboundValues](ui.iggrid#options:columns.unboundValues), or through the [setUnboundValues](ui.iggrid#methods:setUnboundValues) API method. [Here's an overview of the unbound columns feature](http://www.igniteui.com/help/iggrid-unboundcolumns-overview) + * */ unbound?: boolean; /** * Options used to configure collapsible column [groups](ui.iggrid#options:columns.group). + * */ groupOptions?: IgGridColumnGroupOptions; /** * Array of child column definitions. If the column has the property group than the grid has multi column headers. + * */ group?: any[]; /** * Determines the way in which dates will be displayed in the grid for this column. * + * * Valid values: * "local" The dates for this column will be rendered in the client's local timezone. * "utc" The dates for this column will be rendered in their UTC representation. @@ -41699,6 +48724,7 @@ interface IgGridColumn { /** * A reference to or the name of a JavaScript function, which will calculate the value of the current cell based on other cell values in the same row. Used with [unbound columns](ui.iggrid#options:columns.unbound). * + * * Valid values: * "string" The name of the JavaScript function. * "function" Reference to the JavaScript function. @@ -41707,22 +48733,26 @@ interface IgGridColumn { /** * Array of values which will be populated in the column cells at initialization, if the column is [unbound](ui.iggrid#options:columns.unbound). + * */ unboundValues?: any[]; /** * Space-separated list of CSS classes to be applied on the header cell of this column. + * */ headerCssClass?: string; /** * Space-separated list of CSS classes to be applied on the data cells of this column. The class is not applied if the column has a column [template](ui.iggrid#options:columns.template) defined, which contains full ' + * */ editorsTemplate?: string; /** * Specifies a selector to a template to be executed for each column in the grid's column collection (or just the read-write columns if [showReadonlyEditors](ui.iggridupdating#options:rowEditDialogOptions.showReadonlyEditors) is false). Decorate the element to be used as an editor with 'data-editor-for-${key}'. The ${key} template tag should be replaced with the chosen templating engine's syntax for rendering values. If any editors for columns are specified in the dialog markup they will be exluded from the data the template will be rendered for. This property is ignored if [dialogTemplate](ui.iggridupdating#options:rowEditDialogOptions.dialogTemplate) does not include an element with the 'data-render-tmpl' attribute. If both [editorsTemplate](ui.iggridupdating#options:rowEditDialogOptions.editorsTemplate) and editorsTemplateSelector are specified, editorsTemplateSelector will be used. * The default template is '' + * */ editorsTemplateSelector?: string; @@ -56017,41 +64580,49 @@ interface IgGridUpdatingRowEditDialogOptions { interface IgGridUpdatingLocale { /** * Specifies the label for the Done editing button (only applicable when the [showDoneCancelButtons](ui.iggridupdating#options:showDoneCancelButtons) option is enabled). If not set, $.ig.GridUpdating.locale.doneLabel is used. + * */ doneLabel?: string; /** * Specifies the title for the Done editing button (only applicable when the [showDoneCancelButtons](ui.iggridupdating#options:showDoneCancelButtons) option is enabled). If not set, $.ig.GridUpdating.locale.doneTooltip is used. + * */ doneTooltip?: string; /** * Specifies the label for the Cancel editing button (only applicable when the [showDoneCancelButtons](ui.iggridupdating#options:showDoneCancelButtons) option is enabled). If not set, $.ig.GridUpdating.locale.cancelLabel is used. + * */ cancelLabel?: string; /** * Specifies the title for the Cancel editing button (only applicable when the [showDoneCancelButtons](ui.iggridupdating#options:showDoneCancelButtons) option is enabled). If not set, $.ig.GridUpdating.locale.cancelTooltip is used. + * */ cancelTooltip?: string; /** * Specifies the label for the button starting edit mode for row adding. If not set, $.ig.GridUpdating.locale.addRowLabel is used. + * */ addRowLabel?: string; /** * Specifies the title for the button starting edit mode for row adding. If not set, $.ig.GridUpdating.locale.addRowTooltip is used. + * */ addRowTooltip?: string; /** * Specifies the label for the delete button. If not set, $.ig.GridUpdating.locale.deleteRowLabel is used. + * */ deleteRowLabel?: string; /** * Specifies the title for the delete button. If not set, $.ig.GridUpdating.locale.deleteRowTooltip is used. + * */ deleteRowTooltip?: string; @@ -56453,12 +65024,14 @@ interface RowEditDialogContentsRenderedEventUIParam { interface IgGridUpdating { /** * A list of custom column options that specify editing and validation settings for a specific column. + * */ columnSettings?: IgGridUpdatingColumnSetting[]; /** * Specifies the edit mode. * + * * Valid values: * "row" Editors are shown for all columns that are not read-only. The editor of the clicked cell receives initial focus. Done and Cancel buttons may be displayed based on the [showDoneCancelButtons](ui.iggridupdating#options:showDoneCancelButtons) property. * "cell" An editor is shown for the cell entering edit mode. The Done and Cancel buttons are not supported for this mode. @@ -56469,16 +65042,19 @@ interface IgGridUpdating { /** * Specifies if deleting rows through the UI is enabled. + * */ enableDeleteRow?: boolean; /** * Specifies if adding rows through the UI is enabled. When enabled an additional row is rendered at the bottom of the grid's header that works as a button. When the end-user clicks on it edit mode is initiated either through a dialog (when [editMode](ui.iggridupdating#options:editMode) is 'dialog') or mimicking the look and feel of 'row' [editMode](ui.iggridupdating#options:editMode) (when [editMode](ui.iggridupdating#options:editMode) is 'row' or 'cell'). + * */ enableAddRow?: boolean; /** * Specifies if the value of each editable column in the grid should be validated. The validation is done based on the rules of their corresponding editors. + * */ validation?: boolean; @@ -56540,56 +65116,67 @@ interface IgGridUpdating { /** * Determines if the Done and Cancel buttons will be available as means to end edit mode for [editMode](ui.iggridupdating#options:editMode) 'row' and when adding a new row. + * */ showDoneCancelButtons?: boolean; /** * Specifies if an exception should be thrown when the grid's data view changes while there are pending transactions in the data source. The data view changes when the data source performs a sorting, filtering, groupby or paging operation and the exception thrown will prevent the operation from succeeding. All pending transactions must be committed before a data view operation is able to complete. Committing transactions can be done manually through the grid's [commit](ui.iggrid#methods:commit) function or automatically by setting [autoCommit](ui.iggrid#options:autoCommit) to 'true'. + * */ enableDataDirtyException?: boolean; /** * Specifies how end-users are able to start edit mode. Possible values: "click", "dblclick", "F2", "enter" and their combinations separated by coma or in array. The keyboard triggers have effect only if the grid cells can receive focus (the grid's [tabIndex](ui.iggrid#options:tabIndex) property should not have a negative value) or Selection is enabled. If "dblclick" is included, then "click" has no effect. + * */ startEditTriggers?: string|Array; /** * Determines if pressing Enter to navigate away from the currently edited cell should move the focus horizontally or vertically (default). + * */ horizontalMoveOnEnter?: boolean; /** * Enables excel navigation style. When turned on, the arrow keys can be used for changing the currently edited cell similar to how Tab and Enter behave. When disabled, the arrow keys control the cursor inside editors. + * */ excelNavigationMode?: boolean; /** * Sets a custom function to be called when the AJAX request to the URL specified by the [updateUrl](ui.iggrid#options:updateUrl) property succeeds. The function will be called with arguments representing the data returned by the server. + * */ saveChangesSuccessHandler?: Function|string; /** * Sets a custom function to be called when the AJAX request to the URL specified by the [updateUrl](ui.iggrid#options:updateUrl) property fails. The function will be called with arguments representing the data returned by the server. + * */ saveChangesErrorHandler?: Function|string; /** * On touch-enabled devices specifies the swipe distance for the delete button to appear. + * */ swipeDistance?: string|number; /** * Controls if navigation will wrap around the grid. The feature will never wrap around virtual grids. + * */ wrapAround?: boolean; /** * A list of options controlling the rendering behavior of the row edit dialog. If [editMode](ui.iggridupdating#options:editMode) is not 'dialog' these have no effect. + * */ rowEditDialogOptions?: IgGridUpdatingRowEditDialogOptions; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. For more information on how to utilize this property, please refer to the [Extending igGrid Modal Dialog](http://www.igniteui.com/help/extending-iggrid-modal-dialog) topic. + * */ dialogWidget?: string; @@ -56793,7 +65380,17 @@ interface IgGridUpdatingMethods { * Destroys igGridUpdating. */ destroy(): Object; + + /** + * Changes the the regional settings of widget element to the language specified in [options.regional](ui.iggridupdating#options:regional) + * Note that this method is for rare scenarios, use [regional](ui.iggridupdating#options:regional) option setter + */ changeRegional(): void; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.iggridupdating#options:language) + * Note that this method is for rare scenarios, see [language](ui.iggridupdating#options:language) or [locale](ui.iggridupdating#options:locale) option setter + */ changeLocale(): void; /** @@ -56832,18 +65429,21 @@ interface JQuery { /** * A list of custom column options that specify editing and validation settings for a specific column. + * */ igGridUpdating(optionLiteral: 'option', optionName: "columnSettings"): IgGridUpdatingColumnSetting[]; /** * A list of custom column options that specify editing and validation settings for a specific column. * + * * @optionValue New value to be set. */ igGridUpdating(optionLiteral: 'option', optionName: "columnSettings", optionValue: IgGridUpdatingColumnSetting[]): void; /** * Gets the edit mode. + * */ igGridUpdating(optionLiteral: 'option', optionName: "editMode"): string; @@ -56851,6 +65451,7 @@ interface JQuery { /** * Sets the edit mode. * + * * @optionValue New value to be set. */ @@ -56858,36 +65459,42 @@ interface JQuery { /** * Gets if deleting rows through the UI is enabled. + * */ igGridUpdating(optionLiteral: 'option', optionName: "enableDeleteRow"): boolean; /** * Sets if deleting rows through the UI is enabled. * + * * @optionValue New value to be set. */ igGridUpdating(optionLiteral: 'option', optionName: "enableDeleteRow", optionValue: boolean): void; /** * Gets if adding rows through the UI is enabled. When enabled an additional row is rendered at the bottom of the grid's header that works as a button. When the end-user clicks on it edit mode is initiated either through a dialog (when [editMode](ui.iggridupdating#options:editMode) is 'dialog') or mimicking the look and feel of 'row' [editMode](ui.iggridupdating#options:editMode) (when [editMode](ui.iggridupdating#options:editMode) is 'row' or 'cell'). + * */ igGridUpdating(optionLiteral: 'option', optionName: "enableAddRow"): boolean; /** * Sets if adding rows through the UI is enabled. When enabled an additional row is rendered at the bottom of the grid's header that works as a button. When the end-user clicks on it edit mode is initiated either through a dialog (when [editMode](ui.iggridupdating#options:editMode) is 'dialog') or mimicking the look and feel of 'row' [editMode](ui.iggridupdating#options:editMode) (when [editMode](ui.iggridupdating#options:editMode) is 'row' or 'cell'). * + * * @optionValue New value to be set. */ igGridUpdating(optionLiteral: 'option', optionName: "enableAddRow", optionValue: boolean): void; /** * Gets if the value of each editable column in the grid should be validated. The validation is done based on the rules of their corresponding editors. + * */ igGridUpdating(optionLiteral: 'option', optionName: "validation"): boolean; /** * Sets if the value of each editable column in the grid should be validated. The validation is done based on the rules of their corresponding editors. * + * * @optionValue New value to be set. */ igGridUpdating(optionLiteral: 'option', optionName: "validation", optionValue: boolean): void; @@ -57022,30 +65629,35 @@ interface JQuery { /** * Determines if the Done and Cancel buttons will be available as means to end edit mode for [editMode](ui.iggridupdating#options:editMode) 'row' and when adding a new row. + * */ igGridUpdating(optionLiteral: 'option', optionName: "showDoneCancelButtons"): boolean; /** * Determines if the Done and Cancel buttons will be available as means to end edit mode for [editMode](ui.iggridupdating#options:editMode) 'row' and when adding a new row. * + * * @optionValue New value to be set. */ igGridUpdating(optionLiteral: 'option', optionName: "showDoneCancelButtons", optionValue: boolean): void; /** * Gets if an exception should be thrown when the grid's data view changes while there are pending transactions in the data source. The data view changes when the data source performs a sorting, filtering, groupby or paging operation and the exception thrown will prevent the operation from succeeding. All pending transactions must be committed before a data view operation is able to complete. Committing transactions can be done manually through the grid's [commit](ui.iggrid#methods:commit) function or automatically by setting [autoCommit](ui.iggrid#options:autoCommit) to 'true'. + * */ igGridUpdating(optionLiteral: 'option', optionName: "enableDataDirtyException"): boolean; /** * Sets if an exception should be thrown when the grid's data view changes while there are pending transactions in the data source. The data view changes when the data source performs a sorting, filtering, groupby or paging operation and the exception thrown will prevent the operation from succeeding. All pending transactions must be committed before a data view operation is able to complete. Committing transactions can be done manually through the grid's [commit](ui.iggrid#methods:commit) function or automatically by setting [autoCommit](ui.iggrid#options:autoCommit) to 'true'. * + * * @optionValue New value to be set. */ igGridUpdating(optionLiteral: 'option', optionName: "enableDataDirtyException", optionValue: boolean): void; /** * Gets how end-users are able to start edit mode. Possible values: "click", "dblclick", "F2", "enter" and their combinations separated by coma or in array. The keyboard triggers have effect only if the grid cells can receive focus (the grid's [tabIndex](ui.iggrid#options:tabIndex) property should not have a negative value) or Selection is enabled. If "dblclick" is included, then "click" has no effect. + * */ igGridUpdating(optionLiteral: 'option', optionName: "startEditTriggers"): string|Array; @@ -57053,6 +65665,7 @@ interface JQuery { /** * Sets how end-users are able to start edit mode. Possible values: "click", "dblclick", "F2", "enter" and their combinations separated by coma or in array. The keyboard triggers have effect only if the grid cells can receive focus (the grid's [tabIndex](ui.iggrid#options:tabIndex) property should not have a negative value) or Selection is enabled. If "dblclick" is included, then "click" has no effect. * + * * @optionValue New value to be set. */ @@ -57060,30 +65673,35 @@ interface JQuery { /** * Determines if pressing Enter to navigate away from the currently edited cell should move the focus horizontally or vertically (default). + * */ igGridUpdating(optionLiteral: 'option', optionName: "horizontalMoveOnEnter"): boolean; /** * Determines if pressing Enter to navigate away from the currently edited cell should move the focus horizontally or vertically (default). * + * * @optionValue New value to be set. */ igGridUpdating(optionLiteral: 'option', optionName: "horizontalMoveOnEnter", optionValue: boolean): void; /** * Enables excel navigation style. When turned on, the arrow keys can be used for changing the currently edited cell similar to how Tab and Enter behave. When disabled, the arrow keys control the cursor inside editors. + * */ igGridUpdating(optionLiteral: 'option', optionName: "excelNavigationMode"): boolean; /** * Enables excel navigation style. When turned on, the arrow keys can be used for changing the currently edited cell similar to how Tab and Enter behave. When disabled, the arrow keys control the cursor inside editors. * + * * @optionValue New value to be set. */ igGridUpdating(optionLiteral: 'option', optionName: "excelNavigationMode", optionValue: boolean): void; /** * Sets a custom function to be called when the AJAX request to the URL specified by the [updateUrl](ui.iggrid#options:updateUrl) property succeeds. The function will be called with arguments representing the data returned by the server. + * */ igGridUpdating(optionLiteral: 'option', optionName: "saveChangesSuccessHandler"): Function|string; @@ -57091,6 +65709,7 @@ interface JQuery { /** * Sets a custom function to be called when the AJAX request to the URL specified by the [updateUrl](ui.iggrid#options:updateUrl) property succeeds. The function will be called with arguments representing the data returned by the server. * + * * @optionValue New value to be set. */ @@ -57098,6 +65717,7 @@ interface JQuery { /** * Sets a custom function to be called when the AJAX request to the URL specified by the [updateUrl](ui.iggrid#options:updateUrl) property fails. The function will be called with arguments representing the data returned by the server. + * */ igGridUpdating(optionLiteral: 'option', optionName: "saveChangesErrorHandler"): Function|string; @@ -57105,6 +65725,7 @@ interface JQuery { /** * Sets a custom function to be called when the AJAX request to the URL specified by the [updateUrl](ui.iggrid#options:updateUrl) property fails. The function will be called with arguments representing the data returned by the server. * + * * @optionValue New value to be set. */ @@ -57112,6 +65733,7 @@ interface JQuery { /** * On touch-enabled devices specifies the swipe distance for the delete button to appear. + * */ igGridUpdating(optionLiteral: 'option', optionName: "swipeDistance"): string|number; @@ -57119,6 +65741,7 @@ interface JQuery { /** * On touch-enabled devices specifies the swipe distance for the delete button to appear. * + * * @optionValue New value to be set. */ @@ -57126,36 +65749,42 @@ interface JQuery { /** * Controls if navigation will wrap around the grid. The feature will never wrap around virtual grids. + * */ igGridUpdating(optionLiteral: 'option', optionName: "wrapAround"): boolean; /** * Controls if navigation will wrap around the grid. The feature will never wrap around virtual grids. * + * * @optionValue New value to be set. */ igGridUpdating(optionLiteral: 'option', optionName: "wrapAround", optionValue: boolean): void; /** * A list of options controlling the rendering behavior of the row edit dialog. If [editMode](ui.iggridupdating#options:editMode) is not 'dialog' these have no effect. + * */ igGridUpdating(optionLiteral: 'option', optionName: "rowEditDialogOptions"): IgGridUpdatingRowEditDialogOptions; /** * A list of options controlling the rendering behavior of the row edit dialog. If [editMode](ui.iggridupdating#options:editMode) is not 'dialog' these have no effect. * + * * @optionValue New value to be set. */ igGridUpdating(optionLiteral: 'option', optionName: "rowEditDialogOptions", optionValue: IgGridUpdatingRowEditDialogOptions): void; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. For more information on how to utilize this property, please refer to the [Extending igGrid Modal Dialog](http://www.igniteui.com/help/extending-iggrid-modal-dialog) topic. + * */ igGridUpdating(optionLiteral: 'option', optionName: "dialogWidget"): string; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. For more information on how to utilize this property, please refer to the [Extending igGrid Modal Dialog](http://www.igniteui.com/help/extending-iggrid-modal-dialog) topic. * + * * @optionValue New value to be set. */ igGridUpdating(optionLiteral: 'option', optionName: "dialogWidget", optionValue: string): void; @@ -57496,54 +66125,82 @@ interface WorkspaceResizedEventUIParam {} interface IgHtmlEditor { /** * Shows/hides the "Formatting" toolbar. + * */ showFormattingToolbar?: boolean; /** * Shows/hides the "Text" toolbar. + * */ showTextToolbar?: boolean; /** * Shows/hides the "Insert Object" toolbar. + * */ showInsertObjectToolbar?: boolean; /** * Shows/hides the "Copy Paste" toolbar. + * */ showCopyPasteToolbar?: boolean; /** * The width of the html editor. It can be set as a number in pixels, string (px) or percentage (%). + * */ width?: string|number; /** * The height of the html editor. It can be set as a number in pixels, string (px) or percentage (%). + * */ height?: string|number; /** * The html editor toolbars list. + * */ toolbarSettings?: any[]; /** * The html editor custom toolbars list. + * */ customToolbars?: any[]; /** * The name attribute of the html editor source view. + * */ inputName?: string; /** * Used to render inside the html editor as initial content + * */ value?: string; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event fired after the html editor widget has been rendered. */ @@ -57624,6 +66281,11 @@ interface IgHtmlEditorMethods { * Returns the element on which the widget was instantiated */ widget(): void; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.ightmleditor#options:language) + * Note that this method is for rare scenarios, use [language](ui.ightmleditor#options:language) or [locale](ui.ightmleditor#options:locale) option setter + */ changeLocale(): void; /** @@ -57695,6 +66357,16 @@ interface IgHtmlEditorMethods { * @param element Accepts html string, DOM element or a jQuery object. */ insertAtCaret(element: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igHtmlEditor"): IgHtmlEditorMethods; @@ -57737,6 +66409,24 @@ interface IgHtmlEditorPopover { item?: any; target?: any; isHidden?: boolean; + + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; apply?: ApplyEvent; cancel?: CancelEvent; show?: ShowEvent; @@ -57750,6 +66440,32 @@ interface IgHtmlEditorPopover { interface IgHtmlEditorPopoverMethods { show(item: Object): void; hide(): void; + + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ + changeLocale($container: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; + + /** + * Destroy is part of the jQuery UI widget API and does the following: + * 1. Remove custom CSS classes that were added. + * 2. Unwrap any wrapping elements such as scrolling divs and other containers. + * 3. Unbind all events that were bound. + */ + destroy(): void; } interface JQuery { data(propertyName: "igHtmlEditorPopover"): IgHtmlEditorPopoverMethods; @@ -57759,6 +66475,24 @@ interface IgLinkPropertiesDialog { item?: any; target?: any; isHidden?: boolean; + + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; apply?: ApplyEvent; cancel?: CancelEvent; show?: ShowEvent; @@ -57781,6 +66515,24 @@ interface IgTablePropertiesDialog { item?: any; target?: any; isHidden?: boolean; + + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; apply?: ApplyEvent; cancel?: CancelEvent; show?: ShowEvent; @@ -57803,6 +66555,24 @@ interface IgImagePropertiesDialog { item?: any; target?: any; isHidden?: boolean; + + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; apply?: ApplyEvent; cancel?: CancelEvent; show?: ShowEvent; @@ -57859,57 +66629,68 @@ interface JQuery { igHtmlEditor(methodName: "selection"): Object; igHtmlEditor(methodName: "range"): Object; igHtmlEditor(methodName: "insertAtCaret", element: Object): void; + igHtmlEditor(methodName: "changeGlobalLanguage"): void; + igHtmlEditor(methodName: "changeGlobalRegional"): void; /** * Shows/hides the "Formatting" toolbar. + * */ igHtmlEditor(optionLiteral: 'option', optionName: "showFormattingToolbar"): boolean; /** * Shows/hides the "Formatting" toolbar. * + * * @optionValue New value to be set. */ igHtmlEditor(optionLiteral: 'option', optionName: "showFormattingToolbar", optionValue: boolean): void; /** * Shows/hides the "Text" toolbar. + * */ igHtmlEditor(optionLiteral: 'option', optionName: "showTextToolbar"): boolean; /** * Shows/hides the "Text" toolbar. * + * * @optionValue New value to be set. */ igHtmlEditor(optionLiteral: 'option', optionName: "showTextToolbar", optionValue: boolean): void; /** * Shows/hides the "Insert Object" toolbar. + * */ igHtmlEditor(optionLiteral: 'option', optionName: "showInsertObjectToolbar"): boolean; /** * Shows/hides the "Insert Object" toolbar. * + * * @optionValue New value to be set. */ igHtmlEditor(optionLiteral: 'option', optionName: "showInsertObjectToolbar", optionValue: boolean): void; /** * Shows/hides the "Copy Paste" toolbar. + * */ igHtmlEditor(optionLiteral: 'option', optionName: "showCopyPasteToolbar"): boolean; /** * Shows/hides the "Copy Paste" toolbar. * + * * @optionValue New value to be set. */ igHtmlEditor(optionLiteral: 'option', optionName: "showCopyPasteToolbar", optionValue: boolean): void; /** * The width of the html editor. It can be set as a number in pixels, string (px) or percentage (%). + * */ igHtmlEditor(optionLiteral: 'option', optionName: "width"): string|number; @@ -57917,6 +66698,7 @@ interface JQuery { /** * The width of the html editor. It can be set as a number in pixels, string (px) or percentage (%). * + * * @optionValue New value to be set. */ @@ -57924,6 +66706,7 @@ interface JQuery { /** * The height of the html editor. It can be set as a number in pixels, string (px) or percentage (%). + * */ igHtmlEditor(optionLiteral: 'option', optionName: "height"): string|number; @@ -57931,6 +66714,7 @@ interface JQuery { /** * The height of the html editor. It can be set as a number in pixels, string (px) or percentage (%). * + * * @optionValue New value to be set. */ @@ -57938,52 +66722,104 @@ interface JQuery { /** * The html editor toolbars list. + * */ igHtmlEditor(optionLiteral: 'option', optionName: "toolbarSettings"): any[]; /** * The html editor toolbars list. * + * * @optionValue New value to be set. */ igHtmlEditor(optionLiteral: 'option', optionName: "toolbarSettings", optionValue: any[]): void; /** * The html editor custom toolbars list. + * */ igHtmlEditor(optionLiteral: 'option', optionName: "customToolbars"): any[]; /** * The html editor custom toolbars list. * + * * @optionValue New value to be set. */ igHtmlEditor(optionLiteral: 'option', optionName: "customToolbars", optionValue: any[]): void; /** * The name attribute of the html editor source view. + * */ igHtmlEditor(optionLiteral: 'option', optionName: "inputName"): string; /** * The name attribute of the html editor source view. * + * * @optionValue New value to be set. */ igHtmlEditor(optionLiteral: 'option', optionName: "inputName", optionValue: string): void; /** * Used to render inside the html editor as initial content + * */ igHtmlEditor(optionLiteral: 'option', optionName: "value"): string; /** * Used to render inside the html editor as initial content * + * * @optionValue New value to be set. */ igHtmlEditor(optionLiteral: 'option', optionName: "value", optionValue: string): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igHtmlEditor(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igHtmlEditor(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igHtmlEditor(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igHtmlEditor(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igHtmlEditor(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igHtmlEditor(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event fired after the html editor widget has been rendered. */ @@ -58169,12 +67005,60 @@ interface JQuery { interface JQuery { igHtmlEditorPopover(methodName: "show", item: Object): void; igHtmlEditorPopover(methodName: "hide"): void; + igHtmlEditorPopover(methodName: "changeLocale", $container: Object): void; + igHtmlEditorPopover(methodName: "changeGlobalLanguage"): void; + igHtmlEditorPopover(methodName: "changeGlobalRegional"): void; + igHtmlEditorPopover(methodName: "destroy"): void; igHtmlEditorPopover(optionLiteral: 'option', optionName: "item"): any; igHtmlEditorPopover(optionLiteral: 'option', optionName: "item", optionValue: any): void; igHtmlEditorPopover(optionLiteral: 'option', optionName: "target"): any; igHtmlEditorPopover(optionLiteral: 'option', optionName: "target", optionValue: any): void; igHtmlEditorPopover(optionLiteral: 'option', optionName: "isHidden"): boolean; igHtmlEditorPopover(optionLiteral: 'option', optionName: "isHidden", optionValue: boolean): void; + + /** + * Set/Get the locale setting for the widget. + * + */ + igHtmlEditorPopover(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igHtmlEditorPopover(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igHtmlEditorPopover(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igHtmlEditorPopover(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igHtmlEditorPopover(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igHtmlEditorPopover(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; igHtmlEditorPopover(optionLiteral: 'option', optionName: "apply"): ApplyEvent; igHtmlEditorPopover(optionLiteral: 'option', optionName: "apply", optionValue: ApplyEvent): void; igHtmlEditorPopover(optionLiteral: 'option', optionName: "cancel"): CancelEvent; @@ -58198,6 +67082,50 @@ interface JQuery { igLinkPropertiesDialog(optionLiteral: 'option', optionName: "target", optionValue: any): void; igLinkPropertiesDialog(optionLiteral: 'option', optionName: "isHidden"): boolean; igLinkPropertiesDialog(optionLiteral: 'option', optionName: "isHidden", optionValue: boolean): void; + + /** + * Set/Get the locale setting for the widget. + * + */ + igLinkPropertiesDialog(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igLinkPropertiesDialog(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igLinkPropertiesDialog(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igLinkPropertiesDialog(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igLinkPropertiesDialog(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igLinkPropertiesDialog(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; igLinkPropertiesDialog(optionLiteral: 'option', optionName: "apply"): ApplyEvent; igLinkPropertiesDialog(optionLiteral: 'option', optionName: "apply", optionValue: ApplyEvent): void; igLinkPropertiesDialog(optionLiteral: 'option', optionName: "cancel"): CancelEvent; @@ -58221,6 +67149,50 @@ interface JQuery { igTablePropertiesDialog(optionLiteral: 'option', optionName: "target", optionValue: any): void; igTablePropertiesDialog(optionLiteral: 'option', optionName: "isHidden"): boolean; igTablePropertiesDialog(optionLiteral: 'option', optionName: "isHidden", optionValue: boolean): void; + + /** + * Set/Get the locale setting for the widget. + * + */ + igTablePropertiesDialog(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igTablePropertiesDialog(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igTablePropertiesDialog(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igTablePropertiesDialog(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igTablePropertiesDialog(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igTablePropertiesDialog(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; igTablePropertiesDialog(optionLiteral: 'option', optionName: "apply"): ApplyEvent; igTablePropertiesDialog(optionLiteral: 'option', optionName: "apply", optionValue: ApplyEvent): void; igTablePropertiesDialog(optionLiteral: 'option', optionName: "cancel"): CancelEvent; @@ -58244,6 +67216,50 @@ interface JQuery { igImagePropertiesDialog(optionLiteral: 'option', optionName: "target", optionValue: any): void; igImagePropertiesDialog(optionLiteral: 'option', optionName: "isHidden"): boolean; igImagePropertiesDialog(optionLiteral: 'option', optionName: "isHidden", optionValue: boolean): void; + + /** + * Set/Get the locale setting for the widget. + * + */ + igImagePropertiesDialog(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igImagePropertiesDialog(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igImagePropertiesDialog(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igImagePropertiesDialog(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igImagePropertiesDialog(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igImagePropertiesDialog(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; igImagePropertiesDialog(optionLiteral: 'option', optionName: "apply"): ApplyEvent; igImagePropertiesDialog(optionLiteral: 'option', optionName: "apply", optionValue: ApplyEvent): void; igImagePropertiesDialog(optionLiteral: 'option', optionName: "cancel"): CancelEvent; @@ -58261,31 +67277,37 @@ interface JQuery { interface IgLayoutManagerBorderLayout { /** * Option specifying the width of the left region, either in px or percentages + * */ leftWidth?: string; /** * Option specifying the width of the right region, either in px or percentages + * */ rightWidth?: string; /** * Option specifying whether the footer region in the border layout will be hidden or shown + * */ showFooter?: boolean; /** * Option specifying whether the header region in the border layout will be hidden or shown + * */ showHeader?: boolean; /** * Option specifying whether the left region in the border layout will be hidden or shown + * */ showLeft?: boolean; /** * Option specifying whether the right region in the border layout will be hidden or shown + * */ showRight?: boolean; @@ -58298,11 +67320,13 @@ interface IgLayoutManagerBorderLayout { interface IgLayoutManagerGridLayout { /** * Specifies the duration of the animations in the layout manager"s grid layout + * */ animationDuration?: number; /** * Number of columns in the grid + * */ cols?: number; @@ -58311,6 +67335,7 @@ interface IgLayoutManagerGridLayout { * It can also accept an array, specifying height for each column. If more than one column * has an asterisk value, the remaining height will be equally distributed between these columns. * array The column height can be set as an array of heights. + * */ columnHeight?: string|number|Array; @@ -58319,32 +67344,38 @@ interface IgLayoutManagerGridLayout { * It can also accept an array, specifying width for each column. If more than one column * has an asterisk value, the remaining width will be equally distributed between these columns. * array The column width can be set as an array of widths. + * */ columnWidth?: string|number|Array; /** * Specifies the margin left css property for items + * */ marginLeft?: number; /** * Specifies the margin top css property for items + * */ marginTop?: number; /** * Specifies whether the previous set options should be overriden when setting options + * */ overrideConfigOnSetOption?: boolean; /** * Specified whether the items should rearrange to fit in the container when it is resized. * Have effect only when fixed columnWidth option is set. + * */ rearrangeItems?: boolean; /** * Number of rows in the grid + * */ rows?: number; @@ -58357,33 +67388,39 @@ interface IgLayoutManagerGridLayout { interface IgLayoutManagerItem { /** * Column index of the item in the grid + * */ colIndex?: number; /** * ColSpan of the item + * */ colSpan?: number; /** * Gets/Sets individual item height, either in px or percentage * string The default height can be set in pixels (px), %, em and other units. + * */ height?: string; /** * Row index of the item in the grid + * */ rowIndex?: number; /** * RowSpan of the item + * */ rowSpan?: number; /** * Gets/Sets individual item width, either in px or percentage * string The default width can be set in pixels (px), %, em and other units. + * */ width?: number; @@ -58470,21 +67507,25 @@ interface ItemRenderingEventUIParam { interface IgLayoutManager { /** * Options specific to a border layout + * */ borderLayout?: IgLayoutManagerBorderLayout; /** * Options specific to grid layout mode + * */ gridLayout?: IgLayoutManagerGridLayout; /** * Gets/Sets height of the layout container. + * */ height?: string|number; /** * Number of items to render, this is only applicable to layouts: vertical and flow + * */ itemCount?: number; @@ -58496,6 +67537,7 @@ interface IgLayoutManager { * items can have various properties some of which may not be applicable * depending on the layoutMode. * for example rowSpan/colSpan/colIndex/rowIndex are only applicable to gridlayout + * */ items?: IgLayoutManagerItem[]; @@ -58507,6 +67549,7 @@ interface IgLayoutManager { * column Column type can be set with column layout * vertical Column type can be set with vertical layout * + * * Valid values: * "grid" * "border" @@ -58518,6 +67561,7 @@ interface IgLayoutManager { /** * Gets/Sets width of the layout container. + * */ width?: string|number; @@ -58594,30 +67638,35 @@ interface JQuery { /** * Options specific to a border layout + * */ igLayoutManager(optionLiteral: 'option', optionName: "borderLayout"): IgLayoutManagerBorderLayout; /** * Options specific to a border layout * + * * @optionValue New value to be set. */ igLayoutManager(optionLiteral: 'option', optionName: "borderLayout", optionValue: IgLayoutManagerBorderLayout): void; /** * Options specific to grid layout mode + * */ igLayoutManager(optionLiteral: 'option', optionName: "gridLayout"): IgLayoutManagerGridLayout; /** * Options specific to grid layout mode * + * * @optionValue New value to be set. */ igLayoutManager(optionLiteral: 'option', optionName: "gridLayout", optionValue: IgLayoutManagerGridLayout): void; /** * Gets/Sets height of the layout container. + * */ igLayoutManager(optionLiteral: 'option', optionName: "height"): string|number; @@ -58625,6 +67674,7 @@ interface JQuery { /** * /Sets height of the layout container. * + * * @optionValue New value to be set. */ @@ -58632,12 +67682,14 @@ interface JQuery { /** * Number of items to render, this is only applicable to layouts: vertical and flow + * */ igLayoutManager(optionLiteral: 'option', optionName: "itemCount"): number; /** * Number of items to render, this is only applicable to layouts: vertical and flow * + * * @optionValue New value to be set. */ igLayoutManager(optionLiteral: 'option', optionName: "itemCount", optionValue: number): void; @@ -58650,6 +67702,7 @@ interface JQuery { * items can have various properties some of which may not be applicable * depending on the layoutMode. * for example rowSpan/colSpan/colIndex/rowIndex are only applicable to gridlayout + * */ igLayoutManager(optionLiteral: 'option', optionName: "items"): IgLayoutManagerItem[]; @@ -58662,6 +67715,7 @@ interface JQuery { * depending on the layoutMode. * for example rowSpan/colSpan/colIndex/rowIndex are only applicable to gridlayout * + * * @optionValue New value to be set. */ igLayoutManager(optionLiteral: 'option', optionName: "items", optionValue: IgLayoutManagerItem[]): void; @@ -58673,6 +67727,7 @@ interface JQuery { * flow Column type can be set with flow layout * column Column type can be set with column layout * vertical Column type can be set with vertical layout + * */ igLayoutManager(optionLiteral: 'option', optionName: "layoutMode"): any; @@ -58684,12 +67739,14 @@ interface JQuery { * column Column type can be set with column layout * vertical Column type can be set with vertical layout * + * * @optionValue New value to be set. */ igLayoutManager(optionLiteral: 'option', optionName: "layoutMode", optionValue: any): void; /** * Gets/Sets width of the layout container. + * */ igLayoutManager(optionLiteral: 'option', optionName: "width"): string|number; @@ -58697,6 +67754,7 @@ interface JQuery { /** * /Sets width of the layout container. * + * * @optionValue New value to be set. */ @@ -59201,6 +68259,24 @@ interface IgLinearGauge { */ pixelScalingRatio?: number; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event which is raised when a label of the the gauge is formatted. * Function takes first argument evt and second argument ui. @@ -59266,6 +68342,9 @@ interface IgLinearGaugeMethods { /** * Gets the value for the main scale of the gauge for a given point within the bounds of the gauge. + * + * @param x + * @param y */ getValueForPoint(x: Object, y: Object): number; @@ -59296,6 +68375,24 @@ interface IgLinearGaugeMethods { * Re-polls the css styles for the widget. Use this method when the css styles have been modified. */ styleUpdated(): void; + + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ + changeLocale($container: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igLinearGauge"): IgLinearGaugeMethods; @@ -59312,6 +68409,9 @@ interface JQuery { igLinearGauge(methodName: "flush"): void; igLinearGauge(methodName: "destroy"): void; igLinearGauge(methodName: "styleUpdated"): void; + igLinearGauge(methodName: "changeLocale", $container: Object): void; + igLinearGauge(methodName: "changeGlobalLanguage"): void; + igLinearGauge(methodName: "changeGlobalRegional"): void; /** * The width of the gauge. It can be set as a number in pixels, string (px) or percentage (%). @@ -60113,6 +69213,50 @@ interface JQuery { */ igLinearGauge(optionLiteral: 'option', optionName: "pixelScalingRatio", optionValue: number): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igLinearGauge(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igLinearGauge(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igLinearGauge(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igLinearGauge(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igLinearGauge(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igLinearGauge(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event which is raised when a label of the the gauge is formatted. * Function takes first argument evt and second argument ui. @@ -60438,6 +69582,7 @@ interface IgMapSeries { /** * Gets or sets the marker type for the current series object.If the MarkerTemplate property is set, the setting of the MarkerType property will be ignored. * + * * Valid values: * "unset" * "none" @@ -60879,6 +70024,7 @@ interface IgMap { /** * The response to user panning and zooming: whether to update the view immediately while the user action is happening, or to defer the update to after the user action is complete. The user action will be an action such as a mouse drag which causes panning and/or zooming to occur. * + * * Valid values: * "deferred" Defer the view update until after the user action is complete. * "immediate" Update the view immediately while the user action is happening. @@ -61019,6 +70165,24 @@ interface IgMap { */ theme?: string; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event fired when the mouse has hovered on a series and the tooltip is about to show * Function takes arguments evt and ui. @@ -61358,11 +70522,15 @@ interface IgMapMethods { /** * Gets the actual minimum value of the target xAxis or yAxis + * + * @param targetName */ getActualMinimumValue(targetName: Object): void; /** * Gets the actual maximum value of the target xAxis or yAxis + * + * @param targetName */ getActualMaximumValue(targetName: Object): void; @@ -61404,147 +70572,29 @@ interface IgMapMethods { * @param animate Whether the change should be animated, if possible. */ renderSeries(targetName: string, animate: boolean): void; + + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ + changeLocale($container: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igMap"): IgMapMethods; } -interface ShapeDataSourceSettings { - /** - * The unique identifier. - */ - id?: string; - - /** - * The Uri of the .shp portion of the Shapefile. - */ - shapefileSource?: string; - - /** - * The Uri of the .dbf portion of the Shapefile. - */ - databaseSource?: string; - - /** - * Callback function to call when data binding is complete. - */ - callback?: Function; - - /** - * Object on which to invoke the callback function. - */ - callee?: any; - - /** - * Callback function to call to allow shape records to be transformed. - * paramType="object" the shape record to be transformed. - */ - transformRecord?: Function; - - /** - * Callback function to call to allow points in the shape records to be transformed. - * paramType="object" the point to be transformed in place. The object will look like { x: value, y: value2 } - */ - transformPoint?: Function; - - /** - * Callback function to call to allow the bounds of the shape data source to be transformed. - * paramType="object" the bounds of the shape datasource to be transformed in place. The object will look like { top: value, left: value, width: value, height: value } - */ - transformBounds?: Function; - - /** - * Callback function to call when the import process has been completed - * paramType="object" the ShapeDataSource instance - */ - importCompleted?: Function; - - /** - * Option for ShapeDataSourceSettings - */ - [optionName: string]: any; -} - -declare namespace Infragistics { -class ShapeDataSource { - constructor(settings: ShapeDataSourceSettings); - - /** - * Loads to the current data source - */ - dataBind(): void; - - /** - * Returns true if data is loaded - */ - isBound(): boolean; - - /** - * Returns the current converter instance - */ - converter(): Object; -} -} -interface IgniteUIStatic { -ShapeDataSource: typeof Infragistics.ShapeDataSource; -} - -interface TriangulationDataSourceSettings { - /** - * The unique identifier. - */ - id?: string; - - /** - * A Uri specifying the location of the Itf file. - */ - source?: string; - - /** - * The TriangulationSource which is typically created after importing the Itf from the Source Uri. - */ - triangulationSource?: string; - - /** - * Callback function to call when data binding is complete - */ - callback?: Function; - - /** - * Object on which to invoke the callback function - */ - callee?: any; - - /** - * Option for TriangulationDataSourceSettings - */ - [optionName: string]: any; -} - -declare namespace Infragistics { -class TriangulationDataSource { - constructor(settings: TriangulationDataSourceSettings); - - /** - * Loads to the current data source - */ - dataBind(): void; - - /** - * Returns true if data is loaded - */ - isBound(): boolean; - - /** - * Returns the current converter instance - */ - converter(): Object; -} -} -interface IgniteUIStatic { -TriangulationDataSource: typeof Infragistics.TriangulationDataSource; -} - interface JQuery { igMap(methodName: "option"): void; igMap(methodName: "destroy"): void; @@ -61576,6 +70626,9 @@ interface JQuery { igMap(methodName: "getZoomFromGeographic", rect: Object): Object; igMap(methodName: "print"): void; igMap(methodName: "renderSeries", targetName: string, animate: boolean): void; + igMap(methodName: "changeLocale", $container: Object): void; + igMap(methodName: "changeGlobalLanguage"): void; + igMap(methodName: "changeGlobalRegional"): void; /** * The width of the map. It can be set as a number in pixels, string (px) or percentage (%). @@ -61821,6 +70874,7 @@ interface JQuery { /** * The response to user panning and zooming: whether to update the view immediately while the user action is happening, or to defer the update to after the user action is complete. The user action will be an action such as a mouse drag which causes panning and/or zooming to occur. + * */ igMap(optionLiteral: 'option', optionName: "windowResponse"): string; @@ -61828,6 +70882,7 @@ interface JQuery { /** * The response to user panning and zooming: whether to update the view immediately while the user action is happening, or to defer the update to after the user action is complete. The user action will be an action such as a mouse drag which causes panning and/or zooming to occur. * + * * @optionValue New value to be set. */ @@ -62141,6 +71196,50 @@ interface JQuery { */ igMap(optionLiteral: 'option', optionName: "theme", optionValue: string): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igMap(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igMap(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igMap(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igMap(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igMap(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igMap(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event fired when the mouse has hovered on a series and the tooltip is about to show * Function takes arguments evt and ui. @@ -62535,11 +71634,13 @@ interface JQuery { interface IgNotifierHeaderTemplate { /** * Controls whether the popover renders a functional close button + * */ closeButton?: boolean; /** * Sets the content for the popover header. + * */ title?: string; @@ -62553,6 +71654,7 @@ interface IgNotifier { /** * Gets/Sets the current state of the igNotifier messages. State controls what CSS classes are applied to the messages and target and has interactions with other options as well. * + * * Valid values: * "success" Messages and target CSS have success styles applied. * "info" Messages have info applied. Target is unaffected. @@ -62564,6 +71666,7 @@ interface IgNotifier { /** * Controls the level of notifications shown by automatic and manual messages using the [notify](ui.ignotifier#methods:notify) method. Use [show](ui.ignotifier#methods:show) to ignore the level. * + * * Valid values: * "success" Show all types of messages * "info" Show everything from info level messages up @@ -62575,6 +71678,7 @@ interface IgNotifier { /** * Controls where the popover DOM should be attached to (only applies to popovers). * + * * Valid values: * "string" A valid jQuery selector for the element * "object" A reference to the parent jQuery object @@ -62584,6 +71688,7 @@ interface IgNotifier { /** * Controls the positioning mode of messages. Setting a mode will override the default behavior which is auto.Note: Inline element uses a block container as is always placed after the target. * + * * Valid values: * "auto" Uses popover for info and warning messages and inline for errors and success. * "popover" Displays messages in a configurable popover. @@ -62593,17 +71698,20 @@ interface IgNotifier { /** * Allows setting the respective state CSS on the target element (used to apply border color by default) + * */ allowCSSOnTarget?: boolean; /** * Allows rendering a span with the respective state CSS to display jQuery UI framework icons + * */ showIcon?: boolean; /** * Gets/Sets the content for the popover container. Templated with parameters by default: {0} - icon container class, {1} - the icon class and {2} - message text. * + * * Valid values: * "string" String content of the popover container * "function" Function which is a callback that should return the content. Use the 'this' value to access the target DOM element and passed argument for state value. Result can also include the same template parametes. @@ -62612,12 +71720,14 @@ interface IgNotifier { /** * Sets the content for the popover header + * */ headerTemplate?: IgNotifierHeaderTemplate; /** * Sets the event on which the notification will be shown. Predefined values are "mouseenter", "click" and "focus" * + * * Valid values: * "mouseenter" The popover is shown on mouse enter in the target element * "click" The popover is shown on click on the target element @@ -62628,16 +71738,19 @@ interface IgNotifier { /** * Controls whether the popover will close on blur or not. This option has effect only when the corresponding [showOn](ui.ignotifier#options:showOn) is set (manual by default) + * */ closeOnBlur?: boolean; /** * Gets/Sets the time in milliseconds the notification fades in and out when showing/hiding + * */ animationDuration?: number; /** * Gets/Sets the distance in pixels a notification popover slides outwards as it's shown. + * */ animationSlideDistance?: number; @@ -62649,6 +71762,7 @@ interface IgNotifier { /** * controls the direction in which the control shows relative to the target element * + * * Valid values: * "auto" lets the control show on the side where enough space is available with the priority specified by the [directionPriority](ui.%%WidgetNameLowered%%#options:directionPriority) property * "left" shows popover on the left side of the target element @@ -62661,12 +71775,14 @@ interface IgNotifier { /** * Controls the priority in which the control searches for space to show relative to the target element. * This property has effect only if the [direction](ui.%%WidgetNameLowered%%#options:direction) property value is "auto" or unset. + * */ directionPriority?: any[]; /** * controls the position of the popover according to the target element in case the popover is larger than the target on the side we want to position, if the popover is smaller it should always be in the middle of the visible area * + * * Valid values: * "auto" lets the control choose a position depending on available space with the following priority balanced > end > start * "balanced" the popover is positioned at the middle of the target element @@ -62677,31 +71793,37 @@ interface IgNotifier { /** * defines width for the popover. leave null for auto. + * */ width?: number|string; /** * defines height for the popover. leave null for auto + * */ height?: number|string; /** * defines width the popover won't go under the value even if no specific one is set. + * */ minWidth?: number|string; /** * defines width the popover won't exceed even if no specific one is set. + * */ maxWidth?: number|string; /** * defines height the popover won't exceed even if no specific one is set. + * */ maxHeight?: number|string; /** * Sets the containment for the popover. Accepts a jQuery object + * */ containment?: any; @@ -62731,6 +71853,10 @@ interface IgNotifier { [optionName: string]: any; } interface IgNotifierMethods { + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.ignotifier#options:language) + * Note that this method is for rare scenarios, use [language](ui.ignotifier#options:language) or [locale](ui.ignotifier#options:locale) option setter + */ changeLocale(): void; /** @@ -62824,6 +71950,7 @@ interface JQuery { /** * Gets/Sets the current state of the igNotifier messages. State controls what CSS classes are applied to the messages and target and has interactions with other options as well. + * */ igNotifier(optionLiteral: 'option', optionName: "state"): string; @@ -62831,6 +71958,7 @@ interface JQuery { /** * /Sets the current state of the igNotifier messages. State controls what CSS classes are applied to the messages and target and has interactions with other options as well. * + * * @optionValue New value to be set. */ @@ -62838,6 +71966,7 @@ interface JQuery { /** * Controls the level of notifications shown by automatic and manual messages using the [notify](ui.ignotifier#methods:notify) method. Use [show](ui.ignotifier#methods:show) to ignore the level. + * */ igNotifier(optionLiteral: 'option', optionName: "notifyLevel"): string; @@ -62845,6 +71974,7 @@ interface JQuery { /** * Controls the level of notifications shown by automatic and manual messages using the [notify](ui.ignotifier#methods:notify) method. Use [show](ui.ignotifier#methods:show) to ignore the level. * + * * @optionValue New value to be set. */ @@ -62852,6 +71982,7 @@ interface JQuery { /** * Controls where the popover DOM should be attached to (only applies to popovers). + * */ igNotifier(optionLiteral: 'option', optionName: "appendTo"): string|Object; @@ -62859,6 +71990,7 @@ interface JQuery { /** * Controls where the popover DOM should be attached to (only applies to popovers). * + * * @optionValue New value to be set. */ @@ -62866,6 +71998,7 @@ interface JQuery { /** * Controls the positioning mode of messages. Setting a mode will override the default behavior which is auto.Note: Inline element uses a block container as is always placed after the target. + * */ igNotifier(optionLiteral: 'option', optionName: "mode"): string; @@ -62873,6 +72006,7 @@ interface JQuery { /** * Controls the positioning mode of messages. Setting a mode will override the default behavior which is auto.Note: Inline element uses a block container as is always placed after the target. * + * * @optionValue New value to be set. */ @@ -62880,30 +72014,35 @@ interface JQuery { /** * Allows setting the respective state CSS on the target element (used to apply border color by default) + * */ igNotifier(optionLiteral: 'option', optionName: "allowCSSOnTarget"): boolean; /** * Allows setting the respective state CSS on the target element (used to apply border color by default) * + * * @optionValue New value to be set. */ igNotifier(optionLiteral: 'option', optionName: "allowCSSOnTarget", optionValue: boolean): void; /** * Allows rendering a span with the respective state CSS to display jQuery UI framework icons + * */ igNotifier(optionLiteral: 'option', optionName: "showIcon"): boolean; /** * Allows rendering a span with the respective state CSS to display jQuery UI framework icons * + * * @optionValue New value to be set. */ igNotifier(optionLiteral: 'option', optionName: "showIcon", optionValue: boolean): void; /** * Gets/Sets the content for the popover container. Templated with parameters by default: {0} - icon container class, {1} - the icon class and {2} - message text. + * */ igNotifier(optionLiteral: 'option', optionName: "contentTemplate"): string|Function; @@ -62911,6 +72050,7 @@ interface JQuery { /** * /Sets the content for the popover container. Templated with parameters by default: {0} - icon container class, {1} - the icon class and {2} - message text. * + * * @optionValue New value to be set. */ @@ -62918,18 +72058,21 @@ interface JQuery { /** * The content for the popover header + * */ igNotifier(optionLiteral: 'option', optionName: "headerTemplate"): IgNotifierHeaderTemplate; /** * Sets the content for the popover header * + * * @optionValue New value to be set. */ igNotifier(optionLiteral: 'option', optionName: "headerTemplate", optionValue: IgNotifierHeaderTemplate): void; /** * Sets the event on which the notification will be shown. Predefined values are "mouseenter", "click" and "focus" + * */ igNotifier(optionLiteral: 'option', optionName: "showOn"): string; @@ -62937,6 +72080,7 @@ interface JQuery { /** * Sets the event on which the notification will be shown. Predefined values are "mouseenter", "click" and "focus" * + * * @optionValue New value to be set. */ @@ -62944,36 +72088,42 @@ interface JQuery { /** * Controls whether the popover will close on blur or not. This option has effect only when the corresponding [showOn](ui.ignotifier#options:showOn) is set (manual by default) + * */ igNotifier(optionLiteral: 'option', optionName: "closeOnBlur"): boolean; /** * Controls whether the popover will close on blur or not. This option has effect only when the corresponding [showOn](ui.ignotifier#options:showOn) is set (manual by default) * + * * @optionValue New value to be set. */ igNotifier(optionLiteral: 'option', optionName: "closeOnBlur", optionValue: boolean): void; /** * Gets/Sets the time in milliseconds the notification fades in and out when showing/hiding + * */ igNotifier(optionLiteral: 'option', optionName: "animationDuration"): number; /** * /Sets the time in milliseconds the notification fades in and out when showing/hiding * + * * @optionValue New value to be set. */ igNotifier(optionLiteral: 'option', optionName: "animationDuration", optionValue: number): void; /** * Gets/Sets the distance in pixels a notification popover slides outwards as it's shown. + * */ igNotifier(optionLiteral: 'option', optionName: "animationSlideDistance"): number; /** * /Sets the distance in pixels a notification popover slides outwards as it's shown. * + * * @optionValue New value to be set. */ igNotifier(optionLiteral: 'option', optionName: "animationSlideDistance", optionValue: number): void; @@ -62992,6 +72142,7 @@ interface JQuery { /** * Controls the direction in which the control shows relative to the target element + * */ igNotifier(optionLiteral: 'option', optionName: "direction"): string; @@ -62999,6 +72150,7 @@ interface JQuery { /** * Controls the direction in which the control shows relative to the target element * + * * @optionValue New value to be set. */ @@ -63007,6 +72159,7 @@ interface JQuery { /** * Controls the priority in which the control searches for space to show relative to the target element. * This property has effect only if the [direction](ui.%%WidgetNameLowered%%#options:direction) property value is "auto" or unset. + * */ igNotifier(optionLiteral: 'option', optionName: "directionPriority"): any[]; @@ -63014,12 +72167,14 @@ interface JQuery { * Controls the priority in which the control searches for space to show relative to the target element. * This property has effect only if the [direction](ui.%%WidgetNameLowered%%#options:direction) property value is "auto" or unset. * + * * @optionValue New value to be set. */ igNotifier(optionLiteral: 'option', optionName: "directionPriority", optionValue: any[]): void; /** * Controls the position of the popover according to the target element in case the popover is larger than the target on the side we want to position, if the popover is smaller it should always be in the middle of the visible area + * */ igNotifier(optionLiteral: 'option', optionName: "position"): string; @@ -63027,6 +72182,7 @@ interface JQuery { /** * Controls the position of the popover according to the target element in case the popover is larger than the target on the side we want to position, if the popover is smaller it should always be in the middle of the visible area * + * * @optionValue New value to be set. */ @@ -63034,6 +72190,7 @@ interface JQuery { /** * Defines width for the popover. leave null for auto. + * */ igNotifier(optionLiteral: 'option', optionName: "width"): number|string; @@ -63041,6 +72198,7 @@ interface JQuery { /** * Defines width for the popover. leave null for auto. * + * * @optionValue New value to be set. */ @@ -63048,6 +72206,7 @@ interface JQuery { /** * Defines height for the popover. leave null for auto + * */ igNotifier(optionLiteral: 'option', optionName: "height"): number|string; @@ -63055,6 +72214,7 @@ interface JQuery { /** * Defines height for the popover. leave null for auto * + * * @optionValue New value to be set. */ @@ -63062,6 +72222,7 @@ interface JQuery { /** * Defines width the popover won't go under the value even if no specific one is set. + * */ igNotifier(optionLiteral: 'option', optionName: "minWidth"): number|string; @@ -63069,6 +72230,7 @@ interface JQuery { /** * Defines width the popover won't go under the value even if no specific one is set. * + * * @optionValue New value to be set. */ @@ -63076,6 +72238,7 @@ interface JQuery { /** * Defines width the popover won't exceed even if no specific one is set. + * */ igNotifier(optionLiteral: 'option', optionName: "maxWidth"): number|string; @@ -63083,6 +72246,7 @@ interface JQuery { /** * Defines width the popover won't exceed even if no specific one is set. * + * * @optionValue New value to be set. */ @@ -63090,6 +72254,7 @@ interface JQuery { /** * Defines height the popover won't exceed even if no specific one is set. + * */ igNotifier(optionLiteral: 'option', optionName: "maxHeight"): number|string; @@ -63097,6 +72262,7 @@ interface JQuery { /** * Defines height the popover won't exceed even if no specific one is set. * + * * @optionValue New value to be set. */ @@ -63104,12 +72270,14 @@ interface JQuery { /** * The containment for the popover. Accepts a jQuery object + * */ igNotifier(optionLiteral: 'option', optionName: "containment"): any; /** * Sets the containment for the popover. Accepts a jQuery object * + * * @optionValue New value to be set. */ igNotifier(optionLiteral: 'option', optionName: "containment", optionValue: any): void; @@ -63170,8 +72338,8 @@ interface JQuery { interface IgPivotDataSelectorDataSourceOptionsXmlaOptionsRequestOptions { /** * The value is applied to XmlHttpRequest.withCredentials if supported by the user agent. - * Setting this property to true will allow IE8/IE9 to make authenticated cross-origin requests to tusted domains through XmlHttpRequest instead of XDomainRequest - * and will prompt the user for credentials. + * Setting this property to true will allow IE8/IE9 to make authenticated cross-origin requests to tusted domains through XmlHttpRequest instead of XDomainRequest + * and will prompt the user for credentials. */ withCredentials?: boolean; @@ -63256,13 +72424,13 @@ interface IgPivotDataSelectorDataSourceOptionsXmlaOptions { /** * Additional properties sent with every discover request. - * The object is treated as a key/value store where each property name is used as the key and the property value as the value. + * The object is treated as a key/value store where each property name is used as the key and the property value as the value. */ discoverProperties?: any; /** * Additional properties sent with every execute request. - * The object is treated as a key/value store where each property name is used as the key and the property value as the value. + * The object is treated as a key/value store where each property name is used as the key and the property value as the value. */ executeProperties?: any; @@ -63290,7 +72458,7 @@ interface IgPivotDataSelectorDataSourceOptionsFlatDataOptionsMetadataCubeMeasure /** * Optional="false" An aggregator function called when each cell is evaluated. - * Returns a value for the cell. If the returned value is null, no cell will be created in for the data source result. + * Returns a value for the cell. If the returned value is null, no cell will be created in for the data source result. */ aggregator?: Function; @@ -63308,14 +72476,14 @@ interface IgPivotDataSelectorDataSourceOptionsFlatDataOptionsMetadataCubeMeasure interface IgPivotDataSelectorDataSourceOptionsFlatDataOptionsMetadataCubeMeasuresDimension { /** * A unique name for the measures dimension. - * The default value is "Measures". This name is used to create the names of dimensions using the following pattern: - * [].[] + * The default value is "Measures". This name is used to create the names of dimensions using the following pattern: + * [].[] */ name?: string; /** * A caption for the measures dimension. - * The default value is "Measures". + * The default value is "Measures". */ caption?: string; @@ -63333,8 +72501,8 @@ interface IgPivotDataSelectorDataSourceOptionsFlatDataOptionsMetadataCubeMeasure interface IgPivotDataSelectorDataSourceOptionsFlatDataOptionsMetadataCubeDimensionHierarchieLevel { /** * Optional="false" A name for the level. - * The unique name of the level is formed using the following pattern: - * {}.[] + * The unique name of the level is formed using the following pattern: + * {}.[] */ name?: string; @@ -63345,7 +72513,7 @@ interface IgPivotDataSelectorDataSourceOptionsFlatDataOptionsMetadataCubeDimensi /** * A function called for each item of the data source array when level members are created. - * Based on the item parameter the function should return a value that will form the $.ig.Member’s name and caption. + * Based on the item parameter the function should return a value that will form the $.ig.Member’s name and caption. */ memberProvider?: Function; @@ -63358,8 +72526,8 @@ interface IgPivotDataSelectorDataSourceOptionsFlatDataOptionsMetadataCubeDimensi interface IgPivotDataSelectorDataSourceOptionsFlatDataOptionsMetadataCubeDimensionHierarchie { /** * Optional="false" A name for the hierarchy. - * The unique name of the hierarchy is formed using the following pattern: - * [].[] + * The unique name of the hierarchy is formed using the following pattern: + * [].[] */ name?: string; @@ -63370,8 +72538,8 @@ interface IgPivotDataSelectorDataSourceOptionsFlatDataOptionsMetadataCubeDimensi /** * The path to be used when displaying the hierarchy in the user interface. - * Nested folders are indicated by a backslash (\). - * The folder hierarchy will appear under parent dimension node. + * Nested folders are indicated by a backslash (\). + * The folder hierarchy will appear under parent dimension node. */ displayFolder?: string; @@ -63465,14 +72633,14 @@ interface IgPivotDataSelectorDataSourceOptionsFlatDataOptions { /** * See $.ig.DataSource. - * string Specifies the name of the property in which data records are held if the response is wrapped. - * null Option is ignored. + * string Specifies the name of the property in which data records are held if the response is wrapped. + * null Option is ignored. */ responseDataKey?: string; /** * String Explicitly set data source type (such as "json"). Please refer to the documentation of $.ig.DataSource and its type property. - * null Option is ignored. + * null Option is ignored. */ responseDataType?: string; @@ -63531,7 +72699,8 @@ interface IgPivotDataSelectorDragAndDropSettings { appendTo?: any; /** - * Specifies the containment for the drag helper. The area inside of which the helper is contained would be scrollable while dragging. + * Specifies the containment for the drag helper. The area inside of which thehelper is contained would be scrollable while dragging. + * */ containment?: boolean|string|Array; @@ -63552,7 +72721,7 @@ interface DataSelectorRenderedEvent { interface DataSelectorRenderedEventUIParam { /** - * Used to get a reference to the data selector. + * Gets a reference to the data selector. */ owner?: any; } @@ -63563,22 +72732,22 @@ interface DataSourceInitializedEvent { interface DataSourceInitializedEventUIParam { /** - * Used to get a reference to the data selector. + * Gets a reference to the data selector. */ owner?: any; /** - * Used to get a reference to the data source. + * Gets a reference to the data source. */ dataSource?: any; /** - * Used to see if an error has occured during initialization. + * See if an error has occured during initialization. */ - error?: any; + error?: string; /** - * Used to get a reference to the root of the data source metatadata root item. + * Gets a reference to the root of the data source metatadata root item. */ metadataTreeRoot?: any; } @@ -63589,22 +72758,22 @@ interface DataSourceUpdatedEvent { interface DataSourceUpdatedEventUIParam { /** - * Used to get a reference to the data selector. + * Gets a reference to the data selector. */ owner?: any; /** - * Used to get a reference to the data source. + * Gets a reference to the data source. */ dataSource?: any; /** - * Used to see if an error has occured during update. + * See if an error has occured during update. */ - error?: any; + error?: string; /** - * Used to get the result of the update operation. + * Gets the result of the update operation. */ result?: any; } @@ -63615,14 +72784,14 @@ interface DeferUpdateChangedEvent { interface DeferUpdateChangedEventUIParam { /** - * Used to get a reference to the data selector. + * Gets a reference to the data selector. */ owner?: any; /** - * Used to get the defer update value. + * Gets the defer update value. */ - deferUpdate?: any; + deferUpdate?: boolean; } interface DragStartEvent { @@ -63631,27 +72800,27 @@ interface DragStartEvent { interface DragStartEventUIParam { /** - * Used to get a reference to the data. + * Gets a reference to the data. */ metadata?: any; /** - * Used to get a reference to the helper. + * Gets a reference to the helper. */ - helper?: any; + helper?: string; /** - * Used to get a reference to the offset. + * Gets a reference to the offset. */ offset?: any; /** - * Used to get a reference to the original position of the draggable element. + * Gets a reference to the original position of the draggable element. */ originalPosition?: any; /** - * Used to get a reference to the current position of the draggable element. + * Gets a reference to the current position of the draggable element. */ position?: any; } @@ -63662,27 +72831,27 @@ interface DragEvent { interface DragEventUIParam { /** - * Used to get a reference to the data. + * Gets a reference to the data. */ metadata?: any; /** - * Used to get a reference to the helper. + * Gets a reference to the helper. */ - helper?: any; + helper?: string; /** - * Used to get a reference to the offset. + * Gets a reference to the offset. */ offset?: any; /** - * Used to get a reference to the original position of the draggable element. + * Gets a reference to the original position of the draggable element. */ originalPosition?: any; /** - * Used to get a reference to the current position of the draggable element. + * Gets a reference to the current position of the draggable element. */ position?: any; } @@ -63693,22 +72862,22 @@ interface DragStopEvent { interface DragStopEventUIParam { /** - * Used to get a reference to the helper. + * Gets a reference to the helper. */ - helper?: any; + helper?: string; /** - * Used to get a reference to the offset. + * Gets a reference to the offset. */ offset?: any; /** - * Used to get a reference to the original position of the draggable element. + * Gets a reference to the original position of the draggable element. */ originalPosition?: any; /** - * Used to get a reference to the current position of the draggable element. + * Gets a reference to the current position of the draggable element. */ position?: any; } @@ -63719,37 +72888,37 @@ interface MetadataDroppingEvent { interface MetadataDroppingEventUIParam { /** - * Used to the drop target. + * A reference to the drop target. */ - targetElement?: any; + targetElement?: string; /** - * Used to the dragged element. + * A reference to the dragged element. */ - draggedElement?: any; + draggedElement?: string; /** - * Used to get a reference to the data. + * Gets a reference to the data. */ metadata?: any; /** - * Used to get the index at which the metadata will be inserted. + * Gets the index at which the metadata will be inserted. */ - metadataIndex?: any; + metadataIndex?: number; /** - * Used to get a reference to the helper. + * Gets a reference to the helper. */ - helper?: any; + helper?: string; /** - * Used to get a reference to the offset. + * Gets a reference to the offset. */ offset?: any; /** - * Used to get a reference to the current position of the draggable element. + * Gets a reference to the current position of the draggable element. */ position?: any; } @@ -63760,37 +72929,37 @@ interface MetadataDroppedEvent { interface MetadataDroppedEventUIParam { /** - * Used to the drop target. + * A reference to the drop target. */ - targetElement?: any; + targetElement?: string; /** - * Used to the dragged element. + * A reference to the dragged element. */ - draggedElement?: any; + draggedElement?: string; /** - * Used to get a reference to the data. + * Gets a reference to the data. */ metadata?: any; /** - * Used to get the index at which the metadata is inserted. + * Gets the index at which the metadata is inserted. */ - metadataIndex?: any; + metadataIndex?: number; /** - * Used to get a reference to the helper. + * Gets a reference to the helper. */ - helper?: any; + helper?: string; /** - * Used to get a reference to the offset. + * Gets a reference to the offset. */ offset?: any; /** - * Used to get a reference to the current position of the draggable element. + * Gets a reference to the current position of the draggable element. */ position?: any; } @@ -63801,12 +72970,12 @@ interface MetadataRemovingEvent { interface MetadataRemovingEventUIParam { /** - * Used to the dragged element. + * A reference to the dragged element. */ - targetElement?: any; + targetElement?: string; /** - * Used to get a reference to the data. + * Gets a reference to the data. */ metadata?: any; } @@ -63817,7 +72986,7 @@ interface MetadataRemovedEvent { interface MetadataRemovedEventUIParam { /** - * Used to get a reference to the data. + * Gets a reference to the data. */ metadata?: any; } @@ -63828,7 +72997,7 @@ interface FilterDropDownOpeningEvent { interface FilterDropDownOpeningEventUIParam { /** - * Used to the hierarchy. + * A reference to the hierarchy. */ hierarchy?: any; } @@ -63839,14 +73008,14 @@ interface FilterDropDownOpenedEvent { interface FilterDropDownOpenedEventUIParam { /** - * Used to the hierarchy. + * A reference to the hierarchy. */ hierarchy?: any; /** - * Used to the drop down. + * A reference to the drop down. */ - dropDownElement?: any; + dropDownElement?: string; } interface FilterMembersLoadedEvent { @@ -63855,11 +73024,19 @@ interface FilterMembersLoadedEvent { interface FilterMembersLoadedEventUIParam { /** - * Used to get the parent node or the igTree instance in the initial load. + * Gets the parent node or the igTree instance in the initial load. */ - parent?: any; - rootFilterMembers?: any; - filterMembers?: any; + parent?: string; + + /** + * A collection with the root filter members . + */ + rootFilterMembers?: any[]; + + /** + * A collection with the newly loaded filter members. + */ + filterMembers?: any[]; } interface FilterDropDownOkEvent { @@ -63868,15 +73045,19 @@ interface FilterDropDownOkEvent { interface FilterDropDownOkEventUIParam { /** - * Used to the hierarchy. + * A reference to the hierarchy. */ hierarchy?: any; - filterMembers?: any; /** - * Used to the drop down. + * A collection with the selected filter members. If all filter members are selected the collection will be empty. */ - dropDownElement?: any; + filterMembers?: any[]; + + /** + * A reference to the drop down. + */ + dropDownElement?: string; } interface FilterDropDownClosingEvent { @@ -63885,14 +73066,14 @@ interface FilterDropDownClosingEvent { interface FilterDropDownClosingEventUIParam { /** - * Used to the hierarchy. + * A reference to the hierarchy. */ hierarchy?: any; /** - * Used to the drop down. + * A reference to the drop down. */ - dropDownElement?: any; + dropDownElement?: string; } interface FilterDropDownClosedEvent { @@ -63901,17 +73082,26 @@ interface FilterDropDownClosedEvent { interface FilterDropDownClosedEventUIParam { /** - * Used to the hierarchy. + * A reference to the hierarchy. */ hierarchy?: any; } interface IgPivotDataSelector { + /** + * + * + * Valid values: + * "string" The widget width can be set in pixels (px) and percentage (%). The recommended width is 250px. + * "number" The widget width can be set as a number. + * "null" will stretch to fit data, if no other widths are defined. + */ width?: string|number; /** * This is the total height of the grid, including all UI elements - scroll container with data rows, header, footer, filter row - (if any), etc. * + * * Valid values: * "string" The widget height can be set in pixels (px) and percentage (%). * "number" The widget height can be set as a number. @@ -63921,22 +73111,26 @@ interface IgPivotDataSelector { /** * An instance of $.ig.OlapXmlaDataSource or $.ig.OlapFlatDataSource. + * */ dataSource?: any; /** * An object that will be used to create an instance of $.ig.OlapXmlaDataSource or $.ig.OlapFlatDataSource. - * The provided value must contain an object with settings for one of the data source types - xmlaOptions or flatDataOptions. + * The provided value must contain an object with settings for one of the data source types - xmlaOptions or flatDataOptions. + * */ dataSourceOptions?: IgPivotDataSelectorDataSourceOptions; /** * Setting deferUpdate to true will not apply changes to the data source until the update method is called or the update layout button is clicked. + * */ deferUpdate?: boolean; /** * Settings for the drag and drop functionality of the igPivotDataSelector. + * */ dragAndDropSettings?: IgPivotDataSelectorDragAndDropSettings; @@ -63947,173 +73141,138 @@ interface IgPivotDataSelector { /** * Disable the drag and drop for the rows drop area and the ability to use filtering and remove items from it. + * */ disableRowsDropArea?: boolean; /** * Disable the drag and drop for the columns drop area and the ability to use filtering and remove items from it. + * */ disableColumnsDropArea?: boolean; /** * Disable the drag and drop for the measures drop area and the ability to use filtering and remove items from it. + * */ disableMeasuresDropArea?: boolean; /** * Disable the drag and drop for the filters drop area and the ability to use filtering and remove items from it. + * */ disableFiltersDropArea?: boolean; /** * A function that will be called to determine if an item can be moved in or dropped on an area of the data selector. - * paramType="string" The location where the item will be moved - igPivotGrid, igPivotDataSelector, filters, rows, columns or measures. - * paramType="string" The type of the item - Hierarchy, Measure or MeasureList. - * paramType="string" The unique name of the item. - * returnType="bool" The function must return true if the item should be accepted. + * + * paramType="string" The location where the item will be moved - igPivotGrid, igPivotDataSelector, filters, rows, columns or measures. + * paramType="string" The type of the item - Hierarchy, Measure or MeasureList. + * paramType="string" The unique name of the item. + * returnType="bool" The function must return true if the item should be accepted. */ customMoveValidation?: Function; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Fired after the data selector is rendered. Changing the data source instance will re-render the data selector. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the data selector. */ dataSelectorRendered?: DataSelectorRenderedEvent; /** * Fired after the data source has initialized. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the data selector. - * Use ui.dataSource to get a reference to the data source. - * Use ui.error to see if an error has occured during initialization. - * Use ui.metadataTreeRoot to get a reference to the root of the data source metatadata root item. */ dataSourceInitialized?: DataSourceInitializedEvent; /** * Fired after the data source has updated. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the data selector. - * Use ui.dataSource to get a reference to the data source. - * Use ui.error to see if an error has occured during update. - * Use ui.result to get the result of the update operation. */ dataSourceUpdated?: DataSourceUpdatedEvent; /** * Fired when the defer update checkbox changes. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the data selector. - * Use ui.deferUpdate to get the defer update value. */ deferUpdateChanged?: DeferUpdateChangedEvent; /** * Fired on drag start. Return false to cancel the drag. - * Use ui.metadatato get a reference to the data. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.originalPosition to get a reference to the original position of the draggable element. - * Use ui.position to get a reference to the current position of the draggable element. */ dragStart?: DragStartEvent; /** * Fired on drag. Return false to cancel the dragging. - * Use ui.metadatato get a reference to the data. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.originalPosition to get a reference to the original position of the draggable element. - * Use ui.position to get a reference to the current position of the draggable element. */ drag?: DragEvent; /** * Fired on drag stop. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.originalPosition to get a reference to the original position of the draggable element. - * Use ui.position to get a reference to the current position of the draggable element. */ dragStop?: DragStopEvent; /** * Fired before a metadata item drop. Return false to cancel the drop. - * Use ui.targetElement for a reference to the drop target. - * Use ui.draggedElement for a reference to the dragged element. - * Use ui.metadatato get a reference to the data. - * Use ui.metadataIndex to get the index at which the metadata will be inserted. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.position to get a reference to the current position of the draggable element. */ metadataDropping?: MetadataDroppingEvent; /** * Fired after a metadata item drop. - * Use ui.targetElement for a reference to the drop target. - * Use ui.draggedElement for a reference to the dragged element. - * Use ui.metadatato get a reference to the data. - * Use ui.metadataIndex to get the index at which the metadata is inserted. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.position to get a reference to the current position of the draggable element. */ metadataDropped?: MetadataDroppedEvent; /** * Fired before a metadata item is removed when the user clicks the close icon. Return false to cancel the removing. - * Use ui.targetElement for a reference to the dragged element. - * Use ui.metadatato get a reference to the data. */ metadataRemoving?: MetadataRemovingEvent; /** * Fired after a metadata item is removed when the user clicks the close icon. - * Use ui.metadatato get a reference to the data. */ metadataRemoved?: MetadataRemovedEvent; /** * Fired before the filter members drop down opens. Return false to cancel the opening. - * Use ui.hierarchy for a reference to the hierarchy. */ filterDropDownOpening?: FilterDropDownOpeningEvent; /** * Fired after the filter members drop down opens. - * Use ui.hierarchy for a reference to the hierarchy. - * Use ui.dropDownElement for a reference to the drop down. */ filterDropDownOpened?: FilterDropDownOpenedEvent; /** * Fired after the filter members are loaded. - * Use ui.parent to get the parent node or the igTree instance in the initial load. - * Use ui.rootFilterMembers for a collection with the root filter members . - * Use ui.filterMembers for a collection with the newly loaded filter members. */ filterMembersLoaded?: FilterMembersLoadedEvent; /** * Fired after the OK button in the filter members drop down is clicked. Return false to cancel the applying of the filters. - * Use ui.hierarchy for a reference to the hierarchy. - * Use ui.filterMembers for a collection with the selected filter members. If all filter members are selected the collection will be empty. - * Use ui.dropDownElement for a reference to the drop down. */ filterDropDownOk?: FilterDropDownOkEvent; /** * Fired before the filter members drop down closes. Return false to cancel the closing. - * Use ui.hierarchy for a reference to the hierarchy. - * Use ui.dropDownElement for a reference to the drop down. */ filterDropDownClosing?: FilterDropDownClosingEvent; /** * Fired after the filter members drop down closes. - * Use ui.hierarchy for a reference to the hierarchy. */ filterDropDownClosed?: FilterDropDownClosedEvent; @@ -64123,6 +73282,10 @@ interface IgPivotDataSelector { [optionName: string]: any; } interface IgPivotDataSelectorMethods { + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.igpivotdataselector#options:language) + * Note that this method is for rare scenarios, see [language](ui.igpivotdataselector#options:language) or [locale](ui.igpivotdataselector#options:locale) option setter + */ changeLocale(): void; /** @@ -64132,11 +73295,21 @@ interface IgPivotDataSelectorMethods { /** * Destroy is part of the jQuery UI widget API and does the following: - * 1. Remove custom CSS classes that were added. - * 2. Unwrap any wrapping elements such as scrolling divs and other containers. - * 3. Unbind all events that were bound. + * 1. Remove custom CSS classes that were added. + * 2. Unwrap any wrapping elements such as scrolling divs and other containers. + * 3. Unbind all events that were bound. */ destroy(): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igPivotDataSelector"): IgPivotDataSelectorMethods; @@ -64146,13 +73319,26 @@ interface JQuery { igPivotDataSelector(methodName: "changeLocale"): void; igPivotDataSelector(methodName: "update"): void; igPivotDataSelector(methodName: "destroy"): void; + igPivotDataSelector(methodName: "changeGlobalLanguage"): void; + igPivotDataSelector(methodName: "changeGlobalRegional"): void; + + /** + * * + */ igPivotDataSelector(optionLiteral: 'option', optionName: "width"): string|number; + /** + * * + * + * @optionValue New value to be set. + */ + igPivotDataSelector(optionLiteral: 'option', optionName: "width", optionValue: string|number): void; /** * This is the total height of the grid, including all UI elements - scroll container with data rows, header, footer, filter row - (if any), etc. + * */ igPivotDataSelector(optionLiteral: 'option', optionName: "height"): string|number; @@ -64160,6 +73346,7 @@ interface JQuery { /** * This is the total height of the grid, including all UI elements - scroll container with data rows, header, footer, filter row - (if any), etc. * + * * @optionValue New value to be set. */ @@ -64167,25 +73354,29 @@ interface JQuery { /** * An instance of $.ig.OlapXmlaDataSource or $.ig.OlapFlatDataSource. + * */ igPivotDataSelector(optionLiteral: 'option', optionName: "dataSource"): any; /** * An instance of $.ig.OlapXmlaDataSource or $.ig.OlapFlatDataSource. * + * * @optionValue New value to be set. */ igPivotDataSelector(optionLiteral: 'option', optionName: "dataSource", optionValue: any): void; /** * An object that will be used to create an instance of $.ig.OlapXmlaDataSource or $.ig.OlapFlatDataSource. - * The provided value must contain an object with settings for one of the data source types - xmlaOptions or flatDataOptions. + * The provided value must contain an object with settings for one of the data source types - xmlaOptions or flatDataOptions. + * */ igPivotDataSelector(optionLiteral: 'option', optionName: "dataSourceOptions"): IgPivotDataSelectorDataSourceOptions; /** * An object that will be used to create an instance of $.ig.OlapXmlaDataSource or $.ig.OlapFlatDataSource. - * The provided value must contain an object with settings for one of the data source types - xmlaOptions or flatDataOptions. + * The provided value must contain an object with settings for one of the data source types - xmlaOptions or flatDataOptions. + * * * @optionValue New value to be set. */ @@ -64193,24 +73384,28 @@ interface JQuery { /** * Setting deferUpdate to true will not apply changes to the data source until the update method is called or the update layout button is clicked. + * */ igPivotDataSelector(optionLiteral: 'option', optionName: "deferUpdate"): boolean; /** * Setting deferUpdate to true will not apply changes to the data source until the update method is called or the update layout button is clicked. * + * * @optionValue New value to be set. */ igPivotDataSelector(optionLiteral: 'option', optionName: "deferUpdate", optionValue: boolean): void; /** * Settings for the drag and drop functionality of the igPivotDataSelector. + * */ igPivotDataSelector(optionLiteral: 'option', optionName: "dragAndDropSettings"): IgPivotDataSelectorDragAndDropSettings; /** * Settings for the drag and drop functionality of the igPivotDataSelector. * + * * @optionValue New value to be set. */ igPivotDataSelector(optionLiteral: 'option', optionName: "dragAndDropSettings", optionValue: IgPivotDataSelectorDragAndDropSettings): void; @@ -64229,83 +73424,133 @@ interface JQuery { /** * Disable the drag and drop for the rows drop area and the ability to use filtering and remove items from it. + * */ igPivotDataSelector(optionLiteral: 'option', optionName: "disableRowsDropArea"): boolean; /** * Disable the drag and drop for the rows drop area and the ability to use filtering and remove items from it. * + * * @optionValue New value to be set. */ igPivotDataSelector(optionLiteral: 'option', optionName: "disableRowsDropArea", optionValue: boolean): void; /** * Disable the drag and drop for the columns drop area and the ability to use filtering and remove items from it. + * */ igPivotDataSelector(optionLiteral: 'option', optionName: "disableColumnsDropArea"): boolean; /** * Disable the drag and drop for the columns drop area and the ability to use filtering and remove items from it. * + * * @optionValue New value to be set. */ igPivotDataSelector(optionLiteral: 'option', optionName: "disableColumnsDropArea", optionValue: boolean): void; /** * Disable the drag and drop for the measures drop area and the ability to use filtering and remove items from it. + * */ igPivotDataSelector(optionLiteral: 'option', optionName: "disableMeasuresDropArea"): boolean; /** * Disable the drag and drop for the measures drop area and the ability to use filtering and remove items from it. * + * * @optionValue New value to be set. */ igPivotDataSelector(optionLiteral: 'option', optionName: "disableMeasuresDropArea", optionValue: boolean): void; /** * Disable the drag and drop for the filters drop area and the ability to use filtering and remove items from it. + * */ igPivotDataSelector(optionLiteral: 'option', optionName: "disableFiltersDropArea"): boolean; /** * Disable the drag and drop for the filters drop area and the ability to use filtering and remove items from it. * + * * @optionValue New value to be set. */ igPivotDataSelector(optionLiteral: 'option', optionName: "disableFiltersDropArea", optionValue: boolean): void; /** * A function that will be called to determine if an item can be moved in or dropped on an area of the data selector. - * paramType="string" The location where the item will be moved - igPivotGrid, igPivotDataSelector, filters, rows, columns or measures. - * paramType="string" The type of the item - Hierarchy, Measure or MeasureList. - * paramType="string" The unique name of the item. - * returnType="bool" The function must return true if the item should be accepted. + * + * paramType="string" The location where the item will be moved - igPivotGrid, igPivotDataSelector, filters, rows, columns or measures. + * paramType="string" The type of the item - Hierarchy, Measure or MeasureList. + * paramType="string" The unique name of the item. + * returnType="bool" The function must return true if the item should be accepted. */ igPivotDataSelector(optionLiteral: 'option', optionName: "customMoveValidation"): Function; /** * A function that will be called to determine if an item can be moved in or dropped on an area of the data selector. - * paramType="string" The location where the item will be moved - igPivotGrid, igPivotDataSelector, filters, rows, columns or measures. - * paramType="string" The type of the item - Hierarchy, Measure or MeasureList. - * paramType="string" The unique name of the item. - * returnType="bool" The function must return true if the item should be accepted. + * + * paramType="string" The location where the item will be moved - igPivotGrid, igPivotDataSelector, filters, rows, columns or measures. + * paramType="string" The type of the item - Hierarchy, Measure or MeasureList. + * paramType="string" The unique name of the item. + * returnType="bool" The function must return true if the item should be accepted. * * @optionValue New value to be set. */ igPivotDataSelector(optionLiteral: 'option', optionName: "customMoveValidation", optionValue: Function): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igPivotDataSelector(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igPivotDataSelector(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igPivotDataSelector(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igPivotDataSelector(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igPivotDataSelector(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igPivotDataSelector(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Fired after the data selector is rendered. Changing the data source instance will re-render the data selector. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the data selector. */ igPivotDataSelector(optionLiteral: 'option', optionName: "dataSelectorRendered"): DataSelectorRenderedEvent; /** * Fired after the data selector is rendered. Changing the data source instance will re-render the data selector. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the data selector. * * @optionValue New value to be set. */ @@ -64313,21 +73558,11 @@ interface JQuery { /** * Fired after the data source has initialized. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the data selector. - * Use ui.dataSource to get a reference to the data source. - * Use ui.error to see if an error has occured during initialization. - * Use ui.metadataTreeRoot to get a reference to the root of the data source metatadata root item. */ igPivotDataSelector(optionLiteral: 'option', optionName: "dataSourceInitialized"): DataSourceInitializedEvent; /** * Fired after the data source has initialized. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the data selector. - * Use ui.dataSource to get a reference to the data source. - * Use ui.error to see if an error has occured during initialization. - * Use ui.metadataTreeRoot to get a reference to the root of the data source metatadata root item. * * @optionValue New value to be set. */ @@ -64335,21 +73570,11 @@ interface JQuery { /** * Fired after the data source has updated. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the data selector. - * Use ui.dataSource to get a reference to the data source. - * Use ui.error to see if an error has occured during update. - * Use ui.result to get the result of the update operation. */ igPivotDataSelector(optionLiteral: 'option', optionName: "dataSourceUpdated"): DataSourceUpdatedEvent; /** * Fired after the data source has updated. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the data selector. - * Use ui.dataSource to get a reference to the data source. - * Use ui.error to see if an error has occured during update. - * Use ui.result to get the result of the update operation. * * @optionValue New value to be set. */ @@ -64357,17 +73582,11 @@ interface JQuery { /** * Fired when the defer update checkbox changes. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the data selector. - * Use ui.deferUpdate to get the defer update value. */ igPivotDataSelector(optionLiteral: 'option', optionName: "deferUpdateChanged"): DeferUpdateChangedEvent; /** * Fired when the defer update checkbox changes. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the data selector. - * Use ui.deferUpdate to get the defer update value. * * @optionValue New value to be set. */ @@ -64375,21 +73594,11 @@ interface JQuery { /** * Fired on drag start. Return false to cancel the drag. - * Use ui.metadatato get a reference to the data. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.originalPosition to get a reference to the original position of the draggable element. - * Use ui.position to get a reference to the current position of the draggable element. */ igPivotDataSelector(optionLiteral: 'option', optionName: "dragStart"): DragStartEvent; /** * Fired on drag start. Return false to cancel the drag. - * Use ui.metadatato get a reference to the data. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.originalPosition to get a reference to the original position of the draggable element. - * Use ui.position to get a reference to the current position of the draggable element. * * @optionValue New value to be set. */ @@ -64397,21 +73606,11 @@ interface JQuery { /** * Fired on drag. Return false to cancel the dragging. - * Use ui.metadatato get a reference to the data. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.originalPosition to get a reference to the original position of the draggable element. - * Use ui.position to get a reference to the current position of the draggable element. */ igPivotDataSelector(optionLiteral: 'option', optionName: "drag"): DragEvent; /** * Fired on drag. Return false to cancel the dragging. - * Use ui.metadatato get a reference to the data. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.originalPosition to get a reference to the original position of the draggable element. - * Use ui.position to get a reference to the current position of the draggable element. * * @optionValue New value to be set. */ @@ -64419,19 +73618,11 @@ interface JQuery { /** * Fired on drag stop. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.originalPosition to get a reference to the original position of the draggable element. - * Use ui.position to get a reference to the current position of the draggable element. */ igPivotDataSelector(optionLiteral: 'option', optionName: "dragStop"): DragStopEvent; /** * Fired on drag stop. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.originalPosition to get a reference to the original position of the draggable element. - * Use ui.position to get a reference to the current position of the draggable element. * * @optionValue New value to be set. */ @@ -64439,25 +73630,11 @@ interface JQuery { /** * Fired before a metadata item drop. Return false to cancel the drop. - * Use ui.targetElement for a reference to the drop target. - * Use ui.draggedElement for a reference to the dragged element. - * Use ui.metadatato get a reference to the data. - * Use ui.metadataIndex to get the index at which the metadata will be inserted. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.position to get a reference to the current position of the draggable element. */ igPivotDataSelector(optionLiteral: 'option', optionName: "metadataDropping"): MetadataDroppingEvent; /** * Fired before a metadata item drop. Return false to cancel the drop. - * Use ui.targetElement for a reference to the drop target. - * Use ui.draggedElement for a reference to the dragged element. - * Use ui.metadatato get a reference to the data. - * Use ui.metadataIndex to get the index at which the metadata will be inserted. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.position to get a reference to the current position of the draggable element. * * @optionValue New value to be set. */ @@ -64465,25 +73642,11 @@ interface JQuery { /** * Fired after a metadata item drop. - * Use ui.targetElement for a reference to the drop target. - * Use ui.draggedElement for a reference to the dragged element. - * Use ui.metadatato get a reference to the data. - * Use ui.metadataIndex to get the index at which the metadata is inserted. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.position to get a reference to the current position of the draggable element. */ igPivotDataSelector(optionLiteral: 'option', optionName: "metadataDropped"): MetadataDroppedEvent; /** * Fired after a metadata item drop. - * Use ui.targetElement for a reference to the drop target. - * Use ui.draggedElement for a reference to the dragged element. - * Use ui.metadatato get a reference to the data. - * Use ui.metadataIndex to get the index at which the metadata is inserted. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.position to get a reference to the current position of the draggable element. * * @optionValue New value to be set. */ @@ -64491,15 +73654,11 @@ interface JQuery { /** * Fired before a metadata item is removed when the user clicks the close icon. Return false to cancel the removing. - * Use ui.targetElement for a reference to the dragged element. - * Use ui.metadatato get a reference to the data. */ igPivotDataSelector(optionLiteral: 'option', optionName: "metadataRemoving"): MetadataRemovingEvent; /** * Fired before a metadata item is removed when the user clicks the close icon. Return false to cancel the removing. - * Use ui.targetElement for a reference to the dragged element. - * Use ui.metadatato get a reference to the data. * * @optionValue New value to be set. */ @@ -64507,13 +73666,11 @@ interface JQuery { /** * Fired after a metadata item is removed when the user clicks the close icon. - * Use ui.metadatato get a reference to the data. */ igPivotDataSelector(optionLiteral: 'option', optionName: "metadataRemoved"): MetadataRemovedEvent; /** * Fired after a metadata item is removed when the user clicks the close icon. - * Use ui.metadatato get a reference to the data. * * @optionValue New value to be set. */ @@ -64521,13 +73678,11 @@ interface JQuery { /** * Fired before the filter members drop down opens. Return false to cancel the opening. - * Use ui.hierarchy for a reference to the hierarchy. */ igPivotDataSelector(optionLiteral: 'option', optionName: "filterDropDownOpening"): FilterDropDownOpeningEvent; /** * Fired before the filter members drop down opens. Return false to cancel the opening. - * Use ui.hierarchy for a reference to the hierarchy. * * @optionValue New value to be set. */ @@ -64535,15 +73690,11 @@ interface JQuery { /** * Fired after the filter members drop down opens. - * Use ui.hierarchy for a reference to the hierarchy. - * Use ui.dropDownElement for a reference to the drop down. */ igPivotDataSelector(optionLiteral: 'option', optionName: "filterDropDownOpened"): FilterDropDownOpenedEvent; /** * Fired after the filter members drop down opens. - * Use ui.hierarchy for a reference to the hierarchy. - * Use ui.dropDownElement for a reference to the drop down. * * @optionValue New value to be set. */ @@ -64551,17 +73702,11 @@ interface JQuery { /** * Fired after the filter members are loaded. - * Use ui.parent to get the parent node or the igTree instance in the initial load. - * Use ui.rootFilterMembers for a collection with the root filter members . - * Use ui.filterMembers for a collection with the newly loaded filter members. */ igPivotDataSelector(optionLiteral: 'option', optionName: "filterMembersLoaded"): FilterMembersLoadedEvent; /** * Fired after the filter members are loaded. - * Use ui.parent to get the parent node or the igTree instance in the initial load. - * Use ui.rootFilterMembers for a collection with the root filter members . - * Use ui.filterMembers for a collection with the newly loaded filter members. * * @optionValue New value to be set. */ @@ -64569,17 +73714,11 @@ interface JQuery { /** * Fired after the OK button in the filter members drop down is clicked. Return false to cancel the applying of the filters. - * Use ui.hierarchy for a reference to the hierarchy. - * Use ui.filterMembers for a collection with the selected filter members. If all filter members are selected the collection will be empty. - * Use ui.dropDownElement for a reference to the drop down. */ igPivotDataSelector(optionLiteral: 'option', optionName: "filterDropDownOk"): FilterDropDownOkEvent; /** * Fired after the OK button in the filter members drop down is clicked. Return false to cancel the applying of the filters. - * Use ui.hierarchy for a reference to the hierarchy. - * Use ui.filterMembers for a collection with the selected filter members. If all filter members are selected the collection will be empty. - * Use ui.dropDownElement for a reference to the drop down. * * @optionValue New value to be set. */ @@ -64587,15 +73726,11 @@ interface JQuery { /** * Fired before the filter members drop down closes. Return false to cancel the closing. - * Use ui.hierarchy for a reference to the hierarchy. - * Use ui.dropDownElement for a reference to the drop down. */ igPivotDataSelector(optionLiteral: 'option', optionName: "filterDropDownClosing"): FilterDropDownClosingEvent; /** * Fired before the filter members drop down closes. Return false to cancel the closing. - * Use ui.hierarchy for a reference to the hierarchy. - * Use ui.dropDownElement for a reference to the drop down. * * @optionValue New value to be set. */ @@ -64603,13 +73738,11 @@ interface JQuery { /** * Fired after the filter members drop down closes. - * Use ui.hierarchy for a reference to the hierarchy. */ igPivotDataSelector(optionLiteral: 'option', optionName: "filterDropDownClosed"): FilterDropDownClosedEvent; /** * Fired after the filter members drop down closes. - * Use ui.hierarchy for a reference to the hierarchy. * * @optionValue New value to be set. */ @@ -65018,6 +74151,7 @@ interface IgPivotGridGridOptions { /** * Headers will be fixed if this option is set to true, and only the grid data will be scrollable. + * */ fixedHeaders?: boolean; @@ -65028,11 +74162,13 @@ interface IgPivotGridGridOptions { /** * A list of grid features definitions. The supported features are Resizing and Tooltips. Each feature goes with its separate options that are documented for the feature accordingly. + * */ features?: IgPivotGridGridOptionsFeatures; /** * Initial tabIndex attribute that will be set on the container element. + * */ tabIndex?: number; @@ -65060,6 +74196,7 @@ interface IgPivotGridDragAndDropSettings { /** * Specifies the containment for the drag helper. The area inside of which thehelper is contained would be scrollable while dragging. + * */ containment?: boolean|string|Array; @@ -65080,19 +74217,19 @@ interface PivotGridHeadersRenderedEvent { interface PivotGridHeadersRenderedEventUIParam { /** - * Used to get a reference to the pivot grid. + * Gets a reference to the pivot grid. */ owner?: any; /** - * Used to get a reference to the igGrid widget, which holds the headers. + * Gets a reference to the igGrid widget, which holds the headers. */ grid?: any; /** - * Used to get a reference to the headers table DOM element. + * Gets a reference to the headers table DOM element. */ - table?: any; + table?: Element; } interface PivotGridRenderedEvent { @@ -65101,12 +74238,12 @@ interface PivotGridRenderedEvent { interface PivotGridRenderedEventUIParam { /** - * Used to get a reference to the pivot grid. + * Gets a reference to the pivot grid. */ owner?: any; /** - * Used to get reference to the igGrid widget, which represents the data. + * Gets reference to the igGrid widget, which represents the data. */ grid?: any; } @@ -65117,29 +74254,29 @@ interface TupleMemberExpandingEvent { interface TupleMemberExpandingEventUIParam { /** - * Used to get a reference to the pivot grid. + * Gets a reference to the pivot grid. */ owner?: any; /** - * Used to get a reference to the data source. + * Gets a reference to the data source. */ dataSource?: any; /** - * Used to get the name of axis, which holds the member and the tuple. + * Gets the name of axis, which holds the member and the tuple. */ - axisName?: any; + axisName?: string; /** - * Used to get the index of the tuple in the axis. + * Gets the index of the tuple in the axis. */ - tupleIndex?: any; + tupleIndex?: number; /** - * Used to get the index of the member in the tuple. + * Gets the index of the member in the tuple. */ - memberIndex?: any; + memberIndex?: number; } interface TupleMemberExpandedEvent { @@ -65148,29 +74285,29 @@ interface TupleMemberExpandedEvent { interface TupleMemberExpandedEventUIParam { /** - * Used to get a reference to the pivot grid. + * Gets a reference to the pivot grid. */ owner?: any; /** - * Used to get a reference to the data source. + * Gets a reference to the data source. */ dataSource?: any; /** - * Used to get the name of axis, which holds the member and the tuple. + * Gets the name of axis, which holds the member and the tuple. */ - axisName?: any; + axisName?: string; /** - * Used to get the index of the tuple in the axis. + * Gets the index of the tuple in the axis. */ - tupleIndex?: any; + tupleIndex?: number; /** - * Used to get the index of the member in the tuple. + * Gets the index of the member in the tuple. */ - memberIndex?: any; + memberIndex?: number; } interface TupleMemberCollapsingEvent { @@ -65179,29 +74316,29 @@ interface TupleMemberCollapsingEvent { interface TupleMemberCollapsingEventUIParam { /** - * Used to get a reference to the pivot grid. + * Gets a reference to the pivot grid. */ owner?: any; /** - * Used to get a reference to the data source. + * Gets a reference to the data source. */ dataSource?: any; /** - * Used to get the name of axis, which holds the member and the tuple. + * Gets the name of axis, which holds the member and the tuple. */ - axisName?: any; + axisName?: string; /** - * Used to get the index of the tuple in the axis. + * Gets the index of the tuple in the axis. */ - tupleIndex?: any; + tupleIndex?: number; /** - * Used to get the index of the member in the tuple. + * Gets the index of the member in the tuple. */ - memberIndex?: any; + memberIndex?: number; } interface TupleMemberCollapsedEvent { @@ -65210,29 +74347,29 @@ interface TupleMemberCollapsedEvent { interface TupleMemberCollapsedEventUIParam { /** - * Used to get a reference to the pivot grid. + * Gets a reference to the pivot grid. */ owner?: any; /** - * Used to get a reference to the data source. + * Gets a reference to the data source. */ dataSource?: any; /** - * Used to get the name of axis, which holds the member and the tuple. + * Gets the name of axis, which holds the member and the tuple. */ - axisName?: any; + axisName?: string; /** - * Used to get the index of the tuple in the axis. + * Gets the index of the tuple in the axis. */ - tupleIndex?: any; + tupleIndex?: number; /** - * Used to get the index of the member in the tuple. + * Gets the index of the member in the tuple. */ - memberIndex?: any; + memberIndex?: number; } interface SortingEvent { @@ -65241,14 +74378,14 @@ interface SortingEvent { interface SortingEventUIParam { /** - * Used to get a reference to the pivot grid. + * Gets a reference to the pivot grid. */ owner?: any; /** - * Used to get an array of the tuple indices and sort directions that will be used. + * Gets an array of the tuple indices and sort directions that will be used. */ - sortDirections?: any; + sortDirections?: any[]; } interface SortedEvent { @@ -65257,19 +74394,19 @@ interface SortedEvent { interface SortedEventUIParam { /** - * Used to get a reference to the pivot grid. + * Gets a reference to the pivot grid. */ owner?: any; /** - * Used to get an array of the tuple indices and sort directions that were passed to the table view. + * Gets an array of the tuple indices and sort directions that were passed to the table view. */ - sortDirections?: any; + sortDirections?: any[]; /** - * Used to get an array of the tuple indices and sort directions that were actually applied to the table view. + * Gets an array of the tuple indices and sort directions that were actually applied to the table view. */ - appliedSortDirections?: any; + appliedSortDirections?: any[]; } interface HeadersSortingEvent { @@ -65278,14 +74415,14 @@ interface HeadersSortingEvent { interface HeadersSortingEventUIParam { /** - * Used to get a reference to the pivot grid. + * Gets a reference to the pivot grid. */ owner?: any; /** - * Used to get an array of the level names and sort directions that will be used. + * Gets an array of the level names and sort directions that will be used. */ - levelSortDirections?: any; + levelSortDirections?: any[]; } interface HeadersSortedEvent { @@ -65294,27 +74431,34 @@ interface HeadersSortedEvent { interface HeadersSortedEventUIParam { /** - * Used to get a reference to the pivot grid. + * Gets a reference to the pivot grid. */ owner?: any; /** - * Used to get an array of the level names and sort directions that were used. + * Gets an array of the level names and sort directions that were used. */ - levelSortDirections?: any; + levelSortDirections?: any[]; /** - * Used to get an array of the level names and sort directions that were actually applied to the table view. + * Gets an array of the level names and sort directions that were actually applied to the table view. */ - appliedLevelSortDirections?: any; + appliedLevelSortDirections?: any[]; } interface IgPivotGrid { + /** + * + * + * Valid values: + * "null" Will stretch to fit the data, if no other widths are defined. + */ width?: string|number; /** * This is the total height of the grid. * + * * Valid values: * "null" Will stretch vertically to fit data, if no other heights are defined */ @@ -65322,17 +74466,20 @@ interface IgPivotGrid { /** * An instance of $.ig.OlapXmlaDataSource or $.ig.OlapFlatDataSource. + * */ dataSource?: any; /** * An object that will be used to create an instance of $.ig.OlapXmlaDataSource or $.ig.OlapFlatDataSource. * The provided value must contain an object with settings for one of the data source types - xmlaOptions or flatDataOptions. + * */ dataSourceOptions?: IgPivotGridDataSourceOptions; /** * Setting deferUpdate to true will not apply changes to the data source until the updateGrid method is called. + * */ deferUpdate?: boolean; @@ -65340,6 +74487,7 @@ interface IgPivotGrid { * A boolean value indicating whether a parent in the columns is in front of its children. * If set to true, the query set sorts members in a level in their natural order - child members immediately follow their parent members. * If set to false the query set sorts the members in a level using a post-natural order. In other words, child members precede their parents. + * */ isParentInFrontForColumns?: boolean; @@ -65347,16 +74495,19 @@ interface IgPivotGrid { * A boolean value indicating whether a parent in the rows is in front of its children. * If set to true, the query set sorts members in a level in their natural order - child members immediately follow their parent members. * If set to false the query set sorts the members in a level using a post-natural order. In other words, child members precede their parents. + * */ isParentInFrontForRows?: boolean; /** * A boolean value indicating whether the column headers should be arranged for compact header layout i.e. each hierarchy is in a single row. + * */ compactColumnHeaders?: boolean; /** * A boolean value indicating whether the row headers should be arranged for compact header layout i.e. each hierarchy is in a single column. + * */ compactRowHeaders?: boolean; @@ -65365,6 +74516,7 @@ interface IgPivotGrid { * superCompact Each hierarchy in the rows is displayed in a separate column. The child members of a member in the rows are displayed on above or below it (Depending on the isParentInFrontForRows setting). * tree All hierarchies in the rows are displayed in a tree-like structure in a single column (The column's width is dependent on the defaultRowHEaderWidth, which can be set to "null" to enable the built-in auto-sizing functionality). * + * * Valid values: * "standard" * "superCompact" @@ -65374,11 +74526,13 @@ interface IgPivotGrid { /** * The indentation for every level column when the compactColumnHeaders is set to true. + * */ compactColumnHeaderIndentation?: number; /** * The indentation for every level row when the rowHeadersLayout is set to 'superCompact'. + * */ compactRowHeaderIndentation?: number; @@ -65394,31 +74548,37 @@ interface IgPivotGrid { /** * Specifies the width of the row headers. + * */ defaultRowHeaderWidth?: number; /** * Enables sorting of the value cells in columns. + * */ allowSorting?: boolean; /** * Specifies the default sort direction for the rows. + * */ firstSortDirection?: any; /** * Enables sorting of the header cells in rows. + * */ allowHeaderRowsSorting?: boolean; /** * Enables sorting of the header cells in columns. + * */ allowHeaderColumnsSorting?: boolean; /** * An array of level sort direction items, which predefine the sorted header cells. + * */ levelSortDirections?: IgPivotGridLevelSortDirection[]; @@ -65433,16 +74593,19 @@ interface IgPivotGrid { /** * Specifies the default sort direction for the levels if no sort direction is specified in an item from the levelSortDirections option. + * */ firstLevelSortDirection?: any; /** * Options specific to the igGrid that will render the pivot grid view. + * */ gridOptions?: IgPivotGridGridOptions; /** * Settings for the drag and drop functionality of the igPivotGrid. + * */ dragAndDropSettings?: IgPivotGridDragAndDropSettings; @@ -65453,46 +74616,55 @@ interface IgPivotGrid { /** * Disable the drag and drop for the rows drop area and the ability to use filtering and remove items from it. + * */ disableRowsDropArea?: boolean; /** * Disable the drag and drop for the columns drop area and the ability to use filtering and remove items from it. + * */ disableColumnsDropArea?: boolean; /** * Disable the drag and drop for the measures drop area and the ability to use filtering and remove items from it. + * */ disableMeasuresDropArea?: boolean; /** * Disable the drag and drop for the filters drop area and the ability to use filtering and remove items from it. + * */ disableFiltersDropArea?: boolean; /** * Hide the rows drop area. + * */ hideRowsDropArea?: boolean; /** * Hide the columns drop area. + * */ hideColumnsDropArea?: boolean; /** * Hide the measures drop area. + * */ hideMeasuresDropArea?: boolean; /** * Hide the filters drop area. + * */ hideFiltersDropArea?: boolean; /** * A function that will be called to determine if an item can be moved in or dropped on an area of the pivot grid. + * * paramType="string" The location where the item will be moved - igPivotGrid, igPivotDataSelector, filters, rows, columns or measures. * paramType="string" The type of the item - Hierarchy, Measure or MeasureList. * paramType="string" The unique name of the item. @@ -65500,226 +74672,146 @@ interface IgPivotGrid { */ customMoveValidation?: Function; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Fired after the data source has initialized. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.dataSource to get a reference to the data source. - * Use ui.error to see if an error has occured during initialization. - * Use ui.metadataTreeRoot to get a reference to the root of the data source metatadata root item. */ dataSourceInitialized?: DataSourceInitializedEvent; /** * Fired after the data source has updated. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.dataSource to get a reference to the data source. - * Use ui.error to see if an error has occured during update. - * Use ui.result to get the result of the update operation. */ dataSourceUpdated?: DataSourceUpdatedEvent; /** * Event fired after the headers have been rendered. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.grid to get a reference to the igGrid widget, which holds the headers. - * Use ui.table to get a reference to the headers table DOM element. */ pivotGridHeadersRendered?: PivotGridHeadersRenderedEvent; /** * Event fired after the whole grid widget has been rendered (including headers, footers, etc.). - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.grid to get reference to the igGrid widget, which represents the data. */ pivotGridRendered?: PivotGridRenderedEvent; /** - * Fired before the expand of the tuple member. - * Function takes arguments evt and ui. Return false to cancel the expanding. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.dataSource to get a reference to the data source. - * Use ui.axisName to get the name of axis, which holds the member and the tuple. - * Use ui.tupleIndex to get the index of the tuple in the axis. - * Use ui.memberIndex to get the index of the member in the tuple. + * Fired before the expand of the tuple member. Return false to cancel the expanding. */ tupleMemberExpanding?: TupleMemberExpandingEvent; /** * Fired after the expand of the tuple member. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.dataSource to get a reference to the data source. - * Use ui.axisName to get the name of axis, which holds the member and the tuple. - * Use ui.tupleIndex to get the index of the tuple in the axis. - * Use ui.memberIndex to get the index of the member in the tuple. */ tupleMemberExpanded?: TupleMemberExpandedEvent; /** - * Fired before the collapse of the tuple member. - * Function takes arguments evt and ui. Return false to cancel the collapsing. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.dataSource to get a reference to the data source. - * Use ui.axisName to get the name of axis, which holds the member and the tuple. - * Use ui.tupleIndex to get the index of the tuple in the axis. - * Use ui.memberIndex to get the index of the member in the tuple. + * Fired before the collapse of the tuple member. Return false to cancel the collapsing. */ tupleMemberCollapsing?: TupleMemberCollapsingEvent; /** * Fired after the collapse of the tuple member. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.dataSource to get a reference to the data source. - * Use ui.axisName to get the name of axis, which holds the member and the tuple. - * Use ui.tupleIndex to get the index of the tuple in the axis. - * Use ui.memberIndex to get the index of the member in the tuple. */ tupleMemberCollapsed?: TupleMemberCollapsedEvent; /** - * Fired before the sorting of the columns. - * Function takes arguments evt and ui. Return false to cancel the sorting. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.sortDirections to get an array of the tuple indices and sort directions that will be used. + * Fired before the sorting of the columns. Return false to cancel the sorting. */ sorting?: SortingEvent; /** * Fired after the sorting of the columns. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.sortDirections to get an array of the tuple indices and sort directions that were passed to the table view. - * Use ui.appliedSortDirections to get an array of the tuple indices and sort directions that were actually applied to the table view. */ sorted?: SortedEvent; /** - * Fired before the sorting of the headers. - * Function takes arguments evt and ui. Return false to cancel the sorting. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.levelSortDirections to get an array of the level names and sort directions that will be used. + * Fired before the sorting of the headers. Return false to cancel the sorting. */ headersSorting?: HeadersSortingEvent; /** * Fired after the sorting of the headers. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.levelSortDirections to get an array of the level names and sort directions that were used. - * Use ui.appliedLevelSortDirections to get an array of the level names and sort directions that were actually applied to the table view. */ headersSorted?: HeadersSortedEvent; /** * Fired on drag start. Return false to cancel the dragging. - * Use ui.metadatato get a reference to the data. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.originalPosition to get a reference to the original position of the draggable element. - * Use ui.position to get a reference to the current position of the draggable element. */ dragStart?: DragStartEvent; /** * Fired on drag. Return false to cancel the drag. - * Use ui.metadatato get a reference to the data. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.originalPosition to get a reference to the original position of the draggable element. - * Use ui.position to get a reference to the current position of the draggable element. */ drag?: DragEvent; /** * Fired on drag stop. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.originalPosition to get a reference to the original position of the draggable element. - * Use ui.position to get a reference to the current position of the draggable element. */ dragStop?: DragStopEvent; /** * Fired before a metadata item drop. Return false to cancel the drop. - * Use ui.targetElement for a reference to the drop target. - * Use ui.draggedElement for a reference to the metadata item element. - * Use ui.metadatato get a reference to the data. - * Use ui.metadataIndex to get the index at which the metadata will be inserted. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.position to get a reference to the current position of the draggable element. */ metadataDropping?: MetadataDroppingEvent; /** * Fired after a metadata item drop. - * Use ui.targetElement for a reference to the drop target. - * Use ui.draggedElement for a reference to the dragged element. - * Use ui.metadatato get a reference to the data. - * Use ui.metadataIndex to get the index at which the metadata is inserted. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.position to get a reference to the current position of the draggable element. */ metadataDropped?: MetadataDroppedEvent; /** * Fired before a metadata item is removed when the user clicks the close icon. Return false to cancel the removing. - * Use ui.targetElement for a reference to the dragged element. - * Use ui.metadatato get a reference to the data. */ metadataRemoving?: MetadataRemovingEvent; /** * Fired after a metadata item is removed when the user clicks the close icon. - * Use ui.metadatato get a reference to the data. */ metadataRemoved?: MetadataRemovedEvent; /** * Fired before the filter members drop down opens. Return false to cancel the opening. - * Use ui.hierarchy for a reference to the hierarchy. */ filterDropDownOpening?: FilterDropDownOpeningEvent; /** * Fired after the filter members drop down opens. - * Use ui.hierarchy for a reference to the hierarchy. - * Use ui.dropDownElement for a reference to the drop down. */ filterDropDownOpened?: FilterDropDownOpenedEvent; /** * Fired after the filter members are loaded. - * Use ui.parent to get the parent node or the igTree instance in the initial load. - * Use ui.rootFilterMembers for a collection with the root filter members . - * Use ui.filterMembers for a collection with the newly loaded filter members. */ filterMembersLoaded?: FilterMembersLoadedEvent; /** * Fired after the OK button in the filter members drop down is clicked. Return false to cancel the applying of the filters. - * Use ui.hierarchy for a reference to the hierarchy. - * Use ui.filterMembers for a collection with the selected filter members. If all filter members are selected the collection will be empty. - * Use ui.dropDownElement for a reference to the drop down. */ filterDropDownOk?: FilterDropDownOkEvent; /** * Fired before the filter members drop down closes. Return false to cancel the closing. - * Use ui.hierarchy for a reference to the hierarchy. - * Use ui.dropDownElement for a reference to the drop down. */ filterDropDownClosing?: FilterDropDownClosingEvent; /** * Fired after the filter members drop down closes. - * Use ui.hierarchy for a reference to the hierarchy. */ filterDropDownClosed?: FilterDropDownClosedEvent; @@ -65729,7 +74821,16 @@ interface IgPivotGrid { [optionName: string]: any; } interface IgPivotGridMethods { + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.igpivotgrid#options:language) + * Note that this method is for rare scenarios, see [language](ui.igpivotgrid#options:language) or [locale](ui.igpivotgrid#options:locale) option setter + */ changeLocale(): void; + + /** + * Changes the the regional settings of widget element to the language specified in [options.regional](ui.igpivotgrid#options:regional) + * Note that this method is for rare scenarios, use [regional](ui.igpivotgrid#options:regional) option setter + */ changeRegional(): void; /** @@ -65764,6 +74865,7 @@ interface IgPivotGridMethods { /** * Returns an array with the applied sort directions on the igPivotGrid's columns. The returned array contains objects with the following properties: + * * memberNames: The names of the members in the tuple. * tupleIndex: The index of the tuple on the column axis in the original unsorted result. * sortDirection: The direction of the sort - ascending or descending. @@ -65772,6 +74874,7 @@ interface IgPivotGridMethods { /** * Returns an array with the applied level sort direction items, which were used for the sorting of the header cells. The returned array contains objects with the following properties: + * * levelUniqueName: Specifies the unique name of the level, which was sorted. * sortDirection: The direction of the header sort - ascending or descending. */ @@ -65784,6 +74887,16 @@ interface IgPivotGridMethods { * 3. Unbind all events that were bound. */ destroy(): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igPivotGrid"): IgPivotGridMethods; @@ -65799,13 +74912,26 @@ interface JQuery { igPivotGrid(methodName: "appliedColumnSortDirections"): any[]; igPivotGrid(methodName: "appliedLevelSortDirections"): any[]; igPivotGrid(methodName: "destroy"): void; + igPivotGrid(methodName: "changeGlobalLanguage"): void; + igPivotGrid(methodName: "changeGlobalRegional"): void; + + /** + * * + */ igPivotGrid(optionLiteral: 'option', optionName: "width"): string|number; + /** + * * + * + * @optionValue New value to be set. + */ + igPivotGrid(optionLiteral: 'option', optionName: "width", optionValue: string|number): void; /** * This is the total height of the grid. + * */ igPivotGrid(optionLiteral: 'option', optionName: "height"): string|number; @@ -65813,6 +74939,7 @@ interface JQuery { /** * This is the total height of the grid. * + * * @optionValue New value to be set. */ @@ -65820,12 +74947,14 @@ interface JQuery { /** * An instance of $.ig.OlapXmlaDataSource or $.ig.OlapFlatDataSource. + * */ igPivotGrid(optionLiteral: 'option', optionName: "dataSource"): any; /** * An instance of $.ig.OlapXmlaDataSource or $.ig.OlapFlatDataSource. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "dataSource", optionValue: any): void; @@ -65833,6 +74962,7 @@ interface JQuery { /** * An object that will be used to create an instance of $.ig.OlapXmlaDataSource or $.ig.OlapFlatDataSource. * The provided value must contain an object with settings for one of the data source types - xmlaOptions or flatDataOptions. + * */ igPivotGrid(optionLiteral: 'option', optionName: "dataSourceOptions"): IgPivotGridDataSourceOptions; @@ -65840,18 +74970,21 @@ interface JQuery { * An object that will be used to create an instance of $.ig.OlapXmlaDataSource or $.ig.OlapFlatDataSource. * The provided value must contain an object with settings for one of the data source types - xmlaOptions or flatDataOptions. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "dataSourceOptions", optionValue: IgPivotGridDataSourceOptions): void; /** * Setting deferUpdate to true will not apply changes to the data source until the updateGrid method is called. + * */ igPivotGrid(optionLiteral: 'option', optionName: "deferUpdate"): boolean; /** * Setting deferUpdate to true will not apply changes to the data source until the updateGrid method is called. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "deferUpdate", optionValue: boolean): void; @@ -65860,6 +74993,7 @@ interface JQuery { * A boolean value indicating whether a parent in the columns is in front of its children. * If set to true, the query set sorts members in a level in their natural order - child members immediately follow their parent members. * If set to false the query set sorts the members in a level using a post-natural order. In other words, child members precede their parents. + * */ igPivotGrid(optionLiteral: 'option', optionName: "isParentInFrontForColumns"): boolean; @@ -65868,6 +75002,7 @@ interface JQuery { * If set to true, the query set sorts members in a level in their natural order - child members immediately follow their parent members. * If set to false the query set sorts the members in a level using a post-natural order. In other words, child members precede their parents. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "isParentInFrontForColumns", optionValue: boolean): void; @@ -65876,6 +75011,7 @@ interface JQuery { * A boolean value indicating whether a parent in the rows is in front of its children. * If set to true, the query set sorts members in a level in their natural order - child members immediately follow their parent members. * If set to false the query set sorts the members in a level using a post-natural order. In other words, child members precede their parents. + * */ igPivotGrid(optionLiteral: 'option', optionName: "isParentInFrontForRows"): boolean; @@ -65884,30 +75020,35 @@ interface JQuery { * If set to true, the query set sorts members in a level in their natural order - child members immediately follow their parent members. * If set to false the query set sorts the members in a level using a post-natural order. In other words, child members precede their parents. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "isParentInFrontForRows", optionValue: boolean): void; /** * A boolean value indicating whether the column headers should be arranged for compact header layout i.e. each hierarchy is in a single row. + * */ igPivotGrid(optionLiteral: 'option', optionName: "compactColumnHeaders"): boolean; /** * A boolean value indicating whether the column headers should be arranged for compact header layout i.e. each hierarchy is in a single row. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "compactColumnHeaders", optionValue: boolean): void; /** * A boolean value indicating whether the row headers should be arranged for compact header layout i.e. each hierarchy is in a single column. + * */ igPivotGrid(optionLiteral: 'option', optionName: "compactRowHeaders"): boolean; /** * A boolean value indicating whether the row headers should be arranged for compact header layout i.e. each hierarchy is in a single column. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "compactRowHeaders", optionValue: boolean): void; @@ -65916,6 +75057,7 @@ interface JQuery { * A value indicating whether the layout that row headers should be arranged.standard Each hierarchy in the rows is displayed in a separate column. The child members of a member in the rows are displayed on its right. * superCompact Each hierarchy in the rows is displayed in a separate column. The child members of a member in the rows are displayed on above or below it (Depending on the isParentInFrontForRows setting). * tree All hierarchies in the rows are displayed in a tree-like structure in a single column (The column's width is dependent on the defaultRowHEaderWidth, which can be set to "null" to enable the built-in auto-sizing functionality). + * */ igPivotGrid(optionLiteral: 'option', optionName: "rowHeadersLayout"): any; @@ -65924,30 +75066,35 @@ interface JQuery { * superCompact Each hierarchy in the rows is displayed in a separate column. The child members of a member in the rows are displayed on above or below it (Depending on the isParentInFrontForRows setting). * tree All hierarchies in the rows are displayed in a tree-like structure in a single column (The column's width is dependent on the defaultRowHEaderWidth, which can be set to "null" to enable the built-in auto-sizing functionality). * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "rowHeadersLayout", optionValue: any): void; /** * The indentation for every level column when the compactColumnHeaders is set to true. + * */ igPivotGrid(optionLiteral: 'option', optionName: "compactColumnHeaderIndentation"): number; /** * The indentation for every level column when the compactColumnHeaders is set to true. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "compactColumnHeaderIndentation", optionValue: number): void; /** * The indentation for every level row when the rowHeadersLayout is set to 'superCompact'. + * */ igPivotGrid(optionLiteral: 'option', optionName: "compactRowHeaderIndentation"): number; /** * The indentation for every level row when the rowHeadersLayout is set to 'superCompact'. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "compactRowHeaderIndentation", optionValue: number): void; @@ -65978,72 +75125,84 @@ interface JQuery { /** * Gets the width of the row headers. + * */ igPivotGrid(optionLiteral: 'option', optionName: "defaultRowHeaderWidth"): number; /** * Sets the width of the row headers. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "defaultRowHeaderWidth", optionValue: number): void; /** * Enables sorting of the value cells in columns. + * */ igPivotGrid(optionLiteral: 'option', optionName: "allowSorting"): boolean; /** * Enables sorting of the value cells in columns. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "allowSorting", optionValue: boolean): void; /** * Gets the default sort direction for the rows. + * */ igPivotGrid(optionLiteral: 'option', optionName: "firstSortDirection"): any; /** * Sets the default sort direction for the rows. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "firstSortDirection", optionValue: any): void; /** * Enables sorting of the header cells in rows. + * */ igPivotGrid(optionLiteral: 'option', optionName: "allowHeaderRowsSorting"): boolean; /** * Enables sorting of the header cells in rows. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "allowHeaderRowsSorting", optionValue: boolean): void; /** * Enables sorting of the header cells in columns. + * */ igPivotGrid(optionLiteral: 'option', optionName: "allowHeaderColumnsSorting"): boolean; /** * Enables sorting of the header cells in columns. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "allowHeaderColumnsSorting", optionValue: boolean): void; /** * An array of level sort direction items, which predefine the sorted header cells. + * */ igPivotGrid(optionLiteral: 'option', optionName: "levelSortDirections"): IgPivotGridLevelSortDirection[]; /** * An array of level sort direction items, which predefine the sorted header cells. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "levelSortDirections", optionValue: IgPivotGridLevelSortDirection[]): void; @@ -66064,36 +75223,42 @@ interface JQuery { /** * Gets the default sort direction for the levels if no sort direction is specified in an item from the levelSortDirections option. + * */ igPivotGrid(optionLiteral: 'option', optionName: "firstLevelSortDirection"): any; /** * Sets the default sort direction for the levels if no sort direction is specified in an item from the levelSortDirections option. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "firstLevelSortDirection", optionValue: any): void; /** * Options specific to the igGrid that will render the pivot grid view. + * */ igPivotGrid(optionLiteral: 'option', optionName: "gridOptions"): IgPivotGridGridOptions; /** * Options specific to the igGrid that will render the pivot grid view. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "gridOptions", optionValue: IgPivotGridGridOptions): void; /** * Settings for the drag and drop functionality of the igPivotGrid. + * */ igPivotGrid(optionLiteral: 'option', optionName: "dragAndDropSettings"): IgPivotGridDragAndDropSettings; /** * Settings for the drag and drop functionality of the igPivotGrid. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "dragAndDropSettings", optionValue: IgPivotGridDragAndDropSettings): void; @@ -66112,102 +75277,119 @@ interface JQuery { /** * Disable the drag and drop for the rows drop area and the ability to use filtering and remove items from it. + * */ igPivotGrid(optionLiteral: 'option', optionName: "disableRowsDropArea"): boolean; /** * Disable the drag and drop for the rows drop area and the ability to use filtering and remove items from it. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "disableRowsDropArea", optionValue: boolean): void; /** * Disable the drag and drop for the columns drop area and the ability to use filtering and remove items from it. + * */ igPivotGrid(optionLiteral: 'option', optionName: "disableColumnsDropArea"): boolean; /** * Disable the drag and drop for the columns drop area and the ability to use filtering and remove items from it. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "disableColumnsDropArea", optionValue: boolean): void; /** * Disable the drag and drop for the measures drop area and the ability to use filtering and remove items from it. + * */ igPivotGrid(optionLiteral: 'option', optionName: "disableMeasuresDropArea"): boolean; /** * Disable the drag and drop for the measures drop area and the ability to use filtering and remove items from it. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "disableMeasuresDropArea", optionValue: boolean): void; /** * Disable the drag and drop for the filters drop area and the ability to use filtering and remove items from it. + * */ igPivotGrid(optionLiteral: 'option', optionName: "disableFiltersDropArea"): boolean; /** * Disable the drag and drop for the filters drop area and the ability to use filtering and remove items from it. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "disableFiltersDropArea", optionValue: boolean): void; /** * Hide the rows drop area. + * */ igPivotGrid(optionLiteral: 'option', optionName: "hideRowsDropArea"): boolean; /** * Hide the rows drop area. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "hideRowsDropArea", optionValue: boolean): void; /** * Hide the columns drop area. + * */ igPivotGrid(optionLiteral: 'option', optionName: "hideColumnsDropArea"): boolean; /** * Hide the columns drop area. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "hideColumnsDropArea", optionValue: boolean): void; /** * Hide the measures drop area. + * */ igPivotGrid(optionLiteral: 'option', optionName: "hideMeasuresDropArea"): boolean; /** * Hide the measures drop area. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "hideMeasuresDropArea", optionValue: boolean): void; /** * Hide the filters drop area. + * */ igPivotGrid(optionLiteral: 'option', optionName: "hideFiltersDropArea"): boolean; /** * Hide the filters drop area. * + * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "hideFiltersDropArea", optionValue: boolean): void; /** * A function that will be called to determine if an item can be moved in or dropped on an area of the pivot grid. + * * paramType="string" The location where the item will be moved - igPivotGrid, igPivotDataSelector, filters, rows, columns or measures. * paramType="string" The type of the item - Hierarchy, Measure or MeasureList. * paramType="string" The unique name of the item. @@ -66217,6 +75399,7 @@ interface JQuery { /** * A function that will be called to determine if an item can be moved in or dropped on an area of the pivot grid. + * * paramType="string" The location where the item will be moved - igPivotGrid, igPivotDataSelector, filters, rows, columns or measures. * paramType="string" The type of the item - Hierarchy, Measure or MeasureList. * paramType="string" The unique name of the item. @@ -66226,23 +75409,57 @@ interface JQuery { */ igPivotGrid(optionLiteral: 'option', optionName: "customMoveValidation", optionValue: Function): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igPivotGrid(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igPivotGrid(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igPivotGrid(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igPivotGrid(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igPivotGrid(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igPivotGrid(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Fired after the data source has initialized. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.dataSource to get a reference to the data source. - * Use ui.error to see if an error has occured during initialization. - * Use ui.metadataTreeRoot to get a reference to the root of the data source metatadata root item. */ igPivotGrid(optionLiteral: 'option', optionName: "dataSourceInitialized"): DataSourceInitializedEvent; /** * Fired after the data source has initialized. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.dataSource to get a reference to the data source. - * Use ui.error to see if an error has occured during initialization. - * Use ui.metadataTreeRoot to get a reference to the root of the data source metatadata root item. * * @optionValue New value to be set. */ @@ -66250,21 +75467,11 @@ interface JQuery { /** * Fired after the data source has updated. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.dataSource to get a reference to the data source. - * Use ui.error to see if an error has occured during update. - * Use ui.result to get the result of the update operation. */ igPivotGrid(optionLiteral: 'option', optionName: "dataSourceUpdated"): DataSourceUpdatedEvent; /** * Fired after the data source has updated. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.dataSource to get a reference to the data source. - * Use ui.error to see if an error has occured during update. - * Use ui.result to get the result of the update operation. * * @optionValue New value to be set. */ @@ -66272,19 +75479,11 @@ interface JQuery { /** * Event fired after the headers have been rendered. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.grid to get a reference to the igGrid widget, which holds the headers. - * Use ui.table to get a reference to the headers table DOM element. */ igPivotGrid(optionLiteral: 'option', optionName: "pivotGridHeadersRendered"): PivotGridHeadersRenderedEvent; /** * Event fired after the headers have been rendered. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.grid to get a reference to the igGrid widget, which holds the headers. - * Use ui.table to get a reference to the headers table DOM element. * * @optionValue Define event handler function. */ @@ -66292,41 +75491,23 @@ interface JQuery { /** * Event fired after the whole grid widget has been rendered (including headers, footers, etc.). - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.grid to get reference to the igGrid widget, which represents the data. */ igPivotGrid(optionLiteral: 'option', optionName: "pivotGridRendered"): PivotGridRenderedEvent; /** * Event fired after the whole grid widget has been rendered (including headers, footers, etc.). - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.grid to get reference to the igGrid widget, which represents the data. * * @optionValue Define event handler function. */ igPivotGrid(optionLiteral: 'option', optionName: "pivotGridRendered", optionValue: PivotGridRenderedEvent): void; /** - * Fired before the expand of the tuple member. - * Function takes arguments evt and ui. Return false to cancel the expanding. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.dataSource to get a reference to the data source. - * Use ui.axisName to get the name of axis, which holds the member and the tuple. - * Use ui.tupleIndex to get the index of the tuple in the axis. - * Use ui.memberIndex to get the index of the member in the tuple. + * Fired before the expand of the tuple member. Return false to cancel the expanding. */ igPivotGrid(optionLiteral: 'option', optionName: "tupleMemberExpanding"): TupleMemberExpandingEvent; /** - * Fired before the expand of the tuple member. - * Function takes arguments evt and ui. Return false to cancel the expanding. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.dataSource to get a reference to the data source. - * Use ui.axisName to get the name of axis, which holds the member and the tuple. - * Use ui.tupleIndex to get the index of the tuple in the axis. - * Use ui.memberIndex to get the index of the member in the tuple. + * Fired before the expand of the tuple member. Return false to cancel the expanding. * * @optionValue New value to be set. */ @@ -66334,47 +75515,23 @@ interface JQuery { /** * Fired after the expand of the tuple member. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.dataSource to get a reference to the data source. - * Use ui.axisName to get the name of axis, which holds the member and the tuple. - * Use ui.tupleIndex to get the index of the tuple in the axis. - * Use ui.memberIndex to get the index of the member in the tuple. */ igPivotGrid(optionLiteral: 'option', optionName: "tupleMemberExpanded"): TupleMemberExpandedEvent; /** * Fired after the expand of the tuple member. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.dataSource to get a reference to the data source. - * Use ui.axisName to get the name of axis, which holds the member and the tuple. - * Use ui.tupleIndex to get the index of the tuple in the axis. - * Use ui.memberIndex to get the index of the member in the tuple. * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "tupleMemberExpanded", optionValue: TupleMemberExpandedEvent): void; /** - * Fired before the collapse of the tuple member. - * Function takes arguments evt and ui. Return false to cancel the collapsing. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.dataSource to get a reference to the data source. - * Use ui.axisName to get the name of axis, which holds the member and the tuple. - * Use ui.tupleIndex to get the index of the tuple in the axis. - * Use ui.memberIndex to get the index of the member in the tuple. + * Fired before the collapse of the tuple member. Return false to cancel the collapsing. */ igPivotGrid(optionLiteral: 'option', optionName: "tupleMemberCollapsing"): TupleMemberCollapsingEvent; /** - * Fired before the collapse of the tuple member. - * Function takes arguments evt and ui. Return false to cancel the collapsing. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.dataSource to get a reference to the data source. - * Use ui.axisName to get the name of axis, which holds the member and the tuple. - * Use ui.tupleIndex to get the index of the tuple in the axis. - * Use ui.memberIndex to get the index of the member in the tuple. + * Fired before the collapse of the tuple member. Return false to cancel the collapsing. * * @optionValue New value to be set. */ @@ -66382,41 +75539,23 @@ interface JQuery { /** * Fired after the collapse of the tuple member. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.dataSource to get a reference to the data source. - * Use ui.axisName to get the name of axis, which holds the member and the tuple. - * Use ui.tupleIndex to get the index of the tuple in the axis. - * Use ui.memberIndex to get the index of the member in the tuple. */ igPivotGrid(optionLiteral: 'option', optionName: "tupleMemberCollapsed"): TupleMemberCollapsedEvent; /** * Fired after the collapse of the tuple member. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.dataSource to get a reference to the data source. - * Use ui.axisName to get the name of axis, which holds the member and the tuple. - * Use ui.tupleIndex to get the index of the tuple in the axis. - * Use ui.memberIndex to get the index of the member in the tuple. * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "tupleMemberCollapsed", optionValue: TupleMemberCollapsedEvent): void; /** - * Fired before the sorting of the columns. - * Function takes arguments evt and ui. Return false to cancel the sorting. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.sortDirections to get an array of the tuple indices and sort directions that will be used. + * Fired before the sorting of the columns. Return false to cancel the sorting. */ igPivotGrid(optionLiteral: 'option', optionName: "sorting"): SortingEvent; /** - * Fired before the sorting of the columns. - * Function takes arguments evt and ui. Return false to cancel the sorting. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.sortDirections to get an array of the tuple indices and sort directions that will be used. + * Fired before the sorting of the columns. Return false to cancel the sorting. * * @optionValue New value to be set. */ @@ -66424,37 +75563,23 @@ interface JQuery { /** * Fired after the sorting of the columns. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.sortDirections to get an array of the tuple indices and sort directions that were passed to the table view. - * Use ui.appliedSortDirections to get an array of the tuple indices and sort directions that were actually applied to the table view. */ igPivotGrid(optionLiteral: 'option', optionName: "sorted"): SortedEvent; /** * Fired after the sorting of the columns. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.sortDirections to get an array of the tuple indices and sort directions that were passed to the table view. - * Use ui.appliedSortDirections to get an array of the tuple indices and sort directions that were actually applied to the table view. * * @optionValue New value to be set. */ igPivotGrid(optionLiteral: 'option', optionName: "sorted", optionValue: SortedEvent): void; /** - * Fired before the sorting of the headers. - * Function takes arguments evt and ui. Return false to cancel the sorting. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.levelSortDirections to get an array of the level names and sort directions that will be used. + * Fired before the sorting of the headers. Return false to cancel the sorting. */ igPivotGrid(optionLiteral: 'option', optionName: "headersSorting"): HeadersSortingEvent; /** - * Fired before the sorting of the headers. - * Function takes arguments evt and ui. Return false to cancel the sorting. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.levelSortDirections to get an array of the level names and sort directions that will be used. + * Fired before the sorting of the headers. Return false to cancel the sorting. * * @optionValue New value to be set. */ @@ -66462,19 +75587,11 @@ interface JQuery { /** * Fired after the sorting of the headers. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.levelSortDirections to get an array of the level names and sort directions that were used. - * Use ui.appliedLevelSortDirections to get an array of the level names and sort directions that were actually applied to the table view. */ igPivotGrid(optionLiteral: 'option', optionName: "headersSorted"): HeadersSortedEvent; /** * Fired after the sorting of the headers. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the pivot grid. - * Use ui.levelSortDirections to get an array of the level names and sort directions that were used. - * Use ui.appliedLevelSortDirections to get an array of the level names and sort directions that were actually applied to the table view. * * @optionValue New value to be set. */ @@ -66482,21 +75599,11 @@ interface JQuery { /** * Fired on drag start. Return false to cancel the dragging. - * Use ui.metadatato get a reference to the data. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.originalPosition to get a reference to the original position of the draggable element. - * Use ui.position to get a reference to the current position of the draggable element. */ igPivotGrid(optionLiteral: 'option', optionName: "dragStart"): DragStartEvent; /** * Fired on drag start. Return false to cancel the dragging. - * Use ui.metadatato get a reference to the data. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.originalPosition to get a reference to the original position of the draggable element. - * Use ui.position to get a reference to the current position of the draggable element. * * @optionValue New value to be set. */ @@ -66504,21 +75611,11 @@ interface JQuery { /** * Fired on drag. Return false to cancel the drag. - * Use ui.metadatato get a reference to the data. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.originalPosition to get a reference to the original position of the draggable element. - * Use ui.position to get a reference to the current position of the draggable element. */ igPivotGrid(optionLiteral: 'option', optionName: "drag"): DragEvent; /** * Fired on drag. Return false to cancel the drag. - * Use ui.metadatato get a reference to the data. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.originalPosition to get a reference to the original position of the draggable element. - * Use ui.position to get a reference to the current position of the draggable element. * * @optionValue New value to be set. */ @@ -66526,19 +75623,11 @@ interface JQuery { /** * Fired on drag stop. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.originalPosition to get a reference to the original position of the draggable element. - * Use ui.position to get a reference to the current position of the draggable element. */ igPivotGrid(optionLiteral: 'option', optionName: "dragStop"): DragStopEvent; /** * Fired on drag stop. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.originalPosition to get a reference to the original position of the draggable element. - * Use ui.position to get a reference to the current position of the draggable element. * * @optionValue New value to be set. */ @@ -66546,25 +75635,11 @@ interface JQuery { /** * Fired before a metadata item drop. Return false to cancel the drop. - * Use ui.targetElement for a reference to the drop target. - * Use ui.draggedElement for a reference to the metadata item element. - * Use ui.metadatato get a reference to the data. - * Use ui.metadataIndex to get the index at which the metadata will be inserted. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.position to get a reference to the current position of the draggable element. */ igPivotGrid(optionLiteral: 'option', optionName: "metadataDropping"): MetadataDroppingEvent; /** * Fired before a metadata item drop. Return false to cancel the drop. - * Use ui.targetElement for a reference to the drop target. - * Use ui.draggedElement for a reference to the metadata item element. - * Use ui.metadatato get a reference to the data. - * Use ui.metadataIndex to get the index at which the metadata will be inserted. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.position to get a reference to the current position of the draggable element. * * @optionValue New value to be set. */ @@ -66572,25 +75647,11 @@ interface JQuery { /** * Fired after a metadata item drop. - * Use ui.targetElement for a reference to the drop target. - * Use ui.draggedElement for a reference to the dragged element. - * Use ui.metadatato get a reference to the data. - * Use ui.metadataIndex to get the index at which the metadata is inserted. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.position to get a reference to the current position of the draggable element. */ igPivotGrid(optionLiteral: 'option', optionName: "metadataDropped"): MetadataDroppedEvent; /** * Fired after a metadata item drop. - * Use ui.targetElement for a reference to the drop target. - * Use ui.draggedElement for a reference to the dragged element. - * Use ui.metadatato get a reference to the data. - * Use ui.metadataIndex to get the index at which the metadata is inserted. - * Use ui.helper to get a reference to the helper. - * Use ui.offset to get a reference to the offset. - * Use ui.position to get a reference to the current position of the draggable element. * * @optionValue New value to be set. */ @@ -66598,15 +75659,11 @@ interface JQuery { /** * Fired before a metadata item is removed when the user clicks the close icon. Return false to cancel the removing. - * Use ui.targetElement for a reference to the dragged element. - * Use ui.metadatato get a reference to the data. */ igPivotGrid(optionLiteral: 'option', optionName: "metadataRemoving"): MetadataRemovingEvent; /** * Fired before a metadata item is removed when the user clicks the close icon. Return false to cancel the removing. - * Use ui.targetElement for a reference to the dragged element. - * Use ui.metadatato get a reference to the data. * * @optionValue New value to be set. */ @@ -66614,13 +75671,11 @@ interface JQuery { /** * Fired after a metadata item is removed when the user clicks the close icon. - * Use ui.metadatato get a reference to the data. */ igPivotGrid(optionLiteral: 'option', optionName: "metadataRemoved"): MetadataRemovedEvent; /** * Fired after a metadata item is removed when the user clicks the close icon. - * Use ui.metadatato get a reference to the data. * * @optionValue New value to be set. */ @@ -66628,13 +75683,11 @@ interface JQuery { /** * Fired before the filter members drop down opens. Return false to cancel the opening. - * Use ui.hierarchy for a reference to the hierarchy. */ igPivotGrid(optionLiteral: 'option', optionName: "filterDropDownOpening"): FilterDropDownOpeningEvent; /** * Fired before the filter members drop down opens. Return false to cancel the opening. - * Use ui.hierarchy for a reference to the hierarchy. * * @optionValue New value to be set. */ @@ -66642,15 +75695,11 @@ interface JQuery { /** * Fired after the filter members drop down opens. - * Use ui.hierarchy for a reference to the hierarchy. - * Use ui.dropDownElement for a reference to the drop down. */ igPivotGrid(optionLiteral: 'option', optionName: "filterDropDownOpened"): FilterDropDownOpenedEvent; /** * Fired after the filter members drop down opens. - * Use ui.hierarchy for a reference to the hierarchy. - * Use ui.dropDownElement for a reference to the drop down. * * @optionValue New value to be set. */ @@ -66658,17 +75707,11 @@ interface JQuery { /** * Fired after the filter members are loaded. - * Use ui.parent to get the parent node or the igTree instance in the initial load. - * Use ui.rootFilterMembers for a collection with the root filter members . - * Use ui.filterMembers for a collection with the newly loaded filter members. */ igPivotGrid(optionLiteral: 'option', optionName: "filterMembersLoaded"): FilterMembersLoadedEvent; /** * Fired after the filter members are loaded. - * Use ui.parent to get the parent node or the igTree instance in the initial load. - * Use ui.rootFilterMembers for a collection with the root filter members . - * Use ui.filterMembers for a collection with the newly loaded filter members. * * @optionValue New value to be set. */ @@ -66676,17 +75719,11 @@ interface JQuery { /** * Fired after the OK button in the filter members drop down is clicked. Return false to cancel the applying of the filters. - * Use ui.hierarchy for a reference to the hierarchy. - * Use ui.filterMembers for a collection with the selected filter members. If all filter members are selected the collection will be empty. - * Use ui.dropDownElement for a reference to the drop down. */ igPivotGrid(optionLiteral: 'option', optionName: "filterDropDownOk"): FilterDropDownOkEvent; /** * Fired after the OK button in the filter members drop down is clicked. Return false to cancel the applying of the filters. - * Use ui.hierarchy for a reference to the hierarchy. - * Use ui.filterMembers for a collection with the selected filter members. If all filter members are selected the collection will be empty. - * Use ui.dropDownElement for a reference to the drop down. * * @optionValue New value to be set. */ @@ -66694,15 +75731,11 @@ interface JQuery { /** * Fired before the filter members drop down closes. Return false to cancel the closing. - * Use ui.hierarchy for a reference to the hierarchy. - * Use ui.dropDownElement for a reference to the drop down. */ igPivotGrid(optionLiteral: 'option', optionName: "filterDropDownClosing"): FilterDropDownClosingEvent; /** * Fired before the filter members drop down closes. Return false to cancel the closing. - * Use ui.hierarchy for a reference to the hierarchy. - * Use ui.dropDownElement for a reference to the drop down. * * @optionValue New value to be set. */ @@ -66710,13 +75743,11 @@ interface JQuery { /** * Fired after the filter members drop down closes. - * Use ui.hierarchy for a reference to the hierarchy. */ igPivotGrid(optionLiteral: 'option', optionName: "filterDropDownClosed"): FilterDropDownClosedEvent; /** * Fired after the filter members drop down closes. - * Use ui.hierarchy for a reference to the hierarchy. * * @optionValue New value to be set. */ @@ -67092,6 +76123,7 @@ interface IgPivotViewPivotGridOptionsLevelSortDirection { /** * optional="true" Specifies the sort direction. If no direction is specified,the level is going to be sorted in the direction specified by the firstLevelSortDirection option. + * */ sortDirection?: any; @@ -67161,7 +76193,8 @@ interface IgPivotViewPivotGridOptionsDragAndDropSettings { appendTo?: any; /** - * Specifies the containment for the drag helper. The area inside of which the helper is contained would be scrollable while dragging. + * Specifies the containment for the drag helper. The area inside of which thehelper is contained would be scrollable while dragging. + * */ containment?: boolean|string|Array; @@ -67323,7 +76356,8 @@ interface IgPivotViewDataSelectorOptionsDragAndDropSettings { appendTo?: any; /** - * Specifies the containment for the drag helper. The area inside of which the helper is contained would be scrollable while dragging. + * Specifies the containment for the drag helper. The area inside of which thehelper is contained would be scrollable while dragging. + * */ containment?: boolean|string|Array; @@ -67434,40 +76468,81 @@ interface IgPivotViewDataSelectorPanel { } interface IgPivotView { + /** + * + * + * Valid values: + * "string" The widget width can be set in pixels (px) and percentage (%). + * "number" The widget width can be set as a number. + * "null" will stretch to fit the parent, if no other widths are defined. + */ width?: string|number; + + /** + * + * + * Valid values: + * "string" The widget height can be set in pixels (px) and percentage (%). + * "number" The widget height can be set as a number. + * "null" will stretch vertically to fit the parent, if no other heights are defined. + */ height?: string|number; /** * An instance of $.ig.OlapXmlaDataSource or $.ig.OlapFlatDataSource. + * */ dataSource?: any; /** * An object that will be used to create an instance of $.ig.OlapXmlaDataSource or $.ig.OlapFlatDataSource. * The provided value must contain an object with settings for one of the data source types - xmlaOptions or flatDataOptions. + * */ dataSourceOptions?: IgPivotViewDataSourceOptions; /** * Configuration settings that will be assigned to the igPivotGrid widget. + * */ pivotGridOptions?: IgPivotViewPivotGridOptions; /** * Configuration settings that will be assigned to the igPivotDataSelector widget. + * */ dataSelectorOptions?: IgPivotViewDataSelectorOptions; /** * Configuration settings for the panel containing the igPivotGrid. + * */ pivotGridPanel?: IgPivotViewPivotGridPanel; /** * Configuration settings for the panel containing the igPivotDataSelector. + * */ dataSelectorPanel?: IgPivotViewDataSelectorPanel; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Option for igPivotView */ @@ -67496,6 +76571,24 @@ interface IgPivotViewMethods { * 3. Unbind all events that were bound. */ destroy(): void; + + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ + changeLocale($container: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igPivotView"): IgPivotViewMethods; @@ -67506,23 +76599,48 @@ interface JQuery { igPivotView(methodName: "dataSelector"): Object; igPivotView(methodName: "splitter"): Object; igPivotView(methodName: "destroy"): void; + igPivotView(methodName: "changeLocale", $container: Object): void; + igPivotView(methodName: "changeGlobalLanguage"): void; + igPivotView(methodName: "changeGlobalRegional"): void; + + /** + * * + */ igPivotView(optionLiteral: 'option', optionName: "width"): string|number; + /** + * * + * + * @optionValue New value to be set. + */ + igPivotView(optionLiteral: 'option', optionName: "width", optionValue: string|number): void; + /** + * * + */ + igPivotView(optionLiteral: 'option', optionName: "height"): string|number; + /** + * * + * + * @optionValue New value to be set. + */ + igPivotView(optionLiteral: 'option', optionName: "height", optionValue: string|number): void; /** * An instance of $.ig.OlapXmlaDataSource or $.ig.OlapFlatDataSource. + * */ igPivotView(optionLiteral: 'option', optionName: "dataSource"): any; /** * An instance of $.ig.OlapXmlaDataSource or $.ig.OlapFlatDataSource. * + * * @optionValue New value to be set. */ igPivotView(optionLiteral: 'option', optionName: "dataSource", optionValue: any): void; @@ -67530,6 +76648,7 @@ interface JQuery { /** * An object that will be used to create an instance of $.ig.OlapXmlaDataSource or $.ig.OlapFlatDataSource. * The provided value must contain an object with settings for one of the data source types - xmlaOptions or flatDataOptions. + * */ igPivotView(optionLiteral: 'option', optionName: "dataSourceOptions"): IgPivotViewDataSourceOptions; @@ -67537,57 +76656,110 @@ interface JQuery { * An object that will be used to create an instance of $.ig.OlapXmlaDataSource or $.ig.OlapFlatDataSource. * The provided value must contain an object with settings for one of the data source types - xmlaOptions or flatDataOptions. * + * * @optionValue New value to be set. */ igPivotView(optionLiteral: 'option', optionName: "dataSourceOptions", optionValue: IgPivotViewDataSourceOptions): void; /** * Configuration settings that will be assigned to the igPivotGrid widget. + * */ igPivotView(optionLiteral: 'option', optionName: "pivotGridOptions"): IgPivotViewPivotGridOptions; /** * Configuration settings that will be assigned to the igPivotGrid widget. * + * * @optionValue New value to be set. */ igPivotView(optionLiteral: 'option', optionName: "pivotGridOptions", optionValue: IgPivotViewPivotGridOptions): void; /** * Configuration settings that will be assigned to the igPivotDataSelector widget. + * */ igPivotView(optionLiteral: 'option', optionName: "dataSelectorOptions"): IgPivotViewDataSelectorOptions; /** * Configuration settings that will be assigned to the igPivotDataSelector widget. * + * * @optionValue New value to be set. */ igPivotView(optionLiteral: 'option', optionName: "dataSelectorOptions", optionValue: IgPivotViewDataSelectorOptions): void; /** * Configuration settings for the panel containing the igPivotGrid. + * */ igPivotView(optionLiteral: 'option', optionName: "pivotGridPanel"): IgPivotViewPivotGridPanel; /** * Configuration settings for the panel containing the igPivotGrid. * + * * @optionValue New value to be set. */ igPivotView(optionLiteral: 'option', optionName: "pivotGridPanel", optionValue: IgPivotViewPivotGridPanel): void; /** * Configuration settings for the panel containing the igPivotDataSelector. + * */ igPivotView(optionLiteral: 'option', optionName: "dataSelectorPanel"): IgPivotViewDataSelectorPanel; /** * Configuration settings for the panel containing the igPivotDataSelector. * + * * @optionValue New value to be set. */ igPivotView(optionLiteral: 'option', optionName: "dataSelectorPanel", optionValue: IgPivotViewDataSelectorPanel): void; + + /** + * Set/Get the locale setting for the widget. + * + */ + igPivotView(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igPivotView(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igPivotView(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igPivotView(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igPivotView(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igPivotView(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; igPivotView(options: IgPivotView): JQuery; igPivotView(optionLiteral: 'option', optionName: string): any; igPivotView(optionLiteral: 'option', options: IgPivotView): JQuery; @@ -67597,12 +76769,14 @@ interface JQuery { interface IgPopover { /** * Controls whether the popover will close on blur or not + * */ closeOnBlur?: boolean; /** * controls the direction in which the control shows relative to the target element * + * * Valid values: * "auto" lets the control show on the side where enough space is available with the priority specified by the [directionPriority](ui.%%WidgetNameLowered%%#options:directionPriority) property * "left" shows popover on the left side of the target element @@ -67615,12 +76789,14 @@ interface IgPopover { /** * Controls the priority in which the control searches for space to show relative to the target element. * This property has effect only if the [direction](ui.%%WidgetNameLowered%%#options:direction) property value is "auto" or unset. + * */ directionPriority?: any[]; /** * controls the position of the popover according to the target element in case the popover is larger than the target on the side we want to position, if the popover is smaller it should always be in the middle of the visible area * + * * Valid values: * "auto" lets the control choose a position depending on available space with the following priority balanced > end > start * "balanced" the popover is positioned at the middle of the target element @@ -67631,37 +76807,44 @@ interface IgPopover { /** * defines width for the popover. leave null for auto. + * */ width?: number|string; /** * defines height for the popover. leave null for auto + * */ height?: number|string; /** * defines width the popover won't go under the value even if no specific one is set. + * */ minWidth?: number|string; /** * defines width the popover won't exceed even if no specific one is set. + * */ maxWidth?: number|string; /** * defines height the popover won't exceed even if no specific one is set. + * */ maxHeight?: number|string; /** * Sets the time popover fades in and out when showing/hiding + * */ animationDuration?: number; /** * sets the content for the popover container. If left null the content will be get from the target. * + * * Valid values: * "string" String content of the popover container * "function" Function which is a callback that should return the content. Use the 'this' value to access the target DOM element. @@ -67670,17 +76853,20 @@ interface IgPopover { /** * Selectors indicating which items should show popovers. The predefined value is [title]. Customize if you're using something other then the title attribute for the popover content, or if you need a different selector for event delegation. When changing this option, you likely need to also change the contentTemplate option + * */ selectors?: string; /** * Sets the content for the popover header + * */ headerTemplate?: IgPopoverHeaderTemplate; /** * sets the event on which the popover will be shown. Predefined values are "mouseenter", "click" and "focus" * + * * Valid values: * "mouseenter" the popover is shown on mouse enter in the target element * "click" the popover is shown on click on the target element @@ -67690,18 +76876,38 @@ interface IgPopover { /** * Sets the containment for the popover. Accepts a jQuery object + * */ containment?: any; /** * Controls where the popover DOM should be attached to. * + * * Valid values: * "string" A valid jQuery selector for the element * "object" A reference to the parent jQuery object */ appendTo?: string|Object; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event fired before popover is shown. */ @@ -67784,6 +76990,24 @@ interface IgPopoverMethods { * @param pos The popover coordinates in pixels. */ setCoordinates(pos: Object): void; + + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ + changeLocale($container: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igPopover"): IgPopoverMethods; @@ -67800,21 +77024,27 @@ interface JQuery { igPopover(methodName: "target"): Object; igPopover(methodName: "getCoordinates"): Object; igPopover(methodName: "setCoordinates", pos: Object): void; + igPopover(methodName: "changeLocale", $container: Object): void; + igPopover(methodName: "changeGlobalLanguage"): void; + igPopover(methodName: "changeGlobalRegional"): void; /** * Controls whether the popover will close on blur or not + * */ igPopover(optionLiteral: 'option', optionName: "closeOnBlur"): boolean; /** * Controls whether the popover will close on blur or not * + * * @optionValue New value to be set. */ igPopover(optionLiteral: 'option', optionName: "closeOnBlur", optionValue: boolean): void; /** * Controls the direction in which the control shows relative to the target element + * */ igPopover(optionLiteral: 'option', optionName: "direction"): string; @@ -67822,6 +77052,7 @@ interface JQuery { /** * Controls the direction in which the control shows relative to the target element * + * * @optionValue New value to be set. */ @@ -67830,6 +77061,7 @@ interface JQuery { /** * Controls the priority in which the control searches for space to show relative to the target element. * This property has effect only if the [direction](ui.%%WidgetNameLowered%%#options:direction) property value is "auto" or unset. + * */ igPopover(optionLiteral: 'option', optionName: "directionPriority"): any[]; @@ -67837,12 +77069,14 @@ interface JQuery { * Controls the priority in which the control searches for space to show relative to the target element. * This property has effect only if the [direction](ui.%%WidgetNameLowered%%#options:direction) property value is "auto" or unset. * + * * @optionValue New value to be set. */ igPopover(optionLiteral: 'option', optionName: "directionPriority", optionValue: any[]): void; /** * Controls the position of the popover according to the target element in case the popover is larger than the target on the side we want to position, if the popover is smaller it should always be in the middle of the visible area + * */ igPopover(optionLiteral: 'option', optionName: "position"): string; @@ -67850,6 +77084,7 @@ interface JQuery { /** * Controls the position of the popover according to the target element in case the popover is larger than the target on the side we want to position, if the popover is smaller it should always be in the middle of the visible area * + * * @optionValue New value to be set. */ @@ -67857,6 +77092,7 @@ interface JQuery { /** * Defines width for the popover. leave null for auto. + * */ igPopover(optionLiteral: 'option', optionName: "width"): number|string; @@ -67864,6 +77100,7 @@ interface JQuery { /** * Defines width for the popover. leave null for auto. * + * * @optionValue New value to be set. */ @@ -67871,6 +77108,7 @@ interface JQuery { /** * Defines height for the popover. leave null for auto + * */ igPopover(optionLiteral: 'option', optionName: "height"): number|string; @@ -67878,6 +77116,7 @@ interface JQuery { /** * Defines height for the popover. leave null for auto * + * * @optionValue New value to be set. */ @@ -67885,6 +77124,7 @@ interface JQuery { /** * Defines width the popover won't go under the value even if no specific one is set. + * */ igPopover(optionLiteral: 'option', optionName: "minWidth"): number|string; @@ -67892,6 +77132,7 @@ interface JQuery { /** * Defines width the popover won't go under the value even if no specific one is set. * + * * @optionValue New value to be set. */ @@ -67899,6 +77140,7 @@ interface JQuery { /** * Defines width the popover won't exceed even if no specific one is set. + * */ igPopover(optionLiteral: 'option', optionName: "maxWidth"): number|string; @@ -67906,6 +77148,7 @@ interface JQuery { /** * Defines width the popover won't exceed even if no specific one is set. * + * * @optionValue New value to be set. */ @@ -67913,6 +77156,7 @@ interface JQuery { /** * Defines height the popover won't exceed even if no specific one is set. + * */ igPopover(optionLiteral: 'option', optionName: "maxHeight"): number|string; @@ -67920,6 +77164,7 @@ interface JQuery { /** * Defines height the popover won't exceed even if no specific one is set. * + * * @optionValue New value to be set. */ @@ -67927,18 +77172,21 @@ interface JQuery { /** * The time popover fades in and out when showing/hiding + * */ igPopover(optionLiteral: 'option', optionName: "animationDuration"): number; /** * Sets the time popover fades in and out when showing/hiding * + * * @optionValue New value to be set. */ igPopover(optionLiteral: 'option', optionName: "animationDuration", optionValue: number): void; /** * The content for the popover container. If left null the content will be get from the target. + * */ igPopover(optionLiteral: 'option', optionName: "contentTemplate"): string|Function; @@ -67946,6 +77194,7 @@ interface JQuery { /** * Sets the content for the popover container. If left null the content will be get from the target. * + * * @optionValue New value to be set. */ @@ -67953,30 +77202,35 @@ interface JQuery { /** * Selectors indicating which items should show popovers. The predefined value is [title]. Customize if you're using something other then the title attribute for the popover content, or if you need a different selector for event delegation. When changing this option, you likely need to also change the contentTemplate option + * */ igPopover(optionLiteral: 'option', optionName: "selectors"): string; /** * Selectors indicating which items should show popovers. The predefined value is [title]. Customize if you're using something other then the title attribute for the popover content, or if you need a different selector for event delegation. When changing this option, you likely need to also change the contentTemplate option * + * * @optionValue New value to be set. */ igPopover(optionLiteral: 'option', optionName: "selectors", optionValue: string): void; /** * The content for the popover header + * */ igPopover(optionLiteral: 'option', optionName: "headerTemplate"): IgPopoverHeaderTemplate; /** * Sets the content for the popover header * + * * @optionValue New value to be set. */ igPopover(optionLiteral: 'option', optionName: "headerTemplate", optionValue: IgPopoverHeaderTemplate): void; /** * The event on which the popover will be shown. Predefined values are "mouseenter", "click" and "focus" + * */ igPopover(optionLiteral: 'option', optionName: "showOn"): string; @@ -67984,6 +77238,7 @@ interface JQuery { /** * Sets the event on which the popover will be shown. Predefined values are "mouseenter", "click" and "focus" * + * * @optionValue New value to be set. */ @@ -67991,18 +77246,21 @@ interface JQuery { /** * The containment for the popover. Accepts a jQuery object + * */ igPopover(optionLiteral: 'option', optionName: "containment"): any; /** * Sets the containment for the popover. Accepts a jQuery object * + * * @optionValue New value to be set. */ igPopover(optionLiteral: 'option', optionName: "containment", optionValue: any): void; /** * Controls where the popover DOM should be attached to. + * */ igPopover(optionLiteral: 'option', optionName: "appendTo"): string|Object; @@ -68010,11 +77268,56 @@ interface JQuery { /** * Controls where the popover DOM should be attached to. * + * * @optionValue New value to be set. */ igPopover(optionLiteral: 'option', optionName: "appendTo", optionValue: string|Object): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igPopover(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igPopover(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igPopover(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igPopover(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igPopover(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igPopover(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event fired before popover is shown. */ @@ -68290,6 +77593,24 @@ interface IgQRCodeBarcode { */ applicationIndicator?: string; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Occurs when an error has happened. * Function takes first argument evt and second argument ui. @@ -68331,6 +77652,24 @@ interface IgQRCodeBarcodeMethods { * Re-polls the css styles for the widget. Use this method when the css styles have been modified. */ styleUpdated(): void; + + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ + changeLocale($container: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igQRCodeBarcode"): IgQRCodeBarcodeMethods; @@ -68341,6 +77680,9 @@ interface JQuery { igQRCodeBarcode(methodName: "flush"): void; igQRCodeBarcode(methodName: "destroy"): void; igQRCodeBarcode(methodName: "styleUpdated"): void; + igQRCodeBarcode(methodName: "changeLocale", $container: Object): void; + igQRCodeBarcode(methodName: "changeGlobalLanguage"): void; + igQRCodeBarcode(methodName: "changeGlobalRegional"): void; /** * The width of the barcode. It can be set as a number in pixels, string (px) or percentage (%). @@ -68632,6 +77974,50 @@ interface JQuery { */ igQRCodeBarcode(optionLiteral: 'option', optionName: "applicationIndicator", optionValue: string): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igQRCodeBarcode(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igQRCodeBarcode(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igQRCodeBarcode(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igQRCodeBarcode(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igQRCodeBarcode(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igQRCodeBarcode(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Occurs when an error has happened. * Function takes first argument evt and second argument ui. @@ -69127,6 +78513,24 @@ interface IgRadialGauge { */ pixelScalingRatio?: number; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event which is raised when a label of the gauge is formatted. * Function takes first argument null and second argument ui. @@ -69177,16 +78581,22 @@ interface IgRadialGaugeMethods { /** * Adds a new range to the radial gauge. + * + * @param value */ addRange(value: Object): void; /** * Removes a specified range. + * + * @param value */ removeRange(value: Object): void; /** * Updates the range. + * + * @param value */ updateRange(value: Object): void; @@ -69197,26 +78607,39 @@ interface IgRadialGaugeMethods { /** * Scales a value on the gauge's main scale to an angle around the center point of the gauge, in radians. + * + * @param value */ scaleValue(value: Object): void; /** * Unscales a value from an angle in radians to the represented value along the main scale of the gauge. + * + * @param value */ unscaleValue(value: Object): void; /** * Gets the value for the main scale of the gauge for a given point within the bounds of the gauge. + * + * @param x + * @param y */ getValueForPoint(x: Object, y: Object): number; /** * Gets the point on the gauge for a given scale value and extent. + * + * @param value + * @param extent */ getPointForValue(value: Object, extent: Object): void; /** * Returns true if the main gauge needle bounding box contains the point provided, otherwise false. + * + * @param x + * @param y */ needleContainsPoint(x: Object, y: Object): void; @@ -69239,6 +78662,24 @@ interface IgRadialGaugeMethods { * Returns true if the style was updated for the radial gauge. */ styleUpdated(): void; + + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ + changeLocale($container: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igRadialGauge"): IgRadialGaugeMethods; @@ -69259,6 +78700,9 @@ interface JQuery { igRadialGauge(methodName: "flush"): void; igRadialGauge(methodName: "destroy"): void; igRadialGauge(methodName: "styleUpdated"): void; + igRadialGauge(methodName: "changeLocale", $container: Object): void; + igRadialGauge(methodName: "changeGlobalLanguage"): void; + igRadialGauge(methodName: "changeGlobalRegional"): void; /** * The width of the gauge. It can be set as a number in pixels, string (px) or percentage (%). @@ -70112,6 +79556,50 @@ interface JQuery { */ igRadialGauge(optionLiteral: 'option', optionName: "pixelScalingRatio", optionValue: number): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igRadialGauge(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igRadialGauge(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igRadialGauge(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igRadialGauge(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igRadialGauge(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igRadialGauge(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event which is raised when a label of the gauge is formatted. * Function takes first argument null and second argument ui. @@ -70201,6 +79689,7 @@ interface IgRadialMenuItem { /** * Gets or sets a value indicating what type of item is being provided. * + * * Valid values: * "button" * "coloritem" @@ -70666,6 +80155,24 @@ interface IgRadialMenu { wedgePaddingInDegrees?: number; pixelScalingRatio?: number; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Invoked when the IsOpen property is changed to false. * Function takes a first argument ui. @@ -70714,6 +80221,24 @@ interface IgRadialMenuMethods { * Notify the radial menu that style information used for rendering the menu may have been updated. */ styleUpdated(): void; + + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ + changeLocale($container: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igRadialMenu"): IgRadialMenuMethods; @@ -70725,6 +80250,9 @@ interface JQuery { igRadialMenu(methodName: "flush"): void; igRadialMenu(methodName: "destroy"): void; igRadialMenu(methodName: "styleUpdated"): void; + igRadialMenu(methodName: "changeLocale", $container: Object): void; + igRadialMenu(methodName: "changeGlobalLanguage"): void; + igRadialMenu(methodName: "changeGlobalRegional"): void; /** * Gets the items in the menu. @@ -71040,6 +80568,50 @@ interface JQuery { igRadialMenu(optionLiteral: 'option', optionName: "pixelScalingRatio"): number; igRadialMenu(optionLiteral: 'option', optionName: "pixelScalingRatio", optionValue: number): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igRadialMenu(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igRadialMenu(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igRadialMenu(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igRadialMenu(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igRadialMenu(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igRadialMenu(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Invoked when the IsOpen property is changed to false. * Function takes a first argument ui. @@ -71083,14 +80655,14 @@ interface HoverChangeEvent { interface HoverChangeEventUIParam { /** - * Used to get new value. + * Gets the new hovered value. */ - value?: any; + value?: number; /** - * Used to get old value. + * Gets the old value. */ - oldValue?: any; + oldValue?: number; } interface ValueChangeEvent { @@ -71099,45 +80671,51 @@ interface ValueChangeEvent { interface ValueChangeEventUIParam { /** - * Used to get new value. + * Gets the new selected value. */ - value?: any; + value?: number; /** - * Used to get old value. + * Gets the previously selected value. */ - oldValue?: any; + oldValue?: number; } interface IgRating { /** * Gets a vertical or horizontal orientation for the votes. * Change of that option is not supported after igRating was created. + * */ vertical?: boolean; /** * Gets/Sets value (selected votes or percent). If the value is of type string, it should be suitable for parsing to number. According to [valueAsPercent](ui.igrating#options:valueAsPercent) options the value is used as number of selected votes or as a percent of the votes. + * */ value?: number|string; /** * Gets/Sets value-hover (hovered votes or percent of hovered votes). The default is same as value. If the value is of type string, it should be suitable for parsing to number. According to [valueAsPercent](ui.igrating#options:valueAsPercent) options the valueHover is used as number of hovered votes or as a percent of the hovered votes. + * */ valueHover?: number|string; /** * Gets/Sets number of votes. + * */ voteCount?: number; /** * Gets/Sets custom width of a vote in pixels. In case of 0 the run time style value is used. + * */ voteWidth?: number; /** * Gets/Sets custom height of a vote in pixels. In case of 0 the run time style value is used. + * */ voteHeight?: number; @@ -71145,6 +80723,7 @@ interface IgRating { * Gets the direction of selected and hovered votes. Change of that option is not supported after igRating was created. * Value true: from left to right or from top to bottom. * Value false: from right to left or from bottom to left. + * */ swapDirection?: boolean; @@ -71152,6 +80731,7 @@ interface IgRating { * Gets/Sets percent or vote number to measure value and value-hover. * Value true: value is measured as percent (from 0 to 1). * Value false: value is measured in number of voted (from 0 to voteCount) + * */ valueAsPercent?: boolean; @@ -71159,12 +80739,14 @@ interface IgRating { * Gets if igRating can have focus. Change of that option is not supported after igRating was created. * Value true: can get focus and process key events. * Value false: cannot get focus. + * */ focusable?: boolean; /** * Gets/Sets precision. Precision of value and valueHover. * + * * Valid values: * "exact" Value corresponds location of mouse. * "half" Value is rounded to the half of vote. @@ -71177,6 +80759,7 @@ interface IgRating { * It has effect only when precision is set to "half" or "whole". * If user clicks between edge of the first vote and (sizeOfVote * precisionZeroVote), then value is set to 0. * Same is applied for mouseover as well. + * */ precisionZeroVote?: number; @@ -71187,6 +80770,7 @@ interface IgRating { * If precision is "whole" or "half" and roundedDecimalPlaces is set in range of 0..2, then 3 is used. * If valueAsPercent is enabled and roundedDecimalPlaces is set to 0, then 1 is used. * If it is larger than 15, then 15 is used. + * */ roundedDecimalPlaces?: number; @@ -71194,12 +80778,14 @@ interface IgRating { * Gets/Sets selector for css classes. * That option allows replacing all default css styles by custom values. * Application should provide css classes for all members defined in the css options with "theme" selector. + * */ theme?: string; /** * Gets/Sets object which contains options supported by igValidator. * Note that for onblur validation depends on the [focusable](ui.igrating#options:focusable) option. + * */ validatorOptions?: any; @@ -71215,26 +80801,37 @@ interface IgRating { * will customize only second vote with [normalCss](ui.igrating#theming:ui-igrating ui-state-default ui-widget-content) for normal state, [hoverCss](ui.igrating#theming:ui-igrating-hover ui-state-hover) for hover state and [selectedCss](ui.igrating#theming:ui-igrating-voteselected) for selected state. * [[null, 's1', 'h1'], [null, 's2', 'h2'], [null, 's3', 'h3']] * will customize selected and hover states for first 3 votes with classes h# and s#. + * */ cssVotes?: any; /** - * Event which is raised before hover value is changed. - * If application returns false, then action is canceled and hover value stays unchanged. + * Set/Get the locale setting for the widget. * - * Function takes arguments evt and ui. - * Use ui.value to get new value. - * Use ui.oldValue to get old value. + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + + /** + * Fired before hover value is changed. + * If the application returns false, then the action is canceled and the value remains unchanged. */ hoverChange?: HoverChangeEvent; /** - * Event which is raised before (selected) value is changed. - * If application returns false, then action is canceled and value stays unchanged. - * - * Function takes arguments evt and ui. - * Use ui.value to get new value. - * Use ui.oldValue to get old value. + * Fired before (selected) value is changed. + * If the application returns false, then the action is canceled and the value remains unchanged. */ valueChange?: ValueChangeEvent; @@ -71286,6 +80883,24 @@ interface IgRatingMethods { * Destroys igRating widget. */ destroy(): Object; + + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ + changeLocale($container: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igRating"): IgRatingMethods; @@ -71299,10 +80914,14 @@ interface JQuery { igRating(methodName: "hasFocus"): boolean; igRating(methodName: "focus"): Object; igRating(methodName: "destroy"): Object; + igRating(methodName: "changeLocale", $container: Object): void; + igRating(methodName: "changeGlobalLanguage"): void; + igRating(methodName: "changeGlobalRegional"): void; /** * Gets a vertical or horizontal orientation for the votes. * Change of that option is not supported after igRating was created. + * */ igRating(optionLiteral: 'option', optionName: "vertical"): boolean; @@ -71310,12 +80929,14 @@ interface JQuery { * A vertical or horizontal orientation for the votes. * Change of that option is not supported after igRating was created. * + * * @optionValue New value to be set. */ igRating(optionLiteral: 'option', optionName: "vertical", optionValue: boolean): void; /** * Gets/Sets value (selected votes or percent). If the value is of type string, it should be suitable for parsing to number. According to [valueAsPercent](ui.igrating#options:valueAsPercent) options the value is used as number of selected votes or as a percent of the votes. + * */ igRating(optionLiteral: 'option', optionName: "value"): number|string; @@ -71323,6 +80944,7 @@ interface JQuery { /** * /Sets value (selected votes or percent). If the value is of type string, it should be suitable for parsing to number. According to [valueAsPercent](ui.igrating#options:valueAsPercent) options the value is used as number of selected votes or as a percent of the votes. * + * * @optionValue New value to be set. */ @@ -71330,6 +80952,7 @@ interface JQuery { /** * Gets/Sets value-hover (hovered votes or percent of hovered votes). The default is same as value. If the value is of type string, it should be suitable for parsing to number. According to [valueAsPercent](ui.igrating#options:valueAsPercent) options the valueHover is used as number of hovered votes or as a percent of the hovered votes. + * */ igRating(optionLiteral: 'option', optionName: "valueHover"): number|string; @@ -71337,6 +80960,7 @@ interface JQuery { /** * /Sets value-hover (hovered votes or percent of hovered votes). The default is same as value. If the value is of type string, it should be suitable for parsing to number. According to [valueAsPercent](ui.igrating#options:valueAsPercent) options the valueHover is used as number of hovered votes or as a percent of the hovered votes. * + * * @optionValue New value to be set. */ @@ -71344,36 +80968,42 @@ interface JQuery { /** * Gets/Sets number of votes. + * */ igRating(optionLiteral: 'option', optionName: "voteCount"): number; /** * /Sets number of votes. * + * * @optionValue New value to be set. */ igRating(optionLiteral: 'option', optionName: "voteCount", optionValue: number): void; /** * Gets/Sets custom width of a vote in pixels. In case of 0 the run time style value is used. + * */ igRating(optionLiteral: 'option', optionName: "voteWidth"): number; /** * /Sets custom width of a vote in pixels. In case of 0 the run time style value is used. * + * * @optionValue New value to be set. */ igRating(optionLiteral: 'option', optionName: "voteWidth", optionValue: number): void; /** * Gets/Sets custom height of a vote in pixels. In case of 0 the run time style value is used. + * */ igRating(optionLiteral: 'option', optionName: "voteHeight"): number; /** * /Sets custom height of a vote in pixels. In case of 0 the run time style value is used. * + * * @optionValue New value to be set. */ igRating(optionLiteral: 'option', optionName: "voteHeight", optionValue: number): void; @@ -71382,6 +81012,7 @@ interface JQuery { * Gets the direction of selected and hovered votes. Change of that option is not supported after igRating was created. * Value true: from left to right or from top to bottom. * Value false: from right to left or from bottom to left. + * */ igRating(optionLiteral: 'option', optionName: "swapDirection"): boolean; @@ -71390,6 +81021,7 @@ interface JQuery { * Value true: from left to right or from top to bottom. * Value false: from right to left or from bottom to left. * + * * @optionValue New value to be set. */ igRating(optionLiteral: 'option', optionName: "swapDirection", optionValue: boolean): void; @@ -71398,6 +81030,7 @@ interface JQuery { * Gets/Sets percent or vote number to measure value and value-hover. * Value true: value is measured as percent (from 0 to 1). * Value false: value is measured in number of voted (from 0 to voteCount) + * */ igRating(optionLiteral: 'option', optionName: "valueAsPercent"): boolean; @@ -71406,6 +81039,7 @@ interface JQuery { * Value true: value is measured as percent (from 0 to 1). * Value false: value is measured in number of voted (from 0 to voteCount) * + * * @optionValue New value to be set. */ igRating(optionLiteral: 'option', optionName: "valueAsPercent", optionValue: boolean): void; @@ -71414,6 +81048,7 @@ interface JQuery { * Gets if igRating can have focus. Change of that option is not supported after igRating was created. * Value true: can get focus and process key events. * Value false: cannot get focus. + * */ igRating(optionLiteral: 'option', optionName: "focusable"): boolean; @@ -71422,12 +81057,14 @@ interface JQuery { * Value true: can get focus and process key events. * Value false: cannot get focus. * + * * @optionValue New value to be set. */ igRating(optionLiteral: 'option', optionName: "focusable", optionValue: boolean): void; /** * Gets/Sets precision. Precision of value and valueHover. + * */ igRating(optionLiteral: 'option', optionName: "precision"): string; @@ -71435,6 +81072,7 @@ interface JQuery { /** * /Sets precision. Precision of value and valueHover. * + * * @optionValue New value to be set. */ @@ -71445,6 +81083,7 @@ interface JQuery { * It has effect only when precision is set to "half" or "whole". * If user clicks between edge of the first vote and (sizeOfVote * precisionZeroVote), then value is set to 0. * Same is applied for mouseover as well. + * */ igRating(optionLiteral: 'option', optionName: "precisionZeroVote"): number; @@ -71454,6 +81093,7 @@ interface JQuery { * If user clicks between edge of the first vote and (sizeOfVote * precisionZeroVote), then value is set to 0. * Same is applied for mouseover as well. * + * * @optionValue New value to be set. */ igRating(optionLiteral: 'option', optionName: "precisionZeroVote", optionValue: number): void; @@ -71465,6 +81105,7 @@ interface JQuery { * If precision is "whole" or "half" and roundedDecimalPlaces is set in range of 0..2, then 3 is used. * If valueAsPercent is enabled and roundedDecimalPlaces is set to 0, then 1 is used. * If it is larger than 15, then 15 is used. + * */ igRating(optionLiteral: 'option', optionName: "roundedDecimalPlaces"): number; @@ -71476,6 +81117,7 @@ interface JQuery { * If valueAsPercent is enabled and roundedDecimalPlaces is set to 0, then 1 is used. * If it is larger than 15, then 15 is used. * + * * @optionValue New value to be set. */ igRating(optionLiteral: 'option', optionName: "roundedDecimalPlaces", optionValue: number): void; @@ -71484,6 +81126,7 @@ interface JQuery { * Gets/Sets selector for css classes. * That option allows replacing all default css styles by custom values. * Application should provide css classes for all members defined in the css options with "theme" selector. + * */ igRating(optionLiteral: 'option', optionName: "theme"): string; @@ -71492,6 +81135,7 @@ interface JQuery { * That option allows replacing all default css styles by custom values. * Application should provide css classes for all members defined in the css options with "theme" selector. * + * * @optionValue New value to be set. */ igRating(optionLiteral: 'option', optionName: "theme", optionValue: string): void; @@ -71499,6 +81143,7 @@ interface JQuery { /** * Gets/Sets object which contains options supported by igValidator. * Note that for onblur validation depends on the [focusable](ui.igrating#options:focusable) option. + * */ igRating(optionLiteral: 'option', optionName: "validatorOptions"): any; @@ -71506,6 +81151,7 @@ interface JQuery { * /Sets object which contains options supported by igValidator. * Note that for onblur validation depends on the [focusable](ui.igrating#options:focusable) option. * + * * @optionValue New value to be set. */ igRating(optionLiteral: 'option', optionName: "validatorOptions", optionValue: any): void; @@ -71522,6 +81168,7 @@ interface JQuery { * will customize only second vote with [normalCss](ui.igrating#theming:ui-igrating ui-state-default ui-widget-content) for normal state, [hoverCss](ui.igrating#theming:ui-igrating-hover ui-state-hover) for hover state and [selectedCss](ui.igrating#theming:ui-igrating-voteselected) for selected state. * [[null, 's1', 'h1'], [null, 's2', 'h2'], [null, 's3', 'h3']] * will customize selected and hover states for first 3 votes with classes h# and s#. + * */ igRating(optionLiteral: 'option', optionName: "cssVotes"): any; @@ -71538,51 +81185,80 @@ interface JQuery { * [[null, 's1', 'h1'], [null, 's2', 'h2'], [null, 's3', 'h3']] * will customize selected and hover states for first 3 votes with classes h# and s#. * + * * @optionValue New value to be set. */ igRating(optionLiteral: 'option', optionName: "cssVotes", optionValue: any): void; /** - * Event which is raised before hover value is changed. - * If application returns false, then action is canceled and hover value stays unchanged. + * Set/Get the locale setting for the widget. * - * Function takes arguments evt and ui. - * Use ui.value to get new value. - * Use ui.oldValue to get old value. + */ + igRating(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igRating(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igRating(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igRating(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igRating(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igRating(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + + /** + * Fired before hover value is changed. + * If the application returns false, then the action is canceled and the value remains unchanged. */ igRating(optionLiteral: 'option', optionName: "hoverChange"): HoverChangeEvent; /** - * Event which is raised before hover value is changed. - * If application returns false, then action is canceled and hover value stays unchanged. + * Fired before hover value is changed. + * If the application returns false, then the action is canceled and the value remains unchanged. * - * Function takes arguments evt and ui. - * Use ui.value to get new value. - * Use ui.oldValue to get old value. - * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igRating(optionLiteral: 'option', optionName: "hoverChange", optionValue: HoverChangeEvent): void; /** - * Event which is raised before (selected) value is changed. - * If application returns false, then action is canceled and value stays unchanged. - * - * Function takes arguments evt and ui. - * Use ui.value to get new value. - * Use ui.oldValue to get old value. + * Fired before (selected) value is changed. + * If the application returns false, then the action is canceled and the value remains unchanged. */ igRating(optionLiteral: 'option', optionName: "valueChange"): ValueChangeEvent; /** - * Event which is raised before (selected) value is changed. - * If application returns false, then action is canceled and value stays unchanged. + * Fired before (selected) value is changed. + * If the application returns false, then the action is canceled and the value remains unchanged. * - * Function takes arguments evt and ui. - * Use ui.value to get new value. - * Use ui.oldValue to get old value. - * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igRating(optionLiteral: 'option', optionName: "valueChange", optionValue: ValueChangeEvent): void; igRating(options: IgRating): JQuery; @@ -71594,6 +81270,7 @@ interface JQuery { interface IgSchedulerAgendaViewSettings { /** * Gets/Sets the number of days shown in AgendaView mode. + * */ dateRangeInterval?: number; @@ -71603,6 +81280,56 @@ interface IgSchedulerAgendaViewSettings { [optionName: string]: any; } +interface IgSchedulerWeekViewSettings { + /** + * Gets/Sets the week view display mode (whether to show all days or just working days). + * + */ + weekViewDisplayMode?: number; + + /** + * Gets/Sets whether to display all hours or just working hours. + * + */ + workingHoursDisplayMode?: number; + + /** + * Gets/Sets the time slots duration. 5, 6, 10, 15, 30 and 60 minutes are supported. + * + */ + timeSlotInterval?: number; + + /** + * Option for IgSchedulerWeekViewSettings + */ + [optionName: string]: any; +} + +interface IgSchedulerDayViewSettings { + /** + * Gets/Sets the time slots duration. 5, 6, 10, 15, 30 and 60 minutes are supported. + * + */ + timeSlotInterval?: number; + + /** + * Gets/Sets the number of days are visible at a time in the day view. 1 to 7 days are supported. + * + */ + dayViewNumberOfDays?: number; + + /** + * Gets/Sets whether to display all hours or just working hours. + * + */ + workingHoursDisplayMode?: number; + + /** + * Option for IgSchedulerDayViewSettings + */ + [optionName: string]: any; +} + interface IgSchedulerMonthViewSettings { /** * Gets/Sets the type of content displayed in a MonthView day. @@ -71615,6 +81342,7 @@ interface IgSchedulerMonthViewSettings { /** * Gets/Sets the visibility of an AgendaView in a MonthView. When true, the MonthView will display an AgendaView showing the Appointments for the currently selected day at the top of its list of Appointments. + * */ isAgendaVisible?: boolean; @@ -71637,31 +81365,37 @@ interface IgSchedulerMonthViewSettings { /** * Gets/sets the visibility of the horizontal separators between weeks in the MonthView. + * */ isHorizontalSeparatorVisibile?: boolean; /** * Gets/sets the visibility of the vertical separators between days of the week in a MonthView. + * */ isVerticalSeparatorVisibile?: boolean; /** * Gets/sets the visibility of the weekday names in MonthView. + * */ isWeekdayVisible?: boolean; /** * Gets/sets the visibility of the week numbers in a MonthView. + * */ isWeekNumberVisible?: boolean; /** * Gets/sets the visibility of the days from the previous month that occur in the first week of a given month. + * */ isPreviousMonthShown?: boolean; /** * Gets/sets the visibility of the days from the next month that occur in the last week of a given month. + * */ isNextMonthShown?: boolean; @@ -71771,6 +81505,80 @@ interface MonthChangedEventUIParam { newSelectedDate?: any; } +interface WeekChangingEvent { + (event: Event, ui: WeekChangingEventUIParam): void; +} + +interface WeekChangingEventUIParam { + /** + * Gets a reference to the scheduler. + */ + owner?: any; + + /** + * Gets a reference to newly selected date. + */ + newSelectedDate?: any; + + /** + * Gets a reference to the currently selected date. + */ + currentSelectedDate?: any; +} + +interface WeekChangedEvent { + (event: Event, ui: WeekChangedEventUIParam): void; +} + +interface WeekChangedEventUIParam { + /** + * Gets a reference to the scheduler. + */ + owner?: any; + + /** + * Gets a reference to newly selected date. + */ + newSelectedDate?: any; +} + +interface DayChangingEvent { + (event: Event, ui: DayChangingEventUIParam): void; +} + +interface DayChangingEventUIParam { + /** + * Gets a reference to the scheduler. + */ + owner?: any; + + /** + * Gets a reference to newly selected date. + */ + newSelectedDate?: any; + + /** + * Gets a reference to the currently selected date. + */ + currentSelectedDate?: any; +} + +interface DayChangedEvent { + (event: Event, ui: DayChangedEventUIParam): void; +} + +interface DayChangedEventUIParam { + /** + * Gets a reference to the scheduler. + */ + owner?: any; + + /** + * Gets a reference to newly selected date. + */ + newSelectedDate?: any; +} + interface ViewChangingEvent { (event: Event, ui: ViewChangingEventUIParam): void; } @@ -71996,12 +81804,14 @@ interface AppointmentEditedEventUIParam { interface IgScheduler { /** * Lists of all the views, rendered in the Scheduler. + * */ views?: any[]; /** * Gets/Sets current view mode in the Scheduler. If this options is not defined, then the first defined view in the views property is taken. * + * * Valid values: * "monthView" Enables MonthView in the Scheduler. * "agendaView" Enables AgendaView in the Scheduler. @@ -72009,13 +81819,21 @@ interface IgScheduler { viewMode?: string; /** - * Enables/Disables today button. + * Gets/Sets selected date in the Scheduler. + * */ - selectedDate?: boolean; + selectedDate?: Date; + + /** + * Enables/Disables today button. + * + */ + enableTodayButton?: boolean; /** * Gets/Sets the width of the control. * + * * Valid values: * "null" will stretch to fit data, if no other widths are defined. */ @@ -72024,6 +81842,7 @@ interface IgScheduler { /** * Gets/Sets the height of the control. * + * * Valid values: * "null" will fit the editor inside its parent container, if no other heights are defined. */ @@ -72031,24 +81850,74 @@ interface IgScheduler { /** * Gets/Sets AgendaView settings. + * */ agendaViewSettings?: IgSchedulerAgendaViewSettings; + /** + * Gets/Sets WeekView settings. + * + */ + weekViewSettings?: IgSchedulerWeekViewSettings; + + /** + * Gets/Sets DayView settings. + * + */ + dayViewSettings?: IgSchedulerDayViewSettings; + /** * Gets/Sets MonthView settings. + * */ monthViewSettings?: IgSchedulerMonthViewSettings; /** * Gets/Sets whether the appointment dialog and the related day and appointment popups should be shown. + * */ appointmentDialogSuppress?: boolean; /** * Gets/Sets dataSource of type $.ig.scheduler.ScheduleListDataSource. + * */ dataSource?: any; + /** + * Gets the resources collection that holds the activities` owners + * + * //Initialize + * var resources = [ + * { id: 1, displayName: "Trina Friesen" }, + * { id: 2, displayName: "Mack Koch" }]; + * $(".selector").%%WidgetName%%({ + * resources: resources + * }); + * + * // Get + * var resources = $(".selector").%%WidgetName%%("option", "resources"); + */ + resources?: any; + + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Fired before agenda view range is changed when using previous and next buttons (fired only in Agenda View) */ @@ -72084,6 +81953,26 @@ interface IgScheduler { */ rendered?: RenderedEvent; + /** + * Fired before changing the week begins, when using previous and next buttons (fired only in Week View) + */ + weekChanging?: WeekChangingEvent; + + /** + * Fired after week is changed when using previous and next buttons (fired only in Week View) + */ + weekChanged?: WeekChangedEvent; + + /** + * Fired before changing the day begins, when using previous and next buttons (fired only in Day View) + */ + dayChanging?: DayChangingEvent; + + /** + * Fired after day is changed when using previous and next buttons (fired only in Day View) + */ + dayChanged?: DayChangedEvent; + /** * Fired before the view is changed, when using the menu buttons. */ @@ -72151,15 +82040,20 @@ interface IgScheduler { } interface IgSchedulerMethods { /** - * Gets reference to appointment by id - */ - getAppointmentById(id: Object): Object; - - /** - * Creates a new appointment and renders it to the scheduler + * Creates an appointment and adds it to the appointment collection + * + * @param appointment appointment */ createAppointment(appointment: Object): Object; + /** + * Gets reference to a collection of all appointments for the given time range + * + * @param start Start date. + * @param end End date. + */ + getAppointmentsInRange(start: Date, end: Date): Object; + /** * Deletes appointment from the appointment collection * @@ -72174,6 +82068,11 @@ interface IgSchedulerMethods { * @param updateAppoinment updateAppoinment */ editAppointment(appointment: Object, updateAppoinment: Object): Object; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.igscheduler#options:language) + * Note that this method is for rare scenarios, see [language](ui.igscheduler#options:language) or [locale](ui.igscheduler#options:locale) option setter + */ changeLocale(): void; /** @@ -72205,14 +82104,24 @@ interface IgSchedulerMethods { * Gets reference to the jQuery calendar UI control. */ getCalendar(): string; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igScheduler"): IgSchedulerMethods; } interface JQuery { - igScheduler(methodName: "getAppointmentById", id: Object): Object; igScheduler(methodName: "createAppointment", appointment: Object): Object; + igScheduler(methodName: "getAppointmentsInRange", start: Date, end: Date): Object; igScheduler(methodName: "deleteAppointment", appointment: Object): Object; igScheduler(methodName: "editAppointment", appointment: Object, updateAppoinment: Object): Object; igScheduler(methodName: "changeLocale"): void; @@ -72222,21 +82131,26 @@ interface JQuery { igScheduler(methodName: "dateRangeButton"): string; igScheduler(methodName: "nextButton"): string; igScheduler(methodName: "getCalendar"): string; + igScheduler(methodName: "changeGlobalLanguage"): void; + igScheduler(methodName: "changeGlobalRegional"): void; /** * Lists of all the views, rendered in the Scheduler. + * */ igScheduler(optionLiteral: 'option', optionName: "views"): any[]; /** * Lists of all the views, rendered in the Scheduler. * + * * @optionValue New value to be set. */ igScheduler(optionLiteral: 'option', optionName: "views", optionValue: any[]): void; /** * Gets/Sets current view mode in the Scheduler. If this options is not defined, then the first defined view in the views property is taken. + * */ igScheduler(optionLiteral: 'option', optionName: "viewMode"): string; @@ -72244,25 +82158,43 @@ interface JQuery { /** * /Sets current view mode in the Scheduler. If this options is not defined, then the first defined view in the views property is taken. * + * * @optionValue New value to be set. */ igScheduler(optionLiteral: 'option', optionName: "viewMode", optionValue: string): void; /** - * Enables/Disables today button. + * Gets/Sets selected date in the Scheduler. + * */ - igScheduler(optionLiteral: 'option', optionName: "selectedDate"): boolean; + igScheduler(optionLiteral: 'option', optionName: "selectedDate"): Date; + + /** + * /Sets selected date in the Scheduler. + * + * + * @optionValue New value to be set. + */ + igScheduler(optionLiteral: 'option', optionName: "selectedDate", optionValue: Date): void; /** * Enables/Disables today button. * + */ + igScheduler(optionLiteral: 'option', optionName: "enableTodayButton"): boolean; + + /** + * Enables/Disables today button. + * + * * @optionValue New value to be set. */ - igScheduler(optionLiteral: 'option', optionName: "selectedDate", optionValue: boolean): void; + igScheduler(optionLiteral: 'option', optionName: "enableTodayButton", optionValue: boolean): void; /** * Gets/Sets the width of the control. + * */ igScheduler(optionLiteral: 'option', optionName: "width"): string|number; @@ -72270,6 +82202,7 @@ interface JQuery { /** * /Sets the width of the control. * + * * @optionValue New value to be set. */ @@ -72277,6 +82210,7 @@ interface JQuery { /** * Gets/Sets the height of the control. + * */ igScheduler(optionLiteral: 'option', optionName: "height"): string|number; @@ -72284,6 +82218,7 @@ interface JQuery { /** * /Sets the height of the control. * + * * @optionValue New value to be set. */ @@ -72291,52 +82226,166 @@ interface JQuery { /** * Gets/Sets AgendaView settings. + * */ igScheduler(optionLiteral: 'option', optionName: "agendaViewSettings"): IgSchedulerAgendaViewSettings; /** * /Sets AgendaView settings. * + * * @optionValue New value to be set. */ igScheduler(optionLiteral: 'option', optionName: "agendaViewSettings", optionValue: IgSchedulerAgendaViewSettings): void; + /** + * Gets/Sets WeekView settings. + * + */ + igScheduler(optionLiteral: 'option', optionName: "weekViewSettings"): IgSchedulerWeekViewSettings; + + /** + * /Sets WeekView settings. + * + * + * @optionValue New value to be set. + */ + igScheduler(optionLiteral: 'option', optionName: "weekViewSettings", optionValue: IgSchedulerWeekViewSettings): void; + + /** + * Gets/Sets DayView settings. + * + */ + igScheduler(optionLiteral: 'option', optionName: "dayViewSettings"): IgSchedulerDayViewSettings; + + /** + * /Sets DayView settings. + * + * + * @optionValue New value to be set. + */ + igScheduler(optionLiteral: 'option', optionName: "dayViewSettings", optionValue: IgSchedulerDayViewSettings): void; + /** * Gets/Sets MonthView settings. + * */ igScheduler(optionLiteral: 'option', optionName: "monthViewSettings"): IgSchedulerMonthViewSettings; /** * /Sets MonthView settings. * + * * @optionValue New value to be set. */ igScheduler(optionLiteral: 'option', optionName: "monthViewSettings", optionValue: IgSchedulerMonthViewSettings): void; /** * Gets/Sets whether the appointment dialog and the related day and appointment popups should be shown. + * */ igScheduler(optionLiteral: 'option', optionName: "appointmentDialogSuppress"): boolean; /** * /Sets whether the appointment dialog and the related day and appointment popups should be shown. * + * * @optionValue New value to be set. */ igScheduler(optionLiteral: 'option', optionName: "appointmentDialogSuppress", optionValue: boolean): void; /** * Gets/Sets dataSource of type $.ig.scheduler.ScheduleListDataSource. + * */ igScheduler(optionLiteral: 'option', optionName: "dataSource"): any; /** * /Sets dataSource of type $.ig.scheduler.ScheduleListDataSource. * + * * @optionValue New value to be set. */ igScheduler(optionLiteral: 'option', optionName: "dataSource", optionValue: any): void; + /** + * Gets the resources collection that holds the activities` owners + * + * //Initialize + * var resources = [ + * { id: 1, displayName: "Trina Friesen" }, + * { id: 2, displayName: "Mack Koch" }]; + * $(".selector").%%WidgetName%%({ + * resources: resources + * }); + * + * // Get + * var resources = $(".selector").%%WidgetName%%("option", "resources"); + */ + igScheduler(optionLiteral: 'option', optionName: "resources"): any; + + /** + * The resources collection that holds the activities` owners + * + * //Initialize + * var resources = [ + * { id: 1, displayName: "Trina Friesen" }, + * { id: 2, displayName: "Mack Koch" }]; + * $(".selector").%%WidgetName%%({ + * resources: resources + * }); + * + * // Get + * var resources = $(".selector").%%WidgetName%%("option", "resources"); + * + * @optionValue New value to be set. + */ + igScheduler(optionLiteral: 'option', optionName: "resources", optionValue: any): void; + + /** + * Set/Get the locale setting for the widget. + * + */ + igScheduler(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igScheduler(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igScheduler(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igScheduler(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igScheduler(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igScheduler(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Fired before agenda view range is changed when using previous and next buttons (fired only in Agenda View) */ @@ -72421,6 +82470,54 @@ interface JQuery { */ igScheduler(optionLiteral: 'option', optionName: "rendered", optionValue: RenderedEvent): void; + /** + * Fired before changing the week begins, when using previous and next buttons (fired only in Week View) + */ + igScheduler(optionLiteral: 'option', optionName: "weekChanging"): WeekChangingEvent; + + /** + * Fired before changing the week begins, when using previous and next buttons (fired only in Week View) + * + * @optionValue New value to be set. + */ + igScheduler(optionLiteral: 'option', optionName: "weekChanging", optionValue: WeekChangingEvent): void; + + /** + * Fired after week is changed when using previous and next buttons (fired only in Week View) + */ + igScheduler(optionLiteral: 'option', optionName: "weekChanged"): WeekChangedEvent; + + /** + * Fired after week is changed when using previous and next buttons (fired only in Week View) + * + * @optionValue New value to be set. + */ + igScheduler(optionLiteral: 'option', optionName: "weekChanged", optionValue: WeekChangedEvent): void; + + /** + * Fired before changing the day begins, when using previous and next buttons (fired only in Day View) + */ + igScheduler(optionLiteral: 'option', optionName: "dayChanging"): DayChangingEvent; + + /** + * Fired before changing the day begins, when using previous and next buttons (fired only in Day View) + * + * @optionValue New value to be set. + */ + igScheduler(optionLiteral: 'option', optionName: "dayChanging", optionValue: DayChangingEvent): void; + + /** + * Fired after day is changed when using previous and next buttons (fired only in Day View) + */ + igScheduler(optionLiteral: 'option', optionName: "dayChanged"): DayChangedEvent; + + /** + * Fired after day is changed when using previous and next buttons (fired only in Day View) + * + * @optionValue New value to be set. + */ + igScheduler(optionLiteral: 'option', optionName: "dayChanged", optionValue: DayChangedEvent): void; + /** * Fired before the view is changed, when using the menu buttons. */ @@ -72715,12 +82812,14 @@ interface ResizedEventUIParam { interface IgScroll { /** * Sets or gets if the scrollbars should be always visible (on all environments). Otherwise it will be the default behavior. Note: this option is only for the custom scrollbars set through the scrollbarType option. + * */ alwaysVisible?: boolean; /** * Sets or gets what type of scrollbars should be using the igScroll (on all environments). * + * * Valid values: * "custom" Custom scrollbars with custom ui and events. * "native" Native scrollbars @@ -72728,126 +82827,174 @@ interface IgScroll { */ scrollbarType?: string; + /** + * Sets or gets the minimum size of the thumb drag in pixels. For the vertical thumb it means its minimum height, for the horizontal thumb it means its minimum width. This affects only the custom scrollblar when scrollbarType is set to "custom". + * + */ + minThumbSize?: number|string; + /** * Sets or gets if igScroll can modify the DOM when it is initialized on certain element so that the content can be scrollable. + * */ modifyDOM?: boolean; /** * Sets custom value for how high is actually the content. Useful when wanting to scroll and update the shown content manually. + * */ scrollHeight?: number; /** * Sets custom value for what width is actually the content. Useful when wanting to scroll and update the shown content manually. + * */ scrollWidth?: number; /** * Sets gets current vertical position of the content. + * */ scrollTop?: number; /** * Sets gets current horizontal position of the content. + * */ scrollLeft?: number; /** * Sets gets the step of the default scrolling behavior when using mouse wheel + * */ wheelStep?: number; /** * Sets gets the step of the default scrolling behavior when using any of the custom scrollbar arrows + * */ smallIncrementStep?: number; /** * Sets gets the step of the default scrolling behavior when using any of the custom scrollbar track areas. + * */ bigIncrementStep?: number; /** * Sets gets if smoother scrolling with small intertia should be used when using mouse wheel + * */ smoothing?: boolean; /** * Sets or gets the modifier for how many pixels will be scrolled when using the mouse wheel once. This is used only for the smooth scrolling behavior. + * */ smoothingStep?: number; /** * Sets or gets the modifier for how long the scroll ‘animation’ lasts when using the mouse wheel once. This is used only for the smooth scrolling behavior. + * */ smoothingDuration?: number; /** * Sets gets the modifier for how much the inertia scrolls on mobile devices + * */ inertiaStep?: number; /** * Sets gets the modifier for how long the inertia last on mobile devices + * */ inertiaDuration?: number; /** * Sets gets how much pixels of toleration there will be when initially swiping horizontally. This is to improve swiping up/down without scrolling left/right when not intended due to small deviation left/right + * */ swipeToleranceX?: number; /** * Sets gets at least how many times the horizontal speed should be bigger so the inertia proceeds only horizontally without scrolling vertically. This is to improve interactions due to not perfectly swiping left/right with some deviation down/up + * */ inertiaDeltaX?: number; /** * Sets gets at least how many times the vertical speed should be bigger so the inertia proceeds only vertically without scrolling horizontally. This is to improve interactions due to not perfectly swiping down/up with some deviation left/right + * */ inertiaDeltaY?: number; /** * Sets gets elements that are linked to the main content horizontally. When the content is scrolled on X axis the linked elements scroll accordingly. + * */ syncedElemsH?: any[]; /** * Sets gets elements that are linked to the main content vertically. When the content is scrolled on Y axis the linked elements scroll accordingly. + * */ syncedElemsV?: any[]; /** * Sets gets html or jQuery element which is used for horizontal scrolling. + * */ scrollbarH?: string; /** * Sets gets html or jQuery element which is used for vertical scrolling. + * */ scrollbarV?: string; /** * Sets gets if only the linked horizontal scrollbar should be used for horizontal scrolling. Note: The behavior when the linked scrollbar is scrolled in this case should be handled manually. + * */ scrollOnlyHBar?: boolean; /** * Sets gets if only the linked vertical scrollbar should be used for vertical scrolling. Note: The behavior when the linked scrollbar is scrolled in this case should be handled manually. + * */ scrollOnlyVBar?: boolean; /** * Sets gets html or jQuery element to which the horizontal scrollbar will be appended to. + * */ scrollbarHParent?: string; /** * Sets gets html or jQuery element to which the vertical scrollbar will be appended to. + * */ scrollbarVParent?: string; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event which is raised after the scroller has been rendered fully */ @@ -72902,9 +83049,24 @@ interface IgScroll { } interface IgScrollMethods { refresh(): void; + + /** + * This method overrides the base method and does nothing, because the scoll container shouldn't change the container locales + * Note that this method is for rare scenarios, use [language](ui.igupload#options:language) or [locale](ui.igupload#options:locale) option setter + */ changeLocale(): void; option(optionName: Object, value: Object): void; destroy(): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igScroll"): IgScrollMethods; @@ -72915,21 +83077,26 @@ interface JQuery { igScroll(methodName: "changeLocale"): void; igScroll(methodName: "option", optionName: Object, value: Object): void; igScroll(methodName: "destroy"): void; + igScroll(methodName: "changeGlobalLanguage"): void; + igScroll(methodName: "changeGlobalRegional"): void; /** * Sets or gets if the scrollbars should be always visible (on all environments). Otherwise it will be the default behavior. Note: this option is only for the custom scrollbars set through the scrollbarType option. + * */ igScroll(optionLiteral: 'option', optionName: "alwaysVisible"): boolean; /** * Sets or gets if the scrollbars should be always visible (on all environments). Otherwise it will be the default behavior. Note: this option is only for the custom scrollbars set through the scrollbarType option. * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "alwaysVisible", optionValue: boolean): void; /** * Sets or gets what type of scrollbars should be using the igScroll (on all environments). + * */ igScroll(optionLiteral: 'option', optionName: "scrollbarType"): string; @@ -72937,299 +83104,408 @@ interface JQuery { /** * Sets or gets what type of scrollbars should be using the igScroll (on all environments). * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "scrollbarType", optionValue: string): void; + /** + * Sets or gets the minimum size of the thumb drag in pixels. For the vertical thumb it means its minimum height, for the horizontal thumb it means its minimum width. This affects only the custom scrollblar when scrollbarType is set to "custom". + * + */ + + igScroll(optionLiteral: 'option', optionName: "minThumbSize"): number|string; + + /** + * Sets or gets the minimum size of the thumb drag in pixels. For the vertical thumb it means its minimum height, for the horizontal thumb it means its minimum width. This affects only the custom scrollblar when scrollbarType is set to "custom". + * + * + * @optionValue New value to be set. + */ + + igScroll(optionLiteral: 'option', optionName: "minThumbSize", optionValue: number|string): void; + /** * Sets or gets if igScroll can modify the DOM when it is initialized on certain element so that the content can be scrollable. + * */ igScroll(optionLiteral: 'option', optionName: "modifyDOM"): boolean; /** * Sets or gets if igScroll can modify the DOM when it is initialized on certain element so that the content can be scrollable. * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "modifyDOM", optionValue: boolean): void; /** * Sets custom value for how high is actually the content. Useful when wanting to scroll and update the shown content manually. + * */ igScroll(optionLiteral: 'option', optionName: "scrollHeight"): number; /** * Sets custom value for how high is actually the content. Useful when wanting to scroll and update the shown content manually. * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "scrollHeight", optionValue: number): void; /** * Sets custom value for what width is actually the content. Useful when wanting to scroll and update the shown content manually. + * */ igScroll(optionLiteral: 'option', optionName: "scrollWidth"): number; /** * Sets custom value for what width is actually the content. Useful when wanting to scroll and update the shown content manually. * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "scrollWidth", optionValue: number): void; /** * Sets gets current vertical position of the content. + * */ igScroll(optionLiteral: 'option', optionName: "scrollTop"): number; /** * Sets gets current vertical position of the content. * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "scrollTop", optionValue: number): void; /** * Sets gets current horizontal position of the content. + * */ igScroll(optionLiteral: 'option', optionName: "scrollLeft"): number; /** * Sets gets current horizontal position of the content. * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "scrollLeft", optionValue: number): void; /** * Sets gets the step of the default scrolling behavior when using mouse wheel + * */ igScroll(optionLiteral: 'option', optionName: "wheelStep"): number; /** * Sets gets the step of the default scrolling behavior when using mouse wheel * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "wheelStep", optionValue: number): void; /** * Sets gets the step of the default scrolling behavior when using any of the custom scrollbar arrows + * */ igScroll(optionLiteral: 'option', optionName: "smallIncrementStep"): number; /** * Sets gets the step of the default scrolling behavior when using any of the custom scrollbar arrows * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "smallIncrementStep", optionValue: number): void; /** * Sets gets the step of the default scrolling behavior when using any of the custom scrollbar track areas. + * */ igScroll(optionLiteral: 'option', optionName: "bigIncrementStep"): number; /** * Sets gets the step of the default scrolling behavior when using any of the custom scrollbar track areas. * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "bigIncrementStep", optionValue: number): void; /** * Sets gets if smoother scrolling with small intertia should be used when using mouse wheel + * */ igScroll(optionLiteral: 'option', optionName: "smoothing"): boolean; /** * Sets gets if smoother scrolling with small intertia should be used when using mouse wheel * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "smoothing", optionValue: boolean): void; /** * Sets or gets the modifier for how many pixels will be scrolled when using the mouse wheel once. This is used only for the smooth scrolling behavior. + * */ igScroll(optionLiteral: 'option', optionName: "smoothingStep"): number; /** * Sets or gets the modifier for how many pixels will be scrolled when using the mouse wheel once. This is used only for the smooth scrolling behavior. * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "smoothingStep", optionValue: number): void; /** * Sets or gets the modifier for how long the scroll ‘animation’ lasts when using the mouse wheel once. This is used only for the smooth scrolling behavior. + * */ igScroll(optionLiteral: 'option', optionName: "smoothingDuration"): number; /** * Sets or gets the modifier for how long the scroll ‘animation’ lasts when using the mouse wheel once. This is used only for the smooth scrolling behavior. * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "smoothingDuration", optionValue: number): void; /** * Sets gets the modifier for how much the inertia scrolls on mobile devices + * */ igScroll(optionLiteral: 'option', optionName: "inertiaStep"): number; /** * Sets gets the modifier for how much the inertia scrolls on mobile devices * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "inertiaStep", optionValue: number): void; /** * Sets gets the modifier for how long the inertia last on mobile devices + * */ igScroll(optionLiteral: 'option', optionName: "inertiaDuration"): number; /** * Sets gets the modifier for how long the inertia last on mobile devices * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "inertiaDuration", optionValue: number): void; /** * Sets gets how much pixels of toleration there will be when initially swiping horizontally. This is to improve swiping up/down without scrolling left/right when not intended due to small deviation left/right + * */ igScroll(optionLiteral: 'option', optionName: "swipeToleranceX"): number; /** * Sets gets how much pixels of toleration there will be when initially swiping horizontally. This is to improve swiping up/down without scrolling left/right when not intended due to small deviation left/right * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "swipeToleranceX", optionValue: number): void; /** * Sets gets at least how many times the horizontal speed should be bigger so the inertia proceeds only horizontally without scrolling vertically. This is to improve interactions due to not perfectly swiping left/right with some deviation down/up + * */ igScroll(optionLiteral: 'option', optionName: "inertiaDeltaX"): number; /** * Sets gets at least how many times the horizontal speed should be bigger so the inertia proceeds only horizontally without scrolling vertically. This is to improve interactions due to not perfectly swiping left/right with some deviation down/up * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "inertiaDeltaX", optionValue: number): void; /** * Sets gets at least how many times the vertical speed should be bigger so the inertia proceeds only vertically without scrolling horizontally. This is to improve interactions due to not perfectly swiping down/up with some deviation left/right + * */ igScroll(optionLiteral: 'option', optionName: "inertiaDeltaY"): number; /** * Sets gets at least how many times the vertical speed should be bigger so the inertia proceeds only vertically without scrolling horizontally. This is to improve interactions due to not perfectly swiping down/up with some deviation left/right * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "inertiaDeltaY", optionValue: number): void; /** * Sets gets elements that are linked to the main content horizontally. When the content is scrolled on X axis the linked elements scroll accordingly. + * */ igScroll(optionLiteral: 'option', optionName: "syncedElemsH"): any[]; /** * Sets gets elements that are linked to the main content horizontally. When the content is scrolled on X axis the linked elements scroll accordingly. * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "syncedElemsH", optionValue: any[]): void; /** * Sets gets elements that are linked to the main content vertically. When the content is scrolled on Y axis the linked elements scroll accordingly. + * */ igScroll(optionLiteral: 'option', optionName: "syncedElemsV"): any[]; /** * Sets gets elements that are linked to the main content vertically. When the content is scrolled on Y axis the linked elements scroll accordingly. * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "syncedElemsV", optionValue: any[]): void; /** * Sets gets html or jQuery element which is used for horizontal scrolling. + * */ igScroll(optionLiteral: 'option', optionName: "scrollbarH"): string; /** * Sets gets html or jQuery element which is used for horizontal scrolling. * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "scrollbarH", optionValue: string): void; /** * Sets gets html or jQuery element which is used for vertical scrolling. + * */ igScroll(optionLiteral: 'option', optionName: "scrollbarV"): string; /** * Sets gets html or jQuery element which is used for vertical scrolling. * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "scrollbarV", optionValue: string): void; /** * Sets gets if only the linked horizontal scrollbar should be used for horizontal scrolling. Note: The behavior when the linked scrollbar is scrolled in this case should be handled manually. + * */ igScroll(optionLiteral: 'option', optionName: "scrollOnlyHBar"): boolean; /** * Sets gets if only the linked horizontal scrollbar should be used for horizontal scrolling. Note: The behavior when the linked scrollbar is scrolled in this case should be handled manually. * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "scrollOnlyHBar", optionValue: boolean): void; /** * Sets gets if only the linked vertical scrollbar should be used for vertical scrolling. Note: The behavior when the linked scrollbar is scrolled in this case should be handled manually. + * */ igScroll(optionLiteral: 'option', optionName: "scrollOnlyVBar"): boolean; /** * Sets gets if only the linked vertical scrollbar should be used for vertical scrolling. Note: The behavior when the linked scrollbar is scrolled in this case should be handled manually. * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "scrollOnlyVBar", optionValue: boolean): void; /** * Sets gets html or jQuery element to which the horizontal scrollbar will be appended to. + * */ igScroll(optionLiteral: 'option', optionName: "scrollbarHParent"): string; /** * Sets gets html or jQuery element to which the horizontal scrollbar will be appended to. * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "scrollbarHParent", optionValue: string): void; /** * Sets gets html or jQuery element to which the vertical scrollbar will be appended to. + * */ igScroll(optionLiteral: 'option', optionName: "scrollbarVParent"): string; /** * Sets gets html or jQuery element to which the vertical scrollbar will be appended to. * + * * @optionValue New value to be set. */ igScroll(optionLiteral: 'option', optionName: "scrollbarVParent", optionValue: string): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igScroll(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igScroll(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igScroll(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igScroll(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igScroll(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igScroll(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event which is raised after the scroller has been rendered fully */ @@ -73345,6 +83621,3062 @@ interface JQuery { igScroll(optionLiteral: 'option', optionName: string, optionValue: any): JQuery; igScroll(methodName: string, ...methodParams: any[]): any; } +interface IgShapeChart { + /** + * The triangulated file source URI or an instance of $.ig.ShapeDataSource. + */ + shapeDataSource?: string; + + /** + * String The database source URI. + */ + databaseSource?: string; + + /** + * The triangulated file source URI or an instance of $.ig.TriangulationDataSource. + */ + triangulationDataSource?: string; + + /** + * Gets or sets the id of a template element to use for tooltips, or markup representing the tooltip template. + */ + tooltipTemplate?: any; + + /** + * Gets or sets the names of tooltip templates + */ + tooltipTemplates?: any; + + /** + * Gets or sets the left margin of chart title + */ + titleLeftMargin?: number; + + /** + * Gets or sets the right margin of chart title + */ + titleRightMargin?: number; + + /** + * Gets or sets the top margin of chart title + */ + titleTopMargin?: number; + + /** + * Gets or sets the bottom margin of chart title + */ + titleBottomMargin?: number; + + /** + * Gets or sets the left margin of chart subtitle + */ + subtitleLeftMargin?: number; + + /** + * Gets or sets the top margin of chart subtitle + */ + subtitleTopMargin?: number; + + /** + * Gets or sets the right margin of chart subtitle + */ + subtitleRightMargin?: number; + + /** + * Gets or sets the bottom margin of chart subtitle + */ + subtitleBottomMargin?: number; + + /** + * Gets or sets color of chart subtitle + */ + subtitleTextColor?: string; + + /** + * Gets or sets color of chart title + */ + titleTextColor?: string; + + /** + * Gets or sets the left margin of the chart content. + */ + leftMargin?: number; + + /** + * Gets or sets the top margin of the chart content. + */ + topMargin?: number; + + /** + * Gets or sets the right margin of the chart content. + */ + rightMargin?: number; + + /** + * Gets or sets the bottom margin around the chart content. + */ + bottomMargin?: number; + + /** + * Gets or sets the duration used for animating series plots when the data is changing + */ + transitionDuration?: number; + + /** + * Gets or sets the easing function used for animating series plots when the data is changing. + * This can be set to one of the known values "linear" or "cubic," or it can be set to an easing function which takes a single numeric parameter and returns a number. + */ + transitionEasingFunction?: any; + + /** + * Gets or sets a function for creating wrapped tooltip + */ + createWrappedTooltip?: any; + + /** + * Gets or sets the widget of this control + */ + widget?: any; + + /** + * Gets or sets CSS font property for the chart subtitle + */ + subtitleTextStyle?: string; + + /** + * Gets or sets CSS font property for the chart title + */ + titleTextStyle?: string; + + /** + * Gets or sets a collection of data items used to generate the chart. + * The ItemsSource of this chart can be a list of objects containing one or more numeric properties. + * Additionally, if the objects in the list implement the IEnumerable interface, + * the Chart will attempt to delve into the sub-collections when reading through the data source. + * Databinding can be further configured by attributing the data item classes + * with the DataSeriesMemberIntentAttribute. + */ + itemsSource?: any; + + /** + * Gets or sets a set of property paths that should be included for consideration by the category chart, leaving the remainder excluded. If null, all properties will be considered. + */ + includedProperties?: any; + + /** + * Gets or sets a set of property paths that should be excluded from consideration by the category chart. + */ + excludedProperties?: any; + + /** + * Gets or sets the palette of brushes to use for coloring the chart series. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + brushes?: any; + + /** + * Gets or sets the palette of brushes to use for outlines on the chart series. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + outlines?: any; + + /** + * Gets or sets the legend to connect this chart to. + * When the legend property is set, the chart will use it to display information about its series. Legends can be shared by multiple chart controls. + */ + legend?: any; + + /** + * Gets or sets whether the chart can be horizontally zoomed through user interactions. + */ + isHorizontalZoomEnabled?: boolean; + + /** + * Gets or sets whether the chart can be vertically zoomed through user interactions. + */ + isVerticalZoomEnabled?: boolean; + + /** + * Gets or sets the rectangle representing the current scroll and zoom state of the chart. + * WindowRect is expressed as a Rectangle with coordinates and sizes between 0 and 1. + * The provided object should have numeric properties called left, top, width and height. + */ + windowRect?: any; + + /** + * Gets or sets text to display above the plot area. + */ + title?: string; + + /** + * Gets or sets text to display below the Title, above the plot area. + */ + subtitle?: string; + + /** + * Gets or sets horizontal alignment which determines the title position, relative to the left and right edges of the control. + * + * Valid values: + * "left" Align the item to the left + * "center" Center the item + * "right" Align the item to the right + * "stretch" Stretch the item to the full width + */ + titleAlignment?: string; + + /** + * Gets or sets horizontal alignment which determines the subtitle position, relative to the left and right edges of the control. + * + * Valid values: + * "left" Align the item to the left + * "center" Center the item + * "right" Align the item to the right + * "stretch" Stretch the item to the full width + */ + subtitleAlignment?: string; + + /** + * Gets or sets the behavior that determines how unknown values will be plotted on the chart.Null and Double.NaN are two examples of unknown values. + * + * + * Valid values: + * "linearInterpolate" Plot the unknown value as the midpoint between surrounding known values using linear interpolation. + * "dontPlot" Do not plot the unknown value on the chart. + */ + unknownValuePlotting?: string; + + /** + * Gets or sets the rendering resolution for all series in this chart. + * Where n = Resolution, for every n horizontal pixels, combine all items into a single datapoint. When Resolution = 0, all datapoints will be rendered as graphical objects. Charts with a higher resolution will have faster performance. + */ + resolution?: number; + + /** + * Gets or sets the thickness for all series in this chart. Depending on the ChartType, this can be the main brush used, or just the outline. + */ + thickness?: number; + + /** + * Gets or sets the marker shapes used for indicating location of data points in this chart. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + */ + markerTypes?: any; + + /** + * Gets or sets the palette of brushes used for rendering fill area of data point markers. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + markerBrushes?: any; + + /** + * Gets or sets the palette of brushes used for rendering outlines of data point markers. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + markerOutlines?: any; + + /** + * Gets or sets the maximum number of markers displyed in the plot area of the chart. + */ + markerMaxCount?: number; + + /** + * Gets or sets the palette of brushes to used for coloring trend lines in this chart. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + trendLineBrushes?: any; + + /** + * Gets or sets the formula used for calculating trend lines in this chart.This property applies only to these chart types: point, line, spline, and bubble + * + * + * Valid values: + * "none" No trend line will be displayed. + * "linearFit" Linear fit. + * "quadraticFit" Quadratic polynomial fit. + * "cubicFit" Cubic polynomial fit. + * "quarticFit" Quartic polynomial fit. + * "quinticFit" Quintic polynomial fit. + * "logarithmicFit" Logarithmic fit. + * "exponentialFit" Exponential fit. + * "powerLawFit" Powerlaw fit. + * "simpleAverage" Simple moving average. + * "exponentialAverage" Exponential moving average. + * "modifiedAverage" Modified moving average. + * "cumulativeAverage" Cumulative moving average. + * "weightedAverage" Weighted moving average. + */ + trendLineType?: string; + + /** + * Gets or sets the thickness of the trend lines in this chart. + * This property applies only to these chart types: point, line, spline, and bubble + */ + trendLineThickness?: number; + + /** + * Gets or sets a value indicating whether grid and tick lines are aligned to device pixels. + */ + alignsGridLinesToPixels?: boolean; + trendLinePeriod?: number; + + /** + * Gets or sets function which takes an context object and returns a formatted label for the X-axis. + */ + xAxisFormatLabel?: any; + + /** + * Gets or sets function which takes a context object and returns a formatted label for the Y-axis. + */ + yAxisFormatLabel?: any; + + /** + * Gets or sets the left margin of labels on the X-axis + */ + xAxisLabelLeftMargin?: number; + + /** + * Gets or sets the top margin of labels on the X-axis + */ + xAxisLabelTopMargin?: number; + + /** + * Gets or sets the right margin of labels on the X-axis + */ + xAxisLabelRightMargin?: number; + + /** + * Gets or sets the bottom margin of labels on the X-axis + */ + xAxisLabelBottomMargin?: number; + + /** + * Gets or sets the left margin of labels on the Y-axis + */ + yAxisLabelLeftMargin?: number; + + /** + * Gets or sets the top margin of labels on the Y-axis + */ + yAxisLabelTopMargin?: number; + + /** + * Gets or sets the right margin of labels on the Y-axis + */ + yAxisLabelRightMargin?: number; + + /** + * Gets or sets the bottom margin of labels on the Y-axis + */ + yAxisLabelBottomMargin?: number; + + /** + * Gets or sets color of labels on the X-axis + */ + xAxisLabelTextColor?: string; + + /** + * Gets or sets color of labels on the Y-axis + */ + yAxisLabelTextColor?: string; + + /** + * Gets or sets the margin around a title on the X-axis + */ + xAxisTitleMargin?: number; + + /** + * Gets or sets the margin around a title on the Y-axis + */ + yAxisTitleMargin?: number; + + /** + * Gets or sets the left margin of a title on the X-axis + */ + xAxisTitleLeftMargin?: number; + + /** + * Gets or sets the left margin of a title on the Y-axis + */ + yAxisTitleLeftMargin?: number; + + /** + * Gets or sets the top margin of a title on the X-axis + */ + xAxisTitleTopMargin?: number; + + /** + * Gets or sets the top margin of a title on the Y-axis + */ + yAxisTitleTopMargin?: number; + + /** + * Gets or sets the right margin of a title on the X-axis + */ + xAxisTitleRightMargin?: number; + + /** + * Gets or sets the right margin of a title on the Y-axis + */ + yAxisTitleRightMargin?: number; + + /** + * Gets or sets the bottom margin of a title on the X-axis + */ + xAxisTitleBottomMargin?: number; + + /** + * Gets or sets the bottom margin of a title on the Y-axis + */ + yAxisTitleBottomMargin?: number; + + /** + * Gets or sets color of title on the X-axis + */ + xAxisTitleTextColor?: string; + + /** + * Gets or sets color of title on the Y-axis + */ + yAxisTitleTextColor?: string; + + /** + * Gets or sets CSS font property for labels on X-axis + */ + xAxisLabelTextStyle?: string; + + /** + * Gets or sets CSS font property for labels on Y-axis + */ + yAxisLabelTextStyle?: string; + + /** + * Gets or sets CSS font property for title on X-axis + */ + xAxisTitleTextStyle?: string; + + /** + * Gets or sets CSS font property for title on Y-axis + */ + yAxisTitleTextStyle?: string; + + /** + * Gets or sets the format for labels along the X-axis. + */ + xAxisLabel?: any; + + /** + * Gets or sets the format for labels along the Y-axis. + */ + yAxisLabel?: any; + + /** + * Gets or sets the color to apply to major gridlines along the X-axis. + */ + xAxisMajorStroke?: string; + + /** + * Gets or sets the color to apply to major gridlines along the Y-axis. + */ + yAxisMajorStroke?: string; + + /** + * Gets or sets the thickness to apply to major gridlines along the X-axis. + */ + xAxisMajorStrokeThickness?: number; + + /** + * Gets or sets the thickness to apply to major gridlines along the Y-axis. + */ + yAxisMajorStrokeThickness?: number; + + /** + * Gets or sets the thickness to apply to minor gridlines along the X-axis. + */ + xAxisMinorStrokeThickness?: number; + + /** + * Gets or sets the thickness to apply to minor gridlines along the Y-axis. + */ + yAxisMinorStrokeThickness?: number; + + /** + * Gets or sets the color to apply to stripes along the X-axis. + */ + xAxisStrip?: string; + + /** + * Gets or sets the color to apply to stripes along the Y-axis. + */ + yAxisStrip?: string; + + /** + * Gets or sets the color to apply to the X-axis line. + */ + xAxisStroke?: string; + + /** + * Gets or sets the color to apply to the Y-axis line. + */ + yAxisStroke?: string; + + /** + * Gets or sets the thickness to apply to the X-axis line. + */ + xAxisStrokeThickness?: number; + + /** + * Gets or sets the thickness to apply to the Y-axis line. + */ + yAxisStrokeThickness?: number; + + /** + * Gets or sets the length of tickmarks along the X-axis. + */ + xAxisTickLength?: number; + + /** + * Gets or sets the length of tickmarks along the Y-axis. + */ + yAxisTickLength?: number; + + /** + * Gets or sets the color to apply to tickmarks along the X-axis. + */ + xAxisTickStroke?: string; + + /** + * Gets or sets the color to apply to tickmarks along the Y-axis. + */ + yAxisTickStroke?: string; + + /** + * Gets or sets the thickness to apply to tickmarks along the X-axis. + */ + xAxisTickStrokeThickness?: number; + + /** + * Gets or sets the thickness to apply to tickmarks along the Y-axis. + */ + yAxisTickStrokeThickness?: number; + + /** + * Gets or sets the Text to display below the X-axis. + */ + xAxisTitle?: string; + + /** + * Gets or sets the Text to display to the left of the Y-axis. + */ + yAxisTitle?: string; + + /** + * Gets or sets the color to apply to minor gridlines along the X-axis. + */ + xAxisMinorStroke?: string; + + /** + * Gets or sets the color to apply to minor gridlines along the Y-axis. + */ + yAxisMinorStroke?: string; + + /** + * Gets or sets the angle of rotation for labels along the X-axis. + */ + xAxisLabelAngle?: number; + + /** + * Gets or sets the angle of rotation for labels along the Y-axis. + */ + yAxisLabelAngle?: number; + + /** + * Gets or sets the distance between the X-axis and the bottom of the chart. + */ + xAxisExtent?: number; + + /** + * Gets or sets the distance between the Y-axis and the left edge of the chart. + */ + yAxisExtent?: number; + + /** + * Gets or sets the angle of rotation for the X-axis title. + */ + xAxisTitleAngle?: number; + + /** + * Gets or sets the angle of rotation for the Y-axis title. + */ + yAxisTitleAngle?: number; + + /** + * Gets or sets whether to invert the direction of the X-axis by placing the first data items on the right side of the chart. + */ + xAxisInverted?: boolean; + + /** + * Gets or sets whether to invert the direction of the Y-axis by placing the minimum numeric value at the top of the chart. + */ + yAxisInverted?: boolean; + + /** + * Gets or sets Horizontal alignment of the X-axis title. + * + * Valid values: + * "left" Align the item to the left + * "center" Center the item + * "right" Align the item to the right + * "stretch" Stretch the item to the full width + */ + xAxisTitleAlignment?: string; + + /** + * Gets or sets Vertical alignment of the Y-axis title. + * + * Valid values: + * "top" Align the item to the top + * "center" Center the item + * "bottom" Align the item to the bottom + * "stretch" Stretch the item to the full height + */ + yAxisTitleAlignment?: string; + + /** + * Gets or sets Horizontal alignment of X-axis labels. + * + * Valid values: + * "left" Align the item to the left + * "center" Center the item + * "right" Align the item to the right + * "stretch" Stretch the item to the full width + */ + xAxisLabelHorizontalAlignment?: string; + + /** + * Gets or sets Horizontal alignment of Y-axis labels. + * + * Valid values: + * "left" Align the item to the left + * "center" Center the item + * "right" Align the item to the right + * "stretch" Stretch the item to the full width + */ + yAxisLabelHorizontalAlignment?: string; + + /** + * Gets or sets Vertical alignment of X-axis labels. + * + * Valid values: + * "top" Align the item to the top + * "center" Center the item + * "bottom" Align the item to the bottom + * "stretch" Stretch the item to the full height + */ + xAxisLabelVerticalAlignment?: string; + + /** + * Gets or sets Vertical alignment of Y-axis labels. + * + * Valid values: + * "top" Align the item to the top + * "center" Center the item + * "bottom" Align the item to the bottom + * "stretch" Stretch the item to the full height + */ + yAxisLabelVerticalAlignment?: string; + + /** + * Gets or sets Visibility of X-axis labels. + * + * Valid values: + * "visible" Display the element. + * "collapsed" Do not display the element. + */ + xAxisLabelVisibility?: string; + + /** + * Gets or sets Visibility of Y-axis labels. + * + * Valid values: + * "visible" Display the element. + * "collapsed" Do not display the element. + */ + yAxisLabelVisibility?: string; + + /** + * The location of Y-axis labels, relative to the plot area. + * + * Valid values: + * "outsideTop" Places the axis labels at the top, outside of the plotting area. + * "outsideBottom" Places the axis labels at the bottom, outside of the plotting area + * "outsideLeft" Places the axis labels to the left, outside of the plotting area. + * "outsideRight" Places the axis labels to the right, outside of the plotting area. + * "insideTop" Places the axis labels inside the plotting area above the axis line. + * "insideBottom" Places the axis labels inside the plotting area below the axis line. + * "insideLeft" Places the axis labels inside the plotting area and to the left of the axis line. + * "insideRight" Places the axis labels inside the plotting area and to the right of the axis line. + */ + yAxisLabelLocation?: string; + + /** + * Gets or sets the frequency of displayed labels along the X-axis. + * Gets or sets the set value is a factor that determines which labels will be hidden. For example, an interval of 2 will display every other label. + */ + xAxisInterval?: number; + + /** + * Gets or sets the frequency of displayed minor lines along the X-axis. + * Gets or sets the set value is a factor that determines how the minor lines will be displayed. + */ + xAxisMinorInterval?: number; + + /** + * Gets or sets the distance between each label and grid line along the Y-axis. + */ + yAxisInterval?: number; + + /** + * Gets or sets whether the Y-axis should use a logarithmic scale instead of a linear one. + * Since log(-1) is imaginary and log(0) is undefined, it is recommended to enable this property only when the Y-axis minimum is greater than zero. + */ + yAxisIsLogarithmic?: boolean; + + /** + * Gets or sets the base value to use in the log function when mapping the position of data items along the Y-axis. + * This property is effective only when YAxisIsLogarithmic is true. + */ + yAxisLogarithmBase?: number; + + /** + * Gets or sets the data value corresponding to the minimum value of the Y-axis. + */ + yAxisMinimumValue?: number; + + /** + * Gets or sets the data value corresponding to the maximum value of the Y-axis. + */ + yAxisMaximumValue?: number; + + /** + * Gets or sets the frequency of displayed minor lines along the Y-axis. + */ + yAxisMinorInterval?: number; + + /** + * Gets or sets whether the X-axis will use a logarithmic scale, instead of a linear one. + * Since log(-1) is imaginary and log(0) is undefined, it is recommended to enable this property only when the X-axis minimum is greater than zero. + */ + xAxisIsLogarithmic?: boolean; + + /** + * Gets or sets the base value to use in the log function when mapping the position of data items along the X-axis. + * This property is effective only when y-axis is logarithmic + */ + xAxisLogarithmBase?: number; + + /** + * Gets or sets the data value corresponding to the minimum value on the X-axis. + */ + xAxisMinimumValue?: number; + + /** + * Gets or sets the data value corresponding to the maximum value on the X-axis. + */ + xAxisMaximumValue?: number; + + /** + * Gets or sets whether the large numbers on the X-axis labels are abbreviated. + */ + xAxisAbbreviateLargeNumbers?: boolean; + + /** + * Gets or sets whether the large numbers on the Y-axis labels are abbreviated. + */ + yAxisAbbreviateLargeNumbers?: boolean; + + /** + * Gets or sets collision avoidance between markers on series that support this behaviour. + * + * Valid values: + * "none" Collision avoidance is disabled. + * "omit" Items colliding with other items will be hidden from view. + * "fade" Items colliding with other items will be partially hidden from view by reducing their opacity. + * "omitAndShift" Items colliding with other items will be either hidden from view or moved to new positions. + * "fadeAndShift" Items colliding with other items will be either partially hidden from view by reducing their opacity, or moved to new positions, or a combination of both. + */ + markerCollision?: string; + + /** + * Gets or sets the type of chart series to generate from the data. + * + * Valid values: + * "auto" Specifies automatic selection of chart type based on suggestion from internal Data Adapter + * "point" Specifies point chart with small markers at X/Y data + * "line" Specifies line chart with small markers at X/Y data and connected with lines + * "spline" Specifies spline chart with small markers at X/Y data and connected with splines + * "bubble" Specifies bubble chart with proportional markers at X/Y data + * "highDensity" Specifies high density chart with colored bitmap pixels at X/Y data based on density of nearby points + * "area" Specifies area chart with colored surface based on a triangulation of X/Y data with numeric values assigned to each point. + * "contour" Specifies area chart with colored lines based on a triangulation of X/Y data with numeric values assigned to each point. + * "polygon" Specifies polygon chart with polygons defined by X/Y data + * "polyline" Specifies polyline chart with polylines defined by X/Y data + */ + chartType?: string; + + /** + * The width of the chart. + */ + width?: number; + + /** + * The height of the chart. + */ + height?: number; + + /** + * Gets sets maximum number of displayed records in chart. + */ + maxRecCount?: number; + + /** + * Gets sets a valid data source. + * That can be instance of array or primitives, array of objects, instance of $.ig.DataSource, or any other data accepted by $.ig.DataSource. + * Note: if it is set to string and "dataSourceType" option is not set, then $.ig.JSONPDataSource is used. + */ + dataSource?: any; + + /** + * Gets sets data source type (such as "json", "xml", etc). Please refer to the documentation of $.ig.DataSource and its type property + */ + dataSourceType?: string; + + /** + * Gets sets url which is used for sending JSON on request for remote data. + */ + dataSourceUrl?: string; + + /** + * See $.ig.DataSource. property in the response specifying the total number of records on the server. + */ + responseTotalRecCountKey?: string; + + /** + * See $.ig.DataSource. This is basically the property in the responses where data records are held, if the response is wrapped. + */ + responseDataKey?: string; + + /** + * Event raised when a property value is changed on this chart + */ + propertyChanged?: PropertyChangedEvent; + + /** + * Event raised when a series is initialized and added to this chart. + */ + seriesAdded?: SeriesAddedEvent; + + /** + * Event raised when a series is removed from this chart. + */ + seriesRemoved?: SeriesRemovedEvent; + + /** + * Occurs when the pointer enters a Series. + */ + seriesPointerEnter?: SeriesPointerEnterEvent; + + /** + * Occurs when the pointer leaves a Series. + */ + seriesPointerLeave?: SeriesPointerLeaveEvent; + + /** + * Occurs when the pointer moves over a Series. + */ + seriesPointerMove?: SeriesPointerMoveEvent; + + /** + * Occurs when the pointer is pressed down over a Series. + */ + seriesPointerDown?: SeriesPointerDownEvent; + + /** + * Occurs when the pointer is released over a Series. + */ + seriesPointerUp?: SeriesPointerUpEvent; + + /** + * Event which is raised before data binding. + * Return false in order to cancel data binding. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.dataSource to obtain reference to instance of $.ig.DataSource. + */ + dataBinding?: DataBindingEvent; + + /** + * Event which is raised after data binding. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.data to obtain reference to array actual data which is displayed by chart. + * Use ui.dataSource to obtain reference to instance of $.ig.DataSource. + */ + dataBound?: DataBoundEvent; + + /** + * Event which is raised before tooltip is updated. + * Return false in order to cancel updating and hide tooltip. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.text to obtain html of tooltip. Value of that member can be modified. If modified value is null or empty string, then current content of tooltip keeps old value. + * Use ui.item to obtain reference to item. Value of that member can be modified or replaced by custom item. + * Use ui.x to obtain left position of tooltip in pixels relative to widget. Value of that member can be modified. + * Use ui.y to obtain top position of tooltip in pixels relative to widget. Value of that member can be modified. + * Use ui.element to obtain reference to jquery object which represents tooltip. Value of that member can be replaced by custom element. + */ + updateTooltip?: UpdateTooltipEvent; + + /** + * Event which is raised before tooltip is hidden. + * Return false in order to cancel hiding and keep tooltip visible. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.item to obtain reference to item. + * Use ui.element to obtain reference to jquery object which represents tooltip or value of ui.element from last updateTooltip event. Value of that member can be replaced by custom element. + */ + hideTooltip?: HideTooltipEvent; + + /** + * Option for igShapeChart + */ + [optionName: string]: any; +} +interface IgShapeChartMethods { + destroy(): void; + id(): void; + exportVisualData(): void; + + /** + * Find index of item within actual data used by chart. + * + * @param item The reference to item. + */ + findIndexOfItem(item: Object): number; + + /** + * Get item within actual data used by chart. That is similar to this.getData()[ index ]. + * + * @param index Index of data item. + */ + getDataItem(index: Object): Object; + + /** + * Get reference of actual data used by chart. + */ + getData(): any[]; + + /** + * Adds a new item to the data source and notifies the chart. + * + * @param item The item that we want to add to the data source. + */ + addItem(item: Object): Object; + + /** + * Inserts a new item to the data source and notifies the chart. + * + * @param item the new item that we want to insert in the data source. + * @param index The index in the data source where the new item will be inserted. + */ + insertItem(item: Object, index: number): Object; + + /** + * Deletes an item from the data source and notifies the chart. + * + * @param index The index in the data source from where the item will be been removed. + */ + removeItem(index: number): Object; + + /** + * Updates an item in the data source and notifies the chart. + * + * @param index The index of the item in the data source that we want to change. + * @param item The new item object that will be set in the data source. + */ + setItem(index: number, item: Object): Object; + + /** + * Notifies the chart that an item has been set in an associated data source. + * + * @param dataSource The data source in which the change happened. + * @param index The index in the items source that has been changed. + * @param newItem the new item that has been set in the collection. + * @param oldItem the old item that has been overwritten in the collection. + */ + notifySetItem(dataSource: Object, index: number, newItem: Object, oldItem: Object): Object; + + /** + * Notifies the chart that the items have been cleared from an associated data source. + * It's not necessary to notify more than one target of a change if they share the same items source. + * + * @param dataSource The data source in which the change happened. + */ + notifyClearItems(dataSource: Object): Object; + + /** + * Notifies the target axis or series that an item has been inserted at the specified index in its data source. + * It's not necessary to notify more than one target of a change if they share the same items source. + * + * @param dataSource The data source in which the change happened. + * @param index The index in the items source where the new item has been inserted. + * @param newItem the new item that has been set in the collection. + */ + notifyInsertItem(dataSource: Object, index: number, newItem: Object): Object; + + /** + * Notifies the target axis or series that an item has been removed from the specified index in its data source. + * It's not necessary to notify more than one target of a change if they share the same items source. + * + * @param dataSource The data source in which the change happened. + * @param index The index in the items source from where the old item has been removed. + * @param oldItem the old item that has been removed from the collection. + */ + notifyRemoveItem(dataSource: Object, index: number, oldItem: Object): Object; + + /** + * Get reference to chart object. + */ + chart(): Object; + + /** + * Binds data to the chart + */ + dataBind(): void; + + /** + * Forces any pending deferred work to render on the chart before continuing + */ + flush(): void; +} +interface JQuery { + data(propertyName: "igShapeChart"): IgShapeChartMethods; +} + +interface JQuery { + igShapeChart(methodName: "destroy"): void; + igShapeChart(methodName: "id"): void; + igShapeChart(methodName: "exportVisualData"): void; + igShapeChart(methodName: "findIndexOfItem", item: Object): number; + igShapeChart(methodName: "getDataItem", index: Object): Object; + igShapeChart(methodName: "getData"): any[]; + igShapeChart(methodName: "addItem", item: Object): Object; + igShapeChart(methodName: "insertItem", item: Object, index: number): Object; + igShapeChart(methodName: "removeItem", index: number): Object; + igShapeChart(methodName: "setItem", index: number, item: Object): Object; + igShapeChart(methodName: "notifySetItem", dataSource: Object, index: number, newItem: Object, oldItem: Object): Object; + igShapeChart(methodName: "notifyClearItems", dataSource: Object): Object; + igShapeChart(methodName: "notifyInsertItem", dataSource: Object, index: number, newItem: Object): Object; + igShapeChart(methodName: "notifyRemoveItem", dataSource: Object, index: number, oldItem: Object): Object; + igShapeChart(methodName: "chart"): Object; + igShapeChart(methodName: "dataBind"): void; + igShapeChart(methodName: "flush"): void; + + /** + * The triangulated file source URI or an instance of $.ig.ShapeDataSource. + */ + igShapeChart(optionLiteral: 'option', optionName: "shapeDataSource"): string; + + /** + * The triangulated file source URI or an instance of $.ig.ShapeDataSource. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "shapeDataSource", optionValue: string): void; + + /** + * String The database source URI. + */ + igShapeChart(optionLiteral: 'option', optionName: "databaseSource"): string; + + /** + * String The database source URI. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "databaseSource", optionValue: string): void; + + /** + * The triangulated file source URI or an instance of $.ig.TriangulationDataSource. + */ + igShapeChart(optionLiteral: 'option', optionName: "triangulationDataSource"): string; + + /** + * The triangulated file source URI or an instance of $.ig.TriangulationDataSource. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "triangulationDataSource", optionValue: string): void; + + /** + * Gets the id of a template element to use for tooltips, or markup representing the tooltip template. + */ + igShapeChart(optionLiteral: 'option', optionName: "tooltipTemplate"): any; + + /** + * Sets the id of a template element to use for tooltips, or markup representing the tooltip template. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "tooltipTemplate", optionValue: any): void; + + /** + * Gets the names of tooltip templates + */ + igShapeChart(optionLiteral: 'option', optionName: "tooltipTemplates"): any; + + /** + * Sets the names of tooltip templates + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "tooltipTemplates", optionValue: any): void; + + /** + * Gets the left margin of chart title + */ + igShapeChart(optionLiteral: 'option', optionName: "titleLeftMargin"): number; + + /** + * Sets the left margin of chart title + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "titleLeftMargin", optionValue: number): void; + + /** + * Gets the right margin of chart title + */ + igShapeChart(optionLiteral: 'option', optionName: "titleRightMargin"): number; + + /** + * Sets the right margin of chart title + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "titleRightMargin", optionValue: number): void; + + /** + * Gets the top margin of chart title + */ + igShapeChart(optionLiteral: 'option', optionName: "titleTopMargin"): number; + + /** + * Sets the top margin of chart title + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "titleTopMargin", optionValue: number): void; + + /** + * Gets the bottom margin of chart title + */ + igShapeChart(optionLiteral: 'option', optionName: "titleBottomMargin"): number; + + /** + * Sets the bottom margin of chart title + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "titleBottomMargin", optionValue: number): void; + + /** + * Gets the left margin of chart subtitle + */ + igShapeChart(optionLiteral: 'option', optionName: "subtitleLeftMargin"): number; + + /** + * Sets the left margin of chart subtitle + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "subtitleLeftMargin", optionValue: number): void; + + /** + * Gets the top margin of chart subtitle + */ + igShapeChart(optionLiteral: 'option', optionName: "subtitleTopMargin"): number; + + /** + * Sets the top margin of chart subtitle + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "subtitleTopMargin", optionValue: number): void; + + /** + * Gets the right margin of chart subtitle + */ + igShapeChart(optionLiteral: 'option', optionName: "subtitleRightMargin"): number; + + /** + * Sets the right margin of chart subtitle + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "subtitleRightMargin", optionValue: number): void; + + /** + * Gets the bottom margin of chart subtitle + */ + igShapeChart(optionLiteral: 'option', optionName: "subtitleBottomMargin"): number; + + /** + * Sets the bottom margin of chart subtitle + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "subtitleBottomMargin", optionValue: number): void; + + /** + * Gets color of chart subtitle + */ + igShapeChart(optionLiteral: 'option', optionName: "subtitleTextColor"): string; + + /** + * Sets color of chart subtitle + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "subtitleTextColor", optionValue: string): void; + + /** + * Gets color of chart title + */ + igShapeChart(optionLiteral: 'option', optionName: "titleTextColor"): string; + + /** + * Sets color of chart title + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "titleTextColor", optionValue: string): void; + + /** + * Gets the left margin of the chart content. + */ + igShapeChart(optionLiteral: 'option', optionName: "leftMargin"): number; + + /** + * Sets the left margin of the chart content. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "leftMargin", optionValue: number): void; + + /** + * Gets the top margin of the chart content. + */ + igShapeChart(optionLiteral: 'option', optionName: "topMargin"): number; + + /** + * Sets the top margin of the chart content. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "topMargin", optionValue: number): void; + + /** + * Gets the right margin of the chart content. + */ + igShapeChart(optionLiteral: 'option', optionName: "rightMargin"): number; + + /** + * Sets the right margin of the chart content. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "rightMargin", optionValue: number): void; + + /** + * Gets the bottom margin around the chart content. + */ + igShapeChart(optionLiteral: 'option', optionName: "bottomMargin"): number; + + /** + * Sets the bottom margin around the chart content. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "bottomMargin", optionValue: number): void; + + /** + * Gets the duration used for animating series plots when the data is changing + */ + igShapeChart(optionLiteral: 'option', optionName: "transitionDuration"): number; + + /** + * Sets the duration used for animating series plots when the data is changing + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "transitionDuration", optionValue: number): void; + + /** + * Gets the easing function used for animating series plots when the data is changing. + * This can be set to one of the known values "linear" or "cubic," or it can be set to an easing function which takes a single numeric parameter and returns a number. + */ + igShapeChart(optionLiteral: 'option', optionName: "transitionEasingFunction"): any; + + /** + * Sets the easing function used for animating series plots when the data is changing. + * This can be set to one of the known values "linear" or "cubic," or it can be set to an easing function which takes a single numeric parameter and returns a number. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "transitionEasingFunction", optionValue: any): void; + + /** + * Gets a function for creating wrapped tooltip + */ + igShapeChart(optionLiteral: 'option', optionName: "createWrappedTooltip"): any; + + /** + * Sets a function for creating wrapped tooltip + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "createWrappedTooltip", optionValue: any): void; + + /** + * Gets the widget of this control + */ + igShapeChart(optionLiteral: 'option', optionName: "widget"): any; + + /** + * Sets the widget of this control + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "widget", optionValue: any): void; + + /** + * Gets CSS font property for the chart subtitle + */ + igShapeChart(optionLiteral: 'option', optionName: "subtitleTextStyle"): string; + + /** + * Sets CSS font property for the chart subtitle + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "subtitleTextStyle", optionValue: string): void; + + /** + * Gets CSS font property for the chart title + */ + igShapeChart(optionLiteral: 'option', optionName: "titleTextStyle"): string; + + /** + * Sets CSS font property for the chart title + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "titleTextStyle", optionValue: string): void; + + /** + * Gets a collection of data items used to generate the chart. + * The ItemsSource of this chart can be a list of objects containing one or more numeric properties. + * Additionally, if the objects in the list implement the IEnumerable interface, + * the Chart will attempt to delve into the sub-collections when reading through the data source. + * Databinding can be further configured by attributing the data item classes + * with the DataSeriesMemberIntentAttribute. + */ + igShapeChart(optionLiteral: 'option', optionName: "itemsSource"): any; + + /** + * Sets a collection of data items used to generate the chart. + * The ItemsSource of this chart can be a list of objects containing one or more numeric properties. + * Additionally, if the objects in the list implement the IEnumerable interface, + * the Chart will attempt to delve into the sub-collections when reading through the data source. + * Databinding can be further configured by attributing the data item classes + * with the DataSeriesMemberIntentAttribute. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "itemsSource", optionValue: any): void; + + /** + * Gets a set of property paths that should be included for consideration by the category chart, leaving the remainder excluded. If null, all properties will be considered. + */ + igShapeChart(optionLiteral: 'option', optionName: "includedProperties"): any; + + /** + * Sets a set of property paths that should be included for consideration by the category chart, leaving the remainder excluded. If null, all properties will be considered. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "includedProperties", optionValue: any): void; + + /** + * Gets a set of property paths that should be excluded from consideration by the category chart. + */ + igShapeChart(optionLiteral: 'option', optionName: "excludedProperties"): any; + + /** + * Sets a set of property paths that should be excluded from consideration by the category chart. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "excludedProperties", optionValue: any): void; + + /** + * Gets the palette of brushes to use for coloring the chart series. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igShapeChart(optionLiteral: 'option', optionName: "brushes"): any; + + /** + * Sets the palette of brushes to use for coloring the chart series. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "brushes", optionValue: any): void; + + /** + * Gets the palette of brushes to use for outlines on the chart series. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igShapeChart(optionLiteral: 'option', optionName: "outlines"): any; + + /** + * Sets the palette of brushes to use for outlines on the chart series. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "outlines", optionValue: any): void; + + /** + * Gets the legend to connect this chart to. + * When the legend property is set, the chart will use it to display information about its series. Legends can be shared by multiple chart controls. + */ + igShapeChart(optionLiteral: 'option', optionName: "legend"): any; + + /** + * Sets the legend to connect this chart to. + * When the legend property is set, the chart will use it to display information about its series. Legends can be shared by multiple chart controls. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "legend", optionValue: any): void; + + /** + * Gets whether the chart can be horizontally zoomed through user interactions. + */ + igShapeChart(optionLiteral: 'option', optionName: "isHorizontalZoomEnabled"): boolean; + + /** + * Sets whether the chart can be horizontally zoomed through user interactions. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "isHorizontalZoomEnabled", optionValue: boolean): void; + + /** + * Gets whether the chart can be vertically zoomed through user interactions. + */ + igShapeChart(optionLiteral: 'option', optionName: "isVerticalZoomEnabled"): boolean; + + /** + * Sets whether the chart can be vertically zoomed through user interactions. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "isVerticalZoomEnabled", optionValue: boolean): void; + + /** + * Gets the rectangle representing the current scroll and zoom state of the chart. + * WindowRect is expressed as a Rectangle with coordinates and sizes between 0 and 1. + * The provided object should have numeric properties called left, top, width and height. + */ + igShapeChart(optionLiteral: 'option', optionName: "windowRect"): any; + + /** + * Sets the rectangle representing the current scroll and zoom state of the chart. + * WindowRect is expressed as a Rectangle with coordinates and sizes between 0 and 1. + * The provided object should have numeric properties called left, top, width and height. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "windowRect", optionValue: any): void; + + /** + * Gets text to display above the plot area. + */ + igShapeChart(optionLiteral: 'option', optionName: "title"): string; + + /** + * Sets text to display above the plot area. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "title", optionValue: string): void; + + /** + * Gets text to display below the Title, above the plot area. + */ + igShapeChart(optionLiteral: 'option', optionName: "subtitle"): string; + + /** + * Sets text to display below the Title, above the plot area. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "subtitle", optionValue: string): void; + + /** + * Gets horizontal alignment which determines the title position, relative to the left and right edges of the control. + */ + + igShapeChart(optionLiteral: 'option', optionName: "titleAlignment"): string; + + /** + * Sets horizontal alignment which determines the title position, relative to the left and right edges of the control. + * + * @optionValue New value to be set. + */ + + igShapeChart(optionLiteral: 'option', optionName: "titleAlignment", optionValue: string): void; + + /** + * Gets horizontal alignment which determines the subtitle position, relative to the left and right edges of the control. + */ + + igShapeChart(optionLiteral: 'option', optionName: "subtitleAlignment"): string; + + /** + * Sets horizontal alignment which determines the subtitle position, relative to the left and right edges of the control. + * + * @optionValue New value to be set. + */ + + igShapeChart(optionLiteral: 'option', optionName: "subtitleAlignment", optionValue: string): void; + + /** + * Gets the behavior that determines how unknown values will be plotted on the chart.Null and Double.NaN are two examples of unknown values. + * + */ + + igShapeChart(optionLiteral: 'option', optionName: "unknownValuePlotting"): string; + + /** + * Sets the behavior that determines how unknown values will be plotted on the chart.Null and Double.NaN are two examples of unknown values. + * + * + * @optionValue New value to be set. + */ + + igShapeChart(optionLiteral: 'option', optionName: "unknownValuePlotting", optionValue: string): void; + + /** + * Gets the rendering resolution for all series in this chart. + * Where n = Resolution, for every n horizontal pixels, combine all items into a single datapoint. When Resolution = 0, all datapoints will be rendered as graphical objects. Charts with a higher resolution will have faster performance. + */ + igShapeChart(optionLiteral: 'option', optionName: "resolution"): number; + + /** + * Sets the rendering resolution for all series in this chart. + * Where n = Resolution, for every n horizontal pixels, combine all items into a single datapoint. When Resolution = 0, all datapoints will be rendered as graphical objects. Charts with a higher resolution will have faster performance. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "resolution", optionValue: number): void; + + /** + * Gets the thickness for all series in this chart. Depending on the ChartType, this can be the main brush used, or just the outline. + */ + igShapeChart(optionLiteral: 'option', optionName: "thickness"): number; + + /** + * Sets the thickness for all series in this chart. Depending on the ChartType, this can be the main brush used, or just the outline. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "thickness", optionValue: number): void; + + /** + * Gets the marker shapes used for indicating location of data points in this chart. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + */ + igShapeChart(optionLiteral: 'option', optionName: "markerTypes"): any; + + /** + * Sets the marker shapes used for indicating location of data points in this chart. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "markerTypes", optionValue: any): void; + + /** + * Gets the palette of brushes used for rendering fill area of data point markers. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igShapeChart(optionLiteral: 'option', optionName: "markerBrushes"): any; + + /** + * Sets the palette of brushes used for rendering fill area of data point markers. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "markerBrushes", optionValue: any): void; + + /** + * Gets the palette of brushes used for rendering outlines of data point markers. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igShapeChart(optionLiteral: 'option', optionName: "markerOutlines"): any; + + /** + * Sets the palette of brushes used for rendering outlines of data point markers. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "markerOutlines", optionValue: any): void; + + /** + * Gets the maximum number of markers displyed in the plot area of the chart. + */ + igShapeChart(optionLiteral: 'option', optionName: "markerMaxCount"): number; + + /** + * Sets the maximum number of markers displyed in the plot area of the chart. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "markerMaxCount", optionValue: number): void; + + /** + * Gets the palette of brushes to used for coloring trend lines in this chart. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igShapeChart(optionLiteral: 'option', optionName: "trendLineBrushes"): any; + + /** + * Sets the palette of brushes to used for coloring trend lines in this chart. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "trendLineBrushes", optionValue: any): void; + + /** + * Gets the formula used for calculating trend lines in this chart.This property applies only to these chart types: point, line, spline, and bubble + * + */ + + igShapeChart(optionLiteral: 'option', optionName: "trendLineType"): string; + + /** + * Sets the formula used for calculating trend lines in this chart.This property applies only to these chart types: point, line, spline, and bubble + * + * + * @optionValue New value to be set. + */ + + igShapeChart(optionLiteral: 'option', optionName: "trendLineType", optionValue: string): void; + + /** + * Gets the thickness of the trend lines in this chart. + * This property applies only to these chart types: point, line, spline, and bubble + */ + igShapeChart(optionLiteral: 'option', optionName: "trendLineThickness"): number; + + /** + * Sets the thickness of the trend lines in this chart. + * This property applies only to these chart types: point, line, spline, and bubble + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "trendLineThickness", optionValue: number): void; + + /** + * Gets a value indicating whether grid and tick lines are aligned to device pixels. + */ + igShapeChart(optionLiteral: 'option', optionName: "alignsGridLinesToPixels"): boolean; + + /** + * Sets a value indicating whether grid and tick lines are aligned to device pixels. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "alignsGridLinesToPixels", optionValue: boolean): void; + igShapeChart(optionLiteral: 'option', optionName: "trendLinePeriod"): number; + igShapeChart(optionLiteral: 'option', optionName: "trendLinePeriod", optionValue: number): void; + + /** + * Gets function which takes an context object and returns a formatted label for the X-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisFormatLabel"): any; + + /** + * Sets function which takes an context object and returns a formatted label for the X-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisFormatLabel", optionValue: any): void; + + /** + * Gets function which takes a context object and returns a formatted label for the Y-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisFormatLabel"): any; + + /** + * Sets function which takes a context object and returns a formatted label for the Y-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisFormatLabel", optionValue: any): void; + + /** + * Gets the left margin of labels on the X-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabelLeftMargin"): number; + + /** + * Sets the left margin of labels on the X-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabelLeftMargin", optionValue: number): void; + + /** + * Gets the top margin of labels on the X-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabelTopMargin"): number; + + /** + * Sets the top margin of labels on the X-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabelTopMargin", optionValue: number): void; + + /** + * Gets the right margin of labels on the X-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabelRightMargin"): number; + + /** + * Sets the right margin of labels on the X-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabelRightMargin", optionValue: number): void; + + /** + * Gets the bottom margin of labels on the X-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabelBottomMargin"): number; + + /** + * Sets the bottom margin of labels on the X-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabelBottomMargin", optionValue: number): void; + + /** + * Gets the left margin of labels on the Y-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelLeftMargin"): number; + + /** + * Sets the left margin of labels on the Y-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelLeftMargin", optionValue: number): void; + + /** + * Gets the top margin of labels on the Y-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelTopMargin"): number; + + /** + * Sets the top margin of labels on the Y-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelTopMargin", optionValue: number): void; + + /** + * Gets the right margin of labels on the Y-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelRightMargin"): number; + + /** + * Sets the right margin of labels on the Y-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelRightMargin", optionValue: number): void; + + /** + * Gets the bottom margin of labels on the Y-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelBottomMargin"): number; + + /** + * Sets the bottom margin of labels on the Y-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelBottomMargin", optionValue: number): void; + + /** + * Gets color of labels on the X-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabelTextColor"): string; + + /** + * Sets color of labels on the X-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabelTextColor", optionValue: string): void; + + /** + * Gets color of labels on the Y-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelTextColor"): string; + + /** + * Sets color of labels on the Y-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelTextColor", optionValue: string): void; + + /** + * Gets the margin around a title on the X-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTitleMargin"): number; + + /** + * Sets the margin around a title on the X-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTitleMargin", optionValue: number): void; + + /** + * Gets the margin around a title on the Y-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTitleMargin"): number; + + /** + * Sets the margin around a title on the Y-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTitleMargin", optionValue: number): void; + + /** + * Gets the left margin of a title on the X-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTitleLeftMargin"): number; + + /** + * Sets the left margin of a title on the X-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTitleLeftMargin", optionValue: number): void; + + /** + * Gets the left margin of a title on the Y-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTitleLeftMargin"): number; + + /** + * Sets the left margin of a title on the Y-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTitleLeftMargin", optionValue: number): void; + + /** + * Gets the top margin of a title on the X-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTitleTopMargin"): number; + + /** + * Sets the top margin of a title on the X-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTitleTopMargin", optionValue: number): void; + + /** + * Gets the top margin of a title on the Y-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTitleTopMargin"): number; + + /** + * Sets the top margin of a title on the Y-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTitleTopMargin", optionValue: number): void; + + /** + * Gets the right margin of a title on the X-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTitleRightMargin"): number; + + /** + * Sets the right margin of a title on the X-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTitleRightMargin", optionValue: number): void; + + /** + * Gets the right margin of a title on the Y-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTitleRightMargin"): number; + + /** + * Sets the right margin of a title on the Y-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTitleRightMargin", optionValue: number): void; + + /** + * Gets the bottom margin of a title on the X-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTitleBottomMargin"): number; + + /** + * Sets the bottom margin of a title on the X-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTitleBottomMargin", optionValue: number): void; + + /** + * Gets the bottom margin of a title on the Y-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTitleBottomMargin"): number; + + /** + * Sets the bottom margin of a title on the Y-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTitleBottomMargin", optionValue: number): void; + + /** + * Gets color of title on the X-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTitleTextColor"): string; + + /** + * Sets color of title on the X-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTitleTextColor", optionValue: string): void; + + /** + * Gets color of title on the Y-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTitleTextColor"): string; + + /** + * Sets color of title on the Y-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTitleTextColor", optionValue: string): void; + + /** + * Gets CSS font property for labels on X-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabelTextStyle"): string; + + /** + * Sets CSS font property for labels on X-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabelTextStyle", optionValue: string): void; + + /** + * Gets CSS font property for labels on Y-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelTextStyle"): string; + + /** + * Sets CSS font property for labels on Y-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelTextStyle", optionValue: string): void; + + /** + * Gets CSS font property for title on X-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTitleTextStyle"): string; + + /** + * Sets CSS font property for title on X-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTitleTextStyle", optionValue: string): void; + + /** + * Gets CSS font property for title on Y-axis + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTitleTextStyle"): string; + + /** + * Sets CSS font property for title on Y-axis + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTitleTextStyle", optionValue: string): void; + + /** + * Gets the format for labels along the X-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabel"): any; + + /** + * Sets the format for labels along the X-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabel", optionValue: any): void; + + /** + * Gets the format for labels along the Y-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabel"): any; + + /** + * Sets the format for labels along the Y-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabel", optionValue: any): void; + + /** + * Gets the color to apply to major gridlines along the X-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisMajorStroke"): string; + + /** + * Sets the color to apply to major gridlines along the X-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisMajorStroke", optionValue: string): void; + + /** + * Gets the color to apply to major gridlines along the Y-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisMajorStroke"): string; + + /** + * Sets the color to apply to major gridlines along the Y-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisMajorStroke", optionValue: string): void; + + /** + * Gets the thickness to apply to major gridlines along the X-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisMajorStrokeThickness"): number; + + /** + * Sets the thickness to apply to major gridlines along the X-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisMajorStrokeThickness", optionValue: number): void; + + /** + * Gets the thickness to apply to major gridlines along the Y-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisMajorStrokeThickness"): number; + + /** + * Sets the thickness to apply to major gridlines along the Y-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisMajorStrokeThickness", optionValue: number): void; + + /** + * Gets the thickness to apply to minor gridlines along the X-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisMinorStrokeThickness"): number; + + /** + * Sets the thickness to apply to minor gridlines along the X-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisMinorStrokeThickness", optionValue: number): void; + + /** + * Gets the thickness to apply to minor gridlines along the Y-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisMinorStrokeThickness"): number; + + /** + * Sets the thickness to apply to minor gridlines along the Y-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisMinorStrokeThickness", optionValue: number): void; + + /** + * Gets the color to apply to stripes along the X-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisStrip"): string; + + /** + * Sets the color to apply to stripes along the X-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisStrip", optionValue: string): void; + + /** + * Gets the color to apply to stripes along the Y-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisStrip"): string; + + /** + * Sets the color to apply to stripes along the Y-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisStrip", optionValue: string): void; + + /** + * Gets the color to apply to the X-axis line. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisStroke"): string; + + /** + * Sets the color to apply to the X-axis line. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisStroke", optionValue: string): void; + + /** + * Gets the color to apply to the Y-axis line. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisStroke"): string; + + /** + * Sets the color to apply to the Y-axis line. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisStroke", optionValue: string): void; + + /** + * Gets the thickness to apply to the X-axis line. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisStrokeThickness"): number; + + /** + * Sets the thickness to apply to the X-axis line. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisStrokeThickness", optionValue: number): void; + + /** + * Gets the thickness to apply to the Y-axis line. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisStrokeThickness"): number; + + /** + * Sets the thickness to apply to the Y-axis line. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisStrokeThickness", optionValue: number): void; + + /** + * Gets the length of tickmarks along the X-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTickLength"): number; + + /** + * Sets the length of tickmarks along the X-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTickLength", optionValue: number): void; + + /** + * Gets the length of tickmarks along the Y-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTickLength"): number; + + /** + * Sets the length of tickmarks along the Y-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTickLength", optionValue: number): void; + + /** + * Gets the color to apply to tickmarks along the X-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTickStroke"): string; + + /** + * Sets the color to apply to tickmarks along the X-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTickStroke", optionValue: string): void; + + /** + * Gets the color to apply to tickmarks along the Y-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTickStroke"): string; + + /** + * Sets the color to apply to tickmarks along the Y-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTickStroke", optionValue: string): void; + + /** + * Gets the thickness to apply to tickmarks along the X-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTickStrokeThickness"): number; + + /** + * Sets the thickness to apply to tickmarks along the X-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTickStrokeThickness", optionValue: number): void; + + /** + * Gets the thickness to apply to tickmarks along the Y-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTickStrokeThickness"): number; + + /** + * Sets the thickness to apply to tickmarks along the Y-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTickStrokeThickness", optionValue: number): void; + + /** + * Gets the Text to display below the X-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTitle"): string; + + /** + * Sets the Text to display below the X-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTitle", optionValue: string): void; + + /** + * Gets the Text to display to the left of the Y-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTitle"): string; + + /** + * Sets the Text to display to the left of the Y-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTitle", optionValue: string): void; + + /** + * Gets the color to apply to minor gridlines along the X-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisMinorStroke"): string; + + /** + * Sets the color to apply to minor gridlines along the X-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisMinorStroke", optionValue: string): void; + + /** + * Gets the color to apply to minor gridlines along the Y-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisMinorStroke"): string; + + /** + * Sets the color to apply to minor gridlines along the Y-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisMinorStroke", optionValue: string): void; + + /** + * Gets the angle of rotation for labels along the X-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabelAngle"): number; + + /** + * Sets the angle of rotation for labels along the X-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabelAngle", optionValue: number): void; + + /** + * Gets the angle of rotation for labels along the Y-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelAngle"): number; + + /** + * Sets the angle of rotation for labels along the Y-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelAngle", optionValue: number): void; + + /** + * Gets the distance between the X-axis and the bottom of the chart. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisExtent"): number; + + /** + * Sets the distance between the X-axis and the bottom of the chart. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisExtent", optionValue: number): void; + + /** + * Gets the distance between the Y-axis and the left edge of the chart. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisExtent"): number; + + /** + * Sets the distance between the Y-axis and the left edge of the chart. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisExtent", optionValue: number): void; + + /** + * Gets the angle of rotation for the X-axis title. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTitleAngle"): number; + + /** + * Sets the angle of rotation for the X-axis title. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisTitleAngle", optionValue: number): void; + + /** + * Gets the angle of rotation for the Y-axis title. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTitleAngle"): number; + + /** + * Sets the angle of rotation for the Y-axis title. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisTitleAngle", optionValue: number): void; + + /** + * Gets whether to invert the direction of the X-axis by placing the first data items on the right side of the chart. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisInverted"): boolean; + + /** + * Sets whether to invert the direction of the X-axis by placing the first data items on the right side of the chart. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisInverted", optionValue: boolean): void; + + /** + * Gets whether to invert the direction of the Y-axis by placing the minimum numeric value at the top of the chart. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisInverted"): boolean; + + /** + * Sets whether to invert the direction of the Y-axis by placing the minimum numeric value at the top of the chart. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisInverted", optionValue: boolean): void; + + /** + * Gets Horizontal alignment of the X-axis title. + */ + + igShapeChart(optionLiteral: 'option', optionName: "xAxisTitleAlignment"): string; + + /** + * Sets Horizontal alignment of the X-axis title. + * + * @optionValue New value to be set. + */ + + igShapeChart(optionLiteral: 'option', optionName: "xAxisTitleAlignment", optionValue: string): void; + + /** + * Gets Vertical alignment of the Y-axis title. + */ + + igShapeChart(optionLiteral: 'option', optionName: "yAxisTitleAlignment"): string; + + /** + * Sets Vertical alignment of the Y-axis title. + * + * @optionValue New value to be set. + */ + + igShapeChart(optionLiteral: 'option', optionName: "yAxisTitleAlignment", optionValue: string): void; + + /** + * Gets Horizontal alignment of X-axis labels. + */ + + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabelHorizontalAlignment"): string; + + /** + * Sets Horizontal alignment of X-axis labels. + * + * @optionValue New value to be set. + */ + + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabelHorizontalAlignment", optionValue: string): void; + + /** + * Gets Horizontal alignment of Y-axis labels. + */ + + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelHorizontalAlignment"): string; + + /** + * Sets Horizontal alignment of Y-axis labels. + * + * @optionValue New value to be set. + */ + + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelHorizontalAlignment", optionValue: string): void; + + /** + * Gets Vertical alignment of X-axis labels. + */ + + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabelVerticalAlignment"): string; + + /** + * Sets Vertical alignment of X-axis labels. + * + * @optionValue New value to be set. + */ + + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabelVerticalAlignment", optionValue: string): void; + + /** + * Gets Vertical alignment of Y-axis labels. + */ + + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelVerticalAlignment"): string; + + /** + * Sets Vertical alignment of Y-axis labels. + * + * @optionValue New value to be set. + */ + + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelVerticalAlignment", optionValue: string): void; + + /** + * Gets Visibility of X-axis labels. + */ + + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabelVisibility"): string; + + /** + * Sets Visibility of X-axis labels. + * + * @optionValue New value to be set. + */ + + igShapeChart(optionLiteral: 'option', optionName: "xAxisLabelVisibility", optionValue: string): void; + + /** + * Gets Visibility of Y-axis labels. + */ + + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelVisibility"): string; + + /** + * Sets Visibility of Y-axis labels. + * + * @optionValue New value to be set. + */ + + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelVisibility", optionValue: string): void; + + /** + * The location of Y-axis labels, relative to the plot area. + */ + + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelLocation"): string; + + /** + * The location of Y-axis labels, relative to the plot area. + * + * @optionValue New value to be set. + */ + + igShapeChart(optionLiteral: 'option', optionName: "yAxisLabelLocation", optionValue: string): void; + + /** + * Gets the frequency of displayed labels along the X-axis. + * Gets the set value is a factor that determines which labels will be hidden. For example, an interval of 2 will display every other label. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisInterval"): number; + + /** + * Sets the frequency of displayed labels along the X-axis. + * sets the set value is a factor that determines which labels will be hidden. For example, an interval of 2 will display every other label. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisInterval", optionValue: number): void; + + /** + * Gets the frequency of displayed minor lines along the X-axis. + * Gets the set value is a factor that determines how the minor lines will be displayed. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisMinorInterval"): number; + + /** + * Sets the frequency of displayed minor lines along the X-axis. + * sets the set value is a factor that determines how the minor lines will be displayed. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisMinorInterval", optionValue: number): void; + + /** + * Gets the distance between each label and grid line along the Y-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisInterval"): number; + + /** + * Sets the distance between each label and grid line along the Y-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisInterval", optionValue: number): void; + + /** + * Gets whether the Y-axis should use a logarithmic scale instead of a linear one. + * Since log(-1) is imaginary and log(0) is undefined, it is recommended to enable this property only when the Y-axis minimum is greater than zero. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisIsLogarithmic"): boolean; + + /** + * Sets whether the Y-axis should use a logarithmic scale instead of a linear one. + * Since log(-1) is imaginary and log(0) is undefined, it is recommended to enable this property only when the Y-axis minimum is greater than zero. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisIsLogarithmic", optionValue: boolean): void; + + /** + * Gets the base value to use in the log function when mapping the position of data items along the Y-axis. + * This property is effective only when YAxisIsLogarithmic is true. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisLogarithmBase"): number; + + /** + * Sets the base value to use in the log function when mapping the position of data items along the Y-axis. + * This property is effective only when YAxisIsLogarithmic is true. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisLogarithmBase", optionValue: number): void; + + /** + * Gets the data value corresponding to the minimum value of the Y-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisMinimumValue"): number; + + /** + * Sets the data value corresponding to the minimum value of the Y-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisMinimumValue", optionValue: number): void; + + /** + * Gets the data value corresponding to the maximum value of the Y-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisMaximumValue"): number; + + /** + * Sets the data value corresponding to the maximum value of the Y-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisMaximumValue", optionValue: number): void; + + /** + * Gets the frequency of displayed minor lines along the Y-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisMinorInterval"): number; + + /** + * Sets the frequency of displayed minor lines along the Y-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisMinorInterval", optionValue: number): void; + + /** + * Gets whether the X-axis will use a logarithmic scale, instead of a linear one. + * Since log(-1) is imaginary and log(0) is undefined, it is recommended to enable this property only when the X-axis minimum is greater than zero. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisIsLogarithmic"): boolean; + + /** + * Sets whether the X-axis will use a logarithmic scale, instead of a linear one. + * Since log(-1) is imaginary and log(0) is undefined, it is recommended to enable this property only when the X-axis minimum is greater than zero. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisIsLogarithmic", optionValue: boolean): void; + + /** + * Gets the base value to use in the log function when mapping the position of data items along the X-axis. + * This property is effective only when y-axis is logarithmic + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisLogarithmBase"): number; + + /** + * Sets the base value to use in the log function when mapping the position of data items along the X-axis. + * This property is effective only when y-axis is logarithmic + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisLogarithmBase", optionValue: number): void; + + /** + * Gets the data value corresponding to the minimum value on the X-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisMinimumValue"): number; + + /** + * Sets the data value corresponding to the minimum value on the X-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisMinimumValue", optionValue: number): void; + + /** + * Gets the data value corresponding to the maximum value on the X-axis. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisMaximumValue"): number; + + /** + * Sets the data value corresponding to the maximum value on the X-axis. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisMaximumValue", optionValue: number): void; + + /** + * Gets whether the large numbers on the X-axis labels are abbreviated. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisAbbreviateLargeNumbers"): boolean; + + /** + * Sets whether the large numbers on the X-axis labels are abbreviated. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "xAxisAbbreviateLargeNumbers", optionValue: boolean): void; + + /** + * Gets whether the large numbers on the Y-axis labels are abbreviated. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisAbbreviateLargeNumbers"): boolean; + + /** + * Sets whether the large numbers on the Y-axis labels are abbreviated. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "yAxisAbbreviateLargeNumbers", optionValue: boolean): void; + + /** + * Gets collision avoidance between markers on series that support this behaviour. + */ + + igShapeChart(optionLiteral: 'option', optionName: "markerCollision"): string; + + /** + * Sets collision avoidance between markers on series that support this behaviour. + * + * @optionValue New value to be set. + */ + + igShapeChart(optionLiteral: 'option', optionName: "markerCollision", optionValue: string): void; + + /** + * Gets the type of chart series to generate from the data. + */ + + igShapeChart(optionLiteral: 'option', optionName: "chartType"): string; + + /** + * Sets the type of chart series to generate from the data. + * + * @optionValue New value to be set. + */ + + igShapeChart(optionLiteral: 'option', optionName: "chartType", optionValue: string): void; + + /** + * The width of the chart. + */ + igShapeChart(optionLiteral: 'option', optionName: "width"): number; + + /** + * The width of the chart. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "width", optionValue: number): void; + + /** + * The height of the chart. + */ + igShapeChart(optionLiteral: 'option', optionName: "height"): number; + + /** + * The height of the chart. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "height", optionValue: number): void; + + /** + * Gets maximum number of displayed records in chart. + */ + igShapeChart(optionLiteral: 'option', optionName: "maxRecCount"): number; + + /** + * Sets maximum number of displayed records in chart. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "maxRecCount", optionValue: number): void; + + /** + * Gets a valid data source. + * That can be instance of array or primitives, array of objects, instance of $.ig.DataSource, or any other data accepted by $.ig.DataSource. + * Note: if it is set to string and "dataSourceType" option is not set, then $.ig.JSONPDataSource is used. + */ + igShapeChart(optionLiteral: 'option', optionName: "dataSource"): any; + + /** + * Sets a valid data source. + * That can be instance of array or primitives, array of objects, instance of $.ig.DataSource, or any other data accepted by $.ig.DataSource. + * Note: if it is set to string and "dataSourceType" option is not set, then $.ig.JSONPDataSource is used. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "dataSource", optionValue: any): void; + + /** + * Gets data source type (such as "json", "xml", etc). Please refer to the documentation of $.ig.DataSource and its type property + */ + igShapeChart(optionLiteral: 'option', optionName: "dataSourceType"): string; + + /** + * Sets data source type (such as "json", "xml", etc). Please refer to the documentation of $.ig.DataSource and its type property + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "dataSourceType", optionValue: string): void; + + /** + * Gets url which is used for sending JSON on request for remote data. + */ + igShapeChart(optionLiteral: 'option', optionName: "dataSourceUrl"): string; + + /** + * Sets url which is used for sending JSON on request for remote data. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "dataSourceUrl", optionValue: string): void; + + /** + * See $.ig.DataSource. property in the response specifying the total number of records on the server. + */ + igShapeChart(optionLiteral: 'option', optionName: "responseTotalRecCountKey"): string; + + /** + * See $.ig.DataSource. property in the response specifying the total number of records on the server. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "responseTotalRecCountKey", optionValue: string): void; + + /** + * See $.ig.DataSource. This is basically the property in the responses where data records are held, if the response is wrapped. + */ + igShapeChart(optionLiteral: 'option', optionName: "responseDataKey"): string; + + /** + * See $.ig.DataSource. This is basically the property in the responses where data records are held, if the response is wrapped. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "responseDataKey", optionValue: string): void; + + /** + * Event raised when a property value is changed on this chart + */ + igShapeChart(optionLiteral: 'option', optionName: "propertyChanged"): PropertyChangedEvent; + + /** + * Event raised when a property value is changed on this chart + * + * @optionValue Define event handler function. + */ + igShapeChart(optionLiteral: 'option', optionName: "propertyChanged", optionValue: PropertyChangedEvent): void; + + /** + * Event raised when a series is initialized and added to this chart. + */ + igShapeChart(optionLiteral: 'option', optionName: "seriesAdded"): SeriesAddedEvent; + + /** + * Event raised when a series is initialized and added to this chart. + * + * @optionValue Define event handler function. + */ + igShapeChart(optionLiteral: 'option', optionName: "seriesAdded", optionValue: SeriesAddedEvent): void; + + /** + * Event raised when a series is removed from this chart. + */ + igShapeChart(optionLiteral: 'option', optionName: "seriesRemoved"): SeriesRemovedEvent; + + /** + * Event raised when a series is removed from this chart. + * + * @optionValue Define event handler function. + */ + igShapeChart(optionLiteral: 'option', optionName: "seriesRemoved", optionValue: SeriesRemovedEvent): void; + + /** + * Occurs when the pointer enters a Series. + */ + igShapeChart(optionLiteral: 'option', optionName: "seriesPointerEnter"): SeriesPointerEnterEvent; + + /** + * Occurs when the pointer enters a Series. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "seriesPointerEnter", optionValue: SeriesPointerEnterEvent): void; + + /** + * Occurs when the pointer leaves a Series. + */ + igShapeChart(optionLiteral: 'option', optionName: "seriesPointerLeave"): SeriesPointerLeaveEvent; + + /** + * Occurs when the pointer leaves a Series. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "seriesPointerLeave", optionValue: SeriesPointerLeaveEvent): void; + + /** + * Occurs when the pointer moves over a Series. + */ + igShapeChart(optionLiteral: 'option', optionName: "seriesPointerMove"): SeriesPointerMoveEvent; + + /** + * Occurs when the pointer moves over a Series. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "seriesPointerMove", optionValue: SeriesPointerMoveEvent): void; + + /** + * Occurs when the pointer is pressed down over a Series. + */ + igShapeChart(optionLiteral: 'option', optionName: "seriesPointerDown"): SeriesPointerDownEvent; + + /** + * Occurs when the pointer is pressed down over a Series. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "seriesPointerDown", optionValue: SeriesPointerDownEvent): void; + + /** + * Occurs when the pointer is released over a Series. + */ + igShapeChart(optionLiteral: 'option', optionName: "seriesPointerUp"): SeriesPointerUpEvent; + + /** + * Occurs when the pointer is released over a Series. + * + * @optionValue New value to be set. + */ + igShapeChart(optionLiteral: 'option', optionName: "seriesPointerUp", optionValue: SeriesPointerUpEvent): void; + + /** + * Event which is raised before data binding. + * Return false in order to cancel data binding. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.dataSource to obtain reference to instance of $.ig.DataSource. + */ + igShapeChart(optionLiteral: 'option', optionName: "dataBinding"): DataBindingEvent; + + /** + * Event which is raised before data binding. + * Return false in order to cancel data binding. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.dataSource to obtain reference to instance of $.ig.DataSource. + * + * @optionValue Define event handler function. + */ + igShapeChart(optionLiteral: 'option', optionName: "dataBinding", optionValue: DataBindingEvent): void; + + /** + * Event which is raised after data binding. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.data to obtain reference to array actual data which is displayed by chart. + * Use ui.dataSource to obtain reference to instance of $.ig.DataSource. + */ + igShapeChart(optionLiteral: 'option', optionName: "dataBound"): DataBoundEvent; + + /** + * Event which is raised after data binding. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.data to obtain reference to array actual data which is displayed by chart. + * Use ui.dataSource to obtain reference to instance of $.ig.DataSource. + * + * @optionValue Define event handler function. + */ + igShapeChart(optionLiteral: 'option', optionName: "dataBound", optionValue: DataBoundEvent): void; + + /** + * Event which is raised before tooltip is updated. + * Return false in order to cancel updating and hide tooltip. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.text to obtain html of tooltip. Value of that member can be modified. If modified value is null or empty string, then current content of tooltip keeps old value. + * Use ui.item to obtain reference to item. Value of that member can be modified or replaced by custom item. + * Use ui.x to obtain left position of tooltip in pixels relative to widget. Value of that member can be modified. + * Use ui.y to obtain top position of tooltip in pixels relative to widget. Value of that member can be modified. + * Use ui.element to obtain reference to jquery object which represents tooltip. Value of that member can be replaced by custom element. + */ + igShapeChart(optionLiteral: 'option', optionName: "updateTooltip"): UpdateTooltipEvent; + + /** + * Event which is raised before tooltip is updated. + * Return false in order to cancel updating and hide tooltip. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.text to obtain html of tooltip. Value of that member can be modified. If modified value is null or empty string, then current content of tooltip keeps old value. + * Use ui.item to obtain reference to item. Value of that member can be modified or replaced by custom item. + * Use ui.x to obtain left position of tooltip in pixels relative to widget. Value of that member can be modified. + * Use ui.y to obtain top position of tooltip in pixels relative to widget. Value of that member can be modified. + * Use ui.element to obtain reference to jquery object which represents tooltip. Value of that member can be replaced by custom element. + * + * @optionValue Define event handler function. + */ + igShapeChart(optionLiteral: 'option', optionName: "updateTooltip", optionValue: UpdateTooltipEvent): void; + + /** + * Event which is raised before tooltip is hidden. + * Return false in order to cancel hiding and keep tooltip visible. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.item to obtain reference to item. + * Use ui.element to obtain reference to jquery object which represents tooltip or value of ui.element from last updateTooltip event. Value of that member can be replaced by custom element. + */ + igShapeChart(optionLiteral: 'option', optionName: "hideTooltip"): HideTooltipEvent; + + /** + * Event which is raised before tooltip is hidden. + * Return false in order to cancel hiding and keep tooltip visible. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.item to obtain reference to item. + * Use ui.element to obtain reference to jquery object which represents tooltip or value of ui.element from last updateTooltip event. Value of that member can be replaced by custom element. + * + * @optionValue Define event handler function. + */ + igShapeChart(optionLiteral: 'option', optionName: "hideTooltip", optionValue: HideTooltipEvent): void; + igShapeChart(options: IgShapeChart): JQuery; + igShapeChart(optionLiteral: 'option', optionName: string): any; + igShapeChart(optionLiteral: 'option', options: IgShapeChart): JQuery; + igShapeChart(optionLiteral: 'option', optionName: string, optionValue: any): JQuery; + igShapeChart(methodName: string, ...methodParams: any[]): any; +} interface IgLoading { cssClass?: any; includeVerticalOffset?: boolean; @@ -75295,16 +88627,19 @@ interface IgSplitButtonItem { interface IgSplitButton { /** * Button items. + * */ items?: IgSplitButtonItem[]; /** * Default button item name. + * */ defaultItemName?: string; /** * Specifies whether the default button will be switched when another button is selected. + * */ swapDefaultEnabled?: boolean; @@ -75402,36 +88737,42 @@ interface JQuery { /** * Button items. + * */ igSplitButton(optionLiteral: 'option', optionName: "items"): IgSplitButtonItem[]; /** * Button items. * + * * @optionValue New value to be set. */ igSplitButton(optionLiteral: 'option', optionName: "items", optionValue: IgSplitButtonItem[]): void; /** * Default button item name. + * */ igSplitButton(optionLiteral: 'option', optionName: "defaultItemName"): string; /** * Default button item name. * + * * @optionValue New value to be set. */ igSplitButton(optionLiteral: 'option', optionName: "defaultItemName", optionValue: string): void; /** * Gets whether the default button will be switched when another button is selected. + * */ igSplitButton(optionLiteral: 'option', optionName: "swapDefaultEnabled"): boolean; /** * Sets whether the default button will be switched when another button is selected. * + * * @optionValue New value to be set. */ igSplitButton(optionLiteral: 'option', optionName: "swapDefaultEnabled", optionValue: boolean): void; @@ -75534,31 +88875,37 @@ interface JQuery { interface IgSplitterPanel { /** * Gets the size of the panel + * */ size?: string|number; /** * Gets the minimum size that the panel can have + * */ min?: string|number; /** * Gets the maximum size that the panel can have + * */ max?: string|number; /** * Gets whether the panel can be resized + * */ resizable?: boolean; /** * Gets whether the panel is initially collapsed + * */ collapsed?: boolean; /** * Gets whether the panel can be collapsed + * */ collapsible?: boolean; @@ -75616,6 +88963,7 @@ interface IgSplitter { /** * Gets/Sets the width of the container. * + * * Valid values: * "null" will stretch to fit data, if no other widths are defined. */ @@ -75624,6 +88972,7 @@ interface IgSplitter { /** * Gets/Sets the height of the container. * + * * Valid values: * "null" will fit the tree inside its parent container, if no other widths are defined. */ @@ -75632,6 +88981,7 @@ interface IgSplitter { /** * Specifies the orientation of the splitter. * + * * Valid values: * "vertical" * "horizontal" @@ -75640,19 +88990,40 @@ interface IgSplitter { /** * Array of objects options that specify the panels settings. The panels are no more than two. Settings are specified via enumeration. + * */ panels?: IgSplitterPanel[]; /** * Specifies drag delta of the split bar. In order to start dragging "move", the mouse has to be moved specific distance from its original position. + * */ dragDelta?: number; /** * Specifies whether the other splitters on the page will be resized as this splitter resizes. + * */ resizeOtherSplitters?: boolean; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Fired after collapsing is performed * @@ -75769,6 +89140,24 @@ interface IgSplitterMethods { * Destroys the igSplitter widget */ destroy(): void; + + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ + changeLocale($container: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igSplitter"): IgSplitterMethods; @@ -75784,9 +89173,13 @@ interface JQuery { igSplitter(methodName: "setFirstPanelSize", size: Object): void; igSplitter(methodName: "setSecondPanelSize", size: Object): void; igSplitter(methodName: "destroy"): void; + igSplitter(methodName: "changeLocale", $container: Object): void; + igSplitter(methodName: "changeGlobalLanguage"): void; + igSplitter(methodName: "changeGlobalRegional"): void; /** * Gets/Sets the width of the container. + * */ igSplitter(optionLiteral: 'option', optionName: "width"): string|number; @@ -75794,6 +89187,7 @@ interface JQuery { /** * /Sets the width of the container. * + * * @optionValue New value to be set. */ @@ -75801,6 +89195,7 @@ interface JQuery { /** * Gets/Sets the height of the container. + * */ igSplitter(optionLiteral: 'option', optionName: "height"): string|number; @@ -75808,6 +89203,7 @@ interface JQuery { /** * /Sets the height of the container. * + * * @optionValue New value to be set. */ @@ -75815,6 +89211,7 @@ interface JQuery { /** * Gets the orientation of the splitter. + * */ igSplitter(optionLiteral: 'option', optionName: "orientation"): string; @@ -75822,6 +89219,7 @@ interface JQuery { /** * Sets the orientation of the splitter. * + * * @optionValue New value to be set. */ @@ -75829,40 +89227,90 @@ interface JQuery { /** * Array of objects options that specify the panels settings. The panels are no more than two. Settings are specified via enumeration. + * */ igSplitter(optionLiteral: 'option', optionName: "panels"): IgSplitterPanel[]; /** * Array of objects options that specify the panels settings. The panels are no more than two. Settings are specified via enumeration. * + * * @optionValue New value to be set. */ igSplitter(optionLiteral: 'option', optionName: "panels", optionValue: IgSplitterPanel[]): void; /** * Gets drag delta of the split bar. In order to start dragging "move", the mouse has to be moved specific distance from its original position. + * */ igSplitter(optionLiteral: 'option', optionName: "dragDelta"): number; /** * Sets drag delta of the split bar. In order to start dragging "move", the mouse has to be moved specific distance from its original position. * + * * @optionValue New value to be set. */ igSplitter(optionLiteral: 'option', optionName: "dragDelta", optionValue: number): void; /** * Gets whether the other splitters on the page will be resized as this splitter resizes. + * */ igSplitter(optionLiteral: 'option', optionName: "resizeOtherSplitters"): boolean; /** * Sets whether the other splitters on the page will be resized as this splitter resizes. * + * * @optionValue New value to be set. */ igSplitter(optionLiteral: 'option', optionName: "resizeOtherSplitters", optionValue: boolean): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igSplitter(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igSplitter(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igSplitter(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igSplitter(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igSplitter(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igSplitter(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Fired after collapsing is performed * @@ -76029,6 +89477,27 @@ interface ActivePaneChangedEventUIParam { visibleRange?: string; } +interface ActiveTableChangedEvent { + (event: Event, ui: ActiveTableChangedEventUIParam): void; +} + +interface ActiveTableChangedEventUIParam { + /** + * Gets a reference to the spreadsheet widget. + */ + owner?: any; + + /** + * Gets the previous active [Table](ig.excel.WorksheetTable). + */ + oldActiveTable?: any; + + /** + * Gets the current active [Table](ig.excel.WorksheetTable). + */ + newActiveTable?: any; +} + interface ActiveWorksheetChangedEvent { (event: Event, ui: ActiveWorksheetChangedEventUIParam): void; } @@ -76253,6 +89722,7 @@ interface IgSpreadsheet { /** * The width of the spreadsheet. It can be set as a number in pixels, string (px) or percentage (%). * + * * Valid values: * "string" The widget width can be set in pixels (px) and percentage (%). * "number" The widget width can be set as a number @@ -76262,6 +89732,7 @@ interface IgSpreadsheet { /** * The height of the spreadsheet. It can be set as a number in pixels, string (px) or percentage (%). * + * * Valid values: * "string" The widget height can be set in pixels (px) and percentage (%). * "number" The widget height can be set as a number @@ -76270,6 +89741,7 @@ interface IgSpreadsheet { /** * Returns or sets the A1 format address of the current active cell within the selected worksheet. + * */ activeCell?: string; @@ -76279,31 +89751,37 @@ interface IgSpreadsheet { * if an arrow key is pressed while the scroll lock is enabled the cell area will be scrolled rather than changing * the active cell. Note: This property is not maintained/changed by the control. It is just queried when * performing actions that consider whether the scroll lock is enabled. + * */ isScrollLocked?: boolean; /** * Returns or sets the Worksheet from the workbook whose content should be displayed within the control. + * */ activeWorksheet?: any; /** * Returns or sets a boolean indicating whether the spreadsheet allows adding worksheets. + * */ allowAddWorksheet?: boolean; /** * Returns or sets a boolean indicating whether the spreadsheet allows deleting worksheets. + * */ allowDeleteWorksheet?: boolean; /** * Returns or sets a boolean indicating if the grid lines are displayed in the selected worksheets. + * */ areGridlinesVisible?: boolean; /** * Returns or sets a boolean indicating if the row and column headers are displayed for the selected worksheets. + * */ areHeadersVisible?: boolean; @@ -76311,6 +89789,7 @@ interface IgSpreadsheet { * Returns or sets an enumeration indicating the direction of the cell adjacent to the activeCell that should be activated when the enter key is pressed.This property is only used if the isEnterKeyNavigationEnabled is set to true. Also, the reverse direction is * navigated when Shift + Enter are pressed. * + * * Valid values: * "down" The cell below should be activated. * "right" The cell to the right should be activated @@ -76321,21 +89800,25 @@ interface IgSpreadsheet { /** * Returns or sets the number of decimal places by which a whole number typed in during edit mode should be adjusted when isFixedDecimalEnabled is true + * */ fixedDecimalPlaceCount?: number; /** * Returns or sets a boolean indicating whether the adjacent cell indicated by the enterKeyNavigationDirection should be navigated to when the enter key is pressed. + * */ isEnterKeyNavigationEnabled?: boolean; /** * Returns or sets a boolean indicating whether a fixed decimal place is automatically added when a whole number is entered while in edit mode. + * */ isFixedDecimalEnabled?: boolean; /** * Returns or sets a boolean indicating if the formula bar is displayed within the Spreadsheet. + * */ isFormulaBarVisible?: boolean; @@ -76345,22 +89828,26 @@ interface IgSpreadsheet { * end mode and one presses the right arrow, the activeCell will be changed to be the first cell to the right of the current ActiveCell * that has a value (even if the value is ""). If there were no cells to the right with a value then it would activate the right most cell in that row. End * mode will end automatically such as when one presses an arrow key. + * */ isInEndMode?: boolean; /** * Returns or sets a boolean indicating whether undo is enabled for the control. + * */ isUndoEnabled?: boolean; /** * Returns or sets the width of the name box within the formula bar. + * */ nameBoxWidth?: number; /** * Returns or sets a value indicating how the selection is updated when interacting with the cells via the mouse or keyboard. * + * * Valid values: * "normal" The selection is replaced when dragging the mouse to select a cell or range of cells. Similarly when navigating via the keyboard a new selection is created. One may add a new range by holding the Ctrl key and using the mouse and one may alter the selection range containing the active cell by holding the Shift key down while clicking with the mouse or navigating with the keyboard such as with the arrow keys. * "extendSelection" The selection range in the cellRanges representing the active cell is updated as one uses the mouse to select a cell or navigating via the keyboard. @@ -76370,6 +89857,7 @@ interface IgSpreadsheet { /** * Type="ig.excel.Worksheet[]" Returns or sets an array of the Worksheets whose tabs are selected. + * */ selectedWorksheets?: any; @@ -76382,26 +89870,31 @@ interface IgSpreadsheet { /** * Returns or sets the workbook whose information is displayed in the control. + * */ workbook?: any; /** * Returns or sets the magnification of the selected worksheets. + * */ zoomLevel?: number; /** * Set/Get the locale setting for the widget. + * */ locale?: any; /** * Set/Get the locale language setting for the widget. + * */ language?: string; /** * Set/Get the regional setting for the widget. + * */ regional?: string|Object; @@ -76425,6 +89918,11 @@ interface IgSpreadsheet { */ activePaneChanged?: ActivePaneChangedEvent; + /** + * Invoked when the activeTable of the Spreadsheet has changed. + */ + activeTableChanged?: ActiveTableChangedEvent; + /** * Invoked when the activeWorksheet of the Spreadsheet has changed. */ @@ -76499,6 +89997,11 @@ interface IgSpreadsheetMethods { */ getActivePane(): Object; + /** + * Returns an object that represents the pane with the focus. + */ + getActiveTable(): Object; + /** * Returns an object that represents the current selection of the active pane. */ @@ -76542,6 +90045,22 @@ interface IgSpreadsheetMethods { */ executeAction(action: Object): boolean; + /** + * Shows the filter dialog for the specified relative column of the [filterSettings](ig.excel.worksheet#methods:filterSettings) of the [activeWorksheet](ui.igspreadsheet#options:activeWorksheet). + * + * @param relativeColumnIndex A zero based column index relative to the [region](ig.excel.worksheetFilterSettings#methods:region) of the active worksheet. + * @param spreadsheetFilterDialogOption Optional enumeration that specifies the initial display of the filter dialog. + */ + showFilterDialogForWorksheet(relativeColumnIndex: number, spreadsheetFilterDialogOption: Object): void; + + /** + * Shows the filter dialog for the specified relative column of the [filterSettings](ig.excel.Worksheet#methods:filterSettings) of the [activeWorksheet](ui.igspreadsheet#options:activeWorksheet). + * + * @param worksheetTableColumn A [region](ig.excel.WorksheetTableColumn) whose filter is to be viewed or changed. + * @param spreadsheetFilterDialogOption Optional enumeration that specifies the initial display of the filter dialog. + */ + showFilterDialogForTable(worksheetTableColumn: Object, spreadsheetFilterDialogOption: Object): void; + /** * Forces any pending deferred work to render on the spreadsheet before continuing */ @@ -76557,7 +90076,15 @@ interface IgSpreadsheetMethods { * Notify the spreadsheet that style information used for rendering the spreadsheet may have been updated. */ styleUpdated(): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ changeGlobalRegional(): void; } interface JQuery { @@ -76566,6 +90093,7 @@ interface JQuery { interface JQuery { igSpreadsheet(methodName: "getActivePane"): Object; + igSpreadsheet(methodName: "getActiveTable"): Object; igSpreadsheet(methodName: "getActiveSelection"): Object; igSpreadsheet(methodName: "getActiveSelectionCellRangeFormat"): Object; igSpreadsheet(methodName: "getCellEditMode"): Object; @@ -76573,6 +90101,8 @@ interface JQuery { igSpreadsheet(methodName: "getIsRenamingWorksheet"): boolean; igSpreadsheet(methodName: "getPanes"): void; igSpreadsheet(methodName: "executeAction", action: Object): boolean; + igSpreadsheet(methodName: "showFilterDialogForWorksheet", relativeColumnIndex: number, spreadsheetFilterDialogOption: Object): void; + igSpreadsheet(methodName: "showFilterDialogForTable", worksheetTableColumn: Object, spreadsheetFilterDialogOption: Object): void; igSpreadsheet(methodName: "flush"): void; igSpreadsheet(methodName: "destroy"): void; igSpreadsheet(methodName: "changeLocale", $container: Object): void; @@ -76582,6 +90112,7 @@ interface JQuery { /** * The width of the spreadsheet. It can be set as a number in pixels, string (px) or percentage (%). + * */ igSpreadsheet(optionLiteral: 'option', optionName: "width"): string|number; @@ -76589,6 +90120,7 @@ interface JQuery { /** * The width of the spreadsheet. It can be set as a number in pixels, string (px) or percentage (%). * + * * @optionValue New value to be set. */ @@ -76596,6 +90128,7 @@ interface JQuery { /** * The height of the spreadsheet. It can be set as a number in pixels, string (px) or percentage (%). + * */ igSpreadsheet(optionLiteral: 'option', optionName: "height"): string|number; @@ -76603,6 +90136,7 @@ interface JQuery { /** * The height of the spreadsheet. It can be set as a number in pixels, string (px) or percentage (%). * + * * @optionValue New value to be set. */ @@ -76610,12 +90144,14 @@ interface JQuery { /** * Returns the A1 format address of the current active cell within the selected worksheet. + * */ igSpreadsheet(optionLiteral: 'option', optionName: "activeCell"): string; /** * Returns or sets the A1 format address of the current active cell within the selected worksheet. * + * * @optionValue New value to be set. */ igSpreadsheet(optionLiteral: 'option', optionName: "activeCell", optionValue: string): void; @@ -76626,6 +90162,7 @@ interface JQuery { * if an arrow key is pressed while the scroll lock is enabled the cell area will be scrolled rather than changing * the active cell. Note: This property is not maintained/changed by the control. It is just queried when * performing actions that consider whether the scroll lock is enabled. + * */ igSpreadsheet(optionLiteral: 'option', optionName: "isScrollLocked"): boolean; @@ -76636,66 +90173,77 @@ interface JQuery { * the active cell. Note: This property is not maintained/changed by the control. It is just queried when * performing actions that consider whether the scroll lock is enabled. * + * * @optionValue New value to be set. */ igSpreadsheet(optionLiteral: 'option', optionName: "isScrollLocked", optionValue: boolean): void; /** * Returns the Worksheet from the workbook whose content should be displayed within the control. + * */ igSpreadsheet(optionLiteral: 'option', optionName: "activeWorksheet"): any; /** * Returns or sets the Worksheet from the workbook whose content should be displayed within the control. * + * * @optionValue New value to be set. */ igSpreadsheet(optionLiteral: 'option', optionName: "activeWorksheet", optionValue: any): void; /** * Returns a boolean indicating whether the spreadsheet allows adding worksheets. + * */ igSpreadsheet(optionLiteral: 'option', optionName: "allowAddWorksheet"): boolean; /** * Returns or sets a boolean indicating whether the spreadsheet allows adding worksheets. * + * * @optionValue New value to be set. */ igSpreadsheet(optionLiteral: 'option', optionName: "allowAddWorksheet", optionValue: boolean): void; /** * Returns a boolean indicating whether the spreadsheet allows deleting worksheets. + * */ igSpreadsheet(optionLiteral: 'option', optionName: "allowDeleteWorksheet"): boolean; /** * Returns or sets a boolean indicating whether the spreadsheet allows deleting worksheets. * + * * @optionValue New value to be set. */ igSpreadsheet(optionLiteral: 'option', optionName: "allowDeleteWorksheet", optionValue: boolean): void; /** * Returns a boolean indicating if the grid lines are displayed in the selected worksheets. + * */ igSpreadsheet(optionLiteral: 'option', optionName: "areGridlinesVisible"): boolean; /** * Returns or sets a boolean indicating if the grid lines are displayed in the selected worksheets. * + * * @optionValue New value to be set. */ igSpreadsheet(optionLiteral: 'option', optionName: "areGridlinesVisible", optionValue: boolean): void; /** * Returns a boolean indicating if the row and column headers are displayed for the selected worksheets. + * */ igSpreadsheet(optionLiteral: 'option', optionName: "areHeadersVisible"): boolean; /** * Returns or sets a boolean indicating if the row and column headers are displayed for the selected worksheets. * + * * @optionValue New value to be set. */ igSpreadsheet(optionLiteral: 'option', optionName: "areHeadersVisible", optionValue: boolean): void; @@ -76703,6 +90251,7 @@ interface JQuery { /** * Returns an enumeration indicating the direction of the cell adjacent to the activeCell that should be activated when the enter key is pressed.This property is only used if the isEnterKeyNavigationEnabled is set to true. Also, the reverse direction is * navigated when Shift + Enter are pressed. + * */ igSpreadsheet(optionLiteral: 'option', optionName: "enterKeyNavigationDirection"): string; @@ -76711,6 +90260,7 @@ interface JQuery { * Returns or sets an enumeration indicating the direction of the cell adjacent to the activeCell that should be activated when the enter key is pressed.This property is only used if the isEnterKeyNavigationEnabled is set to true. Also, the reverse direction is * navigated when Shift + Enter are pressed. * + * * @optionValue New value to be set. */ @@ -76718,48 +90268,56 @@ interface JQuery { /** * Returns the number of decimal places by which a whole number typed in during edit mode should be adjusted when isFixedDecimalEnabled is true + * */ igSpreadsheet(optionLiteral: 'option', optionName: "fixedDecimalPlaceCount"): number; /** * Returns or sets the number of decimal places by which a whole number typed in during edit mode should be adjusted when isFixedDecimalEnabled is true * + * * @optionValue New value to be set. */ igSpreadsheet(optionLiteral: 'option', optionName: "fixedDecimalPlaceCount", optionValue: number): void; /** * Returns a boolean indicating whether the adjacent cell indicated by the enterKeyNavigationDirection should be navigated to when the enter key is pressed. + * */ igSpreadsheet(optionLiteral: 'option', optionName: "isEnterKeyNavigationEnabled"): boolean; /** * Returns or sets a boolean indicating whether the adjacent cell indicated by the enterKeyNavigationDirection should be navigated to when the enter key is pressed. * + * * @optionValue New value to be set. */ igSpreadsheet(optionLiteral: 'option', optionName: "isEnterKeyNavigationEnabled", optionValue: boolean): void; /** * Returns a boolean indicating whether a fixed decimal place is automatically added when a whole number is entered while in edit mode. + * */ igSpreadsheet(optionLiteral: 'option', optionName: "isFixedDecimalEnabled"): boolean; /** * Returns or sets a boolean indicating whether a fixed decimal place is automatically added when a whole number is entered while in edit mode. * + * * @optionValue New value to be set. */ igSpreadsheet(optionLiteral: 'option', optionName: "isFixedDecimalEnabled", optionValue: boolean): void; /** * Returns a boolean indicating if the formula bar is displayed within the Spreadsheet. + * */ igSpreadsheet(optionLiteral: 'option', optionName: "isFormulaBarVisible"): boolean; /** * Returns or sets a boolean indicating if the formula bar is displayed within the Spreadsheet. * + * * @optionValue New value to be set. */ igSpreadsheet(optionLiteral: 'option', optionName: "isFormulaBarVisible", optionValue: boolean): void; @@ -76770,6 +90328,7 @@ interface JQuery { * end mode and one presses the right arrow, the activeCell will be changed to be the first cell to the right of the current ActiveCell * that has a value (even if the value is ""). If there were no cells to the right with a value then it would activate the right most cell in that row. End * mode will end automatically such as when one presses an arrow key. + * */ igSpreadsheet(optionLiteral: 'option', optionName: "isInEndMode"): boolean; @@ -76780,36 +90339,42 @@ interface JQuery { * that has a value (even if the value is ""). If there were no cells to the right with a value then it would activate the right most cell in that row. End * mode will end automatically such as when one presses an arrow key. * + * * @optionValue New value to be set. */ igSpreadsheet(optionLiteral: 'option', optionName: "isInEndMode", optionValue: boolean): void; /** * Returns a boolean indicating whether undo is enabled for the control. + * */ igSpreadsheet(optionLiteral: 'option', optionName: "isUndoEnabled"): boolean; /** * Returns or sets a boolean indicating whether undo is enabled for the control. * + * * @optionValue New value to be set. */ igSpreadsheet(optionLiteral: 'option', optionName: "isUndoEnabled", optionValue: boolean): void; /** * Returns the width of the name box within the formula bar. + * */ igSpreadsheet(optionLiteral: 'option', optionName: "nameBoxWidth"): number; /** * Returns or sets the width of the name box within the formula bar. * + * * @optionValue New value to be set. */ igSpreadsheet(optionLiteral: 'option', optionName: "nameBoxWidth", optionValue: number): void; /** * Returns a value indicating how the selection is updated when interacting with the cells via the mouse or keyboard. + * */ igSpreadsheet(optionLiteral: 'option', optionName: "selectionMode"): string; @@ -76817,6 +90382,7 @@ interface JQuery { /** * Returns or sets a value indicating how the selection is updated when interacting with the cells via the mouse or keyboard. * + * * @optionValue New value to be set. */ @@ -76824,12 +90390,14 @@ interface JQuery { /** * Type="ig.excel.Worksheet[]" Returns an array of the Worksheets whose tabs are selected. + * */ igSpreadsheet(optionLiteral: 'option', optionName: "selectedWorksheets"): any; /** * Type="ig.excel.Worksheet[]" Returns or sets an array of the Worksheets whose tabs are selected. * + * * @optionValue New value to be set. */ igSpreadsheet(optionLiteral: 'option', optionName: "selectedWorksheets", optionValue: any): void; @@ -76852,54 +90420,63 @@ interface JQuery { /** * Returns the workbook whose information is displayed in the control. + * */ igSpreadsheet(optionLiteral: 'option', optionName: "workbook"): any; /** * Returns or sets the workbook whose information is displayed in the control. * + * * @optionValue New value to be set. */ igSpreadsheet(optionLiteral: 'option', optionName: "workbook", optionValue: any): void; /** * Returns the magnification of the selected worksheets. + * */ igSpreadsheet(optionLiteral: 'option', optionName: "zoomLevel"): number; /** * Returns or sets the magnification of the selected worksheets. * + * * @optionValue New value to be set. */ igSpreadsheet(optionLiteral: 'option', optionName: "zoomLevel", optionValue: number): void; /** * Set/Get the locale setting for the widget. + * */ igSpreadsheet(optionLiteral: 'option', optionName: "locale"): any; /** * Set/Get the locale setting for the widget. * + * * @optionValue New value to be set. */ igSpreadsheet(optionLiteral: 'option', optionName: "locale", optionValue: any): void; /** * Set/Get the locale language setting for the widget. + * */ igSpreadsheet(optionLiteral: 'option', optionName: "language"): string; /** * Set/Get the locale language setting for the widget. * + * * @optionValue New value to be set. */ igSpreadsheet(optionLiteral: 'option', optionName: "language", optionValue: string): void; /** * Set/Get the regional setting for the widget. + * */ igSpreadsheet(optionLiteral: 'option', optionName: "regional"): string|Object; @@ -76907,6 +90484,7 @@ interface JQuery { /** * Set/Get the regional setting for the widget. * + * * @optionValue New value to be set. */ @@ -76960,6 +90538,18 @@ interface JQuery { */ igSpreadsheet(optionLiteral: 'option', optionName: "activePaneChanged", optionValue: ActivePaneChangedEvent): void; + /** + * Invoked when the activeTable of the Spreadsheet has changed. + */ + igSpreadsheet(optionLiteral: 'option', optionName: "activeTableChanged"): ActiveTableChangedEvent; + + /** + * Invoked when the activeTable of the Spreadsheet has changed. + * + * @optionValue New value to be set. + */ + igSpreadsheet(optionLiteral: 'option', optionName: "activeTableChanged", optionValue: ActiveTableChangedEvent): void; + /** * Invoked when the activeWorksheet of the Spreadsheet has changed. */ @@ -77141,21 +90731,25 @@ interface IgTileManagerSplitterOptionsEvents { interface IgTileManagerSplitterOptions { /** * Gets/Sets whether the splitter should be enabled. + * */ enabled?: boolean; /** * Gets whether the splitter can be collapsible. + * */ collapsible?: boolean; /** * Gets whether the splitter should be initially collapsed. + * */ collapsed?: boolean; /** * Gets/Sets splitter events. + * */ events?: IgTileManagerSplitterOptionsEvents; @@ -77273,6 +90867,7 @@ interface TileMinimizedEventUIParam { interface IgTileManager { /** + * * * Valid values: * "string" The container width can be set in pixels (px) and percentage (%). @@ -77283,6 +90878,7 @@ interface IgTileManager { /** * Gets/Sets the height of the container. * + * * Valid values: * "string" The height width can be set in pixels (px) and percentage (%). * "number" The height width can be set as a number in pixels. @@ -77293,6 +90889,7 @@ interface IgTileManager { /** * Gets/Sets the width of each column in the container. * + * * Valid values: * "string" The column width can be set in pixels (px), percentage (%) or asterisk (*) which will distribute all the width between all the columns equally. * "number" The column width can be set as a number representing value in pixels. @@ -77304,6 +90901,7 @@ interface IgTileManager { /** * Gets/Sets the height of each column in the container. * + * * Valid values: * "string" The column height can be set in pixels (px), percentage (%) or asterisk (*) which will distribute all the height between all the columns equally. * "number" The column height can be set as a number representing value in pixels. @@ -77315,6 +90913,7 @@ interface IgTileManager { /** * Gets/Sets the columns count in the container. * + * * Valid values: * "null" The column count will be automatically calculated. * "number" The column count can be set as a number. @@ -77324,6 +90923,7 @@ interface IgTileManager { /** * Gets/Sets the rows count in the container. * + * * Valid values: * "number" The row count can be set as a number. * "null" The row count will be automatically calculated. @@ -77346,12 +90946,14 @@ interface IgTileManager { /** * Gets/Sets whether the items will rearrange when the container is resized. + * */ rearrangeItems?: boolean; /** * Gets/Sets the tiles configurations. Every tile is described by rowSpan, colSpan, rowIndex and colIndex. * + * * Valid values: * "array" An array with colSpan, rowSpan, colIndex, rowIndex configurations for each tile. * "null" Default tile configurations of rowSpan: 1 and colSpan: 1 will be used. @@ -77360,12 +90962,14 @@ interface IgTileManager { /** * Specifies any valid data source accepted by [$.ig.DataSource](ig.datasource), or an instance of an [$.ig.DataSource](ig.datasource) itself. + * */ dataSource?: any; /** * Gets/Sets the content of the tiles in minimized state. * + * * Valid values: * "string" When initializing on html markup provide jQuery selector specifying what content of the tile to be shown in minimized state. When initializing on data source provide igTemplate that will be rendered for the minimized state. * "null" The whole content of the tile will be visible in minimized state. @@ -77375,6 +90979,7 @@ interface IgTileManager { /** * Gets/Sets the content of the tiles in maximized state. * + * * Valid values: * "string" When initializing on html markup provide jQuery selector specifying which elements of the tile to be shown in maximized state. When initializing on data source provide igTemplate that will be rendered for the maximized state. * "null" The whole content of the tile will be visible in maximized state. @@ -77384,6 +90989,7 @@ interface IgTileManager { /** * Gets/Sets the index of which items configuration will be used for positioning and sizing of the maximized tile. * + * * Valid values: * "number" The maximizedTileindex can be set as a number. * "null" Option is ignored. @@ -77393,6 +90999,7 @@ interface IgTileManager { /** * Gets/Sets how many columns to be displayed in the right panel when the tiles are minimized. * + * * Valid values: * "number" Set the number of right panel columns as a number. The minimum value is 1. * "null" Default of 1 column will be used. @@ -77402,6 +91009,7 @@ interface IgTileManager { /** * Gets/Sets the width of the minimized tiles in the right panel. * + * * Valid values: * "number" Set the width of the minimized tiles as a number. * "null" Default value equal to the column width will be used. @@ -77411,6 +91019,7 @@ interface IgTileManager { /** * Gets/Sets the height of the minimized tiles in the right panel. * + * * Valid values: * "number" Set the height of the minimized tiles as a number. * "null" Default value equal to the column height will be used. @@ -77419,32 +91028,38 @@ interface IgTileManager { /** * Gets/Sets whether the right panel should show scrollbar when tiles are overflowing. + * */ showRightPanelScroll?: boolean; /** * Configure the container variable representation, which defines splitter functionality. + * */ splitterOptions?: IgTileManagerSplitterOptions; /** * Gets/Sets JQuery selector that specifies which elements will not trigger maximizing when clicked on. + * */ preventMaximizingSelector?: string; /** * Gets/Sets the duration of the animations in the tile manager. + * */ animationDuration?: number; /** * Specifies a remote URL accepted by [$.ig.DataSource](ig.datasource) in order to request data from it. + * */ dataSourceUrl?: string; /** * Property in the response which specifies where the data records array will be held (if the response is wrapped). See [$.ig.DataSource responseDataKey](ig.datasource#options:settings.responseDataKey). * + * * Valid values: * "string" Specifies the name of the property in which data records are held if the response is wrapped. * "null" Option is ignored. @@ -77454,6 +91069,7 @@ interface IgTileManager { /** * Explicitly set data source type (such as "json"). Please refer to the documentation of [$.ig.DataSource type](ig.datasource#options:settings.type) and its type property. * + * * Valid values: * "string" Explicitly set data source type (such as "json"). Please refer to the documentation of $.ig.DataSource and its type property. * "null" Option is ignored. @@ -77462,19 +91078,40 @@ interface IgTileManager { /** * Explicitly set data source type (such as "json"). Please refer to the documentation of [$.ig.DataSource type](ig.datasource#options:settings.type) and its type property. + * */ dataSourceType?: string; /** * Specifies the HTTP request method. + * */ requestType?: string; /** * Gets/Sets the HTTP content type for the response object. See [Perform an asynchronous HTTP (Ajax) request](http://api.jquery.com/jQuery.ajax/). + * */ responseContentType?: string; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Fired before databinding is performed * @@ -77639,6 +91276,24 @@ interface IgTileManagerMethods { * Deletes the widget instance (client object). It is no longer accessible and all its event handlers stop working. Destroys all child widgets. Removes auto-generated HTML content, which is outside the widget, e.g. detached popups, dropdowns, etc. */ destroy(): Object; + + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ + changeLocale($container: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igTileManager"): IgTileManagerMethods; @@ -77655,6 +91310,9 @@ interface JQuery { igTileManager(methodName: "widget"): Object; igTileManager(methodName: "dataBind"): void; igTileManager(methodName: "destroy"): Object; + igTileManager(methodName: "changeLocale", $container: Object): void; + igTileManager(methodName: "changeGlobalLanguage"): void; + igTileManager(methodName: "changeGlobalRegional"): void; /** * * @@ -77672,6 +91330,7 @@ interface JQuery { /** * Gets/Sets the height of the container. + * */ igTileManager(optionLiteral: 'option', optionName: "height"): string|number; @@ -77679,6 +91338,7 @@ interface JQuery { /** * /Sets the height of the container. * + * * @optionValue New value to be set. */ @@ -77686,6 +91346,7 @@ interface JQuery { /** * Gets/Sets the width of each column in the container. + * */ igTileManager(optionLiteral: 'option', optionName: "columnWidth"): string|number|Array; @@ -77693,6 +91354,7 @@ interface JQuery { /** * /Sets the width of each column in the container. * + * * @optionValue New value to be set. */ @@ -77700,6 +91362,7 @@ interface JQuery { /** * Gets/Sets the height of each column in the container. + * */ igTileManager(optionLiteral: 'option', optionName: "columnHeight"): string|number|Array; @@ -77707,6 +91370,7 @@ interface JQuery { /** * /Sets the height of each column in the container. * + * * @optionValue New value to be set. */ @@ -77714,6 +91378,7 @@ interface JQuery { /** * Gets/Sets the columns count in the container. + * */ igTileManager(optionLiteral: 'option', optionName: "cols"): number; @@ -77721,6 +91386,7 @@ interface JQuery { /** * /Sets the columns count in the container. * + * * @optionValue New value to be set. */ @@ -77728,6 +91394,7 @@ interface JQuery { /** * Gets/Sets the rows count in the container. + * */ igTileManager(optionLiteral: 'option', optionName: "rows"): number; @@ -77735,6 +91402,7 @@ interface JQuery { /** * /Sets the rows count in the container. * + * * @optionValue New value to be set. */ @@ -77774,18 +91442,21 @@ interface JQuery { /** * Gets/Sets whether the items will rearrange when the container is resized. + * */ igTileManager(optionLiteral: 'option', optionName: "rearrangeItems"): boolean; /** * /Sets whether the items will rearrange when the container is resized. * + * * @optionValue New value to be set. */ igTileManager(optionLiteral: 'option', optionName: "rearrangeItems", optionValue: boolean): void; /** * Gets/Sets the tiles configurations. Every tile is described by rowSpan, colSpan, rowIndex and colIndex. + * */ igTileManager(optionLiteral: 'option', optionName: "items"): Object; @@ -77793,6 +91464,7 @@ interface JQuery { /** * /Sets the tiles configurations. Every tile is described by rowSpan, colSpan, rowIndex and colIndex. * + * * @optionValue New value to be set. */ @@ -77800,18 +91472,21 @@ interface JQuery { /** * Gets any valid data source accepted by [$.ig.DataSource](ig.datasource), or an instance of an [$.ig.DataSource](ig.datasource) itself. + * */ igTileManager(optionLiteral: 'option', optionName: "dataSource"): any; /** * Sets any valid data source accepted by [$.ig.DataSource](ig.datasource), or an instance of an [$.ig.DataSource](ig.datasource) itself. * + * * @optionValue New value to be set. */ igTileManager(optionLiteral: 'option', optionName: "dataSource", optionValue: any): void; /** * Gets/Sets the content of the tiles in minimized state. + * */ igTileManager(optionLiteral: 'option', optionName: "minimizedState"): string; @@ -77819,6 +91494,7 @@ interface JQuery { /** * /Sets the content of the tiles in minimized state. * + * * @optionValue New value to be set. */ @@ -77826,6 +91502,7 @@ interface JQuery { /** * Gets/Sets the content of the tiles in maximized state. + * */ igTileManager(optionLiteral: 'option', optionName: "maximizedState"): string; @@ -77833,6 +91510,7 @@ interface JQuery { /** * /Sets the content of the tiles in maximized state. * + * * @optionValue New value to be set. */ @@ -77840,6 +91518,7 @@ interface JQuery { /** * Gets/Sets the index of which items configuration will be used for positioning and sizing of the maximized tile. + * */ igTileManager(optionLiteral: 'option', optionName: "maximizedTileIndex"): number; @@ -77847,6 +91526,7 @@ interface JQuery { /** * /Sets the index of which items configuration will be used for positioning and sizing of the maximized tile. * + * * @optionValue New value to be set. */ @@ -77854,6 +91534,7 @@ interface JQuery { /** * Gets/Sets how many columns to be displayed in the right panel when the tiles are minimized. + * */ igTileManager(optionLiteral: 'option', optionName: "rightPanelCols"): number; @@ -77861,6 +91542,7 @@ interface JQuery { /** * /Sets how many columns to be displayed in the right panel when the tiles are minimized. * + * * @optionValue New value to be set. */ @@ -77868,6 +91550,7 @@ interface JQuery { /** * Gets/Sets the width of the minimized tiles in the right panel. + * */ igTileManager(optionLiteral: 'option', optionName: "rightPanelTilesWidth"): number; @@ -77875,6 +91558,7 @@ interface JQuery { /** * /Sets the width of the minimized tiles in the right panel. * + * * @optionValue New value to be set. */ @@ -77882,6 +91566,7 @@ interface JQuery { /** * Gets/Sets the height of the minimized tiles in the right panel. + * */ igTileManager(optionLiteral: 'option', optionName: "rightPanelTilesHeight"): number; @@ -77889,6 +91574,7 @@ interface JQuery { /** * /Sets the height of the minimized tiles in the right panel. * + * * @optionValue New value to be set. */ @@ -77896,66 +91582,77 @@ interface JQuery { /** * Gets/Sets whether the right panel should show scrollbar when tiles are overflowing. + * */ igTileManager(optionLiteral: 'option', optionName: "showRightPanelScroll"): boolean; /** * /Sets whether the right panel should show scrollbar when tiles are overflowing. * + * * @optionValue New value to be set. */ igTileManager(optionLiteral: 'option', optionName: "showRightPanelScroll", optionValue: boolean): void; /** * Configure the container variable representation, which defines splitter functionality. + * */ igTileManager(optionLiteral: 'option', optionName: "splitterOptions"): IgTileManagerSplitterOptions; /** * Configure the container variable representation, which defines splitter functionality. * + * * @optionValue New value to be set. */ igTileManager(optionLiteral: 'option', optionName: "splitterOptions", optionValue: IgTileManagerSplitterOptions): void; /** * Gets/Sets JQuery selector that specifies which elements will not trigger maximizing when clicked on. + * */ igTileManager(optionLiteral: 'option', optionName: "preventMaximizingSelector"): string; /** * /Sets JQuery selector that specifies which elements will not trigger maximizing when clicked on. * + * * @optionValue New value to be set. */ igTileManager(optionLiteral: 'option', optionName: "preventMaximizingSelector", optionValue: string): void; /** * Gets/Sets the duration of the animations in the tile manager. + * */ igTileManager(optionLiteral: 'option', optionName: "animationDuration"): number; /** * /Sets the duration of the animations in the tile manager. * + * * @optionValue New value to be set. */ igTileManager(optionLiteral: 'option', optionName: "animationDuration", optionValue: number): void; /** * Gets a remote URL accepted by [$.ig.DataSource](ig.datasource) in order to request data from it. + * */ igTileManager(optionLiteral: 'option', optionName: "dataSourceUrl"): string; /** * Sets a remote URL accepted by [$.ig.DataSource](ig.datasource) in order to request data from it. * + * * @optionValue New value to be set. */ igTileManager(optionLiteral: 'option', optionName: "dataSourceUrl", optionValue: string): void; /** * Property in the response which specifies where the data records array will be held (if the response is wrapped). See [$.ig.DataSource responseDataKey](ig.datasource#options:settings.responseDataKey). + * */ igTileManager(optionLiteral: 'option', optionName: "responseDataKey"): string; @@ -77963,6 +91660,7 @@ interface JQuery { /** * Property in the response which specifies where the data records array will be held (if the response is wrapped). See [$.ig.DataSource responseDataKey](ig.datasource#options:settings.responseDataKey). * + * * @optionValue New value to be set. */ @@ -77970,6 +91668,7 @@ interface JQuery { /** * Explicitly set data source type (such as "json"). Please refer to the documentation of [$.ig.DataSource type](ig.datasource#options:settings.type) and its type property. + * */ igTileManager(optionLiteral: 'option', optionName: "responseDataType"): string; @@ -77977,6 +91676,7 @@ interface JQuery { /** * Explicitly set data source type (such as "json"). Please refer to the documentation of [$.ig.DataSource type](ig.datasource#options:settings.type) and its type property. * + * * @optionValue New value to be set. */ @@ -77984,40 +91684,90 @@ interface JQuery { /** * Explicitly set data source type (such as "json"). Please refer to the documentation of [$.ig.DataSource type](ig.datasource#options:settings.type) and its type property. + * */ igTileManager(optionLiteral: 'option', optionName: "dataSourceType"): string; /** * Explicitly set data source type (such as "json"). Please refer to the documentation of [$.ig.DataSource type](ig.datasource#options:settings.type) and its type property. * + * * @optionValue New value to be set. */ igTileManager(optionLiteral: 'option', optionName: "dataSourceType", optionValue: string): void; /** * Gets the HTTP request method. + * */ igTileManager(optionLiteral: 'option', optionName: "requestType"): string; /** * Sets the HTTP request method. * + * * @optionValue New value to be set. */ igTileManager(optionLiteral: 'option', optionName: "requestType", optionValue: string): void; /** * Gets/Sets the HTTP content type for the response object. See [Perform an asynchronous HTTP (Ajax) request](http://api.jquery.com/jQuery.ajax/). + * */ igTileManager(optionLiteral: 'option', optionName: "responseContentType"): string; /** * /Sets the HTTP content type for the response object. See [Perform an asynchronous HTTP (Ajax) request](http://api.jquery.com/jQuery.ajax/). * + * * @optionValue New value to be set. */ igTileManager(optionLiteral: 'option', optionName: "responseContentType", optionValue: string): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igTileManager(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igTileManager(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igTileManager(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igTileManager(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igTileManager(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igTileManager(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Fired before databinding is performed * @@ -78234,11 +91984,13 @@ interface JQuery { interface IgToolbarLocale { /** * Gets/Sets collapse button title. + * */ collapseButtonTitle?: any; /** * Gets/Sets expand button title. + * */ expandButtonTitle?: any; @@ -78305,50 +92057,71 @@ interface WindowResizedEventUIParam {} interface IgToolbar { /** * Set/Get the widget height. + * */ height?: any; /** * Set/Get the widget width. + * */ width?: any; /** * Get/Set whether the toolbar can be collapsed. + * */ allowCollapsing?: boolean; /** * The css class that will be applied to collapseButtonIcon. + * */ collapseButtonIcon?: string; /** * The css class that will be applied to the expand/collapse button icon. + * */ expandButtonIcon?: string; /** * Formal name of the widget. + * */ name?: string; /** * Display Name of the widget. + * */ displayName?: string; /** * Get/Set Toolbar's items. + * */ items?: any[]; /** * Get/Set whether the widget is expanded initially. + * */ isExpanded?: boolean; locale?: IgToolbarLocale; + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event fired after a click on any toolbar button */ @@ -78472,6 +92245,16 @@ interface IgToolbarMethods { * Destroy the widget. */ destroy(): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igToolbar"): IgToolbarMethods; @@ -78487,117 +92270,167 @@ interface JQuery { igToolbar(methodName: "activateItem", index: Object, activated: Object): void; igToolbar(methodName: "deactivateAll"): void; igToolbar(methodName: "destroy"): void; + igToolbar(methodName: "changeGlobalLanguage"): void; + igToolbar(methodName: "changeGlobalRegional"): void; /** * Set/Get the widget height. + * */ igToolbar(optionLiteral: 'option', optionName: "height"): any; /** * Set/Get the widget height. * + * * @optionValue New value to be set. */ igToolbar(optionLiteral: 'option', optionName: "height", optionValue: any): void; /** * Set/Get the widget width. + * */ igToolbar(optionLiteral: 'option', optionName: "width"): any; /** * Set/Get the widget width. * + * * @optionValue New value to be set. */ igToolbar(optionLiteral: 'option', optionName: "width", optionValue: any): void; /** * Get/Set whether the toolbar can be collapsed. + * */ igToolbar(optionLiteral: 'option', optionName: "allowCollapsing"): boolean; /** * Get/Set whether the toolbar can be collapsed. * + * * @optionValue New value to be set. */ igToolbar(optionLiteral: 'option', optionName: "allowCollapsing", optionValue: boolean): void; /** * The css class that will be applied to collapseButtonIcon. + * */ igToolbar(optionLiteral: 'option', optionName: "collapseButtonIcon"): string; /** * The css class that will be applied to collapseButtonIcon. * + * * @optionValue New value to be set. */ igToolbar(optionLiteral: 'option', optionName: "collapseButtonIcon", optionValue: string): void; /** * The css class that will be applied to the expand/collapse button icon. + * */ igToolbar(optionLiteral: 'option', optionName: "expandButtonIcon"): string; /** * The css class that will be applied to the expand/collapse button icon. * + * * @optionValue New value to be set. */ igToolbar(optionLiteral: 'option', optionName: "expandButtonIcon", optionValue: string): void; /** * Formal name of the widget. + * */ igToolbar(optionLiteral: 'option', optionName: "name"): string; /** * Formal name of the widget. * + * * @optionValue New value to be set. */ igToolbar(optionLiteral: 'option', optionName: "name", optionValue: string): void; /** * Display Name of the widget. + * */ igToolbar(optionLiteral: 'option', optionName: "displayName"): string; /** * Display Name of the widget. * + * * @optionValue New value to be set. */ igToolbar(optionLiteral: 'option', optionName: "displayName", optionValue: string): void; /** * Get/Set Toolbar's items. + * */ igToolbar(optionLiteral: 'option', optionName: "items"): any[]; /** * Get/Set Toolbar's items. * + * * @optionValue New value to be set. */ igToolbar(optionLiteral: 'option', optionName: "items", optionValue: any[]): void; /** * Get/Set whether the widget is expanded initially. + * */ igToolbar(optionLiteral: 'option', optionName: "isExpanded"): boolean; /** * Get/Set whether the widget is expanded initially. * + * * @optionValue New value to be set. */ igToolbar(optionLiteral: 'option', optionName: "isExpanded", optionValue: boolean): void; igToolbar(optionLiteral: 'option', optionName: "locale"): IgToolbarLocale; igToolbar(optionLiteral: 'option', optionName: "locale", optionValue: IgToolbarLocale): void; + /** + * Set/Get the locale language setting for the widget. + * + */ + igToolbar(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igToolbar(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igToolbar(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igToolbar(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event fired after a click on any toolbar button */ @@ -78806,11 +92639,13 @@ interface DeactivatedEventUIParam { interface IgToolbarButton { /** * Enable/Disable the "Toggling" of a button. + * */ allowToggling?: boolean; /** * Get/Set whether the toolbar button is selected. + * */ isSelected?: boolean; @@ -78855,11 +92690,15 @@ interface IgToolbarButtonMethods { /** * Activate toolbar button + * + * @param event */ activate(event: Object): void; /** * Deactivate toolbar button + * + * @param event */ deactivate(event: Object): void; @@ -78886,24 +92725,28 @@ interface JQuery { /** * Gets the "Toggling" of a button. + * */ igToolbarButton(optionLiteral: 'option', optionName: "allowToggling"): boolean; /** * Enable/Disable the "Toggling" of a button. * + * * @optionValue New value to be set. */ igToolbarButton(optionLiteral: 'option', optionName: "allowToggling", optionValue: boolean): void; /** * Get/Set whether the toolbar button is selected. + * */ igToolbarButton(optionLiteral: 'option', optionName: "isSelected"): boolean; /** * Get/Set whether the toolbar button is selected. * + * * @optionValue New value to be set. */ igToolbarButton(optionLiteral: 'option', optionName: "isSelected", optionValue: boolean): void; @@ -78987,53 +92830,63 @@ interface IgTreeBindingsBindings { interface IgTreeBindings { /** * Gets the name of the data source property the value of which would be the node text. + * */ textKey?: string; /** * Gets the XPath to the text attribute/node. Used in client-only binding directly to XML. + * */ textXPath?: string; /** * Gets the name of the data source property the value of which would be the node value. + * */ valueKey?: string; /** * Gets the XPath to the value attribute/node. Used in client-only binding directly to XML. + * */ valueXPath?: string; /** * Gets the name of the data source property the value of which would be used as a URL for the node image. + * */ imageUrlKey?: string; /** * Gets the XPath to the image URL attribute/node. Used in client-only binding directly to XML. + * */ imageUrlXPath?: string; /** * Gets the name of the data source property the value of which would be used as an href attribute for the node anchor. + * */ navigateUrlKey?: string; /** * Gets the XPath to the navigate URL attribute/node. Used in client-only binding directly to XML. + * */ navigateUrlXPath?: string; /** * Gets the name of the data source property the value of which would be used as a target * attribute for the node anchor. + * */ targetKey?: string; /** * Gets the name of the data source property the value of which would hold the node`s * expanded state. The expanded state is represented by a boolean. + * */ expandedKey?: string; @@ -79041,6 +92894,7 @@ interface IgTreeBindings { * Gets the name of the data source property the value of which would hold the node's * check state. The check state itself is represented by a string enumeration with the * checked|partially checked|unchecked states being respectively "on|partial|off". + * */ checkedKey?: string; @@ -79048,32 +92902,38 @@ interface IgTreeBindings { * Gets the name of the data source property the value of which is the primary key attribute * for the data. This property is used when load on demand is enabled and if specified the node paths * would be generated using primary keys instead of indices. + * */ primaryKey?: string; /** * Gets the node content template for the current layer of bindings. The igTree utilizes igTemplating * for generating node content templates. A good example of how to setup templating can be found here http://www.infragistics.com/community/blogs/marina_stoyanova/archive/2014/06/17/how-to-use-templates-to-style-the-different-nodes-of-the-ignite-ui-tree-control.aspx + * */ nodeContentTemplate?: string; /** * Gets the name of the data source property that holds the child data of the current layer node. + * */ childDataProperty?: string; /** * Gets the XPath to the child data node. Used in client-only binding directly to XML. + * */ childDataXPath?: string; /** * Gets the XPath to the root data node. Used in client-only binding directly to XML. + * */ searchFieldXPath?: string; /** * Gets the next layer of bindings in a recursive fashion. + * */ bindings?: IgTreeBindingsBindings; @@ -79086,12 +92946,14 @@ interface IgTreeBindings { interface IgTreeDragAndDropSettings { /** * Gets whether the widget will accept drag and drop from other controls. + * */ allowDrop?: boolean; /** * Gets the drag and drop mode. * + * * Valid values: * "default" Performs "copy" when holding the Ctrl key, otherwise "move" is performed. * "copy" Makes a copy of the dragged node at the drop location. @@ -79101,43 +92963,51 @@ interface IgTreeDragAndDropSettings { /** * Gets the opacity of the drag helper: 0 is fully transparent while 1 is fully opaque. + * */ dragOpacity?: number; /** * Gets whether the helper would revert to its original position upon an invalid drop. + * */ revert?: boolean; /** * Gets the duration of the revert animation. + * */ revertDuration?: number; /** * Gets the z-index that would be set for the drag helper. + * */ zIndex?: number; /** * Gets the delay between mousedown and the start of the actual drag. Smaller values make the nodes * more sensitive to drag and may interfere with selection. + * */ dragStartDelay?: number; /** * Gets whether when dragging over a collapsed node with children will trigger the node to expand. + * */ expandOnDragOver?: boolean; /** * Gets the delay after hovering a parent node before expanding that node during drag when [expandOnDragOver](ui.igtree#options:dragAndDropSettings.expandOnDragOver) is set to true. + * */ expandDelay?: number; /** * Gets the type of helper to be rendered for the drag operation. * + * * Valid values: * "function" A function that will return a DOMElement to use while dragging. * "default" would render the default igTree helper. @@ -79147,6 +93017,7 @@ interface IgTreeDragAndDropSettings { /** * Gets the method for custom drop point validation. Returning true from this function would render the drop point valid, while false would make it invalid. The function has one parameter which is the current drop point and the context (this) of the function is the drag element. * + * * Valid values: * "function" A function that will be used for validating drop points. * "null" Only built-in validation is applied. @@ -79156,6 +93027,7 @@ interface IgTreeDragAndDropSettings { /** * Gets the containment for the drag helper. The area inside of which thehelper is contained would be scrollable while dragging. * + * * Valid values: * "boolean" If set to false, then the draggable elements will be contained in their window. * "selector" The draggable element will be contained to the bounding box of the first element found by the selector. If no element is found, no containment will be set. @@ -79167,46 +93039,55 @@ interface IgTreeDragAndDropSettings { /** * Gets the HTML markup for the invalid helper. + * */ invalidMoveToMarkup?: string; /** * Gets the HTML markup for the "move to" helper. + * */ moveToMarkup?: string; /** * Gets the HTML markup for the "move between" helper. + * */ moveBetweenMarkup?: string; /** * Gets the HTML markup for the "move after" helper. + * */ moveAfterMarkup?: string; /** * Gets the HTML markup for the "move before" helper. + * */ moveBeforeMarkup?: string; /** * Gets the HTML markup for the "copy to" helper. + * */ copyToMarkup?: string; /** * Gets the HTML markup for the "copy between" helper. + * */ copyBetweenMarkup?: string; /** * Gets the HTML markup for the "copy after" helper. + * */ copyAfterMarkup?: string; /** * Gets the HTML markup for the "copy before" helper. + * */ copyBeforeMarkup?: string; @@ -79532,6 +93413,7 @@ interface IgTree { /** * Gets/Sets the width of the control container. * + * * Valid values: * "string" The widget width can be set in pixels (px) and percentage (%). * "number" The widget width can be set as a number in pixels. @@ -79542,6 +93424,7 @@ interface IgTree { /** * Gets/Sets how the height of of the control container. * + * * Valid values: * "string" The widget height can be set in pixels (px) and percentage (%). * "number" The widget height can be set as a number in pixels. @@ -79552,6 +93435,7 @@ interface IgTree { /** * Gets the behavior and type of the checkboxes rendered for the tree nodes. Can be set only at initialization. * + * * Valid values: * "off" Checkboxes are turned off and are not rendered for the tree. * "biState" Checkboxes are rendered and support two states (checked and unchecked). Checkboxes do not cascade down or up in this mode. @@ -79561,17 +93445,20 @@ interface IgTree { /** * Gets/Sets one or more branches to be expanded at a time. If set to true then only one branch at each level of the tree can be expanded at a time. Otherwise multiple branches can be expanded at a time. + * */ singleBranchExpand?: boolean; /** * Gets/Sets whether nodes are hoverable. Setting this option to false would make the tree to not apply hover styles on the nodes when they are hovered. + * */ hotTracking?: boolean; /** * Gets/Sets the image url applied to all parent nodes. * + * * Valid values: * "string" Image with the specified URL will be rendered for each node that has children (If you define both parentNodeImageUrl and parentNodeImageClass the parentNodeImageUrl would take priority). * "null" Option is ignored @@ -79581,6 +93468,7 @@ interface IgTree { /** * Gets/Sets the CSS class applied to all parent nodes. * + * * Valid values: * "string" Specified class with a CSS sprite that would be rendered for each node that has children (If you define both parentNodeImageUrl and parentNodeImageClass the parentNodeImageUrl would take priority). * "null" Option is ignored @@ -79590,6 +93478,7 @@ interface IgTree { /** * Gets/Sets the tooltip applied to all parent node images. * + * * Valid values: * "string" Specified a tooltip that would be rendered for each node that has children. * "null" Option is ignored @@ -79599,6 +93488,7 @@ interface IgTree { /** * Gets/Sets the image url applied to all leaf nodes. * + * * Valid values: * "string" Image with the specified URL will be rendered for each node that has no children (If you define both leafNodeImageUrl and leafNodeImageClass the leafNodeImageUrl would take priority). * "null" Option is ignored @@ -79608,6 +93498,7 @@ interface IgTree { /** * Gets/Sets the CSS class applied to all leaf nodes. * + * * Valid values: * "string" Specified class with a CSS sprite that would be rendered for each node that has no children (If you define both leafNodeImageUrl and leafNodeImageClass the leafNodeImageUrl would take priority). * "null" Option is ignored @@ -79617,6 +93508,7 @@ interface IgTree { /** * Gets/Sets the tooltip applied to all leaf node images. * + * * Valid values: * "string" Specified a tooltip that would be rendered for each node that has no children. * "null" Option is ignored @@ -79625,23 +93517,27 @@ interface IgTree { /** * Gets/Sets the duration of each animation such as the expand/collapse. + * */ animationDuration?: number; /** * Gets the node data-path attribute separator character. + * */ pathSeparator?: string; /** * Gets/Sets the igTree data source. Accepts any valid data source accepted by $.ig.DataSource, or an instance of an $.ig.DataSource itself. * Once the data source is initialized, this option becomes an instance of the $.ig.HierarchicalDataSource. + * */ dataSource?: any; /** * Gets/Sets a remote URL accepted by [$.ig.DataSource](ig.datasource) in order to request data from it. * + * * Valid values: * "string" Specifies the remote url. * "null" Option is ignored. @@ -79651,6 +93547,7 @@ interface IgTree { /** * Gets the type of the data source. Delegates the value to [$.ig.DataSource.settings.type](ig.datasource#options:settings.type). Explicitly set data source type (such as "json"). Please refer to the documentation of $.ig.DataSource.settings.type. * + * * Valid values: * "string" Specifies the data source type implicitly. * "null" Type is inferred. @@ -79660,6 +93557,7 @@ interface IgTree { /** * Gets the JSON key at which a remote data source will write the data. Delegates the value to [$.ig.DataSource.settings.responseDataKey](ig.datasource#options:settings.responseDataKey). Please refer to the documentation of $.ig.DataSource.settings.responseDataKey. * + * * Valid values: * "string" Specifies the name of the property in which data records are held if the response is wrapped. * "null" Option is ignored. @@ -79669,6 +93567,7 @@ interface IgTree { /** * Gets the data type of the remote data source response. Delegates the value to [$.ig.DataSource.settings.responseDataType](ig.datasource#options:settings.responseDataType). Please refer to the documentation of $.ig.DataSource.settings.responseDataType. * + * * Valid values: * "string" Response type when a URL is set as the data source. See http://api.jquery.com/jQuery.ajax/ => dataType. * "null" Type is inferred. @@ -79677,49 +93576,76 @@ interface IgTree { /** * Gets the HTTP verb used for remote requests. Specifies the HTTP verb to be used to issue the requests to the [dataSourceUrl](ui.igtree#options:dataSourceUrl). + * */ requestType?: string; /** * Gets the type of the content in a remote data source response. Content type of the response from the [dataSourceUrl](ui.igtree#options:dataSourceUrl). See http://api.jquery.com/jQuery.ajax/ => contentType + * */ responseContentType?: string; /** * Gets the initial depth the igTree is going to be expanded to upon initial render. + * */ initialExpandDepth?: number; /** * Gets whether all the data would be bound initially or each child collection would be bound upon expand. + * */ loadOnDemand?: boolean; /** * Gets the data binding properties and keys. The igTree uses these to extract the corresponding data from the dataSource. + * */ bindings?: IgTreeBindings; /** * Gets the default target attribute value for the node anchors. + * */ defaultNodeTarget?: string; /** * Gets/Sets whether drag and drop functionality is enabled. + * */ dragAndDrop?: boolean; /** * Gets the URL to which updating requests will be made. + * */ updateUrl?: string; /** * Gets/Sets specific settings for the drag and drop functionality. + * */ dragAndDropSettings?: IgTreeDragAndDropSettings; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Fired before databinding is performed. */ @@ -79850,6 +93776,7 @@ interface IgTreeMethods { * Applies a checked state to a node. * * @param nodeObj Specifies the node element to apply the state to. + * @param cascadeDir */ checkNode(nodeObj: Object, cascadeDir: Object): void; @@ -79857,6 +93784,7 @@ interface IgTreeMethods { * Applies an unchecked state to a node. * * @param nodeObj Specifies the node element to apply the state to. + * @param cascadeDir */ uncheckNode(nodeObj: Object, cascadeDir: Object): void; @@ -79864,6 +93792,7 @@ interface IgTreeMethods { * Applies a partially checked state to a node. * * @param nodeObj Specifies the node element to apply the state to. + * @param cascadeDir */ partiallyCheckNode(nodeObj: Object, cascadeDir: Object): void; @@ -79987,9 +93916,9 @@ interface IgTreeMethods { /** * Retrieves a node object for the specified node element. * - * @param element Specifies the node element. + * @param element Specifies the node jQuery element. */ - nodeFromElement(element: Object): Object; + nodeFromElement(element: string): Object; /** * Retrieves a node object collection of the immediate children of the provided node element. @@ -80080,6 +94009,16 @@ interface IgTreeMethods { * Destructor for the igTree widget. */ destroy(): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igTree"): IgTreeMethods; @@ -80109,7 +94048,7 @@ interface JQuery { igTree(methodName: "findNodesByText", text: string, parent?: Object): any[]; igTree(methodName: "findImmediateNodesByText", text: string, parent?: Object): any[]; igTree(methodName: "nodeByIndex", index: number, parent?: Object): Object; - igTree(methodName: "nodeFromElement", element: Object): Object; + igTree(methodName: "nodeFromElement", element: string): Object; igTree(methodName: "children", parent: Object): any[]; igTree(methodName: "childrenByPath", path: string): any[]; igTree(methodName: "isSelected", node: Object): boolean; @@ -80123,9 +94062,12 @@ interface JQuery { igTree(methodName: "transactionLog"): any[]; igTree(methodName: "nodeDataFor", path: string): Object; igTree(methodName: "destroy"): void; + igTree(methodName: "changeGlobalLanguage"): void; + igTree(methodName: "changeGlobalRegional"): void; /** * Gets/Sets the width of the control container. + * */ igTree(optionLiteral: 'option', optionName: "width"): string|number; @@ -80133,6 +94075,7 @@ interface JQuery { /** * /Sets the width of the control container. * + * * @optionValue New value to be set. */ @@ -80140,6 +94083,7 @@ interface JQuery { /** * Gets/Sets how the height of of the control container. + * */ igTree(optionLiteral: 'option', optionName: "height"): string|number; @@ -80147,6 +94091,7 @@ interface JQuery { /** * /Sets how the height of of the control container. * + * * @optionValue New value to be set. */ @@ -80154,6 +94099,7 @@ interface JQuery { /** * Gets the behavior and type of the checkboxes rendered for the tree nodes. Can be set only at initialization. + * */ igTree(optionLiteral: 'option', optionName: "checkboxMode"): string; @@ -80161,6 +94107,7 @@ interface JQuery { /** * The behavior and type of the checkboxes rendered for the tree nodes. Can be set only at initialization. * + * * @optionValue New value to be set. */ @@ -80168,30 +94115,35 @@ interface JQuery { /** * Gets/Sets one or more branches to be expanded at a time. If set to true then only one branch at each level of the tree can be expanded at a time. Otherwise multiple branches can be expanded at a time. + * */ igTree(optionLiteral: 'option', optionName: "singleBranchExpand"): boolean; /** * /Sets one or more branches to be expanded at a time. If set to true then only one branch at each level of the tree can be expanded at a time. Otherwise multiple branches can be expanded at a time. * + * * @optionValue New value to be set. */ igTree(optionLiteral: 'option', optionName: "singleBranchExpand", optionValue: boolean): void; /** * Gets/Sets whether nodes are hoverable. Setting this option to false would make the tree to not apply hover styles on the nodes when they are hovered. + * */ igTree(optionLiteral: 'option', optionName: "hotTracking"): boolean; /** * /Sets whether nodes are hoverable. Setting this option to false would make the tree to not apply hover styles on the nodes when they are hovered. * + * * @optionValue New value to be set. */ igTree(optionLiteral: 'option', optionName: "hotTracking", optionValue: boolean): void; /** * Gets/Sets the image url applied to all parent nodes. + * */ igTree(optionLiteral: 'option', optionName: "parentNodeImageUrl"): string; @@ -80199,6 +94151,7 @@ interface JQuery { /** * /Sets the image url applied to all parent nodes. * + * * @optionValue New value to be set. */ @@ -80206,6 +94159,7 @@ interface JQuery { /** * Gets/Sets the CSS class applied to all parent nodes. + * */ igTree(optionLiteral: 'option', optionName: "parentNodeImageClass"): string; @@ -80213,6 +94167,7 @@ interface JQuery { /** * /Sets the CSS class applied to all parent nodes. * + * * @optionValue New value to be set. */ @@ -80220,6 +94175,7 @@ interface JQuery { /** * Gets/Sets the tooltip applied to all parent node images. + * */ igTree(optionLiteral: 'option', optionName: "parentNodeImageTooltip"): string; @@ -80227,6 +94183,7 @@ interface JQuery { /** * /Sets the tooltip applied to all parent node images. * + * * @optionValue New value to be set. */ @@ -80234,6 +94191,7 @@ interface JQuery { /** * Gets/Sets the image url applied to all leaf nodes. + * */ igTree(optionLiteral: 'option', optionName: "leafNodeImageUrl"): string; @@ -80241,6 +94199,7 @@ interface JQuery { /** * /Sets the image url applied to all leaf nodes. * + * * @optionValue New value to be set. */ @@ -80248,6 +94207,7 @@ interface JQuery { /** * Gets/Sets the CSS class applied to all leaf nodes. + * */ igTree(optionLiteral: 'option', optionName: "leafNodeImageClass"): string; @@ -80255,6 +94215,7 @@ interface JQuery { /** * /Sets the CSS class applied to all leaf nodes. * + * * @optionValue New value to be set. */ @@ -80262,6 +94223,7 @@ interface JQuery { /** * Gets/Sets the tooltip applied to all leaf node images. + * */ igTree(optionLiteral: 'option', optionName: "leafNodeImageTooltip"): string; @@ -80269,6 +94231,7 @@ interface JQuery { /** * /Sets the tooltip applied to all leaf node images. * + * * @optionValue New value to be set. */ @@ -80276,24 +94239,28 @@ interface JQuery { /** * Gets/Sets the duration of each animation such as the expand/collapse. + * */ igTree(optionLiteral: 'option', optionName: "animationDuration"): number; /** * /Sets the duration of each animation such as the expand/collapse. * + * * @optionValue New value to be set. */ igTree(optionLiteral: 'option', optionName: "animationDuration", optionValue: number): void; /** * Gets the node data-path attribute separator character. + * */ igTree(optionLiteral: 'option', optionName: "pathSeparator"): string; /** * The node data-path attribute separator character. * + * * @optionValue New value to be set. */ igTree(optionLiteral: 'option', optionName: "pathSeparator", optionValue: string): void; @@ -80301,6 +94268,7 @@ interface JQuery { /** * Gets/Sets the igTree data source. Accepts any valid data source accepted by $.ig.DataSource, or an instance of an $.ig.DataSource itself. * Once the data source is initialized, this option becomes an instance of the $.ig.HierarchicalDataSource. + * */ igTree(optionLiteral: 'option', optionName: "dataSource"): any; @@ -80308,12 +94276,14 @@ interface JQuery { * /Sets the igTree data source. Accepts any valid data source accepted by $.ig.DataSource, or an instance of an $.ig.DataSource itself. * Once the data source is initialized, this option becomes an instance of the $.ig.HierarchicalDataSource. * + * * @optionValue New value to be set. */ igTree(optionLiteral: 'option', optionName: "dataSource", optionValue: any): void; /** * Gets/Sets a remote URL accepted by [$.ig.DataSource](ig.datasource) in order to request data from it. + * */ igTree(optionLiteral: 'option', optionName: "dataSourceUrl"): string; @@ -80321,6 +94291,7 @@ interface JQuery { /** * /Sets a remote URL accepted by [$.ig.DataSource](ig.datasource) in order to request data from it. * + * * @optionValue New value to be set. */ @@ -80328,6 +94299,7 @@ interface JQuery { /** * Gets the type of the data source. Delegates the value to [$.ig.DataSource.settings.type](ig.datasource#options:settings.type). Explicitly set data source type (such as "json"). Please refer to the documentation of $.ig.DataSource.settings.type. + * */ igTree(optionLiteral: 'option', optionName: "dataSourceType"): string; @@ -80335,6 +94307,7 @@ interface JQuery { /** * The type of the data source. Delegates the value to [$.ig.DataSource.settings.type](ig.datasource#options:settings.type). Explicitly set data source type (such as "json"). Please refer to the documentation of $.ig.DataSource.settings.type. * + * * @optionValue New value to be set. */ @@ -80342,6 +94315,7 @@ interface JQuery { /** * Gets the JSON key at which a remote data source will write the data. Delegates the value to [$.ig.DataSource.settings.responseDataKey](ig.datasource#options:settings.responseDataKey). Please refer to the documentation of $.ig.DataSource.settings.responseDataKey. + * */ igTree(optionLiteral: 'option', optionName: "responseDataKey"): string; @@ -80349,6 +94323,7 @@ interface JQuery { /** * The JSON key at which a remote data source will write the data. Delegates the value to [$.ig.DataSource.settings.responseDataKey](ig.datasource#options:settings.responseDataKey). Please refer to the documentation of $.ig.DataSource.settings.responseDataKey. * + * * @optionValue New value to be set. */ @@ -80356,6 +94331,7 @@ interface JQuery { /** * Gets the data type of the remote data source response. Delegates the value to [$.ig.DataSource.settings.responseDataType](ig.datasource#options:settings.responseDataType). Please refer to the documentation of $.ig.DataSource.settings.responseDataType. + * */ igTree(optionLiteral: 'option', optionName: "responseDataType"): string; @@ -80363,6 +94339,7 @@ interface JQuery { /** * The data type of the remote data source response. Delegates the value to [$.ig.DataSource.settings.responseDataType](ig.datasource#options:settings.responseDataType). Please refer to the documentation of $.ig.DataSource.settings.responseDataType. * + * * @optionValue New value to be set. */ @@ -80370,112 +94347,174 @@ interface JQuery { /** * Gets the HTTP verb used for remote requests. Gets the HTTP verb to be used to issue the requests to the [dataSourceUrl](ui.igtree#options:dataSourceUrl). + * */ igTree(optionLiteral: 'option', optionName: "requestType"): string; /** * The HTTP verb used for remote requests. Sets the HTTP verb to be used to issue the requests to the [dataSourceUrl](ui.igtree#options:dataSourceUrl). * + * * @optionValue New value to be set. */ igTree(optionLiteral: 'option', optionName: "requestType", optionValue: string): void; /** * Gets the type of the content in a remote data source response. Content type of the response from the [dataSourceUrl](ui.igtree#options:dataSourceUrl). See http://api.jquery.com/jQuery.ajax/ => contentType + * */ igTree(optionLiteral: 'option', optionName: "responseContentType"): string; /** * The type of the content in a remote data source response. Content type of the response from the [dataSourceUrl](ui.igtree#options:dataSourceUrl). See http://api.jquery.com/jQuery.ajax/ => contentType * + * * @optionValue New value to be set. */ igTree(optionLiteral: 'option', optionName: "responseContentType", optionValue: string): void; /** * Gets the initial depth the igTree is going to be expanded to upon initial render. + * */ igTree(optionLiteral: 'option', optionName: "initialExpandDepth"): number; /** * The initial depth the igTree is going to be expanded to upon initial render. * + * * @optionValue New value to be set. */ igTree(optionLiteral: 'option', optionName: "initialExpandDepth", optionValue: number): void; /** * Gets whether all the data would be bound initially or each child collection would be bound upon expand. + * */ igTree(optionLiteral: 'option', optionName: "loadOnDemand"): boolean; /** * Whether all the data would be bound initially or each child collection would be bound upon expand. * + * * @optionValue New value to be set. */ igTree(optionLiteral: 'option', optionName: "loadOnDemand", optionValue: boolean): void; /** * Gets the data binding properties and keys. The igTree uses these to extract the corresponding data from the dataSource. + * */ igTree(optionLiteral: 'option', optionName: "bindings"): IgTreeBindings; /** * The data binding properties and keys. The igTree uses these to extract the corresponding data from the dataSource. * + * * @optionValue New value to be set. */ igTree(optionLiteral: 'option', optionName: "bindings", optionValue: IgTreeBindings): void; /** * Gets the default target attribute value for the node anchors. + * */ igTree(optionLiteral: 'option', optionName: "defaultNodeTarget"): string; /** * The default target attribute value for the node anchors. * + * * @optionValue New value to be set. */ igTree(optionLiteral: 'option', optionName: "defaultNodeTarget", optionValue: string): void; /** * Gets/Sets whether drag and drop functionality is enabled. + * */ igTree(optionLiteral: 'option', optionName: "dragAndDrop"): boolean; /** * /Sets whether drag and drop functionality is enabled. * + * * @optionValue New value to be set. */ igTree(optionLiteral: 'option', optionName: "dragAndDrop", optionValue: boolean): void; /** * Gets the URL to which updating requests will be made. + * */ igTree(optionLiteral: 'option', optionName: "updateUrl"): string; /** * The URL to which updating requests will be made. * + * * @optionValue New value to be set. */ igTree(optionLiteral: 'option', optionName: "updateUrl", optionValue: string): void; /** * Gets/Sets specific settings for the drag and drop functionality. + * */ igTree(optionLiteral: 'option', optionName: "dragAndDropSettings"): IgTreeDragAndDropSettings; /** * /Sets specific settings for the drag and drop functionality. * + * * @optionValue New value to be set. */ igTree(optionLiteral: 'option', optionName: "dragAndDropSettings", optionValue: IgTreeDragAndDropSettings): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igTree(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igTree(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igTree(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igTree(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igTree(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igTree(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Fired before databinding is performed. */ @@ -80761,22 +94800,26 @@ interface IgTreeGridColumnFixing { /** * Specifies whether to show the column fixing buttons in header cells/feature chooser. + * */ showFixButtons?: boolean; /** * Enable row height sync for the fixed and unfixed portion of the grid. If you're observing row misalignment, please refer to [this article](http://www.igniteui.com/help/iggrid-known-issues#misalignment-ie9). + * */ syncRowHeights?: boolean; /** * Scroll delta in pixels when scrolling with the mouse wheel or the keyboard in the fixed columns area of the grid. + * */ scrollDelta?: number; /** * Configures which side the fixed columns of the grid will be rendered on. Check [this topic](http://www.igniteui.com/help/iggrid-columnfixing-configuring#direction) out of more information. * + * * Valid values: * "left" Fixed columns are rendered on the left side of the main grid. * "right" Fixed columns are rendered on the right side of the main grid. @@ -80785,12 +94828,14 @@ interface IgTreeGridColumnFixing { /** * List of column settings that specifies custom column fixing options on a per column basis. + * */ columnSettings?: IgGridColumnFixingColumnSetting[]; /** * Minimal visible area in pixels for the unfixed columns. If the end user tries to fix a column(or columns), which causes the width of the fixed columns to grow such that the width of visible area of unfixed columns is less than this option then fixing will be canceled. Check [this topic](http://www.igniteui.com/help/iggrid-columnfixing-configuring#non-fixable-min-width) out for more information. * + * * Valid values: * "string" The width can be set in pixels (px) and percentage (%). * "number" The width can be set in pixels as a number. @@ -80799,6 +94844,7 @@ interface IgTreeGridColumnFixing { /** * Specify initial fixing of all non data columns. Non-data columns are columns in the grid rendered for specific features, like the row selectors feature. The column containing the row numbering is such a column. This option is applicable when [fixingDirection](ui.iggridcolumnfixing#options:fixingDirection) is set to left. For a full column fixing configuration summary please refer to [this topic](http://www.igniteui.com/help/iggrid-columnfixing-configuring#configuration-summary). + * */ fixNondataColumns?: boolean; @@ -80844,6 +94890,8 @@ interface IgTreeGridColumnFixing { } interface IgTreeGridColumnFixingMethods { destroy(): void; + changeGlobalLanguage(): void; + changeGlobalRegional(): void; /** * Unfixes a column by specified column identifier - column key or column index. @@ -80866,6 +94914,11 @@ interface IgTreeGridColumnFixingMethods { * @param clearRowsHeights Clears row heigths for all visible rows. */ syncHeights(check?: boolean, clearRowsHeights?: boolean): void; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.iggridcolumnfixing#options:language) + * Note that this method is for rare scenarios, see [language](ui.iggridcolumnfixing#options:language) or [locale](ui.iggridcolumnfixing#options:locale) option setter + */ changeLocale(): void; /** @@ -80946,6 +94999,8 @@ interface JQuery { interface JQuery { igTreeGridColumnFixing(methodName: "destroy"): void; + igTreeGridColumnFixing(methodName: "changeGlobalLanguage"): void; + igTreeGridColumnFixing(methodName: "changeGlobalRegional"): void; igTreeGridColumnFixing(methodName: "unfixColumn", colIdentifier: Object, target?: string, after?: boolean): Object; igTreeGridColumnFixing(methodName: "checkAndSyncHeights"): void; igTreeGridColumnFixing(methodName: "syncHeights", check?: boolean, clearRowsHeights?: boolean): void; @@ -81022,42 +95077,49 @@ interface JQuery { /** * Gets whether to show the column fixing buttons in header cells/feature chooser. + * */ igTreeGridColumnFixing(optionLiteral: 'option', optionName: "showFixButtons"): boolean; /** * Sets whether to show the column fixing buttons in header cells/feature chooser. * + * * @optionValue New value to be set. */ igTreeGridColumnFixing(optionLiteral: 'option', optionName: "showFixButtons", optionValue: boolean): void; /** * Enable row height sync for the fixed and unfixed portion of the grid. If you're observing row misalignment, please refer to [this article](http://www.igniteui.com/help/iggrid-known-issues#misalignment-ie9). + * */ igTreeGridColumnFixing(optionLiteral: 'option', optionName: "syncRowHeights"): boolean; /** * Enable row height sync for the fixed and unfixed portion of the grid. If you're observing row misalignment, please refer to [this article](http://www.igniteui.com/help/iggrid-known-issues#misalignment-ie9). * + * * @optionValue New value to be set. */ igTreeGridColumnFixing(optionLiteral: 'option', optionName: "syncRowHeights", optionValue: boolean): void; /** * Scroll delta in pixels when scrolling with the mouse wheel or the keyboard in the fixed columns area of the grid. + * */ igTreeGridColumnFixing(optionLiteral: 'option', optionName: "scrollDelta"): number; /** * Scroll delta in pixels when scrolling with the mouse wheel or the keyboard in the fixed columns area of the grid. * + * * @optionValue New value to be set. */ igTreeGridColumnFixing(optionLiteral: 'option', optionName: "scrollDelta", optionValue: number): void; /** * Configures which side the fixed columns of the grid will be rendered on. Check [this topic](http://www.igniteui.com/help/iggrid-columnfixing-configuring#direction) out of more information. + * */ igTreeGridColumnFixing(optionLiteral: 'option', optionName: "fixingDirection"): string; @@ -81065,6 +95127,7 @@ interface JQuery { /** * Configures which side the fixed columns of the grid will be rendered on. Check [this topic](http://www.igniteui.com/help/iggrid-columnfixing-configuring#direction) out of more information. * + * * @optionValue New value to be set. */ @@ -81072,18 +95135,21 @@ interface JQuery { /** * List of column settings that specifies custom column fixing options on a per column basis. + * */ igTreeGridColumnFixing(optionLiteral: 'option', optionName: "columnSettings"): IgGridColumnFixingColumnSetting[]; /** * List of column settings that specifies custom column fixing options on a per column basis. * + * * @optionValue New value to be set. */ igTreeGridColumnFixing(optionLiteral: 'option', optionName: "columnSettings", optionValue: IgGridColumnFixingColumnSetting[]): void; /** * Minimal visible area in pixels for the unfixed columns. If the end user tries to fix a column(or columns), which causes the width of the fixed columns to grow such that the width of visible area of unfixed columns is less than this option then fixing will be canceled. Check [this topic](http://www.igniteui.com/help/iggrid-columnfixing-configuring#non-fixable-min-width) out for more information. + * */ igTreeGridColumnFixing(optionLiteral: 'option', optionName: "minimalVisibleAreaWidth"): string|number; @@ -81091,6 +95157,7 @@ interface JQuery { /** * Minimal visible area in pixels for the unfixed columns. If the end user tries to fix a column(or columns), which causes the width of the fixed columns to grow such that the width of visible area of unfixed columns is less than this option then fixing will be canceled. Check [this topic](http://www.igniteui.com/help/iggrid-columnfixing-configuring#non-fixable-min-width) out for more information. * + * * @optionValue New value to be set. */ @@ -81098,12 +95165,14 @@ interface JQuery { /** * Specify initial fixing of all non data columns. Non-data columns are columns in the grid rendered for specific features, like the row selectors feature. The column containing the row numbering is such a column. This option is applicable when [fixingDirection](ui.iggridcolumnfixing#options:fixingDirection) is set to left. For a full column fixing configuration summary please refer to [this topic](http://www.igniteui.com/help/iggrid-columnfixing-configuring#configuration-summary). + * */ igTreeGridColumnFixing(optionLiteral: 'option', optionName: "fixNondataColumns"): boolean; /** * Specify initial fixing of all non data columns. Non-data columns are columns in the grid rendered for specific features, like the row selectors feature. The column containing the row numbering is such a column. This option is applicable when [fixingDirection](ui.iggridcolumnfixing#options:fixingDirection) is set to left. For a full column fixing configuration summary please refer to [this topic](http://www.igniteui.com/help/iggrid-columnfixing-configuring#configuration-summary). * + * * @optionValue New value to be set. */ igTreeGridColumnFixing(optionLiteral: 'option', optionName: "fixNondataColumns", optionValue: boolean): void; @@ -81198,14 +95267,21 @@ interface JQuery { igTreeGridColumnFixing(methodName: string, ...methodParams: any[]): any; } interface IgTreeGridColumnMoving { + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + inherit?: boolean; + /** * A list of column settings that specifies moving options on a per column basis. + * */ columnSettings?: IgGridColumnMovingColumnSetting[]; /** * Specify the drag-and-drop mode for the feature * + * * Valid values: * "immediate" Column headers will rearange as you drag with a space opening under the cursor for the header to be dropped on * "deferred" A clone of the header dragged will be created and indicators will be shown between columns to help navigate the drop. @@ -81215,6 +95291,7 @@ interface IgTreeGridColumnMoving { /** * Specify the way columns will be rearranged * + * * Valid values: * "dom" Columns will be rearranged through dom manipulation * "render" Columns will not be rearranged but the grid will be rendered again with the new column order. Please note this option is incompatible with immediate move mode. @@ -81223,47 +95300,56 @@ interface IgTreeGridColumnMoving { /** * Specifies if header cells should include an additional button that opens a moving helper dropdown. + * */ addMovingDropdown?: boolean; /** * Specifies width of column moving dialog + * */ movingDialogWidth?: number; /** * Specifies height of column moving dialog + * */ movingDialogHeight?: number; /** * Specifies time in milliseconds for animation duration to show/hide modal dialog + * */ movingDialogAnimationDuration?: number; /** * Specifies the length (in pixels) between the dragged column and the column edges below which the move operation is accepted + * */ movingAcceptanceTolerance?: number; /** * Specifies the length (in pixels) between the dragged column and the grid edges below which horizontal scrolling occurs + * */ movingScrollTolerance?: number; /** * Specifies a multiplier for the delay between subsequent scroll operations. The larger this number is, the slower scrolling will appear to be. + * */ scrollSpeedMultiplier?: number; /** * Specifies the length (in pixels) of each individual scroll operation + * */ scrollDelta?: number; /** * Specifies whether the contents of the column being dragged will get hidden. The option is only * relevant in immediate moving mode. + * */ hideHeaderContentsDuringDrag?: boolean; @@ -81271,6 +95357,7 @@ interface IgTreeGridColumnMoving { * Specifies the opacity of the drag markup, while a column header is being dragged. * The value must be between 0 and 1. When GroupBy is enabled, the corresponding option in the GroupBy configuration * will be used with priority over this one. + * */ dragHelperOpacity?: number; @@ -81343,6 +95430,7 @@ interface IgTreeGridColumnMoving { /** * Specifies markup for drop tooltip in column moving dialog + * */ movingDialogDropTooltipMarkup?: string; @@ -81356,14 +95444,10 @@ interface IgTreeGridColumnMoving { /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. + * */ dialogWidget?: string; - /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. - */ - inherit?: boolean; - /** * Event which is fired when a drag operation begins on a column header */ @@ -81451,6 +95535,13 @@ interface IgTreeGridColumnMoving { } interface IgTreeGridColumnMovingMethods { destroy(): void; + changeGlobalLanguage(): void; + changeGlobalRegional(): void; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.iggridcolumnmoving#options:language) + * Note that this method is for rare scenarios, see [language](ui.iggridcolumnmoving#options:language) or [locale](ui.iggridcolumnmoving#options:locale) option setter + */ changeLocale(): void; /** @@ -81471,23 +95562,40 @@ interface JQuery { interface JQuery { igTreeGridColumnMoving(methodName: "destroy"): void; + igTreeGridColumnMoving(methodName: "changeGlobalLanguage"): void; + igTreeGridColumnMoving(methodName: "changeGlobalRegional"): void; igTreeGridColumnMoving(methodName: "changeLocale"): void; igTreeGridColumnMoving(methodName: "moveColumn", column: Object, target: Object, after?: boolean, inDom?: boolean, callback?: Function): void; + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + igTreeGridColumnMoving(optionLiteral: 'option', optionName: "inherit"): boolean; + + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + * + * @optionValue New value to be set. + */ + igTreeGridColumnMoving(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + /** * A list of column settings that specifies moving options on a per column basis. + * */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "columnSettings"): IgGridColumnMovingColumnSetting[]; /** * A list of column settings that specifies moving options on a per column basis. * + * * @optionValue New value to be set. */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "columnSettings", optionValue: IgGridColumnMovingColumnSetting[]): void; /** * Specify the drag-and-drop mode for the feature + * */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "mode"): string; @@ -81495,6 +95603,7 @@ interface JQuery { /** * Specify the drag-and-drop mode for the feature * + * * @optionValue New value to be set. */ @@ -81502,6 +95611,7 @@ interface JQuery { /** * Specify the way columns will be rearranged + * */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "moveType"): string; @@ -81509,6 +95619,7 @@ interface JQuery { /** * Specify the way columns will be rearranged * + * * @optionValue New value to be set. */ @@ -81516,96 +95627,112 @@ interface JQuery { /** * Gets if header cells should include an additional button that opens a moving helper dropdown. + * */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "addMovingDropdown"): boolean; /** * Sets if header cells should include an additional button that opens a moving helper dropdown. * + * * @optionValue New value to be set. */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "addMovingDropdown", optionValue: boolean): void; /** * Gets width of column moving dialog + * */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "movingDialogWidth"): number; /** * Sets width of column moving dialog * + * * @optionValue New value to be set. */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "movingDialogWidth", optionValue: number): void; /** * Gets height of column moving dialog + * */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "movingDialogHeight"): number; /** * Sets height of column moving dialog * + * * @optionValue New value to be set. */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "movingDialogHeight", optionValue: number): void; /** * Gets time in milliseconds for animation duration to show/hide modal dialog + * */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "movingDialogAnimationDuration"): number; /** * Sets time in milliseconds for animation duration to show/hide modal dialog * + * * @optionValue New value to be set. */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "movingDialogAnimationDuration", optionValue: number): void; /** * Gets the length (in pixels) between the dragged column and the column edges below which the move operation is accepted + * */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "movingAcceptanceTolerance"): number; /** * Sets the length (in pixels) between the dragged column and the column edges below which the move operation is accepted * + * * @optionValue New value to be set. */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "movingAcceptanceTolerance", optionValue: number): void; /** * Gets the length (in pixels) between the dragged column and the grid edges below which horizontal scrolling occurs + * */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "movingScrollTolerance"): number; /** * Sets the length (in pixels) between the dragged column and the grid edges below which horizontal scrolling occurs * + * * @optionValue New value to be set. */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "movingScrollTolerance", optionValue: number): void; /** * Gets a multiplier for the delay between subsequent scroll operations. The larger this number is, the slower scrolling will appear to be. + * */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "scrollSpeedMultiplier"): number; /** * Sets a multiplier for the delay between subsequent scroll operations. The larger this number is, the slower scrolling will appear to be. * + * * @optionValue New value to be set. */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "scrollSpeedMultiplier", optionValue: number): void; /** * Gets the length (in pixels) of each individual scroll operation + * */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "scrollDelta"): number; /** * Sets the length (in pixels) of each individual scroll operation * + * * @optionValue New value to be set. */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "scrollDelta", optionValue: number): void; @@ -81613,6 +95740,7 @@ interface JQuery { /** * Gets whether the contents of the column being dragged will get hidden. The option is only * relevant in immediate moving mode. + * */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "hideHeaderContentsDuringDrag"): boolean; @@ -81620,6 +95748,7 @@ interface JQuery { * Sets whether the contents of the column being dragged will get hidden. The option is only * relevant in immediate moving mode. * + * * @optionValue New value to be set. */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "hideHeaderContentsDuringDrag", optionValue: boolean): void; @@ -81628,6 +95757,7 @@ interface JQuery { * Gets the opacity of the drag markup, while a column header is being dragged. * The value must be between 0 and 1. When GroupBy is enabled, the corresponding option in the GroupBy configuration * will be used with priority over this one. + * */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "dragHelperOpacity"): number; @@ -81636,6 +95766,7 @@ interface JQuery { * The value must be between 0 and 1. When GroupBy is enabled, the corresponding option in the GroupBy configuration * will be used with priority over this one. * + * * @optionValue New value to be set. */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "dragHelperOpacity", optionValue: number): void; @@ -81798,12 +95929,14 @@ interface JQuery { /** * Gets markup for drop tooltip in column moving dialog + * */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "movingDialogDropTooltipMarkup"): string; /** * Sets markup for drop tooltip in column moving dialog * + * * @optionValue New value to be set. */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "movingDialogDropTooltipMarkup", optionValue: string): void; @@ -81828,27 +95961,17 @@ interface JQuery { /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. + * */ igTreeGridColumnMoving(optionLiteral: 'option', optionName: "dialogWidget"): string; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. * - * @optionValue New value to be set. - */ - igTreeGridColumnMoving(optionLiteral: 'option', optionName: "dialogWidget", optionValue: string): void; - - /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. - */ - igTreeGridColumnMoving(optionLiteral: 'option', optionName: "inherit"): boolean; - - /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. * * @optionValue New value to be set. */ - igTreeGridColumnMoving(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + igTreeGridColumnMoving(optionLiteral: 'option', optionName: "dialogWidget", optionValue: string): void; /** * Event which is fired when a drag operation begins on a column header @@ -82056,6 +96179,7 @@ interface IgTreeGridFilteringLocale { * ${startRecord} (paging) * ${endRecord} (paging) * ${recordCount} (paging) + * */ filterSummaryInPagerTemplate?: string; @@ -82068,21 +96192,25 @@ interface IgTreeGridFilteringLocale { interface IgTreeGridFiltering { /** * The property in the response that will hold the total number of records in the data source + * */ recordCountKey?: string; /** * Specifies from which data bound level to be applied filtering - 0 is the first level + * */ fromLevel?: number; /** * Specifies to which data bound level to be applied filtering - if -1 filtering should be applied to the last data bound level + * */ toLevel?: number; /** * If displayMode is showWithAncestorsAndDescendants, show all records that match filtering conditions and their child records, even if child records don"t match filtering conditions. If displayMode is showWithAncestors show only those records that match filtering conditions and do not show child records(if any) that don"t match filtering conditions + * */ displayMode?: any; @@ -82090,6 +96218,7 @@ interface IgTreeGridFiltering { * Specifies the name of a boolean property in the dataRecord object that indicates whether the dataRow matches the filtering conditions. * When filtering a boolean flag with the specified name is added on each data record object with a value of true if it matches the condition or false if it doesn"t. * This is used mainly for internal purposes. + * */ matchFiltering?: string; @@ -82107,8 +96236,14 @@ interface IgTreeGridFiltering { filterSummaryInPagerTemplate?: string; locale?: IgTreeGridFilteringLocale; + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + inherit?: boolean; + /** * Enables or disables the filtering case sensitivity. Works only for local filtering. If true, it case sensitive filtering is performed. If false, filtering is case insensitive. + * */ caseSensitive?: boolean; @@ -82116,11 +96251,13 @@ interface IgTreeGridFiltering { * Enable/disable footer visibility with summary info about the filter. * When false, the filter summary row (in the footer) will only be visible when paging is enabled (or some other feature that renders a footer). * When true, the filter summary row will only be visible when a filter is applied i.e. it's not visible by default. + * */ filterSummaryAlwaysVisible?: boolean; /** * Render in [Feature Chooser](http://www.igniteui.com/help/iggrid-feature-chooser) + * */ renderFC?: boolean; @@ -82133,6 +96270,7 @@ interface IgTreeGridFiltering { /** * Type of animations for the column filter dropdowns. * + * * Valid values: * "linear" The column filtering drop downs are shown with a linear animation. * "none" No animation is used when showing the filtering drop downs. @@ -82141,12 +96279,14 @@ interface IgTreeGridFiltering { /** * Animation duration in milliseconds for the [filterDropDownAnimations](ui.iggridfiltering#options:filterDropDownAnimations). + * */ filterDropDownAnimationDuration?: number; /** * Width of the column filter dropdowns. * + * * Valid values: * "string" The width in pixels (0px) * "number" The width in pixels as a number (0) @@ -82163,12 +96303,14 @@ interface IgTreeGridFiltering { /** * URL key name that specifies how the filtering expressions will be encoded for remote requests, e.g. &filter('col') = startsWith. Default is OData. + * */ filterExprUrlKey?: string; /** * Enable/disable filter icons visibility. * + * * Valid values: * "true" All predefined filters in the filter dropdowns will have icons rendered in front of the text. * "false" No icons will be rendered. @@ -82177,12 +96319,14 @@ interface IgTreeGridFiltering { /** * A list of column settings that specifies custom filtering options on a per column basis. + * */ columnSettings?: IgGridFilteringColumnSetting[]; /** * Type of filtering. Delegates all filtering functionality to the [$.ig.DataSource](ig.datasource). * + * * Valid values: * "remote" Filtering is performed by a remote end-point. * "local" Filtering is performed locally by the [$.ig.DataSource](ig.datasource). @@ -82191,12 +96335,14 @@ interface IgTreeGridFiltering { /** * Time in milliseconds for which widget will wait between keystrokes before sending filtering requests. + * */ filterDelay?: number; /** * Default is 'simple' for non-virtualized grids, and 'advanced' when [virtualization](ui.iggrid#options:virtualization) is enabled. * + * * Valid values: * "simple" Renders just a filter row. * "advanced" Allows to configure multiple filters from a dialog - Excel style. @@ -82205,12 +96351,14 @@ interface IgTreeGridFiltering { /** * Defines whether to render editors in advanced [mode](ui.iggridfiltering#options:mode). If false, no editors will be rendered in the advanced [mode](ui.iggridfiltering#options:mode). + * */ advancedModeEditorsVisible?: boolean; /** * Location of the advanced filtering button when [advancedModeEditorsVisible](ui.iggridfiltering#options:advancedModeEditorsVisible) is false (i.e. when the button is rendered in the header). * + * * Valid values: * "left" * "right" @@ -82220,6 +96368,7 @@ interface IgTreeGridFiltering { /** * Default filter dialog width (used for Advanced filtering [mode](ui.iggridfiltering#options:mode)). * + * * Valid values: * "string" The dialog window width in pixels (370px). * "number" The dialog window width in pixels as a number (370). @@ -82229,6 +96378,7 @@ interface IgTreeGridFiltering { /** * default filter dialog height (used for Advanced filtering [mode](ui.iggridfiltering#options:mode)). * + * * Valid values: * "string" The dialog window height in pixels (350px). * "number" The dialog window height in pixels as a number (350). @@ -82238,6 +96388,7 @@ interface IgTreeGridFiltering { /** * Width of the filtering condition dropdowns in the advanced filter dialog. * + * * Valid values: * "string" The filtering condition dropdowns width in pixels (80px). * "number" The filtering condition dropdowns width in pixels as a number (80). @@ -82247,6 +96398,7 @@ interface IgTreeGridFiltering { /** * Width of the filtering expression input boxes in the advanced filter dialog. * + * * Valid values: * "string" The filtering expression input boxes width in pixels (80px). * "number" The filtering expression input boxes width in pixels as a number (80). @@ -82256,6 +96408,7 @@ interface IgTreeGridFiltering { /** * Width of the column chooser dropdowns in the advanced filter dialog. * + * * Valid values: * "string" The column chooser dropdowns width in pixels (80px). * "number" The column chooser dropdowns width in pixels as a number (80). @@ -82264,12 +96417,14 @@ interface IgTreeGridFiltering { /** * Enable/disable filter button visibility. If false, no filter dropdown buttons will be rendered and a predefined list of filters will not be rendered for the columns. + * */ renderFilterButton?: boolean; /** * The filtering button for filter dropdowns can be rendered either on the left of the filter editor, or on the right. * + * * Valid values: * "left" The button is rendered on the left. * "right" The button is rendered on the right. @@ -82314,11 +96469,13 @@ interface IgTreeGridFiltering { /** * Custom template for add condition area in the filter dialog. The default template is "
${label1}
${label2}
". + * */ filterDialogAddConditionTemplate?: string; /** * Custom template for options in dropdown in add condition area in the filter dialog. The default template is "". + * */ filterDialogAddConditionDropDownTemplate?: string; @@ -82328,17 +96485,20 @@ interface IgTreeGridFiltering { * E.g.: DOM element used for selecting column has attribute "data-af-col", for selecting filter condition - "data-af-cond", for filter expression- "data-af-expr". * NOTE: The template is supported only with
. * The default template is "". + * */ filterDialogFilterTemplate?: string; /** * Custom template for options in condition list in filter dialog. The default template is "". + * */ filterDialogFilterConditionTemplate?: string; /** * Add button width - in the advanced filter dialog. * + * * Valid values: * "string" The dialog Add button width in pixels (100px). * "number" The dialog Add button width in pixels as a number (100). @@ -82348,6 +96508,7 @@ interface IgTreeGridFiltering { /** * Width of the Ok and Cancel buttons in the advanced filtering dialogs. * + * * Valid values: * "string" The advanced filter dialog Ok and Cancel buttons width in pixels (120px). * "number" The advanced filter dialog Ok and Cancel buttons width in pixels as a number (120). @@ -82356,6 +96517,7 @@ interface IgTreeGridFiltering { /** * Maximum number of filter rows in the advanced filtering dialog. If this number is exceeded, an error message will be rendered. + * */ filterDialogMaxFilterCount?: number; @@ -82369,28 +96531,114 @@ interface IgTreeGridFiltering { /** * Enable/disable empty condition visibility in the filter. If true, shows empty and not empty filtering conditions in the dropdowns. + * */ showEmptyConditions?: boolean; /** * Enable/disable visibility of null and not null filtering conditions in the dropdowns. If true, shows null and not null filtering conditions in the dropdowns. + * */ showNullConditions?: boolean; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. + * */ dialogWidget?: string; /** * Enables/disables filtering persistence between states. + * */ persist?: boolean; /** - * Enables/disables feature inheritance for the child [layouts](ui.ighierarchicalgrid#options:columnLayouts). NOTE: It only applies for [igHierarchicalGrid](ui.ighierarchicalgrid). + * Event fired before a filtering operation is executed (remote request or local). + * Return false in order to cancel filtering operation. */ - inherit?: boolean; + dataFiltering?: DataFilteringEvent; + + /** + * Event fired after the filtering has been executed and results are rendered. + */ + dataFiltered?: DataFilteredEvent; + + /** + * Event fired before the filter dropdown is opened for a specific column. + * Return false in order to cancel dropdown opening. + */ + dropDownOpening?: DropDownOpeningEvent; + + /** + * Event fired after the filter dropdown is opened for a specific column. + */ + dropDownOpened?: DropDownOpenedEvent; + + /** + * Event fired before the filter dropdown starts closing. + * Return false in order to cancel dropdown closing. + */ + dropDownClosing?: DropDownClosingEvent; + + /** + * Event fired after a filter column dropdown is completely closed. + */ + dropDownClosed?: DropDownClosedEvent; + + /** + * Event fired before the advanced filtering dialog is opened. + * Return false in order to cancel filter dialog opening. + */ + filterDialogOpening?: FilterDialogOpeningEvent; + + /** + * Event fired after the advanced filter dialog is already opened. + */ + filterDialogOpened?: FilterDialogOpenedEvent; + + /** + * Event fired every time the advanced filter dialog changes its position. + */ + filterDialogMoving?: FilterDialogMovingEvent; + + /** + * Event fired before a filter row is added to the advanced filter dialog. + * Return false in order to cancel filter adding to the advanced filtering dialog. + */ + filterDialogFilterAdding?: FilterDialogFilterAddingEvent; + + /** + * Event fired after a filter row is added to the advanced filter dialog. + */ + filterDialogFilterAdded?: FilterDialogFilterAddedEvent; + + /** + * Event fired before the advanced filter dialog is closed. + * Return false in order to cancel filtering dialog closing. + */ + filterDialogClosing?: FilterDialogClosingEvent; + + /** + * Event fired after the advanced filter dialog has been closed. + */ + filterDialogClosed?: FilterDialogClosedEvent; + + /** + * Event fired before the contents of the advanced filter dialog are rendered. + * Return false in order to cancel filtering dialog rendering. + */ + filterDialogContentsRendering?: FilterDialogContentsRenderingEvent; + + /** + * Event fired after the contents of the advanced filter dialog are rendered. + */ + filterDialogContentsRendered?: FilterDialogContentsRenderedEvent; + + /** + * Event fired when the OK button in the advanced filter dialog is pressed. + */ + filterDialogFiltering?: FilterDialogFilteringEvent; /** * Option for igTreeGridFiltering @@ -82403,6 +96651,43 @@ interface IgTreeGridFilteringMethods { */ getFilteringMatchesCount(): number; destroy(): void; + changeGlobalLanguage(): void; + changeGlobalRegional(): void; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.iggridfiltering#options:language) + * Note that this method is for rare scenarios, see [language](ui.iggridfiltering#options:language) or [locale](ui.iggridfiltering#options:locale) option setter + */ + changeLocale(): void; + + /** + * Changes the the regional settings of widget element to the language specified in [options.regional](ui.iggridfiltering#options:regional) + * Note that this method is for rare scenarios, use [regional](ui.iggridfiltering#options:regional) option setter + */ + changeRegional(): void; + + /** + * Toggle filter row when mode is simple or [advancedModeEditorsVisible](ui.iggridfiltering#options:advancedModeEditorsVisible) is true. Otherwise show/hide advanced dialog. + * + * @param event Column key + */ + toggleFilterRowByFeatureChooser(event: string): void; + + /** + * Applies filtering programmatically and updates the UI by default. + * + * @param expressions An array of filtering expressions, each one having the format {fieldName: , expr: , cond: , logic: } where fieldName is the key of the column, expr is the actual expression string with which we would like to filter, logic is 'AND' or 'OR', and cond is one of the following strings: "equals", "doesNotEqual", "contains", "doesNotContain", "greaterThan", "lessThan", "greaterThanOrEqualTo", "lessThanOrEqualTo", "true", "false", "null", "notNull", "empty", "notEmpty", "startsWith", "endsWith", "today", "yesterday", "on", "notOn", "thisMonth", "lastMonth", "nextMonth", "before", "after", "thisYear", "lastYear", "nextYear". The difference between the empty and null filtering conditions is that empty includes null, NaN, and undefined, as well as the empty string. + * @param updateUI specifies whether the filter row should be also updated once the grid is filtered + * @param addedFromAdvanced + */ + filter(expressions: any[], updateUI?: boolean, addedFromAdvanced?: boolean): void; + + /** + * Check whether filterCondition requires or not filtering expression - e.g. if filterCondition is "lastMonth", "thisMonth", "null", "notNull", "true", "false", etc. then filtering expression is NOT required + * + * @param filterCondition filtering condition - e.g. "true", "false", "yesterday", "empty", "null", etc. + */ + requiresFilteringExpression(filterCondition: string): boolean; } interface JQuery { data(propertyName: "igTreeGridFiltering"): IgTreeGridFilteringMethods; @@ -82411,51 +96696,66 @@ interface JQuery { interface JQuery { igTreeGridFiltering(methodName: "getFilteringMatchesCount"): number; igTreeGridFiltering(methodName: "destroy"): void; + igTreeGridFiltering(methodName: "changeGlobalLanguage"): void; + igTreeGridFiltering(methodName: "changeGlobalRegional"): void; + igTreeGridFiltering(methodName: "changeLocale"): void; + igTreeGridFiltering(methodName: "changeRegional"): void; + igTreeGridFiltering(methodName: "toggleFilterRowByFeatureChooser", event: string): void; + igTreeGridFiltering(methodName: "filter", expressions: any[], updateUI?: boolean, addedFromAdvanced?: boolean): void; + igTreeGridFiltering(methodName: "requiresFilteringExpression", filterCondition: string): boolean; /** * The property in the response that will hold the total number of records in the data source + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "recordCountKey"): string; /** * The property in the response that will hold the total number of records in the data source * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "recordCountKey", optionValue: string): void; /** * Specifies from which data bound level to be applied filtering - 0 is the first level + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "fromLevel"): number; /** * Specifies from which data bound level to be applied filtering - 0 is the first level * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "fromLevel", optionValue: number): void; /** * Specifies to which data bound level to be applied filtering - if -1 filtering should be applied to the last data bound level + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "toLevel"): number; /** * Specifies to which data bound level to be applied filtering - if -1 filtering should be applied to the last data bound level * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "toLevel", optionValue: number): void; /** * If displayMode is showWithAncestorsAndDescendants, show all records that match filtering conditions and their child records, even if child records don"t match filtering conditions. If displayMode is showWithAncestors show only those records that match filtering conditions and do not show child records(if any) that don"t match filtering conditions + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "displayMode"): any; /** * If displayMode is showWithAncestorsAndDescendants, show all records that match filtering conditions and their child records, even if child records don"t match filtering conditions. If displayMode is showWithAncestors show only those records that match filtering conditions and do not show child records(if any) that don"t match filtering conditions * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "displayMode", optionValue: any): void; @@ -82464,6 +96764,7 @@ interface JQuery { * Gets the name of a boolean property in the dataRecord object that indicates whether the dataRow matches the filtering conditions. * When filtering a boolean flag with the specified name is added on each data record object with a value of true if it matches the condition or false if it doesn"t. * This is used mainly for internal purposes. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "matchFiltering"): string; @@ -82472,6 +96773,7 @@ interface JQuery { * When filtering a boolean flag with the specified name is added on each data record object with a value of true if it matches the condition or false if it doesn"t. * This is used mainly for internal purposes. * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "matchFiltering", optionValue: string): void; @@ -82506,14 +96808,28 @@ interface JQuery { igTreeGridFiltering(optionLiteral: 'option', optionName: "locale"): IgTreeGridFilteringLocale; igTreeGridFiltering(optionLiteral: 'option', optionName: "locale", optionValue: IgTreeGridFilteringLocale): void; + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "inherit"): boolean; + + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + * + * @optionValue New value to be set. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + /** * Enables or disables the filtering case sensitivity. Works only for local filtering. If true, it case sensitive filtering is performed. If false, filtering is case insensitive. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "caseSensitive"): boolean; /** * Enables or disables the filtering case sensitivity. Works only for local filtering. If true, it case sensitive filtering is performed. If false, filtering is case insensitive. * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "caseSensitive", optionValue: boolean): void; @@ -82522,6 +96838,7 @@ interface JQuery { * Enable/disable footer visibility with summary info about the filter. * When false, the filter summary row (in the footer) will only be visible when paging is enabled (or some other feature that renders a footer). * When true, the filter summary row will only be visible when a filter is applied i.e. it's not visible by default. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterSummaryAlwaysVisible"): boolean; @@ -82530,18 +96847,21 @@ interface JQuery { * When false, the filter summary row (in the footer) will only be visible when paging is enabled (or some other feature that renders a footer). * When true, the filter summary row will only be visible when a filter is applied i.e. it's not visible by default. * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterSummaryAlwaysVisible", optionValue: boolean): void; /** * Render in [Feature Chooser](http://www.igniteui.com/help/iggrid-feature-chooser) + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "renderFC"): boolean; /** * Render in [Feature Chooser](http://www.igniteui.com/help/iggrid-feature-chooser) * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "renderFC", optionValue: boolean): void; @@ -82562,6 +96882,7 @@ interface JQuery { /** * Type of animations for the column filter dropdowns. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDropDownAnimations"): string; @@ -82569,6 +96890,7 @@ interface JQuery { /** * Type of animations for the column filter dropdowns. * + * * @optionValue New value to be set. */ @@ -82576,18 +96898,21 @@ interface JQuery { /** * Animation duration in milliseconds for the [filterDropDownAnimations](ui.iggridfiltering#options:filterDropDownAnimations). + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDropDownAnimationDuration"): number; /** * Animation duration in milliseconds for the [filterDropDownAnimations](ui.iggridfiltering#options:filterDropDownAnimations). * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDropDownAnimationDuration", optionValue: number): void; /** * Width of the column filter dropdowns. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDropDownWidth"): string|number; @@ -82595,6 +96920,7 @@ interface JQuery { /** * Width of the column filter dropdowns. * + * * @optionValue New value to be set. */ @@ -82620,18 +96946,21 @@ interface JQuery { /** * URL key name that specifies how the filtering expressions will be encoded for remote requests, e.g. &filter('col') = startsWith. Default is OData. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterExprUrlKey"): string; /** * URL key name that specifies how the filtering expressions will be encoded for remote requests, e.g. &filter('col') = startsWith. Default is OData. * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterExprUrlKey", optionValue: string): void; /** * Enable/disable filter icons visibility. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDropDownItemIcons"): boolean; @@ -82639,6 +96968,7 @@ interface JQuery { /** * Enable/disable filter icons visibility. * + * * @optionValue New value to be set. */ @@ -82646,18 +96976,21 @@ interface JQuery { /** * A list of column settings that specifies custom filtering options on a per column basis. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "columnSettings"): IgGridFilteringColumnSetting[]; /** * A list of column settings that specifies custom filtering options on a per column basis. * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "columnSettings", optionValue: IgGridFilteringColumnSetting[]): void; /** * Type of filtering. Delegates all filtering functionality to the [$.ig.DataSource](ig.datasource). + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "type"): string; @@ -82665,6 +96998,7 @@ interface JQuery { /** * Type of filtering. Delegates all filtering functionality to the [$.ig.DataSource](ig.datasource). * + * * @optionValue New value to be set. */ @@ -82672,18 +97006,21 @@ interface JQuery { /** * Time in milliseconds for which widget will wait between keystrokes before sending filtering requests. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDelay"): number; /** * Time in milliseconds for which widget will wait between keystrokes before sending filtering requests. * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDelay", optionValue: number): void; /** * Default is 'simple' for non-virtualized grids, and 'advanced' when [virtualization](ui.iggrid#options:virtualization) is enabled. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "mode"): string; @@ -82691,6 +97028,7 @@ interface JQuery { /** * Default is 'simple' for non-virtualized grids, and 'advanced' when [virtualization](ui.iggrid#options:virtualization) is enabled. * + * * @optionValue New value to be set. */ @@ -82698,18 +97036,21 @@ interface JQuery { /** * Defines whether to render editors in advanced [mode](ui.iggridfiltering#options:mode). If false, no editors will be rendered in the advanced [mode](ui.iggridfiltering#options:mode). + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "advancedModeEditorsVisible"): boolean; /** * Defines whether to render editors in advanced [mode](ui.iggridfiltering#options:mode). If false, no editors will be rendered in the advanced [mode](ui.iggridfiltering#options:mode). * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "advancedModeEditorsVisible", optionValue: boolean): void; /** * Location of the advanced filtering button when [advancedModeEditorsVisible](ui.iggridfiltering#options:advancedModeEditorsVisible) is false (i.e. when the button is rendered in the header). + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "advancedModeHeaderButtonLocation"): string; @@ -82717,6 +97058,7 @@ interface JQuery { /** * Location of the advanced filtering button when [advancedModeEditorsVisible](ui.iggridfiltering#options:advancedModeEditorsVisible) is false (i.e. when the button is rendered in the header). * + * * @optionValue New value to be set. */ @@ -82724,6 +97066,7 @@ interface JQuery { /** * Default filter dialog width (used for Advanced filtering [mode](ui.iggridfiltering#options:mode)). + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogWidth"): string|number; @@ -82731,6 +97074,7 @@ interface JQuery { /** * Default filter dialog width (used for Advanced filtering [mode](ui.iggridfiltering#options:mode)). * + * * @optionValue New value to be set. */ @@ -82738,6 +97082,7 @@ interface JQuery { /** * Default filter dialog height (used for Advanced filtering [mode](ui.iggridfiltering#options:mode)). + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogHeight"): string|number; @@ -82745,6 +97090,7 @@ interface JQuery { /** * Default filter dialog height (used for Advanced filtering [mode](ui.iggridfiltering#options:mode)). * + * * @optionValue New value to be set. */ @@ -82752,6 +97098,7 @@ interface JQuery { /** * Width of the filtering condition dropdowns in the advanced filter dialog. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterDropDownDefaultWidth"): string|number; @@ -82759,6 +97106,7 @@ interface JQuery { /** * Width of the filtering condition dropdowns in the advanced filter dialog. * + * * @optionValue New value to be set. */ @@ -82766,6 +97114,7 @@ interface JQuery { /** * Width of the filtering expression input boxes in the advanced filter dialog. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogExprInputDefaultWidth"): string|number; @@ -82773,6 +97122,7 @@ interface JQuery { /** * Width of the filtering expression input boxes in the advanced filter dialog. * + * * @optionValue New value to be set. */ @@ -82780,6 +97130,7 @@ interface JQuery { /** * Width of the column chooser dropdowns in the advanced filter dialog. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogColumnDropDownDefaultWidth"): string|number; @@ -82787,6 +97138,7 @@ interface JQuery { /** * Width of the column chooser dropdowns in the advanced filter dialog. * + * * @optionValue New value to be set. */ @@ -82794,18 +97146,21 @@ interface JQuery { /** * Enable/disable filter button visibility. If false, no filter dropdown buttons will be rendered and a predefined list of filters will not be rendered for the columns. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "renderFilterButton"): boolean; /** * Enable/disable filter button visibility. If false, no filter dropdown buttons will be rendered and a predefined list of filters will not be rendered for the columns. * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "renderFilterButton", optionValue: boolean): void; /** * The filtering button for filter dropdowns can be rendered either on the left of the filter editor, or on the right. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterButtonLocation"): string; @@ -82813,6 +97168,7 @@ interface JQuery { /** * The filtering button for filter dropdowns can be rendered either on the left of the filter editor, or on the right. * + * * @optionValue New value to be set. */ @@ -82904,24 +97260,28 @@ interface JQuery { /** * Custom template for add condition area in the filter dialog. The default template is "
${label1}
${label2}
". + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogAddConditionTemplate"): string; /** * Custom template for add condition area in the filter dialog. The default template is "
${label1}
${label2}
". * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogAddConditionTemplate", optionValue: string): void; /** * Custom template for options in dropdown in add condition area in the filter dialog. The default template is "". + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogAddConditionDropDownTemplate"): string; /** * Custom template for options in dropdown in add condition area in the filter dialog. The default template is "". * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogAddConditionDropDownTemplate", optionValue: string): void; @@ -82932,6 +97292,7 @@ interface JQuery { * E.g.: DOM element used for selecting column has attribute "data-af-col", for selecting filter condition - "data-af-cond", for filter expression- "data-af-expr". * NOTE: The template is supported only with
. * The default template is "". + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterTemplate"): string; @@ -82942,24 +97303,28 @@ interface JQuery { * NOTE: The template is supported only with . * The default template is "". * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterTemplate", optionValue: string): void; /** * Custom template for options in condition list in filter dialog. The default template is "". + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterConditionTemplate"): string; /** * Custom template for options in condition list in filter dialog. The default template is "". * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterConditionTemplate", optionValue: string): void; /** * Add button width - in the advanced filter dialog. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogAddButtonWidth"): string|number; @@ -82967,6 +97332,7 @@ interface JQuery { /** * Add button width - in the advanced filter dialog. * + * * @optionValue New value to be set. */ @@ -82974,6 +97340,7 @@ interface JQuery { /** * Width of the Ok and Cancel buttons in the advanced filtering dialogs. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogOkCancelButtonWidth"): string|number; @@ -82981,6 +97348,7 @@ interface JQuery { /** * Width of the Ok and Cancel buttons in the advanced filtering dialogs. * + * * @optionValue New value to be set. */ @@ -82988,12 +97356,14 @@ interface JQuery { /** * Maximum number of filter rows in the advanced filtering dialog. If this number is exceeded, an error message will be rendered. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogMaxFilterCount"): number; /** * Maximum number of filter rows in the advanced filtering dialog. If this number is exceeded, an error message will be rendered. * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogMaxFilterCount", optionValue: number): void; @@ -83018,63 +97388,265 @@ interface JQuery { /** * Enable/disable empty condition visibility in the filter. If true, shows empty and not empty filtering conditions in the dropdowns. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "showEmptyConditions"): boolean; /** * Enable/disable empty condition visibility in the filter. If true, shows empty and not empty filtering conditions in the dropdowns. * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "showEmptyConditions", optionValue: boolean): void; /** * Enable/disable visibility of null and not null filtering conditions in the dropdowns. If true, shows null and not null filtering conditions in the dropdowns. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "showNullConditions"): boolean; /** * Enable/disable visibility of null and not null filtering conditions in the dropdowns. If true, shows null and not null filtering conditions in the dropdowns. * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "showNullConditions", optionValue: boolean): void; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "dialogWidget"): string; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "dialogWidget", optionValue: string): void; /** * Enables/disables filtering persistence between states. + * */ igTreeGridFiltering(optionLiteral: 'option', optionName: "persist"): boolean; /** * Enables/disables filtering persistence between states. * + * * @optionValue New value to be set. */ igTreeGridFiltering(optionLiteral: 'option', optionName: "persist", optionValue: boolean): void; /** - * Enables/disables feature inheritance for the child [layouts](ui.ighierarchicalgrid#options:columnLayouts). NOTE: It only applies for [igHierarchicalGrid](ui.ighierarchicalgrid). + * Event fired before a filtering operation is executed (remote request or local). + * Return false in order to cancel filtering operation. */ - igTreeGridFiltering(optionLiteral: 'option', optionName: "inherit"): boolean; + igTreeGridFiltering(optionLiteral: 'option', optionName: "dataFiltering"): DataFilteringEvent; /** - * Enables/disables feature inheritance for the child [layouts](ui.ighierarchicalgrid#options:columnLayouts). NOTE: It only applies for [igHierarchicalGrid](ui.ighierarchicalgrid). + * Event fired before a filtering operation is executed (remote request or local). + * Return false in order to cancel filtering operation. * - * @optionValue New value to be set. + * @optionValue Define event handler function. */ - igTreeGridFiltering(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + igTreeGridFiltering(optionLiteral: 'option', optionName: "dataFiltering", optionValue: DataFilteringEvent): void; + + /** + * Event fired after the filtering has been executed and results are rendered. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "dataFiltered"): DataFilteredEvent; + + /** + * Event fired after the filtering has been executed and results are rendered. + * + * @optionValue Define event handler function. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "dataFiltered", optionValue: DataFilteredEvent): void; + + /** + * Event fired before the filter dropdown is opened for a specific column. + * Return false in order to cancel dropdown opening. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "dropDownOpening"): DropDownOpeningEvent; + + /** + * Event fired before the filter dropdown is opened for a specific column. + * Return false in order to cancel dropdown opening. + * + * @optionValue Define event handler function. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "dropDownOpening", optionValue: DropDownOpeningEvent): void; + + /** + * Event fired after the filter dropdown is opened for a specific column. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "dropDownOpened"): DropDownOpenedEvent; + + /** + * Event fired after the filter dropdown is opened for a specific column. + * + * @optionValue Define event handler function. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "dropDownOpened", optionValue: DropDownOpenedEvent): void; + + /** + * Event fired before the filter dropdown starts closing. + * Return false in order to cancel dropdown closing. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "dropDownClosing"): DropDownClosingEvent; + + /** + * Event fired before the filter dropdown starts closing. + * Return false in order to cancel dropdown closing. + * + * @optionValue Define event handler function. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "dropDownClosing", optionValue: DropDownClosingEvent): void; + + /** + * Event fired after a filter column dropdown is completely closed. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "dropDownClosed"): DropDownClosedEvent; + + /** + * Event fired after a filter column dropdown is completely closed. + * + * @optionValue Define event handler function. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "dropDownClosed", optionValue: DropDownClosedEvent): void; + + /** + * Event fired before the advanced filtering dialog is opened. + * Return false in order to cancel filter dialog opening. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogOpening"): FilterDialogOpeningEvent; + + /** + * Event fired before the advanced filtering dialog is opened. + * Return false in order to cancel filter dialog opening. + * + * @optionValue Define event handler function. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogOpening", optionValue: FilterDialogOpeningEvent): void; + + /** + * Event fired after the advanced filter dialog is already opened. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogOpened"): FilterDialogOpenedEvent; + + /** + * Event fired after the advanced filter dialog is already opened. + * + * @optionValue Define event handler function. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogOpened", optionValue: FilterDialogOpenedEvent): void; + + /** + * Event fired every time the advanced filter dialog changes its position. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogMoving"): FilterDialogMovingEvent; + + /** + * Event fired every time the advanced filter dialog changes its position. + * + * @optionValue Define event handler function. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogMoving", optionValue: FilterDialogMovingEvent): void; + + /** + * Event fired before a filter row is added to the advanced filter dialog. + * Return false in order to cancel filter adding to the advanced filtering dialog. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterAdding"): FilterDialogFilterAddingEvent; + + /** + * Event fired before a filter row is added to the advanced filter dialog. + * Return false in order to cancel filter adding to the advanced filtering dialog. + * + * @optionValue Define event handler function. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterAdding", optionValue: FilterDialogFilterAddingEvent): void; + + /** + * Event fired after a filter row is added to the advanced filter dialog. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterAdded"): FilterDialogFilterAddedEvent; + + /** + * Event fired after a filter row is added to the advanced filter dialog. + * + * @optionValue Define event handler function. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogFilterAdded", optionValue: FilterDialogFilterAddedEvent): void; + + /** + * Event fired before the advanced filter dialog is closed. + * Return false in order to cancel filtering dialog closing. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogClosing"): FilterDialogClosingEvent; + + /** + * Event fired before the advanced filter dialog is closed. + * Return false in order to cancel filtering dialog closing. + * + * @optionValue Define event handler function. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogClosing", optionValue: FilterDialogClosingEvent): void; + + /** + * Event fired after the advanced filter dialog has been closed. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogClosed"): FilterDialogClosedEvent; + + /** + * Event fired after the advanced filter dialog has been closed. + * + * @optionValue Define event handler function. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogClosed", optionValue: FilterDialogClosedEvent): void; + + /** + * Event fired before the contents of the advanced filter dialog are rendered. + * Return false in order to cancel filtering dialog rendering. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogContentsRendering"): FilterDialogContentsRenderingEvent; + + /** + * Event fired before the contents of the advanced filter dialog are rendered. + * Return false in order to cancel filtering dialog rendering. + * + * @optionValue Define event handler function. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogContentsRendering", optionValue: FilterDialogContentsRenderingEvent): void; + + /** + * Event fired after the contents of the advanced filter dialog are rendered. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogContentsRendered"): FilterDialogContentsRenderedEvent; + + /** + * Event fired after the contents of the advanced filter dialog are rendered. + * + * @optionValue Define event handler function. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogContentsRendered", optionValue: FilterDialogContentsRenderedEvent): void; + + /** + * Event fired when the OK button in the advanced filter dialog is pressed. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogFiltering"): FilterDialogFilteringEvent; + + /** + * Event fired when the OK button in the advanced filter dialog is pressed. + * + * @optionValue Define event handler function. + */ + igTreeGridFiltering(optionLiteral: 'option', optionName: "filterDialogFiltering", optionValue: FilterDialogFilteringEvent): void; igTreeGridFiltering(options: IgTreeGridFiltering): JQuery; igTreeGridFiltering(optionLiteral: 'option', optionName: string): any; igTreeGridFiltering(optionLiteral: 'option', options: IgTreeGridFiltering): JQuery; @@ -83082,13 +97654,20 @@ interface JQuery { igTreeGridFiltering(methodName: string, ...methodParams: any[]): any; } interface IgTreeGridHiding { + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + inherit?: boolean; + /** * A list of column settings that specifies hiding options on a per column basis. + * */ columnSettings?: IgGridHidingColumnSetting[]; /** * The width in pixels of the hidden column indicator in the header. + * */ hiddenColumnIndicatorHeaderWidth?: number; @@ -83102,16 +97681,19 @@ interface IgTreeGridHiding { /** * The default column chooser width. + * */ columnChooserWidth?: string; /** * The default column chooser height. + * */ columnChooserHeight?: string; /** * The duration of the dropdown animation in milliseconds. + * */ dropDownAnimationDuration?: number; @@ -83172,24 +97754,22 @@ interface IgTreeGridHiding { /** * Specifies on click show/hide directly to be shown/hidden columns. If columnChooserHideOnClick is false then Apply and Cancel Buttons are shown on the bottom of modal dialog. Columns are Shown/Hidden after the Apply button is clicked + * */ columnChooserHideOnClick?: boolean; /** * Specifies time of milliseconds for animation duration to show/hide modal dialog + * */ columnChooserAnimationDuration?: number; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. + * */ dialogWidget?: string; - /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. - */ - inherit?: boolean; - /** * Event fired before a hiding operation is executed. */ @@ -83277,7 +97857,14 @@ interface IgTreeGridHiding { } interface IgTreeGridHidingMethods { destroy(): void; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.iggridhiding#options:language) + * Note that this method is for rare scenarios, see [language](ui.iggridhiding#options:language) or [locale](ui.iggridhiding#options:locale) option setter + */ changeLocale(): void; + changeGlobalLanguage(): void; + changeGlobalRegional(): void; /** * Shows the Column Chooser dialog. If it is visible the method does nothing. @@ -83352,6 +97939,8 @@ interface JQuery { interface JQuery { igTreeGridHiding(methodName: "destroy"): void; igTreeGridHiding(methodName: "changeLocale"): void; + igTreeGridHiding(methodName: "changeGlobalLanguage"): void; + igTreeGridHiding(methodName: "changeGlobalRegional"): void; igTreeGridHiding(methodName: "showColumnChooser"): void; igTreeGridHiding(methodName: "hideColumnChooser"): void; igTreeGridHiding(methodName: "showColumn", column: Object, callback?: Function): void; @@ -83363,26 +97952,42 @@ interface JQuery { igTreeGridHiding(methodName: "renderColumnChooserResetButton"): void; igTreeGridHiding(methodName: "removeColumnChooserResetButton"): void; + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + igTreeGridHiding(optionLiteral: 'option', optionName: "inherit"): boolean; + + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + * + * @optionValue New value to be set. + */ + igTreeGridHiding(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + /** * A list of column settings that specifies hiding options on a per column basis. + * */ igTreeGridHiding(optionLiteral: 'option', optionName: "columnSettings"): IgGridHidingColumnSetting[]; /** * A list of column settings that specifies hiding options on a per column basis. * + * * @optionValue New value to be set. */ igTreeGridHiding(optionLiteral: 'option', optionName: "columnSettings", optionValue: IgGridHidingColumnSetting[]): void; /** * The width in pixels of the hidden column indicator in the header. + * */ igTreeGridHiding(optionLiteral: 'option', optionName: "hiddenColumnIndicatorHeaderWidth"): number; /** * The width in pixels of the hidden column indicator in the header. * + * * @optionValue New value to be set. */ igTreeGridHiding(optionLiteral: 'option', optionName: "hiddenColumnIndicatorHeaderWidth", optionValue: number): void; @@ -83407,36 +98012,42 @@ interface JQuery { /** * The default column chooser width. + * */ igTreeGridHiding(optionLiteral: 'option', optionName: "columnChooserWidth"): string; /** * The default column chooser width. * + * * @optionValue New value to be set. */ igTreeGridHiding(optionLiteral: 'option', optionName: "columnChooserWidth", optionValue: string): void; /** * The default column chooser height. + * */ igTreeGridHiding(optionLiteral: 'option', optionName: "columnChooserHeight"): string; /** * The default column chooser height. * + * * @optionValue New value to be set. */ igTreeGridHiding(optionLiteral: 'option', optionName: "columnChooserHeight", optionValue: string): void; /** * The duration of the dropdown animation in milliseconds. + * */ igTreeGridHiding(optionLiteral: 'option', optionName: "dropDownAnimationDuration"): number; /** * The duration of the dropdown animation in milliseconds. * + * * @optionValue New value to be set. */ igTreeGridHiding(optionLiteral: 'option', optionName: "dropDownAnimationDuration", optionValue: number): void; @@ -83571,51 +98182,45 @@ interface JQuery { /** * Gets on click show/hide directly to be shown/hidden columns. If columnChooserHideOnClick is false then Apply and Cancel Buttons are shown on the bottom of modal dialog. Columns are Shown/Hidden after the Apply button is clicked + * */ igTreeGridHiding(optionLiteral: 'option', optionName: "columnChooserHideOnClick"): boolean; /** * Sets on click show/hide directly to be shown/hidden columns. If columnChooserHideOnClick is false then Apply and Cancel Buttons are shown on the bottom of modal dialog. Columns are Shown/Hidden after the Apply button is clicked * + * * @optionValue New value to be set. */ igTreeGridHiding(optionLiteral: 'option', optionName: "columnChooserHideOnClick", optionValue: boolean): void; /** * Gets time of milliseconds for animation duration to show/hide modal dialog + * */ igTreeGridHiding(optionLiteral: 'option', optionName: "columnChooserAnimationDuration"): number; /** * Sets time of milliseconds for animation duration to show/hide modal dialog * + * * @optionValue New value to be set. */ igTreeGridHiding(optionLiteral: 'option', optionName: "columnChooserAnimationDuration", optionValue: number): void; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. + * */ igTreeGridHiding(optionLiteral: 'option', optionName: "dialogWidget"): string; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. * - * @optionValue New value to be set. - */ - igTreeGridHiding(optionLiteral: 'option', optionName: "dialogWidget", optionValue: string): void; - - /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. - */ - igTreeGridHiding(optionLiteral: 'option', optionName: "inherit"): boolean; - - /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. * * @optionValue New value to be set. */ - igTreeGridHiding(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + igTreeGridHiding(optionLiteral: 'option', optionName: "dialogWidget", optionValue: string): void; /** * Event fired before a hiding operation is executed. @@ -83818,27 +98423,32 @@ interface IgTreeGridDataSourceSettings { /** * *** IMPORTANT DEPRECATED *** Use the expandedKey option instead. * The name of the property that keeps track of the expansion state of a data item. Defaults to __ig_options.expanded. + * */ propertyExpanded?: any; /** * *** IMPORTANT DEPRECATED *** Use the dataLevelKey option instead. * The name of the property that keeps track of the level in the hierarchy.Defaults to __ig_options.dataLevel. + * */ propertyDataLevel?: any; /** * The name of the property that keeps track of the expansion state of a data item. Defaults to __ig_options.expanded. + * */ expandedKey?: string; /** * The name of the property that keeps track of the level in the hierarchy.Defaults to __ig_options.dataLevel. + * */ dataLevelKey?: string; /** * If set to TRUE it is expected that the source of data is normalized and transformed(has set dataLevel and expansion state). The source of data is used as flatDataView. Usually used when the paging is remote and paging mode is allLevels, or features are remote(and the processing of the returned result should be made on the server) + * */ initialFlatDataView?: boolean; @@ -83851,11 +98461,13 @@ interface IgTreeGridDataSourceSettings { interface IgTreeGridLocale { /** * Specifies the expansion indicator tooltip text. + * */ expandTooltipText?: string; /** * Specifies the collapse indicator tooltip text. + * */ collapseTooltipText?: string; @@ -83865,19 +98477,29 @@ interface IgTreeGridLocale { [optionName: string]: any; } +interface IgTreeGridRestSettings { + /** + * Option for IgTreeGridRestSettings + */ + [optionName: string]: any; +} + interface IgTreeGrid { /** * Specifies the indentation (in pixels or percent) for a tree grid row. Nested indentation is achieved by calculating the level times the indentation value. Ex: '10px' or '5%'. Default is 30. + * */ indentation?: string; /** * If initial indentation level is set then it is used to be calculated width of the data skip column(usually used when remote load on demand is enabled) + * */ initialIndentationLevel?: number; /** * Specifies if rows(that have child rows) will have an expander image that will allow end users to expand and collapse them. This option can be set only at initialization. + * */ showExpansionIndicator?: boolean; @@ -83897,58 +98519,90 @@ interface IgTreeGrid { /** * Unique identifier used in a self-referencing flat data source. Used with primaryKey to create a relationship among flat data sources. + * */ foreignKey?: string; /** * Specifies the depth down to which the tree grid would be expanded upon initial render. To expand all rows set value to -1. Default is -1. + * */ initialExpandDepth?: number; /** * Specifies the foreign key value in the data source to treat as the root level once the grid is data bound. Defaults to -1 (which includes the entire data source) + * */ foreignKeyRootValue?: number|string; /** * Specify whether to render non-data column which contains expander indicators + * */ renderExpansionIndicatorColumn?: boolean; /** * a reference or name of a javascript function which changes first data cell - renders indentation according to databound level + * */ renderFirstDataCellFunction?: string|Object; /** * Property name of the array of child data in a hierarchical data source. + * */ childDataKey?: string; /** * a reference or name of a javascript function which renders expand indicators(called ONLY IF option renderExpansionIndicatorColumn is true) + * */ renderExpansionCellFunction?: string|Object; /** * Specifies to the tree grid if data is loaded on demand from a remote server. Default is false. + * */ enableRemoteLoadOnDemand?: boolean; /** * Options object to configure data source-specific settings + * */ dataSourceSettings?: IgTreeGridDataSourceSettings; locale?: IgTreeGridLocale; + /** + * Determines row virtualization mode. For igTreeGrid only continuous virtualization can be used. + * + * continuous renders a pre-defined number of rows in the grid. On scrolling the continuous virtualization loads another portion of rows and disposes the current one. + */ + virtualizationMode?: string; + /** * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. */ - restSettings?: any; + avgColumnWidth?: any; + + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + avgRowHeight?: any; + + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + columnVirtualization?: any; + + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + restSettings?: IgTreeGridRestSettings; /** * Defines the grid width in pixels or percents. [Here you can find more info about setting igGrid width](http://www.igniteui.com/help/iggrid-columns-and-layout#width-height). * + * * Valid values: * "string" The widget width can be set in pixels (px) or percentage (%). Example values: "800px", "800" (defaults to pixels), "100%". * "number" The widget width can be set in pixels as a number. Example values: 800, 700. @@ -83959,6 +98613,7 @@ interface IgTreeGrid { /** * This is the total height of the grid, including all UI elements - scroll container with data rows, header, footer, filter row - (if any), etc. [Here you can find more info about setting igGrid height](http://www.igniteui.com/help/iggrid-columns-and-layout#width-height). * + * * Valid values: * "string" The widget height can be set in pixels (px) and percentage (%). * "number" The widget height can be set as a number @@ -83968,32 +98623,16 @@ interface IgTreeGrid { /** * If autoAdjustHeight is set to false, the [height](ui.iggrid#options:height) will be set only on the scrolling container, and all other UI elements such as paging footer / filter row / headers will add on top of that, so the total height of the grid will be more than this value - the height of the scroll container (content area) will not be dynamically calculated. Setting this option to false will usually result in a lot better initial rendering performance for large data sets ( > 1000 rows rendered at once, no [virtualization](ui.iggrid#options:virtualization) enabled), since no reflows will be made by browsers when accessing DOM properties such as offsetHeight. + * */ autoAdjustHeight?: boolean; /** - * Used for [row virtualization](ui.iggrid#options:rowVirtualization) in [fixed mode](ui.iggrid#options:virtualizationMode). This is the average value in pixels (default) that will be used to calculate how many rows to render as the end user scrolls. Also all rows' height will be automatically set to this value. + * Default column width that will be set for all columns, that don't have [column width](ui.iggrid#options:columns.width) defined. Can also be set as '*', in which case the width auto-size based on the content of the column cells (including the header text). + * * * Valid values: - * "string" The avarage row height can be set in pixels ("25px"). - * "number" The avarage row height can be set in pixels as a number (25). - */ - avgRowHeight?: string|number; - - /** - * Used for [column virtualization](ui.iggrid#options:columnVirtualization) in [fixed mode](ui.iggrid#options:virtualizationMode). This is the average value in pixels for a column width. - * - * Valid values: - * "string" The avarage column width can be set in pixels ("25px"). - * "number" The avarage column width can be set in pixels as a number (25). - */ - avgColumnWidth?: string|number; - - /** - * Default column width that will be set for all columns, that don't have [column width](ui.iggrid#options:columns.width) defined. - * - * Valid values: - * "string" The default column width can be set in pixels ("100px"). + * "string" The default column width can be set in pixels ("100px") or as '*' in order to auto-size based on the cells and header content. * "number" The default column width can be set in pixels as a number (100). */ defaultColumnWidth?: string|number; @@ -84002,46 +98641,38 @@ interface IgTreeGrid { * If no [columns](ui.iggrid#options:columns) collection is defined, and autoGenerateColumns is set to true, [columns](ui.iggrid#options:columns) will be inferred from the data source before the [dataRendering](ui.iggrid#events:dataRendering) event is fired. The inferred [columns](ui.iggrid#options:columns) collection will be available to the developer for modification at [dataRendering](ui.iggrid#events:dataRendering). If autoGenerateColumns is not explicitly set and [columns](ui.iggrid#options:columns) has at least one column defined then autoGenerateColumns is automatically set to false. * If autoGenerateColumns is true and there are columns defined auto-generated columns will render after the explicitly defined ones. * Since auto-generated columns don't have width defined consider setting [defaultColumnWidth](ui.iggrid#options:defaultColumnWidth) as well. + * */ autoGenerateColumns?: boolean; /** * Enables/disables column and row virtualization at the same time. Virtualization can greatly enhance rendering performance. If enabled, the number of actual rendered rows (DOM elements) will be constant and related to the visible viewport of the grid. As the end user scrolls, those DOM elements will be dynamically reused to render the new data. [Here you can find more info about the performance guidelines when using the igGrid](http://www.igniteui.com/help/iggrid-performance-guide) + * */ virtualization?: boolean; - /** - * Determines row virtualization mode. - * - * Valid values: - * "fixed" Renders only the visible rows and/or columns in the grid. On scrolling the same rows and/or columns are updated with new data from the data source. Only fixed virtualization can work with column virtualization at the same time. Fixed virtualization is not supported by some grid features: Resizing, Group By, Responsive. - * "continuous" renders a pre-defined number of rows in the grid. On scrolling the continuous virtualization loads another portion of rows and disposes the current one. - */ - virtualizationMode?: string; - /** * Enables virtualization for rows only. [Here you can find more info about igGrid row virtualization](http://www.igniteui.com/help/iggrid-virtualization-overview) + * */ rowVirtualization?: boolean; - /** - * Enables virtualization for columns only. Column virtualization can work only in combination with fixed row virtalization. Setting columnVirtualization to true will automatically set [virtualization](ui.iggrid#options:virtualization) to true and [virtualizationMode](ui.iggrid#options:virtualizationMode) to "fixed". - */ - columnVirtualization?: boolean; - /** * Number of pixels to scroll the grid by, when virtualization is enabled, and mouse wheel scrolling is performed over the virtual grid area. If "null" the step will be equal to the [avgRowHeight](ui.iggrid#options:avgRowHeight). + * */ virtualizationMouseWheelStep?: number; /** * If this option is set to true, the height of the grid row will be calculated automatically based on the [avgRowHeight](ui.iggrid#options:avgRowHeight) and the visible virtual records. If no [avgRowHeight](ui.iggrid#options:avgRowHeight) is specified, it will be calculated automatically at runtime. + * */ adjustVirtualHeights?: boolean; /** * The templating engine that will be used to render the grid [column templates](ui.iggrid#options:columns.template). [Here you can find](http://www.infragistics.com/community/blogs/marina_stoyanova/archive/2014/05/30/using-different-template-engines-with-ignite-ui-controls.aspx) how to use templating engines other than igTemplating and jsRender. * + * * Valid values: * "infragistics" The grid will use the Infragistics Templating engine to render its [column templates](ui.iggrid#options:columns.template) and specific parts of the UI. * "jsRender" The grid will use jsRender to render its [column templates](ui.iggrid#options:columns.template) and specific parts of the UI. @@ -84050,12 +98681,14 @@ interface IgTreeGrid { /** * An array of column objects. Checkout the [Columns and Layout](http://www.igniteui.com/help/iggrid-columns-and-layout#defining-columns) topic for details on configuring the columns array. + * */ columns?: IgGridColumn[]; /** * Can be any valid data source accepted by [$.ig.DataSource](ig.datasource), or an instance of an $.ig.DataSource itself * + * * Valid values: * "array" dataSource as an array * "object" ddataSource as an object @@ -84065,86 +98698,102 @@ interface IgTreeGrid { /** * Specifies a remote URL as a data source, from which data will be retrieved using the [$.ig.DataSource](ig.datasource). + * */ dataSourceUrl?: string; /** * Explicitly set data source type (such as "json"). Please refer to the documentation of [$.ig.DataSource type](ig.datasource#options:settings.type). + * */ dataSourceType?: string; /** * See [$.ig.DataSource responseDataKey](ig.datasource#options:settings.responseDataKey). This is the property in the responses where data records are held, if the response is wrapped. + * */ responseDataKey?: string; /** - * See [$.ig.DataSource responseTotalRecCountKey](ig.datasource#options:settings.responseTotalRecCountKey). Property in the response specifying the total number of records on the server. + * This option has been deprecated. See [$.ig.DataSource responseTotalRecCountKey](ig.datasource#options:settings.responseTotalRecCountKey). Property in the response specifying the total number of records on the server. */ responseTotalRecCountKey?: string; /** * Specifies the HTTP verb to be used to issue the requests to a remote data source. + * */ requestType?: string; /** * Content type of the response. See http://api.jquery.com/jQuery.ajax/ => contentType + * */ responseContentType?: string; /** * Controls the visibility of the grid header. + * */ showHeader?: boolean; /** * Controls the visibility of the grid footer. + * */ showFooter?: boolean; /** * Headers will be fixed if this option is set to true, and only the grid data will be scrollable. If [virtualization](ui.iggrid#options:virtualization) is enabled, fixedHeaders will always act as if it's true, no matter which value is set. + * */ fixedHeaders?: boolean; /** * Footers will be fixed if this option is set to true, and only the grid data will be scrollable. If [virtualization](ui.iggrid#options:virtualization) is enabled, fixedFooters will always act as if it's true, no matter which value is set. + * */ fixedFooters?: boolean; /** * Caption text that will be shown above the grid header. + * */ caption?: string; /** * List of grid feature definitions: sorting, paging, etc. Each feature goes with its separate options that are documented for the feature accordingly. [Here you can find detailed documentation for all igGrid features](http://www.igniteui.com/help/iggrid-features-landing-page) + * */ features?: IgGridFeature[]; /** * Initial tabIndex attribute that will be set on all focusable elements. + * */ tabIndex?: number; /** * If this option is set to false, the data to which the grid is bound will be used "as is" with no additional transformations based on [columns](ui.iggrid#options:columns) defined. Otherwise only the subset of data properties used in the [columns](ui.iggrid#options:columns) defined will be extracted in a new object and used. + * */ localSchemaTransform?: boolean; /** * Key of the column containing unique identifiers for the data records. + * */ primaryKey?: string; /** * If true, the transaction log will always be sent in the request for remote data, by the data source. Also this means that if there are values in the log, a POST will be performed instead of GET. + * */ serializeTransactionLog?: boolean; /** * Automatically commits the transactions as rows/cells are being edited to the client data source. A [saveChanges](ui.iggrid#methods:saveChanges) call still needs to be performed in order to commit the transactions to a server-side data source. + * */ autoCommit?: boolean; @@ -84154,12 +98803,14 @@ interface IgTreeGrid { * If a new row is added, edited, then deleted, there will be no transaction added to the log. * If several edits are made to a row or an individual cell, this should result in a single transaction. * Note: This option takes effect only when [autoCommit](ui.iggrid#options:autoCommit) is set to false. + * */ aggregateTransactions?: boolean; /** * Sets gets ability to automatically format text in cells for numeric and date columns. The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) * + * * Valid values: * "date" formats only Date columns * "number" formats only number columns @@ -84171,53 +98822,63 @@ interface IgTreeGrid { /** * Gets sets ability to render checkboxes and use checkbox editor when dataType of a column is "bool". Checkboxes are not rendered for boolean values in columns with a [column template](ui.iggrid#options:columns.template). + * */ renderCheckboxes?: boolean; /** * URL to which updating requests will be made. + * */ updateUrl?: string; /** * Enables/disables rendering of alternating row styles (odd and even rows receive different styling). + * */ alternateRowStyles?: boolean; /** * If set to true and all columns' widths are specified and their combined width is less than the grid width then the last column width will be automatically adjusted to fill the remaining empty space of the grid. + * */ autofitLastColumn?: boolean; /** * Enables/disables rendering of hover styles when the mouse is over a record. This can be useful in templating scenarios, for example, where we don't want to apply hover styling to templated content. + * */ enableHoverStyles?: boolean; /** * Enables/Disables serializing client date as UTC ISO 8061 string instead of using the local time and zone values. + * */ enableUTCDates?: boolean; /** * Merge unbound columns values inside data source when data source is remote. If true then the unbound columns are merged to the data source at runtime on the server. Note that data source is expanded with the new data and this could cause performance issues when the data is huge. If mergeUnboundColumns is false then the unbound data is sent and merged on the client. This option is used by the [igGrid MVC Helper](http://www.igniteui.com/help/iggrid-developing-asp-net-mvc-applications-with-iggrid). * Checkout [Populating Unbound Columns Remotely (igGrid)](http://www.igniteui.com/help/iggrid-unboundcolumns-populating-with-data-remotely) topic for more information. + * */ mergeUnboundColumns?: boolean; /** * When dataSource is a remote URL, defines whether to set the type of the remote data source to JSONP. + * */ jsonpRequest?: boolean; /** * Enables/disables grid adjusting its dimensions when its [width](ui.iggrid#options:width) and/or [height](ui.iggrid#options:height) is set in percent (%) and grid parent DOM container is resized. + * */ enableResizeContainerCheck?: boolean; /** * Configures how the feature chooser icon should display on header cells - e.g. to display as gear icon or not. * + * * Valid values: * "none" Always hide the feature chooser icon; The feature chooser is shown on tapping/clicking the column header. * "desktopOnly" Always show the icon on desktop but hide when touch device detected. @@ -84227,6 +98888,7 @@ interface IgTreeGrid { /** * Settings related to content scrolling. + * */ scrollSettings?: IgGridScrollSettings; @@ -84438,6 +99100,11 @@ interface IgTreeGridMethods { * Returns the element holding the data records */ widget(): void; + + /** + * Changes the the regional settings of widget element to the language specified in [options.regional](ui.iggrid#options:regional) + * Note that this method is for rare scenarios, use [regional](ui.iggrid#options:regional) option setter + */ changeRegional(): void; /** @@ -84965,36 +99632,42 @@ interface JQuery { /** * Gets the indentation (in pixels or percent) for a tree grid row. Nested indentation is achieved by calculating the level times the indentation value. Ex: '10px' or '5%'. Default is 30. + * */ igTreeGrid(optionLiteral: 'option', optionName: "indentation"): string; /** * Sets the indentation (in pixels or percent) for a tree grid row. Nested indentation is achieved by calculating the level times the indentation value. Ex: '10px' or '5%'. Default is 30. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "indentation", optionValue: string): void; /** * If initial indentation level is set then it is used to be calculated width of the data skip column(usually used when remote load on demand is enabled) + * */ igTreeGrid(optionLiteral: 'option', optionName: "initialIndentationLevel"): number; /** * If initial indentation level is set then it is used to be calculated width of the data skip column(usually used when remote load on demand is enabled) * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "initialIndentationLevel", optionValue: number): void; /** * Gets if rows(that have child rows) will have an expander image that will allow end users to expand and collapse them. This option can be set only at initialization. + * */ igTreeGrid(optionLiteral: 'option', optionName: "showExpansionIndicator"): boolean; /** * Sets if rows(that have child rows) will have an expander image that will allow end users to expand and collapse them. This option can be set only at initialization. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "showExpansionIndicator", optionValue: boolean): void; @@ -85033,30 +99706,35 @@ interface JQuery { /** * Unique identifier used in a self-referencing flat data source. Used with primaryKey to create a relationship among flat data sources. + * */ igTreeGrid(optionLiteral: 'option', optionName: "foreignKey"): string; /** * Unique identifier used in a self-referencing flat data source. Used with primaryKey to create a relationship among flat data sources. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "foreignKey", optionValue: string): void; /** * Gets the depth down to which the tree grid would be expanded upon initial render. To expand all rows set value to -1. Default is -1. + * */ igTreeGrid(optionLiteral: 'option', optionName: "initialExpandDepth"): number; /** * Sets the depth down to which the tree grid would be expanded upon initial render. To expand all rows set value to -1. Default is -1. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "initialExpandDepth", optionValue: number): void; /** * Gets the foreign key value in the data source to treat as the root level once the grid is data bound. Defaults to -1 (which includes the entire data source) + * */ igTreeGrid(optionLiteral: 'option', optionName: "foreignKeyRootValue"): number|string; @@ -85064,6 +99742,7 @@ interface JQuery { /** * Sets the foreign key value in the data source to treat as the root level once the grid is data bound. Defaults to -1 (which includes the entire data source) * + * * @optionValue New value to be set. */ @@ -85071,18 +99750,21 @@ interface JQuery { /** * Specify whether to render non-data column which contains expander indicators + * */ igTreeGrid(optionLiteral: 'option', optionName: "renderExpansionIndicatorColumn"): boolean; /** * Specify whether to render non-data column which contains expander indicators * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "renderExpansionIndicatorColumn", optionValue: boolean): void; /** * A reference or name of a javascript function which changes first data cell - renders indentation according to databound level + * */ igTreeGrid(optionLiteral: 'option', optionName: "renderFirstDataCellFunction"): string|Object; @@ -85090,6 +99772,7 @@ interface JQuery { /** * A reference or name of a javascript function which changes first data cell - renders indentation according to databound level * + * * @optionValue New value to be set. */ @@ -85097,18 +99780,21 @@ interface JQuery { /** * Property name of the array of child data in a hierarchical data source. + * */ igTreeGrid(optionLiteral: 'option', optionName: "childDataKey"): string; /** * Property name of the array of child data in a hierarchical data source. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "childDataKey", optionValue: string): void; /** * A reference or name of a javascript function which renders expand indicators(called ONLY IF option renderExpansionIndicatorColumn is true) + * */ igTreeGrid(optionLiteral: 'option', optionName: "renderExpansionCellFunction"): string|Object; @@ -85116,6 +99802,7 @@ interface JQuery { /** * A reference or name of a javascript function which renders expand indicators(called ONLY IF option renderExpansionIndicatorColumn is true) * + * * @optionValue New value to be set. */ @@ -85123,44 +99810,101 @@ interface JQuery { /** * Gets to the tree grid if data is loaded on demand from a remote server. Default is false. + * */ igTreeGrid(optionLiteral: 'option', optionName: "enableRemoteLoadOnDemand"): boolean; /** * Sets to the tree grid if data is loaded on demand from a remote server. Default is false. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "enableRemoteLoadOnDemand", optionValue: boolean): void; /** * Options object to configure data source-specific settings + * */ igTreeGrid(optionLiteral: 'option', optionName: "dataSourceSettings"): IgTreeGridDataSourceSettings; /** * Options object to configure data source-specific settings * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "dataSourceSettings", optionValue: IgTreeGridDataSourceSettings): void; igTreeGrid(optionLiteral: 'option', optionName: "locale"): IgTreeGridLocale; igTreeGrid(optionLiteral: 'option', optionName: "locale", optionValue: IgTreeGridLocale): void; + /** + * Determines row virtualization mode. For igTreeGrid only continuous virtualization can be used. + * + * continuous renders a pre-defined number of rows in the grid. On scrolling the continuous virtualization loads another portion of rows and disposes the current one. + */ + igTreeGrid(optionLiteral: 'option', optionName: "virtualizationMode"): string; + + /** + * Determines row virtualization mode. For igTreeGrid only continuous virtualization can be used. + * + * continuous renders a pre-defined number of rows in the grid. On scrolling the continuous virtualization loads another portion of rows and disposes the current one. + * + * @optionValue New value to be set. + */ + igTreeGrid(optionLiteral: 'option', optionName: "virtualizationMode", optionValue: string): void; + /** * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. */ - igTreeGrid(optionLiteral: 'option', optionName: "restSettings"): any; + igTreeGrid(optionLiteral: 'option', optionName: "avgColumnWidth"): any; /** * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. * * @optionValue New value to be set. */ - igTreeGrid(optionLiteral: 'option', optionName: "restSettings", optionValue: any): void; + igTreeGrid(optionLiteral: 'option', optionName: "avgColumnWidth", optionValue: any): void; + + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + igTreeGrid(optionLiteral: 'option', optionName: "avgRowHeight"): any; + + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + * + * @optionValue New value to be set. + */ + igTreeGrid(optionLiteral: 'option', optionName: "avgRowHeight", optionValue: any): void; + + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + igTreeGrid(optionLiteral: 'option', optionName: "columnVirtualization"): any; + + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + * + * @optionValue New value to be set. + */ + igTreeGrid(optionLiteral: 'option', optionName: "columnVirtualization", optionValue: any): void; + + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + igTreeGrid(optionLiteral: 'option', optionName: "restSettings"): IgTreeGridRestSettings; + + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + * + * @optionValue New value to be set. + */ + igTreeGrid(optionLiteral: 'option', optionName: "restSettings", optionValue: IgTreeGridRestSettings): void; /** * Defines the grid width in pixels or percents. [Here you can find more info about setting igGrid width](http://www.igniteui.com/help/iggrid-columns-and-layout#width-height). + * */ igTreeGrid(optionLiteral: 'option', optionName: "width"): string|number; @@ -85168,6 +99912,7 @@ interface JQuery { /** * Defines the grid width in pixels or percents. [Here you can find more info about setting igGrid width](http://www.igniteui.com/help/iggrid-columns-and-layout#width-height). * + * * @optionValue New value to be set. */ @@ -85175,6 +99920,7 @@ interface JQuery { /** * This is the total height of the grid, including all UI elements - scroll container with data rows, header, footer, filter row - (if any), etc. [Here you can find more info about setting igGrid height](http://www.igniteui.com/help/iggrid-columns-and-layout#width-height). + * */ igTreeGrid(optionLiteral: 'option', optionName: "height"): string|number; @@ -85182,6 +99928,7 @@ interface JQuery { /** * This is the total height of the grid, including all UI elements - scroll container with data rows, header, footer, filter row - (if any), etc. [Here you can find more info about setting igGrid height](http://www.igniteui.com/help/iggrid-columns-and-layout#width-height). * + * * @optionValue New value to be set. */ @@ -85189,52 +99936,28 @@ interface JQuery { /** * If autoAdjustHeight is set to false, the [height](ui.iggrid#options:height) will be set only on the scrolling container, and all other UI elements such as paging footer / filter row / headers will add on top of that, so the total height of the grid will be more than this value - the height of the scroll container (content area) will not be dynamically calculated. Setting this option to false will usually result in a lot better initial rendering performance for large data ( > 1000 rows rendered at once, no [virtualization](ui.iggrid#options:virtualization) enabled), since no reflows will be made by browsers when accessing DOM properties such as offsetHeight. + * */ igTreeGrid(optionLiteral: 'option', optionName: "autoAdjustHeight"): boolean; /** * If autoAdjustHeight is set to false, the [height](ui.iggrid#options:height) will be set only on the scrolling container, and all other UI elements such as paging footer / filter row / headers will add on top of that, so the total height of the grid will be more than this value - the height of the scroll container (content area) will not be dynamically calculated. Setting this option to false will usually result in a lot better initial rendering performance for large data sets ( > 1000 rows rendered at once, no [virtualization](ui.iggrid#options:virtualization) enabled), since no reflows will be made by browsers when accessing DOM properties such as offsetHeight. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "autoAdjustHeight", optionValue: boolean): void; /** - * Used for [row virtualization](ui.iggrid#options:rowVirtualization) in [fixed mode](ui.iggrid#options:virtualizationMode). This is the average value in pixels (default) that will be used to calculate how many rows to render as the end user scrolls. Also all rows' height will be automatically set to this value. - */ - - igTreeGrid(optionLiteral: 'option', optionName: "avgRowHeight"): string|number; - - /** - * Used for [row virtualization](ui.iggrid#options:rowVirtualization) in [fixed mode](ui.iggrid#options:virtualizationMode). This is the average value in pixels (default) that will be used to calculate how many rows to render as the end user scrolls. Also all rows' height will be automatically set to this value. + * Default column width that will be set for all columns, that don't have [column width](ui.iggrid#options:columns.width) defined. Can also be set as '*', in which case the width auto-size based on the content of the column cells (including the header text). * - * @optionValue New value to be set. - */ - - igTreeGrid(optionLiteral: 'option', optionName: "avgRowHeight", optionValue: string|number): void; - - /** - * Used for [column virtualization](ui.iggrid#options:columnVirtualization) in [fixed mode](ui.iggrid#options:virtualizationMode). This is the average value in pixels for a column width. - */ - - igTreeGrid(optionLiteral: 'option', optionName: "avgColumnWidth"): string|number; - - /** - * Used for [column virtualization](ui.iggrid#options:columnVirtualization) in [fixed mode](ui.iggrid#options:virtualizationMode). This is the average value in pixels for a column width. - * - * @optionValue New value to be set. - */ - - igTreeGrid(optionLiteral: 'option', optionName: "avgColumnWidth", optionValue: string|number): void; - - /** - * Default column width that will be set for all columns, that don't have [column width](ui.iggrid#options:columns.width) defined. */ igTreeGrid(optionLiteral: 'option', optionName: "defaultColumnWidth"): string|number; /** - * Default column width that will be set for all columns, that don't have [column width](ui.iggrid#options:columns.width) defined. + * Default column width that will be set for all columns, that don't have [column width](ui.iggrid#options:columns.width) defined. Can also be set as '*', in which case the width auto-size based on the content of the column cells (including the header text). + * * * @optionValue New value to be set. */ @@ -85245,6 +99968,7 @@ interface JQuery { * If no [columns](ui.iggrid#options:columns) collection is defined, and autoGenerateColumns is set to true, [columns](ui.iggrid#options:columns) will be inferred from the data source before the [dataRendering](ui.iggrid#events:dataRendering) event is fired. The inferred [columns](ui.iggrid#options:columns) collection will be available to the developer for modification at [dataRendering](ui.iggrid#events:dataRendering). If autoGenerateColumns is not explicitly set and [columns](ui.iggrid#options:columns) has at least one column defined then autoGenerateColumns is automatically set to false. * If autoGenerateColumns is true and there are columns defined auto-generated columns will render after the explicitly defined ones. * Since auto-generated columns don't have width defined consider setting [defaultColumnWidth](ui.iggrid#options:defaultColumnWidth) as well. + * */ igTreeGrid(optionLiteral: 'option', optionName: "autoGenerateColumns"): boolean; @@ -85253,86 +99977,70 @@ interface JQuery { * If autoGenerateColumns is true and there are columns defined auto-generated columns will render after the explicitly defined ones. * Since auto-generated columns don't have width defined consider setting [defaultColumnWidth](ui.iggrid#options:defaultColumnWidth) as well. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "autoGenerateColumns", optionValue: boolean): void; /** * Enables/disables column and row virtualization at the same time. Virtualization can greatly enhance rendering performance. If enabled, the number of actual rendered rows (DOM elements) will be constant and related to the visible viewport of the grid. As the end user scrolls, those DOM elements will be dynamically reused to render the new data. [Here you can find more info about the performance guidelines when using the igGrid](http://www.igniteui.com/help/iggrid-performance-guide) + * */ igTreeGrid(optionLiteral: 'option', optionName: "virtualization"): boolean; /** * Enables/disables column and row virtualization at the same time. Virtualization can greatly enhance rendering performance. If enabled, the number of actual rendered rows (DOM elements) will be constant and related to the visible viewport of the grid. As the end user scrolls, those DOM elements will be dynamically reused to render the new data. [Here you can find more info about the performance guidelines when using the igGrid](http://www.igniteui.com/help/iggrid-performance-guide) * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "virtualization", optionValue: boolean): void; - /** - * Determines row virtualization mode. - */ - - igTreeGrid(optionLiteral: 'option', optionName: "virtualizationMode"): string; - - /** - * Determines row virtualization mode. - * - * @optionValue New value to be set. - */ - - igTreeGrid(optionLiteral: 'option', optionName: "virtualizationMode", optionValue: string): void; - /** * Enables virtualization for rows only. [Here you can find more info about igGrid row virtualization](http://www.igniteui.com/help/iggrid-virtualization-overview) + * */ igTreeGrid(optionLiteral: 'option', optionName: "rowVirtualization"): boolean; /** * Enables virtualization for rows only. [Here you can find more info about igGrid row virtualization](http://www.igniteui.com/help/iggrid-virtualization-overview) * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "rowVirtualization", optionValue: boolean): void; - /** - * Enables virtualization for columns only. Column virtualization can work only in combination with fixed row virtalization. Setting columnVirtualization to true will automatically set [virtualization](ui.iggrid#options:virtualization) to true and [virtualizationMode](ui.iggrid#options:virtualizationMode) to "fixed". - */ - igTreeGrid(optionLiteral: 'option', optionName: "columnVirtualization"): boolean; - - /** - * Enables virtualization for columns only. Column virtualization can work only in combination with fixed row virtalization. Setting columnVirtualization to true will automatically set [virtualization](ui.iggrid#options:virtualization) to true and [virtualizationMode](ui.iggrid#options:virtualizationMode) to "fixed". - * - * @optionValue New value to be set. - */ - igTreeGrid(optionLiteral: 'option', optionName: "columnVirtualization", optionValue: boolean): void; - /** * Number of pixels to scroll the grid by, when virtualization is enabled, and mouse wheel scrolling is performed over the virtual grid area. If "null" the step will be equal to the [avgRowHeight](ui.iggrid#options:avgRowHeight). + * */ igTreeGrid(optionLiteral: 'option', optionName: "virtualizationMouseWheelStep"): number; /** * Number of pixels to scroll the grid by, when virtualization is enabled, and mouse wheel scrolling is performed over the virtual grid area. If "null" the step will be equal to the [avgRowHeight](ui.iggrid#options:avgRowHeight). * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "virtualizationMouseWheelStep", optionValue: number): void; /** * If this option is set to true, the height of the grid row will be calculated automatically based on the [avgRowHeight](ui.iggrid#options:avgRowHeight) and the visible virtual records. If no [avgRowHeight](ui.iggrid#options:avgRowHeight) is specified, it will be calculated automatically at runtime. + * */ igTreeGrid(optionLiteral: 'option', optionName: "adjustVirtualHeights"): boolean; /** * If this option is set to true, the height of the grid row will be calculated automatically based on the [avgRowHeight](ui.iggrid#options:avgRowHeight) and the visible virtual records. If no [avgRowHeight](ui.iggrid#options:avgRowHeight) is specified, it will be calculated automatically at runtime. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "adjustVirtualHeights", optionValue: boolean): void; /** * The templating engine that will be used to render the grid [column templates](ui.iggrid#options:columns.template). [Here you can find](http://www.infragistics.com/community/blogs/marina_stoyanova/archive/2014/05/30/using-different-template-engines-with-ignite-ui-controls.aspx) how to use templating engines other than igTemplating and jsRender. + * */ igTreeGrid(optionLiteral: 'option', optionName: "templatingEngine"): string; @@ -85340,6 +100048,7 @@ interface JQuery { /** * The templating engine that will be used to render the grid [column templates](ui.iggrid#options:columns.template). [Here you can find](http://www.infragistics.com/community/blogs/marina_stoyanova/archive/2014/05/30/using-different-template-engines-with-ignite-ui-controls.aspx) how to use templating engines other than igTemplating and jsRender. * + * * @optionValue New value to be set. */ @@ -85347,18 +100056,21 @@ interface JQuery { /** * An array of column objects. Checkout the [Columns and Layout](http://www.igniteui.com/help/iggrid-columns-and-layout#defining-columns) topic for details on configuring the columns array. + * */ igTreeGrid(optionLiteral: 'option', optionName: "columns"): IgGridColumn[]; /** * An array of column objects. Checkout the [Columns and Layout](http://www.igniteui.com/help/iggrid-columns-and-layout#defining-columns) topic for details on configuring the columns array. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "columns", optionValue: IgGridColumn[]): void; /** * Can be any valid data source accepted by [$.ig.DataSource](ig.datasource), or an instance of an $.ig.DataSource itself + * */ igTreeGrid(optionLiteral: 'option', optionName: "dataSource"): Array|Object|string; @@ -85366,6 +100078,7 @@ interface JQuery { /** * Can be any valid data source accepted by [$.ig.DataSource](ig.datasource), or an instance of an $.ig.DataSource itself * + * * @optionValue New value to be set. */ @@ -85373,47 +100086,53 @@ interface JQuery { /** * Gets a remote URL as a data source, from which data will be retrieved using the [$.ig.DataSource](ig.datasource). + * */ igTreeGrid(optionLiteral: 'option', optionName: "dataSourceUrl"): string; /** * Sets a remote URL as a data source, from which data will be retrieved using the [$.ig.DataSource](ig.datasource). * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "dataSourceUrl", optionValue: string): void; /** * Explicitly set data source type (such as "json"). Please refer to the documentation of [$.ig.DataSource type](ig.datasource#options:settings.type). + * */ igTreeGrid(optionLiteral: 'option', optionName: "dataSourceType"): string; /** * Explicitly set data source type (such as "json"). Please refer to the documentation of [$.ig.DataSource type](ig.datasource#options:settings.type). * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "dataSourceType", optionValue: string): void; /** * See [$.ig.DataSource responseDataKey](ig.datasource#options:settings.responseDataKey). This is the property in the responses where data records are held, if the response is wrapped. + * */ igTreeGrid(optionLiteral: 'option', optionName: "responseDataKey"): string; /** * See [$.ig.DataSource responseDataKey](ig.datasource#options:settings.responseDataKey). This is the property in the responses where data records are held, if the response is wrapped. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "responseDataKey", optionValue: string): void; /** - * See [$.ig.DataSource responseTotalRecCountKey](ig.datasource#options:settings.responseTotalRecCountKey). Property in the response specifying the total number of records on the server. + * This option has been deprecated. See [$.ig.DataSource responseTotalRecCountKey](ig.datasource#options:settings.responseTotalRecCountKey). Property in the response specifying the total number of records on the server. */ igTreeGrid(optionLiteral: 'option', optionName: "responseTotalRecCountKey"): string; /** - * See [$.ig.DataSource responseTotalRecCountKey](ig.datasource#options:settings.responseTotalRecCountKey). Property in the response specifying the total number of records on the server. + * This option has been deprecated. See [$.ig.DataSource responseTotalRecCountKey](ig.datasource#options:settings.responseTotalRecCountKey). Property in the response specifying the total number of records on the server. * * @optionValue New value to be set. */ @@ -85421,156 +100140,182 @@ interface JQuery { /** * Gets the HTTP verb to be used to issue the requests to a remote data source. + * */ igTreeGrid(optionLiteral: 'option', optionName: "requestType"): string; /** * Sets the HTTP verb to be used to issue the requests to a remote data source. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "requestType", optionValue: string): void; /** * Content type of the response. See http://api.jquery.com/jQuery.ajax/ => contentType + * */ igTreeGrid(optionLiteral: 'option', optionName: "responseContentType"): string; /** * Content type of the response. See http://api.jquery.com/jQuery.ajax/ => contentType * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "responseContentType", optionValue: string): void; /** * Controls the visibility of the grid header. + * */ igTreeGrid(optionLiteral: 'option', optionName: "showHeader"): boolean; /** * Controls the visibility of the grid header. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "showHeader", optionValue: boolean): void; /** * Controls the visibility of the grid footer. + * */ igTreeGrid(optionLiteral: 'option', optionName: "showFooter"): boolean; /** * Controls the visibility of the grid footer. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "showFooter", optionValue: boolean): void; /** * Headers will be fixed if this option is set to true, and only the grid data will be scrollable. If [virtualization](ui.iggrid#options:virtualization) is enabled, fixedHeaders will always act as if it's true, no matter which value is set. + * */ igTreeGrid(optionLiteral: 'option', optionName: "fixedHeaders"): boolean; /** * Headers will be fixed if this option is set to true, and only the grid data will be scrollable. If [virtualization](ui.iggrid#options:virtualization) is enabled, fixedHeaders will always act as if it's true, no matter which value is set. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "fixedHeaders", optionValue: boolean): void; /** * Footers will be fixed if this option is set to true, and only the grid data will be scrollable. If [virtualization](ui.iggrid#options:virtualization) is enabled, fixedFooters will always act as if it's true, no matter which value is set. + * */ igTreeGrid(optionLiteral: 'option', optionName: "fixedFooters"): boolean; /** * Footers will be fixed if this option is set to true, and only the grid data will be scrollable. If [virtualization](ui.iggrid#options:virtualization) is enabled, fixedFooters will always act as if it's true, no matter which value is set. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "fixedFooters", optionValue: boolean): void; /** * Caption text that will be shown above the grid header. + * */ igTreeGrid(optionLiteral: 'option', optionName: "caption"): string; /** * Caption text that will be shown above the grid header. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "caption", optionValue: string): void; /** * List of grid feature definitions: sorting, paging, etc. Each feature goes with its separate options that are documented for the feature accordingly. [Here you can find detailed documentation for all igGrid features](http://www.igniteui.com/help/iggrid-features-landing-page) + * */ igTreeGrid(optionLiteral: 'option', optionName: "features"): IgGridFeature[]; /** * List of grid feature definitions: sorting, paging, etc. Each feature goes with its separate options that are documented for the feature accordingly. [Here you can find detailed documentation for all igGrid features](http://www.igniteui.com/help/iggrid-features-landing-page) * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "features", optionValue: IgGridFeature[]): void; /** * Initial tabIndex attribute that will be set on all focusable elements. + * */ igTreeGrid(optionLiteral: 'option', optionName: "tabIndex"): number; /** * Initial tabIndex attribute that will be set on all focusable elements. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "tabIndex", optionValue: number): void; /** * If this option is set to false, the data to which the grid is bound will be used "as is" with no additional transformations based on [columns](ui.iggrid#options:columns) defined. Otherwise only the subset of data properties used in the [columns](ui.iggrid#options:columns) defined will be extracted in a new object and used. + * */ igTreeGrid(optionLiteral: 'option', optionName: "localSchemaTransform"): boolean; /** * If this option is set to false, the data to which the grid is bound will be used "as is" with no additional transformations based on [columns](ui.iggrid#options:columns) defined. Otherwise only the subset of data properties used in the [columns](ui.iggrid#options:columns) defined will be extracted in a new object and used. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "localSchemaTransform", optionValue: boolean): void; /** * Key of the column containing unique identifiers for the data records. + * */ igTreeGrid(optionLiteral: 'option', optionName: "primaryKey"): string; /** * Key of the column containing unique identifiers for the data records. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "primaryKey", optionValue: string): void; /** * If true, the transaction log will always be sent in the request for remote data, by the data source. Also this means that if there are values in the log, a POST will be performed instead of GET. + * */ igTreeGrid(optionLiteral: 'option', optionName: "serializeTransactionLog"): boolean; /** * If true, the transaction log will always be sent in the request for remote data, by the data source. Also this means that if there are values in the log, a POST will be performed instead of GET. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "serializeTransactionLog", optionValue: boolean): void; /** * Automatically commits the transactions as rows/cells are being edited to the client data source. A [saveChanges](ui.iggrid#methods:saveChanges) call still needs to be performed in order to commit the transactions to a server-side data source. + * */ igTreeGrid(optionLiteral: 'option', optionName: "autoCommit"): boolean; /** * Automatically commits the transactions as rows/cells are being edited to the client data source. A [saveChanges](ui.iggrid#methods:saveChanges) call still needs to be performed in order to commit the transactions to a server-side data source. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "autoCommit", optionValue: boolean): void; @@ -85581,6 +100326,7 @@ interface JQuery { * If a new row is added, edited, then deleted, there will be no transaction added to the log. * If several edits are made to a row or an individual cell, this should result in a single transaction. * Note: This option takes effect only when [autoCommit](ui.iggrid#options:autoCommit) is set to false. + * */ igTreeGrid(optionLiteral: 'option', optionName: "aggregateTransactions"): boolean; @@ -85591,12 +100337,14 @@ interface JQuery { * If several edits are made to a row or an individual cell, this should result in a single transaction. * Note: This option takes effect only when [autoCommit](ui.iggrid#options:autoCommit) is set to false. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "aggregateTransactions", optionValue: boolean): void; /** * Sets gets ability to automatically format text in cells for numeric and date columns. The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) + * */ igTreeGrid(optionLiteral: 'option', optionName: "autoFormat"): string|boolean; @@ -85604,6 +100352,7 @@ interface JQuery { /** * Sets gets ability to automatically format text in cells for numeric and date columns. The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) * + * * @optionValue New value to be set. */ @@ -85611,72 +100360,84 @@ interface JQuery { /** * Gets ability to render checkboxes and use checkbox editor when dataType of a column is "bool". Checkboxes are not rendered for boolean values in columns with a [column template](ui.iggrid#options:columns.template). + * */ igTreeGrid(optionLiteral: 'option', optionName: "renderCheckboxes"): boolean; /** * Sets ability to render checkboxes and use checkbox editor when dataType of a column is "bool". Checkboxes are not rendered for boolean values in columns with a [column template](ui.iggrid#options:columns.template). * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "renderCheckboxes", optionValue: boolean): void; /** * URL to which updating requests will be made. + * */ igTreeGrid(optionLiteral: 'option', optionName: "updateUrl"): string; /** * URL to which updating requests will be made. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "updateUrl", optionValue: string): void; /** * Enables/disables rendering of alternating row styles (odd and even rows receive different styling). + * */ igTreeGrid(optionLiteral: 'option', optionName: "alternateRowStyles"): boolean; /** * Enables/disables rendering of alternating row styles (odd and even rows receive different styling). * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "alternateRowStyles", optionValue: boolean): void; /** * If set to true and all columns' widths are specified and their combined width is less than the grid width then the last column width will be automatically adjusted to fill the remaining empty space of the grid. + * */ igTreeGrid(optionLiteral: 'option', optionName: "autofitLastColumn"): boolean; /** * If set to true and all columns' widths are specified and their combined width is less than the grid width then the last column width will be automatically adjusted to fill the remaining empty space of the grid. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "autofitLastColumn", optionValue: boolean): void; /** * Enables/disables rendering of hover styles when the mouse is over a record. This can be useful in templating scenarios, for example, where we don't want to apply hover styling to templated content. + * */ igTreeGrid(optionLiteral: 'option', optionName: "enableHoverStyles"): boolean; /** * Enables/disables rendering of hover styles when the mouse is over a record. This can be useful in templating scenarios, for example, where we don't want to apply hover styling to templated content. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "enableHoverStyles", optionValue: boolean): void; /** * Enables/Disables serializing client date as UTC ISO 8061 string instead of using the local time and zone values. + * */ igTreeGrid(optionLiteral: 'option', optionName: "enableUTCDates"): boolean; /** * Enables/Disables serializing client date as UTC ISO 8061 string instead of using the local time and zone values. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "enableUTCDates", optionValue: boolean): void; @@ -85684,6 +100445,7 @@ interface JQuery { /** * Merge unbound columns values inside data source when data source is remote. If true then the unbound columns are merged to the data source at runtime on the server. Note that data source is expanded with the new data and this could cause performance issues when the data is huge. If mergeUnboundColumns is false then the unbound data is sent and merged on the client. This option is used by the [igGrid MVC Helper](http://www.igniteui.com/help/iggrid-developing-asp-net-mvc-applications-with-iggrid). * Checkout [Populating Unbound Columns Remotely (igGrid)](http://www.igniteui.com/help/iggrid-unboundcolumns-populating-with-data-remotely) topic for more information. + * */ igTreeGrid(optionLiteral: 'option', optionName: "mergeUnboundColumns"): boolean; @@ -85691,36 +100453,42 @@ interface JQuery { * Merge unbound columns values inside data source when data source is remote. If true then the unbound columns are merged to the data source at runtime on the server. Note that data source is expanded with the new data and this could cause performance issues when the data is huge. If mergeUnboundColumns is false then the unbound data is sent and merged on the client. This option is used by the [igGrid MVC Helper](http://www.igniteui.com/help/iggrid-developing-asp-net-mvc-applications-with-iggrid). * Checkout [Populating Unbound Columns Remotely (igGrid)](http://www.igniteui.com/help/iggrid-unboundcolumns-populating-with-data-remotely) topic for more information. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "mergeUnboundColumns", optionValue: boolean): void; /** * When dataSource is a remote URL, defines whether to set the type of the remote data source to JSONP. + * */ igTreeGrid(optionLiteral: 'option', optionName: "jsonpRequest"): boolean; /** * When dataSource is a remote URL, defines whether to set the type of the remote data source to JSONP. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "jsonpRequest", optionValue: boolean): void; /** * Enables/disables grid adjusting its dimensions when its [width](ui.iggrid#options:width) and/or [height](ui.iggrid#options:height) is set in percent (%) and grid parent DOM container is resized. + * */ igTreeGrid(optionLiteral: 'option', optionName: "enableResizeContainerCheck"): boolean; /** * Enables/disables grid adjusting its dimensions when its [width](ui.iggrid#options:width) and/or [height](ui.iggrid#options:height) is set in percent (%) and grid parent DOM container is resized. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "enableResizeContainerCheck", optionValue: boolean): void; /** * Configures how the feature chooser icon should display on header cells - e.g. to display as gear icon or not. + * */ igTreeGrid(optionLiteral: 'option', optionName: "featureChooserIconDisplay"): string; @@ -85728,6 +100496,7 @@ interface JQuery { /** * Configures how the feature chooser icon should display on header cells - e.g. to display as gear icon or not. * + * * @optionValue New value to be set. */ @@ -85735,12 +100504,14 @@ interface JQuery { /** * Settings related to content scrolling. + * */ igTreeGrid(optionLiteral: 'option', optionName: "scrollSettings"): IgGridScrollSettings; /** * Settings related to content scrolling. * + * * @optionValue New value to be set. */ igTreeGrid(optionLiteral: 'option', optionName: "scrollSettings", optionValue: IgGridScrollSettings): void; @@ -86100,7 +100871,7 @@ interface JQuery { } interface IgTreeGridMultiColumnHeaders { /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. */ inherit?: boolean; @@ -86131,6 +100902,11 @@ interface IgTreeGridMultiColumnHeaders { } interface IgTreeGridMultiColumnHeadersMethods { destroy(): void; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.iggridmulticolumnheader#options:language) + * Note that this method is for rare scenarios, see [language](ui.iggridmulticolumnheader#options:language) or [locale](ui.iggridmulticolumnheader#options:locale) option setter + */ changeLocale(): void; /** @@ -86178,12 +100954,12 @@ interface JQuery { igTreeGridMultiColumnHeaders(methodName: "getMultiColumnHeaders"): any[]; /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. */ igTreeGridMultiColumnHeaders(optionLiteral: 'option', optionName: "inherit"): boolean; /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. * * @optionValue New value to be set. */ @@ -86245,11 +101021,13 @@ interface JQuery { interface IgTreeGridPagingLocale { /** * Sets/gets the text message shown while loading content of the context row(while processing breadcrumb/immediate parent row). It is set via $.html(). If set to null loading message is not shown. + * */ contextRowLoadingText?: string; /** * Sets/gets the content of the context row when the first record in the page is root(hasn't ancestors) record. It is set via $.html() + * */ contextRowRootText?: string; @@ -86320,6 +101098,7 @@ interface IgTreeGridPaging { /** * Sets gets paging mode. * + * * Valid values: * "rootLevelOnly" Only pages records at the root of the tree grid are displayed. * "allLevels" includes all visible records in paging. @@ -86329,6 +101108,7 @@ interface IgTreeGridPaging { /** * When data flows to the next page there are a couple of different modes that can help communicate the context of a leaf level row. When mode option is "rootLevelOnly" then the context row always shows the value of the contextRowRootText option. * + * * Valid values: * "none" Does not render the contextual row * "parent" Renders a read-only representation of the immediate parent row @@ -86352,48 +101132,62 @@ interface IgTreeGridPaging { /** * Sets/gets the column key of ancestor to be shown in the breadcrumb trail. It is used only when contextRowMode is breadcrumb + * */ breadcrumbKey?: string; /** * Sets/gets (it is set via $.html()) delimiter between ancestors in the breadcrumb trail. It is used only when contextRowMode is breadcrumb + * */ breadcrumbDelimiter?: string; /** * Reference to the (or name of )function, called before rendering context row content(rendering loading message/bread crumb/parent row). The function takes 4 arguments- dataRow, $textArea- jQuery representation of the text area of the context row(when mode is loading/breadcrumb then it is otherwise ), array of parent rows and context mode - "loading"|"breadcrumb"|"parent". When the function returns string it is used as html set in $textArea. If the function does not return result or returns false/empty string then rendering of the content of the context row should be handled by the developer(similar to canceling rendering of context row content). + * */ renderContextRowFunc?: Function|string; locale?: IgTreeGridPagingLocale; + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + inherit?: boolean; + /** * Number of records loaded and displayed per page. + * */ pageSize?: number; /** * The property in the response data, when using remote data source, that will hold the total number of records in the data source. + * */ recordCountKey?: string; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested page size. + * */ pageSizeUrlKey?: string; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested page index. + * */ pageIndexUrlKey?: string; /** * Current page index that's bound in the data source and rendered in the UI. + * */ currentPageIndex?: number; /** * Type of paging. Delegates all paging functionality to the [$.ig.DataSource](ig.datasource). * + * * Valid values: * "remote" Paging is performed by a remote end-point. * "local" Paging is performed locally by the [$.ig.DataSource](ig.datasource). @@ -86402,6 +101196,7 @@ interface IgTreeGridPaging { /** * If false, a dropdown allowing to change the page size will not be rendered in the UI. + * */ showPageSizeDropDown?: boolean; @@ -86514,6 +101309,7 @@ interface IgTreeGridPaging { /** * Page size dropdown location, when [showPageSizeDropDown](ui.iggridpaging#options:showPageSizeDropDown) is set to true. Can be rendered above the grid header or inside the pager, next to the page links. * + * * Valid values: * "above" The page size drop down will be rendered above the grid header. * "inpager" The page size drop down will be rendered next to page links. @@ -86522,54 +101318,58 @@ interface IgTreeGridPaging { /** * Option specifying whether to show summary label for the currently rendered records or not. + * */ showPagerRecordsLabel?: boolean; /** * Option specifying whether to render the first and last page navigation buttons. + * */ showFirstLastPages?: boolean; /** * Option specifying whether to render the previous and next page navigation buttons. + * */ showPrevNextPages?: boolean; /** * Predefined page sizes that are available to the end user to switch their grid paging to, through a drop down in the grid header. + * */ pageSizeList?: any; /** * Sets/Gets the number of pages which if exceeded a drop down list of page indices is displayed. If the number of pages is less than or equal to this option then buttons for each page are displayed. + * */ pageCountLimit?: number; /** * Number of page buttons, adjacent to and including the [active page](ui.iggridpaging#options:currentPageIndex), that are constantly visible. For the invisible pages, previous and next buttons are used. + * */ visiblePageCount?: number; /** * Drop down width for the page size and page index drop downs. + * */ defaultDropDownWidth?: number; /** * Time in milliseconds for which page drop down will wait for keystrokes before changing the page. + * */ delayOnPageChanged?: number; /** * Enables/disables paging persistence between states. + * */ persist?: boolean; - /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. - */ - inherit?: boolean; - /** * Event fired before rendering context row content. * Return false in order to cancel this event. @@ -86595,7 +101395,6 @@ interface IgTreeGridPaging { /** * Event fired when the page size is about to be changed from the page size dropdown. * Return false in order to cancel page size changing. - * Use ui.newPageSize to get new page size. */ pageSizeChanging?: PageSizeChangingEvent; @@ -86621,6 +101420,10 @@ interface IgTreeGridPaging { [optionName: string]: any; } interface IgTreeGridPagingMethods { + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.igtreegridpaging#options:language) + * Note that this method is for rare scenarios, see [language](ui.igtreegridpaging#options:language) or [locale](ui.igtreegridpaging#options:locale) option setter + */ changeLocale(): void; /** @@ -86637,6 +101440,8 @@ interface IgTreeGridPagingMethods { * Get jQuery representation of element that holds text area of the context row. If there isn't such element - creates it. */ getContextRowTextArea(): Object; + changeGlobalLanguage(): void; + changeGlobalRegional(): void; /** * Gets/Sets the current page index, delegates data binding and paging to [$.ig.DataSource](ig.datasource). @@ -86661,11 +101466,14 @@ interface JQuery { igTreeGridPaging(methodName: "destroy"): void; igTreeGridPaging(methodName: "getContextRow"): Object; igTreeGridPaging(methodName: "getContextRowTextArea"): Object; + igTreeGridPaging(methodName: "changeGlobalLanguage"): void; + igTreeGridPaging(methodName: "changeGlobalRegional"): void; igTreeGridPaging(methodName: "pageIndex", index?: number): number; igTreeGridPaging(methodName: "pageSize", size?: number): number; /** * Sets gets paging mode. + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "mode"): string; @@ -86673,6 +101481,7 @@ interface JQuery { /** * Sets gets paging mode. * + * * @optionValue New value to be set. */ @@ -86680,6 +101489,7 @@ interface JQuery { /** * When data flows to the next page there are a couple of different modes that can help communicate the context of a leaf level row. When mode option is "rootLevelOnly" then the context row always shows the value of the contextRowRootText option. + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "contextRowMode"): string; @@ -86687,6 +101497,7 @@ interface JQuery { /** * When data flows to the next page there are a couple of different modes that can help communicate the context of a leaf level row. When mode option is "rootLevelOnly" then the context row always shows the value of the contextRowRootText option. * + * * @optionValue New value to be set. */ @@ -86726,30 +101537,35 @@ interface JQuery { /** * Sets/gets the column key of ancestor to be shown in the breadcrumb trail. It is used only when contextRowMode is breadcrumb + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "breadcrumbKey"): string; /** * Sets/gets the column key of ancestor to be shown in the breadcrumb trail. It is used only when contextRowMode is breadcrumb * + * * @optionValue New value to be set. */ igTreeGridPaging(optionLiteral: 'option', optionName: "breadcrumbKey", optionValue: string): void; /** * Sets/gets (it is set via $.html()) delimiter between ancestors in the breadcrumb trail. It is used only when contextRowMode is breadcrumb + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "breadcrumbDelimiter"): string; /** * Sets/gets (it is set via $.html()) delimiter between ancestors in the breadcrumb trail. It is used only when contextRowMode is breadcrumb * + * * @optionValue New value to be set. */ igTreeGridPaging(optionLiteral: 'option', optionName: "breadcrumbDelimiter", optionValue: string): void; /** * Reference to the (or name of )function, called before rendering context row content(rendering loading message/bread crumb/parent row). The function takes 4 arguments- dataRow, $textArea- jQuery representation of the text area of the context row(when mode is loading/breadcrumb then it is otherwise ), array of parent rows and context mode - "loading"|"breadcrumb"|"parent". When the function returns string it is used as html set in $textArea. If the function does not return result or returns false/empty string then rendering of the content of the context row should be handled by the developer(similar to canceling rendering of context row content). + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "renderContextRowFunc"): Function|string; @@ -86757,6 +101573,7 @@ interface JQuery { /** * Reference to the (or name of )function, called before rendering context row content(rendering loading message/bread crumb/parent row). The function takes 4 arguments- dataRow, $textArea- jQuery representation of the text area of the context row(when mode is loading/breadcrumb then it is otherwise ), array of parent rows and context mode - "loading"|"breadcrumb"|"parent". When the function returns string it is used as html set in $textArea. If the function does not return result or returns false/empty string then rendering of the content of the context row should be handled by the developer(similar to canceling rendering of context row content). * + * * @optionValue New value to be set. */ @@ -86764,68 +101581,91 @@ interface JQuery { igTreeGridPaging(optionLiteral: 'option', optionName: "locale"): IgTreeGridPagingLocale; igTreeGridPaging(optionLiteral: 'option', optionName: "locale", optionValue: IgTreeGridPagingLocale): void; + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + igTreeGridPaging(optionLiteral: 'option', optionName: "inherit"): boolean; + + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + * + * @optionValue New value to be set. + */ + igTreeGridPaging(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + /** * Number of records loaded and displayed per page. + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "pageSize"): number; /** * Number of records loaded and displayed per page. * + * * @optionValue New value to be set. */ igTreeGridPaging(optionLiteral: 'option', optionName: "pageSize", optionValue: number): void; /** * The property in the response data, when using remote data source, that will hold the total number of records in the data source. + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "recordCountKey"): string; /** * The property in the response data, when using remote data source, that will hold the total number of records in the data source. * + * * @optionValue New value to be set. */ igTreeGridPaging(optionLiteral: 'option', optionName: "recordCountKey", optionValue: string): void; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested page size. + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "pageSizeUrlKey"): string; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested page size. * + * * @optionValue New value to be set. */ igTreeGridPaging(optionLiteral: 'option', optionName: "pageSizeUrlKey", optionValue: string): void; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested page index. + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "pageIndexUrlKey"): string; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested page index. * + * * @optionValue New value to be set. */ igTreeGridPaging(optionLiteral: 'option', optionName: "pageIndexUrlKey", optionValue: string): void; /** * Current page index that's bound in the data source and rendered in the UI. + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "currentPageIndex"): number; /** * Current page index that's bound in the data source and rendered in the UI. * + * * @optionValue New value to be set. */ igTreeGridPaging(optionLiteral: 'option', optionName: "currentPageIndex", optionValue: number): void; /** * Type of paging. Delegates all paging functionality to the [$.ig.DataSource](ig.datasource). + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "type"): string; @@ -86833,6 +101673,7 @@ interface JQuery { /** * Type of paging. Delegates all paging functionality to the [$.ig.DataSource](ig.datasource). * + * * @optionValue New value to be set. */ @@ -86840,12 +101681,14 @@ interface JQuery { /** * If false, a dropdown allowing to change the page size will not be rendered in the UI. + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "showPageSizeDropDown"): boolean; /** * If false, a dropdown allowing to change the page size will not be rendered in the UI. * + * * @optionValue New value to be set. */ igTreeGridPaging(optionLiteral: 'option', optionName: "showPageSizeDropDown", optionValue: boolean): void; @@ -87098,6 +101941,7 @@ interface JQuery { /** * Page size dropdown location, when [showPageSizeDropDown](ui.iggridpaging#options:showPageSizeDropDown) is set to true. Can be rendered above the grid header or inside the pager, next to the page links. + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "pageSizeDropDownLocation"): string; @@ -87105,6 +101949,7 @@ interface JQuery { /** * Page size dropdown location, when [showPageSizeDropDown](ui.iggridpaging#options:showPageSizeDropDown) is set to true. Can be rendered above the grid header or inside the pager, next to the page links. * + * * @optionValue New value to be set. */ @@ -87112,123 +101957,129 @@ interface JQuery { /** * Option specifying whether to show summary label for the currently rendered records or not. + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "showPagerRecordsLabel"): boolean; /** * Option specifying whether to show summary label for the currently rendered records or not. * + * * @optionValue New value to be set. */ igTreeGridPaging(optionLiteral: 'option', optionName: "showPagerRecordsLabel", optionValue: boolean): void; /** * Option specifying whether to render the first and last page navigation buttons. + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "showFirstLastPages"): boolean; /** * Option specifying whether to render the first and last page navigation buttons. * + * * @optionValue New value to be set. */ igTreeGridPaging(optionLiteral: 'option', optionName: "showFirstLastPages", optionValue: boolean): void; /** * Option specifying whether to render the previous and next page navigation buttons. + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "showPrevNextPages"): boolean; /** * Option specifying whether to render the previous and next page navigation buttons. * + * * @optionValue New value to be set. */ igTreeGridPaging(optionLiteral: 'option', optionName: "showPrevNextPages", optionValue: boolean): void; /** * Predefined page sizes that are available to the end user to switch their grid paging to, through a drop down in the grid header. + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "pageSizeList"): any; /** * Predefined page sizes that are available to the end user to switch their grid paging to, through a drop down in the grid header. * + * * @optionValue New value to be set. */ igTreeGridPaging(optionLiteral: 'option', optionName: "pageSizeList", optionValue: any): void; /** * Sets/Gets the number of pages which if exceeded a drop down list of page indices is displayed. If the number of pages is less than or equal to this option then buttons for each page are displayed. + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "pageCountLimit"): number; /** * Sets/ the number of pages which if exceeded a drop down list of page indices is displayed. If the number of pages is less than or equal to this option then buttons for each page are displayed. * + * * @optionValue New value to be set. */ igTreeGridPaging(optionLiteral: 'option', optionName: "pageCountLimit", optionValue: number): void; /** * Number of page buttons, adjacent to and including the [active page](ui.iggridpaging#options:currentPageIndex), that are constantly visible. For the invisible pages, previous and next buttons are used. + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "visiblePageCount"): number; /** * Number of page buttons, adjacent to and including the [active page](ui.iggridpaging#options:currentPageIndex), that are constantly visible. For the invisible pages, previous and next buttons are used. * + * * @optionValue New value to be set. */ igTreeGridPaging(optionLiteral: 'option', optionName: "visiblePageCount", optionValue: number): void; /** * Drop down width for the page size and page index drop downs. + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "defaultDropDownWidth"): number; /** * Drop down width for the page size and page index drop downs. * + * * @optionValue New value to be set. */ igTreeGridPaging(optionLiteral: 'option', optionName: "defaultDropDownWidth", optionValue: number): void; /** * Time in milliseconds for which page drop down will wait for keystrokes before changing the page. + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "delayOnPageChanged"): number; /** * Time in milliseconds for which page drop down will wait for keystrokes before changing the page. * + * * @optionValue New value to be set. */ igTreeGridPaging(optionLiteral: 'option', optionName: "delayOnPageChanged", optionValue: number): void; /** * Enables/disables paging persistence between states. + * */ igTreeGridPaging(optionLiteral: 'option', optionName: "persist"): boolean; /** * Enables/disables paging persistence between states. * - * @optionValue New value to be set. - */ - igTreeGridPaging(optionLiteral: 'option', optionName: "persist", optionValue: boolean): void; - - /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. - */ - igTreeGridPaging(optionLiteral: 'option', optionName: "inherit"): boolean; - - /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. * * @optionValue New value to be set. */ - igTreeGridPaging(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + igTreeGridPaging(optionLiteral: 'option', optionName: "persist", optionValue: boolean): void; /** * Event fired before rendering context row content. @@ -87285,14 +102136,12 @@ interface JQuery { /** * Event fired when the page size is about to be changed from the page size dropdown. * Return false in order to cancel page size changing. - * Use ui.newPageSize to get new page size. */ igTreeGridPaging(optionLiteral: 'option', optionName: "pageSizeChanging"): PageSizeChangingEvent; /** * Event fired when the page size is about to be changed from the page size dropdown. * Return false in order to cancel page size changing. - * Use ui.newPageSize to get new page size. * * @optionValue Define event handler function. */ @@ -87342,31 +102191,35 @@ interface JQuery { igTreeGridPaging(methodName: string, ...methodParams: any[]): any; } interface IgTreeGridResizing { + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + inherit?: boolean; + /** * Resize the column to the size of the longest currently visible cell value. + * */ allowDoubleClickToResize?: boolean; /** * Specifies whether the resizing should be deferred until the user finishes resizing or applied immediately. + * */ deferredResizing?: boolean; /** * A list of column settings that specifies resizing options on a per column basis. + * */ columnSettings?: IgGridResizingColumnSetting[]; /** * The width in pixels of the resizing handle which is position at the right side of each resizeable column header. + * */ handleThreshold?: number; - /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. - */ - inherit?: boolean; - /** * Event fired before a resizing operation is executed. */ @@ -87389,6 +102242,8 @@ interface IgTreeGridResizing { } interface IgTreeGridResizingMethods { destroy(): void; + changeGlobalLanguage(): void; + changeGlobalRegional(): void; /** * Resizes a column to a specified width in pixels, percents or auto if no width is specified. @@ -87404,67 +102259,77 @@ interface JQuery { interface JQuery { igTreeGridResizing(methodName: "destroy"): void; + igTreeGridResizing(methodName: "changeGlobalLanguage"): void; + igTreeGridResizing(methodName: "changeGlobalRegional"): void; igTreeGridResizing(methodName: "resize", column: Object, width?: Object): void; + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + igTreeGridResizing(optionLiteral: 'option', optionName: "inherit"): boolean; + + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + * + * @optionValue New value to be set. + */ + igTreeGridResizing(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + /** * Resize the column to the size of the longest currently visible cell value. + * */ igTreeGridResizing(optionLiteral: 'option', optionName: "allowDoubleClickToResize"): boolean; /** * Resize the column to the size of the longest currently visible cell value. * + * * @optionValue New value to be set. */ igTreeGridResizing(optionLiteral: 'option', optionName: "allowDoubleClickToResize", optionValue: boolean): void; /** * Gets whether the resizing should be deferred until the user finishes resizing or applied immediately. + * */ igTreeGridResizing(optionLiteral: 'option', optionName: "deferredResizing"): boolean; /** * Sets whether the resizing should be deferred until the user finishes resizing or applied immediately. * + * * @optionValue New value to be set. */ igTreeGridResizing(optionLiteral: 'option', optionName: "deferredResizing", optionValue: boolean): void; /** * A list of column settings that specifies resizing options on a per column basis. + * */ igTreeGridResizing(optionLiteral: 'option', optionName: "columnSettings"): IgGridResizingColumnSetting[]; /** * A list of column settings that specifies resizing options on a per column basis. * + * * @optionValue New value to be set. */ igTreeGridResizing(optionLiteral: 'option', optionName: "columnSettings", optionValue: IgGridResizingColumnSetting[]): void; /** * The width in pixels of the resizing handle which is position at the right side of each resizeable column header. + * */ igTreeGridResizing(optionLiteral: 'option', optionName: "handleThreshold"): number; /** * The width in pixels of the resizing handle which is position at the right side of each resizeable column header. * - * @optionValue New value to be set. - */ - igTreeGridResizing(optionLiteral: 'option', optionName: "handleThreshold", optionValue: number): void; - - /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. - */ - igTreeGridResizing(optionLiteral: 'option', optionName: "inherit"): boolean; - - /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. * * @optionValue New value to be set. */ - igTreeGridResizing(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + igTreeGridResizing(optionLiteral: 'option', optionName: "handleThreshold", optionValue: number): void; /** * Event fired before a resizing operation is executed. @@ -87511,6 +102376,7 @@ interface IgTreeGridRowSelectors { /** * Determines row numbering format. * + * * Valid values: * "sequential" Defines numbering format to be the index of the visible records. * "hierarchical" Defines numbering format to be concatenation of the parent and children indexes. @@ -87520,30 +102386,40 @@ interface IgTreeGridRowSelectors { /** * Gets the type of checkboxes rendered in the row selector. Can be set only at initialization. * + * * Valid values: * "biState" Checkboxes are rendered and support two states(checked and unchecked). Checkboxes do not cascade down or up in this mode. * "triState" Checkboxes are rendered and support three states(checked, partial and unchecked). Checkboxes cascade up and down in this mode. */ checkBoxMode?: string; + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + inherit?: boolean; + /** * Determines whether the row selectors column should contain row numbering + * */ enableRowNumbering?: boolean; /** * Determines whether the row selectors column should contain checkboxes + * */ enableCheckBoxes?: boolean; /** * The seed to be added to the default numbering + * */ rowNumberingSeed?: number; /** * defines width of the row selector`s column in pixels or percentage. * + * * Valid values: * "string" The row selector column width can be set in pixels (px) and percentage (%) * "number" The row selector width can be set as a number @@ -87555,21 +102431,19 @@ interface IgTreeGridRowSelectors { * Determines whether the selection feature is required for the row selectors. If set to "false" * the widget will not check for Selection availability. If set to "true" an exception will be thrown if Selection is * not available. + * */ requireSelection?: boolean; /** * Determines whether checkboxes will be shown only if row selectors are on focus/selected. + * */ showCheckBoxesOnFocus?: boolean; - /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. - */ - inherit?: boolean; - /** * Enables/disables showing an overlay after clicking on the header checkbox, which allows selecting all records from all pages. + * */ enableSelectAllForPaging?: boolean; @@ -87579,6 +102453,7 @@ interface IgTreeGridRowSelectors { * Element with attribute data-rs-close-all is used for closing the overlay * The default template is "
You have selected ${checked} records. Select all ${totalRecordsCount} records
" * There is also ${allCheckedRecords} parameter which is not used in the default template, but it represents the checked records from all pages. + * */ selectAllForPagingTemplate?: string; @@ -87588,6 +102463,7 @@ interface IgTreeGridRowSelectors { * Element with attribute data-rs-close-all is used for closing the overlay * The default template is "
You have deselected ${unchecked} records. Deselect all ${totalRecordsCount} records
" * There is also ${allCheckedRecords} parameter which is not used in the default template, but it represents the checked records from all pages. + * */ deselectAllForPagingTemplate?: string; locale?: IgGridRowSelectorsLocale; @@ -87614,6 +102490,11 @@ interface IgTreeGridRowSelectors { } interface IgTreeGridRowSelectorsMethods { destroy(): void; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.igtreegridrowselectors#options:language) + * Note that this method is for rare scenarios, see [language](ui.igtreegridrowselectors#options:language) or [locale](ui.igtreegridrowselectors#options:locale) option setter + */ changeLocale(): void; /** @@ -87663,6 +102544,8 @@ interface IgTreeGridRowSelectorsMethods { /** * Returns the check state of the row by id. + * + * @param rowId */ checkStateById(rowId: Object): string; } @@ -87684,6 +102567,7 @@ interface JQuery { /** * Determines row numbering format. + * */ igTreeGridRowSelectors(optionLiteral: 'option', optionName: "rowSelectorNumberingMode"): string; @@ -87691,6 +102575,7 @@ interface JQuery { /** * Determines row numbering format. * + * * @optionValue New value to be set. */ @@ -87698,6 +102583,7 @@ interface JQuery { /** * Gets the type of checkboxes rendered in the row selector. Can be set only at initialization. + * */ igTreeGridRowSelectors(optionLiteral: 'option', optionName: "checkBoxMode"): string; @@ -87705,49 +102591,69 @@ interface JQuery { /** * The type of checkboxes rendered in the row selector. Can be set only at initialization. * + * * @optionValue New value to be set. */ igTreeGridRowSelectors(optionLiteral: 'option', optionName: "checkBoxMode", optionValue: string): void; + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + igTreeGridRowSelectors(optionLiteral: 'option', optionName: "inherit"): boolean; + + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + * + * @optionValue New value to be set. + */ + igTreeGridRowSelectors(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + /** * Determines whether the row selectors column should contain row numbering + * */ igTreeGridRowSelectors(optionLiteral: 'option', optionName: "enableRowNumbering"): boolean; /** * Determines whether the row selectors column should contain row numbering * + * * @optionValue New value to be set. */ igTreeGridRowSelectors(optionLiteral: 'option', optionName: "enableRowNumbering", optionValue: boolean): void; /** * Determines whether the row selectors column should contain checkboxes + * */ igTreeGridRowSelectors(optionLiteral: 'option', optionName: "enableCheckBoxes"): boolean; /** * Determines whether the row selectors column should contain checkboxes * + * * @optionValue New value to be set. */ igTreeGridRowSelectors(optionLiteral: 'option', optionName: "enableCheckBoxes", optionValue: boolean): void; /** * The seed to be added to the default numbering + * */ igTreeGridRowSelectors(optionLiteral: 'option', optionName: "rowNumberingSeed"): number; /** * The seed to be added to the default numbering * + * * @optionValue New value to be set. */ igTreeGridRowSelectors(optionLiteral: 'option', optionName: "rowNumberingSeed", optionValue: number): void; /** * Defines width of the row selector`s column in pixels or percentage. + * */ igTreeGridRowSelectors(optionLiteral: 'option', optionName: "rowSelectorColumnWidth"): string|number; @@ -87755,6 +102661,7 @@ interface JQuery { /** * Defines width of the row selector`s column in pixels or percentage. * + * * @optionValue New value to be set. */ @@ -87764,6 +102671,7 @@ interface JQuery { * Determines whether the selection feature is required for the row selectors. If set to "false" * the widget will not check for Selection availability. If set to "true" an exception will be thrown if Selection is * not available. + * */ igTreeGridRowSelectors(optionLiteral: 'option', optionName: "requireSelection"): boolean; @@ -87772,42 +102680,35 @@ interface JQuery { * the widget will not check for Selection availability. If set to "true" an exception will be thrown if Selection is * not available. * + * * @optionValue New value to be set. */ igTreeGridRowSelectors(optionLiteral: 'option', optionName: "requireSelection", optionValue: boolean): void; /** * Determines whether checkboxes will be shown only if row selectors are on focus/selected. + * */ igTreeGridRowSelectors(optionLiteral: 'option', optionName: "showCheckBoxesOnFocus"): boolean; /** * Determines whether checkboxes will be shown only if row selectors are on focus/selected. * + * * @optionValue New value to be set. */ igTreeGridRowSelectors(optionLiteral: 'option', optionName: "showCheckBoxesOnFocus", optionValue: boolean): void; - /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. - */ - igTreeGridRowSelectors(optionLiteral: 'option', optionName: "inherit"): boolean; - - /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. - * - * @optionValue New value to be set. - */ - igTreeGridRowSelectors(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; - /** * Enables/disables showing an overlay after clicking on the header checkbox, which allows selecting all records from all pages. + * */ igTreeGridRowSelectors(optionLiteral: 'option', optionName: "enableSelectAllForPaging"): boolean; /** * Enables/disables showing an overlay after clicking on the header checkbox, which allows selecting all records from all pages. * + * * @optionValue New value to be set. */ igTreeGridRowSelectors(optionLiteral: 'option', optionName: "enableSelectAllForPaging", optionValue: boolean): void; @@ -87818,6 +102719,7 @@ interface JQuery { * Element with attribute data-rs-close-all is used for closing the overlay * The default template is "
You have selected ${checked} records. Select all ${totalRecordsCount} records
" * There is also ${allCheckedRecords} parameter which is not used in the default template, but it represents the checked records from all pages. + * */ igTreeGridRowSelectors(optionLiteral: 'option', optionName: "selectAllForPagingTemplate"): string; @@ -87828,6 +102730,7 @@ interface JQuery { * The default template is "
You have selected ${checked} records. Select all ${totalRecordsCount} records
" * There is also ${allCheckedRecords} parameter which is not used in the default template, but it represents the checked records from all pages. * + * * @optionValue New value to be set. */ igTreeGridRowSelectors(optionLiteral: 'option', optionName: "selectAllForPagingTemplate", optionValue: string): void; @@ -87838,6 +102741,7 @@ interface JQuery { * Element with attribute data-rs-close-all is used for closing the overlay * The default template is "
You have deselected ${unchecked} records. Deselect all ${totalRecordsCount} records
" * There is also ${allCheckedRecords} parameter which is not used in the default template, but it represents the checked records from all pages. + * */ igTreeGridRowSelectors(optionLiteral: 'option', optionName: "deselectAllForPagingTemplate"): string; @@ -87848,6 +102752,7 @@ interface JQuery { * The default template is "
You have deselected ${unchecked} records. Deselect all ${totalRecordsCount} records
" * There is also ${allCheckedRecords} parameter which is not used in the default template, but it represents the checked records from all pages. * + * * @optionValue New value to be set. */ igTreeGridRowSelectors(optionLiteral: 'option', optionName: "deselectAllForPagingTemplate", optionValue: string): void; @@ -87898,17 +102803,20 @@ interface JQuery { interface IgTreeGridSelection { /** * Enables / Disables multiple selection of cells and rows - depending on the mode + * */ multipleSelection?: boolean; /** * Enables / disables selection via dragging with the mouse - only applicable for cell selection + * */ mouseDragSelect?: boolean; /** * Defines type of the selection. * + * * Valid values: * "row" Defines row selection mode. * "cell" Defines cell selection mode. @@ -87917,36 +102825,43 @@ interface IgTreeGridSelection { /** * Enables / disables activation of rows and cells. Activation implies ability to perform navigating through cells and rows via the keyboard, and selecting rows and cells using CTRL / SHIFT - in the way cells/rows are selected in Ms Excel + * */ activation?: boolean; /** * If wrapAround is enabled and selection is on the first or last row or cell, then when the end user tries to go beyond that, the first/last row or cell will be selected + * */ wrapAround?: boolean; /** * If true will basically skip going into child grids with down / up / right / left arrow keys, when in the context of hierarchical grid + * */ skipChildren?: boolean; /** * If true multiple selection of cells is done as if CTRL is being held. the option is disregarded if mode is set to row. this option is useful for enabling multiple discountinued selection on touch environments. + * */ multipleCellSelectOnClick?: boolean; /** - * Enables / disables selection via continuous touch event - only applicable for cell selection and touch-supported environments + * Deprecated="true" Enables / disables selection via continuous touch event - only applicable for cell selection and touch-supported environments + * */ touchDragSelect?: boolean; /** * Enables / disables selection persistance between states. + * */ persist?: boolean; /** * Enables / disables the ability to ctrl drag multiple selection windows when selection mode is 'cell' + * */ allowMultipleRangeSelection?: boolean; @@ -88131,30 +103046,35 @@ interface JQuery { /** * Enables / Disables multiple selection of cells and rows - depending on the mode + * */ igTreeGridSelection(optionLiteral: 'option', optionName: "multipleSelection"): boolean; /** * Enables / Disables multiple selection of cells and rows - depending on the mode * + * * @optionValue New value to be set. */ igTreeGridSelection(optionLiteral: 'option', optionName: "multipleSelection", optionValue: boolean): void; /** * Enables / disables selection via dragging with the mouse - only applicable for cell selection + * */ igTreeGridSelection(optionLiteral: 'option', optionName: "mouseDragSelect"): boolean; /** * Enables / disables selection via dragging with the mouse - only applicable for cell selection * + * * @optionValue New value to be set. */ igTreeGridSelection(optionLiteral: 'option', optionName: "mouseDragSelect", optionValue: boolean): void; /** * Defines type of the selection. + * */ igTreeGridSelection(optionLiteral: 'option', optionName: "mode"): string; @@ -88162,6 +103082,7 @@ interface JQuery { /** * Defines type of the selection. * + * * @optionValue New value to be set. */ @@ -88169,59 +103090,69 @@ interface JQuery { /** * Enables / disables activation of rows and cells. Activation implies ability to perform navigating through cells and rows via the keyboard, and selecting rows and cells using CTRL / SHIFT - in the way cells/rows are selected in Ms Excel + * */ igTreeGridSelection(optionLiteral: 'option', optionName: "activation"): boolean; /** * Enables / disables activation of rows and cells. Activation implies ability to perform navigating through cells and rows via the keyboard, and selecting rows and cells using CTRL / SHIFT - in the way cells/rows are selected in Ms Excel * + * * @optionValue New value to be set. */ igTreeGridSelection(optionLiteral: 'option', optionName: "activation", optionValue: boolean): void; /** * If wrapAround is enabled and selection is on the first or last row or cell, then when the end user tries to go beyond that, the first/last row or cell will be selected + * */ igTreeGridSelection(optionLiteral: 'option', optionName: "wrapAround"): boolean; /** * If wrapAround is enabled and selection is on the first or last row or cell, then when the end user tries to go beyond that, the first/last row or cell will be selected * + * * @optionValue New value to be set. */ igTreeGridSelection(optionLiteral: 'option', optionName: "wrapAround", optionValue: boolean): void; /** * If true will basically skip going into child grids with down / up / right / left arrow keys, when in the context of hierarchical grid + * */ igTreeGridSelection(optionLiteral: 'option', optionName: "skipChildren"): boolean; /** * If true will basically skip going into child grids with down / up / right / left arrow keys, when in the context of hierarchical grid * + * * @optionValue New value to be set. */ igTreeGridSelection(optionLiteral: 'option', optionName: "skipChildren", optionValue: boolean): void; /** * If true multiple selection of cells is done as if CTRL is being held. the option is disregarded if mode is set to row. this option is useful for enabling multiple discountinued selection on touch environments. + * */ igTreeGridSelection(optionLiteral: 'option', optionName: "multipleCellSelectOnClick"): boolean; /** * If true multiple selection of cells is done as if CTRL is being held. the option is disregarded if mode is set to row. this option is useful for enabling multiple discountinued selection on touch environments. * + * * @optionValue New value to be set. */ igTreeGridSelection(optionLiteral: 'option', optionName: "multipleCellSelectOnClick", optionValue: boolean): void; /** - * Enables / disables selection via continuous touch event - only applicable for cell selection and touch-supported environments + * Deprecated="true" Enables / disables selection via continuous touch event - only applicable for cell selection and touch-supported environments + * */ igTreeGridSelection(optionLiteral: 'option', optionName: "touchDragSelect"): boolean; /** - * Enables / disables selection via continuous touch event - only applicable for cell selection and touch-supported environments + * Deprecated="true" Enables / disables selection via continuous touch event - only applicable for cell selection and touch-supported environments + * * * @optionValue New value to be set. */ @@ -88229,24 +103160,28 @@ interface JQuery { /** * Enables / disables selection persistance between states. + * */ igTreeGridSelection(optionLiteral: 'option', optionName: "persist"): boolean; /** * Enables / disables selection persistance between states. * + * * @optionValue New value to be set. */ igTreeGridSelection(optionLiteral: 'option', optionName: "persist", optionValue: boolean): void; /** * Enables / disables the ability to ctrl drag multiple selection windows when selection mode is 'cell' + * */ igTreeGridSelection(optionLiteral: 'option', optionName: "allowMultipleRangeSelection"): boolean; /** * Enables / disables the ability to ctrl drag multiple selection windows when selection mode is 'cell' * + * * @optionValue New value to be set. */ igTreeGridSelection(optionLiteral: 'option', optionName: "allowMultipleRangeSelection", optionValue: boolean): void; @@ -88363,17 +103298,25 @@ interface JQuery { interface IgTreeGridSorting { /** * Specifies from which data bound level to be applied sorting - 0 is the first level + * */ fromLevel?: number; /** * Specifies to which data bound level to be applied sorting - if -1 sorting should be applied to the last data bound level + * */ toLevel?: number; + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + inherit?: boolean; + /** * Defines local or remote sorting operations. * + * * Valid values: * "remote" Sorting is performed remotely as a server-side operation. * "local" Sorting is performed locally by the [$.ig.DataSource](ig.datasource) component. @@ -88382,32 +103325,38 @@ interface IgTreeGridSorting { /** * Enables or disables the case sensitivity of the sorting. Works only for [local](ui.iggridsorting#options:type) sorting. + * */ caseSensitive?: boolean; /** * Enables/disables special styling for sorted columns. If false, sorted column cells will not have any special sort-related styling. + * */ applySortedColumnCss?: boolean; /** * URL param name which specifies how sorting expressions will be encoded in the URL. Uses OData conventions. ex: ?sort(col1)=asc + * */ sortUrlKey?: string; /** * URL param value for ascending type of sorting. Uses OData conventions. Example: ?sort(col1)=asc + * */ sortUrlKeyAscValue?: string; /** * URL param value for descending type of sorting. Uses OData conventions. Example: ?sort(col1)=desc + * */ sortUrlKeyDescValue?: string; /** * Defines single column sorting or multiple column sorting. * + * * Valid values: * "single" Only a single column can be sorted. Previously sorted columns will not preserve their sorting upon sorting a new column. * "multi" If enabled, previous sorted state for columns won't be cleared @@ -88416,12 +103365,14 @@ interface IgTreeGridSorting { /** * Custom sort function(or name of the function as a string) accepting three parameters - the data to be sorted, an array of data source field definitions, and the direction to sort with (optional). The function should return the sorted data array. + * */ customSortFunction?: Function; /** * Specifies which direction to use on the first click / keydown, if the column is sorted for the first time. * + * * Valid values: * "ascending" The first sort of the column data will be in ascending order. * "descending" The first sort of the column data will be in descending order. @@ -88430,6 +103381,7 @@ interface IgTreeGridSorting { /** * Specifies whether sorting to be applied immediately when click sort/unsort columns when using the multiple sorting dialog. When it is false Apply button shows and sorting is applied when the button is clicked. + * */ modalDialogSortOnClick?: boolean; @@ -88521,6 +103473,7 @@ interface IgTreeGridSorting { /** * Specifies width of multiple sorting dialog. * + * * Valid values: * "string" Specifies the width in pixels as a string ("300px"). * "number" Specifies the width in pixels as a number (300) @@ -88530,6 +103483,7 @@ interface IgTreeGridSorting { /** * Specifies height of multiple sorting dialog. * + * * Valid values: * "string" The widget height can be set in pixels (px) and percentage (%). * "number" The widget height can be set in pixels as a number. @@ -88538,16 +103492,19 @@ interface IgTreeGridSorting { /** * Specifies time of milliseconds for animation duration to show/hide modal dialog. + * */ modalDialogAnimationDuration?: number; /** * A list of custom column settings that specify custom sorting settings for a specific column (whether sorting is enabled / disabled, default sort direction, first sort direction, etc.). + * */ columnSettings?: IgGridSortingColumnSetting[]; /** * Enables/disables sorting persistence when the grid is rebound. + * */ persist?: boolean; @@ -88561,14 +103518,10 @@ interface IgTreeGridSorting { /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. + * */ dialogWidget?: string; - /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. - */ - inherit?: boolean; - /** * Event fired before sorting is invoked for a certain column. * Return false in order to cancel column sorting. @@ -88646,6 +103599,10 @@ interface IgTreeGridSorting { [optionName: string]: any; } interface IgTreeGridSortingMethods { + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.igtreegridsorting#options:language) + * Note that this method is for rare scenarios, see [language](ui.igtreegridsorting#options:language) or [locale](ui.igtreegridsorting#options:locale) option setter + */ changeLocale(): void; /** @@ -88655,12 +103612,15 @@ interface IgTreeGridSortingMethods { */ isColumnSorted(columnKey: string): boolean; destroy(): void; + changeGlobalLanguage(): void; + changeGlobalRegional(): void; /** * Sorts the data in a grid column and updates the UI. * * @param index Column key (string) or index (number) - for multi-row grid only column key can be used. Specifies the column which we want to sort. If the mode is multiple, previous sorting states are not cleared. * @param direction Specifies sorting direction (ascending or descending) + * @param header */ sortColumn(index: Object, direction: Object, header: Object): void; @@ -88696,6 +103656,8 @@ interface IgTreeGridSortingMethods { /** * Renders content of multiple sorting dialog - sorted and unsorted columns. + * + * @param isToCallEvents */ renderMultipleSortingDialogContent(isToCallEvents: Object): void; @@ -88712,6 +103674,8 @@ interface JQuery { igTreeGridSorting(methodName: "changeLocale"): void; igTreeGridSorting(methodName: "isColumnSorted", columnKey: string): boolean; igTreeGridSorting(methodName: "destroy"): void; + igTreeGridSorting(methodName: "changeGlobalLanguage"): void; + igTreeGridSorting(methodName: "changeGlobalRegional"): void; igTreeGridSorting(methodName: "sortColumn", index: Object, direction: Object, header: Object): void; igTreeGridSorting(methodName: "sortMultiple", exprs?: any[]): void; igTreeGridSorting(methodName: "clearSorting"): void; @@ -88723,30 +103687,47 @@ interface JQuery { /** * Specifies from which data bound level to be applied sorting - 0 is the first level + * */ igTreeGridSorting(optionLiteral: 'option', optionName: "fromLevel"): number; /** * Specifies from which data bound level to be applied sorting - 0 is the first level * + * * @optionValue New value to be set. */ igTreeGridSorting(optionLiteral: 'option', optionName: "fromLevel", optionValue: number): void; /** * Specifies to which data bound level to be applied sorting - if -1 sorting should be applied to the last data bound level + * */ igTreeGridSorting(optionLiteral: 'option', optionName: "toLevel"): number; /** * Specifies to which data bound level to be applied sorting - if -1 sorting should be applied to the last data bound level * + * * @optionValue New value to be set. */ igTreeGridSorting(optionLiteral: 'option', optionName: "toLevel", optionValue: number): void; + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + igTreeGridSorting(optionLiteral: 'option', optionName: "inherit"): boolean; + + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + * + * @optionValue New value to be set. + */ + igTreeGridSorting(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + /** * Defines local or remote sorting operations. + * */ igTreeGridSorting(optionLiteral: 'option', optionName: "type"): string; @@ -88754,6 +103735,7 @@ interface JQuery { /** * Defines local or remote sorting operations. * + * * @optionValue New value to be set. */ @@ -88761,66 +103743,77 @@ interface JQuery { /** * Enables or disables the case sensitivity of the sorting. Works only for [local](ui.iggridsorting#options:type) sorting. + * */ igTreeGridSorting(optionLiteral: 'option', optionName: "caseSensitive"): boolean; /** * Enables or disables the case sensitivity of the sorting. Works only for [local](ui.iggridsorting#options:type) sorting. * + * * @optionValue New value to be set. */ igTreeGridSorting(optionLiteral: 'option', optionName: "caseSensitive", optionValue: boolean): void; /** * Enables/disables special styling for sorted columns. If false, sorted column cells will not have any special sort-related styling. + * */ igTreeGridSorting(optionLiteral: 'option', optionName: "applySortedColumnCss"): boolean; /** * Enables/disables special styling for sorted columns. If false, sorted column cells will not have any special sort-related styling. * + * * @optionValue New value to be set. */ igTreeGridSorting(optionLiteral: 'option', optionName: "applySortedColumnCss", optionValue: boolean): void; /** * URL param name which specifies how sorting expressions will be encoded in the URL. Uses OData conventions. ex: ?sort(col1)=asc + * */ igTreeGridSorting(optionLiteral: 'option', optionName: "sortUrlKey"): string; /** * URL param name which specifies how sorting expressions will be encoded in the URL. Uses OData conventions. ex: ?sort(col1)=asc * + * * @optionValue New value to be set. */ igTreeGridSorting(optionLiteral: 'option', optionName: "sortUrlKey", optionValue: string): void; /** * URL param value for ascending type of sorting. Uses OData conventions. Example: ?sort(col1)=asc + * */ igTreeGridSorting(optionLiteral: 'option', optionName: "sortUrlKeyAscValue"): string; /** * URL param value for ascending type of sorting. Uses OData conventions. Example: ?sort(col1)=asc * + * * @optionValue New value to be set. */ igTreeGridSorting(optionLiteral: 'option', optionName: "sortUrlKeyAscValue", optionValue: string): void; /** * URL param value for descending type of sorting. Uses OData conventions. Example: ?sort(col1)=desc + * */ igTreeGridSorting(optionLiteral: 'option', optionName: "sortUrlKeyDescValue"): string; /** * URL param value for descending type of sorting. Uses OData conventions. Example: ?sort(col1)=desc * + * * @optionValue New value to be set. */ igTreeGridSorting(optionLiteral: 'option', optionName: "sortUrlKeyDescValue", optionValue: string): void; /** * Defines single column sorting or multiple column sorting. + * */ igTreeGridSorting(optionLiteral: 'option', optionName: "mode"): string; @@ -88828,6 +103821,7 @@ interface JQuery { /** * Defines single column sorting or multiple column sorting. * + * * @optionValue New value to be set. */ @@ -88835,18 +103829,21 @@ interface JQuery { /** * Custom sort function(or name of the function as a string) accepting three parameters - the data to be sorted, an array of data source field definitions, and the direction to sort with (optional). The function should return the sorted data array. + * */ igTreeGridSorting(optionLiteral: 'option', optionName: "customSortFunction"): Function; /** * Custom sort function(or name of the function as a string) accepting three parameters - the data to be sorted, an array of data source field definitions, and the direction to sort with (optional). The function should return the sorted data array. * + * * @optionValue New value to be set. */ igTreeGridSorting(optionLiteral: 'option', optionName: "customSortFunction", optionValue: Function): void; /** * Gets which direction to use on the first click / keydown, if the column is sorted for the first time. + * */ igTreeGridSorting(optionLiteral: 'option', optionName: "firstSortDirection"): string; @@ -88854,6 +103851,7 @@ interface JQuery { /** * Sets which direction to use on the first click / keydown, if the column is sorted for the first time. * + * * @optionValue New value to be set. */ @@ -88861,12 +103859,14 @@ interface JQuery { /** * Gets whether sorting to be applied immediately when click sort/unsort columns when using the multiple sorting dialog. When it is false Apply button shows and sorting is applied when the button is clicked. + * */ igTreeGridSorting(optionLiteral: 'option', optionName: "modalDialogSortOnClick"): boolean; /** * Sets whether sorting to be applied immediately when click sort/unsort columns when using the multiple sorting dialog. When it is false Apply button shows and sorting is applied when the button is clicked. * + * * @optionValue New value to be set. */ igTreeGridSorting(optionLiteral: 'option', optionName: "modalDialogSortOnClick", optionValue: boolean): void; @@ -89067,6 +104067,7 @@ interface JQuery { /** * Gets width of multiple sorting dialog. + * */ igTreeGridSorting(optionLiteral: 'option', optionName: "modalDialogWidth"): string|number; @@ -89074,6 +104075,7 @@ interface JQuery { /** * Sets width of multiple sorting dialog. * + * * @optionValue New value to be set. */ @@ -89081,6 +104083,7 @@ interface JQuery { /** * Gets height of multiple sorting dialog. + * */ igTreeGridSorting(optionLiteral: 'option', optionName: "modalDialogHeight"): string|number; @@ -89088,6 +104091,7 @@ interface JQuery { /** * Sets height of multiple sorting dialog. * + * * @optionValue New value to be set. */ @@ -89095,36 +104099,42 @@ interface JQuery { /** * Gets time of milliseconds for animation duration to show/hide modal dialog. + * */ igTreeGridSorting(optionLiteral: 'option', optionName: "modalDialogAnimationDuration"): number; /** * Sets time of milliseconds for animation duration to show/hide modal dialog. * + * * @optionValue New value to be set. */ igTreeGridSorting(optionLiteral: 'option', optionName: "modalDialogAnimationDuration", optionValue: number): void; /** * A list of custom column settings that specify custom sorting settings for a specific column (whether sorting is enabled / disabled, default sort direction, first sort direction, etc.). + * */ igTreeGridSorting(optionLiteral: 'option', optionName: "columnSettings"): IgGridSortingColumnSetting[]; /** * A list of custom column settings that specify custom sorting settings for a specific column (whether sorting is enabled / disabled, default sort direction, first sort direction, etc.). * + * * @optionValue New value to be set. */ igTreeGridSorting(optionLiteral: 'option', optionName: "columnSettings", optionValue: IgGridSortingColumnSetting[]): void; /** * Enables/disables sorting persistence when the grid is rebound. + * */ igTreeGridSorting(optionLiteral: 'option', optionName: "persist"): boolean; /** * Enables/disables sorting persistence when the grid is rebound. * + * * @optionValue New value to be set. */ igTreeGridSorting(optionLiteral: 'option', optionName: "persist", optionValue: boolean): void; @@ -89149,27 +104159,17 @@ interface JQuery { /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. + * */ igTreeGridSorting(optionLiteral: 'option', optionName: "dialogWidget"): string; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. * - * @optionValue New value to be set. - */ - igTreeGridSorting(optionLiteral: 'option', optionName: "dialogWidget", optionValue: string): void; - - /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. - */ - igTreeGridSorting(optionLiteral: 'option', optionName: "inherit"): boolean; - - /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. * * @optionValue New value to be set. */ - igTreeGridSorting(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + igTreeGridSorting(optionLiteral: 'option', optionName: "dialogWidget", optionValue: string): void; /** * Event fired before sorting is invoked for a certain column. @@ -89348,7 +104348,13 @@ interface JQuery { } interface IgTreeGridTooltips { /** - * determines the tooltip visibility option + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + inherit?: boolean; + + /** + * Determines the tooltip visibility option + * * * Valid values: * "always" tooltips always show for hovered elements @@ -89358,7 +104364,8 @@ interface IgTreeGridTooltips { visibility?: string; /** - * controls the tooltip's style + * Controls the tooltip's style + * * * Valid values: * "tooltip" The tooltip will be positioned according to the mouse cursor. Will render the tooltip content as plain text. @@ -89369,40 +104376,41 @@ interface IgTreeGridTooltips { /** * The time in milliseconds after which tooltip will show when * mouse cursor is hovered over a cell. + * */ showDelay?: number; /** * Type="integer" The time in milliseconds after which tooltip hides when mouse * cursor gets outside of the cell. + * */ hideDelay?: number; /** * A list of custom column settings that specify custom tooltip settings for a specific column (whether tooltips are enabled / disabled) + * */ columnSettings?: IgGridTooltipsColumnSettings; /** * Sets the time tooltip fades in and out when showing/hiding + * */ fadeTimespan?: number; /** * Sets the left position of the tooltip relative to the mouse cursor + * */ cursorLeftOffset?: number; /** * Sets the top position of the tooltip relative to the mouse cursor + * */ cursorTopOffset?: number; - /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. - */ - inherit?: boolean; - /** * Event fired when the mouse has hovered on an element long enough to display a tooltip */ @@ -89444,8 +104452,21 @@ interface JQuery { igTreeGridTooltips(methodName: "destroy"): void; igTreeGridTooltips(methodName: "id"): string; + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + igTreeGridTooltips(optionLiteral: 'option', optionName: "inherit"): boolean; + + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + * + * @optionValue New value to be set. + */ + igTreeGridTooltips(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + /** * Determines the tooltip visibility option + * */ igTreeGridTooltips(optionLiteral: 'option', optionName: "visibility"): string; @@ -89453,6 +104474,7 @@ interface JQuery { /** * Determines the tooltip visibility option * + * * @optionValue New value to be set. */ @@ -89460,6 +104482,7 @@ interface JQuery { /** * Controls the tooltip's style + * */ igTreeGridTooltips(optionLiteral: 'option', optionName: "style"): string; @@ -89467,6 +104490,7 @@ interface JQuery { /** * Controls the tooltip's style * + * * @optionValue New value to be set. */ @@ -89475,6 +104499,7 @@ interface JQuery { /** * The time in milliseconds after which tooltip will show when * mouse cursor is hovered over a cell. + * */ igTreeGridTooltips(optionLiteral: 'option', optionName: "showDelay"): number; @@ -89482,6 +104507,7 @@ interface JQuery { * The time in milliseconds after which tooltip will show when * mouse cursor is hovered over a cell. * + * * @optionValue New value to be set. */ igTreeGridTooltips(optionLiteral: 'option', optionName: "showDelay", optionValue: number): void; @@ -89489,6 +104515,7 @@ interface JQuery { /** * Type="integer" The time in milliseconds after which tooltip hides when mouse * cursor gets outside of the cell. + * */ igTreeGridTooltips(optionLiteral: 'option', optionName: "hideDelay"): number; @@ -89496,69 +104523,66 @@ interface JQuery { * Type="integer" The time in milliseconds after which tooltip hides when mouse * cursor gets outside of the cell. * + * * @optionValue New value to be set. */ igTreeGridTooltips(optionLiteral: 'option', optionName: "hideDelay", optionValue: number): void; /** * A list of custom column settings that specify custom tooltip settings for a specific column (whether tooltips are enabled / disabled) + * */ igTreeGridTooltips(optionLiteral: 'option', optionName: "columnSettings"): IgGridTooltipsColumnSettings; /** * A list of custom column settings that specify custom tooltip settings for a specific column (whether tooltips are enabled / disabled) * + * * @optionValue New value to be set. */ igTreeGridTooltips(optionLiteral: 'option', optionName: "columnSettings", optionValue: IgGridTooltipsColumnSettings): void; /** * The time tooltip fades in and out when showing/hiding + * */ igTreeGridTooltips(optionLiteral: 'option', optionName: "fadeTimespan"): number; /** * Sets the time tooltip fades in and out when showing/hiding * + * * @optionValue New value to be set. */ igTreeGridTooltips(optionLiteral: 'option', optionName: "fadeTimespan", optionValue: number): void; /** * The left position of the tooltip relative to the mouse cursor + * */ igTreeGridTooltips(optionLiteral: 'option', optionName: "cursorLeftOffset"): number; /** * Sets the left position of the tooltip relative to the mouse cursor * + * * @optionValue New value to be set. */ igTreeGridTooltips(optionLiteral: 'option', optionName: "cursorLeftOffset", optionValue: number): void; /** * The top position of the tooltip relative to the mouse cursor + * */ igTreeGridTooltips(optionLiteral: 'option', optionName: "cursorTopOffset"): number; /** * Sets the top position of the tooltip relative to the mouse cursor * - * @optionValue New value to be set. - */ - igTreeGridTooltips(optionLiteral: 'option', optionName: "cursorTopOffset", optionValue: number): void; - - /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. - */ - igTreeGridTooltips(optionLiteral: 'option', optionName: "inherit"): boolean; - - /** - * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. * * @optionValue New value to be set. */ - igTreeGridTooltips(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + igTreeGridTooltips(optionLiteral: 'option', optionName: "cursorTopOffset", optionValue: number): void; /** * Event fired when the mouse has hovered on an element long enough to display a tooltip @@ -89616,11 +104640,13 @@ interface JQuery { interface IgTreeGridUpdatingLocale { /** * Specifies the add child tooltip text. + * */ addChildTooltip?: string; /** * Specifies the label of the add child button in touch environment. + * */ addChildButtonLabel?: string; @@ -89633,6 +104659,7 @@ interface IgTreeGridUpdatingLocale { interface IgTreeGridUpdating { /** * Specifies whether to enable or disable adding children to rows. + * */ enableAddChild?: boolean; @@ -89649,14 +104676,21 @@ interface IgTreeGridUpdating { addChildButtonLabel?: string; locale?: IgTreeGridUpdatingLocale; + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + inherit?: boolean; + /** * A list of custom column options that specify editing and validation settings for a specific column. + * */ columnSettings?: IgGridUpdatingColumnSetting[]; /** * Specifies the edit mode. * + * * Valid values: * "row" Editors are shown for all columns that are not read-only. The editor of the clicked cell receives initial focus. Done and Cancel buttons may be displayed based on the [showDoneCancelButtons](ui.iggridupdating#options:showDoneCancelButtons) property. * "cell" An editor is shown for the cell entering edit mode. The Done and Cancel buttons are not supported for this mode. @@ -89667,16 +104701,19 @@ interface IgTreeGridUpdating { /** * Specifies if deleting rows through the UI is enabled. + * */ enableDeleteRow?: boolean; /** * Specifies if adding rows through the UI is enabled. When enabled an additional row is rendered at the bottom of the grid's header that works as a button. When the end-user clicks on it edit mode is initiated either through a dialog (when [editMode](ui.iggridupdating#options:editMode) is 'dialog') or mimicking the look and feel of 'row' [editMode](ui.iggridupdating#options:editMode) (when [editMode](ui.iggridupdating#options:editMode) is 'row' or 'cell'). + * */ enableAddRow?: boolean; /** * Specifies if the value of each editable column in the grid should be validated. The validation is done based on the rules of their corresponding editors. + * */ validation?: boolean; @@ -89738,64 +104775,70 @@ interface IgTreeGridUpdating { /** * Determines if the Done and Cancel buttons will be available as means to end edit mode for [editMode](ui.iggridupdating#options:editMode) 'row' and when adding a new row. + * */ showDoneCancelButtons?: boolean; /** * Specifies if an exception should be thrown when the grid's data view changes while there are pending transactions in the data source. The data view changes when the data source performs a sorting, filtering, groupby or paging operation and the exception thrown will prevent the operation from succeeding. All pending transactions must be committed before a data view operation is able to complete. Committing transactions can be done manually through the grid's [commit](ui.iggrid#methods:commit) function or automatically by setting [autoCommit](ui.iggrid#options:autoCommit) to 'true'. + * */ enableDataDirtyException?: boolean; /** * Specifies how end-users are able to start edit mode. Possible values: "click", "dblclick", "F2", "enter" and their combinations separated by coma or in array. The keyboard triggers have effect only if the grid cells can receive focus (the grid's [tabIndex](ui.iggrid#options:tabIndex) property should not have a negative value) or Selection is enabled. If "dblclick" is included, then "click" has no effect. + * */ startEditTriggers?: string|Array; /** * Determines if pressing Enter to navigate away from the currently edited cell should move the focus horizontally or vertically (default). + * */ horizontalMoveOnEnter?: boolean; /** * Enables excel navigation style. When turned on, the arrow keys can be used for changing the currently edited cell similar to how Tab and Enter behave. When disabled, the arrow keys control the cursor inside editors. + * */ excelNavigationMode?: boolean; /** * Sets a custom function to be called when the AJAX request to the URL specified by the [updateUrl](ui.iggrid#options:updateUrl) property succeeds. The function will be called with arguments representing the data returned by the server. + * */ saveChangesSuccessHandler?: Function|string; /** * Sets a custom function to be called when the AJAX request to the URL specified by the [updateUrl](ui.iggrid#options:updateUrl) property fails. The function will be called with arguments representing the data returned by the server. + * */ saveChangesErrorHandler?: Function|string; /** * On touch-enabled devices specifies the swipe distance for the delete button to appear. + * */ swipeDistance?: string|number; /** * Controls if navigation will wrap around the grid. The feature will never wrap around virtual grids. + * */ wrapAround?: boolean; /** * A list of options controlling the rendering behavior of the row edit dialog. If [editMode](ui.iggridupdating#options:editMode) is not 'dialog' these have no effect. + * */ rowEditDialogOptions?: IgGridUpdatingRowEditDialogOptions; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. For more information on how to utilize this property, please refer to the [Extending igGrid Modal Dialog](http://www.igniteui.com/help/extending-iggrid-modal-dialog) topic. + * */ dialogWidget?: string; - /** - * Enables/disables feature inheritance for the child layouts in igHierarchicalGrid. - */ - inherit?: boolean; - /** * Event fired before row editing begins. * Return false in order to cancel editing. @@ -89904,6 +104947,10 @@ interface IgTreeGridUpdating { [optionName: string]: any; } interface IgTreeGridUpdatingMethods { + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.igtreegridupdating#options:language) + * Note that this method is for rare scenarios, see [language](ui.igtreegridupdating#options:language) or [locale](ui.igtreegridupdating#options:locale) option setter + */ changeLocale(): void; /** @@ -90016,6 +105063,11 @@ interface IgTreeGridUpdatingMethods { * @param create Requests to create the editor if it has not been created yet. */ editorForCell(cell: string, create?: boolean): Object; + + /** + * Changes the the regional settings of widget element to the language specified in [options.regional](ui.iggridupdating#options:regional) + * Note that this method is for rare scenarios, use [regional](ui.iggridupdating#options:regional) option setter + */ changeRegional(): void; /** @@ -90058,12 +105110,14 @@ interface JQuery { /** * Gets whether to enable or disable adding children to rows. + * */ igTreeGridUpdating(optionLiteral: 'option', optionName: "enableAddChild"): boolean; /** * Sets whether to enable or disable adding children to rows. * + * * @optionValue New value to be set. */ igTreeGridUpdating(optionLiteral: 'option', optionName: "enableAddChild", optionValue: boolean): void; @@ -90098,20 +105152,35 @@ interface JQuery { igTreeGridUpdating(optionLiteral: 'option', optionName: "locale"): IgTreeGridUpdatingLocale; igTreeGridUpdating(optionLiteral: 'option', optionName: "locale", optionValue: IgTreeGridUpdatingLocale): void; + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + */ + igTreeGridUpdating(optionLiteral: 'option', optionName: "inherit"): boolean; + + /** + * This option is inherited from a parent widget and it's not applicable for the igTreeGrid. + * + * @optionValue New value to be set. + */ + igTreeGridUpdating(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + /** * A list of custom column options that specify editing and validation settings for a specific column. + * */ igTreeGridUpdating(optionLiteral: 'option', optionName: "columnSettings"): IgGridUpdatingColumnSetting[]; /** * A list of custom column options that specify editing and validation settings for a specific column. * + * * @optionValue New value to be set. */ igTreeGridUpdating(optionLiteral: 'option', optionName: "columnSettings", optionValue: IgGridUpdatingColumnSetting[]): void; /** * Gets the edit mode. + * */ igTreeGridUpdating(optionLiteral: 'option', optionName: "editMode"): string; @@ -90119,6 +105188,7 @@ interface JQuery { /** * Sets the edit mode. * + * * @optionValue New value to be set. */ @@ -90126,36 +105196,42 @@ interface JQuery { /** * Gets if deleting rows through the UI is enabled. + * */ igTreeGridUpdating(optionLiteral: 'option', optionName: "enableDeleteRow"): boolean; /** * Sets if deleting rows through the UI is enabled. * + * * @optionValue New value to be set. */ igTreeGridUpdating(optionLiteral: 'option', optionName: "enableDeleteRow", optionValue: boolean): void; /** * Gets if adding rows through the UI is enabled. When enabled an additional row is rendered at the bottom of the grid's header that works as a button. When the end-user clicks on it edit mode is initiated either through a dialog (when [editMode](ui.iggridupdating#options:editMode) is 'dialog') or mimicking the look and feel of 'row' [editMode](ui.iggridupdating#options:editMode) (when [editMode](ui.iggridupdating#options:editMode) is 'row' or 'cell'). + * */ igTreeGridUpdating(optionLiteral: 'option', optionName: "enableAddRow"): boolean; /** * Sets if adding rows through the UI is enabled. When enabled an additional row is rendered at the bottom of the grid's header that works as a button. When the end-user clicks on it edit mode is initiated either through a dialog (when [editMode](ui.iggridupdating#options:editMode) is 'dialog') or mimicking the look and feel of 'row' [editMode](ui.iggridupdating#options:editMode) (when [editMode](ui.iggridupdating#options:editMode) is 'row' or 'cell'). * + * * @optionValue New value to be set. */ igTreeGridUpdating(optionLiteral: 'option', optionName: "enableAddRow", optionValue: boolean): void; /** * Gets if the value of each editable column in the grid should be validated. The validation is done based on the rules of their corresponding editors. + * */ igTreeGridUpdating(optionLiteral: 'option', optionName: "validation"): boolean; /** * Sets if the value of each editable column in the grid should be validated. The validation is done based on the rules of their corresponding editors. * + * * @optionValue New value to be set. */ igTreeGridUpdating(optionLiteral: 'option', optionName: "validation", optionValue: boolean): void; @@ -90290,30 +105366,35 @@ interface JQuery { /** * Determines if the Done and Cancel buttons will be available as means to end edit mode for [editMode](ui.iggridupdating#options:editMode) 'row' and when adding a new row. + * */ igTreeGridUpdating(optionLiteral: 'option', optionName: "showDoneCancelButtons"): boolean; /** * Determines if the Done and Cancel buttons will be available as means to end edit mode for [editMode](ui.iggridupdating#options:editMode) 'row' and when adding a new row. * + * * @optionValue New value to be set. */ igTreeGridUpdating(optionLiteral: 'option', optionName: "showDoneCancelButtons", optionValue: boolean): void; /** * Gets if an exception should be thrown when the grid's data view changes while there are pending transactions in the data source. The data view changes when the data source performs a sorting, filtering, groupby or paging operation and the exception thrown will prevent the operation from succeeding. All pending transactions must be committed before a data view operation is able to complete. Committing transactions can be done manually through the grid's [commit](ui.iggrid#methods:commit) function or automatically by setting [autoCommit](ui.iggrid#options:autoCommit) to 'true'. + * */ igTreeGridUpdating(optionLiteral: 'option', optionName: "enableDataDirtyException"): boolean; /** * Sets if an exception should be thrown when the grid's data view changes while there are pending transactions in the data source. The data view changes when the data source performs a sorting, filtering, groupby or paging operation and the exception thrown will prevent the operation from succeeding. All pending transactions must be committed before a data view operation is able to complete. Committing transactions can be done manually through the grid's [commit](ui.iggrid#methods:commit) function or automatically by setting [autoCommit](ui.iggrid#options:autoCommit) to 'true'. * + * * @optionValue New value to be set. */ igTreeGridUpdating(optionLiteral: 'option', optionName: "enableDataDirtyException", optionValue: boolean): void; /** * Gets how end-users are able to start edit mode. Possible values: "click", "dblclick", "F2", "enter" and their combinations separated by coma or in array. The keyboard triggers have effect only if the grid cells can receive focus (the grid's [tabIndex](ui.iggrid#options:tabIndex) property should not have a negative value) or Selection is enabled. If "dblclick" is included, then "click" has no effect. + * */ igTreeGridUpdating(optionLiteral: 'option', optionName: "startEditTriggers"): string|Array; @@ -90321,6 +105402,7 @@ interface JQuery { /** * Sets how end-users are able to start edit mode. Possible values: "click", "dblclick", "F2", "enter" and their combinations separated by coma or in array. The keyboard triggers have effect only if the grid cells can receive focus (the grid's [tabIndex](ui.iggrid#options:tabIndex) property should not have a negative value) or Selection is enabled. If "dblclick" is included, then "click" has no effect. * + * * @optionValue New value to be set. */ @@ -90328,30 +105410,35 @@ interface JQuery { /** * Determines if pressing Enter to navigate away from the currently edited cell should move the focus horizontally or vertically (default). + * */ igTreeGridUpdating(optionLiteral: 'option', optionName: "horizontalMoveOnEnter"): boolean; /** * Determines if pressing Enter to navigate away from the currently edited cell should move the focus horizontally or vertically (default). * + * * @optionValue New value to be set. */ igTreeGridUpdating(optionLiteral: 'option', optionName: "horizontalMoveOnEnter", optionValue: boolean): void; /** * Enables excel navigation style. When turned on, the arrow keys can be used for changing the currently edited cell similar to how Tab and Enter behave. When disabled, the arrow keys control the cursor inside editors. + * */ igTreeGridUpdating(optionLiteral: 'option', optionName: "excelNavigationMode"): boolean; /** * Enables excel navigation style. When turned on, the arrow keys can be used for changing the currently edited cell similar to how Tab and Enter behave. When disabled, the arrow keys control the cursor inside editors. * + * * @optionValue New value to be set. */ igTreeGridUpdating(optionLiteral: 'option', optionName: "excelNavigationMode", optionValue: boolean): void; /** * Sets a custom function to be called when the AJAX request to the URL specified by the [updateUrl](ui.iggrid#options:updateUrl) property succeeds. The function will be called with arguments representing the data returned by the server. + * */ igTreeGridUpdating(optionLiteral: 'option', optionName: "saveChangesSuccessHandler"): Function|string; @@ -90359,6 +105446,7 @@ interface JQuery { /** * Sets a custom function to be called when the AJAX request to the URL specified by the [updateUrl](ui.iggrid#options:updateUrl) property succeeds. The function will be called with arguments representing the data returned by the server. * + * * @optionValue New value to be set. */ @@ -90366,6 +105454,7 @@ interface JQuery { /** * Sets a custom function to be called when the AJAX request to the URL specified by the [updateUrl](ui.iggrid#options:updateUrl) property fails. The function will be called with arguments representing the data returned by the server. + * */ igTreeGridUpdating(optionLiteral: 'option', optionName: "saveChangesErrorHandler"): Function|string; @@ -90373,6 +105462,7 @@ interface JQuery { /** * Sets a custom function to be called when the AJAX request to the URL specified by the [updateUrl](ui.iggrid#options:updateUrl) property fails. The function will be called with arguments representing the data returned by the server. * + * * @optionValue New value to be set. */ @@ -90380,6 +105470,7 @@ interface JQuery { /** * On touch-enabled devices specifies the swipe distance for the delete button to appear. + * */ igTreeGridUpdating(optionLiteral: 'option', optionName: "swipeDistance"): string|number; @@ -90387,6 +105478,7 @@ interface JQuery { /** * On touch-enabled devices specifies the swipe distance for the delete button to appear. * + * * @optionValue New value to be set. */ @@ -90394,51 +105486,45 @@ interface JQuery { /** * Controls if navigation will wrap around the grid. The feature will never wrap around virtual grids. + * */ igTreeGridUpdating(optionLiteral: 'option', optionName: "wrapAround"): boolean; /** * Controls if navigation will wrap around the grid. The feature will never wrap around virtual grids. * + * * @optionValue New value to be set. */ igTreeGridUpdating(optionLiteral: 'option', optionName: "wrapAround", optionValue: boolean): void; /** * A list of options controlling the rendering behavior of the row edit dialog. If [editMode](ui.iggridupdating#options:editMode) is not 'dialog' these have no effect. + * */ igTreeGridUpdating(optionLiteral: 'option', optionName: "rowEditDialogOptions"): IgGridUpdatingRowEditDialogOptions; /** * A list of options controlling the rendering behavior of the row edit dialog. If [editMode](ui.iggridupdating#options:editMode) is not 'dialog' these have no effect. * + * * @optionValue New value to be set. */ igTreeGridUpdating(optionLiteral: 'option', optionName: "rowEditDialogOptions", optionValue: IgGridUpdatingRowEditDialogOptions): void; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. For more information on how to utilize this property, please refer to the [Extending igGrid Modal Dialog](http://www.igniteui.com/help/extending-iggrid-modal-dialog) topic. + * */ igTreeGridUpdating(optionLiteral: 'option', optionName: "dialogWidget"): string; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. For more information on how to utilize this property, please refer to the [Extending igGrid Modal Dialog](http://www.igniteui.com/help/extending-iggrid-modal-dialog) topic. * - * @optionValue New value to be set. - */ - igTreeGridUpdating(optionLiteral: 'option', optionName: "dialogWidget", optionValue: string): void; - - /** - * Enables/disables feature inheritance for the child layouts in igHierarchicalGrid. - */ - igTreeGridUpdating(optionLiteral: 'option', optionName: "inherit"): boolean; - - /** - * Enables/disables feature inheritance for the child layouts in igHierarchicalGrid. * * @optionValue New value to be set. */ - igTreeGridUpdating(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + igTreeGridUpdating(optionLiteral: 'option', optionName: "dialogWidget", optionValue: string): void; /** * Event fired before row editing begins. @@ -90717,171 +105803,205 @@ interface JQuery { interface IgUploadLocale { /** * Get or set label for the first shown browse button. When file is selected for the first time this button is hidden. + * */ labelUploadButton?: string; /** * Get or set label for browse button in main container. + * */ labelAddButton?: string; /** * Get or set label for summary Clear all button. It will be shown only in multiple upload mode. + * */ labelClearAllButton?: string; /** * Get or set template for showing summary template. {0} is count of uploaded files. {1} is total count of file to be uploaded. + * */ labelSummaryTemplate?: string; /** * Get or set template for showing uploading information in summary progress bar. It will be shown only in multiple upload mode. {0} uploaded filesize. {1} - total file size. + * */ labelSummaryProgressBarTemplate?: string; /** * Get or set label for show/hide details button when main container is hidden. + * */ labelShowDetails?: string; /** * Get or set label for show/hide details button when main container is shown. + * */ labelHideDetails?: string; /** * Get or set label for button cancelling all files. Shown only in multiple upload mode. + * */ labelSummaryProgressButtonCancel?: string; /** * Get or set label for start upload batch files. Shown only in multiple upload mode and autostartupload is false. + * */ labelSummaryProgressButtonContinue?: string; /** * Get or set label when upload is finished. Shown only in multiple upload mode. + * */ labelSummaryProgressButtonDone?: string; /** * Get or set filename when it could not be shown the whole file name and should be shorten. + * */ labelProgressBarFileNameContinue?: string; /** * Get or set message shown when max file size of the uploaded file exceeds the limit. + * */ errorMessageFileSizeExceeded?: string; /** * Get or set error message when ajax call to get file status throws error. + * */ errorMessageGetFileStatus?: string; /** * Get or set error message when ajax call to send cancel upload command. + * */ errorMessageCancelUpload?: string; /** * Get or set error message when file is not found. + * */ errorMessageNoSuchFile?: string; /** * Get or set error message different from the other messages. + * */ errorMessageOther?: string; /** * Get or set error message when file extension validation failed. + * */ errorMessageValidatingFileExtension?: string; /** * Get or set error message when AJAX Request to get file size throws error. + * */ errorMessageAJAXRequestFileSize?: string; /** * Get or set error message when maximum allowed files exceeded. + * */ errorMessageMaxUploadedFiles?: string; /** * Get or set error message when maximum simultaneous files is less or equal to 0. + * */ errorMessageMaxSimultaneousFiles?: string; /** * Get or set error message when trying to remove non existing file. + * */ errorMessageTryToRemoveNonExistingFile?: string; /** * Get or set error message when trying to start non existing file. + * */ errorMessageTryToStartNonExistingFile?: string; /** * Get or set error message when trying to drop more than 1 file and mode is single. + * */ errorMessageDropMultipleFilesWhenSingleModel?: string; /** * Get or set title for the first shown browse button. When file is selected for the first time this button is hidden. + * */ titleUploadFileButtonInit?: string; /** * Get or set title for browse button in main container. + * */ titleAddFileButton?: string; /** * Get or set title for the cancel upload button. + * */ titleCancelUploadButton?: string; /** * Get or set title for start upload batch files. Shown only in multiple upload mode and autostartupload is false. + * */ titleSummaryProgressButtonContinue?: string; /** * Get or set title for summary Clear all button. It will be shown only in multiple upload mode. + * */ titleClearUploaded?: string; /** * Get or set title for show details button. + * */ titleShowDetailsButton?: string; /** * Get or set title for hide details button. + * */ titleHideDetailsButton?: string; /** * Get or set title for button cancelling all files. Shown only in multiple upload mode. + * */ titleSummaryProgressButtonCancel?: string; /** * Get or set title when upload is finished. Shown only in multiple upload mode. + * */ titleSummaryProgressButtonDone?: string; /** * Get or set title for Continue button. + * */ titleSingleUploadButtonContinue?: string; /** * Get or set title for summary Clear all button. It will be shown only in multiple upload mode. + * */ titleClearAllButton?: string; @@ -91181,16 +106301,19 @@ interface OnFormDataSubmitEventUIParam { interface IgUpload { /** * Get or set width of the main container of the file upload control. Main container contains all buttons, progressbar, etc. + * */ width?: number|string; /** * Get or set height of the main container of the file upload control. Main container contains all buttons, progressbar, etc. + * */ height?: number|string; /** * Get or set whether the file start upload automatically when it is selected. Default is false. + * */ autostartupload?: boolean; @@ -91358,66 +106481,79 @@ interface IgUpload { /** * Get or set URL for uploading. + * */ uploadUrl?: string; /** * Get or set URL of HTTPHandler to get information about file upload, current size and also to get commands + * */ progressUrl?: string; /** * Get or set file allowed file extensions. When this array is empty - it is not made such validation. Example ["gif", "jpg", "bmp"]. + * */ allowedExtensions?: any[]; /** * Get or set whether to show File Extension icon + * */ showFileExtensionIcon?: boolean; /** * Get or set control specific CSS options. For example you can override specific control classes with custom ones. + * */ css?: any; /** * Set icon css classes for specified file extension + * */ fileExtensionIcons?: IgUploadFileExtensionIcons; /** * Get or set multiple or single file upload. In single upload it is possible to upload only one file at the same time. + * */ mode?: any; /** * Get or set a bool setting that allows user to select(for upload) more than 1 file from the browse dialog at once. HTML 5+ - it is supported by Chrome, MOzilla FF, Safar, Opera latest versions and IE10+ + * */ multipleFiles?: boolean; /** * Get or set the maximum number of allowed files to upload. + * */ maxUploadedFiles?: number; /** * Get or set count of files that could be uploaded at the same time. + * */ maxSimultaneousFilesUploads?: number; /** * Get or set file size metrics how to be shown files size. + * */ fileSizeMetric?: any; /** * UniqueId of the control - should not be changed by developer. Set from server-side wrapper. + * */ controlId?: string; /** * The number of digits after the decimal point. + * */ fileSizeDecimalDisplay?: number; @@ -91426,6 +106562,24 @@ interface IgUpload { */ maxFileSize?: any; + /** + * Get or set whether to use only one request for sending data, when you are sending more than one file. + * + */ + useSingleRequest?: boolean; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Defines the name of the file upload selecting event. Fired when browse button is pressed. * Return false in order to cancel selecting file. @@ -91519,7 +106673,7 @@ interface IgUploadMethods { /** * Start uploading file as submitting form with the specified formNumber. * - * @param formNumber id of the upload form + * @param formNumber id of the upload form. If left undefined and useSingleRequest is true all pending files will be uploaded. */ startUpload(formNumber: number): void; @@ -91530,6 +106684,11 @@ interface IgUploadMethods { * @param formNumber id of the form which should be cancelled */ cancelUpload(formNumber: number): void; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.igupload#options:language) + * Note that this method is for rare scenarios, use [language](ui.igupload#options:language) or [locale](ui.igupload#options:locale) option setter + */ changeLocale(): void; /** @@ -91553,6 +106712,16 @@ interface IgUploadMethods { * @param fileIndex unique identifier of the file */ getFileInfo(fileIndex: number): Object; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igUpload"): IgUploadMethods; @@ -91597,9 +106766,12 @@ interface JQuery { igUpload(methodName: "getFileInfoData"): Object; igUpload(methodName: "cancelAll"): void; igUpload(methodName: "getFileInfo", fileIndex: number): Object; + igUpload(methodName: "changeGlobalLanguage"): void; + igUpload(methodName: "changeGlobalRegional"): void; /** * Get or set width of the main container of the file upload control. Main container contains all buttons, progressbar, etc. + * */ igUpload(optionLiteral: 'option', optionName: "width"): number|string; @@ -91607,6 +106779,7 @@ interface JQuery { /** * Get or set width of the main container of the file upload control. Main container contains all buttons, progressbar, etc. * + * * @optionValue New value to be set. */ @@ -91614,6 +106787,7 @@ interface JQuery { /** * Get or set height of the main container of the file upload control. Main container contains all buttons, progressbar, etc. + * */ igUpload(optionLiteral: 'option', optionName: "height"): number|string; @@ -91621,6 +106795,7 @@ interface JQuery { /** * Get or set height of the main container of the file upload control. Main container contains all buttons, progressbar, etc. * + * * @optionValue New value to be set. */ @@ -91628,12 +106803,14 @@ interface JQuery { /** * Get or set whether the file start upload automatically when it is selected. Default is false. + * */ igUpload(optionLiteral: 'option', optionName: "autostartupload"): boolean; /** * Get or set whether the file start upload automatically when it is selected. Default is false. * + * * @optionValue New value to be set. */ igUpload(optionLiteral: 'option', optionName: "autostartupload", optionValue: boolean): void; @@ -92010,156 +107187,182 @@ interface JQuery { /** * Get or set URL for uploading. + * */ igUpload(optionLiteral: 'option', optionName: "uploadUrl"): string; /** * Get or set URL for uploading. * + * * @optionValue New value to be set. */ igUpload(optionLiteral: 'option', optionName: "uploadUrl", optionValue: string): void; /** * Get or set URL of HTTPHandler to get information about file upload, current size and also to get commands + * */ igUpload(optionLiteral: 'option', optionName: "progressUrl"): string; /** * Get or set URL of HTTPHandler to get information about file upload, current size and also to get commands * + * * @optionValue New value to be set. */ igUpload(optionLiteral: 'option', optionName: "progressUrl", optionValue: string): void; /** * Get or set file allowed file extensions. When this array is empty - it is not made such validation. Example ["gif", "jpg", "bmp"]. + * */ igUpload(optionLiteral: 'option', optionName: "allowedExtensions"): any[]; /** * Get or set file allowed file extensions. When this array is empty - it is not made such validation. Example ["gif", "jpg", "bmp"]. * + * * @optionValue New value to be set. */ igUpload(optionLiteral: 'option', optionName: "allowedExtensions", optionValue: any[]): void; /** * Get or set whether to show File Extension icon + * */ igUpload(optionLiteral: 'option', optionName: "showFileExtensionIcon"): boolean; /** * Get or set whether to show File Extension icon * + * * @optionValue New value to be set. */ igUpload(optionLiteral: 'option', optionName: "showFileExtensionIcon", optionValue: boolean): void; /** * Get or set control specific CSS options. For example you can override specific control classes with custom ones. + * */ igUpload(optionLiteral: 'option', optionName: "css"): any; /** * Get or set control specific CSS options. For example you can override specific control classes with custom ones. * + * * @optionValue New value to be set. */ igUpload(optionLiteral: 'option', optionName: "css", optionValue: any): void; /** * Set icon css classes for specified file extension + * */ igUpload(optionLiteral: 'option', optionName: "fileExtensionIcons"): IgUploadFileExtensionIcons; /** * Set icon css classes for specified file extension * + * * @optionValue New value to be set. */ igUpload(optionLiteral: 'option', optionName: "fileExtensionIcons", optionValue: IgUploadFileExtensionIcons): void; /** * Get or set multiple or single file upload. In single upload it is possible to upload only one file at the same time. + * */ igUpload(optionLiteral: 'option', optionName: "mode"): any; /** * Get or set multiple or single file upload. In single upload it is possible to upload only one file at the same time. * + * * @optionValue New value to be set. */ igUpload(optionLiteral: 'option', optionName: "mode", optionValue: any): void; /** * Get or set a bool setting that allows user to select(for upload) more than 1 file from the browse dialog at once. HTML 5+ - it is supported by Chrome, MOzilla FF, Safar, Opera latest versions and IE10+ + * */ igUpload(optionLiteral: 'option', optionName: "multipleFiles"): boolean; /** * Get or set a bool setting that allows user to select(for upload) more than 1 file from the browse dialog at once. HTML 5+ - it is supported by Chrome, MOzilla FF, Safar, Opera latest versions and IE10+ * + * * @optionValue New value to be set. */ igUpload(optionLiteral: 'option', optionName: "multipleFiles", optionValue: boolean): void; /** * Get or set the maximum number of allowed files to upload. + * */ igUpload(optionLiteral: 'option', optionName: "maxUploadedFiles"): number; /** * Get or set the maximum number of allowed files to upload. * + * * @optionValue New value to be set. */ igUpload(optionLiteral: 'option', optionName: "maxUploadedFiles", optionValue: number): void; /** * Get or set count of files that could be uploaded at the same time. + * */ igUpload(optionLiteral: 'option', optionName: "maxSimultaneousFilesUploads"): number; /** * Get or set count of files that could be uploaded at the same time. * + * * @optionValue New value to be set. */ igUpload(optionLiteral: 'option', optionName: "maxSimultaneousFilesUploads", optionValue: number): void; /** * Get or set file size metrics how to be shown files size. + * */ igUpload(optionLiteral: 'option', optionName: "fileSizeMetric"): any; /** * Get or set file size metrics how to be shown files size. * + * * @optionValue New value to be set. */ igUpload(optionLiteral: 'option', optionName: "fileSizeMetric", optionValue: any): void; /** * UniqueId of the control - should not be changed by developer. Set from server-side wrapper. + * */ igUpload(optionLiteral: 'option', optionName: "controlId"): string; /** * UniqueId of the control - should not be changed by developer. Set from server-side wrapper. * + * * @optionValue New value to be set. */ igUpload(optionLiteral: 'option', optionName: "controlId", optionValue: string): void; /** * The number of digits after the decimal point. + * */ igUpload(optionLiteral: 'option', optionName: "fileSizeDecimalDisplay"): number; /** * The number of digits after the decimal point. * + * * @optionValue New value to be set. */ igUpload(optionLiteral: 'option', optionName: "fileSizeDecimalDisplay", optionValue: number): void; @@ -92176,6 +107379,50 @@ interface JQuery { */ igUpload(optionLiteral: 'option', optionName: "maxFileSize", optionValue: any): void; + /** + * Get or set whether to use only one request for sending data, when you are sending more than one file. + * + */ + igUpload(optionLiteral: 'option', optionName: "useSingleRequest"): boolean; + + /** + * Get or set whether to use only one request for sending data, when you are sending more than one file. + * + * + * @optionValue New value to be set. + */ + igUpload(optionLiteral: 'option', optionName: "useSingleRequest", optionValue: boolean): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igUpload(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igUpload(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igUpload(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igUpload(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Defines the name of the file upload selecting event. Fired when browse button is pressed. * Return false in order to cancel selecting file. @@ -92311,6 +107558,7 @@ interface IgValidatorField { /** * Gets the target element (input or control target) to be validated. This field setting is required. * + * * Valid values: * "string" A valid jQuery selector for the element * "object" A reference to a jQuery object @@ -92749,23 +107997,27 @@ interface IgValidator { * Gets/Sets whether validation is triggered when the text in editor changes. * Note that this is more appropriate for selection controls such as checkbox, combo or rating. * As it can cause excessive messages with text-based fields, the initial validation can be delayed via the [threshold](ui.igvalidator#options:threshold) option. + * */ onchange?: boolean; /** * Gets/Sets whether validation is triggered when the editor loses focus. + * */ onblur?: boolean; /** * Gets/Sets whether validation is triggered when a form containing validation targets is submitting. If any of the validations fail, the submit action will be prevented. * Note that this doesn't apply to the native JavaScript submit function, but will handle the jQuery equivalent and the browser default action. + * */ onsubmit?: boolean; /** * Gets/Sets option to validate if a value was entered (not empty text, selected item, etc.) * + * * Valid values: * "boolean" A boolean value indicating if the field is required. * "object" A configuration object with optional error message (e.g. required: { errorMessage: "Error!"} ) @@ -92775,6 +108027,7 @@ interface IgValidator { /** * Gets/Sets number validation rule options.Default separators for decimals and thousands are '.' and ',' respectively and are defined in the "$.ui.igValidator.defaults" object. * + * * Valid values: * "boolean" A boolean value indicating if the field should be a number. Default separators are used. * "object" A configuration object with errorMessage, decimalSeparator and thousandsSeparator. Those properties are all optional. @@ -92784,6 +108037,7 @@ interface IgValidator { /** * Gets/Sets date validation rule options. This can additionally help guide the [valueRange](ui.igvalidator#options:valueRange) validation.Note: Dependant on JavaScript Date parsing which will accept a wide range of values. * + * * Valid values: * "boolean" A boolean value indicating if the field should be a valid JavaScript Date or can be parsed as one. * "object" A configuration object with optional error message (e.g. date: { errorMessage: "Enter a valid number"} ) @@ -92793,6 +108047,7 @@ interface IgValidator { /** * Gets/Sets email validation rule options. Uses a RegExp defined in the "$.ui.igValidator.defaults" object. * + * * Valid values: * "boolean" A boolean value indicating if the field should be an email. * "object" A configuration object with optional error message (e.g. email: { errorMessage: "Enter a valid email"} ) @@ -92802,6 +108057,7 @@ interface IgValidator { /** * Gets/Sets a minimum and/or maximum length of text or number of selected items. Null or 0 values are ignored. * + * * Valid values: * "array" An array of two numbers, where the first value is the minimum and the second is the maximum. (e.g. lengthRange: [ 1, 10] ) * "object" A configuration object with optional error message. Message strings can contain format items for min and max respectively (e.g. lengthRange: { min: 6, max: 20, errorMessage: "Password must be at least {0} long and no more than {1}." } ) @@ -92811,6 +108067,7 @@ interface IgValidator { /** * Gets/Sets a minimum and/or maximum value. Null values are ignored. * + * * Valid values: * "array" An array of two numbers or dates, where the first is the minimum and the second is the maximum. (e.g. valueRange: [ 1, 10] ) * "object" A configuration object with optional error message. Message strings can contain format items for min and max respectively (e.g. lengthRange: { min: 6, max: 20, errorMessage: "Value must be between {0} and {1}." } ) @@ -92820,6 +108077,7 @@ interface IgValidator { /** * Gets/Sets Credit Card number validation rule options.Note: This rule will only validate the checksum of the number using Luhn algorithm irregardless of card type. * + * * Valid values: * "boolean" A boolean value indicating if the field should be a valid Credit Card number. * "object" A configuration object with optional error message (e.g. creditCard: { errorMessage: "Enter a valid card number"} ) @@ -92829,6 +108087,7 @@ interface IgValidator { /** * Gets/Sets regular expression validation rule options. * + * * Valid values: * "string" A string containing regular expression. * "object" A RegExp object or an object with expression and errorMessage properties. @@ -92838,33 +108097,39 @@ interface IgValidator { /** * Gets/Sets if all rules for a field should be checked, so even if one fails the rest will continue executing. * Note: This will not force checks on an empty field for rules that don't normally execute without a value. + * */ executeAllRules?: boolean; /** * Gets/Sets a custom jQuery element to be used for validation messages. That inner HTML of the target is modified, can be a SPAN, LABEL or DIV. + * */ messageTarget?: Element; /** * Gets/Sets text for an error message to be used if none is set for the particular rule. Overrides default rule-specific error messages. + * */ errorMessage?: string; /** * Gets/Sets text for a success message. Note that since there is no default, setting this message will enable showing success indication. + * */ successMessage?: string; /** * Gets/Sets validation minimum input length. Validation won't be triggered for input before that value is reached on change and focus loss. * Note: This will not affect required fields on form submit. + * */ threshold?: number; /** * Gets/Sets a requirement for the value in this field to be the same as another input element or editor control. * + * * Valid values: * "string" A valid jQuery selector for the target element * "object" A reference to the jQuery object for the target or an object with selector property and custom errorMessage. @@ -92874,6 +108139,7 @@ interface IgValidator { /** * Gets/Sets a custom function to perform validation. Use 'this' to reference the calling validator and the value and optional field settings arguments to determine and return the state of the field. * + * * Valid values: * "function" The function to call * "string" Function name, must be in global namespace (window["name"]) @@ -92884,26 +108150,48 @@ interface IgValidator { /** * Gets a list of target field items describing each with validation options and a required selector. Fields can contain any of the validation rules and triggers but not other fields or event handlers. * Applicable options are also inherited from the global control configuration if not set. + * */ fields?: IgValidatorField[]; /** * Gets/Sets the options for the [igNotifier](ui.ignotifier#options) used to show error messages. + * */ notificationOptions?: any; /** * Gets/Sets the option to show an asterisks indication next to required fields. * Note: Indicators are not supported on grouped controls such as checkbox or radio button sets and the igRating control. + * */ requiredIndication?: boolean; /** * Gets/Sets the option to show a label indication next to optional fields. * Note: Indicators are not supported on grouped controls such as checkbox or radio button sets and the igRating control. + * */ optionalIndication?: boolean; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event which is raised on validation before default validation logic is applied. * Return false in order to cancel the event and consider the field valid. @@ -93097,6 +108385,24 @@ interface IgValidatorMethods { * Destroys the validator widget. */ destroy(): void; + + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ + changeLocale($container: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igValidator"): IgValidatorMethods; @@ -93111,11 +108417,15 @@ class IgValidatorBaseRule { /** * Gets the error message type to get from locale settings (matching as "Message>"). Returns the rule name by default. * Only used when there's no errorMessage option available through getRuleMessage. + * + * @param options */ getMessageType(options: Object): string; /** * Gets an errorMessage from either the rule or field/global options. + * + * @param options */ getRuleMessage(options: Object): string; @@ -93162,6 +108472,8 @@ class IgValidatorRequiredRule { /** * Gets an errorMessage from either the rule or field/global options. + * + * @param options */ getRuleMessage(options: Object): string; @@ -93186,6 +108498,8 @@ class IgValidatorControlRule { /** * Returns an error message for the rule from options + * + * @param options */ getRuleMessage(options: Object): void; shouldRun(options: Object, value: Object): void; @@ -93213,11 +108527,15 @@ class IgValidatorNumberRule { /** * Gets the error message type to get from locale settings (matching as "Message>"). Returns the rule name by default. * Only used when there's no errorMessage option available through getRuleMessage. + * + * @param options */ getMessageType(options: Object): string; /** * Gets an errorMessage from either the rule or field/global options. + * + * @param options */ getRuleMessage(options: Object): string; @@ -93251,11 +108569,15 @@ class IgValidatorDateRule { /** * Gets the error message type to get from locale settings (matching as "Message>"). Returns the rule name by default. * Only used when there's no errorMessage option available through getRuleMessage. + * + * @param options */ getMessageType(options: Object): string; /** * Gets an errorMessage from either the rule or field/global options. + * + * @param options */ getRuleMessage(options: Object): string; @@ -93289,6 +108611,8 @@ class IgValidatorLengthRule { /** * Gets an errorMessage from either the rule or field/global options. + * + * @param options */ getRuleMessage(options: Object): string; @@ -93335,11 +108659,15 @@ class IgValidatorEqualToRule { /** * Gets the error message type to get from locale settings (matching as "Message>"). Returns the rule name by default. * Only used when there's no errorMessage option available through getRuleMessage. + * + * @param options */ getMessageType(options: Object): string; /** * Gets an errorMessage from either the rule or field/global options. + * + * @param options */ getRuleMessage(options: Object): string; @@ -93373,11 +108701,15 @@ class IgValidatorEmailRule { /** * Gets the error message type to get from locale settings (matching as "Message>"). Returns the rule name by default. * Only used when there's no errorMessage option available through getRuleMessage. + * + * @param options */ getMessageType(options: Object): string; /** * Gets an errorMessage from either the rule or field/global options. + * + * @param options */ getRuleMessage(options: Object): string; @@ -93411,11 +108743,15 @@ class IgValidatorPatternRule { /** * Gets the error message type to get from locale settings (matching as "Message>"). Returns the rule name by default. * Only used when there's no errorMessage option available through getRuleMessage. + * + * @param options */ getMessageType(options: Object): string; /** * Gets an errorMessage from either the rule or field/global options. + * + * @param options */ getRuleMessage(options: Object): string; @@ -93450,6 +108786,8 @@ class IgValidatorCustomRule { /** * Gets an errorMessage from either the rule or field/global options. + * + * @param options */ getRuleMessage(options: Object): string; @@ -93475,17 +108813,24 @@ class IgValidatorCreditCardRule { * Based on ASP.NET CreditCardAttribute check, * https://github.com/Microsoft/referencesource/blob/master/System.ComponentModel.DataAnnotations/DataAnnotations/CreditCardAttribute.cs * using Luhn algorithm https://en.wikipedia.org/wiki/Luhn_algorithm + * + * @param options + * @param value */ isValid(options: Object, value: Object): void; /** * Gets the error message type to get from locale settings (matching as "Message>"). Returns the rule name by default. * Only used when there's no errorMessage option available through getRuleMessage. + * + * @param options */ getMessageType(options: Object): string; /** * Gets an errorMessage from either the rule or field/global options. + * + * @param options */ getRuleMessage(options: Object): string; @@ -93520,11 +108865,15 @@ interface JQuery { igValidator(methodName: "removeField", field: Object): void; igValidator(methodName: "updateField", field: Object, fieldOptions?: Object): void; igValidator(methodName: "destroy"): void; + igValidator(methodName: "changeLocale", $container: Object): void; + igValidator(methodName: "changeGlobalLanguage"): void; + igValidator(methodName: "changeGlobalRegional"): void; /** * Gets/Sets whether validation is triggered when the text in editor changes. * Note that this is more appropriate for selection controls such as checkbox, combo or rating. * As it can cause excessive messages with text-based fields, the initial validation can be delayed via the [threshold](ui.igvalidator#options:threshold) option. + * */ igValidator(optionLiteral: 'option', optionName: "onchange"): boolean; @@ -93533,18 +108882,21 @@ interface JQuery { * Note that this is more appropriate for selection controls such as checkbox, combo or rating. * As it can cause excessive messages with text-based fields, the initial validation can be delayed via the [threshold](ui.igvalidator#options:threshold) option. * + * * @optionValue New value to be set. */ igValidator(optionLiteral: 'option', optionName: "onchange", optionValue: boolean): void; /** * Gets/Sets whether validation is triggered when the editor loses focus. + * */ igValidator(optionLiteral: 'option', optionName: "onblur"): boolean; /** * /Sets whether validation is triggered when the editor loses focus. * + * * @optionValue New value to be set. */ igValidator(optionLiteral: 'option', optionName: "onblur", optionValue: boolean): void; @@ -93552,6 +108904,7 @@ interface JQuery { /** * Gets/Sets whether validation is triggered when a form containing validation targets is submitting. If any of the validations fail, the submit action will be prevented. * Note that this doesn't apply to the native JavaScript submit function, but will handle the jQuery equivalent and the browser default action. + * */ igValidator(optionLiteral: 'option', optionName: "onsubmit"): boolean; @@ -93559,12 +108912,14 @@ interface JQuery { * /Sets whether validation is triggered when a form containing validation targets is submitting. If any of the validations fail, the submit action will be prevented. * Note that this doesn't apply to the native JavaScript submit function, but will handle the jQuery equivalent and the browser default action. * + * * @optionValue New value to be set. */ igValidator(optionLiteral: 'option', optionName: "onsubmit", optionValue: boolean): void; /** * Gets/Sets option to validate if a value was entered (not empty text, selected item, etc.) + * */ igValidator(optionLiteral: 'option', optionName: "required"): boolean|Object; @@ -93572,6 +108927,7 @@ interface JQuery { /** * /Sets option to validate if a value was entered (not empty text, selected item, etc.) * + * * @optionValue New value to be set. */ @@ -93579,6 +108935,7 @@ interface JQuery { /** * Gets/Sets number validation rule options.Default separators for decimals and thousands are '.' and ',' respectively and are defined in the "$.ui.igValidator.defaults" object. + * */ igValidator(optionLiteral: 'option', optionName: "number"): boolean|Object; @@ -93586,6 +108943,7 @@ interface JQuery { /** * /Sets number validation rule options.Default separators for decimals and thousands are '.' and ',' respectively and are defined in the "$.ui.igValidator.defaults" object. * + * * @optionValue New value to be set. */ @@ -93593,6 +108951,7 @@ interface JQuery { /** * Gets/Sets date validation rule options. This can additionally help guide the [valueRange](ui.igvalidator#options:valueRange) validation.Note: Dependant on JavaScript Date parsing which will accept a wide range of values. + * */ igValidator(optionLiteral: 'option', optionName: "date"): boolean|Object; @@ -93600,6 +108959,7 @@ interface JQuery { /** * /Sets date validation rule options. This can additionally help guide the [valueRange](ui.igvalidator#options:valueRange) validation.Note: Dependant on JavaScript Date parsing which will accept a wide range of values. * + * * @optionValue New value to be set. */ @@ -93607,6 +108967,7 @@ interface JQuery { /** * Gets/Sets email validation rule options. Uses a RegExp defined in the "$.ui.igValidator.defaults" object. + * */ igValidator(optionLiteral: 'option', optionName: "email"): boolean|Object; @@ -93614,6 +108975,7 @@ interface JQuery { /** * /Sets email validation rule options. Uses a RegExp defined in the "$.ui.igValidator.defaults" object. * + * * @optionValue New value to be set. */ @@ -93621,6 +108983,7 @@ interface JQuery { /** * Gets/Sets a minimum and/or maximum length of text or number of selected items. Null or 0 values are ignored. + * */ igValidator(optionLiteral: 'option', optionName: "lengthRange"): Array|Object; @@ -93628,6 +108991,7 @@ interface JQuery { /** * /Sets a minimum and/or maximum length of text or number of selected items. Null or 0 values are ignored. * + * * @optionValue New value to be set. */ @@ -93635,6 +108999,7 @@ interface JQuery { /** * Gets/Sets a minimum and/or maximum value. Null values are ignored. + * */ igValidator(optionLiteral: 'option', optionName: "valueRange"): Array|Object; @@ -93642,6 +109007,7 @@ interface JQuery { /** * /Sets a minimum and/or maximum value. Null values are ignored. * + * * @optionValue New value to be set. */ @@ -93649,6 +109015,7 @@ interface JQuery { /** * Gets/Sets Credit Card number validation rule options.Note: This rule will only validate the checksum of the number using Luhn algorithm irregardless of card type. + * */ igValidator(optionLiteral: 'option', optionName: "creditCard"): boolean|Object; @@ -93656,6 +109023,7 @@ interface JQuery { /** * /Sets Credit Card number validation rule options.Note: This rule will only validate the checksum of the number using Luhn algorithm irregardless of card type. * + * * @optionValue New value to be set. */ @@ -93663,6 +109031,7 @@ interface JQuery { /** * Gets/Sets regular expression validation rule options. + * */ igValidator(optionLiteral: 'option', optionName: "pattern"): string|Object; @@ -93670,6 +109039,7 @@ interface JQuery { /** * /Sets regular expression validation rule options. * + * * @optionValue New value to be set. */ @@ -93678,6 +109048,7 @@ interface JQuery { /** * Gets/Sets if all rules for a field should be checked, so even if one fails the rest will continue executing. * Note: This will not force checks on an empty field for rules that don't normally execute without a value. + * */ igValidator(optionLiteral: 'option', optionName: "executeAllRules"): boolean; @@ -93685,42 +109056,49 @@ interface JQuery { * /Sets if all rules for a field should be checked, so even if one fails the rest will continue executing. * Note: This will not force checks on an empty field for rules that don't normally execute without a value. * + * * @optionValue New value to be set. */ igValidator(optionLiteral: 'option', optionName: "executeAllRules", optionValue: boolean): void; /** * Gets/Sets a custom jQuery element to be used for validation messages. That inner HTML of the target is modified, can be a SPAN, LABEL or DIV. + * */ igValidator(optionLiteral: 'option', optionName: "messageTarget"): Element; /** * /Sets a custom jQuery element to be used for validation messages. That inner HTML of the target is modified, can be a SPAN, LABEL or DIV. * + * * @optionValue New value to be set. */ igValidator(optionLiteral: 'option', optionName: "messageTarget", optionValue: Element): void; /** * Gets/Sets text for an error message to be used if none is set for the particular rule. Overrides default rule-specific error messages. + * */ igValidator(optionLiteral: 'option', optionName: "errorMessage"): string; /** * /Sets text for an error message to be used if none is set for the particular rule. Overrides default rule-specific error messages. * + * * @optionValue New value to be set. */ igValidator(optionLiteral: 'option', optionName: "errorMessage", optionValue: string): void; /** * Gets/Sets text for a success message. Note that since there is no default, setting this message will enable showing success indication. + * */ igValidator(optionLiteral: 'option', optionName: "successMessage"): string; /** * /Sets text for a success message. Note that since there is no default, setting this message will enable showing success indication. * + * * @optionValue New value to be set. */ igValidator(optionLiteral: 'option', optionName: "successMessage", optionValue: string): void; @@ -93728,6 +109106,7 @@ interface JQuery { /** * Gets/Sets validation minimum input length. Validation won't be triggered for input before that value is reached on change and focus loss. * Note: This will not affect required fields on form submit. + * */ igValidator(optionLiteral: 'option', optionName: "threshold"): number; @@ -93735,12 +109114,14 @@ interface JQuery { * /Sets validation minimum input length. Validation won't be triggered for input before that value is reached on change and focus loss. * Note: This will not affect required fields on form submit. * + * * @optionValue New value to be set. */ igValidator(optionLiteral: 'option', optionName: "threshold", optionValue: number): void; /** * Gets/Sets a requirement for the value in this field to be the same as another input element or editor control. + * */ igValidator(optionLiteral: 'option', optionName: "equalTo"): string|Object; @@ -93748,6 +109129,7 @@ interface JQuery { /** * /Sets a requirement for the value in this field to be the same as another input element or editor control. * + * * @optionValue New value to be set. */ @@ -93755,6 +109137,7 @@ interface JQuery { /** * Gets/Sets a custom function to perform validation. Use 'this' to reference the calling validator and the value and optional field settings arguments to determine and return the state of the field. + * */ igValidator(optionLiteral: 'option', optionName: "custom"): Function|string|Object; @@ -93762,6 +109145,7 @@ interface JQuery { /** * /Sets a custom function to perform validation. Use 'this' to reference the calling validator and the value and optional field settings arguments to determine and return the state of the field. * + * * @optionValue New value to be set. */ @@ -93770,6 +109154,7 @@ interface JQuery { /** * Gets a list of target field items describing each with validation options and a required selector. Fields can contain any of the validation rules and triggers but not other fields or event handlers. * Applicable options are also inherited from the global control configuration if not set. + * */ igValidator(optionLiteral: 'option', optionName: "fields"): IgValidatorField[]; @@ -93777,18 +109162,21 @@ interface JQuery { * A list of target field items describing each with validation options and a required selector. Fields can contain any of the validation rules and triggers but not other fields or event handlers. * Applicable options are also inherited from the global control configuration if not set. * + * * @optionValue New value to be set. */ igValidator(optionLiteral: 'option', optionName: "fields", optionValue: IgValidatorField[]): void; /** * Gets/Sets the options for the [igNotifier](ui.ignotifier#options) used to show error messages. + * */ igValidator(optionLiteral: 'option', optionName: "notificationOptions"): any; /** * /Sets the options for the [igNotifier](ui.ignotifier#options) used to show error messages. * + * * @optionValue New value to be set. */ igValidator(optionLiteral: 'option', optionName: "notificationOptions", optionValue: any): void; @@ -93796,6 +109184,7 @@ interface JQuery { /** * Gets/Sets the option to show an asterisks indication next to required fields. * Note: Indicators are not supported on grouped controls such as checkbox or radio button and the igRating control. + * */ igValidator(optionLiteral: 'option', optionName: "requiredIndication"): boolean; @@ -93803,6 +109192,7 @@ interface JQuery { * /Sets the option to show an asterisks indication next to required fields. * Note: Indicators are not supported on grouped controls such as checkbox or radio button sets and the igRating control. * + * * @optionValue New value to be set. */ igValidator(optionLiteral: 'option', optionName: "requiredIndication", optionValue: boolean): void; @@ -93810,6 +109200,7 @@ interface JQuery { /** * Gets/Sets the option to show a label indication next to optional fields. * Note: Indicators are not supported on grouped controls such as checkbox or radio button and the igRating control. + * */ igValidator(optionLiteral: 'option', optionName: "optionalIndication"): boolean; @@ -93817,10 +109208,55 @@ interface JQuery { * /Sets the option to show a label indication next to optional fields. * Note: Indicators are not supported on grouped controls such as checkbox or radio button sets and the igRating control. * + * * @optionValue New value to be set. */ igValidator(optionLiteral: 'option', optionName: "optionalIndication", optionValue: boolean): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igValidator(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igValidator(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igValidator(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igValidator(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igValidator(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igValidator(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event which is raised on validation before default validation logic is applied. * Return false in order to cancel the event and consider the field valid. @@ -94093,16 +109529,19 @@ interface JQuery { interface IgVideoPlayerBookmark { /** * Gets/Sets where the bookmark will be positioned. Should be between 0 and movie duration in seconds. + * */ time?: number; /** * Gets/Sets bookmark title. It is shown as tooltip on hover. + * */ title?: string; /** * Gets/Sets whether the bookmark is disabled or not. + * */ disabled?: boolean; @@ -94115,36 +109554,43 @@ interface IgVideoPlayerBookmark { interface IgVideoPlayerRelatedVideo { /** * Gets/Sets the URL of the related video image. + * */ imageUrl?: string; /** * Gets/Sets the title of the video. + * */ title?: string; /** * Gets/Sets the width of the related video image. + * */ width?: number; /** * Gets/Sets the height of the related video image. + * */ height?: number; /** * Gets/Sets a link to a page that will play the related video. It will be opened in a new window. If there are sources also, the link property has a priority. + * */ link?: string; /** * Gets/Sets the sources of the related video. + * */ sources?: any[]; /** * Gets/Sets custom CSS class to be applied on the related video element. + * */ css?: string; @@ -94157,61 +109603,73 @@ interface IgVideoPlayerRelatedVideo { interface IgVideoPlayerBanner { /** * Gets/Sets the banner image url. + * */ imageUrl?: string; /** * Gets/Sets an array of numbers. Each number specifies on which second in the movie the banner will pop. + * */ times?: any[]; /** * Gets/Sets whether the user will be able to close the banner or not. + * */ closeBanner?: boolean; /** * Gets/Sets whether to apply animation effects when showing or hiding the banner. If set to true, the animation is played for banner.duration in milliseconds. + * */ animate?: boolean; /** * Gets/Sets whether the banner is visible or not. + * */ visible?: boolean; /** * Gets/Sets the banner animation duration. + * */ duration?: number; /** * Gets/Sets whether to automatically hide the banner. If set to true, the banner is hidden after [hidedelay](ui.igvideoplayer#options:banners.hidedelay) in milliseconds. + * */ autohide?: boolean; /** * Gets/Sets the banner autohide delay in milliseconds. It is taken into account only if the banner.autohide option is set to true. + * */ hidedelay?: number; /** * Gets/Sets the banner link that will open in new window. + * */ link?: string; /** * Gets/Sets the banner width + * */ width?: number|string; /** * Gets/Sets the banner height + * */ height?: number|string; /** * Gets/Sets the banner specific css class, that will be applied on the banner grid. + * */ css?: string; @@ -94224,21 +109682,25 @@ interface IgVideoPlayerBanner { interface IgVideoPlayerCommercialsLinkedCommercial { /** * Gets/Sets the sources of the linked commercial video. + * */ sources?: any[]; /** * Gets/Sets the second in the video at which the linked commercial should play. + * */ startTime?: number; /** * Gets/Sets the link to open on linked commercial click. + * */ link?: string; /** * Gets/Sets the tooltip for the linked commercial bookmark. + * */ title?: string; @@ -94251,21 +109713,25 @@ interface IgVideoPlayerCommercialsLinkedCommercial { interface IgVideoPlayerCommercialsEmbeddedCommercial { /** * Gets/Sets the start second of the embedded commercial. + * */ startTime?: number; /** * Gets/Sets the end second of the embedded commercial. + * */ endTime?: number; /** * Gets/Sets the sponsored link of the embedded commercial. + * */ link?: string; /** * Gets/Sets the tooltip for the bookmark of the embedded commercial. + * */ title?: string; @@ -94278,21 +109744,25 @@ interface IgVideoPlayerCommercialsEmbeddedCommercial { interface IgVideoPlayerCommercialsAdMessage { /** * Gets/Sets whether to apply an animation effect when showing or hiding the ad message. If set to true, the animation is played for [animationDuration](ui.igvideoplayer#options:commercials.adMessage.animationDuration) in milliseconds. + * */ animate?: boolean; /** * Gets/Sets the ad message auto hide of the commercial. + * */ autoHide?: boolean; /** * Gets/Sets the ad message hide delay. + * */ hideDelay?: number; /** * Gets/Sets the ad message animation duration of the commercial. + * */ animationDuration?: number; @@ -94305,26 +109775,31 @@ interface IgVideoPlayerCommercialsAdMessage { interface IgVideoPlayerCommercials { /** * Gets/Sets an array of linked commercial objects. A linked commercial is a separate video file that will be played in the specified position of the original movie clip by [startTime](ui.igvideoplayer#options:commercials.linkedCommercials.startTime). This feature is useful if you have frequently changing outside commercial sources. + * */ linkedCommercials?: IgVideoPlayerCommercialsLinkedCommercial[]; /** * Gets/Sets an array of embedded commercials objects. An embedded commercial is an ad that is contained in the original video file. It is suitable when you want to mark some sections of the video as commercials. + * */ embeddedCommercials?: IgVideoPlayerCommercialsEmbeddedCommercial[]; /** * Gets/Sets whether the commercials will play againg during the repetitive video plays. + * */ alwaysPlayCommercials?: boolean; /** * Gets/Sets whether to show commercial locations or not. + * */ showBookmarks?: boolean; /** * Customizes the ad message settings of the commercial. Ad message shows the duration of the commercial and pops up when the commercial starts playing. + * */ adMessage?: IgVideoPlayerCommercialsAdMessage; @@ -94337,96 +109812,115 @@ interface IgVideoPlayerCommercials { interface IgVideoPlayerLocale { /** * Gets/Sets live stream video title. + * */ liveStream?: boolean; /** * Gets/Sets live video title. + * */ live?: boolean; /** * Gets/Sets paused button title. + * */ paused?: boolean; /** * Gets/Sets playing button title. + * */ playing?: boolean; /** * Gets/Sets play button title. + * */ play?: boolean; /** * Gets/Sets volume button title. + * */ volume?: boolean; /** * Gets/Sets progress label long format. + * */ progressLabelLongFormat?: boolean; /** * Gets/Sets progress label short format. + * */ progressLabelShortFormat?: boolean; /** * Gets/Sets enter fullscreen button title. + * */ enterFullscreen?: boolean; /** * Gets/Sets exit fullscreen button title. + * */ exitFullscreen?: boolean; /** * Gets/Sets skip to button title. + * */ skipTo?: boolean; /** * Gets/Sets buffering label text. + * */ buffering?: boolean; /** * Gets/Sets ad message text. + * */ adMessage?: boolean; /** * Gets/Sets long ad message text. + * */ adMessageLong?: boolean; /** * Gets/Sets ad message text when no duration is specified. + * */ adMessageNoDuration?: boolean; /** * Gets/Sets new ad window title. + * */ adNewWindowTip?: boolean; /** * Gets/Sets related videos text. + * */ relatedVideos?: boolean; /** * Gets/Sets replay button text. + * */ replayButton?: boolean; /** * Gets/Sets replay button tooltip. + * */ replayTooltip?: boolean; @@ -94442,14 +109936,14 @@ interface EndedEvent { interface EndedEventUIParam { /** - * Used to get the url of the playing video. + * Get the video duration in seconds. */ - source?: any; + duration?: number; /** - * Used to get the video duration in seconds. + * Get the url of the playing video. */ - duration?: any; + source?: string; } interface PlayingEvent { @@ -94458,14 +109952,19 @@ interface PlayingEvent { interface PlayingEventUIParam { /** - * Used to get the url of the playing video. + * Get the current time in the video at which the event was fired. */ - source?: any; + currentTime?: number; /** - * Used to get the video duration in seconds. + * Get the video duration in seconds. */ - duration?: any; + duration?: number; + + /** + * Get the url of the playing video. + */ + source?: string; } interface PausedEvent { @@ -94474,14 +109973,19 @@ interface PausedEvent { interface PausedEventUIParam { /** - * Used to get the url of the playing video. + * Get the current time in the video at which the event was fired. */ - source?: any; + currentTime?: number; /** - * Used to get the video duration in seconds. + * Get the video duration in seconds. */ - duration?: any; + duration?: number; + + /** + * Get the url of the playing video. + */ + source?: string; } interface BufferingEvent { @@ -94490,14 +109994,14 @@ interface BufferingEvent { interface BufferingEventUIParam { /** - * Used to get the url of the playing video. + * Get buffered percentage. */ - source?: any; + buffered?: number; /** - * Used to get buffered percentage. + * Get the url of the playing video. */ - buffered?: any; + source?: string; } interface ProgressEvent { @@ -94506,19 +110010,19 @@ interface ProgressEvent { interface ProgressEventUIParam { /** - * Used to get the url of the playing video. + * Get the current time in the video at which the event was fired. */ - source?: any; + currentTime?: number; /** - * Used to get current position in the video at which the event was fired. + * Get the video duration in seconds. */ - currentTime?: any; + duration?: number; /** - * Used to get the video duration in seconds. + * Get the url of the playing video. */ - duration?: any; + source?: string; } interface WaitingEvent { @@ -94527,19 +110031,19 @@ interface WaitingEvent { interface WaitingEventUIParam { /** - * Used to get the url of the playing video. + * Get the current time in the video at which the event was fired. */ - source?: any; + currentTime?: number; /** - * Used to get current position in the video at which the event was fired. + * Get the video duration in seconds. */ - currentTime?: any; + duration?: number; /** - * Used to get the video duration in seconds. + * Get the url of the playing video. */ - duration?: any; + source?: string; } interface EnterFullScreenEvent { @@ -94548,9 +110052,9 @@ interface EnterFullScreenEvent { interface EnterFullScreenEventUIParam { /** - * Used to get the url of the playing video. + * Get the url of the playing video. */ - source?: any; + source?: string; } interface ExitFullScreenEvent { @@ -94559,9 +110063,9 @@ interface ExitFullScreenEvent { interface ExitFullScreenEventUIParam { /** - * Used to get the url of the playing video. + * Get the url of the playing video. */ - source?: any; + source?: string; } interface RelatedVideoClickEvent { @@ -94570,12 +110074,12 @@ interface RelatedVideoClickEvent { interface RelatedVideoClickEventUIParam { /** - * Used to get the relatedVideo object from the relatedVideos array. + * Get the relatedVideo object from the relatedVideos array. */ relatedVideo?: any; /** - * Used to get the relatedVideo html element in the DOM. + * Get the relatedVideo html element in the DOM. */ relatedVideoElement?: any; } @@ -94586,19 +110090,19 @@ interface BannerVisibleEvent { interface BannerVisibleEventUIParam { /** - * Used to get the banner index in the banners array. - */ - index?: any; - - /** - * Used to get the banner object from the banners array. + * Get the banner object from the banners array. */ banner?: any; /** - * Used to get the banner html element in the DOM. + * Get the banner html element in the DOM. */ bannerElement?: any; + + /** + * Get the banner index in the banners array. + */ + index?: number; } interface BannerHiddenEvent { @@ -94607,19 +110111,19 @@ interface BannerHiddenEvent { interface BannerHiddenEventUIParam { /** - * Used to get the banner index in the banners array. - */ - index?: any; - - /** - * Used to get the banner object from the banners array. + * Get the banner object from the banners array. */ banner?: any; /** - * Used to get the banner html element in the DOM. + * Get the banner html element in the DOM. */ bannerElement?: any; + + /** + * Get the banner index in the banners array. + */ + index?: number; } interface BannerClickEvent { @@ -94628,7 +110132,7 @@ interface BannerClickEvent { interface BannerClickEventUIParam { /** - * Used to get the banner html element in the DOM. + * Get the banner html element in the DOM. */ bannerElement?: any; } @@ -94636,116 +110140,147 @@ interface BannerClickEventUIParam { interface IgVideoPlayer { /** * Gets/Sets a list of video sources to choose from. Best coded/format is automatically detected by the control. Supported types are depending on the browser and could be one of the following mov, mp4, webm, ogg. + * */ sources?: any[]; /** * Gets/Sets the width of the control. By default null will stretch the control to fit data, if no other widths are defined. + * */ width?: string|number; /** * Gets/Sets the height of the control. By default null will stretch the control to fit data, if no other heights are defined. + * */ height?: string|number; /** * Gets/Sets a URL to an image to show, when no video data is available. + * */ posterUrl?: string; /** * Gets/Sets whether to preload load initial data for duration of video. If true it may start buffering the video, but this highly depends on the specific browser implementation. + * */ preload?: boolean; /** * Gets/Sets whether the video should start playing immediately after the control is loaded. + * */ autoplay?: boolean; /** * Gets/Sets whether player controls will auto hide when video is not hovered. This is applicable only when Infragistics playback controls are used. + * */ autohide?: boolean; /** * Gets/Sets volume slider auto hide delay. This is applicable only when Infragistics playback controls are used. + * */ volumeAutohideDelay?: number; /** * Gets/Sets the center big button hide delay. + * */ centerButtonHideDelay?: number; /** * Gets/Sets whether the video to start again after it has ended. + * */ loop?: boolean; /** * Gets/Sets whether if you want to use the built in browser controls. By default player uses Infragistics playback controls. Note that you may have different look and feel across different browsers if you use the built in browser controls. When this option is set to true, no [commercials](ui.igvideoplayer#options:commercials) will be displayed as they are not supported. + * */ browserControls?: boolean; /** * Gets/Sets whether the video player to be in full screen or not. This is not a pure full screen, because browsers do not allow that. It just sets 100% width and height to the control. + * */ fullscreen?: boolean; /** * Gets/Sets the video volume. It can be between 0.0 and 1.0. + * */ volume?: number; /** * Gets/Sets whether the video volume is muted. + * */ muted?: boolean; /** * Gets/Sets video title. + * */ title?: string; /** * Gets/Sets whether the control seek tool tip will be shown when hovering the video progress bar. + * */ showSeekTime?: boolean; /** * Gets/Sets the format of the video progress label. You should use ${currentTime} to represent current playback position and ${duration} to represent video duration. + * */ progressLabelFormat?: string; /** * Gets/Sets an array of bookmarks that will be displayed in the video player control. + * */ bookmarks?: IgVideoPlayerBookmark[]; /** * Gets/Sets an array of related videos that will be displayed when video playback has ended. + * */ relatedVideos?: IgVideoPlayerRelatedVideo[]; /** * Gets/Sets an array of banner objects that will show the banners when the video clip is played. + * */ banners?: IgVideoPlayerBanner[]; /** * Gets/Sets an array of commercials objects that will be displayed when the video is playing. Note that [broswerControls](ui.igvideoplayer#options:browserControls) doesn't support commercials. + * */ commercials?: IgVideoPlayerCommercials; locale?: IgVideoPlayerLocale; /** - * Occurs when video has ended. + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + + /** + * Occurs when the video has ended. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. - * Use ui.duration to get the video duration in seconds. */ ended?: EndedEvent; @@ -94753,17 +110288,13 @@ interface IgVideoPlayer { * Occurs when video gets playing. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. - * Use ui.duration to get the video duration in seconds. */ playing?: PlayingEvent; /** - * Occurs when video is paused. + * Occurs when the video is paused. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. - * Use ui.duration to get the video duration in seconds. */ paused?: PausedEvent; @@ -94771,18 +110302,13 @@ interface IgVideoPlayer { * Occurs when a chunk of data is buffered. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. - * Use ui.buffered to get buffered percentage. */ buffering?: BufferingEvent; /** - * Occurs when video has advanced the playback position. + * Occurs when the video has advanced the playback position. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. - * Use ui.currentTime to get current position in the video at which the event was fired. - * Use ui.duration to get the video duration in seconds. */ progress?: ProgressEvent; @@ -94790,28 +110316,20 @@ interface IgVideoPlayer { * Occurs when igVideoPlayer is waiting for data from the server. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. - * Use ui.currentTime to get current position in the video at which the event was fired. - * Use ui.duration to get the video duration in seconds. */ waiting?: WaitingEvent; /** - * Occurs when the bookmark is hit. + * Occurs when a bookmark is hit. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. - * Use ui.bookmark to get the bookmark object from the bookmarks array. - * Use ui.bookmarkElement to get the html element in the DOM. */ bookmarkHit?: BookmarkHitEvent; /** - * Occurs when the bookmark is clicked. + * Occurs when a bookmark is clicked. * * Function takes arguments evt and ui. - * Use ui.bookmark to get the bookmark object from the bookmarks array. - * Use ui.bookmarkElement to get the html element in the DOM. */ bookmarkClick?: BookmarkClickEvent; @@ -94819,7 +110337,6 @@ interface IgVideoPlayer { * Occurs when igVideoPlayer enters full screen mode. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. */ enterFullScreen?: EnterFullScreenEvent; @@ -94827,16 +110344,13 @@ interface IgVideoPlayer { * Occurs when igVideoPlayer exits full screen mode. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. */ exitFullScreen?: ExitFullScreenEvent; /** - * Occurs when related video is clicked. + * Occurs when a related video is clicked. * * Function takes arguments evt and ui. - * Use ui.relatedVideo to get the relatedVideo object from the relatedVideos array. - * Use ui.relatedVideoElement to get the relatedVideo html element in the DOM. */ relatedVideoClick?: RelatedVideoClickEvent; @@ -94844,9 +110358,6 @@ interface IgVideoPlayer { * Defines the name of the player banner visible event. Fired when the banner has been displayed. * * Function takes arguments evt and ui. - * Use ui.index to get the banner index in the banners array. - * Use ui.banner to get the banner object from the banners array. - * Use ui.bannerElement to get the banner html element in the DOM. */ bannerVisible?: BannerVisibleEvent; @@ -94854,9 +110365,6 @@ interface IgVideoPlayer { * Occurs when the banner is hidden. * * Function takes arguments evt and ui. - * Use ui.index to get the banner index in the banners array. - * Use ui.banner to get the banner object from the banners array. - * Use ui.bannerElement to get the banner html element in the DOM. */ bannerHidden?: BannerHiddenEvent; @@ -94864,7 +110372,6 @@ interface IgVideoPlayer { * Occurs when the banner is clicked. * * Function takes arguments evt and ui. - * Use ui.bannerElement to get the banner html element in the DOM. */ bannerClick?: BannerClickEvent; @@ -94914,6 +110421,11 @@ interface IgVideoPlayerMethods { * Resets the commercials, to be shown again. */ resetCommercialsShow(): void; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.igvideoplayer#options:language) + * Note that this method is for rare scenarios, use [language](ui.igvideoplayer#options:language) or [locale](ui.igvideoplayer#options:locale) option setter + */ changeLocale(): void; /** @@ -94989,6 +110501,16 @@ interface IgVideoPlayerMethods { * Destroys the widget. */ destroy(): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igVideoPlayer"): IgVideoPlayerMethods; @@ -95016,21 +110538,26 @@ interface JQuery { igVideoPlayer(methodName: "duration"): number; igVideoPlayer(methodName: "seeking"): boolean; igVideoPlayer(methodName: "destroy"): void; + igVideoPlayer(methodName: "changeGlobalLanguage"): void; + igVideoPlayer(methodName: "changeGlobalRegional"): void; /** * Gets/Sets a list of video sources to choose from. Best coded/format is automatically detected by the control. Supported types are depending on the browser and could be one of the following mov, mp4, webm, ogg. + * */ igVideoPlayer(optionLiteral: 'option', optionName: "sources"): any[]; /** * /Sets a list of video sources to choose from. Best coded/format is automatically detected by the control. Supported types are depending on the browser and could be one of the following mov, mp4, webm, ogg. * + * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "sources", optionValue: any[]): void; /** * Gets/Sets the width of the control. By default null will stretch the control to fit data, if no other widths are defined. + * */ igVideoPlayer(optionLiteral: 'option', optionName: "width"): string|number; @@ -95038,6 +110565,7 @@ interface JQuery { /** * /Sets the width of the control. By default null will stretch the control to fit data, if no other widths are defined. * + * * @optionValue New value to be set. */ @@ -95045,6 +110573,7 @@ interface JQuery { /** * Gets/Sets the height of the control. By default null will stretch the control to fit data, if no other heights are defined. + * */ igVideoPlayer(optionLiteral: 'option', optionName: "height"): string|number; @@ -95052,6 +110581,7 @@ interface JQuery { /** * /Sets the height of the control. By default null will stretch the control to fit data, if no other heights are defined. * + * * @optionValue New value to be set. */ @@ -95059,216 +110589,252 @@ interface JQuery { /** * Gets/Sets a URL to an image to show, when no video data is available. + * */ igVideoPlayer(optionLiteral: 'option', optionName: "posterUrl"): string; /** * /Sets a URL to an image to show, when no video data is available. * + * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "posterUrl", optionValue: string): void; /** * Gets/Sets whether to preload load initial data for duration of video. If true it may start buffering the video, but this highly depends on the specific browser implementation. + * */ igVideoPlayer(optionLiteral: 'option', optionName: "preload"): boolean; /** * /Sets whether to preload load initial data for duration of video. If true it may start buffering the video, but this highly depends on the specific browser implementation. * + * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "preload", optionValue: boolean): void; /** * Gets/Sets whether the video should start playing immediately after the control is loaded. + * */ igVideoPlayer(optionLiteral: 'option', optionName: "autoplay"): boolean; /** * /Sets whether the video should start playing immediately after the control is loaded. * + * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "autoplay", optionValue: boolean): void; /** * Gets/Sets whether player controls will auto hide when video is not hovered. This is applicable only when Infragistics playback controls are used. + * */ igVideoPlayer(optionLiteral: 'option', optionName: "autohide"): boolean; /** * /Sets whether player controls will auto hide when video is not hovered. This is applicable only when Infragistics playback controls are used. * + * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "autohide", optionValue: boolean): void; /** * Gets/Sets volume slider auto hide delay. This is applicable only when Infragistics playback controls are used. + * */ igVideoPlayer(optionLiteral: 'option', optionName: "volumeAutohideDelay"): number; /** * /Sets volume slider auto hide delay. This is applicable only when Infragistics playback controls are used. * + * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "volumeAutohideDelay", optionValue: number): void; /** * Gets/Sets the center big button hide delay. + * */ igVideoPlayer(optionLiteral: 'option', optionName: "centerButtonHideDelay"): number; /** * /Sets the center big button hide delay. * + * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "centerButtonHideDelay", optionValue: number): void; /** * Gets/Sets whether the video to start again after it has ended. + * */ igVideoPlayer(optionLiteral: 'option', optionName: "loop"): boolean; /** * /Sets whether the video to start again after it has ended. * + * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "loop", optionValue: boolean): void; /** * Gets/Sets whether if you want to use the built in browser controls. By default player uses Infragistics playback controls. Note that you may have different look and feel across different browsers if you use the built in browser controls. When this option is set to true, no [commercials](ui.igvideoplayer#options:commercials) will be displayed as they are not supported. + * */ igVideoPlayer(optionLiteral: 'option', optionName: "browserControls"): boolean; /** * /Sets whether if you want to use the built in browser controls. By default player uses Infragistics playback controls. Note that you may have different look and feel across different browsers if you use the built in browser controls. When this option is set to true, no [commercials](ui.igvideoplayer#options:commercials) will be displayed as they are not supported. * + * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "browserControls", optionValue: boolean): void; /** * Gets/Sets whether the video player to be in full screen or not. This is not a pure full screen, because browsers do not allow that. It just 100% width and height to the control. + * */ igVideoPlayer(optionLiteral: 'option', optionName: "fullscreen"): boolean; /** * /Sets whether the video player to be in full screen or not. This is not a pure full screen, because browsers do not allow that. It just sets 100% width and height to the control. * + * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "fullscreen", optionValue: boolean): void; /** * Gets/Sets the video volume. It can be between 0.0 and 1.0. + * */ igVideoPlayer(optionLiteral: 'option', optionName: "volume"): number; /** * /Sets the video volume. It can be between 0.0 and 1.0. * + * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "volume", optionValue: number): void; /** * Gets/Sets whether the video volume is muted. + * */ igVideoPlayer(optionLiteral: 'option', optionName: "muted"): boolean; /** * /Sets whether the video volume is muted. * + * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "muted", optionValue: boolean): void; /** * Gets/Sets video title. + * */ igVideoPlayer(optionLiteral: 'option', optionName: "title"): string; /** * /Sets video title. * + * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "title", optionValue: string): void; /** * Gets/Sets whether the control seek tool tip will be shown when hovering the video progress bar. + * */ igVideoPlayer(optionLiteral: 'option', optionName: "showSeekTime"): boolean; /** * /Sets whether the control seek tool tip will be shown when hovering the video progress bar. * + * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "showSeekTime", optionValue: boolean): void; /** * Gets/Sets the format of the video progress label. You should use ${currentTime} to represent current playback position and ${duration} to represent video duration. + * */ igVideoPlayer(optionLiteral: 'option', optionName: "progressLabelFormat"): string; /** * /Sets the format of the video progress label. You should use ${currentTime} to represent current playback position and ${duration} to represent video duration. * + * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "progressLabelFormat", optionValue: string): void; /** * Gets/Sets an array of bookmarks that will be displayed in the video player control. + * */ igVideoPlayer(optionLiteral: 'option', optionName: "bookmarks"): IgVideoPlayerBookmark[]; /** * /Sets an array of bookmarks that will be displayed in the video player control. * + * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "bookmarks", optionValue: IgVideoPlayerBookmark[]): void; /** * Gets/Sets an array of related videos that will be displayed when video playback has ended. + * */ igVideoPlayer(optionLiteral: 'option', optionName: "relatedVideos"): IgVideoPlayerRelatedVideo[]; /** * /Sets an array of related videos that will be displayed when video playback has ended. * + * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "relatedVideos", optionValue: IgVideoPlayerRelatedVideo[]): void; /** * Gets/Sets an array of banner objects that will show the banners when the video clip is played. + * */ igVideoPlayer(optionLiteral: 'option', optionName: "banners"): IgVideoPlayerBanner[]; /** * /Sets an array of banner objects that will show the banners when the video clip is played. * + * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "banners", optionValue: IgVideoPlayerBanner[]): void; /** * Gets/Sets an array of commercials objects that will be displayed when the video is playing. Note that [broswerControls](ui.igvideoplayer#options:browserControls) doesn't support commercials. + * */ igVideoPlayer(optionLiteral: 'option', optionName: "commercials"): IgVideoPlayerCommercials; /** * /Sets an array of commercials objects that will be displayed when the video is playing. Note that [broswerControls](ui.igvideoplayer#options:browserControls) doesn't support commercials. * + * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "commercials", optionValue: IgVideoPlayerCommercials): void; @@ -95276,20 +110842,46 @@ interface JQuery { igVideoPlayer(optionLiteral: 'option', optionName: "locale", optionValue: IgVideoPlayerLocale): void; /** - * Occurs when video has ended. + * Set/Get the locale language setting for the widget. + * + */ + igVideoPlayer(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igVideoPlayer(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igVideoPlayer(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igVideoPlayer(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + + /** + * Occurs when the video has ended. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. - * Use ui.duration to get the video duration in seconds. */ igVideoPlayer(optionLiteral: 'option', optionName: "ended"): EndedEvent; /** - * Occurs when video has ended. + * Occurs when the video has ended. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. - * Use ui.duration to get the video duration in seconds. * * @optionValue New value to be set. */ @@ -95299,8 +110891,6 @@ interface JQuery { * Occurs when video gets playing. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. - * Use ui.duration to get the video duration in seconds. */ igVideoPlayer(optionLiteral: 'option', optionName: "playing"): PlayingEvent; @@ -95308,28 +110898,22 @@ interface JQuery { * Occurs when video gets playing. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. - * Use ui.duration to get the video duration in seconds. * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "playing", optionValue: PlayingEvent): void; /** - * Occurs when video is paused. + * Occurs when the video is paused. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. - * Use ui.duration to get the video duration in seconds. */ igVideoPlayer(optionLiteral: 'option', optionName: "paused"): PausedEvent; /** - * Occurs when video is paused. + * Occurs when the video is paused. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. - * Use ui.duration to get the video duration in seconds. * * @optionValue New value to be set. */ @@ -95339,8 +110923,6 @@ interface JQuery { * Occurs when a chunk of data is buffered. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. - * Use ui.buffered to get buffered percentage. */ igVideoPlayer(optionLiteral: 'option', optionName: "buffering"): BufferingEvent; @@ -95348,30 +110930,22 @@ interface JQuery { * Occurs when a chunk of data is buffered. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. - * Use ui.buffered to get buffered percentage. * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "buffering", optionValue: BufferingEvent): void; /** - * Occurs when video has advanced the playback position. + * Occurs when the video has advanced the playback position. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. - * Use ui.currentTime to get current position in the video at which the event was fired. - * Use ui.duration to get the video duration in seconds. */ igVideoPlayer(optionLiteral: 'option', optionName: "progress"): ProgressEvent; /** - * Occurs when video has advanced the playback position. + * Occurs when the video has advanced the playback position. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. - * Use ui.currentTime to get current position in the video at which the event was fired. - * Use ui.duration to get the video duration in seconds. * * @optionValue New value to be set. */ @@ -95381,9 +110955,6 @@ interface JQuery { * Occurs when igVideoPlayer is waiting for data from the server. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. - * Use ui.currentTime to get current position in the video at which the event was fired. - * Use ui.duration to get the video duration in seconds. */ igVideoPlayer(optionLiteral: 'option', optionName: "waiting"): WaitingEvent; @@ -95391,51 +110962,38 @@ interface JQuery { * Occurs when igVideoPlayer is waiting for data from the server. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. - * Use ui.currentTime to get current position in the video at which the event was fired. - * Use ui.duration to get the video duration in seconds. * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "waiting", optionValue: WaitingEvent): void; /** - * Occurs when the bookmark is hit. + * Occurs when a bookmark is hit. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. - * Use ui.bookmark to get the bookmark object from the bookmarks array. - * Use ui.bookmarkElement to get the html element in the DOM. */ igVideoPlayer(optionLiteral: 'option', optionName: "bookmarkHit"): BookmarkHitEvent; /** - * Occurs when the bookmark is hit. + * Occurs when a bookmark is hit. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. - * Use ui.bookmark to get the bookmark object from the bookmarks array. - * Use ui.bookmarkElement to get the html element in the DOM. * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "bookmarkHit", optionValue: BookmarkHitEvent): void; /** - * Occurs when the bookmark is clicked. + * Occurs when a bookmark is clicked. * * Function takes arguments evt and ui. - * Use ui.bookmark to get the bookmark object from the bookmarks array. - * Use ui.bookmarkElement to get the html element in the DOM. */ igVideoPlayer(optionLiteral: 'option', optionName: "bookmarkClick"): BookmarkClickEvent; /** - * Occurs when the bookmark is clicked. + * Occurs when a bookmark is clicked. * * Function takes arguments evt and ui. - * Use ui.bookmark to get the bookmark object from the bookmarks array. - * Use ui.bookmarkElement to get the html element in the DOM. * * @optionValue New value to be set. */ @@ -95445,7 +111003,6 @@ interface JQuery { * Occurs when igVideoPlayer enters full screen mode. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. */ igVideoPlayer(optionLiteral: 'option', optionName: "enterFullScreen"): EnterFullScreenEvent; @@ -95453,7 +111010,6 @@ interface JQuery { * Occurs when igVideoPlayer enters full screen mode. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. * * @optionValue New value to be set. */ @@ -95463,7 +111019,6 @@ interface JQuery { * Occurs when igVideoPlayer exits full screen mode. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. */ igVideoPlayer(optionLiteral: 'option', optionName: "exitFullScreen"): ExitFullScreenEvent; @@ -95471,27 +111026,22 @@ interface JQuery { * Occurs when igVideoPlayer exits full screen mode. * * Function takes arguments evt and ui. - * Use ui.source to get the url of the playing video. * * @optionValue New value to be set. */ igVideoPlayer(optionLiteral: 'option', optionName: "exitFullScreen", optionValue: ExitFullScreenEvent): void; /** - * Occurs when related video is clicked. + * Occurs when a related video is clicked. * * Function takes arguments evt and ui. - * Use ui.relatedVideo to get the relatedVideo object from the relatedVideos array. - * Use ui.relatedVideoElement to get the relatedVideo html element in the DOM. */ igVideoPlayer(optionLiteral: 'option', optionName: "relatedVideoClick"): RelatedVideoClickEvent; /** - * Occurs when related video is clicked. + * Occurs when a related video is clicked. * * Function takes arguments evt and ui. - * Use ui.relatedVideo to get the relatedVideo object from the relatedVideos array. - * Use ui.relatedVideoElement to get the relatedVideo html element in the DOM. * * @optionValue New value to be set. */ @@ -95501,9 +111051,6 @@ interface JQuery { * Defines the name of the player banner visible event. Fired when the banner has been displayed. * * Function takes arguments evt and ui. - * Use ui.index to get the banner index in the banners array. - * Use ui.banner to get the banner object from the banners array. - * Use ui.bannerElement to get the banner html element in the DOM. */ igVideoPlayer(optionLiteral: 'option', optionName: "bannerVisible"): BannerVisibleEvent; @@ -95511,9 +111058,6 @@ interface JQuery { * Defines the name of the player banner visible event. Fired when the banner has been displayed. * * Function takes arguments evt and ui. - * Use ui.index to get the banner index in the banners array. - * Use ui.banner to get the banner object from the banners array. - * Use ui.bannerElement to get the banner html element in the DOM. * * @optionValue New value to be set. */ @@ -95523,9 +111067,6 @@ interface JQuery { * Occurs when the banner is hidden. * * Function takes arguments evt and ui. - * Use ui.index to get the banner index in the banners array. - * Use ui.banner to get the banner object from the banners array. - * Use ui.bannerElement to get the banner html element in the DOM. */ igVideoPlayer(optionLiteral: 'option', optionName: "bannerHidden"): BannerHiddenEvent; @@ -95533,9 +111074,6 @@ interface JQuery { * Occurs when the banner is hidden. * * Function takes arguments evt and ui. - * Use ui.index to get the banner index in the banners array. - * Use ui.banner to get the banner object from the banners array. - * Use ui.bannerElement to get the banner html element in the DOM. * * @optionValue New value to be set. */ @@ -95545,7 +111083,6 @@ interface JQuery { * Occurs when the banner is clicked. * * Function takes arguments evt and ui. - * Use ui.bannerElement to get the banner html element in the DOM. */ igVideoPlayer(optionLiteral: 'option', optionName: "bannerClick"): BannerClickEvent; @@ -95553,7 +111090,6 @@ interface JQuery { * Occurs when the banner is clicked. * * Function takes arguments evt and ui. - * Use ui.bannerElement to get the banner html element in the DOM. * * @optionValue New value to be set. */ @@ -95579,16 +111115,19 @@ interface JQuery { interface IgWidget { /** * Set/Get the locale setting for the widget. + * */ locale?: any; /** * Set/Get the locale language setting for the widget. + * */ language?: string; /** * Set/Get the regional setting for the widget. + * */ regional?: string|Object; @@ -95598,9 +111137,30 @@ interface IgWidget { [optionName: string]: any; } interface IgWidgetMethods { + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ changeLocale($container: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ changeGlobalRegional(): void; + + /** + * Destroy is part of the jQuery UI widget API and does the following: + * 1. Remove custom CSS classes that were added. + * 2. Unwrap any wrapping elements such as scrolling divs and other containers. + * 3. Unbind all events that were bound. + */ destroy(): void; } interface JQuery { @@ -95615,30 +111175,35 @@ interface JQuery { /** * Set/Get the locale setting for the widget. + * */ igWidget(optionLiteral: 'option', optionName: "locale"): any; /** * Set/Get the locale setting for the widget. * + * * @optionValue New value to be set. */ igWidget(optionLiteral: 'option', optionName: "locale", optionValue: any): void; /** * Set/Get the locale language setting for the widget. + * */ igWidget(optionLiteral: 'option', optionName: "language"): string; /** * Set/Get the locale language setting for the widget. * + * * @optionValue New value to be set. */ igWidget(optionLiteral: 'option', optionName: "language", optionValue: string): void; /** * Set/Get the regional setting for the widget. + * */ igWidget(optionLiteral: 'option', optionName: "regional"): string|Object; @@ -95646,6 +111211,7 @@ interface JQuery { /** * Set/Get the regional setting for the widget. * + * * @optionValue New value to be set. */ @@ -95659,11 +111225,13 @@ interface JQuery { interface IgZoombarDefaultZoomWindow { /** * The left component of the zoom window in percentages. + * */ left?: number; /** * The width of the zoom window in percentages. + * */ width?: string; @@ -95787,6 +111355,7 @@ interface IgZoombar { /** * Specifies the element on which the widget the Zoombar is attached to is initialized. * object A valid jQuery object, the first element of which is that element. + * */ target?: string|Object; @@ -95794,6 +111363,7 @@ interface IgZoombar { * Specifies how the target widget's clone is rendered inside the Zoombar. * object A valid set of properties to initialize the clone with. * + * * Valid values: * "auto" Options for initializing the clone will be inferred from the target widget. Certain properties will be altered to make the clone more suitable for using inside the Zoombar. * "none" No clone of the target widget will be initialized inside the Zoombar. @@ -95803,8 +111373,11 @@ interface IgZoombar { /** * Specifies the width of the Zoombar. * + * * Valid values: * "auto" The width of the Zoombar will be the same as the widget it is attached to. + * "number" The widget width in pixels (px). + * "string" The widget width can be set in pixels (px) and percentage (%). * "null" The Zoombar will stretch horizontally to fit its container if it has width set, otherwise assumes auto. */ width?: string|number; @@ -95812,6 +111385,7 @@ interface IgZoombar { /** * Specifies the height of the Zoombar. * + * * Valid values: * "null" The Zoombar will stretch vertically to fit its container if it has height set, otherwise assumes 70px. */ @@ -95820,6 +111394,7 @@ interface IgZoombar { /** * Specifies when the zoom effect is applied. * + * * Valid values: * "immediate" The zoom action is applied as the end-user interacts with the zoom window. * "deferred" The zoom action is applied after the interaction with the zoom window completes. @@ -95828,34 +111403,58 @@ interface IgZoombar { /** * Specifies the distance (in percents) the zoom window moves when the left or right scroll bar buttons are clicked. + * */ zoomWindowMoveDistance?: number; /** * Specifies the default zoom in percentages. + * */ defaultZoomWindow?: IgZoombarDefaultZoomWindow; /** * The minimal width the zoom window can have in percentages. + * */ zoomWindowMinWidth?: number; /** * Specifies the animation duration (in milliseconds) when hover style is applied or removed from elements. + * */ hoverStyleAnimationDuration?: number; /** * Specifies the pan duration (in milliseconds) when the window changes position. Set to 0 for snap. + * */ windowPanDuration?: number; /** * Initial tabIndex for the Zoombar container elements. + * */ tabIndex?: number; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event fired before a zoom action is applied */ @@ -95945,6 +111544,24 @@ interface IgZoombarMethods { * @param width The width parameter of the new zoom window in percentages */ zoom(left?: number, width?: number): Object; + + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ + changeLocale($container: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igZoombar"): IgZoombarMethods; @@ -96041,6 +111658,9 @@ class ZoombarProviderDefault { /** * Jshint ignore:line + * + * @param a + * @param b */ update(a: Object, b: Object): void; } @@ -96075,6 +111695,9 @@ interface JQuery { igZoombar(methodName: "container"): Element; igZoombar(methodName: "clone"): Element; igZoombar(methodName: "zoom", left?: number, width?: number): Object; + igZoombar(methodName: "changeLocale", $container: Object): void; + igZoombar(methodName: "changeGlobalLanguage"): void; + igZoombar(methodName: "changeGlobalRegional"): void; /** * Gets a provider class which interfaces the widget that is being zoomed. @@ -96093,6 +111716,7 @@ interface JQuery { /** * Gets the element on which the widget the Zoombar is attached to is initialized. * object A valid jQuery object, the first element of which is that element. + * */ igZoombar(optionLiteral: 'option', optionName: "target"): string|Object; @@ -96101,6 +111725,7 @@ interface JQuery { * Sets the element on which the widget the Zoombar is attached to is initialized. * object A valid jQuery object, the first element of which is that element. * + * * @optionValue New value to be set. */ @@ -96109,6 +111734,7 @@ interface JQuery { /** * Gets how the target widget's clone is rendered inside the Zoombar. * object A valid set of properties to initialize the clone with. + * */ igZoombar(optionLiteral: 'option', optionName: "clone"): string|Object; @@ -96117,6 +111743,7 @@ interface JQuery { * Sets how the target widget's clone is rendered inside the Zoombar. * object A valid set of properties to initialize the clone with. * + * * @optionValue New value to be set. */ @@ -96124,6 +111751,7 @@ interface JQuery { /** * Gets the width of the Zoombar. + * */ igZoombar(optionLiteral: 'option', optionName: "width"): string|number; @@ -96131,6 +111759,7 @@ interface JQuery { /** * Sets the width of the Zoombar. * + * * @optionValue New value to be set. */ @@ -96138,6 +111767,7 @@ interface JQuery { /** * Gets the height of the Zoombar. + * */ igZoombar(optionLiteral: 'option', optionName: "height"): number|string; @@ -96145,6 +111775,7 @@ interface JQuery { /** * Sets the height of the Zoombar. * + * * @optionValue New value to be set. */ @@ -96152,6 +111783,7 @@ interface JQuery { /** * Gets when the zoom effect is applied. + * */ igZoombar(optionLiteral: 'option', optionName: "zoomAction"): string; @@ -96159,6 +111791,7 @@ interface JQuery { /** * Sets when the zoom effect is applied. * + * * @optionValue New value to be set. */ @@ -96166,76 +111799,132 @@ interface JQuery { /** * Gets the distance (in percents) the zoom window moves when the left or right scroll bar buttons are clicked. + * */ igZoombar(optionLiteral: 'option', optionName: "zoomWindowMoveDistance"): number; /** * Sets the distance (in percents) the zoom window moves when the left or right scroll bar buttons are clicked. * + * * @optionValue New value to be set. */ igZoombar(optionLiteral: 'option', optionName: "zoomWindowMoveDistance", optionValue: number): void; /** * Gets the default zoom in percentages. + * */ igZoombar(optionLiteral: 'option', optionName: "defaultZoomWindow"): IgZoombarDefaultZoomWindow; /** * Sets the default zoom in percentages. * + * * @optionValue New value to be set. */ igZoombar(optionLiteral: 'option', optionName: "defaultZoomWindow", optionValue: IgZoombarDefaultZoomWindow): void; /** * The minimal width the zoom window can have in percentages. + * */ igZoombar(optionLiteral: 'option', optionName: "zoomWindowMinWidth"): number; /** * The minimal width the zoom window can have in percentages. * + * * @optionValue New value to be set. */ igZoombar(optionLiteral: 'option', optionName: "zoomWindowMinWidth", optionValue: number): void; /** * Gets the animation duration (in milliseconds) when hover style is applied or removed from elements. + * */ igZoombar(optionLiteral: 'option', optionName: "hoverStyleAnimationDuration"): number; /** * Sets the animation duration (in milliseconds) when hover style is applied or removed from elements. * + * * @optionValue New value to be set. */ igZoombar(optionLiteral: 'option', optionName: "hoverStyleAnimationDuration", optionValue: number): void; /** * Gets the pan duration (in milliseconds) when the window changes position. Set to 0 for snap. + * */ igZoombar(optionLiteral: 'option', optionName: "windowPanDuration"): number; /** * Sets the pan duration (in milliseconds) when the window changes position. Set to 0 for snap. * + * * @optionValue New value to be set. */ igZoombar(optionLiteral: 'option', optionName: "windowPanDuration", optionValue: number): void; /** * Initial tabIndex for the Zoombar container elements. + * */ igZoombar(optionLiteral: 'option', optionName: "tabIndex"): number; /** * Initial tabIndex for the Zoombar container elements. * + * * @optionValue New value to be set. */ igZoombar(optionLiteral: 'option', optionName: "tabIndex", optionValue: number): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igZoombar(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igZoombar(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igZoombar(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igZoombar(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igZoombar(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igZoombar(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event fired before a zoom action is applied */ @@ -96363,6 +112052,233 @@ interface JQuery { igZoombar(optionLiteral: 'option', optionName: string, optionValue: any): JQuery; igZoombar(methodName: string, ...methodParams: any[]): any; } +interface ResolvingAxisValueEvent { + (event: Event, ui: ResolvingAxisValueEventUIParam): void; +} + +interface ResolvingAxisValueEventUIParam {} + +interface IgZoomSlider { + /** + * The width of the gauge. It can be set as a number in pixels, string (px) or percentage (%). + */ + width?: string|number; + + /** + * The height of the gauge. It can be set as a number in pixels, string (px) or percentage (%). + */ + height?: string|number; + panTransitionDuration?: number; + maxZoomWidth?: number; + pixelScalingRatio?: number; + actualPixelScalingRatio?: number; + windowRect?: any; + minZoomWidth?: number; + startInset?: number; + endInset?: number; + trackStartInset?: number; + trackEndInset?: number; + barExtent?: number; + orientation?: string; + lowerThumbBrush?: any; + lowerThumbStrokeThickness?: number; + higherThumbStrokeThickness?: number; + higherThumbBrush?: any; + lowerThumbOutline?: any; + higherThumbOutline?: any; + lowerThumbRidgesBrush?: any; + higherThumbRidgesBrush?: any; + lowerThumbWidth?: number; + higherThumbWidth?: number; + lowerThumbHeight?: number; + higherThumbHeight?: number; + lowerShadeBrush?: any; + lowerShadeOutline?: any; + lowerShadeStrokeThickness?: number; + higherShadeBrush?: any; + higherShadeOutline?: any; + higherShadeStrokeThickness?: number; + barBrush?: any; + barOutline?: any; + barStrokeThickness?: number; + rangeThumbBrush?: any; + rangeThumbOutline?: any; + rangeThumbStrokeThickness?: number; + rangeThumbRidgesBrush?: any; + lowerCalloutBrush?: any; + lowerCalloutTextColor?: any; + lowerCalloutOutline?: any; + lowerCalloutStrokeThickness?: number; + higherCalloutBrush?: any; + higherCalloutTextColor?: any; + higherCalloutOutline?: any; + higherCalloutStrokeThickness?: number; + areThumbCalloutsEnabled?: boolean; + thumbCalloutTextStyle?: any; + propertyChanged?: PropertyChangedEvent; + resolvingAxisValue?: ResolvingAxisValueEvent; + windowRectChanged?: WindowRectChangedEvent; + + /** + * Option for igZoomSlider + */ + [optionName: string]: any; +} +interface IgZoomSliderMethods { + notifySizeChanged(): void; + + /** + * Flushes the gauge. + */ + flush(): void; + + /** + * Destroys widget. + */ + destroy(): void; +} +interface JQuery { + data(propertyName: "igZoomSlider"): IgZoomSliderMethods; +} + +interface JQuery { + igZoomSlider(methodName: "notifySizeChanged"): void; + igZoomSlider(methodName: "flush"): void; + igZoomSlider(methodName: "destroy"): void; + + /** + * The width of the gauge. It can be set as a number in pixels, string (px) or percentage (%). + */ + + igZoomSlider(optionLiteral: 'option', optionName: "width"): string|number; + + /** + * The width of the gauge. It can be set as a number in pixels, string (px) or percentage (%). + * + * @optionValue New value to be set. + */ + + igZoomSlider(optionLiteral: 'option', optionName: "width", optionValue: string|number): void; + + /** + * The height of the gauge. It can be set as a number in pixels, string (px) or percentage (%). + */ + + igZoomSlider(optionLiteral: 'option', optionName: "height"): string|number; + + /** + * The height of the gauge. It can be set as a number in pixels, string (px) or percentage (%). + * + * @optionValue New value to be set. + */ + + igZoomSlider(optionLiteral: 'option', optionName: "height", optionValue: string|number): void; + igZoomSlider(optionLiteral: 'option', optionName: "panTransitionDuration"): number; + igZoomSlider(optionLiteral: 'option', optionName: "panTransitionDuration", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "maxZoomWidth"): number; + igZoomSlider(optionLiteral: 'option', optionName: "maxZoomWidth", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "pixelScalingRatio"): number; + igZoomSlider(optionLiteral: 'option', optionName: "pixelScalingRatio", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "actualPixelScalingRatio"): number; + igZoomSlider(optionLiteral: 'option', optionName: "actualPixelScalingRatio", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "windowRect"): any; + igZoomSlider(optionLiteral: 'option', optionName: "windowRect", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "minZoomWidth"): number; + igZoomSlider(optionLiteral: 'option', optionName: "minZoomWidth", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "startInset"): number; + igZoomSlider(optionLiteral: 'option', optionName: "startInset", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "endInset"): number; + igZoomSlider(optionLiteral: 'option', optionName: "endInset", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "trackStartInset"): number; + igZoomSlider(optionLiteral: 'option', optionName: "trackStartInset", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "trackEndInset"): number; + igZoomSlider(optionLiteral: 'option', optionName: "trackEndInset", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "barExtent"): number; + igZoomSlider(optionLiteral: 'option', optionName: "barExtent", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "orientation"): string; + igZoomSlider(optionLiteral: 'option', optionName: "orientation", optionValue: string): void; + igZoomSlider(optionLiteral: 'option', optionName: "lowerThumbBrush"): any; + igZoomSlider(optionLiteral: 'option', optionName: "lowerThumbBrush", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "lowerThumbStrokeThickness"): number; + igZoomSlider(optionLiteral: 'option', optionName: "lowerThumbStrokeThickness", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "higherThumbStrokeThickness"): number; + igZoomSlider(optionLiteral: 'option', optionName: "higherThumbStrokeThickness", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "higherThumbBrush"): any; + igZoomSlider(optionLiteral: 'option', optionName: "higherThumbBrush", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "lowerThumbOutline"): any; + igZoomSlider(optionLiteral: 'option', optionName: "lowerThumbOutline", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "higherThumbOutline"): any; + igZoomSlider(optionLiteral: 'option', optionName: "higherThumbOutline", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "lowerThumbRidgesBrush"): any; + igZoomSlider(optionLiteral: 'option', optionName: "lowerThumbRidgesBrush", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "higherThumbRidgesBrush"): any; + igZoomSlider(optionLiteral: 'option', optionName: "higherThumbRidgesBrush", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "lowerThumbWidth"): number; + igZoomSlider(optionLiteral: 'option', optionName: "lowerThumbWidth", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "higherThumbWidth"): number; + igZoomSlider(optionLiteral: 'option', optionName: "higherThumbWidth", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "lowerThumbHeight"): number; + igZoomSlider(optionLiteral: 'option', optionName: "lowerThumbHeight", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "higherThumbHeight"): number; + igZoomSlider(optionLiteral: 'option', optionName: "higherThumbHeight", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "lowerShadeBrush"): any; + igZoomSlider(optionLiteral: 'option', optionName: "lowerShadeBrush", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "lowerShadeOutline"): any; + igZoomSlider(optionLiteral: 'option', optionName: "lowerShadeOutline", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "lowerShadeStrokeThickness"): number; + igZoomSlider(optionLiteral: 'option', optionName: "lowerShadeStrokeThickness", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "higherShadeBrush"): any; + igZoomSlider(optionLiteral: 'option', optionName: "higherShadeBrush", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "higherShadeOutline"): any; + igZoomSlider(optionLiteral: 'option', optionName: "higherShadeOutline", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "higherShadeStrokeThickness"): number; + igZoomSlider(optionLiteral: 'option', optionName: "higherShadeStrokeThickness", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "barBrush"): any; + igZoomSlider(optionLiteral: 'option', optionName: "barBrush", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "barOutline"): any; + igZoomSlider(optionLiteral: 'option', optionName: "barOutline", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "barStrokeThickness"): number; + igZoomSlider(optionLiteral: 'option', optionName: "barStrokeThickness", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "rangeThumbBrush"): any; + igZoomSlider(optionLiteral: 'option', optionName: "rangeThumbBrush", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "rangeThumbOutline"): any; + igZoomSlider(optionLiteral: 'option', optionName: "rangeThumbOutline", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "rangeThumbStrokeThickness"): number; + igZoomSlider(optionLiteral: 'option', optionName: "rangeThumbStrokeThickness", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "rangeThumbRidgesBrush"): any; + igZoomSlider(optionLiteral: 'option', optionName: "rangeThumbRidgesBrush", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "lowerCalloutBrush"): any; + igZoomSlider(optionLiteral: 'option', optionName: "lowerCalloutBrush", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "lowerCalloutTextColor"): any; + igZoomSlider(optionLiteral: 'option', optionName: "lowerCalloutTextColor", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "lowerCalloutOutline"): any; + igZoomSlider(optionLiteral: 'option', optionName: "lowerCalloutOutline", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "lowerCalloutStrokeThickness"): number; + igZoomSlider(optionLiteral: 'option', optionName: "lowerCalloutStrokeThickness", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "higherCalloutBrush"): any; + igZoomSlider(optionLiteral: 'option', optionName: "higherCalloutBrush", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "higherCalloutTextColor"): any; + igZoomSlider(optionLiteral: 'option', optionName: "higherCalloutTextColor", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "higherCalloutOutline"): any; + igZoomSlider(optionLiteral: 'option', optionName: "higherCalloutOutline", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "higherCalloutStrokeThickness"): number; + igZoomSlider(optionLiteral: 'option', optionName: "higherCalloutStrokeThickness", optionValue: number): void; + igZoomSlider(optionLiteral: 'option', optionName: "areThumbCalloutsEnabled"): boolean; + igZoomSlider(optionLiteral: 'option', optionName: "areThumbCalloutsEnabled", optionValue: boolean): void; + igZoomSlider(optionLiteral: 'option', optionName: "thumbCalloutTextStyle"): any; + igZoomSlider(optionLiteral: 'option', optionName: "thumbCalloutTextStyle", optionValue: any): void; + igZoomSlider(optionLiteral: 'option', optionName: "propertyChanged"): PropertyChangedEvent; + igZoomSlider(optionLiteral: 'option', optionName: "propertyChanged", optionValue: PropertyChangedEvent): void; + igZoomSlider(optionLiteral: 'option', optionName: "resolvingAxisValue"): ResolvingAxisValueEvent; + igZoomSlider(optionLiteral: 'option', optionName: "resolvingAxisValue", optionValue: ResolvingAxisValueEvent): void; + igZoomSlider(optionLiteral: 'option', optionName: "windowRectChanged"): WindowRectChangedEvent; + igZoomSlider(optionLiteral: 'option', optionName: "windowRectChanged", optionValue: WindowRectChangedEvent): void; + igZoomSlider(options: IgZoomSlider): JQuery; + igZoomSlider(optionLiteral: 'option', optionName: string): any; + igZoomSlider(optionLiteral: 'option', options: IgZoomSlider): JQuery; + igZoomSlider(optionLiteral: 'option', optionName: string, optionValue: any): JQuery; + igZoomSlider(methodName: string, ...methodParams: any[]): any; +} interface IgLoader { scriptPath: string; From df22c6534ac2c8901a29e091a3a9cd6c9e5733a5 Mon Sep 17 00:00:00 2001 From: Angel Merino Date: Tue, 17 Apr 2018 18:46:34 +0200 Subject: [PATCH 0712/2153] Update types for dnssd (#25054) * Added types for dnssd * Cosmetics, test passed * Removed unused rules * Service entry type added Browser implements EventEmitter * make tslint happy --- types/dnssd/index.d.ts | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/types/dnssd/index.d.ts b/types/dnssd/index.d.ts index 3f5617afcb..9c66a6d6a4 100644 --- a/types/dnssd/index.d.ts +++ b/types/dnssd/index.d.ts @@ -4,6 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// +import { EventEmitter } from 'events'; /** Declaration file generated by dts-gen */ @@ -17,7 +18,27 @@ export class Advertisement { updateTXT(txtObj: any): void; } -export class Browser { +/** + * A service entry as returned by serviceUp + */ +export class Service { + fullname: string; // 'InstanceName._googlecast._tcp.local.' + name: string; // 'InstanceName' + type: SType; // { name: 'googlecast'; protocol: 'tcp' } + domain: string; // 'local' + host: string; // 'Hostname.local.' + port: number; // 8009 + addresses: string[]; // ['192.168.1.15'] + txt: any; // { id: 'strings' } + txtRaw: any; +} + +export class SType { + name: string; + protocol: string; +} + +export class Browser extends EventEmitter { constructor(type: any, ...args: any[]); list(): any; From 7354268b5373c3fe2128ed63eba07c86d0c553ec Mon Sep 17 00:00:00 2001 From: Giovanni Gonzaga Date: Tue, 17 Apr 2018 18:57:01 +0200 Subject: [PATCH 0713/2153] pg: query method missing an overload (#24940) * Update index.d.ts * Update pg-tests.ts --- types/pg/index.d.ts | 4 ++-- types/pg/pg-tests.ts | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/types/pg/index.d.ts b/types/pg/index.d.ts index a0efbb1555..9098f400e7 100644 --- a/types/pg/index.d.ts +++ b/types/pg/index.d.ts @@ -107,7 +107,7 @@ export class Pool extends events.EventEmitter { query(queryStream: QueryConfig & stream.Readable): stream.Readable; query(queryConfig: QueryArrayConfig): Promise; query(queryConfig: QueryConfig): Promise; - query(queryText: string, values?: any[]): Promise; + query(queryTextOrConfig: string | QueryConfig, values?: any[]): Promise; query(queryConfig: QueryArrayConfig, callback: (err: Error, result: QueryArrayResult) => void): Query; query(queryTextOrConfig: string | QueryConfig, callback: (err: Error, result: QueryResult) => void): Query; query(queryText: string, values: any[], callback: (err: Error, result: QueryResult) => void): Query; @@ -125,7 +125,7 @@ export class ClientBase extends events.EventEmitter { query(queryStream: QueryConfig & stream.Readable): stream.Readable; query(queryConfig: QueryArrayConfig): Promise; query(queryConfig: QueryConfig): Promise; - query(queryText: string, values?: any[]): Promise; + query(queryTextOrConfig: string | QueryConfig, values?: any[]): Promise; query(queryConfig: QueryArrayConfig, callback: (err: Error, result: QueryArrayResult) => void): Query; query(queryTextOrConfig: string | QueryConfig, callback: (err: Error, result: QueryResult) => void): Query; query(queryText: string, values: any[], callback: (err: Error, result: QueryResult) => void): Query; diff --git a/types/pg/pg-tests.ts b/types/pg/pg-tests.ts index f0defa0fb2..48f7dafe36 100644 --- a/types/pg/pg-tests.ts +++ b/types/pg/pg-tests.ts @@ -66,6 +66,14 @@ client.query(query) .catch(e => { console.error(e.stack); }); +client.query(query, ['brianc']) + .then(res => { + console.log(res.rows); + console.log(res.fields.map(f => f.name)); + }) + .catch(e => { + console.error(e.stack); + }); const queryArrMode: QueryArrayConfig = { name: 'get-name-array', @@ -156,6 +164,9 @@ pool.query('SELECT $1::text as name', ['brianc'], (err, result) => { pool.query('SELECT $1::text as name', ['brianc']) .then((res) => console.log(res.rows[0].name)) .catch(err => console.error('Error executing query', err.stack)); +pool.query({ text: 'SELECT $1::text as name' }, ['brianc']) + .then((res) => console.log(res.rows[0].name)) + .catch(err => console.error('Error executing query', err.stack)); pool.end(() => { console.log('pool has ended'); From a9e8ad80f96e72bbaaa90677a35931d4b3f6976c Mon Sep 17 00:00:00 2001 From: doomsower Date: Tue, 17 Apr 2018 19:57:43 +0300 Subject: [PATCH 0714/2153] [react-navigation] Loosen navigator navigationOptions (#24943) * Loosen navigator navigationOptions * Fix linter --- types/react-navigation/index.d.ts | 19 ++++++++++--------- .../react-navigation-tests.tsx | 5 ++++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 9aafc994fb..517ec8784d 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -158,9 +158,7 @@ export interface NavigationScreenDetails { navigation: NavigationScreenProp; } -export interface NavigationScreenOptions { - title?: string; -} +export type NavigationScreenOptions = NavigationStackScreenOptions & NavigationTabScreenOptions & NavigationDrawerScreenOptions; export interface NavigationScreenConfigProps { navigation: NavigationScreenProp; @@ -289,7 +287,8 @@ export interface NavigationStackViewConfig { onTransitionEnd?: () => void; } -export type NavigationStackScreenOptions = NavigationScreenOptions & { +export interface NavigationStackScreenOptions { + title?: string; header?: (React.ReactElement | ((headerProps: HeaderProps) => React.ReactElement)) | null; headerTransparent?: boolean; headerTitle?: string | React.ReactElement; @@ -305,14 +304,14 @@ export type NavigationStackScreenOptions = NavigationScreenOptions & { headerBackground?: React.ReactNode | React.ReactType; gesturesEnabled?: boolean; gestureResponseDistance?: { vertical?: number; horizontal?: number }; -}; +} export interface NavigationStackRouterConfig { headerTransitionPreset?: 'fade-in-place' | 'uikit'; initialRouteName?: string; initialRouteParams?: NavigationParams; paths?: NavigationPathsConfig; - navigationOptions?: NavigationScreenConfig; + navigationOptions?: NavigationScreenConfig; } export type NavigationStackAction = @@ -352,7 +351,7 @@ export interface NavigationPathsConfig { export interface NavigationTabRouterConfig { initialRouteName?: string; paths?: NavigationPathsConfig; - navigationOptions?: NavigationScreenConfig; + navigationOptions?: NavigationScreenConfig; order?: string[]; // todo: type these as the real route names rather than 'string' // Does the back button cause the router to switch to the initial tab @@ -364,7 +363,8 @@ export interface TabScene { index: number; tintColor?: string; } -export interface NavigationTabScreenOptions extends NavigationScreenOptions { +export interface NavigationTabScreenOptions { + title?: string; tabBarIcon?: React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< @@ -384,7 +384,8 @@ export interface NavigationTabScreenOptions extends NavigationScreenOptions { }) => void; } -export interface NavigationDrawerScreenOptions extends NavigationScreenOptions { +export interface NavigationDrawerScreenOptions { + title?: string; drawerIcon?: React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 7e956d2c1a..ec43f2c86a 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -193,7 +193,10 @@ const tabNavigatorConfigWithNavigationOptions: TabNavigatorConfig = { navigationOptions: { tabBarOnPress: ({scene, jumpToIndex}) => { jumpToIndex(scene.index); - } + }, + headerStyle: { + backgroundColor: 'red', + }, }, }; From 5227ddf7d53c976ce6238535e26a5700fca01506 Mon Sep 17 00:00:00 2001 From: Aankhen Date: Wed, 18 Apr 2018 01:22:41 +0530 Subject: [PATCH 0715/2153] Add `write-file-atomically` types. (#25064) --- types/write-file-atomically/index.d.ts | 14 +++++++++++ types/write-file-atomically/tsconfig.json | 23 +++++++++++++++++++ types/write-file-atomically/tslint.json | 1 + .../write-file-atomically-tests.ts | 10 ++++++++ 4 files changed, 48 insertions(+) create mode 100644 types/write-file-atomically/index.d.ts create mode 100644 types/write-file-atomically/tsconfig.json create mode 100644 types/write-file-atomically/tslint.json create mode 100644 types/write-file-atomically/write-file-atomically-tests.ts diff --git a/types/write-file-atomically/index.d.ts b/types/write-file-atomically/index.d.ts new file mode 100644 index 0000000000..b4e3957a80 --- /dev/null +++ b/types/write-file-atomically/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for write-file-atomically 2.0 +// Project: https://github.com/shinnn/write-file-atomically#readme +// Definitions by: Aankhen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import writeFileAtomic = require("write-file-atomic"); + +export = WriteFileAtomically; + +declare function WriteFileAtomically(path: string, data: WriteFileAtomically.Data, options?: writeFileAtomic.Options): Promise; + +declare namespace WriteFileAtomically { + type Data = string | Buffer | Uint8Array; +} diff --git a/types/write-file-atomically/tsconfig.json b/types/write-file-atomically/tsconfig.json new file mode 100644 index 0000000000..eb3aedbee9 --- /dev/null +++ b/types/write-file-atomically/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "write-file-atomically-tests.ts" + ] +} diff --git a/types/write-file-atomically/tslint.json b/types/write-file-atomically/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/write-file-atomically/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/write-file-atomically/write-file-atomically-tests.ts b/types/write-file-atomically/write-file-atomically-tests.ts new file mode 100644 index 0000000000..a1654d6cb6 --- /dev/null +++ b/types/write-file-atomically/write-file-atomically-tests.ts @@ -0,0 +1,10 @@ +import writeFileAtomically = require('write-file-atomically'); + +writeFileAtomically(1, '_'); // $ExpectError + +import { readFileSync } from 'fs'; + +(() => { + writeFileAtomically('file.txt', 'Hi!'); + readFileSync('file.txt', 'utf8'); +})(); From 8c3fdbcf025bea5dc20b09800c495cb95b7bccca Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Tue, 17 Apr 2018 22:16:35 +0200 Subject: [PATCH 0716/2153] [estree] make function declaration id nullable (#24854) * [estree] make function declaration id nullable * apply review feedback * [estree] make class declaration id nullable --- types/estree/estree-tests.ts | 7 ++++++- types/estree/index.d.ts | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/types/estree/estree-tests.ts b/types/estree/estree-tests.ts index 5cd065d03f..24e92ddc38 100644 --- a/types/estree/estree-tests.ts +++ b/types/estree/estree-tests.ts @@ -223,7 +223,8 @@ boolean = memberExpression.computed; // Declarations var functionDeclaration: ESTree.FunctionDeclaration; -identifier = functionDeclaration.id; +var identifierOrNull: ESTree.Identifier | null = functionDeclaration.id; +functionDeclaration.id = null; var params: Array = functionDeclaration.params; blockStatement = functionDeclaration.body; booleanMaybe = functionDeclaration.generator; @@ -237,6 +238,10 @@ var variableDeclarator: ESTree.VariableDeclarator; pattern = variableDeclarator.id; // Pattern expressionMaybe = variableDeclarator.init; +var classDeclaration: ESTree.ClassDeclaration; +identifierOrNull = classDeclaration.id; +classDeclaration.id = null; + // Clauses // SwitchCase string = switchCase.type; diff --git a/types/estree/index.d.ts b/types/estree/index.d.ts index 068cbfd8ce..0133991c9f 100644 --- a/types/estree/index.d.ts +++ b/types/estree/index.d.ts @@ -196,7 +196,8 @@ interface BaseDeclaration extends BaseStatement { } export interface FunctionDeclaration extends BaseFunction, BaseDeclaration { type: "FunctionDeclaration"; - id: Identifier; + /** It is null when a function declaration is a part of the `export default function` statement */ + id: Identifier | null; body: BlockStatement; } @@ -473,7 +474,8 @@ export interface MethodDefinition extends BaseNode { export interface ClassDeclaration extends BaseClass, BaseDeclaration { type: "ClassDeclaration"; - id: Identifier; + /** It is null when a class declaration is a part of the `export default class` statement */ + id: Identifier | null; } export interface ClassExpression extends BaseClass, BaseExpression { From 16c3ba2628afff477e2fdc41bda1752e498c415a Mon Sep 17 00:00:00 2001 From: Abram Booth Date: Tue, 17 Apr 2018 21:11:35 -0400 Subject: [PATCH 0717/2153] Fix DS.Model.belongsTo and DS.Model.hasMany args (#25072) --- types/ember-data/index.d.ts | 4 ++-- types/ember-data/test/relationships.ts | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/types/ember-data/index.d.ts b/types/ember-data/index.d.ts index ea3de94436..5e4fa4eb60 100644 --- a/types/ember-data/index.d.ts +++ b/types/ember-data/index.d.ts @@ -521,11 +521,11 @@ declare module 'ember-data' { /** * Get the reference for the specified belongsTo relationship. */ - belongsTo(name: keyof ModelRegistry): BelongsToReference; + belongsTo(name: RelationshipsFor): BelongsToReference; /** * Get the reference for the specified hasMany relationship. */ - hasMany(name: keyof ModelRegistry): HasManyReference; + hasMany(name: RelationshipsFor): HasManyReference; /** * Given a callback, iterates over each of the relationships in the model, * invoking the callback with the name of each relationship and its relationship diff --git a/types/ember-data/test/relationships.ts b/types/ember-data/test/relationships.ts index fb89d4410c..df43387bb4 100644 --- a/types/ember-data/test/relationships.ts +++ b/types/ember-data/test/relationships.ts @@ -16,17 +16,23 @@ class Comment extends DS.Model { author = DS.attr('string'); } +class Series extends DS.Model { + title = DS.attr('string'); +} + class RelationalPost extends DS.Model { title = DS.attr('string'); tag = DS.attr('string'); comments = DS.hasMany('comment', { async: true }); relatedPosts = DS.hasMany('post'); + series = DS.belongsTo('series'); } declare module 'ember-data' { interface ModelRegistry { 'relational-post': RelationalPost; comment: Comment; + series: Series; } } @@ -35,3 +41,6 @@ blogPost!.get('comments').then((comments) => { // now we can work with the comments let author: string = comments.get('firstObject')!.get('author'); }); + +blogPost!.hasMany('relatedPosts'); +blogPost!.belongsTo('series'); From 302ef7b926ace5e05e376e59611d206a7fa14c7d Mon Sep 17 00:00:00 2001 From: Abram Booth Date: Tue, 17 Apr 2018 21:11:52 -0400 Subject: [PATCH 0718/2153] Fix EmberArray.uniqBy typing (#25073) --- types/ember/index.d.ts | 2 +- types/ember/test/array-ext.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index cd4ba0f85f..aeb05d115d 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -1243,7 +1243,7 @@ declare module 'ember' { * Returns a new enumerable that contains only items containing a unique property value. * The default implementation returns an array regardless of the receiver type. */ - uniqBy(): NativeArray; + uniqBy(property: string): NativeArray; /** * Returns `true` if the passed object can be found in the enumerable. */ diff --git a/types/ember/test/array-ext.ts b/types/ember/test/array-ext.ts index 86e84fd7c5..059d60c00c 100755 --- a/types/ember/test/array-ext.ts +++ b/types/ember/test/array-ext.ts @@ -16,3 +16,6 @@ assertType(array.get('length')); assertType(array.get('firstObject')); assertType(array.mapBy('name')); assertType(array.map(p => p.get('name'))); +assertType(array.sortBy('name')); +assertType(array.uniq()); +assertType(array.uniqBy('name')); From cfa60b7c664ad32b5fd9c008f83178f90cda7b58 Mon Sep 17 00:00:00 2001 From: Chris Krycho Date: Tue, 17 Apr 2018 19:12:12 -0600 Subject: [PATCH 0719/2153] Ember: Make `RegistryProxyMixin.register` options optional. (#25076) * Ember: Make `RegistryProxyMixin.register` options optional. * Add tests for register change. --- types/ember/index.d.ts | 2 +- types/ember/test/application-instance.ts | 17 +++++++++++++++++ types/ember/tsconfig.json | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 types/ember/test/application-instance.ts diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index aeb05d115d..81d3bd69e6 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -325,7 +325,7 @@ declare module 'ember' { * `inject`) or for service lookup. Each factory is registered with * a full name including two parts: `type:name`. */ - register(fullName: string, factory: Function, options: {}): any; + register(fullName: string, factory: Function, options?: { singleton?: boolean, instantiate?: boolean }): any; /** * Unregister a factory. */ diff --git a/types/ember/test/application-instance.ts b/types/ember/test/application-instance.ts new file mode 100644 index 0000000000..dfda446463 --- /dev/null +++ b/types/ember/test/application-instance.ts @@ -0,0 +1,17 @@ +import ApplicationInstance from '@ember/application/instance'; + +const appInstance = ApplicationInstance.create(); +appInstance.register('some:injection', class Foo {}); + +appInstance.register('some:injection', class Foo {}, { + singleton: true, +}); + +appInstance.register('some:injection', class Foo {}, { + instantiate: false, +}); + +appInstance.register('some:injection', class Foo {}, { + singleton: false, + instantiate: true, +}); diff --git a/types/ember/tsconfig.json b/types/ember/tsconfig.json index cbdb6b6afc..b4bc966044 100755 --- a/types/ember/tsconfig.json +++ b/types/ember/tsconfig.json @@ -22,6 +22,7 @@ "index.d.ts", "test/lib/assert.ts", "test/application.ts", + "test/application-instance.ts", "test/ember-tests.ts", "test/error.ts", "test/event.ts", From 932727f5785b3bdab808da5852467358dc09d588 Mon Sep 17 00:00:00 2001 From: Don Denton Date: Tue, 17 Apr 2018 20:12:42 -0500 Subject: [PATCH 0720/2153] Use partials for setting methods which take options (#24959) This commit addresses a problem where the following would produce a type error, even though it was valid code: ```typescript setCanvasData({left: 23}) ``` I have changed the argument type for all of the `setXXX` methods which accept an object as their argument. In the spec files for cropperjs, @fengyuanchen uses these objects as partials for setters. So I have made the type definitions follow that same pattern. I changed the `cropperjs.CropBoxData` type to act the same way as well. It looks like it was changed at some point, I am guessing to allow it to be used as a partial in the `setCropBoxData` method. Since, like all the other data structures here, it contains all members when you `get` it, I have made all members required parts of the object and changed the setter method to accept a partial. I hope this all makes sense. Basically, I went from the first line below to the second. ```typescript setXXXXX(thing: cropperjs.SomeInterface): void setXXXXX(thing: Partial): void ``` Then I changed `cropperjs.CropBoxData` to fit this new system. --- types/cropperjs/index.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/types/cropperjs/index.d.ts b/types/cropperjs/index.d.ts index 60b508dd8f..30556e11fc 100644 --- a/types/cropperjs/index.d.ts +++ b/types/cropperjs/index.d.ts @@ -312,19 +312,19 @@ declare namespace cropperjs { /** * the offset left of the crop box */ - left?: number; + left: number; /** * the offset top of the crop box */ - top?: number; + top: number; /** * the width of the crop box */ - width?: number; + width: number; /** * the height of the crop box */ - height?: number; + height: number; } interface CanvasData { /** @@ -516,7 +516,7 @@ declare class cropperjs { /** * Change the cropped area position and size with new data (base on the original image). */ - setData(data: cropperjs.Data): void; + setData(data: Partial): void; /** * Output the container size data. @@ -545,7 +545,7 @@ declare class cropperjs { /** * Change the canvas (image wrapper) position and size with new data. */ - setCanvasData(data: cropperjs.CanvasData): void; + setCanvasData(data: Partial): void; /** * Output the crop box position and size data. @@ -555,7 +555,7 @@ declare class cropperjs { /** * Change the crop box position and size with new data. */ - setCropBoxData(data: cropperjs.CropBoxData): void; + setCropBoxData(data: Partial): void; /** * Get a canvas drawn the cropped image. From 3204acf72ad613c89e741d6dd378d0e212a13a8b Mon Sep 17 00:00:00 2001 From: Alexander Christie Date: Wed, 18 Apr 2018 17:44:50 +0100 Subject: [PATCH 0721/2153] Add support for the Collation argument to Cursors (#25099) http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#collation --- types/mongodb/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 00356214c6..561cb153bb 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -1215,6 +1215,8 @@ export class Cursor extends Readable { /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#close */ close(): Promise; close(callback: MongoCallback): void; + /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#collation */ + collation(value: Object): Cursor; /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#comment */ comment(value: string): Cursor; /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#count */ From 713eb722d96eaee1f716b67a0fc7da0b467c4c35 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Thu, 19 Apr 2018 01:45:49 +0900 Subject: [PATCH 0722/2153] [webidl2] extAttrs.rhs can be null (#25092) --- types/webidl2/index.d.ts | 2 +- types/webidl2/webidl2-tests.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/types/webidl2/index.d.ts b/types/webidl2/index.d.ts index 9992642749..90a938b22a 100644 --- a/types/webidl2/index.d.ts +++ b/types/webidl2/index.d.ts @@ -249,7 +249,7 @@ export interface ExtendedAttributes { /** If the extended attribute takes arguments or if its right-hand side does they are listed here. */ arguments: Argument[]; /** If there is a right-hand side, this will capture its type ("identifier" or "identifier-list") and its value. */ - rhs: ExtendedAttributeRightHandSideIdentifier | ExtendedAttributeRightHandSideIdentifierList; + rhs: ExtendedAttributeRightHandSideIdentifier | ExtendedAttributeRightHandSideIdentifierList | null; } export interface Token { diff --git a/types/webidl2/webidl2-tests.ts b/types/webidl2/webidl2-tests.ts index a1c3165edf..179c1fcea5 100644 --- a/types/webidl2/webidl2-tests.ts +++ b/types/webidl2/webidl2-tests.ts @@ -106,6 +106,9 @@ function logExtAttrs(extAttrs: webidl2.ExtendedAttributes[]) { console.log(extAttrs[0].name); logArguments(extAttrs[0].arguments); const { rhs } = extAttrs[0]; + if (rhs === null) { + return; + } if (rhs.type === "identifier") { console.log(rhs); } else { From d38890b46abbd28a39be1c27954d8c2109997c35 Mon Sep 17 00:00:00 2001 From: Adam Laycock Date: Wed, 18 Apr 2018 17:46:05 +0100 Subject: [PATCH 0723/2153] update to type-screeps 2.3.0 (#25086) --- types/screeps/index.d.ts | 11 +++++++---- types/screeps/screeps-tests.ts | 5 +++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/types/screeps/index.d.ts b/types/screeps/index.d.ts index 77d472f447..d6153f8d64 100644 --- a/types/screeps/index.d.ts +++ b/types/screeps/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Screeps 2.2 +// Type definitions for Screeps 2.3 // Project: https://github.com/screeps/screeps // Definitions by: Marko Sulamägi // Nhan Ho @@ -344,6 +344,7 @@ declare const DENSITY_HIGH: number; declare const DENSITY_ULTRA: number; declare const TERMINAL_CAPACITY: number; +declare const TERMINAL_COOLDOWN: number; declare const TERMINAL_HITS: number; declare const TERMINAL_SEND_COST: number; declare const TERMINAL_MIN_SEND: number; @@ -777,7 +778,7 @@ interface Creep extends RoomObject { * @param target The target object to be attacked. * @returns Result Code: OK, ERR_NOT_OWNER, ERR_BUSY, ERR_NOT_ENOUGH_RESOURCES, ERR_INVALID_TARGET, ERR_NOT_IN_RANGE, ERR_NO_BODYPART, ERR_RCL_NOT_ENOUGH */ - build(target: ConstructionSite): CreepActionReturnCode | ERR_RCL_NOT_ENOUGH; + build(target: ConstructionSite): CreepActionReturnCode | ERR_NOT_ENOUGH_RESOURCES | ERR_RCL_NOT_ENOUGH; /** * Cancel the order given during the current game tick. * @param methodName The name of a creep's method to be cancelled. @@ -981,7 +982,7 @@ interface Creep extends RoomObject { * @param resourceType The target One of the RESOURCE_* constants.. * @param amount The amount of resources to be transferred. If omitted, all the available amount is used. */ - withdraw(target: Structure, resourceType: ResourceConstant, amount?: number): ScreepsReturnCode; + withdraw(target: Structure | Tombstone, resourceType: ResourceConstant, amount?: number): ScreepsReturnCode; } interface CreepConstructor extends _Constructor, _ConstructorById { @@ -1127,7 +1128,7 @@ interface Game { notify(message: string, groupInterval?: number): undefined; } -declare let Game: Game; +declare var Game: Game; interface _HasRoomPosition { pos: RoomPosition; } @@ -3899,6 +3900,8 @@ type AnyStructure = StructureRoad | StructureWall; interface Tombstone extends RoomObject { + /** The tombstones game objects id. */ + id: string; /** The tick that the creep died. */ deathTime: number; store: StoreDefinition; diff --git a/types/screeps/screeps-tests.ts b/types/screeps/screeps-tests.ts index 17a78de496..a8700a853b 100644 --- a/types/screeps/screeps-tests.ts +++ b/types/screeps/screeps-tests.ts @@ -541,6 +541,11 @@ interface CreepMemory { tombstone.creep.my; tombstone.store.energy; + + tombstone.id; + + const creep = Game.creeps['dave']; + creep.withdraw(tombstone, RESOURCE_ENERGY); } { From 59648ae466892cf17a448afe4db700ac91a551f1 Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Wed, 18 Apr 2018 11:46:55 -0500 Subject: [PATCH 0724/2153] enzyme: Fix `find` override for components with strict null checks. (#24811) * Fix `find` override for components with strict null checks. With strict null checks enabled, code like: shallow(...).find(SomeComponent) Would return ShallowWrapper. This is because the `find` override: find(component: ComponentClass): ShallowWrapper; Would not match, and instead fallback on find(EnzymePropSelector). The ComponentClass did not match because the `new(props?, context?)` does not actually match to `new(props)`, as polymorphically `props` is a restriction on `props?`. Instead, we explicitly model each potential constructor pattern, no-arg, 1-arg, 2-arg, and union them together. This also allows enabling strict null checks for the entire enzyme typings. This required a few tangential changes, e.g. changing the test's numberProp?/stringProp? to non-optional, as with null checking enabled several of the existing tests were making non-null safe accesses (e.g. the reduce/map/etc. checks). * Change let to const to fix tslint error. * Simplify prefix fix, just need to change props? to props. Also, I changed the new return type from Component to Component. This more exactly matches the ComponentClass declaration and fixes what I was seeing with React Native where: find(View) --> returns ReactWrapper find(Button) -- returns ReactWrapper After changing the new return type to Component then find(Button) successfully returns ReactWrapper. * Fix lint error, as {} is already the default type. --- types/enzyme/enzyme-tests.tsx | 52 ++++++++++++++++++----------------- types/enzyme/index.d.ts | 8 +++--- types/enzyme/tsconfig.json | 2 +- 3 files changed, 32 insertions(+), 30 deletions(-) diff --git a/types/enzyme/enzyme-tests.tsx b/types/enzyme/enzyme-tests.tsx index 50f9bf3f38..bbdd8f404f 100644 --- a/types/enzyme/enzyme-tests.tsx +++ b/types/enzyme/enzyme-tests.tsx @@ -8,13 +8,14 @@ import { configure, EnzymeAdapter, ShallowRendererProps, + ComponentClass as EnzymeComponentClass } from "enzyme"; import { Component, ReactElement, HTMLAttributes, ComponentClass, StatelessComponent } from "react"; // Help classes/interfaces interface MyComponentProps { - stringProp?: string; - numberProp?: number; + stringProp: string; + numberProp: number; } interface AnotherComponentProps { @@ -65,27 +66,27 @@ function configureTest() { // ShallowWrapper function ShallowWrapperTest() { let shallowWrapper: ShallowWrapper = - shallow(); + shallow(); let reactElement: ReactElement; let reactElements: Array>; let domElement: Element; let boolVal: boolean; let stringVal: string; - let numOrStringVal: number | string; + let numOrStringVal: number | string | undefined; let elementWrapper: ShallowWrapper>; let anotherStatelessWrapper: ShallowWrapper; let anotherComponentWrapper: ShallowWrapper; function test_props_state_inferring() { let wrapper: ShallowWrapper; - wrapper = shallow(); + wrapper = shallow(); wrapper.state().stateProperty; wrapper.props().stringProp.toUpperCase(); } function test_shallow_options() { - shallow(, { + shallow(, { context: { test: "a", }, @@ -99,6 +100,9 @@ function ShallowWrapperTest() { anotherStatelessWrapper = shallowWrapper.find(AnotherStatelessComponent); shallowWrapper = shallowWrapper.find({ prop: 'value' }); elementWrapper = shallowWrapper.find('.selector'); + // Since AnotherComponent does not have a constructor, it cannot match the + // previous selector overload of ComponentClass { new(props?, contenxt? ) } + const s1: EnzymeComponentClass = AnotherComponent; } function test_findWhere() { @@ -155,7 +159,7 @@ function ShallowWrapperTest() { } function test_hostNodes() { - shallowWrapper.hostNodes(); + shallowWrapper.hostNodes(); } function test_equals() { @@ -411,20 +415,19 @@ function ShallowWrapperTest() { function test_constructor() { let anyWrapper: ShallowWrapper; - anyWrapper = new ShallowWrapper(); - anyWrapper = new ShallowWrapper(); - shallowWrapper = new ShallowWrapper(); - shallowWrapper = new ShallowWrapper([, ]); - shallowWrapper = new ShallowWrapper(, shallowWrapper); - shallowWrapper = new ShallowWrapper(, null, { lifecycleExperimental: true }); - shallowWrapper = new ShallowWrapper(, shallowWrapper, { lifecycleExperimental: true }); + anyWrapper = new ShallowWrapper(); + shallowWrapper = new ShallowWrapper(); + shallowWrapper = new ShallowWrapper([, ]); + shallowWrapper = new ShallowWrapper(, shallowWrapper); + shallowWrapper = new ShallowWrapper(, undefined, { lifecycleExperimental: true }); + shallowWrapper = new ShallowWrapper(, shallowWrapper, { lifecycleExperimental: true }); } } // ReactWrapper function ReactWrapperTest() { let reactWrapper: ReactWrapper = - mount(); + mount(); let reactElement: ReactElement; let reactElements: Array>; @@ -437,7 +440,7 @@ function ReactWrapperTest() { function test_prop_state_inferring() { let wrapper: ReactWrapper; - wrapper = mount(); + wrapper = mount(); wrapper.state().stateProperty; wrapper.props().stringProp.toUpperCase(); } @@ -449,7 +452,7 @@ function ReactWrapperTest() { function test_mount() { reactWrapper = reactWrapper.mount(); - mount(, { + mount(, { attachTo: document.getElementById('test'), context: { a: "b" @@ -685,7 +688,7 @@ function ReactWrapperTest() { } function test_setProps() { - reactWrapper = reactWrapper.setProps({ stringProp: 'foo' }, () => {}); + reactWrapper = reactWrapper.setProps({ stringProp: 'foo' }, () => { }); } function test_setContext() { @@ -764,13 +767,12 @@ function ReactWrapperTest() { function test_constructor() { let anyWrapper: ReactWrapper; - anyWrapper = new ReactWrapper(); - anyWrapper = new ReactWrapper(); - reactWrapper = new ReactWrapper(); - reactWrapper = new ReactWrapper([, ]); - reactWrapper = new ReactWrapper(, reactWrapper); - reactWrapper = new ReactWrapper(, null, { attachTo: document.createElement('div') }); - reactWrapper = new ReactWrapper(, reactWrapper, { attachTo: document.createElement('div') }); + anyWrapper = new ReactWrapper(); + reactWrapper = new ReactWrapper(); + reactWrapper = new ReactWrapper([, ]); + reactWrapper = new ReactWrapper(, reactWrapper); + reactWrapper = new ReactWrapper(, undefined, { attachTo: document.createElement('div') }); + reactWrapper = new ReactWrapper(, reactWrapper, { attachTo: document.createElement('div') }); } } diff --git a/types/enzyme/index.d.ts b/types/enzyme/index.d.ts index fbb953e167..0a741460f6 100644 --- a/types/enzyme/index.d.ts +++ b/types/enzyme/index.d.ts @@ -23,7 +23,7 @@ export class ElementClass extends Component { * all specified in the implementation. TS chooses the EnzymePropSelector overload and loses the generics */ export interface ComponentClass { - new(props?: Props, context?: any): Component; + new(props: Props, context?: any): Component; } export type StatelessComponent = (props: Props, context?: any) => JSX.Element; @@ -354,7 +354,7 @@ export interface CommonWrapper

{ } // tslint:disable-next-line no-empty-interface -export interface ShallowWrapper

extends CommonWrapper {} +export interface ShallowWrapper

extends CommonWrapper { } export class ShallowWrapper

{ constructor(nodes: JSX.Element[] | JSX.Element, root?: ShallowWrapper, options?: ShallowRendererProps); shallow(options?: ShallowRendererProps): ShallowWrapper; @@ -440,7 +440,7 @@ export class ShallowWrapper

{ } // tslint:disable-next-line no-empty-interface -export interface ReactWrapper

extends CommonWrapper {} +export interface ReactWrapper

extends CommonWrapper { } export class ReactWrapper

{ constructor(nodes: JSX.Element | JSX.Element[], root?: ReactWrapper, options?: MountRendererProps); @@ -577,7 +577,7 @@ export interface MountRendererProps { /** * DOM Element to attach the component to */ - attachTo?: HTMLElement; + attachTo?: HTMLElement | null; /** * Merged contextTypes for all children of the wrapper */ diff --git a/types/enzyme/tsconfig.json b/types/enzyme/tsconfig.json index 096b64a111..c04256e39a 100644 --- a/types/enzyme/tsconfig.json +++ b/types/enzyme/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "jsx": "react", From 147bef129f34285a08807396f2ab216c4e9098e9 Mon Sep 17 00:00:00 2001 From: Jarom Loveridge Date: Wed, 18 Apr 2018 10:47:35 -0600 Subject: [PATCH 0725/2153] Update SSLOptions to match documentation. (#25080) --- types/mongodb/index.d.ts | 6 +++++- types/mongodb/mongodb-tests.ts | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 561cb153bb..f72af738a3 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -104,6 +104,10 @@ export interface MongoClientOptions extends } export interface SSLOptions { + // Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info. + ciphers?: string; + // Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info. + ecdhCurve?: string; // Default:5; Number of connections for each server instance poolSize?: number; // Use ssl connection (needs to have a mongod server with ssl support) @@ -115,7 +119,7 @@ export interface SSLOptions { // Array of valid certificates either as Buffers or Strings sslCA?: Array; // SSL Certificate revocation list binary buffer - sslCRL?: Buffer; + sslCRL?: Array; // SSL Certificate binary buffer sslCert?: Buffer | string; // SSL Key file binary buffer diff --git a/types/mongodb/mongodb-tests.ts b/types/mongodb/mongodb-tests.ts index 270379989a..bdbddb1250 100644 --- a/types/mongodb/mongodb-tests.ts +++ b/types/mongodb/mongodb-tests.ts @@ -23,6 +23,7 @@ let options: mongodb.MongoClientOptions = { sslValidate: false, checkServerIdentity: function () { }, sslCA: ['str'], + sslCRL: ['str'], sslCert: new Buffer(999), sslKey: new Buffer(999), sslPass: new Buffer(999), From cfbc3cd2a000d33ffcd5e32812a44b010198b721 Mon Sep 17 00:00:00 2001 From: ikokostya Date: Wed, 18 Apr 2018 19:58:55 +0300 Subject: [PATCH 0726/2153] [got] Update to 8.3.0 (#25098) * [got] Update to 8.3.0 Fixes #23454 * Return support for legacy url object * Simplify agent option type Because https.Agent is compatible with http.Agent * Rename RequestOptions interface to InternalRequestOptions and move outside got namespace * Add myself to "Definitions by" section --- types/got/got-tests.ts | 58 +++++++++++++++++++++++++++++++++++ types/got/index.d.ts | 68 ++++++++++++++++++++++++++++++++---------- 2 files changed, 110 insertions(+), 16 deletions(-) diff --git a/types/got/got-tests.ts b/types/got/got-tests.ts index 7048533295..8c88cef3bc 100644 --- a/types/got/got-tests.ts +++ b/types/got/got-tests.ts @@ -3,6 +3,8 @@ import cookie = require('cookie'); import FormData = require('form-data'); import * as fs from 'fs'; import * as http from 'http'; +import * as https from 'https'; +import * as url from 'url'; let str: string; let buf: Buffer; @@ -94,6 +96,7 @@ let res: http.IncomingMessage | undefined; let opts: got.GotOptions; let err: got.GotError; let href: string | undefined; +let progress: got.Progress; const stream = got.stream('todomvc.com'); stream.addListener('request', (r) => req = r); @@ -107,6 +110,12 @@ stream.addListener('error', (e, b, r) => { err = e; res = r; }); +stream.addListener('downloadProgress', (p) => { + progress = p; +}); +stream.addListener('uploadProgress', (p) => { + progress = p; +}); stream.on('request', (r) => req = r); stream.on('response', (r) => res = r); @@ -119,6 +128,12 @@ stream.on('error', (e, b, r) => { err = e; res = r; }); +stream.on('downloadProgress', (p) => { + progress = p; +}); +stream.on('uploadProgress', (p) => { + progress = p; +}); stream.once('request', (r) => req = r); stream.once('response', (r) => res = r); @@ -131,6 +146,12 @@ stream.once('error', (e, b, r) => { err = e; res = r; }); +stream.once('downloadProgress', (p) => { + progress = p; +}); +stream.once('uploadProgress', (p) => { + progress = p; +}); stream.prependListener('request', (r) => req = r); stream.prependListener('response', (r) => res = r); @@ -143,6 +164,12 @@ stream.prependListener('error', (e, b, r) => { err = e; res = r; }); +stream.prependListener('downloadProgress', (p) => { + progress = p; +}); +stream.prependListener('uploadProgress', (p) => { + progress = p; +}); stream.prependOnceListener('request', (r) => req = r); stream.prependOnceListener('response', (r) => res = r); @@ -155,6 +182,12 @@ stream.prependOnceListener('error', (e, b, r) => { err = e; res = r; }); +stream.prependOnceListener('downloadProgress', (p) => { + progress = p; +}); +stream.prependOnceListener('uploadProgress', (p) => { + progress = p; +}); stream.removeListener('request', (r) => req = r); stream.removeListener('response', (r) => res = r); @@ -167,6 +200,12 @@ stream.removeListener('error', (e, b, r) => { err = e; res = r; }); +stream.removeListener('downloadProgress', (p) => { + progress = p; +}); +stream.removeListener('uploadProgress', (p) => { + progress = p; +}); got('google.com', { headers: { @@ -190,3 +229,22 @@ got('todomvc.com', { got('https://httpbin.org/404') .catch(err => err instanceof got.HTTPError && err.statusCode === 404); + +got('todomvc', { + throwHttpErrors: false +}); + +got('todomvc', { + agent: { + http: new http.Agent(), + https: new https.Agent() + } +}); + +got('todomvc', { + cache: new Map() +}).then(res => res.fromCache); + +got(new url.URL('http://todomvc.com')); + +got(url.parse('http://todomvc.com')); diff --git a/types/got/index.d.ts b/types/got/index.d.ts index 5872b4f993..47c281fb53 100644 --- a/types/got/index.d.ts +++ b/types/got/index.d.ts @@ -1,14 +1,16 @@ -// Type definitions for got 7.1 +// Type definitions for got 8.3 // Project: https://github.com/sindresorhus/got#readme // Definitions by: BendingBender // Linus Unnebäck +// Konstantin Ikonnikov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 /// -import { Url } from 'url'; +import { Url, URL } from 'url'; import * as http from 'http'; +import * as https from 'https'; import * as nodeStream from 'stream'; export = got; @@ -45,6 +47,10 @@ declare class UnsupportedProtocolError extends StdError { name: 'UnsupportedProtocolError'; } +declare class CancelError extends StdError { + name: 'CancelError'; +} + declare class StdError extends Error { code?: string; host?: string; @@ -59,15 +65,22 @@ declare class StdError extends Error { declare const got: got.GotFn & Record<'get' | 'post' | 'put' | 'patch' | 'head' | 'delete', got.GotFn> & { - stream: got.GotStreamFn & Record<'get' | 'post' | 'put' | 'patch' | 'head' | 'delete', got.GotStreamFn> - RequestError: typeof RequestError - ReadError: typeof ReadError - ParseError: typeof ParseError - HTTPError: typeof HTTPError - MaxRedirectsError: typeof MaxRedirectsError - UnsupportedProtocolError: typeof UnsupportedProtocolError + stream: got.GotStreamFn & Record<'get' | 'post' | 'put' | 'patch' | 'head' | 'delete', got.GotStreamFn>; + RequestError: typeof RequestError; + ReadError: typeof ReadError; + ParseError: typeof ParseError; + HTTPError: typeof HTTPError; + MaxRedirectsError: typeof MaxRedirectsError; + UnsupportedProtocolError: typeof UnsupportedProtocolError; + CancelError: typeof CancelError; }; +interface InternalRequestOptions extends http.RequestOptions { + // Redeclare options with `any` type for allow specify types incompatible with http.RequestOptions. + timeout?: any; + agent?: any; +} + declare namespace got { interface GotFn { (url: GotUrl): GotPromise; @@ -80,7 +93,7 @@ declare namespace got { type GotStreamFn = (url: GotUrl, options?: GotOptions) => GotEmitter & nodeStream.Duplex; - type GotUrl = string | http.RequestOptions | Url; + type GotUrl = string | http.RequestOptions | Url | URL; interface GotBodyOptions extends GotOptions { body?: string | Buffer | nodeStream.Readable; @@ -98,11 +111,7 @@ declare namespace got { json?: boolean; } - interface TimoutRequestOptions extends http.RequestOptions { - timeout?: any; - } - - interface GotOptions extends TimoutRequestOptions { + interface GotOptions extends InternalRequestOptions { encoding?: E; query?: string | object; timeout?: number | TimeoutOptions; @@ -110,6 +119,9 @@ declare namespace got { followRedirect?: boolean; decompress?: boolean; useElectronNet?: boolean; + cache?: Map; + agent?: http.Agent | boolean | AgentOptions; + throwHttpErrors?: boolean; } interface TimeoutOptions { @@ -118,12 +130,18 @@ declare namespace got { request?: number; } + interface AgentOptions { + http: http.Agent; + https: https.Agent; + } + type RetryFunction = (retry: number, error: any) => number; interface Response extends http.IncomingMessage { body: B; url: string; requestUrl: string; + fromCache: boolean; redirectUrls?: string[]; } @@ -134,32 +152,50 @@ declare namespace got { addListener(event: 'response', listener: (res: http.IncomingMessage) => void): this; addListener(event: 'redirect', listener: (res: http.IncomingMessage, nextOptions: GotOptions & Url) => void): this; addListener(event: 'error', listener: (error: GotError, body?: any, res?: http.IncomingMessage) => void): this; + addListener(event: 'downloadProgress', listener: (progress: Progress) => void): this; + addListener(event: 'uploadProgress', listener: (progress: Progress) => void): this; on(event: 'request', listener: (req: http.ClientRequest) => void): this; on(event: 'response', listener: (res: http.IncomingMessage) => void): this; on(event: 'redirect', listener: (res: http.IncomingMessage, nextOptions: GotOptions & Url) => void): this; on(event: 'error', listener: (error: GotError, body?: any, res?: http.IncomingMessage) => void): this; + on(event: 'downloadProgress', listener: (progress: Progress) => void): this; + on(event: 'uploadProgress', listener: (progress: Progress) => void): this; once(event: 'request', listener: (req: http.ClientRequest) => void): this; once(event: 'response', listener: (res: http.IncomingMessage) => void): this; once(event: 'redirect', listener: (res: http.IncomingMessage, nextOptions: GotOptions & Url) => void): this; once(event: 'error', listener: (error: GotError, body?: any, res?: http.IncomingMessage) => void): this; + once(event: 'downloadProgress', listener: (progress: Progress) => void): this; + once(event: 'uploadProgress', listener: (progress: Progress) => void): this; prependListener(event: 'request', listener: (req: http.ClientRequest) => void): this; prependListener(event: 'response', listener: (res: http.IncomingMessage) => void): this; prependListener(event: 'redirect', listener: (res: http.IncomingMessage, nextOptions: GotOptions & Url) => void): this; prependListener(event: 'error', listener: (error: GotError, body?: any, res?: http.IncomingMessage) => void): this; + prependListener(event: 'downloadProgress', listener: (progress: Progress) => void): this; + prependListener(event: 'uploadProgress', listener: (progress: Progress) => void): this; prependOnceListener(event: 'request', listener: (req: http.ClientRequest) => void): this; prependOnceListener(event: 'response', listener: (res: http.IncomingMessage) => void): this; prependOnceListener(event: 'redirect', listener: (res: http.IncomingMessage, nextOptions: GotOptions & Url) => void): this; prependOnceListener(event: 'error', listener: (error: GotError, body?: any, res?: http.IncomingMessage) => void): this; + prependOnceListener(event: 'downloadProgress', listener: (progress: Progress) => void): this; + prependOnceListener(event: 'uploadProgress', listener: (progress: Progress) => void): this; removeListener(event: 'request', listener: (req: http.ClientRequest) => void): this; removeListener(event: 'response', listener: (res: http.IncomingMessage) => void): this; removeListener(event: 'redirect', listener: (res: http.IncomingMessage, nextOptions: GotOptions & Url) => void): this; removeListener(event: 'error', listener: (error: GotError, body?: any, res?: http.IncomingMessage) => void): this; + removeListener(event: 'downloadProgress', listener: (progress: Progress) => void): this; + removeListener(event: 'uploadProgress', listener: (progress: Progress) => void): this; } - type GotError = RequestError | ReadError | ParseError | HTTPError | MaxRedirectsError | UnsupportedProtocolError; + type GotError = RequestError | ReadError | ParseError | HTTPError | MaxRedirectsError | UnsupportedProtocolError | CancelError; + + interface Progress { + percent: number; + transferred: number; + total: number | null; + } } From 42c65bb609fd847132e78ba9ffe30d016a8b724b Mon Sep 17 00:00:00 2001 From: Lucas Terra Date: Wed, 18 Apr 2018 13:59:23 -0300 Subject: [PATCH 0727/2153] [recompose] Add aliases to recompose sub modules. (#25069) --- types/recompose/index.d.ts | 249 +++++++++++++++++++++++++++- types/recompose/recompose-tests.tsx | 42 +++++ 2 files changed, 290 insertions(+), 1 deletion(-) diff --git a/types/recompose/index.d.ts b/types/recompose/index.d.ts index c057521570..222f0ed539 100644 --- a/types/recompose/index.d.ts +++ b/types/recompose/index.d.ts @@ -1,9 +1,10 @@ -// Type definitions for Recompose 0.24 +// Type definitions for Recompose 0.26 // Project: https://github.com/acdlite/recompose // Definitions by: Iskander Sierra // Samuel DeSota // Curtis Layne // Rasmus Eneman +// Lucas Terra // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -453,3 +454,249 @@ declare module 'recompose/kefirObservableConfig' { export default kefirConfig; } + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#mapprops +declare module 'recompose/mapProps' { + import { mapProps } from 'recompose'; + export default mapProps; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#withprops +declare module 'recompose/withProps' { + import { withProps } from 'recompose'; + export default withProps; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#withpropsonchange +declare module 'recompose/withPropsOnChange' { + import { withPropsOnChange } from 'recompose'; + export default withPropsOnChange; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#withhandlers +declare module 'recompose/withHandlers' { + import { withHandlers } from 'recompose'; + export default withHandlers; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#defaultprops +declare module 'recompose/defaultProps' { + import { defaultProps } from 'recompose'; + export default defaultProps; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#renameprop +declare module 'recompose/renameProp' { + import { renameProp } from 'recompose'; + export default renameProp; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#renameprops +declare module 'recompose/renameProps' { + import { renameProps } from 'recompose'; + export default renameProps; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#flattenprop +declare module 'recompose/flattenProp' { + import { flattenProp } from 'recompose'; + export default flattenProp; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#withstate +declare module 'recompose/withState' { + import { withState } from 'recompose'; + export default withState; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#withstatehandlers +declare module 'recompose/withStateHandlers' { + import { withStateHandlers } from 'recompose'; + export default withStateHandlers; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#withreducer +declare module 'recompose/withReducer' { + import { withReducer } from 'recompose'; + export default withReducer; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#branch +declare module 'recompose/branch' { + import { branch } from 'recompose'; + export default branch; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#rendercomponent +declare module 'recompose/renderComponent' { + import { renderComponent } from 'recompose'; + export default renderComponent; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#rendernothing +declare module 'recompose/renderNothing' { + import { renderNothing } from 'recompose'; + export default renderNothing; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#shouldupdate +declare module 'recompose/shouldUpdate' { + import { shouldUpdate } from 'recompose'; + export default shouldUpdate; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#pure +declare module 'recompose/pure' { + import { pure } from 'recompose'; + export default pure; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#onlyupdateforkeys +declare module 'recompose/onlyUpdateForKeys' { + import { onlyUpdateForKeys } from 'recompose'; + export default onlyUpdateForKeys; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#onlyupdateforproptypes +declare module 'recompose/onlyUpdateForPropTypes' { + import { onlyUpdateForPropTypes } from 'recompose'; + export default onlyUpdateForPropTypes; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#withcontext +declare module 'recompose/withContext' { + import { withContext } from 'recompose'; + export default withContext; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#getcontext +declare module 'recompose/getContext' { + import { getContext } from 'recompose'; + export default getContext; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#lifecycle +declare module 'recompose/lifecycle' { + import { lifecycle } from 'recompose'; + export default lifecycle; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#toclass +declare module 'recompose/toClass' { + import { toClass } from 'recompose'; + export default toClass; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#setstatic +declare module 'recompose/setStatic' { + import { setStatic } from 'recompose'; + export default setStatic; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#setproptypes +declare module 'recompose/setPropTypes' { + import { setPropTypes } from 'recompose'; + export default setPropTypes; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#setdisplayname +declare module 'recompose/setDisplayName' { + import { setDisplayName } from 'recompose'; + export default setDisplayName; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#compose +declare module 'recompose/compose' { + import { compose } from 'recompose'; + export default compose; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#getdisplayname +declare module 'recompose/getDisplayName' { + import { getDisplayName } from 'recompose'; + export default getDisplayName; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#wrapdisplayname +declare module 'recompose/wrapDisplayName' { + import { wrapDisplayName } from 'recompose'; + export default wrapDisplayName; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#shallowequal +declare module 'recompose/shallowEqual' { + import { shallowEqual } from 'recompose'; + export default shallowEqual; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#isclasscomponent +declare module 'recompose/isClassComponent' { + import { isClassComponent } from 'recompose'; + export default isClassComponent; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#createsink +declare module 'recompose/createSink' { + import { createSink } from 'recompose'; + export default createSink; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#componentfromprop +declare module 'recompose/componentFromProp' { + import { componentFromProp } from 'recompose'; + export default componentFromProp; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#nest +declare module 'recompose/nest' { + import { nest } from 'recompose'; + export default nest; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#hoiststatics +declare module 'recompose/hoistStatics' { + import { hoistStatics } from 'recompose'; + export default hoistStatics; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#componentfromstream +declare module 'recompose/componentFromStream' { + import { componentFromStream } from 'recompose'; + export default componentFromStream; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#componentfromstreamwithconfig +declare module 'recompose/componentFromStreamWithConfig' { + import { componentFromStreamWithConfig } from 'recompose'; + export default componentFromStreamWithConfig; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#mappropsstream +declare module 'recompose/mapPropsStream' { + import { mapPropsStream } from 'recompose'; + export default mapPropsStream; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#mappropsstreamwithconfig +declare module 'recompose/mapPropsStreamWithConfig' { + import { mapPropsStreamWithConfig } from 'recompose'; + export default mapPropsStreamWithConfig; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#createeventhandler +declare module 'recompose/createEventHandler' { + import { createEventHandler } from 'recompose'; + export default createEventHandler; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#createeventhandlerwithconfig +declare module 'recompose/createEventHandlerWithConfig' { + import { createEventHandlerWithConfig } from 'recompose'; + export default createEventHandlerWithConfig; +} + +// https://github.com/acdlite/recompose/blob/master/docs/API.md#setobservableconfig +declare module 'recompose/setObservableConfig' { + import { setObservableConfig } from 'recompose'; + export default setObservableConfig; +} diff --git a/types/recompose/recompose-tests.tsx b/types/recompose/recompose-tests.tsx index c239cbacb1..75d64b468d 100644 --- a/types/recompose/recompose-tests.tsx +++ b/types/recompose/recompose-tests.tsx @@ -28,6 +28,48 @@ import xstreamConfig from "recompose/xstreamObservableConfig"; import baconConfig from "recompose/baconObservableConfig"; import kefirConfig from "recompose/kefirObservableConfig"; +import mapPropsStandalone from "recompose/mapProps"; +import withPropsStandalone from "recompose/withProps"; +import withPropsOnChangeStandalone from "recompose/withPropsOnChange"; +import withHandlersStandalone from "recompose/withHandlers"; +import defaultPropsStandalone from "recompose/defaultProps"; +import renamePropStandalone from "recompose/renameProp"; +import renamePropsStandalone from "recompose/renameProps"; +import flattenPropStandalone from "recompose/flattenProp"; +import withStateStandalone from "recompose/withState"; +import withStateHandlersStandalone from "recompose/withStateHandlers"; +import withReducerStandalone from "recompose/withReducer"; +import branchStandalone from "recompose/branch"; +import renderComponentStandalone from "recompose/renderComponent"; +import renderNothingStandalone from "recompose/renderNothing"; +import shouldUpdateStandalone from "recompose/shouldUpdate"; +import pureStandalone from "recompose/pure"; +import onlyUpdateForKeysStandalone from "recompose/onlyUpdateForKeys"; +import onlyUpdateForPropTypesStandalone from "recompose/onlyUpdateForPropTypes"; +import withContextStandalone from "recompose/withContext"; +import getContextStandalone from "recompose/getContext"; +import lifecycleStandalone from "recompose/lifecycle"; +import toClassStandalone from "recompose/toClass"; +import setStaticStandalone from "recompose/setStatic"; +import setPropTypesStandalone from "recompose/setPropTypes"; +import setDisplayNameStandalone from "recompose/setDisplayName"; +import composeStandalone from "recompose/compose"; +import getDisplayNameStandalone from "recompose/getDisplayName"; +import wrapDisplayNameStandalone from "recompose/wrapDisplayName"; +import shallowEqualStandalone from "recompose/shallowEqual"; +import isClassComponentStandalone from "recompose/isClassComponent"; +import createSinkStandalone from "recompose/createSink"; +import componentFromPropStandalone from "recompose/componentFromProp"; +import nestStandalone from "recompose/nest"; +import hoistStaticsStandalone from "recompose/hoistStatics"; +import componentFromStreamStandalone from "recompose/componentFromStream"; +import componentFromStreamWithConfigStandalone from "recompose/componentFromStreamWithConfig"; +import mapPropsStreamStandalone from "recompose/mapPropsStream"; +import mapPropsStreamWithConfigStandalone from "recompose/mapPropsStreamWithConfig"; +import createEventHandlerStandalone from "recompose/createEventHandler"; +import createEventHandlerWithConfigStandalone from "recompose/createEventHandlerWithConfig"; +import setObservableConfigStandalone from "recompose/setObservableConfig"; + function testMapProps() { interface InnerProps { inn: number From a8de5cf374997d843a70cbbbe8c306f048a79d72 Mon Sep 17 00:00:00 2001 From: Bruno Lemos Date: Wed, 18 Apr 2018 15:25:23 -0300 Subject: [PATCH 0728/2153] [react-native] Add missing layout props (#25081) borderEndWidth, borderStartWidth, display, end, marginEnd, marginStart, paddingEnd, paddingStart, start https://github.com/facebook/react-native/blob/master/Libraries/StyleSheet/LayoutPropTypes.js --- types/react-native/index.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 4e48a85ba2..e42f1f2055 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -544,11 +544,15 @@ export interface FlexStyle { alignSelf?: "auto" | FlexAlignType; aspectRatio?: number; borderBottomWidth?: number; + borderEndWidth?: number | string; borderLeftWidth?: number; borderRightWidth?: number; + borderStartWidth?: number | string; borderTopWidth?: number; borderWidth?: number; bottom?: number | string; + display?: "none" | "flex"; + end?: number | string; flex?: number; flexBasis?: number | string; flexDirection?: "row" | "column" | "row-reverse" | "column-reverse"; @@ -560,9 +564,11 @@ export interface FlexStyle { left?: number | string; margin?: number | string; marginBottom?: number | string; + marginEnd?: number | string; marginHorizontal?: number | string; marginLeft?: number | string; marginRight?: number | string; + marginStart?: number | string; marginTop?: number | string; marginVertical?: number | string; maxHeight?: number | string; @@ -572,13 +578,16 @@ export interface FlexStyle { overflow?: "visible" | "hidden" | "scroll"; padding?: number | string; paddingBottom?: number | string; + paddingEnd?: number | string; paddingHorizontal?: number | string; paddingLeft?: number | string; paddingRight?: number | string; + paddingStart?: number | string; paddingTop?: number | string; paddingVertical?: number | string; position?: "absolute" | "relative"; right?: number | string; + start?: number | string; top?: number | string; width?: number | string; zIndex?: number; From b244b1661a205bfb7d15d545c8a0178132b2d75d Mon Sep 17 00:00:00 2001 From: Jarom Loveridge Date: Wed, 18 Apr 2018 12:25:46 -0600 Subject: [PATCH 0729/2153] Add additional SSL configuration options. (#25079) http://mongodb.github.io/node-mongodb-native/3.0/api/Server.html --- types/mongoose/index.d.ts | 20 ++++++++++++++++++++ types/mongoose/mongoose-tests.ts | 19 +++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index d8ffa046e9..723a88bdf8 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -326,6 +326,26 @@ declare module "mongoose" { /** How long driver keeps waiting for servers to come back up (default: Number.MAX_VALUE) */ bufferMaxEntries?: number; + /** additional SSL configuration options */ + /** Array of valid certificates either as Buffers or Strings */ + sslCA?: ReadonlyArray; + /** Array of revocation certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher) */ + sslCRL?: ReadonlyArray; + /** SSL certificate */ + sslCert?: Buffer | string; + /** SSL private key */ + sslKey?: Buffer | string; + /** SSL Certificate pass phrase */ + sslPass?: Buffer | string; + /** Default: true; Server identity checking during SSL */ + checkServerIdentity?: boolean | Function; + /** String containing the server name requested via TLS SNI. */ + servername?: string; + + /** Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info. */ + ciphers?: string; + ecdhCurve?: string; + // TODO safe?: any; fsync?: any; diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index 244658ac9b..d6fbe3cd82 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -65,6 +65,25 @@ mongoose.Types.ObjectId; mongoose.Types.Decimal128; mongoose.version.toLowerCase(); +const sslConnections: {[key: string]: mongoose.Connection} = { + basic: mongoose.createConnection(connectUri, {ssl: true}), + customCA: mongoose.createConnection( + connectUri, + { + ssl: true, + sslCA: [new Buffer('ca string')], + sslCRL: [new Buffer('crl buffer')], + sslCert: 'ssl cert', + sslKey: new Buffer('ssl private key'), + sslPass: 'ssl password', + servername: 'localhost', + checkServerIdentity: true, + ciphers: 'ciphers', + ecdhCurve: 'ecdhCurve', + } + ), +}; + /* * section collection.js * http://mongoosejs.com/docs/api.html#collection-js From 05650a7853db6ebd51879d73f72916b3c3ec36ca Mon Sep 17 00:00:00 2001 From: Jarom Loveridge Date: Wed, 18 Apr 2018 12:26:14 -0600 Subject: [PATCH 0730/2153] Add `models` hash object. (#25078) --- types/mongoose/index.d.ts | 5 +++++ types/mongoose/mongoose-tests.ts | 2 ++ 2 files changed, 7 insertions(+) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 723a88bdf8..7363701f2f 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -72,6 +72,8 @@ declare module "mongoose" { export var STATES: any; /** The default connection of the mongoose module. */ export var connection: Connection; + /** Models registred on the default mongoose connection. */ + export var models: { [index: string]: Model }; /** The node-mongodb-native driver Mongoose uses. */ export var mongo: typeof mongodb; /** The Mongoose version */ @@ -254,6 +256,9 @@ declare module "mongoose" { /** A hash of the collections associated with this connection */ collections: { [index: string]: Collection }; + /** A hash of models registered with this connection */ + models: { [index: string]: Model }; + /** * Connection ready state * 0 = disconnected diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index d6fbe3cd82..a6fe9f406a 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -51,6 +51,7 @@ mongoose.model('Actor', new mongoose.Schema({ }), 'collectionName', true).find({}); mongoose.model('Actor').find({}); mongoose.modelNames()[0].toLowerCase(); +mongoose.models.Actor.findOne({}).exec(); new (new mongoose.Mongoose(9, 8, 7)).Mongoose(1, 2, 3).connect(''); mongoose.plugin(cb, {}).connect(''); mongoose.set('test', 'value'); @@ -131,6 +132,7 @@ conn1.openSet('mongodb://localhost/test', 'db', { conn1.close().catch(function (err) {}); conn1.collection('name').$format(999); conn1.model('myModel', new mongoose.Schema({}), 'myCol').find(); +conn1.models.myModel.findOne().exec(); interface IStatics { staticMethod1: (a: number) => string; } From 658cdc180f1b4399019c946d1082c2ac6ab82592 Mon Sep 17 00:00:00 2001 From: Denis Tokarev Date: Wed, 18 Apr 2018 20:28:34 +0200 Subject: [PATCH 0731/2153] iScroll: Update types for zoom-related functionality (#25090) * iScroll: zoom takes scale as first parameter iScroll's zoom() method takes scale as the first parameter. The rest parameters are optional according to the documentation: https://github.com/cubiq/iscroll#zoomscale-x-y-time * iScroll: Update tests Update tests for iScroll to reflect the changes * iScroll: iScroll instance has 'scale' public numeric property --- types/iscroll/index.d.ts | 5 +++-- types/iscroll/iscroll-tests.ts | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/types/iscroll/index.d.ts b/types/iscroll/index.d.ts index 13cd83cf99..1ba48227fe 100644 --- a/types/iscroll/index.d.ts +++ b/types/iscroll/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for iScroll 5.2 // Project: http://cubiq.org/iscroll-5-ready-for-beta-test -// Definitions by: Christiaan Rakowski +// Definitions by: Christiaan Rakowski , Denis Tokarev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface IScrollOptions { @@ -81,6 +81,7 @@ declare class IScroll { x: number; y: number; + scale: number; destroy(): void; refresh(): void; @@ -92,7 +93,7 @@ declare class IScroll { disable(): void; enable(): void; stop(): void; - zoom(x: number, y: number, scale: number, time?: number): void; + zoom(scale: number, x?: number, y?: number, time?: number): void; isReady(): boolean; // Events diff --git a/types/iscroll/iscroll-tests.ts b/types/iscroll/iscroll-tests.ts index 7bb8604937..4d7b71f93a 100644 --- a/types/iscroll/iscroll-tests.ts +++ b/types/iscroll/iscroll-tests.ts @@ -24,6 +24,11 @@ myScroll1.scrollTo(0, 100); myScroll1.scrollTo(0, 100, 200); myScroll1.scrollTo(0, 100, 200, true); +myScroll1.zoom(1); +myScroll1.zoom(-1); +myScroll1.zoom(1, 100, 200); +myScroll1.zoom(1, 200, 250, 100); + myScroll1.scrollToElement('selectedElement'); myScroll1.scrollToElement('selectedElement', 250); From e1894fb7e98283ece14287b7c928d835abe0e3f1 Mon Sep 17 00:00:00 2001 From: Atanas Atanasov Date: Wed, 18 Apr 2018 22:32:45 +0300 Subject: [PATCH 0732/2153] upgrade gijgo typings to version 1.9.6 (#25093) --- types/gijgo/index.d.ts | 58 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/types/gijgo/index.d.ts b/types/gijgo/index.d.ts index 188d8753b1..611373be11 100644 --- a/types/gijgo/index.d.ts +++ b/types/gijgo/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Gijgo v1.8.2 +// Type definitions for Gijgo v1.9.6 // Project: http://gijgo.com // Definitions by: Atanas Atanasov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -88,6 +88,7 @@ declare module Types { //Configuration options autoGenerateColumns?: boolean; autoLoad?: boolean; + bodyRowHeight?: string; columnReorder?: boolean; columns?: Array; dataSource?: any; @@ -97,6 +98,7 @@ declare module Types { fontSize?: string; grouping?: GridGrouping; headerFilter?: GridHeaderFilter; + headerRowHeight?: string; icons?: GridIcons; iconsLibrary?: string; inlineEditing?: GridInlineEditing; @@ -158,7 +160,7 @@ declare module Types { edit(id: string): Grid; expandAll(): Grid; //get(position: number): Entity; //TODO: rename to getByPosition to avoid conflicts with jquery.get - getAll(): Array; + getAll(includeAllRecords?: boolean): Array; getById(id: string): Entity; getChanges(): Array; getCSV(includeAllRecords?: boolean): string; @@ -256,11 +258,16 @@ declare module Types { keyboardNavigation?: boolean; locale?: string; icons?: DatePickerIcons; + size?: string; + modal?: boolean; + header?: boolean; + footer?: boolean; //Events change?: (e: any) => any; open?: (e: any) => any; close?: (e: any) => any; + select?: (e: any, type: string) => any; } interface DatePicker extends JQuery { @@ -285,6 +292,7 @@ declare module Types { uiLibrary?: string; iconsLibrary?: string; icons?: DropDownIcons; + placeholder?: string; //Events change?: (e: any) => any; @@ -325,11 +333,13 @@ declare module Types { value?: string; mode?: string; locale?: string; + size?: string; //Events change?: (e: any) => any; open?: (e: any) => any; close?: (e: any) => any; + select?: (e: any, type: string) => any; } interface TimePicker extends JQuery { @@ -339,6 +349,45 @@ declare module Types { value(value?: string): string | TimePicker; } + // DateTimePicker + interface DateTimePickerSettings { + datepicker?: Types.DatePickerSettings; + footer?: boolean; + format?: string; + locale?: string; + modal?: boolean; + size?: string; + uiLibrary?: string; + value?: string; + width?: number; + + //Events + change?: (e: any) => any; + } + + interface DateTimePicker extends JQuery { + destroy(): void; + value(value?: string): string | DateTimePicker; + } + + // Slider + interface SliderSettings { + min?: number; + max?: number; + uiLibrary?: string; + value?: string; + width?: number; + + //Events + change?: (e: any) => any; + slide?: (e: any, value: number) => any; + } + + interface Slider extends JQuery { + destroy(): void; + value(value?: string): string | Slider; + } + // Tree interface TreeIcons { expand?: string; @@ -397,6 +446,7 @@ declare module Types { render(response: any): any; addNode(data: any, parentNode: any, position: number): Tree; removeNode(node: any): Tree; + updateNode(id: string, record: any) : Tree; destroy(): void; expand(node: any, cascade: boolean): Tree; collapse(node: any, cascade: boolean) : Tree; @@ -444,5 +494,9 @@ interface JQuery { timepicker(settings: Types.TimePickerSettings): Types.TimePicker; + datetimepicker(settings: Types.DateTimePickerSettings): Types.DateTimePicker; + + slider(settings: Types.SliderSettings): Types.Slider; + tree(settings: Types.TreeSettings): Types.Tree; } From 6b7871531fd192478830c7bf5b06443bd9b87ad8 Mon Sep 17 00:00:00 2001 From: Pupskuchen Date: Wed, 18 Apr 2018 21:33:39 +0200 Subject: [PATCH 0733/2153] iframe-resizer: fix options property type (#24970) * fix iframe-resizer options property type add string as valid value type for bodyMargin * iframe-resizer: change spacing --- types/iframe-resizer/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/iframe-resizer/index.d.ts b/types/iframe-resizer/index.d.ts index 70d9c1d4f3..3858cab780 100644 --- a/types/iframe-resizer/index.d.ts +++ b/types/iframe-resizer/index.d.ts @@ -31,7 +31,7 @@ export interface IFrameOptions { * Override the default body margin style in the iFrame. A string can be any valid value for the * CSS margin attribute, for example '8px 3em'. A number value is converted into px. */ - bodyMargin?: number; + bodyMargin?: number | string; /** * When set to true, only allow incoming messages from the domain listed in the src property of the iFrame tag. * If your iFrame navigates between different domains, ports or protocols; then you will need to From 38c005479f4b4e392b212a6a8cdc7315574c239f Mon Sep 17 00:00:00 2001 From: Troy Lamerton Date: Wed, 18 Apr 2018 21:34:15 +0200 Subject: [PATCH 0734/2153] add scope(s) to authorization code flow (#25096) --- types/simple-oauth2/index.d.ts | 16 +++++++++------- types/simple-oauth2/simple-oauth2-tests.ts | 3 ++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/types/simple-oauth2/index.d.ts b/types/simple-oauth2/index.d.ts index b93bbc229f..f5f7659b99 100644 --- a/types/simple-oauth2/index.d.ts +++ b/types/simple-oauth2/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for simple-oauth2 1.1 // Project: https://github.com/lelylan/simple-oauth2 -// Definitions by: [Michael Müller] +// Definitions by: Michael Müller , +// Troy Lamerton // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -64,6 +65,7 @@ export type AuthorizationCode = string; export interface AuthorizationTokenConfig { code: AuthorizationCode; redirect_uri: string; + scope?: string | string[]; } export interface PasswordTokenConfig { @@ -71,13 +73,13 @@ export interface PasswordTokenConfig { username: string; /** A string that represents the registered password. */ password: string; - /** A string that represents the application privileges */ - scope: string; + /** A string or array of strings that represents the application privileges */ + scope: string | string[]; } export interface ClientCredentialTokenConfig { /** A string that represents the application privileges */ - scope?: string; + scope?: string | string[]; } export interface OAuthClient { @@ -89,9 +91,9 @@ export interface OAuthClient { authorizeURL(params?: { /** A string that represents the registered application URI where the user is redirected after authentication */ redirect_uri?: string, - /** A String that represents the application privileges */ - scope?: string, - /** A String that represents an option opaque value used by the client to main the state between the request and the callback */ + /** A string or array of strings that represents the application privileges */ + scope?: string | string[], + /** A string that represents an option opaque value used by the client to main the state between the request and the callback */ state?: string }): string, diff --git a/types/simple-oauth2/simple-oauth2-tests.ts b/types/simple-oauth2/simple-oauth2-tests.ts index 713d930f23..f83a616681 100644 --- a/types/simple-oauth2/simple-oauth2-tests.ts +++ b/types/simple-oauth2/simple-oauth2-tests.ts @@ -32,7 +32,8 @@ const oauth2 = oauth2lib.create(credentials); // Get the access token object (the authorization code is given from the previous step). const tokenConfig = { code: '', - redirect_uri: 'http://localhost:3000/callback' + redirect_uri: 'http://localhost:3000/callback', + scope: ['', ''] }; // Callbacks From 589a7cff2151802998340fc5ef0f385da4503766 Mon Sep 17 00:00:00 2001 From: Hendrik Schaeidt Date: Wed, 18 Apr 2018 21:34:35 +0200 Subject: [PATCH 0735/2153] linkify-it: fix typings to reflect the api (#25102) * the constructor accepts as first parameter or the SchemaRules or the Options * the validate callback can be either a string, RegExp or Validate type * Rule only accepts a string or a FullRule, where when a string is set, it applies the same rules as the given schema name * add more tests to showcase and type test the implementation --- types/linkify-it/index.d.ts | 74 +++++++++++++++------------- types/linkify-it/linkify-it-tests.ts | 44 +++++++++++++---- 2 files changed, 75 insertions(+), 43 deletions(-) diff --git a/types/linkify-it/index.d.ts b/types/linkify-it/index.d.ts index f361d88bba..e3696e09c4 100644 --- a/types/linkify-it/index.d.ts +++ b/types/linkify-it/index.d.ts @@ -4,47 +4,55 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare const LinkifyIt: { - (schemas?: LinkifyIt.SchemaRules, options?: LinkifyIt.Options): LinkifyIt.LinkifyIt; - new (schemas?: LinkifyIt.SchemaRules, options?: LinkifyIt.Options): LinkifyIt.LinkifyIt; + ( + schemas?: LinkifyIt.SchemaRules | LinkifyIt.Options, + options?: LinkifyIt.Options + ): LinkifyIt.LinkifyIt; + new ( + schemas?: LinkifyIt.SchemaRules | LinkifyIt.Options, + options?: LinkifyIt.Options + ): LinkifyIt.LinkifyIt; }; declare namespace LinkifyIt { - interface FullRule { - validate(text: string, pos: number, self: LinkifyIt): number; - normalize?(match: string): string; - } + type Validate = (text: string, pos: number, self: LinkifyIt) => number; - type Rule = string | RegExp | FullRule; + interface FullRule { + validate: string | RegExp | Validate; + normalize?(match: string): string; + } - interface SchemaRules { - [schema: string]: Rule; - } + type Rule = string | FullRule; - interface Options { - fuzzyLink?: boolean; - fuzzyIP?: boolean; - fuzzyEmail?: boolean; - } + interface SchemaRules { + [schema: string]: Rule; + } - interface Match { - index: number; - lastIndex: number; - raw: string; - schema: string; - text: string; - url: string; - } + interface Options { + fuzzyLink?: boolean; + fuzzyIP?: boolean; + fuzzyEmail?: boolean; + } - interface LinkifyIt { - add(schema: string, rule: Rule): LinkifyIt; - match(text: string): Match[]; - normalize(raw: string): string; - pretest(text: string): boolean; - set(options: Options): LinkifyIt; - test(text: string): boolean; - testSchemaAt(text: string, schemaName: string, pos: number): number; - tlds(list: string | string[], keepOld?: boolean): LinkifyIt; - } + interface Match { + index: number; + lastIndex: number; + raw: string; + schema: string; + text: string; + url: string; + } + + interface LinkifyIt { + add(schema: string, rule: Rule): LinkifyIt; + match(text: string): Match[]; + normalize(raw: string): string; + pretest(text: string): boolean; + set(options: Options): LinkifyIt; + test(text: string): boolean; + testSchemaAt(text: string, schemaName: string, pos: number): number; + tlds(list: string | string[], keepOld?: boolean): LinkifyIt; + } } export = LinkifyIt; diff --git a/types/linkify-it/linkify-it-tests.ts b/types/linkify-it/linkify-it-tests.ts index c4366321cf..1768bd5efb 100644 --- a/types/linkify-it/linkify-it-tests.ts +++ b/types/linkify-it/linkify-it-tests.ts @@ -1,24 +1,48 @@ -import LinkifyIt = require('linkify-it'); +import LinkifyIt = require("linkify-it"); + +// constructor formats +const linkifier = new LinkifyIt(); +const withOptions = new LinkifyIt({ fuzzyLink: false }); +const withSchema = new LinkifyIt( + { + "myCustom:": { + validate: /23/ + }, + "other:": { + validate: (text, pos, self) => 42 + }, + "git:": "http:" + }, + { + fuzzyIP: false, + fuzzyLink: false + } +); // fluent interface -const linkifier = new LinkifyIt(); - linkifier - .add('git:', 'http:') + .add("git:", "http:") .set({ fuzzyIP: true }) - .tlds('onion', true) + .tlds("onion", true) .test("https://github.com/DefinitelyTyped/DefinitelyTyped/"); // match -const matches = linkifier.match("https://github.com/DefinitelyTyped/DefinitelyTyped/"); -matches.forEach(({index, lastIndex, raw, schema, text, url}) => {}); +const matches = linkifier.match( + "https://github.com/DefinitelyTyped/DefinitelyTyped/" +); +matches.forEach(({ index, lastIndex, raw, schema, text, url }) => {}); // complex rule -linkifier.add('@', { +linkifier.add("@", { validate: (text, pos, self) => { return 42; }, - normalize: (match) => { - return 'forty-two'; + normalize: match => { + return "forty-two"; } }); + +// regexp rule +linkifier.add("custom:", { + validate: /^\/\/\d+/ +}); From 31b8246a65d5485ef71ab1f2a31db568044e178b Mon Sep 17 00:00:00 2001 From: Clark Stevenson Date: Wed, 18 Apr 2018 20:36:54 +0100 Subject: [PATCH 0736/2153] Update Pixi.js to 4.7.3 (#25091) --- types/pixi.js/index.d.ts | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/types/pixi.js/index.d.ts b/types/pixi.js/index.d.ts index f503867b5b..d4f1097601 100644 --- a/types/pixi.js/index.d.ts +++ b/types/pixi.js/index.d.ts @@ -319,7 +319,7 @@ declare namespace PIXI { buttonMode: boolean; cursor: string; trackedPointers(): { [key: number]: interaction.InteractionTrackingData; }; - // depricated + // Deprecated defaultCursor: string; // end interactive target @@ -775,12 +775,12 @@ declare namespace PIXI { legacy?: boolean; /** - * Depricated + * Deprecated */ context?: WebGLRenderingContext; /** - * Depricated + * Deprecated */ autoResize?: boolean; @@ -1116,6 +1116,8 @@ declare namespace PIXI { } class FilterManager extends WebGLManager { constructor(renderer: WebGLRenderer); + protected _screenWidth: number; + protected _screenHeight: number; gl: WebGLRenderingContext; quad: Quad; stack: FilterManagerStackItem[]; @@ -1123,6 +1125,7 @@ declare namespace PIXI { shaderCache: any; filterData: any; + onPrerender(): void; pushFilter(target: RenderTarget, filters: Array>): void; popFilter(): void; applyFilter(shader: glCore.GLShader | Filter, inputTarget: RenderTarget, outputTarget: RenderTarget, clear?: boolean): void; @@ -1185,7 +1188,7 @@ declare namespace PIXI { // name is set by pixi if uniforms were automatically extracted from shader code, but not used anywhere name?: string; } - type UniformDataMap = {[K in keyof U]: UniformData}; + type UniformDataMap = { [K in keyof U]: UniformData }; class Filter { constructor(vertexSrc?: string, fragmentSrc?: string, uniforms?: UniformDataMap); @@ -2041,7 +2044,7 @@ declare namespace PIXI { cursor: string; trackedPointers(): { [key: number]: InteractionTrackingData; }; - // depricated + // Deprecated defaultCursor: string; } interface InteractionTrackingData { @@ -2159,7 +2162,7 @@ declare namespace PIXI { protected normalizeToPointerData(event: TouchEvent | MouseEvent | PointerEvent): PointerEvent[]; destroy(): void; - // depricated + // Deprecated defaultCursorStyle: string; currentCursorStyle: string; } @@ -2554,7 +2557,8 @@ declare namespace PIXI { protected _maxSize: number; protected _batchSize: number; protected _glBuffers: { [n: number]: WebGLBuffer; }; - protected _bufferToUpdate: number; + protected _bufferUpdateIDs: number[]; + protected _updateID: number; interactiveChildren: boolean; blendMode: number; autoSize: boolean; @@ -2582,6 +2586,8 @@ declare namespace PIXI { dynamicData: any; dynamicDataUint32: any; + protected _updateID: number; + destroy(): void; } interface ParticleRendererProperty { @@ -2867,6 +2873,8 @@ declare namespace PIXI { function sign(n: number): number; function removeItems(arr: T[], startIdx: number, removeCount: number): void; function correctBlendMode(blendMode: number, premultiplied: boolean): number; + function clearTextureCache(): void; + function destroyTextureCache(): void; function premultiplyTint(tint: number, alpha: number): number; function premultiplyRgba(rgb: Float32Array | number[], alpha: number, out?: Float32Array, premultiply?: boolean): Float32Array; function premultiplyTintToRgba(tint: number, alpha: number, out?: Float32Array, premultiply?: boolean): Float32Array; From 3cb9ea62c06f483ed432a80876b0b6be9f683ca3 Mon Sep 17 00:00:00 2001 From: Vytautas Strimaitis Date: Wed, 18 Apr 2018 22:44:05 +0300 Subject: [PATCH 0737/2153] Add type definitions for react-credit-cards (#25106) * Added type definitions for react-credit-cards * Lint fixes * Use ReadonlyArray --- types/react-credit-cards/index.d.ts | 31 +++++++++++++++++++ .../react-credit-cards-tests.tsx | 22 +++++++++++++ types/react-credit-cards/tsconfig.json | 25 +++++++++++++++ types/react-credit-cards/tslint.json | 1 + 4 files changed, 79 insertions(+) create mode 100644 types/react-credit-cards/index.d.ts create mode 100644 types/react-credit-cards/react-credit-cards-tests.tsx create mode 100644 types/react-credit-cards/tsconfig.json create mode 100644 types/react-credit-cards/tslint.json diff --git a/types/react-credit-cards/index.d.ts b/types/react-credit-cards/index.d.ts new file mode 100644 index 0000000000..bc9a8fbf51 --- /dev/null +++ b/types/react-credit-cards/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for react-credit-cards 0.7 +// Project: https://github.com/amarofashion/react-credit-cards +// Definitions by: Vytautas Strimaitis +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +import * as React from "react"; + +export interface CallbackArgument { + isValid: boolean; + type: { issuer: string; maxLength: number; }; +} + +export interface ReactCreditCardProps { + acceptedCards?: ReadonlyArray; + callback?: (type: CallbackArgument, isValid: boolean) => void; + cvc: string | number; + expiry: string | number; + focused?: "name" | "number" | "expiry" | "cvc"; + issuer?: string; + locale?: { valid: string; }; + name: string; + number: string | number; + placeholders?: { name: string; }; + preview?: boolean; +} + +declare class ReactCreditCard extends React.Component { +} + +export default ReactCreditCard; diff --git a/types/react-credit-cards/react-credit-cards-tests.tsx b/types/react-credit-cards/react-credit-cards-tests.tsx new file mode 100644 index 0000000000..8e1a92f002 --- /dev/null +++ b/types/react-credit-cards/react-credit-cards-tests.tsx @@ -0,0 +1,22 @@ +import * as React from "react"; +import Card, { CallbackArgument, ReactCreditCardProps } from "react-credit-cards"; + +const defaultProps: ReactCreditCardProps = { + acceptedCards: [], + callback: (type: CallbackArgument, isValid: boolean) => {}, + cvc: "123", + expiry: "04/18", + focused: "number", + issuer: "visa", + locale: {valid: "valid through"}, + name: "Name Surname", + number: "4111111111111111", + placeholders: {name: "YOUR NAME"}, + preview: true +}; + +class CardTest extends React.Component { + render() { + return (); + } +} diff --git a/types/react-credit-cards/tsconfig.json b/types/react-credit-cards/tsconfig.json new file mode 100644 index 0000000000..b011d560b5 --- /dev/null +++ b/types/react-credit-cards/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-credit-cards-tests.tsx" + ] +} diff --git a/types/react-credit-cards/tslint.json b/types/react-credit-cards/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-credit-cards/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From eabc8ca7627c57a7de6ce798c3f1671c4535fe6c Mon Sep 17 00:00:00 2001 From: Su-Shing Chen Date: Thu, 19 Apr 2018 07:45:15 +1200 Subject: [PATCH 0738/2153] [@types/when] Make when.js promises compatible with native promises (#24904) * Make when.js promises compatible with native promises * Stricter compiler options and fix revealed issues - Remove optional parameters from callbacks - Replace `Number` type with `number` - Improve type checking of when.settle and promise.inspect * Add stricter types and backwards compatibility * Minor renaming --- types/when/index.d.ts | 70 ++++++++++++++++++++++++++++------------ types/when/tsconfig.json | 6 ++-- types/when/when-tests.ts | 70 ++++++++++++++++++++++++++++++++++++---- 3 files changed, 115 insertions(+), 31 deletions(-) diff --git a/types/when/index.d.ts b/types/when/index.d.ts index a459e031a1..3736cfa7dd 100644 --- a/types/when/index.d.ts +++ b/types/when/index.d.ts @@ -109,7 +109,7 @@ declare namespace When { * @returns a promise that will fulfill with an array of mapped values * or reject if any input promise rejects. */ - function map(promisesOrValues: any[], mapFunc: (value: any, index?: Number) => any): Promise; + function map(promisesOrValues: any[], mapFunc: (value: any, index: number) => any): Promise; /** * Traditional reduce function, similar to `Array.prototype.reduce()`, but @@ -118,10 +118,10 @@ declare namespace When { * be a promise for the starting value. * @param promisesOrValues array or promise for an array of anything, * may contain a mix of promises and values. - * @param reduceFunc function(accumulated:*, x:*, index:Number):*} f reduce function + * @param reduceFunc function(accumulated:*, x:*, index:number):*} f reduce function * @returns a promise that will resolve to the final reduced value */ - function reduce(promisesOrValues: any[], reduceFunc: (reduction: T, value: any, index?: Number) => T | Promise, initialValue: T): Promise; + function reduce(promisesOrValues: any[], reduceFunc: (reduction: T, value: any, index: number) => T | Promise, initialValue: T): Promise; /** * Traditional reduce function, similar to `Array.prototype.reduceRight()`, but @@ -130,22 +130,38 @@ declare namespace When { * be a promise for the starting value. * @param promisesOrValues array or promise for an array of anything, * may contain a mix of promises and values. - * @param reduceFunc function(accumulated:*, x:*, index:Number):*} f reduce function + * @param reduceFunc function(accumulated:*, x:*, index:number):*} f reduce function * @returns a promise that will resolve to the final reduced value */ - function reduceRight(promisesOrValues: any[], reduceFunc: (reduction: T, value: any, index?: Number) => T | Promise, initialValue: T): Promise; + function reduceRight(promisesOrValues: any[], reduceFunc: (reduction: T, value: any, index: number) => T | Promise, initialValue: T): Promise; /** - * Describes the status of a promise. + * Describes the outcome of a promise. * state may be one of: * "fulfilled" - the promise has resolved - * "pending" - the promise is still pending to resolve/reject * "rejected" - the promise has rejected */ - interface Descriptor { - state: string; - value?: T; - reason?: any; + type Descriptor = FulfilledDescriptor | RejectedDescriptor; + + /** + * Snapshot which describes the status of a promise. + * state may be one of: + * "fulfilled" - the promise has resolved + * "rejected" - the promise has rejected + * "pending" - the promise is still pending to resolve/reject + */ + type Snapshot = FulfilledDescriptor | RejectedDescriptor | PendingDescriptor; + + interface FulfilledDescriptor { + state: 'fulfilled'; + value: T; + } + interface RejectedDescriptor { + state: 'rejected'; + reason: any; + } + interface PendingDescriptor { + state: 'pending'; } /** @@ -269,7 +285,26 @@ declare namespace When { // be a constructor with prototype set to an instance of Error. otherwise(exceptionType: any, onRejected?: (reason: any) => U | Promise): Promise; - then(onFulfilled: (value: T) => U | Promise, onRejected?: (reason: any) => U | Promise, onProgress?: (update: any) => void): Promise; + then( + onFulfilled?: ((value: T) => T | Thenable) | undefined | null, + onRejected?: ((reason: any) => T | Thenable) | undefined | null, + onProgress?: (update: any) => void + ): Promise; + then( + onFulfilled: ((value: T) => TResult | Thenable), + onRejected?: ((reason: any) => TResult | Thenable) | undefined | null, + onProgress?: (update: any) => void + ): Promise; + then( + onFulfilled: ((value: T) => T | Thenable) | undefined | null, + onRejected: ((reason: any) => TResult | Thenable), + onProgress?: (update: any) => void + ): Promise; + then( + onFulfilled: ((value: T) => TResult1 | Thenable), + onRejected: ((reason: any) => TResult2 | Thenable), + onProgress?: (update: any) => void + ): Promise; spread(onFulfilled: _.Fn0 | T>): Promise; spread(onFulfilled: _.Fn1 | T>): Promise; @@ -284,13 +319,7 @@ declare namespace When { } interface Thenable { - then(onFulfilled: (value: T) => U, onRejected?: (reason: any) => U): Thenable; - } - - interface Snapshot { - state: string; - value?: T; - reason?: any; + then(onFulfilled?: (value: T) => U, onRejected?: (reason: any) => U): Thenable; } } @@ -369,8 +398,7 @@ declare module "when/node" { interface Resolver { reject(reason: any): void; - resolve(value?: T): void; - resolve(value?: when.Promise): void; + resolve(value?: T | when.Promise): void; } function createCallback(resolver: Resolver): (err: any, arg: TArg) => void; diff --git a/types/when/tsconfig.json b/types/when/tsconfig.json index f903b8862c..2162d713fc 100644 --- a/types/when/tsconfig.json +++ b/types/when/tsconfig.json @@ -6,8 +6,8 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": false, + "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +20,4 @@ "index.d.ts", "when-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/when/when-tests.ts b/types/when/when-tests.ts index 63fbba2234..d44752b950 100644 --- a/types/when/when-tests.ts +++ b/types/when/when-tests.ts @@ -10,13 +10,17 @@ class ForeignPromise { constructor(private readonly value: T) { } - then(onFulfilled: (value: T) => U, onRejected?: (reason: any) => U) { return new ForeignPromise(onFulfilled(this.value)); } + then(onFulfilled?: (value: T) => U, onRejected?: (reason: any) => U): ForeignPromise + then(onFulfilled?: (value: T) => T, onRejected?: (reason: any) => T): ForeignPromise { + return new ForeignPromise(onFulfilled ? onFulfilled(this.value) : this.value); + } }; var promise: when.Promise; var foreign = new ForeignPromise(1); var error = new Error("boom!"); var example: () => void; +var native: Promise; /* * * * * * * * Core * @@ -100,8 +104,16 @@ when.all([when(1), when(2), when(3)]).then(results => { when.map([when(1), 2, 3], (num: number, index: number) => num * index).then((results) => { return results.reduce((r, x) => r + x, 0); }); +when.map([when(1), 2, 3], (num: number) => num * num).then((results) => { + return results.reduce((r, x) => r + x, 0); +}); /* when.reduce(arr, reduceFunc, initialValue) */ +when.reduce([when(1), 2, 3], (reduction: number, value: number, index: number) => { + return reduction += value * index; +}, 0).then((result: number) => { + return result; +}); when.reduce([when(1), 2, 3], (reduction: number, value: number) => { return reduction += value; }, 0).then((result: number) => { @@ -109,6 +121,12 @@ when.reduce([when(1), 2, 3], (reduction: number, value: number) => { }); /* when.reduceRight(arr, reduceFunc, initialValue) */ +when.reduceRight([when(1), 2, 3], (reduction: number, value: number, index: number) => { + return when(value * index) + .then((v) => reduction += v); +}, 0).then((result: number) => { + return result; +}); when.reduceRight([when(1), 2, 3], (reduction: number, value: number) => { return when(value) .then((v) => reduction += v); @@ -118,7 +136,24 @@ when.reduceRight([when(1), 2, 3], (reduction: number, value: number) => /* when.settle(arr) */ when.settle([when(1), when(2), when.reject(new Error("Foo"))]).then(descriptors => { - return descriptors.filter(d => d.state === 'rejected').reduce((r, d) => r + d.value, 0); + return descriptors.reduce((r, d) => { + if (d.state === 'fulfilled') { + return r + d.value; + } else { + console.error(d.reason); + return r; + } + }, 0); +}); +when.settle([when(1), when(2), when.reject(new Error("Foo"))]).then(descriptors => { + return descriptors.reduce((r, d) => { + if (d.state === 'rejected') { + console.error(d.reason); + return r; + } else { + return r + d.value; + } + }, 0); }); /* when.iterate(f, predicate, handler, seed) */ @@ -174,13 +209,16 @@ deferred.reject(error); when(1).done(); when(1).done((val: number) => console.log(val)); +when(1).done(undefined, (err: any) => console.log(err)); when(1).done((val: number) => console.log(val), (err: any) => console.log(err)); /* promise.then(onFulfilled) */ +promise = when(1).then(); promise = when(1).then((val: number) => val + val); promise = when(1).then((val: number) => when(val + val)); +promise = when(1).then(undefined, (err: any) => 2); promise = when(1).then((val: number) => val + val, (err: any) => 2); promise = when(1).then((val: number) => when(val + val), (err: any) => 2); @@ -261,6 +299,17 @@ var status: { status = when(1).inspect() +var status2: when.Snapshot; + +status2 = when(1).inspect(); +if (status2.state === 'fulfilled') { + console.log(status2.value + 2); +} else if (status2.state === 'rejected') { + console.log(status2.reason); +} else { + console.log(status2.state === 'pending'); +} + /* promise.with(thisArg) */ promise = when(1).with(2); @@ -416,8 +465,8 @@ example = function () { /* node.liftCallback */ example = function () { - var fetchData: (key: string) => when.Promise; - var handleData: (err: any, result: number) => void; + var fetchData: (key: string) => when.Promise = () => when(1); + var handleData: (err: any, result: number) => void = () => undefined; var handlePromisedData: (result: when.Promise) => when.Promise; handlePromisedData = nodefn.liftCallback(handleData); @@ -428,8 +477,8 @@ example = function () { /* node.bindCallback */ example = function () { - var fetchData: (key: string) => when.Promise; - var handleData: (err: any, result: number) => void; + var fetchData: (key: string) => when.Promise = () => when(1); + var handleData: (err: any, result: number) => void = () => undefined; nodefn.bindCallback(fetchData('thing'), handleData); }; @@ -437,9 +486,16 @@ example = function () { /* node.createCallback */ example = function () { - when.promise((resolve, reject) => + when.promise((resolve, reject) => nodeFn2(1, '2', nodefn.createCallback({ resolve: resolve, reject: reject }))) .then( (value: number) => console.log(value), (err: any) => console.error(err)); }; + +/* * * * * * * * * * * + * Native Promises * + * * * * * * * * * * */ + +native = Promise.resolve(when(1)); +native = Promise.all([when(1)]).then(([x]) => x); From 8d24d22453819922bd870c1967528bd7672fec3e Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 18 Apr 2018 15:56:48 -0400 Subject: [PATCH 0739/2153] add d.ts for pumpify (#25049) * add d.ts for pumpify * pr feedback --- types/pumpify/index.d.ts | 17 +++++++++++++++++ types/pumpify/pumpify-tests.ts | 14 ++++++++++++++ types/pumpify/tsconfig.json | 24 ++++++++++++++++++++++++ types/pumpify/tslint.json | 1 + 4 files changed, 56 insertions(+) create mode 100644 types/pumpify/index.d.ts create mode 100644 types/pumpify/pumpify-tests.ts create mode 100644 types/pumpify/tsconfig.json create mode 100644 types/pumpify/tslint.json diff --git a/types/pumpify/index.d.ts b/types/pumpify/index.d.ts new file mode 100644 index 0000000000..474484b95b --- /dev/null +++ b/types/pumpify/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for pumpify 1.4 +// Project: https://github.com/mafintosh/pumpify +// Definitions by: Justin Beckwith +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { Stream, Duplex } from 'stream'; + +export = pumpify; + +declare class pumpify extends Duplex { + constructor(); + setPipeline(...args: Stream[]): void; +} + +declare namespace pumpify {} diff --git a/types/pumpify/pumpify-tests.ts b/types/pumpify/pumpify-tests.ts new file mode 100644 index 0000000000..d4dff3bd70 --- /dev/null +++ b/types/pumpify/pumpify-tests.ts @@ -0,0 +1,14 @@ +import pumpify from 'pumpify'; +import { Duplex, Transform, PassThrough } from 'stream'; + +class Pumpy extends pumpify { + constructor() { + super(); + const dup1 = new Duplex(); + const dup2 = new Transform(); + this.setPipeline(dup1, dup2); + } +} + +const pumpy = new Pumpy(); +pumpy.pipe(new PassThrough()); diff --git a/types/pumpify/tsconfig.json b/types/pumpify/tsconfig.json new file mode 100644 index 0000000000..1404589863 --- /dev/null +++ b/types/pumpify/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "allowSyntheticDefaultImports": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "pumpify-tests.ts" + ] +} diff --git a/types/pumpify/tslint.json b/types/pumpify/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pumpify/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From fdcf6d8469ec75bf11c9239afca16bf7bb1c9662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Majchrzak?= Date: Thu, 19 Apr 2018 00:32:37 +0200 Subject: [PATCH 0740/2153] feature(zapier-core-platform): add missing methods to Z object (#25101) --- types/zapier-platform-core/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/zapier-platform-core/index.d.ts b/types/zapier-platform-core/index.d.ts index 474de4f0fd..2f0c11bd01 100644 --- a/types/zapier-platform-core/index.d.ts +++ b/types/zapier-platform-core/index.d.ts @@ -58,6 +58,8 @@ export interface Z { new (message?: string): RefreshAuthError; }; }; + stashFile: (promise: Promise, knownLength?: number | string, filename?: string, contentType?: string) => Promise; + dehydrate: (callback: (z: Z, bundle: Bundle) => any, inputData: T) => string; } export interface AuthData { From f8e09cf492816cc3c7d7d554146ccfc23c9ef727 Mon Sep 17 00:00:00 2001 From: Dmitrii Sorin Date: Thu, 19 Apr 2018 08:33:10 +1000 Subject: [PATCH 0741/2153] Describe loadFiles method and suite property (#24982) * Document loadFiles method * Document suite property * Update index.d.ts --- types/mocha/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/mocha/index.d.ts b/types/mocha/index.d.ts index 98443f5569..7817e205c3 100644 --- a/types/mocha/index.d.ts +++ b/types/mocha/index.d.ts @@ -74,6 +74,8 @@ interface ReporterConstructor { declare class Mocha { currentTest: Mocha.ITestDefinition; + suite: Mocha.ISuite; + constructor(options?: { grep?: RegExp; ui?: string; @@ -119,6 +121,7 @@ declare class Mocha { noHighlighting(value: boolean): Mocha; /** Runs tests and invokes `onComplete()` when finished. */ run(onComplete?: (failures: number) => void): Mocha.IRunner; + loadFiles(cb?: () => any): void; } // merge the Mocha class declaration with a module @@ -168,6 +171,7 @@ declare namespace Mocha { interface ISuite { parent: ISuite; title: string; + suites: ISuite[]; fullTitle(): string; } From 4478031e2fbc4ed9cafbe27ea4eb28f787cca00c Mon Sep 17 00:00:00 2001 From: Dmitrii Sorin Date: Thu, 19 Apr 2018 08:33:38 +1000 Subject: [PATCH 0742/2153] IRunner should be an instance of EventEmitter (#24971) * IRunner extends EventEmitter https://github.com/mochajs/mocha/blob/master/lib/runner.js#L97 * Update index.d.ts --- types/mocha/index.d.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/types/mocha/index.d.ts b/types/mocha/index.d.ts index 7817e205c3..b99fa24ab2 100644 --- a/types/mocha/index.d.ts +++ b/types/mocha/index.d.ts @@ -1,13 +1,16 @@ -// Type definitions for mocha 5.0 +// Type definitions for mocha 5.1 // Project: http://mochajs.org/ // Definitions by: Kazi Manzur Rashid // otiai10 // jt000 // Vadim Macagon // Andrew Bradley +// Dmitrii Sorin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 +/// + interface MochaSetupOptions { // milliseconds to wait before considering a test slow slow?: number; @@ -201,7 +204,7 @@ declare namespace Mocha { } /** Partial interface for Mocha's `Runner` class. */ - interface IRunner { + interface IRunner extends NodeJS.EventEmitter { stats?: IStats; started: boolean; suite: ISuite; From a0d4396ad9fb92ef8b185134ccbdc37b6fe846c5 Mon Sep 17 00:00:00 2001 From: Zev Spitz Date: Thu, 19 Apr 2018 01:48:25 +0300 Subject: [PATCH 0743/2153] ADOX; reduce any; return type of Execute; default properties; Bookmark (#25107) * Removal of any * Reduce any; fix default values in JsDoc * Note about Execute and RecordsAffected; Default property on Recordset * Expanded tests * Fixed linting errors * Fix long lines * Define return value of Execute methods * Add Bookmark * Initial commit for ADOX * Clean up `any` in ADOX * Removed duplicate types from ADOX; add jsDoc to Attribute properties * ADOX tests * Lint fixes * State flag comment * Reduce any * Add multicolumn index finder in tests file * Update activex-access version * Updated activex-infopath version --- types/activex-access/index.d.ts | 2 +- types/activex-adodb/activex-adodb-tests.ts | 459 +++++++- types/activex-adodb/index.d.ts | 401 ++++--- types/activex-adodb/tslint.json | 3 +- types/activex-adox/activex-adox-tests.ts | 1204 ++++++++++++++++++++ types/activex-adox/index.d.ts | 335 ++++++ types/activex-adox/package.json | 6 + types/activex-adox/tsconfig.json | 22 + types/activex-adox/tslint.json | 7 + types/activex-infopath/index.d.ts | 2 +- 10 files changed, 2211 insertions(+), 230 deletions(-) create mode 100644 types/activex-adox/activex-adox-tests.ts create mode 100644 types/activex-adox/index.d.ts create mode 100644 types/activex-adox/package.json create mode 100644 types/activex-adox/tsconfig.json create mode 100644 types/activex-adox/tslint.json diff --git a/types/activex-access/index.d.ts b/types/activex-access/index.d.ts index 0fd93502f8..2529538cad 100644 --- a/types/activex-access/index.d.ts +++ b/types/activex-access/index.d.ts @@ -2,7 +2,7 @@ // Project: https://msdn.microsoft.com/en-us/library/dn142571.aspx // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.6 /// /// diff --git a/types/activex-adodb/activex-adodb-tests.ts b/types/activex-adodb/activex-adodb-tests.ts index f409b888d3..347e1d9c9f 100644 --- a/types/activex-adodb/activex-adodb-tests.ts +++ b/types/activex-adodb/activex-adodb-tests.ts @@ -1,57 +1,426 @@ -let obj0 = new ActiveXObject('ADODB.Command'); +// Note -- running these tests under cscript requires some ES5 polyfills -let obj1 = new ActiveXObject('ADODB.Connection'); +const collectionToArray = (col: { Item(key: any): T }): T[] => { + const results: T[] = []; + const enumerator = new Enumerator(col); + enumerator.moveFirst(); + while (!enumerator.atEnd()) { + results.push(enumerator.item()); + enumerator.moveNext(); + } + return results; +}; -let obj2 = new ActiveXObject('ADODB.Parameter'); - -let obj3 = new ActiveXObject('ADODB.Record'); - -let obj4 = new ActiveXObject('ADODB.Recordset'); - -let obj5 = new ActiveXObject('ADODB.Stream'); - -// open connection to an Excel file -let pathToExcelFile = 'C:\\path\\to\\excel\\file.xlsx'; -let conn = new ActiveXObject('ADODB.Connection'); -conn.Provider = 'Microsoft.ACE.OLEDB.12.0'; -conn.ConnectionString = `Data Source="${pathToExcelFile}";Extended Properties="Excel 12.0;HDR=Yes"`; -conn.Open(); - -// create a Command to access the data -let cmd = new ActiveXObject('ADODB.Command'); -cmd.ActiveConnection = conn; -cmd.CommandText = 'SELECT DISTINCT LastName, CityName FROM [Sheet1$]'; -// get a Recordset -let rs = cmd.Execute(); -// build a string from the Recordset -let s = rs.GetString(ADODB.StringFormatEnum.adClipString, -1, '\t', '\n', '(NULL)'); -rs.Close(); -WScript.Echo(s); - -// create a disconnected recordset -- https://support.microsoft.com/en-us/help/184397/how-to-create-ado-disconnected-recordsets-in-vba-c-java -(() => { - conn = new ActiveXObject('ADODB.Connection'); - conn.Open(); // pass connection details here - - rs = new ActiveXObject('ADODB.Recordset'); - rs.CursorLocation = ADODB.CursorLocationEnum.adUseClient; - rs.Open('SELECT * FROM Table1', conn, ADODB.CursorTypeEnum.adOpenForwardOnly, ADODB.LockTypeEnum.adLockBatchOptimistic); - rs.ActiveConnection = null; - - const v = rs.Fields.Item(0).Value; - conn.Close(); -})(); - -// helper function const toSafeArray = (...items: T[]): SafeArray => { const dict = new ActiveXObject('Scripting.Dictionary'); items.forEach((x, index) => dict.Add(index, x)); return dict.Items() as SafeArray; }; +const toConnectionString = (o: { [index: string]: any }) => { + o.Provider = o.Provider || 'sqloledb'; + o['Data Source'] = o['Data Source'] || 'Server'; + o['Integrated Security'] = o['Integrated Security'] || 'SSPI'; + + const parts: string[] = []; + for (const key in o) { + let val = o[key]; + if (typeof val === 'string') { val = `'${val}'`; } + parts.push(`${key}=${val}`); + } + return parts.join(';'); +}; + +const printLine = () => WScript.Echo(new Array(26).join('-')); + +{ + // open connection to an Excel file + const pathToExcelFile = 'C:\\path\\to\\excel\\file.xlsx'; + const conn = new ActiveXObject('ADODB.Connection'); + conn.ConnectionString = toConnectionString({ + Provider: 'Microsoft.ACE.OLEDB.12.0', + 'Data Source': pathToExcelFile, + 'Extended Properties': "Excel 12.0;HDR=Yes" + }); + conn.Open(); + + // create a Command to access the data + const cmd = new ActiveXObject('ADODB.Command'); + cmd.ActiveConnection = conn; + cmd.CommandText = 'SELECT DISTINCT LastName, CityName FROM [Sheet1$]'; + // get a Recordset + const rs = cmd.Execute() as ADODB.Recordset; + // build a string from the Recordset + const s = rs.GetString(ADODB.StringFormatEnum.adClipString, -1, '\t', '\n', '(NULL)'); + rs.Close(); + WScript.Echo(s); +} + +// create a disconnected recordset -- https://support.microsoft.com/en-us/help/184397/how-to-create-ado-disconnected-recordsets-in-vba-c-java +{ + const conn = new ActiveXObject('ADODB.Connection'); + conn.Open(); // pass connection details here + + const rs = new ActiveXObject('ADODB.Recordset'); + rs.CursorLocation = ADODB.CursorLocationEnum.adUseClient; + rs.Open('SELECT * FROM Table1', conn, ADODB.CursorTypeEnum.adOpenForwardOnly, ADODB.LockTypeEnum.adLockBatchOptimistic); + rs.ActiveConnection = null; + + const v = rs(0).Value; + conn.Close(); +} + // update with SafeArray -(() => { +{ + const rs = new ActiveXObject('ADODB.Recordset'); + rs.Open(); // missing connection details here const fields = toSafeArray('FirstName', 'LastName', 'DOB'); const values = toSafeArray('Plony', 'Almony', new Date(1980, 1, 1).getVarDate()); rs.Update(fields, values); -})(); + rs.Close(); +} + +const withConnection = (initialCatalog: string, fn: (conn: ADODB.Connection) => void) => { + let conn: ADODB.Connection | null = new ActiveXObject('ADODB.Connection'); + const connectionString = toConnectionString({ + 'Initial Catalog': initialCatalog + }); + try { + conn.Open(connectionString); + fn(conn); + } catch (e) { + WScript.Echo(e.message); + } finally { + if (conn.State === ADODB.ObjectStateEnum.adStateOpen) { + conn.Close(); + } + conn = null; + } +}; + +const withRs = (catalogOrConnection: string | ADODB.Connection, tableOrCommand: string | ADODB.Command, fn: (rs: ADODB.Recordset) => void, + type: ADODB.CursorTypeEnum = ADODB.CursorTypeEnum.adOpenUnspecified, + location: ADODB.CursorLocationEnum = ADODB.CursorLocationEnum.adUseNone, + lockType: ADODB.LockTypeEnum = ADODB.LockTypeEnum.adLockOptimistic +) => { + let connection = catalogOrConnection; + if (typeof connection === 'string') { + // expand catalog to full connection string + connection = toConnectionString({ + 'Initial Catalog': connection + }); + } + + let rs: ADODB.Recordset | null = null; + try { + if (typeof tableOrCommand === 'string') { + rs = new ActiveXObject('ADODB.Recordset'); + rs.CursorLocation = location; + rs.LockType = lockType; + rs.Open(tableOrCommand, connection, type, lockType, ADODB.CommandTypeEnum.adCmdTable); + } else { + tableOrCommand.ActiveConnection = connection; + rs = tableOrCommand.Execute() as ADODB.Recordset; + } + fn(rs); + } catch (e) { + WScript.Echo(e.message); + } finally { + if (rs && rs.State === ADODB.ObjectStateEnum.adStateOpen) { + rs.Close(); + } + rs = null; + } +}; + +const withEmployees = (fn: (rs: ADODB.Recordset) => void, type: ADODB.CursorTypeEnum) => + withRs('Northwind', 'Employees', fn, type, ADODB.CursorLocationEnum.adUseClient); + +// https://msdn.microsoft.com/en-us/library/jj249882.aspx +{ + withConnection('Northwind', conn => { + withEmployees(rs => { + const FName = 'first name'; + const LName = 'last name'; + + rs.AddNew(); + rs('FirstName').Value = FName; + rs('LastName').Value = LName; + rs.Update(); + WScript.Echo('New record added.'); + }, ADODB.CursorTypeEnum.adOpenKeyset); + }); +} + +// https://msdn.microsoft.com/en-us/library/jj249434.aspx +{ + withConnection('Northwind', conn => { + withEmployees(rs => { + // Set PageSize to five to display names and hire dates of five employees at a time + rs.PageSize = 5; + const pageCount = rs.PageCount; + + WScript.Echo(`There are ${pageCount} pages, each containing ${rs.PageSize} or fewer records`.trim()); + + for (let i = 1; i <= pageCount; i++) { + rs.AbsolutePage = i; + + for (let iRecord = 1; iRecord <= rs.PageSize; iRecord++) { + // First column in row contains page number on + // first record of each page. Otherwise, the column + // contains a non-breaking space. + const page = iRecord === 1 ? `Page ${i} of ${rs.PageCount}` : ''; + + // First and last name are in first column. + const name = `${rs('FirstName')} ${rs('LastName')}`; + + // Hire date in second column. + const hireDate = new Date(rs('HireDate').Value as VarDate).toString(); + + // Write the row + WScript.Echo([page, name, hireDate].join('\t')); + + // Get next record. + rs.MoveNext(); + + if (rs.EOF) { break; } + } + } + }, ADODB.CursorTypeEnum.adOpenStatic); + }); +} + +// https://msdn.microsoft.com/en-us/library/jj250117.aspx +{ + withConnection('Northwind', conn => { + withEmployees(rs => { + WScript.Echo(['AbsolutePosition', 'Name', 'Hire Date'].join('\t')); + + while (!rs.EOF) { + // First column in row contains AbsolutePosition value. + const recordCount = `${rs.AbsolutePosition} of ${rs.RecordCount}`; + + // First and last name are in first column. + const name = `${rs('FirstName')} ${rs('LastName')}`; + + // Hire date in second column. + const hireDate = new Date(rs('HireDate').Value as VarDate).toString(); + + WScript.Echo([recordCount, name, hireDate].join('\t')); + } + }, ADODB.CursorTypeEnum.adOpenStatic); + }); +} + +// https://msdn.microsoft.com/en-us/library/jj249824.aspx +{ + withConnection('Northwind', conn => { + WScript.Echo('Enter city name, and press ENTER:'); + const cityName = WScript.StdIn.ReadLine(); + + const cmdContact = new ActiveXObject('ADODB.Command'); + cmdContact.CommandText = 'SELECT ContactName FROM Customers WHERE City = ?'; + cmdContact.ActiveConnection = conn; + + // create parameter and insert variable value + const param = cmdContact.CreateParameter('CityName', ADODB.DataTypeEnum.adChar, ADODB.ParameterDirectionEnum.adParamInput, 30, cityName); + cmdContact.Parameters.Append(param); + + let rsContact: ADODB.Recordset | null = null; + try { + // Open a recordset using the command object + rsContact = cmdContact.Execute() as ADODB.Recordset; + + while (!rsContact.EOF) { + WScript.Echo(rsContact('ContactName')); + rsContact.MoveNext(); + } + } catch (e) { + WScript.Echo(e.message); + } finally { + if (rsContact && rsContact.State === ADODB.ObjectStateEnum.adStateOpen) { + rsContact.Close(); + } + } + }); +} + +// https://msdn.microsoft.com/en-us/library/jj249056.aspx +// https://msdn.microsoft.com/en-us/library/jj249494.aspx +{ + WScript.Echo('Enter royalty value, and press ENTER:'); + const iRoyalty = parseInt(WScript.StdIn.ReadLine(), 10); + if (iRoyalty > -1) { + withConnection('pubs', conn => { + const cmdByRoyalty = new ActiveXObject('ADODB.Command'); + cmdByRoyalty.CommandText = 'byroyalty'; + cmdByRoyalty.CommandType = ADODB.CommandTypeEnum.adCmdStoredProc; + cmdByRoyalty.CommandTimeout = 15; + + // The stored procedure called above is as follows: + /* + CREATE PROCEDURE byroyalty + @percentage int + AS + SELECT au_id from titleauthor + WHERE titleauthor.royaltyper = @percentage + GO + */ + + const prmByRoyalty = new ActiveXObject('ADODB.Parameter'); + prmByRoyalty.Type = ADODB.DataTypeEnum.adInteger; + prmByRoyalty.Size = 3; + prmByRoyalty.Direction = ADODB.ParameterDirectionEnum.adParamInput; + prmByRoyalty.Value = iRoyalty; + cmdByRoyalty.Parameters.Append(prmByRoyalty); + + // open byRoyalty recordset via Command + withRs(conn, cmdByRoyalty, rsByRoyalty => { + // open authors recordset directly + withRs(conn, 'Authors', rsAuthor => { + while (!rsByRoyalty.EOF) { + // set filter + rsAuthor.Filter = `au_id='${rsByRoyalty('au_id')}'`; + + // write author name + WScript.Echo(`${rsAuthor('au_fname')} ${rsAuthor('au_lname')}`); + } + + // get next record + rsByRoyalty.MoveNext(); + }); + }); + }); + } +} + +// https://msdn.microsoft.com/en-us/library/jj250032.aspx +{ + withRs('Northwind', 'Suppliers', rsSuppliers => { + WScript.Echo(['Field Value', 'Defined Size', 'Actual Size'].join('\t')); + while (!rsSuppliers.EOF) { + const fld = rsSuppliers('CompanyName'); + WScript.Echo([fld.Value, fld.DefinedSize, fld.ActualSize].join('\t')); + } + rsSuppliers.MoveNext(); + }); +} + +// https://msdn.microsoft.com/en-us/library/jj249928.aspx +{ + withRs('Northwind', 'Customers', rs => { + const loop20 = () => { + const start = new Date().getTime(); + + // loop through the recordset 20 times + for (let i = 0; i < 20; i++) { + rs.MoveFirst(); + while (!rs.EOF) { + // do something with the record + const strTemp = rs('CompanyName').Value as string; + rs.MoveNext(); + } + } + + const end = new Date().getTime(); + return end - start; + }; + + const noCache = loop20(); + + // cache records in groups of 30 + rs.MoveFirst(); + rs.CacheSize = 30; + + const cache = loop20(); + + WScript.Echo(`No cache: ${noCache}; with cache: ${cache}`); + }, ADODB.CursorTypeEnum.adOpenUnspecified, ADODB.CursorLocationEnum.adUseClient); +} + +// https://msdn.microsoft.com/en-us/library/jj249157.aspx +{ + const printAuthorRecordset = (caption: string, rs: ADODB.Recordset) => { + printLine(); + WScript.Echo(`**${caption}**`); + while (!rs.EOF) { + // write current row's data + const name = `${rs('au_fname')} ${rs('au_lname')}`; + WScript.Echo(name); + + // get next record + rs.MoveNext; + } + }; + + WScript.Echo('Enter last name of author to find (e.g., Ringer) and then press ENTER:'); + const lastName = WScript.StdIn.ReadLine() || ''; + if (lastName.length > 0) { + withConnection('pubs', conn => { + // command object parameters + const cmdAuthor = new ActiveXObject('ADODB.Command'); + cmdAuthor.CommandText = 'SELECT * FROM Authors WHERE au_name = ?'; + const lastNameParameter = cmdAuthor.CreateParameter('Last Name', ADODB.DataTypeEnum.adChar, ADODB.ParameterDirectionEnum.adParamInput, 20, lastName); + cmdAuthor.Parameters.Append(lastNameParameter); + cmdAuthor.ActiveConnection = conn; + + // recordset from command.execute + const rsAuthor = cmdAuthor.Execute() as ADODB.Recordset; + + // recordset from connection.execute + const rsAuthor2 = conn.Execute('SELECT * FROM Authors') as ADODB.Recordset; + + const errs = collectionToArray(conn.Errors); + if (errs.length > 0) { + for (const err of errs) { + WScript.Echo(err); + } + } + conn.Errors.Clear(); + + printAuthorRecordset('Command.Execute results', rsAuthor); + printAuthorRecordset('Connection.Execute results', rsAuthor2); + }); + } +} + +// https://msdn.microsoft.com/en-us/library/jj249466.aspx +{ + withConnection('Northwind', conn => { + const sql = 'SELECT * FROM Customers'; + withRs(conn, sql, rs => { + rs.MoveFirst(); + if (rs.RecordCount === 0) { + WScript.Echo(`No records matched for '${sql}'`); + return; + } + + // print headings for each field name + WScript.Echo(collectionToArray(rs.Fields).map(fld => fld.Name).join('\t')); + + // JScript doesn't support multi-dimensional arrays + // so we'll convert the returned array to a single + // dimensional JScript array and then display the data. + const safeArray = rs.GetRows(); + const data = new VBArray(safeArray).toArray(); + + const fieldCount = rs.Fields.Count; + + data.forEach((cellValue, index) => { + const currentField = index % fieldCount; + + // don't print tab character for first and last columns + if (currentField > 0 && currentField < fieldCount - 1) { + WScript.StdOut.Write('\t'); + } + + const displayValue = cellValue === null ? '-null-' : cellValue; + if (currentField === fieldCount - 1) { + WScript.StdOut.WriteLine(displayValue); + } else { + WScript.StdOut.Write(displayValue); + } + }); + }, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.CursorLocationEnum.adUseClient, ADODB.LockTypeEnum.adLockOptimistic); + }); +} diff --git a/types/activex-adodb/index.d.ts b/types/activex-adodb/index.d.ts index 43f43f5bd5..1879891b2d 100644 --- a/types/activex-adodb/index.d.ts +++ b/types/activex-adodb/index.d.ts @@ -2,7 +2,7 @@ // Project: https://msdn.microsoft.com/en-us/library/jj249010.aspx // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 declare namespace ADODB { const enum ADCPROP_ASYNCTHREADPRIORITY_ENUM { @@ -594,10 +594,19 @@ declare namespace ADODB { adXactSyncPhaseOne = 1048576, } + class Bookmark { + private 'ADODB.Bookmark_typekey': Bookmark; + private constructor(); + } + class Command { private 'ADODB.Command_typekey': Command; private constructor(); - ActiveConnection: Connection; + + /** + * Sets or returns a String value that contains a definition for a connection if the connection is closed, or a Variant containing the current Connection object if the connection is open. Default is a null object reference. + */ + ActiveConnection: string | Connection | null; Cancel(): void; CommandStream: any; CommandText: string; @@ -605,28 +614,40 @@ declare namespace ADODB { CommandType: CommandTypeEnum; /** - * @param string [Name=''] - * @param ADODB.DataTypeEnum [Type=0] - * @param ADODB.ParameterDirectionEnum [Direction=1] - * @param number [Size=0] + * @param Name [Name=''] + * @param Type [Type=0] + * @param Direction [Direction=1] + * @param Size [Size=0] */ CreateParameter(Name?: string, Type?: DataTypeEnum, Direction?: ParameterDirectionEnum, Size?: number, Value?: any): Parameter; Dialect: string; - /** @param number [Options=-1] */ - Execute(RecordsAffected?: number, Parameters?: SafeArray, Options?: number): Recordset; + /** + * @param Options [Options=-1] + * + * The **RecordsAffected** parameter is meant to take a variable to be modified by reference, which is not supported by Javascript + * + * The return value is as follows: + * + * * If the **adExecuteNoRecords** option is passed in, the method will return `null`. Otherwise: + * * If the command specifies a row-returning query, then the method will return a new read-only, forward-only **Recordset** object with the results. + * * If the command isn't intended to return results (e.g. an `UPDATE` statement), a closed empty **Recordset** will be returned. + */ + Execute(RecordsAffected?: undefined, Parameters?: SafeArray, Options?: number): Recordset | null; Name: string; NamedParameters: boolean; readonly Parameters: Parameters; Prepared: boolean; readonly Properties: Properties; - readonly State: number; + readonly State: ObjectStateEnum; } class Connection { private 'ADODB.Connection_typekey': Connection; private constructor(); - Attributes: number; + + /** Sum of one or more of the values in the **XactAttributeEnum** enum */ + Attributes: XactAttributeEnum; BeginTrans(): number; Cancel(): void; Close(): void; @@ -638,23 +659,45 @@ declare namespace ADODB { DefaultDatabase: string; readonly Errors: Errors; - /** @param number [Options=-1] */ - Execute(CommandText: string, RecordsAffected: any, Options?: number): Recordset; + /** + * @param Options [Options=-1] + * + * The **RecordsAffected** parameter is meant to take a variable to be modified by reference, which is not supported by Javascript + * + * The return value is as follows: + * + * * If the **adExecuteNoRecords** option is passed in, the method will return `null`. Otherwise: + * * If **CommandText** specifies a row-returning query, then the method will return a new read-only, forward-only **Recordset** object with the results + * * If **CommandText** isn't intended to return results (e.g. an `UPDATE` statement), a closed empty **Recordset** will be returned. + */ + Execute(CommandText: string, RecordsAffected?: undefined, Options?: CommandTypeEnum | ExecuteOptionEnum): Recordset | null; IsolationLevel: IsolationLevelEnum; Mode: ConnectModeEnum; /** - * @param string [ConnectionString=''] - * @param string [UserID=''] - * @param string [Password=''] - * @param number [Options=-1] + * @param ConnectionString [ConnectionString=''] + * @param UserID [UserID=''] + * @param Password [Password=''] + * @param Options [Options=-1] */ Open(ConnectionString?: string, UserID?: string, Password?: string, Options?: number): void; - OpenSchema(Schema: SchemaEnum, Restrictions?: any, SchemaID?: any): Recordset; + + /** + * Returns a Recordset object that contains schema information + * @param Schema Type of schema query to run + * @param Restrictions A SafeArray of query constraints; depends on the [type of the schema query](https://msdn.microsoft.com/en-us/library/jj249359.aspx) + */ + OpenSchema(Schema: SchemaEnum, Restrictions?: SafeArray): Recordset; + + /** + * Returns a Recordset object that contains schema information, for a provider-specific schema query type + * @param SchemaID The GUID for a provider-schema query not defined by the OLE DB specification. + */ + OpenSchema(Schema: SchemaEnum.adSchemaProviderSpecific, Restrictions: SafeArray, SchemaID: string): Recordset; readonly Properties: Properties; Provider: string; RollbackTrans(): void; - readonly State: number; + readonly State: ObjectStateEnum; readonly Version: string; } @@ -670,13 +713,12 @@ declare namespace ADODB { readonly SQLState: string; } - class Errors { - private 'ADODB.Errors_typekey': Errors; - private constructor(); + interface Errors { Clear(): void; readonly Count: number; Item(Index: any): Error; Refresh(): void; + (Index: any): Error; } class Field { @@ -684,7 +726,9 @@ declare namespace ADODB { private constructor(); readonly ActualSize: number; AppendChunk(Data: any): void; - Attributes: number; + + /** Sum of one or more of the values in the **FieldAttributeEnum** enum */ + Attributes: FieldAttributeEnum; DataFormat: any; DefinedSize: number; GetChunk(Length: number): any; @@ -699,37 +743,37 @@ declare namespace ADODB { Value: any; } - class Fields { - private 'ADODB.Fields_typekey': Fields; - private constructor(); - + interface Fields { /** - * @param number [DefinedSize=0] - * @param ADODB.FieldAttributeEnum [Attrib=-1] + * @param DefinedSize [DefinedSize=0] + * @param Attrib [Attrib=-1] */ _Append(Name: string, Type: DataTypeEnum, DefinedSize?: number, Attrib?: FieldAttributeEnum): void; /** - * @param number [DefinedSize=0] - * @param ADODB.FieldAttributeEnum [Attrib=-1] + * @param DefinedSize [DefinedSize=0] + * @param Attrib [Attrib=-1] */ Append(Name: string, Type: DataTypeEnum, DefinedSize?: number, Attrib?: FieldAttributeEnum, FieldValue?: any): void; CancelUpdate(): void; readonly Count: number; - Delete(Index: any): void; - Item(Index: any): Field; + Delete(Index: string | number): void; + Item(Index: string | number): Field; Refresh(): void; - /** @param ADODB.ResyncEnum [ResyncValues=2] */ + /** @param ResyncValues [ResyncValues=2] */ Resync(ResyncValues?: ResyncEnum): void; Update(): void; + (Index: string | number): Field; } class Parameter { private 'ADODB.Parameter_typekey': Parameter; private constructor(); AppendChunk(Val: any): void; - Attributes: number; + + /** Sum of one or more of the values in the **ParameterAttributesEnum** enum */ + Attributes: ParameterAttributesEnum; Direction: ParameterDirectionEnum; Name: string; NumericScale: number; @@ -740,28 +784,28 @@ declare namespace ADODB { Value: any; } - class Parameters { - private 'ADODB.Parameters_typekey': Parameters; - private constructor(); + interface Parameters { Append(Object: any): void; readonly Count: number; - Delete(Index: any): void; - Item(Index: any): Parameter; + Delete(Index: string | number): void; + Item(Index: string | number): Parameter; Refresh(): void; + (Index: string | number): Parameter; } - class Properties { - private 'ADODB.Properties_typekey': Properties; - private constructor(); + interface Properties { readonly Count: number; - Item(Index: any): Property; + Item(Index: string | number): Property; Refresh(): void; + (Index: string | number): Property; } class Property { private 'ADODB.Property_typekey': Property; private constructor(); - Attributes: number; + + /** Sum of one or more of the values in the **PropertyAttributesEnum** enum */ + Attributes: PropertyAttributesEnum; readonly Name: string; readonly Type: DataTypeEnum; Value: any; @@ -770,23 +814,27 @@ declare namespace ADODB { class Record { private 'ADODB.Record_typekey': Record; private constructor(); - ActiveConnection: any; + + /** + * Sets or returns a String value that contains a definition for a connection if the connection is closed, or a Variant containing the current Connection object if the connection is open. Default is a null object reference. + */ + ActiveConnection: string | Connection | null; Cancel(): void; Close(): void; /** - * @param string [Source=''] - * @param string [Destination=''] - * @param string [UserName=''] - * @param string [Password=''] - * @param ADODB.CopyRecordOptionsEnum [Options=-1] - * @param boolean [Async=false] + * @param Source [Source=''] + * @param Destination [Destination=''] + * @param UserName [UserName=''] + * @param Password [Password=''] + * @param Options [Options=-1] + * @param Async [Async=false] */ CopyRecord(Source?: string, Destination?: string, UserName?: string, Password?: string, Options?: CopyRecordOptionsEnum, Async?: boolean): string; /** - * @param string [Source=''] - * @param boolean [Async=false] + * @param Source [Source=''] + * @param Async [Async=false] */ DeleteRecord(Source?: string, Async?: boolean): void; readonly Fields: Fields; @@ -794,137 +842,174 @@ declare namespace ADODB { Mode: ConnectModeEnum; /** - * @param string [Source=''] - * @param string [Destination=''] - * @param string [UserName=''] - * @param string [Password=''] - * @param ADODB.MoveRecordOptionsEnum [Options=-1] - * @param boolean [Async=false] + * @param Source [Source=''] + * @param Destination [Destination=''] + * @param UserName [UserName=''] + * @param Password [Password=''] + * @param Options [Options=-1] + * @param Async [Async=false] */ MoveRecord(Source?: string, Destination?: string, UserName?: string, Password?: string, Options?: MoveRecordOptionsEnum, Async?: boolean): string; /** - * @param ADODB.ConnectModeEnum [Mode=0] - * @param ADODB.RecordCreateOptionsEnum [CreateOptions=-1] - * @param ADODB.RecordOpenOptionsEnum [Options=-1] - * @param string [UserName=''] - * @param string [Password=''] + * Source may be: + * * A URL. If the protocol for the URL is http, then the Internet Provider will be invoked by default. If the URL points to a node that contains an executable script (such as an .ASP page), then a Record containing the source rather than the executed contents is opened by default. Use the Options argument to modify this behavior. + * * A Record object. A Record object opened from another Record will clone the original Record object. + * * A Command object. The opened Record object represents the single row returned by executing the Command. If the results contain more than a single row, the contents of the first row are placed in the record and an error may be added to the Errors collection. + * * A SQL SELECT statement. The opened Record object represents the single row returned by executing the contents of the string. If the results contain more than a single row, the contents of the first row are placed in the record and an error may be added to the Errors collection. + * * A table name. + * + * @param Mode [Mode=0] + * @param CreateOptions [CreateOptions=-1] + * @param Options [Options=-1] + * @param UserName [UserName=''] + * @param Password [Password=''] */ - Open(Source: any, ActiveConnection: any, Mode?: ConnectModeEnum, CreateOptions?: RecordCreateOptionsEnum, Options?: RecordOpenOptionsEnum, UserName?: string, Password?: string): void; + Open(Source?: string | Record | Recordset | Command, ActiveConnection?: string | Connection, Mode?: ConnectModeEnum, CreateOptions?: RecordCreateOptionsEnum, Options?: RecordOpenOptionsEnum, UserName?: string, Password?: string): void; readonly ParentURL: string; readonly Properties: Properties; readonly RecordType: RecordTypeEnum; - Source: any; + Source: string | Recordset | Command; readonly State: ObjectStateEnum; } - class Recordset { - private 'ADODB.Recordset_typekey': Recordset; - private constructor(); + interface Recordset { _xClone(): Recordset; - /** @param ADODB.AffectEnum [AffectRecords=3] */ + /** @param AffectRecords [AffectRecords=3] */ _xResync(AffectRecords?: AffectEnum): void; /** - * @param string [FileName=''] - * @param ADODB.PersistFormatEnum [PersistFormat=0] + * @param FileName [FileName=''] + * @param PersistFormat [PersistFormat=0] */ _xSave(FileName?: string, PersistFormat?: PersistFormatEnum): void; AbsolutePage: PositionEnum; AbsolutePosition: PositionEnum; - readonly ActiveCommand: any; - ActiveConnection: any; - AddNew(FieldList?: any, Values?: any): void; + readonly ActiveCommand?: Command; + + /** + * Sets or returns a String value that contains a definition for a connection if the connection is closed, or a Variant containing the current Connection object if the connection is open. Default is a null object reference. + */ + ActiveConnection: string | Connection | null; + AddNew(): void; + AddNew(Fields: SafeArray, Values: SafeArray): void; + AddNew(Field: string, Value: any): void; readonly BOF: boolean; - Bookmark: any; + Bookmark: Bookmark; CacheSize: number; Cancel(): void; - /** @param ADODB.AffectEnum [AffectRecords=3] */ + /** @param AffectRecords [AffectRecords=3] */ CancelBatch(AffectRecords?: AffectEnum): void; CancelUpdate(): void; - /** @param ADODB.LockTypeEnum [LockType=-1] */ + /** @param LockType [LockType=-1] */ Clone(LockType?: LockTypeEnum): Recordset; Close(): void; Collect(Index: any): any; - CompareBookmarks(Bookmark1: any, Bookmark2: any): CompareEnum; + CompareBookmarks(Bookmark1: Bookmark, Bookmark2: Bookmark): CompareEnum; CursorLocation: CursorLocationEnum; CursorType: CursorTypeEnum; DataMember: string; DataSource: any; - /** @param ADODB.AffectEnum [AffectRecords=1] */ + /** @param AffectRecords [AffectRecords=1] */ Delete(AffectRecords?: AffectEnum): void; readonly EditMode: EditModeEnum; readonly EOF: boolean; readonly Fields: Fields; - Filter: any; /** - * @param number [SkipRecords=0] - * @param ADODB.SearchDirectionEnum [SearchDirection=1] + * Sets or returns one of the following: + * * Criteria string — a string made up of one or more individual clauses concatenated with AND or OR operators. + * * Array of bookmarks — an array of unique bookmark values that point to records in the Recordset object. + * * A FilterGroupEnum value */ - Find(Criteria: string, SkipRecords?: number, SearchDirection?: SearchDirectionEnum, Start?: any): void; - - /** @param number [Rows=-1] */ - GetRows(Rows?: number, Start?: any, Fields?: any): any; + Filter: string | SafeArray | FilterGroupEnum; /** - * @param ADODB.StringFormatEnum [StringFormat=2] - * @param number [NumRows=-1] - * @param string [ColumnDelimeter=''] - * @param string [RowDelimeter=''] - * @param string [NullExpr=''] + * @param SkipRecords [SkipRecords=0] + * @param SearchDirection [SearchDirection=1] + */ + Find(Criteria: string, SkipRecords?: number, SearchDirection?: SearchDirectionEnum, Start?: Bookmark): void; + + /** @param Rows [Rows=-1] */ + GetRows(Rows?: number, Start?: string | Bookmark | BookmarkEnum, Fields?: string | SafeArray): SafeArray; + + /** + * @param StringFormat [StringFormat=2] + * @param NumRows [NumRows=-1] + * @param ColumnDelimeter [ColumnDelimeter=''] + * @param RowDelimeter [RowDelimeter=''] + * @param NullExpr [NullExpr=''] */ GetString(StringFormat?: StringFormatEnum, NumRows?: number, ColumnDelimeter?: string, RowDelimeter?: string, NullExpr?: string): string; Index: string; LockType: LockTypeEnum; MarshalOptions: MarshalOptionsEnum; MaxRecords: number; - Move(NumRecords: number, Start?: any): void; + Move(NumRecords: number, Start?: string | Bookmark | BookmarkEnum): void; MoveFirst(): void; MoveLast(): void; MoveNext(): void; MovePrevious(): void; - NextRecordset(RecordsAffected?: any): Recordset; + + /** Since Javascript doesn't support byref parameters, the RecordsAffected parameter cannot be used */ + NextRecordset(): Recordset; /** - * @param ADODB.CursorTypeEnum [CursorType=-1] - * @param ADODB.LockTypeEnum [LockType=-1] - * @param number [Options=-1] + * @param CursorType [CursorType=-1] + * @param LockType [LockType=-1] + * @param Options [Options=-1] */ - Open(Source: any, ActiveConnection: any, CursorType?: CursorTypeEnum, LockType?: LockTypeEnum, Options?: number): void; + Open(Source: Command, ActiveConnection: null, CursorType?: CursorTypeEnum, LockType?: LockTypeEnum, Options?: CommandTypeEnum | ExecuteOptionEnum): void; + Open(Source?: Stream): void; + + /** + * @param CursorType [CursorType=-1] + * @param LockType [LockType=-1] + * @param Options [Options=-1] + */ + Open(Source: string, ActiveConnection: string | Connection, CursorType?: CursorTypeEnum, LockType?: LockTypeEnum, Options?: CommandTypeEnum | ExecuteOptionEnum): void; readonly PageCount: number; PageSize: number; readonly Properties: Properties; readonly RecordCount: number; - /** @param number [Options=-1] */ + /** @param Options [Options=-1] */ Requery(Options?: number): void; /** - * @param ADODB.AffectEnum [AffectRecords=3] - * @param ADODB.ResyncEnum [ResyncValues=2] + * @param AffectRecords [AffectRecords=3] + * @param ResyncValues [ResyncValues=2] */ Resync(AffectRecords?: AffectEnum, ResyncValues?: ResyncEnum): void; - /** @param ADODB.PersistFormatEnum [PersistFormat=0] */ - Save(Destination: any, PersistFormat?: PersistFormatEnum): void; + /** @param PersistFormat [PersistFormat=0] */ + Save(Destination: string | Stream, PersistFormat?: PersistFormatEnum): void; - /** @param ADODB.SeekEnum [SeekOption=1] */ + /** + * @param SeekOption [SeekOption=1] + * + * For a single-column index, pass in a single value to seek in the column of the index + * + * For a multi-column index, pass in a SafeArray containing the multiple values to seek in the columns of the index. + */ Seek(KeyValues: any, SeekOption?: SeekEnum): void; Sort: string; - Source: any; - readonly State: number; + Source: string | Command; + readonly State: ObjectStateEnum; readonly Status: number; StayInSync: boolean; Supports(CursorOptions: CursorOptionEnum): boolean; - Update(Fields?: string | SafeArray, Values?: any): void; + Update(): void; + Update(Fields: SafeArray, Values: SafeArray): void; + Update(Field: string, Value: any): void; - /** @param ADODB.AffectEnum [AffectRecords=3] */ + /** @param AffectRecords [AffectRecords=3] */ UpdateBatch(AffectRecords?: AffectEnum): void; + (FieldIndex: string | number): Field; } class Stream { @@ -934,7 +1019,7 @@ declare namespace ADODB { Charset: string; Close(): void; - /** @param number [CharNumber=-1] */ + /** @param CharNumber [CharNumber=-1] */ CopyTo(DestStream: Stream, CharNumber?: number): void; readonly EOS: boolean; Flush(): void; @@ -943,21 +1028,21 @@ declare namespace ADODB { Mode: ConnectModeEnum; /** - * @param ADODB.ConnectModeEnum [Mode=0] - * @param ADODB.StreamOpenOptionsEnum [Options=-1] - * @param string [UserName=''] - * @param string [Password=''] + * @param Mode [Mode=0] + * @param Options [Options=-1] + * @param UserName [UserName=''] + * @param Password [Password=''] */ - Open(Source: any, Mode?: ConnectModeEnum, Options?: StreamOpenOptionsEnum, UserName?: string, Password?: string): void; + Open(Source?: string | Record, Mode?: ConnectModeEnum, Options?: StreamOpenOptionsEnum, UserName?: string, Password?: string): void; Position: number; - /** @param number [NumBytes=-1] */ + /** @param NumBytes [NumBytes=-1] */ Read(NumBytes?: number): any; - /** @param number [NumChars=-1] */ + /** @param NumChars [NumChars=-1] */ ReadText(NumChars?: number): string; - /** @param ADODB.SaveOptionsEnum [Options=1] */ + /** @param Options [Options=1] */ SaveToFile(FileName: string, Options?: SaveOptionsEnum): void; SetEOS(): void; readonly Size: number; @@ -966,7 +1051,7 @@ declare namespace ADODB { Type: StreamTypeEnum; Write(Buffer: any): void; - /** @param ADODB.StreamWriteEnum [Options=0] */ + /** @param Options [Options=0] */ WriteText(Data: string, Options?: StreamWriteEnum): void; } @@ -1009,60 +1094,23 @@ declare namespace ADODB { } interface ActiveXObject { - on( - obj: ADODB.Connection, event: 'BeginTransComplete', argNames: ['TransactionLevel', 'pError', 'adStatus', 'pConnection'], handler: ( - this: ADODB.Connection, parameter: { - readonly TransactionLevel: number, readonly pError: ADODB.Error, adStatus: ADODB.EventStatusEnum, readonly pConnection: ADODB.Connection}) => void): void; - on( - obj: ADODB.Connection, event: 'CommitTransComplete' | 'ConnectComplete' | 'InfoMessage' | 'RollbackTransComplete', argNames: ['pError', 'adStatus', 'pConnection'], - handler: (this: ADODB.Connection, parameter: {readonly pError: ADODB.Error, adStatus: ADODB.EventStatusEnum, readonly pConnection: ADODB.Connection}) => void): void; - on( - obj: ADODB.Connection, event: 'Disconnect', argNames: ['adStatus', 'pConnection'], handler: ( - this: ADODB.Connection, parameter: {adStatus: ADODB.EventStatusEnum, readonly pConnection: ADODB.Connection}) => void): void; - on( - obj: ADODB.Connection, event: 'ExecuteComplete', argNames: ADODB.EventHelperTypes.Connection_ExecuteComplete_ArgNames, handler: ( - this: ADODB.Connection, parameter: ADODB.EventHelperTypes.Connection_ExecuteComplete_Parameter) => void): void; - on( - obj: ADODB.Connection, event: 'WillConnect', argNames: ADODB.EventHelperTypes.Connection_WillConnect_ArgNames, handler: ( - this: ADODB.Connection, parameter: ADODB.EventHelperTypes.Connection_WillConnect_Parameter) => void): void; - on( - obj: ADODB.Connection, event: 'WillExecute', argNames: ADODB.EventHelperTypes.Connection_WillExecute_ArgNames, handler: ( - this: ADODB.Connection, parameter: ADODB.EventHelperTypes.Connection_WillExecute_Parameter) => void): void; - on( - obj: ADODB.Recordset, event: 'EndOfRecordset', argNames: ['fMoreData', 'adStatus', 'pRecordset'], handler: ( - this: ADODB.Recordset, parameter: {fMoreData: boolean, adStatus: ADODB.EventStatusEnum, readonly pRecordset: ADODB.Recordset}) => void): void; - on( - obj: ADODB.Recordset, event: 'FetchComplete', argNames: ['pError', 'adStatus', 'pRecordset'], handler: ( - this: ADODB.Recordset, parameter: {readonly pError: ADODB.Error, adStatus: ADODB.EventStatusEnum, readonly pRecordset: ADODB.Recordset}) => void): void; - on( - obj: ADODB.Recordset, event: 'FetchProgress', argNames: ['Progress', 'MaxProgress', 'adStatus', 'pRecordset'], handler: ( - this: ADODB.Recordset, parameter: {readonly Progress: number, readonly MaxProgress: number, adStatus: ADODB.EventStatusEnum, readonly pRecordset: ADODB.Recordset}) => void): void; - on( - obj: ADODB.Recordset, event: 'FieldChangeComplete', argNames: ['cFields', 'Fields', 'pError', 'adStatus', 'pRecordset'], handler: ( - this: ADODB.Recordset, parameter: { - readonly cFields: number, readonly Fields: any, readonly pError: ADODB.Error, adStatus: ADODB.EventStatusEnum, readonly pRecordset: ADODB.Recordset}) => void): void; - on( - obj: ADODB.Recordset, event: 'MoveComplete' | 'RecordsetChangeComplete', argNames: ['adReason', 'pError', 'adStatus', 'pRecordset'], - handler: ( - this: ADODB.Recordset, parameter: { - readonly adReason: ADODB.EventReasonEnum, readonly pError: ADODB.Error, adStatus: ADODB.EventStatusEnum, readonly pRecordset: ADODB.Recordset}) => void): void; - on( - obj: ADODB.Recordset, event: 'RecordChangeComplete', argNames: ['adReason', 'cRecords', 'pError', 'adStatus', 'pRecordset'], handler: ( - this: ADODB.Recordset, parameter: { - readonly adReason: ADODB.EventReasonEnum, readonly cRecords: number, readonly pError: ADODB.Error, - adStatus: ADODB.EventStatusEnum, readonly pRecordset: ADODB.Recordset}) => void): void; - on( - obj: ADODB.Recordset, event: 'WillChangeField', argNames: ['cFields', 'Fields', 'adStatus', 'pRecordset'], handler: ( - this: ADODB.Recordset, parameter: {readonly cFields: number, readonly Fields: any, adStatus: ADODB.EventStatusEnum, readonly pRecordset: ADODB.Recordset}) => void): void; - on( - obj: ADODB.Recordset, event: 'WillChangeRecord', argNames: ['adReason', 'cRecords', 'adStatus', 'pRecordset'], handler: ( - this: ADODB.Recordset, parameter: { - readonly adReason: ADODB.EventReasonEnum, readonly cRecords: number, adStatus: ADODB.EventStatusEnum, readonly pRecordset: ADODB.Recordset}) => void): void; - on( - obj: ADODB.Recordset, event: 'WillChangeRecordset' | 'WillMove', argNames: ['adReason', 'adStatus', 'pRecordset'], handler: ( - this: ADODB.Recordset, parameter: {readonly adReason: ADODB.EventReasonEnum, adStatus: ADODB.EventStatusEnum, readonly pRecordset: ADODB.Recordset}) => void): void; - set(obj: ADODB.Recordset, propertyName: 'Collect', parameterTypes: [any], newValue: any): void; new(progid: K): ActiveXObjectNameMap[K]; + on(obj: ADODB.Connection, event: 'BeginTransComplete', argNames: ['TransactionLevel', 'pError', 'adStatus', 'pConnection'], handler: (this: ADODB.Connection, parameter: {readonly TransactionLevel: number, readonly pError: ADODB.Error, adStatus: ADODB.EventStatusEnum, readonly pConnection: ADODB.Connection}) => void): void; + on(obj: ADODB.Connection, event: 'CommitTransComplete' | 'ConnectComplete' | 'InfoMessage' | 'RollbackTransComplete', argNames: ['pError', 'adStatus', 'pConnection'], handler: (this: ADODB.Connection, parameter: {readonly pError: ADODB.Error, adStatus: ADODB.EventStatusEnum, readonly pConnection: ADODB.Connection}) => void): void; + on(obj: ADODB.Connection, event: 'Disconnect', argNames: ['adStatus', 'pConnection'], handler: (this: ADODB.Connection, parameter: {adStatus: ADODB.EventStatusEnum, readonly pConnection: ADODB.Connection}) => void): void; + on(obj: ADODB.Connection, event: 'ExecuteComplete', argNames: ADODB.EventHelperTypes.Connection_ExecuteComplete_ArgNames, handler: (this: ADODB.Connection, parameter: ADODB.EventHelperTypes.Connection_ExecuteComplete_Parameter) => void): void; + on(obj: ADODB.Connection, event: 'WillConnect', argNames: ADODB.EventHelperTypes.Connection_WillConnect_ArgNames, handler: (this: ADODB.Connection, parameter: ADODB.EventHelperTypes.Connection_WillConnect_Parameter) => void): void; + on(obj: ADODB.Connection, event: 'WillExecute', argNames: ADODB.EventHelperTypes.Connection_WillExecute_ArgNames, handler: (this: ADODB.Connection, parameter: ADODB.EventHelperTypes.Connection_WillExecute_Parameter) => void): void; + on(obj: ADODB.Recordset, event: 'EndOfRecordset', argNames: ['fMoreData', 'adStatus', 'pRecordset'], handler: (this: ADODB.Recordset, parameter: {fMoreData: boolean, adStatus: ADODB.EventStatusEnum, readonly pRecordset: ADODB.Recordset}) => void): void; + on(obj: ADODB.Recordset, event: 'FetchComplete', argNames: ['pError', 'adStatus', 'pRecordset'], handler: (this: ADODB.Recordset, parameter: {readonly pError: ADODB.Error, adStatus: ADODB.EventStatusEnum, readonly pRecordset: ADODB.Recordset}) => void): void; + on(obj: ADODB.Recordset, event: 'FetchProgress', argNames: ['Progress', 'MaxProgress', 'adStatus', 'pRecordset'], handler: (this: ADODB.Recordset, parameter: {readonly Progress: number, readonly MaxProgress: number, adStatus: ADODB.EventStatusEnum, readonly pRecordset: ADODB.Recordset}) => void): void; + on(obj: ADODB.Recordset, event: 'FieldChangeComplete', argNames: ['cFields', 'Fields', 'pError', 'adStatus', 'pRecordset'], handler: (this: ADODB.Recordset, parameter: {readonly cFields: number, readonly Fields: any, readonly pError: ADODB.Error, adStatus: ADODB.EventStatusEnum, readonly pRecordset: ADODB.Recordset}) => void): void; + on(obj: ADODB.Recordset, event: 'MoveComplete' | 'RecordsetChangeComplete', argNames: ['adReason', 'pError', 'adStatus', 'pRecordset'], handler: (this: ADODB.Recordset, parameter: {readonly adReason: ADODB.EventReasonEnum, readonly pError: ADODB.Error, adStatus: ADODB.EventStatusEnum, readonly pRecordset: ADODB.Recordset}) => void): void; + on(obj: ADODB.Recordset, event: 'RecordChangeComplete', argNames: ['adReason', 'cRecords', 'pError', 'adStatus', 'pRecordset'], handler: (this: ADODB.Recordset, parameter: {readonly adReason: ADODB.EventReasonEnum, readonly cRecords: number, readonly pError: ADODB.Error, adStatus: ADODB.EventStatusEnum, readonly pRecordset: ADODB.Recordset}) => void): void; + on(obj: ADODB.Recordset, event: 'WillChangeField', argNames: ['cFields', 'Fields', 'adStatus', 'pRecordset'], handler: (this: ADODB.Recordset, parameter: {readonly cFields: number, readonly Fields: any, adStatus: ADODB.EventStatusEnum, readonly pRecordset: ADODB.Recordset}) => void): void; + on(obj: ADODB.Recordset, event: 'WillChangeRecord', argNames: ['adReason', 'cRecords', 'adStatus', 'pRecordset'], handler: (this: ADODB.Recordset, parameter: {readonly adReason: ADODB.EventReasonEnum, readonly cRecords: number, adStatus: ADODB.EventStatusEnum, readonly pRecordset: ADODB.Recordset}) => void): void; + on(obj: ADODB.Recordset, event: 'WillChangeRecordset' | 'WillMove', argNames: ['adReason', 'adStatus', 'pRecordset'], handler: (this: ADODB.Recordset, parameter: {readonly adReason: ADODB.EventReasonEnum, adStatus: ADODB.EventStatusEnum, readonly pRecordset: ADODB.Recordset}) => void): void; + set(obj: ADODB.Recordset, propertyName: 'Collect', parameterTypes: [any], newValue: any): void; } interface ActiveXObjectNameMap { @@ -1073,14 +1121,3 @@ interface ActiveXObjectNameMap { 'ADODB.Recordset': ADODB.Recordset; 'ADODB.Stream': ADODB.Stream; } - -interface EnumeratorConstructor { - new(col: ADODB.Errors): Enumerator; - new(col: ADODB.Fields): Enumerator; - new(col: ADODB.Parameters): Enumerator; - new(col: ADODB.Properties): Enumerator; -} - -interface SafeArray { - _brand: SafeArray; -} diff --git a/types/activex-adodb/tslint.json b/types/activex-adodb/tslint.json index 3224b40b8b..7b89accc6d 100644 --- a/types/activex-adodb/tslint.json +++ b/types/activex-adodb/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "no-const-enum": false + "no-const-enum": false, + "max-line-length": false } } diff --git a/types/activex-adox/activex-adox-tests.ts b/types/activex-adox/activex-adox-tests.ts new file mode 100644 index 0000000000..1b6ec21d1f --- /dev/null +++ b/types/activex-adox/activex-adox-tests.ts @@ -0,0 +1,1204 @@ +const collectionToArray = (col: { Item(key: any): T }): T[] => { + const results: T[] = []; + const enumerator = new Enumerator(col); + enumerator.moveFirst(); + while (!enumerator.atEnd()) { + results.push(enumerator.item()); + enumerator.moveNext(); + } + return results; +}; + +const toConnectionString = (o: { [index: string]: any }) => { + o.Provider = o.Provider || 'sqloledb'; + o['Data Source'] = o['Data Source'] || 'Server'; + o['Integrated Security'] = o['Integrated Security'] || 'SSPI'; + + const parts: string[] = []; + for (const key in o) { + let val = o[key]; + if (typeof val === 'string') { val = `'${val}'`; } + parts.push(`${key}=${val}`); + } + return parts.join(';'); +}; + +const connectionString = toConnectionString({ + Provider: 'Microsoft.Jet.OLEDB.4.0', + 'Data Source': 'c:\\Program Files\\Microsoft Office\\Office\\Samples\\Northwind.mdb' +}); +const connectionStringWithSys = toConnectionString({ + Provider: 'Microsoft.Jet.OLEDB.4.0', + 'Data Source': 'c:\\Program Files\\Microsoft Office\\Office\\Samples\\Northwind.mdb', + 'jet oledb:system database': 'c:\\Program Files\\Microsoft Office\\Office\\system.mdw' +}); + +const adPermObjTable = ADOX.ObjectTypeEnum.adPermObjTable; +const adRightFull = ADOX.RightsEnum.adRightFull; + +const adInteger = ADODB.DataTypeEnum.adInteger; +const adVarWChar = ADODB.DataTypeEnum.adVarWChar; +const adVarChar = ADODB.DataTypeEnum.adVarChar; + +const adOpenKeyset = ADODB.CursorTypeEnum.adOpenKeyset; +const adLockOptimistic = ADODB.LockTypeEnum.adLockOptimistic; + +const tryClose = (obj: { State: ADODB.ObjectStateEnum, Close(): void } | null) => { + // TODO State could also be a combination of multiple values in this enum + if (obj && obj.State === ADODB.ObjectStateEnum.adStateOpen) { + obj.Close(); + } + return null; +}; + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/columns-and-tables-append-methods-name-property-example-vb +{ + let cat: ADOX.Catalog | null = null; + let tbl: ADOX.Table | null = null; + try { + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = connectionString; + + tbl = new ActiveXObject('ADOX.Table'); + tbl.Name = 'MyTable'; + tbl.Columns.Append('Column1', adInteger); + tbl.Columns.Append('Column2', adInteger); + tbl.Columns.Append('Column3', adVarChar, 50); + cat.Tables.Append(tbl); + WScript.Echo('Table "MyTables" is added.'); + + cat.Tables.Delete(tbl.Name); + WScript.Echo('Table "MyTable" is deleted'); + + cat.ActiveConnection = null; + } catch (error) { + WScript.Echo(error); + } finally { + if (cat) { + cat.ActiveConnection = null; + } + cat = null; + tbl = null; + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/connection-close-method-table-type-property-example-vb +{ + let conn: ADODB.Connection | null = null; + let cat: ADOX.Catalog | null = null; + try { + conn = new ActiveXObject('ADODB.Connection'); + conn.Open(connectionString); + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = conn; + const tbl = cat.Tables(0); + WScript.Echo(tbl.Type); // Cache tbl.Type info + cat.ActiveConnection = null; // tbl is orphaned + + // The following two lines will succeed only if the information was cached + WScript.Echo(tbl.Type); + WScript.Echo(tbl.Columns(0).DefinedSize); + } catch (error) { + WScript.Echo(error); + } finally { + // Clean up + if (cat) { cat.ActiveConnection = null; } + cat = null; + conn = tryClose(conn); + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/create-method-example-vb +{ + let cat: ADOX.Catalog | null = null; + try { + cat = new ActiveXObject('ADOX.Catalog'); + cat.Create("Provider='Microsoft.Jet.OLEDB.4.0';Data Source='new.mdb'"); + } catch (error) { + WScript.Echo(error); + } finally { + cat = null; + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/getobjectowner-and-setobjectowner-methods-example-vb +{ + const cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = connectionStringWithSys; + + // Print the original owner of Categories + const strOwner = cat.GetObjectOwner('Categories', adPermObjTable); + WScript.Echo(`Ower of Categories: ${strOwner}`); + + // Set the owner of Categories to Accounting + cat.SetObjectOwner('Categories', adPermObjTable, 'Accounting'); + + for (const tblLoop of collectionToArray(cat.Tables)) { + WScript.Echo(` +Table: ${tblLoop.Name} +Owner: ${cat.GetObjectOwner(tblLoop.Name, adPermObjTable)} + `.trim()); + } + + // Restore the original owner of Categories + cat.SetObjectOwner('Categories', adPermObjTable, strOwner); +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/getpermissions-and-setpermissions-methods-example-vb +{ + let cnn: ADODB.Connection | null = null; + let cat: ADOX.Catalog | null = null; + try { + cnn = new ActiveXObject('ADODB.Connection'); + cnn.Provider = 'Microsoft.Jet.OLEDB.4.0'; + cnn.Open("Data Source='Northwind.mdb';jet oledb:system database='system.mdw'"); + + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = cnn; + + const displayPermissions = (title: string) => + WScript.Echo(`${title}: ${cat!.Users('admin').GetPermissions('Orders', adPermObjTable)}`); + + // Retrieve original permissions + const perm = cat.Users('admin').GetPermissions('Orders', adPermObjTable); + WScript.Echo(`Permissions: ${perm}`); + + // Revoke all permissions + cat.Users('admin').SetPermissions('Orders', adPermObjTable, ADOX.ActionEnum.adAccessRevoke, adRightFull); + displayPermissions('Revoked permissions'); + + // Give the Admin user full rights on the orders object + cat.Users('admin').SetPermissions('Orders', adPermObjTable, ADOX.ActionEnum.adAccessSet, adRightFull); + displayPermissions('Full permissions'); + + // Restore original permissions + cat.Users('admin').SetPermissions('Orders', adPermObjTable, ADOX.ActionEnum.adAccessSet, perm); + displayPermissions('Final permissions'); + } catch (error) { + WScript.Echo(error); + } finally { + cat = null; + cnn = tryClose(cnn); + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/groups-and-users-append-changepassword-methods-example-vb +{ + let cat: ADOX.Catalog | null = null; + let usrNew: ADOX.User | null = null; + let usrLoop: ADOX.User | null; + let grpLoop: ADOX.Group | null; + let user: ADOX.User | null; + let group: ADOX.Group | null; + try { + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = connectionStringWithSys; + + // Create and append a new group with a string + cat.Groups.Append('Accounting'); + + // Create and append a new user with an object + usrNew = new ActiveXObject('ADOX.User'); + usrNew.Name = 'Pat Smith'; + usrNew.ChangePassword('', 'Password1'); + cat.Users.Append(usrNew); + + // Make the user Pat Smith a member of the + // Accounting group by creating and adding the + // appropriate Group object to the user's Groups + // collection. The same is accomplished if a User + // object representing Pat Smith is created and + // appended to the Accounting group Users collection + usrNew.Groups.Append('Accounting'); + + // Enumerate all User objects in the catalog's Users collection. + for (usrLoop of collectionToArray(cat.Users)) { + WScript.Echo(`${usrLoop.Name} belongs to the following groups:`); + + // Enumerate all Group objects in each User object's Groups collection + const groups = collectionToArray(usrLoop.Groups); + if (groups.length !== 0) { + for (group of groups) { + WScript.Echo(`\t\t${group.Name}`); + } + } else { + WScript.Echo('\t[None]'); + } + } + + // Enumerate all Group objects in the default workspace's Groups collection + for (grpLoop of collectionToArray(cat.Groups)) { + WScript.Echo(`${grpLoop.Name} has as its members:`); + + // Enumerate all User objects in each Group object's User collection + const users = collectionToArray(grpLoop.Users); + if (users.length !== 0) { + for (user of users) { + WScript.Echo(`\t\t${user.Name}`); + } + } else { + WScript.Echo('\t[None]'); + } + } + + // Delete new User and Group objects because this is only a demonstration + cat.Users.Delete('Pat Smith'); + cat.Groups.Delete('Accounting'); + } catch (error) { + WScript.Echo(error); + } finally { + if (cat) { cat.ActiveConnection = null; } + cat = null; + usrNew = null; + usrLoop = null; + grpLoop = null; + user = null; + group = null; + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/indexes-append-method-example-vb +{ + let cat: ADOX.Catalog | null = null; + let tbl: ADOX.Table | null = null; + let idx: ADOX.Index | null = null; + try { + // Open the catalog + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = connectionString; + + // Define the table and append it to the catalog + tbl = new ActiveXObject('ADOX.Table'); + tbl.Name = 'MyTable'; + tbl.Columns.Append('Column1', adInteger); + tbl.Columns.Append('Column2', adInteger); + tbl.Columns.Append('Column3', adVarChar, 50); + cat.Tables.Append(tbl); + WScript.Echo('Table "MyTables" is added.'); + + // Define a multi-column index + idx = new ActiveXObject('ADOX.Index'); + idx.Name = 'multicolidx'; + idx.Columns.Append('Column1'); + idx.Columns.Append('Column2'); + + // Append the index to the table + tbl.Indexes.Append(idx); + WScript.Echo('The index is appended to table "MyTable".'); + + // Delete the table as this is a demonstration + cat.Tables.Delete(tbl.Name); + WScript.Echo('Table "MyTable" is deleeted.'); + } catch (error) { + WScript.Echo(error); + } finally { + if (cat) { cat.ActiveConnection = null; } + cat = null; + tbl = null; + idx = null; + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/keys-append-method-key-type-relatedcolumn-relatedtable-example-vb +{ + let cat: ADOX.Catalog | null = null; + let kyForeign: ADOX.Key | null = null; + try { + // Connect to the catalog + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = connectionString; + + // Define the foreign key + kyForeign = new ActiveXObject('ADOX.Key'); + kyForeign.Name = 'CustOrder'; + kyForeign.Type = ADOX.KeyTypeEnum.adKeyForeign; + kyForeign.RelatedTable = 'Customers'; + kyForeign.Columns.Append('CustomerId'); + kyForeign.Columns('CustomerId').RelatedColumn = 'CustomerID'; + kyForeign.UpdateRule = ADOX.RuleEnum.adRICascade; + + // Append the foreign key to the keys collection + cat.Tables('Orders').Keys.Append(kyForeign); + + // Delete the key to demonstrate the Detele method + cat.Tables('Orders').Keys.Delete(kyForeign.Name); + } catch (error) { + WScript.Echo(error); + } finally { + if (cat) { cat.ActiveConnection = null; } + cat = null; + kyForeign = null; + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/procedures-append-method-example-vb +{ + let cnn: ADODB.Connection | null = null; + let cmd: ADODB.Command | null = null; + let cat: ADOX.Catalog | null = null; + try { + // Open the Connection + cnn = new ActiveXObject('ADODB.Connection'); + cnn.Open(connectionString); + + // Create the parameterized command (Microsoft Jet specific) + cmd = new ActiveXObject('ADODB.Command'); + cmd.ActiveConnection = cnn; + cmd.CommandText = ` + PARAMETERS [CustId] TEXT; + SELECT * FROM Customers WHERE CustomerId = [CustId] + `; + + // Open the Catalog + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = cnn; + + // Create the new Procedure + cat.Procedures.Append('CustomerById', cmd); + } catch (error) { + WScript.Echo(error); + } finally { + cat = null; + cmd = null; + cnn = tryClose(cnn); + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/procedures-delete-method-example-vb +{ + let cat: ADOX.Catalog | null = null; + try { + // Open the catalog + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = connectionString; + + // Delete the procedure + cat.Procedures.Delete('CustomerById'); + } catch (error) { + WScript.Echo(error); + } finally { + if (cat) { cat.ActiveConnection = null; } + cat = null; + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/procedures-refresh-method-example-vb +{ + let cat: ADOX.Catalog | null = null; + try { + // Open the catalog + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = connectionString; + + // Refresh the Procedures collection + cat.Procedures.Refresh(); + } catch (error) { + WScript.Echo(error); + } finally { + if (cat) { cat.ActiveConnection = null; } + cat = null; + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/views-append-method-example-vb +{ + let cat: ADOX.Catalog | null = null; + let cmd: ADODB.Command | null = null; + try { + // Open the catalog + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = connectionString; + + // Create the command representing the view. + cmd = new ActiveXObject('ADODB.Command'); + cmd.CommandText = 'SELECT * FROM Customers'; + + // Create the new View + cat.Views.Append('All Customers', cmd); + } catch (error) { + WScript.Echo(error); + } finally { + if (cat) { cat.ActiveConnection = null; } + cat = null; + cmd = null; + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/views-delete-method-example-vb +{ + let cat: ADOX.Catalog | null = null; + try { + // Open the catalog + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = connectionString; + + // Delete the View + cat.Views.Delete('All Customers'); + } catch (error) { + WScript.Echo(error); + } finally { + if (cat) { cat.ActiveConnection = null; } + cat = null; + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/views-refresh-method-example-vb +{ + let cat: ADOX.Catalog | null = null; + try { + // Open the catalog + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = connectionString; + + // Refresh the Views collection + cat.Views.Refresh(); + } catch (error) { + WScript.Echo(error); + } finally { + cat = null; + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/attributes-property-example-vb +{ + let cnn: ADODB.Connection | null = null; + let cat: ADOX.Catalog | null = null; + let tblEmp: ADOX.Table | null = null; + let colTemp: ADOX.Column | null = null; + let rstEmployees: ADODB.Recordset | null = null; + try { + // Connect the catalog + cnn = new ActiveXObject('ADODB.Connection'); + cnn.Open(connectionString); + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = cnn; + + tblEmp = cat.Tables('Employees'); + + // Create a new Field object and append it to the Field collection of the Employees table + colTemp = new ActiveXObject('ADOX.Column'); + colTemp.Name = 'FaxPhone'; + colTemp.Type = adVarWChar; + colTemp.DefinedSize = 24; + colTemp.Attributes = ADOX.ColumnAttributesEnum.adColNullable; + tblEmp.Columns.Append(colTemp.Name, ADODB.DataTypeEnum.adWChar, 24); + + // Open the Employees table for updating as a Recordset + rstEmployees = new ActiveXObject('ADODB.Recordset'); + rstEmployees.Open('Employees', cnn, adOpenKeyset, adLockOptimistic, ADODB.CommandTypeEnum.adCmdTable); + + // Get user input + WScript.Echo(` +Enter fax number for ${rstEmployees('FirstName')} ${rstEmployees('LastName')}. +[? - unknown, X - has no fax] + `.trim()); + const strInput = WScript.StdIn.ReadLine().toUpperCase().trim(); + if (strInput) { + let newValue: string | null; + if (strInput === '?') { + newValue = null; + } else if (strInput === 'X') { + newValue = ''; + } else { + newValue = strInput; + } + rstEmployees('FaxPhone').Value = newValue; + rstEmployees.Update(); + + // Print report + const faxValue = rstEmployees('FaxPhone').Value; + let faxDisplayString: string; + if (faxValue === null) { + faxDisplayString = '[Unkown]'; + } else if (faxValue === '') { + faxDisplayString = '[Has no fax]'; + } else { + faxDisplayString = faxValue; + } + WScript.Echo(` +Name\t\tFax number +${rstEmployees('FirstName')} ${rstEmployees('LastName')}\t\t${faxDisplayString} + `.trim()); + } + } catch (error) { + WScript.Echo(error); + } finally { + rstEmployees = tryClose(rstEmployees); + if (tblEmp) { + tblEmp.Columns.Delete(colTemp!.Name); + } + cnn = tryClose(cnn); + cat = null; + colTemp = null; + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/catalog-activeconnection-property-example-vb +{ + let cnn: ADODB.Connection | null = null; + let cat: ADOX.Catalog | null = null; + try { + cnn = new ActiveXObject('ADODB.Connection'); + cnn.Open(connectionString); + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = cnn; + WScript.Echo(cat.Tables(0).Type); + } catch (error) { + WScript.Echo(error); + } finally { + cat = null; + cnn = tryClose(cnn); + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/clustered-property-example-vb +{ + let cnn: ADODB.Connection | null = null; + let cat: ADOX.Catalog | null = null; + let tblLoop: ADOX.Table | null; + let idxLoop: ADOX.Index | null; + try { + // Connect to the catalog + cnn = new ActiveXObject('ADODB.Connection'); + cnn.Open(connectionString); + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = cnn; + + // Enumerate the tables + for (tblLoop of collectionToArray(cat.Tables)) { + // Enumerate the indexes + for (idxLoop of collectionToArray(tblLoop.Indexes)) { + WScript.Echo(`${tblLoop.Name} ${idxLoop.Name} ${idxLoop.Clustered}`); + } + } + } catch (error) { + WScript.Echo(error); + } finally { + cat = null; + cnn = tryClose(cnn); + tblLoop = null; + idxLoop = null; + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/command-and-commandtext-properties-example-vb +{ + let cnn: ADODB.Connection | null = null; + let cat: ADOX.Catalog | null = null; + let cmd: ADODB.Command | null = null; + try { + // Open the connection + cnn = new ActiveXObject('ADODB.Connection'); + cnn.Open(connectionString); + + // Open the catalog + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = cnn; + + // Get the command + cmd = new ActiveXObject('ADODB.Command'); + cmd = cat.Procedures('CustomerById').Command; + + // Update the CommandText + cmd.CommandText = ` + SELECT CustomerID, CompanyName ContactName + FROM Customers + WHERE CustomerId = [CustId] + `.trim(); + + // Update the procedure + cat.Procedures('CustomerById').Command = cmd; + } catch (error) { + WScript.Echo(error); + } finally { + cnn = tryClose(cnn); + cat = null; + cmd = null; + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/parameters-collection-command-property-example-vb +{ + let cnn: ADODB.Connection | null = null; + let cat: ADOX.Catalog | null = null; + let cmd: ADODB.Command | null = null; + let prm: ADODB.Parameter | null; + try { + // Open the connection + cnn = new ActiveXObject('ADODB.Connection'); + cnn.Open(connectionString); + + // Open the catalog + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = cnn; + + // Get the command + cmd = cat.Procedures('CustomerById').Command; + + // Retreive Parameter information + cmd.Parameters.Refresh(); + for (prm of collectionToArray(cmd.Parameters)) { + WScript.Echo(`${prm.Name}: ${prm.Type}`); + } + } catch (error) { + WScript.Echo(error); + } finally { + cat = null; + cmd = null; + cnn = tryClose(cnn); + prm = null; + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/views-collection-commandtext-property-example-vb +{ + let cnn: ADODB.Connection | null = null; + let cat: ADOX.Catalog | null = null; + let cmd: ADODB.Command | null = null; + try { + // Open the connection + cnn = new ActiveXObject('ADODB.Connection'); + cnn.Open(connectionString); + + // Open the catalog + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = cnn; + + // Get the command + cmd = cat.Views('AllCustomers').Command; + + // Update the CommandText of the command + cmd.CommandText = 'SELECT CustomerId, CompanyName, ContactName FROM Customers'; + + // Update the view + cat.Views('AllCustomers').Command = cmd; + } catch (error) { + WScript.Echo(error); + } finally { + cat = null; + cmd = null; + cnn = tryClose(cnn); + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/datecreated-and-datemodified-properties-example-vb +{ + const dateOutput = (caption: string, tbl: ADOX.Table) => { + // Print DateCreated and DateModified information about specified Table object + WScript.Echo(caption); + WScript.Echo(`\tTable: ${tbl.Name}`); + WScript.Echo(`\t\t${new Date(tbl.DateCreated).toString()}`); + WScript.Echo(`\t\t${new Date(tbl.DateModified).toString()}`); + WScript.Echo(''); + }; + + let cat: ADOX.Catalog | null = null; + try { + // Connect to the catalog. + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = connectionString; + const tblEmployees = cat.Tables('Employees'); + + // Print current information about the Employees table + dateOutput('Current properties', tblEmployees); + + // Create and append column to the Employees table. + tblEmployees.Columns.Append('NewColumn', adInteger); + cat.Tables.Refresh(); + + // Print new information about the Employees table. + dateOutput('After creating a new column', tblEmployees); + + // Delete new column because this is a demonstration + tblEmployees.Columns.Delete('NewColumn'); + + // Create and append new Table object to the Northwind database + const tblNewTable = new ActiveXObject('ADOX.Table'); + tblNewTable.Name = 'NewTable'; + tblNewTable.Columns.Append('NewColumn', adInteger); + cat.Tables.Append(tblNewTable); + cat.Tables.Refresh(); + + // Print information about the new Table object + dateOutput('After creating a new table', cat.Tables('NewTable')); + + // Delete new Table object because this is a demonstration + cat.Tables.Delete(tblNewTable.Name); + } catch (error) { + WScript.Echo(error); + } finally { + if (cat) { cat.ActiveConnection = null; } + cat = null; + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/definedsize-property-example-vb +{ + let rstEmployees: ADODB.Recordset | null = null; + let catNorthwind: ADOX.Catalog | null; + let colFirstname: ADOX.Column | null; + let colNewFirstName: ADOX.Column | null; + try { + // Open a Recordset for the Employees table. + rstEmployees = new ActiveXObject('ADODB.Recordset'); + rstEmployees.Open('Employees', connectionString, adOpenKeyset, undefined, ADODB.CommandTypeEnum.adCmdTable); + + // Open a Catalog for the Northwind database, using same connection as rstEmployees + catNorthwind = new ActiveXObject('ADOX.Catalog'); + catNorthwind.ActiveConnection = rstEmployees.ActiveConnection; + + // Loop through the recordset displaying the contents of the FirstName field, the field's defined size, + // and its actual size. Also store FirstName values in aryFirstName array. + rstEmployees.MoveFirst(); + WScript.Echo(''); + WScript.Echo('Original Defined Size and Actual Size'); + const firstnames: string[] = []; + for (let i = 0; !rstEmployees.EOF; i++) { + const firstField = rstEmployees('FirstName'); + const [firstname, lastname] = [firstField.Value as string, rstEmployees('LastName').Value as string]; + WScript.Echo(`Employee name: ${firstname} ${lastname}`); + WScript.Echo(`\tFirstName Defined size: ${firstField.DefinedSize}`); + WScript.Echo(`\tFirstName Actual size: ${firstField.ActualSize}`); + firstnames[i] = firstname; // we don't check for null, because null is better than undefined when putting the first names back + rstEmployees.MoveNext(); + } + rstEmployees.Close(); + + // Redefine the DefinedSize of FirstName in the catalog + colFirstname = catNorthwind.Tables('Employees').Columns('FirstName'); + colNewFirstName = new ActiveXObject('ADOX.Column'); + colNewFirstName.Name = colFirstname.Name; + colNewFirstName.Type = colFirstname.Type; + colNewFirstName.DefinedSize = colFirstname.DefinedSize + 1; + + // Append new FirstName column to catalog + catNorthwind.Tables('Employees').Columns.Delete(colFirstname.Name); + catNorthwind.Tables('Employees').Columns.Append(colNewFirstName); + + // Open Employee table in Recordset for updating + rstEmployees.Open('Employees', catNorthwind.ActiveConnection!, adOpenKeyset, adLockOptimistic, ADODB.CommandTypeEnum.adCmdTable); + + // Loop through the recordset displaying the contents of the FirstName field, the field's defined size, + // and its actual size. Also restore FirstName values from aryFirstName. + rstEmployees.MoveFirst(); + WScript.Echo(''); + WScript.Echo('Original Defined Size and Actual Size'); + for (let i = 0; !rstEmployees.EOF; i++) { + const firstField = rstEmployees('FirstName'); + firstField.Value = firstnames[i]; + WScript.Echo(`Employee name: ${firstField.Value} ${rstEmployees('LastName').Value}`); + WScript.Echo(`\tFirstName Defined size: ${firstField.DefinedSize}`); + WScript.Echo(`\tFirstName Actual size: ${firstField.ActualSize}`); + rstEmployees.MoveNext(); + } + rstEmployees.Close(); + + // Restore original FirstName column to catalog + catNorthwind.Tables('Employees').Columns.Delete(colNewFirstName.Name); + catNorthwind.Tables('Employees').Columns.Append(colFirstname); + + // Restore original FirstName values to Employees table + rstEmployees.Open('Employees', catNorthwind.ActiveConnection!, adOpenKeyset, adLockOptimistic, ADODB.CommandTypeEnum.adCmdTable); + rstEmployees.MoveFirst(); + for (let i = 0; !rstEmployees.EOF; i++) { + rstEmployees('FirstName').Value = firstnames[i]; + rstEmployees.MoveNext(); + } + rstEmployees.Close(); + } catch (error) { + WScript.Echo(error); + } finally { + catNorthwind = null; + colNewFirstName = null; + colFirstname = null; + rstEmployees = tryClose(rstEmployees); + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/deleterule-property-example-vb +{ + let cat: ADOX.Catalog | null = null; + let tblNew: ADOX.Table | null; + let kyPrimary: ADOX.Key | null; + try { + // Connect the catalog + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = connectionString; + + // Name new table + tblNew = new ActiveXObject('ADOX.Table'); + tblNew.Name = 'NewTable'; + + // Append a numeric and a text field to new table. + tblNew.Columns.Append('NumField', adInteger, 20); + tblNew.Columns.Append('TextField', adVarChar, 20); + + // Append the new table + cat.Tables.Append(tblNew); + + // Define the Primary key + kyPrimary = new ActiveXObject('ADOX.Key'); + kyPrimary.Name = 'NumField'; + kyPrimary.Type = ADOX.KeyTypeEnum.adKeyPrimary; + kyPrimary.RelatedTable = 'Customers'; + kyPrimary.Columns.Append('NumField'); + kyPrimary.Columns('NumField').RelatedColumn = 'CustomerId'; + kyPrimary.DeleteRule = ADOX.RuleEnum.adRICascade; + + // Append the primary key + cat.Tables('NewTable').Keys.Append(kyPrimary); + WScript.Echo('The primary key is appended.'); + + // Delete the table as this is a demonstration. + cat.Tables.Delete(tblNew.Name); + WScript.Echo('The primary key is deleted.'); + } catch (error) { + WScript.Echo(error); + } finally { + if (cat) { cat.ActiveConnection = null; } + cat = null; + kyPrimary = null; + tblNew = null; + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/indexnulls-property-example-vb +{ + // Connect the catalog. + const cnn = new ActiveXObject('ADODB.Connection'); + cnn.Open(connectionString); + + let catNorthwind: ADOX.Catalog | null = new ActiveXObject('ADOX.Catalog'); + catNorthwind.ActiveConnection = cnn; + + // Append Country column to new index + const idxNew = new ActiveXObject('ADOX.Index'); + idxNew.Columns.Append('Country'); + idxNew.Name = 'NewIndex'; + + // Set IndexNulls based on user selection + WScript.Echo('Allow nulls Y/N (Y to allow, N to ignore)?'); + const input = WScript.StdIn.ReadLine().toUpperCase(); + switch (input) { + case 'Y': + idxNew.IndexNulls = ADOX.AllowNullsEnum.adIndexNullsAllow; + break; + case 'N': + idxNew.IndexNulls = ADOX.AllowNullsEnum.adIndexNullsIgnore; + break; + } + + // Append new index to Employees table + catNorthwind.Tables('Employees').Indexes.Append(idxNew); + + const rstEmployees = new ActiveXObject('ADODB.Recordset'); + rstEmployees.Index = idxNew.Name; + rstEmployees.Open('Employees', cnn, adOpenKeyset, adLockOptimistic, ADODB.CommandTypeEnum.adCmdTableDirect); + + // Add a new record to the Employees table. + rstEmployees.AddNew(); + rstEmployees('FirstName').Value = 'Gary'; + rstEmployees('LastName').Value = 'Haarsager'; + rstEmployees.Update(); + + // Bookmark the newly added record + const bookmark = rstEmployees.Bookmark; + + // Use the new index to set the order of the records. + rstEmployees.MoveFirst(); + + WScript.Echo(`Index = ${rstEmployees.Index}, IndexNulls = ${idxNew.IndexNulls}`); + WScript.Echo('\tCountry - Name'); + + // Enumerate the Recordset. The value of the IndexNulls property will determine if the newly added record appears in the output. + while (!rstEmployees.EOF) { + const country = rstEmployees('Country').Value as string | null || '[NULL]'; + WScript.Echo(`\t${country} - ${rstEmployees('FirstName').Value} ${rstEmployees('LastName').Value}`); + rstEmployees.MoveNext(); + } + + // Delete new record because this is a demonstration. + rstEmployees.Bookmark = bookmark; + rstEmployees.Delete(); + + rstEmployees.Close(); + + catNorthwind.Tables('Employees').Indexes.Delete(idxNew.Name); + catNorthwind = null; +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/adox-code-example-numericscale-and-precision-properties-example-vb +{ + let cnn: ADODB.Connection | null = null; + let cat: ADOX.Catalog | null; + let colLoop: ADOX.Column | null; + try { + // Connect the catalog. + cnn = new ActiveXObject('ADODB.Connection'); + cnn.Open(connectionString); + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = cnn; + + // Retrieve the Order Details table + const tblOD = cat.Tables('Order Details'); + + // Display numeric scale and precision of small integer fields. + for (colLoop of collectionToArray(tblOD.Columns)) { + if (colLoop.Type === ADODB.DataTypeEnum.adSmallInt) { + WScript.Echo(` +Column: ${colLoop.Name} +Numeric scale: ${colLoop.NumericScale} +Precision: ${colLoop.Precision} + `.trim()); + } + } + } catch (error) { + WScript.Echo(error); + } finally { + cat = null; + cnn = tryClose(cnn); + colLoop = null; + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/parentcatalog-property-example-vb +{ + let cnn: ADODB.Connection | null = null; + let cat: ADOX.Catalog | null; + let tbl: ADOX.Table | null; + try { + cnn = new ActiveXObject('ADODB.Connection'); + cnn.Open(connectionString); + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = cnn; + + tbl = new ActiveXObject('ADOX.Table'); + tbl.Name = 'MyContacts'; + tbl.ParentCatalog = cat; + + // Create fields and append them to the new Table object. + tbl.Columns.Append('ContactId', adInteger); + tbl.Columns.Append('CustomerID', adVarWChar); + tbl.Columns.Append('FirstName', adVarWChar); + tbl.Columns.Append('LastName', adVarWChar); + tbl.Columns.Append('Phone', adVarWChar, 20); + tbl.Columns.Append('Notes', ADODB.DataTypeEnum.adLongVarWChar); + + // Make the ContactId column an auto incrementing column + tbl.Columns('ContactId').Properties('AutoIncrement').Value = true; + + cat.Tables.Append(tbl); + WScript.Echo(`Table 'MyContacts' is added.`); + + // Delete the table as this is a demonstration. + cat.Tables.Delete(tbl.Name); + WScript.Echo(`Table 'MyContacts' is deleted.`); + } catch (error) { + WScript.Echo(error); + } finally { + cnn = tryClose(cnn); + cat = null; + tbl = null; + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/primarykey-and-unique-properties-example-vb +{ + let catNorthwind: ADOX.Catalog | null = null; + let tblNew: ADOX.Table | null; + let idxNew: ADOX.Index | null; + let idxLoop: ADOX.Index | null; + try { + // Connect the catalog + catNorthwind = new ActiveXObject('ADOX.Catalog'); + catNorthwind.ActiveConnection = connectionString; + + // Name new table + tblNew = new ActiveXObject('ADOX.Table'); + tblNew.Name = 'NewTable'; + + // Append a numeric and a text field to new table. + tblNew.Columns.Append('NumField', adInteger, 20); + tblNew.Columns.Append('TextField', adVarWChar, 20); + + // Append new Primary Key index on NumField column to new table + idxNew = new ActiveXObject('ADOX.Index'); + idxNew.Name = 'NumIndex'; + idxNew.Columns.Append('NumField'); + idxNew.PrimaryKey = true; + idxNew.Unique = true; + tblNew.Indexes.Append(idxNew); + + // Append an index on Textfield to new table.. + // Note the different technique: Specifying index and column name as parameters of the Append method + tblNew.Indexes.Append('TextIndex', 'TextField'); + + // Append the new table + catNorthwind.Tables.Append(tblNew); + + WScript.Echo(`${tblNew.Indexes.Count} indexes in '${tblNew.Name}' table`); + + // Enumerate Indexes collection. + for (idxLoop of collectionToArray(tblNew.Indexes)) { + WScript.Echo(` +Index ${idxLoop.Name} + Primary key = ${idxLoop.PrimaryKey} + Unique = ${idxLoop.Unique} + Columns = ${collectionToArray(idxLoop.Columns).map(colLoop => colLoop.Name).join(', ')} + `.trim()); + } + + // Delete new table as this is a demonstration. + catNorthwind.Tables.Delete(tblNew.Name); + } catch (error) { + WScript.Echo(error); + } finally { + if (catNorthwind) { catNorthwind.ActiveConnection = null; } + catNorthwind = null; + tblNew = null; + idxNew = null; + idxLoop = null; + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/sortorder-property-example-vb +{ + let cnn: ADODB.Connection | null = null; + let catNorthwind: ADOX.Catalog | null; + let idxAscending: ADOX.Index | null; + let rstEmployees: ADODB.Recordset | null = null; + let idxDescending: ADOX.Index | null; + + try { + // Connect to the catalog. + cnn = new ActiveXObject('ADODB.Connection'); + cnn.Open(connectionString); + catNorthwind = new ActiveXObject('ADOX.Catalog'); + catNorthwind.ActiveConnection = cnn; + + const enumerateRecordset = (indexName: string) => { + rstEmployees = new ActiveXObject('ADODB.Recordset'); + rstEmployees.Index = indexName; + rstEmployees.Open('Employees', cnn!, adOpenKeyset, adLockOptimistic, ADODB.CommandTypeEnum.adCmdTableDirect); + + rstEmployees.MoveFirst(); + WScript.Echo(`Index = ${rstEmployees.Index}`); + WScript.Echo('\tCountry - Name'); + + // Enumerate the Recordset. The value of the IndexNulls property will determine if the newly added record appears in the output. + while (!rstEmployees.EOF) { + WScript.Echo(`\t${rstEmployees('Country').Value} - ${rstEmployees('FirstName').Value} ${rstEmployees('LastName').Value}`); + rstEmployees.MoveNext(); + } + + rstEmployees.Close(); + }; + + // Append Country column to new index. + idxAscending = new ActiveXObject('ADOX.Index'); + idxAscending.Columns.Append('Country'); + idxAscending.Columns('Country').SortOrder = ADOX.SortOrderEnum.adSortAscending; + idxAscending.Name = 'Ascending'; + idxAscending.IndexNulls = ADOX.AllowNullsEnum.adIndexNullsAllow; + + // Append new index to Employees table. + catNorthwind.Tables('Employees').Indexes.Append(idxAscending); + + enumerateRecordset(idxAscending.Name); + + // Append Country column to new index. + idxDescending = new ActiveXObject('ADOX.Index'); + idxDescending.Columns.Append('Country'); + idxDescending.Columns('Country').SortOrder = ADOX.SortOrderEnum.adSortDescending; + idxDescending.Name = 'Descending'; + idxDescending.IndexNulls = ADOX.AllowNullsEnum.adIndexNullsAllow; + + // Append descending index to Employees table. + catNorthwind.Tables('Employees').Indexes.Append(idxDescending); + + enumerateRecordset(idxDescending.Name); + + // Delete new indexes because this is a demonstration. + catNorthwind.Tables('Employees').Indexes.Delete(idxAscending.Name); + catNorthwind.Tables('Employees').Indexes.Delete(idxDescending.Name); + } catch (error) { + WScript.Echo(error); + } finally { + cnn = tryClose(cnn); + catNorthwind = null; + idxAscending = null; + idxDescending = null; + rstEmployees = tryClose(rstEmployees); + } +} + +// https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/views-and-fields-collections-example-vb +{ + let cnn: ADODB.Connection | null = null; + let cat: ADOX.Catalog | null; + let rst: ADODB.Recordset | null = null; + let fld: ADODB.Field | null; + try { + // Open the Connection + cnn = new ActiveXObject('ADODB.Connection'); + cnn.Open(connectionString); + + // Open the catalog + cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = cnn; + + // Set the Source for the Recordset + rst = new ActiveXObject('ADODB.Recordset'); + rst.Source = cat.Views('AllCustomers').Command; + + // Retrieve Field information + rst.Fields.Refresh(); + + for (fld of collectionToArray(rst.Fields)) { + WScript.Echo(`${fld.Name}.${fld.Type}`); + } + } catch (error) { + WScript.Echo(error); + } finally { + cnn = tryClose(cnn); + cat = null; + rst = tryClose(rst); + fld = null; + } +} + +const flatten = (arr: T[][], result: T[] = []) => { + for (let i = 0, length = arr.length; i < length; i++) { + const value: T | any[] = arr[i]; // any in this context is because the array might have an arbitrary depth + if (Array.isArray(value)) { + flatten(value, result); + } else { + result.push(value); + } + } + return result; +}; + +// List indexes with multiple columns +{ + interface TableIndex { + tbl: ADOX.Table; + idx: ADOX.Index; + } + + const cat = new ActiveXObject('ADOX.Catalog'); + cat.ActiveConnection = connectionString; + + let multicolumnIndexes = flatten( + collectionToArray(cat.Tables).map(tbl => + collectionToArray(tbl.Indexes).map(idx => + ({ tbl, idx }) + ) + ) + ).filter(x => x.idx.Columns.Count > 1); + for (const x of multicolumnIndexes) { + const columns = collectionToArray(x.idx.Columns).map(col => col.Name).join(', '); + WScript.Echo(`${x.tbl.Name}.${x.idx.Name} -- ${columns}`); + } + multicolumnIndexes = []; +} diff --git a/types/activex-adox/index.d.ts b/types/activex-adox/index.d.ts new file mode 100644 index 0000000000..8960dd0a31 --- /dev/null +++ b/types/activex-adox/index.d.ts @@ -0,0 +1,335 @@ +// Type definitions for Microsoft ADO Extensions 6.0 for DDL and Security - ADOX 6.0 +// Project: https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/adox-object-model +// Definitions by: Zev Spitz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/// + +declare namespace ADOX { + const enum ActionEnum { + adAccessDeny = 3, + adAccessGrant = 1, + adAccessRevoke = 4, + adAccessSet = 2, + } + + const enum AllowNullsEnum { + adIndexNullsAllow = 0, + adIndexNullsDisallow = 1, + adIndexNullsIgnore = 2, + adIndexNullsIgnoreAny = 4, + } + + const enum ColumnAttributesEnum { + adColFixed = 1, + adColNullable = 2, + } + + const enum InheritTypeEnum { + adInheritBoth = 3, + adInheritContainers = 2, + adInheritNone = 0, + adInheritNoPropogate = 4, + adInheritObjects = 1, + } + + const enum KeyTypeEnum { + adKeyForeign = 2, + adKeyPrimary = 1, + adKeyUnique = 3, + } + + const enum ObjectTypeEnum { + adPermObjColumn = 2, + adPermObjDatabase = 3, + adPermObjProcedure = 4, + adPermObjProviderSpecific = -1, + adPermObjTable = 1, + adPermObjView = 5, + } + + const enum RightsEnum { + adRightCreate = 16384, + adRightDelete = 65536, + adRightDrop = 256, + adRightExclusive = 512, + adRightExecute = 536870912, + adRightFull = 268435456, + adRightInsert = 32768, + adRightMaximumAllowed = 33554432, + adRightNone = 0, + adRightRead = -2147483648, + adRightReadDesign = 1024, + adRightReadPermissions = 131072, + adRightReference = 8192, + adRightUpdate = 1073741824, + adRightWithGrant = 4096, + adRightWriteDesign = 2048, + adRightWriteOwner = 524288, + adRightWritePermissions = 262144, + } + + const enum RuleEnum { + adRICascade = 1, + adRINone = 0, + adRISetDefault = 3, + adRISetNull = 2, + } + + const enum SortOrderEnum { + adSortAscending = 1, + adSortDescending = 2, + } + + class Catalog { + private constructor(); + private 'ADOX.Catalog_typekey': Catalog; + + /** Can be set to a Connection object or a string. Returns the active Connection object, or `null` */ + ActiveConnection: string | ADODB.Connection | null; + + /** + * The **Create** method creates and opens a new ADO Connection to the data source specified in _ConnectString_. If successful, the new **Connection** object is assigned to the **ActiveConnection** property. + * + * An error will occur if the provider does not support creating new catalogs. + * + * @param ConnectString Connection string + */ + Create(ConnectString: string): void; + + /** + * @param ObjectTypeId Specifies the GUID for a provider object type not defined by the OLE DB specification + */ + GetObjectOwner(ObjectName: string, ObjectType: ObjectTypeEnum.adPermObjProviderSpecific, ObjectTypeId: any): string; + GetObjectOwner(ObjectName: string, ObjectType: ObjectTypeEnum): string; + readonly Groups: Groups; + readonly Procedures: Procedures; + + /** + * @param UserName Specifies the name of the **User** or **Group** to own the object + * @param ObjectTypeId Specifies the GUID for a provider object type that is not defined by the OLE DB specification + */ + SetObjectOwner(ObjectName: string, ObjectType: ObjectTypeEnum.adPermObjProviderSpecific, UserName: string, ObjectTypeId: any): void; + SetObjectOwner(ObjectName: string, ObjectType: ObjectTypeEnum, UserName: string): void; + readonly Tables: Tables; + readonly Users: Users; + readonly Views: Views; + } + + class Column { + private constructor(); + private 'ADOX.Column_typekey': Column; + Attributes: ColumnAttributesEnum; + DefinedSize: number; + Name: string; + NumericScale: number; + ParentCatalog: Catalog; + Precision: number; + readonly Properties: ADODB.Properties; + RelatedColumn: string; + SortOrder: SortOrderEnum; + Type: ADODB.DataTypeEnum; + } + + interface Columns { + /** + * @param Type [Type=202] + * @param DefinedSize [DefinedSize=0] + */ + Append(Item: Column | string, Type?: ADODB.DataTypeEnum, DefinedSize?: number): void; + readonly Count: number; + Delete(Item: string | number): void; + Item(Item: string | number): Column; + Refresh(): void; + (Item: string | number): Column; + } + + class Group { + private constructor(); + private 'ADOX.Group_typekey': Group; + + /** + * @param Name Specifies the name of the object for which to set permissions. Pass `null` if you want to get the permissions for the object container. + * @param ObjectTypeId Specifies the GUID for a provider object type not defined by the OLE DB specification. + */ + GetPermissions(Name: string | null, ObjectType: ObjectTypeEnum.adPermObjProviderSpecific, ObjectTypeId: any): RightsEnum; + GetPermissions(Name: string | null, ObjectType: ObjectTypeEnum): RightsEnum; + Name: string; + ParentCatalog: Catalog; + readonly Properties: ADODB.Properties; + + /** + * @param Rights A bitmask of one or more of the **RightsEnum** constants, that indicates the rights to set. + * @param Inherit [Inherit=0] + * @param ObjectTypeId Specifies the GUID for a provider object type not defined by the OLE DB specification. + */ + SetPermissions(Name: string, ObjectType: ObjectTypeEnum.adPermObjProviderSpecific, Action: ActionEnum, Rights: RightsEnum, Inherit: InheritTypeEnum, ObjectTypeId: any): void; + SetPermissions(Name: string, ObjectType: ObjectTypeEnum, Action: ActionEnum, Rights: RightsEnum, Inherit?: InheritTypeEnum): void; + readonly Users: Users; + } + + interface Groups { + Append(Item: Group | string): void; + readonly Count: number; + Delete(Item: string | number): void; + Item(Item: string | number): Group; + Refresh(): void; + (Item: string | number): Group; + } + + class Index { + private constructor(); + private 'ADOX.Index_typekey': Index; + Clustered: boolean; + readonly Columns: Columns; + IndexNulls: AllowNullsEnum; + Name: string; + PrimaryKey: boolean; + readonly Properties: ADODB.Properties; + Unique: boolean; + } + + // tslint:disable-next-line:interface-name + interface Indexes { + Append(Item: Index | string, Columns?: string | SafeArray): void; // is this actually two overloads, one with [Index] and one with [string,string | SafeArray]? + readonly Count: number; + Delete(Item: string | number): void; + Item(Item: string | number): Index; + Refresh(): void; + (Item: string | number): Index; + } + + class Key { + private constructor(); + private 'ADOX.Key_typekey': Key; + readonly Columns: Columns; + DeleteRule: RuleEnum; + Name: string; + RelatedTable: string; + Type: KeyTypeEnum; + UpdateRule: RuleEnum; + } + + interface Keys { + /** + * @param Type [Type=1] + * @param RelatedTable [RelatedTable=''] + * @param RelatedColumn [RelatedColumn=''] + */ + Append(Item: Key | string, Type?: KeyTypeEnum, Column?: string | SafeArray, RelatedTable?: string, RelatedColumn?: string): void; + readonly Count: number; + Delete(Item: string | number): void; + Item(Item: string | number): Key; + Refresh(): void; + (Item: string | number): Key; + } + + class Procedure { + private constructor(); + private 'ADOX.Procedure_typekey': Procedure; + Command: ADODB.Command; + readonly DateCreated: VarDate | null; + readonly DateModified: VarDate | null; + readonly Name: string; + } + + interface Procedures { + Append(Name: string, Command: ADODB.Command): void; + readonly Count: number; + Delete(Item: string | number): void; + Item(Item: string | number): Procedure; + Refresh(): void; + (Item: string | number): Procedure; + } + + class Table { + private constructor(); + private 'ADOX.Table_typekey': Table; + readonly Columns: Columns; + readonly DateCreated: VarDate; + readonly DateModified: VarDate; + readonly Indexes: Indexes; + readonly Keys: Keys; + Name: string; + ParentCatalog: Catalog; + readonly Properties: ADODB.Properties; + readonly Type: string; + } + + interface Tables { + Append(Item: Table | string): void; + readonly Count: number; + Delete(Item: string | number): void; + Item(Item: string | number): Table; + Refresh(): void; + (Item: string | number): Table; + } + + class User { + private constructor(); + private 'ADOX.User_typekey': User; + ChangePassword(OldPassword: string, NewPassword: string): void; + + /** + * @param Name Specifies the name of the object for which to set permissions. Pass `null` if you want to get the permissions for the object container. + * @param ObjectTypeId Specifies the GUID for a provider object type not defined by the OLE DB specification. + */ + GetPermissions(Name: string | null, ObjectType: ObjectTypeEnum.adPermObjProviderSpecific, ObjectTypeId: any): RightsEnum; + GetPermissions(Name: string | null, ObjectType: ObjectTypeEnum): RightsEnum; + readonly Groups: Groups; + Name: string; + ParentCatalog: Catalog; + readonly Properties: ADODB.Properties; + + /** + * @param Rights A bitmask of one or more of the **RightsEnum** constants, that indicates the rights to set. + * @param Inherit [Inherit=0] + * @param ObjectTypeId Specifies the GUID for a provider object type not defined by the OLE DB specification. + */ + SetPermissions(Name: string, ObjectType: ObjectTypeEnum.adPermObjProviderSpecific, Action: ActionEnum, Rights: RightsEnum, Inherit: InheritTypeEnum, ObjectTypeId: any): void; + SetPermissions(Name: string, ObjectType: ObjectTypeEnum, Action: ActionEnum, Rights: RightsEnum, Inherit?: InheritTypeEnum): void; + } + + interface Users { + /** @param Password [Password=''] */ + Append(Item: User | string, Password?: string): void; + readonly Count: number; + Delete(Item: string | number): void; + Item(Item: string | number): User; + Refresh(): void; + (Item: string | number): User; + } + + class View { + private constructor(); + private 'ADOX.View_typekey': View; + Command: ADODB.Command; + readonly DateCreated: VarDate; + readonly DateModified: VarDate; + readonly Name: string; + } + + interface Views { + Append(Name: string, Command: ADODB.Command): void; + readonly Count: number; + Delete(Item: string | number): void; + Item(Item: string | number): View; + Refresh(): void; + (Item: string | number): View; + } +} + +interface ActiveXObject { + new(progid: K): ActiveXObjectNameMap[K]; +} + +interface ActiveXObjectNameMap { + 'ADOX.Catalog': ADOX.Catalog; + 'ADOX.Column': ADOX.Column; + 'ADOX.Group': ADOX.Group; + 'ADOX.Index': ADOX.Index; + 'ADOX.Key': ADOX.Key; + 'ADOX.Table': ADOX.Table; + 'ADOX.User': ADOX.User; +} diff --git a/types/activex-adox/package.json b/types/activex-adox/package.json new file mode 100644 index 0000000000..d9b1031263 --- /dev/null +++ b/types/activex-adox/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "activex-helpers": "*" + } +} \ No newline at end of file diff --git a/types/activex-adox/tsconfig.json b/types/activex-adox/tsconfig.json new file mode 100644 index 0000000000..7aaa955db5 --- /dev/null +++ b/types/activex-adox/tsconfig.json @@ -0,0 +1,22 @@ + +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es5", "scripthost"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "activex-adox-tests.ts" + ] +} \ No newline at end of file diff --git a/types/activex-adox/tslint.json b/types/activex-adox/tslint.json new file mode 100644 index 0000000000..b06c06beef --- /dev/null +++ b/types/activex-adox/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false, + "max-line-length": false + } +} \ No newline at end of file diff --git a/types/activex-infopath/index.d.ts b/types/activex-infopath/index.d.ts index 1aa8cba2f9..c00c67e197 100644 --- a/types/activex-infopath/index.d.ts +++ b/types/activex-infopath/index.d.ts @@ -2,7 +2,7 @@ // Project: https://msdn.microsoft.com/en-us/library/jj602751.aspx // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 /// /// From 2111782c01a2daccabdbc92d617306ca84872690 Mon Sep 17 00:00:00 2001 From: leozhao0709 Date: Wed, 18 Apr 2018 17:05:05 -0700 Subject: [PATCH 0744/2153] add prompt options (#24983) add prompt options which used to prompt the user to select their account --- types/passport/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/passport/index.d.ts b/types/passport/index.d.ts index 4a91d2b64b..0be63d337e 100644 --- a/types/passport/index.d.ts +++ b/types/passport/index.d.ts @@ -51,6 +51,7 @@ declare namespace passport { pauseStream?: boolean; userProperty?: string; passReqToCallback?: boolean; + prompt?: string; } interface Authenticator { From aa93526d48b171bcec787e806993332ffd9b3128 Mon Sep 17 00:00:00 2001 From: Bruno Scheufler <4772980+BrunoScheufler@users.noreply.github.com> Date: Thu, 19 Apr 2018 17:45:08 +0200 Subject: [PATCH 0745/2153] Node: Added missing windowsHide properties to SpawnOptions (revision) (#25122) * Added missing windowsHide properties to SpawnOptions of child_process module * Retrigger CI --- types/node/index.d.ts | 2 ++ types/node/node-tests.ts | 3 ++- types/node/v8/index.d.ts | 2 ++ types/node/v8/node-tests.ts | 5 +++-- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index d27e680aed..50a17ddb76 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -20,6 +20,7 @@ // Klaus Meinhardt // Huw // Nicolas Even +// Bruno Scheufler // Mohsen Azimi // Hoàng Văn Khải // Alexander T. @@ -2087,6 +2088,7 @@ declare module "child_process" { gid?: number; shell?: boolean | string; windowsVerbatimArguments?: boolean; + windowsHide?: boolean; } export function spawn(command: string, args?: string[], options?: SpawnOptions): ChildProcess; diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index 776364a740..7a055c620e 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -2059,7 +2059,8 @@ namespace string_decoder_tests { namespace child_process_tests { { childProcess.exec("echo test"); - childProcess.exec("echo test", {windowsHide: true}); + childProcess.exec("echo test", { windowsHide: true }); + childProcess.spawn("echo", ["test"], { windowsHide: true }); childProcess.spawnSync("echo test"); childProcess.spawnSync("echo test", {windowsVerbatimArguments: false}); } diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index 642a957eca..f055cd0716 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -19,6 +19,7 @@ // Alberto Schiabel // Huw // Nicolas Even +// Bruno Scheufler // Hoàng Văn Khải // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -2086,6 +2087,7 @@ declare module "child_process" { gid?: number; shell?: boolean | string; windowsVerbatimArguments?: boolean; + windowsHide?: boolean; } export function spawn(command: string, args?: string[], options?: SpawnOptions): ChildProcess; diff --git a/types/node/v8/node-tests.ts b/types/node/v8/node-tests.ts index 2546184d0a..a79d96aa6a 100644 --- a/types/node/v8/node-tests.ts +++ b/types/node/v8/node-tests.ts @@ -2033,9 +2033,10 @@ namespace string_decoder_tests { namespace child_process_tests { { childProcess.exec("echo test"); - childProcess.exec("echo test", {windowsHide: true}); + childProcess.spawn("echo", ["test"], { windowsHide: true }); + childProcess.exec("echo test", { windowsHide: true }); childProcess.spawnSync("echo test"); - childProcess.spawnSync("echo test", {windowsVerbatimArguments: false}); + childProcess.spawnSync("echo test", { windowsVerbatimArguments: false }); } { From 92760d42ac53cc42e49cb694e21d890e3a948767 Mon Sep 17 00:00:00 2001 From: falsandtru Date: Fri, 20 Apr 2018 02:05:43 +0900 Subject: [PATCH 0746/2153] mocha: fix a regression bug (#25117) * Revert "IRunner should be an instance of EventEmitter (#24971)" This reverts commit 4478031e2fbc4ed9cafbe27ea4eb28f787cca00c. * Bump version * Add tests --- types/mocha/index.d.ts | 7 ++----- types/mocha/mocha-tests.ts | 5 +++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/types/mocha/index.d.ts b/types/mocha/index.d.ts index b99fa24ab2..0e066791eb 100644 --- a/types/mocha/index.d.ts +++ b/types/mocha/index.d.ts @@ -1,16 +1,13 @@ -// Type definitions for mocha 5.1 +// Type definitions for mocha 5.2 // Project: http://mochajs.org/ // Definitions by: Kazi Manzur Rashid // otiai10 // jt000 // Vadim Macagon // Andrew Bradley -// Dmitrii Sorin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 -/// - interface MochaSetupOptions { // milliseconds to wait before considering a test slow slow?: number; @@ -204,7 +201,7 @@ declare namespace Mocha { } /** Partial interface for Mocha's `Runner` class. */ - interface IRunner extends NodeJS.EventEmitter { + interface IRunner { stats?: IStats; started: boolean; suite: ISuite; diff --git a/types/mocha/mocha-tests.ts b/types/mocha/mocha-tests.ts index 4694c66fe7..f2fa323f19 100644 --- a/types/mocha/mocha-tests.ts +++ b/types/mocha/mocha-tests.ts @@ -10,6 +10,11 @@ import { xit as importedXit } from 'mocha'; +// Warning!! +// Don't refer node.d.ts!! +// See #22510. +(): number => setTimeout(() => 0, 0); + let boolean: boolean; let string: string; let number: number; From 026ef4246a938045684872351966d2d490560632 Mon Sep 17 00:00:00 2001 From: Andy Patterson Date: Thu, 19 Apr 2018 13:09:13 -0400 Subject: [PATCH 0747/2153] [@types/mathjs] tests only test types, not runtime behaviour (#24875) --- types/mathjs/mathjs-tests.ts | 575 ++++++++++------------------------- 1 file changed, 157 insertions(+), 418 deletions(-) diff --git a/types/mathjs/mathjs-tests.ts b/types/mathjs/mathjs-tests.ts index 306ab44ccd..6cf43dc698 100644 --- a/types/mathjs/mathjs-tests.ts +++ b/types/mathjs/mathjs-tests.ts @@ -3,20 +3,16 @@ Basic usage examples */ { // functions and constants - math.round(math.e, 3); // 2.718 - math.atan2(3, -3) / math.pi; // 0.75 - math.log(10000, 10); // 4 - math.sqrt(-4); // 2i - math.pow([[-1, 2], [3, 1]], 2); // [[7, 0], [0, 7]] + math.round(math.e, 3); + math.atan2(3, -3) / math.pi; + math.log(10000, 10); + math.sqrt(-4); + math.pow([[-1, 2], [3, 1]], 2); const angle = 0.2; - math.add(math.pow(math.sin(angle), 2), math.pow(math.cos(angle), 2)); // returns number ~1 + math.add(math.pow(math.sin(angle), 2), math.pow(math.cos(angle), 2)); // expressions - math.eval('1.2 * (2 + 4.5)'); // 7.8 - math.eval('5.08 cm to inch'); // 2 inch - math.eval('sin(45 deg) ^ 2'); // 0.5 - math.eval('9 / 3 + 2i'); // 3 + 2i - math.eval('det([-1, 2; 3, 1])'); // -7 + math.eval('1.2 * (2 + 4.5)'); // chained operations const a = math.chain(3) @@ -25,7 +21,6 @@ Basic usage examples .done(); // 14 // mixed use of different data types in functions - console.log('mixed use of data types'); math.add(4, [5, 6]); // number + Array, [9, 10] math.multiply(math.unit('5 mm'), 3); // Unit * number, 15 mm math.subtract([2, 3, 4], 5); // Array - number, [-3, -2, -1] @@ -38,40 +33,20 @@ Bignumbers examples { // configure the default type of numbers as BigNumbers math.config({ - number: 'bignumber', // Default type of number: - // 'number' (default), 'bignumber', or 'fraction' - precision: 20 // Number of significant digits for BigNumbers + number: 'bignumber', + precision: 20, }); - console.log('round-off errors with numbers'); - math.add(0.1, 0.2); // number, 0.30000000000000004 - math.divide(0.3, 0.2); // number, 1.4999999999999998 - console.log(); - - console.log('no round-off errors with BigNumbers'); - math.add(math.bignumber(0.1), math.bignumber(0.2)); // BigNumber, 0.3 - math.divide(math.bignumber(0.3), math.bignumber(0.2)); // BigNumber, 1.5 - console.log(); - - console.log('create BigNumbers from strings when exceeding the range of a number'); - math.bignumber(1.2e+500); // BigNumber, Infinity WRONG - math.bignumber('1.2e+500'); // BigNumber, 1.2e+500 - console.log(); - - // one can work conveniently with BigNumbers using the expression parser. - // note though that BigNumbers are only supported in arithmetic functions - console.log('use BigNumbers in the expression parser'); - math.eval('0.1 + 0.2'); // BigNumber, 0.3 - math.eval('0.3 / 0.2'); // BigNumber, 1.5 - console.log(); + { + math.add(math.bignumber(0.1), math.bignumber(0.2)); // BigNumber, 0.3 + math.divide(math.bignumber(0.3), math.bignumber(0.2)); // BigNumber, 1.5 + } } /* Chaining examples */ { - // create a chained operation using the function `chain(value)` - // end a chain using done(). Let's calculate (3 + 4) * 2 const a = math.chain(3) .add(4) .multiply(2) @@ -82,19 +57,13 @@ Chaining examples .divide(4) .sin() .square() - .done(); // 0.5 - - // A chain has a few special methods: done, toString, valueOf, get, and set. - // these are demonstrated in the following examples + .done(); // toString will return a string representation of the chain's value const chain = math.chain(2).divide(3); - const str = chain.toString(); // "0.6666666666666666" + const str: string = chain.toString(); // "0.6666666666666666" - // a chain has a function .valueOf(), which returns the value hold by the chain. - // This allows using it in regular operations. The function valueOf() acts the - // same as function done(). - chain.valueOf(); // 0.66666666666667 + chain.valueOf(); // the function subset can be used to get or replace sub matrices const array = [[1, 2], [3, 4]]; @@ -105,212 +74,114 @@ Chaining examples const m = math.chain(array) .subset(math.index(0, 0), 8) .multiply(3) - .done(); // [[24, 6], [9, 12]] + .done(); } /* Complex numbers examples */ { - const a = math.complex(2, 3); // 2 + 3i + const a = math.complex(2, 3); + // create a complex number by providing a string with real and complex parts + const b = math.complex('3 - 7i'); // read the real and complex parts of the complex number - a.re; // 2 - a.im; // 3 + { + const x: number = a.re; + const y: number = a.im; + + // adjust the complex value + a.re = 5; + } // clone a complex value - const clone = a.clone(); // 2 + 3i - - // adjust the complex value - a.re = 5; // 5 + 3i - - // create a complex number by providing a string with real and complex parts - const b = math.complex('3 - 7i'); // 3 - 7i - console.log(); + { + const clone = a.clone(); + } // perform operations with complex numbers - console.log('perform operations'); - math.add(a, b); // 8 - 4i - math.multiply(a, b); // 36 - 26i - math.sin(a); // -9.6541254768548 + 2.8416922956064i - - // some operations will return a complex number depending on the arguments - math.sqrt(4); // 2 - math.sqrt(-4); // 2i + { + math.add(a, b); + math.multiply(a, b); + math.sin(a); + } // create a complex number from polar coordinates - console.log('create complex numbers with polar coordinates'); - const c = math.complex({r: math.sqrt(2), phi: math.pi / 4}); // 1 + i + { + const p: math.PolarCoordinates = { r: math.sqrt(2), phi: math.pi / 4 }; + const c: math.Complex = math + .complex(p); + } // get polar coordinates of a complex number - const d = math.complex(3, 4); - d.toPolar(); // { r: 5, phi: 0.9272952180016122 } + { + const p: math.PolarCoordinates = math + .complex(3, 4) + .toPolar(); + } } /* Expressions examples */ { - // 1. using the function math.eval - // - // Function `eval` accepts a single expression or an array with - // expressions as first argument, and has an optional second argument - // containing a scope with variables and functions. The scope is a regular - // JavaScript Object. The scope will be used to resolve symbols, and to write - // assigned variables or function. - console.log('1. USING FUNCTION MATH.EVAL'); - // evaluate expressions - console.log('\nevaluate expressions'); - math.eval('sqrt(3^2 + 4^2)'); // 5 - math.eval('sqrt(-4)'); // 2i - math.eval('2 inch to cm'); // 5.08 cm - math.eval('cos(45 deg)'); // 0.70711 + { + math.eval('sqrt(3^2 + 4^2)'); + } // evaluate multiple expressions at once - console.log('\nevaluate multiple expressions at once'); - math.eval([ - 'f = 3', - 'g = 4', - 'f * g' - ]); // [3, 4, 12] - - // provide a scope (just a regular JavaScript Object) - console.log('\nevaluate expressions providing a scope with variables and functions'); - let scope: any = { - a: 3, - b: 4, - }; - - // variables can be read from the scope - math.eval('a * b', scope); // 12 - - // variable assignments are written to the scope - math.eval('c = 2.3 + 4.5', scope); // 6.8 - scope.c; // 6.8 + { + math.eval([ + 'f = 3', + 'g = 4', + 'f * g' + ]); + } // scope can contain both variables and functions - scope["hello"] = function(name: string) { - return `hello, ${name}!`; - }; - math.eval('hello("hero")', scope); // "hello, hero!" + { + const scope = { hello: (name: string) => `hello, ${name}!` }; + math.eval('hello("hero")', scope); // "hello, hero!" + } // define a function as an expression - let f = math.eval('f(x) = x ^ a', scope); - f(2); // 8 - scope.f(2); // 8 + { + const scope: any = { + a: 3, + b: 4, + }; + const f = math.eval('f(x) = x ^ a', scope); + f(2); + scope.f(2); + } - // 2. using function math.parse - // - // Function `math.parse` parses expressions into a node tree. The syntax is - // similar to function `math.eval`. - // Function `parse` accepts a single expression or an array with - // expressions as first argument. The function returns a node tree, which - // then can be compiled against math, and then evaluated against an (optional - // scope. This scope is a regular JavaScript Object. The scope will be used - // to resolve symbols, and to write assigned variables or function. - console.log('\n2. USING FUNCTION MATH.PARSE'); - - // parse an expression - console.log('\nparse an expression into a node tree'); - const node1 = math.parse('sqrt(3^2 + 4^2)'); - node1.toString(); // "sqrt((3 ^ 2) + (4 ^ 2))" - - // compile and evaluate the compiled code - // you could also do this in two steps: node1.compile().eval() - node1.eval(); // 5 - - // provide a scope - console.log('\nprovide a scope'); - const node2 = math.parse('x^a'); - let code2 = node2.compile(); - node2.toString(); // "x ^ a" - scope = { - x: 3, - a: 2, - }; - code2.eval(scope); // 9 - - // change a value in the scope and re-evaluate the node - scope.a = 3; - code2.eval(scope); // 27 + { + const node2 = math.parse('x^a'); + const code2: math.EvalFunction = node2.compile(); + node2.toString(); + } // 3. using function math.compile - // - // Function `math.compile` compiles expressions into a node tree. The syntax is - // similar to function `math.eval`. - // Function `compile` accepts a single expression or an array with - // expressions as first argument, and returns an object with a function eval - // to evaluate the compiled expression. On evaluation, an optional scope can - // be provided. This scope will be used to resolve symbols, and to write - // assigned variables or function. - console.log('\n3. USING FUNCTION MATH.COMPILE'); - // parse an expression - console.log('\ncompile an expression'); - const code3 = math.compile('sqrt(3^2 + 4^2)'); - - // evaluate the compiled code - code3.eval(); // 5 - - // provide a scope for the variable assignment - console.log('\nprovide a scope'); - code2 = math.compile('a = a + 3'); - scope = { a: 7 }; - code2.eval(scope); - scope.a; // 10 - + { + // provide a scope for the variable assignment + const code2 = math.compile('a = a + 3'); + const scope = { a: 7 }; + code2.eval(scope); + } // 4. using a parser - // - // In addition to the static functions `math.eval` and `math.parse`, math.js - // contains a parser with functions `eval` and `parse`, which automatically - // keeps a scope with assigned variables in memory. The parser also contains - // some convenience methods to get, set, and remove variables from memory. - console.log('\n4. USING A PARSER'); const parser = math.parser(); - // evaluate with parser - console.log('\nevaluate expressions'); - parser.eval('sqrt(3^2 + 4^2)'); // 5 - parser.eval('sqrt(-4)'); // 2i - parser.eval('2 inch to cm'); // 5.08 cm - parser.eval('cos(45 deg)'); // 0.70711 - - // define variables and functions - console.log('\ndefine variables and functions'); - parser.eval('x = 7 / 2'); // 3.5 - parser.eval('x + 3'); // 6.5 - parser.eval('f(x, y) = x^y'); // f(x, y) - parser.eval('f(2, 3)'); // 8 - - // manipulate matrices - // Note that matrix indexes in the expression parser are one-based with the - // upper-bound included. On a JavaScript level however, math.js uses zero-based - // indexes with an excluded upper-bound. - console.log('\nmanipulate matrices'); - parser.eval('k = [1, 2; 3, 4]'); // [[1, 2], [3, 4]] - parser.eval('l = zeros(2, 2)'); // [[0, 0], [0, 0]] - parser.eval('l[1, 1:2] = [5, 6]'); // [[5, 6], [0, 0]] - parser.eval('l[2, :] = [7, 8]'); // [[5, 6], [7, 8]] - parser.eval('m = k * l'); // [[19, 22], [43, 50]] - parser.eval('n = m[2, 1]'); // 43 - parser.eval('n = m[:, 1]'); // [[19], [43]] - // get and set variables and functions - console.log('\nget and set variables and function in the scope of the parser'); - const x = parser.get('x'); - console.log('x =', x); // x = 7 - f = parser.get('f'); - console.log('f =', math.format(f)); // f = f(x, y) - const g = f(3, 3); - console.log('g =', g); // g = 27 + { + const x = parser.get('x'); + const f = parser.get('f'); + const g = f(3, 3); - parser.set('h', 500); - parser.eval('h / 2'); // 250 - parser.set('hello', function(name: string) { - return `hello, ${name}!`; - }); - parser.eval('hello("hero")'); // "hello, hero!" + parser.set('h', 500); + parser.set('hello', (name: string) => `hello, ${name}!`); + } // clear defined functions and variables parser.clear(); @@ -322,51 +193,21 @@ Fractions examples { // configure the default type of numbers as Fractions math.config({ - number: 'fraction' // Default type of number: - // 'number' (default), 'bignumber', or 'fraction' + number: 'fraction', }); - console.log('basic usage'); - math.fraction(0.125); // Fraction, 1/8 - math.fraction(0.32); // Fraction, 8/25 - math.fraction('1/3'); // Fraction, 1/3 - math.fraction('0.(3)'); // Fraction, 1/3 - math.fraction(2, 3); // Fraction, 2/3 - math.fraction('0.(285714)'); // Fraction, 2/7 - console.log(); + const x = math.fraction(0.125); + const y = math.fraction('1/3'); + math.fraction(2, 3); - console.log('round-off errors with numbers'); - math.add(0.1, 0.2); // number, 0.30000000000000004 - math.divide(0.3, 0.2); // number, 1.4999999999999998 - console.log(); - - console.log('no round-off errors with fractions :)'); - math.add(math.fraction(0.1), math.fraction(0.2)); // Fraction, 3/10 - math.divide(math.fraction(0.3), math.fraction(0.2)); // Fraction, 3/2 - console.log(); - - console.log('represent an infinite number of repeating digits'); - math.fraction('1/3'); // Fraction, 0.(3) - math.fraction('2/7'); // Fraction, 0.(285714) - math.fraction('23/11'); // Fraction, 2.(09) - console.log(); - - // one can work conveniently with fractions using the expression parser. - // note though that Fractions are only supported by basic arithmetic functions - console.log('use fractions in the expression parser'); - math.eval('0.1 + 0.2'); // Fraction, 3/10 - math.eval('0.3 / 0.2'); // Fraction, 3/2 - math.eval('23 / 11'); // Fraction, 23/11 - console.log(); + math.add(x, y); + math.divide(x, y); // output formatting - console.log('output formatting of fractions'); const a = math.fraction('2/3'); - console.log(math.format(a)); // Fraction, 2/3 - console.log(math.format(a, {fraction: 'ratio'})); // Fraction, 2/3 - console.log(math.format(a, {fraction: 'decimal'})); // Fraction, 0.(6) - console.log(a.toString()); // Fraction, 0.(6) - console.log(); + console.log(math.format(a)); + console.log(math.format(a, {fraction: 'ratio'})); + console.log(math.format(a, {fraction: 'decimal'})); } /* @@ -375,76 +216,60 @@ Matrices examples { // create matrices and arrays. a matrix is just a wrapper around an Array, // providing some handy utilities. - console.log('create a matrix'); - const a = math.matrix([1, 4, 9, 16, 25]); // [1, 4, 9, 16, 25] - const b = math.matrix(math.ones([2, 3])); // [[1, 1, 1], [1, 1, 1]] - b.size(); // [2, 3] + const a: math.Matrix = math.matrix([1, 4, 9, 16, 25]); + const b: math.Matrix = math.matrix(math.ones([2, 3])); + b.size(); // the Array data of a Matrix can be retrieved using valueOf() - const array = a.valueOf(); // [1, 4, 9, 16, 25] + const array = a.valueOf(); // Matrices can be cloned - const clone = a.clone(); // [1, 4, 9, 16, 25] - console.log(); + const clone: math.Matrix = a.clone(); // perform operations with matrices - console.log('perform operations'); - math.sqrt(a); // [1, 2, 3, 4, 5] - const c = [1, 2, 3, 4, 5]; - math.factorial(c); // [1, 2, 6, 24, 120] - console.log(); + math.sqrt(a); + math.factorial(a); // create and manipulate matrices. Arrays and Matrices can be used mixed. - console.log('manipulate matrices'); - const d = [[1, 2], [3, 4]]; // [[1, 2], [3, 4]] - const e = math.matrix([[5, 6], [1, 1]]); // [[5, 6], [1, 1]] + { + const a = [[1, 2], [3, 4]]; + const b: math.Matrix = math.matrix([[5, 6], [1, 1]]); - // set a submatrix. - // Matrix indexes are zero-based. - e.subset(math.index(1, [0, 1]), [[7, 8]]); // [[5, 6], [7, 8]] - const f = math.multiply(d, e); // [[19, 22], [43, 50]] - const g = f.subset(math.index(1, 0)); // 43 - console.log(); + b.subset(math.index(1, [0, 1]), [[7, 8]]); + const c = math.multiply(a, b); + const d: math.Matrix = c.subset(math.index(1, 0)); + } // get a sub matrix - // Matrix indexes are zero-based. - console.log('get a sub matrix'); - const h = math.diag(math.range(1, 4)); // [[1, 0, 0], [0, 2, 0], [0, 0, 3]] - h.subset(math.index([1, 2], [1, 2])); // [[2, 0], [0, 3]] - const i = math.range(1, 6); // [1, 2, 3, 4, 5] - i.subset(math.index(math.range(1, 4))); // [2, 3, 4] - console.log(); + { + const a: math.Matrix = math.diag(math.range(1, 4)); + a.subset(math.index([1, 2], [1, 2])); + const b: math.Matrix = math.range(1, 6); + b.subset(math.index(math.range(1, 4))); + } // resize a multi dimensional matrix - console.log('resizing a matrix'); - const j = math.matrix(); - let defaultValue = 0; - j.resize([2, 2, 2], defaultValue); // [[[0, 0], [0, 0]], [[0, 0], [0, 0]]] - j.size(); // [2, 2, 2] - j.resize([2, 2]); // [[0, 0], [0, 0]] - j.size(); // [2, 2] - console.log(); + { + const a = math.matrix(); + a.resize([2, 2, 2], 0); + a.size(); + a.resize([2, 2]); + a.size(); + } - // setting a value outside the matrices range will resize the matrix. - // new elements will be initialized with zero. - console.log('set a value outside a matrices range'); - const k = math.matrix(); - k.subset(math.index(2), 6); // [0, 0, 6] - console.log(); - - console.log('set a value outside a matrices range, leaving new entries uninitialized'); - const m = math.matrix(); - defaultValue = math.uninitialized; - m.subset(math.index(2), 6, defaultValue); // [undefined, undefined, 6] - console.log(); + // can set a subset of a matrix to uninitialized + { + const m = math.matrix(); + m.subset(math.index(2), 6, math.uninitialized); + } // create ranges - console.log('create ranges'); - math.range(1, 6); // [1, 2, 3, 4, 5] - math.range(0, 18, 3); // [0, 3, 6, 9, 12, 15] - math.range('2:-1:-3'); // [2, 1, 0, -1, -2] - math.factorial(math.range('1:6')); // [1, 2, 6, 24, 120] - console.log(); + { + math.range(1, 6); + math.range(0, 18, 3); + math.range('2:-1:-3'); + math.factorial(math.range('1:6')); + } } /* @@ -452,20 +277,13 @@ Sparse matrices examples */ { // create a sparse matrix - console.log('creating a 1000x1000 sparse matrix...'); const a = math.eye(1000, 1000, 'sparse'); // do operations with a sparse matrix - console.log('doing some operations on the sparse matrix...'); const b = math.multiply(a, a); const c = math.multiply(b, math.complex(2, 2)); const d = math.transpose(c); const e = math.multiply(d, a); - - // we will not print the output, but doing the same operations - // with a dense matrix are very slow, try it for yourself. - console.log('already done'); - console.log('now try this with a dense matrix :)'); } /* @@ -474,10 +292,8 @@ Units examples { // units can be created by providing a value and unit name, or by providing // a string with a valued unit. - console.log('create units'); const a = math.unit(45, 'cm'); // 450 mm const b = math.unit('0.1m'); // 100 mm - console.log(); // creating units math.createUnit('foo'); @@ -509,88 +325,19 @@ Units examples math.createUnit('c', {definition: b}, {override: true}); // units can be added, subtracted, and multiplied or divided by numbers and by other units - console.log('perform operations'); - math.add(a, b); // 0.55 m - math.multiply(b, 2); // 200 mm - math.divide(math.unit('1 m'), math.unit('1 s')); // 1 m / s - math.pow(math.unit('12 in'), 3); // 1728 in^3 - console.log(); + math.add(a, b); + math.multiply(b, 2); + math.divide(math.unit('1 m'), math.unit('1 s')); + math.pow(math.unit('12 in'), 3); // units can be converted to a specific type, or to a number - console.log('convert to another type or to a number'); - b.to('cm'); // 10 cm Alternatively: math.to(b, 'cm') - math.to(b, 'inch'); // 3.9370... inch - b.toNumber('cm'); // 10 - math.number(b, 'cm'); // 10 - console.log(); + b.to('cm'); + math.to(b, 'inch'); + b.toNumber('cm'); + math.number(b, 'cm'); // the expression parser supports units too - console.log('parse expressions'); - math.eval('2 inch to cm'); // 5.08 cm - math.eval('cos(45 deg)'); // 0.70711... - math.eval('90 km/h to m/s'); // 25 m / s - console.log(); - - // convert a unit to a number - // A second parameter with the unit for the exported number must be provided - math.eval('number(5 cm, mm)'); // number, 50 - console.log(); - - // simplify units - console.log('simplify units'); - math.eval('100000 N / m^2'); // 100 kPa - math.eval('9.81 m/s^2 * 100 kg * 40 m'); // 39.24 kJ - console.log(); - - // example engineering calculations - console.log('compute molar volume of ideal gas at 65 Fahrenheit, 14.7 psi in L/mol'); - const Rg = math.unit('8.314 N m / (mol K)'); - const T = math.unit('65 degF'); - const P = math.unit('14.7 psi'); - const v = math.divide(math.multiply(Rg, T), P); - console.log('gas constant (Rg) = ', format(Rg)); - console.log('P = ' + format(P)); - console.log('T = ' + format(T)); - console.log('v = Rg * T / P = ' + format(math.to(v, 'L/mol'))); // 23.910... L / mol - console.log(); - - console.log('compute speed of fluid flowing out of hole in a container'); - const g = math.unit('9.81 m / s^2'); - const h = math.unit('1 m'); - const v2 = math.pow(math.multiply(2, math.multiply(g, h)), 0.5); // Can also use math.sqrt - console.log('g = ' + format(g)); - console.log('h = ' + format(h)); - console.log('v = (2 g h) ^ 0.5 = ' + format(v2)); // 4.429... m / s - console.log(); - - console.log('electrical power consumption:'); - let expr = '460 V * 20 A * 30 days to kWh'; - console.log(`${expr} = ${math.eval(expr)}`); // 6624 kWh - console.log(); - - console.log('circuit design:'); - expr = '24 V / (6 mA)'; - console.log(`${expr} = ${math.eval(expr)}`); // 4 kohm - console.log(); - - console.log('operations on arrays:'); - const B = math.eval('[1, 0, 0] T'); - const v3 = math.eval('[0, 1, 0] m/s'); - const q = math.eval('1 C'); - const F = math.multiply(q, math.cross(v3, B)); - console.log('B (magnetic field strength) = ' + format(B)); // [1 T, 0 T, 0 T] - console.log('v (particle velocity) = ' + format(v3)); // [0 m / s, 1 m / s, 0 m / s] - console.log('q (particle charge) = ' + format(q)); // 1 C - console.log('F (force) = q (v cross B) = ' + format(F)); // [0 N, 0 N, -1 N] - - /** - * Helper function to format an output a value. - * @return Returns the formatted value - */ - function format(value: any): string { - const precision = 14; - return math.format(value, precision); - } + math.eval('2 inch to cm'); } /* @@ -598,31 +345,23 @@ Expression tree examples */ { // Filter an expression tree - console.log('Filter all symbol nodes "x" in the expression "x^2 + x/4 + 3*y"'); - const node = math.parse('x^2 + x/4 + 3*y'); - const filtered = node.filter(function(node) { - return node.isSymbolNode && node.name === 'x'; - }); - // returns an array with two entries: two SymbolNodes 'x' + const node: math.MathNode = math.parse('x^2 + x/4 + 3*y'); + const filtered: math.MathNode[] = node.filter((node: math.MathNode) => node.isSymbolNode && node.name === 'x'); - filtered.forEach(function(node) { - console.log(node.type, node.toString()); - }); - // outputs: - // SymbolNode x - // SymbolNode x + const arr: string[] = filtered.map((node: math.MathNode) => node.toString()); // Traverse an expression tree - console.log(); - console.log('Traverse the expression tree of expression "3 * x + 2"'); - const node1 = math.parse('3 * x + 2'); - node1.traverse(function(node, path, parent) { - switch (node.type) { - // case 'OperatorNode': console.log(node.type, node.op); break; - case 'OperatorNode': console.log(node.type); break; // for now removing .op - case 'ConstantNode': console.log(node.type, node.value); break; - case 'SymbolNode': console.log(node.type, node.name); break; - default: console.log(node.type); - } + const node1: math.MathNode = math.parse('3 * x + 2'); + node1.traverse((node: math.MathNode, path: string, parent: math.MathNode) => { + switch (node.type) { + case 'OperatorNode': + return node.type === 'OperatorNode'; + case 'ConstantNode': + return node.type === 'ConstantNode'; + case 'SymbolNode': + return node.type === 'SymbolNode'; + default: + return node.type === 'any string at all'; + } }); } From 9f74c6978a7bffa50425ed5a4e23dc791a60b173 Mon Sep 17 00:00:00 2001 From: GiorgosPap Date: Thu, 19 Apr 2018 20:18:19 +0300 Subject: [PATCH 0748/2153] added typings for npm package ng-tags-input (#24946) * Added typings for ngTagsInput * Adding typings for ng-tags-input (#2) * fixed travis CI issues * fixed CI travis issues #2 * fixed CI travis issues #3 --- types/ng-tags-input/index.d.ts | 82 ++++++++++++++++++++++ types/ng-tags-input/ng-tags-input-tests.ts | 8 +++ types/ng-tags-input/tsconfig.json | 23 ++++++ types/ng-tags-input/tslint.json | 1 + 4 files changed, 114 insertions(+) create mode 100644 types/ng-tags-input/index.d.ts create mode 100644 types/ng-tags-input/ng-tags-input-tests.ts create mode 100644 types/ng-tags-input/tsconfig.json create mode 100644 types/ng-tags-input/tslint.json diff --git a/types/ng-tags-input/index.d.ts b/types/ng-tags-input/index.d.ts new file mode 100644 index 0000000000..624bbac7f0 --- /dev/null +++ b/types/ng-tags-input/index.d.ts @@ -0,0 +1,82 @@ +// Type definitions for ng-tags-input for 3.2 +// Project: https://github.com/mbenford/ngTagsInput +// Definitions by: George Pap +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as angular from 'angular'; + +export type ITagsInputParams = angular.ngTagsInput.TagsInputParams; +export type IAutocompleteParams = angular.ngTagsInput.AutocompleteParams; +export type ITagsInputConfigurationProvider = angular.ngTagsInput.TagsInputConfigurationProvider; + +declare module 'angular' { + namespace ngTagsInput { + interface TagsInputParams { + ngModel?: string; + useStrings?: boolean; + template?: string | boolean; + templateScope?: string | boolean; + displayProperty?: string | boolean; + keyProperty?: string | boolean; + type?: string | boolean; + text?: string | boolean; + tabindex?: number | boolean; + placeholder?: string | boolean; + minLength?: number | boolean; + maxLength?: number | boolean; + minTags?: number | boolean; + maxTags?: number | boolean; + allowLeftoverText?: boolean; + removeTagSymbol?: string | boolean; + addOnEnter?: boolean; + addOnSpace?: boolean; + addOnComma?: boolean; + addOnBlur?: boolean; + addOnPaste?: boolean; + pasteSplitPattern?: string | boolean; + replaceSpacesWithDashes?: boolean; + allowedTagsPattern?: string | boolean; + enableEditingLastTag?: boolean; + addFromAutocompleteOnly?: boolean; + spellcheck?: boolean; + tagClass?: any; + onTagAdding?: any; + onTagAdded?: any; + onInvalidTag?: any; + onTagRemoving?: any; + onTagRemoved?: any; + onTagClicked?: any; + } + + interface AutocompleteParams { + source?: any; + template?: string | boolean; + displayProperty?: string | boolean; + debounceDelay?: number | boolean; + minLength?: number | boolean; + highlightMatchedText?: boolean; + maxResultsToShow?: number | boolean; + loadOnDownArrow?: boolean; + loadOnEmpty?: boolean; + loadOnFocus?: boolean; + selectFirstMatch?: boolean; + matchClass?: any; + } + + interface TagsInputConfigurationProvider extends IServiceProvider { + /** + * Sets the default configuration option for a directive. + */ + setDefaults(directive: string, defaults: ITagsInputParams | IAutocompleteParams): any; + /** + * Sets active interpolation for a set of options. + */ + setActiveInterpolation(directive: string, options: ITagsInputParams | IAutocompleteParams): any; + /** + * Sets the threshold used by the tagsInput directive to re-size the inner input field element based on its contents. + */ + setTextAutosizeThreshold(threshold: number): any; + } + } +} diff --git a/types/ng-tags-input/ng-tags-input-tests.ts b/types/ng-tags-input/ng-tags-input-tests.ts new file mode 100644 index 0000000000..f0b31d457d --- /dev/null +++ b/types/ng-tags-input/ng-tags-input-tests.ts @@ -0,0 +1,8 @@ +import * as angular from 'angular'; +angular.module('testModule', ['ngTagsInput']) + .config((tagsInputConfigProvider: angular.ngTagsInput.TagsInputConfigurationProvider) => { + const options: angular.ngTagsInput.TagsInputParams = { + placeholder: true + }; + tagsInputConfigProvider.setActiveInterpolation('tagsInput', options); + }); diff --git a/types/ng-tags-input/tsconfig.json b/types/ng-tags-input/tsconfig.json new file mode 100644 index 0000000000..42a59350cb --- /dev/null +++ b/types/ng-tags-input/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ng-tags-input-tests.ts" + ] +} diff --git a/types/ng-tags-input/tslint.json b/types/ng-tags-input/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ng-tags-input/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From ebf96ffc55c516ff2132bd7db6b0472cd59c54c7 Mon Sep 17 00:00:00 2001 From: Kyle Roach Date: Thu, 19 Apr 2018 13:56:03 -0400 Subject: [PATCH 0749/2153] (react-native-modalbox) Remove ViewProperties from main props (#25128) --- types/react-native-modalbox/index.d.ts | 301 +++++++++++++------------ 1 file changed, 153 insertions(+), 148 deletions(-) diff --git a/types/react-native-modalbox/index.d.ts b/types/react-native-modalbox/index.d.ts index 683773e995..84461471f2 100644 --- a/types/react-native-modalbox/index.d.ts +++ b/types/react-native-modalbox/index.d.ts @@ -5,176 +5,181 @@ // TypeScript Version: 2.6 import * as React from 'react'; -import { ViewProperties } from 'react-native'; +import { StyleProp, ViewStyle } from 'react-native'; -export interface ModalProps extends ViewProperties { - /** - * Checks if the modal is open - * - * Default is false - * - */ - isOpen?: boolean; +export interface ModalProps { + /** + * Checks if the modal is open + * + * Default is false + * + */ + isOpen?: boolean; - /** - * Checks if the modal is disabled - * - * Default is false - * - */ - isDisabled?: boolean; + /** + * Checks if the modal is disabled + * + * Default is false + * + */ + isDisabled?: boolean; - /** - * If the modal can be closed by pressing on the backdrop - * - * Default is true - * - */ - backdropPressToClose?: boolean; + /** + * If the modal can be closed by pressing on the backdrop + * + * Default is true + * + */ + backdropPressToClose?: boolean; - /** - * If the modal can be closed by swiping - * - * Default is true - * - */ - swipeToClose?: boolean; + /** + * If the modal can be closed by swiping + * + * Default is true + * + */ + swipeToClose?: boolean; - /** - * The threshold to reach in pixels to close the modal - * - * Default is 50 - * - */ - swipeThreshold?: number; + /** + * The threshold to reach in pixels to close the modal + * + * Default is 50 + * + */ + swipeThreshold?: number; - /** - * The height in pixels of the swipeable area - * - * Default is the Window Height - * - */ - swipeArea?: number; + /** + * The height in pixels of the swipeable area + * + * Default is the Window Height + * + */ + swipeArea?: number; - /** - * The final position of the modal. - * Accepts top, center or bottom - * - * Default is center - * - */ - position?: 'top' | 'center' | 'bottom' | string; + /** + * The final position of the modal. + * Accepts top, center or bottom + * + * Default is center + * + */ + position?: 'top' | 'center' | 'bottom' | string; - /** - * The direction modal enters from - * - * Default is bottom - * - */ - entry?: 'top' | 'bottom' | string; + /** + * The direction modal enters from + * + * Default is bottom + * + */ + entry?: 'top' | 'bottom' | string; - /** - * If a backdrop is displayed behind the modal - * - * Default is true - * - */ - backdrop?: boolean; + /** + * If a backdrop is displayed behind the modal + * + * Default is true + * + */ + backdrop?: boolean; - /** - * Opacity of the backdrop - * - * Default is 0.5 - * - */ - backdropOpacity?: number; + /** + * Opacity of the backdrop + * + * Default is 0.5 + * + */ + backdropOpacity?: number; - /** - * Background color of the backdrop - * - * Default is black - * - */ - backdropColor?: string; + /** + * Background color of the backdrop + * + * Default is black + * + */ + backdropColor?: string; - /** - * Add an element in the backdrop (a close button for example) - * - * Default is null - * - */ - backdropContent?: React.ReactNode; + /** + * Add an element in the backdrop (a close button for example) + * + * Default is null + * + */ + backdropContent?: React.ReactNode; - /** - * Duration of the animation - * - * Default is 400ms - * - */ - animationDuration?: number; + /** + * Duration of the animation + * + * Default is 400ms + * + */ + animationDuration?: number; - /** - * (Android only) Close modal when receiving back button event - * - * Default is false - * - */ - backButtonClose?: boolean; + /** + * (Android only) Close modal when receiving back button event + * + * Default is false + * + */ + backButtonClose?: boolean; - /** - * - * Default is false - */ - coverScreen?: boolean; + /** + * + * Default is false + */ + coverScreen?: boolean; - /** - * If the modal should appear open without animation upon first mount - * - * Default is false - * - */ - startOpen?: boolean; + /** + * If the modal should appear open without animation upon first mount + * + * Default is false + * + */ + startOpen?: boolean; - /** - * This property prevent the modal to cover the ios status bar when the modal is scrolling up because the keyboard is opening - * - * Default is ios:22, android:0 - */ - keyboardTopOffset?: number; + /** + * This property prevent the modal to cover the ios status bar when the modal is scrolling up because the keyboard is opening + * + * Default is ios:22, android:0 + */ + keyboardTopOffset?: number; - /** - * Event fired when the modal is closed and the animation is complete - * - */ - onClosed?(): void; + /** + * Custom styling for the content area + */ + style?: StyleProp; - /** - * Event fired when the modal is opened and the animation is complete - * - */ - onOpened?(): void; + /** + * Event fired when the modal is closed and the animation is complete + * + */ + onClosed?(): void; - /** - * When the state of the swipe to close feature has changed - * (useful to change the content of the modal, display a message for example) - * - * - */ - onClosingState?(state: boolean): void; + /** + * Event fired when the modal is opened and the animation is complete + * + */ + onOpened?(): void; + + /** + * When the state of the swipe to close feature has changed + * (useful to change the content of the modal, display a message for example) + * + * + */ + onClosingState?(state: boolean): void; } export default class Modal extends React.Component { - /** - * Open the modal - * - * - */ - open(): void; + /** + * Open the modal + * + * + */ + open(): void; - /** - * Close the modal - * - * - */ - close(): void; + /** + * Close the modal + * + * + */ + close(): void; } From df9434571ff294ac73caf5d674bc1d1849c88534 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 19 Apr 2018 19:57:20 +0200 Subject: [PATCH 0750/2153] [adone] refactoring, additions (#25114) * [adone] refactoring, additions * [math] add decimal * [math] index decomposition * [math] add min, max * [adone] collections, async * add adone.async * TimedoutMap -> TimeMap * normalize lru constructors * [adone] is, collection, regex * [is] add multiAddress, ip options * [collection.ByteArray] add readUInt24BE, writeUInt24BE * [regex] ip options, ip --- types/adone/adone.d.ts | 3 + types/adone/async.d.ts | 3 + .../adone/glosses/collections/byte_array.d.ts | 14 + types/adone/glosses/collections/fast_lru.d.ts | 11 +- types/adone/glosses/collections/index.d.ts | 2 +- types/adone/glosses/collections/lru.d.ts | 9 +- types/adone/glosses/collections/ns_cache.d.ts | 2 +- .../{timedout_map.d.ts => time_map.d.ts} | 2 +- types/adone/glosses/is.d.ts | 29 +- types/adone/glosses/math/bignumber.d.ts | 227 +++ types/adone/glosses/math/bitset.d.ts | 225 +++ types/adone/glosses/math/decimal.d.ts | 1287 +++++++++++++++++ types/adone/glosses/math/index.d.ts | 762 +--------- types/adone/glosses/math/long.d.ts | 293 ++++ types/adone/glosses/regex.d.ts | 12 +- .../test/glosses/collections/byte_array.ts | 10 + .../test/glosses/collections/fast_lru.ts | 4 +- types/adone/test/glosses/collections/lru.ts | 7 +- .../test/glosses/collections/time_map.ts | 22 + .../test/glosses/collections/timedout_map.ts | 22 - types/adone/test/glosses/is.ts | 7 + types/adone/test/glosses/math/bignumber.ts | 154 ++ types/adone/test/glosses/math/bitset.ts | 62 + types/adone/test/glosses/math/decimal.ts | 445 ++++++ types/adone/test/glosses/math/index.ts | 486 +------ types/adone/test/glosses/math/long.ts | 261 ++++ types/adone/test/glosses/regex.ts | 4 + types/adone/test/index.ts | 5 + types/adone/tsconfig.json | 13 +- 29 files changed, 3114 insertions(+), 1269 deletions(-) create mode 100644 types/adone/async.d.ts rename types/adone/glosses/collections/{timedout_map.d.ts => time_map.d.ts} (93%) create mode 100644 types/adone/glosses/math/bignumber.d.ts create mode 100644 types/adone/glosses/math/bitset.d.ts create mode 100644 types/adone/glosses/math/decimal.d.ts create mode 100644 types/adone/glosses/math/long.d.ts create mode 100644 types/adone/test/glosses/collections/time_map.ts delete mode 100644 types/adone/test/glosses/collections/timedout_map.ts create mode 100644 types/adone/test/glosses/math/bignumber.ts create mode 100644 types/adone/test/glosses/math/bitset.ts create mode 100644 types/adone/test/glosses/math/decimal.ts create mode 100644 types/adone/test/glosses/math/long.ts diff --git a/types/adone/adone.d.ts b/types/adone/adone.d.ts index d4e8b67b7b..6322bf6efc 100644 --- a/types/adone/adone.d.ts +++ b/types/adone/adone.d.ts @@ -1,6 +1,7 @@ /// /// /// +/// declare namespace adone { const _null: symbol; @@ -110,4 +111,6 @@ declare namespace adone { export const lodash: _.LoDashStatic; export const benchmark: typeof tbenchmark; + + export const async: typeof tasync; } diff --git a/types/adone/async.d.ts b/types/adone/async.d.ts new file mode 100644 index 0000000000..4cd3d421da --- /dev/null +++ b/types/adone/async.d.ts @@ -0,0 +1,3 @@ +export * from "async"; + +export as namespace tasync; diff --git a/types/adone/glosses/collections/byte_array.d.ts b/types/adone/glosses/collections/byte_array.d.ts index 1dc3080fb3..e6f145ce38 100644 --- a/types/adone/glosses/collections/byte_array.d.ts +++ b/types/adone/glosses/collections/byte_array.d.ts @@ -103,6 +103,13 @@ declare namespace adone.collection { */ readUInt16BE(offset?: number): number; + /** + * Reads a 24bit unsigned be integer + * + * @param offset Offset to read from + */ + readUInt24BE(offset?: number): number; + /** * Reads a 32bit signed le integer * @@ -260,6 +267,13 @@ declare namespace adone.collection { */ writeUInt16BE(value: number, offset?: number): this; + /** + * Writes a 24bit unsigned be integer + * + * @param offset Offset to write at + */ + writeUInt24BE(value: number, offset?: number): this; + /** * Writes a 32bit signed le integer * diff --git a/types/adone/glosses/collections/fast_lru.d.ts b/types/adone/glosses/collections/fast_lru.d.ts index e991322bc0..3418f60ffa 100644 --- a/types/adone/glosses/collections/fast_lru.d.ts +++ b/types/adone/glosses/collections/fast_lru.d.ts @@ -4,13 +4,18 @@ declare namespace adone.collection { */ class FastLRU { /** - * @param size Cache size, unlimited by default + * @param size */ - constructor(size?: number, options?: { + constructor(options?: { + /** + * Cache size, unlimited by default + */ + maxSize?: number; + /** * Function that is called when a value is deleted */ - dispose?(key: K, value: V): void + dispose?(key: K, value: V): void; }); /** diff --git a/types/adone/glosses/collections/index.d.ts b/types/adone/glosses/collections/index.d.ts index 234ffe85f4..ab4e744d1a 100644 --- a/types/adone/glosses/collections/index.d.ts +++ b/types/adone/glosses/collections/index.d.ts @@ -16,7 +16,7 @@ /// /// /// -/// +/// declare namespace adone { /** diff --git a/types/adone/glosses/collections/lru.d.ts b/types/adone/glosses/collections/lru.d.ts index 7d41e32cd5..730845ae16 100644 --- a/types/adone/glosses/collections/lru.d.ts +++ b/types/adone/glosses/collections/lru.d.ts @@ -6,7 +6,7 @@ declare namespace adone.collection { * The maximum size of the cache, checked by applying the length function to all values in the cache. * Default is Infinity */ - max?: number; + maxSize?: number; /** * Maximum age in ms. Items are not pro-actively pruned out as they age, @@ -85,11 +85,6 @@ declare namespace adone.collection { * Represent an LRU cache */ class LRU { - /** - * Creates an LRU cache of the given size - */ - constructor(max: number); - /** * Creates an LRU cache with the given options */ @@ -98,7 +93,7 @@ declare namespace adone.collection { /** * The length of the cache, setter resizes the cache */ - max: number; + maxSize: number; /** * stale setting diff --git a/types/adone/glosses/collections/ns_cache.d.ts b/types/adone/glosses/collections/ns_cache.d.ts index 5630c295d3..1c6e88702f 100644 --- a/types/adone/glosses/collections/ns_cache.d.ts +++ b/types/adone/glosses/collections/ns_cache.d.ts @@ -1,6 +1,6 @@ declare namespace adone.collection { class NSCache { - constructor(size: number, namespaces: string[]); + constructor(maxSize: number, namespaces: string[]); resize(newSize: number): void; diff --git a/types/adone/glosses/collections/timedout_map.d.ts b/types/adone/glosses/collections/time_map.d.ts similarity index 93% rename from types/adone/glosses/collections/timedout_map.d.ts rename to types/adone/glosses/collections/time_map.d.ts index fedcf79fa2..ae5d23e62b 100644 --- a/types/adone/glosses/collections/timedout_map.d.ts +++ b/types/adone/glosses/collections/time_map.d.ts @@ -2,7 +2,7 @@ declare namespace adone.collection { /** * Represents a Map that keeps keys only for a specified interval of time */ - class TimedoutMap extends Map { + class TimeMap extends Map { /** * @param timeout maximum age of the keys, 1000 by default * @param callback callback that is called with each key when the timeout is passed diff --git a/types/adone/glosses/is.d.ts b/types/adone/glosses/is.d.ts index d112d3f109..011b906234 100644 --- a/types/adone/glosses/is.d.ts +++ b/types/adone/glosses/is.d.ts @@ -490,12 +490,17 @@ declare namespace adone { /** * Checks whether the given string is an IPv4 address */ - export function ip4(str: string): boolean; + export function ip4(str: string, options?: adone.regex.I.IP.Options): boolean; /** * Checks whether the given string is an IPv6 address */ - export function ip6(str: string): boolean; + export function ip6(str: string, options?: adone.regex.I.IP.Options): boolean; + + /** + * Checks whether the given string is IPv4 or IPv6 address + */ + export function ip(str: string, options?: adone.regex.I.IP.Options): boolean; /** * Checks whether the given object is an array buffer @@ -628,21 +633,6 @@ declare namespace adone { requireTld?: boolean }): obj is string; - /** - * Checks whether the given object is a valid IPv4 address - */ - export function ip(obj: any, version: 4): boolean; - - /** - * Checks whether the given object is a valid IPv6 address - */ - export function ip(obj: any, version: 6): boolean; - - /** - * Checks whether the given object in a valid IPv4 or IPv6 address - */ - export function ip(obj: any): boolean; - /** * Checks whether the given object is a valid UUIDv1 identifier */ @@ -680,5 +670,10 @@ declare namespace adone { export const openbsd: boolean; export const aix: boolean; + + /** + * Checks whether the given object is adone.multi.address.Multiaddr + */ + export function multiAddress(obj: any): boolean; // TODO: obj is adone.multi.address.Multiaddr } } diff --git a/types/adone/glosses/math/bignumber.d.ts b/types/adone/glosses/math/bignumber.d.ts new file mode 100644 index 0000000000..f746ebfe02 --- /dev/null +++ b/types/adone/glosses/math/bignumber.d.ts @@ -0,0 +1,227 @@ +declare namespace adone.math { + namespace I.BigNumber { + interface BufferConvertOptions { + endian?: 1 | -1 | "big" | "little"; + size?: "auto" | number; + } + } + + /** + * Represents a number of arbitrary precision + */ + class BigNumber { + /** + * Creates a BigNumber from the given value, the base is 10 + */ + constructor(n: number | string | BigNumber); + + /** + * Creates a BigNumber from the given string and base + */ + constructor(n: string, base: number); + + /** + * Converts the number to a string in the given base + */ + toString(base?: number): string; + + /** + * Converts the bignum into a Number. + * If the bignum is too big you'll lose precision or you'll get ±Infinity. + */ + toNumber(): number; + + /** + * Returns a new Buffer with the data from the bignum. + */ + toBuffer(opts?: I.BigNumber.BufferConvertOptions): Buffer; + + /** + * Returns a new bignum containing the instance value plus n + */ + add(n: number | string | BigNumber): BigNumber; + + /** + * Return a new bignum containing the instance value minus n + */ + sub(n: number | string | BigNumber): BigNumber; + + /** + * Returns a new bignum containing the instance value multiplied by n + */ + mul(n: number | string | BigNumber): BigNumber; + + /** + * Returns a new bignum containing the instance value integrally divided by n + */ + div(n: number | string | BigNumber): BigNumber; + + /** + * Returns a new bignum with the absolute value of the instance + */ + abs(): BigNumber; + + /** + * Returns a new bignum with the negative of the instance value + */ + neg(): BigNumber; + + /** + * Compares the instance value to n. + * + * Returns a positive integer if > n, a negative integer if < n, and 0 if == n + */ + cmp(n: number | string | BigNumber): number; + + /** + * Checks whether the instance value is greater than n (> n). + */ + gt(n: number | string | BigNumber): boolean; + + /** + * Checks whether the instance value is greater than or equal to n (>= n). + */ + ge(n: number | string | BigNumber): boolean; + + /** + * Checks whether the instance value is equal to n (== n). + */ + eq(n: number | string | BigNumber): boolean; + + /** + * Checks whether the instance value is less than n (< n). + */ + lt(n: number | string | BigNumber): boolean; + + /** + * Checks whether the instance value is less than or equal to n (<= n). + */ + le(n: number | string | BigNumber): boolean; + + /** + * Returns a new bignum with the instance value bitwise AND (&)-ed with n. + */ + and(n: number | string | BigNumber): BigNumber; + + /** + * Returns a new bignum with the instance value bitwise inclusive-OR (|)-ed with n. + */ + or(n: number | string | BigNumber): BigNumber; + + /** + * Returns a new bignum with the instance value bitwise exclusive-OR (^)-ed with n. + */ + xor(n: number | string | BigNumber): BigNumber; + + /** + * Returns a new bignum with the instance value modulo n. + */ + mod(n: number | string | BigNumber): BigNumber; + + /** + * Returns a new bignum with the instance value raised to the nth power. + */ + pow(n: number | string | BigNumber): BigNumber; + + /** + * Returns a new bignum with the instance value raised to the nth power modulo m. + */ + powm(n: number | string | BigNumber, m: number | string | BigNumber): BigNumber; + + /** + * Computes the multiplicative inverse modulo m. + */ + invertm(m: number | string | BigNumber): BigNumber; + + /** + * Returns a random number from 0 to this -1 + */ + rand(): BigNumber; + + /** + * Returns a random number from this to upperBound - 1 + */ + rand(upperBound: number | string | BigNumber): BigNumber; + + /** + * Checks whether the bignum is: + * + * - certainly prime (true) + * + * - probably prime ('maybe') + * + * - certainly composite (false) + */ + probPrime(): boolean | "maybe"; + + /** + * Returns the next prime number after this bignum + */ + nextPrime(): BigNumber; + + /** + * Returns a new bignum that is the square root. This truncates. + */ + sqrt(): BigNumber; + + /** + * Returns a new bignum that is the nth root. This truncates. + */ + root(n: number | string | BigNumber): BigNumber; + + /** + * Returns a new bignum that is the 2^n multiple. Equivalent of the << operator. + */ + shiftLeft(n: number | string | BigNumber): BigNumber; + + /** + * Returns a new bignum of the value integer divided by 2^n. Equivalent of the >> operator. + */ + shiftRight(n: number | string | BigNumber): BigNumber; + + /** + * Returns the greatest common divisor of the current bignum with n as a new bignum. + */ + gcd(n: number | string | BigNumber): BigNumber; + + /** + * Returns the Jacobi symbol (or Legendre symbol if n is prime) of the current bignum (= a) over n. + * Note that n must be odd and >= 3. 0 <= a < n. + * Returns -1 or 1 + */ + jacobi(n: number | string | BigNumber): number; + + /** + * Returns the number of bits used to represent the current bignum + */ + bitLength(): number; + + /** + * Checks whether the bit at the given index is set + */ + isBitSet(n: number): boolean; + + /** + * Generates a probable prime number of length bits. + * + * @param bits the number of bits + * @param safe If true, it will be a "safe" prime of the form p=2p'+1 where p' is also prime. Default: true + */ + static prime(bits: number, safe?: boolean): BigNumber; + + /** + * Creates a new bignum from a Buffer. + */ + static fromBuffer(buf: Buffer, opts?: I.BigNumber.BufferConvertOptions): BigNumber; + + /** + * One + */ + static ONE: BigNumber; + + /** + * Zero + */ + static ZERO: BigNumber; + } +} diff --git a/types/adone/glosses/math/bitset.d.ts b/types/adone/glosses/math/bitset.d.ts new file mode 100644 index 0000000000..a6bbd36989 --- /dev/null +++ b/types/adone/glosses/math/bitset.d.ts @@ -0,0 +1,225 @@ +declare namespace adone.math { + /** + * Represents a set of bits + */ + class BitSet { + /** + * Creates a new bitset of n bits + */ + constructor(n: number); + + /** + * Creates a new bitset from a dehydrated bitset + */ + constructor(key: string); + + /** + * Checks whether a bit at a specific index is set + */ + get(idx: number): boolean; + + /** + * Sets a single bit. + * Returns true if set was successfull + */ + set(idx: number): boolean; + + /** + * Sets a range of bits. + * Returns true if set was successfull + */ + setRange(from: number, to: number): boolean; + + /** + * Unsets a single bit. + * Returns true if unset was successfull + */ + unset(idx: number): boolean; + + /** + * Unsets a range of bits. + * Returns true if unset was successfull + */ + unsetRange(from: number, to: number): boolean; + + /** + * Toggles a single bit + */ + toggle(idx: number): boolean; + + /** + * Toggles a range of bits + */ + toggleRange(from: number, to: number): boolean; + + /** + * Clears the entire bitset + */ + clear(): boolean; + + /** + * Clones the set + */ + clone(): BitSet; + + /** + * Turns the bitset into a comma separated string that skips leading & trailing 0 words. + * Ends with the number of leading 0s and MAX_BIT. + * Useful if you need the bitset to be an object key (eg dynamic programming). + * Can rehydrate by passing the result into the constructor + */ + dehydrate(): string; + + /** + * Performs a bitwise AND on 2 bitsets or 1 bitset and 1 index. + * Both bitsets must have the same number of words, no length check is performed to prevent and overflow. + */ + and(value: number | BitSet): BitSet; + + /** + * Performs a bitwise OR on 2 bitsets or 1 bitset and 1 index. + * Both bitsets must have the same number of words, no length check is performed to prevent and overflow. + */ + or(value: number | BitSet): BitSet; + + /** + * Performs a bitwise XOR on 2 bitsets or 1 bitset and 1 index. + * Both bitsets must have the same number of words, no length check is performed to prevent and overflow. + */ + xor(value: number | BitSet): BitSet; + + /** + * Runs a custom function on every set bit. + * Faster than iterating over the entire bitset with a get(). + * If the callback returns `false` it stops iterating. + */ + forEach(callback: ((idx: number) => void | boolean)): void; + + /** + * Performs a circular shift bitset by an offset + * + * @param n number of positions that the bitset that will be shifted to the right. Using a negative number will result in a left shift. + */ + circularShift(n: number): BitSet; + + /** + * Gets the cardinality (count of set bits) for the entire bitset + */ + getCardinality(): number; + + /** + * Gets the indices of all set bits + */ + getIndices(): number[]; + + /** + * Checks if one bitset is subset of another. + */ + isSubsetOf(other: BitSet): boolean; + + /** + * Quickly determines if a bitset is empty + */ + isEmpty(): boolean; + + /** + * Quickly determines if both bitsets are equal (faster than checking if the XOR of the two is === 0). + * Both bitsets must have the same number of words, no length check is performed to prevent and overflow. + */ + isEqual(other: BitSet): boolean; + + /** + * Gets a string representation of the entire bitset, including leading 0s + */ + toString(): string; + + /** + * Finds first set bit (useful for processing queues, breadth-first tree searches, etc.). + * Returns -1 if not found + * + * @param startWord the word to start with (only used internally by nextSetBit) + */ + ffs(startWord?: number): number; + + /** + * Finds first zero (unset bit). + * Returns -1 if not found + * + * @param startWord the word to start with (only used internally by nextUnsetBit) + */ + ffz(startWord?: number): number; + + /** + * Finds last set bit. + * Returns -1 if not found + * + * @param startWord the word to start with (only used internally by previousSetBit) + */ + fls(startWord?: number): number; + + /** + * Finds last zero (unset bit). + * Returns -1 if not found + * + * @param startWord the word to start with (only used internally by previousUnsetBit) + */ + flz(startWord?: number): number; + + /** + * Finds first set bit, starting at a given index. + * Return -1 if not found + * + * @param idx the starting index for the next set bit + */ + nextSetBit(idx: number): number; + + /** + * Finds first unset bit, starting at a given index. + * Return -1 if not found + * + * @param idx the starting index for the next unset bit + */ + nextUnsetBit(idx: number): number; + + /** + * Finds last set bit, up to a given index. + * Returns -1 if not found + * + * @param idx the starting index for the next unset bit (going in reverse) + */ + previousSetBit(idx: number): number; + + /** + * Finds last unset bit, up to a given index. + * Returns -1 if not found + */ + previousUnsetBit(idx: number): number; + + /** + * Converts the bitset to a math.Long number + */ + toLong(): Long; + + /** + * Reads an unsigned integer of the given bits from the given offset + * + * @param bits number of bits, 1 by default + * @param offset offset, 0 by default + */ + readUInt(bits?: number, offset?: number): number; + + /** + * Writes the given unsigned integer + * + * @param val integer + * @param bits number of bits to write, 1 by default + * @param offset write offset, 0 by default + */ + writeUInt(val: number, bits?: number, offset?: number): void; + + /** + * Creates a new BitSet from the given math.Long number + */ + static fromLong(l: Long): BitSet; + } +} diff --git a/types/adone/glosses/math/decimal.d.ts b/types/adone/glosses/math/decimal.d.ts new file mode 100644 index 0000000000..a7acb0ecad --- /dev/null +++ b/types/adone/glosses/math/decimal.d.ts @@ -0,0 +1,1287 @@ +declare namespace adone.math { + namespace I.Decimal { + type Constructor = typeof Decimal; + type Instance = Decimal; + type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; + type Modulo = Rounding | 9; + type Value = string | number | Decimal; + + interface Config { + /** + * The maximum number of significant digits of the result of an operation. + * + * @default 20 + */ + precision?: number; + + /** + * The default rounding mode used when rounding the result of an operation to precision significant digits, and when rounding + * the return value of the round, toBinary, toDecimalPlaces, toExponential, toFixed, toHexadecimal, toNearest, toOctal, + * toPrecision and toSignificantDigits methods. + * + * @default 4 (ROUND_HALF_UP) + */ + rounding?: Rounding; + + /** + * The negative exponent value at and below which toString returns exponential notation. + * + * JavaScript numbers use exponential notation for negative exponents of -7 and below. + * + * @default -7 + */ + toExpNeg?: number; + + /** + * The positive exponent value at and above which toString returns exponential notation. + * + * JavaScript numbers use exponential notation for positive exponents of 20 and above. + * + * @default 20 + */ + toExpPos?: number; + + /** + * The negative exponent limit, i.e. the exponent value below which underflow to zero occurs. + * + * If the Decimal to be returned by a calculation would have an exponent lower than minE then the value of that Decimal becomes zero. + * + * JavaScript numbers underflow to zero for exponents below -324. + * + * @default -9e15 + */ + minE?: number; + + /** + * The positive exponent limit, i.e. the exponent value above which overflow to Infinity occurs. + * + * If the Decimal to be returned by a calculation would have an exponent higher than maxE then the value of that Decimal becomes Infinity. + * + * JavaScript numbers overflow to Infinity for exponents above 308. + * + * @default 9e15 + */ + maxE?: number; + + /** + * The value that determines whether cryptographically-secure pseudo-random number generation is used. + */ + crypto?: boolean; + + /** + * The modulo mode used when calculating the modulus: a mod n. + * + * The quotient, q = a / n, is calculated according to the rounding mode that corresponds to the chosen modulo mode. + * + * The remainder, r, is calculated as: r = a - n * q. + * + * @default 1 (ROUND_DOWN) + */ + modulo?: Modulo; + + defaults?: boolean; + } + } + + /** + * An arbitrary precision decimal number + */ + class Decimal { + /** + * digits + */ + readonly d: number[]; + + /** + * exponent + */ + readonly e: number; + + /** + * sign + */ + readonly s: number; + + private readonly name: string; + + constructor(x: I.Decimal.Value); + + /** + * Returns a new Decimal whose value is the absolute value, i.e. the magnitude, of the value of this Decimal. + * + * @alias abs + */ + absoluteValue(): Decimal; + + /** + * Returns a new Decimal whose value is the absolute value, i.e. the magnitude, of the value of this Decimal. + * + * @alias absoluteValue + */ + abs(): Decimal; + + /** + * Returns a new Decimal whose value is the value of this Decimal rounded to a whole number in the direction of positive Infinity. + * + * The return value is not affected by the value of the precision setting. + */ + ceil(): Decimal; + + /** + * 1 if the value of this Decimal is greater than the value of x + * + * -1 if the value of this Decimal is less than the value of x + * + * 0 if this Decimal and x have the same value + * + * NaN if the value of either this Decimal or x is NaN + * + * @alias cmp + */ + comparedTo(x: I.Decimal.Value): number; + + /** + * 1 if the value of this Decimal is greater than the value of x + * + * -1 if the value of this Decimal is less than the value of x + * + * 0 if this Decimal and x have the same value + * + * NaN if the value of either this Decimal or x is NaN + * + * @alias comparedTo + */ + cmp(x: I.Decimal.Value): number; + + /** + * Returns a new Decimal whose value is the cosine of the value in radians of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias cos + */ + cosine(): Decimal; + + /** + * Returns a new Decimal whose value is the cosine of the value in radians of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias cosine + */ + cos(): Decimal; + + /** + * Returns a new Decimal whose value is the cube root of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * The return value will be correctly rounded, + * i.e. rounded as if the result was first calculated to an infinite number of correct digits before rounding. + * + * @alias cbrt + */ + cubeRoot(): Decimal; + + /** + * Returns a new Decimal whose value is the cube root of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * The return value will be correctly rounded, + * i.e. rounded as if the result was first calculated to an infinite number of correct digits before rounding. + * + * @alias cubeRoot + */ + cbrt(): Decimal; + + /** + * Returns the number of decimal places, i.e. the number of digits after the decimal point, of the value of this Decimal. + * + * @alias dp + */ + decimalPlaces(): number; + + /** + * Returns the number of decimal places, i.e. the number of digits after the decimal point, of the value of this Decimal. + * + * @alias decimalPlaces + */ + dp(): number; + + /** + * Returns a new Decimal whose value is the value of this Decimal divided by x, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias div + */ + dividedBy(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the value of this Decimal divided by x, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias dividedBy + */ + div(x: I.Decimal.Value): Decimal; + + /** + * Return a new Decimal whose value is the integer part of dividing this Decimal by x, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias divToInt + */ + dividedToIntegerBy(x: I.Decimal.Value): Decimal; + + /** + * Return a new Decimal whose value is the integer part of dividing this Decimal by x, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias dividedToIntegerBy + */ + divToInt(x: I.Decimal.Value): Decimal; + + /** + * Returns true if the value of this Decimal equals the value of x, otherwise returns false. + * As with JavaScript, NaN does not equal NaN. + * + * @alias eq + */ + equals(x: I.Decimal.Value): boolean; + + /** + * Returns true if the value of this Decimal equals the value of x, otherwise returns false. + * As with JavaScript, NaN does not equal NaN. + * + * @alias equals + */ + eq(x: I.Decimal.Value): boolean; + + /** + * Returns a new Decimal whose value is the value of this Decimal rounded to a whole number in the direction of negative Infinity. + * + * The return value is not affected by the value of the precision setting. + */ + floor(): Decimal; + + /** + * Returns true if the value of this Decimal is greater than the value of x, otherwise returns false. + * + * @alias gt + */ + greaterThan(x: I.Decimal.Value): boolean; + + /** + * Returns true if the value of this Decimal is greater than the value of x, otherwise returns false. + * + * @alias greaterThan + */ + gt(x: I.Decimal.Value): boolean; + + /** + * Returns true if the value of this Decimal is greater than or equal to the value of x, otherwise returns false. + * + * @alias gte + */ + greaterThanOrEqualTo(x: I.Decimal.Value): boolean; + + /** + * Returns true if the value of this Decimal is greater than or equal to the value of x, otherwise returns false. + * + * @alias greaterThanOrEqualTo + */ + gte(x: I.Decimal.Value): boolean; + + /** + * Returns a new Decimal whose value is the hyperbolic cosine of the value in radians of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias cosh + */ + hyperbolicCosine(): Decimal; + + /** + * Returns a new Decimal whose value is the hyperbolic cosine of the value in radians of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias hyperbolicCosine + */ + cosh(): Decimal; + + /** + * Returns a new Decimal whose value is the hyperbolic sine of the value in radians of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias sinh + */ + hyperbolicSine(): Decimal; + + /** + * Returns a new Decimal whose value is the hyperbolic sine of the value in radians of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias hyperbolicSine + */ + sinh(): Decimal; + + /** + * Returns a new Decimal whose value is the inverse hyperbolic tangent in radians of the value of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias tanh + */ + hyperbolicTangent(): Decimal; + + /** + * Returns a new Decimal whose value is the inverse hyperbolic tangent in radians of the value of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias hyperbolicTangent + */ + tanh(): Decimal; + + /** + * Returns a new Decimal whose value is the inverse cosine in radians of the value of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias acos + */ + inverseCosine(): Decimal; + + /** + * Returns a new Decimal whose value is the inverse cosine in radians of the value of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias inverseCosine + */ + acos(): Decimal; + + /** + * Returns a new Decimal whose value is the inverse hyperbolic cosine in radians of the value of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias acosh + */ + inverseHyperbolicCosine(): Decimal; + + /** + * Returns a new Decimal whose value is the inverse hyperbolic cosine in radians of the value of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias inverseHyperbolicCosine + */ + acosh(): Decimal; + + /** + * Returns a new Decimal whose value is the inverse hyperbolic sine in radians of the value of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias asinh + */ + inverseHyperbolicSine(): Decimal; + + /** + * Returns a new Decimal whose value is the inverse hyperbolic sine in radians of the value of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias inverseHyperbolicSine + */ + asinh(): Decimal; + + /** + * Returns a new Decimal whose value is the inverse hyperbolic tangent in radians of the value of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias atanh + */ + inverseHyperbolicTangent(): Decimal; + + /** + * Returns a new Decimal whose value is the inverse hyperbolic tangent in radians of the value of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias inverseHyperbolicTangent + */ + atanh(): Decimal; + + /** + * Returns a new Decimal whose value is the inverse sine in radians of the value of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias asin + */ + inverseSine(): Decimal; + + /** + * Returns a new Decimal whose value is the inverse sine in radians of the value of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias inverseSine + */ + asin(): Decimal; + + /** + * Returns a new Decimal whose value is the inverse tangent in radians of the value of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias atan + */ + inverseTangent(): Decimal; + + /** + * Returns a new Decimal whose value is the inverse tangent in radians of the value of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias inverseTangent + */ + atan(): Decimal; + + /** + * Returns true if the value of this Decimal is a finite number, otherwise returns false. + * The only possible non-finite values of a Decimal are NaN, Infinity and -Infinity. + */ + isFinite(): boolean; + + /** + * Returns true if the value of this Decimal is a whole number, otherwise returns false. + * + * @alias isInt + */ + isInteger(): boolean; + + /** + * Returns true if the value of this Decimal is a whole number, otherwise returns false. + * + * @alias isInteger + */ + isInt(): boolean; + + /** + * Returns true if the value of this Decimal is NaN, otherwise returns false. + */ + isNaN(): boolean; + + /** + * Returns true if the value of this Decimal is negative, otherwise returns false. + * + * @alias isNeg + */ + isNegative(): boolean; + + /** + * Returns true if the value of this Decimal is negative, otherwise returns false. + * + * @alias isNegative + */ + isNeg(): boolean; + + /** + * Returns true if the value of this Decimal is positive, otherwise returns false. + * + * @alias isPos + */ + isPositive(): boolean; + + /** + * Returns true if the value of this Decimal is positive, otherwise returns false. + * + * @alias isPositive + */ + isPos(): boolean; + + /** + * Returns true if the value of this Decimal is zero or minus zero, otherwise returns false. + */ + isZero(): boolean; + + /** + * Returns true if the value of this Decimal is less than the value of x, otherwise returns false. + * + * @alias lt + */ + lessThan(x: I.Decimal.Value): boolean; + + /** + * Returns true if the value of this Decimal is less than the value of x, otherwise returns false. + * + * @alias lessThan + */ + lt(x: I.Decimal.Value): boolean; + + /** + * Returns true if the value of this Decimal is less than or equal to the value of x, otherwise returns false. + * + * @alias lte + */ + lessThanOrEqualTo(x: I.Decimal.Value): boolean; + + /** + * Returns true if the value of this Decimal is less than or equal to the value of x, otherwise returns false. + * + * @alias lessThanOrEqualTo + */ + lte(x: I.Decimal.Value): boolean; + + /** + * Returns a new Decimal whose value is the base x logarithm of the value of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias log + */ + logarithm(n?: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the base x logarithm of the value of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias logarithm + */ + log(n?: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the value of this Decimal minus x, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias sub + */ + minus(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the value of this Decimal minus x, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias minus + */ + sub(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the value of this Decimal modulo x, + * rounded to precision significant digits using rounding mode rounding. + * + * The value returned, and in particular its sign, is dependent on the value of the modulo property of this Decimal's constructor. + * If it is 1 (default value), the result will have the same sign as this Decimal, + * and it will match that of Javascript's % operator (within the limits of double precision) and BigDecimal's remainder method. + * + * @alias mod + */ + modulo(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the value of this Decimal modulo x, + * rounded to precision significant digits using rounding mode rounding. + * + * The value returned, and in particular its sign, is dependent on the value of the modulo property of this Decimal's constructor. + * If it is 1 (default value), the result will have the same sign as this Decimal, + * and it will match that of Javascript's % operator (within the limits of double precision) and BigDecimal's remainder method. + * + * @alias modulo + */ + mod(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the base e (Euler's number, the base of the natural logarithm) exponential of the value of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias exp + */ + naturalExponential(): Decimal; + + /** + * Returns a new Decimal whose value is the base e (Euler's number, the base of the natural logarithm) exponential of the value of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias naturalExponential + */ + exp(): Decimal; + + /** + * Returns a new Decimal whose value is the natural logarithm of the value of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias ln + */ + naturalLogarithm(): Decimal; + + /** + * Returns a new Decimal whose value is the natural logarithm of the value of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias naturalLogarithm + */ + ln(): Decimal; + + /** + * Returns a new Decimal whose value is the value of this Decimal negated, i.e. multiplied by -1. + * + * @alias neg + */ + negated(): Decimal; + + /** + * Returns a new Decimal whose value is the value of this Decimal negated, i.e. multiplied by -1. + * + * @alias negated + */ + neg(): Decimal; + + /** + * Returns a new Decimal whose value is the value of this Decimal plus x, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias add + */ + plus(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the value of this Decimal plus x, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias plus + */ + add(x: I.Decimal.Value): Decimal; + + /** + * Returns the number of significant digits of the value of this Decimal. + * + * @param includeZeros If it is true or 1 then any trailing zeros of the integer part of a number are counted as significant digits, + * otherwise they are not. + * @alias sd + */ + precision(includeZeros?: boolean): number; + + /** + * Returns the number of significant digits of the value of this Decimal. + * + * @param includeZeros If it is true or 1 then any trailing zeros of the integer part of a number are counted as significant digits, + * otherwise they are not. + * @alias precision + */ + sd(includeZeros?: boolean): number; + + /** + * Returns a new Decimal whose value is the value of this Decimal rounded to a whole number using rounding mode rounding. + */ + round(): Decimal; + + /** + * Returns a new Decimal whose value is the sine of the value in radians of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias sin + */ + sine(): Decimal; + + /** + * Returns a new Decimal whose value is the sine of the value in radians of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias sine + */ + sin(): Decimal; + + /** + * Returns a new Decimal whose value is the square root of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * The return value will be correctly rounded, + * i.e. rounded as if the result was first calculated to an infinite number of correct digits before rounding. + * + * @alias sqrt + */ + squareRoot(): Decimal; + + /** + * Returns a new Decimal whose value is the square root of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * The return value will be correctly rounded, + * i.e. rounded as if the result was first calculated to an infinite number of correct digits before rounding. + * + * @alias squareRoot + */ + sqrt(): Decimal; + + /** + * Returns a new Decimal whose value is the tangent of the value in radians of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias tan + */ + tangent(): Decimal; + + /** + * Returns a new Decimal whose value is the tangent of the value in radians of this Decimal, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias tangent + */ + tan(): Decimal; + + /** + * Returns a new Decimal whose value is the value of this Decimal times x, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias mul + */ + times(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the value of this Decimal times x, + * rounded to precision significant digits using rounding mode rounding. + * + * @alias times + */ + mul(x: I.Decimal.Value): Decimal; + + /** + * Returns a string representing the value of this Decimal in binary, rounded to sd significant digits using rounding mode rm. + */ + toBinary(significantDigits?: number): string; + + /** + * Returns a string representing the value of this Decimal in binary, rounded to sd significant digits using rounding mode rm. + */ + toBinary(significantDigits: number, rounding: I.Decimal.Rounding): string; + + /** + * Returns a new Decimal whose value is the value of this Decimal rounded to dp decimal places using rounding mode rm. + * + * @alias toDP + */ + toDecimalPlaces(decimalPlaces?: number): Decimal; + + /** + * Returns a new Decimal whose value is the value of this Decimal rounded to dp decimal places using rounding mode rm. + * + * @alias toDP + */ + toDecimalPlaces(decimalPlaces: number, rounding: I.Decimal.Rounding): Decimal; + + /** + * Returns a new Decimal whose value is the value of this Decimal rounded to dp decimal places using rounding mode rm. + * + * @alias toDecimalPlaces + */ + toDP(decimalPlaces?: number): Decimal; + + /** + * Returns a new Decimal whose value is the value of this Decimal rounded to dp decimal places using rounding mode rm. + * + * @alias toDecimalPlaces + */ + toDP(decimalPlaces: number, rounding: I.Decimal.Rounding): Decimal; + + /** + * Returns a string representing the value of this Decimal in exponential notation rounded using rounding mode rm to dp decimal places, + * i.e with one digit before the decimal point and dp digits after it. + * + * If the value of this Decimal in exponential notation has fewer than dp fraction digits, + * the return value will be appended with zeros accordingly. + */ + toExponential(decimalPlaces?: number): string; + + /** + * Returns a string representing the value of this Decimal in exponential notation rounded using rounding mode rm to dp decimal places, + * i.e with one digit before the decimal point and dp digits after it. + * + * If the value of this Decimal in exponential notation has fewer than dp fraction digits, + * the return value will be appended with zeros accordingly. + */ + toExponential(decimalPlaces: number, rounding: I.Decimal.Rounding): string; + + /** + * Returns a string representing the value of this Decimal in normal (fixed-point) notation rounded to dp decimal places using rounding mode rm. + * + * If the value of this Decimal in normal notation has fewer than dp fraction digits, the return value will be appended with zeros accordingly. + * + * Unlike Number.prototype.toFixed, which returns exponential notation if a number is greater or equal to 1021, this method will always return normal notation. + */ + toFixed(decimalPlaces?: number): string; + + /** + * Returns a string representing the value of this Decimal in normal (fixed-point) notation rounded to dp decimal places using rounding mode rm. + * + * If the value of this Decimal in normal notation has fewer than dp fraction digits, the return value will be appended with zeros accordingly. + * + * Unlike Number.prototype.toFixed, which returns exponential notation if a number is greater or equal to 1021, this method will always return normal notation. + */ + toFixed(decimalPlaces: number, rounding: I.Decimal.Rounding): string; + + /** + * Returns an array of two Decimals representing the value of this Decimal as a simple fraction with an integer numerator and an integer denominator. + * The denominator will be a positive non-zero value less than or equal to maxDenominator. + * + * If a maximum denominator is omitted, the denominator will be the lowest value necessary to represent the number exactly. + */ + toFraction(maxDenominator?: I.Decimal.Value): Decimal[]; + + /** + * Returns a string representing the value of this Decimal in hexadecimal, rounded to sd significant digits using rounding mode rm. + * + * @alias toHex + */ + toHexadecimal(significantDigits?: number): string; + + /** + * Returns a string representing the value of this Decimal in hexadecimal, rounded to sd significant digits using rounding mode rm. + * + * @alias toHex + */ + toHexadecimal(significantDigits: number, rounding: I.Decimal.Rounding): string; + + /** + * Returns a string representing the value of this Decimal in hexadecimal, rounded to sd significant digits using rounding mode rm. + * + * @alias toHexadecimal + */ + toHex(significantDigits?: number): string; + + /** + * Returns a string representing the value of this Decimal in hexadecimal, rounded to sd significant digits using rounding mode rm. + * + * @alias toHexadecimal + */ + toHex(significantDigits: number, rounding?: I.Decimal.Rounding): string; + + /** + * Same as valueOf + */ + toJSON(): string; + + /** + * Returns a new Decimal whose value is the nearest multiple of x in the direction of rounding mode rm, or rounding if rm is omitted, + * to the value of this Decimal. + * + * The return value will always have the same sign as this Decimal, unless either this Decimal or x is NaN, + * in which case the return value will be also be NaN. + */ + toNearest(x?: I.Decimal.Value, rounding?: I.Decimal.Rounding): Decimal; + + /** + * Returns the value of this Decimal converted to a primitive number. + * + * Type coercion with, for example, JavaScript's unary plus operator will also work, + * except that a Decimal with the value minus zero will convert to positive zero. + */ + toNumber(): number; + + /** + * Returns a string representing the value of this Decimal in octal, rounded to sd significant digits using rounding mode rm. + */ + toOctal(significantDigits?: number): string; + + /** + * Returns a string representing the value of this Decimal in octal, rounded to sd significant digits using rounding mode rm. + */ + toOctal(significantDigits: number, rounding: I.Decimal.Rounding): string; + + /** + * Returns a new Decimal whose value is the value of this Decimal raised to the power x, + * rounded to precision significant digits using rounding mode rounding. + * + * The return value will almost always be correctly rounded, + * i.e. rounded as if the result was first calculated to an infinite number of correct digits before rounding. + * If a result is incorrectly rounded the maximum error will be 1 ulp (unit in the last place). + * + * @alias pow + */ + toPower(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the value of this Decimal raised to the power x, + * rounded to precision significant digits using rounding mode rounding. + * + * The return value will almost always be correctly rounded, + * i.e. rounded as if the result was first calculated to an infinite number of correct digits before rounding. + * If a result is incorrectly rounded the maximum error will be 1 ulp (unit in the last place). + * + * @alias toPower + */ + pow(x: I.Decimal.Value): Decimal; + + /** + * Returns a string representing the value of this Decimal rounded to sd significant digits using rounding mode rm. + */ + toPrecision(significantDigits?: number): string; + + /** + * Returns a string representing the value of this Decimal rounded to sd significant digits using rounding mode rm. + */ + toPrecision(significantDigits: number, rounding: I.Decimal.Rounding): string; + + /** + * Returns a new Decimal whose value is the value of this Decimal rounded to sd significant digits using rounding mode rm. + * + * @alias toSD + */ + toSignificantDigits(significantDigits?: number): Decimal; + + /** + * Returns a new Decimal whose value is the value of this Decimal rounded to sd significant digits using rounding mode rm. + * + * @alias toSD + */ + toSignificantDigits(significantDigits: number, rounding: I.Decimal.Rounding): Decimal; + + /** + * Returns a new Decimal whose value is the value of this Decimal rounded to sd significant digits using rounding mode rm. + * + * @alias toSignificantDigits + */ + toSD(significantDigits?: number): Decimal; + + /** + * Returns a new Decimal whose value is the value of this Decimal rounded to sd significant digits using rounding mode rm. + * + * @alias toSignificantDigits + */ + toSD(significantDigits: number, rounding: I.Decimal.Rounding): Decimal; + + /** + * Returns a string representing the value of this Decimal. + * + * If this Decimal has a positive exponent that is equal to or greater than toExpPos, + * or a negative exponent equal to or less than toExpNeg, then exponential notation will be returned. + */ + toString(): string; + + /** + * Returns a new Decimal whose value is the value of this Decimal truncated to a whole number. + * + * @alias trunc + */ + truncated(): Decimal; + + /** + * Returns a new Decimal whose value is the value of this Decimal truncated to a whole number. + * + * @alias truncated + */ + trunc(): Decimal; + + /** + * As toString, but zero is signed. + */ + valueOf(): string; + + /** + * Returns a new Decimal whose value is the absolute value of x + */ + static abs(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the inverse cosine in radians of x, rounded to precision significant digits using rounding mode rounding. + */ + static acos(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the inverse cosine in radians of x, rounded to precision significant digits using rounding mode rounding. + */ + static acosh(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the value of x + y, rounded to precision significant digits using rounding mode rounding. + */ + static add(x: I.Decimal.Value, y: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the inverse sine in radians of x, rounded to precision significant digits using rounding mode rounding. + */ + static asin(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the inverse hyperbolic sine in radians of x, rounded to precision significant digits using rounding mode rounding. + */ + static asinh(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the inverse tangent in radians of x, rounded to precision significant digits using rounding mode rounding. + */ + static atan(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the inverse hyperbolic tangent in radians of x, rounded to precision significant digits using rounding mode rounding. + */ + static atanh(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the inverse tangent in radians of the quotient of y and x, rounded to precision significant digits using rounding mode rounding. + * + * The signs of y and x are used to determine the quadrant of the result. + */ + static atan2(y: I.Decimal.Value, x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the cube root of x, rounded to precision significant digits using rounding mode rounding. + */ + static cbrt(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the value of x rounded to a whole number in the direction of positive Infinity. + */ + static ceil(x: I.Decimal.Value): Decimal; + + /** + * Returns a new independent Decimal constructor with configuration settings as described by object, or with the same settings as this Decimal constructor if object is omitted. + * + * @alias config + */ + static clone(object?: I.Decimal.Config): I.Decimal.Constructor; + + /** + * Configures the 'global' settings for this particular Decimal constructor, i.e. the settings which apply to operations performed on the Decimal instances created by it. + * + * @alias set + */ + static config(object: I.Decimal.Config): I.Decimal.Constructor; + + /** + * Configures the 'global' settings for this particular Decimal constructor, i.e. the settings which apply to operations performed on the Decimal instances created by it. + * + * @alias config + */ + static set(object: I.Decimal.Config): I.Decimal.Constructor; + + /** + * Returns a new Decimal whose value is the cosine of the value in radians of x, rounded to precision significant digits using rounding mode rounding. + */ + static cos(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the inverse hyperbolic cosine in radians of x, rounded to precision significant digits using rounding mode rounding. + */ + static cosh(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the value of x divided by x, rounded to precision significant digits using rounding mode rounding. + */ + static div(x: I.Decimal.Value, y: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the base e (Euler's number, the base of the natural logarithm) exponential of x, rounded to precision significant digits using rounding mode rounding. + */ + static exp(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the value of x rounded to a whole number in the direction of negative Infinity. + */ + static floor(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the square root of the sum of the squares of the arguments, rounded to precision significant digits using rounding mode rounding. + */ + static hypot(...x: I.Decimal.Value[]): Decimal; + + /** + * Returns true if object is a Decimal instance (where Decimal is any Decimal constructor), or false if it is not. + */ + static isDecimal(object: any): boolean; + + /** + * Returns a new Decimal whose value is the natural logarithm of x, rounded to precision significant digits using rounding mode rounding. + */ + static ln(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the base x logarithm of x, rounded to precision significant digits using rounding mode rounding. + * + * @param base logarithm base, default is 10 + */ + static log(x: I.Decimal.Value, base?: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the base 2 logarithm of x, rounded to precision significant digits using rounding mode rounding. + */ + static log2(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the base 10 logarithm of x, rounded to precision significant digits using rounding mode rounding. + */ + static log10(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the maximum of the arguments. + */ + static max(...x: I.Decimal.Value[]): Decimal; + + /** + * Returns a new Decimal whose value is the minimum of the arguments. + */ + static min(...x: I.Decimal.Value[]): Decimal; + + /** + * Returns a new Decimal whose value is x modulo y, rounded to precision significant digits using rounding mode rounding. + */ + static mod(x: I.Decimal.Value, y: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is x times y, rounded to precision significant digits using rounding mode rounding. + */ + static mul(x: I.Decimal.Value, y: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is base raised to the power exponent, rounded to precision significant digits using rounding mode rounding. + */ + static pow(base: I.Decimal.Value, exponent: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal with a pseudo-random value equal to or greater than 0 and less than 1. + * + * The return value will have dp decimal places (or less if trailing zeros are produced). If dp is omitted then the number of decimal places will default to the current precision setting. + */ + static random(significantDigits?: number): Decimal; + + /** + * Returns a new Decimal whose value is x rounded to a whole number using rounding mode rounding. + */ + static round(x: I.Decimal.Value): Decimal; + + /** + * 1 if the value of x is non-zero and its sign is positive + * + * -1 if the value of x is non-zero and its sign is negative + * + * 0 if the value of x is positive zero + * + * -0 if the value of x is negative zero + * + * NaN if the value of x is NaN + */ + static sign(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the sine of the value in radians of x, rounded to precision significant digits using rounding mode rounding. + */ + static sin(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the hyperbolic sine of the value in radians of x, rounded to precision significant digits using rounding mode rounding. + */ + static sinh(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the square root of x, rounded to precision significant digits using rounding mode rounding. + */ + static sqrt(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is x minus y, rounded to precision significant digits using rounding mode rounding. + */ + static sub(x: I.Decimal.Value, y: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the tangent of the value in radians of x, rounded to precision significant digits using rounding mode rounding. + */ + static tan(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is the hyperbolic tangent of the value in radians of x, rounded to precision significant digits using rounding mode rounding. + */ + static tanh(x: I.Decimal.Value): Decimal; + + /** + * Returns a new Decimal whose value is x truncated to a whole number. + */ + static trunc(x: I.Decimal.Value): Decimal; + + static readonly default?: I.Decimal.Constructor; + static readonly Decimal?: I.Decimal.Constructor; + + /** + * The maximum number of significant digits of the result of an operation. + */ + static readonly precision: number; + + /** + * The default rounding mode used when rounding the result of an operation to precision significant digits, and when rounding + * the return value of the round, toBinary, toDecimalPlaces, toExponential, toFixed, toHexadecimal, toNearest, toOctal, + * toPrecision and toSignificantDigits methods. + */ + static readonly rounding: I.Decimal.Rounding; + + /** + * The negative exponent value at and below which toString returns exponential notation. + * + * JavaScript numbers use exponential notation for negative exponents of -7 and below. + */ + static readonly toExpNeg: number; + + /** + * The positive exponent value at and above which toString returns exponential notation. + * + * JavaScript numbers use exponential notation for positive exponents of 20 and above. + */ + static readonly toExpPos: number; + + static readonly minE: number; + + static readonly maxE: number; + + static readonly crypto: boolean; + + /** + * The modulo mode used when calculating the modulus: a mod n. + * + * The quotient, q = a / n, is calculated according to the rounding mode that corresponds to the chosen modulo mode. + * + * The remainder, r, is calculated as: r = a - n * q. + */ + static readonly modulo: I.Decimal.Modulo; + + /** + * Rounds away from zero + */ + static readonly ROUND_UP: 0; + + /** + * Rounds towards zero + */ + static readonly ROUND_DOWN: 1; + + /** + * Rounds towards Infinity + */ + static readonly ROUND_CEIL: 2; + + /** + * Rounds towards -Infinity + */ + static readonly ROUND_FLOOR: 3; + + /** + * Rounds towards nearest neighbour. + * + * If equidistant, rounds away from zero + */ + static readonly ROUND_HALF_UP: 4; + + /** + * Rounds towards nearest neighbour. + * + * If equidistant, rounds towards zero + */ + static readonly ROUND_HALF_DOWN: 5; + + /** + * Rounds towards nearest neighbour. + * + * If equidistant, rounds towards even neighbour + */ + static readonly ROUND_HALF_EVEN: 6; + + /** + * Rounds towards nearest neighbour. + * + * If equidistant, rounds towards Infinity + */ + static readonly ROUND_HALF_CEIL: 7; + + /** + * Rounds towards nearest neighbour. + * + * If equidistant, rounds towards -Infinity + */ + static readonly ROUND_HALF_FLOOR: 8; + + /** + * Not a rounding mode + */ + static readonly EUCLID: 9; + } +} diff --git a/types/adone/glosses/math/index.d.ts b/types/adone/glosses/math/index.d.ts index 2713196e6e..5e6bbeea65 100644 --- a/types/adone/glosses/math/index.d.ts +++ b/types/adone/glosses/math/index.d.ts @@ -1,3 +1,7 @@ +/// +/// +/// +/// /// /// @@ -6,748 +10,6 @@ declare namespace adone { * math related things */ namespace math { - namespace I { - interface LowHighBits { - /** - * The low (signed) 32 bits of the long - */ - low: number; - /** - * The high (signed) 32 bits of the long - */ - high: number; - } - type Longable = Long | number | string | LowHighBits; - } - - /** - * Represents a 64 bit two's-complement integer - */ - class Long { - low: number; - high: number; - unsigned: boolean; - - /** - * @param low The low (signed) 32 bits of the long - * @param high The high (signed) 32 bits of the long - * @param unsigned Whether unsigned or not, defaults to false for signed - */ - constructor(low?: number, high?: number, unsigned?: boolean); - - /** - * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer - */ - toInt(): number; - - /** - * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa) - */ - toNumber(): number; - - /** - * Converts the Long to a string written in the specified radix - * - * @param radix Radix (2-36), 10 by default - */ - toString(radix?: number): string; - - inspect(): string; - - /** - * Gets the high 32 bits as a signed integer - */ - getHighBits(): number; - - /** - * Gets the high 32 bits as an unsigned integer - */ - getHighBitsUnsigned(): number; - - /** - * Gets the low 32 bits as a signed integer - */ - getLowBits(): number; - - /** - * Gets the low 32 bits as an unsigned integer - */ - getLowBitsUnsigned(): number; - - /** - * Gets the number of bits needed to represent the absolute value of this Long - */ - getNumBitsAbs(): number; - - /** - * Tests if this Long's value equals zero - */ - isZero(): boolean; - - /** - * Tests if this Long's value is negative - */ - isNegative(): boolean; - - /** - * Tests if this Long's value is positive - */ - isPositive(): boolean; - - /** - * Tests if this Long's value is odd - */ - isOdd(): boolean; - - /** - * Tests if this Long's value is even - */ - isEven(): boolean; - - /** - * Tests if this Long's value equals the specified's - */ - equals(other: I.Longable): boolean; - - /** - * Tests if this Long's value is less than the specified's - */ - lessThan(other: I.Longable): boolean; - - /** - * Tests if this Long's value is less than or equal the specified's - */ - lessThanOrEqual(other: I.Longable): boolean; - - /** - * Tests if this Long's value is greater than the specified's - */ - greaterThan(other: I.Longable): boolean; - - /** - * Tests if this Long's value is greater than or equal the specified's - */ - greaterThanOrEqual(other: I.Longable): boolean; - - /** - * Compares this Long's value with the specified's. - * Returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater - */ - compare(other: I.Longable): number; - - /** - * Negates this Long's value - */ - negate(): Long; - - /** - * Returns the sum of this and the specified Long - */ - add(addend: I.Longable): Long; - - /** - * Returns the difference of this and the specified Long - */ - sub(subtrahend: I.Longable): Long; - - /** - * Returns the product of this and the specified Long - */ - mul(multiplier: I.Longable): Long; - - /** - * Returns this Long divided by the specified - */ - div(divisor: I.Longable): Long; - - /** - * Returns this Long modulo the specified - */ - mod(divisor: I.Longable): Long; - - /** - * Returns the bitwise NOT of this Long - */ - not(): Long; - - /** - * Returns the bitwise AND of this Long and the specified - */ - and(other: I.Longable): Long; - - /** - * Returns the bitwise OR of this Long and the specifieds - */ - or(other: I.Longable): Long; - - /** - * Returns the bitwise XOR of this Long and the given one - */ - xor(other: I.Longable): Long; - - /** - * Returns this Long with bits shifted to the left by the given amount - */ - shl(numBits: number | Long): Long; - - /** - * Returns this Long with bits arithmetically shifted to the right by the given amount - */ - shr(numBits: number | Long): Long; - - /** - * Returns this Long with bits logically shifted to the right by the given amount - */ - shru(numBits: number | Long): Long; - - /** - * Converts this Long to signed - */ - toSigned(): Long; - - /** - * Converts this Long to unsigned - */ - toUnsigned(): Long; - - /** - * Converts this Long to an array of bytes, big-endian by default - * - * @param le Whether to return an array in little-endian format - */ - toBytes(le?: boolean): number[]; - - /** - * Converts this Long to an array of bytes in little-endian format - */ - toBytesLE(): number[]; - - /** - * Converts this Long to an array of bytes in big-endian format - */ - toBytesBE(): number[]; - - /** - * Returns a Long representing the given 32 bit integer value - */ - static fromInt(value: number, unsigned?: boolean): Long; - - /** - * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned - */ - static fromNumber(value?: number, unsigned?: boolean): Long; - - /** - * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits - */ - static fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long; - - /** - * Returns a Long representation of the given string, written using the specified radix - */ - static fromString(str: string, unsigned?: boolean, radix?: number): Long; - - /** - * Returns a Long representation of the given string, written using the specified radix - */ - static fromString(str: string, radix?: number): Long; - - /** - * Converts the specified value to a Long - */ - static fromValue(val: I.Longable): Long; - - /** - * Minimum signed value - */ - static MIN_VALUE: Long; - - /** - * Maximum signed value - */ - static MAX_VALUE: Long; - - /** - * Maximum unsigned value - */ - static MAX_UNSIGNED_VALUE: Long; - - /** - * Signed zero - */ - static ZERO: Long; - - /** - * Unsigned zero - */ - static UZERO: Long; - - /** - * Signed one - */ - static ONE: Long; - - /** - * Unsigned one - */ - static UONE: Long; - - /** - * Signed negative one - */ - static NEG_ONE: Long; - } - - namespace I.BigNumber { - interface BufferConvertOptions { - endian?: 1 | -1 | "big" | "little"; - size?: "auto" | number; - } - } - - /** - * Represents a number of arbitrary precision - */ - class BigNumber { - /** - * Creates a BigNumber from the given value, the base is 10 - */ - constructor(n: number | string | BigNumber); - - /** - * Creates a BigNumber from the given string and base - */ - constructor(n: string, base: number); - - /** - * Converts the number to a string in the given base - */ - toString(base?: number): string; - - /** - * Converts the bignum into a Number. - * If the bignum is too big you'll lose precision or you'll get ±Infinity. - */ - toNumber(): number; - - /** - * Returns a new Buffer with the data from the bignum. - */ - toBuffer(opts?: I.BigNumber.BufferConvertOptions): Buffer; - - /** - * Returns a new bignum containing the instance value plus n - */ - add(n: number | string | BigNumber): BigNumber; - - /** - * Return a new bignum containing the instance value minus n - */ - sub(n: number | string | BigNumber): BigNumber; - - /** - * Returns a new bignum containing the instance value multiplied by n - */ - mul(n: number | string | BigNumber): BigNumber; - - /** - * Returns a new bignum containing the instance value integrally divided by n - */ - div(n: number | string | BigNumber): BigNumber; - - /** - * Returns a new bignum with the absolute value of the instance - */ - abs(): BigNumber; - - /** - * Returns a new bignum with the negative of the instance value - */ - neg(): BigNumber; - - /** - * Compares the instance value to n. - * - * Returns a positive integer if > n, a negative integer if < n, and 0 if == n - */ - cmp(n: number | string | BigNumber): number; - - /** - * Checks whether the instance value is greater than n (> n). - */ - gt(n: number | string | BigNumber): boolean; - - /** - * Checks whether the instance value is greater than or equal to n (>= n). - */ - ge(n: number | string | BigNumber): boolean; - - /** - * Checks whether the instance value is equal to n (== n). - */ - eq(n: number | string | BigNumber): boolean; - - /** - * Checks whether the instance value is less than n (< n). - */ - lt(n: number | string | BigNumber): boolean; - - /** - * Checks whether the instance value is less than or equal to n (<= n). - */ - le(n: number | string | BigNumber): boolean; - - /** - * Returns a new bignum with the instance value bitwise AND (&)-ed with n. - */ - and(n: number | string | BigNumber): BigNumber; - - /** - * Returns a new bignum with the instance value bitwise inclusive-OR (|)-ed with n. - */ - or(n: number | string | BigNumber): BigNumber; - - /** - * Returns a new bignum with the instance value bitwise exclusive-OR (^)-ed with n. - */ - xor(n: number | string | BigNumber): BigNumber; - - /** - * Returns a new bignum with the instance value modulo n. - */ - mod(n: number | string | BigNumber): BigNumber; - - /** - * Returns a new bignum with the instance value raised to the nth power. - */ - pow(n: number | string | BigNumber): BigNumber; - - /** - * Returns a new bignum with the instance value raised to the nth power modulo m. - */ - powm(n: number | string | BigNumber, m: number | string | BigNumber): BigNumber; - - /** - * Computes the multiplicative inverse modulo m. - */ - invertm(m: number | string | BigNumber): BigNumber; - - /** - * Returns a random number from 0 to this -1 - */ - rand(): BigNumber; - - /** - * Returns a random number from this to upperBound - 1 - */ - rand(upperBound: number | string | BigNumber): BigNumber; - - /** - * Checks whether the bignum is: - * - * - certainly prime (true) - * - * - probably prime ('maybe') - * - * - certainly composite (false) - */ - probPrime(): boolean | "maybe"; - - /** - * Returns the next prime number after this bignum - */ - nextPrime(): BigNumber; - - /** - * Returns a new bignum that is the square root. This truncates. - */ - sqrt(): BigNumber; - - /** - * Returns a new bignum that is the nth root. This truncates. - */ - root(n: number | string | BigNumber): BigNumber; - - /** - * Returns a new bignum that is the 2^n multiple. Equivalent of the << operator. - */ - shiftLeft(n: number | string | BigNumber): BigNumber; - - /** - * Returns a new bignum of the value integer divided by 2^n. Equivalent of the >> operator. - */ - shiftRight(n: number | string | BigNumber): BigNumber; - - /** - * Returns the greatest common divisor of the current bignum with n as a new bignum. - */ - gcd(n: number | string | BigNumber): BigNumber; - - /** - * Returns the Jacobi symbol (or Legendre symbol if n is prime) of the current bignum (= a) over n. - * Note that n must be odd and >= 3. 0 <= a < n. - * Returns -1 or 1 - */ - jacobi(n: number | string | BigNumber): number; - - /** - * Returns the number of bits used to represent the current bignum - */ - bitLength(): number; - - /** - * Checks whether the bit at the given index is set - */ - isBitSet(n: number): boolean; - - /** - * Generates a probable prime number of length bits. - * - * @param bits the number of bits - * @param safe If true, it will be a "safe" prime of the form p=2p'+1 where p' is also prime. Default: true - */ - static prime(bits: number, safe?: boolean): BigNumber; - - /** - * Creates a new bignum from a Buffer. - */ - static fromBuffer(buf: Buffer, opts?: I.BigNumber.BufferConvertOptions): BigNumber; - - /** - * One - */ - static ONE: BigNumber; - - /** - * Zero - */ - static ZERO: BigNumber; - } - - /** - * Represents a set of bits - */ - class BitSet { - /** - * Creates a new bitset of n bits - */ - constructor(n: number); - - /** - * Creates a new bitset from a dehydrated bitset - */ - constructor(key: string); - - /** - * Checks whether a bit at a specific index is set - */ - get(idx: number): boolean; - - /** - * Sets a single bit. - * Returns true if set was successfull - */ - set(idx: number): boolean; - - /** - * Sets a range of bits. - * Returns true if set was successfull - */ - setRange(from: number, to: number): boolean; - - /** - * Unsets a single bit. - * Returns true if unset was successfull - */ - unset(idx: number): boolean; - - /** - * Unsets a range of bits. - * Returns true if unset was successfull - */ - unsetRange(from: number, to: number): boolean; - - /** - * Toggles a single bit - */ - toggle(idx: number): boolean; - - /** - * Toggles a range of bits - */ - toggleRange(from: number, to: number): boolean; - - /** - * Clears the entire bitset - */ - clear(): boolean; - - /** - * Clones the set - */ - clone(): BitSet; - - /** - * Turns the bitset into a comma separated string that skips leading & trailing 0 words. - * Ends with the number of leading 0s and MAX_BIT. - * Useful if you need the bitset to be an object key (eg dynamic programming). - * Can rehydrate by passing the result into the constructor - */ - dehydrate(): string; - - /** - * Performs a bitwise AND on 2 bitsets or 1 bitset and 1 index. - * Both bitsets must have the same number of words, no length check is performed to prevent and overflow. - */ - and(value: number | BitSet): BitSet; - - /** - * Performs a bitwise OR on 2 bitsets or 1 bitset and 1 index. - * Both bitsets must have the same number of words, no length check is performed to prevent and overflow. - */ - or(value: number | BitSet): BitSet; - - /** - * Performs a bitwise XOR on 2 bitsets or 1 bitset and 1 index. - * Both bitsets must have the same number of words, no length check is performed to prevent and overflow. - */ - xor(value: number | BitSet): BitSet; - - /** - * Runs a custom function on every set bit. - * Faster than iterating over the entire bitset with a get(). - * If the callback returns `false` it stops iterating. - */ - forEach(callback: ((idx: number) => void | boolean)): void; - - /** - * Performs a circular shift bitset by an offset - * - * @param n number of positions that the bitset that will be shifted to the right. Using a negative number will result in a left shift. - */ - circularShift(n: number): BitSet; - - /** - * Gets the cardinality (count of set bits) for the entire bitset - */ - getCardinality(): number; - - /** - * Gets the indices of all set bits - */ - getIndices(): number[]; - - /** - * Checks if one bitset is subset of another. - */ - isSubsetOf(other: BitSet): boolean; - - /** - * Quickly determines if a bitset is empty - */ - isEmpty(): boolean; - - /** - * Quickly determines if both bitsets are equal (faster than checking if the XOR of the two is === 0). - * Both bitsets must have the same number of words, no length check is performed to prevent and overflow. - */ - isEqual(other: BitSet): boolean; - - /** - * Gets a string representation of the entire bitset, including leading 0s - */ - toString(): string; - - /** - * Finds first set bit (useful for processing queues, breadth-first tree searches, etc.). - * Returns -1 if not found - * - * @param startWord the word to start with (only used internally by nextSetBit) - */ - ffs(startWord?: number): number; - - /** - * Finds first zero (unset bit). - * Returns -1 if not found - * - * @param startWord the word to start with (only used internally by nextUnsetBit) - */ - ffz(startWord?: number): number; - - /** - * Finds last set bit. - * Returns -1 if not found - * - * @param startWord the word to start with (only used internally by previousSetBit) - */ - fls(startWord?: number): number; - - /** - * Finds last zero (unset bit). - * Returns -1 if not found - * - * @param startWord the word to start with (only used internally by previousUnsetBit) - */ - flz(startWord?: number): number; - - /** - * Finds first set bit, starting at a given index. - * Return -1 if not found - * - * @param idx the starting index for the next set bit - */ - nextSetBit(idx: number): number; - - /** - * Finds first unset bit, starting at a given index. - * Return -1 if not found - * - * @param idx the starting index for the next unset bit - */ - nextUnsetBit(idx: number): number; - - /** - * Finds last set bit, up to a given index. - * Returns -1 if not found - * - * @param idx the starting index for the next unset bit (going in reverse) - */ - previousSetBit(idx: number): number; - - /** - * Finds last unset bit, up to a given index. - * Returns -1 if not found - */ - previousUnsetBit(idx: number): number; - - /** - * Converts the bitset to a math.Long number - */ - toLong(): Long; - - /** - * Reads an unsigned integer of the given bits from the given offset - * - * @param bits number of bits, 1 by default - * @param offset offset, 0 by default - */ - readUInt(bits?: number, offset?: number): number; - - /** - * Writes the given unsigned integer - * - * @param val integer - * @param bits number of bits to write, 1 by default - * @param offset write offset, 0 by default - */ - writeUInt(val: number, bits?: number, offset?: number): void; - - /** - * Creates a new BitSet from the given math.Long number - */ - static fromLong(l: Long): BitSet; - } - /** * Returns a random number from min to max - 1 * @@ -755,5 +17,21 @@ declare namespace adone { * @param max upper bound, default is 0xFFFFFFFF */ function random(min?: number, max?: number): number; + + /** + * Returns the maximum value from the given array + * + * @param array array of values + * @param score function to calculate the element score value + */ + function max(array: T[], score?: (x: T) => any): T; + + /** + * Returns the minimum value from the given array + * + * @param array array of values + * @param score function to calculate the element score value + */ + function min(array: T[], score?: (x: T) => any): T; } } diff --git a/types/adone/glosses/math/long.d.ts b/types/adone/glosses/math/long.d.ts new file mode 100644 index 0000000000..a4a15e2be5 --- /dev/null +++ b/types/adone/glosses/math/long.d.ts @@ -0,0 +1,293 @@ +declare namespace adone.math { + namespace I { + interface LowHighBits { + /** + * The low (signed) 32 bits of the long + */ + low: number; + /** + * The high (signed) 32 bits of the long + */ + high: number; + } + type Longable = Long | number | string | LowHighBits; + } + + /** + * Represents a 64 bit two's-complement integer + */ + class Long { + low: number; + high: number; + unsigned: boolean; + + /** + * @param low The low (signed) 32 bits of the long + * @param high The high (signed) 32 bits of the long + * @param unsigned Whether unsigned or not, defaults to false for signed + */ + constructor(low?: number, high?: number, unsigned?: boolean); + + /** + * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer + */ + toInt(): number; + + /** + * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa) + */ + toNumber(): number; + + /** + * Converts the Long to a string written in the specified radix + * + * @param radix Radix (2-36), 10 by default + */ + toString(radix?: number): string; + + inspect(): string; + + /** + * Gets the high 32 bits as a signed integer + */ + getHighBits(): number; + + /** + * Gets the high 32 bits as an unsigned integer + */ + getHighBitsUnsigned(): number; + + /** + * Gets the low 32 bits as a signed integer + */ + getLowBits(): number; + + /** + * Gets the low 32 bits as an unsigned integer + */ + getLowBitsUnsigned(): number; + + /** + * Gets the number of bits needed to represent the absolute value of this Long + */ + getNumBitsAbs(): number; + + /** + * Tests if this Long's value equals zero + */ + isZero(): boolean; + + /** + * Tests if this Long's value is negative + */ + isNegative(): boolean; + + /** + * Tests if this Long's value is positive + */ + isPositive(): boolean; + + /** + * Tests if this Long's value is odd + */ + isOdd(): boolean; + + /** + * Tests if this Long's value is even + */ + isEven(): boolean; + + /** + * Tests if this Long's value equals the specified's + */ + equals(other: I.Longable): boolean; + + /** + * Tests if this Long's value is less than the specified's + */ + lessThan(other: I.Longable): boolean; + + /** + * Tests if this Long's value is less than or equal the specified's + */ + lessThanOrEqual(other: I.Longable): boolean; + + /** + * Tests if this Long's value is greater than the specified's + */ + greaterThan(other: I.Longable): boolean; + + /** + * Tests if this Long's value is greater than or equal the specified's + */ + greaterThanOrEqual(other: I.Longable): boolean; + + /** + * Compares this Long's value with the specified's. + * Returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater + */ + compare(other: I.Longable): number; + + /** + * Negates this Long's value + */ + negate(): Long; + + /** + * Returns the sum of this and the specified Long + */ + add(addend: I.Longable): Long; + + /** + * Returns the difference of this and the specified Long + */ + sub(subtrahend: I.Longable): Long; + + /** + * Returns the product of this and the specified Long + */ + mul(multiplier: I.Longable): Long; + + /** + * Returns this Long divided by the specified + */ + div(divisor: I.Longable): Long; + + /** + * Returns this Long modulo the specified + */ + mod(divisor: I.Longable): Long; + + /** + * Returns the bitwise NOT of this Long + */ + not(): Long; + + /** + * Returns the bitwise AND of this Long and the specified + */ + and(other: I.Longable): Long; + + /** + * Returns the bitwise OR of this Long and the specifieds + */ + or(other: I.Longable): Long; + + /** + * Returns the bitwise XOR of this Long and the given one + */ + xor(other: I.Longable): Long; + + /** + * Returns this Long with bits shifted to the left by the given amount + */ + shl(numBits: number | Long): Long; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount + */ + shr(numBits: number | Long): Long; + + /** + * Returns this Long with bits logically shifted to the right by the given amount + */ + shru(numBits: number | Long): Long; + + /** + * Converts this Long to signed + */ + toSigned(): Long; + + /** + * Converts this Long to unsigned + */ + toUnsigned(): Long; + + /** + * Converts this Long to an array of bytes, big-endian by default + * + * @param le Whether to return an array in little-endian format + */ + toBytes(le?: boolean): number[]; + + /** + * Converts this Long to an array of bytes in little-endian format + */ + toBytesLE(): number[]; + + /** + * Converts this Long to an array of bytes in big-endian format + */ + toBytesBE(): number[]; + + /** + * Returns a Long representing the given 32 bit integer value + */ + static fromInt(value: number, unsigned?: boolean): Long; + + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned + */ + static fromNumber(value?: number, unsigned?: boolean): Long; + + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits + */ + static fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long; + + /** + * Returns a Long representation of the given string, written using the specified radix + */ + static fromString(str: string, unsigned?: boolean, radix?: number): Long; + + /** + * Returns a Long representation of the given string, written using the specified radix + */ + static fromString(str: string, radix?: number): Long; + + /** + * Converts the specified value to a Long + */ + static fromValue(val: I.Longable): Long; + + /** + * Minimum signed value + */ + static MIN_VALUE: Long; + + /** + * Maximum signed value + */ + static MAX_VALUE: Long; + + /** + * Maximum unsigned value + */ + static MAX_UNSIGNED_VALUE: Long; + + /** + * Signed zero + */ + static ZERO: Long; + + /** + * Unsigned zero + */ + static UZERO: Long; + + /** + * Signed one + */ + static ONE: Long; + + /** + * Unsigned one + */ + static UONE: Long; + + /** + * Signed negative one + */ + static NEG_ONE: Long; + } +} diff --git a/types/adone/glosses/regex.d.ts b/types/adone/glosses/regex.d.ts index e5c3be642a..edd66d324f 100644 --- a/types/adone/glosses/regex.d.ts +++ b/types/adone/glosses/regex.d.ts @@ -2,9 +2,17 @@ declare namespace adone { namespace regex { function filename(): RegExp; - function ip4(): RegExp; + namespace I.IP { + interface Options { + exact?: boolean; + } + } - function ip6(): RegExp; + function ip(options?: I.IP.Options): RegExp; + + function ip4(options?: I.IP.Options): RegExp; + + function ip6(options?: I.IP.Options): RegExp; function protocol(): RegExp; diff --git a/types/adone/test/glosses/collections/byte_array.ts b/types/adone/test/glosses/collections/byte_array.ts index 7254008322..377acfba9c 100644 --- a/types/adone/test/glosses/collections/byte_array.ts +++ b/types/adone/test/glosses/collections/byte_array.ts @@ -56,6 +56,11 @@ namespace adoneTests.collection.ByteArray { const b: number = buffer.readUInt16BE(10); } + namespace readUInt24BE { + const a: number = buffer.readUInt24BE(); + const b: number = buffer.readUInt24BE(10); + } + namespace readInt32LE { const a: number = buffer.readInt32LE(); const b: number = buffer.readInt32LE(10); @@ -162,6 +167,11 @@ namespace adoneTests.collection.ByteArray { const b: adone.collection.ByteArray = buffer.writeUInt16BE(10, 10); } + namespace writeUInt24BE { + const a: adone.collection.ByteArray = buffer.writeUInt24BE(10); + const b: adone.collection.ByteArray = buffer.writeUInt24BE(10, 10); + } + namespace writeInt32LE { const a: adone.collection.ByteArray = buffer.writeInt32LE(10); const b: adone.collection.ByteArray = buffer.writeInt32LE(10, 10); diff --git a/types/adone/test/glosses/collections/fast_lru.ts b/types/adone/test/glosses/collections/fast_lru.ts index 0e61f51dc5..6df1164d53 100644 --- a/types/adone/test/glosses/collections/fast_lru.ts +++ b/types/adone/test/glosses/collections/fast_lru.ts @@ -6,8 +6,8 @@ namespace adoneTests.collection.FastLRU { } = adone; new FastLRU(); - new FastLRU(100); - new FastLRU(100, { dispose: (key: string, value: number) => null }); + new FastLRU({ maxSize: 100 }); + new FastLRU({ maxSize: 100, dispose: (key: string, value: number) => null }); { const a: number = new FastLRU().size; } { const a: number | undefined = new FastLRU().get("key"); } new FastLRU().set("key", 123); diff --git a/types/adone/test/glosses/collections/lru.ts b/types/adone/test/glosses/collections/lru.ts index 934e5a1fbf..59e7b77694 100644 --- a/types/adone/test/glosses/collections/lru.ts +++ b/types/adone/test/glosses/collections/lru.ts @@ -8,15 +8,14 @@ namespace adoneTests.collection.LRU { type LRU = adone.collection.LRU; new LRU(); - new LRU(100); + new LRU({ maxSize: 100 }); new LRU({}); - new LRU({ max: 100 }); new LRU({ dispose: (key: string, value: number) => null }); new LRU({ maxAge: 100 }); new LRU({ noDisposeOnSet: false }); new LRU({ stale: true }); - { const a: number = new LRU().max; } - { new LRU().max = 100; } + { const a: number = new LRU().maxSize; } + { new LRU().maxSize = 100; } { const a: boolean = new LRU().allowStale; } { new LRU().allowStale = false; } { const a: number = new LRU().maxAge; } diff --git a/types/adone/test/glosses/collections/time_map.ts b/types/adone/test/glosses/collections/time_map.ts new file mode 100644 index 0000000000..5cabcdac9d --- /dev/null +++ b/types/adone/test/glosses/collections/time_map.ts @@ -0,0 +1,22 @@ +namespace adoneTests.collection.TimedoutMap { + const { + collection: { + TimeMap + } + } = adone; + + type TimeMap = adone.collection.TimeMap; + + new TimeMap(); + new TimeMap(1000); + new TimeMap(1000, (key: string) => null); + { + const a: TimeMap = new TimeMap().forEach((value: number, key: string) => null); + } + { + const a: TimeMap = new TimeMap().forEach(function (value: number, key: string) { + const a: number = this.a; + }, { a: 1 }); + } + { const a: boolean = new TimeMap().delete("123"); } +} diff --git a/types/adone/test/glosses/collections/timedout_map.ts b/types/adone/test/glosses/collections/timedout_map.ts deleted file mode 100644 index ffca754e2a..0000000000 --- a/types/adone/test/glosses/collections/timedout_map.ts +++ /dev/null @@ -1,22 +0,0 @@ -namespace adoneTests.collection.TimedoutMap { - const { - collection: { - TimedoutMap - } - } = adone; - - type TimedoutMap = adone.collection.TimedoutMap; - - new TimedoutMap(); - new TimedoutMap(1000); - new TimedoutMap(1000, (key: string) => null); - { - const a: TimedoutMap = new TimedoutMap().forEach((value: number, key: string) => null); - } - { - const a: TimedoutMap = new TimedoutMap().forEach(function (value: number, key: string) { - const a: number = this.a; - }, { a: 1 }); - } - { const a: boolean = new TimedoutMap().delete("123"); } -} diff --git a/types/adone/test/glosses/is.ts b/types/adone/test/glosses/is.ts index 455dd745da..96c954d284 100644 --- a/types/adone/test/glosses/is.ts +++ b/types/adone/test/glosses/is.ts @@ -345,7 +345,11 @@ namespace isTests { { const a: boolean = is.binaryExtension("mp3"); } { const a: boolean = is.binaryPath("a.mp3"); } { const a: boolean = is.ip4("192.168.1.1"); } + { const a: boolean = is.ip4("192.168.1.1", { exact: true }); } { const a: boolean = is.ip6("::192.168.1.1"); } + { const a: boolean = is.ip6("::192.168.1.1", { exact: true }); } + { const a: boolean = is.ip("::192.168.1.1"); } + { const a: boolean = is.ip("::192.168.1.1", { exact: true }); } { const a: boolean = is.arrayBuffer({}); const b: any = 2; @@ -492,4 +496,7 @@ namespace isTests { b.charCodeAt(0); } } + { + const a: boolean = is.multiAddress(2); + } } diff --git a/types/adone/test/glosses/math/bignumber.ts b/types/adone/test/glosses/math/bignumber.ts new file mode 100644 index 0000000000..8466abae7f --- /dev/null +++ b/types/adone/test/glosses/math/bignumber.ts @@ -0,0 +1,154 @@ +namespace mathTests.bignumberTests { + const { + math: { + BigNumber + } + } = adone; + + type BigNumber = adone.math.BigNumber; + + new BigNumber(10); + new BigNumber("10"); + new BigNumber(new BigNumber(10)); + new BigNumber("10", 2); + + { const a: string = new BigNumber(1).toString(); } + { const a: string = new BigNumber(1).toString(2); } + + { const a: number = new BigNumber(1).toNumber(); } + + { const a: Buffer = new BigNumber(1).toBuffer(); } + { const a: Buffer = new BigNumber(1).toBuffer({}); } + { const a: Buffer = new BigNumber(1).toBuffer({ endian: 1 }); } + { const a: Buffer = new BigNumber(1).toBuffer({ endian: -1 }); } + { const a: Buffer = new BigNumber(1).toBuffer({ endian: "big" }); } + { const a: Buffer = new BigNumber(1).toBuffer({ endian: "little" }); } + { const a: Buffer = new BigNumber(1).toBuffer({ size: 1 }); } + { const a: Buffer = new BigNumber(1).toBuffer({ size: "auto" }); } + + { const a: BigNumber = new BigNumber(10).add(1); } + { const a: BigNumber = new BigNumber(10).add("1"); } + { const a: BigNumber = new BigNumber(10).add(new BigNumber(1)); } + + { const a: BigNumber = new BigNumber(10).sub(1); } + { const a: BigNumber = new BigNumber(10).sub("1"); } + { const a: BigNumber = new BigNumber(10).sub(new BigNumber(1)); } + + { const a: BigNumber = new BigNumber(10).mul(1); } + { const a: BigNumber = new BigNumber(10).mul("1"); } + { const a: BigNumber = new BigNumber(10).mul(new BigNumber(1)); } + + { const a: BigNumber = new BigNumber(10).div(1); } + { const a: BigNumber = new BigNumber(10).div("1"); } + { const a: BigNumber = new BigNumber(10).div(new BigNumber(1)); } + + { const a: BigNumber = new BigNumber(10).abs(); } + + { const a: BigNumber = new BigNumber(10).neg(); } + + { const a: number = new BigNumber(10).cmp(1); } + { const a: number = new BigNumber(10).cmp("1"); } + { const a: number = new BigNumber(10).cmp(new BigNumber(1)); } + + { const a: boolean = new BigNumber(10).gt(1); } + { const a: boolean = new BigNumber(10).gt("1"); } + { const a: boolean = new BigNumber(10).gt(new BigNumber(10)); } + + { const a: boolean = new BigNumber(10).ge(1); } + { const a: boolean = new BigNumber(10).ge("1"); } + { const a: boolean = new BigNumber(10).ge(new BigNumber(10)); } + + { const a: boolean = new BigNumber(10).eq(1); } + { const a: boolean = new BigNumber(10).eq("1"); } + { const a: boolean = new BigNumber(10).eq(new BigNumber(10)); } + + { const a: boolean = new BigNumber(10).lt(1); } + { const a: boolean = new BigNumber(10).lt("1"); } + { const a: boolean = new BigNumber(10).lt(new BigNumber(10)); } + + { const a: boolean = new BigNumber(10).le(1); } + { const a: boolean = new BigNumber(10).le("1"); } + { const a: boolean = new BigNumber(10).le(new BigNumber(10)); } + + { const a: BigNumber = new BigNumber(10).and(1); } + { const a: BigNumber = new BigNumber(10).and("1"); } + { const a: BigNumber = new BigNumber(10).and(new BigNumber(1)); } + + { const a: BigNumber = new BigNumber(10).or(1); } + { const a: BigNumber = new BigNumber(10).or("1"); } + { const a: BigNumber = new BigNumber(10).or(new BigNumber(1)); } + + { const a: BigNumber = new BigNumber(10).xor(1); } + { const a: BigNumber = new BigNumber(10).xor("1"); } + { const a: BigNumber = new BigNumber(10).xor(new BigNumber(1)); } + + { const a: BigNumber = new BigNumber(10).mod(1); } + { const a: BigNumber = new BigNumber(10).mod("1"); } + { const a: BigNumber = new BigNumber(10).mod(new BigNumber(1)); } + + { const a: BigNumber = new BigNumber(10).pow(1); } + { const a: BigNumber = new BigNumber(10).pow("1"); } + { const a: BigNumber = new BigNumber(10).pow(new BigNumber(1)); } + + { const a: BigNumber = new BigNumber(10).powm(1, 1); } + { const a: BigNumber = new BigNumber(10).powm("1", 1); } + { const a: BigNumber = new BigNumber(10).powm(new BigNumber(1), 1); } + { const a: BigNumber = new BigNumber(10).powm(1, "1"); } + { const a: BigNumber = new BigNumber(10).powm("1", "1"); } + { const a: BigNumber = new BigNumber(10).powm(new BigNumber(1), "1"); } + { const a: BigNumber = new BigNumber(10).powm(1, new BigNumber(1)); } + { const a: BigNumber = new BigNumber(10).powm("1", new BigNumber(1)); } + { const a: BigNumber = new BigNumber(10).powm(new BigNumber(1), new BigNumber(1)); } + + { const a: BigNumber = new BigNumber(10).invertm(1); } + { const a: BigNumber = new BigNumber(10).invertm("1"); } + { const a: BigNumber = new BigNumber(10).invertm(new BigNumber(1)); } + + { const a: BigNumber = new BigNumber(10).rand(); } + { const a: BigNumber = new BigNumber(10).rand(1); } + { const a: BigNumber = new BigNumber(10).rand("1"); } + { const a: BigNumber = new BigNumber(10).rand(new BigNumber(1)); } + + { const a: boolean | "maybe" = new BigNumber(10).probPrime(); } + + { const a: BigNumber = new BigNumber(10).nextPrime(); } + + { const a: BigNumber = new BigNumber(10).sqrt(); } + + { const a: BigNumber = new BigNumber(10).root(1); } + { const a: BigNumber = new BigNumber(10).root("1"); } + { const a: BigNumber = new BigNumber(10).root(new BigNumber(1)); } + + { const a: BigNumber = new BigNumber(10).shiftLeft(1); } + { const a: BigNumber = new BigNumber(10).shiftLeft("1"); } + { const a: BigNumber = new BigNumber(10).shiftLeft(new BigNumber(1)); } + + { const a: BigNumber = new BigNumber(10).shiftRight(1); } + { const a: BigNumber = new BigNumber(10).shiftRight("1"); } + { const a: BigNumber = new BigNumber(10).shiftRight(new BigNumber(1)); } + + { const a: BigNumber = new BigNumber(10).gcd(1); } + { const a: BigNumber = new BigNumber(10).gcd("1"); } + { const a: BigNumber = new BigNumber(10).gcd(new BigNumber(1)); } + + { const a: number = new BigNumber(10).jacobi(1); } + { const a: number = new BigNumber(10).jacobi("1"); } + { const a: number = new BigNumber(10).jacobi(new BigNumber(1)); } + + { const a: number = new BigNumber(10).bitLength(); } + + { const a: boolean = new BigNumber(10).isBitSet(10); } + + { const a: BigNumber = BigNumber.prime(10); } + { const a: BigNumber = BigNumber.prime(10, true); } + + { const a: BigNumber = BigNumber.fromBuffer(Buffer.alloc(10)); } + { const a: BigNumber = BigNumber.fromBuffer(Buffer.alloc(10), { endian: "little" }); } + { const a: BigNumber = BigNumber.fromBuffer(Buffer.alloc(10), { endian: -1 }); } + { const a: BigNumber = BigNumber.fromBuffer(Buffer.alloc(10), { endian: 1 }); } + { const a: BigNumber = BigNumber.fromBuffer(Buffer.alloc(10), { endian: "big" }); } + { const a: BigNumber = BigNumber.fromBuffer(Buffer.alloc(10), { size: "auto" }); } + + { const a: BigNumber = BigNumber.ONE; } + { const a: BigNumber = BigNumber.ZERO; } +} diff --git a/types/adone/test/glosses/math/bitset.ts b/types/adone/test/glosses/math/bitset.ts new file mode 100644 index 0000000000..1e08d0649f --- /dev/null +++ b/types/adone/test/glosses/math/bitset.ts @@ -0,0 +1,62 @@ +namespace mathTests.bitsetTests { + const { + math: { + BitSet + } + } = adone; + + type BitSet = adone.math.BitSet; + + new BitSet(10); + new BitSet(new BitSet(10).dehydrate()); + + { const a: boolean = new BitSet(10).get(0); } + { const a: boolean = new BitSet(10).set(0); } + { const a: boolean = new BitSet(10).setRange(0, 10); } + { const a: boolean = new BitSet(10).unset(0); } + { const a: boolean = new BitSet(10).unsetRange(0, 10); } + { const a: boolean = new BitSet(10).toggle(0); } + { const a: boolean = new BitSet(10).toggleRange(0, 10); } + { const a: boolean = new BitSet(10).clear(); } + { const a: BitSet = new BitSet(10).clone(); } + { const a: string = new BitSet(10).dehydrate(); } + + { const a: BitSet = new BitSet(10).and(1); } + { const a: BitSet = new BitSet(10).and(new BitSet(10)); } + + { const a: BitSet = new BitSet(10).or(1); } + { const a: BitSet = new BitSet(10).or(new BitSet(10)); } + + { const a: BitSet = new BitSet(10).xor(1); } + { const a: BitSet = new BitSet(10).xor(new BitSet(10)); } + + new BitSet(10).forEach((x: number) => {}); + new BitSet(10).forEach((x: number) => false); + + { const a: BitSet = new BitSet(10).circularShift(10); } + { const a: number = new BitSet(10).getCardinality(); } + { const a: number[] = new BitSet(10).getIndices(); } + { const a: boolean = new BitSet(10).isSubsetOf(new BitSet(10)); } + { const a: boolean = new BitSet(10).isEmpty(); } + { const a: boolean = new BitSet(10).isEqual(new BitSet(10)); } + { const a: string = new BitSet(10).toString(); } + { const a: number = new BitSet(10).ffs(); } + { const a: number = new BitSet(10).ffs(1); } + { const a: number = new BitSet(10).ffz(); } + { const a: number = new BitSet(10).ffz(1); } + { const a: number = new BitSet(10).fls(); } + { const a: number = new BitSet(10).fls(1); } + { const a: number = new BitSet(10).flz(); } + { const a: number = new BitSet(10).flz(1); } + { const a: number = new BitSet(10).nextSetBit(1); } + { const a: number = new BitSet(10).nextUnsetBit(1); } + { const a: number = new BitSet(10).previousSetBit(1); } + { const a: number = new BitSet(10).previousUnsetBit(1); } + { const a: number = new BitSet(10).readUInt(); } + { const a: number = new BitSet(10).readUInt(1); } + { const a: number = new BitSet(10).readUInt(1, 2); } + { new BitSet(10).writeUInt(1); } + { new BitSet(10).writeUInt(1, 2); } + { new BitSet(10).writeUInt(1, 2, 3); } + { const a: BitSet = BitSet.fromLong(new adone.math.Long(10, 20)); } +} diff --git a/types/adone/test/glosses/math/decimal.ts b/types/adone/test/glosses/math/decimal.ts new file mode 100644 index 0000000000..7c5f450c35 --- /dev/null +++ b/types/adone/test/glosses/math/decimal.ts @@ -0,0 +1,445 @@ +namespace mathTests.decimalTest { + const { + math: { + Decimal + } + } = adone; + + type Decimal = adone.math.Decimal; + + new Decimal(0); + new Decimal("0"); + new Decimal(new Decimal(0)); + + new Decimal(0).e.toExponential(); + new Decimal(0).d[0].toExponential(); + new Decimal(0).s.toExponential(); + + const d = new Decimal(0); + + { const a: Decimal = d.abs(); } + { const a: Decimal = d.absoluteValue(); } + + { const a: Decimal = d.ceil(); } + + { const a: number = d.comparedTo(1); } + { const a: number = d.comparedTo("1"); } + { const a: number = d.comparedTo(d); } + { const a: number = d.cmp(1); } + { const a: number = d.cmp("1"); } + { const a: number = d.cmp(d); } + + { const a: Decimal = d.cos(); } + { const a: Decimal = d.cosine(); } + + { const a: Decimal = d.cubeRoot(); } + { const a: Decimal = d.cbrt(); } + + { const a: number = d.decimalPlaces(); } + { const a: number = d.dp(); } + + { const a: Decimal = d.dividedBy(1); } + { const a: Decimal = d.dividedBy("1"); } + { const a: Decimal = d.dividedBy(d); } + { const a: Decimal = d.div(1); } + { const a: Decimal = d.div("1"); } + { const a: Decimal = d.div(d); } + + { const a: Decimal = d.dividedToIntegerBy(1); } + { const a: Decimal = d.dividedToIntegerBy("1"); } + { const a: Decimal = d.dividedToIntegerBy(d); } + { const a: Decimal = d.divToInt(1); } + { const a: Decimal = d.divToInt("1"); } + { const a: Decimal = d.divToInt(d); } + + { const a: boolean = d.equals(1); } + { const a: boolean = d.equals("1"); } + { const a: boolean = d.equals(d); } + { const a: boolean = d.eq(1); } + { const a: boolean = d.eq("1"); } + { const a: boolean = d.eq(d); } + + { const a: Decimal = d.floor(); } + + { const a: boolean = d.greaterThan(1); } + { const a: boolean = d.greaterThan("1"); } + { const a: boolean = d.greaterThan(d); } + { const a: boolean = d.gt(1); } + { const a: boolean = d.gt("1"); } + { const a: boolean = d.gt(d); } + + { const a: boolean = d.greaterThanOrEqualTo(1); } + { const a: boolean = d.greaterThanOrEqualTo("1"); } + { const a: boolean = d.greaterThanOrEqualTo(d); } + { const a: boolean = d.gte(1); } + { const a: boolean = d.gte("1"); } + { const a: boolean = d.gte(d); } + + { const a: Decimal = d.hyperbolicCosine(); } + { const a: Decimal = d.cosh(); } + + { const a: Decimal = d.hyperbolicSine(); } + { const a: Decimal = d.sinh(); } + + { const a: Decimal = d.hyperbolicTangent(); } + { const a: Decimal = d.tanh(); } + + { const a: Decimal = d.inverseCosine(); } + { const a: Decimal = d.acos(); } + + { const a: Decimal = d.inverseHyperbolicCosine(); } + { const a: Decimal = d.acosh(); } + + { const a: Decimal = d.inverseHyperbolicSine(); } + { const a: Decimal = d.asinh(); } + + { const a: Decimal = d.inverseHyperbolicTangent(); } + { const a: Decimal = d.atanh(); } + + { const a: Decimal = d.inverseSine(); } + { const a: Decimal = d.asin(); } + + { const a: Decimal = d.inverseTangent(); } + { const a: Decimal = d.atan(); } + + { const a: boolean = d.isFinite(); } + + { const a: boolean = d.isInteger(); } + { const a: boolean = d.isInt(); } + + { const a: boolean = d.isNaN(); } + + { const a: boolean = d.isNegative(); } + { const a: boolean = d.isNeg(); } + + { const a: boolean = d.isPositive(); } + { const a: boolean = d.isPos(); } + + { const a: boolean = d.isZero(); } + + { const a: boolean = d.lessThan(1); } + { const a: boolean = d.lessThan("1"); } + { const a: boolean = d.lessThan(d); } + { const a: boolean = d.lt(1); } + { const a: boolean = d.lt("1"); } + { const a: boolean = d.lt(d); } + + { const a: boolean = d.lessThanOrEqualTo(1); } + { const a: boolean = d.lessThanOrEqualTo("1"); } + { const a: boolean = d.lessThanOrEqualTo(d); } + { const a: boolean = d.lte(1); } + { const a: boolean = d.lte("1"); } + { const a: boolean = d.lte(d); } + + { const a: Decimal = d.logarithm(); } + { const a: Decimal = d.logarithm(1); } + { const a: Decimal = d.logarithm("1"); } + { const a: Decimal = d.logarithm(d); } + { const a: Decimal = d.log(); } + { const a: Decimal = d.log(1); } + { const a: Decimal = d.log("1"); } + { const a: Decimal = d.log(d); } + + { const a: Decimal = d.minus(1); } + { const a: Decimal = d.minus("1"); } + { const a: Decimal = d.minus(d); } + { const a: Decimal = d.sub(1); } + { const a: Decimal = d.sub("1"); } + { const a: Decimal = d.sub(d); } + + { const a: Decimal = d.modulo(1); } + { const a: Decimal = d.modulo("1"); } + { const a: Decimal = d.modulo(d); } + { const a: Decimal = d.mod(1); } + { const a: Decimal = d.mod("1"); } + { const a: Decimal = d.mod(d); } + + { const a: Decimal = d.naturalExponential(); } + { const a: Decimal = d.exp(); } + + { const a: Decimal = d.naturalLogarithm(); } + { const a: Decimal = d.ln(); } + + { const a: Decimal = d.negated(); } + { const a: Decimal = d.neg(); } + + { const a: Decimal = d.plus(1); } + { const a: Decimal = d.plus("1"); } + { const a: Decimal = d.plus(d); } + { const a: Decimal = d.add(1); } + { const a: Decimal = d.add("1"); } + { const a: Decimal = d.add(d); } + + { const a: number = d.precision(); } + { const a: number = d.precision(true); } + { const a: number = d.sd(); } + { const a: number = d.sd(true); } + + { const a: Decimal = d.round(); } + + { const a: Decimal = d.sine(); } + { const a: Decimal = d.sin(); } + + { const a: Decimal = d.squareRoot(); } + { const a: Decimal = d.sqrt(); } + + { const a: Decimal = d.tangent(); } + { const a: Decimal = d.tan(); } + + { const a: Decimal = d.times(1); } + { const a: Decimal = d.times("1"); } + { const a: Decimal = d.times(d); } + { const a: Decimal = d.mul(1); } + { const a: Decimal = d.mul("1"); } + { const a: Decimal = d.mul(d); } + + { const a: string = d.toBinary(); } + { const a: string = d.toBinary(1); } + { const a: string = d.toBinary(1, 1); } + + { const a: Decimal = d.toDecimalPlaces(); } + { const a: Decimal = d.toDecimalPlaces(1); } + { const a: Decimal = d.toDecimalPlaces(1, 1); } + { const a: Decimal = d.toDP(); } + { const a: Decimal = d.toDP(1); } + { const a: Decimal = d.toDP(1, 1); } + + { const a: string = d.toExponential(); } + { const a: string = d.toExponential(1); } + { const a: string = d.toExponential(1, 1); } + + { const a: string = d.toFixed(); } + { const a: string = d.toFixed(1); } + { const a: string = d.toFixed(1, 1); } + + { const a: Decimal[] = d.toFraction(); } + { const a: Decimal[] = d.toFraction(1); } + { const a: Decimal[] = d.toFraction("1"); } + { const a: Decimal[] = d.toFraction(d); } + + { const a: string = d.toHexadecimal(); } + { const a: string = d.toHexadecimal(1); } + { const a: string = d.toHexadecimal(1, 1); } + { const a: string = d.toHex(); } + { const a: string = d.toHex(1); } + { const a: string = d.toHex(1, 1); } + + { const a: string = d.toJSON(); } + + { const a: Decimal = d.toNearest(); } + { const a: Decimal = d.toNearest(1); } + { const a: Decimal = d.toNearest("1"); } + { const a: Decimal = d.toNearest(d); } + { const a: Decimal = d.toNearest(d, 1); } + + { const a: number = d.toNumber(); } + + { const a: string = d.toOctal(); } + { const a: string = d.toOctal(1); } + { const a: string = d.toOctal(1, 1); } + + { const a: Decimal = d.toPower(1); } + { const a: Decimal = d.toPower("1"); } + { const a: Decimal = d.toPower(d); } + { const a: Decimal = d.pow(1); } + { const a: Decimal = d.pow("1"); } + { const a: Decimal = d.pow(d); } + + { const a: string = d.toPrecision(); } + { const a: string = d.toPrecision(1); } + { const a: string = d.toPrecision(1, 1); } + + { const a: Decimal = d.toSignificantDigits(); } + { const a: Decimal = d.toSignificantDigits(1); } + { const a: Decimal = d.toSignificantDigits(1, 1); } + { const a: Decimal = d.toSD(); } + { const a: Decimal = d.toSD(1); } + { const a: Decimal = d.toSD(1, 1); } + + { const a: string = d.toString(); } + + { const a: Decimal = d.truncated(); } + { const a: Decimal = d.trunc(); } + + { const a: string = d.valueOf(); } + + { const a: Decimal = Decimal.abs(1); } + { const a: Decimal = Decimal.abs("1"); } + { const a: Decimal = Decimal.abs(d); } + + { const a: Decimal = Decimal.acos(1); } + { const a: Decimal = Decimal.acos("1"); } + { const a: Decimal = Decimal.acos(d); } + + { const a: Decimal = Decimal.acosh(1); } + { const a: Decimal = Decimal.acosh("1"); } + { const a: Decimal = Decimal.acosh(d); } + + { const a: Decimal = Decimal.asin(1); } + { const a: Decimal = Decimal.asin("1"); } + { const a: Decimal = Decimal.asin(d); } + + { const a: Decimal = Decimal.asinh(1); } + { const a: Decimal = Decimal.asinh("1"); } + { const a: Decimal = Decimal.asinh(d); } + + { const a: Decimal = Decimal.atan(1); } + { const a: Decimal = Decimal.atan("1"); } + { const a: Decimal = Decimal.atan(d); } + + { const a: Decimal = Decimal.atan2(1, 1); } + { const a: Decimal = Decimal.atan2("1", "1"); } + { const a: Decimal = Decimal.atan2(d, d); } + + { const a: Decimal = Decimal.cbrt(1); } + { const a: Decimal = Decimal.cbrt("1"); } + { const a: Decimal = Decimal.cbrt(d); } + + { const a: typeof Decimal = Decimal.clone({}); } + { const a: typeof Decimal = Decimal.clone({ crypto: true }); } + { const a: typeof Decimal = Decimal.clone({ defaults: true }); } + { const a: typeof Decimal = Decimal.clone({ maxE: 1 }); } + { const a: typeof Decimal = Decimal.clone({ minE: 1 }); } + { const a: typeof Decimal = Decimal.clone({ modulo: 1 }); } + { const a: typeof Decimal = Decimal.clone({ precision: 1 }); } + { const a: typeof Decimal = Decimal.clone({ rounding: 1 }); } + { const a: typeof Decimal = Decimal.clone({ toExpNeg: 1 }); } + { const a: typeof Decimal = Decimal.clone({ toExpPos: 1 }); } + { const a: typeof Decimal = Decimal.clone({}); } + + { const a: typeof Decimal = Decimal.config({ crypto: true }); } + { const a: typeof Decimal = Decimal.config({ defaults: true }); } + { const a: typeof Decimal = Decimal.config({ maxE: 1 }); } + { const a: typeof Decimal = Decimal.config({ minE: 1 }); } + { const a: typeof Decimal = Decimal.config({ modulo: 1 }); } + { const a: typeof Decimal = Decimal.config({ precision: 1 }); } + { const a: typeof Decimal = Decimal.config({ rounding: 1 }); } + { const a: typeof Decimal = Decimal.config({ toExpNeg: 1 }); } + { const a: typeof Decimal = Decimal.config({ toExpPos: 1 }); } + + { const a: typeof Decimal = Decimal.set({ crypto: true }); } + { const a: typeof Decimal = Decimal.set({ defaults: true }); } + { const a: typeof Decimal = Decimal.set({ maxE: 1 }); } + { const a: typeof Decimal = Decimal.set({ minE: 1 }); } + { const a: typeof Decimal = Decimal.set({ modulo: 1 }); } + { const a: typeof Decimal = Decimal.set({ precision: 1 }); } + { const a: typeof Decimal = Decimal.set({ rounding: 1 }); } + { const a: typeof Decimal = Decimal.set({ toExpNeg: 1 }); } + { const a: typeof Decimal = Decimal.set({ toExpPos: 1 }); } + + { const a: Decimal = Decimal.cos(1); } + { const a: Decimal = Decimal.cos("1"); } + { const a: Decimal = Decimal.cos(d); } + + { const a: Decimal = Decimal.div(1, 1); } + { const a: Decimal = Decimal.div("1", "1"); } + { const a: Decimal = Decimal.div(d, d); } + + { const a: Decimal = Decimal.exp(1); } + { const a: Decimal = Decimal.exp("1"); } + { const a: Decimal = Decimal.exp(d); } + + { const a: Decimal = Decimal.floor(1); } + { const a: Decimal = Decimal.floor("1"); } + { const a: Decimal = Decimal.floor(d); } + + { const a: Decimal = Decimal.hypot(1); } + { const a: Decimal = Decimal.hypot("1"); } + { const a: Decimal = Decimal.hypot(d); } + { const a: Decimal = Decimal.hypot(1, 1); } + { const a: Decimal = Decimal.hypot("1", "1"); } + { const a: Decimal = Decimal.hypot(d, d); } + { const a: Decimal = Decimal.hypot(1, 1, 1); } + { const a: Decimal = Decimal.hypot("1", "1", "1"); } + { const a: Decimal = Decimal.hypot(d, d, d); } + { const a: Decimal = Decimal.hypot(1, 1, 1, 1, 1, 1, 1, 1, 1, d, 1, 1, 1, "1", d); } + + { const a: boolean = Decimal.isDecimal(d); } + + { const a: Decimal = Decimal.ln(1); } + { const a: Decimal = Decimal.ln("1"); } + { const a: Decimal = Decimal.ln(d); } + + { const a: Decimal = Decimal.log(1); } + { const a: Decimal = Decimal.log("1"); } + { const a: Decimal = Decimal.log(d); } + { const a: Decimal = Decimal.log(1, 2); } + { const a: Decimal = Decimal.log("1", 2); } + { const a: Decimal = Decimal.log(d, 2); } + + { const a: Decimal = Decimal.log2(1); } + { const a: Decimal = Decimal.log2("1"); } + { const a: Decimal = Decimal.log2(d); } + + { const a: Decimal = Decimal.log10(1); } + { const a: Decimal = Decimal.log10("1"); } + { const a: Decimal = Decimal.log10(d); } + + { const a: Decimal = Decimal.min(1, "1", 1, d); } + + { const a: Decimal = Decimal.max(1, "1", 1, d); } + + { const a: Decimal = Decimal.mul(1, 1); } + { const a: Decimal = Decimal.mul("1", "1"); } + { const a: Decimal = Decimal.mul(d, d); } + + { const a: Decimal = Decimal.pow(1, 1); } + { const a: Decimal = Decimal.pow("1", "1"); } + { const a: Decimal = Decimal.pow(d, d); } + + { const a: Decimal = Decimal.random(); } + { const a: Decimal = Decimal.random(1); } + + { const a: Decimal = Decimal.round(1); } + { const a: Decimal = Decimal.round("1"); } + { const a: Decimal = Decimal.round(d); } + + { const a: Decimal = Decimal.sign(1); } + { const a: Decimal = Decimal.sign("1"); } + { const a: Decimal = Decimal.sign(d); } + + { const a: Decimal = Decimal.sin(1); } + { const a: Decimal = Decimal.sin("1"); } + { const a: Decimal = Decimal.sin(d); } + + { const a: Decimal = Decimal.sinh(1); } + { const a: Decimal = Decimal.sinh("1"); } + { const a: Decimal = Decimal.sinh(d); } + + { const a: Decimal = Decimal.sqrt(1); } + { const a: Decimal = Decimal.sqrt("1"); } + { const a: Decimal = Decimal.sqrt(d); } + + { const a: Decimal = Decimal.sub(1, 1); } + { const a: Decimal = Decimal.sub("1", "1"); } + { const a: Decimal = Decimal.sub(d, d); } + + { const a: Decimal = Decimal.tan(1); } + { const a: Decimal = Decimal.tan("1"); } + { const a: Decimal = Decimal.tan(d); } + + { const a: Decimal = Decimal.tanh(1); } + { const a: Decimal = Decimal.tanh("1"); } + { const a: Decimal = Decimal.tanh(d); } + + { const a: Decimal = Decimal.trunc(1); } + { const a: Decimal = Decimal.trunc("1"); } + { const a: Decimal = Decimal.trunc(d); } + + { const a: number = Decimal.precision; } + { const a: number = Decimal.rounding; } + { const a: number = Decimal.toExpNeg; } + { const a: number = Decimal.minE; } + { const a: boolean = Decimal.crypto; } + { const a: number = Decimal.modulo; } + { const a: number = Decimal.ROUND_UP; } + { const a: number = Decimal.ROUND_DOWN; } + { const a: number = Decimal.ROUND_CEIL; } + { const a: number = Decimal.ROUND_FLOOR; } + { const a: number = Decimal.ROUND_HALF_UP; } + { const a: number = Decimal.ROUND_HALF_DOWN; } + { const a: number = Decimal.ROUND_HALF_EVEN; } + { const a: number = Decimal.ROUND_HALF_CEIL; } + { const a: number = Decimal.ROUND_HALF_FLOOR; } + { const a: number = Decimal.EUCLID; } +} diff --git a/types/adone/test/glosses/math/index.ts b/types/adone/test/glosses/math/index.ts index 928977fad9..d85c08bdef 100644 --- a/types/adone/test/glosses/math/index.ts +++ b/types/adone/test/glosses/math/index.ts @@ -1,469 +1,7 @@ namespace mathTests { - const { math } = adone; - - namespace LongTests { - new math.Long(); - new math.Long(0); - new math.Long(0, 0); - new math.Long(0, 0, true); - - namespace toInt { - const a: number = new math.Long().toInt(); - } - - namespace toNumber { - const a: number = new math.Long().toNumber(); - } - - namespace toString { - const a: string = new math.Long().toString(); - const b: string = new math.Long().toString(16); - } - - namespace getHighBits { - const a: number = new math.Long().getHighBits(); - } - - namespace getLowBits { - const a: number = new math.Long().getLowBits(); - } - - namespace getLowBitsUnsigned { - const a: number = new math.Long().getLowBitsUnsigned(); - } - - namespace getHighBitsUnsigned { - const a: number = new math.Long().getHighBitsUnsigned(); - } - - namespace getNumBitsAbs { - const a: number = new math.Long().getNumBitsAbs(); - } - - namespace isZero { - const a: boolean = new math.Long().isZero(); - } - - namespace isNegative { - const a: boolean = new math.Long().isNegative(); - } - - namespace isPositive { - const a: boolean = new math.Long().isPositive(); - } - - namespace isOdd { - const a: boolean = new math.Long().isOdd(); - } - - namespace isEven { - const a: boolean = new math.Long().isEven(); - } - - namespace equals { - const a = new math.Long(); - const b: boolean = a.equals(new math.Long()); - const c: boolean = a.equals(1); - const d: boolean = a.equals("1"); - const e: boolean = a.equals({ low: 0, high: 0 }); - } - - namespace lessThan { - const a = new math.Long(); - const b: boolean = a.lessThan(new math.Long()); - const c: boolean = a.lessThan(1); - const d: boolean = a.lessThan("1"); - const e: boolean = a.lessThan({ low: 0, high: 0 }); - } - - namespace lessThanOrEqual { - const a = new math.Long(); - const b: boolean = a.lessThanOrEqual(new math.Long()); - const c: boolean = a.lessThanOrEqual(1); - const d: boolean = a.lessThanOrEqual("1"); - const e: boolean = a.lessThanOrEqual({ low: 0, high: 0 }); - } - - namespace greaterThan { - const a = new math.Long(); - const b: boolean = a.greaterThan(new math.Long()); - const c: boolean = a.greaterThan(1); - const d: boolean = a.greaterThan("1"); - const e: boolean = a.greaterThan({ low: 0, high: 0 }); - } - - namespace greaterThanOrEqual { - const a = new math.Long(); - const b: boolean = a.greaterThanOrEqual(new math.Long()); - const c: boolean = a.greaterThanOrEqual(1); - const d: boolean = a.greaterThanOrEqual("1"); - const e: boolean = a.greaterThanOrEqual({ low: 0, high: 0 }); - } - - namespace compareTests { - const a = new math.Long(); - const b: number = a.compare(new math.Long()); - const c: number = a.compare(1); - const d: number = a.compare("1"); - const e: number = a.compare({ low: 0, high: 0 }); - } - - namespace negate { - const a: adone.math.Long = new math.Long().negate(); - } - - namespace add { - const a = new math.Long(); - const b: adone.math.Long = a.add(new math.Long()); - const c: adone.math.Long = a.add(1); - const d: adone.math.Long = a.add("1"); - const e: adone.math.Long = a.add({ low: 0, high: 0 }); - } - - namespace sub { - const a = new math.Long(); - const b: adone.math.Long = a.sub(new math.Long()); - const c: adone.math.Long = a.sub(1); - const d: adone.math.Long = a.sub("1"); - const e: adone.math.Long = a.sub({ low: 0, high: 0 }); - } - - namespace mul { - const a = new math.Long(); - const b: adone.math.Long = a.mul(new math.Long()); - const c: adone.math.Long = a.mul(1); - const d: adone.math.Long = a.mul("1"); - const e: adone.math.Long = a.mul({ low: 0, high: 0 }); - } - - namespace div { - const a = new math.Long(); - const b: adone.math.Long = a.div(new math.Long()); - const c: adone.math.Long = a.div(1); - const d: adone.math.Long = a.div("1"); - const e: adone.math.Long = a.div({ low: 0, high: 0 }); - } - - namespace mod { - const a = new math.Long(); - const b: adone.math.Long = a.mod(new math.Long()); - const c: adone.math.Long = a.mod(1); - const d: adone.math.Long = a.mod("1"); - const e: adone.math.Long = a.mod({ low: 0, high: 0 }); - } - - namespace not { - const a: adone.math.Long = new math.Long().not(); - } - - namespace and { - const a = new math.Long(); - const b: adone.math.Long = a.and(new math.Long()); - const c: adone.math.Long = a.and(1); - const d: adone.math.Long = a.and("1"); - const e: adone.math.Long = a.and({ low: 0, high: 0 }); - } - - namespace or { - const a = new math.Long(); - const b: adone.math.Long = a.or(new math.Long()); - const c: adone.math.Long = a.or(1); - const d: adone.math.Long = a.or("1"); - const e: adone.math.Long = a.or({ low: 0, high: 0 }); - } - - namespace xor { - const a = new math.Long(); - const b: adone.math.Long = a.xor(new math.Long()); - const c: adone.math.Long = a.xor(1); - const d: adone.math.Long = a.xor("1"); - const e: adone.math.Long = a.xor({ low: 0, high: 0 }); - } - - namespace shl { - const a = new math.Long(); - const b: adone.math.Long = a.shl(new math.Long()); - const c: adone.math.Long = a.shl(1); - } - - namespace shr { - const a = new math.Long(); - const b: adone.math.Long = a.shr(new math.Long()); - const c: adone.math.Long = a.shr(1); - } - - namespace shru { - const a = new math.Long(); - const b: adone.math.Long = a.shr(new math.Long()); - const c: adone.math.Long = a.shr(1); - } - - namespace toSigned { - const a: adone.math.Long = new math.Long().toSigned(); - } - - namespace toUnsigned { - const a: adone.math.Long = new math.Long().toUnsigned(); - } - - namespace toBytes { - const a: number[] = new math.Long().toBytes(); - } - - namespace toBytesLE { - const a: number[] = new math.Long().toBytesLE(); - } - - namespace static { - namespace fromInt { - const a: adone.math.Long = math.Long.fromInt(123); - const b: adone.math.Long = math.Long.fromInt(123, true); - } - - namespace fromNumber { - const a: adone.math.Long = math.Long.fromNumber(123); - const b: adone.math.Long = math.Long.fromNumber(123, true); - } - - namespace fromBits { - const a: adone.math.Long = math.Long.fromBits(0, 0); - const b: adone.math.Long = math.Long.fromBits(123, 0, true); - } - - namespace fromString { - const a: adone.math.Long = math.Long.fromString("123"); - const b: adone.math.Long = math.Long.fromString("123", true); - const c: adone.math.Long = math.Long.fromString("123", 16); - const d: adone.math.Long = math.Long.fromString("123", true, 16); - } - - namespace fromValue { - const a: adone.math.Long = math.Long.fromValue(new math.Long()); - const b: adone.math.Long = math.Long.fromValue(1); - const c: adone.math.Long = math.Long.fromValue("1"); - const e: adone.math.Long = math.Long.fromValue({ low: 0, high: 0 }); - } - - namespace constants { - const a: adone.math.Long = math.Long.MIN_VALUE; - const b: adone.math.Long = math.Long.MAX_VALUE; - const c: adone.math.Long = math.Long.MAX_UNSIGNED_VALUE; - const d: adone.math.Long = math.Long.ZERO; - const e: adone.math.Long = math.Long.UZERO; - const f: adone.math.Long = math.Long.ONE; - const g: adone.math.Long = math.Long.UONE; - const h: adone.math.Long = math.Long.NEG_ONE; - } - } - } - - namespace BigNumberTests { - const { BigNumber } = math; - type BigNumber = adone.math.BigNumber; - - new BigNumber(10); - new BigNumber("10"); - new BigNumber(new BigNumber(10)); - new BigNumber("10", 2); - - { const a: string = new BigNumber(1).toString(); } - { const a: string = new BigNumber(1).toString(2); } - - { const a: number = new BigNumber(1).toNumber(); } - - { const a: Buffer = new BigNumber(1).toBuffer(); } - { const a: Buffer = new BigNumber(1).toBuffer({}); } - { const a: Buffer = new BigNumber(1).toBuffer({ endian: 1 }); } - { const a: Buffer = new BigNumber(1).toBuffer({ endian: -1 }); } - { const a: Buffer = new BigNumber(1).toBuffer({ endian: "big" }); } - { const a: Buffer = new BigNumber(1).toBuffer({ endian: "little" }); } - { const a: Buffer = new BigNumber(1).toBuffer({ size: 1 }); } - { const a: Buffer = new BigNumber(1).toBuffer({ size: "auto" }); } - - { const a: BigNumber = new BigNumber(10).add(1); } - { const a: BigNumber = new BigNumber(10).add("1"); } - { const a: BigNumber = new BigNumber(10).add(new BigNumber(1)); } - - { const a: BigNumber = new BigNumber(10).sub(1); } - { const a: BigNumber = new BigNumber(10).sub("1"); } - { const a: BigNumber = new BigNumber(10).sub(new BigNumber(1)); } - - { const a: BigNumber = new BigNumber(10).mul(1); } - { const a: BigNumber = new BigNumber(10).mul("1"); } - { const a: BigNumber = new BigNumber(10).mul(new BigNumber(1)); } - - { const a: BigNumber = new BigNumber(10).div(1); } - { const a: BigNumber = new BigNumber(10).div("1"); } - { const a: BigNumber = new BigNumber(10).div(new BigNumber(1)); } - - { const a: BigNumber = new BigNumber(10).abs(); } - - { const a: BigNumber = new BigNumber(10).neg(); } - - { const a: number = new BigNumber(10).cmp(1); } - { const a: number = new BigNumber(10).cmp("1"); } - { const a: number = new BigNumber(10).cmp(new BigNumber(1)); } - - { const a: boolean = new BigNumber(10).gt(1); } - { const a: boolean = new BigNumber(10).gt("1"); } - { const a: boolean = new BigNumber(10).gt(new BigNumber(10)); } - - { const a: boolean = new BigNumber(10).ge(1); } - { const a: boolean = new BigNumber(10).ge("1"); } - { const a: boolean = new BigNumber(10).ge(new BigNumber(10)); } - - { const a: boolean = new BigNumber(10).eq(1); } - { const a: boolean = new BigNumber(10).eq("1"); } - { const a: boolean = new BigNumber(10).eq(new BigNumber(10)); } - - { const a: boolean = new BigNumber(10).lt(1); } - { const a: boolean = new BigNumber(10).lt("1"); } - { const a: boolean = new BigNumber(10).lt(new BigNumber(10)); } - - { const a: boolean = new BigNumber(10).le(1); } - { const a: boolean = new BigNumber(10).le("1"); } - { const a: boolean = new BigNumber(10).le(new BigNumber(10)); } - - { const a: BigNumber = new BigNumber(10).and(1); } - { const a: BigNumber = new BigNumber(10).and("1"); } - { const a: BigNumber = new BigNumber(10).and(new BigNumber(1)); } - - { const a: BigNumber = new BigNumber(10).or(1); } - { const a: BigNumber = new BigNumber(10).or("1"); } - { const a: BigNumber = new BigNumber(10).or(new BigNumber(1)); } - - { const a: BigNumber = new BigNumber(10).xor(1); } - { const a: BigNumber = new BigNumber(10).xor("1"); } - { const a: BigNumber = new BigNumber(10).xor(new BigNumber(1)); } - - { const a: BigNumber = new BigNumber(10).mod(1); } - { const a: BigNumber = new BigNumber(10).mod("1"); } - { const a: BigNumber = new BigNumber(10).mod(new BigNumber(1)); } - - { const a: BigNumber = new BigNumber(10).pow(1); } - { const a: BigNumber = new BigNumber(10).pow("1"); } - { const a: BigNumber = new BigNumber(10).pow(new BigNumber(1)); } - - { const a: BigNumber = new BigNumber(10).powm(1, 1); } - { const a: BigNumber = new BigNumber(10).powm("1", 1); } - { const a: BigNumber = new BigNumber(10).powm(new BigNumber(1), 1); } - { const a: BigNumber = new BigNumber(10).powm(1, "1"); } - { const a: BigNumber = new BigNumber(10).powm("1", "1"); } - { const a: BigNumber = new BigNumber(10).powm(new BigNumber(1), "1"); } - { const a: BigNumber = new BigNumber(10).powm(1, new BigNumber(1)); } - { const a: BigNumber = new BigNumber(10).powm("1", new BigNumber(1)); } - { const a: BigNumber = new BigNumber(10).powm(new BigNumber(1), new BigNumber(1)); } - - { const a: BigNumber = new BigNumber(10).invertm(1); } - { const a: BigNumber = new BigNumber(10).invertm("1"); } - { const a: BigNumber = new BigNumber(10).invertm(new BigNumber(1)); } - - { const a: BigNumber = new BigNumber(10).rand(); } - { const a: BigNumber = new BigNumber(10).rand(1); } - { const a: BigNumber = new BigNumber(10).rand("1"); } - { const a: BigNumber = new BigNumber(10).rand(new BigNumber(1)); } - - { const a: boolean | "maybe" = new BigNumber(10).probPrime(); } - - { const a: BigNumber = new BigNumber(10).nextPrime(); } - - { const a: BigNumber = new BigNumber(10).sqrt(); } - - { const a: BigNumber = new BigNumber(10).root(1); } - { const a: BigNumber = new BigNumber(10).root("1"); } - { const a: BigNumber = new BigNumber(10).root(new BigNumber(1)); } - - { const a: BigNumber = new BigNumber(10).shiftLeft(1); } - { const a: BigNumber = new BigNumber(10).shiftLeft("1"); } - { const a: BigNumber = new BigNumber(10).shiftLeft(new BigNumber(1)); } - - { const a: BigNumber = new BigNumber(10).shiftRight(1); } - { const a: BigNumber = new BigNumber(10).shiftRight("1"); } - { const a: BigNumber = new BigNumber(10).shiftRight(new BigNumber(1)); } - - { const a: BigNumber = new BigNumber(10).gcd(1); } - { const a: BigNumber = new BigNumber(10).gcd("1"); } - { const a: BigNumber = new BigNumber(10).gcd(new BigNumber(1)); } - - { const a: number = new BigNumber(10).jacobi(1); } - { const a: number = new BigNumber(10).jacobi("1"); } - { const a: number = new BigNumber(10).jacobi(new BigNumber(1)); } - - { const a: number = new BigNumber(10).bitLength(); } - - { const a: boolean = new BigNumber(10).isBitSet(10); } - - { const a: BigNumber = BigNumber.prime(10); } - { const a: BigNumber = BigNumber.prime(10, true); } - - { const a: BigNumber = BigNumber.fromBuffer(Buffer.alloc(10)); } - { const a: BigNumber = BigNumber.fromBuffer(Buffer.alloc(10), { endian: "little" }); } - { const a: BigNumber = BigNumber.fromBuffer(Buffer.alloc(10), { endian: -1 }); } - { const a: BigNumber = BigNumber.fromBuffer(Buffer.alloc(10), { endian: 1 }); } - { const a: BigNumber = BigNumber.fromBuffer(Buffer.alloc(10), { endian: "big" }); } - { const a: BigNumber = BigNumber.fromBuffer(Buffer.alloc(10), { size: "auto" }); } - - { const a: BigNumber = BigNumber.ONE; } - { const a: BigNumber = BigNumber.ZERO; } - } - - namespace bitSetTests { - const { BitSet } = math; - type BitSet = adone.math.BitSet; - - new BitSet(10); - new BitSet(new BitSet(10).dehydrate()); - - { const a: boolean = new BitSet(10).get(0); } - { const a: boolean = new BitSet(10).set(0); } - { const a: boolean = new BitSet(10).setRange(0, 10); } - { const a: boolean = new BitSet(10).unset(0); } - { const a: boolean = new BitSet(10).unsetRange(0, 10); } - { const a: boolean = new BitSet(10).toggle(0); } - { const a: boolean = new BitSet(10).toggleRange(0, 10); } - { const a: boolean = new BitSet(10).clear(); } - { const a: BitSet = new BitSet(10).clone(); } - { const a: string = new BitSet(10).dehydrate(); } - - { const a: BitSet = new BitSet(10).and(1); } - { const a: BitSet = new BitSet(10).and(new BitSet(10)); } - - { const a: BitSet = new BitSet(10).or(1); } - { const a: BitSet = new BitSet(10).or(new BitSet(10)); } - - { const a: BitSet = new BitSet(10).xor(1); } - { const a: BitSet = new BitSet(10).xor(new BitSet(10)); } - - new BitSet(10).forEach((x: number) => {}); - new BitSet(10).forEach((x: number) => false); - - { const a: BitSet = new BitSet(10).circularShift(10); } - { const a: number = new BitSet(10).getCardinality(); } - { const a: number[] = new BitSet(10).getIndices(); } - { const a: boolean = new BitSet(10).isSubsetOf(new BitSet(10)); } - { const a: boolean = new BitSet(10).isEmpty(); } - { const a: boolean = new BitSet(10).isEqual(new BitSet(10)); } - { const a: string = new BitSet(10).toString(); } - { const a: number = new BitSet(10).ffs(); } - { const a: number = new BitSet(10).ffs(1); } - { const a: number = new BitSet(10).ffz(); } - { const a: number = new BitSet(10).ffz(1); } - { const a: number = new BitSet(10).fls(); } - { const a: number = new BitSet(10).fls(1); } - { const a: number = new BitSet(10).flz(); } - { const a: number = new BitSet(10).flz(1); } - { const a: number = new BitSet(10).nextSetBit(1); } - { const a: number = new BitSet(10).nextUnsetBit(1); } - { const a: number = new BitSet(10).previousSetBit(1); } - { const a: number = new BitSet(10).previousUnsetBit(1); } - { const a: number = new BitSet(10).readUInt(); } - { const a: number = new BitSet(10).readUInt(1); } - { const a: number = new BitSet(10).readUInt(1, 2); } - { new BitSet(10).writeUInt(1); } - { new BitSet(10).writeUInt(1, 2); } - { new BitSet(10).writeUInt(1, 2, 3); } - { const a: BitSet = BitSet.fromLong(new adone.math.Long(10, 20)); } - } + const { + math + } = adone; namespace randomTests { const { random } = math; @@ -471,4 +9,22 @@ namespace mathTests { random(100); random(0, 10); } + + namespace maxTests { + const { max } = math; + max([]); + { const a: number = max([1, 2, 3]); } + { const a: string = max(["1", "2", "3"]); } + { const a: string = max(["1", "2", "3"], (a) => a.length); } + { const a: number = max([1, 2, 3], (a) => a.toExponential()); } + } + + namespace minTests { + const { min } = math; + min([]); + { const a: number = min([1, 2, 3]); } + { const a: string = min(["1", "2", "3"]); } + { const a: string = min(["1", "2", "3"], (a) => a.length); } + { const a: number = min([1, 2, 3], (a) => a.toExponential()); } + } } diff --git a/types/adone/test/glosses/math/long.ts b/types/adone/test/glosses/math/long.ts new file mode 100644 index 0000000000..f0dfa0b7ec --- /dev/null +++ b/types/adone/test/glosses/math/long.ts @@ -0,0 +1,261 @@ +namespace mathTests.longTests { + const { + math: { + Long + } + } = adone; + + new Long(); + new Long(0); + new Long(0, 0); + new Long(0, 0, true); + + namespace toInt { + const a: number = new Long().toInt(); + } + + namespace toNumber { + const a: number = new Long().toNumber(); + } + + namespace toString { + const a: string = new Long().toString(); + const b: string = new Long().toString(16); + } + + namespace getHighBits { + const a: number = new Long().getHighBits(); + } + + namespace getLowBits { + const a: number = new Long().getLowBits(); + } + + namespace getLowBitsUnsigned { + const a: number = new Long().getLowBitsUnsigned(); + } + + namespace getHighBitsUnsigned { + const a: number = new Long().getHighBitsUnsigned(); + } + + namespace getNumBitsAbs { + const a: number = new Long().getNumBitsAbs(); + } + + namespace isZero { + const a: boolean = new Long().isZero(); + } + + namespace isNegative { + const a: boolean = new Long().isNegative(); + } + + namespace isPositive { + const a: boolean = new Long().isPositive(); + } + + namespace isOdd { + const a: boolean = new Long().isOdd(); + } + + namespace isEven { + const a: boolean = new Long().isEven(); + } + + namespace equals { + const a = new Long(); + const b: boolean = a.equals(new Long()); + const c: boolean = a.equals(1); + const d: boolean = a.equals("1"); + const e: boolean = a.equals({ low: 0, high: 0 }); + } + + namespace lessThan { + const a = new Long(); + const b: boolean = a.lessThan(new Long()); + const c: boolean = a.lessThan(1); + const d: boolean = a.lessThan("1"); + const e: boolean = a.lessThan({ low: 0, high: 0 }); + } + + namespace lessThanOrEqual { + const a = new Long(); + const b: boolean = a.lessThanOrEqual(new Long()); + const c: boolean = a.lessThanOrEqual(1); + const d: boolean = a.lessThanOrEqual("1"); + const e: boolean = a.lessThanOrEqual({ low: 0, high: 0 }); + } + + namespace greaterThan { + const a = new Long(); + const b: boolean = a.greaterThan(new Long()); + const c: boolean = a.greaterThan(1); + const d: boolean = a.greaterThan("1"); + const e: boolean = a.greaterThan({ low: 0, high: 0 }); + } + + namespace greaterThanOrEqual { + const a = new Long(); + const b: boolean = a.greaterThanOrEqual(new Long()); + const c: boolean = a.greaterThanOrEqual(1); + const d: boolean = a.greaterThanOrEqual("1"); + const e: boolean = a.greaterThanOrEqual({ low: 0, high: 0 }); + } + + namespace compareTests { + const a = new Long(); + const b: number = a.compare(new Long()); + const c: number = a.compare(1); + const d: number = a.compare("1"); + const e: number = a.compare({ low: 0, high: 0 }); + } + + namespace negate { + const a: adone.math.Long = new Long().negate(); + } + + namespace add { + const a = new Long(); + const b: adone.math.Long = a.add(new Long()); + const c: adone.math.Long = a.add(1); + const d: adone.math.Long = a.add("1"); + const e: adone.math.Long = a.add({ low: 0, high: 0 }); + } + + namespace sub { + const a = new Long(); + const b: adone.math.Long = a.sub(new Long()); + const c: adone.math.Long = a.sub(1); + const d: adone.math.Long = a.sub("1"); + const e: adone.math.Long = a.sub({ low: 0, high: 0 }); + } + + namespace mul { + const a = new Long(); + const b: adone.math.Long = a.mul(new Long()); + const c: adone.math.Long = a.mul(1); + const d: adone.math.Long = a.mul("1"); + const e: adone.math.Long = a.mul({ low: 0, high: 0 }); + } + + namespace div { + const a = new Long(); + const b: adone.math.Long = a.div(new Long()); + const c: adone.math.Long = a.div(1); + const d: adone.math.Long = a.div("1"); + const e: adone.math.Long = a.div({ low: 0, high: 0 }); + } + + namespace mod { + const a = new Long(); + const b: adone.math.Long = a.mod(new Long()); + const c: adone.math.Long = a.mod(1); + const d: adone.math.Long = a.mod("1"); + const e: adone.math.Long = a.mod({ low: 0, high: 0 }); + } + + namespace not { + const a: adone.math.Long = new Long().not(); + } + + namespace and { + const a = new Long(); + const b: adone.math.Long = a.and(new Long()); + const c: adone.math.Long = a.and(1); + const d: adone.math.Long = a.and("1"); + const e: adone.math.Long = a.and({ low: 0, high: 0 }); + } + + namespace or { + const a = new Long(); + const b: adone.math.Long = a.or(new Long()); + const c: adone.math.Long = a.or(1); + const d: adone.math.Long = a.or("1"); + const e: adone.math.Long = a.or({ low: 0, high: 0 }); + } + + namespace xor { + const a = new Long(); + const b: adone.math.Long = a.xor(new Long()); + const c: adone.math.Long = a.xor(1); + const d: adone.math.Long = a.xor("1"); + const e: adone.math.Long = a.xor({ low: 0, high: 0 }); + } + + namespace shl { + const a = new Long(); + const b: adone.math.Long = a.shl(new Long()); + const c: adone.math.Long = a.shl(1); + } + + namespace shr { + const a = new Long(); + const b: adone.math.Long = a.shr(new Long()); + const c: adone.math.Long = a.shr(1); + } + + namespace shru { + const a = new Long(); + const b: adone.math.Long = a.shr(new Long()); + const c: adone.math.Long = a.shr(1); + } + + namespace toSigned { + const a: adone.math.Long = new Long().toSigned(); + } + + namespace toUnsigned { + const a: adone.math.Long = new Long().toUnsigned(); + } + + namespace toBytes { + const a: number[] = new Long().toBytes(); + } + + namespace toBytesLE { + const a: number[] = new Long().toBytesLE(); + } + + namespace static { + namespace fromInt { + const a: adone.math.Long = Long.fromInt(123); + const b: adone.math.Long = Long.fromInt(123, true); + } + + namespace fromNumber { + const a: adone.math.Long = Long.fromNumber(123); + const b: adone.math.Long = Long.fromNumber(123, true); + } + + namespace fromBits { + const a: adone.math.Long = Long.fromBits(0, 0); + const b: adone.math.Long = Long.fromBits(123, 0, true); + } + + namespace fromString { + const a: adone.math.Long = Long.fromString("123"); + const b: adone.math.Long = Long.fromString("123", true); + const c: adone.math.Long = Long.fromString("123", 16); + const d: adone.math.Long = Long.fromString("123", true, 16); + } + + namespace fromValue { + const a: adone.math.Long = Long.fromValue(new Long()); + const b: adone.math.Long = Long.fromValue(1); + const c: adone.math.Long = Long.fromValue("1"); + const e: adone.math.Long = Long.fromValue({ low: 0, high: 0 }); + } + + namespace constants { + const a: adone.math.Long = Long.MIN_VALUE; + const b: adone.math.Long = Long.MAX_VALUE; + const c: adone.math.Long = Long.MAX_UNSIGNED_VALUE; + const d: adone.math.Long = Long.ZERO; + const e: adone.math.Long = Long.UZERO; + const f: adone.math.Long = Long.ONE; + const g: adone.math.Long = Long.UONE; + const h: adone.math.Long = Long.NEG_ONE; + } + } +} diff --git a/types/adone/test/glosses/regex.ts b/types/adone/test/glosses/regex.ts index 7aab1e0d8d..2acf6cc24e 100644 --- a/types/adone/test/glosses/regex.ts +++ b/types/adone/test/glosses/regex.ts @@ -7,7 +7,11 @@ namespace adoneTests.regex { regex.filename().test("a"); regex.idn().test("a"); regex.ip4().test("a"); + regex.ip4({ exact: true }).test("a"); regex.ip6().test("a"); + regex.ip6({ exact: true }).test("a"); + regex.ip().test("a"); + regex.ip({ exact: true }).test("a"); regex.protocol().test("a"); regex.punycode().test("a"); regex.shebang().test("a"); diff --git a/types/adone/test/index.ts b/types/adone/test/index.ts index aec454539b..c97886c1e0 100644 --- a/types/adone/test/index.ts +++ b/types/adone/test/index.ts @@ -65,4 +65,9 @@ namespace AdoneRootTests { const b = new adone.benchmark.Benchmark.Suite(); b.add(() => {}).add("", () => {}).run(); } + + namespace asyncTests { + adone.async.all([], () => {}); + adone.async.forEach([], () => {}); + } } diff --git a/types/adone/tsconfig.json b/types/adone/tsconfig.json index 6a1af264a3..3f02029dcc 100644 --- a/types/adone/tsconfig.json +++ b/types/adone/tsconfig.json @@ -22,6 +22,7 @@ "files": [ "adone-tests.ts", "adone.d.ts", + "async.d.ts", "benchmark.d.ts", "glosses/archives.d.ts", "glosses/assertion.d.ts", @@ -44,7 +45,7 @@ "glosses/collections/refcounted_cache.d.ts", "glosses/collections/set.d.ts", "glosses/collections/stack.d.ts", - "glosses/collections/timedout_map.d.ts", + "glosses/collections/time_map.d.ts", "glosses/compressors.d.ts", "glosses/crypto/asn1.d.ts", "glosses/crypto/ed25519.d.ts", @@ -58,7 +59,11 @@ "glosses/fast.d.ts", "glosses/fs.d.ts", "glosses/is.d.ts", + "glosses/math/bignumber.d.ts", + "glosses/math/bitset.d.ts", + "glosses/math/decimal.d.ts", "glosses/math/index.d.ts", + "glosses/math/long.d.ts", "glosses/math/matrix.d.ts", "glosses/math/simd.d.ts", "glosses/meta.d.ts", @@ -111,7 +116,7 @@ "test/glosses/collections/refcounted_cache.ts", "test/glosses/collections/set.ts", "test/glosses/collections/stack.ts", - "test/glosses/collections/timedout_map.ts", + "test/glosses/collections/time_map.ts", "test/glosses/compressors.ts", "test/glosses/crypto/asn1.ts", "test/glosses/crypto/ed25519.ts", @@ -124,7 +129,11 @@ "test/glosses/fast.ts", "test/glosses/fs.ts", "test/glosses/is.ts", + "test/glosses/math/bignumber.ts", + "test/glosses/math/bitset.ts", + "test/glosses/math/decimal.ts", "test/glosses/math/index.ts", + "test/glosses/math/long.ts", "test/glosses/math/matrix.ts", "test/glosses/math/simd.ts", "test/glosses/meta.ts", From a146d147bbb945a124c005b1a5c5f7f835ed0c62 Mon Sep 17 00:00:00 2001 From: Glen M Date: Thu, 19 Apr 2018 13:57:56 -0400 Subject: [PATCH 0751/2153] [atom] Support version v1.26. (#25111) * [atom] bump to v1.26. * [atom] support ContextMenu placement properties. --- types/atom/atom-tests.ts | 4 ++ types/atom/autocomplete-plus/index.d.ts | 9 ---- types/atom/index.d.ts | 64 +++++++++++++++---------- 3 files changed, 44 insertions(+), 33 deletions(-) diff --git a/types/atom/atom-tests.ts b/types/atom/atom-tests.ts index 5396338e9c..57420d5059 100644 --- a/types/atom/atom-tests.ts +++ b/types/atom/atom-tests.ts @@ -88,6 +88,10 @@ function testAtomEnvironment() { { label: "Undo", command: "core:undo" }, { label: "Redo", command: "core:redo" }, ], + after: ["test"], + before: ["test"], + afterGroupContaining: ["test"], + beforeGroupContaining: ["test"] }], }); diff --git a/types/atom/autocomplete-plus/index.d.ts b/types/atom/autocomplete-plus/index.d.ts index 8f23911540..5176ca0f30 100644 --- a/types/atom/autocomplete-plus/index.d.ts +++ b/types/atom/autocomplete-plus/index.d.ts @@ -30,15 +30,6 @@ export interface SuggestionInsertedEvent { suggestion: TextSuggestion|SnippetSuggestion; } -/** - * COMPATIBILITY STUB. WILL BE REMOVED - */ -// tslint:disable-next-line:no-empty-interface -export interface Suggestion< - T extends { text: string }|{ snippet: string } - > extends SuggestionBase {} -// TODO: Remove on next minor version - /** * An autocompletion suggestion for the user. * Primary data type for the Atom Autocomplete+ service. diff --git a/types/atom/index.d.ts b/types/atom/index.d.ts index e46ee9d0cf..3cee95ace5 100644 --- a/types/atom/index.d.ts +++ b/types/atom/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Atom 1.25 +// Type definitions for Atom 1.26 // Project: https://github.com/atom/atom // Definitions by: GlenCFL // smhxx @@ -7,7 +7,7 @@ // TypeScript Version: 2.3 // NOTE: only those classes exported within this file should be retain that status below. -// https://github.com/atom/atom/blob/v1.25.0/exports/atom.js +// https://github.com/atom/atom/blob/v1.26.0/exports/atom.js /// @@ -1529,7 +1529,7 @@ export class TextEditor { /** Set the text in the given Range in buffer coordinates. */ setTextInBufferRange(range: RangeCompatible, text: string, options?: - { normalizeLineEndings?: boolean, undo?: "skip" }): Range; + TextEditOptions): Range; /* For each selection, replace the selected text with the given text. */ insertText(text: string, options?: TextInsertionOptions): Range|false; @@ -5145,16 +5145,13 @@ export class TextBuffer { setTextViaDiff(text: string): void; /** Set the text in the given range. */ - setTextInRange(range: RangeCompatible, text: string, options?: - { normalizeLineEndings?: boolean, undo?: "skip" }): Range; + setTextInRange(range: RangeCompatible, text: string, options?: TextEditOptions): Range; /** Insert text at the given position. */ - insert(position: PointCompatible, text: string, options?: - { normalizeLineEndings?: boolean, undo?: "skip" }): Range; + insert(position: PointCompatible, text: string, options?: TextEditOptions): Range; /** Append text to the end of the buffer. */ - append(text: string, options?: { normalizeLineEndings?: boolean, undo?: - "skip" }): Range; + append(text: string, options?: TextEditOptions): Range; /** Delete the text in the given range. */ delete(range: RangeCompatible): Range; @@ -5831,7 +5828,7 @@ export interface TextEditorObservedEvent { // information under certain contexts. // NOTE: the config schema with these defaults can be found here: -// https://github.com/atom/atom/blob/v1.25.0/src/config-schema.js +// https://github.com/atom/atom/blob/v1.26.0/src/config-schema.js /** * Allows you to strongly type Atom configuration variables. Additional key:value * pairings merged into this interface will result in configuration values under @@ -6170,7 +6167,7 @@ export interface ConfirmationOptions { normalizeAccessKeys?: boolean; } -export interface ContextMenuOptions { +export interface ContextMenuItemOptions { /** The menu item's label. */ label?: string; @@ -6189,12 +6186,6 @@ export interface ContextMenuOptions { /** An array of additional items. */ submenu?: ReadonlyArray; - /** - * If you want to create a separator, provide an item with type: 'separator' - * and no other keys. - */ - type?: "separator"; - /** Whether the menu item should appear in the menu. Defaults to true. */ visible?: boolean; @@ -6209,8 +6200,28 @@ export interface ContextMenuOptions { * given context menu deployment. */ shouldDisplay?(event: Event): void; + + /** Place this menu item before the menu items representing the given commands. */ + before?: ReadonlyArray; + + /** Place this menu item after the menu items representing the given commands. */ + after?: ReadonlyArray; + + /** + * Place this menu item's group before the containing group of the menu items + * representing the given commands. + */ + beforeGroupContaining?: ReadonlyArray; + + /** + * Place this menu item's group after the containing group of the menu items + * representing the given commands. + */ + afterGroupContaining?: ReadonlyArray; } +export type ContextMenuOptions = ContextMenuItemOptions | { type: "separator" }; + export interface CopyMarkerOptions { /** Whether or not the marker should be tailed. */ tailed?: boolean; @@ -6483,7 +6494,18 @@ export interface SpawnProcessOptions { shell?: boolean | string; } -export interface TextInsertionOptions { +export interface TextEditOptions { + /** If true, all line endings will be normalized to match the editor's current mode. */ + normalizeLineEndings?: boolean; + + /** + * If skip, skips the undo stack for this operation. + * @deprecated Call groupLastChanges() on the TextBuffer afterward instead. + */ + undo?: "skip"; +} + +export interface TextInsertionOptions extends TextEditOptions { /** If true, selects the newly added text. */ select?: boolean; @@ -6506,12 +6528,6 @@ export interface TextInsertionOptions { * true, this behavior is suppressed. */ preserveTrailingLineIndentation?: boolean; - - /** If true, all line endings will be normalized to match the editor's current mode. */ - normalizeLineEndings?: boolean; - - /** If skip, skips the undo stack for this operation. */ - undo?: "skip"; } /** The options for a Bootstrap 3 Tooltip class, which Atom uses a variant of. */ From c72a09b00f0768979d783325adb21434c2b4c19d Mon Sep 17 00:00:00 2001 From: heroboy Date: Fri, 20 Apr 2018 01:58:49 +0800 Subject: [PATCH 0752/2153] [THREE] add Curve.arcLengthDivisions (#25116) * Update three-core.d.ts add `optionalTarget` parameter * Update three-core.d.ts add Curve.arcLengthDivisions * fix Indentation --- types/three/three-core.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index d08d7ad1db..d3bd6fadcc 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -6582,6 +6582,14 @@ export class AudioListener extends Object3D { * class Curve<T extends Vector> */ export class Curve { + + /** + * This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths. + * To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. + * Default is 200. + */ + arcLengthDivisions:number; + /** * Returns a vector for point t of the curve where t is between 0 and 1 * getPoint(t: number): T; From ac1a16b0d6beaaf3a4495a075cf78eee84bf17b8 Mon Sep 17 00:00:00 2001 From: ougunbu <36983387+ougunbu@users.noreply.github.com> Date: Fri, 20 Apr 2018 01:59:28 +0800 Subject: [PATCH 0753/2153] Added the statement of ActiveSelection (#25084) * Added the statement of ActiveSelection A declaration about ActiveSelection has been added after Group. * Update types Line number 1723: changed any[] to Object[] Line number 1751: changed any to Group Line number 1751: changed "(activeSelection: ActiveSelection) => any" to "(activeSelection: ActiveSelection) => void" --- types/fabric/fabric-impl.d.ts | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/types/fabric/fabric-impl.d.ts b/types/fabric/fabric-impl.d.ts index 31509435a5..369856130c 100644 --- a/types/fabric/fabric-impl.d.ts +++ b/types/fabric/fabric-impl.d.ts @@ -1710,6 +1710,47 @@ export class Group { static fromObject(object: any, callback: (group: Group) => any): void; } +/////////////////////////////////////////////////////////////////////////////// +// ActiveSelection +////////////////////////////////////////////////////////////////////////////// +export interface ActiveSelection extends Object, ICollection {} +export class ActiveSelection { + /** + * Constructor + * @param objects ActiveSelection objects + * @param [options] Options object + */ + constructor(items?: Object[], options?: IObjectOptions); + + /** + * Change te activeSelection to a normal group, + * High level function that automatically adds it to canvas as + * active object. no events fired. + */ + toGroup(): Group; + + /** + * Removes objects from a collection, then renders canvas (if `renderOnAddRemove` is not `false`) + * @param object Zero or more fabric instances + * @return thisArg + * @chainable + */ + remove(...object: Object[]): Group; + + /** + * Returns string represenation of a group + */ + toString(): string; + + /** + * Returns {@link fabric.ActiveSelection} instance from an object representation + * @memberOf fabric.ActiveSelection + * @param object Object to create a group from + * @param [callback] Callback to invoke when an ActiveSelection instance is created + */ + static fromObject(object: Group, callback: (activeSelection: ActiveSelection) => void): void; +} + interface IImageOptions extends IObjectOptions { /** * crossOrigin value (one of "", "anonymous", "allow-credentials") From ef37d26fdfa8c98883ee665c3780c742a53bb612 Mon Sep 17 00:00:00 2001 From: Alex Watson Date: Thu, 19 Apr 2018 14:00:04 -0400 Subject: [PATCH 0754/2153] Updating react-native-drawer definitions from 2.3 to 2.5 (#25118) * Updating types for v2.5.0 of react-native-drawer * Adding credit for updates * Increment version number * Adding test contents for proposed changes * Adding missing comment markers * Removing bad asterisk --- types/react-native-drawer/index.d.ts | 13 +++++++++++-- .../react-native-drawer-tests.tsx | 3 +++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/types/react-native-drawer/index.d.ts b/types/react-native-drawer/index.d.ts index ac64c55fd9..3a82e3363a 100644 --- a/types/react-native-drawer/index.d.ts +++ b/types/react-native-drawer/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for react-native-drawer 2.3 +// Type definitions for react-native-drawer 2.5 // Project: https://github.com/root-two/react-native-drawer // Definitions by: jnbt +// suniahk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -108,6 +109,10 @@ export interface DrawerProperties { * Callback fired at the start of an open animation */ onOpenStart?(): void; + /** + * Callback fired when a drag gesture starts. + */ + onDragStart?(): void; /** * Will be called immediately after the drawer has entered the closed state */ @@ -137,6 +142,10 @@ export interface DrawerProperties { * disable the drawer while still allowing programmatic control */ acceptPan?: boolean; + /** + * Allow Pan when drawer is 'open' + */ + acceptPanOnDrawer?: boolean; /** * Same as acceptTap, except only for close */ @@ -167,7 +176,7 @@ export interface DrawerProperties { /** * which side the drawer should be on. */ - side?: 'left' | 'right'; + side?: 'left' | 'right' | 'top' | 'bottom'; /** * if true will run InteractionManager for open/close animations. */ diff --git a/types/react-native-drawer/react-native-drawer-tests.tsx b/types/react-native-drawer/react-native-drawer-tests.tsx index 10aa1991bd..530fe25a1c 100644 --- a/types/react-native-drawer/react-native-drawer-tests.tsx +++ b/types/react-native-drawer/react-native-drawer-tests.tsx @@ -25,6 +25,9 @@ class DrawerTest extends React.Component<{}, {open: boolean}> { onClose={this.onClose} closedDrawerOffset={100} openDrawerOffset={(viewport: ScaledSize) => 50} + side={ "bottom" } + acceptPanOnDrawer={ true } + onDragStart={ () => {} } > ); From a3245ce3a48086d888729b5a748f6e3c3ffbcbb7 Mon Sep 17 00:00:00 2001 From: Erik Moldtmann Date: Thu, 19 Apr 2018 20:05:36 +0200 Subject: [PATCH 0755/2153] change member types from variable to method (#25097) --- types/nodegit/diff-line.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/types/nodegit/diff-line.d.ts b/types/nodegit/diff-line.d.ts index bf4ad7de91..7d1c071348 100644 --- a/types/nodegit/diff-line.d.ts +++ b/types/nodegit/diff-line.d.ts @@ -11,10 +11,10 @@ export class DiffLine { * */ rawContent(): string; - origin: number; - oldLineno: number; - newLineno: number; - numLines: number; - contentLen: number; - contentOffset: number; + origin(): number; + oldLineno(): number; + newLineno(): number; + numLines(): number; + contentLen(): number; + contentOffset(): number; } From 97c9e20e981fbbbabb724aa067b5ab27ac2b3f4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Pradel?= Date: Thu, 19 Apr 2018 20:07:30 +0200 Subject: [PATCH 0756/2153] dotenv-safe 5.0 (#25124) --- types/dotenv-safe/dotenv-safe-tests.ts | 6 ++++++ types/dotenv-safe/index.d.ts | 29 +++++++++++++++++++------- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/types/dotenv-safe/dotenv-safe-tests.ts b/types/dotenv-safe/dotenv-safe-tests.ts index eca6c0937a..a204a4fc6c 100644 --- a/types/dotenv-safe/dotenv-safe-tests.ts +++ b/types/dotenv-safe/dotenv-safe-tests.ts @@ -5,3 +5,9 @@ env.load({ path: "/foo/bar/baz.env", sample: "/foo/bar/qux.env" }) + +env.config({ + allowEmptyValues: true, + path: "/foo/bar/baz.env", + sample: "/foo/bar/qux.env" +}) diff --git a/types/dotenv-safe/index.d.ts b/types/dotenv-safe/index.d.ts index 2c696ae1b5..114edce926 100644 --- a/types/dotenv-safe/index.d.ts +++ b/types/dotenv-safe/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for dotenv-safe 4.0 +// Type definitions for dotenv-safe 5.0 // Project: https://github.com/rolodato/dotenv-safe // Definitions by: Stan Goldmann // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -18,12 +18,11 @@ export interface MissingEnvVarsError extends Error { missing: string[] } -/** - * Loads environment variables file into 'process.env'. - * - * @throws MissingEnvVarsError - */ -export function load(options?: { +export interface DotenvSafeOptions { + /** + * You can specify a custom path if your file containing environment variables is named or located differently. + * @default '.env' + */ path?: string, /** * Path to example environment file. @@ -45,4 +44,18 @@ export function load(options?: { * @default false */ allowEmptyValues?: boolean, -}): env.DotenvResult +} + +/** + * Loads environment variables file into 'process.env'. + * + * @throws MissingEnvVarsError + */ +export function load(options?: DotenvSafeOptions): env.DotenvResult + +/** + * Loads environment variables file into 'process.env'. + * + * @throws MissingEnvVarsError + */ +export function config(options?: DotenvSafeOptions): env.DotenvResult From 3b33d22565a7ae876841c3ddda8aa7d289191f6b Mon Sep 17 00:00:00 2001 From: Edward Sammut Alessi Date: Thu, 19 Apr 2018 20:09:13 +0200 Subject: [PATCH 0757/2153] React-navigation onTransition event pass props (#25121) * React-navigation onTransition prop passing * Only transition start takes a promise --- types/react-navigation/index.d.ts | 9 +++++---- types/react-navigation/react-navigation-tests.tsx | 12 ++++++++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 517ec8784d..d3f288c217 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -15,6 +15,7 @@ // Steven Miller // Armando Assuncao // Ciaran Liedeman +// Edward Sammut Alessi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -283,8 +284,8 @@ export interface NavigationStackViewConfig { prevTransitionProps: NavigationTransitionProps, isModal: boolean, ) => TransitionConfig; - onTransitionStart?: () => void; - onTransitionEnd?: () => void; + onTransitionStart?: (transitionProps: NavigationTransitionProps, prevTransitionProps?: NavigationTransitionProps) => Promise | void; + onTransitionEnd?: (transitionProps: NavigationTransitionProps, prevTransitionProps?: NavigationTransitionProps) => void; } export interface NavigationStackScreenOptions { @@ -797,8 +798,8 @@ export interface TransitionerProps { prevTransitionProps?: NavigationTransitionProps ) => NavigationTransitionSpec; navigation: NavigationScreenProp; - onTransitionEnd?: () => void; - onTransitionStart?: () => void; + onTransitionStart?: (transitionProps: NavigationTransitionProps, prevTransitionProps?: NavigationTransitionProps) => Promise | void; + onTransitionEnd?: (transitionProps: NavigationTransitionProps, prevTransitionProps?: NavigationTransitionProps) => void; render: ( transitionProps: NavigationTransitionProps, prevTransitionProps?: NavigationTransitionProps diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index ec43f2c86a..15ad2a62f5 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -329,8 +329,16 @@ class CustomTransitioner extends React.Component configureTransition={this._configureTransition} navigation={this.props.navigation} render={this._render} - onTransitionStart={() => { }} - onTransitionEnd={() => { }} + onTransitionStart={(curr, prev) => { + if (prev) { + prev.position.setValue(curr.navigation.state.index); + } + }} + onTransitionEnd={(curr, prev) => { + if (prev) { + prev.position.setValue(curr.navigation.state.index); + } + }} /> ); } From 97163eecd660296d4de02e4e1a6c87e5d9290f15 Mon Sep 17 00:00:00 2001 From: JFGHT Date: Thu, 19 Apr 2018 20:11:54 +0200 Subject: [PATCH 0758/2153] Fixed AccountResponse's signers' object (#25095) * Update index.d.ts Fixed AccountResponse signers object. * Update index.d.ts Fixed public_key in another place. --- types/stellar-sdk/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/stellar-sdk/index.d.ts b/types/stellar-sdk/index.d.ts index b098ea0896..f7eb20af73 100644 --- a/types/stellar-sdk/index.d.ts +++ b/types/stellar-sdk/index.d.ts @@ -92,7 +92,7 @@ export interface AccountRecord extends Record { >; signers: Array< { - _key: string + public_key: string weight: number } >; @@ -425,7 +425,7 @@ export class AccountResponse implements AccountRecord { >; signers: Array< { - _key: string + public_key: string weight: number } >; From 4f374d225e56812b71a70a02c8f9607abe6093fb Mon Sep 17 00:00:00 2001 From: Ricardo Albuquerque Pinto Date: Thu, 19 Apr 2018 15:15:21 -0300 Subject: [PATCH 0759/2153] React animate on scroll (#25131) * Added type definitions for react-animate-on-scroll * Corrected itens pointed by tslint --- types/react-animate-on-scroll/index.d.ts | 24 +++++++++++++++++++ .../react-animate-on-scroll-tests.tsx | 12 ++++++++++ types/react-animate-on-scroll/tsconfig.json | 24 +++++++++++++++++++ types/react-animate-on-scroll/tslint.json | 1 + 4 files changed, 61 insertions(+) create mode 100644 types/react-animate-on-scroll/index.d.ts create mode 100644 types/react-animate-on-scroll/react-animate-on-scroll-tests.tsx create mode 100644 types/react-animate-on-scroll/tsconfig.json create mode 100644 types/react-animate-on-scroll/tslint.json diff --git a/types/react-animate-on-scroll/index.d.ts b/types/react-animate-on-scroll/index.d.ts new file mode 100644 index 0000000000..6584833cbe --- /dev/null +++ b/types/react-animate-on-scroll/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for react-animate-on-scroll 2.1 +// Project: https://github.com/dbramwell/react-animate-on-scroll +// Definitions by: Ricardo Albuquerque +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from 'react'; + +export interface ScrollAnimationProps { + animateIn?: string; + animateOut?: string; + offset?: number; + duration?: number; + delay?: number; + initiallyVisible?: boolean; + animateOnce?: boolean; + style?: object; + scrollableParentSelector?: string; + className?: string; +} + +export default class ScrollAnimation extends React.Component { + constructor(props: ScrollAnimationProps); +} diff --git a/types/react-animate-on-scroll/react-animate-on-scroll-tests.tsx b/types/react-animate-on-scroll/react-animate-on-scroll-tests.tsx new file mode 100644 index 0000000000..cba9342f78 --- /dev/null +++ b/types/react-animate-on-scroll/react-animate-on-scroll-tests.tsx @@ -0,0 +1,12 @@ +import * as React from "react"; +import ScrollAnimation from 'react-animate-on-scroll'; + +export default class ReactAnimateOnScrollTest extends React.Component { + render() { + return ( + + Some Text + + ); + } +} diff --git a/types/react-animate-on-scroll/tsconfig.json b/types/react-animate-on-scroll/tsconfig.json new file mode 100644 index 0000000000..aff07b55c5 --- /dev/null +++ b/types/react-animate-on-scroll/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-animate-on-scroll-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/react-animate-on-scroll/tslint.json b/types/react-animate-on-scroll/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-animate-on-scroll/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From f0bf0a7cef76f97cbbd43a5b853223b805c23a47 Mon Sep 17 00:00:00 2001 From: Alexey Gorshkov Date: Thu, 19 Apr 2018 21:16:02 +0300 Subject: [PATCH 0760/2153] added typings for mapbox-gl-leaflet (#25120) * added typings for mapbox-gl-leaflet * fixed build errors --- types/mapbox-gl-leaflet/index.d.ts | 20 ++++++++++++++++ .../mapbox-gl-leaflet-tests.ts | 14 +++++++++++ types/mapbox-gl-leaflet/tsconfig.json | 24 +++++++++++++++++++ types/mapbox-gl-leaflet/tslint.json | 3 +++ 4 files changed, 61 insertions(+) create mode 100644 types/mapbox-gl-leaflet/index.d.ts create mode 100644 types/mapbox-gl-leaflet/mapbox-gl-leaflet-tests.ts create mode 100644 types/mapbox-gl-leaflet/tsconfig.json create mode 100644 types/mapbox-gl-leaflet/tslint.json diff --git a/types/mapbox-gl-leaflet/index.d.ts b/types/mapbox-gl-leaflet/index.d.ts new file mode 100644 index 0000000000..34e3578eac --- /dev/null +++ b/types/mapbox-gl-leaflet/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for mapbox-gl-leaflet 0.0 +// Project: https://github.com/brunob/leaflet.fullscreen +// Definitions by: Alexey Gorshkov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as L from 'leaflet'; + +declare module 'leaflet' { + class MapboxGL extends Layer { + constructor(options: MapboxGLOptions); + } + + function mapboxGL(options: MapboxGLOptions): MapboxGL; + + interface MapboxGLOptions { + accessToken: string; + style: string; + } +} diff --git a/types/mapbox-gl-leaflet/mapbox-gl-leaflet-tests.ts b/types/mapbox-gl-leaflet/mapbox-gl-leaflet-tests.ts new file mode 100644 index 0000000000..3c8bc6a207 --- /dev/null +++ b/types/mapbox-gl-leaflet/mapbox-gl-leaflet-tests.ts @@ -0,0 +1,14 @@ +import * as L from 'leaflet'; + +const token = 'token'; + +const map = L.map('map').setView([38.912753, -77.032194], 15); +L.marker([38.912753, -77.032194]) + .bindPopup("Hello Leaflet GL!
Whoa, it works!") + .addTo(map) + .openPopup(); + +const gl = L.mapboxGL({ + accessToken: token, + style: 'mapbox://styles/mapbox/bright-v8' +}).addTo(map); diff --git a/types/mapbox-gl-leaflet/tsconfig.json b/types/mapbox-gl-leaflet/tsconfig.json new file mode 100644 index 0000000000..0eef6c85dd --- /dev/null +++ b/types/mapbox-gl-leaflet/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "mapbox-gl-leaflet-tests.ts" + ] +} \ No newline at end of file diff --git a/types/mapbox-gl-leaflet/tslint.json b/types/mapbox-gl-leaflet/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/mapbox-gl-leaflet/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From c9de295a0942129af7d4f16865326c33fb53fa34 Mon Sep 17 00:00:00 2001 From: Jacob Gillespie Date: Thu, 19 Apr 2018 13:19:37 -0500 Subject: [PATCH 0761/2153] react: change default type value of snapshot to any (#24987) * Add getSnapshotBeforeUpdate test for React.createElement * Add test for using component with new lifecycles * Add test for pure component with new lifecycle methods * Chage react snapshot SS to default to any --- types/react/index.d.ts | 4 ++-- types/react/test/index.ts | 14 +++++++++++++- types/react/test/tsx.tsx | 20 ++++++++++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index b766eee600..123bf15d02 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -278,7 +278,7 @@ declare namespace React { // Base component for plain JS classes // tslint:disable-next-line:no-empty-interface - interface Component

extends ComponentLifecycle { } + interface Component

extends ComponentLifecycle { } class Component { constructor(props: P, context?: any); @@ -306,7 +306,7 @@ declare namespace React { }; } - class PureComponent

extends Component { } + class PureComponent

extends Component { } interface ClassicComponent

extends Component { replaceState(nextState: S, callback?: () => void): void; diff --git a/types/react/test/index.ts b/types/react/test/index.ts index 6dae0cbe3c..64d1b20955 100644 --- a/types/react/test/index.ts +++ b/types/react/test/index.ts @@ -25,6 +25,10 @@ interface State { seconds?: number; } +interface Snapshot { + baz: string; +} + interface Context { someValue?: string; } @@ -51,7 +55,7 @@ declare const container: Element; // Top-Level API // -------------------------------------------------------------------------- -class ModernComponent extends React.Component +class ModernComponent extends React.Component implements MyComponent, React.ChildContextProvider { static propTypes: React.ValidationMap = { foo: PropTypes.number @@ -103,6 +107,14 @@ class ModernComponent extends React.Component shouldComponentUpdate(nextProps: Props, nextState: State, nextContext: any): boolean { return shallowCompare(this, nextProps, nextState); } + + getSnapshotBeforeUpdate(prevProps: Readonly) { + return { baz: `${prevProps.foo}baz` }; + } + + componentDidUpdate(prevProps: Readonly, prevState: Readonly, snapshot: Snapshot) { + return; + } } class ModernComponentArrayRender extends React.Component { diff --git a/types/react/test/tsx.tsx b/types/react/test/tsx.tsx index dca7a1f814..431cef2fa0 100644 --- a/types/react/test/tsx.tsx +++ b/types/react/test/tsx.tsx @@ -153,6 +153,26 @@ class ComponentWithNewLifecycles extends React.Component; + +class PureComponentWithNewLifecycles extends React.PureComponent { + static getDerivedStateFromProps: React.GetDerivedStateFromProps = (nextProps) => { + return { bar: `${nextProps.foo}bar` }; + } + + getSnapshotBeforeUpdate(prevProps: Readonly) { + return { baz: `${prevProps.foo}baz` }; + } + + componentDidUpdate(prevProps: Readonly, prevState: Readonly, snapshot: { baz: string }) { + return; + } + + render() { + return this.state.bar; + } +} +; class ComponentWithLargeState extends React.Component<{}, Record<'a'|'b'|'c', string>> { static getDerivedStateFromProps: React.GetDerivedStateFromProps<{}, Record<'a'|'b'|'c', string>> = () => { From 57f3c174f95b1d74cda580cc0b497eff62d1363b Mon Sep 17 00:00:00 2001 From: Edo Rivai Date: Thu, 19 Apr 2018 20:42:38 +0200 Subject: [PATCH 0762/2153] [knex] Add QueryBuilder to knex.raw bindings (#25100) * Ignore no-var tslint rule * [knex] Add QueryBuilder to knex.raw bindings --- types/knex/index.d.ts | 11 +++++------ types/knex/knex-tests.ts | 15 ++++++++++++--- types/knex/tslint.json | 1 + 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/types/knex/index.d.ts b/types/knex/index.d.ts index 34715ec6cc..90a700b7dc 100644 --- a/types/knex/index.d.ts +++ b/types/knex/index.d.ts @@ -18,7 +18,7 @@ import Bluebird = require("bluebird"); type Callback = Function; type Client = Function; type Value = string | number | boolean | Date | Array | Array | Array | Array | Buffer | Knex.Raw; -type ValueMap = { [key: string]: Value }; +type ValueMap = { [key: string]: Value | Knex.QueryBuilder }; type ColumnName = string | Knex.Raw | Knex.QueryBuilder | {[key: string]: string }; type TableName = string | Knex.Raw | Knex.QueryBuilder; @@ -338,8 +338,8 @@ declare namespace Knex { } interface RawQueryBuilder { - (sql: string, ...bindings: Value[]): QueryBuilder; - (sql: string, bindings: Value[] | ValueMap): QueryBuilder; + (sql: string, ...bindings: (Value | QueryBuilder)[]): QueryBuilder; + (sql: string, bindings: (Value | QueryBuilder)[] | ValueMap): QueryBuilder; (raw: Raw): QueryBuilder; } @@ -351,9 +351,8 @@ declare namespace Knex { interface RawBuilder { (value: Value): Raw; - (sql: string, ...bindings: Value[]): Raw; - (sql: string, bindings: Value[]): Raw; - (sql: string, bindings: ValueMap): Raw; + (sql: string, ...bindings: (Value | QueryBuilder)[]): Raw; + (sql: string, bindings: (Value | QueryBuilder)[] | ValueMap): Raw; } // diff --git a/types/knex/knex-tests.ts b/types/knex/knex-tests.ts index 112732a2e5..eaf186a186 100644 --- a/types/knex/knex-tests.ts +++ b/types/knex/knex-tests.ts @@ -247,6 +247,7 @@ knex('users').whereNotBetween('votes', [1, 100]); knex('users').whereRaw('id = ?', [1]); knex('users').whereRaw('id = :id', { id: 1 }); +knex('users').whereRaw('id = :id', { id: knex('users').select('id').limit(1) }); // Join methods knex('users') @@ -409,7 +410,15 @@ knex.select('*').from('users').join('accounts', (join: Knex.JoinClause) => { knex.select('*').from('users').join('accounts', 'accounts.type', knex.raw('?', ['admin'])); +knex.raw('? ON CONFLICT DO NOTHING', [knex('account').insert([{}])]); +knex.raw('select * from users where id = ? OR id = ?', + 1, + knex('users').select('id').limit(1), +); knex.raw('select * from users where id = :user_id', { user_id: 1 }); +knex.raw('select * from users where id = :user_id_query', { + user_id_query: knex('ids').select('id').limit(1) +}); knex.from('users').innerJoin('accounts', 'users.id', 'accounts.user_id'); @@ -812,7 +821,7 @@ knex('users') .orWhere(knex.raw('status <> ?', [1])) .groupBy('status'); - knex.raw('select * from users where id = ?', [1]).then(function(resp) { +knex.raw('select * from users where id = ?', [1]).then(function(resp) { // ... }); @@ -963,9 +972,9 @@ knex.select('*') // ... }); - knex.select('*').from('users').where(knex.raw('id = ?', [1])).toString(); +knex.select('*').from('users').where(knex.raw('id = ?', [1])).toString(); - knex.select('*').from('users').where(knex.raw('id = ?', [1])).toSQL(); +knex.select('*').from('users').where(knex.raw('id = ?', [1])).toSQL(); // // Callback functions diff --git a/types/knex/tslint.json b/types/knex/tslint.json index cf7f07f094..d84fe24e60 100644 --- a/types/knex/tslint.json +++ b/types/knex/tslint.json @@ -50,6 +50,7 @@ "no-unnecessary-type-assertion": false, "no-useless-files": false, "no-var-keyword": false, + "no-var": false, "no-var-requires": false, "no-void-expression": false, "no-trailing-whitespace": false, From 8a3389ca45cca46006f367337f707559d27d44b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=B8rch?= Date: Thu, 19 Apr 2018 20:43:24 +0200 Subject: [PATCH 0763/2153] Adding more siblings to Red interface in node-red (#25013) * Adding more siblings to Red interface in node-red * Fixed typo --- types/node-red/index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types/node-red/index.d.ts b/types/node-red/index.d.ts index 8a013128c8..4c9a1f093a 100644 --- a/types/node-red/index.d.ts +++ b/types/node-red/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for node-red 0.17 // Project: http://nodered.org // Definitions by: Anders E. Andersen +// Thomas B. Mørch // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -18,6 +19,12 @@ export interface Red { settings: any; events: any; util: any; + httpAdmin: any; + auth: any; + comms: any; + library: any; + httpNode: any; + server: any; /** Returns the version of the running Node-RED environment. */ version(): string; } From 076d8cafb4f6b8bf3928250d9a0a695dbee522c3 Mon Sep 17 00:00:00 2001 From: Gareth Parker Date: Thu, 19 Apr 2018 20:56:31 +0100 Subject: [PATCH 0764/2153] Glue - Fix to plugins --- types/glue/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/glue/index.d.ts b/types/glue/index.d.ts index 8e710d233a..d1bf010ffe 100644 --- a/types/glue/index.d.ts +++ b/types/glue/index.d.ts @@ -24,7 +24,7 @@ export interface Plugin { export interface Manifest { server: ServerOptions; register?: { - plugins: Plugin[] + plugins: string | Plugin[] }; } From 1aab1e3668570ca3c4afd88798ea93f5cd55b52d Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Thu, 19 Apr 2018 23:25:09 +0200 Subject: [PATCH 0765/2153] add addEventListener to eventsource (#25125) --- types/eventsource/eventsource-tests.ts | 2 ++ types/eventsource/index.d.ts | 1 + types/eventsource/lib/eventsource-polyfill/index.d.ts | 1 + 3 files changed, 4 insertions(+) diff --git a/types/eventsource/eventsource-tests.ts b/types/eventsource/eventsource-tests.ts index d081e87e42..62f867926f 100644 --- a/types/eventsource/eventsource-tests.ts +++ b/types/eventsource/eventsource-tests.ts @@ -4,6 +4,7 @@ const eventSource = new EventSource("http://foobar"); eventSource.onmessage = (x: any) => {}; eventSource.onerror = (x: any) => {}; eventSource.onopen = (x: any) => {}; +eventSource.addEventListener = (type: string, x: any) => {}; eventSource.close(); import EventSourcePolyfill = require("eventsource/lib/eventsource-polyfill"); @@ -12,4 +13,5 @@ const eventSourcePolyfill = new EventSourcePolyfill("http://foobar"); eventSourcePolyfill.onmessage = (x: any) => {}; eventSourcePolyfill.onerror = (x: any) => {}; eventSourcePolyfill.onopen = (x: any) => {}; +eventSourcePolyfill.addEventListener = (type: string, x: any) => {}; eventSourcePolyfill.close(); diff --git a/types/eventsource/index.d.ts b/types/eventsource/index.d.ts index 3620b6116f..62859d037b 100644 --- a/types/eventsource/index.d.ts +++ b/types/eventsource/index.d.ts @@ -16,6 +16,7 @@ declare class EventSource { onopen: EventListener; onmessage: EventListener; onerror: EventListener; + addEventListener(type: string, listener: EventListener): void; close(): void; } diff --git a/types/eventsource/lib/eventsource-polyfill/index.d.ts b/types/eventsource/lib/eventsource-polyfill/index.d.ts index 6246355dfe..3e4ad378e4 100644 --- a/types/eventsource/lib/eventsource-polyfill/index.d.ts +++ b/types/eventsource/lib/eventsource-polyfill/index.d.ts @@ -10,6 +10,7 @@ declare class EventSource { onopen: EventListener; onmessage: EventListener; onerror: EventListener; + addEventListener(type: string, listener: EventListener): void; close(): void; } From c107a976ba75f27912013b597e42b6419d9a2833 Mon Sep 17 00:00:00 2001 From: Gareth Parker Date: Thu, 19 Apr 2018 22:38:26 +0100 Subject: [PATCH 0766/2153] Glue - Fix to plugins (#25141) --- types/glue/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/glue/index.d.ts b/types/glue/index.d.ts index 8e710d233a..d1bf010ffe 100644 --- a/types/glue/index.d.ts +++ b/types/glue/index.d.ts @@ -24,7 +24,7 @@ export interface Plugin { export interface Manifest { server: ServerOptions; register?: { - plugins: Plugin[] + plugins: string | Plugin[] }; } From 847ad849a92e4495a0da501d3465af5de67b8ddd Mon Sep 17 00:00:00 2001 From: Nick Burrell Date: Fri, 20 Apr 2018 00:41:48 +0100 Subject: [PATCH 0767/2153] @types/mapbox-gl maxDuration property in FlyToOptions (#25088) --- types/mapbox-gl/index.d.ts | 1 + types/mapbox-gl/mapbox-gl-tests.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index b6a63ef9dd..f878e2b2bd 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -873,6 +873,7 @@ declare namespace mapboxgl { speed?: number; screenSpeed?: number; easing?: Function; + maxDuration?: number; } export interface FitBoundsOptions extends mapboxgl.FlyToOptions { diff --git a/types/mapbox-gl/mapbox-gl-tests.ts b/types/mapbox-gl/mapbox-gl-tests.ts index ce10a26564..fa62007088 100644 --- a/types/mapbox-gl/mapbox-gl-tests.ts +++ b/types/mapbox-gl/mapbox-gl-tests.ts @@ -150,7 +150,8 @@ map.flyTo({ screenSpeed: 1, easing: function(t: any) { return t; - } + }, + maxDuration: 1 }); /** From ee2f1b215e2b3833dbe8ef7d8878d893303a6548 Mon Sep 17 00:00:00 2001 From: Conan Date: Thu, 19 Apr 2018 19:42:37 -0400 Subject: [PATCH 0768/2153] [Joi] - add schema option to .when (#25136) --- types/joi/v10/index.d.ts | 15 +++++++++++++++ types/joi/v10/joi-tests.ts | 17 +++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/types/joi/v10/index.d.ts b/types/joi/v10/index.d.ts index 9270c411aa..e21edda875 100644 --- a/types/joi/v10/index.d.ts +++ b/types/joi/v10/index.d.ts @@ -8,6 +8,7 @@ // Rytis Alekna // Pavel Ivanov // Youngrok Kim +// Conan Lai // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -142,6 +143,17 @@ export interface WhenOptions { otherwise?: SchemaLike; } +export interface WhenSchemaOptions { + /** + * the alternative schema type if the condition is true. Required if otherwise is missing. + */ + then?: SchemaLike; + /** + * the alternative schema type if the condition is false. Required if then is missing + */ + otherwise?: SchemaLike; +} + export interface ReferenceOptions { separator?: string; contextPrefix?: string; @@ -327,6 +339,7 @@ export interface AnySchema extends JoiObject { */ when(ref: string, options: WhenOptions): AlternativesSchema; when(ref: Reference, options: WhenOptions): AlternativesSchema; + when(ref: Schema, options: WhenSchemaOptions): AlternativesSchema; /** * Overrides the key name in error messages. @@ -878,6 +891,7 @@ export interface AlternativesSchema extends AnySchema { try(...types: SchemaLike[]): this; when(ref: string, options: WhenOptions): this; when(ref: Reference, options: WhenOptions): this; + when(ref: Schema, options: WhenSchemaOptions): this; } export interface LazySchema extends AnySchema { @@ -1160,6 +1174,7 @@ export function concat(schema: T): T; */ export function when(ref: string, options: WhenOptions): AlternativesSchema; export function when(ref: Reference, options: WhenOptions): AlternativesSchema; +export function when(ref: Schema, options: WhenSchemaOptions): AlternativesSchema; /** * Overrides the key name in error messages. diff --git a/types/joi/v10/joi-tests.ts b/types/joi/v10/joi-tests.ts index bfc6268ef7..b1f125a6ea 100644 --- a/types/joi/v10/joi-tests.ts +++ b/types/joi/v10/joi-tests.ts @@ -122,6 +122,14 @@ whenOpts = { is: schemaLike, then: schemaLike, otherwise: schemaLike }; // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- +var whenSchemaOpts: Joi.WhenSchemaOptions = null; + +whenSchemaOpts = { then: schema }; +whenSchemaOpts = { otherwise: schema }; +whenSchemaOpts = { then: schemaLike, otherwise: schemaLike }; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + var refOpts: Joi.ReferenceOptions = null; refOpts = { separator: str }; @@ -263,6 +271,7 @@ namespace common { altSchema = anySchema.when(str, whenOpts); altSchema = anySchema.when(ref, whenOpts); + altSchema = anySchema.when(schema, whenSchemaOpts); anySchema = anySchema.label(str); anySchema = anySchema.raw(); @@ -350,6 +359,7 @@ namespace common_copy_paste { altSchema = arrSchema.when(str, whenOpts); altSchema = arrSchema.when(ref, whenOpts); + altSchema = arrSchema.when(schema, whenSchemaOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -420,6 +430,7 @@ namespace common_copy_paste { altSchema = boolSchema.when(str, whenOpts); altSchema = boolSchema.when(ref, whenOpts); + altSchema = boolSchema.when(schema, whenSchemaOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -476,6 +487,7 @@ namespace common { altSchema = binSchema.when(str, whenOpts); altSchema = binSchema.when(ref, whenOpts); + altSchema = binSchema.when(schema, whenSchemaOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -548,6 +560,7 @@ namespace common { altSchema = dateSchema.when(str, whenOpts); altSchema = dateSchema.when(ref, whenOpts); + altSchema = dateSchema.when(schema, whenSchemaOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -622,6 +635,7 @@ namespace common { altSchema = numSchema.when(str, whenOpts); altSchema = numSchema.when(ref, whenOpts); + altSchema = numSchema.when(schema, whenSchemaOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -732,6 +746,7 @@ namespace common { altSchema = objSchema.when(str, whenOpts); altSchema = objSchema.when(ref, whenOpts); + altSchema = objSchema.when(schema, whenSchemaOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -823,6 +838,7 @@ namespace common { altSchema = strSchema.when(str, whenOpts); altSchema = strSchema.when(ref, whenOpts); + altSchema = strSchema.when(schema, whenSchemaOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -1007,6 +1023,7 @@ schema = Joi.concat(x); schema = Joi.when(str, whenOpts); schema = Joi.when(ref, whenOpts); +schema = Joi.when(schema, whenSchemaOpts); schema = Joi.label(str); schema = Joi.raw(); From fde76994561dd7151f8b002fd646690c176e85a3 Mon Sep 17 00:00:00 2001 From: Scott Jones Date: Thu, 19 Apr 2018 23:42:02 -0400 Subject: [PATCH 0769/2153] Fix up next/router types * add name to index.ts * update tests --- types/next/index.d.ts | 1 + types/next/router.d.ts | 8 +++-- types/next/test/next-router-tests.tsx | 46 +++++++++++++-------------- 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/types/next/index.d.ts b/types/next/index.d.ts index 036e9f58ce..e0ec456724 100644 --- a/types/next/index.d.ts +++ b/types/next/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/zeit/next.js // Definitions by: Drew Hays // Brice BERNARD +// Scott Jones // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 diff --git a/types/next/router.d.ts b/types/next/router.d.ts index 181208518f..a5cfb42c90 100644 --- a/types/next/router.d.ts +++ b/types/next/router.d.ts @@ -9,7 +9,7 @@ export interface EventChangeOptions { } export type RouterCallback = () => void; -export interface SingletonRouter { +export interface RouterProps { readyCallbacks: RouterCallback[]; ready(cb: RouterCallback): void; @@ -53,8 +53,12 @@ export interface SingletonRouter { onRouteChangeError?(error: any, url: string): void; } +export interface SingletonRouter { + router: RouterProps; +} + export function withRouter( - Component: React.ComponentType, + Component: React.ComponentType, ): React.ComponentType; export const Singleton: SingletonRouter; diff --git a/types/next/test/next-router-tests.tsx b/types/next/test/next-router-tests.tsx index fe82d6f0b2..7957f5e8a2 100644 --- a/types/next/test/next-router-tests.tsx +++ b/types/next/test/next-router-tests.tsx @@ -2,10 +2,10 @@ import Router, * as r from "next/router"; import * as React from "react"; import * as qs from "querystring"; -Router.readyCallbacks.push(() => { +Router.router.readyCallbacks.push(() => { console.log("I'll get called when the router initializes."); }); -Router.ready(() => { +Router.router.ready(() => { console.log( "I'll get called immediately if the router initializes, or when it eventually does.", ); @@ -13,8 +13,8 @@ Router.ready(() => { // Access readonly properties of the router. -Object.keys(Router.components).forEach(key => { - const c = Router.components[key]; +Object.keys(Router.router.components).forEach(key => { + const c = Router.router.components[key]; c.err.isAnAny; return ; @@ -26,51 +26,51 @@ function split(routeLike: string) { }); } -if (Router.asPath) { - split(Router.asPath); - split(Router.asPath); +if (Router.router.asPath) { + split(Router.router.asPath); + split(Router.router.asPath); } -split(Router.pathname); +split(Router.router.pathname); -const query = `?${qs.stringify(Router.query)}`; +const query = `?${qs.stringify(Router.router.query)}`; // Assign some callback methods. -Router.onAppUpdated = (nextRoute: string) => console.log(nextRoute); -Router.onRouteChangeStart = (url: string) => +Router.router.onAppUpdated = (nextRoute: string) => console.log(nextRoute); +Router.router.onRouteChangeStart = (url: string) => console.log("Route is starting to change.", url); -Router.onBeforeHistoryChange = (as: string) => +Router.router.onBeforeHistoryChange = (as: string) => console.log("History hasn't changed yet.", as); -Router.onRouteChangeComplete = (url: string) => +Router.router.onRouteChangeComplete = (url: string) => console.log("Route chaneg is complete.", url); -Router.onRouteChangeError = (err: any, url: string) => +Router.router.onRouteChangeError = (err: any, url: string) => console.log("Route is starting to change.", url, err); // Call methods on the router itself. -Router.reload("/route").then(() => console.log("route was reloaded")); -Router.back(); +Router.router.reload("/route").then(() => console.log("route was reloaded")); +Router.router.back(); -Router.push("/route").then((success: boolean) => +Router.router.push("/route").then((success: boolean) => console.log("route push success: ", success), ); -Router.push("/route", "/asRoute").then((success: boolean) => +Router.router.push("/route", "/asRoute").then((success: boolean) => console.log("route push success: ", success), ); -Router.push("/route", "/asRoute", { shallow: false }).then((success: boolean) => +Router.router.push("/route", "/asRoute", { shallow: false }).then((success: boolean) => console.log("route push success: ", success), ); -Router.replace("/route").then((success: boolean) => +Router.router.replace("/route").then((success: boolean) => console.log("route replace success: ", success), ); -Router.replace("/route", "/asRoute").then((success: boolean) => +Router.router.replace("/route", "/asRoute").then((success: boolean) => console.log("route replace success: ", success), ); -Router.replace("/route", "/asRoute", { +Router.router.replace("/route", "/asRoute", { shallow: false, }).then((success: boolean) => console.log("route replace success: ", success)); -Router.prefetch("/route").then(Component => { +Router.router.prefetch("/route").then(Component => { const element = ; }); From 8f5e007f5e76260c6991523241dfc2112cbfcfd4 Mon Sep 17 00:00:00 2001 From: Zev Spitz Date: Fri, 20 Apr 2018 20:27:00 +0300 Subject: [PATCH 0770/2153] activex-dao: Default properties; removed Enumerator, SafeArray; default parameter values fix (#25138) * Default properties; fix jsdoc for default parameters; remove Enumerator * Fix extra line * Move test code into blocks * Recordset default property * Use default properties --- types/activex-dao/activex-dao-tests.ts | 193 +++++++----- types/activex-dao/index.d.ts | 404 ++++++++++++------------- 2 files changed, 307 insertions(+), 290 deletions(-) diff --git a/types/activex-dao/activex-dao-tests.ts b/types/activex-dao/activex-dao-tests.ts index 412bea60b5..7e8c2bef22 100644 --- a/types/activex-dao/activex-dao-tests.ts +++ b/types/activex-dao/activex-dao-tests.ts @@ -1,27 +1,48 @@ -let engine = new ActiveXObject('DAO.DBEngine.120'); +const collectionToArray = (col: { Item(key: any): T }): T[] => { + const results: T[] = []; + const enumerator = new Enumerator(col); + enumerator.moveFirst(); + while (!enumerator.atEnd()) { + results.push(enumerator.item()); + enumerator.moveNext(); + } + return results; +}; + +const dbOpenSnapshot = DAO.RecordsetTypeEnum.dbOpenSnapshot; + +let engine = new ActiveXObject('DAO.DBEngine'); let dbsNorthwind = engine.OpenDatabase('c:\\path\\to\\northwind.mdb'); -// adding a record to a recordset -- https://msdn.microsoft.com/VBA/Access-VBA/articles/add-a-record-to-a-dao-recordset -let rstShippers = dbsNorthwind.OpenRecordset('Shippers'); -rstShippers.AddNew(); -rstShippers.Fields.Item('CompanyName').Value = 'Global Parcel Service'; -// Set remaining fields -rstShippers.Update(); -rstShippers.Close(); +// https://msdn.microsoft.com/VBA/Access-VBA/articles/add-a-record-to-a-dao-recordset +{ + // adding a record to a recordset + const rstShippers = dbsNorthwind.OpenRecordset('Shippers'); + rstShippers.AddNew(); + rstShippers('CompanyName').Value = 'Global Parcel Service'; + // Set remaining fields + rstShippers.Update(); + rstShippers.Close(); +} -// create a QueryDef with the given SQL -- https://msdn.microsoft.com/VBA/Access-VBA/articles/build-sql-statements-that-include-variables-and-controls -let sql = 'SELECT * FROM Orders WHERE OrderDate > #3-31-2006#'; -let qdf = dbsNorthwind.CreateQueryDef('Second quarter', sql); -// using parameters -sql = ` - PARAMETERS QuarterStart DATETIME - SELECT * - FROM Orders - WHERE OrderDate > QuarterStart -`; -qdf = dbsNorthwind.CreateQueryDef('Second quarter (parameters)', sql); +// https://msdn.microsoft.com/VBA/Access-VBA/articles/build-sql-statements-that-include-variables-and-controls +{ + // create a QueryDef with the given SQL + let sql = 'SELECT * FROM Orders WHERE OrderDate > #3-31-2006#'; + let qdf = dbsNorthwind.CreateQueryDef('Second quarter', sql); + // using parameters + sql = ` + PARAMETERS QuarterStart DATETIME + SELECT * + FROM Orders + WHERE OrderDate > QuarterStart + `; + qdf = dbsNorthwind.CreateQueryDef('Second quarter (parameters)', sql); + WScript.Echo(`Field names: ${collectionToArray(qdf.Fields).map(fld => fld.Name).join(', ')}`); +} -// count the number of records in a Recordset -- https://msdn.microsoft.com/VBA/Access-VBA/articles/count-the-number-of-records-in-a-dao-recordset +// https://msdn.microsoft.com/VBA/Access-VBA/articles/count-the-number-of-records-in-a-dao-recordset +/** Count the number of records in a Recordset */ const findRecordCount = (dbs: DAO.Database, sql: string) => { let count = 0; const rstRecords = dbs.OpenRecordset(sql); @@ -33,113 +54,119 @@ const findRecordCount = (dbs: DAO.Database, sql: string) => { return count; }; -// delete records from a Recordset -- https://msdn.microsoft.com/VBA/Access-VBA/articles/delete-a-record-from-a-dao-recordset -rstShippers = dbsNorthwind.OpenRecordset('SELECT * FROM Shippers ORDER BY CompanyName, ShipperID', DAO.RecordsetTypeEnum.dbOpenDynaset); -if (!rstShippers.EOF) { - let name = rstShippers.Fields.Item('CompanyName').Value; - rstShippers.MoveNext(); - while (!rstShippers.EOF) { - const recordName: string = rstShippers.Fields.Item('CompanyName').Value; - if (recordName === name) { - rstShippers.Delete(); - } else { - name = recordName; - } +// https://msdn.microsoft.com/VBA/Access-VBA/articles/delete-a-record-from-a-dao-recordset +{ + // delete records from a Recordset + const rstShippers = dbsNorthwind.OpenRecordset('SELECT * FROM Shippers ORDER BY CompanyName, ShipperID', DAO.RecordsetTypeEnum.dbOpenDynaset); + if (!rstShippers.EOF) { + let name = rstShippers('CompanyName').Value; rstShippers.MoveNext(); + while (!rstShippers.EOF) { + const recordName: string = rstShippers('CompanyName').Value; + if (recordName === name) { + rstShippers.Delete(); + } else { + name = recordName; + } + rstShippers.MoveNext(); + } } + rstShippers.Close(); } -rstShippers.Close(); -// copy entire records to an array -- https://msdn.microsoft.com/VBA/Access-VBA/articles/extract-data-from-a-record-in-a-dao-recordset -let rstEmployees = dbsNorthwind.OpenRecordset('SELECT FirstName, LastName, Title FROM Employees', DAO.RecordsetTypeEnum.dbOpenSnapshot); -let records = new VBArray(rstEmployees.GetRows(3)); -let recordCount = records.ubound(2) + 1; -let columnCount = records.ubound(1) + 1; -for (let row = 0; row < recordCount; row += 1) { - for (let column = 0; column < columnCount; column += 1) { - WScript.Echo(records.getItem(column, row)); +// https://msdn.microsoft.com/VBA/Access-VBA/articles/extract-data-from-a-record-in-a-dao-recordset +{ + // copy entire records to an array + const rstEmployees = dbsNorthwind.OpenRecordset('SELECT FirstName, LastName, Title FROM Employees', dbOpenSnapshot); + const records = new VBArray(rstEmployees.GetRows(3)); + const recordCount = records.ubound(2) + 1; + const columnCount = records.ubound(1) + 1; + for (let row = 0; row < recordCount; row += 1) { + for (let column = 0; column < columnCount; column += 1) { + WScript.Echo(records.getItem(column, row)); + } } + if (rstEmployees.EOF) { WScript.Echo('At end of recordset'); } + rstEmployees.Close(); } -if (rstEmployees.EOF) { WScript.Echo('At end of recordset'); } -rstEmployees.Close(); // find a record in a dynaset-type or snapshot-type DAO Recordset -- https://msdn.microsoft.com/en-us/vba/access-vba/articles/find-a-record-in-a-dynaset-type-or-snapshot-type-dao-recordset -const findOrdersWithoutDetails = () => { +{ const orders: number[] = []; - const rstOrders = dbsNorthwind.OpenRecordset('SELECT * FROM Orders ORDER BY OrderID', DAO.RecordsetTypeEnum.dbOpenSnapshot); - const rstOrderDetails = dbsNorthwind.OpenRecordset('SELECT * FROM [Order Details] ORDER BY OrderID', DAO.RecordsetTypeEnum.dbOpenSnapshot); + const rstOrders = dbsNorthwind.OpenRecordset('SELECT * FROM Orders ORDER BY OrderID', dbOpenSnapshot); + const rstOrderDetails = dbsNorthwind.OpenRecordset('SELECT * FROM [Order Details] ORDER BY OrderID', dbOpenSnapshot); - const closeRecordsets = () => { - rstOrders.Close(); - rstOrderDetails.Close(); - }; - if (rstOrders.EOF || rstOrderDetails.EOF) { - closeRecordsets(); - return; - } - - while (!rstOrders.EOF) { - const orderID = rstOrders.Fields.Item('OrderID').Value; - rstOrderDetails.FindFirst(`OrderID=${orderID}`); - if (rstOrderDetails.NoMatch) { - orders.push(orderID); + if (!rstOrders.EOF && !rstOrderDetails.EOF) { + while (!rstOrders.EOF) { + const orderID = rstOrders('OrderID').Value; + rstOrderDetails.FindFirst(`OrderID=${orderID}`); + if (rstOrderDetails.NoMatch) { + orders.push(orderID); + } + rstOrders.MoveNext(); } - rstOrders.MoveNext(); } - closeRecordsets(); - return orders; -}; -// find a record in a table-type DAO Recordset -- https://msdn.microsoft.com/VBA/Access-VBA/articles/find-a-record-in-a-table-type-dao-recordset + rstOrders.Close(); + rstOrderDetails.Close(); + + WScript.Echo(orders.join('\n')); +} + +// https://msdn.microsoft.com/VBA/Access-VBA/articles/find-a-record-in-a-table-type-dao-recordset +/** Find a record in a table-type DAO Recordset */ const getHireDate = (employeeID: number) => { let hireDate: Date | undefined; const rstEmployees = dbsNorthwind.OpenRecordset('Employees'); rstEmployees.Index = 'PrimaryKey'; rstEmployees.Seek('=', employeeID); if (!rstEmployees.NoMatch) { - hireDate = new Date(rstEmployees.Fields.Item('HireDate').Value as VarDate); + hireDate = new Date(rstEmployees('HireDate').Value as VarDate); } return hireDate; }; -// manipulate multiple fields with DAO -- https://msdn.microsoft.com/VBA/Access-VBA/articles/manipulate-multivalued-fields-with-dao -const browseMultiValueField = () => { +// https://msdn.microsoft.com/VBA/Access-VBA/articles/manipulate-multivalued-fields-with-dao +{ + // manipulate multiple fields with DAO const rs = dbsNorthwind.OpenRecordset('Tasks'); rs.MoveFirst(); while (!rs.EOF) { - WScript.Echo(rs.Fields.Item('TaskName').Value); - const childRs = rs.Fields.Item('AssignedTo').Value as DAO.Recordset; + WScript.Echo(rs('TaskName').Value); + const childRs = rs('AssignedTo').Value as DAO.Recordset; if (childRs.EOF) { continue; } childRs.MoveFirst(); while (!childRs.EOF) { - WScript.Echo('\t' + childRs.Fields.Item('Value').Value); + WScript.Echo('\t' + childRs('Value').Value); } } -}; +} -// modifying an existing record in a DAO Recordset -- https://msdn.microsoft.com/VBA/Access-VBA/articles/modify-an-existing-record-in-a-dao-recordset -const changeTitleWithoutTransaction = () => { - rstEmployees = dbsNorthwind.OpenRecordset('Employees'); +// https://msdn.microsoft.com/VBA/Access-VBA/articles/modify-an-existing-record-in-a-dao-recordset +{ + // modifying an existing record in a DAO Recordset + const rstEmployees = dbsNorthwind.OpenRecordset('Employees'); while (!rstEmployees.EOF) { - if (rstEmployees.Fields.Item('Title').Value === 'Sales Representative') { + if (rstEmployees('Title').Value === 'Sales Representative') { rstEmployees.Edit(); - rstEmployees.Fields.Item('Title').Value = 'Account Executive'; + rstEmployees('Title').Value = 'Account Executive'; rstEmployees.Update(); } rstEmployees.MoveNext(); } rstEmployees.Close(); -}; +} -// using transactions in a DAO Recordset -- https://msdn.microsoft.com/VBA/Access-VBA/articles/use-transactions-in-a-dao-recordset +// https://msdn.microsoft.com/VBA/Access-VBA/articles/use-transactions-in-a-dao-recordset +/** using transactions in a DAO Recordset */ const changeTitleWithTransaction = (commitTransaction: boolean) => { - const currentWorkspace = engine.Workspaces.Item(0); - rstEmployees = dbsNorthwind.OpenRecordset('Employees'); + const currentWorkspace = engine.Workspaces(0); + const rstEmployees = dbsNorthwind.OpenRecordset('Employees'); currentWorkspace.BeginTrans(); while (!rstEmployees.EOF) { - if (rstEmployees.Fields.Item('Title').Value === 'Sales Representative') { + if (rstEmployees('Title').Value === 'Sales Representative') { rstEmployees.Edit(); - rstEmployees.Fields.Item('Title').Value = 'Account Executive'; + rstEmployees('Title').Value = 'Account Executive'; rstEmployees.Update(); } rstEmployees.MoveNext(); diff --git a/types/activex-dao/index.d.ts b/types/activex-dao/index.d.ts index 6db3e0bd0d..a2a159e324 100644 --- a/types/activex-dao/index.d.ts +++ b/types/activex-dao/index.d.ts @@ -1,8 +1,8 @@ -// Type definitions for Microsoft Office 14.0 Access Database Engine Object Library - DAO 14.0 +// Type definitions for Microsoft Office 16.0 Access Database Engine Object Library - DAO 16.0 // Project: https://msdn.microsoft.com/en-us/library/dn124645.aspx // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.6 declare namespace DAO { const enum _DAOSuppHelp { @@ -56,12 +56,15 @@ declare namespace DAO { } const enum DatabaseTypeEnum { + /** @deprecated */ dbDecrypt = 4, + /** @deprecated */ dbEncrypt = 2, dbVersion10 = 1, dbVersion11 = 8, dbVersion120 = 128, dbVersion140 = 256, + dbVersion150 = 512, dbVersion20 = 16, dbVersion30 = 32, dbVersion40 = 64, @@ -128,6 +131,15 @@ declare namespace DAO { dbRefreshCache = 8, } + const enum ISAMStatsEnum { + DiskReads = 0, + DiskWrites = 1, + LocksPlaced = 4, + LocksReleased = 5, + ReadsFromCache = 2, + ReadsFromReadAheadCache = 3, + } + const enum LanguageConstants { dbLangArabic = ';LANGID=0x0401;CP=1256;COUNTRY=0', dbLangChineseSimplified = ';LANGID=0x0804;CP=936;COUNTRY=0', @@ -308,18 +320,26 @@ declare namespace DAO { dbUseODBC = 1, } + type Bookmark = SafeArray; + + class ComplexType { + private 'DAO.ComplexType_typekey': ComplexType; + private constructor(); + readonly Fields: Fields; + } + class Connection { private 'DAO.Connection_typekey': Connection; private constructor(); Cancel(): void; Close(): void; readonly Connect: string; - CreateQueryDef(Name?: any, SQLText?: any): QueryDef; + CreateQueryDef(Name?: string, SQLText?: string): QueryDef; readonly Database: Database; - Execute(Query: string, Options?: any): void; + Execute(Query: string, Options?: RecordsetOptionEnum): void; readonly hDbc: number; readonly Name: string; - OpenRecordset(Name: string, Type?: any, Options?: any, LockEdit?: any): Recordset; + OpenRecordset(Name: string, Type?: RecordsetTypeEnum, Options?: RecordsetOptionEnum, LockEdit?: LockTypeEnum): Recordset; readonly QueryDefs: QueryDefs; QueryTimeout: number; readonly RecordsAffected: number; @@ -329,12 +349,11 @@ declare namespace DAO { readonly Updatable: boolean; } - class Connections { - private 'DAO.Connections_typekey': Connections; - private constructor(); + interface Connections { readonly Count: number; - Item(Item: any): Connection; + Item(Item: number | string): Connection; Refresh(): void; + (Item: number | string): Connection; } class Container { @@ -350,12 +369,11 @@ declare namespace DAO { UserName: string; } - class Containers { - private 'DAO.Containers_typekey': Containers; - private constructor(); + interface Containers { readonly Count: number; - Item(Item: any): Container; + Item(Item: number | string): Container; Refresh(): void; + (Item: number | string): Container; } class Database { @@ -366,16 +384,16 @@ declare namespace DAO { Connect: string; readonly Connection: Connection; readonly Containers: Containers; - CreateProperty(Name?: any, Type?: any, Value?: any, DDL?: any): Property; - CreateQueryDef(Name?: any, SQLText?: any): QueryDef; - CreateRelation(Name?: any, Table?: any, ForeignTable?: any, Attributes?: any): Relation; - CreateTableDef(Name?: any, Attributes?: any, SourceTableName?: any, Connect?: any): TableDef; + CreateProperty(Name?: string, Type?: DataTypeEnum, Value?: any, DDL?: boolean): Property; + CreateQueryDef(Name?: string, SQLText?: string): QueryDef; + CreateRelation(Name?: string, Table?: string, ForeignTable?: string, Attributes?: RelationAttributeEnum): Relation; + CreateTableDef(Name?: string, Attributes?: TableDefAttributeEnum, SourceTableName?: string, Connect?: string): TableDef; DesignMasterID: string; - Execute(Query: string, Options?: any): void; - MakeReplica(PathName: string, Description: string, Options?: any): void; + Execute(Query: string, Options?: RecordsetOptionEnum): void; + MakeReplica(PathName: string, Description: string, Options?: ReplicaTypeEnum): void; readonly Name: string; NewPassword(bstrOld: string, bstrNew: string): void; - OpenRecordset(Name: string, Type?: any, Options?: any, LockEdit?: any): Recordset; + OpenRecordset(Name: string, Type?: RecordsetTypeEnum, Options?: RecordsetOptionEnum, LockEdit?: LockTypeEnum): Recordset; PopulatePartial(DbPathName: string): void; readonly Properties: Properties; readonly QueryDefs: QueryDefs; @@ -384,19 +402,18 @@ declare namespace DAO { readonly Recordsets: Recordsets; readonly Relations: Relations; readonly ReplicaID: string; - Synchronize(DbPathName: string, ExchangeType?: any): void; + Synchronize(DbPathName: string, ExchangeType?: SynchronizeTypeEnum): void; readonly TableDefs: TableDefs; readonly Transactions: boolean; readonly Updatable: boolean; readonly Version: string; } - class Databases { - private 'DAO.Databases_typekey': Databases; - private constructor(); + interface Databases { readonly Count: number; - Item(Item: any): Database; + Item(Item: number | string): Database; Refresh(): void; + (Item: number | string): Database; } class DBEngine { @@ -404,26 +421,51 @@ declare namespace DAO { private constructor(); BeginTrans(): void; - /** @param number [Option=0] */ + /** @param Option [Option=0] */ CommitTrans(Option?: number): void; - CompactDatabase(SrcName: string, DstName: string, DstLocale?: any, Options?: any, SrcLocale?: any): void; - CreateDatabase(Name: string, Locale: string, Option?: any): Database; - CreateWorkspace(Name: string, UserName: string, Password: string, UseType?: any): Workspace; + + /** + * Compact a closed database + * + * @param DstLocale Specify one of the following: + * * the locale, using one of the language constants + * * the password, in the form `;pwd=MyNewPassword'` + * * both the constant and a password, e.g. `dbLangGreek + ';pwd=MyNewPassword'` + * + * @param Options `dbEncrypt` and `dbDecrypt` are deprecated, and unsupported for ACCDB + * @param password Deprecated, and unsupported for ACCDB + */ + CompactDatabase(SrcName: string, DstName: string, DstLocale?: LanguageConstants | string, Options?: DatabaseTypeEnum, password?: string): void; + + /** + * @param Locale Specify one of the following: + * * the locale, using one of the language constants + * * the password, in the form `;pwd=MyNewPassword'` + * * both the constant and a password, e.g. `dbLangGreek + ';pwd=MyNewPassword'` + */ + CreateDatabase(Name: string, Locale: LanguageConstants | string, Option?: DatabaseTypeEnum): Database; + CreateWorkspace(Name: string, UserName: string, Password: string, UseType?: WorkspaceTypeEnum): Workspace; readonly DefaultPassword: string; DefaultType: number; readonly DefaultUser: string; readonly Errors: Errors; - Idle(Action?: any): void; + Idle(Action?: IdleEnum): void; IniPath: string; - ISAMStats(StatNum: number, Reset?: any): number; + + /** Returns various statistics from the Jet engine */ + ISAMStats(StatNum: ISAMStatsEnum, Reset?: boolean): number; LoginTimeout: number; - OpenConnection(Name: string, Options?: any, ReadOnly?: any, Connect?: any): Connection; - OpenDatabase(Name: string, Options?: any, ReadOnly?: any, Connect?: any): Database; + + /** + * @param Connect ODBC connection string; prepend with `ODBC;` + */ + OpenConnection(Name: string, Options?: DriverPromptEnum | RecordsetOptionEnum.dbRunAsync, ReadOnly?: boolean, Connect?: string): Connection; + OpenDatabase(Name: string, Exclusive?: boolean, ReadOnly?: boolean, Connect?: string): Database; readonly Properties: Properties; RegisterDatabase(Dsn: string, Driver: string, Silent: boolean, Attributes: string): void; RepairDatabase(Name: string): void; Rollback(): void; - SetOption(Option: number, Value: any): void; + SetOption(Option: SetOptionEnum, Value: any): void; SystemDB: string; readonly Version: string; readonly Workspaces: Workspaces; @@ -434,9 +476,9 @@ declare namespace DAO { private constructor(); readonly AllPermissions: number; readonly Container: string; - CreateProperty(Name?: any, Type?: any, Value?: any, DDL?: any): Property; - readonly DateCreated: any; - readonly LastUpdated: any; + CreateProperty(Name?: string, Type?: DataTypeEnum, Value?: any, DDL?: boolean): Property; + readonly DateCreated: VarDate; + readonly LastUpdated: VarDate; readonly Name: string; Owner: string; Permissions: number; @@ -444,12 +486,11 @@ declare namespace DAO { UserName: string; } - class Documents { - private 'DAO.Documents_typekey': Documents; - private constructor(); + interface Documents { readonly Count: number; - Item(Item: any): Document; + Item(Item: number | string): Document; Refresh(): void; + (Item: number | string): Document; } class Error { @@ -462,33 +503,38 @@ declare namespace DAO { readonly Source: string; } - class Errors { - private 'DAO.Errors_typekey': Errors; - private constructor(); + interface Errors { readonly Count: number; Item(Item: any): Error; Refresh(): void; + (Item: any): Error; } class Field { - private 'DAO.Field_typekey': Field; private constructor(); + private 'DAO.Field2_typekey': Field; AllowZeroLength: boolean; AppendChunk(Val: any): void; + AppendOnly: boolean; Attributes: number; readonly CollatingOrder: number; readonly CollectionIndex: number; - CreateProperty(Name?: any, Type?: any, Value?: any, DDL?: any): Property; + readonly ComplexType: ComplexType; + CreateProperty(Name?: string, Type?: DataTypeEnum, Value?: any, DDL?: boolean): Property; readonly DataUpdatable: boolean; DefaultValue: any; + Expression: string; readonly FieldSize: number; ForeignName: string; GetChunk(Offset: number, Bytes: number): any; + readonly IsComplex: boolean; + LoadFromFile(FileName: string): void; Name: string; OrdinalPosition: number; readonly OriginalValue: any; readonly Properties: Properties; Required: boolean; + SaveToFile(FileName: string): void; Size: number; readonly SourceField: string; readonly SourceTable: string; @@ -500,44 +546,42 @@ declare namespace DAO { readonly VisibleValue: any; } - class Fields { - private 'DAO.Fields_typekey': Fields; - private constructor(); - Append(Object: any): void; + interface Fields { + Append(Field: Field): void; readonly Count: number; Delete(Name: string): void; - Item(Item: any): Field; + Item(Item: number | string): Field; Refresh(): void; + (Item: number | string): Field; } class Group { private 'DAO.Group_typekey': Group; private constructor(); - CreateUser(Name?: any, PID?: any, Password?: any): User; + CreateUser(Name?: string, PID?: string, Password?: string): User; Name: string; readonly PID: string; readonly Properties: Properties; readonly Users: Users; } - class Groups { - private 'DAO.Groups_typekey': Groups; - private constructor(); - Append(Object: any): void; + interface Groups { + Append(Group: Group): void; readonly Count: number; Delete(Name: string): void; - Item(Item: any): Group; + Item(Item: number | string): Group; Refresh(): void; + (Item: number | string): Group; } class Index { private 'DAO.Index_typekey': Index; private constructor(); Clustered: boolean; - CreateField(Name?: any, Type?: any, Size?: any): Field; - CreateProperty(Name?: any, Type?: any, Value?: any, DDL?: any): Property; + CreateField(Name?: string): Field; + CreateProperty(Name?: string, Type?: DataTypeEnum, Value?: any, DDL?: boolean): Property; readonly DistinctCount: number; - Fields: any; + Fields: Fields; readonly Foreign: boolean; IgnoreNulls: boolean; Name: string; @@ -547,14 +591,14 @@ declare namespace DAO { Unique: boolean; } - class Indexes { - private 'DAO.Indexes_typekey': Indexes; - private constructor(); - Append(Object: any): void; + // tslint:disable-next-line:interface-name + interface Indexes { + Append(Index: Index): void; readonly Count: number; Delete(Name: string): void; - Item(Item: any): Index; + Item(Item: number | string): Index; Refresh(): void; + (Item: number | string): Index; } class Parameter { @@ -567,53 +611,20 @@ declare namespace DAO { Value: any; } - class Parameters { - private 'DAO.Parameters_typekey': Parameters; - private constructor(); + interface Parameters { readonly Count: number; - Item(Item: any): Parameter; + Item(Item: number | string): Parameter; Refresh(): void; + (Item: number | string): Parameter; } - /** DAO 3.0 DBEngine (private) */ - class PrivDBEngine { - private 'DAO.PrivDBEngine_typekey': PrivDBEngine; - private constructor(); - BeginTrans(): void; - - /** @param number [Option=0] */ - CommitTrans(Option?: number): void; - CompactDatabase(SrcName: string, DstName: string, DstLocale?: any, Options?: any, SrcLocale?: any): void; - CreateDatabase(Name: string, Locale: string, Option?: any): Database; - CreateWorkspace(Name: string, UserName: string, Password: string, UseType?: any): Workspace; - readonly DefaultPassword: string; - DefaultType: number; - readonly DefaultUser: string; - readonly Errors: Errors; - Idle(Action?: any): void; - IniPath: string; - ISAMStats(StatNum: number, Reset?: any): number; - LoginTimeout: number; - OpenConnection(Name: string, Options?: any, ReadOnly?: any, Connect?: any): Connection; - OpenDatabase(Name: string, Options?: any, ReadOnly?: any, Connect?: any): Database; - readonly Properties: Properties; - RegisterDatabase(Dsn: string, Driver: string, Silent: boolean, Attributes: string): void; - RepairDatabase(Name: string): void; - Rollback(): void; - SetOption(Option: number, Value: any): void; - SystemDB: string; - readonly Version: string; - readonly Workspaces: Workspaces; - } - - class Properties { - private 'DAO.Properties_typekey': Properties; - private constructor(); - Append(Object: any): void; + interface Properties { + Append(Property: Property): void; readonly Count: number; Delete(Name: string): void; - Item(Item: any): Property; + Item(Item: number | string): Property; Refresh(): void; + (Item: number | string): Property; } class Property { @@ -633,81 +644,78 @@ declare namespace DAO { Cancel(): void; Close(): void; Connect: string; - CreateProperty(Name?: any, Type?: any, Value?: any, DDL?: any): Property; - readonly DateCreated: any; - Execute(Options?: any): void; + CreateProperty(Name?: string, Type?: DataTypeEnum, Value?: any, DDL?: boolean): Property; + readonly DateCreated: VarDate; + Execute(Options?: RecordsetOptionEnum): void; readonly Fields: Fields; readonly hStmt: number; - readonly LastUpdated: any; + readonly LastUpdated: VarDate; MaxRecords: number; Name: string; ODBCTimeout: number; - OpenRecordset(Type?: any, Options?: any, LockEdit?: any): Recordset; + OpenRecordset(Type?: RecordsetTypeEnum, Options?: RecordsetOptionEnum, LockEdit?: LockTypeEnum): Recordset; readonly Parameters: Parameters; - Prepare: any; + Prepare: QueryDefStateEnum; readonly Properties: Properties; readonly RecordsAffected: number; ReturnsRecords: boolean; SQL: string; readonly StillExecuting: boolean; - readonly Type: number; + readonly Type: QueryDefTypeEnum; readonly Updatable: boolean; } - class QueryDefs { - private 'DAO.QueryDefs_typekey': QueryDefs; - private constructor(); - Append(Object: any): void; + interface QueryDefs { + Append(QueryDef: QueryDef): void; readonly Count: number; Delete(Name: string): void; - Item(Item: any): QueryDef; + Item(Item: number | string): QueryDef; Refresh(): void; + (Item: number | string): QueryDef; } - class Recordset { - private 'DAO.Recordset_typekey': Recordset; - private constructor(); + interface Recordset { AbsolutePosition: number; AddNew(): void; readonly BatchCollisionCount: number; - readonly BatchCollisions: any; + readonly BatchCollisions: SafeArray; BatchSize: number; readonly BOF: boolean; - Bookmark: SafeArray; + Bookmark: Bookmark; readonly Bookmarkable: boolean; CacheSize: number; - CacheStart: SafeArray; + CacheStart: Bookmark; Cancel(): void; - /** @param number [UpdateType=1] */ + /** @param UpdateType [UpdateType=1] */ CancelUpdate(UpdateType?: number): void; Clone(): Recordset; Close(): void; Collect(Item: any): any; Connection: Connection; CopyQueryDef(): QueryDef; - readonly DateCreated: any; + readonly DateCreated: VarDate; Delete(): void; Edit(): void; - readonly EditMode: number; + readonly EditMode: EditModeEnum; readonly EOF: boolean; readonly Fields: Fields; - FillCache(Rows?: any, StartBookmark?: any): void; + FillCache(Rows?: number, StartBookmark?: string): void; Filter: string; FindFirst(Criteria: string): void; FindLast(Criteria: string): void; FindNext(Criteria: string): void; FindPrevious(Criteria: string): void; - GetRows(NumRows?: any): any; + GetRows(NumRows?: number): any; readonly hStmt: number; Index: string; - readonly LastModified: SafeArray; - readonly LastUpdated: any; + readonly LastModified: Bookmark; + readonly LastUpdated: VarDate; LockEdits: boolean; - Move(Rows: number, StartBookmark?: any): void; + Move(Rows: number, StartBookmark?: Bookmark): void; MoveFirst(): void; - /** @param number [Options=0] */ + /** @param Options [Options=0] */ MoveLast(Options?: number): void; MoveNext(): void; MovePrevious(): void; @@ -716,45 +724,44 @@ declare namespace DAO { readonly NoMatch: boolean; readonly ODBCFetchCount: number; readonly ODBCFetchDelay: number; - OpenRecordset(Type?: any, Options?: any): Recordset; + OpenRecordset(Type?: RecordsetTypeEnum, Options?: RecordsetOptionEnum): Recordset; readonly Parent: Database; PercentPosition: number; readonly Properties: Properties; readonly RecordCount: number; readonly RecordStatus: number; - Requery(NewQueryDef?: any): void; + Requery(NewQueryDef?: QueryDef): void; readonly Restartable: boolean; - Seek( - Comparison: string, Key1: any, Key2?: any, Key3?: any, Key4?: any, Key5?: any, Key6?: any, Key7?: any, Key8?: any, Key9?: any, Key10?: any, Key11?: any, Key12?: any, Key13?: any): void; + Seek(Comparison: string, Key1: any, Key2?: any, Key3?: any, Key4?: any, Key5?: any, Key6?: any, Key7?: any, Key8?: any, Key9?: any, Key10?: any, Key11?: any, Key12?: any, Key13?: any): void; Sort: string; readonly StillExecuting: boolean; readonly Transactions: boolean; - readonly Type: number; + readonly Type: RecordsetTypeEnum; readonly Updatable: boolean; /** - * @param number [UpdateType=1] - * @param boolean [Force=false] + * @param UpdateType [UpdateType=1] + * @param Force [Force=false] */ - Update(UpdateType?: number, Force?: boolean): void; - UpdateOptions: number; + Update(UpdateType?: UpdateTypeEnum, Force?: boolean): void; + UpdateOptions: UpdateCriteriaEnum; readonly ValidationRule: string; readonly ValidationText: string; + (FieldIndex: number | string): Field; } - class Recordsets { - private 'DAO.Recordsets_typekey': Recordsets; - private constructor(); + interface Recordsets { readonly Count: number; - Item(Item: any): Recordset; + Item(Item: number | string): Recordset; Refresh(): void; + (Item: number | string): Recordset; } class Relation { private 'DAO.Relation_typekey': Relation; private constructor(); - Attributes: number; - CreateField(Name?: any, Type?: any, Size?: any): Field; + Attributes: RelationAttributeEnum; + CreateField(Name?: string): Field; readonly Fields: Fields; ForeignTable: string; Name: string; @@ -763,55 +770,53 @@ declare namespace DAO { Table: string; } - class Relations { - private 'DAO.Relations_typekey': Relations; - private constructor(); - Append(Object: any): void; + interface Relations { + Append(Relation: Relation): void; readonly Count: number; Delete(Name: string): void; - Item(Item: any): Relation; + Item(Item: number | string): Relation; Refresh(): void; + (Item: number | string): Relation; } class TableDef { private 'DAO.TableDef_typekey': TableDef; private constructor(); - Attributes: number; + Attributes: TableDefAttributeEnum; readonly ConflictTable: string; Connect: string; - CreateField(Name?: any, Type?: any, Size?: any): Field; - CreateIndex(Name?: any): Index; - CreateProperty(Name?: any, Type?: any, Value?: any, DDL?: any): Property; - readonly DateCreated: any; + CreateField(Name?: string, Type?: DataTypeEnum, Size?: number): Field; + CreateIndex(Name?: string): Index; + CreateProperty(Name?: string, Type?: DataTypeEnum, Value?: any, DDL?: boolean): Property; + readonly DateCreated: VarDate; readonly Fields: Fields; readonly Indexes: Indexes; - readonly LastUpdated: any; + readonly LastUpdated: VarDate; Name: string; - OpenRecordset(Type?: any, Options?: any): Recordset; + OpenRecordset(Type?: RecordsetTypeEnum, Options?: RecordsetOptionEnum): Recordset; readonly Properties: Properties; readonly RecordCount: number; RefreshLink(): void; - ReplicaFilter: any; + ReplicaFilter: string | boolean; SourceTableName: string; readonly Updatable: boolean; ValidationRule: string; ValidationText: string; } - class TableDefs { - private 'DAO.TableDefs_typekey': TableDefs; - private constructor(); - Append(Object: any): void; + interface TableDefs { + Append(TableDef: TableDef): void; readonly Count: number; Delete(Name: string): void; - Item(Item: any): TableDef; + Item(Item: number | string): TableDef; Refresh(): void; + (Item: number | string): TableDef; } class User { private 'DAO.User_typekey': User; private constructor(); - CreateGroup(Name?: any, PID?: any): Group; + CreateGroup(Name?: string, PID?: string): Group; readonly Groups: Groups; Name: string; NewPassword(bstrOld: string, bstrNew: string): void; @@ -820,14 +825,13 @@ declare namespace DAO { readonly Properties: Properties; } - class Users { - private 'DAO.Users_typekey': Users; - private constructor(); - Append(Object: any): void; + interface Users { + Append(User: User): void; readonly Count: number; Delete(Name: string): void; - Item(Item: any): User; + Item(Item: number | string): User; Refresh(): void; + (Item: number | string): User; } class Workspace { @@ -836,12 +840,19 @@ declare namespace DAO { BeginTrans(): void; Close(): void; - /** @param number [Options=0] */ + /** @param Options [Options=0] */ CommitTrans(Options?: number): void; readonly Connections: Connections; - CreateDatabase(Name: string, Connect: string, Option?: any): Database; - CreateGroup(Name?: any, PID?: any): Group; - CreateUser(Name?: any, PID?: any, Password?: any): User; + + /** + * @param Connect Specify one of the following: + * * the locale, using one of the language constants + * * the password, in the form `;pwd=MyNewPassword'` + * * both the constant and a password, e.g. `dbLangGreek + ';pwd=MyNewPassword'` + */ + CreateDatabase(Name: string, Connect: string, Option?: DatabaseTypeEnum): Database; + CreateGroup(Name?: string, PID?: string): Group; + CreateUser(Name?: string, PID?: string, Password?: string): User; readonly Databases: Databases; DefaultCursorDriver: number; readonly Groups: Groups; @@ -849,8 +860,12 @@ declare namespace DAO { IsolateODBCTrans: number; LoginTimeout: number; Name: string; - OpenConnection(Name: string, Options?: any, ReadOnly?: any, Connect?: any): Connection; - OpenDatabase(Name: string, Options?: any, ReadOnly?: any, Connect?: any): Database; + + /** + * @param Connect ODBC connection string; prepend with `ODBC;` + */ + OpenConnection(Name: string, Options?: DriverPromptEnum | RecordsetOptionEnum.dbRunAsync, ReadOnly?: boolean, Connect?: string): Connection; + OpenDatabase(Name: string, Exclusive?: boolean, ReadOnly?: boolean, Connect?: string): Database; readonly Properties: Properties; Rollback(): void; readonly Type: number; @@ -858,14 +873,13 @@ declare namespace DAO { readonly Users: Users; } - class Workspaces { - private 'DAO.Workspaces_typekey': Workspaces; - private constructor(); - Append(Object: any): void; + interface Workspaces { + Append(Workspace: Workspace): void; readonly Count: number; Delete(Name: string): void; - Item(Item: any): Workspace; + Item(Item: number | string): Workspace; Refresh(): void; + (Item: number | string): Workspace; } } @@ -875,36 +889,12 @@ interface ActiveXObject { interface ActiveXObjectNameMap { 'DAO.DBEngine': DAO.DBEngine; - 'DAO.DBEngine.120': DAO.DBEngine; 'DAO.Field': DAO.Field; 'DAO.Group': DAO.Group; 'DAO.Index': DAO.Index; - 'DAO.PrivateDBEngine': DAO.PrivDBEngine; + 'DAO.PrivateDBEngine': DAO.DBEngine; 'DAO.QueryDef': DAO.QueryDef; 'DAO.Relation': DAO.Relation; 'DAO.TableDef': DAO.TableDef; 'DAO.User': DAO.User; } - -interface EnumeratorConstructor { - new(col: DAO.Connections): Enumerator; - new(col: DAO.Containers): Enumerator; - new(col: DAO.Databases): Enumerator; - new(col: DAO.Documents): Enumerator; - new(col: DAO.Errors): Enumerator; - new(col: DAO.Fields): Enumerator; - new(col: DAO.Groups): Enumerator; - new(col: DAO.Indexes): Enumerator; - new(col: DAO.Parameters): Enumerator; - new(col: DAO.Properties): Enumerator; - new(col: DAO.QueryDefs): Enumerator; - new(col: DAO.Recordsets): Enumerator; - new(col: DAO.Relations): Enumerator; - new(col: DAO.TableDefs): Enumerator; - new(col: DAO.Users): Enumerator; - new(col: DAO.Workspaces): Enumerator; -} - -interface SafeArray { - _brand: SafeArray; -} From cc428670a2d70bfb9b0d633cc6b644e3f7d93c12 Mon Sep 17 00:00:00 2001 From: heroboy Date: Sat, 21 Apr 2018 01:29:18 +0800 Subject: [PATCH 0771/2153] [THREE]fix class Raycaster and add jsdoc (#25151) * Update three-core.d.ts add `optionalTarget` parameter * Update three-core.d.ts add Curve.arcLengthDivisions * fix Indentation * fix class Raycaster --- types/three/three-core.d.ts | 53 ++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index d3bd6fadcc..f97768d34f 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -1833,19 +1833,66 @@ export interface RaycasterParameters { } export class Raycaster { + /** + * This creates a new raycaster object. + * @param origin The origin vector where the ray casts from. + * @param direction The direction vector that gives direction to the ray. Should be normalized. + * @param near All results returned are further away than near. Near can't be negative. Default value is 0. + * @param far All results returned are closer then far. Far can't be lower then near . Default value is Infinity. + */ constructor(origin?: Vector3, direction?: Vector3, near?: number, far?: number); + /** The Ray used for the raycasting. */ ray: Ray; + + /** + * The near factor of the raycaster. This value indicates which objects can be discarded based on the + * distance. This value shouldn't be negative and should be smaller than the far property. + */ near: number; + + /** + * The far factor of the raycaster. This value indicates which objects can be discarded based on the + * distance. This value shouldn't be negative and should be larger than the near property. + */ far: number; + params: RaycasterParameters; - precision: number; + + /** + * The precision factor of the raycaster when intersecting Line objects. + */ linePrecision: number; + /** + * Updates the ray with a new origin and direction. + * @param origin The origin vector where the ray casts from. + * @param direction The normalized direction vector that gives direction to the ray. + */ set(origin: Vector3, direction: Vector3): void; + + /** + * Updates the ray with a new origin and direction. + * @param coords 2D coordinates of the mouse, in normalized device coordinates (NDC)---X and Y components should be between -1 and 1. + * @param camera camera from which the ray should originate + */ setFromCamera(coords: { x: number; y: number; }, camera: Camera ): void; - intersectObject(object: Object3D, recursive?: boolean): Intersection[]; - intersectObjects(objects: Object3D[], recursive?: boolean): Intersection[]; + + /** + * Checks all intersection between the ray and the object with or without the descendants. Intersections are returned sorted by distance, closest first. + * @param object The object to check for intersection with the ray. + * @param recursive If true, it also checks all descendants. Otherwise it only checks intersecton with the object. Default is false. + * @param optionalTarget (optional) target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;). + */ + intersectObject(object: Object3D, recursive?: boolean, optionalTarget?: Intersection[]): Intersection[]; + + /** + * Checks all intersection between the ray and the objects with or without the descendants. Intersections are returned sorted by distance, closest first. Intersections are of the same form as those returned by .intersectObject. + * @param objects The objects to check for intersection with the ray. + * @param recursive If true, it also checks all descendants of the objects. Otherwise it only checks intersecton with the objects. Default is false. + * @param optionalTarget (optional) target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;). + */ + intersectObjects(objects: Object3D[], recursive?: boolean, optionalTarget?: Intersection[]): Intersection[]; } export class Layers { From 1fc33c76c932afe616ab3d62c2d096d109c43cac Mon Sep 17 00:00:00 2001 From: Eduard Dyckman Date: Fri, 20 Apr 2018 20:29:38 +0300 Subject: [PATCH 0772/2153] Update index.d.ts (#25130) --- types/storybook__addon-info/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/storybook__addon-info/index.d.ts b/types/storybook__addon-info/index.d.ts index f694ad3eb4..c616933b8f 100644 --- a/types/storybook__addon-info/index.d.ts +++ b/types/storybook__addon-info/index.d.ts @@ -29,6 +29,6 @@ export interface Options { maxPropStringLength?: number; } -export function withInfo(textOrOptions: string | Options): (storyFn: RenderFunction) => () => React.ReactElement; +export function withInfo(textOrOptions: string | Options): (storyFn: RenderFunction) => (context?: object) => React.ReactElement; export function setDefaults(newDefaults: Options): Options; From a7eb125f90220a80698b0344be1e0a8d811cccd6 Mon Sep 17 00:00:00 2001 From: Curtis Maddalozzo Date: Fri, 20 Apr 2018 18:30:42 +0100 Subject: [PATCH 0773/2153] [Raven] Add types for default transport instances (#25161) * Add definitions for transports * Fix transport option. Add tests. * Bump version * Fix linting error * Add definitions for default transport instances --- types/raven/index.d.ts | 2 ++ types/raven/raven-tests.ts | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/types/raven/index.d.ts b/types/raven/index.d.ts index 5d478a496b..81a36ee8f1 100644 --- a/types/raven/index.d.ts +++ b/types/raven/index.d.ts @@ -158,4 +158,6 @@ export namespace transports { } class HTTPSTransport extends HTTPTransport { } + const https: HTTPSTransport; + const http: HTTPTransport; } diff --git a/types/raven/raven-tests.ts b/types/raven/raven-tests.ts index 6191f8f89d..fc89d88589 100644 --- a/types/raven/raven-tests.ts +++ b/types/raven/raven-tests.ts @@ -16,6 +16,11 @@ Raven.config({ release: 'foobar', transport }); + +Raven.config({ + transport: Raven.transports.https +}); + client.setContext({}); client.on('logged', () => { }); client.process({}); From 6e4734614deeb13174de0c7dcd07d85ab0695df7 Mon Sep 17 00:00:00 2001 From: Richard Hulm Date: Fri, 20 Apr 2018 18:31:33 +0100 Subject: [PATCH 0774/2153] react-stripe-elements - Add correct typings to creating a source object (#25169) * Update typings. Ensure the createSource typings are better, using the types from the main stripe package. Also update the injectStripe type to be more flexible in how it can be used, ensuring it allows components with state to be used * Tabs not spaces --- types/react-stripe-elements/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/react-stripe-elements/index.d.ts b/types/react-stripe-elements/index.d.ts index 0ef90dc839..d7cea98728 100644 --- a/types/react-stripe-elements/index.d.ts +++ b/types/react-stripe-elements/index.d.ts @@ -16,6 +16,8 @@ export namespace ReactStripeElements { import ElementsOptions = stripe.elements.ElementsOptions; import TokenOptions = stripe.TokenOptions; import TokenResponse = stripe.TokenResponse; + import SourceResponse = stripe.SourceResponse; + import SourceOptions = stripe.SourceOptions; /** * There's a bug in @types/stripe which defines the property as @@ -28,8 +30,7 @@ export namespace ReactStripeElements { type StripeProviderProps = { apiKey: string; stripe?: never; } | { apiKey?: never; stripe: StripeProps | null; }; interface StripeProps { - // I'm not sure what the definition for this is - createSource(): void; + createSource(sourceData?: SourceOptions): Promise; createToken(options?: TokenOptions): Promise; } From f5e6b5a365bd8ad2e393ae37316a6c43889fe0e5 Mon Sep 17 00:00:00 2001 From: Patrick Simmelbauer Date: Fri, 20 Apr 2018 19:32:43 +0200 Subject: [PATCH 0775/2153] Add typing for node and mark keys of prosemirror Schema in all prosemirror-* packages (#25061) * Add typing to nodes and mark of prosemirror Schema * Update typings of prosemirror-model * Update typings of prosemirror-view * Update typings of prosemirror-state * Remove warning comments and fix indentation * Fix indendation before comments * Add index signature to nodes and marks * Change default generic argument from Schema to any --- types/prosemirror-collab/index.d.ts | 28 +- types/prosemirror-commands/index.d.ts | 124 ++++-- types/prosemirror-gapcursor/index.d.ts | 10 +- types/prosemirror-history/index.d.ts | 22 +- types/prosemirror-inputrules/index.d.ts | 46 ++- types/prosemirror-keymap/index.d.ts | 11 +- types/prosemirror-markdown/index.d.ts | 52 ++- types/prosemirror-menu/index.d.ts | 67 +-- types/prosemirror-model/index.d.ts | 382 +++++++++++------- .../prosemirror-model-tests.ts | 38 +- types/prosemirror-schema-basic/index.d.ts | 34 +- types/prosemirror-schema-list/index.d.ts | 32 +- types/prosemirror-state/index.d.ts | 190 +++++---- types/prosemirror-tables/index.d.ts | 162 ++++++-- types/prosemirror-transform/index.d.ts | 160 +++++--- types/prosemirror-transform/tsconfig.json | 16 +- types/prosemirror-view/index.d.ts | 209 +++++++--- 17 files changed, 1029 insertions(+), 554 deletions(-) diff --git a/types/prosemirror-collab/index.d.ts b/types/prosemirror-collab/index.d.ts index 4b84101159..cb4949bcba 100644 --- a/types/prosemirror-collab/index.d.ts +++ b/types/prosemirror-collab/index.d.ts @@ -3,13 +3,11 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. +// TypeScript Version: 2.3 +import { Schema } from 'prosemirror-model'; import { EditorState, Plugin, Transaction } from 'prosemirror-state'; import { Step } from 'prosemirror-transform'; @@ -17,13 +15,20 @@ import { Step } from 'prosemirror-transform'; * Creates a plugin that enables the collaborative editing framework * for the editor. */ -export function collab(config?: { version?: number | null, clientID?: number | string | null }): Plugin; +export function collab(config?: { + version?: number | null; + clientID?: number | string | null; +}): Plugin; /** * Create a transaction that represents a set of new steps received from * the authority. Applying this transaction moves the state forward to * adjust to the authority's view of the document. */ -export function receiveTransaction(state: EditorState, steps: Step[], clientIDs: Array): Transaction; +export function receiveTransaction( + state: EditorState, + steps: Array>, + clientIDs: Array +): Transaction; /** * Provides data describing the editor's unconfirmed steps, which need * to be sent to the central authority. Returns null when there is @@ -35,7 +40,14 @@ export function receiveTransaction(state: EditorState, steps: Step[], clientIDs: * rebased, whereas the origin transactions are still the old, * unchanged objects. */ -export function sendableSteps(state: EditorState): { version: number, steps: Step[], clientID: number | string, origins: Transaction[] } | null | void; +export function sendableSteps( + state: EditorState +): { + version: number; + steps: Array>; + clientID: number | string; + origins: Array>; +} | null | void; /** * Get the version up to which the collab plugin has synced with the * central authority. diff --git a/types/prosemirror-commands/index.d.ts b/types/prosemirror-commands/index.d.ts index 5f8cb75946..1f6fbee7b3 100644 --- a/types/prosemirror-commands/index.d.ts +++ b/types/prosemirror-commands/index.d.ts @@ -3,21 +3,21 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.3 -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. - -import { MarkType, Node as ProsemirrorNode, NodeType } from 'prosemirror-model'; +import { MarkType, Node as ProsemirrorNode, NodeType, Schema } from 'prosemirror-model'; import { EditorState, Transaction } from 'prosemirror-state'; import { EditorView } from 'prosemirror-view'; /** * Delete the selection, if there is one. */ -export function deleteSelection(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function deleteSelection( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * If the selection is empty and at the start of a textblock, try to * reduce the distance between that block and the one before it—if @@ -27,7 +27,11 @@ export function deleteSelection(state: EditorState, dispatch?: (tr: Transaction) * into a parent of the previous block. Will use the view for accurate * (bidi-aware) start-of-textblock detection if given. */ -export function joinBackward(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView): boolean; +export function joinBackward( + state: EditorState, + dispatch?: (tr: Transaction) => void, + view?: EditorView +): boolean; /** * When the selection is empty and at the start of a textblock, select * the node before that textblock, if possible. This is intended to be @@ -36,7 +40,11 @@ export function joinBackward(state: EditorState, dispatch?: (tr: Transaction) => * commands, as a fall-back behavior when the schema doesn't allow * deletion at the selected point. */ -export function selectNodeBackward(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView): boolean; +export function selectNodeBackward( + state: EditorState, + dispatch?: (tr: Transaction) => void, + view?: EditorView +): boolean; /** * If the selection is empty and the cursor is at the end of a * textblock, try to reduce or remove the boundary between that block @@ -44,7 +52,11 @@ export function selectNodeBackward(state: EditorState, dispatch?: (tr: Transacti * block closer to this one in the tree structure. Will use the view * for accurate start-of-textblock detection if given. */ -export function joinForward(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView): boolean; +export function joinForward( + state: EditorState, + dispatch?: (tr: Transaction) => void, + view?: EditorView +): boolean; /** * When the selection is empty and at the end of a textblock, select * the node coming after that textblock, if possible. This is intended @@ -53,74 +65,117 @@ export function joinForward(state: EditorState, dispatch?: (tr: Transaction) => * commands, to provide a fall-back behavior when the schema doesn't * allow deletion at the selected point. */ -export function selectNodeForward(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView): boolean; +export function selectNodeForward( + state: EditorState, + dispatch?: (tr: Transaction) => void, + view?: EditorView +): boolean; /** * Join the selected block or, if there is a text selection, the * closest ancestor block of the selection that can be joined, with * the sibling above it. */ -export function joinUp(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function joinUp( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * Join the selected block, or the closest ancestor of the selection * that can be joined, with the sibling after it. */ -export function joinDown(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function joinDown( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * Lift the selected block, or the closest ancestor block of the * selection that can be lifted, out of its parent node. */ -export function lift(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function lift( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * If the selection is in a node whose type has a truthy * [`code`](#model.NodeSpec.code) property in its spec, replace the * selection with a newline character. */ -export function newlineInCode(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function newlineInCode( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * When the selection is in a node with a truthy * [`code`](#model.NodeSpec.code) property in its spec, create a * default block after the code block, and move the cursor there. */ -export function exitCode(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function exitCode( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * If a block node is selected, create an empty paragraph before (if * it is its parent's first child) or after it. */ -export function createParagraphNear(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function createParagraphNear( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * If the cursor is in an empty textblock that can be lifted, lift the * block. */ -export function liftEmptyBlock(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function liftEmptyBlock( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * Split the parent block of the selection. If the selection is a text * selection, also delete its content. */ -export function splitBlock(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function splitBlock( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * Acts like [`splitBlock`](#commands.splitBlock), but without * resetting the set of active marks at the cursor. */ -export function splitBlockKeepMarks(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function splitBlockKeepMarks( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * Move the selection to the node wrapping the current selection, if * any. (Will not select the document node.) */ -export function selectParentNode(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function selectParentNode( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * Select the whole document. */ -export function selectAll(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function selectAll( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * Wrap the selection in a node of the given type with the given * attributes. */ -export function wrapIn(nodeType: NodeType, attrs?: { [key: string]: any }): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; +export function wrapIn( + nodeType: NodeType, + attrs?: { [key: string]: any } +): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; /** * Returns a command that tries to set the textblock around the * selection to the given node type with the given attributes. */ -export function setBlockType(nodeType: NodeType, attrs?: { [key: string]: any }): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; +export function setBlockType( + nodeType: NodeType, + attrs?: { [key: string]: any } +): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; /** * Create a command function that toggles the given mark with the * given attributes. Will return `false` when the current selection @@ -130,7 +185,10 @@ export function setBlockType(nodeType: NodeType, attrs?: { [key: string]: any }) * marks](#state.EditorState.storedMarks) instead of a range of the * document. */ -export function toggleMark(markType: MarkType, attrs?: { [key: string]: any }): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; +export function toggleMark( + markType: MarkType, + attrs?: { [key: string]: any } +): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; /** * Wrap a command so that, when it produces a transform that causes * two joinable nodes to end up next to each other, those are joined. @@ -139,17 +197,19 @@ export function toggleMark(markType: MarkType, attrs?: { [key: string]: any }): * array of strings was passed, if their node type name is in that * array. */ -export function autoJoin( - command: (state: EditorState, p1?: (tr: Transaction) => void) => boolean, - isJoinable: ((before: ProsemirrorNode, after: ProsemirrorNode) => boolean) | string[] -): (state: EditorState, p1?: (tr: Transaction) => void) => boolean; +export function autoJoin( + command: (state: EditorState, p1?: (tr: Transaction) => void) => boolean, + isJoinable: ((before: ProsemirrorNode, after: ProsemirrorNode) => boolean) | string[] +): (state: EditorState, p1?: (tr: Transaction) => void) => boolean; /** * Combine a number of command functions into a single function (which * calls them one by one until one returns true). */ -export function chainCommands( - ...commands: Array<(p1: EditorState, p2?: (tr: Transaction) => void, p3?: EditorView) => boolean> -): (p1: EditorState, p2?: (tr: Transaction) => void, p3?: EditorView) => boolean; +export function chainCommands( + ...commands: Array< + (p1: EditorState, p2?: (tr: Transaction) => void, p3?: EditorView) => boolean + > +): (p1: EditorState, p2?: (tr: Transaction) => void, p3?: EditorView) => boolean; /** * A basic keymap containing bindings not specific to any schema. * Binds the following keys (when multiple commands are listed, they diff --git a/types/prosemirror-gapcursor/index.d.ts b/types/prosemirror-gapcursor/index.d.ts index 41edf50e3f..c1fe56425d 100644 --- a/types/prosemirror-gapcursor/index.d.ts +++ b/types/prosemirror-gapcursor/index.d.ts @@ -3,12 +3,9 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. +// TypeScript Version: 2.3 import { Plugin, Selection } from 'prosemirror-state'; @@ -16,8 +13,7 @@ import { Plugin, Selection } from 'prosemirror-state'; * Gap cursor selections are represented using this class. Its * `$anchor` and `$head` properties both point at the cursor position. */ -export class GapCursor extends Selection { -} +export class GapCursor extends Selection { } /** * Create a gap cursor plugin. When enabled, this will capture clicks * near and arrow-key-motion past places that don't have a normally diff --git a/types/prosemirror-history/index.d.ts b/types/prosemirror-history/index.d.ts index 4fbb59ecb9..5d62c9267c 100644 --- a/types/prosemirror-history/index.d.ts +++ b/types/prosemirror-history/index.d.ts @@ -3,13 +3,11 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. +// TypeScript Version: 2.3 +import { Schema } from 'prosemirror-model'; import { EditorState, Plugin, Transaction } from 'prosemirror-state'; /** @@ -17,7 +15,7 @@ import { EditorState, Plugin, Transaction } from 'prosemirror-state'; * from being appended to an existing history event (so that they * require a separate undo command to undo). */ -export function closeHistory(tr: Transaction): Transaction; +export function closeHistory(tr: Transaction): Transaction; /** * Returns a plugin that enables the undo history for an editor. The * plugin will track undo and redo stacks, which can be used with the @@ -27,15 +25,21 @@ export function closeHistory(tr: Transaction): Transaction; * property](#state.Transaction.setMeta) of `false` on a transaction * to prevent it from being rolled back by undo. */ -export function history(config?: { depth?: number | null, newGroupDelay?: number | null }): Plugin; +export function history(config?: { depth?: number | null; newGroupDelay?: number | null }): Plugin; /** * A command function that undoes the last change, if any. */ -export function undo(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function undo( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * A command function that redoes the last undone change, if any. */ -export function redo(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function redo( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * The amount of undoable events available in a given state. */ diff --git a/types/prosemirror-inputrules/index.d.ts b/types/prosemirror-inputrules/index.d.ts index a75dc9cff5..7c405530e0 100644 --- a/types/prosemirror-inputrules/index.d.ts +++ b/types/prosemirror-inputrules/index.d.ts @@ -3,14 +3,11 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.3 -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. - -import { Node as ProsemirrorNode, NodeType } from 'prosemirror-model'; +import { Node as ProsemirrorNode, NodeType, Schema } from 'prosemirror-model'; import { EditorState, Plugin, Transaction } from 'prosemirror-state'; /** @@ -19,7 +16,7 @@ import { EditorState, Plugin, Transaction } from 'prosemirror-state'; * changing two dashes into an emdash, wrapping a paragraph starting * with `"> "` into a blockquote, or something entirely different. */ -export class InputRule { +export class InputRule { /** * Create an input rule. The rule applies when the user typed * something and the text directly in front of the cursor matches @@ -36,19 +33,34 @@ export class InputRule { * return a [transaction](#state.Transaction) that describes the * rule's effect, or null to indicate the input was not handled. */ - constructor(match: RegExp, handler: string | ((state: EditorState, match: string[], start: number, end: number) => Transaction | null | void)); + constructor( + match: RegExp, + handler: + | string + | (( + state: EditorState, + match: string[], + start: number, + end: number + ) => Transaction | null | void) + ); } /** * Create an input rules plugin. When enabled, it will cause text * input that matches any of the given rules to trigger the rule's * action. */ -export function inputRules(config: { rules: InputRule[] }): Plugin; +export function inputRules(config: { + rules: Array>; +}): Plugin; /** * This is a command that will undo an input rule, if applying such a * rule was the last thing that the user did. */ -export function undoInputRule(state: EditorState, dispatch?: (p: Transaction) => void): boolean; +export function undoInputRule( + state: EditorState, + dispatch?: (p: Transaction) => void +): boolean; /** * Build an input rule for automatically wrapping a textblock when a * given string is typed. The `regexp` argument is @@ -66,12 +78,12 @@ export function undoInputRule(state: EditorState, dispatch?: (p: Transaction) => * expression match and the node before the wrapped node, and can * return a boolean to indicate whether a join should happen. */ -export function wrappingInputRule( +export function wrappingInputRule( regexp: RegExp, - nodeType: NodeType, + nodeType: NodeType, getAttrs?: { [key: string]: any } | ((p: string[]) => { [key: string]: any } | null | void), - joinPredicate?: (p1: string[], p2: ProsemirrorNode) => boolean -): InputRule; + joinPredicate?: (p1: string[], p2: ProsemirrorNode) => boolean +): InputRule; /** * Build an input rule that changes the type of a textblock when the * matched text is typed into it. You'll usually want to start your @@ -80,7 +92,11 @@ export function wrappingInputRule( * the new node's attributes, and works the same as in the * `wrappingInputRule` function. */ -export function textblockTypeInputRule(regexp: RegExp, nodeType: NodeType, getAttrs?: { [key: string]: any } | ((p: string[]) => { [key: string]: any } | null | void)): InputRule; +export function textblockTypeInputRule( + regexp: RegExp, + nodeType: NodeType, + getAttrs?: { [key: string]: any } | ((p: string[]) => { [key: string]: any } | null | void) +): InputRule; /** * Converts double dashes to an emdash. */ diff --git a/types/prosemirror-keymap/index.d.ts b/types/prosemirror-keymap/index.d.ts index 2e049948d5..8b418b08f5 100644 --- a/types/prosemirror-keymap/index.d.ts +++ b/types/prosemirror-keymap/index.d.ts @@ -3,12 +3,9 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. +// TypeScript Version: 2.3 import { Plugin } from 'prosemirror-state'; import { EditorView } from 'prosemirror-view'; @@ -50,4 +47,6 @@ export function keymap(bindings: { [key: string]: any }): Plugin; * [`keymap`](#keymap.keymap), return a [keydown * handler](#view.EditorProps.handleKeyDown) handles them. */ -export function keydownHandler(bindings: { [key: string]: any }): (view: EditorView, event: Event) => boolean; +export function keydownHandler(bindings: { + [key: string]: any; +}): (view: EditorView, event: Event) => boolean; diff --git a/types/prosemirror-markdown/index.d.ts b/types/prosemirror-markdown/index.d.ts index 6617166c6e..7af366c04e 100644 --- a/types/prosemirror-markdown/index.d.ts +++ b/types/prosemirror-markdown/index.d.ts @@ -3,12 +3,9 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. +// TypeScript Version: 2.3 import { MarkdownIt } from 'markdown-it'; import { Node as ProsemirrorNode, Schema } from 'prosemirror-model'; @@ -19,7 +16,7 @@ import { Node as ProsemirrorNode, Schema } from 'prosemirror-model'; * tokenize a file, and then runs the custom rules it is given over * the tokens to create a ProseMirror document tree. */ -export class MarkdownParser { +export class MarkdownParser { /** * Create a parser with the given configuration. You can configure * the markdown-it parser to parse the dialect you want, and provide @@ -58,7 +55,7 @@ export class MarkdownParser { * **`ignore`**`: ?bool` * : When true, ignore content for the matched token. */ - constructor(schema: Schema, tokenizer: MarkdownIt, tokens: { [key: string]: any }); + constructor(schema: S, tokenizer: MarkdownIt, tokens: { [key: string]: any }); /** * The value of the `tokens` object used to construct * this parser. Can be useful to copy and modify to base other @@ -70,7 +67,7 @@ export class MarkdownParser { * and create a ProseMirror document as prescribed by this parser's * rules. */ - parse(text: string): ProsemirrorNode; + parse(text: string): ProsemirrorNode; } /** * A parser parsing unextended [CommonMark](http://commonmark.org/), @@ -81,13 +78,23 @@ export let defaultMarkdownParser: MarkdownParser; * A specification for serializing a ProseMirror document as * Markdown/CommonMark text. */ -export class MarkdownSerializer { - constructor(nodes: { [name: string]: (state: MarkdownSerializerState, node: ProsemirrorNode, parent: ProsemirrorNode, index: number) => void }, marks: { [key: string]: any }); +export class MarkdownSerializer { + constructor( + nodes: { + [name: string]: ( + state: MarkdownSerializerState, + node: ProsemirrorNode, + parent: ProsemirrorNode, + index: number + ) => void; + }, + marks: { [key: string]: any } + ); /** * The node serializer * functions for this serializer. */ - nodes: { [name: string]: (p1: MarkdownSerializerState, p2: ProsemirrorNode) => void }; + nodes: { [name: string]: (p1: MarkdownSerializerState, p2: ProsemirrorNode) => void }; /** * The mark serializer info. */ @@ -96,7 +103,7 @@ export class MarkdownSerializer { * Serialize the content of the given node to * [CommonMark](http://commonmark.org/). */ - serialize(content: ProsemirrorNode, options?: { [key: string]: any }): string; + serialize(content: ProsemirrorNode, options?: { [key: string]: any }): string; } /** * A serializer for the [basic schema](#schema). @@ -107,7 +114,7 @@ export let defaultMarkdownSerializer: MarkdownSerializer; * methods related to markdown serialization. Instances are passed to * node and mark serialization methods (see `toMarkdown`). */ -export class MarkdownSerializerState { +export class MarkdownSerializerState { /** * The options passed to the serializer. */ @@ -118,7 +125,12 @@ export class MarkdownSerializerState { * the end of the block, and `f` is a function that renders the * content of the block. */ - wrapBlock(delim: string, firstDelim: string | undefined, node: ProsemirrorNode, f: () => void): void; + wrapBlock( + delim: string, + firstDelim: string | undefined, + node: ProsemirrorNode, + f: () => void + ): void; /** * Ensure the current content ends with a newline. */ @@ -132,7 +144,7 @@ export class MarkdownSerializerState { /** * Close the block for the given node. */ - closeBlock(node: ProsemirrorNode): void; + closeBlock(node: ProsemirrorNode): void; /** * Add the given text to the document. When escape is not `false`, * it will be escaped. @@ -141,22 +153,22 @@ export class MarkdownSerializerState { /** * Render the given node as a block. */ - render(node: ProsemirrorNode): void; + render(node: ProsemirrorNode): void; /** * Render the contents of `parent` as block nodes. */ - renderContent(parent: ProsemirrorNode): void; + renderContent(parent: ProsemirrorNode): void; /** * Render the contents of `parent` as inline content. */ - renderInline(parent: ProsemirrorNode): void; + renderInline(parent: ProsemirrorNode): void; /** * Render a node's content as a list. `delim` should be the extra * indentation added to all lines except the first in an item, * `firstDelim` is a function going from an item index to a * delimiter for the first line of the item. */ - renderList(node: ProsemirrorNode, delim: string, firstDelim: (p: number) => string): void; + renderList(node: ProsemirrorNode, delim: string, firstDelim: (p: number) => string): void; /** * Escape the given string so that it can safely appear in Markdown * content. If `startOfLine` is true, also escape characters that @@ -172,5 +184,5 @@ export class MarkdownSerializerState { * leading or trailing property of the return object will be undefined * if there is no match. */ - getEnclosingWhitespace(text: string): { leading?: string | null, trailing?: string | null }; + getEnclosingWhitespace(text: string): { leading?: string | null; trailing?: string | null }; } diff --git a/types/prosemirror-menu/index.d.ts b/types/prosemirror-menu/index.d.ts index 898fdffd20..75cc56966d 100644 --- a/types/prosemirror-menu/index.d.ts +++ b/types/prosemirror-menu/index.d.ts @@ -3,14 +3,11 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.3 -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. - -import { NodeType } from 'prosemirror-model'; +import { NodeType, Schema } from 'prosemirror-model'; import { EditorState, Plugin, Transaction } from 'prosemirror-state'; import { EditorView } from 'prosemirror-view'; @@ -19,61 +16,61 @@ import { EditorView } from 'prosemirror-view'; * display in your menu. Anything that conforms to this interface can * be put into a menu structure. */ -export interface MenuElement { +export interface MenuElement { /** * Render the element for display in the menu. Must return a DOM * element and a function that can be used to update the element to * a new state. The `update` function will return false if the * update hid the entire element. */ - render(pm: EditorView): { dom: Node, update(p: EditorState): boolean }; + render(pm: EditorView): { dom: Node; update(p: EditorState): boolean }; } /** * An icon or label that, when clicked, executes a command. */ -export class MenuItem { - constructor(spec: MenuItemSpec); +export class MenuItem { + constructor(spec: MenuItemSpec); /** * The spec used to create the menu item. */ - spec: MenuItemSpec; + spec: MenuItemSpec; /** * Renders the icon according to its [display * spec](#menu.MenuItemSpec.display), and adds an event handler which * executes the command when the representation is clicked. */ - render(view: EditorView): { dom: Node, update(p: EditorState): boolean }; + render(view: EditorView): { dom: Node; update(p: EditorState): boolean }; } /** * The configuration object passed to the `MenuItem` constructor. */ -export interface MenuItemSpec { +export interface MenuItemSpec { /** * The function to execute when the menu item is activated. */ - run(p1: EditorState, p2: (p: Transaction) => void, p3: EditorView, p4: Event): void; + run(p1: EditorState, p2: (p: Transaction) => void, p3: EditorView, p4: Event): void; /** * Optional function that is used to determine whether the item is * appropriate at the moment. Deselected items will be hidden. */ - select?: ((p: EditorState) => boolean) | null; + select?: ((p: EditorState) => boolean) | null; /** * Function that is used to determine if the item is enabled. If * given and returning false, the item will be given a disabled * styling. */ - enable?: ((p: EditorState) => boolean) | null; + enable?: ((p: EditorState) => boolean) | null; /** * A predicate function to determine whether the item is 'active' (for * example, the item for toggling the strong mark might be active then * the cursor is in strong text). */ - active?: ((p: EditorState) => boolean) | null; + active?: ((p: EditorState) => boolean) | null; /** * A function that renders the item. You must provide either this, * [`icon`](#menu.MenuItemSpec.icon), or [`label`](#MenuItemSpec.label). */ - render?: ((p: EditorView) => Node) | null; + render?: ((p: EditorView) => Node) | null; /** * Describes an icon to show for this item. The object may specify * an SVG icon, in which case its `path` property should be an [SVG @@ -95,7 +92,7 @@ export interface MenuItemSpec { /** * Defines DOM title (mouseover) text for the item. */ - title?: string | ((p: EditorState) => string) | null; + title?: string | ((p: EditorState) => string) | null; /** * Optionally adds a CSS class to the item's DOM representation. */ @@ -115,7 +112,7 @@ export interface MenuItemSpec { * A drop-down menu, displayed as a label with a downwards-pointing * triangle to the right of it. */ -export class Dropdown { +export class Dropdown { /** * Create a dropdown wrapping the elements. Options may include * the following properties: @@ -134,17 +131,17 @@ export class Dropdown { * **`css`**`: string` * : When given, adds an extra set of CSS styles to the menu control. */ - constructor(content: MenuElement[], options?: { [key: string]: any }); + constructor(content: Array>, options?: { [key: string]: any }); /** * Render the dropdown menu and sub-items. */ - render(view: EditorView): { dom: Node, update(p: EditorState): void }; + render(view: EditorView): { dom: Node; update(p: EditorState): void }; } /** * Represents a submenu wrapping a group of elements that start * hidden and expand to the right when hovered over or tapped. */ -export class DropdownSubmenu { +export class DropdownSubmenu { /** * Creates a submenu for the given group of menu elements. The * following options are recognized: @@ -152,11 +149,11 @@ export class DropdownSubmenu { * **`label`**`: string` * : The label to show on the submenu. */ - constructor(content: MenuElement[], options?: { [key: string]: any }); + constructor(content: Array>, options?: { [key: string]: any }); /** * Renders the submenu. */ - render(view: EditorView): { dom: Node, update(p: EditorState): boolean }; + render(view: EditorView): { dom: Node; update(p: EditorState): boolean }; } /** * Render the given, possibly nested, array of menu elements into a @@ -164,7 +161,10 @@ export class DropdownSubmenu { * superfluous separators appear when some of the groups turn out to * be empty). */ -export function renderGrouped(view: EditorView, content: Array): { dom?: DocumentFragment | null, update(p: EditorState): boolean }; +export function renderGrouped( + view: EditorView, + content: Array | Array>> +): { dom?: DocumentFragment | null; update(p: EditorState): boolean }; /** * A set of basic editor-related icons. Contains the properties * `join`, `lift`, `selectParentNode`, `undo`, `redo`, `strong`, `em`, @@ -199,16 +199,25 @@ export function redoItem(p: { [key: string]: any }): MenuItem; * `options`. `options.attrs` may be an object or a function, as in * `toggleMarkItem`. */ -export function wrapItem(nodeType: NodeType, options: { [key: string]: any }): MenuItem; +export function wrapItem( + nodeType: NodeType, + options: { [key: string]: any } +): MenuItem; /** * Build a menu item for changing the type of the textblock around the * selection to the given type. Provides `run`, `active`, and `select` * properties. Others must be given in `options`. `options.attrs` may * be an object to provide the attributes for the textblock node. */ -export function blockTypeItem(nodeType: NodeType, options: { [key: string]: any }): MenuItem; +export function blockTypeItem( + nodeType: NodeType, + options: { [key: string]: any } +): MenuItem; /** * A plugin that will place a menu bar above the editor. Note that * this involves wrapping the editor in an additional `

`. */ -export function menuBar(options: { content: MenuElement[][], floating?: boolean | null }): Plugin; +export function menuBar(options: { + content: Array>>; + floating?: boolean | null; +}): Plugin; diff --git a/types/prosemirror-model/index.d.ts b/types/prosemirror-model/index.d.ts index 153358e3c6..adb8a6141c 100644 --- a/types/prosemirror-model/index.d.ts +++ b/types/prosemirror-model/index.d.ts @@ -1,15 +1,12 @@ -// Type definitions for prosemirror-model 1.1 +// Type definitions for prosemirror-model 1.4 // Project: https://github.com/ProseMirror/prosemirror-model // Definitions by: Bradley Ayers // David Hahn // Tim Baumann // Malte Blanken +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. +// TypeScript Version: 2.3 import OrderedMap = require('orderedmap'); @@ -19,7 +16,17 @@ import OrderedMap = require('orderedmap'); * used to find out whether further content matches here, and whether * a given position is a valid end of the node. */ -export class ContentMatch { +export class ContentMatch { + /** + * Get the first matching node type at this match position that can + * be generated. + */ + defaultType?: NodeType; + /** + * The number of outgoing edges this node has in the finite automaton + * that describes the content expression. + */ + edgeCount: number; /** * True when this match state represents a valid end of the node. */ @@ -28,12 +35,12 @@ export class ContentMatch { * Match a node type and marks, returning a match after that node * if successful. */ - matchType(type: NodeType): ContentMatch | null | void; + matchType(type: NodeType): ContentMatch | null | void; /** * Try to match a fragment. Returns the resulting match when * successful. */ - matchFragment(frag: Fragment, start?: number, end?: number): ContentMatch | null | void; + matchFragment(frag: Fragment, start?: number, end?: number): ContentMatch | null | void; /** * Try to match the given fragment, and if that fails, see if it can * be made to match by inserting nodes in front of it. When @@ -42,14 +49,19 @@ export class ContentMatch { * return a fragment if the resulting match goes to the end of the * content expression. */ - fillBefore(after: Fragment, toEnd?: boolean, startIndex?: number): Fragment | null | void; + fillBefore(after: Fragment, toEnd?: boolean, startIndex?: number): Fragment | null | void; /** * Find a set of wrapping node types that would allow a node of the * given type to appear at this position. The result may be empty * (when it fits directly) and will be null when no such wrapping * exists. */ - findWrapping(target: NodeType): NodeType[] | null | void; + findWrapping(target: NodeType): Array> | null | void; + /** + * Get the _n_th outgoing edge from this node in the finite automaton + * that describes the content expression. + */ + edge(n: number): { type: NodeType; next: ContentMatch }; } /** * A fragment represents a node's collection of child nodes. @@ -58,7 +70,7 @@ export class ContentMatch { * should not mutate them or their content. Rather, you create new * instances whenever needed. The API tries to make this easy. */ -export class Fragment { +export class Fragment { /** * The size of the fragment, which is the total of the size of its * content nodes. @@ -69,38 +81,54 @@ export class Fragment { * positions (relative to start of this fragment). Doesn't descend * into a node when the callback returns `false`. */ - nodesBetween(from: number, to: number, f: (node: ProsemirrorNode, start: number, parent: ProsemirrorNode, index: number) => boolean | null | void): void; + nodesBetween( + from: number, + to: number, + f: ( + node: ProsemirrorNode, + start: number, + parent: ProsemirrorNode, + index: number + ) => boolean | null | void, + startPos?: number + ): void; /** * Call the given callback for every descendant node. The callback * may return `false` to prevent traversal of a given node's children. */ - descendants(f: (node: ProsemirrorNode, pos: number, parent: ProsemirrorNode) => boolean | null | void): void; + descendants( + f: ( + node: ProsemirrorNode, + pos: number, + parent: ProsemirrorNode + ) => boolean | null | void + ): void; /** * Create a new fragment containing the combined content of this * fragment and the other. */ - append(other: Fragment): Fragment; + append(other: Fragment): Fragment; /** * Cut out the sub-fragment between the two given positions. */ - cut(from: number, to?: number): Fragment; + cut(from: number, to?: number): Fragment; /** * Create a new fragment in which the node at the given index is * replaced by the given node. */ - replaceChild(index: number, node: ProsemirrorNode): Fragment; + replaceChild(index: number, node: ProsemirrorNode): Fragment; /** * Compare this fragment to another one. */ - eq(other: Fragment): boolean; + eq(other: Fragment): boolean; /** * The first child of the fragment, or `null` if it is empty. */ - firstChild?: ProsemirrorNode | null; + firstChild?: ProsemirrorNode | null; /** * The last child of the fragment, or `null` if it is empty. */ - lastChild?: ProsemirrorNode | null; + lastChild?: ProsemirrorNode | null; /** * The number of child nodes in this fragment. */ @@ -109,28 +137,28 @@ export class Fragment { * Get the child node at the given index. Raise an error when the * index is out of range. */ - child(index: number): ProsemirrorNode; + child(index: number): ProsemirrorNode; /** * Get the child node at the given index, if it exists. */ - maybeChild(index: number): ProsemirrorNode | null | void; + maybeChild(index: number): ProsemirrorNode | null | void; /** * Call `f` for every child node, passing the node, its offset * into this parent node, and its index. */ - forEach(f: (node: ProsemirrorNode, offset: number, index: number) => void): void; + forEach(f: (node: ProsemirrorNode, offset: number, index: number) => void): void; /** * Find the first position at which this fragment and another * fragment differ, or `null` if they are the same. */ - findDiffStart(other: Fragment): number | null | void; + findDiffStart(other: Fragment): number | null | void; /** * Find the first position, searching from the end, at which this * fragment and the given fragment differ, or `null` if they are the * same. Since this position will not be the same in both nodes, an * object with two separate positions is returned. */ - findDiffEnd(other: ProsemirrorNode): { a: number, b: number } | null | void; + findDiffEnd(other: ProsemirrorNode): { a: number; b: number } | null | void; /** * Return a debugging string that describes this fragment. */ @@ -142,19 +170,24 @@ export class Fragment { /** * Deserialize a fragment from its JSON representation. */ - static fromJSON(schema: Schema, value?: { [key: string]: any }): Fragment; + static fromJSON( + schema: S, + value?: { [key: string]: any } + ): Fragment; /** * Build a fragment from an array of nodes. Ensures that adjacent * text nodes with the same marks are joined together. */ - static fromArray(array: ProsemirrorNode[]): Fragment; + static fromArray(array: Array>): Fragment; /** * Create a fragment from something that can be interpreted as a set * of nodes. For `null`, it returns the empty fragment. For a * fragment, the fragment itself. For a node or array of nodes, a * fragment containing those nodes. */ - static from(nodes?: Fragment | ProsemirrorNode | ProsemirrorNode[]): Fragment; + static from( + nodes?: Fragment | ProsemirrorNode | Array> + ): Fragment; /** * An empty fragment. Intended to be reused whenever a node doesn't * contain anything (rather than allocating a new empty fragment for @@ -167,13 +200,13 @@ export class Fragment { * [`parse`](#model.DOMParser.parse) and * [`parseSlice`](#model.DOMParser.parseSlice) methods. */ -export interface ParseOptions { +export interface ParseOptions { /** * By default, whitespace is collapsed as per HTML's rules. Pass * `true` to preserve whitespace, but normalize newlines to * spaces, and `"full"` to preserve whitespace entirely. */ - preserveWhitespace?: boolean | "full" | null; + preserveWhitespace?: boolean | 'full' | null; /** * When given, the parser will, beside parsing the content, * record the document positions of the given DOM positions. It @@ -181,7 +214,7 @@ export interface ParseOptions { * that holds the document position. DOM positions that are not * in the parsed content will not be written to. */ - findPositions?: Array<{ node: Node, offset: number }> | null; + findPositions?: Array<{ node: Node; offset: number }> | null; /** * The child node index to start parsing from. */ @@ -196,7 +229,7 @@ export interface ParseOptions { * option to use the type and attributes from a different node * as the top container. */ - topNode?: ProsemirrorNode | null; + topNode?: ProsemirrorNode | null; /** * Provide the starting content match that content parsed into the * top node is matched against. @@ -207,13 +240,13 @@ export interface ParseOptions { * [context](#model.ParseRule.context) when parsing, above the * given [top node](#model.ParseOptions.topNode). */ - context?: ResolvedPos | null; + context?: ResolvedPos | null; } /** * A value that describes how to parse a given DOM node or inline * style as a ProseMirror node or mark. */ -export interface ParseRule { +export interface ParseRule { /** * A CSS selector describing the kind of DOM elements to match. A * single rule should have _either_ a `tag` or a `style` property. @@ -308,7 +341,7 @@ export interface ParseRule { * present, instead of parsing the node's child nodes, the result of * this function is used. */ - getContent?: ((p: Node) => Fragment) | null; + getContent?: ((p: Node) => Fragment) | null; /** * Controls whether whitespace should be preserved when parsing the * content inside the matched element. `false` means whitespace may @@ -316,32 +349,32 @@ export interface ParseRule { * but newlines normalized to spaces, and `"full"` means that * newlines should also be preserved. */ - preserveWhitespace?: boolean | "full" | null; + preserveWhitespace?: boolean | 'full' | null; } /** * A DOM parser represents a strategy for parsing DOM content into * a ProseMirror document conforming to a given schema. Its behavior * is defined by an array of [rules](#model.ParseRule). */ -export class DOMParser { +export class DOMParser { /** * Create a parser that targets the given schema, using the given * parsing rules. */ - constructor(schema: Schema, rules: ParseRule[]); + constructor(schema: S, rules: Array>); /** * The schema into which the parser parses. */ - schema: Schema; + schema: S; /** * The set of [parse rules](#model.ParseRule) that the parser * uses, in order of precedence. */ - rules: ParseRule[]; + rules: Array>; /** * Parse a document from the content of a DOM node. */ - parse(dom: Node, options?: ParseOptions): ProsemirrorNode; + parse(dom: Node, options?: ParseOptions): ProsemirrorNode; /** * Parses the content of the given DOM node, like * [`parse`](#model.DOMParser.parse), and takes the same set of @@ -350,13 +383,13 @@ export class DOMParser { * the schema constraints aren't applied to the start of nodes to * the left of the input and the end of nodes at the end. */ - parseSlice(dom: Node, options?: ParseOptions): Slice; + parseSlice(dom: Node, options?: ParseOptions): Slice; /** * Construct a DOM parser using the parsing rules listed in a * schema's [node specs](#model.NodeSpec.parseDOM), reordered by * [priority](#model.ParseRule.priority). */ - static fromSchema(schema: Schema): DOMParser; + static fromSchema(schema: S): DOMParser; } /** * A mark is a piece of information that can be attached to a node, @@ -366,11 +399,11 @@ export class DOMParser { * `Schema`, which controls which types exist and which * attributes they have. */ -export class Mark { +export class Mark { /** * The type of this mark. */ - type: MarkType; + type: MarkType; /** * The attributes associated with this mark. */ @@ -382,35 +415,35 @@ export class Mark { * [exclusive](#model.MarkSpec.excludes) with this mark are present, * those are replaced by this one. */ - addToSet(set: Mark[]): Mark[]; + addToSet(set: Array>): Array>; /** * Remove this mark from the given set, returning a new set. If this * mark is not in the set, the set itself is returned. */ - removeFromSet(set: Mark[]): Mark[]; + removeFromSet(set: Array>): Array>; /** * Test whether this mark is in the given set of marks. */ - isInSet(set: Mark[]): boolean; + isInSet(set: Array>): boolean; /** * Test whether this mark has the same type and attributes as * another mark. */ - eq(other: Mark): boolean; + eq(other: Mark): boolean; /** * Convert this mark to a JSON-serializeable representation. */ toJSON(): { [key: string]: any }; - static fromJSON(schema: Schema, json: { [key: string]: any }): Mark; + static fromJSON(schema: S, json: { [key: string]: any }): Mark; /** * Test whether two sets of marks are identical. */ - static sameSet(a: Mark[], b: Mark[]): boolean; + static sameSet(a: Array>, b: Array>): boolean; /** * Create a properly sorted mark set from null, a single mark, or an * unsorted array of marks. */ - static setFrom(marks?: Mark | Mark[]): Mark[]; + static setFrom(marks?: Mark | Array>): Array>; /** * The empty set of marks. */ @@ -430,11 +463,11 @@ export class Mark { * **Do not** directly mutate the properties of a `Node` object. See * [the guide](/docs/guide/#doc) for more information. */ -declare class ProsemirrorNode { +declare class ProsemirrorNode { /** * The type of node that this is. */ - type: NodeType; + type: NodeType; /** * An object mapping attribute names to values. The kind of * attributes allowed and required are @@ -444,12 +477,12 @@ declare class ProsemirrorNode { /** * A container holding the node's children. */ - content: Fragment; + content: Fragment; /** * The marks (things like whether it is emphasized or part of a * link) applied to this node. */ - marks: Mark[]; + marks: Array>; /** * For text nodes, this contains the node's text content. */ @@ -470,16 +503,16 @@ declare class ProsemirrorNode { * Get the child node at the given index. Raises an error when the * index is out of range. */ - child(index: number): ProsemirrorNode; + child(index: number): ProsemirrorNode; /** * Get the child node at the given index, if it exists. */ - maybeChild(index: number): ProsemirrorNode | null | void; + maybeChild(index: number): ProsemirrorNode | null | void; /** * Call `f` for every child node, passing the node, its offset * into this parent node, and its index. */ - forEach(f: (node: ProsemirrorNode, offset: number, index: number) => void): void; + forEach(f: (node: ProsemirrorNode, offset: number, index: number) => void): void; /** * Invoke a callback for all descendant nodes recursively between * the given two positions that are relative to start of this node's @@ -488,12 +521,28 @@ declare class ProsemirrorNode { * When the callback returns false for a given node, that node's * children will not be recursed over. */ - nodesBetween(from: number, to: number, f: (node: ProsemirrorNode, pos: number, parent: ProsemirrorNode, index: number) => boolean | null | void): void; + nodesBetween( + from: number, + to: number, + f: ( + node: ProsemirrorNode, + pos: number, + parent: ProsemirrorNode, + index: number + ) => boolean | null | void, + startPos?: number + ): void; /** * Call the given callback for every descendant node. Doesn't * descend into a node when the callback returns `false`. */ - descendants(f: (node: ProsemirrorNode, pos: number, parent: ProsemirrorNode) => boolean | null | void): void; + descendants( + f: ( + node: ProsemirrorNode, + pos: number, + parent: ProsemirrorNode + ) => boolean | null | void + ): void; /** * Concatenates all the text nodes found in this fragment and its * children. @@ -510,47 +559,47 @@ declare class ProsemirrorNode { * Returns this node's first child, or `null` if there are no * children. */ - firstChild?: ProsemirrorNode | null; + firstChild?: ProsemirrorNode | null; /** * Returns this node's last child, or `null` if there are no * children. */ - lastChild?: ProsemirrorNode | null; + lastChild?: ProsemirrorNode | null; /** * Test whether two nodes represent the same piece of document. */ - eq(other: ProsemirrorNode): boolean; + eq(other: ProsemirrorNode): boolean; /** * Compare the markup (type, attributes, and marks) of this node to * those of another. Returns `true` if both have the same markup. */ - sameMarkup(other: ProsemirrorNode): boolean; + sameMarkup(other: ProsemirrorNode): boolean; /** * Check whether this node's markup correspond to the given type, * attributes, and marks. */ - hasMarkup(type: NodeType, attrs?: { [key: string]: any }, marks?: Mark[]): boolean; + hasMarkup(type: NodeType, attrs?: { [key: string]: any }, marks?: Array>): boolean; /** * Create a new node with the same markup as this node, containing * the given content (or empty, if no content is given). */ - copy(content?: Fragment): ProsemirrorNode; + copy(content?: Fragment): ProsemirrorNode; /** * Create a copy of this node, with the given set of marks instead * of the node's own marks. */ - mark(marks: Mark[]): ProsemirrorNode; + mark(marks: Array>): ProsemirrorNode; /** * Create a copy of this node with only the content between the * given positions. If `to` is not given, it defaults to the end of * the node. */ - cut(from: number, to?: number): ProsemirrorNode; + cut(from: number, to?: number): ProsemirrorNode; /** * Cut out the part of the document between the given positions, and * return it as a `Slice` object. */ - slice(from: number, to?: number): Slice; + slice(from: number, to?: number): Slice; /** * Replace the part of the document between the given positions with * the given slice. The slice must 'fit', meaning its open sides @@ -559,33 +608,33 @@ declare class ProsemirrorNode { * into. If any of this is violated, an error of type * [`ReplaceError`](#model.ReplaceError) is thrown. */ - replace(from: number, to: number, slice: Slice): ProsemirrorNode; + replace(from: number, to: number, slice: Slice): ProsemirrorNode; /** * Find the node starting at the given position. */ - nodeAt(pos: number): ProsemirrorNode | null | void; + nodeAt(pos: number): ProsemirrorNode | null | void; /** * Find the (direct) child node after the given offset, if any, * and return it along with its index and offset relative to this * node. */ - childAfter(pos: number): { node?: ProsemirrorNode | null, index: number, offset: number }; + childAfter(pos: number): { node?: ProsemirrorNode | null; index: number; offset: number }; /** * Find the (direct) child node before the given offset, if any, * and return it along with its index and offset relative to this * node. */ - childBefore(pos: number): { node?: ProsemirrorNode | null, index: number, offset: number }; + childBefore(pos: number): { node?: ProsemirrorNode | null; index: number; offset: number }; /** * Resolve the given position in the document, returning an * [object](#model.ResolvedPos) with information about its context. */ - resolve(pos: number): ResolvedPos; + resolve(pos: number): ResolvedPos; /** * Test whether a mark of the given type occurs in this document * between the two given positions. */ - rangeHasMark(from: number, to: number, type: MarkType): boolean; + rangeHasMark(from: number, to: number, type: MarkType): boolean; /** * True when this is a block (non-inline node) */ @@ -628,7 +677,7 @@ declare class ProsemirrorNode { /** * Get the content match in this node at the given index. */ - contentMatchAt(index: number): ContentMatch; + contentMatchAt(index: number): ContentMatch; /** * Test whether replacing the range between `from` and `to` (by * child index) with the given replacement fragment (which defaults @@ -636,19 +685,25 @@ declare class ProsemirrorNode { * can optionally pass `start` and `end` indices into the * replacement fragment. */ - canReplace(from: number, to: number, replacement?: Fragment, start?: number, end?: number): boolean; + canReplace( + from: number, + to: number, + replacement?: Fragment, + start?: number, + end?: number + ): boolean; /** * Test whether replacing the range `from` to `to` (by index) with a * node of the given type. */ - canReplaceWith(from: number, to: number, type: NodeType, marks?: Mark[]): boolean; + canReplaceWith(from: number, to: number, type: NodeType, marks?: Array>): boolean; /** * Test whether the given node's content could be appended to this * node. If that node is empty, this will only return true if there * is at least one node type that can appear in both nodes (to avoid * merging completely incompatible nodes). */ - canAppend(other: ProsemirrorNode): boolean; + canAppend(other: ProsemirrorNode): boolean; /** * Check whether this node and its descendants conform to the * schema, and raise error when they do not. @@ -661,21 +716,23 @@ declare class ProsemirrorNode { /** * Deserialize a node from its JSON representation. */ - static fromJSON(schema: Schema, json: { [key: string]: any }): ProsemirrorNode; + static fromJSON( + schema: S, + json: { [key: string]: any } + ): ProsemirrorNode; } export { ProsemirrorNode as Node }; /** * Error type raised by [`Node.replace`](#model.Node.replace) when * given an invalid replacement. */ -export class ReplaceError extends Error { -} +export class ReplaceError extends Error { } /** * A slice represents a piece cut out of a larger document. It * stores not only a fragment, but also the depth up to which nodes on * both side are ‘open’ (cut through). */ -export class Slice { +export class Slice { /** * Create a slice. When specifying a non-zero open depth, you must * make sure that there are nodes of at least that depth at the @@ -688,11 +745,11 @@ export class Slice { * start/end/middle for such a node, depending on which sides are * open. */ - constructor(content: Fragment, openStart: number, openEnd: number); + constructor(content: Fragment, openStart: number, openEnd: number); /** * The slice's content. */ - content: Fragment; + content: Fragment; /** * The open depth at the start. */ @@ -708,7 +765,7 @@ export class Slice { /** * Tests whether this slice is equal to another slice. */ - eq(other: Slice): boolean; + eq(other: Slice): boolean; /** * Convert a slice to a JSON-serializable representation. */ @@ -716,12 +773,15 @@ export class Slice { /** * Deserialize a slice from its JSON representation. */ - static fromJSON(schema: Schema, json?: { [key: string]: any }): Slice; + static fromJSON(schema: S, json?: { [key: string]: any }): Slice; /** * Create a slice from a fragment by taking the maximum possible * open value on both side of the fragment. */ - static maxOpen(fragment: Fragment, openIsolating?: boolean): Slice; + static maxOpen( + fragment: Fragment, + openIsolating?: boolean + ): Slice; /** * The empty slice. */ @@ -737,7 +797,7 @@ export class Slice { * parameter will interpret undefined as `this.depth` and negative * numbers as `this.depth + value`. */ -export class ResolvedPos { +export class ResolvedPos { /** * The position that was resolved. */ @@ -757,16 +817,16 @@ export class ResolvedPos { * a position points into a text node, that node is not considered * the parent—text nodes are ‘flat’ in this model, and have no content. */ - parent: ProsemirrorNode; + parent: ProsemirrorNode; /** * The root node in which the position was resolved. */ - doc: ProsemirrorNode; + doc: ProsemirrorNode; /** * The ancestor node at the given level. `p.node(p.depth)` is the * same as `p.parent`. */ - node(depth?: number): ProsemirrorNode; + node(depth?: number): ProsemirrorNode; /** * The index into the ancestor at the given level. If this points at * the 3rd node in the 2nd paragraph on the top level, for example, @@ -810,20 +870,20 @@ export class ResolvedPos { * points into a text node, only the part of that node after the * position is returned. */ - nodeAfter?: ProsemirrorNode | null; + nodeAfter?: ProsemirrorNode | null; /** * Get the node directly before the position, if any. If the * position points into a text node, only the part of that node * before the position is returned. */ - nodeBefore?: ProsemirrorNode | null; + nodeBefore?: ProsemirrorNode | null; /** * Get the marks at this position, factoring in the surrounding * marks' [`inclusive`](#model.MarkSpec.inclusive) property. If the * position is at the start of a non-empty node, the marks of the * node after it (if any) are returned. */ - marks(): Mark[]; + marks(): Array>; /** * Get the marks after the current position, if any, except those * that are non-inclusive and not present at position `$end`. This @@ -832,7 +892,7 @@ export class ResolvedPos { * its parent node or its parent node isn't a textblock (in which * case no marks should be preserved). */ - marksAcross($end: ResolvedPos): Mark[] | null | void; + marksAcross($end: ResolvedPos): Array> | null | void; /** * The depth up to which this position and the given (non-resolved) * position share the same parent nodes. @@ -847,31 +907,34 @@ export class ResolvedPos { * pass in an optional predicate that will be called with a parent * node to see if a range into that parent is acceptable. */ - blockRange(other?: ResolvedPos, pred?: (p: ProsemirrorNode) => boolean): NodeRange | null | void; + blockRange( + other?: ResolvedPos, + pred?: (p: ProsemirrorNode) => boolean + ): NodeRange | null | void; /** * Query whether the given position shares the same parent node. */ - sameParent(other: ResolvedPos): boolean; + sameParent(other: ResolvedPos): boolean; /** * Return the greater of this and the given position. */ - max(other: ResolvedPos): ResolvedPos; + max(other: ResolvedPos): ResolvedPos; /** * Return the smaller of this and the given position. */ - min(other: ResolvedPos): ResolvedPos; + min(other: ResolvedPos): ResolvedPos; } /** * Represents a flat range of content, i.e. one that starts and * ends in the same node. */ -export class NodeRange { +export class NodeRange { /** * Construct a node range. `$from` and `$to` should point into the * same node until at least the given `depth`, since a node range * denotes an adjacent set of nodes in a single parent node. */ - constructor($from: ResolvedPos, $to: ResolvedPos, depth: number); + constructor($from: ResolvedPos, $to: ResolvedPos, depth: number); /** * A resolved position along the start of the * content. May have a `depth` greater than this object's `depth` @@ -879,12 +942,12 @@ export class NodeRange { * compute the range, not re-resolved positions directly at its * boundaries. */ - $from: ResolvedPos; + $from: ResolvedPos; /** * A position along the end of the content. See * caveat for [`$from`](#model.NodeRange.$from). */ - $to: ResolvedPos; + $to: ResolvedPos; /** * The depth of the node that this range points into. */ @@ -900,7 +963,7 @@ export class NodeRange { /** * The parent node that the range points into. */ - parent: ProsemirrorNode; + parent: ProsemirrorNode; /** * The start index of the range in the parent node. */ @@ -916,7 +979,7 @@ export class NodeRange { * about the node type, such as its name and what kind of node it * represents. */ -export class NodeType { +export class NodeType { /** * The name the node type has in this schema. */ @@ -924,7 +987,7 @@ export class NodeType { /** * A link back to the `Schema` the node type belongs to. */ - schema: Schema; + schema: S; /** * The spec that this type is based on */ @@ -932,7 +995,7 @@ export class NodeType { /** * The starting match of the node type's content expression. */ - contentMatch: ContentMatch; + contentMatch: ContentMatch; /** * True if this node type has inline content. */ @@ -971,13 +1034,21 @@ export class NodeType { * `null`. Similarly `marks` may be `null` to default to the empty * set of marks. */ - create(attrs?: { [key: string]: any }, content?: Fragment | ProsemirrorNode | ProsemirrorNode[], marks?: Mark[]): ProsemirrorNode; + create( + attrs?: { [key: string]: any }, + content?: Fragment | ProsemirrorNode | Array>, + marks?: Array> + ): ProsemirrorNode; /** * Like [`create`](#model.NodeType.create), but check the given content * against the node type's content restrictions, and throw an error * if it doesn't match. */ - createChecked(attrs?: { [key: string]: any }, content?: Fragment | ProsemirrorNode | ProsemirrorNode[], marks?: Mark[]): ProsemirrorNode; + createChecked( + attrs?: { [key: string]: any }, + content?: Fragment | ProsemirrorNode | Array>, + marks?: Array> + ): ProsemirrorNode; /** * Like [`create`](#model.NodeType.create), but see if it is necessary to * add nodes to the start or end of the given fragment to make it @@ -986,24 +1057,28 @@ export class NodeType { * created, this will always succeed if you pass null or * `Fragment.empty` as content. */ - createAndFill(attrs?: { [key: string]: any }, content?: Fragment | ProsemirrorNode | ProsemirrorNode[], marks?: Mark[]): ProsemirrorNode | null | void; + createAndFill( + attrs?: { [key: string]: any }, + content?: Fragment | ProsemirrorNode | Array>, + marks?: Array> + ): ProsemirrorNode | null | void; /** * Returns true if the given fragment is valid content for this node * type with the given attributes. */ - validContent(content: Fragment): boolean; + validContent(content: Fragment): boolean; /** * Check whether the given mark type is allowed in this node. */ - allowsMarkType(markType: MarkType): boolean; + allowsMarkType(markType: MarkType): boolean; /** * Test whether the given set of marks are allowed in this node. */ - allowsMarks(marks: Mark[]): boolean; + allowsMarks(marks: Array>): boolean; /** * Removes the marks that are not allowed in this node from the given set. */ - allowedMarks(marks: Mark[]): Mark[]; + allowedMarks(marks: Array>): Array>; } /** * Like nodes, marks (which are associated with nodes to signify @@ -1011,7 +1086,7 @@ export class NodeType { * [tagged](#model.Mark.type) with type objects, which are * instantiated once per `Schema`. */ -export class MarkType { +export class MarkType { /** * The name of the mark type. */ @@ -1019,7 +1094,7 @@ export class MarkType { /** * The schema that this mark type instance is part of. */ - schema: Schema; + schema: S; /** * The spec on which the type is based. */ @@ -1029,27 +1104,27 @@ export class MarkType { * containing only some of the mark's attributes. The others, if * they have defaults, will be added. */ - create(attrs?: { [key: string]: any }): Mark; + create(attrs?: { [key: string]: any }): Mark; /** * When there is a mark of this type in the given set, a new set * without it is returned. Otherwise, the input set is returned. */ - removeFromSet(set: Mark[]): Mark[]; + removeFromSet(set: Array>): Array>; /** * Tests whether there is a mark of this type in the given set. */ - isInSet(set: Mark[]): Mark | null | void; + isInSet(set: Array>): Mark | null | void; /** * Queries whether a given mark type is * [excluded](#model.MarkSpec.excludes) by this one. */ - excludes(other: MarkType): boolean; + excludes(other: MarkType): boolean; } /** * An object describing a schema, as passed to the [`Schema`](#model.Schema) * constructor. */ -export interface SchemaSpec { +export interface SchemaSpec { /** * The node types in this schema. Maps names to * [`NodeSpec`](#model.NodeSpec) objects that describe the node type @@ -1058,14 +1133,14 @@ export interface SchemaSpec { * precedence by default, and which nodes come first in a given * [group](#model.NodeSpec.group). */ - nodes: { [name: string]: NodeSpec } | OrderedMap; + nodes: { [name in N]: NodeSpec } | OrderedMap; /** * The mark types that exist in this schema. The order in which they * are provided determines the order in which [mark * sets](#model.Mark.addToSet) are sorted and in which [parse * rules](#model.MarkSpec.parseDOM) are tried. */ - marks?: { [name: string]: MarkSpec } | OrderedMap | null; + marks?: { [name in M]: MarkSpec } | OrderedMap | null; /** * The name of the default top-level node for the schema. Defaults * to `"doc"`. @@ -1228,11 +1303,11 @@ export interface AttributeSpec { * occur in conforming documents, and provides functionality for * creating and deserializing such documents. */ -export class Schema { +export class Schema { /** * Construct a schema from a schema [specification](#model.SchemaSpec). */ - constructor(spec: SchemaSpec); + constructor(spec: SchemaSpec); /** * The [spec](#model.SchemaSpec) on which the schema is based, * with the added guarantee that its `nodes` and `marks` @@ -1240,20 +1315,20 @@ export class Schema { * [`OrderedMap`](https://github.com/marijnh/orderedmap) instances * (not raw objects). */ - spec: SchemaSpec; + spec: SchemaSpec; /** * An object mapping the schema's node names to node type objects. */ - nodes: { [name: string]: NodeType }; + nodes: { [name in N]: NodeType> } & { [key: string]: NodeType> }; /** * A map from mark names to mark type objects. */ - marks: { [name: string]: MarkType }; + marks: { [name in M]: MarkType> } & { [key: string]: NodeType> }; /** * The type of the [default top node](#model.SchemaSpec.topNode) * for this schema. */ - topNodeType: NodeType; + topNodeType: NodeType>; /** * An object for storing whatever values modules may want to * compute and cache per schema. (If you want to store something @@ -1266,26 +1341,34 @@ export class Schema { * with defaults, `content` may be a `Fragment`, * `null`, a `Node`, or an array of nodes. */ - node(type: string | NodeType, attrs?: { [key: string]: any }, content?: Fragment | ProsemirrorNode | ProsemirrorNode[], marks?: Mark[]): ProsemirrorNode; + node( + type: string | NodeType>, + attrs?: { [key: string]: any }, + content?: + | Fragment> + | ProsemirrorNode> + | Array>>, + marks?: Array>> + ): ProsemirrorNode>; /** * Create a text node in the schema. Empty text nodes are not * allowed. */ - text(text: string, marks?: Mark[]): ProsemirrorNode; + text(text: string, marks?: Array>>): ProsemirrorNode>; /** * Create a mark with the given type and attributes. */ - mark(type: string | MarkType, attrs?: { [key: string]: any }): Mark; + mark(type: string | MarkType>, attrs?: { [key: string]: any }): Mark>; /** * Deserialize a node from its JSON representation. This method is * bound. */ - nodeFromJSON(json: { [key: string]: any }): ProsemirrorNode; + nodeFromJSON(json: { [key: string]: any }): ProsemirrorNode>; /** * Deserialize a mark from its JSON representation. This method is * bound. */ - markFromJSON(json: { [key: string]: any }): Mark; + markFromJSON(json: { [key: string]: any }): Mark>; } export interface DOMOutputSpecArray { 0: string; @@ -1299,15 +1382,12 @@ export interface DOMOutputSpecArray { 8?: DOMOutputSpec | 0; 9?: DOMOutputSpec | 0; } -export type DOMOutputSpec - = string - | Node - | DOMOutputSpecArray; +export type DOMOutputSpec = string | Node | DOMOutputSpecArray; /** * A DOM serializer knows how to convert ProseMirror nodes and * marks of various types to DOM nodes. */ -export class DOMSerializer { +export class DOMSerializer { /** * Create a serializer. `nodes` should map node names to functions * that take a node and return a description of the corresponding @@ -1317,22 +1397,25 @@ export class DOMSerializer { * serializer may be `null` to indicate that marks of that type * should not be serialized. */ - constructor(nodes: { [name: string]: (node: ProsemirrorNode) => DOMOutputSpec }, marks: { [name: string]: (mark: Mark, inline: boolean) => DOMOutputSpec }); + constructor( + nodes: { [name: string]: (node: ProsemirrorNode) => DOMOutputSpec }, + marks: { [name: string]: (mark: Mark, inline: boolean) => DOMOutputSpec } + ); /** * The node serialization functions. */ - nodes: { [name: string]: (node: ProsemirrorNode) => DOMOutputSpec }; + nodes: { [name: string]: (node: ProsemirrorNode) => DOMOutputSpec }; /** * The mark serialization functions. */ - marks: { [name: string]: (mark: Mark, inline: boolean) => DOMOutputSpec }; + marks: { [name: string]: (mark: Mark, inline: boolean) => DOMOutputSpec }; /** * Serialize the content of this fragment to a DOM fragment. When * not in the browser, the `document` option, containing a DOM * document, should be passed so that the serializer can create * nodes. */ - serializeFragment(fragment: Fragment, options?: { [key: string]: any }): DocumentFragment; + serializeFragment(fragment: Fragment, options?: { [key: string]: any }): DocumentFragment; /** * Serialize this node to a DOM node. This can be useful when you * need to serialize a part of a document, as opposed to the whole @@ -1340,16 +1423,19 @@ export class DOMSerializer { * [`serializeFragment`](#model.DOMSerializer.serializeFragment) on * its [content](#model.Node.content). */ - serializeNode(node: ProsemirrorNode, options?: { [key: string]: any }): Node; + serializeNode(node: ProsemirrorNode, options?: { [key: string]: any }): Node; /** * Render an [output spec](#model.DOMOutputSpec) to a DOM node. If * the spec has a hole (zero) in it, `contentDOM` will point at the * node with the hole. */ - static renderSpec(doc: Document, structure: DOMOutputSpec): { dom: Node, contentDOM?: Node | null }; + static renderSpec( + doc: Document, + structure: DOMOutputSpec + ): { dom: Node; contentDOM?: Node | null }; /** * Build a serializer using the [`toDOM`](#model.NodeSpec.toDOM) * properties in a schema's node and mark specs. */ - static fromSchema(schema: Schema): DOMSerializer; + static fromSchema(schema: S): DOMSerializer; } diff --git a/types/prosemirror-model/prosemirror-model-tests.ts b/types/prosemirror-model/prosemirror-model-tests.ts index d6ac1c2a5f..98460d4313 100644 --- a/types/prosemirror-model/prosemirror-model-tests.ts +++ b/types/prosemirror-model/prosemirror-model-tests.ts @@ -13,26 +13,28 @@ domOutputSpec = ['div', ['div', { class: 'foo' }]]; domOutputSpec = ['div', ['div', { class: 'foo' }, 0]]; export const nodeSpec: model.NodeSpec = { - attrs: { - name: { default: '' }, - }, - parseDOM: [{ - tag: 'span[data-name]', - getAttrs(dom) { - if (dom instanceof HTMLElement) { - return { - name: dom.getAttribute('data-name')! + attrs: { + name: { default: '' } + }, + parseDOM: [ + { + tag: 'span[data-name]', + getAttrs(dom) { + if (dom instanceof HTMLElement) { + return { + name: dom.getAttribute('data-name')! + }; + } + } + } + ], + toDOM(node) { + const { name } = node.attrs; + const attrs = { + 'data-emoji-name': name }; - } + return ['span', attrs, 0]; } - }], - toDOM(node) { - const { name } = node.attrs; - const attrs = { - 'data-emoji-name': name, - }; - return ['span', attrs, 0]; - } }; const node = new model.Node(); diff --git a/types/prosemirror-schema-basic/index.d.ts b/types/prosemirror-schema-basic/index.d.ts index 0e7a6f7846..49c9d29851 100644 --- a/types/prosemirror-schema-basic/index.d.ts +++ b/types/prosemirror-schema-basic/index.d.ts @@ -3,12 +3,9 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. +// TypeScript Version: 2.3 import { MarkSpec, NodeSpec, Schema } from 'prosemirror-model'; @@ -16,20 +13,25 @@ import { MarkSpec, NodeSpec, Schema } from 'prosemirror-model'; * [Specs](#model.NodeSpec) for the nodes defined in this schema. */ export let nodes: { - doc: NodeSpec, - paragraph: NodeSpec, - blockquote: NodeSpec, - horizontal_rule: NodeSpec, - heading: NodeSpec, - code_block: NodeSpec, - text: NodeSpec, - image: NodeSpec, - hard_break: NodeSpec + doc: NodeSpec; + paragraph: NodeSpec; + blockquote: NodeSpec; + horizontal_rule: NodeSpec; + heading: NodeSpec; + code_block: NodeSpec; + text: NodeSpec; + image: NodeSpec; + hard_break: NodeSpec; }; /** * [Specs](#model.MarkSpec) for the marks in the schema. */ -export let marks: { link: MarkSpec, em: MarkSpec, strong: MarkSpec, code: MarkSpec }; +export let marks: { + link: MarkSpec; + em: MarkSpec; + strong: MarkSpec; + code: MarkSpec; +}; /** * This schema rougly corresponds to the document schema used by * [CommonMark](http://commonmark.org/), minus the list elements, @@ -39,4 +41,4 @@ export let marks: { link: MarkSpec, em: MarkSpec, strong: MarkSpec, code: MarkSp * To reuse elements from this schema, extend or read from its * `spec.nodes` and `spec.marks` [properties](#model.Schema.spec). */ -export let schema: Schema; +export let schema: Schema; diff --git a/types/prosemirror-schema-list/index.d.ts b/types/prosemirror-schema-list/index.d.ts index 01053b06cd..9c97c3fcdb 100644 --- a/types/prosemirror-schema-list/index.d.ts +++ b/types/prosemirror-schema-list/index.d.ts @@ -3,15 +3,12 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. +// TypeScript Version: 2.3 import OrderedMap = require('orderedmap'); -import { NodeSpec, NodeType } from 'prosemirror-model'; +import { NodeSpec, NodeType, Schema } from 'prosemirror-model'; import { EditorState, Transaction } from 'prosemirror-state'; /** @@ -43,26 +40,39 @@ export let listItem: NodeSpec; * given to assign a group name to the list node types, for example * `"block"`. */ -export function addListNodes(nodes: OrderedMap, itemContent: string, listGroup?: string): OrderedMap; +export function addListNodes( + nodes: OrderedMap, + itemContent: string, + listGroup?: string +): OrderedMap; /** * Returns a command function that wraps the selection in a list with * the given type an attributes. If `dispatch` is null, only return a * value to indicate whether this is possible, but don't actually * perform the change. */ -export function wrapInList(listType: NodeType, attrs?: { [key: string]: any }): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; +export function wrapInList( + listType: NodeType, + attrs?: { [key: string]: any } +): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; /** * Build a command that splits a non-empty textblock at the top level * of a list item by also splitting that list item. */ -export function splitListItem(itemType: NodeType): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; +export function splitListItem( + itemType: NodeType +): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; /** * Create a command to lift the list item around the selection up into * a wrapping list. */ -export function liftListItem(itemType: NodeType): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; +export function liftListItem( + itemType: NodeType +): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; /** * Create a command to sink the list item around the selection down * into an inner list. */ -export function sinkListItem(itemType: NodeType): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; +export function sinkListItem( + itemType: NodeType +): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; diff --git a/types/prosemirror-state/index.d.ts b/types/prosemirror-state/index.d.ts index 781a1459e9..6b210a73e1 100644 --- a/types/prosemirror-state/index.d.ts +++ b/types/prosemirror-state/index.d.ts @@ -1,16 +1,20 @@ -// Type definitions for prosemirror-state 1.0 +// Type definitions for prosemirror-state 1.1 // Project: https://github.com/ProseMirror/prosemirror-state // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.3 -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. - -import { Mark, MarkType, Node as ProsemirrorNode, ResolvedPos, Schema, Slice } from 'prosemirror-model'; +import { + Mark, + MarkType, + Node as ProsemirrorNode, + ResolvedPos, + Schema, + Slice +} from 'prosemirror-model'; import { Mappable, Mapping, Transform } from 'prosemirror-transform'; import { EditorProps, EditorView } from 'prosemirror-view'; @@ -18,13 +22,13 @@ import { EditorProps, EditorView } from 'prosemirror-view'; * This is the type passed to the [`Plugin`](#state.Plugin) * constructor. It provides a definition for a plugin. */ -export interface PluginSpec { +export interface PluginSpec { /** * The [view props](#view.EditorProps) added by this plugin. Props * that are functions will be bound to have the plugin instance as * their `this` binding. */ - props?: EditorProps | null; + props?: EditorProps | null; /** * Allows a plugin to define a [state field](#state.StateField), an * extra slot in the state object in which it can keep its own data. @@ -36,20 +40,27 @@ export interface PluginSpec { * access the plugin's configuration and state through the key, * without having access to the plugin instance object. */ - key?: PluginKey | null; + key?: PluginKey | null; /** * When the plugin needs to interact with the editor view, or * set something up in the DOM, use this field. The function * will be called when the plugin's state is associated with an * editor view. */ - view?: ((p: EditorView) => { update?: ((view: EditorView, prevState: EditorState) => void) | null, destroy?: (() => void) | null }) | null; + view?: + | (( + p: EditorView + ) => { + update?: ((view: EditorView, prevState: EditorState) => void) | null; + destroy?: (() => void) | null; + }) + | null; /** * When present, this will be called before a transaction is * applied by the state, allowing the plugin to cancel it (by * returning false). */ - filterTransaction?: ((p1: Transaction, p2: EditorState) => boolean) | null; + filterTransaction?: ((p1: Transaction, p2: EditorState) => boolean) | null; /** * Allows the plugin to append another transaction to be applied * after the given array of transactions. When another plugin @@ -58,22 +69,28 @@ export interface PluginSpec { * transactions, i.e. it won't be passed transactions that it * already saw. */ - appendTransaction?: ((transactions: Transaction[], oldState: EditorState, newState: EditorState) => Transaction | null | void) | null; + appendTransaction?: + | (( + transactions: Transaction[], + oldState: EditorState, + newState: EditorState + ) => Transaction | null | void) + | null; } /** * Plugins bundle functionality that can be added to an editor. * They are part of the [editor state](#state.EditorState) and * may influence that state and the view that contains it. */ -export class Plugin { +export class Plugin { /** * Create a plugin. */ - constructor(spec: PluginSpec); + constructor(spec: PluginSpec); /** * The [props](#view.EditorProps) exported by this plugin. */ - props: EditorProps; + props: EditorProps; /** * The plugin's [spec object](#state.PluginSpec). */ @@ -81,7 +98,7 @@ export class Plugin { /** * Extract the plugin's state field from an editor state. */ - getState(state: EditorState): any; + getState(state: EditorState): any; } /** * A plugin spec may provide a state field (under its @@ -89,21 +106,21 @@ export class Plugin { * describes the state it wants to keep. Functions provided here are * always called with the plugin instance as their `this` binding. */ -export interface StateField { +export interface StateField { /** * Initialize the value of the field. `config` will be the object * passed to [`EditorState.create`](#state.EditorState^create). Note * that `instance` is a half-initialized state instance, and will * not have values for plugin fields initialized after this one. */ - init(config: { [key: string]: any }, instance: EditorState): T; + init(config: { [key: string]: any }, instance: EditorState): T; /** * Apply the given transaction to this state field, producing a new * field value. Note that the `newState` argument is again a partially * constructed state does not yet contain the state from plugins * coming after this one. */ - apply(tr: Transaction, value: T, oldState: EditorState, newState: EditorState): T; + apply(tr: Transaction, value: T, oldState: EditorState, newState: EditorState): T; /** * Convert this field to JSON. Optional, can be left off to disable * JSON serialization for the field. @@ -113,7 +130,7 @@ export interface StateField { * Deserialize the JSON representation of this field. Note that the * `state` argument is again a half-initialized state. */ - fromJSON?: ((config: { [key: string]: any }, value: any, state: EditorState) => T) | null; + fromJSON?: ((config: { [key: string]: any }, value: any, state: EditorState) => T) | null; } /** * A key is used to [tag](#state.PluginSpec.key) @@ -121,7 +138,7 @@ export interface StateField { * editor state. Assigning a key does mean only one plugin of that * type can be active in a state. */ -export class PluginKey { +export class PluginKey { /** * Create a plugin key. */ @@ -130,37 +147,37 @@ export class PluginKey { * Get the active plugin with this key, if any, from an editor * state. */ - get(state: EditorState): Plugin | null | void; + get(state: EditorState): Plugin | null | void; /** * Get the plugin's state from an editor state. */ - getState(state: EditorState): any | null | void; + getState(state: EditorState): any | null | void; } /** * Superclass for editor selections. Every selection type should * extend this. Should not be instantiated directly. */ -export class Selection { +export class Selection { /** * Initialize a selection with the head and anchor and ranges. If no * ranges are given, constructs a single range across `$anchor` and * `$head`. */ - constructor($anchor: ResolvedPos, $head: ResolvedPos, ranges?: SelectionRange[]); + constructor($anchor: ResolvedPos, $head: ResolvedPos, ranges?: Array>); /** * The ranges covered by the selection. */ - ranges: SelectionRange[]; + ranges: Array>; /** * The resolved anchor of the selection (the side that stays in * place when the selection is modified). */ - $anchor: ResolvedPos; + $anchor: ResolvedPos; /** * The resolved head of the selection (the side that moves when * the selection is modified). */ - $head: ResolvedPos; + $head: ResolvedPos; /** * The selection's anchor, as an unresolved position. */ @@ -180,11 +197,11 @@ export class Selection { /** * The resolved lower bound of the selection's main range. */ - $from: ResolvedPos; + $from: ResolvedPos; /** * The resolved upper bound of the selection's main range. */ - $to: ResolvedPos; + $to: ResolvedPos; /** * Indicates whether the selection contains any content. */ @@ -192,26 +209,26 @@ export class Selection { /** * Test whether the selection is the same as another selection. */ - eq(p: Selection): boolean; + eq(p: Selection): boolean; /** * Map this selection through a [mappable](#transform.Mappable) thing. `doc` * should be the new document to which we are mapping. */ - map(doc: ProsemirrorNode, mapping: Mappable): Selection; + map(doc: ProsemirrorNode, mapping: Mappable): Selection; /** * Get the content of this selection as a slice. */ - content(): Slice; + content(): Slice; /** * Replace the selection with a slice or, if no slice is given, * delete the selection. Will append to the given transaction. */ - replace(tr: Transaction, content?: Slice): void; + replace(tr: Transaction, content?: Slice): void; /** * Replace the selection with the given node, appending the changes * to the given transaction. */ - replaceWith(tr: Transaction, node: ProsemirrorNode): void; + replaceWith(tr: Transaction, node: ProsemirrorNode): void; /** * Convert the selection to a JSON representation. When implementing * this for a custom selection class, make sure to give the object a @@ -228,7 +245,7 @@ export class Selection { * this method just converts the selection to a text selection and * returns the bookmark for that. */ - getBookmark(): SelectionBookmark; + getBookmark(): SelectionBookmark; /** * Controls whether, when a selection of this type is active in the * browser, the selected range should be visible to the user. Defaults @@ -242,30 +259,37 @@ export class Selection { * selections. Will return null when no valid selection position is * found. */ - static findFrom($pos: ResolvedPos, dir: number, textOnly?: boolean): Selection | null | void; + static findFrom( + $pos: ResolvedPos, + dir: number, + textOnly?: boolean + ): Selection | null | void; /** * Find a valid cursor or leaf node selection near the given * position. Searches forward first by default, but if `bias` is * negative, it will search backwards first. */ - static near($pos: ResolvedPos, bias?: number): Selection; + static near($pos: ResolvedPos, bias?: number): Selection; /** * Find the cursor or leaf node selection closest to the start of * the given document. Will return an * [`AllSelection`](#state.AllSelection) if no valid position * exists. */ - static atStart(doc: ProsemirrorNode): Selection; + static atStart(doc: ProsemirrorNode): Selection; /** * Find the cursor or leaf node selection closest to the end of the * given document. */ - static atEnd(doc: ProsemirrorNode): Selection; + static atEnd(doc: ProsemirrorNode): Selection; /** * Deserialize the JSON representation of a selection. Must be * implemented for custom classes (as a static class method). */ - static fromJSON(doc: ProsemirrorNode, json: { [key: string]: any }): Selection; + static fromJSON( + doc: ProsemirrorNode, + json: { [key: string]: any } + ): Selection; /** * To be able to deserialize selections from JSON, custom selection * classes must register themselves with an ID string, so that they @@ -279,32 +303,32 @@ export class Selection { * You can define a custom bookmark type for a custom selection class * to make the history handle it well. */ -export interface SelectionBookmark { +export interface SelectionBookmark { /** * Map the bookmark through a set of changes. */ - map(mapping: Mapping): SelectionBookmark; + map(mapping: Mapping): SelectionBookmark; /** * Resolve the bookmark to a real selection again. This may need to * do some error checking and may fall back to a default (usually * [`TextSelection.between`](#state.TextSelection^between)) if * mapping made the bookmark invalid. */ - resolve(doc: ProsemirrorNode): Selection; + resolve(doc: ProsemirrorNode): Selection; } /** * Represents a selected range in a document. */ -export class SelectionRange { - constructor($from: ResolvedPos, $to: ResolvedPos); +export class SelectionRange { + constructor($from: ResolvedPos, $to: ResolvedPos); /** * The lower bound of the range. */ - $from: ResolvedPos; + $from: ResolvedPos; /** * The upper bound of the range. */ - $to: ResolvedPos; + $to: ResolvedPos; } /** * A text selection represents a classical editor selection, with @@ -312,20 +336,24 @@ export class SelectionRange { * point into textblock nodes. It can be empty (a regular cursor * position). */ -export class TextSelection extends Selection { +export class TextSelection extends Selection { /** * Construct a text selection between the given points. */ - constructor($anchor: ResolvedPos, $head?: ResolvedPos); + constructor($anchor: ResolvedPos, $head?: ResolvedPos); /** * Returns a resolved position if this is a cursor selection (an * empty text selection), and null otherwise. */ - $cursor?: ResolvedPos | null; + $cursor?: ResolvedPos | null; /** * Create a text selection from non-resolved positions. */ - static create(doc: ProsemirrorNode, anchor: number, head?: number): TextSelection; + static create( + doc: ProsemirrorNode, + anchor: number, + head?: number + ): TextSelection; /** * Return a text selection that spans the given positions or, if * they aren't text positions, find a text selection near them. @@ -334,7 +362,11 @@ export class TextSelection extends Selection { * [`Selection.near`](#state.Selection^near) when the document * doesn't contain a valid text position. */ - static between($anchor: ResolvedPos, $head: ResolvedPos, bias?: number): Selection; + static between( + $anchor: ResolvedPos, + $head: ResolvedPos, + bias?: number + ): Selection; } /** * A node selection is a selection that points at a single node. @@ -343,20 +375,23 @@ export class TextSelection extends Selection { * `to` point directly before and after the selected node, `anchor` * equals `from`, and `head` equals `to`.. */ -export class NodeSelection extends Selection { +export class NodeSelection extends Selection { /** * Create a node selection. Does not verify the validity of its * argument. */ - constructor($pos: ResolvedPos); + constructor($pos: ResolvedPos); /** * The selected node. */ - node: ProsemirrorNode; + node: ProsemirrorNode; /** * Create a node selection from non-resolved positions. */ - static create(doc: ProsemirrorNode, from: number): NodeSelection; + static create( + doc: ProsemirrorNode, + from: number + ): NodeSelection; /** * Determines whether the given node may be selected as a node * selection. @@ -369,11 +404,11 @@ export class NodeSelection extends Selection { * there are for example leaf block nodes at the start or end of the * document). */ -export class AllSelection extends Selection { +export class AllSelection extends Selection { /** * Create an all-selection over the given document. */ - constructor(doc: ProsemirrorNode); + constructor(doc: ProsemirrorNode); } /** * The state of a ProseMirror editor is represented by an object @@ -384,32 +419,32 @@ export class AllSelection extends Selection { * A state holds a number of built-in fields, and plugins can * [define](#state.PluginSpec.state) additional fields. */ -export class EditorState { +export class EditorState { /** * The current document. */ - doc: ProsemirrorNode; + doc: ProsemirrorNode; /** * The selection. */ - selection: Selection; + selection: Selection; /** * A set of marks to apply to the next input. Will be null when * no explicit marks have been set. */ - storedMarks?: Mark[] | null; + storedMarks?: Array> | null; /** * The schema of the state's document. */ - schema: Schema; + schema: S; /** * The plugins that are active in this state. */ - plugins: Plugin[]; + plugins: Array>; /** * Apply the given transaction to produce a new state. */ - apply(tr: Transaction): EditorState; + apply(tr: Transaction): EditorState; /** * Verbose variant of [`apply`](#state.EditorState.apply) that * returns the precise transactions that were applied (which might @@ -417,7 +452,7 @@ export class EditorState { * hooks](#state.PluginSpec.filterTransaction) of * plugins) along with the new state. */ - applyTransaction(tr: Transaction): { state: EditorState, transactions: Transaction[] }; + applyTransaction(tr: Transaction): { state: EditorState; transactions: Transaction[] }; /** * Start a [transaction](#state.Transaction) from this state. */ @@ -430,17 +465,22 @@ export class EditorState { * [`init`](#state.StateField.init) method, passing in the new * configuration object.. */ - reconfigure(config: { schema?: Schema | null, plugins?: Plugin[] | null }): EditorState; + reconfigure(config: { schema?: S | null; plugins?: Array> | null }): EditorState; /** * Serialize this state to JSON. If you want to serialize the state * of plugins, pass an object mapping property names to use in the * resulting JSON object to plugin objects. */ - toJSON(pluginFields?: { [name: string]: Plugin }): { [key: string]: any }; + toJSON(pluginFields?: { [name: string]: Plugin } | string | number): { [key: string]: any }; /** * Create a new state. */ - static create(config: { schema?: Schema | null, doc?: ProsemirrorNode | null, selection?: Selection | null, plugins?: Plugin[] | null }): EditorState; + static create(config: { + schema?: S | null; + doc?: ProsemirrorNode | null; + selection?: Selection | null; + plugins?: Array> | null; + }): EditorState; /** * Deserialize a JSON representation of a state. `config` should * have at least a `schema` field, and should contain array of @@ -448,7 +488,11 @@ export class EditorState { * to deserialize the state of plugins, by associating plugin * instances with the property names they use in the JSON object. */ - static fromJSON(config: { schema: Schema, plugins?: Plugin[] | null }, json: { [key: string]: any }, pluginFields?: { [name: string]: Plugin }): EditorState; + static fromJSON( + config: { schema: S; plugins?: Array> | null }, + json: { [key: string]: any }, + pluginFields?: { [name: string]: Plugin } + ): EditorState; } /** * An editor state transaction, which can be applied to a state to @@ -469,7 +513,7 @@ export class EditorState { * selection transactions directly caused by mouse or touch input, and * a `"paste"` property of true to transactions caused by a paste.. */ -export class Transaction extends Transform { +export class Transaction extends Transform { /** * The timestamp associated with this transaction, in the same * format as `Date.now()`. diff --git a/types/prosemirror-tables/index.d.ts b/types/prosemirror-tables/index.d.ts index 53df9fc220..9ae723910b 100644 --- a/types/prosemirror-tables/index.d.ts +++ b/types/prosemirror-tables/index.d.ts @@ -2,10 +2,12 @@ // Project: https://github.com/ProseMirror/prosemirror-tables // Definitions by: Oscar Wallhult // Eduard Shvedai +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 + import { EditorState, Plugin, SelectionRange, Transaction, PluginKey } from 'prosemirror-state'; -import { Node as ProsemirrorNode, NodeSpec, Slice, ResolvedPos } from 'prosemirror-model'; +import { Node as ProsemirrorNode, NodeSpec, Slice, ResolvedPos, Schema } from 'prosemirror-model'; import { NodeView } from 'prosemirror-view'; export interface TableNodesOptions { @@ -38,37 +40,50 @@ export interface CellSelectionJSON { head: number; } -export class CellSelection { - constructor($anchorCell: ResolvedPos, $headCell?: ResolvedPos); +export class CellSelection { + constructor($anchorCell: ResolvedPos, $headCell?: ResolvedPos); from: number; to: number; - $from: ResolvedPos; - $to: ResolvedPos; + $from: ResolvedPos; + $to: ResolvedPos; anchor: number; head: number; - $anchor: ResolvedPos; - $head: ResolvedPos; - $anchorCell: ResolvedPos; - $headCell: ResolvedPos; + $anchor: ResolvedPos; + $head: ResolvedPos; + $anchorCell: ResolvedPos; + $headCell: ResolvedPos; empty: boolean; - ranges: SelectionRange[]; + ranges: Array>; - map(doc: ProsemirrorNode, mapping: any): any; - content(): Slice; - replace(tr: Transaction, content: Slice): void; - replaceWith(tr: Transaction, node: ProsemirrorNode): void; - forEachCell(f: (node: ProsemirrorNode, pos: number) => void): void; + map(doc: ProsemirrorNode, mapping: any): any; + content(): Slice; + replace(tr: Transaction, content: Slice): void; + replaceWith(tr: Transaction, node: ProsemirrorNode): void; + forEachCell(f: (node: ProsemirrorNode, pos: number) => void): void; isRowSelection(): boolean; isColSelection(): boolean; eq(other: any): boolean; toJSON(): CellSelectionJSON; - getBookmark(): {anchor: number, head: number}; + getBookmark(): { anchor: number; head: number }; - static colSelection(anchorCell: ResolvedPos, headCell?: ResolvedPos): CellSelection; - static rowSelection(anchorCell: ResolvedPos, headCell?: ResolvedPos): CellSelection; - static create(doc: ProsemirrorNode, anchorCell: number, headCell?: number): CellSelection; - static fromJSON(doc: ProsemirrorNode, json: CellSelectionJSON): CellSelection; + static colSelection( + anchorCell: ResolvedPos, + headCell?: ResolvedPos + ): CellSelection; + static rowSelection( + anchorCell: ResolvedPos, + headCell?: ResolvedPos + ): CellSelection; + static create( + doc: ProsemirrorNode, + anchorCell: number, + headCell?: number + ): CellSelection; + static fromJSON( + doc: ProsemirrorNode, + json: CellSelectionJSON + ): CellSelection; } export interface Rect { @@ -96,52 +111,115 @@ export class TableMap { export function tableEditing(): Plugin; -export function deleteTable(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function deleteTable( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function goToNextCell(direction: number): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; +export function goToNextCell( + direction: number +): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; -export function toggleHeaderCell(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function toggleHeaderCell( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function toggleHeaderColumn(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function toggleHeaderColumn( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function toggleHeaderRow(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function toggleHeaderRow( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function setCellAttr(name: string, value: any): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; +export function setCellAttr( + name: string, + value: any +): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; -export function splitCell(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function splitCell( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function mergeCells(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function mergeCells( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function deleteRow(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function deleteRow( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function addRowAfter(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function addRowAfter( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function addRowBefore(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function addRowBefore( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function deleteColumn(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function deleteColumn( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function addColumnAfter(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function addColumnAfter( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function addColumnBefore(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function addColumnBefore( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function columnResizing(props: { handleWidth?: number, cellMinWidth?: number, View?: NodeView }): Plugin; +export function columnResizing(props: { + handleWidth?: number; + cellMinWidth?: number; + View?: NodeView; +}): Plugin; export const columnResizingPluginKey: PluginKey; -export function updateColumnsOnResize(node: ProsemirrorNode, colgroup: Element, table: Element, cellMinWidth: number, overrideCol?: number, overrideValue?: number): void; +export function updateColumnsOnResize( + node: ProsemirrorNode, + colgroup: Element, + table: Element, + cellMinWidth: number, + overrideCol?: number, + overrideValue?: number +): void; -export function cellAround(pos: ResolvedPos): ResolvedPos | null; +export function cellAround(pos: ResolvedPos): ResolvedPos | null; export function isInTable(state: EditorState): boolean; -export function selectionCell(state: EditorState): ResolvedPos | null | undefined; +export function selectionCell( + state: EditorState +): ResolvedPos | null | undefined; -export function moveCellForward(pos: ResolvedPos): ResolvedPos; +export function moveCellForward(pos: ResolvedPos): ResolvedPos; -export function inSameTable($a: ResolvedPos, $b: ResolvedPos): boolean; +export function inSameTable( + $a: ResolvedPos, + $b: ResolvedPos +): boolean; -export function findCell(pos: ResolvedPos): {top: number, left: number, right: number, buttom: number}; +export function findCell( + pos: ResolvedPos +): { top: number; left: number; right: number; buttom: number }; export function colCount(pos: ResolvedPos): number; -export function nextCell(pos: ResolvedPos, axis: string, dir: number): null | ResolvedPos; +export function nextCell( + pos: ResolvedPos, + axis: string, + dir: number +): null | ResolvedPos; diff --git a/types/prosemirror-transform/index.d.ts b/types/prosemirror-transform/index.d.ts index 8f386b4bd3..c0b63136f4 100644 --- a/types/prosemirror-transform/index.d.ts +++ b/types/prosemirror-transform/index.d.ts @@ -3,14 +3,21 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.3 -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. - -import { ContentMatch, Fragment, Mark, MarkType, Node as ProsemirrorNode, NodeRange, NodeType, Schema, Slice } from 'prosemirror-model'; +import { + ContentMatch, + Fragment, + Mark, + MarkType, + Node as ProsemirrorNode, + NodeRange, + NodeType, + Schema, + Slice +} from 'prosemirror-model'; /** * There are several things that positions can be mapped through. @@ -160,14 +167,14 @@ export class Mapping implements Mappable { /** * Add a mark to all inline content between two positions. */ -export class AddMarkStep extends Step { - constructor(from: number, to: number, mark: Mark); +export class AddMarkStep extends Step { + constructor(from: number, to: number, mark: Mark); } /** * Remove a mark from all inline content between two positions. */ -export class RemoveMarkStep extends Step { - constructor(from: number, to: number, mark: Mark); +export class RemoveMarkStep extends Step { + constructor(from: number, to: number, mark: Mark); } /** * Abstraction to build up and track an array of @@ -176,39 +183,43 @@ export class RemoveMarkStep extends Step { * Most transforming methods return the `Transform` object itself, so * that they can be chained. */ -export class Transform { +export class Transform { /** * Create a transform that starts with the given document. */ - constructor(doc: ProsemirrorNode); + constructor(doc: ProsemirrorNode); /** * Add the given mark to the inline content between `from` and `to`. */ - addMark(from: number, to: number, mark: Mark): this; + addMark(from: number, to: number, mark: Mark): this; /** * Remove marks from inline nodes between `from` and `to`. When `mark` * is a single mark, remove precisely that mark. When it is a mark type, * remove all marks of that type. When it is null, remove all marks of * any type. */ - removeMark(from: number, to: number, mark?: Mark | MarkType): this; + removeMark(from: number, to: number, mark?: Mark | MarkType): this; /** * Removes all marks and nodes from the content of the node at `pos` * that don't match the given new parent node type. Accepts an * optional starting [content match](#model.ContentMatch) as third * argument. */ - clearIncompatible(pos: number, parentType: NodeType, match?: ContentMatch): this; + clearIncompatible(pos: number, parentType: NodeType, match?: ContentMatch): this; /** * Replace the part of the document between `from` and `to` with the * given `slice`. */ - replace(from: number, to?: number, slice?: Slice): this; + replace(from: number, to?: number, slice?: Slice): this; /** * Replace the given range with the given content, which may be a * fragment, node, or array of nodes. */ - replaceWith(from: number, to: number, content: Fragment | ProsemirrorNode | ProsemirrorNode[]): this; + replaceWith( + from: number, + to: number, + content: Fragment | ProsemirrorNode | Array> + ): this; /** * Delete the content between the given positions. */ @@ -216,7 +227,10 @@ export class Transform { /** * Insert the given content at the given position. */ - insert(pos: number, content: Fragment | ProsemirrorNode | ProsemirrorNode[]): this; + insert( + pos: number, + content: Fragment | ProsemirrorNode | Array> + ): this; /** * Replace a range of the document with a given slice, using `from`, * `to`, and the slice's [`openStart`](#model.Slice.openStart) property @@ -234,7 +248,7 @@ export class Transform { * range, and is useful in situations where you need more precise * control over what happens. */ - replaceRange(from: number, to: number, slice: Slice): this; + replaceRange(from: number, to: number, slice: Slice): this; /** * Replace the given range with a node, but use `from` and `to` as * hints, rather than precise positions. When from and to are the same @@ -244,7 +258,7 @@ export class Transform { * completely covers a parent node, this method may completely replace * that parent node. */ - replaceRangeWith(from: number, to: number, node: ProsemirrorNode): this; + replaceRangeWith(from: number, to: number, node: ProsemirrorNode): this; /** * Delete the given range, expanding it to cover fully covered * parent nodes until a valid replace is found. @@ -257,23 +271,36 @@ export class Transform { * [`liftTarget`](#transform.liftTarget) to compute `target`, to make * sure the lift is valid. */ - lift(range: NodeRange, target: number): this; + lift(range: NodeRange, target: number): this; /** * Wrap the given [range](#model.NodeRange) in the given set of wrappers. * The wrappers are assumed to be valid in this position, and should * probably be computed with [`findWrapping`](#transform.findWrapping). */ - wrap(range: NodeRange, wrappers: Array<{ type: NodeType, attrs?: { [key: string]: any } | null }>): this; + wrap( + range: NodeRange, + wrappers: Array<{ type: NodeType; attrs?: { [key: string]: any } | null }> + ): this; /** * Set the type of all textblocks (partly) between `from` and `to` to * the given node type with the given attributes. */ - setBlockType(from: number, to: number | undefined, type: NodeType, attrs?: { [key: string]: any }): this; + setBlockType( + from: number, + to: number | undefined, + type: NodeType, + attrs?: { [key: string]: any } + ): this; /** * Change the type, attributes, and/or marks of the node at `pos`. * When `nodeType` is null, the existing node type is preserved, */ - setNodeMarkup(pos: number, type?: NodeType, attrs?: { [key: string]: any }, marks?: Mark[]): this; + setNodeMarkup( + pos: number, + type?: NodeType, + attrs?: { [key: string]: any }, + marks?: Array> + ): this; /** * Split the node at the given position, and optionally, if `depth` is * greater than one, any number of nodes above that. By default, the @@ -281,7 +308,11 @@ export class Transform { * This can be changed by passing an array of types and attributes to * use after the split. */ - split(pos: number, depth?: number, typesAfter?: Array<{ type: NodeType, attrs?: { [key: string]: any } | null }>): this; + split( + pos: number, + depth?: number, + typesAfter?: Array<{ type: NodeType; attrs?: { [key: string]: any } | null }> + ): this; /** * Join the blocks around the given position. If depth is 2, their * last and first siblings are also joined, and so on. @@ -291,15 +322,15 @@ export class Transform { * The current document (the result of applying the steps in the * transform). */ - doc: ProsemirrorNode; + doc: ProsemirrorNode; /** * The steps in this transform. */ - steps: Step[]; + steps: Array>; /** * The documents before each of the steps. */ - docs: ProsemirrorNode[]; + docs: Array>; /** * A mapping with the maps for each of the steps in this transform. */ @@ -307,17 +338,17 @@ export class Transform { /** * The starting document. */ - before: ProsemirrorNode; + before: ProsemirrorNode; /** * Apply a new step in this transform, saving the result. Throws an * error when the step fails. */ - step(step: Step): this; + step(step: Step): this; /** * Try to apply a step in this transformation, ignoring it if it * fails. Returns the step result. */ - maybeStep(step: Step): StepResult; + maybeStep(step: Step): StepResult; /** * True when the document has been changed (when there are any * steps). @@ -327,7 +358,7 @@ export class Transform { /** * Replace a part of the document with a slice of new content. */ -export class ReplaceStep extends Step { +export class ReplaceStep extends Step { /** * The given `slice` should fit the 'gap' between `from` and * `to`—the depths must line up, and the surrounding nodes must be @@ -337,21 +368,29 @@ export class ReplaceStep extends Step { * tokens (this is to guard against rebased replace steps * overwriting something they weren't supposed to). */ - constructor(from: number, to: number, slice: Slice, structure?: boolean); + constructor(from: number, to: number, slice: Slice, structure?: boolean); } /** * Replace a part of the document with a slice of content, but * preserve a range of the replaced content by moving it into the * slice. */ -export class ReplaceAroundStep extends Step { +export class ReplaceAroundStep extends Step { /** * Create a replace-around step with the given range and gap. * `insert` should be the point in the slice into which the content * of the gap should be moved. `structure` has the same meaning as * it has in the [`ReplaceStep`](#transform.ReplaceStep) class. */ - constructor(from: number, to: number, gapFrom: number, gapTo: number, slice: Slice, insert: number, structure?: boolean); + constructor( + from: number, + to: number, + gapFrom: number, + gapTo: number, + slice: Slice, + insert: number, + structure?: boolean + ); } /** * ‘Fit’ a slice into a given position in the document, producing a @@ -359,7 +398,12 @@ export class ReplaceAroundStep extends Step { * there's no meaningful way to insert the slice here, or inserting it * would be a no-op (an empty slice over an empty range). */ -export function replaceStep(doc: ProsemirrorNode, from: number, to?: number, slice?: Slice): Step | null | void; +export function replaceStep( + doc: ProsemirrorNode, + from: number, + to?: number, + slice?: Slice +): Step | null | void; /** * A step object represents an atomic change. It generally applies * only to the document it was created for, since the positions @@ -371,14 +415,14 @@ export function replaceStep(doc: ProsemirrorNode, from: number, to?: number, sli * JSON-serialization identifier using * [`Step.jsonID`](#transform.Step^jsonID). */ -export class Step { +export class Step { /** * Applies this step to the given document, returning a result * object that either indicates failure, if the step can not be * applied to this document, or indicates success by containing a * transformed document. */ - apply(doc: ProsemirrorNode): StepResult; + apply(doc: ProsemirrorNode): StepResult; /** * Get the step map that represents the changes made by this step, * and which can be used to transform between positions in the old @@ -389,19 +433,19 @@ export class Step { * Create an inverted version of this step. Needs the document as it * was before the step as argument. */ - invert(doc: ProsemirrorNode): Step; + invert(doc: ProsemirrorNode): Step; /** * Map this step through a mappable thing, returning either a * version of that step with its positions adjusted, or `null` if * the step was entirely deleted by the mapping. */ - map(mapping: Mappable): Step | null | void; + map(mapping: Mappable): Step | null | void; /** * Try to merge this step with another one, to be applied directly * after it. Returns the merged step when possible, null if the * steps can't be merged. */ - merge(other: Step): Step | null | void; + merge(other: Step): Step | null | void; /** * Create a JSON-serializeable representation of this step. When * defining this for a custom subclass, make sure the result object @@ -413,7 +457,7 @@ export class Step { * Deserialize a step from its JSON representation. Will call * through to the step class' own implementation of this method. */ - static fromJSON(schema: Schema, json: { [key: string]: any }): Step; + static fromJSON(schema: S, json: { [key: string]: any }): Step; /** * To be able to serialize steps to JSON, each step needs a string * ID to attach to its JSON representation. Use this method to @@ -426,11 +470,11 @@ export class Step { * The result of [applying](#transform.Step.apply) a step. Contains either a * new document or a failure value. */ -export class StepResult { +export class StepResult { /** * The transformed document. */ - doc?: ProsemirrorNode | null; + doc?: ProsemirrorNode | null; /** * Text providing information about a failed step. */ @@ -438,7 +482,7 @@ export class StepResult { /** * Create a successful step result. */ - static ok(doc: ProsemirrorNode): StepResult; + static ok(doc: ProsemirrorNode): StepResult; /** * Create a failed step result. */ @@ -448,7 +492,12 @@ export class StepResult { * arguments. Create a successful result if it succeeds, and a * failed one if it throws a `ReplaceError`. */ - static fromReplace(doc: ProsemirrorNode, from: number, to: number, slice: Slice): StepResult; + static fromReplace( + doc: ProsemirrorNode, + from: number, + to: number, + slice: Slice + ): StepResult; } /** * Try to find a target depth to which the content in the given range @@ -462,11 +511,20 @@ export function liftTarget(range: NodeRange): number | null | void; * the wrapper node, if necessary. Returns null if no valid wrapping * could be found. */ -export function findWrapping(range: NodeRange, nodeType: NodeType, attrs?: { [key: string]: any }): Array<{ type: NodeType, attrs?: { [key: string]: any } | null }> | null | void; +export function findWrapping( + range: NodeRange, + nodeType: NodeType, + attrs?: { [key: string]: any } +): Array<{ type: NodeType; attrs?: { [key: string]: any } | null }> | null | void; /** * Check whether splitting at the given position is allowed. */ -export function canSplit(doc: ProsemirrorNode, pos: number, depth?: number, typesAfter?: Array<{ type: NodeType, attrs?: { [key: string]: any } | null }>): boolean; +export function canSplit( + doc: ProsemirrorNode, + pos: number, + depth?: number, + typesAfter?: Array<{ type: NodeType; attrs?: { [key: string]: any } | null }> +): boolean; /** * Test whether the blocks before and after a given position can be * joined. @@ -484,4 +542,8 @@ export function joinPoint(doc: ProsemirrorNode, pos: number, dir?: number): numb * isn't a valid place but is at the start or end of a node. Return * null if no position was found. */ -export function insertPoint(doc: ProsemirrorNode, pos: number, nodeType: NodeType): number | null | void; +export function insertPoint( + doc: ProsemirrorNode, + pos: number, + nodeType: NodeType +): number | null | void; diff --git a/types/prosemirror-transform/tsconfig.json b/types/prosemirror-transform/tsconfig.json index c5799c88a6..31a3452e16 100644 --- a/types/prosemirror-transform/tsconfig.json +++ b/types/prosemirror-transform/tsconfig.json @@ -1,24 +1,16 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6", - "dom" - ], + "lib": ["es6", "dom"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": [ - "../" - ], + "typeRoots": ["../"], "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, - "files": [ - "index.d.ts", - "prosemirror-transform-tests.ts" - ] -} \ No newline at end of file + "files": ["index.d.ts", "prosemirror-transform-tests.ts"] +} diff --git a/types/prosemirror-view/index.d.ts b/types/prosemirror-view/index.d.ts index 0ce2e37794..f24a5270d1 100644 --- a/types/prosemirror-view/index.d.ts +++ b/types/prosemirror-view/index.d.ts @@ -1,16 +1,21 @@ -// Type definitions for prosemirror-view 1.0 +// Type definitions for prosemirror-view 1.2 // Project: https://github.com/ProseMirror/prosemirror-view // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.3 -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. - -import { DOMParser, DOMSerializer, Node as ProsemirrorNode, ResolvedPos, Slice } from 'prosemirror-model'; +import { + DOMParser, + DOMSerializer, + Node as ProsemirrorNode, + ResolvedPos, + Slice, + Schema, + Mark +} from 'prosemirror-model'; import { EditorState, Selection, Transaction } from 'prosemirror-state'; import { Mapping } from 'prosemirror-transform'; @@ -38,18 +43,37 @@ export class Decoration { * Creates a widget decoration, which is a DOM node that's shown in * the document at the given position. */ - static widget(pos: number, dom: Node, spec?: { side?: number | null, stopEvent?: ((event: Event) => boolean) | null, key?: string | null }): Decoration; + static widget( + pos: number, + dom: Node, + spec?: { + side?: number | null; + marks?: Mark[]; + stopEvent?: ((event: Event) => boolean) | null; + key?: string | null; + } + ): Decoration; /** * Creates an inline decoration, which adds the given attributes to * each inline node between `from` and `to`. */ - static inline(from: number, to: number, attrs: DecorationAttrs, spec?: { inclusiveStart?: boolean | null, inclusiveEnd?: boolean | null }): Decoration; + static inline( + from: number, + to: number, + attrs: DecorationAttrs, + spec?: { inclusiveStart?: boolean | null; inclusiveEnd?: boolean | null } + ): Decoration; /** * Creates a node decoration. `from` and `to` should point precisely * before and after a node in the document. That node, and only that * node, will receive the given attributes. */ - static node(from: number, to: number, attrs: DecorationAttrs, spec?: { [key: string]: any }): Decoration; + static node( + from: number, + to: number, + attrs: DecorationAttrs, + spec?: { [key: string]: any } + ): Decoration; } /** * A set of attributes to add to a decorated node. Most properties @@ -78,7 +102,7 @@ export interface DecorationAttrs { * compare them. This is a persistent data structure—it is not * modified, updates create a new value. */ -export class DecorationSet { +export class DecorationSet { /** * Find all decorations in this set which touch the given range * (including decorations that start or end directly at the @@ -87,28 +111,39 @@ export class DecorationSet { * considered. When `predicate` isn't given, all decorations are * asssumed to match. */ - find(start?: number, end?: number, predicate?: (spec: { [key: string]: any }) => boolean): Decoration[]; + find( + start?: number, + end?: number, + predicate?: (spec: { [key: string]: any }) => boolean + ): Decoration[]; /** * Map the set of decorations in response to a change in the * document. */ - map(mapping: Mapping, doc: ProsemirrorNode, options?: { onRemove?: ((decorationSpec: { [key: string]: any }) => void) | null }): DecorationSet; + map( + mapping: Mapping, + doc: ProsemirrorNode, + options?: { onRemove?: ((decorationSpec: { [key: string]: any }) => void) | null } + ): DecorationSet; /** * Add the given array of decorations to the ones in the set, * producing a new set. Needs access to the current document to * create the appropriate tree structure. */ - add(doc: ProsemirrorNode, decorations: Decoration[]): DecorationSet; + add(doc: ProsemirrorNode, decorations: Decoration[]): DecorationSet; /** * Create a new set that contains the decorations in this set, minus * the ones in the given array. */ - remove(decorations: Decoration[]): DecorationSet; + remove(decorations: Decoration[]): DecorationSet; /** * Create a set of decorations, using the structure of the given * document. */ - static create(doc: ProsemirrorNode, decorations: Decoration[]): DecorationSet; + static create( + doc: ProsemirrorNode, + decorations: Decoration[] + ): DecorationSet; /** * The empty set of decorations. */ @@ -119,7 +154,7 @@ export class DecorationSet { * editable document. Its state and behavior are determined by its * [props](#view.DirectEditorProps). */ -export class EditorView { +export class EditorView { /** * Create a view. `place` may be a DOM node that the editor should * be appended to, a function that will place it into the document, @@ -127,11 +162,14 @@ export class EditorView { * document container. If it is `null`, the editor will not be added * to the document. */ - constructor(place: Node | ((p: Node) => void) | { mount: Node } | undefined, props: DirectEditorProps); + constructor( + place: Node | ((p: Node) => void) | { mount: Node } | undefined, + props: DirectEditorProps + ); /** * The view's current [state](#state.EditorState). */ - state: EditorState; + state: EditorState; /** * An editable DOM node containing the document. (You probably * should not directly interfere with its content.) @@ -142,27 +180,27 @@ export class EditorView { * information about the dragged slice and whether it is being * copied or moved. At any other time, it is null. */ - dragging?: { slice: Slice, move: boolean } | null; + dragging?: { slice: Slice; move: boolean } | null; /** * The view's current [props](#view.EditorProps). */ - props: DirectEditorProps; + props: DirectEditorProps; /** * Update the view's props. Will immediately cause an update to * the DOM. */ - update(props: DirectEditorProps): void; + update(props: DirectEditorProps): void; /** * Update the view by updating existing props object with the object * given as argument. Equivalent to `view.update(Object.assign({}, * view.props, props))`. */ - setProps(props: DirectEditorProps): void; + setProps(props: DirectEditorProps): void; /** * Update the editor's `state` prop, without touching any of the * other props. */ - updateState(state: EditorState): void; + updateState(state: EditorState): void; /** * Goes over the values of a prop, first those provided directly, * then those from plugins (in order), and calls `f` every time a @@ -196,20 +234,23 @@ export class EditorView { * inner node that the position falls inside of, or -1 if it is at * the top level, not in any node. */ - posAtCoords(coords: { left: number, top: number }): { pos: number, inside: number } | null | void; + posAtCoords(coords: { + left: number; + top: number; + }): { pos: number; inside: number } | null | void; /** * Returns the viewport rectangle at a given document position. `left` * and `right` will be the same number, as this returns a flat * cursor-ish rectangle. */ - coordsAtPos(pos: number): { left: number, right: number, top: number, bottom: number }; + coordsAtPos(pos: number): { left: number; right: number; top: number; bottom: number }; /** * Find the DOM position that corresponds to the given document * position. Note that you should **not** mutate the editor's * internal DOM, only inspect it (and even that is usually not * necessary). */ - domAtPos(pos: number): { node: Node, offset: number }; + domAtPos(pos: number): { node: Node; offset: number }; /** * Find out whether the selection is at the end of a textblock when * moving in a given direction. When, for example, given `"left"`, @@ -218,7 +259,10 @@ export class EditorView { * to the view's current state by default, but it is possible to * pass a different state. */ - endOfTextblock(dir: "up" | "down" | "left" | "right" | "forward" | "backward", state?: EditorState): boolean; + endOfTextblock( + dir: 'up' | 'down' | 'left' | 'right' | 'forward' | 'backward', + state?: EditorState + ): boolean; /** * Removes the editor from the DOM and destroys all [node * views](#view.NodeView). @@ -233,7 +277,7 @@ export class EditorView { * This method is bound to the view instance, so that it can be * easily passed around. */ - dispatch(tr: Transaction): void; + dispatch(tr: Transaction): void; } /** * Props are configuration values that can be passed to an editor view @@ -250,7 +294,7 @@ export class EditorView { * them returns true. For some props, the first plugin that yields a * value gets precedence. */ -export interface EditorProps { +export interface EditorProps { /** * Can be an object mapping DOM event type names to functions that * handle them. Such functions will be called before any handling @@ -260,78 +304,115 @@ export interface EditorProps { * `preventDefault` yourself (or not, if you want to allow the * default behavior). */ - handleDOMEvents?: { [name: string]: (view: EditorView, event: Event) => boolean } | null; + handleDOMEvents?: { [name: string]: (view: EditorView, event: Event) => boolean } | null; /** * Called when the editor receives a `keydown` event. */ - handleKeyDown?: ((view: EditorView, event: KeyboardEvent) => boolean) | null; + handleKeyDown?: ((view: EditorView, event: KeyboardEvent) => boolean) | null; /** * Handler for `keypress` events. */ - handleKeyPress?: ((view: EditorView, event: KeyboardEvent) => boolean) | null; + handleKeyPress?: ((view: EditorView, event: KeyboardEvent) => boolean) | null; /** * Whenever the user directly input text, this handler is called * before the input is applied. If it returns `true`, the default * behavior of actually inserting the text is suppressed. */ - handleTextInput?: ((view: EditorView, from: number, to: number, text: string) => boolean) | null; + handleTextInput?: + | ((view: EditorView, from: number, to: number, text: string) => boolean) + | null; /** * Called for each node around a click, from the inside out. The * `direct` flag will be true for the inner node. */ - handleClickOn?: ((view: EditorView, pos: number, node: ProsemirrorNode, nodePos: number, event: MouseEvent, direct: boolean) => boolean) | null; + handleClickOn?: + | (( + view: EditorView, + pos: number, + node: ProsemirrorNode, + nodePos: number, + event: MouseEvent, + direct: boolean + ) => boolean) + | null; /** * Called when the editor is clicked, after `handleClickOn` handlers * have been called. */ - handleClick?: ((view: EditorView, pos: number, event: MouseEvent) => boolean) | null; + handleClick?: ((view: EditorView, pos: number, event: MouseEvent) => boolean) | null; /** * Called for each node around a double click. */ - handleDoubleClickOn?: ((view: EditorView, pos: number, node: ProsemirrorNode, nodePos: number, event: MouseEvent, direct: boolean) => boolean) | null; + handleDoubleClickOn?: + | (( + view: EditorView, + pos: number, + node: ProsemirrorNode, + nodePos: number, + event: MouseEvent, + direct: boolean + ) => boolean) + | null; /** * Called when the editor is double-clicked, after `handleDoubleClickOn`. */ - handleDoubleClick?: ((view: EditorView, pos: number, event: MouseEvent) => boolean) | null; + handleDoubleClick?: ((view: EditorView, pos: number, event: MouseEvent) => boolean) | null; /** * Called for each node around a triple click. */ - handleTripleClickOn?: ((view: EditorView, pos: number, node: ProsemirrorNode, nodePos: number, event: MouseEvent, direct: boolean) => boolean) | null; + handleTripleClickOn?: + | (( + view: EditorView, + pos: number, + node: ProsemirrorNode, + nodePos: number, + event: MouseEvent, + direct: boolean + ) => boolean) + | null; /** * Called when the editor is triple-clicked, after `handleTripleClickOn`. */ - handleTripleClick?: ((view: EditorView, pos: number, event: MouseEvent) => boolean) | null; + handleTripleClick?: ((view: EditorView, pos: number, event: MouseEvent) => boolean) | null; /** * Can be used to override the behavior of pasting. `slice` is the * pasted content parsed by the editor, but you can directly access * the event to get at the raw content. */ - handlePaste?: ((view: EditorView, event: Event, slice: Slice) => boolean) | null; + handlePaste?: ((view: EditorView, event: Event, slice: Slice) => boolean) | null; /** * Called when something is dropped on the editor. `moved` will be * true if this drop moves from the current selection (which should * thus be deleted). */ - handleDrop?: ((view: EditorView, event: Event, slice: Slice, moved: boolean) => boolean) | null; + handleDrop?: + | ((view: EditorView, event: Event, slice: Slice, moved: boolean) => boolean) + | null; /** * Called when the view, after updating its state, tries to scroll * the selection into view. A handler function may return false to * indicate that it did not handle the scrolling and further * handlers or the default behavior should be tried. */ - handleScrollToSelection?: ((view: EditorView) => boolean) | null; + handleScrollToSelection?: ((view: EditorView) => boolean) | null; /** * Can be used to override the way a selection is created when * reading a DOM selection between the given anchor and head. */ - createSelectionBetween?: ((view: EditorView, anchor: ResolvedPos, head: ResolvedPos) => Selection | null | void) | null; + createSelectionBetween?: + | (( + view: EditorView, + anchor: ResolvedPos, + head: ResolvedPos + ) => Selection | null | void) + | null; /** * The [parser](#model.DOMParser) to use when reading editor changes * from the DOM. Defaults to calling * [`DOMParser.fromSchema`](#model.DOMParser^fromSchema) on the * editor's schema. */ - domParser?: DOMParser | null; + domParser?: DOMParser | null; /** * Can be used to transform pasted HTML text, _before_ it is parsed, * for example to clean it up. @@ -342,7 +423,7 @@ export interface EditorProps { * the clipboard. When not given, the value of the * [`domParser`](#view.EditorProps.domParser) prop is used. */ - clipboardParser?: DOMParser | null; + clipboardParser?: DOMParser | null; /** * Transform pasted plain text. */ @@ -355,12 +436,12 @@ export interface EditorProps { * in `

` tags, and call * [`clipboardParser`](#view.EditorProps.clipboardParser) on it. */ - clipboardTextParser?: ((text: string, $context: ResolvedPos) => Slice) | null; + clipboardTextParser?: ((text: string, $context: ResolvedPos) => Slice) | null; /** * Can be used to transform pasted content before it is applied to * the document. */ - transformPasted?: ((p: Slice) => Slice) | null; + transformPasted?: ((p: Slice) => Slice) | null; /** * Allows you to pass custom rendering and behavior logic for nodes * and marks. Should map node and mark names to constructor @@ -375,31 +456,38 @@ export interface EditorProps { * they can also be used as a way to provide context information to * the node view without adding it to the document itself. */ - nodeViews?: { [name: string]: (node: ProsemirrorNode, view: EditorView, getPos: () => number, decorations: Decoration[]) => NodeView } | null; + nodeViews?: { + [name: string]: ( + node: ProsemirrorNode, + view: EditorView, + getPos: () => number, + decorations: Decoration[] + ) => NodeView; + } | null; /** * The DOM serializer to use when putting content onto the * clipboard. If not given, the result of * [`DOMSerializer.fromSchema`](#model.DOMSerializer^fromSchema) * will be used. */ - clipboardSerializer?: DOMSerializer | null; + clipboardSerializer?: DOMSerializer | null; /** * A function that will be called to get the text for the current * selection when copying text to the clipboard. By default, the * editor will use [`textBetween`](#model.Node.textBetween) on the * selected range. */ - clipboardTextSerializer?: ((p: Slice) => string) | null; + clipboardTextSerializer?: ((p: Slice) => string) | null; /** * A set of [document decorations](#view.Decoration) to show in the * view. */ - decorations?: ((state: EditorState) => DecorationSet | null | void) | null; + decorations?: ((state: EditorState) => DecorationSet | null | void) | null; /** * When this returns false, the content of the view is not directly * editable. */ - editable?: ((state: EditorState) => boolean) | null; + editable?: ((state: EditorState) => boolean) | null; /** * Control the DOM attributes of the editable element. May be either * an object or a function going from an editor state to an object. @@ -410,7 +498,10 @@ export interface EditorProps { * the value provided first (as in * [`someProp`](#view.EditorView.someProp)) will be used. */ - attributes?: { [name: string]: string } | ((p: EditorState) => { [name: string]: string } | null | void) | null; + attributes?: + | { [name: string]: string } + | ((p: EditorState) => { [name: string]: string } | null | void) + | null; /** * Determines the distance (in pixels) between the cursor and the * end of the visible viewport at which point, when scrolling the @@ -427,11 +518,11 @@ export interface EditorProps { * The props object given directly to the editor view supports two * fields that can't be used in plugins: */ -export interface DirectEditorProps extends EditorProps { +export interface DirectEditorProps extends EditorProps { /** * The current state of the editor. */ - state: EditorState; + state: EditorState; /** * The callback over which to send transactions (state updates) * produced by the view. If you specify this, you probably want to @@ -440,7 +531,7 @@ export interface DirectEditorProps extends EditorProps { * state that has the transaction * [applied](#state.EditorState.apply). */ - dispatchTransaction?: ((tr: Transaction) => void) | null; + dispatchTransaction?: ((tr: Transaction) => void) | null; } /** * By default, document nodes are rendered using the result of the @@ -452,7 +543,7 @@ export interface DirectEditorProps extends EditorProps { * * Objects returned as node views must conform to this interface. */ -export interface NodeView { +export interface NodeView { /** * The outer DOM node that represents the document node. When not * given, the default strategy is used to create a DOM node. @@ -477,7 +568,7 @@ export interface NodeView { * no `dom` property), updating its child nodes will be handled by * ProseMirror. */ - update?: ((node: ProsemirrorNode, decorations: Decoration[]) => boolean) | null; + update?: ((node: ProsemirrorNode, decorations: Decoration[]) => boolean) | null; /** * Can be used to override the way the node's selected status (as a * node selection) is displayed. From 363064fd25970814fe08a66549962530d26a753b Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Fri, 20 Apr 2018 19:33:07 +0200 Subject: [PATCH 0776/2153] chai: Add Date comparison overloads (#25163) --- types/chai/chai-tests.ts | 60 ++++++++++++++++++++++++++++++++++++++++ types/chai/index.d.ts | 4 ++- 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/types/chai/chai-tests.ts b/types/chai/chai-tests.ts index 57b7d127ac..f19514fe71 100644 --- a/types/chai/chai-tests.ts +++ b/types/chai/chai-tests.ts @@ -191,6 +191,18 @@ function within() { expect(10).to.be.within(50, 100, 'blah'); (10).should.be.within(50, 100, 'blah'); + expect(new Date('December 17, 1995 03:24:30')).to.not.be.within(new Date('December 17, 1995 03:24:20'), new Date('December 17, 1995 03:24:40')); + new Date('December 17, 1995 03:24:30').should.not.be.within(new Date('December 17, 1995 03:24:20'), new Date('December 17, 1995 03:24:40')); + + expect(new Date('December 17, 1995 03:24:30')).to.be.within(new Date('December 17, 1995 03:24:20'), new Date('December 17, 1995 03:24:40')); + new Date('December 17, 1995 03:24:30').should.be.within(new Date('December 17, 1995 03:24:20'), new Date('December 17, 1995 03:24:40')); + + expect(new Date('December 17, 1995 03:24:30')).to.not.be.within(new Date('December 17, 1995 03:24:20'), new Date('December 17, 1995 03:24:40'), 'blah'); + new Date('December 17, 1995 03:24:30').should.not.be.within(new Date('December 17, 1995 03:24:20'), new Date('December 17, 1995 03:24:40'), 'blah'); + + expect(new Date('December 17, 1995 03:24:30')).to.be.within(new Date('December 17, 1995 03:24:20'), new Date('December 17, 1995 03:24:40'), 'blah'); + new Date('December 17, 1995 03:24:30').should.be.within(new Date('December 17, 1995 03:24:20'), new Date('December 17, 1995 03:24:40'), 'blah'); + expect('foo').to.have.length.within(5, 7, 'blah'); 'foo'.should.have.length.within(5, 7, 'blah'); @@ -218,6 +230,18 @@ function above() { expect(10).to.not.be.above(6, 'blah'); (10).should.not.be.above(6, 'blah'); + expect(new Date('December 17, 1995 03:24:30')).to.not.be.above(new Date('December 17, 1995 03:24:20')); + new Date('December 17, 1995 03:24:30').should.not.be.above(new Date('December 17, 1995 03:24:20')); + + expect(new Date('December 17, 1995 03:24:30')).to.be.above(new Date('December 17, 1995 03:24:20')); + new Date('December 17, 1995 03:24:30').should.be.above(new Date('December 17, 1995 03:24:20')); + + expect(new Date('December 17, 1995 03:24:30')).to.not.be.above(new Date('December 17, 1995 03:24:20'), 'blah'); + new Date('December 17, 1995 03:24:30').should.not.be.above(new Date('December 17, 1995 03:24:20'), 'blah'); + + expect(new Date('December 17, 1995 03:24:30')).to.be.above(new Date('December 17, 1995 03:24:20'), 'blah'); + new Date('December 17, 1995 03:24:30').should.be.above(new Date('December 17, 1995 03:24:20'), 'blah'); + expect('foo').to.have.length.above(4, 'blah'); 'foo'.should.have.length.above(4, 'blah'); @@ -243,6 +267,18 @@ function least() { expect(10).to.not.be.at.least(6, 'blah'); (10).should.not.be.at.least(6, 'blah'); + expect(new Date('December 17, 1995 03:24:30')).to.not.be.least(new Date('December 17, 1995 03:24:20')); + new Date('December 17, 1995 03:24:30').should.not.be.least(new Date('December 17, 1995 03:24:20')); + + expect(new Date('December 17, 1995 03:24:30')).to.be.least(new Date('December 17, 1995 03:24:20')); + new Date('December 17, 1995 03:24:30').should.be.least(new Date('December 17, 1995 03:24:20')); + + expect(new Date('December 17, 1995 03:24:30')).to.not.be.least(new Date('December 17, 1995 03:24:20'), 'blah'); + new Date('December 17, 1995 03:24:30').should.not.be.least(new Date('December 17, 1995 03:24:20'), 'blah'); + + expect(new Date('December 17, 1995 03:24:30')).to.be.least(new Date('December 17, 1995 03:24:20'), 'blah'); + new Date('December 17, 1995 03:24:30').should.be.least(new Date('December 17, 1995 03:24:20'), 'blah'); + expect('foo').to.have.length.of.at.least(4, 'blah'); 'foo'.should.have.length.of.at.least(4, 'blah'); @@ -273,6 +309,18 @@ function below() { expect(6).to.not.be.below(10, 'blah'); (6).should.not.be.below(10, 'blah'); + expect(new Date('December 17, 1995 03:24:30')).to.not.be.below(new Date('December 17, 1995 03:24:20')); + new Date('December 17, 1995 03:24:30').should.not.be.below(new Date('December 17, 1995 03:24:20')); + + expect(new Date('December 17, 1995 03:24:30')).to.be.below(new Date('December 17, 1995 03:24:20')); + new Date('December 17, 1995 03:24:30').should.be.below(new Date('December 17, 1995 03:24:20')); + + expect(new Date('December 17, 1995 03:24:30')).to.not.be.below(new Date('December 17, 1995 03:24:20'), 'blah'); + new Date('December 17, 1995 03:24:30').should.not.be.below(new Date('December 17, 1995 03:24:20'), 'blah'); + + expect(new Date('December 17, 1995 03:24:30')).to.be.below(new Date('December 17, 1995 03:24:20'), 'blah'); + new Date('December 17, 1995 03:24:30').should.be.below(new Date('December 17, 1995 03:24:20'), 'blah'); + expect('foo').to.have.length.below(2, 'blah'); 'foo'.should.have.length.below(2, 'blah'); @@ -300,6 +348,18 @@ function most() { expect(6).to.not.be.at.most(10, 'blah'); (6).should.not.be.at.most(10, 'blah'); + expect(new Date('December 17, 1995 03:24:30')).to.not.be.most(new Date('December 17, 1995 03:24:20')); + new Date('December 17, 1995 03:24:30').should.not.be.most(new Date('December 17, 1995 03:24:20')); + + expect(new Date('December 17, 1995 03:24:30')).to.be.most(new Date('December 17, 1995 03:24:20')); + new Date('December 17, 1995 03:24:30').should.be.most(new Date('December 17, 1995 03:24:20')); + + expect(new Date('December 17, 1995 03:24:30')).to.not.be.most(new Date('December 17, 1995 03:24:20'), 'blah'); + new Date('December 17, 1995 03:24:30').should.not.be.most(new Date('December 17, 1995 03:24:20'), 'blah'); + + expect(new Date('December 17, 1995 03:24:30')).to.be.most(new Date('December 17, 1995 03:24:20'), 'blah'); + new Date('December 17, 1995 03:24:30').should.be.most(new Date('December 17, 1995 03:24:20'), 'blah'); + expect('foo').to.have.length.of.at.most(2, 'blah'); 'foo'.should.have.length.of.at.most(2, 'blah'); diff --git a/types/chai/index.d.ts b/types/chai/index.d.ts index 02bca8909f..d0f5ab099c 100644 --- a/types/chai/index.d.ts +++ b/types/chai/index.d.ts @@ -9,6 +9,7 @@ // Shaun Luttin // Gintautas Miselis // Satana Charuwichitratana +// Erik Schierboom // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Chai { @@ -150,10 +151,11 @@ declare namespace Chai { most: NumberComparer; lte: NumberComparer; within(start: number, finish: number, message?: string): Assertion; + within(start: Date, finish: Date, message?: string): Assertion; } interface NumberComparer { - (value: number, message?: string): Assertion; + (value: number | Date, message?: string): Assertion; } interface TypeComparison { From 4bc92af1335740a888eb6203683d00a7546e3e05 Mon Sep 17 00:00:00 2001 From: Abram Booth Date: Fri, 20 Apr 2018 13:35:02 -0400 Subject: [PATCH 0777/2153] Allow augmenting DS namespace (#25174) see Microsoft/TypeScript#11034 --- types/ember-data/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/ember-data/index.d.ts b/types/ember-data/index.d.ts index 5e4fa4eb60..a5918f9375 100644 --- a/types/ember-data/index.d.ts +++ b/types/ember-data/index.d.ts @@ -43,7 +43,7 @@ declare module 'ember-data' { isRelationship: true; } - namespace DS { + export namespace DS { /** * Convert an hash of errors into an array with errors in JSON-API format. */ From 3bd123248502acfbd50596957db94c11b393c07e Mon Sep 17 00:00:00 2001 From: Avi Vahl Date: Fri, 20 Apr 2018 20:36:06 +0300 Subject: [PATCH 0778/2153] [react-is] Initial package typings (#25176) * [react-is] Initial typings for package React introduced the react-is for assertions on elements and element types. I took the README and tests and created the matching ts types. * Add TypeScript 2.6 comment this package uses @types/react, and it requires 2.6 or above. * Match strictFunctionTypes config of react * Remove unneeded generics per https://github.com/Microsoft/dtslint/blob/master/docs/no-unnecessary-generics.md React uses this pattern (providing the Props interface via generics) and turned off the linting. We'll use the default lint options and `any` props. * Use ReactType instead of an explicit union * Cleanup unused imports --- types/react-is/index.d.ts | 26 +++++++++++ types/react-is/react-is-tests.tsx | 74 +++++++++++++++++++++++++++++++ types/react-is/tsconfig.json | 25 +++++++++++ types/react-is/tslint.json | 1 + 4 files changed, 126 insertions(+) create mode 100644 types/react-is/index.d.ts create mode 100644 types/react-is/react-is-tests.tsx create mode 100644 types/react-is/tsconfig.json create mode 100644 types/react-is/tslint.json diff --git a/types/react-is/index.d.ts b/types/react-is/index.d.ts new file mode 100644 index 0000000000..f088b1bcc9 --- /dev/null +++ b/types/react-is/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for react-is 16.3 +// Project: https://reactjs.org/ +// Definitions by: Avi Vahl +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +export as namespace ReactIs; + +import { ReactElement, ReactType } from 'react'; + +export function typeOf(value: any): symbol | undefined; +export function isValidElementType(value: any): value is ReactType; + +export function isContextConsumer(value: any): value is ReactElement; +export function isContextProvider(value: any): value is ReactElement; +export function isElement(value: any): value is ReactElement; +export function isFragment(value: any): value is ReactElement; +export function isPortal(value: any): value is ReactElement; +export function isStrictMode(value: any): value is ReactElement; + +export const ContextProvider: symbol; +export const ContextConsumer: symbol; +export const Element: symbol; +export const Fragment: symbol; +export const Portal: symbol; +export const StrictMode: symbol; diff --git a/types/react-is/react-is-tests.tsx b/types/react-is/react-is-tests.tsx new file mode 100644 index 0000000000..a03ad7b534 --- /dev/null +++ b/types/react-is/react-is-tests.tsx @@ -0,0 +1,74 @@ +import * as React from 'react'; +import * as ReactDOM from 'react-dom'; +import * as ReactIs from 'react-is'; + +// Below is taken from README of react-is +// Determining if a Component is Valid + +interface CompProps { + forwardedRef?: React.Ref; + children?: React.ReactNode; +} + +class ClassComponent extends React.Component { + render() { + return React.createElement('div'); + } +} + +const StatelessComponent = () => React.createElement('div'); + +const ForwardRefComponent = React.forwardRef((props, ref) => + React.createElement(ClassComponent, { forwardedRef: ref, ...props }) +); + +const Context = React.createContext(false); + +ReactIs.isValidElementType('div'); // true +ReactIs.isValidElementType(ClassComponent); // true +ReactIs.isValidElementType(StatelessComponent); // true +ReactIs.isValidElementType(ForwardRefComponent); // true +ReactIs.isValidElementType(Context.Provider); // true +ReactIs.isValidElementType(Context.Consumer); // true +ReactIs.isValidElementType(React.createFactory('div')); // true + +// Determining an Element's Type + +// AsyncMode - unstable_AsyncMode is not implemented in @types/react yet +// ReactIs.isAsyncMode(); // true +// ReactIs.typeOf() === ReactIs.AsyncMode; // true + +// Context +const ThemeContext = React.createContext('blue'); + +ReactIs.isContextConsumer(); // true +ReactIs.isContextProvider(); // true +ReactIs.typeOf() === ReactIs.ContextConsumer; // true +ReactIs.typeOf() === ReactIs.ContextProvider; // true + +// Element +ReactIs.isElement(

); // true +ReactIs.typeOf(
) === ReactIs.Element; // true + +// Fragment +ReactIs.isFragment(<>); // true +ReactIs.typeOf(<>) === ReactIs.Fragment; // true + +// Portal +const div = document.createElement('div'); +const portal = ReactDOM.createPortal(
, div); + +ReactIs.isPortal(portal); // true +ReactIs.typeOf(portal) === ReactIs.Portal; // true + +// StrictMode +ReactIs.isStrictMode(); // true +ReactIs.typeOf() === ReactIs.StrictMode; // true + +// Verify typeOf accepts any type of value (taken from tests of react-is) +ReactIs.typeOf('abc') === undefined; +ReactIs.typeOf(true) === undefined; +ReactIs.typeOf(123) === undefined; +ReactIs.typeOf({}) === undefined; +ReactIs.typeOf(null) === undefined; +ReactIs.typeOf(undefined) === undefined; diff --git a/types/react-is/tsconfig.json b/types/react-is/tsconfig.json new file mode 100644 index 0000000000..9ef6f3da96 --- /dev/null +++ b/types/react-is/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": false, + "jsx": "preserve" + }, + "files": [ + "index.d.ts", + "react-is-tests.tsx" + ] +} diff --git a/types/react-is/tslint.json b/types/react-is/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-is/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From f38bda6988e396db11ba424fe5b946895a984bea Mon Sep 17 00:00:00 2001 From: tbounsiar Date: Fri, 20 Apr 2018 19:37:27 +0200 Subject: [PATCH 0779/2153] React owl carousel (#25170) * adding react-owl-carousel types * Update Definitions by list Fix Test error * Fix tslint Fix tsconfig * Add docs Fix Bugs --- types/react-owl-carousel/index.d.ts | 414 ++++++++++++++++++ .../react-owl-carousel-tests.tsx | 30 ++ types/react-owl-carousel/tsconfig.json | 26 ++ types/react-owl-carousel/tslint.json | 3 + 4 files changed, 473 insertions(+) create mode 100644 types/react-owl-carousel/index.d.ts create mode 100644 types/react-owl-carousel/react-owl-carousel-tests.tsx create mode 100644 types/react-owl-carousel/tsconfig.json create mode 100644 types/react-owl-carousel/tslint.json diff --git a/types/react-owl-carousel/index.d.ts b/types/react-owl-carousel/index.d.ts new file mode 100644 index 0000000000..bcd9af38b5 --- /dev/null +++ b/types/react-owl-carousel/index.d.ts @@ -0,0 +1,414 @@ +// Type definitions for react-owl-carousel 2.2 +// Project: https://github.com/seal789ie/react-owl-carousel +// Definitions by: T Bounsiar , Ismael Gorissen , Kenneth Ceyer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from "react"; + +export type HandlerCallback = (...args: any[]) => void; + +export interface Options { + // OPTIONS + /** + * Default: + * Adding a -striped className to OwlCarousel. + */ + className?: string; + /** + * Default: 3 + * The number of items you want to see on the screen. + */ + items?: number; + /** + * Default: 0 + * margin-right(px) on item. + */ + margin?: number; + /** + * Default: false + * Infinity loop. Duplicate last and first items to get loop illusion. + */ + loop?: boolean; + /** + * Default: false + * Center item. Works well with even an odd number of items. + */ + center?: boolean; + /** + * Default: true + * Mouse drag enabled. + */ + mouseDrag?: boolean; + /** + * Default: true + * Touch drag enabled. + */ + touchDrag?: boolean; + /** + * Default: true + * Stage pull to edge. + */ + pullDrag?: boolean; + /** + * Default: false + * Item pull to edge. + */ + freeDrag?: boolean; + /** + * Default: 0 + * Padding left and right on stage (can see neighbours). + */ + stagePadding?: number; + /** + * Default: false + * Merge items. Looking for data-merge='{number}' inside item. + */ + merge?: boolean; + /** + * Default: true + * Fit merged items if screen is smaller than items value. + */ + mergeFit?: boolean; + /** + * Default: false + * Set non grid content. Try using width style on divs. + */ + autoWidth?: boolean; + /** + * Default: 0 + * Start position or URL Hash string like '#id'. + */ + startPosition?: number | string; + /** + * Default: false + * Listen to url hash changes. data-hash on items is required. + */ + URLhashListener?: boolean; + /** + * Default: false + * Show next/prev buttons. + */ + nav?: boolean; + /** + * Default: true + * Go backwards when the boundary has reached. + */ + rewind?: boolean; + /** + * Default: ['next','prev'] + * HTML allowed. + */ + navText?: string[]; + /** + * Default: div + * DOM element type for a single directional navigation link. + */ + navElement?: string; + /** + * Default: 1 + * Navigation slide by x. 'page' string can be set to slide by page. + */ + slideBy?: number | string; + /** + * Default: true + * Show dots navigation. + */ + dots?: boolean; + /** + * Default: false + * Show dots each x item. + */ + dotsEach?: number | boolean; + /** + * Default: false + * Used by data-dot content. + */ + dotData?: boolean; + /** + * Default: false + * Lazy load images. data-src and data-src-retina for highres. + * Also load images into background inline style if element is not . + */ + lazyLoad?: boolean; + /** + * Default: false + * lazyContent was introduced during beta tests but i removed it from the final release due to bad implementation. + * It is a nice options so i will work on it in the nearest feature. + */ + lazyContent?: boolean; + /** + * Default: false + * Autoplay. + */ + autoplay?: boolean; + /** + * Default: 5000 + * Autoplay interval timeout. + */ + autoplayTimeout?: number; + /** + * Default: false + * Pause on mouse hover. + */ + autoplayHoverPause?: boolean; + /** + * Default: 250 + * Speed Calculate. More info to come.. + */ + smartSpeed?: number | boolean; + /** + * Default: Number + * Speed Calculate. More info to come.. + */ + fluidSpeed?: number | boolean; + /** + * Default: false + * autoplay speed. + */ + autoplaySpeed?: number | boolean; + /** + * Default: false + * Navigation speed. + */ + navSpeed?: number | boolean; + /** + * Default: Number/Boolean + * Pagination speed. + */ + dotsSpeed?: number | boolean; + /** + * Default: false + * Drag end speed. + */ + dragEndSpeed?: number | boolean; + /** + * Default: true + * Enable callback events. + */ + callbacks?: boolean; + /** + * Default: empty object + * Object containing responsive options. Can be set to false to remove responsive capabilities.. + */ + responsive?: { [breakpoint: string]: Options }; + /** + * Default: 200 + * Responsive refresh rate. + */ + responsiveRefreshRate?: number; + /** + * Default: window + * Set on any DOM element. + * If you care about non responsive browser (like ie8) then use it on main wrapper. This will prevent from crazy resizing. + */ + responsiveBaseElement?: Element; + /** + * Default: false + * Enable fetching YouTube/Vimeo/Vzaar videos. + */ + video?: boolean; + /** + * Default: false + * Set height for videos. + */ + videoHeight?: number | boolean; + /** + * Default: false + * Set width for videos. + */ + videoWidth?: number | boolean; + /** + * Default: false + * Class for CSS3 animation out. + */ + animateOut?: string | boolean; + /** + * Default: false + * Class for CSS3 animation in. + */ + animateIn?: string | boolean; + /** + * Default: swing + * Easing for CSS2 $.animate. + */ + fallbackEasing?: string; + /** + * Default: false + * Callback to retrieve basic information (current item/pages/widths). + * Info function second parameter is Owl DOM object reference. + */ + info?: HandlerCallback; + /** + * Default: false + * Use it if owl items are deep nested inside some generated content. E.g 'youritem'. Dont use dot before class name. + */ + nestedItemSelector?: string; + /** + * Default: div + * DOM element type for owl-item. + */ + itemElement?: string; + /** + * Default: div + * DOM element type for owl-stage. + */ + stageElement?: string; + /** + * Default: false + * Set your own container for nav. + */ + navContainer?: string | boolean; + /** + * Default: false + * Set your own container for nav. + */ + dotsContainer?: string | boolean; + + // CLASSES + /** + * Default: owl-refresh + * Class during refresh. + */ + refreshClass?: string; + /** + * Default: owl-loading + * Class during load. + */ + loadingClass?: string; + /** + * Default: owl-loaded + * Class after load. + */ + loadedClass?: string; + /** + * Default: owl-rtl + * Class for right to left mode. + */ + rtlClass?: string; + /** + * Default: owl-drag + * Class for mouse drag mode. + */ + dragClass?: string; + /** + * Default: owl-grab + * Class during mouse drag. + */ + grabClass?: string; + /** + * Default: owl-stage + * Stage class. + */ + stageClass?: string; + /** + * Default: owl-stage-outer + * Stage outer class. + */ + stageOuterClass?: string; + /** + * Default: owl-nav + * Navigation container class. + */ + navContainerClass?: string; + /** + * Default: ['owl-prev','owl-next'] + * Navigation buttons classes. + */ + navClass?: string[]; + /** + * Default: owl-controls + * Controls container class - wrapper for navs and dots. + */ + controlsClass?: string; + /** + * Default: owl-dot + * Dot Class. + */ + dotClass?: string; + /** + * Default: owl-dots + * Dots container class. + */ + dotsClass?: string; + /** + * Default: owl-height + * Auto height class. + */ + autoHeightClass?: string; + /** + * Default: false + * Optional helper class. + * Add '-' class to main element. Can be used to stylize content on given breakpoint. + */ + responsiveClass?: string | boolean; + + // EVENTS + /** + * When the plugin initializes. + */ + onInitialize?: HandlerCallback; + /** + * When the plugin has initialized. + */ + onInitialized?: HandlerCallback; + /** + * When the plugin gets resized. + */ + onResize?: HandlerCallback; + /** + * When the plugin has resized. + */ + onResized?: HandlerCallback; + /** + * When the internal state of the plugin needs update. + */ + onRefresh?: HandlerCallback; + /** + * When the internal state of the plugin has updated. + */ + onRefreshed?: HandlerCallback; + /** + * When the dragging of an item is started. + */ + onDrag?: HandlerCallback; + /** + * When the dragging of an item has finished. + */ + onDragged?: HandlerCallback; + /** + * When the translation of the stage starts. + */ + onTranslate?: HandlerCallback; + /** + * When the translation of the stage has finished. + */ + onTranslated?: HandlerCallback; + /** + * When a property is going to change its value. + */ + onChange?: HandlerCallback; + /** + * When a property has changed its value. + */ + onChanged?: HandlerCallback; + /** + * When lazy image loads. + */ + onLoadLazy?: HandlerCallback; + /** + * When lazy image has loaded. + */ + onLoadedLazy?: HandlerCallback; + /** + * When video has unloaded. + */ + onStopVideo?: HandlerCallback; + /** + * When video has loaded. + */ + onPlayVideo?: HandlerCallback; +} + +export default class OwlCarousel extends React.Component { +} diff --git a/types/react-owl-carousel/react-owl-carousel-tests.tsx b/types/react-owl-carousel/react-owl-carousel-tests.tsx new file mode 100644 index 0000000000..ba65ca9557 --- /dev/null +++ b/types/react-owl-carousel/react-owl-carousel-tests.tsx @@ -0,0 +1,30 @@ +import * as React from "react"; +import * as ReactDOM from 'react-dom'; + +// Import React Owl Carousel +import OwlCarousel from "react-owl-carousel"; + +export class ReactOwlCarouselTest extends React.Component { + render() { + return ( +
+ +

1

+

2

+

3

+

4

+

5

+

6

+

7

+

8

+

9

+

10

+

11

+

12

+
+
+ ); + } +} + +ReactDOM.render(, document.getElementById("root")); diff --git a/types/react-owl-carousel/tsconfig.json b/types/react-owl-carousel/tsconfig.json new file mode 100644 index 0000000000..3733b428c9 --- /dev/null +++ b/types/react-owl-carousel/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "jsx": "react", + "strictNullChecks": true, + "strictFunctionTypes": true, + "noImplicitAny": true, + "noImplicitThis": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true, + "experimentalDecorators": true + }, + "files": [ + "index.d.ts", + "react-owl-carousel-tests.tsx" + ] +} diff --git a/types/react-owl-carousel/tslint.json b/types/react-owl-carousel/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/react-owl-carousel/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From ce61935ac80e1cd10c47defee0fdebba6da2a322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Dal=C3=A9n?= Date: Fri, 20 Apr 2018 19:38:45 +0200 Subject: [PATCH 0780/2153] Make all options optional (#25160) The package uses `Object.assign` and has default values, so these are all optional: https://github.com/SamVerschueren/aws-lambda-mock-context/blob/master/index.js#L11-L18 --- types/aws-lambda-mock-context/index.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/types/aws-lambda-mock-context/index.d.ts b/types/aws-lambda-mock-context/index.d.ts index 6fc5fda67a..b5a3768f2d 100644 --- a/types/aws-lambda-mock-context/index.d.ts +++ b/types/aws-lambda-mock-context/index.d.ts @@ -26,10 +26,10 @@ interface Context { } interface Options { - region: string; - account: string; - functionName: string; - functionVersion: string; - memoryLimitInMB: string; + region?: string; + account?: string; + functionName?: string; + functionVersion?: string; + memoryLimitInMB?: string; alias?: string; } From 19493d0fb16f8d86d2935d897b3d1450e0e92a46 Mon Sep 17 00:00:00 2001 From: Hirotaka Ikoma Date: Sat, 21 Apr 2018 02:40:03 +0900 Subject: [PATCH 0781/2153] Add type definitions for pngquant-bin (#25159) --- types/pngquant-bin/index.d.ts | 9 +++++++++ types/pngquant-bin/pngquant-bin-tests.ts | 6 ++++++ types/pngquant-bin/tsconfig.json | 23 +++++++++++++++++++++++ types/pngquant-bin/tslint.json | 1 + 4 files changed, 39 insertions(+) create mode 100644 types/pngquant-bin/index.d.ts create mode 100644 types/pngquant-bin/pngquant-bin-tests.ts create mode 100644 types/pngquant-bin/tsconfig.json create mode 100644 types/pngquant-bin/tslint.json diff --git a/types/pngquant-bin/index.d.ts b/types/pngquant-bin/index.d.ts new file mode 100644 index 0000000000..928ef83333 --- /dev/null +++ b/types/pngquant-bin/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for pngquant-bin 4.0 +// Project: https://github.com/imagemin/pngquant-bin#readme +// Definitions by: Hirotaka Ikoma +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare const pngquant: string; +export = pngquant; diff --git a/types/pngquant-bin/pngquant-bin-tests.ts b/types/pngquant-bin/pngquant-bin-tests.ts new file mode 100644 index 0000000000..40f79d1371 --- /dev/null +++ b/types/pngquant-bin/pngquant-bin-tests.ts @@ -0,0 +1,6 @@ +import { execFile } from "child_process"; +import * as pngquant from "pngquant-bin"; + +execFile(pngquant, ["-o", "output.png", "input.png"], { encoding: "utf-8" }, (err: Error | null) => { + console.log("Image minified!"); +}); diff --git a/types/pngquant-bin/tsconfig.json b/types/pngquant-bin/tsconfig.json new file mode 100644 index 0000000000..770ff62c3f --- /dev/null +++ b/types/pngquant-bin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "pngquant-bin-tests.ts" + ] +} diff --git a/types/pngquant-bin/tslint.json b/types/pngquant-bin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pngquant-bin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From c3748d5c111eedbefd99bf7260e7f05b51307754 Mon Sep 17 00:00:00 2001 From: Hirotaka Ikoma Date: Sat, 21 Apr 2018 02:40:43 +0900 Subject: [PATCH 0782/2153] Add type definitions for mozjpeg (#25155) --- types/mozjpeg/index.d.ts | 9 +++++++++ types/mozjpeg/mozjpeg-tests.ts | 6 ++++++ types/mozjpeg/tsconfig.json | 23 +++++++++++++++++++++++ types/mozjpeg/tslint.json | 1 + 4 files changed, 39 insertions(+) create mode 100644 types/mozjpeg/index.d.ts create mode 100644 types/mozjpeg/mozjpeg-tests.ts create mode 100644 types/mozjpeg/tsconfig.json create mode 100644 types/mozjpeg/tslint.json diff --git a/types/mozjpeg/index.d.ts b/types/mozjpeg/index.d.ts new file mode 100644 index 0000000000..064d7b16e3 --- /dev/null +++ b/types/mozjpeg/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for mozjpeg 5.0 +// Project: https://github.com/imagemin/mozjpeg-bin#readme +// Definitions by: Hirotaka Ikoma +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare const mozjpeg: string; +export = mozjpeg; diff --git a/types/mozjpeg/mozjpeg-tests.ts b/types/mozjpeg/mozjpeg-tests.ts new file mode 100644 index 0000000000..6915acf946 --- /dev/null +++ b/types/mozjpeg/mozjpeg-tests.ts @@ -0,0 +1,6 @@ +import { execFile } from "child_process"; +import * as mozjpeg from "mozjpeg"; + +execFile(mozjpeg, ["-outfile", "output.jpg", "input.jpg"], {encoding: "utf-8"}, (err: Error | null) => { + console.log("Image minified!"); +}); diff --git a/types/mozjpeg/tsconfig.json b/types/mozjpeg/tsconfig.json new file mode 100644 index 0000000000..caea469f46 --- /dev/null +++ b/types/mozjpeg/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "mozjpeg-tests.ts" + ] +} diff --git a/types/mozjpeg/tslint.json b/types/mozjpeg/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mozjpeg/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 8a377075d9150ce48d7530016b765c2ebbf87f80 Mon Sep 17 00:00:00 2001 From: Hirotaka Ikoma Date: Sat, 21 Apr 2018 02:41:04 +0900 Subject: [PATCH 0783/2153] Add type definitions for jpegtran-bin (#25156) --- types/jpegtran-bin/index.d.ts | 9 +++++++++ types/jpegtran-bin/jpegtran-bin-tests.ts | 6 ++++++ types/jpegtran-bin/tsconfig.json | 23 +++++++++++++++++++++++ types/jpegtran-bin/tslint.json | 1 + 4 files changed, 39 insertions(+) create mode 100644 types/jpegtran-bin/index.d.ts create mode 100644 types/jpegtran-bin/jpegtran-bin-tests.ts create mode 100644 types/jpegtran-bin/tsconfig.json create mode 100644 types/jpegtran-bin/tslint.json diff --git a/types/jpegtran-bin/index.d.ts b/types/jpegtran-bin/index.d.ts new file mode 100644 index 0000000000..b946d056b7 --- /dev/null +++ b/types/jpegtran-bin/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for jpegtran-bin 3.2 +// Project: https://github.com/imagemin/jpegtran-bin#readme +// Definitions by: Hirotaka Ikoma +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare const jpegtran: string; +export = jpegtran; diff --git a/types/jpegtran-bin/jpegtran-bin-tests.ts b/types/jpegtran-bin/jpegtran-bin-tests.ts new file mode 100644 index 0000000000..9f3e8318fd --- /dev/null +++ b/types/jpegtran-bin/jpegtran-bin-tests.ts @@ -0,0 +1,6 @@ +import { execFile } from "child_process"; +import * as jpegtran from "jpegtran-bin"; + +execFile(jpegtran, ["-outfile", "output.jpg", "input.jpg"], { encoding: "utf-8" }, (err: Error | null) => { + console.log("Image minified!"); +}); diff --git a/types/jpegtran-bin/tsconfig.json b/types/jpegtran-bin/tsconfig.json new file mode 100644 index 0000000000..5f260cfaed --- /dev/null +++ b/types/jpegtran-bin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jpegtran-bin-tests.ts" + ] +} diff --git a/types/jpegtran-bin/tslint.json b/types/jpegtran-bin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jpegtran-bin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 2e1b78adc09a5205cc04dc6398f60cdef5481398 Mon Sep 17 00:00:00 2001 From: Hirotaka Ikoma Date: Sat, 21 Apr 2018 02:41:19 +0900 Subject: [PATCH 0784/2153] Add type definitions for zopflipng-bin (#25158) --- types/zopflipng-bin/index.d.ts | 8 ++++++++ types/zopflipng-bin/tsconfig.json | 23 ++++++++++++++++++++++ types/zopflipng-bin/tslint.json | 1 + types/zopflipng-bin/zopflipng-bin-tests.ts | 6 ++++++ 4 files changed, 38 insertions(+) create mode 100644 types/zopflipng-bin/index.d.ts create mode 100644 types/zopflipng-bin/tsconfig.json create mode 100644 types/zopflipng-bin/tslint.json create mode 100644 types/zopflipng-bin/zopflipng-bin-tests.ts diff --git a/types/zopflipng-bin/index.d.ts b/types/zopflipng-bin/index.d.ts new file mode 100644 index 0000000000..8fc2242b98 --- /dev/null +++ b/types/zopflipng-bin/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for zopflipng-bin 4.1 +// Project: https://github.com/imagemin/zopflipng-bin#readme +// Definitions by: Hirotaka Ikoma +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +declare const zopflipng: string; +export = zopflipng; diff --git a/types/zopflipng-bin/tsconfig.json b/types/zopflipng-bin/tsconfig.json new file mode 100644 index 0000000000..5a929c6d3a --- /dev/null +++ b/types/zopflipng-bin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "zopflipng-bin-tests.ts" + ] +} diff --git a/types/zopflipng-bin/tslint.json b/types/zopflipng-bin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/zopflipng-bin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/zopflipng-bin/zopflipng-bin-tests.ts b/types/zopflipng-bin/zopflipng-bin-tests.ts new file mode 100644 index 0000000000..28c3fe491f --- /dev/null +++ b/types/zopflipng-bin/zopflipng-bin-tests.ts @@ -0,0 +1,6 @@ +import { execFile } from "child_process"; +import * as zopflipng from "zopflipng-bin"; + +execFile(zopflipng, ["-m", "--lossy_8bit", "input.png", "outout.png"], { encoding: "utf-8" }, (err: Error | null) => { + console.log("Image minified!"); +}); From 68d4475fa9fc769044ceaeddd71b49642139868f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Szabo?= Date: Fri, 20 Apr 2018 19:46:39 +0200 Subject: [PATCH 0785/2153] [Ramda] Added memoizeWith definition (#24895) * Ramda: added memoizeWith definition * Ramda: added memoizeWith definition * Ramda: added memoizeWith definition - narrowed generic --- types/ramda/index.d.ts | 8 ++++++++ types/ramda/ramda-tests.ts | 30 ++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 70200aae41..69acb41dc6 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -17,6 +17,7 @@ // Ethan Resnick // Jack Leigh // Keagan McClelland +// Tomas Szabo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -1027,6 +1028,13 @@ declare namespace R { */ memoize(fn: (...a: any[]) => T): (...a: any[]) => T; + /** + * A customisable version of R.memoize. memoizeWith takes an additional function that will be applied to a given + * argument set and used to create the cache key under which the results of the function to be memoized will be stored. + * Care must be taken when implementing key generation to avoid clashes that may overwrite previous entries erroneously. + */ + memoizeWith any>(keyFn: (...v: any[]) => string, fn: T): T; + /** * Create a new object with the own properties of a * merged with the own properties of object b. diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index dbb697e658..81eb438535 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -309,6 +309,36 @@ R.times(i, 5); const isLong = memoStringLength('short') > 10; // false })(); +(() => { + interface Vector { + x: number; + y: number; + } + + let numberOfCalls = 0; + + function vectorSum(a: Vector, b: Vector): Vector { + numberOfCalls += 1; + return { + x: a.x + b.x, + y: a.y + b.y + }; + } + + const memoVectorSum = R.memoizeWith(JSON.stringify, vectorSum); + + memoVectorSum({ x: 1, y: 1 }, { x: 2, y: 2 }); // => { x: 3, y: 3 } + numberOfCalls; // => 1 + memoVectorSum({ x: 1, y: 1 }, { x: 2, y: 2 }); // => { x: 3, y: 3 } + numberOfCalls; // => 1 + memoVectorSum({ x: 1, y: 2 }, { x: 2, y: 3 }); // => { x: 3, y: 5 } + numberOfCalls; // => 2 + + // Note that argument order matters + memoVectorSum({ x: 2, y: 3 }, { x: 1, y: 2 }); // => { x: 3, y: 5 } + numberOfCalls; // => 3 +})(); + (() => { const addOneOnce = R.once((x: number) => x + 1); addOneOnce(10); // => 11 From 182a90fc99ab676a03815ff009c809d880c583cb Mon Sep 17 00:00:00 2001 From: Pine Mizune Date: Sat, 21 Apr 2018 02:48:10 +0900 Subject: [PATCH 0786/2153] Fix `gulp-mustache` types (#25165) * Fix gulp-mustache types * Fix `gulp-mustache` test --- types/gulp-mustache/gulp-mustache-tests.ts | 27 ++++++++++++++++++++++ types/gulp-mustache/index.d.ts | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/types/gulp-mustache/gulp-mustache-tests.ts b/types/gulp-mustache/gulp-mustache-tests.ts index d8285370e7..d7fb994a58 100644 --- a/types/gulp-mustache/gulp-mustache-tests.ts +++ b/types/gulp-mustache/gulp-mustache-tests.ts @@ -4,6 +4,33 @@ import { Transform } from "stream"; mustache({ // $ExpectType Transform msg: "Hello Gulp!" }); +mustache({ + name: "Chris", + value: 10000, + taxed_value: 10000 - (10000 * 0.4), + in_ca: true +}); +mustache({ + repo: [ + { name: "resque" }, + { name: "hub" }, + { name: "rip" } + ] +}); +mustache({ + name: "Willy", + wrapped: () => { + return (text: string, render: (arg: string) => string) => { + return `${render(text)}`; + }; + } +}); +mustache({ + "person?": { name: "Jon" } +}); +mustache({ + repo: [] +}); mustache({ // $ExpectType Transform msg: "Hello Gulp!", diff --git a/types/gulp-mustache/index.d.ts b/types/gulp-mustache/index.d.ts index 13e0198558..ba6b22df9d 100644 --- a/types/gulp-mustache/index.d.ts +++ b/types/gulp-mustache/index.d.ts @@ -11,7 +11,7 @@ declare namespace GulpMustache { type View = Hash | string | undefined; interface Hash { - [key: string]: string; + [key: string]: any; } interface Options { From b8d8d08301f0e41b19ea234f19ceafc014c32e42 Mon Sep 17 00:00:00 2001 From: Kevin Lau Date: Fri, 20 Apr 2018 10:53:05 -0700 Subject: [PATCH 0787/2153] node-common-errors: Rename to common-errors (#25153) --- .../common-errors-tests.ts} | 2 +- types/{node-common-errors => common-errors}/index.d.ts | 4 ++-- types/{node-common-errors => common-errors}/tsconfig.json | 4 ++-- types/{node-common-errors => common-errors}/tslint.json | 0 4 files changed, 5 insertions(+), 5 deletions(-) rename types/{node-common-errors/node-common-errors-tests.ts => common-errors/common-errors-tests.ts} (98%) rename types/{node-common-errors => common-errors}/index.d.ts (99%) rename types/{node-common-errors => common-errors}/tsconfig.json (92%) rename types/{node-common-errors => common-errors}/tslint.json (100%) diff --git a/types/node-common-errors/node-common-errors-tests.ts b/types/common-errors/common-errors-tests.ts similarity index 98% rename from types/node-common-errors/node-common-errors-tests.ts rename to types/common-errors/common-errors-tests.ts index 9554c31dff..ed2c1cdf15 100644 --- a/types/node-common-errors/node-common-errors-tests.ts +++ b/types/common-errors/common-errors-tests.ts @@ -1,4 +1,4 @@ -import * as errors from 'node-common-errors'; +import * as errors from 'common-errors'; errors.log(new Error()); // $ExpectType Error errors.log(new Error(), ''); // $ExpectType Error diff --git a/types/node-common-errors/index.d.ts b/types/common-errors/index.d.ts similarity index 99% rename from types/node-common-errors/index.d.ts rename to types/common-errors/index.d.ts index 06bcb9e754..da0230b084 100644 --- a/types/node-common-errors/index.d.ts +++ b/types/common-errors/index.d.ts @@ -1,5 +1,5 @@ -// Type definitions for node-common-errors 0.4 -// Project: https://github.com/shutterstock/node-errors +// Type definitions for common-errors 1.0 +// Project: https://github.com/shutterstock/node-common-errors // Definitions by: Ian Copp // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 diff --git a/types/node-common-errors/tsconfig.json b/types/common-errors/tsconfig.json similarity index 92% rename from types/node-common-errors/tsconfig.json rename to types/common-errors/tsconfig.json index a862893b87..a4c4800e39 100644 --- a/types/node-common-errors/tsconfig.json +++ b/types/common-errors/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "node-common-errors-tests.ts" + "common-errors-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/node-common-errors/tslint.json b/types/common-errors/tslint.json similarity index 100% rename from types/node-common-errors/tslint.json rename to types/common-errors/tslint.json From 38a994187eb1228c759e50bcf5bd05621390297a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=98i=C4=8Da=C5=99?= Date: Fri, 20 Apr 2018 19:53:45 +0200 Subject: [PATCH 0788/2153] [react-popover] Create new definition (#25146) --- types/react-popover/index.d.ts | 35 +++++++++++++++++++++ types/react-popover/react-popover-tests.tsx | 23 ++++++++++++++ types/react-popover/tsconfig.json | 25 +++++++++++++++ types/react-popover/tslint.json | 1 + 4 files changed, 84 insertions(+) create mode 100644 types/react-popover/index.d.ts create mode 100644 types/react-popover/react-popover-tests.tsx create mode 100644 types/react-popover/tsconfig.json create mode 100644 types/react-popover/tslint.json diff --git a/types/react-popover/index.d.ts b/types/react-popover/index.d.ts new file mode 100644 index 0000000000..20958f3040 --- /dev/null +++ b/types/react-popover/index.d.ts @@ -0,0 +1,35 @@ +// Type definitions for react-popover 0.5 +// Project: https://github.com/littlebits/react-popover +// Definitions by: Jakub Řičař +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from 'react'; + +export type PopoverPlace = + | 'above' + | 'right' + | 'below' + | 'left' + | 'row' + | 'column' + | 'start' + | 'end'; + +export interface PopoverProps { + body: React.ReactNode; + isOpen?: boolean; + preferPlace?: PopoverPlace; + place?: PopoverPlace; + onOuterAction?: (event: Event) => void; + refreshIntervalMs?: number; + enterExitTransitionDurationMs?: number; + tipSize?: number; + className?: string; + style?: React.CSSProperties; + target?: React.ReactElement; + appendTarget?: Element; +} + +declare class Popover extends React.Component {} +export default Popover; diff --git a/types/react-popover/react-popover-tests.tsx b/types/react-popover/react-popover-tests.tsx new file mode 100644 index 0000000000..39cb256c73 --- /dev/null +++ b/types/react-popover/react-popover-tests.tsx @@ -0,0 +1,23 @@ +import * as React from 'react'; +import Popover from 'react-popover'; + +class Test extends React.Component { + render() { + return ( + body
} + isOpen + preferPlace="above" + place="below" + onOuterAction={event => console.log(event)} + refreshIntervalMs={10} + enterExitTransitionDurationMs={10} + tipSize={10} + className="xxx" + style={{ display: 'block' }} + target={
target
} + appendTarget={document.createElement('div')} + /> + ); + } +} diff --git a/types/react-popover/tsconfig.json b/types/react-popover/tsconfig.json new file mode 100644 index 0000000000..723d670093 --- /dev/null +++ b/types/react-popover/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-popover-tests.tsx" + ] +} diff --git a/types/react-popover/tslint.json b/types/react-popover/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-popover/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From f9810f1caa738e724cfdc07533c139486cbf5146 Mon Sep 17 00:00:00 2001 From: Gareth Parker Date: Fri, 20 Apr 2018 21:25:56 +0100 Subject: [PATCH 0789/2153] Plugins can now be string arrays rather that just strings --- types/glue/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/glue/index.d.ts b/types/glue/index.d.ts index d1bf010ffe..f347e69746 100644 --- a/types/glue/index.d.ts +++ b/types/glue/index.d.ts @@ -24,7 +24,7 @@ export interface Plugin { export interface Manifest { server: ServerOptions; register?: { - plugins: string | Plugin[] + plugins: string[] | Plugin[] }; } From 0a74c04ab86341362b6f57b252eb27fb4e684e1a Mon Sep 17 00:00:00 2001 From: Gareth Parker Date: Fri, 20 Apr 2018 23:03:51 +0100 Subject: [PATCH 0790/2153] Plugins can now be string arrays (#25184) * Glue - Fix to plugins * Plugins can now be string arrays rather that just strings --- types/glue/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/glue/index.d.ts b/types/glue/index.d.ts index d1bf010ffe..f347e69746 100644 --- a/types/glue/index.d.ts +++ b/types/glue/index.d.ts @@ -24,7 +24,7 @@ export interface Plugin { export interface Manifest { server: ServerOptions; register?: { - plugins: string | Plugin[] + plugins: string[] | Plugin[] }; } From 841c9f9a0b8d054cd15f286637fd143a2f3bec30 Mon Sep 17 00:00:00 2001 From: "James C. Davis" Date: Fri, 20 Apr 2018 18:04:36 -0400 Subject: [PATCH 0791/2153] Change allowed return type of Ember helper function to any (#25183) --- types/ember/index.d.ts | 2 +- types/ember/test/helper.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index 81d3bd69e6..a35ed40dec 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -3461,7 +3461,7 @@ declare module '@ember/component/helper' { * }); * ``` */ - export function helper(helperFn: (params: any[], hash?: any) => string): any; + export function helper(helperFn: (params: any[], hash?: any) => any): any; } declare module '@ember/component/text-area' { diff --git a/types/ember/test/helper.ts b/types/ember/test/helper.ts index cba5709b10..2aa79a5ba1 100755 --- a/types/ember/test/helper.ts +++ b/types/ember/test/helper.ts @@ -33,3 +33,9 @@ function typedHelp(/*params, hash*/) { } export default helper(typedHelp); + +function arrayNumHelp(/*params, hash*/) { + return [1, 2, 3]; +} + +helper(arrayNumHelp); From 060127cc737534335b672963d83c5a99ad513fdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Moln=C3=A1r?= Date: Sat, 21 Apr 2018 00:05:59 +0200 Subject: [PATCH 0792/2153] Updated leaflet-gpx definitions with actual types (#25008) * added actual types * added descriptive argument names * type tests for all methods * updated header * fixed header --- types/leaflet-gpx/index.d.ts | 91 +++++++++++++------------- types/leaflet-gpx/leaflet-gpx-tests.ts | 84 ++++++++++++++++++++++++ 2 files changed, 130 insertions(+), 45 deletions(-) diff --git a/types/leaflet-gpx/index.d.ts b/types/leaflet-gpx/index.d.ts index 1071ef7b2f..7165aaba28 100644 --- a/types/leaflet-gpx/index.d.ts +++ b/types/leaflet-gpx/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for leaflet-gpx 1.1 +// Type definitions for leaflet-gpx 1.3 // Project: https://github.com/mpetazzoni/leaflet-gpx -// Definitions by: Viktor Soucek +// Definitions by: Viktor Soucek , Márton Molnár // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -8,62 +8,63 @@ import * as L from 'leaflet'; declare module 'leaflet' { interface GPXOptions { - async?: boolean; + async?: boolean; max_point_interval?: number; marker_options?: MarkerOptions; polyline_options?: PolylineOptions; gpx_options?: { parseElements: ['track', 'route', 'waypoint'] }; } + class GPX extends FeatureGroup { - constructor(gpx: any, options?: GPXOptions); - get_duration_string(duration: any, hidems: any): any; - get_duration_string_iso(duration: any, hidems: any): any; - to_miles(v: any): any; - to_ft(v: any): any; - m_to_km(v: any): any; - m_to_mi(v: any): any; + constructor(gpx: string, options?: GPXOptions); + get_duration_string(duration: number, hidems: boolean): string; + get_duration_string_iso(duration: number, hidems: boolean): string; + to_miles(kilometers: number): number; + to_ft(meters: number): number; + m_to_km(meters: number): number; + m_to_mi(meters: number): number; - get_name(): any; - get_desc(): any; - get_author(): any; - get_copyright(): any; - get_distance(): any; - get_distance_imp(): any; + get_name(): string; + get_desc(): string; + get_author(): string; + get_copyright(): string; + get_distance(): number; + get_distance_imp(): number; - get_start_time(): any; - get_end_time(): any; - get_moving_time(): any; - get_total_time(): any; + get_start_time(): Date; + get_end_time(): Date; + get_moving_time(): number; + get_total_time(): number; - get_moving_pace(): any; - get_moving_pace_imp(): any; + get_moving_pace(): number; + get_moving_pace_imp(): number; - get_moving_speed(): any; - get_moving_speed_imp(): any; + get_moving_speed(): number; + get_moving_speed_imp(): number; - get_total_speed(): any; - get_total_speed_imp(): any; + get_total_speed(): number; + get_total_speed_imp(): number; - get_elevation_gain(): any; - get_elevation_loss(): any; - get_elevation_gain_imp(): any; - get_elevation_loss_imp(): any; - get_elevation_data(): any; - get_elevation_data_imp(): any; - get_elevation_max(): any; - get_elevation_min(): any; - get_elevation_max_imp(): any; - get_elevation_min_imp(): any; + get_elevation_gain(): number; + get_elevation_loss(): number; + get_elevation_gain_imp(): number; + get_elevation_loss_imp(): number; + get_elevation_data(): Array<[number, number, string]>; + get_elevation_data_imp(): Array<[number, number, string]>; + get_elevation_max(): number; + get_elevation_min(): number; + get_elevation_max_imp(): number; + get_elevation_min_imp(): number; - get_average_hr(): any; - get_average_temp(): any; - get_average_cadence(): any; - get_heartrate_data(): any; - get_heartrate_data_imp(): any; - get_cadence_data(): any; - get_temp_data(): any; - get_cadence_data_imp(): any; - get_temp_data_imp(): any; + get_average_hr(): number; + get_average_temp(): number; + get_average_cadence(): number; + get_heartrate_data(): Array<[number, number, string]>; + get_heartrate_data_imp(): Array<[number, number, string]>; + get_cadence_data(): Array<[number, number, string]>; + get_temp_data(): Array<[number, number, string]>; + get_cadence_data_imp(): Array<[number, number, string]>; + get_temp_data_imp(): Array<[number, number, string]>; reload(): void; } diff --git a/types/leaflet-gpx/leaflet-gpx-tests.ts b/types/leaflet-gpx/leaflet-gpx-tests.ts index 342d1d00d7..fa61696bb0 100644 --- a/types/leaflet-gpx/leaflet-gpx-tests.ts +++ b/types/leaflet-gpx/leaflet-gpx-tests.ts @@ -4,6 +4,7 @@ const osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; const osmAttrib = '© OpenStreetMap contributors'; const osm = L.tileLayer(osmUrl, { maxZoom: 18, attribution: osmAttrib }); const map = L.map('map', { layers: [osm], center: L.latLng(-37.7772, 175.2756), zoom: 15 }); + const gpx = new L.GPX( '\ { map.fitBounds(e.target.getBounds()); }).addTo(map); + +const durationString: string = gpx.get_duration_string(1000, true); +const durationStringIso: string = gpx.get_duration_string_iso(1000, true); +const miles: number = gpx.to_miles(1.5); +const feet: number = gpx.to_ft(1.5); +const km: number = gpx.m_to_km(1500); +const mi: number = gpx.m_to_mi(1500); + +const name: string = gpx.get_name(); +const desc: string = gpx.get_desc(); +const author: string = gpx.get_author(); +const copyright: string = gpx.get_copyright(); +const distance: number = gpx.get_distance(); +const distanceImp: number = gpx.get_distance_imp(); + +const startTime: Date = gpx.get_start_time(); +const endTime: Date = gpx.get_end_time(); +const movingTime: number = gpx.get_moving_time(); +const totalTime: number = gpx.get_total_time(); + +const movingPace: number = gpx.get_moving_pace(); +const movingPaceImp: number = gpx.get_moving_pace_imp(); + +const movingSpeed: number = gpx.get_moving_speed(); +const movingSpeedImp: number = gpx.get_moving_speed_imp(); + +const totalSpeed: number = gpx.get_total_speed(); +const totalSpeedImp: number = gpx.get_total_speed_imp(); + +const elevationGain: number = gpx.get_elevation_gain(); +const elevationLoss: number = gpx.get_elevation_loss(); +const elevationGainImp: number = gpx.get_elevation_gain_imp(); +const elevationLossImp: number = gpx.get_elevation_loss_imp(); +const elevationData = gpx.get_elevation_data(); +const firstElevationData = elevationData[0]; +const elevationDistance: number = firstElevationData[0]; +const elevationValue: number = firstElevationData[1]; +const elevationTooltip: string = firstElevationData[2]; +const elevationDataImp = gpx.get_elevation_data_imp(); +const firstElevationDataImp = elevationDataImp[0]; +const elevationDistanceImp: number = firstElevationDataImp[0]; +const elevationValueImp: number = firstElevationDataImp[1]; +const elevationTooltipImp: string = firstElevationDataImp[2]; +const elevationMax: number = gpx.get_elevation_max(); +const elevationMin: number = gpx.get_elevation_min(); +const elevationMaxImp: number = gpx.get_elevation_max_imp(); +const elevationMinImp: number = gpx.get_elevation_min_imp(); + +const averageHr: number = gpx.get_average_hr(); +const averageTemp: number = gpx.get_average_temp(); +const averageCadence: number = gpx.get_average_cadence(); +const heartrateData = gpx.get_heartrate_data(); +const firstHeartrateData = heartrateData[0]; +const heartrateDistance: number = firstHeartrateData[0]; +const heartrateValue: number = firstHeartrateData[1]; +const heartrateTooltip: string = firstHeartrateData[2]; +const heartrateDataImp = gpx.get_heartrate_data_imp(); +const firstHeartrateDataImp = heartrateDataImp[0]; +const heartrateDistanceImp: number = firstHeartrateDataImp[0]; +const heartrateValueImp: number = firstHeartrateDataImp[1]; +const heartrateTooltipImp: string = firstHeartrateDataImp[2]; +const tempData = gpx.get_temp_data(); +const firstTempData = tempData[0]; +const tempDistance: number = firstTempData[0]; +const tempValue: number = firstTempData[1]; +const tempTooltip: string = firstTempData[2]; +const tempDataImp = gpx.get_temp_data_imp(); +const firstTempDataImp = tempDataImp[0]; +const tempDistanceImp: number = firstTempDataImp[0]; +const tempValueImp: number = firstTempDataImp[1]; +const tempTooltipImp: string = firstTempDataImp[2]; +const cadenceData = gpx.get_cadence_data(); +const firstCadenceData = cadenceData[0]; +const cadenceDistance: number = firstCadenceData[0]; +const cadenceValue: number = firstCadenceData[1]; +const cadenceTooltip: string = firstCadenceData[2]; +const cadenceDataImp = gpx.get_cadence_data_imp(); +const firstCadenceDataImp = cadenceDataImp[0]; +const cadenceDistanceImp: number = firstCadenceDataImp[0]; +const cadenceValueImp: number = firstCadenceDataImp[1]; +const cadenceTooltipImp: string = firstCadenceDataImp[2]; + +gpx.reload(); From 107dce1caeeab4524dbe53e049f692dbd858eb5a Mon Sep 17 00:00:00 2001 From: Scott Jones Date: Fri, 20 Apr 2018 19:19:50 -0400 Subject: [PATCH 0793/2153] Update SingletonRouter type to include ready and readyCallback funcs --- types/next/router.d.ts | 5 ++--- types/next/test/next-router-tests.tsx | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/types/next/router.d.ts b/types/next/router.d.ts index a5cfb42c90..5a17bd2a53 100644 --- a/types/next/router.d.ts +++ b/types/next/router.d.ts @@ -10,9 +10,6 @@ export interface EventChangeOptions { export type RouterCallback = () => void; export interface RouterProps { - readyCallbacks: RouterCallback[]; - ready(cb: RouterCallback): void; - // router properties readonly components: { [key: string]: { Component: React.ComponentType; err: any }; @@ -55,6 +52,8 @@ export interface RouterProps { export interface SingletonRouter { router: RouterProps; + readyCallbacks: RouterCallback[]; + ready(cb: RouterCallback): void; } export function withRouter( diff --git a/types/next/test/next-router-tests.tsx b/types/next/test/next-router-tests.tsx index 7957f5e8a2..822b9b8e6f 100644 --- a/types/next/test/next-router-tests.tsx +++ b/types/next/test/next-router-tests.tsx @@ -2,10 +2,10 @@ import Router, * as r from "next/router"; import * as React from "react"; import * as qs from "querystring"; -Router.router.readyCallbacks.push(() => { +Router.readyCallbacks.push(() => { console.log("I'll get called when the router initializes."); }); -Router.router.ready(() => { +Router.ready(() => { console.log( "I'll get called immediately if the router initializes, or when it eventually does.", ); From 2421842822c0f83801d2af4b825bb4b3f3690584 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 20 Apr 2018 17:27:18 -0600 Subject: [PATCH 0794/2153] Add definitions for ace-diff --- types/ace-diff/ace-diff-tests.ts | 18 ++++++++++++ types/ace-diff/index.d.ts | 47 ++++++++++++++++++++++++++++++++ types/ace-diff/tsconfig.json | 24 ++++++++++++++++ types/ace-diff/tslint.json | 1 + 4 files changed, 90 insertions(+) create mode 100644 types/ace-diff/ace-diff-tests.ts create mode 100644 types/ace-diff/index.d.ts create mode 100644 types/ace-diff/tsconfig.json create mode 100644 types/ace-diff/tslint.json diff --git a/types/ace-diff/ace-diff-tests.ts b/types/ace-diff/ace-diff-tests.ts new file mode 100644 index 0000000000..9c9eb4cfb9 --- /dev/null +++ b/types/ace-diff/ace-diff-tests.ts @@ -0,0 +1,18 @@ +import AceDiff = require('ace-diff'); + +new AceDiff(); // $ExpectError + +const aceDiffOpts = { + element: '.acediff', + left: { content: 'left content' }, + right: { content: 'left content' }, +}; +new AceDiff(aceDiffOpts); // $ExpectType AceDiff + +const differ = new AceDiff(aceDiffOpts); + +differ.getEditors(); // $ExpectType { left: any; right: any; } +differ.setOptions(); // $ExpectType void +differ.getNumDiffs(); // $ExpectType number +differ.diff(); // $ExpectType void +differ.destroy(); // $ExpectType void diff --git a/types/ace-diff/index.d.ts b/types/ace-diff/index.d.ts new file mode 100644 index 0000000000..f381aedfed --- /dev/null +++ b/types/ace-diff/index.d.ts @@ -0,0 +1,47 @@ +// Type definitions for ace-diff 2.1 +// Project: https://ace-diff.github.io/ace-diff/ +// Definitions by: Mike Dodge +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export as namespace AceDiff; + +export = AceDiff; + +declare class AceDiff { + constructor(opts: AceDiff.AceDiffOpts); + getEditors(): { + left: any; + right: any; + }; + setOptions(): void; + getNumDiffs(): number; + diff(): void; + destroy(): void; +} +declare namespace AceDiff { + interface AceDiffLROpts { + content?: string | null; + mode?: string; + theme?: string; + editable?: boolean; + copyLinkEnabled?: boolean; + } + + interface AceDiffOpts { + element: string | HTMLElement; + mode?: string; + theme?: string; + diffGranularity?: 'specific' | 'broad'; + showDiffs?: boolean; + showConnectors?: boolean; + maxDiffs?: number; + left: AceDiffLROpts; + right: AceDiffLROpts; + classes?: { + diff: string; + connector: string; + newCodeConnectorLinkContent: string; + deletedCodeConnectorLinkContent: string; + }; + } +} diff --git a/types/ace-diff/tsconfig.json b/types/ace-diff/tsconfig.json new file mode 100644 index 0000000000..00fb70bbcd --- /dev/null +++ b/types/ace-diff/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ace-diff-tests.ts" + ] +} diff --git a/types/ace-diff/tslint.json b/types/ace-diff/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ace-diff/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From cf0ccd4511208373e6729bc64ce54ddf07e84830 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 21 Apr 2018 14:26:41 -0700 Subject: [PATCH 0795/2153] Use namespace with 'export =' to model self-referential chaining API in 'temp'. --- types/temp/index.d.ts | 71 ++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/types/temp/index.d.ts b/types/temp/index.d.ts index 0a452a221b..eaf9adde66 100644 --- a/types/temp/index.d.ts +++ b/types/temp/index.d.ts @@ -5,41 +5,44 @@ /// -import * as temp from "."; import * as fs from "fs"; -export interface OpenFile { - path: string; - fd: number; +declare namespace temp { + export interface OpenFile { + path: string; + fd: number; + } + + export interface Stats { + files: number; + dirs: number; + } + + export interface AffixOptions { + prefix?: string; + suffix?: string; + dir?: string; + } + + export let dir: string; + + export function track(value?: boolean): typeof temp; + + export function mkdir(affixes?: string | AffixOptions, callback?: (err: any, dirPath: string) => void): void; + + export function mkdirSync(affixes?: string | AffixOptions): string; + + export function open(affixes?: string | AffixOptions, callback?: (err: any, result: OpenFile) => void): void; + + export function openSync(affixes?: string | AffixOptions): OpenFile; + + export function path(affixes?: string | AffixOptions, defaultPrefix?: string): string; + + export function cleanup(callback?: (result: boolean | Stats) => void): void; + + export function cleanupSync(): boolean | Stats; + + export function createWriteStream(affixes?: string | AffixOptions): fs.WriteStream; } -export interface Stats { - files: number; - dirs: number; -} - -export interface AffixOptions { - prefix?: string; - suffix?: string; - dir?: string; -} - -export let dir: string; - -export function track(value?: boolean): typeof temp; - -export function mkdir(affixes?: string | AffixOptions, callback?: (err: any, dirPath: string) => void): void; - -export function mkdirSync(affixes?: string | AffixOptions): string; - -export function open(affixes?: string | AffixOptions, callback?: (err: any, result: OpenFile) => void): void; - -export function openSync(affixes?: string | AffixOptions): OpenFile; - -export function path(affixes?: string | AffixOptions, defaultPrefix?: string): string; - -export function cleanup(callback?: (result: boolean | Stats) => void): void; - -export function cleanupSync(): boolean | Stats; - -export function createWriteStream(affixes?: string | AffixOptions): fs.WriteStream; +export = temp; From 526ca393cb2532ff562d9e8c48ae6c10ef59858f Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 21 Apr 2018 15:06:59 -0700 Subject: [PATCH 0796/2153] Fix lint nits. --- types/temp/index.d.ts | 26 +++++++++++++------------- types/temp/tslint.json | 1 + 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/types/temp/index.d.ts b/types/temp/index.d.ts index eaf9adde66..25a76ec47e 100644 --- a/types/temp/index.d.ts +++ b/types/temp/index.d.ts @@ -8,41 +8,41 @@ import * as fs from "fs"; declare namespace temp { - export interface OpenFile { + interface OpenFile { path: string; fd: number; } - export interface Stats { + interface Stats { files: number; dirs: number; } - export interface AffixOptions { + interface AffixOptions { prefix?: string; suffix?: string; dir?: string; } - export let dir: string; + let dir: string; - export function track(value?: boolean): typeof temp; + function track(value?: boolean): typeof temp; - export function mkdir(affixes?: string | AffixOptions, callback?: (err: any, dirPath: string) => void): void; + function mkdir(affixes?: string | AffixOptions, callback?: (err: any, dirPath: string) => void): void; - export function mkdirSync(affixes?: string | AffixOptions): string; + function mkdirSync(affixes?: string | AffixOptions): string; - export function open(affixes?: string | AffixOptions, callback?: (err: any, result: OpenFile) => void): void; + function open(affixes?: string | AffixOptions, callback?: (err: any, result: OpenFile) => void): void; - export function openSync(affixes?: string | AffixOptions): OpenFile; + function openSync(affixes?: string | AffixOptions): OpenFile; - export function path(affixes?: string | AffixOptions, defaultPrefix?: string): string; + function path(affixes?: string | AffixOptions, defaultPrefix?: string): string; - export function cleanup(callback?: (result: boolean | Stats) => void): void; + function cleanup(callback?: (result: boolean | Stats) => void): void; - export function cleanupSync(): boolean | Stats; + function cleanupSync(): boolean | Stats; - export function createWriteStream(affixes?: string | AffixOptions): fs.WriteStream; + function createWriteStream(affixes?: string | AffixOptions): fs.WriteStream; } export = temp; diff --git a/types/temp/tslint.json b/types/temp/tslint.json index 495d29983d..adaee1b55f 100644 --- a/types/temp/tslint.json +++ b/types/temp/tslint.json @@ -1,5 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { + "export-just-namespace": false } } From 54a59cd8f0bdbee257ada2716fdc1b7c94909c40 Mon Sep 17 00:00:00 2001 From: Alan Plum Date: Mon, 23 Apr 2018 17:00:09 +0200 Subject: [PATCH 0797/2153] [cors] Add delegate function and change owner (#25177) * Add cors delegate function * Remove Mihhail Lapushkin as per his wishes --- types/cors/cors-tests.ts | 7 +++++++ types/cors/index.d.ts | 13 ++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/types/cors/cors-tests.ts b/types/cors/cors-tests.ts index 83975549c7..ed4cd77213 100644 --- a/types/cors/cors-tests.ts +++ b/types/cors/cors-tests.ts @@ -47,4 +47,11 @@ app.use(cors({ } } })); +app.use(cors((req, cb) => { + if (req.query.trusted) { + cb(null, {origin: 'http://example.com', credentials: true}); + } else { + cb(new Error('Not trusted')); + } +})) diff --git a/types/cors/index.d.ts b/types/cors/index.d.ts index ab8ba2ed2d..bc7a567fc7 100644 --- a/types/cors/index.d.ts +++ b/types/cors/index.d.ts @@ -1,12 +1,9 @@ // Type definitions for cors 2.8 // Project: https://github.com/troygoode/node-cors/ -// Definitions by: Mihhail Lapushkin +// Definitions by: Alan Plum // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 - - - import express = require('express'); type CustomOrigin = ( @@ -25,7 +22,13 @@ declare namespace e { preflightContinue?: boolean; optionsSuccessStatus?: number; } + type CorsOptionsDelegate = ( + req: express.Request, + callback: (err: Error | null, options?: CorsOptions) => void + ) => void; } -declare function e(options?: e.CorsOptions): express.RequestHandler; +declare function e( + options?: e.CorsOptions | e.CorsOptionsDelegate +): express.RequestHandler; export = e; From 27e6fddf22d2ff6f3fa90f3ca8555e2c0b4a3884 Mon Sep 17 00:00:00 2001 From: Michael Dodge Date: Mon, 23 Apr 2018 12:29:43 -0600 Subject: [PATCH 0798/2153] Add definitions for axios-token-interceptor --- .../axios-token-interceptor-tests.ts | 18 +++++++++++ types/axios-token-interceptor/index.d.ts | 31 +++++++++++++++++++ types/axios-token-interceptor/package.json | 6 ++++ types/axios-token-interceptor/tsconfig.json | 23 ++++++++++++++ types/axios-token-interceptor/tslint.json | 1 + 5 files changed, 79 insertions(+) create mode 100644 types/axios-token-interceptor/axios-token-interceptor-tests.ts create mode 100644 types/axios-token-interceptor/index.d.ts create mode 100644 types/axios-token-interceptor/package.json create mode 100644 types/axios-token-interceptor/tsconfig.json create mode 100644 types/axios-token-interceptor/tslint.json diff --git a/types/axios-token-interceptor/axios-token-interceptor-tests.ts b/types/axios-token-interceptor/axios-token-interceptor-tests.ts new file mode 100644 index 0000000000..58d67e02ad --- /dev/null +++ b/types/axios-token-interceptor/axios-token-interceptor-tests.ts @@ -0,0 +1,18 @@ +import tokenProvider, { tokenCache } from 'axios-token-interceptor'; + +tokenProvider(); // $ExpectError + +const validOptions = { + getToken: () => Promise.resolve('qwerty'), +}; +tokenProvider(validOptions); // $ExpectType TokenProvider + +tokenCache(); // $ExpectError + +const getToken = Promise.resolve('qwerty'); +const validCacheOptions = { + maxAge: 3600, +}; +const cache = tokenCache(getToken, validCacheOptions); // $Expect TokenCache + +cache.reset(); // $ExpectType void diff --git a/types/axios-token-interceptor/index.d.ts b/types/axios-token-interceptor/index.d.ts new file mode 100644 index 0000000000..8b63c5cc67 --- /dev/null +++ b/types/axios-token-interceptor/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for axios-token-interceptor 0.1 +// Project: https://github.com/sandrinodimattia/axios-token-interceptor#readme +// Definitions by: Mike Dodge +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { AxiosRequestConfig } from 'axios'; + +/*~ If this module has methods, declare them as functions like so. + */ + +export default function tokenProvider(Options: InterceptorOptions): TokenProvider; +export function tokenCache(getToken: Promise, options: TokenCacheOptions): TokenCache; + +/*~ You can declare types that are available via importing the module */ +export interface InterceptorOptions { + token?: string; + getToken?: () => string | Promise; + header?: string; + headerFormatter?: (token: string) => string; +} + +export type TokenProvider = (config: AxiosRequestConfig) => Promise; + +export interface TokenCacheOptions { + getMaxAge?: () => number; + maxAge?: number; +} + +export interface TokenCache { + reset(): void; +} diff --git a/types/axios-token-interceptor/package.json b/types/axios-token-interceptor/package.json new file mode 100644 index 0000000000..bd5a40b16d --- /dev/null +++ b/types/axios-token-interceptor/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "axios": "^0.16.2" + } +} diff --git a/types/axios-token-interceptor/tsconfig.json b/types/axios-token-interceptor/tsconfig.json new file mode 100644 index 0000000000..509608e7d6 --- /dev/null +++ b/types/axios-token-interceptor/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "axios-token-interceptor-tests.ts" + ] +} diff --git a/types/axios-token-interceptor/tslint.json b/types/axios-token-interceptor/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/axios-token-interceptor/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 3ec28e76de08d0cf5b50dd04390cc3f172db8cfb Mon Sep 17 00:00:00 2001 From: Michael Dodge Date: Mon, 23 Apr 2018 12:59:39 -0600 Subject: [PATCH 0799/2153] Use namespace to add tokenCache as prop of default export function --- .../axios-token-interceptor-tests.ts | 4 ++-- types/axios-token-interceptor/index.d.ts | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/types/axios-token-interceptor/axios-token-interceptor-tests.ts b/types/axios-token-interceptor/axios-token-interceptor-tests.ts index 58d67e02ad..63f40c611a 100644 --- a/types/axios-token-interceptor/axios-token-interceptor-tests.ts +++ b/types/axios-token-interceptor/axios-token-interceptor-tests.ts @@ -1,4 +1,4 @@ -import tokenProvider, { tokenCache } from 'axios-token-interceptor'; +import tokenProvider from 'axios-token-interceptor'; tokenProvider(); // $ExpectError @@ -13,6 +13,6 @@ const getToken = Promise.resolve('qwerty'); const validCacheOptions = { maxAge: 3600, }; -const cache = tokenCache(getToken, validCacheOptions); // $Expect TokenCache +const cache = tokenProvider.tokenCache(getToken, validCacheOptions); // $Expect TokenCache cache.reset(); // $ExpectType void diff --git a/types/axios-token-interceptor/index.d.ts b/types/axios-token-interceptor/index.d.ts index 8b63c5cc67..c2bcd259d2 100644 --- a/types/axios-token-interceptor/index.d.ts +++ b/types/axios-token-interceptor/index.d.ts @@ -5,13 +5,15 @@ import { AxiosRequestConfig } from 'axios'; -/*~ If this module has methods, declare them as functions like so. - */ +// Module +export function AxiosTokenProvider(Options: InterceptorOptions): TokenProvider; +export namespace AxiosTokenProvider { + function tokenCache(getToken: Promise, options: TokenCacheOptions): TokenCache; +} +export default AxiosTokenProvider; -export default function tokenProvider(Options: InterceptorOptions): TokenProvider; -export function tokenCache(getToken: Promise, options: TokenCacheOptions): TokenCache; +// Interfaces -/*~ You can declare types that are available via importing the module */ export interface InterceptorOptions { token?: string; getToken?: () => string | Promise; From 27f3db2d27e1a1e95784cffa1438b8557d4e7a17 Mon Sep 17 00:00:00 2001 From: Michael Dodge Date: Tue, 24 Apr 2018 12:10:34 -0600 Subject: [PATCH 0800/2153] Add definitions for okta-vue --- types/okta__okta-vue/index.d.ts | 36 ++++++++++++++ types/okta__okta-vue/okta__okta-vue-tests.ts | 50 ++++++++++++++++++++ types/okta__okta-vue/package.json | 7 +++ types/okta__okta-vue/tsconfig.json | 23 +++++++++ types/okta__okta-vue/tslint.json | 1 + 5 files changed, 117 insertions(+) create mode 100644 types/okta__okta-vue/index.d.ts create mode 100644 types/okta__okta-vue/okta__okta-vue-tests.ts create mode 100644 types/okta__okta-vue/package.json create mode 100644 types/okta__okta-vue/tsconfig.json create mode 100644 types/okta__okta-vue/tslint.json diff --git a/types/okta__okta-vue/index.d.ts b/types/okta__okta-vue/index.d.ts new file mode 100644 index 0000000000..75a3332c68 --- /dev/null +++ b/types/okta__okta-vue/index.d.ts @@ -0,0 +1,36 @@ +// Type definitions for okta-vue 1.0 +// Project: https://github.com/okta/okta-oidc-js/tree/master/packages/okta-vue +// Definitions by: Mike Dodge +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { VueConstructor, PluginFunction } from 'vue'; +import { NavigationGuard } from 'vue-router'; + +export interface OktaVueOptions { + issuer: string; + client_id: string; + redirect_uri: string; + scope: string; +} +export function OktaVuePlugin(vm: VueConstructor, options: OktaVueOptions): void; +export namespace OktaVuePlugin { + function handleCallback(): VueConstructor; +} +export default OktaVuePlugin; + +declare module 'vue/types/vue' { + interface Vue { + $auth: { + loginRedirect(): void; + logout(): Promise; + isAuthenticated(): Promise; + handleAuthentication(): Promise; + getFromUri(): string; + getIdToken(): Promise; + getAccessToken(): Promise; + getUser(): Promise; + authRedirectGuardd(): Promise; + }; + } +} diff --git a/types/okta__okta-vue/okta__okta-vue-tests.ts b/types/okta__okta-vue/okta__okta-vue-tests.ts new file mode 100644 index 0000000000..881726a9f0 --- /dev/null +++ b/types/okta__okta-vue/okta__okta-vue-tests.ts @@ -0,0 +1,50 @@ +import Vue from 'vue'; +import Router from 'vue-router'; +import Auth from 'okta__okta-vue'; + +Vue.use(Auth, { + issuer: 'https://{yourOktaDomain}.com/oauth2/default', + client_id: '{client_id}', + redirect_uri: 'http://localhost:{port}/implicit/callback', + scope: 'openid profile email' +}); + +Vue.use(Router); +const router = new Router({ + mode: 'history', + routes: [ + { path: '/implicit/callback', component: Auth.handleCallback() }, + { + path: '/protected', + component: { + name: 'protected', + template: '
Protected Route
' + }, + meta: { + requiresAuth: true + } + }, + ] +}); + +const redirectGuard = Vue.prototype.$auth.authRedirectGuard(); +router.beforeEach(redirectGuard); + +const component = Vue.extend({ + mounted() { + const authd = this.$auth.isAuthenticated(); + const userInfo = this.$auth.getUser(); + const handleAuth = this.$auth.handleAuthentication(); + const path = this.$auth.getFromUri(); + const idToken = this.$auth.getIdToken(); + const accessToken = this.$auth.getAccessToken(); + }, + methods: { + logout() { + const logoutPromise = this.$auth.logout(); + }, + redirect() { + this.$auth.loginRedirect(); + }, + }, +}); diff --git a/types/okta__okta-vue/package.json b/types/okta__okta-vue/package.json new file mode 100644 index 0000000000..fe98511c31 --- /dev/null +++ b/types/okta__okta-vue/package.json @@ -0,0 +1,7 @@ +{ + "private": true, + "dependencies": { + "vue": "^2.5.9", + "vue-router": "^3.0.1" + } +} diff --git a/types/okta__okta-vue/tsconfig.json b/types/okta__okta-vue/tsconfig.json new file mode 100644 index 0000000000..f114dc0fe8 --- /dev/null +++ b/types/okta__okta-vue/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "okta__okta-vue-tests.ts" + ] +} diff --git a/types/okta__okta-vue/tslint.json b/types/okta__okta-vue/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/okta__okta-vue/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 4411dfcac089a7bdb2259d195061af55813d5116 Mon Sep 17 00:00:00 2001 From: Zev Spitz Date: Wed, 25 Apr 2018 01:53:31 +0300 Subject: [PATCH 0801/2153] activex-msxml2: default properties (#25266) * Default properties * Reduce any * dtslint fixes * Replace IIFEs with blocks in tests * Deleted unneeded file --- types/activex-msxml2/activex-msxml2-tests.ts | 48 ++++++------- types/activex-msxml2/index.d.ts | 74 +++++++++----------- types/activex-msxml2/tslint.json | 3 +- 3 files changed, 61 insertions(+), 64 deletions(-) diff --git a/types/activex-msxml2/activex-msxml2-tests.ts b/types/activex-msxml2/activex-msxml2-tests.ts index a793c08db5..470f35d785 100644 --- a/types/activex-msxml2/activex-msxml2-tests.ts +++ b/types/activex-msxml2/activex-msxml2-tests.ts @@ -1,18 +1,18 @@ // https://msdn.microsoft.com/en-us/library/ms764708(v=vs.85).aspx -(() => { +{ const dom = new ActiveXObject('Msxml2.DOMDocument.6.0'); dom.async = false; dom.resolveExternals = false; dom.loadXML('A'); WScript.Echo(`dom: ${dom.xml}`); -})(); +} // https://msdn.microsoft.com/en-us/library/ms766390(v=vs.85).aspx -(() => { +{ const doc = new ActiveXObject('Msxml2.DOMDocument.6.0'); doc.load('test.xml'); WScript.Echo(`doc: ${doc.xml}`); -})(); +} const MakeDOM = () => { try { @@ -37,7 +37,7 @@ const LoadDOM = (file: string) => { }; // https://msdn.microsoft.com/en-us/library/ms759105(v=vs.85).aspx -(() => { +{ const doc = new ActiveXObject('Msxml2.DOMDocument.6.0'); doc.async = false; doc.resolveExternals = false; @@ -60,10 +60,10 @@ const LoadDOM = (file: string) => { `; doc.loadXML(xml); doc.save('saved.xml'); -})(); +} // https://msdn.microsoft.com/en-us/library/ms764656(v=vs.85).aspx -(() => { +{ const doc = LoadDOM('test.xml')!; const xsl = (LoadDOM('test.xsl')! as any) as MSXML2.IXMLDOMNode; @@ -73,10 +73,10 @@ const LoadDOM = (file: string) => { const out = MakeDOM()!; doc.transformNodeToObject(xsl, out); WScript.Echo('\ndoc.transformNodeToObject:\n' + out.xml); -})(); +} // https://msdn.microsoft.com/en-us/library/ms763685(v=vs.85).aspx -(() => { +{ const dom = MakeDOM()!; // Create a processing instruction targeted for xml. @@ -148,10 +148,10 @@ const LoadDOM = (file: string) => { // Save the XML document to a file. dom.save("dynamDom.xml"); -})(); +} // https://msdn.microsoft.com/en-us/library/ms757050(v=vs.85).aspx -(() => { +{ const dom = LoadDOM("stocks.xml")!; try { // Query a single node. @@ -172,17 +172,17 @@ const LoadDOM = (file: string) => { } catch (e) { WScript.Echo(e.description); } -})(); +} // https://msdn.microsoft.com/en-us/library/ms757064(v=vs.85).aspx -(() => { +{ const xhr = new ActiveXObject("Msxml2.XMLHTTP.6.0"); xhr.open("GET", "http://localhost/sxh/contact.asp?SearchID=John Doe", false); xhr.send(); const doc = xhr.responseXML; WScript.Echo(doc.xml); -})(); +} const xmlValidation = (fn: (x: MSXML2.DOMDocument60) => void) => { // Create and initialize the DOMDocument object @@ -212,16 +212,16 @@ ${x.xml} }; // https://msdn.microsoft.com/en-us/library/ms766449(v=vs.85).aspx -(() => { +{ const validateFile = (filename: string) => xmlValidation(x => x.load(filename)); let sOutput = validateFile("nn-valid.xml"); sOutput = sOutput + validateFile("nn-notValid.xml"); WScript.Echo(sOutput); -})(); +} // https://msdn.microsoft.com/en-us/library/ms767542(v=vs.85).aspx -(() => { +{ const validateFile = (filename: string) => xmlValidation(x => { // Configure DOM properties for namespace selection. x.setProperty("SelectionLanguage", "XPath"); @@ -235,10 +235,10 @@ ${x.xml} let sOutput = validateFile("sl-valid.xml"); sOutput = sOutput + validateFile("sl-notValid.xml"); WScript.Echo(sOutput); -})(); +} // https://msdn.microsoft.com/en-us/library/ms766439(v=vs.85).aspx -(() => { +{ const validateFile = (filename: string) => xmlValidation(xd => { // Create a schema cache and add books.xsd to it. const xs = new ActiveXObject('Msxml2.XMLSchemaCache'); @@ -253,10 +253,10 @@ ${x.xml} let sOutput = validateFile("sc-valid.xml"); sOutput = sOutput + validateFile("sc-notValid.xml"); WScript.Echo(sOutput); -})(); +} // https://msdn.microsoft.com/en-us/library/ms767636(v=vs.85).aspx -(() => { +{ const validateFile = (filename: string) => xmlValidation(x => { x.setProperty("UseInlineSchema", true); x.load(filename); @@ -265,10 +265,10 @@ ${x.xml} let sOutput = validateFile("valid.xml"); sOutput = sOutput + validateFile("notValid.xml"); WScript.Echo(sOutput); -})(); +} // https://msdn.microsoft.com/en-us/library/ms757833(v=vs.85).aspx -(() => { +{ // Load an XML document into a DOM instance. const oXMLDoc = LoadDOM("books.xml")!; @@ -326,4 +326,4 @@ ${oError.reason}`; } WScript.Echo(msg); } -})(); +} diff --git a/types/activex-msxml2/index.d.ts b/types/activex-msxml2/index.d.ts index 76dc3d9415..6f43ba02c5 100644 --- a/types/activex-msxml2/index.d.ts +++ b/types/activex-msxml2/index.d.ts @@ -424,7 +424,7 @@ declare namespace MSXML2 { createEntityReference(name: string): IXMLDOMEntityReference; /** create a node of the specified node type and name */ - createNode(type: any, name: string, namespaceURI: string): IXMLDOMNode; + createNode(type: DOMNodeType.NODE_ATTRIBUTE | DOMNodeType.NODE_CDATA_SECTION | DOMNodeType.NODE_COMMENT | DOMNodeType.NODE_DOCUMENT_FRAGMENT | DOMNodeType.NODE_TEXT | DOMNodeType.NODE_ELEMENT | DOMNodeType.NODE_ENTITY_REFERENCE | DOMNodeType.NODE_PROCESSING_INSTRUCTION, name: string, namespaceURI: string): IXMLDOMNode; /** create a processing instruction node */ createProcessingInstruction(target: string, data: string): IXMLDOMProcessingInstruction; @@ -433,7 +433,7 @@ declare namespace MSXML2 { createTextNode(data: string): IXMLDOMText; /** the data type of the node */ - dataType: any; + dataType: string | null; /** pointer to the definition of the node in the DTD or schema */ readonly definition: IXMLDOMNode; @@ -497,7 +497,7 @@ declare namespace MSXML2 { readonly nodeTypeString: string; /** value stored in the node */ - nodeValue: any; + nodeValue: string | null; /** register an ondataavailable event handler */ readonly ondataavailable: any; @@ -795,8 +795,7 @@ declare namespace MSXML2 { getAllResponseHeaders(ppwszHeaders: string): void; GetCookie(pwszUrl: string, pwszName: string, dwFlags: number, pcCookies: number, ppCookies: tagXHR_COOKIE): void; getResponseHeader(pwszHeader: string, ppwszValue: string): void; - open( - pwszMethod: string, pwszUrl: string, pStatusCallback: IXMLHTTPRequest2Callback, pwszUserName: string, pwszPassword: string, pwszProxyUserName: string, pwszProxyPassword: string): void; + open(pwszMethod: string, pwszUrl: string, pStatusCallback: IXMLHTTPRequest2Callback, pwszUserName: string, pwszPassword: string, pwszProxyUserName: string, pwszProxyPassword: string): void; send(pBody: ISequentialStream, cbBody: number): void; SetCookie(pCookie: tagXHR_COOKIE, pdwCookieState: number): void; SetCustomResponseStream(pSequentialStream: ISequentialStream): void; @@ -805,11 +804,11 @@ declare namespace MSXML2 { } /** IMXNamespacePrefixes interface */ - class IMXNamespacePrefixes { - private 'MSXML2.IMXNamespacePrefixes_typekey': IMXNamespacePrefixes; - private constructor(); + // tslint:disable-next-line:interface-name + interface IMXNamespacePrefixes { item(index: number): string; readonly length: number; + (index: number): string; } /** XML Schema */ @@ -848,21 +847,21 @@ declare namespace MSXML2 { } /** XML Schema Item Collection */ - class ISchemaItemCollection { - private 'MSXML2.ISchemaItemCollection_typekey': ISchemaItemCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface ISchemaItemCollection { item(index: number): ISchemaItem; itemByName(name: string): ISchemaItem; itemByQName(name: string, namespaceURI: string): ISchemaItem; readonly length: number; + (index: number): ISchemaItem; } /** XML Schema String Collection */ - class ISchemaStringCollection { - private 'MSXML2.ISchemaStringCollection_typekey': ISchemaStringCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface ISchemaStringCollection { item(index: number): string; readonly length: number; + (index: number): string; } class ISequentialStream { @@ -1960,10 +1959,8 @@ declare namespace MSXML2 { hasFeature(feature: string, version: string): boolean; } - class IXMLDOMNamedNodeMap { - private 'MSXML2.IXMLDOMNamedNodeMap_typekey': IXMLDOMNamedNodeMap; - private constructor(); - + // tslint:disable-next-line:interface-name + interface IXMLDOMNamedNodeMap { /** lookup item by name */ getNamedItem(name: string): IXMLDOMNode; @@ -1990,6 +1987,9 @@ declare namespace MSXML2 { /** set item by name */ setNamedItem(newItem: IXMLDOMNode): IXMLDOMNode; + + /** collection of nodes */ + (index: number): IXMLDOMNode; } /** Core DOM node interface */ @@ -2090,10 +2090,8 @@ declare namespace MSXML2 { readonly xml: string; } - class IXMLDOMNodeList { - private 'MSXML2.IXMLDOMNodeList_typekey': IXMLDOMNodeList; - private constructor(); - + // tslint:disable-next-line:interface-name + interface IXMLDOMNodeList { /** collection of nodes */ item(index: number): IXMLDOMNode; @@ -2105,6 +2103,9 @@ declare namespace MSXML2 { /** reset the position of iterator */ reset(): void; + + /** collection of nodes */ + (index: number): IXMLDOMNode; } /** structure for reporting parser errors */ @@ -2238,10 +2239,8 @@ declare namespace MSXML2 { } /** XML Schemas Collection */ - class IXMLDOMSchemaCollection { - private 'MSXML2.IXMLDOMSchemaCollection_typekey': IXMLDOMSchemaCollection; - private constructor(); - + // tslint:disable-next-line:interface-name + interface IXMLDOMSchemaCollection { /** add a new schema */ add(namespaceURI: string, var_1: any): void; @@ -2259,6 +2258,9 @@ declare namespace MSXML2 { /** remove schema by namespaceURI */ remove(namespaceURI: string): void; + + /** Get namespaceURI for schema by index */ + (index: number): string; } class IXMLDOMText { @@ -2403,7 +2405,7 @@ declare namespace MSXML2 { /** * set values - * @param string [namespaceURI=''] + * @param namespaceURI [namespaceURI='0'] */ addParameter(baseName: string, parameter: any, namespaceURI?: string): void; @@ -2424,7 +2426,7 @@ declare namespace MSXML2 { /** * set XSL mode and it's namespace - * @param string [namespaceURI=''] + * @param namespaceURI [namespaceURI='0'] */ setStartMode(mode: string, namespaceURI?: string): void; @@ -2487,7 +2489,7 @@ declare namespace MSXML2 { popContext(): void; pushContext(): void; - /** @param boolean [fDeep=true] */ + /** @param fDeep [fDeep=true] */ pushNodeContext(contextNode: IXMLDOMNode, fDeep?: boolean): void; reset(): void; } @@ -2730,10 +2732,7 @@ declare namespace MSXML2 { } /** XML Schema Cache 6.0 */ - class XMLSchemaCache60 { - private 'MSXML2.XMLSchemaCache60_typekey': XMLSchemaCache60; - private constructor(); - + interface XMLSchemaCache60 { /** add a new schema */ add(namespaceURI: string, var_1: any): void; @@ -2755,6 +2754,9 @@ declare namespace MSXML2 { remove(namespaceURI: string): void; validate(): void; validateOnLoad: boolean; + + /** Get namespaceURI for schema by index */ + (index: number): string; } /** XSL Stylesheet Cache 6.0 */ @@ -2787,12 +2789,6 @@ interface ActiveXObjectNameMap { 'Msxml2.SAXXMLReader': MSXML2.SAXXMLReader60; 'Msxml2.ServerXMLHTTP': MSXML2.ServerXMLHTTP60; 'Msxml2.XMLHTTP': MSXML2.XMLHTTP60; - 'Msxml2.XMLHTTP.6.0': MSXML2.XMLHTTP60; 'Msxml2.XMLSchemaCache': MSXML2.XMLSchemaCache60; - 'Msxml2.XMLSchemaCache.6.0': MSXML2.XMLSchemaCache60; 'Msxml2.XSLTemplate': MSXML2.XSLTemplate60; } - -interface SafeArray { - _brand: SafeArray; -} diff --git a/types/activex-msxml2/tslint.json b/types/activex-msxml2/tslint.json index 3224b40b8b..7b89accc6d 100644 --- a/types/activex-msxml2/tslint.json +++ b/types/activex-msxml2/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "no-const-enum": false + "no-const-enum": false, + "max-line-length": false } } From 482390bbe7ad17f916bea462f354a7477a87906b Mon Sep 17 00:00:00 2001 From: Jan Lohage Date: Wed, 25 Apr 2018 00:53:53 +0200 Subject: [PATCH 0802/2153] Update index.d.ts (#25260) --- types/feathersjs__errors/index.d.ts | 32 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/types/feathersjs__errors/index.d.ts b/types/feathersjs__errors/index.d.ts index 9eacd9ce7e..056acff676 100644 --- a/types/feathersjs__errors/index.d.ts +++ b/types/feathersjs__errors/index.d.ts @@ -9,67 +9,67 @@ export class FeathersError extends Error { } export class BadRequest extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class NotAuthenticated extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class PaymentError extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class Forbidden extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class NotFound extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class MethodNotAllowed extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class NotAcceptable extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class Timeout extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class Conflict extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class LengthRequired extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class Unprocessable extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class TooManyRequests extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class GeneralError extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class NotImplemented extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class BadGateway extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class Unavailable extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export interface Errors { From 2f5d1477b95df0eb40558898f9abe4f9a66e0b77 Mon Sep 17 00:00:00 2001 From: denisname Date: Wed, 25 Apr 2018 00:54:31 +0200 Subject: [PATCH 0803/2153] Chosen.js update types for v1.8.5 (#25238) Add new options: group_search, hide_results_on_select, rtl Activate `strictNullChecks` Remove colon after `@default` Add jsDoc to `on` and `trigger` function Add line return before jsDoc first line Remove all exception rules to tslint (unified-signatures, max-line-length) --- types/chosen-js/chosen-js-tests.ts | 17 ++-- types/chosen-js/index.d.ts | 128 ++++++++++++++++++++--------- types/chosen-js/tsconfig.json | 2 +- types/chosen-js/tslint.json | 78 +----------------- 4 files changed, 104 insertions(+), 121 deletions(-) diff --git a/types/chosen-js/chosen-js-tests.ts b/types/chosen-js/chosen-js-tests.ts index 575b7503ea..811ff4994b 100644 --- a/types/chosen-js/chosen-js-tests.ts +++ b/types/chosen-js/chosen-js-tests.ts @@ -1,5 +1,3 @@ - - // Options $(".my_select_box").chosen(); @@ -12,14 +10,23 @@ $(".my_select_box").chosen({ width: "95%" }); +$(".chosen-select").chosen({ + rtl: true +}); + // Destroy $(".my_select_box").chosen("destroy"); // Triggered Events -$(".my_select_box").on("change", function(evt, params) { +$(".my_select_box").on("change", (evt, params) => { evt.preventDefault(); - let s = params.selected; - console.log(s); + const s: string = params.selected; + const d: string = params.deselected; + console.log(s, d); +}); + +$(".chosen-select").on("chosen:maxselected", () => { + alert("Max selected"); }); // Triggerable Events diff --git a/types/chosen-js/index.d.ts b/types/chosen-js/index.d.ts index c9a5556c26..e9a67550db 100644 --- a/types/chosen-js/index.d.ts +++ b/types/chosen-js/index.d.ts @@ -1,9 +1,11 @@ -// Type definitions for Chosen.JQuery 1.6.1 +// Type definitions for Chosen 1.8 // Project: http://harvesthq.github.com/chosen/ -// Definitions by: Boris Yankov , denis +// Definitions by: Boris Yankov , denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 +// Validated against Chosen version 1.8.5 + /// declare namespace Chosen { @@ -11,71 +13,107 @@ declare namespace Chosen { type TriggerEvent = "chosen:updated" | "chosen:activate" | "chosen:open" | "chosen:close"; interface Options { - /**When set to true on a single select, Chosen adds a UI element which selects the first element (if it is blank). - * @default: false + /** + * When set to true on a single select, Chosen adds a UI element which selects the first element (if it is blank). + * @default false */ allow_single_deselect?: boolean; - /**By default Chosen's search is case-insensitive. Setting this option to true makes the search case-sensitive. - * @default: false + /** + * By default, Chosen's search is case-insensitive. Setting this option to true makes the search case-sensitive. + * @default false */ case_sensitive_search?: boolean; - /**When set to true, Chosen will not display the search field (single selects only). - * @default: false + /** + * When set to true, Chosen will not display the search field (single selects only). + * @default false */ disable_search?: boolean; - /**Hide the search input on single selects if there are n or fewer options. - * @default: 0 + /** + * Hide the search input on single selects if there are n or fewer options. + * @default 0 */ disable_search_threshold?: number; - /**By default, searching will match on any word within an option tag. Set this option to false if you want to only match on the entire text of an option tag. - * @default: true + /** + * By default, searching will match on any word within an option tag. Set this option to false if you want to only match on the entire text of an option tag. + * @default true */ enable_split_word_search?: boolean; - /**When set to true, Chosen will grab any classes on the original select field and add them to Chosen’s container div. - * @default: false + /** + * By default, Chosen will search group labels as well as options, and filter to show all options below matching groups. Set this to false to search only in the options. + * @default true + */ + group_search?: boolean; + /** + * By default, Chosen's results are hidden after a option is selected. Setting this option to false will keep the results open after selection. This only applies to multiple selects. + * @default true + */ + hide_results_on_select?: boolean; + /** + * When set to true, Chosen will grab any classes on the original select field and add them to Chosen’s container div. + * @default false */ inherit_select_classes?: boolean; - /**Limits how many options the user can select. When the limit is reached, the chosen:maxselected event is triggered. - * @default: Infinity + /** + * Limits how many options the user can select. When the limit is reached, the `chosen:maxselected` event is triggered. + * @default Infinity */ max_selected_options?: number; - /**The text to be displayed when no matching results are found. The current search is shown at the end of the text (e.g., No results match "Bad Search"). - * @default: "No results match" + /** + * The text to be displayed when no matching results are found. The current search is shown at the end of the text (e.g., No results match "Bad Search"). + * @default "No results match" */ no_results_text?: string; - /**The text to be displayed as a placeholder when no options are selected for a multiple select. - * @default: "Select Some Options" + /** + * The text to be displayed as a placeholder when no options are selected for a multiple select. + * @default "Select Some Options" */ placeholder_text_multiple?: string; - /**The text to be displayed as a placeholder when no options are selected for a single select. - * @default: "Select an Option" + /** + * The text to be displayed as a placeholder when no options are selected for a single select. + * @default "Select an Option" */ placeholder_text_single?: string; - /**By default, Chosen’s search matches starting at the beginning of a word. Setting this option to true allows matches starting from anywhere within a word. This is especially useful for options that include a lot of special characters or phrases in ()s and []s. - * @default: false + /** + * Chosen supports right-to-left text in select boxes. Set this option to true to support right-to-left text options. + * @default false + */ + rtl?: boolean; + /** + * By default, Chosen’s search matches starting at the beginning of a word. Setting this option to true allows matches starting from anywhere within a word. + * This is especially useful for options that include a lot of special characters or phrases in ()s and []s. + * @default false */ search_contains?: boolean; - /**By default, pressing delete/backspace on multiple selects will remove a selected choice. When false, pressing delete/backspace will highlight the last choice, and a second press deselects it. - * @default: true + /** + * By default, pressing delete/backspace on multiple selects will remove a selected choice. + * When false, pressing delete/backspace will highlight the last choice, and a second press deselects it. + * @default true */ single_backstroke_delete?: boolean; - /**The width of the Chosen select box. By default, Chosen attempts to match the width of the select box you are replacing. If your select is hidden when Chosen is instantiated, you must specify a width or the select will show up with a width of 0. */ + /** + * The width of the Chosen select box. By default, Chosen attempts to match the width of the select box you are replacing. + * If your select is hidden when Chosen is instantiated, you must specify a width or the select will show up with a width of 0. + */ width?: string; - /**By default, Chosen includes disabled options in search results with a special styling. Setting this option to false will hide disabled results and exclude them from searches. - * @default: true + /** + * By default, Chosen includes disabled options in search results with a special styling. Setting this option to false will hide disabled results and exclude them from searches. + * @default true */ display_disabled_options?: boolean; - /**By default, Chosen includes selected options in search results with a special styling. Setting this option to false will hide selected results and exclude them from searches. + /** + * By default, Chosen includes selected options in search results with a special styling. Setting this option to false will hide selected results and exclude them from searches. * Note: this is for multiple selects only. In single selects, the selected result will always be displayed. - * @default: true + * @default true */ display_selected_options?: boolean; - /**By default, Chosen only shows the text of a selected option. Setting this option to true will show the text and group (if any) of the selected option. - * @default: false + /** + * By default, Chosen only shows the text of a selected option. Setting this option to true will show the text and group (if any) of the selected option. + * @default false */ include_group_label_in_selected?: boolean; - /**Only show the first (n) matching options in the results. This can be used to increase performance for selects with very many options. - * @default: Infinity + /** + * Only show the first (n) matching options in the results. This can be used to increase performance for selects with very many options. + * @default Infinity */ max_shown_results?: number; } @@ -87,13 +125,27 @@ declare namespace Chosen { } interface JQuery { - chosen(): JQuery; - chosen(options: Chosen.Options | "destroy"): JQuery; + chosen(options?: Chosen.Options | "destroy"): JQuery; - /**Chosen triggers the standard DOM event whenever a selection is made (it also sends a selected or deselected parameter that tells you which option was changed). */ + /** + * Chosen triggers the standard DOM event whenever a selection is made (it also sends a selected or deselected parameter that tells you which option was changed). + */ on(events: "change", handler: (eventObject: JQueryEventObject, args: Chosen.SelectedData) => any): JQuery; + /** + * * `chosen:ready` Triggered after Chosen has been fully instantiated. + * * `chosen:maxselected` Triggered if max_selected_options is set and that total is broken. + * * `chosen:showing_dropdown` Triggered when Chosen’s dropdown is opened. + * * `chosen:hiding_dropdown` Triggered when Chosen’s dropdown is closed. + * * `chosen:no_results` Triggered when a search returns no matching results. + */ on(events: Chosen.OnEvent, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * * `chosen:updated` This event should be triggered whenever Chosen’s underlying select element changes (such as a change in selected options). + * * `chosen:activate` This is the equivalant of focusing a standard HTML select field. When activated, Chosen will capure keypress events as if you had clicked the field directly. + * * `chosen:open` This event activates Chosen and also displays the search results. + * * `chosen:close` This event deactivates Chosen and hides the search results. + */ trigger(eventType: Chosen.TriggerEvent): JQuery; } diff --git a/types/chosen-js/tsconfig.json b/types/chosen-js/tsconfig.json index 9f4ce049cb..93360e6201 100644 --- a/types/chosen-js/tsconfig.json +++ b/types/chosen-js/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/chosen-js/tslint.json b/types/chosen-js/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/chosen-js/tslint.json +++ b/types/chosen-js/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } From eb895995a75491a41804373a28855d34ca1bf9d9 Mon Sep 17 00:00:00 2001 From: Fernando Alex Helwanger Date: Tue, 24 Apr 2018 19:55:02 -0300 Subject: [PATCH 0804/2153] Fix reverseGeocodeAsync return type (#25233) --- types/expo/expo-tests.tsx | 8 +++++++- types/expo/index.d.ts | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index d1b543c591..c40b76d93d 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -30,9 +30,15 @@ import { ScreenOrientation, SQLite, Calendar, - MailComposer + MailComposer, + Location } from 'expo'; +const reverseGeocode: Promise = Location.reverseGeocodeAsync({ + latitude: 0, + longitude: 0 +}); + Accelerometer.addListener((obj) => { obj.x; obj.y; diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 8e35cb8631..3726249cc7 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -1622,7 +1622,7 @@ export namespace Location { function getHeadingAsync(): Promise; function watchHeadingAsync(callback: (status: HeadingStatus) => void): EventSubscription; function geocodeAsync(address: string): Promise; - function reverseGeocodeAsync(location: LocationProps): Promise; + function reverseGeocodeAsync(location: LocationProps): Promise; function setApiKey(key: string): void; } From cfe11e8e8360f1154258aa67a0b114cbe08b538a Mon Sep 17 00:00:00 2001 From: Bryan Hughes Date: Tue, 24 Apr 2018 15:55:57 -0700 Subject: [PATCH 0805/2153] Updated various raspi-* modules to pull in breaking changes (#25203) --- types/raspi-board/index.d.ts | 3 ++- types/raspi-gpio/index.d.ts | 2 +- types/raspi-i2c/index.d.ts | 2 +- types/raspi-pwm/index.d.ts | 2 +- types/raspi-serial/index.d.ts | 2 +- types/raspi-soft-pwm/index.d.ts | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/types/raspi-board/index.d.ts b/types/raspi-board/index.d.ts index a244577c2b..5347c58e7f 100644 --- a/types/raspi-board/index.d.ts +++ b/types/raspi-board/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for raspi-board 5.0 +// Type definitions for raspi-board 5.2 // Project: https://github.com/nebrius/raspi-board // Definitions by: Bryan Hughes // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -13,6 +13,7 @@ export const VERSION_1_MODEL_ZERO = "rpi1_zero"; export const VERSION_1_MODEL_ZERO_W = "rpi1_zerow"; export const VERSION_2_MODEL_B = "rpi2_b"; export const VERSION_3_MODEL_B = "rpi3_b"; +export const VERSION_3_MODEL_B_PLUS = "rpi3_bplus"; export const VERSION_UNKNOWN = "unknown"; export interface PinInfo { pins: string[]; diff --git a/types/raspi-gpio/index.d.ts b/types/raspi-gpio/index.d.ts index 4daf607b87..60c0c125c1 100644 --- a/types/raspi-gpio/index.d.ts +++ b/types/raspi-gpio/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for raspi-gpio 5.0 +// Type definitions for raspi-gpio 6.0 // Project: https://github.com/nebrius/raspi-gpio // Definitions by: Bryan Hughes // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/raspi-i2c/index.d.ts b/types/raspi-i2c/index.d.ts index ce71190055..317a34f311 100644 --- a/types/raspi-i2c/index.d.ts +++ b/types/raspi-i2c/index.d.ts @@ -12,7 +12,6 @@ export class I2C extends Peripheral { private _devices; constructor(); destroy(): void; - private _getDevice(address); read(address: number, length: number, cb: ReadCallback): void; read(address: number, register: number, length: number, cb: ReadCallback): void; readSync(address: number, registerOrLength: number | undefined, length?: number): Buffer; @@ -32,4 +31,5 @@ export class I2C extends Peripheral { writeWord(address: number, word: number, cb?: WriteCallback): void; writeWord(address: number, register: number, word: number, cb?: WriteCallback): void; writeWordSync(address: number, registerOrWord: number, word?: number): void; + private _getDevice(address); } diff --git a/types/raspi-pwm/index.d.ts b/types/raspi-pwm/index.d.ts index 42c122c75d..aa6b5e4774 100644 --- a/types/raspi-pwm/index.d.ts +++ b/types/raspi-pwm/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for raspi-pwm 5.0 +// Type definitions for raspi-pwm 6.0 // Project: https://github.com/nebrius/raspi-pwm // Definitions by: Bryan Hughes // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/raspi-serial/index.d.ts b/types/raspi-serial/index.d.ts index 033c0682c3..c26b9a6852 100644 --- a/types/raspi-serial/index.d.ts +++ b/types/raspi-serial/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for raspi-serial 4.0 +// Type definitions for raspi-serial 5.0 // Project: https://github.com/nebrius/raspi-serial // Definitions by: Bryan Hughes // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/raspi-soft-pwm/index.d.ts b/types/raspi-soft-pwm/index.d.ts index 098cf9aff7..3e3296d979 100644 --- a/types/raspi-soft-pwm/index.d.ts +++ b/types/raspi-soft-pwm/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for raspi-soft-pwm 4.0 +// Type definitions for raspi-soft-pwm 5.0 // Project: https://github.com/nebrius/raspi-soft-pwm // Definitions by: Bryan Hughes // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From c8ca0b5b8f028bc158fd380c8f65135c48576dc6 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 24 Apr 2018 23:56:52 +0100 Subject: [PATCH 0806/2153] Jsforce updates (#25152) * Add bulk, batch and job and clean up * Add streaming api * Put test dependencies into test file * Update OAuth2 typings * Fix linting * Add Bulk and Streaming tests * Fix linting * Fix lint rules for new dtslinter * Make Id optional * Make T any by default * Set callbacks to have Error as first argument * Remove blank interface * Clean up and remove unused and duplicated typings * Sort exports --- types/jsforce/api/analytics.d.ts | 53 +++++++++++++--------------- types/jsforce/api/chatter.d.ts | 16 ++++----- types/jsforce/api/metadata.d.ts | 46 ++++++++++++------------ types/jsforce/batch.d.ts | 26 ++++++++++++++ types/jsforce/bulk.d.ts | 31 ++++++++++++++++ types/jsforce/channel.d.ts | 5 +++ types/jsforce/connection.d.ts | 29 ++++++++------- types/jsforce/index.d.ts | 39 ++++++++++---------- types/jsforce/job.d.ts | 24 +++++++++++++ types/jsforce/jsforce-tests.ts | 50 +++++++++++++++++++++++--- types/jsforce/oauth2.d.ts | 22 +++++++----- types/jsforce/record.d.ts | 8 +++-- types/jsforce/salesforce-object.d.ts | 17 +-------- types/jsforce/streaming.d.ts | 23 ++++++++++++ types/jsforce/topic.d.ts | 8 +++++ types/jsforce/tsconfig.json | 10 +----- 16 files changed, 273 insertions(+), 134 deletions(-) create mode 100644 types/jsforce/batch.d.ts create mode 100644 types/jsforce/bulk.d.ts create mode 100644 types/jsforce/channel.d.ts create mode 100644 types/jsforce/job.d.ts create mode 100644 types/jsforce/streaming.d.ts create mode 100644 types/jsforce/topic.d.ts diff --git a/types/jsforce/api/analytics.d.ts b/types/jsforce/api/analytics.d.ts index 02f04fac41..09784acfed 100644 --- a/types/jsforce/api/analytics.d.ts +++ b/types/jsforce/api/analytics.d.ts @@ -1,64 +1,59 @@ -import { callback } from '../connection'; - -interface ReportInfo { -} +import { Callback } from '../connection'; +import { ExplainInfo } from '../query'; export class Dashboard { - describe(callback?: callback): Promise; + describe(callback?: Callback): Promise; - del(callback?: callback): Promise; + del(callback?: Callback): Promise; - destory(callback?: callback): Promise; + destory(callback?: Callback): Promise; - delete(callback?: callback): Promise; + delete(callback?: Callback): Promise; - components(componentIds: () => any | string[] | string, callback?: callback): Promise; + components(componentIds: () => any | string[] | string, callback?: Callback): Promise; - status(callback?: callback): Promise; + status(callback?: Callback): Promise; - refresh(callback?: callback): Promise; + refresh(callback?: Callback): Promise; - clone(name: string | object, folderid: string, callback?: callback): Promise; + clone(name: string | object, folderid: string, callback?: Callback): Promise; } export class ReportInstance { constructor(report: Report, id: string); - retrieve(callback: callback): Promise + retrieve(callback: Callback): Promise } export class Report { - describe(callback?: callback): Promise; + describe(callback?: Callback): Promise; - del(callback?: callback): Promise; + del(callback?: Callback): Promise; - destory(callback?: callback): Promise; + destory(callback?: Callback): Promise; - delete(callback?: callback): Promise; + delete(callback?: Callback): Promise; - clone(name: string, callback?: callback): Promise; + clone(name: string, callback?: Callback): Promise; - explain(callback?: callback): Promise; + explain(callback?: Callback): Promise; - run(options: () => any | object, callback?: callback): Promise; + run(options: () => any | object, callback?: Callback): Promise; - exec(options: () => any | object, callback?: callback): Promise; + exec(options: () => any | object, callback?: Callback): Promise; - execute(options: () => any | object, callback?: callback): Promise; + execute(options: () => any | object, callback?: Callback): Promise; - executeAsync(options: () => any | object, callback?: callback): Promise; + executeAsync(options: () => any | object, callback?: Callback): Promise; instance(id: string): ReportInstance; - instances(callback?: callback): Promise; + instances(callback?: Callback): Promise; } export interface ReportInstanceAttrs { } -export interface ExplainInfo { -} - export interface ReportMetadata { } @@ -74,9 +69,9 @@ export interface DashboardInfo { export class Analytics { report(id: string): Promise; - reports(callback?: callback): Promise; + reports(callback?: Callback): Promise; dashboard(id: string): Promise; - dashboards(callback?: callback): Promise; + dashboards(callback?: Callback): Promise; } diff --git a/types/jsforce/api/chatter.d.ts b/types/jsforce/api/chatter.d.ts index 05fc4551e0..4e0982ca24 100644 --- a/types/jsforce/api/chatter.d.ts +++ b/types/jsforce/api/chatter.d.ts @@ -1,4 +1,4 @@ -import { Connection, callback } from '../connection'; +import { Connection, Callback } from '../connection'; import { Query } from '../query'; import { Stream } from 'stream'; @@ -49,23 +49,23 @@ export class Request implements Promise { export class Resource extends Request { constructor(chatter: Chatter, url: string, queryParams?: object); - create(data: object | string, callback?: callback): Request; + create(data: object | string, callback?: Callback): Request; - del(callback?: callback): Request; + del(callback?: Callback): Request; - delete(callback?: callback): Request; + delete(callback?: Callback): Request; - retrieve(callback?: callback): Request; + retrieve(callback?: Callback): Request; - update(data: object, callback?: callback): Request; + update(data: object, callback?: Callback): Request; } export class Chatter { constructor(conn: Connection); - batch(callback?: callback): Promise; + batch(callback?: Callback): Promise; - request(params: RequestParams, callback?: callback>): Request; + request(params: RequestParams, callback?: Callback>): Request; resource(url: string, queryParams?: object): Resource } diff --git a/types/jsforce/api/metadata.d.ts b/types/jsforce/api/metadata.d.ts index c867ece15b..15f0fe249e 100644 --- a/types/jsforce/api/metadata.d.ts +++ b/types/jsforce/api/metadata.d.ts @@ -1,4 +1,4 @@ -import { callback, Connection } from '../connection'; +import { Callback, Connection } from '../connection'; import { EventEmitter } from 'events'; import { Stream } from 'stream'; @@ -113,9 +113,9 @@ interface DeployOptions { } export class AsyncResultLocator extends EventEmitter implements Promise { - check(callback?: callback): Promise + check(callback?: Callback): Promise - complete(callback?: callback): Promise + complete(callback?: Callback): Promise poll(interval: number, timeout: number): void; @@ -136,43 +136,43 @@ export class Metadata { constructor(conn: Connection); - checkDeployStatus(id: string, includeDetails?: boolean, callback?: callback): Promise + checkDeployStatus(id: string, includeDetails?: boolean, callback?: Callback): Promise - checkRetrieveStatus(id: string, callback?: callback): Promise + checkRetrieveStatus(id: string, callback?: Callback): Promise - checkStatus(ids: string | string[], callback?: callback>): AsyncResultLocator> + checkStatus(ids: string | string[], callback?: Callback>): AsyncResultLocator> - create(type: string, metadata: MetadataInfo | Array, callback?: callback>): Promise> + create(type: string, metadata: MetadataInfo | Array, callback?: Callback>): Promise> - createAsync(type: string, metadata: MetadataInfo | Array, callback?: callback>): Promise> + createAsync(type: string, metadata: MetadataInfo | Array, callback?: Callback>): Promise> - createSync(type: string, metadata: MetadataInfo | Array, callback?: callback>): Promise>; + createSync(type: string, metadata: MetadataInfo | Array, callback?: Callback>): Promise>; - delete(type: string, fullNames: string | string[], callback?: callback>): Promise>; + delete(type: string, fullNames: string | string[], callback?: Callback>): Promise>; - deleteAsync(type: string, metadata: string | string[] | MetadataInfo | Array, callback?: callback>): AsyncResultLocator> + deleteAsync(type: string, metadata: string | string[] | MetadataInfo | Array, callback?: Callback>): AsyncResultLocator> - deleteSync(type: string, fullNames: string | string[], callback?: callback>): Promise>; + deleteSync(type: string, fullNames: string | string[], callback?: Callback>): Promise>; - deploy(zipInput: Stream | Buffer | string, options: DeployOptions, callback?:callback): DeployResultLocator; + deploy(zipInput: Stream | Buffer | string, options: DeployOptions, callback?:Callback): DeployResultLocator; - describe(version?: string, callback?: callback): Promise; + describe(version?: string, callback?: Callback): Promise; - list(queries: ListMetadataQuery | Array, version?: string, callback?: callback>): Promise>; + list(queries: ListMetadataQuery | Array, version?: string, callback?: Callback>): Promise>; - read(type: string, fullNames: string | string[], callback?: callback>): Promise>; + read(type: string, fullNames: string | string[], callback?: Callback>): Promise>; - readSync(type: string, fullNames: string | string[], callback?: callback>): Promise>; + readSync(type: string, fullNames: string | string[], callback?: Callback>): Promise>; - rename(type: string, oldFullName: string, newFullName: string, callback?: callback): Promise + rename(type: string, oldFullName: string, newFullName: string, callback?: Callback): Promise - retrieve(request: RetrieveRequest, callback: callback): RetrieveResultLocator + retrieve(request: RetrieveRequest, callback: Callback): RetrieveResultLocator - update(type: string, updateMetadata: MetadataInfo | Array, callback?: callback>): Promise> + update(type: string, updateMetadata: MetadataInfo | Array, callback?: Callback>): Promise> - updateAsync(type: string, updateMetadata: MetadataInfo, callback?: callback>): AsyncResultLocator> + updateAsync(type: string, updateMetadata: MetadataInfo, callback?: Callback>): AsyncResultLocator> - updateSync(type: string, updateMetadata: MetadataInfo | Array, callback?: callback>): Promise> + updateSync(type: string, updateMetadata: MetadataInfo | Array, callback?: Callback>): Promise> - upsert(type: string, metadata: MetadataInfo | Array, callback?: callback>): Promise> + upsert(type: string, metadata: MetadataInfo | Array, callback?: Callback>): Promise> } diff --git a/types/jsforce/batch.d.ts b/types/jsforce/batch.d.ts new file mode 100644 index 0000000000..94a24fa2cd --- /dev/null +++ b/types/jsforce/batch.d.ts @@ -0,0 +1,26 @@ +import { Stream, Writable } from 'stream'; + +import { RecordResult } from './record-result'; +import { Record } from './record'; + +export interface BatchInfo { + id: string; + jobId: string; + state: string; + stateMessage: string; +} + +export interface BatchResultInfo { + id: string; + batchId: string; + jobId: string; +} + +export class Batch extends Writable { + check(callback?: (batchInfo: BatchInfo) => void): Promise; + execute(input?: Record[] | Stream | string, callback?: (err: Error, result: RecordResult[] | BatchResultInfo[]) => void): Batch; + poll(interval: number, timeout: number): void; + retrieve(callback?: (batchInfo: BatchInfo) => void): Promise; + then(): Promise; + thenAll(callback: (data: any) => void): void; +} diff --git a/types/jsforce/bulk.d.ts b/types/jsforce/bulk.d.ts new file mode 100644 index 0000000000..51708f59f1 --- /dev/null +++ b/types/jsforce/bulk.d.ts @@ -0,0 +1,31 @@ +import { Stream } from 'stream'; + +import { Connection } from './connection'; +import { RecordResult } from './record-result'; +import { Record } from './record'; +import { Job } from './job'; +import { Batch, BatchResultInfo } from './batch'; + +export interface BulkOptions { + extIdField: string; + concurrencyMode: 'Serial' | 'Parallel'; +} + +type BulkLoadOperation = + | 'insert' + | 'update' + | 'upsert' + | 'delete' + | 'hardDelete'; + +export class Bulk { + constructor(connection: Connection); + + pollInterval: number; + pollTimeout: number; + + createJob(type: string, operation: string, options?: BulkOptions): Job; + job(id: string): Job; + load(type: string, operation: BulkLoadOperation, options?: BulkOptions, input?: Record[] | Stream | string, callback?: (err: Error, result: RecordResult[] | BatchResultInfo[]) => void): Batch; + query(soql: string): any; +} diff --git a/types/jsforce/channel.d.ts b/types/jsforce/channel.d.ts new file mode 100644 index 0000000000..a290c04d88 --- /dev/null +++ b/types/jsforce/channel.d.ts @@ -0,0 +1,5 @@ +import { Streaming } from "./streaming"; + +export class Channel { + constructor(streaming: Streaming, name: string); +} diff --git a/types/jsforce/connection.d.ts b/types/jsforce/connection.d.ts index 06cda5e29f..2283320912 100644 --- a/types/jsforce/connection.d.ts +++ b/types/jsforce/connection.d.ts @@ -7,12 +7,14 @@ import { SObject } from './salesforce-object'; import { Analytics } from './api/analytics'; import { Chatter } from './api/chatter'; import { Metadata } from './api/metadata'; +import { Bulk } from './bulk'; +import { OAuth2, Streaming } from '.'; -export type callback = (err: Error, result: T) => void; +export type Callback = (err: Error, result: T) => void; // These are pulled out because according to http://jsforce.github.io/jsforce/doc/connection.js.html#line49 // the oauth options can either be in the `oauth2` proeprty OR spread across the main connection -export interface OAuth2Options { +export interface PartialOAuth2Options { clientId?: string; clientSecret?: string; loginUrl?: string; @@ -25,14 +27,14 @@ export interface RequestInfo { headers?: object; } -export interface ConnectionOptions extends OAuth2Options { +export interface ConnectionOptions extends PartialOAuth2Options { accessToken?: string; callOptions?: Object; instanceUrl?: string; loginUrl?: string; logLevel?: string; maxRequest?: number; - oauth2?: Partial; + oauth2?: Partial; proxyUrl?: string; redirectUri?: string; refreshToken?: string; @@ -82,21 +84,21 @@ export abstract class BaseConnection extends EventEmitter { request(info: RequestInfo | string, options?: Object, callback?: (err: Error, Object: object) => void): Promise; query(soql: string, callback?: (err: Error, result: QueryResult) => void): Query>; queryMore(locator: string, options?: object, callback?: (err: Error, result: QueryResult) => void): Promise>; - create(type: string, records: Record|Array>, options?: Object, + create(type: string, records: Record | Array>, options?: Object, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; - insert(type: string, records: Record|Array>, options?: Object, + insert(type: string, records: Record | Array>, options?: Object, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; - retrieve(type: string, ids: string|string[], options?: Object, + retrieve(type: string, ids: string | string[], options?: Object, callback?: (err: Error, result: Record | Array>) => void): Promise<(Record | Array>)>; - update(type: string, records: Record|Array>, options?: Object, + update(type: string, records: Record | Array>, options?: Object, callback?: (err: Error, result: RecordResult | Array>) => void): Promise<(RecordResult | RecordResult[])>; - upsert(type: string, records: Record|Array>, extIdField: string, options?: Object, + upsert(type: string, records: Record | Array>, extIdField: string, options?: Object, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; - del(type: string, ids: string|string[], options?: Object, + del(type: string, ids: string | string[], options?: Object, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; - delete(type: string, ids: string|string[], options?: Object, + delete(type: string, ids: string | string[], options?: Object, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; - destroy(type: string, ids: string|string[], options?: Object, + destroy(type: string, ids: string | string[], options?: Object, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; describe(type: string, callback?: (err: Error, result: DescribeSObjectResult) => void): Promise; describeGlobal(callback?: (err: Error, result: DescribeGlobalResult) => void): Promise; @@ -110,6 +112,9 @@ export class Connection extends BaseConnection { analytics: Analytics; chatter: Chatter; metadata: Metadata; + bulk: Bulk; + oauth2: OAuth2; + streaming: Streaming; // Specific to Connection instanceUrl: string; diff --git a/types/jsforce/index.d.ts b/types/jsforce/index.d.ts index edb2830f52..704bb07655 100644 --- a/types/jsforce/index.d.ts +++ b/types/jsforce/index.d.ts @@ -7,24 +7,21 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -import * as fs from 'fs'; -import * as stream from 'stream'; -import * as express from 'express'; -import * as glob from 'glob'; - -export { Date } from './date-enum'; -export { Record } from './record'; -export { RecordResult } from './record-result'; -export { Connection, ConnectionOptions, RequestInfo, Tooling, callback } from './connection'; -export { SObject } from './salesforce-object'; -export { SalesforceId } from './salesforce-id'; -export { OAuth2, OAuth2Options } from './oauth2'; -export { Query, QueryResult } from './query'; -export { Promise } from './promise'; -export { Report, Dashboard, Analytics, ReportInstance, DashboardInfo, ReportInfo, ExplainInfo, ReportInstanceAttrs, - ReportMetadata, ReportResult } from './api/analytics'; -export { Chatter, Request, RequestResult, BatchRequestResults, BatchRequestParams, - Resource, BatchRequestResult, RequestParams } from './api/chatter'; -export { Metadata, SaveResult, MetadataInfo, AsyncResult, RetrieveResultLocator, RetrieveRequest, FileProperties, - ListMetadataQuery, DescribeMetadataResult, DeployOptions, AsyncResultLocator, RetrieveResult, MetadataObject, - DeployResult, DeployResultLocator, UpdateMetadataInfo, UpsertResult } from './api/metadata'; +export * from './api/analytics'; +export * from './api/chatter'; +export * from './api/metadata'; +export * from './batch'; +export * from './bulk'; +export * from './channel'; +export * from './connection'; +export * from './date-enum'; +export * from './job'; +export * from './oauth2'; +export * from './promise'; +export * from './query'; +export * from './record'; +export * from './record-result'; +export * from './salesforce-id'; +export * from './salesforce-object'; +export * from './streaming'; +export * from './topic'; diff --git a/types/jsforce/job.d.ts b/types/jsforce/job.d.ts new file mode 100644 index 0000000000..bdad4bf564 --- /dev/null +++ b/types/jsforce/job.d.ts @@ -0,0 +1,24 @@ +import { EventEmitter } from 'events'; + +import { Bulk, BulkOptions } from './bulk'; +import { Batch, BatchInfo } from './batch'; + +export interface JobInfo { + id: string; + object: string; + operation: string; + state: string; +} + +export class Job extends EventEmitter { + constructor(bulk: Bulk, type?: string, operation?: string, options?: BulkOptions, jobId?: string); + + abort(callback?: (err: Error, jobInfo: JobInfo) => void): Promise; + batch(batchId: string): Batch; + check(callback?: (err: Error, jobInfo: JobInfo) => void): Promise; + close(callback?: (err: Error, jobInfo: JobInfo) => void): Promise; + createBatch(): Batch; + info(callback?: (err: Error, jobInfo: JobInfo) => void): Promise; + list(callback?: (err: Error, jobInfo: BatchInfo) => void): Promise; + open(callback?: (err: Error, jobInfo: JobInfo) => void): Promise; +} diff --git a/types/jsforce/jsforce-tests.ts b/types/jsforce/jsforce-tests.ts index 9205d59096..156b0d292b 100644 --- a/types/jsforce/jsforce-tests.ts +++ b/types/jsforce/jsforce-tests.ts @@ -1,3 +1,8 @@ +import * as fs from 'fs'; +import * as stream from 'stream'; +import * as express from 'express'; +import * as glob from 'glob'; + import * as sf from 'jsforce'; export interface DummyRecord { @@ -125,7 +130,7 @@ async function testMetadata(conn: sf.Connection): Promise { m.metadataObjects.filter((value: sf.MetadataObject) => value.directoryName === 'pages'); console.log(`ApexPage?: ${pages[0].xmlName === 'ApexPage'}`); - const types: sf.ListMetadataQuery[] = [{type: 'CustomObject', folder: null}]; + const types: sf.ListMetadataQuery[] = [{ type: 'CustomObject', folder: null }]; md.list(types, '39.0', (err, properties: sf.FileProperties[]) => { if (err) { console.error('err', err); @@ -147,7 +152,7 @@ async function testMetadata(conn: sf.Connection): Promise { console.log('type: ' + meta.type); }); - const fullNames: string[] = [ 'Account', 'Contact' ]; + const fullNames: string[] = ['Account', 'Contact']; const info: sf.MetadataInfo | sf.MetadataInfo[] = await md.read('CustomObject', fullNames); console.log((info as sf.MetadataInfo[])[0].fullName); console.log((info as sf.MetadataInfo[])[1].fullName); @@ -196,7 +201,7 @@ async function testChatter(conn: sf.Connection): Promise { text: 'This is new post' }] }, - feedElementType : 'FeedItem', + feedElementType: 'FeedItem', subjectId: 'me' }, (err: Error, result: any) => { if (err) { @@ -255,7 +260,7 @@ async function testChatter(conn: sf.Connection): Promise { text: 'This is new comment on the post' }] }, - feedElementType : 'FeedItem', + feedElementType: 'FeedItem', subjectId: 'me' }) as Promise); @@ -264,7 +269,7 @@ async function testChatter(conn: sf.Connection): Promise { const itemsLikeResource: sf.Resource = chatter.resource(itemLikesUrl); const itemsLikeCreateResult: sf.RequestResult = await (itemsLikeResource.create('') as Promise); - console.log(`itemsLikeCreateResult['likedItem']: ${itemsLikeCreateResult as any ['likedItem']}`); + console.log(`itemsLikeCreateResult['likedItem']: ${itemsLikeCreateResult as any['likedItem']}`); } (async () => { @@ -277,3 +282,38 @@ async function testChatter(conn: sf.Connection): Promise { await testChatter(salesforceConnection); await testMetadata(salesforceConnection); })(); + +const oauth2 = new sf.OAuth2({ + // you can change loginUrl to connect to sandbox or prerelease env. + // loginUrl : 'https://test.salesforce.com', + clientId: '', + clientSecret: '', + redirectUri: '' +}); +oauth2.getAuthorizationUrl({ scope: 'api id web' }); + +const job = salesforceConnection.bulk.createJob("Account", "insert"); +const batch = job.createBatch(); +batch.execute(undefined); +batch.on("queue", (batchInfo) => { // fired when batch request is queued in server. + console.log('batchInfo:', batchInfo); + const batchId = batchInfo.id; + const jobId = batchInfo.jobId; +}); +job.batch("batchId"); +batch.poll(1000, 20000); +batch.on("response", (rets) => { + for (let i = 0; i < rets.length; i++) { + if (rets[i].success) { + console.log(`# ${(i + 1)} loaded successfully, id = ${rets[i].id}`); + } else { + console.log(`# ${(i + 1)} error occurred, message = ${rets[i].errors.join(', ')}`); + } + } +}); + +salesforceConnection.streaming.topic("InvoiceStatementUpdates").subscribe((message) => { + console.log('Event Type : ' + message.event.type); + console.log('Event Created : ' + message.event.createdDate); + console.log('Object Id : ' + message.sobject.Id); +}); diff --git a/types/jsforce/oauth2.d.ts b/types/jsforce/oauth2.d.ts index 833a9d45fd..64e26e1719 100644 --- a/types/jsforce/oauth2.d.ts +++ b/types/jsforce/oauth2.d.ts @@ -14,10 +14,13 @@ export interface OAuth2Options { privateKey?: string; // Used for sfdx auth files for legacy support reasons } -export class OAuth2 { - constructor (options? : OAuth2Options); +export interface TokenResponse { + access_token: string; + refresh_token: string; +} - protected _postParams(options: any, callback: () => any): void +export class OAuth2 { + constructor(options?: OAuth2Options); loginUrl: string; authzServiceUrl: string; @@ -27,9 +30,12 @@ export class OAuth2 { clientSecret: string; redirectUri: string; - getAuthorizationUrl(params: any): string; - refreshToken(code: string, callback?: () => any): Promise; - requestToken(code: string, callback?: () => any): Promise; - authenticate(username: string, password: string, callback?: () => any): Promise; - revokeToken(accessToken: string, callback?: () => any): Promise; + getAuthorizationUrl(params: { + scope?: string, + state?: string + }): string; + refreshToken(code: string, callback?: (err: Error, tokenResponse: TokenResponse) => void): Promise; + requestToken(code: string, callback?: (err: Error, tokenResponse: TokenResponse) => void): Promise; + authenticate(username: string, password: string, callback?: (err: Error, tokenResponse: TokenResponse) => void): Promise; + revokeToken(accessToken: string, callback?: (err: Error, ) => void): Promise; } diff --git a/types/jsforce/record.d.ts b/types/jsforce/record.d.ts index 3dd0bca1da..25ca2d62f4 100644 --- a/types/jsforce/record.d.ts +++ b/types/jsforce/record.d.ts @@ -1,10 +1,12 @@ +import { Stream } from 'stream'; + import { RecordResult } from './record-result'; import { Connection } from './connection'; import { SalesforceId } from './salesforce-id'; -import { Stream } from 'stream'; -export class RecordReference { +export class RecordReference { constructor(conn: Connection, type: string, id: SalesforceId); + blob(fieldName: string): Stream; del(options?: Object, callback?: (err: Error, result: RecordResult) => void): Promise; delete(options?: Object, callback?: (err: Error, result: RecordResult) => void): Promise; @@ -13,4 +15,4 @@ export class RecordReference { update(record: Partial, options?: Object, callback?: (err: Error, result: RecordResult) => void): Promise; } -export type Record = {Id: SalesforceId } & T; +export type Record = { Id?: SalesforceId } & T; diff --git a/types/jsforce/salesforce-object.d.ts b/types/jsforce/salesforce-object.d.ts index 86ec7ecaf4..2c54d598fc 100644 --- a/types/jsforce/salesforce-object.d.ts +++ b/types/jsforce/salesforce-object.d.ts @@ -7,6 +7,7 @@ import { Record, RecordReference } from './record'; import { RecordResult } from './record-result'; import { Connection } from './connection'; import { SalesforceId } from './salesforce-id'; +import { Batch, BatchResultInfo } from './batch'; export class SObject { record(id: SalesforceId): RecordReference; @@ -61,9 +62,6 @@ export interface ApprovalLayoutInfo { approvalLayouts: Object[]; } -export class Batch extends stream.Writable { -} - export interface CompactLayoutInfo { compactLayouts: Object[]; defaultCompactLayoutId: string; @@ -88,18 +86,5 @@ export class ListView { constructor(connection: Connection, type: string, id: SalesforceId) } -export interface BatchInfo { - id: string; - jobId: string; - state: string; - stateMessage: string; -} - -export interface BatchResultInfo { - id: string; - batchId: string; - jobId: string; -} - export class ListViewsInfo { } export class QuickAction { } diff --git a/types/jsforce/streaming.d.ts b/types/jsforce/streaming.d.ts new file mode 100644 index 0000000000..9d91de90f1 --- /dev/null +++ b/types/jsforce/streaming.d.ts @@ -0,0 +1,23 @@ +import { EventEmitter } from 'events'; + +import { Connection } from './connection'; +import { Record } from './record'; +import { Channel } from './channel'; +import { Topic } from './topic'; + +export interface StreamingMessage { + event: { + type: object + createdDate: any; + }; + sobject: Record +} + +export class Streaming extends EventEmitter { + constructor(connection: Connection); + + channel(channelId: string): Channel; + subscribe(name: string, listener: StreamingMessage): any; // Faye Subscription + topic(namne: string): Topic; + unsubscribe(name: string, listener: StreamingMessage): Streaming; +} diff --git a/types/jsforce/topic.d.ts b/types/jsforce/topic.d.ts new file mode 100644 index 0000000000..1de6f41aad --- /dev/null +++ b/types/jsforce/topic.d.ts @@ -0,0 +1,8 @@ +import { Streaming, StreamingMessage } from "./streaming"; + +export class Topic { + constructor(streaming: Streaming, name: string); + + subscribe(listener: (streamingMessage: StreamingMessage) => void): any; // Faye Subscription + unsubscribe(listener: (streamingMessage: StreamingMessage) => void): Topic; +} diff --git a/types/jsforce/tsconfig.json b/types/jsforce/tsconfig.json index 0d480d799f..bf92077cd0 100644 --- a/types/jsforce/tsconfig.json +++ b/types/jsforce/tsconfig.json @@ -18,14 +18,6 @@ }, "files": [ "index.d.ts", - "connection.d.ts", - "create-options.d.ts", - "date-enum.d.ts", - "salesforce-object-options.d.ts", - "salesforce-object.d.ts", - "salesforce-id.d.ts", - "query.d.ts", - "describe-result.d.ts", "jsforce-tests.ts" ] -} \ No newline at end of file +} From e87728aa06a5ca7e9ff2435dea72e3abac81645f Mon Sep 17 00:00:00 2001 From: "Kees C. Bakker" Date: Wed, 25 Apr 2018 00:57:07 +0200 Subject: [PATCH 0807/2153] Added alias, name, helpCommands and loadFile (#25012) * Added some extra defintions - Alias and name can be used to identify the name of the bot. - helpCommands will list all help commands - loadFile will load a script file from a directory into the bot * Update index.d.ts * Making CLI happy. --- types/hubot/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/hubot/index.d.ts b/types/hubot/index.d.ts index 7da5501736..1b90a512af 100644 --- a/types/hubot/index.d.ts +++ b/types/hubot/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for hubot 2.19 // Project: https://github.com/github/hubot // Definitions by: Dirk Gadsden +// Kees C. Bakker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Hubot { @@ -33,12 +34,16 @@ declare namespace Hubot { type ListenerCallback = (response: Response) => void; class Robot { + alias: string; brain: Brain; + name: string; readonly adapter: A; constructor(adapterPath: string, adapter: string, httpd: boolean, name: string, alias?: string); hear(regex: RegExp, callback: ListenerCallback): void; hear(regex: RegExp, options: any, callback: ListenerCallback): void; + helpCommands(): string[]; + loadFile(directory: string, fileName: string): void; respond(regex: RegExp, callback: ListenerCallback): void; respond(regex: RegExp, options: any, callback: ListenerCallback): void; } From b11cc1ee031e676f848d2ff639ca8e6172230ec7 Mon Sep 17 00:00:00 2001 From: Aankhen Date: Wed, 25 Apr 2018 04:27:24 +0530 Subject: [PATCH 0808/2153] [puppeteer] Add `Request.failure` and test. (#25178) --- types/puppeteer/index.d.ts | 5 +++++ types/puppeteer/puppeteer-tests.ts | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/types/puppeteer/index.d.ts b/types/puppeteer/index.d.ts index 9298d6c631..4b5be6bbc8 100644 --- a/types/puppeteer/index.d.ts +++ b/types/puppeteer/index.d.ts @@ -627,6 +627,11 @@ export interface Request { */ continue(overrides?: Overrides): Promise; + /** + * @returns An object if the request failed, null otherwise. + */ + failure(): { errorText: string; } | null; + /** * @returns The `Frame` object that initiated the request, or `null` if navigating to error pages */ diff --git a/types/puppeteer/puppeteer-tests.ts b/types/puppeteer/puppeteer-tests.ts index 3d7d44d0ca..043c2f5c78 100644 --- a/types/puppeteer/puppeteer-tests.ts +++ b/types/puppeteer/puppeteer-tests.ts @@ -282,6 +282,24 @@ puppeteer.launch().then(async browser => { browser.close(); })(); +// Test 0.13 features +(async () => { + const browser = await puppeteer.launch(); + const page = await browser.newPage(); + const handler = (r: puppeteer.Request) => { + const failure = r.failure(); + + if (failure == null) { + console.error("Request completed successfully"); + return; + } + + console.log("Request failed", failure.errorText.toUpperCase()); + }; + page.on('requestfinished', handler); + page.on('requestfailed', handler); +})(); + // Test 1.0 features (async () => { const browser = await puppeteer.launch({ From 2f3c13b0d372adbca88a5c87cdf6783643df2fb0 Mon Sep 17 00:00:00 2001 From: Rogerio Teixeira nunes Date: Wed, 25 Apr 2018 00:58:36 +0200 Subject: [PATCH 0809/2153] Fabric (#25168) * Add types backend filter * Add types backend filter * Add types backend filter * Add types backend filter(review) --- types/fabric/fabric-impl.d.ts | 188 ++++++++++++++++++++++------------ types/fabric/index.d.ts | 1 + types/fabric/test/index.ts | 6 ++ 3 files changed, 129 insertions(+), 66 deletions(-) diff --git a/types/fabric/fabric-impl.d.ts b/types/fabric/fabric-impl.d.ts index 369856130c..e35b0ebe0d 100644 --- a/types/fabric/fabric-impl.d.ts +++ b/types/fabric/fabric-impl.d.ts @@ -283,7 +283,7 @@ interface IObservable { * Observes specified event * @param eventName Object with key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler}) */ - on(events: {[eventName: string]: (e: IEvent) => void}): T; + on(events: { [eventName: string]: (e: IEvent) => void }): T; /** * Fires event with an optional options object * @param eventName Event name to fire @@ -296,7 +296,7 @@ interface IObservable { * @param eventName Event name (eg. 'after:render') or object with key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler}) * @param handler Function to be deleted from EventListeners */ - off(eventName?: string|any, handler?: (e: IEvent) => void): T; + off(eventName?: string | any, handler?: (e: IEvent) => void): T; } interface Callbacks { @@ -337,7 +337,7 @@ interface IObjectAnimation { * @param value Value to animate property * @param options The animation options */ - animate(property: string, value: number|string, options?: IAnimationOptions): Object; + animate(property: string, value: number | string, options?: IAnimationOptions): Object; /** * Animates object's properties * object.animate({ left: ..., top: ... }, { duration: ... }); @@ -350,7 +350,7 @@ interface IAnimationOptions { /** * Allows to specify starting value of animatable property (if we don't want current value to be used). */ - from?: string|number; + from?: string | number; /** * Defaults to 500 (ms). Can be used to change duration of an animation. */ @@ -443,7 +443,7 @@ export class Color { /** * Overlays color with another color */ - overlayWith(otherColor: string|Color): Color; + overlayWith(otherColor: string | Color): Color; /** * Returns new color object, when given a color in RGB format @@ -551,7 +551,7 @@ interface IGradient extends IGradientOptions { toLive(ctx: CanvasRenderingContext2D, object?: PathGroup): CanvasGradient; } interface IGrandientStatic { - new (options?: IGradientOptions): IGradient; + new(options?: IGradientOptions): IGradient; /** * Returns instance from an SVG element * @param el SVG gradient element @@ -612,10 +612,10 @@ interface IPatternOptions { /** * The source for the pattern */ - source: string|HTMLImageElement; + source: string | HTMLImageElement; } -export interface Pattern extends IPatternOptions {} -export class Pattern { +export interface Pattern extends IPatternOptions { } +export class Pattern { constructor(options?: IPatternOptions); initialise(options?: IPatternOptions): Pattern; @@ -797,10 +797,10 @@ interface IShadowOptions { */ offsetY: number; } -export interface Shadow extends IShadowOptions {} +export interface Shadow extends IShadowOptions { } export class Shadow { constructor(options?: IShadowOptions); - initialize(options?: IShadowOptions|string): Shadow; + initialize(options?: IShadowOptions | string): Shadow; /** * Returns object representation of a shadow */ @@ -874,7 +874,7 @@ interface IStaticCanvasOptions { * Background color of canvas instance. * Should be set via setBackgroundColor */ - backgroundColor?: string|Pattern; + backgroundColor?: string | Pattern; /** * Background image of canvas instance. * Should be set via setBackgroundImage @@ -902,7 +902,7 @@ interface IStaticCanvasOptions { * Overlay color of canvas instance. * Should be set via setOverlayColor */ - overlayColor?: string|Pattern; + overlayColor?: string | Pattern; /** * Overlay image of canvas instance. * Should be set via setOverlayImage @@ -922,14 +922,14 @@ interface IStaticCanvasOptions { */ stateful?: boolean; } -export interface StaticCanvas extends IObservable, IStaticCanvasOptions, ICollection, ICanvasAnimation {} +export interface StaticCanvas extends IObservable, IStaticCanvasOptions, ICollection, ICanvasAnimation { } export class StaticCanvas { /** * Constructor * @param element element to initialize instance on * @param [options] Options object */ - constructor(element: HTMLCanvasElement|string, options?: ICanvasOptions); + constructor(element: HTMLCanvasElement | string, options?: ICanvasOptions); /** * Calculates canvas element offset relative to the document @@ -943,7 +943,7 @@ export class StaticCanvas { * @param callback callback to invoke when image is loaded and set as an overlay * @param [options] Optional options to set for the {@link fabric.Image|overlay image}. */ - setOverlayImage(image: Image|string, callback: (img: HTMLImageElement) => void, options?: IImageOptions): this; + setOverlayImage(image: Image | string, callback: (img: HTMLImageElement) => void, options?: IImageOptions): this; /** * Sets {@link fabric.StaticCanvas#backgroundImage|background image} for this canvas @@ -951,21 +951,21 @@ export class StaticCanvas { * @param callback Callback to invoke when image is loaded and set as background * @param [options] Optional options to set for the {@link fabric.Image|background image}. */ - setBackgroundImage(image: Image|string, callback?: (img: HTMLImageElement) => void, options?: IImageOptions): this; + setBackgroundImage(image: Image | string, callback?: (img: HTMLImageElement) => void, options?: IImageOptions): this; /** * Sets {@link fabric.StaticCanvas#overlayColor|background color} for this canvas * @param overlayColor Color or pattern to set background color to * @param callback Callback to invoke when background color is set */ - setOverlayColor(overlayColor: string|Pattern, callback: (pattern: Pattern | undefined) => void): this; + setOverlayColor(overlayColor: string | Pattern, callback: (pattern: Pattern | undefined) => void): this; /** * Sets {@link fabric.StaticCanvas#backgroundColor|background color} for this canvas * @param backgroundColor Color or pattern to set background color to * @param callback Callback to invoke when background color is set */ - setBackgroundColor(backgroundColor: string|Pattern, callback: (pattern: Pattern | undefined) => void): StaticCanvas; + setBackgroundColor(backgroundColor: string | Pattern, callback: (pattern: Pattern | undefined) => void): StaticCanvas; /** * Returns canvas width (in px) @@ -982,14 +982,14 @@ export class StaticCanvas { * @param value Value to set width to * @param [options] Options object */ - setWidth(value: number|string, options?: ICanvasDimensionsOptions): this; + setWidth(value: number | string, options?: ICanvasDimensionsOptions): this; /** * Sets height of this canvas instance * @param value Value to set height to * @param [options] Options object */ - setHeight(value: number|string, options?: ICanvasDimensionsOptions): this; + setHeight(value: number | string, options?: ICanvasDimensionsOptions): this; /** * Sets dimensions (width, height) of this canvas instance. when options.cssOnly flag active you should also supply the unit of measure (px/%/em) @@ -1213,7 +1213,7 @@ export class StaticCanvas { * are initialized * @param [reviver] Method for further parsing of JSON elements, called after each fabric object created. */ - loadFromJSON(json: string|any, callback: () => void, reviver?: Function): this; + loadFromJSON(json: string | any, callback: () => void, reviver?: Function): this; /** * Clones canvas instance * @param [callback] Receives cloned instance as a first argument @@ -1364,8 +1364,8 @@ interface ICanvasOptions extends IStaticCanvasOptions { */ isDrawingMode?: boolean; } -export interface Canvas extends StaticCanvas {} -export interface Canvas extends ICanvasOptions {} +export interface Canvas extends StaticCanvas { } +export interface Canvas extends ICanvasOptions { } export class Canvas { /** * Constructor @@ -1509,7 +1509,7 @@ interface ICircleOptions extends IObjectOptions { */ endAngle?: number; } -export interface Circle extends Object, ICircleOptions {} +export interface Circle extends Object, ICircleOptions { } export class Circle { constructor(options?: ICircleOptions); @@ -1571,7 +1571,7 @@ interface IEllipseOptions extends IObjectOptions { */ ry?: number; } -export interface Ellipse extends Object, IEllipseOptions {} +export interface Ellipse extends Object, IEllipseOptions { } export class Ellipse { constructor(options?: IEllipseOptions); @@ -1621,7 +1621,7 @@ export class Ellipse { static fromObject(object: any): Ellipse; } -export interface Group extends Object, ICollection {} +export interface Group extends Object, ICollection { } export class Group { /** * Constructor @@ -1713,7 +1713,7 @@ export class Group { /////////////////////////////////////////////////////////////////////////////// // ActiveSelection ////////////////////////////////////////////////////////////////////////////// -export interface ActiveSelection extends Object, ICollection {} +export interface ActiveSelection extends Object, ICollection { } export class ActiveSelection { /** * Constructor @@ -1781,7 +1781,7 @@ interface IImageOptions extends IObjectOptions { */ filters?: IBaseFilter[]; } -interface Image extends Object, IImageOptions {} +interface Image extends Object, IImageOptions { } export class Image { /** * Constructor @@ -1790,7 +1790,7 @@ export class Image { */ constructor(element: HTMLImageElement, objObjects: IObjectOptions); - initialize(element?: string|HTMLImageElement, options?: IImageOptions): void; + initialize(element?: string | HTMLImageElement, options?: IImageOptions): void; /** * Applies filters assigned to this image (from "filters" array) * @param callback Callback is invoked when all filters have been applied and new image is generated @@ -1907,7 +1907,7 @@ interface ILineOptions extends IObjectOptions { */ y2: number; } -export interface Line extends Object, ILineOptions {} +export interface Line extends Object, ILineOptions { } export class Line { /** * Constructor @@ -2131,7 +2131,7 @@ interface IObjectOptions { /** * Shadow object representing shadow of this shape */ - shadow?: Shadow|string; + shadow?: Shadow | string; /** * Opacity of object's controlling borders when object is active and moving @@ -2250,7 +2250,7 @@ interface IObjectOptions { */ data?: any; } -export interface Object extends IObservable, IObjectOptions, IObjectAnimation {} +export interface Object extends IObservable, IObjectOptions, IObjectAnimation { } export class Object { getCurrentWidth(): number; getCurrentHeight(): number; @@ -2656,7 +2656,8 @@ export class Object { mt?: boolean; tl?: boolean; tr?: boolean; - mtr?: boolean; }): this; + mtr?: boolean; + }): this; // functions from geometry mixin // ------------------------------------------------------------------------------------------------------------------------------- @@ -2731,14 +2732,14 @@ interface IPathOptions extends IObjectOptions { */ minY?: number; } -export interface Path extends Object, IPathOptions {} +export interface Path extends Object, IPathOptions { } export class Path { /** * Constructor * @param path Path data (sequence of coordinates and corresponding "command" tokens) * @param [options] Options object */ - constructor(path?: string|any[], options?: IPathOptions); + constructor(path?: string | any[], options?: IPathOptions); pathOffset: Point; @@ -2871,7 +2872,7 @@ interface IPolygonOptions extends IObjectOptions { */ minY?: number; } -export interface Polygon extends IPolygonOptions {} +export interface Polygon extends IPolygonOptions { } export class Polygon extends Object { /** * Constructor @@ -2933,7 +2934,7 @@ interface IPolylineOptions extends IObjectOptions { */ minY?: number; } -export interface Polyline extends IPolylineOptions {} +export interface Polyline extends IPolylineOptions { } export class Polyline extends Object { /** * Constructor @@ -2993,7 +2994,7 @@ interface IRectOptions extends IObjectOptions { ry?: number; } -export interface Rect extends IRectOptions {} +export interface Rect extends IRectOptions { } export class Rect extends Object { /** * Constructor @@ -3044,7 +3045,7 @@ interface ITextOptions extends IObjectOptions { /** * Font weight (e.g. bold, normal, 400, 600, 800) */ - fontWeight?: number|string; + fontWeight?: number | string; /** * Font family */ @@ -3074,7 +3075,7 @@ interface ITextOptions extends IObjectOptions { * Shadow object representing shadow of this shape. * Backwards incompatibility note?: This property was named "textShadow" (String) until v1.2.11 */ - shadow?: Shadow|string; + shadow?: Shadow | string; /** * Background color of text lines */ @@ -3084,7 +3085,7 @@ interface ITextOptions extends IObjectOptions { useNative?: boolean; text?: string; } -export interface Text extends ITextOptions {} +export interface Text extends ITextOptions { } export class Text extends Object { /** * Constructor @@ -3127,12 +3128,12 @@ export class Text extends Object { /** * Retrieves object's fontWeight */ - getFontWeight(): number|string; + getFontWeight(): number | string; /** * Sets object's fontWeight * @param fontWeight Font weight */ - setFontWeight(fontWeight: string|number): Text; + setFontWeight(fontWeight: string | number): Text; /** * Retrieves object's fontFamily */ @@ -3281,7 +3282,7 @@ interface IITextOptions extends IObjectOptions, ITextOptions { */ caching?: boolean; } -export interface IText extends Text, IITextOptions {} +export interface IText extends Text, IITextOptions { } export class IText extends Object { /** * Constructor @@ -3566,14 +3567,14 @@ interface IAllFilters { * Constructor * @param [options] Options object */ - new (options?: any): IBaseFilter; + new(options?: any): IBaseFilter; }; Blend: { /** * Constructor * @param [options] Options object */ - new (options?: { color?: string; mode?: string; alpha?: number; image?: Image }): IBlendFilter; + new(options?: { color?: string; mode?: string; alpha?: number; image?: Image }): IBlendFilter; /** * Returns filter instance from an object representation * @param object Object to create an instance from @@ -3581,7 +3582,7 @@ interface IAllFilters { fromObject(object: any): IBlendFilter }; Brightness: { - new (options?: { + new(options?: { /** * Value to brighten the image up (0..255) * @default 0 @@ -3595,7 +3596,7 @@ interface IAllFilters { fromObject(object: any): IBrightnessFilter }; Convolute: { - new (options?: { + new(options?: { opaque?: boolean, /** Filter matrix */ matrix?: number[], @@ -3607,7 +3608,7 @@ interface IAllFilters { fromObject(object: any): IConvoluteFilter }; GradientTransparency: { - new (options?: { + new(options?: { /** @default 100 */ threshold?: number; }): IGradientTransparencyFilter; @@ -3618,7 +3619,7 @@ interface IAllFilters { fromObject(object: any): IGradientTransparencyFilter }; Grayscale: { - new (options?: any): IGrayscaleFilter; + new(options?: any): IGrayscaleFilter; /** * Returns filter instance from an object representation * @param object Object to create an instance from @@ -3630,7 +3631,7 @@ interface IAllFilters { * Constructor * @param [options] Options object */ - new (options?: any): IInvertFilter; + new(options?: any): IInvertFilter; /** * Returns filter instance from an object representation * @param object Object to create an instance from @@ -3638,7 +3639,7 @@ interface IAllFilters { fromObject(object: any): IInvertFilter }; Mask: { - new (options?: { + new(options?: { /** Mask image object */ mask?: Image, /** @@ -3654,7 +3655,7 @@ interface IAllFilters { fromObject(object: any): IMaskFilter }; Multiply: { - new (options?: { + new(options?: { /** * Color to multiply the image pixels with * @default #000000 @@ -3668,7 +3669,7 @@ interface IAllFilters { fromObject(object: any): IMultiplyFilter }; Noise: { - new (options?: { + new(options?: { /** @default 0 */ noise: number, }): INoiseFilter; @@ -3679,7 +3680,7 @@ interface IAllFilters { fromObject(object: any): INoiseFilter }; Pixelate: { - new (options?: { + new(options?: { /** * Blocksize for pixelate * @default 4 @@ -3693,7 +3694,7 @@ interface IAllFilters { fromObject(object: any): IPixelateFilter }; RemoveWhite: { - new (options?: { + new(options?: { /** @default 30 */ threshold?: number, /** @default 20 */ @@ -3706,7 +3707,7 @@ interface IAllFilters { fromObject(object: any): IRemoveWhiteFilter }; Resize: { - new (options?: any): IResizeFilter; + new(options?: any): IResizeFilter; /** * Returns filter instance from an object representation * @param object Object to create an instance from @@ -3714,7 +3715,7 @@ interface IAllFilters { fromObject(object: any): IResizeFilter }; Sepia2: { - new (options?: any): ISepia2Filter; + new(options?: any): ISepia2Filter; /** * Returns filter instance from an object representation * @param object Object to create an instance from @@ -3722,7 +3723,7 @@ interface IAllFilters { fromObject(object: any): ISepia2Filter }; Sepia: { - new (options?: any): ISepiaFilter; + new(options?: any): ISepiaFilter; /** * Returns filter instance from an object representation * @param object Object to create an instance from @@ -3730,7 +3731,7 @@ interface IAllFilters { fromObject(object: any): ISepiaFilter }; Tint: { - new (options?: { + new(options?: { /** * Color to tint the image with * @default #000000 @@ -3905,7 +3906,7 @@ export class BaseBrush { * Backwards incompatibility note: This property replaces "shadowColor" (String), "shadowOffsetX" (Number), * "shadowOffsetY" (Number) and "shadowBlur" (Number) since v1.2.12 */ - shadow: Shadow|string; + shadow: Shadow | string; /** * Line endings style of a brush (one of "butt", "round", "square") */ @@ -3925,7 +3926,7 @@ export class BaseBrush { * Sets shadow of an object * @param [options] Options object or string (e.g. "2px 2px 10px rgba(0,0,0,0.2)") */ - setShadow(options: string|any): BaseBrush; + setShadow(options: string | any): BaseBrush; } export class CircleBrush extends BaseBrush { @@ -4133,7 +4134,7 @@ interface IUtilDomMisc { /** * Takes id and returns an element with that id (if one exists in a document) */ - getById(id: string|HTMLElement): HTMLElement; + getById(id: string | HTMLElement): HTMLElement; /** * Converts an array-like object (e.g. arguments or NodeList) to an array */ @@ -4157,7 +4158,7 @@ interface IUtilDomMisc { * @param wrapper Element to wrap with * @param [attributes] Attributes to set on a wrapper */ - wrapElement(element: HTMLElement, wrapper: HTMLElement|string, attributes?: any): HTMLElement; + wrapElement(element: HTMLElement, wrapper: HTMLElement | string, attributes?: any): HTMLElement; /** * Returns element scroll offsets * @param element Element to operate on @@ -4353,7 +4354,7 @@ interface IUtilMisc { * Returns converted pixels or original value not converted. * @param value number to operate on */ - parseUnit(value: number|string, fontSize?: number): number|string; + parseUnit(value: number | string, fontSize?: number): number | string; /** * Function which always returns `false`. @@ -4480,3 +4481,58 @@ interface IUtil extends IUtilAnimation, IUtilArc, IObservable, IUtilDomEv object: IUtilObject; string: IUtilString; } + +export interface Resources { + [key: string]: HTMLCanvasElement +} +export interface FilterBackend { + resources: Resources; + + applyFilters(filters: IBaseFilter[], sourceElement: HTMLImageElement | HTMLCanvasElement, sourceWidth: number, sourceHeight: number, targetCanvas: HTMLCanvasElement,cacheKey?: string): any; + + evictCachesForKey(cacheKey: string): void; + + dispose(): void; + + clearWebGLCaches(): void; + +} +export let filterBackend: FilterBackend; +export interface Canvas2dFilterBackend extends FilterBackend { } +export class Canvas2dFilterBackend { + constructor(); +} + +export interface GPUInfo{ + renderer:string; + vendor:string; +} + +export interface WebglFilterBackendOptions { + tileSize: number; +} +export interface WebglFilterBackend extends FilterBackend, WebglFilterBackendOptions { + setupGLContext(width: number, height: number): void; + + chooseFastestCopyGLTo2DMethod(width: number, height: number): void; + + createWebGLCanvas(width: number, height: number): void; + + applyFiltersDebug(filters: IBaseFilter[], sourceElement: HTMLImageElement | HTMLCanvasElement, sourceWidth: number, sourceHeight: number, targetCanvas: HTMLCanvasElement, cacheKey?: string): any; + + glErrorToString(context: any, errorCode: any): string; + + createTexture(gl: WebGLRenderingContext, width: number, height: number, textureImageSource?: HTMLImageElement | HTMLCanvasElement): WebGLTexture; + + getCachedTexture(uniqueId: string, textureImageSource: HTMLImageElement | HTMLCanvasElement): WebGLTexture; + + copyGLTo2D(gl: WebGLRenderingContext, pipelineState: any): void; + + captureGPUInfo(): GPUInfo; + +} + +export class WebglFilterBackend { + constructor(options?: WebglFilterBackendOptions); +} + diff --git a/types/fabric/index.d.ts b/types/fabric/index.d.ts index 38277c5708..76ed1ab054 100644 --- a/types/fabric/index.d.ts +++ b/types/fabric/index.d.ts @@ -5,6 +5,7 @@ // Michael Randolph // Tiger Oakes // Brian Martinson +// Rogerio Teixeira // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 export import fabric = require("./fabric-impl"); diff --git a/types/fabric/test/index.ts b/types/fabric/test/index.ts index dfdaafce06..1060525a00 100644 --- a/types/fabric/test/index.ts +++ b/types/fabric/test/index.ts @@ -1061,3 +1061,9 @@ function sample10() { canvas.add(objB); const objArray = canvas.getActiveObjects(); } + +function sample11() { + const canvas2dFilterBackend = new fabric.Canvas2dFilterBackend(); + const webglFilterBackend = new fabric.WebglFilterBackend(); + fabric.filterBackend = new fabric.Canvas2dFilterBackend(); +} From 23ff949115428b0e2b2c6e1f4c4a7c884d491341 Mon Sep 17 00:00:00 2001 From: ufolux Date: Wed, 25 Apr 2018 06:58:52 +0800 Subject: [PATCH 0810/2153] export NativeSyntheticEvent (#25190) Due to WebView onMessage function need a event param --- types/react-native/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index e42f1f2055..db4b5c33ce 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -347,7 +347,7 @@ type TaskProvider = () => Task; type NodeHandle = number; // Similar to React.SyntheticEvent except for nativeEvent -interface NativeSyntheticEvent { +export interface NativeSyntheticEvent { bubbles: boolean; cancelable: boolean; currentTarget: NodeHandle; From 53b8794401092be07f9e1e9400d67543d103bf09 Mon Sep 17 00:00:00 2001 From: ufolux Date: Wed, 25 Apr 2018 06:59:13 +0800 Subject: [PATCH 0811/2153] Update index.d.ts (#25194) --- types/react-native/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index db4b5c33ce..4fc6592c80 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -3522,7 +3522,7 @@ export interface ViewabilityConfig { * @see https://facebook.github.io/react-native/docs/flatlist.html#props */ -interface ListRenderItemInfo { +export interface ListRenderItemInfo { item: ItemT; index: number; @@ -3534,7 +3534,7 @@ interface ListRenderItemInfo { }; } -type ListRenderItem = (info: ListRenderItemInfo) => React.ReactElement | null; +export type ListRenderItem = (info: ListRenderItemInfo) => React.ReactElement | null; export interface FlatListProperties extends VirtualizedListProperties { /** From dac6c4fc10b7926e9892a3091d4fbc534d4962ae Mon Sep 17 00:00:00 2001 From: Kevin Perrine Date: Tue, 24 Apr 2018 17:59:33 -0500 Subject: [PATCH 0812/2153] [react-sortable-tree] Added props for custom themes (#25179) * initial addition of theme prop to react-sortable-tree Signed-off-by: Kevin * fix TreeRenderer and it's Props. Signed-off-by: Kevin * bump version, add theme prop to test Signed-off-by: Kevin * added "by" line Signed-off-by: Kevin --- types/react-sortable-tree/index.d.ts | 82 ++++++++++++++++--- .../react-sortable-tree-tests.tsx | 6 +- 2 files changed, 75 insertions(+), 13 deletions(-) diff --git a/types/react-sortable-tree/index.d.ts b/types/react-sortable-tree/index.d.ts index 0a0efc7f31..db90ce90f9 100644 --- a/types/react-sortable-tree/index.d.ts +++ b/types/react-sortable-tree/index.d.ts @@ -1,13 +1,19 @@ -// Type definitions for react-sortable-tree 0.1 +// Type definitions for react-sortable-tree 0.2 // Project: https://fritz-c.github.io/react-sortable-tree // Definitions by: Wouter Hardeman // Jovica Zoric +// Kevin Perrine // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 import * as React from 'react'; import { ListProps, Index } from 'react-virtualized'; -import { ConnectDragSource, ConnectDragPreview, DragSourceMonitor } from 'react-dnd'; +import { + ConnectDragSource, + ConnectDragPreview, + ConnectDropTarget, + DragSourceMonitor +} from 'react-dnd'; export * from './utils/tree-data-utils'; export * from './utils/default-handlers'; @@ -70,44 +76,93 @@ export interface NodeRendererProps { canDrag: boolean; scaffoldBlockPxWidth: number; toggleChildrenVisibility?(data: NodeData): void; - buttons?: any[]; + buttons?: JSX.Element[]; className?: string; - style?: {[index: string]: any}; + style?: { [index: string]: any }; + title?: (data: NodeData) => JSX.Element | JSX.Element; + subtitle?: (data: NodeData) => JSX.Element | JSX.Element; + icons?: JSX.Element[]; + lowerSiblingCounts: number[]; + swapDepth?: number; + swapFrom?: number; + swapLength?: number; + listIndex: number; + treeId: string; connectDragPreview: ConnectDragPreview; connectDragSource: ConnectDragSource; - parentNode?: {[index: string]: any}; + parentNode?: { [index: string]: any }; startDrag: any; endDrag: any; isDragging: boolean; didDrop: boolean; - draggedNode?: {[index: string]: any}; + draggedNode?: { [index: string]: any }; isOver: boolean; canDrop?: boolean; } -export type PlaceholderRenderer = React.ComponentClass; +export type PlaceholderRenderer = React.ComponentClass< + PlaceholderRendererProps +>; export interface PlaceholderRendererProps { isOver: boolean; canDrop: boolean; - draggedNode: {[index: string]: any}; + draggedNode: { [index: string]: any }; } type NumberArrayOrStringArray = string[] | number[]; +export type TreeRenderer = React.ComponentClass; + +export interface TreeRendererProps { + treeIndex: number; + treeId: string; + swapFrom?: number; + swapDepth?: number; + swapLength?: number; + scaffoldBlockPxWidth: number; + lowerSiblingCounts: number[]; + + listIndex: number; + children: JSX.Element[]; + + // Drop target + connectDropTarget: ConnectDropTarget; + isOver: boolean; + canDrop?: boolean; + draggedNode?: { [index: string]: any }; + + // used in dndManager + getPrevRow: any; // @TODO what is this method? + node: TreeItem; + path: NumberArrayOrStringArray; +} + +export interface ThemeProps { + style?: { [index: string]: any }; + innerStyle?: { [index: string]: any }; + reactVirtualizedListProps?: ListProps; + scaffoldBlockPxWidth?: number; + slideRegionSize?: number; + rowHeight?: ((info: Index) => number) | number; + treeNodeRenderer?: TreeRenderer; + nodeContentRenderer?: NodeRenderer; + placeholderRenderer?: PlaceholderRenderer; +} + export interface ReactSortableTreeProps { treeData: TreeItem[]; onChange(treeData: TreeItem[]): void; - style?: {[index: string]: any; }; + style?: { [index: string]: any }; className?: string; - innerStyle?: {[index: string]: any; }; + innerStyle?: { [index: string]: any }; maxDepth?: number; searchMethod?(data: SearchData): boolean; searchQuery?: string | any; searchFocusOffset?: number; searchFinishCallback?(matches: NodeData[]): void; - generateNodeProps?(data: ExtendedNodeData): {[index: string]: any}; + generateNodeProps?(data: ExtendedNodeData): { [index: string]: any }; getNodeKey?(data: TreeNode & TreeIndex): string | number; onMoveNode?(data: NodeData & FullTree): void; onVisibilityToggle?(data: OnVisibilityToggleData): void; @@ -121,10 +176,13 @@ export interface ReactSortableTreeProps { nodeContentRenderer?: NodeRenderer; dndType?: string; placeholderRenderer?: PlaceholderRenderer; + theme?: ThemeProps; } declare const SortableTree: React.ComponentClass; -export const SortableTreeWithoutDndContext: React.ComponentClass; +export const SortableTreeWithoutDndContext: React.ComponentClass< + ReactSortableTreeProps +>; export default SortableTree; diff --git a/types/react-sortable-tree/react-sortable-tree-tests.tsx b/types/react-sortable-tree/react-sortable-tree-tests.tsx index d67e6ad123..f29e814cc9 100644 --- a/types/react-sortable-tree/react-sortable-tree-tests.tsx +++ b/types/react-sortable-tree/react-sortable-tree-tests.tsx @@ -12,7 +12,8 @@ import SortableTree, FullTree, OnVisibilityToggleData, PreviousAndNextLocation, - PlaceholderRendererProps + PlaceholderRendererProps, + ThemeProps } from "react-sortable-tree"; import { ListProps, ListRowRenderer } from "react-virtualized"; @@ -37,6 +38,8 @@ class Test extends React.Component { width: 100, height: 44, rowCount: 3, rowHeight: 44, rowRenderer: "test" as any as ListRowRenderer }; const nodeRenderer: NodeRenderer = "test" as any as NodeRenderer; + const theme: ThemeProps = { nodeContentRenderer: nodeRenderer } as any as ThemeProps; + return (
Date: Tue, 24 Apr 2018 19:00:18 -0400 Subject: [PATCH 0813/2153] [eslint] CLIEngine ignorePattern can be a string or string[] (#25197) --- types/eslint/eslint-tests.ts | 1 + types/eslint/index.d.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/types/eslint/eslint-tests.ts b/types/eslint/eslint-tests.ts index 376cdf0a92..a281991918 100644 --- a/types/eslint/eslint-tests.ts +++ b/types/eslint/eslint-tests.ts @@ -456,6 +456,7 @@ cli = new CLIEngine({ globals: ['foo'] }); cli = new CLIEngine({ ignore: true }); cli = new CLIEngine({ ignorePath: 'foo' }); cli = new CLIEngine({ ignorePattern: 'foo' }); +cli = new CLIEngine({ ignorePattern: ['foo', 'bar'] }); cli = new CLIEngine({ useEslintrc: false }); cli = new CLIEngine({ parserOptions: {} }); cli = new CLIEngine({ plugins: ['foo'] }); diff --git a/types/eslint/index.d.ts b/types/eslint/index.d.ts index 9e0e68af0b..76f04617d8 100644 --- a/types/eslint/index.d.ts +++ b/types/eslint/index.d.ts @@ -2,6 +2,7 @@ // Project: https://eslint.org // Definitions by: Pierre-Marie Dartus // Jed Fox +// Saad Quadri // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -491,7 +492,7 @@ export namespace CLIEngine { globals?: string[]; ignore?: boolean; ignorePath?: string; - ignorePattern?: string; + ignorePattern?: string | string[]; useEslintrc?: boolean; parser?: string; parserOptions?: Linter.ParserOptions; From 2f1a4cda5ce0365fc3272f89f66bacab992c5a4f Mon Sep 17 00:00:00 2001 From: Christophe Hurpeau Date: Wed, 25 Apr 2018 01:00:59 +0200 Subject: [PATCH 0814/2153] webpack: Add Configuration.Resolve.cacheWithContext (#25209) https://webpack.js.org/configuration/resolve/#resolve-cachewithcontext --- types/webpack/index.d.ts | 9 +++++++++ types/webpack/v3/index.d.ts | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index 8c93019f24..e422c58b32 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -11,6 +11,7 @@ // Spencer Elliott // Jason Cheatham // Dennis George +// Christophe Hurpeau // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -320,6 +321,14 @@ declare namespace webpack { * Defaults to `true` */ symlinks?: boolean; + + /** + * If unsafe cache is enabled, includes request.context in the cache key. + * This option is taken into account by the enhanced-resolve module. + * Since webpack 3.1.0 context in resolve caching is ignored when resolve or resolveLoader plugins are provided. + * This addresses a performance regression. + */ + cacheWithContext?: boolean; } interface ResolveLoader extends Resolve { diff --git a/types/webpack/v3/index.d.ts b/types/webpack/v3/index.d.ts index 7f943d4151..262b52a286 100644 --- a/types/webpack/v3/index.d.ts +++ b/types/webpack/v3/index.d.ts @@ -10,6 +10,7 @@ // Alan Agius // Spencer Elliott // Jason Cheatham +// Christophe Hurpeau // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -318,6 +319,14 @@ declare namespace webpack { * Defaults to `true` */ symlinks?: boolean; + + /** + * If unsafe cache is enabled, includes request.context in the cache key. + * This option is taken into account by the enhanced-resolve module. + * Since webpack 3.1.0 context in resolve caching is ignored when resolve or resolveLoader plugins are provided. + * This addresses a performance regression. + */ + cacheWithContext?: boolean; } interface ResolveLoader extends Resolve { From 3d6c3d223baa56d7983b6a0ea7673cd1f3ac1a91 Mon Sep 17 00:00:00 2001 From: Andrei Markeev Date: Wed, 25 Apr 2018 02:02:21 +0300 Subject: [PATCH 0815/2153] meteor: strong typings for mongo collections selectors and modifiers (#25210) * meteor: strong typings for mongo collections selectors and modifiers * meteor: updated dependent packages * bugfix in $push->$each block, added more tests --- types/angular-meteor/index.d.ts | 4 +- types/meteor-jboulhous-dev/index.d.ts | 1 + types/meteor-persistent-session/index.d.ts | 1 + .../meteor-prime8consulting-oauth2/index.d.ts | 1 + types/meteor-publish-composite/index.d.ts | 1 + types/meteor-roles/index.d.ts | 1 + types/meteor/index.d.ts | 10 +- types/meteor/meteor-tests.ts | 54 ++++ types/meteor/mongo.d.ts | 264 ++++++++++++++++-- 9 files changed, 313 insertions(+), 24 deletions(-) diff --git a/types/angular-meteor/index.d.ts b/types/angular-meteor/index.d.ts index c842dd2cf0..11d782ee47 100644 --- a/types/angular-meteor/index.d.ts +++ b/types/angular-meteor/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/Urigo/angular-meteor // Definitions by: Peter Grman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// @@ -101,7 +101,7 @@ declare module 'angular' { * @param [autoClientSave=true] - By default, changes in the Angular object will automatically update the Meteor object. * - However if set to false, changes in the client won't be automatically propagated back to the Meteor object. */ - object(collection: Mongo.Collection, selector: Mongo.Selector|Mongo.ObjectID|string, autoClientSave?: boolean): AngularMeteorObject; + object(collection: Mongo.Collection, selector: Mongo.Selector|Mongo.ObjectID|string, autoClientSave?: boolean): AngularMeteorObject; /** * A service which is a wrapper for Meteor.subscribe. It subscribes to a Meteor.publish method in the client and returns a AngularJS promise when ready. diff --git a/types/meteor-jboulhous-dev/index.d.ts b/types/meteor-jboulhous-dev/index.d.ts index 6b529740b5..28d7ec19cd 100644 --- a/types/meteor-jboulhous-dev/index.d.ts +++ b/types/meteor-jboulhous-dev/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/jboulhous/dev // Definitions by: Robbie Van Gorkom // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 /// diff --git a/types/meteor-persistent-session/index.d.ts b/types/meteor-persistent-session/index.d.ts index f122c412dd..5efaed6dfa 100644 --- a/types/meteor-persistent-session/index.d.ts +++ b/types/meteor-persistent-session/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/okgrow/meteor-persistent-session // Definitions by: Robbie Van Gorkom // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 /// diff --git a/types/meteor-prime8consulting-oauth2/index.d.ts b/types/meteor-prime8consulting-oauth2/index.d.ts index ca92d7445d..f9f08efca3 100644 --- a/types/meteor-prime8consulting-oauth2/index.d.ts +++ b/types/meteor-prime8consulting-oauth2/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/prime-8-consulting/meteor-oauth2/ // Definitions by: Robbie Van Gorkom // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 /// diff --git a/types/meteor-publish-composite/index.d.ts b/types/meteor-publish-composite/index.d.ts index a5f6205913..428175f6ad 100644 --- a/types/meteor-publish-composite/index.d.ts +++ b/types/meteor-publish-composite/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/englue/meteor-publish-composite // Definitions by: Robert Van Gorkom // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 /// diff --git a/types/meteor-roles/index.d.ts b/types/meteor-roles/index.d.ts index ed91f96ab5..348f6eef9c 100644 --- a/types/meteor-roles/index.d.ts +++ b/types/meteor-roles/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Robbie Van Gorkom // Matthew Zartman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 /// diff --git a/types/meteor/index.d.ts b/types/meteor/index.d.ts index 1d95ba429d..fad7da05bf 100644 --- a/types/meteor/index.d.ts +++ b/types/meteor/index.d.ts @@ -1,7 +1,15 @@ // Type definitions for Meteor 1.4 // Project: http://www.meteor.com/ -// Definitions by: Alex Borodach , Dave Allen , Olivier Refalo , Daniel Neveux , Birk Skyum , Arda TANRIKULU , Stefan Holzapfel +// Definitions by: Alex Borodach +// Dave Allen +// Olivier Refalo +// Daniel Neveux +// Birk Skyum +// Arda TANRIKULU +// Stefan Holzapfel +// Andrey Markeev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 /// /// diff --git a/types/meteor/meteor-tests.ts b/types/meteor/meteor-tests.ts index 0e457b9fc5..f9cf039c84 100644 --- a/types/meteor/meteor-tests.ts +++ b/types/meteor/meteor-tests.ts @@ -352,6 +352,60 @@ let cursor: Mongo.Cursor; // After five seconds, stop keeping the count. setTimeout(function () { handle.stop(); }, 5000); +// Additional testing for Mongo.Collection +enum InlineObjectType { + Invalid, + Link, + Image, + Video, + Person +} +interface CommentsDAO { + text: string; + authorId: string; + inlineLinks: { objectType: InlineObjectType, objectId: string, objectUrl: string }[], + tags: string[], + viewNumber: number, + private: boolean +} + +var Comments = new Mongo.Collection("comments"); + +Comments.find({ text: { $regex: /test/ } }); +Comments.find({ viewNumber: { $gt: 100 } }); +Comments.find({ viewNumber: { $not: { $lt: 100, $gt: 1000 } } }); +Comments.find({ tags: { $in: [ "tag-1", "tag-2", "tag-3" ] } }); +Comments.find({ $or: [ { text: "hello" }, { text: "world" } ] }); +Comments.find({ $or: [ + { text: "hello" }, + { text: "world", viewNumber: { $gt: 0 } } +], authorId: "test-author-id" }); +Comments.find({ $and: [ + { $or: [{ authorId: "author-id-1" }, { authorId: "author-id-2" }] }, + { $or: [{ tags: "tag-1" }, { tags: "tag-2" }] } +]}); + +Comments.find({ inlineLinks: { $exists: true, $type: "array" } }); +Comments.find({ inlineLinks: { $elemMatch: { + objectType: InlineObjectType.Image, + objectUrl: { $regex: "https://(www\.?)youtube\.com" } +} } }); +Comments.find({ "inlineLinks.objectType": InlineObjectType.Person }); +Comments.find({ tags: "tag-1" }); +Comments.find({ tags: { $all: ["tag-1", "tag2"] } }); + +Comments.update({ viewNumber: { $exists: false } }, { $set: { viewNumber: 0 } }); +Comments.update({ authorId: "author-id-1" }, { $push: { tags: "test-tag-1" } }); +Comments.update({ authorId: "author-id-1" }, { $push: { tags: { $each: [ "test-tag-2", "test-tag-3" ] } } }); + +Comments.update({ authorId: "author-id-1" }, { $push: { inlineLinks: { + objectId: "test-object-id", + objectType: InlineObjectType.Link, + objectUrl: "https://test.url/" +} } }); +Comments.update({ viewNumber: { $exists: false } }, { $set: { viewNumber: 0 } }); +Comments.update({ private: true }, { $unset: { tags: true } }); + /** * From Sessions, Session.set section */ diff --git a/types/meteor/mongo.d.ts b/types/meteor/mongo.d.ts index 28e1868840..248f5a22af 100644 --- a/types/meteor/mongo.d.ts +++ b/types/meteor/mongo.d.ts @@ -1,9 +1,121 @@ declare module Mongo { - interface Selector { - [key: string]: any; + + type BsonType = 1 | "double" | + 2 | "string" | + 3 | "object" | + 4 | "array" | + 5 | "binData" | + 6 | "undefined" | + 7 | "objectId" | + 8 | "bool" | + 9 | "date" | + 10 | "null" | + 11 | "regex" | + 12 | "dbPointer" | + 13 | "javascript" | + 14 | "symbol" | + 15 | "javascriptWithScope" | + 16 | "int" | + 17 | "timestamp" | + 18 | "long" | + 19 | "decimal" | + -1 | "minKey" | + 127 | "maxKey" | "number" + + type FieldExpression = { + $eq?: T, + $gt?: T, + $gte?: T, + $lt?: T, + $lte?: T, + $in?: T[], + $nin?: T[], + $ne?: T, + $exists?: boolean, + $type?: BsonType[] | BsonType, + $not?: FieldExpression, + $expr?: FieldExpression, + $jsonSchema?: any, + $mod?: number[], + $regex?: RegExp | string, + $options?: string, + $text?: { $search: string, $language?: string, $caseSensitive?: boolean, $diacriticSensitive?: boolean }, + $where?: string | Function, + $geoIntersects?: any, + $geoWithin?: any, + $near?: any, + $nearSphere?: any, + $all?: T[], + $elemMatch?: T extends {} ? Query : FieldExpression, + $size?: number, + $bitsAllClear?: any, + $bitsAllSet?: any, + $bitsAnyClear?: any, + $bitsAnySet?: any, + $comment?: string } - interface Selector extends Object { } - interface Modifier { } + + type Flatten = T extends any[] ? T[0] : T + + type Query = { + [P in keyof T]?: Flatten | RegExp | FieldExpression> + } & { + $or?: Query[], + $and?: Query[], + $nor?: Query[] + } & Dictionary + + type QueryWithModifiers = { + $query: Query, + $comment?: string, + $explain?: any, + $hint?: any, + $maxScan?: any, + $max?: any, + $maxTimeMS?: any, + $min?: any, + $orderby?: any, + $returnKey?: any, + $showDiskLoc?: any, + $natural?: any + } + + type Selector = Query | QueryWithModifiers + + type Dictionary = { [key: string]: T } + type PartialMapTo = Partial> + type OnlyArrays = T extends any[] ? T : never; + type OnlyElementsOfArrays = T extends any[] ? Partial : never + type ElementsOf = { + [P in keyof T]?: OnlyElementsOfArrays + } + type PushModifier = { + [P in keyof T]?: + OnlyElementsOfArrays | + { $each?: T[P], $position?: number, $slice?: number, $sort?: 1 | -1 | Dictionary } + } + type ArraysOrEach = { + [P in keyof T]?: OnlyArrays | { $each: T[P] } + } + type CurrentDateModifier = { $type: "timestamp" | "date" } | true + type Modifier = T | { + $currentDate?: Partial> & Dictionary, + $inc?: PartialMapTo & Dictionary, + $min?: PartialMapTo & Dictionary, + $max?: PartialMapTo & Dictionary, + $mul?: PartialMapTo & Dictionary, + $rename?: PartialMapTo & Dictionary, + $set?: Partial & Dictionary, + $setOnInsert?: Partial & Dictionary, + $unset?: PartialMapTo & Dictionary, + $addToSet?: ArraysOrEach & Dictionary, + $push?: PushModifier & Dictionary, + $pull?: ElementsOf & Dictionary, + $pullAll?: Partial & Dictionary, + $pop?: PartialMapTo & Dictionary<1 | -1>, + } + + interface SortSpecifier { } interface FieldSpecifier { [id: string]: Number; @@ -32,7 +144,7 @@ declare module Mongo { fetch?: string[]; transform?: Function; }): boolean; - find(selector?: Selector | ObjectID | string, options?: { + find(selector?: Selector | ObjectID | string, options?: { sort?: SortSpecifier; skip?: number; limit?: number; @@ -40,7 +152,7 @@ declare module Mongo { reactive?: boolean; transform?: Function; }): Cursor; - findOne(selector?: Selector | ObjectID | string, options?: { + findOne(selector?: Selector | ObjectID | string, options?: { sort?: SortSpecifier; skip?: number; fields?: FieldSpecifier; @@ -50,12 +162,12 @@ declare module Mongo { insert(doc: T, callback?: Function): string; rawCollection(): any; rawDatabase(): any; - remove(selector: Selector | ObjectID | string, callback?: Function): number; - update(selector: Selector | ObjectID | string, modifier: Modifier, options?: { + remove(selector: Selector | ObjectID | string, callback?: Function): number; + update(selector: Selector | ObjectID | string, modifier: Modifier, options?: { multi?: boolean; upsert?: boolean; }, callback?: Function): number; - upsert(selector: Selector | ObjectID | string, modifier: Modifier, options?: { + upsert(selector: Selector | ObjectID | string, modifier: Modifier, options?: { multi?: boolean; }, callback?: Function): { numberAffected?: number; insertedId?: string; @@ -101,7 +213,7 @@ declare module Mongo { var ObjectID: ObjectIDStatic; interface ObjectIDStatic { - new (hexString?: string): ObjectID; + new(hexString?: string): ObjectID; } interface ObjectID { toHexString(): string; @@ -113,11 +225,121 @@ declare module Mongo { declare module "meteor/mongo" { module Mongo { - interface Selector { - [key: string]: any; + type BsonType = 1 | "double" | + 2 | "string" | + 3 | "object" | + 4 | "array" | + 5 | "binData" | + 6 | "undefined" | + 7 | "objectId" | + 8 | "bool" | + 9 | "date" | + 10 | "null" | + 11 | "regex" | + 12 | "dbPointer" | + 13 | "javascript" | + 14 | "symbol" | + 15 | "javascriptWithScope" | + 16 | "int" | + 17 | "timestamp" | + 18 | "long" | + 19 | "decimal" | + -1 | "minKey" | + 127 | "maxKey" | "number" + + type FieldExpression = { + $eq?: T, + $gt?: T, + $gte?: T, + $lt?: T, + $lte?: T, + $in?: T[], + $nin?: T[], + $ne?: T, + $exists?: boolean, + $type?: BsonType[] | BsonType, + $not?: FieldExpression, + $expr?: FieldExpression, + $jsonSchema?: any, + $mod?: number[], + $regex?: RegExp | string, + $options?: string, + $text?: { $search: string, $language?: string, $caseSensitive?: boolean, $diacriticSensitive?: boolean }, + $where?: string | Function, + $geoIntersects?: any, + $geoWithin?: any, + $near?: any, + $nearSphere?: any, + $all?: T[], + $elemMatch?: T extends {} ? Query : FieldExpression, + $size?: number, + $bitsAllClear?: any, + $bitsAllSet?: any, + $bitsAnyClear?: any, + $bitsAnySet?: any, + $comment?: string } - interface Selector extends Object { } - interface Modifier { } + + type Flatten = T extends any[] ? T[0] : T + + type Query = { + [P in keyof T]?: Flatten | RegExp | FieldExpression> + } & { + $or?: Query[], + $and?: Query[], + $nor?: Query[] + } & Dictionary + + type QueryWithModifiers = { + $query: Query, + $comment?: string, + $explain?: any, + $hint?: any, + $maxScan?: any, + $max?: any, + $maxTimeMS?: any, + $min?: any, + $orderby?: any, + $returnKey?: any, + $showDiskLoc?: any, + $natural?: any + } + + type Selector = Query | QueryWithModifiers + + type Dictionary = { [key: string]: T } + type PartialMapTo = Partial> + type OnlyArrays = T extends any[] ? T : never; + type OnlyElementsOfArrays = T extends any[] ? Partial : never + type ElementsOf = { + [P in keyof T]?: OnlyElementsOfArrays + } + type PushModifier = { + [P in keyof T]?: + OnlyElementsOfArrays | + { $each?: T[P], $position?: number, $slice?: number, $sort?: 1 | -1 | Dictionary } + } + type ArraysOrEach = { + [P in keyof T]?: OnlyArrays | { $each: T[P] } + } + type CurrentDateModifier = { $type: "timestamp" | "date" } | true + type Modifier = T | { + $currentDate?: Partial> & Dictionary, + $inc?: PartialMapTo & Dictionary, + $min?: PartialMapTo & Dictionary, + $max?: PartialMapTo & Dictionary, + $mul?: PartialMapTo & Dictionary, + $rename?: PartialMapTo & Dictionary, + $set?: Partial & Dictionary, + $setOnInsert?: Partial & Dictionary, + $unset?: PartialMapTo & Dictionary, + $addToSet?: ArraysOrEach & Dictionary, + $push?: PushModifier & Dictionary, + $pull?: ElementsOf & Dictionary, + $pullAll?: Partial & Dictionary, + $pop?: PartialMapTo & Dictionary<1 | -1>, + } + interface SortSpecifier { } interface FieldSpecifier { [id: string]: Number; @@ -146,7 +368,7 @@ declare module "meteor/mongo" { fetch?: string[]; transform?: Function; }): boolean; - find(selector?: Selector | ObjectID | string, options?: { + find(selector?: Selector | ObjectID | string, options?: { sort?: SortSpecifier; skip?: number; limit?: number; @@ -154,7 +376,7 @@ declare module "meteor/mongo" { reactive?: boolean; transform?: Function; }): Cursor; - findOne(selector?: Selector | ObjectID | string, options?: { + findOne(selector?: Selector | ObjectID | string, options?: { sort?: SortSpecifier; skip?: number; fields?: FieldSpecifier; @@ -164,12 +386,12 @@ declare module "meteor/mongo" { insert(doc: T, callback?: Function): string; rawCollection(): any; rawDatabase(): any; - remove(selector: Selector | ObjectID | string, callback?: Function): number; - update(selector: Selector | ObjectID | string, modifier: Modifier, options?: { + remove(selector: Selector | ObjectID | string, callback?: Function): number; + update(selector: Selector | ObjectID | string, modifier: Modifier, options?: { multi?: boolean; upsert?: boolean; }, callback?: Function): number; - upsert(selector: Selector | ObjectID | string, modifier: Modifier, options?: { + upsert(selector: Selector | ObjectID | string, modifier: Modifier, options?: { multi?: boolean; }, callback?: Function): { numberAffected?: number; insertedId?: string; @@ -215,12 +437,12 @@ declare module "meteor/mongo" { var ObjectID: ObjectIDStatic; interface ObjectIDStatic { - new (hexString?: string): ObjectID; + new(hexString?: string): ObjectID; } interface ObjectID { toHexString(): string; equals(otherID: ObjectID): boolean; - } + } function setConnectionOptions(options: any): void; } From 64104e9760065bd498a3d62d98bb05ea26500dc2 Mon Sep 17 00:00:00 2001 From: AJ Richardson Date: Tue, 24 Apr 2018 19:03:38 -0400 Subject: [PATCH 0816/2153] Lowdb test fix (#25204) * lodash: _.get should with numeric keys, too. Also added some better tests. * lodash: add one more NumericDictionary overload for _.get * lodash: more reasonable index for _.get tests * lodash: object type should not be here (fixes #23293) * lodash: reduce should always return T if no accumulator (#14758) * lodash: fix iterator types, remove thisArg from documentation * lodash: return more specific type for stubTrue and stubFalse * lowdb: fix failing tests --- types/lodash/common/array.d.ts | 149 +- types/lodash/common/collection.d.ts | 312 +-- types/lodash/common/common.d.ts | 2 +- types/lodash/common/math.d.ts | 24 +- types/lodash/common/object.d.ts | 48 +- types/lodash/common/seq.d.ts | 4 +- types/lodash/common/util.d.ts | 12 +- types/lodash/fp.d.ts | 81 +- types/lodash/lodash-tests.ts | 157 +- types/lodash/readme.md | 4 +- types/lodash/scripts/generate-fp.ts | 35 +- types/lodash/scripts/generate-lowdb.ts | 165 ++ types/lodash/scripts/package.json | 4 +- types/lodash/scripts/utils.ts | 38 + types/lowdb/_lodash.d.ts | 3134 ++++++++++++++++++++++++ types/lowdb/index.d.ts | 347 +-- types/lowdb/lowdb-tests.ts | 73 +- types/lowdb/tslint.json | 75 +- 18 files changed, 3719 insertions(+), 945 deletions(-) create mode 100644 types/lodash/scripts/generate-lowdb.ts create mode 100644 types/lodash/scripts/utils.ts create mode 100644 types/lowdb/_lodash.d.ts diff --git a/types/lodash/common/array.d.ts b/types/lodash/common/array.d.ts index 34b9548221..5591bce088 100644 --- a/types/lodash/common/array.d.ts +++ b/types/lodash/common/array.d.ts @@ -577,20 +577,10 @@ declare module "../index" { interface LoDashStatic { /** * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. + * returns falsey. The predicate is invoked with three arguments: (value, index, array). * * @param array The array to query. * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. * @return Returns the slice of array. */ dropRightWhile( @@ -624,20 +614,10 @@ declare module "../index" { interface LoDashStatic { /** * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * returns falsey. The predicate is invoked with three arguments: (value, index, array). * * @param array The array to query. * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. * @return Returns the slice of array. */ dropWhile( @@ -797,15 +777,6 @@ declare module "../index" { * This method is like _.find except that it returns the index of the first element predicate returns truthy * for instead of the element itself. * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * * @param array The array to search. * @param predicate The function invoked per iteration. * @param fromIndex The index to search from. @@ -846,15 +817,6 @@ declare module "../index" { /** * This method is like _.findIndex except that it iterates over elements of collection from right to left. * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * * @param array The array to search. * @param predicate The function invoked per iteration. * @param fromIndex The index to search from. @@ -1881,22 +1843,12 @@ declare module "../index" { interface LoDashStatic { /** * Removes all elements from array that predicate returns truthy for and returns an array of the removed - * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * elements. The predicate is invoked with three arguments: (value, index, array). * * Note: Unlike _.filter, this method mutates array. * * @param array The array to modify. * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. * @return Returns the new array of removed elements. */ remove( @@ -2359,53 +2311,29 @@ declare module "../index" { * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); * // => [1.1, 2.2] */ - sortedUniqBy( - array: string | null | undefined, - iteratee: StringIterator - ): string[]; - - /** - * @see _.sortedUniqBy - */ sortedUniqBy( array: List | null | undefined, - iteratee: ListIteratee + iteratee: ValueIteratee ): T[]; } interface LoDashImplicitWrapper { - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - this: LoDashImplicitWrapper, - iteratee: StringIterator - ): LoDashImplicitWrapper; - /** * @see _.sortedUniqBy */ sortedUniqBy( this: LoDashImplicitWrapper | null | undefined>, - iteratee: ListIteratee + iteratee: ValueIteratee ): LoDashImplicitWrapper; } interface LoDashExplicitWrapper { - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - this: LoDashExplicitWrapper, - iteratee: StringIterator - ): LoDashExplicitWrapper; - /** * @see _.sortedUniqBy */ sortedUniqBy( this: LoDashExplicitWrapper | null | undefined>, - iteratee: ListIteratee + iteratee: ValueIteratee ): LoDashExplicitWrapper; } @@ -2512,20 +2440,10 @@ declare module "../index" { interface LoDashStatic { /** * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * falsey. The predicate is invoked with three arguments: (value, index, array). * * @param array The array to query. * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. * @return Returns the slice of array. */ takeRightWhile( @@ -2559,20 +2477,10 @@ declare module "../index" { interface LoDashStatic { /** * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * falsey. The predicate is invoked with three arguments: (value, index, array). * * @param array The array to query. * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. * @return Returns the slice of array. */ takeWhile( @@ -2958,53 +2866,29 @@ declare module "../index" { * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ - uniqBy( - array: string | null | undefined, - iteratee: StringIterator - ): string[]; - - /** - * @see _.uniqBy - */ uniqBy( array: List | null | undefined, - iteratee: ListIteratee + iteratee: ValueIteratee ): T[]; } interface LoDashImplicitWrapper { - /** - * @see _.uniqBy - */ - uniqBy( - this: LoDashImplicitWrapper, - iteratee: StringIterator - ): LoDashImplicitWrapper; - /** * @see _.uniqBy */ uniqBy( this: LoDashImplicitWrapper | null | undefined>, - iteratee: ListIteratee + iteratee: ValueIteratee ): LoDashImplicitWrapper; } interface LoDashExplicitWrapper { - /** - * @see _.uniqBy - */ - uniqBy( - this: LoDashExplicitWrapper, - iteratee: StringIterator - ): LoDashExplicitWrapper; - /** * @see _.uniqBy */ uniqBy( this: LoDashExplicitWrapper | null | undefined>, - iteratee: ListIteratee + iteratee: ValueIteratee ): LoDashExplicitWrapper; } @@ -3085,12 +2969,10 @@ declare module "../index" { interface LoDashStatic { /** * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). + * combined. The iteratee is invoked with four arguments: (accumulator, value, index, group). * * @param array The array of grouped elements to process. * @param iteratee The function to combine regrouped values. - * @param thisArg The this binding of iteratee. * @return Returns the new array of regrouped elements. */ unzipWith( @@ -3643,11 +3525,10 @@ declare module "../index" { interface LoDashStatic { /** * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, + * combined. The iteratee is invoked with four arguments: (accumulator, value, index, * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. + * @param arrays The arrays to process. + * @param iteratee The function to combine grouped values. * @return Returns the new array of grouped elements. */ zipWith( diff --git a/types/lodash/common/collection.d.ts b/types/lodash/common/collection.d.ts index 3c7e65d38f..2e38422b2d 100644 --- a/types/lodash/common/collection.d.ts +++ b/types/lodash/common/collection.d.ts @@ -6,34 +6,15 @@ declare module "../index" { /** * Creates an object composed of keys generated from the results of running each element of collection through * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * iteratee is invoked with one argument: (value). * * @param collection The collection to iterate over. * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. * @return Returns the composed aggregate object. */ - countBy( - collection: string | null | undefined, - iteratee?: StringIterator - ): Dictionary; - - /** - * @see _.countBy - */ countBy( collection: List | null | undefined, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): Dictionary; /** @@ -41,25 +22,17 @@ declare module "../index" { */ countBy( collection: T | null | undefined, - iteratee?: ObjectIteratee + iteratee?: ValueIteratee ): Dictionary; } interface LoDashImplicitWrapper { - /** - * @see _.countBy - */ - countBy( - this: LoDashImplicitWrapper, - iteratee?: StringIterator - ): LoDashImplicitWrapper>; - /** * @see _.countBy */ countBy( this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): LoDashImplicitWrapper>; /** @@ -67,25 +40,17 @@ declare module "../index" { */ countBy( this: LoDashImplicitWrapper, - iteratee?: ObjectIteratee + iteratee?: ValueIteratee ): LoDashImplicitWrapper>; } interface LoDashExplicitWrapper { - /** - * @see _.countBy - */ - countBy( - this: LoDashExplicitWrapper, - iteratee?: StringIterator - ): LoDashExplicitWrapper>; - /** * @see _.countBy */ countBy( this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): LoDashExplicitWrapper>; /** @@ -93,7 +58,7 @@ declare module "../index" { */ countBy( this: LoDashExplicitWrapper, - iteratee?: ObjectIteratee + iteratee?: ValueIteratee ): LoDashExplicitWrapper>; } @@ -243,20 +208,10 @@ declare module "../index" { interface LoDashStatic { /** * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * predicate is invoked with three arguments: (value, index|key, collection). * * @param collection The collection to iterate over. * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. * @return Returns the new filtered array. */ filter( @@ -386,16 +341,7 @@ declare module "../index" { interface LoDashStatic { /** * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * The predicate is invoked with three arguments: (value, index|key, collection). * * @param collection The collection to search. * @param predicate The function invoked per iteration. @@ -1070,8 +1016,7 @@ declare module "../index" { interface LoDashStatic { /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: + * Iterates over elements of collection invoking iteratee for each element. The iteratee is invoked with three arguments: * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. * * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To @@ -1081,7 +1026,6 @@ declare module "../index" { * * @param collection The collection to iterate over. * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. */ forEach( collection: T[], @@ -1189,7 +1133,6 @@ declare module "../index" { * * @param collection The collection to iterate over. * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. */ forEachRight( collection: T[], @@ -1293,34 +1236,15 @@ declare module "../index" { /** * Creates an object composed of keys generated from the results of running each element of collection through * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * key. The iteratee is invoked with one argument: (value). * * @param collection The collection to iterate over. * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. * @return Returns the composed aggregate object. */ - groupBy( - collection: string | null | undefined, - iteratee?: StringIterator - ): Dictionary; - - /** - * @see _.groupBy - */ groupBy( collection: List | null | undefined, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): Dictionary; /** @@ -1328,25 +1252,17 @@ declare module "../index" { */ groupBy( collection: T | null | undefined, - iteratee?: ObjectIteratee + iteratee?: ValueIteratee ): Dictionary>; } interface LoDashImplicitWrapper { - /** - * @see _.groupBy - */ - groupBy( - this: LoDashImplicitWrapper, - iteratee?: StringIterator - ): LoDashImplicitWrapper>; - /** * @see _.groupBy */ groupBy( this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): LoDashImplicitWrapper>; /** @@ -1354,25 +1270,17 @@ declare module "../index" { */ groupBy( this: LoDashImplicitWrapper, - iteratee?: ObjectIteratee + iteratee?: ValueIteratee ): LoDashImplicitWrapper>>; } interface LoDashExplicitWrapper { - /** - * @see _.groupBy - */ - groupBy( - this: LoDashExplicitWrapper, - iteratee?: StringIterator - ): LoDashExplicitWrapper>; - /** * @see _.groupBy */ groupBy( this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): LoDashExplicitWrapper>; /** @@ -1380,7 +1288,7 @@ declare module "../index" { */ groupBy( this: LoDashExplicitWrapper, - iteratee?: ObjectIteratee + iteratee?: ValueIteratee ): LoDashExplicitWrapper>>; } @@ -1489,34 +1397,15 @@ declare module "../index" { /** * Creates an object composed of keys generated from the results of running each element of collection through * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * iteratee function is invoked with one argument: (value). * * @param collection The collection to iterate over. * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. * @return Returns the composed aggregate object. */ - keyBy( - collection: string | null | undefined, - iteratee?: StringIterator - ): Dictionary; - - /** - * @see _.keyBy - */ keyBy( collection: List | null | undefined, - iteratee?: ListIterateeCustom + iteratee?: ValueIterateeCustom ): Dictionary; /** @@ -1524,25 +1413,17 @@ declare module "../index" { */ keyBy( collection: T | null | undefined, - iteratee?: ObjectIterateeCustom + iteratee?: ValueIterateeCustom ): Dictionary; } interface LoDashImplicitWrapper { - /** - * @see _.keyBy - */ - keyBy( - this: LoDashImplicitWrapper, - iteratee?: StringIterator - ): LoDashImplicitWrapper>; - /** * @see _.keyBy */ keyBy( this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIterateeCustom + iteratee?: ValueIterateeCustom ): LoDashImplicitWrapper>; /** @@ -1550,25 +1431,17 @@ declare module "../index" { */ keyBy( this: LoDashImplicitWrapper, - iteratee?: ObjectIterateeCustom + iteratee?: ValueIterateeCustom ): LoDashImplicitWrapper>; } interface LoDashExplicitWrapper { - /** - * @see _.keyBy - */ - keyBy( - this: LoDashExplicitWrapper, - iteratee?: StringIterator - ): LoDashExplicitWrapper>; - /** * @see _.keyBy */ keyBy( this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIterateeCustom + iteratee?: ValueIterateeCustom ): LoDashExplicitWrapper>; /** @@ -1576,7 +1449,7 @@ declare module "../index" { */ keyBy( this: LoDashExplicitWrapper, - iteratee?: ObjectIterateeCustom + iteratee?: ValueIterateeCustom ): LoDashExplicitWrapper>; } @@ -1584,17 +1457,8 @@ declare module "../index" { interface LoDashStatic { /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * Creates an array of values by running each element in collection through iteratee. The iteratee is + * invoked with three arguments: (value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, * _.reject, and _.some. @@ -1606,7 +1470,6 @@ declare module "../index" { * * @param collection The collection to iterate over. * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. * @return Returns the new mapped array. */ map( @@ -1908,20 +1771,10 @@ declare module "../index" { /** * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, * while the second of which contains elements predicate returns falsey for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback - * returns the property value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback - * returns true for elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns - * true for elements that have the properties of the given object, else false. + * The predicate is invoked with three arguments: (value, index|key, collection). * * @param collection The collection to iterate over. * @param callback The function called per iteration. - * @param thisArg The this binding of predicate. * @return Returns the array of grouped elements. **/ partition( @@ -1982,7 +1835,7 @@ declare module "../index" { * element in the collection through the callback, where each successive callback execution * consumes the return value of the previous execution. If accumulator is not provided the * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). + * is invoked with four arguments: (accumulator, value, index|key, collection). * @param collection The collection to iterate over. * @param callback The function called per iteration. * @param accumulator Initial value of the accumulator. @@ -2015,26 +1868,26 @@ declare module "../index" { /** * @see _.reduce **/ - reduce( + reduce( collection: T[] | null | undefined, - callback: MemoListIterator - ): TResult | undefined; + callback: MemoListIterator + ): T | undefined; /** * @see _.reduce **/ - reduce( + reduce( collection: List | null | undefined, - callback: MemoListIterator> - ): TResult | undefined; + callback: MemoListIterator> + ): T | undefined; /** * @see _.reduce **/ - reduce( + reduce( collection: T | null | undefined, - callback: MemoObjectIterator - ): TResult | undefined; + callback: MemoObjectIterator + ): T[keyof T] | undefined; } interface LoDashImplicitWrapper { @@ -2068,26 +1921,26 @@ declare module "../index" { /** * @see _.reduce **/ - reduce( + reduce( this: LoDashImplicitWrapper, - callback: MemoListIterator - ): TResult | undefined; + callback: MemoListIterator + ): T | undefined; /** * @see _.reduce **/ - reduce( + reduce( this: LoDashImplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): TResult | undefined; + callback: MemoListIterator> + ): T | undefined; /** * @see _.reduce **/ - reduce( + reduce( this: LoDashImplicitWrapper, - callback: MemoObjectIterator - ): TResult | undefined; + callback: MemoObjectIterator + ): T[keyof T] | undefined; } interface LoDashExplicitWrapper { @@ -2121,26 +1974,26 @@ declare module "../index" { /** * @see _.reduce **/ - reduce( + reduce( this: LoDashExplicitWrapper, - callback: MemoListIterator - ): LoDashExplicitWrapper; + callback: MemoListIterator + ): LoDashExplicitWrapper; /** * @see _.reduce **/ - reduce( + reduce( this: LoDashExplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): LoDashExplicitWrapper; + callback: MemoListIterator> + ): LoDashExplicitWrapper; /** * @see _.reduce **/ - reduce( + reduce( this: LoDashExplicitWrapper, - callback: MemoObjectIterator - ): LoDashExplicitWrapper; + callback: MemoObjectIterator + ): LoDashExplicitWrapper; } // reduceRight @@ -2181,26 +2034,26 @@ declare module "../index" { /** * @see _.reduceRight **/ - reduceRight( + reduceRight( collection: T[] | null | undefined, - callback: MemoListIterator - ): TResult | undefined; + callback: MemoListIterator + ): T | undefined; /** * @see _.reduceRight **/ - reduceRight( + reduceRight( collection: List | null | undefined, - callback: MemoListIterator> - ): TResult | undefined; + callback: MemoListIterator> + ): T | undefined; /** * @see _.reduceRight **/ - reduceRight( + reduceRight( collection: T | null | undefined, - callback: MemoObjectIterator - ): TResult | undefined; + callback: MemoObjectIterator + ): T[keyof T] | undefined; } interface LoDashImplicitWrapper { @@ -2234,26 +2087,26 @@ declare module "../index" { /** * @see _.reduceRight **/ - reduceRight( + reduceRight( this: LoDashImplicitWrapper, - callback: MemoListIterator - ): TResult | undefined; + callback: MemoListIterator + ): T | undefined; /** * @see _.reduceRight **/ - reduceRight( + reduceRight( this: LoDashImplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): TResult | undefined; + callback: MemoListIterator> + ): T | undefined; /** * @see _.reduceRight **/ - reduceRight( + reduceRight( this: LoDashImplicitWrapper, - callback: MemoObjectIterator - ): TResult | undefined; + callback: MemoObjectIterator + ): T[keyof T] | undefined; } interface LoDashExplicitWrapper { @@ -2287,26 +2140,26 @@ declare module "../index" { /** * @see _.reduceRight **/ - reduceRight( + reduceRight( this: LoDashExplicitWrapper, - callback: MemoListIterator - ): LoDashExplicitWrapper; + callback: MemoListIterator + ): LoDashExplicitWrapper; /** * @see _.reduceRight **/ - reduceRight( + reduceRight( this: LoDashExplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): LoDashExplicitWrapper; + callback: MemoListIterator> + ): LoDashExplicitWrapper; /** * @see _.reduceRight **/ - reduceRight( + reduceRight( this: LoDashExplicitWrapper, - callback: MemoObjectIterator - ): LoDashExplicitWrapper; + callback: MemoObjectIterator + ): LoDashExplicitWrapper; } // reject @@ -2318,7 +2171,6 @@ declare module "../index" { * * @param collection The collection to iterate over. * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. * @return Returns the new filtered array. */ reject( diff --git a/types/lodash/common/common.d.ts b/types/lodash/common/common.d.ts index 17d5e04b36..28c4437073 100644 --- a/types/lodash/common/common.d.ts +++ b/types/lodash/common/common.d.ts @@ -182,7 +182,7 @@ declare module "../index" { type ArrayIterator = (value: T, index: number, collection: T[]) => TResult; type ListIterator = (value: T, index: number, collection: List) => TResult; type ListIteratee = ListIterator | string | [string, any] | PartialDeep; - type ListIterateeCustom = ListIterator | string | object | [string, any] | PartialDeep; + type ListIterateeCustom = ListIterator | string | [string, any] | PartialDeep; type ListIteratorTypeGuard = (value: T, index: number, collection: List) => value is S; // Note: key should be string, not keyof T, because the actual object may contain extra properties that were not specified in the type. diff --git a/types/lodash/common/math.d.ts b/types/lodash/common/math.d.ts index b38a7df970..640fbc429d 100644 --- a/types/lodash/common/math.d.ts +++ b/types/lodash/common/math.d.ts @@ -160,7 +160,7 @@ declare module "../index" { * * @category Math * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. + * @param iteratee The iteratee invoked per element. * @returns Returns the maximum value. * @example * @@ -175,7 +175,7 @@ declare module "../index" { */ maxBy( collection: List | null | undefined, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): T | undefined; } @@ -185,7 +185,7 @@ declare module "../index" { */ maxBy( this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): T | undefined; } @@ -195,7 +195,7 @@ declare module "../index" { */ maxBy( this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): LoDashExplicitWrapper; } @@ -240,7 +240,7 @@ declare module "../index" { * * @category Math * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. + * @param iteratee The iteratee invoked per element. * @returns Returns the mean. * @example * @@ -249,7 +249,7 @@ declare module "../index" { */ meanBy( collection: List | null | undefined, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): number; } @@ -259,7 +259,7 @@ declare module "../index" { */ meanBy( this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): number; } @@ -269,7 +269,7 @@ declare module "../index" { */ meanBy( this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): LoDashExplicitWrapper; } @@ -313,7 +313,7 @@ declare module "../index" { * * @category Math * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. + * @param iteratee The iteratee invoked per element. * @returns Returns the minimum value. * @example * @@ -328,7 +328,7 @@ declare module "../index" { */ minBy( collection: List | null | undefined, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): T | undefined; } @@ -338,7 +338,7 @@ declare module "../index" { */ minBy( this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): T | undefined; } @@ -348,7 +348,7 @@ declare module "../index" { */ minBy( this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): LoDashExplicitWrapper; } diff --git a/types/lodash/common/object.d.ts b/types/lodash/common/object.d.ts index 4845e7f31b..e0b1f3ebf1 100644 --- a/types/lodash/common/object.d.ts +++ b/types/lodash/common/object.d.ts @@ -1370,18 +1370,8 @@ declare module "../index" { * This method is like _.find except that it returns the key of the first element predicate returns truthy for * instead of the element itself. * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * * @param object The object to search. * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. * @return Returns the key of the matched element, else undefined. */ findKey( @@ -1416,18 +1406,8 @@ declare module "../index" { /** * This method is like _.findKey except that it iterates over elements of a collection in the opposite order. * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * * @param object The object to search. * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. * @return Returns the key of the matched element, else undefined. */ findLastKey( @@ -1461,12 +1441,11 @@ declare module "../index" { interface LoDashStatic { /** * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The - * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may + * iteratee is invoked with three arguments: (value, key, object). Iteratee functions may * exit iteration early by explicitly returning false. * * @param object The object to iterate over. * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. * @return Returns object. */ forIn( @@ -1501,7 +1480,6 @@ declare module "../index" { * * @param object The object to iterate over. * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. * @return Returns object. */ forInRight( @@ -1533,12 +1511,11 @@ declare module "../index" { interface LoDashStatic { /** * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is - * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit + * invoked with three arguments: (value, key, object). Iteratee functions may exit * iteration early by explicitly returning false. * * @param object The object to iterate over. * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. * @return Returns object. */ forOwn( @@ -1573,7 +1550,6 @@ declare module "../index" { * * @param object The object to iterate over. * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. * @return Returns object. */ forOwnRight( @@ -2199,7 +2175,6 @@ declare module "../index" { * * @param object The object to iterate over. * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. * @return Returns the new mapped object. */ mapKeys( @@ -2257,21 +2232,11 @@ declare module "../index" { interface LoDashStatic { /** * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. + * enumerable property of object through iteratee. The iteratee function is + * invoked with three arguments: (value, key, object). * * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. + * @param iteratee The function invoked per iteration. * @return Returns the new mapped object. */ mapValues(obj: string | null | undefined, callback: StringIterator): NumericDictionary; @@ -3363,13 +3328,12 @@ declare module "../index" { /** * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, + * the accumulator object. The iteratee is invoked with four arguments: (accumulator, * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. * * @param object The object to iterate over. * @param iteratee The function invoked per iteration. * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. * @return Returns the accumulated value. */ transform( diff --git a/types/lodash/common/seq.d.ts b/types/lodash/common/seq.d.ts index 22a7a14746..bc3cc39963 100644 --- a/types/lodash/common/seq.d.ts +++ b/types/lodash/common/seq.d.ts @@ -141,13 +141,12 @@ declare module "../index" { interface LoDashStatic { /** - * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one + * This method invokes interceptor and returns value. The interceptor is invoked with one * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations * on intermediate results within the chain. * * @param value The value to provide to interceptor. * @param interceptor The function to invoke. - * @parem thisArg The this binding of interceptor. * @return Returns value. **/ tap( @@ -173,7 +172,6 @@ declare module "../index" { * * @param value The value to provide to interceptor. * @param interceptor The function to invoke. - * @param thisArg The this binding of interceptor. * @return Returns the result of interceptor. */ thru( diff --git a/types/lodash/common/util.d.ts b/types/lodash/common/util.d.ts index 8aad451ca1..80b06778fd 100644 --- a/types/lodash/common/util.d.ts +++ b/types/lodash/common/util.d.ts @@ -1250,21 +1250,21 @@ declare module "../index" { * * @returns Returns `false`. */ - stubFalse(): boolean; + stubFalse(): false; } interface LoDashImplicitWrapper { /** * @see _.stubFalse */ - stubFalse(): boolean; + stubFalse(): false; } interface LoDashExplicitWrapper { /** * @see _.stubFalse */ - stubFalse(): LoDashExplicitWrapper; + stubFalse(): LoDashExplicitWrapper; } // stubObject @@ -1325,21 +1325,21 @@ declare module "../index" { * * @returns Returns `true`. */ - stubTrue(): boolean; + stubTrue(): true; } interface LoDashImplicitWrapper { /** * @see _.stubTrue */ - stubTrue(): boolean; + stubTrue(): true; } interface LoDashExplicitWrapper { /** * @see _.stubTrue */ - stubTrue(): LoDashExplicitWrapper; + stubTrue(): LoDashExplicitWrapper; } // times diff --git a/types/lodash/fp.d.ts b/types/lodash/fp.d.ts index 725ee237aa..d577414aa4 100644 --- a/types/lodash/fp.d.ts +++ b/types/lodash/fp.d.ts @@ -350,20 +350,15 @@ declare namespace _ { type LodashContains1x1 = (collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined) => boolean; type LodashContains1x2 = (target: T) => boolean; interface LodashCountBy { - (iteratee: (value: string) => T): LodashCountBy1x1; - (iteratee: lodash.__, collection: string | null | undefined): LodashCountBy1x2; - (iteratee: (value: string) => T, collection: string | null | undefined): lodash.Dictionary; - (iteratee: lodash.ValueIteratee): LodashCountBy2x1; - (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashCountBy2x2; + (iteratee: lodash.ValueIteratee): LodashCountBy1x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashCountBy1x2; (iteratee: lodash.ValueIteratee, collection: lodash.List | null | undefined): lodash.Dictionary; - (iteratee: lodash.__, collection: T | null | undefined): LodashCountBy3x2; + (iteratee: lodash.__, collection: T | null | undefined): LodashCountBy2x2; (iteratee: lodash.ValueIteratee, collection: T | null | undefined): lodash.Dictionary; } - type LodashCountBy1x1 = (collection: string | null | undefined) => lodash.Dictionary; - type LodashCountBy1x2 = (iteratee: (value: string) => T) => lodash.Dictionary; - type LodashCountBy2x1 = (collection: lodash.List | object | null | undefined) => lodash.Dictionary; - type LodashCountBy2x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; - type LodashCountBy3x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; + type LodashCountBy1x1 = (collection: lodash.List | object | null | undefined) => lodash.Dictionary; + type LodashCountBy1x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; + type LodashCountBy2x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; type LodashCreate = (prototype: T) => T & U; interface LodashCurry { (func: (t1: T1) => R): lodash.CurriedFunction1; @@ -744,7 +739,7 @@ declare namespace _ { } type LodashExtendWith1x5 = (object: TObject) => TObject & TSource; type LodashExtendWith1x6 = (customizer: lodash.AssignCustomizer) => TObject & TSource; - type LodashStubFalse = () => boolean; + type LodashStubFalse = () => false; interface LodashFill { (start: number): LodashFill1x1; (start: lodash.__, end: number): LodashFill1x2; @@ -1580,20 +1575,15 @@ declare namespace _ { type LodashGetOr4x5 = (path: lodash.PropertyPath) => any; type LodashGetOr4x6 = (defaultValue: any) => any; interface LodashGroupBy { - (iteratee: (value: string) => lodash.NotVoid): LodashGroupBy1x1; - (iteratee: lodash.__, collection: string | null | undefined): LodashGroupBy1x2; - (iteratee: (value: string) => lodash.NotVoid, collection: string | null | undefined): lodash.Dictionary; - (iteratee: lodash.ValueIteratee): LodashGroupBy2x1; - (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashGroupBy2x2; + (iteratee: lodash.ValueIteratee): LodashGroupBy1x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashGroupBy1x2; (iteratee: lodash.ValueIteratee, collection: lodash.List | null | undefined): lodash.Dictionary; - (iteratee: lodash.__, collection: T | null | undefined): LodashGroupBy3x2; + (iteratee: lodash.__, collection: T | null | undefined): LodashGroupBy2x2; (iteratee: lodash.ValueIteratee, collection: T | null | undefined): lodash.Dictionary>; } - type LodashGroupBy1x1 = (collection: string | null | undefined) => lodash.Dictionary; - type LodashGroupBy1x2 = (iteratee: (value: string) => lodash.NotVoid) => lodash.Dictionary; - type LodashGroupBy2x1 = (collection: lodash.List | object | null | undefined) => lodash.Dictionary; - type LodashGroupBy2x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; - type LodashGroupBy3x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary>; + type LodashGroupBy1x1 = (collection: lodash.List | object | null | undefined) => lodash.Dictionary; + type LodashGroupBy1x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; + type LodashGroupBy2x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary>; interface LodashGt { (value: any): LodashGt1x1; (value: lodash.__, other: any): LodashGt1x2; @@ -1661,20 +1651,15 @@ declare namespace _ { type LodashIncludesFrom1x5 = (fromIndex: number) => boolean; type LodashIncludesFrom1x6 = (target: T) => boolean; interface LodashKeyBy { - (iteratee: (value: string) => lodash.PropertyName): LodashKeyBy1x1; - (iteratee: lodash.__, collection: string | null | undefined): LodashKeyBy1x2; - (iteratee: (value: string) => lodash.PropertyName, collection: string | null | undefined): lodash.Dictionary; - (iteratee: lodash.ValueIterateeCustom): LodashKeyBy2x1; - (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashKeyBy2x2; + (iteratee: lodash.ValueIterateeCustom): LodashKeyBy1x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashKeyBy1x2; (iteratee: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): lodash.Dictionary; - (iteratee: lodash.__, collection: T | null | undefined): LodashKeyBy3x2; + (iteratee: lodash.__, collection: T | null | undefined): LodashKeyBy2x2; (iteratee: lodash.ValueIterateeCustom, collection: T | null | undefined): lodash.Dictionary; } - type LodashKeyBy1x1 = (collection: string | null | undefined) => lodash.Dictionary; - type LodashKeyBy1x2 = (iteratee: (value: string) => lodash.PropertyName) => lodash.Dictionary; - type LodashKeyBy2x1 = (collection: lodash.List | object | null | undefined) => lodash.Dictionary; - type LodashKeyBy2x2 = (iteratee: lodash.ValueIterateeCustom) => lodash.Dictionary; - type LodashKeyBy3x2 = (iteratee: lodash.ValueIterateeCustom) => lodash.Dictionary; + type LodashKeyBy1x1 = (collection: lodash.List | object | null | undefined) => lodash.Dictionary; + type LodashKeyBy1x2 = (iteratee: lodash.ValueIterateeCustom) => lodash.Dictionary; + type LodashKeyBy2x2 = (iteratee: lodash.ValueIterateeCustom) => lodash.Dictionary; interface LodashIndexOf { (value: T): LodashIndexOf1x1; (value: lodash.__, array: lodash.List | null | undefined): LodashIndexOf1x2; @@ -3546,17 +3531,12 @@ declare namespace _ { type LodashSortedLastIndexOf1x2 = (value: T) => number; type LodashSortedUniq = (array: lodash.List | null | undefined) => T[]; interface LodashSortedUniqBy { - (iteratee: (value: string) => lodash.NotVoid): LodashSortedUniqBy1x1; - (iteratee: lodash.__, array: string | null | undefined): LodashSortedUniqBy1x2; - (iteratee: (value: string) => lodash.NotVoid, array: string | null | undefined): string[]; - (iteratee: lodash.ValueIteratee): LodashSortedUniqBy2x1; - (iteratee: lodash.__, array: lodash.List | null | undefined): LodashSortedUniqBy2x2; + (iteratee: lodash.ValueIteratee): LodashSortedUniqBy1x1; + (iteratee: lodash.__, array: lodash.List | null | undefined): LodashSortedUniqBy1x2; (iteratee: lodash.ValueIteratee, array: lodash.List | null | undefined): T[]; } - type LodashSortedUniqBy1x1 = (array: string | null | undefined) => string[]; - type LodashSortedUniqBy1x2 = (iteratee: (value: string) => lodash.NotVoid) => string[]; - type LodashSortedUniqBy2x1 = (array: lodash.List | null | undefined) => T[]; - type LodashSortedUniqBy2x2 = (iteratee: lodash.ValueIteratee) => T[]; + type LodashSortedUniqBy1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashSortedUniqBy1x2 = (iteratee: lodash.ValueIteratee) => T[]; interface LodashSplit { (separator: RegExp|string): LodashSplit1x1; (separator: lodash.__, string: string): LodashSplit1x2; @@ -3583,7 +3563,7 @@ declare namespace _ { type LodashStubArray = () => any[]; type LodashStubObject = () => any; type LodashStubString = () => string; - type LodashStubTrue = () => boolean; + type LodashStubTrue = () => true; interface LodashSubtract { (minuend: number): LodashSubtract1x1; (minuend: lodash.__, subtrahend: number): LodashSubtract1x2; @@ -3900,17 +3880,12 @@ declare namespace _ { type LodashUnionWith1x6 = (comparator: lodash.Comparator) => T[]; type LodashUniq = (array: lodash.List | null | undefined) => T[]; interface LodashUniqBy { - (iteratee: (value: string) => lodash.NotVoid): LodashUniqBy1x1; - (iteratee: lodash.__, array: string | null | undefined): LodashUniqBy1x2; - (iteratee: (value: string) => lodash.NotVoid, array: string | null | undefined): string[]; - (iteratee: lodash.ValueIteratee): LodashUniqBy2x1; - (iteratee: lodash.__, array: lodash.List | null | undefined): LodashUniqBy2x2; + (iteratee: lodash.ValueIteratee): LodashUniqBy1x1; + (iteratee: lodash.__, array: lodash.List | null | undefined): LodashUniqBy1x2; (iteratee: lodash.ValueIteratee, array: lodash.List | null | undefined): T[]; } - type LodashUniqBy1x1 = (array: string | null | undefined) => string[]; - type LodashUniqBy1x2 = (iteratee: (value: string) => lodash.NotVoid) => string[]; - type LodashUniqBy2x1 = (array: lodash.List | null | undefined) => T[]; - type LodashUniqBy2x2 = (iteratee: lodash.ValueIteratee) => T[]; + type LodashUniqBy1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashUniqBy1x2 = (iteratee: lodash.ValueIteratee) => T[]; type LodashUniqueId = (prefix: string) => string; interface LodashUniqWith { (comparator: lodash.Comparator): LodashUniqWith1x1; diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index ee86770a2a..fbb164c4c5 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -1399,35 +1399,33 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const stringIterator = (value: string, index: number, collection: string) => ""; - const listIterator = (value: AbcObject, index: number, collection: _.List) => 0; - const stringIterator2 = (value: string) => ""; - const listIterator2 = (value: AbcObject) => 0; + const stringIterator = (value: string) => ""; + const valueIterator = (value: AbcObject) => 0; _.uniqBy("abc", stringIterator); // $ExpectType string[] - _.uniqBy(list, listIterator); // $ExpectType AbcObject[] + _.uniqBy(list, valueIterator); // $ExpectType AbcObject[] _.uniqBy(list, "a"); // $ExpectType AbcObject[] - _(list).uniqBy(listIterator); // $ExpectType LoDashImplicitWrapper + _(list).uniqBy(valueIterator); // $ExpectType LoDashImplicitWrapper _(list).uniqBy("a"); // $ExpectType LoDashImplicitWrapper - _.chain(list).uniqBy(listIterator); // $ExpectType LoDashExplicitWrapper + _.chain(list).uniqBy(valueIterator); // $ExpectType LoDashExplicitWrapper _.chain(list).uniqBy("a"); // $ExpectType LoDashExplicitWrapper - fp.uniqBy(stringIterator2, "abc"); // $ExpectType string[] - fp.uniqBy(listIterator2, list); // $ExpectType AbcObject[] - fp.uniqBy(listIterator2)(list); // $ExpectType AbcObject[] + fp.uniqBy(stringIterator, "abc"); // $ExpectType string[] + fp.uniqBy(valueIterator, list); // $ExpectType AbcObject[] + fp.uniqBy(valueIterator)(list); // $ExpectType AbcObject[] fp.uniqBy("a", list); // $ExpectType AbcObject[] _.sortedUniqBy("abc", stringIterator); // $ExpectType string[] - _.sortedUniqBy(list, listIterator); // $ExpectType AbcObject[] + _.sortedUniqBy(list, valueIterator); // $ExpectType AbcObject[] _.sortedUniqBy(list, "a"); // $ExpectType AbcObject[] - _(list).sortedUniqBy(listIterator); // $ExpectType LoDashImplicitWrapper + _(list).sortedUniqBy(valueIterator); // $ExpectType LoDashImplicitWrapper _(list).sortedUniqBy("a"); // $ExpectType LoDashImplicitWrapper - _.chain(list).sortedUniqBy(listIterator); // $ExpectType LoDashExplicitWrapper + _.chain(list).sortedUniqBy(valueIterator); // $ExpectType LoDashExplicitWrapper _.chain(list).sortedUniqBy("a"); // $ExpectType LoDashExplicitWrapper - fp.sortedUniqBy(stringIterator2, "abc"); // $ExpectType string[] - fp.sortedUniqBy(listIterator2, list); // $ExpectType AbcObject[] - fp.sortedUniqBy(listIterator2)(list); // $ExpectType AbcObject[] + fp.sortedUniqBy(stringIterator, "abc"); // $ExpectType string[] + fp.sortedUniqBy(valueIterator, list); // $ExpectType AbcObject[] + fp.sortedUniqBy(valueIterator)(list); // $ExpectType AbcObject[] fp.sortedUniqBy("a", list); // $ExpectType AbcObject[] } @@ -1725,26 +1723,24 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; const numericDictionary: _.NumericDictionary | null | undefined = anything; - const stringIterator = (value: string, index: number, collection: string) => 1; - const listIterator = (value: AbcObject, index: number, collection: _.List) => 1; - const dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => 1; - const numericDictionaryIterator = (value: AbcObject, key: string, collection: _.NumericDictionary) => 1; + const stringIterator = (value: string) => 1; + const valueIterator = (value: AbcObject) => 1; _.countBy(""); // $ExpectType Dictionary _.countBy("", stringIterator); // $ExpectType Dictionary _.countBy(list); // $ExpectType Dictionary - _.countBy(list, listIterator); // $ExpectType Dictionary + _.countBy(list, valueIterator); // $ExpectType Dictionary _.countBy(list, ""); // $ExpectType Dictionary _.countBy(list, { a: 42 }); // $ExpectType Dictionary _.countBy(dictionary); // $ExpectType Dictionary - _.countBy(dictionary, dictionaryIterator); // $ExpectType Dictionary + _.countBy(dictionary, valueIterator); // $ExpectType Dictionary _.countBy(dictionary, ""); // $ExpectType Dictionary _.countBy(dictionary, { a: 42 }); // $ExpectType Dictionary _.countBy(numericDictionary); // $ExpectType Dictionary - _.countBy(numericDictionary, numericDictionaryIterator); // $ExpectType Dictionary + _.countBy(numericDictionary, valueIterator); // $ExpectType Dictionary _.countBy(numericDictionary, ""); // $ExpectType Dictionary _.countBy(numericDictionary, { a: 42 }); // $ExpectType Dictionary @@ -1752,17 +1748,17 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper> _(list).countBy(); // $ExpectType LoDashImplicitWrapper> - _(list).countBy(listIterator); // $ExpectType LoDashImplicitWrapper> + _(list).countBy(valueIterator); // $ExpectType LoDashImplicitWrapper> _(list).countBy(""); // $ExpectType LoDashImplicitWrapper> _(list).countBy({ a: 42 }); // $ExpectType LoDashImplicitWrapper> _(dictionary).countBy(); // $ExpectType LoDashImplicitWrapper> - _(dictionary).countBy(dictionaryIterator); // $ExpectType LoDashImplicitWrapper> + _(dictionary).countBy(valueIterator); // $ExpectType LoDashImplicitWrapper> _(dictionary).countBy(""); // $ExpectType LoDashImplicitWrapper> _(dictionary).countBy({ a: 42 }); // $ExpectType LoDashImplicitWrapper> _(numericDictionary).countBy(); // $ExpectType LoDashImplicitWrapper> - _(numericDictionary).countBy(numericDictionaryIterator); // $ExpectType LoDashImplicitWrapper> + _(numericDictionary).countBy(valueIterator); // $ExpectType LoDashImplicitWrapper> _(numericDictionary).countBy(""); // $ExpectType LoDashImplicitWrapper> _(numericDictionary).countBy({ a: 42 }); // $ExpectType LoDashImplicitWrapper> @@ -1770,30 +1766,28 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper> _.chain(list).countBy(); // $ExpectType LoDashExplicitWrapper> - _.chain(list).countBy(listIterator); // $ExpectType LoDashExplicitWrapper> + _.chain(list).countBy(valueIterator); // $ExpectType LoDashExplicitWrapper> _.chain(list).countBy(""); // $ExpectType LoDashExplicitWrapper> _.chain(list).countBy({ a: 42 }); // $ExpectType LoDashExplicitWrapper> _.chain(dictionary).countBy(); // $ExpectType LoDashExplicitWrapper> - _.chain(dictionary).countBy(dictionaryIterator); // $ExpectType LoDashExplicitWrapper> + _.chain(dictionary).countBy(valueIterator); // $ExpectType LoDashExplicitWrapper> _.chain(dictionary).countBy(""); // $ExpectType LoDashExplicitWrapper> _.chain(dictionary).countBy({ a: 42 }); // $ExpectType LoDashExplicitWrapper> _.chain(numericDictionary).countBy(); // $ExpectType LoDashExplicitWrapper> - _.chain(numericDictionary).countBy(numericDictionaryIterator); // $ExpectType LoDashExplicitWrapper> + _.chain(numericDictionary).countBy(valueIterator); // $ExpectType LoDashExplicitWrapper> _.chain(numericDictionary).countBy(""); // $ExpectType LoDashExplicitWrapper> _.chain(numericDictionary).countBy({ a: 42 }); // $ExpectType LoDashExplicitWrapper> - const stringIterator2 = (value: string) => 1; - const listIterator2 = (value: AbcObject) => 1; - fp.countBy(stringIterator2, ""); // $ExpectType Dictionary - fp.countBy(stringIterator2)(""); // $ExpectType Dictionary - fp.countBy(listIterator2, list); // $ExpectType Dictionary + fp.countBy(stringIterator, ""); // $ExpectType Dictionary + fp.countBy(stringIterator)(""); // $ExpectType Dictionary + fp.countBy(valueIterator, list); // $ExpectType Dictionary fp.countBy("", list); // $ExpectType Dictionary fp.countBy({ a: 42 }, list); // $ExpectType Dictionary - fp.countBy(listIterator2, dictionary); // $ExpectType Dictionary + fp.countBy(valueIterator, dictionary); // $ExpectType Dictionary fp.countBy({ a: 42 }, dictionary); // $ExpectType Dictionary - fp.countBy(listIterator2, numericDictionary); // $ExpectType Dictionary + fp.countBy(valueIterator, numericDictionary); // $ExpectType Dictionary fp.countBy({ a: 42 }, numericDictionary); // $ExpectType Dictionary } @@ -2656,41 +2650,39 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = [] as any; const dictionary: _.Dictionary | null | undefined = anything; - const stringIterator = (char: string, index: number, string: string) => 0; - const listIterator = (value: AbcObject, index: number, collection: _.List) => 0; - const dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => 0; + const stringIterator = (char: string) => 0; const valueIterator = (value: AbcObject) => 0; _.groupBy(""); // $ExpectType Dictionary _.groupBy("", stringIterator); // $ExpectType Dictionary _.groupBy(list); // $ExpectType Dictionary - _.groupBy(list, listIterator); // $ExpectType Dictionary + _.groupBy(list, valueIterator); // $ExpectType Dictionary _.groupBy(list, "a"); // $ExpectType Dictionary _.groupBy(list, { a: 42 }); // $ExpectType Dictionary _.groupBy(dictionary); // $ExpectType Dictionary - _.groupBy(dictionary, dictionaryIterator); // $ExpectType Dictionary + _.groupBy(dictionary, valueIterator); // $ExpectType Dictionary _.groupBy(dictionary, ""); // $ExpectType Dictionary _.groupBy(dictionary, { a: 42 }); // $ExpectType Dictionary _("").groupBy(); // $ExpectType LoDashImplicitWrapper> - _("").groupBy((char: string, index: number, string: ArrayLike) => 0); // $ExpectType LoDashImplicitWrapper> + _("").groupBy(stringIterator); // $ExpectType LoDashImplicitWrapper> _(list).groupBy(); // $ExpectType LoDashImplicitWrapper> - _(list).groupBy(listIterator); // $ExpectType LoDashImplicitWrapper> + _(list).groupBy(valueIterator); // $ExpectType LoDashImplicitWrapper> _(list).groupBy(""); // $ExpectType LoDashImplicitWrapper> _(list).groupBy({ a: 42 }); // $ExpectType LoDashImplicitWrapper> _(dictionary).groupBy(); // $ExpectType LoDashImplicitWrapper> - _(dictionary).groupBy(dictionaryIterator); // $ExpectType LoDashImplicitWrapper> + _(dictionary).groupBy(valueIterator); // $ExpectType LoDashImplicitWrapper> _(dictionary).groupBy(""); // $ExpectType LoDashImplicitWrapper> _(dictionary).groupBy({ a: 42 }); // $ExpectType LoDashImplicitWrapper> _.chain("").groupBy(); // $ExpectType LoDashExplicitWrapper> - _.chain("").groupBy((char: string, index: number, string: ArrayLike) => 0); // $ExpectType LoDashExplicitWrapper> + _.chain("").groupBy(stringIterator); // $ExpectType LoDashExplicitWrapper> _.chain(list).groupBy(); // $ExpectType LoDashExplicitWrapper> - _.chain(list).groupBy(listIterator); // $ExpectType LoDashExplicitWrapper> + _.chain(list).groupBy(valueIterator); // $ExpectType LoDashExplicitWrapper> _.chain(list).groupBy(""); // $ExpectType LoDashExplicitWrapper> _.chain(list).groupBy({ a: 42 }); // $ExpectType LoDashExplicitWrapper> _.chain(dictionary).groupBy(); // $ExpectType LoDashExplicitWrapper> - _.chain(dictionary).groupBy(dictionaryIterator); // $ExpectType LoDashExplicitWrapper> + _.chain(dictionary).groupBy(valueIterator); // $ExpectType LoDashExplicitWrapper> _.chain(dictionary).groupBy(""); // $ExpectType LoDashExplicitWrapper> _.chain(dictionary).groupBy({ a: 42 }); // $ExpectType LoDashExplicitWrapper> @@ -2741,57 +2733,54 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; const numericDictionary: _.NumericDictionary | null | undefined = anything; - const stringIterator = (value: string, index: number, collection: string) => "a"; - const listIterator = (value: AbcObject, index: number, collection: _.List) => 1; - const dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => Symbol.name; - const numericDictionaryIterator = (value: AbcObject, key: string, collection: _.NumericDictionary) => "a"; + const stringIterator = (value: string) => "a"; const valueIterator = (value: AbcObject) => 1; _.keyBy("abcd"); // $ExpectType Dictionary _.keyBy("abcd", stringIterator); // $ExpectType Dictionary _.keyBy(list); // $ExpectType Dictionary - _.keyBy(list, listIterator); // $ExpectType Dictionary + _.keyBy(list, valueIterator); // $ExpectType Dictionary _.keyBy(list, "a"); // $ExpectType Dictionary _.keyBy(list, { a: 42 }); // $ExpectType Dictionary _.keyBy(dictionary); // $ExpectType Dictionary - _.keyBy(dictionary, dictionaryIterator); // $ExpectType Dictionary + _.keyBy(dictionary, valueIterator); // $ExpectType Dictionary _.keyBy(dictionary, "a"); // $ExpectType Dictionary _.keyBy(dictionary, { a: 42 }); // $ExpectType Dictionary // These fail in TS 2.4 // _.keyBy(numericDictionary); // Dictionary - // _.keyBy(numericDictionary, numericDictionaryIterator); // Dictionary + // _.keyBy(numericDictionary, valueIterator); // Dictionary // _.keyBy(numericDictionary, "a"); // Dictionary // _.keyBy(numericDictionary, { a: 42 }); // Dictionary _("abcd").keyBy(); // $ExpectType LoDashImplicitWrapper> _("abcd").keyBy(stringIterator); // $ExpectType LoDashImplicitWrapper> _(list).keyBy(); // $ExpectType LoDashImplicitWrapper> - _(list).keyBy(listIterator); // $ExpectType LoDashImplicitWrapper> + _(list).keyBy(valueIterator); // $ExpectType LoDashImplicitWrapper> _(list).keyBy("a"); // $ExpectType LoDashImplicitWrapper> _(list).keyBy({ a: 42 }); // $ExpectType LoDashImplicitWrapper> _(dictionary).keyBy(); // $ExpectType LoDashImplicitWrapper> - _(dictionary).keyBy(dictionaryIterator); // $ExpectType LoDashImplicitWrapper> + _(dictionary).keyBy(valueIterator); // $ExpectType LoDashImplicitWrapper> _(dictionary).keyBy("a"); // $ExpectType LoDashImplicitWrapper> _(dictionary).keyBy({ a: 42 }); // $ExpectType LoDashImplicitWrapper> // These fail in TS 2.4 // _(numericDictionary).keyBy(); // LoDashImplicitWrapper> - // _(numericDictionary).keyBy(numericDictionaryIterator); // LoDashImplicitWrapper> + // _(numericDictionary).keyBy(valueIterator); // LoDashImplicitWrapper> // _(numericDictionary).keyBy("a"); // LoDashImplicitWrapper> // _(numericDictionary).keyBy({ a: 42 }); // LoDashImplicitWrapper> _.chain("abcd").keyBy(); // $ExpectType LoDashExplicitWrapper> _.chain("abcd").keyBy(stringIterator); // $ExpectType LoDashExplicitWrapper> _.chain(list).keyBy(); // $ExpectType LoDashExplicitWrapper> - _.chain(list).keyBy(listIterator); // $ExpectType LoDashExplicitWrapper> + _.chain(list).keyBy(valueIterator); // $ExpectType LoDashExplicitWrapper> _.chain(list).keyBy("a"); // $ExpectType LoDashExplicitWrapper> _.chain(list).keyBy({ a: 42 }); // $ExpectType LoDashExplicitWrapper> _.chain(dictionary).keyBy(); // $ExpectType LoDashExplicitWrapper> - _.chain(dictionary).keyBy(dictionaryIterator); // $ExpectType LoDashExplicitWrapper> + _.chain(dictionary).keyBy(valueIterator); // $ExpectType LoDashExplicitWrapper> _.chain(dictionary).keyBy("a"); // $ExpectType LoDashExplicitWrapper> _.chain(dictionary).keyBy({ a: 42 }); // $ExpectType LoDashExplicitWrapper> // These fail in TS 2.4 // _.chain(numericDictionary).keyBy(); // LoDashExplicitWrapper> - // _.chain(numericDictionary).keyBy(numericDictionaryIterator); // LoDashExplicitWrapper> + // _.chain(numericDictionary).keyBy(valueIterator); // LoDashExplicitWrapper> // _.chain(numericDictionary).keyBy("a"); // LoDashExplicitWrapper> // _.chain(numericDictionary).keyBy({ a: 42 }); // LoDashExplicitWrapper> @@ -3085,27 +3074,34 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper sum + num); // $ExpectType number | undefined + // $ExpectType number | undefined + _.reduce([1, 2, 3], (sum, curr, key, coll) => { + sum; // $ExpectType number + curr; // $ExpectType number + key; // $ExpectType number + coll; // $ExpectType number[] + return sum + curr; + }); _.reduce(null, (sum: number, num: number) => sum + num); // $ExpectType number | undefined _.reduce({ a: 1, b: 2, c: 3 }, (r: ABC, num: number, key: string) => r, initial); // $ExpectType ABC - _([1, 2, 3]).reduce((sum: number, num: number) => sum + num); // $ExpectType number | undefined + _([1, 2, 3]).reduce((sum, num) => sum + num); // $ExpectType number | undefined _({ a: 1, b: 2, c: 3 }).reduce((r: ABC, num: number, key: string) => r, initial); // $ExpectType ABC - _.chain([1, 2, 3]).reduce((sum: number, num: number) => sum + num); // $ExpectType LoDashExplicitWrapper + _.chain([1, 2, 3]).reduce((sum, num) => sum + num); // $ExpectType LoDashExplicitWrapper _.chain({ a: 1, b: 2, c: 3 }).reduce((r: ABC, num: number, key: string) => r, initial); // $ExpectType LoDashExplicitWrapper fp.reduce((s: string, num: number) => s + num, "", [1, 2, 3]); // $ExpectType string fp.reduce((s: string, num: number) => s + num)("")([1, 2, 3]); // $ExpectType string - _.reduceRight([1, 2, 3], (sum: number, num: number) => sum + num); // $ExpectType number | undefined + _.reduceRight([1, 2, 3], (sum, num) => sum + num); // $ExpectType number | undefined _.reduceRight(null, (sum: number, num: number) => sum + num); // $ExpectType number | undefined _.reduceRight({ a: 1, b: 2, c: 3 }, (r: ABC, num: number, key: string) => r, initial); // $ExpectType ABC - _([1, 2, 3]).reduceRight((sum: number, num: number) => sum + num); // $ExpectType number | undefined + _([1, 2, 3]).reduceRight((sum, num) => sum + num); // $ExpectType number | undefined _({ a: 1, b: 2, c: 3 }).reduceRight((r: ABC, num: number, key: string) => r, initial); // $ExpectType ABC - _.chain([1, 2, 3]).reduceRight((sum: number, num: number) => sum + num); // $ExpectType LoDashExplicitWrapper + _.chain([1, 2, 3]).reduceRight((sum, num) => sum + num); // $ExpectType LoDashExplicitWrapper _.chain({ a: 1, b: 2, c: 3 }).reduceRight((r: ABC, num: number, key: string) => r, initial); // $ExpectType LoDashExplicitWrapper fp.reduceRight((num: number, s: string) => s + num, "", [1, 2, 3]); // $ExpectType string @@ -4886,29 +4882,28 @@ fp.now(); // $ExpectType number { const list: ArrayLike = anything; - const listIterator = (value: AbcObject, index: number, collection: ArrayLike) => 0; const valueIterator = (value: AbcObject) => 0; - _.maxBy(list, listIterator); // $ExpectType AbcObject | undefined + _.maxBy(list, valueIterator); // $ExpectType AbcObject | undefined _.maxBy(list, "a"); // $ExpectType AbcObject | undefined _.maxBy(list, { a: 42 }); // $ExpectType AbcObject | undefined - _(list).maxBy(listIterator); // $ExpectType AbcObject | undefined + _(list).maxBy(valueIterator); // $ExpectType AbcObject | undefined _(list).maxBy("a"); // $ExpectType AbcObject | undefined _(list).maxBy({ a: 42 }); // $ExpectType AbcObject | undefined - _.chain(list).maxBy(listIterator); // $ExpectType LoDashExplicitWrapper + _.chain(list).maxBy(valueIterator); // $ExpectType LoDashExplicitWrapper _.chain(list).maxBy("a"); // $ExpectType LoDashExplicitWrapper _.chain(list).maxBy({ a: 42 }); // $ExpectType LoDashExplicitWrapper fp.maxBy(valueIterator)(list); // $ExpectType AbcObject | undefined fp.maxBy("a", list); // $ExpectType AbcObject | undefined fp.maxBy({ a: 42 }, list); // $ExpectType AbcObject | undefined - _.minBy(list, listIterator); // $ExpectType AbcObject | undefined + _.minBy(list, valueIterator); // $ExpectType AbcObject | undefined _.minBy(list, "a"); // $ExpectType AbcObject | undefined _.minBy(list, { a: 42 }); // $ExpectType AbcObject | undefined - _(list).minBy(listIterator); // $ExpectType AbcObject | undefined + _(list).minBy(valueIterator); // $ExpectType AbcObject | undefined _(list).minBy("a"); // $ExpectType AbcObject | undefined _(list).minBy({ a: 42 }); // $ExpectType AbcObject | undefined - _.chain(list).minBy(listIterator); // $ExpectType LoDashExplicitWrapper + _.chain(list).minBy(valueIterator); // $ExpectType LoDashExplicitWrapper _.chain(list).minBy("a"); // $ExpectType LoDashExplicitWrapper _.chain(list).minBy({ a: 42 }); // $ExpectType LoDashExplicitWrapper fp.minBy(valueIterator)(list); // $ExpectType AbcObject | undefined @@ -7139,10 +7134,10 @@ fp.now(); // $ExpectType number // _.stubFalse { - _.stubFalse(); // $ExpectType boolean - _(anything).stubFalse(); // $ExpectType boolean - _.chain(anything).stubFalse(); // $ExpectType LoDashExplicitWrapper - fp.stubFalse(); // $ExpectType boolean + _.stubFalse(); // $ExpectType false + _(anything).stubFalse(); // $ExpectType false + _.chain(anything).stubFalse(); // $ExpectType LoDashExplicitWrapper + fp.stubFalse(); // $ExpectType false } // _.stubObject @@ -7163,10 +7158,10 @@ fp.now(); // $ExpectType number // _.stubTrue { - _.stubTrue(); // $ExpectType boolean - _(anything).stubTrue(); // $ExpectType boolean - _.chain(anything).stubTrue(); // $ExpectType LoDashExplicitWrapper - fp.stubTrue(); // $ExpectType boolean + _.stubTrue(); // $ExpectType true + _(anything).stubTrue(); // $ExpectType true + _.chain(anything).stubTrue(); // $ExpectType LoDashExplicitWrapper + fp.stubTrue(); // $ExpectType true } // _.times diff --git a/types/lodash/readme.md b/types/lodash/readme.md index d65d7f878f..e605e30784 100644 --- a/types/lodash/readme.md +++ b/types/lodash/readme.md @@ -18,7 +18,7 @@ You should not modify these scripts directly - you should use a script to re-generate them (see below). - `scripts` directory: contains code generation scripts. - Before running any scripts, run `npm install` in this directory (it contains its own `package.json`). - - Most notable script is `npm run fp`, which re-generates all of the `fp` files. + - Most notable script is `npm run generate`, which re-generates all of the `fp` files and `lowdb` wrapper extensions. - `v3` directory: contains types for lodash v3. ## Different ways people might use lodash @@ -38,7 +38,7 @@ ## Before creating a PR - For every function you modify, don't forget to update the corresponding wrapper functions. -- Re-generate the `fp` types by opening a terminal in the `scripts` directory and running `npm run fp`. +- Re-generate the `fp` types by opening a terminal in the `scripts` directory and running `npm run generate`. - Note that this directory has its own `package.json`, so you'll need to run `npm install` first if you haven't already. - Back at the root directory, do `npm run lint lodash` and make sure there are no errors. diff --git a/types/lodash/scripts/generate-fp.ts b/types/lodash/scripts/generate-fp.ts index 3b8320b59c..77f11b46ac 100644 --- a/types/lodash/scripts/generate-fp.ts +++ b/types/lodash/scripts/generate-fp.ts @@ -13,6 +13,7 @@ import fs from "fs"; import _ from "lodash"; import convert from "lodash/fp/convert"; import path from "path"; +import { readFile, getLineBreak, tab, getLineNumber } from "./utils"; interface Definition { name: string; @@ -45,10 +46,8 @@ interface TypeParam { let lineBreak = "\n"; async function main() { + lineBreak = await getLineBreak(); const commonTypes: string[] = []; - const tsconfigPath = path.join("..", "tsconfig.json"); - const tsconfigFile = await readFile(tsconfigPath); - lineBreak = _.find(["\r\n", "\n", "\r"], x => tsconfigFile.includes(x)) || "\n"; // Read each function definition and fp-ify it const subfolders = ["common"]; @@ -106,7 +105,7 @@ async function main() { const fpFile = [ "// AUTO-GENERATED: do not modify this file directly.", "// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do:", - "// npm run fp", + "// npm install && npm run generate", "", 'import lodash = require("./index");', "", @@ -130,6 +129,8 @@ async function main() { }); // Make sure the generated files are listed in tsconfig.json, so they are included in the lint checks + const tsconfigPath = path.join("..", "tsconfig.json"); + const tsconfigFile = await readFile(tsconfigPath); const tsconfig = tsconfigFile.split(lineBreak).filter(row => !row.includes("fp/") || row.includes("fp/convert.d.ts")); const newRows = interfaceGroups.map(g => ` "fp/${g.functionName}.d.ts",`) .concat(["__", "placeholder"].map(p => ` "fp/${p}.d.ts",`)); @@ -146,22 +147,6 @@ async function main() { }); } -function readFile(filePath: string): Promise { - return new Promise((resolve, reject) => { - fs.readFile(filePath, "utf8", (err, data) => { - if (err) { - reject(err); - return; - } - try { - resolve(data); - } catch (e) { - reject(e); - } - }); - }); -} - async function processDefinitions(filePaths: string[], commonTypes: string[]): Promise { const builder: { [name: string]: (...args: number[][]) => () => Interface[] } = {}; const unconvertedBuilder: { [name: string]: (...args: number[][]) => () => Interface[] } = {}; @@ -255,7 +240,6 @@ async function parseFile(filePath: string, commonTypes: string[]): Promise !_.isEmpty(d.constants)); return definitons; } @@ -899,15 +883,6 @@ function getPreviousLine(s: string, index: number): string { return s.substring(bol + 1, eol); } -function getLineNumber(fileContents: string, index: number) { - return fileContents.substring(0, index).split(lineBreak).length + 1; -} - -function tab(s: string, count: number) { - const prepend: string = " ".repeat(count * 4); - return (s[0] === "\n" || s[0] === "\r" ? "" : prepend) + s.replace(/(?:\r\n|\n|\r)(.)/g, `${lineBreak}${prepend}$1`); -} - function indexOfAny(source: string, values: string[], position?: number): number { const indexes: number[] = []; for (const value of values) { diff --git a/types/lodash/scripts/generate-lowdb.ts b/types/lodash/scripts/generate-lowdb.ts new file mode 100644 index 0000000000..13fbd18fe4 --- /dev/null +++ b/types/lodash/scripts/generate-lowdb.ts @@ -0,0 +1,165 @@ +// Script for converting the lodash types into functional programming (FP) format. +// The convertion is done based on this guide: https://github.com/lodash/lodash/wiki/FP-Guide + +// Assumptions: +// - All functions are defined in one of the files in the "common" subfolder +// - All functions are defined inside of the LoDashStatic interface (although functions like _.partial may refer to another interface in the same file) +// - Consistent indentation is used for the start and end of the above interface +// - Consistent spacing is used for interface definitions: interface MyInterface { +// - Consistent line breaks (\n, \r, or \r\n) are used in all files +// - All overloads of a given function are defined in the same file + +import fs from "fs"; +import _ from "lodash"; +import path from "path"; +import { getLineBreak, getLineNumber } from "./utils"; + +interface Definition { + name: string; + overloads: Overload[]; + constants: string[]; + jsdoc: string; +} +interface InterfaceGroup { + functionName: string; + interfaces: Interface[]; +} +interface Interface { + name: string; + typeParams: TypeParam[]; + overloads: Overload[]; + constants: string[]; +} +interface Overload { + typeParams: TypeParam[]; + params: string[]; + returnType: string; + jsdoc: string; + tslintDisable?: string; +} +interface TypeParam { + name: string; + extends?: string; + equals?: string; +} + +// Get the correct line break for the current OS (git for windows will generally convert \n to \r\n during checkout) +let lineBreak = "\n"; +async function main() { + lineBreak = await getLineBreak(); + const commonTypes: string[] = []; + const tsconfigPath = path.join("..", "tsconfig.json"); + + const subfolders = ["common"]; + const promises: Array> = []; + for (const subfolder of subfolders) { + promises.push(new Promise((resolve, reject) => { + fs.readdir(path.join("..", subfolder), (err, files) => { + if (err) { + console.error(`failed to list directory contents for '${subfolder}': `, err); + reject(err); + return; + } + const filePaths = files.map(f => path.join("..", subfolder, f)); + try { + resolve(processDefinitions(filePaths, commonTypes)); + } catch (e) { + console.error(`failed to process files in '${subfolder}': `, e); + reject(e); + } + }); + })); + } + + let functions: string; + try { + functions = _.flatten(await Promise.all(promises)).join(lineBreak); + } catch (err) { + console.error("Failed to parse all functions: ", err); + return; + } + _.pull(commonTypes, "LoDashExplicitWrapper"); + const commonTypeSearch = new RegExp(`\\b(${commonTypes.join("|")})\\b`, "g"); + functions = functions.replace(commonTypeSearch, "_.$1"); + const syncFunctions = functions.replace(/\bLoDashExplicitWrapper\b/g, "LoDashExplicitSyncWrapper"); + const asyncFunctions = functions.replace(/\bLoDashExplicitWrapper\b/g, "LoDashExplicitAsyncWrapper"); + + const lodashFile = [ + "// AUTO-GENERATED: do not modify this file directly.", + "// If you need to make changes, modify types/lodash/scripts/generate-lowdb.ts (if necessary), then open a terminal in types/lodash/scripts, and do:", + "// npm install && npm run generate", + "", + 'import _ = require("lodash");', + 'declare module "./index" {', + " interface LoDashExplicitSyncWrapper {", + syncFunctions, // TODO: write sync? + " }", + "", + " interface LoDashExplicitAsyncWrapper {", + asyncFunctions, // TODO: write async? + " }", + "}", + "", + ].join(lineBreak); + const lodashFilePath = path.resolve(__dirname, "..", "..", "lowdb", "_lodash.d.ts"); + fs.writeFile(lodashFilePath, lodashFile, (err) => { + if (err) + console.error(`Failed to write ${lodashFilePath}: `, err); + }); +} + +function readFile(filePath: string): Promise { + return new Promise((resolve, reject) => { + fs.readFile(filePath, "utf8", (err, data) => { + if (err) { + reject(err); + return; + } + try { + resolve(data); + } catch (e) { + reject(e); + } + }); + }); +} + +async function processDefinitions(filePaths: string[], commonTypes: string[]): Promise { + const functions: string[] = []; + for (const filePath of filePaths) + functions.push(...await parseFile(filePath, commonTypes)); + return functions; +} + +async function parseFile(filePath: string, commonTypes: string[]): Promise { + const definitionString = await readFile(filePath); + const newCommonTypeRegExp = / (?:type|interface) ([A-Za-z0-9_]+)/g; + let newCommonType = newCommonTypeRegExp.exec(definitionString); + while (newCommonType) { + if (!commonTypes.includes(newCommonType[1])) + commonTypes.push(newCommonType[1]); + newCommonType = newCommonTypeRegExp.exec(definitionString); + } + + const functions: string[] = []; + const lodashWrapperRegExp = /( *)interface +LoDashExplicitWrapper<\w+> *(?:extends .+)? *{/g; + let lodashWrapperMatch = lodashWrapperRegExp.exec(definitionString); + while (lodashWrapperMatch) { + const startIndex = definitionString.indexOf(lineBreak, lodashWrapperMatch.index) + lineBreak.length; + const endIndex = definitionString.indexOf(`${lineBreak}${lodashWrapperMatch[1]}}`, startIndex); + if (endIndex === -1) { + const lineNumber = getLineNumber(definitionString, startIndex); + console.warn(`Failed to find end of interface 'LoDashExplicitWrapper' (starting at ${filePath} line ${lineNumber}).`); + break; + } + let functionString = definitionString.substring(startIndex, endIndex); + // Remove comments since they're generally useless (e.g. @see XXXX) + functionString = functionString.replace(/ *\/\*\*[\s\S]+?\*\/(?:\r\n|\n|\r)/g, ""); + functionString = functionString.replace(/(?:(\r\n){2,}|(\n){2,}|(\r){2,})/g, "$1$2$3"); + functions.push(functionString); + lodashWrapperMatch = lodashWrapperRegExp.exec(definitionString); + } + return functions; +} + +main(); diff --git a/types/lodash/scripts/package.json b/types/lodash/scripts/package.json index f98c233642..a91ecd226e 100644 --- a/types/lodash/scripts/package.json +++ b/types/lodash/scripts/package.json @@ -3,7 +3,9 @@ "name": "lodash-scripts", "version": "0.0.1", "scripts": { - "fp": "ts-node generate-fp" + "generate": "ts-node generate-fp && ts-node generate-lowdb", + "fp": "ts-node generate-fp", + "lowdb": "ts-node generate-lowdb" }, "devDependencies": { "lodash": "^4.17.4", diff --git a/types/lodash/scripts/utils.ts b/types/lodash/scripts/utils.ts new file mode 100644 index 0000000000..59bdd448a9 --- /dev/null +++ b/types/lodash/scripts/utils.ts @@ -0,0 +1,38 @@ +import fs from "fs"; +import _ from "lodash"; +import path from "path"; + +export function readFile(filePath: string): Promise { + return new Promise((resolve, reject) => { + fs.readFile(filePath, "utf8", (err, data) => { + if (err) { + reject(err); + return; + } + try { + resolve(data); + } catch (e) { + reject(e); + } + }); + }); +} + +let lineBreak = "\n"; + +/** Gets the correct line break for the current OS (git for windows will generally convert \n to \r\n during checkout) */ +export async function getLineBreak(): Promise { + const tsconfigPath = path.join("..", "tsconfig.json"); + const tsconfigFile = await readFile(tsconfigPath); + lineBreak = _.find(["\r\n", "\n", "\r"], x => tsconfigFile.includes(x)) || "\n"; + return lineBreak; +} + +export function getLineNumber(fileContents: string, index: number) { + return fileContents.substring(0, index).split(/\r\n|\n|\r/g).length + 1; +} + +export function tab(s: string, count: number) { + const prepend: string = " ".repeat(count * 4); + return (s[0] === "\n" || s[0] === "\r" ? "" : prepend) + s.replace(/(?:\r\n|\n|\r)(.)/g, `${lineBreak}${prepend}$1`); +} diff --git a/types/lowdb/_lodash.d.ts b/types/lowdb/_lodash.d.ts new file mode 100644 index 0000000000..78ff4901af --- /dev/null +++ b/types/lowdb/_lodash.d.ts @@ -0,0 +1,3134 @@ +// AUTO-GENERATED: do not modify this file directly. +// If you need to make changes, modify types/lodash/scripts/generate-lowdb.ts (if necessary), then open a terminal in types/lodash/scripts, and do: +// npm install && npm run generate + +import _ = require("lodash"); +declare module "./index" { + interface LoDashExplicitSyncWrapper { + chunk( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + size?: number, + ): LoDashExplicitSyncWrapper; + compact(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + concat(this: LoDashExplicitSyncWrapper<_.Many>, ...values: Array<_.Many>): LoDashExplicitSyncWrapper; + difference( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...values: Array<_.List> + ): LoDashExplicitSyncWrapper; + differenceBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + differenceBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + differenceBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + values3: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + differenceBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + values3: _.List, + values4: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + differenceBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + values3: _.List, + values4: _.List, + values5: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + differenceBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + values3: _.List, + values4: _.List, + values5: _.List, + ...values: Array<_.List | _.ValueIteratee> + ): LoDashExplicitSyncWrapper; + differenceBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...values: Array<_.List> + ): LoDashExplicitSyncWrapper; + differenceWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values: _.List, + comparator: _.Comparator2 + ): LoDashExplicitSyncWrapper; + differenceWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + comparator: _.Comparator2 + ): LoDashExplicitSyncWrapper; + differenceWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + ...values: Array<_.List | _.Comparator2> + ): LoDashExplicitSyncWrapper; + differenceWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...values: Array<_.List> + ): LoDashExplicitSyncWrapper; + drop(this: LoDashExplicitSyncWrapper<_.List | null | undefined>, n?: number): LoDashExplicitSyncWrapper; + dropRight(this: LoDashExplicitSyncWrapper<_.List | null | undefined>, n?: number): LoDashExplicitSyncWrapper; + dropRightWhile( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIteratee + ): LoDashExplicitSyncWrapper; + dropWhile( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIteratee + ): LoDashExplicitSyncWrapper; + fill( + this: LoDashExplicitSyncWrapper, + value: T + ): LoDashExplicitSyncWrapper; + fill( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitSyncWrapper<_.List>; + fill( + this: LoDashExplicitSyncWrapper, + value: T, + start?: number, + end?: number + ): LoDashExplicitSyncWrapper>; + fill( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T, + start?: number, + end?: number + ): LoDashExplicitSyncWrapper<_.List>; + findIndex( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + findLastIndex( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + first(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + flatten(this: LoDashExplicitSyncWrapper<_.List<_.Many> | null | undefined>): LoDashExplicitSyncWrapper; + flattenDeep(this: LoDashExplicitSyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>): LoDashExplicitSyncWrapper; + flattenDepth(this: LoDashExplicitSyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>, depth?: number): LoDashExplicitSyncWrapper; + fromPairs( + this: LoDashExplicitSyncWrapper<_.List<[_.PropertyName, T]> | null | undefined> + ): LoDashExplicitSyncWrapper<_.Dictionary>; + fromPairs( + this: LoDashExplicitSyncWrapper<_.List | null | undefined> + ): LoDashExplicitSyncWrapper<_.Dictionary>; + head(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + indexOf( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + initial(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + intersection( + this: LoDashExplicitSyncWrapper<_.List>, + ...arrays: Array<_.List> + ): LoDashExplicitSyncWrapper; + intersectionBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + intersectionBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + intersectionBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + ...values: Array<_.List | _.ValueIteratee> + ): LoDashExplicitSyncWrapper; + intersectionBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...values: Array<_.List> + ): LoDashExplicitSyncWrapper; + intersectionWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values: _.List, + comparator: _.Comparator2 + ): LoDashExplicitSyncWrapper; + intersectionWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + comparator: _.Comparator2 + ): LoDashExplicitSyncWrapper; + intersectionWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + ...values: Array<_.List | _.Comparator2> + ): LoDashExplicitSyncWrapper; + intersectionWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...values: Array<_.List> + ): LoDashExplicitSyncWrapper; + join(separator?: string): LoDashExplicitSyncWrapper; + last(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + lastIndexOf( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T, + fromIndex?: true|number + ): LoDashExplicitSyncWrapper; + nth( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + n?: number + ): LoDashExplicitSyncWrapper; + pull( + this: LoDashExplicitSyncWrapper<_.List>, + ...values: T[] + ): this; + pullAll( + this: LoDashExplicitSyncWrapper<_.List>, + values?: _.List + ): this; + remove( + this: LoDashExplicitSyncWrapper<_.List>, + predicate?: _.ListIteratee + ): LoDashExplicitSyncWrapper; + slice( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + start?: number, + end?: number + ): LoDashExplicitSyncWrapper; + sortedIndex( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitSyncWrapper; + sortedIndex( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitSyncWrapper; + sortedIndexBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + sortedIndexOf( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitSyncWrapper; + sortedLastIndex( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitSyncWrapper; + sortedLastIndexBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T, + iteratee: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + sortedLastIndexOf( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitSyncWrapper; + sortedUniq(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + sortedUniqBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + tail(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + take( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + n?: number + ): LoDashExplicitSyncWrapper; + takeRight( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + n?: number + ): LoDashExplicitSyncWrapper; + takeRightWhile( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIteratee + ): LoDashExplicitSyncWrapper; + takeWhile( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIteratee + ): LoDashExplicitSyncWrapper; + union( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...arrays: Array<_.List | null | undefined> + ): LoDashExplicitSyncWrapper; + unionBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + unionBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + unionBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + unionBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + arrays4: _.List | null | undefined, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + unionBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + arrays4: _.List | null | undefined, + arrays5: _.List | null | undefined, + ...iteratee: Array<_.ValueIteratee | _.List | null | undefined> + ): LoDashExplicitSyncWrapper; + unionWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + comparator?: _.Comparator + ): LoDashExplicitSyncWrapper; + unionWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + comparator?: _.Comparator + ): LoDashExplicitSyncWrapper; + unionWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + ...comparator: Array<_.Comparator | _.List | null | undefined> + ): LoDashExplicitSyncWrapper; + uniq(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + uniqBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + uniqWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + comparator?: _.Comparator + ): LoDashExplicitSyncWrapper; + unzip(this: LoDashExplicitSyncWrapper> | null | undefined>): LoDashExplicitSyncWrapper; + unzipWith( + this: LoDashExplicitSyncWrapper<_.List<_.List> | null | undefined>, + iteratee: (...values: T[]) => TResult + ): LoDashExplicitSyncWrapper; + unzipWith( + this: LoDashExplicitSyncWrapper<_.List<_.List> | null | undefined> + ): LoDashExplicitSyncWrapper; + without( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...values: T[] + ): LoDashExplicitSyncWrapper; + xor( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...arrays: Array<_.List | null | undefined> + ): LoDashExplicitSyncWrapper; + xorBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + xorBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + xorBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + ...iteratee: Array<_.ValueIteratee | _.List | null | undefined> + ): LoDashExplicitSyncWrapper; + xorWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + comparator?: _.Comparator + ): LoDashExplicitSyncWrapper; + xorWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + comparator?: _.Comparator + ): LoDashExplicitSyncWrapper; + xorWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + ...comparator: Array<_.Comparator | _.List | null | undefined> + ): LoDashExplicitSyncWrapper; + zip( + this: LoDashExplicitSyncWrapper<_.List>, + arrays2: _.List, + ): LoDashExplicitSyncWrapper>; + zip( + this: LoDashExplicitSyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + ): LoDashExplicitSyncWrapper>; + zip( + this: LoDashExplicitSyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + arrays4: _.List, + ): LoDashExplicitSyncWrapper>; + zip( + this: LoDashExplicitSyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + arrays4: _.List, + arrays5: _.List, + ): LoDashExplicitSyncWrapper>; + zip( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...arrays: Array<_.List | null | undefined> + ): LoDashExplicitSyncWrapper>>; + zipObject( + this: LoDashExplicitSyncWrapper<_.List<_.PropertyName>>, + values: _.List + ): LoDashExplicitSyncWrapper<_.Dictionary>; + zipObject( + this: LoDashExplicitSyncWrapper<_.List<_.PropertyName>> + ): LoDashExplicitSyncWrapper<_.Dictionary>; + zipObjectDeep( + this: LoDashExplicitSyncWrapper<_.List<_.PropertyPath>>, + values?: _.List + ): LoDashExplicitSyncWrapper; + zipWith( + this: LoDashExplicitSyncWrapper<_.List>, + iteratee: (value1: T) => TResult + ): LoDashExplicitSyncWrapper; + zipWith( + this: LoDashExplicitSyncWrapper<_.List>, + arrays2: _.List, + iteratee: (value1: T1, value2: T2) => TResult + ): LoDashExplicitSyncWrapper; + zipWith( + this: LoDashExplicitSyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + iteratee: (value1: T1, value2: T2, value3: T3) => TResult + ): LoDashExplicitSyncWrapper; + zipWith( + this: LoDashExplicitSyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + arrays4: _.List, + iteratee: (value1: T1, value2: T2, value3: T3, value4: T4) => TResult + ): LoDashExplicitSyncWrapper; + zipWith( + this: LoDashExplicitSyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + arrays4: _.List, + arrays5: _.List, + iteratee: (value1: T1, value2: T2, value3: T3, value4: T4, value5: T5) => TResult + ): LoDashExplicitSyncWrapper; + zipWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...iteratee: Array<((...group: T[]) => TResult) | _.List | null | undefined> + ): LoDashExplicitSyncWrapper; + countBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper<_.Dictionary>; + countBy( + this: LoDashExplicitSyncWrapper, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper<_.Dictionary>; + every( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom + ): LoDashExplicitSyncWrapper; + every( + this: LoDashExplicitSyncWrapper, + predicate?: _.ObjectIterateeCustom + ): LoDashExplicitSyncWrapper; + filter( + this: LoDashExplicitSyncWrapper, + predicate?: _.StringIterator + ): LoDashExplicitSyncWrapper; + filter( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate: _.ListIteratorTypeGuard + ): LoDashExplicitSyncWrapper; + filter( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom + ): LoDashExplicitSyncWrapper; + filter( + this: LoDashExplicitSyncWrapper, + predicate: _.ObjectIteratorTypeGuard + ): LoDashExplicitSyncWrapper; + filter( + this: LoDashExplicitSyncWrapper, + predicate?: _.ObjectIterateeCustom + ): LoDashExplicitSyncWrapper>; + find( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate: _.ListIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + find( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + find( + this: LoDashExplicitSyncWrapper, + predicate: _.ObjectIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + find( + this: LoDashExplicitSyncWrapper, + predicate?: _.ObjectIterateeCustom, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + findLast( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate: _.ListIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + findLast( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + findLast( + this: LoDashExplicitSyncWrapper, + predicate: _.ObjectIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + findLast( + this: LoDashExplicitSyncWrapper, + predicate?: _.ObjectIterateeCustom, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + flatMap(this: LoDashExplicitSyncWrapper<_.List<_.Many> | _.Dictionary<_.Many> | _.NumericDictionary<_.Many> | null | undefined>): LoDashExplicitSyncWrapper; + flatMap(): LoDashExplicitSyncWrapper; + flatMap( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee: _.ListIterator> + ): LoDashExplicitSyncWrapper; + flatMap( + this: LoDashExplicitSyncWrapper, + iteratee: _.ObjectIterator> + ): LoDashExplicitSyncWrapper; + flatMap( + iteratee: string + ): LoDashExplicitSyncWrapper; + flatMap( + iteratee: object + ): LoDashExplicitSyncWrapper; + flatMapDeep( + this: LoDashExplicitSyncWrapper<_.List<_.ListOfRecursiveArraysOrValues | T> | _.Dictionary<_.ListOfRecursiveArraysOrValues | T> | _.NumericDictionary<_.ListOfRecursiveArraysOrValues | T> | null | undefined> + ): LoDashExplicitSyncWrapper; + flatMapDeep( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee: _.ListIterator | TResult> + ): LoDashExplicitSyncWrapper; + flatMapDeep( + this: LoDashExplicitSyncWrapper, + iteratee: _.ObjectIterator | TResult> + ): LoDashExplicitSyncWrapper; + flatMapDeep( + this: LoDashExplicitSyncWrapper, + iteratee: string + ): LoDashExplicitSyncWrapper; + flatMapDeep( + this: LoDashExplicitSyncWrapper, + iteratee: object + ): LoDashExplicitSyncWrapper; + flatMapDepth( + this: LoDashExplicitSyncWrapper<_.List<_.ListOfRecursiveArraysOrValues | T> | _.Dictionary<_.ListOfRecursiveArraysOrValues | T> | _.NumericDictionary<_.ListOfRecursiveArraysOrValues | T> | null | undefined> + ): LoDashExplicitSyncWrapper; + flatMapDepth( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee: _.ListIterator | TResult>, + depth?: number + ): LoDashExplicitSyncWrapper; + flatMapDepth( + this: LoDashExplicitSyncWrapper, + iteratee: _.ObjectIterator | TResult>, + depth?: number + ): LoDashExplicitSyncWrapper; + flatMapDepth( + this: LoDashExplicitSyncWrapper, + iteratee: string, + depth?: number + ): LoDashExplicitSyncWrapper; + flatMapDepth( + this: LoDashExplicitSyncWrapper, + iteratee: object, + depth?: number + ): LoDashExplicitSyncWrapper; + groupBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper<_.Dictionary>; + groupBy( + this: LoDashExplicitSyncWrapper, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper<_.Dictionary>>; + includes( + this: LoDashExplicitSyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + target: T, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + invokeMap( + methodName: string, + ...args: any[]): LoDashExplicitSyncWrapper; + invokeMap( + method: (...args: any[]) => TResult, + ...args: any[]): LoDashExplicitSyncWrapper; + keyBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIterateeCustom + ): LoDashExplicitSyncWrapper<_.Dictionary>; + keyBy( + this: LoDashExplicitSyncWrapper, + iteratee?: _.ValueIterateeCustom + ): LoDashExplicitSyncWrapper<_.Dictionary>; + map( + this: LoDashExplicitSyncWrapper, + iteratee: _.ArrayIterator + ): LoDashExplicitSyncWrapper; + map( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee: _.ListIterator + ): LoDashExplicitSyncWrapper; + map(this: LoDashExplicitSyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>): LoDashExplicitSyncWrapper; + map( + this: LoDashExplicitSyncWrapper, + iteratee: _.ObjectIterator + ): LoDashExplicitSyncWrapper; + map( + this: LoDashExplicitSyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + iteratee: K + ): LoDashExplicitSyncWrapper>; + map( + this: LoDashExplicitSyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + iteratee?: string + ): LoDashExplicitSyncWrapper; + map( + this: LoDashExplicitSyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + iteratee?: object + ): LoDashExplicitSyncWrapper; + orderBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratees?: _.Many<_.ListIterator>, + orders?: _.Many + ): LoDashExplicitSyncWrapper; + orderBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratees?: _.Many<_.ListIteratee>, + orders?: _.Many + ): LoDashExplicitSyncWrapper; + orderBy( + this: LoDashExplicitSyncWrapper, + iteratees?: _.Many<_.ObjectIterator>, + orders?: _.Many + ): LoDashExplicitSyncWrapper>; + orderBy( + this: LoDashExplicitSyncWrapper, + iteratees?: _.Many<_.ObjectIteratee>, + orders?: _.Many + ): LoDashExplicitSyncWrapper>; + partition( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + callback: _.ValueIteratee + ): LoDashExplicitSyncWrapper<[T[], T[]]>; + partition( + this: LoDashExplicitSyncWrapper, + callback: _.ValueIteratee + ): LoDashExplicitSyncWrapper<[Array, Array]>; + reduce( + this: LoDashExplicitSyncWrapper, + callback: _.MemoListIterator, + accumulator: TResult + ): LoDashExplicitSyncWrapper; + reduce( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + callback: _.MemoListIterator>, + accumulator: TResult + ): LoDashExplicitSyncWrapper; + reduce( + this: LoDashExplicitSyncWrapper, + callback: _.MemoObjectIterator, + accumulator: TResult + ): LoDashExplicitSyncWrapper; + reduce( + this: LoDashExplicitSyncWrapper, + callback: _.MemoListIterator + ): LoDashExplicitSyncWrapper; + reduce( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + callback: _.MemoListIterator> + ): LoDashExplicitSyncWrapper; + reduce( + this: LoDashExplicitSyncWrapper, + callback: _.MemoObjectIterator + ): LoDashExplicitSyncWrapper; + reduceRight( + this: LoDashExplicitSyncWrapper, + callback: _.MemoListIterator, + accumulator: TResult + ): LoDashExplicitSyncWrapper; + reduceRight( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + callback: _.MemoListIterator>, + accumulator: TResult + ): LoDashExplicitSyncWrapper; + reduceRight( + this: LoDashExplicitSyncWrapper, + callback: _.MemoObjectIterator, + accumulator: TResult + ): LoDashExplicitSyncWrapper; + reduceRight( + this: LoDashExplicitSyncWrapper, + callback: _.MemoListIterator + ): LoDashExplicitSyncWrapper; + reduceRight( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + callback: _.MemoListIterator> + ): LoDashExplicitSyncWrapper; + reduceRight( + this: LoDashExplicitSyncWrapper, + callback: _.MemoObjectIterator + ): LoDashExplicitSyncWrapper; + reject( + this: LoDashExplicitSyncWrapper, + predicate?: _.StringIterator + ): LoDashExplicitSyncWrapper; + reject( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom + ): LoDashExplicitSyncWrapper; + reject( + this: LoDashExplicitSyncWrapper, + predicate?: _.ObjectIterateeCustom + ): LoDashExplicitSyncWrapper>; + sample( + this: LoDashExplicitSyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined> + ): LoDashExplicitSyncWrapper; + sample( + this: LoDashExplicitSyncWrapper + ): LoDashExplicitSyncWrapper; + sampleSize( + this: LoDashExplicitSyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + n?: number + ): LoDashExplicitSyncWrapper; + sampleSize( + this: LoDashExplicitSyncWrapper, + n?: number + ): LoDashExplicitSyncWrapper>; + shuffle(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + shuffle(this: LoDashExplicitSyncWrapper): LoDashExplicitSyncWrapper>; + size(): LoDashExplicitSyncWrapper; + some( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom + ): LoDashExplicitSyncWrapper; + some( + this: LoDashExplicitSyncWrapper, + predicate?: _.ObjectIterateeCustom + ): LoDashExplicitSyncWrapper; + sortBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...iteratees: Array<_.Many<_.ListIteratee>> + ): LoDashExplicitSyncWrapper; + sortBy( + this: LoDashExplicitSyncWrapper, + ...iteratees: Array<_.Many<_.ObjectIteratee>> + ): LoDashExplicitSyncWrapper>; + pop(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + push(this: LoDashExplicitSyncWrapper<_.List | null | undefined>, ...items: T[]): this; + shift(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + sort(this: LoDashExplicitSyncWrapper<_.List | null | undefined>, compareFn?: (a: T, b: T) => number): this; + splice(this: LoDashExplicitSyncWrapper<_.List | null | undefined>, start: number, deleteCount?: number, ...items: T[]): this; + unshift(this: LoDashExplicitSyncWrapper<_.List | null | undefined>, ...items: T[]): this; + now(): LoDashExplicitSyncWrapper; + after any>(func: TFunc): LoDashExplicitSyncWrapper; + ary(n?: number): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + before any>(func: TFunc): LoDashExplicitSyncWrapper; + bind( + thisArg: any, + ...partials: any[] + ): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + bindKey( + key: string, + ...partials: any[] + ): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + curry(this: LoDashExplicitSyncWrapper<(t1: T1) => R>): + LoDashExplicitSyncWrapper<_.CurriedFunction1>; + curry(this: LoDashExplicitSyncWrapper<(t1: T1, t2: T2) => R>): + LoDashExplicitSyncWrapper<_.CurriedFunction2>; + curry(this: LoDashExplicitSyncWrapper<(t1: T1, t2: T2, t3: T3) => R>): + LoDashExplicitSyncWrapper<_.CurriedFunction3>; + curry(this: LoDashExplicitSyncWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>): + LoDashExplicitSyncWrapper<_.CurriedFunction4>; + curry(this: LoDashExplicitSyncWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>): + LoDashExplicitSyncWrapper<_.CurriedFunction5>; + curry(arity?: number): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + curryRight(this: LoDashExplicitSyncWrapper<(t1: T1) => R>, arity?: number): + LoDashExplicitSyncWrapper<_.RightCurriedFunction1>; + curryRight(this: LoDashExplicitSyncWrapper<(t1: T1, t2: T2) => R>, arity?: number): + LoDashExplicitSyncWrapper<_.RightCurriedFunction2>; + curryRight(this: LoDashExplicitSyncWrapper<(t1: T1, t2: T2, t3: T3) => R>, arity?: number): + LoDashExplicitSyncWrapper<_.RightCurriedFunction3>; + curryRight(this: LoDashExplicitSyncWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>, arity?: number): + LoDashExplicitSyncWrapper<_.RightCurriedFunction4>; + curryRight(this: LoDashExplicitSyncWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>, arity?: number): + LoDashExplicitSyncWrapper<_.RightCurriedFunction5>; + curryRight(arity?: number): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + debounce( + wait?: number, + options?: _.DebounceSettings + ): LoDashExplicitSyncWrapper; + defer(...args: any[]): LoDashExplicitSyncWrapper; + delay( + wait: number, + ...args: any[] + ): LoDashExplicitSyncWrapper; + memoize(resolver?: (...args: any[]) => any): LoDashExplicitSyncWrapper; + overArgs(...transforms: Array<_.Many<(...args: any[]) => any>>): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + partial: _.ExplicitPartial; + partialRight: _.ExplicitPartialRight; + rearg(...indexes: Array<_.Many>): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + rest(start?: number): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + spread(this: LoDashExplicitSyncWrapper<(...args: any[]) => TResult>): LoDashExplicitSyncWrapper<(...args: any[]) => TResult>; + spread(this: LoDashExplicitSyncWrapper<(...args: any[]) => TResult>, start: number): LoDashExplicitSyncWrapper<(...args: any[]) => TResult>; + throttle( + wait?: number, + options?: _.ThrottleSettings + ): LoDashExplicitSyncWrapper; + unary(this: LoDashExplicitSyncWrapper<(arg1: T, ...args: any[]) => TResult>): LoDashExplicitSyncWrapper<(arg1: T) => TResult>; + wrap( + wrapper: (value: TValue, ...args: TArgs[]) => TResult + ): LoDashExplicitSyncWrapper<(...args: TArgs[]) => TResult>; + wrap( + wrapper: (value: TValue, ...args: any[]) => TResult + ): LoDashExplicitSyncWrapper<(...args: any[]) => TResult>; + castArray(this: LoDashExplicitSyncWrapper<_.Many>): LoDashExplicitSyncWrapper; + clone(): this; + cloneDeep(): this; + cloneDeepWith( + customizer: _.CloneDeepWithCustomizer + ): LoDashExplicitSyncWrapper; + cloneDeepWith(): this; + cloneWith( + customizer: _.CloneWithCustomizer + ): LoDashExplicitSyncWrapper; + cloneWith( + customizer: _.CloneWithCustomizer + ): LoDashExplicitSyncWrapper; + cloneWith(): this; + conformsTo(this: LoDashExplicitSyncWrapper, source: _.ConformsPredicateObject): LoDashExplicitSyncWrapper; + // Note: we can't use TValue here, because it generates a typescript error when strictFunctionTypes is enabled. + eq( + other: any + ): LoDashExplicitSyncWrapper; + gt(other: any): LoDashExplicitSyncWrapper; + gte(other: any): LoDashExplicitSyncWrapper; + isArguments(): LoDashExplicitSyncWrapper; + isArray(): LoDashExplicitSyncWrapper; + isArrayBuffer(): LoDashExplicitSyncWrapper; + isArrayLike(): LoDashExplicitSyncWrapper; + isArrayLikeObject(): LoDashExplicitSyncWrapper; + isBoolean(): LoDashExplicitSyncWrapper; + isBuffer(): LoDashExplicitSyncWrapper; + isDate(): LoDashExplicitSyncWrapper; + isElement(): LoDashExplicitSyncWrapper; + isEmpty(): LoDashExplicitSyncWrapper; + isEqual( + other: any + ): LoDashExplicitSyncWrapper; + isEqualWith( + other: any, + customizer?: _.IsEqualCustomizer + ): LoDashExplicitSyncWrapper; + isError(): LoDashExplicitSyncWrapper; + isFinite(): LoDashExplicitSyncWrapper; + isFunction(): LoDashExplicitSyncWrapper; + isInteger(): LoDashExplicitSyncWrapper; + isLength(): LoDashExplicitSyncWrapper; + isMap(): LoDashExplicitSyncWrapper; + isMatch(source: object): LoDashExplicitSyncWrapper; + isMatchWith(source: object, customizer: _.isMatchWithCustomizer): LoDashExplicitSyncWrapper; + isNaN(): LoDashExplicitSyncWrapper; + isNative(): LoDashExplicitSyncWrapper; + isNil(): LoDashExplicitSyncWrapper; + isNull(): LoDashExplicitSyncWrapper; + isNumber(): LoDashExplicitSyncWrapper; + isObject(): LoDashExplicitSyncWrapper; + isObjectLike(): LoDashExplicitSyncWrapper; + isPlainObject(): LoDashExplicitSyncWrapper; + isRegExp(): LoDashExplicitSyncWrapper; + isSafeInteger(): LoDashExplicitSyncWrapper; + isSet(): LoDashExplicitSyncWrapper; + isString(): LoDashExplicitSyncWrapper; + isSymbol(): LoDashExplicitSyncWrapper; + isTypedArray(): LoDashExplicitSyncWrapper; + isUndefined(): LoDashExplicitSyncWrapper; + isWeakMap(): LoDashExplicitSyncWrapper; + isWeakSet(): LoDashExplicitSyncWrapper; + lt(other: any): LoDashExplicitSyncWrapper; + lte(other: any): LoDashExplicitSyncWrapper; + toArray(this: LoDashExplicitSyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>): LoDashExplicitSyncWrapper; + toArray(this: _.LoDashImplicitWrapper): LoDashExplicitSyncWrapper>; + toFinite(): LoDashExplicitSyncWrapper; + toInteger(): LoDashExplicitSyncWrapper; + toLength(): LoDashExplicitSyncWrapper; + toNumber(): LoDashExplicitSyncWrapper; + toPlainObject(): LoDashExplicitSyncWrapper; + toSafeInteger(): LoDashExplicitSyncWrapper; + add(addend: number): LoDashExplicitSyncWrapper; + ceil(precision?: number): LoDashExplicitSyncWrapper; + divide(divisor: number): LoDashExplicitSyncWrapper; + floor(precision?: number): LoDashExplicitSyncWrapper; + max(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + maxBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + mean(): LoDashExplicitSyncWrapper; + meanBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + min(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + minBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + multiply(multiplicand: number): LoDashExplicitSyncWrapper; + round(precision?: number): LoDashExplicitSyncWrapper; + subtract( + subtrahend: number + ): LoDashExplicitSyncWrapper; + sum(): LoDashExplicitSyncWrapper; + sumBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee?: ((value: T) => number) | string + ): LoDashExplicitSyncWrapper; + clamp( + lower: number, + upper: number + ): LoDashExplicitSyncWrapper; + clamp( + upper: number + ): LoDashExplicitSyncWrapper; + inRange( + start: number, + end?: number + ): LoDashExplicitSyncWrapper; + random(floating?: boolean): LoDashExplicitSyncWrapper; + random( + max: number, + floating?: boolean + ): LoDashExplicitSyncWrapper; + assign( + source: TSource + ): LoDashExplicitSyncWrapper; + assign( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitSyncWrapper; + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitSyncWrapper; + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitSyncWrapper; + assign(): LoDashExplicitSyncWrapper; + assign(...otherArgs: any[]): LoDashExplicitSyncWrapper; + assignIn( + source: TSource + ): LoDashExplicitSyncWrapper; + assignIn( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitSyncWrapper; + assignIn( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitSyncWrapper; + assignIn( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitSyncWrapper; + assignIn(): LoDashExplicitSyncWrapper; + assignIn(...otherArgs: any[]): LoDashExplicitSyncWrapper; + assignInWith( + source: TSource, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + assignInWith( + source1: TSource1, + source2: TSource2, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + assignInWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + assignInWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + assignInWith(): LoDashExplicitSyncWrapper; + assignInWith(...otherArgs: any[]): LoDashExplicitSyncWrapper; + assignWith( + source: TSource, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + assignWith( + source1: TSource1, + source2: TSource2, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + assignWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + assignWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + assignWith(): LoDashExplicitSyncWrapper; + assignWith(...otherArgs: any[]): LoDashExplicitSyncWrapper; + at( + this: LoDashExplicitSyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + ...props: _.PropertyPath[] + ): LoDashExplicitSyncWrapper; + at( + this: LoDashExplicitSyncWrapper, + ...props: Array<_.Many> + ): LoDashExplicitSyncWrapper>; + create(properties?: U): LoDashExplicitSyncWrapper; + defaults( + source: TSource + ): LoDashExplicitSyncWrapper; + defaults( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitSyncWrapper; + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitSyncWrapper; + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitSyncWrapper; + defaults(): LoDashExplicitSyncWrapper; + defaults(...sources: any[]): LoDashExplicitSyncWrapper; + defaultsDeep(...sources: any[]): LoDashExplicitSyncWrapper; + entries(this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary>): LoDashExplicitSyncWrapper>; + entries(): LoDashExplicitSyncWrapper>; + entriesIn(this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary>): LoDashExplicitSyncWrapper>; + entriesIn(): LoDashExplicitSyncWrapper>; + extend( + source: TSource + ): LoDashExplicitSyncWrapper; + extend( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitSyncWrapper; + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitSyncWrapper; + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitSyncWrapper; + extend(): LoDashExplicitSyncWrapper; + extend(...otherArgs: any[]): LoDashExplicitSyncWrapper; + extendWith( + source: TSource, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + extendWith( + source1: TSource1, + source2: TSource2, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + extendWith(): LoDashExplicitSyncWrapper; + extendWith(...otherArgs: any[]): LoDashExplicitSyncWrapper; + findKey( + this: LoDashExplicitSyncWrapper, + predicate?: _.ObjectIteratee + ): LoDashExplicitSyncWrapper; + findLastKey( + this: LoDashExplicitSyncWrapper, + predicate?: _.ObjectIteratee + ): LoDashExplicitSyncWrapper; + functions(): LoDashExplicitSyncWrapper; + functionsIn(): LoDashExplicitSyncWrapper; + get( + path: TKey | [TKey] + ): LoDashExplicitSyncWrapper; + get( + this: LoDashExplicitSyncWrapper, + path: TKey | [TKey], + ): LoDashExplicitSyncWrapper; + get( + this: LoDashExplicitSyncWrapper, + path: TKey | [TKey], + defaultValue: TDefault + ): LoDashExplicitSyncWrapper; + get( + this: LoDashExplicitSyncWrapper<_.NumericDictionary>, + path: number + ): LoDashExplicitSyncWrapper; + get( + this: LoDashExplicitSyncWrapper<_.NumericDictionary | null | undefined>, + path: number + ): LoDashExplicitSyncWrapper; + get( + this: LoDashExplicitSyncWrapper<_.NumericDictionary | null | undefined>, + path: number, + defaultValue: TDefault + ): LoDashExplicitSyncWrapper; + get( + this: LoDashExplicitSyncWrapper, + path: _.PropertyPath, + defaultValue: TDefault + ): LoDashExplicitSyncWrapper; + get( + this: LoDashExplicitSyncWrapper, + path: _.PropertyPath + ): LoDashExplicitSyncWrapper; + get( + path: _.PropertyPath, + defaultValue?: any + ): LoDashExplicitSyncWrapper; + has(path: _.PropertyPath): LoDashExplicitSyncWrapper; + hasIn(path: _.PropertyPath): LoDashExplicitSyncWrapper; + invert(): LoDashExplicitSyncWrapper<_.Dictionary>; + invertBy( + this: LoDashExplicitSyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + interatee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper<_.Dictionary>; + invertBy( + this: LoDashExplicitSyncWrapper, + interatee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper<_.Dictionary>; + invoke( + path: _.PropertyPath, + ...args: any[]): LoDashExplicitSyncWrapper; + keys(): LoDashExplicitSyncWrapper; + keysIn(): LoDashExplicitSyncWrapper; + mapKeys( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee?: _.ListIteratee + ): LoDashExplicitSyncWrapper<_.Dictionary>; + mapKeys( + this: LoDashExplicitSyncWrapper, + iteratee?: _.ObjectIteratee + ): LoDashExplicitSyncWrapper<_.Dictionary>; + mapValues( + this: LoDashExplicitSyncWrapper, + callback: _.StringIterator + ): LoDashExplicitSyncWrapper<_.NumericDictionary>; + mapValues( + this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary | null | undefined>, + callback: _.DictionaryIterator + ): LoDashExplicitSyncWrapper<_.Dictionary>; + mapValues( + this: LoDashExplicitSyncWrapper, + callback: _.ObjectIterator + ): LoDashExplicitSyncWrapper<{ [P in keyof T]: TResult }>; + mapValues( + this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary | null | undefined>, + iteratee: object + ): LoDashExplicitSyncWrapper<_.Dictionary>; + mapValues( + this: LoDashExplicitSyncWrapper, + iteratee: object + ): LoDashExplicitSyncWrapper<{ [P in keyof T]: boolean }>; + mapValues( + this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary | null | undefined>, + iteratee: TKey + ): LoDashExplicitSyncWrapper<_.Dictionary>; + mapValues( + this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary | null | undefined>, + iteratee: string + ): LoDashExplicitSyncWrapper<_.Dictionary>; + mapValues( + this: LoDashExplicitSyncWrapper, + iteratee: string + ): LoDashExplicitSyncWrapper<{ [P in keyof T]: any }>; + mapValues(this: LoDashExplicitSyncWrapper): LoDashExplicitSyncWrapper<_.NumericDictionary>; + mapValues(this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary | null | undefined>): LoDashExplicitSyncWrapper<_.Dictionary>; + mapValues(this: LoDashExplicitSyncWrapper): LoDashExplicitSyncWrapper; + mapValues(this: LoDashExplicitSyncWrapper): LoDashExplicitSyncWrapper<_.PartialObject>; + merge( + source: TSource + ): LoDashExplicitSyncWrapper; + merge( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitSyncWrapper; + merge( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitSyncWrapper; + merge( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitSyncWrapper; + merge( + ...otherArgs: any[] + ): LoDashExplicitSyncWrapper; + mergeWith( + source: TSource, + customizer: _.MergeWithCustomizer + ): LoDashExplicitSyncWrapper; + mergeWith( + source1: TSource1, + source2: TSource2, + customizer: _.MergeWithCustomizer + ): LoDashExplicitSyncWrapper; + mergeWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: _.MergeWithCustomizer + ): LoDashExplicitSyncWrapper; + mergeWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: _.MergeWithCustomizer + ): LoDashExplicitSyncWrapper; + mergeWith( + ...otherArgs: any[] + ): LoDashExplicitSyncWrapper; + omit( + this: LoDashExplicitSyncWrapper, + ...paths: _.PropertyPath[] + ): LoDashExplicitSyncWrapper; + omit( + this: LoDashExplicitSyncWrapper, + ...paths: _.PropertyPath[] + ): LoDashExplicitSyncWrapper<_.PartialObject>; + omitBy( + this: LoDashExplicitSyncWrapper, + predicate: _.ValueKeyIteratee + ): LoDashExplicitSyncWrapper<_.PartialObject>; + pick( + this: LoDashExplicitSyncWrapper, + ...props: Array<_.Many> + ): LoDashExplicitSyncWrapper>; + pick( + this: LoDashExplicitSyncWrapper, + ...props: _.PropertyPath[] + ): LoDashExplicitSyncWrapper<_.PartialObject>; + pickBy( + this: LoDashExplicitSyncWrapper, + predicate?: _.ValueKeyIteratee + ): LoDashExplicitSyncWrapper<_.PartialObject>; + result( + path: _.PropertyPath, + defaultValue?: TResult|((...args: any[]) => TResult) + ): LoDashExplicitSyncWrapper; + set( + path: _.PropertyPath, + value: any + ): this; + set( + path: _.PropertyPath, + value: any + ): LoDashExplicitSyncWrapper; + setWith( + path: _.PropertyPath, + value: any, + customizer?: _.SetWithCustomizer + ): this; + setWith( + path: _.PropertyPath, + value: any, + customizer?: _.SetWithCustomizer + ): LoDashExplicitSyncWrapper; + toPairs(this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary>): LoDashExplicitSyncWrapper>; + toPairs(): LoDashExplicitSyncWrapper>; + toPairsIn(this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary>): LoDashExplicitSyncWrapper>; + toPairsIn(): LoDashExplicitSyncWrapper>; + transform( + this: LoDashExplicitSyncWrapper, + iteratee: _.MemoVoidArrayIterator, + accumulator?: TResult[] + ): LoDashExplicitSyncWrapper; + transform( + this: LoDashExplicitSyncWrapper, + iteratee: _.MemoVoidArrayIterator>, + accumulator?: _.Dictionary + ): LoDashExplicitSyncWrapper<_.Dictionary>; + transform( + this: LoDashExplicitSyncWrapper<_.Dictionary>, + iteratee: _.MemoVoidDictionaryIterator>, + accumulator?: _.Dictionary + ): LoDashExplicitSyncWrapper<_.Dictionary>; + transform( + this: LoDashExplicitSyncWrapper<_.Dictionary>, + iteratee: _.MemoVoidDictionaryIterator, + accumulator?: TResult[] + ): LoDashExplicitSyncWrapper; + transform( + this: LoDashExplicitSyncWrapper, + ): LoDashExplicitSyncWrapper; + transform(): LoDashExplicitSyncWrapper<_.Dictionary>; + unset(path: _.PropertyPath): LoDashExplicitSyncWrapper; + update( + path: _.PropertyPath, + updater: (value: any) => any + ): LoDashExplicitSyncWrapper; + updateWith( + path: _.PropertyPath, + updater: (oldValue: any) => any, + customizer?: _.SetWithCustomizer + ): this; + updateWith( + path: _.PropertyPath, + updater: (oldValue: any) => any, + customizer?: _.SetWithCustomizer + ): LoDashExplicitSyncWrapper; + values(this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary | _.List | null | undefined>): LoDashExplicitSyncWrapper; + values(this: LoDashExplicitSyncWrapper): LoDashExplicitSyncWrapper>; + values(): LoDashExplicitSyncWrapper; + valuesIn(this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary | _.List | null | undefined>): LoDashExplicitSyncWrapper; + valuesIn(this: LoDashExplicitSyncWrapper): LoDashExplicitSyncWrapper>; + chain(): this; + chain(): this; + plant(value: T): LoDashExplicitSyncWrapper; + thru(interceptor: (value: TValue) => TResult): LoDashExplicitSyncWrapper; + camelCase(): LoDashExplicitSyncWrapper; + capitalize(): LoDashExplicitSyncWrapper; + deburr(): LoDashExplicitSyncWrapper; + endsWith( + target?: string, + position?: number + ): LoDashExplicitSyncWrapper; + escape(): LoDashExplicitSyncWrapper; + escapeRegExp(): LoDashExplicitSyncWrapper; + kebabCase(): LoDashExplicitSyncWrapper; + lowerCase(): LoDashExplicitSyncWrapper; + lowerFirst(): LoDashExplicitSyncWrapper; + pad( + length?: number, + chars?: string + ): LoDashExplicitSyncWrapper; + padEnd( + length?: number, + chars?: string + ): LoDashExplicitSyncWrapper; + padStart( + length?: number, + chars?: string + ): LoDashExplicitSyncWrapper; + parseInt(radix?: number): LoDashExplicitSyncWrapper; + repeat(n?: number): LoDashExplicitSyncWrapper; + replace( + pattern: RegExp | string, + replacement: _.ReplaceFunction | string + ): LoDashExplicitSyncWrapper; + replace( + replacement: _.ReplaceFunction | string + ): LoDashExplicitSyncWrapper; + snakeCase(): LoDashExplicitSyncWrapper; + split( + separator?: RegExp|string, + limit?: number + ): LoDashExplicitSyncWrapper; + startCase(): LoDashExplicitSyncWrapper; + startsWith( + target?: string, + position?: number + ): LoDashExplicitSyncWrapper; + template(options?: _.TemplateOptions): LoDashExplicitSyncWrapper<_.TemplateExecutor>; + toLower(): LoDashExplicitSyncWrapper; + toUpper(): LoDashExplicitSyncWrapper; + trim(chars?: string): LoDashExplicitSyncWrapper; + trimEnd(chars?: string): LoDashExplicitSyncWrapper; + trimStart(chars?: string): LoDashExplicitSyncWrapper; + truncate(options?: _.TruncateOptions): LoDashExplicitSyncWrapper; + unescape(): LoDashExplicitSyncWrapper; + upperCase(): LoDashExplicitSyncWrapper; + upperFirst(): LoDashExplicitSyncWrapper; + words(pattern?: string|RegExp): LoDashExplicitSyncWrapper; + attempt(...args: any[]): LoDashExplicitSyncWrapper; + conforms(this: LoDashExplicitSyncWrapper<_.ConformsPredicateObject>): LoDashExplicitSyncWrapper<(value: T) => boolean>; + constant(): LoDashExplicitSyncWrapper<() => TValue>; + defaultTo(this: LoDashExplicitSyncWrapper, defaultValue: T): LoDashExplicitSyncWrapper; + defaultTo( + this: LoDashExplicitSyncWrapper, + defaultValue: TDefault + ): LoDashExplicitSyncWrapper; + // 0-argument first function + flow(this: LoDashExplicitSyncWrapper<() => R1>, f2: (a: R1) => R2): LoDashExplicitSyncWrapper<() => R2>; + flow(this: LoDashExplicitSyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitSyncWrapper<() => R3>; + flow(this: LoDashExplicitSyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitSyncWrapper<() => R4>; + flow(this: LoDashExplicitSyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitSyncWrapper<() => R5>; + flow(this: LoDashExplicitSyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitSyncWrapper<() => R6>; + flow(this: LoDashExplicitSyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitSyncWrapper<() => R7>; + flow(this: LoDashExplicitSyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitSyncWrapper<() => any>; + // 1-argument first function + flow(this: LoDashExplicitSyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2): LoDashExplicitSyncWrapper<(a1: A1) => R2>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitSyncWrapper<(a1: A1) => R3>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitSyncWrapper<(a1: A1) => R4>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitSyncWrapper<(a1: A1) => R5>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitSyncWrapper<(a1: A1) => R6>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitSyncWrapper<(a1: A1) => R7>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitSyncWrapper<(a1: A1) => any>; + // 2-argument first function + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R2>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R3>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R4>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R5>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R6>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R7>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => any>; + // 3-argument first function + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R2>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R3>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R4>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R5>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R6>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R7>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => any>; + // 4-argument first function + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => any>; + // any-argument first function + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any>; + flow(this: LoDashExplicitSyncWrapper<(...args: any[]) => any>, funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + // 0-argument first function + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f1: () => R1): LoDashExplicitSyncWrapper<() => R2>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitSyncWrapper<() => R3>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitSyncWrapper<() => R4>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitSyncWrapper<() => R5>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitSyncWrapper<() => R6>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitSyncWrapper<() => R7>; + // 1-argument first function + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f1: (a1: A1) => R1): LoDashExplicitSyncWrapper<(a1: A1) => R2>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitSyncWrapper<(a1: A1) => R3>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitSyncWrapper<(a1: A1) => R4>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitSyncWrapper<(a1: A1) => R5>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitSyncWrapper<(a1: A1) => R6>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitSyncWrapper<(a1: A1) => R7>; + // 2-argument first function + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R2>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R3>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R4>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R5>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R6>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R7>; + // 3-argument first function + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R2>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R3>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R4>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R5>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R6>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R7>; + // 4-argument first function + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; + // any-argument first function + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f1: (...args: any[]) => R1): LoDashExplicitSyncWrapper<(...args: any[]) => R2>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitSyncWrapper<(...args: any[]) => R3>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitSyncWrapper<(...args: any[]) => R4>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitSyncWrapper<(...args: any[]) => R5>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitSyncWrapper<(...args: any[]) => R6>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitSyncWrapper<(...args: any[]) => R7>; + flowRight(this: LoDashExplicitSyncWrapper<(a: any) => any>, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array<_.Many<(...args: any[]) => any>>): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + flowRight(this: LoDashExplicitSyncWrapper<(a: any) => any>, funcs: Array<_.Many<(...args: any[]) => any>>): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + identity(): this; + iteratee any>( + this: LoDashExplicitSyncWrapper + ): LoDashExplicitSyncWrapper; + matches(): LoDashExplicitSyncWrapper<(value: V) => boolean>; + matchesProperty( + srcValue: SrcValue + ): LoDashExplicitSyncWrapper<(value: any) => boolean>; + matchesProperty( + srcValue: SrcValue + ): LoDashExplicitSyncWrapper<(value: Value) => boolean>; + method(...args: any[]): LoDashExplicitSyncWrapper<(object: any) => any>; + methodOf( + ...args: any[] + ): LoDashExplicitSyncWrapper<(path: _.PropertyPath) => any>; + mixin( + source: _.Dictionary<(...args: any[]) => any>, + options?: _.MixinOptions + ): this; + mixin( + options?: _.MixinOptions + ): LoDashExplicitSyncWrapper<_.LoDashStatic>; + noConflict(): LoDashExplicitSyncWrapper; + noop(...args: any[]): LoDashExplicitSyncWrapper; + nthArg(): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + over( + this: LoDashExplicitSyncWrapper<_.Many<(...args: any[]) => TResult>>, + ...iteratees: Array<_.Many<(...args: any[]) => TResult>> + ): LoDashExplicitSyncWrapper<(...args: any[]) => TResult[]>; + overEvery(...predicates: Array<_.Many<(...args: T[]) => boolean>>): LoDashExplicitSyncWrapper<(...args: T[]) => boolean>; + overSome(...predicates: Array<_.Many<(...args: T[]) => boolean>>): LoDashExplicitSyncWrapper<(...args: T[]) => boolean>; + property(): LoDashExplicitSyncWrapper<(obj: TObj) => TResult>; + propertyOf(): LoDashExplicitSyncWrapper<(path: _.PropertyPath) => any>; + range( + end?: number, + step?: number + ): LoDashExplicitSyncWrapper; + rangeRight( + end?: number, + step?: number + ): LoDashExplicitSyncWrapper; + stubArray(): LoDashExplicitSyncWrapper; + stubFalse(): LoDashExplicitSyncWrapper; + stubObject(): LoDashExplicitSyncWrapper; + stubString(): LoDashExplicitSyncWrapper; + stubTrue(): LoDashExplicitSyncWrapper; + times( + iteratee: (num: number) => TResult + ): LoDashExplicitSyncWrapper; + times(): LoDashExplicitSyncWrapper; + toPath(): LoDashExplicitSyncWrapper; + uniqueId(): LoDashExplicitSyncWrapper; + } + + interface LoDashExplicitAsyncWrapper { + chunk( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + size?: number, + ): LoDashExplicitAsyncWrapper; + compact(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + concat(this: LoDashExplicitAsyncWrapper<_.Many>, ...values: Array<_.Many>): LoDashExplicitAsyncWrapper; + difference( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...values: Array<_.List> + ): LoDashExplicitAsyncWrapper; + differenceBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + differenceBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + differenceBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + values3: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + differenceBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + values3: _.List, + values4: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + differenceBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + values3: _.List, + values4: _.List, + values5: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + differenceBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + values3: _.List, + values4: _.List, + values5: _.List, + ...values: Array<_.List | _.ValueIteratee> + ): LoDashExplicitAsyncWrapper; + differenceBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...values: Array<_.List> + ): LoDashExplicitAsyncWrapper; + differenceWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values: _.List, + comparator: _.Comparator2 + ): LoDashExplicitAsyncWrapper; + differenceWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + comparator: _.Comparator2 + ): LoDashExplicitAsyncWrapper; + differenceWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + ...values: Array<_.List | _.Comparator2> + ): LoDashExplicitAsyncWrapper; + differenceWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...values: Array<_.List> + ): LoDashExplicitAsyncWrapper; + drop(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, n?: number): LoDashExplicitAsyncWrapper; + dropRight(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, n?: number): LoDashExplicitAsyncWrapper; + dropRightWhile( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIteratee + ): LoDashExplicitAsyncWrapper; + dropWhile( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIteratee + ): LoDashExplicitAsyncWrapper; + fill( + this: LoDashExplicitAsyncWrapper, + value: T + ): LoDashExplicitAsyncWrapper; + fill( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitAsyncWrapper<_.List>; + fill( + this: LoDashExplicitAsyncWrapper, + value: T, + start?: number, + end?: number + ): LoDashExplicitAsyncWrapper>; + fill( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T, + start?: number, + end?: number + ): LoDashExplicitAsyncWrapper<_.List>; + findIndex( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + findLastIndex( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + first(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + flatten(this: LoDashExplicitAsyncWrapper<_.List<_.Many> | null | undefined>): LoDashExplicitAsyncWrapper; + flattenDeep(this: LoDashExplicitAsyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>): LoDashExplicitAsyncWrapper; + flattenDepth(this: LoDashExplicitAsyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>, depth?: number): LoDashExplicitAsyncWrapper; + fromPairs( + this: LoDashExplicitAsyncWrapper<_.List<[_.PropertyName, T]> | null | undefined> + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + fromPairs( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined> + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + head(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + indexOf( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + initial(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + intersection( + this: LoDashExplicitAsyncWrapper<_.List>, + ...arrays: Array<_.List> + ): LoDashExplicitAsyncWrapper; + intersectionBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + intersectionBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + intersectionBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + ...values: Array<_.List | _.ValueIteratee> + ): LoDashExplicitAsyncWrapper; + intersectionBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...values: Array<_.List> + ): LoDashExplicitAsyncWrapper; + intersectionWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values: _.List, + comparator: _.Comparator2 + ): LoDashExplicitAsyncWrapper; + intersectionWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + comparator: _.Comparator2 + ): LoDashExplicitAsyncWrapper; + intersectionWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + ...values: Array<_.List | _.Comparator2> + ): LoDashExplicitAsyncWrapper; + intersectionWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...values: Array<_.List> + ): LoDashExplicitAsyncWrapper; + join(separator?: string): LoDashExplicitAsyncWrapper; + last(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + lastIndexOf( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T, + fromIndex?: true|number + ): LoDashExplicitAsyncWrapper; + nth( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + n?: number + ): LoDashExplicitAsyncWrapper; + pull( + this: LoDashExplicitAsyncWrapper<_.List>, + ...values: T[] + ): this; + pullAll( + this: LoDashExplicitAsyncWrapper<_.List>, + values?: _.List + ): this; + remove( + this: LoDashExplicitAsyncWrapper<_.List>, + predicate?: _.ListIteratee + ): LoDashExplicitAsyncWrapper; + slice( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + start?: number, + end?: number + ): LoDashExplicitAsyncWrapper; + sortedIndex( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitAsyncWrapper; + sortedIndex( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitAsyncWrapper; + sortedIndexBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + sortedIndexOf( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitAsyncWrapper; + sortedLastIndex( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitAsyncWrapper; + sortedLastIndexBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T, + iteratee: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + sortedLastIndexOf( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitAsyncWrapper; + sortedUniq(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + sortedUniqBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + tail(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + take( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + n?: number + ): LoDashExplicitAsyncWrapper; + takeRight( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + n?: number + ): LoDashExplicitAsyncWrapper; + takeRightWhile( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIteratee + ): LoDashExplicitAsyncWrapper; + takeWhile( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIteratee + ): LoDashExplicitAsyncWrapper; + union( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...arrays: Array<_.List | null | undefined> + ): LoDashExplicitAsyncWrapper; + unionBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + unionBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + unionBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + unionBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + arrays4: _.List | null | undefined, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + unionBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + arrays4: _.List | null | undefined, + arrays5: _.List | null | undefined, + ...iteratee: Array<_.ValueIteratee | _.List | null | undefined> + ): LoDashExplicitAsyncWrapper; + unionWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + comparator?: _.Comparator + ): LoDashExplicitAsyncWrapper; + unionWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + comparator?: _.Comparator + ): LoDashExplicitAsyncWrapper; + unionWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + ...comparator: Array<_.Comparator | _.List | null | undefined> + ): LoDashExplicitAsyncWrapper; + uniq(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + uniqBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + uniqWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + comparator?: _.Comparator + ): LoDashExplicitAsyncWrapper; + unzip(this: LoDashExplicitAsyncWrapper> | null | undefined>): LoDashExplicitAsyncWrapper; + unzipWith( + this: LoDashExplicitAsyncWrapper<_.List<_.List> | null | undefined>, + iteratee: (...values: T[]) => TResult + ): LoDashExplicitAsyncWrapper; + unzipWith( + this: LoDashExplicitAsyncWrapper<_.List<_.List> | null | undefined> + ): LoDashExplicitAsyncWrapper; + without( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...values: T[] + ): LoDashExplicitAsyncWrapper; + xor( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...arrays: Array<_.List | null | undefined> + ): LoDashExplicitAsyncWrapper; + xorBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + xorBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + xorBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + ...iteratee: Array<_.ValueIteratee | _.List | null | undefined> + ): LoDashExplicitAsyncWrapper; + xorWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + comparator?: _.Comparator + ): LoDashExplicitAsyncWrapper; + xorWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + comparator?: _.Comparator + ): LoDashExplicitAsyncWrapper; + xorWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + ...comparator: Array<_.Comparator | _.List | null | undefined> + ): LoDashExplicitAsyncWrapper; + zip( + this: LoDashExplicitAsyncWrapper<_.List>, + arrays2: _.List, + ): LoDashExplicitAsyncWrapper>; + zip( + this: LoDashExplicitAsyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + ): LoDashExplicitAsyncWrapper>; + zip( + this: LoDashExplicitAsyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + arrays4: _.List, + ): LoDashExplicitAsyncWrapper>; + zip( + this: LoDashExplicitAsyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + arrays4: _.List, + arrays5: _.List, + ): LoDashExplicitAsyncWrapper>; + zip( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...arrays: Array<_.List | null | undefined> + ): LoDashExplicitAsyncWrapper>>; + zipObject( + this: LoDashExplicitAsyncWrapper<_.List<_.PropertyName>>, + values: _.List + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + zipObject( + this: LoDashExplicitAsyncWrapper<_.List<_.PropertyName>> + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + zipObjectDeep( + this: LoDashExplicitAsyncWrapper<_.List<_.PropertyPath>>, + values?: _.List + ): LoDashExplicitAsyncWrapper; + zipWith( + this: LoDashExplicitAsyncWrapper<_.List>, + iteratee: (value1: T) => TResult + ): LoDashExplicitAsyncWrapper; + zipWith( + this: LoDashExplicitAsyncWrapper<_.List>, + arrays2: _.List, + iteratee: (value1: T1, value2: T2) => TResult + ): LoDashExplicitAsyncWrapper; + zipWith( + this: LoDashExplicitAsyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + iteratee: (value1: T1, value2: T2, value3: T3) => TResult + ): LoDashExplicitAsyncWrapper; + zipWith( + this: LoDashExplicitAsyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + arrays4: _.List, + iteratee: (value1: T1, value2: T2, value3: T3, value4: T4) => TResult + ): LoDashExplicitAsyncWrapper; + zipWith( + this: LoDashExplicitAsyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + arrays4: _.List, + arrays5: _.List, + iteratee: (value1: T1, value2: T2, value3: T3, value4: T4, value5: T5) => TResult + ): LoDashExplicitAsyncWrapper; + zipWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...iteratee: Array<((...group: T[]) => TResult) | _.List | null | undefined> + ): LoDashExplicitAsyncWrapper; + countBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + countBy( + this: LoDashExplicitAsyncWrapper, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + every( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom + ): LoDashExplicitAsyncWrapper; + every( + this: LoDashExplicitAsyncWrapper, + predicate?: _.ObjectIterateeCustom + ): LoDashExplicitAsyncWrapper; + filter( + this: LoDashExplicitAsyncWrapper, + predicate?: _.StringIterator + ): LoDashExplicitAsyncWrapper; + filter( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate: _.ListIteratorTypeGuard + ): LoDashExplicitAsyncWrapper; + filter( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom + ): LoDashExplicitAsyncWrapper; + filter( + this: LoDashExplicitAsyncWrapper, + predicate: _.ObjectIteratorTypeGuard + ): LoDashExplicitAsyncWrapper; + filter( + this: LoDashExplicitAsyncWrapper, + predicate?: _.ObjectIterateeCustom + ): LoDashExplicitAsyncWrapper>; + find( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate: _.ListIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + find( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + find( + this: LoDashExplicitAsyncWrapper, + predicate: _.ObjectIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + find( + this: LoDashExplicitAsyncWrapper, + predicate?: _.ObjectIterateeCustom, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + findLast( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate: _.ListIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + findLast( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + findLast( + this: LoDashExplicitAsyncWrapper, + predicate: _.ObjectIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + findLast( + this: LoDashExplicitAsyncWrapper, + predicate?: _.ObjectIterateeCustom, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + flatMap(this: LoDashExplicitAsyncWrapper<_.List<_.Many> | _.Dictionary<_.Many> | _.NumericDictionary<_.Many> | null | undefined>): LoDashExplicitAsyncWrapper; + flatMap(): LoDashExplicitAsyncWrapper; + flatMap( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee: _.ListIterator> + ): LoDashExplicitAsyncWrapper; + flatMap( + this: LoDashExplicitAsyncWrapper, + iteratee: _.ObjectIterator> + ): LoDashExplicitAsyncWrapper; + flatMap( + iteratee: string + ): LoDashExplicitAsyncWrapper; + flatMap( + iteratee: object + ): LoDashExplicitAsyncWrapper; + flatMapDeep( + this: LoDashExplicitAsyncWrapper<_.List<_.ListOfRecursiveArraysOrValues | T> | _.Dictionary<_.ListOfRecursiveArraysOrValues | T> | _.NumericDictionary<_.ListOfRecursiveArraysOrValues | T> | null | undefined> + ): LoDashExplicitAsyncWrapper; + flatMapDeep( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee: _.ListIterator | TResult> + ): LoDashExplicitAsyncWrapper; + flatMapDeep( + this: LoDashExplicitAsyncWrapper, + iteratee: _.ObjectIterator | TResult> + ): LoDashExplicitAsyncWrapper; + flatMapDeep( + this: LoDashExplicitAsyncWrapper, + iteratee: string + ): LoDashExplicitAsyncWrapper; + flatMapDeep( + this: LoDashExplicitAsyncWrapper, + iteratee: object + ): LoDashExplicitAsyncWrapper; + flatMapDepth( + this: LoDashExplicitAsyncWrapper<_.List<_.ListOfRecursiveArraysOrValues | T> | _.Dictionary<_.ListOfRecursiveArraysOrValues | T> | _.NumericDictionary<_.ListOfRecursiveArraysOrValues | T> | null | undefined> + ): LoDashExplicitAsyncWrapper; + flatMapDepth( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee: _.ListIterator | TResult>, + depth?: number + ): LoDashExplicitAsyncWrapper; + flatMapDepth( + this: LoDashExplicitAsyncWrapper, + iteratee: _.ObjectIterator | TResult>, + depth?: number + ): LoDashExplicitAsyncWrapper; + flatMapDepth( + this: LoDashExplicitAsyncWrapper, + iteratee: string, + depth?: number + ): LoDashExplicitAsyncWrapper; + flatMapDepth( + this: LoDashExplicitAsyncWrapper, + iteratee: object, + depth?: number + ): LoDashExplicitAsyncWrapper; + groupBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + groupBy( + this: LoDashExplicitAsyncWrapper, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper<_.Dictionary>>; + includes( + this: LoDashExplicitAsyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + target: T, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + invokeMap( + methodName: string, + ...args: any[]): LoDashExplicitAsyncWrapper; + invokeMap( + method: (...args: any[]) => TResult, + ...args: any[]): LoDashExplicitAsyncWrapper; + keyBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIterateeCustom + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + keyBy( + this: LoDashExplicitAsyncWrapper, + iteratee?: _.ValueIterateeCustom + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + map( + this: LoDashExplicitAsyncWrapper, + iteratee: _.ArrayIterator + ): LoDashExplicitAsyncWrapper; + map( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee: _.ListIterator + ): LoDashExplicitAsyncWrapper; + map(this: LoDashExplicitAsyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>): LoDashExplicitAsyncWrapper; + map( + this: LoDashExplicitAsyncWrapper, + iteratee: _.ObjectIterator + ): LoDashExplicitAsyncWrapper; + map( + this: LoDashExplicitAsyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + iteratee: K + ): LoDashExplicitAsyncWrapper>; + map( + this: LoDashExplicitAsyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + iteratee?: string + ): LoDashExplicitAsyncWrapper; + map( + this: LoDashExplicitAsyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + iteratee?: object + ): LoDashExplicitAsyncWrapper; + orderBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratees?: _.Many<_.ListIterator>, + orders?: _.Many + ): LoDashExplicitAsyncWrapper; + orderBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratees?: _.Many<_.ListIteratee>, + orders?: _.Many + ): LoDashExplicitAsyncWrapper; + orderBy( + this: LoDashExplicitAsyncWrapper, + iteratees?: _.Many<_.ObjectIterator>, + orders?: _.Many + ): LoDashExplicitAsyncWrapper>; + orderBy( + this: LoDashExplicitAsyncWrapper, + iteratees?: _.Many<_.ObjectIteratee>, + orders?: _.Many + ): LoDashExplicitAsyncWrapper>; + partition( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + callback: _.ValueIteratee + ): LoDashExplicitAsyncWrapper<[T[], T[]]>; + partition( + this: LoDashExplicitAsyncWrapper, + callback: _.ValueIteratee + ): LoDashExplicitAsyncWrapper<[Array, Array]>; + reduce( + this: LoDashExplicitAsyncWrapper, + callback: _.MemoListIterator, + accumulator: TResult + ): LoDashExplicitAsyncWrapper; + reduce( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + callback: _.MemoListIterator>, + accumulator: TResult + ): LoDashExplicitAsyncWrapper; + reduce( + this: LoDashExplicitAsyncWrapper, + callback: _.MemoObjectIterator, + accumulator: TResult + ): LoDashExplicitAsyncWrapper; + reduce( + this: LoDashExplicitAsyncWrapper, + callback: _.MemoListIterator + ): LoDashExplicitAsyncWrapper; + reduce( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + callback: _.MemoListIterator> + ): LoDashExplicitAsyncWrapper; + reduce( + this: LoDashExplicitAsyncWrapper, + callback: _.MemoObjectIterator + ): LoDashExplicitAsyncWrapper; + reduceRight( + this: LoDashExplicitAsyncWrapper, + callback: _.MemoListIterator, + accumulator: TResult + ): LoDashExplicitAsyncWrapper; + reduceRight( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + callback: _.MemoListIterator>, + accumulator: TResult + ): LoDashExplicitAsyncWrapper; + reduceRight( + this: LoDashExplicitAsyncWrapper, + callback: _.MemoObjectIterator, + accumulator: TResult + ): LoDashExplicitAsyncWrapper; + reduceRight( + this: LoDashExplicitAsyncWrapper, + callback: _.MemoListIterator + ): LoDashExplicitAsyncWrapper; + reduceRight( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + callback: _.MemoListIterator> + ): LoDashExplicitAsyncWrapper; + reduceRight( + this: LoDashExplicitAsyncWrapper, + callback: _.MemoObjectIterator + ): LoDashExplicitAsyncWrapper; + reject( + this: LoDashExplicitAsyncWrapper, + predicate?: _.StringIterator + ): LoDashExplicitAsyncWrapper; + reject( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom + ): LoDashExplicitAsyncWrapper; + reject( + this: LoDashExplicitAsyncWrapper, + predicate?: _.ObjectIterateeCustom + ): LoDashExplicitAsyncWrapper>; + sample( + this: LoDashExplicitAsyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined> + ): LoDashExplicitAsyncWrapper; + sample( + this: LoDashExplicitAsyncWrapper + ): LoDashExplicitAsyncWrapper; + sampleSize( + this: LoDashExplicitAsyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + n?: number + ): LoDashExplicitAsyncWrapper; + sampleSize( + this: LoDashExplicitAsyncWrapper, + n?: number + ): LoDashExplicitAsyncWrapper>; + shuffle(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + shuffle(this: LoDashExplicitAsyncWrapper): LoDashExplicitAsyncWrapper>; + size(): LoDashExplicitAsyncWrapper; + some( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom + ): LoDashExplicitAsyncWrapper; + some( + this: LoDashExplicitAsyncWrapper, + predicate?: _.ObjectIterateeCustom + ): LoDashExplicitAsyncWrapper; + sortBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...iteratees: Array<_.Many<_.ListIteratee>> + ): LoDashExplicitAsyncWrapper; + sortBy( + this: LoDashExplicitAsyncWrapper, + ...iteratees: Array<_.Many<_.ObjectIteratee>> + ): LoDashExplicitAsyncWrapper>; + pop(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + push(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, ...items: T[]): this; + shift(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + sort(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, compareFn?: (a: T, b: T) => number): this; + splice(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, start: number, deleteCount?: number, ...items: T[]): this; + unshift(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, ...items: T[]): this; + now(): LoDashExplicitAsyncWrapper; + after any>(func: TFunc): LoDashExplicitAsyncWrapper; + ary(n?: number): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + before any>(func: TFunc): LoDashExplicitAsyncWrapper; + bind( + thisArg: any, + ...partials: any[] + ): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + bindKey( + key: string, + ...partials: any[] + ): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + curry(this: LoDashExplicitAsyncWrapper<(t1: T1) => R>): + LoDashExplicitAsyncWrapper<_.CurriedFunction1>; + curry(this: LoDashExplicitAsyncWrapper<(t1: T1, t2: T2) => R>): + LoDashExplicitAsyncWrapper<_.CurriedFunction2>; + curry(this: LoDashExplicitAsyncWrapper<(t1: T1, t2: T2, t3: T3) => R>): + LoDashExplicitAsyncWrapper<_.CurriedFunction3>; + curry(this: LoDashExplicitAsyncWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>): + LoDashExplicitAsyncWrapper<_.CurriedFunction4>; + curry(this: LoDashExplicitAsyncWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>): + LoDashExplicitAsyncWrapper<_.CurriedFunction5>; + curry(arity?: number): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + curryRight(this: LoDashExplicitAsyncWrapper<(t1: T1) => R>, arity?: number): + LoDashExplicitAsyncWrapper<_.RightCurriedFunction1>; + curryRight(this: LoDashExplicitAsyncWrapper<(t1: T1, t2: T2) => R>, arity?: number): + LoDashExplicitAsyncWrapper<_.RightCurriedFunction2>; + curryRight(this: LoDashExplicitAsyncWrapper<(t1: T1, t2: T2, t3: T3) => R>, arity?: number): + LoDashExplicitAsyncWrapper<_.RightCurriedFunction3>; + curryRight(this: LoDashExplicitAsyncWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>, arity?: number): + LoDashExplicitAsyncWrapper<_.RightCurriedFunction4>; + curryRight(this: LoDashExplicitAsyncWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>, arity?: number): + LoDashExplicitAsyncWrapper<_.RightCurriedFunction5>; + curryRight(arity?: number): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + debounce( + wait?: number, + options?: _.DebounceSettings + ): LoDashExplicitAsyncWrapper; + defer(...args: any[]): LoDashExplicitAsyncWrapper; + delay( + wait: number, + ...args: any[] + ): LoDashExplicitAsyncWrapper; + memoize(resolver?: (...args: any[]) => any): LoDashExplicitAsyncWrapper; + overArgs(...transforms: Array<_.Many<(...args: any[]) => any>>): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + partial: _.ExplicitPartial; + partialRight: _.ExplicitPartialRight; + rearg(...indexes: Array<_.Many>): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + rest(start?: number): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + spread(this: LoDashExplicitAsyncWrapper<(...args: any[]) => TResult>): LoDashExplicitAsyncWrapper<(...args: any[]) => TResult>; + spread(this: LoDashExplicitAsyncWrapper<(...args: any[]) => TResult>, start: number): LoDashExplicitAsyncWrapper<(...args: any[]) => TResult>; + throttle( + wait?: number, + options?: _.ThrottleSettings + ): LoDashExplicitAsyncWrapper; + unary(this: LoDashExplicitAsyncWrapper<(arg1: T, ...args: any[]) => TResult>): LoDashExplicitAsyncWrapper<(arg1: T) => TResult>; + wrap( + wrapper: (value: TValue, ...args: TArgs[]) => TResult + ): LoDashExplicitAsyncWrapper<(...args: TArgs[]) => TResult>; + wrap( + wrapper: (value: TValue, ...args: any[]) => TResult + ): LoDashExplicitAsyncWrapper<(...args: any[]) => TResult>; + castArray(this: LoDashExplicitAsyncWrapper<_.Many>): LoDashExplicitAsyncWrapper; + clone(): this; + cloneDeep(): this; + cloneDeepWith( + customizer: _.CloneDeepWithCustomizer + ): LoDashExplicitAsyncWrapper; + cloneDeepWith(): this; + cloneWith( + customizer: _.CloneWithCustomizer + ): LoDashExplicitAsyncWrapper; + cloneWith( + customizer: _.CloneWithCustomizer + ): LoDashExplicitAsyncWrapper; + cloneWith(): this; + conformsTo(this: LoDashExplicitAsyncWrapper, source: _.ConformsPredicateObject): LoDashExplicitAsyncWrapper; + // Note: we can't use TValue here, because it generates a typescript error when strictFunctionTypes is enabled. + eq( + other: any + ): LoDashExplicitAsyncWrapper; + gt(other: any): LoDashExplicitAsyncWrapper; + gte(other: any): LoDashExplicitAsyncWrapper; + isArguments(): LoDashExplicitAsyncWrapper; + isArray(): LoDashExplicitAsyncWrapper; + isArrayBuffer(): LoDashExplicitAsyncWrapper; + isArrayLike(): LoDashExplicitAsyncWrapper; + isArrayLikeObject(): LoDashExplicitAsyncWrapper; + isBoolean(): LoDashExplicitAsyncWrapper; + isBuffer(): LoDashExplicitAsyncWrapper; + isDate(): LoDashExplicitAsyncWrapper; + isElement(): LoDashExplicitAsyncWrapper; + isEmpty(): LoDashExplicitAsyncWrapper; + isEqual( + other: any + ): LoDashExplicitAsyncWrapper; + isEqualWith( + other: any, + customizer?: _.IsEqualCustomizer + ): LoDashExplicitAsyncWrapper; + isError(): LoDashExplicitAsyncWrapper; + isFinite(): LoDashExplicitAsyncWrapper; + isFunction(): LoDashExplicitAsyncWrapper; + isInteger(): LoDashExplicitAsyncWrapper; + isLength(): LoDashExplicitAsyncWrapper; + isMap(): LoDashExplicitAsyncWrapper; + isMatch(source: object): LoDashExplicitAsyncWrapper; + isMatchWith(source: object, customizer: _.isMatchWithCustomizer): LoDashExplicitAsyncWrapper; + isNaN(): LoDashExplicitAsyncWrapper; + isNative(): LoDashExplicitAsyncWrapper; + isNil(): LoDashExplicitAsyncWrapper; + isNull(): LoDashExplicitAsyncWrapper; + isNumber(): LoDashExplicitAsyncWrapper; + isObject(): LoDashExplicitAsyncWrapper; + isObjectLike(): LoDashExplicitAsyncWrapper; + isPlainObject(): LoDashExplicitAsyncWrapper; + isRegExp(): LoDashExplicitAsyncWrapper; + isSafeInteger(): LoDashExplicitAsyncWrapper; + isSet(): LoDashExplicitAsyncWrapper; + isString(): LoDashExplicitAsyncWrapper; + isSymbol(): LoDashExplicitAsyncWrapper; + isTypedArray(): LoDashExplicitAsyncWrapper; + isUndefined(): LoDashExplicitAsyncWrapper; + isWeakMap(): LoDashExplicitAsyncWrapper; + isWeakSet(): LoDashExplicitAsyncWrapper; + lt(other: any): LoDashExplicitAsyncWrapper; + lte(other: any): LoDashExplicitAsyncWrapper; + toArray(this: LoDashExplicitAsyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>): LoDashExplicitAsyncWrapper; + toArray(this: _.LoDashImplicitWrapper): LoDashExplicitAsyncWrapper>; + toFinite(): LoDashExplicitAsyncWrapper; + toInteger(): LoDashExplicitAsyncWrapper; + toLength(): LoDashExplicitAsyncWrapper; + toNumber(): LoDashExplicitAsyncWrapper; + toPlainObject(): LoDashExplicitAsyncWrapper; + toSafeInteger(): LoDashExplicitAsyncWrapper; + add(addend: number): LoDashExplicitAsyncWrapper; + ceil(precision?: number): LoDashExplicitAsyncWrapper; + divide(divisor: number): LoDashExplicitAsyncWrapper; + floor(precision?: number): LoDashExplicitAsyncWrapper; + max(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + maxBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + mean(): LoDashExplicitAsyncWrapper; + meanBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + min(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + minBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + multiply(multiplicand: number): LoDashExplicitAsyncWrapper; + round(precision?: number): LoDashExplicitAsyncWrapper; + subtract( + subtrahend: number + ): LoDashExplicitAsyncWrapper; + sum(): LoDashExplicitAsyncWrapper; + sumBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee?: ((value: T) => number) | string + ): LoDashExplicitAsyncWrapper; + clamp( + lower: number, + upper: number + ): LoDashExplicitAsyncWrapper; + clamp( + upper: number + ): LoDashExplicitAsyncWrapper; + inRange( + start: number, + end?: number + ): LoDashExplicitAsyncWrapper; + random(floating?: boolean): LoDashExplicitAsyncWrapper; + random( + max: number, + floating?: boolean + ): LoDashExplicitAsyncWrapper; + assign( + source: TSource + ): LoDashExplicitAsyncWrapper; + assign( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitAsyncWrapper; + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitAsyncWrapper; + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitAsyncWrapper; + assign(): LoDashExplicitAsyncWrapper; + assign(...otherArgs: any[]): LoDashExplicitAsyncWrapper; + assignIn( + source: TSource + ): LoDashExplicitAsyncWrapper; + assignIn( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitAsyncWrapper; + assignIn( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitAsyncWrapper; + assignIn( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitAsyncWrapper; + assignIn(): LoDashExplicitAsyncWrapper; + assignIn(...otherArgs: any[]): LoDashExplicitAsyncWrapper; + assignInWith( + source: TSource, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + assignInWith( + source1: TSource1, + source2: TSource2, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + assignInWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + assignInWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + assignInWith(): LoDashExplicitAsyncWrapper; + assignInWith(...otherArgs: any[]): LoDashExplicitAsyncWrapper; + assignWith( + source: TSource, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + assignWith( + source1: TSource1, + source2: TSource2, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + assignWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + assignWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + assignWith(): LoDashExplicitAsyncWrapper; + assignWith(...otherArgs: any[]): LoDashExplicitAsyncWrapper; + at( + this: LoDashExplicitAsyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + ...props: _.PropertyPath[] + ): LoDashExplicitAsyncWrapper; + at( + this: LoDashExplicitAsyncWrapper, + ...props: Array<_.Many> + ): LoDashExplicitAsyncWrapper>; + create(properties?: U): LoDashExplicitAsyncWrapper; + defaults( + source: TSource + ): LoDashExplicitAsyncWrapper; + defaults( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitAsyncWrapper; + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitAsyncWrapper; + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitAsyncWrapper; + defaults(): LoDashExplicitAsyncWrapper; + defaults(...sources: any[]): LoDashExplicitAsyncWrapper; + defaultsDeep(...sources: any[]): LoDashExplicitAsyncWrapper; + entries(this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary>): LoDashExplicitAsyncWrapper>; + entries(): LoDashExplicitAsyncWrapper>; + entriesIn(this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary>): LoDashExplicitAsyncWrapper>; + entriesIn(): LoDashExplicitAsyncWrapper>; + extend( + source: TSource + ): LoDashExplicitAsyncWrapper; + extend( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitAsyncWrapper; + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitAsyncWrapper; + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitAsyncWrapper; + extend(): LoDashExplicitAsyncWrapper; + extend(...otherArgs: any[]): LoDashExplicitAsyncWrapper; + extendWith( + source: TSource, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + extendWith( + source1: TSource1, + source2: TSource2, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + extendWith(): LoDashExplicitAsyncWrapper; + extendWith(...otherArgs: any[]): LoDashExplicitAsyncWrapper; + findKey( + this: LoDashExplicitAsyncWrapper, + predicate?: _.ObjectIteratee + ): LoDashExplicitAsyncWrapper; + findLastKey( + this: LoDashExplicitAsyncWrapper, + predicate?: _.ObjectIteratee + ): LoDashExplicitAsyncWrapper; + functions(): LoDashExplicitAsyncWrapper; + functionsIn(): LoDashExplicitAsyncWrapper; + get( + path: TKey | [TKey] + ): LoDashExplicitAsyncWrapper; + get( + this: LoDashExplicitAsyncWrapper, + path: TKey | [TKey], + ): LoDashExplicitAsyncWrapper; + get( + this: LoDashExplicitAsyncWrapper, + path: TKey | [TKey], + defaultValue: TDefault + ): LoDashExplicitAsyncWrapper; + get( + this: LoDashExplicitAsyncWrapper<_.NumericDictionary>, + path: number + ): LoDashExplicitAsyncWrapper; + get( + this: LoDashExplicitAsyncWrapper<_.NumericDictionary | null | undefined>, + path: number + ): LoDashExplicitAsyncWrapper; + get( + this: LoDashExplicitAsyncWrapper<_.NumericDictionary | null | undefined>, + path: number, + defaultValue: TDefault + ): LoDashExplicitAsyncWrapper; + get( + this: LoDashExplicitAsyncWrapper, + path: _.PropertyPath, + defaultValue: TDefault + ): LoDashExplicitAsyncWrapper; + get( + this: LoDashExplicitAsyncWrapper, + path: _.PropertyPath + ): LoDashExplicitAsyncWrapper; + get( + path: _.PropertyPath, + defaultValue?: any + ): LoDashExplicitAsyncWrapper; + has(path: _.PropertyPath): LoDashExplicitAsyncWrapper; + hasIn(path: _.PropertyPath): LoDashExplicitAsyncWrapper; + invert(): LoDashExplicitAsyncWrapper<_.Dictionary>; + invertBy( + this: LoDashExplicitAsyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + interatee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + invertBy( + this: LoDashExplicitAsyncWrapper, + interatee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + invoke( + path: _.PropertyPath, + ...args: any[]): LoDashExplicitAsyncWrapper; + keys(): LoDashExplicitAsyncWrapper; + keysIn(): LoDashExplicitAsyncWrapper; + mapKeys( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee?: _.ListIteratee + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + mapKeys( + this: LoDashExplicitAsyncWrapper, + iteratee?: _.ObjectIteratee + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + mapValues( + this: LoDashExplicitAsyncWrapper, + callback: _.StringIterator + ): LoDashExplicitAsyncWrapper<_.NumericDictionary>; + mapValues( + this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary | null | undefined>, + callback: _.DictionaryIterator + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + mapValues( + this: LoDashExplicitAsyncWrapper, + callback: _.ObjectIterator + ): LoDashExplicitAsyncWrapper<{ [P in keyof T]: TResult }>; + mapValues( + this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary | null | undefined>, + iteratee: object + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + mapValues( + this: LoDashExplicitAsyncWrapper, + iteratee: object + ): LoDashExplicitAsyncWrapper<{ [P in keyof T]: boolean }>; + mapValues( + this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary | null | undefined>, + iteratee: TKey + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + mapValues( + this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary | null | undefined>, + iteratee: string + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + mapValues( + this: LoDashExplicitAsyncWrapper, + iteratee: string + ): LoDashExplicitAsyncWrapper<{ [P in keyof T]: any }>; + mapValues(this: LoDashExplicitAsyncWrapper): LoDashExplicitAsyncWrapper<_.NumericDictionary>; + mapValues(this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary | null | undefined>): LoDashExplicitAsyncWrapper<_.Dictionary>; + mapValues(this: LoDashExplicitAsyncWrapper): LoDashExplicitAsyncWrapper; + mapValues(this: LoDashExplicitAsyncWrapper): LoDashExplicitAsyncWrapper<_.PartialObject>; + merge( + source: TSource + ): LoDashExplicitAsyncWrapper; + merge( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitAsyncWrapper; + merge( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitAsyncWrapper; + merge( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitAsyncWrapper; + merge( + ...otherArgs: any[] + ): LoDashExplicitAsyncWrapper; + mergeWith( + source: TSource, + customizer: _.MergeWithCustomizer + ): LoDashExplicitAsyncWrapper; + mergeWith( + source1: TSource1, + source2: TSource2, + customizer: _.MergeWithCustomizer + ): LoDashExplicitAsyncWrapper; + mergeWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: _.MergeWithCustomizer + ): LoDashExplicitAsyncWrapper; + mergeWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: _.MergeWithCustomizer + ): LoDashExplicitAsyncWrapper; + mergeWith( + ...otherArgs: any[] + ): LoDashExplicitAsyncWrapper; + omit( + this: LoDashExplicitAsyncWrapper, + ...paths: _.PropertyPath[] + ): LoDashExplicitAsyncWrapper; + omit( + this: LoDashExplicitAsyncWrapper, + ...paths: _.PropertyPath[] + ): LoDashExplicitAsyncWrapper<_.PartialObject>; + omitBy( + this: LoDashExplicitAsyncWrapper, + predicate: _.ValueKeyIteratee + ): LoDashExplicitAsyncWrapper<_.PartialObject>; + pick( + this: LoDashExplicitAsyncWrapper, + ...props: Array<_.Many> + ): LoDashExplicitAsyncWrapper>; + pick( + this: LoDashExplicitAsyncWrapper, + ...props: _.PropertyPath[] + ): LoDashExplicitAsyncWrapper<_.PartialObject>; + pickBy( + this: LoDashExplicitAsyncWrapper, + predicate?: _.ValueKeyIteratee + ): LoDashExplicitAsyncWrapper<_.PartialObject>; + result( + path: _.PropertyPath, + defaultValue?: TResult|((...args: any[]) => TResult) + ): LoDashExplicitAsyncWrapper; + set( + path: _.PropertyPath, + value: any + ): this; + set( + path: _.PropertyPath, + value: any + ): LoDashExplicitAsyncWrapper; + setWith( + path: _.PropertyPath, + value: any, + customizer?: _.SetWithCustomizer + ): this; + setWith( + path: _.PropertyPath, + value: any, + customizer?: _.SetWithCustomizer + ): LoDashExplicitAsyncWrapper; + toPairs(this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary>): LoDashExplicitAsyncWrapper>; + toPairs(): LoDashExplicitAsyncWrapper>; + toPairsIn(this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary>): LoDashExplicitAsyncWrapper>; + toPairsIn(): LoDashExplicitAsyncWrapper>; + transform( + this: LoDashExplicitAsyncWrapper, + iteratee: _.MemoVoidArrayIterator, + accumulator?: TResult[] + ): LoDashExplicitAsyncWrapper; + transform( + this: LoDashExplicitAsyncWrapper, + iteratee: _.MemoVoidArrayIterator>, + accumulator?: _.Dictionary + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + transform( + this: LoDashExplicitAsyncWrapper<_.Dictionary>, + iteratee: _.MemoVoidDictionaryIterator>, + accumulator?: _.Dictionary + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + transform( + this: LoDashExplicitAsyncWrapper<_.Dictionary>, + iteratee: _.MemoVoidDictionaryIterator, + accumulator?: TResult[] + ): LoDashExplicitAsyncWrapper; + transform( + this: LoDashExplicitAsyncWrapper, + ): LoDashExplicitAsyncWrapper; + transform(): LoDashExplicitAsyncWrapper<_.Dictionary>; + unset(path: _.PropertyPath): LoDashExplicitAsyncWrapper; + update( + path: _.PropertyPath, + updater: (value: any) => any + ): LoDashExplicitAsyncWrapper; + updateWith( + path: _.PropertyPath, + updater: (oldValue: any) => any, + customizer?: _.SetWithCustomizer + ): this; + updateWith( + path: _.PropertyPath, + updater: (oldValue: any) => any, + customizer?: _.SetWithCustomizer + ): LoDashExplicitAsyncWrapper; + values(this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary | _.List | null | undefined>): LoDashExplicitAsyncWrapper; + values(this: LoDashExplicitAsyncWrapper): LoDashExplicitAsyncWrapper>; + values(): LoDashExplicitAsyncWrapper; + valuesIn(this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary | _.List | null | undefined>): LoDashExplicitAsyncWrapper; + valuesIn(this: LoDashExplicitAsyncWrapper): LoDashExplicitAsyncWrapper>; + chain(): this; + chain(): this; + plant(value: T): LoDashExplicitAsyncWrapper; + thru(interceptor: (value: TValue) => TResult): LoDashExplicitAsyncWrapper; + camelCase(): LoDashExplicitAsyncWrapper; + capitalize(): LoDashExplicitAsyncWrapper; + deburr(): LoDashExplicitAsyncWrapper; + endsWith( + target?: string, + position?: number + ): LoDashExplicitAsyncWrapper; + escape(): LoDashExplicitAsyncWrapper; + escapeRegExp(): LoDashExplicitAsyncWrapper; + kebabCase(): LoDashExplicitAsyncWrapper; + lowerCase(): LoDashExplicitAsyncWrapper; + lowerFirst(): LoDashExplicitAsyncWrapper; + pad( + length?: number, + chars?: string + ): LoDashExplicitAsyncWrapper; + padEnd( + length?: number, + chars?: string + ): LoDashExplicitAsyncWrapper; + padStart( + length?: number, + chars?: string + ): LoDashExplicitAsyncWrapper; + parseInt(radix?: number): LoDashExplicitAsyncWrapper; + repeat(n?: number): LoDashExplicitAsyncWrapper; + replace( + pattern: RegExp | string, + replacement: _.ReplaceFunction | string + ): LoDashExplicitAsyncWrapper; + replace( + replacement: _.ReplaceFunction | string + ): LoDashExplicitAsyncWrapper; + snakeCase(): LoDashExplicitAsyncWrapper; + split( + separator?: RegExp|string, + limit?: number + ): LoDashExplicitAsyncWrapper; + startCase(): LoDashExplicitAsyncWrapper; + startsWith( + target?: string, + position?: number + ): LoDashExplicitAsyncWrapper; + template(options?: _.TemplateOptions): LoDashExplicitAsyncWrapper<_.TemplateExecutor>; + toLower(): LoDashExplicitAsyncWrapper; + toUpper(): LoDashExplicitAsyncWrapper; + trim(chars?: string): LoDashExplicitAsyncWrapper; + trimEnd(chars?: string): LoDashExplicitAsyncWrapper; + trimStart(chars?: string): LoDashExplicitAsyncWrapper; + truncate(options?: _.TruncateOptions): LoDashExplicitAsyncWrapper; + unescape(): LoDashExplicitAsyncWrapper; + upperCase(): LoDashExplicitAsyncWrapper; + upperFirst(): LoDashExplicitAsyncWrapper; + words(pattern?: string|RegExp): LoDashExplicitAsyncWrapper; + attempt(...args: any[]): LoDashExplicitAsyncWrapper; + conforms(this: LoDashExplicitAsyncWrapper<_.ConformsPredicateObject>): LoDashExplicitAsyncWrapper<(value: T) => boolean>; + constant(): LoDashExplicitAsyncWrapper<() => TValue>; + defaultTo(this: LoDashExplicitAsyncWrapper, defaultValue: T): LoDashExplicitAsyncWrapper; + defaultTo( + this: LoDashExplicitAsyncWrapper, + defaultValue: TDefault + ): LoDashExplicitAsyncWrapper; + // 0-argument first function + flow(this: LoDashExplicitAsyncWrapper<() => R1>, f2: (a: R1) => R2): LoDashExplicitAsyncWrapper<() => R2>; + flow(this: LoDashExplicitAsyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitAsyncWrapper<() => R3>; + flow(this: LoDashExplicitAsyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitAsyncWrapper<() => R4>; + flow(this: LoDashExplicitAsyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitAsyncWrapper<() => R5>; + flow(this: LoDashExplicitAsyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitAsyncWrapper<() => R6>; + flow(this: LoDashExplicitAsyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitAsyncWrapper<() => R7>; + flow(this: LoDashExplicitAsyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitAsyncWrapper<() => any>; + // 1-argument first function + flow(this: LoDashExplicitAsyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2): LoDashExplicitAsyncWrapper<(a1: A1) => R2>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitAsyncWrapper<(a1: A1) => R3>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitAsyncWrapper<(a1: A1) => R4>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitAsyncWrapper<(a1: A1) => R5>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitAsyncWrapper<(a1: A1) => R6>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitAsyncWrapper<(a1: A1) => R7>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitAsyncWrapper<(a1: A1) => any>; + // 2-argument first function + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R2>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R3>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R4>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R5>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R6>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R7>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => any>; + // 3-argument first function + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R2>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R3>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R4>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R5>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R6>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R7>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => any>; + // 4-argument first function + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => any>; + // any-argument first function + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any>; + flow(this: LoDashExplicitAsyncWrapper<(...args: any[]) => any>, funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + // 0-argument first function + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f1: () => R1): LoDashExplicitAsyncWrapper<() => R2>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitAsyncWrapper<() => R3>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitAsyncWrapper<() => R4>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitAsyncWrapper<() => R5>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitAsyncWrapper<() => R6>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitAsyncWrapper<() => R7>; + // 1-argument first function + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f1: (a1: A1) => R1): LoDashExplicitAsyncWrapper<(a1: A1) => R2>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitAsyncWrapper<(a1: A1) => R3>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitAsyncWrapper<(a1: A1) => R4>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitAsyncWrapper<(a1: A1) => R5>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitAsyncWrapper<(a1: A1) => R6>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitAsyncWrapper<(a1: A1) => R7>; + // 2-argument first function + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R2>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R3>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R4>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R5>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R6>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R7>; + // 3-argument first function + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R2>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R3>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R4>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R5>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R6>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R7>; + // 4-argument first function + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; + // any-argument first function + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f1: (...args: any[]) => R1): LoDashExplicitAsyncWrapper<(...args: any[]) => R2>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitAsyncWrapper<(...args: any[]) => R3>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitAsyncWrapper<(...args: any[]) => R4>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitAsyncWrapper<(...args: any[]) => R5>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitAsyncWrapper<(...args: any[]) => R6>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitAsyncWrapper<(...args: any[]) => R7>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: any) => any>, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array<_.Many<(...args: any[]) => any>>): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: any) => any>, funcs: Array<_.Many<(...args: any[]) => any>>): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + identity(): this; + iteratee any>( + this: LoDashExplicitAsyncWrapper + ): LoDashExplicitAsyncWrapper; + matches(): LoDashExplicitAsyncWrapper<(value: V) => boolean>; + matchesProperty( + srcValue: SrcValue + ): LoDashExplicitAsyncWrapper<(value: any) => boolean>; + matchesProperty( + srcValue: SrcValue + ): LoDashExplicitAsyncWrapper<(value: Value) => boolean>; + method(...args: any[]): LoDashExplicitAsyncWrapper<(object: any) => any>; + methodOf( + ...args: any[] + ): LoDashExplicitAsyncWrapper<(path: _.PropertyPath) => any>; + mixin( + source: _.Dictionary<(...args: any[]) => any>, + options?: _.MixinOptions + ): this; + mixin( + options?: _.MixinOptions + ): LoDashExplicitAsyncWrapper<_.LoDashStatic>; + noConflict(): LoDashExplicitAsyncWrapper; + noop(...args: any[]): LoDashExplicitAsyncWrapper; + nthArg(): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + over( + this: LoDashExplicitAsyncWrapper<_.Many<(...args: any[]) => TResult>>, + ...iteratees: Array<_.Many<(...args: any[]) => TResult>> + ): LoDashExplicitAsyncWrapper<(...args: any[]) => TResult[]>; + overEvery(...predicates: Array<_.Many<(...args: T[]) => boolean>>): LoDashExplicitAsyncWrapper<(...args: T[]) => boolean>; + overSome(...predicates: Array<_.Many<(...args: T[]) => boolean>>): LoDashExplicitAsyncWrapper<(...args: T[]) => boolean>; + property(): LoDashExplicitAsyncWrapper<(obj: TObj) => TResult>; + propertyOf(): LoDashExplicitAsyncWrapper<(path: _.PropertyPath) => any>; + range( + end?: number, + step?: number + ): LoDashExplicitAsyncWrapper; + rangeRight( + end?: number, + step?: number + ): LoDashExplicitAsyncWrapper; + stubArray(): LoDashExplicitAsyncWrapper; + stubFalse(): LoDashExplicitAsyncWrapper; + stubObject(): LoDashExplicitAsyncWrapper; + stubString(): LoDashExplicitAsyncWrapper; + stubTrue(): LoDashExplicitAsyncWrapper; + times( + iteratee: (num: number) => TResult + ): LoDashExplicitAsyncWrapper; + times(): LoDashExplicitAsyncWrapper; + toPath(): LoDashExplicitAsyncWrapper; + uniqueId(): LoDashExplicitAsyncWrapper; + } +} diff --git a/types/lowdb/index.d.ts b/types/lowdb/index.d.ts index bab0116404..a8146ef8a2 100644 --- a/types/lowdb/index.d.ts +++ b/types/lowdb/index.d.ts @@ -1,83 +1,77 @@ -// Type definitions for Lowdb 1.0.0 +// Type definitions for Lowdb 1.0 // Project: https://github.com/typicode/lowdb // Definitions by: typicode // Bazyli Brzóska // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 -import { LoDashExplicitWrapper, LoDashStatic } from "lodash"; +/// + +import { LoDashStatic } from "lodash"; declare let Lowdb: Lowdb.lowdb; export = Lowdb; declare namespace Lowdb { - export type AdapterOptions = { + interface AdapterOptions { defaultValue?: SchemaT; serialize?: (data: SchemaT) => string; deserialize?: (serializedData: string) => SchemaT; - }; + } - export interface BaseAdapter - extends AdapterOptions { + interface BaseAdapter extends AdapterOptions { readonly "@@reference": SchemaT; - new ( + new ( source: string, options?: AdapterOptions ): BaseAdapter; source: string; } - export interface AdapterSync - extends BaseAdapter { - new ( + interface AdapterSync extends BaseAdapter { + new ( source: string, options?: AdapterOptions ): AdapterSync; - readonly "@@isAsync": False; - write(state: Object): void; + write(state: object): void; } - export interface AdapterAsync - extends BaseAdapter { - new ( + interface AdapterAsync extends BaseAdapter { + new ( source: string, options?: AdapterOptions ): AdapterAsync; - readonly "@@isAsync": True; - write(state: Object): Promise; + write(state: object): Promise; } - export type Adapter = - | AdapterSync - | AdapterAsync; - - export interface LowdbBase< - SchemaT extends {}, - AdapterT extends Adapter - > { - read: () => Wrapper; + interface LowdbBase { getState: () => SchemaT; setState: (state: SchemaT) => this; } - export interface Lowdb> - extends LowdbBase, - LoDashExplicitWrapper { + interface LowdbSync extends LowdbBase, LoDashExplicitSyncWrapper { _: LoDashStatic; + read: () => this; /** * @description Be careful: This function overwrites the whole database. */ - write(returnValue?: T): Wrapper; + write(returnValue?: T): T; } - export interface LowdbFp< - SchemaT extends {} = any, - AdapterT extends Adapter = Adapter - > extends LowdbBase { + interface LowdbAsync extends LowdbBase, LoDashExplicitAsyncWrapper { + _: LoDashStatic; + read: () => Promise; /** * @description Be careful: This function overwrites the whole database. */ - write(returnValue?: T): Wrapper; + write(returnValue?: T): Promise; + } + + interface LowdbFpSync extends LowdbBase { + /** + * @description Be careful: This function overwrites the whole database. + */ + write(returnValue?: T): T; /** * @description Returns a function that allows you to access/modify the database at a given path. * @example @@ -90,11 +84,11 @@ declare namespace Lowdb { ( path: TKey | [TKey], defaultValue?: SchemaT[TKey] - ): FpReturn; + ): FpReturnSync; ( path: [TKey, TSubKey], defaultValue?: SchemaT[TKey][TSubKey] - ): FpReturn; + ): FpReturnSync; < TKey extends keyof SchemaT, TSubKey extends keyof SchemaT[TKey], @@ -102,7 +96,7 @@ declare namespace Lowdb { >( path: [TKey, TSubKey, TSubKey2], defaultValue?: SchemaT[TKey][TSubKey][TSubKey2] - ): FpReturn; + ): FpReturnSync; < TKey extends keyof SchemaT, TSubKey extends keyof SchemaT[TKey], @@ -111,7 +105,7 @@ declare namespace Lowdb { >( path: [TKey, TSubKey, TSubKey2, TSubKey3], defaultValue?: SchemaT[TKey][TSubKey][TSubKey2][TSubKey3] - ): FpReturn; + ): FpReturnSync; < TKey extends keyof SchemaT, TSubKey extends keyof SchemaT[TKey], @@ -121,10 +115,63 @@ declare namespace Lowdb { >( path: [TKey, TSubKey, TSubKey2, TSubKey3, TSubKey4], defaultValue?: SchemaT[TKey][TSubKey][TSubKey2][TSubKey3][TSubKey4] - ): FpReturn; - (path: string | Array, defaultValue?: T): T; + ): FpReturnSync; + (path: string | string[], defaultValue?: T): FpReturnSync; } - export interface FpReturn { + + interface LowdbFpAsync extends LowdbBase { + /** + * @description Be careful: This function overwrites the whole database. + */ + write(returnValue?: T): Promise; + /** + * @description Returns a function that allows you to access/modify the database at a given path. + * @example + * ```js + * const posts = db('posts') + * const firstPost = posts(all => all[0]) + * posts.write((allPosts) => [...allPosts, {title: 'Yup!'}]) + * ``` + */ + ( + path: TKey | [TKey], + defaultValue?: SchemaT[TKey] + ): FpReturnAsync; + ( + path: [TKey, TSubKey], + defaultValue?: SchemaT[TKey][TSubKey] + ): FpReturnAsync; + < + TKey extends keyof SchemaT, + TSubKey extends keyof SchemaT[TKey], + TSubKey2 extends keyof SchemaT[TKey][TSubKey] + >( + path: [TKey, TSubKey, TSubKey2], + defaultValue?: SchemaT[TKey][TSubKey][TSubKey2] + ): FpReturnAsync; + < + TKey extends keyof SchemaT, + TSubKey extends keyof SchemaT[TKey], + TSubKey2 extends keyof SchemaT[TKey][TSubKey], + TSubKey3 extends keyof SchemaT[TKey][TSubKey][TSubKey2] + >( + path: [TKey, TSubKey, TSubKey2, TSubKey3], + defaultValue?: SchemaT[TKey][TSubKey][TSubKey2][TSubKey3] + ): FpReturnAsync; + < + TKey extends keyof SchemaT, + TSubKey extends keyof SchemaT[TKey], + TSubKey2 extends keyof SchemaT[TKey][TSubKey], + TSubKey3 extends keyof SchemaT[TKey][TSubKey][TSubKey2], + TSubKey4 extends keyof SchemaT[TKey][TSubKey][TSubKey2][TSubKey3] + >( + path: [TKey, TSubKey, TSubKey2, TSubKey3, TSubKey4], + defaultValue?: SchemaT[TKey][TSubKey][TSubKey2][TSubKey3][TSubKey4] + ): FpReturnAsync; + (path: string | string[], defaultValue?: T): FpReturnAsync; + } + + interface FpReturnBase { /** * Execute a series of functions on the data at a given path. * Result of previous function is the input of the next one. @@ -168,7 +215,8 @@ declare namespace Lowdb { ] ): R7; (funcs: Array<(a: any) => any>): any; - + } + interface FpReturnSync extends FpReturnBase { /** * @description Writes the change to the database, based on the callback's return value. * @example @@ -176,198 +224,37 @@ declare namespace Lowdb { * posts.write((allPosts) => [...allPosts, {title: 'Yup!'}]) * ``` */ - write(f1: (a1: PathT) => R1): Wrapper; + write(f1: (a1: PathT) => R1): R1; + } + interface FpReturnAsync extends FpReturnBase { + /** + * @description Writes the change to the database, based on the callback's return value. + * @example + * ```js + * posts.write((allPosts) => [...allPosts, {title: 'Yup!'}]) + * ``` + */ + write(f1: (a1: PathT) => R1): Promise; } - export type lowdb = < - SchemaT extends AdapterT[ReferenceProperty], - AdapterT extends Adapter - >( - adapter: AdapterT - ) => If< - AdapterT[AsyncProperty], - Promise, AdapterT>>, - Lowdb, AdapterT> - >; + interface lowdb { + (adapter: AdapterT): Promise>; + (adapter: AdapterT): LowdbSync; + } - export type lowdbFp = < - SchemaT extends AdapterT[ReferenceProperty], - AdapterT extends Adapter - >( - adapter: AdapterT - ) => If< - AdapterT[AsyncProperty], - Promise>, - LowdbFp - >; + interface lowdbFp { + (adapter: AdapterT): Promise>; + (adapter: AdapterT): LowdbFpSync; + } - export type Wrapper = WrapInPromiseIfTrue< - T, - AdapterT[AsyncProperty] - >; -} - -/** - * lodash augmentation is necessary in order not to duplicate the whole lodash definition - * it's mostly harmless, aside from the fact that 'write' becomes a method in a lodash.chain() - */ -declare module "lodash" { - interface LoDashExplicitWrapper { - write(): WrapInPromiseIfAsyncTag>; - // override lodash's methods only if source tag is present: - value(): GetReferenceTypeIfDefined; + // Note: this interface is augmented in _lodash.d.ts + interface LoDashExplicitSyncWrapper extends _.LoDashWrapper { + write(): TValue; + } + // Note: this interface is augmented in _lodash.d.ts + interface LoDashExplicitAsyncWrapper extends _.LoDashWrapper { + write(): Promise; } } -// utility types: -type WrapInPromiseIfTrue = If, T>; type ReferenceProperty = "@@reference"; -/** - * Hidden source property for resolving to the correct type. - * It is doubly nested so that we retain all nullability information - */ -type SourceReference = { - readonly "@@reference"?: { readonly "@@reference": T }; -}; -type GetReferenceParent> = NonNull< - U[keyof U & ReferenceProperty] ->; -type GetDefinedReferenceType< - TValue, - SourceParent = GetReferenceParent -> = SourceParent[keyof SourceParent & ReferenceProperty]; -type AsyncProperty = "@@isAsync"; -type AsyncTag = { readonly "@@reference"?: { readonly "@@isAsync"?: true } }; -type SyncTag = {}; -type HasAsyncTag> = If< - HasReferenceProperty, - UnionHasKey, - False ->; -type HasReferenceProperty = UnionHasKey, ReferenceProperty>; -type WrapInPromiseIfAsyncTag< - TaggedT, - WrappedT = GetReferenceTypeIfDefined -> = WrapInPromiseIfTrue>; - -/** - * Resolves the hidden source type - * while preserving nullability as much as possible - */ -type GetReferenceType> = If< - IsEmptyType, - Source | undefined, - Source ->; - -type GetReferenceTypeIfDefined = If< - HasReferenceProperty, - GetReferenceType, - T ->; - -type RecursivelyExtend = If< - IsArrayType, - MapArrayType, AddT>, - MapScalarOrObjectType -> & - SourceReference; - -type MapScalarOrObjectType = If< - IsScalarOrInstance, - T, - MapObjectWithPossibleArrays & SourceReference & AddT ->; - -type MapObjectWithPossibleArrays = { - [P in keyof T]: If< - IsArrayType, - MapArrayType, AddT> & SourceReference, - MapScalarOrObjectType - > -}; - -type MapArrayType, AddT, T = Arr[-1]> = Array< - MapObjectWithPossibleArrays & SourceReference & AddT -> & - AddT; - -////////////////////////////////////////// -// generic utils (some from https://github.com/tycho01/typical/): - -type False = "0"; -type True = "1"; -type Bool = True | False; -type If = { 1: Then; 0: Else }[Cond]; - -type Obj = { [k: string]: T }; - -type And = ({ 1: { 1: "1" } & Obj<"0"> } & Obj< - Obj<"0"> ->)[A][B]; - -type UnionHasKey = ({ - [S in Union]: "1" -} & - Obj<"0">)[K]; - -type Indeterminate = And< - UnionHasKey, - UnionHasKey ->; - -type Not = { "1": "0"; "0": "1" }[T]; - -type Determinate = Not>; - -type DefinitelyYes = And>; - -type UnionContained = DefinitelyYes< - ({ [P in U]: "1" } & Obj<"0">)[T | U] ->; - -type UnionEmpty = And< - UnionContained, - UnionContained ->; - -type UnionToObject = { [K in Keys]: K }; - -type Keyed = { [K in keyof T]: K }; - -type KeyedSafe = Keyed & Obj; - -type IntersectionUnions = KeyedSafe< - UnionToObject ->[Big]; -type UnionsOverlap = Not< - UnionEmpty> ->; - -type DiffUnion = ({ [P in T]: P } & - { [P in U]: never } & { [k: string]: never })[T]; - -type ObjectHasKey = UnionHasKey; - -type ArrayPrototypeProperties = DiffUnion< - keyof Array, - "toString" | "toLocaleString" ->; -type IsArrayType = DefinitelyYes>; -/** - * either: undefined, never, null or {} - * can also be used to check if one union contains one of the above - **/ -type IsEmptyType = UnionEmpty; - -/** - * false for: undefined, interfaces - * true for: Array, boolean, number, string, Object - */ -type IsScalarOrInstance = ObjectHasKeySafe; -type ObjectHasKeySafe = UnionsOverlap; -type NonNull = T & {}; - -interface List { - readonly [n: number]: T; -} diff --git a/types/lowdb/lowdb-tests.ts b/types/lowdb/lowdb-tests.ts index d466681ab4..45662ce342 100644 --- a/types/lowdb/lowdb-tests.ts +++ b/types/lowdb/lowdb-tests.ts @@ -1,12 +1,14 @@ import * as low from "lowdb"; import * as lowfp from "lowdb/lib/fp"; +import * as Base from "lowdb/adapters/Base"; import * as FileSync from "lowdb/adapters/FileSync"; import * as FileAsync from "lowdb/adapters/FileAsync"; import * as LocalStorage from "lowdb/adapters/LocalStorage"; +import { find, filter, random, concat, sortBy, take, set } from "lodash/fp"; -const adapterSync: low.AdapterSync<{}> = new FileSync("db.json"); -const adapterAsync: low.AdapterAsync<{}> = new FileAsync("db.json"); -const db = low(adapterSync); +const adapterSync = new FileSync("db.json"); +const adapterAsync = new FileAsync("db.json"); +const db = low(adapterSync); const write: DbSchema = db.defaults({ posts: [] }).write(); @@ -15,25 +17,16 @@ const result: Post[] = db .push({ title: "hello", views: 123 }) .value(); -const teste = db.get("user").value(); -const post: Post | undefined = db - .get("posts") +// $ExpectType Post | undefined +db.get("posts") .find({ id: 123 }) .value(); - -// $ExpectError -const postAssertWithUndefined: Post = db - .get("posts") - .find({ id: 123 }) - .value(); - -// $ExpectError -const postAssertWithUndefined2: Post = db - .get("posts") +// $ExpectType Post | undefined +db.get("posts") .find({ id: 123 }) .write(); -low(adapterAsync).then(dbAsync => { +low(adapterAsync).then(dbAsync => { const writeAction: Promise = dbAsync .get("posts") .push({ title: "async hello" }) @@ -76,11 +69,10 @@ async () => { const dbSync = low(adapterSync); const dbAsync = await low(adapterAsync); - const dbAssertTypeSync: low.Lowdb = dbSync; - const dbAssertTypeAsync: low.Lowdb< - ExampleSchema, - typeof adapterAsync - > = dbAsync; + // $ExpectType LowdbSync + dbSync; + // $ExpectType LowdbAsync + dbAsync; const xSync: ExampleSchema = dbSync .defaults({ posts: [{ name: "baz" }] }) @@ -100,7 +92,9 @@ async () => { .push({ name: "hello" }) .write(); - const dbPromise = low(adapterAsync); + const otherAdapterAsync = new FileAsync("db.json"); + + const dbPromise = low(otherAdapterAsync); const db = await dbPromise; const nested: OtherSchema["nested"] = db.get("nested").value(); @@ -124,37 +118,32 @@ const weDidNotBreakLodash: ExampleSchema["posts"] = lodashChain const adapterLS = new LocalStorage("test.json"); const dbFP = lowfp(adapterLS); // Get posts - const postsFP: low.FpReturn> = dbFP( - "posts" - ); + const postsFP = dbFP("posts"); // replace posts with a new array resulting from concat // and persist database const write: Post[] = postsFP.write( - concat({ title: "lowdb is awesome", views: random(0, 5) }) + concat({ title: "lowdb is awesome", views: random(0, 5) }) ); // Find post by id - const post: Post = postsFP(find({ id: 1 })); + const post: Post | undefined = postsFP(find({ id: 1 })); // Find top 5 fives posts const popular: Post[] = postsFP([ - sortBy("views") as PostsAction, + sortBy("views") as PostsAction, take(5) as PostsAction ]); - const filtered: Post[] = dbFP("posts")(filter({ published: true })); - const writeAction: Post[] = dbFP("posts").write(concat({ id: "123" })); - const writeAction2: string = dbFP(["user", "name"]).write(set("typicode")); + const filtered: Post[] = dbFP("posts")(filter({ published: true })); + const writeAction: Post[] = dbFP("posts").write(concat({ id: 123 })); + const writeAction2: string = dbFP(["user", "name"]).write(() => "typicode"); async () => { const adapterAsync = new FileAsync("test.json"); const dbAsyncPromise = lowfp(adapterAsync); const dbAsync = await dbAsyncPromise; - const postsWithDefault: low.FpReturn< - Post[], - low.AdapterAsync - > = dbAsync("posts", [{ title: "baz" }] as Post[]); + const postsWithDefault = dbAsync("posts", [{ title: "baz" }] as Post[]); const func: Promise = postsWithDefault.write(post => [ ...post, @@ -165,16 +154,8 @@ const weDidNotBreakLodash: ExampleSchema["posts"] = lodashChain type PostsAction = (posts: Post[]) => Post[]; }; -declare function find(a: B): (arr: A[]) => A; -declare function filter(a: B): (arr: A[]) => A[]; -declare function random(a: number, b: number): number; -declare function concat(a: any): (arr: A) => A; -declare function sortBy(a: any): (arr: A) => A; -declare function take(a: A): (arr: A) => A; -declare function set(a: A): (val: A) => A; - interface DbSchema { - posts: Array; + posts: Post[]; user: { name: string; }; @@ -184,7 +165,7 @@ interface Post { title?: string; views?: number; id?: number; - published?: boolean | undefined; + published?: boolean; tuple?: [boolean, number]; } diff --git a/types/lowdb/tslint.json b/types/lowdb/tslint.json index a41bf5d19a..dfea11be1a 100644 --- a/types/lowdb/tslint.json +++ b/types/lowdb/tslint.json @@ -1,79 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "no-misused-new": false } } From af589d355f308cb4df34f25f0ca222ac5bac1d96 Mon Sep 17 00:00:00 2001 From: denisname Date: Wed, 25 Apr 2018 01:04:48 +0200 Subject: [PATCH 0817/2153] d3-color: strict null checks and `instanceof` (#25211) * Strict null checks strict null check, uncomment prototypes, RGBColor#rgb returns this, remove `displayable` and `toString` when inherits `Color` * Contributors --- types/d3-color/d3-color-tests.ts | 50 ++++++++++++++++++-------------- types/d3-color/index.d.ts | 26 ++++++++--------- types/d3-color/tsconfig.json | 2 +- 3 files changed, 43 insertions(+), 35 deletions(-) diff --git a/types/d3-color/d3-color-tests.ts b/types/d3-color/d3-color-tests.ts index c001080d36..47f191073b 100644 --- a/types/d3-color/d3-color-tests.ts +++ b/types/d3-color/d3-color-tests.ts @@ -8,37 +8,21 @@ import * as d3Color from 'd3-color'; -// RGB and HSL Typeguards - -function isRGB(color: d3Color.RGBColor | d3Color.HSLColor): color is d3Color.RGBColor { - return (color instanceof d3Color.rgb); -} - -function isHSL(color: d3Color.RGBColor | d3Color.HSLColor): color is d3Color.HSLColor { - return (color instanceof d3Color.hsl); -} - // Signature tests for 'color', rgb and hsl -let c: d3Color.RGBColor | d3Color.HSLColor; +let c: d3Color.RGBColor | d3Color.HSLColor | null; let cRGB: d3Color.RGBColor; let cHSL: d3Color.HSLColor; let displayable: boolean; let cString: string; +let nil: null; -// string signature +c = d3Color.color('oops'); c = d3Color.color('steelblue'); - -if (isRGB(c)) { - cRGB = c; -} else { - cHSL = c; -} - c = d3Color.color('rgba(20, 100, 200, 0.5)'); -c = d3Color.color(cRGB); +c = d3Color.color(d3Color.rgb(0, 0, 0)); -cRGB = d3Color.color('hsl(60, 100%, 20%, 0.5)').rgb(); +cRGB = d3Color.color('hsl(60, 100%, 20%, 0.5)')!.rgb(); cRGB = d3Color.rgb(20, 100, 200); cRGB = d3Color.rgb(20, 100, 200, 0.5); @@ -126,3 +110,27 @@ displayable = cCubehelix.displayable(); cString = cCubehelix.toString(); console.log('Channels = (h : %d, s: %d, l: %d)', cCubehelix.h, cCubehelix.s, cCubehelix.l); console.log('Opacity = %d', cCubehelix.opacity); + +// Prototype, instanceof and typeguard + +declare let color: d3Color.RGBColor | d3Color.HSLColor | d3Color.LabColor | d3Color.HCLColor | d3Color.CubehelixColor | null; + +if (color instanceof d3Color.rgb) { + cRGB = color; +} else if (color instanceof d3Color.hsl) { + cHSL = color; +} else if (color instanceof d3Color.lab) { + cLab = color; +} else if (color instanceof d3Color.hcl) { + cHcl = color; +} else if (color instanceof d3Color.cubehelix) { + cCubehelix = color; +} else if (color === null) { + nil = color; +} + +if (color instanceof d3Color.color) { + console.log(color.toString(), color.darker()); +} else { + nil = color; +} diff --git a/types/d3-color/index.d.ts b/types/d3-color/index.d.ts index 96b24fd09e..825b82d9c4 100644 --- a/types/d3-color/index.d.ts +++ b/types/d3-color/index.d.ts @@ -1,9 +1,12 @@ // Type definitions for D3JS d3-color module 1.0 // Project: https://github.com/d3/d3-color/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov +// Definitions by: Tom Wanzek +// Alex Ford +// Boris Yankov +// denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Last module patch version validated against: 1.0.1 +// Last module patch version validated against: 1.0.3 // --------------------------------------------------------------------------- // Shared Type Definitions and Interfaces @@ -32,9 +35,9 @@ export interface Color { } export interface ColorFactory extends Function { - (cssColorSpecifier: string): RGBColor | HSLColor; + (cssColorSpecifier: string): RGBColor | HSLColor | null; (color: ColorSpaceObject | ColorCommonInstance): RGBColor | HSLColor; - // prototype: Color; + readonly prototype: Color; } export interface RGBColor extends Color { @@ -44,16 +47,14 @@ export interface RGBColor extends Color { opacity: number; brighter(k?: number): this; darker(k?: number): this; - displayable(): boolean; - rgb(): RGBColor; - toString(): string; + rgb(): this; } export interface RGBColorFactory extends Function { (r: number, g: number, b: number, opacity?: number): RGBColor; (cssColorSpecifier: string): RGBColor; (color: ColorSpaceObject | ColorCommonInstance): RGBColor; - // prototype: RGBColor; + readonly prototype: RGBColor; } export interface HSLColor extends Color { @@ -63,7 +64,6 @@ export interface HSLColor extends Color { opacity: number; brighter(k?: number): this; darker(k?: number): this; - displayable(): boolean; rgb(): RGBColor; } @@ -71,7 +71,7 @@ export interface HSLColorFactory extends Function { (h: number, s: number, l: number, opacity?: number): HSLColor; (cssColorSpecifier: string): HSLColor; (color: ColorSpaceObject | ColorCommonInstance): HSLColor; - // prototype: HSLColor; + readonly prototype: HSLColor; } export interface LabColor extends Color { @@ -88,7 +88,7 @@ export interface LabColorFactory extends Function { (l: number, a: number, b: number, opacity?: number): LabColor; (cssColorSpecifier: string): LabColor; (color: ColorSpaceObject | ColorCommonInstance): LabColor; - // prototype: LabColor; + readonly prototype: LabColor; } export interface HCLColor extends Color { @@ -105,7 +105,7 @@ export interface HCLColorFactory extends Function { (h: number, l: number, c: number, opacity?: number): HCLColor; (cssColorSpecifier: string): HCLColor; (color: ColorSpaceObject | ColorCommonInstance): HCLColor; - // prototype: HCLColor; + readonly prototype: HCLColor; } export interface CubehelixColor extends Color { @@ -122,7 +122,7 @@ export interface CubehelixColorFactory extends Function { (h: number, s: number, l: number, opacity?: number): CubehelixColor; (cssColorSpecifier: string): CubehelixColor; (color: ColorSpaceObject | ColorCommonInstance): CubehelixColor; - // prototype: CubehelixColor; + readonly prototype: CubehelixColor; } // -------------------------------------------------------------------------- diff --git a/types/d3-color/tsconfig.json b/types/d3-color/tsconfig.json index d783922755..f5229e4fd8 100644 --- a/types/d3-color/tsconfig.json +++ b/types/d3-color/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ From 3363dfb20e55319cb0d9e996bb7394e8d790141b Mon Sep 17 00:00:00 2001 From: Colin Luo Date: Wed, 25 Apr 2018 07:05:35 +0800 Subject: [PATCH 0818/2153] Update `klaw-sync` module interface from v1.0 to v2.0.0 + (#25134) * commit 'Update `klaw-sync` module interface to v2.0.0 + [v2.0.0 apis](https://github.com/manidlou/node-klaw-sync/tree/v2.0.0) [v3.0.2 apis](https://github.com/manidlou/node-klaw-sync/tree/v3.0.2) * Update `klaw-sync` module interface from v1.0 to v2.0.0 + * Update `klaw-sync` module interface from v1.0 to v2.0.0 + * Change `klaw-sync` types version from `3.0` to `2.0` and remove ignore parameter. * Update test case. * Improve the test case of `options.filter`. * Add definitions of `klaw-sync` * Remove `Colin Luo` from `klaw-sync` Difinitions. --- types/klaw-sync/index.d.ts | 69 ++++++++++++++++++------------ types/klaw-sync/klaw-sync-tests.ts | 11 +++-- 2 files changed, 49 insertions(+), 31 deletions(-) diff --git a/types/klaw-sync/index.d.ts b/types/klaw-sync/index.d.ts index 1bdd409dfc..f222804222 100644 --- a/types/klaw-sync/index.d.ts +++ b/types/klaw-sync/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for klaw-sync 1.1 +// Type definitions for klaw-sync 2.0 // Project: https://github.com/manidlou/node-klaw-sync // Definitions by: Brendan Forster // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,35 +6,50 @@ /// import * as fs from 'fs' - declare namespace klawSync { - interface Item { - path: string - stats: fs.Stats - } + interface Item { + path: string + stats: fs.Stats + } - interface Options { - /** - * any paths or `micromatch` patterns to ignore. - * - * For more information on micromatch patterns: https://github.com/jonschlinkert/micromatch#features - */ - ignore?: string | string[] - /** - * True to only return files (ignore directories). - * - * Defaults to false if not specified. - */ - nodir?: boolean - /** - * True to only return directories (ignore files). - * - * Defaults to false if not specified. - */ - nofile?: boolean - } + type Filter = (item: Item) => boolean + + interface Options { + /** + * @description True to only return files (ignore directories). + * Defaults to false if not specified. + * @default false + */ + nodir?: boolean + + /** + * @description True to only return directories (ignore files). + * Defaults to false if not specified. + * @default false + */ + nofile?: boolean + + /** + * @description when filter function is used, the default behavior is to read all directories even + * if they don't pass the filter function (won't be included but still will be traversed). + * If you set true, there will be neither inclusion nor traversal for directories that + * don't pass the filter function + * @since v2.0.0 + */ + noRecurseOnFailedFilter?: boolean + + /** + * @description function that gets one argument fn({path: '', stats: {}}) and returns true to include + * or false to exclude the item + * @since v2.0.0 + */ + filter?: Filter + } } -declare function klawSync(root: string, options?: klawSync.Options): ReadonlyArray +declare function klawSync( + root: string, + options?: klawSync.Options, +): ReadonlyArray export = klawSync diff --git a/types/klaw-sync/klaw-sync-tests.ts b/types/klaw-sync/klaw-sync-tests.ts index 4808146882..5875c528fd 100644 --- a/types/klaw-sync/klaw-sync-tests.ts +++ b/types/klaw-sync/klaw-sync-tests.ts @@ -2,7 +2,7 @@ import * as path from 'path' import klawSync = require('klaw-sync') const outputMessage = (result: klawSync.Item) => { - console.log(`file: ${result.path} has size '${result.stats.size}'`) + console.log(`file: ${result.path} has size '${result.stats.size}'`) } klawSync('/some/dir').forEach(outputMessage) @@ -12,9 +12,12 @@ const defaultOptions = {} klawSync('/some/dir', defaultOptions).forEach(outputMessage) const options = { - ignore: ['.exe'], - nodir: true, - nofile: false, + nodir: true, + nofile: false, + noRecurseOnFailedFilter: false, + filter(item: klawSync.Item) { + return item.path.indexOf('node_modules') < 0 + }, } klawSync('/some/dir', options).forEach(outputMessage) From 0c0e3799ecd229f671b9e6598f7db85b561db959 Mon Sep 17 00:00:00 2001 From: denisname Date: Wed, 25 Apr 2018 01:06:06 +0200 Subject: [PATCH 0819/2153] d3-axis strictNullChecks and strictFunctionTypes (#25066) --- types/d3-axis/d3-axis-tests.ts | 26 +++++++++++++----- types/d3-axis/index.d.ts | 48 ++++++++++++++++++++-------------- types/d3-axis/tsconfig.json | 2 +- 3 files changed, 48 insertions(+), 28 deletions(-) diff --git a/types/d3-axis/d3-axis-tests.ts b/types/d3-axis/d3-axis-tests.ts index f2b47beaa8..8edd1ab1c4 100644 --- a/types/d3-axis/d3-axis-tests.ts +++ b/types/d3-axis/d3-axis-tests.ts @@ -47,6 +47,7 @@ axisScaleNumber = scaleBand(); axisScaleNumber = scalePoint(); axisScaleString = scaleBand(); axisScaleString = scalePoint(); + // -------------------------------------------------------------------------- // Test AxisContainerElement // -------------------------------------------------------------------------- @@ -58,7 +59,8 @@ const canvas: HTMLCanvasElement = select('canvas').node( containerElement = svg; containerElement = g; -// containerElement = canvas; // fails, incompatible type +// $ExpectError +containerElement = canvas; // fails, incompatible type // -------------------------------------------------------------------------- // Test Axis Generators @@ -77,14 +79,13 @@ let leftAxis: d3Axis.Axis = d3Axis.axisLeft(scal leftAxis = leftAxis.scale(scalePow()); const powerScale: ScalePower = leftAxis.scale>(); -// powerScale = leftAxis.scale(); // fails, without casting as AxisScale is purposely generic bottomAxis = bottomAxis.scale(scaleOrdinal()); -// bottomAxis = bottomAxis.scale(scalePow()) // fails, domain of scale incompatible with domain of axis +// $ExpectError +bottomAxis = bottomAxis.scale(scalePow()); // fails, domain of scale incompatible with domain of axis const axisScale: d3Axis.AxisScale = bottomAxis.scale(); const ordinalScale: ScaleOrdinal = bottomAxis.scale>(); -// ordinalScale = bottomAxis.scale(); // fails, without casting as AxisScale is purposely generic // ticks(...) ---------------------------------------------------------------- @@ -119,6 +120,7 @@ const formatFn: ((domainValue: string, index: number) => string) | null = bottom bottomAxis.tickFormat((d, i) => '#' + i); bottomAxis.tickFormat(d => d + '!'); + // tickSize(...) ---------------------------------------------------------------- rightAxis = rightAxis.tickSize(5); @@ -149,14 +151,24 @@ const gTransition = gSelection.transition(); gSelection.call(topAxis); gTransition.call(topAxis); -const svgSelection: Selection = select('g'); +const svgSelection: Selection = select('svg'); const svgTransition = svgSelection.transition(); svgSelection.call(leftAxis); svgTransition.call(leftAxis); +const pathSelection: Selection = select('path'); +const pathTransition = svgSelection.transition(); + +// // $ExpectError +// pathSelection.call(bottomAxis); +// // $ExpectError +// pathSelection.call(bottomAxis); + const canvasSelection: Selection = select('canvas'); const canvasTransition = canvasSelection.transition(); -// canvasSelection.call(rightAxis); // fails, incompatible context container element -// canvasTransition.call(rightAxis); // fails, incompatible context container element +// $ExpectError +canvasSelection.call(rightAxis); // fails, incompatible context container element +// $ExpectError +canvasTransition.call(rightAxis); // fails, incompatible context container element diff --git a/types/d3-axis/index.d.ts b/types/d3-axis/index.d.ts index 1c7820c809..ea67b74209 100644 --- a/types/d3-axis/index.d.ts +++ b/types/d3-axis/index.d.ts @@ -1,6 +1,9 @@ // Type definitions for D3JS d3-axis module 1.0 // Project: https://github.com/d3/d3-axis/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov +// Definitions by: Tom Wanzek +// Alex Ford +// Boris Yankov +// denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Last module patch version validated against: 1.0.8 @@ -11,6 +14,11 @@ import { Selection, TransitionLike } from 'd3-selection'; // Shared Types and Interfaces // -------------------------------------------------------------------------- +/** + * A helper type to alias elements which can serve as a domain for an axis. + */ +export type AxisDomain = number | string | Date | { valueOf(): number}; + /** * A helper interface to describe the minimal contract to be met by a time interval * which can be passed into the Axis.ticks(...) or Axis.tickArguments(...) methods when @@ -29,7 +37,7 @@ export interface AxisTimeInterval { /** * A helper interface to which a scale passed into axis must conform (at a minimum) - * for axis to use the scale without error + * for axis to use the scale without error. */ export interface AxisScale { (x: Domain): number | undefined; @@ -37,7 +45,7 @@ export interface AxisScale { range(): number[]; copy(): this; bandwidth?(): number; - // TODO: Reconsider the below, note that the compiler does not differentiate the overloads w.r.t. optionality + // TODO: Reconsider the below, note that the compiler does not differentiate the overloads w.r.t. optionality // ticks?(count?: number): Domain[]; // ticks?(count?: AxisTimeInterval): Date[]; // tickFormat?(count?: number, specifier?: string): ((d: number) => string); @@ -45,12 +53,12 @@ export interface AxisScale { } /** - * A helper type to alias elements which can serve as a container for an axis + * A helper type to alias elements which can serve as a container for an axis. */ export type AxisContainerElement = SVGSVGElement | SVGGElement; /** - * Interface defining an axis generator. The generic is the type of the axis domain + * Interface defining an axis generator. The generic is the type of the axis domain. */ export interface Axis { /** @@ -58,14 +66,14 @@ export interface Axis { * * @param context A selection of SVG containers (either SVG or G elements). */ - (context: Selection): void; + (context: Selection | Selection): void; /** * Render the axis to the given context. * * @param context A transition defined on SVG containers (either SVG or G elements). */ - (context: TransitionLike): void; + (context: TransitionLike | TransitionLike): void; /** * Gets the current scale underlying the axis. @@ -75,7 +83,7 @@ export interface Axis { /** * Sets the scale and returns the axis. * - * @param scale The scale to be used for axis generation + * @param scale The scale to be used for axis generation. */ scale(scale: AxisScale): this; @@ -86,7 +94,7 @@ export interface Axis { * * This method is also a convenience function for axis.tickArguments. * - * @param count Number of ticks that should be rendered + * @param count Number of ticks that should be rendered. * @param specifier An optional format specifier to customize how the tick values are formatted. */ ticks(count: number, specifier?: string): this; @@ -178,7 +186,7 @@ export interface Axis { * * See also axis.ticks. * - * @param args An array with arguments suitable for the scale to be used for tick generation + * @param args An array with arguments suitable for the scale to be used for tick generation. */ tickArguments(args: any[]): this; @@ -210,7 +218,7 @@ export interface Axis { tickFormat(): ((domainValue: Domain, index: number) => string) | null; /** - * Sets the tick format function and returns the axis. + * Sets the tick format function and returns the axis. * * @param format A function mapping a value from the axis Domain to a formatted string * for display purposes. When invoked, the format function is also passed a second argument representing the zero-based index @@ -287,7 +295,7 @@ export interface Axis { /** * Set the current padding and return the axis. * - * @param padding Padding in pixels (Default is 3). + * @param padding Padding in pixels (Default is 3). */ tickPadding(padding: number): this; } @@ -296,30 +304,30 @@ export interface Axis { * Constructs a new top-oriented axis generator for the given scale, with empty tick arguments, * a tick size of 6 and padding of 3. In this orientation, ticks are drawn above the horizontal domain path. * - * @param scale The scale to be used for axis generation + * @param scale The scale to be used for axis generation. */ -export function axisTop(scale: AxisScale): Axis; +export function axisTop(scale: AxisScale): Axis; /** * Constructs a new right-oriented axis generator for the given scale, with empty tick arguments, * a tick size of 6 and padding of 3. In this orientation, ticks are drawn to the right of the vertical domain path. * - * @param scale The scale to be used for axis generation + * @param scale The scale to be used for axis generation. */ -export function axisRight(scale: AxisScale): Axis; +export function axisRight(scale: AxisScale): Axis; /** * Constructs a new bottom-oriented axis generator for the given scale, with empty tick arguments, * a tick size of 6 and padding of 3. In this orientation, ticks are drawn below the horizontal domain path. * - * @param scale The scale to be used for axis generation + * @param scale The scale to be used for axis generation. */ -export function axisBottom(scale: AxisScale): Axis; +export function axisBottom(scale: AxisScale): Axis; /** * Constructs a new left-oriented axis generator for the given scale, with empty tick arguments, * a tick size of 6 and padding of 3. In this orientation, ticks are drawn to the left of the vertical domain path. * - * @param scale The scale to be used for axis generation + * @param scale The scale to be used for axis generation. */ -export function axisLeft(scale: AxisScale): Axis; +export function axisLeft(scale: AxisScale): Axis; diff --git a/types/d3-axis/tsconfig.json b/types/d3-axis/tsconfig.json index 5b54d1f622..0e15092e48 100644 --- a/types/d3-axis/tsconfig.json +++ b/types/d3-axis/tsconfig.json @@ -8,7 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" From 02ed6f6b493e23f8df3d95c4c12c5bafcbdc8b8b Mon Sep 17 00:00:00 2001 From: Martin Donath Date: Wed, 25 Apr 2018 01:06:22 +0200 Subject: [PATCH 0820/2153] Added missing field `apiKeyId` to API Gateway request context (#25195) * Added missing field `apiKeyId` to API Gateway request context `$context.identity.apiKeyId`: The API key ID associated with the key-enabled API request. See the [AWS documentation](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html) and search for `apiKeyId`. * Added missing tests for new apiKeyId field in aws-lambda typings --- types/aws-lambda/aws-lambda-tests.ts | 1 + types/aws-lambda/index.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index dc16eca58f..8ffff3d8a3 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -83,6 +83,7 @@ str = apiGwEvtReqCtx.httpMethod; strOrNull = apiGwEvtReqCtx.identity.accessKey; strOrNull = apiGwEvtReqCtx.identity.accountId; strOrNull = apiGwEvtReqCtx.identity.apiKey; +strOrNull = apiGwEvtReqCtx.identity.apiKeyId; strOrNull = apiGwEvtReqCtx.identity.caller; strOrNull = apiGwEvtReqCtx.identity.cognitoAuthenticationProvider; strOrNull = apiGwEvtReqCtx.identity.cognitoAuthenticationType; diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index c060bc10ee..cdee868594 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -31,6 +31,7 @@ export interface APIGatewayEventRequestContext { accessKey: string | null; accountId: string | null; apiKey: string | null; + apiKeyId: string | null; caller: string | null; cognitoAuthenticationProvider: string | null; cognitoAuthenticationType: string | null; From 2d3747f9986d74f8e793a7c042c1a5619d693c2e Mon Sep 17 00:00:00 2001 From: Simon Schick Date: Wed, 25 Apr 2018 01:06:35 +0200 Subject: [PATCH 0821/2153] fix(hapi): make all ext options properties optional (#25214) --- types/hapi/index.d.ts | 6 +++--- types/hapi/test/request/event-types.ts | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index d4072b0cd7..f0730e6f67 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -2472,15 +2472,15 @@ export interface ServerExtOptions { /** * a string or array of strings of plugin names this method must execute before (on the same event). Otherwise, extension methods are executed in the order added. */ - before: string | string[]; + before?: string | string[]; /** * a string or array of strings of plugin names this method must execute after (on the same event). Otherwise, extension methods are executed in the order added. */ - after: string | string[]; + after?: string | string[]; /** * a context object passed back to the provided method (via this) when called. Ignored if the method is an arrow function. */ - bind: object; + bind?: object; /** * if set to 'plugin' when adding a request extension points the extension is only added to routes defined by the current plugin. Not allowed when configuring route-level extensions, or when * adding server extensions. Defaults to 'server' which applies to any route added to the server the extension is added to. diff --git a/types/hapi/test/request/event-types.ts b/types/hapi/test/request/event-types.ts index 386b93e19d..4d4f3f01ca 100644 --- a/types/hapi/test/request/event-types.ts +++ b/types/hapi/test/request/event-types.ts @@ -1,6 +1,6 @@ // https://github.com/hapijs/hapi/blob/master/API.md#-servereventevents // https://github.com/hapijs/hapi/blob/master/API.md#-requestevents -import { Lifecycle, Request, ResponseToolkit, RouteOptions, Server, ServerOptions, ServerRoute } from "hapi"; +import { Lifecycle, Request, Server, ServerOptions, ServerRoute } from "hapi"; import * as Crypto from 'crypto'; const options: ServerOptions = { @@ -10,7 +10,7 @@ const options: ServerOptions = { const serverRoute: ServerRoute = { path: '/', method: 'GET', - handler(request, h) { + handler(request) { return 'ok: ' + request.path; } }; @@ -42,7 +42,7 @@ const onRequest: Lifecycle.Method = (request, h) => { */ const hash = Crypto.createHash('sha1'); - request.events.on("peek", (chunk, encoding) => { + request.events.on("peek", (chunk) => { hash.update(chunk); }); @@ -59,7 +59,9 @@ const onRequest: Lifecycle.Method = (request, h) => { const server = new Server(options); server.route(serverRoute); -server.ext('onRequest', onRequest); +server.ext('onRequest', onRequest, { + before: 'test', +}); server.start(); console.log('Server started at: ' + server.info.uri); From b4ea50c7a999cd4c63b4305a8664c643c2350a40 Mon Sep 17 00:00:00 2001 From: Mike Fisher Date: Wed, 25 Apr 2018 09:06:57 +1000 Subject: [PATCH 0822/2153] [auth0] Fix ManagementClient.linkUsers signature (#25219) --- types/auth0/auth0-tests.ts | 9 +++++++++ types/auth0/index.d.ts | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/types/auth0/auth0-tests.ts b/types/auth0/auth0-tests.ts index 0572c2b0e7..9c1bbe8856 100644 --- a/types/auth0/auth0-tests.ts +++ b/types/auth0/auth0-tests.ts @@ -141,3 +141,12 @@ management.createPasswordChangeTicket({ }, (err: Error, data) => { console.log(data.ticket); }); + +// Link users +management.linkUsers('primaryId', { user_id: 'secondaryId' }) + .then((result: any) => console.log(result)); + +// Link users with callback +management.linkUsers('primaryId', { user_id: 'secondaryId' }, + (err: Error, result: any) => {}); + diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index 58013848f8..050f463bfb 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -664,8 +664,8 @@ export class ManagementClient { unlinkUsers(params: UnlinkAccountsParams): Promise; unlinkUsers(params: UnlinkAccountsParams, cb: (err: Error, data: UnlinkAccountsResponse) => void): void; - linkUsers(params: ObjectWithId, data: LinkAccountsData): Promise; - linkUsers(params: ObjectWithId, data: LinkAccountsData, cb: (err: Error, data: any) => void): void; + linkUsers(userId: string, data: LinkAccountsData): Promise; + linkUsers(userId: string, data: LinkAccountsData, cb: (err: Error, data: any) => void): void; // Tokens From ba5f8c991240e9cceeb73a20e4213b4eb373dccd Mon Sep 17 00:00:00 2001 From: Alexander Kachkaev Date: Wed, 25 Apr 2018 00:07:44 +0100 Subject: [PATCH 0823/2153] Add tOptions prop to in react-i18next (#25089) --- types/react-i18next/index.d.ts | 2 +- types/react-i18next/src/trans.d.ts | 5 +++++ types/react-i18next/test/react-i18next-tests.tsx | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/types/react-i18next/index.d.ts b/types/react-i18next/index.d.ts index 356418fe2e..5ea0e7cb91 100644 --- a/types/react-i18next/index.d.ts +++ b/types/react-i18next/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-i18next 7.3 +// Type definitions for react-i18next 7.6 // Project: https://github.com/i18next/react-i18next // Definitions by: Giedrius Grabauskas // Simon Baumann diff --git a/types/react-i18next/src/trans.d.ts b/types/react-i18next/src/trans.d.ts index 8b12c81fc9..c5652315c7 100644 --- a/types/react-i18next/src/trans.d.ts +++ b/types/react-i18next/src/trans.d.ts @@ -1,12 +1,17 @@ import * as React from "react"; import { i18n, TranslationFunction } from "i18next"; +export interface TOptions { + [key: string]: any; +} + export interface TransProps { i18nKey?: string; count?: number; parent?: string; i18n?: i18n; t?: TranslationFunction; + tOptions?: TOptions; } export default class Trans extends React.Component { } diff --git a/types/react-i18next/test/react-i18next-tests.tsx b/types/react-i18next/test/react-i18next-tests.tsx index 46d212e680..7f49913c44 100644 --- a/types/react-i18next/test/react-i18next-tests.tsx +++ b/types/react-i18next/test/react-i18next-tests.tsx @@ -119,6 +119,7 @@ loadNamespaces({components: [App], i18n}).then(() => { ; +; type Key = "view" | "nav"; From de9b889ba9a40380cd429defda16034a3ff02ddb Mon Sep 17 00:00:00 2001 From: Bradley Ayers Date: Wed, 25 Apr 2018 09:08:18 +1000 Subject: [PATCH 0824/2153] fix(node-fetch): Headers#get may return null (#25218) See https://github.com/bitinn/node-fetch/blob/master/src/headers.js#L117 --- types/node-fetch/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/node-fetch/index.d.ts b/types/node-fetch/index.d.ts index aaaf30a5e3..874e216e89 100644 --- a/types/node-fetch/index.d.ts +++ b/types/node-fetch/index.d.ts @@ -63,7 +63,7 @@ type RequestCache = export class Headers { append(name: string, value: string): void; delete(name: string): void; - get(name: string): string; + get(name: string): string | null; getAll(name: string): Array; has(name: string): boolean; set(name: string, value: string): void; From 8797fe7279a88bf0bec7f701a200332c15e061f4 Mon Sep 17 00:00:00 2001 From: qqilihq Date: Wed, 25 Apr 2018 01:08:55 +0200 Subject: [PATCH 0825/2153] Fix `validator` types (#25212) Make `require_host` optional, adjust tests so that they catch options not set as optional --- types/validator/index.d.ts | 3 ++- types/validator/validator-tests.ts | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/types/validator/index.d.ts b/types/validator/index.d.ts index e91bd36ce2..d51465d1a7 100644 --- a/types/validator/index.d.ts +++ b/types/validator/index.d.ts @@ -7,6 +7,7 @@ // Kacper Polak // Bonggyun Lee // Naoto Yokoyama +// Philipp Katz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace ValidatorJS { @@ -356,7 +357,7 @@ declare namespace ValidatorJS { protocols?: string[]; require_tld?: boolean; require_protocol?: boolean; - require_host: boolean; + require_host?: boolean; require_valid_protocol?: boolean; allow_underscores?: boolean; host_whitelist?: (string | RegExp)[]; diff --git a/types/validator/validator-tests.ts b/types/validator/validator-tests.ts index c3d4327d84..784528d963 100644 --- a/types/validator/validator-tests.ts +++ b/types/validator/validator-tests.ts @@ -402,36 +402,36 @@ let any: any; result = validator.isBoolean('sample'); - let isByteLengthOptions: ValidatorJS.IsByteLengthOptions; + let isByteLengthOptions: ValidatorJS.IsByteLengthOptions = {}; result = validator.isByteLength('sample', isByteLengthOptions); result = validator.isByteLength('sample', 0); result = validator.isByteLength('sample', 0, 42); result = validator.isCreditCard('sample'); - let isCurrencyOptions: ValidatorJS.IsCurrencyOptions; + let isCurrencyOptions: ValidatorJS.IsCurrencyOptions = {}; result = validator.isCurrency('sample'); result = validator.isCurrency('sample', isCurrencyOptions); result = validator.isDataURI('sample'); - let isDecimalOptions: ValidatorJS.IsDecimalOptions; + let isDecimalOptions: ValidatorJS.IsDecimalOptions = {}; result = validator.isDecimal('sample'); result = validator.isDecimal('sample', isDecimalOptions); result = validator.isDivisibleBy('sample', 2); - let isEmailOptions: ValidatorJS.IsEmailOptions; + let isEmailOptions: ValidatorJS.IsEmailOptions = {}; result = validator.isEmail('sample'); result = validator.isEmail('sample', isEmailOptions); result = validator.isEmpty('sample'); - let isFQDNOptions: ValidatorJS.IsFQDNOptions; + let isFQDNOptions: ValidatorJS.IsFQDNOptions = {}; result = validator.isFQDN('sample'); result = validator.isFQDN('sample', isFQDNOptions); - let isFloatOptions: ValidatorJS.IsFloatOptions; + let isFloatOptions: ValidatorJS.IsFloatOptions = {}; result = validator.isFloat('sample'); result = validator.isFloat('sample', isFloatOptions); @@ -463,7 +463,7 @@ let any: any; result = validator.isISBN('sample'); result = validator.isISBN('sample', 13); - let isISSNOptions: ValidatorJS.IsISSNOptions; + let isISSNOptions: ValidatorJS.IsISSNOptions = {}; result = validator.isISSN('sample'); result = validator.isISSN('sample', isISSNOptions); @@ -477,7 +477,7 @@ let any: any; result = validator.isIn('sample', []); - let isIntOptions: ValidatorJS.IsIntOptions; + let isIntOptions: ValidatorJS.IsIntOptions = {}; result = validator.isInt('sample'); result = validator.isInt('sample', isIntOptions); @@ -485,7 +485,7 @@ let any: any; result = validator.isLatLong('sample'); - let isLengthOptions: ValidatorJS.IsLengthOptions; + let isLengthOptions: ValidatorJS.IsLengthOptions = {}; result = validator.isLength('sample', isLengthOptions); result = validator.isLength('sample', 3); result = validator.isLength('sample', 3, 5); @@ -498,7 +498,7 @@ let any: any; result = validator.isMimeType('sample'); - let isMobilePhoneOptions: ValidatorJS.IsMobilePhoneOptions; + let isMobilePhoneOptions: ValidatorJS.IsMobilePhoneOptions = {}; result = validator.isMobilePhone('sample', 'any', isMobilePhoneOptions); result = validator.isMobilePhone('sample', 'ar-AE'); result = validator.isMobilePhone('sample', 'ar-DZ'); @@ -607,7 +607,7 @@ let any: any; result = validator.isSurrogatePair('sample'); - let isURLOptions: ValidatorJS.IsURLOptions; + let isURLOptions: ValidatorJS.IsURLOptions = {}; result = validator.isURL('sample'); result = validator.isURL('sample', isURLOptions); @@ -642,7 +642,7 @@ let any: any; result = validator.ltrim('sample'); result = validator.ltrim('sample', ' '); - let normalizeEmailOptions: ValidatorJS.NormalizeEmailOptions; + let normalizeEmailOptions: ValidatorJS.NormalizeEmailOptions = {}; let normalizeResult: string | false; normalizeResult = validator.normalizeEmail('sample'); normalizeResult = validator.normalizeEmail('sample', normalizeEmailOptions); From a39131b390c06a0dd6ad9aa7d15fce414d3b7b79 Mon Sep 17 00:00:00 2001 From: Shude Li Date: Wed, 25 Apr 2018 07:09:44 +0800 Subject: [PATCH 0826/2153] feat(node-v8): add `TextDecoder` and `TextEncoder` for `util` module (#25221) * feat(node-v8): add `TextDecoder` and `TextEncoder` for `util` module * fix(node-v8): change constructor's first param name * style(node-v8): styling `TextDecoder` * refact(node-v8): using class instead interface+var * test(node-v8): add tests for util.TextDecoder and util.TextEncoder * fix(node-v8): fix param type of TextDecoder.decode --- types/node/v8/index.d.ts | 33 +++++++++++++++++++++++++++++++++ types/node/v8/node-tests.ts | 29 +++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index f055cd0716..2d705270ef 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -21,6 +21,7 @@ // Nicolas Even // Bruno Scheufler // Hoàng Văn Khải +// Lishude // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -5575,6 +5576,38 @@ declare module "util" { export namespace promisify { const custom: symbol; } + + export class TextDecoder { + readonly encoding: string; + readonly fatal: boolean; + readonly ignoreBOM: boolean; + constructor( + encoding?: string, + options?: { fatal?: boolean; ignoreBOM?: boolean } + ); + decode( + input?: + | Int8Array + | Int16Array + | Int32Array + | Uint8Array + | Uint16Array + | Uint32Array + | Uint8ClampedArray + | Float32Array + | Float64Array + | DataView + | ArrayBuffer + | null, + options?: { stream?: boolean } + ): string; + } + + export class TextEncoder { + readonly encoding: string; + constructor(); + encode(input?: string): Uint8Array; + } } declare module "assert" { diff --git a/types/node/v8/node-tests.ts b/types/node/v8/node-tests.ts index a79d96aa6a..d37aa70ad5 100644 --- a/types/node/v8/node-tests.ts +++ b/types/node/v8/node-tests.ts @@ -825,6 +825,35 @@ namespace util_tests { util.deprecate(foo, 'foo() is deprecated, use bar() instead'); // $ExpectType (fn: T, message: string) => T util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead'); + + // util.TextDecoder() + var td = new util.TextDecoder(); + new util.TextDecoder("utf-8"); + new util.TextDecoder("utf-8", { fatal: true }); + new util.TextDecoder("utf-8", { fatal: true, ignoreBOM: true }); + var ignoreBom: boolean = td.ignoreBOM; + var fatal: boolean = td.fatal; + var encoding: string = td.encoding; + td.decode(new Int8Array(1)); + td.decode(new Int16Array(1)); + td.decode(new Int32Array(1)); + td.decode(new Uint8Array(1)); + td.decode(new Uint16Array(1)); + td.decode(new Uint32Array(1)); + td.decode(new Uint8ClampedArray(1)); + td.decode(new Float32Array(1)); + td.decode(new Float64Array(1)); + td.decode(new DataView(new Int8Array(1).buffer)); + td.decode(new ArrayBuffer(1)); + td.decode(null); + td.decode(null, { stream: true }); + td.decode(new Int8Array(1), { stream: true }); + var decode: string = td.decode(new Int8Array(1)); + + // util.TextEncoder() + var te = new util.TextEncoder(); + var teEncoding: string = te.encoding; + var teEncodeRes: Uint8Array = te.encode("TextEncoder"); } } From 06dca562095a88cfcc3678f11d0d66e8e7745247 Mon Sep 17 00:00:00 2001 From: Bruno Lemos Date: Tue, 24 Apr 2018 20:11:37 -0300 Subject: [PATCH 0827/2153] [sequelize] Change ReplicationOptions.read type to array (#25207) --- types/sequelize/index.d.ts | 2 +- types/sequelize/sequelize-tests.ts | 4 ++-- types/sequelize/v3/index.d.ts | 2 +- types/sequelize/v3/sequelize-tests.ts | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index d20bd83b86..b6d1da1e55 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -5320,7 +5320,7 @@ declare namespace sequelize { username?: string; password?: string; database?: string; - }; + }[]; write?: { host?: string; diff --git a/types/sequelize/sequelize-tests.ts b/types/sequelize/sequelize-tests.ts index 6c4f6c0a6f..1572b91c00 100644 --- a/types/sequelize/sequelize-tests.ts +++ b/types/sequelize/sequelize-tests.ts @@ -1243,11 +1243,11 @@ new Sequelize( 'wat', 'trololo', 'wow', { port : 99999 } ); new Sequelize( 'localhost', 'wtf', 'lol', { port : 99999 } ); new Sequelize( 'sequelize', null, null, { replication : { - read : { + read : [{ host : 'localhost', username : 'omg', password : 'lol' - } + }] } } ); new Sequelize( { diff --git a/types/sequelize/v3/index.d.ts b/types/sequelize/v3/index.d.ts index 9453a8473d..eafa70b641 100644 --- a/types/sequelize/v3/index.d.ts +++ b/types/sequelize/v3/index.d.ts @@ -5067,7 +5067,7 @@ declare namespace sequelize { username?: string; password?: string; database?: string; - }; + }[]; write?: { host?: string; diff --git a/types/sequelize/v3/sequelize-tests.ts b/types/sequelize/v3/sequelize-tests.ts index b575271867..ccc0a66c96 100644 --- a/types/sequelize/v3/sequelize-tests.ts +++ b/types/sequelize/v3/sequelize-tests.ts @@ -1165,11 +1165,11 @@ new Sequelize( 'wat', 'trololo', 'wow', { port : 99999 } ); new Sequelize( 'localhost', 'wtf', 'lol', { port : 99999 } ); new Sequelize( 'sequelize', null, null, { replication : { - read : { + read : [{ host : 'localhost', username : 'omg', password : 'lol' - } + }] } } ); new Sequelize( { From 4a866a79f107d3bad50ebb6727486d7942328554 Mon Sep 17 00:00:00 2001 From: Drew Diamantoukos Date: Tue, 24 Apr 2018 19:11:49 -0400 Subject: [PATCH 0828/2153] Plotly.js: Added pointcloud type for ScatterData and sizemax property for Marker (#25234) * Adding pointcloud type for Plotly scatter type and sizemax for Marker * Added xy field for ScatterData, which is used by pointcloud --- types/plotly.js/index.d.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/types/plotly.js/index.d.ts b/types/plotly.js/index.d.ts index 9fbbeaa92f..6b405d3e53 100644 --- a/types/plotly.js/index.d.ts +++ b/types/plotly.js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for plotly.js 1.35 +// Type definitions for plotly.js 1.36 // Project: https://plot.ly/javascript/ // Definitions by: Chris Gervang // Martin Duparc @@ -6,6 +6,7 @@ // taoqf // Dadstart // Jared Szechy +// Drew Diamantoukos // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -354,10 +355,11 @@ export type Color = string | Array | Array Date: Tue, 24 Apr 2018 18:12:30 -0500 Subject: [PATCH 0829/2153] reactstrap: Add Missing Prop Types (#25104) * reactstrap: Add hideArrow PropType to * reactstrap: Remove dropup prop in favor of direction for * reactstrap: Update the version to 5.0 in index.d.ts header --- types/reactstrap/index.d.ts | 1 + types/reactstrap/lib/Dropdown.d.ts | 8 +++++++- types/reactstrap/lib/Popover.d.ts | 3 ++- types/reactstrap/reactstrap-tests.tsx | 4 ++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/types/reactstrap/index.d.ts b/types/reactstrap/index.d.ts index 359090b5b2..c8ff3e452f 100644 --- a/types/reactstrap/index.d.ts +++ b/types/reactstrap/index.d.ts @@ -7,6 +7,7 @@ // FaithForHumans // Kurt Preston // Tim Chen +// Pat Gaffney // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 diff --git a/types/reactstrap/lib/Dropdown.d.ts b/types/reactstrap/lib/Dropdown.d.ts index 17805d4908..52194dac65 100644 --- a/types/reactstrap/lib/Dropdown.d.ts +++ b/types/reactstrap/lib/Dropdown.d.ts @@ -1,5 +1,11 @@ import { CSSModule } from '../index'; +export type Direction = + | "up" + | "down" + | "left" + | "right" + export interface UncontrolledProps extends React.HTMLAttributes { isOpen?: boolean; toggle?: () => void; @@ -14,7 +20,7 @@ export interface UncontrolledDropdownProps extends UncontrolledProps { export interface Props extends UncontrolledProps { disabled?: boolean; - dropup?: boolean; + direction?: Direction; group?: boolean; size?: string; tag?: React.ReactType; diff --git a/types/reactstrap/lib/Popover.d.ts b/types/reactstrap/lib/Popover.d.ts index 07634cd787..3012b64485 100644 --- a/types/reactstrap/lib/Popover.d.ts +++ b/types/reactstrap/lib/Popover.d.ts @@ -1,7 +1,7 @@ /// import { CSSModule } from '../index'; -import {Popper} from './Popper'; +import { Popper } from './Popper'; export interface PopoverProps extends React.HTMLAttributes { isOpen?: boolean; @@ -12,6 +12,7 @@ export interface PopoverProps extends React.HTMLAttributes { placement?: Popper.Placement; innerClassName?: string; disabled?: boolean; + hideArrow?: boolean; placementPrefix?: string; delay?: number | {show: number, hide: number}; modifiers?: Popper.Modifiers; diff --git a/types/reactstrap/reactstrap-tests.tsx b/types/reactstrap/reactstrap-tests.tsx index 1b777d173c..f8515bf2b5 100644 --- a/types/reactstrap/reactstrap-tests.tsx +++ b/types/reactstrap/reactstrap-tests.tsx @@ -413,7 +413,7 @@ const Example18 = ( ); const Example19 = ( - true} dropup> + true} direction="up"> Dropup @@ -2533,7 +2533,7 @@ class PopoverItem extends React.Component { - + Popover Title Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. From 6a7b69883e41782ce32f49ad0fdaf0bc17b07ac1 Mon Sep 17 00:00:00 2001 From: Florent SCHILDKNECHT Date: Wed, 25 Apr 2018 01:13:13 +0200 Subject: [PATCH 0830/2153] [reactstrap] Correct FormGroups props typings (#25208) --- types/reactstrap/lib/FormGroup.d.ts | 2 +- types/reactstrap/reactstrap-tests.tsx | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/types/reactstrap/lib/FormGroup.d.ts b/types/reactstrap/lib/FormGroup.d.ts index 5827f2c17b..52c96f3060 100644 --- a/types/reactstrap/lib/FormGroup.d.ts +++ b/types/reactstrap/lib/FormGroup.d.ts @@ -3,9 +3,9 @@ import { CSSModule } from '../index'; export interface FormGroupProps extends React.HTMLProps { row?: boolean; check?: boolean; + inline?: boolean; disabled?: boolean; tag?: React.ReactType; - color?: string; className?: string; cssModule?: CSSModule; } diff --git a/types/reactstrap/reactstrap-tests.tsx b/types/reactstrap/reactstrap-tests.tsx index f8515bf2b5..9215bc7ba9 100644 --- a/types/reactstrap/reactstrap-tests.tsx +++ b/types/reactstrap/reactstrap-tests.tsx @@ -1141,6 +1141,20 @@ class Example45 extends React.Component { Check me out + + + + + + + + ); From d29b31e5dba366eba1a4f41d2ac42d616115ee6f Mon Sep 17 00:00:00 2001 From: Sam Walsh Date: Wed, 25 Apr 2018 11:13:27 +1200 Subject: [PATCH 0831/2153] @types/material-ui -ToggleProps.label change string to React.ReactNode (#25241) * @types/material-ui - Change `ToggleProps` `label` type to `React.ReactNode` instead of `string` * Amend samwalshnz github username to authors list for material-ui --- types/material-ui/index.d.ts | 3 ++- types/material-ui/material-ui-tests.tsx | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/material-ui/index.d.ts b/types/material-ui/index.d.ts index 8c7a49c96d..307ce84115 100644 --- a/types/material-ui/index.d.ts +++ b/types/material-ui/index.d.ts @@ -11,6 +11,7 @@ // Artyom Stukans // Dan Jones // Daisuke Mino +// Sam Walsh // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -1583,7 +1584,7 @@ declare namespace __MaterialUI { elementStyle?: React.CSSProperties; iconStyle?: React.CSSProperties; inputStyle?: React.CSSProperties; - label?: string; + label?: React.ReactNode; labelPosition?: "left" | "right"; labelStyle?: React.CSSProperties; onToggle?(e: React.MouseEvent<{}>, isInputChecked: boolean): void; diff --git a/types/material-ui/material-ui-tests.tsx b/types/material-ui/material-ui-tests.tsx index a416670d0d..a7bb59fcf8 100644 --- a/types/material-ui/material-ui-tests.tsx +++ b/types/material-ui/material-ui-tests.tsx @@ -5709,6 +5709,10 @@ const ToggleExampleSimple = () => ( label="Simple" style={styles.toggle} /> + Element} + style={styles.toggle} + /> Date: Tue, 24 Apr 2018 16:13:52 -0700 Subject: [PATCH 0832/2153] Update react-slick types (#25112) * Update types for react-slick 0.23.1 * Fix tests * Update react-slick version in comment * Don't include patch version --- types/react-slick/index.d.ts | 45 +++++++++++++++---------- types/react-slick/react-slick-tests.tsx | 6 ++-- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/types/react-slick/index.d.ts b/types/react-slick/index.d.ts index 475b9afcfc..fc7568ac4c 100644 --- a/types/react-slick/index.d.ts +++ b/types/react-slick/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-slick 0.15 +// Type definitions for react-slick 0.23 // Project: https://github.com/akiran/react-slick // Definitions by: Andrey Balokha // Giedrius Grabauskas @@ -27,54 +27,63 @@ export type SwipeDirection = "left" | "down" | "right" | "up" | string; export interface Settings { accessibility?: boolean; - className?: string; adaptiveHeight?: boolean; + afterChange?(currentSlide: number): void; + appendDots?(dots: React.ReactNode): JSX.Element; arrows?: boolean; - nextArrow?: JSX.Element; - prevArrow?: JSX.Element; - autoplay?: boolean; + asNavFor?: Slider; autoplaySpeed?: number; + autoplay?: boolean; + beforeChange?(currentSlide: number, nextSlide: number): void; centerMode?: boolean; centerPadding?: string; + className?: string; cssEase?: string; customPaging?(index: number): JSX.Element; - dots?: boolean; dotsClass?: string; + dots?: boolean; draggable?: boolean; easing?: string; + edgeFriction?: number; fade?: boolean; focusOnSelect?: boolean; infinite?: boolean; initialSlide?: number; - lazyLoad?: boolean; + lazyLoad?: "ondemand" | "progressive"; + nextArrow?: JSX.Element; + onEdge?(swipeDirection: SwipeDirection): void; + onInit?(): void; + onLazyLoad?(slidesToLoad: number[]): void; + onReInit?(): void; + onSwipe?(swipeDirection: SwipeDirection): void; + pauseOnDotsHover?: boolean; + pauseOnFocus?: boolean; pauseOnHover?: boolean; + prevArrow?: JSX.Element; responsive?: ResponsiveObject[]; + rows?: number; rtl?: boolean; slide?: string; - slidesToShow?: number; + slidesPerRow?: number; slidesToScroll?: number; + slidesToShow?: number; speed?: number; - swipe?: boolean; swipeToSlide?: boolean; + swipe?: boolean; + swipeEvent?(swipeDirection: SwipeDirection): void; touchMove?: boolean; touchThreshold?: number; - variableWidth?: boolean; useCSS?: boolean; + useTransform?: boolean; + variableWidth?: boolean; vertical?: boolean; - afterChange?(currentSlide: number): void; - beforeChange?(currentSlide: number, nextSlide: number): void; - slickGoTo?: number; - edgeFriction?: number; waitForAnimate?: boolean; - edgeEvent?(swipeDirection: SwipeDirection): void; - swipeEvent?(swipeDirection: SwipeDirection): void; - init?(): void; } declare class Slider extends React.Component { slickNext(): void; slickPrev(): void; - slickGoTo(slideNumber: number): void; + slickGoTo(slideNumber: number, dontAnimate?: boolean): void; } export default Slider; diff --git a/types/react-slick/react-slick-tests.tsx b/types/react-slick/react-slick-tests.tsx index 18a104049f..aebcabc81d 100644 --- a/types/react-slick/react-slick-tests.tsx +++ b/types/react-slick/react-slick-tests.tsx @@ -40,7 +40,7 @@ const defaultSettings: Settings = { focusOnSelect: false, infinite: true, initialSlide: 0, - lazyLoad: false, + lazyLoad: "progressive", pauseOnHover: true, responsive: [{ breakpoint: 1000, settings: "unslick" }, { breakpoint: 2000, settings: { arrows: false } }], rtl: false, @@ -58,8 +58,8 @@ const defaultSettings: Settings = { waitForAnimate: true, afterChange: (currentSlide: number) => { }, beforeChange: (currentSlide: number, nextSlide: number) => { }, - edgeEvent: (swipeDirection: string) => { }, - init: () => { }, + onEdge: (swipeDirection: string) => { }, + onInit: () => { }, swipeEvent: (swipeDirection: string) => { }, nextArrow: , prevArrow: From 7f5ae12581aa76ff9ae2064008d5d120b60d08d3 Mon Sep 17 00:00:00 2001 From: Toby Rahilly Date: Wed, 25 Apr 2018 09:14:10 +1000 Subject: [PATCH 0833/2153] react-dnd-touch-backend: Add touchSlop, ignoreContextMenu and scrollAngleRanges options. (#25244) * Add touchSlop, ignoreContextMenu and scrollAngleRanges to the TouchBackendOptions type. * v4 --- types/react-dnd-touch-backend/index.d.ts | 16 +++++++++++++++- .../react-dnd-touch-backend-tests.ts | 4 ++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/types/react-dnd-touch-backend/index.d.ts b/types/react-dnd-touch-backend/index.d.ts index d8e1681f96..86ba0d1d10 100644 --- a/types/react-dnd-touch-backend/index.d.ts +++ b/types/react-dnd-touch-backend/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-dnd-touch-backend 0.3 +// Type definitions for react-dnd-touch-backend 0.4 // Project: https://github.com/yahoo/react-dnd-touch-backend#readme // Definitions by: Daniel Król , Janeene Beeforth // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -31,4 +31,18 @@ export interface TouchBackendOptions { * @deprecated replaced by delayTouchStart and delayMouseStart, but is still supported at present. */ delay?: number; + /** + * Specifies the pixel distance moved before a drag is signaled. Default 0. + */ + touchSlop?: number; + /** + * If true, prevents the contextmenu event from canceling a drag. Default false. + */ + ignoreContextMenu?: boolean; + /** + * Specifies ranges of angles in degrees that drag events should be ignored. This is useful when you want to allow + * the user to scroll in a particular direction instead of dragging. Degrees move clockwise, 0/360 pointing to the + * left. Default: undefined + */ + scrollAngleRanges?: ReadonlyArray<{ start?: number, end?: number }>; } diff --git a/types/react-dnd-touch-backend/react-dnd-touch-backend-tests.ts b/types/react-dnd-touch-backend/react-dnd-touch-backend-tests.ts index 3e77b52d78..dbf807a6a8 100644 --- a/types/react-dnd-touch-backend/react-dnd-touch-backend-tests.ts +++ b/types/react-dnd-touch-backend/react-dnd-touch-backend-tests.ts @@ -11,3 +11,7 @@ const dndComponentKeyboardEvents = ReactDnd.DragDropContext(TouchBackend({enable const dndComponentOldDelay = ReactDnd.DragDropContext(TouchBackend({delay: 300})); const dndComponentAllCurrentEvents = ReactDnd.DragDropContext(TouchBackend( {enableKeyboardEvents: true, enableMouseEvents: true, delayMouseStart: 100, delayTouchStart: 200})); +const dndComponentWithScrollAngleRanges = ReactDnd.DragDropContext(TouchBackend( + { scrollAngleRanges: [{ start: 0, end: 0 }, { start: 0 }, { end: 0 }] })); +const dndComponentWithTouchSlop = ReactDnd.DragDropContext(TouchBackend({ touchSlop: 0 })); +const dndComponentWithIgnoreContextMenu = ReactDnd.DragDropContext(TouchBackend({ ignoreContextMenu: true })); From 959c2e2e3572f68bf1dcff140e9908982f3e286b Mon Sep 17 00:00:00 2001 From: Arjun Jhawar Date: Wed, 25 Apr 2018 11:14:38 +1200 Subject: [PATCH 0834/2153] Bugfix: change url to uri property name under SourceLocation to match API (#25243) --- types/cucumber/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/cucumber/index.d.ts b/types/cucumber/index.d.ts index d93ad4c7b2..03dda3d736 100644 --- a/types/cucumber/index.d.ts +++ b/types/cucumber/index.d.ts @@ -81,7 +81,7 @@ export interface HookScenarioResult { export interface SourceLocation { line: number; - url: string; + uri: string; } export interface ScenarioResult { From 73619f74ffedb15ca332a4a934c58f75f5fd7310 Mon Sep 17 00:00:00 2001 From: Nick Schultz Date: Tue, 24 Apr 2018 19:17:23 -0400 Subject: [PATCH 0835/2153] [Sequelize] Fix types error with UpsertOptions requiring the returning option if they are defined at all (#25240) * upsert should compile with options that dont include returning * fix parens * bump version for bugfix --- types/sequelize/index.d.ts | 4 ++-- types/sequelize/sequelize-tests.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index b6d1da1e55..37a0b46829 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Sequelize 4.27.9 +// Type definitions for Sequelize 4.27.10 // Project: http://sequelizejs.com // Definitions by: samuelneff // Peter Harris @@ -4006,7 +4006,7 @@ declare namespace sequelize { * because SQLite always runs INSERT OR IGNORE + UPDATE, in a single query, so there is no way to know * whether the row was inserted or not. */ - upsert(values: TAttributes, options?: UpsertOptions & { returning: false | undefined }): Promise; + upsert(values: TAttributes, options?: UpsertOptions & { returning?: false | undefined }): Promise; upsert(values: TAttributes, options?: UpsertOptions & { returning: true }): Promise<[TInstance, boolean]>; insertOrUpdate(values: TAttributes, options?: UpsertOptions & { returning: false | undefined }): Promise; insertOrUpdate(values: TAttributes, options?: UpsertOptions & { returning: true }): Promise<[TInstance, boolean]>; diff --git a/types/sequelize/sequelize-tests.ts b/types/sequelize/sequelize-tests.ts index 1572b91c00..9c5eb13708 100644 --- a/types/sequelize/sequelize-tests.ts +++ b/types/sequelize/sequelize-tests.ts @@ -1055,6 +1055,7 @@ findOrRetVal = User.findOrCreate( { where : { email : 'unique.email.@d.com', com findOrRetVal = User.findOrCreate( { where : { objectId : 1 }, defaults : { bool : false } } ); let upsertPromiseNoOptions: Bluebird = User.upsert( { id : 42, username : 'doe', foo : s.fn( 'upper', 'mixedCase2' ) } ); +let upsertPromiseWithNonReturningOptions: Bluebird = User.upsert( { id : 42, username : 'doe', foo : s.fn( 'upper', 'mixedCase2' ) }, { logging: true } ); let upsertPromiseReturning: Bluebird<[AnyInstance, boolean]> = User.upsert( { id : 42, username : 'doe', foo : s.fn( 'upper', 'mixedCase2' ) }, { returning: true } ); let upsertPromiseNotReturning: Bluebird = User.upsert( { id : 42, username : 'doe', foo : s.fn( 'upper', 'mixedCase2' ) }, { returning: false } ); From 49b8178b77118ea713351a78639f74e8e1149b11 Mon Sep 17 00:00:00 2001 From: Ben Cook Date: Tue, 24 Apr 2018 18:19:00 -0500 Subject: [PATCH 0836/2153] Add type definitions for base64-arraybuffer (#25239) * Added declarations for 'base64-arraybuffer' * fix linting and header --- .../base64-arraybuffer-tests.ts | 4 ++++ types/base64-arraybuffer/index.d.ts | 7 ++++++ types/base64-arraybuffer/tsconfig.json | 23 +++++++++++++++++++ types/base64-arraybuffer/tslint.json | 1 + 4 files changed, 35 insertions(+) create mode 100644 types/base64-arraybuffer/base64-arraybuffer-tests.ts create mode 100644 types/base64-arraybuffer/index.d.ts create mode 100644 types/base64-arraybuffer/tsconfig.json create mode 100644 types/base64-arraybuffer/tslint.json diff --git a/types/base64-arraybuffer/base64-arraybuffer-tests.ts b/types/base64-arraybuffer/base64-arraybuffer-tests.ts new file mode 100644 index 0000000000..3263f45afe --- /dev/null +++ b/types/base64-arraybuffer/base64-arraybuffer-tests.ts @@ -0,0 +1,4 @@ +import { encode, decode } from 'base64-arraybuffer'; + +encode(new Float32Array([1, 2, 3]).buffer); // $ExpectType string +decode('AACAPwAAAEAAAEBA'); // $ExpectType ArrayBuffer diff --git a/types/base64-arraybuffer/index.d.ts b/types/base64-arraybuffer/index.d.ts new file mode 100644 index 0000000000..8d8f5b8285 --- /dev/null +++ b/types/base64-arraybuffer/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for base64-arraybuffer 0.1 +// Project: https://github.com/niklasvh/base64-arraybuffer +// Definitions by: Ben Cook +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function encode(arraybuffer: ArrayBuffer): string; +export function decode(base64: string): ArrayBuffer; diff --git a/types/base64-arraybuffer/tsconfig.json b/types/base64-arraybuffer/tsconfig.json new file mode 100644 index 0000000000..5d6ba6ac31 --- /dev/null +++ b/types/base64-arraybuffer/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "base64-arraybuffer-tests.ts" + ] +} diff --git a/types/base64-arraybuffer/tslint.json b/types/base64-arraybuffer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/base64-arraybuffer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 8231b1a62a5f69e489a48c4f002b05eed128d884 Mon Sep 17 00:00:00 2001 From: Michael Utz Date: Wed, 25 Apr 2018 02:20:12 +0300 Subject: [PATCH 0837/2153] added jest-each module declarations (#25224) * added jest-each module declarations * test: updated tests for `it.skip` and `it.only` --- types/jest-each/index.d.ts | 42 ++++++++++++++++++++++++++++++ types/jest-each/jest-each-tests.ts | 19 ++++++++++++++ types/jest-each/tsconfig.json | 23 ++++++++++++++++ types/jest-each/tslint.json | 1 + 4 files changed, 85 insertions(+) create mode 100644 types/jest-each/index.d.ts create mode 100644 types/jest-each/jest-each-tests.ts create mode 100644 types/jest-each/tsconfig.json create mode 100644 types/jest-each/tslint.json diff --git a/types/jest-each/index.d.ts b/types/jest-each/index.d.ts new file mode 100644 index 0000000000..01d13db0e4 --- /dev/null +++ b/types/jest-each/index.d.ts @@ -0,0 +1,42 @@ +// Type definitions for jest-each 0.3 +// Project: https://github.com/mattphillips/jest-each +// Definitions by: Michael Utz +// Definitions: +// TypeScript Version: 2.1 + +export = JestEach; + +declare function JestEach(parameters: any[][]): JestEach.ReturnType; + +declare namespace JestEach { + type SyncCallback = (...args: string[]) => void; + type AsyncCallback = () => void; + + type TestCallback = SyncCallback | AsyncCallback; + + type TestFn = (name: string, fn: TestCallback) => void; + type DescribeFn = (name: string, fn: SyncCallback) => void; + + interface TestObj { + (name: string, fn: TestCallback): void; + only: TestFn; + skip: TestFn; + } + + interface DescribeObj { + (name: string, fn: DescribeFn): void; + only: DescribeFn; + skip: DescribeFn; + } + + interface ReturnType { + test: TestObj; + it: TestObj; + fit: TestFn; + xit: TestFn; + xtest: TestFn; + describe: DescribeObj; + fdescribe: DescribeFn; + xdescribe: DescribeFn; + } +} diff --git a/types/jest-each/jest-each-tests.ts b/types/jest-each/jest-each-tests.ts new file mode 100644 index 0000000000..bbfbcabe05 --- /dev/null +++ b/types/jest-each/jest-each-tests.ts @@ -0,0 +1,19 @@ +import * as each from 'jest-each'; + +const params = [[1, 0, 1], [1, 1, 0], ['1', 'two', 'three']]; + +each(params).test('', () => {}); +each(params).it('', () => {}); +each(params).test.only('', () => {}); +each(params).it.only('', () => {}); +each(params).fit('', () => {}); +each(params).test.skip('', () => {}); +each(params).it.skip('', () => {}); +each(params).xit('', () => {}); +each(params).xtest('', () => {}); + +each(params).describe('', () => {}); +each(params).describe.only('', () => {}); +each(params).fdescribe('', () => {}); +each(params).describe.skip('', () => {}); +each(params).xdescribe('', () => {}); diff --git a/types/jest-each/tsconfig.json b/types/jest-each/tsconfig.json new file mode 100644 index 0000000000..62a3193837 --- /dev/null +++ b/types/jest-each/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jest-each-tests.ts" + ] +} diff --git a/types/jest-each/tslint.json b/types/jest-each/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jest-each/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From fd5742930d73d2889b2ab03da84ffe9b3be01298 Mon Sep 17 00:00:00 2001 From: Andrew Houghton Date: Tue, 24 Apr 2018 16:21:17 -0700 Subject: [PATCH 0838/2153] (new definition) add mjml (mjml.io) types (#25217) * add mjml (mjml.io) types * update mjml definition, actually verify linter runs, be more explicit in re: error types * mjml: int -> number. why does lint pass w/ 'int'? ah well. * per @plantain-00 CR --- types/mjml/index.d.ts | 29 +++++++++++++++++++++++++++++ types/mjml/mjml-tests.ts | 10 ++++++++++ types/mjml/tsconfig.json | 23 +++++++++++++++++++++++ types/mjml/tslint.json | 1 + 4 files changed, 63 insertions(+) create mode 100644 types/mjml/index.d.ts create mode 100644 types/mjml/mjml-tests.ts create mode 100644 types/mjml/tsconfig.json create mode 100644 types/mjml/tslint.json diff --git a/types/mjml/index.d.ts b/types/mjml/index.d.ts new file mode 100644 index 0000000000..bccb7d319d --- /dev/null +++ b/types/mjml/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for mjml 4.0 +// Project: https://github.com/mjmlio/mjml +// Definitions by: aahoughton +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface MJMLParsingOpts { + fonts?: { [key: string]: string; }; + keepComments?: boolean; + beautify?: boolean; + minify?: boolean; + validationLevel?: 'strict' | 'soft' | 'skip'; + filePath?: boolean; +} + +interface MJMLParseError { + line: number; + message: string; + tagName: string; + formattedMessage: string; +} + +interface MJMLParseResults { + html: string; + errors: MJMLParseError[]; +} + +declare function mjml2html(inp: string, opts?: MJMLParsingOpts): MJMLParseResults; + +export = mjml2html; diff --git a/types/mjml/mjml-tests.ts b/types/mjml/mjml-tests.ts new file mode 100644 index 0000000000..3a7711d08b --- /dev/null +++ b/types/mjml/mjml-tests.ts @@ -0,0 +1,10 @@ +import mjml2html = require('mjml'); + +const simple_test = mjml2html(""); +const html = simple_test.html; +const errors = simple_test.errors; +let formattedMessage = errors[0].formattedMessage; +formattedMessage = "force string test"; + +const minimal_opts_test = mjml2html("", {beautify: true}); +const validation_level_test = mjml2html("", {validationLevel: "strict"}); diff --git a/types/mjml/tsconfig.json b/types/mjml/tsconfig.json new file mode 100644 index 0000000000..5fb996bbe9 --- /dev/null +++ b/types/mjml/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "mjml-tests.ts" + ] +} diff --git a/types/mjml/tslint.json b/types/mjml/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mjml/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 25c7bb748453909dfb7268ee96e5856325dae4a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=98i=C4=8Da=C5=99?= Date: Wed, 25 Apr 2018 01:22:23 +0200 Subject: [PATCH 0839/2153] [react-popover] Fix for users without allowSyntheticDefaultExports or esModuleInterop (#25216) --- types/react-popover/index.d.ts | 53 +++++++++++---------- types/react-popover/react-popover-tests.tsx | 2 +- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/types/react-popover/index.d.ts b/types/react-popover/index.d.ts index 20958f3040..fed9c4c32d 100644 --- a/types/react-popover/index.d.ts +++ b/types/react-popover/index.d.ts @@ -6,30 +6,33 @@ import * as React from 'react'; -export type PopoverPlace = - | 'above' - | 'right' - | 'below' - | 'left' - | 'row' - | 'column' - | 'start' - | 'end'; +export = Popover; -export interface PopoverProps { - body: React.ReactNode; - isOpen?: boolean; - preferPlace?: PopoverPlace; - place?: PopoverPlace; - onOuterAction?: (event: Event) => void; - refreshIntervalMs?: number; - enterExitTransitionDurationMs?: number; - tipSize?: number; - className?: string; - style?: React.CSSProperties; - target?: React.ReactElement; - appendTarget?: Element; +declare class Popover extends React.Component {} + +declare namespace Popover { + type PopoverPlace = + | 'above' + | 'right' + | 'below' + | 'left' + | 'row' + | 'column' + | 'start' + | 'end'; + + interface PopoverProps { + body: React.ReactNode; + isOpen?: boolean; + preferPlace?: PopoverPlace; + place?: PopoverPlace; + onOuterAction?: (event: Event) => void; + refreshIntervalMs?: number; + enterExitTransitionDurationMs?: number; + tipSize?: number; + className?: string; + style?: React.CSSProperties; + target?: React.ReactElement; + appendTarget?: Element; + } } - -declare class Popover extends React.Component {} -export default Popover; diff --git a/types/react-popover/react-popover-tests.tsx b/types/react-popover/react-popover-tests.tsx index 39cb256c73..c0912d1f50 100644 --- a/types/react-popover/react-popover-tests.tsx +++ b/types/react-popover/react-popover-tests.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import Popover from 'react-popover'; +import Popover = require('react-popover'); class Test extends React.Component { render() { From 958ae300398af83fd4d4767d7b272ca1e5faf3d5 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 24 Apr 2018 16:25:01 -0700 Subject: [PATCH 0840/2153] add types for 'fluxible' and 'fluxible-router' (#25198) * add types for package 'fluxible' * add fluxible router types * fix tests * fixed annotation --- types/fluxible-router/index.d.ts | 28 ++++++ types/fluxible-router/tsconfig.json | 23 +++++ types/fluxible-router/tslint.json | 1 + types/fluxible/addons/BaseStore.d.ts | 4 + types/fluxible/addons/createStore.d.ts | 3 + types/fluxible/fluxible-tests.ts | 36 +++++++ types/fluxible/index.d.ts | 126 +++++++++++++++++++++++++ types/fluxible/tsconfig.json | 26 +++++ types/fluxible/tslint.json | 1 + 9 files changed, 248 insertions(+) create mode 100644 types/fluxible-router/index.d.ts create mode 100644 types/fluxible-router/tsconfig.json create mode 100644 types/fluxible-router/tslint.json create mode 100644 types/fluxible/addons/BaseStore.d.ts create mode 100644 types/fluxible/addons/createStore.d.ts create mode 100644 types/fluxible/fluxible-tests.ts create mode 100644 types/fluxible/index.d.ts create mode 100644 types/fluxible/tsconfig.json create mode 100644 types/fluxible/tslint.json diff --git a/types/fluxible-router/index.d.ts b/types/fluxible-router/index.d.ts new file mode 100644 index 0000000000..2dea024107 --- /dev/null +++ b/types/fluxible-router/index.d.ts @@ -0,0 +1,28 @@ +// Type definitions for fluxible-router 1.5 +// Project: https://github.com/yahoo/fluxible#readme +// Definitions by: xbim +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 +/// +import * as React from 'react'; +import { FluxibleContext } from 'fluxible'; +import BaseStore = require('fluxible/addons/BaseStore'); + +export class NavLink extends React.Component { } + +export class RouteStore extends BaseStore { + static withStaticRoutes(routes: object): typeof RouteStore; +} + +export function handleHistory(Component: typeof React.Component, opts?: object): typeof React.Component; + +export function navigateAction(context: FluxibleContext, params: object): undefined; + +export class NavLinkProps { + href?: string; + routeName?: string; + activeStyle?: object; + preserveScrollPosition?: boolean; + className?: string; + type?: string; +} diff --git a/types/fluxible-router/tsconfig.json b/types/fluxible-router/tsconfig.json new file mode 100644 index 0000000000..1ce319bb08 --- /dev/null +++ b/types/fluxible-router/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "esModuleInterop": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} diff --git a/types/fluxible-router/tslint.json b/types/fluxible-router/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fluxible-router/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/fluxible/addons/BaseStore.d.ts b/types/fluxible/addons/BaseStore.d.ts new file mode 100644 index 0000000000..78b51c53c5 --- /dev/null +++ b/types/fluxible/addons/BaseStore.d.ts @@ -0,0 +1,4 @@ +/// +import BaseStore = require('dispatchr/addons/BaseStore'); + +export = BaseStore; diff --git a/types/fluxible/addons/createStore.d.ts b/types/fluxible/addons/createStore.d.ts new file mode 100644 index 0000000000..319a02dc51 --- /dev/null +++ b/types/fluxible/addons/createStore.d.ts @@ -0,0 +1,3 @@ +import createStore = require('dispatchr/addons/createStore'); + +export = createStore; diff --git a/types/fluxible/fluxible-tests.ts b/types/fluxible/fluxible-tests.ts new file mode 100644 index 0000000000..27de6d1b1e --- /dev/null +++ b/types/fluxible/fluxible-tests.ts @@ -0,0 +1,36 @@ +import { createDispatcher, Store } from 'dispatchr'; +import createStore = require('fluxible/addons/createStore'); +import BaseStore = require('fluxible/addons/BaseStore'); +import { Fluxible } from 'fluxible'; + +const TestStore = createStore({ + storeName: 'TestStore', + + handlers: { + ACTION_NAME: 'actionHandler' + }, + + statics: { + staticMethod() { + } + }, + + initialize() {}, +}); + +class ExtendedStore extends BaseStore { + static handlers = { + ACTION_NAME: 'actionHandler' + }; + + actionHandler() { + this.emitChange(); + } +} + +const app = new Fluxible({ + component: {} +}); + +app.registerStore(TestStore); +app.registerStore(ExtendedStore); diff --git a/types/fluxible/index.d.ts b/types/fluxible/index.d.ts new file mode 100644 index 0000000000..d317662e1b --- /dev/null +++ b/types/fluxible/index.d.ts @@ -0,0 +1,126 @@ +// Type definitions for fluxible 1.4 +// Project: https://fluxible.io/ +// Definitions by: xbim +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.5 +/// +import { Dispatcher, DispatcherInterface, StoreClass } from 'dispatchr'; +import BaseStore = require('./addons/BaseStore'); + +export interface FluxibleConfiguration { + /** + * App level component action handler + */ + componentActionHandler?: () => void; + /** + * Stores your top level React component for access using `getComponent()` + */ + component: any; +} + +/** + * Provides a structured way of registering an application's configuration and + * resources. + */ +export class Fluxible { + /** + * @param [options] + * @example + * var app = new Fluxible({ + * component: require('./components/App.jsx') + * }); + */ + constructor(options?: FluxibleConfiguration); + + /** + * Creates an isolated context for a request/session + * @param [contextOptions] The options object. Please refer to FluxibleContext's constructor + * doc for supported subfields and detailed description. + */ + createContext(contextOptions?: any): FluxibleContext; + + /** + * Creates a new dispatcher instance using the application's dispatchr class. Used by + * FluxibleContext to create new dispatcher instance + * @param contextOptions The context options to be provided to each store instance + */ + createDispatcherInstance(contextOptions?: any): Dispatcher; + + /** + * Provides plugin mechanism for adding application level settings that are persisted + * between server/client and also modification of the FluxibleContext + * @param plugin + * @param plugin.name Name of the plugin + * @param plugin.plugContext Method called after context is created to allow + * dynamically plugging the context + * @param [plugin.dehydrate] Method called to serialize the plugin settings to be persisted + * to the client + * @param [plugin.rehydrate] Method called to rehydrate the plugin settings from the server + */ + plug(plugin: any): void; + + /** + * Provides access to a plugin instance by name + * @param pluginName The plugin name + */ + getPlugin(pluginName: string): any; + + /** + * Getter for the top level react component for the application + */ + getComponent(): any; + + /** + * Registers a store to the dispatcher so it can listen for actions + */ + registerStore(store: StoreClass| typeof BaseStore): void; + + /** + * Creates a serializable state of the application and a given context for sending to the client + * @param context + */ + dehydrate(context?: FluxibleContext): any; + + /** + * Rehydrates the application and creates a new context with the state from the server + * @param obj Raw object of dehydrated state + * @param obj.plugins Dehydrated app plugin state + * @param obj.context Dehydrated context state. See FluxibleContext's + * rehydrate() for subfields in this object. + * @param callback + * @async Rehydration may require more asset loading or async IO calls + */ + rehydrate(state: any): void; +} + +/** + * A request or browser-session context + */ +export class FluxibleContext { + /** + * @param options The options sharable by the context and context plugins + */ + + constructor(options?: FluxibleConfiguration); + + /** + * Provides plugin mechanism for adding application level settings that are persisted + * between server/client and also modification of the FluxibleContext + */ + plug(plugin: any): void; + + /** + * Returns a serializable context state + */ + dehydrate(): any; + + /** + * Rehydrates the context state + */ + rehydrate(state: any): void; + + /** + * Getter for store from dispatcher + */ + getStore(store: { new(dispatcher?: DispatcherInterface): T; }): T; +} diff --git a/types/fluxible/tsconfig.json b/types/fluxible/tsconfig.json new file mode 100644 index 0000000000..9af8323ce8 --- /dev/null +++ b/types/fluxible/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "esModuleInterop": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "addons/createStore.d.ts", + "addons/BaseStore.d.ts", + "fluxible-tests.ts" + ] +} diff --git a/types/fluxible/tslint.json b/types/fluxible/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fluxible/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From ddb98c71c2126e077c4a4749fc15b53519ba97a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anderson=20Fria=C3=A7a?= Date: Tue, 24 Apr 2018 19:26:13 -0400 Subject: [PATCH 0841/2153] Types for JQuery Loading Overlay (#25189) --- types/jquery-loading-overlay/index.d.ts | 46 +++++++++++++++++++ .../jquery-loading-overlay-tests.ts | 23 ++++++++++ types/jquery-loading-overlay/tsconfig.json | 25 ++++++++++ types/jquery-loading-overlay/tslint.json | 1 + 4 files changed, 95 insertions(+) create mode 100644 types/jquery-loading-overlay/index.d.ts create mode 100644 types/jquery-loading-overlay/jquery-loading-overlay-tests.ts create mode 100644 types/jquery-loading-overlay/tsconfig.json create mode 100644 types/jquery-loading-overlay/tslint.json diff --git a/types/jquery-loading-overlay/index.d.ts b/types/jquery-loading-overlay/index.d.ts new file mode 100644 index 0000000000..ff5fa59976 --- /dev/null +++ b/types/jquery-loading-overlay/index.d.ts @@ -0,0 +1,46 @@ +// Type definitions for JQuery Loading Overlay 1.0 +// Project: https://github.com/jgerigmeyer/jquery-loading-overlay +// Definitions by: Anderson Friaça +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +export type Options = Partial<{ + /** + * Class added to target while loading + */ + loadingClass: string; + + /** + * Class added to overlay (style with CSS) + */ + overlayClass: string; + + /** + * Class added to loading overlay spinner + */ + spinnerClass: string; + + /** + * Class added to loading overlay spinner + */ + iconClass: string; + + /** + * Class added to loading overlay spinner + */ + textClass: string; + + /** + * Text within loading overlay + */ + loadingText: string; +}>; + +declare global { + interface JQuery { + loadingOverlay(options?: Options): JQuery; + loadingOverlay(method: 'remove', options?: Options): JQuery; + } +} diff --git a/types/jquery-loading-overlay/jquery-loading-overlay-tests.ts b/types/jquery-loading-overlay/jquery-loading-overlay-tests.ts new file mode 100644 index 0000000000..a4d2afec9a --- /dev/null +++ b/types/jquery-loading-overlay/jquery-loading-overlay-tests.ts @@ -0,0 +1,23 @@ +import { Options } from "jquery-loading-overlay"; + +// Basic usage +$('#target').loadingOverlay(); + +$('#target').loadingOverlay('remove'); + +// With options +const options: Options = { + loadingClass: 'loading', + overlayClass: 'loading-overlay', + spinnerClass: 'loading-spinner', + iconClass: 'loading-icon', + textClass: 'loading-text', + loadingText: 'loading' +}; + +$('#target').loadingOverlay(options); + +$('#target').loadingOverlay('remove', { + loadingClass: 'loading', + overlayClass: 'loading-overlay' +}); diff --git a/types/jquery-loading-overlay/tsconfig.json b/types/jquery-loading-overlay/tsconfig.json new file mode 100644 index 0000000000..cb40c55c09 --- /dev/null +++ b/types/jquery-loading-overlay/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "jquery-loading-overlay-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jquery-loading-overlay/tslint.json b/types/jquery-loading-overlay/tslint.json new file mode 100644 index 0000000000..d04fe2e1fa --- /dev/null +++ b/types/jquery-loading-overlay/tslint.json @@ -0,0 +1 @@ +{"extends": "dtslint/dt.json"} \ No newline at end of file From 6c26901d8b20c4ee1b0827390697fe61f75f148a Mon Sep 17 00:00:00 2001 From: Alan Plum Date: Wed, 25 Apr 2018 01:28:27 +0200 Subject: [PATCH 0842/2153] Add ArangoDB typescript typings (#25087) * Initial declaration WIP * Unexplode linter * Some linting * More linting * More linting This was the last of the low-hanging fruit. * Use generic string index types There doesn't seem to be a way to set a "fallback" string index type so I guess this has to be as generic as necessary. * Expand stub interfaces * Get rid of extra declares These seem to be redundant * Get rid of extra exports and const enum This seems to simply work. * @arangodb/index -> @arangodb * Escape 'new' attribute to be safe? * Replace string index types with compositesa This seems to achieve the behaviour we want: typeof db.asdfg == ArangoDB.Collection | undefined typeof db._query == Function * Both options actually exist Thanks @Simran-B for clarifying this. * Remove PlainObject interface Turns out we actually want `object` as the default type almost everywhere. * Bolt down generics No sense defaulting to object if we don't also enforce extending object. Also those Documents and Edges might contain literally anything so let's allow that. * This is probably a hack but at least it works * Add example stub * Deduplicate route handler signatures * Brute force? This feels wrong. There must be a better way. * Pass linting * Possible workaround for globals * Unnecessary qualifier * Override NodeJS types * Add View API * Slightly more specific graphql types * Use actual graphql module for types * Better model manifest/config/deps * Apparently this doesn't require escaping * Fix InsertResult * Functions that always throw should return never? * Add HttpStatus * Add Console#logLines * type to interface * More example code * Inline some types * Inline JwtStorageOptions * Add sessions middleware example * Fix aql template string handler --- types/arangodb/arangodb-tests.ts | 63 + types/arangodb/index.d.ts | 1851 ++++++++++++++++++++++++++++++ types/arangodb/tsconfig.json | 16 + types/arangodb/tslint.json | 1 + 4 files changed, 1931 insertions(+) create mode 100644 types/arangodb/arangodb-tests.ts create mode 100644 types/arangodb/index.d.ts create mode 100644 types/arangodb/tsconfig.json create mode 100644 types/arangodb/tslint.json diff --git a/types/arangodb/arangodb-tests.ts b/types/arangodb/arangodb-tests.ts new file mode 100644 index 0000000000..b498caf6af --- /dev/null +++ b/types/arangodb/arangodb-tests.ts @@ -0,0 +1,63 @@ +import { db, aql } from "@arangodb"; +import { md5 } from "@arangodb/crypto"; +import { createRouter } from "@arangodb/foxx"; +import sessionsMiddleware = require("@arangodb/foxx/sessions"); +import jwtStorage = require("@arangodb/foxx/sessions/storages/jwt"); +import cookieTransport = require("@arangodb/foxx/sessions/transports/cookie"); + +console.warnStack(new Error(), "something went wrong"); + +interface User { + username: string; + password?: string; +} +const coll = module.context.collection("users")!; +coll.save({ username: "user" }); +const doc = coll.any(); +console.log(doc.username); + +const users = coll as ArangoDB.Collection; +const admin = users.firstExample({ username: "admin" })!; +users.update(admin, { password: md5("hunter2") }); +console.logLines("user", admin._key, admin.username); + +const query = aql` + FOR u IN ${users} + RETURN u +`; + +db._createDocumentCollection("bananas").ensureIndex({ + type: "hash", + unique: true, + fields: ["color", "shape"] +}); + +const router = createRouter(); +module.context.use(router); + +router.get("/", (req, res) => { + if (req.cookie("sid", { secret: "keyboardcat" })) { + res.set("content-type", "text/plain"); + res.write("Welcome back, Commander"); + } else { + res.json({ success: false }); + } +}); + +router.use((req, res, next) => { + if (req.is("json")) res.throw("too many requests"); + next(); +}); + +router.use( + sessionsMiddleware({ + storage: jwtStorage({ algorithm: "none" }), + transport: "header" + }) +); +router.use( + sessionsMiddleware({ + storage: jwtStorage({ algorithm: "HS512", secret: "tacocat" }), + transport: cookieTransport({ secret: "banana", algorithm: "sha256" }) + }) +); diff --git a/types/arangodb/index.d.ts b/types/arangodb/index.d.ts new file mode 100644 index 0000000000..34cf3ef99e --- /dev/null +++ b/types/arangodb/index.d.ts @@ -0,0 +1,1851 @@ +// Type definitions for ArangoDB 3.4 +// Project: https://github.com/arangodb/arangodb +// Definitions by: Alan Plum +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +declare namespace ArangoDB { + type JwtAlgorithm = "HS512" | "HS384" | "HS256"; + type HashAlgorithm = + | "sha512" + | "sha384" + | "sha256" + | "sha224" + | "sha1" + | "md5"; + type HttpMethod = + | "HEAD" + | "GET" + | "POST" + | "PUT" + | "PATCH" + | "DELETE" + | "OPTIONS"; + type HttpStatus = + | "continue" + | "switching protocols" + | "processing" + | "ok" + | "created" + | "accepted" + | "non-authoritative information" + | "no content" + | "reset content" + | "partial content" + | "multi-status" + | "already reported" + | "im used" + | "multiple choices" + | "moved permanently" + | "found" + | "see other" + | "not modified" + | "use proxy" + | "(unused)" + | "temporary redirect" + | "permanent redirect" + | "bad request" + | "unauthorized" + | "payment required" + | "forbidden" + | "not found" + | "method not allowed" + | "not acceptable" + | "proxy authentication required" + | "request timeout" + | "conflict" + | "gone" + | "length required" + | "precondition failed" + | "payload too large" + | "uri too long" + | "unsupported media type" + | "range not satisfiable" + | "expectation failed" + | "i'm a teapot" + | "misdirected request" + | "unprocessable entity" + | "locked" + | "failed dependency" + | "unordered collection" + | "upgrade required" + | "precondition required" + | "too many requests" + | "request header fields too large" + | "unavailable for legal reasons" + | "internal server error" + | "not implemented" + | "bad gateway" + | "service unavailable" + | "gateway timeout" + | "http version not supported" + | "variant also negotiates" + | "insufficient storage" + | "loop detected" + | "bandwidth limit exceeded" + | "not extended" + | "network authentication required"; + type EdgeDirection = "any" | "inbound" | "outbound"; + type EngineType = "mmfiles" | "rocksdb"; + type IndexType = "hash" | "skiplist" | "fulltext" | "geo1" | "geo2"; + type ViewType = "arangosearch"; + type ErrorName = + | "ERROR_NO_ERROR" + | "ERROR_FAILED" + | "ERROR_SYS_ERROR" + | "ERROR_OUT_OF_MEMORY" + | "ERROR_INTERNAL" + | "ERROR_ILLEGAL_NUMBER" + | "ERROR_NUMERIC_OVERFLOW" + | "ERROR_ILLEGAL_OPTION" + | "ERROR_DEAD_PID" + | "ERROR_NOT_IMPLEMENTED" + | "ERROR_BAD_PARAMETER" + | "ERROR_FORBIDDEN" + | "ERROR_OUT_OF_MEMORY_MMAP" + | "ERROR_CORRUPTED_CSV" + | "ERROR_FILE_NOT_FOUND" + | "ERROR_CANNOT_WRITE_FILE" + | "ERROR_CANNOT_OVERWRITE_FILE" + | "ERROR_TYPE_ERROR" + | "ERROR_LOCK_TIMEOUT" + | "ERROR_CANNOT_CREATE_DIRECTORY" + | "ERROR_CANNOT_CREATE_TEMP_FILE" + | "ERROR_REQUEST_CANCELED" + | "ERROR_DEBUG" + | "ERROR_IP_ADDRESS_INVALID" + | "ERROR_FILE_EXISTS" + | "ERROR_LOCKED" + | "ERROR_DEADLOCK" + | "ERROR_SHUTTING_DOWN" + | "ERROR_ONLY_ENTERPRISE" + | "ERROR_RESOURCE_LIMIT" + | "ERROR_ARANGO_ICU_ERROR" + | "ERROR_CANNOT_READ_FILE" + | "ERROR_HTTP_BAD_PARAMETER" + | "ERROR_HTTP_UNAUTHORIZED" + | "ERROR_HTTP_FORBIDDEN" + | "ERROR_HTTP_NOT_FOUND" + | "ERROR_HTTP_METHOD_NOT_ALLOWED" + | "ERROR_HTTP_NOT_ACCEPTABLE" + | "ERROR_HTTP_PRECONDITION_FAILED" + | "ERROR_HTTP_SERVER_ERROR" + | "ERROR_HTTP_SERVICE_UNAVAILABLE" + | "ERROR_HTTP_GATEWAY_TIMEOUT" + | "ERROR_HTTP_CORRUPTED_JSON" + | "ERROR_HTTP_SUPERFLUOUS_SUFFICES" + | "ERROR_ARANGO_ILLEGAL_STATE" + | "ERROR_ARANGO_DATAFILE_SEALED" + | "ERROR_ARANGO_READ_ONLY" + | "ERROR_ARANGO_DUPLICATE_IDENTIFIER" + | "ERROR_ARANGO_DATAFILE_UNREADABLE" + | "ERROR_ARANGO_DATAFILE_EMPTY" + | "ERROR_ARANGO_RECOVERY" + | "ERROR_ARANGO_DATAFILE_STATISTICS_NOT_FOUND" + | "ERROR_ARANGO_CORRUPTED_DATAFILE" + | "ERROR_ARANGO_ILLEGAL_PARAMETER_FILE" + | "ERROR_ARANGO_CORRUPTED_COLLECTION" + | "ERROR_ARANGO_MMAP_FAILED" + | "ERROR_ARANGO_FILESYSTEM_FULL" + | "ERROR_ARANGO_NO_JOURNAL" + | "ERROR_ARANGO_DATAFILE_ALREADY_EXISTS" + | "ERROR_ARANGO_DATADIR_LOCKED" + | "ERROR_ARANGO_COLLECTION_DIRECTORY_ALREADY_EXISTS" + | "ERROR_ARANGO_MSYNC_FAILED" + | "ERROR_ARANGO_DATADIR_UNLOCKABLE" + | "ERROR_ARANGO_SYNC_TIMEOUT" + | "ERROR_ARANGO_CONFLICT" + | "ERROR_ARANGO_DATADIR_INVALID" + | "ERROR_ARANGO_DOCUMENT_NOT_FOUND" + | "ERROR_ARANGO_DATA_SOURCE_NOT_FOUND" + | "ERROR_ARANGO_COLLECTION_PARAMETER_MISSING" + | "ERROR_ARANGO_DOCUMENT_HANDLE_BAD" + | "ERROR_ARANGO_MAXIMAL_SIZE_TOO_SMALL" + | "ERROR_ARANGO_DUPLICATE_NAME" + | "ERROR_ARANGO_ILLEGAL_NAME" + | "ERROR_ARANGO_NO_INDEX" + | "ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED" + | "ERROR_ARANGO_INDEX_NOT_FOUND" + | "ERROR_ARANGO_CROSS_COLLECTION_REQUEST" + | "ERROR_ARANGO_INDEX_HANDLE_BAD" + | "ERROR_ARANGO_DOCUMENT_TOO_LARGE" + | "ERROR_ARANGO_COLLECTION_NOT_UNLOADED" + | "ERROR_ARANGO_COLLECTION_TYPE_INVALID" + | "ERROR_ARANGO_VALIDATION_FAILED" + | "ERROR_ARANGO_ATTRIBUTE_PARSER_FAILED" + | "ERROR_ARANGO_DOCUMENT_KEY_BAD" + | "ERROR_ARANGO_DOCUMENT_KEY_UNEXPECTED" + | "ERROR_ARANGO_DATADIR_NOT_WRITABLE" + | "ERROR_ARANGO_OUT_OF_KEYS" + | "ERROR_ARANGO_DOCUMENT_KEY_MISSING" + | "ERROR_ARANGO_DOCUMENT_TYPE_INVALID" + | "ERROR_ARANGO_DATABASE_NOT_FOUND" + | "ERROR_ARANGO_DATABASE_NAME_INVALID" + | "ERROR_ARANGO_USE_SYSTEM_DATABASE" + | "ERROR_ARANGO_ENDPOINT_NOT_FOUND" + | "ERROR_ARANGO_INVALID_KEY_GENERATOR" + | "ERROR_ARANGO_INVALID_EDGE_ATTRIBUTE" + | "ERROR_ARANGO_INDEX_DOCUMENT_ATTRIBUTE_MISSING" + | "ERROR_ARANGO_INDEX_CREATION_FAILED" + | "ERROR_ARANGO_WRITE_THROTTLE_TIMEOUT" + | "ERROR_ARANGO_COLLECTION_TYPE_MISMATCH" + | "ERROR_ARANGO_COLLECTION_NOT_LOADED" + | "ERROR_ARANGO_DOCUMENT_REV_BAD" + | "ERROR_ARANGO_DATAFILE_FULL" + | "ERROR_ARANGO_EMPTY_DATADIR" + | "ERROR_ARANGO_TRY_AGAIN" + | "ERROR_ARANGO_BUSY" + | "ERROR_ARANGO_MERGE_IN_PROGRESS" + | "ERROR_ARANGO_IO_ERROR" + | "ERROR_REPLICATION_NO_RESPONSE" + | "ERROR_REPLICATION_INVALID_RESPONSE" + | "ERROR_REPLICATION_MASTER_ERROR" + | "ERROR_REPLICATION_MASTER_INCOMPATIBLE" + | "ERROR_REPLICATION_MASTER_CHANGE" + | "ERROR_REPLICATION_LOOP" + | "ERROR_REPLICATION_UNEXPECTED_MARKER" + | "ERROR_REPLICATION_INVALID_APPLIER_STATE" + | "ERROR_REPLICATION_UNEXPECTED_TRANSACTION" + | "ERROR_REPLICATION_INVALID_APPLIER_CONFIGURATION" + | "ERROR_REPLICATION_RUNNING" + | "ERROR_REPLICATION_APPLIER_STOPPED" + | "ERROR_REPLICATION_NO_START_TICK" + | "ERROR_REPLICATION_START_TICK_NOT_PRESENT" + | "ERROR_REPLICATION_WRONG_CHECKSUM" + | "ERROR_REPLICATION_SHARD_NONEMPTY" + | "ERROR_CLUSTER_NO_AGENCY" + | "ERROR_CLUSTER_NO_COORDINATOR_HEADER" + | "ERROR_CLUSTER_COULD_NOT_LOCK_PLAN" + | "ERROR_CLUSTER_COLLECTION_ID_EXISTS" + | "ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION_IN_PLAN" + | "ERROR_CLUSTER_COULD_NOT_READ_CURRENT_VERSION" + | "ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION" + | "ERROR_CLUSTER_TIMEOUT" + | "ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_PLAN" + | "ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_CURRENT" + | "ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE_IN_PLAN" + | "ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE" + | "ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_PLAN" + | "ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_CURRENT" + | "ERROR_CLUSTER_SHARD_GONE" + | "ERROR_CLUSTER_CONNECTION_LOST" + | "ERROR_CLUSTER_MUST_NOT_SPECIFY_KEY" + | "ERROR_CLUSTER_GOT_CONTRADICTING_ANSWERS" + | "ERROR_CLUSTER_NOT_ALL_SHARDING_ATTRIBUTES_GIVEN" + | "ERROR_CLUSTER_MUST_NOT_CHANGE_SHARDING_ATTRIBUTES" + | "ERROR_CLUSTER_UNSUPPORTED" + | "ERROR_CLUSTER_ONLY_ON_COORDINATOR" + | "ERROR_CLUSTER_READING_PLAN_AGENCY" + | "ERROR_CLUSTER_COULD_NOT_TRUNCATE_COLLECTION" + | "ERROR_CLUSTER_AQL_COMMUNICATION" + | "ERROR_ARANGO_DOCUMENT_NOT_FOUND_OR_SHARDING_ATTRIBUTES_CHANGED" + | "ERROR_CLUSTER_COULD_NOT_DETERMINE_ID" + | "ERROR_CLUSTER_ONLY_ON_DBSERVER" + | "ERROR_CLUSTER_BACKEND_UNAVAILABLE" + | "ERROR_CLUSTER_UNKNOWN_CALLBACK_ENDPOINT" + | "ERROR_CLUSTER_AGENCY_STRUCTURE_INVALID" + | "ERROR_CLUSTER_AQL_COLLECTION_OUT_OF_SYNC" + | "ERROR_CLUSTER_COULD_NOT_CREATE_INDEX_IN_PLAN" + | "ERROR_CLUSTER_COULD_NOT_DROP_INDEX_IN_PLAN" + | "ERROR_CLUSTER_CHAIN_OF_DISTRIBUTESHARDSLIKE" + | "ERROR_CLUSTER_MUST_NOT_DROP_COLL_OTHER_DISTRIBUTESHARDSLIKE" + | "ERROR_CLUSTER_UNKNOWN_DISTRIBUTESHARDSLIKE" + | "ERROR_CLUSTER_INSUFFICIENT_DBSERVERS" + | "ERROR_CLUSTER_COULD_NOT_DROP_FOLLOWER" + | "ERROR_CLUSTER_SHARD_LEADER_REFUSES_REPLICATION" + | "ERROR_CLUSTER_SHARD_FOLLOWER_REFUSES_OPERATION" + | "ERROR_CLUSTER_SHARD_LEADER_RESIGNED" + | "ERROR_CLUSTER_AGENCY_COMMUNICATION_FAILED" + | "ERROR_CLUSTER_DISTRIBUTE_SHARDS_LIKE_REPLICATION_FACTOR" + | "ERROR_CLUSTER_DISTRIBUTE_SHARDS_LIKE_NUMBER_OF_SHARDS" + | "ERROR_CLUSTER_LEADERSHIP_CHALLENGE_ONGOING" + | "ERROR_CLUSTER_NOT_LEADER" + | "ERROR_CLUSTER_COULD_NOT_CREATE_VIEW_IN_PLAN" + | "ERROR_QUERY_KILLED" + | "ERROR_QUERY_PARSE" + | "ERROR_QUERY_EMPTY" + | "ERROR_QUERY_SCRIPT" + | "ERROR_QUERY_NUMBER_OUT_OF_RANGE" + | "ERROR_QUERY_VARIABLE_NAME_INVALID" + | "ERROR_QUERY_VARIABLE_REDECLARED" + | "ERROR_QUERY_VARIABLE_NAME_UNKNOWN" + | "ERROR_QUERY_COLLECTION_LOCK_FAILED" + | "ERROR_QUERY_TOO_MANY_COLLECTIONS" + | "ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED" + | "ERROR_QUERY_FUNCTION_NAME_UNKNOWN" + | "ERROR_QUERY_FUNCTION_ARGUMENT_NUMBER_MISMATCH" + | "ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH" + | "ERROR_QUERY_INVALID_REGEX" + | "ERROR_QUERY_BIND_PARAMETERS_INVALID" + | "ERROR_QUERY_BIND_PARAMETER_MISSING" + | "ERROR_QUERY_BIND_PARAMETER_UNDECLARED" + | "ERROR_QUERY_BIND_PARAMETER_TYPE" + | "ERROR_QUERY_INVALID_LOGICAL_VALUE" + | "ERROR_QUERY_INVALID_ARITHMETIC_VALUE" + | "ERROR_QUERY_DIVISION_BY_ZERO" + | "ERROR_QUERY_ARRAY_EXPECTED" + | "ERROR_QUERY_FAIL_CALLED" + | "ERROR_QUERY_GEO_INDEX_MISSING" + | "ERROR_QUERY_FULLTEXT_INDEX_MISSING" + | "ERROR_QUERY_INVALID_DATE_VALUE" + | "ERROR_QUERY_MULTI_MODIFY" + | "ERROR_QUERY_INVALID_AGGREGATE_EXPRESSION" + | "ERROR_QUERY_COMPILE_TIME_OPTIONS" + | "ERROR_QUERY_EXCEPTION_OPTIONS" + | "ERROR_QUERY_COLLECTION_USED_IN_EXPRESSION" + | "ERROR_QUERY_DISALLOWED_DYNAMIC_CALL" + | "ERROR_QUERY_ACCESS_AFTER_MODIFICATION" + | "ERROR_QUERY_FUNCTION_INVALID_NAME" + | "ERROR_QUERY_FUNCTION_INVALID_CODE" + | "ERROR_QUERY_FUNCTION_NOT_FOUND" + | "ERROR_QUERY_FUNCTION_RUNTIME_ERROR" + | "ERROR_QUERY_BAD_JSON_PLAN" + | "ERROR_QUERY_NOT_FOUND" + | "ERROR_QUERY_IN_USE" + | "ERROR_QUERY_USER_ASSERT" + | "ERROR_QUERY_USER_WARN" + | "ERROR_CURSOR_NOT_FOUND" + | "ERROR_CURSOR_BUSY" + | "ERROR_TRANSACTION_INTERNAL" + | "ERROR_TRANSACTION_NESTED" + | "ERROR_TRANSACTION_UNREGISTERED_COLLECTION" + | "ERROR_TRANSACTION_DISALLOWED_OPERATION" + | "ERROR_TRANSACTION_ABORTED" + | "ERROR_USER_INVALID_NAME" + | "ERROR_USER_INVALID_PASSWORD" + | "ERROR_USER_DUPLICATE" + | "ERROR_USER_NOT_FOUND" + | "ERROR_USER_CHANGE_PASSWORD" + | "ERROR_USER_EXTERNAL" + | "ERROR_SERVICE_INVALID_NAME" + | "ERROR_SERVICE_INVALID_MOUNT" + | "ERROR_SERVICE_DOWNLOAD_FAILED" + | "ERROR_SERVICE_UPLOAD_FAILED" + | "ERROR_LDAP_CANNOT_INIT" + | "ERROR_LDAP_CANNOT_SET_OPTION" + | "ERROR_LDAP_CANNOT_BIND" + | "ERROR_LDAP_CANNOT_UNBIND" + | "ERROR_LDAP_CANNOT_SEARCH" + | "ERROR_LDAP_CANNOT_START_TLS" + | "ERROR_LDAP_FOUND_NO_OBJECTS" + | "ERROR_LDAP_NOT_ONE_USER_FOUND" + | "ERROR_LDAP_USER_NOT_IDENTIFIED" + | "ERROR_LDAP_INVALID_MODE" + | "ERROR_TASK_INVALID_ID" + | "ERROR_TASK_DUPLICATE_ID" + | "ERROR_TASK_NOT_FOUND" + | "ERROR_GRAPH_INVALID_GRAPH" + | "ERROR_GRAPH_COULD_NOT_CREATE_GRAPH" + | "ERROR_GRAPH_INVALID_VERTEX" + | "ERROR_GRAPH_COULD_NOT_CREATE_VERTEX" + | "ERROR_GRAPH_COULD_NOT_CHANGE_VERTEX" + | "ERROR_GRAPH_INVALID_EDGE" + | "ERROR_GRAPH_COULD_NOT_CREATE_EDGE" + | "ERROR_GRAPH_COULD_NOT_CHANGE_EDGE" + | "ERROR_GRAPH_TOO_MANY_ITERATIONS" + | "ERROR_GRAPH_INVALID_FILTER_RESULT" + | "ERROR_GRAPH_EMPTY" + | "ERROR_SESSION_UNKNOWN" + | "ERROR_SESSION_EXPIRED" + | "SIMPLE_CLIENT_UNKNOWN_ERROR" + | "SIMPLE_CLIENT_COULD_NOT_CONNECT" + | "SIMPLE_CLIENT_COULD_NOT_WRITE" + | "SIMPLE_CLIENT_COULD_NOT_READ" + | "COMMUNICATOR_REQUEST_ABORTED" + | "COMMUNICATOR_DISABLED" + | "ERROR_MALFORMED_MANIFEST_FILE" + | "ERROR_INVALID_SERVICE_MANIFEST" + | "ERROR_SERVICE_FILES_MISSING" + | "ERROR_SERVICE_FILES_OUTDATED" + | "ERROR_INVALID_FOXX_OPTIONS" + | "ERROR_INVALID_MOUNTPOINT" + | "ERROR_SERVICE_NOT_FOUND" + | "ERROR_SERVICE_NEEDS_CONFIGURATION" + | "ERROR_SERVICE_MOUNTPOINT_CONFLICT" + | "ERROR_SERVICE_MANIFEST_NOT_FOUND" + | "ERROR_SERVICE_OPTIONS_MALFORMED" + | "ERROR_SERVICE_SOURCE_NOT_FOUND" + | "ERROR_SERVICE_SOURCE_ERROR" + | "ERROR_SERVICE_UNKNOWN_SCRIPT" + | "ERROR_MODULE_NOT_FOUND" + | "ERROR_MODULE_SYNTAX_ERROR" + | "ERROR_MODULE_FAILURE" + | "ERROR_NO_SMART_COLLECTION" + | "ERROR_NO_SMART_GRAPH_ATTRIBUTE" + | "ERROR_CANNOT_DROP_SMART_COLLECTION" + | "ERROR_KEY_MUST_BE_PREFIXED_WITH_SMART_GRAPH_ATTRIBUTE" + | "ERROR_ILLEGAL_SMART_GRAPH_ATTRIBUTE" + | "ERROR_AGENCY_INQUIRY_SYNTAX" + | "ERROR_AGENCY_INFORM_MUST_BE_OBJECT" + | "ERROR_AGENCY_INFORM_MUST_CONTAIN_TERM" + | "ERROR_AGENCY_INFORM_MUST_CONTAIN_ID" + | "ERROR_AGENCY_INFORM_MUST_CONTAIN_ACTIVE" + | "ERROR_AGENCY_INFORM_MUST_CONTAIN_POOL" + | "ERROR_AGENCY_INFORM_MUST_CONTAIN_MIN_PING" + | "ERROR_AGENCY_INFORM_MUST_CONTAIN_MAX_PING" + | "ERROR_AGENCY_INFORM_MUST_CONTAIN_TIMEOUT_MULT" + | "ERROR_AGENCY_INQUIRE_CLIENT_ID_MUST_BE_STRING" + | "ERROR_AGENCY_CANNOT_REBUILD_DBS" + | "ERROR_SUPERVISION_GENERAL_FAILURE" + | "ERROR_DISPATCHER_IS_STOPPING" + | "ERROR_QUEUE_UNKNOWN" + | "ERROR_QUEUE_FULL"; + + // Collection + + type DocumentCollectionType = 2; + type EdgeCollectionType = 3; + type CollectionType = DocumentCollectionType | EdgeCollectionType; + + interface CollectionChecksum { + checksum: string; + revision: string; + } + + interface CollectionFigures { + alive: { + count: number; + size: number; + }; + dead: { + count: number; + size: number; + deletion: number; + }; + datafiles: { + count: number; + fileSize: number; + }; + journals: { + count: number; + fileSize: number; + }; + compactors: { + count: number; + fileSize: number; + }; + shapefiles: { + count: number; + fileSize: number; + }; + shapes: { + count: number; + size: number; + }; + attributes: { + count: number; + size: number; + }; + indexes: { + count: number; + size: number; + }; + lastTick: number; + uncollectedLogfileEntries: number; + documentReferences: number; + waitingFor: string; + compactionStatus: { + time: string; + message: string; + count: number; + filesCombined: number; + bytesRead: number; + bytesWritten: number; + }; + } + + interface CollectionPropertiesOptions { + waitForSync?: boolean; + journalSize?: number; + indexBuckets?: number; + replicationFactor?: number; + } + + interface CollectionProperties { + waitForSync: boolean; + journalSize: number; + isVolatile: boolean; + keyOptions?: { + type: string; + allowUserKeys: boolean; + increment?: number; + offset?: number; + }; + indexBuckets: number; + numberOfShards?: number; + shardKeys?: string[]; + replicationFactor?: number; + } + + // Indexes + + interface IndexLike { + [key: string]: any; + id: string; + } + + interface IndexDescription { + type: IndexType; + fields: ReadonlyArray; + sparse?: boolean; + unique?: boolean; + deduplicate?: boolean; + } + + interface Index { + id: string; + type: IndexType; + fields: Array; + sparse: boolean; + unique: boolean; + deduplicate: boolean; + isNewlyCreated: boolean; + selectivityEstimate: number; + code: number; + } + + // Document + + interface ObjectWithId { + [key: string]: any; + _id: string; + } + + interface ObjectWithKey { + [key: string]: any; + _key: string; + } + + type DocumentLike = ObjectWithId | ObjectWithKey; + + interface DocumentMetadata { + _key: string; + _id: string; + _rev: string; + } + + interface UpdateMetadata extends DocumentMetadata { + _oldRev: string; + } + + type Document = { [K in keyof T]: T[K] } & + DocumentMetadata & { _from?: string; _to?: string } & { + [key: string]: any; + }; + type DocumentData = { [K in keyof T]: T[K] } & + Partial; + type Edge = Document & { + _from: string; + _to: string; + }; + + interface InsertResult extends DocumentMetadata { + new?: Document; + } + interface UpdateResult extends UpdateMetadata { + old?: Document; + new?: Document; + } + interface RemoveResult extends DocumentMetadata { + old?: Document; + } + + interface InsertOptions { + waitForSync?: boolean; + silent?: boolean; + returnNew?: boolean; + } + + interface ReplaceOptions extends InsertOptions { + overwrite?: boolean; + returnOld?: boolean; + } + + interface UpdateOptions extends ReplaceOptions { + keepNull?: boolean; + mergeObjects?: boolean; + } + + interface UpdateByExampleOptions { + keepNull?: boolean; + waitForSync?: boolean; + limit?: number; + } + + interface RemoveOptions { + waitForSync?: boolean; + overwrite?: boolean; + returnOld?: boolean; + silent?: boolean; + } + + interface RemoveByExampleOptions { + waitForSync?: boolean; + limit?: number; + } + + interface IterateOptions { + limit?: number; + probability?: number; + } + + type DocumentIterator = ( + document: Document, + number: number + ) => void; + + interface Collection { + // Collection + checksum( + withRevisions?: boolean, + withData?: boolean + ): CollectionChecksum; + count(): number; + drop(options?: { isSystem?: boolean }): void; + figures(): CollectionFigures; + load(): void; + path(): string; + properties( + properties?: CollectionPropertiesOptions + ): CollectionProperties; + revision(): string; + rotate(): void; + toArray(): Array>; + truncate(): void; + type(): CollectionType; + unload(): void; + + // Indexes + dropIndex(index: string | IndexLike): boolean; + ensureIndex(description: IndexDescription): Index; + getIndexes(): Array>; + index(index: string | IndexLike): Index | null; + + // Document + all(): Cursor>; + any(): Document; + byExample(example: Partial>): Cursor>; + document(selector: string | DocumentLike): Document; + document( + selectors: ReadonlyArray + ): Array>; + exists(name: string): boolean; + firstExample(example: Partial>): Document | null; + insert(data: DocumentData, options?: InsertOptions): InsertResult; + insert( + array: ReadonlyArray>, + options?: InsertOptions + ): Array>; + insert( + from: string, + to: string, + data: DocumentData, + options?: InsertOptions + ): InsertResult; + edges( + vertex: string | ObjectWithId | ReadonlyArray + ): Array>; + inEdges( + vertex: string | ObjectWithId | ReadonlyArray + ): Array>; + outEdges( + vertex: string | ObjectWithId | ReadonlyArray + ): Array>; + iterate(iterator: DocumentIterator, options?: IterateOptions): void; + remove( + selector: string | DocumentLike, + options?: RemoveOptions + ): RemoveResult; + remove( + selectors: ReadonlyArray, + options?: RemoveOptions + ): RemoveResult[]; + removeByExample( + example: Partial>, + waitForSync?: boolean, + limit?: number + ): number; + removeByExample( + example: Partial>, + options?: RemoveByExampleOptions + ): number; + rename(newName: string): void; + replace( + selector: string | DocumentLike, + data: DocumentData, + options?: ReplaceOptions + ): UpdateResult; + replace( + selectors: ReadonlyArray, + data: ReadonlyArray>, + options?: ReplaceOptions + ): Array>; + replaceByExample( + example: Partial>, + newValue: DocumentData, + waitForSync?: boolean, + limit?: number + ): number; + replaceByExample( + example: Partial>, + newValue: DocumentData, + options?: { waitForSync?: boolean; limit?: number } + ): number; + save(data: DocumentData, options?: InsertOptions): InsertResult; + save( + array: ReadonlyArray>, + options?: InsertOptions + ): Array>; + save( + from: string, + to: string, + data: DocumentData, + options?: InsertOptions + ): InsertResult; + update( + selector: string | DocumentLike, + data: Partial>, + options?: UpdateOptions + ): UpdateResult; + update( + selectors: ReadonlyArray, + data: ReadonlyArray>>, + options?: UpdateOptions + ): Array>; + updateByExample( + example: Partial>, + newValue: Partial>, + keepNull?: boolean, + waitForSync?: boolean, + limit?: number + ): number; + updateByExample( + example: Partial>, + newValue: Partial>, + options?: UpdateByExampleOptions + ): number; + } + + // Database + + interface DatabaseUser { + username: string; + passwd?: string; + active?: boolean; + extra?: object; + } + + // AQL + + interface Query { + query: string; + bindVars?: object; + options?: QueryOptions; + } + + interface Cursor { + toArray(): T[]; + hasNext(): boolean; + next(): T; + count(count?: boolean): number; + getExtra(): QueryExtra; + setBatchSize(size: number): void; + getBatchSize(): number; + execute(batchSize?: number): void; + dispose(): void; + } + + interface Statement { + bind(name: string, value: any): void; + setBatchSize(size: number): void; + getBatchSize(): number; + execute(): Cursor; + } + + interface QueryOptions { + memoryLimit?: number; + failOnWarning?: boolean; + cache?: boolean; + count?: boolean; + fullCount?: boolean; + profile?: boolean; + maxWarningCount?: number; + maxNumberOfPlans?: number; + stream?: boolean; + // RocksDB + maxTransactionsSize?: number; + intermediateCommitSize?: number; + intermediateCommitCount?: number; + // enterprise + skipInaccessibleCollections?: boolean; + } + + interface QueryExtra { + stats: { + writesExecuted: number; + writesIgnored: number; + scannedFull: number; + scannedIndex: number; + filtered: number; + httpRequests: number; + fullCount: number; + executionTime: number; + }; + warnings: string[]; + } + + interface QueryAstNode { + type: string; + subNodes?: QueryAstNode[]; + [key: string]: any; + } + + interface ParsedQuery { + parsed: boolean; + collections: string[]; + parameters: string[]; + bindVars: string[]; + ast: QueryAstNode[]; + } + + // Views + + interface View { + // TODO + [key: string]: any; + } + type ViewProperties = object; // TODO + + // Global + + interface TransactionCollections { + read?: string | string[]; + write?: string | string[]; + allowImplicit?: boolean; + } + interface Transaction { + collections: TransactionCollections | string[]; + action: (params: object) => void | string; + waitForSync?: boolean; + lockTimeout?: number; + params?: object; + // RocksDB + maxTransactionsSize?: number; + intermediateCommitSize?: number; + intermediateCommitCount?: number; + } + + interface Database { + // Database + _createDatabase( + name: string, + options?: never, + users?: DatabaseUser[] + ): true; + _databases(): string[]; + _dropDatabase(name: string): true; + _useDatabase(name: string): Database; + + // Indexes + _index(index: string | IndexLike): Index | null; + _dropIndex(index: string | IndexLike): boolean; + + // Properties + _id(): string; + _isSystem(): boolean; + _name(): string; + _path(): string; + _version(): string; + + // Collection + _collection(name: string): Collection; + _collections(): Collection[]; + _create(name: string, properties?: CollectionProperties): Collection; + _createDocumentCollection( + name: string, + properties?: CollectionProperties + ): Collection; + _createEdgeCollection( + name: string, + properties?: CollectionProperties + ): Collection; + _drop(name: string): void; + _truncate(name: string): void; + + // AQL + _createStatement(query: Query | string): Statement; + _query( + query: Query | string, + bindVars?: object, + options?: QueryOptions + ): Cursor; + _explain(query: Query | string): void; + _parse(query: string): ParsedQuery; + + // Document + _document(name: string): Document; + _exists(selector: string | ObjectWithId): DocumentMetadata; + _remove(selector: string | ObjectWithId): DocumentMetadata; + _replace( + selector: string | ObjectWithId, + data: object + ): DocumentMetadata; + _update( + selector: string | ObjectWithId, + data: object + ): DocumentMetadata; + + // Views + _view(name: string): View | null; + _views(): View[]; + _createView( + name: string, + type: ViewType, + properties: ViewProperties + ): View; + _dropView(name: string): void; + + // Global + _engine(): EngineType; + _engineStats(): { [key: string]: any }; + _executeTransaction(transaction: Transaction): void; + } +} + +declare namespace Foxx { + interface Session { + uid: string | null; + created: number; + data: any; + } + interface SessionStorage { + new?: () => Session; + fromClient: (sid: string) => Session | null; + forClient: (session: Session) => string | null; + } + interface SessionTransport { + get?: (req: Request) => string | null; + set?: (res: Response, sid: string) => void; + clear?: (res: Response) => void; + } + + type Middleware = (req: Request, res: Response, next: NextFunction) => void; + type Handler = ((req: Request, res: Response) => void); + type NextFunction = () => void; + + interface ValidationResult { + value: T; + error: any; + } + + interface Schema { + isJoi: boolean; + validate(value: T): ValidationResult; + } + + interface Model { + schema: Schema; + fromClient?: (value: any) => any; + forClient?: (value: any) => any; + } + + interface DocumentationRouterOptions { + mount: string; + indexFile: string; + swaggerRoot: string; + before: (req: Request, res: Response) => void | false; + } + + interface MediaType { + type: string; + subtype: string; + suffix?: string; + parameters: { + charset: string; + }; + } + + interface TypeDefinition { + fromClient?: ( + body: string | Buffer, + req: Request, + type: MediaType + ) => any; + forClient?: ( + body: any + ) => { + data: string; + headers: { [key: string]: string | undefined }; + }; + } + + type Ranges = Array<{ + start: number; + end: number; + }> & { type: string }; + + type ConfigurationType = + | "integer" + | "boolean" + | "string" + | "number" + | "json" + | "password" + | "int" + | "bool"; + interface ConfigurationDefinition { + default?: any; + type?: ConfigurationType; + description?: string; + required: boolean; + } + interface DependencyDefinition { + name: string; + version: string; + description?: string; + required: boolean; + multiple: boolean; + } + interface AssetDefinition { + path: string; + gzip?: boolean; + type?: string; + } + + interface Manifest { + name?: string; + version?: string; + keywords?: string; + license?: string; + repository?: { type: string; url: string }; + author: string; + contributors?: any[]; + description: string; + thumbnail?: string; + engines?: { [key: string]: string | undefined }; + defaultDocument?: string; + lib: string; + main?: string; + configuration?: { [key: string]: ConfigurationDefinition }; + dependencies?: { [key: string]: DependencyDefinition }; + provides?: { [key: string]: string | undefined }; + files?: { [key: string]: AssetDefinition }; + scripts?: { [key: string]: string | undefined }; + tests?: string[]; + } + + interface Context { + argv: any[]; + basePath: string; + baseUrl: string; + collectionPrefix: string; + configuration: { [key: string]: any }; + dependencies: { [key: string]: any }; + isDevelopment: boolean; + isProduction: boolean; + manifest: Manifest; + mount: string; + collection(name: string): ArangoDB.Collection | null; + collectionName(name: string): string; + createDocumentationRouter( + opts?: + | Partial + | DocumentationRouterOptions["before"] + | DocumentationRouterOptions["swaggerRoot"] + ): Router; + file(name: string): Buffer; + file(name: string, encoding: string): string; + fileName(name: string): string; + registerType(type: string, def: TypeDefinition): void; + use( + path: string, + routerOrMiddleware: Router | Middleware, + name?: string + ): Endpoint; + use(routerOrMiddleware: Router | Middleware, name?: string): Endpoint; + } + + interface Request { + arangoUser: string | null; + arangoVersion: number; + baseUrl: string; + body: any; + context: Context; + database: string; + headers: { [key: string]: string | undefined }; + hostname: string; + method: ArangoDB.HttpMethod; + originalUrl: string; + path: string; + pathParams: { [key: string]: any }; + port: number; + protocol: string; + queryParams: { [key: string]: any }; + rawBody: Buffer; + remoteAddress: string; + remoteAddresses: string[]; + remotePort: number; + secure: boolean; + session?: Session; + sessionStorage?: SessionStorage; + suffix: string; + trustProxy: boolean; + url: string; + xhr: boolean; + accepts(types: string[]): string | false; + accepts(...types: string[]): string | false; + acceptsCharsets(charsets: string[]): string | false; + acceptsCharsets(...charsets: string[]): string | false; + acceptsEncodings(encodings: string[]): string | false; + acceptsEncodings(...encodings: string[]): string | false; + acceptsLanguages(languages: string[]): string | false; + acceptsLanguages(...languages: string[]): string | false; + cookie( + name: string, + options?: { secret?: string; algorithm?: ArangoDB.HashAlgorithm } + ): string | null; + get(name: string): string | undefined; + header(name: string): string | undefined; + is(types: string[]): string; + is(...types: string[]): string; + json(): any; + makeAbsolute( + path: string, + query?: string | { [key: string]: string | undefined } + ): string; + param(name: string): any; + range(size?: number): Ranges | number; + reverse(name: string, params?: object): string; + } + + interface Response { + body: Buffer | string; + context: Context; + headers: { [key: string]: any }; + statusCode: number; + attachment(filename?: string): this; + cookie( + name: string, + value: string, + options?: { + ttl?: number; + algorithm?: ArangoDB.HashAlgorithm; + secret?: string; + path?: string; + domain?: string; + secure?: boolean; + httpOnly?: boolean; + } + ): this; + download(path: string, filename?: string): this; + getHeader(name: string): string | undefined; + json(data: any): this; + redirect(status: number | ArangoDB.HttpStatus, path: string): this; + redirect(path: string): this; + removeHeader(name: string): this; + send(data: any, type?: string): this; + sendFile(path: string, options?: { lastModified: boolean }): this; + sendStatus(status: number | ArangoDB.HttpStatus): this; + setHeader(name: string, value: string): this; + set(name: string, value: string): this; + set(headers: { [name: string]: string }): this; + status(status: number | ArangoDB.HttpStatus): this; + throw( + status: number | ArangoDB.HttpStatus, + reason: string, + error: Error + ): never; + throw( + status: number | ArangoDB.HttpStatus, + reason: string, + options?: { cause?: Error; extra?: any } + ): never; + throw(status: number | ArangoDB.HttpStatus, error: Error): never; + throw( + status: number | ArangoDB.HttpStatus, + options?: { cause?: Error; extra?: any } + ): never; + type(type?: string): string; + vary(names: string[]): this; + vary(...names: string[]): this; + write(data: string | Buffer): this; + } + + interface Endpoint { + header(name: string, schema: Schema, description?: string): this; + header(name: string, description: string): this; + pathParam(name: string, schema: Schema, description?: string): this; + pathParam(name: string, description: string): this; + queryParam(name: string, schema: Schema, description?: string): this; + queryParam(name: string, description: string): this; + body( + schema: Schema | Model | [Model], + mimes?: string[], + description?: string + ): this; + body( + schemaOrMimes: Schema | Model | [Model] | string[], + description?: string + ): this; + body(description: string): this; + response( + status: number | ArangoDB.HttpStatus, + schema: Schema | Model | [Model], + mimes?: string[], + description?: string + ): this; + response( + status: number | ArangoDB.HttpStatus, + mimes: string[], + description?: string + ): this; + response( + status: number | ArangoDB.HttpStatus, + description: string + ): this; + summary(summary: string): this; + description(description: string): this; + deprecated(deprecated: boolean): this; + error(status: number | ArangoDB.HttpStatus, description: string): this; + tag(...tags: string[]): this; + } + + function route(handler: Handler, name?: string): Endpoint; + function route( + pathOrMiddleware: string | Middleware, + handler: Handler, + name?: string + ): Endpoint; + function route( + pathOrMiddleware: string | Middleware, + middleware: Middleware, + handler: Handler, + name?: string + ): Endpoint; + function route( + pathOrMiddleware: string | Middleware, + middleware1: Middleware, + middleware2: Middleware, + handler: Handler, + name?: string + ): Endpoint; + function route( + pathOrMiddleware: string | Middleware, + middleware1: Middleware, + middleware2: Middleware, + middleware3: Middleware, + handler: Handler, + name?: string + ): Endpoint; + function route( + pathOrMiddleware: string | Middleware, + middleware1: Middleware, + middleware2: Middleware, + middleware3: Middleware, + middleware4: Middleware, + handler: Handler, + name?: string + ): Endpoint; + function route( + pathOrMiddleware: string | Middleware, + middleware1: Middleware, + middleware2: Middleware, + middleware3: Middleware, + middleware4: Middleware, + middleware5: Middleware, + handler: Handler, + name?: string + ): Endpoint; + function route( + pathOrMiddleware: string | Middleware, + middleware1: Middleware, + middleware2: Middleware, + middleware3: Middleware, + middleware4: Middleware, + middleware5: Middleware, + middleware6: Middleware, + handler: Handler, + name?: string + ): Endpoint; + function route( + pathOrMiddleware: string | Middleware, + middleware1: Middleware, + middleware2: Middleware, + middleware3: Middleware, + middleware4: Middleware, + middleware5: Middleware, + middleware6: Middleware, + middleware7: Middleware, + handler: Handler, + name?: string + ): Endpoint; + function route( + pathOrMiddleware: string | Middleware, + middleware1: Middleware, + middleware2: Middleware, + middleware3: Middleware, + middleware4: Middleware, + middleware5: Middleware, + middleware6: Middleware, + middleware7: Middleware, + middleware8: Middleware, + handler: Handler, + name?: string + ): Endpoint; + function route( + pathOrMiddleware: string | Middleware, + middleware1: Middleware, + middleware2: Middleware, + middleware3: Middleware, + middleware4: Middleware, + middleware5: Middleware, + middleware6: Middleware, + middleware7: Middleware, + middleware8: Middleware, + middleware9: Middleware, + handler: Handler, + name?: string + ): Endpoint; + + interface Router { + get: typeof route; + post: typeof route; + put: typeof route; + patch: typeof route; + delete: typeof route; + all: typeof route; + use( + path: string, + routerOrMiddleware: Router | Middleware, + name?: string + ): Endpoint; + use(routerOrMiddleware: Router | Middleware, name?: string): Endpoint; + } +} + +declare module "@arangodb" { + function aql(strings: TemplateStringsArray, ...args: any[]): ArangoDB.Query; + function time(): number; + const db: ArangoDB.Database & { + [key: string]: ArangoDB.Collection | undefined; + }; + const errors: { + [Name in ArangoDB.ErrorName]: { code: number; message: string } + }; +} + +declare module "@arangodb/foxx/router" { + function createRouter(): Foxx.Router; + export = createRouter; +} + +declare module "@arangodb/foxx/graphql" { + import { GraphQLSchema, formatError } from "graphql"; + type GraphQLModule = object; + type GraphQLFormatErrorFunction = typeof formatError; + interface GraphQLOptions { + schema: GraphQLSchema; + context?: any; + rootValue?: object; + pretty?: boolean; + formatError?: GraphQLFormatErrorFunction; + validationRules?: any[]; + graphiql?: boolean; + graphql?: GraphQLModule; + } + function createGraphQLRouter( + options: GraphQLOptions | GraphQLSchema + ): Foxx.Router; + export = createGraphQLRouter; +} + +declare module "@arangodb/foxx/sessions" { + interface SessionsMiddleware extends Foxx.Middleware { + storage: Foxx.SessionStorage; + transport: Foxx.SessionTransport[]; + } + interface SessionsOptions { + storage: Foxx.SessionStorage | string | ArangoDB.Collection; + transport: + | Foxx.SessionTransport + | Foxx.SessionTransport[] + | "cookie" + | "header"; + autoCreate?: boolean; + } + function sessionsMiddleware(options: SessionsOptions): Foxx.Middleware; + export = sessionsMiddleware; +} + +declare module "@arangodb/foxx/sessions/storages/collection" { + interface CollectionStorageOptions { + collection: string | ArangoDB.Collection; + ttl?: number; + pruneExpired?: boolean; + autoUpdate?: boolean; + } + interface CollectionStorage extends Foxx.SessionStorage { + prune: () => string[]; + } + function collectionStorage( + options: + | CollectionStorageOptions + | CollectionStorageOptions["collection"] + ): CollectionStorage; + export = collectionStorage; +} + +declare module "@arangodb/foxx/sessions/storages/jwt" { + interface SafeJwtStorageOptions { + algorithm?: ArangoDB.JwtAlgorithm; + secret: string; + ttl?: number; + verify?: boolean; + maxExp?: number; + } + interface UnsafeJwtStorageOptions { + algorithm: "none"; + ttl?: number; + verify?: boolean; + maxExp?: number; + } + function jwtStorage( + options: + | SafeJwtStorageOptions + | UnsafeJwtStorageOptions + | SafeJwtStorageOptions["secret"] + ): Foxx.SessionStorage; + export = jwtStorage; +} + +declare module "@arangodb/foxx/sessions/transports/cookie" { + interface CookieTransportOptions { + name?: string; + ttl?: number; + algorithm?: ArangoDB.HashAlgorithm; + secret?: string; + path?: string; + domain?: string; + secure?: string; + httpOnly?: string; + } + function cookieTransport( + options?: CookieTransportOptions + ): Foxx.SessionTransport; + function cookieTransport(name: string): Foxx.SessionTransport; + export = cookieTransport; +} + +declare module "@arangodb/foxx/sessions/transports/header" { + interface HeaderTransportOptions { + name?: string; + } + function headerTransport( + options?: HeaderTransportOptions + ): Foxx.SessionTransport; + function headerTransport(name: string): Foxx.SessionTransport; + export = headerTransport; +} + +declare module "@arangodb/foxx/auth" { + interface AuthData { + method: string; + salt: string; + hash: string; + } + interface Authenticator { + create(password: string): AuthData; + verify(hash?: AuthData, password?: string): boolean; + } + interface AuthOptions { + method?: ArangoDB.HashAlgorithm; + saltLength?: number; + } + function createAuth(options?: AuthOptions): Authenticator; + export = createAuth; +} + +declare module "@arangodb/foxx/oauth1" { + interface OAuth1Options { + requestTokenEndpoint: string; + authEndpoint: string; + accessTokenEndpoint: string; + activeUserEndpoint?: string; + clientId: string; + clientSecret: string; + signatureMethod?: "HMAC-SHA1" | "PLAINTEXT"; + } + interface OAuth1Client { + fetchRequestToken( + oauth_callback: string, + qs?: { [key: string]: string | undefined } + ): any; + getAuthUrl( + oauth_token: string, + qs?: { [key: string]: string | undefined } + ): string; + exchangeRequestToken( + oauth_token: string, + oauth_verifier: string, + qs?: { [key: string]: string | undefined } + ): any; + fetchActiveUser( + oauth_token: string, + oauth_token_secret: string, + qs?: { [key: string]: string | undefined } + ): any; + createSignedRequest( + method: ArangoDB.HttpMethod, + url: string, + parameters: string | { [key: string]: string | undefined } | null, + oauth_token: string, + oauth_token_secret: string + ): { + url: string; + qs: string; + headers: { accept: "application/json"; authorization: string }; + }; + } + function createOAuth1Client(options: OAuth1Options): OAuth1Client; + export = createOAuth1Client; +} + +declare module "@arangodb/foxx/oauth2" { + interface OAuth2Options { + authEndpoint: string; + tokenEndpoint: string; + refreshEndpoint?: string; + activeUserEndpoint?: string; + clientId: string; + clientSecret: string; + } + interface OAuth2Client { + getAuthUrl( + redirect_uri: string, + options?: { response_type?: string } + ): string; + exchangeGrantToken( + code: string, + redirect_uri: string, + options?: { grant_type?: string } + ): any; + fetchActiveUser(access_token: string): any; + } + function createOAuth2Client(options: OAuth2Options): OAuth2Client; + export = createOAuth2Client; +} + +declare module "@arangodb/foxx" { + function createRouter(): Foxx.Router; +} + +declare module "@arangodb/request" { + interface Response { + rawBody: Buffer; + body: string | Buffer; + json?: any; + headers: { [key: string]: string | undefined }; + status: number; + statusCode: number; + message: string; + throw(message?: string): void | never; + } + interface RequestOptions { + qs?: object; + useQuerystring?: boolean; + headers?: { [key: string]: string | undefined }; + body?: any; + json?: boolean; + form?: any; + auth?: { username: string; password?: string } | { bearer: string }; + sslProtocol?: number; + followRedirect?: boolean; + maxRedirects?: number; + encoding?: string | null; + timeout?: number; + returnBodyOnError?: boolean; + } + function method(options: { url: string } & RequestOptions): Response; + function method(url: string, options?: RequestOptions): Response; + interface Request { + ( + options: { + url: string; + method?: ArangoDB.HttpMethod; + } & RequestOptions + ): Response; + head: typeof method; + get: typeof method; + post: typeof method; + put: typeof method; + patch: typeof method; + delete: typeof method; + } + const request: Request; + export = request; +} + +declare module "@arangodb/crypto" { + function createNonce(): string; + function checkAndMarkNonce(nonce: string): void; + function rand(): number; + function genRandomAlphaNumbers(length: number): string; + function genRandomNumbers(length: number): string; + function genRandomSalt(length: number): string; + function jwtEncode( + key: string, + message: string, + algorithm: ArangoDB.JwtAlgorithm + ): string; + function jwtEncode(key: null, message: string, algorithm: "none"): string; + function jwtDecode( + key: string | null, + token: string, + noVerify?: boolean + ): string | null; + function md5(message: string): string; + function sha1(message: string): string; + function sha224(message: string): string; + function sha256(message: string): string; + function sha384(message: string): string; + function sha512(message: string): string; + function constantEquals(a: string, b: string): boolean; + function pbkdf2( + salt: string, + password: string, + iterations: number, + keyLength: number + ): string; + function hmac( + key: string, + message: string, + algorithm: ArangoDB.HashAlgorithm + ): string; +} + +declare module "@arangodb/general-graph" { + interface EdgeDefinition { + collection: string; + from: string[]; + to: string[]; + } + interface CommonNeighbors { + left: string; + right: string; + neighbors: string[]; + } + interface CountCommonNeighbors { + [key: string]: Array<{ [key: string]: number | undefined }> | undefined; + } + interface CommonProperties { + [key: string]: + | Array<{ _id: string } & { [key: string]: any }> + | undefined; + } + interface CountCommonProperties { + [key: string]: number | undefined; + } + interface Path< + A extends object = any, + B extends object = any, + E extends object = any, + V extends object = never + > { + source: ArangoDB.Document; + destination: ArangoDB.Document; + edges: Array>; + vertice: Array>; + } + interface ShortestPath { + vertices: string[]; + edges: Array>; + distance: number; + } + interface Distance { + startVertex: string; + vertex: string; + distance: number; + } + interface Eccentricity { + [key: string]: number | undefined; + } + type Closeness = Eccentricity; + type Betweenness = Eccentricity; + type Example = Array | object | string | null; + interface ConnectingEdgesOptions { + edgeExamples?: Example; + edgeCollectionRestriction?: string[] | string; + vertex1CollectionRestriction?: string[] | string; + vertex2CollectionRestriction?: string[] | string; + } + interface NeighborsOptions { + direction?: ArangoDB.EdgeDirection; + edgeExamples?: Example; + neighborExamples?: Example; + edgeCollectionRestriction?: string[] | string; + vertexCollectionRestriction?: string[] | string; + minDepth?: number; + maxDepth?: number; + } + interface CommonPropertiesOptions { + vertex1CollectionRestriction?: string[] | string; + vertex2CollectionRestriction?: string[] | string; + ignoredProperties?: string[] | string; + } + interface PathsOptions { + direction?: ArangoDB.EdgeDirection; + followCycles?: boolean; + minLength?: number; + maxLength?: number; + } + interface ShortestPathOptions { + direction?: ArangoDB.EdgeDirection; + edgeCollectionRestriction?: string[] | string; + startVertexCollectionRestriction?: string[] | string; + endVertexCollectionRestriction?: string[] | string; + weight?: string; + defaultWeight?: number; + } + type EccentricityOptions = ShortestPathOptions; + type ClosenessOptions = ShortestPathOptions; + interface BetweennessOptions { + direction?: ArangoDB.EdgeDirection; + weight?: string; + defaultWeight?: number; + } + type RadiusOptions = BetweennessOptions; + type DiameterOptions = BetweennessOptions; + interface Graph { + _extendEdgeDefinitions(edgeDefinition: EdgeDefinition): void; + _editEdgeDefinitions(edgeDefinition: EdgeDefinition): void; + _deleteEdgeDefinition( + edgeCollectionName: string, + dropCollection?: boolean + ): void; + _addVertexCollection( + orphanCollectionName: string, + createCollection?: boolean + ): void; + _orphanCollections(): string[]; + _removeVertexCollection( + orphanCollectionName: string, + dropCollection?: boolean + ): void; + _getConnectingEdges( + vertexExample1: Example, + vertexExample2: Example, + options: ConnectingEdgesOptions + ): ArangoDB.Edge; + _fromVertex(edgeId: string): ArangoDB.Document; + _toVertex(edgeId: string): ArangoDB.Document; + _neighbors( + vertexExample: Example, + options?: NeighborsOptions + ): string[]; + _commonNeighbors( + vertex1Example: Example, + vertex2Example: Example, + vertex1Options?: NeighborsOptions, + vertex2Options?: NeighborsOptions + ): CommonNeighbors[]; + _countCommonNeighbors( + vertex1Example: Example, + vertex2Example: Example, + vertex1Options?: NeighborsOptions, + vertex2Options?: NeighborsOptions + ): CountCommonNeighbors[]; + _commonProperties( + vertexExample1: Example, + vertex2Example: Example, + options?: CommonPropertiesOptions + ): CommonProperties[]; + _countCommonProperties( + vertex1Example: Example, + vertex2Example: Example, + options?: CommonPropertiesOptions + ): CountCommonProperties[]; + _paths(options?: PathsOptions): Path[]; + _shortestPath( + startVertexExample: Example, + endVertexExample: Example, + options?: ShortestPathOptions + ): ShortestPath[]; + _distanceTo( + startVertexExample: Example, + endVertexExample: Example, + options?: ShortestPathOptions + ): Distance[]; + _absoluteEccentricity( + vertexExample: Example, + options?: EccentricityOptions + ): Eccentricity; + _eccentricity( + vertexExample: Example, + options?: EccentricityOptions + ): Eccentricity; + _absoluteCloseness( + vertexExample: Example, + options?: ClosenessOptions + ): Closeness; + _closeness( + vertexExample: Example, + options?: ClosenessOptions + ): Closeness; + _absoluteBetweenness( + vertexExample: Example, + options?: BetweennessOptions + ): Betweenness; + _betweenness( + vertexExample: Example, + options?: BetweennessOptions + ): Betweenness; + _radius(vertexExample: Example, options?: RadiusOptions): number; + _diameter(vertexExample: Example, options?: DiameterOptions): number; + } + function _create( + name: string, + edgeDefinitions?: EdgeDefinition[], + orphanCollections?: string[] + ): Graph & { + [key: string]: ArangoDB.Collection | undefined; + }; + function _list(): string[]; + function _graph( + name: string + ): Graph & { + [key: string]: ArangoDB.Collection | undefined; + }; + function _drop(name: string, dropCollections?: boolean): boolean; + function _relation( + name: string, + fromVertexCollections: string[] | string, + toVertexCollections: string[] | string + ): EdgeDefinition; + function _edgeDefinitions(...relations: EdgeDefinition[]): EdgeDefinition[]; + function _extendEdgeDefinitions( + edgeDefinitions: EdgeDefinition[], + ...relations: EdgeDefinition[] + ): EdgeDefinition[]; +} + +declare module "@arangodb/locals" { + const context: Foxx.Context; +} + +interface NodeModule { + context: Foxx.Context; +} + +interface Console { + logLines(...args: any[]): void; + errorLines(...args: any[]): void; + warnLines(...args: any[]): void; + infoLines(...args: any[]): void; + debugLines(...args: any[]): void; + errorStack(err: Error, msg?: string): void; + warnStack(err: Error, msg?: string): void; + infoStack(err: Error, msg?: string): void; + debugStack(err: Error, msg?: string): void; +} diff --git a/types/arangodb/tsconfig.json b/types/arangodb/tsconfig.json new file mode 100644 index 0000000000..f778fd7c47 --- /dev/null +++ b/types/arangodb/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "arangodb-tests.ts"] +} diff --git a/types/arangodb/tslint.json b/types/arangodb/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/arangodb/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From ebad624215ea63fb6b2c0c7bbe48be205061d105 Mon Sep 17 00:00:00 2001 From: Periklis Tsirakidis Date: Wed, 25 Apr 2018 01:29:04 +0200 Subject: [PATCH 0843/2153] react-lazyload: Update to 2.3.0 (#25030) --- types/react-lazyload/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/react-lazyload/index.d.ts b/types/react-lazyload/index.d.ts index b739b7d8cc..bc66a10b0f 100644 --- a/types/react-lazyload/index.d.ts +++ b/types/react-lazyload/index.d.ts @@ -1,15 +1,15 @@ -// Type definitions for react-lazyload ver 2.2 +// Type definitions for react-lazyload ver 2.3 // Project: https://github.com/jasonslyvia/react-lazyload // Definitions by: m0a // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 -import { Component } from 'react'; +import { Component } from "react"; export interface LazyLoadProps { once?: boolean; height?: number | string; - offset?: number | string; + offset?: number | number[]; overflow?: boolean; scroll?: boolean; children?: JSX.Element; @@ -23,6 +23,6 @@ export default class LazyLoad extends Component { constructor(props: LazyLoad); } -export function lazyload(option: {}): LazyLoad; +export function lazyload(option: {}): LazyLoad; export function forceCheck(): void; From 93bef664052bdd80bd86a4680b8968986093ecff Mon Sep 17 00:00:00 2001 From: Daphne Date: Wed, 25 Apr 2018 01:29:34 +0200 Subject: [PATCH 0844/2153] Added missing prop 'resize' (#25029) --- types/react-lazyload/index.d.ts | 1 + types/react-lazyload/react-lazyload-tests.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/types/react-lazyload/index.d.ts b/types/react-lazyload/index.d.ts index bc66a10b0f..a72fdd3581 100644 --- a/types/react-lazyload/index.d.ts +++ b/types/react-lazyload/index.d.ts @@ -11,6 +11,7 @@ export interface LazyLoadProps { height?: number | string; offset?: number | number[]; overflow?: boolean; + resize?: boolean; scroll?: boolean; children?: JSX.Element; throttle?: number | boolean; diff --git a/types/react-lazyload/react-lazyload-tests.tsx b/types/react-lazyload/react-lazyload-tests.tsx index f673652ef5..3e562300b5 100644 --- a/types/react-lazyload/react-lazyload-tests.tsx +++ b/types/react-lazyload/react-lazyload-tests.tsx @@ -24,7 +24,7 @@ class Normal extends React.Component<{}, State> {
{this.state.arr.map((el, index) => { return ( - +

count={index + 1}

From cd39e74f6b91831c9827566a180fc8ec55435ef8 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 24 Apr 2018 16:30:51 -0700 Subject: [PATCH 0845/2153] protractor-helpers: Move 'jasmine' dependency to tests (#25034) --- types/protractor-helpers/index.d.ts | 4 +++- types/protractor-helpers/protractor-helpers-tests.ts | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/types/protractor-helpers/index.d.ts b/types/protractor-helpers/index.d.ts index 57b94dd6b9..bc52455d6e 100644 --- a/types/protractor-helpers/index.d.ts +++ b/types/protractor-helpers/index.d.ts @@ -4,7 +4,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -/// import * as webdriver from "selenium-webdriver"; declare global { @@ -41,6 +40,9 @@ declare global { // Matchers // TODO - Use `T` to improve types + // Note: This augments a namespace from '@types/jasmine'. + // Intentionally not referencing those types from this file as they introduce many globals, + // and users may use protractor-helpers but not jasmine, and have different definitions of those globals (e.g. through `jest`) namespace jasmine { interface Matchers { toBePresent() : boolean; diff --git a/types/protractor-helpers/protractor-helpers-tests.ts b/types/protractor-helpers/protractor-helpers-tests.ts index 39ac5f079e..36dd9eb583 100644 --- a/types/protractor-helpers/protractor-helpers-tests.ts +++ b/types/protractor-helpers/protractor-helpers-tests.ts @@ -1,3 +1,5 @@ +/// + import helpers = require('protractor-helpers'); import * as webdriver from "selenium-webdriver"; From 593a956550ba6aefbe65077d4cbba98b066c825b Mon Sep 17 00:00:00 2001 From: Mathew Rumsey Date: Tue, 24 Apr 2018 19:42:48 -0400 Subject: [PATCH 0846/2153] command-line-usage added (#24787) * command-line-usage types good default bad * Type adjustments export Section, raw optional * No errors - try remove tslint rule override * Linting .d.ts works great! * typings pass all given examples * Removed type-annotation causing Travis to fail * Re-added Dvorsky as contributor Even though the new definitions completely overwrite the old, it was requested that the original author be re-added. * Fixed a silly, silly mistake - missing comment slashes --- .../command-line-usage-tests.ts | 409 +++++++++++++++++- types/command-line-usage/index.d.ts | 106 +++-- 2 files changed, 461 insertions(+), 54 deletions(-) diff --git a/types/command-line-usage/command-line-usage-tests.ts b/types/command-line-usage/command-line-usage-tests.ts index 05dfadc7f3..23e2284d83 100644 --- a/types/command-line-usage/command-line-usage-tests.ts +++ b/types/command-line-usage/command-line-usage-tests.ts @@ -1,24 +1,397 @@ -import commandLineUsage = require("command-line-usage"); +import getUsage = require('command-line-usage'); -const sections = [ +let usage: string; +let sections: getUsage.Section[]; +let optionDefinitions: getUsage.OptionDefinition[] = []; + +// chalk-escaping.js +usage = getUsage([ { - header: 'A typical app', - content: 'Generates something {italic very} important.' + header: 'A typical app', + content: 'Generates something \\{very important\\}, also retaining `backticks`.' }, { - header: 'Options', - optionList: [ - { - name: 'input', - typeLabel: '{underline file}', - description: 'The input to process.' - }, - { - name: 'help', - description: 'Print this usage guide.' - } - ] + header: 'Options', + optionList: [ + { name: 'files', typeLabel: '\\{something\\}', description: 'This is not \\{red red\\}.'} + ] } -]; + ]); -const usage = commandLineUsage(sections); +// chalk-formatting.js +usage = getUsage([ + { + header: 'A typical app', + content: 'Generates something {italic.keyword("orange") very {rgb(255,231,0).bold important}}. This is a rather long, but {hex("#1ef").underline ultimately} inconsequential ' + + 'description intended {yellow.bgRed.bold solely {bgBlue to}} demonstrate description appearance. ' + }, + { + header: 'Options', + optionList: [ + { name: 'files', typeLabel: '{magenta {underline files}}', description: 'This is {red red}.'} + ] + }, + { + content: 'Project home: {underline https://github.com/me/example}' + } + ]); + +// command-list.js +sections = [ + { + header: 'Example App', + content: 'Generates something {italic very} important. This is a rather long, but ultimately inconsequential description intended solely to demonstrate description appearance. ' + }, + { + header: 'Synopsis', + content: '$ app ' + }, + { + header: 'Command List', + content: [ + { name: 'help', summary: 'Display help information about Git.' }, + { name: 'commit', summary: 'Record changes to the repository.' }, + { name: 'Version', summary: 'Print the version.' }, + { name: 'etc', summary: 'Etc.' } + ] + } + ]; +usage = getUsage(sections); + +// description-columns.js +sections = [ + { + header: 'Soviet Union', + content: { + options: { + columns: [ + { name: 'one', maxWidth: 40 }, + { name: 'two', width: 40, noWrap: true } + ] + }, + data: [ + { + one: "this was waaaay too long", + two: null + } + ] + } + }, + { + header: 'Synopsis', + content: [ + '$ example [{bold --timeout} {underline ms}] {bold --src} {underline file} ...', + '$ example {bold --help}' + ] + }, + { + header: 'Options', + optionList: optionDefinitions + } + ]; +getUsage(sections); + +// examples.js +sections = [ + { + header: 'A typical app', + content: 'Generates something {italic very} important.' + }, + { + header: 'Synopsis', + content: [ + '$ example [{bold --timeout} {underline ms}] {bold --src} {underline file} ...', + '$ example {bold --help}' + ] + }, + { + header: 'Options', + optionList: optionDefinitions + }, + { + header: 'Examples', + content: [ + { + desc: '1. A concise example. ', + example: '$ example -t 100 lib/*.js' + }, + { + desc: '2. A long example. ', + example: '$ example --timeout 100 --src lib/*.js' + }, + { + desc: '3. This example will scan space for unknown things. Take cure when scanning space, it could take some time. ', + example: '$ example --src galaxy1.facts galaxy1.facts galaxy2.facts galaxy3.facts galaxy4.facts galaxy5.facts' + } + ] + }, + { + content: 'Project home: {underline https://github.com/me/example}' + } + ]; +getUsage(sections); + +// footer.js +sections = [ + { + header: 'A typical app', + content: 'Generates something {italic very} important.' + }, + { + header: 'Synopsis', + content: [ + '$ example [{bold --timeout} {underline ms}] {bold --src} {underline file} ...', + '$ example {bold --help}' + ] + }, + { + header: 'Options', + optionList: optionDefinitions + }, + { + content: [ + '{italic This app was tested by dragons in Wales.}', + '', + null + ], + raw: true + } +]; +getUsage(sections); + +// groups.js +optionDefinitions = [ + { + name: 'help', + description: 'Display this usage guide.', + alias: 'h', + type: Boolean, + group: 'main' + }, + { + name: 'src', + description: 'The input files to process', + multiple: true, + defaultOption: true, + typeLabel: '{underline file} ...', + group: 'input' + }, + { + name: 'timeout', + description: 'Timeout value in ms', + alias: 't', + typeLabel: '{underline ms}', + group: 'main' + }, + { + name: 'plugin', + description: 'A plugin path', + type: String + } + ]; + +sections = [ + { + header: 'A typical app', + content: 'Generates something {italic very} important.' + }, + { + header: 'Main options', + optionList: optionDefinitions, + group: [ 'main', 'input' ] + }, + { + header: 'Misc', + optionList: optionDefinitions, + group: '_none' + } + ]; + +getUsage(sections); + +// header-only.js +sections = [ + { + header: 'a header only' + }, + { + content: 'content only' + } + ]; +getUsage(sections); + +// header.js +sections = [ + { + content: "", + raw: true + }, + { + header: 'Synopsis', + content: [ + '$ example [{bold --timeout} {underline ms}] {bold --src} {underline file} ...', + '$ example {bold --help}' + ] + } +]; +getUsage(sections); + +// hide.js +usage = getUsage([ + { + header: 'A typical app', + content: 'Generates something {italic very} important. This is a rather long, but ultimately inconsequential description intended solely to demonstrate description appearance. ' + }, + { + header: 'Options', + optionList: optionDefinitions, + hide: 'src' + }, + { + content: 'Project home: {underline https://github.com/me/example}' + } +]); + +// option-list-options.js +sections = [ + { + header: 'A typical app', + content: 'Generates something {italic very} important.' + }, + { + header: 'Options', + optionList: optionDefinitions, + tableOptions: { + columns: [ + { + name: 'option', + noWrap: true, + padding: { left: '🔥 ', right: '' }, + width: 30 + }, + { + name: 'description', + width: 50, + padding: { left: '', right: ' 🔥' } + } + ] + } + } +]; +getUsage(sections); + +// simple-reverse-name-order.js +usage = getUsage([ + { + header: 'A typical app', + content: 'Generates something {italic very} important. This is a rather long, but ultimately inconsequential description intended solely to demonstrate description appearance. ' + }, + { + header: 'Options', + optionList: optionDefinitions, + reverseNameOrder: true + }, + { + content: 'Project home: {underline https://github.com/me/example}' + } + ]); + +// simple-width.js +usage = getUsage([ + { + header: 'A typical app', + content: { + options: { maxWidth: 40 }, + data: [ + { col: 'Generates something {italic very} important. This is a rather long, but ultimately inconsequential description intended solely to demonstrate description appearance. ' } + ] + } + } + ]); + +// synopsis.js +sections = [ + { + header: 'A typical app', + content: 'Generates something {italic very} important.' + }, + { + header: 'Options', + optionList: [ + { + name: 'input', + typeLabel: '{underline file}', + description: 'The input to process.' + }, + { + name: 'help', + description: 'Print this usage guide.' + } + ] + } + ]; +usage = getUsage(sections); + +// whitespace.js +/* When using default options, the whitespace before the bullets is trimmed */ +sections = [ + { + header: 'Example app', + content: [ + 'Generates something {italic very} important. This description is:', + '', + ' • rather long', + ' • inconsequential', + ' • demonstrative', + '', + 'And the text continues underneath as this {cyan might} be required in cases where text is required underneath.' + ] + } + ]; +usage = getUsage(sections); +/* Solution 1: Use `raw` option and supply your own whitespace */ +sections = [ + { + header: 'Example app', + content: [ + ' Generates something {italic very} important. This description is:', + ' ', + ' • rather long', + ' • inconsequential', + ' • demonstrative', + ' ', + ' And the text continues underneath as this {cyan might} be required in cases where', + ' text is required underneath.' + ], + raw: true + } +]; +usage = getUsage(sections); + +/* Section 2: use separate sections with the `noTrim` option on the bullets */ +sections = [ + { + header: 'Example app', + content: [ + 'Generates something {italic very} important. This description is:' + ] + }, + { + content: { + options: { + noTrim: true + }, + data: [ + { col: ' • rather long' }, + { col: ' • inconsequential' }, + { col: ' • demonstrative' } + ] + } + }, + { + content: [ + 'And the text continues underneath as this {cyan might} be required in cases where text is required underneath.' + ] + } +]; +usage = getUsage(sections); diff --git a/types/command-line-usage/index.d.ts b/types/command-line-usage/index.d.ts index ac4f1d7606..0beb4ef2d8 100644 --- a/types/command-line-usage/index.d.ts +++ b/types/command-line-usage/index.d.ts @@ -1,48 +1,82 @@ // Type definitions for command-line-usage 5.0 // Project: https://github.com/75lb/command-line-usage#readme -// Definitions by: Andrija Dvorski +// Definitions by: matrumz +// Andrija Dvorski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 +/** + * Generates a usage guide suitable for a command-line app. + * @param sections One or more Section objects + * @alias module:command-line-usage + */ +declare function commandLineUsage(sections: commandLineUsage.Section | commandLineUsage.Section[]): string; +export = commandLineUsage; + declare namespace commandLineUsage { - interface Section { - list: string[]; + /** Section object. */ + type Section = Content | OptionList; - add(content: object): void; - emptyLine(): void; - header(text: string): void; - toString(): string; - } - - interface SectionData { - optionList?: OptionListData[]; - hide?: string[]; - group?: string[]; + /** A Content section comprises a header and one or more lines of content. */ + interface Content { + /** The section header, always bold and underlined. */ header?: string; - reverseNameOrder?: boolean; - tableOptions?: any; - } - - interface OptionListData extends SectionData { - name: string; - typeLabel?: string; - description?: string; - } - - interface ContentSectionData extends SectionData { - content: string; + /** + * Overloaded property, accepting data in one of four formats. + * 1. A single string (one line of text). + * 2. An array of strings (multiple lines of text). + * 3. An array of objects (recordset-style data). In this case, the data will be rendered in table format. The property names of each object are not important, so long as they are + * consistent throughout the array. + * 4. An object with two properties - data and options. In this case, the data and options will be passed directly to the underlying table layout module for rendering. + */ + content?: string | string[] | any[] | { data: any; options: any }; + /** Set to true to avoid indentation and wrapping. Useful for banners. */ raw?: boolean; } - type CommandLineUsageInput = - SectionData - | SectionData[] - | OptionListData - | OptionListData[] - | ContentSectionData - | ContentSectionData[]; + /** Describes a command-line option. Additionally, if generating a usage guide with command-line-usage you could optionally add description and typeLabel properties to each definition. */ + interface OptionDefinition { + name: string; + /** + * The type value is a setter function (you receive the output from this), enabling you to be specific about the type and value received. + * + * The most common values used are String (the default), Number and Boolean but you can use a custom function. + */ + type?: any; + /** getopt-style short option names. Can be any single character (unicode included) except a digit or hyphen. */ + alias?: string; + /** Set this flag if the option takes a list of values. You will receive an array of values, each passed through the type function (if specified). */ + multiple?: boolean; + /** Identical to multiple but with greedy parsing disabled. */ + lazyMultiple?: boolean; + /** Any values unaccounted for by an option definition will be set on the defaultOption. This flag is typically set on the most commonly-used option to make for more concise usage. */ + defaultOption?: boolean; + /** An initial value for the option. */ + defaultValue?: any; + /** + * When your app has a large amount of options it makes sense to organise them in groups. + * + * There are two automatic groups: _all (contains all options) and _none (contains options without a group specified in their definition). + */ + group?: string | string[]; + /** A string describing the option. */ + description?: string; + /** A string to replace the default type string (e.g. ). It's often more useful to set a more descriptive type label, like , , , etc.. */ + typeLabel?: string; + } + + /** A OptionList section adds a table displaying details of the available options. */ + interface OptionList { + header?: string; + /** An array of option definition objects. */ + optionList?: OptionDefinition[]; + /** If specified, only options from this particular group will be printed. */ + group?: string | string[]; + /** The names of one of more option definitions to hide from the option list. */ + hide?: string | string[]; + /** If true, the option alias will be displayed after the name, i.e. --verbose, -v instead of -v, --verbose). */ + reverseNameOrder?: boolean; + /** An options object suitable for passing into table-layout. */ + tableOptions?: any; + } } - -declare function commandLineUsage(sections: commandLineUsage.CommandLineUsageInput): string | undefined | commandLineUsage.Section; - -export = commandLineUsage; From c5e4324520f3c3d4964387789cf144f9f70c45af Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Tue, 24 Apr 2018 16:46:15 -0700 Subject: [PATCH 0847/2153] [css-font-loading-module] Add missing FontFace properties (#25045) Based on full FontFace interface - https://drafts.csswg.org/css-font-loading/#fontface --- types/css-font-loading-module/css-font-loading-module-tests.ts | 2 ++ types/css-font-loading-module/index.d.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/types/css-font-loading-module/css-font-loading-module-tests.ts b/types/css-font-loading-module/css-font-loading-module-tests.ts index 52556a03a6..db894a5b57 100644 --- a/types/css-font-loading-module/css-font-loading-module-tests.ts +++ b/types/css-font-loading-module/css-font-loading-module-tests.ts @@ -6,6 +6,8 @@ font.load(); font.loaded.then((fontFace: FontFace) => { fontFace.status; fontFace.family; + fontFace.variationSettings; + fontFace.display; }, (fontFace: FontFace) => {}); const a: boolean = document.fonts.check("12px Example"); diff --git a/types/css-font-loading-module/index.d.ts b/types/css-font-loading-module/index.d.ts index 95d504f272..c710f2f653 100644 --- a/types/css-font-loading-module/index.d.ts +++ b/types/css-font-loading-module/index.d.ts @@ -49,6 +49,8 @@ declare global { unicodeRange: string; variant: string; featureSettings: string; + variationSettings: string; + display: string; readonly status: FontFaceLoadStatus; readonly loaded: Promise; } From 63f5ebe4516b14e769a03052f594838ac180f9ad Mon Sep 17 00:00:00 2001 From: restimel Date: Wed, 25 Apr 2018 01:55:20 +0200 Subject: [PATCH 0848/2153] ace: extend all core component with optionProvider. (#25058) The methods setOption, setOptions, getOption, and getOptions are available for all core ace components (editor, session, renderer): https://github.com/ajaxorg/ace/wiki/Configuring-Ace In commit 19fc8fa756b484511662028f48af923c24116b13, it was done only for editor. Now a dedicated OptionProvider interface is available and core components interface extends this new one. --- types/ace/index.d.ts | 49 +++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/types/ace/index.d.ts b/types/ace/index.d.ts index 1f7dd9752b..b1e013bea9 100644 --- a/types/ace/index.d.ts +++ b/types/ace/index.d.ts @@ -101,6 +101,29 @@ declare namespace AceAjax { transformAction(state: any, action: any, editor: any, session: any, param: any): any; } + export interface OptionProvider { + + /** + * Sets a Configuration Option + **/ + setOption(optionName: string, optionValue: any): void; + + /** + * Sets Configuration Options + **/ + setOptions(keyValueTuples: any): void; + + /** + * Get a Configuration Option + **/ + getOption(name: string):any; + + /** + * Get Configuration Options + **/ + getOptions():any; + } + //////////////// /// Ace //////////////// @@ -495,7 +518,7 @@ declare namespace AceAjax { * Stores all the data about [[Editor `Editor`]] state providing easy way to change editors state. * `EditSession` can be attached to only one [[Document `Document`]]. Same `Document` can be attached to several `EditSession`s. **/ - export interface IEditSession { + export interface IEditSession extends OptionProvider { selection: Selection; @@ -1074,7 +1097,7 @@ declare namespace AceAjax { * The `Editor` manages the [[EditSession]] (which manages [[Document]]s), as well as the [[VirtualRenderer]], which draws everything to the screen. * Event sessions dealing with the mouse and keyboard are bubbled up from `Document` to the `Editor`, which decides what to do with them. **/ - export interface Editor { + export interface Editor extends OptionProvider { on(ev: string, callback: (e: any) => any): void; @@ -1113,26 +1136,6 @@ declare namespace AceAjax { execCommand(command:string, args?: any): void; - /** - * Sets a Configuration Option - **/ - setOption(optionName: any, optionValue: any): void; - - /** - * Sets Configuration Options - **/ - setOptions(keyValueTuples: any): void; - - /** - * Get a Configuration Option - **/ - getOption(name: any):any; - - /** - * Get Configuration Options - **/ - getOptions():any; - /** * Get rid of console warning by setting this to Infinity **/ @@ -2692,7 +2695,7 @@ declare namespace AceAjax { /** * The class that is responsible for drawing everything you see on the screen! **/ - export interface VirtualRenderer { + export interface VirtualRenderer extends OptionProvider { scroller: any; From b273310927a9c545a893ec1cc37cf56c780641d3 Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Wed, 25 Apr 2018 02:00:51 +0200 Subject: [PATCH 0849/2153] react-native: small improvements (#25057) * Switch from var to const * import React instead of /// --- types/react-native/index.d.ts | 240 +++++++++++++++++----------------- 1 file changed, 120 insertions(+), 120 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 4fc6592c80..a76bdb6e4c 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -24,10 +24,10 @@ // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -/// - /// +import * as React from 'react'; + export type MeasureOnSuccessCallback = ( x: number, y: number, @@ -190,7 +190,7 @@ interface EventEmitter extends EventEmitterListener { * @throws {Error} When called not during an eventing cycle * * @example - * var subscription = emitter.addListenerMap({ + * const subscription = emitter.addListenerMap({ * someEvent: function(data, event) { * console.log(data); * emitter.removeCurrentListener(); @@ -4844,7 +4844,7 @@ export namespace StyleSheet { * * Example: * ``` - * var styles = StyleSheet.create({ + * const styles = StyleSheet.create({ * listItem: { * flex: 1, * fontSize: 16, @@ -4892,7 +4892,7 @@ export namespace StyleSheet { * constant size, because on different platforms and screen densities its * value may be calculated differently. */ - export var hairlineWidth: number; + export const hairlineWidth: number; interface AbsoluteFillStyle { position: "absolute"; @@ -4914,14 +4914,14 @@ export namespace StyleSheet { * }, * }); */ - export var absoluteFillObject: AbsoluteFillStyle; + export const absoluteFillObject: AbsoluteFillStyle; /** * A very common pattern is to create overlays with position absolute and zero positioning, * so `absoluteFill` can be used for convenience and to reduce duplication of these repeated * styles. */ - export var absoluteFill: RegisteredStyle; + export const absoluteFill: RegisteredStyle; } export interface RelayProfiler { @@ -5331,7 +5331,7 @@ export interface ScaledSize { * than caching the value (for example, using inline styles rather than * setting a value in a `StyleSheet`). * - * Example: `var {height, width} = Dimensions.get('window');` + * Example: `const {height, width} = Dimensions.get('window');` * * @param dim Name of dimension as defined when calling `set`. * @returns Value for the dimension. @@ -5348,7 +5348,7 @@ export interface Dimensions { * function on every render, rather than caching the value (for * example, using inline styles rather than setting a value in a * StyleSheet). - * Example: var {height, width} = Dimensions.get('window'); + * Example: const {height, width} = Dimensions.get('window'); @param dim Name of dimension as defined when calling set. @returns Value for the dimension. */ @@ -5921,7 +5921,7 @@ export interface ScrollViewProperties * * ); * ... - * var styles = StyleSheet.create({ + * const styles = StyleSheet.create({ * contentContainer: { * paddingVertical: 20 * } @@ -8015,7 +8015,7 @@ export namespace Animated { * Animates a value along a timed easing curve. The `Easing` module has tons * of pre-defined curves, or you can use your own function. */ - export var timing: (value: AnimatedValue | AnimatedValueXY, config: TimingAnimationConfig) => CompositeAnimation; + export const timing: (value: AnimatedValue | AnimatedValueXY, config: TimingAnimationConfig) => CompositeAnimation; interface TimingAnimationConfig extends AnimationConfig { toValue: number | AnimatedValue | { x: number; y: number } | AnimatedValueXY; @@ -8166,10 +8166,10 @@ export namespace Animated { * Animated variants of the basic native views. Accepts Animated.Value for * props and style. */ - export var View: any; - export var Image: any; - export var Text: any; - export var ScrollView: any; + export const View: any; + export const Image: any; + export const Text: any; + export const ScrollView: any; } // tslint:disable-next-line:interface-name @@ -8435,278 +8435,278 @@ export interface KeyboardStatic extends NativeEventEmitter { // TODO: The following components need to be added // - [ ] ART -export var ART: ARTStatic; +export const ART: ARTStatic; export type ART = ARTStatic; -export var ActivityIndicator: ActivityIndicatorStatic; +export const ActivityIndicator: ActivityIndicatorStatic; export type ActivityIndicator = ActivityIndicatorStatic; -export var ActivityIndicatorIOS: ActivityIndicatorIOSStatic; +export const ActivityIndicatorIOS: ActivityIndicatorIOSStatic; export type ActivityIndicatorIOS = ActivityIndicatorIOSStatic; -export var DatePickerIOS: DatePickerIOSStatic; +export const DatePickerIOS: DatePickerIOSStatic; export type DatePickerIOS = DatePickerIOSStatic; -export var DrawerLayoutAndroid: DrawerLayoutAndroidStatic; +export const DrawerLayoutAndroid: DrawerLayoutAndroidStatic; export type DrawerLayoutAndroid = DrawerLayoutAndroidStatic; -export var Image: ImageStatic; +export const Image: ImageStatic; export type Image = ImageStatic; -export var ImageBackground: ImageBackgroundStatic; +export const ImageBackground: ImageBackgroundStatic; export type ImageBackground = ImageBackgroundStatic; -export var ImagePickerIOS: ImagePickerIOSStatic; +export const ImagePickerIOS: ImagePickerIOSStatic; export type ImagePickerIOS = ImagePickerIOSStatic; -export var InputAccessoryView: InputAccessoryViewStatic; +export const InputAccessoryView: InputAccessoryViewStatic; export type InputAccessoryView = InputAccessoryViewStatic; -export var FlatList: FlatListStatic; +export const FlatList: FlatListStatic; export type FlatList = FlatListStatic; -export var LayoutAnimation: LayoutAnimationStatic; +export const LayoutAnimation: LayoutAnimationStatic; export type LayoutAnimation = LayoutAnimationStatic; -export var ListView: ListViewStatic; +export const ListView: ListViewStatic; export type ListView = ListViewStatic; -export var MapView: MapViewStatic; +export const MapView: MapViewStatic; export type MapView = MapViewStatic; -export var MaskedViewIOS: MaskedViewStatic; +export const MaskedViewIOS: MaskedViewStatic; export type MaskedViewIOS = MaskedViewStatic; -export var Modal: ModalStatic; +export const Modal: ModalStatic; export type Modal = ModalStatic; -export var NavigatorIOS: NavigatorIOSStatic; +export const NavigatorIOS: NavigatorIOSStatic; export type NavigatorIOS = NavigatorIOSStatic; -export var Picker: PickerStatic; +export const Picker: PickerStatic; export type Picker = PickerStatic; -export var PickerIOS: PickerIOSStatic; +export const PickerIOS: PickerIOSStatic; export type PickerIOS = PickerIOSStatic; -export var ProgressBarAndroid: ProgressBarAndroidStatic; +export const ProgressBarAndroid: ProgressBarAndroidStatic; export type ProgressBarAndroid = ProgressBarAndroidStatic; -export var ProgressViewIOS: ProgressViewIOSStatic; +export const ProgressViewIOS: ProgressViewIOSStatic; export type ProgressViewIOS = ProgressViewIOSStatic; -export var RefreshControl: RefreshControlStatic; +export const RefreshControl: RefreshControlStatic; export type RefreshControl = RefreshControlStatic; -export var RecyclerViewBackedScrollView: RecyclerViewBackedScrollViewStatic; +export const RecyclerViewBackedScrollView: RecyclerViewBackedScrollViewStatic; export type RecyclerViewBackedScrollView = RecyclerViewBackedScrollViewStatic; -export var SafeAreaView: SafeAreaViewStatic; +export const SafeAreaView: SafeAreaViewStatic; export type SafeAreaView = SafeAreaViewStatic; -export var SegmentedControlIOS: SegmentedControlIOSStatic; +export const SegmentedControlIOS: SegmentedControlIOSStatic; export type SegmentedControlIOS = SegmentedControlIOSStatic; -export var Slider: SliderStatic; +export const Slider: SliderStatic; export type Slider = SliderStatic; -export var SliderIOS: SliderStatic; +export const SliderIOS: SliderStatic; export type SliderIOS = SliderStatic; -export var StatusBar: StatusBarStatic; +export const StatusBar: StatusBarStatic; export type StatusBar = StatusBarStatic; -export var ScrollView: ScrollViewStatic; +export const ScrollView: ScrollViewStatic; export type ScrollView = ScrollViewStatic; -export var SectionList: SectionListStatic; +export const SectionList: SectionListStatic; export type SectionList = SectionListStatic; -export var SnapshotViewIOS: SnapshotViewIOSStatic; +export const SnapshotViewIOS: SnapshotViewIOSStatic; export type SnapshotViewIOS = SnapshotViewIOSStatic; -export var Systrace: SystraceStatic; +export const Systrace: SystraceStatic; export type Systrace = SystraceStatic; -export var SwipeableListView: SwipeableListViewStatic; +export const SwipeableListView: SwipeableListViewStatic; export type SwipeableListView = SwipeableListViewStatic; -export var Switch: SwitchStatic; +export const Switch: SwitchStatic; export type Switch = SwitchStatic; -export var SwitchIOS: SwitchIOSStatic; +export const SwitchIOS: SwitchIOSStatic; export type SwitchIOS = SwitchIOSStatic; -export var TabBarIOS: TabBarIOSStatic; +export const TabBarIOS: TabBarIOSStatic; export type TabBarIOS = TabBarIOSStatic; -export var Text: TextStatic; +export const Text: TextStatic; export type Text = TextStatic; -export var TextInput: TextInputStatic; +export const TextInput: TextInputStatic; export type TextInput = TextInputStatic; -export var ToolbarAndroid: ToolbarAndroidStatic; +export const ToolbarAndroid: ToolbarAndroidStatic; export type ToolbarAndroid = ToolbarAndroidStatic; -export var TouchableHighlight: TouchableHighlightStatic; +export const TouchableHighlight: TouchableHighlightStatic; export type TouchableHighlight = TouchableHighlightStatic; -export var TouchableNativeFeedback: TouchableNativeFeedbackStatic; +export const TouchableNativeFeedback: TouchableNativeFeedbackStatic; export type TouchableNativeFeedback = TouchableNativeFeedbackStatic; -export var TouchableOpacity: TouchableOpacityStatic; +export const TouchableOpacity: TouchableOpacityStatic; export type TouchableOpacity = TouchableOpacityStatic; -export var TouchableWithoutFeedback: TouchableWithoutFeedbackStatic; +export const TouchableWithoutFeedback: TouchableWithoutFeedbackStatic; export type TouchableWithoutFeedback = TouchableWithoutFeedbackStatic; -export var View: ViewStatic; +export const View: ViewStatic; export type View = ViewStatic; -export var ViewPagerAndroid: ViewPagerAndroidStatic; +export const ViewPagerAndroid: ViewPagerAndroidStatic; export type ViewPagerAndroid = ViewPagerAndroidStatic; -export var WebView: WebViewStatic; +export const WebView: WebViewStatic; export type WebView = WebViewStatic; //////////// APIS ////////////// -export var ActionSheetIOS: ActionSheetIOSStatic; +export const ActionSheetIOS: ActionSheetIOSStatic; export type ActionSheetIOS = ActionSheetIOSStatic; -export var Share: ShareStatic; +export const Share: ShareStatic; export type Share = ShareStatic; -export var AdSupportIOS: AdSupportIOSStatic; +export const AdSupportIOS: AdSupportIOSStatic; export type AdSupportIOS = AdSupportIOSStatic; -export var AccessibilityInfo: AccessibilityInfoStatic; +export const AccessibilityInfo: AccessibilityInfoStatic; export type AccessibilityInfo = AccessibilityInfoStatic; -export var Alert: AlertStatic; +export const Alert: AlertStatic; export type Alert = AlertStatic; -export var AlertAndroid: AlertAndroidStatic; +export const AlertAndroid: AlertAndroidStatic; export type AlertAndroid = AlertAndroidStatic; -export var AlertIOS: AlertIOSStatic; +export const AlertIOS: AlertIOSStatic; export type AlertIOS = AlertIOSStatic; -export var AppState: AppStateStatic; +export const AppState: AppStateStatic; export type AppState = AppStateStatic; -export var AppStateIOS: AppStateStatic; +export const AppStateIOS: AppStateStatic; export type AppStateIOS = AppStateStatic; -export var AsyncStorage: AsyncStorageStatic; +export const AsyncStorage: AsyncStorageStatic; export type AsyncStorage = AsyncStorageStatic; -export var BackAndroid: BackAndroidStatic; +export const BackAndroid: BackAndroidStatic; export type BackAndroid = BackAndroidStatic; -export var BackHandler: BackHandlerStatic; +export const BackHandler: BackHandlerStatic; export type BackHandler = BackHandlerStatic; -export var Button: ButtonStatic; +export const Button: ButtonStatic; export type Button = ButtonStatic; -export var CameraRoll: CameraRollStatic; +export const CameraRoll: CameraRollStatic; export type CameraRoll = CameraRollStatic; -export var Clipboard: ClipboardStatic; +export const Clipboard: ClipboardStatic; export type Clipboard = ClipboardStatic; -export var DatePickerAndroid: DatePickerAndroidStatic; +export const DatePickerAndroid: DatePickerAndroidStatic; export type DatePickerAndroid = DatePickerAndroidStatic; -export var Geolocation: GeolocationStatic; +export const Geolocation: GeolocationStatic; export type Geolocation = GeolocationStatic; /** http://facebook.github.io/react-native/blog/2016/08/19/right-to-left-support-for-react-native-apps.html */ -export var I18nManager: I18nManagerStatic; +export const I18nManager: I18nManagerStatic; export type I18nManager = I18nManagerStatic; -export var ImageEditor: ImageEditorStatic; +export const ImageEditor: ImageEditorStatic; export type ImageEditor = ImageEditorStatic; -export var ImageStore: ImageStoreStatic; +export const ImageStore: ImageStoreStatic; export type ImageStore = ImageStoreStatic; -export var InteractionManager: InteractionManagerStatic; +export const InteractionManager: InteractionManagerStatic; -export var IntentAndroid: IntentAndroidStatic; +export const IntentAndroid: IntentAndroidStatic; export type IntentAndroid = IntentAndroidStatic; -export var Keyboard: KeyboardStatic; +export const Keyboard: KeyboardStatic; -export var KeyboardAvoidingView: KeyboardAvoidingViewStatic; +export const KeyboardAvoidingView: KeyboardAvoidingViewStatic; export type KeyboardAvoidingView = KeyboardAvoidingViewStatic; -export var Linking: LinkingStatic; +export const Linking: LinkingStatic; export type Linking = LinkingStatic; -export var LinkingIOS: LinkingIOSStatic; +export const LinkingIOS: LinkingIOSStatic; export type LinkingIOS = LinkingIOSStatic; -export var NativeMethodsMixin: NativeMethodsMixinStatic; +export const NativeMethodsMixin: NativeMethodsMixinStatic; export type NativeMethodsMixin = NativeMethodsMixinStatic; -export var NativeComponent: NativeMethodsMixinStatic; +export const NativeComponent: NativeMethodsMixinStatic; export type NativeComponent = NativeMethodsMixinStatic; -export var NetInfo: NetInfoStatic; +export const NetInfo: NetInfoStatic; export type NetInfo = NetInfoStatic; -export var PanResponder: PanResponderStatic; +export const PanResponder: PanResponderStatic; export type PanResponder = PanResponderStatic; -export var PermissionsAndroid: PermissionsAndroidStatic; +export const PermissionsAndroid: PermissionsAndroidStatic; export type PermissionsAndroid = PermissionsAndroidStatic; -export var PushNotificationIOS: PushNotificationIOSStatic; +export const PushNotificationIOS: PushNotificationIOSStatic; export type PushNotificationIOS = PushNotificationIOSStatic; -export var Settings: SettingsStatic; +export const Settings: SettingsStatic; export type Settings = SettingsStatic; -export var StatusBarIOS: StatusBarIOSStatic; +export const StatusBarIOS: StatusBarIOSStatic; export type StatusBarIOS = StatusBarIOSStatic; -export var TimePickerAndroid: TimePickerAndroidStatic; +export const TimePickerAndroid: TimePickerAndroidStatic; export type TimePickerAndroid = TimePickerAndroidStatic; -export var ToastAndroid: ToastAndroidStatic; +export const ToastAndroid: ToastAndroidStatic; export type ToastAndroid = ToastAndroidStatic; -export var UIManager: UIManagerStatic; +export const UIManager: UIManagerStatic; export type UIManager = UIManagerStatic; -export var VibrationIOS: VibrationIOSStatic; +export const VibrationIOS: VibrationIOSStatic; export type VibrationIOS = VibrationIOSStatic; -export var Vibration: VibrationStatic; +export const Vibration: VibrationStatic; export type Vibration = VibrationStatic; -export var Dimensions: Dimensions; -export var ShadowPropTypesIOS: ShadowPropTypesIOSStatic; +export const Dimensions: Dimensions; +export const ShadowPropTypesIOS: ShadowPropTypesIOSStatic; export type Easing = EasingStatic; -export var Easing: EasingStatic; +export const Easing: EasingStatic; //////////// Plugins ////////////// -export var DeviceEventEmitter: DeviceEventEmitterStatic; +export const DeviceEventEmitter: DeviceEventEmitterStatic; /** * Abstract base class for implementing event-emitting modules. This implements * a subset of the standard EventEmitter node module API. */ export interface NativeEventEmitter extends EventEmitter {} -export var NativeEventEmitter: NativeEventEmitter; +export const NativeEventEmitter: NativeEventEmitter; /** * Deprecated - subclass NativeEventEmitter to create granular event modules instead of * adding all event listeners directly to RCTNativeAppEventEmitter. */ -export var NativeAppEventEmitter: RCTNativeAppEventEmitter; +export const NativeAppEventEmitter: RCTNativeAppEventEmitter; /** * Interface for NativeModules which allows to augment NativeModules with type informations. @@ -8723,10 +8723,10 @@ interface NativeModulesStatic { * Use: * const MyModule = NativeModules.ModuleName */ -export var NativeModules: NativeModulesStatic; -export var Platform: PlatformStatic; -export var PlatformIOS: PlatformIOSStatic; -export var PixelRatio: PixelRatioStatic; +export const NativeModules: NativeModulesStatic; +export const Platform: PlatformStatic; +export const PlatformIOS: PlatformIOSStatic; +export const PixelRatio: PixelRatioStatic; export interface ComponentInterface

{ name?: string; @@ -8789,17 +8789,17 @@ export namespace addons { markTestCompleted: () => void; } - export var TestModule: TestModuleStatic; + export const TestModule: TestModuleStatic; export type TestModule = TestModuleStatic; } // // Prop Types // -export var ColorPropType: React.Requireable; -export var EdgeInsetsPropType: React.Requireable; -export var PointPropType: React.Requireable; -export var ViewPropTypes: React.Requireable; +export const ColorPropType: React.Requireable; +export const EdgeInsetsPropType: React.Requireable; +export const PointPropType: React.Requireable; +export const ViewPropTypes: React.Requireable; declare global { function require(name: string): any; @@ -8820,7 +8820,7 @@ declare global { ignoredYellowBox: string[]; } - var console: Console; + const console: Console; /** * Navigator object for accessing location API @@ -8831,7 +8831,7 @@ declare global { readonly geolocation: Geolocation; } - var navigator: Navigator; + const navigator: Navigator; /** * This contains the non-native `XMLHttpRequest` object, which you can use if you want to route network requests @@ -8841,15 +8841,15 @@ declare global { * * @see https://github.com/facebook/react-native/issues/934 */ - var originalXMLHttpRequest: any; + const originalXMLHttpRequest: any; - var __BUNDLE_START_TIME__: number; - var ErrorUtils: ErrorUtils; + const __BUNDLE_START_TIME__: number; + const ErrorUtils: ErrorUtils; /** * This variable is set to true when react-native is running in Dev mode * Typical usage: * if (__DEV__) console.log('Running in dev mode') */ - var __DEV__: boolean; + const __DEV__: boolean; } From f958ca566907eb698d829ec3c659209b089ef6a2 Mon Sep 17 00:00:00 2001 From: Fabio Berta Date: Wed, 25 Apr 2018 02:02:02 +0200 Subject: [PATCH 0850/2153] add proper default export (#25071) --- types/react-map-gl/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/react-map-gl/index.d.ts b/types/react-map-gl/index.d.ts index e0e78c6e75..9dd7584f5f 100644 --- a/types/react-map-gl/index.d.ts +++ b/types/react-map-gl/index.d.ts @@ -221,6 +221,8 @@ export class InteractiveMap extends React.Component { queryRenderedFeatures(geometry?: MapboxGL.PointLike | MapboxGL.PointLike[], parameters?: QueryRenderedFeaturesParams): Array>; } +export default InteractiveMap; + /** * * React Map Overlays From 48e4b600943f96b52b419af7c262117a2bbf3f04 Mon Sep 17 00:00:00 2001 From: Omar Diab Date: Tue, 24 Apr 2018 20:03:16 -0400 Subject: [PATCH 0851/2153] React intl JSX.Element values (#25074) * allow formatted message children to be a JSX Element * tests for JSX.Element children * lint --- types/react-intl/index.d.ts | 2 +- types/react-intl/react-intl-tests.tsx | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/types/react-intl/index.d.ts b/types/react-intl/index.d.ts index c6a06d39aa..d33b014e36 100644 --- a/types/react-intl/index.d.ts +++ b/types/react-intl/index.d.ts @@ -142,7 +142,7 @@ declare namespace ReactIntl { interface Props extends MessageDescriptor { values?: {[key: string]: MessageValue | JSX.Element}; tagName?: string; - children?: (...formattedMessage: string[]) => React.ReactNode; + children?: (...formattedMessage: Array) => React.ReactNode; } } class FormattedMessage extends React.Component { } diff --git a/types/react-intl/react-intl-tests.tsx b/types/react-intl/react-intl-tests.tsx index 51d5065fe3..2ed6eb0d98 100644 --- a/types/react-intl/react-intl-tests.tsx +++ b/types/react-intl/react-intl-tests.tsx @@ -154,7 +154,7 @@ class SomeComponent extends React.Component - {(text) => } + {(text) => }

    {text.map(t =>
  • {t}
  • )}
} + + + + ), + terms_of_service: ( + + + + ) + }} + > + {(...messages) => messages.map(message => <>{message})} + + Date: Wed, 25 Apr 2018 02:06:44 +0200 Subject: [PATCH 0852/2153] Added type definitions for Chai UUID (#25227) * Added types for Chai UUID * Fixed the test file * Removed the message parameter because it's not implemented in the plugin * Removed an empty namespace as it was unnecessary --- types/chai-uuid/chai-uuid-tests.ts | 15 +++++++++++++++ types/chai-uuid/index.d.ts | 27 +++++++++++++++++++++++++++ types/chai-uuid/tsconfig.json | 23 +++++++++++++++++++++++ types/chai-uuid/tslint.json | 1 + 4 files changed, 66 insertions(+) create mode 100644 types/chai-uuid/chai-uuid-tests.ts create mode 100644 types/chai-uuid/index.d.ts create mode 100644 types/chai-uuid/tsconfig.json create mode 100644 types/chai-uuid/tslint.json diff --git a/types/chai-uuid/chai-uuid-tests.ts b/types/chai-uuid/chai-uuid-tests.ts new file mode 100644 index 0000000000..0620464988 --- /dev/null +++ b/types/chai-uuid/chai-uuid-tests.ts @@ -0,0 +1,15 @@ +import { assert, expect, use, should } from 'chai'; +import chaiUuid = require('chai-uuid'); + +use(chaiUuid); +should(); + +// bdd style +expect('67cb8aa1-61bb-4b9b-8ca9-9dc0b278d5f7').to.be.uuid('v4'); +expect('67cb8aa1-61bb-4b9b-8ca9-9dc0b278d5f7').to.be.guid; +expect('invalid').to.not.be.uuid('v4'); +expect('invalid').to.not.be.guid(); + +// tdd style +assert.uuid('67cb8aa1-61bb-4b9b-8ca9-9dc0b278d5f7', 'v4'); +assert.guid('67cb8aa1-61bb-4b9b-8ca9-9dc0b278d5f7'); diff --git a/types/chai-uuid/index.d.ts b/types/chai-uuid/index.d.ts new file mode 100644 index 0000000000..23a0b6db92 --- /dev/null +++ b/types/chai-uuid/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for chai-uuid 1.0 +// Project: https://github.com/rfrench/chai-uuid +// Definitions by: Harm van der Werf +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// +/// + +declare global { + namespace Chai { + type UuidVersion = 'v1' | 'v2' | 'v3' | 'v4' | 'v5' | ''; + + interface Assertion extends LanguageChains, NumericComparison, TypeComparison { + uuid(uuid?: UuidVersion): void; + guid(guid?: any): void; + } + + interface Assert { + uuid(uuid: string, version?: UuidVersion): void; + guid(guid: string, version?: any): void; + } + } +} + +declare function chaiUuid(chai: any, utils: any): void; +export = chaiUuid; diff --git a/types/chai-uuid/tsconfig.json b/types/chai-uuid/tsconfig.json new file mode 100644 index 0000000000..ca2ca40071 --- /dev/null +++ b/types/chai-uuid/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "chai-uuid-tests.ts" + ] +} diff --git a/types/chai-uuid/tslint.json b/types/chai-uuid/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/chai-uuid/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 1efe02587a531ed9bc8abe07705494982f2d0b55 Mon Sep 17 00:00:00 2001 From: ryym Date: Wed, 25 Apr 2018 09:08:19 +0900 Subject: [PATCH 0853/2153] [react-redux] Update type definitions for redux@4.0.0 (#25109) --- types/react-redux/index.d.ts | 18 +++++----- types/react-redux/package.json | 2 +- types/react-redux/react-redux-tests.tsx | 46 ++++++++++++------------- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index 52cc28b9a5..bc16194f0c 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -26,15 +26,15 @@ type StatelessComponent

= React.StatelessComponent

; type Component

= React.ComponentType

; type ReactNode = React.ReactNode; type Store = Redux.Store; -type Dispatch = Redux.Dispatch; +type Dispatch = Redux.Dispatch; type ActionCreator = Redux.ActionCreator; // Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766 type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; type Omit = Pick>; -export interface DispatchProp { - dispatch?: Dispatch; +export interface DispatchProp { + dispatch?: Dispatch; } interface AdvancedComponentDecorator { @@ -76,11 +76,11 @@ export type InferableComponentEnhancer = * @param options */ export interface Connect { - (): InferableComponentEnhancer>; + (): InferableComponentEnhancer; ( mapStateToProps: MapStateToPropsParam - ): InferableComponentEnhancerWithProps & TOwnProps, TOwnProps>; + ): InferableComponentEnhancerWithProps; ( mapStateToProps: null | undefined, @@ -121,7 +121,7 @@ export interface Connect { mapDispatchToProps: null | undefined, mergeProps: null | undefined, options: Options - ): InferableComponentEnhancerWithProps & TStateProps, TOwnProps>; + ): InferableComponentEnhancerWithProps; ( mapStateToProps: null | undefined, @@ -161,14 +161,14 @@ interface MapStateToPropsFactory { type MapStateToPropsParam = MapStateToPropsFactory | MapStateToProps | null | undefined; interface MapDispatchToPropsFunction { - (dispatch: Dispatch, ownProps: TOwnProps): TDispatchProps; + (dispatch: Dispatch, ownProps: TOwnProps): TDispatchProps; } type MapDispatchToProps = MapDispatchToPropsFunction | TDispatchProps; interface MapDispatchToPropsFactory { - (dispatch: Dispatch, ownProps: TOwnProps): MapDispatchToProps; + (dispatch: Dispatch, ownProps: TOwnProps): MapDispatchToProps; } type MapDispatchToPropsParam = MapDispatchToPropsFactory | MapDispatchToProps; @@ -236,7 +236,7 @@ export declare function connectAdvanced { - (dispatch: Dispatch, factoryOptions: TFactoryOptions): Selector + (dispatch: Dispatch, factoryOptions: TFactoryOptions): Selector } export interface Selector { diff --git a/types/react-redux/package.json b/types/react-redux/package.json index 6d68bf2f9b..7f5b19d45b 100644 --- a/types/react-redux/package.json +++ b/types/react-redux/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "redux": "^3.6.0" + "redux": "^4.0.0" } } diff --git a/types/react-redux/react-redux-tests.tsx b/types/react-redux/react-redux-tests.tsx index 07b81ff082..367afedad6 100644 --- a/types/react-redux/react-redux-tests.tsx +++ b/types/react-redux/react-redux-tests.tsx @@ -1,7 +1,7 @@ import { Component, ReactElement } from 'react'; import * as React from 'react'; import * as ReactDOM from 'react-dom'; -import { Store, Dispatch, ActionCreator, createStore, bindActionCreators, ActionCreatorsMapObject } from 'redux'; +import { Store, Dispatch, AnyAction, ActionCreator, createStore, bindActionCreators, ActionCreatorsMapObject } from 'redux'; import { Connect, connect, createProvider, Provider, DispatchProp, MapStateToProps, Options } from 'react-redux'; import objectAssign = require('object-assign'); @@ -14,7 +14,7 @@ import objectAssign = require('object-assign'); // output of `connect` to make sure the signature is what is expected namespace Empty { - interface OwnProps { foo: string, dispatch: Dispatch } + interface OwnProps { foo: string, dispatch: Dispatch } class TestComponent extends Component {} @@ -42,7 +42,7 @@ namespace MapState { namespace MapStateWithDispatchProp { interface OwnProps { foo: string } - interface StateProps { bar: number, dispatch: Dispatch } + interface StateProps { bar: number, dispatch: Dispatch } class TestComponent extends Component {} @@ -250,7 +250,7 @@ namespace MapStateAndOptions { interface State { state: string; } interface OwnProps { foo: string } interface StateProps { bar: number } - interface DispatchProps { dispatch: Dispatch } + interface DispatchProps { dispatch: Dispatch } class TestComponent extends Component {} @@ -295,7 +295,7 @@ function mapStateToProps(state: CounterState) { } // Which action creators does it want to receive by props? -function mapDispatchToProps(dispatch: Dispatch) { +function mapDispatchToProps(dispatch: Dispatch) { return { onIncrement: () => dispatch(increment()) }; @@ -327,7 +327,7 @@ connect( // with higher order functions using parameters connect( (initialState: CounterState, ownProps) => mapStateToProps, - (dispatch: Dispatch, ownProps) => mapDispatchToProps + (dispatch: Dispatch, ownProps) => mapDispatchToProps )(Counter); // only first argument connect( @@ -415,7 +415,7 @@ ReactDOM.render( // Inject just dispatch and don't listen to store -const AppWrap = (props: DispatchProp & { children?: React.ReactNode }) =>

+const AppWrap = (props: DispatchProp & { children?: React.ReactNode }) =>
const WrappedApp = connect()(AppWrap); @@ -446,7 +446,7 @@ connect(mapStateToProps2, actionCreators)(TodoApp); // return { todos: state.todos }; //} -function mapDispatchToProps2(dispatch: Dispatch) { +function mapDispatchToProps2(dispatch: Dispatch) { return { actions: bindActionCreators(actionCreators, dispatch) }; } @@ -458,7 +458,7 @@ connect(mapStateToProps2, mapDispatchToProps2)(TodoApp); // return { todos: state.todos }; //} -function mapDispatchToProps3(dispatch: Dispatch) { +function mapDispatchToProps3(dispatch: Dispatch) { return bindActionCreators({ addTodo }, dispatch); } @@ -470,7 +470,7 @@ connect(mapStateToProps2, mapDispatchToProps3)(TodoApp); // return { todos: state.todos }; //} -function mapDispatchToProps4(dispatch: Dispatch) { +function mapDispatchToProps4(dispatch: Dispatch) { return { todoActions: bindActionCreators(todoActionCreators, dispatch), counterActions: bindActionCreators(counterActionCreators, dispatch) @@ -485,7 +485,7 @@ connect(mapStateToProps2, mapDispatchToProps4)(TodoApp); // return { todos: state.todos }; //} -function mapDispatchToProps5(dispatch: Dispatch) { +function mapDispatchToProps5(dispatch: Dispatch) { return { actions: bindActionCreators(objectAssign({}, todoActionCreators, counterActionCreators), dispatch) }; @@ -499,7 +499,7 @@ connect(mapStateToProps2, mapDispatchToProps5)(TodoApp); // return { todos: state.todos }; //} -function mapDispatchToProps6(dispatch: Dispatch) { +function mapDispatchToProps6(dispatch: Dispatch) { return bindActionCreators(objectAssign({}, todoActionCreators, counterActionCreators), dispatch); } @@ -541,7 +541,7 @@ interface TestState { isLoaded: boolean; state1: number; } -class TestComponent extends Component, TestState> { } +class TestComponent extends Component { } const WrappedTestComponent = connect()(TestComponent); // return value of the connect()(TestComponent) is of the type TestComponent @@ -559,7 +559,7 @@ class NonComponent {} // stateless functions interface HelloMessageProps { - dispatch: Dispatch + dispatch: Dispatch name: string; } const HelloMessage: React.StatelessComponent = (props) => { @@ -585,7 +585,7 @@ namespace TestStatelessFunctionWithMapArguments { }; }; - const mapDispatchToProps = (dispatch: Dispatch, ownProps: GreetingProps) => { + const mapDispatchToProps = (dispatch: Dispatch, ownProps: GreetingProps) => { return { onClick: () => { dispatch({ type: 'GREETING', name: ownProps.name }); @@ -609,7 +609,7 @@ namespace TestTOwnPropsInference { state: string; } - class OwnPropsComponent extends React.Component> { + class OwnPropsComponent extends React.Component { render() { return
; } @@ -647,7 +647,7 @@ namespace TestTOwnPropsInference { state: string } - class AllPropsComponent extends React.Component> { + class AllPropsComponent extends React.Component { render() { return
; } @@ -691,7 +691,7 @@ namespace TestMergedPropsInference { return { state: 'string' }; } - function mapDispatchToProps(dispatch: Dispatch): DispatchProps { + function mapDispatchToProps(dispatch: Dispatch): DispatchProps { return { dispatch: 'string' }; } @@ -729,7 +729,7 @@ namespace Issue16652 { comments: ({ id: string } | undefined)[]; } - class CommentList extends React.Component> {} + class CommentList extends React.Component {} const mapStateToProps = (state: any, ownProps: PassedProps): GeneratedStateProps => { return { @@ -748,7 +748,7 @@ namespace Issue15463 { interface ISpinnerProps{ showGlobalSpinner: boolean; } - class SpinnerClass extends React.Component, undefined> { + class SpinnerClass extends React.Component { render() { return (
); } @@ -766,7 +766,7 @@ namespace RemoveInjectedAndPassOnRest { showGlobalSpinner: boolean; foo: string; } - class SpinnerClass extends React.Component, {}> { + class SpinnerClass extends React.Component { render() { return (
); } @@ -877,8 +877,8 @@ namespace TestCreateProvider { }; interface State { a: number }; - const store = createStore(() => ({ a: 1 })); - const myStore = createStore(() => ({ a: 2 })); + const store = createStore(() => ({ a: 1 })); + const myStore = createStore(() => ({ a: 2 })); interface AProps { a: number }; const A = (props: AProps) => (

A is {props.a}

); From bd16c73705e98fd7f02caf223e058fae66119422 Mon Sep 17 00:00:00 2001 From: Alan Plum Date: Wed, 25 Apr 2018 02:09:25 +0200 Subject: [PATCH 0854/2153] [tea-merge] Remove attribution (#25223) * Remove attribution as per @mihhail-lapushkin's wishes * Update index.d.ts --- types/tea-merge/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/tea-merge/index.d.ts b/types/tea-merge/index.d.ts index 7aec947806..a799b04a8b 100644 --- a/types/tea-merge/index.d.ts +++ b/types/tea-merge/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for tea-merge // Project: https://github.com/qualiancy/tea-merge -// Definitions by: Mihhail Lapushkin +// Definitions by: No one // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 517765c944922ac5b70c5f7a5fa1b878d016e6e8 Mon Sep 17 00:00:00 2001 From: Marc Ghorayeb Date: Wed, 25 Apr 2018 02:11:08 +0200 Subject: [PATCH 0855/2153] feat(react-jsonschema-form): generic interfaces for better return types (#25103) --- types/react-jsonschema-form/index.d.ts | 67 +++++++++++++++++++------- 1 file changed, 49 insertions(+), 18 deletions(-) diff --git a/types/react-jsonschema-form/index.d.ts b/types/react-jsonschema-form/index.d.ts index dec2ad0509..5cce3d38c2 100644 --- a/types/react-jsonschema-form/index.d.ts +++ b/types/react-jsonschema-form/index.d.ts @@ -11,26 +11,26 @@ declare module "react-jsonschema-form" { import * as React from "react"; import { JSONSchema6 } from "json-schema"; - export interface FormProps { + export interface FormProps { schema: JSONSchema6; uiSchema?: UiSchema; - formData?: any; + formData?: T; formContext?: any; - widgets?: {[name: string]: Widget}; - fields?: {[name: string]: Field}; + widgets?: { [name: string]: Widget }; + fields?: { [name: string]: Field }; noValidate?: boolean; noHtml5Validate?: boolean; showErrorList?: boolean; - validate?: (formData: any, errors: any) => any; - onChange?: (e: IChangeEvent) => any; + validate?: (formData: T, errors: FormValidation) => FormValidation; + onChange?: (e: IChangeEvent) => any; onError?: (e: any) => any; - onSubmit?: (e: any) => any; + onSubmit?: (e: ISubmitEvent) => any; liveValidate?: boolean; FieldTemplate?: React.StatelessComponent; ArrayFieldTemplate?: React.StatelessComponent; ObjectFieldTemplate?: React.StatelessComponent; safeRenderCompletion?: boolean; - transformErrors?: (errors: any) => any; + transformErrors?: (errors: AjvError[]) => AjvError[]; // HTML Attributes id?: string; @@ -44,7 +44,7 @@ declare module "react-jsonschema-form" { acceptcharset?: string; } - export default class Form extends React.Component { } + export default class Form extends React.Component> { } export type UiSchema = { 'ui:field'?: Field | string; @@ -54,9 +54,13 @@ declare module "react-jsonschema-form" { [name: string]: any; }; - export type IdSchema = { + export type FieldId = { $id: string; - }; + } + + export type IdSchema = FieldId & { + [key: string]: FieldId; + } export interface WidgetProps extends React.HTMLAttributes { id: string; @@ -81,8 +85,8 @@ declare module "react-jsonschema-form" { errorSchema: object; onChange: (value: any) => void; registry: { - fields: {[name: string]: Field}; - widgets: {[name: string]: Widget}; + fields: { [name: string]: Field }; + widgets: { [name: string]: Widget }; definitions: object; formContext: any; }; @@ -168,12 +172,39 @@ declare module "react-jsonschema-form" { formContext: any; } - export interface IChangeEvent { + export interface IChangeEvent { edit: boolean; - formData: any; - errors: any[]; - errorSchema: any; + formData: T; + errors: { stack: string }[]; + errorSchema: FormValidation; idSchema: IdSchema; - status: string; + schema: JSONSchema6; + uiSchema: UiSchema; + status?: string; + } + + export type ISubmitEvent = IChangeEvent; + + export type AjvError = { + message: string; + name: string; + params: any; + property: string; + stack: string; + } + + export type FieldError = string + + type FieldValidation = { + __errors: FieldError[]; + addError: (message: string) => void; + } + + type FormValidation = FieldValidation & { + [fieldName: string]: FieldValidation; + } + + type FormSubmit = { + formData: T; } } From 8c831011f24da5c89650dd8a2c655f08b4bfbc3a Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Wed, 25 Apr 2018 02:12:55 +0200 Subject: [PATCH 0856/2153] Added type definitions for url-params (#25226) * Added type definitions for url-params * add test file * fix naming * fix naming --- types/url-params/index.d.ts | 11 +++++++++++ types/url-params/tsconfig.json | 23 +++++++++++++++++++++++ types/url-params/tslint.json | 1 + types/url-params/url-params-tests.ts | 5 +++++ 4 files changed, 40 insertions(+) create mode 100644 types/url-params/index.d.ts create mode 100644 types/url-params/tsconfig.json create mode 100644 types/url-params/tslint.json create mode 100644 types/url-params/url-params-tests.ts diff --git a/types/url-params/index.d.ts b/types/url-params/index.d.ts new file mode 100644 index 0000000000..bfe7ea6668 --- /dev/null +++ b/types/url-params/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for url-params 1.0 +// Project: https://github.com/AtenDesignGroup/url-params +// Definitions by: Daniel Sogl +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export function add(oldUrl: string, param: string, value: any): string; + +export function createUrlObject(oldUrl: string): any; + +export function remove(oldUrl: string, param: string, value: any): string; + +export function set(oldUrl: string, param: string, value: any): string; diff --git a/types/url-params/tsconfig.json b/types/url-params/tsconfig.json new file mode 100644 index 0000000000..82f6539e78 --- /dev/null +++ b/types/url-params/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "url-params-tests.ts" + ] +} \ No newline at end of file diff --git a/types/url-params/tslint.json b/types/url-params/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/url-params/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/url-params/url-params-tests.ts b/types/url-params/url-params-tests.ts new file mode 100644 index 0000000000..ac8fe828c2 --- /dev/null +++ b/types/url-params/url-params-tests.ts @@ -0,0 +1,5 @@ +import { add, remove, set } from 'url-params'; + +const url1 = add('http://www.example.com/?foo=2+3+6&baz=6', 'foo', 4); +const url2 = remove('http://www.example.com/?foo=2+3+6&baz=6', 'foo', 3); +const url3 = set('http://www.example.com/?foo=2+3+6&baz=6', 'foo', 3); From 248e3140ec8a8f083d50e4a0871f7411ac0ba837 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Wed, 25 Apr 2018 02:15:06 +0200 Subject: [PATCH 0857/2153] Added type definitions for apicache (#25225) * Added type definitions for apicache * Added type definitions for apicache * Update index.d.ts * Update index.d.ts * fix lint * refactor lint rules * fix lint * add test file --- types/apicache/apicache-tests.ts | 17 +++++++ types/apicache/index.d.ts | 77 ++++++++++++++++++++++++++++++++ types/apicache/tsconfig.json | 16 +++++++ types/apicache/tslint.json | 1 + 4 files changed, 111 insertions(+) create mode 100644 types/apicache/apicache-tests.ts create mode 100644 types/apicache/index.d.ts create mode 100644 types/apicache/tsconfig.json create mode 100644 types/apicache/tslint.json diff --git a/types/apicache/apicache-tests.ts b/types/apicache/apicache-tests.ts new file mode 100644 index 0000000000..1f9eb98dda --- /dev/null +++ b/types/apicache/apicache-tests.ts @@ -0,0 +1,17 @@ +import { middleware, newInstance, options } from 'apicache'; + +let cache = middleware; + +options({ + statusCodes: { + exclude: [404, 429, 500], + include: [200, 304] + } +}); + +cache = newInstance({ + statusCodes: { + exclude: [404, 429, 500], + include: [200, 304] + } +}); diff --git a/types/apicache/index.d.ts b/types/apicache/index.d.ts new file mode 100644 index 0000000000..b62fd7356d --- /dev/null +++ b/types/apicache/index.d.ts @@ -0,0 +1,77 @@ +// Type definitions for apicache 1.2 +// Project: https://github.com/kwhitley/apicache +// Definitions by: Daniel Sogl +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { RedisClient } from 'redis'; + +export const id: number; + +/** + * clears cache target (key or group), or entire cache if no value passed, returns new index. + */ +export function clear(target: string | any[]): any; + +/** used to create a new ApiCache instance with the same options as the current one */ +export function clone(): any; + +export function getDuration(duration: string): any; + +/** + * returns current cache index [of keys] + */ +export function getIndex(): any; + +/** + * the actual middleware that will be used in your routes. duration is in the following format + * "[length] [unit]", as in "10 minutes" or "1 day". A second param is a middleware toggle function, + * accepting request and response params, and must return truthy to enable cache for the request. + * Third param is the options that will override global ones and affect this middleware only. + */ +export function middleware( + duration?: string, + toggleMiddleware?: any, + localOptions?: Options +): any; + +/** + * used to create a new ApiCache instance (by default, simply requiring this library shares a common instance) + */ +export function newInstance(config: Options): any; + +/** + * getter/setter for global options. If used as a setter, this function is + * chainable, allowing you to do things such as... say... return the middleware. + */ +export function options(options: Options): any; + +export function resetIndex(): void; + +export interface Options { + /** if true, enables console output */ + debug?: boolean; + /** should be either a number (in ms) or a string, defaults to 1 hour */ + defaultDuration?: string; + /** if false, turns off caching globally (useful on dev) */ + enabled?: boolean; + /** + * if provided, uses the [node-redis](https://github.com/NodeRedis/node_redis) client instead of [memory-cache](https://github.com/ptarjan/node-cache) + */ + redisClient?: RedisClient; + /** appendKey takes the req/res objects and returns a custom value to extend the cache key */ + appendKey?: any; + /** list of headers that should never be cached */ + headerBlacklist?: string[]; + statusCodes?: { + /** list status codes to specifically exclude (e.g. [404, 403] cache all responses unless they had a 404 or 403 status) */ + exclude?: number[]; + /** list status codes to require (e.g. [200] caches ONLY responses with a success/200 code) */ + include?: number[]; + }; + /** + * 'cache-control': 'no-cache' // example of header overwrite + */ + headers?: { + [key: string]: string; + }; +} diff --git a/types/apicache/tsconfig.json b/types/apicache/tsconfig.json new file mode 100644 index 0000000000..9ae5f1f827 --- /dev/null +++ b/types/apicache/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "apicache-tests.ts"] +} diff --git a/types/apicache/tslint.json b/types/apicache/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/apicache/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file From 0823873176ed91e0af883ec854a37fb98e1a1a2b Mon Sep 17 00:00:00 2001 From: Mathias Paumgarten Date: Tue, 24 Apr 2018 17:17:17 -0700 Subject: [PATCH 0858/2153] Adds types for gl-shader (#25200) * init gl-shader types * adds tests * fixes file name * adds additional signature * fixes definitions url --- types/gl-shader/gl-shader-tests.ts | 41 ++++++++++++++++++++++++ types/gl-shader/index.d.ts | 51 ++++++++++++++++++++++++++++++ types/gl-shader/tsconfig.json | 24 ++++++++++++++ types/gl-shader/tslint.json | 3 ++ 4 files changed, 119 insertions(+) create mode 100644 types/gl-shader/gl-shader-tests.ts create mode 100644 types/gl-shader/index.d.ts create mode 100644 types/gl-shader/tsconfig.json create mode 100644 types/gl-shader/tslint.json diff --git a/types/gl-shader/gl-shader-tests.ts b/types/gl-shader/gl-shader-tests.ts new file mode 100644 index 0000000000..ad42dd2507 --- /dev/null +++ b/types/gl-shader/gl-shader-tests.ts @@ -0,0 +1,41 @@ +import createShader = require("gl-shader"); + +const gl = new WebGLRenderingContext(); + +let shader = createShader(gl, "", ""); + +shader = createShader(gl, "", "", []); +shader = createShader(gl, "", "", [], []); +shader = createShader(gl, "", "", [{name: "foo", type: "bool"}]); +shader = createShader(gl, "", "", [{name: "foo", type: "bool"}, {name: "bar", type: "float"}]); +shader = createShader(gl, "", "", [{name: "foo", type: "bool"}], [{name: "bar", type: "float"}]); + +shader = createShader(gl, {vertex: "", fragment: ""}); +shader = createShader(gl, {vertex: "", fragment: "", uniforms: [{name: "foo", type: "bool"}]}); +shader = createShader(gl, {vertex: "", fragment: "", uniforms: [{name: "foo", type: "bool"}]}); +shader = createShader(gl, { + vertex: "", + fragment: "", + uniforms: [{name: "foo", type: "bool"}], + attributes: [{name: "bar", type: "float"}] +}); + +shader.bind(); +shader.dispose(); +shader.update("", ""); +shader.update("", "", [{name: "foo", type: "bool"}]); +shader.update("", "", [{name: "foo", type: "bool"}], [{name: "foo", type: "bool"}]); + +shader.uniforms; +shader.uniforms.color; +shader.uniforms.color = 4; +shader.uniforms.color = [ 1, 0, 0, 0 ]; + +shader.uniforms = { + model: [ 1, 2, 3, 4 ], + foo: 13 +}; + +shader.attributes; +shader.attributes.position.length; +shader.attributes.position.pointer(); diff --git a/types/gl-shader/index.d.ts b/types/gl-shader/index.d.ts new file mode 100644 index 0000000000..3049516cca --- /dev/null +++ b/types/gl-shader/index.d.ts @@ -0,0 +1,51 @@ +// Type definitions for gl-shader 4.2 +// Project: https://github.com/stackgl/gl-shader +// Definitions by: Mathias Paumgarten +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +interface Parameter { + type: string; + name: string; +} + +interface Attribute { + location: number[] | number; + pointer(type?: number, normalized?: boolean, stride?: number, offset?: number): number; +} + +declare class Shader { + readonly gl: WebGLRenderingContext; + readonly program: WebGLProgram; + readonly vertShader: WebGLShader; + readonly fragShader: WebGLShader; + readonly attributes: {[key: string]: Attribute & any[]}; + + uniforms: {[key: string]: any}; + + constructor(gl: WebGLRenderingContext); + + bind(): void; + dispose(): void; + + update(vertex: string, fragment: string, uniforms?: Parameter[], attributes?: Parameter[]): void; + update(obj: {vertex: string, fragment: string, uniforms: Parameter[], attributes: Parameter[]}): void; +} + +declare function createShader( + gl: WebGLRenderingContext, + vertex: string, + fragment: string, + uniforms?: Parameter[], + attributes?: Parameter[]): Shader; + +declare function createShader( + gl: WebGLRenderingContext, + options: { + vertex: string, + fragment: string, + uniforms?: Parameter[], + attributes?: Parameter[], + }): Shader; + +export = createShader; diff --git a/types/gl-shader/tsconfig.json b/types/gl-shader/tsconfig.json new file mode 100644 index 0000000000..fefb7e0c4c --- /dev/null +++ b/types/gl-shader/tsconfig.json @@ -0,0 +1,24 @@ +{ + "files": [ + "index.d.ts", + "gl-shader-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/gl-shader/tslint.json b/types/gl-shader/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/gl-shader/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 211a5eb474e2ceadc1eadb1fc92ab4d13344a181 Mon Sep 17 00:00:00 2001 From: Jason Walton Date: Tue, 24 Apr 2018 20:18:28 -0400 Subject: [PATCH 0859/2153] [@types/body-parser] Fix so body-parser works with connect/vanilla node.js apps. (#25115) --- types/body-parser/body-parser-tests.ts | 16 ++++++++++++++++ types/body-parser/index.d.ts | 26 ++++++++++++++++---------- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/types/body-parser/body-parser-tests.ts b/types/body-parser/body-parser-tests.ts index 2f6a33ea72..89d905ead0 100644 --- a/types/body-parser/body-parser-tests.ts +++ b/types/body-parser/body-parser-tests.ts @@ -1,3 +1,4 @@ +import * as http from 'http'; import express = require('express'); import { json, @@ -13,6 +14,21 @@ app.use(raw()); app.use(text()); app.use(urlencoded()); +const jsonParser = app.use(json({ + inflate: true, + limit: '100kb', + type: 'application/*', + verify: ( + req: http.IncomingMessage, + res: http.ServerResponse, + buf: Buffer, + encoding: string + ) => { + return true; + } +})); +app.use(jsonParser); + // send any data, it should be parsed and printed app.all('/', (req, res, next) => { console.log(req.body); diff --git a/types/body-parser/index.d.ts b/types/body-parser/index.d.ts index b1485770a1..67774e2149 100644 --- a/types/body-parser/index.d.ts +++ b/types/body-parser/index.d.ts @@ -1,24 +1,30 @@ -// Type definitions for body-parser 1.16 +// Type definitions for body-parser 1.17 // Project: https://github.com/expressjs/body-parser -// Definitions by: Santi Albo , Vilic Vane , Jonathan Häberle , Gevik Babakhani , Tomasz Łaziuk +// Definitions by: Santi Albo +// Vilic Vane +// Jonathan Häberle +// Gevik Babakhani +// Tomasz Łaziuk +// Jason Walton // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 /// -import { Request, RequestHandler, Response } from 'express'; +import { NextHandleFunction } from 'connect'; +import * as http from 'http'; // for docs go to https://github.com/expressjs/body-parser/tree/1.16.0#body-parser // @deprecated -declare function bodyParser(options?: bodyParser.OptionsJson & bodyParser.OptionsText & bodyParser.OptionsUrlencoded): RequestHandler; +declare function bodyParser(options?: bodyParser.OptionsJson & bodyParser.OptionsText & bodyParser.OptionsUrlencoded): NextHandleFunction; declare namespace bodyParser { interface Options { inflate?: boolean; limit?: number | string; - type?: string | string[] | ((req: Request) => any); - verify?(req: Request, res: Response, buf: Buffer, encoding: string): void; + type?: string | string[] | ((req: http.IncomingMessage) => any); + verify?(req: http.IncomingMessage, res: http.ServerResponse, buf: Buffer, encoding: string): void; } interface OptionsJson extends Options { @@ -35,13 +41,13 @@ declare namespace bodyParser { parameterLimit?: number; } - function json(options?: OptionsJson): RequestHandler; + function json(options?: OptionsJson): NextHandleFunction; - function raw(options?: Options): RequestHandler; + function raw(options?: Options): NextHandleFunction; - function text(options?: OptionsText): RequestHandler; + function text(options?: OptionsText): NextHandleFunction; - function urlencoded(options?: OptionsUrlencoded): RequestHandler; + function urlencoded(options?: OptionsUrlencoded): NextHandleFunction; } export = bodyParser; From 8d87c67236a73febd08e7afa94cdcc02ae76d38b Mon Sep 17 00:00:00 2001 From: Su-Shing Chen Date: Wed, 25 Apr 2018 12:20:45 +1200 Subject: [PATCH 0860/2153] [@types/when] Fix when.js then() when TResult is a subtype of T (#25110) * Fix when.js then() when TResult is a subtype of T Change the order of .then overrides to deprioritize no generics. * Move the more specific overload to the top --- types/when/index.d.ts | 16 ++++++++-------- types/when/tsconfig.json | 1 + types/when/when-tests.ts | 28 +++++++++++++++++++++++++++- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/types/when/index.d.ts b/types/when/index.d.ts index 3736cfa7dd..0b016a9ea0 100644 --- a/types/when/index.d.ts +++ b/types/when/index.d.ts @@ -285,11 +285,11 @@ declare namespace When { // be a constructor with prototype set to an instance of Error. otherwise(exceptionType: any, onRejected?: (reason: any) => U | Promise): Promise; - then( - onFulfilled?: ((value: T) => T | Thenable) | undefined | null, - onRejected?: ((reason: any) => T | Thenable) | undefined | null, + then( + onFulfilled: ((value: T) => TResult1 | Thenable), + onRejected: ((reason: any) => TResult2 | Thenable), onProgress?: (update: any) => void - ): Promise; + ): Promise; then( onFulfilled: ((value: T) => TResult | Thenable), onRejected?: ((reason: any) => TResult | Thenable) | undefined | null, @@ -300,11 +300,11 @@ declare namespace When { onRejected: ((reason: any) => TResult | Thenable), onProgress?: (update: any) => void ): Promise; - then( - onFulfilled: ((value: T) => TResult1 | Thenable), - onRejected: ((reason: any) => TResult2 | Thenable), + then( + onFulfilled?: ((value: T) => T | Thenable) | undefined | null, + onRejected?: ((reason: any) => T | Thenable) | undefined | null, onProgress?: (update: any) => void - ): Promise; + ): Promise; spread(onFulfilled: _.Fn0 | T>): Promise; spread(onFulfilled: _.Fn1 | T>): Promise; diff --git a/types/when/tsconfig.json b/types/when/tsconfig.json index 2162d713fc..84a5f78c14 100644 --- a/types/when/tsconfig.json +++ b/types/when/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { "module": "commonjs", + "target": "es5", "lib": [ "es6" ], diff --git a/types/when/when-tests.ts b/types/when/when-tests.ts index d44752b950..e1e3f0fd7c 100644 --- a/types/when/when-tests.ts +++ b/types/when/when-tests.ts @@ -14,9 +14,24 @@ class ForeignPromise { then(onFulfilled?: (value: T) => T, onRejected?: (reason: any) => T): ForeignPromise { return new ForeignPromise(onFulfilled ? onFulfilled(this.value) : this.value); } -}; +} + +interface IData { + timestamp: number; +} + +class Data implements IData { + timestamp: number; + date: Date; + + constructor({ timestamp }: IData) { + this.timestamp = timestamp; + this.date = new Date(timestamp); + } +} var promise: when.Promise; +var promise2: when.Promise; var foreign = new ForeignPromise(1); var error = new Error("boom!"); var example: () => void; @@ -222,6 +237,17 @@ promise = when(1).then(undefined, (err: any) => 2); promise = when(1).then((val: number) => val + val, (err: any) => 2); promise = when(1).then((val: number) => when(val + val), (err: any) => 2); +promise = when('1').then((val: string) => parseInt(val)); + +// Tests for when TResult is a subtype of T +const subData: IData = { timestamp: Date.now() }; +const errorData: Data = new Data({ timestamp: -1 }); + +promise2 = when(subData).then((val: IData) => new Data(val)); +promise2 = when(subData).then((val: IData) => when(new Data(val))); +promise2 = when(subData).then((val: IData) => new Data(val), (err: any) => errorData); +promise2 = when(subData).then((val: IData) => when(new Data(val)), (err: any) => errorData); + /* promise.spread(onFulfilledArray) */ promise = when([]).spread(() => 2); From 470d9ed790a243023a732880aa2b84e3e44893c0 Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Wed, 25 Apr 2018 03:22:30 +0300 Subject: [PATCH 0861/2153] Update index.d.ts (#25119) The done function takes an optional release (boolean) argument that tells whether the client should be released or put back in the pool. From: https://node-postgres.com/api/pool ` The releaseCallback releases an acquired client back to the pool. If you pass a truthy value in the err position to the callback, instead of releasing the client to the pool, the pool will be instructed to disconnect and destroy this client, leaving a space within itself for a new client. ` --- types/pg/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/pg/index.d.ts b/types/pg/index.d.ts index 9098f400e7..0013a9c738 100644 --- a/types/pg/index.d.ts +++ b/types/pg/index.d.ts @@ -99,7 +99,7 @@ export class Pool extends events.EventEmitter { readonly waitingCount: number; connect(): Promise; - connect(callback: (err: Error, client: PoolClient, done: () => void) => void): void; + connect(callback: (err: Error, client: PoolClient, done: (release?: any) => void) => void): void; end(): Promise; end(callback: () => void): void; From 7c9595d32e7b9b37580202d55670430aa270283c Mon Sep 17 00:00:00 2001 From: Slava Date: Wed, 25 Apr 2018 03:23:31 +0300 Subject: [PATCH 0862/2153] Update @types/long to latest version (#25126) Add fromBytes/LE/BE and toBytes/LE/BE. Also fix some tests. --- types/long/index.d.ts | 35 ++++++++++++++++++++++++++++++++++- types/long/long-tests.ts | 15 ++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/types/long/index.d.ts b/types/long/index.d.ts index 3fbc02727b..7d373ae11f 100644 --- a/types/long/index.d.ts +++ b/types/long/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for long.js 3.0.2 +// Type definitions for long.js 4.0.0 // Project: https://github.com/dcodeIO/long.js // Definitions by: Peter Kooijmans // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -90,6 +90,21 @@ declare class Long */ static fromString( str: string, unsigned?: boolean | number, radix?: number ): Long; + /** + * Creates a Long from its byte representation. + */ + static fromBytes( bytes: number[], unsigned?: boolean, le?: boolean ): Long; + + /** + * Creates a Long from its little endian byte representation. + */ + static fromBytesLE( bytes: number[], unsigned?: boolean ): Long; + + /** + * Creates a Long from its little endian byte representation. + */ + static fromBytesBE( bytes: number[], unsigned?: boolean ): Long; + /** * Tests if the specified object is a Long. */ @@ -330,6 +345,24 @@ declare class Long */ toNumber(): number; + /** + * Converts this Long to its byte representation. + */ + + toBytes( le?: boolean ): number[]; + + /** + * Converts this Long to its little endian byte representation. + */ + + toBytesLE(): number[]; + + /** + * Converts this Long to its big endian byte representation. + */ + + toBytesBE(): number[]; + /** * Converts this Long to signed. */ diff --git a/types/long/long-tests.ts b/types/long/long-tests.ts index c54c83d4d6..12f76ba570 100644 --- a/types/long/long-tests.ts +++ b/types/long/long-tests.ts @@ -6,6 +6,7 @@ var val: Long; var n: number = 42; var b: boolean = true; var s: string = "1337"; +var bytes: number[] = [0, 0, 0, 0, 0, 0, 0, 0]; val = new Long(0xFFFFFFFF, 0x7FFFFFFF, true); val = new Long(0xFFFFFFFF, 0x7FFFFFFF); @@ -27,6 +28,7 @@ n = val.compare(val); n = val.compare(n); n = val.compare(s); +val = Long.ONE; val = val.div(val); val = val.div(n); val = val.div(s); @@ -63,6 +65,7 @@ b = val.lessThanOrEqual(val); b = val.lessThanOrEqual(n); b = val.lessThanOrEqual(s); +val = Long.fromValue(10); val = val.modulo(val); val = val.modulo(n); val = val.modulo(s); @@ -100,7 +103,7 @@ n = val.toNumber(); val = val.toSigned(); s = val.toString(); -s = val.toString(n); +s = val.toString(16); val = val.toUnsigned(); @@ -115,3 +118,13 @@ val = Long.NEG_ONE; val = Long.ONE; val = Long.UZERO; val = Long.ZERO; + +val = Long.fromBytes(bytes); +val = Long.fromBytes(bytes, true); +val = Long.fromBytes(bytes, true, true); +bytes = val.toBytes(); +val = Long.fromBytes(bytes) +bytes = val.toBytesLE() +val = Long.fromBytesLE(bytes) +bytes = val.toBytesBE() +val = Long.fromBytesBE(bytes) From 56f31f9da4b3962a2e1ae7724fff9338eda25632 Mon Sep 17 00:00:00 2001 From: Eugene Kuzmin Date: Wed, 25 Apr 2018 03:25:17 +0300 Subject: [PATCH 0863/2153] Add merge() method to ObjectLikeSequence (#25127) --- types/lazy.js/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/lazy.js/index.d.ts b/types/lazy.js/index.d.ts index daa0451e48..3a44d2ce40 100644 --- a/types/lazy.js/index.d.ts +++ b/types/lazy.js/index.d.ts @@ -210,6 +210,7 @@ declare namespace LazyJS { get(property: string): ObjectLikeSequence; invert(): ObjectLikeSequence; keys(): Sequence; + merge(others: Object | ObjectLikeSequence, mergeFn?: Function): ObjectLikeSequence; omit(properties: string[]): ObjectLikeSequence; pairs(): Sequence; pick(properties: string[]): ObjectLikeSequence; From c02c9f00f0b98adc2abdc62f8f9fedd0c046a1eb Mon Sep 17 00:00:00 2001 From: "a.nvlkv" Date: Wed, 25 Apr 2018 02:31:59 +0200 Subject: [PATCH 0864/2153] Update Layer.paramNames, Add ParamName (#25135) In recent version of koa-router paramNames aren't strings but objects. Added definition --- types/koa-router/index.d.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/types/koa-router/index.d.ts b/types/koa-router/index.d.ts index ab61772835..1ade4b135b 100644 --- a/types/koa-router/index.d.ts +++ b/types/koa-router/index.d.ts @@ -87,12 +87,23 @@ declare module Router { } +declare class ParamName { + asterisk: boolean; + delimiter: string; + name: string; + optional: boolean; + partial: boolean; + pattern: string; + prefix: string; + repeat: string; +} + declare class Layer { opts: Layer.ILayerOptions; name: string; methods: string[]; - paramNames: string[]; + paramNames: ParamName[]; stack: Router.IMiddleware[]; regexp: RegExp; path: string; From 6250af69ce88189b38e5bf1bc6c43ca13de43594 Mon Sep 17 00:00:00 2001 From: Ben Saufley Date: Tue, 24 Apr 2018 20:34:23 -0400 Subject: [PATCH 0865/2153] [next-redux-wrapper]: Change reference to React.Component to [react-redux.]Component (#25137) * Change reference to React.Component to [react-redux].Component * Bump verison number to match latest package version? * No patch version * Don't pass MergedProps to returned type; extend tests --- types/next-redux-wrapper/index.d.ts | 8 ++--- .../next-redux-wrapper-tests.tsx | 29 +++++++++++++------ 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/types/next-redux-wrapper/index.d.ts b/types/next-redux-wrapper/index.d.ts index 38e20f608a..16dc88b1a4 100644 --- a/types/next-redux-wrapper/index.d.ts +++ b/types/next-redux-wrapper/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for next-redux-wrapper 1.3 +// Type definitions for next-redux-wrapper 1.4 // Project: https://github.com/kirill-konshin/next-redux-wrapper // Definitions by: Steve // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -25,20 +25,20 @@ export = nextReduxWrapper; declare function nextReduxWrapper( options: nextReduxWrapper.Options -): (Component: Component) => nextReduxWrapper.NextReduxWrappedComponent; +): (Component: Component) => nextReduxWrapper.NextReduxWrappedComponent; declare function nextReduxWrapper( createStore: nextReduxWrapper.NextStoreCreator, mapStateToProps?: MapStateToPropsParam, mapDispatchToProps?: MapDispatchToPropsParam, mergeProps?: MergeProps, options?: ConnectOptions -): (Component: Component) => nextReduxWrapper.NextReduxWrappedComponent; +): (Component: Component) => nextReduxWrapper.NextReduxWrappedComponent; declare namespace nextReduxWrapper { interface NextPageComponentMethods { getInitialProps(props: any): Promise; } - type NextReduxWrappedComponent = React.Component & NextPageComponentMethods; + type NextReduxWrappedComponent

= Component

& NextPageComponentMethods; type NextStoreCreator = ( initialState: TInitialState, diff --git a/types/next-redux-wrapper/next-redux-wrapper-tests.tsx b/types/next-redux-wrapper/next-redux-wrapper-tests.tsx index 40069aeb8d..89e358afb2 100644 --- a/types/next-redux-wrapper/next-redux-wrapper-tests.tsx +++ b/types/next-redux-wrapper/next-redux-wrapper-tests.tsx @@ -20,6 +20,10 @@ const makeStore = (initialState: InitialState): Store => { return createStore(reducer, initialState); }; +interface OwnProps { + bar: string; +} + interface Props { foo: string; custom: string; @@ -29,7 +33,7 @@ interface ReduxStore { foo: string; } -class Page extends React.Component { +class Page extends React.Component { static getInitialProps({store, isServer, pathname, query}: any) { store.dispatch({type: 'FOO', payload: 'foo'}); return {custom: 'custom'}; @@ -46,29 +50,28 @@ class Page extends React.Component { type ConnectStateProps = Props; type DispatchProps = Props; -type OwnProps = Props; type MergedProps = Props; // Test various typings -const com1 = withRedux(makeStore, (state: ReduxStore) => ({foo: state.foo}))(Page); +const Com1 = withRedux(makeStore, (state: ReduxStore) => ({foo: state.foo}))(Page); -const com2 = withRedux(makeStore, (state: ReduxStore) => ({foo: state.foo}))(Page); +const Com2 = withRedux(makeStore, (state: ReduxStore) => ({foo: state.foo}))(Page); -const com3 = withRedux(makeStore, (state: ReduxStore) => ({foo: state.foo}))(Page); +const Com3 = withRedux(makeStore, (state: ReduxStore) => ({foo: state.foo}))(Page); -const com4 = withRedux( +const Com4 = withRedux( makeStore, (state: ReduxStore) => ({foo: state.foo, custom: 'hi'}) )(Page); -const com5 = withRedux( +const Com5 = withRedux( makeStore, (state: ReduxStore) => ({foo: state.foo, custom: 'hi'}), undefined, (state: Props) => ({foo: state.foo, custom: 'hi'}) )(Page); -const com6 = withRedux( +const Com6 = withRedux( (initialState: InitialState, options: StoreCreatorOptions) => { if (options.isServer || options.req || options.query || options.res) { const a = 1; @@ -80,10 +83,18 @@ const com6 = withRedux ({foo: state.foo, custom: 'hi'}) )(Page); -const com7 = withRedux({ +const Com7 = withRedux({ createStore: makeStore, mapStateToProps: (state: ReduxStore) => ({foo: state.foo}) })(Page); +const com1Instance = (); +const com2Instance = (); +const com3Instance = (); +const com4Instance = (); +const com5Instance = (); +const com6Instance = (); +const com7Instance = (); + withRedux.setPromise(Promise); withRedux.setDebug(true); From a5cb7117633f46105258d1fec9fb9a7e56afde95 Mon Sep 17 00:00:00 2001 From: Bruno Lemos Date: Tue, 24 Apr 2018 21:36:43 -0300 Subject: [PATCH 0866/2153] [expo] Un-extend LinearGradientProps from ViewProperties to unblock #25083 (#25149) --- types/expo/index.d.ts | 6 ++++-- types/expo/v24/index.d.ts | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 3726249cc7..8efbbd120d 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -18,7 +18,8 @@ import { NativeEventEmitter, ViewProperties, ViewStyle, - Permission + Permission, + StyleProp } from 'react-native'; export type Axis = number; @@ -1554,11 +1555,12 @@ export class KeepAwake extends Component { /** * LinearGradient */ -export interface LinearGradientProps extends ViewProperties { +export interface LinearGradientProps { colors: string[]; start?: [number, number]; end?: [number, number]; locations?: number[]; + style?: StyleProp; } export class LinearGradient extends Component { } diff --git a/types/expo/v24/index.d.ts b/types/expo/v24/index.d.ts index 829e9730a7..0647519da4 100644 --- a/types/expo/v24/index.d.ts +++ b/types/expo/v24/index.d.ts @@ -17,7 +17,8 @@ import { NativeEventEmitter, ViewProperties, ViewStyle, - Permission + Permission, + StyleProp } from 'react-native'; export type Axis = number; @@ -1534,11 +1535,12 @@ export class KeepAwake extends Component { /** * LinearGradient */ -export interface LinearGradientProps extends ViewProperties { +export interface LinearGradientProps { colors: string[]; start?: [number, number]; end?: [number, number]; locations?: number[]; + style?: StyleProp; } export class LinearGradient extends Component { } From e5c82b2910e56a0d1ffdb6609e349baa971d4922 Mon Sep 17 00:00:00 2001 From: Bruno Lemos Date: Tue, 24 Apr 2018 21:37:10 -0300 Subject: [PATCH 0867/2153] [react-native-linear-gradient] Remove type definitions (#25147) The project has a `index.d.ts` file since v2.4.0. --- notNeededPackages.json | 6 +++ types/react-native-linear-gradient/index.d.ts | 47 ------------------- .../react-native-linear-gradient-tests.tsx | 35 -------------- .../tsconfig.json | 25 ---------- .../react-native-linear-gradient/tslint.json | 1 - 5 files changed, 6 insertions(+), 108 deletions(-) delete mode 100644 types/react-native-linear-gradient/index.d.ts delete mode 100644 types/react-native-linear-gradient/react-native-linear-gradient-tests.tsx delete mode 100644 types/react-native-linear-gradient/tsconfig.json delete mode 100644 types/react-native-linear-gradient/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 2b9e1fcde0..6f3e4fe093 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1176,6 +1176,12 @@ "sourceRepoURL": "https://github.com/idehub/react-native-google-analytics-bridge", "asOfVersion": "5.3.3" }, + { + "libraryName": "react-native-linear-gradient", + "typingsPackageName": "react-native-linear-gradient", + "sourceRepoURL": "https://github.com/react-native-community/react-native-linear-gradient", + "asOfVersion": "2.4.0" + }, { "libraryName": "react-native-modal", "typingsPackageName": "react-native-modal", diff --git a/types/react-native-linear-gradient/index.d.ts b/types/react-native-linear-gradient/index.d.ts deleted file mode 100644 index 687bd4e432..0000000000 --- a/types/react-native-linear-gradient/index.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -// Type definitions for react-native-linear-gradient 2.3 -// Project: https://github.com/brentvatne/react-native-linear-gradient#readme -// Definitions by: Jacob Froman -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 - -import * as React from 'react'; -import { ViewProperties } from 'react-native'; - -interface LinearGradientProps extends ViewProperties { - children?: React.ReactNode; - - /** - * Colors that will be used for the gradient - */ - colors?: ReadonlyArray; - - /** - * Coordinates of the position that the gradient starts at, as a fraction - * of the overall size of the gradient, starting from the top left corner. - * { x: 0.1, y: 0.1 } means that the gradient will start 10% from the top - * and 10% from the left. - */ - start?: { x: number; y: number }; - - /** - * Coordinates of the position that the gradient ends at, as a fraction - * of the overall size of the gradient, starting from the top left corner. - * { x: 0.9, y: 0.9 } means that the gradient will end 90% from the top - * and 90% from the left. - */ - end?: { x: number; y: number }; - - /** - * An optional array of numbers defining the location of each gradient - * color stop, mapping to the color with the same index in colors prop. - * [0.1, 0.75, 1] means that first color will take 0% - 10%, second color - * will take 10% - 75% and finally third color will occupy 75% - 100%. - */ - locations?: ReadonlyArray; -} - -declare class LinearGradient extends React.Component { - constructor(props: LinearGradientProps); -} - -export default LinearGradient; diff --git a/types/react-native-linear-gradient/react-native-linear-gradient-tests.tsx b/types/react-native-linear-gradient/react-native-linear-gradient-tests.tsx deleted file mode 100644 index 00172818b1..0000000000 --- a/types/react-native-linear-gradient/react-native-linear-gradient-tests.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import * as React from 'react'; -import LinearGradient from 'react-native-linear-gradient'; -import { Text, StyleSheet } from 'react-native'; - -export default class MyLinearGradient extends React.Component { - render() { - return ( - - Sign in with Facebook - - ); - } -} - -const styles = StyleSheet.create({ - linearGradient: { - flex: 1, - paddingLeft: 15, - paddingRight: 15, - borderRadius: 5 - }, - buttonText: { - fontSize: 18, - textAlign: 'center', - margin: 10, - color: '#ffffff', - backgroundColor: 'transparent' - } -}); diff --git a/types/react-native-linear-gradient/tsconfig.json b/types/react-native-linear-gradient/tsconfig.json deleted file mode 100644 index 60d93ae024..0000000000 --- a/types/react-native-linear-gradient/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true, - "jsx": "react-native" - }, - "files": [ - "index.d.ts", - "react-native-linear-gradient-tests.tsx" - ] -} \ No newline at end of file diff --git a/types/react-native-linear-gradient/tslint.json b/types/react-native-linear-gradient/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/react-native-linear-gradient/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } From 163ae93d8639e63033f6c7957ebf79f5e8f909bc Mon Sep 17 00:00:00 2001 From: Zev Spitz Date: Wed, 25 Apr 2018 03:38:01 +0300 Subject: [PATCH 0868/2153] MSOffice dependencies: activex-office, activex-msforms, activex-vbide, activex-stdole -- default properties; jsdoc fixes (#25256) * Fix activex-stdole * Reduce any * Default properties; fix jsDoc default values * Fix office tests * activex-office dtslint fix * activex-vbide: default properties; default values of optional parameters * activex-vbide: dtslint fixes * activex-msforms -- default properties; default parameter values in jsDoc * Reduce duplicate types * dtslint fix * activex-outlook version bump * activex-powerpoint Typescript version bump * activex-vbide Typescript version bump * post-DefinitelyTyped-build fixes * Fix Column and List setters * Fix for Excel tests --- types/activex-excel/activex-excel-tests.ts | 4 +- types/activex-msforms/index.d.ts | 2423 +----------------- types/activex-msforms/tslint.json | 3 +- types/activex-office/activex-office-tests.ts | 23 +- types/activex-office/index.d.ts | 1114 ++++---- types/activex-office/tslint.json | 3 +- types/activex-outlook/index.d.ts | 2 +- types/activex-powerpoint/index.d.ts | 2 +- types/activex-stdole/index.d.ts | 6 +- types/activex-vbide/activex-vbide-tests.ts | 22 +- types/activex-vbide/index.d.ts | 80 +- types/activex-vbide/tslint.json | 3 +- types/activex-word/index.d.ts | 2 +- 13 files changed, 787 insertions(+), 2900 deletions(-) diff --git a/types/activex-excel/activex-excel-tests.ts b/types/activex-excel/activex-excel-tests.ts index b93a924263..4e577300e5 100644 --- a/types/activex-excel/activex-excel-tests.ts +++ b/types/activex-excel/activex-excel-tests.ts @@ -279,7 +279,7 @@ const setColumnVisibility = (visible: boolean) => { const data = sheet.Range("L2", sheet.Range('L100').End(Excel.XlDirection.xlUp)).Value() as SafeArray; sheet.Range('L1', sheet.Range('L100').End(Excel.XlDirection.xlUp)).ClearContents(); - const combobox = sheet.OLEObjects('ComboBox1').Object as MSForms.ComboBox2; + const combobox = sheet.OLEObjects('ComboBox1').Object as MSForms.ComboBox; combobox.Clear(); ActiveXObject.set(combobox, 'List', [], data); combobox.ListIndex = -1; @@ -293,7 +293,7 @@ const setColumnVisibility = (visible: boolean) => { const dict = new ActiveXObject('Scripting.Dictionary'); arr.forEach(x => ActiveXObject.set(dict, 'Item', [x], true)); - const combobox = sheet.OLEObjects('ComboBox1').Object as MSForms.ComboBox2; + const combobox = sheet.OLEObjects('ComboBox1').Object as MSForms.ComboBox; combobox.Clear(); const enumerator = new Enumerator(dict.Items()); enumerator.moveFirst(); diff --git a/types/activex-msforms/index.d.ts b/types/activex-msforms/index.d.ts index 45acebbdb3..c896cc4bf5 100644 --- a/types/activex-msforms/index.d.ts +++ b/types/activex-msforms/index.d.ts @@ -2,7 +2,7 @@ // Project: https://msdn.microsoft.com/VBA/Language-Reference-VBA/articles/reference-microsoft-forms // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 /// @@ -361,48 +361,11 @@ declare namespace MSForms { WordWrap: boolean; } - class CheckBox2 { - private 'MSForms.CheckBox2_typekey': CheckBox2; - private constructor(); - readonly _Font_Reserved: NewFont; - Accelerator: string; - Alignment: fmAlignment; - AutoSize: boolean; - BackColor: number; - BackStyle: fmBackStyle; - BordersSuppress: boolean; - Caption: string; - readonly DisplayStyle: fmDisplayStyle; - Enabled: boolean; - Font: NewFont; - FontBold: boolean; - FontItalic: boolean; - FontName: string; - FontSize: number; - FontStrikethru: boolean; - FontUnderline: boolean; - FontWeight: number; - ForeColor: number; - GroupName: string; - Locked: boolean; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - MultiSelect: fmMultiSelect; - Picture: stdole.StdPicture; - PicturePosition: fmPicturePosition; - SpecialEffect: fmButtonEffect; - TextAlign: fmTextAlign; - TripleState: boolean; - readonly Valid: boolean; - Value: any; - WordWrap: boolean; - } - class ComboBox { private 'MSForms.ComboBox_typekey': ComboBox; private constructor(); readonly _Font_Reserved: NewFont; - AddItem(pvargItem?: any, pvargIndex?: any): void; + AddItem(pvargItem?: number, pvargIndex?: number): void; AutoSize: boolean; AutoTab: boolean; AutoWordSelect: boolean; @@ -411,10 +374,11 @@ declare namespace MSForms { BorderColor: number; BordersSuppress: boolean; BorderStyle: fmBorderStyle; - BoundColumn: any; + BoundColumn: number; readonly CanPaste: boolean; Clear(): void; - Column(pvargColumn?: any, pvargIndex?: any): any; + Column(pvargColumn: number, pvargIndex?: number): any; + Column(): SafeArray; ColumnCount: number; ColumnHeads: boolean; ColumnWidths: string; @@ -441,13 +405,14 @@ declare namespace MSForms { HideSelection: boolean; IMEMode: fmIMEMode; readonly LineCount: number; - List(pvargIndex?: any, pvargColumn?: any): any; + List(pvargIndex: number, pvargColumn?: number): any; + List(): SafeArray; readonly ListCount: number; ListCursor: any; - ListIndex: any; + ListIndex: number; ListRows: number; ListStyle: fmListStyle; - ListWidth: any; + ListWidth: number; Locked: boolean; MatchEntry: fmMatchEntry; readonly MatchFound: boolean; @@ -456,7 +421,7 @@ declare namespace MSForms { MouseIcon: stdole.StdPicture; MousePointer: fmMousePointer; Paste(): void; - RemoveItem(pvargIndex: any): void; + RemoveItem(pvargIndex: number): boolean; SelectionMargin: boolean; SelLength: number; SelStart: number; @@ -466,84 +431,9 @@ declare namespace MSForms { Style: fmStyle; Text: string; TextAlign: fmTextAlign; - TextColumn: any; + TextColumn: number; readonly TextLength: number; - TopIndex: any; - readonly Valid: boolean; - Value: any; - } - - class ComboBox2 { - private 'MSForms.ComboBox2_typekey': ComboBox2; - private constructor(); - readonly _Font_Reserved: NewFont; - AddItem(pvargItem?: any, pvargIndex?: any): void; - AutoSize: boolean; - AutoTab: boolean; - AutoWordSelect: boolean; - BackColor: number; - BackStyle: fmBackStyle; - BorderColor: number; - BordersSuppress: boolean; - BorderStyle: fmBorderStyle; - BoundColumn: any; - readonly CanPaste: boolean; - Clear(): void; - Column(pvargColumn?: any, pvargIndex?: any): any; - ColumnCount: number; - ColumnHeads: boolean; - ColumnWidths: string; - Copy(): void; - readonly CurTargetX: number; - readonly CurTargetY: number; - CurX: number; - Cut(): void; - readonly DisplayStyle: fmDisplayStyle; - DragBehavior: fmDragBehavior; - DropButtonStyle: fmDropButtonStyle; - DropDown(): void; - Enabled: boolean; - EnterFieldBehavior: fmEnterFieldBehavior; - Font: NewFont; - FontBold: boolean; - FontItalic: boolean; - FontName: string; - FontSize: number; - FontStrikethru: boolean; - FontUnderline: boolean; - FontWeight: number; - ForeColor: number; - HideSelection: boolean; - IMEMode: fmIMEMode; - readonly LineCount: number; - List(pvargIndex?: any, pvargColumn?: any): any; - readonly ListCount: number; - ListCursor: any; - ListIndex: any; - ListRows: number; - ListStyle: fmListStyle; - ListWidth: any; - Locked: boolean; - MatchEntry: fmMatchEntry; - readonly MatchFound: boolean; - MatchRequired: boolean; - MaxLength: number; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - Paste(): void; - RemoveItem(pvargIndex: any): void; - SelectionMargin: boolean; - SelLength: number; - SelStart: number; - SelText: string; - ShowDropButtonWhen: fmShowDropButtonWhen; - SpecialEffect: fmSpecialEffect; - Style: fmStyle; - Text: string; - TextAlign: fmTextAlign; - TextColumn: any; - readonly TextLength: number; - TopIndex: any; + TopIndex: number; readonly Valid: boolean; Value: any; } @@ -577,35 +467,6 @@ declare namespace MSForms { WordWrap: boolean; } - class CommandButton2 { - private 'MSForms.CommandButton2_typekey': CommandButton2; - private constructor(); - readonly _Font_Reserved: NewFont; - Accelerator: string; - AutoSize: boolean; - BackColor: number; - BackStyle: fmBackStyle; - Caption: string; - Enabled: boolean; - Font: NewFont; - FontBold: boolean; - FontItalic: boolean; - FontName: string; - FontSize: number; - FontStrikethru: boolean; - FontUnderline: boolean; - FontWeight: number; - ForeColor: number; - Locked: boolean; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - Picture: stdole.StdPicture; - PicturePosition: fmPicturePosition; - TakeFocusOnClick: boolean; - Value: boolean; - WordWrap: boolean; - } - class Control { private 'MSForms.Control_typekey': Control; private constructor(); @@ -656,9 +517,7 @@ declare namespace MSForms { ZOrder(zPosition?: any): void; } - class Controls { - private 'MSForms.Controls_typekey': Controls; - private constructor(); + interface Controls { _AddByClass(clsid: number): Control; _GetItemByID(ID: number): Control; _GetItemByIndex(lIndex: number): Control; @@ -679,6 +538,7 @@ declare namespace MSForms { SelectAll(): void; SendBackward(): void; SendToBack(): void; + (varg: any): any; } class DataObject { @@ -693,18 +553,6 @@ declare namespace MSForms { StartDrag(OKEffect?: any): fmDropEffect; } - class DataObject2 { - private 'MSForms.DataObject2_typekey': DataObject2; - private constructor(); - Clear(): void; - GetFormat(Format: any): boolean; - GetFromClipboard(): void; - GetText(Format?: any): string; - PutInClipboard(): void; - SetText(Text: string, Format?: any): void; - StartDrag(OKEffect?: any): fmDropEffect; - } - class Frame { private 'MSForms.Frame_typekey': Frame; private constructor(); @@ -770,71 +618,6 @@ declare namespace MSForms { Zoom: number; } - class Frame2 { - private 'MSForms.Frame2_typekey': Frame2; - private constructor(); - readonly _Font_Reserved: NewFont; - _GetGridX(GridX: number): void; - _GetGridY(GridY: number): void; - _GetInsideHeight(InsideHeight: number): void; - _GetInsideWidth(InsideWidth: number): void; - _GetScrollHeight(ScrollHeight: number): void; - _GetScrollLeft(ScrollLeft: number): void; - _GetScrollTop(ScrollTop: number): void; - _GetScrollWidth(ScrollWidth: number): void; - _SetGridX(GridX: number): void; - _SetGridY(GridY: number): void; - _SetScrollHeight(ScrollHeight: number): void; - _SetScrollLeft(ScrollLeft: number): void; - _SetScrollTop(ScrollTop: number): void; - _SetScrollWidth(ScrollWidth: number): void; - readonly ActiveControl: Control; - BackColor: number; - BorderColor: number; - BorderStyle: fmBorderStyle; - readonly CanPaste: boolean; - readonly CanRedo: boolean; - readonly CanUndo: boolean; - Caption: string; - readonly Controls: Controls; - Copy(): void; - Cut(): void; - Cycle: fmCycle; - DesignMode: fmMode; - Enabled: boolean; - Font: NewFont; - ForeColor: number; - GridX: number; - GridY: number; - readonly InsideHeight: number; - readonly InsideWidth: number; - KeepScrollBarsVisible: fmScrollBars; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - Paste(): void; - Picture: stdole.StdPicture; - PictureAlignment: fmPictureAlignment; - PictureSizeMode: fmPictureSizeMode; - PictureTiling: boolean; - RedoAction(): void; - Repaint(): void; - Scroll(xAction?: any, yAction?: any): void; - ScrollBars: fmScrollBars; - ScrollHeight: number; - ScrollLeft: number; - ScrollTop: number; - ScrollWidth: number; - readonly Selected: Controls; - SetDefaultTabOrder(): void; - ShowGridDots: fmMode; - ShowToolbox: fmMode; - SnapToGrid: fmMode; - SpecialEffect: fmSpecialEffect; - UndoAction(): void; - VerticalScrollBarSide: fmVerticalScrollBarSide; - Zoom: number; - } - class HTMLCheckbox { private 'MSForms.HTMLCheckbox_typekey': HTMLCheckbox; private constructor(); @@ -844,15 +627,6 @@ declare namespace MSForms { Value: string; } - class HTMLCheckbox2 { - private 'MSForms.HTMLCheckbox2_typekey': HTMLCheckbox2; - private constructor(); - Checked: boolean; - HTMLName: string; - HTMLType: string; - Value: string; - } - class HTMLHidden { private 'MSForms.HTMLHidden_typekey': HTMLHidden; private constructor(); @@ -861,14 +635,6 @@ declare namespace MSForms { Value: string; } - class HTMLHidden2 { - private 'MSForms.HTMLHidden2_typekey': HTMLHidden2; - private constructor(); - HTMLName: string; - HTMLType: string; - Value: string; - } - class HTMLImage { private 'MSForms.HTMLImage_typekey': HTMLImage; private constructor(); @@ -880,17 +646,6 @@ declare namespace MSForms { Source: string; } - class HTMLImage2 { - private 'MSForms.HTMLImage2_typekey': HTMLImage2; - private constructor(); - Action: string; - Encoding: string; - HTMLName: string; - HTMLType: string; - Method: string; - Source: string; - } - class HTMLOption { private 'MSForms.HTMLOption_typekey': HTMLOption; private constructor(); @@ -901,16 +656,6 @@ declare namespace MSForms { Value: string; } - class HTMLOption2 { - private 'MSForms.HTMLOption2_typekey': HTMLOption2; - private constructor(); - Checked: boolean; - readonly DisplayStyle: fmDisplayStyle; - HTMLName: string; - HTMLType: string; - Value: string; - } - class HTMLPassword { private 'MSForms.HTMLPassword_typekey': HTMLPassword; private constructor(); @@ -921,16 +666,6 @@ declare namespace MSForms { Width: number; } - class HTMLPassword2 { - private 'MSForms.HTMLPassword2_typekey': HTMLPassword2; - private constructor(); - HTMLName: string; - HTMLType: string; - MaxLength: number; - Value: string; - Width: number; - } - class HTMLReset { private 'MSForms.HTMLReset_typekey': HTMLReset; private constructor(); @@ -939,14 +674,6 @@ declare namespace MSForms { HTMLType: string; } - class HTMLReset2 { - private 'MSForms.HTMLReset2_typekey': HTMLReset2; - private constructor(); - Caption: string; - HTMLName: string; - HTMLType: string; - } - class HTMLSelect { private 'MSForms.HTMLSelect_typekey': HTMLSelect; private constructor(); @@ -958,17 +685,6 @@ declare namespace MSForms { Values: any; } - class HTMLSelect2 { - private 'MSForms.HTMLSelect2_typekey': HTMLSelect2; - private constructor(); - DisplayValues: any; - HTMLName: string; - MultiSelect: boolean; - Selected: string; - Size: number; - Values: any; - } - class HTMLSubmit { private 'MSForms.HTMLSubmit_typekey': HTMLSubmit; private constructor(); @@ -980,17 +696,6 @@ declare namespace MSForms { Method: string; } - class HTMLSubmit2 { - private 'MSForms.HTMLSubmit2_typekey': HTMLSubmit2; - private constructor(); - Action: string; - Caption: string; - Encoding: string; - HTMLName: string; - HTMLType: string; - Method: string; - } - class HTMLText { private 'MSForms.HTMLText_typekey': HTMLText; private constructor(); @@ -1001,16 +706,6 @@ declare namespace MSForms { Width: number; } - class HTMLText2 { - private 'MSForms.HTMLText2_typekey': HTMLText2; - private constructor(); - HTMLName: string; - HTMLType: string; - MaxLength: number; - Value: string; - Width: number; - } - class HTMLTextArea { private 'MSForms.HTMLTextArea_typekey': HTMLTextArea; private constructor(); @@ -1021,16 +716,6 @@ declare namespace MSForms { WordWrap: string; } - class HTMLTextArea2 { - private 'MSForms.HTMLTextArea2_typekey': HTMLTextArea2; - private constructor(); - Columns: number; - HTMLName: string; - Rows: number; - Value: string; - WordWrap: string; - } - class Image { private 'MSForms.Image_typekey': Image; private constructor(); @@ -1049,24 +734,6 @@ declare namespace MSForms { SpecialEffect: fmSpecialEffect; } - class Image2 { - private 'MSForms.Image2_typekey': Image2; - private constructor(); - AutoSize: boolean; - BackColor: number; - BackStyle: fmBackStyle; - BorderColor: number; - BorderStyle: fmBorderStyle; - Enabled: boolean; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - Picture: stdole.StdPicture; - PictureAlignment: fmPictureAlignment; - PictureSizeMode: fmPictureSizeMode; - PictureTiling: boolean; - SpecialEffect: fmSpecialEffect; - } - class Label { private 'MSForms.Label_typekey': Label; private constructor(); @@ -1098,37 +765,6 @@ declare namespace MSForms { WordWrap: boolean; } - class Label2 { - private 'MSForms.Label2_typekey': Label2; - private constructor(); - readonly _Font_Reserved: NewFont; - _Value: string; - Accelerator: string; - AutoSize: boolean; - BackColor: number; - BackStyle: fmBackStyle; - BorderColor: number; - BorderStyle: fmBorderStyle; - Caption: string; - Enabled: boolean; - Font: NewFont; - FontBold: boolean; - FontItalic: boolean; - FontName: string; - FontSize: number; - FontStrikethru: boolean; - FontUnderline: boolean; - FontWeight: number; - ForeColor: number; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - Picture: stdole.StdPicture; - PicturePosition: fmPicturePosition; - SpecialEffect: fmSpecialEffect; - TextAlign: fmTextAlign; - WordWrap: boolean; - } - class ListBox { private 'MSForms.ListBox_typekey': ListBox; private constructor(); @@ -1140,7 +776,8 @@ declare namespace MSForms { BorderStyle: fmBorderStyle; BoundColumn: any; Clear(): void; - Column(pvargColumn?: any, pvargIndex?: any): any; + Column(pvargColumn: number, pvargIndex?: number): any; + Column(): SafeArray; ColumnCount: number; ColumnHeads: boolean; ColumnWidths: string; @@ -1157,57 +794,8 @@ declare namespace MSForms { ForeColor: number; IMEMode: fmIMEMode; IntegralHeight: boolean; - List(pvargIndex?: any, pvargColumn?: any): any; - readonly ListCount: number; - ListCursor: any; - ListIndex: any; - ListStyle: fmListStyle; - ListWidth: any; - Locked: boolean; - MatchEntry: fmMatchEntry; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - MultiSelect: fmMultiSelect; - RemoveItem(pvargIndex: any): void; - Selected(pvargIndex: any): boolean; - SpecialEffect: fmSpecialEffect; - Text: string; - TextAlign: fmTextAlign; - TextColumn: any; - TopIndex: any; - readonly Valid: boolean; - Value: any; - } - - class ListBox2 { - private 'MSForms.ListBox2_typekey': ListBox2; - private constructor(); - readonly _Font_Reserved: NewFont; - AddItem(pvargItem?: any, pvargIndex?: any): void; - BackColor: number; - BorderColor: number; - BordersSuppress: boolean; - BorderStyle: fmBorderStyle; - BoundColumn: any; - Clear(): void; - Column(pvargColumn?: any, pvargIndex?: any): any; - ColumnCount: number; - ColumnHeads: boolean; - ColumnWidths: string; - readonly DisplayStyle: fmDisplayStyle; - Enabled: boolean; - Font: NewFont; - FontBold: boolean; - FontItalic: boolean; - FontName: string; - FontSize: number; - FontStrikethru: boolean; - FontUnderline: boolean; - FontWeight: number; - ForeColor: number; - IMEMode: fmIMEMode; - IntegralHeight: boolean; - List(pvargIndex?: any, pvargColumn?: any): any; + List(pvargIndex: number, pvargColumn?: number): any; + List(): SafeArray; readonly ListCount: number; ListCursor: any; ListIndex: any; @@ -1258,35 +846,6 @@ declare namespace MSForms { Value: number; } - class MultiPage2 { - private 'MSForms.MultiPage2_typekey': MultiPage2; - private constructor(); - readonly _Font_Reserved: NewFont; - _GetTabFixedHeight(Height: number): void; - _GetTabFixedWidth(Width: number): void; - _SetTabFixedHeight(Height: number): void; - _SetTabFixedWidth(Width: number): void; - BackColor: number; - Enabled: boolean; - Font: NewFont; - FontBold: boolean; - FontItalic: boolean; - FontName: string; - FontSize: number; - FontStrikethru: boolean; - FontUnderline: boolean; - FontWeight: number; - ForeColor: number; - MultiRow: boolean; - readonly Pages: Pages; - readonly SelectedItem: Page; - Style: fmTabStyle; - TabFixedHeight: number; - TabFixedWidth: number; - TabOrientation: fmTabOrientation; - Value: number; - } - class NewFont { private 'MSForms.NewFont_typekey': NewFont; private constructor(); @@ -1337,43 +896,6 @@ declare namespace MSForms { WordWrap: boolean; } - class OptionButton2 { - private 'MSForms.OptionButton2_typekey': OptionButton2; - private constructor(); - readonly _Font_Reserved: NewFont; - Accelerator: string; - Alignment: fmAlignment; - AutoSize: boolean; - BackColor: number; - BackStyle: fmBackStyle; - BordersSuppress: boolean; - Caption: string; - readonly DisplayStyle: fmDisplayStyle; - Enabled: boolean; - Font: NewFont; - FontBold: boolean; - FontItalic: boolean; - FontName: string; - FontSize: number; - FontStrikethru: boolean; - FontUnderline: boolean; - FontWeight: number; - ForeColor: number; - GroupName: string; - Locked: boolean; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - MultiSelect: fmMultiSelect; - Picture: stdole.StdPicture; - PicturePosition: fmPicturePosition; - SpecialEffect: fmButtonEffect; - TextAlign: fmTextAlign; - TripleState: boolean; - readonly Valid: boolean; - Value: any; - WordWrap: boolean; - } - class Page { private 'MSForms.Page_typekey': Page; private constructor(); @@ -1439,9 +961,7 @@ declare namespace MSForms { Zoom: number; } - class Pages { - private 'MSForms.Pages_typekey': Pages; - private constructor(); + interface Pages { _AddCtrl(clsid: number, bstrName: string, bstrCaption: string): Page; _GetItemByIndex(lIndex: number): Control; _GetItemByName(pstrName: string): Control; @@ -1452,6 +972,7 @@ declare namespace MSForms { Enum(): any; Item(varg: any): any; Remove(varg: any): void; + (varg: any): any; } class ReturnBoolean { @@ -1502,24 +1023,6 @@ declare namespace MSForms { Value: number; } - class ScrollBar2 { - private 'MSForms.ScrollBar2_typekey': ScrollBar2; - private constructor(); - BackColor: number; - Delay: number; - Enabled: boolean; - ForeColor: number; - LargeChange: number; - Max: number; - Min: number; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - Orientation: fmOrientation; - ProportionalThumb: boolean; - SmallChange: number; - Value: number; - } - class SpinButton { private 'MSForms.SpinButton_typekey': SpinButton; private constructor(); @@ -1536,22 +1039,6 @@ declare namespace MSForms { Value: number; } - class SpinButton2 { - private 'MSForms.SpinButton2_typekey': SpinButton2; - private constructor(); - BackColor: number; - Delay: number; - Enabled: boolean; - ForeColor: number; - Max: number; - Min: number; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - Orientation: fmOrientation; - SmallChange: number; - Value: number; - } - class Tab { private 'MSForms.Tab_typekey': Tab; private constructor(); @@ -1565,9 +1052,7 @@ declare namespace MSForms { Visible: boolean; } - class Tabs { - private 'MSForms.Tabs_typekey': Tabs; - private constructor(); + interface Tabs { _Add(bstrName: string, bstrCaption: string): Tab; _GetItemByIndex(lIndex: number): Tab; _GetItemByName(bstr: string): Tab; @@ -1578,6 +1063,7 @@ declare namespace MSForms { Enum(): any; Item(varg: any): any; Remove(varg: any): void; + (varg: any): any; } class TabStrip { @@ -1619,45 +1105,6 @@ declare namespace MSForms { Value: number; } - class TabStrip2 { - private 'MSForms.TabStrip2_typekey': TabStrip2; - private constructor(); - readonly _Font_Reserved: NewFont; - _GetClientHeight(ClientHeight: number): void; - _GetClientLeft(ClientLeft: number): void; - _GetClientTop(ClientTop: number): void; - _GetClientWidth(ClientWidth: number): void; - _GetTabFixedHeight(TabFixedHeight: number): void; - _GetTabFixedWidth(TabFixedWidth: number): void; - _SetTabFixedHeight(TabFixedHeight: number): void; - _SetTabFixedWidth(TabFixedWidth: number): void; - BackColor: number; - readonly ClientHeight: number; - readonly ClientLeft: number; - readonly ClientTop: number; - readonly ClientWidth: number; - Enabled: boolean; - Font: NewFont; - FontBold: boolean; - FontItalic: boolean; - FontName: string; - FontSize: number; - FontStrikethru: boolean; - FontUnderline: boolean; - FontWeight: number; - ForeColor: number; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - MultiRow: boolean; - readonly SelectedItem: Tab; - Style: fmTabStyle; - TabFixedHeight: number; - TabFixedWidth: number; - TabOrientation: fmTabOrientation; - readonly Tabs: Tabs; - Value: number; - } - class TextBox { private 'MSForms.TextBox_typekey': TextBox; private constructor(); @@ -1720,68 +1167,6 @@ declare namespace MSForms { WordWrap: boolean; } - class TextBox2 { - private 'MSForms.TextBox2_typekey': TextBox2; - private constructor(); - readonly _Font_Reserved: NewFont; - AutoSize: boolean; - AutoTab: boolean; - AutoWordSelect: boolean; - BackColor: number; - BackStyle: fmBackStyle; - BorderColor: number; - BordersSuppress: boolean; - BorderStyle: fmBorderStyle; - readonly CanPaste: boolean; - Copy(): void; - CurLine: number; - readonly CurTargetX: number; - readonly CurTargetY: number; - CurX: number; - CurY: number; - Cut(): void; - readonly DisplayStyle: fmDisplayStyle; - DragBehavior: fmDragBehavior; - DropButtonStyle: fmDropButtonStyle; - Enabled: boolean; - EnterFieldBehavior: fmEnterFieldBehavior; - EnterKeyBehavior: boolean; - Font: NewFont; - FontBold: boolean; - FontItalic: boolean; - FontName: string; - FontSize: number; - FontStrikethru: boolean; - FontUnderline: boolean; - FontWeight: number; - ForeColor: number; - HideSelection: boolean; - IMEMode: fmIMEMode; - IntegralHeight: boolean; - readonly LineCount: number; - Locked: boolean; - MaxLength: number; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - MultiLine: boolean; - PasswordChar: string; - Paste(): void; - ScrollBars: fmScrollBars; - SelectionMargin: boolean; - SelLength: number; - SelStart: number; - SelText: string; - ShowDropButtonWhen: fmShowDropButtonWhen; - SpecialEffect: fmSpecialEffect; - TabKeyBehavior: boolean; - Text: string; - TextAlign: fmTextAlign; - readonly TextLength: number; - readonly Valid: boolean; - Value: any; - WordWrap: boolean; - } - class ToggleButton { private 'MSForms.ToggleButton_typekey': ToggleButton; private constructor(); @@ -1819,43 +1204,6 @@ declare namespace MSForms { WordWrap: boolean; } - class ToggleButton2 { - private 'MSForms.ToggleButton2_typekey': ToggleButton2; - private constructor(); - readonly _Font_Reserved: NewFont; - Accelerator: string; - Alignment: fmAlignment; - AutoSize: boolean; - BackColor: number; - BackStyle: fmBackStyle; - BordersSuppress: boolean; - Caption: string; - readonly DisplayStyle: fmDisplayStyle; - Enabled: boolean; - Font: NewFont; - FontBold: boolean; - FontItalic: boolean; - FontName: string; - FontSize: number; - FontStrikethru: boolean; - FontUnderline: boolean; - FontWeight: number; - ForeColor: number; - GroupName: string; - Locked: boolean; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - MultiSelect: fmMultiSelect; - Picture: stdole.StdPicture; - PicturePosition: fmPicturePosition; - SpecialEffect: fmButtonEffect; - TextAlign: fmTextAlign; - TripleState: boolean; - readonly Valid: boolean; - Value: any; - WordWrap: boolean; - } - class UserForm { private 'MSForms.UserForm_typekey': UserForm; private constructor(); @@ -1922,160 +1270,18 @@ declare namespace MSForms { Zoom: number; } - class UserForm2 { - private 'MSForms.UserForm2_typekey': UserForm2; - private constructor(); - readonly _Font_Reserved: NewFont; - _GetGridX(GridX: number): void; - _GetGridY(GridY: number): void; - _GetInsideHeight(InsideHeight: number): void; - _GetInsideWidth(InsideWidth: number): void; - _GetScrollHeight(ScrollHeight: number): void; - _GetScrollLeft(ScrollLeft: number): void; - _GetScrollTop(ScrollTop: number): void; - _GetScrollWidth(ScrollWidth: number): void; - _SetGridX(GridX: number): void; - _SetGridY(GridY: number): void; - _SetScrollHeight(ScrollHeight: number): void; - _SetScrollLeft(ScrollLeft: number): void; - _SetScrollTop(ScrollTop: number): void; - _SetScrollWidth(ScrollWidth: number): void; - readonly ActiveControl: Control; - BackColor: number; - BorderColor: number; - BorderStyle: fmBorderStyle; - readonly CanPaste: boolean; - readonly CanRedo: boolean; - readonly CanUndo: boolean; - Caption: string; - readonly Controls: Controls; - Copy(): void; - Cut(): void; - Cycle: fmCycle; - DesignMode: fmMode; - DrawBuffer: number; - Enabled: boolean; - Font: NewFont; - ForeColor: number; - GridX: number; - GridY: number; - readonly InsideHeight: number; - readonly InsideWidth: number; - KeepScrollBarsVisible: fmScrollBars; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - Paste(): void; - Picture: stdole.StdPicture; - PictureAlignment: fmPictureAlignment; - PictureSizeMode: fmPictureSizeMode; - PictureTiling: boolean; - RedoAction(): void; - Repaint(): void; - Scroll(xAction?: any, yAction?: any): void; - ScrollBars: fmScrollBars; - ScrollHeight: number; - ScrollLeft: number; - ScrollTop: number; - ScrollWidth: number; - readonly Selected: Controls; - SetDefaultTabOrder(): void; - ShowGridDots: fmMode; - ShowToolbox: fmMode; - SnapToGrid: fmMode; - SpecialEffect: fmSpecialEffect; - UndoAction(): void; - VerticalScrollBarSide: fmVerticalScrollBarSide; - Zoom: number; - } - namespace EventHelperTypes { - type CheckBox_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; + type Container_BeforeDragOver_ArgNames = ['Cancel', 'Control', 'Data', 'X', 'Y', 'State', 'Effect', 'Shift']; - type CheckBox_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; + type Container_BeforeDropOrPaste_ArgNames = ['Cancel', 'Control', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - type CheckBox_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; + type Container_Scroll_ArgNames = ['ActionX', 'ActionY', 'RequestDx', 'RequestDy', 'ActualDx', 'ActualDy']; - type CheckBox2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; + type Control_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - type CheckBox2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; + type Control_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - type CheckBox2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type ComboBox_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type ComboBox_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type ComboBox_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type ComboBox2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type ComboBox2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type ComboBox2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type CommandButton_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type CommandButton_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type CommandButton_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type CommandButton2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type CommandButton2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type CommandButton2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type Frame_BeforeDragOver_ArgNames = ['Cancel', 'Control', 'Data', 'X', 'Y', 'State', 'Effect', 'Shift']; - - type Frame_BeforeDropOrPaste_ArgNames = ['Cancel', 'Control', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type Frame_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type Frame_Scroll_ArgNames = ['ActionX', 'ActionY', 'RequestDx', 'RequestDy', 'ActualDx', 'ActualDy']; - - type Frame2_BeforeDragOver_ArgNames = ['Cancel', 'Control', 'Data', 'X', 'Y', 'State', 'Effect', 'Shift']; - - type Frame2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Control', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type Frame2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type Frame2_Scroll_ArgNames = ['ActionX', 'ActionY', 'RequestDx', 'RequestDy', 'ActualDx', 'ActualDy']; - - type Image_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type Image_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type Image_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type Image2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type Image2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type Image2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type Label_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type Label_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type Label_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type Label2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type Label2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type Label2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type ListBox_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type ListBox_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type ListBox_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type ListBox2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type ListBox2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type ListBox2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; + type Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; type MultiPage_BeforeDragOver_ArgNames = ['Index', 'Cancel', 'Control', 'Data', 'X', 'Y', 'State', 'Effect', 'Shift']; @@ -2085,283 +1291,11 @@ declare namespace MSForms { type MultiPage_Scroll_ArgNames = ['Index', 'ActionX', 'ActionY', 'RequestDx', 'RequestDy', 'ActualDx', 'ActualDy']; - type MultiPage2_BeforeDragOver_ArgNames = ['Index', 'Cancel', 'Control', 'Data', 'X', 'Y', 'State', 'Effect', 'Shift']; - - type MultiPage2_BeforeDropOrPaste_ArgNames = ['Index', 'Cancel', 'Control', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type MultiPage2_Error_ArgNames = ['Index', 'Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type MultiPage2_Scroll_ArgNames = ['Index', 'ActionX', 'ActionY', 'RequestDx', 'RequestDy', 'ActualDx', 'ActualDy']; - - type OptionButton_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type OptionButton_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type OptionButton_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type OptionButton2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type OptionButton2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type OptionButton2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type ScrollBar_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type ScrollBar_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type ScrollBar_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type ScrollBar2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type ScrollBar2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type ScrollBar2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type SpinButton_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type SpinButton_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type SpinButton_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type SpinButton2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type SpinButton2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type SpinButton2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - type TabStrip_BeforeDragOver_ArgNames = ['Index', 'Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; type TabStrip_BeforeDropOrPaste_ArgNames = ['Index', 'Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - type TabStrip_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type TabStrip2_BeforeDragOver_ArgNames = ['Index', 'Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type TabStrip2_BeforeDropOrPaste_ArgNames = ['Index', 'Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type TabStrip2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type TextBox_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type TextBox_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type TextBox_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type TextBox2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type TextBox2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type TextBox2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type ToggleButton_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type ToggleButton_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type ToggleButton_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type ToggleButton2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type ToggleButton2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type ToggleButton2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type UserForm_BeforeDragOver_ArgNames = ['Cancel', 'Control', 'Data', 'X', 'Y', 'State', 'Effect', 'Shift']; - - type UserForm_BeforeDropOrPaste_ArgNames = ['Cancel', 'Control', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type UserForm_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type UserForm_Scroll_ArgNames = ['ActionX', 'ActionY', 'RequestDx', 'RequestDy', 'ActualDx', 'ActualDy']; - - type UserForm2_BeforeDragOver_ArgNames = ['Cancel', 'Control', 'Data', 'X', 'Y', 'State', 'Effect', 'Shift']; - - type UserForm2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Control', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type UserForm2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type UserForm2_Scroll_ArgNames = ['ActionX', 'ActionY', 'RequestDx', 'RequestDy', 'ActualDx', 'ActualDy']; - - interface CheckBox_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface CheckBox_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface CheckBox_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface CheckBox2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface CheckBox2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface CheckBox2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface ComboBox_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ComboBox_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ComboBox_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface ComboBox2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ComboBox2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ComboBox2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface CommandButton_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface CommandButton_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface CommandButton_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface CommandButton2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface CommandButton2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface CommandButton2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface Frame_BeforeDragOver_Parameter { + interface Container_BeforeDragOver_Parameter { readonly Cancel: ReturnBoolean; readonly Control: Control; readonly Data: DataObject; @@ -2372,7 +1306,7 @@ declare namespace MSForms { readonly Y: number; } - interface Frame_BeforeDropOrPaste_Parameter { + interface Container_BeforeDropOrPaste_Parameter { readonly Action: fmAction; readonly Cancel: ReturnBoolean; readonly Control: Control; @@ -2383,17 +1317,7 @@ declare namespace MSForms { readonly Y: number; } - interface Frame_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface Frame_Scroll_Parameter { + interface Container_Scroll_Parameter { readonly ActionX: fmScrollAction; readonly ActionY: fmScrollAction; readonly ActualDx: ReturnSingle; @@ -2402,48 +1326,7 @@ declare namespace MSForms { readonly RequestDy: number; } - interface Frame2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Control: Control; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly State: fmDragState; - readonly X: number; - readonly Y: number; - } - - interface Frame2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Control: Control; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface Frame2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface Frame2_Scroll_Parameter { - readonly ActionX: fmScrollAction; - readonly ActionY: fmScrollAction; - readonly ActualDx: ReturnSingle; - readonly ActualDy: ReturnSingle; - readonly RequestDx: number; - readonly RequestDy: number; - } - - interface Image_BeforeDragOver_Parameter { + interface Control_BeforeDragOver_Parameter { readonly Cancel: ReturnBoolean; readonly Data: DataObject; readonly DragState: fmDragState; @@ -2453,7 +1336,7 @@ declare namespace MSForms { readonly Y: number; } - interface Image_BeforeDropOrPaste_Parameter { + interface Control_BeforeDropOrPaste_Parameter { readonly Action: fmAction; readonly Cancel: ReturnBoolean; readonly Data: DataObject; @@ -2463,157 +1346,7 @@ declare namespace MSForms { readonly Y: number; } - interface Image_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface Image2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface Image2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface Image2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface Label_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface Label_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface Label_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface Label2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface Label2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface Label2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface ListBox_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ListBox_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ListBox_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface ListBox2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ListBox2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ListBox2_Error_Parameter { + interface Error_Parameter { readonly CancelDisplay: ReturnBoolean; readonly Description: ReturnString; readonly HelpContext: number; @@ -2668,231 +1401,6 @@ declare namespace MSForms { readonly RequestDy: number; } - interface MultiPage2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Control: Control; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Index: number; - readonly Shift: number; - readonly State: fmDragState; - readonly X: number; - readonly Y: number; - } - - interface MultiPage2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Control: Control; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Index: number; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface MultiPage2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Index: number; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface MultiPage2_Scroll_Parameter { - readonly ActionX: fmScrollAction; - readonly ActionY: fmScrollAction; - readonly ActualDx: ReturnSingle; - readonly ActualDy: ReturnSingle; - readonly Index: number; - readonly RequestDx: number; - readonly RequestDy: number; - } - - interface OptionButton_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface OptionButton_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface OptionButton_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface OptionButton2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface OptionButton2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface OptionButton2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface ScrollBar_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ScrollBar_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ScrollBar_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface ScrollBar2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ScrollBar2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ScrollBar2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface SpinButton_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface SpinButton_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface SpinButton_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface SpinButton2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface SpinButton2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface SpinButton2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - interface TabStrip_BeforeDragOver_Parameter { readonly Cancel: ReturnBoolean; readonly Data: DataObject; @@ -2914,844 +1422,151 @@ declare namespace MSForms { readonly X: number; readonly Y: number; } - - interface TabStrip_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface TabStrip2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Index: number; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface TabStrip2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Index: number; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface TabStrip2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface TextBox_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface TextBox_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface TextBox_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface TextBox2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface TextBox2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface TextBox2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface ToggleButton_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ToggleButton_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ToggleButton_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface ToggleButton2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ToggleButton2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ToggleButton2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface UserForm_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Control: Control; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly State: fmDragState; - readonly X: number; - readonly Y: number; - } - - interface UserForm_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Control: Control; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface UserForm_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface UserForm_Scroll_Parameter { - readonly ActionX: fmScrollAction; - readonly ActionY: fmScrollAction; - readonly ActualDx: ReturnSingle; - readonly ActualDy: ReturnSingle; - readonly RequestDx: number; - readonly RequestDy: number; - } - - interface UserForm2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Control: Control; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly State: fmDragState; - readonly X: number; - readonly Y: number; - } - - interface UserForm2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Control: Control; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface UserForm2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface UserForm2_Scroll_Parameter { - readonly ActionX: fmScrollAction; - readonly ActionY: fmScrollAction; - readonly ActualDx: ReturnSingle; - readonly ActualDy: ReturnSingle; - readonly RequestDx: number; - readonly RequestDy: number; - } } } interface ActiveXObject { - on( - obj: MSForms.CheckBox, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.CheckBox_BeforeDragOver_ArgNames, handler: ( - this: MSForms.CheckBox, parameter: MSForms.EventHelperTypes.CheckBox_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.CheckBox, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.CheckBox_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.CheckBox, parameter: MSForms.EventHelperTypes.CheckBox_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.CheckBox, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.CheckBox, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.CheckBox, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.CheckBox, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.CheckBox, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.CheckBox, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.CheckBox, event: 'Error', argNames: MSForms.EventHelperTypes.CheckBox_Error_ArgNames, handler: ( - this: MSForms.CheckBox, parameter: MSForms.EventHelperTypes.CheckBox_Error_Parameter) => void): void; - on( - obj: MSForms.CheckBox, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.CheckBox, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.CheckBox, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.CheckBox, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.CheckBox, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.CheckBox, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.CheckBox, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.CheckBox, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.CheckBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.CheckBox, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.CheckBox2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.CheckBox2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.CheckBox2, parameter: MSForms.EventHelperTypes.CheckBox2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.CheckBox2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.CheckBox2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.CheckBox2, parameter: MSForms.EventHelperTypes.CheckBox2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.CheckBox2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.CheckBox2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.CheckBox2, event: 'Error', argNames: MSForms.EventHelperTypes.CheckBox2_Error_ArgNames, handler: ( - this: MSForms.CheckBox2, parameter: MSForms.EventHelperTypes.CheckBox2_Error_Parameter) => void): void; - on( - obj: MSForms.CheckBox2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.CheckBox2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.CheckBox2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.CheckBox2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.CheckBox2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.CheckBox2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.ComboBox, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.ComboBox_BeforeDragOver_ArgNames, handler: ( - this: MSForms.ComboBox, parameter: MSForms.EventHelperTypes.ComboBox_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.ComboBox, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.ComboBox_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.ComboBox, parameter: MSForms.EventHelperTypes.ComboBox_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.CheckBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.CheckBox, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; + on(obj: MSForms.ComboBox, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.ComboBox, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.ComboBox, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.ComboBox, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.ComboBox, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.ComboBox, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.ComboBox, event: 'Error', argNames: MSForms.EventHelperTypes.ComboBox_Error_ArgNames, handler: ( - this: MSForms.ComboBox, parameter: MSForms.EventHelperTypes.ComboBox_Error_Parameter) => void): void; - on( - obj: MSForms.ComboBox, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.ComboBox, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.ComboBox, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.ComboBox, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.ComboBox, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.ComboBox, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.ComboBox, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.ComboBox, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.ComboBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.ComboBox, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.ComboBox2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.ComboBox2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.ComboBox2, parameter: MSForms.EventHelperTypes.ComboBox2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.ComboBox2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.ComboBox2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.ComboBox2, parameter: MSForms.EventHelperTypes.ComboBox2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.ComboBox2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.ComboBox2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.ComboBox2, event: 'Error', argNames: MSForms.EventHelperTypes.ComboBox2_Error_ArgNames, handler: ( - this: MSForms.ComboBox2, parameter: MSForms.EventHelperTypes.ComboBox2_Error_Parameter) => void): void; - on( - obj: MSForms.ComboBox2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.ComboBox2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.ComboBox2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.ComboBox2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.ComboBox2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.ComboBox2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.CommandButton, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.CommandButton_BeforeDragOver_ArgNames, - handler: (this: MSForms.CommandButton, parameter: MSForms.EventHelperTypes.CommandButton_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.CommandButton, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.CommandButton_BeforeDropOrPaste_ArgNames, - handler: (this: MSForms.CommandButton, parameter: MSForms.EventHelperTypes.CommandButton_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.ComboBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.ComboBox, parameter: { readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number }) => void): void; + on(obj: MSForms.CommandButton, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.CommandButton, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.CommandButton, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.CommandButton, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.CommandButton, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.CommandButton, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.CommandButton, event: 'Error', argNames: MSForms.EventHelperTypes.CommandButton_Error_ArgNames, handler: ( - this: MSForms.CommandButton, parameter: MSForms.EventHelperTypes.CommandButton_Error_Parameter) => void): void; - on( - obj: MSForms.CommandButton, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.CommandButton, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.CommandButton, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.CommandButton, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.CommandButton, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.CommandButton, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.CommandButton, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.CommandButton, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.CommandButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.CommandButton, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.CommandButton2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.CommandButton2_BeforeDragOver_ArgNames, - handler: (this: MSForms.CommandButton2, parameter: MSForms.EventHelperTypes.CommandButton2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.CommandButton2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.CommandButton2_BeforeDropOrPaste_ArgNames, - handler: (this: MSForms.CommandButton2, parameter: MSForms.EventHelperTypes.CommandButton2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.CommandButton2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.CommandButton2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.CommandButton2, event: 'Error', argNames: MSForms.EventHelperTypes.CommandButton2_Error_ArgNames, handler: ( - this: MSForms.CommandButton2, parameter: MSForms.EventHelperTypes.CommandButton2_Error_Parameter) => void): void; - on( - obj: MSForms.CommandButton2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.CommandButton2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.CommandButton2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.CommandButton2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.CommandButton2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.CommandButton2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on(obj: MSForms.Control, event: 'BeforeUpdate' | 'Exit', argNames: ['Cancel'], handler: (this: MSForms.Control, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; + on(obj: MSForms.CommandButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.CommandButton, parameter: { readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number }) => void): void; + on(obj: MSForms.Control, event: 'BeforeUpdate' | 'Exit', argNames: ['Cancel'], handler: (this: MSForms.Control, parameter: { readonly Cancel: MSForms.ReturnBoolean }) => void): void; on(obj: MSForms.Frame, event: 'AddControl' | 'RemoveControl', argNames: ['Control'], handler: (this: MSForms.Frame, parameter: {readonly Control: MSForms.Control}) => void): void; - on( - obj: MSForms.Frame, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Frame_BeforeDragOver_ArgNames, handler: ( - this: MSForms.Frame, parameter: MSForms.EventHelperTypes.Frame_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.Frame, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Frame_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.Frame, parameter: MSForms.EventHelperTypes.Frame_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.Frame, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Container_BeforeDragOver_ArgNames, handler: (this: MSForms.Frame, parameter: MSForms.EventHelperTypes.Container_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.Frame, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Container_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.Frame, parameter: MSForms.EventHelperTypes.Container_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.Frame, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.Frame, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.Frame, event: 'Error', argNames: MSForms.EventHelperTypes.Frame_Error_ArgNames, handler: ( - this: MSForms.Frame, parameter: MSForms.EventHelperTypes.Frame_Error_Parameter) => void): void; - on( - obj: MSForms.Frame, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.Frame, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.Frame, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.Frame, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.Frame, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.Frame, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.Frame, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.Frame, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.Frame, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.Frame, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.Frame, event: 'Scroll', argNames: MSForms.EventHelperTypes.Frame_Scroll_ArgNames, handler: ( - this: MSForms.Frame, parameter: MSForms.EventHelperTypes.Frame_Scroll_Parameter) => void): void; - on(obj: MSForms.Frame, event: 'Zoom', argNames: ['Percent'], handler: (this: MSForms.Frame, parameter: {Percent: number}) => void): void; - on(obj: MSForms.Frame2, event: 'AddControl' | 'RemoveControl', argNames: ['Control'], handler: (this: MSForms.Frame2, parameter: {readonly Control: MSForms.Control}) => void): void; - on( - obj: MSForms.Frame2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Frame2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.Frame2, parameter: MSForms.EventHelperTypes.Frame2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.Frame2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Frame2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.Frame2, parameter: MSForms.EventHelperTypes.Frame2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.Frame2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.Frame2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.Frame2, event: 'Error', argNames: MSForms.EventHelperTypes.Frame2_Error_ArgNames, handler: ( - this: MSForms.Frame2, parameter: MSForms.EventHelperTypes.Frame2_Error_Parameter) => void): void; - on( - obj: MSForms.Frame2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.Frame2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.Frame2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.Frame2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.Frame2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.Frame2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.Frame2, event: 'Scroll', argNames: MSForms.EventHelperTypes.Frame2_Scroll_ArgNames, handler: ( - this: MSForms.Frame2, parameter: MSForms.EventHelperTypes.Frame2_Scroll_Parameter) => void): void; - on(obj: MSForms.Frame2, event: 'Zoom', argNames: ['Percent'], handler: (this: MSForms.Frame2, parameter: {Percent: number}) => void): void; - on( - obj: MSForms.Image, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Image_BeforeDragOver_ArgNames, handler: ( - this: MSForms.Image, parameter: MSForms.EventHelperTypes.Image_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.Image, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Image_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.Image, parameter: MSForms.EventHelperTypes.Image_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.Frame, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.Frame, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; + on(obj: MSForms.Frame, event: 'Scroll', argNames: MSForms.EventHelperTypes.Container_Scroll_ArgNames, handler: (this: MSForms.Frame, parameter: MSForms.EventHelperTypes.Container_Scroll_Parameter) => void): void; + on(obj: MSForms.Frame, event: 'Zoom', argNames: ['Percent'], handler: (this: MSForms.Frame, parameter: { Percent: number }) => void): void; + on(obj: MSForms.Image, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.Image, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.Image, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.Image, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.Image, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.Image, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.Image, event: 'Error', argNames: MSForms.EventHelperTypes.Image_Error_ArgNames, handler: ( - this: MSForms.Image, parameter: MSForms.EventHelperTypes.Image_Error_Parameter) => void): void; - on( - obj: MSForms.Image, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.Image, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.Image2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Image2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.Image2, parameter: MSForms.EventHelperTypes.Image2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.Image2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Image2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.Image2, parameter: MSForms.EventHelperTypes.Image2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.Image2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.Image2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.Image2, event: 'Error', argNames: MSForms.EventHelperTypes.Image2_Error_ArgNames, handler: ( - this: MSForms.Image2, parameter: MSForms.EventHelperTypes.Image2_Error_Parameter) => void): void; - on( - obj: MSForms.Image2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.Image2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.Label, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Label_BeforeDragOver_ArgNames, handler: ( - this: MSForms.Label, parameter: MSForms.EventHelperTypes.Label_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.Label, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Label_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.Label, parameter: MSForms.EventHelperTypes.Label_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.Image, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.Image, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.Image, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.Image, parameter: { readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number }) => void): void; + on(obj: MSForms.Label, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.Label, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.Label, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.Label, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.Label, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.Label, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.Label, event: 'Error', argNames: MSForms.EventHelperTypes.Label_Error_ArgNames, handler: ( - this: MSForms.Label, parameter: MSForms.EventHelperTypes.Label_Error_Parameter) => void): void; - on( - obj: MSForms.Label, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.Label, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.Label2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Label2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.Label2, parameter: MSForms.EventHelperTypes.Label2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.Label2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Label2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.Label2, parameter: MSForms.EventHelperTypes.Label2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.Label2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.Label2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.Label2, event: 'Error', argNames: MSForms.EventHelperTypes.Label2_Error_ArgNames, handler: ( - this: MSForms.Label2, parameter: MSForms.EventHelperTypes.Label2_Error_Parameter) => void): void; - on( - obj: MSForms.Label2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.Label2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.ListBox, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.ListBox_BeforeDragOver_ArgNames, handler: ( - this: MSForms.ListBox, parameter: MSForms.EventHelperTypes.ListBox_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.ListBox, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.ListBox_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.ListBox, parameter: MSForms.EventHelperTypes.ListBox_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.Label, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.Label, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.Label, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.Label, parameter: { readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number }) => void): void; + on(obj: MSForms.ListBox, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.ListBox, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.ListBox, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.ListBox, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.ListBox, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.ListBox, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.ListBox, event: 'Error', argNames: MSForms.EventHelperTypes.ListBox_Error_ArgNames, handler: ( - this: MSForms.ListBox, parameter: MSForms.EventHelperTypes.ListBox_Error_Parameter) => void): void; - on( - obj: MSForms.ListBox, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.ListBox, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.ListBox, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.ListBox, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.ListBox, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.ListBox, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.ListBox, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.ListBox, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.ListBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.ListBox, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.ListBox2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.ListBox2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.ListBox2, parameter: MSForms.EventHelperTypes.ListBox2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.ListBox2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.ListBox2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.ListBox2, parameter: MSForms.EventHelperTypes.ListBox2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.ListBox2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.ListBox2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.ListBox2, event: 'Error', argNames: MSForms.EventHelperTypes.ListBox2_Error_ArgNames, handler: ( - this: MSForms.ListBox2, parameter: MSForms.EventHelperTypes.ListBox2_Error_Parameter) => void): void; - on( - obj: MSForms.ListBox2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.ListBox2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.ListBox2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.ListBox2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.ListBox2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.ListBox2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.MultiPage, event: 'AddControl' | 'RemoveControl', argNames: ['Index', 'Control'], handler: ( - this: MSForms.MultiPage, parameter: {readonly Index: number, readonly Control: MSForms.Control}) => void): void; - on( - obj: MSForms.MultiPage, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.MultiPage_BeforeDragOver_ArgNames, handler: ( - this: MSForms.MultiPage, parameter: MSForms.EventHelperTypes.MultiPage_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.MultiPage, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.MultiPage_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.MultiPage, parameter: MSForms.EventHelperTypes.MultiPage_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.ListBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.ListBox, parameter: { readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number }) => void): void; + on(obj: MSForms.MultiPage, event: 'AddControl' | 'RemoveControl', argNames: ['Index', 'Control'], handler: (this: MSForms.MultiPage, parameter: {readonly Index: number, readonly Control: MSForms.Control}) => void): void; + on(obj: MSForms.MultiPage, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.MultiPage_BeforeDragOver_ArgNames, handler: (this: MSForms.MultiPage, parameter: MSForms.EventHelperTypes.MultiPage_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.MultiPage, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.MultiPage_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.MultiPage, parameter: MSForms.EventHelperTypes.MultiPage_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.MultiPage, event: 'Click' | 'Layout', argNames: ['Index'], handler: (this: MSForms.MultiPage, parameter: {readonly Index: number}) => void): void; - on( - obj: MSForms.MultiPage, event: 'DblClick', argNames: ['Index', 'Cancel'], handler: ( - this: MSForms.MultiPage, parameter: {readonly Index: number, readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.MultiPage, event: 'Error', argNames: MSForms.EventHelperTypes.MultiPage_Error_ArgNames, handler: ( - this: MSForms.MultiPage, parameter: MSForms.EventHelperTypes.MultiPage_Error_Parameter) => void): void; - on( - obj: MSForms.MultiPage, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.MultiPage, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.MultiPage, event: 'DblClick', argNames: ['Index', 'Cancel'], handler: (this: MSForms.MultiPage, parameter: {readonly Index: number, readonly Cancel: MSForms.ReturnBoolean}) => void): void; + on(obj: MSForms.MultiPage, event: 'Error', argNames: MSForms.EventHelperTypes.MultiPage_Error_ArgNames, handler: (this: MSForms.MultiPage, parameter: MSForms.EventHelperTypes.MultiPage_Error_Parameter) => void): void; + on(obj: MSForms.MultiPage, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.MultiPage, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.MultiPage, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.MultiPage, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.MultiPage, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Index', 'Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.MultiPage, parameter: {readonly Index: number, readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.MultiPage, event: 'Scroll', argNames: MSForms.EventHelperTypes.MultiPage_Scroll_ArgNames, handler: ( - this: MSForms.MultiPage, parameter: MSForms.EventHelperTypes.MultiPage_Scroll_Parameter) => void): void; - on(obj: MSForms.MultiPage, event: 'Zoom', argNames: ['Index', 'Percent'], handler: (this: MSForms.MultiPage, parameter: {readonly Index: number, Percent: number}) => void): void; - on( - obj: MSForms.MultiPage2, event: 'AddControl' | 'RemoveControl', argNames: ['Index', 'Control'], handler: ( - this: MSForms.MultiPage2, parameter: {readonly Index: number, readonly Control: MSForms.Control}) => void): void; - on( - obj: MSForms.MultiPage2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.MultiPage2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.MultiPage2, parameter: MSForms.EventHelperTypes.MultiPage2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.MultiPage2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.MultiPage2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.MultiPage2, parameter: MSForms.EventHelperTypes.MultiPage2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.MultiPage2, event: 'Click' | 'Layout', argNames: ['Index'], handler: (this: MSForms.MultiPage2, parameter: {readonly Index: number}) => void): void; - on( - obj: MSForms.MultiPage2, event: 'DblClick', argNames: ['Index', 'Cancel'], handler: ( - this: MSForms.MultiPage2, parameter: {readonly Index: number, readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.MultiPage2, event: 'Error', argNames: MSForms.EventHelperTypes.MultiPage2_Error_ArgNames, handler: ( - this: MSForms.MultiPage2, parameter: MSForms.EventHelperTypes.MultiPage2_Error_Parameter) => void): void; - on( - obj: MSForms.MultiPage2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.MultiPage2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.MultiPage2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.MultiPage2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.MultiPage2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Index', 'Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.MultiPage2, parameter: {readonly Index: number, readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.MultiPage2, event: 'Scroll', argNames: MSForms.EventHelperTypes.MultiPage2_Scroll_ArgNames, handler: ( - this: MSForms.MultiPage2, parameter: MSForms.EventHelperTypes.MultiPage2_Scroll_Parameter) => void): void; - on(obj: MSForms.MultiPage2, event: 'Zoom', argNames: ['Index', 'Percent'], handler: (this: MSForms.MultiPage2, parameter: {readonly Index: number, Percent: number}) => void): void; - on( - obj: MSForms.OptionButton, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.OptionButton_BeforeDragOver_ArgNames, handler: ( - this: MSForms.OptionButton, parameter: MSForms.EventHelperTypes.OptionButton_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.OptionButton, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.OptionButton_BeforeDropOrPaste_ArgNames, - handler: (this: MSForms.OptionButton, parameter: MSForms.EventHelperTypes.OptionButton_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.MultiPage, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Index', 'Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.MultiPage, parameter: {readonly Index: number, readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; + on(obj: MSForms.MultiPage, event: 'Scroll', argNames: MSForms.EventHelperTypes.MultiPage_Scroll_ArgNames, handler: (this: MSForms.MultiPage, parameter: MSForms.EventHelperTypes.MultiPage_Scroll_Parameter) => void): void; + on(obj: MSForms.MultiPage, event: 'Zoom', argNames: ['Index', 'Percent'], handler: (this: MSForms.MultiPage, parameter: { readonly Index: number, Percent: number }) => void): void; + on(obj: MSForms.OptionButton, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.OptionButton, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.OptionButton, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.OptionButton, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.OptionButton, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.OptionButton, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.OptionButton, event: 'Error', argNames: MSForms.EventHelperTypes.OptionButton_Error_ArgNames, handler: ( - this: MSForms.OptionButton, parameter: MSForms.EventHelperTypes.OptionButton_Error_Parameter) => void): void; - on( - obj: MSForms.OptionButton, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.OptionButton, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.OptionButton, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.OptionButton, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.OptionButton, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.OptionButton, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.OptionButton, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.OptionButton, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.OptionButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.OptionButton, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.OptionButton2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.OptionButton2_BeforeDragOver_ArgNames, - handler: (this: MSForms.OptionButton2, parameter: MSForms.EventHelperTypes.OptionButton2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.OptionButton2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.OptionButton2_BeforeDropOrPaste_ArgNames, - handler: (this: MSForms.OptionButton2, parameter: MSForms.EventHelperTypes.OptionButton2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.OptionButton2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.OptionButton2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.OptionButton2, event: 'Error', argNames: MSForms.EventHelperTypes.OptionButton2_Error_ArgNames, handler: ( - this: MSForms.OptionButton2, parameter: MSForms.EventHelperTypes.OptionButton2_Error_Parameter) => void): void; - on( - obj: MSForms.OptionButton2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.OptionButton2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.OptionButton2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.OptionButton2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.OptionButton2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.OptionButton2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.ScrollBar, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.ScrollBar_BeforeDragOver_ArgNames, handler: ( - this: MSForms.ScrollBar, parameter: MSForms.EventHelperTypes.ScrollBar_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.ScrollBar, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.ScrollBar_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.ScrollBar, parameter: MSForms.EventHelperTypes.ScrollBar_BeforeDropOrPaste_Parameter) => void): void; - on( - obj: MSForms.ScrollBar, event: 'Error', argNames: MSForms.EventHelperTypes.ScrollBar_Error_ArgNames, handler: ( - this: MSForms.ScrollBar, parameter: MSForms.EventHelperTypes.ScrollBar_Error_Parameter) => void): void; - on( - obj: MSForms.ScrollBar, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.ScrollBar, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.ScrollBar, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.ScrollBar, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.ScrollBar2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.ScrollBar2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.ScrollBar2, parameter: MSForms.EventHelperTypes.ScrollBar2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.ScrollBar2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.ScrollBar2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.ScrollBar2, parameter: MSForms.EventHelperTypes.ScrollBar2_BeforeDropOrPaste_Parameter) => void): void; - on( - obj: MSForms.ScrollBar2, event: 'Error', argNames: MSForms.EventHelperTypes.ScrollBar2_Error_ArgNames, handler: ( - this: MSForms.ScrollBar2, parameter: MSForms.EventHelperTypes.ScrollBar2_Error_Parameter) => void): void; - on( - obj: MSForms.ScrollBar2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.ScrollBar2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.ScrollBar2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.ScrollBar2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.SpinButton, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.SpinButton_BeforeDragOver_ArgNames, handler: ( - this: MSForms.SpinButton, parameter: MSForms.EventHelperTypes.SpinButton_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.SpinButton, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.SpinButton_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.SpinButton, parameter: MSForms.EventHelperTypes.SpinButton_BeforeDropOrPaste_Parameter) => void): void; - on( - obj: MSForms.SpinButton, event: 'Error', argNames: MSForms.EventHelperTypes.SpinButton_Error_ArgNames, handler: ( - this: MSForms.SpinButton, parameter: MSForms.EventHelperTypes.SpinButton_Error_Parameter) => void): void; - on( - obj: MSForms.SpinButton, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.SpinButton, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.OptionButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.OptionButton, parameter: { readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number }) => void): void; + on(obj: MSForms.ScrollBar, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.ScrollBar, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.ScrollBar, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.ScrollBar, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.ScrollBar, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.ScrollBar, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.ScrollBar, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.ScrollBar, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.ScrollBar, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.ScrollBar, parameter: { readonly KeyAscii: MSForms.ReturnInteger }) => void): void; + on(obj: MSForms.SpinButton, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.SpinButton, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.SpinButton, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.SpinButton, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.SpinButton, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.SpinButton, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.SpinButton, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.SpinButton, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.SpinButton, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.SpinButton, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.SpinButton2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.SpinButton2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.SpinButton2, parameter: MSForms.EventHelperTypes.SpinButton2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.SpinButton2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.SpinButton2_BeforeDropOrPaste_ArgNames, - handler: (this: MSForms.SpinButton2, parameter: MSForms.EventHelperTypes.SpinButton2_BeforeDropOrPaste_Parameter) => void): void; - on( - obj: MSForms.SpinButton2, event: 'Error', argNames: MSForms.EventHelperTypes.SpinButton2_Error_ArgNames, handler: ( - this: MSForms.SpinButton2, parameter: MSForms.EventHelperTypes.SpinButton2_Error_Parameter) => void): void; - on( - obj: MSForms.SpinButton2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.SpinButton2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.SpinButton2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.SpinButton2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.TabStrip, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.TabStrip_BeforeDragOver_ArgNames, handler: ( - this: MSForms.TabStrip, parameter: MSForms.EventHelperTypes.TabStrip_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.TabStrip, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.TabStrip_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.TabStrip, parameter: MSForms.EventHelperTypes.TabStrip_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.TabStrip, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.TabStrip_BeforeDragOver_ArgNames, handler: (this: MSForms.TabStrip, parameter: MSForms.EventHelperTypes.TabStrip_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.TabStrip, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.TabStrip_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.TabStrip, parameter: MSForms.EventHelperTypes.TabStrip_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.TabStrip, event: 'Click', argNames: ['Index'], handler: (this: MSForms.TabStrip, parameter: {readonly Index: number}) => void): void; - on( - obj: MSForms.TabStrip, event: 'DblClick', argNames: ['Index', 'Cancel'], handler: ( - this: MSForms.TabStrip, parameter: {readonly Index: number, readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.TabStrip, event: 'Error', argNames: MSForms.EventHelperTypes.TabStrip_Error_ArgNames, handler: ( - this: MSForms.TabStrip, parameter: MSForms.EventHelperTypes.TabStrip_Error_Parameter) => void): void; - on( - obj: MSForms.TabStrip, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.TabStrip, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.TabStrip, event: 'DblClick', argNames: ['Index', 'Cancel'], handler: (this: MSForms.TabStrip, parameter: {readonly Index: number, readonly Cancel: MSForms.ReturnBoolean}) => void): void; + on(obj: MSForms.TabStrip, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.TabStrip, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.TabStrip, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.TabStrip, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.TabStrip, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.TabStrip, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.TabStrip, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Index', 'Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.TabStrip, parameter: {readonly Index: number, readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.TabStrip2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.TabStrip2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.TabStrip2, parameter: MSForms.EventHelperTypes.TabStrip2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.TabStrip2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.TabStrip2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.TabStrip2, parameter: MSForms.EventHelperTypes.TabStrip2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.TabStrip2, event: 'Click', argNames: ['Index'], handler: (this: MSForms.TabStrip2, parameter: {readonly Index: number}) => void): void; - on( - obj: MSForms.TabStrip2, event: 'DblClick', argNames: ['Index', 'Cancel'], handler: ( - this: MSForms.TabStrip2, parameter: {readonly Index: number, readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.TabStrip2, event: 'Error', argNames: MSForms.EventHelperTypes.TabStrip2_Error_ArgNames, handler: ( - this: MSForms.TabStrip2, parameter: MSForms.EventHelperTypes.TabStrip2_Error_Parameter) => void): void; - on( - obj: MSForms.TabStrip2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.TabStrip2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.TabStrip2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.TabStrip2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.TabStrip2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Index', 'Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.TabStrip2, parameter: {readonly Index: number, readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.TextBox, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.TextBox_BeforeDragOver_ArgNames, handler: ( - this: MSForms.TextBox, parameter: MSForms.EventHelperTypes.TextBox_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.TextBox, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.TextBox_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.TextBox, parameter: MSForms.EventHelperTypes.TextBox_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.TabStrip, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Index', 'Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.TabStrip, parameter: { readonly Index: number, readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number }) => void): void; + on(obj: MSForms.TextBox, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.TextBox, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.TextBox, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.TextBox, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.TextBox, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.TextBox, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.TextBox, event: 'Error', argNames: MSForms.EventHelperTypes.TextBox_Error_ArgNames, handler: ( - this: MSForms.TextBox, parameter: MSForms.EventHelperTypes.TextBox_Error_Parameter) => void): void; - on( - obj: MSForms.TextBox, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.TextBox, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.TextBox, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.TextBox, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.TextBox, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.TextBox, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.TextBox, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.TextBox, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.TextBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.TextBox, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.TextBox2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.TextBox2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.TextBox2, parameter: MSForms.EventHelperTypes.TextBox2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.TextBox2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.TextBox2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.TextBox2, parameter: MSForms.EventHelperTypes.TextBox2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.TextBox2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.TextBox2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.TextBox2, event: 'Error', argNames: MSForms.EventHelperTypes.TextBox2_Error_ArgNames, handler: ( - this: MSForms.TextBox2, parameter: MSForms.EventHelperTypes.TextBox2_Error_Parameter) => void): void; - on( - obj: MSForms.TextBox2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.TextBox2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.TextBox2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.TextBox2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.TextBox2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.TextBox2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.ToggleButton, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.ToggleButton_BeforeDragOver_ArgNames, handler: ( - this: MSForms.ToggleButton, parameter: MSForms.EventHelperTypes.ToggleButton_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.ToggleButton, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.ToggleButton_BeforeDropOrPaste_ArgNames, - handler: (this: MSForms.ToggleButton, parameter: MSForms.EventHelperTypes.ToggleButton_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.TextBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.TextBox, parameter: { readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number }) => void): void; + on(obj: MSForms.ToggleButton, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.ToggleButton, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.ToggleButton, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.ToggleButton, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.ToggleButton, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.ToggleButton, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.ToggleButton, event: 'Error', argNames: MSForms.EventHelperTypes.ToggleButton_Error_ArgNames, handler: ( - this: MSForms.ToggleButton, parameter: MSForms.EventHelperTypes.ToggleButton_Error_Parameter) => void): void; - on( - obj: MSForms.ToggleButton, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.ToggleButton, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.ToggleButton, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.ToggleButton, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.ToggleButton, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.ToggleButton, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.ToggleButton, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.ToggleButton, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.ToggleButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.ToggleButton, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.ToggleButton2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.ToggleButton2_BeforeDragOver_ArgNames, - handler: (this: MSForms.ToggleButton2, parameter: MSForms.EventHelperTypes.ToggleButton2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.ToggleButton2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.ToggleButton2_BeforeDropOrPaste_ArgNames, - handler: (this: MSForms.ToggleButton2, parameter: MSForms.EventHelperTypes.ToggleButton2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.ToggleButton2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.ToggleButton2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.ToggleButton2, event: 'Error', argNames: MSForms.EventHelperTypes.ToggleButton2_Error_ArgNames, handler: ( - this: MSForms.ToggleButton2, parameter: MSForms.EventHelperTypes.ToggleButton2_Error_Parameter) => void): void; - on( - obj: MSForms.ToggleButton2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.ToggleButton2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.ToggleButton2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.ToggleButton2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.ToggleButton2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.ToggleButton2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; + on(obj: MSForms.ToggleButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.ToggleButton, parameter: { readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number }) => void): void; on(obj: MSForms.UserForm, event: 'AddControl' | 'RemoveControl', argNames: ['Control'], handler: (this: MSForms.UserForm, parameter: {readonly Control: MSForms.Control}) => void): void; - on( - obj: MSForms.UserForm, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.UserForm_BeforeDragOver_ArgNames, handler: ( - this: MSForms.UserForm, parameter: MSForms.EventHelperTypes.UserForm_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.UserForm, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.UserForm_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.UserForm, parameter: MSForms.EventHelperTypes.UserForm_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.UserForm, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Container_BeforeDragOver_ArgNames, handler: (this: MSForms.UserForm, parameter: MSForms.EventHelperTypes.Container_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.UserForm, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Container_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.UserForm, parameter: MSForms.EventHelperTypes.Container_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.UserForm, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.UserForm, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.UserForm, event: 'Error', argNames: MSForms.EventHelperTypes.UserForm_Error_ArgNames, handler: ( - this: MSForms.UserForm, parameter: MSForms.EventHelperTypes.UserForm_Error_Parameter) => void): void; - on( - obj: MSForms.UserForm, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.UserForm, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.UserForm, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.UserForm, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.UserForm, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.UserForm, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.UserForm, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.UserForm, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.UserForm, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.UserForm, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.UserForm, event: 'Scroll', argNames: MSForms.EventHelperTypes.UserForm_Scroll_ArgNames, handler: ( - this: MSForms.UserForm, parameter: MSForms.EventHelperTypes.UserForm_Scroll_Parameter) => void): void; - on(obj: MSForms.UserForm, event: 'Zoom', argNames: ['Percent'], handler: (this: MSForms.UserForm, parameter: {Percent: number}) => void): void; - on(obj: MSForms.UserForm2, event: 'AddControl' | 'RemoveControl', argNames: ['Control'], handler: (this: MSForms.UserForm2, parameter: {readonly Control: MSForms.Control}) => void): void; - on( - obj: MSForms.UserForm2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.UserForm2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.UserForm2, parameter: MSForms.EventHelperTypes.UserForm2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.UserForm2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.UserForm2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.UserForm2, parameter: MSForms.EventHelperTypes.UserForm2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.UserForm2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.UserForm2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.UserForm2, event: 'Error', argNames: MSForms.EventHelperTypes.UserForm2_Error_ArgNames, handler: ( - this: MSForms.UserForm2, parameter: MSForms.EventHelperTypes.UserForm2_Error_Parameter) => void): void; - on( - obj: MSForms.UserForm2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.UserForm2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.UserForm2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.UserForm2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.UserForm2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.UserForm2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.UserForm2, event: 'Scroll', argNames: MSForms.EventHelperTypes.UserForm2_Scroll_ArgNames, handler: ( - this: MSForms.UserForm2, parameter: MSForms.EventHelperTypes.UserForm2_Scroll_Parameter) => void): void; - on(obj: MSForms.UserForm2, event: 'Zoom', argNames: ['Percent'], handler: (this: MSForms.UserForm2, parameter: {Percent: number}) => void): void; + on(obj: MSForms.UserForm, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.UserForm, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; + on(obj: MSForms.UserForm, event: 'Scroll', argNames: MSForms.EventHelperTypes.Container_Scroll_ArgNames, handler: (this: MSForms.UserForm, parameter: MSForms.EventHelperTypes.Container_Scroll_Parameter) => void): void; + on(obj: MSForms.UserForm, event: 'Zoom', argNames: ['Percent'], handler: (this: MSForms.UserForm, parameter: { Percent: number }) => void): void; on(obj: MSForms.CheckBox, event: 'Change' | 'Click', handler: (this: MSForms.CheckBox, parameter: {}) => void): void; - on(obj: MSForms.CheckBox2, event: 'Change' | 'Click', handler: (this: MSForms.CheckBox2, parameter: {}) => void): void; on(obj: MSForms.ComboBox, event: 'Change' | 'Click' | 'DropButtonClick', handler: (this: MSForms.ComboBox, parameter: {}) => void): void; - on(obj: MSForms.ComboBox2, event: 'Change' | 'Click' | 'DropButtonClick', handler: (this: MSForms.ComboBox2, parameter: {}) => void): void; on(obj: MSForms.CommandButton, event: 'Click', handler: (this: MSForms.CommandButton, parameter: {}) => void): void; - on(obj: MSForms.CommandButton2, event: 'Click', handler: (this: MSForms.CommandButton2, parameter: {}) => void): void; on(obj: MSForms.Control, event: 'AfterUpdate' | 'Enter', handler: (this: MSForms.Control, parameter: {}) => void): void; on(obj: MSForms.Frame, event: 'Click' | 'Layout', handler: (this: MSForms.Frame, parameter: {}) => void): void; - on(obj: MSForms.Frame2, event: 'Click' | 'Layout', handler: (this: MSForms.Frame2, parameter: {}) => void): void; on(obj: MSForms.HTMLCheckbox, event: 'Click', handler: (this: MSForms.HTMLCheckbox, parameter: {}) => void): void; - on(obj: MSForms.HTMLCheckbox2, event: 'Click', handler: (this: MSForms.HTMLCheckbox2, parameter: {}) => void): void; on(obj: MSForms.HTMLHidden, event: 'Click', handler: (this: MSForms.HTMLHidden, parameter: {}) => void): void; - on(obj: MSForms.HTMLHidden2, event: 'Click', handler: (this: MSForms.HTMLHidden2, parameter: {}) => void): void; on(obj: MSForms.HTMLImage, event: 'Click', handler: (this: MSForms.HTMLImage, parameter: {}) => void): void; - on(obj: MSForms.HTMLImage2, event: 'Click', handler: (this: MSForms.HTMLImage2, parameter: {}) => void): void; on(obj: MSForms.HTMLOption, event: 'Click', handler: (this: MSForms.HTMLOption, parameter: {}) => void): void; - on(obj: MSForms.HTMLOption2, event: 'Click', handler: (this: MSForms.HTMLOption2, parameter: {}) => void): void; on(obj: MSForms.HTMLPassword, event: 'Click', handler: (this: MSForms.HTMLPassword, parameter: {}) => void): void; - on(obj: MSForms.HTMLPassword2, event: 'Click', handler: (this: MSForms.HTMLPassword2, parameter: {}) => void): void; on(obj: MSForms.HTMLReset, event: 'Click', handler: (this: MSForms.HTMLReset, parameter: {}) => void): void; - on(obj: MSForms.HTMLReset2, event: 'Click', handler: (this: MSForms.HTMLReset2, parameter: {}) => void): void; on(obj: MSForms.HTMLSelect, event: 'Click', handler: (this: MSForms.HTMLSelect, parameter: {}) => void): void; - on(obj: MSForms.HTMLSelect2, event: 'Click', handler: (this: MSForms.HTMLSelect2, parameter: {}) => void): void; on(obj: MSForms.HTMLSubmit, event: 'Click', handler: (this: MSForms.HTMLSubmit, parameter: {}) => void): void; - on(obj: MSForms.HTMLSubmit2, event: 'Click', handler: (this: MSForms.HTMLSubmit2, parameter: {}) => void): void; on(obj: MSForms.HTMLText, event: 'Click', handler: (this: MSForms.HTMLText, parameter: {}) => void): void; - on(obj: MSForms.HTMLText2, event: 'Click', handler: (this: MSForms.HTMLText2, parameter: {}) => void): void; on(obj: MSForms.HTMLTextArea, event: 'Click', handler: (this: MSForms.HTMLTextArea, parameter: {}) => void): void; - on(obj: MSForms.HTMLTextArea2, event: 'Click', handler: (this: MSForms.HTMLTextArea2, parameter: {}) => void): void; on(obj: MSForms.Image, event: 'Click', handler: (this: MSForms.Image, parameter: {}) => void): void; - on(obj: MSForms.Image2, event: 'Click', handler: (this: MSForms.Image2, parameter: {}) => void): void; on(obj: MSForms.Label, event: 'Click', handler: (this: MSForms.Label, parameter: {}) => void): void; - on(obj: MSForms.Label2, event: 'Click', handler: (this: MSForms.Label2, parameter: {}) => void): void; on(obj: MSForms.ListBox, event: 'Change' | 'Click', handler: (this: MSForms.ListBox, parameter: {}) => void): void; - on(obj: MSForms.ListBox2, event: 'Change' | 'Click', handler: (this: MSForms.ListBox2, parameter: {}) => void): void; on(obj: MSForms.MultiPage, event: 'Change', handler: (this: MSForms.MultiPage, parameter: {}) => void): void; - on(obj: MSForms.MultiPage2, event: 'Change', handler: (this: MSForms.MultiPage2, parameter: {}) => void): void; on(obj: MSForms.OptionButton, event: 'Change' | 'Click', handler: (this: MSForms.OptionButton, parameter: {}) => void): void; - on(obj: MSForms.OptionButton2, event: 'Change' | 'Click', handler: (this: MSForms.OptionButton2, parameter: {}) => void): void; on(obj: MSForms.ScrollBar, event: 'Change' | 'Scroll', handler: (this: MSForms.ScrollBar, parameter: {}) => void): void; - on(obj: MSForms.ScrollBar2, event: 'Change' | 'Scroll', handler: (this: MSForms.ScrollBar2, parameter: {}) => void): void; on(obj: MSForms.SpinButton, event: 'Change' | 'SpinDown' | 'SpinUp', handler: (this: MSForms.SpinButton, parameter: {}) => void): void; - on(obj: MSForms.SpinButton2, event: 'Change' | 'SpinDown' | 'SpinUp', handler: (this: MSForms.SpinButton2, parameter: {}) => void): void; on(obj: MSForms.TabStrip, event: 'Change', handler: (this: MSForms.TabStrip, parameter: {}) => void): void; - on(obj: MSForms.TabStrip2, event: 'Change', handler: (this: MSForms.TabStrip2, parameter: {}) => void): void; on(obj: MSForms.TextBox, event: 'Change' | 'DropButtonClick', handler: (this: MSForms.TextBox, parameter: {}) => void): void; - on(obj: MSForms.TextBox2, event: 'Change' | 'DropButtonClick', handler: (this: MSForms.TextBox2, parameter: {}) => void): void; on(obj: MSForms.ToggleButton, event: 'Change' | 'Click', handler: (this: MSForms.ToggleButton, parameter: {}) => void): void; - on(obj: MSForms.ToggleButton2, event: 'Change' | 'Click', handler: (this: MSForms.ToggleButton2, parameter: {}) => void): void; on(obj: MSForms.UserForm, event: 'Click' | 'Layout', handler: (this: MSForms.UserForm, parameter: {}) => void): void; - on(obj: MSForms.UserForm2, event: 'Click' | 'Layout', handler: (this: MSForms.UserForm2, parameter: {}) => void): void; - set(obj: MSForms.ComboBox | MSForms.ComboBox2 | MSForms.ListBox | MSForms.ListBox2, propertyName: 'Column' | 'List', parameterTypes: [number | undefined, number] | [number] | never[], - newValue: any): void; - set(obj: MSForms.ListBox | MSForms.ListBox2, propertyName: 'Selected', parameterTypes: [any], newValue: boolean): void; + set(obj: MSForms.ComboBox | MSForms.ListBox, propertyName: 'Column' | 'List', parameterTypes: [number, number] | [number], newValue: any): void; + set(obj: MSForms.ComboBox | MSForms.ListBox, propertyName: 'Column' | 'List', parameterTypes: number[], newValue: SafeArray): void; + set(obj: MSForms.ListBox, propertyName: 'Selected', parameterTypes: [any], newValue: boolean): void; new(progid: K): ActiveXObjectNameMap[K]; } interface ActiveXObjectNameMap { 'Forms.Image': MSForms.Image; } - -interface EnumeratorConstructor { - new(col: MSForms.Controls | MSForms.Pages | MSForms.Tabs): Enumerator; // tslint:disable-line:use-default-type-parameter -} - -interface SafeArray { - _brand: SafeArray; -} diff --git a/types/activex-msforms/tslint.json b/types/activex-msforms/tslint.json index 3224b40b8b..7b89accc6d 100644 --- a/types/activex-msforms/tslint.json +++ b/types/activex-msforms/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "no-const-enum": false + "no-const-enum": false, + "max-line-length": false } } diff --git a/types/activex-office/activex-office-tests.ts b/types/activex-office/activex-office-tests.ts index 69a0563640..7aab0b4521 100644 --- a/types/activex-office/activex-office-tests.ts +++ b/types/activex-office/activex-office-tests.ts @@ -1,19 +1,26 @@ /// +const collectionToArray = (col: { Item(key: any): T }): T[] => { + const results: T[] = []; + const enumerator = new Enumerator(col); + enumerator.moveFirst(); + while (!enumerator.atEnd()) { + results.push(enumerator.item()); + enumerator.moveNext(); + } + return results; +}; + let app = new ActiveXObject('Word.Application'); +app.Visible = true; let dlg = app.FileDialog(Office.MsoFileDialogType.msoFileDialogFolderPicker); dlg.AllowMultiSelect = true; dlg.Title = 'Select one or more folders'; dlg.Execute(); -let enumerator = new Enumerator(dlg.SelectedItems); -enumerator.moveFirst(); -while (!enumerator.atEnd()) { - WScript.Echo(enumerator.item); +for (const item of collectionToArray(dlg.SelectedItems)) { + WScript.Echo(item); } -let enumerator2 = new Enumerator(app.COMAddIns); -enumerator2.moveFirst(); -while (!enumerator2.atEnd()) { - const item = enumerator2.item(); +for (const item of collectionToArray(app.COMAddIns)) { WScript.Echo(`COM Addin: ${item.Description} -- ${item.ProgId}`); } diff --git a/types/activex-office/index.d.ts b/types/activex-office/index.d.ts index 20351b91f9..18a7dd285d 100644 --- a/types/activex-office/index.d.ts +++ b/types/activex-office/index.d.ts @@ -1,10 +1,11 @@ -// Type definitions for Microsoft Office 14.0 Object Library - Office 14.0 +// Type definitions for Microsoft Office 16.0 Object Library - Office 16.0 // Project: https://msdn.microsoft.com/VBA/Office-Shared-VBA/articles/office-vba-object-library-reference // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 /// +/// declare namespace Office { type MsoRGBType = number; @@ -524,6 +525,18 @@ declare namespace Office { msoblogImageTypePNG = 3, } + const enum MsoBroadcastCapabilities { + BroadcastCapFileSizeLimited = 1, + BroadcastCapSupportsMeetingNotes = 2, + BroadcastCapSupportsUpdateDoc = 4, + } + + const enum MsoBroadcastState { + BroadcastPaused = 2, + BroadcastStarted = 1, + NoBroadcast = 0, + } + const enum MsoBulletType { msoBulletMixed = -2, msoBulletNone = 0, @@ -622,6 +635,7 @@ declare namespace Office { msoElementChartWallShow = 1101, msoElementDataLabelBestFit = 210, msoElementDataLabelBottom = 209, + msoElementDataLabelCallout = 211, msoElementDataLabelCenter = 202, msoElementDataLabelInsideBase = 204, msoElementDataLabelInsideEnd = 203, @@ -741,6 +755,16 @@ declare namespace Office { msoElementUpDownBarsShow = 901, } + const enum MsoChartFieldType { + msoChartFieldBubbleSize = 1, + msoChartFieldCategoryName = 2, + msoChartFieldFormula = 6, + msoChartFieldPercentage = 3, + msoChartFieldRange = 7, + msoChartFieldSeriesName = 4, + msoChartFieldValue = 5, + } + const enum MsoClipboardFormat { msoClipboardFormatHTML = 2, msoClipboardFormatMixed = -2, @@ -1625,6 +1649,13 @@ declare namespace Office { msoLightRigTwoPoint = 25, } + const enum MsoLineCapStyle { + msoLineCapFlat = 3, + msoLineCapMixed = -2, + msoLineCapRound = 2, + msoLineCapSquare = 1, + } + const enum MsoLineDashStyle { msoLineDash = 4, msoLineDashDot = 5, @@ -1641,6 +1672,24 @@ declare namespace Office { msoLineSysDot = 11, } + const enum MsoLineFillType { + msoLineFillBackground = 5, + msoLineFillGradient = 3, + msoLineFillMixed = -2, + msoLineFillNone = 0, + msoLineFillPatterned = 2, + msoLineFillPicture = 6, + msoLineFillSolid = 1, + msoLineFillTextured = 4, + } + + const enum MsoLineJoinStyle { + msoLineJoinBevel = 2, + msoLineJoinMiter = 3, + msoLineJoinMixed = -2, + msoLineJoinRound = 1, + } + const enum MsoLineStyle { msoLineSingle = 1, msoLineStyleMixed = -2, @@ -1657,6 +1706,14 @@ declare namespace Office { msoMenuAnimationUnfold = 2, } + const enum MsoMergeCmd { + msoMergeCombine = 2, + msoMergeFragment = 5, + msoMergeIntersect = 3, + msoMergeSubtract = 4, + msoMergeUnion = 1, + } + const enum MsoMetaPropertyType { msoMetaPropertyTypeBoolean = 1, msoMetaPropertyTypeBusinessData = 20, @@ -1884,6 +1941,12 @@ declare namespace Office { msoPictureWatermark = 4, } + const enum MsoPictureCompress { + msoPictureCompressDocDefault = -1, + msoPictureCompressFalse = 0, + msoPictureCompressTrue = 1, + } + const enum MsoPictureEffectType { msoEffectBackgroundRemoval = 1, msoEffectBlur = 2, @@ -2086,8 +2149,28 @@ declare namespace Office { msoTextEffect29 = 28, msoTextEffect3 = 2, msoTextEffect30 = 29, + msoTextEffect31 = 30, + msoTextEffect32 = 31, + msoTextEffect33 = 32, + msoTextEffect34 = 33, + msoTextEffect35 = 34, + msoTextEffect36 = 35, + msoTextEffect37 = 36, + msoTextEffect38 = 37, + msoTextEffect39 = 38, msoTextEffect4 = 3, + msoTextEffect40 = 39, + msoTextEffect41 = 40, + msoTextEffect42 = 41, + msoTextEffect43 = 42, + msoTextEffect44 = 43, + msoTextEffect45 = 44, + msoTextEffect46 = 45, + msoTextEffect47 = 46, + msoTextEffect48 = 47, + msoTextEffect49 = 48, msoTextEffect5 = 4, + msoTextEffect50 = 49, msoTextEffect6 = 5, msoTextEffect7 = 6, msoTextEffect8 = 7, @@ -2324,8 +2407,29 @@ declare namespace Office { msoLineStylePreset2 = 10002, msoLineStylePreset20 = 10020, msoLineStylePreset21 = 10021, + msoLineStylePreset22 = 10022, + msoLineStylePreset23 = 10023, + msoLineStylePreset24 = 10024, + msoLineStylePreset25 = 10025, + msoLineStylePreset26 = 10026, + msoLineStylePreset27 = 10027, + msoLineStylePreset28 = 10028, + msoLineStylePreset29 = 10029, msoLineStylePreset3 = 10003, + msoLineStylePreset30 = 10030, + msoLineStylePreset31 = 10031, + msoLineStylePreset32 = 10032, + msoLineStylePreset33 = 10033, + msoLineStylePreset34 = 10034, + msoLineStylePreset35 = 10035, + msoLineStylePreset36 = 10036, + msoLineStylePreset37 = 10037, + msoLineStylePreset38 = 10038, + msoLineStylePreset39 = 10039, msoLineStylePreset4 = 10004, + msoLineStylePreset40 = 10040, + msoLineStylePreset41 = 10041, + msoLineStylePreset42 = 10042, msoLineStylePreset5 = 10005, msoLineStylePreset6 = 10006, msoLineStylePreset7 = 10007, @@ -2370,9 +2474,44 @@ declare namespace Office { msoShapeStylePreset40 = 40, msoShapeStylePreset41 = 41, msoShapeStylePreset42 = 42, + msoShapeStylePreset43 = 43, + msoShapeStylePreset44 = 44, + msoShapeStylePreset45 = 45, + msoShapeStylePreset46 = 46, + msoShapeStylePreset47 = 47, + msoShapeStylePreset48 = 48, + msoShapeStylePreset49 = 49, msoShapeStylePreset5 = 5, + msoShapeStylePreset50 = 50, + msoShapeStylePreset51 = 51, + msoShapeStylePreset52 = 52, + msoShapeStylePreset53 = 53, + msoShapeStylePreset54 = 54, + msoShapeStylePreset55 = 55, + msoShapeStylePreset56 = 56, + msoShapeStylePreset57 = 57, + msoShapeStylePreset58 = 58, + msoShapeStylePreset59 = 59, msoShapeStylePreset6 = 6, + msoShapeStylePreset60 = 60, + msoShapeStylePreset61 = 61, + msoShapeStylePreset62 = 62, + msoShapeStylePreset63 = 63, + msoShapeStylePreset64 = 64, + msoShapeStylePreset65 = 65, + msoShapeStylePreset66 = 66, + msoShapeStylePreset67 = 67, + msoShapeStylePreset68 = 68, + msoShapeStylePreset69 = 69, msoShapeStylePreset7 = 7, + msoShapeStylePreset70 = 70, + msoShapeStylePreset71 = 71, + msoShapeStylePreset72 = 72, + msoShapeStylePreset73 = 73, + msoShapeStylePreset74 = 74, + msoShapeStylePreset75 = 75, + msoShapeStylePreset76 = 76, + msoShapeStylePreset77 = 77, msoShapeStylePreset8 = 8, msoShapeStylePreset9 = 9, } @@ -2383,6 +2522,7 @@ declare namespace Office { msoCanvas = 20, msoChart = 3, msoComment = 4, + msoContentApp = 27, msoDiagram = 21, msoEmbeddedOLEObject = 7, msoFormControl = 8, @@ -2404,6 +2544,7 @@ declare namespace Office { msoTable = 19, msoTextBox = 17, msoTextEffect = 15, + msoWebVideo = 26, } const enum MsoSharedWorkspaceTaskPriority { @@ -2858,6 +2999,14 @@ declare namespace Office { xlPyramidToPoint = 1, } + const enum XlBinsType { + xlBinsTypeAutomatic = 0, + xlBinsTypeBinCount = 4, + xlBinsTypeBinSize = 3, + xlBinsTypeCategorical = 1, + xlBinsTypeManual = 2, + } + const enum XlBorderWeight { xlHairline = 1, xlMedium = -4138, @@ -2865,6 +3014,12 @@ declare namespace Office { xlThin = 2, } + const enum XlCategoryLabelLevel { + xlCategoryLabelLevelAll = -1, + xlCategoryLabelLevelCustom = -2, + xlCategoryLabelLevelNone = -3, + } + const enum XlCategoryType { xlAutomaticScale = -4105, xlCategoryScale = 2, @@ -2897,7 +3052,9 @@ declare namespace Office { xlMajorGridlines = 15, xlMinorGridlines = 16, xlNothing = 28, + xlPivotChartCollapseEntireFieldButton = 34, xlPivotChartDropZone = 32, + xlPivotChartExpandEntireFieldButton = 33, xlPivotChartFieldButton = 31, xlPlotArea = 19, xlRadarAxisLabels = 27, @@ -2952,11 +3109,16 @@ declare namespace Office { xlBarOfPie = 71, xlBarStacked = 58, xlBarStacked100 = 59, + xlBoxwhisker = 121, xlBubble = 15, xlBubble3DEffect = 87, xlColumnClustered = 51, xlColumnStacked = 52, xlColumnStacked100 = 53, + xlCombo = -4152, + xlComboAreaStackedColumnClustered = 115, + xlComboColumnClusteredLine = 113, + xlComboColumnClusteredLineSecondaryAxis = 114, xlConeBarClustered = 102, xlConeBarStacked = 103, xlConeBarStacked100 = 104, @@ -2973,12 +3135,15 @@ declare namespace Office { xlCylinderColStacked100 = 94, xlDoughnut = -4120, xlDoughnutExploded = 80, + xlHistogram = 118, xlLine = 4, xlLineMarkers = 65, xlLineMarkersStacked = 66, xlLineMarkersStacked100 = 67, xlLineStacked = 63, xlLineStacked100 = 64, + xlOtherCombinations = 116, + xlPareto = 122, xlPie = 5, xlPieExploded = 69, xlPieOfPie = 68, @@ -2996,10 +3161,14 @@ declare namespace Office { xlStockOHLC = 89, xlStockVHLC = 90, xlStockVOHLC = 91, + xlSuggestedChart = -2, + xlSunburst = 120, xlSurface = 83, xlSurfaceTopView = 85, xlSurfaceTopViewWireframe = 86, xlSurfaceWireframe = 84, + xlTreemap = 117, + xlWaterfall = 119, xlXYScatter = -4169, xlXYScatterLines = 74, xlXYScatterLinesNoMarkers = 75, @@ -3181,6 +3350,12 @@ declare namespace Office { xlMarkerStyleX = -4168, } + const enum XlParentDataLabelOptions { + xlParentDataLabelOptionsBanner = 1, + xlParentDataLabelOptionsNone = 0, + xlParentDataLabelOptionsOverlapping = 2, + } + const enum XlPieSliceIndex { xlCenterPoint = 5, xlInnerCenterPoint = 8, @@ -3222,6 +3397,12 @@ declare namespace Office { xlScaleLogarithmic = -4133, } + const enum XlSeriesNameLevel { + xlSeriesNameLevelAll = -1, + xlSeriesNameLevelCustom = -2, + xlSeriesNameLevelNone = -3, + } + const enum XlSizeRepresents { xlSizeIsArea = 1, xlSizeIsWidth = 2, @@ -3280,14 +3461,13 @@ declare namespace Office { xlVAlignTop = -4160, } - class Adjustments { - private 'Office.Adjustments_typekey': Adjustments; - private constructor(); + interface Adjustments { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): number; readonly Parent: any; + (Index: number): number; } class AnswerWizard { @@ -3301,9 +3481,7 @@ declare namespace Office { ResetFileList(): void; } - class AnswerWizardFiles { - private 'Office.AnswerWizardFiles_typekey': AnswerWizardFiles; - private constructor(); + interface AnswerWizardFiles { Add(FileName: string): void; readonly Application: any; readonly Count: number; @@ -3311,12 +3489,13 @@ declare namespace Office { Delete(FileName: string): void; Item(Index: number): string; readonly Parent: any; + (Index: number): string; } class Assistant { private 'Office.Assistant_typekey': Assistant; private constructor(); - ActivateWizard(WizardID: number, act: MsoWizardActType, Animation?: any): void; + ActivateWizard(WizardID: number, act: MsoWizardActType, Animation?: MsoAnimationType): void; Animation: MsoAnimationType; readonly Application: any; AssistWithAlerts: boolean; @@ -3325,7 +3504,7 @@ declare namespace Office { readonly BalloonError: MsoBalloonErrorType; readonly Creator: number; DoAlert(bstrAlertTitle: string, bstrAlertText: string, alb: MsoAlertButtonType, alc: MsoAlertIconType, ald: MsoAlertDefaultType, alq: MsoAlertCancelType, varfSysAlert: boolean): number; - EndWizard(WizardID: number, varfSuccess: boolean, Animation?: any): void; + EndWizard(WizardID: number, varfSuccess: boolean, Animation?: MsoAnimationType): void; FeatureTips: boolean; FileName: string; GuessHelp: boolean; @@ -3345,7 +3524,7 @@ declare namespace Office { ResetTips(): void; SearchWhenProgramming: boolean; Sounds: boolean; - StartWizard(On: boolean, Callback: string, PrivateX: number, Animation?: any, CustomTeaser?: any, Top?: any, Left?: any, Bottom?: any, Right?: any): number; + StartWizard(On: boolean, Callback: string, PrivateX: number, Animation?: MsoAnimationType, CustomTeaser?: any, Top?: number, Left?: number, Bottom?: number, Right?: number): number; TipOfDay: boolean; Top: number; Visible: boolean; @@ -3359,12 +3538,12 @@ declare namespace Office { BalloonType: MsoBalloonType; Button: MsoButtonSetType; Callback: string; - readonly Checkboxes: any; + readonly Checkboxes: BalloonCheckboxes; Close(): void; readonly Creator: number; Heading: string; Icon: MsoIconType; - readonly Labels: any; + readonly Labels: BalloonLabels; Mode: MsoModeType; readonly Name: string; readonly Parent: any; @@ -3374,6 +3553,49 @@ declare namespace Office { Text: string; } + class BalloonCheckbox { + private 'Office.BalloonCheckbox_typekey': BalloonCheckbox; + private constructor(); + readonly Application: any; + Checked: boolean; + readonly Creator: number; + readonly Item: string; + readonly Name: string; + readonly Parent: any; + Text: string; + } + + interface BalloonCheckboxes { + readonly Application: any; + Count: number; + readonly Creator: number; + Item(Index: number): BalloonCheckbox; + readonly Name: string; + readonly Parent: any; + (Index: number): BalloonCheckbox; + } + + class BalloonLabel { + private constructor(); + private 'Office.BalloonLabel_typekey': BalloonLabel; + readonly Application: any; + readonly Creator: number; + readonly Item: string; + readonly Name: string; + readonly Parent: any; + Text: string; + } + + interface BalloonLabels { + readonly Application: any; + Count: number; + readonly Creator: number; + Item(Index: number): BalloonLabel; + readonly Name: string; + readonly Parent: any; + (Index: number): BalloonLabel; + } + class BulletFormat2 { private 'Office.BulletFormat2_typekey': BulletFormat2; private constructor(); @@ -3415,21 +3637,19 @@ declare namespace Office { Type: MsoCalloutType; } - class CanvasShapes { - private 'Office.CanvasShapes_typekey': CanvasShapes; - private constructor(); + interface CanvasShapes { AddCallout(Type: MsoCalloutType, Left: number, Top: number, Width: number, Height: number): Shape; AddConnector(Type: MsoConnectorType, BeginX: number, BeginY: number, EndX: number, EndY: number): Shape; - AddCurve(SafeArrayOfPoints: any): Shape; + AddCurve(SafeArrayOfPoints: SafeArray): Shape; AddLabel(Orientation: MsoTextOrientation, Left: number, Top: number, Width: number, Height: number): Shape; AddLine(BeginX: number, BeginY: number, EndX: number, EndY: number): Shape; /** - * @param number [Width=-1] - * @param number [Height=-1] + * @param Width [Width=-1] + * @param Height [Height=-1] */ AddPicture(FileName: string, LinkToFile: MsoTriState, SaveWithDocument: MsoTriState, Left: number, Top: number, Width?: number, Height?: number): Shape; - AddPolyline(SafeArrayOfPoints: any): Shape; + AddPolyline(SafeArrayOfPoints: SafeArray): Shape; AddShape(Type: MsoAutoShapeType, Left: number, Top: number, Width: number, Height: number): Shape; AddTextbox(Orientation: MsoTextOrientation, Left: number, Top: number, Width: number, Height: number): Shape; AddTextEffect(PresetTextEffect: MsoPresetTextEffect, Text: string, FontName: string, FontSize: number, FontBold: MsoTriState, FontItalic: MsoTriState, Left: number, Top: number): Shape; @@ -3438,10 +3658,11 @@ declare namespace Office { BuildFreeform(EditingType: MsoEditingType, X1: number, Y1: number): FreeformBuilder; readonly Count: number; readonly Creator: number; - Item(Index: any): Shape; + Item(Index: number | string): Shape; readonly Parent: any; Range(Index: any): ShapeRange; SelectAll(): void; + (Index: number | string): Shape; } class ChartColorFormat { @@ -3480,7 +3701,7 @@ declare namespace Office { readonly TextureType: number; TwoColorGradient(Style: number, Variant: number): void; readonly Type: number; - UserPicture(PictureFile: any, PictureFormat: any, PictureStackUnit: any, PicturePlacement: any): void; + UserPicture(PictureFile: string, PictureFormat: any, PictureStackUnit: any, PicturePlacement: any): void; UserTextured(TextureFile: string): void; Visible: number; } @@ -3534,16 +3755,15 @@ declare namespace Office { readonly ProgId: string; } - class COMAddIns { - private 'Office.COMAddIns_typekey': COMAddIns; - private constructor(); + interface COMAddIns { readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): COMAddIn; + Item(Index: number | string): COMAddIn; readonly Parent: any; SetAppModal(varfModal: boolean): void; Update(): void; + (Index: number | string): COMAddIn; } class CommandBar { @@ -3576,7 +3796,7 @@ declare namespace Office { readonly Creator: number; Delete(): void; Enabled: boolean; - FindControl(Type?: any, Id?: any, Tag?: any, Visible?: any, Recursive?: any): CommandBarControl; + FindControl(Type?: any, Id?: any, Tag?: any, Visible?: boolean, Recursive?: boolean): CommandBarControl; Height: number; readonly Id: number; readonly Index: number; @@ -3590,7 +3810,7 @@ declare namespace Office { Protection: MsoBarProtection; Reset(): void; RowIndex: number; - ShowPopup(x?: any, y?: any): void; + ShowPopup(x?: number, y?: number): void; Top: number; readonly Type: MsoBarType; Visible: boolean; @@ -3625,10 +3845,10 @@ declare namespace Office { BuiltInFace: boolean; Caption: string; readonly Control: any; - Copy(Bar?: any, Before?: any): CommandBarControl; + Copy(Bar?: CommandBar, Before?: number): CommandBarControl; CopyFace(): void; readonly Creator: number; - Delete(Temporary?: any): void; + Delete(Temporary?: boolean): void; DescriptionText: string; Enabled: boolean; Execute(): void; @@ -3644,7 +3864,7 @@ declare namespace Office { readonly IsPriorityDropped: boolean; readonly Left: number; Mask: stdole.IPictureDisp; - Move(Bar?: any, Before?: any): CommandBarControl; + Move(Bar?: CommandBar, Before?: number): CommandBarControl; OLEUsage: MsoControlOLEUsage; OnAction: string; Parameter: string; @@ -3701,9 +3921,9 @@ declare namespace Office { Caption: string; Clear(): void; readonly Control: any; - Copy(Bar?: any, Before?: any): CommandBarControl; + Copy(Bar?: CommandBar, Before?: number): CommandBarControl; readonly Creator: number; - Delete(Temporary?: any): void; + Delete(Temporary?: boolean): void; DescriptionText: string; DropDownLines: number; DropDownWidth: number; @@ -3722,7 +3942,7 @@ declare namespace Office { readonly ListCount: number; ListHeaderCount: number; ListIndex: number; - Move(Bar?: any, Before?: any): CommandBarControl; + Move(Bar?: CommandBar, Before?: number): CommandBarControl; OLEUsage: MsoControlOLEUsage; OnAction: string; Parameter: string; @@ -3775,9 +3995,9 @@ declare namespace Office { readonly BuiltIn: boolean; Caption: string; readonly Control: any; - Copy(Bar?: any, Before?: any): CommandBarControl; + Copy(Bar?: CommandBar, Before?: number): CommandBarControl; readonly Creator: number; - Delete(Temporary?: any): void; + Delete(Temporary?: boolean): void; DescriptionText: string; Enabled: boolean; Execute(): void; @@ -3789,7 +4009,7 @@ declare namespace Office { readonly InstanceId: number; readonly IsPriorityDropped: boolean; readonly Left: number; - Move(Bar?: any, Before?: any): CommandBarControl; + Move(Bar?: CommandBar, Before?: number): CommandBarControl; OLEUsage: MsoControlOLEUsage; OnAction: string; Parameter: string; @@ -3812,24 +4032,21 @@ declare namespace Office { Width: number; } - class CommandBarControls { - private 'Office.CommandBarControls_typekey': CommandBarControls; - private constructor(); - Add(Type?: any, Id?: any, Parameter?: any, Before?: any, Temporary?: any): CommandBarControl; + interface CommandBarControls { + Add(Type?: MsoControlType.msoControlButton | MsoControlType.msoControlEdit | MsoControlType.msoControlDropdown | MsoControlType.msoControlComboBox | MsoControlType.msoControlPopup, Id?: number, Parameter?: any, Before?: number, Temporary?: boolean): CommandBarControl; readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): CommandBarControl; + Item(Index: number | string): CommandBarControl; readonly Parent: CommandBar; + (Index: number | string): CommandBarControl; } - class CommandBars { - private 'Office.CommandBars_typekey': CommandBars; - private constructor(); + interface CommandBars { readonly ActionControl: CommandBarControl; readonly ActiveMenuBar: CommandBar; AdaptiveMenus: boolean; - Add(Name?: any, Position?: any, MenuBar?: any, Temporary?: any): CommandBar; + Add(Name?: string, Position?: MsoBarPosition, MenuBar?: boolean, Temporary?: boolean): CommandBar; AddEx(TbidOrName?: any, Position?: any, MenuBar?: any, Temporary?: any, TbtrProtection?: any): CommandBar; readonly Application: any; CommitRenderingTransaction(hwnd: number): void; @@ -3841,8 +4058,8 @@ declare namespace Office { DisplayKeysInTooltips: boolean; DisplayTooltips: boolean; ExecuteMso(idMso: string): void; - FindControl(Type?: any, Id?: any, Tag?: any, Visible?: any): CommandBarControl; - FindControls(Type?: any, Id?: any, Tag?: any, Visible?: any): CommandBarControls; + FindControl(Type?: MsoControlType, Id?: any, Tag?: any, Visible?: boolean): CommandBarControl | null; + FindControls(Type?: MsoControlType, Id?: any, Tag?: any, Visible?: boolean): CommandBarControls | null; GetEnabledMso(idMso: string): boolean; GetImageMso(idMso: string, Width: number, Height: number): stdole.IPictureDisp; GetLabelMso(idMso: string): string; @@ -3851,12 +4068,13 @@ declare namespace Office { GetSupertipMso(idMso: string): string; GetVisibleMso(idMso: string): boolean; IdsString(ids: number, pbstrName: string): number; - Item(Index: any): CommandBar; + Item(Index: number | string): CommandBar; LargeButtons: boolean; MenuAnimationStyle: MsoMenuAnimation; readonly Parent: any; ReleaseFocus(): void; TmcGetName(tmc: number, pbstrName: string): number; + (Index: number | string): CommandBar; } class ConnectorFormat { @@ -3886,8 +4104,7 @@ declare namespace Office { readonly Creator: number; /** @param boolean [ShowWithDelay=false] */ - Show( - CardStyle: MsoContactCardStyle, RectangleLeft: number, RectangleRight: number, RectangleTop: number, RectangleBottom: number, HorizontalPosition: number, ShowWithDelay?: boolean): void; + Show(CardStyle: MsoContactCardStyle, RectangleLeft: number, RectangleRight: number, RectangleTop: number, RectangleBottom: number, HorizontalPosition: number, ShowWithDelay?: boolean): void; } class Crop { @@ -3925,10 +4142,10 @@ declare namespace Office { private constructor(); /** - * @param string [Name=''] - * @param string [NamespaceURI=''] - * @param Office.MsoCustomXMLNodeType [NodeType=1] - * @param string [NodeValue=''] + * @param Name [Name=''] + * @param NamespaceURI [NamespaceURI=''] + * @param NodeType [NodeType=1] + * @param NodeValue [NodeValue=''] */ AppendChildNode(Name?: string, NamespaceURI?: string, NodeType?: MsoCustomXMLNodeType, NodeValue?: string): void; AppendChildSubtree(XML: string): void; @@ -3942,15 +4159,15 @@ declare namespace Office { HasChildNodes(): boolean; /** - * @param string [Name=''] - * @param string [NamespaceURI=''] - * @param Office.MsoCustomXMLNodeType [NodeType=1] - * @param string [NodeValue=''] - * @param Office.CustomXMLNode [NextSibling=0] + * @param Name [Name=''] + * @param NamespaceURI [NamespaceURI=''] + * @param NodeType [NodeType=1] + * @param NodeValue [NodeValue=''] + * @param NextSibling [NextSibling=0] */ InsertNodeBefore(Name?: string, NamespaceURI?: string, NodeType?: MsoCustomXMLNodeType, NodeValue?: string, NextSibling?: CustomXMLNode): void; - /** @param Office.CustomXMLNode [NextSibling=0] */ + /** @param NextSibling [NextSibling=0] */ InsertSubtreeBefore(XML: string, NextSibling?: CustomXMLNode): void; readonly LastChild: CustomXMLNode; readonly NamespaceURI: string; @@ -3965,10 +4182,10 @@ declare namespace Office { RemoveChild(Child: CustomXMLNode): void; /** - * @param string [Name=''] - * @param string [NamespaceURI=''] - * @param Office.MsoCustomXMLNodeType [NodeType=1] - * @param string [NodeValue=''] + * @param Name [Name=''] + * @param NamespaceURI [NamespaceURI=''] + * @param NodeType [NodeType=1] + * @param NodeValue [NodeValue=''] */ ReplaceChildNode(OldNode: CustomXMLNode, Name?: string, NamespaceURI?: string, NodeType?: MsoCustomXMLNodeType, NodeValue?: string): void; ReplaceChildSubtree(XML: string, OldNode: CustomXMLNode): void; @@ -3979,14 +4196,13 @@ declare namespace Office { readonly XPath: string; } - class CustomXMLNodes { - private 'Office.CustomXMLNodes_typekey': CustomXMLNodes; - private constructor(); + interface CustomXMLNodes { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): CustomXMLNode; readonly Parent: any; + (Index: number): CustomXMLNode; } class CustomXMLPart { @@ -3994,11 +4210,11 @@ declare namespace Office { private constructor(); /** - * @param string [Name=''] - * @param string [NamespaceURI=''] - * @param Office.CustomXMLNode [NextSibling=0] - * @param Office.MsoCustomXMLNodeType [NodeType=1] - * @param string [NodeValue=''] + * @param Name [Name=''] + * @param NamespaceURI [NamespaceURI=''] + * @param NextSibling [NextSibling=0] + * @param NodeType [NodeType=1] + * @param NodeValue [NodeValue=''] */ AddNode(Parent: CustomXMLNode, Name?: string, NamespaceURI?: string, NextSibling?: CustomXMLNode, NodeType?: MsoCustomXMLNodeType, NodeValue?: string): void; readonly Application: any; @@ -4019,19 +4235,17 @@ declare namespace Office { readonly XML: string; } - class CustomXMLParts { - private 'Office.CustomXMLParts_typekey': CustomXMLParts; - private constructor(); - - /** @param string [XML=''] */ - Add(XML?: string, SchemaCollection?: any): CustomXMLPart; + interface CustomXMLParts { + /** @param XML [XML=''] */ + Add(XML?: string, SchemaCollection?: CustomXMLSchemaCollection): CustomXMLPart; readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): CustomXMLPart; + Item(Index: number | string): CustomXMLPart; readonly Parent: any; SelectByID(Id: string): CustomXMLPart; SelectByNamespace(NamespaceURI: string): CustomXMLParts; + (Index: number | string): CustomXMLPart; } class CustomXMLPrefixMapping { @@ -4044,17 +4258,16 @@ declare namespace Office { readonly Prefix: string; } - class CustomXMLPrefixMappings { - private 'Office.CustomXMLPrefixMappings_typekey': CustomXMLPrefixMappings; - private constructor(); + interface CustomXMLPrefixMappings { AddNamespace(Prefix: string, NamespaceURI: string): void; readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): CustomXMLPrefixMapping; + Item(Index: number | string): CustomXMLPrefixMapping; LookupNamespace(Prefix: string): string; LookupPrefix(NamespaceURI: string): string; readonly Parent: any; + (Index: number | string): CustomXMLPrefixMapping; } class CustomXMLSchema { @@ -4069,25 +4282,23 @@ declare namespace Office { Reload(): void; } - class CustomXMLSchemaCollection { - private 'Office.CustomXMLSchemaCollection_typekey': CustomXMLSchemaCollection; - private constructor(); - + interface CustomXMLSchemaCollection { /** - * @param string [NamespaceURI=''] - * @param string [Alias=''] - * @param string [FileName=''] - * @param boolean [InstallForAllUsers=false] + * @param NamespaceURI [NamespaceURI=''] + * @param Alias [Alias=''] + * @param FileName [FileName=''] + * @param InstallForAllUsers [InstallForAllUsers=false] */ Add(NamespaceURI?: string, Alias?: string, FileName?: string, InstallForAllUsers?: boolean): CustomXMLSchema; AddCollection(SchemaCollection: CustomXMLSchemaCollection): void; readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): CustomXMLSchema; + Item(Index: number | string): CustomXMLSchema; NamespaceURI(Index: number): string; readonly Parent: any; Validate(): boolean; + (Index: number | string): CustomXMLSchema; } class CustomXMLValidationError { @@ -4104,13 +4315,10 @@ declare namespace Office { readonly Type: MsoCustomXMLValidationErrorType; } - class CustomXMLValidationErrors { - private 'Office.CustomXMLValidationErrors_typekey': CustomXMLValidationErrors; - private constructor(); - + interface CustomXMLValidationErrors { /** - * @param string [ErrorText=''] - * @param boolean [ClearedOnUpdate=true] + * @param ErrorText [ErrorText=''] + * @param ClearedOnUpdate [ClearedOnUpdate=true] */ Add(Node: CustomXMLNode, ErrorName: string, ErrorText?: string, ClearedOnUpdate?: boolean): void; readonly Application: any; @@ -4118,6 +4326,7 @@ declare namespace Office { readonly Creator: number; Item(Index: number): CustomXMLValidationError; readonly Parent: any; + (Index: number): CustomXMLValidationError; } class DiagramNode { @@ -4125,14 +4334,14 @@ declare namespace Office { private constructor(); /** - * @param Office.MsoRelativeNodePosition [Pos=2] - * @param Office.MsoDiagramNodeType [NodeType=1] + * @param Pos [Pos=2] + * @param NodeType [NodeType=1] */ AddNode(Pos?: MsoRelativeNodePosition, NodeType?: MsoDiagramNodeType): DiagramNode; readonly Application: any; readonly Children: DiagramNodeChildren; - /** @param Office.MsoRelativeNodePosition [Pos=2] */ + /** @param Pos [Pos=2] */ CloneNode(CopyChildren: boolean, TargetNode: DiagramNode, Pos?: MsoRelativeNodePosition): DiagramNode; readonly Creator: number; Delete(): void; @@ -4146,19 +4355,16 @@ declare namespace Office { readonly Root: DiagramNode; readonly Shape: Shape; - /** @param boolean [SwapChildren=true] */ + /** @param SwapChildren [SwapChildren=true] */ SwapNode(TargetNode: DiagramNode, SwapChildren?: boolean): void; readonly TextShape: Shape; TransferChildren(ReceivingNode: DiagramNode): void; } - class DiagramNodeChildren { - private 'Office.DiagramNodeChildren_typekey': DiagramNodeChildren; - private constructor(); - + interface DiagramNodeChildren { /** - * @param any [Index=-1] - * @param Office.MsoDiagramNodeType [NodeType=1] + * @param Index [Index=-1] + * @param NodeType [NodeType=1] */ AddNode(Index?: any, NodeType?: MsoDiagramNodeType): DiagramNode; readonly Application: any; @@ -4169,17 +4375,17 @@ declare namespace Office { readonly LastChild: DiagramNode; readonly Parent: any; SelectAll(): void; + (Index: any): DiagramNode; } - class DiagramNodes { - private 'Office.DiagramNodes_typekey': DiagramNodes; - private constructor(); + interface DiagramNodes { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: any): DiagramNode; readonly Parent: any; SelectAll(): void; + (Index: any): DiagramNode; } class DocumentInspector { @@ -4194,25 +4400,23 @@ declare namespace Office { readonly Parent: any; } - class DocumentInspectors { - private 'Office.DocumentInspectors_typekey': DocumentInspectors; - private constructor(); + interface DocumentInspectors { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): DocumentInspector; readonly Parent: any; + (Index: number): DocumentInspector; } - class DocumentProperties { - private 'Office.DocumentProperties_typekey': DocumentProperties; - private constructor(); + interface DocumentProperties { Add(Name: string, LinkToContent: boolean, Type?: MsoDocProperties, Value?: any, LinkSource?: string): DocumentProperty; Application: TApplication; Count: number; Creator: number; Item(index: string | number): DocumentProperty; Parent: any; + (index: string | number): DocumentProperty; } class DocumentProperty { @@ -4237,22 +4441,21 @@ declare namespace Office { readonly Creator: number; Delete(): void; readonly Index: number; - readonly Modified: any; + readonly Modified: VarDate; readonly ModifiedBy: string; Open(): any; readonly Parent: any; Restore(): any; } - class DocumentLibraryVersions { - private 'Office.DocumentLibraryVersions_typekey': DocumentLibraryVersions; - private constructor(); + interface DocumentLibraryVersions { readonly Application: any; readonly Count: number; readonly Creator: number; readonly IsVersioningEnabled: boolean; Item(lIndex: number): DocumentLibraryVersion; readonly Parent: any; + (lIndex: number): DocumentLibraryVersion; } class EffectParameter { @@ -4264,13 +4467,12 @@ declare namespace Office { Value: any; } - class EffectParameters { - private 'Office.EffectParameters_typekey': EffectParameters; - private constructor(); + interface EffectParameters { readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): EffectParameter; + Item(Index: string | number): EffectParameter; + (Index: string | number): EffectParameter; } class FileDialog { @@ -4303,10 +4505,8 @@ declare namespace Office { readonly Parent: any; } - class FileDialogFilters { - private 'Office.FileDialogFilters_typekey': FileDialogFilters; - private constructor(); - Add(Description: string, Extensions: string, Position?: any): FileDialogFilter; + interface FileDialogFilters { + Add(Description: string, Extensions: string, Position?: number): FileDialogFilter; readonly Application: any; Clear(): void; readonly Count: number; @@ -4314,16 +4514,16 @@ declare namespace Office { Delete(filter?: any): void; Item(Index: number): FileDialogFilter; readonly Parent: any; + (Index: number): FileDialogFilter; } - class FileDialogSelectedItems { - private 'Office.FileDialogSelectedItems_typekey': FileDialogSelectedItems; - private constructor(); + interface FileDialogSelectedItems { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): string; readonly Parent: any; + (Index: number): string; } class FileSearch { @@ -4333,9 +4533,9 @@ declare namespace Office { readonly Creator: number; /** - * @param Office.MsoSortBy [SortBy=1] - * @param Office.MsoSortOrder [SortOrder=1] - * @param boolean [AlwaysAccurate=true] + * @param SortBy [SortBy=1] + * @param SortOrder [SortOrder=1] + * @param AlwaysAccurate [AlwaysAccurate=true] */ Execute(SortBy?: MsoSortBy, SortOrder?: MsoSortOrder, AlwaysAccurate?: boolean): number; FileName: string; @@ -4355,15 +4555,14 @@ declare namespace Office { TextOrProperty: string; } - class FileTypes { - private 'Office.FileTypes_typekey': FileTypes; - private constructor(); + interface FileTypes { Add(FileType: MsoFileType): void; readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): MsoFileType; Remove(Index: number): void; + (Index: number): MsoFileType; } class FillFormat { @@ -4448,13 +4647,12 @@ declare namespace Office { WordArtformat: MsoPresetTextEffect; } - class FoundFiles { - private 'Office.FoundFiles_typekey': FoundFiles; - private constructor(); + interface FoundFiles { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): string; + (Index: number): string; } class FreeformBuilder { @@ -4462,10 +4660,10 @@ declare namespace Office { private constructor(); /** - * @param number [X2=0] - * @param number [Y2=0] - * @param number [X3=0] - * @param number [Y3=0] + * @param X2 [X2=0] + * @param Y2 [Y2=0] + * @param X3 [X3=0] + * @param Y3 [Y3=0] */ AddNodes(SegmentType: MsoSegmentType, EditingType: MsoEditingType, X1: number, Y1: number, X2?: number, Y2?: number, X3?: number, Y3?: number): void; readonly Application: any; @@ -4494,40 +4692,38 @@ declare namespace Office { Transparency: number; } - class GradientStops { - private 'Office.GradientStops_typekey': GradientStops; - private constructor(); + interface GradientStops { readonly Application: any; readonly Count: number; readonly Creator: number; - /** @param number [Index=-1] */ + /** @param Index [Index=-1] */ Delete(Index?: number): void; /** - * @param number [Transparency=0] - * @param number [Index=-1] + * @param Transparency [Transparency=0] + * @param Index [Index=-1] */ Insert(RGB: number, Position: number, Transparency?: number, Index?: number): void; /** - * @param number [Transparency=0] - * @param number [Index=-1] - * @param number [Brightness=0] + * @param Transparency [Transparency=0] + * @param Index [Index=-1] + * @param Brightness [Brightness=0] */ Insert2(RGB: number, Position: number, Transparency?: number, Index?: number, Brightness?: number): void; Item(Index: number): GradientStop; + (Index: number): GradientStop; } - class GroupShapes { - private 'Office.GroupShapes_typekey': GroupShapes; - private constructor(); + interface GroupShapes { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: any): Shape; readonly Parent: any; Range(Index: any): ShapeRange; + (Index: any): Shape; } class HTMLProject { @@ -4537,14 +4733,14 @@ declare namespace Office { readonly Creator: number; readonly HTMLProjectItems: HTMLProjectItems; - /** @param Office.MsoHTMLProjectOpen [OpenKind=0] */ + /** @param OpenKind [OpenKind=0] */ Open(OpenKind?: MsoHTMLProjectOpen): void; readonly Parent: any; - /** @param boolean [Refresh=true] */ + /** @param Refresh [Refresh=true] */ RefreshDocument(Refresh?: boolean): void; - /** @param boolean [Refresh=true] */ + /** @param Refresh [Refresh=true] */ RefreshProject(Refresh?: boolean): void; readonly State: MsoHTMLProjectState; } @@ -4558,21 +4754,20 @@ declare namespace Office { LoadFromFile(FileName: string): void; readonly Name: string; - /** @param Office.MsoHTMLProjectOpen [OpenKind=0] */ + /** @param OpenKind [OpenKind=0] */ Open(OpenKind?: MsoHTMLProjectOpen): void; readonly Parent: any; SaveCopyAs(FileName: string): void; Text: string; } - class HTMLProjectItems { - private 'Office.HTMLProjectItems_typekey': HTMLProjectItems; - private constructor(); + interface HTMLProjectItems { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: any): HTMLProjectItem; readonly Parent: any; + (Index: any): HTMLProjectItem; } class IAssistance { @@ -4584,7 +4779,7 @@ declare namespace Office { /** * SearchHelp Method - * @param string [Scope=''] + * @param Scope [Scope=''] */ SearchHelp(Query: string, Scope?: string): void; @@ -4593,12 +4788,14 @@ declare namespace Office { /** * ShowHelp Method - * @param string [HelpId=''] - * @param string [Scope=''] + * @param HelpId [HelpId=''] + * @param Scope [Scope=''] */ ShowHelp(HelpId?: string, Scope?: string): void; } + /** For Macintosh only */ + // tslint:disable-next-line:interface-name class IFind { private 'Office.IFind_typekey': IFind; private constructor(); @@ -4631,11 +4828,12 @@ declare namespace Office { View: MsoFileFindView; } - class IFoundFiles { - private 'Office.IFoundFiles_typekey': IFoundFiles; - private constructor(); + /** For Macintosh only */ + // tslint:disable-next-line:interface-name + interface IFoundFiles { readonly Count: number; Item(Index: number): string; + (Index: number): string; } class IMsoBorder { @@ -4669,52 +4867,52 @@ declare namespace Office { private 'Office.IMsoChart_typekey': IMsoChart; private constructor(); - /** @param Office.XlDataLabelsType [Type=2] */ + /** @param Type [Type=2] */ _ApplyDataLabels(Type?: XlDataLabelsType, IMsoLegendKey?: any, AutoText?: any, HasLeaderLines?: any): void; readonly Application: any; ApplyChartTemplate(bstrFileName: string): void; ApplyCustomType(ChartType: XlChartType, TypeName?: any): void; - /** @param Office.XlDataLabelsType [Type=2] */ - ApplyDataLabels( - Type?: XlDataLabelsType, IMsoLegendKey?: any, AutoText?: any, HasLeaderLines?: any, ShowSeriesName?: any, ShowCategoryName?: any, ShowValue?: any, - ShowPercentage?: any, ShowBubbleSize?: any, Separator?: any): void; + /** @param Type [Type=2] */ + ApplyDataLabels(Type?: XlDataLabelsType, IMsoLegendKey?: any, AutoText?: any, HasLeaderLines?: any, ShowSeriesName?: any, ShowCategoryName?: any, ShowValue?: any, ShowPercentage?: any, ShowBubbleSize?: any, Separator?: any): void; ApplyLayout(Layout: number, varChartType?: any): void; readonly Area3DGroup: IMsoChartGroup; AreaGroups(Index?: any): any; AutoFormat(rGallery: number, varFormat?: any): void; AutoScaling: boolean; - /** @param Office.XlAxisGroup [AxisGroup=1] */ + /** @param AxisGroup [AxisGroup=1] */ Axes(Type: any, AxisGroup?: XlAxisGroup): any; readonly BackWall: IMsoWalls; readonly Bar3DGroup: IMsoChartGroup; BarGroups(Index?: any): any; BarShape: XlBarShape; + CategoryLabelLevel: XlCategoryLabelLevel; readonly ChartArea: IMsoChartArea; + ChartColor: any; readonly ChartData: IMsoChartData; ChartGroups(pvarIndex?: any, varIgallery?: any): any; ChartStyle: any; readonly ChartTitle: IMsoChartTitle; ChartType: XlChartType; - ChartWizard( - varSource?: any, varGallery?: any, varFormat?: any, varPlotBy?: any, varCategoryLabels?: any, varSeriesLabels?: any, varHasLegend?: any, varTitle?: any, - varCategoryTitle?: any, varValueTitle?: any, varExtraTitle?: any): void; + ChartWizard(varSource?: any, varGallery?: any, varFormat?: any, varPlotBy?: any, varCategoryLabels?: any, varSeriesLabels?: any, varHasLegend?: any, varTitle?: any, varCategoryTitle?: any, varValueTitle?: any, varExtraTitle?: any): void; + ClearToMatchColorStyle(): void; ClearToMatchStyle(): void; readonly Column3DGroup: IMsoChartGroup; ColumnGroups(Index?: any): any; Copy(): any; /** - * @param number [Appearance=1] - * @param number [Format=-4147] - * @param number [Size=2] + * @param Appearance [Appearance=1] + * @param Format [Format=-4147] + * @param Size [Size=2] */ CopyPicture(Appearance?: number, Format?: number, Size?: number): void; readonly Corners: IMsoCorners; readonly Creator: number; readonly DataTable: IMsoDataTable; Delete(): any; + DeleteHiddenContent(): void; DepthPercent: number; DisplayBlanksAs: XlDisplayBlanksAs; DoughnutGroups(Index?: any): any; @@ -4722,10 +4920,12 @@ declare namespace Office { Export(bstr: string, varFilterName?: any, varInteractive?: any): boolean; readonly Floor: IMsoFloor; readonly Format: IMsoChartFormat; + FullSeriesCollection(Index?: any): any; GapDepth: number; GetChartElement(x: number, y: number, ElementID: number, Arg1: number, Arg2: number): void; HasAxis(axisType?: any, AxisGroup?: any): any; HasDataTable: boolean; + readonly HasHiddenContent: boolean; HasLegend: boolean; HasPivotFields: boolean; HasTitle: boolean; @@ -4749,6 +4949,7 @@ declare namespace Office { SaveChartTemplate(bstrFileName: string): void; Select(Replace?: any): any; SeriesCollection(Index?: any): any; + SeriesNameLevel: XlSeriesNameLevel; SetDefaultChart(varName: any): void; SetElement(RHS: MsoChartElementType): void; SetSourceData(Source: string, PlotBy?: any): void; @@ -4756,6 +4957,7 @@ declare namespace Office { ShowAllFieldButtons: boolean; ShowAxisFieldButtons: boolean; ShowDataLabelsOverMaximum: boolean; + ShowExpandCollapseEntireFieldButtons: boolean; ShowLegendFieldButtons: boolean; ShowReportFilterFieldButtons: boolean; ShowValueFieldButtons: boolean; @@ -4764,7 +4966,7 @@ declare namespace Office { readonly SurfaceGroup: IMsoChartGroup; Type: number; - /** @param boolean [fBackWall=true] */ + /** @param fBackWall [fBackWall=true] */ Walls(fBackWall?: boolean): IMsoWalls; XYGroups(Index?: any): any; } @@ -4799,6 +5001,7 @@ declare namespace Office { private 'Office.IMsoChartData_typekey': IMsoChartData; private constructor(); Activate(): void; + ActivateChartDataWindow(): void; BreakLink(): void; readonly IsLinked: boolean; readonly Workbook: any; @@ -4807,7 +5010,9 @@ declare namespace Office { class IMsoChartFormat { private 'Office.IMsoChartFormat_typekey': IMsoChartFormat; private constructor(); + readonly Adjustments: Adjustments; readonly Application: any; + AutoShapeType: MsoAutoShapeType; readonly Creator: number; readonly Fill: FillFormat; readonly Glow: GlowFormat; @@ -4825,12 +5030,21 @@ declare namespace Office { private constructor(); readonly Application: any; AxisGroup: number; + BinsCountValue: number; + BinsOverflowEnabled: boolean; + BinsOverflowValue: number; + BinsType: XlBinsType; + BinsUnderflowEnabled: boolean; + BinsUnderflowValue: number; + BinWidthValue: number; BubbleScale: number; + CategoryCollection(Index?: any): any; readonly Creator: number; DoughnutHoleSize: number; readonly DownBars: IMsoDownBars; readonly DropLines: IMsoDropLines; FirstSliceAngle: number; + FullCategoryCollection(Index?: any): any; GapWidth: number; Has3DShading: boolean; HasDropLines: boolean; @@ -5137,18 +5351,17 @@ declare namespace Office { Weight: number; } - class MetaProperties { - private 'Office.MetaProperties_typekey': MetaProperties; - private constructor(); + interface MetaProperties { readonly Application: any; readonly Count: number; readonly Creator: number; GetItemByInternalName(InternalName: string): MetaProperty; - Item(Index: any): MetaProperty; + Item(Index: number | string): MetaProperty; readonly Parent: any; readonly SchemaXml: string; Validate(): string; readonly ValidationError: string; + (Index: number | string): MetaProperty; } class MetaProperty { @@ -5170,31 +5383,33 @@ declare namespace Office { class MsoDebugOptions { private 'Office.MsoDebugOptions_typekey': MsoDebugOptions; private constructor(); + AddIgnoredAssertTag(bstrTagToIgnore: string): void; readonly Application: any; readonly Creator: number; FeatureReports: number; OutputToDebugger: boolean; OutputToFile: boolean; OutputToMessageBox: boolean; + RemoveIgnoredAssertTag(bstrTagToIgnore: string): void; readonly UnitTestManager: any; } class MsoEnvelope { private 'Office.MsoEnvelope_typekey': MsoEnvelope; private constructor(); - readonly CommandBars: any; + readonly CommandBars: CommandBars; Introduction: string; - readonly Item: any; + readonly Item: Outlook.MailItem; readonly Parent: any; } class NewFile { private 'Office.NewFile_typekey': NewFile; private constructor(); - Add(FileName: string, Section?: any, DisplayName?: any, Action?: any): boolean; + Add(FileName: string, Section?: MsoFileNewSection, DisplayName?: string, Action?: MsoFileNewAction): boolean; readonly Application: any; readonly Creator: number; - Remove(FileName: string, Section?: any, DisplayName?: any, Action?: any): boolean; + Remove(FileName: string, Section?: MsoFileNewSection, DisplayName?: string, Action?: MsoFileNewAction): boolean; } class OfficeTheme { @@ -5234,10 +5449,8 @@ declare namespace Office { WordWrap: MsoTriState; } - class Permission { - private 'Office.Permission_typekey': Permission; - private constructor(); - Add(UserId: string, Permission?: any, ExpirationDate?: any): UserPermission; + interface Permission { + Add(UserId: string, Permission?: MsoPermission, ExpirationDate?: VarDate): UserPermission; readonly Application: any; ApplyPolicy(FileName: string): void; readonly Count: number; @@ -5253,6 +5466,7 @@ declare namespace Office { RemoveAll(): void; RequestPermissionURL: string; StoreLicenses: boolean; + (Index: any): UserPermission; } class PickerDialog { @@ -5266,8 +5480,8 @@ declare namespace Office { Resolve(TokenText: string, duplicateDlgMode: number): PickerResults; /** - * @param boolean [IsMultiSelect=true] - * @param Office.PickerResults [ExistingResults=0] + * @param IsMultiSelect [IsMultiSelect=true] + * @param ExistingResults [ExistingResults=0] */ Show(IsMultiSelect?: boolean, ExistingResults?: PickerResults): PickerResults; Title: string; @@ -5283,24 +5497,22 @@ declare namespace Office { readonly Type: MsoPickerField; } - class PickerFields { - private 'Office.PickerFields_typekey': PickerFields; - private constructor(); + interface PickerFields { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): PickerField; + (Index: number): PickerField; } - class PickerProperties { - private 'Office.PickerProperties_typekey': PickerProperties; - private constructor(); + interface PickerProperties { Add(Id: string, Value: string, Type: MsoPickerField): PickerProperty; readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): PickerProperty; Remove(Id: string): void; + (Index: number): PickerProperty; } class PickerProperty { @@ -5328,16 +5540,14 @@ declare namespace Office { Type: string; } - class PickerResults { - private 'Office.PickerResults_typekey': PickerResults; - private constructor(); - - /** @param string [SIPId=''] */ + interface PickerResults { + /** @param SIPId [SIPId=''] */ Add(Id: string, DisplayName: string, Type: string, SIPId?: string, ItemData?: any, SubItems?: any): PickerResult; readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): PickerResult; + (Index: number): PickerResult; } class PictureEffect { @@ -5352,19 +5562,18 @@ declare namespace Office { Visible: MsoTriState; } - class PictureEffects { - private 'Office.PictureEffects_typekey': PictureEffects; - private constructor(); + interface PictureEffects { readonly Application: any; readonly Count: number; readonly Creator: number; - /** @param number [Index=-1] */ + /** @param Index [Index=-1] */ Delete(Index?: number): void; - /** @param number [Position=-1] */ + /** @param Position [Position=-1] */ Insert(EffectType: MsoPictureEffectType, Position?: number): PictureEffect; Item(Index: number): PictureEffect; + (Index: number): PictureEffect; } class PictureFormat { @@ -5411,17 +5620,15 @@ declare namespace Office { readonly Value: any; } - class PropertyTests { - private 'Office.PropertyTests_typekey': PropertyTests; - private constructor(); - - /** @param Office.MsoConnector [Connector=1] */ + interface PropertyTests { + /** @param Connector [Connector=1] */ Add(Name: string, Condition: MsoCondition, Value: any, SecondValue: any, Connector?: MsoConnector): void; readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): PropertyTest; Remove(Index: number): void; + (Index: number): PropertyTest; } class ReflectionFormat { @@ -5456,14 +5663,13 @@ declare namespace Office { readonly Parent: any; } - class RulerLevels2 { - private 'Office.RulerLevels2_typekey': RulerLevels2; - private constructor(); + interface RulerLevels2 { readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): RulerLevel2; + Item(Index: 1 | 2 | 3 | 4 | 5): RulerLevel2; readonly Parent: any; + (Index: 1 | 2 | 3 | 4 | 5): RulerLevel2; } class ScopeFolder { @@ -5477,13 +5683,12 @@ declare namespace Office { readonly ScopeFolders: ScopeFolders; } - class ScopeFolders { - private 'Office.ScopeFolders_typekey': ScopeFolders; - private constructor(); + interface ScopeFolders { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): ScopeFolder; + (Index: number): ScopeFolder; } class Script { @@ -5501,16 +5706,13 @@ declare namespace Office { readonly Shape: any; } - class Scripts { - private 'Office.Scripts_typekey': Scripts; - private constructor(); - + interface Scripts { /** - * @param Office.MsoScriptLocation [Location=2] - * @param Office.MsoScriptLanguage [Language=2] - * @param string [Id=''] - * @param string [Extended=''] - * @param string [ScriptText=''] + * @param Location [Location=2] + * @param Language [Language=2] + * @param Id [Id=''] + * @param Extended [Extended=''] + * @param ScriptText [ScriptText=''] */ Add(Anchor?: any, Location?: MsoScriptLocation, Language?: MsoScriptLanguage, Id?: string, Extended?: string, ScriptText?: string): Script; readonly Application: any; @@ -5519,17 +5721,17 @@ declare namespace Office { Delete(): void; Item(Index: any): Script; readonly Parent: any; + (Index: any): Script; } - class SearchFolders { - private 'Office.SearchFolders_typekey': SearchFolders; - private constructor(); + interface SearchFolders { Add(ScopeFolder: ScopeFolder): void; readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): ScopeFolder; Remove(Index: number): void; + (Index: number): ScopeFolder; } class SearchScope { @@ -5541,28 +5743,26 @@ declare namespace Office { readonly Type: MsoSearchIn; } - class SearchScopes { - private 'Office.SearchScopes_typekey': SearchScopes; - private constructor(); + interface SearchScopes { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): SearchScope; + (Index: number): SearchScope; } - class ServerPolicy { - private 'Office.ServerPolicy_typekey': ServerPolicy; - private constructor(); + interface ServerPolicy { readonly Application: any; readonly BlockPreview: boolean; readonly Count: number; readonly Creator: number; readonly Description: string; readonly Id: string; - Item(Index: any): PolicyItem; + Item(Index: number | string): PolicyItem; readonly Name: string; readonly Parent: any; readonly Statement: string; + (Index: number | string): PolicyItem; } class ShadowFormat { @@ -5643,10 +5843,10 @@ declare namespace Office { Rotation: number; readonly RTF: string; - /** @param Office.MsoScaleFrom [fScale=0] */ + /** @param fScale [fScale=0] */ ScaleHeight(Factor: number, RelativeToOriginalSize: MsoTriState, fScale?: MsoScaleFrom): void; - /** @param Office.MsoScaleFrom [fScale=0] */ + /** @param fScale [fScale=0] */ ScaleWidth(Factor: number, RelativeToOriginalSize: MsoTriState, fScale?: MsoScaleFrom): void; readonly Script: Script; Select(Replace?: any): void; @@ -5682,19 +5882,17 @@ declare namespace Office { readonly SegmentType: MsoSegmentType; } - class ShapeNodes { - private 'Office.ShapeNodes_typekey': ShapeNodes; - private constructor(); + interface ShapeNodes { readonly Application: any; readonly Count: number; readonly Creator: number; Delete(Index: number): void; /** - * @param number [X2=0] - * @param number [Y2=0] - * @param number [X3=0] - * @param number [Y3=0] + * @param X2 [X2=0] + * @param Y2 [Y2=0] + * @param X3 [X3=0] + * @param Y3 [Y3=0] */ Insert(Index: number, SegmentType: MsoSegmentType, EditingType: MsoEditingType, X1: number, Y1: number, X2?: number, Y2?: number, X3?: number, Y3?: number): void; Item(Index: any): ShapeNode; @@ -5702,11 +5900,10 @@ declare namespace Office { SetEditingType(Index: number, EditingType: MsoEditingType): void; SetPosition(Index: number, X1: number, Y1: number): void; SetSegmentType(Index: number, SegmentType: MsoSegmentType): void; + (Index: any): ShapeNode; } - class ShapeRange { - private 'Office.ShapeRange_typekey': ShapeRange; - private constructor(); + interface ShapeRange { readonly Adjustments: Adjustments; Align(AlignCmd: MsoAlignCmd, RelativeTo: MsoTriState): void; AlternativeText: string; @@ -5753,6 +5950,9 @@ declare namespace Office { Left: number; readonly Line: LineFormat; LockAspectRatio: MsoTriState; + + /** @param PrimaryShape [PrimaryShape=0] */ + MergeShapes(MergeCmd: MsoMergeCmd, PrimaryShape?: Shape): void; Name: string; readonly Nodes: ShapeNodes; readonly Parent: any; @@ -5765,10 +5965,10 @@ declare namespace Office { Rotation: number; readonly RTF: string; - /** @param Office.MsoScaleFrom [fScale=0] */ + /** @param fScale [fScale=0] */ ScaleHeight(Factor: number, RelativeToOriginalSize: MsoTriState, fScale?: MsoScaleFrom): void; - /** @param Office.MsoScaleFrom [fScale=0] */ + /** @param fScale [fScale=0] */ ScaleWidth(Factor: number, RelativeToOriginalSize: MsoTriState, fScale?: MsoScaleFrom): void; readonly Script: Script; Select(Replace?: any): void; @@ -5790,22 +5990,32 @@ declare namespace Office { Width: number; ZOrder(ZOrderCmd: MsoZOrderCmd): void; readonly ZOrderPosition: number; + (Index: any): Shape; } - class Shapes { - private 'Office.Shapes_typekey': Shapes; - private constructor(); + interface Shapes { AddCallout(Type: MsoCalloutType, Left: number, Top: number, Width: number, Height: number): Shape; AddCanvas(Left: number, Top: number, Width: number, Height: number): Shape; /** - * @param Office.XlChartType [Type=-1] - * @param number [Left=-1] - * @param number [Top=-1] - * @param number [Width=-1] - * @param number [Height=-1] + * @param Type [Type=-1] + * @param Left [Left=-1] + * @param Top [Top=-1] + * @param Width [Width=-1] + * @param Height [Height=-1] */ AddChart(Type?: XlChartType, Left?: number, Top?: number, Width?: number, Height?: number): Shape; + + /** + * @param Style [Style=-1] + * @param Type [Type=-1] + * @param Left [Left=-1] + * @param Top [Top=-1] + * @param Width [Width=-1] + * @param Height [Height=-1] + * @param NewLayout [NewLayout=true] + */ + AddChart2(Style?: number, Type?: XlChartType, Left?: number, Top?: number, Width?: number, Height?: number, NewLayout?: boolean): Shape; AddConnector(Type: MsoConnectorType, BeginX: number, BeginY: number, EndX: number, EndY: number): Shape; AddCurve(SafeArrayOfPoints: any): Shape; AddDiagram(Type: MsoDiagramType, Left: number, Top: number, Width: number, Height: number): Shape; @@ -5813,18 +6023,18 @@ declare namespace Office { AddLine(BeginX: number, BeginY: number, EndX: number, EndY: number): Shape; /** - * @param number [Width=-1] - * @param number [Height=-1] + * @param Width [Width=-1] + * @param Height [Height=-1] */ AddPicture(FileName: string, LinkToFile: MsoTriState, SaveWithDocument: MsoTriState, Left: number, Top: number, Width?: number, Height?: number): Shape; AddPolyline(SafeArrayOfPoints: any): Shape; AddShape(Type: MsoAutoShapeType, Left: number, Top: number, Width: number, Height: number): Shape; /** - * @param number [Left=-1] - * @param number [Top=-1] - * @param number [Width=-1] - * @param number [Height=-1] + * @param Left [Left=-1] + * @param Top [Top=-1] + * @param Width [Width=-1] + * @param Height [Height=-1] */ AddSmartArt(Layout: SmartArtLayout, Left?: number, Top?: number, Width?: number, Height?: number): Shape; AddTable(NumRows: number, NumColumns: number, Left: number, Top: number, Width: number, Height: number): Shape; @@ -5840,6 +6050,7 @@ declare namespace Office { readonly Parent: any; Range(Index: any): ShapeRange; SelectAll(): void; + (Index: any): Shape; } class SharedWorkspace { @@ -5847,13 +6058,13 @@ declare namespace Office { private constructor(); readonly Application: any; readonly Connected: boolean; - CreateNew(URL?: any, Name?: any): void; + CreateNew(URL?: string, Name?: string): void; readonly Creator: number; Delete(): void; Disconnect(): void; readonly Files: SharedWorkspaceFiles; readonly Folders: SharedWorkspaceFolders; - readonly LastRefreshed: any; + readonly LastRefreshed: VarDate; readonly Links: SharedWorkspaceLinks; readonly Members: SharedWorkspaceMembers; Name: string; @@ -5870,25 +6081,24 @@ declare namespace Office { private constructor(); readonly Application: any; readonly CreatedBy: string; - readonly CreatedDate: any; + readonly CreatedDate: VarDate; readonly Creator: number; Delete(): void; readonly ModifiedBy: string; - readonly ModifiedDate: any; + readonly ModifiedDate: VarDate; readonly Parent: any; readonly URL: string; } - class SharedWorkspaceFiles { - private 'Office.SharedWorkspaceFiles_typekey': SharedWorkspaceFiles; - private constructor(); - Add(FileName: string, ParentFolder?: any, OverwriteIfFileAlreadyExists?: any, KeepInSync?: any): SharedWorkspaceFile; + interface SharedWorkspaceFiles { + Add(FileName: string, ParentFolder?: SharedWorkspaceFolder, OverwriteIfFileAlreadyExists?: boolean, KeepInSync?: boolean): SharedWorkspaceFile; readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): SharedWorkspaceFile; readonly ItemCountExceeded: boolean; readonly Parent: any; + (Index: number): SharedWorkspaceFile; } class SharedWorkspaceFolder { @@ -5896,21 +6106,20 @@ declare namespace Office { private constructor(); readonly Application: any; readonly Creator: number; - Delete(DeleteEventIfFolderContainsFiles?: any): void; + Delete(DeleteEventIfFolderContainsFiles?: boolean): void; readonly FolderName: string; readonly Parent: any; } - class SharedWorkspaceFolders { - private 'Office.SharedWorkspaceFolders_typekey': SharedWorkspaceFolders; - private constructor(); - Add(FolderName: string, ParentFolder?: any): SharedWorkspaceFolder; + interface SharedWorkspaceFolders { + Add(FolderName: string, ParentFolder?: SharedWorkspaceFolder): SharedWorkspaceFolder; readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): SharedWorkspaceFolder; readonly ItemCountExceeded: boolean; readonly Parent: any; + (Index: number): SharedWorkspaceFolder; } class SharedWorkspaceLink { @@ -5918,28 +6127,27 @@ declare namespace Office { private constructor(); readonly Application: any; readonly CreatedBy: string; - readonly CreatedDate: any; + readonly CreatedDate: VarDate; readonly Creator: number; Delete(): void; Description: string; readonly ModifiedBy: string; - readonly ModifiedDate: any; + readonly ModifiedDate: VarDate; Notes: string; readonly Parent: any; Save(): void; URL: string; } - class SharedWorkspaceLinks { - private 'Office.SharedWorkspaceLinks_typekey': SharedWorkspaceLinks; - private constructor(); - Add(URL: string, Description?: any, Notes?: any): SharedWorkspaceLink; + interface SharedWorkspaceLinks { + Add(URL: string, Description?: string, Notes?: string): SharedWorkspaceLink; readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): SharedWorkspaceLink; readonly ItemCountExceeded: boolean; readonly Parent: any; + (Index: number): SharedWorkspaceLink; } class SharedWorkspaceMember { @@ -5955,16 +6163,15 @@ declare namespace Office { readonly Parent: any; } - class SharedWorkspaceMembers { - private 'Office.SharedWorkspaceMembers_typekey': SharedWorkspaceMembers; - private constructor(); - Add(Email: string, DomainName: string, DisplayName: string, Role?: any): SharedWorkspaceMember; + interface SharedWorkspaceMembers { + Add(Email: string, DomainName: string, DisplayName: string, Role?: string): SharedWorkspaceMember; readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): SharedWorkspaceMember; readonly ItemCountExceeded: boolean; readonly Parent: any; + (Index: number): SharedWorkspaceMember; } class SharedWorkspaceTask { @@ -5973,13 +6180,13 @@ declare namespace Office { readonly Application: any; AssignedTo: string; readonly CreatedBy: string; - readonly CreatedDate: any; + readonly CreatedDate: VarDate; readonly Creator: number; Delete(): void; Description: string; - DueDate: any; + DueDate: VarDate; readonly ModifiedBy: string; - readonly ModifiedDate: any; + readonly ModifiedDate: VarDate; readonly Parent: any; Priority: MsoSharedWorkspaceTaskPriority; Save(): void; @@ -5987,16 +6194,15 @@ declare namespace Office { Title: string; } - class SharedWorkspaceTasks { - private 'Office.SharedWorkspaceTasks_typekey': SharedWorkspaceTasks; - private constructor(); - Add(Title: string, Status?: any, Priority?: any, Assignee?: any, Description?: any, DueDate?: any): SharedWorkspaceTask; + interface SharedWorkspaceTasks { + Add(Title: string, Status?: MsoSharedWorkspaceTaskStatus, Priority?: MsoSharedWorkspaceTaskPriority, Assignee?: SharedWorkspaceMember, Description?: string, DueDate?: VarDate): SharedWorkspaceTask; readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): SharedWorkspaceTask; readonly ItemCountExceeded: boolean; readonly Parent: any; + (Index: number): SharedWorkspaceTask; } class Signature { @@ -6008,7 +6214,7 @@ declare namespace Office { readonly Creator: number; Delete(): void; readonly Details: SignatureInfo; - readonly ExpireDate: any; + readonly ExpireDate: VarDate; readonly IsCertificateExpired: boolean; readonly IsCertificateRevoked: boolean; readonly IsSignatureLine: boolean; @@ -6019,8 +6225,8 @@ declare namespace Office { readonly Setup: SignatureSetup; ShowDetails(): void; Sign(varSigImg?: any, varDelSuggSigner?: any, varDelSuggSignerLine2?: any, varDelSuggSignerEmail?: any): void; - readonly SignatureLineShape: any; - readonly SignDate: any; + readonly SignatureLineShape: Shape; + readonly SignDate: VarDate; readonly Signer: string; readonly SortHint: number; } @@ -6048,9 +6254,7 @@ declare namespace Office { SignatureText: string; } - class SignatureSet { - private 'Office.SignatureSet_typekey': SignatureSet; - private constructor(); + interface SignatureSet { Add(): Signature; AddNonVisibleSignature(varSigProv?: any): Signature; AddSignatureLine(varSigProv?: any): Signature; @@ -6063,6 +6267,7 @@ declare namespace Office { readonly Parent: any; readonly ShowSignaturesPane: boolean; Subset: MsoSignatureSubset; + (iSig: number): Signature; } class SignatureSetup { @@ -6109,14 +6314,13 @@ declare namespace Office { readonly Parent: any; } - class SmartArtColors { - private 'Office.SmartArtColors_typekey': SmartArtColors; - private constructor(); + interface SmartArtColors { readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): SmartArtColor; + Item(Index: number | string): SmartArtColor; readonly Parent: any; + (Index: number | string): SmartArtColor; } class SmartArtLayout { @@ -6131,14 +6335,13 @@ declare namespace Office { readonly Parent: any; } - class SmartArtLayouts { - private 'Office.SmartArtLayouts_typekey': SmartArtLayouts; - private constructor(); + interface SmartArtLayouts { readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): SmartArtLayout; + Item(Index: number | string): SmartArtLayout; readonly Parent: any; + (Index: number | string): SmartArtLayout; } class SmartArtNode { @@ -6146,8 +6349,8 @@ declare namespace Office { private constructor(); /** - * @param Office.MsoSmartArtNodePosition [Position=1] - * @param Office.MsoSmartArtNodeType [Type=1] + * @param Position [Position=1] + * @param Type [Type=1] */ AddNode(Position?: MsoSmartArtNodePosition, Type?: MsoSmartArtNodeType): SmartArtNode; readonly Application: any; @@ -6170,15 +6373,14 @@ declare namespace Office { readonly Type: MsoSmartArtNodeType; } - class SmartArtNodes { - private 'Office.SmartArtNodes_typekey': SmartArtNodes; - private constructor(); + interface SmartArtNodes { Add(): SmartArtNode; readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): SmartArtNode; + Item(Index: number | string): SmartArtNode; readonly Parent: any; + (Index: number | string): SmartArtNode; } class SmartArtQuickStyle { @@ -6193,14 +6395,13 @@ declare namespace Office { readonly Parent: any; } - class SmartArtQuickStyles { - private 'Office.SmartArtQuickStyles_typekey': SmartArtQuickStyles; - private constructor(); + interface SmartArtQuickStyles { readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): SmartArtQuickStyle; + Item(Index: number | string): SmartArtQuickStyle; readonly Parent: any; + (Index: number | string): SmartArtQuickStyle; } class SmartDocument { @@ -6209,7 +6410,7 @@ declare namespace Office { readonly Application: any; readonly Creator: number; - /** @param boolean [ConsiderAllSchemas=false] */ + /** @param ConsiderAllSchemas [ConsiderAllSchemas=false] */ PickSolution(ConsiderAllSchemas?: boolean): void; RefreshPane(): void; SolutionID: string; @@ -6232,7 +6433,7 @@ declare namespace Office { readonly Creator: number; readonly ErrorType: MsoSyncErrorType; GetUpdate(): void; - readonly LastSyncTime: any; + readonly LastSyncTime: VarDate; OpenVersion(SyncVersionType: MsoSyncVersionType): void; readonly Parent: any; PutUpdate(): void; @@ -6253,16 +6454,15 @@ declare namespace Office { Type: MsoTabStopType; } - class TabStops2 { - private 'Office.TabStops2_typekey': TabStops2; - private constructor(); + interface TabStops2 { Add(Type: MsoTabStopType, Position: number): TabStop2; readonly Application: any; readonly Count: number; readonly Creator: number; DefaultSpacing: number; - Item(Index: any): TabStop2; + Item(Index: number): TabStop2; readonly Parent: any; + (Index: number): TabStop2; } class TextColumn2 { @@ -6348,8 +6548,8 @@ declare namespace Office { ChangeCase(Type: MsoTextChangeCase): void; /** - * @param number [Start=-1] - * @param number [Length=-1] + * @param Start [Start=-1] + * @param Length [Length=-1] */ Characters(Start?: number, Length?: number): TextRange2; Copy(): void; @@ -6359,42 +6559,48 @@ declare namespace Office { Delete(): void; /** - * @param number [After=0] - * @param Office.MsoTriState [MatchCase=0] - * @param Office.MsoTriState [WholeWords=0] + * @param After [After=0] + * @param MatchCase [MatchCase=0] + * @param WholeWords [WholeWords=0] */ Find(FindWhat: string, After?: number, MatchCase?: MsoTriState, WholeWords?: MsoTriState): TextRange2; readonly Font: Font2; - /** @param string [NewText=''] */ + /** @param NewText [NewText=''] */ InsertAfter(NewText?: string): TextRange2; - /** @param string [NewText=''] */ + /** @param NewText [NewText=''] */ InsertBefore(NewText?: string): TextRange2; - /** @param Office.MsoTriState [Unicode=0] */ + /** + * @param Formula [Formula=''] + * @param Position [Position=-1] + */ + InsertChartField(ChartFieldType: MsoChartFieldType, Formula?: string, Position?: number): TextRange2; + + /** @param Unicode [Unicode=0] */ InsertSymbol(FontName: string, CharNumber: number, Unicode?: MsoTriState): TextRange2; - Item(Index: any): TextRange2; + Item(Index: number): TextRange2; LanguageID: MsoLanguageID; readonly Length: number; /** - * @param number [Start=-1] - * @param number [Length=-1] + * @param Start [Start=-1] + * @param Length [Length=-1] */ Lines(Start?: number, Length?: number): TextRange2; LtrRun(): void; /** - * @param number [Start=-1] - * @param number [Length=-1] + * @param Start [Start=-1] + * @param Length [Length=-1] */ MathZones(Start?: number, Length?: number): TextRange2; readonly ParagraphFormat: ParagraphFormat2; /** - * @param number [Start=-1] - * @param number [Length=-1] + * @param Start [Start=-1] + * @param Length [Length=-1] */ Paragraphs(Start?: number, Length?: number): TextRange2; readonly Parent: any; @@ -6403,24 +6609,24 @@ declare namespace Office { RemovePeriods(): void; /** - * @param number [After=0] - * @param Office.MsoTriState [MatchCase=0] - * @param Office.MsoTriState [WholeWords=0] + * @param After [After=0] + * @param MatchCase [MatchCase=0] + * @param WholeWords [WholeWords=0] */ Replace(FindWhat: string, ReplaceWhat: string, After?: number, MatchCase?: MsoTriState, WholeWords?: MsoTriState): TextRange2; RotatedBounds(X1: number, Y1: number, X2: number, Y2: number, X3: number, Y3: number, x4: number, y4: number): void; RtlRun(): void; /** - * @param number [Start=-1] - * @param number [Length=-1] + * @param Start [Start=-1] + * @param Length [Length=-1] */ Runs(Start?: number, Length?: number): TextRange2; Select(): void; /** - * @param number [Start=-1] - * @param number [Length=-1] + * @param Start [Start=-1] + * @param Length [Length=-1] */ Sentences(Start?: number, Length?: number): TextRange2; readonly Start: number; @@ -6428,8 +6634,8 @@ declare namespace Office { TrimText(): TextRange2; /** - * @param number [Start=-1] - * @param number [Length=-1] + * @param Start [Start=-1] + * @param Length [Length=-1] */ Words(Start?: number, Length?: number): TextRange2; } @@ -6444,9 +6650,7 @@ declare namespace Office { readonly ThemeColorSchemeIndex: MsoThemeColorSchemeIndex; } - class ThemeColorScheme { - private 'Office.ThemeColorScheme_typekey': ThemeColorScheme; - private constructor(); + interface ThemeColorScheme { readonly Application: any; Colors(Index: MsoThemeColorSchemeIndex): ThemeColor; readonly Count: number; @@ -6455,6 +6659,7 @@ declare namespace Office { Load(FileName: string): void; readonly Parent: any; Save(FileName: string): void; + (Index: MsoThemeColorSchemeIndex): ThemeColor; } class ThemeEffectScheme { @@ -6475,14 +6680,13 @@ declare namespace Office { readonly Parent: any; } - class ThemeFonts { - private 'Office.ThemeFonts_typekey': ThemeFonts; - private constructor(); + interface ThemeFonts { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: MsoFontLanguageIndex): ThemeFont; readonly Parent: any; + (Index: MsoFontLanguageIndex): ThemeFont; } class ThemeFontScheme { @@ -6546,7 +6750,7 @@ declare namespace Office { private constructor(); readonly Application: any; readonly Creator: number; - ExpirationDate: any; + ExpirationDate: VarDate; readonly Parent: any; Permission: number; Remove(): void; @@ -6564,13 +6768,12 @@ declare namespace Office { ProportionalFontSize: number; } - class WebPageFonts { - private 'Office.WebPageFonts_typekey': WebPageFonts; - private constructor(); + interface WebPageFonts { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: MsoCharacterSet): WebPageFont; + (Index: MsoCharacterSet): WebPageFont; } class WorkflowTask { @@ -6590,13 +6793,12 @@ declare namespace Office { readonly WorkflowID: string; } - class WorkflowTasks { - private 'Office.WorkflowTasks_typekey': WorkflowTasks; - private constructor(); + interface WorkflowTasks { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): WorkflowTask; + (Index: number): WorkflowTask; } class WorkflowTemplate { @@ -6612,13 +6814,12 @@ declare namespace Office { Show(): number; } - class WorkflowTemplates { - private 'Office.WorkflowTemplates_typekey': WorkflowTemplates; - private constructor(); + interface WorkflowTemplates { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): WorkflowTemplate; + (Index: number): WorkflowTemplate; } namespace EventHelperTypes { @@ -6703,103 +6904,45 @@ declare namespace Office { } interface ActiveXObject { - on( - obj: Office.CommandBarButton, event: 'Click', argNames: ['Ctrl', 'CancelDefault'], handler: ( - this: Office.CommandBarButton, parameter: {readonly Ctrl: Office.CommandBarButton, CancelDefault: boolean}) => void): void; - on( - obj: Office.CommandBarButton, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Office.CommandBarButton, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; - on( - obj: Office.CommandBarButton, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Office.CommandBarButton, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; + on(obj: Office.CommandBarButton, event: 'Click', argNames: ['Ctrl', 'CancelDefault'], handler: (this: Office.CommandBarButton, parameter: {readonly Ctrl: Office.CommandBarButton, CancelDefault: boolean}) => void): void; + on(obj: Office.CommandBarButton, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Office.CommandBarButton, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; + on(obj: Office.CommandBarButton, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Office.CommandBarButton, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; on(obj: Office.CommandBarButton, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Office.CommandBarButton, parameter: {pctinfo: number}) => void): void; - on( - obj: Office.CommandBarButton, event: 'Invoke', argNames: Office.EventHelperTypes.CommandBarButton_Invoke_ArgNames, handler: ( - this: Office.CommandBarButton, parameter: Office.EventHelperTypes.CommandBarButton_Invoke_Parameter) => void): void; - on( - obj: Office.CommandBarButton, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: ( - this: Office.CommandBarButton, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; + on(obj: Office.CommandBarButton, event: 'Invoke', argNames: Office.EventHelperTypes.CommandBarButton_Invoke_ArgNames, handler: (this: Office.CommandBarButton, parameter: Office.EventHelperTypes.CommandBarButton_Invoke_Parameter) => void): void; + on(obj: Office.CommandBarButton, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Office.CommandBarButton, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; on(obj: Office.CommandBarComboBox, event: 'Change', argNames: ['Ctrl'], handler: (this: Office.CommandBarComboBox, parameter: {readonly Ctrl: Office.CommandBarComboBox}) => void): void; - on( - obj: Office.CommandBarComboBox, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Office.CommandBarComboBox, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; - on( - obj: Office.CommandBarComboBox, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Office.CommandBarComboBox, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; + on(obj: Office.CommandBarComboBox, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Office.CommandBarComboBox, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; + on(obj: Office.CommandBarComboBox, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Office.CommandBarComboBox, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; on(obj: Office.CommandBarComboBox, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Office.CommandBarComboBox, parameter: {pctinfo: number}) => void): void; - on( - obj: Office.CommandBarComboBox, event: 'Invoke', argNames: Office.EventHelperTypes.CommandBarComboBox_Invoke_ArgNames, handler: ( - this: Office.CommandBarComboBox, parameter: Office.EventHelperTypes.CommandBarComboBox_Invoke_Parameter) => void): void; - on( - obj: Office.CommandBarComboBox, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: ( - this: Office.CommandBarComboBox, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; - on( - obj: Office.CommandBars, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Office.CommandBars, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; - on( - obj: Office.CommandBars, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Office.CommandBars, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; + on(obj: Office.CommandBarComboBox, event: 'Invoke', argNames: Office.EventHelperTypes.CommandBarComboBox_Invoke_ArgNames, handler: (this: Office.CommandBarComboBox, parameter: Office.EventHelperTypes.CommandBarComboBox_Invoke_Parameter) => void): void; + on(obj: Office.CommandBarComboBox, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Office.CommandBarComboBox, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; + on(obj: Office.CommandBars, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Office.CommandBars, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; + on(obj: Office.CommandBars, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Office.CommandBars, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; on(obj: Office.CommandBars, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Office.CommandBars, parameter: {pctinfo: number}) => void): void; - on( - obj: Office.CommandBars, event: 'Invoke', argNames: Office.EventHelperTypes.CommandBars_Invoke_ArgNames, handler: ( - this: Office.CommandBars, parameter: Office.EventHelperTypes.CommandBars_Invoke_Parameter) => void): void; + on(obj: Office.CommandBars, event: 'Invoke', argNames: Office.EventHelperTypes.CommandBars_Invoke_ArgNames, handler: (this: Office.CommandBars, parameter: Office.EventHelperTypes.CommandBars_Invoke_Parameter) => void): void; on(obj: Office.CommandBars, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Office.CommandBars, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; - on( - obj: Office.CustomTaskPane, event: 'DockPositionStateChange' | 'VisibleStateChange', argNames: ['CustomTaskPaneInst'], handler: ( - this: Office.CustomTaskPane, parameter: {readonly CustomTaskPaneInst: Office.CustomTaskPane}) => void): void; - on( - obj: Office.CustomTaskPane, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Office.CustomTaskPane, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; - on( - obj: Office.CustomTaskPane, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Office.CustomTaskPane, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; + on(obj: Office.CustomTaskPane, event: 'DockPositionStateChange' | 'VisibleStateChange', argNames: ['CustomTaskPaneInst'], handler: (this: Office.CustomTaskPane, parameter: {readonly CustomTaskPaneInst: Office.CustomTaskPane}) => void): void; + on(obj: Office.CustomTaskPane, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Office.CustomTaskPane, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; + on(obj: Office.CustomTaskPane, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Office.CustomTaskPane, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; on(obj: Office.CustomTaskPane, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Office.CustomTaskPane, parameter: {pctinfo: number}) => void): void; - on( - obj: Office.CustomTaskPane, event: 'Invoke', argNames: Office.EventHelperTypes.CustomTaskPane_Invoke_ArgNames, handler: ( - this: Office.CustomTaskPane, parameter: Office.EventHelperTypes.CustomTaskPane_Invoke_Parameter) => void): void; - on( - obj: Office.CustomTaskPane, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: ( - this: Office.CustomTaskPane, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; - on( - obj: Office.CustomXMLPart, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Office.CustomXMLPart, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; - on( - obj: Office.CustomXMLPart, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Office.CustomXMLPart, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; + on(obj: Office.CustomTaskPane, event: 'Invoke', argNames: Office.EventHelperTypes.CustomTaskPane_Invoke_ArgNames, handler: (this: Office.CustomTaskPane, parameter: Office.EventHelperTypes.CustomTaskPane_Invoke_Parameter) => void): void; + on(obj: Office.CustomTaskPane, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Office.CustomTaskPane, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; + on(obj: Office.CustomXMLPart, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Office.CustomXMLPart, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; + on(obj: Office.CustomXMLPart, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Office.CustomXMLPart, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; on(obj: Office.CustomXMLPart, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Office.CustomXMLPart, parameter: {pctinfo: number}) => void): void; - on( - obj: Office.CustomXMLPart, event: 'Invoke', argNames: Office.EventHelperTypes.CustomXMLPart_Invoke_ArgNames, handler: ( - this: Office.CustomXMLPart, parameter: Office.EventHelperTypes.CustomXMLPart_Invoke_Parameter) => void): void; - on( - obj: Office.CustomXMLPart, event: 'NodeAfterDelete', argNames: ['OldNode', 'OldParentNode', 'OldNextSibling', 'InUndoRedo'], handler: ( - this: Office.CustomXMLPart, - parameter: { - readonly OldNode: Office.CustomXMLNode, readonly OldParentNode: Office.CustomXMLNode, readonly OldNextSibling: Office.CustomXMLNode, readonly InUndoRedo: boolean}) => void): void; - on( - obj: Office.CustomXMLPart, event: 'NodeAfterInsert', argNames: ['NewNode', 'InUndoRedo'], handler: ( - this: Office.CustomXMLPart, parameter: {readonly NewNode: Office.CustomXMLNode, readonly InUndoRedo: boolean}) => void): void; - on( - obj: Office.CustomXMLPart, event: 'NodeAfterReplace', argNames: ['OldNode', 'NewNode', 'InUndoRedo'], handler: ( - this: Office.CustomXMLPart, parameter: {readonly OldNode: Office.CustomXMLNode, readonly NewNode: Office.CustomXMLNode, readonly InUndoRedo: boolean}) => void): void; - on( - obj: Office.CustomXMLPart, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: ( - this: Office.CustomXMLPart, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; - on( - obj: Office.CustomXMLParts, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Office.CustomXMLParts, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; - on( - obj: Office.CustomXMLParts, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Office.CustomXMLParts, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; + on(obj: Office.CustomXMLPart, event: 'Invoke', argNames: Office.EventHelperTypes.CustomXMLPart_Invoke_ArgNames, handler: (this: Office.CustomXMLPart, parameter: Office.EventHelperTypes.CustomXMLPart_Invoke_Parameter) => void): void; + on(obj: Office.CustomXMLPart, event: 'NodeAfterDelete', argNames: ['OldNode', 'OldParentNode', 'OldNextSibling', 'InUndoRedo'], handler: (this: Office.CustomXMLPart, parameter: {readonly OldNode: Office.CustomXMLNode, readonly OldParentNode: Office.CustomXMLNode, readonly OldNextSibling: Office.CustomXMLNode, readonly InUndoRedo: boolean}) => void): void; + on(obj: Office.CustomXMLPart, event: 'NodeAfterInsert', argNames: ['NewNode', 'InUndoRedo'], handler: (this: Office.CustomXMLPart, parameter: {readonly NewNode: Office.CustomXMLNode, readonly InUndoRedo: boolean}) => void): void; + on(obj: Office.CustomXMLPart, event: 'NodeAfterReplace', argNames: ['OldNode', 'NewNode', 'InUndoRedo'], handler: (this: Office.CustomXMLPart, parameter: {readonly OldNode: Office.CustomXMLNode, readonly NewNode: Office.CustomXMLNode, readonly InUndoRedo: boolean}) => void): void; + on(obj: Office.CustomXMLPart, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Office.CustomXMLPart, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; + on(obj: Office.CustomXMLParts, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Office.CustomXMLParts, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; + on(obj: Office.CustomXMLParts, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Office.CustomXMLParts, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; on(obj: Office.CustomXMLParts, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Office.CustomXMLParts, parameter: {pctinfo: number}) => void): void; - on( - obj: Office.CustomXMLParts, event: 'Invoke', argNames: Office.EventHelperTypes.CustomXMLParts_Invoke_ArgNames, handler: ( - this: Office.CustomXMLParts, parameter: Office.EventHelperTypes.CustomXMLParts_Invoke_Parameter) => void): void; + on(obj: Office.CustomXMLParts, event: 'Invoke', argNames: Office.EventHelperTypes.CustomXMLParts_Invoke_ArgNames, handler: (this: Office.CustomXMLParts, parameter: Office.EventHelperTypes.CustomXMLParts_Invoke_Parameter) => void): void; on(obj: Office.CustomXMLParts, event: 'PartAfterAdd', argNames: ['NewPart'], handler: (this: Office.CustomXMLParts, parameter: {readonly NewPart: Office.CustomXMLPart}) => void): void; on(obj: Office.CustomXMLParts, event: 'PartAfterLoad', argNames: ['Part'], handler: (this: Office.CustomXMLParts, parameter: {readonly Part: Office.CustomXMLPart}) => void): void; on(obj: Office.CustomXMLParts, event: 'PartBeforeDelete', argNames: ['OldPart'], handler: (this: Office.CustomXMLParts, parameter: {readonly OldPart: Office.CustomXMLPart}) => void): void; - on( - obj: Office.CustomXMLParts, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: ( - this: Office.CustomXMLParts, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; + on(obj: Office.CustomXMLParts, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Office.CustomXMLParts, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; on(obj: Office.CommandBarButton, event: 'AddRef' | 'Release', handler: (this: Office.CommandBarButton, parameter: {}) => void): void; on(obj: Office.CommandBarComboBox, event: 'AddRef' | 'Release', handler: (this: Office.CommandBarComboBox, parameter: {}) => void): void; on(obj: Office.CommandBars, event: 'AddRef' | 'OnUpdate' | 'Release', handler: (this: Office.CommandBars, parameter: {}) => void): void; @@ -6810,56 +6953,3 @@ interface ActiveXObject { set(obj: Office.CommandBarButton | Office.CommandBarComboBox, propertyName: 'accName' | 'accValue', parameterTypes: [any], newValue: string): void; set(obj: Office.CommandBarComboBox, propertyName: 'List', parameterTypes: [number], newValue: string): void; } - -interface EnumeratorConstructor { - new(col: Office.CanvasShapes | Office.GroupShapes | Office.ShapeRange | Office.Shapes): Enumerator; - new(col: Office.COMAddIns): Enumerator; - new(col: Office.CommandBarControls): Enumerator; - new(col: Office.CommandBars): Enumerator; - new(col: Office.CustomXMLNodes): Enumerator; - new(col: Office.CustomXMLParts): Enumerator; - new(col: Office.CustomXMLPrefixMappings): Enumerator; - new(col: Office.CustomXMLSchemaCollection): Enumerator; - new(col: Office.CustomXMLValidationErrors): Enumerator; - new(col: Office.DiagramNodeChildren | Office.DiagramNodes): Enumerator; - new(col: Office.DocumentInspectors): Enumerator; - new(col: Office.DocumentLibraryVersions): Enumerator; - new(col: Office.EffectParameters): Enumerator; - new(col: Office.FileDialogFilters): Enumerator; - new(col: Office.FileDialogSelectedItems | Office.FoundFiles | Office.IFoundFiles): Enumerator; - new(col: Office.FileTypes): Enumerator; - new(col: Office.GradientStops): Enumerator; - new(col: Office.HTMLProjectItems): Enumerator; - new(col: Office.MetaProperties): Enumerator; - new(col: Office.Permission): Enumerator; - new(col: Office.PickerFields): Enumerator; - new(col: Office.PickerProperties): Enumerator; - new(col: Office.PickerResults): Enumerator; - new(col: Office.PictureEffects): Enumerator; - new(col: Office.PropertyTests): Enumerator; - new(col: Office.RulerLevels2): Enumerator; - new(col: Office.ScopeFolders | Office.SearchFolders): Enumerator; - new(col: Office.Scripts): Enumerator; - new(col: Office.SearchScopes): Enumerator; - new(col: Office.ShapeNodes): Enumerator; - new(col: Office.SharedWorkspaceFiles): Enumerator; - new(col: Office.SharedWorkspaceFolders): Enumerator; - new(col: Office.SharedWorkspaceLinks): Enumerator; - new(col: Office.SharedWorkspaceMembers): Enumerator; - new(col: Office.SharedWorkspaceTasks): Enumerator; - new(col: Office.SignatureSet): Enumerator; - new(col: Office.SmartArtColors): Enumerator; - new(col: Office.SmartArtLayouts): Enumerator; - new(col: Office.SmartArtNodes): Enumerator; - new(col: Office.SmartArtQuickStyles): Enumerator; - new(col: Office.TabStops2): Enumerator; - new(col: Office.TextRange2): Enumerator; - new(col: Office.ThemeFonts): Enumerator; - new(col: Office.WebPageFonts): Enumerator; - new(col: Office.WorkflowTasks): Enumerator; - new(col: Office.WorkflowTemplates): Enumerator; -} - -interface SafeArray { - _brand: SafeArray; -} diff --git a/types/activex-office/tslint.json b/types/activex-office/tslint.json index 3224b40b8b..7b89accc6d 100644 --- a/types/activex-office/tslint.json +++ b/types/activex-office/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "no-const-enum": false + "no-const-enum": false, + "max-line-length": false } } diff --git a/types/activex-outlook/index.d.ts b/types/activex-outlook/index.d.ts index b7a709fe45..37628722b5 100644 --- a/types/activex-outlook/index.d.ts +++ b/types/activex-outlook/index.d.ts @@ -2,7 +2,7 @@ // Project: https://msdn.microsoft.com/en-us/vba/vba-outlook // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 /// /// diff --git a/types/activex-powerpoint/index.d.ts b/types/activex-powerpoint/index.d.ts index 6de089010d..ee59fd0be4 100644 --- a/types/activex-powerpoint/index.d.ts +++ b/types/activex-powerpoint/index.d.ts @@ -2,7 +2,7 @@ // Project: https://msdn.microsoft.com/en-us/library/fp161225.aspx // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 /// /// diff --git a/types/activex-stdole/index.d.ts b/types/activex-stdole/index.d.ts index 9d0c8f3a3c..e738e4f03d 100644 --- a/types/activex-stdole/index.d.ts +++ b/types/activex-stdole/index.d.ts @@ -2,7 +2,7 @@ // Project: https://msdn.microsoft.com/en-us/library/hh272953.aspx // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 declare namespace stdole { type IPictureDisp = StdPicture; @@ -86,7 +86,3 @@ interface ActiveXObjectNameMap { StdFont: stdole.StdFont; StdPicture: stdole.StdPicture; } - -interface SafeArray { - _brand: SafeArray; -} diff --git a/types/activex-vbide/activex-vbide-tests.ts b/types/activex-vbide/activex-vbide-tests.ts index c3d92e51cf..02209ec9bd 100644 --- a/types/activex-vbide/activex-vbide-tests.ts +++ b/types/activex-vbide/activex-vbide-tests.ts @@ -1,21 +1,25 @@ -// tslint:disable-next-line no-unnecessary-generics -const collectionToArray = (col: any): T[] => { +/// + +const collectionToArray = (col: { Item(key: any): T }): T[] => { const results: T[] = []; const enumerator = new Enumerator(col); enumerator.moveFirst(); while (!enumerator.atEnd()) { results.push(enumerator.item()); + enumerator.moveNext(); } return results; }; const app = new ActiveXObject('Word.Application'); -const projects = collectionToArray(app.VBE.VBProjects); -projects.forEach(project => { +app.Visible = true; + +for (const project of collectionToArray(app.VBE.VBProjects)) { WScript.Echo(`Name: ${project.Name}`); - collectionToArray(project.References) - .forEach(reference => { - WScript.Echo(` ${reference.Name} ${reference.Major}.${reference.Minor} -- ${reference.FullPath}`); - }); -}); + for (const reference of collectionToArray(project.References)) { + WScript.Echo(` ${reference.Name} ${reference.Major}.${reference.Minor} -- ${reference.FullPath}`); + } +} + +app.Quit(); diff --git a/types/activex-vbide/index.d.ts b/types/activex-vbide/index.d.ts index 83049260c2..88594969e6 100644 --- a/types/activex-vbide/index.d.ts +++ b/types/activex-vbide/index.d.ts @@ -2,7 +2,7 @@ // Project: https://msdn.microsoft.com/en-us/vba/language-reference-vba/articles/collections-visual-basic-add-in-model // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 /// @@ -99,14 +99,13 @@ declare namespace VBIDE { readonly VBE: VBE; } - class Addins { - private 'VBIDE.Addins_typekey': Addins; - private constructor(); + interface Addins { readonly Count: number; Item(index: any): AddIn; readonly Parent: any; Update(): void; readonly VBE: VBE; + (index: any): AddIn; } class Application { @@ -125,13 +124,13 @@ declare namespace VBIDE { readonly CountOfLines: number; CreateEventProc(EventName: string, ObjectName: string): number; - /** @param number [Count=1] */ + /** @param Count [Count=1] */ DeleteLines(StartLine: number, Count?: number): void; /** - * @param boolean [WholeWord=false] - * @param boolean [MatchCase=false] - * @param boolean [PatternSearch=false] + * @param WholeWord [WholeWord=false] + * @param MatchCase [MatchCase=false] + * @param PatternSearch [PatternSearch=false] */ Find(Target: string, StartLine: number, StartColumn: number, EndLine: number, EndColumn: number, WholeWord?: boolean, MatchCase?: boolean, PatternSearch?: boolean): boolean; InsertLines(Line: number, String: string): void; @@ -161,14 +160,13 @@ declare namespace VBIDE { readonly Window: Window; } - class CodePanes { - private 'VBIDE.CodePanes_typekey': CodePanes; - private constructor(); + interface CodePanes { readonly Count: number; Current: CodePane; Item(index: any): CodePane; readonly Parent: VBE; readonly VBE: VBE; + (index: any): CodePane; } class CommandBarEvents { @@ -185,9 +183,7 @@ declare namespace VBIDE { readonly Parent: Components; } - class Components { - private 'VBIDE.Components_typekey': Components; - private constructor(); + interface Components { Add(ComponentType: vbext_ComponentType): Component; readonly Application: Application; readonly Count: number; @@ -196,6 +192,7 @@ declare namespace VBIDE { readonly Parent: VBProject; Remove(Component: Component): void; readonly VBE: VBE; + (index: any): Component; } class Events { @@ -205,15 +202,14 @@ declare namespace VBIDE { ReferencesEvents(VBProject: VBProject): ReferencesEvents; } - class LinkedWindows { - private 'VBIDE.LinkedWindows_typekey': LinkedWindows; - private constructor(); + interface LinkedWindows { Add(Window: Window): void; readonly Count: number; Item(index: any): Window; readonly Parent: Window; Remove(Window: Window): void; readonly VBE: VBE; + (index: any): Window; } class ProjectTemplate { @@ -223,14 +219,13 @@ declare namespace VBIDE { readonly Parent: Application; } - class Properties { - private 'VBIDE.Properties_typekey': Properties; - private constructor(); + interface Properties { readonly Application: Application; readonly Count: number; Item(index: any): Property; readonly Parent: any; readonly VBE: VBE; + (index: any): Property; } class Property { @@ -263,9 +258,7 @@ declare namespace VBIDE { readonly VBE: VBE; } - class References { - private 'VBIDE.References_typekey': References; - private constructor(); + interface References { AddFromFile(FileName: string): Reference; AddFromGuid(Guid: string, Major: number, Minor: number): Reference; readonly Count: number; @@ -273,6 +266,7 @@ declare namespace VBIDE { readonly Parent: VBProject; Remove(Reference: Reference): void; readonly VBE: VBE; + (index: any): Reference; } class ReferencesEvents { @@ -298,13 +292,11 @@ declare namespace VBIDE { readonly VBE: VBE; } - class VBComponents { - private 'VBIDE.VBComponents_typekey': VBComponents; - private constructor(); + interface VBComponents { Add(ComponentType: vbext_ComponentType): VBComponent; AddCustom(ProgId: string): VBComponent; - /** @param number [index=0] */ + /** @param index [index=0] */ AddMTDesigner(index?: number): VBComponent; readonly Count: number; Import(FileName: string): VBComponent; @@ -312,6 +304,7 @@ declare namespace VBIDE { readonly Parent: VBProject; Remove(VBComponent: VBComponent): void; readonly VBE: VBE; + (index: any): VBComponent; } class VBE { @@ -354,9 +347,7 @@ declare namespace VBIDE { readonly VBE: VBE; } - class VBProjects { - private 'VBIDE.VBProjects_typekey': VBProjects; - private constructor(); + interface VBProjects { Add(Type: vbext_ProjectType): VBProject; readonly Count: number; Item(index: any): VBProject; @@ -364,6 +355,7 @@ declare namespace VBIDE { readonly Parent: VBE; Remove(lpc: VBProject): void; readonly VBE: VBE; + (index: any): VBProject; } class Window { @@ -386,38 +378,18 @@ declare namespace VBIDE { WindowState: vbext_WindowState; } - class Windows { - private 'VBIDE.Windows_typekey': Windows; - private constructor(); + interface Windows { readonly Count: number; CreateToolWindow(AddInInst: AddIn, ProgId: string, Caption: string, GuidPosition: string, DocObj: any): Window; Item(index: any): Window; readonly Parent: Application; readonly VBE: VBE; + (index: any): Window; } } interface ActiveXObject { - on( - obj: VBIDE.CommandBarEvents, event: 'Click', argNames: ['CommandBarControl', 'handled', 'CancelDefault'], handler: ( - this: VBIDE.CommandBarEvents, parameter: {readonly CommandBarControl: any, readonly handled: boolean, readonly CancelDefault: boolean}) => void): void; + on(obj: VBIDE.CommandBarEvents, event: 'Click', argNames: ['CommandBarControl', 'handled', 'CancelDefault'], handler: (this: VBIDE.CommandBarEvents, parameter: {readonly CommandBarControl: any, readonly handled: boolean, readonly CancelDefault: boolean}) => void): void; on(obj: VBIDE.References, event: 'ItemAdded' | 'ItemRemoved', argNames: ['Reference'], handler: (this: VBIDE.References, parameter: {readonly Reference: VBIDE.Reference}) => void): void; - on( - obj: VBIDE.ReferencesEvents, event: 'ItemAdded' | 'ItemRemoved', argNames: ['Reference'], handler: ( - this: VBIDE.ReferencesEvents, parameter: {readonly Reference: VBIDE.Reference}) => void): void; -} - -interface EnumeratorConstructor { - new(col: VBIDE.Addins): Enumerator; - new(col: VBIDE.CodePanes): Enumerator; - new(col: VBIDE.Components): Enumerator; - new(col: VBIDE.LinkedWindows | VBIDE.Windows): Enumerator; - new(col: VBIDE.Properties): Enumerator; - new(col: VBIDE.References): Enumerator; - new(col: VBIDE.VBComponents): Enumerator; - new(col: VBIDE.VBProjects): Enumerator; -} - -interface SafeArray { - _brand: SafeArray; + on(obj: VBIDE.ReferencesEvents, event: 'ItemAdded' | 'ItemRemoved', argNames: ['Reference'], handler: (this: VBIDE.ReferencesEvents, parameter: {readonly Reference: VBIDE.Reference}) => void): void; } diff --git a/types/activex-vbide/tslint.json b/types/activex-vbide/tslint.json index 3224b40b8b..7b89accc6d 100644 --- a/types/activex-vbide/tslint.json +++ b/types/activex-vbide/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "no-const-enum": false + "no-const-enum": false, + "max-line-length": false } } diff --git a/types/activex-word/index.d.ts b/types/activex-word/index.d.ts index 7fe194552a..879af9021d 100644 --- a/types/activex-word/index.d.ts +++ b/types/activex-word/index.d.ts @@ -2,7 +2,7 @@ // Project: https://msdn.microsoft.com/en-us/library/fp179696.aspx // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 /// /// From fdb2c25846c0ea21a4e07569008d6d32dd9b8d6f Mon Sep 17 00:00:00 2001 From: Bruno Lemos Date: Tue, 24 Apr 2018 22:34:33 -0300 Subject: [PATCH 0869/2153] [react-native] Support Layout Props (#25083) Support some styles as View and Image props, e.g. --- types/react-native/index.d.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index a76bdb6e4c..fe73c7abae 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -536,6 +536,7 @@ type FlexAlignType = "flex-start" | "flex-end" | "center" | "stretch" | "baselin /** * Flex Prop Types * @see https://facebook.github.io/react-native/docs/flexbox.html#proptypes + * @see https://facebook.github.io/react-native/docs/layout-props.html * @see LayoutPropTypes.js */ export interface FlexStyle { @@ -598,6 +599,14 @@ export interface FlexStyle { direction?: "inherit" | "ltr" | "rtl"; } + +/** + * Layout Prop Types + * @see https://facebook.github.io/react-native/docs/layout-props.html + * @see LayoutPropTypes.js + */ +export interface LayoutProperties extends FlexStyle {} + /** * @see ShadowPropTypesIOS.js */ @@ -1752,7 +1761,7 @@ type AccessibilityTraits = * @see https://facebook.github.io/react-native/docs/view.html#props */ export interface ViewProperties - extends ViewPropertiesAndroid, ViewPropertiesIOS, GestureResponderHandlers, Touchable, AccessibilityProperties { + extends ViewPropertiesAndroid, ViewPropertiesIOS, GestureResponderHandlers, Touchable, AccessibilityProperties, LayoutProperties { /** * This defines how far a touch event can start away from the view. * Typical interface guidelines recommend touch targets that are at least @@ -3344,7 +3353,7 @@ interface ImagePropertiesAndroid { * @see https://facebook.github.io/react-native/docs/image.html */ export type ImagePropertiesSourceOptions = ImageURISource | ImageURISource[] | ImageRequireSource; -export interface ImageProperties extends ImagePropertiesIOS, ImagePropertiesAndroid, AccessibilityProperties { +export interface ImageProperties extends ImagePropertiesIOS, ImagePropertiesAndroid, AccessibilityProperties, LayoutProperties { /** * onLayout function * From b73b4426dd1cd78b7ddf4f4d1cc5b6316fd6956f Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 24 Apr 2018 17:44:50 -0700 Subject: [PATCH 0870/2153] compatibility fix for keyof T in ts 2.9 --- types/aphrodite/index.d.ts | 8 +------- types/dispatchr/addons/createStore.d.ts | 3 +-- .../google-cloud__datastore-tests.ts | 3 +-- types/google-cloud__datastore/index.d.ts | 10 ++++++---- types/grid-styled/index.d.ts | 5 +---- types/mirrorx/index.d.ts | 3 +-- types/react-autosuggest/index.d.ts | 6 +----- types/react-bootstrap-table/index.d.ts | 2 +- types/react-bootstrap/index.d.ts | 3 +-- types/react-dynamic-number/index.d.ts | 6 +----- types/react-geosuggest/index.d.ts | 7 +------ types/react-i18next/src/translate.d.ts | 7 +++---- types/react-redux/index.d.ts | 3 +-- types/react-relay/index.d.ts | 4 +--- types/react-router/index.d.ts | 3 +-- types/recompose/index.d.ts | 3 +-- types/redux-form/index.d.ts | 3 +-- 17 files changed, 24 insertions(+), 55 deletions(-) diff --git a/types/aphrodite/index.d.ts b/types/aphrodite/index.d.ts index 583e84e996..a82ec2f36b 100644 --- a/types/aphrodite/index.d.ts +++ b/types/aphrodite/index.d.ts @@ -12,13 +12,7 @@ type FontFamily = | BaseCSSProperties['fontFamily'] | CSS.FontFace; -// Replace with Exclude once on 2.8+ -type Diff = ( - & { [P in T]: P } - & { [P in U]: never } - & { [x: string]: never } -)[T]; -type Omit = Pick>; +type Omit = Pick; type CSSProperties = Omit & { fontFamily?: FontFamily | FontFamily[]; diff --git a/types/dispatchr/addons/createStore.d.ts b/types/dispatchr/addons/createStore.d.ts index 86a1f24fbb..bf576156fc 100644 --- a/types/dispatchr/addons/createStore.d.ts +++ b/types/dispatchr/addons/createStore.d.ts @@ -1,7 +1,6 @@ import { StoreClass, Store } from '../index'; -type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; -type Omit = Pick>; +type Omit = Pick; interface StoreOptions { storeName: string; diff --git a/types/google-cloud__datastore/google-cloud__datastore-tests.ts b/types/google-cloud__datastore/google-cloud__datastore-tests.ts index 3093a8256a..cb723d0d5b 100644 --- a/types/google-cloud__datastore/google-cloud__datastore-tests.ts +++ b/types/google-cloud__datastore/google-cloud__datastore-tests.ts @@ -14,8 +14,7 @@ interface TestEntity { name?: string; location?: string; symbol?: string; - - [keySymbol: string]: any; + [Datastore.KEY]?: any; } const kind = 'Company'; diff --git a/types/google-cloud__datastore/index.d.ts b/types/google-cloud__datastore/index.d.ts index 8c9cdd23c3..f864f965c9 100644 --- a/types/google-cloud__datastore/index.d.ts +++ b/types/google-cloud__datastore/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/googleapis/nodejs-datastore // Definitions by: Antoine Beauvais-Lacasse // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.7 /// @@ -36,7 +36,7 @@ declare module '@google-cloud/datastore' { class Datastore extends DatastoreRequest_ { constructor(options: InitOptions); - readonly KEY: KEY_SYMBOL; + readonly KEY: typeof Datastore.KEY; readonly MORE_RESULTS_AFTER_CURSOR: MoreResultsAfterCursor; readonly MORE_RESULTS_AFTER_LIMIT: MoreResultsAfterLimit; readonly NO_MORE_RESULTS: NoMoreResults; @@ -81,7 +81,7 @@ declare module '@google-cloud/datastore' { } namespace Datastore { - const KEY: KEY_SYMBOL; + const KEY: unique symbol; const MORE_RESULTS_AFTER_CURSOR: MoreResultsAfterCursor; const MORE_RESULTS_AFTER_LIMIT: MoreResultsAfterLimit; const NO_MORE_RESULTS: NoMoreResults; @@ -93,6 +93,8 @@ declare module '@google-cloud/datastore' { } declare module '@google-cloud/datastore/entity' { + import Datastore = require("@google-cloud/datastore"); + interface DatastoreInt { value: string; } @@ -133,7 +135,7 @@ declare module '@google-cloud/datastore/entity' { parent?: DatastoreKey; } - type KEY_SYMBOL = symbol; + type KEY_SYMBOL = typeof Datastore.KEY; interface DatastorePayload { key: DatastoreKey; diff --git a/types/grid-styled/index.d.ts b/types/grid-styled/index.d.ts index 8cce111478..0006be1db8 100644 --- a/types/grid-styled/index.d.ts +++ b/types/grid-styled/index.d.ts @@ -5,10 +5,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 -export type Diff = ({ [P in T]: P } & - { [P in U]: never } & { [x: string]: never })[T]; - -export type Omit = Pick>; +export type Omit = Pick; import { ComponentClass } from "react"; import { StyledComponentClass } from "styled-components"; diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index b4bebc9cea..3e7090eab2 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -11,8 +11,7 @@ import * as React from 'react'; import { Connect } from 'react-redux'; import { match } from "react-router"; -export type Diff = ({[P in T]: P } & {[P in U]: never } & { [x: string]: never })[T]; -export type Omit = Pick>; +export type Omit = Pick; export interface model { name: string; diff --git a/types/react-autosuggest/index.d.ts b/types/react-autosuggest/index.d.ts index b78ee34ab8..ab91481925 100644 --- a/types/react-autosuggest/index.d.ts +++ b/types/react-autosuggest/index.d.ts @@ -22,11 +22,7 @@ declare namespace Autosuggest { */ /** @internal */ - type Diff = ({ [P in T]: P } & - { [P in U]: never } & { [x: string]: never })[T]; - - /** @internal */ - type Omit = Pick>; + type Omit = Pick; interface SuggestionsFetchRequestedParams { value: string; diff --git a/types/react-bootstrap-table/index.d.ts b/types/react-bootstrap-table/index.d.ts index 6e9fd1dea8..d98dac1c44 100644 --- a/types/react-bootstrap-table/index.d.ts +++ b/types/react-bootstrap-table/index.d.ts @@ -1022,7 +1022,7 @@ export interface Options { * The function allows you to make further modifications to the cell value prior to it being saved. You need to * return the final cell value to use. */ - onCellEdit?(row: TRow, fieldName: K, value: TRow[K]): TRow[K]; + onCellEdit?(row: TRow, fieldName: K, value: TRow[K]): TRow[K]; /** * Custom message to show when the InsertModal save fails validation. * Default message is 'Form validate errors, please checking!' diff --git a/types/react-bootstrap/index.d.ts b/types/react-bootstrap/index.d.ts index 45a645fc32..6a78dcbb1a 100644 --- a/types/react-bootstrap/index.d.ts +++ b/types/react-bootstrap/index.d.ts @@ -17,8 +17,7 @@ import * as React from 'react'; -export type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; -export type Omit = Pick>; +export type Omit = Pick; export type Sizes = 'xs' | 'xsmall' | 'sm' | 'small' | 'medium' | 'lg' | 'large'; diff --git a/types/react-dynamic-number/index.d.ts b/types/react-dynamic-number/index.d.ts index c1ffdc229d..559d0c9d01 100644 --- a/types/react-dynamic-number/index.d.ts +++ b/types/react-dynamic-number/index.d.ts @@ -6,11 +6,7 @@ import * as React from 'react'; -/** - * remove Diff & Omit when in will be placed in TS from scratch - */ -export type Diff = ({[P in T]: P} & {[P in U]: never} & {[x: string]: never})[T]; -export type Omit = {[P in Diff]: T[P]}; +export type Omit = Pick; export type BaseInputProps = Partial< Omit< diff --git a/types/react-geosuggest/index.d.ts b/types/react-geosuggest/index.d.ts index 344e768b08..2d31ba4d6d 100644 --- a/types/react-geosuggest/index.d.ts +++ b/types/react-geosuggest/index.d.ts @@ -17,12 +17,7 @@ export default class Geosuggest extends Component { } // Replace with Exclude once on 2.8+ -export type Diff = ( - & { [P in T]: P } - & { [P in U]: never } - & { [x: string]: never } -)[T]; -export type Omit = Pick>; +export type Omit = Pick; export interface GeosuggestProps extends Omit, 'style'> { placeholder?: string; diff --git a/types/react-i18next/src/translate.d.ts b/types/react-i18next/src/translate.d.ts index 0711d3895d..0383ee1ead 100644 --- a/types/react-i18next/src/translate.d.ts +++ b/types/react-i18next/src/translate.d.ts @@ -20,8 +20,7 @@ export interface TranslateHocProps { } // Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766 -type Diff = ({[P in T]: P } & {[P in U]: never } & { [x: string]: never })[T]; -type Omit = Pick>; +type Omit = Pick; type InjectedProps = InjectedI18nProps & InjectedTranslateProps; @@ -32,11 +31,11 @@ export interface WrapperComponentClass

extends React.Comp // Injects props and removes them from the prop requirements. // Adds the new properties t (or whatever the translation function is called) and i18n if needed. export type InferableComponentEnhancerWithProps = -

(component: React.ComponentClass

| React.StatelessComponent

) => +

(component: React.ComponentClass

| React.StatelessComponent

) => React.ComponentClass & TranslateHocProps>; export type InferableComponentEnhancerWithPropsAndRef = -

(component: React.ComponentClass

| React.StatelessComponent

) => +

(component: React.ComponentClass

| React.StatelessComponent

= Omit

; diff --git a/types/react-router/index.d.ts b/types/react-router/index.d.ts index 01654c8304..23f2f4f78a 100644 --- a/types/react-router/index.d.ts +++ b/types/react-router/index.d.ts @@ -102,8 +102,7 @@ export interface match

{ } // Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766 -export type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; -export type Omit = Pick>; +export type Omit = Pick; export function matchPath

(pathname: string, props: RouteProps): match

| null; diff --git a/types/recompose/index.d.ts b/types/recompose/index.d.ts index 222f0ed539..0c7b9089c6 100644 --- a/types/recompose/index.d.ts +++ b/types/recompose/index.d.ts @@ -20,8 +20,7 @@ declare module 'recompose' { type predicateDiff = (current: T, next: T) => boolean // Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766 - type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; - type Omit = Pick>; + type Omit = Pick; interface Observer{ next(props: T): void; diff --git a/types/redux-form/index.d.ts b/types/redux-form/index.d.ts index 3ecfe65cd4..8ee5fa9698 100644 --- a/types/redux-form/index.d.ts +++ b/types/redux-form/index.d.ts @@ -39,8 +39,7 @@ export interface RegisteredFieldState { type: FieldType; } -export type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; -export type Omit = Pick>; +export type Omit = Pick; export * from "./lib/reduxForm"; export * from "./lib/Field"; From 689c9abdb257bc88346a572880fc62df879866d6 Mon Sep 17 00:00:00 2001 From: Wouter van Heeswijk Date: Wed, 25 Apr 2018 11:40:14 +0200 Subject: [PATCH 0871/2153] .tz() can also return undefined as per the docs --- types/moment-timezone/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/moment-timezone/index.d.ts b/types/moment-timezone/index.d.ts index c3927415c6..727c91cad4 100644 --- a/types/moment-timezone/index.d.ts +++ b/types/moment-timezone/index.d.ts @@ -57,7 +57,7 @@ declare module "moment" { } interface Moment { - tz(): string; + tz(): string | undefined; tz(timezone: string): Moment; zoneAbbr(): string; zoneName(): string; From e6c708ae1a6d86fd0459ce89ad2a0d05c09d222f Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Wed, 25 Apr 2018 17:31:02 +0530 Subject: [PATCH 0872/2153] 16.1.37 added --- types/ej.web.all/ej.web.all-tests.ts | 1354 +++++++++++++------------- types/ej.web.all/index.d.ts | 225 +++-- 2 files changed, 837 insertions(+), 742 deletions(-) diff --git a/types/ej.web.all/ej.web.all-tests.ts b/types/ej.web.all/ej.web.all-tests.ts index 83ed128742..62ad67ce7b 100644 --- a/types/ej.web.all/ej.web.all-tests.ts +++ b/types/ej.web.all/ej.web.all-tests.ts @@ -1,3 +1,7 @@ +/* tslint:disable */ + + + module AccordionComponent { $(function () { var sample = new ej.Accordion($("#basicAccordion"), { @@ -18,39 +22,39 @@ module AccordionComponent { }); } + - -module AutocompleteComponent { +module AutocompleteComponent{ var carList = [ - "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", - "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", - "Chevrolet Camaro", "Cadillac", - "Duesenberg J", "Dodge Sprinter", - "Elantra", "Excavator", - "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", - "GAZ Siber", - "Honda S2000", "Hyundai Santro", - "Isuzu Swift", "Infiniti Skyline", - "Jaguar XJS", - "Kia Sedona EX", "Koenigsegg Agera", - "Lotus Esprit", "Lamborghini Diablo", - "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", - "Nissan Qashqai", - "Oldsmobile S98", "Opel Superboss", - "Porsche 356", "Pontiac Sunbird", - "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", - "Triumph Spitfire", "Toyota 2000GT", - "Volvo P1800", "Volkswagen Shirako" - ]; - $(function () { - var autocompleteInstance = new ej.Autocomplete($("#selectCar"), { + "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", + "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", + "Chevrolet Camaro", "Cadillac", + "Duesenberg J", "Dodge Sprinter", + "Elantra", "Excavator", + "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", + "GAZ Siber", + "Honda S2000", "Hyundai Santro", + "Isuzu Swift", "Infiniti Skyline", + "Jaguar XJS", + "Kia Sedona EX", "Koenigsegg Agera", + "Lotus Esprit", "Lamborghini Diablo", + "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", + "Nissan Qashqai", + "Oldsmobile S98", "Opel Superboss", + "Porsche 356", "Pontiac Sunbird", + "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", + "Triumph Spitfire", "Toyota 2000GT", + "Volvo P1800", "Volkswagen Shirako" + ]; + $(function () { + var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { width: "100%", watermarkText: "Select a car", dataSource: carList, enableAutoFill: true, showPopupButton: true, multiSelectMode: "delimiter" - }); + }); }); } @@ -193,12 +197,12 @@ module ChartComponent { range: { min: 25, max: 50, interval: 5 }, labelFormat: "{value}%", title: { text: "Efficiency" }, - + }, commonSeriesOptions: - { + { type: 'line', enableAnimation: true, - tooltip: { visible: true, template: 'Tooltip' }, + tooltip:{ visible :true, template:'Tooltip'}, marker: { shape: 'circle', @@ -208,30 +212,30 @@ module ChartComponent { }, visible: true }, - border: { width: 2 } - }, - series: - [ + border : {width: 2} + }, + series: + [ + { + points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, + { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], + name: 'India' + }, { - points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 }, { x: 2007, y: 26 }, { x: 2008, y: 27 }, - { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], - name: 'India' + points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, + { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], + name: 'Germany' }, + { + points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, + { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], + name: 'England' + }, { - points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 }, { x: 2007, y: 30 }, { x: 2008, y: 36 }, - { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], - name: 'Germany' - }, - { - points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 }, { x: 2007, y: 34 }, { x: 2008, y: 41 }, - { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], - name: 'England' - }, - { - points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 }, { x: 2007, y: 40 }, { x: 2008, y: 44 }, - { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], - name: 'France' - } + points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, + { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], + name: 'France' + } ], isResponsive: true, load: function () { @@ -296,14 +300,13 @@ module ChartComponent { theme = "flatlight"; break; } - sender.model.theme = theme; + sender.model.theme = theme; } }, title: { text: 'Efficiency of oil-fired power production' }, size: { height: "600" }, - legend: { visible: true }, + legend: { visible: true}, }); - // chartsample.model.load="loadTheme"; }); } @@ -357,7 +360,7 @@ module circulargaugecomponent { backgroundColor: "#f5b43f", border: { color: "#f5b43f" } }] - }] + }] }); }); } @@ -376,21 +379,21 @@ module ColorPickerComponent { -module ComboBoxComponent { +module ComboBoxComponent{ var BikeList = [ { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, { empid: "bk4", text: "Discover" }, { empid: "bk5", text: "Dazzler" }, { empid: "bk6", text: "Flame" }, { empid: "bk7", text: "Fazzer" }, { empid: "bk8", text: "FZ-S" }, { empid: "bk9", text: "Pulsar" }, { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } ]; - $(function () { - var comboboxInstance = new ej.ComboBox($("#selectCar"), { + $(function () { + var comboboxInstance =new ej.ComboBox($("#selectCar"), { width: "100%", placeholder: "Select a Bike", - fields: { text: "text", value: "empid" }, + fields: { text: "text", value: "empid" }, dataSource: BikeList, autofill: true - }); + }); }); } @@ -462,8 +465,7 @@ $(function () { }), createNode({ name: "Project", width: 150, height: 100, offsetX: 300, offsetY: 430, labels: [createLabel({ "text": "Find Project \nmanager" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Decision }), createNode({ - name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process - }), + name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), createNode({ name: "Decision", width: 250, height: 60, offsetX: 550, offsetY: 60, labels: [createLabel({ "text": "Decision Process for new software ideas" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Card, fillColor: "#858585", borderColor: "#858585" }), createNode({ name: "Reject", width: 150, height: 60, offsetX: 550, offsetY: 285, labels: [createLabel({ "text": "Reject and write report" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), createNode({ name: "Resources", width: 150, height: 60, offsetX: 550, offsetY: 430, labels: [createLabel({ "text": "Hire new resources" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }) @@ -477,7 +479,7 @@ $(function () { createConnector({ name: "connector6", sourceNode: "Project", targetNode: "Resources", labels: [createLabel({ "text": "No" })] }) ] }); - + }); function createNode(option: ej.datavisualization.Diagram.Node) { @@ -498,11 +500,11 @@ function createConnector(option: ej.datavisualization.Diagram.Connector) { return option; } -function createLabel(options: any) { +function createLabel(options : any) { return options; } - + module DialogComponent { $(function () { @@ -510,17 +512,15 @@ module DialogComponent { width: 550, minWidth: 310, minHeight: 215, - target: ".control", - close: () => { - $("#btnOpen").show(); - } + target:".control", + close:()=>{ + $("#btnOpen").show();} }); var btnInstance = new ej.Button($("#btnOpen"), { size: "medium", - click: () => { - $("#btnOpen").hide(); - $("#basicDialog").ejDialog("open"); - }, + click: ()=>{ + $("#btnOpen").hide(); + $("#basicDialog").ejDialog("open");}, type: "button", height: 30, width: 150 @@ -554,7 +554,7 @@ module digitalgaugecomponent { } - + @@ -566,7 +566,7 @@ module DropDownListComponent { { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } ]; $(function () { - var sample = new ej.DropDownList($("#bikeList"), { + var sample = new ej.DropDownList($("#bikeList"),{ dataSource: BikeList, width: "100%", watermarkText: "Select a bike", @@ -574,12 +574,12 @@ module DropDownListComponent { enableFilterSearch: true, caseSensitiveSearch: true, enableIncrementalSearch: true, - enablePopupResize: true, + enablePopupResize: true, delimiterChar: ";", multiSelectMode: ej.MultiSelectMode.Delimiter, maxPopupHeight: "300px", - minPopupHeight: "150px", - maxPopupWidth: "500px", + minPopupHeight: "150px", + maxPopupWidth: "500px", minPopupWidth: "350px", showCheckbox: true, showRoundedCorner: true @@ -610,53 +610,53 @@ module ExplorerComponent { module GanttComponent { - $(function () { - var ganttInstance = new ej.Gantt($("#GanttContainer"), { - dataSource: (window).projectData, - allowColumnResize: true, - allowSorting: true, - allowSelection: true, - enableContextMenu: true, - taskIdMapping: "taskID", - allowDragAndDrop: true, - taskNameMapping: "taskName", - startDateMapping: "startDate", - showColumnChooser: true, - showColumnOptions: true, - progressMapping: "progress", - durationMapping: "duration", - endDateMapping: "endDate", - childMapping: "subtasks", - scheduleStartDate: "02/01/2017", - scheduleEndDate: "04/09/2017", - //Resources mapping - resourceInfoMapping: "resourceId", - resourceNameMapping: "resourceName", - resourceIdMapping: "resourceId", - resources: (window).projectResources, - predecessorMapping: "predecessor", - showResourceNames: true, - toolbarSettings: { - showToolbar: true, - toolbarItems: ["add", "edit", "delete", "update", "cancel", "indent", "outdent", "expandAll", "collapseAll", "search"] - }, - editSettings: { - allowEditing: true, - allowAdding: true, - allowDeleting: true, - allowIndent: true, - editMode: "cellEditing" - }, - sizeSettings: { - width: "100%", - height: "100%" - }, - dragTooltip: { showTooltip: true }, - showGridCellTooltip: true, - treeColumnIndex: 1, - isResponsive: true, - }); + $(function () { + var ganttInstance = new ej.Gantt($("#GanttContainer"), { + dataSource: (window).projectData, + allowColumnResize: true, + allowSorting: true, + allowSelection: true, + enableContextMenu: true, + taskIdMapping: "taskID", + allowDragAndDrop: true, + taskNameMapping: "taskName", + startDateMapping: "startDate", + showColumnChooser: true, + showColumnOptions: true, + progressMapping: "progress", + durationMapping: "duration", + endDateMapping: "endDate", + childMapping: "subtasks", + scheduleStartDate: "02/01/2017", + scheduleEndDate: "04/09/2017", + //Resources mapping + resourceInfoMapping: "resourceId", + resourceNameMapping: "resourceName", + resourceIdMapping: "resourceId", + resources: (window).projectResources, + predecessorMapping: "predecessor", + showResourceNames: true, + toolbarSettings: { + showToolbar: true, + toolbarItems: ["add","edit","delete","update","cancel","indent","outdent","expandAll","collapseAll","search"] + }, + editSettings: { + allowEditing: true, + allowAdding: true, + allowDeleting: true, + allowIndent: true, + editMode: "cellEditing" + }, + sizeSettings: { + width: "100%", + height: "100%" + }, + dragTooltip: { showTooltip: true }, + showGridCellTooltip: true, + treeColumnIndex: 1, + isResponsive: true, }); +}); } @@ -749,7 +749,7 @@ $(function () { module KanbanComponent { $(function () { var sample = new ej.Kanban($("#Kanban"), { - dataSource: new ej.DataManager((window).kanbanData).executeLocal(new ej.Query().take(20)), + dataSource: new ej.DataManager((window).kanbanData).executeLocal(new ej.Query().take(20)), columns: [ { headerText: "Backlog", key: "Open" }, { headerText: "In Progress", key: "InProgress" }, @@ -768,7 +768,7 @@ module KanbanComponent { }); } - + module lineargaugecomponent { @@ -794,14 +794,14 @@ module lineargaugecomponent { backgroundColor: "#E94649", border: { color: "#E94649" }, startWidth: 4, endWidth: 4 }] - }] + }] }); }); } + - - + module ListBoxComponent { $(function () { @@ -811,13 +811,13 @@ module ListBoxComponent { }); } - + module ListviewComponent { $(function () { var listviewInstance = new ej.ListView($("#defaultlistview"), { - enableCheckMark: true, - width: 400 + enableCheckMark: true, + width: 400 }); }); } @@ -1056,7 +1056,7 @@ module mapcomponenet { module MenuComponent { $(function () { - var sample = new ej.Menu($("#syncfusionProducts"), { + var sample = new ej.Menu($("#syncfusionProducts"),{ width: "100%", animationType: ej.AnimationType.Default, cssClass: 'gradient-lime ', @@ -1081,12 +1081,12 @@ module MenuComponent { - + module NavigationDrawerComponent { $(function () { var navigationdrawerInstance = new ej.NavigationDrawer($("#navpane"), { - targetId: "butdrawer", + targetId: "butdrawer", contentId: "content_container", type: "overlay", direction: "left", @@ -1097,8 +1097,8 @@ module NavigationDrawerComponent { }, position: "normal" }); - $("#navpane_listview").click(function (e: any) { - var text = e.target["text"] || $(e.target).closest("li.e-list").text(); + $("#navpane_listview").click(function(e: any) { + var text=e.target["text"]||$(e.target).closest("li.e-list").text(); $("#butdrawer").parent().children("h2").text(text); }); }); @@ -1109,7 +1109,7 @@ module NavigationDrawerComponent { module PDFViewerComponent { $(function () { var pdfviewerControl = new ej.PdfViewer($("#pdfviewer"), { - serviceUrl: (window).baseurl + "api/PdfViewer", + serviceUrl:(window).baseurl+ "api/PdfViewer", isResponsive: true }); }); @@ -1119,42 +1119,50 @@ module PDFViewerComponent { module PivotChartOlap { $(function () { - var sample = new ej.PivotChart($("#PivotChart"), { + var sample = new ej.PivotChart($("#PivotChart"),{ dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]" - } - ], - axis: "columns" - } - ], - filters: [] + data: "//bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]" + } + ], + axis: "columns" + } + ], + filters:[] + }, + isResponsive: true,zooming:{enableScrollbar: true}, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, + primaryYAxis: { title: { text: "Internet Sales Amount" } }, + legend: { visible: true, rowCount: 2 }, + load: function () { + var PivotChart = (window).themeStyle + (window).themeColor + (window).themeVarient; + PivotChart = PivotChart.toString(); + if (PivotChart.indexOf("dark") > -1 || PivotChart.indexOf("contrast") > -1) + PivotChart = "flatdark"; + else + PivotChart = "flatlight"; + this.model.theme = PivotChart; }, - isResponsive: true, zooming: { enableScrollbar: true }, - commonSeriesOptions: { - type: "column" - }, - size: { height: "460px", width: "100%" }, - primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, - primaryYAxis: { title: { text: "Internet Sales Amount" } }, - legend: { visible: true, rowCount: 2 } - // load:"loadTheme" }); }); } @@ -1191,45 +1199,53 @@ var pivot_dataset = [ module PivotChartRelational { $(function () { - var sample = new ej.PivotChart($("#PivotChart"), { + var sample = new ej.PivotChart($("#PivotChart"),{ dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - fieldCaption: "Country" - }, - { - fieldName: "State", - fieldCaption: "State" - }, - { - fieldName: "Date", - fieldCaption: "Date" - } - ], - columns: [ - { - fieldName: "Product", - fieldCaption: "Product" - } - ], - values: [ - { - fieldName: "Amount", - fieldCaption: "Amount" - } - ], - filters: [] + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + }, + { + fieldName: "Date", + fieldCaption: "Date" + } + ], + columns: [ + { + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + } + ], + filters:[] + }, + isResponsive: true,zooming:{enableScrollbar: true}, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryYAxis: { title: { text: "Amount" } }, + legend: { visible: true }, + load: function () { + var PivotChart = (window).themeStyle + (window).themeColor + (window).themeVarient; + PivotChart = PivotChart.toString(); + if (PivotChart.indexOf("dark") > -1 || PivotChart.indexOf("contrast") > -1) + PivotChart = "flatdark"; + else + PivotChart = "flatlight"; + this.model.theme = PivotChart; }, - isResponsive: true, zooming: { enableScrollbar: true }, - commonSeriesOptions: { - type: "column" - }, - size: { height: "460px", width: "100%" }, - primaryYAxis: { title: { text: "Amount" } }, - legend: { visible: true } - // load:"loadTheme" }); }); } @@ -1239,106 +1255,106 @@ module PivotChartRelational { module PivotGaugeOlap { $(function () { - var sample = new ej.PivotGauge($("#PivotGauge"), { + var sample = new ej.PivotGauge($("#PivotGauge"),{ dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]", - filterItems: { filterType: "include", values: ["[Date].[Fiscal].[Fiscal Year].&[2004]"] } - }, - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]" - }, - { - fieldName: "[Measures].[Internet Revenue Status]" - }, - { - fieldName: "[Measures].[Internet Revenue Trend]" - }, - { - fieldName: "[Measures].[Internet Revenue Goal]" - }, - ], - axis: "columns" - } - ], - filters: [] - }, + data: "//bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]", + filterItems: { filterType: "include", values: ["[Date].[Fiscal].[Fiscal Year].&[2004]"] } + }, + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]" + }, + { + fieldName: "[Measures].[Internet Revenue Status]" + }, + { + fieldName: "[Measures].[Internet Revenue Trend]" + }, + { + fieldName: "[Measures].[Internet Revenue Goal]" + }, + ], + axis: "columns" + } + ], + filters:[] + }, enableTooltip: true, isResponsive: true, labelFormatSettings: { decimalPlaces: 2 }, - scales: [{ - showRanges: true, - radius: 150, showScaleBar: true, size: 1, + scales: [{ + showRanges: true, + radius: 150, showScaleBar: true, size: 1, border: { - width: 0.5 - }, - showIndicators: true, showLabels: true, + width: 0.5 + }, + showIndicators: true, showLabels: true, pointers: [{ - showBackNeedle: true, - backNeedleLength: 20, - length: 120, - width: 7 + showBackNeedle: true, + backNeedleLength: 20, + length: 120, + width: 7 }, - { - type: "marker", - markerType: "diamond", - distanceFromScale: 5, - placement: "center", - backgroundColor: "#29A4D9", - length: 25, - width: 15 - }], + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], ticks: [{ - type: "major", + type: "major", distanceFromScale: 2, - height: 16, - width: 1, color: "#8c8c8c" - }, - { - type: "minor", - height: 6, - width: 1, - distanceFromScale: 2, - color: "#8c8c8c" - }], - labels: [{ + height: 16, + width: 1, color: "#8c8c8c" + }, + { + type: "minor", + height: 6, + width: 1, + distanceFromScale: 2, color: "#8c8c8c" }], + labels: [{ + color: "#8c8c8c" + }], ranges: [{ - distanceFromScale: -5, + distanceFromScale: -5, backgroundColor: "#fc0606", - border: { color: "#fc0606" } + border: { color: "#fc0606" } + }, + { + distanceFromScale: -5 + }], + customLabels: [{ + position: { x: 180, y: 290 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" }, - { - distanceFromScale: -5 - }], - customLabels: [{ - position: { x: 180, y: 290 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + { + position: { x: 180, y: 320 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" }, - { - position: { x: 180, y: 320 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }, - { - position: { x: 180, y: 150 }, - font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }] + { + position: { x: 180, y: 150 }, + font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }] }] }); - }); + }); } @@ -1372,94 +1388,94 @@ var pivot_dataset = [ module PivotGaugeRelational { $(function () { - var sample = new ej.PivotGauge($("#PivotGauge"), { + var sample = new ej.PivotGauge($("#PivotGauge"),{ dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - }, - { - fieldName: "State", - } - ], - columns: [ - { - fieldName: "Product", - } - ], + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + }, + { + fieldName: "State", + } + ], + columns: [ + { + fieldName: "Product", + } + ], values: [ - { - fieldName: "Amount", - }, - { - fieldName: "Quantity", - } - ] - }, + { + fieldName: "Amount", + }, + { + fieldName: "Quantity", + } + ] + }, enableTooltip: true, isResponsive: true, labelFormatSettings: { decimalPlaces: 2 }, - scales: [{ - showRanges: true, - radius: 150, showScaleBar: true, size: 1, + scales: [{ + showRanges: true, + radius: 150, showScaleBar: true, size: 1, border: { - width: 0.5 - }, - showIndicators: true, showLabels: true, + width: 0.5 + }, + showIndicators: true, showLabels: true, pointers: [{ - showBackNeedle: true, - backNeedleLength: 20, - length: 120, - width: 7 + showBackNeedle: true, + backNeedleLength: 20, + length: 120, + width: 7 }, - { - type: "marker", - markerType: "diamond", - distanceFromScale: 5, - placement: "center", - backgroundColor: "#29A4D9", - length: 25, - width: 15 - }], + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], ticks: [{ - type: "major", + type: "major", distanceFromScale: 2, - height: 16, - width: 1, color: "#8c8c8c" - }, - { - type: "minor", - height: 6, - width: 1, - distanceFromScale: 2, - color: "#8c8c8c" - }], - labels: [{ + height: 16, + width: 1, color: "#8c8c8c" + }, + { + type: "minor", + height: 6, + width: 1, + distanceFromScale: 2, color: "#8c8c8c" }], + labels: [{ + color: "#8c8c8c" + }], ranges: [{ - distanceFromScale: -5, + distanceFromScale: -5, backgroundColor: "#fc0606", - border: { color: "#fc0606" } + border: { color: "#fc0606" } + }, + { + distanceFromScale: -5 + }], + customLabels: [{ + position: { x: 180, y: 290 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" }, - { - distanceFromScale: -5 - }], - customLabels: [{ - position: { x: 180, y: 290 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + { + position: { x: 180, y: 320 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" }, - { - position: { x: 180, y: 320 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }, - { - position: { x: 180, y: 150 }, - font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }] + { + position: { x: 180, y: 150 }, + font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }] }] }); - }); + }); } @@ -1467,35 +1483,35 @@ module PivotGaugeRelational { module PivotGridOlap { $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"), { + var sample = new ej.PivotGrid($("#PivotGrid"),{ dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]", - } - ], - axis: "columns" - } - ], - filters: [] - }, - enableGroupingBar: true, - pivotTableFieldListID: "PivotSchemaDesigner" + data: "//bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]", + } + ], + axis: "columns" + } + ], + filters:[] + }, + enableGroupingBar: true, + pivotTableFieldListID:"PivotSchemaDesigner" }); $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); }); @@ -1532,41 +1548,41 @@ var pivot_dataset = [ module PivotGridRelational { $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"), { + var sample = new ej.PivotGrid($("#PivotGrid"),{ dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - fieldCaption: "Country" - }, - { - fieldName: "State", - fieldCaption: "State" - } - ], - columns: - [{ - fieldName: "Product", - fieldCaption: "Product" - } - ], - values: [ - { - fieldName: "Amount", - fieldCaption: "Amount" - }, - { - fieldName: "Quantity", - fieldCaption: "Quantity" - } - ], - filters: [] - }, - enableGroupingBar: true, - pivotTableFieldListID: "PivotSchemaDesigner" + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + } + ], + columns: + [{ + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + }, + { + fieldName: "Quantity", + fieldCaption: "Quantity" + } + ], + filters:[] + }, + enableGroupingBar: true, + pivotTableFieldListID:"PivotSchemaDesigner" }); - $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); + $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); }); } @@ -1575,33 +1591,33 @@ module PivotGridRelational { module PivotTreeMap { $(function () { - var sample = new ej.PivotTreeMap($("#PivotTreeMap"), { + var sample = new ej.PivotTreeMap($("#PivotTreeMap"),{ dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll;Locale Identifier=1033;", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - columns: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Customer Count]", - } - ], - axis: "columns" - } - ], - filters: [] - } + data: "//bi.syncfusion.com/olap/msmdpump.dll;Locale Identifier=1033;", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + columns: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Customer Count]", + } + ], + axis: "columns" + } + ], + filters:[] + } }); }); } @@ -1610,7 +1626,7 @@ module PivotTreeMap { module ProgressBarComponent { $(function () { - var sample = new ej.ProgressBar($("#progressBar"), { + var sample = new ej.ProgressBar($("#progressBar"),{ width: 200, value: 45, height: 20, @@ -1640,7 +1656,7 @@ module RadialMenuComponent { backImageClass: "backimageclass", targetElementId: "radialtarget1" }); - $("#radialtarget1").parent().css("position", "relative"); + $("#radialtarget1").parent().css("position", "relative"); } else { $("#contentDiv").html("Radial Menu is only supported from Internet Explorer Versioned 9 and above.").css({ "font-size": "20px", "color": "red" }); @@ -1707,12 +1723,12 @@ function redo(e: any) { } - + module RadialSliderComponent { $(function () { var radialsliderInstance = new ej.RadialSlider($("#radialSlider"), { - innerCircleImageUrl: "images/radialslider/chevron-right.png" + innerCircleImageUrl: "images/radialslider/chevron-right.png" }); }); } @@ -1809,8 +1825,8 @@ var data; data = GetData(); function GetData() { - var series1: any[] = []; - var series2: any[] = []; + var series1:any[]=[]; + var series2:any[]= []; var value = 100; var value1 = 120; for (var i = 1; i < 730; i++) { @@ -1837,7 +1853,7 @@ function GetData() { module RatingComponent { $(function () { - var sample1 = new ej.Rating($("#fullRating"), { + var sample1 = new ej.Rating($("#fullRating"),{ value: 4, precision: ej.Rating.Precision.Full, allowReset: true, @@ -1852,8 +1868,8 @@ module RatingComponent { shapeWidth: 25, showTooltip: true }); - - var sample2 = new ej.Rating($("#halfRating"), { + + var sample2 = new ej.Rating($("#halfRating"),{ precision: ej.Rating.Precision.Half, value: 3.5, allowReset: true, @@ -1869,7 +1885,7 @@ module RatingComponent { showTooltip: true }); - var sample3 = new ej.Rating($("#exactRating"), { + var sample3 = new ej.Rating($("#exactRating"),{ precision: ej.Rating.Precision.Exact, value: 3.7, allowReset: true, @@ -1883,7 +1899,7 @@ module RatingComponent { shapeHeight: 25, shapeWidth: 25, showTooltip: true - }); + }); }); } @@ -1891,15 +1907,15 @@ module RatingComponent { module ReportViewerComponent { - $(function () { - var report = new ej.ReportViewer($("#territoryReportViewer"), { - reportServiceUrl: (window).baseurl + 'api/ReportViewer', - reportServerUrl: 'http://104.207.134.201/reportserver', - processingMode: ej.ReportViewer.ProcessingMode.Remote, - reportPath: "/SSRSSamples2/Territory Sales new", - isResponsive: true - }); - }); + $(function () { + var report = new ej.ReportViewer($("#territoryReportViewer"), { + reportServiceUrl: (window).baseurl + 'api/ReportViewer', + reportServerUrl: 'http://104.207.134.201/reportserver', + processingMode: ej.ReportViewer.ProcessingMode.Remote, + reportPath: "/SSRSSamples2/Territory Sales new", + isResponsive: true + }); + }); } @@ -1916,7 +1932,7 @@ module RibbonComponent { toolTip: "Pin the Ribbon" }, applicationTab: { - type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } + type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } }, tabs: [{ id: "home", text: "HOME", groups: [{ @@ -1940,7 +1956,7 @@ module RibbonComponent { } }] }, - { + { text: "Clipboard", alignType: ej.Ribbon.AlignType.Columns, content: [{ groups: [{ id: "paste", @@ -1962,8 +1978,8 @@ module RibbonComponent { height: 70 } }, - { - groups: [{ + { + groups: [{ id: "cut", text: "Cut", toolTip: "Cut", @@ -1993,14 +2009,14 @@ module RibbonComponent { prefixIcon: "e-icon e-ribbon clearAll" } }], - defaults: { + defaults: { type: "button", width: 60, isBig: false } - }] - }, - { + }] + }, + { text: "Font", alignType: "rows", content: [{ groups: [{ id: "fontfamily", @@ -2299,7 +2315,7 @@ module RibbonComponent { groups: [{ id: "zoomin", text: "Zoom In", - toolTip: "Zoom In", + toolTip: "Zoom In", buttonSettings: { width: 58, click: "onClick", @@ -2311,7 +2327,7 @@ module RibbonComponent { { id: "zoomout", text: "Zoom Out", - toolTip: "Zoom Out", + toolTip: "Zoom Out", buttonSettings: { width: 70, click: "onClick", @@ -2323,7 +2339,7 @@ module RibbonComponent { { id: "fullscreen", text: "Full Screen", - toolTip: "Full Screen", + toolTip: "Full Screen", buttonSettings: { width: 73, click: "onClick", @@ -2339,7 +2355,7 @@ module RibbonComponent { } }] }] - }, { + },{ id: "insert", text: "INSERT", groups: [{ text: "Tables", alignType: ej.Ribbon.AlignType.Columns, content: [{ groups: [{ @@ -2484,7 +2500,7 @@ module RibbonComponent { } ], defaults: { - type: "button", + type: "button", width: 70, height: 70 } @@ -2566,7 +2582,7 @@ module RibbonComponent { } ] } - ], + ], create: function createControl(args) { var ribbon = $("#defaultRibbon").data("ejRibbon"); $("#fontcolor").ejColorPicker({ value: "#FFFF00", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fontcoloricon", select: colorHandler }); @@ -2578,7 +2594,7 @@ module RibbonComponent { function colorHandler(args:any) { (this._id.indexOf("fillcolor") != -1) ? $("#contenteditor").css('background-color', args.value) : document.execCommand('forecolor', false, args.value); } -function onClick(args: any) { +function onClick(args:any) { var val, prop = args.text; val = (ej.isNullOrUndefined(args.model.text)) ? args.model.activeText : args.model.text; if (action1.indexOf(val) != -1) @@ -2596,7 +2612,7 @@ function onClick(args: any) { - + module RotatorComponent { $(function () { @@ -2606,14 +2622,14 @@ module RotatorComponent { slideHeight: "auto", displayItemsCount: "1", navigateSteps: "1", - pagerPosition: "outside", + pagerPosition:"outside", orientation: "horizontal", showPager: true, enabled: true, showCaption: true, allowKeyboardNavigation: true, showPlayButton: true, - isResponsive: true, + isResponsive:true, animationType: "slide", }); }); @@ -2623,7 +2639,7 @@ module RotatorComponent { module RTEComponent { $(function () { - var sample = new ej.RTE($("#rteSample"), { + var sample = new ej.RTE($("#rteSample"),{ width: "100%", minWidth: "150px", showFooter: true, @@ -2759,7 +2775,7 @@ module ScheduleComponent { } }); }); -} +} @@ -2819,10 +2835,10 @@ module linesparkline { dataSource: [12, 14, 11, 12, 11, 15, 12, 10, 11, 12, 15, 13, 12, 11, 10, 13, 15, 12, 14, 16, 14, 12, 11], tooltip: { visible: true, - font: { size: "12px" } + font: { size:"12px" } }, type: "line", - size: { height: "40", width: "170" }, + size: { height: "40", width:"170" }, }); }); } @@ -2830,7 +2846,7 @@ module linesparkline { module columnsparkline { $(function () { var sparkcolumnsample = new ej.Sparkline($("#column"), { - dataSource: [2, 6, -1, 1, 12, 5, -2, 7, -3, 5, 8, 10, ], + dataSource: [2, 6, -1, 1, 12, 5, -2, 7, -3, 5, 8, 10,], negativePointColor: "red", highPointColor: "blue", tooltip: { @@ -2848,7 +2864,7 @@ module columnsparkline { module areasparkline { $(function () { var sparkareasample = new ej.Sparkline($("#area"), { - dataSource: [12, -10, 11, 8, 17, 6, 2, -17, 13, -6, 8, 10, ], + dataSource: [12, -10, 11, 8, 17, 6, 2, -17, 13, -6, 8, 10,], markerSettings: { visible: true }, highPointColor: "blue", lowPointColor: "orange", @@ -2868,7 +2884,7 @@ module areasparkline { module windlosssparkline { $(function () { var sparkwinlosssample = new ej.Sparkline($("#winloss"), { - dataSource: [12, 15, -11, 13, 17, 0, -12, 17, 13, -15, 8, 10, ], + dataSource: [12, 15, -11, 13, 17, 0, -12, 17, 13, -15, 8, 10,], type: "winloss", size: { height: "100", width: "150" }, }); @@ -2894,7 +2910,7 @@ module piesparkline1 { module piesparkline2 { $(function () { var sparkpiesample2 = new ej.Sparkline($("#pie2"), { - dataSource: [8, 9, 1, ], + dataSource: [8, 9, 1,], type: "pie", tooltip: { visible: true, @@ -2939,9 +2955,9 @@ module piesparkline4 { }); } + - - + module SplitterComponent { @@ -2951,10 +2967,10 @@ module SplitterComponent { width: "50%", orientation: ej.Orientation.Vertical, properties: [{}, { paneSize: 80 }], - isResponsive: true + isResponsive:true }); var splitterInstance1 = new ej.Splitter($("#innerSpliter"), { - isResponsive: true, + isResponsive:true, }); }); } @@ -2962,7 +2978,7 @@ module SplitterComponent { module SpreadsheetComponent { - $(function () { +$(function () { var sample = new ej.Spreadsheet($("#basicSpreadsheet"), { scrollSettings: { height: 550, @@ -2976,15 +2992,14 @@ module SpreadsheetComponent { pdfUrl: (window).baseurl + "api/Spreadsheet/PdfExport" }, sheets: [{ rangeSettings: [{ dataSource: (window).defaultData, startCell: "A1" }] }], - loadComplete: () => { - var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; - if (!(spreadsheet).isImport) { - spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); - xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); - xlFormat.format({ "type": "currency" }, "E2:H11"); - spreadsheet.XLRibbon.updateRibbonIcons(); - } - } + loadComplete: () => { + var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; + if (!(spreadsheet).isImport) { + spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); + xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); + xlFormat.format({ "type": "currency" }, "E2:H11"); + spreadsheet.XLRibbon.updateRibbonIcons(); + }} }); }); } @@ -2993,58 +3008,58 @@ module SpreadsheetComponent { var default_data: Array = [ - { Category: "Employees", Country: "USA", JobDescription: "Sales", JobGroup: "Executive", EmployeesCount: 50 }, - { Category: "Employees", Country: "USA", JobDescription: "Sales", JobGroup: "Analyst", EmployeesCount: 40 }, - { Category: "Employees", Country: "USA", JobDescription: "Marketing", EmployeesCount: 40 }, - { Category: "Employees", Country: "USA", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 55 }, - { Category: "Employees", Country: "USA", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 175 }, - { Category: "Employees", Country: "USA", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 70 }, - { Category: "Employees", Country: "USA", JobDescription: "Management", EmployeesCount: 40 }, - { Category: "Employees", Country: "USA", JobDescription: "Accounts", EmployeesCount: 60 }, - - { Category: "Employees", Country: "India", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 43 }, - { Category: "Employees", Country: "India", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 125 }, - { Category: "Employees", Country: "India", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 60 }, - { Category: "Employees", Country: "India", JobDescription: "HR Executives", EmployeesCount: 70 }, - { Category: "Employees", Country: "India", JobDescription: "Accounts", EmployeesCount: 45 }, - - { Category: "Employees", Country: "Germany", JobDescription: "Sales", JobGroup: "Executive", EmployeesCount: 30 }, - { Category: "Employees", Country: "Germany", JobDescription: "Sales", JobGroup: "Analyst", EmployeesCount: 40 }, - { Category: "Employees", Country: "Germany", JobDescription: "Marketing", EmployeesCount: 50 }, - { Category: "Employees", Country: "Germany", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 40 }, - { Category: "Employees", Country: "Germany", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 65 }, - { Category: "Employees", Country: "Germany", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 27 }, - { Category: "Employees", Country: "Germany", JobDescription: "Management", EmployeesCount: 33 }, - { Category: "Employees", Country: "Germany", JobDescription: "Accounts", EmployeesCount: 55 }, - - { Category: "Employees", Country: "UK", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 45 }, - { Category: "Employees", Country: "UK", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 96 }, - { Category: "Employees", Country: "UK", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 55 }, - { Category: "Employees", Country: "UK", JobDescription: "HR Executives", EmployeesCount: 60 }, - { Category: "Employees", Country: "UK", JobDescription: "Accounts", EmployeesCount: 30 }, - - { Category: "Employees", Country: "France", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 40 }, - { Category: "Employees", Country: "France", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 65 }, - { Category: "Employees", Country: "France", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 27 }, - { Category: "Employees", Country: "France", JobDescription: "Marketing", EmployeesCount: 50 } + { Category : "Employees", Country : "USA", JobDescription : "Sales", JobGroup:"Executive", EmployeesCount : 50 }, + { Category : "Employees", Country : "USA", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, + { Category : "Employees", Country : "USA", JobDescription : "Marketing", EmployeesCount : 40 }, + { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 55 }, + { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 175}, + { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 70 }, + { Category : "Employees", Country : "USA", JobDescription : "Management", EmployeesCount : 40 }, + { Category : "Employees", Country : "USA", JobDescription : "Accounts", EmployeesCount : 60 }, + + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 43 }, + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 125}, + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 60 }, + { Category : "Employees", Country : "India", JobDescription : "HR Executives", EmployeesCount : 70 }, + { Category : "Employees", Country : "India", JobDescription : "Accounts", EmployeesCount : 45 }, + + { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Executive", EmployeesCount : 30 }, + { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, + { Category : "Employees", Country : "Germany", JobDescription : "Marketing", EmployeesCount : 50 }, + { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, + { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, + { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, + { Category : "Employees", Country : "Germany", JobDescription : "Management", EmployeesCount : 33 }, + { Category : "Employees", Country : "Germany", JobDescription : "Accounts", EmployeesCount : 55 }, + + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 45 }, + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 96 }, + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 55 }, + { Category : "Employees", Country : "UK", JobDescription : "HR Executives", EmployeesCount : 60 }, + { Category : "Employees", Country : "UK", JobDescription: "Accounts", EmployeesCount: 30 }, + + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, + { Category : "Employees", Country : "France", JobDescription: "Marketing", EmployeesCount: 50 } ]; module sunburstcomponent { $(function () { var sunburstsample = new ej.SunburstChart($("#Sunburst"), { - valueMemberPath: "EmployeesCount", + valueMemberPath: "EmployeesCount", levels: [ - { groupMemberPath: "Country" }, - { groupMemberPath: "JobDescription" }, - { groupMemberPath: "JobGroup" }, - { groupMemberPath: "JobRole" } + {groupMemberPath: "Country"}, + {groupMemberPath: "JobDescription"}, + {groupMemberPath: "JobGroup"}, + {groupMemberPath: "JobRole"} ], dataSource: default_data, - dataLabelSettings: { visible: true }, - tooltip: { visible: false }, - enableAnimation: false, - size: { height: "600" }, - innerRadius: 0.2, + dataLabelSettings:{visible:true}, + tooltip:{visible:false}, + enableAnimation:false, + size:{height:"600"}, + innerRadius:0.2, load: function () { var sender = $("#Sunburst").data("ejSunburstChart"); var SunBurstTheme = (window).themeStyle + (window).themeColor + (window).themeVarient; @@ -3055,10 +3070,9 @@ module sunburstcomponent { SunBurstTheme = "flatlight"; sender.model.theme = SunBurstTheme; }, - title: { text: "Employees Count" }, - zoomSettings: { enable: false }, - legend: { visible: true, position: 'top' } - // load:"loadTheme" + title:{text:"Employees Count"}, + zoomSettings:{enable:false}, + legend:{visible:true,position:'top'}, }); }); } @@ -3068,7 +3082,7 @@ module sunburstcomponent { module TabComponent { $(function () { - var sample = new ej.Tab($("#defaultTab"), { + var sample = new ej.Tab($("#defaultTab"),{ width: "500px", collapsible: true, events: "click", @@ -3082,8 +3096,8 @@ module TabComponent { module TagCloudComponent { - - + + var websiteCollection = [ { text: "Google", url: "http://www.google.com", frequency: 12 }, { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, @@ -3114,7 +3128,7 @@ module TagCloudComponent { text: "text", url: "url", frequency: "frequency" } }); - + }); } @@ -3154,82 +3168,82 @@ module EditorComponent { - + module TileViewComponent { $(function () { var tile1 = new ej.Tile($("#tile1"), { - imagePosition: "fill", - caption: { text: "People" }, - tileSize: "medium", - imageUrl: 'content/images/tile/windows/people_1.png' + imagePosition:"fill", + caption:{text:"People"}, + tileSize:"medium", + imageUrl:'content/images/tile/windows/people_1.png' }); - var tile2 = new ej.Tile($("#tile2"), { - imagePosition: "center", - tileSize: "small", - imageUrl: 'content/images/tile/windows/alerts.png', - + var tile2 = new ej.Tile($("#tile2"), { + imagePosition:"center", + tileSize:"small", + imageUrl:'content/images/tile/windows/alerts.png', + }); - var tile3 = new ej.Tile($("#tile3"), { - imagePosition: "center", - tileSize: "small", - imageUrl: 'content/images/tile/windows/bing.png', + var tile3 = new ej.Tile($("#tile3"), { + imagePosition:"center", + tileSize:"small", + imageUrl:'content/images/tile/windows/bing.png', }); - var tile4 = new ej.Tile($("#tile4"), { - tileSize: "small", - imageUrl: 'content/images/tile/windows/camera.png', + var tile4 = new ej.Tile($("#tile4"), { + tileSize:"small", + imageUrl:'content/images/tile/windows/camera.png', }); - var tile5 = new ej.Tile($("#tile5"), { - imagePosition: "center", - tileSize: "small", - imageUrl: 'content/images/tile/windows/messages.png', + var tile5 = new ej.Tile($("#tile5"), { + imagePosition:"center", + tileSize:"small", + imageUrl:'content/images/tile/windows/messages.png', }); - var tile6 = new ej.Tile($("#tile6"), { - imagePosition: "center", - tileSize: "medium", - imageUrl: 'content/images/tile/windows/games.png', - caption: { text: "Play" } + var tile6 = new ej.Tile($("#tile6"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/games.png', + caption:{text:"Play"} }); - var tile7 = new ej.Tile($("#tile7"), { - tileSize: "medium", - imageUrl: 'content/images/tile/windows/map.png', - caption: { text: "Maps" } + var tile7 = new ej.Tile($("#tile7"), { + tileSize:"medium", + imageUrl:'content/images/tile/windows/map.png', + caption:{text:"Maps"} }); - var tile8 = new ej.Tile($("#tile8"), { - imagePosition: "fill", - tileSize: "wide", - imageUrl: 'content/images/tile/windows/sports.png', - caption: { text: "Sports" } + var tile8 = new ej.Tile($("#tile8"), { + imagePosition:"fill", + tileSize:"wide", + imageUrl:'content/images/tile/windows/sports.png', + caption:{text:"Sports"} }); - var tile9 = new ej.Tile($("#tile9"), { - imagePosition: "fill", - tileSize: "medium", - imageUrl: 'content/images/tile/windows/people_2.png', - caption: { text: "People" } + var tile9 = new ej.Tile($("#tile9"), { + imagePosition:"fill", + tileSize:"medium", + imageUrl:'content/images/tile/windows/people_2.png', + caption:{text:"People"} }); - var tile10 = new ej.Tile($("#tile10"), { - imagePosition: "center", - tileSize: "medium", - imageUrl: 'content/images/tile/windows/pictures.png', - caption: { text: "Photo" } + var tile10 = new ej.Tile($("#tile10"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/pictures.png', + caption:{text:"Photo"} }); - var tile11 = new ej.Tile($("#tile11"), { - imagePosition: "center", - tileSize: "wide", - imageUrl: 'content/images/tile/windows/weather.png', - caption: { text: "Weather" } + var tile11 = new ej.Tile($("#tile11"), { + imagePosition:"center", + tileSize:"wide", + imageUrl:'content/images/tile/windows/weather.png', + caption:{text:"Weather"} }); - var tile12 = new ej.Tile($("#tile12"), { - imagePosition: "center", - tileSize: "medium", - imageUrl: 'content/images/tile/windows/music.png', - caption: { text: "Music" } + var tile12 = new ej.Tile($("#tile12"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/music.png', + caption:{text:"Music"} }); - var tile13 = new ej.Tile($("#tile13"), { - imagePosition: "center", - tileSize: "medium", - imageUrl: 'content/images/tile/windows/favs.png', - caption: { text: "Favorites" } + var tile13 = new ej.Tile($("#tile13"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/favs.png', + caption:{text:"Favorites"} }); }); } @@ -3248,13 +3262,13 @@ module TimePickerComponent { module ToolbarComponent { - + $(function () { - var sample = new ej.Toolbar($("#editingToolbar"), { + var sample = new ej.Toolbar($("#editingToolbar"),{ width: "100%", cssClass: "gradient-lime", enableSeparator: true, - + isResponsive: true, orientation: ej.Orientation.Horizontal, showRoundedCorner: true @@ -3267,10 +3281,10 @@ module ToolbarComponent { module TooltipComponent { - + $(function () { - var sample1 = new ej.Tooltip($("#link1"), { + var sample1 = new ej.Tooltip($("#link1"),{ content: "ECMAScript (or ES) is a trademarked scripting-language specification standardized by Ecma International in ECMA-262 and ISO/IEC 16262.", associate: "mousefollow", autoCloseTimeout: 5000, @@ -3280,7 +3294,7 @@ module TooltipComponent { showShadow: true }); - var sample2 = new ej.Tooltip($("#link2"), { + var sample2 = new ej.Tooltip($("#link2"),{ content: "The World Wide Web (WWW) is an information space where documents and other web resources are identified by URLs, interlinked by hypertext links, and can be accessed via the Internet.", position: { stem: { @@ -3299,7 +3313,7 @@ module TooltipComponent { showShadow: true }); - var sample3 = new ej.Tooltip($("#link3"), { + var sample3 = new ej.Tooltip($("#link3"),{ content: 'Object-oriented programming (OOP) is a programming language model organized around objects rather than "actions" and data rather than logic.', position: { stem: { @@ -3326,43 +3340,43 @@ module TooltipComponent { module TreeGridComponent { $(function () { var treegridInstance = new ej.TreeGrid($("#TreeGridContainer"), { - dataSource: (window).treeGridData, - childMapping: "subtasks", - allowSorting: true, - allowMultiSorting: true, - enableAltRow: true, - allowFiltering: true, - treeColumnIndex: 1, - allowKeyboardNavigation: true, - showColumnChooser: true, - showColumnOptions: true, - contextMenuSettings: { - showContextMenu: true, - contextMenuItems: ["add", "edit", "delete"] - }, - columnDialogFields: ["field", "headerText", "editType", "width", "visible", "allowSorting", "textAlign", "headerTextAlign"], - editSettings: { - allowAdding: true, - allowEditing: true, - allowDeleting: true, - editMode: "cellEditing", - rowPosition: "belowSelectedRow" - }, - toolbarSettings: { - showToolbar: true, - toolbarItems: ["add", "edit", "delete", "update", "cancel", "expandAll", "collapseAll"] - }, - columns: [ - { field: "taskID", headerText: "Task Id", allowFiltering: false, editType: "numericedit", filterEditType: "numericedit" }, - { field: "taskName", headerText: "Task Name", editType: "stringedit", filterEditType: "stringedit" }, - { field: "startDate", headerText: "Start Date", editType: "datepicker", filterEditType: "datepicker", format: "{0:MM/dd/yyyy}" }, - { field: "endDate", headerText: "End Date", editType: "datepicker", filterEditType: "datepicker", format: "{0:MM/dd/yyyy}" }, - { field: "progress", headerText: "Progress", editType: "numericedit", filterEditType: "numericedit" } - ], - isResponsive: true, - }); + dataSource: (window).treeGridData, + childMapping: "subtasks", + allowSorting: true, + allowMultiSorting: true, + enableAltRow: true, + allowFiltering: true, + treeColumnIndex: 1, + allowKeyboardNavigation: true, + showColumnChooser: true, + showColumnOptions: true, + contextMenuSettings: { + showContextMenu: true, + contextMenuItems: ["add", "edit", "delete"] + }, + columnDialogFields: ["field", "headerText", "editType", "width", "visible", "allowSorting", "textAlign", "headerTextAlign"], + editSettings: { + allowAdding: true, + allowEditing: true, + allowDeleting: true, + editMode: "cellEditing", + rowPosition: "belowSelectedRow" + }, + toolbarSettings: { + showToolbar: true, + toolbarItems: ["add","edit","delete","update","cancel","expandAll","collapseAll"] + }, + columns: [ + { field: "taskID", headerText: "Task Id", allowFiltering: false, editType: "numericedit", filterEditType: "numericedit" }, + { field: "taskName", headerText: "Task Name", editType: "stringedit", filterEditType: "stringedit" }, + { field: "startDate", headerText: "Start Date", editType: "datepicker", filterEditType: "datepicker", format:"{0:MM/dd/yyyy}" }, + { field: "endDate", headerText: "End Date", editType: "datepicker", filterEditType: "datepicker", format:"{0:MM/dd/yyyy}" }, + { field: "progress", headerText: "Progress", editType: "numericedit", filterEditType: "numericedit" } + ], + isResponsive: true, }); -} +}); +} @@ -3407,7 +3421,7 @@ module treemapcomponent { - + module TreeViewComponent { $(function () { @@ -3424,9 +3438,9 @@ module TreeViewComponent { module UploadboxComponent { - + $(function () { - var sample = new ej.Uploadbox($("#UploadDefault"), { + var sample = new ej.Uploadbox($("#UploadDefault"),{ saveUrl: (window).baseurl + "api/uploadbox/Save", removeUrl: (window).baseurl + "api/uploadbox/Remove", buttonText: { @@ -3449,12 +3463,12 @@ module UploadboxComponent { module WaitingPopupComponent { $(function () { - var sample = new ej.WaitingPopup($("#target"), { + var sample = new ej.WaitingPopup($("#target"),{ showOnInit: true, showImage: true, text: 'waiting…', - target: "#target", - appendTo: "#waiting" + target: "#target", + appendTo: "#waiting" }); }); diff --git a/types/ej.web.all/index.d.ts b/types/ej.web.all/index.d.ts index e95fb94b2b..77332f6a6d 100644 --- a/types/ej.web.all/index.d.ts +++ b/types/ej.web.all/index.d.ts @@ -8,7 +8,7 @@ /*! * filename: ej.web.all.d.ts -* version : 16.1.0.32 +* version : 16.1.0.37 * Copyright Syncfusion Inc. 2001 - 2018. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing @@ -7995,9 +7995,9 @@ declare namespace ej { */ footerTemplateId?: string; - /** This event is triggered before the dialog widgets gets open. + /** Triggered when the custom action button clicked. */ - beforeOpen?(e: BeforeOpenEventArgs): void; + actionButtonClick?(e: ActionButtonClickEventArgs): void; /** This event is triggered whenever the AJAX request fails to retrieve the dialog content. */ @@ -8007,6 +8007,10 @@ declare namespace ej { */ ajaxSuccess?(e: AjaxSuccessEventArgs): void; + /** This event is triggered before the dialog widgets gets open. + */ + beforeOpen?(e: BeforeOpenEventArgs): void; + /** This event is triggered before the dialog widgets get closed. */ beforeClose?(e: BeforeCloseEventArgs): void; @@ -8015,6 +8019,10 @@ declare namespace ej { */ close?(e: CloseEventArgs): void; + /** Triggered when the dialog content is collapsed. + */ + collapse?(e: CollapseEventArgs): void; + /** Triggered after the dialog content is loaded in DOM. */ contentLoad?(e: ContentLoadEventArgs): void; @@ -8039,6 +8047,10 @@ declare namespace ej { */ dragStop?(e: DragStopEventArgs): void; + /** Triggered when the dialog content is expanded. + */ + expand?(e: ExpandEventArgs): void; + /** Triggered after the dialog is opened. */ open?(e: OpenEventArgs): void; @@ -8054,33 +8066,33 @@ declare namespace ej { /** Triggered when the user stops resizing the dialog. */ resizeStop?(e: ResizeStopEventArgs): void; - - /** Triggered when the dialog content is expanded. - */ - expand?(e: ExpandEventArgs): void; - - /** Triggered when the dialog content is collapsed. - */ - collapse?(e: CollapseEventArgs): void; - - /** Triggered when the custom action button clicked. - */ - actionButtonClick?(e: ActionButtonClickEventArgs): void; } - export interface BeforeOpenEventArgs { + export interface ActionButtonClickEventArgs { /** Set this option to true to cancel the event. */ cancel?: boolean; + /** Name of the event target attribute. + */ + buttonID?: string; + + /** Name of the event. + */ + type?: string; + /** Instance of the dialog model object. */ model?: ej.Dialog.Model; - /** Name of the event + /** Name of the event current target title. */ - type?: string; + currentTarget?: string; + + /** Name of the event. + */ + event?: string; } export interface AjaxErrorEventArgs { @@ -8137,6 +8149,21 @@ declare namespace ej { data?: string; } + export interface BeforeOpenEventArgs { + + /** Set this option to true to cancel the event. + */ + cancel?: boolean; + + /** Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /** Name of the event + */ + type?: string; + } + export interface BeforeCloseEventArgs { /** Current event object. @@ -8154,6 +8181,10 @@ declare namespace ej { /** Name of the event. */ type?: string; + + /** returns true when the dialog activated by user interaction otherwise returns false + */ + isInteraction?: boolean; } export interface CloseEventArgs { @@ -8173,6 +8204,29 @@ declare namespace ej { /** Name of the event */ type?: string; + + /** returns true when the Dialog activated by user interaction otherwise returns false + */ + isInteraction?: boolean; + } + + export interface CollapseEventArgs { + + /** Set this option to true to cancel the event. + */ + cancel?: boolean; + + /** Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /** Name of the event. + */ + type?: string; + + /** returns true when the Dialog activated by user interaction otherwise returns false + */ + isInteraction?: boolean; } export interface ContentLoadEventArgs { @@ -8285,6 +8339,25 @@ declare namespace ej { event?: any; } + export interface ExpandEventArgs { + + /** Set this option to true to cancel the event. + */ + cancel?: boolean; + + /** Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /** Name of the event. + */ + type?: string; + + /** returns true when the Dialog activated by user interaction otherwise returns false + */ + isInteraction?: boolean; + } + export interface OpenEventArgs { /** Set this option to true to cancel the event. @@ -8357,59 +8430,6 @@ declare namespace ej { event?: any; } - export interface ExpandEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event. - */ - type?: string; - } - - export interface CollapseEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event. - */ - type?: string; - } - - export interface ActionButtonClickEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Name of the event target attribute. - */ - buttonID?: string; - - /** Name of the event. - */ - type?: string; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event current target title. - */ - currentTarget?: string; - } - export interface AjaxSettings { /** It specifies, whether to enable or disable asynchronous request. @@ -23206,9 +23226,10 @@ declare namespace ej { getCurrentViewData(): any[]; /** Get the data of given row index in grid. + * @param {number} Pass the index of the row to get the corresponding data * @returns {any} */ - getDataByIndex(): any; + getDataByIndex(rowIndex: number): any; /** Get the column field name from the given header text in grid. * @param {string} Pass header text of the column to get its corresponding field name @@ -35422,6 +35443,13 @@ declare namespace ej { */ filterColumn(fieldName: string, filterOperator: string, filterValue: string, predicate?: string, matchCase?: boolean): void; + /** To filter multiple columns with multiple conditions dynamically in Gantt. + * @param {Gantt.EjPredicate} Pass the filtering column details and conditions as ejPredicate instance. The ejPredicate object is defined as fieldName,filterOperator, filterValue and + * ignoreCase properties. + * @returns {void} + */ + filterContent(ejPredicate: Gantt.EjPredicate): void; + /** To hide the column by using header text * @param {string} you can pass a header text of a column to hide * @returns {void} @@ -35534,6 +35562,25 @@ declare namespace ej { } export namespace Gantt { + export interface EjPredicate { + + /** Pass the field name of the column. + */ + fieldName?: string; + + /** string/integer/date operator. + */ + filterOperator?: string; + + /** Pass the value to be filtered in a column. + */ + filterValue?: string; + + /** Optional - pass the ignore case value as true/false. + */ + ignoreCase?: boolean; + } + export interface Model { /** Specifies the fields to be included in the add dialog in Gantt @@ -38232,6 +38279,13 @@ declare namespace ej { */ filterColumn(fieldName: string, filterOperator: string, filterValue: string, predicate: string, matchcase: boolean, actualFilterValue: any): void; + /** To filter multiple columns with multiple conditions dynamically in TreeGrid. + * @param {TreeGrid.EjPredicate} Pass the filtering column details and conditions as ejPredicate instance. ejPredicate object is defined as fieldName,filterOperator, filterValue and + * ignoreCase properties + * @returns {void} + */ + filterContent(ejPredicate: TreeGrid.EjPredicate): void; + /** To change the index of the tree column in TreeGrid. * @param {number} Pass the column index to make the column as treeColumnIndex. * @returns {void} @@ -38275,6 +38329,25 @@ declare namespace ej { } export namespace TreeGrid { + export interface EjPredicate { + + /** Pass the field name of the column. + */ + fieldName?: string; + + /** string/integer/date operator. + */ + filterOperator?: string; + + /** Pass the value to be filtered in a column. + */ + filterValue?: string; + + /** Optional - pass the ignore case value as true/false. + */ + ignoreCase?: boolean; + } + export interface Model { /** Enables or disables the ability to resize the column width interactively. @@ -43129,6 +43202,14 @@ declare namespace ej { export interface XLFormat { + /** This method is used to add the custom Date & Time format and recognize it as a preferred pattern in spreadsheet. + * @param {string} Pass the name for custom format. + * @param {string} Pass the custom format string. + * @param {string} Pass the type for custom format. + * @returns {void} + */ + addCustomFormatSpecifier(name: string, formatSpecifier: string, type: string): void; + /** This method is used to add the font to the Ribbon font family dropdown. * @param {string} Font name which needs to add into the font family option. * @returns {void} From 8f488f0f4e6d8d158838e0e0398b4d7914209ca4 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Wed, 25 Apr 2018 18:14:51 +0530 Subject: [PATCH 0873/2153] updated file committed --- types/ej.web.all/ej.web.all-tests.ts | 1362 +++++++++++++------------- 1 file changed, 674 insertions(+), 688 deletions(-) diff --git a/types/ej.web.all/ej.web.all-tests.ts b/types/ej.web.all/ej.web.all-tests.ts index 62ad67ce7b..83ed128742 100644 --- a/types/ej.web.all/ej.web.all-tests.ts +++ b/types/ej.web.all/ej.web.all-tests.ts @@ -1,7 +1,3 @@ -/* tslint:disable */ - - - module AccordionComponent { $(function () { var sample = new ej.Accordion($("#basicAccordion"), { @@ -22,39 +18,39 @@ module AccordionComponent { }); } - -module AutocompleteComponent{ + +module AutocompleteComponent { var carList = [ - "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", - "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", - "Chevrolet Camaro", "Cadillac", - "Duesenberg J", "Dodge Sprinter", - "Elantra", "Excavator", - "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", - "GAZ Siber", - "Honda S2000", "Hyundai Santro", - "Isuzu Swift", "Infiniti Skyline", - "Jaguar XJS", - "Kia Sedona EX", "Koenigsegg Agera", - "Lotus Esprit", "Lamborghini Diablo", - "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", - "Nissan Qashqai", - "Oldsmobile S98", "Opel Superboss", - "Porsche 356", "Pontiac Sunbird", - "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", - "Triumph Spitfire", "Toyota 2000GT", - "Volvo P1800", "Volkswagen Shirako" - ]; - $(function () { - var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { + "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", + "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", + "Chevrolet Camaro", "Cadillac", + "Duesenberg J", "Dodge Sprinter", + "Elantra", "Excavator", + "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", + "GAZ Siber", + "Honda S2000", "Hyundai Santro", + "Isuzu Swift", "Infiniti Skyline", + "Jaguar XJS", + "Kia Sedona EX", "Koenigsegg Agera", + "Lotus Esprit", "Lamborghini Diablo", + "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", + "Nissan Qashqai", + "Oldsmobile S98", "Opel Superboss", + "Porsche 356", "Pontiac Sunbird", + "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", + "Triumph Spitfire", "Toyota 2000GT", + "Volvo P1800", "Volkswagen Shirako" + ]; + $(function () { + var autocompleteInstance = new ej.Autocomplete($("#selectCar"), { width: "100%", watermarkText: "Select a car", dataSource: carList, enableAutoFill: true, showPopupButton: true, multiSelectMode: "delimiter" - }); + }); }); } @@ -197,12 +193,12 @@ module ChartComponent { range: { min: 25, max: 50, interval: 5 }, labelFormat: "{value}%", title: { text: "Efficiency" }, - + }, commonSeriesOptions: - { + { type: 'line', enableAnimation: true, - tooltip:{ visible :true, template:'Tooltip'}, + tooltip: { visible: true, template: 'Tooltip' }, marker: { shape: 'circle', @@ -212,30 +208,30 @@ module ChartComponent { }, visible: true }, - border : {width: 2} - }, - series: - [ - { - points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, - { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], - name: 'India' - }, + border: { width: 2 } + }, + series: + [ { - points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, - { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], - name: 'Germany' + points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 }, { x: 2007, y: 26 }, { x: 2008, y: 27 }, + { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], + name: 'India' }, - { - points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, - { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], - name: 'England' - }, { - points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, - { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], - name: 'France' - } + points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 }, { x: 2007, y: 30 }, { x: 2008, y: 36 }, + { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], + name: 'Germany' + }, + { + points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 }, { x: 2007, y: 34 }, { x: 2008, y: 41 }, + { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], + name: 'England' + }, + { + points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 }, { x: 2007, y: 40 }, { x: 2008, y: 44 }, + { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], + name: 'France' + } ], isResponsive: true, load: function () { @@ -300,13 +296,14 @@ module ChartComponent { theme = "flatlight"; break; } - sender.model.theme = theme; + sender.model.theme = theme; } }, title: { text: 'Efficiency of oil-fired power production' }, size: { height: "600" }, - legend: { visible: true}, + legend: { visible: true }, }); + // chartsample.model.load="loadTheme"; }); } @@ -360,7 +357,7 @@ module circulargaugecomponent { backgroundColor: "#f5b43f", border: { color: "#f5b43f" } }] - }] + }] }); }); } @@ -379,21 +376,21 @@ module ColorPickerComponent { -module ComboBoxComponent{ +module ComboBoxComponent { var BikeList = [ { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, { empid: "bk4", text: "Discover" }, { empid: "bk5", text: "Dazzler" }, { empid: "bk6", text: "Flame" }, { empid: "bk7", text: "Fazzer" }, { empid: "bk8", text: "FZ-S" }, { empid: "bk9", text: "Pulsar" }, { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } ]; - $(function () { - var comboboxInstance =new ej.ComboBox($("#selectCar"), { + $(function () { + var comboboxInstance = new ej.ComboBox($("#selectCar"), { width: "100%", placeholder: "Select a Bike", - fields: { text: "text", value: "empid" }, + fields: { text: "text", value: "empid" }, dataSource: BikeList, autofill: true - }); + }); }); } @@ -465,7 +462,8 @@ $(function () { }), createNode({ name: "Project", width: 150, height: 100, offsetX: 300, offsetY: 430, labels: [createLabel({ "text": "Find Project \nmanager" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Decision }), createNode({ - name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), + name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process + }), createNode({ name: "Decision", width: 250, height: 60, offsetX: 550, offsetY: 60, labels: [createLabel({ "text": "Decision Process for new software ideas" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Card, fillColor: "#858585", borderColor: "#858585" }), createNode({ name: "Reject", width: 150, height: 60, offsetX: 550, offsetY: 285, labels: [createLabel({ "text": "Reject and write report" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), createNode({ name: "Resources", width: 150, height: 60, offsetX: 550, offsetY: 430, labels: [createLabel({ "text": "Hire new resources" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }) @@ -479,7 +477,7 @@ $(function () { createConnector({ name: "connector6", sourceNode: "Project", targetNode: "Resources", labels: [createLabel({ "text": "No" })] }) ] }); - + }); function createNode(option: ej.datavisualization.Diagram.Node) { @@ -500,11 +498,11 @@ function createConnector(option: ej.datavisualization.Diagram.Connector) { return option; } -function createLabel(options : any) { +function createLabel(options: any) { return options; } - + module DialogComponent { $(function () { @@ -512,15 +510,17 @@ module DialogComponent { width: 550, minWidth: 310, minHeight: 215, - target:".control", - close:()=>{ - $("#btnOpen").show();} + target: ".control", + close: () => { + $("#btnOpen").show(); + } }); var btnInstance = new ej.Button($("#btnOpen"), { size: "medium", - click: ()=>{ - $("#btnOpen").hide(); - $("#basicDialog").ejDialog("open");}, + click: () => { + $("#btnOpen").hide(); + $("#basicDialog").ejDialog("open"); + }, type: "button", height: 30, width: 150 @@ -554,7 +554,7 @@ module digitalgaugecomponent { } - + @@ -566,7 +566,7 @@ module DropDownListComponent { { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } ]; $(function () { - var sample = new ej.DropDownList($("#bikeList"),{ + var sample = new ej.DropDownList($("#bikeList"), { dataSource: BikeList, width: "100%", watermarkText: "Select a bike", @@ -574,12 +574,12 @@ module DropDownListComponent { enableFilterSearch: true, caseSensitiveSearch: true, enableIncrementalSearch: true, - enablePopupResize: true, + enablePopupResize: true, delimiterChar: ";", multiSelectMode: ej.MultiSelectMode.Delimiter, maxPopupHeight: "300px", - minPopupHeight: "150px", - maxPopupWidth: "500px", + minPopupHeight: "150px", + maxPopupWidth: "500px", minPopupWidth: "350px", showCheckbox: true, showRoundedCorner: true @@ -610,53 +610,53 @@ module ExplorerComponent { module GanttComponent { - $(function () { - var ganttInstance = new ej.Gantt($("#GanttContainer"), { - dataSource: (window).projectData, - allowColumnResize: true, - allowSorting: true, - allowSelection: true, - enableContextMenu: true, - taskIdMapping: "taskID", - allowDragAndDrop: true, - taskNameMapping: "taskName", - startDateMapping: "startDate", - showColumnChooser: true, - showColumnOptions: true, - progressMapping: "progress", - durationMapping: "duration", - endDateMapping: "endDate", - childMapping: "subtasks", - scheduleStartDate: "02/01/2017", - scheduleEndDate: "04/09/2017", - //Resources mapping - resourceInfoMapping: "resourceId", - resourceNameMapping: "resourceName", - resourceIdMapping: "resourceId", - resources: (window).projectResources, - predecessorMapping: "predecessor", - showResourceNames: true, - toolbarSettings: { - showToolbar: true, - toolbarItems: ["add","edit","delete","update","cancel","indent","outdent","expandAll","collapseAll","search"] - }, - editSettings: { - allowEditing: true, - allowAdding: true, - allowDeleting: true, - allowIndent: true, - editMode: "cellEditing" - }, - sizeSettings: { - width: "100%", - height: "100%" - }, - dragTooltip: { showTooltip: true }, - showGridCellTooltip: true, - treeColumnIndex: 1, - isResponsive: true, + $(function () { + var ganttInstance = new ej.Gantt($("#GanttContainer"), { + dataSource: (window).projectData, + allowColumnResize: true, + allowSorting: true, + allowSelection: true, + enableContextMenu: true, + taskIdMapping: "taskID", + allowDragAndDrop: true, + taskNameMapping: "taskName", + startDateMapping: "startDate", + showColumnChooser: true, + showColumnOptions: true, + progressMapping: "progress", + durationMapping: "duration", + endDateMapping: "endDate", + childMapping: "subtasks", + scheduleStartDate: "02/01/2017", + scheduleEndDate: "04/09/2017", + //Resources mapping + resourceInfoMapping: "resourceId", + resourceNameMapping: "resourceName", + resourceIdMapping: "resourceId", + resources: (window).projectResources, + predecessorMapping: "predecessor", + showResourceNames: true, + toolbarSettings: { + showToolbar: true, + toolbarItems: ["add", "edit", "delete", "update", "cancel", "indent", "outdent", "expandAll", "collapseAll", "search"] + }, + editSettings: { + allowEditing: true, + allowAdding: true, + allowDeleting: true, + allowIndent: true, + editMode: "cellEditing" + }, + sizeSettings: { + width: "100%", + height: "100%" + }, + dragTooltip: { showTooltip: true }, + showGridCellTooltip: true, + treeColumnIndex: 1, + isResponsive: true, + }); }); -}); } @@ -749,7 +749,7 @@ $(function () { module KanbanComponent { $(function () { var sample = new ej.Kanban($("#Kanban"), { - dataSource: new ej.DataManager((window).kanbanData).executeLocal(new ej.Query().take(20)), + dataSource: new ej.DataManager((window).kanbanData).executeLocal(new ej.Query().take(20)), columns: [ { headerText: "Backlog", key: "Open" }, { headerText: "In Progress", key: "InProgress" }, @@ -768,7 +768,7 @@ module KanbanComponent { }); } - + module lineargaugecomponent { @@ -794,14 +794,14 @@ module lineargaugecomponent { backgroundColor: "#E94649", border: { color: "#E94649" }, startWidth: 4, endWidth: 4 }] - }] + }] }); }); } - - + + module ListBoxComponent { $(function () { @@ -811,13 +811,13 @@ module ListBoxComponent { }); } - + module ListviewComponent { $(function () { var listviewInstance = new ej.ListView($("#defaultlistview"), { - enableCheckMark: true, - width: 400 + enableCheckMark: true, + width: 400 }); }); } @@ -1056,7 +1056,7 @@ module mapcomponenet { module MenuComponent { $(function () { - var sample = new ej.Menu($("#syncfusionProducts"),{ + var sample = new ej.Menu($("#syncfusionProducts"), { width: "100%", animationType: ej.AnimationType.Default, cssClass: 'gradient-lime ', @@ -1081,12 +1081,12 @@ module MenuComponent { - + module NavigationDrawerComponent { $(function () { var navigationdrawerInstance = new ej.NavigationDrawer($("#navpane"), { - targetId: "butdrawer", + targetId: "butdrawer", contentId: "content_container", type: "overlay", direction: "left", @@ -1097,8 +1097,8 @@ module NavigationDrawerComponent { }, position: "normal" }); - $("#navpane_listview").click(function(e: any) { - var text=e.target["text"]||$(e.target).closest("li.e-list").text(); + $("#navpane_listview").click(function (e: any) { + var text = e.target["text"] || $(e.target).closest("li.e-list").text(); $("#butdrawer").parent().children("h2").text(text); }); }); @@ -1109,7 +1109,7 @@ module NavigationDrawerComponent { module PDFViewerComponent { $(function () { var pdfviewerControl = new ej.PdfViewer($("#pdfviewer"), { - serviceUrl:(window).baseurl+ "api/PdfViewer", + serviceUrl: (window).baseurl + "api/PdfViewer", isResponsive: true }); }); @@ -1119,50 +1119,42 @@ module PDFViewerComponent { module PivotChartOlap { $(function () { - var sample = new ej.PivotChart($("#PivotChart"),{ + var sample = new ej.PivotChart($("#PivotChart"), { dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]" - } - ], - axis: "columns" - } - ], - filters:[] - }, - isResponsive: true,zooming:{enableScrollbar: true}, - commonSeriesOptions: { - type: "column" - }, - size: { height: "460px", width: "100%" }, - primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, - primaryYAxis: { title: { text: "Internet Sales Amount" } }, - legend: { visible: true, rowCount: 2 }, - load: function () { - var PivotChart = (window).themeStyle + (window).themeColor + (window).themeVarient; - PivotChart = PivotChart.toString(); - if (PivotChart.indexOf("dark") > -1 || PivotChart.indexOf("contrast") > -1) - PivotChart = "flatdark"; - else - PivotChart = "flatlight"; - this.model.theme = PivotChart; + data: "//bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]" + } + ], + axis: "columns" + } + ], + filters: [] }, + isResponsive: true, zooming: { enableScrollbar: true }, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, + primaryYAxis: { title: { text: "Internet Sales Amount" } }, + legend: { visible: true, rowCount: 2 } + // load:"loadTheme" }); }); } @@ -1199,53 +1191,45 @@ var pivot_dataset = [ module PivotChartRelational { $(function () { - var sample = new ej.PivotChart($("#PivotChart"),{ + var sample = new ej.PivotChart($("#PivotChart"), { dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - fieldCaption: "Country" - }, - { - fieldName: "State", - fieldCaption: "State" - }, - { - fieldName: "Date", - fieldCaption: "Date" - } - ], - columns: [ - { - fieldName: "Product", - fieldCaption: "Product" - } - ], - values: [ - { - fieldName: "Amount", - fieldCaption: "Amount" - } - ], - filters:[] - }, - isResponsive: true,zooming:{enableScrollbar: true}, - commonSeriesOptions: { - type: "column" - }, - size: { height: "460px", width: "100%" }, - primaryYAxis: { title: { text: "Amount" } }, - legend: { visible: true }, - load: function () { - var PivotChart = (window).themeStyle + (window).themeColor + (window).themeVarient; - PivotChart = PivotChart.toString(); - if (PivotChart.indexOf("dark") > -1 || PivotChart.indexOf("contrast") > -1) - PivotChart = "flatdark"; - else - PivotChart = "flatlight"; - this.model.theme = PivotChart; + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + }, + { + fieldName: "Date", + fieldCaption: "Date" + } + ], + columns: [ + { + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + } + ], + filters: [] }, + isResponsive: true, zooming: { enableScrollbar: true }, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryYAxis: { title: { text: "Amount" } }, + legend: { visible: true } + // load:"loadTheme" }); }); } @@ -1255,106 +1239,106 @@ module PivotChartRelational { module PivotGaugeOlap { $(function () { - var sample = new ej.PivotGauge($("#PivotGauge"),{ + var sample = new ej.PivotGauge($("#PivotGauge"), { dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]", - filterItems: { filterType: "include", values: ["[Date].[Fiscal].[Fiscal Year].&[2004]"] } - }, - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]" - }, - { - fieldName: "[Measures].[Internet Revenue Status]" - }, - { - fieldName: "[Measures].[Internet Revenue Trend]" - }, - { - fieldName: "[Measures].[Internet Revenue Goal]" - }, - ], - axis: "columns" - } - ], - filters:[] - }, + data: "//bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]", + filterItems: { filterType: "include", values: ["[Date].[Fiscal].[Fiscal Year].&[2004]"] } + }, + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]" + }, + { + fieldName: "[Measures].[Internet Revenue Status]" + }, + { + fieldName: "[Measures].[Internet Revenue Trend]" + }, + { + fieldName: "[Measures].[Internet Revenue Goal]" + }, + ], + axis: "columns" + } + ], + filters: [] + }, enableTooltip: true, isResponsive: true, labelFormatSettings: { decimalPlaces: 2 }, - scales: [{ - showRanges: true, - radius: 150, showScaleBar: true, size: 1, + scales: [{ + showRanges: true, + radius: 150, showScaleBar: true, size: 1, border: { - width: 0.5 - }, - showIndicators: true, showLabels: true, - pointers: [{ - showBackNeedle: true, - backNeedleLength: 20, - length: 120, - width: 7 + width: 0.5 }, - { - type: "marker", - markerType: "diamond", - distanceFromScale: 5, - placement: "center", - backgroundColor: "#29A4D9", - length: 25, - width: 15 - }], + showIndicators: true, showLabels: true, + pointers: [{ + showBackNeedle: true, + backNeedleLength: 20, + length: 120, + width: 7 + }, + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], ticks: [{ - type: "major", + type: "major", distanceFromScale: 2, - height: 16, - width: 1, color: "#8c8c8c" - }, - { - type: "minor", - height: 6, - width: 1, - distanceFromScale: 2, - color: "#8c8c8c" - }], + height: 16, + width: 1, color: "#8c8c8c" + }, + { + type: "minor", + height: 6, + width: 1, + distanceFromScale: 2, + color: "#8c8c8c" + }], labels: [{ color: "#8c8c8c" - }], - ranges: [{ - distanceFromScale: -5, - backgroundColor: "#fc0606", - border: { color: "#fc0606" } - }, - { - distanceFromScale: -5 }], - customLabels: [{ - position: { x: 180, y: 290 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + ranges: [{ + distanceFromScale: -5, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } }, - { - position: { x: 180, y: 320 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + { + distanceFromScale: -5 + }], + customLabels: [{ + position: { x: 180, y: 290 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" }, - { - position: { x: 180, y: 150 }, - font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }] + { + position: { x: 180, y: 320 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }, + { + position: { x: 180, y: 150 }, + font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }] }] }); - }); + }); } @@ -1388,94 +1372,94 @@ var pivot_dataset = [ module PivotGaugeRelational { $(function () { - var sample = new ej.PivotGauge($("#PivotGauge"),{ + var sample = new ej.PivotGauge($("#PivotGauge"), { dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - }, - { - fieldName: "State", - } - ], - columns: [ - { - fieldName: "Product", - } - ], + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + }, + { + fieldName: "State", + } + ], + columns: [ + { + fieldName: "Product", + } + ], values: [ - { - fieldName: "Amount", - }, - { - fieldName: "Quantity", - } - ] - }, + { + fieldName: "Amount", + }, + { + fieldName: "Quantity", + } + ] + }, enableTooltip: true, isResponsive: true, labelFormatSettings: { decimalPlaces: 2 }, - scales: [{ - showRanges: true, - radius: 150, showScaleBar: true, size: 1, + scales: [{ + showRanges: true, + radius: 150, showScaleBar: true, size: 1, border: { - width: 0.5 - }, - showIndicators: true, showLabels: true, - pointers: [{ - showBackNeedle: true, - backNeedleLength: 20, - length: 120, - width: 7 + width: 0.5 }, - { - type: "marker", - markerType: "diamond", - distanceFromScale: 5, - placement: "center", - backgroundColor: "#29A4D9", - length: 25, - width: 15 - }], + showIndicators: true, showLabels: true, + pointers: [{ + showBackNeedle: true, + backNeedleLength: 20, + length: 120, + width: 7 + }, + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], ticks: [{ - type: "major", + type: "major", distanceFromScale: 2, - height: 16, - width: 1, color: "#8c8c8c" - }, - { - type: "minor", - height: 6, - width: 1, - distanceFromScale: 2, - color: "#8c8c8c" - }], + height: 16, + width: 1, color: "#8c8c8c" + }, + { + type: "minor", + height: 6, + width: 1, + distanceFromScale: 2, + color: "#8c8c8c" + }], labels: [{ color: "#8c8c8c" - }], - ranges: [{ - distanceFromScale: -5, - backgroundColor: "#fc0606", - border: { color: "#fc0606" } - }, - { - distanceFromScale: -5 }], - customLabels: [{ - position: { x: 180, y: 290 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + ranges: [{ + distanceFromScale: -5, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } }, - { - position: { x: 180, y: 320 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + { + distanceFromScale: -5 + }], + customLabels: [{ + position: { x: 180, y: 290 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" }, - { - position: { x: 180, y: 150 }, - font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }] + { + position: { x: 180, y: 320 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }, + { + position: { x: 180, y: 150 }, + font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }] }] }); - }); + }); } @@ -1483,35 +1467,35 @@ module PivotGaugeRelational { module PivotGridOlap { $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"),{ + var sample = new ej.PivotGrid($("#PivotGrid"), { dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]", - } - ], - axis: "columns" - } - ], - filters:[] - }, - enableGroupingBar: true, - pivotTableFieldListID:"PivotSchemaDesigner" + data: "//bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]", + } + ], + axis: "columns" + } + ], + filters: [] + }, + enableGroupingBar: true, + pivotTableFieldListID: "PivotSchemaDesigner" }); $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); }); @@ -1548,41 +1532,41 @@ var pivot_dataset = [ module PivotGridRelational { $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"),{ + var sample = new ej.PivotGrid($("#PivotGrid"), { dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - fieldCaption: "Country" - }, - { - fieldName: "State", - fieldCaption: "State" - } - ], - columns: - [{ - fieldName: "Product", - fieldCaption: "Product" - } - ], - values: [ - { - fieldName: "Amount", - fieldCaption: "Amount" - }, - { - fieldName: "Quantity", - fieldCaption: "Quantity" - } - ], - filters:[] - }, - enableGroupingBar: true, - pivotTableFieldListID:"PivotSchemaDesigner" + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + } + ], + columns: + [{ + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + }, + { + fieldName: "Quantity", + fieldCaption: "Quantity" + } + ], + filters: [] + }, + enableGroupingBar: true, + pivotTableFieldListID: "PivotSchemaDesigner" }); - $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); + $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); }); } @@ -1591,33 +1575,33 @@ module PivotGridRelational { module PivotTreeMap { $(function () { - var sample = new ej.PivotTreeMap($("#PivotTreeMap"),{ + var sample = new ej.PivotTreeMap($("#PivotTreeMap"), { dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll;Locale Identifier=1033;", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - columns: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Customer Count]", - } - ], - axis: "columns" - } - ], - filters:[] - } + data: "//bi.syncfusion.com/olap/msmdpump.dll;Locale Identifier=1033;", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + columns: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Customer Count]", + } + ], + axis: "columns" + } + ], + filters: [] + } }); }); } @@ -1626,7 +1610,7 @@ module PivotTreeMap { module ProgressBarComponent { $(function () { - var sample = new ej.ProgressBar($("#progressBar"),{ + var sample = new ej.ProgressBar($("#progressBar"), { width: 200, value: 45, height: 20, @@ -1656,7 +1640,7 @@ module RadialMenuComponent { backImageClass: "backimageclass", targetElementId: "radialtarget1" }); - $("#radialtarget1").parent().css("position", "relative"); + $("#radialtarget1").parent().css("position", "relative"); } else { $("#contentDiv").html("Radial Menu is only supported from Internet Explorer Versioned 9 and above.").css({ "font-size": "20px", "color": "red" }); @@ -1723,12 +1707,12 @@ function redo(e: any) { } - + module RadialSliderComponent { $(function () { var radialsliderInstance = new ej.RadialSlider($("#radialSlider"), { - innerCircleImageUrl: "images/radialslider/chevron-right.png" + innerCircleImageUrl: "images/radialslider/chevron-right.png" }); }); } @@ -1825,8 +1809,8 @@ var data; data = GetData(); function GetData() { - var series1:any[]=[]; - var series2:any[]= []; + var series1: any[] = []; + var series2: any[] = []; var value = 100; var value1 = 120; for (var i = 1; i < 730; i++) { @@ -1853,7 +1837,7 @@ function GetData() { module RatingComponent { $(function () { - var sample1 = new ej.Rating($("#fullRating"),{ + var sample1 = new ej.Rating($("#fullRating"), { value: 4, precision: ej.Rating.Precision.Full, allowReset: true, @@ -1868,8 +1852,8 @@ module RatingComponent { shapeWidth: 25, showTooltip: true }); - - var sample2 = new ej.Rating($("#halfRating"),{ + + var sample2 = new ej.Rating($("#halfRating"), { precision: ej.Rating.Precision.Half, value: 3.5, allowReset: true, @@ -1885,7 +1869,7 @@ module RatingComponent { showTooltip: true }); - var sample3 = new ej.Rating($("#exactRating"),{ + var sample3 = new ej.Rating($("#exactRating"), { precision: ej.Rating.Precision.Exact, value: 3.7, allowReset: true, @@ -1899,7 +1883,7 @@ module RatingComponent { shapeHeight: 25, shapeWidth: 25, showTooltip: true - }); + }); }); } @@ -1907,15 +1891,15 @@ module RatingComponent { module ReportViewerComponent { - $(function () { - var report = new ej.ReportViewer($("#territoryReportViewer"), { - reportServiceUrl: (window).baseurl + 'api/ReportViewer', - reportServerUrl: 'http://104.207.134.201/reportserver', - processingMode: ej.ReportViewer.ProcessingMode.Remote, - reportPath: "/SSRSSamples2/Territory Sales new", - isResponsive: true - }); - }); + $(function () { + var report = new ej.ReportViewer($("#territoryReportViewer"), { + reportServiceUrl: (window).baseurl + 'api/ReportViewer', + reportServerUrl: 'http://104.207.134.201/reportserver', + processingMode: ej.ReportViewer.ProcessingMode.Remote, + reportPath: "/SSRSSamples2/Territory Sales new", + isResponsive: true + }); + }); } @@ -1932,7 +1916,7 @@ module RibbonComponent { toolTip: "Pin the Ribbon" }, applicationTab: { - type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } + type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } }, tabs: [{ id: "home", text: "HOME", groups: [{ @@ -1956,7 +1940,7 @@ module RibbonComponent { } }] }, - { + { text: "Clipboard", alignType: ej.Ribbon.AlignType.Columns, content: [{ groups: [{ id: "paste", @@ -1978,8 +1962,8 @@ module RibbonComponent { height: 70 } }, - { - groups: [{ + { + groups: [{ id: "cut", text: "Cut", toolTip: "Cut", @@ -2009,14 +1993,14 @@ module RibbonComponent { prefixIcon: "e-icon e-ribbon clearAll" } }], - defaults: { + defaults: { type: "button", width: 60, isBig: false } - }] - }, - { + }] + }, + { text: "Font", alignType: "rows", content: [{ groups: [{ id: "fontfamily", @@ -2315,7 +2299,7 @@ module RibbonComponent { groups: [{ id: "zoomin", text: "Zoom In", - toolTip: "Zoom In", + toolTip: "Zoom In", buttonSettings: { width: 58, click: "onClick", @@ -2327,7 +2311,7 @@ module RibbonComponent { { id: "zoomout", text: "Zoom Out", - toolTip: "Zoom Out", + toolTip: "Zoom Out", buttonSettings: { width: 70, click: "onClick", @@ -2339,7 +2323,7 @@ module RibbonComponent { { id: "fullscreen", text: "Full Screen", - toolTip: "Full Screen", + toolTip: "Full Screen", buttonSettings: { width: 73, click: "onClick", @@ -2355,7 +2339,7 @@ module RibbonComponent { } }] }] - },{ + }, { id: "insert", text: "INSERT", groups: [{ text: "Tables", alignType: ej.Ribbon.AlignType.Columns, content: [{ groups: [{ @@ -2500,7 +2484,7 @@ module RibbonComponent { } ], defaults: { - type: "button", + type: "button", width: 70, height: 70 } @@ -2582,7 +2566,7 @@ module RibbonComponent { } ] } - ], + ], create: function createControl(args) { var ribbon = $("#defaultRibbon").data("ejRibbon"); $("#fontcolor").ejColorPicker({ value: "#FFFF00", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fontcoloricon", select: colorHandler }); @@ -2594,7 +2578,7 @@ module RibbonComponent { function colorHandler(args:any) { (this._id.indexOf("fillcolor") != -1) ? $("#contenteditor").css('background-color', args.value) : document.execCommand('forecolor', false, args.value); } -function onClick(args:any) { +function onClick(args: any) { var val, prop = args.text; val = (ej.isNullOrUndefined(args.model.text)) ? args.model.activeText : args.model.text; if (action1.indexOf(val) != -1) @@ -2612,7 +2596,7 @@ function onClick(args:any) { - + module RotatorComponent { $(function () { @@ -2622,14 +2606,14 @@ module RotatorComponent { slideHeight: "auto", displayItemsCount: "1", navigateSteps: "1", - pagerPosition:"outside", + pagerPosition: "outside", orientation: "horizontal", showPager: true, enabled: true, showCaption: true, allowKeyboardNavigation: true, showPlayButton: true, - isResponsive:true, + isResponsive: true, animationType: "slide", }); }); @@ -2639,7 +2623,7 @@ module RotatorComponent { module RTEComponent { $(function () { - var sample = new ej.RTE($("#rteSample"),{ + var sample = new ej.RTE($("#rteSample"), { width: "100%", minWidth: "150px", showFooter: true, @@ -2775,7 +2759,7 @@ module ScheduleComponent { } }); }); -} +} @@ -2835,10 +2819,10 @@ module linesparkline { dataSource: [12, 14, 11, 12, 11, 15, 12, 10, 11, 12, 15, 13, 12, 11, 10, 13, 15, 12, 14, 16, 14, 12, 11], tooltip: { visible: true, - font: { size:"12px" } + font: { size: "12px" } }, type: "line", - size: { height: "40", width:"170" }, + size: { height: "40", width: "170" }, }); }); } @@ -2846,7 +2830,7 @@ module linesparkline { module columnsparkline { $(function () { var sparkcolumnsample = new ej.Sparkline($("#column"), { - dataSource: [2, 6, -1, 1, 12, 5, -2, 7, -3, 5, 8, 10,], + dataSource: [2, 6, -1, 1, 12, 5, -2, 7, -3, 5, 8, 10, ], negativePointColor: "red", highPointColor: "blue", tooltip: { @@ -2864,7 +2848,7 @@ module columnsparkline { module areasparkline { $(function () { var sparkareasample = new ej.Sparkline($("#area"), { - dataSource: [12, -10, 11, 8, 17, 6, 2, -17, 13, -6, 8, 10,], + dataSource: [12, -10, 11, 8, 17, 6, 2, -17, 13, -6, 8, 10, ], markerSettings: { visible: true }, highPointColor: "blue", lowPointColor: "orange", @@ -2884,7 +2868,7 @@ module areasparkline { module windlosssparkline { $(function () { var sparkwinlosssample = new ej.Sparkline($("#winloss"), { - dataSource: [12, 15, -11, 13, 17, 0, -12, 17, 13, -15, 8, 10,], + dataSource: [12, 15, -11, 13, 17, 0, -12, 17, 13, -15, 8, 10, ], type: "winloss", size: { height: "100", width: "150" }, }); @@ -2910,7 +2894,7 @@ module piesparkline1 { module piesparkline2 { $(function () { var sparkpiesample2 = new ej.Sparkline($("#pie2"), { - dataSource: [8, 9, 1,], + dataSource: [8, 9, 1, ], type: "pie", tooltip: { visible: true, @@ -2955,9 +2939,9 @@ module piesparkline4 { }); } - - + + module SplitterComponent { @@ -2967,10 +2951,10 @@ module SplitterComponent { width: "50%", orientation: ej.Orientation.Vertical, properties: [{}, { paneSize: 80 }], - isResponsive:true + isResponsive: true }); var splitterInstance1 = new ej.Splitter($("#innerSpliter"), { - isResponsive:true, + isResponsive: true, }); }); } @@ -2978,7 +2962,7 @@ module SplitterComponent { module SpreadsheetComponent { -$(function () { + $(function () { var sample = new ej.Spreadsheet($("#basicSpreadsheet"), { scrollSettings: { height: 550, @@ -2992,14 +2976,15 @@ $(function () { pdfUrl: (window).baseurl + "api/Spreadsheet/PdfExport" }, sheets: [{ rangeSettings: [{ dataSource: (window).defaultData, startCell: "A1" }] }], - loadComplete: () => { - var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; - if (!(spreadsheet).isImport) { - spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); - xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); - xlFormat.format({ "type": "currency" }, "E2:H11"); - spreadsheet.XLRibbon.updateRibbonIcons(); - }} + loadComplete: () => { + var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; + if (!(spreadsheet).isImport) { + spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); + xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); + xlFormat.format({ "type": "currency" }, "E2:H11"); + spreadsheet.XLRibbon.updateRibbonIcons(); + } + } }); }); } @@ -3008,58 +2993,58 @@ $(function () { var default_data: Array = [ - { Category : "Employees", Country : "USA", JobDescription : "Sales", JobGroup:"Executive", EmployeesCount : 50 }, - { Category : "Employees", Country : "USA", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, - { Category : "Employees", Country : "USA", JobDescription : "Marketing", EmployeesCount : 40 }, - { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 55 }, - { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 175}, - { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 70 }, - { Category : "Employees", Country : "USA", JobDescription : "Management", EmployeesCount : 40 }, - { Category : "Employees", Country : "USA", JobDescription : "Accounts", EmployeesCount : 60 }, - - { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 43 }, - { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 125}, - { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 60 }, - { Category : "Employees", Country : "India", JobDescription : "HR Executives", EmployeesCount : 70 }, - { Category : "Employees", Country : "India", JobDescription : "Accounts", EmployeesCount : 45 }, - - { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Executive", EmployeesCount : 30 }, - { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, - { Category : "Employees", Country : "Germany", JobDescription : "Marketing", EmployeesCount : 50 }, - { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, - { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, - { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, - { Category : "Employees", Country : "Germany", JobDescription : "Management", EmployeesCount : 33 }, - { Category : "Employees", Country : "Germany", JobDescription : "Accounts", EmployeesCount : 55 }, - - { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 45 }, - { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 96 }, - { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 55 }, - { Category : "Employees", Country : "UK", JobDescription : "HR Executives", EmployeesCount : 60 }, - { Category : "Employees", Country : "UK", JobDescription: "Accounts", EmployeesCount: 30 }, - - { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, - { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, - { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, - { Category : "Employees", Country : "France", JobDescription: "Marketing", EmployeesCount: 50 } + { Category: "Employees", Country: "USA", JobDescription: "Sales", JobGroup: "Executive", EmployeesCount: 50 }, + { Category: "Employees", Country: "USA", JobDescription: "Sales", JobGroup: "Analyst", EmployeesCount: 40 }, + { Category: "Employees", Country: "USA", JobDescription: "Marketing", EmployeesCount: 40 }, + { Category: "Employees", Country: "USA", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 55 }, + { Category: "Employees", Country: "USA", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 175 }, + { Category: "Employees", Country: "USA", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 70 }, + { Category: "Employees", Country: "USA", JobDescription: "Management", EmployeesCount: 40 }, + { Category: "Employees", Country: "USA", JobDescription: "Accounts", EmployeesCount: 60 }, + + { Category: "Employees", Country: "India", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 43 }, + { Category: "Employees", Country: "India", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 125 }, + { Category: "Employees", Country: "India", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 60 }, + { Category: "Employees", Country: "India", JobDescription: "HR Executives", EmployeesCount: 70 }, + { Category: "Employees", Country: "India", JobDescription: "Accounts", EmployeesCount: 45 }, + + { Category: "Employees", Country: "Germany", JobDescription: "Sales", JobGroup: "Executive", EmployeesCount: 30 }, + { Category: "Employees", Country: "Germany", JobDescription: "Sales", JobGroup: "Analyst", EmployeesCount: 40 }, + { Category: "Employees", Country: "Germany", JobDescription: "Marketing", EmployeesCount: 50 }, + { Category: "Employees", Country: "Germany", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 40 }, + { Category: "Employees", Country: "Germany", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 65 }, + { Category: "Employees", Country: "Germany", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 27 }, + { Category: "Employees", Country: "Germany", JobDescription: "Management", EmployeesCount: 33 }, + { Category: "Employees", Country: "Germany", JobDescription: "Accounts", EmployeesCount: 55 }, + + { Category: "Employees", Country: "UK", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 45 }, + { Category: "Employees", Country: "UK", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 96 }, + { Category: "Employees", Country: "UK", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 55 }, + { Category: "Employees", Country: "UK", JobDescription: "HR Executives", EmployeesCount: 60 }, + { Category: "Employees", Country: "UK", JobDescription: "Accounts", EmployeesCount: 30 }, + + { Category: "Employees", Country: "France", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 40 }, + { Category: "Employees", Country: "France", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 65 }, + { Category: "Employees", Country: "France", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 27 }, + { Category: "Employees", Country: "France", JobDescription: "Marketing", EmployeesCount: 50 } ]; module sunburstcomponent { $(function () { var sunburstsample = new ej.SunburstChart($("#Sunburst"), { - valueMemberPath: "EmployeesCount", + valueMemberPath: "EmployeesCount", levels: [ - {groupMemberPath: "Country"}, - {groupMemberPath: "JobDescription"}, - {groupMemberPath: "JobGroup"}, - {groupMemberPath: "JobRole"} + { groupMemberPath: "Country" }, + { groupMemberPath: "JobDescription" }, + { groupMemberPath: "JobGroup" }, + { groupMemberPath: "JobRole" } ], dataSource: default_data, - dataLabelSettings:{visible:true}, - tooltip:{visible:false}, - enableAnimation:false, - size:{height:"600"}, - innerRadius:0.2, + dataLabelSettings: { visible: true }, + tooltip: { visible: false }, + enableAnimation: false, + size: { height: "600" }, + innerRadius: 0.2, load: function () { var sender = $("#Sunburst").data("ejSunburstChart"); var SunBurstTheme = (window).themeStyle + (window).themeColor + (window).themeVarient; @@ -3070,9 +3055,10 @@ module sunburstcomponent { SunBurstTheme = "flatlight"; sender.model.theme = SunBurstTheme; }, - title:{text:"Employees Count"}, - zoomSettings:{enable:false}, - legend:{visible:true,position:'top'}, + title: { text: "Employees Count" }, + zoomSettings: { enable: false }, + legend: { visible: true, position: 'top' } + // load:"loadTheme" }); }); } @@ -3082,7 +3068,7 @@ module sunburstcomponent { module TabComponent { $(function () { - var sample = new ej.Tab($("#defaultTab"),{ + var sample = new ej.Tab($("#defaultTab"), { width: "500px", collapsible: true, events: "click", @@ -3096,8 +3082,8 @@ module TabComponent { module TagCloudComponent { - - + + var websiteCollection = [ { text: "Google", url: "http://www.google.com", frequency: 12 }, { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, @@ -3128,7 +3114,7 @@ module TagCloudComponent { text: "text", url: "url", frequency: "frequency" } }); - + }); } @@ -3168,82 +3154,82 @@ module EditorComponent { - + module TileViewComponent { $(function () { var tile1 = new ej.Tile($("#tile1"), { - imagePosition:"fill", - caption:{text:"People"}, - tileSize:"medium", - imageUrl:'content/images/tile/windows/people_1.png' + imagePosition: "fill", + caption: { text: "People" }, + tileSize: "medium", + imageUrl: 'content/images/tile/windows/people_1.png' }); - var tile2 = new ej.Tile($("#tile2"), { - imagePosition:"center", - tileSize:"small", - imageUrl:'content/images/tile/windows/alerts.png', - + var tile2 = new ej.Tile($("#tile2"), { + imagePosition: "center", + tileSize: "small", + imageUrl: 'content/images/tile/windows/alerts.png', + }); - var tile3 = new ej.Tile($("#tile3"), { - imagePosition:"center", - tileSize:"small", - imageUrl:'content/images/tile/windows/bing.png', + var tile3 = new ej.Tile($("#tile3"), { + imagePosition: "center", + tileSize: "small", + imageUrl: 'content/images/tile/windows/bing.png', }); - var tile4 = new ej.Tile($("#tile4"), { - tileSize:"small", - imageUrl:'content/images/tile/windows/camera.png', + var tile4 = new ej.Tile($("#tile4"), { + tileSize: "small", + imageUrl: 'content/images/tile/windows/camera.png', }); - var tile5 = new ej.Tile($("#tile5"), { - imagePosition:"center", - tileSize:"small", - imageUrl:'content/images/tile/windows/messages.png', + var tile5 = new ej.Tile($("#tile5"), { + imagePosition: "center", + tileSize: "small", + imageUrl: 'content/images/tile/windows/messages.png', }); - var tile6 = new ej.Tile($("#tile6"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/games.png', - caption:{text:"Play"} + var tile6 = new ej.Tile($("#tile6"), { + imagePosition: "center", + tileSize: "medium", + imageUrl: 'content/images/tile/windows/games.png', + caption: { text: "Play" } }); - var tile7 = new ej.Tile($("#tile7"), { - tileSize:"medium", - imageUrl:'content/images/tile/windows/map.png', - caption:{text:"Maps"} + var tile7 = new ej.Tile($("#tile7"), { + tileSize: "medium", + imageUrl: 'content/images/tile/windows/map.png', + caption: { text: "Maps" } }); - var tile8 = new ej.Tile($("#tile8"), { - imagePosition:"fill", - tileSize:"wide", - imageUrl:'content/images/tile/windows/sports.png', - caption:{text:"Sports"} + var tile8 = new ej.Tile($("#tile8"), { + imagePosition: "fill", + tileSize: "wide", + imageUrl: 'content/images/tile/windows/sports.png', + caption: { text: "Sports" } }); - var tile9 = new ej.Tile($("#tile9"), { - imagePosition:"fill", - tileSize:"medium", - imageUrl:'content/images/tile/windows/people_2.png', - caption:{text:"People"} + var tile9 = new ej.Tile($("#tile9"), { + imagePosition: "fill", + tileSize: "medium", + imageUrl: 'content/images/tile/windows/people_2.png', + caption: { text: "People" } }); - var tile10 = new ej.Tile($("#tile10"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/pictures.png', - caption:{text:"Photo"} + var tile10 = new ej.Tile($("#tile10"), { + imagePosition: "center", + tileSize: "medium", + imageUrl: 'content/images/tile/windows/pictures.png', + caption: { text: "Photo" } }); - var tile11 = new ej.Tile($("#tile11"), { - imagePosition:"center", - tileSize:"wide", - imageUrl:'content/images/tile/windows/weather.png', - caption:{text:"Weather"} + var tile11 = new ej.Tile($("#tile11"), { + imagePosition: "center", + tileSize: "wide", + imageUrl: 'content/images/tile/windows/weather.png', + caption: { text: "Weather" } }); - var tile12 = new ej.Tile($("#tile12"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/music.png', - caption:{text:"Music"} + var tile12 = new ej.Tile($("#tile12"), { + imagePosition: "center", + tileSize: "medium", + imageUrl: 'content/images/tile/windows/music.png', + caption: { text: "Music" } }); - var tile13 = new ej.Tile($("#tile13"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/favs.png', - caption:{text:"Favorites"} + var tile13 = new ej.Tile($("#tile13"), { + imagePosition: "center", + tileSize: "medium", + imageUrl: 'content/images/tile/windows/favs.png', + caption: { text: "Favorites" } }); }); } @@ -3262,13 +3248,13 @@ module TimePickerComponent { module ToolbarComponent { - + $(function () { - var sample = new ej.Toolbar($("#editingToolbar"),{ + var sample = new ej.Toolbar($("#editingToolbar"), { width: "100%", cssClass: "gradient-lime", enableSeparator: true, - + isResponsive: true, orientation: ej.Orientation.Horizontal, showRoundedCorner: true @@ -3281,10 +3267,10 @@ module ToolbarComponent { module TooltipComponent { - + $(function () { - var sample1 = new ej.Tooltip($("#link1"),{ + var sample1 = new ej.Tooltip($("#link1"), { content: "ECMAScript (or ES) is a trademarked scripting-language specification standardized by Ecma International in ECMA-262 and ISO/IEC 16262.", associate: "mousefollow", autoCloseTimeout: 5000, @@ -3294,7 +3280,7 @@ module TooltipComponent { showShadow: true }); - var sample2 = new ej.Tooltip($("#link2"),{ + var sample2 = new ej.Tooltip($("#link2"), { content: "The World Wide Web (WWW) is an information space where documents and other web resources are identified by URLs, interlinked by hypertext links, and can be accessed via the Internet.", position: { stem: { @@ -3313,7 +3299,7 @@ module TooltipComponent { showShadow: true }); - var sample3 = new ej.Tooltip($("#link3"),{ + var sample3 = new ej.Tooltip($("#link3"), { content: 'Object-oriented programming (OOP) is a programming language model organized around objects rather than "actions" and data rather than logic.', position: { stem: { @@ -3340,43 +3326,43 @@ module TooltipComponent { module TreeGridComponent { $(function () { var treegridInstance = new ej.TreeGrid($("#TreeGridContainer"), { - dataSource: (window).treeGridData, - childMapping: "subtasks", - allowSorting: true, - allowMultiSorting: true, - enableAltRow: true, - allowFiltering: true, - treeColumnIndex: 1, - allowKeyboardNavigation: true, - showColumnChooser: true, - showColumnOptions: true, - contextMenuSettings: { - showContextMenu: true, - contextMenuItems: ["add", "edit", "delete"] - }, - columnDialogFields: ["field", "headerText", "editType", "width", "visible", "allowSorting", "textAlign", "headerTextAlign"], - editSettings: { - allowAdding: true, - allowEditing: true, - allowDeleting: true, - editMode: "cellEditing", - rowPosition: "belowSelectedRow" - }, - toolbarSettings: { - showToolbar: true, - toolbarItems: ["add","edit","delete","update","cancel","expandAll","collapseAll"] - }, - columns: [ - { field: "taskID", headerText: "Task Id", allowFiltering: false, editType: "numericedit", filterEditType: "numericedit" }, - { field: "taskName", headerText: "Task Name", editType: "stringedit", filterEditType: "stringedit" }, - { field: "startDate", headerText: "Start Date", editType: "datepicker", filterEditType: "datepicker", format:"{0:MM/dd/yyyy}" }, - { field: "endDate", headerText: "End Date", editType: "datepicker", filterEditType: "datepicker", format:"{0:MM/dd/yyyy}" }, - { field: "progress", headerText: "Progress", editType: "numericedit", filterEditType: "numericedit" } - ], - isResponsive: true, + dataSource: (window).treeGridData, + childMapping: "subtasks", + allowSorting: true, + allowMultiSorting: true, + enableAltRow: true, + allowFiltering: true, + treeColumnIndex: 1, + allowKeyboardNavigation: true, + showColumnChooser: true, + showColumnOptions: true, + contextMenuSettings: { + showContextMenu: true, + contextMenuItems: ["add", "edit", "delete"] + }, + columnDialogFields: ["field", "headerText", "editType", "width", "visible", "allowSorting", "textAlign", "headerTextAlign"], + editSettings: { + allowAdding: true, + allowEditing: true, + allowDeleting: true, + editMode: "cellEditing", + rowPosition: "belowSelectedRow" + }, + toolbarSettings: { + showToolbar: true, + toolbarItems: ["add", "edit", "delete", "update", "cancel", "expandAll", "collapseAll"] + }, + columns: [ + { field: "taskID", headerText: "Task Id", allowFiltering: false, editType: "numericedit", filterEditType: "numericedit" }, + { field: "taskName", headerText: "Task Name", editType: "stringedit", filterEditType: "stringedit" }, + { field: "startDate", headerText: "Start Date", editType: "datepicker", filterEditType: "datepicker", format: "{0:MM/dd/yyyy}" }, + { field: "endDate", headerText: "End Date", editType: "datepicker", filterEditType: "datepicker", format: "{0:MM/dd/yyyy}" }, + { field: "progress", headerText: "Progress", editType: "numericedit", filterEditType: "numericedit" } + ], + isResponsive: true, + }); }); -}); -} +} @@ -3421,7 +3407,7 @@ module treemapcomponent { - + module TreeViewComponent { $(function () { @@ -3438,9 +3424,9 @@ module TreeViewComponent { module UploadboxComponent { - + $(function () { - var sample = new ej.Uploadbox($("#UploadDefault"),{ + var sample = new ej.Uploadbox($("#UploadDefault"), { saveUrl: (window).baseurl + "api/uploadbox/Save", removeUrl: (window).baseurl + "api/uploadbox/Remove", buttonText: { @@ -3463,12 +3449,12 @@ module UploadboxComponent { module WaitingPopupComponent { $(function () { - var sample = new ej.WaitingPopup($("#target"),{ + var sample = new ej.WaitingPopup($("#target"), { showOnInit: true, showImage: true, text: 'waiting…', - target: "#target", - appendTo: "#waiting" + target: "#target", + appendTo: "#waiting" }); }); From f58ed1701bf1744dd82eabb616bb5813c23d8e3d Mon Sep 17 00:00:00 2001 From: Louis Hache Date: Wed, 25 Apr 2018 20:52:41 +0200 Subject: [PATCH 0874/2153] [@types/grid-styled] Support AlignSelf property on Box (#25261) --- types/grid-styled/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/grid-styled/index.d.ts b/types/grid-styled/index.d.ts index 0006be1db8..af969b0cec 100644 --- a/types/grid-styled/index.d.ts +++ b/types/grid-styled/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for grid-styled 3.2 +// Type definitions for grid-styled 4.1 // Project: https://github.com/jxnblk/grid-styled // Definitions by: Anton Vasin // Victor Orlov +// Louis Hache // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -39,6 +40,7 @@ export interface BoxProps flex?: ResponsiveProp; order?: ResponsiveProp; is?: string | ComponentClass; + alignSelf?: ResponsiveProp; } export interface FlexProps extends BoxProps { From bfefeaadb9fe70b6010c0299fcc24cc87d5b3b48 Mon Sep 17 00:00:00 2001 From: Zev Spitz Date: Wed, 25 Apr 2018 21:53:53 +0300 Subject: [PATCH 0875/2153] activex-mshtml: default properties; fix for default argument values in jsdoc (#25293) * Fix activex-stdole * Reduce any * Default properties; fix jsDoc default values * Fix office tests * activex-office dtslint fix * activex-vbide: default properties; default values of optional parameters * activex-vbide: dtslint fixes * activex-msforms -- default properties; default parameter values in jsDoc * Reduce duplicate types * dtslint fix * activex-outlook version bump * activex-powerpoint Typescript version bump * activex-vbide Typescript version bump * post-DefinitelyTyped-build fixes * Fix Column and List setters * Fix for Excel tests * Default properties; fix default parameter values in jsDoc * Remove max-line-length --- types/activex-mshtml/index.d.ts | 2586 ++++++++++-------------------- types/activex-mshtml/tslint.json | 3 +- 2 files changed, 835 insertions(+), 1754 deletions(-) diff --git a/types/activex-mshtml/index.d.ts b/types/activex-mshtml/index.d.ts index 01c6007620..94466927d7 100644 --- a/types/activex-mshtml/index.d.ts +++ b/types/activex-mshtml/index.d.ts @@ -2885,11 +2885,10 @@ declare namespace MSHTML { update(): void; } - class BlockFormats { - private 'MSHTML.BlockFormats_typekey': BlockFormats; - private constructor(); + interface BlockFormats { readonly Count: number; item(pvarIndex: any): string; + (pvarIndex: any): string; } class CanvasGradient { @@ -2975,7 +2974,7 @@ declare namespace MSHTML { private 'MSHTML.CClientCaps_typekey': CClientCaps; private constructor(); - /** @param string [bStrVer=''] */ + /** @param bStrVer [bStrVer=''] */ addComponentRequest(bstrName: string, bstrURL: string, bStrVer?: string): void; readonly availHeight: number; readonly availWidth: number; @@ -2991,7 +2990,7 @@ declare namespace MSHTML { getComponentVersion(bstrName: string, bstrURL: string): string; readonly height: number; - /** @param string [bStrVer=''] */ + /** @param bStrVer [bStrVer=''] */ isComponentInstalled(bstrName: string, bstrURL: string, bStrVer?: string): boolean; readonly javaEnabled: boolean; readonly onLine: boolean; @@ -3025,7 +3024,7 @@ declare namespace MSHTML { readonly dataTransfer: IHTMLDataTransfer; fromElement: IHTMLElement; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; keyCode: number; readonly nextPage: string; @@ -3037,14 +3036,14 @@ declare namespace MSHTML { reason: number; recordset: any; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; repeat: boolean; returnValue: any; screenX: number; screenY: number; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; shiftKey: boolean; shiftLeft: boolean; @@ -3086,7 +3085,7 @@ declare namespace MSHTML { readonly 'constructor': any; readonly length: number; - /** @param boolean [reload=false] */ + /** @param reload [reload=false] */ refresh(reload?: boolean): void; } @@ -3230,13 +3229,12 @@ declare namespace MSHTML { readonly type: string; } - class DOMChildrenCollection { - private 'MSHTML.DOMChildrenCollection_typekey': DOMChildrenCollection; - private constructor(); + interface DOMChildrenCollection { readonly 'constructor': any; ie9_item(index: number): any; item(index: number): any; readonly length: number; + (index: number): any; } class DOMCloseEvent { @@ -3348,7 +3346,7 @@ declare namespace MSHTML { readonly publicId: any; removeChild(oldChild: IHTMLDOMNode): IHTMLDOMNode; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; replaceNode(replacement: IHTMLDOMNode): IHTMLDOMNode; @@ -3376,14 +3374,9 @@ declare namespace MSHTML { readonly eventPhase: number; readonly fromElement: IHTMLElement; getModifierState(keyArg: string): boolean; - initDragEvent( - eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, - clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, - relatedTargetArg: IEventTarget, dataTransferArg: IHTMLDataTransfer): void; + initDragEvent(eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: IEventTarget, dataTransferArg: IHTMLDataTransfer): void; initEvent(eventType: string, canBubble: boolean, cancelable: boolean): void; - initMouseEvent( - eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, - clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: IEventTarget): void; + initMouseEvent(eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: IEventTarget): void; initUIEvent(eventType: string, canBubble: boolean, cancelable: boolean, view: IHTMLWindow2, detail: number): void; readonly isTrusted: boolean; readonly layerX: number; @@ -3479,8 +3472,7 @@ declare namespace MSHTML { getModifierState(keyArg: string): boolean; readonly ie9_char: any; initEvent(eventType: string, canBubble: boolean, cancelable: boolean): void; - initKeyboardEvent( - eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; + initKeyboardEvent(eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; initUIEvent(eventType: string, canBubble: boolean, cancelable: boolean, view: IHTMLWindow2, detail: number): void; readonly isTrusted: boolean; readonly key: string; @@ -3544,9 +3536,7 @@ declare namespace MSHTML { readonly fromElement: IHTMLElement; getModifierState(keyArg: string): boolean; initEvent(eventType: string, canBubble: boolean, cancelable: boolean): void; - initMouseEvent( - eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, - clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: IEventTarget): void; + initMouseEvent(eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: IEventTarget): void; initUIEvent(eventType: string, canBubble: boolean, cancelable: boolean, view: IHTMLWindow2, detail: number): void; readonly isTrusted: boolean; readonly layerX: number; @@ -3593,12 +3583,8 @@ declare namespace MSHTML { readonly fromElement: IHTMLElement; getModifierState(keyArg: string): boolean; initEvent(eventType: string, canBubble: boolean, cancelable: boolean): void; - initMouseEvent( - eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, - clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: IEventTarget): void; - initMouseWheelEvent( - eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, - clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: IEventTarget, modifiersListArg: string, wheelDeltaArg: number): void; + initMouseEvent(eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: IEventTarget): void; + initMouseWheelEvent(eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: IEventTarget, modifiersListArg: string, wheelDeltaArg: number): void; initUIEvent(eventType: string, canBubble: boolean, cancelable: boolean, view: IHTMLWindow2, detail: number): void; readonly isTrusted: boolean; readonly layerX: number; @@ -3711,8 +3697,7 @@ declare namespace MSHTML { readonly defaultPrevented: boolean; readonly eventPhase: number; initEvent(eventType: string, canBubble: boolean, cancelable: boolean): void; - initMutationEvent( - eventType: string, canBubble: boolean, cancelable: boolean, relatedNodeArg: any, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; + initMutationEvent(eventType: string, canBubble: boolean, cancelable: boolean, relatedNodeArg: any, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; readonly isTrusted: boolean; readonly newValue: string; preventDefault(): void; @@ -3732,10 +3717,9 @@ declare namespace MSHTML { parseFromString(xmlSource: string, mimeType: string): IHTMLDocument2; } - class DOMParserFactory { - private 'MSHTML.DOMParserFactory_typekey': DOMParserFactory; - private constructor(); + interface DOMParserFactory { create(): IDOMParser; + (): IDOMParser; } class DOMProcessingInstruction { @@ -3773,7 +3757,7 @@ declare namespace MSHTML { readonly previousSibling: IHTMLDOMNode; removeChild(oldChild: IHTMLDOMNode): IHTMLDOMNode; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; replaceNode(replacement: IHTMLDOMNode): IHTMLDOMNode; @@ -3838,8 +3822,7 @@ declare namespace MSHTML { readonly defaultPrevented: boolean; readonly eventPhase: number; initEvent(eventType: string, canBubble: boolean, cancelable: boolean): void; - initStorageEvent( - eventType: string, canBubble: boolean, cancelable: boolean, keyArg: string, oldValueArg: string, newValueArg: string, urlArg: string, storageAreaArg: IHTMLStorage): void; + initStorageEvent(eventType: string, canBubble: boolean, cancelable: boolean, keyArg: string, oldValueArg: string, newValueArg: string, urlArg: string, storageAreaArg: IHTMLStorage): void; readonly isTrusted: boolean; readonly key: string; readonly newValue: string; @@ -3928,14 +3911,9 @@ declare namespace MSHTML { readonly fromElement: IHTMLElement; getModifierState(keyArg: string): boolean; initEvent(eventType: string, canBubble: boolean, cancelable: boolean): void; - initMouseEvent( - eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, - clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: IEventTarget): void; + initMouseEvent(eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: IEventTarget): void; initUIEvent(eventType: string, canBubble: boolean, cancelable: boolean, view: IHTMLWindow2, detail: number): void; - initWheelEvent( - eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, - clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: IEventTarget, modifiersListArg: string, deltaX: number, deltaY: number, - deltaZ: number, deltaMode: number): void; + initWheelEvent(eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: IEventTarget, modifiersListArg: string, deltaX: number, deltaY: number, deltaZ: number, deltaMode: number): void; readonly isTrusted: boolean; readonly layerX: number; readonly layerY: number; @@ -3967,25 +3945,22 @@ declare namespace MSHTML { private constructor(); } - class FontNames { - private 'MSHTML.FontNames_typekey': FontNames; - private constructor(); + interface FontNames { readonly Count: number; item(pvarIndex: any): string; + (pvarIndex: any): string; } - class FramesCollection { - private 'MSHTML.FramesCollection_typekey': FramesCollection; - private constructor(); + interface FramesCollection { item(pvarIndex: any): any; readonly length: number; + (pvarIndex: any): any; } - class HTCAttachBehavior { - private 'MSHTML.HTCAttachBehavior_typekey': HTCAttachBehavior; - private constructor(); + interface HTCAttachBehavior { detachEvent(): void; FireEvent(evt: any): void; + (evt: any): void; } class HTCDefaultDispatch { @@ -4098,7 +4073,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -4317,7 +4292,7 @@ declare namespace MSHTML { rel: string; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -4326,7 +4301,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -4343,16 +4318,16 @@ declare namespace MSHTML { search: string; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; shape: string; readonly sourceIndex: number; @@ -4468,7 +4443,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -4666,7 +4641,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -4675,7 +4650,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -4691,16 +4666,16 @@ declare namespace MSHTML { search: string; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; shape: string; readonly sourceIndex: number; @@ -4718,9 +4693,7 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLAreasCollection { - private 'MSHTML.HTMLAreasCollection_typekey': HTMLAreasCollection; - private constructor(); + interface HTMLAreasCollection { add(element: IHTMLElement, before?: any): void; readonly 'constructor': any; ie8_item(index: number): IHTMLElement2; @@ -4730,15 +4703,14 @@ declare namespace MSHTML { length: number; namedItem(name: string): any; - /** @param number [index=-1] */ + /** @param index [index=-1] */ remove(index?: number): void; tags(tagName: any): any; urns(urn: any): any; + (name?: any, index?: any): any; } - class HTMLAttributeCollection { - private 'MSHTML.HTMLAttributeCollection_typekey': HTMLAttributeCollection; - private constructor(); + interface HTMLAttributeCollection { readonly 'constructor': any; getNamedItem(bstrName: string): IHTMLDOMAttribute; getNamedItemNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -4758,6 +4730,7 @@ declare namespace MSHTML { removeNamedItemNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; setNamedItem(ppNode: IHTMLDOMAttribute): IHTMLDOMAttribute; setNamedItemNS(pNodeIn: IHTMLDOMAttribute2): IHTMLDOMAttribute2; + (name?: any): any; } class HTMLAudioElement { @@ -4848,7 +4821,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -5065,7 +5038,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -5074,7 +5047,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -5091,16 +5064,16 @@ declare namespace MSHTML { readonly seeking: boolean; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -5120,10 +5093,9 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLAudioElementFactory { - private 'MSHTML.HTMLAudioElementFactory_typekey': HTMLAudioElementFactory; - private constructor(); + interface HTMLAudioElementFactory { create(src?: any): IHTMLAudioElement; + (src?: any): IHTMLAudioElement; } class HTMLBaseElement { @@ -5196,7 +5168,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -5385,7 +5357,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -5394,7 +5366,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -5409,16 +5381,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -5507,7 +5479,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -5694,7 +5666,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -5703,7 +5675,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -5718,16 +5690,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; size: number; readonly sourceIndex: number; @@ -5815,7 +5787,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -6003,7 +5975,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -6012,7 +5984,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -6027,16 +5999,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -6126,7 +6098,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -6314,7 +6286,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -6323,7 +6295,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -6338,16 +6310,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -6440,7 +6412,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -6641,7 +6613,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -6650,7 +6622,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -6667,16 +6639,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -6766,7 +6738,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -6953,7 +6925,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -6962,7 +6934,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -6977,16 +6949,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -7078,7 +7050,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -7282,7 +7254,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -7291,7 +7263,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -7306,16 +7278,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -7405,7 +7377,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -7594,7 +7566,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -7603,7 +7575,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -7618,16 +7590,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -7719,7 +7691,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -7912,7 +7884,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -7921,7 +7893,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -7937,16 +7909,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -7992,10 +7964,10 @@ declare namespace MSHTML { readonly cssRules: IHTMLStyleSheetRulesCollection; cssText: string; - /** @param number [lIndex=-1] */ + /** @param lIndex [lIndex=-1] */ deleteRule(lIndex?: number): void; - /** @param number [lIndex=-1] */ + /** @param lIndex [lIndex=-1] */ insertRule(bstrRule: string, lIndex?: number): number; media: any; readonly parentRule: IHTMLCSSRule; @@ -8023,9 +7995,7 @@ declare namespace MSHTML { readonly type: number; } - class HTMLCSSStyleDeclaration { - private 'MSHTML.HTMLCSSStyleDeclaration_typekey': HTMLCSSStyleDeclaration; - private constructor(); + interface HTMLCSSStyleDeclaration { accelerator: string; alignContent: string; alignItems: string; @@ -8306,7 +8276,7 @@ declare namespace MSHTML { scrollbarShadowColor: any; scrollbarTrackColor: any; - /** @param any [pvarPropertyPriority=''] */ + /** @param pvarPropertyPriority [pvarPropertyPriority=''] */ setProperty(bstrPropertyName: string, pvarPropertyValue: any, pvarPropertyPriority?: any): void; stopColor: any; stopOpacity: any; @@ -8400,11 +8370,10 @@ declare namespace MSHTML { writingMode: string; zIndex: any; zoom: any; + (index: number): string; } - class HTMLCurrentStyle { - private 'MSHTML.HTMLCurrentStyle_typekey': HTMLCurrentStyle; - private constructor(); + interface HTMLCurrentStyle { readonly accelerator: string; alignContent: string; alignItems: string; @@ -8496,7 +8465,7 @@ declare namespace MSHTML { readonly fontVariant: string; readonly fontWeight: any; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getPropertyPriority(bstrPropertyName: string): string; getPropertyValue(bstrPropertyName: string): string; @@ -8642,7 +8611,7 @@ declare namespace MSHTML { readonly scrollbarShadowColor: any; readonly scrollbarTrackColor: any; - /** @param any [pvarPropertyPriority=''] */ + /** @param pvarPropertyPriority [pvarPropertyPriority=''] */ setProperty(bstrPropertyName: string, pvarPropertyValue: any, pvarPropertyPriority?: any): void; readonly styleFloat: string; readonly tableLayout: string; @@ -8725,6 +8694,7 @@ declare namespace MSHTML { readonly writingMode: string; readonly zIndex: any; readonly zoom: any; + (index: number): string; } class HTMLDDElement { @@ -8797,7 +8767,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -8985,7 +8955,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -8994,7 +8964,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -9009,16 +8979,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -9140,7 +9110,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -9343,7 +9313,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -9352,7 +9322,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -9367,16 +9337,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -9468,7 +9438,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -9670,7 +9640,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -9679,7 +9649,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -9694,16 +9664,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -9800,7 +9770,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -9987,7 +9957,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -9996,7 +9966,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -10011,16 +9981,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -10078,8 +10048,8 @@ declare namespace MSHTML { createRenderStyle(v: string): IHTMLRenderStyle; /** - * @param string [bstrHref=''] - * @param number [lIndex=-1] + * @param bstrHref [bstrHref=''] + * @param lIndex [lIndex=-1] */ createStyleSheet(bstrHref?: string, lIndex?: number): IHTMLStyleSheet; createTextNode(text: string): IHTMLDOMNode; @@ -10099,7 +10069,7 @@ declare namespace MSHTML { elementsFromRect(left: number, top: number, width: number, height: number): IHTMLDOMChildrenCollection; readonly embeds: IHTMLElementCollection; - /** @param boolean [showUI=false] */ + /** @param showUI [showUI=false] */ execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; execCommandShowHelp(cmdID: string): boolean; expando: boolean; @@ -10257,7 +10227,7 @@ declare namespace MSHTML { onvolumechange: any; onwaiting: any; - /** @param string [url='text/html'] */ + /** @param url [url='text/html'] */ open(url?: string, name?: any, features?: any, replace?: any): any; readonly ownerDocument: any; readonly parentNode: IHTMLDOMNode; @@ -10276,14 +10246,14 @@ declare namespace MSHTML { querySelectorAll(v: string): IHTMLDOMChildrenCollection; readonly readyState: string; - /** @param boolean [fForce=false] */ + /** @param fForce [fForce=false] */ recalc(fForce?: boolean): void; readonly referrer: string; releaseCapture(): void; removeChild(oldChild: IHTMLDOMNode): IHTMLDOMNode; removeEventListener(type: string, listener: any, useCapture: boolean): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; replaceNode(replacement: IHTMLDOMNode): IHTMLDOMNode; @@ -10470,7 +10440,7 @@ declare namespace MSHTML { removeChild(oldChild: IHTMLDOMNode): IHTMLDOMNode; removeEventListener(type: string, listener: any, useCapture: boolean): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; replaceData(offset: number, Count: number, bstrstring: string): void; @@ -10484,10 +10454,9 @@ declare namespace MSHTML { readonly wholeText: string; } - class HTMLDOMXmlSerializerFactory { - private 'MSHTML.HTMLDOMXmlSerializerFactory_typekey': HTMLDOMXmlSerializerFactory; - private constructor(); + interface HTMLDOMXmlSerializerFactory { create(): IDOMXmlSerializer; + (): IDOMXmlSerializer; } class HTMLDTElement { @@ -10560,7 +10529,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -10748,7 +10717,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -10757,7 +10726,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -10772,16 +10741,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -10797,9 +10766,7 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLElementCollection { - private 'MSHTML.HTMLElementCollection_typekey': HTMLElementCollection; - private constructor(); + interface HTMLElementCollection { readonly 'constructor': any; ie8_item(index: number): IHTMLElement2; readonly ie8_length: number; @@ -10810,6 +10777,7 @@ declare namespace MSHTML { tags(tagName: any): any; toString(): string; urns(urn: any): any; + (name?: any, index?: any): any; } class HTMLEmbed { @@ -10882,7 +10850,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -11077,7 +11045,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -11086,7 +11054,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -11101,16 +11069,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -11201,7 +11169,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -11388,7 +11356,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -11397,7 +11365,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -11412,16 +11380,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -11509,7 +11477,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -11696,7 +11664,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -11705,7 +11673,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -11720,16 +11688,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; size: any; readonly sourceIndex: number; @@ -11746,9 +11714,7 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLFormElement { - private 'MSHTML.HTMLFormElement_typekey': HTMLFormElement; - private constructor(); + interface HTMLFormElement { acceptCharset: string; accessKey: string; action: string; @@ -11759,14 +11725,14 @@ declare namespace MSHTML { appendItemSeparator(): void; /** - * @param string [name=''] - * @param string [filename=''] + * @param name [name=''] + * @param filename [filename=''] */ appendNameFilePair(name?: string, filename?: string): void; /** - * @param string [name=''] - * @param string [value=''] + * @param name [name=''] + * @param value [value=''] */ appendNameValuePair(name?: string, value?: string): void; applyElement(apply: IHTMLElement, where: string): IHTMLElement; @@ -11833,7 +11799,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -12026,7 +11992,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -12035,7 +12001,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -12051,16 +12017,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -12078,6 +12044,7 @@ declare namespace MSHTML { readonly uniqueNumber: number; urns(urn: any): any; xmsAcceleratorKey: string; + (name?: any, index?: any): any; } class HTMLFrameBase { @@ -12155,7 +12122,7 @@ declare namespace MSHTML { frameSpacing: any; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -12347,7 +12314,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -12356,7 +12323,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -12372,16 +12339,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -12479,7 +12446,7 @@ declare namespace MSHTML { frameSpacing: any; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -12691,7 +12658,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -12700,7 +12667,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -12716,16 +12683,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -12819,7 +12786,7 @@ declare namespace MSHTML { frameSpacing: any; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -13016,7 +12983,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -13025,7 +12992,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -13041,16 +13008,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -13136,7 +13103,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -13325,7 +13292,7 @@ declare namespace MSHTML { readonly recordset: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -13334,7 +13301,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -13349,16 +13316,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -13444,7 +13411,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -13633,7 +13600,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -13642,7 +13609,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -13657,16 +13624,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -13754,7 +13721,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -13941,7 +13908,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -13950,7 +13917,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -13965,16 +13932,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -14072,7 +14039,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -14260,7 +14227,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -14269,7 +14236,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -14284,16 +14251,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; size: any; readonly sourceIndex: number; @@ -14381,7 +14348,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -14568,7 +14535,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -14577,7 +14544,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -14592,16 +14559,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -14699,7 +14666,7 @@ declare namespace MSHTML { frameSpacing: any; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -14912,7 +14879,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -14921,7 +14888,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -14937,16 +14904,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -14966,10 +14933,9 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLImageElementFactory { - private 'MSHTML.HTMLImageElementFactory_typekey': HTMLImageElementFactory; - private constructor(); + interface HTMLImageElementFactory { create(width?: any, height?: any): IHTMLImgElement; + (width?: any, height?: any): IHTMLImgElement; } class HTMLImg { @@ -15055,7 +15021,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -15276,7 +15242,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -15285,7 +15251,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -15300,16 +15266,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -15354,7 +15320,7 @@ declare namespace MSHTML { focus(): void; readonly form: IHTMLFormElement; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; id: string; innerHTML: string; @@ -15401,12 +15367,12 @@ declare namespace MSHTML { readonly parentTextEdit: IHTMLElement; readonly recordNumber: any; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeFilter(pUnk: any): void; scrollIntoView(varargStart?: any): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; readonly sourceIndex: number; status: any; @@ -15504,7 +15470,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -15720,7 +15686,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -15729,7 +15695,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -15747,16 +15713,16 @@ declare namespace MSHTML { selectionStart: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; setSelectionRange(start: number, end: number): void; size: number; @@ -15767,10 +15733,10 @@ declare namespace MSHTML { status: boolean; step: string; - /** @param number [n=1] */ + /** @param n [n=1] */ stepDown(n?: number): void; - /** @param number [n=1] */ + /** @param n [n=1] */ stepUp(n?: number): void; readonly style: IHTMLStyle; swapNode(otherNode: IHTMLDOMNode): IHTMLDOMNode; @@ -15813,7 +15779,7 @@ declare namespace MSHTML { focus(): void; readonly form: IHTMLFormElement; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; id: string; innerHTML: string; @@ -15863,13 +15829,13 @@ declare namespace MSHTML { readonly parentTextEdit: IHTMLElement; readonly recordNumber: any; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeFilter(pUnk: any): void; scrollIntoView(varargStart?: any): void; select(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; size: number; readonly sourceIndex: number; @@ -15908,7 +15874,7 @@ declare namespace MSHTML { readonly filters: IHTMLFiltersCollection; focus(): void; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; height: number; hspace: number; @@ -15963,12 +15929,12 @@ declare namespace MSHTML { readonly readyState: string; readonly recordNumber: any; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeFilter(pUnk: any): void; scrollIntoView(varargStart?: any): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; readonly sourceIndex: number; src: string; @@ -16010,7 +15976,7 @@ declare namespace MSHTML { focus(): void; readonly form: IHTMLFormElement; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; id: string; innerHTML: string; @@ -16061,13 +16027,13 @@ declare namespace MSHTML { readOnly: boolean; readonly recordNumber: any; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeFilter(pUnk: any): void; scrollIntoView(varargStart?: any): void; select(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; size: number; readonly sourceIndex: number; @@ -16153,7 +16119,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -16341,7 +16307,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -16350,7 +16316,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -16365,16 +16331,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -16465,7 +16431,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -16668,7 +16634,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -16677,7 +16643,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -16692,16 +16658,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -16794,7 +16760,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -16996,7 +16962,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -17005,7 +16971,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -17020,16 +16986,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -17116,7 +17082,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -17303,7 +17269,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -17312,7 +17278,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -17327,16 +17293,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -17425,7 +17391,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -17617,7 +17583,7 @@ declare namespace MSHTML { rel: string; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -17626,7 +17592,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -17642,16 +17608,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sheet: IHTMLStyleSheet; readonly sourceIndex: number; @@ -17742,7 +17708,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -17929,7 +17895,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -17938,7 +17904,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -17953,16 +17919,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -17991,7 +17957,7 @@ declare namespace MSHTML { port: string; protocol: string; - /** @param boolean [flag=false] */ + /** @param flag [flag=false] */ reload(flag?: boolean): void; replace(bstr: string): void; search: string; @@ -18069,7 +18035,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -18257,7 +18223,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -18266,7 +18232,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -18281,16 +18247,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -18383,7 +18349,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -18591,7 +18557,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -18600,7 +18566,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -18617,16 +18583,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -18736,7 +18702,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -18953,7 +18919,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -18962,7 +18928,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -18979,16 +18945,16 @@ declare namespace MSHTML { readonly seeking: boolean; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -19086,7 +19052,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -19276,7 +19242,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -19285,7 +19251,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -19301,16 +19267,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -19366,13 +19332,12 @@ declare namespace MSHTML { readonly urn: string; } - class HTMLNamespaceCollection { - private 'MSHTML.HTMLNamespaceCollection_typekey': HTMLNamespaceCollection; - private constructor(); + interface HTMLNamespaceCollection { add(bstrNamespace: string, bstrUrn: string, implementationUrl?: any): any; readonly 'constructor': any; item(index: any): any; readonly length: number; + (index: any): any; } class HTMLNavigator { @@ -19473,7 +19438,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -19661,7 +19626,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -19670,7 +19635,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -19685,16 +19650,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -19780,7 +19745,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -19967,7 +19932,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -19976,7 +19941,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -19991,16 +19956,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -20104,7 +20069,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -20316,7 +20281,7 @@ declare namespace MSHTML { recordset: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -20325,7 +20290,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -20340,16 +20305,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -20442,7 +20407,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -20629,7 +20594,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -20638,7 +20603,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -20653,16 +20618,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -20706,7 +20671,7 @@ declare namespace MSHTML { focus(): void; readonly form: IHTMLFormElement; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; id: string; indeterminate: boolean; @@ -20755,12 +20720,12 @@ declare namespace MSHTML { readonly parentTextEdit: IHTMLElement; readonly recordNumber: any; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeFilter(pUnk: any): void; scrollIntoView(varargStart?: any): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; readonly sourceIndex: number; status: boolean; @@ -20849,7 +20814,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -21054,7 +21019,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -21063,7 +21028,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -21079,16 +21044,16 @@ declare namespace MSHTML { selected: boolean; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -21107,10 +21072,9 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLOptionElementFactory { - private 'MSHTML.HTMLOptionElementFactory_typekey': HTMLOptionElementFactory; - private constructor(); + interface HTMLOptionElementFactory { create(text?: any, value?: any, defaultSelected?: any, selected?: any): IHTMLOptionElement; + (text?: any, value?: any, defaultSelected?: any, selected?: any): IHTMLOptionElement; } class HTMLParaElement { @@ -21185,7 +21149,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -21372,7 +21336,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -21381,7 +21345,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -21396,16 +21360,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -21491,7 +21455,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -21680,7 +21644,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -21689,7 +21653,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -21704,16 +21668,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -21850,7 +21814,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -22038,7 +22002,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -22047,7 +22011,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -22062,16 +22026,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -22172,7 +22136,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -22376,7 +22340,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -22385,7 +22349,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -22400,16 +22364,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -22519,7 +22483,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -22723,7 +22687,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -22732,7 +22696,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -22749,16 +22713,16 @@ declare namespace MSHTML { select(): void; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -22779,9 +22743,7 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLRuleStyle { - private 'MSHTML.HTMLRuleStyle_typekey': HTMLRuleStyle; - private constructor(); + interface HTMLRuleStyle { accelerator: string; alignContent: string; alignItems: string; @@ -22881,7 +22843,7 @@ declare namespace MSHTML { fontVariant: string; fontWeight: string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getPropertyPriority(bstrPropertyName: string): string; getPropertyValue(bstrPropertyName: string): string; @@ -23021,7 +22983,7 @@ declare namespace MSHTML { posRight: number; quotes: string; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeProperty(bstrPropertyName: string): string; right: any; @@ -23037,10 +22999,10 @@ declare namespace MSHTML { scrollbarShadowColor: any; scrollbarTrackColor: any; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; - /** @param any [pvarPropertyPriority=''] */ + /** @param pvarPropertyPriority [pvarPropertyPriority=''] */ setProperty(bstrPropertyName: string, pvarPropertyValue: any, pvarPropertyPriority?: any): void; styleFloat: string; tableLayout: string; @@ -23128,6 +23090,7 @@ declare namespace MSHTML { writingMode: string; zIndex: any; zoom: any; + (index: number): string; } class HTMLScreen { @@ -23224,7 +23187,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -23413,7 +23376,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -23422,7 +23385,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -23437,16 +23400,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -23466,9 +23429,7 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLSelectElement { - private 'MSHTML.HTMLSelectElement_typekey': HTMLSelectElement; - private constructor(); + interface HTMLSelectElement { accessKey: string; add(element: IHTMLElement, before?: any): void; addBehavior(bstrURL: string, pvarFactory?: any): number; @@ -23542,7 +23503,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -23753,10 +23714,10 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [index=-1] */ + /** @param index [index=-1] */ remove(index?: number): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -23765,7 +23726,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -23781,16 +23742,16 @@ declare namespace MSHTML { selectedIndex: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; size: number; readonly sourceIndex: number; @@ -23810,6 +23771,7 @@ declare namespace MSHTML { urns(urn: any): any; value: string; xmsAcceleratorKey: string; + (name?: any, index?: any): any; } class HTMLSemanticElement { @@ -23882,7 +23844,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -24069,7 +24031,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -24078,7 +24040,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -24093,16 +24055,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -24192,7 +24154,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -24395,7 +24357,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -24404,7 +24366,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -24419,16 +24381,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -24521,7 +24483,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -24723,7 +24685,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -24732,7 +24694,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -24747,16 +24709,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -24848,7 +24810,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -25050,7 +25012,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -25059,7 +25021,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -25074,16 +25036,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -25114,9 +25076,7 @@ declare namespace MSHTML { setItem(bstrKey: string, bstrValue: string): void; } - class HTMLStyle { - private 'MSHTML.HTMLStyle_typekey': HTMLStyle; - private constructor(); + interface HTMLStyle { accelerator: string; alignContent: string; alignItems: string; @@ -25216,7 +25176,7 @@ declare namespace MSHTML { fontVariant: string; fontWeight: string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getExpression(propname: string): any; getPropertyPriority(bstrPropertyName: string): string; @@ -25365,7 +25325,7 @@ declare namespace MSHTML { posWidth: number; quotes: string; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeExpression(propname: string): boolean; removeProperty(bstrPropertyName: string): string; @@ -25382,13 +25342,13 @@ declare namespace MSHTML { scrollbarShadowColor: any; scrollbarTrackColor: any; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; - /** @param any [pvarPropertyPriority=''] */ + /** @param pvarPropertyPriority [pvarPropertyPriority=''] */ setProperty(bstrPropertyName: string, pvarPropertyValue: any, pvarPropertyPriority?: any): void; styleFloat: string; tableLayout: string; @@ -25477,6 +25437,7 @@ declare namespace MSHTML { writingMode: string; zIndex: any; zoom: any; + (index: number): string; } class HTMLStyleElement { @@ -25549,7 +25510,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -25737,7 +25698,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -25746,7 +25707,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -25761,16 +25722,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sheet: IHTMLStyleSheet; readonly sourceIndex: number; @@ -25811,19 +25772,19 @@ declare namespace MSHTML { private 'MSHTML.HTMLStyleSheet_typekey': HTMLStyleSheet; private constructor(); - /** @param number [lIndex=-1] */ + /** @param lIndex [lIndex=-1] */ addImport(bstrURL: string, lIndex?: number): number; - /** @param number [lIndex=-1] */ + /** @param lIndex [lIndex=-1] */ addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; - /** @param number [lIndex=-1] */ + /** @param lIndex [lIndex=-1] */ addRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; readonly 'constructor': any; readonly cssRules: IHTMLStyleSheetRulesCollection; cssText: string; - /** @param number [lIndex=-1] */ + /** @param lIndex [lIndex=-1] */ deleteRule(lIndex?: number): void; disabled: boolean; href: string; @@ -25835,7 +25796,7 @@ declare namespace MSHTML { readonly ie9_type: string; readonly imports: IHTMLStyleSheetsCollection; - /** @param number [lIndex=-1] */ + /** @param lIndex [lIndex=-1] */ insertRule(bstrRule: string, lIndex?: number): number; readonly isAlternate: boolean; readonly isPrefAlternate: boolean; @@ -25867,12 +25828,11 @@ declare namespace MSHTML { readonly type: number; } - class HTMLStyleSheetPagesCollection { - private 'MSHTML.HTMLStyleSheetPagesCollection_typekey': HTMLStyleSheetPagesCollection; - private constructor(); + interface HTMLStyleSheetPagesCollection { readonly 'constructor': any; item(index: number): IHTMLStyleSheetPage; readonly length: number; + (index: number): IHTMLStyleSheetPage; } class HTMLStyleSheetRule { @@ -25890,33 +25850,30 @@ declare namespace MSHTML { readonly type: number; } - class HTMLStyleSheetRulesAppliedCollection { - private 'MSHTML.HTMLStyleSheetRulesAppliedCollection_typekey': HTMLStyleSheetRulesAppliedCollection; - private constructor(); + interface HTMLStyleSheetRulesAppliedCollection { item(index: number): IHTMLStyleSheetRule; readonly length: number; propertyAppliedBy(name: string): IHTMLStyleSheetRule; propertyAppliedTrace(name: string, index: number): IHTMLStyleSheetRule; propertyAppliedTraceLength(name: string): number; + (index: number): IHTMLStyleSheetRule; } - class HTMLStyleSheetRulesCollection { - private 'MSHTML.HTMLStyleSheetRulesCollection_typekey': HTMLStyleSheetRulesCollection; - private constructor(); + interface HTMLStyleSheetRulesCollection { readonly 'constructor': any; ie9_item(index: number): IHTMLCSSRule; readonly ie9_length: number; item(index: number): IHTMLStyleSheetRule; readonly length: number; + (index: number): IHTMLStyleSheetRule; } - class HTMLStyleSheetsCollection { - private 'MSHTML.HTMLStyleSheetsCollection_typekey': HTMLStyleSheetsCollection; - private constructor(); + interface HTMLStyleSheetsCollection { readonly 'constructor': any; ie9_item(index: number): any; item(pvarIndex: any): any; readonly length: number; + (pvarIndex: any): any; } class HTMLTable { @@ -26000,7 +25957,7 @@ declare namespace MSHTML { dataSrc: string; deleteCaption(): void; - /** @param number [index=-1] */ + /** @param index [index=-1] */ deleteRow(index?: number): void; deleteTFoot(): void; deleteTHead(): void; @@ -26018,7 +25975,7 @@ declare namespace MSHTML { frame: string; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -26046,7 +26003,7 @@ declare namespace MSHTML { ie9_appendChild(newChild: IHTMLDOMNode): IHTMLDOMNode; ie9_caption: IHTMLTableCaption; - /** @param number [index=-1] */ + /** @param index [index=-1] */ ie9_deleteRow(index?: number): void; ie9_getAttribute(strAttributeName: string): any; ie9_getAttributeNode(strAttributeName: string): IHTMLDOMAttribute2; @@ -26054,7 +26011,7 @@ declare namespace MSHTML { ie9_hasAttributes(): boolean; ie9_insertBefore(newChild: IHTMLDOMNode, refChild?: any): IHTMLDOMNode; - /** @param number [index=-1] */ + /** @param index [index=-1] */ ie9_insertRow(index?: number): any; readonly ie9_nodeName: string; ie9_removeAttribute(strAttributeName: string): void; @@ -26073,7 +26030,7 @@ declare namespace MSHTML { insertAdjacentText(where: string, text: string): void; insertBefore(newChild: IHTMLDOMNode, refChild?: any): IHTMLDOMNode; - /** @param number [index=-1] */ + /** @param index [index=-1] */ insertRow(index?: number): any; readonly isContentEditable: boolean; isDefaultNamespace(pvarNamespace: any): boolean; @@ -26093,8 +26050,8 @@ declare namespace MSHTML { mergeAttributes(mergeThis: IHTMLElement, pvarFlags?: any): void; /** - * @param number [indexFrom=-1] - * @param number [indexTo=-1] + * @param indexFrom [indexFrom=-1] + * @param indexTo [indexTo=-1] */ moveRow(indexFrom?: number, indexTo?: number): any; msMatchesSelector(v: string): boolean; @@ -26243,7 +26200,7 @@ declare namespace MSHTML { refresh(): void; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -26252,7 +26209,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -26269,16 +26226,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -26371,7 +26328,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -26558,7 +26515,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -26567,7 +26524,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -26582,16 +26539,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -26690,7 +26647,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -26882,7 +26839,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -26891,7 +26848,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -26908,16 +26865,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -27008,7 +26965,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -27197,7 +27154,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -27206,7 +27163,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -27221,16 +27178,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; span: number; @@ -27316,7 +27273,7 @@ declare namespace MSHTML { createControlRange(): any; readonly currentStyle: IHTMLCurrentStyle; - /** @param number [index=-1] */ + /** @param index [index=-1] */ deleteCell(index?: number): void; detachEvent(event: string, pdisp: any): void; dir: string; @@ -27330,7 +27287,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -27358,14 +27315,14 @@ declare namespace MSHTML { ie9_ch: string; ie9_chOff: string; - /** @param number [index=-1] */ + /** @param index [index=-1] */ ie9_deleteCell(index?: number): void; ie9_getAttribute(strAttributeName: string): any; ie9_getAttributeNode(strAttributeName: string): IHTMLDOMAttribute2; ie9_hasAttribute(name: string): boolean; ie9_hasAttributes(): boolean; - /** @param number [index=-1] */ + /** @param index [index=-1] */ ie9_insertCell(index?: number): any; readonly ie9_nodeName: string; ie9_removeAttribute(strAttributeName: string): void; @@ -27380,7 +27337,7 @@ declare namespace MSHTML { insertAdjacentText(where: string, text: string): void; insertBefore(newChild: IHTMLDOMNode, refChild?: any): IHTMLDOMNode; - /** @param number [index=-1] */ + /** @param index [index=-1] */ insertCell(index?: number): any; readonly isContentEditable: boolean; readonly isDisabled: boolean; @@ -27529,7 +27486,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -27538,7 +27495,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -27555,16 +27512,16 @@ declare namespace MSHTML { readonly sectionRowIndex: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -27644,7 +27601,7 @@ declare namespace MSHTML { createControlRange(): any; readonly currentStyle: IHTMLCurrentStyle; - /** @param number [index=-1] */ + /** @param index [index=-1] */ deleteRow(index?: number): void; detachEvent(event: string, pdisp: any): void; dir: string; @@ -27658,7 +27615,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -27685,14 +27642,14 @@ declare namespace MSHTML { ie9_ch: string; ie9_chOff: string; - /** @param number [index=-1] */ + /** @param index [index=-1] */ ie9_deleteRow(index?: number): void; ie9_getAttribute(strAttributeName: string): any; ie9_getAttributeNode(strAttributeName: string): IHTMLDOMAttribute2; ie9_hasAttribute(name: string): boolean; ie9_hasAttributes(): boolean; - /** @param number [index=-1] */ + /** @param index [index=-1] */ ie9_insertRow(index?: number): any; readonly ie9_nodeName: string; ie9_removeAttribute(strAttributeName: string): void; @@ -27707,7 +27664,7 @@ declare namespace MSHTML { insertAdjacentText(where: string, text: string): void; insertBefore(newChild: IHTMLDOMNode, refChild?: any): IHTMLDOMNode; - /** @param number [index=-1] */ + /** @param index [index=-1] */ insertRow(index?: number): any; readonly isContentEditable: boolean; readonly isDisabled: boolean; @@ -27719,8 +27676,8 @@ declare namespace MSHTML { mergeAttributes(mergeThis: IHTMLElement, pvarFlags?: any): void; /** - * @param number [indexFrom=-1] - * @param number [indexTo=-1] + * @param indexFrom [indexFrom=-1] + * @param indexTo [indexTo=-1] */ moveRow(indexFrom?: number, indexTo?: number): any; msMatchesSelector(v: string): boolean; @@ -27862,7 +27819,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -27871,7 +27828,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -27887,16 +27844,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -27991,7 +27948,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -28195,7 +28152,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -28204,7 +28161,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -28223,16 +28180,16 @@ declare namespace MSHTML { selectionStart: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; setSelectionRange(start: number, end: number): void; readonly sourceIndex: number; @@ -28324,7 +28281,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -28511,7 +28468,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -28520,7 +28477,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -28535,16 +28492,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -28640,7 +28597,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -28827,7 +28784,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -28836,7 +28793,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -28851,16 +28808,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -28948,7 +28905,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -29135,7 +29092,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -29144,7 +29101,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -29159,16 +29116,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -29255,7 +29212,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -29442,7 +29399,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -29451,7 +29408,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -29466,16 +29423,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -29491,12 +29448,11 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLUrnCollection { - private 'MSHTML.HTMLUrnCollection_typekey': HTMLUrnCollection; - private constructor(); + interface HTMLUrnCollection { readonly 'constructor': any; item(index: number): string; readonly length: number; + (index: number): string; } class HTMLVideoElement { @@ -29587,7 +29543,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -29806,7 +29762,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -29815,7 +29771,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -29832,16 +29788,16 @@ declare namespace MSHTML { readonly seeking: boolean; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -29864,9 +29820,7 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLW3CComputedStyle { - private 'MSHTML.HTMLW3CComputedStyle_typekey': HTMLW3CComputedStyle; - private constructor(); + interface HTMLW3CComputedStyle { accelerator: string; alignContent: string; alignItems: string; @@ -30145,7 +30099,7 @@ declare namespace MSHTML { scrollbarShadowColor: any; scrollbarTrackColor: any; - /** @param any [pvarPropertyPriority=''] */ + /** @param pvarPropertyPriority [pvarPropertyPriority=''] */ setProperty(bstrPropertyName: string, pvarPropertyValue: any, pvarPropertyPriority?: any): void; stopColor: any; stopOpacity: any; @@ -30239,14 +30193,13 @@ declare namespace MSHTML { writingMode: string; zIndex: any; zoom: any; + (index: number): string; } - class HTMLWindow2 { - private 'MSHTML.HTMLWindow2_typekey': HTMLWindow2; - private constructor(); + interface HTMLWindow2 { addEventListener(type: string, listener: any, useCapture: boolean): void; - /** @param string [message=''] */ + /** @param message [message=''] */ alert(message?: string): void; readonly applicationCache: applicationCache; attachEvent(event: string, pdisp: any): boolean; @@ -30258,7 +30211,7 @@ declare namespace MSHTML { close(): void; readonly closed: boolean; - /** @param string [message=''] */ + /** @param message [message=''] */ confirm(message?: string): boolean; readonly 'constructor': any; createPopup(varArgIn?: any): any; @@ -30268,14 +30221,14 @@ declare namespace MSHTML { readonly document: IHTMLDocument2; readonly event: IHTMLEventObj; - /** @param string [language='JScript'] */ + /** @param language [language='JScript'] */ execScript(code: string, language?: string): any; readonly external: any; focus(): void; readonly frameElement: IHTMLFrameBase; readonly frames: FramesCollection; - /** @param string [bstrPseudoElt=''] */ + /** @param bstrPseudoElt [bstrPseudoElt=''] */ getComputedStyle(varArgIn: IHTMLDOMNode, bstrPseudoElt?: string): IHTMLCSSStyleDeclaration; getSelection(): IHTMLSelection; readonly history: IOmHistory; @@ -30376,10 +30329,10 @@ declare namespace MSHTML { onwaiting: any; /** - * @param string [url=''] - * @param string [name=''] - * @param string [features=''] - * @param boolean [replace=false] + * @param url [url=''] + * @param name [name=''] + * @param features [features=''] + * @param replace [replace=false] */ open(url?: string, name?: string, features?: string, replace?: boolean): IHTMLWindow2; opener: any; @@ -30393,8 +30346,8 @@ declare namespace MSHTML { print(): void; /** - * @param string [message=''] - * @param string [defstr='undefined'] + * @param message [message=''] + * @param defstr [defstr='undefined'] */ prompt(message?: string, defstr?: string): any; removeEventListener(type: string, listener: any, useCapture: boolean): void; @@ -30413,11 +30366,11 @@ declare namespace MSHTML { setInterval(expression: any, msec: number, language?: any): number; setTimeout(expression: any, msec: number, language?: any): number; - /** @param string [features=''] */ + /** @param features [features=''] */ showHelp(helpURL: string, helpArg: any, features?: string): void; showModalDialog(dialog: string, varArgIn?: any, varOptions?: any): any; - /** @param string [url=''] */ + /** @param url [url=''] */ showModelessDialog(url?: string, varArgIn?: any, options?: any): IHTMLWindow2; status: string; readonly styleMedia: IHTMLStyleMedia; @@ -30425,14 +30378,13 @@ declare namespace MSHTML { toStaticHTML(bstrHTML: string): string; toString(): string; readonly window: IHTMLWindow2; + (pvarIndex: any): any; } - class HTMLWindowProxy { - private 'MSHTML.HTMLWindowProxy_typekey': HTMLWindowProxy; - private constructor(); + interface HTMLWindowProxy { addEventListener(type: string, listener: any, useCapture: boolean): void; - /** @param string [message=''] */ + /** @param message [message=''] */ alert(message?: string): void; readonly applicationCache: applicationCache; attachEvent(event: string, pdisp: any): boolean; @@ -30444,7 +30396,7 @@ declare namespace MSHTML { close(): void; readonly closed: boolean; - /** @param string [message=''] */ + /** @param message [message=''] */ confirm(message?: string): boolean; readonly 'constructor': any; createPopup(varArgIn?: any): any; @@ -30454,14 +30406,14 @@ declare namespace MSHTML { readonly document: IHTMLDocument2; readonly event: IHTMLEventObj; - /** @param string [language='JScript'] */ + /** @param language [language='JScript'] */ execScript(code: string, language?: string): any; readonly external: any; focus(): void; readonly frameElement: IHTMLFrameBase; readonly frames: FramesCollection; - /** @param string [bstrPseudoElt=''] */ + /** @param bstrPseudoElt [bstrPseudoElt=''] */ getComputedStyle(varArgIn: IHTMLDOMNode, bstrPseudoElt?: string): IHTMLCSSStyleDeclaration; getSelection(): IHTMLSelection; readonly history: IOmHistory; @@ -30562,10 +30514,10 @@ declare namespace MSHTML { onwaiting: any; /** - * @param string [url=''] - * @param string [name=''] - * @param string [features=''] - * @param boolean [replace=false] + * @param url [url=''] + * @param name [name=''] + * @param features [features=''] + * @param replace [replace=false] */ open(url?: string, name?: string, features?: string, replace?: boolean): IHTMLWindow2; opener: any; @@ -30579,8 +30531,8 @@ declare namespace MSHTML { print(): void; /** - * @param string [message=''] - * @param string [defstr='undefined'] + * @param message [message=''] + * @param defstr [defstr='undefined'] */ prompt(message?: string, defstr?: string): any; removeEventListener(type: string, listener: any, useCapture: boolean): void; @@ -30599,11 +30551,11 @@ declare namespace MSHTML { setInterval(expression: any, msec: number, language?: any): number; setTimeout(expression: any, msec: number, language?: any): number; - /** @param string [features=''] */ + /** @param features [features=''] */ showHelp(helpURL: string, helpArg: any, features?: string): void; showModalDialog(dialog: string, varArgIn?: any, varOptions?: any): any; - /** @param string [url=''] */ + /** @param url [url=''] */ showModelessDialog(url?: string, varArgIn?: any, options?: any): IHTMLWindow2; status: string; readonly styleMedia: IHTMLStyleMedia; @@ -30611,6 +30563,7 @@ declare namespace MSHTML { toStaticHTML(bstrHTML: string): string; toString(): string; readonly window: IHTMLWindow2; + (pvarIndex: any): any; } class HTMLWndOptionElement { @@ -30689,7 +30642,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -30893,7 +30846,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -30902,7 +30855,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -30918,16 +30871,16 @@ declare namespace MSHTML { selected: boolean; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -30946,9 +30899,7 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLWndSelectElement { - private 'MSHTML.HTMLWndSelectElement_typekey': HTMLWndSelectElement; - private constructor(); + interface HTMLWndSelectElement { accessKey: string; add(element: IHTMLElement, before?: any): void; addBehavior(bstrURL: string, pvarFactory?: any): number; @@ -31022,7 +30973,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -31230,10 +31181,10 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [index=-1] */ + /** @param index [index=-1] */ remove(index?: number): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -31242,7 +31193,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -31258,16 +31209,16 @@ declare namespace MSHTML { selectedIndex: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; size: number; readonly sourceIndex: number; @@ -31287,6 +31238,7 @@ declare namespace MSHTML { urns(urn: any): any; value: string; xmsAcceleratorKey: string; + (name?: any, index?: any): any; } class HTMLXMLHttpRequest { @@ -31313,10 +31265,9 @@ declare namespace MSHTML { timeout: number; } - class HTMLXMLHttpRequestFactory { - private 'MSHTML.HTMLXMLHttpRequestFactory_typekey': HTMLXMLHttpRequestFactory; - private constructor(); + interface HTMLXMLHttpRequestFactory { create(): IHTMLXMLHttpRequest; + (): IHTMLXMLHttpRequest; } class ICanvasGradient { @@ -31485,16 +31436,16 @@ declare namespace MSHTML { removeEventListener(type: string, listener: any, useCapture: boolean): void; } - class IHTMLAreasCollection { - private 'MSHTML.IHTMLAreasCollection_typekey': IHTMLAreasCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLAreasCollection { add(element: IHTMLElement, before?: any): void; item(name?: any, index?: any): any; length: number; - /** @param number [index=-1] */ + /** @param index [index=-1] */ remove(index?: number): void; tags(tagName: any): any; + (name?: any, index?: any): any; } class IHTMLAttributeCollection3 { @@ -31512,11 +31463,11 @@ declare namespace MSHTML { private constructor(); } - class IHTMLBookmarkCollection { - private 'MSHTML.IHTMLBookmarkCollection_typekey': IHTMLBookmarkCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLBookmarkCollection { item(index: number): any; readonly length: number; + (index: number): any; } class IHTMLCanvasElement { @@ -31537,9 +31488,8 @@ declare namespace MSHTML { readonly type: number; } - class IHTMLCSSStyleDeclaration { - private 'MSHTML.IHTMLCSSStyleDeclaration_typekey': IHTMLCSSStyleDeclaration; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLCSSStyleDeclaration { accelerator: string; alignmentBaseline: string; background: string; @@ -31693,7 +31643,7 @@ declare namespace MSHTML { scrollbarShadowColor: any; scrollbarTrackColor: any; - /** @param any [pvarPropertyPriority=''] */ + /** @param pvarPropertyPriority [pvarPropertyPriority=''] */ setProperty(bstrPropertyName: string, pvarPropertyValue: any, pvarPropertyPriority?: any): void; stopColor: any; stopOpacity: any; @@ -31733,6 +31683,7 @@ declare namespace MSHTML { writingMode: string; zIndex: any; zoom: any; + (index: number): string; } class IHTMLCurrentStyle { @@ -31779,7 +31730,7 @@ declare namespace MSHTML { readonly fontVariant: string; readonly fontWeight: any; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; readonly height: any; readonly imeMode: string; @@ -31866,8 +31817,8 @@ declare namespace MSHTML { createElement(eTag: string): IHTMLElement; /** - * @param string [bstrHref=''] - * @param number [lIndex=-1] + * @param bstrHref [bstrHref=''] + * @param lIndex [lIndex=-1] */ createStyleSheet(bstrHref?: string, lIndex?: number): IHTMLStyleSheet; defaultCharset: string; @@ -31876,7 +31827,7 @@ declare namespace MSHTML { elementFromPoint(x: number, y: number): IHTMLElement; readonly embeds: IHTMLElementCollection; - /** @param boolean [showUI=false] */ + /** @param showUI [showUI=false] */ execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; execCommandShowHelp(cmdID: string): boolean; expando: boolean; @@ -31914,7 +31865,7 @@ declare namespace MSHTML { onrowexit: any; onselectstart: any; - /** @param string [url='text/html'] */ + /** @param url [url='text/html'] */ open(url?: string, name?: any, features?: any, replace?: any): any; readonly parentWindow: IHTMLWindow2; readonly plugins: IHTMLElementCollection; @@ -32014,11 +31965,11 @@ declare namespace MSHTML { readonly version: string; } - class IHTMLDocumentCompatibleInfoCollection { - private 'MSHTML.IHTMLDocumentCompatibleInfoCollection_typekey': IHTMLDocumentCompatibleInfoCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLDocumentCompatibleInfoCollection { item(index: number): IHTMLDocumentCompatibleInfo; readonly length: number; + (index: number): IHTMLDocumentCompatibleInfo; } class IHTMLDOMAttribute { @@ -32052,11 +32003,11 @@ declare namespace MSHTML { value: string; } - class IHTMLDOMChildrenCollection { - private 'MSHTML.IHTMLDOMChildrenCollection_typekey': IHTMLDOMChildrenCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLDOMChildrenCollection { item(index: number): any; readonly length: number; + (index: number): any; } class IHTMLDOMImplementation { @@ -32084,7 +32035,7 @@ declare namespace MSHTML { readonly previousSibling: IHTMLDOMNode; removeChild(oldChild: IHTMLDOMNode): IHTMLDOMNode; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; replaceNode(replacement: IHTMLDOMNode): IHTMLDOMNode; @@ -32153,7 +32104,7 @@ declare namespace MSHTML { readonly document: any; readonly filters: IHTMLFiltersCollection; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; id: string; innerHTML: string; @@ -32196,11 +32147,11 @@ declare namespace MSHTML { readonly parentTextEdit: IHTMLElement; readonly recordNumber: any; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; scrollIntoView(varargStart?: any): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; readonly sourceIndex: number; readonly style: IHTMLStyle; @@ -32276,22 +32227,22 @@ declare namespace MSHTML { scrollTop: number; readonly scrollWidth: number; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; tabIndex: number; tagUrn: string; } - class IHTMLElementCollection { - private 'MSHTML.IHTMLElementCollection_typekey': IHTMLElementCollection; - private constructor(); - item(name?: string | number, index?: number): any; + // tslint:disable-next-line:interface-name + interface IHTMLElementCollection { + item(name?: any, index?: any): any; length: number; tags(tagName: any): any; toString(): string; + (name?: any, index?: any): any; } class IHTMLEventObj { @@ -32321,16 +32272,15 @@ declare namespace MSHTML { readonly y: number; } - class IHTMLFiltersCollection { - private 'MSHTML.IHTMLFiltersCollection_typekey': IHTMLFiltersCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLFiltersCollection { item(pvarIndex: any): any; readonly length: number; + (pvarIndex: any): any; } - class IHTMLFormElement { - private 'MSHTML.IHTMLFormElement_typekey': IHTMLFormElement; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLFormElement { action: string; dir: string; readonly elements: any; @@ -32345,6 +32295,7 @@ declare namespace MSHTML { submit(): void; tags(tagName: any): any; target: string; + (name?: any, index?: any): any; } class IHTMLFrameBase { @@ -32407,7 +32358,7 @@ declare namespace MSHTML { port: string; protocol: string; - /** @param boolean [flag=false] */ + /** @param flag [flag=false] */ reload(flag?: boolean): void; replace(bstr: string): void; search: string; @@ -32480,7 +32431,7 @@ declare namespace MSHTML { private constructor(); readonly length: number; - /** @param boolean [reload=false] */ + /** @param reload [reload=false] */ refresh(reload?: boolean): void; } @@ -32493,11 +32444,11 @@ declare namespace MSHTML { top: number; } - class IHTMLRectCollection { - private 'MSHTML.IHTMLRectCollection_typekey': IHTMLRectCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLRectCollection { item(pvarIndex: any): any; readonly length: number; + (pvarIndex: any): any; } class IHTMLRenderStyle { @@ -32559,7 +32510,7 @@ declare namespace MSHTML { fontVariant: string; fontWeight: string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; height: any; left: any; @@ -32584,10 +32535,10 @@ declare namespace MSHTML { pageBreakBefore: string; readonly position: string; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; styleFloat: string; textAlign: string; @@ -32708,7 +32659,7 @@ declare namespace MSHTML { fontVariant: string; fontWeight: string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; height: any; left: any; @@ -32741,10 +32692,10 @@ declare namespace MSHTML { posTop: number; posWidth: number; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; styleFloat: string; textAlign: string; @@ -32777,10 +32728,10 @@ declare namespace MSHTML { private 'MSHTML.IHTMLStyleSheet_typekey': IHTMLStyleSheet; private constructor(); - /** @param number [lIndex=-1] */ + /** @param lIndex [lIndex=-1] */ addImport(bstrURL: string, lIndex?: number): number; - /** @param number [lIndex=-1] */ + /** @param lIndex [lIndex=-1] */ addRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; cssText: string; disabled: boolean; @@ -32805,11 +32756,11 @@ declare namespace MSHTML { readonly selector: string; } - class IHTMLStyleSheetPagesCollection { - private 'MSHTML.IHTMLStyleSheetPagesCollection_typekey': IHTMLStyleSheetPagesCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLStyleSheetPagesCollection { item(index: number): IHTMLStyleSheetPage; readonly length: number; + (index: number): IHTMLStyleSheetPage; } class IHTMLStyleSheetRule { @@ -32820,28 +32771,28 @@ declare namespace MSHTML { readonly style: IHTMLRuleStyle; } - class IHTMLStyleSheetRulesAppliedCollection { - private 'MSHTML.IHTMLStyleSheetRulesAppliedCollection_typekey': IHTMLStyleSheetRulesAppliedCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLStyleSheetRulesAppliedCollection { item(index: number): IHTMLStyleSheetRule; readonly length: number; propertyAppliedBy(name: string): IHTMLStyleSheetRule; propertyAppliedTrace(name: string, index: number): IHTMLStyleSheetRule; propertyAppliedTraceLength(name: string): number; + (index: number): IHTMLStyleSheetRule; } - class IHTMLStyleSheetRulesCollection { - private 'MSHTML.IHTMLStyleSheetRulesCollection_typekey': IHTMLStyleSheetRulesCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLStyleSheetRulesCollection { item(index: number): IHTMLStyleSheetRule; readonly length: number; + (index: number): IHTMLStyleSheetRule; } - class IHTMLStyleSheetsCollection { - private 'MSHTML.IHTMLStyleSheetsCollection_typekey': IHTMLStyleSheetsCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLStyleSheetsCollection { item(pvarIndex: any): any; readonly length: number; + (pvarIndex: any): any; } class IHTMLTableCaption { @@ -32857,10 +32808,10 @@ declare namespace MSHTML { align: string; bgColor: any; - /** @param number [index=-1] */ + /** @param index [index=-1] */ deleteRow(index?: number): void; - /** @param number [index=-1] */ + /** @param index [index=-1] */ insertRow(index?: number): any; readonly rows: IHTMLElementCollection; vAlign: string; @@ -32878,19 +32829,19 @@ declare namespace MSHTML { private 'MSHTML.IHTMLTxtRange_typekey': IHTMLTxtRange; private constructor(); - /** @param boolean [start=true] */ + /** @param start [start=true] */ collapse(start?: boolean): void; compareEndPoints(how: string, sourceRange: IHTMLTxtRange): number; duplicate(): IHTMLTxtRange; - /** @param boolean [showUI=false] */ + /** @param showUI [showUI=false] */ execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; execCommandShowHelp(cmdID: string): boolean; expand(Unit: string): boolean; /** - * @param number [Count=1073741823] - * @param number [flags=0] + * @param Count [Count=1073741823] + * @param flags [flags=0] */ findText(String: string, Count?: number, flags?: number): boolean; getBookmark(): string; @@ -32898,13 +32849,13 @@ declare namespace MSHTML { inRange(range: IHTMLTxtRange): boolean; isEqual(range: IHTMLTxtRange): boolean; - /** @param number [Count=1] */ + /** @param Count [Count=1] */ move(Unit: string, Count?: number): number; - /** @param number [Count=1] */ + /** @param Count [Count=1] */ moveEnd(Unit: string, Count?: number): number; - /** @param number [Count=1] */ + /** @param Count [Count=1] */ moveStart(Unit: string, Count?: number): number; moveToBookmark(Bookmark: string): boolean; moveToElementText(element: IHTMLElement): void; @@ -32918,18 +32869,16 @@ declare namespace MSHTML { queryCommandText(cmdID: string): string; queryCommandValue(cmdID: string): any; - /** @param boolean [fStart=true] */ + /** @param fStart [fStart=true] */ scrollIntoView(fStart?: boolean): void; select(): void; setEndPoint(how: string, sourceRange: IHTMLTxtRange): void; text: string; } - class IHTMLWindow2 { - private 'MSHTML.IHTMLWindow2_typekey': IHTMLWindow2; - private constructor(); - - /** @param string [message=''] */ + // tslint:disable-next-line:interface-name + interface IHTMLWindow2 { + /** @param message [message=''] */ alert(message?: string): void; blur(): void; clearInterval(timerID: number): void; @@ -32938,13 +32887,13 @@ declare namespace MSHTML { close(): void; readonly closed: boolean; - /** @param string [message=''] */ + /** @param message [message=''] */ confirm(message?: string): boolean; defaultStatus: string; readonly document: IHTMLDocument2; readonly event: IHTMLEventObj; - /** @param string [language='JScript'] */ + /** @param language [language='JScript'] */ execScript(code: string, language?: string): any; readonly external: any; focus(): void; @@ -32971,10 +32920,10 @@ declare namespace MSHTML { onunload: any; /** - * @param string [url=''] - * @param string [name=''] - * @param string [features=''] - * @param boolean [replace=false] + * @param url [url=''] + * @param name [name=''] + * @param features [features=''] + * @param replace [replace=false] */ open(url?: string, name?: string, features?: string, replace?: boolean): IHTMLWindow2; opener: any; @@ -32982,8 +32931,8 @@ declare namespace MSHTML { readonly parent: IHTMLWindow2; /** - * @param string [message=''] - * @param string [defstr='undefined'] + * @param message [message=''] + * @param defstr [defstr='undefined'] */ prompt(message?: string, defstr?: string): any; resizeBy(x: number, y: number): void; @@ -32996,13 +32945,14 @@ declare namespace MSHTML { setInterval(expression: string, msec: number, language?: any): number; setTimeout(expression: string, msec: number, language?: any): number; - /** @param string [features=''] */ + /** @param features [features=''] */ showHelp(helpURL: string, helpArg: any, features?: string): void; showModalDialog(dialog: string, varArgIn?: any, varOptions?: any): any; status: string; readonly top: IHTMLWindow2; toString(): string; readonly window: IHTMLWindow2; + (pvarIndex: any): any; } class IHTMLXDomainRequest { @@ -33398,8 +33348,8 @@ declare namespace MSHTML { createRenderStyle(v: string): IHTMLRenderStyle; /** - * @param string [bstrHref=''] - * @param number [lIndex=-1] + * @param bstrHref [bstrHref=''] + * @param lIndex [lIndex=-1] */ createStyleSheet(bstrHref?: string, lIndex?: number): IHTMLStyleSheet; createTextNode(text: string): IHTMLDOMNode; @@ -33419,7 +33369,7 @@ declare namespace MSHTML { elementsFromRect(left: number, top: number, width: number, height: number): IHTMLDOMChildrenCollection; readonly embeds: IHTMLElementCollection; - /** @param boolean [showUI=false] */ + /** @param showUI [showUI=false] */ execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; execCommandShowHelp(cmdID: string): boolean; expando: boolean; @@ -33577,7 +33527,7 @@ declare namespace MSHTML { onvolumechange: any; onwaiting: any; - /** @param string [url='text/html'] */ + /** @param url [url='text/html'] */ open(url?: string, name?: any, features?: any, replace?: any): any; readonly ownerDocument: any; readonly parentNode: IHTMLDOMNode; @@ -33596,14 +33546,14 @@ declare namespace MSHTML { querySelectorAll(v: string): IHTMLDOMChildrenCollection; readonly readyState: string; - /** @param boolean [fForce=false] */ + /** @param fForce [fForce=false] */ recalc(fForce?: boolean): void; readonly referrer: string; releaseCapture(): void; removeChild(oldChild: IHTMLDOMNode): IHTMLDOMNode; removeEventListener(type: string, listener: any, useCapture: boolean): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; replaceNode(replacement: IHTMLDOMNode): IHTMLDOMNode; @@ -33629,9 +33579,7 @@ declare namespace MSHTML { xmlVersion: string; } - class OldHTMLFormElement { - private 'MSHTML.OldHTMLFormElement_typekey': OldHTMLFormElement; - private constructor(); + interface OldHTMLFormElement { acceptCharset: string; accessKey: string; action: string; @@ -33642,14 +33590,14 @@ declare namespace MSHTML { appendItemSeparator(): void; /** - * @param string [name=''] - * @param string [filename=''] + * @param name [name=''] + * @param filename [filename=''] */ appendNameFilePair(name?: string, filename?: string): void; /** - * @param string [name=''] - * @param string [value=''] + * @param name [name=''] + * @param value [value=''] */ appendNameValuePair(name?: string, value?: string): void; applyElement(apply: IHTMLElement, where: string): IHTMLElement; @@ -33716,7 +33664,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -33909,7 +33857,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -33918,7 +33866,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -33934,16 +33882,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -33961,6 +33909,7 @@ declare namespace MSHTML { readonly uniqueNumber: number; urns(urn: any): any; xmsAcceleratorKey: string; + (name?: any, index?: any): any; } class RangeException { @@ -33981,9 +33930,7 @@ declare namespace MSHTML { propertyIsInline(name: string): boolean; } - class RulesAppliedCollection { - private 'MSHTML.RulesAppliedCollection_typekey': RulesAppliedCollection; - private constructor(); + interface RulesAppliedCollection { readonly element: IHTMLElement; item(index: number): IRulesApplied; readonly length: number; @@ -33992,6 +33939,7 @@ declare namespace MSHTML { propertyInheritedFrom(name: string): IRulesApplied; propertyInheritedTrace(name: string, index: number): IRulesApplied; propertyInheritedTraceLength(name: string): number; + (index: number): IRulesApplied; } class Scriptlet { @@ -34005,12 +33953,11 @@ declare namespace MSHTML { url: string; } - class StaticNodeList { - private 'MSHTML.StaticNodeList_typekey': StaticNodeList; - private constructor(); + interface StaticNodeList { readonly 'constructor': any; item(index: number): any; readonly length: number; + (index: number): any; } class SVGAElement { @@ -34230,7 +34177,7 @@ declare namespace MSHTML { readonly filters: IHTMLFiltersCollection; focusable: SVGAnimatedEnumeration; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; id: string; innerHTML: string; @@ -34274,11 +34221,11 @@ declare namespace MSHTML { readonly parentTextEdit: IHTMLElement; readonly recordNumber: any; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; scrollIntoView(varargStart?: any): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; readonly sourceIndex: number; readonly style: IHTMLStyle; @@ -35487,10 +35434,9 @@ declare namespace MSHTML { readonly 'constructor': any; } - class XDomainRequestFactory { - private 'MSHTML.XDomainRequestFactory_typekey': XDomainRequestFactory; - private constructor(); + interface XDomainRequestFactory { create(): IHTMLXDomainRequest; + (): IHTMLXDomainRequest; } class XMLHttpRequestEventTarget { @@ -35510,982 +35456,120 @@ declare namespace MSHTML { interface ActiveXObject { on(obj: MSHTML.HTMLNamespace, event: 'onreadystatechange', argNames: ['pEvtObj'], handler: (this: MSHTML.HTMLNamespace, parameter: {readonly pEvtObj: MSHTML.IHTMLEventObj}) => void): void; - on( - obj: MSHTML.HTMLWindow2, event: 'onerror', argNames: ['description', 'url', 'line'], handler: ( - this: MSHTML.HTMLWindow2, parameter: {readonly description: string, readonly url: string, readonly line: number}) => void): void; - on( - obj: MSHTML.HTMLWindowProxy, event: 'onerror', argNames: ['description', 'url', 'line'], handler: ( - this: MSHTML.HTMLWindowProxy, parameter: {readonly description: string, readonly url: string, readonly line: number}) => void): void; + on(obj: MSHTML.HTMLWindow2, event: 'onerror', argNames: ['description', 'url', 'line'], handler: (this: MSHTML.HTMLWindow2, parameter: {readonly description: string, readonly url: string, readonly line: number}) => void): void; + on(obj: MSHTML.HTMLWindowProxy, event: 'onerror', argNames: ['description', 'url', 'line'], handler: (this: MSHTML.HTMLWindowProxy, parameter: {readonly description: string, readonly url: string, readonly line: number}) => void): void; on(obj: MSHTML.Scriptlet, event: 'onscriptletevent', argNames: ['name', 'eventData'], handler: (this: MSHTML.Scriptlet, parameter: {readonly name: string, readonly eventData: any}) => void): void; - on( - obj: MSHTML.HTMLAnchorElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLAnchorElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLAreaElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLAreaElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLAudioElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLAudioElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLBaseElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLBaseElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLBaseFontElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLBaseFontElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLBGsound, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | - 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | - 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | - 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | - 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | - 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | - 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLBGsound, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLBlockElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLBlockElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLBody, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | - 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', - handler: (this: MSHTML.HTMLBody, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLBRElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLBRElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLButtonElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLButtonElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLCanvasElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLCanvasElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLCommentElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLCommentElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLDDElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLDDElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLDivElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLDivElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLDivPosition, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | - 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', - handler: (this: MSHTML.HTMLDivPosition, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLDListElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLDListElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLDocument, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforeupdate' | - 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | - 'ondragstart' | 'onerrorupdate' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onmousedown' | 'onmousemove' | 'onmouseout' | - 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onpropertychange' | 'onreadystatechange' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | - 'onselectionchange' | 'onselectstart' | 'onstop', - handler: (this: MSHTML.HTMLDocument, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLDTElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLDTElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLEmbed, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | - 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | - 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | - 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | - 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | - 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | - 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLEmbed, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLFieldSetElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | - 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', - handler: (this: MSHTML.HTMLFieldSetElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLFontElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLFontElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLFormElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onreset' | 'onresize' | - 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart' | 'onsubmit', - handler: (this: MSHTML.HTMLFormElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLFrameBase, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLFrameBase, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLFrameElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLFrameElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLFrameSetSite, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLFrameSetSite, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLGenericElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLGenericElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLHeadElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLHeadElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLHeaderElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLHeaderElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLHRElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLHRElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLHtmlElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLHtmlElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLIFrame, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | - 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | - 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | - 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | - 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | - 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | - 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLIFrame, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLImg, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | - 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | - 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | - 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLImg, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLInputButtonElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLInputButtonElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLInputElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | - 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | - 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | - 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | - 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', - handler: (this: MSHTML.HTMLInputElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLInputFileElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | - 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | - 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | - 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | - 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', - handler: (this: MSHTML.HTMLInputFileElement, parameter: {}) => void): void; - on( - obj: MSHTML.htmlInputImage, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | - 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | - 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | - 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.htmlInputImage, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLInputTextElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | - 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | - 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | - 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | - 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', - handler: (this: MSHTML.HTMLInputTextElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLIsIndexElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLIsIndexElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLLabelElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLLabelElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLLegendElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | - 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', - handler: (this: MSHTML.HTMLLegendElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLLIElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLLIElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLLinkElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | - 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | - 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | - 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLLinkElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLListElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLListElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLMapElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLMapElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLMarqueeElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'onbounce' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | - 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | - 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfinish' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | - 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | - 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | - 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart' | - 'onstart', - handler: (this: MSHTML.HTMLMarqueeElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLMediaElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLMediaElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLMetaElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLMetaElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLNextIdElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLNextIdElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLNoShowElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLNoShowElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLObjectElement, event: 'onafterupdate' | 'onbeforeupdate' | 'oncellchange' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | - 'onerror' | 'onerrorupdate' | 'onreadystatechange' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted', - handler: (this: MSHTML.HTMLObjectElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLOListElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLOListElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLOptionButtonElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | - 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | - 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | - 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | - 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | - 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | - 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | - 'onselectstart', - handler: (this: MSHTML.HTMLOptionButtonElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLOptionElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLOptionElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLParaElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLParaElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLParamElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLParamElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLPhraseElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLPhraseElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLProgressElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLProgressElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLRichtextElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | - 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | - 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | - 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | - 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', - handler: (this: MSHTML.HTMLRichtextElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLScriptElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | - 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | - 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | - 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLScriptElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLSelectElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | - 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLSelectElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLSemanticElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLSemanticElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLSourceElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLSourceElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLSpanElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLSpanElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLSpanFlow, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | - 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', handler: ( - this: MSHTML.HTMLSpanFlow, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLStyleElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | - 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | - 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | - 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLStyleElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLTable, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | - 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | - 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | - 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | - 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | - 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | - 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLTable, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLTableCaption, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | - 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', - handler: (this: MSHTML.HTMLTableCaption, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLTableCell, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | - 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', handler: ( - this: MSHTML.HTMLTableCell, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLTableCol, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLTableCol, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLTableRow, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLTableRow, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLTableSection, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLTableSection, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLTextAreaElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | - 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | - 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | - 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | - 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', - handler: (this: MSHTML.HTMLTextAreaElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLTextElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLTextElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLTitleElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLTitleElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLUListElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLUListElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLUnknownElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLUnknownElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLVideoElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLVideoElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLWindow2, event: 'onafterprint' | 'onbeforeprint' | 'onbeforeunload' | 'onblur' | 'onfocus' | 'onhelp' | 'onload' | 'onresize' | 'onscroll' | - 'onunload', - handler: (this: MSHTML.HTMLWindow2, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLWindowProxy, event: 'onafterprint' | 'onbeforeprint' | 'onbeforeunload' | 'onblur' | 'onfocus' | 'onhelp' | 'onload' | 'onresize' | 'onscroll' | - 'onunload', - handler: (this: MSHTML.HTMLWindowProxy, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLWndOptionElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLWndOptionElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLWndSelectElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | - 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.HTMLWndSelectElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLAnchorElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLAnchorElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLAreaElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLAreaElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLAudioElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLAudioElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLBaseElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLBaseElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLBaseFontElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLBaseFontElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLBGsound, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLBGsound, parameter: {}) => void): void; + on(obj: MSHTML.HTMLBlockElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLBlockElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLBody, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLBody, parameter: {}) => void): void; + on(obj: MSHTML.HTMLBRElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLBRElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLButtonElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLButtonElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLCanvasElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLCanvasElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLCommentElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLCommentElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLDDElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLDDElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLDivElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLDivElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLDivPosition, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLDivPosition, parameter: {}) => void): void; + on(obj: MSHTML.HTMLDListElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLDListElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLDocument, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforeupdate' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondragstart' | 'onerrorupdate' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onmousedown' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onpropertychange' | 'onreadystatechange' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onselectionchange' | 'onselectstart' | 'onstop', handler: (this: MSHTML.HTMLDocument, parameter: {}) => void): void; + on(obj: MSHTML.HTMLDTElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLDTElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLEmbed, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLEmbed, parameter: {}) => void): void; + on(obj: MSHTML.HTMLFieldSetElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLFieldSetElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLFontElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLFontElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLFormElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onreset' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart' | 'onsubmit', handler: (this: MSHTML.HTMLFormElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLFrameBase, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLFrameBase, parameter: {}) => void): void; + on(obj: MSHTML.HTMLFrameElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLFrameElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLFrameSetSite, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLFrameSetSite, parameter: {}) => void): void; + on(obj: MSHTML.HTMLGenericElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLGenericElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLHeadElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLHeadElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLHeaderElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLHeaderElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLHRElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLHRElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLHtmlElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLHtmlElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLIFrame, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLIFrame, parameter: {}) => void): void; + on(obj: MSHTML.HTMLImg, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLImg, parameter: {}) => void): void; + on(obj: MSHTML.HTMLInputButtonElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLInputButtonElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLInputElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLInputElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLInputFileElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLInputFileElement, parameter: {}) => void): void; + on(obj: MSHTML.htmlInputImage, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.htmlInputImage, parameter: {}) => void): void; + on(obj: MSHTML.HTMLInputTextElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLInputTextElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLIsIndexElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLIsIndexElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLLabelElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLLabelElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLLegendElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLLegendElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLLIElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLLIElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLLinkElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLLinkElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLListElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLListElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLMapElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLMapElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLMarqueeElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'onbounce' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfinish' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart' | 'onstart', handler: (this: MSHTML.HTMLMarqueeElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLMediaElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLMediaElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLMetaElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLMetaElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLNextIdElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLNextIdElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLNoShowElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLNoShowElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLObjectElement, event: 'onafterupdate' | 'onbeforeupdate' | 'oncellchange' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'onerror' | 'onerrorupdate' | 'onreadystatechange' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted', handler: (this: MSHTML.HTMLObjectElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLOListElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLOListElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLOptionButtonElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLOptionButtonElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLOptionElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLOptionElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLParaElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLParaElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLParamElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLParamElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLPhraseElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLPhraseElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLProgressElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLProgressElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLRichtextElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLRichtextElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLScriptElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLScriptElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLSelectElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLSelectElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLSemanticElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLSemanticElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLSourceElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLSourceElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLSpanElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLSpanElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLSpanFlow, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLSpanFlow, parameter: {}) => void): void; + on(obj: MSHTML.HTMLStyleElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLStyleElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLTable, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLTable, parameter: {}) => void): void; + on(obj: MSHTML.HTMLTableCaption, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLTableCaption, parameter: {}) => void): void; + on(obj: MSHTML.HTMLTableCell, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLTableCell, parameter: {}) => void): void; + on(obj: MSHTML.HTMLTableCol, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLTableCol, parameter: {}) => void): void; + on(obj: MSHTML.HTMLTableRow, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLTableRow, parameter: {}) => void): void; + on(obj: MSHTML.HTMLTableSection, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLTableSection, parameter: {}) => void): void; + on(obj: MSHTML.HTMLTextAreaElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLTextAreaElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLTextElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLTextElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLTitleElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLTitleElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLUListElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLUListElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLUnknownElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLUnknownElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLVideoElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLVideoElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLWindow2, event: 'onafterprint' | 'onbeforeprint' | 'onbeforeunload' | 'onblur' | 'onfocus' | 'onhelp' | 'onload' | 'onresize' | 'onscroll' | 'onunload', handler: (this: MSHTML.HTMLWindow2, parameter: {}) => void): void; + on(obj: MSHTML.HTMLWindowProxy, event: 'onafterprint' | 'onbeforeprint' | 'onbeforeunload' | 'onblur' | 'onfocus' | 'onhelp' | 'onload' | 'onresize' | 'onscroll' | 'onunload', handler: (this: MSHTML.HTMLWindowProxy, parameter: {}) => void): void; + on(obj: MSHTML.HTMLWndOptionElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLWndOptionElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLWndSelectElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.HTMLWndSelectElement, parameter: {}) => void): void; on(obj: MSHTML.HTMLXMLHttpRequest, event: 'onreadystatechange' | 'ontimeout', handler: (this: MSHTML.HTMLXMLHttpRequest, parameter: {}) => void): void; - on( - obj: MSHTML.OldHTMLDocument, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforeupdate' | - 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | - 'ondragstart' | 'onerrorupdate' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onmousedown' | 'onmousemove' | 'onmouseout' | - 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onpropertychange' | 'onreadystatechange' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | - 'onselectionchange' | 'onselectstart' | 'onstop', - handler: (this: MSHTML.OldHTMLDocument, parameter: {}) => void): void; - on( - obj: MSHTML.OldHTMLFormElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onreset' | 'onresize' | - 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart' | 'onsubmit', - handler: (this: MSHTML.OldHTMLFormElement, parameter: {}) => void): void; - on( - obj: MSHTML.Scriptlet, event: 'onclick' | 'ondblclick' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onmousedown' | 'onmousemove' | 'onmouseup' | - 'onreadystatechange', - handler: (this: MSHTML.Scriptlet, parameter: {}) => void): void; - on( - obj: MSHTML.SVGAElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | - 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | - 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | - 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | - 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | - 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | - 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGAElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGCircleElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGCircleElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGClipPathElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGClipPathElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGDefsElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGDefsElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | - 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | - 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | - 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | - 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | - 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | - 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGEllipseElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGEllipseElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGGElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | - 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | - 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | - 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | - 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | - 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | - 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGGElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGGradientElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGGradientElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGImageElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGImageElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGLineElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGLineElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGMarkerElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGMarkerElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGMaskElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGMaskElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGPathElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGPathElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGPatternElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGPatternElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGPolygonElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGPolygonElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGPolylineElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGPolylineElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGRectElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGRectElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGScriptElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGScriptElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGStopElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGStopElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGSVGElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGSVGElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGSymbolElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGSymbolElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGTextElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGTextElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGTextPathElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGTextPathElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGTSpanElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGTSpanElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGUseElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGUseElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGViewElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | - 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | - 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | - 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | - 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', - handler: (this: MSHTML.SVGViewElement, parameter: {}) => void): void; + on(obj: MSHTML.OldHTMLDocument, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforeupdate' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondragstart' | 'onerrorupdate' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onmousedown' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onpropertychange' | 'onreadystatechange' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onselectionchange' | 'onselectstart' | 'onstop', handler: (this: MSHTML.OldHTMLDocument, parameter: {}) => void): void; + on(obj: MSHTML.OldHTMLFormElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onreset' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart' | 'onsubmit', handler: (this: MSHTML.OldHTMLFormElement, parameter: {}) => void): void; + on(obj: MSHTML.Scriptlet, event: 'onclick' | 'ondblclick' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onmousedown' | 'onmousemove' | 'onmouseup' | 'onreadystatechange', handler: (this: MSHTML.Scriptlet, parameter: {}) => void): void; + on(obj: MSHTML.SVGAElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGAElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGCircleElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGCircleElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGClipPathElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGClipPathElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGDefsElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGDefsElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGEllipseElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGEllipseElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGGElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGGElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGGradientElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGGradientElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGImageElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGImageElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGLineElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGLineElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGMarkerElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGMarkerElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGMaskElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGMaskElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGPathElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGPathElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGPatternElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGPatternElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGPolygonElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGPolygonElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGPolylineElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGPolylineElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGRectElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGRectElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGScriptElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGScriptElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGStopElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGStopElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGSVGElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGSVGElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGSymbolElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGSymbolElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGTextElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGTextElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGTextPathElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGTextPathElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGTSpanElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGTSpanElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGUseElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGUseElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGViewElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGViewElement, parameter: {}) => void): void; new(progid: K): ActiveXObjectNameMap[K]; } @@ -36494,7 +35578,3 @@ interface ActiveXObjectNameMap { 'ScriptBridge.ScriptBridge': MSHTML.Scriptlet; 'TemplatePrinter.TemplatePrinter': MSHTML.CTemplatePrinter; } - -interface SafeArray { - _brand: SafeArray; -} diff --git a/types/activex-mshtml/tslint.json b/types/activex-mshtml/tslint.json index 3224b40b8b..916af93888 100644 --- a/types/activex-mshtml/tslint.json +++ b/types/activex-mshtml/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "no-const-enum": false + "no-const-enum": false, + "max-line-length": false } } From 08f61aa8131bdd2e888121671228f28aa764be41 Mon Sep 17 00:00:00 2001 From: Niklas Wulf Date: Wed, 25 Apr 2018 20:54:06 +0200 Subject: [PATCH 0876/2153] [accept-language-parser] add PickOptions (#25289) --- .../accept-language-parser-tests.ts | 8 +++++++- types/accept-language-parser/index.d.ts | 12 ++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/types/accept-language-parser/accept-language-parser-tests.ts b/types/accept-language-parser/accept-language-parser-tests.ts index b137df02e4..586a31cb93 100644 --- a/types/accept-language-parser/accept-language-parser-tests.ts +++ b/types/accept-language-parser/accept-language-parser-tests.ts @@ -1,4 +1,4 @@ -// https://github.com/opentable/accept-language-parser/blob/v1.4.1/index.js +// https://github.com/opentable/accept-language-parser/blob/v1.5.0/index.js import * as AcceptLanguageParser from 'accept-language-parser'; @@ -23,3 +23,9 @@ const l3: AcceptLanguageParser.Language = { const parsed1: AcceptLanguageParser.Language[] = AcceptLanguageParser.parse(''); const pick1: string | null = AcceptLanguageParser.pick([''], ''); const pick2: string | null = AcceptLanguageParser.pick([''], [l1, l2, l3]); +const pick3: string | null = AcceptLanguageParser.pick([''], '', {}); +const pick4: string | null = AcceptLanguageParser.pick([''], '', { loose: true }); + +const pickOptions: AcceptLanguageParser.PickOptions = { + loose: true +}; diff --git a/types/accept-language-parser/index.d.ts b/types/accept-language-parser/index.d.ts index 16d003648c..c47969c940 100644 --- a/types/accept-language-parser/index.d.ts +++ b/types/accept-language-parser/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for accept-language-parser 1.4 +// Type definitions for accept-language-parser 1.5 // Project: https://github.com/opentable/accept-language-parser // Definitions by: Niklas Wulf // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -7,7 +7,11 @@ // https://github.com/opentable/accept-language-parser/blob/v1.4.1/index.js export function parse(acceptLanguage: string): Language[]; -export function pick(supportedLanguages: string[], acceptLanguage: string | Language[]): string | null; +export function pick( + supportedLanguages: string[], + acceptLanguage: string | Language[], + options?: PickOptions +): string | null; export interface Language { code: string; @@ -15,3 +19,7 @@ export interface Language { region?: string; quality: number; } + +export interface PickOptions { + loose?: boolean; +} From b3ce091e34e0a9330908b46d2583317e9858db02 Mon Sep 17 00:00:00 2001 From: Jan Lohage Date: Wed, 25 Apr 2018 20:54:53 +0200 Subject: [PATCH 0877/2153] Update index.d.ts (#25283) --- types/feathersjs__feathers/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/feathersjs__feathers/index.d.ts b/types/feathersjs__feathers/index.d.ts index c0fa3d9946..b3a0f60667 100644 --- a/types/feathersjs__feathers/index.d.ts +++ b/types/feathersjs__feathers/index.d.ts @@ -45,9 +45,9 @@ export interface Paginated { } // tslint:disable-next-line void-return -export type Hook = (hook: HookContext) => (Promise> | void); +export type Hook = (hook: HookContext) => (Promise | void); -export interface HookContext { +export interface HookContext { app?: Application; data?: T; error?: any; From e81f217c018e6132d099cbd189431250124aa7d8 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Wed, 25 Apr 2018 20:55:08 +0200 Subject: [PATCH 0878/2153] Add NavigationContainerComponent (#25270) --- types/react-navigation/index.d.ts | 10 ++++++++- .../react-navigation-tests.tsx | 22 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index d3f288c217..a054ecf4d0 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -600,9 +600,17 @@ export interface NavigationContainerProps { style?: StyleProp; } +export interface NavigationContainerComponent extends React.Component< + NavigationContainerProps & NavigationNavigatorProps + > { + dispatch: NavigationDispatch; +} + export interface NavigationContainer extends React.ComponentClass< NavigationContainerProps & NavigationNavigatorProps -> { + > { + new(props: NavigationContainerProps & NavigationNavigatorProps, context?: any): NavigationContainerComponent; + router: NavigationRouter; screenProps: { [key: string]: any }; navigationOptions: any; diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 15ad2a62f5..fb6e72a623 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -33,10 +33,12 @@ import { addNavigationHelpers, HeaderBackButton, Header, + NavigationContainer, NavigationParams, NavigationPopAction, NavigationPopToTopAction, NavigationScreenComponent, + NavigationContainerComponent, } from 'react-navigation'; // Constants @@ -422,3 +424,23 @@ const popToTopAction: NavigationPopToTopAction = NavigationActions.popToTop({ key: "foo", immediate: true }); + +class Page1 extends React.Component { } + +const RootNavigator: NavigationContainer = SwitchNavigator({ + default: { getScreen: () => Page1 }, +}); + +class Page2 extends React.Component { + navigatorRef: NavigationContainerComponent | null; + + componentDidMount() { + if (this.navigatorRef) { + this.navigatorRef.dispatch(NavigationActions.navigate({ routeName: 'default' })); + } + } + + render() { + return { this.navigatorRef = instance; }} />; + } +} From 69fb65bf61c8431d89febe21b7eb3f8f6cba6d05 Mon Sep 17 00:00:00 2001 From: Matt Terski Date: Wed, 25 Apr 2018 13:55:21 -0500 Subject: [PATCH 0879/2153] Add S3's serverSideEncryption option (#25262) --- types/multer-s3/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/multer-s3/index.d.ts b/types/multer-s3/index.d.ts index a03e6ae36e..570dc3c85e 100644 --- a/types/multer-s3/index.d.ts +++ b/types/multer-s3/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/badunk/multer-s3 // Definitions by: KIM Jaesuck a.k.a. gim tcaesvk // Gal Talmor +// Matt Terski // Definitions: https://github.com/DefinitelyType/DefinitelyTyped // TypeScript Version: 2.2 @@ -16,6 +17,7 @@ interface Options { contentType?(req: Express.Request, file: Express.Multer.File, callback: (error: any, mime?: string, stream?: NodeJS.ReadableStream) => void): void; metadata?(req: Express.Request, file: Express.Multer.File, callback: (error: any, metadata?: any) => void): void; cacheControl?: ((req: Express.Request, file: Express.Multer.File, callback: (error: any, cacheControl?: string) => void) => void) | string; + serverSideEncryption?: ((req: Express.Request, file: Express.Multer.File, callback: (error: any, serverSideEncryption?: string) => void) => void) | string; } declare global { From e9b73ce6db31e159ea0782ad1d2af530d24c51c9 Mon Sep 17 00:00:00 2001 From: JB Nizet Date: Wed, 25 Apr 2018 20:55:37 +0200 Subject: [PATCH 0880/2153] luxon: add changes introduced in versions 1.1.0 (#25237) --- types/luxon/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/luxon/index.d.ts b/types/luxon/index.d.ts index c3b9d2a029..d90ba90b13 100644 --- a/types/luxon/index.d.ts +++ b/types/luxon/index.d.ts @@ -175,6 +175,7 @@ declare module 'luxon' { weekday: number; weekdayLong: string; weekdayShort: string; + weeksInWeekYear: number; year: number; zoneName: string; diff( From 9c7cdc97e576393b2f6ab4a62362dd8cb047c320 Mon Sep 17 00:00:00 2001 From: Armin Pfurtscheller Date: Wed, 25 Apr 2018 20:56:00 +0200 Subject: [PATCH 0881/2153] Added types/wampy v6.x.x (#25265) --- types/wampy/index.d.ts | 298 +++++++++++++++++++++++-------------- types/wampy/wampy-tests.ts | 63 +++++--- 2 files changed, 232 insertions(+), 129 deletions(-) diff --git a/types/wampy/index.d.ts b/types/wampy/index.d.ts index 276a1a2f00..71ca538eac 100644 --- a/types/wampy/index.d.ts +++ b/types/wampy/index.d.ts @@ -1,115 +1,195 @@ -// Type definitions for wampy.js v3.0.x +// Type definitions for wampy.js v6.x.x // Project: https://github.com/KSDaemon/wampy.js // Definitions by: Konstantin Burkalev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 -interface WampyOptions -{ - autoReconnect?: boolean; - reconnectInterval?: number; - maxRetries?: number; - realm?: string; - helloCustomDetails?: any; - onChallenge?: (auth_method: string, challenge_details: string) => string; - authid?: string; - onConnect?: () => void; - onClose?: () => void; - onError?: () => void; - onReconnect?: () => void; - onReconnectSuccess?: () => void; - ws?: any; - serializer?: any; +declare namespace wampy { + + type Dict = {[key: string]: any}; + + type Callback = () => void; + + type ErrorCallback = (args: ErrorArgs) => void; + + type EventCallback = (args: DataArgs) => void; + + type SuccessCallback = (args: DataArgs) => void; + + type RPCCallback = (args: DataArgs) => RPCResult | void; + + type ChallengeCallback = (auth_method: string, extra: Dict) => string; + + type Payload = Args | Dict | string | number | boolean | any[] | null; + + interface Args + { + argsList: any[]; + argsDict: Dict; + } + + interface ErrorArgs + { + error: string; + details: Dict; + } + + interface DataArgs extends Args + { + details: Dict; + } + + interface RPCOptions + { + process?: boolean; + } + + interface RPCResult extends Args + { + options: RPCOptions; + } + + interface SubscribeCallbacksHash + { + onSuccess?: Callback; + onError?: ErrorCallback; + onEvent?: EventCallback; + } + + interface UnsubscibeCallbacksHash extends SubscribeCallbacksHash + { + + } + + interface PublishCallbacksHash + { + onSuccess?: Callback; + onError?: ErrorCallback; + } + + interface CallCallbacksHash + { + onSuccess?: SuccessCallback; + onError?: ErrorCallback; + } + + interface CancelCallbacksHash + { + onSuccess?: Callback; + onError?: Callback; + } + + interface RegisterCallbacksHash + { + rpc: RPCCallback; + onSuccess?: Callback; + onError?: ErrorCallback; + } + + interface UnregisterCallbacksHash + { + onSuccess?: Callback; + onError?: ErrorCallback; + } + + interface AdvancedOptions + { + exclude?: number | number[]; + eligible?: number | number[]; + exclude_me?: boolean; + disclose_me?: boolean; + } + + interface PublishAdvancedOptions extends AdvancedOptions + { + exclude_authid?: string | string[]; + exclude_authrole?: string | string[]; + eligible_authid?: string | string[]; + eligible_authrole?: string | string[]; + } + + interface CallAdvancedOptions + { + disclose_me?: boolean; + receive_progress?: boolean; + timeout?: number; + } + + interface CancelAdvancedOptions + { + mode?: "skip" | "kill" | "killnowait"; + } + + interface RegisterAdvancedOptions + { + match?: "prefix" | "wildcard" + invoke?: "single" | "roundrobin" | "random" | "first" | "last" + } + + interface WampyOptions + { + autoReconnect?: boolean; + reconnectInterval?: number; + maxRetries?: number; + realm?: string; + helloCustomDetails?: any; + authid?: string; + authmethods?: string[]; + onChallenge?: ChallengeCallback; + onConnect?: Callback; + onClose?: Callback; + onError?: Callback; + onReconnect?: Callback; + onReconnectSuccess?: Callback; + ws?: any; + serializer?: any; + } + + interface WampyOpStatus + { + code: number; + description: string; + reqId?: number; + } + + interface WampyStatic + { + new (options?: WampyOptions): Wampy; + new (url: string, options?: WampyOptions): Wampy; + } + + interface Wampy + { + constructor: WampyStatic; + options(opts?: WampyOptions): WampyOptions | Wampy; + getOpStatus(): WampyOpStatus; + getSessionId(): number; + connect(url?: string): Wampy; + disconnect(): Wampy; + abort(): Wampy; + subscribe(topicURI: string, + callbacks: EventCallback | SubscribeCallbacksHash): Wampy; + unsubscribe(topicURI: string, + callbacks?: EventCallback | UnsubscibeCallbacksHash): Wampy; + publish(topicURI: string, + payload?: Payload, + callbacks?: PublishCallbacksHash, + advancedOptions?: PublishAdvancedOptions): Wampy; + call(topicURI: string, + payload?: Payload, + callbacks?: SuccessCallback | CallCallbacksHash, + advancedOptions?: CallAdvancedOptions): Wampy; + cancel(reqId: number, + callbacks?: Callback | CancelCallbacksHash, + advancedOptions?: CancelAdvancedOptions): Wampy; + register(topicURI: string, + callbacks: RPCCallback | RegisterCallbacksHash, + avdancedOptions?: RegisterAdvancedOptions): Wampy; + unregister(topicURI: string, + callbacks?: Callback | UnregisterCallbacksHash): Wampy; + } } -interface WampyOpStatus -{ - code: number; - description: string; - reqId?: number; -} - -interface SuccessErrorCallbacksHash -{ - onSuccess?: (args: any[], kwargs: any) => void; - onError?: (err: string, details: any) => void; -} - -interface SubscribeCallbacksHash extends SuccessErrorCallbacksHash -{ - onEvent: (args: any[], kwargs: any) => void; -} - -interface RegisterCallbacksHash extends SuccessErrorCallbacksHash -{ - rpc: (args: any[], kwargs: any, options: any) => any[]; -} - -interface CallSuccessErrorCallbacksHash -{ - onSuccess: (args: any[], kwargs: any) => any; - onError?: (err: string, details: any, args: any[], kwargs: any) => void; -} - -interface AdvancedOptions -{ - exclude?: number | number[]; - eligible?: number | number[]; - exclude_me?: boolean; - disclose_me?: boolean; -} - -interface PublishAdvancedOptions extends AdvancedOptions -{ - exclude_authid?: string | string[]; - exclude_authrole?: string | string[]; - eligible_authid?: string | string[]; - eligible_authrole?: string | string[]; -} - -interface CallAdvancedOptions -{ - disclose_me?: boolean; - receive_progress?: boolean; - timeout?: number; -} - -interface CancelAdvancedOptions -{ - mode?: "skip" | "kill" | "killnowait"; -} - -interface Wampy -{ - new (url?: string, options?: WampyOptions): Wampy; - options(opts?: WampyOptions): WampyOptions | Wampy; - getOpStatus(): WampyOpStatus; - getSessionId(): number; - connect(url?: string): Wampy; - disconnect(): Wampy; - abort(): Wampy; - subscribe(topicURI: string, callbacks: (((args: any[], kwargs: any) => void) | SubscribeCallbacksHash)): Wampy; - unsubscribe(topicURI: string, callbacks?: (((args: any[], kwargs: any) => void) | SubscribeCallbacksHash)): Wampy; - publish(topicURI: string, - payload?: any, - callbacks?: SuccessErrorCallbacksHash, - advancedOptions?: PublishAdvancedOptions): Wampy; - call(topicURI: string, - payload?: any, - callbacks?: (((args: any[], kwargs: any) => void) | CallSuccessErrorCallbacksHash), - advancedOptions?: CallAdvancedOptions): Wampy; - cancel(reqId: number, - callbacks?: ((() => void) | SuccessErrorCallbacksHash), - advancedOptions?: CancelAdvancedOptions): Wampy; - register(topicURI: string, callbacks: (((args: any[], kwargs: any, options: any) => any[]) | RegisterCallbacksHash)): Wampy; - unregister(topicURI: string, callbacks?: ((() => void) | SuccessErrorCallbacksHash)): Wampy; -} - -declare var wampy: Wampy; - -declare module 'wampy' -{ - export = wampy; -} - - - +declare const wampy: wampy.WampyStatic; +export as namespace wampy; +export = wampy; diff --git a/types/wampy/wampy-tests.ts b/types/wampy/wampy-tests.ts index 1d999fc7c6..cf06c98aef 100644 --- a/types/wampy/wampy-tests.ts +++ b/types/wampy/wampy-tests.ts @@ -1,4 +1,12 @@ import Wampy = require('wampy'); +import { + DataArgs, + ErrorArgs, + RPCResult, + RPCOptions, + RPCCallback, + WampyOpStatus +} from 'wampy'; declare var console: { log(...args: any[]): void }; let ws = new Wampy('http://wamp.router.url', {realm: 'WAMPRealm'}); @@ -24,11 +32,11 @@ let id: number = ws.getSessionId(); ws.disconnect(); ws.abort(); -ws.subscribe('system.monitor.update', (args: any[], kwargs: any) => +ws.subscribe('system.monitor.update', (args: DataArgs) => { console.log('Received system.monitor.update event!'); }) - .subscribe('client.message', function (args: any[], kwargs: any) + .subscribe('client.message', function (args: DataArgs) { console.log('Received client.message event!'); }); @@ -40,14 +48,14 @@ ws.unsubscribe('subscribed.topic', f1); ws.unsubscribe('chat.message.received'); ws.call('get.server.time', null, { - onSuccess: (args: any[], kwargs: any) => + onSuccess: (args: DataArgs) => { console.log('RPC successfully called'); - console.log('Server time is ' + kwargs); + console.log('Server time is ' + args.argsDict); }, - onError: (err: string, details: any, args: any[], kwargs: any) => + onError: (args: ErrorArgs) => { - console.log('RPC call failed with error ' + err); + console.log('RPC call failed with error ' + args.error); } }); @@ -63,44 +71,59 @@ ws.publish('user.modified', {field1: 'field1', field2: true, field3: 123}, { }); ws.publish('user.modified', {field1: 'field1', field2: true, field3: 123}, { onSuccess: () => console.log('User successfully modified'), - onError: (err: string, details: any) => console.log('User modification failed', err) + onError: (args: ErrorArgs) => console.log('User modification failed', args.error) }); ws.publish('chat.message.received', ['Private message'], null, {eligible: 123456789}); +ws.publish('user.logged.in', { argsList: [1,2,3], argsDict: {first: 1, second:2, third: 3}}); -ws.call('server.time', null, (args: any[], kwargs: any) => console.log('Server time is ' + args[0])); +ws.call('server.time', null, (args: DataArgs) => console.log('Server time is ' + args.argsList[0])); +ws.call('server.time', null, (args: DataArgs) => console.log('Server time is ' + args.argsDict.serverTime)); ws.call('start.migration', null, { - onSuccess: (args: any[], kwargs: any) => console.log('RPC successfully called'), - onError: (err: string, details: any, args: any[], kwargs: any) => console.log('RPC call failed!', err) + onSuccess: (args: DataArgs) => console.log('RPC successfully called'), + onError: (args: ErrorArgs) => console.log('RPC call failed!', args.error) }); ws.call('restore.backup', {backupFile: 'backup.zip'}, { - onSuccess: (args: any[], kwargs: any) => console.log('Backup successfully restored'), - onError: (err: string, details: any, args: any[], kwargs: any) => console.log('Restore failed!', err) + onSuccess: (args: DataArgs) => console.log('Backup successfully restored'), + onError: (args: ErrorArgs) => console.log('Restore failed!', args.error) }); ws.call('start.migration', null, { - onSuccess: (args: any[], kwargs: any) => console.log('RPC successfully called'), - onError: (err: string, details: any, args: any[], kwargs: any) => console.log('RPC call failed!', err) + onSuccess: (args: DataArgs) => console.log('RPC successfully called'), + onError: (args: ErrorArgs) => console.log('RPC call failed!', args.error) }); -let status = ws.getOpStatus(); +let status: WampyOpStatus = ws.getOpStatus(); ws.cancel(status.reqId); -let sqrt_f = (args: any[], kwargs: any, options: any) => [{}, kwargs * kwargs]; +let options: RPCOptions = { process: true }; + +let sqrt_f: RPCCallback = (args: DataArgs): RPCResult => { + let result = args.argsList[0] * args.argsList[0]; + if (result === 0) { + return; + } + + return { + options, + argsList: [result], + argsDict: { result } + } +}; ws.register('sqrt.value', sqrt_f); ws.register('sqrt.value', { rpc: sqrt_f, - onSuccess: (args: any[], kwargs: any) => console.log('RPC successfully registered'), - onError: (err: string, details: any) => console.log('RPC registration failed!', err) + onSuccess: () => console.log('RPC successfully registered'), + onError: (args: ErrorArgs) => console.log('RPC registration failed!', args.error) }); ws.unregister('sqrt.value'); ws.unregister('sqrt.value', { - onSuccess: (data: any) => console.log('RPC successfully unregistered'), - onError: (err: string, details: any) => console.log('RPC unregistration failed!', err) + onSuccess: () => console.log('RPC successfully unregistered'), + onError: (args: ErrorArgs) => console.log('RPC unregistration failed!', args.error) }); From f659a6fb160cc3aa8ea6457c27b279b802e78a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Simon=20Maria=20M=C3=B6llers?= Date: Wed, 25 Apr 2018 20:57:10 +0200 Subject: [PATCH 0882/2153] [whatwg-streams] Make classes generic, add transform streams (#25292) * [whatwg-streams] Make stream classes generic * [whatwg-streams] Add transform streams * [whatwg-streams] Add ksm2 to authors --- types/whatwg-streams/index.d.ts | 132 +++++++++++-------- types/whatwg-streams/whatwg-streams-tests.ts | 65 ++++++++- 2 files changed, 141 insertions(+), 56 deletions(-) diff --git a/types/whatwg-streams/index.d.ts b/types/whatwg-streams/index.d.ts index 02ad2c5152..accc08276c 100644 --- a/types/whatwg-streams/index.d.ts +++ b/types/whatwg-streams/index.d.ts @@ -1,25 +1,27 @@ // Type definitions for Streams API // Project: https://github.com/whatwg/streams // Definitions by: Kagami Sascha Rosylight +// Konstantin Simon Maria Möllers // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 -export interface ReadableStreamSource { - start?(controller: ReadableStreamDefaultController): void | Promise; - pull?(controller: ReadableStreamDefaultController): void | Promise; +export interface ReadableStreamSource { + start?(controller: ReadableStreamDefaultController): void | Promise; + pull?(controller: ReadableStreamDefaultController): void | Promise; cancel?(reason: string): void | Promise; } -export interface ReadableByteStreamSource { - start?(controller: ReadableByteStreamController): void | Promise; - pull?(controller: ReadableByteStreamController): void | Promise; +export interface ReadableByteStreamSource { + start?(controller: ReadableByteStreamController): void | Promise; + pull?(controller: ReadableByteStreamController): void | Promise; cancel?(reason: string): void | Promise; type: "bytes"; autoAllocateChunkSize?: number; } -export interface QueuingStrategy { - size?(chunk: ArrayBufferView): number; +export interface QueuingStrategy { + size?(chunk: T): number; highWaterMark?: number; } @@ -29,88 +31,93 @@ export interface PipeOptions { preventCancel?: boolean; } -declare class ReadableStream { - constructor(underlyingSource?: ReadableStreamSource, strategy?: QueuingStrategy); - constructor(underlyingSource?: ReadableByteStreamSource, strategy?: QueuingStrategy); +export interface WritableReadablePair, U extends ReadableStream> { + writable: T; + readable: U; +} + +declare class ReadableStream { + constructor(underlyingSource?: ReadableStreamSource, strategy?: QueuingStrategy); + constructor(underlyingSource?: ReadableByteStreamSource, strategy?: QueuingStrategy); locked: boolean; cancel(reason: string): Promise; - getReader(): ReadableStreamDefaultReader; - getReader({ mode }: { mode: "byob" }): ReadableStreamBYOBReader; - pipeThrough({ writable, readable }: { writable: WritableStream, readable: T }, options?: PipeOptions): T; + getReader(): ReadableStreamDefaultReader; + getReader({ mode }: { mode: "byob" }): ReadableStreamBYOBReader; + pipeThrough>({ writable, readable }: WritableReadablePair, T>, options?: PipeOptions): T; pipeTo(dest: WritableStream, options?: PipeOptions): Promise; - tee(): [ReadableStream, ReadableStream]; + tee(): [ReadableStream, ReadableStream]; } -declare class ReadableStreamDefaultReader { +declare class ReadableStreamDefaultReader { + constructor(stream: ReadableStream); + + closed: Promise; + + cancel(reason: string): Promise; + read(): Promise>; + releaseLock(): void; +} + +declare class ReadableStreamBYOBReader { constructor(stream: ReadableStream); closed: Promise; cancel(reason: string): Promise; - read(): Promise>; + read(view: R): Promise>; releaseLock(): void; } -declare class ReadableStreamBYOBReader { - constructor(stream: ReadableStream); - - closed: Promise; - - cancel(reason: string): Promise; - read(view: ArrayBufferView): Promise>; - releaseLock(): void; -} - -declare class ReadableStreamDefaultController { - constructor(stream: ReadableStream, underlyingSource: ReadableStreamSource, size: number, highWaterMark: number); +declare class ReadableStreamDefaultController { + constructor(stream: ReadableStream, underlyingSource: ReadableStreamSource, size: number, highWaterMark: number); desiredSize: number; close(): void; - enqueue(chunk: ArrayBufferView): number; + enqueue(chunk: R): number; error(e: any): void; } -declare class ReadableByteStreamController { - constructor(stream: ReadableStream, underlyingSource: ReadableStreamSource, highWaterMark: number); +declare class ReadableByteStreamController { + constructor(stream: ReadableStream, underlyingSource: ReadableStreamSource, highWaterMark: number); - byobRequest: ReadableStreamBYOBRequest; + byobRequest: ReadableStreamBYOBRequest; desiredSize: number; close(): void; - enqueue(chunk: ArrayBufferView): number; + enqueue(chunk: R): number; error(e: any): void; } -declare class ReadableStreamBYOBRequest { - constructor(controller: ReadableByteStreamController, view: ArrayBufferView); +declare class ReadableStreamBYOBRequest { + constructor(controller: ReadableByteStreamController, view: R); - view: ArrayBufferView; + view: R; respond(bytesWritten: number): void; - respondWithNewView(view: ArrayBufferView): void; + respondWithNewView(view: R): void; } -interface WritableStreamSink { - start?(controller: WritableStreamDefaultController): void | Promise; - write?(chunk: any, controller?: WritableStreamDefaultController): any; - close?(controller: WritableStreamDefaultController): void | Promise; +interface WritableStreamSink { + start?(controller: WritableStreamDefaultController): void | Promise; + write?(chunk: W, controller?: WritableStreamDefaultController): any; + close?(controller: WritableStreamDefaultController): void | Promise; abort?(reason: string): void | Promise; } -declare class WritableStream { - constructor(underlyingSink?: WritableStreamSink, strategy?: QueuingStrategy); +declare class WritableStream { + constructor(underlyingSink?: WritableStreamSink, strategy?: QueuingStrategy); locked: boolean; abort(reason: string): Promise; - getWriter(): WritableStreamDefaultWriter; + getWriter(): WritableStreamDefaultWriter; } -declare class WritableStreamDefaultWriter { - constructor(stream: WritableStream); +declare class WritableStreamDefaultWriter { + constructor(stream: WritableStream); closed: Promise; desiredSize: number | null; @@ -119,19 +126,19 @@ declare class WritableStreamDefaultWriter { abort(reason: string): Promise; close(): Promise; releaseLock(): void; - write(chunk: any): Promise; + write(chunk: W): Promise; } -declare class WritableStreamDefaultController { - constructor(stream: WritableStream, underlyingSink: WritableStreamSink, size: number, highWaterMark: number); +declare class WritableStreamDefaultController { + constructor(stream: WritableStream, underlyingSink: WritableStreamSink, size: number, highWaterMark: number); error(e: any): void; } -declare class ByteLengthQueuingStrategy { +declare class ByteLengthQueuingStrategy { constructor({ highWaterMark }: { highWaterMark: number }); - size(chunk: ArrayBufferView): number | undefined; + size(chunk: T): number | undefined; } declare class CountQueuingStrategy { @@ -139,3 +146,24 @@ declare class CountQueuingStrategy { size(): 1; } + +declare interface TransformStreamTransformer { + start?(controller: TransformStreamDefaultController): void | Promise; + transform?(chunk: R, controller: TransformStreamDefaultController): void | Promise; + flush?(controller: TransformStreamDefaultController): void | Promise; +} + +declare class TransformStream implements WritableReadablePair, ReadableStream> { + constructor(transformer?: TransformStreamTransformer, writableStrategy?: QueuingStrategy, readableStrategy?: QueuingStrategy); + + readonly readable: ReadableStream; + readonly writable: WritableStream; +} + +declare class TransformStreamDefaultController { + enqueue(chunk: W): void; + error(reason: any): void; + terminate(): void; + + readonly desiredSize: number; +} diff --git a/types/whatwg-streams/whatwg-streams-tests.ts b/types/whatwg-streams/whatwg-streams-tests.ts index 9456ff2983..141f47c820 100644 --- a/types/whatwg-streams/whatwg-streams-tests.ts +++ b/types/whatwg-streams/whatwg-streams-tests.ts @@ -2,7 +2,8 @@ import { ReadableStream, ReadableStreamSource, WritableStream, - ReadableStreamDefaultController, WritableStreamSink, WritableStreamDefaultController, ReadableByteStreamController + ReadableStreamDefaultController, WritableStreamSink, WritableStreamDefaultController, ReadableByteStreamController, + TransformStream, TransformStreamDefaultController, TransformStreamTransformer } from "whatwg-streams"; // Examples taken from https://streams.spec.whatwg.org/#creating-examples @@ -127,7 +128,7 @@ function makeUDPSocketStream(host: string, port: number) { interface fs { open(path: string | Buffer, flags: string | number): Promise; read(fd: number, buffer: Buffer, offset: number, length: number, position: number): Promise; - write(fd: number, buffer: Buffer, offset: number, length: number): Promise; + write(fd: number, buffer: Buffer | string, offset: number, length: number): Promise; close(fd: number): Promise; } let fs: fs; @@ -251,7 +252,7 @@ function makeWritableWebSocketStream(url: string, protocols: string | string[]) function makeWritableFileStream(filename: string) { let fd: number; - return new WritableStream({ + return new WritableStream({ start() { return fs.open(filename, "w").then(result => { fd = result; @@ -290,7 +291,7 @@ function streamifyWebSocket(url: string, protocol: string) { return { readable: new ReadableStream(new WebSocketSource(ws)), - writable: new WritableStream(new WebSocketSink(ws)) + writable: new WritableStream(new WebSocketSink(ws)) }; } @@ -354,3 +355,59 @@ class WebSocketSink implements WritableStreamSink { console.log("The web socket says: ", value); }); } + + +// 8.9. A transform stream that replaces template tags + + +type Dictionary = { [key: string]: T } + +declare interface FetchEvent { + respondWith(promise: Promise): void; +} + +class LipFuzzTransformer implements TransformStreamTransformer { + substitutions: Dictionary; + partialChunk: string; + lastIndex: number | undefined; + + constructor(substitutions: Dictionary) { + this.substitutions = substitutions; + this.partialChunk = ""; + this.lastIndex = undefined; + } + + transform(chunk: string, controller: TransformStreamDefaultController) { + chunk = this.partialChunk + chunk; + this.partialChunk = ""; + // lastIndex is the index of the first character after the last substitution. + this.lastIndex = 0; + chunk = chunk.replace(/\{\{([a-zA-Z0-9_-]+)\}\}/g, this.replaceTag.bind(this)); + // Regular expression for an incomplete template at the end of a string. + const partialAtEndRegexp = /\{(\{([a-zA-Z0-9_-]+(\})?)?)?$/g; + // Avoid looking at any characters that have already been substituted. + partialAtEndRegexp.lastIndex = this.lastIndex; + this.lastIndex = undefined; + const match = partialAtEndRegexp.exec(chunk); + if (match) { + this.partialChunk = chunk.substring(match.index); + chunk = chunk.substring(0, match.index); + } + controller.enqueue(chunk); + } + + flush(controller: TransformStreamDefaultController) { + if (this.partialChunk.length > 0) { + controller.enqueue(this.partialChunk); + } + } + + replaceTag(match: string, p1: string, offset: number) { + let replacement = this.substitutions[p1]; + if (replacement === undefined) { + replacement = ""; + } + this.lastIndex = offset + replacement.length; + return replacement; + } +} From d54d8943e3e9165161f5a07f17fe3b59579d0071 Mon Sep 17 00:00:00 2001 From: Don Denton Date: Wed, 25 Apr 2018 13:59:01 -0500 Subject: [PATCH 0883/2153] (new definition) [qunit-dom] Add types (#25299) --- types/qunit-dom/index.d.ts | 281 +++++++++++++++++++++++++++++ types/qunit-dom/qunit-dom-tests.ts | 26 +++ types/qunit-dom/tsconfig.json | 23 +++ types/qunit-dom/tslint.json | 1 + 4 files changed, 331 insertions(+) create mode 100644 types/qunit-dom/index.d.ts create mode 100644 types/qunit-dom/qunit-dom-tests.ts create mode 100644 types/qunit-dom/tsconfig.json create mode 100644 types/qunit-dom/tslint.json diff --git a/types/qunit-dom/index.d.ts b/types/qunit-dom/index.d.ts new file mode 100644 index 0000000000..720634088d --- /dev/null +++ b/types/qunit-dom/index.d.ts @@ -0,0 +1,281 @@ +// Type definitions for qunit-dom 0.6 +// Project: https://github.com/simplabs/qunit-dom#readme +// Definitions by: Don Denton +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +declare namespace QUnitDom { + interface Options { + count?: number; + } + + interface Matchers { + /** + * Assert an `HTMLElement` (or multiple) matching the `selector` exists. + * + * + * @param options Documentation on options is sparse. It at least takes a `count` param, which confirms the number of elements that match your selector in the DOM. + * @param message + */ + exists(options?: Options, message?: string): void; + + /** + * Assert an `HTMLElement` matching the `selector` does not exists. + * + * + * @param message + */ + doesNotExist(message?: string): void; + + /** + * Assert that the `HTMLElement` or an `HTMLElement` matching the + * `selector` is currently checked. + * + * + * @param message + */ + isChecked(message?: string): void; + + /** + * Assert that the `HTMLElement` or an `HTMLElement` matching the + * `selector` is currently unchecked. + * + * + * @param message + */ + isNotChecked(message?: string): void; + + /** + * Assert that the `HTMLElement` or an `HTMLElement` matching the + * `selector` is currently focused. + * + * + * @param message + */ + isFocused(message?: string): void; + + /** + * Assert that the `HTMLElement` or an `HTMLElement` matching the + * `selector` is not currently focused. + * + * + * @param message + */ + isNotFocused(message?: string): void; + + /** + * Assert that the `HTMLElement` or an `HTMLElement` matching the + * `selector` is currently required. + * + * + * @param message + */ + isRequired(message?: string): void; + + /** + * Assert that the `HTMLElement` or an `HTMLElement` matching the + * `selector` is currently not required. + * + * + * @param message + */ + isNotRequired(message?: string): void; + + /** + * Assert that the `HTMLElement` or an `HTMLElement` matching the + * `selector` is visible.Visibility is determined with the hueristic + * used in [jQuery's :visible pseudo-selector](https://github.com/jquery/jquery/blob/2d4f53416e5f74fa98e0c1d66b6f3c285a12f0ce/src/css/hiddenVisibleSelectors.js#L12), + * specifically: + * + * - is the element's offsetWidth non-zero + * - is the element's offsetHeight non-zero + * - is the length of an element's DOMRect objects found via getClientRects() non-zero + * + * Additionally, visibility in this case means that the element is visible on the page, + * but not necessarily in the viewport. + * + * + * @param message + */ + isVisible(message?: string): void; + + /** + * Assert that the `HTMLElement` or an `HTMLElement` matching the + * `selector` is not visible.Visibility is determined with the hueristic + * used in [jQuery's :visible pseudo-selector](https://github.com/jquery/jquery/blob/2d4f53416e5f74fa98e0c1d66b6f3c285a12f0ce/src/css/hiddenVisibleSelectors.js#L12), + * specifically: + * + * - is the element's offsetWidth non-zero + * - is the element's offsetHeight non-zero + * - is the length of an element's DOMRect objects found via getClientRects() non-zero + * + * Additionally, visibility in this case means that the element is visible on the page, + * but not necessarily in the viewport. + * + * + * @param message + */ + isNotVisible(message?: string): void; + + /** + * Assert that the `HTMLElement` has an attribute with the provided `name` + * and optionally checks if the attribute `value` matches the provided text + * or regular expression. + * + * + * @param name + * @param value + * @param message + */ + hasAttribute(name: string, value: string | RegExp | object, message?: string): void; + + /** + * Assert that the `HTMLElement` or an `HTMLElement` matching the + * `selector` is disabled. + * + * + * @param message + */ + isDisabled(message?: string): void; + + /** + * Assert that the `HTMLElement` or an `HTMLElement` matching the + * `selector` is not disabled. + * + * + * @param message + */ + isNotDisabled(message?: string): void; + + /** + * Assert that the `HTMLElement` has no attribute with the provided `name`. + * + * @alias hasNoAttribute + * @alias lacksAttribute + * + * @param name + * @param message + */ + doesNotHaveAttribute(name: string, message?: string): void; + hasNoAttribute: Matchers['doesNotHaveAttribute']; + lacksAttribute: Matchers['doesNotHaveAttribute']; + + /** + * Assert that the `HTMLElement` has the `expected` CSS class using + * [`classList`](https://developer.mozilla.org/en-US/docs/Web/API/Element/classList). + * + * + * @param expected + * @param message + */ + hasClass(expected: string, message?: string): void; + + /** + * Assert that the `HTMLElement` does not have the `expected` CSS class using + * [`classList`](https://developer.mozilla.org/en-US/docs/Web/API/Element/classList). + * + * @alias hasNoClass + * @alias lacksClass + * + * @param expected + * @param message + */ + doesNotHaveClass(expected: string, message?: string): void; + hasNoClass: Matchers['doesNotHaveClass']; + lacksClass: Matchers['doesNotHaveClass']; + + /** + * Assert that the text of the `HTMLElement` or an `HTMLElement` + * matching the `selector` matches the `expected` text, using the + * [`textContent`](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent) + * attribute and stripping / collapsing whitespace. + * + * `expected` can also be a regular expression. + * + * @alias matchesText + * + * @param expected + * @param message + */ + hasText(expected: string | RegExp, message?: string): void; + matchesText: Matchers['hasText']; + + /** + * Assert that the `textContent` property of an `HTMLElement` is not empty. + * + * + * @param message + */ + hasAnyText(message?: string): void; + + /** + * Assert that the text of the `HTMLElement` or an `HTMLElement` + * matching the `selector` contains the given `text`, using the + * [`textContent`](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent) + * attribute. + * + * @alias containsText + * @alias hasTextContaining + * + * @param text + * @param message + */ + includesText(text: string, message?: string): void; + containsText: Matchers['includesText']; + hasTextContaining: Matchers['includesText']; + + /** + * Assert that the text of the `HTMLElement` or an `HTMLElement` + * matching the `selector` does not include the given `text`, using the + * [`textContent`](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent) + * attribute. + * + * @alias doesNotContainText + * @alias doesNotHaveTextContaining + * + * @param text + * @param message + */ + doesNotIncludeText(text: string, message?: string): void; + doesNotContainText: Matchers['doesNotIncludeText']; + doesNotHaveTextContaining: Matchers['doesNotIncludeText']; + + /** + * Assert that the `value` property of an `HTMLInputElement` matches + * the `expected` text or regular expression. + * + * If no `expected` value is provided, the assertion will fail if the + * `value` is an empty string. + * + * + * @param expected + * @param message + */ + hasValue(expected: string | RegExp | object, message?: string): void; + + /** + * Assert that the `value` property of an `HTMLInputElement` is not empty. + * + * + * @param message + */ + hasAnyValue(message?: string): void; + + /** + * Assert that the `value` property of an `HTMLInputElement` is empty. + * + * @alias lacksValue + * + * @param message + */ + hasNoValue(message?: string): void; + lacksValue: Matchers['hasNoValue']; + } +} + +// Extend QUnit's interface for Assert +interface Assert { + dom(selector?: string): QUnitDom.Matchers; +} diff --git a/types/qunit-dom/qunit-dom-tests.ts b/types/qunit-dom/qunit-dom-tests.ts new file mode 100644 index 0000000000..7604f385e1 --- /dev/null +++ b/types/qunit-dom/qunit-dom-tests.ts @@ -0,0 +1,26 @@ +QUnit.assert.dom('#title').exists(); +QUnit.assert.dom('#title').exists(); +QUnit.assert.dom('.choice').exists({ count: 4 }); +QUnit.assert.dom('.should-not-exist').doesNotExist(); +QUnit.assert.dom('input.active').isChecked(); +QUnit.assert.dom('input.active').isNotChecked(); +QUnit.assert.dom('input.email').isFocused(); +QUnit.assert.dom('input[type="password"]').isNotFocused(); +QUnit.assert.dom('input[type="text"]').isRequired(); +QUnit.assert.dom('input[type="text"]').isNotRequired(); +QUnit.assert.dom('.foo').isVisible(); +QUnit.assert.dom('.foo').isNotVisible(); +QUnit.assert.dom('input.password-input').hasAttribute('type', 'password'); +QUnit.assert.dom('.foo').isDisabled(); +QUnit.assert.dom('.foo').isNotDisabled(); +QUnit.assert.dom('input.username').hasNoAttribute('disabled'); +QUnit.assert.dom('input[type="password"]').hasClass('secret-password-input'); +QUnit.assert.dom('input[type="password"]').doesNotHaveClass('username-input'); +QUnit.assert.dom('#title').hasText('Welcome to QUnit'); +QUnit.assert.dom('.foo').hasText(/[12]\d{3}/); +QUnit.assert.dom('button.share').hasAnyText(); +QUnit.assert.dom('#title').includesText('Welcome'); +QUnit.assert.dom('#title').doesNotIncludeText('Welcome'); +QUnit.assert.dom('input.username').hasValue('HSimpson'); +QUnit.assert.dom('input.username').hasAnyValue(); +QUnit.assert.dom('input.username').hasNoValue(); diff --git a/types/qunit-dom/tsconfig.json b/types/qunit-dom/tsconfig.json new file mode 100644 index 0000000000..ec79244abc --- /dev/null +++ b/types/qunit-dom/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "qunit-dom-tests.ts" + ] +} diff --git a/types/qunit-dom/tslint.json b/types/qunit-dom/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/qunit-dom/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 2d8ed8e3db3968ab45d3ff57e823084ed008994f Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Wed, 25 Apr 2018 20:59:22 +0200 Subject: [PATCH 0884/2153] Add defintions for github.com/tonyg/js-nacl (#25296) --- types/js-nacl/index.d.ts | 123 +++++++++++++++++++++++++++++++++ types/js-nacl/js-nacl-tests.ts | 73 +++++++++++++++++++ types/js-nacl/tsconfig.json | 23 ++++++ types/js-nacl/tslint.json | 1 + 4 files changed, 220 insertions(+) create mode 100644 types/js-nacl/index.d.ts create mode 100644 types/js-nacl/js-nacl-tests.ts create mode 100644 types/js-nacl/tsconfig.json create mode 100644 types/js-nacl/tslint.json diff --git a/types/js-nacl/index.d.ts b/types/js-nacl/index.d.ts new file mode 100644 index 0000000000..94a7cecedf --- /dev/null +++ b/types/js-nacl/index.d.ts @@ -0,0 +1,123 @@ +// Type definitions for js-nacl 1.2 +// Project: https://github.com/tonyg/js-nacl#readme +// Definitions by: Ethan Frey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// instantiate is the main entry point to generate a Nacl instance, +// which contains all functionality +export function instantiate(cb: NaclCallback, opts?: NaclOpts): void; + +export type NaclCallback = (nacl: Nacl) => void; +export interface NaclOpts { + readonly [key: string]: any; +} + +// types for signing +export type SignerSecretKey = Uint8Array; +export type SignerPublicKey = Uint8Array; +export interface SignKeyPair { + signPk: SignerPublicKey; + signSk: SignerSecretKey; +} +export type Message = Uint8Array; +export type Signature = Uint8Array; +export type MessageWithSignature = Uint8Array; + +// types for secrets +export type BoxSecretKey = Uint8Array; +export type BoxPublicKey = Uint8Array; +export interface BoxKeyPair { + boxPk: BoxPublicKey; + boxSk: BoxSecretKey; +} +export type Nonce = Uint8Array; +export type CipherText = Uint8Array; +export interface BoxSharedSecret { + boxK: Uint8Array; +} + +// types for streams +export type Stream = Uint8Array; +export type StreamKey = Uint8Array; + +// Nacl functions taken from js-nacl api spec +export interface Nacl { + // strings vs. binary + to_hex: (arr: Uint8Array) => string; + from_hex: (hex: string) => Uint8Array; + encode_utf8: (utf8: string) => Uint8Array; + encode_latin1: (latin1: string) => Uint8Array; + decode_utf8: (arr: Uint8Array) => string; + decode_latin1: (arr: Uint8Array) => string; + + // hash + crypto_hash: (raw: Uint8Array) => Uint8Array; + crypto_hash_sha256: (raw: Uint8Array) => Uint8Array; + + // crypto_sign + crypto_sign_keypair: () => SignKeyPair; + crypto_sign: (msg: Message, sk: SignerSecretKey) => MessageWithSignature; + crypto_sign_open: ( + packet: MessageWithSignature, + pk: SignerPublicKey + ) => Message | null; + crypto_sign_detached: (msg: Message, sk: SignerSecretKey) => Signature; + crypto_sign_verify_detached: ( + sig: Signature, + msg: Message, + pk: SignerPublicKey + ) => boolean; + + // crypto_box + crypto_box_keypair: () => BoxKeyPair; + crypto_box_random_nonce: () => Nonce; + crypto_box: ( + msg: Message, + nonce: Nonce, + rcpt: BoxPublicKey, + sender: BoxSecretKey + ) => CipherText; + crypto_box_open: ( + cipher: CipherText, + nonce: Nonce, + sender: BoxPublicKey, + rcpt: BoxSecretKey + ) => Message; + crypto_box_precompute: ( + sender: BoxPublicKey, + rcpt: BoxSecretKey + ) => BoxSharedSecret; + crypto_box_precomputed: ( + msg: Message, + nonce: Nonce, + shared: BoxSharedSecret + ) => CipherText; + crypto_box_open_precomputed: ( + cipher: CipherText, + nonce: Nonce, + shared: BoxSharedSecret + ) => Message; + + // crypto_secretbox + crypto_secretbox_random_nonce: () => Nonce; + crypto_secretbox: ( + msg: Message, + nonce: Nonce, + key: BoxSecretKey + ) => CipherText; + crypto_secretbox_open: ( + cipher: CipherText, + nonce: Nonce, + key: BoxSecretKey + ) => Message; + + // derived keys + crypto_sign_seed_keypair: (seed: Uint8Array) => SignKeyPair; + crypto_box_seed_keypair: (seed: Uint8Array) => BoxKeyPair; + crypto_box_keypair_from_raw_sk: (seed: Uint8Array) => BoxKeyPair; + + // TODO: crypto_stream + // crypto_stream_random_nonce: () => Nonce; + // crypto_stream: (len: number, nonce: Nonce, key: StreamKey) => Stream; + // crypto_stream_xor: (msg: Message, nonce: Nonce, key: StreamKey) => Stream; +} diff --git a/types/js-nacl/js-nacl-tests.ts b/types/js-nacl/js-nacl-tests.ts new file mode 100644 index 0000000000..b3336b11f7 --- /dev/null +++ b/types/js-nacl/js-nacl-tests.ts @@ -0,0 +1,73 @@ +/* This is test code for the js-nacl type defintions, to make sure it compiles */ + +import * as nacl from "js-nacl"; + +nacl.instantiate((inst: nacl.Nacl) => { + demo_hex(inst); + demo_hash(inst); + demo_sign(inst); + demo_box(inst); + demo_secret_box(inst); + demo_derived(inst); +}); + +function demo_hex(inst: nacl.Nacl): void { + const hex = "1234567890ABCDEF"; + const bin = inst.from_hex(hex); + inst.to_hex(bin); // $ExpectType string + + const text = "\uD800\uDC01"; + const utf8 = inst.encode_utf8(text); + inst.decode_utf8(utf8); // $ExpectType string + + const latinText = "Bl\xf6\xdf"; + const latin = inst.encode_latin1(latinText); + inst.decode_latin1(latin); // $ExpectType string +} + +function demo_hash(inst: nacl.Nacl): void { + const msg: nacl.Message = inst.encode_utf8("some text to hash"); + inst.crypto_hash(msg); // $ExpectType Uint8Array + inst.crypto_hash_sha256(msg); // $ExpectType Uint8Array +} + +function demo_sign(inst: nacl.Nacl): void { + const keypair = inst.crypto_sign_keypair(); + const msg: nacl.Message = inst.encode_utf8("very important message"); + const packet = inst.crypto_sign(msg, keypair.signSk); + inst.crypto_sign_open(packet, keypair.signPk); // $ExpectType Uint8Array | null + + const sig = inst.crypto_sign_detached(msg, keypair.signSk); + inst.crypto_sign_verify_detached(sig, msg, keypair.signPk); // $ExpectType boolean +} + +function demo_box(inst: nacl.Nacl): void { + const msg: nacl.Message = inst.encode_utf8("signed, sealed, and delivered"); + const sender = inst.crypto_box_keypair(); + const rcpt = inst.crypto_box_keypair(); + const nonce = inst.crypto_box_random_nonce(); + + const cipher = inst.crypto_box(msg, nonce, rcpt.boxPk, sender.boxSk); + inst.crypto_box_open(cipher, nonce, sender.boxPk, rcpt.boxSk); // $ExpectType Uint8Array + + const senderPrecompute = inst.crypto_box_precompute(rcpt.boxPk, sender.boxSk); + const rcptPrecompute = inst.crypto_box_precompute(sender.boxPk, rcpt.boxSk); + const cipher2 = inst.crypto_box_precomputed(msg, nonce, senderPrecompute); + inst.crypto_box_open_precomputed(cipher2, nonce, rcptPrecompute); // $ExpectType Uint8Array +} + +function demo_secret_box(inst: nacl.Nacl): void { + const msg: nacl.Message = inst.encode_utf8("for your eyes only"); + const keypair = inst.crypto_box_keypair(); + const nonce = inst.crypto_secretbox_random_nonce(); + + const cipher = inst.crypto_secretbox(msg, nonce, keypair.boxSk); + inst.crypto_secretbox(cipher, nonce, keypair.boxSk); // $ExpectType Uint8Array +} + +function demo_derived(inst: nacl.Nacl): void { + const seed = inst.encode_utf8("123456789012345678901234567890qq"); // 32 byte secret + inst.crypto_sign_seed_keypair(seed); // $ExpectType SignKeyPair + inst.crypto_box_seed_keypair(seed); // $ExpectType BoxKeyPair + inst.crypto_box_keypair_from_raw_sk(seed); // $ExpectType BoxKeyPair +} diff --git a/types/js-nacl/tsconfig.json b/types/js-nacl/tsconfig.json new file mode 100644 index 0000000000..c576fe48b7 --- /dev/null +++ b/types/js-nacl/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "js-nacl-tests.ts" + ] +} diff --git a/types/js-nacl/tslint.json b/types/js-nacl/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/js-nacl/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 41187d887529ffe677287ec4febc770b7c00a9b3 Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Wed, 25 Apr 2018 21:02:33 +0200 Subject: [PATCH 0885/2153] add types for npmlog (#25291) --- types/npmlog/index.d.ts | 70 ++++++++++++++++++++++++++++++++++++ types/npmlog/npmlog-tests.ts | 43 ++++++++++++++++++++++ types/npmlog/tsconfig.json | 23 ++++++++++++ types/npmlog/tslint.json | 1 + 4 files changed, 137 insertions(+) create mode 100644 types/npmlog/index.d.ts create mode 100644 types/npmlog/npmlog-tests.ts create mode 100644 types/npmlog/tsconfig.json create mode 100644 types/npmlog/tslint.json diff --git a/types/npmlog/index.d.ts b/types/npmlog/index.d.ts new file mode 100644 index 0000000000..5487c76dc7 --- /dev/null +++ b/types/npmlog/index.d.ts @@ -0,0 +1,70 @@ +// Type definitions for npmlog 4.1 +// Project: https://github.com/npm/npmlog#readme +// Definitions by: Daniel Schmidt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +export enum LogLevels { + silly = "silly", + verbose = "verbose", + info = "info", + http = "http", + warn = "warn", + error = "error", +} + +export interface StyleObject { + fg?: string; + bg?: string; + bold?: boolean; + inverse?: boolean; + underline?: boolean; + + bell?: boolean; +} + +export interface MessageObject { + id: number; + level: string; + prefix: string; + message: string; + messageRaw: string; +} + +// TODO: newStream, newGroup, setGaugeTemplate and setGaugeTemplateSet need to be added +interface npmlog { + log(level: LogLevels | string, prefix: string, message: string, ...args: any[]): void; + + silly(prefix: string, message: string, ...args: any[]): void; + verbose(prefix: string, message: string, ...args: any[]): void; + info(prefix: string, message: string, ...args: any[]): void; + http(prefix: string, message: string, ...args: any[]): void; + warn(prefix: string, message: string, ...args: any[]): void; + error(prefix: string, message: string, ...args: any[]): void; + + level: string; + record: MessageObject[]; + maxRecordSize: number; + prefixStyle: StyleObject; + headingStyle: StyleObject; + heading: string; + stream: any; // Defaults to process.stderr + + enableColor(): void; + disableColor(): void; + + enableProgress(): void; + disableProgress(): void; + + enableUnicode(): void; + disableUnicode(): void; + + pause(): void; + resume(): void; + + addLevel(level: string, n: number, style?: StyleObject, disp?: string): void; +} + +declare const logger: npmlog; + +export default logger; diff --git a/types/npmlog/npmlog-tests.ts b/types/npmlog/npmlog-tests.ts new file mode 100644 index 0000000000..8f90bea7ce --- /dev/null +++ b/types/npmlog/npmlog-tests.ts @@ -0,0 +1,43 @@ +import npmlog from "npmlog"; + +const prefix = "str"; +const message = "otherStr"; + +['silly', 'verbose', 'info', 'http', 'warn', 'error'].forEach(lvl => npmlog.log(lvl, prefix, message)); + +npmlog.silly(prefix, message); +npmlog.verbose(prefix, message); +npmlog.info(prefix, message); +npmlog.http(prefix, message); +npmlog.warn(prefix, message); +npmlog.error(prefix, message); + +npmlog.level = "silly"; + +npmlog.enableColor(); +npmlog.disableColor(); + +npmlog.enableProgress(); +npmlog.disableProgress(); + +npmlog.enableUnicode(); +npmlog.disableUnicode(); + +npmlog.pause(); +npmlog.resume(); + +npmlog.addLevel("new-level", 42); +npmlog.addLevel("styled-level", 42, { + fg: 'red', + bg: 'blue', + bold: false, + inverse: true, + underline: true, + bell: false +}); + +npmlog.addLevel("styled-level", 42, { + fg: 'red', + bold: false, + underline: true, +}, 'display name'); diff --git a/types/npmlog/tsconfig.json b/types/npmlog/tsconfig.json new file mode 100644 index 0000000000..8ef05dd055 --- /dev/null +++ b/types/npmlog/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "npmlog-tests.ts" + ] +} diff --git a/types/npmlog/tslint.json b/types/npmlog/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/npmlog/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 8d8bf061a9cd15a1e6c5d81d9db58a1eb2f70aac Mon Sep 17 00:00:00 2001 From: Saad Quadri Date: Wed, 25 Apr 2018 15:02:45 -0400 Subject: [PATCH 0886/2153] add types for deglob (#25277) --- types/deglob/deglob-tests.ts | 21 +++++++++++++++++++++ types/deglob/index.d.ts | 22 ++++++++++++++++++++++ types/deglob/tsconfig.json | 23 +++++++++++++++++++++++ types/deglob/tslint.json | 3 +++ 4 files changed, 69 insertions(+) create mode 100644 types/deglob/deglob-tests.ts create mode 100644 types/deglob/index.d.ts create mode 100644 types/deglob/tsconfig.json create mode 100644 types/deglob/tslint.json diff --git a/types/deglob/deglob-tests.ts b/types/deglob/deglob-tests.ts new file mode 100644 index 0000000000..1f9990d345 --- /dev/null +++ b/types/deglob/deglob-tests.ts @@ -0,0 +1,21 @@ +/// + +import deglob = require('deglob'); + +deglob(['**/*.js'], (err, files) => { + files.forEach(file => { + console.log('found file ' + file); + }); +}); + +const opts = { + cwd: 'foo', + useGitIgnore: false, + usePackageJson: false +}; + +deglob(['**/*.js'], opts, (err, files) => { + files.forEach(file => { + console.log('found file ' + file); + }); +}); diff --git a/types/deglob/index.d.ts b/types/deglob/index.d.ts new file mode 100644 index 0000000000..6310201c11 --- /dev/null +++ b/types/deglob/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for deglob v 2.1 +// Project: https://github.com/standard/deglob +// Definitions by: Saad Quadri +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +type Callback = (err: Error | null, files: string[]) => void; + +declare function deglob(patterns: string[], cb: Callback): void; +declare function deglob(patterns: string[], opts: deglob.Options, cb: Callback): void; + +declare namespace deglob { + interface Options { + useGitIgnore?: boolean; + usePackageJson?: boolean; + configKey?: string; + gitIgnoreFile?: string; + ignore?: string[]; + cwd?: string; + } +} + +export = deglob; diff --git a/types/deglob/tsconfig.json b/types/deglob/tsconfig.json new file mode 100644 index 0000000000..1d3064583a --- /dev/null +++ b/types/deglob/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "deglob-tests.ts" + ] +} diff --git a/types/deglob/tslint.json b/types/deglob/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/deglob/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 030ab23ed3d5adf8019e4e62f95f71affa95305a Mon Sep 17 00:00:00 2001 From: Luis Fernando Alvarez D Date: Wed, 25 Apr 2018 14:03:52 -0500 Subject: [PATCH 0887/2153] Added types for graphql-deduplicator (#25272) --- .../graphql-deduplicator-tests.ts | 4 ++++ types/graphql-deduplicator/index.d.ts | 13 +++++++++++ types/graphql-deduplicator/tsconfig.json | 23 +++++++++++++++++++ types/graphql-deduplicator/tslint.json | 1 + 4 files changed, 41 insertions(+) create mode 100644 types/graphql-deduplicator/graphql-deduplicator-tests.ts create mode 100644 types/graphql-deduplicator/index.d.ts create mode 100644 types/graphql-deduplicator/tsconfig.json create mode 100644 types/graphql-deduplicator/tslint.json diff --git a/types/graphql-deduplicator/graphql-deduplicator-tests.ts b/types/graphql-deduplicator/graphql-deduplicator-tests.ts new file mode 100644 index 0000000000..7da4764de2 --- /dev/null +++ b/types/graphql-deduplicator/graphql-deduplicator-tests.ts @@ -0,0 +1,4 @@ +import { deflate, inflate } from 'graphql-deduplicator'; + +deflate({}); +inflate({}); diff --git a/types/graphql-deduplicator/index.d.ts b/types/graphql-deduplicator/index.d.ts new file mode 100644 index 0000000000..079b7c31be --- /dev/null +++ b/types/graphql-deduplicator/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for graphql-deduplicator 2.0 +// Project: https://github.com/gajus/graphql-deduplicator#readme +// Definitions by: Luis Fernando Alvarez D. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export function deflate(response: object): { + [key: string]: any; +}; + +export function inflate(response: object): { + [key: string]: any; +}; diff --git a/types/graphql-deduplicator/tsconfig.json b/types/graphql-deduplicator/tsconfig.json new file mode 100644 index 0000000000..2254638503 --- /dev/null +++ b/types/graphql-deduplicator/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "graphql-deduplicator-tests.ts" + ] +} diff --git a/types/graphql-deduplicator/tslint.json b/types/graphql-deduplicator/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/graphql-deduplicator/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 9c7b8df170f7258e1556aeeef7a4cf0a2e8695c1 Mon Sep 17 00:00:00 2001 From: uwinkelvos Date: Wed, 25 Apr 2018 21:06:10 +0200 Subject: [PATCH 0888/2153] Added type definitions for koa-xml-body (#25273) --- types/koa-xml-body/index.d.ts | 45 ++++++++++++++++++++++++ types/koa-xml-body/koa-xml-body-tests.ts | 15 ++++++++ types/koa-xml-body/tsconfig.json | 23 ++++++++++++ types/koa-xml-body/tslint.json | 1 + 4 files changed, 84 insertions(+) create mode 100644 types/koa-xml-body/index.d.ts create mode 100644 types/koa-xml-body/koa-xml-body-tests.ts create mode 100644 types/koa-xml-body/tsconfig.json create mode 100644 types/koa-xml-body/tslint.json diff --git a/types/koa-xml-body/index.d.ts b/types/koa-xml-body/index.d.ts new file mode 100644 index 0000000000..334998df5a --- /dev/null +++ b/types/koa-xml-body/index.d.ts @@ -0,0 +1,45 @@ +// Type definitions for koa-xml-body 2.0 +// Project: https://github.com/creeperyang/koa-xml-body +// Definitions by: Ulf Winkelvos +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/* =================== USAGE =================== + + import Koa = require('koa'); + import KoaXmlBody = require('koa-xml-body'); + + const app = new Koa(); + app.use(KoaXmlBody({ + onerror: (err, ctx) => { + ctx.throw(err.message); + } + })); + + =============================================== */ + +import * as Koa from "koa"; + +import { Options as Xml2jsOptions } from "xml2js"; + +declare module "koa" { + interface Request { + body: any; + } +} + +declare function bodyParser(opts?: { + // requested encoding. Default is utf8. If not set, the lib will retrive it from content-type(such as content-type:application/xml;charset=gb2312). + encoding?: string + // limit of the body. If the body ends up being larger than this limit, a 413 error code is returned. Default is 1mb. + limit?: number + // length of the body. When content-length is found, it will be overwritten automatically. + length?: number + // error handler. Default is a noop function. It means it will eat the error silently. You can config it to customize the response. + onerror?: (err: Error, ctx: Koa.Context) => void; + // options which will be used to parse xml. Default is {}. See xml2js Options for details. + xmlOptions?: Xml2jsOptions +}): Koa.Middleware; + +declare namespace bodyParser { } +export = bodyParser; diff --git a/types/koa-xml-body/koa-xml-body-tests.ts b/types/koa-xml-body/koa-xml-body-tests.ts new file mode 100644 index 0000000000..1eca30f62a --- /dev/null +++ b/types/koa-xml-body/koa-xml-body-tests.ts @@ -0,0 +1,15 @@ +import Koa = require('koa'); +import KoaXmlBody = require('koa-xml-body'); + +const app = new Koa(); +app.use(KoaXmlBody({ + onerror: (err, ctx) => { + ctx.throw(err.message); + } +})); + +app.use((ctx) => { + console.log(ctx.request.body); +}); + +app.listen(80); diff --git a/types/koa-xml-body/tsconfig.json b/types/koa-xml-body/tsconfig.json new file mode 100644 index 0000000000..0b0da1408f --- /dev/null +++ b/types/koa-xml-body/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "koa-xml-body-tests.ts" + ] +} \ No newline at end of file diff --git a/types/koa-xml-body/tslint.json b/types/koa-xml-body/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/koa-xml-body/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 65a9fe8ac0b956007075ab46f014a7ba6f457c7c Mon Sep 17 00:00:00 2001 From: Mathias Paumgarten Date: Wed, 25 Apr 2018 12:06:32 -0700 Subject: [PATCH 0889/2153] adds types for a-big-triangle (#25275) --- types/a-big-triangle/a-big-triangle-tests.ts | 5 ++++ types/a-big-triangle/index.d.ts | 8 +++++++ types/a-big-triangle/tsconfig.json | 24 ++++++++++++++++++++ types/a-big-triangle/tslint.json | 3 +++ 4 files changed, 40 insertions(+) create mode 100644 types/a-big-triangle/a-big-triangle-tests.ts create mode 100644 types/a-big-triangle/index.d.ts create mode 100644 types/a-big-triangle/tsconfig.json create mode 100644 types/a-big-triangle/tslint.json diff --git a/types/a-big-triangle/a-big-triangle-tests.ts b/types/a-big-triangle/a-big-triangle-tests.ts new file mode 100644 index 0000000000..75198e8690 --- /dev/null +++ b/types/a-big-triangle/a-big-triangle-tests.ts @@ -0,0 +1,5 @@ +import drawTriangle = require("a-big-triangle"); + +const gl = new WebGLRenderingContext(); + +drawTriangle(gl); // $ExpectType void diff --git a/types/a-big-triangle/index.d.ts b/types/a-big-triangle/index.d.ts new file mode 100644 index 0000000000..6e397cfa7e --- /dev/null +++ b/types/a-big-triangle/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for a-big-triangle 1.0 +// Project: https://github.com/mikolalysenko/a-big-triangle +// Definitions by: Mathias Paumgarten +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function createABigTriangle(gl: WebGLRenderingContext): void; + +export = createABigTriangle; diff --git a/types/a-big-triangle/tsconfig.json b/types/a-big-triangle/tsconfig.json new file mode 100644 index 0000000000..c85f12fe20 --- /dev/null +++ b/types/a-big-triangle/tsconfig.json @@ -0,0 +1,24 @@ +{ + "files": [ + "index.d.ts", + "a-big-triangle-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/a-big-triangle/tslint.json b/types/a-big-triangle/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/a-big-triangle/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From e178d12a21639c084f1a5031592c893befcb0b28 Mon Sep 17 00:00:00 2001 From: BehindTheMath Date: Wed, 25 Apr 2018 15:08:10 -0400 Subject: [PATCH 0890/2153] [proxy-verifier] Add types for proxy-verifier (#25268) * [proxy-verifier] Add types for proxy-verifier * Add minimum TS version These definitions depends on request, which has a minimum TS version of 2.3 * Refactor static class and namespace to plain ES6 exports --- types/proxy-verifier/index.d.ts | 93 ++++++++++++++++++++ types/proxy-verifier/proxy-verifier-tests.ts | 42 +++++++++ types/proxy-verifier/tsconfig.json | 23 +++++ types/proxy-verifier/tslint.json | 1 + 4 files changed, 159 insertions(+) create mode 100644 types/proxy-verifier/index.d.ts create mode 100644 types/proxy-verifier/proxy-verifier-tests.ts create mode 100644 types/proxy-verifier/tsconfig.json create mode 100644 types/proxy-verifier/tslint.json diff --git a/types/proxy-verifier/index.d.ts b/types/proxy-verifier/index.d.ts new file mode 100644 index 0000000000..45fde96038 --- /dev/null +++ b/types/proxy-verifier/index.d.ts @@ -0,0 +1,93 @@ +// Type definitions for proxy-verifier 0.4 +// Project: https://github.com/chill117/proxy-verifier#readme +// Definitions by: BehindTheMath +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { CoreOptions as RequestOptions } from "request"; + +export function testAll(proxy: Proxy, options: RequestOptions, cb: (error: any, result: AllResults) => void): void; +export function testAll(proxy: Proxy, cb: (error: any, result: AllResults) => void): void; + +export function testProtocol(proxy: Proxy, options: RequestOptions, cb: (error: any, result: Result) => void): void; +export function testProtocol(proxy: Proxy, cb: (error: any, result: Result) => void): void; + +export function testProtocols(proxy: Proxy, options: RequestOptions, cb: (error: any, result: ProtocolResult) => void): void; +export function testProtocols(proxy: Proxy, cb: (error: any, result: ProtocolResult) => void): void; + +export function testAnonymityLevel(proxy: Proxy, options: RequestOptions, cb: (error: any, result: string) => void): void; +export function testAnonymityLevel(proxy: Proxy, cb: (error: any, result: string) => void): void; + +export function testTunnel(proxy: Proxy, options: RequestOptions, cb: (error: any, result: Result) => void): void; +export function testTunnel(proxy: Proxy, cb: (error: any, result: Result) => void): void; + +export function test(proxy: Proxy, options: TestOptions, cb: (error: any, result: CustomTestResult) => void): void; +export function test(proxy: Proxy, cb: (error: any, result: CustomTestResult) => void): void; + +export interface Proxy { + ipAddress: string; + port: number; + /** + * Proxy-Authorization header + */ + auth?: string; + protocol?: Protocol; + protocols?: Protocol[]; +} + +export type Protocol = "http" | "https" | "socks5" | "socks4"; + +export type AnonymityLevel = "transparent" | "anonymous" | "elite"; + +export interface AllResults { + anonymityLevel?: AnonymityLevel; + protocols?: ProtocolResult; + tunnel?: Result; +} + +export type Result = WorkingResult | NotWorkingResult; + +export interface WorkingResult { + ok: true; +} + +export interface NotWorkingResult { + ok: false; + error: { + message: string; + code: string; + }; +} + +export interface ProtocolResult { + [key: string]: Result; +} + +export interface TestOptions { + testUrl: string; + testFn(data: string, status: number, headers: Headers): void; +} + +export interface Headers { + [key: string]: string; +} + +export interface CustomTestBaseResult { + data: string; + status: number; + headers: Headers; +} + +export type CustomTestResult = CustomTestWorkingResult | CustomTestNotWorkingResult; + +export interface CustomTestWorkingResult extends CustomTestBaseResult { + ok: true; +} + +export interface CustomTestNotWorkingResult extends CustomTestBaseResult { + ok: false; + error: { + message: string; + code: string; + }; +} diff --git a/types/proxy-verifier/proxy-verifier-tests.ts b/types/proxy-verifier/proxy-verifier-tests.ts new file mode 100644 index 0000000000..4c019ffc4c --- /dev/null +++ b/types/proxy-verifier/proxy-verifier-tests.ts @@ -0,0 +1,42 @@ +import * as ProxyVerifier from "proxy-verifier"; + +const proxy: ProxyVerifier.Proxy = { + ipAddress: "123.123.123.123", + port: 8080, + auth: "test", + protocol: "socks5", + protocols: [ "socks5", "https" ] +}; + +const requestOptions = { + method: "GET" +}; + +const testOptions = { + testUrl: "www.example.com", + testFn: (data: string, status: number, headers: ProxyVerifier.Headers) => {} +}; + +function cb(error: any, result: string | ProxyVerifier.Result | ProxyVerifier.ProtocolResult | ProxyVerifier.CustomTestResult | ProxyVerifier.AllResults) { + if (error) console.error(error); + + console.log(result); +} + +ProxyVerifier.testAll(proxy, requestOptions, cb); +ProxyVerifier.testAll(proxy, requestOptions, cb); + +ProxyVerifier.testProtocol(proxy, requestOptions, cb); +ProxyVerifier.testProtocol(proxy, requestOptions, cb); + +ProxyVerifier.testProtocols(proxy, requestOptions, cb); +ProxyVerifier.testProtocols(proxy, requestOptions, cb); + +ProxyVerifier.testAnonymityLevel(proxy, requestOptions, cb); +ProxyVerifier.testAnonymityLevel(proxy, requestOptions, cb); + +ProxyVerifier.testTunnel(proxy, requestOptions, cb); +ProxyVerifier.testTunnel(proxy, requestOptions, cb); + +ProxyVerifier.test(proxy, testOptions, cb); +ProxyVerifier.test(proxy, testOptions, cb); diff --git a/types/proxy-verifier/tsconfig.json b/types/proxy-verifier/tsconfig.json new file mode 100644 index 0000000000..3ba1a15b15 --- /dev/null +++ b/types/proxy-verifier/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "proxy-verifier-tests.ts" + ] +} diff --git a/types/proxy-verifier/tslint.json b/types/proxy-verifier/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/proxy-verifier/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 39d211b878ebf98de648da1f301c49dcf656dd25 Mon Sep 17 00:00:00 2001 From: BehindTheMath Date: Wed, 25 Apr 2018 15:08:37 -0400 Subject: [PATCH 0891/2153] [proxy-lists] Add types for proxy-lists (#25267) * [proxy-lists] Add types for proxy-lists * Change minimum TS version These definitions depends on request, which has a minimum TS version of 2.3. * Refactor static class and namespace to plain ES6 exports --- types/proxy-lists/index.d.ts | 70 ++++++++++++++++++++++++++ types/proxy-lists/proxy-lists-tests.ts | 55 ++++++++++++++++++++ types/proxy-lists/tsconfig.json | 23 +++++++++ types/proxy-lists/tslint.json | 1 + 4 files changed, 149 insertions(+) create mode 100644 types/proxy-lists/index.d.ts create mode 100644 types/proxy-lists/proxy-lists-tests.ts create mode 100644 types/proxy-lists/tsconfig.json create mode 100644 types/proxy-lists/tslint.json diff --git a/types/proxy-lists/index.d.ts b/types/proxy-lists/index.d.ts new file mode 100644 index 0000000000..c0b223bb60 --- /dev/null +++ b/types/proxy-lists/index.d.ts @@ -0,0 +1,70 @@ +// Type definitions for proxy-lists 1.14 +// Project: https://github.com/chill117/proxy-lists#readme +// Definitions by: BehindTheMath +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { CoreOptions as RequestOptions } from "request"; +import { EventEmitter } from "events"; + +export function getProxies(options?: Partial): GetProxiesEventEmitter; + +export function getProxiesFromSource(name: string, options?: Options): GetProxiesEventEmitter; + +export function addSource(name: string, source: AddSource): void; + +export function listSources(options?: ListSourcesOptions): Source[]; + +export class GetProxiesEventEmitter extends EventEmitter { + on(event: "data", listener: (proxies: Proxy[]) => void): this; + on(event: "error", listener: (error: any) => void): this; + on(event: "end", listener: () => void): this; +} + +export interface Options { + filterMode?: "strict" | "loose"; + countries?: string[]; + countriesBlackList?: string[]; + protocols?: Protocol[]; + anonymityLevels?: AnonymityLevel[]; + sourcesWhiteList?: string[]; + sourcesBlackList?: string[]; + series?: boolean; + ipTypes?: IPType[]; + defaultRequestOptions?: RequestOptions; +} + +export type Protocol = "http" | "https" | "socks5" | "socks4"; + +export type AnonymityLevel = "transparent" | "anonymous" | "elite"; + +export type IPType = "ipv4" | "ipv6"; + +export interface Proxy { + ipAddress: string; + port: number; + country: string; + anonymityLevel?: AnonymityLevel; + protocols?: Protocol[]; + source: string; + tunnel?: boolean; +} + +export interface InternalOptions extends Options { + sample?: boolean; +} + +export interface AddSource { + homeUrl: string; + getProxies(options: InternalOptions): GetProxiesEventEmitter; +} + +export interface ListSourcesOptions { + sourcesWhiteList?: string[]; + sourcesBlackList?: string[]; +} + +export interface Source { + name: string; + homeUrl: string; +} diff --git a/types/proxy-lists/proxy-lists-tests.ts b/types/proxy-lists/proxy-lists-tests.ts new file mode 100644 index 0000000000..132aa431e4 --- /dev/null +++ b/types/proxy-lists/proxy-lists-tests.ts @@ -0,0 +1,55 @@ +import * as ProxyLists from "proxy-lists"; +import { EventEmitter } from "events"; + +const options: ProxyLists.Options = { + filterMode: 'strict', + countries: ['us', 'ca'], + countriesBlackList: ['de', 'gb'], + protocols: ['http', 'https'], + anonymityLevels: ['anonymous', 'elite'], + sourcesWhiteList: ['freeproxylists'], + sourcesBlackList: ['freeproxylists'], + series: false, + ipTypes: ['ipv4'], + defaultRequestOptions: { + method: "GET" + } +}; + +// `gettingProxies` is an event emitter object. +let gettingProxies: ProxyLists.GetProxiesEventEmitter = ProxyLists.getProxies(options); + +gettingProxies.on('data', proxies => { + // Received some proxies. +}); + +gettingProxies.on('error', error => { + // Some error has occurred. + console.error(error); +}); + +gettingProxies.once('end', () => { + // Done getting proxies. +}); + +gettingProxies = ProxyLists.getProxiesFromSource('freeproxylists', options); + +gettingProxies.on('data', proxies => { + // Received some proxies. +}); + +const source: ProxyLists.AddSource = { + homeUrl: 'www.example.com', + getProxies: (options: ProxyLists.InternalOptions) => { + return new EventEmitter(); + } +}; + +ProxyLists.addSource('testSource', source); + +const listSourcesOptions: ProxyLists.ListSourcesOptions = { + sourcesWhiteList: ['freeproxylists'], + sourcesBlackList: ['freeproxylists'] +}; + +ProxyLists.listSources(listSourcesOptions).forEach(source => console.log(source.name, source.homeUrl)); diff --git a/types/proxy-lists/tsconfig.json b/types/proxy-lists/tsconfig.json new file mode 100644 index 0000000000..b632be67c9 --- /dev/null +++ b/types/proxy-lists/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "proxy-lists-tests.ts" + ] +} diff --git a/types/proxy-lists/tslint.json b/types/proxy-lists/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/proxy-lists/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 10014f262547903fda7ef72ba72359c77f78df99 Mon Sep 17 00:00:00 2001 From: chanakadrathnayaka Date: Thu, 26 Apr 2018 00:45:52 +0530 Subject: [PATCH 0892/2153] Typescript definition for leaflet-routing-machine (#25249) * Leaflet routing machine typing definition implementation :: Tested * strictFunctionTypes set true * Added typescript version * Issue fixes * Issue fixes * Issue fixes * Issue fixes * Issue fixes * Issue fixes --- types/leaflet-routing-machine/index.d.ts | 270 ++++++++++++++++++ .../leaflet-routing-machine-tests.ts | 15 + types/leaflet-routing-machine/tsconfig.json | 24 ++ types/leaflet-routing-machine/tslint.json | 3 + 4 files changed, 312 insertions(+) create mode 100644 types/leaflet-routing-machine/index.d.ts create mode 100644 types/leaflet-routing-machine/leaflet-routing-machine-tests.ts create mode 100644 types/leaflet-routing-machine/tsconfig.json create mode 100644 types/leaflet-routing-machine/tslint.json diff --git a/types/leaflet-routing-machine/index.d.ts b/types/leaflet-routing-machine/index.d.ts new file mode 100644 index 0000000000..16da37f7c5 --- /dev/null +++ b/types/leaflet-routing-machine/index.d.ts @@ -0,0 +1,270 @@ +// Type definitions for leaflet-routing-machine 3.2 +// Project: https://github.com/perliedman/leaflet-routing-machine#readme +// Definitions by: Chanaka Rathnayaka +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +import * as L from 'leaflet'; + +declare module 'leaflet' { + namespace Routing { + class Control extends Itinerary { + constructor(options?: RoutingControlOptions); + getWaypoints(): Waypoint[]; + setWaypoints(waypoints: Waypoint[] | LatLng[]): this; + spliceWaypoints(index: number, waypointsToRemove: number, ...wayPoints: Waypoint[]): Waypoint[]; + getPlan(): Plan; + getRouter(): IRouter; + route(): void; + on(type: string, fn: (event: any) => void, context?: any): this; + } + + interface RoutingControlOptions extends ItineraryOptions { + waypoints?: Waypoint[] | LatLng[]; + router?: IRouter; + plan?: Plan; + geocoder?: any; // IGeocorder is from other library; + fitSelectedRoutes?: 'smart' | boolean; + lineOptions?: LineOptions; + routeLine?: (route: IRoute, options: LineOptions) => Line; + autoRoute?: boolean; + routeWhileDragging?: boolean; + routeDragInterval?: number; + waypointMode?: string; + useZoomParameter?: boolean; + showAlternatives?: boolean; + altLineOptions?: LineOptions; + } + + class Itinerary extends L.Control { + constructor(options: ItineraryOptions); + setAlternatives(routes: IRoute[]): any; + show(): void; + hide(): void; + } + + interface ItineraryOptions { + pointMarkerStyle?: PathOptions; + summaryTemplate?: string; + distanceTemplate?: string; + timeTemplate?: string; + containerClassName?: string; + alternativeClassName?: string; + minimizedClassName?: string; + itineraryClassName?: string; + show?: boolean; + formatter?: Formatter; + itineraryFormatter?: ItineraryBuilder; + collapsible?: boolean; + collapseBtn?: (itinerary: Itinerary) => void; + collapseBtnClass?: string; + totalDistanceRoundingSensitivity?: number; + } + + class Plan extends Layer { + constructor(waypoints: Waypoint[] | LatLng[], options?: PlanOptions); + isReady(): boolean; + getWaypoints(): Waypoint[]; + setWaypoints(waypoints: Waypoint[] | LatLng[]): any; + spliceWaypoints(index: number, waypointsToRemove: number, ...wayPoints: Waypoint[]): Waypoint[]; + createGeocoders(): any; + } + + interface PlanOptions { + geocoder?: any; // IGeocoder + addWaypoints?: boolean; + draggableWaypoints?: boolean; + dragStyles?: PathOptions[]; + maxGeocoderTolerance?: number; + geocoderPlaceholder?: (waypointIndex: number, numberWaypoints: number) => string; + geocodersClassName?: string; + geocoderClass?: (waypointIndex: number, numberWaypoints: number) => void; + waypointNameFallback?: (latLng: LatLng) => string; + createGeocoder?: (waypointIndex: number, numberWaypoints: number, plan: Plan) => {}; + addButtonClassName?: string; + createMarker?: (waypointIndex: number, waypoint: Waypoint, numberWaypoints: number) => Marker; + routeWhileDragging?: boolean; + reverseWaypoints?: boolean; + } + + class Line extends LayerGroup { + constructor(route: IRoute, options?: LineOptions); + getBounds(): LatLngBounds; + } + + interface LineOptions { + styles?: PathOptions[]; + missingRouteStyles?: PathOptions[]; + addWaypoints?: boolean; + } + + class OSRMv1 implements IRouter { + constructor(options?: OSRMOptions); + + route(waypoints: Waypoint[], callback: (args?: any) => void, context?: {}, options?: RoutingOptions): void ; + buildRouteUrl(waypoints: Waypoint[], options: RoutingOptions): string; + } + + interface OSRMOptions { + serviceUrl?: string; + timeout?: number; + profile?: string; + polylinePrecision?: number; + useHints?: boolean; + } + + class Formatter { + constructor(options?: FormatterOptions); + formatDistance(d: number, precision?: number): string; + formatTime(t: number): string; + formatInstruction(instruction: IInstruction): string; + } + + interface FormatterOptions { + language?: string; + units?: string; + roundingSensitivity?: number; + unitNames?: {}; + } + + class ItineraryBuilder { + constructor(); + createContainer(className: string): HTMLElement; + createStepsContainer(container: HTMLElement): void; + createStep(text: string, distance: string, steps: HTMLElement): void; + } + + class Localization { + constructor(lang: string); + localize(text: string): string; + } + + interface Waypoint { + latLng: LatLng; + name?: string; + options?: WaypointOptions; + } + + interface WaypointOptions { + allowUTurn?: boolean; + } + + // Event Objects + + interface RoutingEvent { + waypoints: Waypoint[]; + } + + interface RoutingResultEvent { + waypoints: Waypoint[]; + routes: IRoute[]; + } + + interface RoutingErrorEvent { + error: IError; + } + + interface RouteSelectedEvent { + route: IRoute; + } + + interface WaypointsSplicedEvent { + index: number; + nRemoved: number; + added: Waypoint[]; + } + + interface LineTouchedEvent { + afterIndex: number; + latlng: number; + } + + interface GeocodingEvent { + waypointIndex: number; + waypoint: Waypoint; + } + + // Interfaces + interface RoutingOptions { + z: number; + allowUTurns: boolean; + geometryOnly: boolean; + fileFormat: string; + } + + // tslint:disable-next-line interface-name + interface IRouter { + route(waypoints: Waypoint[], callback: (error?: IError, routes?: IRoute[]) => any, context?: {}, options?: RoutingOptions): void; + } + + // tslint:disable-next-line interface-name + interface IRoute { + name?: string; + summary?: IRouteSummary; + coordinates?: LatLng[]; + waypoints?: LatLng[]; + instructions?: IInstruction[]; + } + + // tslint:disable-next-line interface-name + interface IRouteSummary { + totalTime: number; + totalDistance: number; + } + + // tslint:disable-next-line interface-name + interface IInstruction { + distance: number; + time: number; + text?: number; + type?: 'Straight' | 'SlightRight' | 'Right' | 'SharpRight' | 'TurnAround' | 'SharpLeft' | 'Left' | 'SlightLeft' | 'WaypointReached' | + 'Roundabout' | 'StartAt' | 'DestinationReached' | 'EnterAgainstAllowedDirection' | 'LeaveAgainstAllowedDirection'; + road?: string; + direction?: string; + exit?: number; + } + + // tslint:disable-next-line interface-name + interface IGeocoderElement { + container: HTMLElement; + input: HTMLElement; + closeButton: HTMLElement; + } + + // tslint:disable-next-line interface-name + interface IError { + status: string | number; + message: string; + } + + function control(options?: RoutingControlOptions): Control; + + function itinerary(options?: ItineraryOptions): Itinerary; + + function line(route: IRoute, options?: LineOptions): Line; + + function plan(waypoints: Waypoint[] | LatLng[], options?: PlanOptions): Plan; + + function osrmv1(options?: OSRMOptions): OSRMv1; + + function formatter(options?: FormatterOptions): Formatter; + + function waypoint(latLng: LatLng, name?: string, options?: WaypointOptions): Waypoint; + } + + namespace routing { + function control(options?: Routing.RoutingControlOptions): Routing.Control; + + function itinerary(options?: Routing.ItineraryOptions): Routing.Itinerary; + + function line(route: Routing.IRoute, options?: Routing.LineOptions): Routing.Line; + + function plan(waypoints: Routing.Waypoint[] | LatLng[], options?: Routing.PlanOptions): Routing.Plan; + + function osrmv1(options?: Routing.OSRMOptions): Routing.OSRMv1; + + function formatter(options?: Routing.FormatterOptions): Routing.Formatter; + + function waypoint(latLng: LatLng, name?: string, options?: Routing.WaypointOptions): Routing.Waypoint; + } +} diff --git a/types/leaflet-routing-machine/leaflet-routing-machine-tests.ts b/types/leaflet-routing-machine/leaflet-routing-machine-tests.ts new file mode 100644 index 0000000000..ae159c2e3d --- /dev/null +++ b/types/leaflet-routing-machine/leaflet-routing-machine-tests.ts @@ -0,0 +1,15 @@ +import * as L from 'leaflet'; +import 'leaflet-routing-machine'; + +const map: L.Map = L.map('map-container'); + +L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { + attribution: '© OpenStreetMap contributors' +}).addTo(map); + +L.Routing.control({ + waypoints: [ + L.latLng(57.74, 11.94), + L.latLng(57.6792, 11.949) + ] +}).addTo(map); diff --git a/types/leaflet-routing-machine/tsconfig.json b/types/leaflet-routing-machine/tsconfig.json new file mode 100644 index 0000000000..424253020a --- /dev/null +++ b/types/leaflet-routing-machine/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "leaflet-routing-machine-tests.ts" + ] +} diff --git a/types/leaflet-routing-machine/tslint.json b/types/leaflet-routing-machine/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/leaflet-routing-machine/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 29f14089b27cfc0546af3c6191b73b46efe7184e Mon Sep 17 00:00:00 2001 From: Ben Wildeman Date: Wed, 25 Apr 2018 20:16:57 +0100 Subject: [PATCH 0893/2153] Expo: Added missing props to Svg (#25162) * Added missing props to Svg * Added space --- types/expo/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 8efbbd120d..c5beebd7f0 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -1876,6 +1876,7 @@ export interface SvgCommonProps { fill?: string; fillOpacity?: number | string; fillRule?: 'nonzero' | 'evenodd'; + opacity?: number | string; stroke?: string; strokeWidth?: number | string; strokeOpacity?: number | string; @@ -1986,7 +1987,7 @@ export interface SvgStopProps extends SvgCommonProps { stopOpacity?: string; } -export class Svg extends Component<{ width: number, height: number }> { +export class Svg extends Component<{ width: number, height: number, viewBox?: string }> { static Circle: ComponentClass; static ClipPath: ComponentClass; static Defs: ComponentClass; From 9bb37f03273d0a1c10b8b9b9e11622f52243192e Mon Sep 17 00:00:00 2001 From: Conan Date: Wed, 25 Apr 2018 15:18:31 -0400 Subject: [PATCH 0894/2153] [Joi] - add schema option to .when in v13.0.1 (#25175) * add schema option to .when * move changes to v13 * fix * add name --- types/joi/index.d.ts | 15 +++++++++++++++ types/joi/joi-tests.ts | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/types/joi/index.d.ts b/types/joi/index.d.ts index 2b6d264b3e..48e2a0327c 100644 --- a/types/joi/index.d.ts +++ b/types/joi/index.d.ts @@ -11,6 +11,7 @@ // Dan Kraus // Anjun Wang // Rafael Kallis +// Conan Lai // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -152,6 +153,17 @@ export interface WhenOptions { otherwise?: SchemaLike; } +export interface WhenSchemaOptions { + /** + * the alternative schema type if the condition is true. Required if otherwise is missing. + */ + then?: SchemaLike; + /** + * the alternative schema type if the condition is false. Required if then is missing + */ + otherwise?: SchemaLike; +} + export interface ReferenceOptions { separator?: string; contextPrefix?: string; @@ -347,6 +359,7 @@ export interface AnySchema extends JoiObject { */ when(ref: string, options: WhenOptions): AlternativesSchema; when(ref: Reference, options: WhenOptions): AlternativesSchema; + when(ref: Schema, options: WhenSchemaOptions): AlternativesSchema; /** * Overrides the key name in error messages. @@ -922,6 +935,7 @@ export interface AlternativesSchema extends AnySchema { try(...types: SchemaLike[]): this; when(ref: string, options: WhenOptions): this; when(ref: Reference, options: WhenOptions): this; + when(ref: Schema, options: WhenSchemaOptions): this; } export interface LazySchema extends AnySchema { @@ -1218,6 +1232,7 @@ export function concat(schema: T): T; */ export function when(ref: string, options: WhenOptions): AlternativesSchema; export function when(ref: Reference, options: WhenOptions): AlternativesSchema; +export function when(ref: Schema, options: WhenSchemaOptions): AlternativesSchema; /** * Overrides the key name in error messages. diff --git a/types/joi/joi-tests.ts b/types/joi/joi-tests.ts index 1ab3316eb8..5ea9088a74 100644 --- a/types/joi/joi-tests.ts +++ b/types/joi/joi-tests.ts @@ -128,6 +128,14 @@ whenOpts = { is: schemaLike, then: schemaLike, otherwise: schemaLike }; // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- +let whenSchemaOpts: Joi.WhenSchemaOptions = null; + +whenSchemaOpts = { then: schema }; +whenSchemaOpts = { otherwise: schema }; +whenSchemaOpts = { then: schemaLike, otherwise: schemaLike }; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + let refOpts: Joi.ReferenceOptions = null; refOpts = { separator: str }; @@ -276,6 +284,7 @@ namespace common { altSchema = anySchema.when(str, whenOpts); altSchema = anySchema.when(ref, whenOpts); + altSchema = anySchema.when(schema, whenSchemaOpts); anySchema = anySchema.label(str); anySchema = anySchema.raw(); @@ -363,6 +372,7 @@ namespace common_copy_paste { altSchema = arrSchema.when(str, whenOpts); altSchema = arrSchema.when(ref, whenOpts); + altSchema = arrSchema.when(schema, whenSchemaOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -433,6 +443,7 @@ namespace common_copy_paste { altSchema = boolSchema.when(str, whenOpts); altSchema = boolSchema.when(ref, whenOpts); + altSchema = boolSchema.when(schema, whenSchemaOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -489,6 +500,7 @@ namespace common { altSchema = binSchema.when(str, whenOpts); altSchema = binSchema.when(ref, whenOpts); + altSchema = binSchema.when(schema, whenSchemaOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -561,6 +573,7 @@ namespace common { altSchema = dateSchema.when(str, whenOpts); altSchema = dateSchema.when(ref, whenOpts); + altSchema = dateSchema.when(schema, whenSchemaOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -635,6 +648,7 @@ namespace common { altSchema = numSchema.when(str, whenOpts); altSchema = numSchema.when(ref, whenOpts); + altSchema = numSchema.when(schema, whenSchemaOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -749,6 +763,7 @@ namespace common { altSchema = objSchema.when(str, whenOpts); altSchema = objSchema.when(ref, whenOpts); + altSchema = objSchema.when(schema, whenSchemaOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -843,6 +858,7 @@ namespace common { altSchema = strSchema.when(str, whenOpts); altSchema = strSchema.when(ref, whenOpts); + altSchema = strSchema.when(schema, whenSchemaOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -1049,6 +1065,7 @@ schema = Joi.concat(x); schema = Joi.when(str, whenOpts); schema = Joi.when(ref, whenOpts); +schema = Joi.when(schema, whenSchemaOpts); schema = Joi.label(str); schema = Joi.raw(); @@ -1102,6 +1119,7 @@ schema = Joi.concat(x); schema = Joi.when(str, whenOpts); schema = Joi.when(ref, whenOpts); +schema = Joi.when(schema, whenSchemaOpts); schema = Joi.label(str); schema = Joi.raw(); From e7c97142be9ca8e8af1a014a367a44430ade7ee6 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 25 Apr 2018 15:30:16 -0700 Subject: [PATCH 0895/2153] Add 'travis-fold' (#25305) --- types/travis-fold/index.d.ts | 11 +++++++++++ types/travis-fold/travis-fold-tests.ts | 12 ++++++++++++ types/travis-fold/tsconfig.json | 23 +++++++++++++++++++++++ types/travis-fold/tslint.json | 1 + 4 files changed, 47 insertions(+) create mode 100644 types/travis-fold/index.d.ts create mode 100644 types/travis-fold/travis-fold-tests.ts create mode 100644 types/travis-fold/tsconfig.json create mode 100644 types/travis-fold/tslint.json diff --git a/types/travis-fold/index.d.ts b/types/travis-fold/index.d.ts new file mode 100644 index 0000000000..710024ab97 --- /dev/null +++ b/types/travis-fold/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for travis-fold 0.1 +// Project: https://github.com/macbre/travis-fold +// Definitions by: Andy Hanson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function start(group: string): string; +export function end(group: string): string; +export function wrap(group: string, content: string): string; +export function pushStart(ret: string[], group: string): void; +export function pushEnd(ret: string[], group: string): void; +export function isTravis(): boolean; diff --git a/types/travis-fold/travis-fold-tests.ts b/types/travis-fold/travis-fold-tests.ts new file mode 100644 index 0000000000..a9d499c3fc --- /dev/null +++ b/types/travis-fold/travis-fold-tests.ts @@ -0,0 +1,12 @@ +import { end, isTravis, pushEnd, pushStart, start } from "travis-fold"; + +const out: string[] = []; +pushStart(out, 'fold'); +pushEnd(out, 'fold'); + +out.join('\n').trim(); // $ExpectType string + +if (isTravis()) { + start("s"); // $ExpectType string + end("e"); // $ExpectType string +} diff --git a/types/travis-fold/tsconfig.json b/types/travis-fold/tsconfig.json new file mode 100644 index 0000000000..9d50a3f5ac --- /dev/null +++ b/types/travis-fold/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "travis-fold-tests.ts" + ] +} \ No newline at end of file diff --git a/types/travis-fold/tslint.json b/types/travis-fold/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/travis-fold/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From bffb03282272b37ccb12429026f4504a39a3cd83 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 24 Apr 2018 14:14:30 -0700 Subject: [PATCH 0896/2153] Add new types for node v10.0.0 --- types/node/index.d.ts | 648 ++- types/node/v9/index.d.ts | 7215 ++++++++++++++++++++++++++++++++++ types/node/v9/inspector.d.ts | 2488 ++++++++++++ types/node/v9/node-tests.ts | 4010 +++++++++++++++++++ types/node/v9/tsconfig.json | 29 + types/node/v9/tslint.json | 26 + 6 files changed, 14377 insertions(+), 39 deletions(-) create mode 100644 types/node/v9/index.d.ts create mode 100644 types/node/v9/inspector.d.ts create mode 100644 types/node/v9/node-tests.ts create mode 100644 types/node/v9/tsconfig.json create mode 100644 types/node/v9/tslint.json diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 50a17ddb76..0eeb696a4e 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Node.js 9.6.x +// Type definitions for Node.js 10.0.x // Project: http://nodejs.org/ // Definitions by: Microsoft TypeScript // DefinitelyTyped @@ -42,6 +42,7 @@ interface Console { timeEnd(label: string): void; trace(message?: any, ...optionalParams: any[]): void; warn(message?: any, ...optionalParams: any[]): void; + table(tabularData: any, properties?: string[]): void; } interface Error { @@ -77,8 +78,10 @@ interface Iterator { next(value?: any): IteratorResult; } interface IteratorResult { } +interface AsyncIterableIterator {} interface SymbolConstructor { readonly iterator: symbol; + readonly asyncIterator: symbol; } declare var Symbol: SymbolConstructor; @@ -185,18 +188,21 @@ declare var Buffer: { * * @param str String to store in buffer. * @param encoding encoding to use, optional. Default is 'utf8' + * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. */ new(str: string, encoding?: string): Buffer; /** * Allocates a new buffer of {size} octets. * * @param size count of octets to allocate. + * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). */ new(size: number): Buffer; /** * Allocates a new buffer containing the given {array} of octets. * * @param array The octets to store. + * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. */ new(array: Uint8Array): Buffer; /** @@ -205,18 +211,21 @@ declare var Buffer: { * * * @param arrayBuffer The ArrayBuffer with which to share memory. + * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. */ new(arrayBuffer: ArrayBuffer): Buffer; /** * Allocates a new buffer containing the given {array} of octets. * * @param array The octets to store. + * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. */ new(array: any[]): Buffer; /** * Copies the passed {buffer} data onto a new {Buffer} instance. * * @param buffer The buffer to copy. + * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead. */ new(buffer: Buffer): Buffer; prototype: Buffer; @@ -252,7 +261,7 @@ declare var Buffer: { * * @param encoding string to test. */ - isEncoding(encoding: string): boolean; + isEncoding(encoding: string): boolean | undefined; /** * Gives the actual byte length of a string. encoding defaults to 'utf8'. * This is not the same as String.prototype.length since that returns the number of characters in a string. @@ -439,6 +448,7 @@ declare namespace NodeJS { unshift(chunk: string): void; unshift(chunk: Buffer): void; wrap(oldStream: ReadableStream): this; + [Symbol.asyncIterator](): AsyncIterableIterator; } export interface WritableStream extends EventEmitter { @@ -2367,40 +2377,44 @@ declare module "url" { unicode?: boolean; } - export class URLSearchParams implements Iterable<[string, string]> { - constructor(init?: URLSearchParams | string | { [key: string]: string | string[] | undefined } | Iterable<[string, string]> | Array<[string, string]>); - append(name: string, value: string): void; - delete(name: string): void; - entries(): IterableIterator<[string, string]>; - forEach(callback: (value: string, name: string) => void): void; - get(name: string): string | null; - getAll(name: string): string[]; - has(name: string): boolean; - keys(): IterableIterator; - set(name: string, value: string): void; - sort(): void; - toString(): string; - values(): IterableIterator; - [Symbol.iterator](): IterableIterator<[string, string]>; + global { + class URL { + constructor(input: string, base?: string | URL); + hash: string; + host: string; + hostname: string; + href: string; + readonly origin: string; + password: string; + pathname: string; + port: string; + protocol: string; + search: string; + readonly searchParams: URLSearchParams; + username: string; + toString(): string; + toJSON(): string; + } + + class URLSearchParams implements Iterable<[string, string]> { + constructor(init?: URLSearchParams | string | { [key: string]: string | string[] | undefined } | Iterable<[string, string]> | Array<[string, string]>); + append(name: string, value: string): void; + delete(name: string): void; + entries(): IterableIterator<[string, string]>; + forEach(callback: (value: string, name: string) => void): void; + get(name: string): string | null; + getAll(name: string): string[]; + has(name: string): boolean; + keys(): IterableIterator; + set(name: string, value: string): void; + sort(): void; + toString(): string; + values(): IterableIterator; + [Symbol.iterator](): IterableIterator<[string, string]>; + } } - export class URL { - constructor(input: string, base?: string | URL); - hash: string; - host: string; - hostname: string; - href: string; - readonly origin: string; - password: string; - pathname: string; - port: string; - protocol: string; - search: string; - readonly searchParams: URLSearchParams; - username: string; - toString(): string; - toJSON(): string; - } + export { URL, URLSearchParams }; } declare module "dns" { @@ -4571,6 +4585,482 @@ declare module "fs" { export function copyFileSync(src: PathLike, dest: PathLike, flags?: number): void; } +declare module "fs/promises" { + import { PathLike, Stats } from "fs"; + interface FileHandle { + /** + * Gets the file descriptor for this file handle. + */ + readonly fd: number; + + /** + * Asynchronously append data to a file, creating the file if it does not exist. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for appending. + * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + appendFile(data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise; + + /** + * Asynchronous fchown(2) - Change ownership of a file. + */ + chown(uid: number, gid: number): Promise; + + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + chmod(mode: string | number): Promise; + + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + */ + datasync(): Promise; + + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + */ + sync(): Promise; + + /** + * Asynchronously reads data from the file. + * The `FileHandle` must have been opened for reading. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + read(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesRead: number, buffer: TBuffer }>; + + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile(options?: { encoding?: null, flag?: string | number } | null): Promise; + + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile(options: { encoding: BufferEncoding, flag?: string | number } | BufferEncoding): Promise; + + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile(options?: { encoding?: string | null, flag?: string | number } | string | null): Promise; + + /** + * Asynchronous fstat(2) - Get file status. + */ + stat(): Promise; + + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param len If not specified, defaults to `0`. + */ + truncate(len?: number): Promise; + + /** + * Asynchronously change file timestamps of the file. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + utimes(atime: string | number | Date, mtime: string | number | Date): Promise; + + /** + * Asynchronously writes `buffer` to the file. + * The `FileHandle` must have been opened for writing. + * @param buffer The buffer that the data will be written to. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + write(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>; + + /** + * Asynchronously writes `string` to the file. + * The `FileHandle` must have been opened for writing. + * It is unsafe to call `write()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + write(data: any, position?: number | null, encoding?: string | null): Promise<{ bytesWritten: number, buffer: string }>; + + /** + * Asynchronously writes data to a file, replacing the file if it already exists. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for writing. + * It is unsafe to call `writeFile()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). + * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + writeFile(data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise; + + /** + * Asynchronous close(2) - close a `FileHandle`. + */ + close(): Promise; + } + + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function access(path: PathLike, mode?: number): Promise; + + /** + * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it already exists. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + * @param flags An optional integer that specifies the behavior of the copy operation. The only + * supported flag is `fs.constants.COPYFILE_EXCL`, which causes the copy operation to fail if + * `dest` already exists. + */ + function copyFile(src: PathLike, dest: PathLike, flags?: number): Promise; + + /** + * Asynchronous open(2) - open and possibly create a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not + * supplied, defaults to `0o666`. + */ + function open(path: PathLike, flags: string | number, mode?: string | number): Promise; + + /** + * Asynchronously reads data from the file referenced by the supplied `FileHandle`. + * @param handle A `FileHandle`. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If + * `null`, data will be read from the current position. + */ + function read(handle: FileHandle, buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesRead: number, buffer: TBuffer }>; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied `FileHandle`. + * It is unsafe to call `fsPromises.write()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended. + * @param handle A `FileHandle`. + * @param buffer The buffer that the data will be written to. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + function write(handle: FileHandle, buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>; + + /** + * Asynchronously writes `string` to the file referenced by the supplied `FileHandle`. + * It is unsafe to call `fsPromises.write()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended. + * @param handle A `FileHandle`. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + function write(handle: FileHandle, string: any, position?: number | null, encoding?: string | null): Promise<{ bytesWritten: number, buffer: string }>; + + /** + * Asynchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function rename(oldPath: PathLike, newPath: PathLike): Promise; + + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + function truncate(path: PathLike, len?: number): Promise; + + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param handle A `FileHandle`. + * @param len If not specified, defaults to `0`. + */ + function ftruncate(handle: FileHandle, len?: number): Promise; + + /** + * Asynchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function rmdir(path: PathLike): Promise; + + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param handle A `FileHandle`. + */ + function fdatasync(handle: FileHandle): Promise; + + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param handle A `FileHandle`. + */ + function fsync(handle: FileHandle): Promise; + + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdir(path: PathLike, mode?: string | number): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + function symlink(target: PathLike, path: PathLike, type?: string | null): Promise; + + /** + * Asynchronous fstat(2) - Get file status. + * @param handle A `FileHandle`. + */ + function fstat(handle: FileHandle): Promise; + + /** + * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function lstat(path: PathLike): Promise; + + /** + * Asynchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function stat(path: PathLike): Promise; + + /** + * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function link(existingPath: PathLike, newPath: PathLike): Promise; + + /** + * Asynchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function unlink(path: PathLike): Promise; + + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param handle A `FileHandle`. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function fchmod(handle: FileHandle, mode: string | number): Promise; + + /** + * Asynchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function chmod(path: PathLike, mode: string | number): Promise; + + /** + * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function lchmod(path: PathLike, mode: string | number): Promise; + + /** + * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function lchown(path: PathLike, uid: number, gid: number): Promise; + + /** + * Asynchronous fchown(2) - Change ownership of a file. + * @param handle A `FileHandle`. + */ + function fchown(handle: FileHandle, uid: number, gid: number): Promise; + + /** + * Asynchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function chown(path: PathLike, uid: number, gid: number): Promise; + + /** + * Asynchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise; + + /** + * Asynchronously change file timestamps of the file referenced by the supplied `FileHandle`. + * @param handle A `FileHandle`. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function futimes(handle: FileHandle, atime: string | number | Date, mtime: string | number | Date): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options?: { encoding?: string | null } | string | null): Promise; + + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * It is unsafe to call `fsPromises.writeFile()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + function writeFile(path: PathLike | FileHandle, data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise; + + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + function appendFile(path: PathLike | FileHandle, data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile(path: PathLike | FileHandle, options?: { encoding?: null, flag?: string | number } | null): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile(path: PathLike | FileHandle, options: { encoding: BufferEncoding, flag?: string | number } | BufferEncoding): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile(path: PathLike | FileHandle, options?: { encoding?: string | null, flag?: string | number } | string | null): Promise; +} + declare module "path" { /** * A parsed path object generated by path.parse() or consumed by path.format(). @@ -5131,6 +5621,7 @@ declare module "crypto" { (): Certificate; }; + /** @deprecated since v10.0.0 */ export var fips: boolean; export interface CredentialDetails { @@ -5279,6 +5770,7 @@ declare module "crypto" { } export function createECDH(curve_name: string): ECDH; export function timingSafeEqual(a: Buffer, b: Buffer): boolean; + /** @deprecated since v10.0.0 */ export var DEFAULT_ENCODING: string; } @@ -5375,6 +5867,8 @@ declare module "stream" { removeListener(event: "end", listener: () => void): this; removeListener(event: "readable", listener: () => void): this; removeListener(event: "error", listener: (err: Error) => void): this; + + [Symbol.asyncIterator](): AsyncIterableIterator; } export interface WritableOptions { @@ -5511,6 +6005,21 @@ declare module "stream" { } export class PassThrough extends Transform { } + + export function pipeline(stream1: NodeJS.ReadableStream, stream2: T, callback?: (err: NodeJS.ErrnoException) => void): T; + export function pipeline(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: T, callback?: (err: NodeJS.ErrnoException) => void): T; + export function pipeline(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.ReadWriteStream, stream4: T, callback?: (err: NodeJS.ErrnoException) => void): T; + export function pipeline(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.ReadWriteStream, stream4: NodeJS.ReadWriteStream, stream5: T, callback?: (err: NodeJS.ErrnoException) => void): T; + export function pipeline(streams: Array, callback?: (err: NodeJS.ErrnoException) => void): NodeJS.WritableStream; + export function pipeline(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, ...streams: Array void)>): NodeJS.WritableStream; + export namespace pipeline { + export function __promisify__(stream1: NodeJS.ReadableStream, stream2: T): Promise; + export function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: T): Promise; + export function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.ReadWriteStream, stream4: T): Promise; + export function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.ReadWriteStream, stream4: NodeJS.ReadWriteStream, stream5: T): Promise; + export function __promisify__(streams: Array): Promise; + export function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, ...streams: Array): Promise; + } } export = internal; @@ -5519,10 +6028,15 @@ declare module "stream" { declare module "util" { export interface InspectOptions extends NodeJS.InspectOptions { } export function format(format: any, ...param: any[]): string; + /** @deprecated since v0.11.3 - use `console.error()` instead. */ export function debug(string: string): void; + /** @deprecated since v0.11.3 - use `console.error()` instead. */ export function error(...param: any[]): void; + /** @deprecated since v0.11.3 - use `console.log()` instead. */ export function puts(...param: any[]): void; + /** @deprecated since v0.11.3 - use `console.log()` instead. */ export function print(...param: any[]): void; + /** @deprecated since v0.11.3 - use a third party module instead. */ export function log(string: string): void; export var inspect: { (object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string; @@ -5536,22 +6050,37 @@ declare module "util" { defaultOptions: InspectOptions; custom: symbol; }; + /** @deprecated since v4.0.0 - use `Array.isArray()` instead. */ export function isArray(object: any): object is any[]; + /** @deprecated since v4.0.0 - use `util.types.isRegExp()` instead. */ export function isRegExp(object: any): object is RegExp; + /** @deprecated since v4.0.0 - use `util.types.isDate()` instead. */ export function isDate(object: any): object is Date; + /** @deprecated since v4.0.0 - use `util.types.isNativeError()` instead. */ export function isError(object: any): object is Error; export function inherits(constructor: any, superConstructor: any): void; export function debuglog(key: string): (msg: string, ...param: any[]) => void; + /** @deprecated since v4.0.0 - use `typeof value === 'boolean'` instead. */ export function isBoolean(object: any): object is boolean; + /** @deprecated since v4.0.0 - use `Buffer.isBuffer()` instead. */ export function isBuffer(object: any): object is Buffer; + /** @deprecated since v4.0.0 - use `typeof value === 'function'` instead. */ export function isFunction(object: any): boolean; + /** @deprecated since v4.0.0 - use `value === null` instead. */ export function isNull(object: any): object is null; + /** @deprecated since v4.0.0 - use `value === null || value === undefined` instead. */ export function isNullOrUndefined(object: any): object is null | undefined; + /** @deprecated since v4.0.0 - use `typeof value === 'number'` instead. */ export function isNumber(object: any): object is number; + /** @deprecated since v4.0.0 - use `value !== null && typeof value === 'object'` instead. */ export function isObject(object: any): boolean; + /** @deprecated since v4.0.0 - use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. */ export function isPrimitive(object: any): boolean; + /** @deprecated since v4.0.0 - use `typeof value === 'string'` instead. */ export function isString(object: any): object is string; + /** @deprecated since v4.0.0 - use `typeof value === 'symbol'` instead. */ export function isSymbol(object: any): object is symbol; + /** @deprecated since v4.0.0 - use `value === undefined` instead. */ export function isUndefined(object: any): object is undefined; export function deprecate(fn: T, message: string): T; @@ -5591,6 +6120,44 @@ declare module "util" { export namespace promisify { const custom: symbol; } + + export namespace types { + export function isAnyArrayBuffer(object: any): boolean; + export function isArgumentsObject(object: any): object is IArguments; + export function isArrayBuffer(object: any): object is ArrayBuffer; + export function isAsyncFunction(object: any): boolean; + export function isBooleanObject(object: any): object is Boolean; + export function isDataView(object: any): object is DataView; + export function isDate(object: any): object is Date; + export function isExternal(object: any): boolean; + export function isFloat32Array(object: any): object is Float32Array; + export function isFloat64Array(object: any): object is Float64Array; + export function isGeneratorFunction(object: any): boolean; + export function isGeneratorObject(object: any): boolean; + export function isInt8Array(object: any): object is Int8Array; + export function isInt16Array(object: any): object is Int16Array; + export function isInt32Array(object: any): object is Int32Array; + export function isMap(object: any): object is Map; + export function isMapIterator(object: any): boolean; + export function isNativeError(object: any): object is Error; + export function isNumberObject(object: any): object is Number; + export function isPromise(object: any): object is Promise; + export function isProxy(object: any): boolean; + export function isRegExp(object: any): object is RegExp; + export function isSet(object: any): object is Set; + export function isSetIterator(object: any): boolean; + export function isSharedArrayBuffer(object: any): boolean; + export function isStringObject(object: any): object is String; + export function isSymbolObject(object: any): object is Symbol; + export function isTypedArray(object: any): object is Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array; + export function isUint8Array(object: any): object is Uint8Array; + export function isUint8ClampedArray(object: any): object is Uint8ClampedArray; + export function isUint16Array(object: any): object is Uint16Array; + export function isUint32Array(object: any): object is Uint32Array; + export function isWeakMap(object: any): object is WeakMap; + export function isWeakSet(object: any): object is WeakSet; + export function isWebAssemblyCompiledModule(object: any): boolean; + } } declare module "assert" { @@ -5633,6 +6200,11 @@ declare module "assert" { export function doesNotThrow(block: Function, error: (err: any) => boolean, message?: string): void; export function ifError(value: any): void; + + export function rejects(block: Function | Promise, message?: string): Promise; + export function rejects(block: Function | Promise, error: Function | RegExp | Object | Error, message?: string): Promise; + export function doesNotReject(block: Function | Promise, message?: string): Promise; + export function doesNotReject(block: Function | Promise, error: Function | RegExp | Object | Error, message?: string): Promise; } export = internal; @@ -6014,15 +6586,11 @@ declare module "async_hooks" { * Returns the asyncId of the current execution context. */ export function executionAsyncId(): number; - /// @deprecated - replaced by executionAsyncId() - export function currentId(): number; /** * Returns the ID of the resource responsible for calling the callback that is currently being executed. */ export function triggerAsyncId(): number; - /// @deprecated - replaced by triggerAsyncId() - export function triggerId(): number; export interface HookCallbacks { /** @@ -6975,6 +7543,8 @@ declare module "http2" { } declare module "perf_hooks" { + import { AsyncResource } from "async_hooks"; + export interface PerformanceEntry { /** * The total number of milliseconds elapsed for this entry. @@ -7187,7 +7757,7 @@ declare module "perf_hooks" { export type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; - export class PerformanceObserver { + export class PerformanceObserver extends AsyncResource { constructor(callback: PerformanceObserverCallback); /** diff --git a/types/node/v9/index.d.ts b/types/node/v9/index.d.ts new file mode 100644 index 0000000000..50a17ddb76 --- /dev/null +++ b/types/node/v9/index.d.ts @@ -0,0 +1,7215 @@ +// Type definitions for Node.js 9.6.x +// Project: http://nodejs.org/ +// Definitions by: Microsoft TypeScript +// DefinitelyTyped +// Parambir Singh +// Christian Vaagland Tellnes +// Wilco Bakker +// Nicolas Voigt +// Chigozirim C. +// Flarna +// Mariusz Wiktorczyk +// wwwy3y3 +// Deividas Bakanas +// Kelvin Jin +// Alvis HT Tang +// Oliver Joseph Ash +// Sebastian Silbermann +// Hannes Magnusson +// Alberto Schiabel +// Klaus Meinhardt +// Huw +// Nicolas Even +// Bruno Scheufler +// Mohsen Azimi +// Hoàng Văn Khải +// Alexander T. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** inspector module types */ +/// + +// This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build +interface Console { + Console: NodeJS.ConsoleConstructor; + assert(value: any, message?: string, ...optionalParams: any[]): void; + dir(obj: any, options?: NodeJS.InspectOptions): void; + debug(message?: any, ...optionalParams: any[]): void; + error(message?: any, ...optionalParams: any[]): void; + info(message?: any, ...optionalParams: any[]): void; + log(message?: any, ...optionalParams: any[]): void; + time(label: string): void; + timeEnd(label: string): void; + trace(message?: any, ...optionalParams: any[]): void; + warn(message?: any, ...optionalParams: any[]): void; +} + +interface Error { + stack?: string; +} + +// Declare "static" methods in Error +interface ErrorConstructor { + /** Create .stack property on a target object */ + captureStackTrace(targetObject: Object, constructorOpt?: Function): void; + + /** + * Optional override for formatting stack traces + * + * @see https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces + */ + prepareStackTrace?: (err: Error, stackTraces: NodeJS.CallSite[]) => any; + + stackTraceLimit: number; +} + +// compat for TypeScript 1.8 +// if you use with --target es3 or --target es5 and use below definitions, +// use the lib.es6.d.ts that is bundled with TypeScript 1.8. +interface MapConstructor { } +interface WeakMapConstructor { } +interface SetConstructor { } +interface WeakSetConstructor { } + +// Forward-declare needed types from lib.es2015.d.ts (in case users are using `--lib es5`) +interface Iterable { } +interface Iterator { + next(value?: any): IteratorResult; +} +interface IteratorResult { } +interface SymbolConstructor { + readonly iterator: symbol; +} +declare var Symbol: SymbolConstructor; + +// Node.js ESNEXT support +interface String { + /** Removes whitespace from the left end of a string. */ + trimLeft(): string; + /** Removes whitespace from the right end of a string. */ + trimRight(): string; +} + +/************************************************ +* * +* GLOBAL * +* * +************************************************/ +declare var process: NodeJS.Process; +declare var global: NodeJS.Global; +declare var console: Console; + +declare var __filename: string; +declare var __dirname: string; + +declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; +declare namespace setTimeout { + export function __promisify__(ms: number): Promise; + export function __promisify__(ms: number, value: T): Promise; +} +declare function clearTimeout(timeoutId: NodeJS.Timer): void; +declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; +declare function clearInterval(intervalId: NodeJS.Timer): void; +declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any; +declare namespace setImmediate { + export function __promisify__(): Promise; + export function __promisify__(value: T): Promise; +} +declare function clearImmediate(immediateId: any): void; + +// TODO: change to `type NodeRequireFunction = (id: string) => any;` in next mayor version. +interface NodeRequireFunction { + /* tslint:disable-next-line:callable-types */ + (id: string): any; +} + +interface NodeRequire extends NodeRequireFunction { + resolve: RequireResolve; + cache: any; + extensions: NodeExtensions; + main: NodeModule | undefined; +} + +interface RequireResolve { + (id: string, options?: { paths?: string[]; }): string; + paths(request: string): string[] | null; +} + +interface NodeExtensions { + '.js': (m: NodeModule, filename: string) => any; + '.json': (m: NodeModule, filename: string) => any; + '.node': (m: NodeModule, filename: string) => any; + [ext: string]: (m: NodeModule, filename: string) => any; +} + +declare var require: NodeRequire; + +interface NodeModule { + exports: any; + require: NodeRequireFunction; + id: string; + filename: string; + loaded: boolean; + parent: NodeModule | null; + children: NodeModule[]; + paths: string[]; +} + +declare var module: NodeModule; + +// Same as module.exports +declare var exports: any; +declare var SlowBuffer: { + new(str: string, encoding?: string): Buffer; + new(size: number): Buffer; + new(size: Uint8Array): Buffer; + new(array: any[]): Buffer; + prototype: Buffer; + isBuffer(obj: any): boolean; + byteLength(string: string, encoding?: string): number; + concat(list: Buffer[], totalLength?: number): Buffer; +}; + +// Buffer class +type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "latin1" | "binary" | "hex"; +interface Buffer extends NodeBuffer { } + +/** + * Raw data is stored in instances of the Buffer class. + * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. + * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + */ +declare var Buffer: { + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + */ + new(str: string, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + */ + new(size: number): Buffer; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + new(array: Uint8Array): Buffer; + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + */ + new(arrayBuffer: ArrayBuffer): Buffer; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + new(array: any[]): Buffer; + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + */ + new(buffer: Buffer): Buffer; + prototype: Buffer; + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() + */ + from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; + /** + * Creates a new Buffer using the passed {data} + * @param data data to create a new Buffer + */ + from(data: any[] | string | Buffer | ArrayBuffer /*| TypedArray*/): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + */ + from(str: string, encoding?: string): Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + isEncoding(encoding: string): boolean; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. (TypedArray is also allowed, but it is only available starting ES2017) + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + byteLength(string: string | Buffer | DataView | ArrayBuffer, encoding?: string): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + concat(list: Buffer[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + compare(buf1: Buffer, buf2: Buffer): number; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @param fill if specified, buffer will be initialized by calling buf.fill(fill). + * If parameter is omitted, buffer will be filled with zeros. + * @param encoding encoding used for call to buf.fill while initalizing + */ + alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + allocUnsafe(size: number): Buffer; + /** + * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + allocUnsafeSlow(size: number): Buffer; + /** + * This is the number of bytes used to determine the size of pre-allocated, internal Buffer instances used for pooling. This value may be modified. + */ + poolSize: number; +}; + +/************************************************ +* * +* GLOBAL INTERFACES * +* * +************************************************/ +declare namespace NodeJS { + export interface InspectOptions { + showHidden?: boolean; + depth?: number | null; + colors?: boolean; + customInspect?: boolean; + showProxy?: boolean; + maxArrayLength?: number | null; + breakLength?: number; + } + + export interface ConsoleConstructor { + prototype: Console; + new(stdout: WritableStream, stderr?: WritableStream): Console; + } + + export interface CallSite { + /** + * Value of "this" + */ + getThis(): any; + + /** + * Type of "this" as a string. + * This is the name of the function stored in the constructor field of + * "this", if available. Otherwise the object's [[Class]] internal + * property. + */ + getTypeName(): string | null; + + /** + * Current function + */ + getFunction(): Function | undefined; + + /** + * Name of the current function, typically its name property. + * If a name property is not available an attempt will be made to try + * to infer a name from the function's context. + */ + getFunctionName(): string | null; + + /** + * Name of the property [of "this" or one of its prototypes] that holds + * the current function + */ + getMethodName(): string | null; + + /** + * Name of the script [if this function was defined in a script] + */ + getFileName(): string | null; + + /** + * Current line number [if this function was defined in a script] + */ + getLineNumber(): number | null; + + /** + * Current column number [if this function was defined in a script] + */ + getColumnNumber(): number | null; + + /** + * A call site object representing the location where eval was called + * [if this function was created using a call to eval] + */ + getEvalOrigin(): string | undefined; + + /** + * Is this a toplevel invocation, that is, is "this" the global object? + */ + isToplevel(): boolean; + + /** + * Does this call take place in code defined by a call to eval? + */ + isEval(): boolean; + + /** + * Is this call in native V8 code? + */ + isNative(): boolean; + + /** + * Is this a constructor call? + */ + isConstructor(): boolean; + } + + export interface ErrnoException extends Error { + errno?: number; + code?: string; + path?: string; + syscall?: string; + stack?: string; + } + + export class EventEmitter { + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeAllListeners(event?: string | symbol): this; + setMaxListeners(n: number): this; + getMaxListeners(): number; + listeners(event: string | symbol): Function[]; + rawListeners(event: string | symbol): Function[]; + emit(event: string | symbol, ...args: any[]): boolean; + listenerCount(type: string | symbol): number; + // Added in Node 6... + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + eventNames(): Array; + } + + export interface ReadableStream extends EventEmitter { + readable: boolean; + read(size?: number): string | Buffer; + setEncoding(encoding: string): this; + pause(): this; + resume(): this; + isPaused(): boolean; + pipe(destination: T, options?: { end?: boolean; }): T; + unpipe(destination?: T): this; + unshift(chunk: string): void; + unshift(chunk: Buffer): void; + wrap(oldStream: ReadableStream): this; + } + + export interface WritableStream extends EventEmitter { + writable: boolean; + write(buffer: Buffer | string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + end(cb?: Function): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + } + + export interface ReadWriteStream extends ReadableStream, WritableStream { } + + export interface Events extends EventEmitter { } + + export interface Domain extends Events { + run(fn: Function): void; + add(emitter: Events): void; + remove(emitter: Events): void; + bind(cb: (err: Error, data: any) => any): any; + intercept(cb: (data: any) => any): any; + + addListener(event: string, listener: (...args: any[]) => void): this; + on(event: string, listener: (...args: any[]) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + removeListener(event: string, listener: (...args: any[]) => void): this; + removeAllListeners(event?: string): this; + } + + export interface MemoryUsage { + rss: number; + heapTotal: number; + heapUsed: number; + } + + export interface CpuUsage { + user: number; + system: number; + } + + export interface ProcessVersions { + http_parser: string; + node: string; + v8: string; + ares: string; + uv: string; + zlib: string; + modules: string; + openssl: string; + } + + type Platform = 'aix' + | 'android' + | 'darwin' + | 'freebsd' + | 'linux' + | 'openbsd' + | 'sunos' + | 'win32' + | 'cygwin'; + + type Signals = + "SIGABRT" | "SIGALRM" | "SIGBUS" | "SIGCHLD" | "SIGCONT" | "SIGFPE" | "SIGHUP" | "SIGILL" | "SIGINT" | "SIGIO" | + "SIGIOT" | "SIGKILL" | "SIGPIPE" | "SIGPOLL" | "SIGPROF" | "SIGPWR" | "SIGQUIT" | "SIGSEGV" | "SIGSTKFLT" | + "SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" | + "SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO"; + + type BeforeExitListener = (code: number) => void; + type DisconnectListener = () => void; + type ExitListener = (code: number) => void; + type RejectionHandledListener = (promise: Promise) => void; + type UncaughtExceptionListener = (error: Error) => void; + type UnhandledRejectionListener = (reason: any, promise: Promise) => void; + type WarningListener = (warning: Error) => void; + type MessageListener = (message: any, sendHandle: any) => void; + type SignalsListener = (signal: Signals) => void; + type NewListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void; + type RemoveListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void; + + export interface Socket extends ReadWriteStream { + isTTY?: true; + } + + export interface ProcessEnv { + [key: string]: string | undefined; + } + + export interface WriteStream extends Socket { + readonly writableHighWaterMark: number; + readonly writableLength: number; + columns?: number; + rows?: number; + _write(chunk: any, encoding: string, callback: Function): void; + _destroy(err: Error, callback: Function): void; + _final(callback: Function): void; + setDefaultEncoding(encoding: string): this; + cork(): void; + uncork(): void; + destroy(error?: Error): void; + } + export interface ReadStream extends Socket { + readonly readableHighWaterMark: number; + readonly readableLength: number; + isRaw?: boolean; + setRawMode?(mode: boolean): void; + _read(size: number): void; + _destroy(err: Error, callback: Function): void; + push(chunk: any, encoding?: string): boolean; + destroy(error?: Error): void; + } + + export interface Process extends EventEmitter { + stdout: WriteStream; + stderr: WriteStream; + stdin: ReadStream; + openStdin(): Socket; + argv: string[]; + argv0: string; + execArgv: string[]; + execPath: string; + abort(): void; + chdir(directory: string): void; + cwd(): string; + emitWarning(warning: string | Error, name?: string, ctor?: Function): void; + env: ProcessEnv; + exit(code?: number): never; + exitCode: number; + getgid(): number; + setgid(id: number | string): void; + getuid(): number; + setuid(id: number | string): void; + geteuid(): number; + seteuid(id: number | string): void; + getegid(): number; + setegid(id: number | string): void; + getgroups(): number[]; + setgroups(groups: Array): void; + setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void; + hasUncaughtExceptionCaptureCallback(): boolean; + version: string; + versions: ProcessVersions; + config: { + target_defaults: { + cflags: any[]; + default_configuration: string; + defines: string[]; + include_dirs: string[]; + libraries: string[]; + }; + variables: { + clang: number; + host_arch: string; + node_install_npm: boolean; + node_install_waf: boolean; + node_prefix: string; + node_shared_openssl: boolean; + node_shared_v8: boolean; + node_shared_zlib: boolean; + node_use_dtrace: boolean; + node_use_etw: boolean; + node_use_openssl: boolean; + target_arch: string; + v8_no_strict_aliasing: number; + v8_use_snapshot: boolean; + visibility: string; + }; + }; + kill(pid: number, signal?: string | number): void; + pid: number; + ppid: number; + title: string; + arch: string; + platform: Platform; + mainModule?: NodeModule; + memoryUsage(): MemoryUsage; + cpuUsage(previousValue?: CpuUsage): CpuUsage; + nextTick(callback: Function, ...args: any[]): void; + umask(mask?: number): number; + uptime(): number; + hrtime(time?: [number, number]): [number, number]; + domain: Domain; + + // Worker + send?(message: any, sendHandle?: any): void; + disconnect(): void; + connected: boolean; + + /** + * EventEmitter + * 1. beforeExit + * 2. disconnect + * 3. exit + * 4. message + * 5. rejectionHandled + * 6. uncaughtException + * 7. unhandledRejection + * 8. warning + * 9. message + * 10. + * 11. newListener/removeListener inherited from EventEmitter + */ + addListener(event: "beforeExit", listener: BeforeExitListener): this; + addListener(event: "disconnect", listener: DisconnectListener): this; + addListener(event: "exit", listener: ExitListener): this; + addListener(event: "rejectionHandled", listener: RejectionHandledListener): this; + addListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; + addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + addListener(event: "warning", listener: WarningListener): this; + addListener(event: "message", listener: MessageListener): this; + addListener(event: Signals, listener: SignalsListener): this; + addListener(event: "newListener", listener: NewListenerListener): this; + addListener(event: "removeListener", listener: RemoveListenerListener): this; + + emit(event: "beforeExit", code: number): boolean; + emit(event: "disconnect"): boolean; + emit(event: "exit", code: number): boolean; + emit(event: "rejectionHandled", promise: Promise): boolean; + emit(event: "uncaughtException", error: Error): boolean; + emit(event: "unhandledRejection", reason: any, promise: Promise): boolean; + emit(event: "warning", warning: Error): boolean; + emit(event: "message", message: any, sendHandle: any): this; + emit(event: Signals): boolean; + emit(event: "newListener", eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(event: "removeListener", eventName: string, listener: (...args: any[]) => void): this; + + on(event: "beforeExit", listener: BeforeExitListener): this; + on(event: "disconnect", listener: DisconnectListener): this; + on(event: "exit", listener: ExitListener): this; + on(event: "rejectionHandled", listener: RejectionHandledListener): this; + on(event: "uncaughtException", listener: UncaughtExceptionListener): this; + on(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + on(event: "warning", listener: WarningListener): this; + on(event: "message", listener: MessageListener): this; + on(event: Signals, listener: SignalsListener): this; + on(event: "newListener", listener: NewListenerListener): this; + on(event: "removeListener", listener: RemoveListenerListener): this; + + once(event: "beforeExit", listener: BeforeExitListener): this; + once(event: "disconnect", listener: DisconnectListener): this; + once(event: "exit", listener: ExitListener): this; + once(event: "rejectionHandled", listener: RejectionHandledListener): this; + once(event: "uncaughtException", listener: UncaughtExceptionListener): this; + once(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + once(event: "warning", listener: WarningListener): this; + once(event: "message", listener: MessageListener): this; + once(event: Signals, listener: SignalsListener): this; + once(event: "newListener", listener: NewListenerListener): this; + once(event: "removeListener", listener: RemoveListenerListener): this; + + prependListener(event: "beforeExit", listener: BeforeExitListener): this; + prependListener(event: "disconnect", listener: DisconnectListener): this; + prependListener(event: "exit", listener: ExitListener): this; + prependListener(event: "rejectionHandled", listener: RejectionHandledListener): this; + prependListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; + prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + prependListener(event: "warning", listener: WarningListener): this; + prependListener(event: "message", listener: MessageListener): this; + prependListener(event: Signals, listener: SignalsListener): this; + prependListener(event: "newListener", listener: NewListenerListener): this; + prependListener(event: "removeListener", listener: RemoveListenerListener): this; + + prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this; + prependOnceListener(event: "disconnect", listener: DisconnectListener): this; + prependOnceListener(event: "exit", listener: ExitListener): this; + prependOnceListener(event: "rejectionHandled", listener: RejectionHandledListener): this; + prependOnceListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; + prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + prependOnceListener(event: "warning", listener: WarningListener): this; + prependOnceListener(event: "message", listener: MessageListener): this; + prependOnceListener(event: Signals, listener: SignalsListener): this; + prependOnceListener(event: "newListener", listener: NewListenerListener): this; + prependOnceListener(event: "removeListener", listener: RemoveListenerListener): this; + + listeners(event: "beforeExit"): BeforeExitListener[]; + listeners(event: "disconnect"): DisconnectListener[]; + listeners(event: "exit"): ExitListener[]; + listeners(event: "rejectionHandled"): RejectionHandledListener[]; + listeners(event: "uncaughtException"): UncaughtExceptionListener[]; + listeners(event: "unhandledRejection"): UnhandledRejectionListener[]; + listeners(event: "warning"): WarningListener[]; + listeners(event: "message"): MessageListener[]; + listeners(event: Signals): SignalsListener[]; + listeners(event: "newListener"): NewListenerListener[]; + listeners(event: "removeListener"): RemoveListenerListener[]; + } + + export interface Global { + Array: typeof Array; + ArrayBuffer: typeof ArrayBuffer; + Boolean: typeof Boolean; + Buffer: typeof Buffer; + DataView: typeof DataView; + Date: typeof Date; + Error: typeof Error; + EvalError: typeof EvalError; + Float32Array: typeof Float32Array; + Float64Array: typeof Float64Array; + Function: typeof Function; + GLOBAL: Global; + Infinity: typeof Infinity; + Int16Array: typeof Int16Array; + Int32Array: typeof Int32Array; + Int8Array: typeof Int8Array; + Intl: typeof Intl; + JSON: typeof JSON; + Map: MapConstructor; + Math: typeof Math; + NaN: typeof NaN; + Number: typeof Number; + Object: typeof Object; + Promise: Function; + RangeError: typeof RangeError; + ReferenceError: typeof ReferenceError; + RegExp: typeof RegExp; + Set: SetConstructor; + String: typeof String; + Symbol: Function; + SyntaxError: typeof SyntaxError; + TypeError: typeof TypeError; + URIError: typeof URIError; + Uint16Array: typeof Uint16Array; + Uint32Array: typeof Uint32Array; + Uint8Array: typeof Uint8Array; + Uint8ClampedArray: Function; + WeakMap: WeakMapConstructor; + WeakSet: WeakSetConstructor; + clearImmediate: (immediateId: any) => void; + clearInterval: (intervalId: NodeJS.Timer) => void; + clearTimeout: (timeoutId: NodeJS.Timer) => void; + console: typeof console; + decodeURI: typeof decodeURI; + decodeURIComponent: typeof decodeURIComponent; + encodeURI: typeof encodeURI; + encodeURIComponent: typeof encodeURIComponent; + escape: (str: string) => string; + eval: typeof eval; + global: Global; + isFinite: typeof isFinite; + isNaN: typeof isNaN; + parseFloat: typeof parseFloat; + parseInt: typeof parseInt; + process: Process; + root: Global; + setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => any; + setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer; + setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer; + undefined: typeof undefined; + unescape: (str: string) => string; + gc: () => void; + v8debug?: any; + } + + export interface Timer { + ref(): void; + unref(): void; + } + + class Module { + static runMain(): void; + static wrap(code: string): string; + static builtinModules: string[]; + + static Module: typeof Module; + + exports: any; + require: NodeRequireFunction; + id: string; + filename: string; + loaded: boolean; + parent: Module | null; + children: Module[]; + paths: string[]; + + constructor(id: string, parent?: Module); + } +} + +interface IterableIterator { } + +/** + * @deprecated + */ +interface NodeBuffer extends Uint8Array { + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): { type: 'Buffer', data: any[] }; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAssert?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): this; + indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + entries(): IterableIterator<[number, number]>; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; + keys(): IterableIterator; + values(): IterableIterator; +} + +/************************************************ +* * +* MODULES * +* * +************************************************/ +declare module "buffer" { + export var INSPECT_MAX_BYTES: number; + var BuffType: typeof Buffer; + var SlowBuffType: typeof SlowBuffer; + export { BuffType as Buffer, SlowBuffType as SlowBuffer }; +} + +declare module "querystring" { + export interface StringifyOptions { + encodeURIComponent?: Function; + } + + export interface ParseOptions { + maxKeys?: number; + decodeURIComponent?: Function; + } + + interface ParsedUrlQuery { [key: string]: string | string[]; } + + export function stringify(obj: T, sep?: string, eq?: string, options?: StringifyOptions): string; + export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; + export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): T; + export function escape(str: string): string; + export function unescape(str: string): string; +} + +declare module "events" { + class internal extends NodeJS.EventEmitter { } + + namespace internal { + export class EventEmitter extends internal { + static listenerCount(emitter: EventEmitter, event: string | symbol): number; // deprecated + static defaultMaxListeners: number; + + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeAllListeners(event?: string | symbol): this; + setMaxListeners(n: number): this; + getMaxListeners(): number; + listeners(event: string | symbol): Function[]; + rawListeners(event: string | symbol): Function[]; + emit(event: string | symbol, ...args: any[]): boolean; + eventNames(): Array; + listenerCount(type: string | symbol): number; + } + } + + export = internal; +} + +declare module "http" { + import * as events from "events"; + import * as net from "net"; + import * as stream from "stream"; + import { URL } from "url"; + + // incoming headers will never contain number + export interface IncomingHttpHeaders { + 'accept'?: string; + 'access-control-allow-origin'?: string; + 'access-control-allow-credentials'?: string; + 'access-control-expose-headers'?: string; + 'access-control-max-age'?: string; + 'access-control-allow-methods'?: string; + 'access-control-allow-headers'?: string; + 'accept-patch'?: string; + 'accept-ranges'?: string; + 'authorization'?: string; + 'age'?: string; + 'allow'?: string; + 'alt-svc'?: string; + 'cache-control'?: string; + 'connection'?: string; + 'content-disposition'?: string; + 'content-encoding'?: string; + 'content-language'?: string; + 'content-length'?: string; + 'content-location'?: string; + 'content-range'?: string; + 'content-type'?: string; + 'date'?: string; + 'expires'?: string; + 'host'?: string; + 'last-modified'?: string; + 'location'?: string; + 'pragma'?: string; + 'proxy-authenticate'?: string; + 'public-key-pins'?: string; + 'retry-after'?: string; + 'set-cookie'?: string[]; + 'strict-transport-security'?: string; + 'trailer'?: string; + 'transfer-encoding'?: string; + 'tk'?: string; + 'upgrade'?: string; + 'vary'?: string; + 'via'?: string; + 'warning'?: string; + 'www-authenticate'?: string; + [header: string]: string | string[] | undefined; + } + + // outgoing headers allows numbers (as they are converted internally to strings) + export interface OutgoingHttpHeaders { + [header: string]: number | string | string[] | undefined; + } + + export interface ClientRequestArgs { + protocol?: string; + host?: string; + hostname?: string; + family?: number; + port?: number | string; + defaultPort?: number | string; + localAddress?: string; + socketPath?: string; + method?: string; + path?: string; + headers?: OutgoingHttpHeaders; + auth?: string; + agent?: Agent | boolean; + _defaultAgent?: Agent; + timeout?: number; + // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278 + createConnection?: (options: ClientRequestArgs, oncreate: (err: Error, socket: net.Socket) => void) => net.Socket; + } + + export class Server extends net.Server { + constructor(requestListener?: (req: IncomingMessage, res: ServerResponse) => void); + + setTimeout(msecs?: number, callback?: () => void): this; + setTimeout(callback: () => void): this; + maxHeadersCount: number; + timeout: number; + keepAliveTimeout: number; + } + /** + * @deprecated Use IncomingMessage + */ + export class ServerRequest extends IncomingMessage { + connection: net.Socket; + } + + // https://github.com/nodejs/node/blob/master/lib/_http_outgoing.js + export class OutgoingMessage extends stream.Writable { + upgrading: boolean; + chunkedEncoding: boolean; + shouldKeepAlive: boolean; + useChunkedEncodingByDefault: boolean; + sendDate: boolean; + finished: boolean; + headersSent: boolean; + connection: net.Socket; + + constructor(); + + setTimeout(msecs: number, callback?: () => void): this; + destroy(error: Error): void; + setHeader(name: string, value: number | string | string[]): void; + getHeader(name: string): number | string | string[] | undefined; + getHeaders(): OutgoingHttpHeaders; + getHeaderNames(): string[]; + hasHeader(name: string): boolean; + removeHeader(name: string): void; + addTrailers(headers: OutgoingHttpHeaders | Array<[string, string]>): void; + flushHeaders(): void; + } + + // https://github.com/nodejs/node/blob/master/lib/_http_server.js#L108-L256 + export class ServerResponse extends OutgoingMessage { + statusCode: number; + statusMessage: string; + + constructor(req: IncomingMessage); + + assignSocket(socket: net.Socket): void; + detachSocket(socket: net.Socket): void; + // https://github.com/nodejs/node/blob/master/test/parallel/test-http-write-callbacks.js#L53 + // no args in writeContinue callback + writeContinue(callback?: () => void): void; + writeHead(statusCode: number, reasonPhrase?: string, headers?: OutgoingHttpHeaders): void; + writeHead(statusCode: number, headers?: OutgoingHttpHeaders): void; + } + + // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L77 + export class ClientRequest extends OutgoingMessage { + connection: net.Socket; + socket: net.Socket; + aborted: number; + + constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void); + + abort(): void; + onSocket(socket: net.Socket): void; + setTimeout(timeout: number, callback?: () => void): this; + setNoDelay(noDelay?: boolean): void; + setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; + } + + export class IncomingMessage extends stream.Readable { + constructor(socket: net.Socket); + + httpVersion: string; + httpVersionMajor: number; + httpVersionMinor: number; + connection: net.Socket; + headers: IncomingHttpHeaders; + rawHeaders: string[]; + trailers: { [key: string]: string | undefined }; + rawTrailers: string[]; + setTimeout(msecs: number, callback: () => void): this; + /** + * Only valid for request obtained from http.Server. + */ + method?: string; + /** + * Only valid for request obtained from http.Server. + */ + url?: string; + /** + * Only valid for response obtained from http.ClientRequest. + */ + statusCode?: number; + /** + * Only valid for response obtained from http.ClientRequest. + */ + statusMessage?: string; + socket: net.Socket; + destroy(error?: Error): void; + } + + /** + * @deprecated Use IncomingMessage + */ + export class ClientResponse extends IncomingMessage { } + + export interface AgentOptions { + /** + * Keep sockets around in a pool to be used by other requests in the future. Default = false + */ + keepAlive?: boolean; + /** + * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. + * Only relevant if keepAlive is set to true. + */ + keepAliveMsecs?: number; + /** + * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity + */ + maxSockets?: number; + /** + * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. + */ + maxFreeSockets?: number; + } + + export class Agent { + maxSockets: number; + sockets: any; + requests: any; + + constructor(opts?: AgentOptions); + + /** + * Destroy any sockets that are currently in use by the agent. + * It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled, + * then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise, + * sockets may hang open for quite a long time before the server terminates them. + */ + destroy(): void; + } + + export var METHODS: string[]; + + export var STATUS_CODES: { + [errorCode: number]: string | undefined; + [errorCode: string]: string | undefined; + }; + + export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) => void): Server; + export function createClient(port?: number, host?: string): any; + + // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly, + // create interface RequestOptions would make the naming more clear to developers + export interface RequestOptions extends ClientRequestArgs { } + export function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + export function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + export var globalAgent: Agent; +} + +declare module "cluster" { + import * as child from "child_process"; + import * as events from "events"; + import * as net from "net"; + + // interfaces + export interface ClusterSettings { + execArgv?: string[]; // default: process.execArgv + exec?: string; + args?: string[]; + silent?: boolean; + stdio?: any[]; + uid?: number; + gid?: number; + inspectPort?: number | (() => number); + } + + export interface Address { + address: string; + port: number; + addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6" + } + + export class Worker extends events.EventEmitter { + id: number; + process: child.ChildProcess; + suicide: boolean; + send(message: any, sendHandle?: any, callback?: (error: Error) => void): boolean; + kill(signal?: string): void; + destroy(signal?: string): void; + disconnect(): void; + isConnected(): boolean; + isDead(): boolean; + exitedAfterDisconnect: boolean; + + /** + * events.EventEmitter + * 1. disconnect + * 2. error + * 3. exit + * 4. listening + * 5. message + * 6. online + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "disconnect", listener: () => void): this; + addListener(event: "error", listener: (error: Error) => void): this; + addListener(event: "exit", listener: (code: number, signal: string) => void): this; + addListener(event: "listening", listener: (address: Address) => void): this; + addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + addListener(event: "online", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "disconnect"): boolean; + emit(event: "error", error: Error): boolean; + emit(event: "exit", code: number, signal: string): boolean; + emit(event: "listening", address: Address): boolean; + emit(event: "message", message: any, handle: net.Socket | net.Server): boolean; + emit(event: "online"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "disconnect", listener: () => void): this; + on(event: "error", listener: (error: Error) => void): this; + on(event: "exit", listener: (code: number, signal: string) => void): this; + on(event: "listening", listener: (address: Address) => void): this; + on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + on(event: "online", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "disconnect", listener: () => void): this; + once(event: "error", listener: (error: Error) => void): this; + once(event: "exit", listener: (code: number, signal: string) => void): this; + once(event: "listening", listener: (address: Address) => void): this; + once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + once(event: "online", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "disconnect", listener: () => void): this; + prependListener(event: "error", listener: (error: Error) => void): this; + prependListener(event: "exit", listener: (code: number, signal: string) => void): this; + prependListener(event: "listening", listener: (address: Address) => void): this; + prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependListener(event: "online", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "disconnect", listener: () => void): this; + prependOnceListener(event: "error", listener: (error: Error) => void): this; + prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this; + prependOnceListener(event: "listening", listener: (address: Address) => void): this; + prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependOnceListener(event: "online", listener: () => void): this; + } + + export interface Cluster extends events.EventEmitter { + Worker: Worker; + disconnect(callback?: Function): void; + fork(env?: any): Worker; + isMaster: boolean; + isWorker: boolean; + // TODO: cluster.schedulingPolicy + settings: ClusterSettings; + setupMaster(settings?: ClusterSettings): void; + worker?: Worker; + workers?: { + [index: string]: Worker | undefined + }; + + /** + * events.EventEmitter + * 1. disconnect + * 2. exit + * 3. fork + * 4. listening + * 5. message + * 6. online + * 7. setup + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "disconnect", listener: (worker: Worker) => void): this; + addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + addListener(event: "fork", listener: (worker: Worker) => void): this; + addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; + addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + addListener(event: "online", listener: (worker: Worker) => void): this; + addListener(event: "setup", listener: (settings: any) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "disconnect", worker: Worker): boolean; + emit(event: "exit", worker: Worker, code: number, signal: string): boolean; + emit(event: "fork", worker: Worker): boolean; + emit(event: "listening", worker: Worker, address: Address): boolean; + emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean; + emit(event: "online", worker: Worker): boolean; + emit(event: "setup", settings: any): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "disconnect", listener: (worker: Worker) => void): this; + on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + on(event: "fork", listener: (worker: Worker) => void): this; + on(event: "listening", listener: (worker: Worker, address: Address) => void): this; + on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + on(event: "online", listener: (worker: Worker) => void): this; + on(event: "setup", listener: (settings: any) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "disconnect", listener: (worker: Worker) => void): this; + once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + once(event: "fork", listener: (worker: Worker) => void): this; + once(event: "listening", listener: (worker: Worker, address: Address) => void): this; + once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + once(event: "online", listener: (worker: Worker) => void): this; + once(event: "setup", listener: (settings: any) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "disconnect", listener: (worker: Worker) => void): this; + prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + prependListener(event: "fork", listener: (worker: Worker) => void): this; + prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; + prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependListener(event: "online", listener: (worker: Worker) => void): this; + prependListener(event: "setup", listener: (settings: any) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this; + prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + prependOnceListener(event: "fork", listener: (worker: Worker) => void): this; + prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; + prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependOnceListener(event: "online", listener: (worker: Worker) => void): this; + prependOnceListener(event: "setup", listener: (settings: any) => void): this; + } + + export function disconnect(callback?: Function): void; + export function fork(env?: any): Worker; + export var isMaster: boolean; + export var isWorker: boolean; + // TODO: cluster.schedulingPolicy + export var settings: ClusterSettings; + export function setupMaster(settings?: ClusterSettings): void; + export var worker: Worker; + export var workers: { + [index: string]: Worker | undefined + }; + + /** + * events.EventEmitter + * 1. disconnect + * 2. exit + * 3. fork + * 4. listening + * 5. message + * 6. online + * 7. setup + */ + export function addListener(event: string, listener: (...args: any[]) => void): Cluster; + export function addListener(event: "disconnect", listener: (worker: Worker) => void): Cluster; + export function addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + export function addListener(event: "fork", listener: (worker: Worker) => void): Cluster; + export function addListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + export function addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + export function addListener(event: "online", listener: (worker: Worker) => void): Cluster; + export function addListener(event: "setup", listener: (settings: any) => void): Cluster; + + export function emit(event: string | symbol, ...args: any[]): boolean; + export function emit(event: "disconnect", worker: Worker): boolean; + export function emit(event: "exit", worker: Worker, code: number, signal: string): boolean; + export function emit(event: "fork", worker: Worker): boolean; + export function emit(event: "listening", worker: Worker, address: Address): boolean; + export function emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean; + export function emit(event: "online", worker: Worker): boolean; + export function emit(event: "setup", settings: any): boolean; + + export function on(event: string, listener: (...args: any[]) => void): Cluster; + export function on(event: "disconnect", listener: (worker: Worker) => void): Cluster; + export function on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + export function on(event: "fork", listener: (worker: Worker) => void): Cluster; + export function on(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + export function on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + export function on(event: "online", listener: (worker: Worker) => void): Cluster; + export function on(event: "setup", listener: (settings: any) => void): Cluster; + + export function once(event: string, listener: (...args: any[]) => void): Cluster; + export function once(event: "disconnect", listener: (worker: Worker) => void): Cluster; + export function once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + export function once(event: "fork", listener: (worker: Worker) => void): Cluster; + export function once(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + export function once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + export function once(event: "online", listener: (worker: Worker) => void): Cluster; + export function once(event: "setup", listener: (settings: any) => void): Cluster; + + export function removeListener(event: string, listener: (...args: any[]) => void): Cluster; + export function removeAllListeners(event?: string): Cluster; + export function setMaxListeners(n: number): Cluster; + export function getMaxListeners(): number; + export function listeners(event: string): Function[]; + export function listenerCount(type: string): number; + + export function prependListener(event: string, listener: (...args: any[]) => void): Cluster; + export function prependListener(event: "disconnect", listener: (worker: Worker) => void): Cluster; + export function prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + export function prependListener(event: "fork", listener: (worker: Worker) => void): Cluster; + export function prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + export function prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + export function prependListener(event: "online", listener: (worker: Worker) => void): Cluster; + export function prependListener(event: "setup", listener: (settings: any) => void): Cluster; + + export function prependOnceListener(event: string, listener: (...args: any[]) => void): Cluster; + export function prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): Cluster; + export function prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + export function prependOnceListener(event: "fork", listener: (worker: Worker) => void): Cluster; + export function prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + export function prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + export function prependOnceListener(event: "online", listener: (worker: Worker) => void): Cluster; + export function prependOnceListener(event: "setup", listener: (settings: any) => void): Cluster; + + export function eventNames(): string[]; +} + +declare module "zlib" { + import * as stream from "stream"; + + export interface ZlibOptions { + flush?: number; // default: zlib.constants.Z_NO_FLUSH + finishFlush?: number; // default: zlib.constants.Z_FINISH + chunkSize?: number; // default: 16*1024 + windowBits?: number; + level?: number; // compression only + memLevel?: number; // compression only + strategy?: number; // compression only + dictionary?: any; // deflate/inflate only, empty dictionary by default + } + + export interface Zlib { + readonly bytesRead: number; + close(callback?: () => void): void; + flush(kind?: number | (() => void), callback?: () => void): void; + } + + export interface ZlibParams { + params(level: number, strategy: number, callback: () => void): void; + } + + export interface ZlibReset { + reset(): void; + } + + export interface Gzip extends stream.Transform, Zlib { } + export interface Gunzip extends stream.Transform, Zlib { } + export interface Deflate extends stream.Transform, Zlib, ZlibReset, ZlibParams { } + export interface Inflate extends stream.Transform, Zlib, ZlibReset { } + export interface DeflateRaw extends stream.Transform, Zlib, ZlibReset, ZlibParams { } + export interface InflateRaw extends stream.Transform, Zlib, ZlibReset { } + export interface Unzip extends stream.Transform, Zlib { } + + export function createGzip(options?: ZlibOptions): Gzip; + export function createGunzip(options?: ZlibOptions): Gunzip; + export function createDeflate(options?: ZlibOptions): Deflate; + export function createInflate(options?: ZlibOptions): Inflate; + export function createDeflateRaw(options?: ZlibOptions): DeflateRaw; + export function createInflateRaw(options?: ZlibOptions): InflateRaw; + export function createUnzip(options?: ZlibOptions): Unzip; + + type InputType = string | Buffer | DataView | ArrayBuffer /* | TypedArray */; + export function deflate(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function deflate(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function deflateSync(buf: InputType, options?: ZlibOptions): Buffer; + export function deflateRaw(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function deflateRaw(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function deflateRawSync(buf: InputType, options?: ZlibOptions): Buffer; + export function gzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function gzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function gzipSync(buf: InputType, options?: ZlibOptions): Buffer; + export function gunzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function gunzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function gunzipSync(buf: InputType, options?: ZlibOptions): Buffer; + export function inflate(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function inflate(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function inflateSync(buf: InputType, options?: ZlibOptions): Buffer; + export function inflateRaw(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function inflateRaw(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function inflateRawSync(buf: InputType, options?: ZlibOptions): Buffer; + export function unzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function unzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function unzipSync(buf: InputType, options?: ZlibOptions): Buffer; + + export namespace constants { + // Allowed flush values. + + export const Z_NO_FLUSH: number; + export const Z_PARTIAL_FLUSH: number; + export const Z_SYNC_FLUSH: number; + export const Z_FULL_FLUSH: number; + export const Z_FINISH: number; + export const Z_BLOCK: number; + export const Z_TREES: number; + + // Return codes for the compression/decompression functions. Negative values are errors, positive values are used for special but normal events. + + export const Z_OK: number; + export const Z_STREAM_END: number; + export const Z_NEED_DICT: number; + export const Z_ERRNO: number; + export const Z_STREAM_ERROR: number; + export const Z_DATA_ERROR: number; + export const Z_MEM_ERROR: number; + export const Z_BUF_ERROR: number; + export const Z_VERSION_ERROR: number; + + // Compression levels. + + export const Z_NO_COMPRESSION: number; + export const Z_BEST_SPEED: number; + export const Z_BEST_COMPRESSION: number; + export const Z_DEFAULT_COMPRESSION: number; + + // Compression strategy. + + export const Z_FILTERED: number; + export const Z_HUFFMAN_ONLY: number; + export const Z_RLE: number; + export const Z_FIXED: number; + export const Z_DEFAULT_STRATEGY: number; + } + + // Constants + export var Z_NO_FLUSH: number; + export var Z_PARTIAL_FLUSH: number; + export var Z_SYNC_FLUSH: number; + export var Z_FULL_FLUSH: number; + export var Z_FINISH: number; + export var Z_BLOCK: number; + export var Z_TREES: number; + export var Z_OK: number; + export var Z_STREAM_END: number; + export var Z_NEED_DICT: number; + export var Z_ERRNO: number; + export var Z_STREAM_ERROR: number; + export var Z_DATA_ERROR: number; + export var Z_MEM_ERROR: number; + export var Z_BUF_ERROR: number; + export var Z_VERSION_ERROR: number; + export var Z_NO_COMPRESSION: number; + export var Z_BEST_SPEED: number; + export var Z_BEST_COMPRESSION: number; + export var Z_DEFAULT_COMPRESSION: number; + export var Z_FILTERED: number; + export var Z_HUFFMAN_ONLY: number; + export var Z_RLE: number; + export var Z_FIXED: number; + export var Z_DEFAULT_STRATEGY: number; + export var Z_BINARY: number; + export var Z_TEXT: number; + export var Z_ASCII: number; + export var Z_UNKNOWN: number; + export var Z_DEFLATED: number; +} + +declare module "os" { + export interface CpuInfo { + model: string; + speed: number; + times: { + user: number; + nice: number; + sys: number; + idle: number; + irq: number; + }; + } + + export interface NetworkInterfaceBase { + address: string; + netmask: string; + mac: string; + internal: boolean; + } + + export interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { + family: "IPv4"; + } + + export interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase { + family: "IPv6"; + scopeid: number; + } + + export type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6; + + export function hostname(): string; + export function loadavg(): number[]; + export function uptime(): number; + export function freemem(): number; + export function totalmem(): number; + export function cpus(): CpuInfo[]; + export function type(): string; + export function release(): string; + export function networkInterfaces(): { [index: string]: NetworkInterfaceInfo[] }; + export function homedir(): string; + export function userInfo(options?: { encoding: string }): { username: string, uid: number, gid: number, shell: any, homedir: string }; + export var constants: { + UV_UDP_REUSEADDR: number, + signals: { + SIGHUP: number; + SIGINT: number; + SIGQUIT: number; + SIGILL: number; + SIGTRAP: number; + SIGABRT: number; + SIGIOT: number; + SIGBUS: number; + SIGFPE: number; + SIGKILL: number; + SIGUSR1: number; + SIGSEGV: number; + SIGUSR2: number; + SIGPIPE: number; + SIGALRM: number; + SIGTERM: number; + SIGCHLD: number; + SIGSTKFLT: number; + SIGCONT: number; + SIGSTOP: number; + SIGTSTP: number; + SIGTTIN: number; + SIGTTOU: number; + SIGURG: number; + SIGXCPU: number; + SIGXFSZ: number; + SIGVTALRM: number; + SIGPROF: number; + SIGWINCH: number; + SIGIO: number; + SIGPOLL: number; + SIGPWR: number; + SIGSYS: number; + SIGUNUSED: number; + }, + errno: { + E2BIG: number; + EACCES: number; + EADDRINUSE: number; + EADDRNOTAVAIL: number; + EAFNOSUPPORT: number; + EAGAIN: number; + EALREADY: number; + EBADF: number; + EBADMSG: number; + EBUSY: number; + ECANCELED: number; + ECHILD: number; + ECONNABORTED: number; + ECONNREFUSED: number; + ECONNRESET: number; + EDEADLK: number; + EDESTADDRREQ: number; + EDOM: number; + EDQUOT: number; + EEXIST: number; + EFAULT: number; + EFBIG: number; + EHOSTUNREACH: number; + EIDRM: number; + EILSEQ: number; + EINPROGRESS: number; + EINTR: number; + EINVAL: number; + EIO: number; + EISCONN: number; + EISDIR: number; + ELOOP: number; + EMFILE: number; + EMLINK: number; + EMSGSIZE: number; + EMULTIHOP: number; + ENAMETOOLONG: number; + ENETDOWN: number; + ENETRESET: number; + ENETUNREACH: number; + ENFILE: number; + ENOBUFS: number; + ENODATA: number; + ENODEV: number; + ENOENT: number; + ENOEXEC: number; + ENOLCK: number; + ENOLINK: number; + ENOMEM: number; + ENOMSG: number; + ENOPROTOOPT: number; + ENOSPC: number; + ENOSR: number; + ENOSTR: number; + ENOSYS: number; + ENOTCONN: number; + ENOTDIR: number; + ENOTEMPTY: number; + ENOTSOCK: number; + ENOTSUP: number; + ENOTTY: number; + ENXIO: number; + EOPNOTSUPP: number; + EOVERFLOW: number; + EPERM: number; + EPIPE: number; + EPROTO: number; + EPROTONOSUPPORT: number; + EPROTOTYPE: number; + ERANGE: number; + EROFS: number; + ESPIPE: number; + ESRCH: number; + ESTALE: number; + ETIME: number; + ETIMEDOUT: number; + ETXTBSY: number; + EWOULDBLOCK: number; + EXDEV: number; + }, + }; + export function arch(): string; + export function platform(): NodeJS.Platform; + export function tmpdir(): string; + export const EOL: string; + export function endianness(): "BE" | "LE"; +} + +declare module "https" { + import * as tls from "tls"; + import * as events from "events"; + import * as http from "http"; + import { URL } from "url"; + + export type ServerOptions = tls.SecureContextOptions & tls.TlsOptions; + + export type RequestOptions = http.RequestOptions & tls.SecureContextOptions & { + rejectUnauthorized?: boolean; // Defaults to true + servername?: string; // SNI TLS Extension + }; + + export interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { + rejectUnauthorized?: boolean; + maxCachedSessions?: number; + } + + export class Agent extends http.Agent { + constructor(options?: AgentOptions); + options: AgentOptions; + } + + export class Server extends tls.Server { + setTimeout(callback: () => void): this; + setTimeout(msecs?: number, callback?: () => void): this; + timeout: number; + keepAliveTimeout: number; + } + + export function createServer(options: ServerOptions, requestListener?: (req: http.IncomingMessage, res: http.ServerResponse) => void): Server; + export function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + export function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + export var globalAgent: Agent; +} + +declare module "punycode" { + export function decode(string: string): string; + export function encode(string: string): string; + export function toUnicode(domain: string): string; + export function toASCII(domain: string): string; + export var ucs2: ucs2; + interface ucs2 { + decode(string: string): number[]; + encode(codePoints: number[]): string; + } + export var version: any; +} + +declare module "repl" { + import * as stream from "stream"; + import * as readline from "readline"; + + export interface ReplOptions { + prompt?: string; + input?: NodeJS.ReadableStream; + output?: NodeJS.WritableStream; + terminal?: boolean; + eval?: Function; + useColors?: boolean; + useGlobal?: boolean; + ignoreUndefined?: boolean; + writer?: Function; + completer?: Function; + replMode?: any; + breakEvalOnSigint?: any; + } + + export interface REPLServer extends readline.ReadLine { + context: any; + inputStream: NodeJS.ReadableStream; + outputStream: NodeJS.WritableStream; + + defineCommand(keyword: string, cmd: Function | { help: string, action: Function }): void; + displayPrompt(preserveCursor?: boolean): void; + + /** + * events.EventEmitter + * 1. exit + * 2. reset + */ + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "exit", listener: () => void): this; + addListener(event: "reset", listener: (...args: any[]) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "exit"): boolean; + emit(event: "reset", context: any): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "exit", listener: () => void): this; + on(event: "reset", listener: (...args: any[]) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "exit", listener: () => void): this; + once(event: "reset", listener: (...args: any[]) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "exit", listener: () => void): this; + prependListener(event: "reset", listener: (...args: any[]) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "exit", listener: () => void): this; + prependOnceListener(event: "reset", listener: (...args: any[]) => void): this; + } + + export function start(options?: string | ReplOptions): REPLServer; + + export class Recoverable extends SyntaxError { + err: Error; + + constructor(err: Error); + } +} + +declare module "readline" { + import * as events from "events"; + import * as stream from "stream"; + + export interface Key { + sequence?: string; + name?: string; + ctrl?: boolean; + meta?: boolean; + shift?: boolean; + } + + export interface ReadLine extends events.EventEmitter { + setPrompt(prompt: string): void; + prompt(preserveCursor?: boolean): void; + question(query: string, callback: (answer: string) => void): void; + pause(): ReadLine; + resume(): ReadLine; + close(): void; + write(data: string | Buffer, key?: Key): void; + + /** + * events.EventEmitter + * 1. close + * 2. line + * 3. pause + * 4. resume + * 5. SIGCONT + * 6. SIGINT + * 7. SIGTSTP + */ + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "line", listener: (input: any) => void): this; + addListener(event: "pause", listener: () => void): this; + addListener(event: "resume", listener: () => void): this; + addListener(event: "SIGCONT", listener: () => void): this; + addListener(event: "SIGINT", listener: () => void): this; + addListener(event: "SIGTSTP", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "line", input: any): boolean; + emit(event: "pause"): boolean; + emit(event: "resume"): boolean; + emit(event: "SIGCONT"): boolean; + emit(event: "SIGINT"): boolean; + emit(event: "SIGTSTP"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "line", listener: (input: any) => void): this; + on(event: "pause", listener: () => void): this; + on(event: "resume", listener: () => void): this; + on(event: "SIGCONT", listener: () => void): this; + on(event: "SIGINT", listener: () => void): this; + on(event: "SIGTSTP", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "line", listener: (input: any) => void): this; + once(event: "pause", listener: () => void): this; + once(event: "resume", listener: () => void): this; + once(event: "SIGCONT", listener: () => void): this; + once(event: "SIGINT", listener: () => void): this; + once(event: "SIGTSTP", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "line", listener: (input: any) => void): this; + prependListener(event: "pause", listener: () => void): this; + prependListener(event: "resume", listener: () => void): this; + prependListener(event: "SIGCONT", listener: () => void): this; + prependListener(event: "SIGINT", listener: () => void): this; + prependListener(event: "SIGTSTP", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "line", listener: (input: any) => void): this; + prependOnceListener(event: "pause", listener: () => void): this; + prependOnceListener(event: "resume", listener: () => void): this; + prependOnceListener(event: "SIGCONT", listener: () => void): this; + prependOnceListener(event: "SIGINT", listener: () => void): this; + prependOnceListener(event: "SIGTSTP", listener: () => void): this; + } + + type Completer = (line: string) => CompleterResult; + type AsyncCompleter = (line: string, callback: (err: any, result: CompleterResult) => void) => any; + + export type CompleterResult = [string[], string]; + + export interface ReadLineOptions { + input: NodeJS.ReadableStream; + output?: NodeJS.WritableStream; + completer?: Completer | AsyncCompleter; + terminal?: boolean; + historySize?: number; + } + + export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): ReadLine; + export function createInterface(options: ReadLineOptions): ReadLine; + + export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number): void; + export function emitKeypressEvents(stream: NodeJS.ReadableStream, interface?: ReadLine): void; + export function moveCursor(stream: NodeJS.WritableStream, dx: number | string, dy: number | string): void; + export function clearLine(stream: NodeJS.WritableStream, dir: number): void; + export function clearScreenDown(stream: NodeJS.WritableStream): void; +} + +declare module "vm" { + export interface Context { } + export interface ScriptOptions { + filename?: string; + lineOffset?: number; + columnOffset?: number; + displayErrors?: boolean; + timeout?: number; + cachedData?: Buffer; + produceCachedData?: boolean; + } + export interface RunningScriptOptions { + filename?: string; + lineOffset?: number; + columnOffset?: number; + displayErrors?: boolean; + timeout?: number; + } + export class Script { + constructor(code: string, options?: ScriptOptions); + runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any; + runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any; + runInThisContext(options?: RunningScriptOptions): any; + } + export function createContext(sandbox?: Context): Context; + export function isContext(sandbox: Context): boolean; + export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions | string): any; + /** @deprecated */ + export function runInDebugContext(code: string): any; + export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any; + export function runInThisContext(code: string, options?: RunningScriptOptions | string): any; +} + +declare module "child_process" { + import * as events from "events"; + import * as stream from "stream"; + import * as net from "net"; + + export interface ChildProcess extends events.EventEmitter { + stdin: stream.Writable; + stdout: stream.Readable; + stderr: stream.Readable; + stdio: [stream.Writable, stream.Readable, stream.Readable]; + killed: boolean; + pid: number; + kill(signal?: string): void; + send(message: any, callback?: (error: Error) => void): boolean; + send(message: any, sendHandle?: net.Socket | net.Server, callback?: (error: Error) => void): boolean; + send(message: any, sendHandle?: net.Socket | net.Server, options?: MessageOptions, callback?: (error: Error) => void): boolean; + connected: boolean; + disconnect(): void; + unref(): void; + ref(): void; + + /** + * events.EventEmitter + * 1. close + * 2. disconnect + * 3. error + * 4. exit + * 5. message + */ + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: (code: number, signal: string) => void): this; + addListener(event: "disconnect", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "exit", listener: (code: number, signal: string) => void): this; + addListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close", code: number, signal: string): boolean; + emit(event: "disconnect"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "exit", code: number, signal: string): boolean; + emit(event: "message", message: any, sendHandle: net.Socket | net.Server): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: (code: number, signal: string) => void): this; + on(event: "disconnect", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "exit", listener: (code: number, signal: string) => void): this; + on(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: (code: number, signal: string) => void): this; + once(event: "disconnect", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "exit", listener: (code: number, signal: string) => void): this; + once(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: (code: number, signal: string) => void): this; + prependListener(event: "disconnect", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "exit", listener: (code: number, signal: string) => void): this; + prependListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: (code: number, signal: string) => void): this; + prependOnceListener(event: "disconnect", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this; + prependOnceListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + } + + export interface MessageOptions { + keepOpen?: boolean; + } + + export interface SpawnOptions { + cwd?: string; + env?: any; + stdio?: any; + detached?: boolean; + uid?: number; + gid?: number; + shell?: boolean | string; + windowsVerbatimArguments?: boolean; + windowsHide?: boolean; + } + + export function spawn(command: string, args?: string[], options?: SpawnOptions): ChildProcess; + + export interface ExecOptions { + cwd?: string; + env?: any; + shell?: string; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + uid?: number; + gid?: number; + windowsHide?: boolean; + } + + export interface ExecOptionsWithStringEncoding extends ExecOptions { + encoding: BufferEncoding; + } + + export interface ExecOptionsWithBufferEncoding extends ExecOptions { + encoding: string | null; // specify `null`. + } + + // no `options` definitely means stdout/stderr are `string`. + export function exec(command: string, callback?: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + + // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. + export function exec(command: string, options: { encoding: "buffer" | null } & ExecOptions, callback?: (error: Error | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + + // `options` with well known `encoding` means stdout/stderr are definitely `string`. + export function exec(command: string, options: { encoding: BufferEncoding } & ExecOptions, callback?: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + + // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. + // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. + export function exec(command: string, options: { encoding: string } & ExecOptions, callback?: (error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess; + + // `options` without an `encoding` means stdout/stderr are definitely `string`. + export function exec(command: string, options: ExecOptions, callback?: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + + // fallback if nothing else matches. Worst case is always `string | Buffer`. + export function exec(command: string, options: ({ encoding?: string | null } & ExecOptions) | undefined | null, callback?: (error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace exec { + export function __promisify__(command: string): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(command: string, options: { encoding: "buffer" | null } & ExecOptions): Promise<{ stdout: Buffer, stderr: Buffer }>; + export function __promisify__(command: string, options: { encoding: BufferEncoding } & ExecOptions): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(command: string, options: ExecOptions): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(command: string, options?: ({ encoding?: string | null } & ExecOptions) | null): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>; + } + + export interface ExecFileOptions { + cwd?: string; + env?: any; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + uid?: number; + gid?: number; + windowsHide?: boolean; + windowsVerbatimArguments?: boolean; + } + export interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { + encoding: BufferEncoding; + } + export interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { + encoding: 'buffer' | null; + } + export interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions { + encoding: string; + } + + export function execFile(file: string): ChildProcess; + export function execFile(file: string, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): ChildProcess; + export function execFile(file: string, args: string[] | undefined | null): ChildProcess; + export function execFile(file: string, args: string[] | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): ChildProcess; + + // no `options` definitely means stdout/stderr are `string`. + export function execFile(file: string, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + export function execFile(file: string, args: string[] | undefined | null, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + + // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. + export function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: Error | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + export function execFile(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithBufferEncoding, callback: (error: Error | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + + // `options` with well known `encoding` means stdout/stderr are definitely `string`. + export function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + export function execFile(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithStringEncoding, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + + // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. + // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. + export function execFile(file: string, options: ExecFileOptionsWithOtherEncoding, callback: (error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess; + export function execFile(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithOtherEncoding, callback: (error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess; + + // `options` without an `encoding` means stdout/stderr are definitely `string`. + export function execFile(file: string, options: ExecFileOptions, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + export function execFile(file: string, args: string[] | undefined | null, options: ExecFileOptions, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + + // fallback if nothing else matches. Worst case is always `string | Buffer`. + export function execFile(file: string, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null, callback: ((error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null): ChildProcess; + export function execFile(file: string, args: string[] | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null, callback: ((error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null): ChildProcess; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace execFile { + export function __promisify__(file: string): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(file: string, args: string[] | undefined | null): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(file: string, options: ExecFileOptionsWithBufferEncoding): Promise<{ stdout: Buffer, stderr: Buffer }>; + export function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithBufferEncoding): Promise<{ stdout: Buffer, stderr: Buffer }>; + export function __promisify__(file: string, options: ExecFileOptionsWithStringEncoding): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithStringEncoding): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(file: string, options: ExecFileOptionsWithOtherEncoding): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>; + export function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithOtherEncoding): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>; + export function __promisify__(file: string, options: ExecFileOptions): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptions): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(file: string, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>; + export function __promisify__(file: string, args: string[] | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>; + } + + export interface ForkOptions { + cwd?: string; + env?: any; + execPath?: string; + execArgv?: string[]; + silent?: boolean; + stdio?: any[]; + uid?: number; + gid?: number; + windowsVerbatimArguments?: boolean; + } + export function fork(modulePath: string, args?: string[], options?: ForkOptions): ChildProcess; + + export interface SpawnSyncOptions { + cwd?: string; + input?: string | Buffer; + stdio?: any; + env?: any; + uid?: number; + gid?: number; + timeout?: number; + killSignal?: string; + maxBuffer?: number; + encoding?: string; + shell?: boolean | string; + windowsHide?: boolean; + windowsVerbatimArguments?: boolean; + } + export interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { + encoding: BufferEncoding; + } + export interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { + encoding: string; // specify `null`. + } + export interface SpawnSyncReturns { + pid: number; + output: string[]; + stdout: T; + stderr: T; + status: number; + signal: string; + error: Error; + } + export function spawnSync(command: string): SpawnSyncReturns; + export function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + export function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + export function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; + export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptions): SpawnSyncReturns; + + export interface ExecSyncOptions { + cwd?: string; + input?: string | Buffer; + stdio?: any; + env?: any; + shell?: string; + uid?: number; + gid?: number; + timeout?: number; + killSignal?: string; + maxBuffer?: number; + encoding?: string; + windowsHide?: boolean; + } + export interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { + encoding: BufferEncoding; + } + export interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { + encoding: string; // specify `null`. + } + export function execSync(command: string): Buffer; + export function execSync(command: string, options?: ExecSyncOptionsWithStringEncoding): string; + export function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer; + export function execSync(command: string, options?: ExecSyncOptions): Buffer; + + export interface ExecFileSyncOptions { + cwd?: string; + input?: string | Buffer; + stdio?: any; + env?: any; + uid?: number; + gid?: number; + timeout?: number; + killSignal?: string; + maxBuffer?: number; + encoding?: string; + windowsHide?: boolean; + } + export interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { + encoding: BufferEncoding; + } + export interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { + encoding: string; // specify `null`. + } + export function execFileSync(command: string): Buffer; + export function execFileSync(command: string, options?: ExecFileSyncOptionsWithStringEncoding): string; + export function execFileSync(command: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; + export function execFileSync(command: string, options?: ExecFileSyncOptions): Buffer; + export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithStringEncoding): string; + export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; + export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptions): Buffer; +} + +declare module "url" { + import { ParsedUrlQuery } from 'querystring'; + + export interface UrlObjectCommon { + auth?: string; + hash?: string; + host?: string; + hostname?: string; + href?: string; + path?: string; + pathname?: string; + protocol?: string; + search?: string; + slashes?: boolean; + } + + // Input to `url.format` + export interface UrlObject extends UrlObjectCommon { + port?: string | number; + query?: string | null | { [key: string]: any }; + } + + // Output of `url.parse` + export interface Url extends UrlObjectCommon { + port?: string; + query?: string | null | ParsedUrlQuery; + } + + export interface UrlWithParsedQuery extends Url { + query: ParsedUrlQuery; + } + + export interface UrlWithStringQuery extends Url { + query: string | null; + } + + export function parse(urlStr: string): UrlWithStringQuery; + export function parse(urlStr: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery; + export function parse(urlStr: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery; + export function parse(urlStr: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url; + + export function format(URL: URL, options?: URLFormatOptions): string; + export function format(urlObject: UrlObject | string): string; + export function resolve(from: string, to: string): string; + + export function domainToASCII(domain: string): string; + export function domainToUnicode(domain: string): string; + + export interface URLFormatOptions { + auth?: boolean; + fragment?: boolean; + search?: boolean; + unicode?: boolean; + } + + export class URLSearchParams implements Iterable<[string, string]> { + constructor(init?: URLSearchParams | string | { [key: string]: string | string[] | undefined } | Iterable<[string, string]> | Array<[string, string]>); + append(name: string, value: string): void; + delete(name: string): void; + entries(): IterableIterator<[string, string]>; + forEach(callback: (value: string, name: string) => void): void; + get(name: string): string | null; + getAll(name: string): string[]; + has(name: string): boolean; + keys(): IterableIterator; + set(name: string, value: string): void; + sort(): void; + toString(): string; + values(): IterableIterator; + [Symbol.iterator](): IterableIterator<[string, string]>; + } + + export class URL { + constructor(input: string, base?: string | URL); + hash: string; + host: string; + hostname: string; + href: string; + readonly origin: string; + password: string; + pathname: string; + port: string; + protocol: string; + search: string; + readonly searchParams: URLSearchParams; + username: string; + toString(): string; + toJSON(): string; + } +} + +declare module "dns" { + // Supported getaddrinfo flags. + export const ADDRCONFIG: number; + export const V4MAPPED: number; + + export interface LookupOptions { + family?: number; + hints?: number; + all?: boolean; + } + + export interface LookupOneOptions extends LookupOptions { + all?: false; + } + + export interface LookupAllOptions extends LookupOptions { + all: true; + } + + export interface LookupAddress { + address: string; + family: number; + } + + export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void; + export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void; + export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException, addresses: LookupAddress[]) => void): void; + export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException, address: string | LookupAddress[], family: number) => void): void; + export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace lookup { + export function __promisify__(hostname: string, options: LookupAllOptions): Promise<{ address: LookupAddress[] }>; + export function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise<{ address: string, family: number }>; + export function __promisify__(hostname: string, options?: LookupOptions | number): Promise<{ address: string | LookupAddress[], family?: number }>; + } + + export interface ResolveOptions { + ttl: boolean; + } + + export interface ResolveWithTtlOptions extends ResolveOptions { + ttl: true; + } + + export interface RecordWithTtl { + address: string; + ttl: number; + } + + export interface MxRecord { + priority: number; + exchange: string; + } + + export interface NaptrRecord { + flags: string; + service: string; + regexp: string; + replacement: string; + order: number; + preference: number; + } + + export interface SoaRecord { + nsname: string; + hostmaster: string; + serial: number; + refresh: number; + retry: number; + expire: number; + minttl: number; + } + + export interface SrvRecord { + priority: number; + weight: number; + port: number; + name: string; + } + + export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void; + export function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void; + export function resolve(hostname: string, rrtype: "NS", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "PTR", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "SOA", callback: (err: NodeJS.ErrnoException, addresses: SoaRecord) => void): void; + export function resolve(hostname: string, rrtype: "SRV", callback: (err: NodeJS.ErrnoException, addresses: SrvRecord[]) => void): void; + export function resolve(hostname: string, rrtype: "TXT", callback: (err: NodeJS.ErrnoException, addresses: string[][]) => void): void; + export function resolve(hostname: string, rrtype: string, callback: (err: NodeJS.ErrnoException, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][]) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace resolve { + export function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise; + export function __promisify__(hostname: string, rrtype: "MX"): Promise; + export function __promisify__(hostname: string, rrtype: "NAPTR"): Promise; + export function __promisify__(hostname: string, rrtype: "SOA"): Promise; + export function __promisify__(hostname: string, rrtype: "SRV"): Promise; + export function __promisify__(hostname: string, rrtype: "TXT"): Promise; + export function __promisify__(hostname: string, rrtype?: string): Promise; + } + + export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException, addresses: RecordWithTtl[]) => void): void; + export function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException, addresses: string[] | RecordWithTtl[]) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace resolve4 { + export function __promisify__(hostname: string): Promise; + export function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; + export function __promisify__(hostname: string, options?: ResolveOptions): Promise; + } + + export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException, addresses: RecordWithTtl[]) => void): void; + export function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException, addresses: string[] | RecordWithTtl[]) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace resolve6 { + export function __promisify__(hostname: string): Promise; + export function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; + export function __promisify__(hostname: string, options?: ResolveOptions): Promise; + } + + export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void; + export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void; + export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException, address: SoaRecord) => void): void; + export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: SrvRecord[]) => void): void; + export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[][]) => void): void; + + export function reverse(ip: string, callback: (err: NodeJS.ErrnoException, hostnames: string[]) => void): void; + export function setServers(servers: string[]): void; + + // Error codes + export var NODATA: string; + export var FORMERR: string; + export var SERVFAIL: string; + export var NOTFOUND: string; + export var NOTIMP: string; + export var REFUSED: string; + export var BADQUERY: string; + export var BADNAME: string; + export var BADFAMILY: string; + export var BADRESP: string; + export var CONNREFUSED: string; + export var TIMEOUT: string; + export var EOF: string; + export var FILE: string; + export var NOMEM: string; + export var DESTRUCTION: string; + export var BADSTR: string; + export var BADFLAGS: string; + export var NONAME: string; + export var BADHINTS: string; + export var NOTINITIALIZED: string; + export var LOADIPHLPAPI: string; + export var ADDRGETNETWORKPARAMS: string; + export var CANCELLED: string; +} + +declare module "net" { + import * as stream from "stream"; + import * as events from "events"; + import * as dns from "dns"; + + type LookupFunction = (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void; + + export interface SocketConstructorOpts { + fd?: number; + allowHalfOpen?: boolean; + readable?: boolean; + writable?: boolean; + } + + export interface TcpSocketConnectOpts { + port: number; + host?: string; + localAddress?: string; + localPort?: number; + hints?: number; + family?: number; + lookup?: LookupFunction; + } + + export interface IpcSocketConnectOpts { + path: string; + } + + export type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; + + export class Socket extends stream.Duplex { + constructor(options?: SocketConstructorOpts); + + // Extended base methods + write(buffer: Buffer): boolean; + write(buffer: Buffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + write(str: string, encoding?: string, fd?: string): boolean; + write(data: any, encoding?: string, callback?: Function): void; + + connect(options: SocketConnectOpts, connectionListener?: Function): this; + connect(port: number, host: string, connectionListener?: Function): this; + connect(port: number, connectionListener?: Function): this; + connect(path: string, connectionListener?: Function): this; + + bufferSize: number; + setEncoding(encoding?: string): this; + destroy(err?: any): void; + pause(): this; + resume(): this; + setTimeout(timeout: number, callback?: Function): this; + setNoDelay(noDelay?: boolean): this; + setKeepAlive(enable?: boolean, initialDelay?: number): this; + address(): { port: number; family: string; address: string; }; + unref(): void; + ref(): void; + + remoteAddress?: string; + remoteFamily?: string; + remotePort?: number; + localAddress: string; + localPort: number; + bytesRead: number; + bytesWritten: number; + connecting: boolean; + destroyed: boolean; + + // Extended base methods + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + end(data?: any, encoding?: string): void; + + /** + * events.EventEmitter + * 1. close + * 2. connect + * 3. data + * 4. drain + * 5. end + * 6. error + * 7. lookup + * 8. timeout + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: (had_error: boolean) => void): this; + addListener(event: "connect", listener: () => void): this; + addListener(event: "data", listener: (data: Buffer) => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "end", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + addListener(event: "timeout", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close", had_error: boolean): boolean; + emit(event: "connect"): boolean; + emit(event: "data", data: Buffer): boolean; + emit(event: "drain"): boolean; + emit(event: "end"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean; + emit(event: "timeout"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: (had_error: boolean) => void): this; + on(event: "connect", listener: () => void): this; + on(event: "data", listener: (data: Buffer) => void): this; + on(event: "drain", listener: () => void): this; + on(event: "end", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + on(event: "timeout", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: (had_error: boolean) => void): this; + once(event: "connect", listener: () => void): this; + once(event: "data", listener: (data: Buffer) => void): this; + once(event: "drain", listener: () => void): this; + once(event: "end", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + once(event: "timeout", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: (had_error: boolean) => void): this; + prependListener(event: "connect", listener: () => void): this; + prependListener(event: "data", listener: (data: Buffer) => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "end", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + prependListener(event: "timeout", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: (had_error: boolean) => void): this; + prependOnceListener(event: "connect", listener: () => void): this; + prependOnceListener(event: "data", listener: (data: Buffer) => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "end", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + } + + export interface ListenOptions { + port?: number; + host?: string; + backlog?: number; + path?: string; + exclusive?: boolean; + } + + // https://github.com/nodejs/node/blob/master/lib/net.js + export class Server extends events.EventEmitter { + constructor(connectionListener?: (socket: Socket) => void); + constructor(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void); + + listen(port?: number, hostname?: string, backlog?: number, listeningListener?: Function): this; + listen(port?: number, hostname?: string, listeningListener?: Function): this; + listen(port?: number, backlog?: number, listeningListener?: Function): this; + listen(port?: number, listeningListener?: Function): this; + listen(path: string, backlog?: number, listeningListener?: Function): this; + listen(path: string, listeningListener?: Function): this; + listen(options: ListenOptions, listeningListener?: Function): this; + listen(handle: any, backlog?: number, listeningListener?: Function): this; + listen(handle: any, listeningListener?: Function): this; + close(callback?: Function): this; + address(): { port: number; family: string; address: string; }; + getConnections(cb: (error: Error | null, count: number) => void): void; + ref(): this; + unref(): this; + maxConnections: number; + connections: number; + listening: boolean; + + /** + * events.EventEmitter + * 1. close + * 2. connection + * 3. error + * 4. listening + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "connection", listener: (socket: Socket) => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "listening", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "connection", socket: Socket): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "listening"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "connection", listener: (socket: Socket) => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "listening", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "connection", listener: (socket: Socket) => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "listening", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "connection", listener: (socket: Socket) => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "listening", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "connection", listener: (socket: Socket) => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "listening", listener: () => void): this; + } + + export interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { + timeout?: number; + } + + export interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts { + timeout?: number; + } + + export type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts; + + export function createServer(connectionListener?: (socket: Socket) => void): Server; + export function createServer(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void): Server; + export function connect(options: NetConnectOpts, connectionListener?: Function): Socket; + export function connect(port: number, host?: string, connectionListener?: Function): Socket; + export function connect(path: string, connectionListener?: Function): Socket; + export function createConnection(options: NetConnectOpts, connectionListener?: Function): Socket; + export function createConnection(port: number, host?: string, connectionListener?: Function): Socket; + export function createConnection(path: string, connectionListener?: Function): Socket; + export function isIP(input: string): number; + export function isIPv4(input: string): boolean; + export function isIPv6(input: string): boolean; +} + +declare module "dgram" { + import * as events from "events"; + import * as dns from "dns"; + + interface RemoteInfo { + address: string; + family: string; + port: number; + } + + interface AddressInfo { + address: string; + family: string; + port: number; + } + + interface BindOptions { + port: number; + address?: string; + exclusive?: boolean; + } + + type SocketType = "udp4" | "udp6"; + + interface SocketOptions { + type: SocketType; + reuseAddr?: boolean; + recvBufferSize?: number; + sendBufferSize?: number; + lookup?: (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void) => void; + } + + export function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + export function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + + export class Socket extends events.EventEmitter { + send(msg: Buffer | String | any[], port: number, address: string, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: Buffer | String | any[], offset: number, length: number, port: number, address: string, callback?: (error: Error | null, bytes: number) => void): void; + bind(port?: number, address?: string, callback?: () => void): void; + bind(port?: number, callback?: () => void): void; + bind(callback?: () => void): void; + bind(options: BindOptions, callback?: Function): void; + close(callback?: () => void): void; + address(): AddressInfo; + setBroadcast(flag: boolean): void; + setTTL(ttl: number): void; + setMulticastTTL(ttl: number): void; + setMulticastInterface(multicastInterface: string): void; + setMulticastLoopback(flag: boolean): void; + addMembership(multicastAddress: string, multicastInterface?: string): void; + dropMembership(multicastAddress: string, multicastInterface?: string): void; + ref(): this; + unref(): this; + setRecvBufferSize(size: number): void; + setSendBufferSize(size: number): void; + getRecvBufferSize(): number; + getSendBufferSize(): number; + + /** + * events.EventEmitter + * 1. close + * 2. error + * 3. listening + * 4. message + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "listening", listener: () => void): this; + addListener(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "listening"): boolean; + emit(event: "message", msg: Buffer, rinfo: AddressInfo): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "listening", listener: () => void): this; + on(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "listening", listener: () => void): this; + once(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "listening", listener: () => void): this; + prependListener(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "listening", listener: () => void): this; + prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this; + } +} + +declare module "fs" { + import * as stream from "stream"; + import * as events from "events"; + import { URL } from "url"; + + /** + * Valid types for path values in "fs". + */ + export type PathLike = string | Buffer | URL; + + export class Stats { + isFile(): boolean; + isDirectory(): boolean; + isBlockDevice(): boolean; + isCharacterDevice(): boolean; + isSymbolicLink(): boolean; + isFIFO(): boolean; + isSocket(): boolean; + dev: number; + ino: number; + mode: number; + nlink: number; + uid: number; + gid: number; + rdev: number; + size: number; + blksize: number; + blocks: number; + atimeMs: number; + mtimeMs: number; + ctimeMs: number; + birthtimeMs: number; + atime: Date; + mtime: Date; + ctime: Date; + birthtime: Date; + } + + export interface FSWatcher extends events.EventEmitter { + close(): void; + + /** + * events.EventEmitter + * 1. change + * 2. error + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + addListener(event: "error", listener: (error: Error) => void): this; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + on(event: "error", listener: (error: Error) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + once(event: "error", listener: (error: Error) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + prependListener(event: "error", listener: (error: Error) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + prependOnceListener(event: "error", listener: (error: Error) => void): this; + } + + export class ReadStream extends stream.Readable { + close(): void; + destroy(): void; + bytesRead: number; + path: string | Buffer; + + /** + * events.EventEmitter + * 1. open + * 2. close + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "open", listener: (fd: number) => void): this; + addListener(event: "close", listener: () => void): this; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "open", listener: (fd: number) => void): this; + on(event: "close", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "open", listener: (fd: number) => void): this; + once(event: "close", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "open", listener: (fd: number) => void): this; + prependListener(event: "close", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "open", listener: (fd: number) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + } + + export class WriteStream extends stream.Writable { + close(): void; + bytesWritten: number; + path: string | Buffer; + + /** + * events.EventEmitter + * 1. open + * 2. close + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "open", listener: (fd: number) => void): this; + addListener(event: "close", listener: () => void): this; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "open", listener: (fd: number) => void): this; + on(event: "close", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "open", listener: (fd: number) => void): this; + once(event: "close", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "open", listener: (fd: number) => void): this; + prependListener(event: "close", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "open", listener: (fd: number) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + } + + /** + * Asynchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function rename(oldPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace rename { + /** + * Asynchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function __promisify__(oldPath: PathLike, newPath: PathLike): Promise; + } + + /** + * Synchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function renameSync(oldPath: PathLike, newPath: PathLike): void; + + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + export function truncate(path: PathLike, len: number | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function truncate(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace truncate { + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + export function __promisify__(path: PathLike, len?: number | null): Promise; + } + + /** + * Synchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + export function truncateSync(path: PathLike, len?: number | null): void; + + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + * @param len If not specified, defaults to `0`. + */ + export function ftruncate(fd: number, len: number | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + */ + export function ftruncate(fd: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace ftruncate { + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + * @param len If not specified, defaults to `0`. + */ + export function __promisify__(fd: number, len?: number | null): Promise; + } + + /** + * Synchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + * @param len If not specified, defaults to `0`. + */ + export function ftruncateSync(fd: number, len?: number | null): void; + + /** + * Asynchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function chown(path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace chown { + /** + * Asynchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function __promisify__(path: PathLike, uid: number, gid: number): Promise; + } + + /** + * Synchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function chownSync(path: PathLike, uid: number, gid: number): void; + + /** + * Asynchronous fchown(2) - Change ownership of a file. + * @param fd A file descriptor. + */ + export function fchown(fd: number, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace fchown { + /** + * Asynchronous fchown(2) - Change ownership of a file. + * @param fd A file descriptor. + */ + export function __promisify__(fd: number, uid: number, gid: number): Promise; + } + + /** + * Synchronous fchown(2) - Change ownership of a file. + * @param fd A file descriptor. + */ + export function fchownSync(fd: number, uid: number, gid: number): void; + + /** + * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function lchown(path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace lchown { + /** + * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function __promisify__(path: PathLike, uid: number, gid: number): Promise; + } + + /** + * Synchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function lchownSync(path: PathLike, uid: number, gid: number): void; + + /** + * Asynchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function chmod(path: PathLike, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace chmod { + /** + * Asynchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function __promisify__(path: PathLike, mode: string | number): Promise; + } + + /** + * Synchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function chmodSync(path: PathLike, mode: string | number): void; + + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param fd A file descriptor. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function fchmod(fd: number, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace fchmod { + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param fd A file descriptor. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function __promisify__(fd: number, mode: string | number): Promise; + } + + /** + * Synchronous fchmod(2) - Change permissions of a file. + * @param fd A file descriptor. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function fchmodSync(fd: number, mode: string | number): void; + + /** + * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function lchmod(path: PathLike, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace lchmod { + /** + * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function __promisify__(path: PathLike, mode: string | number): Promise; + } + + /** + * Synchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function lchmodSync(path: PathLike, mode: string | number): void; + + /** + * Asynchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException, stats: Stats) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace stat { + /** + * Asynchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function statSync(path: PathLike): Stats; + + /** + * Asynchronous fstat(2) - Get file status. + * @param fd A file descriptor. + */ + export function fstat(fd: number, callback: (err: NodeJS.ErrnoException, stats: Stats) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace fstat { + /** + * Asynchronous fstat(2) - Get file status. + * @param fd A file descriptor. + */ + export function __promisify__(fd: number): Promise; + } + + /** + * Synchronous fstat(2) - Get file status. + * @param fd A file descriptor. + */ + export function fstatSync(fd: number): Stats; + + /** + * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException, stats: Stats) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace lstat { + /** + * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function lstatSync(path: PathLike): Stats; + + /** + * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function link(existingPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace link { + /** + * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function link(existingPath: PathLike, newPath: PathLike): Promise; + } + + /** + * Synchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function linkSync(existingPath: PathLike, newPath: PathLike): void; + + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + export function symlink(target: PathLike, path: PathLike, type: string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + */ + export function symlink(target: PathLike, path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace symlink { + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + export function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise; + } + + /** + * Synchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + export function symlinkSync(target: PathLike, path: PathLike, type?: string | null): void; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlink(path: PathLike, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, linkString: string) => void): void; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlink(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, linkString: Buffer) => void): void; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlink(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, linkString: string | Buffer) => void): void; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException, linkString: string) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace readlink { + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + } + + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlinkSync(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string; + + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlinkSync(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer; + + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlinkSync(path: PathLike, options?: { encoding?: string | null } | string | null): string | Buffer; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpath(path: PathLike, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => void): void; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpath(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, resolvedPath: Buffer) => void): void; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpath(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, resolvedPath: string | Buffer) => void): void; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace realpath { + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + + export function native(path: PathLike, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => void): void; + export function native(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, resolvedPath: Buffer) => void): void; + export function native(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, resolvedPath: string | Buffer) => void): void; + export function native(path: PathLike, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => void): void; + } + + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpathSync(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string; + + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpathSync(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer; + + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpathSync(path: PathLike, options?: { encoding?: string | null } | string | null): string | Buffer; + + export namespace realpathSync { + export function native(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string; + export function native(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer; + export function native(path: PathLike, options?: { encoding?: string | null } | string | null): string | Buffer; + } + + /** + * Asynchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function unlink(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace unlink { + /** + * Asynchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function unlinkSync(path: PathLike): void; + + /** + * Asynchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function rmdir(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace rmdir { + /** + * Asynchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function rmdirSync(path: PathLike): void; + + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdir(path: PathLike, mode: number | string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Asynchronous mkdir(2) - create a directory with a mode of `0o777`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function mkdir(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace mkdir { + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function __promisify__(path: PathLike, mode?: number | string | null): Promise; + } + + /** + * Synchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdirSync(path: PathLike, mode?: number | string | null): void; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtemp(prefix: string, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, folder: string) => void): void; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtemp(prefix: string, options: "buffer" | { encoding: "buffer" }, callback: (err: NodeJS.ErrnoException, folder: Buffer) => void): void; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtemp(prefix: string, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, folder: string | Buffer) => void): void; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + */ + export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException, folder: string) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace mkdtemp { + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(prefix: string, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(prefix: string, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(prefix: string, options?: { encoding?: string | null } | string | null): Promise; + } + + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtempSync(prefix: string, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string; + + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtempSync(prefix: string, options: { encoding: "buffer" } | "buffer"): Buffer; + + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtempSync(prefix: string, options?: { encoding?: string | null } | string | null): string | Buffer; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir(path: PathLike, options: { encoding: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, files: Buffer[]) => void): void; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, files: string[] | Buffer[]) => void): void; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace readdir { + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options?: { encoding: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options: "buffer" | { encoding: "buffer" }): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + } + + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync(path: PathLike, options?: { encoding: BufferEncoding | null } | BufferEncoding | null): string[]; + + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer[]; + + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync(path: PathLike, options?: { encoding?: string | null } | string | null): string[] | Buffer[]; + + /** + * Asynchronous close(2) - close a file descriptor. + * @param fd A file descriptor. + */ + export function close(fd: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace close { + /** + * Asynchronous close(2) - close a file descriptor. + * @param fd A file descriptor. + */ + export function __promisify__(fd: number): Promise; + } + + /** + * Synchronous close(2) - close a file descriptor. + * @param fd A file descriptor. + */ + export function closeSync(fd: number): void; + + /** + * Asynchronous open(2) - open and possibly create a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. + */ + export function open(path: PathLike, flags: string | number, mode: string | number | undefined | null, callback: (err: NodeJS.ErrnoException, fd: number) => void): void; + + /** + * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function open(path: PathLike, flags: string | number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace open { + /** + * Asynchronous open(2) - open and possibly create a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. + */ + export function __promisify__(path: PathLike, flags: string | number, mode?: string | number | null): Promise; + } + + /** + * Synchronous open(2) - open and possibly create a file, returning a file descriptor.. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. + */ + export function openSync(path: PathLike, flags: string | number, mode?: string | number | null): number; + + /** + * Asynchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace utimes { + /** + * Asynchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function __promisify__(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise; + } + + /** + * Synchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function utimesSync(path: PathLike, atime: string | number | Date, mtime: string | number | Date): void; + + /** + * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function futimes(fd: number, atime: string | number | Date, mtime: string | number | Date, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace futimes { + /** + * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function __promisify__(fd: number, atime: string | number | Date, mtime: string | number | Date): Promise; + } + + /** + * Synchronously change file timestamps of the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function futimesSync(fd: number, atime: string | number | Date, mtime: string | number | Date): void; + + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param fd A file descriptor. + */ + export function fsync(fd: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace fsync { + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param fd A file descriptor. + */ + export function __promisify__(fd: number): Promise; + } + + /** + * Synchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param fd A file descriptor. + */ + export function fsyncSync(fd: number): void; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + export function write(fd: number, buffer: TBuffer, offset: number | undefined | null, length: number | undefined | null, position: number | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void): void; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + */ + export function write(fd: number, buffer: TBuffer, offset: number | undefined | null, length: number | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void): void; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + */ + export function write(fd: number, buffer: TBuffer, offset: number | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void): void; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + */ + export function write(fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void): void; + + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + export function write(fd: number, string: any, position: number | undefined | null, encoding: string | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; + + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + export function write(fd: number, string: any, position: number | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; + + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + */ + export function write(fd: number, string: any, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace write { + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + export function __promisify__(fd: number, buffer?: TBuffer, offset?: number, length?: number, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>; + + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + export function __promisify__(fd: number, string: any, position?: number | null, encoding?: string | null): Promise<{ bytesWritten: number, buffer: string }>; + } + + /** + * Synchronously writes `buffer` to the file referenced by the supplied file descriptor, returning the number of bytes written. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + export function writeSync(fd: number, buffer: Buffer | Uint8Array, offset?: number | null, length?: number | null, position?: number | null): number; + + /** + * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written. + * @param fd A file descriptor. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + export function writeSync(fd: number, string: any, position?: number | null, encoding?: string | null): number; + + /** + * Asynchronously reads data from the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + export function read(fd: number, buffer: TBuffer, offset: number, length: number, position: number | null, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: TBuffer) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace read { + /** + * @param fd A file descriptor. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + export function __promisify__(fd: number, buffer: TBuffer, offset: number, length: number, position: number | null): Promise<{ bytesRead: number, buffer: TBuffer }>; + } + + /** + * Synchronously reads data from the file referenced by the supplied file descriptor, returning the number of bytes read. + * @param fd A file descriptor. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + export function readSync(fd: number, buffer: Buffer | Uint8Array, offset: number, length: number, position: number | null): number; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFile(path: PathLike | number, options: { encoding?: null; flag?: string; } | undefined | null, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFile(path: PathLike | number, options: { encoding: string; flag?: string; } | string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFile(path: PathLike | number, options: { encoding?: string | null; flag?: string; } | string | undefined | null, callback: (err: NodeJS.ErrnoException, data: string | Buffer) => void): void; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + */ + export function readFile(path: PathLike | number, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace readFile { + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function __promisify__(path: PathLike | number, options?: { encoding?: null; flag?: string; } | null): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function __promisify__(path: PathLike | number, options: { encoding: string; flag?: string; } | string): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function __promisify__(path: PathLike | number, options?: { encoding?: string | null; flag?: string; } | string | null): Promise; + } + + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. If a flag is not provided, it defaults to `'r'`. + */ + export function readFileSync(path: PathLike | number, options?: { encoding?: null; flag?: string; } | null): Buffer; + + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFileSync(path: PathLike | number, options: { encoding: string; flag?: string; } | string): string; + + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFileSync(path: PathLike | number, options?: { encoding?: string | null; flag?: string; } | string | null): string | Buffer; + + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + export function writeFile(path: PathLike | number, data: any, options: { encoding?: string | null; mode?: number | string; flag?: string; } | string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + */ + export function writeFile(path: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace writeFile { + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + export function __promisify__(path: PathLike | number, data: any, options?: { encoding?: string | null; mode?: number | string; flag?: string; } | string | null): Promise; + } + + /** + * Synchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + export function writeFileSync(path: PathLike | number, data: any, options?: { encoding?: string | null; mode?: number | string; flag?: string; } | string | null): void; + + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + export function appendFile(file: PathLike | number, data: any, options: { encoding?: string | null, mode?: string | number, flag?: string } | string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + */ + export function appendFile(file: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace appendFile { + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + export function __promisify__(file: PathLike | number, data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string } | string | null): Promise; + } + + /** + * Synchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + export function appendFileSync(file: PathLike | number, data: any, options?: { encoding?: string | null; mode?: number | string; flag?: string; } | string | null): void; + + /** + * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. + */ + export function watchFile(filename: PathLike, options: { persistent?: boolean; interval?: number; } | undefined, listener: (curr: Stats, prev: Stats) => void): void; + + /** + * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function watchFile(filename: PathLike, listener: (curr: Stats, prev: Stats) => void): void; + + /** + * Stop watching for changes on `filename`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function unwatchFile(filename: PathLike, listener?: (curr: Stats, prev: Stats) => void): void; + + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + export function watch(filename: PathLike, options: { encoding?: BufferEncoding | null, persistent?: boolean, recursive?: boolean } | BufferEncoding | undefined | null, listener?: (event: string, filename: string) => void): FSWatcher; + + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + export function watch(filename: PathLike, options: { encoding: "buffer", persistent?: boolean, recursive?: boolean } | "buffer", listener?: (event: string, filename: Buffer) => void): FSWatcher; + + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + export function watch(filename: PathLike, options: { encoding?: string | null, persistent?: boolean, recursive?: boolean } | string | null, listener?: (event: string, filename: string | Buffer) => void): FSWatcher; + + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function watch(filename: PathLike, listener?: (event: string, filename: string) => any): FSWatcher; + + /** + * Asynchronously tests whether or not the given path exists by checking with the file system. + * @deprecated + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function exists(path: PathLike, callback: (exists: boolean) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace exists { + /** + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronously tests whether or not the given path exists by checking with the file system. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function existsSync(path: PathLike): boolean; + + export namespace constants { + // File Access Constants + + /** Constant for fs.access(). File is visible to the calling process. */ + export const F_OK: number; + + /** Constant for fs.access(). File can be read by the calling process. */ + export const R_OK: number; + + /** Constant for fs.access(). File can be written by the calling process. */ + export const W_OK: number; + + /** Constant for fs.access(). File can be executed by the calling process. */ + export const X_OK: number; + + // File Open Constants + + /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ + export const O_RDONLY: number; + + /** Constant for fs.open(). Flag indicating to open a file for write-only access. */ + export const O_WRONLY: number; + + /** Constant for fs.open(). Flag indicating to open a file for read-write access. */ + export const O_RDWR: number; + + /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */ + export const O_CREAT: number; + + /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */ + export const O_EXCL: number; + + /** Constant for fs.open(). Flag indicating that if path identifies a terminal device, opening the path shall not cause that terminal to become the controlling terminal for the process (if the process does not already have one). */ + export const O_NOCTTY: number; + + /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */ + export const O_TRUNC: number; + + /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */ + export const O_APPEND: number; + + /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */ + export const O_DIRECTORY: number; + + /** Constant for fs.open(). Flag indicating reading accesses to the file system will no longer result in an update to the atime information associated with the file. This flag is available on Linux operating systems only. */ + export const O_NOATIME: number; + + /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */ + export const O_NOFOLLOW: number; + + /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */ + export const O_SYNC: number; + + /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */ + export const O_DSYNC: number; + + /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */ + export const O_SYMLINK: number; + + /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */ + export const O_DIRECT: number; + + /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */ + export const O_NONBLOCK: number; + + // File Type Constants + + /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */ + export const S_IFMT: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */ + export const S_IFREG: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */ + export const S_IFDIR: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */ + export const S_IFCHR: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */ + export const S_IFBLK: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */ + export const S_IFIFO: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */ + export const S_IFLNK: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */ + export const S_IFSOCK: number; + + // File Mode Constants + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */ + export const S_IRWXU: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */ + export const S_IRUSR: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */ + export const S_IWUSR: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */ + export const S_IXUSR: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */ + export const S_IRWXG: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */ + export const S_IRGRP: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */ + export const S_IWGRP: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */ + export const S_IXGRP: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */ + export const S_IRWXO: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */ + export const S_IROTH: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */ + export const S_IWOTH: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ + export const S_IXOTH: number; + + /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ + export const COPYFILE_EXCL: number; + } + + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function access(path: PathLike, mode: number | undefined, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function access(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace access { + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function __promisify__(path: PathLike, mode?: number): Promise; + } + + /** + * Synchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function accessSync(path: PathLike, mode?: number): void; + + /** + * Returns a new `ReadStream` object. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function createReadStream(path: PathLike, options?: string | { + flags?: string; + encoding?: string; + fd?: number; + mode?: number; + autoClose?: boolean; + start?: number; + end?: number; + highWaterMark?: number; + }): ReadStream; + + /** + * Returns a new `WriteStream` object. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function createWriteStream(path: PathLike, options?: string | { + flags?: string; + encoding?: string; + fd?: number; + mode?: number; + autoClose?: boolean; + start?: number; + }): WriteStream; + + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param fd A file descriptor. + */ + export function fdatasync(fd: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace fdatasync { + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param fd A file descriptor. + */ + export function __promisify__(fd: number): Promise; + } + + /** + * Synchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param fd A file descriptor. + */ + export function fdatasyncSync(fd: number): void; + + /** + * Asynchronously copies src to dest. By default, dest is overwritten if it already exists. + * No arguments other than a possible exception are given to the callback function. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + */ + export function copyFile(src: PathLike, dest: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + /** + * Asynchronously copies src to dest. By default, dest is overwritten if it already exists. + * No arguments other than a possible exception are given to the callback function. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + * @param flags An integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists. + */ + export function copyFile(src: PathLike, dest: PathLike, flags: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace copyFile { + /** + * Asynchronously copies src to dest. By default, dest is overwritten if it already exists. + * No arguments other than a possible exception are given to the callback function. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + * @param flags An optional integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists. + */ + export function __promisify__(src: PathLike, dst: PathLike, flags?: number): Promise; + } + + /** + * Synchronously copies src to dest. By default, dest is overwritten if it already exists. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + * @param flags An optional integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists. + */ + export function copyFileSync(src: PathLike, dest: PathLike, flags?: number): void; +} + +declare module "path" { + /** + * A parsed path object generated by path.parse() or consumed by path.format(). + */ + export interface ParsedPath { + /** + * The root of the path such as '/' or 'c:\' + */ + root: string; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir: string; + /** + * The file name including extension (if any) such as 'index.html' + */ + base: string; + /** + * The file extension (if any) such as '.html' + */ + ext: string; + /** + * The file name without extension (if any) such as 'index' + */ + name: string; + } + export interface FormatInputPathObject { + /** + * The root of the path such as '/' or 'c:\' + */ + root?: string; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir?: string; + /** + * The file name including extension (if any) such as 'index.html' + */ + base?: string; + /** + * The file extension (if any) such as '.html' + */ + ext?: string; + /** + * The file name without extension (if any) such as 'index' + */ + name?: string; + } + + /** + * Normalize a string path, reducing '..' and '.' parts. + * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. + * + * @param p string path to normalize. + */ + export function normalize(p: string): string; + /** + * Join all arguments together and normalize the resulting path. + * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown. + * + * @param paths paths to join. + */ + export function join(...paths: string[]): string; + /** + * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. + * + * Starting from leftmost {from} paramter, resolves {to} to an absolute path. + * + * If {to} isn't already absolute, {from} arguments are prepended in right to left order, until an absolute path is found. If after using all {from} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory. + * + * @param pathSegments string paths to join. Non-string arguments are ignored. + */ + export function resolve(...pathSegments: string[]): string; + /** + * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. + * + * @param path path to test. + */ + export function isAbsolute(path: string): boolean; + /** + * Solve the relative path from {from} to {to}. + * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. + */ + export function relative(from: string, to: string): string; + /** + * Return the directory name of a path. Similar to the Unix dirname command. + * + * @param p the path to evaluate. + */ + export function dirname(p: string): string; + /** + * Return the last portion of a path. Similar to the Unix basename command. + * Often used to extract the file name from a fully qualified path. + * + * @param p the path to evaluate. + * @param ext optionally, an extension to remove from the result. + */ + export function basename(p: string, ext?: string): string; + /** + * Return the extension of the path, from the last '.' to end of string in the last portion of the path. + * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string + * + * @param p the path to evaluate. + */ + export function extname(p: string): string; + /** + * The platform-specific file separator. '\\' or '/'. + */ + export var sep: '\\' | '/'; + /** + * The platform-specific file delimiter. ';' or ':'. + */ + export var delimiter: ';' | ':'; + /** + * Returns an object from a path string - the opposite of format(). + * + * @param pathString path to evaluate. + */ + export function parse(pathString: string): ParsedPath; + /** + * Returns a path string from an object - the opposite of parse(). + * + * @param pathString path to evaluate. + */ + export function format(pathObject: FormatInputPathObject): string; + + export module posix { + export function normalize(p: string): string; + export function join(...paths: any[]): string; + export function resolve(...pathSegments: any[]): string; + export function isAbsolute(p: string): boolean; + export function relative(from: string, to: string): string; + export function dirname(p: string): string; + export function basename(p: string, ext?: string): string; + export function extname(p: string): string; + export var sep: string; + export var delimiter: string; + export function parse(p: string): ParsedPath; + export function format(pP: FormatInputPathObject): string; + } + + export module win32 { + export function normalize(p: string): string; + export function join(...paths: any[]): string; + export function resolve(...pathSegments: any[]): string; + export function isAbsolute(p: string): boolean; + export function relative(from: string, to: string): string; + export function dirname(p: string): string; + export function basename(p: string, ext?: string): string; + export function extname(p: string): string; + export var sep: string; + export var delimiter: string; + export function parse(p: string): ParsedPath; + export function format(pP: FormatInputPathObject): string; + } +} + +declare module "string_decoder" { + export interface NodeStringDecoder { + write(buffer: Buffer): string; + end(buffer?: Buffer): string; + } + export var StringDecoder: { + new(encoding?: string): NodeStringDecoder; + }; +} + +declare module "tls" { + import * as crypto from "crypto"; + import * as dns from "dns"; + import * as net from "net"; + import * as stream from "stream"; + + var CLIENT_RENEG_LIMIT: number; + var CLIENT_RENEG_WINDOW: number; + + export interface Certificate { + /** + * Country code. + */ + C: string; + /** + * Street. + */ + ST: string; + /** + * Locality. + */ + L: string; + /** + * Organization. + */ + O: string; + /** + * Organizational unit. + */ + OU: string; + /** + * Common name. + */ + CN: string; + } + + export interface PeerCertificate { + subject: Certificate; + issuer: Certificate; + subjectaltname: string; + infoAccess: { [index: string]: string[] | undefined }; + modulus: string; + exponent: string; + valid_from: string; + valid_to: string; + fingerprint: string; + ext_key_usage: string[]; + serialNumber: string; + raw: Buffer; + } + + export interface DetailedPeerCertificate extends PeerCertificate { + issuerCertificate: DetailedPeerCertificate; + } + + export interface CipherNameAndProtocol { + /** + * The cipher name. + */ + name: string; + /** + * SSL/TLS protocol version. + */ + version: string; + } + + export class TLSSocket extends net.Socket { + /** + * Construct a new tls.TLSSocket object from an existing TCP socket. + */ + constructor(socket: net.Socket, options?: { + /** + * An optional TLS context object from tls.createSecureContext() + */ + secureContext?: SecureContext, + /** + * If true the TLS socket will be instantiated in server-mode. + * Defaults to false. + */ + isServer?: boolean, + /** + * An optional net.Server instance. + */ + server?: net.Server, + /** + * If true the server will request a certificate from clients that + * connect and attempt to verify that certificate. Defaults to + * false. + */ + requestCert?: boolean, + /** + * If true the server will reject any connection which is not + * authorized with the list of supplied CAs. This option only has an + * effect if requestCert is true. Defaults to false. + */ + rejectUnauthorized?: boolean, + /** + * An array of strings or a Buffer naming possible NPN protocols. + * (Protocols should be ordered by their priority.) + */ + NPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array, + /** + * An array of strings or a Buffer naming possible ALPN protocols. + * (Protocols should be ordered by their priority.) When the server + * receives both NPN and ALPN extensions from the client, ALPN takes + * precedence over NPN and the server does not send an NPN extension + * to the client. + */ + ALPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array, + /** + * SNICallback(servername, cb) A function that will be + * called if the client supports SNI TLS extension. Two arguments + * will be passed when called: servername and cb. SNICallback should + * invoke cb(null, ctx), where ctx is a SecureContext instance. + * (tls.createSecureContext(...) can be used to get a proper + * SecureContext.) If SNICallback wasn't provided the default callback + * with high-level API will be used (see below). + */ + SNICallback?: (servername: string, cb: (err: Error | null, ctx: SecureContext) => void) => void, + /** + * An optional Buffer instance containing a TLS session. + */ + session?: Buffer, + /** + * If true, specifies that the OCSP status request extension will be + * added to the client hello and an 'OCSPResponse' event will be + * emitted on the socket before establishing a secure communication + */ + requestOCSP?: boolean + }); + + /** + * A boolean that is true if the peer certificate was signed by one of the specified CAs, otherwise false. + */ + authorized: boolean; + /** + * The reason why the peer's certificate has not been verified. + * This property becomes available only when tlsSocket.authorized === false. + */ + authorizationError: Error; + /** + * Static boolean value, always true. + * May be used to distinguish TLS sockets from regular ones. + */ + encrypted: boolean; + /** + * Returns an object representing the cipher name and the SSL/TLS protocol version of the current connection. + * @returns Returns an object representing the cipher name + * and the SSL/TLS protocol version of the current connection. + */ + getCipher(): CipherNameAndProtocol; + /** + * Returns an object representing the peer's certificate. + * The returned object has some properties corresponding to the field of the certificate. + * If detailed argument is true the full chain with issuer property will be returned, + * if false only the top certificate without issuer property. + * If the peer does not provide a certificate, it returns null or an empty object. + * @param detailed - If true; the full chain with issuer property will be returned. + * @returns An object representing the peer's certificate. + */ + getPeerCertificate(detailed: true): DetailedPeerCertificate; + getPeerCertificate(detailed?: false): PeerCertificate; + getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; + /** + * Returns a string containing the negotiated SSL/TLS protocol version of the current connection. + * The value `'unknown'` will be returned for connected sockets that have not completed the handshaking process. + * The value `null` will be returned for server sockets or disconnected client sockets. + * See https://www.openssl.org/docs/man1.0.2/ssl/SSL_get_version.html for more information. + * @returns negotiated SSL/TLS protocol version of the current connection + */ + getProtocol(): string | null; + /** + * Could be used to speed up handshake establishment when reconnecting to the server. + * @returns ASN.1 encoded TLS session or undefined if none was negotiated. + */ + getSession(): any; + /** + * NOTE: Works only with client TLS sockets. + * Useful only for debugging, for session reuse provide session option to tls.connect(). + * @returns TLS session ticket or undefined if none was negotiated. + */ + getTLSTicket(): any; + /** + * Initiate TLS renegotiation process. + * + * NOTE: Can be used to request peer's certificate after the secure connection has been established. + * ANOTHER NOTE: When running as the server, socket will be destroyed with an error after handshakeTimeout timeout. + * @param options - The options may contain the following fields: rejectUnauthorized, + * requestCert (See tls.createServer() for details). + * @param callback - callback(err) will be executed with null as err, once the renegotiation + * is successfully completed. + */ + renegotiate(options: { rejectUnauthorized?: boolean, requestCert?: boolean }, callback: (err: Error | null) => void): any; + /** + * Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512). + * Smaller fragment size decreases buffering latency on the client: large fragments are buffered by + * the TLS layer until the entire fragment is received and its integrity is verified; + * large fragments can span multiple roundtrips, and their processing can be delayed due to packet + * loss or reordering. However, smaller fragments add extra TLS framing bytes and CPU overhead, + * which may decrease overall server throughput. + * @param size - TLS fragment size (default and maximum value is: 16384, minimum is: 512). + * @returns Returns true on success, false otherwise. + */ + setMaxSendFragment(size: number): boolean; + + /** + * events.EventEmitter + * 1. OCSPResponse + * 2. secureConnect + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; + addListener(event: "secureConnect", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "OCSPResponse", response: Buffer): boolean; + emit(event: "secureConnect"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "OCSPResponse", listener: (response: Buffer) => void): this; + on(event: "secureConnect", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "OCSPResponse", listener: (response: Buffer) => void): this; + once(event: "secureConnect", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; + prependListener(event: "secureConnect", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; + prependOnceListener(event: "secureConnect", listener: () => void): this; + } + + export interface TlsOptions extends SecureContextOptions { + handshakeTimeout?: number; + requestCert?: boolean; + rejectUnauthorized?: boolean; + NPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array; + ALPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array; + SNICallback?: (servername: string, cb: (err: Error | null, ctx: SecureContext) => void) => void; + sessionTimeout?: number; + ticketKeys?: Buffer; + } + + export interface ConnectionOptions extends SecureContextOptions { + host?: string; + port?: number; + path?: string; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored. + socket?: net.Socket; // Establish secure connection on a given socket rather than creating a new socket + rejectUnauthorized?: boolean; // Defaults to true + NPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array; + ALPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array; + checkServerIdentity?: typeof checkServerIdentity; + servername?: string; // SNI TLS Extension + session?: Buffer; + minDHSize?: number; + secureContext?: SecureContext; // If not provided, the entire ConnectionOptions object will be passed to tls.createSecureContext() + lookup?: net.LookupFunction; + } + + export class Server extends net.Server { + addContext(hostName: string, credentials: { + key: string; + cert: string; + ca: string; + }): void; + + /** + * events.EventEmitter + * 1. tlsClientError + * 2. newSession + * 3. OCSPRequest + * 4. resumeSession + * 5. secureConnection + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + addListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this; + addListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this; + addListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this; + addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean; + emit(event: "newSession", sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void): boolean; + emit(event: "OCSPRequest", certificate: Buffer, issuer: Buffer, callback: Function): boolean; + emit(event: "resumeSession", sessionId: any, callback: (err: Error, sessionData: any) => void): boolean; + emit(event: "secureConnection", tlsSocket: TLSSocket): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + on(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this; + on(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this; + on(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this; + on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + once(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this; + once(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this; + once(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this; + once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + prependListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this; + prependListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this; + prependListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this; + prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + prependOnceListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this; + prependOnceListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this; + prependOnceListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this; + prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + } + + export interface ClearTextStream extends stream.Duplex { + authorized: boolean; + authorizationError: Error; + getPeerCertificate(): any; + getCipher: { + name: string; + version: string; + }; + address: { + port: number; + family: string; + address: string; + }; + remoteAddress: string; + remotePort: number; + } + + export interface SecurePair { + encrypted: any; + cleartext: any; + } + + export interface SecureContextOptions { + pfx?: string | Buffer | Array; + key?: string | Buffer | Array; + passphrase?: string; + cert?: string | Buffer | Array; + ca?: string | Buffer | Array; + ciphers?: string; + honorCipherOrder?: boolean; + ecdhCurve?: string; + clientCertEngine?: string; + crl?: string | Buffer | Array; + dhparam?: string | Buffer; + secureOptions?: number; // Value is a numeric bitmask of the `SSL_OP_*` options + secureProtocol?: string; // SSL Method, e.g. SSLv23_method + sessionIdContext?: string; + } + + export interface SecureContext { + context: any; + } + + /* + * Verifies the certificate `cert` is issued to host `host`. + * @host The hostname to verify the certificate against + * @cert PeerCertificate representing the peer's certificate + * + * Returns Error object, populating it with the reason, host and cert on failure. On success, returns undefined. + */ + export function checkServerIdentity(host: string, cert: PeerCertificate): Error | undefined; + export function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; + export function connect(options: ConnectionOptions, secureConnectionListener?: () => void): TLSSocket; + export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; + export function createSecureContext(details: SecureContextOptions): SecureContext; + export function getCiphers(): string[]; + + export var DEFAULT_ECDH_CURVE: string; +} + +declare module "crypto" { + export interface Certificate { + exportChallenge(spkac: string | Buffer): Buffer; + exportPublicKey(spkac: string | Buffer): Buffer; + verifySpkac(spkac: Buffer): boolean; + } + export var Certificate: { + new(): Certificate; + (): Certificate; + }; + + export var fips: boolean; + + export interface CredentialDetails { + pfx: string; + key: string; + passphrase: string; + cert: string; + ca: string | string[]; + crl: string | string[]; + ciphers: string; + } + export interface Credentials { context?: any; } + export function createCredentials(details: CredentialDetails): Credentials; + export function createHash(algorithm: string): Hash; + export function createHmac(algorithm: string, key: string | Buffer): Hmac; + + type Utf8AsciiLatin1Encoding = "utf8" | "ascii" | "latin1"; + type HexBase64Latin1Encoding = "latin1" | "hex" | "base64"; + type Utf8AsciiBinaryEncoding = "utf8" | "ascii" | "binary"; + type HexBase64BinaryEncoding = "binary" | "base64" | "hex"; + type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid"; + + export interface Hash extends NodeJS.ReadWriteStream { + update(data: string | Buffer | DataView): Hash; + update(data: string | Buffer | DataView, input_encoding: Utf8AsciiLatin1Encoding): Hash; + digest(): Buffer; + digest(encoding: HexBase64Latin1Encoding): string; + } + export interface Hmac extends NodeJS.ReadWriteStream { + update(data: string | Buffer | DataView): Hmac; + update(data: string | Buffer | DataView, input_encoding: Utf8AsciiLatin1Encoding): Hmac; + digest(): Buffer; + digest(encoding: HexBase64Latin1Encoding): string; + } + export function createCipher(algorithm: string, password: any): Cipher; + export function createCipheriv(algorithm: string, key: any, iv: any): Cipher; + export interface Cipher extends NodeJS.ReadWriteStream { + update(data: Buffer | DataView): Buffer; + update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer; + update(data: Buffer | DataView, input_encoding: any, output_encoding: HexBase64BinaryEncoding): string; + update(data: string, input_encoding: Utf8AsciiBinaryEncoding, output_encoding: HexBase64BinaryEncoding): string; + final(): Buffer; + final(output_encoding: string): string; + setAutoPadding(auto_padding?: boolean): this; + getAuthTag(): Buffer; + setAAD(buffer: Buffer): this; + } + export function createDecipher(algorithm: string, password: any): Decipher; + export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher; + export interface Decipher extends NodeJS.ReadWriteStream { + update(data: Buffer | DataView): Buffer; + update(data: string, input_encoding: HexBase64BinaryEncoding): Buffer; + update(data: Buffer | DataView, input_encoding: any, output_encoding: Utf8AsciiBinaryEncoding): string; + update(data: string, input_encoding: HexBase64BinaryEncoding, output_encoding: Utf8AsciiBinaryEncoding): string; + final(): Buffer; + final(output_encoding: string): string; + setAutoPadding(auto_padding?: boolean): this; + setAuthTag(tag: Buffer): this; + setAAD(buffer: Buffer): this; + } + export function createSign(algorithm: string): Signer; + export interface Signer extends NodeJS.WritableStream { + update(data: string | Buffer | DataView): Signer; + update(data: string | Buffer | DataView, input_encoding: Utf8AsciiLatin1Encoding): Signer; + sign(private_key: string | { key: string; passphrase: string }): Buffer; + sign(private_key: string | { key: string; passphrase: string }, output_format: HexBase64Latin1Encoding): string; + } + export function createVerify(algorith: string): Verify; + export interface Verify extends NodeJS.WritableStream { + update(data: string | Buffer | DataView): Verify; + update(data: string | Buffer | DataView, input_encoding: Utf8AsciiLatin1Encoding): Verify; + verify(object: string | Object, signature: Buffer | DataView): boolean; + verify(object: string | Object, signature: string, signature_format: HexBase64Latin1Encoding): boolean; + // https://nodejs.org/api/crypto.html#crypto_verifier_verify_object_signature_signature_format + // The signature field accepts a TypedArray type, but it is only available starting ES2017 + } + export function createDiffieHellman(prime_length: number, generator?: number): DiffieHellman; + export function createDiffieHellman(prime: Buffer): DiffieHellman; + export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding): DiffieHellman; + export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | Buffer): DiffieHellman; + export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: string, generator_encoding: HexBase64Latin1Encoding): DiffieHellman; + export interface DiffieHellman { + generateKeys(): Buffer; + generateKeys(encoding: HexBase64Latin1Encoding): string; + computeSecret(other_public_key: Buffer): Buffer; + computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer; + computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string; + getPrime(): Buffer; + getPrime(encoding: HexBase64Latin1Encoding): string; + getGenerator(): Buffer; + getGenerator(encoding: HexBase64Latin1Encoding): string; + getPublicKey(): Buffer; + getPublicKey(encoding: HexBase64Latin1Encoding): string; + getPrivateKey(): Buffer; + getPrivateKey(encoding: HexBase64Latin1Encoding): string; + setPublicKey(public_key: Buffer): void; + setPublicKey(public_key: string, encoding: string): void; + setPrivateKey(private_key: Buffer): void; + setPrivateKey(private_key: string, encoding: string): void; + verifyError: number; + } + export function getDiffieHellman(group_name: string): DiffieHellman; + export function pbkdf2(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => any): void; + export function pbkdf2Sync(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string): Buffer; + export function randomBytes(size: number): Buffer; + export function randomBytes(size: number, callback: (err: Error, buf: Buffer) => void): void; + export function pseudoRandomBytes(size: number): Buffer; + export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) => void): void; + export function randomFillSync(buffer: Buffer | Uint8Array, offset?: number, size?: number): Buffer; + export function randomFill(buffer: Buffer, callback: (err: Error, buf: Buffer) => void): void; + export function randomFill(buffer: Uint8Array, callback: (err: Error, buf: Uint8Array) => void): void; + export function randomFill(buffer: Buffer, offset: number, callback: (err: Error, buf: Buffer) => void): void; + export function randomFill(buffer: Uint8Array, offset: number, callback: (err: Error, buf: Uint8Array) => void): void; + export function randomFill(buffer: Buffer, offset: number, size: number, callback: (err: Error, buf: Buffer) => void): void; + export function randomFill(buffer: Uint8Array, offset: number, size: number, callback: (err: Error, buf: Uint8Array) => void): void; + export interface RsaPublicKey { + key: string; + padding?: number; + } + export interface RsaPrivateKey { + key: string; + passphrase?: string; + padding?: number; + } + export function publicEncrypt(public_key: string | RsaPublicKey, buffer: Buffer): Buffer; + export function privateDecrypt(private_key: string | RsaPrivateKey, buffer: Buffer): Buffer; + export function privateEncrypt(private_key: string | RsaPrivateKey, buffer: Buffer): Buffer; + export function publicDecrypt(public_key: string | RsaPublicKey, buffer: Buffer): Buffer; + export function getCiphers(): string[]; + export function getCurves(): string[]; + export function getHashes(): string[]; + export interface ECDH { + generateKeys(): Buffer; + generateKeys(encoding: HexBase64Latin1Encoding): string; + generateKeys(encoding: HexBase64Latin1Encoding, format: ECDHKeyFormat): string; + computeSecret(other_public_key: Buffer): Buffer; + computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer; + computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string; + getPrivateKey(): Buffer; + getPrivateKey(encoding: HexBase64Latin1Encoding): string; + getPublicKey(): Buffer; + getPublicKey(encoding: HexBase64Latin1Encoding): string; + getPublicKey(encoding: HexBase64Latin1Encoding, format: ECDHKeyFormat): string; + setPrivateKey(private_key: Buffer): void; + setPrivateKey(private_key: string, encoding: HexBase64Latin1Encoding): void; + } + export function createECDH(curve_name: string): ECDH; + export function timingSafeEqual(a: Buffer, b: Buffer): boolean; + export var DEFAULT_ENCODING: string; +} + +declare module "stream" { + import * as events from "events"; + + class internal extends events.EventEmitter { + pipe(destination: T, options?: { end?: boolean; }): T; + } + + namespace internal { + export class Stream extends internal { } + + export interface ReadableOptions { + highWaterMark?: number; + encoding?: string; + objectMode?: boolean; + read?: (this: Readable, size?: number) => any; + destroy?: (error?: Error) => any; + } + + export class Readable extends Stream implements NodeJS.ReadableStream { + readable: boolean; + readonly readableHighWaterMark: number; + readonly readableLength: number; + constructor(opts?: ReadableOptions); + _read(size: number): void; + read(size?: number): any; + setEncoding(encoding: string): this; + pause(): this; + resume(): this; + isPaused(): boolean; + unpipe(destination?: T): this; + unshift(chunk: any): void; + wrap(oldStream: NodeJS.ReadableStream): this; + push(chunk: any, encoding?: string): boolean; + _destroy(err: Error, callback: Function): void; + destroy(error?: Error): void; + + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. data + * 3. end + * 4. readable + * 5. error + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "data", listener: (chunk: Buffer | string) => void): this; + addListener(event: "end", listener: () => void): this; + addListener(event: "readable", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "data", chunk: Buffer | string): boolean; + emit(event: "end"): boolean; + emit(event: "readable"): boolean; + emit(event: "error", err: Error): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "data", listener: (chunk: Buffer | string) => void): this; + on(event: "end", listener: () => void): this; + on(event: "readable", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "data", listener: (chunk: Buffer | string) => void): this; + once(event: "end", listener: () => void): this; + once(event: "readable", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependListener(event: "end", listener: () => void): this; + prependListener(event: "readable", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: "end", listener: () => void): this; + prependOnceListener(event: "readable", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + + removeListener(event: string, listener: (...args: any[]) => void): this; + removeListener(event: "close", listener: () => void): this; + removeListener(event: "data", listener: (chunk: Buffer | string) => void): this; + removeListener(event: "end", listener: () => void): this; + removeListener(event: "readable", listener: () => void): this; + removeListener(event: "error", listener: (err: Error) => void): this; + } + + export interface WritableOptions { + highWaterMark?: number; + decodeStrings?: boolean; + objectMode?: boolean; + write?: (chunk: string | Buffer, encoding: string, callback: Function) => any; + writev?: (chunks: Array<{ chunk: string | Buffer, encoding: string }>, callback: Function) => any; + destroy?: (error?: Error) => any; + final?: (callback: (error?: Error) => void) => void; + } + + export class Writable extends Stream implements NodeJS.WritableStream { + writable: boolean; + readonly writableHighWaterMark: number; + readonly writableLength: number; + constructor(opts?: WritableOptions); + _write(chunk: any, encoding: string, callback: (err?: Error) => void): void; + _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (err?: Error) => void): void; + _destroy(err: Error, callback: Function): void; + _final(callback: Function): void; + write(chunk: any, cb?: Function): boolean; + write(chunk: any, encoding?: string, cb?: Function): boolean; + setDefaultEncoding(encoding: string): this; + end(cb?: Function): void; + end(chunk: any, cb?: Function): void; + end(chunk: any, encoding?: string, cb?: Function): void; + cork(): void; + uncork(): void; + destroy(error?: Error): void; + + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. drain + * 3. error + * 4. finish + * 5. pipe + * 6. unpipe + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "finish", listener: () => void): this; + addListener(event: "pipe", listener: (src: Readable) => void): this; + addListener(event: "unpipe", listener: (src: Readable) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "drain", chunk: Buffer | string): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "finish"): boolean; + emit(event: "pipe", src: Readable): boolean; + emit(event: "unpipe", src: Readable): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "drain", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "finish", listener: () => void): this; + on(event: "pipe", listener: (src: Readable) => void): this; + on(event: "unpipe", listener: (src: Readable) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "drain", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "finish", listener: () => void): this; + once(event: "pipe", listener: (src: Readable) => void): this; + once(event: "unpipe", listener: (src: Readable) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "finish", listener: () => void): this; + prependListener(event: "pipe", listener: (src: Readable) => void): this; + prependListener(event: "unpipe", listener: (src: Readable) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "finish", listener: () => void): this; + prependOnceListener(event: "pipe", listener: (src: Readable) => void): this; + prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this; + + removeListener(event: string, listener: (...args: any[]) => void): this; + removeListener(event: "close", listener: () => void): this; + removeListener(event: "drain", listener: () => void): this; + removeListener(event: "error", listener: (err: Error) => void): this; + removeListener(event: "finish", listener: () => void): this; + removeListener(event: "pipe", listener: (src: Readable) => void): this; + removeListener(event: "unpipe", listener: (src: Readable) => void): this; + } + + export interface DuplexOptions extends ReadableOptions, WritableOptions { + allowHalfOpen?: boolean; + readableObjectMode?: boolean; + writableObjectMode?: boolean; + } + + // Note: Duplex extends both Readable and Writable. + export class Duplex extends Readable implements Writable { + writable: boolean; + readonly writableHighWaterMark: number; + readonly writableLength: number; + constructor(opts?: DuplexOptions); + _write(chunk: any, encoding: string, callback: (err?: Error) => void): void; + _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (err?: Error) => void): void; + _destroy(err: Error, callback: Function): void; + _final(callback: Function): void; + write(chunk: any, cb?: Function): boolean; + write(chunk: any, encoding?: string, cb?: Function): boolean; + setDefaultEncoding(encoding: string): this; + end(cb?: Function): void; + end(chunk: any, cb?: Function): void; + end(chunk: any, encoding?: string, cb?: Function): void; + cork(): void; + uncork(): void; + } + + export interface TransformOptions extends DuplexOptions { + transform?: (chunk: string | Buffer, encoding: string, callback: Function) => any; + flush?: (callback: Function) => any; + } + + export class Transform extends Duplex { + constructor(opts?: TransformOptions); + _transform(chunk: any, encoding: string, callback: Function): void; + destroy(error?: Error): void; + } + + export class PassThrough extends Transform { } + } + + export = internal; +} + +declare module "util" { + export interface InspectOptions extends NodeJS.InspectOptions { } + export function format(format: any, ...param: any[]): string; + export function debug(string: string): void; + export function error(...param: any[]): void; + export function puts(...param: any[]): void; + export function print(...param: any[]): void; + export function log(string: string): void; + export var inspect: { + (object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string; + (object: any, options: InspectOptions): string; + colors: { + [color: string]: [number, number] | undefined + } + styles: { + [style: string]: string | undefined + } + defaultOptions: InspectOptions; + custom: symbol; + }; + export function isArray(object: any): object is any[]; + export function isRegExp(object: any): object is RegExp; + export function isDate(object: any): object is Date; + export function isError(object: any): object is Error; + export function inherits(constructor: any, superConstructor: any): void; + export function debuglog(key: string): (msg: string, ...param: any[]) => void; + export function isBoolean(object: any): object is boolean; + export function isBuffer(object: any): object is Buffer; + export function isFunction(object: any): boolean; + export function isNull(object: any): object is null; + export function isNullOrUndefined(object: any): object is null | undefined; + export function isNumber(object: any): object is number; + export function isObject(object: any): boolean; + export function isPrimitive(object: any): boolean; + export function isString(object: any): object is string; + export function isSymbol(object: any): object is symbol; + export function isUndefined(object: any): object is undefined; + export function deprecate(fn: T, message: string): T; + + export interface CustomPromisify extends Function { + __promisify__: TCustom; + } + + export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + + export function promisify(fn: CustomPromisify): TCustom; + export function promisify(fn: (callback: (err: Error | null, result: TResult) => void) => void): () => Promise; + export function promisify(fn: (callback: (err: Error | null) => void) => void): () => Promise; + export function promisify(fn: (arg1: T1, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1) => Promise; + export function promisify(fn: (arg1: T1, callback: (err: Error | null) => void) => void): (arg1: T1) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + export function promisify(fn: Function): Function; + export namespace promisify { + const custom: symbol; + } +} + +declare module "assert" { + function internal(value: any, message?: string): void; + namespace internal { + export class AssertionError implements Error { + name: string; + message: string; + actual: any; + expected: any; + operator: string; + generatedMessage: boolean; + + constructor(options?: { + message?: string; actual?: any; expected?: any; + operator?: string; stackStartFunction?: Function + }); + } + + export function fail(message: string): never; + export function fail(actual: any, expected: any, message?: string, operator?: string): never; + export function ok(value: any, message?: string): void; + export function equal(actual: any, expected: any, message?: string): void; + export function notEqual(actual: any, expected: any, message?: string): void; + export function deepEqual(actual: any, expected: any, message?: string): void; + export function notDeepEqual(acutal: any, expected: any, message?: string): void; + export function strictEqual(actual: any, expected: any, message?: string): void; + export function notStrictEqual(actual: any, expected: any, message?: string): void; + export function deepStrictEqual(actual: any, expected: any, message?: string): void; + export function notDeepStrictEqual(actual: any, expected: any, message?: string): void; + + export function throws(block: Function, message?: string): void; + export function throws(block: Function, error: Function, message?: string): void; + export function throws(block: Function, error: RegExp, message?: string): void; + export function throws(block: Function, error: (err: any) => boolean, message?: string): void; + + export function doesNotThrow(block: Function, message?: string): void; + export function doesNotThrow(block: Function, error: Function, message?: string): void; + export function doesNotThrow(block: Function, error: RegExp, message?: string): void; + export function doesNotThrow(block: Function, error: (err: any) => boolean, message?: string): void; + + export function ifError(value: any): void; + } + + export = internal; +} + +declare module "tty" { + import * as net from "net"; + + export function isatty(fd: number): boolean; + export class ReadStream extends net.Socket { + isRaw: boolean; + setRawMode(mode: boolean): void; + isTTY: boolean; + } + export class WriteStream extends net.Socket { + columns: number; + rows: number; + isTTY: boolean; + } +} + +declare module "domain" { + import * as events from "events"; + + export class Domain extends events.EventEmitter implements NodeJS.Domain { + run(fn: Function): void; + add(emitter: events.EventEmitter): void; + remove(emitter: events.EventEmitter): void; + bind(cb: (err: Error, data: any) => any): any; + intercept(cb: (data: any) => any): any; + members: any[]; + enter(): void; + exit(): void; + } + + export function create(): Domain; +} + +declare module "constants" { + export var E2BIG: number; + export var EACCES: number; + export var EADDRINUSE: number; + export var EADDRNOTAVAIL: number; + export var EAFNOSUPPORT: number; + export var EAGAIN: number; + export var EALREADY: number; + export var EBADF: number; + export var EBADMSG: number; + export var EBUSY: number; + export var ECANCELED: number; + export var ECHILD: number; + export var ECONNABORTED: number; + export var ECONNREFUSED: number; + export var ECONNRESET: number; + export var EDEADLK: number; + export var EDESTADDRREQ: number; + export var EDOM: number; + export var EEXIST: number; + export var EFAULT: number; + export var EFBIG: number; + export var EHOSTUNREACH: number; + export var EIDRM: number; + export var EILSEQ: number; + export var EINPROGRESS: number; + export var EINTR: number; + export var EINVAL: number; + export var EIO: number; + export var EISCONN: number; + export var EISDIR: number; + export var ELOOP: number; + export var EMFILE: number; + export var EMLINK: number; + export var EMSGSIZE: number; + export var ENAMETOOLONG: number; + export var ENETDOWN: number; + export var ENETRESET: number; + export var ENETUNREACH: number; + export var ENFILE: number; + export var ENOBUFS: number; + export var ENODATA: number; + export var ENODEV: number; + export var ENOENT: number; + export var ENOEXEC: number; + export var ENOLCK: number; + export var ENOLINK: number; + export var ENOMEM: number; + export var ENOMSG: number; + export var ENOPROTOOPT: number; + export var ENOSPC: number; + export var ENOSR: number; + export var ENOSTR: number; + export var ENOSYS: number; + export var ENOTCONN: number; + export var ENOTDIR: number; + export var ENOTEMPTY: number; + export var ENOTSOCK: number; + export var ENOTSUP: number; + export var ENOTTY: number; + export var ENXIO: number; + export var EOPNOTSUPP: number; + export var EOVERFLOW: number; + export var EPERM: number; + export var EPIPE: number; + export var EPROTO: number; + export var EPROTONOSUPPORT: number; + export var EPROTOTYPE: number; + export var ERANGE: number; + export var EROFS: number; + export var ESPIPE: number; + export var ESRCH: number; + export var ETIME: number; + export var ETIMEDOUT: number; + export var ETXTBSY: number; + export var EWOULDBLOCK: number; + export var EXDEV: number; + export var WSAEINTR: number; + export var WSAEBADF: number; + export var WSAEACCES: number; + export var WSAEFAULT: number; + export var WSAEINVAL: number; + export var WSAEMFILE: number; + export var WSAEWOULDBLOCK: number; + export var WSAEINPROGRESS: number; + export var WSAEALREADY: number; + export var WSAENOTSOCK: number; + export var WSAEDESTADDRREQ: number; + export var WSAEMSGSIZE: number; + export var WSAEPROTOTYPE: number; + export var WSAENOPROTOOPT: number; + export var WSAEPROTONOSUPPORT: number; + export var WSAESOCKTNOSUPPORT: number; + export var WSAEOPNOTSUPP: number; + export var WSAEPFNOSUPPORT: number; + export var WSAEAFNOSUPPORT: number; + export var WSAEADDRINUSE: number; + export var WSAEADDRNOTAVAIL: number; + export var WSAENETDOWN: number; + export var WSAENETUNREACH: number; + export var WSAENETRESET: number; + export var WSAECONNABORTED: number; + export var WSAECONNRESET: number; + export var WSAENOBUFS: number; + export var WSAEISCONN: number; + export var WSAENOTCONN: number; + export var WSAESHUTDOWN: number; + export var WSAETOOMANYREFS: number; + export var WSAETIMEDOUT: number; + export var WSAECONNREFUSED: number; + export var WSAELOOP: number; + export var WSAENAMETOOLONG: number; + export var WSAEHOSTDOWN: number; + export var WSAEHOSTUNREACH: number; + export var WSAENOTEMPTY: number; + export var WSAEPROCLIM: number; + export var WSAEUSERS: number; + export var WSAEDQUOT: number; + export var WSAESTALE: number; + export var WSAEREMOTE: number; + export var WSASYSNOTREADY: number; + export var WSAVERNOTSUPPORTED: number; + export var WSANOTINITIALISED: number; + export var WSAEDISCON: number; + export var WSAENOMORE: number; + export var WSAECANCELLED: number; + export var WSAEINVALIDPROCTABLE: number; + export var WSAEINVALIDPROVIDER: number; + export var WSAEPROVIDERFAILEDINIT: number; + export var WSASYSCALLFAILURE: number; + export var WSASERVICE_NOT_FOUND: number; + export var WSATYPE_NOT_FOUND: number; + export var WSA_E_NO_MORE: number; + export var WSA_E_CANCELLED: number; + export var WSAEREFUSED: number; + export var SIGHUP: number; + export var SIGINT: number; + export var SIGILL: number; + export var SIGABRT: number; + export var SIGFPE: number; + export var SIGKILL: number; + export var SIGSEGV: number; + export var SIGTERM: number; + export var SIGBREAK: number; + export var SIGWINCH: number; + export var SSL_OP_ALL: number; + export var SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; + export var SSL_OP_CIPHER_SERVER_PREFERENCE: number; + export var SSL_OP_CISCO_ANYCONNECT: number; + export var SSL_OP_COOKIE_EXCHANGE: number; + export var SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; + export var SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; + export var SSL_OP_EPHEMERAL_RSA: number; + export var SSL_OP_LEGACY_SERVER_CONNECT: number; + export var SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number; + export var SSL_OP_MICROSOFT_SESS_ID_BUG: number; + export var SSL_OP_MSIE_SSLV2_RSA_PADDING: number; + export var SSL_OP_NETSCAPE_CA_DN_BUG: number; + export var SSL_OP_NETSCAPE_CHALLENGE_BUG: number; + export var SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number; + export var SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number; + export var SSL_OP_NO_COMPRESSION: number; + export var SSL_OP_NO_QUERY_MTU: number; + export var SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; + export var SSL_OP_NO_SSLv2: number; + export var SSL_OP_NO_SSLv3: number; + export var SSL_OP_NO_TICKET: number; + export var SSL_OP_NO_TLSv1: number; + export var SSL_OP_NO_TLSv1_1: number; + export var SSL_OP_NO_TLSv1_2: number; + export var SSL_OP_PKCS1_CHECK_1: number; + export var SSL_OP_PKCS1_CHECK_2: number; + export var SSL_OP_SINGLE_DH_USE: number; + export var SSL_OP_SINGLE_ECDH_USE: number; + export var SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number; + export var SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number; + export var SSL_OP_TLS_BLOCK_PADDING_BUG: number; + export var SSL_OP_TLS_D5_BUG: number; + export var SSL_OP_TLS_ROLLBACK_BUG: number; + export var ENGINE_METHOD_DSA: number; + export var ENGINE_METHOD_DH: number; + export var ENGINE_METHOD_RAND: number; + export var ENGINE_METHOD_ECDH: number; + export var ENGINE_METHOD_ECDSA: number; + export var ENGINE_METHOD_CIPHERS: number; + export var ENGINE_METHOD_DIGESTS: number; + export var ENGINE_METHOD_STORE: number; + export var ENGINE_METHOD_PKEY_METHS: number; + export var ENGINE_METHOD_PKEY_ASN1_METHS: number; + export var ENGINE_METHOD_ALL: number; + export var ENGINE_METHOD_NONE: number; + export var DH_CHECK_P_NOT_SAFE_PRIME: number; + export var DH_CHECK_P_NOT_PRIME: number; + export var DH_UNABLE_TO_CHECK_GENERATOR: number; + export var DH_NOT_SUITABLE_GENERATOR: number; + export var NPN_ENABLED: number; + export var RSA_PKCS1_PADDING: number; + export var RSA_SSLV23_PADDING: number; + export var RSA_NO_PADDING: number; + export var RSA_PKCS1_OAEP_PADDING: number; + export var RSA_X931_PADDING: number; + export var RSA_PKCS1_PSS_PADDING: number; + export var POINT_CONVERSION_COMPRESSED: number; + export var POINT_CONVERSION_UNCOMPRESSED: number; + export var POINT_CONVERSION_HYBRID: number; + export var O_RDONLY: number; + export var O_WRONLY: number; + export var O_RDWR: number; + export var S_IFMT: number; + export var S_IFREG: number; + export var S_IFDIR: number; + export var S_IFCHR: number; + export var S_IFBLK: number; + export var S_IFIFO: number; + export var S_IFSOCK: number; + export var S_IRWXU: number; + export var S_IRUSR: number; + export var S_IWUSR: number; + export var S_IXUSR: number; + export var S_IRWXG: number; + export var S_IRGRP: number; + export var S_IWGRP: number; + export var S_IXGRP: number; + export var S_IRWXO: number; + export var S_IROTH: number; + export var S_IWOTH: number; + export var S_IXOTH: number; + export var S_IFLNK: number; + export var O_CREAT: number; + export var O_EXCL: number; + export var O_NOCTTY: number; + export var O_DIRECTORY: number; + export var O_NOATIME: number; + export var O_NOFOLLOW: number; + export var O_SYNC: number; + export var O_DSYNC: number; + export var O_SYMLINK: number; + export var O_DIRECT: number; + export var O_NONBLOCK: number; + export var O_TRUNC: number; + export var O_APPEND: number; + export var F_OK: number; + export var R_OK: number; + export var W_OK: number; + export var X_OK: number; + export var UV_UDP_REUSEADDR: number; + export var SIGQUIT: number; + export var SIGTRAP: number; + export var SIGIOT: number; + export var SIGBUS: number; + export var SIGUSR1: number; + export var SIGUSR2: number; + export var SIGPIPE: number; + export var SIGALRM: number; + export var SIGCHLD: number; + export var SIGSTKFLT: number; + export var SIGCONT: number; + export var SIGSTOP: number; + export var SIGTSTP: number; + export var SIGTTIN: number; + export var SIGTTOU: number; + export var SIGURG: number; + export var SIGXCPU: number; + export var SIGXFSZ: number; + export var SIGVTALRM: number; + export var SIGPROF: number; + export var SIGIO: number; + export var SIGPOLL: number; + export var SIGPWR: number; + export var SIGSYS: number; + export var SIGUNUSED: number; + export var defaultCoreCipherList: string; + export var defaultCipherList: string; + export var ENGINE_METHOD_RSA: number; + export var ALPN_ENABLED: number; +} + +declare module "module" { + export = NodeJS.Module; +} + +declare module "process" { + export = process; +} + +declare module "v8" { + interface HeapSpaceInfo { + space_name: string; + space_size: number; + space_used_size: number; + space_available_size: number; + physical_space_size: number; + } + + // ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */ + type DoesZapCodeSpaceFlag = 0 | 1; + + interface HeapInfo { + total_heap_size: number; + total_heap_size_executable: number; + total_physical_size: number; + total_available_size: number; + used_heap_size: number; + heap_size_limit: number; + malloced_memory: number; + peak_malloced_memory: number; + does_zap_garbage: DoesZapCodeSpaceFlag; + } + + export function getHeapStatistics(): HeapInfo; + export function getHeapSpaceStatistics(): HeapSpaceInfo[]; + export function setFlagsFromString(flags: string): void; +} + +declare module "timers" { + export function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; + export namespace setTimeout { + export function __promisify__(ms: number): Promise; + export function __promisify__(ms: number, value: T): Promise; + } + export function clearTimeout(timeoutId: NodeJS.Timer): void; + export function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; + export function clearInterval(intervalId: NodeJS.Timer): void; + export function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any; + export namespace setImmediate { + export function __promisify__(): Promise; + export function __promisify__(value: T): Promise; + } + export function clearImmediate(immediateId: any): void; +} + +declare module "console" { + export = console; +} + +/** + * Async Hooks module: https://nodejs.org/api/async_hooks.html + */ +declare module "async_hooks" { + /** + * Returns the asyncId of the current execution context. + */ + export function executionAsyncId(): number; + /// @deprecated - replaced by executionAsyncId() + export function currentId(): number; + + /** + * Returns the ID of the resource responsible for calling the callback that is currently being executed. + */ + export function triggerAsyncId(): number; + /// @deprecated - replaced by triggerAsyncId() + export function triggerId(): number; + + export interface HookCallbacks { + /** + * Called when a class is constructed that has the possibility to emit an asynchronous event. + * @param asyncId a unique ID for the async resource + * @param type the type of the async resource + * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created + * @param resource reference to the resource representing the async operation, needs to be released during destroy + */ + init?(asyncId: number, type: string, triggerAsyncId: number, resource: Object): void; + + /** + * When an asynchronous operation is initiated or completes a callback is called to notify the user. + * The before callback is called just before said callback is executed. + * @param asyncId the unique identifier assigned to the resource about to execute the callback. + */ + before?(asyncId: number): void; + + /** + * Called immediately after the callback specified in before is completed. + * @param asyncId the unique identifier assigned to the resource which has executed the callback. + */ + after?(asyncId: number): void; + + /** + * Called when a promise has resolve() called. This may not be in the same execution id + * as the promise itself. + * @param asyncId the unique id for the promise that was resolve()d. + */ + promiseResolve?(asyncId: number): void; + + /** + * Called after the resource corresponding to asyncId is destroyed + * @param asyncId a unique ID for the async resource + */ + destroy?(asyncId: number): void; + } + + export interface AsyncHook { + /** + * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop. + */ + enable(): this; + + /** + * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled. + */ + disable(): this; + } + + /** + * Registers functions to be called for different lifetime events of each async operation. + * @param options the callbacks to register + * @return an AsyncHooks instance used for disabling and enabling hooks + */ + export function createHook(options: HookCallbacks): AsyncHook; + + export interface AsyncResourceOptions { + /** + * The ID of the execution context that created this async event. + * Default: `executionAsyncId()` + */ + triggerAsyncId?: number; + + /** + * Disables automatic `emitDestroy` when the object is garbage collected. + * This usually does not need to be set (even if `emitDestroy` is called + * manually), unless the resource's `asyncId` is retrieved and the + * sensitive API's `emitDestroy` is called with it. + * Default: `false` + */ + requireManualDestroy?: boolean; + } + + /** + * The class AsyncResource was designed to be extended by the embedder's async resources. + * Using this users can easily trigger the lifetime events of their own resources. + */ + export class AsyncResource { + /** + * AsyncResource() is meant to be extended. Instantiating a + * new AsyncResource() also triggers init. If triggerAsyncId is omitted then + * async_hook.executionAsyncId() is used. + * @param type The type of async event. + * @param triggerAsyncId The ID of the execution context that created + * this async event (default: `executionAsyncId()`), or an + * AsyncResourceOptions object (since 9.3) + */ + constructor(type: string, triggerAsyncId?: number|AsyncResourceOptions); + + /** + * Call AsyncHooks before callbacks. + * @deprecated since 9.6 - Use asyncResource.runInAsyncScope() instead. + */ + emitBefore(): void; + + /** + * Call AsyncHooks after callbacks. + * @deprecated since 9.6 - Use asyncResource.runInAsyncScope() instead. + */ + emitAfter(): void; + + /** + * Call the provided function with the provided arguments in the + * execution context of the async resource. This will establish the + * context, trigger the AsyncHooks before callbacks, call the function, + * trigger the AsyncHooks after callbacks, and then restore the original + * execution context. + * @param fn The function to call in the execution context of this + * async resource. + * @param thisArg The receiver to be used for the function call. + * @param args Optional arguments to pass to the function. + */ + runInAsyncScope(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result; + + /** + * Call AsyncHooks destroy callbacks. + */ + emitDestroy(): void; + + /** + * @return the unique ID assigned to this AsyncResource instance. + */ + asyncId(): number; + + /** + * @return the trigger ID for this AsyncResource instance. + */ + triggerAsyncId(): number; + } +} + +declare module "http2" { + import * as events from "events"; + import * as fs from "fs"; + import * as net from "net"; + import * as stream from "stream"; + import * as tls from "tls"; + import * as url from "url"; + + import { IncomingHttpHeaders, OutgoingHttpHeaders } from "http"; + export { IncomingHttpHeaders, OutgoingHttpHeaders } from "http"; + + // Http2Stream + + export interface StreamPriorityOptions { + exclusive?: boolean; + parent?: number; + weight?: number; + silent?: boolean; + } + + export interface StreamState { + localWindowSize?: number; + state?: number; + streamLocalClose?: number; + streamRemoteClose?: number; + sumDependencyWeight?: number; + weight?: number; + } + + export interface ServerStreamResponseOptions { + endStream?: boolean; + getTrailers?: (trailers: OutgoingHttpHeaders) => void; + } + + export interface StatOptions { + offset: number; + length: number; + } + + export interface ServerStreamFileResponseOptions { + statCheck?: (stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions) => void | boolean; + getTrailers?: (trailers: OutgoingHttpHeaders) => void; + offset?: number; + length?: number; + } + + export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { + onError?: (err: NodeJS.ErrnoException) => void; + } + + export interface Http2Stream extends stream.Duplex { + readonly aborted: boolean; + close(code: number, callback?: () => void): void; + readonly closed: boolean; + readonly destroyed: boolean; + readonly pending: boolean; + priority(options: StreamPriorityOptions): void; + readonly rstCode: number; + readonly session: Http2Session; + setTimeout(msecs: number, callback?: () => void): void; + readonly state: StreamState; + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "aborted", listener: () => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "data", listener: (chunk: Buffer | string) => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "end", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "finish", listener: () => void): this; + addListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + addListener(event: "pipe", listener: (src: stream.Readable) => void): this; + addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + addListener(event: "streamClosed", listener: (code: number) => void): this; + addListener(event: "timeout", listener: () => void): this; + addListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "aborted"): boolean; + emit(event: "close"): boolean; + emit(event: "data", chunk: Buffer | string): boolean; + emit(event: "drain"): boolean; + emit(event: "end"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "finish"): boolean; + emit(event: "frameError", frameType: number, errorCode: number): boolean; + emit(event: "pipe", src: stream.Readable): boolean; + emit(event: "unpipe", src: stream.Readable): boolean; + emit(event: "streamClosed", code: number): boolean; + emit(event: "timeout"): boolean; + emit(event: "trailers", trailers: IncomingHttpHeaders, flags: number): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "aborted", listener: () => void): this; + on(event: "close", listener: () => void): this; + on(event: "data", listener: (chunk: Buffer | string) => void): this; + on(event: "drain", listener: () => void): this; + on(event: "end", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "finish", listener: () => void): this; + on(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + on(event: "pipe", listener: (src: stream.Readable) => void): this; + on(event: "unpipe", listener: (src: stream.Readable) => void): this; + on(event: "streamClosed", listener: (code: number) => void): this; + on(event: "timeout", listener: () => void): this; + on(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "aborted", listener: () => void): this; + once(event: "close", listener: () => void): this; + once(event: "data", listener: (chunk: Buffer | string) => void): this; + once(event: "drain", listener: () => void): this; + once(event: "end", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "finish", listener: () => void): this; + once(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + once(event: "pipe", listener: (src: stream.Readable) => void): this; + once(event: "unpipe", listener: (src: stream.Readable) => void): this; + once(event: "streamClosed", listener: (code: number) => void): this; + once(event: "timeout", listener: () => void): this; + once(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "aborted", listener: () => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "end", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "finish", listener: () => void): this; + prependListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; + prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + prependListener(event: "streamClosed", listener: (code: number) => void): this; + prependListener(event: "timeout", listener: () => void): this; + prependListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "aborted", listener: () => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "end", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "finish", listener: () => void): this; + prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; + prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + prependOnceListener(event: "streamClosed", listener: (code: number) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + prependOnceListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + } + + export interface ClientHttp2Stream extends Http2Stream { + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "headers", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: "response", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "headers", headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: "push", headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: "response", headers: IncomingHttpHeaders, flags: number): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "headers", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: "response", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "headers", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: "response", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "headers", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: "response", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "headers", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: "response", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + } + + export interface ServerHttp2Stream extends Http2Stream { + additionalHeaders(headers: OutgoingHttpHeaders): void; + readonly headersSent: boolean; + readonly pushAllowed: boolean; + pushStream(headers: OutgoingHttpHeaders, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; + pushStream(headers: OutgoingHttpHeaders, options?: StreamPriorityOptions, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; + respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void; + respondWithFD(fd: number, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void; + respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptionsWithError): void; + } + + // Http2Session + + export interface Settings { + headerTableSize?: number; + enablePush?: boolean; + initialWindowSize?: number; + maxFrameSize?: number; + maxConcurrentStreams?: number; + maxHeaderListSize?: number; + } + + export interface ClientSessionRequestOptions { + endStream?: boolean; + exclusive?: boolean; + parent?: number; + weight?: number; + getTrailers?: (trailers: OutgoingHttpHeaders, flags: number) => void; + } + + export interface SessionState { + effectiveLocalWindowSize?: number; + effectiveRecvDataLength?: number; + nextStreamID?: number; + localWindowSize?: number; + lastProcStreamID?: number; + remoteWindowSize?: number; + outboundQueueSize?: number; + deflateDynamicTableSize?: number; + inflateDynamicTableSize?: number; + } + + export interface Http2Session extends events.EventEmitter { + readonly alpnProtocol?: string; + close(callback?: () => void): void; + readonly closed: boolean; + destroy(error?: Error, code?: number): void; + readonly destroyed: boolean; + readonly encrypted?: boolean; + goaway(code?: number, lastStreamID?: number, opaqueData?: Buffer | DataView /*| TypedArray*/): void; + readonly localSettings: Settings; + readonly originSet?: string[]; + readonly pendingSettingsAck: boolean; + ref(): void; + readonly remoteSettings: Settings; + rstStream(stream: Http2Stream, code?: number): void; + setTimeout(msecs: number, callback?: () => void): void; + readonly socket: net.Socket | tls.TLSSocket; + readonly state: SessionState; + priority(stream: Http2Stream, options: StreamPriorityOptions): void; + settings(settings: Settings): void; + readonly type: number; + unref(): void; + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + addListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + addListener(event: "localSettings", listener: (settings: Settings) => void): this; + addListener(event: "remoteSettings", listener: (settings: Settings) => void): this; + addListener(event: "timeout", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "frameError", frameType: number, errorCode: number, streamID: number): boolean; + emit(event: "goaway", errorCode: number, lastStreamID: number, opaqueData: Buffer): boolean; + emit(event: "localSettings", settings: Settings): boolean; + emit(event: "remoteSettings", settings: Settings): boolean; + emit(event: "timeout"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + on(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + on(event: "localSettings", listener: (settings: Settings) => void): this; + on(event: "remoteSettings", listener: (settings: Settings) => void): this; + on(event: "timeout", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + once(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + once(event: "localSettings", listener: (settings: Settings) => void): this; + once(event: "remoteSettings", listener: (settings: Settings) => void): this; + once(event: "timeout", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + prependListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + prependListener(event: "localSettings", listener: (settings: Settings) => void): this; + prependListener(event: "remoteSettings", listener: (settings: Settings) => void): this; + prependListener(event: "timeout", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + prependOnceListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + prependOnceListener(event: "localSettings", listener: (settings: Settings) => void): this; + prependOnceListener(event: "remoteSettings", listener: (settings: Settings) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + } + + export interface ClientHttp2Session extends Http2Session { + request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream; + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + addListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + addListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "altsvc", alt: string, origin: string, stream: number): boolean; + emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; + emit(event: "stream", stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + on(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + on(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + once(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + once(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + prependListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + prependOnceListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependOnceListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + } + + export interface AlternativeServiceOptions { + origin: number | string | url.URL; + } + + export interface ServerHttp2Session extends Http2Session { + altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void; + readonly server: Http2Server | Http2SecureServer; + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "connect", session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; + emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + } + + // Http2Server + + export interface SessionOptions { + maxDeflateDynamicTableSize?: number; + maxReservedRemoteStreams?: number; + maxSendHeaderBlockLength?: number; + paddingStrategy?: number; + peerMaxConcurrentStreams?: number; + selectPadding?: (frameLen: number, maxFrameLen: number) => number; + settings?: Settings; + } + + export type ClientSessionOptions = SessionOptions; + export type ServerSessionOptions = SessionOptions; + + export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions { } + export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions { } + + export interface ServerOptions extends ServerSessionOptions { + allowHTTP1?: boolean; + } + + export interface SecureServerOptions extends SecureServerSessionOptions { + allowHTTP1?: boolean; + } + + export interface Http2Server extends net.Server { + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: "sessionError", listener: (err: Error) => void): this; + addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: "timeout", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: "sessionError", err: Error): boolean; + emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: "timeout"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: "sessionError", listener: (err: Error) => void): this; + on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: "timeout", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: "sessionError", listener: (err: Error) => void): this; + once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: "timeout", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: "sessionError", listener: (err: Error) => void): this; + prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: "timeout", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; + prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + } + + export interface Http2SecureServer extends tls.Server { + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: "sessionError", listener: (err: Error) => void): this; + addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: "timeout", listener: () => void): this; + addListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: "sessionError", err: Error): boolean; + emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: "timeout"): boolean; + emit(event: "unknownProtocol", socket: tls.TLSSocket): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: "sessionError", listener: (err: Error) => void): this; + on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: "timeout", listener: () => void): this; + on(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: "sessionError", listener: (err: Error) => void): this; + once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: "timeout", listener: () => void): this; + once(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: "sessionError", listener: (err: Error) => void): this; + prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: "timeout", listener: () => void): this; + prependListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; + prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + prependOnceListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + } + + export interface Http2ServerRequest extends stream.Readable { + headers: IncomingHttpHeaders; + httpVersion: string; + method: string; + rawHeaders: string[]; + rawTrailers: string[]; + setTimeout(msecs: number, callback?: () => void): void; + socket: net.Socket | tls.TLSSocket; + stream: ServerHttp2Stream; + trailers: IncomingHttpHeaders; + url: string; + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "aborted", hadError: boolean, code: number): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + } + + export interface Http2ServerResponse extends events.EventEmitter { + addTrailers(trailers: OutgoingHttpHeaders): void; + connection: net.Socket | tls.TLSSocket; + end(callback?: () => void): void; + end(data?: string | Buffer, callback?: () => void): void; + end(data?: string | Buffer, encoding?: string, callback?: () => void): void; + readonly finished: boolean; + getHeader(name: string): string; + getHeaderNames(): string[]; + getHeaders(): OutgoingHttpHeaders; + hasHeader(name: string): boolean; + readonly headersSent: boolean; + removeHeader(name: string): void; + sendDate: boolean; + setHeader(name: string, value: number | string | string[]): void; + setTimeout(msecs: number, callback?: () => void): void; + socket: net.Socket | tls.TLSSocket; + statusCode: number; + statusMessage: ''; + stream: ServerHttp2Stream; + write(chunk: string | Buffer, callback?: (err: Error) => void): boolean; + write(chunk: string | Buffer, encoding?: string, callback?: (err: Error) => void): boolean; + writeContinue(): void; + writeHead(statusCode: number, headers?: OutgoingHttpHeaders): void; + writeHead(statusCode: number, statusMessage?: string, headers?: OutgoingHttpHeaders): void; + createPushResponse(headers: OutgoingHttpHeaders, callback: (err: Error | null, res: Http2ServerResponse) => void): void; + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "error", listener: (error: Error) => void): this; + addListener(event: "finish", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "aborted", hadError: boolean, code: number): boolean; + emit(event: "close"): boolean; + emit(event: "drain"): boolean; + emit(event: "error", error: Error): boolean; + emit(event: "finish"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + on(event: "close", listener: () => void): this; + on(event: "drain", listener: () => void): this; + on(event: "error", listener: (error: Error) => void): this; + on(event: "finish", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + once(event: "close", listener: () => void): this; + once(event: "drain", listener: () => void): this; + once(event: "error", listener: (error: Error) => void): this; + once(event: "finish", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "error", listener: (error: Error) => void): this; + prependListener(event: "finish", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "error", listener: (error: Error) => void): this; + prependOnceListener(event: "finish", listener: () => void): this; + } + + // Public API + + export namespace constants { + export const NGHTTP2_SESSION_SERVER: number; + export const NGHTTP2_SESSION_CLIENT: number; + export const NGHTTP2_STREAM_STATE_IDLE: number; + export const NGHTTP2_STREAM_STATE_OPEN: number; + export const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number; + export const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number; + export const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number; + export const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number; + export const NGHTTP2_STREAM_STATE_CLOSED: number; + export const NGHTTP2_NO_ERROR: number; + export const NGHTTP2_PROTOCOL_ERROR: number; + export const NGHTTP2_INTERNAL_ERROR: number; + export const NGHTTP2_FLOW_CONTROL_ERROR: number; + export const NGHTTP2_SETTINGS_TIMEOUT: number; + export const NGHTTP2_STREAM_CLOSED: number; + export const NGHTTP2_FRAME_SIZE_ERROR: number; + export const NGHTTP2_REFUSED_STREAM: number; + export const NGHTTP2_CANCEL: number; + export const NGHTTP2_COMPRESSION_ERROR: number; + export const NGHTTP2_CONNECT_ERROR: number; + export const NGHTTP2_ENHANCE_YOUR_CALM: number; + export const NGHTTP2_INADEQUATE_SECURITY: number; + export const NGHTTP2_HTTP_1_1_REQUIRED: number; + export const NGHTTP2_ERR_FRAME_SIZE_ERROR: number; + export const NGHTTP2_FLAG_NONE: number; + export const NGHTTP2_FLAG_END_STREAM: number; + export const NGHTTP2_FLAG_END_HEADERS: number; + export const NGHTTP2_FLAG_ACK: number; + export const NGHTTP2_FLAG_PADDED: number; + export const NGHTTP2_FLAG_PRIORITY: number; + export const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number; + export const DEFAULT_SETTINGS_ENABLE_PUSH: number; + export const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number; + export const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number; + export const MAX_MAX_FRAME_SIZE: number; + export const MIN_MAX_FRAME_SIZE: number; + export const MAX_INITIAL_WINDOW_SIZE: number; + export const NGHTTP2_DEFAULT_WEIGHT: number; + export const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number; + export const NGHTTP2_SETTINGS_ENABLE_PUSH: number; + export const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number; + export const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number; + export const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number; + export const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number; + export const PADDING_STRATEGY_NONE: number; + export const PADDING_STRATEGY_MAX: number; + export const PADDING_STRATEGY_CALLBACK: number; + export const HTTP2_HEADER_STATUS: string; + export const HTTP2_HEADER_METHOD: string; + export const HTTP2_HEADER_AUTHORITY: string; + export const HTTP2_HEADER_SCHEME: string; + export const HTTP2_HEADER_PATH: string; + export const HTTP2_HEADER_ACCEPT_CHARSET: string; + export const HTTP2_HEADER_ACCEPT_ENCODING: string; + export const HTTP2_HEADER_ACCEPT_LANGUAGE: string; + export const HTTP2_HEADER_ACCEPT_RANGES: string; + export const HTTP2_HEADER_ACCEPT: string; + export const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string; + export const HTTP2_HEADER_AGE: string; + export const HTTP2_HEADER_ALLOW: string; + export const HTTP2_HEADER_AUTHORIZATION: string; + export const HTTP2_HEADER_CACHE_CONTROL: string; + export const HTTP2_HEADER_CONNECTION: string; + export const HTTP2_HEADER_CONTENT_DISPOSITION: string; + export const HTTP2_HEADER_CONTENT_ENCODING: string; + export const HTTP2_HEADER_CONTENT_LANGUAGE: string; + export const HTTP2_HEADER_CONTENT_LENGTH: string; + export const HTTP2_HEADER_CONTENT_LOCATION: string; + export const HTTP2_HEADER_CONTENT_MD5: string; + export const HTTP2_HEADER_CONTENT_RANGE: string; + export const HTTP2_HEADER_CONTENT_TYPE: string; + export const HTTP2_HEADER_COOKIE: string; + export const HTTP2_HEADER_DATE: string; + export const HTTP2_HEADER_ETAG: string; + export const HTTP2_HEADER_EXPECT: string; + export const HTTP2_HEADER_EXPIRES: string; + export const HTTP2_HEADER_FROM: string; + export const HTTP2_HEADER_HOST: string; + export const HTTP2_HEADER_IF_MATCH: string; + export const HTTP2_HEADER_IF_MODIFIED_SINCE: string; + export const HTTP2_HEADER_IF_NONE_MATCH: string; + export const HTTP2_HEADER_IF_RANGE: string; + export const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string; + export const HTTP2_HEADER_LAST_MODIFIED: string; + export const HTTP2_HEADER_LINK: string; + export const HTTP2_HEADER_LOCATION: string; + export const HTTP2_HEADER_MAX_FORWARDS: string; + export const HTTP2_HEADER_PREFER: string; + export const HTTP2_HEADER_PROXY_AUTHENTICATE: string; + export const HTTP2_HEADER_PROXY_AUTHORIZATION: string; + export const HTTP2_HEADER_RANGE: string; + export const HTTP2_HEADER_REFERER: string; + export const HTTP2_HEADER_REFRESH: string; + export const HTTP2_HEADER_RETRY_AFTER: string; + export const HTTP2_HEADER_SERVER: string; + export const HTTP2_HEADER_SET_COOKIE: string; + export const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string; + export const HTTP2_HEADER_TRANSFER_ENCODING: string; + export const HTTP2_HEADER_TE: string; + export const HTTP2_HEADER_UPGRADE: string; + export const HTTP2_HEADER_USER_AGENT: string; + export const HTTP2_HEADER_VARY: string; + export const HTTP2_HEADER_VIA: string; + export const HTTP2_HEADER_WWW_AUTHENTICATE: string; + export const HTTP2_HEADER_HTTP2_SETTINGS: string; + export const HTTP2_HEADER_KEEP_ALIVE: string; + export const HTTP2_HEADER_PROXY_CONNECTION: string; + export const HTTP2_METHOD_ACL: string; + export const HTTP2_METHOD_BASELINE_CONTROL: string; + export const HTTP2_METHOD_BIND: string; + export const HTTP2_METHOD_CHECKIN: string; + export const HTTP2_METHOD_CHECKOUT: string; + export const HTTP2_METHOD_CONNECT: string; + export const HTTP2_METHOD_COPY: string; + export const HTTP2_METHOD_DELETE: string; + export const HTTP2_METHOD_GET: string; + export const HTTP2_METHOD_HEAD: string; + export const HTTP2_METHOD_LABEL: string; + export const HTTP2_METHOD_LINK: string; + export const HTTP2_METHOD_LOCK: string; + export const HTTP2_METHOD_MERGE: string; + export const HTTP2_METHOD_MKACTIVITY: string; + export const HTTP2_METHOD_MKCALENDAR: string; + export const HTTP2_METHOD_MKCOL: string; + export const HTTP2_METHOD_MKREDIRECTREF: string; + export const HTTP2_METHOD_MKWORKSPACE: string; + export const HTTP2_METHOD_MOVE: string; + export const HTTP2_METHOD_OPTIONS: string; + export const HTTP2_METHOD_ORDERPATCH: string; + export const HTTP2_METHOD_PATCH: string; + export const HTTP2_METHOD_POST: string; + export const HTTP2_METHOD_PRI: string; + export const HTTP2_METHOD_PROPFIND: string; + export const HTTP2_METHOD_PROPPATCH: string; + export const HTTP2_METHOD_PUT: string; + export const HTTP2_METHOD_REBIND: string; + export const HTTP2_METHOD_REPORT: string; + export const HTTP2_METHOD_SEARCH: string; + export const HTTP2_METHOD_TRACE: string; + export const HTTP2_METHOD_UNBIND: string; + export const HTTP2_METHOD_UNCHECKOUT: string; + export const HTTP2_METHOD_UNLINK: string; + export const HTTP2_METHOD_UNLOCK: string; + export const HTTP2_METHOD_UPDATE: string; + export const HTTP2_METHOD_UPDATEREDIRECTREF: string; + export const HTTP2_METHOD_VERSION_CONTROL: string; + export const HTTP_STATUS_CONTINUE: number; + export const HTTP_STATUS_SWITCHING_PROTOCOLS: number; + export const HTTP_STATUS_PROCESSING: number; + export const HTTP_STATUS_OK: number; + export const HTTP_STATUS_CREATED: number; + export const HTTP_STATUS_ACCEPTED: number; + export const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number; + export const HTTP_STATUS_NO_CONTENT: number; + export const HTTP_STATUS_RESET_CONTENT: number; + export const HTTP_STATUS_PARTIAL_CONTENT: number; + export const HTTP_STATUS_MULTI_STATUS: number; + export const HTTP_STATUS_ALREADY_REPORTED: number; + export const HTTP_STATUS_IM_USED: number; + export const HTTP_STATUS_MULTIPLE_CHOICES: number; + export const HTTP_STATUS_MOVED_PERMANENTLY: number; + export const HTTP_STATUS_FOUND: number; + export const HTTP_STATUS_SEE_OTHER: number; + export const HTTP_STATUS_NOT_MODIFIED: number; + export const HTTP_STATUS_USE_PROXY: number; + export const HTTP_STATUS_TEMPORARY_REDIRECT: number; + export const HTTP_STATUS_PERMANENT_REDIRECT: number; + export const HTTP_STATUS_BAD_REQUEST: number; + export const HTTP_STATUS_UNAUTHORIZED: number; + export const HTTP_STATUS_PAYMENT_REQUIRED: number; + export const HTTP_STATUS_FORBIDDEN: number; + export const HTTP_STATUS_NOT_FOUND: number; + export const HTTP_STATUS_METHOD_NOT_ALLOWED: number; + export const HTTP_STATUS_NOT_ACCEPTABLE: number; + export const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number; + export const HTTP_STATUS_REQUEST_TIMEOUT: number; + export const HTTP_STATUS_CONFLICT: number; + export const HTTP_STATUS_GONE: number; + export const HTTP_STATUS_LENGTH_REQUIRED: number; + export const HTTP_STATUS_PRECONDITION_FAILED: number; + export const HTTP_STATUS_PAYLOAD_TOO_LARGE: number; + export const HTTP_STATUS_URI_TOO_LONG: number; + export const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number; + export const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number; + export const HTTP_STATUS_EXPECTATION_FAILED: number; + export const HTTP_STATUS_TEAPOT: number; + export const HTTP_STATUS_MISDIRECTED_REQUEST: number; + export const HTTP_STATUS_UNPROCESSABLE_ENTITY: number; + export const HTTP_STATUS_LOCKED: number; + export const HTTP_STATUS_FAILED_DEPENDENCY: number; + export const HTTP_STATUS_UNORDERED_COLLECTION: number; + export const HTTP_STATUS_UPGRADE_REQUIRED: number; + export const HTTP_STATUS_PRECONDITION_REQUIRED: number; + export const HTTP_STATUS_TOO_MANY_REQUESTS: number; + export const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number; + export const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number; + export const HTTP_STATUS_INTERNAL_SERVER_ERROR: number; + export const HTTP_STATUS_NOT_IMPLEMENTED: number; + export const HTTP_STATUS_BAD_GATEWAY: number; + export const HTTP_STATUS_SERVICE_UNAVAILABLE: number; + export const HTTP_STATUS_GATEWAY_TIMEOUT: number; + export const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number; + export const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number; + export const HTTP_STATUS_INSUFFICIENT_STORAGE: number; + export const HTTP_STATUS_LOOP_DETECTED: number; + export const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number; + export const HTTP_STATUS_NOT_EXTENDED: number; + export const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number; + } + + export function getDefaultSettings(): Settings; + export function getPackedSettings(settings: Settings): Settings; + export function getUnpackedSettings(buf: Buffer | Uint8Array): Settings; + + export function createServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; + export function createServer(options: ServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; + + export function createSecureServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; + export function createSecureServer(options: SecureServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; + + export function connect(authority: string | url.URL, listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session; + export function connect(authority: string | url.URL, options?: ClientSessionOptions | SecureClientSessionOptions, listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session; +} + +declare module "perf_hooks" { + export interface PerformanceEntry { + /** + * The total number of milliseconds elapsed for this entry. + * This value will not be meaningful for all Performance Entry types. + */ + readonly duration: number; + + /** + * The name of the performance entry. + */ + readonly name: string; + + /** + * The high resolution millisecond timestamp marking the starting time of the Performance Entry. + */ + readonly startTime: number; + + /** + * The type of the performance entry. + * Currently it may be one of: 'node', 'mark', 'measure', 'gc', or 'function'. + */ + readonly entryType: string; + + /** + * When performanceEntry.entryType is equal to 'gc', the performance.kind property identifies + * the type of garbage collection operation that occurred. + * The value may be one of perf_hooks.constants. + */ + readonly kind?: number; + } + + export interface PerformanceNodeTiming extends PerformanceEntry { + /** + * The high resolution millisecond timestamp at which the Node.js process completed bootstrap. + */ + readonly bootstrapComplete: number; + + /** + * The high resolution millisecond timestamp at which cluster processing ended. + */ + readonly clusterSetupEnd: number; + + /** + * The high resolution millisecond timestamp at which cluster processing started. + */ + readonly clusterSetupStart: number; + + /** + * The high resolution millisecond timestamp at which the Node.js event loop exited. + */ + readonly loopExit: number; + + /** + * The high resolution millisecond timestamp at which the Node.js event loop started. + */ + readonly loopStart: number; + + /** + * The high resolution millisecond timestamp at which main module load ended. + */ + readonly moduleLoadEnd: number; + + /** + * The high resolution millisecond timestamp at which main module load started. + */ + readonly moduleLoadStart: number; + + /** + * The high resolution millisecond timestamp at which the Node.js process was initialized. + */ + readonly nodeStart: number; + + /** + * The high resolution millisecond timestamp at which preload module load ended. + */ + readonly preloadModuleLoadEnd: number; + + /** + * The high resolution millisecond timestamp at which preload module load started. + */ + readonly preloadModuleLoadStart: number; + + /** + * The high resolution millisecond timestamp at which third_party_main processing ended. + */ + readonly thirdPartyMainEnd: number; + + /** + * The high resolution millisecond timestamp at which third_party_main processing started. + */ + readonly thirdPartyMainStart: number; + + /** + * The high resolution millisecond timestamp at which the V8 platform was initialized. + */ + readonly v8Start: number; + } + + export interface Performance { + /** + * If name is not provided, removes all PerformanceFunction objects from the Performance Timeline. + * If name is provided, removes entries with name. + * @param name + */ + clearFunctions(name?: string): void; + + /** + * If name is not provided, removes all PerformanceMark objects from the Performance Timeline. + * If name is provided, removes only the named mark. + * @param name + */ + clearMarks(name?: string): void; + + /** + * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline. + * If name is provided, removes only objects whose performanceEntry.name matches name. + */ + clearMeasures(name?: string): void; + + /** + * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime. + * @return list of all PerformanceEntry objects + */ + getEntries(): PerformanceEntry[]; + + /** + * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime + * whose performanceEntry.name is equal to name, and optionally, whose performanceEntry.entryType is equal to type. + * @param name + * @param type + * @return list of all PerformanceEntry objects + */ + getEntriesByName(name: string, type?: string): PerformanceEntry[]; + + /** + * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime + * whose performanceEntry.entryType is equal to type. + * @param type + * @return list of all PerformanceEntry objects + */ + getEntriesByType(type: string): PerformanceEntry[]; + + /** + * Creates a new PerformanceMark entry in the Performance Timeline. + * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark', + * and whose performanceEntry.duration is always 0. + * Performance marks are used to mark specific significant moments in the Performance Timeline. + * @param name + */ + mark(name?: string): void; + + /** + * Creates a new PerformanceMeasure entry in the Performance Timeline. + * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', + * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. + * + * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify + * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, + * then startMark is set to timeOrigin by default. + * + * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp + * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. + * @param name + * @param startMark + * @param endMark + */ + measure(name: string, startMark: string, endMark: string): void; + + /** + * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones. + */ + readonly nodeTiming: PerformanceNodeTiming; + + /** + * @return the current high resolution millisecond timestamp + */ + now(): number; + + /** + * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured. + */ + readonly timeOrigin: number; + + /** + * Wraps a function within a new function that measures the running time of the wrapped function. + * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed. + * @param fn + */ + timerify any>(fn: T): T; + } + + export interface PerformanceObserverEntryList { + /** + * @return a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime. + */ + getEntries(): PerformanceEntry[]; + + /** + * @return a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime + * whose performanceEntry.name is equal to name, and optionally, whose performanceEntry.entryType is equal to type. + */ + getEntriesByName(name: string, type?: string): PerformanceEntry[]; + + /** + * @return Returns a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime + * whose performanceEntry.entryType is equal to type. + */ + getEntriesByType(type: string): PerformanceEntry[]; + } + + export type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; + + export class PerformanceObserver { + constructor(callback: PerformanceObserverCallback); + + /** + * Disconnects the PerformanceObserver instance from all notifications. + */ + disconnect(): void; + + /** + * Subscribes the PerformanceObserver instance to notifications of new PerformanceEntry instances identified by options.entryTypes. + * When options.buffered is false, the callback will be invoked once for every PerformanceEntry instance. + * Property buffered defaults to false. + * @param options + */ + observe(options: { entryTypes: string[], buffered?: boolean }): void; + } + + export namespace constants { + export const NODE_PERFORMANCE_GC_MAJOR: number; + export const NODE_PERFORMANCE_GC_MINOR: number; + export const NODE_PERFORMANCE_GC_INCREMENTAL: number; + export const NODE_PERFORMANCE_GC_WEAKCB: number; + } + + const performance: Performance; +} diff --git a/types/node/v9/inspector.d.ts b/types/node/v9/inspector.d.ts new file mode 100644 index 0000000000..955239b486 --- /dev/null +++ b/types/node/v9/inspector.d.ts @@ -0,0 +1,2488 @@ +// Type definitions for inspector + +// These definitions are auto-generated. +// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330 +// for more information. + +/** + * The inspector module provides an API for interacting with the V8 inspector. + */ +declare module "inspector" { + import { EventEmitter } from 'events'; + + export interface InspectorNotification { + method: string; + params: T; + } + + export namespace Schema { + /** + * Description of the protocol domain. + */ + export interface Domain { + /** + * Domain name. + */ + name: string; + /** + * Domain version. + */ + version: string; + } + + export interface GetDomainsReturnType { + /** + * List of supported domains. + */ + domains: Schema.Domain[]; + } + } + + export namespace Runtime { + /** + * Unique script identifier. + */ + export type ScriptId = string; + + /** + * Unique object identifier. + */ + export type RemoteObjectId = string; + + /** + * Primitive value which cannot be JSON-stringified. + */ + export type UnserializableValue = string; + + /** + * Mirror object referencing original JavaScript object. + */ + export interface RemoteObject { + /** + * Object type. + */ + type: string; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string; + /** + * Object class (constructor) name. Specified for object type values only. + */ + className?: string; + /** + * Remote object value in case of primitive values or JSON values (if it was requested). + */ + value?: any; + /** + * Primitive value which can not be JSON-stringified does not have value, but gets this property. + */ + unserializableValue?: Runtime.UnserializableValue; + /** + * String representation of the object. + */ + description?: string; + /** + * Unique object identifier (for non-primitive values). + */ + objectId?: Runtime.RemoteObjectId; + /** + * Preview containing abbreviated property values. Specified for object type values only. + * @experimental + */ + preview?: Runtime.ObjectPreview; + /** + * @experimental + */ + customPreview?: Runtime.CustomPreview; + } + + /** + * @experimental + */ + export interface CustomPreview { + header: string; + hasBody: boolean; + formatterObjectId: Runtime.RemoteObjectId; + bindRemoteObjectFunctionId: Runtime.RemoteObjectId; + configObjectId?: Runtime.RemoteObjectId; + } + + /** + * Object containing abbreviated remote object value. + * @experimental + */ + export interface ObjectPreview { + /** + * Object type. + */ + type: string; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string; + /** + * String representation of the object. + */ + description?: string; + /** + * True iff some of the properties or entries of the original object did not fit. + */ + overflow: boolean; + /** + * List of the properties. + */ + properties: Runtime.PropertyPreview[]; + /** + * List of the entries. Specified for map and set subtype values only. + */ + entries?: Runtime.EntryPreview[]; + } + + /** + * @experimental + */ + export interface PropertyPreview { + /** + * Property name. + */ + name: string; + /** + * Object type. Accessor means that the property itself is an accessor property. + */ + type: string; + /** + * User-friendly property value string. + */ + value?: string; + /** + * Nested value preview. + */ + valuePreview?: Runtime.ObjectPreview; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string; + } + + /** + * @experimental + */ + export interface EntryPreview { + /** + * Preview of the key. Specified for map-like collection entries. + */ + key?: Runtime.ObjectPreview; + /** + * Preview of the value. + */ + value: Runtime.ObjectPreview; + } + + /** + * Object property descriptor. + */ + export interface PropertyDescriptor { + /** + * Property name or symbol description. + */ + name: string; + /** + * The value associated with the property. + */ + value?: Runtime.RemoteObject; + /** + * True if the value associated with the property may be changed (data descriptors only). + */ + writable?: boolean; + /** + * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). + */ + get?: Runtime.RemoteObject; + /** + * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). + */ + set?: Runtime.RemoteObject; + /** + * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. + */ + configurable: boolean; + /** + * True if this property shows up during enumeration of the properties on the corresponding object. + */ + enumerable: boolean; + /** + * True if the result was thrown during the evaluation. + */ + wasThrown?: boolean; + /** + * True if the property is owned for the object. + */ + isOwn?: boolean; + /** + * Property symbol object, if the property is of the symbol type. + */ + symbol?: Runtime.RemoteObject; + } + + /** + * Object internal property descriptor. This property isn't normally visible in JavaScript code. + */ + export interface InternalPropertyDescriptor { + /** + * Conventional property name. + */ + name: string; + /** + * The value associated with the property. + */ + value?: Runtime.RemoteObject; + } + + /** + * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. + */ + export interface CallArgument { + /** + * Primitive value. + */ + value?: any; + /** + * Primitive value which can not be JSON-stringified. + */ + unserializableValue?: Runtime.UnserializableValue; + /** + * Remote object handle. + */ + objectId?: Runtime.RemoteObjectId; + } + + /** + * Id of an execution context. + */ + export type ExecutionContextId = number; + + /** + * Description of an isolated world. + */ + export interface ExecutionContextDescription { + /** + * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. + */ + id: Runtime.ExecutionContextId; + /** + * Execution context origin. + */ + origin: string; + /** + * Human readable name describing given context. + */ + name: string; + /** + * Embedder-specific auxiliary data. + */ + auxData?: {}; + } + + /** + * Detailed information about exception (or error) that was thrown during script compilation or execution. + */ + export interface ExceptionDetails { + /** + * Exception id. + */ + exceptionId: number; + /** + * Exception text, which should be used together with exception object when available. + */ + text: string; + /** + * Line number of the exception location (0-based). + */ + lineNumber: number; + /** + * Column number of the exception location (0-based). + */ + columnNumber: number; + /** + * Script ID of the exception location. + */ + scriptId?: Runtime.ScriptId; + /** + * URL of the exception location, to be used when the script was not reported. + */ + url?: string; + /** + * JavaScript stack trace if available. + */ + stackTrace?: Runtime.StackTrace; + /** + * Exception object if available. + */ + exception?: Runtime.RemoteObject; + /** + * Identifier of the context where exception happened. + */ + executionContextId?: Runtime.ExecutionContextId; + } + + /** + * Number of milliseconds since epoch. + */ + export type Timestamp = number; + + /** + * Stack entry for runtime errors and assertions. + */ + export interface CallFrame { + /** + * JavaScript function name. + */ + functionName: string; + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * JavaScript script line number (0-based). + */ + lineNumber: number; + /** + * JavaScript script column number (0-based). + */ + columnNumber: number; + } + + /** + * Call frames for assertions or error messages. + */ + export interface StackTrace { + /** + * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. + */ + description?: string; + /** + * JavaScript function name. + */ + callFrames: Runtime.CallFrame[]; + /** + * Asynchronous JavaScript stack trace that preceded this stack, if available. + */ + parent?: Runtime.StackTrace; + /** + * Creation frame of the Promise which produced the next synchronous trace when resolved, if available. + * @experimental + */ + promiseCreationFrame?: Runtime.CallFrame; + } + + export interface EvaluateParameterType { + /** + * Expression to evaluate. + */ + expression: string; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean; + /** + * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + contextId?: Runtime.ExecutionContextId; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean; + /** + * Whether execution should be treated as initiated by user in the UI. + * @experimental + */ + userGesture?: boolean; + /** + * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + */ + awaitPromise?: boolean; + } + + export interface AwaitPromiseParameterType { + /** + * Identifier of the promise. + */ + promiseObjectId: Runtime.RemoteObjectId; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + */ + generatePreview?: boolean; + } + + export interface CallFunctionOnParameterType { + /** + * Identifier of the object to call function on. + */ + objectId: Runtime.RemoteObjectId; + /** + * Declaration of the function to call. + */ + functionDeclaration: string; + /** + * Call arguments. All call arguments must belong to the same JavaScript world as the target object. + */ + arguments?: Runtime.CallArgument[]; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean; + /** + * Whether the result is expected to be a JSON object which should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean; + /** + * Whether execution should be treated as initiated by user in the UI. + * @experimental + */ + userGesture?: boolean; + /** + * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + */ + awaitPromise?: boolean; + } + + export interface GetPropertiesParameterType { + /** + * Identifier of the object to return properties for. + */ + objectId: Runtime.RemoteObjectId; + /** + * If true, returns properties belonging only to the element itself, not to its prototype chain. + */ + ownProperties?: boolean; + /** + * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. + * @experimental + */ + accessorPropertiesOnly?: boolean; + /** + * Whether preview should be generated for the results. + * @experimental + */ + generatePreview?: boolean; + } + + export interface ReleaseObjectParameterType { + /** + * Identifier of the object to release. + */ + objectId: Runtime.RemoteObjectId; + } + + export interface ReleaseObjectGroupParameterType { + /** + * Symbolic object group name. + */ + objectGroup: string; + } + + export interface SetCustomObjectFormatterEnabledParameterType { + enabled: boolean; + } + + export interface CompileScriptParameterType { + /** + * Expression to compile. + */ + expression: string; + /** + * Source url to be set for the script. + */ + sourceURL: string; + /** + * Specifies whether the compiled script should be persisted. + */ + persistScript: boolean; + /** + * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + executionContextId?: Runtime.ExecutionContextId; + } + + export interface RunScriptParameterType { + /** + * Id of the script to run. + */ + scriptId: Runtime.ScriptId; + /** + * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + executionContextId?: Runtime.ExecutionContextId; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean; + /** + * Whether the result is expected to be a JSON object which should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + */ + generatePreview?: boolean; + /** + * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + */ + awaitPromise?: boolean; + } + + export interface EvaluateReturnType { + /** + * Evaluation result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface AwaitPromiseReturnType { + /** + * Promise result. Will contain rejected value if promise was rejected. + */ + result: Runtime.RemoteObject; + /** + * Exception details if stack strace is available. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface CallFunctionOnReturnType { + /** + * Call result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface GetPropertiesReturnType { + /** + * Object properties. + */ + result: Runtime.PropertyDescriptor[]; + /** + * Internal object properties (only of the element itself). + */ + internalProperties?: Runtime.InternalPropertyDescriptor[]; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface CompileScriptReturnType { + /** + * Id of the script. + */ + scriptId?: Runtime.ScriptId; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface RunScriptReturnType { + /** + * Run result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface ExecutionContextCreatedEventDataType { + /** + * A newly created execution context. + */ + context: Runtime.ExecutionContextDescription; + } + + export interface ExecutionContextDestroyedEventDataType { + /** + * Id of the destroyed context + */ + executionContextId: Runtime.ExecutionContextId; + } + + export interface ExceptionThrownEventDataType { + /** + * Timestamp of the exception. + */ + timestamp: Runtime.Timestamp; + exceptionDetails: Runtime.ExceptionDetails; + } + + export interface ExceptionRevokedEventDataType { + /** + * Reason describing why exception was revoked. + */ + reason: string; + /** + * The id of revoked exception, as reported in exceptionUnhandled. + */ + exceptionId: number; + } + + export interface ConsoleAPICalledEventDataType { + /** + * Type of the call. + */ + type: string; + /** + * Call arguments. + */ + args: Runtime.RemoteObject[]; + /** + * Identifier of the context where the call was made. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Call timestamp. + */ + timestamp: Runtime.Timestamp; + /** + * Stack trace captured when the call was made. + */ + stackTrace?: Runtime.StackTrace; + /** + * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. + * @experimental + */ + context?: string; + } + + export interface InspectRequestedEventDataType { + object: Runtime.RemoteObject; + hints: {}; + } + } + + export namespace Debugger { + /** + * Breakpoint identifier. + */ + export type BreakpointId = string; + + /** + * Call frame identifier. + */ + export type CallFrameId = string; + + /** + * Location in the source code. + */ + export interface Location { + /** + * Script identifier as reported in the Debugger.scriptParsed. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number; + } + + /** + * Location in the source code. + * @experimental + */ + export interface ScriptPosition { + lineNumber: number; + columnNumber: number; + } + + /** + * JavaScript call frame. Array of call frames form the call stack. + */ + export interface CallFrame { + /** + * Call frame identifier. This identifier is only valid while the virtual machine is paused. + */ + callFrameId: Debugger.CallFrameId; + /** + * Name of the JavaScript function called on this call frame. + */ + functionName: string; + /** + * Location in the source code. + * @experimental + */ + functionLocation?: Debugger.Location; + /** + * Location in the source code. + */ + location: Debugger.Location; + /** + * Scope chain for this call frame. + */ + scopeChain: Debugger.Scope[]; + /** + * this object for this call frame. + */ + this: Runtime.RemoteObject; + /** + * The value being returned, if the function is at return point. + */ + returnValue?: Runtime.RemoteObject; + } + + /** + * Scope description. + */ + export interface Scope { + /** + * Scope type. + */ + type: string; + /** + * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. + */ + object: Runtime.RemoteObject; + name?: string; + /** + * Location in the source code where scope starts + */ + startLocation?: Debugger.Location; + /** + * Location in the source code where scope ends + */ + endLocation?: Debugger.Location; + } + + /** + * Search match for resource. + * @experimental + */ + export interface SearchMatch { + /** + * Line number in resource content. + */ + lineNumber: number; + /** + * Line with match content. + */ + lineContent: string; + } + + /** + * @experimental + */ + export interface BreakLocation { + /** + * Script identifier as reported in the Debugger.scriptParsed. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number; + type?: string; + } + + export interface SetBreakpointsActiveParameterType { + /** + * New value for breakpoints active state. + */ + active: boolean; + } + + export interface SetSkipAllPausesParameterType { + /** + * New value for skip pauses state. + */ + skip: boolean; + } + + export interface SetBreakpointByUrlParameterType { + /** + * Line number to set breakpoint at. + */ + lineNumber: number; + /** + * URL of the resources to set breakpoint on. + */ + url?: string; + /** + * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. + */ + urlRegex?: string; + /** + * Offset in the line to set breakpoint at. + */ + columnNumber?: number; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. + */ + condition?: string; + } + + export interface SetBreakpointParameterType { + /** + * Location to set breakpoint in. + */ + location: Debugger.Location; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. + */ + condition?: string; + } + + export interface RemoveBreakpointParameterType { + breakpointId: Debugger.BreakpointId; + } + + export interface GetPossibleBreakpointsParameterType { + /** + * Start of range to search possible breakpoint locations in. + */ + start: Debugger.Location; + /** + * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. + */ + end?: Debugger.Location; + /** + * Only consider locations which are in the same (non-nested) function as start. + */ + restrictToFunction?: boolean; + } + + export interface ContinueToLocationParameterType { + /** + * Location to continue to. + */ + location: Debugger.Location; + /** + * @experimental + */ + targetCallFrames?: string; + } + + export interface SearchInContentParameterType { + /** + * Id of the script to search in. + */ + scriptId: Runtime.ScriptId; + /** + * String to search for. + */ + query: string; + /** + * If true, search is case sensitive. + */ + caseSensitive?: boolean; + /** + * If true, treats string parameter as regex. + */ + isRegex?: boolean; + } + + export interface SetScriptSourceParameterType { + /** + * Id of the script to edit. + */ + scriptId: Runtime.ScriptId; + /** + * New content of the script. + */ + scriptSource: string; + /** + * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. + */ + dryRun?: boolean; + } + + export interface RestartFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: Debugger.CallFrameId; + } + + export interface GetScriptSourceParameterType { + /** + * Id of the script to get source for. + */ + scriptId: Runtime.ScriptId; + } + + export interface SetPauseOnExceptionsParameterType { + /** + * Pause on exceptions mode. + */ + state: string; + } + + export interface EvaluateOnCallFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: Debugger.CallFrameId; + /** + * Expression to evaluate. + */ + expression: string; + /** + * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). + */ + objectGroup?: string; + /** + * Specifies whether command line API should be available to the evaluated expression, defaults to false. + */ + includeCommandLineAPI?: boolean; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean; + /** + * Whether to throw an exception if side effect cannot be ruled out during evaluation. + * @experimental + */ + throwOnSideEffect?: boolean; + } + + export interface SetVariableValueParameterType { + /** + * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. + */ + scopeNumber: number; + /** + * Variable name. + */ + variableName: string; + /** + * New variable value. + */ + newValue: Runtime.CallArgument; + /** + * Id of callframe that holds variable. + */ + callFrameId: Debugger.CallFrameId; + } + + export interface SetAsyncCallStackDepthParameterType { + /** + * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). + */ + maxDepth: number; + } + + export interface SetBlackboxPatternsParameterType { + /** + * Array of regexps that will be used to check script url for blackbox state. + */ + patterns: string[]; + } + + export interface SetBlackboxedRangesParameterType { + /** + * Id of the script. + */ + scriptId: Runtime.ScriptId; + positions: Debugger.ScriptPosition[]; + } + + export interface SetBreakpointByUrlReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: Debugger.BreakpointId; + /** + * List of the locations this breakpoint resolved into upon addition. + */ + locations: Debugger.Location[]; + } + + export interface SetBreakpointReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: Debugger.BreakpointId; + /** + * Location this breakpoint resolved into. + */ + actualLocation: Debugger.Location; + } + + export interface GetPossibleBreakpointsReturnType { + /** + * List of the possible breakpoint locations. + */ + locations: Debugger.BreakLocation[]; + } + + export interface SearchInContentReturnType { + /** + * List of search matches. + */ + result: Debugger.SearchMatch[]; + } + + export interface SetScriptSourceReturnType { + /** + * New stack trace in case editing has happened while VM was stopped. + */ + callFrames?: Debugger.CallFrame[]; + /** + * Whether current call stack was modified after applying the changes. + */ + stackChanged?: boolean; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace; + /** + * Exception details if any. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface RestartFrameReturnType { + /** + * New stack trace. + */ + callFrames: Debugger.CallFrame[]; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace; + } + + export interface GetScriptSourceReturnType { + /** + * Script source. + */ + scriptSource: string; + } + + export interface EvaluateOnCallFrameReturnType { + /** + * Object wrapper for the evaluation result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface ScriptParsedEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {}; + /** + * True, if this script is generated as a result of the live edit operation. + * @experimental + */ + isLiveEdit?: boolean; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string; + /** + * True, if this script has sourceURL. + * @experimental + */ + hasSourceURL?: boolean; + /** + * True, if this script is ES6 module. + * @experimental + */ + isModule?: boolean; + /** + * This script length. + * @experimental + */ + length?: number; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace; + } + + export interface ScriptFailedToParseEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {}; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string; + /** + * True, if this script has sourceURL. + * @experimental + */ + hasSourceURL?: boolean; + /** + * True, if this script is ES6 module. + * @experimental + */ + isModule?: boolean; + /** + * This script length. + * @experimental + */ + length?: number; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace; + } + + export interface BreakpointResolvedEventDataType { + /** + * Breakpoint unique identifier. + */ + breakpointId: Debugger.BreakpointId; + /** + * Actual breakpoint location. + */ + location: Debugger.Location; + } + + export interface PausedEventDataType { + /** + * Call stack the virtual machine stopped on. + */ + callFrames: Debugger.CallFrame[]; + /** + * Pause reason. + */ + reason: string; + /** + * Object containing break-specific auxiliary properties. + */ + data?: {}; + /** + * Hit breakpoints IDs + */ + hitBreakpoints?: string[]; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace; + } + } + + export namespace Console { + /** + * Console message. + */ + export interface ConsoleMessage { + /** + * Message source. + */ + source: string; + /** + * Message severity. + */ + level: string; + /** + * Message text. + */ + text: string; + /** + * URL of the message origin. + */ + url?: string; + /** + * Line number in the resource that generated this message (1-based). + */ + line?: number; + /** + * Column number in the resource that generated this message (1-based). + */ + column?: number; + } + + export interface MessageAddedEventDataType { + /** + * Console message that has been added. + */ + message: Console.ConsoleMessage; + } + } + + export namespace Profiler { + /** + * Profile node. Holds callsite information, execution statistics and child nodes. + */ + export interface ProfileNode { + /** + * Unique id of the node. + */ + id: number; + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Number of samples where this node was on top of the call stack. + * @experimental + */ + hitCount?: number; + /** + * Child node ids. + */ + children?: number[]; + /** + * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. + */ + deoptReason?: string; + /** + * An array of source position ticks. + * @experimental + */ + positionTicks?: Profiler.PositionTickInfo[]; + } + + /** + * Profile. + */ + export interface Profile { + /** + * The list of profile nodes. First item is the root node. + */ + nodes: Profiler.ProfileNode[]; + /** + * Profiling start timestamp in microseconds. + */ + startTime: number; + /** + * Profiling end timestamp in microseconds. + */ + endTime: number; + /** + * Ids of samples top nodes. + */ + samples?: number[]; + /** + * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. + */ + timeDeltas?: number[]; + } + + /** + * Specifies a number of samples attributed to a certain source position. + * @experimental + */ + export interface PositionTickInfo { + /** + * Source line number (1-based). + */ + line: number; + /** + * Number of samples attributed to the source line. + */ + ticks: number; + } + + /** + * Coverage data for a source range. + * @experimental + */ + export interface CoverageRange { + /** + * JavaScript script source offset for the range start. + */ + startOffset: number; + /** + * JavaScript script source offset for the range end. + */ + endOffset: number; + /** + * Collected execution count of the source range. + */ + count: number; + } + + /** + * Coverage data for a JavaScript function. + * @experimental + */ + export interface FunctionCoverage { + /** + * JavaScript function name. + */ + functionName: string; + /** + * Source ranges inside the function with coverage data. + */ + ranges: Profiler.CoverageRange[]; + /** + * Whether coverage data for this function has block granularity. + */ + isBlockCoverage: boolean; + } + + /** + * Coverage data for a JavaScript script. + * @experimental + */ + export interface ScriptCoverage { + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Functions contained in the script that has coverage data. + */ + functions: Profiler.FunctionCoverage[]; + } + + export interface SetSamplingIntervalParameterType { + /** + * New sampling interval in microseconds. + */ + interval: number; + } + + export interface StartPreciseCoverageParameterType { + /** + * Collect accurate call counts beyond simple 'covered' or 'not covered'. + */ + callCount?: boolean; + } + + export interface StopReturnType { + /** + * Recorded profile. + */ + profile: Profiler.Profile; + } + + export interface TakePreciseCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: Profiler.ScriptCoverage[]; + } + + export interface GetBestEffortCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: Profiler.ScriptCoverage[]; + } + + export interface ConsoleProfileStartedEventDataType { + id: string; + /** + * Location of console.profile(). + */ + location: Debugger.Location; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string; + } + + export interface ConsoleProfileFinishedEventDataType { + id: string; + /** + * Location of console.profileEnd(). + */ + location: Debugger.Location; + profile: Profiler.Profile; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string; + } + } + + export namespace HeapProfiler { + /** + * Heap snapshot object id. + */ + export type HeapSnapshotObjectId = string; + + /** + * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. + */ + export interface SamplingHeapProfileNode { + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Allocations size in bytes for the node excluding children. + */ + selfSize: number; + /** + * Child nodes. + */ + children: HeapProfiler.SamplingHeapProfileNode[]; + } + + /** + * Profile. + */ + export interface SamplingHeapProfile { + head: HeapProfiler.SamplingHeapProfileNode; + } + + export interface StartTrackingHeapObjectsParameterType { + trackAllocations?: boolean; + } + + export interface StopTrackingHeapObjectsParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. + */ + reportProgress?: boolean; + } + + export interface TakeHeapSnapshotParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. + */ + reportProgress?: boolean; + } + + export interface GetObjectByHeapObjectIdParameterType { + objectId: HeapProfiler.HeapSnapshotObjectId; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string; + } + + export interface AddInspectedHeapObjectParameterType { + /** + * Heap snapshot object id to be accessible by means of $x command line API. + */ + heapObjectId: HeapProfiler.HeapSnapshotObjectId; + } + + export interface GetHeapObjectIdParameterType { + /** + * Identifier of the object to get heap object id for. + */ + objectId: Runtime.RemoteObjectId; + } + + export interface StartSamplingParameterType { + /** + * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. + */ + samplingInterval?: number; + } + + export interface GetObjectByHeapObjectIdReturnType { + /** + * Evaluation result. + */ + result: Runtime.RemoteObject; + } + + export interface GetHeapObjectIdReturnType { + /** + * Id of the heap snapshot object corresponding to the passed remote object id. + */ + heapSnapshotObjectId: HeapProfiler.HeapSnapshotObjectId; + } + + export interface StopSamplingReturnType { + /** + * Recorded sampling heap profile. + */ + profile: HeapProfiler.SamplingHeapProfile; + } + + export interface AddHeapSnapshotChunkEventDataType { + chunk: string; + } + + export interface ReportHeapSnapshotProgressEventDataType { + done: number; + total: number; + finished?: boolean; + } + + export interface LastSeenObjectIdEventDataType { + lastSeenObjectId: number; + timestamp: number; + } + + export interface HeapStatsUpdateEventDataType { + /** + * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. + */ + statsUpdate: number[]; + } + } + + /** + * The inspector.Session is used for dispatching messages to the V8 inspector back-end and receiving message responses and notifications. + */ + export class Session extends EventEmitter { + /** + * Create a new instance of the inspector.Session class. The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend. + */ + constructor(); + + /** + * Connects a session to the inspector back-end. An exception will be thrown if there is already a connected session established either through the API or by a front-end connected to the Inspector WebSocket port. + */ + connect(): void; + + /** + * Immediately close the session. All pending message callbacks will be called with an error. session.connect() will need to be called to be able to send messages again. Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints. + */ + disconnect(): void; + + /** + * Posts a message to the inspector back-end. callback will be notified when a response is received. callback is a function that accepts two optional arguments - error and message-specific result. + */ + post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void; + post(method: string, callback?: (err: Error | null, params?: {}) => void): void; + + /** + * Returns supported domains. + */ + post(method: "Schema.getDomains", callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; + /** + * Evaluates expression on global object. + */ + post(method: "Runtime.evaluate", params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + post(method: "Runtime.evaluate", callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + + /** + * Add handler to promise with given promise object id. + */ + post(method: "Runtime.awaitPromise", params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + post(method: "Runtime.awaitPromise", callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + + /** + * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. + */ + post(method: "Runtime.callFunctionOn", params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + post(method: "Runtime.callFunctionOn", callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + + /** + * Returns properties of a given object. Object group of the result is inherited from the target object. + */ + post(method: "Runtime.getProperties", params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + post(method: "Runtime.getProperties", callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + + /** + * Releases remote object with given id. + */ + post(method: "Runtime.releaseObject", params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.releaseObject", callback?: (err: Error | null) => void): void; + + /** + * Releases all remote objects that belong to a given group. + */ + post(method: "Runtime.releaseObjectGroup", params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.releaseObjectGroup", callback?: (err: Error | null) => void): void; + + /** + * Tells inspected instance to run if it was waiting for debugger to attach. + */ + post(method: "Runtime.runIfWaitingForDebugger", callback?: (err: Error | null) => void): void; + + /** + * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. + */ + post(method: "Runtime.enable", callback?: (err: Error | null) => void): void; + + /** + * Disables reporting of execution contexts creation. + */ + post(method: "Runtime.disable", callback?: (err: Error | null) => void): void; + + /** + * Discards collected exceptions and console API calls. + */ + post(method: "Runtime.discardConsoleEntries", callback?: (err: Error | null) => void): void; + + /** + * @experimental + */ + post(method: "Runtime.setCustomObjectFormatterEnabled", params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.setCustomObjectFormatterEnabled", callback?: (err: Error | null) => void): void; + + /** + * Compiles expression. + */ + post(method: "Runtime.compileScript", params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + post(method: "Runtime.compileScript", callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + + /** + * Runs script with given id in a given context. + */ + post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + /** + * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. + */ + post(method: "Debugger.enable", callback?: (err: Error | null) => void): void; + + /** + * Disables debugger for given page. + */ + post(method: "Debugger.disable", callback?: (err: Error | null) => void): void; + + /** + * Activates / deactivates all breakpoints on the page. + */ + post(method: "Debugger.setBreakpointsActive", params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBreakpointsActive", callback?: (err: Error | null) => void): void; + + /** + * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). + */ + post(method: "Debugger.setSkipAllPauses", params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setSkipAllPauses", callback?: (err: Error | null) => void): void; + + /** + * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. + */ + post(method: "Debugger.setBreakpointByUrl", params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + post(method: "Debugger.setBreakpointByUrl", callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + + /** + * Sets JavaScript breakpoint at a given location. + */ + post(method: "Debugger.setBreakpoint", params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + post(method: "Debugger.setBreakpoint", callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + + /** + * Removes JavaScript breakpoint. + */ + post(method: "Debugger.removeBreakpoint", params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.removeBreakpoint", callback?: (err: Error | null) => void): void; + + /** + * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. + * @experimental + */ + post(method: "Debugger.getPossibleBreakpoints", params?: Debugger.GetPossibleBreakpointsParameterType, callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; + post(method: "Debugger.getPossibleBreakpoints", callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; + + /** + * Continues execution until specific location is reached. + */ + post(method: "Debugger.continueToLocation", params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.continueToLocation", callback?: (err: Error | null) => void): void; + + /** + * Steps over the statement. + */ + post(method: "Debugger.stepOver", callback?: (err: Error | null) => void): void; + + /** + * Steps into the function call. + */ + post(method: "Debugger.stepInto", callback?: (err: Error | null) => void): void; + + /** + * Steps out of the function call. + */ + post(method: "Debugger.stepOut", callback?: (err: Error | null) => void): void; + + /** + * Stops on the next JavaScript statement. + */ + post(method: "Debugger.pause", callback?: (err: Error | null) => void): void; + + /** + * Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. + * @experimental + */ + post(method: "Debugger.scheduleStepIntoAsync", callback?: (err: Error | null) => void): void; + + /** + * Resumes JavaScript execution. + */ + post(method: "Debugger.resume", callback?: (err: Error | null) => void): void; + + /** + * Searches for given string in script content. + * @experimental + */ + post(method: "Debugger.searchInContent", params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + post(method: "Debugger.searchInContent", callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + + /** + * Edits JavaScript source live. + */ + post(method: "Debugger.setScriptSource", params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + post(method: "Debugger.setScriptSource", callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + + /** + * Restarts particular call frame from the beginning. + */ + post(method: "Debugger.restartFrame", params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + post(method: "Debugger.restartFrame", callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + + /** + * Returns source for the script with given id. + */ + post(method: "Debugger.getScriptSource", params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + post(method: "Debugger.getScriptSource", callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + + /** + * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. + */ + post(method: "Debugger.setPauseOnExceptions", params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setPauseOnExceptions", callback?: (err: Error | null) => void): void; + + /** + * Evaluates expression on a given call frame. + */ + post(method: "Debugger.evaluateOnCallFrame", params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + post(method: "Debugger.evaluateOnCallFrame", callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + + /** + * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. + */ + post(method: "Debugger.setVariableValue", params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setVariableValue", callback?: (err: Error | null) => void): void; + + /** + * Enables or disables async call stacks tracking. + */ + post(method: "Debugger.setAsyncCallStackDepth", params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setAsyncCallStackDepth", callback?: (err: Error | null) => void): void; + + /** + * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. + * @experimental + */ + post(method: "Debugger.setBlackboxPatterns", params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBlackboxPatterns", callback?: (err: Error | null) => void): void; + + /** + * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. + * @experimental + */ + post(method: "Debugger.setBlackboxedRanges", params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBlackboxedRanges", callback?: (err: Error | null) => void): void; + /** + * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. + */ + post(method: "Console.enable", callback?: (err: Error | null) => void): void; + + /** + * Disables console domain, prevents further console messages from being reported to the client. + */ + post(method: "Console.disable", callback?: (err: Error | null) => void): void; + + /** + * Does nothing. + */ + post(method: "Console.clearMessages", callback?: (err: Error | null) => void): void; + post(method: "Profiler.enable", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.disable", callback?: (err: Error | null) => void): void; + + /** + * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. + */ + post(method: "Profiler.setSamplingInterval", params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; + post(method: "Profiler.setSamplingInterval", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.start", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.stop", callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; + + /** + * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. + * @experimental + */ + post(method: "Profiler.startPreciseCoverage", params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; + post(method: "Profiler.startPreciseCoverage", callback?: (err: Error | null) => void): void; + + /** + * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. + * @experimental + */ + post(method: "Profiler.stopPreciseCoverage", callback?: (err: Error | null) => void): void; + + /** + * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. + * @experimental + */ + post(method: "Profiler.takePreciseCoverage", callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; + + /** + * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. + * @experimental + */ + post(method: "Profiler.getBestEffortCoverage", callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; + post(method: "HeapProfiler.enable", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.disable", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.startTrackingHeapObjects", params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.startTrackingHeapObjects", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.stopTrackingHeapObjects", params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.stopTrackingHeapObjects", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.takeHeapSnapshot", params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.takeHeapSnapshot", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.collectGarbage", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.getObjectByHeapObjectId", params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; + post(method: "HeapProfiler.getObjectByHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; + + /** + * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). + */ + post(method: "HeapProfiler.addInspectedHeapObject", params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.addInspectedHeapObject", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.getHeapObjectId", params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + post(method: "HeapProfiler.getHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + + post(method: "HeapProfiler.startSampling", params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.startSampling", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.stopSampling", callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; + + // Events + + addListener(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + addListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new execution context is created. + */ + addListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + addListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + addListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + addListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + addListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + addListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + addListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + addListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + addListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + addListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + addListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + addListener(event: "Debugger.resumed", listener: () => void): this; + + /** + * Issued when new console message is added. + */ + addListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + addListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + addListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + addListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + addListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + addListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "inspectorNotification", message: InspectorNotification<{}>): boolean; + emit(event: "Runtime.executionContextCreated", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextDestroyed", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextsCleared"): boolean; + emit(event: "Runtime.exceptionThrown", message: InspectorNotification): boolean; + emit(event: "Runtime.exceptionRevoked", message: InspectorNotification): boolean; + emit(event: "Runtime.consoleAPICalled", message: InspectorNotification): boolean; + emit(event: "Runtime.inspectRequested", message: InspectorNotification): boolean; + emit(event: "Debugger.scriptParsed", message: InspectorNotification): boolean; + emit(event: "Debugger.scriptFailedToParse", message: InspectorNotification): boolean; + emit(event: "Debugger.breakpointResolved", message: InspectorNotification): boolean; + emit(event: "Debugger.paused", message: InspectorNotification): boolean; + emit(event: "Debugger.resumed"): boolean; + emit(event: "Console.messageAdded", message: InspectorNotification): boolean; + emit(event: "Profiler.consoleProfileStarted", message: InspectorNotification): boolean; + emit(event: "Profiler.consoleProfileFinished", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.addHeapSnapshotChunk", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.resetProfiles"): boolean; + emit(event: "HeapProfiler.reportHeapSnapshotProgress", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.lastSeenObjectId", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.heapStatsUpdate", message: InspectorNotification): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + on(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new execution context is created. + */ + on(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + on(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + on(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + on(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + on(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + on(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + on(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + on(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + on(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + on(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + on(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + on(event: "Debugger.resumed", listener: () => void): this; + + /** + * Issued when new console message is added. + */ + on(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + on(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + on(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.resetProfiles", listener: () => void): this; + on(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + on(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + on(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + once(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new execution context is created. + */ + once(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + once(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + once(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + once(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + once(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + once(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + once(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + once(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + once(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + once(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + once(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + once(event: "Debugger.resumed", listener: () => void): this; + + /** + * Issued when new console message is added. + */ + once(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + once(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + once(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.resetProfiles", listener: () => void): this; + once(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + once(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + once(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new execution context is created. + */ + prependListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + prependListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + prependListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + prependListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + prependListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + prependListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + prependListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + prependListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + prependListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + prependListener(event: "Debugger.resumed", listener: () => void): this; + + /** + * Issued when new console message is added. + */ + prependListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + prependListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + prependListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependOnceListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new execution context is created. + */ + prependOnceListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + prependOnceListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + prependOnceListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + prependOnceListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + prependOnceListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + prependOnceListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + prependOnceListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + prependOnceListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + prependOnceListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependOnceListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependOnceListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + prependOnceListener(event: "Debugger.resumed", listener: () => void): this; + + /** + * Issued when new console message is added. + */ + prependOnceListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependOnceListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + prependOnceListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + prependOnceListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependOnceListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependOnceListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + } + + // Top Level API + + /** + * Activate inspector on host and port. Equivalent to node --inspect=[[host:]port], but can be done programatically after node has started. + * If wait is true, will block until a client has connected to the inspect port and flow control has been passed to the debugger client. + * @param port Port to listen on for inspector connections. Optional, defaults to what was specified on the CLI. + * @param host Host to listen on for inspector connections. Optional, defaults to what was specified on the CLI. + * @param wait Block until a client has connected. Optional, defaults to false. + */ + export function open(port?: number, host?: string, wait?: boolean): void; + + /** + * Deactivate the inspector. Blocks until there are no active connections. + */ + export function close(): void; + + /** + * Return the URL of the active inspector, or undefined if there is none. + */ + export function url(): string; +} diff --git a/types/node/v9/node-tests.ts b/types/node/v9/node-tests.ts new file mode 100644 index 0000000000..7a055c620e --- /dev/null +++ b/types/node/v9/node-tests.ts @@ -0,0 +1,4010 @@ +import assert = require("assert"); +import * as fs from "fs"; +import * as events from "events"; +import events2 = require("events"); +import * as zlib from "zlib"; +import * as url from "url"; +import * as util from "util"; +import * as crypto from "crypto"; +import * as tls from "tls"; +import * as http from "http"; +import * as https from "https"; +import * as net from "net"; +import * as tty from "tty"; +import * as dgram from "dgram"; +import * as querystring from "querystring"; +import * as path from "path"; +import * as readline from "readline"; +import * as childProcess from "child_process"; +import * as cluster from "cluster"; +import * as os from "os"; +import * as vm from "vm"; +import * as console2 from "console"; +import * as string_decoder from "string_decoder"; +import * as stream from "stream"; +import * as timers from "timers"; +import * as repl from "repl"; +import * as v8 from "v8"; +import * as dns from "dns"; +import * as async_hooks from "async_hooks"; +import * as http2 from "http2"; +import * as inspector from "inspector"; +import * as perf_hooks from "perf_hooks"; +import Module = require("module"); + +// Specifically test buffer module regression. +import { Buffer as ImportedBuffer, SlowBuffer as ImportedSlowBuffer } from "buffer"; + +////////////////////////////////////////////////////////// +/// Global Tests : https://nodejs.org/api/global.html /// +////////////////////////////////////////////////////////// +namespace global_tests { + { + let x: NodeModule; + let y: NodeModule; + x.children.push(y); + x.parent = require.main; + require.main = y; + } +} + +////////////////////////////////////////////////////////// +/// Assert Tests : https://nodejs.org/api/assert.html /// +////////////////////////////////////////////////////////// + +namespace assert_tests { + { + assert(1 + 1 - 2 === 0, "The universe isn't how it should."); + + assert.deepEqual({ x: { y: 3 } }, { x: { y: 3 } }, "DEEP WENT DERP"); + + assert.deepStrictEqual({ a: 1 }, { a: 1 }, "uses === comparator"); + + assert.doesNotThrow(() => { + const b = false; + if (b) { throw new Error("a hammer at your face"); } + }, undefined, "What the...*crunch*"); + + assert.equal(3, "3", "uses == comparator"); + + assert.fail('stuff broke'); + + assert.fail('actual', 'expected', 'message'); + + assert.fail(1, 2, undefined, '>'); + + assert.ifError(0); + + assert.notDeepStrictEqual({ x: { y: "3" } }, { x: { y: 3 } }, "uses !== comparator"); + + assert.notEqual(1, 2, "uses != comparator"); + + assert.notStrictEqual(2, "2", "uses === comparator"); + + assert.ok(true); + assert.ok(1); + + assert.strictEqual(1, 1, "uses === comparator"); + + assert.throws(() => { throw new Error("a hammer at your face"); }, undefined, "DODGED IT"); + } +} + +//////////////////////////////////////////////////// +/// Events tests : http://nodejs.org/api/events.html +//////////////////////////////////////////////////// + +namespace events_tests { + let emitter: events.EventEmitter; + let event: string | symbol; + let listener: (...args: any[]) => void; + let any: any; + + { + let result: events.EventEmitter; + + result = emitter.addListener(event, listener); + result = emitter.on(event, listener); + result = emitter.once(event, listener); + result = emitter.prependListener(event, listener); + result = emitter.prependOnceListener(event, listener); + result = emitter.removeListener(event, listener); + result = emitter.removeAllListeners(); + result = emitter.removeAllListeners(event); + result = emitter.setMaxListeners(42); + } + + { + let result: number; + + result = events.EventEmitter.defaultMaxListeners; + result = events.EventEmitter.listenerCount(emitter, event); // deprecated + + result = emitter.getMaxListeners(); + result = emitter.listenerCount(event); + } + + { + let result: Function[]; + + result = emitter.listeners(event); + } + + { + let result: boolean; + + result = emitter.emit(event); + result = emitter.emit(event, any); + result = emitter.emit(event, any, any); + result = emitter.emit(event, any, any, any); + } + + { + let result: Array; + + result = emitter.eventNames(); + } + + { + class Networker extends events.EventEmitter { + constructor() { + super(); + + this.emit("mingling"); + } + } + } + + { + new events2(); + } +} + +//////////////////////////////////////////////////// +/// File system tests : http://nodejs.org/api/fs.html +//////////////////////////////////////////////////// + +namespace fs_tests { + { + fs.writeFile("thebible.txt", + "Do unto others as you would have them do unto you.", + assert.ifError); + + fs.write(1234, "test", () => { }); + + fs.writeFile("Harry Potter", + "\"You be wizzing, Harry,\" jived Dumbledore.", + { + encoding: "ascii" + }, + assert.ifError); + + fs.writeFile("testfile", "content", "utf8", assert.ifError); + + fs.writeFileSync("testfile", "content", "utf8"); + fs.writeFileSync("testfile", "content", { encoding: "utf8" }); + } + + { + fs.appendFile("testfile", "foobar", "utf8", assert.ifError); + fs.appendFile("testfile", "foobar", { encoding: "utf8" }, assert.ifError); + fs.appendFileSync("testfile", "foobar", "utf8"); + fs.appendFileSync("testfile", "foobar", { encoding: "utf8" }); + } + + { + var content: string; + var buffer: Buffer; + var stringOrBuffer: string | Buffer; + var nullEncoding: string | null = null; + var stringEncoding: string | null = 'utf8'; + + content = fs.readFileSync('testfile', 'utf8'); + content = fs.readFileSync('testfile', { encoding: 'utf8' }); + stringOrBuffer = fs.readFileSync('testfile', stringEncoding); + stringOrBuffer = fs.readFileSync('testfile', { encoding: stringEncoding }); + + buffer = fs.readFileSync('testfile'); + buffer = fs.readFileSync('testfile', null); + buffer = fs.readFileSync('testfile', { encoding: null }); + stringOrBuffer = fs.readFileSync('testfile', nullEncoding); + stringOrBuffer = fs.readFileSync('testfile', { encoding: nullEncoding }); + + buffer = fs.readFileSync('testfile', { flag: 'r' }); + + fs.readFile('testfile', 'utf8', (err, data) => content = data); + fs.readFile('testfile', { encoding: 'utf8' }, (err, data) => content = data); + fs.readFile('testfile', stringEncoding, (err, data) => stringOrBuffer = data); + fs.readFile('testfile', { encoding: stringEncoding }, (err, data) => stringOrBuffer = data); + + fs.readFile('testfile', (err, data) => buffer = data); + fs.readFile('testfile', null, (err, data) => buffer = data); + fs.readFile('testfile', { encoding: null }, (err, data) => buffer = data); + fs.readFile('testfile', nullEncoding, (err, data) => stringOrBuffer = data); + fs.readFile('testfile', { encoding: nullEncoding }, (err, data) => stringOrBuffer = data); + + fs.readFile('testfile', { flag: 'r' }, (err, data) => buffer = data); + } + + { + var errno: number; + fs.readFile('testfile', (err, data) => { + if (err && err.errno) { + errno = err.errno; + } + }); + } + + { + let listS: string[]; + listS = fs.readdirSync('path'); + listS = fs.readdirSync('path', { encoding: 'utf8' }); + listS = fs.readdirSync('path', { encoding: null }); + listS = fs.readdirSync('path', { encoding: undefined }); + listS = fs.readdirSync('path', 'utf8'); + listS = fs.readdirSync('path', null); + listS = fs.readdirSync('path', undefined); + + let listB: Buffer[]; + listB = fs.readdirSync('path', { encoding: 'buffer' }); + listB = fs.readdirSync("path", 'buffer'); + + let enc = 'buffer'; + fs.readdirSync('path', { encoding: enc }); // $ExpectType string[] | Buffer[] + fs.readdirSync('path', { }); // $ExpectType string[] | Buffer[] + } + + { + fs.mkdtemp('/tmp/foo-', (err, folder) => { + console.log(folder); + // Prints: /tmp/foo-itXde2 + }); + } + + { + var tempDir: string; + tempDir = fs.mkdtempSync('/tmp/foo-'); + } + + { + fs.watch('/tmp/foo-', (event, filename) => { + console.log(event, filename); + }); + + fs.watch('/tmp/foo-', 'utf8', (event, filename) => { + console.log(event, filename); + }); + + fs.watch('/tmp/foo-', { + recursive: true, + persistent: true, + encoding: 'utf8' + }, (event, filename) => { + console.log(event, filename); + }); + } + + { + fs.access('/path/to/folder', (err) => { }); + + fs.access(Buffer.from(''), (err) => { }); + + fs.access('/path/to/folder', fs.constants.F_OK | fs.constants.R_OK, (err) => { }); + + fs.access(Buffer.from(''), fs.constants.F_OK | fs.constants.R_OK, (err) => { }); + + fs.accessSync('/path/to/folder'); + + fs.accessSync(Buffer.from('')); + + fs.accessSync('path/to/folder', fs.constants.W_OK | fs.constants.X_OK); + + fs.accessSync(Buffer.from(''), fs.constants.W_OK | fs.constants.X_OK); + } + + { + let s: string; + let b: Buffer; + fs.readlink('/path/to/folder', (err, linkString) => s = linkString); + fs.readlink('/path/to/folder', undefined, (err, linkString) => s = linkString); + fs.readlink('/path/to/folder', 'utf8', (err, linkString) => s = linkString); + fs.readlink('/path/to/folder', 'buffer', (err, linkString) => b = linkString); + fs.readlink('/path/to/folder', s, (err, linkString) => typeof linkString === 'string' ? s = linkString : b = linkString); + fs.readlink('/path/to/folder', {}, (err, linkString) => s = linkString); + fs.readlink('/path/to/folder', { encoding: undefined }, (err, linkString) => s = linkString); + fs.readlink('/path/to/folder', { encoding: 'utf8' }, (err, linkString) => s = linkString); + fs.readlink('/path/to/folder', { encoding: 'buffer' }, (err, linkString) => b = linkString); + fs.readlink('/path/to/folder', { encoding: s }, (err, linkString) => typeof linkString === "string" ? s = linkString : b = linkString); + + s = fs.readlinkSync('/path/to/folder'); + s = fs.readlinkSync('/path/to/folder', undefined); + s = fs.readlinkSync('/path/to/folder', 'utf8'); + b = fs.readlinkSync('/path/to/folder', 'buffer'); + const v1 = fs.readlinkSync('/path/to/folder', s); + typeof v1 === "string" ? s = v1 : b = v1; + + s = fs.readlinkSync('/path/to/folder', {}); + s = fs.readlinkSync('/path/to/folder', { encoding: undefined }); + s = fs.readlinkSync('/path/to/folder', { encoding: 'utf8' }); + b = fs.readlinkSync('/path/to/folder', { encoding: 'buffer' }); + const v2 = fs.readlinkSync('/path/to/folder', { encoding: s }); + typeof v2 === "string" ? s = v2 : b = v2; + } + + { + let s: string; + let b: Buffer; + fs.realpath('/path/to/folder', (err, resolvedPath) => s = resolvedPath); + fs.realpath('/path/to/folder', undefined, (err, resolvedPath) => s = resolvedPath); + fs.realpath('/path/to/folder', 'utf8', (err, resolvedPath) => s = resolvedPath); + fs.realpath('/path/to/folder', 'buffer', (err, resolvedPath) => b = resolvedPath); + fs.realpath('/path/to/folder', s, (err, resolvedPath) => typeof resolvedPath === 'string' ? s = resolvedPath : b = resolvedPath); + fs.realpath('/path/to/folder', {}, (err, resolvedPath) => s = resolvedPath); + fs.realpath('/path/to/folder', { encoding: undefined }, (err, resolvedPath) => s = resolvedPath); + fs.realpath('/path/to/folder', { encoding: 'utf8' }, (err, resolvedPath) => s = resolvedPath); + fs.realpath('/path/to/folder', { encoding: 'buffer' }, (err, resolvedPath) => b = resolvedPath); + fs.realpath('/path/to/folder', { encoding: s }, (err, resolvedPath) => typeof resolvedPath === "string" ? s = resolvedPath : b = resolvedPath); + + s = fs.realpathSync('/path/to/folder'); + s = fs.realpathSync('/path/to/folder', undefined); + s = fs.realpathSync('/path/to/folder', 'utf8'); + b = fs.realpathSync('/path/to/folder', 'buffer'); + const v1 = fs.realpathSync('/path/to/folder', s); + typeof v1 === "string" ? s = v1 : b = v1; + + s = fs.realpathSync('/path/to/folder', {}); + s = fs.realpathSync('/path/to/folder', { encoding: undefined }); + s = fs.realpathSync('/path/to/folder', { encoding: 'utf8' }); + b = fs.realpathSync('/path/to/folder', { encoding: 'buffer' }); + const v2 = fs.realpathSync('/path/to/folder', { encoding: s }); + typeof v2 === "string" ? s = v2 : b = v2; + + // native + fs.realpath.native('/path/to/folder', (err, resolvedPath) => s = resolvedPath); + fs.realpath.native('/path/to/folder', undefined, (err, resolvedPath) => s = resolvedPath); + fs.realpath.native('/path/to/folder', 'utf8', (err, resolvedPath) => s = resolvedPath); + fs.realpath.native('/path/to/folder', 'buffer', (err, resolvedPath) => b = resolvedPath); + fs.realpath.native('/path/to/folder', s, (err, resolvedPath) => typeof resolvedPath === 'string' ? s = resolvedPath : b = resolvedPath); + fs.realpath.native('/path/to/folder', {}, (err, resolvedPath) => s = resolvedPath); + fs.realpath.native('/path/to/folder', { encoding: undefined }, (err, resolvedPath) => s = resolvedPath); + fs.realpath.native('/path/to/folder', { encoding: 'utf8' }, (err, resolvedPath) => s = resolvedPath); + fs.realpath.native('/path/to/folder', { encoding: 'buffer' }, (err, resolvedPath) => b = resolvedPath); + fs.realpath.native('/path/to/folder', { encoding: s }, (err, resolvedPath) => typeof resolvedPath === "string" ? s = resolvedPath : b = resolvedPath); + + s = fs.realpathSync.native('/path/to/folder'); + s = fs.realpathSync.native('/path/to/folder', undefined); + s = fs.realpathSync.native('/path/to/folder', 'utf8'); + b = fs.realpathSync.native('/path/to/folder', 'buffer'); + const v3 = fs.realpathSync.native('/path/to/folder', s); + typeof v3 === "string" ? s = v3 : b = v3; + + s = fs.realpathSync.native('/path/to/folder', {}); + s = fs.realpathSync.native('/path/to/folder', { encoding: undefined }); + s = fs.realpathSync.native('/path/to/folder', { encoding: 'utf8' }); + b = fs.realpathSync.native('/path/to/folder', { encoding: 'buffer' }); + const v4 = fs.realpathSync.native('/path/to/folder', { encoding: s }); + typeof v4 === "string" ? s = v4 : b = v4; + } + + { + fs.copyFile('/path/to/src', '/path/to/dest', (err) => console.error(err)); + fs.copyFile('/path/to/src', '/path/to/dest', fs.constants.COPYFILE_EXCL, (err) => console.error(err)); + + fs.copyFileSync('/path/to/src', '/path/to/dest', fs.constants.COPYFILE_EXCL); + + const cf = util.promisify(fs.copyFile); + cf('/path/to/src', '/path/to/dest', fs.constants.COPYFILE_EXCL).then(console.log); + } +} + +/////////////////////////////////////////////////////// +/// Buffer tests : https://nodejs.org/api/buffer.html +/////////////////////////////////////////////////////// + +function bufferTests() { + var utf8Buffer = new Buffer('test'); + var base64Buffer = new Buffer('', 'base64'); + var octets: Uint8Array = null; + var octetBuffer = new Buffer(octets); + var sharedBuffer = new Buffer(octets.buffer); + var copiedBuffer = new Buffer(utf8Buffer); + console.log(Buffer.isBuffer(octetBuffer)); + console.log(Buffer.isEncoding('utf8')); + console.log(Buffer.byteLength('xyz123')); + console.log(Buffer.byteLength('xyz123', 'ascii')); + var result1 = Buffer.concat([utf8Buffer, base64Buffer]); + var result2 = Buffer.concat([utf8Buffer, base64Buffer], 9999999); + + // Class Methods: Buffer.swap16(), Buffer.swa32(), Buffer.swap64() + { + const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + buf.swap16(); + buf.swap32(); + buf.swap64(); + } + + // Class Method: Buffer.from(data) + { + // Array + const buf1: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Buffer + const buf2: Buffer = Buffer.from(buf1); + // String + const buf3: Buffer = Buffer.from('this is a tést'); + // ArrayBuffer + const arr: Uint16Array = new Uint16Array(2); + arr[0] = 5000; + arr[1] = 4000; + const buf4: Buffer = Buffer.from(arr.buffer); + } + + // Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) + { + const arr: Uint16Array = new Uint16Array(2); + arr[0] = 5000; + arr[1] = 4000; + + let buf: Buffer; + buf = Buffer.from(arr.buffer, 1); + buf = Buffer.from(arr.buffer, 0, 1); + } + + // Class Method: Buffer.from(str[, encoding]) + { + const buf2: Buffer = Buffer.from('7468697320697320612074c3a97374', 'hex'); + } + + // Class Method: Buffer.alloc(size[, fill[, encoding]]) + { + const buf1: Buffer = Buffer.alloc(5); + const buf2: Buffer = Buffer.alloc(5, 'a'); + const buf3: Buffer = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); + } + // Class Method: Buffer.allocUnsafe(size) + { + const buf: Buffer = Buffer.allocUnsafe(5); + } + // Class Method: Buffer.allocUnsafeSlow(size) + { + const buf: Buffer = Buffer.allocUnsafeSlow(10); + } + + // Class Method byteLenght + { + let len: number; + len = Buffer.byteLength("foo"); + len = Buffer.byteLength("foo", "utf8"); + + const b = Buffer.from("bar"); + len = Buffer.byteLength(b); + len = Buffer.byteLength(b, "utf16le"); + + const ab = new ArrayBuffer(15); + len = Buffer.byteLength(ab); + len = Buffer.byteLength(ab, "ascii"); + + const dv = new DataView(ab); + len = Buffer.byteLength(dv); + len = Buffer.byteLength(dv, "utf16le"); + } + + // Class Method poolSize + { + let s: number; + s = Buffer.poolSize; + Buffer.poolSize = 4096; + } + + // Test that TS 1.6 works with the 'as Buffer' annotation + // on isBuffer. + var a: Buffer | number; + a = new Buffer(10); + if (Buffer.isBuffer(a)) { + a.writeUInt8(3, 4); + } + + // write* methods return offsets. + var b = new Buffer(16); + var result: number = b.writeUInt32LE(0, 0); + result = b.writeUInt16LE(0, 4); + result = b.writeUInt8(0, 6); + result = b.writeInt8(0, 7); + result = b.writeDoubleLE(0, 8); + + // fill returns the input buffer. + b.fill('a').fill('b'); + + { + let buffer = new Buffer('123'); + let index: number; + index = buffer.indexOf("23"); + index = buffer.indexOf("23", 1); + index = buffer.indexOf("23", 1, "utf8"); + index = buffer.indexOf(23); + index = buffer.indexOf(buffer); + } + + { + let buffer = new Buffer('123'); + let index: number; + index = buffer.lastIndexOf("23"); + index = buffer.lastIndexOf("23", 1); + index = buffer.lastIndexOf("23", 1, "utf8"); + index = buffer.lastIndexOf(23); + index = buffer.lastIndexOf(buffer); + } + + { + let buffer = new Buffer('123'); + let val: [number, number]; + + /* comment out for --target es5 + for (let entry of buffer.entries()) { + val = entry; + } + */ + } + + { + let buffer = new Buffer('123'); + let includes: boolean; + includes = buffer.includes("23"); + includes = buffer.includes("23", 1); + includes = buffer.includes("23", 1, "utf8"); + includes = buffer.includes(23); + includes = buffer.includes(23, 1); + includes = buffer.includes(23, 1, "utf8"); + includes = buffer.includes(buffer); + includes = buffer.includes(buffer, 1); + includes = buffer.includes(buffer, 1, "utf8"); + } + + { + let buffer = new Buffer('123'); + let val: number; + + /* comment out for --target es5 + for (let key of buffer.keys()) { + val = key; + } + */ + } + + { + let buffer = new Buffer('123'); + let val: number; + + /* comment out for --target es5 + for (let value of buffer.values()) { + val = value; + } + */ + } + + // Imported Buffer from buffer module works properly + { + let b = new ImportedBuffer('123'); + b.writeUInt8(0, 6); + let sb = new ImportedSlowBuffer(43); + b.writeUInt8(0, 6); + } + + // Buffer has Uint8Array's buffer field (an ArrayBuffer). + { + let buffer = new Buffer('123'); + let octets = new Uint8Array(buffer.buffer); + } +} + +//////////////////////////////////////////////////// +/// Url tests : http://nodejs.org/api/url.html +//////////////////////////////////////////////////// + +namespace url_tests { + { + url.format(url.parse('http://www.example.com/xyz')); + + url.format('http://www.example.com/xyz'); + + // https://google.com/search?q=you're%20a%20lizard%2C%20gary + url.format({ + protocol: 'https', + host: "google.com", + pathname: 'search', + query: { q: "you're a lizard, gary" } + }); + + const myURL = new url.URL('https://a:b@你好你好?abc#foo'); + url.format(myURL, { fragment: false, unicode: true, auth: false }); + } + + { + const helloUrl = url.parse('http://example.com/?hello=world', true); + let helloQuery = helloUrl.query['hello']; + assert.equal(helloUrl.query['hello'], 'world'); + + let strUrl = url.parse('http://example.com/?hello=world'); + let queryStr: string = strUrl.query; + + strUrl = url.parse('http://example.com/?hello=world', false); + queryStr = strUrl.query; + + function getBoolean(): boolean { return false; } + const urlUrl = url.parse('http://example.com/?hello=world', getBoolean()); + if (typeof(urlUrl.query) === 'string') { + queryStr = urlUrl.query; + } else if (urlUrl.query) { + helloQuery = urlUrl.query['hello']; + } + } + + { + const ascii: string = url.domainToASCII('español.com'); + const unicode: string = url.domainToUnicode('xn--espaol-zwa.com'); + } + + { + let myURL = new url.URL('https://theuser:thepwd@example.org:81/foo/path?query=string#bar'); + assert.equal(myURL.hash, '#bar'); + assert.equal(myURL.host, 'example.org:81'); + assert.equal(myURL.hostname, 'example.org'); + assert.equal(myURL.href, 'https://theuser:thepwd@example.org:81/foo/path?query=string#bar'); + assert.equal(myURL.origin, 'https://example.org:81'); + assert.equal(myURL.password, 'thepwd'); + assert.equal(myURL.username, 'theuser'); + assert.equal(myURL.pathname, '/foo/path'); + assert.equal(myURL.port, "81"); + assert.equal(myURL.protocol, "https:"); + assert.equal(myURL.search, "?query=string"); + assert.equal(myURL.toString(), 'https://theuser:thepwd@example.org:81/foo/path?query=string#bar'); + assert(myURL.searchParams instanceof url.URLSearchParams); + + myURL.host = 'example.org:82'; + myURL.hostname = 'example.com'; + myURL.href = 'http://other.com'; + myURL.hash = 'baz'; + myURL.password = "otherpwd"; + myURL.username = "otheruser"; + myURL.pathname = "/otherPath"; + myURL.port = "82"; + myURL.protocol = "http"; + myURL.search = "a=b"; + assert.equal(myURL.href, 'http://otheruser:otherpwd@other.com:82/otherPath?a=b#baz'); + + myURL = new url.URL('/foo', 'https://example.org/'); + assert.equal(myURL.href, 'https://example.org/foo'); + assert.equal(myURL.toJSON(), myURL.href); + } + + { + const searchParams = new url.URLSearchParams('abc=123'); + + assert.equal(searchParams.toString(), 'abc=123'); + searchParams.forEach((value: string, name: string): void => { + assert.equal(name, 'abc'); + assert.equal(value, '123'); + }); + + assert.equal(searchParams.get('abc'), '123'); + + searchParams.append('abc', 'xyz'); + + assert.deepEqual(searchParams.getAll('abc'), ['123', 'xyz']); + + const entries = searchParams.entries(); + assert.deepEqual(entries.next(), { value: ["abc", "123"], done: false }); + assert.deepEqual(entries.next(), { value: ["abc", "xyz"], done: false }); + assert.deepEqual(entries.next(), { value: undefined, done: true }); + + const keys = searchParams.keys(); + assert.deepEqual(keys.next(), { value: "abc", done: false }); + assert.deepEqual(keys.next(), { value: "abc", done: false }); + assert.deepEqual(keys.next(), { value: undefined, done: true }); + + const values = searchParams.values(); + assert.deepEqual(values.next(), { value: "123", done: false }); + assert.deepEqual(values.next(), { value: "xyz", done: false }); + assert.deepEqual(values.next(), { value: undefined, done: true }); + + searchParams.set('abc', 'b'); + assert.deepEqual(searchParams.getAll('abc'), ['b']); + + searchParams.delete('a'); + assert(!searchParams.has('a')); + assert.equal(searchParams.get('a'), null); + + searchParams.sort(); + } + + { + const searchParams = new url.URLSearchParams({ + user: 'abc', + query: ['first', 'second'] + }); + + assert.equal(searchParams.toString(), 'user=abc&query=first%2Csecond'); + assert.deepEqual(searchParams.getAll('query'), ['first,second']); + } + + { + // Using an array + let params = new url.URLSearchParams([ + ['user', 'abc'], + ['query', 'first'], + ['query', 'second'] + ]); + assert.equal(params.toString(), 'user=abc&query=first&query=second'); + } +} + +///////////////////////////////////////////////////// +/// util tests : https://nodejs.org/api/util.html /// +///////////////////////////////////////////////////// + +namespace util_tests { + { + // Old and new util.inspect APIs + util.inspect(["This is nice"], false, 5); + util.inspect(["This is nice"], false, null); + util.inspect(["This is nice"], { + colors: true, + depth: 5, + customInspect: false, + showProxy: true, + maxArrayLength: 10, + breakLength: 20 + }); + util.inspect(["This is nice"], { + colors: true, + depth: null, + customInspect: false, + showProxy: true, + maxArrayLength: null, + breakLength: Infinity + }); + assert(typeof util.inspect.custom === 'symbol'); + + // util.callbackify + // tslint:disable-next-line no-unnecessary-class + class callbackifyTest { + static fn(): Promise { + assert(arguments.length === 0); + + return Promise.resolve(); + } + + static fnE(): Promise { + assert(arguments.length === 0); + + return Promise.reject(new Error('fail')); + } + + static fnT1(arg1: string): Promise { + assert(arguments.length === 1 && arg1 === 'parameter'); + + return Promise.resolve(); + } + + static fnT1E(arg1: string): Promise { + assert(arguments.length === 1 && arg1 === 'parameter'); + + return Promise.reject(new Error('fail')); + } + + static fnTResult(): Promise { + assert(arguments.length === 0); + + return Promise.resolve('result'); + } + + static fnTResultE(): Promise { + assert(arguments.length === 0); + + return Promise.reject(new Error('fail')); + } + + static fnT1TResult(arg1: string): Promise { + assert(arguments.length === 1 && arg1 === 'parameter'); + + return Promise.resolve('result'); + } + + static fnT1TResultE(arg1: string): Promise { + assert(arguments.length === 1 && arg1 === 'parameter'); + + return Promise.reject(new Error('fail')); + } + + static test(): void { + var cfn = util.callbackify(this.fn); + var cfnE = util.callbackify(this.fnE); + var cfnT1 = util.callbackify(this.fnT1); + var cfnT1E = util.callbackify(this.fnT1E); + var cfnTResult = util.callbackify(this.fnTResult); + var cfnTResultE = util.callbackify(this.fnTResultE); + var cfnT1TResult = util.callbackify(this.fnT1TResult); + var cfnT1TResultE = util.callbackify(this.fnT1TResultE); + + cfn((err: NodeJS.ErrnoException, ...args: string[]) => assert(err === null && args.length === 1 && args[0] === undefined)); + cfnE((err: NodeJS.ErrnoException, ...args: string[]) => assert(err.message === 'fail' && args.length === 0)); + cfnT1('parameter', (err: NodeJS.ErrnoException, ...args: string[]) => assert(err === null && args.length === 1 && args[0] === undefined)); + cfnT1E('parameter', (err: NodeJS.ErrnoException, ...args: string[]) => assert(err.message === 'fail' && args.length === 0)); + cfnTResult((err: NodeJS.ErrnoException, ...args: string[]) => assert(err === null && args.length === 1 && args[0] === 'result')); + cfnTResultE((err: NodeJS.ErrnoException, ...args: string[]) => assert(err.message === 'fail' && args.length === 0)); + cfnT1TResult('parameter', (err: NodeJS.ErrnoException, ...args: string[]) => assert(err === null && args.length === 1 && args[0] === 'result')); + cfnT1TResultE('parameter', (err: NodeJS.ErrnoException, ...args: string[]) => assert(err.message === 'fail' && args.length === 0)); + } + } + callbackifyTest.test(); + + // util.promisify + var readPromised = util.promisify(fs.readFile); + var sampleRead: Promise = readPromised(__filename).then((data: Buffer): void => { }).catch((error: Error): void => { }); + var arg0: () => Promise = util.promisify((cb: (err: Error, result: number) => void): void => { }); + var arg0NoResult: () => Promise = util.promisify((cb: (err: Error) => void): void => { }); + var arg1: (arg: string) => Promise = util.promisify((arg: string, cb: (err: Error, result: number) => void): void => { }); + var arg1NoResult: (arg: string) => Promise = util.promisify((arg: string, cb: (err: Error) => void): void => { }); + assert(typeof util.promisify.custom === 'symbol'); + // util.deprecate + const foo = () => {}; + // $ExpectType () => void + util.deprecate(foo, 'foo() is deprecated, use bar() instead'); + // $ExpectType (fn: T, message: string) => T + util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead'); + } +} + +//////////////////////////////////////////////////// +/// Stream tests : http://nodejs.org/api/stream.html +//////////////////////////////////////////////////// + +// http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options +function stream_readable_pipe_test() { + var rs = fs.createReadStream(Buffer.from('file.txt')); + var r = fs.createReadStream('file.txt'); + var z = zlib.createGzip({ finishFlush: zlib.constants.Z_FINISH }); + var w = fs.createWriteStream('file.txt.gz'); + + assert(typeof z.bytesRead === 'number'); + assert(typeof r.bytesRead === 'number'); + assert(typeof r.path === 'string'); + assert(rs.path instanceof Buffer); + + r.pipe(z).pipe(w); + + z.flush(); + r.close(); + z.close(); + rs.close(); +} + +// helpers +const compressMe = new Buffer("some data"); +const compressMeString = "compress me!"; + +zlib.deflate(compressMe, (err: Error, result: Buffer) => zlib.inflate(result, (err: Error, result: Buffer) => result)); +zlib.deflate(compressMe, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => zlib.inflate(result, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => result)); +zlib.deflate(compressMeString, (err: Error, result: Buffer) => zlib.inflate(result, (err: Error, result: Buffer) => result)); +zlib.deflate(compressMeString, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => zlib.inflate(result, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => result)); +const inflated = zlib.inflateSync(zlib.deflateSync(compressMe)); +const inflatedString = zlib.inflateSync(zlib.deflateSync(compressMeString)); + +zlib.deflateRaw(compressMe, (err: Error, result: Buffer) => zlib.inflateRaw(result, (err: Error, result: Buffer) => result)); +zlib.deflateRaw(compressMe, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => zlib.inflateRaw(result, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => result)); +zlib.deflateRaw(compressMeString, (err: Error, result: Buffer) => zlib.inflateRaw(result, (err: Error, result: Buffer) => result)); +zlib.deflateRaw(compressMeString, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => zlib.inflateRaw(result, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => result)); +const inflatedRaw: Buffer = zlib.inflateRawSync(zlib.deflateRawSync(compressMe)); +const inflatedRawString: Buffer = zlib.inflateRawSync(zlib.deflateRawSync(compressMeString)); + +zlib.gzip(compressMe, (err: Error, result: Buffer) => zlib.gunzip(result, (err: Error, result: Buffer) => result)); +zlib.gzip(compressMe, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => zlib.gunzip(result, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => result)); +const gunzipped: Buffer = zlib.gunzipSync(zlib.gzipSync(compressMe)); + +zlib.unzip(compressMe, (err: Error, result: Buffer) => result); +zlib.unzip(compressMe, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => result); +const unzipped: Buffer = zlib.unzipSync(compressMe); + +// Simplified constructors +function simplified_stream_ctor_test() { + new stream.Readable({ + read(size) { + size.toFixed(); + }, + destroy(error) { + error.stack; + } + }); + + new stream.Writable({ + write(chunk, enc, cb) { + chunk.slice(1); + enc.charAt(0); + cb(); + }, + writev(chunks, cb) { + chunks[0].chunk.slice(0); + chunks[0].encoding.charAt(0); + cb(); + }, + destroy(error) { + error.stack; + }, + final(cb) { + cb(null); + } + }); + + new stream.Duplex({ + read(size) { + size.toFixed(); + }, + write(chunk, enc, cb) { + chunk.slice(1); + enc.charAt(0); + cb(); + }, + writev(chunks, cb) { + chunks[0].chunk.slice(0); + chunks[0].encoding.charAt(0); + cb(); + }, + readableObjectMode: true, + writableObjectMode: true + }); + + new stream.Transform({ + transform(chunk, enc, cb) { + chunk.slice(1); + enc.charAt(0); + cb(); + }, + flush(cb) { + cb(); + }, + read(size) { + size.toFixed(); + }, + write(chunk, enc, cb) { + chunk.slice(1); + enc.charAt(0); + cb(); + }, + writev(chunks, cb) { + chunks[0].chunk.slice(0); + chunks[0].encoding.charAt(0); + cb(); + }, + destroy(error) { + error.stack; + }, + allowHalfOpen: true, + readableObjectMode: true, + writableObjectMode: true + }); +} + +//////////////////////////////////////////////////////// +/// Crypto tests : http://nodejs.org/api/crypto.html /// +//////////////////////////////////////////////////////// + +namespace crypto_tests { + { + // crypto_hash_string_test + var hashResult: string = crypto.createHash('md5').update('world').digest('hex'); + } + + { + // crypto_hash_buffer_test + var hashResult: string = crypto.createHash('md5') + .update(new Buffer('world')).digest('hex'); + } + + { + // crypto_hash_dataview_test + var hashResult: string = crypto.createHash('md5') + .update(new DataView(new Buffer('world').buffer)).digest('hex'); + } + + { + // crypto_hmac_string_test + var hmacResult: string = crypto.createHmac('md5', 'hello').update('world').digest('hex'); + } + + { + // crypto_hmac_buffer_test + var hmacResult: string = crypto.createHmac('md5', 'hello') + .update(new Buffer('world')).digest('hex'); + } + + { + // crypto_hmac_dataview_test + var hmacResult: string = crypto.createHmac('md5', 'hello') + .update(new DataView(new Buffer('world').buffer)).digest('hex'); + } + + { + let hmac: crypto.Hmac; + (hmac = crypto.createHmac('md5', 'hello')).end('world', 'utf8', () => { + let hash: Buffer | string = hmac.read(); + }); + } + + { + // crypto_cipher_decipher_string_test + let key: Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]); + let clearText: string = "This is the clear text."; + let cipher: crypto.Cipher = crypto.createCipher("aes-128-ecb", key); + let cipherText: string = cipher.update(clearText, "utf8", "hex"); + cipherText += cipher.final("hex"); + + let decipher: crypto.Decipher = crypto.createDecipher("aes-128-ecb", key); + let clearText2: string = decipher.update(cipherText, "hex", "utf8"); + clearText2 += decipher.final("utf8"); + + assert.equal(clearText2, clearText); + } + + { + // crypto_cipher_decipher_buffer_test + let key: Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]); + let clearText: Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4]); + let cipher: crypto.Cipher = crypto.createCipher("aes-128-ecb", key); + let cipherBuffers: Buffer[] = []; + cipherBuffers.push(cipher.update(clearText)); + cipherBuffers.push(cipher.final()); + + let cipherText: Buffer = Buffer.concat(cipherBuffers); + + let decipher: crypto.Decipher = crypto.createDecipher("aes-128-ecb", key); + let decipherBuffers: Buffer[] = []; + decipherBuffers.push(decipher.update(cipherText)); + decipherBuffers.push(decipher.final()); + + let clearText2: Buffer = Buffer.concat(decipherBuffers); + + assert.deepEqual(clearText2, clearText); + } + + { + // crypto_cipher_decipher_dataview_test + let key: Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]); + let clearText: DataView = new DataView( + new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4]).buffer); + let cipher: crypto.Cipher = crypto.createCipher("aes-128-ecb", key); + let cipherBuffers: Buffer[] = []; + cipherBuffers.push(cipher.update(clearText)); + cipherBuffers.push(cipher.final()); + + let cipherText: DataView = new DataView(Buffer.concat(cipherBuffers).buffer); + + let decipher: crypto.Decipher = crypto.createDecipher("aes-128-ecb", key); + let decipherBuffers: Buffer[] = []; + decipherBuffers.push(decipher.update(cipherText)); + decipherBuffers.push(decipher.final()); + + let clearText2: Buffer = Buffer.concat(decipherBuffers); + + assert.deepEqual(clearText2, clearText); + } + + { + let buffer1: Buffer = new Buffer([1, 2, 3, 4, 5]); + let buffer2: Buffer = new Buffer([1, 2, 3, 4, 5]); + let buffer3: Buffer = new Buffer([5, 4, 3, 2, 1]); + + assert(crypto.timingSafeEqual(buffer1, buffer2)); + assert(!crypto.timingSafeEqual(buffer1, buffer3)); + } + + { + let buffer: Buffer = new Buffer(10); + crypto.randomFillSync(buffer); + crypto.randomFillSync(buffer, 2); + crypto.randomFillSync(buffer, 2, 3); + + crypto.randomFill(buffer, (err: Error, buf: Buffer) => void {}); + crypto.randomFill(buffer, 2, (err: Error, buf: Buffer) => void {}); + crypto.randomFill(buffer, 2, 3, (err: Error, buf: Buffer) => void {}); + + let arr: Uint8Array = new Uint8Array(10); + crypto.randomFillSync(arr); + crypto.randomFillSync(arr, 2); + crypto.randomFillSync(arr, 2, 3); + + crypto.randomFill(arr, (err: Error, buf: Uint8Array) => void {}); + crypto.randomFill(arr, 2, (err: Error, buf: Uint8Array) => void {}); + crypto.randomFill(arr, 2, 3, (err: Error, buf: Uint8Array) => void {}); + } +} + +////////////////////////////////////////////////// +/// TLS tests : http://nodejs.org/api/tls.html /// +////////////////////////////////////////////////// + +namespace tls_tests { + { + var ctx: tls.SecureContext = tls.createSecureContext({ + key: "NOT REALLY A KEY", + cert: "SOME CERTIFICATE", + }); + var blah = ctx.context; + + var connOpts: tls.ConnectionOptions = { + host: "127.0.0.1", + port: 55 + }; + var tlsSocket = tls.connect(connOpts); + + const ciphers: string[] = tls.getCiphers(); + const curve: string = tls.DEFAULT_ECDH_CURVE; + } + + { + let _server: tls.Server; + let _boolean: boolean; + let _func1 = (err: Error, resp: Buffer) => { }; + let _func2 = (err: Error, sessionData: any) => { }; + /** + * events.EventEmitter + * 1. tlsClientError + * 2. newSession + * 3. OCSPRequest + * 4. resumeSession + * 5. secureConnection + */ + + _server = _server.addListener("tlsClientError", (err, tlsSocket) => { + let _err: Error = err; + let _tlsSocket: tls.TLSSocket = tlsSocket; + }); + _server = _server.addListener("newSession", (sessionId, sessionData, callback) => { + let _sessionId: any = sessionId; + let _sessionData: any = sessionData; + let _func1 = callback; + }); + _server = _server.addListener("OCSPRequest", (certificate, issuer, callback) => { + let _certificate: Buffer = certificate; + let _issuer: Buffer = issuer; + let _callback: Function = callback; + }); + _server = _server.addListener("resumeSession", (sessionId, callback) => { + let _sessionId: any = sessionId; + let _func2 = callback; + }); + _server = _server.addListener("secureConnection", (tlsSocket) => { + let _tlsSocket: tls.TLSSocket = tlsSocket; + }); + + let _err: Error; + let _tlsSocket: tls.TLSSocket; + let _any: any; + let _func: Function; + let _buffer: Buffer; + _boolean = _server.emit("tlsClientError", _err, _tlsSocket); + _boolean = _server.emit("newSession", _any, _any, _func1); + _boolean = _server.emit("OCSPRequest", _buffer, _buffer, _func); + _boolean = _server.emit("resumeSession", _any, _func2); + _boolean = _server.emit("secureConnection", _tlsSocket); + + _server = _server.on("tlsClientError", (err, tlsSocket) => { + let _err: Error = err; + let _tlsSocket: tls.TLSSocket = tlsSocket; + }); + _server = _server.on("newSession", (sessionId, sessionData, callback) => { + let _sessionId: any = sessionId; + let _sessionData: any = sessionData; + let _func1 = callback; + }); + _server = _server.on("OCSPRequest", (certificate, issuer, callback) => { + let _certificate: Buffer = certificate; + let _issuer: Buffer = issuer; + let _callback: Function = callback; + }); + _server = _server.on("resumeSession", (sessionId, callback) => { + let _sessionId: any = sessionId; + let _func2 = callback; + }); + _server = _server.on("secureConnection", (tlsSocket) => { + let _tlsSocket: tls.TLSSocket = tlsSocket; + }); + + _server = _server.once("tlsClientError", (err, tlsSocket) => { + let _err: Error = err; + let _tlsSocket: tls.TLSSocket = tlsSocket; + }); + _server = _server.once("newSession", (sessionId, sessionData, callback) => { + let _sessionId: any = sessionId; + let _sessionData: any = sessionData; + let _func1 = callback; + }); + _server = _server.once("OCSPRequest", (certificate, issuer, callback) => { + let _certificate: Buffer = certificate; + let _issuer: Buffer = issuer; + let _callback: Function = callback; + }); + _server = _server.once("resumeSession", (sessionId, callback) => { + let _sessionId: any = sessionId; + let _func2 = callback; + }); + _server = _server.once("secureConnection", (tlsSocket) => { + let _tlsSocket: tls.TLSSocket = tlsSocket; + }); + + _server = _server.prependListener("tlsClientError", (err, tlsSocket) => { + let _err: Error = err; + let _tlsSocket: tls.TLSSocket = tlsSocket; + }); + _server = _server.prependListener("newSession", (sessionId, sessionData, callback) => { + let _sessionId: any = sessionId; + let _sessionData: any = sessionData; + let _func1 = callback; + }); + _server = _server.prependListener("OCSPRequest", (certificate, issuer, callback) => { + let _certificate: Buffer = certificate; + let _issuer: Buffer = issuer; + let _callback: Function = callback; + }); + _server = _server.prependListener("resumeSession", (sessionId, callback) => { + let _sessionId: any = sessionId; + let _func2 = callback; + }); + _server = _server.prependListener("secureConnection", (tlsSocket) => { + let _tlsSocket: tls.TLSSocket = tlsSocket; + }); + + _server = _server.prependOnceListener("tlsClientError", (err, tlsSocket) => { + let _err: Error = err; + let _tlsSocket: tls.TLSSocket = tlsSocket; + }); + _server = _server.prependOnceListener("newSession", (sessionId, sessionData, callback) => { + let _sessionId: any = sessionId; + let _sessionData: any = sessionData; + let _func1 = callback; + }); + _server = _server.prependOnceListener("OCSPRequest", (certificate, issuer, callback) => { + let _certificate: Buffer = certificate; + let _issuer: Buffer = issuer; + let _callback: Function = callback; + }); + _server = _server.prependOnceListener("resumeSession", (sessionId, callback) => { + let _sessionId: any = sessionId; + let _func2 = callback; + }); + _server = _server.prependOnceListener("secureConnection", (tlsSocket) => { + let _tlsSocket: tls.TLSSocket = tlsSocket; + }); + + // close callback parameter is optional + _server = _server.close(); + + // close callback parameter doesn't specify any arguments, so any + // function is acceptable + _server = _server.close(() => { }); + _server = _server.close((...args: any[]) => { }); + } + + { + let _TLSSocket: tls.TLSSocket; + let _boolean: boolean; + /** + * events.EventEmitter + * 1. close + * 2. error + * 3. listening + * 4. message + */ + + _TLSSocket = _TLSSocket.addListener("OCSPResponse", (response) => { + let _response: Buffer = response; + }); + _TLSSocket = _TLSSocket.addListener("secureConnect", () => { }); + + let _buffer: Buffer; + _boolean = _TLSSocket.emit("OCSPResponse", _buffer); + _boolean = _TLSSocket.emit("secureConnect"); + + _TLSSocket = _TLSSocket.on("OCSPResponse", (response) => { + let _response: Buffer = response; + }); + _TLSSocket = _TLSSocket.on("secureConnect", () => { }); + + _TLSSocket = _TLSSocket.once("OCSPResponse", (response) => { + let _response: Buffer = response; + }); + _TLSSocket = _TLSSocket.once("secureConnect", () => { }); + + _TLSSocket = _TLSSocket.prependListener("OCSPResponse", (response) => { + let _response: Buffer = response; + }); + _TLSSocket = _TLSSocket.prependListener("secureConnect", () => { }); + + _TLSSocket = _TLSSocket.prependOnceListener("OCSPResponse", (response) => { + let _response: Buffer = response; + }); + _TLSSocket = _TLSSocket.prependOnceListener("secureConnect", () => { }); + } +} + +//////////////////////////////////////////////////// +/// Http tests : http://nodejs.org/api/http.html /// +//////////////////////////////////////////////////// + +namespace http_tests { + // http Server + { + var server: http.Server = new http.Server(); + + // test public props + const maxHeadersCount: number = server.maxHeadersCount; + const timeout: number = server.timeout; + const listening: boolean = server.listening; + const keepAliveTimeout: number = server.keepAliveTimeout; + server.setTimeout().setTimeout(1000).setTimeout(() => {}).setTimeout(100, () => {}); + } + + // http IncomingMessage + // http ServerResponse + { + // incoming + var incoming: http.IncomingMessage = new http.IncomingMessage(new net.Socket()); + + incoming.setEncoding('utf8'); + + // stream + incoming.pause(); + incoming.resume(); + + // response + var res: http.ServerResponse = new http.ServerResponse(incoming); + + // test headers + res.setHeader('Content-Type', 'text/plain'); + var bool: boolean = res.hasHeader('Content-Type'); + var headers: string[] = res.getHeaderNames(); + + // trailers + res.addTrailers([ + ['x-fOo', 'xOxOxOx'], + ['x-foO', 'OxOxOxO'], + ['X-fOo', 'xOxOxOx'], + ['X-foO', 'OxOxOxO'] + ]); + res.addTrailers({ 'x-foo': 'bar' }); + + // writeHead + res.writeHead(200, 'OK\r\nContent-Type: text/html\r\n'); + res.writeHead(200, { 'Transfer-Encoding': 'chunked' }); + res.writeHead(200); + + // write string + res.write('Part of my res.'); + // write buffer + const chunk = Buffer.alloc(16390, 'Й'); + req.write(chunk); + res.write(chunk, 'hex'); + + // end + res.end("end msg"); + // without msg + res.end(); + + // flush + res.flushHeaders(); + } + + // http ClientRequest + { + var req: http.ClientRequest = new http.ClientRequest("https://www.google.com"); + var req: http.ClientRequest = new http.ClientRequest(new url.URL("https://www.google.com")); + var req: http.ClientRequest = new http.ClientRequest({ path: 'http://0.0.0.0' }); + + // header + req.setHeader('Content-Type', 'text/plain'); + var bool: boolean = req.hasHeader('Content-Type'); + var headers: string[] = req.getHeaderNames(); + req.removeHeader('Date'); + + // write + const chunk = Buffer.alloc(16390, 'Й'); + req.write(chunk); + req.write('a'); + req.end(); + + // abort + req.abort(); + + // connection + req.connection.on('pause', () => { }); + + // event + req.on('data', () => { }); + } + + { + // Status codes + var codeMessage = http.STATUS_CODES['400']; + var codeMessage = http.STATUS_CODES[400]; + } + + { + var agent: http.Agent = new http.Agent({ + keepAlive: true, + keepAliveMsecs: 10000, + maxSockets: Infinity, + maxFreeSockets: 256 + }); + + var agent: http.Agent = http.globalAgent; + + http.request({ agent: false }); + http.request({ agent }); + http.request({ agent: undefined }); + } + + { + http.request('http://www.example.com/xyz'); + } + + { + // Make sure .listen() and .close() return a Server instance + http.createServer().listen(0).close().address(); + net.createServer().listen(0).close().address(); + } + + { + var request = http.request({ path: 'http://0.0.0.0' }); + request.once('error', () => { }); + request.setNoDelay(true); + request.abort(); + } + + // http request options + { + const requestOpts: http.RequestOptions = { + timeout: 30000 + }; + + const clientArgs: http.ClientRequestArgs = { + timeout: 30000 + }; + } + + // http headers + { + const headers: http.IncomingHttpHeaders = { + 'content-type': 'application/json', + 'set-cookie': [ 'type=ninja', 'language=javascript' ] + }; + } +} + +////////////////////////////////////////////////////// +/// Https tests : http://nodejs.org/api/https.html /// +////////////////////////////////////////////////////// + +namespace https_tests { + var agent: https.Agent = new https.Agent({ + keepAlive: true, + keepAliveMsecs: 10000, + maxSockets: Infinity, + maxFreeSockets: 256, + maxCachedSessions: 100 + }); + + var agent: https.Agent = https.globalAgent; + + https.request({ + agent: false + }); + https.request({ + agent + }); + https.request({ + agent: undefined + }); + + https.request('http://www.example.com/xyz'); + + https.globalAgent.options.ca = []; + + { + const server = new https.Server(); + + const timeout: number = server.timeout; + const listening: boolean = server.listening; + const keepAliveTimeout: number = server.keepAliveTimeout; + server.setTimeout().setTimeout(1000).setTimeout(() => {}).setTimeout(100, () => {}); + } +} + +//////////////////////////////////////////////////// +/// TTY tests : http://nodejs.org/api/tty.html +//////////////////////////////////////////////////// + +namespace tty_tests { + let rs: tty.ReadStream; + let ws: tty.WriteStream; + + let rsIsRaw: boolean = rs.isRaw; + rs.setRawMode(true); + + let wsColumns: number = ws.columns; + let wsRows: number = ws.rows; + + let isTTY: boolean = tty.isatty(1); +} + +//////////////////////////////////////////////////// +/// Dgram tests : http://nodejs.org/api/dgram.html +//////////////////////////////////////////////////// + +namespace dgram_tests { + { + var ds: dgram.Socket = dgram.createSocket("udp4", (msg: Buffer, rinfo: dgram.RemoteInfo): void => { + }); + ds.bind(); + ds.bind(41234); + ds.bind(4123, 'localhost'); + ds.bind(4123, 'localhost', () => { }); + ds.bind(4123, () => { }); + ds.bind(() => { }); + var ai: dgram.AddressInfo = ds.address(); + ds.send(new Buffer("hello"), 0, 5, 5000, "127.0.0.1", (error: Error, bytes: number): void => { + }); + ds.send(new Buffer("hello"), 5000, "127.0.0.1"); + ds.setMulticastInterface("127.0.0.1"); + ds = dgram.createSocket({ type: "udp4", reuseAddr: true, recvBufferSize: 1000, sendBufferSize: 1000, lookup: dns.lookup }); + } + + { + let _socket: dgram.Socket; + let _boolean: boolean; + let _err: Error; + let _str: string; + let _rinfo: dgram.AddressInfo; + /** + * events.EventEmitter + * 1. close + * 2. error + * 3. listening + * 4. message + */ + + _socket = _socket.addListener("close", () => { }); + _socket = _socket.addListener("error", (err) => { + let _err: Error = err; + }); + _socket = _socket.addListener("listening", () => { }); + _socket = _socket.addListener("message", (msg, rinfo) => { + let _msg: Buffer = msg; + let _rinfo: dgram.AddressInfo = rinfo; + }); + + _boolean = _socket.emit("close"); + _boolean = _socket.emit("error", _err); + _boolean = _socket.emit("listening"); + _boolean = _socket.emit("message", _str, _rinfo); + + _socket = _socket.on("close", () => { }); + _socket = _socket.on("error", (err) => { + let _err: Error = err; + }); + _socket = _socket.on("listening", () => { }); + _socket = _socket.on("message", (msg, rinfo) => { + let _msg: Buffer = msg; + let _rinfo: dgram.AddressInfo = rinfo; + }); + + _socket = _socket.once("close", () => { }); + _socket = _socket.once("error", (err) => { + let _err: Error = err; + }); + _socket = _socket.once("listening", () => { }); + _socket = _socket.once("message", (msg, rinfo) => { + let _msg: Buffer = msg; + let _rinfo: dgram.AddressInfo = rinfo; + }); + + _socket = _socket.prependListener("close", () => { }); + _socket = _socket.prependListener("error", (err) => { + let _err: Error = err; + }); + _socket = _socket.prependListener("listening", () => { }); + _socket = _socket.prependListener("message", (msg, rinfo) => { + let _msg: Buffer = msg; + let _rinfo: dgram.AddressInfo = rinfo; + }); + + _socket = _socket.prependOnceListener("close", () => { }); + _socket = _socket.prependOnceListener("error", (err) => { + let _err: Error = err; + }); + _socket = _socket.prependOnceListener("listening", () => { }); + _socket = _socket.prependOnceListener("message", (msg, rinfo) => { + let _msg: Buffer = msg; + let _rinfo: dgram.AddressInfo = rinfo; + }); + } + + { + let ds: dgram.Socket = dgram.createSocket({ + type: 'udp4', + recvBufferSize: 10000, + sendBufferSize: 15000 + }); + + let size: number; + size = ds.getRecvBufferSize(); + ds.setRecvBufferSize(size); + size = ds.getSendBufferSize(); + ds.setSendBufferSize(size); + } +} + +//////////////////////////////////////////////////// +/// Querystring tests : https://nodejs.org/api/querystring.html +//////////////////////////////////////////////////// + +namespace querystring_tests { + interface SampleObject { a: string; b: number; } + + { + let obj: SampleObject; + let sep: string; + let eq: string; + let options: querystring.StringifyOptions; + let result: string; + + result = querystring.stringify(obj); + result = querystring.stringify(obj, sep); + result = querystring.stringify(obj, sep, eq); + result = querystring.stringify(obj, sep, eq); + result = querystring.stringify(obj, sep, eq, options); + } + + { + let str: string; + let sep: string; + let eq: string; + let options: querystring.ParseOptions; + let result: SampleObject; + + result = querystring.parse(str); + result = querystring.parse(str, sep); + result = querystring.parse(str, sep, eq); + result = querystring.parse(str, sep, eq, options); + } + + { + let str: string; + let result: string; + + result = querystring.escape(str); + result = querystring.unescape(str); + } +} + +//////////////////////////////////////////////////// +/// path tests : http://nodejs.org/api/path.html +//////////////////////////////////////////////////// + +namespace path_tests { + path.normalize('/foo/bar//baz/asdf/quux/..'); + + path.join('/foo', 'bar', 'baz/asdf', 'quux', '..'); + // returns + // '/foo/bar/baz/asdf' + + try { + path.join('foo', 'bar'); + } catch (error) { } + + path.resolve('foo/bar', '/tmp/file/', '..', 'a/../subfile'); + // Is similar to: + // + // cd foo/bar + // cd /tmp/file/ + // cd .. + // cd a/../subfile + // pwd + + path.resolve('/foo/bar', './baz'); + // returns + // '/foo/bar/baz' + + path.resolve('/foo/bar', '/tmp/file/'); + // returns + // '/tmp/file' + + path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif'); + // if currently in /home/myself/node, it returns + // '/home/myself/node/wwwroot/static_files/gif/image.gif' + + path.isAbsolute('/foo/bar'); // true + path.isAbsolute('/baz/..'); // true + path.isAbsolute('qux/'); // false + path.isAbsolute('.'); // false + + path.isAbsolute('//server'); // true + path.isAbsolute('C:/foo/..'); // true + path.isAbsolute('bar\\baz'); // false + path.isAbsolute('.'); // false + + path.relative('C:\\orandea\\test\\aaa', 'C:\\orandea\\impl\\bbb'); + // returns + // '..\\..\\impl\\bbb' + + path.relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb'); + // returns + // '../../impl/bbb' + + path.dirname('/foo/bar/baz/asdf/quux'); + // returns + // '/foo/bar/baz/asdf' + + path.basename('/foo/bar/baz/asdf/quux.html'); + // returns + // 'quux.html' + + path.basename('/foo/bar/baz/asdf/quux.html', '.html'); + // returns + // 'quux' + + path.extname('index.html'); + // returns + // '.html' + + path.extname('index.coffee.md'); + // returns + // '.md' + + path.extname('index.'); + // returns + // '.' + + path.extname('index'); + // returns + // '' + + 'foo/bar/baz'.split(path.sep); + // returns + // ['foo', 'bar', 'baz'] + + 'foo\\bar\\baz'.split(path.sep); + // returns + // ['foo', 'bar', 'baz'] + + process.env["PATH"]; // $ExpectType string + + path.parse('/home/user/dir/file.txt'); + // returns + // { + // root : "/", + // dir : "/home/user/dir", + // base : "file.txt", + // ext : ".txt", + // name : "file" + // } + + path.parse('C:\\path\\dir\\index.html'); + // returns + // { + // root : "C:\", + // dir : "C:\path\dir", + // base : "index.html", + // ext : ".html", + // name : "index" + // } + + path.format({ + root: "/", + dir: "/home/user/dir", + base: "file.txt", + ext: ".txt", + name: "file" + }); + // returns + // '/home/user/dir/file.txt' + + path.format({ + root: "/", + dir: "/home/user/dir", + ext: ".txt", + name: "file" + }); + // returns + // '/home/user/dir/file.txt' + + path.format({ + dir: "/home/user/dir", + base: "file.txt" + }); + // returns + // '/home/user/dir/file.txt' + + path.posix.format({ + root: "/", + dir: "/home/user/dir", + base: "file.txt", + ext: ".txt", + name: "file" + }); + // returns + // '/home/user/dir/file.txt' + + path.posix.format({ + dir: "/home/user/dir", + base: "file.txt" + }); + // returns + // '/home/user/dir/file.txt' + + path.win32.format({ + root: "C:\\", + dir: "C:\\home\\user\\dir", + ext: ".txt", + name: "file" + }); + // returns + // 'C:\home\user\dir\file.txt' + + path.win32.format({ + dir: "C:\\home\\user\\dir", + base: "file.txt" + }); + // returns + // 'C:\home\user\dir\file.txt' +} + +//////////////////////////////////////////////////// +/// readline tests : https://nodejs.org/api/readline.html +//////////////////////////////////////////////////// + +namespace readline_tests { + let rl: readline.ReadLine; + + { + let options: readline.ReadLineOptions; + let input: NodeJS.ReadableStream; + let output: NodeJS.WritableStream; + let completer: readline.Completer; + let terminal: boolean; + + let result: readline.ReadLine; + + result = readline.createInterface(options); + result = readline.createInterface(input); + result = readline.createInterface(input, output); + result = readline.createInterface(input, output, completer); + result = readline.createInterface(input, output, completer, terminal); + result = readline.createInterface({ + input, + completer(str: string): readline.CompleterResult { + return [['test'], 'test']; + } + }); + result = readline.createInterface({ + input, + completer(str: string, callback: (err: any, result: readline.CompleterResult) => void): any { + callback(null, [['test'], 'test']); + } + }); + } + + { + let prompt: string; + + rl.setPrompt(prompt); + } + + { + let preserveCursor: boolean; + + rl.prompt(); + rl.prompt(preserveCursor); + } + + { + let query: string; + let callback: (answer: string) => void; + + rl.question(query, callback); + } + + { + let result: readline.ReadLine; + + result = rl.pause(); + } + + { + let result: readline.ReadLine; + + result = rl.resume(); + } + + { + rl.close(); + } + + { + let data: string | Buffer; + let key: readline.Key; + + rl.write(data); + rl.write(null, key); + } + + { + let stream: NodeJS.WritableStream; + let x: number; + let y: number; + + readline.cursorTo(stream, x); + readline.cursorTo(stream, x, y); + } + + { + let stream: NodeJS.ReadableStream; + let readLineInterface: readline.ReadLine; + + readline.emitKeypressEvents(stream); + readline.emitKeypressEvents(stream, readLineInterface); + } + + { + let stream: NodeJS.WritableStream; + let dx: number | string; + let dy: number | string; + + readline.moveCursor(stream, dx, dy); + } + + { + let stream: NodeJS.WritableStream; + let dir: number; + + readline.clearLine(stream, dir); + } + + { + let stream: NodeJS.WritableStream; + + readline.clearScreenDown(stream); + } + + { + let _rl: readline.ReadLine; + let _boolean: boolean; + + _rl = _rl.addListener("close", () => { }); + _rl = _rl.addListener("line", (input) => { + let _input: any = input; + }); + _rl = _rl.addListener("pause", () => { }); + _rl = _rl.addListener("resume", () => { }); + _rl = _rl.addListener("SIGCONT", () => { }); + _rl = _rl.addListener("SIGINT", () => { }); + _rl = _rl.addListener("SIGTSTP", () => { }); + + _boolean = _rl.emit("close", () => { }); + _boolean = _rl.emit("line", () => { }); + _boolean = _rl.emit("pause", () => { }); + _boolean = _rl.emit("resume", () => { }); + _boolean = _rl.emit("SIGCONT", () => { }); + _boolean = _rl.emit("SIGINT", () => { }); + _boolean = _rl.emit("SIGTSTP", () => { }); + + _rl = _rl.on("close", () => { }); + _rl = _rl.on("line", (input) => { + let _input: any = input; + }); + _rl = _rl.on("pause", () => { }); + _rl = _rl.on("resume", () => { }); + _rl = _rl.on("SIGCONT", () => { }); + _rl = _rl.on("SIGINT", () => { }); + _rl = _rl.on("SIGTSTP", () => { }); + + _rl = _rl.once("close", () => { }); + _rl = _rl.once("line", (input) => { + let _input: any = input; + }); + _rl = _rl.once("pause", () => { }); + _rl = _rl.once("resume", () => { }); + _rl = _rl.once("SIGCONT", () => { }); + _rl = _rl.once("SIGINT", () => { }); + _rl = _rl.once("SIGTSTP", () => { }); + + _rl = _rl.prependListener("close", () => { }); + _rl = _rl.prependListener("line", (input) => { + let _input: any = input; + }); + _rl = _rl.prependListener("pause", () => { }); + _rl = _rl.prependListener("resume", () => { }); + _rl = _rl.prependListener("SIGCONT", () => { }); + _rl = _rl.prependListener("SIGINT", () => { }); + _rl = _rl.prependListener("SIGTSTP", () => { }); + + _rl = _rl.prependOnceListener("close", () => { }); + _rl = _rl.prependOnceListener("line", (input) => { + let _input: any = input; + }); + _rl = _rl.prependOnceListener("pause", () => { }); + _rl = _rl.prependOnceListener("resume", () => { }); + _rl = _rl.prependOnceListener("SIGCONT", () => { }); + _rl = _rl.prependOnceListener("SIGINT", () => { }); + _rl = _rl.prependOnceListener("SIGTSTP", () => { }); + } +} + +//////////////////////////////////////////////////// +/// string_decoder tests : https://nodejs.org/api/string_decoder.html +//////////////////////////////////////////////////// + +namespace string_decoder_tests { + const StringDecoder = string_decoder.StringDecoder; + const buffer = new Buffer('test'); + const decoder1 = new StringDecoder(); + const decoder2 = new StringDecoder('utf8'); + const part1: string = decoder1.write(new Buffer('test')); + const end1: string = decoder1.end(); + const part2: string = decoder2.write(new Buffer('test')); + const end2: string = decoder1.end(new Buffer('test')); +} + +////////////////////////////////////////////////////////////////////// +/// Child Process tests: https://nodejs.org/api/child_process.html /// +////////////////////////////////////////////////////////////////////// + +namespace child_process_tests { + { + childProcess.exec("echo test"); + childProcess.exec("echo test", { windowsHide: true }); + childProcess.spawn("echo", ["test"], { windowsHide: true }); + childProcess.spawnSync("echo test"); + childProcess.spawnSync("echo test", {windowsVerbatimArguments: false}); + } + + { + childProcess.execFile("npm", () => {}); + childProcess.execFile("npm", { windowsHide: true }, () => {}); + childProcess.execFile("npm", ["-v"], () => {}); + childProcess.execFile("npm", ["-v"], { windowsHide: true, encoding: 'utf-8' }, (stdout, stderr) => { assert(stdout instanceof String); }); + childProcess.execFile("npm", ["-v"], { windowsHide: true, encoding: 'buffer' }, (stdout, stderr) => { assert(stdout instanceof Buffer); }); + childProcess.execFile("npm", { encoding: 'utf-8' }, (stdout, stderr) => { assert(stdout instanceof String); }); + childProcess.execFile("npm", { encoding: 'buffer' }, (stdout, stderr) => { assert(stdout instanceof Buffer); }); + } + + async function testPromisify() { + const execFile = util.promisify(childProcess.execFile); + let r: { stdout: string | Buffer, stderr: string | Buffer } = await execFile("npm"); + r = await execFile("npm", ["-v"]); + r = await execFile("npm", ["-v"], { encoding: 'utf-8' }); + r = await execFile("npm", ["-v"], { encoding: 'buffer' }); + r = await execFile("npm", { encoding: 'utf-8' }); + r = await execFile("npm", { encoding: 'buffer' }); + } + + { + let _cp: childProcess.ChildProcess; + let _socket: net.Socket; + let _server: net.Server; + let _boolean: boolean; + + _boolean = _cp.send(1); + _boolean = _cp.send('one'); + _boolean = _cp.send({ + type: 'test' + }); + + _boolean = _cp.send(1, (error) => { + let _err: Error = error; + }); + _boolean = _cp.send('one', (error) => { + let _err: Error = error; + }); + _boolean = _cp.send({ + type: 'test' + }, (error) => { + let _err: Error = error; + }); + + _boolean = _cp.send(1, _socket); + _boolean = _cp.send('one', _socket); + _boolean = _cp.send({ + type: 'test' + }, _socket); + + _boolean = _cp.send(1, _socket, (error) => { + let _err: Error = error; + }); + _boolean = _cp.send('one', _socket, (error) => { + let _err: Error = error; + }); + _boolean = _cp.send({ + type: 'test' + }, _socket, (error) => { + let _err: Error = error; + }); + + _boolean = _cp.send(1, _socket, { + keepOpen: true + }); + _boolean = _cp.send('one', _socket, { + keepOpen: true + }); + _boolean = _cp.send({ + type: 'test' + }, _socket, { + keepOpen: true + }); + + _boolean = _cp.send(1, _socket, { + keepOpen: true + }, (error) => { + let _err: Error = error; + }); + _boolean = _cp.send('one', _socket, { + keepOpen: true + }, (error) => { + let _err: Error = error; + }); + _boolean = _cp.send({ + type: 'test' + }, _socket, { + keepOpen: true + }, (error) => { + let _err: Error = error; + }); + + _boolean = _cp.send(1, _server); + _boolean = _cp.send('one', _server); + _boolean = _cp.send({ + type: 'test' + }, _server); + + _boolean = _cp.send(1, _server, (error) => { + let _err: Error = error; + }); + _boolean = _cp.send('one', _server, (error) => { + let _err: Error = error; + }); + _boolean = _cp.send({ + type: 'test' + }, _server, (error) => { + let _err: Error = error; + }); + + _boolean = _cp.send(1, _server, { + keepOpen: true + }); + _boolean = _cp.send('one', _server, { + keepOpen: true + }); + _boolean = _cp.send({ + type: 'test' + }, _server, { + keepOpen: true + }); + + _boolean = _cp.send(1, _server, { + keepOpen: true + }, (error) => { + let _err: Error = error; + }); + _boolean = _cp.send('one', _server, { + keepOpen: true + }, (error) => { + let _err: Error = error; + }); + _boolean = _cp.send({ + type: 'test' + }, _server, { + keepOpen: true + }, (error) => { + let _err: Error = error; + }); + + _cp = _cp.addListener("close", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }); + _cp = _cp.addListener("disconnect", () => { }); + _cp = _cp.addListener("error", (err) => { + let _err: Error = err; + }); + _cp = _cp.addListener("exit", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }); + _cp = _cp.addListener("message", (message, sendHandle) => { + let _message: any = message; + let _sendHandle: net.Socket | net.Server = sendHandle; + }); + + _boolean = _cp.emit("close", () => { }); + _boolean = _cp.emit("disconnect", () => { }); + _boolean = _cp.emit("error", () => { }); + _boolean = _cp.emit("exit", () => { }); + _boolean = _cp.emit("message", () => { }); + + _cp = _cp.on("close", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }); + _cp = _cp.on("disconnect", () => { }); + _cp = _cp.on("error", (err) => { + let _err: Error = err; + }); + _cp = _cp.on("exit", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }); + _cp = _cp.on("message", (message, sendHandle) => { + let _message: any = message; + let _sendHandle: net.Socket | net.Server = sendHandle; + }); + + _cp = _cp.once("close", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }); + _cp = _cp.once("disconnect", () => { }); + _cp = _cp.once("error", (err) => { + let _err: Error = err; + }); + _cp = _cp.once("exit", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }); + _cp = _cp.once("message", (message, sendHandle) => { + let _message: any = message; + let _sendHandle: net.Socket | net.Server = sendHandle; + }); + + _cp = _cp.prependListener("close", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }); + _cp = _cp.prependListener("disconnect", () => { }); + _cp = _cp.prependListener("error", (err) => { + let _err: Error = err; + }); + _cp = _cp.prependListener("exit", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }); + _cp = _cp.prependListener("message", (message, sendHandle) => { + let _message: any = message; + let _sendHandle: net.Socket | net.Server = sendHandle; + }); + + _cp = _cp.prependOnceListener("close", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }); + _cp = _cp.prependOnceListener("disconnect", () => { }); + _cp = _cp.prependOnceListener("error", (err) => { + let _err: Error = err; + }); + _cp = _cp.prependOnceListener("exit", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }); + _cp = _cp.prependOnceListener("message", (message, sendHandle) => { + let _message: any = message; + let _sendHandle: net.Socket | net.Server = sendHandle; + }); + } + { + process.stdin.setEncoding('utf8'); + + process.stdin.on('readable', () => { + const chunk = process.stdin.read(); + if (chunk !== null) { + process.stdout.write(`data: ${chunk}`); + } + }); + + process.stdin.on('end', () => { + process.stdout.write('end'); + }); + + process.stdin.pipe(process.stdout); + + console.log(process.stdin.isTTY); + console.log(process.stdout.isTTY); + + console.log(process.stdin instanceof net.Socket); + console.log(process.stdout instanceof fs.ReadStream); + + var stdin: stream.Readable = process.stdin; + console.log(stdin instanceof net.Socket); + console.log(stdin instanceof fs.ReadStream); + + var stdout: stream.Writable = process.stdout; + console.log(stdout instanceof net.Socket); + console.log(stdout instanceof fs.WriteStream); + } +} + +////////////////////////////////////////////////////////////////////// +/// cluster tests: https://nodejs.org/api/cluster.html /// +////////////////////////////////////////////////////////////////////// + +namespace cluster_tests { + { + cluster.fork(); + Object.keys(cluster.workers).forEach(key => { + const worker = cluster.workers[key]; + if (worker.isDead()) { + console.log('worker %d is dead', worker.process.pid); + } + }); + } +} + +//////////////////////////////////////////////////// +/// os tests : https://nodejs.org/api/os.html +//////////////////////////////////////////////////// + +namespace os_tests { + { + let result: string; + + result = os.tmpdir(); + result = os.homedir(); + result = os.endianness(); + result = os.hostname(); + result = os.type(); + 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(); + } + + { + let result: number; + + result = os.constants.signals.SIGHUP; + result = os.constants.signals.SIGINT; + result = os.constants.signals.SIGQUIT; + result = os.constants.signals.SIGILL; + result = os.constants.signals.SIGTRAP; + result = os.constants.signals.SIGABRT; + result = os.constants.signals.SIGIOT; + result = os.constants.signals.SIGBUS; + result = os.constants.signals.SIGFPE; + result = os.constants.signals.SIGKILL; + result = os.constants.signals.SIGUSR1; + result = os.constants.signals.SIGSEGV; + result = os.constants.signals.SIGUSR2; + result = os.constants.signals.SIGPIPE; + result = os.constants.signals.SIGALRM; + result = os.constants.signals.SIGTERM; + result = os.constants.signals.SIGCHLD; + result = os.constants.signals.SIGSTKFLT; + result = os.constants.signals.SIGCONT; + result = os.constants.signals.SIGSTOP; + result = os.constants.signals.SIGTSTP; + result = os.constants.signals.SIGTTIN; + result = os.constants.signals.SIGTTOU; + result = os.constants.signals.SIGURG; + result = os.constants.signals.SIGXCPU; + result = os.constants.signals.SIGXFSZ; + result = os.constants.signals.SIGVTALRM; + result = os.constants.signals.SIGPROF; + result = os.constants.signals.SIGWINCH; + result = os.constants.signals.SIGIO; + result = os.constants.signals.SIGPOLL; + result = os.constants.signals.SIGPWR; + result = os.constants.signals.SIGSYS; + result = os.constants.signals.SIGUNUSED; + } + + { + let result: number; + + result = os.constants.errno.E2BIG; + result = os.constants.errno.EACCES; + result = os.constants.errno.EADDRINUSE; + result = os.constants.errno.EADDRNOTAVAIL; + result = os.constants.errno.EAFNOSUPPORT; + result = os.constants.errno.EAGAIN; + result = os.constants.errno.EALREADY; + result = os.constants.errno.EBADF; + result = os.constants.errno.EBADMSG; + result = os.constants.errno.EBUSY; + result = os.constants.errno.ECANCELED; + result = os.constants.errno.ECHILD; + result = os.constants.errno.ECONNABORTED; + result = os.constants.errno.ECONNREFUSED; + result = os.constants.errno.ECONNRESET; + result = os.constants.errno.EDEADLK; + result = os.constants.errno.EDESTADDRREQ; + result = os.constants.errno.EDOM; + result = os.constants.errno.EDQUOT; + result = os.constants.errno.EEXIST; + result = os.constants.errno.EFAULT; + result = os.constants.errno.EFBIG; + result = os.constants.errno.EHOSTUNREACH; + result = os.constants.errno.EIDRM; + result = os.constants.errno.EILSEQ; + result = os.constants.errno.EINPROGRESS; + result = os.constants.errno.EINTR; + result = os.constants.errno.EINVAL; + result = os.constants.errno.EIO; + result = os.constants.errno.EISCONN; + result = os.constants.errno.EISDIR; + result = os.constants.errno.ELOOP; + result = os.constants.errno.EMFILE; + result = os.constants.errno.EMLINK; + result = os.constants.errno.EMSGSIZE; + result = os.constants.errno.EMULTIHOP; + result = os.constants.errno.ENAMETOOLONG; + result = os.constants.errno.ENETDOWN; + result = os.constants.errno.ENETRESET; + result = os.constants.errno.ENETUNREACH; + result = os.constants.errno.ENFILE; + result = os.constants.errno.ENOBUFS; + result = os.constants.errno.ENODATA; + result = os.constants.errno.ENODEV; + result = os.constants.errno.ENOENT; + result = os.constants.errno.ENOEXEC; + result = os.constants.errno.ENOLCK; + result = os.constants.errno.ENOLINK; + result = os.constants.errno.ENOMEM; + result = os.constants.errno.ENOMSG; + result = os.constants.errno.ENOPROTOOPT; + result = os.constants.errno.ENOSPC; + result = os.constants.errno.ENOSR; + result = os.constants.errno.ENOSTR; + result = os.constants.errno.ENOSYS; + result = os.constants.errno.ENOTCONN; + result = os.constants.errno.ENOTDIR; + result = os.constants.errno.ENOTEMPTY; + result = os.constants.errno.ENOTSOCK; + result = os.constants.errno.ENOTSUP; + result = os.constants.errno.ENOTTY; + result = os.constants.errno.ENXIO; + result = os.constants.errno.EOPNOTSUPP; + result = os.constants.errno.EOVERFLOW; + result = os.constants.errno.EPERM; + result = os.constants.errno.EPIPE; + result = os.constants.errno.EPROTO; + result = os.constants.errno.EPROTONOSUPPORT; + result = os.constants.errno.EPROTOTYPE; + result = os.constants.errno.ERANGE; + result = os.constants.errno.EROFS; + result = os.constants.errno.ESPIPE; + result = os.constants.errno.ESRCH; + result = os.constants.errno.ESTALE; + result = os.constants.errno.ETIME; + result = os.constants.errno.ETIMEDOUT; + result = os.constants.errno.ETXTBSY; + result = os.constants.errno.EWOULDBLOCK; + result = os.constants.errno.EXDEV; + } +} + +//////////////////////////////////////////////////// +/// vm tests : https://nodejs.org/api/vm.html +//////////////////////////////////////////////////// + +namespace vm_tests { + { + const sandbox = { + animal: 'cat', + count: 2 + }; + + const context = vm.createContext(sandbox); + console.log(vm.isContext(context)); + const script = new vm.Script('count += 1; name = "kitty"'); + + for (let i = 0; i < 10; ++i) { + script.runInContext(context); + } + + console.log(util.inspect(sandbox)); + + vm.runInNewContext('count += 1; name = "kitty"', sandbox); + console.log(util.inspect(sandbox)); + } + + { + const sandboxes = [{}, {}, {}]; + + const script = new vm.Script('globalVar = "set"'); + + sandboxes.forEach((sandbox) => { + script.runInNewContext(sandbox); + script.runInThisContext(); + }); + + console.log(util.inspect(sandboxes)); + + var localVar = 'initial value'; + vm.runInThisContext('localVar = "vm";'); + + console.log(localVar); + } + + { + const Debug = vm.runInDebugContext('Debug'); + Debug.scripts().forEach((script: any) => { console.log(script.name); }); + } + + { + vm.runInThisContext('console.log("hello world"', './my-file.js'); + } +} + +///////////////////////////////////////////////////// +/// Timers tests : https://nodejs.org/api/timers.html +///////////////////////////////////////////////////// + +namespace timers_tests { + { + let immediateId = timers.setImmediate(() => { console.log("immediate"); }); + timers.clearImmediate(immediateId); + } + { + let counter = 0; + let timeout = timers.setInterval(() => { console.log("interval"); }, 20); + timeout.unref(); + timeout.ref(); + timers.clearInterval(timeout); + } + { + let counter = 0; + let timeout = timers.setTimeout(() => { console.log("timeout"); }, 20); + timeout.unref(); + timeout.ref(); + timers.clearTimeout(timeout); + } + async function testPromisify() { + const setTimeout = util.promisify(timers.setTimeout); + let v: void = await setTimeout(100); // tslint:disable-line no-void-expression void-return + let s: string = await setTimeout(100, ""); + + const setImmediate = util.promisify(timers.setImmediate); + v = await setImmediate(); // tslint:disable-line no-void-expression + s = await setImmediate(""); + } +} + +///////////////////////////////////////////////////////// +/// Errors Tests : https://nodejs.org/api/errors.html /// +///////////////////////////////////////////////////////// + +namespace errors_tests { + { + Error.stackTraceLimit = Infinity; + } + { + const myObject = {}; + Error.captureStackTrace(myObject); + } + { + let frames: NodeJS.CallSite[] = []; + Error.prepareStackTrace(new Error(), frames); + } + { + let frame: NodeJS.CallSite = null; + let frameThis: any = frame.getThis(); + let typeName: string = frame.getTypeName(); + let func: Function = frame.getFunction(); + let funcName: string = frame.getFunctionName(); + let meth: string = frame.getMethodName(); + let fname: string = frame.getFileName(); + let lineno: number = frame.getLineNumber(); + let colno: number = frame.getColumnNumber(); + let evalOrigin: string = frame.getEvalOrigin(); + let isTop: boolean = frame.isToplevel(); + let isEval: boolean = frame.isEval(); + let isNative: boolean = frame.isNative(); + let isConstr: boolean = frame.isConstructor(); + } +} + +/////////////////////////////////////////////////////////// +/// Process Tests : https://nodejs.org/api/process.html /// +/////////////////////////////////////////////////////////// + +import * as p from "process"; +namespace process_tests { + { + var eventEmitter: events.EventEmitter; + eventEmitter = process; // Test that process implements EventEmitter... + + var _p: NodeJS.Process = process; + _p = p; + } + { + assert(process.argv[0] === process.argv0); + } + { + var module: NodeModule | undefined; + module = process.mainModule; + } + { + process.on("message", (req: any) => { }); + process.addListener("beforeExit", (code: number) => { }); + process.once("disconnect", () => { }); + process.prependListener("exit", (code: number) => { }); + process.prependOnceListener("rejectionHandled", (promise: Promise) => { }); + process.on("uncaughtException", (error: Error) => { }); + process.addListener("unhandledRejection", (reason: any, promise: Promise) => { }); + process.once("warning", (warning: Error) => { }); + process.prependListener("message", (message: any, sendHandle: any) => { }); + process.prependOnceListener("SIGBREAK", () => { }); + process.on("newListener", (event: string | symbol, listener: Function) => { }); + process.once("removeListener", (event: string | symbol, listener: Function) => { }); + + const listeners = process.listeners('uncaughtException'); + const oldHandler = listeners[listeners.length - 1]; + process.addListener('uncaughtException', oldHandler); + } + { + function myCb(err: Error): void { + } + process.setUncaughtExceptionCaptureCallback(myCb); + process.setUncaughtExceptionCaptureCallback(null); + const b: boolean = process.hasUncaughtExceptionCaptureCallback(); + } +} + +/////////////////////////////////////////////////////////// +/// Console Tests : https://nodejs.org/api/console.html /// +/////////////////////////////////////////////////////////// + +import * as c from "console"; +namespace console_tests { + { + var _c: Console = console; + _c = c; + } + { + var writeStream = fs.createWriteStream('./index.d.ts'); + var consoleInstance = new console.Console(writeStream); + } +} + +/////////////////////////////////////////////////// +/// Net Tests : https://nodejs.org/api/net.html /// +/////////////////////////////////////////////////// + +namespace net_tests { + { + const connectOpts: net.NetConnectOpts = { + allowHalfOpen: true, + family: 4, + host: "localhost", + port: 443, + timeout: 10E3 + }; + const socket: net.Socket = net.createConnection(connectOpts, (): void => { + // nothing + }); + } + + { + let server = net.createServer(); + // Check methods which return server instances by chaining calls + server = server.listen(0) + .close() + .ref() + .unref(); + + // close has an optional callback function. No callback parameters are + // specified, so any callback function is permissible. + server = server.close((...args: any[]) => { }); + + // test the types of the address object fields + let address = server.address(); + address.port = 1234; + address.family = "ipv4"; + address.address = "127.0.0.1"; + } + + { + const constructorOpts: net.SocketConstructorOpts = { + fd: 1, + allowHalfOpen: false, + readable: false, + writable: false + }; + + /** + * net.Socket - events.EventEmitter + * 1. close + * 2. connect + * 3. data + * 4. drain + * 5. end + * 6. error + * 7. lookup + * 8. timeout + */ + let _socket: net.Socket = new net.Socket(constructorOpts); + + let bool: boolean; + let buffer: Buffer; + let error: Error; + let str: string; + let num: number; + + let ipcConnectOpts: net.IpcSocketConnectOpts = { + path: "/" + }; + let tcpConnectOpts: net.TcpSocketConnectOpts = { + family: 4, + hints: 0, + host: "localhost", + localAddress: "10.0.0.1", + localPort: 1234, + lookup: (_hostname: string, _options: dns.LookupOneOptions, _callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void => { + // nothing + }, + port: 80 + }; + _socket = _socket.connect(ipcConnectOpts); + _socket = _socket.connect(ipcConnectOpts, (): void => {}); + _socket = _socket.connect(tcpConnectOpts); + _socket = _socket.connect(tcpConnectOpts, (): void => {}); + _socket = _socket.connect(80, "localhost"); + _socket = _socket.connect(80, "localhost", (): void => {}); + _socket = _socket.connect(80); + _socket = _socket.connect(80, (): void => {}); + + /// addListener + + _socket = _socket.addListener("close", had_error => { + bool = had_error; + }); + _socket = _socket.addListener("connect", () => { }); + _socket = _socket.addListener("data", data => { + buffer = data; + }); + _socket = _socket.addListener("drain", () => { }); + _socket = _socket.addListener("end", () => { }); + _socket = _socket.addListener("error", err => { + error = err; + }); + _socket = _socket.addListener("lookup", (err, address, family, host) => { + error = err; + + if (typeof family === 'string') { + str = family; + } else if (typeof family === 'number') { + num = family; + } + + str = host; + }); + _socket = _socket.addListener("timeout", () => { }); + + /// emit + bool = _socket.emit("close", bool); + bool = _socket.emit("connect"); + bool = _socket.emit("data", buffer); + bool = _socket.emit("drain"); + bool = _socket.emit("end"); + bool = _socket.emit("error", error); + bool = _socket.emit("lookup", error, str, str, str); + bool = _socket.emit("lookup", error, str, num, str); + bool = _socket.emit("timeout"); + + /// on + _socket = _socket.on("close", had_error => { + bool = had_error; + }); + _socket = _socket.on("connect", () => { }); + _socket = _socket.on("data", data => { + buffer = data; + }); + _socket = _socket.on("drain", () => { }); + _socket = _socket.on("end", () => { }); + _socket = _socket.on("error", err => { + error = err; + }); + _socket = _socket.on("lookup", (err, address, family, host) => { + error = err; + + if (typeof family === 'string') { + str = family; + } else if (typeof family === 'number') { + num = family; + } + + str = host; + }); + _socket = _socket.on("timeout", () => { }); + + /// once + _socket = _socket.once("close", had_error => { + bool = had_error; + }); + _socket = _socket.once("connect", () => { }); + _socket = _socket.once("data", data => { + buffer = data; + }); + _socket = _socket.once("drain", () => { }); + _socket = _socket.once("end", () => { }); + _socket = _socket.once("error", err => { + error = err; + }); + _socket = _socket.once("lookup", (err, address, family, host) => { + error = err; + + if (typeof family === 'string') { + str = family; + } else if (typeof family === 'number') { + num = family; + } + + str = host; + }); + _socket = _socket.once("timeout", () => { }); + + /// prependListener + _socket = _socket.prependListener("close", had_error => { + bool = had_error; + }); + _socket = _socket.prependListener("connect", () => { }); + _socket = _socket.prependListener("data", data => { + buffer = data; + }); + _socket = _socket.prependListener("drain", () => { }); + _socket = _socket.prependListener("end", () => { }); + _socket = _socket.prependListener("error", err => { + error = err; + }); + _socket = _socket.prependListener("lookup", (err, address, family, host) => { + error = err; + + if (typeof family === 'string') { + str = family; + } else if (typeof family === 'number') { + num = family; + } + + str = host; + }); + _socket = _socket.prependListener("timeout", () => { }); + + /// prependOnceListener + _socket = _socket.prependOnceListener("close", had_error => { + bool = had_error; + }); + _socket = _socket.prependOnceListener("connect", () => { }); + _socket = _socket.prependOnceListener("data", data => { + buffer = data; + }); + _socket = _socket.prependOnceListener("drain", () => { }); + _socket = _socket.prependOnceListener("end", () => { }); + _socket = _socket.prependOnceListener("error", err => { + error = err; + }); + _socket = _socket.prependOnceListener("lookup", (err, address, family, host) => { + error = err; + + if (typeof family === 'string') { + str = family; + } else if (typeof family === 'number') { + num = family; + } + + str = host; + }); + _socket = _socket.prependOnceListener("timeout", () => { }); + + bool = _socket.connecting; + bool = _socket.destroyed; + _socket.destroy(); + } + + { + /** + * net.Server - events.EventEmitter + * 1. close + * 2. connection + * 3. error + * 4. listening + */ + let _server: net.Server; + + let _socket: net.Socket; + let bool: boolean; + let error: Error; + + /// addListener + _server = _server.addListener("close", () => { }); + _server = _server.addListener("connection", socket => { + _socket = socket; + }); + _server = _server.addListener("error", err => { + error = err; + }); + _server = _server.addListener("listening", () => { }); + + /// emit + bool = _server.emit("close"); + bool = _server.emit("connection", _socket); + bool = _server.emit("error", error); + bool = _server.emit("listening"); + + /// once + _server = _server.once("close", () => { }); + _server = _server.once("connection", socket => { + _socket = socket; + }); + _server = _server.once("error", err => { + error = err; + }); + _server = _server.once("listening", () => { }); + + /// prependListener + _server = _server.prependListener("close", () => { }); + _server = _server.prependListener("connection", socket => { + _socket = socket; + }); + _server = _server.prependListener("error", err => { + error = err; + }); + _server = _server.prependListener("listening", () => { }); + + /// prependOnceListener + _server = _server.prependOnceListener("close", () => { }); + _server = _server.prependOnceListener("connection", socket => { + _socket = socket; + }); + _server = _server.prependOnceListener("error", err => { + error = err; + }); + _server = _server.prependOnceListener("listening", () => { }); + } +} + +///////////////////////////////////////////////////// +/// repl Tests : https://nodejs.org/api/repl.html /// +///////////////////////////////////////////////////// + +namespace repl_tests { + { + let _server: repl.REPLServer; + let _boolean: boolean; + let _ctx: any; + + _server = _server.addListener("exit", () => { }); + _server = _server.addListener("reset", () => { }); + + _boolean = _server.emit("exit", () => { }); + _boolean = _server.emit("reset", _ctx); + + _server = _server.on("exit", () => { }); + _server = _server.on("reset", () => { }); + + _server = _server.once("exit", () => { }); + _server = _server.once("reset", () => { }); + + _server = _server.prependListener("exit", () => { }); + _server = _server.prependListener("reset", () => { }); + + _server = _server.prependOnceListener("exit", () => { }); + _server = _server.prependOnceListener("reset", () => { }); + + _server.outputStream.write("test"); + let line = _server.inputStream.read(); + + throw new repl.Recoverable(new Error("test")); + } +} + +/////////////////////////////////////////////////// +/// DNS Tests : https://nodejs.org/api/dns.html /// +/////////////////////////////////////////////////// + +namespace dns_tests { + dns.lookup("nodejs.org", (err, address, family) => { + const _err: NodeJS.ErrnoException = err; + const _address: string = address; + const _family: number = family; + }); + dns.lookup("nodejs.org", 4, (err, address, family) => { + const _err: NodeJS.ErrnoException = err; + const _address: string = address; + const _family: number = family; + }); + dns.lookup("nodejs.org", 6, (err, address, family) => { + const _err: NodeJS.ErrnoException = err; + const _address: string = address; + const _family: number = family; + }); + dns.lookup("nodejs.org", {}, (err, address, family) => { + const _err: NodeJS.ErrnoException = err; + const _address: string = address; + const _family: number = family; + }); + dns.lookup( + "nodejs.org", + { + family: 4, + hints: dns.ADDRCONFIG | dns.V4MAPPED, + all: false + }, + (err, address, family) => { + const _err: NodeJS.ErrnoException = err; + const _address: string = address; + const _family: number = family; + } + ); + dns.lookup("nodejs.org", { all: true }, (err, addresses) => { + const _err: NodeJS.ErrnoException = err; + const _address: dns.LookupAddress[] = addresses; + }); + + function trueOrFalse(): boolean { + return Math.random() > 0.5 ? true : false; + } + dns.lookup("nodejs.org", { all: trueOrFalse() }, (err, addresses, family) => { + const _err: NodeJS.ErrnoException = err; + const _addresses: string | dns.LookupAddress[] = addresses; + const _family: number | undefined = family; + }); + + dns.resolve("nodejs.org", (err, addresses) => { + const _addresses: string[] = addresses; + }); + dns.resolve("nodejs.org", "A", (err, addresses) => { + const _addresses: string[] = addresses; + }); + dns.resolve("nodejs.org", "AAAA", (err, addresses) => { + const _addresses: string[] = addresses; + }); + dns.resolve("nodejs.org", "MX", (err, addresses) => { + const _addresses: dns.MxRecord[] = addresses; + }); + + dns.resolve4("nodejs.org", (err, addresses) => { + const _addresses: string[] = addresses; + }); + dns.resolve4("nodejs.org", { ttl: true }, (err, addresses) => { + const _addresses: dns.RecordWithTtl[] = addresses; + }); + { + const ttl = false; + dns.resolve4("nodejs.org", { ttl }, (err, addresses) => { + const _addresses: string[] | dns.RecordWithTtl[] = addresses; + }); + } + + dns.resolve6("nodejs.org", (err, addresses) => { + const _addresses: string[] = addresses; + }); + dns.resolve6("nodejs.org", { ttl: true }, (err, addresses) => { + const _addresses: dns.RecordWithTtl[] = addresses; + }); + { + const ttl = false; + dns.resolve6("nodejs.org", { ttl }, (err, addresses) => { + const _addresses: string[] | dns.RecordWithTtl[] = addresses; + }); + } +} + +/***************************************************************************** + * * + * The following tests are the modules not mentioned in document but existed * + * * + *****************************************************************************/ + +/////////////////////////////////////////////////////////// +/// Constants Tests /// +/////////////////////////////////////////////////////////// + +import * as constants from 'constants'; +import { PerformanceObserver, PerformanceObserverCallback } from "perf_hooks"; +namespace constants_tests { + var str: string; + var num: number; + num = constants.SIGHUP; + num = constants.SIGINT; + num = constants.SIGQUIT; + num = constants.SIGILL; + num = constants.SIGTRAP; + num = constants.SIGABRT; + num = constants.SIGIOT; + num = constants.SIGBUS; + num = constants.SIGFPE; + num = constants.SIGKILL; + num = constants.SIGUSR1; + num = constants.SIGSEGV; + num = constants.SIGUSR2; + num = constants.SIGPIPE; + num = constants.SIGALRM; + num = constants.SIGTERM; + num = constants.SIGCHLD; + num = constants.SIGSTKFLT; + num = constants.SIGCONT; + num = constants.SIGSTOP; + num = constants.SIGTSTP; + num = constants.SIGTTIN; + num = constants.SIGTTOU; + num = constants.SIGURG; + num = constants.SIGXCPU; + num = constants.SIGXFSZ; + num = constants.SIGVTALRM; + num = constants.SIGPROF; + num = constants.SIGWINCH; + num = constants.SIGIO; + num = constants.SIGPOLL; + num = constants.SIGPWR; + num = constants.SIGSYS; + num = constants.SIGUNUSED; + num = constants.O_RDONLY; + num = constants.O_WRONLY; + num = constants.O_RDWR; + num = constants.S_IFMT; + num = constants.S_IFREG; + num = constants.S_IFDIR; + num = constants.S_IFCHR; + num = constants.S_IFBLK; + num = constants.S_IFIFO; + num = constants.S_IFLNK; + num = constants.S_IFSOCK; + num = constants.O_CREAT; + num = constants.O_EXCL; + num = constants.O_NOCTTY; + num = constants.O_TRUNC; + num = constants.O_APPEND; + num = constants.O_DIRECTORY; + num = constants.O_NOATIME; + num = constants.O_NOFOLLOW; + num = constants.O_SYNC; + num = constants.O_DSYNC; + num = constants.O_DIRECT; + num = constants.O_NONBLOCK; + num = constants.S_IRWXU; + num = constants.S_IRUSR; + num = constants.S_IWUSR; + num = constants.S_IXUSR; + num = constants.S_IRWXG; + num = constants.S_IRGRP; + num = constants.S_IWGRP; + num = constants.S_IXGRP; + num = constants.S_IRWXO; + num = constants.S_IROTH; + num = constants.S_IWOTH; + num = constants.S_IXOTH; + num = constants.F_OK; + num = constants.R_OK; + num = constants.W_OK; + num = constants.X_OK; + num = constants.SSL_OP_ALL; + num = constants.SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION; + num = constants.SSL_OP_CIPHER_SERVER_PREFERENCE; + num = constants.SSL_OP_CISCO_ANYCONNECT; + num = constants.SSL_OP_COOKIE_EXCHANGE; + num = constants.SSL_OP_CRYPTOPRO_TLSEXT_BUG; + num = constants.SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS; + num = constants.SSL_OP_EPHEMERAL_RSA; + num = constants.SSL_OP_LEGACY_SERVER_CONNECT; + num = constants.SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER; + num = constants.SSL_OP_MICROSOFT_SESS_ID_BUG; + num = constants.SSL_OP_MSIE_SSLV2_RSA_PADDING; + num = constants.SSL_OP_NETSCAPE_CA_DN_BUG; + num = constants.SSL_OP_NETSCAPE_CHALLENGE_BUG; + num = constants.SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG; + num = constants.SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG; + num = constants.SSL_OP_NO_COMPRESSION; + num = constants.SSL_OP_NO_QUERY_MTU; + num = constants.SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION; + num = constants.SSL_OP_NO_SSLv2; + num = constants.SSL_OP_NO_SSLv3; + num = constants.SSL_OP_NO_TICKET; + num = constants.SSL_OP_NO_TLSv1; + num = constants.SSL_OP_NO_TLSv1_1; + num = constants.SSL_OP_NO_TLSv1_2; + num = constants.SSL_OP_PKCS1_CHECK_1; + num = constants.SSL_OP_PKCS1_CHECK_2; + num = constants.SSL_OP_SINGLE_DH_USE; + num = constants.SSL_OP_SINGLE_ECDH_USE; + num = constants.SSL_OP_SSLEAY_080_CLIENT_DH_BUG; + num = constants.SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG; + num = constants.SSL_OP_TLS_BLOCK_PADDING_BUG; + num = constants.SSL_OP_TLS_D5_BUG; + num = constants.SSL_OP_TLS_ROLLBACK_BUG; + num = constants.ENGINE_METHOD_RSA; + num = constants.ENGINE_METHOD_DSA; + num = constants.ENGINE_METHOD_DH; + num = constants.ENGINE_METHOD_RAND; + num = constants.ENGINE_METHOD_ECDH; + num = constants.ENGINE_METHOD_ECDSA; + num = constants.ENGINE_METHOD_CIPHERS; + num = constants.ENGINE_METHOD_DIGESTS; + num = constants.ENGINE_METHOD_STORE; + num = constants.ENGINE_METHOD_PKEY_METHS; + num = constants.ENGINE_METHOD_PKEY_ASN1_METHS; + num = constants.ENGINE_METHOD_ALL; + num = constants.ENGINE_METHOD_NONE; + num = constants.DH_CHECK_P_NOT_SAFE_PRIME; + num = constants.DH_CHECK_P_NOT_PRIME; + num = constants.DH_UNABLE_TO_CHECK_GENERATOR; + num = constants.DH_NOT_SUITABLE_GENERATOR; + num = constants.NPN_ENABLED; + num = constants.ALPN_ENABLED; + num = constants.RSA_PKCS1_PADDING; + num = constants.RSA_SSLV23_PADDING; + num = constants.RSA_NO_PADDING; + num = constants.RSA_PKCS1_OAEP_PADDING; + num = constants.RSA_X931_PADDING; + num = constants.RSA_PKCS1_PSS_PADDING; + num = constants.POINT_CONVERSION_COMPRESSED; + num = constants.POINT_CONVERSION_UNCOMPRESSED; + num = constants.POINT_CONVERSION_HYBRID; + str = constants.defaultCoreCipherList; + str = constants.defaultCipherList; +} + +//////////////////////////////////////////////////// +/// v8 tests : https://nodejs.org/api/v8.html +//////////////////////////////////////////////////// + +namespace v8_tests { + const heapStats = v8.getHeapStatistics(); + const heapSpaceStats = v8.getHeapSpaceStatistics(); + + const zapsGarbage: number = heapStats.does_zap_garbage; + + v8.setFlagsFromString('--collect_maps'); +} + +//////////////////////////////////////////////////// +/// PerfHooks tests : https://nodejs.org/api/perf_hooks.html +//////////////////////////////////////////////////// +namespace perf_hooks_tests { + perf_hooks.performance.mark('start'); + ( + () => {} + )(); + perf_hooks.performance.mark('end'); + + const { duration } = perf_hooks.performance.getEntriesByName('discover')[0]; + const timeOrigin = perf_hooks.performance.timeOrigin; + + const performanceObserverCallback: PerformanceObserverCallback = (list, obs) => { + const { + duration, + entryType, + name, + startTime, + } = list.getEntries()[0]; + obs.disconnect(); + perf_hooks.performance.clearFunctions(); + }; + const obs = new perf_hooks.PerformanceObserver(performanceObserverCallback); + obs.observe({ + entryTypes: ['function'], + buffered: true, + }); +} + +//////////////////////////////////////////////////// +/// AsyncHooks tests : https://nodejs.org/api/async_hooks.html +//////////////////////////////////////////////////// +namespace async_hooks_tests { + const hooks: async_hooks.HookCallbacks = { + init() {}, + before() {}, + after() {}, + destroy() {}, + promiseResolve() {}, + }; + + const asyncHook = async_hooks.createHook(hooks); + + asyncHook.enable().disable().enable(); + + const tId: number = async_hooks.triggerAsyncId(); + const eId: number = async_hooks.executionAsyncId(); + + class TestResource extends async_hooks.AsyncResource { + constructor() { + super('TEST_RESOURCE'); + } + } + + class AnotherTestResource extends async_hooks.AsyncResource { + constructor() { + super('TEST_RESOURCE', 42); + const aId: number = this.asyncId(); + const tId: number = this.triggerAsyncId(); + } + run() { + this.runInAsyncScope(() => {}); + this.runInAsyncScope(Array.prototype.find, [], () => true); + } + destroy() { + this.emitDestroy(); + } + } + + // check AsyncResource constructor options. + new async_hooks.AsyncResource(''); + new async_hooks.AsyncResource('', 0); + new async_hooks.AsyncResource('', {}); + new async_hooks.AsyncResource('', { triggerAsyncId: 0 }); + new async_hooks.AsyncResource('', { + triggerAsyncId: 0, + requireManualDestroy: true + }); +} + +//////////////////////////////////////////////////// +/// zlib tests : http://nodejs.org/api/zlib.html /// +//////////////////////////////////////////////////// + +namespace zlib_tests { + { + const gzipped = zlib.gzipSync('test'); + const unzipped = zlib.gunzipSync(gzipped.toString()); + } + + { + const deflate = zlib.deflateSync('test'); + const inflate = zlib.inflateSync(deflate.toString()); + } +} + +/////////////////////////////////////////////////////////// +/// HTTP/2 Tests /// +/////////////////////////////////////////////////////////// + +namespace http2_tests { + // Headers & Settings + { + let headers: http2.OutgoingHttpHeaders = { + ':status': 200, + 'content-type': 'text-plain', + ABC: ['has', 'more', 'than', 'one', 'value'], + undef: undefined + }; + + let settings: http2.Settings = { + headerTableSize: 0, + enablePush: true, + initialWindowSize: 0, + maxFrameSize: 0, + maxConcurrentStreams: 0, + maxHeaderListSize: 0 + }; + } + + // Http2Session + { + let http2Session: http2.Http2Session; + let ee: events.EventEmitter = http2Session; + + http2Session.on('close', () => {}); + http2Session.on('connect', (session: http2.Http2Session, socket: net.Socket) => {}); + http2Session.on('error', (err: Error) => {}); + http2Session.on('frameError', (frameType: number, errorCode: number, streamID: number) => {}); + http2Session.on('goaway', (errorCode: number, lastStreamID: number, opaqueData: Buffer) => {}); + http2Session.on('localSettings', (settings: http2.Settings) => {}); + http2Session.on('remoteSettings', (settings: http2.Settings) => {}); + http2Session.on('stream', (stream: http2.Http2Stream, headers: http2.IncomingHttpHeaders, flags: number) => {}); + http2Session.on('timeout', () => {}); + + http2Session.destroy(); + + let alpnProtocol: string = http2Session.alpnProtocol; + let destroyed: boolean = http2Session.destroyed; + let encrypted: boolean = http2Session.encrypted; + let originSet: string[] = http2Session.originSet; + let pendingSettingsAck: boolean = http2Session.pendingSettingsAck; + let settings: http2.Settings = http2Session.localSettings; + let closed: boolean = http2Session.closed; + settings = http2Session.remoteSettings; + + http2Session.ref(); + http2Session.unref(); + + let headers: http2.OutgoingHttpHeaders; + let options: http2.ClientSessionRequestOptions = { + endStream: true, + exclusive: true, + parent: 0, + weight: 0, + getTrailers: (trailers: http2.OutgoingHttpHeaders) => {} + }; + (http2Session as http2.ClientHttp2Session).request(); + (http2Session as http2.ClientHttp2Session).request(headers); + (http2Session as http2.ClientHttp2Session).request(headers, options); + + let stream: http2.Http2Stream; + http2Session.rstStream(stream); + http2Session.rstStream(stream, 0); + + http2Session.setTimeout(100, () => {}); + http2Session.close(() => {}); + + let socket: net.Socket | tls.TLSSocket = http2Session.socket; + let state: http2.SessionState = http2Session.state; + state = { + effectiveLocalWindowSize: 0, + effectiveRecvDataLength: 0, + nextStreamID: 0, + localWindowSize: 0, + lastProcStreamID: 0, + remoteWindowSize: 0, + outboundQueueSize: 0, + deflateDynamicTableSize: 0, + inflateDynamicTableSize: 0 + }; + + http2Session.priority(stream, { + exclusive: true, + parent: 0, + weight: 0, + silent: true + }); + + http2Session.settings(settings); + } + + // Http2Stream + { + let http2Stream: http2.Http2Stream; + let duplex: stream.Duplex = http2Stream; + + http2Stream.on('aborted', () => {}); + http2Stream.on('error', (err: Error) => {}); + http2Stream.on('frameError', (frameType: number, errorCode: number, streamID: number) => {}); + http2Stream.on('streamClosed', (code: number) => {}); + http2Stream.on('timeout', () => {}); + http2Stream.on('trailers', (trailers: http2.IncomingHttpHeaders, flags: number) => {}); + + let aborted: boolean = http2Stream.aborted; + let closed: boolean = http2Stream.closed; + let destroyed: boolean = http2Stream.destroyed; + let pending: boolean = http2Stream.pending; + + http2Stream.priority({ + exclusive: true, + parent: 0, + weight: 0, + silent: true + }); + + let sesh: http2.Http2Session = http2Stream.session; + + http2Stream.setTimeout(100, () => {}); + + let state: http2.StreamState = http2Stream.state; + state = { + localWindowSize: 0, + state: 0, + streamLocalClose: 0, + streamRemoteClose: 0, + sumDependencyWeight: 0, + weight: 0 + }; + + // ClientHttp2Stream + let clientHttp2Stream: http2.ClientHttp2Stream; + clientHttp2Stream.on('headers', (headers: http2.IncomingHttpHeaders, flags: number) => {}); + clientHttp2Stream.on('push', (headers: http2.IncomingHttpHeaders, flags: number) => {}); + clientHttp2Stream.on('response', (headers: http2.IncomingHttpHeaders, flags: number) => {}); + + // ServerHttp2Stream + let serverHttp2Stream: http2.ServerHttp2Stream; + let headers: http2.OutgoingHttpHeaders; + + serverHttp2Stream.additionalHeaders(headers); + let headerSent: boolean = serverHttp2Stream.headersSent; + let pushAllowed: boolean = serverHttp2Stream.pushAllowed; + serverHttp2Stream.pushStream(headers, (err: Error | null, pushStream: http2.ServerHttp2Stream, headers: http2.OutgoingHttpHeaders) => {}); + + let options: http2.ServerStreamResponseOptions = { + endStream: true, + getTrailers: (trailers: http2.OutgoingHttpHeaders) => {} + }; + serverHttp2Stream.respond(); + serverHttp2Stream.respond(headers); + serverHttp2Stream.respond(headers, options); + + let options2: http2.ServerStreamFileResponseOptions = { + statCheck: (stats: fs.Stats, headers: http2.OutgoingHttpHeaders, statOptions: http2.StatOptions) => {}, + getTrailers: (trailers: http2.OutgoingHttpHeaders) => {}, + offset: 0, + length: 0 + }; + serverHttp2Stream.respondWithFD(0); + serverHttp2Stream.respondWithFD(0, headers); + serverHttp2Stream.respondWithFD(0, headers, options2); + serverHttp2Stream.respondWithFD(0, headers, {statCheck: () => false}); + let options3: http2.ServerStreamFileResponseOptionsWithError = { + onError: (err: NodeJS.ErrnoException) => {}, + statCheck: (stats: fs.Stats, headers: http2.OutgoingHttpHeaders, statOptions: http2.StatOptions) => {}, + getTrailers: (trailers: http2.OutgoingHttpHeaders) => {}, + offset: 0, + length: 0 + }; + serverHttp2Stream.respondWithFile(''); + serverHttp2Stream.respondWithFile('', headers); + serverHttp2Stream.respondWithFile('', headers, options3); + serverHttp2Stream.respondWithFile('', headers, {statCheck: () => false}); + } + + // Http2Server / Http2SecureServer + { + let http2Server: http2.Http2Server; + let http2SecureServer: http2.Http2SecureServer; + let s1: net.Server = http2Server; + let s2: tls.Server = http2SecureServer; + [http2Server, http2SecureServer].forEach((server) => { + server.on('sessionError', (err: Error) => {}); + server.on('checkContinue', (stream: http2.ServerHttp2Stream, headers: http2.IncomingHttpHeaders, flags: number) => {}); + server.on('stream', (stream: http2.ServerHttp2Stream, headers: http2.IncomingHttpHeaders, flags: number) => {}); + server.on('request', (request: http2.Http2ServerRequest, response: http2.Http2ServerResponse) => {}); + server.on('timeout', () => {}); + }); + + http2SecureServer.on('unknownProtocol', (socket: tls.TLSSocket) => {}); + } + + // Public API (except constants) + { + let settings: http2.Settings; + let serverOptions: http2.ServerOptions = { + maxDeflateDynamicTableSize: 0, + maxReservedRemoteStreams: 0, + maxSendHeaderBlockLength: 0, + paddingStrategy: 0, + peerMaxConcurrentStreams: 0, + selectPadding: (frameLen: number, maxFrameLen: number) => 0, + settings, + allowHTTP1: true + }; + // tslint:disable-next-line prefer-object-spread (ts2.1 feature) + let secureServerOptions: http2.SecureServerOptions = Object.assign({}, serverOptions); + secureServerOptions.ca = ''; + let onRequestHandler = (request: http2.Http2ServerRequest, response: http2.Http2ServerResponse) => { + // Http2ServerRequest + + let readable: stream.Readable = request; + let incomingHeaders: http2.IncomingHttpHeaders = request.headers; + incomingHeaders = request.trailers; + let httpVersion: string = request.httpVersion; + let method: string = request.method; + let rawHeaders: string[] = request.rawHeaders; + rawHeaders = request.rawTrailers; + let socket: net.Socket | tls.TLSSocket = request.socket; + let stream: http2.ServerHttp2Stream = request.stream; + let url: string = request.url; + + request.setTimeout(0, () => {}); + request.on('aborted', (hadError: boolean, code: number) => {}); + + // Http2ServerResponse + + let outgoingHeaders: http2.OutgoingHttpHeaders; + response.addTrailers(outgoingHeaders); + socket = response.connection; + let finished: boolean = response.finished; + response.sendDate = true; + response.statusCode = 200; + response.statusMessage = ''; + socket = response.socket; + stream = response.stream; + + method = response.getHeader(':method'); + let headers: string[] = response.getHeaderNames(); + outgoingHeaders = response.getHeaders(); + let hasMethod = response.hasHeader(':method'); + response.removeHeader(':method'); + response.setHeader(':method', 'GET'); + response.setHeader(':status', 200); + response.setHeader('some-list', ['', '']); + let headersSent: boolean = response.headersSent; + + response.setTimeout(0, () => {}); + response.createPushResponse(outgoingHeaders, (err: Error | null, res: http2.Http2ServerResponse) => {}); + + response.writeContinue(); + response.writeHead(200); + response.writeHead(200, outgoingHeaders); + response.writeHead(200, 'OK', outgoingHeaders); + response.writeHead(200, 'OK'); + response.write(''); + response.write('', (err: Error) => {}); + response.write('', 'utf8'); + response.write('', 'utf8', (err: Error) => {}); + response.write(Buffer.from([])); + response.write(Buffer.from([]), (err: Error) => {}); + response.write(Buffer.from([]), 'utf8'); + response.write(Buffer.from([]), 'utf8', (err: Error) => {}); + response.end(); + response.end(() => {}); + response.end(''); + response.end('', () => {}); + response.end('', 'utf8'); + response.end('', 'utf8', () => {}); + response.end(Buffer.from([])); + response.end(Buffer.from([]), () => {}); + response.end(Buffer.from([]), 'utf8'); + response.end(Buffer.from([]), 'utf8', () => {}); + + request.on('aborted', (hadError: boolean, code: number) => {}); + request.on('close', () => {}); + request.on('drain', () => {}); + request.on('error', (error: Error) => {}); + request.on('finish', () => {}); + }; + + let http2Server: http2.Http2Server; + let http2SecureServer: http2.Http2SecureServer; + + http2Server = http2.createServer(); + http2Server = http2.createServer(serverOptions); + http2Server = http2.createServer(onRequestHandler); + http2Server = http2.createServer(serverOptions, onRequestHandler); + + http2SecureServer = http2.createSecureServer(); + http2SecureServer = http2.createSecureServer(secureServerOptions); + http2SecureServer = http2.createSecureServer(onRequestHandler); + http2SecureServer = http2.createSecureServer(secureServerOptions, onRequestHandler); + + let clientSessionOptions: http2.ClientSessionOptions = { + maxDeflateDynamicTableSize: 0, + maxReservedRemoteStreams: 0, + maxSendHeaderBlockLength: 0, + paddingStrategy: 0, + peerMaxConcurrentStreams: 0, + selectPadding: (frameLen: number, maxFrameLen: number) => 0, + settings + }; + // tslint:disable-next-line prefer-object-spread (ts2.1 feature) + let secureClientSessionOptions: http2.SecureClientSessionOptions = Object.assign({}, clientSessionOptions); + secureClientSessionOptions.ca = ''; + let onConnectHandler = (session: http2.Http2Session, socket: net.Socket) => {}; + + let serverHttp2Session: http2.ServerHttp2Session; + + serverHttp2Session.altsvc('', ''); + serverHttp2Session.altsvc('', 0); + serverHttp2Session.altsvc('', new url.URL('')); + serverHttp2Session.altsvc('', { origin: '' }); + serverHttp2Session.altsvc('', { origin: 0 }); + serverHttp2Session.altsvc('', { origin: new url.URL('') }); + + let clientHttp2Session: http2.ClientHttp2Session; + + clientHttp2Session = http2.connect(''); + clientHttp2Session = http2.connect('', onConnectHandler); + clientHttp2Session = http2.connect('', clientSessionOptions); + clientHttp2Session = http2.connect('', clientSessionOptions, onConnectHandler); + clientHttp2Session = http2.connect('', secureClientSessionOptions); + clientHttp2Session = http2.connect('', secureClientSessionOptions, onConnectHandler); + clientHttp2Session.on('altsvc', (alt: string, origin: string, number: number) => {}); + + settings = http2.getDefaultSettings(); + settings = http2.getPackedSettings(settings); + settings = http2.getUnpackedSettings(Buffer.from([])); + settings = http2.getUnpackedSettings(Uint8Array.from([])); + } + + // constants + { + const constants = http2.constants; + let num: number; + let str: string; + num = constants.NGHTTP2_SESSION_SERVER; + num = constants.NGHTTP2_SESSION_CLIENT; + num = constants.NGHTTP2_STREAM_STATE_IDLE; + num = constants.NGHTTP2_STREAM_STATE_OPEN; + num = constants.NGHTTP2_STREAM_STATE_RESERVED_LOCAL; + num = constants.NGHTTP2_STREAM_STATE_RESERVED_REMOTE; + num = constants.NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL; + num = constants.NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE; + num = constants.NGHTTP2_STREAM_STATE_CLOSED; + num = constants.NGHTTP2_NO_ERROR; + num = constants.NGHTTP2_PROTOCOL_ERROR; + num = constants.NGHTTP2_INTERNAL_ERROR; + num = constants.NGHTTP2_FLOW_CONTROL_ERROR; + num = constants.NGHTTP2_SETTINGS_TIMEOUT; + num = constants.NGHTTP2_STREAM_CLOSED; + num = constants.NGHTTP2_FRAME_SIZE_ERROR; + num = constants.NGHTTP2_REFUSED_STREAM; + num = constants.NGHTTP2_CANCEL; + num = constants.NGHTTP2_COMPRESSION_ERROR; + num = constants.NGHTTP2_CONNECT_ERROR; + num = constants.NGHTTP2_ENHANCE_YOUR_CALM; + num = constants.NGHTTP2_INADEQUATE_SECURITY; + num = constants.NGHTTP2_HTTP_1_1_REQUIRED; + num = constants.NGHTTP2_ERR_FRAME_SIZE_ERROR; + num = constants.NGHTTP2_FLAG_NONE; + num = constants.NGHTTP2_FLAG_END_STREAM; + num = constants.NGHTTP2_FLAG_END_HEADERS; + num = constants.NGHTTP2_FLAG_ACK; + num = constants.NGHTTP2_FLAG_PADDED; + num = constants.NGHTTP2_FLAG_PRIORITY; + num = constants.DEFAULT_SETTINGS_HEADER_TABLE_SIZE; + num = constants.DEFAULT_SETTINGS_ENABLE_PUSH; + num = constants.DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE; + num = constants.DEFAULT_SETTINGS_MAX_FRAME_SIZE; + num = constants.MAX_MAX_FRAME_SIZE; + num = constants.MIN_MAX_FRAME_SIZE; + num = constants.MAX_INITIAL_WINDOW_SIZE; + num = constants.NGHTTP2_DEFAULT_WEIGHT; + num = constants.NGHTTP2_SETTINGS_HEADER_TABLE_SIZE; + num = constants.NGHTTP2_SETTINGS_ENABLE_PUSH; + num = constants.NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS; + num = constants.NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE; + num = constants.NGHTTP2_SETTINGS_MAX_FRAME_SIZE; + num = constants.NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE; + num = constants.PADDING_STRATEGY_NONE; + num = constants.PADDING_STRATEGY_MAX; + num = constants.PADDING_STRATEGY_CALLBACK; + num = constants.HTTP_STATUS_CONTINUE; + num = constants.HTTP_STATUS_SWITCHING_PROTOCOLS; + num = constants.HTTP_STATUS_PROCESSING; + num = constants.HTTP_STATUS_OK; + num = constants.HTTP_STATUS_CREATED; + num = constants.HTTP_STATUS_ACCEPTED; + num = constants.HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION; + num = constants.HTTP_STATUS_NO_CONTENT; + num = constants.HTTP_STATUS_RESET_CONTENT; + num = constants.HTTP_STATUS_PARTIAL_CONTENT; + num = constants.HTTP_STATUS_MULTI_STATUS; + num = constants.HTTP_STATUS_ALREADY_REPORTED; + num = constants.HTTP_STATUS_IM_USED; + num = constants.HTTP_STATUS_MULTIPLE_CHOICES; + num = constants.HTTP_STATUS_MOVED_PERMANENTLY; + num = constants.HTTP_STATUS_FOUND; + num = constants.HTTP_STATUS_SEE_OTHER; + num = constants.HTTP_STATUS_NOT_MODIFIED; + num = constants.HTTP_STATUS_USE_PROXY; + num = constants.HTTP_STATUS_TEMPORARY_REDIRECT; + num = constants.HTTP_STATUS_PERMANENT_REDIRECT; + num = constants.HTTP_STATUS_BAD_REQUEST; + num = constants.HTTP_STATUS_UNAUTHORIZED; + num = constants.HTTP_STATUS_PAYMENT_REQUIRED; + num = constants.HTTP_STATUS_FORBIDDEN; + num = constants.HTTP_STATUS_NOT_FOUND; + num = constants.HTTP_STATUS_METHOD_NOT_ALLOWED; + num = constants.HTTP_STATUS_NOT_ACCEPTABLE; + num = constants.HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED; + num = constants.HTTP_STATUS_REQUEST_TIMEOUT; + num = constants.HTTP_STATUS_CONFLICT; + num = constants.HTTP_STATUS_GONE; + num = constants.HTTP_STATUS_LENGTH_REQUIRED; + num = constants.HTTP_STATUS_PRECONDITION_FAILED; + num = constants.HTTP_STATUS_PAYLOAD_TOO_LARGE; + num = constants.HTTP_STATUS_URI_TOO_LONG; + num = constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE; + num = constants.HTTP_STATUS_RANGE_NOT_SATISFIABLE; + num = constants.HTTP_STATUS_EXPECTATION_FAILED; + num = constants.HTTP_STATUS_TEAPOT; + num = constants.HTTP_STATUS_MISDIRECTED_REQUEST; + num = constants.HTTP_STATUS_UNPROCESSABLE_ENTITY; + num = constants.HTTP_STATUS_LOCKED; + num = constants.HTTP_STATUS_FAILED_DEPENDENCY; + num = constants.HTTP_STATUS_UNORDERED_COLLECTION; + num = constants.HTTP_STATUS_UPGRADE_REQUIRED; + num = constants.HTTP_STATUS_PRECONDITION_REQUIRED; + num = constants.HTTP_STATUS_TOO_MANY_REQUESTS; + num = constants.HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE; + num = constants.HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS; + num = constants.HTTP_STATUS_INTERNAL_SERVER_ERROR; + num = constants.HTTP_STATUS_NOT_IMPLEMENTED; + num = constants.HTTP_STATUS_BAD_GATEWAY; + num = constants.HTTP_STATUS_SERVICE_UNAVAILABLE; + num = constants.HTTP_STATUS_GATEWAY_TIMEOUT; + num = constants.HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED; + num = constants.HTTP_STATUS_VARIANT_ALSO_NEGOTIATES; + num = constants.HTTP_STATUS_INSUFFICIENT_STORAGE; + num = constants.HTTP_STATUS_LOOP_DETECTED; + num = constants.HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED; + num = constants.HTTP_STATUS_NOT_EXTENDED; + num = constants.HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED; + str = constants.HTTP2_HEADER_STATUS; + str = constants.HTTP2_HEADER_METHOD; + str = constants.HTTP2_HEADER_AUTHORITY; + str = constants.HTTP2_HEADER_SCHEME; + str = constants.HTTP2_HEADER_PATH; + str = constants.HTTP2_HEADER_ACCEPT_CHARSET; + str = constants.HTTP2_HEADER_ACCEPT_ENCODING; + str = constants.HTTP2_HEADER_ACCEPT_LANGUAGE; + str = constants.HTTP2_HEADER_ACCEPT_RANGES; + str = constants.HTTP2_HEADER_ACCEPT; + str = constants.HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN; + str = constants.HTTP2_HEADER_AGE; + str = constants.HTTP2_HEADER_ALLOW; + str = constants.HTTP2_HEADER_AUTHORIZATION; + str = constants.HTTP2_HEADER_CACHE_CONTROL; + str = constants.HTTP2_HEADER_CONNECTION; + str = constants.HTTP2_HEADER_CONTENT_DISPOSITION; + str = constants.HTTP2_HEADER_CONTENT_ENCODING; + str = constants.HTTP2_HEADER_CONTENT_LANGUAGE; + str = constants.HTTP2_HEADER_CONTENT_LENGTH; + str = constants.HTTP2_HEADER_CONTENT_LOCATION; + str = constants.HTTP2_HEADER_CONTENT_MD5; + str = constants.HTTP2_HEADER_CONTENT_RANGE; + str = constants.HTTP2_HEADER_CONTENT_TYPE; + str = constants.HTTP2_HEADER_COOKIE; + str = constants.HTTP2_HEADER_DATE; + str = constants.HTTP2_HEADER_ETAG; + str = constants.HTTP2_HEADER_EXPECT; + str = constants.HTTP2_HEADER_EXPIRES; + str = constants.HTTP2_HEADER_FROM; + str = constants.HTTP2_HEADER_HOST; + str = constants.HTTP2_HEADER_IF_MATCH; + str = constants.HTTP2_HEADER_IF_MODIFIED_SINCE; + str = constants.HTTP2_HEADER_IF_NONE_MATCH; + str = constants.HTTP2_HEADER_IF_RANGE; + str = constants.HTTP2_HEADER_IF_UNMODIFIED_SINCE; + str = constants.HTTP2_HEADER_LAST_MODIFIED; + str = constants.HTTP2_HEADER_LINK; + str = constants.HTTP2_HEADER_LOCATION; + str = constants.HTTP2_HEADER_MAX_FORWARDS; + str = constants.HTTP2_HEADER_PREFER; + str = constants.HTTP2_HEADER_PROXY_AUTHENTICATE; + str = constants.HTTP2_HEADER_PROXY_AUTHORIZATION; + str = constants.HTTP2_HEADER_RANGE; + str = constants.HTTP2_HEADER_REFERER; + str = constants.HTTP2_HEADER_REFRESH; + str = constants.HTTP2_HEADER_RETRY_AFTER; + str = constants.HTTP2_HEADER_SERVER; + str = constants.HTTP2_HEADER_SET_COOKIE; + str = constants.HTTP2_HEADER_STRICT_TRANSPORT_SECURITY; + str = constants.HTTP2_HEADER_TRANSFER_ENCODING; + str = constants.HTTP2_HEADER_TE; + str = constants.HTTP2_HEADER_UPGRADE; + str = constants.HTTP2_HEADER_USER_AGENT; + str = constants.HTTP2_HEADER_VARY; + str = constants.HTTP2_HEADER_VIA; + str = constants.HTTP2_HEADER_WWW_AUTHENTICATE; + str = constants.HTTP2_HEADER_HTTP2_SETTINGS; + str = constants.HTTP2_HEADER_KEEP_ALIVE; + str = constants.HTTP2_HEADER_PROXY_CONNECTION; + str = constants.HTTP2_METHOD_ACL; + str = constants.HTTP2_METHOD_BASELINE_CONTROL; + str = constants.HTTP2_METHOD_BIND; + str = constants.HTTP2_METHOD_CHECKIN; + str = constants.HTTP2_METHOD_CHECKOUT; + str = constants.HTTP2_METHOD_CONNECT; + str = constants.HTTP2_METHOD_COPY; + str = constants.HTTP2_METHOD_DELETE; + str = constants.HTTP2_METHOD_GET; + str = constants.HTTP2_METHOD_HEAD; + str = constants.HTTP2_METHOD_LABEL; + str = constants.HTTP2_METHOD_LINK; + str = constants.HTTP2_METHOD_LOCK; + str = constants.HTTP2_METHOD_MERGE; + str = constants.HTTP2_METHOD_MKACTIVITY; + str = constants.HTTP2_METHOD_MKCALENDAR; + str = constants.HTTP2_METHOD_MKCOL; + str = constants.HTTP2_METHOD_MKREDIRECTREF; + str = constants.HTTP2_METHOD_MKWORKSPACE; + str = constants.HTTP2_METHOD_MOVE; + str = constants.HTTP2_METHOD_OPTIONS; + str = constants.HTTP2_METHOD_ORDERPATCH; + str = constants.HTTP2_METHOD_PATCH; + str = constants.HTTP2_METHOD_POST; + str = constants.HTTP2_METHOD_PRI; + str = constants.HTTP2_METHOD_PROPFIND; + str = constants.HTTP2_METHOD_PROPPATCH; + str = constants.HTTP2_METHOD_PUT; + str = constants.HTTP2_METHOD_REBIND; + str = constants.HTTP2_METHOD_REPORT; + str = constants.HTTP2_METHOD_SEARCH; + str = constants.HTTP2_METHOD_TRACE; + str = constants.HTTP2_METHOD_UNBIND; + str = constants.HTTP2_METHOD_UNCHECKOUT; + str = constants.HTTP2_METHOD_UNLINK; + str = constants.HTTP2_METHOD_UNLOCK; + str = constants.HTTP2_METHOD_UPDATE; + str = constants.HTTP2_METHOD_UPDATEREDIRECTREF; + str = constants.HTTP2_METHOD_VERSION_CONTROL; + } +} + +/////////////////////////////////////////////////////////// +/// Inspector Tests /// +/////////////////////////////////////////////////////////// + +namespace inspector_tests { + { + inspector.open(); + inspector.open(0); + inspector.open(0, 'localhost'); + inspector.open(0, 'localhost', true); + inspector.close(); + const inspectorUrl: string = inspector.url(); + + const session = new inspector.Session(); + session.connect(); + session.disconnect(); + + // Unknown post method + session.post('A.b', { key: 'value' }, (err, params) => {}); + // TODO: parameters are implicitly 'any' and need type annotation + session.post('A.b', (err: Error | null, params?: {}) => {}); + session.post('A.b'); + // Known post method + const parameter: inspector.Runtime.EvaluateParameterType = { expression: '2 + 2' }; + session.post('Runtime.evaluate', parameter, + (err: Error, params: inspector.Runtime.EvaluateReturnType) => {}); + session.post('Runtime.evaluate', (err: Error, params: inspector.Runtime.EvaluateReturnType) => { + const exceptionDetails: inspector.Runtime.ExceptionDetails = params.exceptionDetails; + const resultClassName: string = params.result.className; + }); + session.post('Runtime.evaluate'); + + // General event + session.on('inspectorNotification', message => { + message; // $ExpectType InspectorNotification<{}> + }); + // Known events + session.on('Debugger.paused', (message: inspector.InspectorNotification) => { + const method: string = message.method; + const pauseReason: string = message.params.reason; + }); + session.on('Debugger.resumed', () => {}); + } +} + +//////////////////////////////////////////////////// +/// module tests : http://nodejs.org/api/modules.html +//////////////////////////////////////////////////// + +namespace module_tests { + require.extensions[".ts"] = () => ""; + + Module.runMain(); + const s: string = Module.wrap("some code"); + + const m1: Module = new Module("moduleId"); + const m2: Module = new Module.Module("moduleId"); + const b: string[] = Module.builtinModules; + let paths: string[] = module.paths; + paths = m1.paths; +} + +//////////////////////////////////////////////////// +/// Node.js ESNEXT Support +//////////////////////////////////////////////////// + +namespace esnext_string_tests { + const s: string = 'foo'; + const s1: string = s.trimLeft(); + const s2: string = s.trimRight(); +} diff --git a/types/node/v9/tsconfig.json b/types/node/v9/tsconfig.json new file mode 100644 index 0000000000..8752b2560b --- /dev/null +++ b/types/node/v9/tsconfig.json @@ -0,0 +1,29 @@ +{ + "files": [ + "index.d.ts", + "node-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "node": [ + "node/v9" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} \ No newline at end of file diff --git a/types/node/v9/tslint.json b/types/node/v9/tslint.json new file mode 100644 index 0000000000..45064d266f --- /dev/null +++ b/types/node/v9/tslint.json @@ -0,0 +1,26 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // All are TODOs + "ban-types": false, + "dt-header": false, + "max-line-length": false, + "no-any-union": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-namespace": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-var-keyword": false, + "prefer-const": false, + "prefer-method-signature": false, + "strict-export-declare-modifiers": false, + "unified-signatures": false + } +} From 492f2dc66d6d9946b1ac513c94b851c746d43711 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 26 Apr 2018 09:13:42 -0700 Subject: [PATCH 0897/2153] Add html-tag-names --- types/html-tag-names/html-tag-names-tests.ts | 3 +++ types/html-tag-names/index.d.ts | 2 ++ types/html-tag-names/tsconfig.json | 23 ++++++++++++++++++++ types/html-tag-names/tslint.json | 1 + 4 files changed, 29 insertions(+) create mode 100644 types/html-tag-names/html-tag-names-tests.ts create mode 100644 types/html-tag-names/index.d.ts create mode 100644 types/html-tag-names/tsconfig.json create mode 100644 types/html-tag-names/tslint.json diff --git a/types/html-tag-names/html-tag-names-tests.ts b/types/html-tag-names/html-tag-names-tests.ts new file mode 100644 index 0000000000..96916aa58a --- /dev/null +++ b/types/html-tag-names/html-tag-names-tests.ts @@ -0,0 +1,3 @@ +import htmlTagNames = require("html-tag-names"); +htmlTagNames.length; //=> 147 +const firstNames: string[] = htmlTagNames.slice(0, 20); diff --git a/types/html-tag-names/index.d.ts b/types/html-tag-names/index.d.ts new file mode 100644 index 0000000000..bc7b39a193 --- /dev/null +++ b/types/html-tag-names/index.d.ts @@ -0,0 +1,2 @@ +declare const htmlTagNames: string[]; +export = htmlTagNames; diff --git a/types/html-tag-names/tsconfig.json b/types/html-tag-names/tsconfig.json new file mode 100644 index 0000000000..05cded79c8 --- /dev/null +++ b/types/html-tag-names/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "html-tag-names-tests.ts" + ] +} diff --git a/types/html-tag-names/tslint.json b/types/html-tag-names/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/html-tag-names/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 21d07f0fcfe33b45ac44efcd508af63353ce8744 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 26 Apr 2018 09:18:33 -0700 Subject: [PATCH 0898/2153] Add author header --- types/html-tag-names/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/html-tag-names/index.d.ts b/types/html-tag-names/index.d.ts index bc7b39a193..e48dda7733 100644 --- a/types/html-tag-names/index.d.ts +++ b/types/html-tag-names/index.d.ts @@ -1,2 +1,6 @@ +// Type definitions for html-tag-names 1.1.2 +// Project: https://github.com/wooorm/html-tag-names +// Definitions by: Nathan Shively-Sanders +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare const htmlTagNames: string[]; export = htmlTagNames; From 9e86892aed09bc22ea45b39c268cf565808bbad0 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 26 Apr 2018 09:21:48 -0700 Subject: [PATCH 0899/2153] Fix lint --- types/html-tag-names/html-tag-names-tests.ts | 2 +- types/html-tag-names/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/html-tag-names/html-tag-names-tests.ts b/types/html-tag-names/html-tag-names-tests.ts index 96916aa58a..b3362a6b7e 100644 --- a/types/html-tag-names/html-tag-names-tests.ts +++ b/types/html-tag-names/html-tag-names-tests.ts @@ -1,3 +1,3 @@ import htmlTagNames = require("html-tag-names"); -htmlTagNames.length; //=> 147 +htmlTagNames.length; // => 147 const firstNames: string[] = htmlTagNames.slice(0, 20); diff --git a/types/html-tag-names/index.d.ts b/types/html-tag-names/index.d.ts index e48dda7733..8c9558edb7 100644 --- a/types/html-tag-names/index.d.ts +++ b/types/html-tag-names/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for html-tag-names 1.1.2 +// Type definitions for html-tag-names 1.1 // Project: https://github.com/wooorm/html-tag-names // Definitions by: Nathan Shively-Sanders // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 2f6852e9934b141c4e4c81396240cc956a56285e Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Thu, 26 Apr 2018 19:27:03 +0200 Subject: [PATCH 0900/2153] cucumber: Transform should support multiple matches and use World as this context (#25326) * cucumber: Transform interface supports multiple matches * cucumber: Use World as this in Transform --- types/cucumber/cucumber-tests.ts | 20 ++++++++++++++++++++ types/cucumber/index.d.ts | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/types/cucumber/cucumber-tests.ts b/types/cucumber/cucumber-tests.ts index b7fa675095..41a52c6d61 100644 --- a/types/cucumber/cucumber-tests.ts +++ b/types/cucumber/cucumber-tests.ts @@ -11,6 +11,7 @@ const Status = cucumber.Status; declare module "cucumber" { interface World { visit(url: string, callback: CallbackStepDefinition): void; + toInt(value: string): number; } } @@ -21,6 +22,7 @@ function StepSampleWithoutDefineSupportCode() { this.visit = (url: string, callback: Callback) => { callback(null, 'pending'); }; + this.toInt = parseInt; }); Before((scenarioResult: HookScenarioResult, callback: Callback) => { @@ -164,6 +166,24 @@ function StepSampleWithoutDefineSupportCode() { useForSnippets: false }); + defineParameterType({ + regexp: /(one) (two)/, + transformer: (x, y) => x + y, + name: 'param', + preferForRegexpMatch: false, + useForSnippets: false + }); + + defineParameterType({ + regexp: /123/, + transformer(val) { + return this.toInt(val); + }, + name: 'param', + preferForRegexpMatch: false, + useForSnippets: false + }); + Given('a {param} step', param => { assert.equal(param, 'PARTICULAR'); }); diff --git a/types/cucumber/index.d.ts b/types/cucumber/index.d.ts index 03dda3d736..8cfed3ef31 100644 --- a/types/cucumber/index.d.ts +++ b/types/cucumber/index.d.ts @@ -129,7 +129,7 @@ export type GlobalHookCode = (callback?: CallbackStepDefinition) => void; export interface Transform { regexp: RegExp; - transformer(arg: string): any; + transformer(this: World, ...arg: string[]): any; useForSnippets?: boolean; preferForRegexpMatch?: boolean; name?: string; From b67b2df1d9fbc7a5fabfe9cc1dbb36b856ae1b3d Mon Sep 17 00:00:00 2001 From: Simon Schick Date: Thu, 26 Apr 2018 19:28:20 +0200 Subject: [PATCH 0901/2153] fix(hapi-auth-jwt2): allow validate and verify to return directly (#25306) --- types/hapi-auth-jwt2/hapi-auth-jwt2-tests.ts | 11 ++++++++++- types/hapi-auth-jwt2/index.d.ts | 12 +++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/types/hapi-auth-jwt2/hapi-auth-jwt2-tests.ts b/types/hapi-auth-jwt2/hapi-auth-jwt2-tests.ts index cf51162eb4..50b17e8db6 100644 --- a/types/hapi-auth-jwt2/hapi-auth-jwt2-tests.ts +++ b/types/hapi-auth-jwt2/hapi-auth-jwt2-tests.ts @@ -32,7 +32,7 @@ server.register({ .then(() => { const opts: hapiAuthJwt2.Options = { key: 'NeverShareYourSecret', - async validate(decoded: { id: number }, request) { + async validate(decoded: { id: number }) { return { isValid: !!users[decoded.id], }; @@ -42,5 +42,14 @@ server.register({ issuer: 'test', } }; + const opts2: hapiAuthJwt2.Options = { + key: 'NeverShareYourSecret2', + validate(decoded: { id: number }) { + return { + isValid: !!users[decoded.id], + }; + } + }; server.auth.strategy('jwt', 'jwt', opts); + server.auth.strategy('jwt2', 'jwt', opts2); }); diff --git a/types/hapi-auth-jwt2/index.d.ts b/types/hapi-auth-jwt2/index.d.ts index a93f740bfc..f980cfa6e9 100644 --- a/types/hapi-auth-jwt2/index.d.ts +++ b/types/hapi-auth-jwt2/index.d.ts @@ -39,6 +39,12 @@ declare namespace hapiAuthJwt2 { }; } + interface ValidationResult { + isValid: boolean; + credentials?: any; + response?: ResponseObject; + } + /** * Options passed to `hapi.auth.strategy` when this plugin is used */ @@ -54,11 +60,7 @@ declare namespace hapiAuthJwt2 { * @param decoded the *decoded* and *verified* JWT received from the client in *request.headers.authorization* * @param request the original *request* received from the client */ - validate(decoded: {}, request: Request, tk: ResponseToolkit): Promise<{ - isValid: boolean; - credentials?: any; - response?: ResponseObject - }>; + validate(decoded: {}, request: Request, tk: ResponseToolkit): ValidationResult | Promise; /** * Settings to define how tokens are verified by the jsonwebtoken library From 4abbfb42ff02fbdf3584f6285238d82c4ccbeb14 Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Thu, 26 Apr 2018 19:30:30 +0200 Subject: [PATCH 0902/2153] [react-native] Switch to *real* components + rename Properties to Props (#25307) * Switch from var to const * import React instead of /// * Fix TextInput and remove TextInputStatic See #16318 [react-native] Wrong type for component ref * Remove TextStatic * Remove ActivityIndicatorStatic * Remove ActivityIndicatorIOSStatic * Remove DatePickerIOSStatic * Remove DrawerLayoutAndroidStatic * Remove ImageStatic * Remove ImageBackgroundStatic * Remove InputAccessoryViewStatic * Remove ListViewStatic * Remove MapViewStatic * Remove MaskedViewStatic * Remove ModalStatic * Remove NavigatorIOSStatic * Remove PickerStatic * Remove PickerIOSStatic * Remove ProgressBarAndroidStatic * Remove ProgressViewIOSStatic * Remove RefreshControlStatic * Remove RecyclerViewBackedScrollViewStatic * Remove SafeAreaViewStatic * Remove SegmentedControlIOSStatic * Remove SliderStatic * Remove StatusBarStatic * Remove ScrollViewStatic * Remove SnapshotViewIOSStatic * Remove SwipeableListViewStatic * Remove SwitchStatic * Remove SwitchIOSStatic * Remove TabBarIOSStatic * Remove ToolbarAndroidStatic * Remove TouchableHighlightStatic * Remove TouchableNativeFeedbackStatic * Remove TouchableOpacityStatic * Remove TouchableWithoutFeedbackStatic * Remove ViewStatic * Remove ViewPagerAndroidStatic * Remove WebViewStatic * Remove ButtonStatic * Remove ClippingRectangleStatic, GroupStatic, ShapeStatic, SurfaceStatic, ARTTextStatic, ARTTextStatic * Remove KeyboardAvoidingViewStatic * Remove FlatListStatic * Rename TextProperties and friends to *Props * Rename TextInputProperties and friends to *Props * Rename WebViewProperties and friends to *Props * Rename *Properties to *Props * Rename ScrollViewProperties and friends to *Props * Improve DatePickerAndroid.open() * Rename ImagePropertiesSourceOptions to ImageSourcePropType * Rename MaskedViewProps to MaskedViewIOSProps * Rename PointProperties to PointPropType * Rename TabBarItem to TabBarIOSItem * Remove internal *Properties * ImagePropertiesSourceOptions => ImagePropsSourceOptions * Merge fail: react-native-linear-gradient has been removed * Rename ImageProperties to ImageProps * Update authors list * Remove ImagePropsSourceOptions * Move *Properties redirections to legacy-properties.d.ts --- types/expo/index.d.ts | 10 +- types/expo/v23/index.d.ts | 10 +- types/expo/v24/index.d.ts | 10 +- types/expo__vector-icons/index.d.ts | 2 +- types/react-native-drawer-layout/index.d.ts | 4 +- types/react-native-elevated-view/index.d.ts | 2 +- types/react-native-google-signin/index.d.ts | 4 +- .../index.d.ts | 4 +- types/react-native-material-kit/index.d.ts | 32 +- types/react-native-photo-view/index.d.ts | 8 +- .../index.d.ts | 4 +- types/react-native-snap-carousel/index.d.ts | 16 +- types/react-native-vector-icons/Icon.d.ts | 22 +- types/react-native-vector-icons/index.d.ts | 2 +- types/react-native-video/index.d.ts | 4 +- types/react-native/index.d.ts | 563 ++++++++---------- types/react-native/legacy-properties.d.ts | 286 +++++++++ types/react-native/test/ART.tsx | 29 + types/react-native/test/index.tsx | 35 +- types/react-native/test/legacy-properties.tsx | 5 + types/react-native/tsconfig.json | 4 +- types/react-navigation/index.d.ts | 4 +- .../react-router-native-tests.tsx | 4 +- types/react-router-navigation/index.d.ts | 4 +- 24 files changed, 660 insertions(+), 408 deletions(-) create mode 100644 types/react-native/legacy-properties.d.ts create mode 100644 types/react-native/test/ART.tsx create mode 100644 types/react-native/test/legacy-properties.tsx diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index c5beebd7f0..8093b52861 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -16,7 +16,7 @@ import { ImageRequireSource, ImageURISource, NativeEventEmitter, - ViewProperties, + ViewProps, ViewStyle, Permission, StyleProp @@ -624,7 +624,7 @@ export class PlaybackObject { /** * BarCodeScanner */ -export interface BarCodeScannerProps extends ViewProperties { +export interface BarCodeScannerProps extends ViewProps { type?: 'front' | 'back'; torchMode?: 'on' | 'off'; barCodeTypes?: string[]; @@ -645,7 +645,7 @@ export class BarCodeScanner extends Component { /** * BlurView */ -export interface BlurViewProps extends ViewProperties { +export interface BlurViewProps extends ViewProps { tint: 'light' | 'default' | 'dark'; intensity: number; } @@ -691,7 +691,7 @@ export class CameraObject { getSupportedRatiosAsync(): Promise; // Android only } -export interface CameraProps extends ViewProperties { +export interface CameraProps extends ViewProps { zoom?: FloatFromZeroToOne; ratio?: string; focusDepth?: FloatFromZeroToOne; @@ -1316,7 +1316,7 @@ export namespace Font { /** * GLView */ -export interface GLViewProps extends ViewProperties { +export interface GLViewProps extends ViewProps { onContextCreate(): void; msaaSamples: number; } diff --git a/types/expo/v23/index.d.ts b/types/expo/v23/index.d.ts index 78de7bf415..322c1b3c6a 100644 --- a/types/expo/v23/index.d.ts +++ b/types/expo/v23/index.d.ts @@ -8,7 +8,7 @@ import { EventSubscription } from 'fbemitter'; import { Component, Ref } from 'react'; import { ViewStyle, - ViewProperties, + ViewProps, ColorPropType, ImageURISource, NativeEventEmitter, @@ -341,7 +341,7 @@ export class AppLoading extends Component { } /** * BarCodeScanner */ -export interface BarCodeScannerProps extends ViewProperties { +export interface BarCodeScannerProps extends ViewProps { type?: 'front' | 'back'; torchMode?: 'on' | 'off'; barCodeTypes?: string[]; @@ -353,7 +353,7 @@ export class BarCodeScanner extends Component { } /** * BlurView */ -export interface BlurViewProps extends ViewProperties { +export interface BlurViewProps extends ViewProps { tint: 'light' | 'default' | 'dark'; intensity: number; } @@ -396,7 +396,7 @@ export class CameraObject { stopRecording(): void; getSupportedRatiosAsync(): Promise; // Android only } -export interface CameraProperties extends ViewProperties { +export interface CameraProperties extends ViewProps { flashMode?: string | number; type?: string | number; ratio?: string; @@ -896,7 +896,7 @@ export namespace Font { /** * GLView */ -export interface GLViewProps extends ViewProperties { +export interface GLViewProps extends ViewProps { onContextCreate(): void; msaaSamples: number; } diff --git a/types/expo/v24/index.d.ts b/types/expo/v24/index.d.ts index 0647519da4..e6a238d129 100644 --- a/types/expo/v24/index.d.ts +++ b/types/expo/v24/index.d.ts @@ -15,7 +15,7 @@ import { ImageRequireSource, ImageURISource, NativeEventEmitter, - ViewProperties, + ViewProps, ViewStyle, Permission, StyleProp @@ -623,7 +623,7 @@ export class PlaybackObject { /** * BarCodeScanner */ -export interface BarCodeScannerProps extends ViewProperties { +export interface BarCodeScannerProps extends ViewProps { type?: 'front' | 'back'; torchMode?: 'on' | 'off'; barCodeTypes?: string[]; @@ -644,7 +644,7 @@ export class BarCodeScanner extends Component { /** * BlurView */ -export interface BlurViewProps extends ViewProperties { +export interface BlurViewProps extends ViewProps { tint: 'light' | 'default' | 'dark'; intensity: number; } @@ -690,7 +690,7 @@ export class CameraObject { getSupportedRatiosAsync(): Promise; // Android only } -export interface CameraProps extends ViewProperties { +export interface CameraProps extends ViewProps { flashMode?: string | number; type?: string | number; ratio?: string; @@ -1302,7 +1302,7 @@ export namespace Font { /** * GLView */ -export interface GLViewProps extends ViewProperties { +export interface GLViewProps extends ViewProps { onContextCreate(): void; msaaSamples: number; } diff --git a/types/expo__vector-icons/index.d.ts b/types/expo__vector-icons/index.d.ts index 864ae1d0cc..19aadf2a33 100644 --- a/types/expo__vector-icons/index.d.ts +++ b/types/expo__vector-icons/index.d.ts @@ -5,7 +5,7 @@ // TypeScript Version: 2.6 import * as React from 'react'; -import { TextProperties } from 'react-native'; +import { TextProps } from 'react-native'; export { createIconSet, createIconSetFromFontello, createIconSetFromIcoMoon } from 'react-native-vector-icons'; export { default as Entypo } from 'react-native-vector-icons/Entypo'; diff --git a/types/react-native-drawer-layout/index.d.ts b/types/react-native-drawer-layout/index.d.ts index e77bcb268c..af3a05698e 100644 --- a/types/react-native-drawer-layout/index.d.ts +++ b/types/react-native-drawer-layout/index.d.ts @@ -5,7 +5,7 @@ // TypeScript Version: 2.6 import * as React from 'react'; -import { ViewProperties } from 'react-native'; +import { ViewProps } from 'react-native'; export type DrawerLayoutOpenEventHandler = () => void; @@ -21,7 +21,7 @@ export type DrawerLayoutSlideEventHandler = (event: DrawerLayoutSlideEvent) => v export type DrawerLayoutStateChangeEventHandler = (state: string) => void; -export interface DrawerLayoutProperties extends ViewProperties { +export interface DrawerLayoutProperties extends ViewProps { /** * Child content. */ diff --git a/types/react-native-elevated-view/index.d.ts b/types/react-native-elevated-view/index.d.ts index 4ad853294b..e9ac2b1103 100644 --- a/types/react-native-elevated-view/index.d.ts +++ b/types/react-native-elevated-view/index.d.ts @@ -7,7 +7,7 @@ import * as React from 'react'; import * as ReactNative from 'react-native'; -export interface ElevatedViewProperties extends ReactNative.ViewProperties { +export interface ElevatedViewProperties extends ReactNative.ViewProps { elevation?: number; } diff --git a/types/react-native-google-signin/index.d.ts b/types/react-native-google-signin/index.d.ts index c99a767b8a..862a40a35a 100644 --- a/types/react-native-google-signin/index.d.ts +++ b/types/react-native-google-signin/index.d.ts @@ -5,9 +5,9 @@ // TypeScript Version: 2.6 import * as React from 'react'; -import { ViewProperties } from 'react-native'; +import { ViewProps } from 'react-native'; -export interface GoogleSigninButtonProps extends ViewProperties { +export interface GoogleSigninButtonProps extends ViewProps { size?: GoogleSigninButton.Size; color?: GoogleSigninButton.Color; onPress?(): void; diff --git a/types/react-native-material-design-searchbar/index.d.ts b/types/react-native-material-design-searchbar/index.d.ts index 3c2aad9c51..23b3204c76 100644 --- a/types/react-native-material-design-searchbar/index.d.ts +++ b/types/react-native-material-design-searchbar/index.d.ts @@ -6,7 +6,7 @@ import * as React from 'react'; import { - TextInputProperties, + TextInputProps, ReturnKeyType, ReturnKeyTypeAndroid, TextStyle, @@ -28,7 +28,7 @@ export interface SearchBarProps { placeholderColor?: string; iconColor?: string; textStyle?: TextStyle; - inputProps?: TextInputProperties; + inputProps?: TextInputProps; alwaysShowBackButton?: boolean; onSearchChange?(text: string): void; onClose?(): void; diff --git a/types/react-native-material-kit/index.d.ts b/types/react-native-material-kit/index.d.ts index 79379e599a..f820d8e4cd 100644 --- a/types/react-native-material-kit/index.d.ts +++ b/types/react-native-material-kit/index.d.ts @@ -9,9 +9,9 @@ import * as React from 'react'; import { ViewStyle, TextStyle, - TextInputProperties, - TouchableWithoutFeedbackProperties, - ViewProperties, + TextInputProps, + TouchableWithoutFeedbackProps, + ViewProps, } from 'react-native'; /////////////////////////////// @@ -178,7 +178,7 @@ export namespace MKPropTypes { type rippleLocation = 'tapLocation' | 'center'; } -export interface TickProperties extends ViewProperties { +export interface TickProperties extends ViewProps { fillColor?: string; inset?: number; } @@ -251,12 +251,12 @@ export interface MKColorStatic { } export interface MKButtonProperties extends - TouchableWithoutFeedbackProperties, MKRippleProperties { + TouchableWithoutFeedbackProps, MKRippleProperties { fab?: boolean; enabled?: boolean; } -export interface MKTextFieldProperties extends TextInputProperties, FloatingLabelProperties { +export interface MKTextFieldProperties extends TextInputProps, FloatingLabelProperties { text?: string; password?: boolean; underlineEnabled?: boolean; @@ -265,11 +265,11 @@ export interface MKTextFieldProperties extends TextInputProperties, FloatingLabe tintColor?: string; textInputStyle?: TextStyle; allowFontScaling?: boolean; - additionalInputProps?: TextInputProperties; + additionalInputProps?: TextInputProps; onTextChange?(val: string): void; } -export interface MKSwitchProperties extends TouchableWithoutFeedbackProperties { +export interface MKSwitchProperties extends TouchableWithoutFeedbackProps { checked?: boolean; onColor?: string; offColor?: string; @@ -284,12 +284,12 @@ export interface MKSwitchProperties extends TouchableWithoutFeedbackProperties { onCheckedChange?(checked: boolean): void; } -export interface MKIconToggleProperties extends MKRippleProperties, TouchableWithoutFeedbackProperties { +export interface MKIconToggleProperties extends MKRippleProperties, TouchableWithoutFeedbackProps { checked?: boolean; onCheckedChange?(checked: boolean): void; } -export interface MKRippleProperties extends ViewProperties { +export interface MKRippleProperties extends ViewProps { rippleColor?: string; rippleDuration?: number; rippleLocation?: MKPropTypes.rippleLocation; @@ -301,7 +301,7 @@ export interface MKRippleProperties extends ViewProperties { shadowAniEnabled?: boolean; } -export interface MKProgressProperties extends ViewProperties { +export interface MKProgressProperties extends ViewProps { progress?: number; buffer?: number; progressColor?: string; @@ -310,12 +310,12 @@ export interface MKProgressProperties extends ViewProperties { bufferAniDuration?: number; } -export interface IndeterminateProgressProperties extends ViewProperties { +export interface IndeterminateProgressProperties extends ViewProps { progressColor?: string; progressAniDuration?: number; } -export interface BaseSlider extends ViewProperties { +export interface BaseSlider extends ViewProps { min?: number; max?: number; value?: number; @@ -340,13 +340,13 @@ export interface MKRangeSliderProperties extends BaseSlider { onChange?(curValue: { min: number, max: number }): void; } -export interface MKSpinnerProperties extends ViewProperties { +export interface MKSpinnerProperties extends ViewProps { strokeColor?: string; strokeWidth?: number; spinnerAniDuration?: number; } -export interface MKRadioButtonProperties extends MKRippleProperties, TouchableWithoutFeedbackProperties { +export interface MKRadioButtonProperties extends MKRippleProperties, TouchableWithoutFeedbackProps { borderOnColor?: string; borderOffColor?: string; fillColor?: string; @@ -356,7 +356,7 @@ export interface MKRadioButtonProperties extends MKRippleProperties, TouchableWi onCheckedChange?(opts: { checked: boolean }): void; } -export interface MKCheckboxProperties extends MKRippleProperties, TickProperties, TouchableWithoutFeedbackProperties { +export interface MKCheckboxProperties extends MKRippleProperties, TickProperties, TouchableWithoutFeedbackProps { borderOnColor?: string; borderOffColor?: string; fillColor?: string; diff --git a/types/react-native-photo-view/index.d.ts b/types/react-native-photo-view/index.d.ts index 8979635288..c3f27d78a6 100644 --- a/types/react-native-photo-view/index.d.ts +++ b/types/react-native-photo-view/index.d.ts @@ -5,11 +5,11 @@ // TypeScript Version: 2.6 import * as React from 'react'; -import { ImagePropertiesSourceOptions, ViewProperties } from 'react-native'; +import { ImageSourcePropType, ViewProps } from 'react-native'; export interface ReactNativePhotoViewProps { - source?: ImagePropertiesSourceOptions; - loadingIndicatorSource?: ImagePropertiesSourceOptions; + source?: ImageSourcePropType; + loadingIndicatorSource?: ImageSourcePropType; fadeDuration?: number; minimumZoomScale?: number; maximumZoomScale?: number; @@ -27,4 +27,4 @@ export interface ReactNativePhotoViewProps { onScale?: (scale: number, target?: React.ReactElement) => void; } -export default class ReactNativePhotoView extends React.Component {} +export default class ReactNativePhotoView extends React.Component {} diff --git a/types/react-native-scrollable-tab-view/index.d.ts b/types/react-native-scrollable-tab-view/index.d.ts index b18ee374a9..962ba8a810 100644 --- a/types/react-native-scrollable-tab-view/index.d.ts +++ b/types/react-native-scrollable-tab-view/index.d.ts @@ -6,7 +6,7 @@ // TypeScript Version: 2.6 import * as React from 'react'; -import { Animated, ScrollViewProperties, ViewStyle, TextStyle } from 'react-native'; +import { Animated, ScrollViewProps, ViewStyle, TextStyle } from 'react-native'; export interface ScrollableTabViewProperties extends React.Props { /** @@ -88,7 +88,7 @@ export interface ScrollableTabViewProperties extends React.Props>; + carouselRef?: React.Component>; itemHeight?: number; itemWidth?: number; scrollPosition?: Animated.Value; @@ -30,7 +30,7 @@ export interface AdditionalParallaxProps { vertical?: boolean; } -export interface CarouselProps extends React.Props { +export interface CarouselProps extends React.Props { // Required /** @@ -278,9 +278,9 @@ export interface CarouselStatic extends React.ComponentClass triggerRenderingHack(offset: number): void; } -export type CarouselProperties = ScrollViewProperties & CarouselProps & React.Props>; +export type CarouselProperties = ScrollViewProps & CarouselProps & React.Props>; -export interface ParallaxImageProps extends ImageProperties, AdditionalParallaxProps { +export interface ParallaxImageProps extends ImageProps, AdditionalParallaxProps { /** * Optional style for image's container */ @@ -330,7 +330,7 @@ export interface PaginationProps { * Reference to the Carousel component to which pagination is linked. * Needed only when setting tappableDots to true */ - carouselRef?: React.Component>; + carouselRef?: React.Component>; /** * Style for dots' container that will be merged with the default one */ diff --git a/types/react-native-vector-icons/Icon.d.ts b/types/react-native-vector-icons/Icon.d.ts index 4b64503452..455a3269b0 100644 --- a/types/react-native-vector-icons/Icon.d.ts +++ b/types/react-native-vector-icons/Icon.d.ts @@ -2,14 +2,14 @@ import * as React from 'react'; import { TextStyle, ViewStyle, - TextProperties, - TouchableHighlightProperties, - TouchableNativeFeedbackProperties, - TabBarItemProperties, - ToolbarAndroidProperties + TextProps, + TouchableHighlightProps, + TouchableNativeFeedbackProps, + TabBarIOSItemProps, + ToolbarAndroidProps } from 'react-native'; -export interface IconProps extends TextProperties { +export interface IconProps extends TextProps { /** * Size of the icon, can also be passed as fontSize in the style object. * @@ -32,7 +32,7 @@ export interface IconProps extends TextProperties { color?: string; } -export interface IconButtonProps extends IconProps, TouchableHighlightProperties, TouchableNativeFeedbackProperties { +export interface IconButtonProps extends IconProps, TouchableHighlightProps, TouchableNativeFeedbackProps { /** * Text and icon color * Use iconStyle or nest a Text component if you need different colors. @@ -58,7 +58,7 @@ export interface IconButtonProps extends IconProps, TouchableHighlightProperties iconStyle?: ViewStyle; /** - * Style prop inherited from TextProperties and TouchableWithoutFeedbackProperties + * Style prop inherited from TextProps and TouchableWithoutFeedbackProperties * Only exist here so we can have ViewStyle or TextStyle * */ @@ -74,7 +74,7 @@ export interface IconButtonProps extends IconProps, TouchableHighlightProperties export type ImageSource = any; -export interface ToolbarAndroidProps extends ToolbarAndroidProperties { +export interface ToolbarAndroidProps extends ToolbarAndroidProps { /** * Name of the navigation logo icon * (similar to ToolbarAndroid logo) @@ -111,7 +111,7 @@ export interface ToolbarAndroidProps extends ToolbarAndroidProperties { iconColor: string; } -export interface TabBarItemIOSProps extends TabBarItemProperties { +export interface TabBarItemIOSProps extends TabBarIOSItemProps { /** * Name of the default icon (similar to TabBarIOS.Item icon) * @@ -164,7 +164,7 @@ export class Icon extends React.Component { export namespace Icon { class ToolbarAndroid extends React.Component {} - class TabBarItem extends React.Component {} + class TabBarItem extends React.Component {} class TabBarItemIOS extends React.Component {} class Button extends React.Component {} } diff --git a/types/react-native-vector-icons/index.d.ts b/types/react-native-vector-icons/index.d.ts index 2a2ef8fdce..60e6408d18 100644 --- a/types/react-native-vector-icons/index.d.ts +++ b/types/react-native-vector-icons/index.d.ts @@ -7,7 +7,7 @@ import * as React from 'react'; import { Icon } from './Icon'; -import { TextProperties } from 'react-native'; +import { TextProps } from 'react-native'; /** * Returns your own custom font based on the glyphMap where the key is the icon name diff --git a/types/react-native-video/index.d.ts b/types/react-native-video/index.d.ts index 3ca2dc80fb..25a58a3e00 100644 --- a/types/react-native-video/index.d.ts +++ b/types/react-native-video/index.d.ts @@ -6,7 +6,7 @@ import * as React from 'react'; import { - ViewProperties + ViewProps } from 'react-native'; export interface OnLoadData { @@ -32,7 +32,7 @@ export interface LoadError { }; } -export interface VideoProperties extends ViewProperties { +export interface VideoProperties extends ViewProps { /* Native only */ src?: any; seek?: number; diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index fe73c7abae..ebd75b2089 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -9,6 +9,7 @@ // Alex Dunne // Manuel Alabor // Michele Bombardi +// Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -25,9 +26,12 @@ /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// +/// import * as React from 'react'; +type Constructor = new(...args: any[]) => T; + export type MeasureOnSuccessCallback = ( x: number, y: number, @@ -411,7 +415,8 @@ export interface NativeTouchEvent { export interface GestureResponderEvent extends NativeSyntheticEvent {} -export interface PointProperties { +// See https://facebook.github.io/react-native/docs/scrollview.html#contentoffset +export interface PointPropType { x: number; y: number; } @@ -605,7 +610,7 @@ export interface FlexStyle { * @see https://facebook.github.io/react-native/docs/layout-props.html * @see LayoutPropTypes.js */ -export interface LayoutProperties extends FlexStyle {} +export interface LayoutProps extends FlexStyle {} /** * @see ShadowPropTypesIOS.js @@ -751,7 +756,7 @@ export interface LayoutRectangle { height: number; } -// @see TextProperties.onLayout +// @see TextProps.onLayout export interface LayoutChangeEvent { nativeEvent: { layout: LayoutRectangle; @@ -794,7 +799,7 @@ export interface TextStyle extends TextStyleIOS, TextStyleAndroid, ViewStyle { testID?: string; } -export interface TextPropertiesIOS { +export interface TextPropsIOS { /** * Specifies whether fonts should scale to respect Text Size accessibility setting on iOS. The * default is `true`. @@ -818,7 +823,7 @@ export interface TextPropertiesIOS { suppressHighlighting?: boolean; } -export interface TextPropertiesAndroid { +export interface TextPropsAndroid { /** * Lets the user select text, to use the native copy and paste functionality. */ @@ -837,7 +842,7 @@ export interface TextPropertiesAndroid { } // https://facebook.github.io/react-native/docs/text.html#props -export interface TextProperties extends TextPropertiesIOS, TextPropertiesAndroid, AccessibilityProperties { +export interface TextProps extends TextPropsIOS, TextPropsAndroid, AccessibilityProps { /** * This can be one of the following values: * @@ -905,7 +910,9 @@ export interface TextProperties extends TextPropertiesIOS, TextPropertiesAndroid /** * A React component for displaying text which supports nesting, styling, and touch handling. */ -export interface TextStatic extends NativeMethodsMixin, React.ClassicComponentClass {} +declare class TextComponent extends React.Component {} +declare const TextBase: Constructor & typeof TextComponent; +export class Text extends TextBase {} type DataDetectorTypes = "phoneNumber" | "link" | "address" | "calendarEvent" | "none" | "all"; @@ -952,7 +959,7 @@ export interface DocumentSelectionState extends EventEmitter { * IOS Specific properties for TextInput * @see https://facebook.github.io/react-native/docs/textinput.html#props */ -export interface TextInputIOSProperties { +export interface TextInputIOSProps { /** * enum('never', 'while-editing', 'unless-editing', 'always') * When the clear button should appear on the right side of the text view @@ -1015,7 +1022,7 @@ export interface TextInputIOSProperties { * Android Specific properties for TextInput * @see https://facebook.github.io/react-native/docs/textinput.html#props */ -export interface TextInputAndroidProperties { +export interface TextInputAndroidProps { /** * When false, if there is a small amount of space available around a text input (e.g. landscape orientation on a phone), * the OS may choose to have the user edit the text inside of a full screen text input mode. @@ -1079,8 +1086,8 @@ export type ReturnKeyTypeOptions = ReturnKeyType | ReturnKeyTypeAndroid | Return /** * @see https://facebook.github.io/react-native/docs/textinput.html#props */ -export interface TextInputProperties - extends ViewProperties, TextInputIOSProperties, TextInputAndroidProperties, AccessibilityProperties { +export interface TextInputProps + extends ViewProps, TextInputIOSProps, TextInputAndroidProps, AccessibilityProps { /** * Can tell TextInput to automatically capitalize certain characters. * characters: all characters, @@ -1297,7 +1304,9 @@ interface TextInputState { /** * @see https://facebook.github.io/react-native/docs/textinput.html#methods */ -export interface TextInputStatic extends NativeMethodsMixin, TimerMixin, React.ComponentClass { +declare class TextInputComponent extends React.Component {} +declare const TextInputBase: Constructor & Constructor & typeof TextInputComponent; +export class TextInput extends TextInputBase { State: TextInputState; /** @@ -1333,7 +1342,7 @@ export type ToolbarAndroidAction = { showWithText?: boolean; }; -export interface ToolbarAndroidProperties extends ViewProperties { +export interface ToolbarAndroidProps extends ViewProps { /** * Sets possible actions on the toolbar as part of the action menu. These are displayed as icons * or text on the right side of the widget. If they don't fit they are placed in an 'overflow' @@ -1446,7 +1455,9 @@ export interface ToolbarAndroidProperties extends ViewProperties { * * [0]: https://developer.android.com/reference/android/support/v7/widget/Toolbar.html */ -export interface ToolbarAndroidStatic extends NativeMethodsMixin, React.ComponentClass {} +declare class ToolbarAndroidComponent extends React.Component {} +declare const ToolbarAndroidBase: Constructor & typeof ToolbarAndroidComponent; +export class ToolbarAndroid extends ToolbarAndroidBase {} /** * Gesture recognition on mobile devices is much more complicated than web. @@ -1595,7 +1606,7 @@ export interface ViewStyle extends FlexStyle, TransformsStyle { testID?: string; } -export interface ViewPropertiesIOS { +export interface ViewPropsIOS { /** * A Boolean value indicating whether VoiceOver should ignore the elements within views that are siblings of the receiver. * @platform ios @@ -1628,7 +1639,7 @@ export interface ViewPropertiesIOS { shouldRasterizeIOS?: boolean; } -export interface ViewPropertiesAndroid { +export interface ViewPropsAndroid { /** * Views that are only used to layout their children or otherwise don't draw anything * may be automatically removed from the native hierarchy as an optimization. @@ -1671,7 +1682,7 @@ export type StyleProp = T | RegisteredStyle | RecursiveArray, android.view, etc. */ -export interface ViewStatic extends NativeMethodsMixin, React.ClassicComponentClass { +declare class ViewComponent extends React.Component {} +declare const ViewBase: Constructor & typeof ViewComponent; +export class View extends ViewBase { /** * Is 3D Touch / Force Touch available (i.e. will touch events include `force`) * @platform ios @@ -1849,7 +1862,7 @@ export interface ViewPagerAndroidOnPageSelectedEventData { position: number; } -export interface ViewPagerAndroidProperties extends ViewProperties { +export interface ViewPagerAndroidProps extends ViewProps { /** * Index of initial page that should be selected. Use `setPage` method to * update the page, and `onPageSelected` to monitor page changes @@ -1905,7 +1918,9 @@ export interface ViewPagerAndroidProperties extends ViewProperties { pageMargin?: number; } -export interface ViewPagerAndroidStatic extends NativeMethodsMixin, React.ComponentClass { +declare class ViewPagerAndroidComponent extends React.Component {} +declare const ViewPagerAndroidBase: Constructor & typeof ViewPagerAndroidComponent; +export class ViewPagerAndroid extends ViewPagerAndroidBase { /** * A helper function to scroll to a specific page in the ViewPager. * The transition between pages will be animated. @@ -1923,11 +1938,11 @@ export interface ViewPagerAndroidStatic extends NativeMethodsMixin, React.Compon * It is a component to solve the common problem of views that need to move out of the way of the virtual keyboard. * It can automatically adjust either its position or bottom padding based on the position of the keyboard. */ -export interface KeyboardAvoidingViewStatic - extends TimerMixin, - React.ClassicComponentClass {} +declare class KeyboardAvoidingViewComponent extends React.Component {} +declare const KeyboardAvoidingViewBase: Constructor & typeof KeyboardAvoidingViewComponent; +export class KeyboardAvoidingView extends KeyboardAvoidingViewBase {} -export interface KeyboardAvoidingViewProps extends ViewProperties { +export interface KeyboardAvoidingViewProps extends ViewProps { behavior?: "height" | "position" | "padding"; /** @@ -1965,7 +1980,7 @@ export interface WebViewMessageEventData { data: string; } -export interface WebViewPropertiesAndroid { +export interface WebViewPropsAndroid { /** * Used for android only, JS is enabled by default for WebView on iOS */ @@ -2003,7 +2018,7 @@ export interface WebViewIOSLoadRequestEvent { url: string; } -export interface WebViewPropertiesIOS { +export interface WebViewPropsIOS { /** * Determines whether HTML5 videos play inline or use the native * full-screen controller. default value false @@ -2104,7 +2119,7 @@ export interface WebViewHtmlSource { /** * @see https://facebook.github.io/react-native/docs/webview.html#props */ -export interface WebViewProperties extends ViewProperties, WebViewPropertiesAndroid, WebViewPropertiesIOS { +export interface WebViewProps extends ViewProps, WebViewPropsAndroid, WebViewPropsIOS { /** * Controls whether to adjust the content inset for web views that are * placed behind a navigation bar, tab bar, or toolbar. The default value @@ -2162,12 +2177,12 @@ export interface WebViewProperties extends ViewProperties, WebViewPropertiesAndr /** * Function that returns a view to show if there's an error. */ - renderError?: () => React.ReactElement; + renderError?: () => React.ReactElement; /** * Function that returns a loading indicator. */ - renderLoading?: () => React.ReactElement; + renderLoading?: () => React.ReactElement; /** * Boolean value that forces the `WebView` to show the loading view @@ -2194,7 +2209,7 @@ export interface WebViewProperties extends ViewProperties, WebViewPropertiesAndr scalesPageToFit?: boolean; } -export interface WebViewStatic extends React.ClassicComponentClass { +export class WebView extends React.Component { /** * Go back one page in the webview's history. */ @@ -2241,7 +2256,7 @@ export interface NativeSegmentedControlIOSChangeEvent { target: number; } -export interface SegmentedControlIOSProperties extends ViewProperties { +export interface SegmentedControlIOSProps extends ViewProps { /** * If false the user won't be able to interact with the control. Default value is true. */ @@ -2286,7 +2301,9 @@ export interface SegmentedControlIOSProperties extends ViewProperties { * Moreover, and most importantly, Safe Area's paddings feflect physical limitation of the screen, * such as rounded corners or camera notches (aka sensor housing area on iPhone X). */ -export interface SafeAreaViewStatic extends NativeMethodsMixin, React.ClassicComponentClass {} +declare class SafeAreaViewComponent extends React.Component {} +declare const SafeAreaViewBase: Constructor & typeof SafeAreaViewComponent; +export class SafeAreaView extends SafeAreaViewBase {} /** @@ -2296,9 +2313,9 @@ export interface SafeAreaViewStatic extends NativeMethodsMixin, React.ClassicCom * To use this component wrap your custom toolbar with the InputAccessoryView component, and set a nativeID. Then, pass * that nativeID as the inputAccessoryViewID of whatever TextInput you desire. */ -export interface InputAccessoryViewStatic extends React.ClassicComponentClass {} +export class InputAccessoryView extends React.Component {} -export interface InputAccessoryViewProperties { +export interface InputAccessoryViewProps { backgroundColor?: string; /** @@ -2329,11 +2346,11 @@ export interface InputAccessoryViewProperties { * /> * ```` */ -export interface SegmentedControlIOSStatic - extends NativeMethodsMixin, - React.ClassicComponentClass {} +declare class SegmentedControlIOSComponent extends React.Component {} +declare const SegmentedControlIOSBase: Constructor & typeof SegmentedControlIOSComponent; +export class SegmentedControlIOS extends SegmentedControlIOSBase {} -export interface NavigatorIOSProperties { +export interface NavigatorIOSProps { /** * The default background color of the navigation bar. */ @@ -2403,7 +2420,7 @@ export interface NavigatorIOSProperties { * * @see https://facebook.github.io/react-native/docs/navigatorios.html#navigator */ -export interface NavigationIOS { +export class NavigatorIOS extends React.Component { /** * Navigate forward to a new route */ @@ -2450,12 +2467,10 @@ export interface NavigationIOS { popToTop(): void; } -export interface NavigatorIOSStatic extends NavigationIOS, React.ComponentClass {} - /** * @see https://facebook.github.io/react-native/docs/activityindicator.html#props */ -export interface ActivityIndicatorProperties extends ViewProperties { +export interface ActivityIndicatorProps extends ViewProps { /** * Whether to show the indicator (true, the default) or hide it (false). */ @@ -2482,14 +2497,14 @@ export interface ActivityIndicatorProperties extends ViewProperties { style?: StyleProp; } -export interface ActivityIndicatorStatic - extends NativeMethodsMixin, - React.ClassicComponentClass {} +declare class ActivityIndicatorComponent extends React.Component {} +declare const ActivityIndicatorBase: Constructor & typeof ActivityIndicatorComponent; +export class ActivityIndicator extends ActivityIndicatorBase {} /** * @see https://facebook.github.io/react-native/docs/activityindicatorios.html#props */ -export interface ActivityIndicatorIOSProperties extends ViewProperties { +export interface ActivityIndicatorIOSProps extends ViewProps { /** * Whether to show the indicator (true, the default) or hide it (false). */ @@ -2524,9 +2539,9 @@ export interface ActivityIndicatorIOSProperties extends ViewProperties { /** * @Deprecated since version 0.28.0 */ -export interface ActivityIndicatorIOSStatic extends React.ComponentClass {} +export class ActivityIndicatorIOS extends React.Component {} -export interface DatePickerIOSProperties extends ViewProperties { +export interface DatePickerIOSProps extends ViewProps { /** * The currently selected date. */ @@ -2576,14 +2591,16 @@ export interface DatePickerIOSProperties extends ViewProperties { timeZoneOffsetInMinutes?: number; } -export interface DatePickerIOSStatic extends NativeMethodsMixin, React.ComponentClass {} +declare class DatePickerIOSComponent extends React.Component {} +declare const DatePickerIOSBase: Constructor & typeof DatePickerIOSComponent; +export class DatePickerIOS extends TextInputBase {} export interface DrawerSlideEvent extends NativeSyntheticEvent {} /** * @see DrawerLayoutAndroid.android.js */ -export interface DrawerLayoutAndroidProperties extends ViewProperties { +export interface DrawerLayoutAndroidProps extends ViewProps { /** * Specifies the background color of the drawer. The default value * is white. If you want to set the opacity of the drawer, use rgba. @@ -2677,9 +2694,9 @@ interface DrawerPosition { Right: number; } -export interface DrawerLayoutAndroidStatic - extends NativeMethodsMixin, - React.ClassicComponentClass { +declare class DrawerLayoutAndroidComponent extends React.Component {} +declare const DrawerLayoutAndroidBase: Constructor & typeof DrawerLayoutAndroidComponent; +export class DrawerLayoutAndroid extends DrawerLayoutAndroidBase { /** * drawer's positions. */ @@ -2699,7 +2716,7 @@ export interface DrawerLayoutAndroidStatic /** * @see PickerIOS.ios.js */ -export interface PickerIOSItemProperties { +export interface PickerIOSItemProps { value?: string | number; label?: string; } @@ -2707,21 +2724,21 @@ export interface PickerIOSItemProperties { /** * @see PickerIOS.ios.js */ -export interface PickerIOSItemStatic extends React.ComponentClass {} +export class PickerIOSItem extends React.Component {} /** * @see Picker.js */ -export interface PickerItemProperties { +export interface PickerItemProps { testID?: string; color?: string; label: string; value?: any; } -export interface PickerItem extends React.ComponentClass {} +export class PickerItem extends React.Component {} -export interface PickerPropertiesIOS extends ViewProperties { +export interface PickerPropsIOS extends ViewProps { /** * Style to apply to each of the item labels. * @platform ios @@ -2729,7 +2746,7 @@ export interface PickerPropertiesIOS extends ViewProperties { itemStyle?: StyleProp; } -export interface PickerPropertiesAndroid extends ViewProperties { +export interface PickerPropsAndroid extends ViewProps { /** * If set to false, the picker will be disabled, i.e. the user will not be able to make a * selection. @@ -2758,7 +2775,7 @@ export interface PickerPropertiesAndroid extends ViewProperties { * @see https://facebook.github.io/react-native/docs/picker.html * @see Picker.js */ -export interface PickerProperties extends PickerPropertiesIOS, PickerPropertiesAndroid { +export interface PickerProps extends PickerPropsIOS, PickerPropsAndroid { /** * Callback for when an item is selected. This is called with the * following parameters: @@ -2785,7 +2802,7 @@ export interface PickerProperties extends PickerPropertiesIOS, PickerPropertiesA * @see https://facebook.github.io/react-native/docs/picker.html * @see Picker.js */ -export interface PickerStatic extends React.ComponentClass { +export class Picker extends React.Component { /** * On Android, display the options in a dialog. */ @@ -2795,14 +2812,14 @@ export interface PickerStatic extends React.ComponentClass { */ MODE_DROPDOWN: string; - Item: PickerItem; + static Item: typeof PickerItem; } /** * @see https://facebook.github.io/react-native/docs/pickerios.html * @see PickerIOS.ios.js */ -export interface PickerIOSProperties extends ViewProperties { +export interface PickerIOSProps extends ViewProps { itemStyle?: StyleProp; onValueChange?: (value: string | number) => void; selectedValue?: string | number; @@ -2812,15 +2829,17 @@ export interface PickerIOSProperties extends ViewProperties { * @see https://facebook.github.io/react-native/docs/pickerios.html * @see PickerIOS.ios.js */ -export interface PickerIOSStatic extends NativeMethodsMixin, React.ClassicComponentClass { - Item: PickerIOSItemStatic; +declare class PickerIOSComponent extends React.Component {} +declare const PickerIOSBase: Constructor & typeof PickerIOSComponent; +export class PickerIOS extends PickerIOSBase { + static Item: typeof PickerIOSItem; } /** * @see https://facebook.github.io/react-native/docs/progressbarandroid.html * @see ProgressBarAndroid.android.js */ -export interface ProgressBarAndroidProperties extends ViewProperties { +export interface ProgressBarAndroidProps extends ViewProps { /** * Style of the ProgressBar. One of: Horizontal @@ -2858,15 +2877,15 @@ export interface ProgressBarAndroidProperties extends ViewProperties { * React component that wraps the Android-only `ProgressBar`. This component is used to indicate * that the app is loading or there is some activity in the app. */ -export interface ProgressBarAndroidStatic - extends NativeMethodsMixin, - React.ClassicComponentClass {} +declare class ProgressBarAndroidComponent extends React.Component {} +declare const ProgressBarAndroidBase: Constructor & typeof ProgressBarAndroidComponent; +export class ProgressBarAndroid extends ProgressBarAndroidBase {} /** * @see https://facebook.github.io/react-native/docs/progressviewios.html * @see ProgressViewIOS.ios.js */ -export interface ProgressViewIOSProperties extends ViewProperties { +export interface ProgressViewIOSProps extends ViewProps { /** * The progress bar style. */ @@ -2897,11 +2916,11 @@ export interface ProgressViewIOSProperties extends ViewProperties { */ trackImage?: ImageURISource | ImageURISource[]; } -export interface ProgressViewIOSStatic - extends NativeMethodsMixin, - React.ClassicComponentClass {} +declare class ProgressViewIOSComponent extends React.Component {} +declare const ProgressViewIOSBase: Constructor & typeof ProgressViewIOSComponent; +export class ProgressViewIOS extends ProgressViewIOSBase {} -export interface RefreshControlPropertiesIOS extends ViewProperties { +export interface RefreshControlPropsIOS extends ViewProps { /** * The color of the refresh indicator. */ @@ -2918,7 +2937,7 @@ export interface RefreshControlPropertiesIOS extends ViewProperties { titleColor?: string; } -export interface RefreshControlPropertiesAndroid extends ViewProperties { +export interface RefreshControlPropsAndroid extends ViewProps { /** * The colors (at least one) that will be used to draw the refresh indicator. */ @@ -2946,7 +2965,7 @@ export interface RefreshControlPropertiesAndroid extends ViewProperties { progressViewOffset?: number; } -export interface RefreshControlProperties extends RefreshControlPropertiesIOS, RefreshControlPropertiesAndroid { +export interface RefreshControlProps extends RefreshControlPropsIOS, RefreshControlPropsAndroid { /** * Called when the view starts refreshing. */ @@ -2966,13 +2985,13 @@ export interface RefreshControlProperties extends RefreshControlPropertiesIOS, R * __Note:__ `refreshing` is a controlled prop, this is why it needs to be set to true * in the `onRefresh` function otherwise the refresh indicator will stop immediately. */ -export interface RefreshControlStatic - extends NativeMethodsMixin, - React.ClassicComponentClass { +declare class RefreshControlComponent extends React.Component {} +declare const RefreshControlBase: Constructor & typeof RefreshControlComponent; +export class RefreshControl extends RefreshControlBase { SIZE: Object; // Undocumented } -export interface RecyclerViewBackedScrollViewProperties extends ScrollViewProperties {} +export interface RecyclerViewBackedScrollViewProps extends ScrollViewProps {} /** * Wrapper around android native recycler view. @@ -2988,9 +3007,9 @@ export interface RecyclerViewBackedScrollViewProperties extends ScrollViewProper * use it pass this component as `renderScrollComponent` to the list view. For * now only horizontal scrolling is supported. */ -export interface RecyclerViewBackedScrollViewStatic - extends ScrollResponderMixin, - React.ClassicComponentClass { +declare class RecyclerViewBackedScrollViewComponent extends React.Component {} +declare const RecyclerViewBackedScrollViewBase: Constructor & typeof RecyclerViewBackedScrollViewComponent; +export class RecyclerViewBackedScrollView extends RecyclerViewBackedScrollViewBase { /** * A helper function to scroll to a specific point in the scrollview. * This is currently used to help focus on child textviews, but can also @@ -3013,14 +3032,14 @@ export interface RecyclerViewBackedScrollViewStatic getScrollResponder(): JSX.Element; } -export interface SliderPropertiesAndroid extends ViewProperties { +export interface SliderPropsAndroid extends ViewProps { /** * Color of the foreground switch grip. */ thumbTintColor?: string; } -export interface SliderPropertiesIOS extends ViewProperties { +export interface SliderPropsIOS extends ViewProps { /** * Assigns a maximum track image. Only static images are supported. * The leftmost pixel of the image will be stretched to fill the track. @@ -3046,7 +3065,7 @@ export interface SliderPropertiesIOS extends ViewProperties { trackImage?: ImageURISource; } -export interface SliderProperties extends SliderPropertiesIOS, SliderPropertiesAndroid { +export interface SliderProps extends SliderPropsIOS, SliderPropsAndroid { /** * If true the user won't be able to move the slider. * Default value is false. @@ -3113,12 +3132,15 @@ export interface SliderProperties extends SliderPropertiesIOS, SliderPropertiesA /** * A component used to select a single value from a range of values. */ -export interface SliderStatic extends NativeMethodsMixin, React.ClassicComponentClass {} +declare class SliderComponent extends React.Component {} +declare const SliderBase: Constructor & typeof SliderComponent; +export class Slider extends TextBase {} +export type SliderIOS = Slider; /** * https://facebook.github.io/react-native/docs/switchios.html#props */ -export interface SwitchIOSProperties extends ViewProperties { +export interface SwitchIOSProps extends ViewProps { /** * If true the user won't be able to toggle the switch. Default value is false. */ @@ -3159,7 +3181,7 @@ export interface SwitchIOSProperties extends ViewProperties { * * @see https://facebook.github.io/react-native/docs/switchios.html */ -export interface SwitchIOSStatic extends React.ComponentClass {} +export class SwitchIOS extends React.Component {} export type ImageResizeMode = "contain" | "cover" | "stretch" | "center" | "repeat"; @@ -3293,7 +3315,7 @@ export interface ImageURISource { export type ImageRequireSource = number; -export interface ImagePropertiesIOS { +export interface ImagePropsIOS { /** * blurRadius: the blur radius of the blur filter added to the image * @platform ios @@ -3327,7 +3349,7 @@ export interface ImagePropertiesIOS { onPartialLoad?: () => void; } -interface ImagePropertiesAndroid { +interface ImagePropsAndroid { /** * The mechanism that should be used to resize the image when the image's dimensions * differ from the image view's dimensions. Defaults to auto. @@ -3349,11 +3371,13 @@ interface ImagePropertiesAndroid { fadeDuration?: number; } +// See https://facebook.github.io/react-native/docs/image.html#source +export type ImageSourcePropType = ImageURISource | ImageURISource[] | ImageRequireSource; + /** * @see https://facebook.github.io/react-native/docs/image.html */ -export type ImagePropertiesSourceOptions = ImageURISource | ImageURISource[] | ImageRequireSource; -export interface ImageProperties extends ImagePropertiesIOS, ImagePropertiesAndroid, AccessibilityProperties, LayoutProperties { +export interface ImageProps extends ImagePropsIOS, ImagePropsAndroid, AccessibilityProps, LayoutProps { /** * onLayout function * @@ -3441,14 +3465,15 @@ export interface ImageProperties extends ImagePropertiesIOS, ImagePropertiesAndr resizeMethod?: "auto" | "resize" | "scale"; /** - * `uri` is a string representing the resource identifier for the image, which - * could be an http address, a local file path, or a static image - * resource (which should be wrapped in the `require('./path/to/image.png')` function). - * This prop can also contain several remote `uri`, specified together with - * their width and height. The native side will then choose the best `uri` to display - * based on the measured size of the image container. + * The image source (either a remote URL or a local file resource). + * + * This prop can also contain several remote URLs, specified together with their width and height and potentially with scale/other URI arguments. + * The native side will then choose the best uri to display based on the measured size of the image container. + * A cache property can be added to control how networked request interacts with the local cache. + * + * The currently supported formats are png, jpg, jpeg, bmp, gif, webp (Android only), psd (iOS only). */ - source: ImagePropertiesSourceOptions; + source: ImageSourcePropType; /** * similarly to `source`, this property represents the resource used to render @@ -3469,7 +3494,9 @@ export interface ImageProperties extends ImagePropertiesIOS, ImagePropertiesAndr testID?: string; } -export interface ImageStatic extends NativeMethodsMixin, React.ComponentClass { +declare class ImageComponent extends React.Component {} +declare const ImageBase: Constructor & typeof ImageComponent; +export class Image extends ImageBase { resizeMode: ImageResizeMode; getSize(uri: string, success: (width: number, height: number) => void, failure: (error: any) => void): any; prefetch(url: string): any; @@ -3477,12 +3504,14 @@ export interface ImageStatic extends NativeMethodsMixin, React.ComponentClass>; } -export interface ImageBackgroundProperties extends ImageProperties { +export interface ImageBackgroundProps extends ImageProps { style?: StyleProp; imageStyle?: StyleProp; } -export interface ImageBackgroundStatic extends NativeMethodsMixin, React.ComponentClass { +declare class ImageBackgroundComponent extends React.Component {} +declare const ImageBackgroundBase: Constructor & typeof ImageBackgroundComponent; +export class ImageBackground extends ImageBackgroundBase { resizeMode: ImageResizeMode; getSize(uri: string, success: (width: number, height: number) => void, failure: (error: any) => void): any; prefetch(url: string): any; @@ -3545,7 +3574,7 @@ export interface ListRenderItemInfo { export type ListRenderItem = (info: ListRenderItemInfo) => React.ReactElement | null; -export interface FlatListProperties extends VirtualizedListProperties { +export interface FlatListProps extends VirtualizedListProps { /** * Rendered in between each item, but not at the top or bottom */ @@ -3693,7 +3722,7 @@ export interface FlatListProperties extends VirtualizedListProperties extends React.ComponentClass> { +export class FlatList extends React.Component> { /** * Exports some data, e.g. for perf investigations or analytics. */ @@ -3762,7 +3791,7 @@ export interface SectionListScrollParams { viewPosition?: number; } -export interface SectionListProperties extends ScrollViewProperties { +export interface SectionListProps extends ScrollViewProps { /** * Rendered in between adjacent Items within each section. */ @@ -3856,7 +3885,7 @@ export interface SectionListProperties extends ScrollViewProperties { /** * Render a custom scroll component, e.g. with a differently styled `RefreshControl`. */ - renderScrollComponent?: (props: ScrollViewProperties) => React.ReactElement; + renderScrollComponent?: (props: ScrollViewProps) => React.ReactElement; /** * Note: may have bugs (missing content) in some circumstances - use at your own risk. @@ -3879,12 +3908,12 @@ export interface SectionListProperties extends ScrollViewProperties { scrollToLocation?(params: SectionListScrollParams): void; } -export interface SectionListStatic extends React.ComponentClass> {} +export interface SectionListStatic extends React.ComponentClass> {} /** * @see https://facebook.github.io/react-native/docs/virtualizedlist.html#props */ -export interface VirtualizedListProperties extends ScrollViewProperties { +export interface VirtualizedListProps extends ScrollViewProps { /** * Rendered when the list is empty. Can be a React Component Class, a render function, or * a rendered element. @@ -4033,7 +4062,7 @@ export interface VirtualizedListProperties extends ScrollViewProperties { /** * Render a custom scroll component, e.g. with a differently styled `RefreshControl`. */ - renderScrollComponent?: (props: ScrollViewProperties) => React.ReactElement; + renderScrollComponent?: (props: ScrollViewProps) => React.ReactElement; /** * Amount of time between low-pri item render batches, e.g. for rendering items quite a ways off @@ -4056,7 +4085,7 @@ export interface VirtualizedListProperties extends ScrollViewProperties { /** * @see https://facebook.github.io/react-native/docs/listview.html#props */ -export interface ListViewProperties extends ScrollViewProperties { +export interface ListViewProps extends ScrollViewProps { /** * An instance of [ListView.DataSource](docs/listviewdatasource.html) to use */ @@ -4154,7 +4183,7 @@ export interface ListViewProperties extends ScrollViewProperties { * A function that returns the scrollable component in which the list rows are rendered. * Defaults to returning a ScrollView with the given props. */ - renderScrollComponent?: (props: ScrollViewProperties) => React.ReactElement; + renderScrollComponent?: (props: ScrollViewProps) => React.ReactElement; /** * (sectionData, sectionID) => renderable @@ -4216,7 +4245,9 @@ interface TimerMixin { cancelAnimationFrame: typeof cancelAnimationFrame; } -export interface ListViewStatic extends ScrollResponderMixin, TimerMixin, React.ComponentClass { +declare class ListViewComponent extends React.Component {} +declare const ListViewBase: Constructor & Constructor & typeof ListViewComponent; +export class ListView extends ListViewBase { DataSource: ListViewDataSource; /** @@ -4280,7 +4311,7 @@ export interface MapViewOverlay { id?: string; } -export interface MapViewProperties extends ViewProperties { +export interface MapViewProps extends ViewProps { /** * If false points of interest won't be displayed on the map. * Default value is true. @@ -4405,7 +4436,9 @@ export interface MapViewProperties extends ViewProperties { /** * @see https://facebook.github.io/react-native/docs/mapview.html#content */ -export interface MapViewStatic extends NativeMethodsMixin, React.ComponentClass { +declare class MapViewComponent extends React.Component {} +declare const MapViewBase: Constructor & typeof MapViewComponent; +export class MapView extends MapViewBase { PinColors: { RED: string; GREEN: string; @@ -4413,16 +4446,18 @@ export interface MapViewStatic extends NativeMethodsMixin, React.ComponentClass< }; } -interface MaskedViewProperties extends ViewProperties { +interface MaskedViewIOSProps extends ViewProps { maskElement: React.ReactElement; } /** * @see https://facebook.github.io/react-native/docs/maskedviewios.html */ -export interface MaskedViewStatic extends NativeMethodsMixin, React.ComponentClass {} +declare class MaskedViewComponent extends React.Component {} +declare const MaskedViewBase: Constructor & typeof MaskedViewComponent; +export class MaskedViewIOS extends MaskedViewBase {} -export interface ModalProperties { +export interface ModalProps { // Only `animated` is documented. The JS code says `animated` is // deprecated and `animationType` is preferred. animated?: boolean; @@ -4481,7 +4516,7 @@ export interface ModalProperties { presentationStyle?: "fullScreen" | "pageSheet" | "formSheet" | "overFullScreen"; } -export interface ModalStatic extends React.ComponentClass {} +export class Modal extends React.Component {} /** * @see https://github.com/facebook/react-native/blob/0.34-stable\Libraries\Components\Touchable\Touchable.js @@ -4544,7 +4579,7 @@ interface TouchableMixin { /** * @see https://facebook.github.io/react-native/docs/touchablewithoutfeedback.html#props */ -export interface TouchableWithoutFeedbackProperties extends AccessibilityProperties { +export interface TouchableWithoutFeedbackProps extends AccessibilityProps { /** * Delay in ms, from onPressIn, before onLongPress is called. */ @@ -4613,8 +4648,6 @@ export interface TouchableWithoutFeedbackProperties extends AccessibilityPropert testID?: string; } -export interface TouchableWithoutFeedbackProps extends TouchableWithoutFeedbackProperties {} - /** * Do not use unless you have a very good reason. * All the elements that respond to press should have a visual feedback when touched. @@ -4622,15 +4655,14 @@ export interface TouchableWithoutFeedbackProps extends TouchableWithoutFeedbackP * * @see https://facebook.github.io/react-native/docs/touchablewithoutfeedback.html */ -export interface TouchableWithoutFeedbackStatic - extends TimerMixin, - TouchableMixin, - React.ClassicComponentClass {} +declare class TouchableWithoutFeedbackComponent extends React.Component {} +declare const TouchableWithoutFeedbackBase: Constructor & Constructor & typeof TouchableWithoutFeedbackComponent; +export class TouchableWithoutFeedback extends TouchableWithoutFeedbackBase {} /** * @see https://facebook.github.io/react-native/docs/touchablehighlight.html#props */ -export interface TouchableHighlightProperties extends TouchableWithoutFeedbackProperties { +export interface TouchableHighlightProps extends TouchableWithoutFeedbackProps { /** * Determines what the opacity of the wrapped view should be when touch is active. */ @@ -4671,16 +4703,14 @@ export interface TouchableHighlightProperties extends TouchableWithoutFeedbackPr * * @see https://facebook.github.io/react-native/docs/touchablehighlight.html */ -export interface TouchableHighlightStatic - extends NativeMethodsMixin, - TimerMixin, - TouchableMixin, - React.ClassicComponentClass {} +declare class TouchableHighlightComponent extends React.Component {} +declare const TouchableHighlightBase: Constructor & Constructor & Constructor & typeof TouchableHighlightComponent; +export class TouchableHighlight extends TouchableHighlightBase {} /** * @see https://facebook.github.io/react-native/docs/touchableopacity.html#props */ -export interface TouchableOpacityProperties extends TouchableWithoutFeedbackProperties { +export interface TouchableOpacityProps extends TouchableWithoutFeedbackProps { /** * Determines what the opacity of the wrapped view should be when touch is active. * Defaults to 0.2 @@ -4696,11 +4726,9 @@ export interface TouchableOpacityProperties extends TouchableWithoutFeedbackProp * * @see https://facebook.github.io/react-native/docs/touchableopacity.html */ -export interface TouchableOpacityStatic - extends TimerMixin, - TouchableMixin, - NativeMethodsMixin, - React.ClassicComponentClass { +declare class TouchableOpacityComponent extends React.Component {} +declare const TouchableOpacityBase: Constructor & Constructor & Constructor & typeof TouchableOpacityComponent; +export class TouchableOpacity extends TouchableOpacityBase { /** * Animate the touchable to a new opacity. */ @@ -4727,7 +4755,7 @@ type BackgroundPropType = RippleBackgroundPropType | ThemeAttributeBackgroundPro /** * @see https://facebook.github.io/react-native/docs/touchableopacity.html#props */ -export interface TouchableNativeFeedbackProperties extends TouchableWithoutFeedbackProperties { +export interface TouchableNativeFeedbackProps extends TouchableWithoutFeedbackProps { /** * Determines the type of background drawable that's going to be used to display feedback. * It takes an object with type property and extra data depending on the type. @@ -4756,9 +4784,9 @@ export interface TouchableNativeFeedbackProperties extends TouchableWithoutFeedb * * @see https://facebook.github.io/react-native/docs/touchablenativefeedback.html#content */ -export interface TouchableNativeFeedbackStatic - extends TouchableMixin, - React.ClassicComponentClass { +declare class TouchableNativeFeedbackComponent extends React.Component {} +declare const TouchableNativeFeedbackBase: Constructor & typeof TouchableNativeFeedbackComponent; +export class TouchableNativeFeedback extends TouchableNativeFeedbackBase { /** * Creates an object that represents android theme's default background for * selectable elements (?android:attr/selectableItemBackground). @@ -5121,7 +5149,7 @@ export interface ListViewDataSource { /** * @see https://facebook.github.io/react-native/docs/tabbarios-item.html#props */ -export interface TabBarItemProperties extends ViewProperties { +export interface TabBarIOSItemProps extends ViewProps { /** * Little red bubble that sits at the top right of the icon. */ @@ -5191,12 +5219,12 @@ export interface TabBarItemProperties extends ViewProperties { title?: string; } -export interface TabBarItemStatic extends React.ComponentClass {} +export class TabBarIOSItem extends React.Component {} /** * @see https://facebook.github.io/react-native/docs/tabbarios.html#props */ -export interface TabBarIOSProperties extends ViewProperties { +export interface TabBarIOSProps extends ViewProps { /** * Background color of the tab bar */ @@ -5234,8 +5262,8 @@ export interface TabBarIOSProperties extends ViewProperties { unselectedItemTintColor?: string; } -export interface TabBarIOSStatic extends React.ComponentClass { - Item: TabBarItemStatic; +export class TabBarIOS extends React.Component { + static Item: typeof TabBarIOSItem; } export interface PixelRatioStatic { @@ -5724,7 +5752,7 @@ interface ScrollResponderMixin extends SubscribableMixin { scrollResponderKeyboardDidHide(e: ScrollResponderEvent): void; } -export interface ScrollViewPropertiesIOS { +export interface ScrollViewPropsIOS { /** * When true the scroll view bounces horizontally when it reaches the end * even if the content is smaller than the scroll view itself. The default @@ -5782,7 +5810,7 @@ export interface ScrollViewPropertiesIOS { * Used to manually set the starting scroll offset. * The default value is {x: 0, y: 0} */ - contentOffset?: PointProperties; // zeros + contentOffset?: PointPropType; // zeros /** * This property specifies how the safe area insets are used to modify the content area of the scroll view. @@ -5886,7 +5914,7 @@ export interface ScrollViewPropertiesIOS { zoomScale?: number; } -export interface ScrollViewPropertiesAndroid { +export interface ScrollViewPropsAndroid { /** * Sometimes a scrollview takes up more space than its content fills. * When this is the case, this prop will fill the rest of the @@ -5916,10 +5944,10 @@ export interface ScrollViewPropertiesAndroid { overScrollMode?: "auto" | "always" | "never"; } -export interface ScrollViewProperties - extends ViewProperties, - ScrollViewPropertiesIOS, - ScrollViewPropertiesAndroid, +export interface ScrollViewProps + extends ViewProps, + ScrollViewPropsIOS, + ScrollViewPropsAndroid, Touchable { /** * These styles will be applied to the scroll view content container which @@ -6035,12 +6063,12 @@ export interface ScrollViewProperties * A RefreshControl component, used to provide pull-to-refresh * functionality for the ScrollView. */ - refreshControl?: React.ReactElement; + refreshControl?: React.ReactElement; } -export interface ScrollViewProps extends ScrollViewProperties {} - -interface ScrollViewStatic extends ScrollResponderMixin, React.ComponentClass { +declare class ScrollViewComponent extends React.Component {} +declare const ScrollViewBase: Constructor & typeof ScrollViewComponent; +export class ScrollView extends ScrollViewBase { /** * Scrolls to a given x, y offset, either immediately or with a smooth animation. * Syntax: @@ -6111,7 +6139,7 @@ export interface NativeScrollEvent { zoomScale: number; } -export interface SnapshotViewIOSProperties extends ViewProperties { +export interface SnapshotViewIOSProps extends ViewProps { // A callback when the Snapshot view is ready to be compared onSnapshotReady(): any; @@ -6119,7 +6147,9 @@ export interface SnapshotViewIOSProperties extends ViewProperties { testIdentifier: string; } -export interface SnapshotViewIOSStatic extends NativeMethodsMixin, React.ComponentClass {} +declare class SnapshotViewIOSComponent extends React.Component {} +declare const SnapshotViewIOSBase: Constructor & typeof SnapshotViewIOSComponent; +export class SnapshotViewIOS extends SnapshotViewIOSBase {} // Deduced from // https://github.com/facebook/react-native/commit/052cd7eb8afa7a805ef13e940251be080499919c @@ -6190,7 +6220,7 @@ export interface SwipeableListViewProps { * - It can bounce the 1st row of the list so users know it's swipeable * - More to come */ -export interface SwipeableListViewStatic extends React.ComponentClass { +export class SwipeableListView extends React.Component { getNewDataSource(): SwipeableListViewDataSource; } @@ -6639,7 +6669,7 @@ export interface BackHandlerStatic { removeEventListener(eventName: BackPressEventName, handler: () => void): void; } -export interface ButtonProperties { +export interface ButtonProps { title: string; onPress: () => any; color?: string; @@ -6652,7 +6682,7 @@ export interface ButtonProperties { testID?: string; } -export interface ButtonStatic extends React.ComponentClass {} +export class Button extends React.Component {} export type CameraRollGroupType = "Album" | "All" | "Event" | "Faces" | "Library" | "PhotoStream" | "SavedPhotos"; export type CameraRollAssetType = "All" | "Videos" | "Photos"; @@ -6790,7 +6820,7 @@ export interface ClipboardStatic { setString(content: string): void; } -export interface DatePickerAndroidOpenOption { +export interface DatePickerAndroidOpenOptions { date?: Date | number; minDate?: Date | number; maxDate?: Date | number; @@ -6806,22 +6836,25 @@ export interface DatePickerAndroidOpenReturn { } export interface DatePickerAndroidStatic { - /* - Opens the standard Android date picker dialog. - - The available keys for the options object are: - * date (Date object or timestamp in milliseconds) - date to show by default - * minDate (Date object or timestamp in milliseconds) - minimum date that can be selected - * maxDate (Date object or timestamp in milliseconds) - maximum date that can be selected - - Returns a Promise which will be invoked an object containing action, year, month (0-11), day if the user picked - a date. If the user dismissed the dialog, the Promise will still be resolved with action being - DatePickerAndroid.dismissedAction and all the other keys being undefined. Always check whether the action before - reading the values. - - Note the native date picker dialog has some UI glitches on Android 4 and lower when using the minDate and maxDate options. - */ - open(options?: DatePickerAndroidOpenOption): Promise; + /** + * Opens the standard Android date picker dialog. + * + * The available keys for the options object are: + * - date (Date object or timestamp in milliseconds) - date to show by default + * - minDate (Date or timestamp in milliseconds) - minimum date that can be selected + * - maxDate (Date object or timestamp in milliseconds) - maximum date that can be selected + * - mode (enum('calendar', 'spinner', 'default')) - To set the date-picker mode to calendar/spinner/default + * - 'calendar': Show a date picker in calendar mode. + * - 'spinner': Show a date picker in spinner mode. + * - 'default': Show a default native date picker(spinner/calendar) based on android versions. + * + * Returns a Promise which will be invoked an object containing action, year, month (0-11), day if the user picked a date. + * If the user dismissed the dialog, the Promise will still be resolved with action being DatePickerAndroid.dismissedAction and all the other keys being undefined. + * Always check whether the action before reading the values. + * + * Note the native date picker dialog has some UI glitches on Android 4 and lower when using the minDate and maxDate options. + */ + open(options?: DatePickerAndroidOpenOptions): Promise; /** * A date has been selected. @@ -7460,7 +7493,7 @@ export type StatusBarStyle = "default" | "light-content" | "dark-content"; export type StatusBarAnimation = "none" | "fade" | "slide"; -export interface StatusBarPropertiesIOS { +export interface StatusBarPropsIOS { /** * Sets the color of the status bar text. */ @@ -7478,7 +7511,7 @@ export interface StatusBarPropertiesIOS { showHideTransition?: "fade" | "slide"; } -export interface StatusBarPropertiesAndroid { +export interface StatusBarPropsAndroid { /** * The background color of the status bar. */ @@ -7492,7 +7525,7 @@ export interface StatusBarPropertiesAndroid { translucent?: boolean; } -export interface StatusBarProperties extends StatusBarPropertiesIOS, StatusBarPropertiesAndroid { +export interface StatusBarProps extends StatusBarPropsIOS, StatusBarPropsAndroid { /** * If the transition between status bar property changes should be * animated. Supported for backgroundColor, barStyle and hidden. @@ -7505,7 +7538,7 @@ export interface StatusBarProperties extends StatusBarPropertiesIOS, StatusBarPr hidden?: boolean; } -export interface StatusBarStatic extends React.ComponentClass { +export class StatusBar extends React.Component { /** * The current height of the status bar on the device. * @platform android @@ -7728,7 +7761,7 @@ export interface UIManagerStatic { setLayoutAnimationEnabledExperimental(value: boolean): void; } -export interface SwitchPropertiesIOS extends ViewProperties { +export interface SwitchPropsIOS extends ViewProps { /** * Background color when the switch is turned on. */ @@ -7745,7 +7778,7 @@ export interface SwitchPropertiesIOS extends ViewProperties { tintColor?: string; } -export interface SwitchProperties extends SwitchPropertiesIOS { +export interface SwitchProps extends SwitchPropsIOS { /** * If true the user won't be able to toggle the switch. * Default value is false. @@ -7778,7 +7811,9 @@ export interface SwitchProperties extends SwitchPropertiesIOS { * If the `value` prop is not updated, the component will continue to render * the supplied `value` prop instead of the expected result of any user actions. */ -export interface SwitchStatic extends NativeMethodsMixin, React.ClassicComponentClass {} +declare class SwitchComponent extends React.Component {} +declare const SwitchBase: Constructor & typeof SwitchComponent; +export class Switch extends SwitchBase {} /** * NOTE: `VibrationIOS` is being deprecated. Use `Vibration` instead. @@ -8414,22 +8449,22 @@ export interface ARTSurfaceProps { height: number; } -export interface ClippingRectangleStatic extends React.ComponentClass {} +export class ClippingRectangle extends React.Component {} -export interface GroupStatic extends React.ComponentClass {} +export class Group extends React.Component {} -export interface ShapeStatic extends React.ComponentClass {} +export class Shape extends React.Component {} -export interface SurfaceStatic extends React.ComponentClass {} +export class Surface extends React.Component {} -export interface ARTTextStatic extends React.ComponentClass {} +export class ARTText extends React.Component {} export interface ARTStatic { - ClippingRectangle: ClippingRectangleStatic; - Group: GroupStatic; - Shape: ShapeStatic; - Surface: SurfaceStatic; - Text: ARTTextStatic; + ClippingRectangle: typeof ClippingRectangle; + Group: typeof Group; + Shape: typeof Shape; + Surface: typeof Surface; + Text: typeof ARTText; } export interface KeyboardStatic extends NativeEventEmitter { @@ -8447,138 +8482,18 @@ export interface KeyboardStatic extends NativeEventEmitter { export const ART: ARTStatic; export type ART = ARTStatic; -export const ActivityIndicator: ActivityIndicatorStatic; -export type ActivityIndicator = ActivityIndicatorStatic; - -export const ActivityIndicatorIOS: ActivityIndicatorIOSStatic; -export type ActivityIndicatorIOS = ActivityIndicatorIOSStatic; - -export const DatePickerIOS: DatePickerIOSStatic; -export type DatePickerIOS = DatePickerIOSStatic; - -export const DrawerLayoutAndroid: DrawerLayoutAndroidStatic; -export type DrawerLayoutAndroid = DrawerLayoutAndroidStatic; - -export const Image: ImageStatic; -export type Image = ImageStatic; - -export const ImageBackground: ImageBackgroundStatic; -export type ImageBackground = ImageBackgroundStatic; - export const ImagePickerIOS: ImagePickerIOSStatic; export type ImagePickerIOS = ImagePickerIOSStatic; -export const InputAccessoryView: InputAccessoryViewStatic; -export type InputAccessoryView = InputAccessoryViewStatic; - -export const FlatList: FlatListStatic; -export type FlatList = FlatListStatic; - export const LayoutAnimation: LayoutAnimationStatic; export type LayoutAnimation = LayoutAnimationStatic; -export const ListView: ListViewStatic; -export type ListView = ListViewStatic; - -export const MapView: MapViewStatic; -export type MapView = MapViewStatic; - -export const MaskedViewIOS: MaskedViewStatic; -export type MaskedViewIOS = MaskedViewStatic; - -export const Modal: ModalStatic; -export type Modal = ModalStatic; - -export const NavigatorIOS: NavigatorIOSStatic; -export type NavigatorIOS = NavigatorIOSStatic; - -export const Picker: PickerStatic; -export type Picker = PickerStatic; - -export const PickerIOS: PickerIOSStatic; -export type PickerIOS = PickerIOSStatic; - -export const ProgressBarAndroid: ProgressBarAndroidStatic; -export type ProgressBarAndroid = ProgressBarAndroidStatic; - -export const ProgressViewIOS: ProgressViewIOSStatic; -export type ProgressViewIOS = ProgressViewIOSStatic; - -export const RefreshControl: RefreshControlStatic; -export type RefreshControl = RefreshControlStatic; - -export const RecyclerViewBackedScrollView: RecyclerViewBackedScrollViewStatic; -export type RecyclerViewBackedScrollView = RecyclerViewBackedScrollViewStatic; - -export const SafeAreaView: SafeAreaViewStatic; -export type SafeAreaView = SafeAreaViewStatic; - -export const SegmentedControlIOS: SegmentedControlIOSStatic; -export type SegmentedControlIOS = SegmentedControlIOSStatic; - -export const Slider: SliderStatic; -export type Slider = SliderStatic; - -export const SliderIOS: SliderStatic; -export type SliderIOS = SliderStatic; - -export const StatusBar: StatusBarStatic; -export type StatusBar = StatusBarStatic; - -export const ScrollView: ScrollViewStatic; -export type ScrollView = ScrollViewStatic; - export const SectionList: SectionListStatic; export type SectionList = SectionListStatic; -export const SnapshotViewIOS: SnapshotViewIOSStatic; -export type SnapshotViewIOS = SnapshotViewIOSStatic; - export const Systrace: SystraceStatic; export type Systrace = SystraceStatic; -export const SwipeableListView: SwipeableListViewStatic; -export type SwipeableListView = SwipeableListViewStatic; - -export const Switch: SwitchStatic; -export type Switch = SwitchStatic; - -export const SwitchIOS: SwitchIOSStatic; -export type SwitchIOS = SwitchIOSStatic; - -export const TabBarIOS: TabBarIOSStatic; -export type TabBarIOS = TabBarIOSStatic; - -export const Text: TextStatic; -export type Text = TextStatic; - -export const TextInput: TextInputStatic; -export type TextInput = TextInputStatic; - -export const ToolbarAndroid: ToolbarAndroidStatic; -export type ToolbarAndroid = ToolbarAndroidStatic; - -export const TouchableHighlight: TouchableHighlightStatic; -export type TouchableHighlight = TouchableHighlightStatic; - -export const TouchableNativeFeedback: TouchableNativeFeedbackStatic; -export type TouchableNativeFeedback = TouchableNativeFeedbackStatic; - -export const TouchableOpacity: TouchableOpacityStatic; -export type TouchableOpacity = TouchableOpacityStatic; - -export const TouchableWithoutFeedback: TouchableWithoutFeedbackStatic; -export type TouchableWithoutFeedback = TouchableWithoutFeedbackStatic; - -export const View: ViewStatic; -export type View = ViewStatic; - -export const ViewPagerAndroid: ViewPagerAndroidStatic; -export type ViewPagerAndroid = ViewPagerAndroidStatic; - -export const WebView: WebViewStatic; -export type WebView = WebViewStatic; - //////////// APIS ////////////// export const ActionSheetIOS: ActionSheetIOSStatic; export type ActionSheetIOS = ActionSheetIOSStatic; @@ -8616,9 +8531,6 @@ export type BackAndroid = BackAndroidStatic; export const BackHandler: BackHandlerStatic; export type BackHandler = BackHandlerStatic; -export const Button: ButtonStatic; -export type Button = ButtonStatic; - export const CameraRoll: CameraRollStatic; export type CameraRoll = CameraRollStatic; @@ -8648,9 +8560,6 @@ export type IntentAndroid = IntentAndroidStatic; export const Keyboard: KeyboardStatic; -export const KeyboardAvoidingView: KeyboardAvoidingViewStatic; -export type KeyboardAvoidingView = KeyboardAvoidingViewStatic; - export const Linking: LinkingStatic; export type Linking = LinkingStatic; diff --git a/types/react-native/legacy-properties.d.ts b/types/react-native/legacy-properties.d.ts new file mode 100644 index 0000000000..eae30f65c7 --- /dev/null +++ b/types/react-native/legacy-properties.d.ts @@ -0,0 +1,286 @@ +import { + LayoutProps, + TextProps, + TextPropsIOS, + TextPropsAndroid, + AccessibilityProps, + AccessibilityPropsIOS, + AccessibilityPropsAndroid, + TextInputProps, + TextInputIOSProps, + TextInputAndroidProps, + ViewProps, + ViewPropsIOS, + ViewPropsAndroid, + ToolbarAndroidProps, + ViewPagerAndroidProps, + WebViewProps, + WebViewPropsIOS, + WebViewPropsAndroid, + SegmentedControlIOSProps, + ScrollViewProps, + ScrollViewPropsIOS, + ScrollViewPropsAndroid, + InputAccessoryViewProps, + NavigatorIOSProps, + ActivityIndicatorProps, + ActivityIndicatorIOSProps, + DatePickerIOSProps, + DrawerLayoutAndroidProps, + PickerItemProps, + PickerIOSItemProps, + PickerProps, + PickerPropsIOS, + PickerPropsAndroid, + PickerIOSProps, + ProgressBarAndroidProps, + ProgressViewIOSProps, + RefreshControlProps, + RefreshControlPropsIOS, + RefreshControlPropsAndroid, + RecyclerViewBackedScrollViewProps, + SliderProps, + SliderPropsIOS, + SliderPropsAndroid, + SwitchIOSProps, + ImageSourcePropType, + ImageProps, + ImagePropsIOS, + ImagePropsAndroid, + ImageBackgroundProps, + FlatListProps, + VirtualizedListProps, + SectionListProps, + ListViewProps, + MapViewProps, + MaskedViewIOSProps, + ModalProps, + TouchableWithoutFeedbackProps, + TouchableHighlightProps, + TouchableOpacityProps, + TouchableNativeFeedbackProps, + TabBarIOSItemProps, + TabBarIOSProps, + SnapshotViewIOSProps, + ButtonProps, + StatusBarProps, + StatusBarPropsIOS, + StatusBarPropsAndroid, + SwitchProps, + SwitchPropsIOS +} from "react-native"; + +declare module "react-native" { + /* + * Previously, props interfaces where named *Properties + * They have been renamed to *Props to match React Native documentation + * The following lines ensure compatibility with *Properties and should be removed in the future + */ + + /** @deprecated Use LayoutProps */ + export type LayoutProperties = LayoutProps; + + /** @deprecated Use TextProps */ + export type TextProperties = TextProps; + + /** @deprecated Use TextPropsIOS */ + export type TextPropertiesIOS = TextPropsIOS; + + /** @deprecated Use TextPropsAndroid */ + export type TextPropertiesAndroid = TextPropsAndroid; + + /** @deprecated Use AccessibilityProps */ + export type AccessibilityProperties = AccessibilityProps; + + /** @deprecated Use AccessibilityPropsIOS */ + export type AccessibilityPropertiesIOS = AccessibilityPropsIOS; + + /** @deprecated Use AccessibilityPropsAndroid */ + export type AccessibilityPropertiesAndroid = AccessibilityPropsAndroid; + + /** @deprecated Use TextInputProps */ + export type TextInputProperties = TextInputProps; + + /** @deprecated Use TextInputIOSProps */ + export type TextInputIOSProperties = TextInputIOSProps; + + /** @deprecated Use TextInputAndroidProps */ + export type TextInputAndroidProperties = TextInputAndroidProps; + + /** @deprecated Use ViewProps */ + export type ViewProperties = ViewProps; + + /** @deprecated Use ViewPropsIOS */ + export type ViewPropertiesIOS = ViewPropsIOS; + + /** @deprecated Use ViewPropsAndroid */ + export type ViewPropertiesAndroid = ViewPropsAndroid; + + /** @deprecated Use ToolbarAndroidProps */ + export type ToolbarAndroidProperties = ToolbarAndroidProps; + + /** @deprecated Use ViewPagerAndroidProps */ + export type ViewPagerAndroidProperties = ViewPagerAndroidProps; + + /** @deprecated Use WebViewProps */ + export type WebViewProperties = WebViewProps; + + /** @deprecated Use WebViewPropsIOS */ + export type WebViewPropertiesIOS = WebViewPropsIOS; + + /** @deprecated Use WebViewPropsAndroid */ + export type WebViewPropertiesAndroid = WebViewPropsAndroid; + + /** @deprecated Use SegmentedControlIOSProps */ + export type SegmentedControlIOSProperties = SegmentedControlIOSProps; + + /** @deprecated Use ScrollViewProps */ + export type ScrollViewProperties = ScrollViewProps; + + /** @deprecated Use ScrollViewPropsIOS */ + export type ScrollViewPropertiesIOS = ScrollViewPropsIOS; + + /** @deprecated Use ScrollViewPropsAndroid */ + export type ScrollViewPropertiesAndroid = ScrollViewPropsAndroid; + + /** @deprecated Use InputAccessoryViewProps */ + export type InputAccessoryViewProperties = InputAccessoryViewProps; + + /** @deprecated Use NavigatorIOSProps */ + export type NavigatorIOSProperties = NavigatorIOSProps; + + /** @deprecated Use ActivityIndicatorProps */ + export type ActivityIndicatorProperties = ActivityIndicatorProps; + + /** @deprecated Use ActivityIndicatorIOSProps */ + export type ActivityIndicatorIOSProperties = ActivityIndicatorIOSProps; + + /** @deprecated Use DatePickerIOSProps */ + export type DatePickerIOSProperties = DatePickerIOSProps; + + /** @deprecated Use DrawerLayoutAndroidProps */ + export type DrawerLayoutAndroidProperties = DrawerLayoutAndroidProps; + + /** @deprecated Use PickerItemProps */ + export type PickerItemProperties = PickerItemProps; + + /** @deprecated Use PickerIOSItemProps */ + export type PickerIOSItemProperties = PickerIOSItemProps; + + /** @deprecated Use PickerProps */ + export type PickerProperties = PickerProps; + + /** @deprecated Use PickerPropsIOS */ + export type PickerPropertiesIOS = PickerPropsIOS; + + /** @deprecated Use PickerPropsAndroid */ + export type PickerPropertiesAndroid = PickerPropsAndroid; + + /** @deprecated Use PickerIOSProps */ + export type PickerIOSProperties = PickerIOSProps; + + /** @deprecated Use ProgressBarAndroidProps */ + export type ProgressBarAndroidProperties = ProgressBarAndroidProps; + + /** @deprecated Use ProgressViewIOSProps */ + export type ProgressViewIOSProperties = ProgressViewIOSProps; + + /** @deprecated Use RefreshControlProps */ + export type RefreshControlProperties = RefreshControlProps; + + /** @deprecated Use RefreshControlPropsIOS */ + export type RefreshControlPropertiesIOS = RefreshControlPropsIOS; + + /** @deprecated Use RefreshControlPropsAndroid */ + export type RefreshControlPropertiesAndroid = RefreshControlPropsAndroid; + + /** @deprecated Use RecyclerViewBackedScrollViewProps */ + export type RecyclerViewBackedScrollViewProperties = RecyclerViewBackedScrollViewProps; + + /** @deprecated Use SliderProps */ + export type SliderProperties = SliderProps; + + /** @deprecated Use SliderPropsIOS */ + export type SliderPropertiesIOS = SliderPropsIOS; + + /** @deprecated Use SliderPropsAndroid */ + export type SliderPropertiesAndroid = SliderPropsAndroid; + + /** @deprecated Use SwitchIOSProps */ + export type SwitchIOSProperties = SwitchIOSProps; + + /** @deprecated Use ImageSourcePropType */ + export type ImagePropertiesSourceOptions = ImageSourcePropType; + + /** @deprecated Use ImageProps */ + export type ImageProperties = ImageProps; + + /** @deprecated Use ImagePropsIOS */ + export type ImagePropertiesIOS = ImagePropsIOS; + + /** @deprecated Use ImagePropsAndroid */ + export type ImagePropertiesAndroid = ImagePropsAndroid; + + /** @deprecated Use ImageBackgroundProps */ + export type ImageBackgroundProperties = ImageBackgroundProps; + + /** @deprecated Use FlatListProps */ + export type FlatListProperties = FlatListProps; + + /** @deprecated Use VirtualizedListProps */ + export type VirtualizedListProperties = VirtualizedListProps; + + /** @deprecated Use SectionListProps */ + export type SectionListProperties = SectionListProps; + + /** @deprecated Use ListViewProps */ + export type ListViewProperties = ListViewProps; + + /** @deprecated Use MapViewProps */ + export type MapViewProperties = MapViewProps; + + /** @deprecated Use MaskedViewIOSProps */ + export type MaskedViewIOSProperties = MaskedViewIOSProps; + + /** @deprecated Use ModalProps */ + export type ModalProperties = ModalProps; + + /** @deprecated Use TouchableWithoutFeedbackProps */ + export type TouchableWithoutFeedbackProperties = TouchableWithoutFeedbackProps; + + /** @deprecated Use TouchableHighlightProps */ + export type TouchableHighlightProperties = TouchableHighlightProps; + + /** @deprecated Use TouchableOpacityProps */ + export type TouchableOpacityProperties = TouchableOpacityProps; + + /** @deprecated Use TouchableNativeFeedbackProps */ + export type TouchableNativeFeedbackProperties = TouchableNativeFeedbackProps; + + /** @deprecated Use TabBarIOSItemProps */ + export type TabBarIOSItemProperties = TabBarIOSItemProps; + + /** @deprecated Use TabBarIOSProps */ + export type TabBarIOSProperties = TabBarIOSProps; + + /** @deprecated Use SnapshotViewIOSProps */ + export type SnapshotViewIOSProperties = SnapshotViewIOSProps; + + /** @deprecated Use ButtonProps */ + export type ButtonProperties = ButtonProps; + + /** @deprecated Use StatusBarProps */ + export type StatusBarProperties = StatusBarProps; + + /** @deprecated Use StatusBarPropsIOS */ + export type StatusBarPropertiesIOS = StatusBarPropsIOS; + + /** @deprecated Use StatusBarPropsAndroid */ + export type StatusBarPropertiesAndroid = StatusBarPropsAndroid; + + /** @deprecated Use SwitchProps */ + export type SwitchProperties = SwitchProps; + + /** @deprecated Use SwitchPropsIOS */ + export type SwitchPropertiesIOS = SwitchPropsIOS; +} diff --git a/types/react-native/test/ART.tsx b/types/react-native/test/ART.tsx new file mode 100644 index 0000000000..86fa48ca88 --- /dev/null +++ b/types/react-native/test/ART.tsx @@ -0,0 +1,29 @@ +import * as React from "react"; +import * as ReactNative from "react-native"; + +// See https://github.com/react-native-china/react-native-ART-doc/blob/6ba9c0f7c7e495a12045f3d7061834d2c74413c5/doc.md + +const { + Surface, + Shape, + Group, + Text, + ClippingRectangle +} = ReactNative.ART + +class Test extends React.Component { + render() { + return ( + + + + + + ) + } +} diff --git a/types/react-native/test/index.tsx b/types/react-native/test/index.tsx index 8d3925d4bd..31cbc5a50e 100644 --- a/types/react-native/test/index.tsx +++ b/types/react-native/test/index.tsx @@ -31,15 +31,15 @@ import { Systrace, Text, TextStyle, - TextProperties, + TextProps, View, ViewStyle, ViewPagerAndroid, FlatList, - FlatListProperties, + FlatListProps, ScaledSize, SectionList, - SectionListProperties, + SectionListProps, findNodeHandle, ScrollView, ScrollViewProps, @@ -235,7 +235,7 @@ InteractionManager.runAfterInteractions(() => { // ... }).then(() => "done"); -export class FlatListTest extends React.Component, {}> { +export class FlatListTest extends React.Component, {}> { _renderItem = (rowData: any) => { return ( @@ -257,7 +257,7 @@ export class FlatListTest extends React.Component, {} } } -export class SectionListTest extends React.Component, {}> { +export class SectionListTest extends React.Component, {}> { render() { const sections = [ { @@ -293,7 +293,7 @@ export class SectionListTest extends React.Component { +export class CapsLockComponent extends React.Component { render() { const content = (this.props.children || "") as string; return {content.toUpperCase()}; @@ -318,7 +318,7 @@ class ScrollerListComponentTest extends React.Component<{}, { dataSource: ListVi throw new Error("Expected scroll to be enabled."); } - return ; + return ; }} renderRow={({ type, data }, _, row) => { return Filler; @@ -412,3 +412,24 @@ const dataSourceAssetCallback2: DataSourceAssetCallback = {}; const deviceEventEmitterStatic: DeviceEventEmitterStatic = null; deviceEventEmitterStatic.addListener("keyboardWillShow", data => true); deviceEventEmitterStatic.addListener("keyboardWillShow", data => true, {}); + + +class TextInputRefTest extends React.Component<{}, {username: string}> { + username: TextInput | null = null; + + handleUsernameChange(text: string) { + } + + render() { + return ( + + this.username.focus()}>Username + this.username = input} + value={this.state.username} + onChangeText={this.handleUsernameChange.bind(this)} + /> + + ); + } +} diff --git a/types/react-native/test/legacy-properties.tsx b/types/react-native/test/legacy-properties.tsx new file mode 100644 index 0000000000..1637cb207c --- /dev/null +++ b/types/react-native/test/legacy-properties.tsx @@ -0,0 +1,5 @@ +import * as React from "react"; +import { TextInputProperties } from "react-native"; + +class Test extends React.Component { +} diff --git a/types/react-native/tsconfig.json b/types/react-native/tsconfig.json index 508ac06f1a..16c6bf9275 100644 --- a/types/react-native/tsconfig.json +++ b/types/react-native/tsconfig.json @@ -21,6 +21,8 @@ "index.d.ts", "test/index.tsx", "test/animated.tsx", - "test/init-example.tsx" + "test/init-example.tsx", + "test/ART.tsx", + "test/legacy-properties.tsx" ] } \ No newline at end of file diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index a054ecf4d0..db45006ef0 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -32,7 +32,7 @@ import * as React from 'react'; import { Animated, TextStyle, - ViewProperties, + ViewProps, ViewStyle, StyleProp, } from 'react-native'; @@ -926,7 +926,7 @@ export function withNavigationFocus( * SafeAreaView Component */ export type SafeAreaViewForceInsetValue = 'always' | 'never'; -export interface SafeAreaViewProps extends ViewProperties { +export interface SafeAreaViewProps extends ViewProps { forceInset?: { top?: SafeAreaViewForceInsetValue; bottom?: SafeAreaViewForceInsetValue; diff --git a/types/react-router-native/react-router-native-tests.tsx b/types/react-router-native/react-router-native-tests.tsx index 5b7dcfa4e7..7ae1b10653 100644 --- a/types/react-router-native/react-router-native-tests.tsx +++ b/types/react-router-native/react-router-native-tests.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { StyleSheet, Text, TouchableOpacity, TouchableOpacityProperties, View } from 'react-native'; +import { StyleSheet, Text, TouchableOpacity, TouchableOpacityProps, View } from 'react-native'; import { AndroidBackButton, BackButton, Link, NativeRouter as Router, Route } from 'react-router-native'; const Home: React.SFC = () => { @@ -24,7 +24,7 @@ const About: React.SFC = () => { ); }; -interface ButtonTextProps extends TouchableOpacityProperties { +interface ButtonTextProps extends TouchableOpacityProps { text: string; } diff --git a/types/react-router-navigation/index.d.ts b/types/react-router-navigation/index.d.ts index c69a172c43..62258b4b6c 100644 --- a/types/react-router-navigation/index.d.ts +++ b/types/react-router-navigation/index.d.ts @@ -5,7 +5,7 @@ // TypeScript Version: 2.6 import { Component, ReactNode, ReactElement, ComponentClass } from "react"; -import { StyleProp, ViewProperties, ViewStyle, TextStyle } from "react-native"; +import { StyleProp, ViewProps, ViewStyle, TextStyle } from "react-native"; import { TabViewAnimated, TabViewPagerPan } from "react-native-tab-view"; import { RouteProps } from "react-router-navigation-core"; import { @@ -128,7 +128,7 @@ export class BottomNavigation extends Component< renderSceneView: (sceneProps: TabSubViewProps) => ReactNode; - renderScene: (sceneProps: TabSubViewProps) => ReactElement; + renderScene: (sceneProps: TabSubViewProps) => ReactElement; } export function Card(props: CardProps): ReactElement; From c3257dd16c8ffb3f4f4dadfb49356f508142826e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martynas=20=C5=BDilinskas?= Date: Thu, 26 Apr 2018 20:31:02 +0300 Subject: [PATCH 0903/2153] [react-hot-loader] Upgraded to v4.1 (#25133) * Updated to 4.1. * Removed from types. * Updated tslint. * Fixed lint errors. --- types/react-hot-loader/index.d.ts | 24 +++--- .../react-hot-loader-tests.tsx | 78 ++++++++++++------ types/react-hot-loader/tsconfig.json | 2 +- types/react-hot-loader/tslint.json | 80 +------------------ 4 files changed, 71 insertions(+), 113 deletions(-) diff --git a/types/react-hot-loader/index.d.ts b/types/react-hot-loader/index.d.ts index 6443fd1f43..ccae5a929c 100644 --- a/types/react-hot-loader/index.d.ts +++ b/types/react-hot-loader/index.d.ts @@ -1,19 +1,25 @@ -// Type definitions for react-hot-loader 3.0 +// Type definitions for react-hot-loader 4.1 // Project: https://github.com/gaearon/react-hot-loader // Definitions by: Jacek Jagiello +// MartynasZilinskas +// Dovydas Navickas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 -import * as React from "react" +import * as React from "react"; +import "node"; -interface ErrorReporterProps { - error: any +export type ReactComponent = React.ComponentClass | React.StatelessComponent; +export type ExtractProps = TComponent extends ReactComponent ? TProps : {}; + +export interface ErrorReporterProps { + error: any; } export interface AppContainerProps { - children?: React.ReactElement, - errorReporter?: React.ComponentClass | React.StatelessComponent - warnings?: boolean + errorReporter?: ReactComponent; + warnings?: boolean; } - export class AppContainer extends React.Component {} + +export function hot(sourceModule: NodeModule): (component: TComponent) => ReactComponent>; diff --git a/types/react-hot-loader/react-hot-loader-tests.tsx b/types/react-hot-loader/react-hot-loader-tests.tsx index 771f4fdd26..ad5b9cc686 100644 --- a/types/react-hot-loader/react-hot-loader-tests.tsx +++ b/types/react-hot-loader/react-hot-loader-tests.tsx @@ -1,29 +1,59 @@ -import * as React from 'react' -import { AppContainer } from 'react-hot-loader' +import * as React from "react"; +import { AppContainer, hot, ReactComponent } from "react-hot-loader"; -interface ErrorReporterProps { - error: any -} +declare function describe(desc: string, f: () => void): void; +declare function it(desc: string, f: () => void): void; -class ErrorReporterComponent extends React.Component { - public render() { - return

{this.props.error.message}

- } -} +it("Using AppContainer", () => { + interface ErrorReporterProps { + error: any; + } -const DummyComponent = () =>

Dummy component

-const ErrorReporter = ({ error } : ErrorReporterProps) => + class ErrorReporterComponent extends React.Component { + render() { + return

{this.props.error.message}

; + } + } -class AppContainerTest extends React.Component { - public render() { - return ( -
- - - -
- ) - } -} + const DummyComponent = () =>

Dummy component

; + const ErrorReporter = ({ error }: ErrorReporterProps) => ; -export default AppContainerTest + class AppContainerTest extends React.Component { + render() { + return ( +
+ + + +
+ ); + } + } +}); + +it("Using hot", () => { + interface Props { + name: string; + } + + class Foo extends React.Component { + render(): JSX.Element { + return
Foo
; + } + } + const FooSFC = (props: { surname: string }) => { + return
; + }; + + const Bar = hot(module)(Foo); + const BarSFC = hot(module)(FooSFC); + + const testRender = () => { + return ( + <> + + + + ); + }; +}); diff --git a/types/react-hot-loader/tsconfig.json b/types/react-hot-loader/tsconfig.json index 5e898cb303..30206811ef 100644 --- a/types/react-hot-loader/tsconfig.json +++ b/types/react-hot-loader/tsconfig.json @@ -22,4 +22,4 @@ "index.d.ts", "react-hot-loader-tests.tsx" ] -} \ No newline at end of file +} diff --git a/types/react-hot-loader/tslint.json b/types/react-hot-loader/tslint.json index a41bf5d19a..3db14f85ea 100644 --- a/types/react-hot-loader/tslint.json +++ b/types/react-hot-loader/tslint.json @@ -1,79 +1 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} +{ "extends": "dtslint/dt.json" } From c853ba2651b141ff6ac9898c5397fbe875069a8e Mon Sep 17 00:00:00 2001 From: denisname Date: Thu, 26 Apr 2018 19:31:47 +0200 Subject: [PATCH 0904/2153] Linting d3-hexbin and d3-hierarchy (#25325) --- types/d3-hexbin/d3-hexbin-tests.ts | 40 +++--- types/d3-hexbin/index.d.ts | 10 +- types/d3-hexbin/tslint.json | 75 +----------- types/d3-hierarchy/d3-hierarchy-tests.ts | 150 ++++++++++------------- types/d3-hierarchy/index.d.ts | 11 +- types/d3-hierarchy/tslint.json | 75 +----------- 6 files changed, 94 insertions(+), 267 deletions(-) diff --git a/types/d3-hexbin/d3-hexbin-tests.ts b/types/d3-hexbin/d3-hexbin-tests.ts index 4dce0d1ce1..0082ae075d 100644 --- a/types/d3-hexbin/d3-hexbin-tests.ts +++ b/types/d3-hexbin/d3-hexbin-tests.ts @@ -22,22 +22,21 @@ interface Point { b.y()([41, 42]); // === 42; b.radius(); // === 1; - // hexbin(points) bins the specified points into hexagonal bins const bins = d3Hexbin.hexbin()([ [0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [1, 2], [2, 0], [2, 1], [2, 2] - ]) + ]); - bins.map((bin: any) => {}) + bins.map((bin: any) => {}); } { // hexbin(points) observes the current x- and y-accessors - const x = function(d: any) { return d.x; }, - y = function(d: any) { return d.y; }, - bins = d3Hexbin.hexbin().x(x).y(y)([ + const x = (d: any) => d.x; + const y = (d: any) => d.y; + const bins = d3Hexbin.hexbin().x(x).y(y)([ {x0: 0, y0: 0}, {x0: 0, y0: 1}, {x0: 0, y0: 2}, {x0: 1, y0: 0}, {x0: 1, y0: 1}, {x0: 1, y0: 2}, {x0: 2, y0: 0}, {x0: 2, y0: 1}, {x0: 2, y0: 2} @@ -52,7 +51,7 @@ interface Point { [1, 0], [1, 1], [1, 2], [2, 0], [2, 1], [2, 2] ]); - bins.map((bin: any)=> {}); + bins.map((bin: any) => {}); } { @@ -62,15 +61,15 @@ interface Point { } // hexbin.x(x) sets the x-coordinate accessor - const x = function(d: PointX) { return d.x; }, - b = d3Hexbin.hexbin().x(x), - bins = b([{x: 1, 1: 2}]); + const x = (d: PointX) => d.x; + const b = d3Hexbin.hexbin().x(x); + const bins = b([{x: 1, 1: 2}]); b.x(); // should be x; bins.length; // should be 1; bins[0].x; // should be 0.8660254037844386; bins[0].y; // should be 1.5; - bins[0].length // should be 1; + bins[0].length; // should be 1; } { @@ -79,9 +78,9 @@ interface Point { [key: number]: number; } // hexbin.y(y) sets the y-coordinate accessor - const y = function(d: PointY) { return d.y; }, - b = d3Hexbin.hexbin().y(y), - bins = b([{0: 1, y: 2}]); + const y = (d: PointY) => d.y; + const b = d3Hexbin.hexbin().y(y); + const bins = b([{0: 1, y: 2}]); bins.length; // should be 1; bins[0].x; // should be 0.8660254037844386; @@ -148,9 +147,8 @@ interface Point { } { - let hb: d3Hexbin.Hexbin; - let bins: d3Hexbin.HexbinBin[]; + let bins: Array>; // Create generator ======================================= @@ -160,8 +158,8 @@ interface Point { // x Accessor ---------------------------------------------- - let x: (d:Point) => number; - x = function (d: Point) { return d.x0; }; + let x: (d: Point) => number; + x = (d: Point) => d.x0; // test setter hb = hb.x(x); @@ -171,8 +169,8 @@ interface Point { // y Accessor ---------------------------------------------- - let y: (d:Point) => number; - y = function (d: Point) { return d.y0; }; + let y: (d: Point) => number; + y = (d: Point) => d.y0; // test setter hb = hb.y(y); @@ -193,7 +191,7 @@ interface Point { points: Point[]; } - let remappedBins: Array; + let remappedBins: RemappedBin[]; remappedBins = bins.map(bin => { const x: number = bin.x; // x-coordinate of bin diff --git a/types/d3-hexbin/index.d.ts b/types/d3-hexbin/index.d.ts index dba33cb292..5fa53e6145 100644 --- a/types/d3-hexbin/index.d.ts +++ b/types/d3-hexbin/index.d.ts @@ -1,8 +1,10 @@ -// Type definitions for D3JS d3-hexbin module v0.2.1 +// Type definitions for D3JS d3-hexbin module 0.2 // Project: https://github.com/d3/d3-hexbin/ // Definitions by: UNCOVER TRUTH Inc. , Tom Wanzek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Last module patch version validated against: 0.2.1 + export interface HexbinBin extends Array { x: number; y: number; @@ -17,7 +19,7 @@ export interface Hexbin { * If either the x- or y-coordinate is NaN, the point is ignored and will * not be in any of the returned bins. */ - (points: T[]): HexbinBin[]; + (points: T[]): Array>; /** * Returns the SVG path string for the hexagon centered at the origin ⟨0,0⟩. @@ -27,7 +29,7 @@ export interface Hexbin { * If radius is specified, a hexagon with the specified radius is returned; * this is useful for area-encoded bivariate hexbins. * - * @param {number} radius Radius number + * @param radius Radius number */ hexagon(radius?: number): string; @@ -78,7 +80,7 @@ export interface Hexbin { * of each point. The default value assumes each point is specified as * a two-element array of numbers [x, y]. */ - y(y: (d: T) => number): Hexbin + y(y: (d: T) => number): Hexbin; /** * If y is not specified, returns the current y-coordinate accessor, diff --git a/types/d3-hexbin/tslint.json b/types/d3-hexbin/tslint.json index a41bf5d19a..71ee04c4e1 100644 --- a/types/d3-hexbin/tslint.json +++ b/types/d3-hexbin/tslint.json @@ -1,79 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "no-unnecessary-generics": false } } diff --git a/types/d3-hierarchy/d3-hierarchy-tests.ts b/types/d3-hierarchy/d3-hierarchy-tests.ts index 7079fae827..4e35f02ff9 100644 --- a/types/d3-hierarchy/d3-hierarchy-tests.ts +++ b/types/d3-hierarchy/d3-hierarchy-tests.ts @@ -8,7 +8,6 @@ import * as d3Hierarchy from 'd3-hierarchy'; - // ----------------------------------------------------------------------- // Preparatory Steps // ----------------------------------------------------------------------- @@ -24,11 +23,9 @@ let idString: string; interface HierarchyDatum { name: string; val: number; - children?: Array; + children?: HierarchyDatum[]; } - - let hierarchyRootDatum: HierarchyDatum = { name: 'n0', val: 10, @@ -68,7 +65,7 @@ let hierarchyRootNode: d3Hierarchy.HierarchyNode; hierarchyRootNode = d3Hierarchy.hierarchy(hierarchyRootDatum); -hierarchyRootNode = d3Hierarchy.hierarchy(hierarchyRootDatum, function (d) { +hierarchyRootNode = d3Hierarchy.hierarchy(hierarchyRootDatum, (d) => { return d.children || null; }); @@ -82,7 +79,6 @@ num = hierarchyRootNode.height; // children, parent ------------------------------------------------------ - hierarchyNodeArray = hierarchyRootNode.children; let parentNode: d3Hierarchy.HierarchyNode; @@ -94,8 +90,8 @@ idString = hierarchyRootNode.id; // ancestors(), descendants() -------------------------------------------- -let ancestors: Array> = hierarchyRootNode.ancestors(); -let descendants: Array> = hierarchyRootNode.descendants(); +const ancestors: Array> = hierarchyRootNode.ancestors(); +const descendants: Array> = hierarchyRootNode.descendants(); // leaves() --------------------------------------------------------------- @@ -105,7 +101,7 @@ hierarchyNodeArray = hierarchyRootNode.leaves(); hierarchyNode = descendants[descendants.length - 1]; -let path: Array> = hierarchyRootNode.path(hierarchyNode); +const path: Array> = hierarchyRootNode.path(hierarchyNode); // links() and HierarchyLink<...> ------------------------------------------ @@ -121,7 +117,7 @@ hierarchyNode = link.target; // sum() and value ---------------------------------------------------------- -hierarchyRootNode = hierarchyRootNode.sum(function (d) { return d.val; }); +hierarchyRootNode = hierarchyRootNode.sum((d) => d.val); num = hierarchyRootNode.value; @@ -131,29 +127,28 @@ hierarchyRootNode = hierarchyRootNode.count(); num = hierarchyRootNode.value; - // sort --------------------------------------------------------------------- -hierarchyRootNode = hierarchyRootNode.sort(function (a, b) { - console.log(' Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyNode +hierarchyRootNode = hierarchyRootNode.sort((a, b) => { + console.log('Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyNode return b.height - a.height || b.value - a.value; }); // each(), eachAfter(), eachBefore() ---------------------------------------- -hierarchyRootNode = hierarchyRootNode.each(function (node) { - console.log(' Raw value of node:', node.data.val); // node type is HierarchyNode - console.log(' Aggregated value of node:', node.value); // node type is HierarchyNode +hierarchyRootNode = hierarchyRootNode.each((node) => { + console.log('Raw value of node:', node.data.val); // node type is HierarchyNode + console.log('Aggregated value of node:', node.value); // node type is HierarchyNode }); -hierarchyRootNode = hierarchyRootNode.eachAfter(function (node) { - console.log(' Raw value of node:', node.data.val); // node type is HierarchyNode - console.log(' Aggregated value of node:', node.value); // node type is HierarchyNode +hierarchyRootNode = hierarchyRootNode.eachAfter((node) => { + console.log('Raw value of node:', node.data.val); // node type is HierarchyNode + console.log('Aggregated value of node:', node.value); // node type is HierarchyNode }); -hierarchyRootNode = hierarchyRootNode.eachBefore(function (node) { - console.log(' Raw value of node:', node.data.val); // node type is HierarchyNode - console.log(' Aggregated value of node:', node.value); // node type is HierarchyNode +hierarchyRootNode = hierarchyRootNode.eachBefore((node) => { + console.log('Raw value of node:', node.data.val); // node type is HierarchyNode + console.log('Aggregated value of node:', node.value); // node type is HierarchyNode }); // copy() -------------------------------------------------------------------- @@ -175,7 +170,7 @@ interface TabularHierarchyDatum { val: number; } -let tabularData: Array; +let tabularData: TabularHierarchyDatum[]; tabularData = [ { name: 'n0', parentId: null, val: 10 }, { name: 'n11', parentId: 'n0', val: 5 }, @@ -183,7 +178,7 @@ tabularData = [ { name: 'n121', parentId: 'n12', val: 30 } ]; -let idStringAccessor: (d: TabularHierarchyDatum, i?: number, data?: Array) => (string | null | '' | undefined); +let idStringAccessor: (d: TabularHierarchyDatum, i?: number, data?: TabularHierarchyDatum[]) => (string | null | '' | undefined); // Create Stratify Operator --------------------------------------------- @@ -194,7 +189,7 @@ stratificatorizer = d3Hierarchy.stratify(); // id(...) -stratificatorizer = stratificatorizer.id(function (d, i, data) { +stratificatorizer = stratificatorizer.id((d, i, data) => { console.log('Length of tabular array: ', data.length); console.log('Name of first entry in tabular array: ', data[0].name); // data of type Array return d.name; // d is of type TabularHierarchyDatum @@ -204,7 +199,7 @@ idStringAccessor = stratificatorizer.id(); // parentId(...) -stratificatorizer = stratificatorizer.parentId(function (d, i, data) { +stratificatorizer = stratificatorizer.parentId((d, i, data) => { console.log('Length of tabular array: ', data.length); console.log('Name of first entry in tabular array: ', data[0].name); // data of type Array return d.parentId; // d is of type TabularHierarchyDatum @@ -214,7 +209,7 @@ idStringAccessor = stratificatorizer.parentId(); // Use Stratify Operator ------------------------------------------------ -let stratifiedRootNode: d3Hierarchy.HierarchyNode = stratificatorizer(tabularData); +const stratifiedRootNode: d3Hierarchy.HierarchyNode = stratificatorizer(tabularData); // ----------------------------------------------------------------------- // Cluster @@ -265,13 +260,12 @@ num = clusterRootNode.y; // data, depth, height --------------------------------------------------- -let clusterDatum: HierarchyDatumWithParentId = clusterRootNode.data; +const clusterDatum: HierarchyDatumWithParentId = clusterRootNode.data; num = clusterRootNode.depth; num = clusterRootNode.height; // children, parent ------------------------------------------------------ - hierarchyPointNodeArray = clusterRootNode.children; let parentPointNode: d3Hierarchy.HierarchyPointNode; @@ -283,8 +277,8 @@ idString = clusterRootNode.id; // ancestors(), descendants() -------------------------------------------- -let pointNodeAncestors: Array> = clusterRootNode.ancestors(); -let pointNodeDescendants: Array> = clusterRootNode.descendants(); +const pointNodeAncestors: Array> = clusterRootNode.ancestors(); +const pointNodeDescendants: Array> = clusterRootNode.descendants(); // leaves() --------------------------------------------------------------- @@ -294,7 +288,7 @@ hierarchyPointNodeArray = clusterRootNode.leaves(); hierarchyPointNode = pointNodeDescendants[pointNodeDescendants.length - 1]; -let clusterPath: Array> = clusterRootNode.path(hierarchyPointNode); +const clusterPath: Array> = clusterRootNode.path(hierarchyPointNode); // links() and HierarchyPointLink<...> ------------------------------------------ @@ -310,7 +304,7 @@ hierarchyPointNode = pointLink.target; // sum() and value ---------------------------------------------------------- -clusterRootNode = clusterRootNode.sum(function (d) { return d.val; }); +clusterRootNode = clusterRootNode.sum((d) => d.val); num = clusterRootNode.value; @@ -322,25 +316,25 @@ num = clusterRootNode.value; // sort --------------------------------------------------------------------- -clusterRootNode = clusterRootNode.sort(function (a, b) { - console.log(' x-coordinates of a:', a.x, ' and b:', b.x); // a and b are of type HierarchyPointNode - console.log(' Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyPointNode +clusterRootNode = clusterRootNode.sort((a, b) => { + console.log('x-coordinates of a:', a.x, ' and b:', b.x); // a and b are of type HierarchyPointNode + console.log('Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyPointNode return b.height - a.height || b.value - a.value; }); // each(), eachAfter(), eachBefore() ---------------------------------------- -clusterRootNode = clusterRootNode.each(function (node) { +clusterRootNode = clusterRootNode.each((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyPointNode console.log('X-coordinate of node:', node.x); // node type is HierarchyPointNode }); -clusterRootNode = clusterRootNode.eachAfter(function (node) { +clusterRootNode = clusterRootNode.eachAfter((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyPointNode console.log('X-coordinate of node:', node.x); // node type is HierarchyPointNode }); -clusterRootNode = clusterRootNode.eachBefore(function (node) { +clusterRootNode = clusterRootNode.eachBefore((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyPointNode console.log('X-coordinate of node:', node.x); // node type is HierarchyPointNode }); @@ -405,8 +399,7 @@ treemapLayout = d3Hierarchy.treemap(); // tile() ---------------------------------------------------------------- -treemapLayout = treemapLayout.tile(function (node, x0, y0, x1, y1) { - let n: number; +treemapLayout = treemapLayout.tile((node, x0, y0, x1, y1) => { console.log('x0 coordinate of node: ', node.x0); console.log('Node parent id: ', node.data.parentId); // type of node is HierarchyRectangularNode num = x0; // number @@ -437,7 +430,7 @@ let roundFlag: boolean = treemapLayout.round(); // padding() ---------------------------------------------------------------- treemapLayout = treemapLayout.padding(1); -treemapLayout = treemapLayout.padding(function (node) { +treemapLayout = treemapLayout.padding((node) => { console.log('Node parent id: ', node.data.parentId); // type of node is HierarchyRectangularNode return node.x0 > 10 ? 2 : 1; }); @@ -447,7 +440,7 @@ numberRectangularNodeAccessor = treemapLayout.padding(); // paddingInner() ---------------------------------------------------------------- treemapLayout = treemapLayout.paddingInner(1); -treemapLayout = treemapLayout.paddingInner(function (node) { +treemapLayout = treemapLayout.paddingInner((node) => { console.log('Node parent id: ', node.data.parentId); // type of node is HierarchyRectangularNode return node.x0 > 10 ? 2 : 1; }); @@ -457,7 +450,7 @@ numberRectangularNodeAccessor = treemapLayout.paddingInner(); // paddingOuter() ---------------------------------------------------------------- treemapLayout = treemapLayout.paddingOuter(1); -treemapLayout = treemapLayout.paddingOuter(function (node) { +treemapLayout = treemapLayout.paddingOuter((node) => { console.log('Node parent id: ', node.data.parentId); // type of node is HierarchyRectangularNode return node.x0 > 10 ? 2 : 1; }); @@ -467,7 +460,7 @@ numberRectangularNodeAccessor = treemapLayout.paddingOuter(); // paddingTop() ---------------------------------------------------------------- treemapLayout = treemapLayout.paddingTop(1); -treemapLayout = treemapLayout.paddingTop(function (node) { +treemapLayout = treemapLayout.paddingTop((node) => { console.log('Node parent id: ', node.data.parentId); // type of node is HierarchyRectangularNode return node.x0 > 10 ? 2 : 1; }); @@ -477,7 +470,7 @@ numberRectangularNodeAccessor = treemapLayout.paddingTop(); // paddingRight() ---------------------------------------------------------------- treemapLayout = treemapLayout.paddingRight(1); -treemapLayout = treemapLayout.paddingRight(function (node) { +treemapLayout = treemapLayout.paddingRight((node) => { console.log('Node parent id: ', node.data.parentId); // type of node is HierarchyRectangularNode return node.x0 > 10 ? 2 : 1; }); @@ -487,7 +480,7 @@ numberRectangularNodeAccessor = treemapLayout.paddingRight(); // paddingBottom() ---------------------------------------------------------------- treemapLayout = treemapLayout.paddingBottom(1); -treemapLayout = treemapLayout.paddingBottom(function (node) { +treemapLayout = treemapLayout.paddingBottom((node) => { console.log('Node parent id: ', node.data.parentId); // type of node is HierarchyRectangularNode return node.x0 > 10 ? 2 : 1; }); @@ -497,21 +490,19 @@ numberRectangularNodeAccessor = treemapLayout.paddingBottom(); // paddingLeft() ---------------------------------------------------------------- treemapLayout = treemapLayout.paddingLeft(1); -treemapLayout = treemapLayout.paddingLeft(function (node) { +treemapLayout = treemapLayout.paddingLeft((node) => { console.log('Node parent id: ', node.data.parentId); // type of node is HierarchyRectangularNode return node.x0 > 10 ? 2 : 1; }); numberRectangularNodeAccessor = treemapLayout.paddingLeft(); - // Use treemap layout generator ========================================== let treemapRootNode: d3Hierarchy.HierarchyRectangularNode; treemapRootNode = treemapLayout(stratifiedRootNode); - // Tiling functions ====================================================== tilingFn = d3Hierarchy.treemapBinary; @@ -536,7 +527,6 @@ tilingFactoryFn = d3Hierarchy.treemapResquarify.ratio(2); treemapLayout.tile(d3Hierarchy.treemapResquarify.ratio(2)); - // Use HierarchyRectangularNode ================================================ // x and y coordinates --------------------------------------------------- @@ -548,13 +538,12 @@ num = treemapRootNode.y1; // data, depth, height --------------------------------------------------- -let treemapDatum: HierarchyDatumWithParentId = treemapRootNode.data; +const treemapDatum: HierarchyDatumWithParentId = treemapRootNode.data; num = treemapRootNode.depth; num = treemapRootNode.height; // children, parent ------------------------------------------------------ - hierarchyRectangularNodeArray = treemapRootNode.children; let parentRectangularNode: d3Hierarchy.HierarchyRectangularNode; @@ -566,8 +555,8 @@ idString = treemapRootNode.id; // ancestors(), descendants() -------------------------------------------- -let rectangularNodeAncestors: Array> = treemapRootNode.ancestors(); -let rectangularNodeDescendants: Array> = treemapRootNode.descendants(); +const rectangularNodeAncestors: Array> = treemapRootNode.ancestors(); +const rectangularNodeDescendants: Array> = treemapRootNode.descendants(); // leaves() --------------------------------------------------------------- @@ -577,7 +566,7 @@ hierarchyRectangularNodeArray = treemapRootNode.leaves(); hierarchyRectangularNode = rectangularNodeDescendants[rectangularNodeDescendants.length - 1]; -let treemapPath: Array> = treemapRootNode.path(hierarchyRectangularNode); +const treemapPath: Array> = treemapRootNode.path(hierarchyRectangularNode); // links() and HierarchyRectangulerLink<...> ------------------------------------------ @@ -593,7 +582,7 @@ hierarchyRectangularNode = rectangularLink.target; // sum() and value ---------------------------------------------------------- -treemapRootNode = treemapRootNode.sum(function (d) { return d.val; }); +treemapRootNode = treemapRootNode.sum((d) => d.val); num = treemapRootNode.value; @@ -604,25 +593,25 @@ treemapRootNode = treemapRootNode.count(); num = treemapRootNode.value; // sort --------------------------------------------------------------------- -treemapRootNode = treemapRootNode.sort(function (a, b) { - console.log(' x0-coordinates of a:', a.x0, ' and b:', b.x0); // a and b are of type HierarchyRectangularNode - console.log(' Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyRectangularNode +treemapRootNode = treemapRootNode.sort((a, b) => { + console.log('x0-coordinates of a:', a.x0, ' and b:', b.x0); // a and b are of type HierarchyRectangularNode + console.log('Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyRectangularNode return b.height - a.height || b.value - a.value; }); // each(), eachAfter(), eachBefore() ---------------------------------------- -treemapRootNode = treemapRootNode.each(function (node) { +treemapRootNode = treemapRootNode.each((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyRectangularNode console.log('X0-coordinate of node:', node.x0); // node type is HierarchyRectangularNode }); -treemapRootNode = treemapRootNode.eachAfter(function (node) { +treemapRootNode = treemapRootNode.eachAfter((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyRectangularNode console.log('X0-coordinate of node:', node.x0); // node type is HierarchyRectangularNode }); -treemapRootNode = treemapRootNode.eachBefore(function (node) { +treemapRootNode = treemapRootNode.eachBefore((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyRectangularNode console.log('X0-coordinate of node:', node.x0); // node type is HierarchyRectangularNode }); @@ -632,8 +621,6 @@ treemapRootNode = treemapRootNode.eachBefore(function (node) { let copiedTreemapNode: d3Hierarchy.HierarchyRectangularNode; copiedTreemapNode = treemapRootNode.copy(); - - // ----------------------------------------------------------------------- // Partition // ----------------------------------------------------------------------- @@ -646,7 +633,6 @@ partitionLayout = d3Hierarchy.partition(); // Configure partition layout generator ==================================== - // size() ---------------------------------------------------------------- partitionLayout = partitionLayout.size(null); @@ -666,7 +652,6 @@ partitionLayout = partitionLayout.padding(1); num = partitionLayout.padding(); - // Use partition layout generator ========================================== let partitionRootNode: d3Hierarchy.HierarchyRectangularNode; @@ -687,7 +672,6 @@ packLayout = d3Hierarchy.pack(); // Configure pack layout generator ==================================== - // size() ---------------------------------------------------------------- packLayout = packLayout.size(null); @@ -697,7 +681,7 @@ size = packLayout.size(); // radius() ------------------------------------------------------------ -packLayout = packLayout.radius(function (node) { +packLayout = packLayout.radius((node) => { console.log('Radius property of node before completing accessor: ', node.r); // node is of type HierarchyCircularNode console.log('Parent id of node: ', node.data.parentId); // node is of type HierarchyCircularNode return node.value; @@ -709,7 +693,7 @@ numberCircularNodeAccessor = packLayout.radius(); packLayout = packLayout.padding(1); -packLayout = packLayout.padding(function (node) { +packLayout = packLayout.padding((node) => { console.log('Radius property of node: ', node.r); // node is of type HierarchyCircularNode console.log('Parent id of node: ', node.data.parentId); // node is of type HierarchyCircularNode return node.value > 10 ? 2 : 1; @@ -717,14 +701,12 @@ packLayout = packLayout.padding(function (node) { numberCircularNodeAccessor = packLayout.padding(); - // Use partition layout generator ========================================== let packRootNode: d3Hierarchy.HierarchyCircularNode; packRootNode = packLayout(stratifiedRootNode); - // Use HierarchyCircularNode ================================================ // x and y coordinates and radius r ------------------------------------------ @@ -735,13 +717,12 @@ num = packRootNode.r; // data, depth, height --------------------------------------------------- -let packDatum: HierarchyDatumWithParentId = packRootNode.data; +const packDatum: HierarchyDatumWithParentId = packRootNode.data; num = packRootNode.depth; num = packRootNode.height; // children, parent ------------------------------------------------------ - hierarchyCircularNodeArray = packRootNode.children; let parentCircularNode: d3Hierarchy.HierarchyCircularNode; @@ -753,8 +734,8 @@ idString = packRootNode.id; // ancestors(), descendants() -------------------------------------------- -let circularNodeAncestors: Array> = packRootNode.ancestors(); -let circularNodeDescendants: Array> = packRootNode.descendants(); +const circularNodeAncestors: Array> = packRootNode.ancestors(); +const circularNodeDescendants: Array> = packRootNode.descendants(); // leaves() --------------------------------------------------------------- @@ -764,7 +745,7 @@ hierarchyCircularNodeArray = packRootNode.leaves(); hierarchyCircularNode = circularNodeDescendants[circularNodeDescendants.length - 1]; -let packPath: Array> = packRootNode.path(hierarchyCircularNode); +const packPath: Array> = packRootNode.path(hierarchyCircularNode); // links() and HierarchyRectangulerLink<...> ------------------------------------------ @@ -780,7 +761,7 @@ hierarchyCircularNode = circularLink.target; // sum() and value ---------------------------------------------------------- -packRootNode = packRootNode.sum(function (d) { return d.val; }); +packRootNode = packRootNode.sum((d) => d.val); num = packRootNode.value; @@ -791,25 +772,25 @@ packRootNode = packRootNode.count(); num = packRootNode.value; // sort --------------------------------------------------------------------- -packRootNode = packRootNode.sort(function (a, b) { +packRootNode = packRootNode.sort((a, b) => { console.log('radius of a:', a.r, ' and b:', b.r); // a and b are of type HierarchyCircularNode - console.log(' Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyCircularNode + console.log('Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyCircularNode return b.height - a.height || b.value - a.value; }); // each(), eachAfter(), eachBefore() ---------------------------------------- -packRootNode = packRootNode.each(function (node) { +packRootNode = packRootNode.each((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyCircularNode console.log('Radius of node:', node.r); // node type is HierarchyCircularNode }); -packRootNode = packRootNode.eachAfter(function (node) { +packRootNode = packRootNode.eachAfter((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyCircularNode console.log('Radius of node:', node.r); // node type is HierarchyCircularNode }); -packRootNode = packRootNode.eachBefore(function (node) { +packRootNode = packRootNode.eachBefore((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyCircularNode console.log('Radius of node:', node.r); // node type is HierarchyCircularNode }); @@ -819,7 +800,6 @@ packRootNode = packRootNode.eachBefore(function (node) { let copiedPackNode: d3Hierarchy.HierarchyCircularNode; copiedPackNode = packRootNode.copy(); - // ----------------------------------------------------------------------- // Pack Siblings and Enclosure // ----------------------------------------------------------------------- @@ -828,7 +808,7 @@ interface CircleData extends d3Hierarchy.PackCircle { v: string; } -let circles: Array = [ +let circles: CircleData[] = [ { r: 10, v: 'a' }, { r: 1, v: 'b' }, { r: 20, v: 'c' } diff --git a/types/d3-hierarchy/index.d.ts b/types/d3-hierarchy/index.d.ts index bfe750b31e..a72dfa0aba 100644 --- a/types/d3-hierarchy/index.d.ts +++ b/types/d3-hierarchy/index.d.ts @@ -9,7 +9,6 @@ // Hierarchy // ----------------------------------------------------------------------- - export interface HierarchyLink { source: HierarchyNode; target: HierarchyNode; @@ -45,7 +44,6 @@ export interface HierarchyNode { copy(): HierarchyNode; } - export function hierarchy(data: Datum, children?: (d: Datum) => (Datum[] | null)): HierarchyNode; // ----------------------------------------------------------------------- @@ -54,7 +52,6 @@ export function hierarchy(data: Datum, children?: (d: Datum) => (Datum[] // TODO: Review the comment in the API documentation related to 'reserved properties': id, parentId, children. If this is refering to the element on node, it should be 'parent'? - export interface StratifyOperator { (data: Datum[]): HierarchyNode; id(): (d: Datum, i: number, data: Datum[]) => (string | null | '' | undefined); @@ -212,7 +209,6 @@ export function treemap(): TreemapLayout; // Tiling functions --------------------------------------------------------------------------------- - export function treemapBinary(node: HierarchyRectangularNode, x0: number, y0: number, x1: number, y1: number): void; export function treemapDice(node: HierarchyRectangularNode, x0: number, y0: number, x1: number, y1: number): void; export function treemapSlice(node: HierarchyRectangularNode, x0: number, y0: number, x1: number, y1: number): void; @@ -224,9 +220,8 @@ export interface RatioSquarifyTilingFactory { ratio(ratio: number): RatioSquarifyTilingFactory; } -export var treemapSquarify: RatioSquarifyTilingFactory; -export var treemapResquarify: RatioSquarifyTilingFactory; - +export const treemapSquarify: RatioSquarifyTilingFactory; +export const treemapResquarify: RatioSquarifyTilingFactory; // ----------------------------------------------------------------------- // Partition @@ -286,7 +281,6 @@ export interface HierarchyCircularNode { copy(): HierarchyCircularNode; } - export interface PackLayout { (root: HierarchyNode): HierarchyCircularNode; radius(): null | ((node: HierarchyCircularNode) => number); @@ -300,7 +294,6 @@ export interface PackLayout { export function pack(): PackLayout; - // ----------------------------------------------------------------------- // Pack Siblings and Enclosure // ----------------------------------------------------------------------- diff --git a/types/d3-hierarchy/tslint.json b/types/d3-hierarchy/tslint.json index a41bf5d19a..71ee04c4e1 100644 --- a/types/d3-hierarchy/tslint.json +++ b/types/d3-hierarchy/tslint.json @@ -1,79 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "no-unnecessary-generics": false } } From 9021588eb78834b502000a0fbac39fdfaa02245e Mon Sep 17 00:00:00 2001 From: Janeene Beeforth Date: Fri, 27 Apr 2018 08:00:29 +1000 Subject: [PATCH 0905/2153] [expo]: Add missing interfaces/classes for AdMob module. (#25258) * [expo]: Add missing interfaces/classes for AdMob module. This module has existed since SDK v21.0.0, but had not been added to the typescript definitions. The interface changed in SDK v26.0.0, so a split between v25 and v26 was required. * [expo]: Condense AdMob event listener functions. * Add missing backslash to v25 baseUrl & typeRoots. * Remove unintended whitespace format changes. * Merge LinearGradientProps change from pull 25149 to v25 definitions. --- types/expo/expo-tests.tsx | 40 + types/expo/index.d.ts | 78 +- types/expo/v23/expo-tests.tsx | 36 +- types/expo/v23/index.d.ts | 73 + types/expo/v24/expo-tests.tsx | 34 + types/expo/v24/index.d.ts | 73 + types/expo/v25/expo-tests.tsx | 732 +++++++++ types/expo/v25/index.d.ts | 2759 +++++++++++++++++++++++++++++++++ types/expo/v25/tsconfig.json | 33 + types/expo/v25/tslint.json | 7 + 10 files changed, 3863 insertions(+), 2 deletions(-) create mode 100644 types/expo/v25/expo-tests.tsx create mode 100644 types/expo/v25/index.d.ts create mode 100644 types/expo/v25/tsconfig.json create mode 100644 types/expo/v25/tslint.json diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index c40b76d93d..5df51127da 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -3,6 +3,10 @@ import { Text } from 'react-native'; import { Accelerometer, + AdMobAppEvent, + AdMobBanner, + AdMobInterstitial, + AdMobRewarded, Amplitude, Asset, AuthSession, @@ -26,6 +30,7 @@ import { KeepAwake, LinearGradient, Permissions, + PublisherBanner, registerRootComponent, ScreenOrientation, SQLite, @@ -47,6 +52,41 @@ Accelerometer.addListener((obj) => { Accelerometer.removeAllListeners(); Accelerometer.setUpdateInterval(1000); +() => ( + console.log(error)} + style={{ flex: 1 }} + /> +); + +() => ( + console.log(error)} + onAdMobDispatchAppEvent={(event: AdMobAppEvent) => console.log(event)} + style={{ flex: 1 }} + /> +); + +AdMobInterstitial.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id +AdMobInterstitial.setTestDeviceID('EMULATOR'); +async () => { + await AdMobInterstitial.requestAdAsync(); + await AdMobInterstitial.showAdAsync(); +}; + +AdMobRewarded.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id +AdMobRewarded.setTestDeviceID('EMULATOR'); +async () => { + await AdMobRewarded.requestAdAsync(); + await AdMobRewarded.showAdAsync(); +}; + Amplitude.initialize('key'); Amplitude.setUserId('userId'); Amplitude.setUserProperties({key: 1}); diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 8093b52861..ca946dd361 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for expo 25.0 +// Type definitions for expo 26.0 // Project: https://github.com/expo/expo-sdk // Definitions by: Konstantin Kai // Martynas Kadiša @@ -60,6 +60,82 @@ export namespace Accelerometer { function setUpdateInterval(intervalMs: number): void; } +/** + * Admob + */ +export type AdMobBannerSize = + | 'banner' + | 'largeBanner' + | 'mediumRectangle' + | 'fullBanner' + | 'leaderboard' + | 'smartBannerPortrait' + | 'smartBannerLandscape'; +export interface AdMobBannerProperties extends ViewProperties { + bannerSize?: AdMobBannerSize; + adUnitID?: string; + testDeviceID?: string; + didFailToReceiveAdWithError?(errorDescription: string): void; + adViewDidReceiveAd?(): void; + adViewWillPresentScreen?(): void; + adViewWillDismissScreen?(): void; + adViewDidDismissScreen?(): void; + adViewWillLeaveApplication?(): void; +} + +export class AdMobBanner extends Component { } +export interface AdMobAppEvent { + name: string; + info: string; +} +export interface PublisherBannerProperties extends AdMobBannerProperties { + onAdMobDispatchAppEvent?(event: AdMobAppEvent): void; +} +export class PublisherBanner extends Component { } + +export type AdMobInterstitialEmptyEvent = + | 'interstitialDidLoad' + | 'interstitialDidOpen' + | 'interstitialDidClose' + | 'interstitialWillLeaveApplication'; +export type AdMobInterstitialEvent = AdMobInterstitialEmptyEvent | 'interstitialDidFailToLoad'; +export namespace AdMobInterstitial { + function setAdUnitID(id: string): void; + function setTestDeviceID(id: string): void; + function requestAdAsync(): Promise; + function showAdAsync(): Promise; + function dismissAdAsync(): Promise; + function getIsReadyAsync(): Promise; + function addEventListener(event: 'interstitialDidFailToLoad', handler: (error: string) => void): void; + function addEventListener(event: AdMobInterstitialEmptyEvent, handler: () => void): void; + function removeEventListener(event: 'interstitialDidFailToLoad', handler: (error: string) => void): void; + function removeEventListener(event: AdMobInterstitialEmptyEvent, handler: () => void): void; + function removeAllListeners(): void; +} + +export type AdMobRewardedEmptyEvent = + | 'rewardedVideoDidLoad' + | 'rewardedVideoDidOpen' + | 'rewardedVideoDidStart' + | 'rewardedVideoDidClose' + | 'rewardedVideoWillLeaveApplication'; +export type AdMobRewardedEvent = AdMobRewardedEmptyEvent | 'rewardedVideoDidRewardUser' | 'rewardedVideoDidFailToLoad'; +export namespace AdMobRewarded { + function setAdUnitID(id: string): void; + function setTestDeviceID(id: string): void; + function requestAdAsync(): Promise; + function showAdAsync(): Promise; + function dismissAdAsync(): Promise; + function getIsReadyAsync(): Promise; + function addEventListener(event: 'rewardedVideoDidRewardUser', handler: (type: string, amount: number) => void): void; + function addEventListener(event: 'rewardedVideoDidFailToLoad', handler: (error: string) => void): void; + function addEventListener(event: AdMobRewardedEmptyEvent, handler: () => void): void; + function removeEventListener(event: 'rewardedVideoDidRewardUser', handler: (type: string, amount: number) => void): void; + function removeEventListener(event: 'rewardedVideoDidFailToLoad', handler: (error: string) => void): void; + function removeEventListener(event: AdMobRewardedEmptyEvent, handler: () => void): void; + function removeAllListeners(): void; +} + /** * Provides access to Amplitude mobile analytics which basically lets you log various events to the Cloud. This module wraps Amplitude’s iOS and Android SDKs. * diff --git a/types/expo/v23/expo-tests.tsx b/types/expo/v23/expo-tests.tsx index 51b3f30d39..c076bbbce1 100644 --- a/types/expo/v23/expo-tests.tsx +++ b/types/expo/v23/expo-tests.tsx @@ -2,6 +2,10 @@ import * as React from 'react'; import { Accelerometer, + AdMobAppEvent, + AdMobBanner, + AdMobInterstitial, + AdMobRewarded, Amplitude, Asset, AuthSession, @@ -16,7 +20,8 @@ import { Facebook, FacebookAds, FileSystem, - ImagePicker + ImagePicker, + PublisherBanner } from 'expo'; Accelerometer.addListener((obj) => { @@ -27,6 +32,35 @@ Accelerometer.addListener((obj) => { Accelerometer.removeAllListeners(); Accelerometer.setUpdateInterval(1000); +() => ( + console.log(error)} + style={{ flex: 1 }} + /> +); + +() => ( + console.log(error)} + admobDispatchAppEvent={(event: AdMobAppEvent) => console.log(event)} + style={{ flex: 1 }} + /> +); + +AdMobInterstitial.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id +AdMobInterstitial.setTestDeviceID('EMULATOR'); +AdMobInterstitial.requestAd(() => AdMobInterstitial.showAd()); + +AdMobRewarded.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id +AdMobRewarded.setTestDeviceID('EMULATOR'); +AdMobRewarded.requestAd(() => AdMobRewarded.showAd()); + Amplitude.initialize('key'); Amplitude.setUserId('userId'); Amplitude.setUserProperties({key: 1}); diff --git a/types/expo/v23/index.d.ts b/types/expo/v23/index.d.ts index 322c1b3c6a..4b00b57a56 100644 --- a/types/expo/v23/index.d.ts +++ b/types/expo/v23/index.d.ts @@ -42,6 +42,79 @@ export namespace Accelerometer { function setUpdateInterval(intervalMs: number): void; } +/** + * Admob + */ +export type AdMobBannerSize = + | 'banner' + | 'largeBanner' + | 'mediumRectangle' + | 'fullBanner' + | 'leaderboard' + | 'smartBannerPortrait' + | 'smartBannerLandscape'; +export interface AdMobBannerProperties extends ViewProperties { + bannerSize?: AdMobBannerSize; + adUnitID?: string; + testDeviceID?: string; + didFailToReceiveAdWithError?(errorDescription: string): void; + adViewDidReceiveAd?(): void; + adViewWillPresentScreen?(): void; + adViewWillDismissScreen?(): void; + adViewDidDismissScreen?(): void; + adViewWillLeaveApplication?(): void; +} + +export class AdMobBanner extends Component { } + +export interface AdMobAppEvent { + name: string; + info: string; +} +export interface PublisherBannerProperties extends AdMobBannerProperties { + admobDispatchAppEvent?(event: AdMobAppEvent): void; +} +export class PublisherBanner extends Component { } + +export type AdMobInterstitialEmptyEvent = + | 'interstitialDidLoad' + | 'interstitialDidOpen' + | 'interstitialDidClose' + | 'interstitialWillLeaveApplication'; +export type AdMobInterstitialEvent = AdMobInterstitialEmptyEvent | 'interstitialVideoDidFailToLoad'; +export namespace AdMobInterstitial { + function setAdUnitID(id: string): void; + function setTestDeviceID(id: string): void; + function requestAd(callback?: () => void): void; + function showAd(callback?: (error: string) => void): void; + function isReady(callback: (isReady: boolean) => void): void; + function addEventListener(event: 'interstitialDidFailToLoad', handler: (error: string) => void): void; + function addEventListener(event: AdMobInterstitialEmptyEvent, handler: () => void): void; + function removeEventListener(event: 'interstitialDidFailToLoad', handler: (error: string) => void): void; + function removeEventListener(event: AdMobInterstitialEmptyEvent, handler: () => void): void; + function removeAllListeners(): void; +} + +export type AdMobRewardedEmptyEvent = + | 'rewardedVideoDidLoad' + | 'rewardedVideoDidOpen' + | 'rewardedVideoDidClose' + | 'rewardedVideoWillLeaveApplication'; +export type AdMobRewardedEvent = AdMobRewardedEmptyEvent | 'rewardedVideoDidRewardUser' | 'rewardedVideoDidFailToLoad'; +export namespace AdMobRewarded { + function setAdUnitID(id: string): void; + function setTestDeviceID(id: string): void; + function requestAd(callback?: () => void): void; + function showAd(callback?: (error: string) => void): void; + function addEventListener(event: 'rewardedVideoDidRewardUser', handler: (type: string, amount: number) => void): void; + function addEventListener(event: 'rewardedVideoDidFailToLoad', handler: (error: string) => void): void; + function addEventListener(event: AdMobRewardedEmptyEvent, handler: () => void): void; + function removeEventListener(event: 'rewardedVideoDidRewardUser', handler: (type: string, amount: number) => void): void; + function removeEventListener(event: 'rewardedVideoDidFailToLoad', handler: (error: string) => void): void; + function removeEventListener(event: AdMobRewardedEmptyEvent, handler: () => void): void; + function removeAllListeners(): void; +} + /** * Amplitude */ diff --git a/types/expo/v24/expo-tests.tsx b/types/expo/v24/expo-tests.tsx index 8749a5993c..308e2de089 100644 --- a/types/expo/v24/expo-tests.tsx +++ b/types/expo/v24/expo-tests.tsx @@ -3,6 +3,10 @@ import { Text } from 'react-native'; import { Accelerometer, + AdMobAppEvent, + AdMobBanner, + AdMobInterstitial, + AdMobRewarded, Amplitude, Asset, AuthSession, @@ -26,6 +30,7 @@ import { KeepAwake, LinearGradient, Permissions, + PublisherBanner, registerRootComponent, ScreenOrientation } from 'expo'; @@ -38,6 +43,35 @@ Accelerometer.addListener((obj) => { Accelerometer.removeAllListeners(); Accelerometer.setUpdateInterval(1000); +() => ( + console.log(error)} + style={{ flex: 1 }} + /> +); + +() => ( + console.log(error)} + admobDispatchAppEvent={(event: AdMobAppEvent) => console.log(event)} + style={{ flex: 1 }} + /> +); + +AdMobInterstitial.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id +AdMobInterstitial.setTestDeviceID('EMULATOR'); +AdMobInterstitial.requestAd(() => AdMobInterstitial.showAd()); + +AdMobRewarded.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id +AdMobRewarded.setTestDeviceID('EMULATOR'); +AdMobRewarded.requestAd(() => AdMobRewarded.showAd()); + Amplitude.initialize('key'); Amplitude.setUserId('userId'); Amplitude.setUserProperties({key: 1}); diff --git a/types/expo/v24/index.d.ts b/types/expo/v24/index.d.ts index e6a238d129..2192912c88 100644 --- a/types/expo/v24/index.d.ts +++ b/types/expo/v24/index.d.ts @@ -59,6 +59,79 @@ export namespace Accelerometer { function setUpdateInterval(intervalMs: number): void; } +/** + * Admob + */ +export type AdMobBannerSize = + | 'banner' + | 'largeBanner' + | 'mediumRectangle' + | 'fullBanner' + | 'leaderboard' + | 'smartBannerPortrait' + | 'smartBannerLandscape'; +export interface AdMobBannerProperties extends ViewProperties { + bannerSize?: AdMobBannerSize; + adUnitID?: string; + testDeviceID?: string; + didFailToReceiveAdWithError?(errorDescription: string): void; + adViewDidReceiveAd?(): void; + adViewWillPresentScreen?(): void; + adViewWillDismissScreen?(): void; + adViewDidDismissScreen?(): void; + adViewWillLeaveApplication?(): void; +} + +export class AdMobBanner extends Component { } + +export interface AdMobAppEvent { + name: string; + info: string; +} +export interface PublisherBannerProperties extends AdMobBannerProperties { + admobDispatchAppEvent?(event: AdMobAppEvent): void; +} +export class PublisherBanner extends Component { } + +export type AdMobInterstitialEmptyEvent = + | 'interstitialDidLoad' + | 'interstitialDidOpen' + | 'interstitialDidClose' + | 'interstitialWillLeaveApplication'; +export type AdMobInterstitialEvent = AdMobInterstitialEmptyEvent | 'interstitialVideoDidFailToLoad'; +export namespace AdMobInterstitial { + function setAdUnitID(id: string): void; + function setTestDeviceID(id: string): void; + function requestAd(callback?: () => void): void; + function showAd(callback?: (error: string) => void): void; + function isReady(callback: (isReady: boolean) => void): void; + function addEventListener(event: 'interstitialDidFailToLoad', handler: (error: string) => void): void; + function addEventListener(event: AdMobInterstitialEmptyEvent, handler: () => void): void; + function removeEventListener(event: 'interstitialDidFailToLoad', handler: (error: string) => void): void; + function removeEventListener(event: AdMobInterstitialEmptyEvent, handler: () => void): void; + function removeAllListeners(): void; +} + +export type AdMobRewardedEmptyEvent = + | 'rewardedVideoDidLoad' + | 'rewardedVideoDidOpen' + | 'rewardedVideoDidClose' + | 'rewardedVideoWillLeaveApplication'; +export type AdMobRewardedEvent = AdMobRewardedEmptyEvent | 'rewardedVideoDidRewardUser' | 'rewardedVideoDidFailToLoad'; +export namespace AdMobRewarded { + function setAdUnitID(id: string): void; + function setTestDeviceID(id: string): void; + function requestAd(callback?: () => void): void; + function showAd(callback?: (error: string) => void): void; + function addEventListener(event: 'rewardedVideoDidRewardUser', handler: (type: string, amount: number) => void): void; + function addEventListener(event: 'rewardedVideoDidFailToLoad', handler: (error: string) => void): void; + function addEventListener(event: AdMobRewardedEmptyEvent, handler: () => void): void; + function removeEventListener(event: 'rewardedVideoDidRewardUser', handler: (type: string, amount: number) => void): void; + function removeEventListener(event: 'rewardedVideoDidFailToLoad', handler: (error: string) => void): void; + function removeEventListener(event: AdMobRewardedEmptyEvent, handler: () => void): void; + function removeAllListeners(): void; +} + /** * Provides access to Amplitude mobile analytics which basically lets you log various events to the Cloud. This module wraps Amplitude’s iOS and Android SDKs. * diff --git a/types/expo/v25/expo-tests.tsx b/types/expo/v25/expo-tests.tsx new file mode 100644 index 0000000000..afcb006949 --- /dev/null +++ b/types/expo/v25/expo-tests.tsx @@ -0,0 +1,732 @@ +import * as React from 'react'; +import { Text } from 'react-native'; + +import { + Accelerometer, + AdMobAppEvent, + AdMobBanner, + AdMobInterstitial, + AdMobRewarded, + Amplitude, + Asset, + AuthSession, + Audio, + AppLoading, + BarCodeScanner, + BlurViewProps, + BlurView, + Brightness, + Camera, + CameraObject, + DocumentPicker, + Facebook, + FacebookAds, + FileSystem, + ImagePicker, + ImageManipulator, + FaceDetector, + Svg, + IntentLauncherAndroid, + KeepAwake, + LinearGradient, + Permissions, + PublisherBanner, + registerRootComponent, + ScreenOrientation, + SQLite, + Calendar, + MailComposer +} from 'expo'; + +Accelerometer.addListener((obj) => { + obj.x; + obj.y; + obj.z; +}); +Accelerometer.removeAllListeners(); +Accelerometer.setUpdateInterval(1000); + +() => ( + console.log(error)} + style={{ flex: 1 }} + /> +); + +() => ( + console.log(error)} + admobDispatchAppEvent={(event: AdMobAppEvent) => console.log(event)} + style={{ flex: 1 }} + /> +); + +AdMobInterstitial.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id +AdMobInterstitial.setTestDeviceID('EMULATOR'); +AdMobInterstitial.requestAd(() => AdMobInterstitial.showAd()); + +AdMobRewarded.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id +AdMobRewarded.setTestDeviceID('EMULATOR'); +AdMobRewarded.requestAd(() => AdMobRewarded.showAd()); + +Amplitude.initialize('key'); +Amplitude.setUserId('userId'); +Amplitude.setUserProperties({key: 1}); +Amplitude.clearUserProperties(); +Amplitude.logEvent('name'); +Amplitude.logEventWithProperties('event', {key: 'value'}); +Amplitude.setGroup('type', ['value']); + +const asset = Asset.fromModule(1); +asset.downloadAsync(); +Asset.loadAsync(1); +Asset.loadAsync([1, 2, 3]); +const asset1 = new Asset({ + uri: 'uri', + type: 'type', + name: 'name', + hash: 'hash', + width: 122, + height: 122 +}); + +const url = AuthSession.getRedirectUrl(); +AuthSession.dismiss(); +AuthSession.startAsync({ + authUrl: 'url1', + returnUrl: 'url2' +}).then(result => { + switch (result.type) { + case 'success': + result.event; + result.params; + break; + case 'error': + result.errorCode; + result.params; + result.event; + break; + case 'dismissed': + case 'cancel': + result.type; + break; + } +}); +AuthSession.startAsync({ + authUrl: 'url1', + returnUrl: undefined +}); + +Audio.setAudioModeAsync({ + shouldDuckAndroid: false, + playsInSilentModeIOS: true, + interruptionModeIOS: 2, + interruptionModeAndroid: 1, + allowsRecordingIOS: true +}); +Audio.setIsEnabledAsync(true); + +Audio.INTERRUPTION_MODE_IOS_MIX_WITH_OTHERS === 0; +Audio.INTERRUPTION_MODE_IOS_DO_NOT_MIX === 1; +Audio.INTERRUPTION_MODE_IOS_DUCK_OTHERS === 2; + +Audio.INTERRUPTION_MODE_ANDROID_DO_NOT_MIX === 1; +Audio.INTERRUPTION_MODE_ANDROID_DUCK_OTHERS === 2; + +Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_DEFAULT === 0; +Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_THREE_GPP === 1; +Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_MPEG_4 === 2; +Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AMR_NB === 3; +Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AMR_WB === 4; +Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AAC_ADIF === 5; +Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AAC_ADTS === 6; +Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_RTP_AVP === 7; +Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_MPEG2TS === 8; +Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_WEBM === 9; + +Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_DEFAULT === 0; +Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AMR_NB === 1; +Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AMR_WB === 2; +Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AAC === 3; +Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_HE_AAC === 4; +Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AAC_ELD === 5; +Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_VORBIS === 6; + +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_LINEARPCM === 'lpcm'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AC3 === 'ac-3'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_60958AC3 === 'cac3'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_APPLEIMA4 === 'ima4'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC === 'aac '; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4CELP === 'celp'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4HVXC === 'hvxc'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4TWINVQ === 'twvq'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MACE3 === 'MAC3'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MACE6 === 'MAC6'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_ULAW === 'ulaw'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_ALAW === 'alaw'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_QDESIGN === 'QDMC'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_QDESIGN2 === 'QDM2'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_QUALCOMM === 'Qclp'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER1 === '.mp1'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER2 === '.mp2'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER3 === '.mp3'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_APPLELOSSLESS === 'alac'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_HE === 'aach'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_LD === 'aacl'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD === 'aace'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD_SBR === 'aacf'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD_V2 === 'aacg'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_HE_V2 === 'aacp'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_SPATIAL === 'aacs'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AMR === 'samr'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AMR_WB === 'sawb'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AUDIBLE === 'AUDB'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_ILBC === 'ilbc'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_DVIINTELIMA === 0x6d730011; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MICROSOFTGSM === 0x6d730031; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AES3 === 'aes3'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_ENHANCEDAC3 === 'ec-3'; + +Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_MIN === 0; +Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_LOW === 0x20; +Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_MEDIUM === 0x40; +Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_HIGH === 0x60; +Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_MAX === 0x7f; + +Audio.RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_CONSTANT === 0; +Audio.RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_LONG_TERM_AVERAGE === 1; +Audio.RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_VARIABLE_CONSTRAINED === 2; +Audio.RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_VARIABLE === 3; + +Audio.RECORDING_OPTIONS_PRESET_HIGH_QUALITY; +Audio.RECORDING_OPTIONS_PRESET_LOW_QUALITY; +async () => { + const result = await Audio.Sound.create({uri: 'uri'}, { + volume: 0.5, + rate: 0.6 + }, null, true); + + const sound = result.sound; + const status = result.status; + + if (!status.isLoaded) { + status.error; + } else { + status.didJustFinish; + // etc. + } + + const _status = await sound.getStatusAsync(); + await sound.loadAsync({uri: 'uri'}); +}; + +() => ( + Promise.resolve()} + onFinish={() => {}} + onError={(error) => console.log(error)} /> +); +() => ( + +); + +const barcodeReadCallback = () => {}; +() => ( + +); + +() => ( + +); + +async () => { + await Brightness.setBrightnessAsync(.6); + await Brightness.setSystemBrightnessAsync(.7); + const br1 = await Brightness.getBrightnessAsync(); + const br2 = await Brightness.getSystemBrightnessAsync(); +}; + +Camera.Constants.AutoFocus; +Camera.Constants.Type; +Camera.Constants.FlashMode; +Camera.Constants.WhiteBalance; +Camera.Constants.VideoQuality; +Camera.Constants.BarCodeType; +() => { + return( { + if (component) { + component.recordAsync(); + } + }} />); +}; + +async () => { + const result = await DocumentPicker.getDocumentAsync(); + + if (result.type === 'success') { + result.name; + result.uri; + result.size; + } +}; + +async () => { + const { type, expires, token } = await Facebook.logInWithReadPermissionsAsync("appId"); +}; + +() => ( + {}} + onError={() => {}} /> +); + +async () => { + const info = await FileSystem.getInfoAsync('file'); + + info.exists; + info.isDirectory; + + if (info.exists) { + info.md5; + info.uri; + info.size; + info.modificationTime; + } + + const string: string = await FileSystem.readAsStringAsync('file'); + await FileSystem.writeAsStringAsync('file', 'content'); + await FileSystem.deleteAsync('file'); + await FileSystem.moveAsync({ from: 'from', to: 'to'}); + await FileSystem.copyAsync({ from: 'from', to: 'to' }); + await FileSystem.makeDirectoryAsync('dir'); + const dirs: string[] = await FileSystem.readDirectoryAsync('dir'); + const result = await FileSystem.downloadAsync('from', 'to'); + + result.headers; + result.status; + result.uri; + result.md5; +}; + +async () => { + // Video test + const result = await ImagePicker.launchImageLibraryAsync({ + mediaTypes: ImagePicker.MediaTypeOptions.Videos, + }); + + if (!result.cancelled) { + result.uri; + result.width; + result.height; + result.duration; + result.type; + } +}; + +async () => { + // Image test + const result = await ImagePicker.launchImageLibraryAsync({ + mediaTypes: ImagePicker.MediaTypeOptions.Images, + base64: true, + aspect: [4, 3], + quality: 1, + exif: true, + }); + + if (!result.cancelled) { + result.uri; + result.width; + result.height; + result.exif; + result.base64; + result.type; + } +}; + +async () => { + const result = await ImageManipulator.manipulate('url', { + rotate: 90 + }, { + compress: 0.5 + }); + + result.height; + result.uri; + result.width; +}; + +FaceDetector.Constants.Mode.fast; +FaceDetector.Constants.Mode.accurate; +FaceDetector.Constants.Landmarks.all; +FaceDetector.Constants.Landmarks.none; +FaceDetector.Constants.Classifications.all; +FaceDetector.Constants.Classifications.none; +async () => { + const result = await FaceDetector.detectFaces('url', { + mode: FaceDetector.Constants.Mode.fast, + detectLandmarks: FaceDetector.Constants.Landmarks.all, + runClassifications: FaceDetector.Constants.Classifications.none + }); + + result.faces[0]; +}; + +() => ( + + + + + + + + + STROKED TEXT + + + + + + + + We go up and down, + then up again + + + + + + + + + + + + + + + + + + + + + +); + +IntentLauncherAndroid.ACTION_ACCESSIBILITY_SETTINGS === 'android.settings.ACCESSIBILITY_SETTINGS'; +IntentLauncherAndroid.ACTION_APP_NOTIFICATION_REDACTION === 'android.settings.ACTION_APP_NOTIFICATION_REDACTION'; +IntentLauncherAndroid.ACTION_CONDITION_PROVIDER_SETTINGS === 'android.settings.ACTION_CONDITION_PROVIDER_SETTINGS'; +IntentLauncherAndroid.ACTION_NOTIFICATION_LISTENER_SETTINGS === 'android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS'; +IntentLauncherAndroid.ACTION_PRINT_SETTINGS === 'android.settings.ACTION_PRINT_SETTINGS'; +IntentLauncherAndroid.ACTION_ADD_ACCOUNT_SETTINGS === 'android.settings.ADD_ACCOUNT_SETTINGS'; +IntentLauncherAndroid.ACTION_AIRPLANE_MODE_SETTINGS === 'android.settings.AIRPLANE_MODE_SETTINGS'; +IntentLauncherAndroid.ACTION_APN_SETTINGS === 'android.settings.APN_SETTINGS'; +IntentLauncherAndroid.ACTION_APPLICATION_DETAILS_SETTINGS === 'android.settings.APPLICATION_DETAILS_SETTINGS'; +IntentLauncherAndroid.ACTION_APPLICATION_DEVELOPMENT_SETTINGS === 'android.settings.APPLICATION_DEVELOPMENT_SETTINGS'; +IntentLauncherAndroid.ACTION_APPLICATION_SETTINGS === 'android.settings.APPLICATION_SETTINGS'; +IntentLauncherAndroid.ACTION_APP_NOTIFICATION_SETTINGS === 'android.settings.APP_NOTIFICATION_SETTINGS'; +IntentLauncherAndroid.ACTION_APP_OPS_SETTINGS === 'android.settings.APP_OPS_SETTINGS'; +IntentLauncherAndroid.ACTION_BATTERY_SAVER_SETTINGS === 'android.settings.BATTERY_SAVER_SETTINGS'; +IntentLauncherAndroid.ACTION_BLUETOOTH_SETTINGS === 'android.settings.BLUETOOTH_SETTINGS'; +IntentLauncherAndroid.ACTION_CAPTIONING_SETTINGS === 'android.settings.CAPTIONING_SETTINGS'; +IntentLauncherAndroid.ACTION_CAST_SETTINGS === 'android.settings.CAST_SETTINGS'; +IntentLauncherAndroid.ACTION_DATA_ROAMING_SETTINGS === 'android.settings.DATA_ROAMING_SETTINGS'; +IntentLauncherAndroid.ACTION_DATE_SETTINGS === 'android.settings.DATE_SETTINGS'; +IntentLauncherAndroid.ACTION_DEVICE_INFO_SETTINGS === 'android.settings.DEVICE_INFO_SETTINGS'; +IntentLauncherAndroid.ACTION_DEVICE_NAME === 'android.settings.DEVICE_NAME'; +IntentLauncherAndroid.ACTION_DISPLAY_SETTINGS === 'android.settings.DISPLAY_SETTINGS'; +IntentLauncherAndroid.ACTION_DREAM_SETTINGS === 'android.settings.DREAM_SETTINGS'; +IntentLauncherAndroid.ACTION_HARD_KEYBOARD_SETTINGS === 'android.settings.HARD_KEYBOARD_SETTINGS'; +IntentLauncherAndroid.ACTION_HOME_SETTINGS === 'android.settings.HOME_SETTINGS'; +IntentLauncherAndroid.ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS === 'android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS'; +IntentLauncherAndroid.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS === 'android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS'; +IntentLauncherAndroid.ACTION_INPUT_METHOD_SETTINGS === 'android.settings.INPUT_METHOD_SETTINGS'; +IntentLauncherAndroid.ACTION_INPUT_METHOD_SUBTYPE_SETTINGS === 'android.settings.INPUT_METHOD_SUBTYPE_SETTINGS'; +IntentLauncherAndroid.ACTION_INTERNAL_STORAGE_SETTINGS === 'android.settings.INTERNAL_STORAGE_SETTINGS'; +IntentLauncherAndroid.ACTION_LOCALE_SETTINGS === 'android.settings.LOCALE_SETTINGS'; +IntentLauncherAndroid.ACTION_LOCATION_SOURCE_SETTINGS === 'android.settings.LOCATION_SOURCE_SETTINGS'; +IntentLauncherAndroid.ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS === 'android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS'; +IntentLauncherAndroid.ACTION_MANAGE_APPLICATIONS_SETTINGS === 'android.settings.MANAGE_APPLICATIONS_SETTINGS'; +IntentLauncherAndroid.ACTION_MANAGE_DEFAULT_APPS_SETTINGS === 'android.settings.MANAGE_DEFAULT_APPS_SETTINGS'; +IntentLauncherAndroid.ACTION_MEMORY_CARD_SETTINGS === 'android.settings.MEMORY_CARD_SETTINGS'; +IntentLauncherAndroid.ACTION_MONITORING_CERT_INFO === 'android.settings.MONITORING_CERT_INFO'; +IntentLauncherAndroid.ACTION_NETWORK_OPERATOR_SETTINGS === 'android.settings.NETWORK_OPERATOR_SETTINGS'; +IntentLauncherAndroid.ACTION_NFCSHARING_SETTINGS === 'android.settings.NFCSHARING_SETTINGS'; +IntentLauncherAndroid.ACTION_NFC_PAYMENT_SETTINGS === 'android.settings.NFC_PAYMENT_SETTINGS'; +IntentLauncherAndroid.ACTION_NFC_SETTINGS === 'android.settings.NFC_SETTINGS'; +IntentLauncherAndroid.ACTION_NIGHT_DISPLAY_SETTINGS === 'android.settings.NIGHT_DISPLAY_SETTINGS'; +IntentLauncherAndroid.ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS === 'android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS'; +IntentLauncherAndroid.ACTION_NOTIFICATION_SETTINGS === 'android.settings.NOTIFICATION_SETTINGS'; +IntentLauncherAndroid.ACTION_PAIRING_SETTINGS === 'android.settings.PAIRING_SETTINGS'; +IntentLauncherAndroid.ACTION_PRIVACY_SETTINGS === 'android.settings.PRIVACY_SETTINGS'; +IntentLauncherAndroid.ACTION_QUICK_LAUNCH_SETTINGS === 'android.settings.QUICK_LAUNCH_SETTINGS'; +IntentLauncherAndroid.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS === 'android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS'; +IntentLauncherAndroid.ACTION_SECURITY_SETTINGS === 'android.settings.SECURITY_SETTINGS'; +IntentLauncherAndroid.ACTION_SETTINGS === 'android.settings.SETTINGS'; +IntentLauncherAndroid.ACTION_SHOW_ADMIN_SUPPORT_DETAILS === 'android.settings.SHOW_ADMIN_SUPPORT_DETAILS'; +IntentLauncherAndroid.ACTION_SHOW_INPUT_METHOD_PICKER === 'android.settings.SHOW_INPUT_METHOD_PICKER'; +IntentLauncherAndroid.ACTION_SHOW_REGULATORY_INFO === 'android.settings.SHOW_REGULATORY_INFO'; +IntentLauncherAndroid.ACTION_SHOW_REMOTE_BUGREPORT_DIALOG === 'android.settings.SHOW_REMOTE_BUGREPORT_DIALOG'; +IntentLauncherAndroid.ACTION_SOUND_SETTINGS === 'android.settings.SOUND_SETTINGS'; +IntentLauncherAndroid.ACTION_STORAGE_MANAGER_SETTINGS === 'android.settings.STORAGE_MANAGER_SETTINGS'; +IntentLauncherAndroid.ACTION_SYNC_SETTINGS === 'android.settings.SYNC_SETTINGS'; +IntentLauncherAndroid.ACTION_SYSTEM_UPDATE_SETTINGS === 'android.settings.SYSTEM_UPDATE_SETTINGS'; +IntentLauncherAndroid.ACTION_TETHER_PROVISIONING_UI === 'android.settings.TETHER_PROVISIONING_UI'; +IntentLauncherAndroid.ACTION_TRUSTED_CREDENTIALS_USER === 'android.settings.TRUSTED_CREDENTIALS_USER'; +IntentLauncherAndroid.ACTION_USAGE_ACCESS_SETTINGS === 'android.settings.USAGE_ACCESS_SETTINGS'; +IntentLauncherAndroid.ACTION_USER_DICTIONARY_INSERT === 'android.settings.USER_DICTIONARY_INSERT'; +IntentLauncherAndroid.ACTION_USER_DICTIONARY_SETTINGS === 'android.settings.USER_DICTIONARY_SETTINGS'; +IntentLauncherAndroid.ACTION_USER_SETTINGS === 'android.settings.USER_SETTINGS'; +IntentLauncherAndroid.ACTION_VOICE_CONTROL_AIRPLANE_MODE === 'android.settings.VOICE_CONTROL_AIRPLANE_MODE'; +IntentLauncherAndroid.ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE === 'android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE'; +IntentLauncherAndroid.ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE === 'android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE'; +IntentLauncherAndroid.ACTION_VOICE_INPUT_SETTINGS === 'android.settings.VOICE_INPUT_SETTINGS'; +IntentLauncherAndroid.ACTION_VPN_SETTINGS === 'android.settings.VPN_SETTINGS'; +IntentLauncherAndroid.ACTION_VR_LISTENER_SETTINGS === 'android.settings.VR_LISTENER_SETTINGS'; +IntentLauncherAndroid.ACTION_WEBVIEW_SETTINGS === 'android.settings.WEBVIEW_SETTINGS'; +IntentLauncherAndroid.ACTION_WIFI_IP_SETTINGS === 'android.settings.WIFI_IP_SETTINGS'; +IntentLauncherAndroid.ACTION_WIFI_SETTINGS === 'android.settings.WIFI_SETTINGS'; +IntentLauncherAndroid.ACTION_WIRELESS_SETTINGS === 'android.settings.WIRELESS_SETTINGS'; +IntentLauncherAndroid.ACTION_ZEN_MODE_AUTOMATION_SETTINGS === 'android.settings.ZEN_MODE_AUTOMATION_SETTINGS'; +IntentLauncherAndroid.ACTION_ZEN_MODE_EVENT_RULE_SETTINGS === 'android.settings.ZEN_MODE_EVENT_RULE_SETTINGS'; +IntentLauncherAndroid.ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS === 'android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS'; +IntentLauncherAndroid.ACTION_ZEN_MODE_PRIORITY_SETTINGS === 'android.settings.ZEN_MODE_PRIORITY_SETTINGS'; +IntentLauncherAndroid.ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS === 'android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS'; +IntentLauncherAndroid.ACTION_ZEN_MODE_SETTINGS === 'android.settings.ZEN_MODE_SETTINGS'; + +KeepAwake.activate(); +KeepAwake.deactivate(); + +() => ( + +); + +() => ( + +); + +Permissions.CAMERA === 'camera'; +Permissions.CAMERA_ROLL === 'cameraRoll'; +Permissions.AUDIO_RECORDING === 'audioRecording'; +Permissions.CONTACTS === 'contacts'; +Permissions.NOTIFICATIONS === 'remoteNotifications'; +Permissions.REMOTE_NOTIFICATIONS === 'remoteNotifications'; +Permissions.SYSTEM_BRIGHTNESS === 'systemBrightness'; +async () => { + const result = await Permissions.askAsync(Permissions.CAMERA); + + result.status === 'granted'; + result.status === 'denied'; + result.status === 'undetermined'; + + result.expires === 'never'; +}; + +ScreenOrientation.Orientation.ALL; +ScreenOrientation.allow(ScreenOrientation.Orientation.ALL); + +class __TestEntry__ extends React.Component { + render() { + return( + test + ); + } +} +registerRootComponent(__TestEntry__); + +Calendar.EntityTypes.EVENT === 'event'; +Calendar.EntityTypes.REMINDER === 'reminder'; + +Calendar.CalendarType.LOCAL === 'local'; +Calendar.CalendarType.CALDAV === 'caldav'; +Calendar.CalendarType.EXCHANGE === 'exchange'; +Calendar.CalendarType.SUBSCRIBED === 'subscribed'; +Calendar.CalendarType.BIRTHDAYS === 'birthdays'; + +async () => { + const result = await Calendar.getCalendarsAsync(Calendar.EntityTypes.EVENT); + result.length; + + const calendar = result[0]; + calendar.id === ''; + calendar.title === ''; + calendar.sourceId === ''; + calendar.type === Calendar.CalendarType.BIRTHDAYS; + calendar.color === ''; + calendar.entityType === Calendar.EntityTypes.EVENT; + calendar.allowsModifications === true; + calendar.allowedAvailabilities === ['']; + calendar.isPrimary === true; + calendar.name === ''; + calendar.ownerAccount === ''; + calendar.timeZone === ''; + calendar.allowedReminders === ['']; + calendar.allowedAttendeeTypes === ['']; + calendar.isVisible === false; + calendar.isSynced === false; + calendar.accessLevel === Calendar.CalendarAccessLevel.CONTRIBUTOR; + + if (calendar.source) { + calendar.source.id === ''; + calendar.source.type === ''; + calendar.source.name === ''; + calendar.source.isLocalAccount === false; + } + + const id1 = await Calendar.createCalendarAsync({ + accessLevel: Calendar.CalendarAccessLevel.EDITOR + }); + + id1 === ''; + + const id2 = await Calendar.updateCalendarAsync('1234', { + isVisible: false + }); + + id2 === ''; + + const id3 = await Calendar.updateCalendarAsync('1234', null); + + await Calendar.deleteCalendarAsync('1234'); + + const events = await Calendar.getEventsAsync( + ['123', '124'], + new Date(), + new Date() + ); + + const event1 = events[0]; + + event1.accessLevel === Calendar.EventAccessLevel.CONFIDENTIAL; + event1.alarms === []; + event1.allDay === true; + event1.availability === Calendar.Availability.FREE; + event1.calendarId === ''; + event1.creationDate === ''; + event1.endDate === ''; + event1.endTimeZone === ''; + event1.guestsCanInviteOthers === true; + event1.guestsCanModify === true; + event1.guestsCanSeeGuests === false; + event1.id === ''; + event1.instanceId === ''; + event1.isDetached === false; + + const event2 = await Calendar.getEventAsync('123', { + futureEvents: true + }); + + const eventId1 = await Calendar.createEventAsync('123'); + + const eventId2 = await Calendar.updateEventAsync('1234'); + + await Calendar.deleteEventAsync('1234'); + + const attendees = await Calendar.getAttendeesForEventAsync('123'); + + const aId1 = await Calendar.createAttendeeAsync('123'); + + const aId2 = await Calendar.updateAttendeeAsync('123'); + + await Calendar.deleteAttendeeAsync('123'); + + const reminders = await Calendar.getRemindersAsync(['123']); + + const reminder = await Calendar.getReminderAsync('123'); + + const remId1 = await Calendar.createReminderAsync('123'); + + const remId2 = await Calendar.updateReminderAsync('123'); + + await Calendar.deleteReminderAsync('123'); + + const sources = await Calendar.getSourcesAsync(); + + const source = await Calendar.getSourceAsync('123'); + + Calendar.openEventInCalendar('123'); +}; + +async () => { + const result = await MailComposer.composeAsync({ + subject: 'sss' + }); + + result.status === 'saved'; +}; diff --git a/types/expo/v25/index.d.ts b/types/expo/v25/index.d.ts new file mode 100644 index 0000000000..101856e288 --- /dev/null +++ b/types/expo/v25/index.d.ts @@ -0,0 +1,2759 @@ +// Type definitions for expo 25.0 +// Project: https://github.com/expo/expo-sdk +// Definitions by: Konstantin Kai +// Martynas Kadiša +// Jan Aagaard +// Sergio Sánchez +// Fernando Helwanger +// Umidbek Karimov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import { EventSubscription } from 'fbemitter'; +import { Component, ComponentClass, Ref, ComponentType } from 'react'; +import { + ColorPropType, + ImageRequireSource, + ImageURISource, + NativeEventEmitter, + ViewProperties, + ViewStyle, + Permission, + StyleProp +} from 'react-native'; + +export type Axis = number; +export type BarCodeReadCallback = (params: { type: string; data: string; }) => void; +export type FloatFromZeroToOne = 0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1; +export type Md5 = string; +export type Orientation = 'portrait' | 'landscape'; +export type RequireSource = ImageRequireSource; +export type ResizeModeContain = 'contain'; +export type ResizeModeCover = 'cover'; +export type ResizeModeStretch = 'stretch'; +export type URISource = ImageURISource; + +export interface HashMap { [key: string]: any; } + +/** Access the device accelerometer sensor(s) to respond to changes in acceleration in 3d space. */ +export namespace Accelerometer { + interface AccelerometerObject { + x: Axis; + y: Axis; + z: Axis; + } + + /** + * Subscribe for updates to the accelerometer. + * @param listener A callback that is invoked when an accelerometer update is available. When invoked, the listener is provided a single argumument that is an object containing keys x, y, z. + * @returns An EventSubscription object that you can call remove() on when you would like to unsubscribe the listener. + */ + function addListener(listener: (obj: AccelerometerObject) => any): EventSubscription; + + /** Remove all listeners. */ + function removeAllListeners(): void; + + /** + * Subscribe for updates to the accelerometer. + * @param intervalMs Desired interval in milliseconds between accelerometer updates. + */ + function setUpdateInterval(intervalMs: number): void; +} + +/** + * Admob + */ +export type AdMobBannerSize = + | 'banner' + | 'largeBanner' + | 'mediumRectangle' + | 'fullBanner' + | 'leaderboard' + | 'smartBannerPortrait' + | 'smartBannerLandscape'; +export interface AdMobBannerProperties extends ViewProperties { + bannerSize?: AdMobBannerSize; + adUnitID?: string; + testDeviceID?: string; + didFailToReceiveAdWithError?(errorDescription: string): void; + adViewDidReceiveAd?(): void; + adViewWillPresentScreen?(): void; + adViewWillDismissScreen?(): void; + adViewDidDismissScreen?(): void; + adViewWillLeaveApplication?(): void; +} + +export class AdMobBanner extends Component { } + +export interface AdMobAppEvent { + name: string; + info: string; +} +export interface PublisherBannerProperties extends AdMobBannerProperties { + admobDispatchAppEvent?(event: AdMobAppEvent): void; +} +export class PublisherBanner extends Component { } + +export type AdMobInterstitialEmptyEvent = + | 'interstitialDidLoad' + | 'interstitialDidOpen' + | 'interstitialDidClose' + | 'interstitialWillLeaveApplication'; +export type AdMobInterstitialEvent = AdMobInterstitialEmptyEvent | 'interstitialVideoDidFailToLoad'; +export namespace AdMobInterstitial { + function setAdUnitID(id: string): void; + function setTestDeviceID(id: string): void; + function requestAd(callback?: () => void): void; + function showAd(callback?: (error: string) => void): void; + function isReady(callback: (isReady: boolean) => void): void; + function addEventListener(event: 'interstitialDidFailToLoad', handler: (error: string) => void): void; + function addEventListener(event: AdMobInterstitialEmptyEvent, handler: () => void): void; + function removeEventListener(event: 'interstitialDidFailToLoad', handler: (error: string) => void): void; + function removeEventListener(event: AdMobInterstitialEmptyEvent, handler: () => void): void; + function removeAllListeners(): void; +} + +export type AdMobRewardedEmptyEvent = + | 'rewardedVideoDidLoad' + | 'rewardedVideoDidOpen' + | 'rewardedVideoDidClose' + | 'rewardedVideoWillLeaveApplication'; +export type AdMobRewardedEvent = AdMobRewardedEmptyEvent | 'rewardedVideoDidRewardUser' | 'rewardedVideoDidFailToLoad'; +export namespace AdMobRewarded { + function setAdUnitID(id: string): void; + function setTestDeviceID(id: string): void; + function requestAd(callback?: () => void): void; + function showAd(callback?: (error: string) => void): void; + function addEventListener(event: 'rewardedVideoDidRewardUser', handler: (type: string, amount: number) => void): void; + function addEventListener(event: 'rewardedVideoDidFailToLoad', handler: (error: string) => void): void; + function addEventListener(event: AdMobRewardedEmptyEvent, handler: () => void): void; + function removeEventListener(event: 'rewardedVideoDidRewardUser', handler: (type: string, amount: number) => void): void; + function removeEventListener(event: 'rewardedVideoDidFailToLoad', handler: (error: string) => void): void; + function removeEventListener(event: AdMobRewardedEmptyEvent, handler: () => void): void; + function removeAllListeners(): void; +} + +/** + * Provides access to Amplitude mobile analytics which basically lets you log various events to the Cloud. This module wraps Amplitude’s iOS and Android SDKs. + * + * Note: Session tracking may not work correctly when running Experiences in the main Expo app. It will work correctly if you create a standalone app. + */ +export namespace Amplitude { + /** Initializes Amplitude with your Amplitude API key. */ + function initialize(apiKey: string): void; + + /** Assign a user ID to the current user. If you don’t have a system for user IDs you don’t need to call this. */ + function setUserId(userId: string): void; + + /** Set properties for the current user. */ + function setUserProperties(userProperties: HashMap): void; + + /** Clear properties set by `setUserProperties()`. */ + function clearUserProperties(): void; + + /** Log an event to Amplitude. */ + function logEvent(eventName: string): void; + + /** Log an event to Amplitude with custom properties. */ + function logEventWithProperties( + eventName: string, + + /** A map of custom properties. */ + properties: HashMap + ): void; + + /** Add the current user to a group. */ + function setGroup( + /** The group name, e.g. `'sports'`. */ + groupType: string, + + /** An array of group names, e.g. `['tennis', 'soccer']`. */ + groupNames: string[] + ): void; +} + +// #region AppLoading +/** The following props are recommended, but optional for the sake of backwards compatibility (they were introduced in SDK21). If you do not provide any props, you are responsible for coordinating loading assets, handling errors, and updating state to unmount the `AppLoading` component. */ +export interface AppLoadingProps { + /** A `function` that returns a `Promise`. The `Promise` should resolve when the app is done loading data and assets. */ + startAsync?: () => Promise; + + /** Required if you provide `startAsync`. Called when `startAsync` resolves or rejects. This should be used to set state and unmount the `AppLoading` component. */ + onFinish?: () => void; + + /** If `startAsync` throws an error, it is caught and passed into the function provided to `onError`. */ + onError?: (error: Error) => void; +} + +/** + * A React component that tells Expo to keep the app loading screen open if it is the first and only component rendered in your app. When it is removed, the loading screen will disappear and your app will be visible. + * + * This is incredibly useful to let you download and cache fonts, logo and icon images and other assets that you want to be sure the user has on their device for an optimal experience before rendering they start using the app. + */ +export class AppLoading extends Component { } +// #endregion AppLoading + +/** This module provides an interface to Expo’s asset system. An asset is any file that lives alongside the source code of your app that the app needs at runtime. Examples include images, fonts and sounds. Expo’s asset system integrates with React Native’s, so that you can refer to files with require('path/to/file'). This is how you refer to static image files in React Native for use in an Image component, for example. */ +export class Asset { + constructor({ name, type, hash, uri, width, height }: { + name: string; + type: string; + hash: string; + uri: string; + width?: number; + height?: number; + }); + + /** The MD5 hash of the asset’s data. */ + hash: Md5; + + /** The name of the asset file without the extension. Also without the part from @ onward in the filename (used to specify scale factor for images). */ + name: string; + + /** The extension of the asset filename. */ + type: string; + + /** A URI that points to the asset’s data on the remote server. When running the published version of your app, this refers to the the location on Expo’s asset server where Expo has stored your asset. When running the app from XDE during development, this URI points to XDE’s server running on your computer and the asset is served directly from your computer. */ + uri: string; + + /** If the asset has been downloaded (by calling `downloadAsync()`), the `file://` URI pointing to the local file on the device that contains the asset data. */ + localUri: string; + + /** If the asset is an image, the width of the image data divided by the scale factor. The scale factor is the number after `@` in the filename, or `1` if not present. */ + width?: number; + + /** If the asset is an image, the height of the image data divided by the scale factor. The scale factor is the number after `@` in the filename, or `1` if not present. */ + height?: number; + + downloading: boolean; + downloaded: boolean; + downloadCallbacks: Array<{ resolve: () => any, reject: (e?: any) => any }>; + + /** Downloads the asset data to a local file in the device’s cache directory. Once the returned promise is fulfilled without error, the localUri field of this asset points to a local file containing the asset data. The asset is only downloaded if an up-to-date local file for the asset isn’t already present due to an earlier download. */ + downloadAsync(): Promise; + + /** Returns the `Expo.Asset` instance representing an asset given its module. */ + static fromModule(module: RequireSource): Asset; + + /** + * A helper that wraps `Expo.Asset.fromModule(module).downloadAsync` for convenience. + * @param moduleIds An array of `require('path/to/file')`. Can also be just one module without an Array. + */ + static loadAsync(module: RequireSource[] | RequireSource): Promise; +} + +/** + * Provides basic sample playback and recording. + * + * Note that Expo does not yet support backgrounding, so audio is not available to play in the background of your experience. Audio also automatically stops if headphones / bluetooth audio devices are disconnected. + */ +export namespace Audio { + enum InterruptionModeIos { + /** This is the default option. If this option is set, your experience’s audio is mixed with audio playing in background apps. */ + INTERRUPTION_MODE_IOS_MIX_WITH_OTHERS = 0, + + /** If this option is set, your experience’s audio interrupts audio from other apps. */ + INTERRUPTION_MODE_IOS_DO_NOT_MIX = 1, + + /** If this option is set, your experience’s audio lowers the volume ("ducks") of audio from other apps while your audio plays. */ + INTERRUPTION_MODE_IOS_DUCK_OTHERS = 2 + } + + const INTERRUPTION_MODE_IOS_MIX_WITH_OTHERS: 0; + const INTERRUPTION_MODE_IOS_DO_NOT_MIX: 1; + const INTERRUPTION_MODE_IOS_DUCK_OTHERS: 2; + + enum InterruptionModeAndroid { + /** If this option is set, your experience’s audio interrupts audio from other apps. */ + INTERRUPTION_MODE_ANDROID_DO_NOT_MIX = 1, + + /** This is the default option. If this option is set, your experience’s audio lowers the volume ("ducks") of audio from other apps while your audio plays. */ + INTERRUPTION_MODE_ANDROID_DUCK_OTHERS = 2 + } + + const INTERRUPTION_MODE_ANDROID_DO_NOT_MIX: 1; + const INTERRUPTION_MODE_ANDROID_DUCK_OTHERS: 2; + + const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_DEFAULT: 0; + const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_THREE_GPP: 1; + const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_MPEG_4: 2; + const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AMR_NB: 3; + const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AMR_WB: 4; + const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AAC_ADIF: 5; + const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AAC_ADTS: 6; + const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_RTP_AVP: 7; + const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_MPEG2TS: 8; + const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_WEBM: 9; + + const RECORDING_OPTION_ANDROID_AUDIO_ENCODER_DEFAULT: 0; + const RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AMR_NB: 1; + const RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AMR_WB: 2; + const RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AAC: 3; + const RECORDING_OPTION_ANDROID_AUDIO_ENCODER_HE_AAC: 4; + const RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AAC_ELD: 5; + const RECORDING_OPTION_ANDROID_AUDIO_ENCODER_VORBIS: 6; + + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_LINEARPCM: 'lpcm'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_AC3: 'ac-3'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_60958AC3: 'cac3'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_APPLEIMA4: 'ima4'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC: 'aac '; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4CELP: 'celp'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4HVXC: 'hvxc'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4TWINVQ: 'twvq'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MACE3: 'MAC3'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MACE6: 'MAC6'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_ULAW: 'ulaw'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_ALAW: 'alaw'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_QDESIGN: 'QDMC'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_QDESIGN2: 'QDM2'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_QUALCOMM: 'Qclp'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER1: '.mp1'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER2: '.mp2'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER3: '.mp3'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_APPLELOSSLESS: 'alac'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_HE: 'aach'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_LD: 'aacl'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD: 'aace'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD_SBR: 'aacf'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD_V2: 'aacg'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_HE_V2: 'aacp'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_SPATIAL: 'aacs'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_AMR: 'samr'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_AMR_WB: 'sawb'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_AUDIBLE: 'AUDB'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_ILBC: 'ilbc'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_DVIINTELIMA: 0x6d730011; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MICROSOFTGSM: 0x6d730031; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_AES3: 'aes3'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_ENHANCEDAC3: 'ec-3'; + + const RECORDING_OPTION_IOS_AUDIO_QUALITY_MIN: 0; + const RECORDING_OPTION_IOS_AUDIO_QUALITY_LOW: 0x20; + const RECORDING_OPTION_IOS_AUDIO_QUALITY_MEDIUM: 0x40; + const RECORDING_OPTION_IOS_AUDIO_QUALITY_HIGH: 0x60; + const RECORDING_OPTION_IOS_AUDIO_QUALITY_MAX: 0x7f; + + const RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_CONSTANT: 0; + const RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_LONG_TERM_AVERAGE: 1; + const RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_VARIABLE_CONSTRAINED: 2; + const RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_VARIABLE: 3; + + type RecordingStatus = { + canRecord: false, + isDoneRecording: false + } | { + canRecord: true, + isRecording: boolean, + durationMillis: number + } | { + canRecord: false, + isDoneRecording: true, + durationMillis: number + }; + + const RECORDING_OPTIONS_PRESET_HIGH_QUALITY: RecordingOptions; + const RECORDING_OPTIONS_PRESET_LOW_QUALITY: RecordingOptions; + + interface RecordingOptions { + android: { + extension: string; + outputFormat: number; + audioEncoder: number; + sampleRate?: number; + numberOfChannels?: number; + bitRate?: number; + maxFileSize?: number; + }; + ios: { + extension: string; + outputFormat?: string | number; + audioQuality: number; + sampleRate: number; + numberOfChannels: number; + bitRate: number; + bitRateStrategy?: number; + bitDepthHint?: number; + linearPCMBitDepth?: number; + linearPCMIsBigEndian?: boolean; + linearPCMIsFloat?: boolean; + }; + } + + interface AudioMode { + /** Boolean selecting if your experience’s audio should play in silent mode on iOS. This value defaults to `false`. */ + playsInSilentModeIOS: boolean; + + /** Boolean selecting if recording is enabled on iOS. This value defaults to `false`. NOTE: when this flag is set to true, playback may be routed to the phone receiver instead of to the speaker. */ + allowsRecordingIOS: boolean; + + /** Enum selecting how your experience’s audio should interact with the audio from other apps on iOS. */ + interruptionModeIOS: InterruptionModeIos; + + /** Boolean selecting if your experience’s audio should automatically be lowered in volume ("duck") if audio from another app interrupts your experience. This value defaults to true. If false, audio from other apps will pause your audio. */ + shouldDuckAndroid: boolean; + + /** an enum selecting how your experience’s audio should interact with the audio from other apps on Android: */ + interruptionModeAndroid: InterruptionModeAndroid; + } + + function setIsEnabledAsync(value: boolean): Promise; + function setAudioModeAsync(mode: AudioMode): Promise; + + /** This class represents a sound corresponding to an Asset or URL. */ + class Sound extends PlaybackObject { + constructor(); + + /** + * Creates and loads a sound from source, with optional `initialStatus`, `onPlaybackStatusUpdate`, and `downloadFirst`. + * + * @returns A `Promise` that is rejected if creation failed, or fulfilled with the following dictionary if creation succeeded: + * - `sound`: The newly created and loaded Sound object. + * - `status`: The PlaybackStatus of the Sound object. See the AV documentation for further information. + */ + static create( + /** + * The source of the sound. The following forms are supported: + * + * - A dictionary of the form `{ uri: 'http://path/to/file' }` with a network URL pointing to an audio file on the web. + * - `require('path/to/file')` for an audio file asset in the source code directory. + * - An `Expo.Asset` object for an audio file asset. + */ + source: PlaybackSource, + + /** The initial intended PlaybackStatusToSet of the sound, whose values will override the default initial playback status. This value defaults to `{}` if no parameter is passed. */ + initialStatus?: PlaybackStatusToSet, + + /** A function taking a single parameter PlaybackStatus. This value defaults to `null` if no parameter is passed. */ + onPlaybackStatusUpdate?: ((status: PlaybackStatus) => void) | null, + + /** If set to true, the system will attempt to download the resource to the device before loading. This value defaults to `true`. Note that at the moment, this will only work for `source`s of the form `require('path/to/file')` or `Asset` objects. */ + downloadFirst?: boolean + ): Promise<{ sound: Sound, status: PlaybackStatus }>; + } + + class Recording { + constructor(); + + /** Gets the `status` of the `Recording`. */ + getStatusAsync(): Promise; + + /** Sets a function to be called regularly with the `status` of the `Recording`. */ + setOnRecordingStatusUpdate(onRecordingStatusUpdate?: (status: RecordingStatus) => void): void; + + /** Sets the interval with which onRecordingStatusUpdate is called while the recording can record. This value defaults to 500 milliseconds. */ + setProgressUpdateInterval(progressUpdateIntervalMillis: number): void; + + /** Loads the recorder into memory and prepares it for recording. This must be called before calling `startAsync()`. This method can only be called if the `Recording` instance has never yet been prepared. */ + prepareToRecordAsync( + /** Options for the recording, including sample rate, bitrate, channels, format, encoder, and extension. If no options are passed to `prepareToRecordAsync()`, the recorder will be created with options `Expo.Audio.RECORDING_OPTIONS_PRESET_LOW_QUALITY`. */ + options?: RecordingOptions + ): Promise; + + /** Begins recording. This method can only be called if the `Recording` has been prepared. */ + startAsync(): Promise; + + /** + * Pauses recording. This method can only be called if the Recording has been prepared. + * + * NOTE: This is only available on Android API version 24 and later. + */ + pauseAsync(): Promise; + + /** Stops the recording and deallocates the recorder from memory. This reverts the Recording instance to an unprepared state, and another Recording instance must be created in order to record again. This method can only be called if the `Recording` has been prepared. */ + stopAndUnloadAsync(): Promise; + + /** + * Gets the local URI of the Recording. Note that this will only succeed once the Recording is prepared to record. + * + * @returns A string with the local URI of the `Recording`, or `null` if the `Recording` is not prepared to record. + */ + getURI(): string | null | undefined; + + /** + * Creates and loads a new `Sound` object to play back the `Recording`. Note that this will only succeed once the `Recording` is done recording (once `stopAndUnloadAsync()` has been called). + * + * @returns A Promise that is rejected if creation failed, or fulfilled with the following dictionary if creation succeeded: + * - `sound`: the newly created and loaded Sound object. + * - `status`: the PlaybackStatus of the Sound object. + */ + createNewLoadedSound( + /** The initial intended `PlaybackStatusToSet` of the sound, whose values will override the default initial playback status. This value defaults to `{}` if no parameter is passed. */ + initialStatus?: PlaybackStatusToSet, + + /** A function taking a single parameter `PlaybackStatus`. This value defaults to `null` if no parameter is passed. */ + onPlaybackStatusUpdate?: ((status: PlaybackStatus) => void) | null + ): Promise<{ sound: Sound, status: PlaybackStatus }>; + } +} + +/** + * AuthSession + */ +export namespace AuthSession { + type StartAsyncResponse = { + type: 'cancel'; + } | { + type: 'dismissed'; + } | { + type: 'success'; + params: HashMap; + event: HashMap; + } | { + type: 'error'; + params: HashMap; + errorCode: string; + event: HashMap; + }; + + function startAsync(options: { authUrl: string; returnUrl?: string; }): Promise; + function dismiss(): void; + function getRedirectUrl(): string; +} + +// #region AV +/** + * AV + */ +export type PlaybackStatus = { + isLoaded: false; + androidImplementation?: string; + + /** Populated exactly once when an error forces the object to unload. */ + error?: string; +} | { + isLoaded: true; + androidImplementation?: string; + uri: string; + progressUpdateIntervalMillis: number; + durationMillis?: number; + positionMillis: number; + playableDurationMillis?: number; + shouldPlay: boolean; + isPlaying: boolean; + isBuffering: boolean; + rate: number; + shouldCorrectPitch: boolean; + volume: number; + isMuted: boolean; + isLooping: boolean; + + /** True exactly once when the track plays to finish. */ + didJustFinish: boolean; +}; + +export interface PlaybackStatusToSet { + androidImplementation?: string; + progressUpdateIntervalMillis?: number; + positionMillis?: number; + shouldPlay?: boolean; + rate?: FloatFromZeroToOne; + shouldCorrectPitch?: boolean; + volume?: FloatFromZeroToOne; + isMuted?: boolean; + isLooping?: boolean; +} + +export type PlaybackSource = RequireSource | { uri: string } | Asset; + +export class PlaybackObject { + /** + * Gets the `PlaybackStatus` of the `playbackObject`. + * + * Returns a `Promise` that is fulfilled with the `PlaybackStatus` of the `playbackObject`. + */ + getStatusAsync(): Promise; + + /** + * Loads the media from source into memory and prepares it for playing. This must be called before calling setStatusAsync() or any of the convenience set status methods. This method can only be called if the playbackObject is in an unloaded state. + * + * Returns a `Promise` that is fulfilled with the `PlaybackStatus` of the `playbackObject` once it is loaded, or rejects if loading failed. The `Promise` will also reject if the `playbackObject` was already loaded. See below for details on `PlaybackStatus`. + */ + loadAsync( + /** + * The source of the media. The following forms are supported: + * - A dictionary of the form `{ uri: 'http://path/to/file' }` with a network URL pointing to a media file on the web. + * - `require('path/to/file')` for a media file asset in the source code directory. + * - An `Expo.Asset object` for a media file asset. + */ + source: PlaybackSource, + + /** The initial intended `PlaybackStatusToSet` of the `playbackObject`, whose values will override the default initial playback status. This value defaults to `{}` if no parameter is passed. See below for details on `PlaybackStatusToSet` and the default initial playback status. */ + initialStatus?: PlaybackStatusToSet, + + /** If set to `true`, the system will attempt to download the resource to the device before loading. This value defaults to true. Note that at the moment, this will only work for sources of the form `require('path/to/file')` or `Expo.Asset` objects. */ + downloadFirst?: boolean + ): Promise; + + /** This is equivalent to `playbackObject.setStatusAsync({ shouldPlay: false })`. */ + pauseAsync(): Promise; + + /** + * This is equivalent to `playbackObject.setStatusAsync({ shouldPlay: true })`. + * + * Playback may not start immediately after calling this function for reasons such as buffering. Make sure to update your UI based on the `isPlaying` and `isBuffering` properties of the `PlaybackStatus`. + */ + playAsync(): Promise; + + /** + * This is equivalent to `playbackObject.setStatusAsync({ shouldPlay: true, positionMillis: millis })`. + * + * Playback may not start immediately after calling this function for reasons such as buffering. Make sure to update your UI based on the isPlaying and `isBuffering` properties of the `PlaybackStatus`. + */ + playFromPositionAsync( + /** The desired position of playback in milliseconds. */ + positionMillis: number, + + /** This is equivalent to `playbackObject.setStatusAsync({ positionMillis: millis, seekMillisToleranceBefore: toleranceMillisBefore, seekMillisToleranceAfter: toleranceMillisAfter })`. The tolerances are used only on iOS. */ + tolerances?: { + toleranceMillisBefore: number, + toleranceMillisAfter: number + } + ): Promise; + + /** + * Replays the item. When using `playFromPositionAsync(0)` the item is seeked to the position at `0` ms. On iOS this method uses internal implementation of the player and is able to play the item from the beginning immediately. + * + * Returns a `Promise` that is fulfilled with the `PlaybackStatus` of the `playbackObject` once the new status has been set successfully, or rejects if setting the new status failed. + */ + replayAsync( + /** The new `PlaybackStatusToSet` of the `playbackObject`, whose values will override the current playback status. */ + status: PlaybackStatusToSet + ): Promise; + + /** This is equivalent to `playbackObject.setStatusAsync({ isLooping: value })`. */ + setIsLoopingAsync( + /** A boolean describing if the media should play once (`false`) or loop indefinitely (`true`). */ + isLooping: boolean + ): Promise; + + /** This is equivalent to `playbackObject.setStatusAsync({ isMuted: value })`. */ + setIsMutedAsync( + /** A boolean describing if the audio of this media should be muted. */ + isMuted: boolean + ): Promise; + + /** + * Sets a function to be called regularly with the `PlaybackStatus` of the `playbackObject`. See below for details on `PlaybackStatus` and an example use case of this function. + * + * `onPlaybackStatusUpdate` will be called whenever a call to the API for this `playbackObject` completes (such as `setStatusAsync()`, `getStatusAsync()`, or `unloadAsync()`), and will also be called at regular intervals while the media is in the loaded state. Set `progressUpdateIntervalMillis` via `setStatusAsync()` or `setProgressUpdateIntervalAsync()` to modify the interval with which `onPlaybackStatusUpdate` is called while loaded. + */ + setOnPlaybackStatusUpdate( + /** A function taking a single parameter `PlaybackStatus`. */ + onPlaybackStatusUpdate?: (status: PlaybackStatus) => void + ): void; + + /** This is equivalent to `playbackObject.setStatusAsync({ positionMillis: millis })`. */ + setPositionAsync( + positionMillis: number, + + /** This is equivalent to `playbackObject.setStatusAsync({ positionMillis: millis, seekMillisToleranceBefore: toleranceMillisBefore, seekMillisToleranceAfter: toleranceMillisAfter })`. The tolerances are used only on iOS. */ + tolerances?: { + toleranceMillisBefore: number, + toleranceMillisAfter: number + } + ): Promise; + + /** This is equivalent to `playbackObject.setStatusAsync({ progressUpdateIntervalMillis: millis })`. */ + setProgressUpdateIntervalAsync( + /** The new minimum interval in milliseconds between calls of `onPlaybackStatusUpdate`. */ + progressUpdateIntervalMillis: number + ): Promise; + + /** This is equivalent to `playbackObject.setStatusAsync({ rate: value, shouldCorrectPitch: shouldCorrectPitch })`. */ + setRateAsync( + /** The desired playback rate of the media. This value must be between `0.0` and `32.0`. Only available on Android API version 23 and later and iOS. */ + rate: number, + + /** A boolean describing if we should correct the pitch for a changed rate. If set to `true`, the pitch of the audio will be corrected (so a rate different than `1.0` will timestretch the audio). */ + shouldCorrectPitch: boolean + ): Promise; + + /** Sets a new `PlaybackStatusToSet` on the `playbackObject`. This method can only be called if the media has been loaded. Return a `Promise` that is fulfilled with the `PlaybackStatus` of the `playbackObject` once the new status has been set successfully, or rejects if setting the new status failed. */ + setStatusAsync( + /** The new `PlaybackStatusToSet` of the `playbackObject`, whose values will override the current playback status. */ + status: PlaybackStatusToSet + ): Promise; + + /** This is equivalent to `playbackObject.setStatusAsync({ volume: value })`. */ + setVolumeAsync( + /** A number between `0.0` (silence) and `1.0` (maximum volume). */ + volume: number + ): Promise; + + /** This is equivalent to `playbackObject.setStatusAsync({ shouldPlay: false, positionMillis: 0 })`. */ + stopAsync(): Promise; + + /** + * Unloads the media from memory. `loadAsync()` must be called again in order to be able to play the media. + * + * Returns a `Promise` that is fulfilled with the `PlaybackStatus` of the `playbackObject` once it is unloaded, or rejects if unloading failed. See below for details on `PlaybackStatus`. + */ + unloadAsync(): Promise; +} +// #endregion + +// #region BarCodeScanner +/** + * BarCodeScanner + */ +export interface BarCodeScannerProps extends ViewProperties { + type?: 'front' | 'back'; + torchMode?: 'on' | 'off'; + barCodeTypes?: string[]; + onBarCodeRead?: BarCodeReadCallback; +} + +export class BarCodeScanner extends Component { + static Constants: { + TorchMode: { + on: string; + off: string + } + } & CameraConstants; +} +// #endregion + +// #region BlurView +/** + * BlurView + */ +export interface BlurViewProps extends ViewProperties { + tint: 'light' | 'default' | 'dark'; + intensity: number; +} +export class BlurView extends Component { } +// #endregion + +/** + * Brightness + */ +export namespace Brightness { + function setBrightnessAsync(brightnessValue: FloatFromZeroToOne): Promise; + function getBrightnessAsync(): Promise; + function getSystemBrightnessAsync(): Promise; + function setSystemBrightnessAsync(brightnessValue: FloatFromZeroToOne): Promise; +} + +// #region Camera +/** + * Camera + */ +export interface PictureOptions { + quality?: number; +} + +export interface PictureResponse { + uri: string; + width: number; + height: number; + exif: string; + base64: string; +} + +export interface RecordingOptions { + quality?: string | number; + maxDuration?: number; + maxFileSize?: number; +} + +export class CameraObject { + takePictureAsync(options: PictureOptions): Promise; + recordAsync(options: RecordingOptions): Promise<{ uri: string; }>; + stopRecording(): void; + getSupportedRatiosAsync(): Promise; // Android only +} + +export interface CameraProps extends ViewProperties { + zoom?: FloatFromZeroToOne; + ratio?: string; + focusDepth?: FloatFromZeroToOne; + type?: string | number; + onCameraReady?: () => void; + onBarCodeRead?: BarCodeReadCallback; + faceDetectionMode?: number; + flashMode?: string | number; + barCodeTypes?: Array; + whiteBalance?: string | number; + faceDetectionLandmarks?: number; + autoFocus?: string | number | boolean; + faceDetectionClassifications?: number; + onMountError?: () => void; + onFacesDetected?: (options: { faces: TrackedFaceFeature[] }) => void; + ref?: Ref; +} + +export interface CameraConstants { + readonly Type: string; + readonly FlashMode: string; + readonly AutoFocus: string; + readonly WhiteBalance: string; + readonly VideoQuality: string; + readonly BarCodeType: { + aztec: string; + codabar: string; + code39: string; + code93: string; + code128: string; + code138: string; + code39mod43: string; + datamatrix: string; + ean13: string; + ean8: string; + interleaved2of5: string; + itf14: string; + maxicode: string; + pdf417: string; + rss14: string; + rssexpanded: string; + upc_a: string; + upc_e: string; + upc_ean: string; + qr: string; + }; +} + +export class Camera extends Component { + static readonly Constants: CameraConstants; +} +// #endregion + +/** + * Constants + */ +export namespace Constants { + const appOwnership: 'expo' | 'standalone' | 'guest'; + const expoVersion: string; + const deviceId: string; + const deviceName: string; + const deviceYearClass: number; + const isDevice: boolean; + + interface Platform { + ios?: { + platform: string; + model: string; + userInterfaceIdiom: string; + buildNumber: string; + }; + android?: { + versionCode: string; + }; + } + const platform: Platform; + const sessionId: string; + const statusBarHeight: number; + const systemFonts: string[]; + + interface Manifest { + name: string; + description?: string; + slug?: string; + sdkVersion?: string; + version?: string; + orientation?: Orientation; + primaryColor?: string; + privacy?: 'public' | 'unlisted'; + scheme?: string; + icon?: string; + platforms?: string[]; + githubUrl?: string; + notification?: { + icon?: string, + color?: string, + androidMode?: 'default' | 'collapse', + androidCollapsedTitle?: string + }; + loading?: { + icon?: string, + exponentIconColor?: 'white' | 'blue', + exponentIconGrayscale?: 1 | 0, + backgroundImage?: string, + backgroundColor?: string, + hideExponentText?: boolean + }; + appKey?: string; + androidStatusBar?: { + barStyle?: 'lignt-content' | 'dark-content', + backgroundColor?: string + }; + androidShowExponentNotificationInShellApp?: boolean; + extra?: { + [propName: string]: any + }; + rnCliPath?: any; + entryPoint?: string; + packagerOpts?: { + hostType?: string, + dev?: boolean, + strict?: boolean, + minify?: boolean, + urlType?: string, + urlRandomness?: string, + lanType?: string, + [propName: string]: any + }; + ignoreNodeModulesValidation?: any; + nodeModulesPath?: string; + ios?: { + bundleIdentifier?: string, + buildNumber?: string, + config?: { + usesNonExemptEncryption?: boolean, + googleSignIn?: { + reservedClientId: string + } + }, + supportsTablet?: boolean, + infoPlist?: any + }; + android?: { + package?: string, + versionCode?: string, + config?: { + fabric?: { + apiKey: string, + buildSecret: string + }, + googleMaps?: { + apiKey: string + }, + googleSignIn?: { + apiKey: string, + certificateHash: string + } + } + }; + facebookScheme?: any; + facebookAppId?: string; + facebookDisplayName?: string; + splash?: { + backgroundColor?: string; + resizeMode?: ResizeModeContain | ResizeModeCover; + image?: string; + }; + assetBundlePatterns?: string[]; + releaseChannel: string; + [propName: string]: any; + } + const manifest: Manifest; + const linkingUri: string; +} + +/** + * Contacts + */ +export namespace Contacts { + type PhoneNumbers = 'phoneNumbers'; + type Emails = 'emails'; + type Addresses = 'addresses'; + type Image = 'image'; + type Thumbnail = 'thumbnail'; + type Note = 'note'; + type Birthday = 'birthday'; + type NonGregorianBirthday = 'nonGregorianBirthday'; + type NamePrefix = 'namePrefix'; + type NameSuffix = 'nameSuffix'; + type PhoneticFirstName = 'phoneticFirstName'; + type PhoneticMiddleName = 'phoneticMiddleName'; + type PhoneticLastName = 'phoneticLastName'; + type SocialProfiles = 'socialProfiles'; + type InstantMessageAddresses = 'instantMessageAddresses'; + type UrlAddresses = 'urlAddresses'; + type Dates = 'dates'; + type Relationships = 'relationships'; + + const PHONE_NUMBERS: PhoneNumbers; + const EMAILS: Emails; + const ADDRESSES: Addresses; + const IMAGE: Image; + const THUMBNAIL: Thumbnail; + const NOTE: Note; + const BIRTHDAY: Birthday; + const NON_GREGORIAN_BIRTHDAY: NonGregorianBirthday; + const NAME_PREFIX: NamePrefix; + const NAME_SUFFIX: NameSuffix; + const PHONETIC_FIRST_NAME: PhoneticFirstName; + const PHONETIC_MIDDLE_NAME: PhoneticMiddleName; + const PHONETIC_LAST_NAME: PhoneticLastName; + const SOCIAL_PROFILES: SocialProfiles; + const IM_ADDRESSES: InstantMessageAddresses; + const URLS: UrlAddresses; + const DATES: Dates; + const RELATIONSHIPS: Relationships; + + type FieldType = PhoneNumbers | Emails | Addresses | Image | Thumbnail | + Note | Birthday | NonGregorianBirthday | NamePrefix | NameSuffix | + PhoneticFirstName | PhoneticMiddleName | PhoneticLastName | SocialProfiles | + InstantMessageAddresses | UrlAddresses | Dates | Relationships; + + interface Options { + pageSize?: number; + pageOffset?: number; + fields?: FieldType[]; + } + + interface Contact { + id: string; + contactType: string; + name: string; + firstName?: string; + middleName?: string; + lastName?: string; + previousLastName?: string; + namePrefix?: string; + nameSuffix?: string; + nickname?: string; + phoneticFirstName?: string; + phoneticMiddleName?: string; + phoneticLastName?: string; + emails?: Array<{ + email?: string; + primary?: boolean; + label: string; + id: string; + }>; + phoneNumbers?: Array<{ + number?: string; + primary?: boolean; + digits?: string; + countryCode?: string; + label: string; + id: string; + }>; + addresses?: Array<{ + street?: string; + city?: string; + country?: string; + region?: string; + neighborhood?: string; + postalCode?: string; + poBox?: string; + isoCountryCode?: string; + label: string; + id: string; + }>; + socialProfiles?: Array<{ + service?: string; + localizedProfile?: string; + url?: string; + username?: string; + userId?: string; + label: string; + id: string; + }>; + instantMessageAddresses?: Array<{ + service?: string; + username?: string; + localizedService?: string; + label: string; + id: string; + }>; + urls?: { + label: string; + url?: string; + id: string; + }; + company?: string; + jobTitle?: string; + department?: string; + imageAvailable?: boolean; + image?: { + uri?: string; + }; + thumbnail?: { + uri?: string; + }; + note?: string; + dates?: Array<{ + day?: number; + month?: number; + year?: number; + id: string; + label: string; + }>; + relationships?: Array<{ + label: string; + name?: string; + id: string; + }>; + } + + interface Response { + data: Contact[]; + total: number; + hasNextPage: boolean; + hasPreviousPage: boolean; + } + + function getContactsAsync(options: Options): Promise; + function getContactByIdAsync(options: { id?: string; fields?: FieldType[] }): Promise; +} + +/** + * DocumentPicker + */ +export namespace DocumentPicker { + interface Options { + type?: string; + } + + type Response = { + type: 'success'; + uri: string; + name: string; + size: number; + } | { + type: 'cancel'; + }; + + function getDocumentAsync(options?: Options): Promise; +} + +/** + * ErrorRecovery + */ +export namespace ErrorRecovery { + function setRecoveryProps(props: HashMap): void; +} + +/** + * Facebook + */ +export namespace Facebook { + interface Options { + permissions?: string[]; + behavior?: 'web' | 'native' | 'browser' | 'system'; + } + interface Response { + type: 'cancel' | 'success'; + token?: string; + expires?: number; + } + function logInWithReadPermissionsAsync(appId: string, options?: Options): Promise; +} + +/** + * Facebook Ads + */ +export namespace FacebookAds { + /** + * Interstitial Ads + */ + namespace InterstitialAdManager { + function showAd(placementId: string): Promise; + } + + /** + * Native Ads + */ + type MediaCachePolicy = 'none' | 'icon' | 'image' | 'all'; + class NativeAdsManager { + constructor(placementId: string, numberOfAdsToRequest?: number); + disableAutoRefresh(): void; + setMediaCachePolicy(cachePolicy: MediaCachePolicy): void; + } + + function withNativeAd(component: Component<{ + icon?: string; + coverImage?: string; + title?: string; + subtitle?: string; + description?: string; + callToActionText?: string; + socialContext?: string; + }>): Component<{ adsManager: NativeAdsManager }, { ad: any, canRequestAds: boolean }>; + + /** + * Banner View + */ + type AdType = 'large' | 'rectangle' | 'standard'; + + interface BannerViewProps { + type: AdType; + placementId: string; + onPress: () => void; + onError: () => void; + } + + class BannerView extends Component { } + + /** + * Ad Settings + */ + namespace AdSettings { + const currentDeviceHash: string; + function addTestDevice(device: string): void; + function clearTestDevices(): void; + type SDKLogLevel = 'none' | 'debug' | 'verbose' | 'warning' | 'error' | 'notification'; + function setLogLevel(logLevel: SDKLogLevel): void; + function setIsChildDirected(isDirected: boolean): void; + function setMediationService(mediationService: string): void; + function setUrlPrefix(urlPrefix: string): void; + } +} + +/** + * FaceDetector + */ +export interface Point { + x: Axis; + y: Axis; +} + +export interface FaceFeature { + bounds: { + size: { + width: number; + height: number; + }, + origin: Point; + }; + smilingProbability?: number; + leftEarPosition?: Point; + rightEarPosition?: Point; + leftEyePosition?: Point; + leftEyeOpenProbability?: number; + rightEyePosition?: Point; + rightEyeOpenProbability?: number; + leftCheekPosition?: Point; + rightCheekPosition?: Point; + leftMouthPosition?: Point; + mouthPosition?: Point; + rightMouthPosition?: Point; + bottomMouthPosition?: Point; + noseBasePosition?: Point; + yawAngle?: number; + rollAngle?: number; +} + +export interface TrackedFaceFeature extends FaceFeature { + faceID?: number; +} + +export namespace FaceDetector { + interface DetectFaceResult { + faces: FaceFeature[]; + image: { + uri: string; + width: number; + height: number; + orientation: number; + }; + } + interface Mode { + fast: 'fast'; + accurate: 'accurate'; + } + interface _Shared { + all: 'all'; + none: 'none'; + } + type Landmarks = _Shared; + type Classifications = _Shared; + interface _Constants { + Mode: Mode; + Landmarks: Landmarks; + Classifications: Classifications; + } + + const Constants: _Constants; + + interface DetectionOptions { + mode?: keyof Mode; + detectLandmarks?: keyof Landmarks; + runClassifications?: keyof Classifications; + } + + function detectFaces(uri: string, options?: DetectionOptions): Promise; +} +/** + * FileSystem + */ +export namespace FileSystem { + type FileInfo = { + exists: true; + isDirectory: boolean; + uri: string; + size: number; + modificationTime: number; + md5?: Md5; + } | { + exists: false; + isDirectory: false; + }; + + interface DownloadResult { + uri: string; + status: number; + headers: { [name: string]: string }; + md5?: Md5; + } + + const documentDirectory: string; + const cacheDirectory: string; + + function getInfoAsync(fileUri: string, options?: { md5?: string, size?: boolean; }): Promise; + function readAsStringAsync(fileUri: string): Promise; + function writeAsStringAsync(fileUri: string, contents: string): Promise; + function deleteAsync(fileUri: string, options?: { idempotent: boolean; }): Promise; + function moveAsync(options: { from: string, to: string; }): Promise; + function copyAsync(options: { from: string, to: string; }): Promise; + function makeDirectoryAsync(dirUri: string, options?: { intermediates: boolean }): Promise; + function readDirectoryAsync(dirUri: string): Promise; + function downloadAsync(uri: string, fileUri: string, options?: { md5?: boolean; }): Promise; + function createDownloadResumable( + uri: string, + fileUri: string, + options?: DownloadOptions, + callback?: (totalBytesWritten: number, totalBytesExpectedToWrite: number) => void, + resumeData?: string | null + ): DownloadResumable; + + interface PauseResult { + url: string; + fileUri: string; + options: { md5: boolean; }; + resumeData: string; + } + + interface DownloadOptions { + md5?: boolean; + headers?: { [name: string]: string }; + } + + interface DownloadProgressData { + totalBytesWritten: number; + totalBytesExpectedToWrite: number; + } + + type DownloadProgressCallback = (data: DownloadProgressData) => void; + + class DownloadResumable { + constructor( + url: string, + fileUri: string, + options: DownloadOptions, + callback?: DownloadProgressCallback, + resumeData?: string + ); + + downloadAsync(): Promise; + pauseAsync(): Promise; + resumeAsync(): Promise; + savable(): PauseResult; + } +} + +/** Use TouchID/FaceID (iOS) or the Fingerprint API (Android) to authenticate the user with a fingerprint scan. */ +export namespace Fingerprint { + type FingerprintAuthenticationResult = { + success: true + } | { + success: false, + + /** Error code in the case where authentication fails. */ + error: string + }; + + /** Determine whether the Fingerprint scanner is available on the device. */ + function hasHardwareAsync(): Promise; + + /** Determine whether the device has saved fingerprints to use for authentication. */ + function isEnrolledAsync(): Promise; + + /** + * Attempts to authenticate via Fingerprint. Android: When using the fingerprint module on Android, you need to provide a UI component to prompt the user to scan their fingerprint, as the OS has no default alert for it. + * + * @param promptMessage A message that is shown alongside the TouchID/FaceID prompt. (iOS only) + */ + function authenticateAsync(promptMessageIOS?: string): Promise; + + /** Cancels the fingerprint authentication flow. (Android only) */ + function cancelAuthenticate(): void; +} + +/** + * Font + */ +export namespace Font { + interface FontMap { + [name: string]: RequireSource; + } + + function loadAsync(name: string, url: string): Promise; + function loadAsync(map: FontMap): Promise; +} + +// #region GLView +/** + * GLView + */ +export interface GLViewProps extends ViewProperties { + onContextCreate(): void; + msaaSamples: number; +} + +export class GLView extends Component { } +// #endregion + +/** + * Google + */ +export namespace Google { + interface LogInConfig { + androidClientId?: string; + androidStandaloneAppClientId?: string; + iosClientId?: string; + iosStandaloneAppClientId?: string; + webClientId?: string; + behavior?: 'system' | 'web'; + scopes?: string[]; + } + + type LogInResult = { + type: 'cancel'; + } | { + type: 'success'; + accessToken: string; + idToken?: string; + refreshToken?: string; + serverAuthCode?: string; + user: { + id: string; + name: string; + givenName: string; + familyName: string; + photoUrl?: string; + email?: string; + } + }; + + function logInAsync(config: LogInConfig): Promise; +} + +/** Access the device gyroscope sensor to respond to changes in rotation in 3d space. */ +export namespace Gyroscope { + interface GyroscopeObject { + x: Axis; + y: Axis; + z: Axis; + } + + /** A callback that is invoked when an gyroscope update is available. */ + function addListener(listener: (obj: GyroscopeObject) => any): EventSubscription; + + /** Remove all listeners. */ + function removeAllListeners(): void; + + /** Subscribe for updates to the gyroscope. */ + function setUpdateInterval(intervalMs: number): void; +} + +/** + * ImageManipulator + */ +export namespace ImageManipulator { + interface ImageResult { + uri: string; + width: number; + height: number; + base64?: string; + } + + interface SaveOptions { + base64?: boolean; + compress?: FloatFromZeroToOne; + format?: 'jpeg' | 'png'; + } + + interface CropParameters { + originX: number; + originY: number; + width: number; + height: number; + } + + interface ImageManipulationOptions { + resize?: { width?: number; height?: number }; + rotate?: number; + flip?: { vertical?: boolean; horizontal?: boolean }; + crop?: CropParameters; + } + + function manipulate(uri: string, actions: ImageManipulationOptions, saveOptions?: SaveOptions): Promise; +} + +/** + * Image Picker + */ +export namespace ImagePicker { + interface ImageInfo { + uri: string; + width: number; + height: number; + type: 'video' | 'image'; + base64?: string; + exif?: object; + duration?: number; + } + + type ImageResult = { cancelled: true } | ({ cancelled: false } & ImageInfo); + + interface _MediaTypeOptions { + All: 'All'; + Videos: 'Videos'; + Images: 'Images'; + } + + const MediaTypeOptions: _MediaTypeOptions; + + interface ImageLibraryOptions { + allowsEditing?: boolean; + aspect?: [number, number]; + quality?: number; + base64?: boolean; + exif?: boolean; + mediaTypes?: keyof _MediaTypeOptions; + } + + function launchImageLibraryAsync(options?: ImageLibraryOptions): Promise; + + interface CameraOptions { + allowsEditing?: boolean; + aspect?: [number, number]; + quality?: number; + } + + function launchCameraAsync(options?: CameraOptions): Promise; +} + +/** + * IntentLauncherAndroid + */ +export namespace IntentLauncherAndroid { + const ACTION_ACCESSIBILITY_SETTINGS: 'android.settings.ACCESSIBILITY_SETTINGS'; + const ACTION_APP_NOTIFICATION_REDACTION: 'android.settings.ACTION_APP_NOTIFICATION_REDACTION'; + const ACTION_CONDITION_PROVIDER_SETTINGS: 'android.settings.ACTION_CONDITION_PROVIDER_SETTINGS'; + const ACTION_NOTIFICATION_LISTENER_SETTINGS: 'android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS'; + const ACTION_PRINT_SETTINGS: 'android.settings.ACTION_PRINT_SETTINGS'; + const ACTION_ADD_ACCOUNT_SETTINGS: 'android.settings.ADD_ACCOUNT_SETTINGS'; + const ACTION_AIRPLANE_MODE_SETTINGS: 'android.settings.AIRPLANE_MODE_SETTINGS'; + const ACTION_APN_SETTINGS: 'android.settings.APN_SETTINGS'; + const ACTION_APPLICATION_DETAILS_SETTINGS: 'android.settings.APPLICATION_DETAILS_SETTINGS'; + const ACTION_APPLICATION_DEVELOPMENT_SETTINGS: 'android.settings.APPLICATION_DEVELOPMENT_SETTINGS'; + const ACTION_APPLICATION_SETTINGS: 'android.settings.APPLICATION_SETTINGS'; + const ACTION_APP_NOTIFICATION_SETTINGS: 'android.settings.APP_NOTIFICATION_SETTINGS'; + const ACTION_APP_OPS_SETTINGS: 'android.settings.APP_OPS_SETTINGS'; + const ACTION_BATTERY_SAVER_SETTINGS: 'android.settings.BATTERY_SAVER_SETTINGS'; + const ACTION_BLUETOOTH_SETTINGS: 'android.settings.BLUETOOTH_SETTINGS'; + const ACTION_CAPTIONING_SETTINGS: 'android.settings.CAPTIONING_SETTINGS'; + const ACTION_CAST_SETTINGS: 'android.settings.CAST_SETTINGS'; + const ACTION_DATA_ROAMING_SETTINGS: 'android.settings.DATA_ROAMING_SETTINGS'; + const ACTION_DATE_SETTINGS: 'android.settings.DATE_SETTINGS'; + const ACTION_DEVICE_INFO_SETTINGS: 'android.settings.DEVICE_INFO_SETTINGS'; + const ACTION_DEVICE_NAME: 'android.settings.DEVICE_NAME'; + const ACTION_DISPLAY_SETTINGS: 'android.settings.DISPLAY_SETTINGS'; + const ACTION_DREAM_SETTINGS: 'android.settings.DREAM_SETTINGS'; + const ACTION_HARD_KEYBOARD_SETTINGS: 'android.settings.HARD_KEYBOARD_SETTINGS'; + const ACTION_HOME_SETTINGS: 'android.settings.HOME_SETTINGS'; + const ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS: 'android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS'; + const ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS: 'android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS'; + const ACTION_INPUT_METHOD_SETTINGS: 'android.settings.INPUT_METHOD_SETTINGS'; + const ACTION_INPUT_METHOD_SUBTYPE_SETTINGS: 'android.settings.INPUT_METHOD_SUBTYPE_SETTINGS'; + const ACTION_INTERNAL_STORAGE_SETTINGS: 'android.settings.INTERNAL_STORAGE_SETTINGS'; + const ACTION_LOCALE_SETTINGS: 'android.settings.LOCALE_SETTINGS'; + const ACTION_LOCATION_SOURCE_SETTINGS: 'android.settings.LOCATION_SOURCE_SETTINGS'; + const ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS: 'android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS'; + const ACTION_MANAGE_APPLICATIONS_SETTINGS: 'android.settings.MANAGE_APPLICATIONS_SETTINGS'; + const ACTION_MANAGE_DEFAULT_APPS_SETTINGS: 'android.settings.MANAGE_DEFAULT_APPS_SETTINGS'; + const ACTION_MEMORY_CARD_SETTINGS: 'android.settings.MEMORY_CARD_SETTINGS'; + const ACTION_MONITORING_CERT_INFO: 'android.settings.MONITORING_CERT_INFO'; + const ACTION_NETWORK_OPERATOR_SETTINGS: 'android.settings.NETWORK_OPERATOR_SETTINGS'; + const ACTION_NFCSHARING_SETTINGS: 'android.settings.NFCSHARING_SETTINGS'; + const ACTION_NFC_PAYMENT_SETTINGS: 'android.settings.NFC_PAYMENT_SETTINGS'; + const ACTION_NFC_SETTINGS: 'android.settings.NFC_SETTINGS'; + const ACTION_NIGHT_DISPLAY_SETTINGS: 'android.settings.NIGHT_DISPLAY_SETTINGS'; + const ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS: 'android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS'; + const ACTION_NOTIFICATION_SETTINGS: 'android.settings.NOTIFICATION_SETTINGS'; + const ACTION_PAIRING_SETTINGS: 'android.settings.PAIRING_SETTINGS'; + const ACTION_PRIVACY_SETTINGS: 'android.settings.PRIVACY_SETTINGS'; + const ACTION_QUICK_LAUNCH_SETTINGS: 'android.settings.QUICK_LAUNCH_SETTINGS'; + const ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS: 'android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS'; + const ACTION_SECURITY_SETTINGS: 'android.settings.SECURITY_SETTINGS'; + const ACTION_SETTINGS: 'android.settings.SETTINGS'; + const ACTION_SHOW_ADMIN_SUPPORT_DETAILS: 'android.settings.SHOW_ADMIN_SUPPORT_DETAILS'; + const ACTION_SHOW_INPUT_METHOD_PICKER: 'android.settings.SHOW_INPUT_METHOD_PICKER'; + const ACTION_SHOW_REGULATORY_INFO: 'android.settings.SHOW_REGULATORY_INFO'; + const ACTION_SHOW_REMOTE_BUGREPORT_DIALOG: 'android.settings.SHOW_REMOTE_BUGREPORT_DIALOG'; + const ACTION_SOUND_SETTINGS: 'android.settings.SOUND_SETTINGS'; + const ACTION_STORAGE_MANAGER_SETTINGS: 'android.settings.STORAGE_MANAGER_SETTINGS'; + const ACTION_SYNC_SETTINGS: 'android.settings.SYNC_SETTINGS'; + const ACTION_SYSTEM_UPDATE_SETTINGS: 'android.settings.SYSTEM_UPDATE_SETTINGS'; + const ACTION_TETHER_PROVISIONING_UI: 'android.settings.TETHER_PROVISIONING_UI'; + const ACTION_TRUSTED_CREDENTIALS_USER: 'android.settings.TRUSTED_CREDENTIALS_USER'; + const ACTION_USAGE_ACCESS_SETTINGS: 'android.settings.USAGE_ACCESS_SETTINGS'; + const ACTION_USER_DICTIONARY_INSERT: 'android.settings.USER_DICTIONARY_INSERT'; + const ACTION_USER_DICTIONARY_SETTINGS: 'android.settings.USER_DICTIONARY_SETTINGS'; + const ACTION_USER_SETTINGS: 'android.settings.USER_SETTINGS'; + const ACTION_VOICE_CONTROL_AIRPLANE_MODE: 'android.settings.VOICE_CONTROL_AIRPLANE_MODE'; + const ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE: 'android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE'; + const ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE: 'android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE'; + const ACTION_VOICE_INPUT_SETTINGS: 'android.settings.VOICE_INPUT_SETTINGS'; + const ACTION_VPN_SETTINGS: 'android.settings.VPN_SETTINGS'; + const ACTION_VR_LISTENER_SETTINGS: 'android.settings.VR_LISTENER_SETTINGS'; + const ACTION_WEBVIEW_SETTINGS: 'android.settings.WEBVIEW_SETTINGS'; + const ACTION_WIFI_IP_SETTINGS: 'android.settings.WIFI_IP_SETTINGS'; + const ACTION_WIFI_SETTINGS: 'android.settings.WIFI_SETTINGS'; + const ACTION_WIRELESS_SETTINGS: 'android.settings.WIRELESS_SETTINGS'; + const ACTION_ZEN_MODE_AUTOMATION_SETTINGS: 'android.settings.ZEN_MODE_AUTOMATION_SETTINGS'; + const ACTION_ZEN_MODE_EVENT_RULE_SETTINGS: 'android.settings.ZEN_MODE_EVENT_RULE_SETTINGS'; + const ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS: 'android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS'; + const ACTION_ZEN_MODE_PRIORITY_SETTINGS: 'android.settings.ZEN_MODE_PRIORITY_SETTINGS'; + const ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS: 'android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS'; + const ACTION_ZEN_MODE_SETTINGS: 'android.settings.ZEN_MODE_SETTINGS'; + + function startActivityAsync(activity: string, data?: HashMap): Promise; +} + +/** + * KeepAwake + */ +export class KeepAwake extends Component { + static activate(): void; + static deactivate(): void; +} + +// #region LinearGradient +/** + * LinearGradient + */ +export interface LinearGradientProps { + colors: string[]; + start?: [number, number]; + end?: [number, number]; + locations?: number[]; + style?: StyleProp; +} + +export class LinearGradient extends Component { } +// #endregion + +/** + * Location + */ +export namespace Location { + interface LocationOptions { + enableHighAccuracy?: boolean; + timeInterval?: number; + distanceInterval?: number; + } + + interface LocationProps { + latitude: number; + longitude: number; + } + + interface Coords extends LocationProps { + altitude: number; + accuracy: number; + } + + interface LocationData { + coords: { + heading: number; + speed: number + } & Coords; + timestamp: number; + } + + interface ProviderStatus { + locationServicesEnabled: boolean; + gpsAvailable?: boolean; + networkAvailable?: boolean; + passiveAvailable?: boolean; + } + + interface HeadingStatus { + magHeading: number; + trueHeading: number; + accuracy: number; + } + + interface GeocodeData { + city: string; + street: string; + region: string; + postalCode: string; + country: string; + name: string; + } + + type LocationCallback = (data: LocationData) => void; + + function getCurrentPositionAsync(options: LocationOptions): Promise; + function watchPositionAsync(options: LocationOptions, callback: LocationCallback): EventSubscription; + function getProviderStatusAsync(): Promise; + function getHeadingAsync(): Promise; + function watchHeadingAsync(callback: (status: HeadingStatus) => void): EventSubscription; + function geocodeAsync(address: string): Promise; + function reverseGeocodeAsync(location: LocationProps): Promise; + function setApiKey(key: string): void; +} + +/** + * Magnetometer + */ +export namespace Magnetometer { + interface MagnetometerObject { + x: Axis; + y: Axis; + z: Axis; + } + + function addListener(listener: (obj: MagnetometerObject) => any): EventSubscription; + function removeAllListeners(): void; + function setUpdateInterval(intervalMs: number): void; +} + +/** + * Notifications + */ +export namespace Notifications { + interface Notification { + origin: 'selected' | 'received'; + data: any; + remote: boolean; + isMultiple: boolean; + } + + interface LocalNotification { + title: string; + body?: string; + data?: any; + ios?: { + sound?: boolean + }; + android?: { + sound?: boolean; + icon?: string; + color?: string; + priority?: 'min' | 'low' | 'high' | 'max'; + sticky?: boolean; + vibrate?: boolean | number[]; + link?: string; + }; + } + + type LocalNotificationId = string | number; + + function addListener(listener: (notification: Notification) => any): EventSubscription; + function getExpoPushTokenAsync(): Promise; + function presentLocalNotificationAsync(localNotification: LocalNotification): Promise; + function scheduleLocalNotificationAsync( + localNotification: LocalNotification, + schedulingOptions: { time: Date | number, repeat?: 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year' } + ): Promise; + function dismissNotificationAsync(localNotificationId: LocalNotificationId): Promise; + function dismissAllNotificationsAsync(): Promise; + function cancelScheduledNotificationAsync(localNotificationId: LocalNotificationId): Promise; + function cancelAllScheduledNotificationsAsync(): Promise; + function getBadgeNumberAsync(): Promise; + function setBadgeNumberAsync(number: number): Promise; +} + +/** + * Pedometer + */ +export namespace Pedometer { + function isAvailableAsync(): Promise; + function getStepCountAsync(start: Date, end: Date): Promise<{ steps: number; }>; + function watchStepCount(callback: (params: { steps: number; }) => void): EventSubscription; +} + +/** + * Permissions + */ +export namespace Permissions { + type PermissionType = 'remoteNotifications' | 'location' | + 'camera' | 'contacts' | 'audioRecording' | 'calendar'; + type PermissionStatus = 'undetermined' | 'granted' | 'denied'; + type PermissionExpires = 'never'; + + interface PermissionDetailsLocationIOS { + scope: 'whenInUse' | 'always'; + } + + interface PermissionDetailsLocationAndroid { + scope: 'fine' | 'coarse' | 'none'; + } + + interface PermissionResponse { + status: PermissionStatus; + expires: PermissionExpires; + ios?: PermissionDetailsLocationIOS; + android?: PermissionDetailsLocationAndroid; + } + + function getAsync(type: PermissionType): Promise; + function askAsync(type: PermissionType): Promise; + + type RemoteNotificationPermission = 'remoteNotifications'; + + const CAMERA: 'camera'; + const CAMERA_ROLL: 'cameraRoll'; + const AUDIO_RECORDING: 'audioRecording'; + const LOCATION: 'location'; + const REMOTE_NOTIFICATIONS: RemoteNotificationPermission; + const NOTIFICATIONS: RemoteNotificationPermission; + const CONTACTS: 'contacts'; + const SYSTEM_BRIGHTNESS: 'systemBrightness'; + const CALENDAR: 'calendar'; +} + +/** + * Register Root Component + */ +export function registerRootComponent(component: ComponentType): void; + +/** + * ScreenOrientation + */ +export namespace ScreenOrientation { + interface Orientations { + ALL: 'ALL'; + ALL_BUT_UPSIDE_DOWN: 'ALL_BUT_UPSIDE_DOWN'; + PORTRAIT: 'PORTRAIT'; + PORTRAIT_UP: 'PORTRAIT_UP'; + PORTRAIT_DOWN: 'PORTRAIT_DOWN'; + LANDSCAPE: 'LANDSCAPE'; + LANDSCAPE_LEFT: 'LANDSCAPE_LEFT'; + LANDSCAPE_RIGHT: 'LANDSCAPE_RIGHT'; + } + + const Orientation: Orientations; + + function allow(orientation: keyof Orientations): void; +} + +/** + * SecureStore + */ +export namespace SecureStore { + interface SecureStoreOptions { + keychainService?: string; + keychainAccessible?: number; + } + + function setItemAsync(key: string, value: string, options?: SecureStoreOptions): Promise; + function getItemAsync(key: string, options?: SecureStoreOptions): Promise; + function deleteItemAsync(key: string, options?: SecureStoreOptions): Promise; +} + +/** + * Segment + */ +export namespace Segment { + function initialize(keys: { + androidWriteKey: string; + iosWriteKey: string; + }): void; + function identify(userId: string): void; + function identifyWithTraits(userId: string, traits: object): void; + function track(event: string): void; + function reset(): void; + function trackWithProperties(event: string, properties: object): void; + function screen(screenName: string): void; + function screenWithProperties(screenName: string, properties: object): void; + function flush(): void; +} + +/** + * Speech + */ +export namespace Speech { + interface SpeechOptions { + language?: string; + pitch?: number; + rate?: number; + onStart?: () => void; + onStopped?: () => void; + onDone?: () => void; + onError?: (error: string) => void; + } + + function speak(text: string, options?: SpeechOptions): void; + function stop(): void; + function isSpeakingAsync(): Promise; + + /** Available on iOS only */ + function pause(): void; + + /** Available on iOS only */ + function resume(): void; +} + +/** + * SQLite + */ +export namespace SQLite { + type Error = any; + + interface Database { + transaction( + callback: (transaction: Transaction) => any, + error?: (error: Error) => any, // TODO def of error + success?: () => any + ): void; + } + + interface Transaction { + executeSql( + sqlStatement: string, + arguments?: string[] | number[], + success?: (transaction: Transaction, resultSet: ResultSet) => any, + error?: (transaction: Transaction, error: Error) => any + ): void; + } + + interface ResultSet { + insertId: number; + rowAffected: number; + rows: { + length: number; + item: (index: number) => any; + _array: HashMap[]; + }; + } + + function openDatabase( + name: string | { + name: string, + version?: string, + description?: string, + size?: number, + callback?: () => any + }, + version?: string, + description?: string, + size?: number, + callback?: () => any + ): any; +} + +// #region Svg +/** + * Svg + */ +export interface SvgCommonProps { + fill?: string; + fillOpacity?: number | string; + fillRule?: 'nonzero' | 'evenodd'; + stroke?: string; + strokeWidth?: number | string; + strokeOpacity?: number | string; + strokeLinecap?: string; + strokeLineJoin?: string; + strokeDasharray?: any[]; + strokeDashoffset?: any; + x?: number | string; + y?: number | string; + rotate?: number | string; + rotation?: number | string; + scale?: number | string; + origin?: number | string; + originX?: number | string; + originY?: number | string; + id?: string; + disabled?: boolean; + onPress?: () => any; + onPressIn?: () => any; + onPressOut?: () => any; + onLongPress?: () => any; + delayPressIn?: number; + delayPressOut?: number; + delayLongPress?: number; +} + +export interface SvgRectProps extends SvgCommonProps { + width: number | string; + height: number | string; +} + +export interface SvgCircleProps extends SvgCommonProps { + cx: number | string; + cy: number | string; + r: number | string; +} + +export interface SvgEllipseProps extends SvgCommonProps { + cx: number | string; + cy: number | string; + rx: number | string; + ry: number | string; +} + +export interface SvgLineProps extends SvgCommonProps { + x1: number | string; + y1: number | string; + x2: number | string; + y2: number | string; +} + +export interface SvgPolyProps extends SvgCommonProps { + points: string; +} + +export interface SvgPathProps extends SvgCommonProps { + d: string; +} + +export interface SvgTextProps extends SvgCommonProps { + textAnchor?: string; + fontSize?: number | string; + fontWeight?: string; +} + +export interface SvgTSpanProps extends SvgTextProps { + dx?: string; + dy?: string; +} + +export interface SvgTextPathProps extends SvgCommonProps { + href?: string; + startOffset?: string; +} + +export interface SvgUseProps extends SvgCommonProps { + href: string; + x: number | string; + y: number | string; +} + +export interface SvgSymbolProps extends SvgCommonProps { + viewBox: string; + width: number | string; + height: number | string; +} + +export interface SvgLinearGradientProps extends SvgCommonProps { + x1: number | string; + x2: number | string; + y1: number | string; + y2: number | string; +} + +export interface SvgRadialGradientProps extends SvgCommonProps { + cx: number | string; + cy: number | string; + rx: number | string; + ry: number | string; + fx: number | string; + fy: number | string; + gradientUnits?: string; +} + +export interface SvgStopProps extends SvgCommonProps { + offset?: string; + stopColor?: string; + stopOpacity?: string; +} + +export class Svg extends Component<{ width: number, height: number }> { + static Circle: ComponentClass; + static ClipPath: ComponentClass; + static Defs: ComponentClass; + static Ellipse: ComponentClass; + static G: ComponentClass; + static Line: ComponentClass; + static LinearGradient: ComponentClass; + static Path: ComponentClass; + static Polygon: ComponentClass; + static Polyline: ComponentClass; + static RadialGradient: ComponentClass; + static Rect: ComponentClass; + static Stop: ComponentClass; + static Symbol: ComponentClass; + static Text: ComponentClass; + static TextPath: ComponentClass; + static TSpan: ComponentClass; + static Use: ComponentClass; +} +// #endregion + +/** + * Take Snapshot + */ +export function takeSnapshotAsync( + view?: (number | React.ReactElement), + options?: { + width?: number, + height?: number, + format?: 'png' | 'jpg' | 'jpeg' | 'webm', + quality?: number, + result?: 'file' | 'base64' | 'data-uri', + } +): Promise; + +/** Helpful utility functions that don’t fit anywhere else, including some localization and internationalization methods. */ +export namespace Util { + /** Returns the current device country code. */ + function getCurrentDeviceCountryAsync(): Promise; + + /** Returns the current device locale as a string. */ + function getCurrentLocaleAsync(): Promise; + + /** Returns the current device time zone name. */ + function getCurrentTimeZoneAsync(): Promise; + + /** Reloads the current experience. This will fetch and load the newest available JavaScript supported by the device’s Expo environment. This is useful for triggering an update of your experience if you have published a new version. */ + function reload(): void; + + /** _Android only_. Invokes a callback when a new version of your app is successfully downloaded in the background. */ + function addNewVersionListenerExperimental(listener: (event: { + manifest: object; + }) => void): { remove(): void; }; +} + +// #region Video +/** + * Expo Video + */ +export interface NaturalSize { + width: number; + height: number; + orientation: Orientation; +} + +export interface ReadyForDisplayEvent { + naturalSize: NaturalSize; + status: PlaybackStatus; +} + +export enum FullscreenUpdateVariants { + IOS_FULLSCREEN_UPDATE_PLAYER_WILL_PRESENT = 0, + IOS_FULLSCREEN_UPDATE_PLAYER_DID_PRESENT = 1, + IOS_FULLSCREEN_UPDATE_PLAYER_WILL_DISMISS = 2, + IOS_FULLSCREEN_UPDATE_PLAYER_DID_DISMISS = 3 +} + +export interface FullscreenUpdateEvent { + fullscreenUpdate: FullscreenUpdateVariants; + status: PlaybackStatus; +} + +export interface VideoProps { + source?: PlaybackSource | null; + posterSource?: URISource | RequireSource; + + resizeMode?: ResizeModeContain | ResizeModeCover | ResizeModeStretch; + useNativeControls?: boolean; + usePoster?: boolean; + + onPlaybackStatusUpdate?: (status: PlaybackStatus) => void; + onReadyForDisplay?: (event: ReadyForDisplayEvent) => void; + onIOSFullscreenUpdate?: (event: FullscreenUpdateEvent) => void; + + onLoadStart?: () => void; + onLoad?: (status: PlaybackStatus) => void; + onError?: (error: string) => void; + + status?: PlaybackStatusToSet; + progressUpdateIntervalMillis?: number; + positionMillis?: number; + shouldPlay?: boolean; + rate?: number; + shouldCorrectPitch?: boolean; + volume?: number; + isMuted?: boolean; + isLooping?: boolean; + + scaleX?: number; + scaleY?: number; + translateX?: number; + translateY?: number; + rotation?: number; + ref?: Ref; +} + +export interface VideoState { + showPoster: boolean; +} + +export class Video extends Component { + static RESIZE_MODE_CONTAIN: ResizeModeContain; + static RESIZE_MODE_COVER: ResizeModeCover; + static RESIZE_MODE_STRETCH: ResizeModeStretch; + static IOS_FULLSCREEN_UPDATE_PLAYER_WILL_PRESENT: FullscreenUpdateVariants.IOS_FULLSCREEN_UPDATE_PLAYER_WILL_PRESENT; + static IOS_FULLSCREEN_UPDATE_PLAYER_DID_PRESENT: FullscreenUpdateVariants.IOS_FULLSCREEN_UPDATE_PLAYER_DID_PRESENT; + static IOS_FULLSCREEN_UPDATE_PLAYER_WILL_DISMISS: FullscreenUpdateVariants.IOS_FULLSCREEN_UPDATE_PLAYER_WILL_DISMISS; + static IOS_FULLSCREEN_UPDATE_PLAYER_DID_DISMISS: FullscreenUpdateVariants.IOS_FULLSCREEN_UPDATE_PLAYER_DID_DISMISS; +} +// #endregion + +/** + * Web Browser + */ +export namespace WebBrowser { + function openBrowserAsync(url: string): Promise<{ type: 'cancelled' | 'dismissed' }>; + function openAuthSessionAsync(url: string, redirectUrl?: string): Promise<{ type: 'cancelled' | 'dismissed' }>; + function dismissBrowser(): Promise<{ type: 'dismissed' }>; +} + +// #region Calendar +/** + * Calendar + * + * Provides an API for interacting with the device’s system calendars, events, reminders, and associated records. + */ +export namespace Calendar { + interface Calendar { + /** Internal ID that represents this calendar on the device */ + id?: string; + + /** Visible name of the calendar */ + title?: string; + + sourceId?: string; // iOS + + /** Object representing the source to be used for the calendar */ + source?: Source; + + /** Type of calendar this object represents */ + type?: CalendarType; // iOS + + /** Color used to display this calendar’s events */ + color?: string; + + /** Whether the calendar is used in the Calendar or Reminders OS app */ + entityType?: EntityTypes; // iOS + + /** Boolean value that determines whether this calendar can be modified */ + allowsModifications?: boolean; + + /** Availability types that this calendar supports */ + allowedAvailabilities?: Availability[]; + + /** Boolean value indicating whether this is the device’s primary calendar */ + isPrimary?: boolean; // Android + + /** Internal system name of the calendar */ + name?: string; // Android + + /** Name for the account that owns this calendar */ + ownerAccount?: string; // Android + + /** Time zone for the calendar */ + timeZone?: string; // Android + + /** Alarm methods that this calendar supports */ + allowedReminders?: AlarmMethod[]; // Android + + /** Attendee types that this calendar supports */ + allowedAttendeeTypes?: AttendeeType[]; // Android + + /** Indicates whether the OS displays events on this calendar */ + isVisible?: boolean; // Android + + /** Indicates whether this calendar is synced and its events stored on the device */ + isSynced?: boolean; // Android + + /** Level of access that the user has for the calendar */ + accessLevel?: CalendarAccessLevel; // Android + } + + interface Source { + /** Internal ID that represents this source on the device */ + id?: string; // iOS only ?? + + /** Type of account that owns this calendar */ + type?: string; + + /** Name for the account that owns this calendar */ + name?: string; + + /** Whether this source is the local phone account */ + isLocalAccount?: boolean; // Android + } + + interface Event { + /** Internal ID that represents this event on the device */ + id?: string; + + /** ID of the calendar that contains this event */ + calendarId?: string; + + /** Visible name of the event */ + title?: string; + + /** Location field of the event */ + location?: string; + + /** Date when the event record was created */ + creationDate?: string; // iOS + + /** Date when the event record was last modified */ + lastModifiedDate?: string; // iOS + + /** Time zone the event is scheduled in */ + timeZone?: string; + + /** Time zone for the event end time */ + endTimeZone?: string; // Android + + /** URL for the event */ + url?: string; // iOS + + /** Description or notes saved with the event */ + notes?: string; + + /** Array of Alarm objects which control automated reminders to the user */ + alarms?: Alarm[]; + + /** Object representing rules for recurring or repeating events. Null for one-time events. */ + recurrenceRule?: RecurrenceRule; + + /** Date object or string representing the time when the event starts */ + startDate?: string; + + /** Date object or string representing the time when the event ends */ + endDate?: string; + + /** For recurring events, the start date for the first (original) instance of the event */ + originalStartDate?: string; // iOS + + /** Boolean value indicating whether or not the event is a detached (modified) instance of a recurring event */ + isDetached?: boolean; // iOS + + /** Whether the event is displayed as an all-day event on the calendar */ + allDay?: boolean; + + /** The availability setting for the event */ + availability?: Availability; // Availability + + /** Status of the event */ + status?: EventStatus; // Status + + /** Organizer of the event, as an Attendee object */ + organizer?: string; // Organizer - iOS + + /** Email address of the organizer of the event */ + organizerEmail?: string; // Android + + /** User’s access level for the event */ + accessLevel?: EventAccessLevel; // Android, + + /** Whether invited guests can modify the details of the event */ + guestsCanModify?: boolean; // Android, + + /** Whether invited guests can invite other guests */ + guestsCanInviteOthers?: boolean; // Android + + /** Whether invited guests can see other guests */ + guestsCanSeeGuests?: boolean; // Android + + /** For detached (modified) instances of recurring events, the ID of the original recurring event */ + originalId?: string; // Android + + /** For instances of recurring events, volatile ID representing this instance; not guaranteed to always refer to the same instance */ + instanceId?: string; // Android + } + + interface Attendee { + /** Internal ID that represents this attendee on the device */ + id?: string; // Android + + /** Indicates whether or not this attendee is the current OS user */ + isCurrentUser?: boolean; // iOS + + /** Displayed name of the attendee */ + name?: string; + + /** Role of the attendee at the event */ + role?: AttendeeRole; + + /** Status of the attendee in relation to the event */ + status?: AttendeeStatus; + + /** Type of the attendee */ + type?: AttendeeType; + + /** URL for the attendee */ + url?: string; // iOS + + /** Email address of the attendee */ + email?: string; // Android + } + + interface Reminder { + /** Internal ID that represents this reminder on the device */ + id?: string; + + /** ID of the calendar that contains this reminder */ + calendarId?: string; + + /** Visible name of the reminder */ + title?: string; + + /** Location field of the reminder */ + location?: string; + + /** Date when the reminder record was created */ + creationDate?: string; + + /** Date when the reminder record was last modified */ + lastModifiedDate?: string; + + /** Time zone the reminder is scheduled in */ + timeZone?: string; + + /** URL for the reminder */ + url?: string; + + /** Description or notes saved with the reminder */ + notes?: string; + + /** Array of Alarm objects which control automated alarms to the user about the task */ + alarms?: Alarm[]; + + /** Object representing rules for recurring or repeated reminders. Null for one-time tasks. */ + recurrenceRule?: RecurrenceRule; + + /** Date object or string representing the start date of the reminder task */ + startDate?: string; + + /** Date object or string representing the time when the reminder task is due */ + dueDate?: string; + + /** Indicates whether or not the task has been completed */ + completed?: boolean; + + /** Date object or string representing the date of completion, if completed is true */ + completionDate?: string; + } + + interface Alarm { + /** Date object or string representing an absolute time the alarm should occur; overrides relativeOffset and structuredLocation if specified alongside either */ + absoluteDate?: string; // iOS + + /** Number of minutes from the startDate of the calendar item that the alarm should occur; use negative values to have the alarm occur before the startDate */ + relativeOffset?: string; + structuredLocation?: { + // iOS + title?: string; + proximity?: string; // Proximity + radius?: number; + coords?: { + latitude?: number; + longitude?: number; + }; + }; + + /** Method of alerting the user that this alarm should use; on iOS this is always a notification */ + method?: AlarmMethod; // Method, Android + } + + interface RecurrenceRule { + /** How often the calendar item should recur */ + frequency: Frequency; // Frequency + + /** Interval at which the calendar item should recur. For example, an interval: 2 with frequency: DAILY would yield an event that recurs every other day. Defaults to 1 . */ + interval?: number; + + /** Date on which the calendar item should stop recurring; overrides occurrence if both are specified */ + endDate?: string; + + /** Number of times the calendar item should recur before stopping */ + occurrence?: number; + } + + enum EntityTypes { + EVENT = 'event', + REMINDER = 'reminder', + } + + enum CalendarType { + LOCAL = 'local', + CALDAV = 'caldav', + EXCHANGE = 'exchange', + SUBSCRIBED = 'subscribed', + BIRTHDAYS = 'birthdays' + } + + enum Availability { + NOT_SUPPORTED = 'notSupported', // iOS + BUSY = 'busy', + FREE = 'free', + TENTATIVE = 'tentative', + UNAVAILABLE = 'unavailable' // iOS + } + + enum AlarmMethod { + ALARM = 'alarm', + ALERT = 'alert', + EMAIL = 'email', + SMS = 'sms', + DEFAULT = 'default', + } + + enum AttendeeType { + UNKNOWN = 'unknown', // iOS + PERSON = 'person', // iOS + ROOM = 'room', // iOS + GROUP = 'group', // iOS + RESOURCE = 'resource', + OPTIONAL = 'optional', // Android + REQUIRED = 'required', // Android + NONE = 'none' // Android + } + + enum CalendarAccessLevel { + CONTRIBUTOR = 'contributor', + EDITOR = 'editor', + FREEBUSY = 'freebusy', + OVERRIDE = 'override', + OWNER = 'owner', + READ = 'read', + RESPOND = 'respond', + ROOT = 'root', + NONE = 'none' + } + + enum EventAccessLevel { + CONFIDENTIAL = 'confidential', + PRIVATE = 'private', + PUBLIC = 'public', + DEFAULT = 'default' + } + + enum EventStatus { + NONE = 'none', + CONFIRMED = 'confirmed', + TENTATIVE = 'tentative', + CANCELED = 'canceled' + } + + enum AttendeeRole { + UNKNOWN = 'unknown', // iOS + REQUIRED = 'required', // iOS + OPTIONAL = 'optional', // iOS + CHAIR = 'chair', // iOS + NON_PARTICIPANT = 'nonParticipant', // iOS + ATTENDEE = 'attendee', // Android + ORGANIZER = 'organizer', // Android + PERFORMER = 'performer', // Android + SPEAKER = 'speaker', // Android + NONE = 'none' // Android + } + + enum AttendeeStatus { + UNKNOWN = 'unknown', // iOS + PENDING = 'pending', // iOS + ACCEPTED = 'accepted', + DECLINED = 'declined', + TENTATIVE = 'tentative', + DELEGATED = 'delegated', // iOS + COMPLETED = 'completed', // iOS + IN_PROCESS = 'inProcess', // iOS + INVITED = 'invited', // Android + NONE = 'none' // Android + } + + enum Frequency { + DAILY = 'daily', + WEEKLY = 'weekly', + MONTHLY = 'monthly', + YEARLY = 'yearly' + } + + enum ReminderStatus { + COMPLETED = 'completed', + INCOMPLETE = 'incomplete' + } + + interface RecurringEventOptions { + futureEvents?: boolean; + instanceStartDate?: string; + } + + /** Gets an array of calendar objects with details about the different calendars stored on the device. */ + function getCalendarsAsync( + /** (iOS only) Not required, but if defined, filters the returned calendars to a specific entity type. */ + entityType?: EntityTypes + ): Promise; + + /** Creates a new calendar on the device, allowing events to be added later and displayed. */ + function createCalendarAsync(details: Calendar): Promise; + + /** Updates the provided details of an existing calendar stored on the device. To remove a property, explicitly set it to null in details */ + function updateCalendarAsync(id: string, details?: Calendar | null): Promise; + + /** Deletes an existing calendar and all associated events/reminders/attendees from the device. Use with caution. */ + function deleteCalendarAsync(id: string): Promise; + + /** Returns all events in a given set of calendars over a specified time period. */ + function getEventsAsync( + /** Array of IDs of calendars to search for events in. Required. */ + calendarIds: string[], + + /** Beginning of time period to search for events in. Required. */ + startDate: Date, + + /** End of time period to search for events in. Required. */ + endDate: Date + ): Promise; + + /** Returns a specific event selected by ID. If a specific instance of a recurring event is desired, the start date of this instance must also be provided, as instances of recurring events do not have their own unique and stable IDs on either iOS or Android. */ + function getEventAsync( + /** ID of the event to return. Required. */ + id: string, + + /** A map of options for recurring events */ + recurringEventOptions?: RecurringEventOptions + ): Promise; + + /** Creates a new event on the specified calendar. */ + function createEventAsync( + /** ID of the calendar to create this event in. Required. */ + calendarId: string, + details?: Event + ): Promise; + + /** Updates the provided details of an existing calendar stored on the device. To remove a property, explicitly set it to null in details */ + function updateEventAsync( + /** ID of the event to be updated. Required. */ + id: string, + + /** A map of properties to be updated */ + details?: Event | null, + + /** A map of options for recurring events */ + recurrentEventOptions?: RecurringEventOptions + ): Promise; + + /** Deletes an existing event from the device. Use with caution. */ + function deleteEventAsync( + /** ID of the event to be deleted. Required. */ + id: string, + + /** A map of options for recurring events */ + recurringEventOptions?: RecurringEventOptions + ): Promise; + + /** Gets all attendees for a given event (or instance of a recurring event). */ + function getAttendeesForEventAsync( + /** ID of the event to return attendees for. Required. */ + eventId: string, + + /** A map of options for recurring events */ + recurrentEventOptions?: RecurringEventOptions + ): Promise; + + /** Available on Android only. Creates a new attendee record and adds it to the specified event. Note that if eventId specifies a recurring event, this will add the attendee to every instance of the event. */ + function createAttendeeAsync( + /** ID of the event to add this attendee to. Required. */ + eventId: string, + + /** A map of details for the attendee to be created */ + details?: Attendee + ): Promise; + + /** Available on Android only. Updates an existing attendee record. To remove a property, explicitly set it to null in details. */ + function updateAttendeeAsync( + /** ID of the attendee record to be updated. Required. */ + id: string, + + /** A map of properties to be updated */ + details?: Attendee | null + ): Promise; + + /** Available on Android only. Deletes an existing attendee record from the device. Use with caution. */ + function deleteAttendeeAsync(id: string): Promise; + + /** Available on iOS only. Returns a list of reminders matching the provided criteria. */ + function getRemindersAsync( + /** Array of IDs of calendars to search for reminders in. Required. */ + calendarIds: string[], + + status?: ReminderStatus, + + /** Beginning of time period to search for reminders in. Required if status is defined. */ + startDate?: Date, + + /** End of time period to search for reminders in. Required if status is defined. */ + endDate?: Date + ): Promise; + + /** Available on iOS only. Returns a specific reminder selected by ID. */ + function getReminderAsync(id: string): Promise; + + /** Available on iOS only. Creates a new reminder on the specified calendar. */ + function createReminderAsync( + /** ID of the calendar to create this reminder in. Required. */ + calendarId: string, + + /** A map of details for the reminder to be created */ + details?: Reminder + ): Promise; + + /** Available on iOS only. Updates the provided details of an existing reminder stored on the device. To remove a property, explicitly set it to null in details. */ + function updateReminderAsync( + /** ID of the reminder to be updated. Required. */ + id: string, + + /** A map of properties to be updated */ + details?: Reminder | null + ): Promise; + + /** Available on iOS only. Deletes an existing reminder from the device. Use with caution. */ + function deleteReminderAsync(id: string): Promise; + + /** Available on iOS only. */ + function getSourcesAsync(): Promise; + + /** Available on iOS only. Returns a specific source selected by ID. */ + function getSourceAsync(id: string): Promise; + + /** Available on Android only. Sends an intent to open the specified event in the OS Calendar app. */ + function openEventInCalendar( + /** ID of the event to open. Required. */ + id: string + ): void; +} +// #endregion + +// #region Calendar +/** + * An API to compose mails using OS specific UI. + */ +export namespace MailComposer { + interface ComposeOptions { + /** An array of e-mail addressess of the recipients. */ + recipients?: string[]; + + /** An array of e-mail addressess of the CC recipients. */ + ccRecipients?: string[]; + + /** An array of e-mail addressess of the BCC recipients. */ + bccRecipients?: string[]; + + /** Subject of the mail. */ + subject?: string; + + /** Body of the mail. */ + body?: string; + + /** Whether the body contains HTML tags so it could be formatted properly. Not working perfectly on Android. */ + isHtml?: boolean; + + /** An array of app’s internal file uris to attach. */ + attachments?: string[]; + } + + /** Resolves to a promise with object containing status field that could be either sent, saved or cancelled. Android does not provide such info so it always resolves to sent. */ + function composeAsync( + /** A map defining the data to fill the mail */ + options: ComposeOptions + ): Promise<{ status: 'sent' | 'saved' | 'cancelled' }>; +} +// #endregion diff --git a/types/expo/v25/tsconfig.json b/types/expo/v25/tsconfig.json new file mode 100644 index 0000000000..db8203e995 --- /dev/null +++ b/types/expo/v25/tsconfig.json @@ -0,0 +1,33 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "expo": [ + "expo/v25" + ], + "expo/*": [ + "expo/v25/*" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "expo-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/expo/v25/tslint.json b/types/expo/v25/tslint.json new file mode 100644 index 0000000000..8270136207 --- /dev/null +++ b/types/expo/v25/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "void-return": false, + "max-line-length": false + } +} From 90c86a9404e3ccd60eb7efb1a10a3f8ae18db165 Mon Sep 17 00:00:00 2001 From: Bradley Ayers Date: Fri, 27 Apr 2018 08:01:16 +1000 Subject: [PATCH 0906/2153] Update index.d.ts (#25318) --- types/react-transition-group/v1/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-transition-group/v1/index.d.ts b/types/react-transition-group/v1/index.d.ts index dd62c27e80..42dea4ba15 100644 --- a/types/react-transition-group/v1/index.d.ts +++ b/types/react-transition-group/v1/index.d.ts @@ -11,13 +11,13 @@ export interface HTMLTransitionGroupProps extends HTMLAttributes { childFactory?(child: ReactElement): ReactElement; } -import * as TransitionGroup from "./TransitionGroup"; +import TransitionGroup = require("./TransitionGroup"); export { TransitionGroupProps, TransitionGroupChildLifecycle } from "./TransitionGroup"; -import * as CSSTransitionGroup from "./CSSTransitionGroup"; +import CSSTransitionGroup = require("./CSSTransitionGroup"); export { CSSTransitionGroupProps, CSSTransitionGroupTransitionName From 07268c98de0d3288bd47bf8ec1299167da9f8bdb Mon Sep 17 00:00:00 2001 From: Aneil Mallavarapu Date: Thu, 26 Apr 2018 15:03:40 -0700 Subject: [PATCH 0907/2153] Improve coverage of AWS Lambda Statement type (#25304) * Improve coverage of AWS Lambda Statement type Allow statements which have either a Principal or a Resource, instead of requiring Resource. This permits policies such as described in https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html: ``` { Effect: "Allow", Principal: "*", Action: "*" } ``` and ``` { Effect: "Allow", Principal: { "Service": "lambda.amazonaws.com" }, Action: "sts:AssumeRole" } ``` * Remove unnecessary additional type * Add tests for valid/invalid combinations of Resource and Principal in Statement type This addresses issues raised by @simonbuchanan here: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/25304\#pullrequestreview-115377094 --- types/aws-lambda/aws-lambda-tests.ts | 54 ++++++++++++++++++++++++++++ types/aws-lambda/index.d.ts | 17 ++++++--- 2 files changed, 66 insertions(+), 5 deletions(-) diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index 8ffff3d8a3..9f9d7438e3 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -260,6 +260,46 @@ statement = { Resource: str }; +// $ExpectError +statement = { + Effect: str, + Action: str, + Principal: 123 +}; + +// Bad Resource +// $ExpectError +statement = { + Effect: str, + Action: str, + Resource: 123 +}; + +// Bad Resource with valid Principal +// $ExpectError +statement = { + Effect: str, + Action: str, + Principal: { Service: str}, + Resource: 123 +}; + +// Bad principal with valid Resource +// $ExpectError +statement = { + Effect: str, + Action: str, + Principal: 123, + Resource: str +}; + +// No Effect +// $ExpectError +statement = { + Action: str, + Principal: str +}; + statement = { Sid: str, Action: [str, str], @@ -278,6 +318,20 @@ statement = { NotPrincipal: [str, str] }; +statement = { + Action: str, + Principal: str, + Effect: str +}; + +statement = { + Action: str, + NotPrincipal: { + Service: str + }, + Effect: str +}; + statement = { Effect: str, NotAction: str, diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index cdee868594..7795c4cdfe 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -473,19 +473,26 @@ export interface Condition { * https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-control-access-policy-language-overview.html * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html */ -export type Statement = BaseStatement & StatementAction & StatementResource; +export type Statement = BaseStatement & StatementAction & (StatementResource | StatementPrincipal); export interface BaseStatement { Effect: string; Sid?: string; Condition?: ConditionBlock; - Principal?: string | string[]; - NotPrincipal?: string | string[]; } +export type PrincipalValue = { [key: string]: string | string[]; } | string | string[]; +export interface MaybeStatementPrincipal { + Principal?: PrincipalValue; + NotPrincipal?: PrincipalValue; +} +export interface MaybeStatementResource { + Resource?: string | string[]; + NotResource?: string | string[]; +} export type StatementAction = { Action: string | string[] } | { NotAction: string | string[] }; -export type StatementResource = { Resource: string | string[] } | { NotResource: string | string[] }; - +export type StatementResource = MaybeStatementPrincipal & ({ Resource: string | string[] } | { NotResource: string | string[] }); +export type StatementPrincipal = MaybeStatementResource & ({ Principal: PrincipalValue } | { NotPrincipal: PrincipalValue }); /** * API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Statement. * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output From c2b29011157e1ba86411422631a62ecfdd6f039c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20=C3=96llinger?= Date: Fri, 27 Apr 2018 00:03:59 +0200 Subject: [PATCH 0908/2153] Add ReactCreatableSelectProps (#25253) * add ReactCreatableSelectProps to our props * fix formatting issues --- types/react-virtualized-select/index.d.ts | 6 +-- .../react-virtualized-select-tests.tsx | 39 +++++++++++-------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/types/react-virtualized-select/index.d.ts b/types/react-virtualized-select/index.d.ts index 78454990f7..83c062eab7 100644 --- a/types/react-virtualized-select/index.d.ts +++ b/types/react-virtualized-select/index.d.ts @@ -5,7 +5,7 @@ // TypeScript Version: 2.6 import * as React from "react"; -import { ReactSelectProps, ReactAsyncSelectProps, LoadOptionsHandler, OptionValues } from "react-select"; +import { ReactSelectProps, ReactAsyncSelectProps, ReactCreatableSelectProps, LoadOptionsHandler, OptionValues } from "react-select"; import { ListProps } from "react-virtualized"; export interface VirtualizedOptionRenderOptions { @@ -29,8 +29,8 @@ export interface AdditionalVirtualizedSelectProps { selectComponent?: React.ComponentClass | React.StatelessComponent; } -type VirtualizedSelectProps = (ReactAsyncSelectProps & AdditionalVirtualizedSelectProps & { async: true }) | - ReactSelectProps & AdditionalVirtualizedSelectProps; +type VirtualizedSelectProps = (ReactCreatableSelectProps & ReactAsyncSelectProps & AdditionalVirtualizedSelectProps & { async: true }) | + ReactCreatableSelectProps & ReactSelectProps & AdditionalVirtualizedSelectProps; declare class VirtualizedSelect extends React.PureComponent> {} export default VirtualizedSelect; diff --git a/types/react-virtualized-select/react-virtualized-select-tests.tsx b/types/react-virtualized-select/react-virtualized-select-tests.tsx index 380828e864..2ed0579386 100644 --- a/types/react-virtualized-select/react-virtualized-select-tests.tsx +++ b/types/react-virtualized-select/react-virtualized-select-tests.tsx @@ -1,29 +1,36 @@ import * as React from "react"; -import Select from "react-select"; +import Select, * as ReactSelect from "react-select"; import VirtualizedSelect from "react-virtualized-select"; /*Example TValue.*/ interface Example { - name: string; + name: string; } /*Example generic class.*/ class ExampleSelectAsync extends VirtualizedSelect { } +class ExampleSelectCreatable extends VirtualizedSelect { +} +
-
} - selectComponent={Select} - options={[]} - /> -
} - selectComponent={Select} - loadOptions={(input: string) => Promise.resolve([{name: 'Hi'}])} - /> +
} + selectComponent={Select} + options={[]} + /> +
} + selectComponent={Select} + loadOptions={(input: string) => Promise.resolve([{name: 'Hi'}])} + /> + arg.label.length > 1} + />
; From 014cf5df60d26ae3051a91cd8d54ade0488fafd2 Mon Sep 17 00:00:00 2001 From: Moritz Gunz Date: Fri, 27 Apr 2018 00:06:33 +0200 Subject: [PATCH 0909/2153] Fix incorrect enum declaration (#25300) --- types/spotify-web-playback-sdk/index.d.ts | 13 ++++++------- .../spotify-web-playback-sdk-tests.ts | 1 + 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/types/spotify-web-playback-sdk/index.d.ts b/types/spotify-web-playback-sdk/index.d.ts index ee3086e40e..93ad7af689 100644 --- a/types/spotify-web-playback-sdk/index.d.ts +++ b/types/spotify-web-playback-sdk/index.d.ts @@ -64,7 +64,12 @@ declare namespace Spotify { duration: number; paused: boolean; position: number; - repeat_mode: RepeatMode; + /** + * 0: NO_REPEAT + * 1: ONCE_REPEAT + * 2: FULL_REPEAT + */ + repeat_mode: 0 | 1 | 2; shuffle: boolean; restrictions: PlaybackRestrictions; track_window: PlaybackTrackWindow; @@ -82,12 +87,6 @@ declare namespace Spotify { volume?: number; } - enum RepeatMode { - NO_REPEAT = 0, - ONCE_REPEAT = 1, - FULL_REPEAT = 2, - } - type ErrorListener = (err: Error) => void; type PlaybackInstanceListener = (inst: WebPlaybackInstance) => void; type PlaybackStateListener = (s: PlaybackState) => void; diff --git a/types/spotify-web-playback-sdk/spotify-web-playback-sdk-tests.ts b/types/spotify-web-playback-sdk/spotify-web-playback-sdk-tests.ts index 8f2c27f33d..1fc6f8fc4c 100644 --- a/types/spotify-web-playback-sdk/spotify-web-playback-sdk-tests.ts +++ b/types/spotify-web-playback-sdk/spotify-web-playback-sdk-tests.ts @@ -27,6 +27,7 @@ player.addListener("ready", (data) => { player.getCurrentState().then((playbackState: Spotify.PlaybackState | null) => { if (playbackState) { const { current_track, next_tracks } = playbackState.track_window; + const repeatMode: 0 | 1 | 2 = playbackState.repeat_mode; console.log("Currently Playing", current_track); console.log("Playing Next", next_tracks[0]); From a965835ec71c137865d16ab2fc33aa446b4d7062 Mon Sep 17 00:00:00 2001 From: Adrian Blumer Date: Fri, 27 Apr 2018 00:07:34 +0200 Subject: [PATCH 0910/2153] webgl2: Allow for better type union with `WebGLRenderingContext` (#25059) * allow for better type union with WebGLRenderingContext adjusted typings for better declaration merging of some of the method declarations * removed `BufferData` and `PixelData` type definitions because otherwise they get exported as well * addressed code review feedback - fixed typos - reverted function signature changes on functions / overloads only introduced in WebGL2 - added WebGL1 compatiblity line for readPixels --- types/webgl2/index.d.ts | 82 +++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 32 deletions(-) diff --git a/types/webgl2/index.d.ts b/types/webgl2/index.d.ts index 8c59b117b3..a18d509e99 100644 --- a/types/webgl2/index.d.ts +++ b/types/webgl2/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for WebGL 2, Editor's Draft Fri Feb 24 16:10:18 2017 -0800 // Project: https://www.khronos.org/registry/webgl/specs/latest/2.0/ // Definitions by: Nico Kemnitz +// Adrian Blumer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface HTMLCanvasElement extends HTMLElement { @@ -286,12 +287,16 @@ interface WebGL2RenderingContext extends WebGLRenderingContext { /* Buffer objects */ // WebGL1: - bufferData(target: number, size: number, usage: number): void; - bufferData(target: number, srcData: ArrayBuffer | ArrayBufferView | null, usage: number): void; - bufferSubData(target: number, dstByteOffset: number, srcData: ArrayBuffer | ArrayBufferView | null): void; + bufferData(target: number, sizeOrData: number | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | + Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, usage: number): void; + bufferSubData(target: number, dstByteOffset: number, srcData: Int8Array | Int16Array | Int32Array | Uint8Array | + Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): void; + // For compatibility with WebGL 1 context in older Typescript versions. + bufferData(target: number, data: ArrayBufferView, usage: number): void; + bufferSubData(target: number, dstByteOffset: number, srcData: ArrayBufferView): void; // WebGL2: - bufferData(target: number, srcData: ArrayBufferView, usage: number, srcOffset: number, - length?: number): void; + bufferData(target: number, srcData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | + Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, usage: number, srcOffset: number, length?: number): void; bufferSubData(target: number, dstByteOffset: number, srcData: ArrayBufferView, srcOffset: number, length?: number): void; @@ -387,7 +392,11 @@ interface WebGL2RenderingContext extends WebGLRenderingContext { compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, imageSize: number, offset: number): void; compressedTexImage2D(target: number, level: number, internalformat: number, width: number, - height: number, border: number, srcData: ArrayBufferView | null, + height: number, border: number, srcData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | + Uint8ClampedArray | Float32Array | Float64Array | DataView | null, srcOffset?: number, srcLengthOverride?: number): void; + // For compatibility with WebGL 1 context in older Typescript versions. + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, + height: number, border: number, srcData: ArrayBufferView, srcOffset?: number, srcLengthOverride?: number): void; compressedTexImage3D(target: number, level: number, internalformat: number, width: number, @@ -398,6 +407,11 @@ interface WebGL2RenderingContext extends WebGLRenderingContext { compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, imageSize: number, offset: number): void; + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, + width: number, height: number, format: number, + srcData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | + Uint8ClampedArray | Float32Array | Float64Array | DataView | null, srcOffset?: number, srcLengthOverride?: number): void; + // For compatibility with WebGL 1 context in older Typescript versions. compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, srcData: ArrayBufferView | null, @@ -422,59 +436,59 @@ interface WebGL2RenderingContext extends WebGLRenderingContext { uniform3ui(location: WebGLUniformLocation | null, v0: number, v1: number, v2: number): void; uniform4ui(location: WebGLUniformLocation | null, v0: number, v1: number, v2: number, v3: number): void; - uniform1fv(location: WebGLUniformLocation | null, data: Float32Array | number[], srcOffset?: number, + uniform1fv(location: WebGLUniformLocation | null, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform2fv(location: WebGLUniformLocation | null, data: Float32Array | number[], srcOffset?: number, + uniform2fv(location: WebGLUniformLocation | null, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform3fv(location: WebGLUniformLocation | null, data: Float32Array | number[], srcOffset?: number, + uniform3fv(location: WebGLUniformLocation | null, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform4fv(location: WebGLUniformLocation | null, data: Float32Array | number[], srcOffset?: number, + uniform4fv(location: WebGLUniformLocation | null, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform1iv(location: WebGLUniformLocation | null, data: Int32Array | number[], srcOffset?: number, + uniform1iv(location: WebGLUniformLocation | null, data: Int32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform2iv(location: WebGLUniformLocation | null, data: Int32Array | number[], srcOffset?: number, + uniform2iv(location: WebGLUniformLocation | null, data: Int32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform3iv(location: WebGLUniformLocation | null, data: Int32Array | number[], srcOffset?: number, + uniform3iv(location: WebGLUniformLocation | null, data: Int32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform4iv(location: WebGLUniformLocation | null, data: Int32Array | number[], srcOffset?: number, + uniform4iv(location: WebGLUniformLocation | null, data: Int32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform1uiv(location: WebGLUniformLocation | null, data: Uint32Array | number[], srcOffset?: number, + uniform1uiv(location: WebGLUniformLocation | null, data: Uint32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform2uiv(location: WebGLUniformLocation | null, data: Uint32Array | number[], srcOffset?: number, + uniform2uiv(location: WebGLUniformLocation | null, data: Uint32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform3uiv(location: WebGLUniformLocation | null, data: Uint32Array | number[], srcOffset?: number, + uniform3uiv(location: WebGLUniformLocation | null, data: Uint32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform4uiv(location: WebGLUniformLocation | null, data: Uint32Array | number[], srcOffset?: number, + uniform4uiv(location: WebGLUniformLocation | null, data: Uint32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | number[], + uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | number[], + uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | number[], + uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | number[], + uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | number[], + uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | number[], + uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | number[], + uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | number[], + uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | number[], + uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; /* Vertex attribs */ vertexAttribI4i(index: number, x: number, y: number, z: number, w: number): void; - vertexAttribI4iv(index: number, values: Int32Array | number[]): void; + vertexAttribI4iv(index: number, values: Int32Array | ArrayLike): void; vertexAttribI4ui(index: number, x: number, y: number, z: number, w: number): void; - vertexAttribI4uiv(index: number, values: Uint32Array | number[]): void; + vertexAttribI4uiv(index: number, values: Uint32Array | ArrayLike): void; vertexAttribIPointer(index: number, size: number, type: number, stride: number, offset: number): void; /* Writing to the drawing buffer */ @@ -485,6 +499,10 @@ interface WebGL2RenderingContext extends WebGLRenderingContext { /* Reading back pixels */ // WebGL1: + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, + dstData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | + Float32Array | Float64Array | DataView | null): void; + // For compatibility with WebGL 1 context in older Typescript versions. readPixels(x: number, y: number, width: number, height: number, format: number, type: number, dstData: ArrayBufferView | null): void; // WebGL2: @@ -496,11 +514,11 @@ interface WebGL2RenderingContext extends WebGLRenderingContext { /* Multiple Render Targets */ drawBuffers(buffers: number[]): void; - clearBufferfv(buffer: number, drawbuffer: number, values: Float32Array | number[], + clearBufferfv(buffer: number, drawbuffer: number, values: Float32Array | ArrayLike, srcOffset?: number): void; - clearBufferiv(buffer: number, drawbuffer: number, values: Int32Array | number[], + clearBufferiv(buffer: number, drawbuffer: number, values: Int32Array | ArrayLike, srcOffset?: number): void; - clearBufferuiv(buffer: number, drawbuffer: number, values: Uint32Array | number[], + clearBufferuiv(buffer: number, drawbuffer: number, values: Uint32Array | ArrayLike, srcOffset?: number): void; clearBufferfi(buffer: number, drawbuffer: number, depth: number, stencil: number): void; From fc6720f5d27e9301a823150cfa943dbc6a98c5b5 Mon Sep 17 00:00:00 2001 From: Andrew Couch Date: Thu, 26 Apr 2018 18:07:50 -0400 Subject: [PATCH 0911/2153] [analytics-node] Add host and enable constructor parameters (#25346) --- types/analytics-node/analytics-node-tests.ts | 4 +++- types/analytics-node/index.d.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/types/analytics-node/analytics-node-tests.ts b/types/analytics-node/analytics-node-tests.ts index 5dfabb426c..6740aaccff 100644 --- a/types/analytics-node/analytics-node-tests.ts +++ b/types/analytics-node/analytics-node-tests.ts @@ -4,7 +4,9 @@ var analytics: Analytics; function testConfig(): void { analytics = new Analytics('YOUR_WRITE_KEY', { flushAt: 20, - flushAfter: 10000 + flushAfter: 10000, + host: "http://example.com", + enable: true }); } diff --git a/types/analytics-node/index.d.ts b/types/analytics-node/index.d.ts index a1de134195..6834087ff7 100644 --- a/types/analytics-node/index.d.ts +++ b/types/analytics-node/index.d.ts @@ -39,7 +39,9 @@ declare namespace AnalyticsNode { export class Analytics { constructor(writeKey: string, opts?: { flushAt?: number, - flushAfter?: number + flushAfter?: number, + host?: string, + enable?: boolean }); /* The identify method lets you tie a user to their actions and record From c071498b0b58f9803721c01e6a6ad29d95d56a27 Mon Sep 17 00:00:00 2001 From: Ilia Choly Date: Thu, 26 Apr 2018 18:09:38 -0400 Subject: [PATCH 0912/2153] Add discriminated unions for GeoJSON types (#25065) * directly give the bbox property to all objects * add unions along side existing types * add iteration example * add name * extend from GeoJsonObject and GeometryObject * rename Object to GeoJSON --- types/geojson/geojson-tests.ts | 20 ++++++++++++++++++++ types/geojson/index.d.ts | 18 +++++++++++++++--- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/types/geojson/geojson-tests.ts b/types/geojson/geojson-tests.ts index c5c3fa2bdd..4ea0f57a6f 100644 --- a/types/geojson/geojson-tests.ts +++ b/types/geojson/geojson-tests.ts @@ -306,6 +306,11 @@ const collectionNoNull: FeatureCollection = { features: [featureNoNull], }; +const collectionDefault: FeatureCollection = { + type: "FeatureCollection", + features: [] +}; + isNull = featureAllNull.geometry; isPoint = featurePropertyNull.geometry; isNull = featureAllNull.properties; @@ -322,3 +327,18 @@ isPropertyOrNull = collectionMaybeNull.features[0].properties; isPropertyOrNull = collectionPropertyMaybeNull.features[0].properties; isProperty = collectionGeometryMaybeNull.features[0].properties; isProperty = collectionNoNull.features[0].properties; + +for (const { geometry } of collectionDefault.features) { + switch (geometry.type) { + case "Point": + isPoint = geometry; + break; + case "GeometryCollection": + for (const child of geometry.geometries) { + if (child.type === "Point") { + isPoint = child; + } + } + break; + } +} diff --git a/types/geojson/index.d.ts b/types/geojson/index.d.ts index 9a0ab3cd8b..ac1bf84e99 100644 --- a/types/geojson/index.d.ts +++ b/types/geojson/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Jacob Bruun // Arne Schubert // Jeff Jacobson +// Ilia Choly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -62,6 +63,11 @@ export interface GeoJsonObject { bbox?: BBox; } +/** + * Union of GeoJSON objects. + */ +export type GeoJSON = Geometry | Feature | FeatureCollection; + /** * A geometry object. * https://tools.ietf.org/html/rfc7946#section-3 @@ -70,6 +76,12 @@ export interface GeometryObject extends GeoJsonObject { type: GeoJsonGeometryTypes; } +/** + * Union of geometry objects. + * https://tools.ietf.org/html/rfc7946#section-3 + */ +export type Geometry = Point | MultiPoint | LineString | Polygon | MultiPolygon | GeometryCollection; + /** * Point geometry object. * https://tools.ietf.org/html/rfc7946#section-3.1.2 @@ -130,7 +142,7 @@ export interface MultiPolygon extends GeometryObject { */ export interface GeometryCollection extends GeometryObject { type: "GeometryCollection"; - geometries: Array; + geometries: Geometry[]; } export type GeoJsonProperties = { [name: string]: any; } | null; @@ -139,7 +151,7 @@ export type GeoJsonProperties = { [name: string]: any; } | null; * A feature object which contains a geometry and associated properties. * https://tools.ietf.org/html/rfc7946#section-3.2 */ -export interface Feature extends GeoJsonObject { +export interface Feature extends GeoJsonObject { type: "Feature"; /** * The feature's geometry @@ -160,7 +172,7 @@ export interface Feature * A collection of feature objects. * https://tools.ietf.org/html/rfc7946#section-3.3 */ -export interface FeatureCollection extends GeoJsonObject { +export interface FeatureCollection extends GeoJsonObject { type: "FeatureCollection"; features: Array>; } From f1c3dd8b6eda63832f936e5cd90b91b8371ee247 Mon Sep 17 00:00:00 2001 From: Daniel Hritzkiv Date: Thu, 26 Apr 2018 18:09:59 -0400 Subject: [PATCH 0913/2153] [stripe-v3] Differentiate response types on "token", "source" StripePaymentRequest events (#25312) * Differentiate response types on "token", "source" StripePaymentRequest events "token" events will pass a Token objects as part of the StripePaymentResponse object, while "source" events will pass a Source object. * Update tests to reflect different response properties on "token" and "source" events --- types/stripe-v3/index.d.ts | 13 ++++++++++--- types/stripe-v3/stripe-v3-tests.ts | 14 +++++++++++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/types/stripe-v3/index.d.ts b/types/stripe-v3/index.d.ts index 55cc5962df..0c99525290 100644 --- a/types/stripe-v3/index.d.ts +++ b/types/stripe-v3/index.d.ts @@ -255,8 +255,6 @@ declare namespace stripe { } interface StripePaymentResponse { - token?: Token; - source?: Source; complete: (status: string) => void; payerName?: string; payerEmail?: string; @@ -266,11 +264,20 @@ declare namespace stripe { methodName: string; } + interface StripeTokenPaymentResponse extends StripePaymentResponse { + token: Token; + } + + interface StripeSourcePaymentResponse extends StripePaymentResponse { + source: Source; + } + interface StripePaymentRequest { canMakePayment(): Promise<{applePay?: boolean} | null>; show(): void; update(options: StripePaymentRequestUpdateOptions): void; - on(event: 'token' | 'source', handler: (response: StripePaymentResponse) => void): void; + on(event: 'token', handler: (response: StripeTokenPaymentResponse) => void): void; + on(event: 'source', handler: (response: StripeSourcePaymentResponse) => void): void; on(event: 'cancel', handler: () => void): void; on(event: 'shippingaddresschange', handler: (response: {updateWith: (options: UpdateDetails) => void, shippingAddress: ShippingAddress}) => void): void; on(event: 'shippingoptionchange', handler: (response: {updateWith: (options: UpdateDetails) => void, shippingOption: ShippingOption}) => void): void; diff --git a/types/stripe-v3/stripe-v3-tests.ts b/types/stripe-v3/stripe-v3-tests.ts index 201bad8678..f461006cf3 100644 --- a/types/stripe-v3/stripe-v3-tests.ts +++ b/types/stripe-v3/stripe-v3-tests.ts @@ -118,7 +118,19 @@ describe("Stripe", () => { } }); paymentRequest.on('token', ev => { - const body = JSON.stringify({token: ev.token!.id}); + const body = JSON.stringify({token: ev.token.id}); + // post to server... + Promise.resolve({ok: true}) + .then(response => { + if (response.ok) { + ev.complete('success'); + } else { + ev.complete('fail'); + } + }); + }); + paymentRequest.on('source', ev => { + const body = JSON.stringify({token: ev.source.id}); // post to server... Promise.resolve({ok: true}) .then(response => { From 363fbd9d5f4b7b197b1ad4061746f5dc32ff4d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=98=89=E6=B0=B8?= <525315462@qq.com> Date: Thu, 26 Apr 2018 17:10:40 -0500 Subject: [PATCH 0914/2153] add return type for sequelize.model.belongsTo and more (#25341) --- types/sequelize/index.d.ts | 12 ++++++++---- types/sequelize/sequelize-tests.ts | 5 +++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index 37a0b46829..fd56cdbd7c 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -1518,8 +1518,9 @@ declare namespace sequelize { * * @param target The model that will be associated with hasOne relationship * @param options Options for the association + * @return return type of association */ - hasOne(target: Model, options?: AssociationOptionsHasOne): void; + hasOne(target: Model, options?: AssociationOptionsHasOne): IncludeAssociation; /** * Creates an association between this (the source) and the provided target. The foreign key is added on the @@ -1529,8 +1530,9 @@ declare namespace sequelize { * * @param target The model that will be associated with hasOne relationship * @param options Options for the association + * @return return type of association */ - belongsTo(target: Model, options?: AssociationOptionsBelongsTo): void; + belongsTo(target: Model, options?: AssociationOptionsBelongsTo): IncludeAssociation; /** * Create an association that is either 1:m or n:m. @@ -1583,8 +1585,9 @@ declare namespace sequelize { * * @param target The model that will be associated with hasOne relationship * @param options Options for the association + * @return return type of association */ - hasMany(target: Model, options?: AssociationOptionsHasMany): void; + hasMany(target: Model, options?: AssociationOptionsHasMany): IncludeAssociation; /** * Create an N:M association with a join table @@ -1632,9 +1635,10 @@ declare namespace sequelize { * * @param target The model that will be associated with hasOne relationship * @param options Options for the association + * @return return type of association * */ - belongsToMany(target: Model, options: AssociationOptionsBelongsToMany): void; + belongsToMany(target: Model, options: AssociationOptionsBelongsToMany): IncludeAssociation; } diff --git a/types/sequelize/sequelize-tests.ts b/types/sequelize/sequelize-tests.ts index 9c5eb13708..bc600c961d 100644 --- a/types/sequelize/sequelize-tests.ts +++ b/types/sequelize/sequelize-tests.ts @@ -955,6 +955,11 @@ User.findAll( { where: s.where(s.fn('lower', s.col('email')), s.fn('lower', 'TES User.findAll( { subQuery: false, include : [User], order : [[User, User, 'numYears', 'c']] } ); User.findAll( { rejectOnEmpty: true }); +User.findAll( { include : [{ association: User.hasOne( Task, { foreignKey : 'userId' } ) }] } ); +User.findAll( { include : [{ association: User.hasMany( Task, { foreignKey : 'userId' } ) }] } ); +User.findAll( { include : [{ association: Task.belongsTo( User, { foreignKey : 'userId' } ) }] } ); +User.findAll( { include : [{ association: User.belongsToMany( User, { through : Task } ) }] } ); + User.findAll( { where: { $and:[ { username: "user" }, { theDate: new Date() } ] } } ); User.findAll( { where: { $or:[ { username: "user" }, { theDate: new Date() } ] } } ); User.findAll( { where: { $and:[ { username: { $not: "user" } }, { theDate: new Date() } ] } } ); From c19e1e82891e7ae732cd2e1d625d1c9296567fcd Mon Sep 17 00:00:00 2001 From: Ian Copp Date: Thu, 26 Apr 2018 15:12:03 -0700 Subject: [PATCH 0915/2153] Add roll (#25340) --- types/roll/index.d.ts | 55 ++++++++++++++++++++++++++++++++++++++++ types/roll/roll-tests.ts | 20 +++++++++++++++ types/roll/tsconfig.json | 23 +++++++++++++++++ types/roll/tslint.json | 1 + 4 files changed, 99 insertions(+) create mode 100644 types/roll/index.d.ts create mode 100644 types/roll/roll-tests.ts create mode 100644 types/roll/tsconfig.json create mode 100644 types/roll/tslint.json diff --git a/types/roll/index.d.ts b/types/roll/index.d.ts new file mode 100644 index 0000000000..7c3e4f70be --- /dev/null +++ b/types/roll/index.d.ts @@ -0,0 +1,55 @@ +// Type definitions for roll 1.2 +// Project: https://github.com/troygoode/node-roll/ +// Definitions by: icopp +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +type RollTransformation = RollTransformationKey | [RollTransformationKey, number] | ((results: number[]) => number[]); + +type RollTransformationKey = 'sum' | 'add' | 'subtract' | 'multiply' | 'divide' | 'best-of' | 'worst-of'; + +interface RollObject { + quantity: number; + sides: number; + transformations: RollTransformation[]; + toString: () => string; +} + +interface RollOutput { + input: RollObject; + calculations: number[]; + rolled: number[]; + result: number; +} + +declare class InvalidInputError extends Error { + name: 'InvalidInputError'; +} + +declare class Roll { + static InvalidInputError: InvalidInputError; + + constructor(seed?: () => number); + + /** + * Validate user input + */ + validate(input: string): boolean; + + /** + * Parse a string into a roll object + * @throws InvalidInputError + */ + parse(input: string): { + quantity: number; + sides: number; + transformations: RollTransformation[]; + toString: () => string; + }; + + /** + * Roll based on a string or roll object + */ + roll(input: string | RollObject): RollOutput; +} + +export = Roll; diff --git a/types/roll/roll-tests.ts b/types/roll/roll-tests.ts new file mode 100644 index 0000000000..bf28963e05 --- /dev/null +++ b/types/roll/roll-tests.ts @@ -0,0 +1,20 @@ +import Roll = require('roll'); + +// $ExpectType Roll +const roll = new Roll(); + +// $ExpectType number +roll.roll('d6').result; + +// $ExpectType number +roll.roll({ + quantity: 2, + sides: 6, + transformations: [ + 'sum', + ['add', 2] + ] +}).result; + +// $ExpectType InvalidInputError +Roll.InvalidInputError; diff --git a/types/roll/tsconfig.json b/types/roll/tsconfig.json new file mode 100644 index 0000000000..6d7640286d --- /dev/null +++ b/types/roll/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "roll-tests.ts" + ] +} diff --git a/types/roll/tslint.json b/types/roll/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/roll/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From fe5ac79ff97ccaafc7c7c2da54e0c69db8e176ef Mon Sep 17 00:00:00 2001 From: tbounsiar Date: Fri, 27 Apr 2018 00:13:59 +0200 Subject: [PATCH 0916/2153] Body parser xml (#25331) * adding react-owl-carousel types * Update Definitions by list Fix Test error * Fix tslint Fix tsconfig * Add new Type body-parser-xml --- .../body-parser-xml/body-parser-xml-tests.ts | 4 ++++ types/body-parser-xml/index.d.ts | 11 +++++++++ types/body-parser-xml/tsconfig.json | 23 +++++++++++++++++++ types/body-parser-xml/tslint.json | 1 + 4 files changed, 39 insertions(+) create mode 100644 types/body-parser-xml/body-parser-xml-tests.ts create mode 100644 types/body-parser-xml/index.d.ts create mode 100644 types/body-parser-xml/tsconfig.json create mode 100644 types/body-parser-xml/tslint.json diff --git a/types/body-parser-xml/body-parser-xml-tests.ts b/types/body-parser-xml/body-parser-xml-tests.ts new file mode 100644 index 0000000000..9aab34ecc7 --- /dev/null +++ b/types/body-parser-xml/body-parser-xml-tests.ts @@ -0,0 +1,4 @@ +import bodyParser = require('body-parser'); +import bodyParserXml = require('body-parser-xml'); + +bodyParserXml(bodyParser); diff --git a/types/body-parser-xml/index.d.ts b/types/body-parser-xml/index.d.ts new file mode 100644 index 0000000000..c5de21c062 --- /dev/null +++ b/types/body-parser-xml/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for body-parser-xml 1.1 +// Project: https://github.com/fiznool/body-parser-xml +// Definitions by: tbounsiar +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Request, RequestHandler, Response, NextFunction } from 'express'; + +declare function bodyParserXml(bodyParser: any): (req: Request, res: Response, next: NextFunction) => void; + +export = bodyParserXml; diff --git a/types/body-parser-xml/tsconfig.json b/types/body-parser-xml/tsconfig.json new file mode 100644 index 0000000000..c597f3cb08 --- /dev/null +++ b/types/body-parser-xml/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "body-parser-xml-tests.ts" + ] +} \ No newline at end of file diff --git a/types/body-parser-xml/tslint.json b/types/body-parser-xml/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/body-parser-xml/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file From 262cb8eae6dfc1addcc175b71eb11bf8d130e918 Mon Sep 17 00:00:00 2001 From: Ian Copp Date: Thu, 26 Apr 2018 15:15:17 -0700 Subject: [PATCH 0917/2153] Add filter-invalid-dom-props (#25316) --- .../filter-invalid-dom-props-tests.ts | 4 ++++ types/filter-invalid-dom-props/index.d.ts | 11 +++++++++ types/filter-invalid-dom-props/tsconfig.json | 23 +++++++++++++++++++ types/filter-invalid-dom-props/tslint.json | 1 + 4 files changed, 39 insertions(+) create mode 100644 types/filter-invalid-dom-props/filter-invalid-dom-props-tests.ts create mode 100644 types/filter-invalid-dom-props/index.d.ts create mode 100644 types/filter-invalid-dom-props/tsconfig.json create mode 100644 types/filter-invalid-dom-props/tslint.json diff --git a/types/filter-invalid-dom-props/filter-invalid-dom-props-tests.ts b/types/filter-invalid-dom-props/filter-invalid-dom-props-tests.ts new file mode 100644 index 0000000000..5e55ae35a2 --- /dev/null +++ b/types/filter-invalid-dom-props/filter-invalid-dom-props-tests.ts @@ -0,0 +1,4 @@ +import filterInvalidDomProps from 'filter-invalid-dom-props'; + +// $ExpectType Partial<{ notADomProp: boolean; }> +filterInvalidDomProps({ notADomProp: true }); diff --git a/types/filter-invalid-dom-props/index.d.ts b/types/filter-invalid-dom-props/index.d.ts new file mode 100644 index 0000000000..ee74aae22e --- /dev/null +++ b/types/filter-invalid-dom-props/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for filter-invalid-dom-props 2.0 +// Project: https://www.npmjs.com/package/filter-invalid-dom-props +// Definitions by: icopp +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +// Note that the below can't actually be fully typed in the latest version of +// Typescript, because there's no way to regex-match against `data-` or `aria-` +// (which this function allows in addition to a list of static props). + +export default function filterInvalidDOMProps(props: T): Partial; diff --git a/types/filter-invalid-dom-props/tsconfig.json b/types/filter-invalid-dom-props/tsconfig.json new file mode 100644 index 0000000000..923a354c4e --- /dev/null +++ b/types/filter-invalid-dom-props/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "filter-invalid-dom-props-tests.ts" + ] +} diff --git a/types/filter-invalid-dom-props/tslint.json b/types/filter-invalid-dom-props/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/filter-invalid-dom-props/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From eae2ca1b4161a3284d044aad69d2d3f2eb7421c7 Mon Sep 17 00:00:00 2001 From: Derek Clair Date: Thu, 26 Apr 2018 16:17:01 -0600 Subject: [PATCH 0918/2153] Update index.d.ts (#25313) Added `async` and `defer` as optional properties of the `` component. --- types/react-helmet/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/react-helmet/index.d.ts b/types/react-helmet/index.d.ts index 57ac67f2a7..93b83075fe 100644 --- a/types/react-helmet/index.d.ts +++ b/types/react-helmet/index.d.ts @@ -7,9 +7,11 @@ import * as React from "react"; export interface HelmetProps { + async?: boolean; base?: any; bodyAttributes?: Object; defaultTitle?: string; + defer?: boolean; encodeSpecialCharacters?: boolean; htmlAttributes?: any; onChangeClientState?: (newState: any) => void; From b89b85ab984a42f25d7e6a17bfd6e89cb9b51aec Mon Sep 17 00:00:00 2001 From: Lee Standen Date: Thu, 26 Apr 2018 15:18:18 -0700 Subject: [PATCH 0919/2153] Add Types for @atlaskit/inline-edit (#25310) * Add 'atlaskit__inline-edit' * lint changes --- .../atlaskit__inline-edit-tests.tsx | 15 ++++++ types/atlaskit__inline-edit/index.d.ts | 51 +++++++++++++++++++ types/atlaskit__inline-edit/tsconfig.json | 20 ++++++++ types/atlaskit__inline-edit/tslint.json | 1 + 4 files changed, 87 insertions(+) create mode 100644 types/atlaskit__inline-edit/atlaskit__inline-edit-tests.tsx create mode 100644 types/atlaskit__inline-edit/index.d.ts create mode 100644 types/atlaskit__inline-edit/tsconfig.json create mode 100644 types/atlaskit__inline-edit/tslint.json diff --git a/types/atlaskit__inline-edit/atlaskit__inline-edit-tests.tsx b/types/atlaskit__inline-edit/atlaskit__inline-edit-tests.tsx new file mode 100644 index 0000000000..1c8a7278b5 --- /dev/null +++ b/types/atlaskit__inline-edit/atlaskit__inline-edit-tests.tsx @@ -0,0 +1,15 @@ +import InlineEdit from '@atlaskit/inline-edit'; + +import * as React from 'react'; +import { render } from 'react-dom'; + +declare const container: Element; + +render( + Hello
} + onConfirm={() => {}} + onCancel={() => {}} + />, + container, +); diff --git a/types/atlaskit__inline-edit/index.d.ts b/types/atlaskit__inline-edit/index.d.ts new file mode 100644 index 0000000000..4ee82ee4c3 --- /dev/null +++ b/types/atlaskit__inline-edit/index.d.ts @@ -0,0 +1,51 @@ +// Type definitions for @atlaskit/inline-edit 5.0 +// Project: https://bitbucket.org/atlassian/atlaskit-mk-2/ +// Definitions by: Lee Standen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import { ReactElement, Component } from 'react'; +export default class InlineEdit extends Component {} +export class InlineEditStateless extends Component {} + +export interface BaseProps { + /** Label above the input. */ + label?: string; + /** Component to be shown when reading only */ + readView: ReactElement; + /** Component to be shown when editing. Should be an @atlaskit/input. */ + editView?: ReactElement; + /** Set whether the read view should fit width, most obvious when hovered. */ + isFitContainerWidthReadView?: boolean; + /** Greys out text and shows spinner. Does not disable input. */ + isWaiting?: boolean; + /** Sets yellow border with warning symbol at end of input. Removes confirm and cancel buttons. */ + isInvalid?: boolean; + /** Determine whether the label is shown. */ + isLabelHidden?: boolean; + /** Sets whether the checkmark and cross are displayed in the bottom right fo the field. */ + areActionButtonsHidden?: boolean; + /** Sets whether the confirm function is called when the input loses focus. */ + isConfirmOnBlurDisabled?: boolean; + /** Handler called when checkmark is clicked. Also by default called when the input loses focus. */ + onConfirm: () => void; + /** Handler called when the cross is clicked on. */ + onCancel: () => void; + /** html to pass down to the label htmlFor prop. */ + labelHtmlFor?: string; + /** Set whether onConfirm is called on pressing enter. */ + shouldConfirmOnEnter?: boolean; + /** Set whether default stylings should be disabled when editing. */ + disableEditViewFieldBase?: boolean; + /** Component to be shown in an @atlaskit/inline-dialog when edit view is open. */ + invalidMessage?: ReactElement; +} + +export interface StatelessProps extends BaseProps { + /** Whether the component shows the readView or the editView. */ + isEditing: boolean; + /** Handler called when the wrapper or the label are clicked. */ + onEditRequested: () => void; +} + +export type StatefulProps = BaseProps; diff --git a/types/atlaskit__inline-edit/tsconfig.json b/types/atlaskit__inline-edit/tsconfig.json new file mode 100644 index 0000000000..d2974ebb7a --- /dev/null +++ b/types/atlaskit__inline-edit/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react", + "paths": { + "@atlaskit/inline-edit": ["atlaskit__inline-edit"] + } + }, + "files": ["index.d.ts", "atlaskit__inline-edit-tests.tsx"] +} diff --git a/types/atlaskit__inline-edit/tslint.json b/types/atlaskit__inline-edit/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/atlaskit__inline-edit/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 321c042eba683a4be5a8290ec9c15a4f0441bee5 Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Thu, 26 Apr 2018 18:19:59 -0400 Subject: [PATCH 0920/2153] Add type for TreeNode that rc-tree generates internally (#25077) * Add type for TreeNode that rc-tree generates internally * Update test * Make InternalTreeNode an interface since it can't be instantiated --- types/rc-tree/index.d.ts | 55 +++++++++++++++++++-------------- types/rc-tree/rc-tree-tests.tsx | 8 ++--- 2 files changed, 35 insertions(+), 28 deletions(-) diff --git a/types/rc-tree/index.d.ts b/types/rc-tree/index.d.ts index 7cee0d8371..aac9e1ea9f 100644 --- a/types/rc-tree/index.d.ts +++ b/types/rc-tree/index.d.ts @@ -1,15 +1,26 @@ -// Type definitions for rc-tree 1.4 +// Type definitions for rc-tree 1.10 // Project: https://github.com/react-component/tree -// Definitions by: John Reilly +// Definitions by: John Reilly , Methuselah96 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.7 -import { - Component, - Props -} from "react"; +import { Component } from "react"; -export interface TreeNodeProps extends Props { +export interface InternalTreeNodeProps extends TreeNodeProps { + eventKey: string; + expanded: boolean; + selected: boolean; + checked: boolean; + halfChecked: boolean; + pos: string; + dragOver: boolean; + dragOverGapTop: boolean; + dragOverGapBottom: boolean; +} + +export interface InternalTreeNode extends Component { } + +export interface TreeNodeProps { /** * additional css class for treeNode */ @@ -26,10 +37,6 @@ export interface TreeNodeProps extends Props { * tree / subTree's title */ title?: string | JSX.Element; - /** - * it's used with tree props (default)ExpandedKeys / (default)CheckedKeys / (default)SelectedKeys. You'd better set it, and it must be unique in the tree's all treeNodes - */ - key?: string | number; /** * whether it is a leaf node */ @@ -40,43 +47,43 @@ export class TreeNode extends Component { } export interface ExpandData { expanded: boolean; - node: TreeNode; + node: InternalTreeNode; } export interface CheckData { checked: boolean; - checkedNodes: TreeNode[]; + checkedNodes: InternalTreeNode[]; halfCheckedKeys: string[]; - node: TreeNode; + node: InternalTreeNode; event: "check"; } export interface SelectData { selected: boolean; - selectedNodes: TreeNode[]; - node: TreeNode; + selectedNodes: InternalTreeNode[]; + node: InternalTreeNode; event: "select"; } export interface OnDragStartData { event: Event; - node: TreeNode; + node: InternalTreeNode; } export interface OnDragEnterData { event: Event; - node: TreeNode; + node: InternalTreeNode; expandedKeys: string[]; } export interface OnDropData { event: Event; - node: TreeNode; - dragNode: TreeNode; + node: InternalTreeNode; + dragNode: InternalTreeNode; dragNodesKeys: string[]; } -export interface TreeProps extends Props { +export interface TreeProps { /** * additional css class of root dom node */ @@ -158,11 +165,11 @@ export interface TreeProps extends Props { /** * filter some treeNodes as you need. */ - filterTreeNode?(node: TreeNode): boolean; + filterTreeNode?(node: InternalTreeNode): boolean; /** * load data asynchronously */ - loadData?(node: TreeNode): Promise; + loadData?(node: InternalTreeNode): Promise; /** * whether can drag treeNode. */ diff --git a/types/rc-tree/rc-tree-tests.tsx b/types/rc-tree/rc-tree-tests.tsx index 571465978d..99f67beca2 100644 --- a/types/rc-tree/rc-tree-tests.tsx +++ b/types/rc-tree/rc-tree-tests.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import Tree, { TreeNode, SelectData, CheckData } from 'rc-tree'; +import Tree, { TreeNode, SelectData, CheckData, InternalTreeNode } from 'rc-tree'; interface Props { keys: string[]; @@ -44,15 +44,15 @@ export class Demo extends React.Component { console.log('onCheck', checkedKeys, info); } - onDragStart(params: {event: Event, node: TreeNode}) { + onDragStart(params: {event: Event, node: InternalTreeNode}) { console.log('onDragStart', params.event, params.node); } - OnDragEnterData(params: {event: Event, node: TreeNode, expandedKeys: string[]}) { + OnDragEnterData(params: {event: Event, node: InternalTreeNode, expandedKeys: string[]}) { console.log('OnDragEnterData', params.event, params.node, params.expandedKeys); } - OnDropData(params: {event: Event, node: TreeNode, dragNode: TreeNode, dragNodesKeys: string[]}) { + OnDropData(params: {event: Event, node: InternalTreeNode, dragNode: InternalTreeNode, dragNodesKeys: string[]}) { console.log('OnDropData', params.event, params.node, params.dragNode, params.dragNodesKeys); } From 54acb6f5d7e0cd68c013976e65527a37f9e4222e Mon Sep 17 00:00:00 2001 From: Gebatzens Date: Fri, 27 Apr 2018 00:20:59 +0200 Subject: [PATCH 0921/2153] Add types for chardet (#25308) --- types/chardet/chardet-tests.ts | 7 +++++++ types/chardet/index.d.ts | 26 ++++++++++++++++++++++++++ types/chardet/tsconfig.json | 23 +++++++++++++++++++++++ types/chardet/tslint.json | 1 + 4 files changed, 57 insertions(+) create mode 100644 types/chardet/chardet-tests.ts create mode 100644 types/chardet/index.d.ts create mode 100644 types/chardet/tsconfig.json create mode 100644 types/chardet/tslint.json diff --git a/types/chardet/chardet-tests.ts b/types/chardet/chardet-tests.ts new file mode 100644 index 0000000000..7c06d2cc61 --- /dev/null +++ b/types/chardet/chardet-tests.ts @@ -0,0 +1,7 @@ +import * as chardet from "chardet"; + +chardet.detect(new Buffer('hello there!')); +chardet.detectFile('/path/to/file', (err, encoding) => {}); +chardet.detectFileSync('/path/to/file'); + +chardet.detectFile('/path/to/file', { sampleSize: 32 }, (err, encoding) => {}); diff --git a/types/chardet/index.d.ts b/types/chardet/index.d.ts new file mode 100644 index 0000000000..20324be60e --- /dev/null +++ b/types/chardet/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for chardet 0.5 +// Project: https://github.com/runk/node-chardet +// Definitions by: Hauke Oldsen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export interface Confidence { + name: string; + confidence: number; + lang?: string; +} + +export interface Options { + returnAllMatches?: boolean; + sampleSize?: number; +} + +export type Result = Confidence[] | string | null; + +export function detect(buf: Buffer, opts?: Options): Result; + +export function detectFile(path: string, cb: (err: any, result: Result) => void): void; +export function detectFile(path: string, opts: Options, cb: (err: any, result: Result) => void): void; + +export function detectFileSync(path: string, opts?: Options): Result; diff --git a/types/chardet/tsconfig.json b/types/chardet/tsconfig.json new file mode 100644 index 0000000000..6215a6303f --- /dev/null +++ b/types/chardet/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "chardet-tests.ts" + ] +} diff --git a/types/chardet/tslint.json b/types/chardet/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/chardet/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From a0cde9ffe04ad456a1b63c8c06411defb116bc20 Mon Sep 17 00:00:00 2001 From: Dan Homola Date: Fri, 27 Apr 2018 00:29:38 +0200 Subject: [PATCH 0922/2153] fix(intl-tel-input): update name and type of placeholderNumberType (#25191) Fixes #24734 --- types/intl-tel-input/index.d.ts | 23 +++++++++++++++----- types/intl-tel-input/intl-tel-input-tests.ts | 4 ++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/types/intl-tel-input/index.d.ts b/types/intl-tel-input/index.d.ts index b0a6bf5721..34493a8b75 100644 --- a/types/intl-tel-input/index.d.ts +++ b/types/intl-tel-input/index.d.ts @@ -171,16 +171,27 @@ declare namespace IntlTelInput { * that way as it provides a better experience for the user. */ nationalMode?: boolean; - /** - * Specify one of the keys from the global enum intlTelInputUtils.numberType - * e.g. "FIXED_LINE" to tell the plugin you're expecting that type of number. - * Currently this is only used to set the placeholder to the right type of number. - */ - numberType?: string; /** * Display only the countries you specify. */ onlyCountries?: Array; + /** + * Specify one of the keys from the global enum intlTelInputUtils.numberType + * e.g. "FIXED_LINE" to set the number type to use for the placeholder. + */ + placeholderNumberType?: + | "FIXED_LINE_OR_MOBILE" + | "FIXED_LINE" + | "MOBILE" + | "PAGER" + | "PERSONAL_NUMBER" + | "PREMIUM_RATE" + | "SHARED_COST" + | "TOLL_FREE" + | "UAN" + | "UNKNOWN" + | "VOICEMAIL" + | "VOIP"; /** * Specify the countries to appear at the top of the list. */ diff --git a/types/intl-tel-input/intl-tel-input-tests.ts b/types/intl-tel-input/intl-tel-input-tests.ts index 0d23c40d75..e91a5deef1 100644 --- a/types/intl-tel-input/intl-tel-input-tests.ts +++ b/types/intl-tel-input/intl-tel-input-tests.ts @@ -6,6 +6,10 @@ $('#phone').intlTelInput({ } }); +$('#phone').intlTelInput({ + placeholderNumberType: "MOBILE", +}); + $('#phone').intlTelInput({ geoIpLookup: function(callback) { $.get('http://ipinfo.io', function() {}, 'jsonp').always(function(resp) { From fb4403c4c09dac6d03674e57a34989821b34cb83 Mon Sep 17 00:00:00 2001 From: Nikita Litvin Date: Fri, 27 Apr 2018 01:30:08 +0300 Subject: [PATCH 0923/2153] parse-git-config: add `promise` method in version 2.0 (#25143) Implementation: https://github.com/jonschlinkert/parse-git-config/blob/a2a1ba179a115478f44938638e5d37ea33ae6632/index.js#L64 --- types/parse-git-config/index.d.ts | 15 ++++++++- .../parse-git-config-tests.ts | 33 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/types/parse-git-config/index.d.ts b/types/parse-git-config/index.d.ts index 4d5897ca5b..b3302106b0 100644 --- a/types/parse-git-config/index.d.ts +++ b/types/parse-git-config/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for parse-git-config 1.1 +// Type definitions for parse-git-config 2.0 // Project: https://github.com/jonschlinkert/parse-git-config // Definitions by: Leonard Thieu +// Nikita Litvin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -18,6 +19,18 @@ interface Parse { * If only the callback is passed, the .git/config file relative to process.cwd() is used. */ (cb: ParseCallback): void; + /** + * Asynchronously parse a .git/config file. Returns a promise. + * Resolves with `null` if unable to resolve path to the git config file. + * If no arguments are passed, the .git/config file relative to process.cwd() is used. + */ + (options?: (Options | object) | string): Promise; + /** + * Asynchronously parse a .git/config file. Returns a promise. + * Resolves with `null` if unable to resolve path to the git config file. + * If no arguments are passed, the .git/config file relative to process.cwd() is used. + */ + promise(options?: (Options | object) | string): Promise; /** * Synchronously parse a .git/config file. * If no arguments are passed, the .git/config file relative to process.cwd() is used. diff --git a/types/parse-git-config/parse-git-config-tests.ts b/types/parse-git-config/parse-git-config-tests.ts index 7afae71a66..c5ce43040a 100644 --- a/types/parse-git-config/parse-git-config-tests.ts +++ b/types/parse-git-config/parse-git-config-tests.ts @@ -39,6 +39,39 @@ function test_parse() { }); } +async function test_promise_options() { + let config = await parse({ cwd: 'foo', path: '.git/config' }); + config = await parse.promise({ cwd: 'foo', path: '.git/config' }); + if (!config) return null; + + const origin = config['remote "origin"']; + if (origin && origin.url) { + origin.url.split('/'); + } +} + +async function test_promise_cwd() { + let config = await parse('foo'); + config = await parse.promise('foo'); + if (!config) return null; + + const origin = config['remote "origin"']; + if (origin && origin.url) { + origin.url.split('/'); + } +} + +async function test_promise() { + let config = await parse(); + config = await parse.promise(); + if (!config) return null; + + const origin = config['remote "origin"']; + if (origin && origin.url) { + origin.url.split('/'); + } +} + function test_sync_options() { const config = parse.sync({ cwd: 'foo', path: '.git/config' }); From f296324f1a833a002f45fe4041fde84e41d4f6a4 Mon Sep 17 00:00:00 2001 From: Suntharesan Mohan Date: Thu, 26 Apr 2018 18:37:29 -0400 Subject: [PATCH 0924/2153] [convict] - Add generic type (#25154) * [convict] - add generic type * Add Typescript version --- types/convict/convict-tests.ts | 206 +++++++++++++++++++-------------- types/convict/index.d.ts | 100 ++++++++++++---- types/convict/tslint.json | 3 +- 3 files changed, 199 insertions(+), 110 deletions(-) diff --git a/types/convict/convict-tests.ts b/types/convict/convict-tests.ts index 98a107d8e8..de35b17578 100644 --- a/types/convict/convict-tests.ts +++ b/types/convict/convict-tests.ts @@ -1,108 +1,122 @@ -import convict = require('convict'); -import validator = require('validator'); +import * as convict from 'convict'; +import * as validator from 'validator'; +import { safeLoad } from 'js-yaml'; // define a schema // straight from the convict tests const format: convict.Format = { - name: 'float-percent', - validate(val) { - if (val !== 0 && (!val || val > 1 || val < 0)) { - throw new Error('must be a float between 0 and 1, inclusive'); + name: 'float-percent', + validate(val) { + if (val !== 0 && (!val || val > 1 || val < 0)) { + throw new Error('must be a float between 0 and 1, inclusive'); + } + }, + coerce(val) { + return parseFloat(val); } - }, - coerce(val) { - return parseFloat(val); - } }; convict.addFormat(format); convict.addFormats({ - prime: { - validate(val) { - function isPrime(n: number) { - if (n <= 1) return false; // zero and one are not prime - for (let i = 2; i * i <= n; i++) { - if (n % i === 0) return false; + prime: { + validate(val) { + function isPrime(n: number) { + if (n <= 1) return false; // zero and one are not prime + for (let i = 2; i * i <= n; i++) { + if (n % i === 0) return false; + } + return true; + } + if (!isPrime(val)) throw new Error('must be a prime number'); + }, + coerce(val) { + return parseInt(val, 10); } - return true; - } - if (!isPrime(val)) throw new Error('must be a prime number'); - }, - coerce(val) { - return parseInt(val, 10); } - } }); +convict.addParser({ extension: 'json', parse: JSON.parse }); +convict.addParser([ + { extension: 'json', parse: JSON.parse }, + { extension: ['yml', 'yaml'], parse: safeLoad } +]); + const conf = convict({ - env: { - doc: 'The applicaton environment.', - format: ['production', 'development', 'test'], - default: 'development', - env: 'NODE_ENV', - arg: 'node-env', - }, - ip: { - doc: 'The IP address to bind.', - format: 'ipaddress', - default: '127.0.0.1', - env: 'IP_ADDRESS', - }, - port: { - doc: 'The port to bind.', - format: 'port', - default: 0, - env: 'PORT', - arg: 'port', - }, - key: { - doc: "API key", - format: (val: string) => { - if (!validator.isUUID(val)) { - throw new Error('must be a valid UUID'); - } + env: { + doc: 'The applicaton environment.', + format: ['production', 'development', 'test'], + default: 'development', + env: 'NODE_ENV', + arg: 'node-env', }, - default: '01527E56-8431-11E4-AF91-47B661C210CA' - }, - db: { ip: { - doc: 'The IP address to bind.', - format: 'ipaddress', - default: '127.0.0.1', - env: 'IP_ADDRESS', + doc: 'The IP address to bind.', + format: 'ipaddress', + default: '127.0.0.1', + env: 'IP_ADDRESS', }, port: { - doc: 'The port to bind.', - format: 'port', - default: 0, - env: 'PORT', - arg: 'port', + doc: 'The port to bind.', + format: 'port', + default: 0, + env: 'PORT', + arg: 'port', }, - password: { - doc: 'The database password.', - default: 'secret', - format: String, - sensitive: true, + key: { + doc: "API key", + format: (val: string) => { + if (!validator.isUUID(val)) { + throw new Error('must be a valid UUID'); + } + }, + default: '01527E56-8431-11E4-AF91-47B661C210CA' + }, + db: { + ip: { + doc: 'The IP address to bind.', + format: 'ipaddress', + default: '127.0.0.1', + env: 'IP_ADDRESS', + }, + port: { + doc: 'The port to bind.', + format: 'port', + default: 0, + env: 'PORT', + arg: 'port', + }, + password: { + doc: 'The database password.', + default: 'secret', + format: String, + sensitive: true, + }, + }, + primeNumber: { + format: 'prime', + default: 17 + }, + percentNumber: { + format: 'float-percent', + default: 0.5 }, - }, - primeNumber: { - format: 'prime', - default: 17 - }, - percentNumber: { - format: 'float-percent', - default: 0.5 - }, }); // load environment dependent configuration +interface LoadType { + primeNumber: number; + isPrime: boolean; +} + const env = conf.get('env'); -const dbip = conf.get('db.ip'); conf.loadFile(`./config/${env}.json`); conf.loadFile(['./configs/always.json', './configs/sometimes.json']); +// tslint:disable-next-line:no-invalid-template-strings +conf.loadFile('./config/${env}.yaml'); + // perform validation conf.validate({ strict: true }); @@ -112,25 +126,39 @@ conf.validate({ allowed: 'warn' }); // Chaining conf - .loadFile(['./configs/always.json', './configs/sometimes.json']) - .loadFile(`./config/${env}.json`) - .load({ jsonKey: 'jsonValue' }) - .set('key', 'value') - .validate({ allowed: 'warn' }) - .toString(); + .loadFile(['./configs/always.json', './configs/sometimes.json']) + .loadFile<{ envVar: any }>(`./config/${env}.json`) + .load({ jsonKey: 'jsonValue' }) + .set('key', 'value') + .validate({ allowed: 'warn' }) + .toString(); -const port: number = conf.default('port'); +const port = conf.default('port'); if (conf.has('key')) { - conf.set('the.awesome', true); - conf.load({ - thing: { - a: 'b' - } - }); + conf.set('the.awesome', true); + conf.load({ + thing: { + a: 'b' + } + }); } +conf.has('unknow.key'); +conf.has<'db', 'ip'>('db.ip'); + +const schema = conf.getSchema(); + +const schemaVal = conf.getSchema().properties.db.properties.port.default; + conf.get(); +conf.get('unknownkey'); +conf.get('db'); +conf.get('db.ip'); +conf.get<'db', 'ip'>('db.ip'); +conf.default('env'); +conf.default('db.ip'); +conf.default<'db', 'ip'>('db.ip'); conf.getSchema(); conf.getProperties(); conf.getSchemaString(); diff --git a/types/convict/index.d.ts b/types/convict/index.d.ts index 544cb9b3f3..2c3dbf0547 100644 --- a/types/convict/index.d.ts +++ b/types/convict/index.d.ts @@ -1,11 +1,16 @@ -// Type definitions for convict 4.1 +// Type definitions for convict 4.2 // Project: https://github.com/mozilla/node-convict // Definitions by: Wim Looman // Vesa Poikajärvi // Eli Young +// Suntharesan Mohan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 declare namespace convict { + // Taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-307871458 + type Overwrite = { [P in Exclude]: T[P] } & U; + type ValidationMethod = 'strict' | 'warn'; interface ValidateOptions { @@ -27,8 +32,13 @@ declare namespace convict { coerce?(val: any): any; } - interface SchemaObj { - default: any; + interface Parser { + extension: string | string[]; + parse: (content: string) => any; + } + + interface SchemaObj { + default: T; doc?: string; /** * From the implementation: @@ -48,57 +58,105 @@ declare namespace convict { sensitive?: boolean; } - interface Schema { - [name: string]: Schema | SchemaObj; + type Schema = { + [P in keyof T]: Schema | SchemaObj; + }; + + interface InternalSchema { + properties: { + [K in keyof T]: T[K] extends object ? InternalSchema : { default: T[K] } + }; } - interface InternalSchema { - properties: Schema; - } - - interface Config { + interface Config { /** * @returns the current value of the name property. name can use dot * notation to reference nested values */ - get(name?: string): any; + get(name?: K): + K extends null | undefined ? T : + K extends keyof T ? T[K] : + any; + get(name: string): T[K][K2]; + get(name: K): T[K][K2][K3]; + get< + K extends keyof T, + K2 extends keyof T[K], + K3 extends keyof T[K][K2], + K4 extends keyof T[K][K2][K3] + >(name: string): T[K][K2][K3][K4]; /** * @returns the default value of the name property. name can use dot * notation to reference nested values */ - default(name: string): any; + default(name?: K): + K extends keyof T ? T[K] : + K extends null | undefined ? T : + any; + default(name?: K): T[K]; + default(name: string): T[K][K2]; + default(name: K): T[K][K2][K3]; + default< + K extends keyof T, + K2 extends keyof T[K], + K3 extends keyof T[K][K2], + K4 extends keyof T[K][K2][K3] + >(name: string): T[K][K2][K3][K4]; /** * @returns true if the property name is defined, or false otherwise */ - has(name: string): boolean; + has(name: K): boolean; + has(name: string): boolean; + has(name: K): boolean; + has< + K extends keyof T, + K2 extends keyof T[K], + K3 extends keyof T[K][K2], + K4 extends keyof T[K][K2][K3] + >(name: string): boolean; /** * Sets the value of name to value. name can use dot notation to reference * nested values, e.g. "database.port". If objects in the chain don't yet * exist, they will be initialized to empty objects */ - set(name: string, value: any): Config; + set(name: K, value: K extends keyof T ? T[K] : any): Config; + set< + K extends keyof T, + K2 extends keyof T[K] | string + >(name: K, value: K2 extends keyof T[K] ? T[K][K2] : any): Config; + set< + K extends keyof T, + K2 extends keyof T[K], + K3 extends keyof T[K][K2] | string + >(name: K, value: K3 extends keyof T[K][K2] ? T[K][K2][K3] : any): Config; + set< + K extends keyof T, + K2 extends keyof T[K], + K3 extends keyof T[K][K2], + K4 extends keyof T[K][K2][K3] | string + >(name: K, value: K4 extends keyof T[K][K2][K3] ? T[K][K2][K3][K4] : any): Config; /** * Loads and merges a JavaScript object into config */ - load(conf: Object): Config; + load(conf: U): Config>; /** * Loads and merges JSON configuration file(s) into config */ - loadFile(files: string | string[]): Config; + loadFile(files: string | string[]): Config>; /** * Validates config against the schema used to initialize it */ - validate(options?: ValidateOptions): Config; + validate(options?: ValidateOptions): Config; /** * Exports all the properties (that is the keys and their current values) as a {JSON} {Object} * @returns A {JSON} compliant {Object} */ - getProperties(): Object; + getProperties(): T; /** * Exports the schema as a {JSON} {Object} * @returns A {JSON} compliant {Object} */ - getSchema(): InternalSchema; + getSchema(): InternalSchema; /** * Exports all the properties (that is the keys and their current values) as a JSON string. @@ -113,10 +171,12 @@ declare namespace convict { getSchemaString(): string; } } + interface convict { addFormat(format: convict.Format): void; addFormats(formats: { [name: string]: convict.Format }): void; - (config: convict.Schema | string): convict.Config; + addParser(parsers: convict.Parser | convict.Parser[]): void; + (config: convict.Schema | string): convict.Config; } declare var convict: convict; export = convict; diff --git a/types/convict/tslint.json b/types/convict/tslint.json index 09f94cd344..3d215ace77 100644 --- a/types/convict/tslint.json +++ b/types/convict/tslint.json @@ -2,6 +2,7 @@ "extends": "dtslint/dt.json", "rules": { // ban-types needs to be disabled to support TypeScript <2.2 - "ban-types": false + "ban-types": false, + "no-unnecessary-generics": false } } From 986dd3b4124a7eff891461f9376192e2c7d39e71 Mon Sep 17 00:00:00 2001 From: denisname Date: Fri, 27 Apr 2018 00:38:30 +0200 Subject: [PATCH 0925/2153] Select2 Better typing for v4 (#25196) * select2 v4 * ts-lint --- types/select2/index.d.ts | 361 ++++++------ types/select2/select2-tests.ts | 992 +++++++++++++++++++++++++-------- types/select2/tsconfig.json | 2 +- types/select2/tslint.json | 3 +- 4 files changed, 962 insertions(+), 396 deletions(-) diff --git a/types/select2/index.d.ts b/types/select2/index.d.ts index 244840f76e..6a7d7c6aaf 100644 --- a/types/select2/index.d.ts +++ b/types/select2/index.d.ts @@ -1,215 +1,242 @@ // Type definitions for Select2 4.0 // Project: http://ivaynberg.github.com/select2/ // Definitions by: Boris Yankov +// denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 /// -interface Select2QueryOptions { +export as namespace Select2; + +// -------------------------------------------------------------------------- +// Some Interfaces +// -------------------------------------------------------------------------- + +export interface Select2 { + $container: JQuery; + $dropdown: JQuery; + $selection: JQuery; + $results: JQuery; + dropdown: any; + id: string; + options: { options: Options }; + results: any; + selection: any; +} + +export interface QueryOptions { term?: string; page?: number; - context?: any; - callback?: (result: { results: any; more?: boolean; context?: any; }) => void; } -type AjaxFunction = - (settings: JQueryAjaxSettings, success?: (data: any) => null, failure?: () => null) => JQueryXHR; - -interface Select2AjaxOptions extends JQueryAjaxSettings { - transport?: AjaxFunction; - /** - * Url to make request to, can be string or a function returning a string. - */ - url?: any; - dataType?: string; - delay?: number; - headers?: any; - cache?: boolean; - data?: (params: Select2QueryOptions, page: number, context: any) => any; - results?: (term: any, page: number, context: any) => any; - processResults?: (data: any, params: any) => any; - templateResult?: (data: any) => any; - templateSelection?: (data: any) => any; +export interface SearchOptions { + term: string; } -interface IdTextPair { - id: any; +export interface DataFormat { + id: number | string; text: string; -} - -interface Select2Options { - amdBase?: string; - amdLanguageBase?: string; - width?: string; - dropdownAutoWidth?: boolean; - minimumInputLength?: number; - maximumInputLength?: number; - minimumResultsForSearch?: number; - maximumSelectionLength?: number; - placeholder?: string | IdTextPair; - separator?: string; - allowClear?: boolean; - multiple?: boolean; + selected?: boolean; disabled?: boolean; - closeOnSelect?: boolean; - openOnEnter?: boolean; - id?: (object: any) => string; - matcher?: (term: string, text: string, option: any) => boolean; - formatSelection?: (object: any, container: JQuery, escapeMarkup: (markup: string) => string) => string; - formatResult?: (object: any, container: JQuery, query: any, escapeMarkup: (markup: string) => string) => string; - formatResultCssClass?: (object: any) => string; - formatNoMatches?: (term: string) => string; - formatSearching?: () => string; - formatInputTooShort?: (term: string, minLength: number) => string; - formatSelectionTooBig?: (maxSize: number) => string; - formatLoadMore?: (pageNumber: number) => string; - initSelection?: (element: JQuery, callback: (data: any) => void) => void; - tokenizer?: (input: string, selection: any[], selectCallback: () => void, options: Select2Options) => string; - tokenSeparators?: string[]; - query?: (options: Select2QueryOptions) => void; - ajax?: Select2AjaxOptions; - data?: any; - tags?: any; - createTag?: any; - containerCss?: any; - containerCssClass?: any; - dropdownCss?: any; - dropdownCssClass?: any; - escapeMarkup?: (markup: string) => string; - theme?: string; - /** - * Template can return both plain string that will be HTML escaped and a jquery object that can render HTML - */ - templateSelection?: (object: Select2SelectionObject, container: JQuery) => any; - templateResult?: (object: Select2SelectionObject) => any; - language?: string | string[] | {}; - selectOnClose?: boolean; - sorter?: (data: any[]) => any[]; - dropdownParent?: JQuery; - debug?: boolean; - dropdownAdapter?: any; - selectionAdapter?: any; - resultsAdapter?: any; - dataAdapter?: any; } -interface Select2JQueryEventObject extends JQueryEventObject { - val: any; - added: any; - removed: any; - choice: { - id: any; - text: string; - }; +export interface GroupedDataFormat { + text: string; + children?: DataFormat[]; + + id?: undefined; } -interface Select2SelectionObject { +export interface ProcessedResult { + results: Result[]; + pagination?: {more: boolean}; +} + +export interface LoadingData { loading: boolean; + text: string; + + id?: undefined; + element?: undefined; +} + +export interface OptGroupData { + children: OptionData[]; + disabled: boolean; + element: HTMLOptGroupElement; + selected: boolean; + text: string; + title: string; + + loading?: undefined; +} + +export interface OptionData { disabled: boolean; element: HTMLOptionElement; id: string; selected: boolean; text: string; title: string; + + loading?: undefined; + children?: undefined; } -interface Select2Plugin { - amd: any; +export interface IdTextPair { + id: string; + text: string; - (): JQuery; - (it: IdTextPair): JQuery; + loading?: undefined; + element?: undefined; +} + +export interface TranslationArg { + input: string; + minimum: number; + maximum: number; +} + +export interface Translation { + errorLoading?: () => string; + inputTooLong?: (arg: TranslationArg) => string; + inputTooShort?: (arg: TranslationArg) => string; + loadingMore?: () => string; + maximumSelected?: (arg: TranslationArg) => string; + noResults?: () => string; + searching?: () => string; +} + +export interface DataParams { + data: OptionData; // TODO: must be data source + originalEvent: JQuery.Event; +} + +export interface IngParams { + name: "select" | "open" | "close" | "unselect"; + prevented: boolean; +} + +export interface Event extends JQuery.Event { + params: T; +} + +export interface Trigger { + type: "select2:select"; + params: { + data: IdTextPair; + }; +} + +// -------------------------------------------------------------------------- +// Ajax Option +// -------------------------------------------------------------------------- + +export interface AjaxOptions extends JQuery.Ajax.AjaxSettingsBase { + delay?: number; + url?: string | ((params: QueryOptions) => string); + data?: (params: QueryOptions) => JQuery.PlainObject; + transport?: (settings: JQueryAjaxSettings, success?: (data: RemoteResult) => undefined, failure?: () => undefined) => void; + processResults?: (data: RemoteResult, params: QueryOptions) => ProcessedResult; +} + +// -------------------------------------------------------------------------- +// Options +// -------------------------------------------------------------------------- + +export interface Options { + ajax?: AjaxOptions; + allowClear?: boolean; + amdBase?: string; + amdLanguageBase?: string; + closeOnSelect?: boolean; + containerCss?: any; + containerCssClass?: string; + data?: DataFormat[] | GroupedDataFormat[]; + dataAdapter?: any; + debug?: boolean; + dir?: "ltr" | "rtl"; + disabled?: boolean; + dropdownAdapter?: any; + dropdownAutoWidth?: boolean; + dropdownCss?: any; + dropdownCssClass?: string; + dropdownParent?: JQuery; + escapeMarkup?: (markup: string) => string; + initSelection?: (element: JQuery, callback: (data: any) => void) => void; + language?: string | Translation; + matcher?: (params: SearchOptions, data: OptGroupData | OptionData) => OptGroupData | OptionData | null; + maximumInputLength?: number; + maximumSelectionLength?: number; + minimumInputLength?: number; + minimumResultsForSearch?: number; + multiple?: boolean; + placeholder?: string | IdTextPair; + resultsAdapter?: any; + selectionAdapter?: any; + selectOnClose?: boolean; + sorter?: (data: Array) => Array; + tags?: boolean; + templateResult?: (result: LoadingData | Result) => string | JQuery | null; + templateSelection?: (selection: IdTextPair | LoadingData | Result) => string | JQuery; + theme?: string; + tokenizer?: (input: string, selection: any[], selectCallback: () => void, options: Options) => string; + tokenSeparators?: string[]; + width?: string; + + // Not in https://select2.org/configuration/options-api + createTag?: (params: SearchOptions) => IdTextPair | null; + insertTag?: (data: Array, tag: IdTextPair) => void; +} + +// -------------------------------------------------------------------------- +// jQuery And Select2 Plugin +// -------------------------------------------------------------------------- + +export interface Select2Plugin { + defaults: { + set: (key: string, value: any) => void; + reset: () => void; + }; + + (): JQuery; + // tslint:disable-next-line:no-unnecessary-generics + (options: Options): JQuery; - /** - * Get the id value of the current selection - */ - (method: 'val'): any; - /** - * Set the id value of the current selection - * @params value Value to set the id to - * @params triggerChange Should a change event be triggered - */ - (method: 'val', value: any, triggerChange?: boolean): any; /** * Get the data object of the current selection */ - (method: 'data'): any; - /** - * Set the data of the current selection - * @params value Object to set the data to - * @params triggerChange Should a change event be triggered - */ - (method: 'data', value: any, triggerChange?: boolean): any; + (method: "data"): OptionData[]; /** * Reverts changes to DOM done by Select2. Any selection done via Select2 will be preserved. */ - (method: 'destroy'): JQuery; + (method: "destroy"): JQuery; /** * Opens the dropdown */ - (method: 'open'): JQuery; + (method: "open"): JQuery; /** * Closes the dropdown */ - (method: 'close'): JQuery; - /** - * Enables or disables Select2 and its underlying form component - * @param value True if it should be enabled false if it should be disabled - */ - (method: 'enable', value: boolean): JQuery; - /** - * Toggles readonly mode on Select2 and its underlying form component - * @param value True if it should be readonly false if it should be read write - */ - (method: 'readonly', value: boolean): JQuery; - /** - * Retrieves the main container element that wraps all of DOM added by Select2 - */ - (method: 'container'): JQuery; - /** - * Notifies Select2 that a drag and drop sorting operation has started - */ - (method: 'onSortStart'): JQuery; - /** - * Notifies Select2 that a drag and drop sorting operation has finished - */ - (method: 'onSortEnd'): JQuery; - - (method: string): any; - (method: string, value: any, trigger?: boolean): any; - (options: Select2Options): JQuery; + (method: "close"): JQuery; } -interface JQuery { - select2: Select2Plugin; - off(events?: "change", selector?: any, handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; +declare global { + interface JQuery { + select2: Select2Plugin; + data(key: "select2"): Select2; - on(events: "change", selector?: string, data?: any, handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "change", selector?: string, handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "change", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2:closing", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2:close", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2:opening", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2:open", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2:selecting", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2:select", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2:unselecting", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2:unselect", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; -} + trigger(events: Trigger): void; -declare class Select2 { - constructor(element: JQuery, options: Select2Options); - focus(): void; - destroy(): void; - // TODO: Don't use 'Function' as a type. - // tslint:disable-next-line:ban-types - on(event: string, callback: Function): void; - selection: any; - dropdown: any; - results: any; - $container: JQuery; - $dropdown: JQuery; - $selection: JQuery; - $results: JQuery; - options: { options: Select2Options }; + // TODO: events "change" and "change.select2" + on(events: "select2:closing", handler?: JQuery.EventHandlerBase>): this; + on(events: "select2:close", handler?: JQuery.EventHandlerBase>): this; + on(events: "select2:opening", handler?: JQuery.EventHandlerBase>): this; + on(events: "select2:open", handler?: JQuery.EventHandlerBase>): this; + on(events: "select2:selecting", handler?: JQuery.EventHandlerBase>): this; + on(events: "select2:select", handler?: JQuery.EventHandlerBase>): this; + on(events: "select2:unselecting", handler?: JQuery.EventHandlerBase>): this; + on(events: "select2:unselect", handler?: JQuery.EventHandlerBase>): this; + } } diff --git a/types/select2/select2-tests.ts b/types/select2/select2-tests.ts index 0a5458063a..7da04a1be5 100644 --- a/types/select2/select2-tests.ts +++ b/types/select2/select2-tests.ts @@ -1,238 +1,776 @@ -$("#e9").select2(); -$("#e2").select2({ - placeholder: "Select a State", +// ===================================================== +// Configuration -- Global defaults +// ===================================================== +// See: https://select2.org/configuration/defaults + +$.fn.select2.defaults.set("theme", "classic"); +$.fn.select2.defaults.set("ajax--cache", false); +$.fn.select2.defaults.reset(); + +// ===================================================== +// Appearance +// ===================================================== +// See: https://select2.org/appearance + +$(".js-example-responsive").select2({ + width: "resolve" +}); + +$(".js-example-theme-single").select2({ + theme: "classic" +}); + +// ===================================================== +// Data sources -- The Select2 data format +// ===================================================== +// See: https://select2.org/data-sources/formats + +let dataFormat: Select2.DataFormat[]; +let groupedDataFormat: Select2.GroupedDataFormat[]; + +dataFormat = [ + {id: 1, text: "Option 1"}, + {id: 2, text: "Option 2"}, +]; + +dataFormat = [ + {id: 1, text: "Option 1"}, + {id: 2, text: "Option 2", selected: true}, + {id: 3, text: "Option 3", disabled: true}, +]; + +groupedDataFormat = [ + { + text: "Group 1", + children : [ + {id: 1, text: "Option 1.1"}, + {id: 2, text: "Option 1.2"}, + ] + }, + { + text: "Group 2", + children : [ + {id: 3, text: "Option 2.1"}, + {id: 4, text: "Option 2.2"}, + ] + } +]; + +// ===================================================== +// Data sources -- Ajax (remote data) +// ===================================================== +// See: https://select2.org/data-sources/ajax + +// Request parameters + +$("#mySelect2").select2({ + ajax: { + url: "https://api.github.com/orgs/select2/repos", + data: (params) => { + return { + search: params.term, + type: "public" + }; + } + } +}); + +// Transforming response data + +interface ServerResult { + items: Select2.DataFormat[]; +} + +$("#mySelect2").select2({ + ajax: { + url: "/example/api", + processResults: (data: ServerResult) => { + return { + results: data.items + }; + } + } +}); + +// Pagination + +$("#mySelect2").select2({ + ajax: { + url: "https://api.github.com/search/repositories", + data: (params) => { + return { + search: params.term, + page: params.page || 1 + }; + } + } +}); + +interface ServerPaginatedResult { + results: Select2.DataFormat[]; + count_filtered: number; +} + +$("#mySelect2").select2({ + ajax: { + url: "/example/api", + processResults: (data: ServerPaginatedResult, params) => { + params.page = params.page || 1; + return { + results: data.results, + pagination: { + more: (params.page * 10) < data.count_filtered + } + }; + } + } +}); + +// Rate-limiting requests + +$("#mySelect2").select2({ + ajax: { + delay: 250 + } +}); + +// Dynamic URLs + +$("#mySelect2").select2({ + ajax: { + url: (params) => { + return "/some/url/" + params.term; + } + } +}); + +// Alternative transport methods + +declare let AjaxSettings2RequestInit: (s: JQueryAjaxSettings) => RequestInit; + +$("#mySelect2").select2({ + ajax: { + transport: (params: JQueryAjaxSettings, success?: (data: any) => undefined, failure?: () => undefined) => { + const p = AjaxSettings2RequestInit(params); + fetch(params.url!, p) + .then(success) + .catch(failure); + } + } +}); + +// Additional examples + +interface GithubApiResult { + total_count: number; + incomplete_results: boolean; + items: GithubRepositories[]; +} + +interface GithubRepositories { + id: string; + name: string; + full_name: string; + owner: { + avatar_url: string + gravatar_id: string + }; + description?: string; + stargazers_count: number; + watchers_count: number; + forks_count: number; + + loading: undefined; +} + +$(".js-example-data-ajax").select2({ + ajax: { + url: "https://api.github.com/search/repositories", + dataType: "json", + delay: 250, + data: (params: Select2.QueryOptions) => { + return { + q: params.term, + page: params.page + }; + }, + processResults: (data: GithubApiResult, params: Select2.QueryOptions) => { + params.page = params.page || 1; + + return { + results: data.items, + pagination: { + more: (params.page * data.items.length) < data.total_count + } + }; + }, + cache: true + }, + placeholder: "Search for a repository", + escapeMarkup: (markup: string) => markup, + minimumInputLength: 1, + templateResult: formatRepo, + templateSelection: formatRepoSelection +}); + +function formatRepo(obj: Select2.LoadingData | GithubRepositories) { + if (obj.loading) { + return obj.text; + } + + const repo = obj as GithubRepositories; + + let markup = '
' + + `
` + + '
' + + `
${repo.full_name}
`; + + if (repo.description) { + markup += `
${repo.description}
`; + } + + markup += '
' + + `
${repo.forks_count} Forks
` + + `
${repo.stargazers_count} Stars
` + + `
${repo.watchers_count} Watchers
` + + "
" + + "
"; + + return markup; +} + +function formatRepoSelection(repo: Select2.IdTextPair | Select2.LoadingData | GithubRepositories) { + return (repo as GithubRepositories).full_name || + (repo as Select2.IdTextPair | Select2.LoadingData).text; +} + +// ===================================================== +// Data sources -- Ajax (remote data) +// ===================================================== +// See: https://select2.org/data-sources/ajax + +$(".js-example-data-array").select2({ + data: dataFormat +}); + +$(".js-example-data-array").select2({ + data: groupedDataFormat +}); + +// ===================================================== +// Dropdown +// ===================================================== +// See: https://select2.org/dropdown + +// Templating + +function formatState(state: Select2.LoadingData | Select2.OptionData) { + const opt = state as Select2.OptionData; + if (!opt.id) { + return (state as Select2.LoadingData).text; + } + const baseUrl = "/user/pages/images/flags"; + const $state = $( + ` ${opt.text}` + ); + return $state; +} + +$(".js-example-templating").select2({ + templateResult: formatState +}); + +// Automatic selection + +$("#mySelect2").select2({ + selectOnClose: true +}); + +// Forcing the dropdown to remain open after selection + +$("#mySelect2").select2({ + closeOnSelect: false +}); + +// Dropdown placement + +$("#mySelect2").select2({ + dropdownParent: $("#myModal") +}); + +// ===================================================== +// Selections +// ===================================================== +// See: https://select2.org/selections + +// Limiting the number of selections + +$(".js-example-basic-multiple-limit").select2({ + maximumSelectionLength: 2 +}); + +// Clearable selections + +$("select").select2({ + placeholder: "This is my placeholder", allowClear: true }); -$("#e2_2").select2({ - placeholder: "Select a State" -}); -$("#e2_3").select2({ - placeholder: { id: "1", text: "Select options" } -}); -$("#e3").select2({ - minimumInputLength: 2 -}); -function format(state: any) { - if (!state.id) return state.text; - return `` + state.text; -} -$("#e4").select2({ - formatResult: format, - formatSelection: format -}); -$("#e5").select2({ - minimumInputLength: 1, - query(query) { - const data = { results: [] as IdTextPair[] }; - for (let i = 1; i < 5; i++) { - let s = ""; - for (let j = 0; j < i; j++) { s = s + query.term; } - data.results.push({ id: query.term + i, text: s }); - } - } + +// ===================================================== +// Dynamic option creation +// ===================================================== +// See: https://select2.org/tagging + +$(".js-example-tags").select2({ + tags: true }); -$("#e19").select2({ maximumSelectionLength: 3 }); -$("#e10").select2({ - data: [{ id: 0, text: 'enhancement' }, { id: 1, text: 'bug' }, { id: 2, text: 'duplicate' }, { id: 3, text: 'invalid' }, { id: 4, text: 'wontfix' }] -}); +// Automatic tokenization into tags -const data = [{ id: 0, tag: 'enhancement' }, { id: 1, tag: 'bug' }, { id: 2, tag: 'duplicate' }, { id: 3, tag: 'invalid' }, { id: 4, tag: 'wontfix' }]; - -$("#e10_2").select2({ - data: { results: data, text: 'tag' }, - formatSelection: format, - formatResult: format -}); - -$("#e10_3").select2({ - data: { - results: data, - text: (item: {tag: string}) => { - console.log('called with', item); - return item.tag; - }}, - formatSelection: format, - formatResult: format -}); - -let movieFormatResult; -let movieFormatSelection; -$("#e6").select2({ - placeholder: "Search for a movie", - minimumInputLength: 1, - ajax: { - url: "http://api.rottentomatoes.com/api/public/v1.0/movies.json", - dataType: 'jsonp', - cache: false, - data(params, page) { - return { - q: params.term, - page_limit: 10, - apikey: "ju6z9mjyajq2djue3gbvv26t" - }; - }, - results(data, page) { - return { results: data.movies }; - } - }, - formatResult: movieFormatResult, - formatSelection: movieFormatSelection, - dropdownCssClass: "bigdrop" -}); - -let t: ArrayLike; -$("#e6").select2({ - placeholder: "Search for a movie", - minimumInputLength: 1, - ajax: { - url: () => "http://api.rottentomatoes.com/api/public/v1.0/movies.json", - dataType: 'jsonp', - data(params, page) { - return { - q: params.term, - page_limit: 10, - apikey: "ju6z9mjyajq2djue3gbvv26t" - }; - }, - results(data, page) { - return { results: data.movies }; - } - }, - formatResult: movieFormatResult, - formatSelection: movieFormatSelection, - dropdownCssClass: "bigdrop" -}); -$("#e6").select2({ - placeholder: "Search for a movie", - minimumInputLength: 1, - ajax: { - url: "http://api.rottentomatoes.com/api/public/v1.0/movies.json", - type: 'GET', - dataType: 'jsonp', - cache: false, - data(params, page) { - return { - q: params.term, - page_limit: 10, - apikey: "ju6z9mjyajq2djue3gbvv26t" - }; - }, - results(data, page) { - return { results: data.movies }; - } - }, - formatResult: movieFormatResult, - formatSelection: movieFormatSelection, - dropdownCssClass: "bigdrop" -}); -$("#e7").select2({ - placeholder: "Search for a movie", - minimumInputLength: 3, - ajax: { - url: "http://api.rottentomatoes.com/api/public/v1.0/movies.json", - dataType: 'jsonp', - delay: 100, - data(params, aPage) { - return { - q: params.term, - page_limit: 10, - page: aPage, - apikey: "ju6z9mjyajq2djue3gbvv26t" - }; - }, - results(data, page) { - const moreValue = (page * 10) < data.total; - return { results: data.movies, more: moreValue }; - } - }, - formatResult: movieFormatResult, - formatSelection: movieFormatSelection, - dropdownCssClass: "bigdrop" -}); - -function sort(elements: any) { - return elements.sort(); -} -$("#e20").select2({ - sorter: sort -}); - -$("#e8").select2(); -$("#e8_get").click(() => alert("Selected value is: " + $("#e8").select2("val"))); -$("#e8_set").click(() => $("#e8").select2("val", "CA")); -$("#e8_cl").click(() => $("#e8").select2("val", "")); -$("#e8_get2").click(() => alert("Selected data is: " + JSON.stringify($("#e8").select2("data")))); -$("#e8_set2").click(() => $("#e8").select2("data", { id: "CA", text: "California" })); -$("#e8_open").click(() => $("#e8").select2("open")); -$("#e8_close").click(() => $("#e8").select2("close")); -$("#e8_2").select2(); -$("#e8_2_get").click(() => alert("Selected value is: " + $("#e8_2").select2("val"))); -$("#e8_2_set").click(() => $("#e8_2").select2("val", ["CA", "MA"])); -$("#e8_2_get2").click(() => alert("Selected value is: " + JSON.stringify($("#e8_2").select2("data")))); -$("#e8_2_set2").click(() => $("#e8_2").select2("data", [{ id: "CA", text: "California" }, { id: "MA", text: "Massachusetts" }])); -$("#e8_2_cl").click(() => $("#e8_2").select2("val", "")); -$("#e8_2_open").click(() => $("#e8_2").select2("open")); -$("#e8_2_close").click(() => $("#e8_2").select2("close")); -$("#e11").select2({ - placeholder: "Select report type", - allowClear: true, - data: [{ id: 0, text: 'story' }, { id: 1, text: 'bug' }, { id: 2, text: 'task' }] -}); -$("#e11_2").select2({ - multiple: true, - data: [{ id: 0, text: 'story' }, { id: 1, text: 'bug' }, { id: 2, text: 'task' }] -}); -function log(e: string) { - const item = $(`
  • ${e}
  • `); - $("#events_11").append(item); - item.animate({ opacity: 1 }, 10000, 'linear', () => item.animate({ opacity: 0 }, 2000, 'linear', () => item.remove())); -} -$("#e11") - // TS 0.9.5: correct overload not resolved https://typescript.codeplex.com/discussions/472172 - .on("change", (e: Select2JQueryEventObject) => log(JSON.stringify({ val: e.val, added: e.added, removed: e.removed }))) - .on("open", () => log("open")); -$("#e11_2") - .on("change", (e: Select2JQueryEventObject) => log(JSON.stringify({ val: e.val, added: e.added, removed: e.removed }))) - .on("open", () => log("open")); -$("#e12").select2({ tags: ["red", "green", "blue"] }); -$("#e20").select2({ - tags: ["red", "green", "blue"], +$(".js-example-tokenizer").select2({ + tags: true, tokenSeparators: [",", " "] }); -$("#e13").select2(); -$("#e13_ca").click(() => $("#e13").val("CA").trigger("change")); -$("#e13_ak_co").click(() => $("#e13").val(["AK", "CO"]).trigger("change")); -$("#e14").val(["AL", "AZ"]).select2(); -$("#e14_init").click(() => $("#e14").select2()); -$("#e14_destroy").click(() => $("#e14").select2("destroy")); -$("#e15").select2({ tags: ["red", "green", "blue", "orange", "white", "black", "purple", "cyan", "teal"] }); -$("#e15").on("change", () => $("#e15_val").html($("#e15").val() as string)); -$("#e16").select2(); -$("#e16_2").select2(); -$("#e16_enable").click(() => $("#e16,#e16_2").select2("enable")); -$("#e16_disable").click(() => $("#e16,#e16_2").select2("disable")); -$("#e17").select2({ - matcher: (term, text) => text.toUpperCase().indexOf(term.toUpperCase()) === 0 -}); -$("#e17_2").select2({ - matcher: (term, text, opt) => { - return text.toUpperCase().indexOf(term.toUpperCase()) >= 0 - || opt.attr("alt").toUpperCase().indexOf(term.toUpperCase()) >= 0; +// Customizing tag creation + +$("select").select2({ + tags: true, + createTag: (params) => { + const term = params.term.trim(); + + if (term === "") { + return null; + } + + return { + id: term, + text: term, + newTag: true, // not for select2 use + }; } }); -$("#e18,#e18_2").select2(); -alert("Selected value is: " + $("#e8").select2("val")); $("#e8").select2("val", { id: "CA", text: "Califoria" }); -$("#e8").select2("val"); -$("#e8").select2("val", "CA"); -$("#e8").select2("data"); -$("#e8").select2("data", { id: "CA", text: "Califoria" }); -$("#e8").select2("destroy"); -$("#e8").select2("open"); -$("#e8").select2("enable", false); -$("#e8").select2("readonly", false); -$("#e8").select2('container'); -$("#e8").select2('onSortStart'); -$("#e8").select2('onSortEnd'); +$("select").select2({ + tags: true, + createTag: (params) => { + if (params.term.indexOf("@") === -1) { + return null; + } + + return { + id: params.term, + text: params.term + }; + } +}); + +// Customizing tag placement in the dropdown + +$("select").select2({ + tags: true, + insertTag: (data, tag) => { + data.push(tag); + } +}); + +// ===================================================== +// Placeholders +// ===================================================== +// See: https://select2.org/placeholders + +// Single select placeholders + +$(".js-example-placeholder-single").select2({ + placeholder: "Select a state", + allowClear: true +}); + +// Multi-select placeholders + +$(".js-example-placeholder-multiple").select2({ + placeholder: "Select a state" +}); + +// Default selection placeholders + +$("select").select2({ + placeholder: { + id: "-1", + text: "Select an option" + } +}); + +// Customizing placeholder appearance + +$("select").select2({ + templateSelection: (data: Select2.IdTextPair | Select2.LoadingData | Select2.OptionData) => { + if (data.id === "") { + return "Custom styled placeholder text"; + } + return data.text; + } +}); + +// ===================================================== +// Search +// ===================================================== +// See: https://select2.org/searching + +// Customizing how results are matched + +$(".js-example-matcher").select2({ + matcher: (params, data) => { + if (params.term.trim() === "") { + return data; + } + + if (typeof data.text === "undefined") { + return null; + } + + if (data.text.indexOf(params.term) > -1) { + const modifiedData = {...data}; + modifiedData.text += " (matched)"; + return modifiedData; + } + + return null; + } +}); + +// Matching grouped options + +function matchStart(params: Select2.SearchOptions, data: Select2.OptGroupData | Select2.OptionData) { + if (params.term.trim() === "") { + return data; + } + + if (typeof data.children === "undefined") { + return null; + } + + const filteredChildren: Select2.OptionData[] = []; + data.children.forEach((child, idx) => { + if (child.text.toUpperCase().indexOf(params.term.toUpperCase()) === 0) { + filteredChildren.push(child); + } + }); + + if (filteredChildren.length) { + const modifiedData = {...data}; + modifiedData.children = filteredChildren; + + return modifiedData; + } + + return null; +} + +$(".js-example-matcher-start").select2({ + matcher: matchStart +}); + +// Minimum search term length + +$("select").select2({ + minimumInputLength: 3 +}); + +// Maximum search term length + +$("select").select2({ + maximumInputLength: 20 +}); + +// Limiting display of the search box to large result sets + +$("select").select2({ + minimumResultsForSearch: 20 +}); + +// Hiding the search box + +$("#js-example-basic-hide-search").select2({ + minimumResultsForSearch: Infinity +}); + +$("#js-example-basic-hide-search-multi").select2(); +$("#js-example-basic-hide-search-multi").on("select2:opening select2:closing", function(event) { + const $searchfield = $(this).parent().find(".select2-search__field"); + $searchfield.prop("disabled", true); +}); + +// ===================================================== +// Programmatic control -- Add, select, or clear items +// ===================================================== +// See: https://select2.org/programmatic-control/add-select-clear-items + +// Preselecting options in an remotely-sourced (AJAX) Select2 + +interface StudentAjaxResult { + id: string; + text: string; + full_name: string; +} + +const studentSelect = $("#mySelect2"); +$.ajax({ + type: "GET", + url: "/api/students/s/123" +}).then((res: StudentAjaxResult) => { + const option = new Option(res.full_name, res.id, true, true); + studentSelect.append(option).trigger("change"); + + studentSelect.trigger({ + type: "select2:select", + params: { + data: res + } + }); +}); + +// ===================================================== +// Programmatic control -- Retrieving selections +// ===================================================== +// See: https://select2.org/programmatic-control/retrieving-selections + +// Using the data method + +$("#mySelect2").select2("data"); + +// Using a jQuery selector + +// TODO +// $("#mySelect2").select2({ +// templateSelection: (data) => { +// $(data.element).attr("data-custom-attribute", (data as GithubRepositories).owner.gravatar_id); +// return data.text; +// } +// }); + +// ===================================================== +// Programmatic control -- Methods +// ===================================================== +// See: https://select2.org/programmatic-control/methods + +// Opening the dropdown + +$("#mySelect2").select2("open"); + +// Closing the dropdown + +$("#mySelect2").select2("close"); + +// Destroying the Select2 control + +$("#mySelect2").select2("destroy"); + +// Event unbinding + +$("#example").select2(); + +$("#example").on("select2:select", (e) => { + console.log("select event"); +}); + +$("#example").select2("destroy"); + +$("#example").off("select2:select"); + +// Examples + +const $example = $(".js-example-programmatic").select2(); +const $exampleMulti = $(".js-example-programmatic-multi").select2(); + +$(".js-programmatic-set-val").on("click", () => { + $example.val("CA").trigger("change"); +}); + +$(".js-programmatic-open").on("click", () => { + $example.select2("open"); +}); + +$(".js-programmatic-close").on("click", () => { + $example.select2("close"); +}); + +$(".js-programmatic-init").on("click", () => { + $example.select2(); +}); + +$(".js-programmatic-destroy").on("click", () => { + $example.select2("destroy"); +}); + +$(".js-programmatic-multi-set-val").on("click", () => { + $exampleMulti.val(["CA", "AL"]).trigger("change"); +}); + +$(".js-programmatic-multi-clear").on("click", () => { + $exampleMulti.val([]).trigger("change"); +}); + +// ===================================================== +// Programmatic control -- Events +// ===================================================== +// See: https://select2.org/programmatic-control/events + +// Listening for events + +$("#mySelect2").on("select2:select", (e) => { + // Do something +}); + +// Event data + +$("#mySelect2").on("select2:select", (e) => { + const data = e.params.data; + console.log(data); +}); + +// Triggering events + +const triggerData = { + id: "1", + text: "Tyto alba", + genus: "Tyto", + species: "alba" +}; + +$("#mySelect2").trigger({ + type: "select2:select", + params: { + data: triggerData + } +}); + +// Examples + +const $eventLog = $(".js-event-log"); +const $eventSelect = $(".js-example-events"); + +$eventSelect.select2(); + +$eventSelect.on("select2:open", (e) => { log("select2:open", e); }); +$eventSelect.on("select2:close", (e) => { log("select2:close", e); }); +$eventSelect.on("select2:select", (e) => { log("select2:select", e); }); +$eventSelect.on("select2:unselect", (e) => { log("select2:unselect", e); }); +$eventSelect.on("change", (e) => { log("change"); }); + +function log(name: string, evt?: Select2.Event) { + let args = "{}"; + if (evt) { + args = JSON.stringify(evt.params, (key, value) => { + if (value && value.nodeName) return "[DOM node]"; + if (value instanceof $.Event) return "[$.Event]"; + return value; + }); + } + const $e = $(`
  • ${name} -> ${args}
  • `); + $eventLog.append($e); + $e.animate({ opacity: 1 }, 10000, "linear", () => { + $e.animate({ opacity: 0 }, 2000, "linear", () => { + $e.remove(); + }); + }); +} + +// ===================================================== +// Internationalization +// ===================================================== +// See: https://select2.org/i18n + +// Language files + +$(".js-example-language").select2({ + language: "es" +}); + +// Translation objects + +const fr: Select2.Translation = { + errorLoading: () => { + return "Les résultats ne peuvent pas être chargés."; + }, + inputTooLong: (args) => { + const overChars = args.input.length - args.maximum; + return `Supprimez ${overChars} caractère${overChars > 1 ? "s" : ""}`; + }, + inputTooShort: (args) => { + const remainingChars = args.minimum - args.input.length; + return `Saisissez au moins ${remainingChars} caractère${remainingChars > 1 ? "s" : ""}`; + }, + loadingMore: () => { + return "Chargement de résultats supplémentaires…"; + }, + maximumSelected: (args) => { + return `Vous pouvez seulement sélectionner ${args.maximum}` + + ` élément${args.maximum > 1 ? "s" : ""}`; + }, + noResults: () => { + return "Aucun résultat trouvé"; + }, + searching: () => { + return "Recherche en cours…"; + } +}; + +$(".js-example-language").select2({ + language: { + inputTooShort: () => "You must enter more characters..." + } +}); + +// RTL support + +$(".js-example-rtl").select2({ + dir: "rtl" +}); + +// ===================================================== +// Advanced Features and Developer Guide +// ===================================================== +// See: https://select2.org/advanced + +// TODO (Adapters) + +// ===================================================== +// Others +// ===================================================== +// Code not from the official documentation + +$().data("select2").$container.on("keyup", "input", console.log); + +$(".js-multiple").select2({ + multiple: false, +}); + +$(".js-states").select2({ + sorter: (data) => { + return data.sort((a, b) => a.text > b.text ? 1 : 0); + } +}); + +$("#mySelect2").select2({ + theme: "bootstrap", +}).on("select2:closing", function() { + $(this).val("Bye"); +}).on("select2:close", function() { + $(this).trigger("change"); +}); + +const selectedData: Select2.OptionData[] = $("#mySelect2").select2("data"); +// TODO +// const selectedRepo: GithubRepositories[] = $(".js-example-data-ajax").select2("data") as GithubRepositories[]; + +// jQuery Generic + +declare let select: HTMLSelectElement; +const $select: JQuery = $(select) as JQuery; + +select = $select.select2().get(0); +select = $select.select2({tags: true}).get(0); +select = $select.select2("open").get(0); +select = $select.select2("close").get(0); +select = $select.select2("destroy").get(0); diff --git a/types/select2/tsconfig.json b/types/select2/tsconfig.json index 257d07ea49..3df135e0e0 100644 --- a/types/select2/tsconfig.json +++ b/types/select2/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/select2/tslint.json b/types/select2/tslint.json index 08b1465cd6..e37cff3f49 100644 --- a/types/select2/tslint.json +++ b/types/select2/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "unified-signatures": false + "unified-signatures": false, + "quotemark": [true, "double", "avoid-escape", "avoid-template"] } } From 3c57d52a150148dffd6b6cdc2cdb5cf5d8193357 Mon Sep 17 00:00:00 2001 From: Ian Copp Date: Thu, 26 Apr 2018 15:39:12 -0700 Subject: [PATCH 0926/2153] Add react-toastify (#25320) * Add react-toastify * Correct Typescript version reference --- types/react-toastify/index.d.ts | 227 +++++++++++++++++++ types/react-toastify/react-toastify-tests.ts | 9 + types/react-toastify/tsconfig.json | 23 ++ types/react-toastify/tslint.json | 1 + 4 files changed, 260 insertions(+) create mode 100644 types/react-toastify/index.d.ts create mode 100644 types/react-toastify/react-toastify-tests.ts create mode 100644 types/react-toastify/tsconfig.json create mode 100644 types/react-toastify/tslint.json diff --git a/types/react-toastify/index.d.ts b/types/react-toastify/index.d.ts new file mode 100644 index 0000000000..e77ef01837 --- /dev/null +++ b/types/react-toastify/index.d.ts @@ -0,0 +1,227 @@ +// Type definitions for react-toastify 4.0 +// Project: https://github.com/fkhadra/react-toastify#readme +// Definitions by: icopp +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from 'react'; +import { Transition } from 'react-transition-group'; + +export type ToastCloseButton = React.ReactElement; + +export interface ToastAndToastContainerOptions { + /** + * @default 'top-right' + */ + position?: 'top-right' | 'top-center' | 'top-left' | 'bottom-right' | 'bottom-center' | 'bottom-left'; + + /** + * Delay in ms to close the toast. If set to false, the notification needs + * to be closed manually. + * @default 5000 + */ + autoClose?: false | number; + + /** + * A React Component to replace the default close button or false to + * hide the button. + */ + closeButton?: false | ToastCloseButton; + + /** + * A reference to a valid react-transition-group/Transition component. + */ + transition?: Transition; + + /** + * Display or not the progress bar below the toast (remaining time). + * @default false + */ + hideProgressBar?: boolean; + + /** + * Keep the timer running or not on hover. + * @default true + */ + pauseOnHover?: boolean; + + /** + * Dismiss toast on click. + * @default true + */ + closeOnClick?: boolean; + + /** + * Add optional classes to the toast body. + */ + bodyClassName?: string; + + /** + * Add optional classes to the progress bar. + */ + progressClassName?: string; + + /** + * Allow toast to be draggable. + * @default true + */ + draggable?: boolean; + + /** + * The percentage of the toast's width it takes for a drag to dismiss a + * toast (value between 0 and 100). + * @default 80 + */ + draggablePercent?: number; +} + +export interface ToastContainerProps extends ToastAndToastContainerOptions { + /** + * Support right to left content. + * @default false + */ + rtl?: boolean; + + /** + * Display newest toast on top. + * @default false + */ + newestOnTop?: boolean; + + /** + * Pause on document visibility change (resizing the window, for + * instance). + * @default true + */ + pauseOnVisibilityChange?: boolean; + + /** + * Add optional inline style to the container. + */ + style?: React.CSSProperties; + + /** + * Add optional classes to the container. + */ + className?: string; + + /** + * Add optional classes to the toast. + */ + toastClassName?: string; +} + +export interface ToastOptions extends ToastAndToastContainerOptions { + /** + * Kind of notification. + * @default 'default' + */ + type?: 'default' | 'success' | 'info' | 'warning' | 'error'; + + /** + * Called inside componentDidMount. + */ + onOpen?(childrenProps: React.Props): void; + + /** + * Called inside componentWillUnmount. + */ + onClose?(childrenProps: React.Props): void; + + /** + * Add optional classes to the toast. + */ + className?: string; + + /** + * String or React Element, only available when calling update. + */ + render?: string | React.ReactElement; +} + +export interface Toast { + /** + * @return The ID of the toast, for future reference. + */ + (content: React.ReactNode | ((props: { closeToast(): void }) => React.ReactNode), options?: ToastOptions): string; + + /** + * Dismiss the toast with the given ID, or all toasts if no ID is given. + */ + dismiss(toastId?: string): void; + + /** + * Test if the toast with the given ID is active. + */ + isActive(toastId?: string): boolean; + + /** + * Shorthand for a toast with `type: toast.TYPE.SUCCESS`. + */ + success(content: React.ReactNode, options?: ToastOptions): string; + + /** + * Shorthand for a toast with `type: toast.TYPE.INFO`. + */ + info(content: React.ReactNode, options?: ToastOptions): string; + + /** + * Shorthand for a toast with `type: toast.TYPE.WARNING`. + */ + warning(content: React.ReactNode, options?: ToastOptions): string; + + /** + * Shorthand for a toast with `type: toast.TYPE.ERROR`. + */ + error(content: React.ReactNode, options?: ToastOptions): string; + + /** + * Update an existing toast by ID. + */ + update(id: string, options: ToastOptions & { render: React.ReactNode }): void; + + POSITION: { + TOP_LEFT: 'top-left' + TOP_RIGHT: 'top-right' + TOP_CENTER: 'top-center' + BOTTOM_LEFT: 'bottom-left' + BOTTOM_RIGHT: 'bottom-right' + BOTTOM_CENTER: 'bottom-center' + }; + + TYPE: { + INFO: 'info' + SUCCESS: 'success' + WARNING: 'warning' + ERROR: 'error' + DEFAULT: 'default' + }; +} + +export interface CssTransitionOptions { + /** The class name that will be used when the toast enters. */ + enter: string; + /** The class name that will be used when the toast exits. */ + exit: string; + /** + * The transition duration in ms. + * @default 750 + */ + duration?: number | number[]; + /** + * Append or not the position to the class name: + * yourClassName--top-right, yourClassName--bottom-left... + * @default false + */ + appendPosition?: boolean; +} + +export function cssTransition(options: CssTransitionOptions): Transition; + +export const ToastContainer: React.StatelessComponent; +export const toast: Toast; + +export const Bounce: Transition; +export const Slide: Transition; +export const Zoom: Transition; +export const Flip: Transition; diff --git a/types/react-toastify/react-toastify-tests.ts b/types/react-toastify/react-toastify-tests.ts new file mode 100644 index 0000000000..06219125e4 --- /dev/null +++ b/types/react-toastify/react-toastify-tests.ts @@ -0,0 +1,9 @@ +import { toast } from 'react-toastify'; + +const someToastId = toast('Testing!'); // $ExpectType string + +// $ExpectType void +toast.update(someToastId, { + render: "New Content", + type: toast.TYPE.INFO +}); diff --git a/types/react-toastify/tsconfig.json b/types/react-toastify/tsconfig.json new file mode 100644 index 0000000000..2a02187994 --- /dev/null +++ b/types/react-toastify/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-toastify-tests.ts" + ] +} diff --git a/types/react-toastify/tslint.json b/types/react-toastify/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-toastify/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 312bad92ccabe90fb95a9e5d3afc1525f4e7bbe3 Mon Sep 17 00:00:00 2001 From: Keiichiro Amemiya Date: Fri, 27 Apr 2018 07:39:33 +0900 Subject: [PATCH 0927/2153] add epochTime (#25199) --- types/rethinkdb/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/rethinkdb/index.d.ts b/types/rethinkdb/index.d.ts index aedd37950d..acaf7c6994 100644 --- a/types/rethinkdb/index.d.ts +++ b/types/rethinkdb/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Alex Gorbatchev // Adrian Farmadin // Pusztai Tibor +// Keiichiro Amemiya // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -54,6 +55,7 @@ declare module "rethinkdb" { export function expr(stuff: any): Expression; export function now(): Expression

    ) => WrapperComponentClass, P>; export interface Translate { diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index bc16194f0c..33b31051a5 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -30,8 +30,7 @@ type Dispatch = Redux.Dispatch; type ActionCreator = Redux.ActionCreator; // Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766 -type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; -type Omit = Pick>; +type Omit = Pick; export interface DispatchProp { dispatch?: Dispatch; diff --git a/types/react-relay/index.d.ts b/types/react-relay/index.d.ts index ae5d6e8f37..35a194b0e7 100644 --- a/types/react-relay/index.d.ts +++ b/types/react-relay/index.d.ts @@ -24,9 +24,7 @@ import * as RelayRuntimeTypes from "relay-runtime"; // Taken from https://github.com/pelotom/type-zoo // tslint:disable-next-line:strict-export-declare-modifiers -type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; -// tslint:disable-next-line:strict-export-declare-modifiers -type Omit = Pick>; +type Omit = Pick; export type RemoveRelayProp

    component. This was still missing from the types. See: https://reactstrap.github.io/components/layout/ --- types/reactstrap/lib/Col.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/reactstrap/lib/Col.d.ts b/types/reactstrap/lib/Col.d.ts index fb3fee9c8e..57829ac931 100644 --- a/types/reactstrap/lib/Col.d.ts +++ b/types/reactstrap/lib/Col.d.ts @@ -7,6 +7,7 @@ export type ColumnProps push?: string | number pull?: string | number offset?: string | number + order?: string | number }; export interface ColProps extends React.HTMLProps { From de7230bdb19e57b678aeb39dfb088342ad20910b Mon Sep 17 00:00:00 2001 From: Kiyotoshi Ichikawa Date: Thu, 3 May 2018 12:56:04 -0400 Subject: [PATCH 1039/2153] [browser-sync] Appended/updated definitions and tests. (#25301) * [browser-sync] Type definition for Option type is missing many valid properties. Also appending tests to cover newly added properties/interfaces. * Updated types and appended some. The proxy.proxyRes property could be further expressed to take one or three parameters. Its previous representation was not correct according to the documentation and default configuration the package generates. Specified types for watchEvents, open, and logLevel options. Converted type Object references to object per recommended guidelines of DefinitelyTyped repo. Converted type Function references to arrow function. More SnippetOptions properties, defined FormsOptions under GhostOptions. Added and modified tests. --- types/browser-sync/browser-sync-tests.ts | 28 ++++++++++-- types/browser-sync/index.d.ts | 56 +++++++++++++++++------- 2 files changed, 63 insertions(+), 21 deletions(-) diff --git a/types/browser-sync/browser-sync-tests.ts b/types/browser-sync/browser-sync-tests.ts index 613f8aee25..c63cb0c862 100644 --- a/types/browser-sync/browser-sync-tests.ts +++ b/types/browser-sync/browser-sync-tests.ts @@ -167,8 +167,8 @@ browserSync({ browserSync({ proxy: { target: "http://yourlocal.dev", - proxyRes: function (proxyRes, req, res) { - console.log(proxyRes); + proxyRes: function (proxyResponse, req, res) { + console.log(proxyResponse); } } }); @@ -177,8 +177,28 @@ browserSync({ proxy: { target: "http://yourlocal.dev", proxyRes: [ - function (proxyRes, req, res) { - console.log(proxyRes); + function (proxyResponse, req, res) { + console.log(proxyResponse); + } + ] + } +}); + +browserSync({ + proxy: { + target: "http://yourlocal.dev", + proxyRes: function (res) { + console.log(res); + } + } +}); + +browserSync({ + proxy: { + target: "http://yourlocal.dev", + proxyRes: [ + function (res) { + console.log(res); } ] } diff --git a/types/browser-sync/index.d.ts b/types/browser-sync/index.d.ts index 3b97fc8616..de0a457266 100644 --- a/types/browser-sync/index.d.ts +++ b/types/browser-sync/index.d.ts @@ -39,7 +39,7 @@ declare namespace browserSync { * Specify which file events to respond to. * Available events: `add`, `change`, `unlink`, `addDir`, `unlinkDir` */ - watchEvents?: string[]; + watchEvents?: WatchEvents | string[]; /** * Watch files automatically. */ @@ -72,7 +72,7 @@ declare namespace browserSync { * ws - Default: undefined * middleware - Default: undefined * reqHeaders - Default: undefined - * proxyRes - Default: undefined + * proxyRes - Default: undefined (http.ServerResponse if expecting single parameter) * proxyReq - Default: undefined */ proxy?: string | ProxyOptions; @@ -91,7 +91,7 @@ declare namespace browserSync { * Default: [] * Note: Requires at least version 2.8.0. */ - serveStatic?: (string | { route?: string | string[], dir?: string | string[]})[]; + serveStatic?: StaticOptions[] | string[]; /** * Options that are passed to the serve-static middleware when you use the * string[] syntax: eg: `serveStatic: ['./app']`. @@ -120,7 +120,7 @@ declare namespace browserSync { * Can be either "info", "debug", "warn", or "silent" * Default: info */ - logLevel?: string; + logLevel?: LogLevel; /** * Change the console logging prefix. Useful if you're creating your own project based on Browsersync * Default: BS @@ -170,7 +170,7 @@ declare namespace browserSync { * Decide which URL to open automatically when Browsersync starts. Defaults to "local" if none set. * Can be true, local, external, ui, ui-external, tunnel or false */ - open?: string | boolean; + open?: OpenOptions | boolean; /** * The browser(s) to open * Default: default @@ -320,6 +320,12 @@ declare namespace browserSync { excludeFileTypes?: string[]; } + type WatchEvents = "add" | "change" | "unlink" | "addDir" | "unlinkDir"; + + type LogLevel = "info" | "debug" | "warn" | "silent"; + + type OpenOptions = "local" | "external" | "ui" | "ui-external" | "tunnel"; + interface Hash { [path: string]: T; } @@ -353,16 +359,21 @@ declare namespace browserSync { routes?: Hash; /** configure custom middleware */ middleware?: (MiddlewareHandler | PerRouteMiddleware)[]; - serveStaticOptions?: ServeStaticOptions + serveStaticOptions?: ServeStaticOptions; } interface ProxyOptions { target?: string; middleware?: MiddlewareHandler; ws?: boolean; - reqHeaders?: (config: any) => Hash; - proxyRes?: ((res: http.ServerResponse, req: http.IncomingMessage, next: Function) => any)[] | ((res: http.ServerResponse, req: http.IncomingMessage, next: Function) => any); - proxyReq?: ((res: http.ServerRequest) => any)[] | ((res: http.ServerRequest) => any); + reqHeaders?: (config: object) => Hash; + proxyRes?: ProxyResponseMiddleware | ProxyResponseMiddleware[]; + proxyReq?: ((res: http.ServerRequest) => void)[] | ((res: http.ServerRequest) => void); + error?: (err: NodeJS.ErrnoException, req: http.IncomingMessage, res: http.ServerResponse) => void; + } + + interface ProxyResponseMiddleware { + (proxyRes: http.ServerResponse | http.IncomingMessage, res: http.ServerResponse, req: http.IncomingMessage): void; } interface HttpsOptions { @@ -370,11 +381,17 @@ declare namespace browserSync { cert?: string; } + interface StaticOptions { + route: string | string[], + dir: string | string[] + } + interface MiddlewareHandler { - (req: http.IncomingMessage, res: http.ServerResponse, next: Function): any; + (req: http.IncomingMessage, res: http.ServerResponse, next: () => void): any; } interface PerRouteMiddleware { + id?: string; route: string; handle: MiddlewareHandler; } @@ -382,18 +399,23 @@ declare namespace browserSync { interface GhostOptions { clicks?: boolean; scroll?: boolean; - forms?: boolean | { - submit?: boolean; - inputs?: boolean; - toggles?: boolean; - }; + forms?: FormsOptions | boolean; + } + + interface FormsOptions { + inputs: boolean, + submit: boolean, + toggles: boolean } interface SnippetOptions { - async?: boolean, + async?: boolean; whitelist?: string[], blacklist?: string[], - rule?: { match?: RegExp; fn?: (snippet: string, match: string) => any }; + rule?: { + match?: RegExp; + fn?: (snippet: string, match: string) => any + }; } interface SocketOptions { From 96f036fdbc6cfd4708dfce8852f90ef9381b8ebb Mon Sep 17 00:00:00 2001 From: Nico Chaves Date: Thu, 3 May 2018 09:56:24 -0700 Subject: [PATCH 1040/2153] [redux-form] add missing updateUnregisteredFields prop (#25309) * add missing updateUnregisteredFields prop * fix lint issue (no-trailing-whitespace) --- types/redux-form/lib/reduxForm.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/redux-form/lib/reduxForm.d.ts b/types/redux-form/lib/reduxForm.d.ts index 5cfcdb842c..29b6ca24ae 100644 --- a/types/redux-form/lib/reduxForm.d.ts +++ b/types/redux-form/lib/reduxForm.d.ts @@ -109,6 +109,7 @@ export interface ConfigProps { immutableProps?: string[]; initialValues?: Partial; keepDirtyOnReinitialize?: boolean; + updateUnregisteredFields?: boolean; onChange?(values: Partial, dispatch: Dispatch, props: P & InjectedFormProps): void; onSubmit?: FormSubmitHandler> | SubmitHandler>; onSubmitFail?(errors: FormErrors, dispatch: Dispatch, submitError: any, props: P & InjectedFormProps): void; From 6372e41de587452faa2e1f188202c52047015e3a Mon Sep 17 00:00:00 2001 From: James Bromwell <943160+thw0rted@users.noreply.github.com> Date: Thu, 3 May 2018 19:00:28 +0200 Subject: [PATCH 1041/2153] @types/node: Add missing methods to Console, plus docs (#25327) * Add missing methods to node Console, plus docs * Update Node console dirxml per review comment --- types/node/index.d.ts | 94 +++++++++++++++++++++++++++++++++++++--- types/node/v9/index.d.ts | 91 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 177 insertions(+), 8 deletions(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 9ba96612dc..8074e3d328 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -32,17 +32,101 @@ // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build interface Console { Console: NodeJS.ConsoleConstructor; + /** + * A simple assertion test that verifies whether `value` is truthy. + * If it is not, an `AssertionError` is thrown. + * If provided, the error `message` is formatted using `util.format()` and used as the error message. + */ assert(value: any, message?: string, ...optionalParams: any[]): void; - dir(obj: any, options?: NodeJS.InspectOptions): void; + /** + * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the TTY. + * When `stdout` is not a TTY, this method does nothing. + */ + clear(): void; + /** + * Maintains an internal counter specific to `label` and outputs to `stdout` the number of times `console.count()` has been called with the given `label`. + */ + count(label?: string): void; + /** + * Resets the internal counter specific to `label`. + */ + countReset(label?: string): void; + /** + * The `console.debug()` function is an alias for {@link console.log()}. + */ debug(message?: any, ...optionalParams: any[]): void; + /** + * Uses {@link util.inspect()} on `obj` and prints the resulting string to `stdout`. + * This function bypasses any custom `inspect()` function defined on `obj`. + */ + dir(obj: any, options?: NodeJS.InspectOptions): void; + /** + * This method calls {@link console.log()} passing it the arguments received. Please note that this method does not produce any XML formatting + */ + dirxml(...data: any[]): void; + /** + * Prints to `stderr` with newline. + */ error(message?: any, ...optionalParams: any[]): void; + /** + * Increases indentation of subsequent lines by two spaces. + * If one or more `label`s are provided, those are printed first without the additional indentation. + */ + group(...label: any[]): void; + /** + * The `console.groupCollapsed()` function is an alias for {@link console.group()}. + */ + groupCollapsed(): void; + /** + * Decreases indentation of subsequent lines by two spaces. + */ + groupEnd(): void; + /** + * The {@link console.info()} function is an alias for {@link console.log()}. + */ info(message?: any, ...optionalParams: any[]): void; + /** + * Prints to `stdout` with newline. + */ log(message?: any, ...optionalParams: any[]): void; - time(label: string): void; - timeEnd(label: string): void; - trace(message?: any, ...optionalParams: any[]): void; - warn(message?: any, ...optionalParams: any[]): void; + /** + * This method does not display anything unless used in the inspector. + * Prints to `stdout` the array `array` formatted as a table. + */ table(tabularData: any, properties?: string[]): void; + /** + * Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique `label`. + */ + time(label?: string): void; + /** + * Stops a timer that was previously started by calling {@link console.time()} and prints the result to `stdout`. + */ + timeEnd(label?: string): void; + /** + * Prints to `stderr` the string 'Trace :', followed by the {@link util.format()} formatted message and stack trace to the current position in the code. + */ + trace(message?: any, ...optionalParams: any[]): void; + /** + * The {@link console.warn()} function is an alias for {@link console.error()}. + */ + warn(message?: any, ...optionalParams: any[]): void; + + // --- Inspector mode only --- + /** + * This method does not display anything unless used in the inspector. + * Starts a JavaScript CPU profile with an optional label. + */ + profile(label?: string): void; + /** + * This method does not display anything unless used in the inspector. + * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector. + */ + profileEnd(): void; + /** + * This method does not display anything unless used in the inspector. + * Adds an event with the label `label` to the Timeline panel of the inspector. + */ + timeStamp(label?: string): void; } interface Error { diff --git a/types/node/v9/index.d.ts b/types/node/v9/index.d.ts index d739a5c523..af2ed7168d 100644 --- a/types/node/v9/index.d.ts +++ b/types/node/v9/index.d.ts @@ -32,16 +32,101 @@ // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build interface Console { Console: NodeJS.ConsoleConstructor; + /** + * A simple assertion test that verifies whether `value` is truthy. + * If it is not, an `AssertionError` is thrown. + * If provided, the error `message` is formatted using `util.format()` and used as the error message. + */ assert(value: any, message?: string, ...optionalParams: any[]): void; - dir(obj: any, options?: NodeJS.InspectOptions): void; + /** + * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the TTY. + * When `stdout` is not a TTY, this method does nothing. + */ + clear(): void; + /** + * Maintains an internal counter specific to `label` and outputs to `stdout` the number of times `console.count()` has been called with the given `label`. + */ + count(label?: string): void; + /** + * Resets the internal counter specific to `label`. + */ + countReset(label?: string): void; + /** + * The `console.debug()` function is an alias for {@link console.log()}. + */ debug(message?: any, ...optionalParams: any[]): void; + /** + * Uses {@link util.inspect()} on `obj` and prints the resulting string to `stdout`. + * This function bypasses any custom `inspect()` function defined on `obj`. + */ + dir(obj: any, options?: NodeJS.InspectOptions): void; + /** + * This method calls {@link console.log()} passing it the arguments received. Please note that this method does not produce any XML formatting + */ + dirxml(...data: any[]): void; + /** + * Prints to `stderr` with newline. + */ error(message?: any, ...optionalParams: any[]): void; + /** + * Increases indentation of subsequent lines by two spaces. + * If one or more `label`s are provided, those are printed first without the additional indentation. + */ + group(...label: any[]): void; + /** + * The `console.groupCollapsed()` function is an alias for {@link console.group()}. + */ + groupCollapsed(): void; + /** + * Decreases indentation of subsequent lines by two spaces. + */ + groupEnd(): void; + /** + * The {@link console.info()} function is an alias for {@link console.log()}. + */ info(message?: any, ...optionalParams: any[]): void; + /** + * Prints to `stdout` with newline. + */ log(message?: any, ...optionalParams: any[]): void; - time(label: string): void; - timeEnd(label: string): void; + /** + * Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique `label`. + */ + time(label?: string): void; + /** + * Stops a timer that was previously started by calling {@link console.time()} and prints the result to `stdout`. + */ + timeEnd(label?: string): void; + /** + * Prints to `stderr` the string 'Trace :', followed by the {@link util.format()} formatted message and stack trace to the current position in the code. + */ trace(message?: any, ...optionalParams: any[]): void; + /** + * The {@link console.warn()} function is an alias for {@link console.error()}. + */ warn(message?: any, ...optionalParams: any[]): void; + + // --- Inspector mode only --- + /** + * This method does not display anything unless used in the inspector. + * Starts a JavaScript CPU profile with an optional label. + */ + profile(label?: string): void; + /** + * This method does not display anything unless used in the inspector. + * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector. + */ + profileEnd(): void; + /** + * This method does not display anything unless used in the inspector. + * Prints to `stdout` the array `array` formatted as a table. + */ + table(tabularData: any, properties?: string[]): void; + /** + * This method does not display anything unless used in the inspector. + * Adds an event with the label `label` to the Timeline panel of the inspector. + */ + timeStamp(label?: string): void; } interface Error { From f4e0c531ba2f8def09b8a90a7b925c68304bda38 Mon Sep 17 00:00:00 2001 From: Oscar Busk Date: Thu, 3 May 2018 19:51:31 +0200 Subject: [PATCH 1042/2153] Add typing for object syntax on component registerer (#25507) --- types/angular/angular-tests.ts | 13 ++++++++++++- types/angular/index.d.ts | 7 +++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/types/angular/angular-tests.ts b/types/angular/angular-tests.ts index ca9d2c7568..1dff1a0451 100644 --- a/types/angular/angular-tests.ts +++ b/types/angular/angular-tests.ts @@ -1138,7 +1138,8 @@ angular.module('multiSlotTranscludeExample', []) }; }); -angular.module('componentExample', []) +// $ExpectType IModule +const componentModule = angular.module('componentExample', []) .component('counter', { require: {ctrl: '^ctrl'}, bindings: { @@ -1160,6 +1161,16 @@ angular.module('componentExample', []) }, template: '', transclude: true + }) + .component({ + aThirdComponent: { + controller: class AThirdComponentController { + count: number; + }, + bindings: { + count: '=' + } + } }); interface ICopyExampleUser { diff --git a/types/angular/index.d.ts b/types/angular/index.d.ts index 4c896eb430..2e674861bc 100644 --- a/types/angular/index.d.ts +++ b/types/angular/index.d.ts @@ -196,6 +196,12 @@ declare namespace angular { * @param options A definition object passed into the component. */ component(name: string, options: IComponentOptions): IModule; + /** + * Use this method to register a component. + * + * @param object Object map of components where the keys are the names and the values are the component definition objects + */ + component(object: {[componentName: string]: IComponentOptions}): IModule; /** * Use this method to register work which needs to be performed on module loading. * @@ -1273,6 +1279,7 @@ declare namespace angular { directive(object: {[directiveName: string]: Injectable>}): ICompileProvider; component(name: string, options: IComponentOptions): ICompileProvider; + component(object: {[componentName: string]: IComponentOptions}): ICompileProvider; aHrefSanitizationWhitelist(): RegExp; aHrefSanitizationWhitelist(regexp: RegExp): ICompileProvider; From 2689160921392c46cfd8b461116d0dff2b753a26 Mon Sep 17 00:00:00 2001 From: Lucas Sloan Date: Thu, 3 May 2018 10:53:09 -0700 Subject: [PATCH 1043/2153] AngularJS: improve types for `IQService.all` (support for arrays of non-promises). (#25350) --- types/angular/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/angular/index.d.ts b/types/angular/index.d.ts index 2e674861bc..6dccefc926 100644 --- a/types/angular/index.d.ts +++ b/types/angular/index.d.ts @@ -1034,7 +1034,7 @@ declare namespace angular { all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise ]): IPromise<[T1, T2, T3, T4]>; all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise]): IPromise<[T1, T2, T3]>; all(values: [T1 | IPromise, T2 | IPromise]): IPromise<[T1, T2]>; - all(promises: Array>): IPromise; + all(promises: Array>): IPromise; /** * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved. * From 5c5450722cca195d0ddf931c75d482f083f6d16e Mon Sep 17 00:00:00 2001 From: ywceric Date: Thu, 3 May 2018 18:53:38 +0100 Subject: [PATCH 1044/2153] add StopError to bluebird-retry (#25339) --- types/bluebird-retry/bluebird-retry-tests.ts | 7 +++++++ types/bluebird-retry/index.d.ts | 2 ++ 2 files changed, 9 insertions(+) diff --git a/types/bluebird-retry/bluebird-retry-tests.ts b/types/bluebird-retry/bluebird-retry-tests.ts index e9beaf5562..45a665c969 100644 --- a/types/bluebird-retry/bluebird-retry-tests.ts +++ b/types/bluebird-retry/bluebird-retry-tests.ts @@ -30,3 +30,10 @@ const options: retry.Options = { }; retry(logFail, options); + +function stopErrorExample() { + console.log('retrying\n'); + throw new retry.StopError('stop retrying'); +} + +retry(stopErrorExample); diff --git a/types/bluebird-retry/index.d.ts b/types/bluebird-retry/index.d.ts index 358c75936d..b7ba96495d 100644 --- a/types/bluebird-retry/index.d.ts +++ b/types/bluebird-retry/index.d.ts @@ -20,6 +20,8 @@ declare namespace retry { context?: any; args?: any; } + + class StopError extends Error {} } export = retry; From 785ca0ad7af07b951907256ef40b562cb0c48dc0 Mon Sep 17 00:00:00 2001 From: Alec Merdler Date: Thu, 3 May 2018 13:54:13 -0400 Subject: [PATCH 1045/2153] add types for Ace editor completion hooks (#25337) --- types/ace/index.d.ts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/types/ace/index.d.ts b/types/ace/index.d.ts index b1e013bea9..828aab87c2 100644 --- a/types/ace/index.d.ts +++ b/types/ace/index.d.ts @@ -3039,6 +3039,37 @@ declare namespace AceAjax { **/ new(container: HTMLElement, theme?: string): VirtualRenderer; } + + export interface Completer { + /** + * Provides possible completion results asynchronously using the given callback. + * @param editor The editor to associate with + * @param session The `EditSession` to refer to + * @param pos An object containing the row and column + * @param prefix The prefixing string before the current position + * @param callback Function to provide the results or error + */ + getCompletions: (editor: Editor, session: IEditSession, pos: Position, prefix: string, callback: CompletionCallback) => void; + + /** + * Provides tooltip information about a completion result. + * @param item The completion result + */ + getDocTooltip?: (item: Completion) => void; + } + + export interface Completion { + value: string; + meta: string; + type?: string; + caption?: string; + snippet?: any; + score?: number; + exactMatch?: number; + docHTML?: string; + } + + export type CompletionCallback = (error: Error, results: Completion[]) => void; } declare var ace: AceAjax.Ace; From e20d3f42c0ae83e996ff2a5ff0a8ce74f6c748d3 Mon Sep 17 00:00:00 2001 From: Junyoung Clare Jang Date: Thu, 3 May 2018 15:34:33 -0400 Subject: [PATCH 1046/2153] Add evaporate 2.1 typing (#25452) --- types/evaporate/evaporate-tests.ts | 32 +++++++-- types/evaporate/index.d.ts | 110 +++++++++++++++++++++++++++-- types/evaporate/tsconfig.json | 17 ++--- types/evaporate/tslint.json | 78 +------------------- 4 files changed, 141 insertions(+), 96 deletions(-) diff --git a/types/evaporate/evaporate-tests.ts b/types/evaporate/evaporate-tests.ts index ea4a4ac9bf..3140cd9ea9 100644 --- a/types/evaporate/evaporate-tests.ts +++ b/types/evaporate/evaporate-tests.ts @@ -1,7 +1,27 @@ -import Evaporate = require("evaporate"); +import Evaporate = require('evaporate'); -function test_upload() { - var evaporate = new Evaporate({}); - var uploadId = evaporate.add({}); - evaporate.cancel(uploadId); -} +const newEvaporate = new Evaporate({ + bucket: 'abc', +}); + +Evaporate.create({ + bucket: 'abc', +}) + .then((evaporate) => { + evaporate.add({ + name: 'gwejlf', + file: new File(['abcd'], 'efg'), + started: (file_key) => { + evaporate.pause(file_key); + }, + paused: (file_key) => { + evaporate.resume(file_key); + }, + resumed: (file_key) => { + evaporate.cancel(file_key); + } + }) + .then((awsS3ObjectKey) => { + console.log(awsS3ObjectKey + '!!!'); + }); + }); diff --git a/types/evaporate/index.d.ts b/types/evaporate/index.d.ts index bf4b52aae3..1c415769b8 100644 --- a/types/evaporate/index.d.ts +++ b/types/evaporate/index.d.ts @@ -1,12 +1,112 @@ -// Type definitions for EvaporateJS +// Type definitions for EvaporateJS 2.1 // Project: https://github.com/TTLabs/EvaporateJS -// Definitions by: Andrew Kuklewicz , Chris Rhoden +// Definitions by: Andrew Kuklewicz +// Chris Rhoden +// Junyoung Clare Jang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 export = Evaporate; declare class Evaporate { - cancel(id:string): boolean; - constructor(config:any); - add(config:any): string; + constructor(config: Evaporate.CreateConfig); + supported: boolean; + add(config: Evaporate.AddConfig, options?: Evaporate.AddOverrideOptions): Promise; + pause(file_key?: string, options?: object): Promise; + resume(file_key?: string): Promise; + cancel(file_key?: string): Promise; +} + +declare namespace Evaporate { + function create(config: CreateConfig): Promise; + + interface CreateConfig { + readableStreams?: boolean; + readableStreamPartMethod?: null | ((file: File, start: number, end: number) => ReadableStream); + bucket: string; + logging?: boolean; + maxConcurrentParts?: number; + partSize?: number; + retryBackoffPower?: number; + maxRetryBackoffSecs?: number; + progressIntervalMS?: number; + cloudfront?: boolean; + s3Acceleration?: boolean; + mockLocalStorage?: boolean; + encodeFilename?: boolean; + computeContentMd5?: false; + allowS3ExistenceOptimization?: boolean; + onlyRetryForSameFileName?: boolean; + timeUrl?: string; + cryptoMd5Method?: null | ((data: ArrayBuffer) => string); + cryptoHexEncodedHash256?: null | ((data: ArrayBuffer) => string); + aws_url?: string; + aws_key?: string; + awsRegion?: string; + awsSignatureVersion?: '2' | '4'; + signerUrl?: string; + sendCanonicalRequestToSignerUrl?: boolean; + s3FileCacheHoursAgo?: null | number; + signParams?: object; + signHeaders?: object; + customAuthMethod?: null | (( + signParams: string, + signHeaders: string, + stringToSign: () => string | undefined, + signatureDateTime: string, + canonicalRequest: string + ) => Promise); + maxFileSize?: number; + signResponseHandler?: null | ((response: any, stringToSign: string, signatureDateTime: string) => Promise); + xhrWithCredentials?: boolean; + localTimeOffset?: number; + evaporateChanged?: (evaporate: Evaporate, evaporatingCount: number) => void; + abortCompletionThrottlingMs?: number; + } + + interface TransferStats { + speed: number; + readableSpeed: string; + loaded: number; + totalUploaded: number; + remainingSize: number; + secondsLeft: number; + fileSize: number; + } + + interface AddConfig { + name: string; + file: File; + xAmzHeadersAtInitiate?: { [key: string]: string }; + notSignedHeadersAtInitiate?: { [key: string]: string }; + xAmzHeadersAtUpload?: { [key: string]: string }; + xAmzHeadersAtComplete?: { [key: string]: string }; + xAmzHeadersCommon?: { [key: string]: string }; + started?: (file_key: string) => void; + uploadInitiated?: (s3UploadId?: string) => void; + paused?: (file_key: string) => void; + resumed?: (file_key: string) => void; + pausing?: (file_key: string) => void; + cancelled?: () => void; + complete?: (xhr: XMLHttpRequest, awsObjectKey: string, stats: TransferStats) => void; + nameChanged?: (awsObjectKey: string) => void; + info?: (msg: string) => void; + warn?: (msg: string) => void; + error?: (msg: string) => void; + progress?: (p: number, stats: TransferStats) => void; + contentType?: string; + beforeSigner?: (xhr: XMLHttpRequest, url: string) => void; + } + + type ImmutableOptionKeys = + | 'maxConcurrentParts' | 'logging' | 'cloudfront' | 'encodeFilename' + | 'computeContentMd5' | 'allowS3ExistenceOptimization' | 'onlyRetryForSameFileName' + | 'timeUrl' | 'cryptoMd5Method' | 'cryptoHexEncodedHash256' | 'awsRegion' | 'awsSignatureVersion' + | 'evaporateChanged'; + type AddOverrideOptionKeys = Exclude; + interface AddOverrideOptions extends Pick {} + + interface PauseConfig { + force?: boolean; + } } diff --git a/types/evaporate/tsconfig.json b/types/evaporate/tsconfig.json index 9164730455..c932b3ca2f 100644 --- a/types/evaporate/tsconfig.json +++ b/types/evaporate/tsconfig.json @@ -1,23 +1,24 @@ { "compilerOptions": { - "module": "commonjs", + "baseUrl": "../", + "forceConsistentCasingInFileNames": true, "lib": [ - "es6" + "es6", + "dom" ], + "module": "commonjs", + "noEmit": true, "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, - "baseUrl": "../", "typeRoots": [ "../" ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true + "types": [] }, "files": [ "index.d.ts", "evaporate-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/evaporate/tslint.json b/types/evaporate/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/evaporate/tslint.json +++ b/types/evaporate/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } From 638e64c83c4c008f8bf774b8102fc61b4e18f9c3 Mon Sep 17 00:00:00 2001 From: Aleksey Lynnyk Date: Thu, 3 May 2018 22:34:59 +0300 Subject: [PATCH 1047/2153] google-apps-script: Add BooleanCriteria, InterpolationType, ConditionalFormatRuleBuilder, ConditionalFormatRule (#25502) * Add BooleanCriteria, InterpolationType, ConditionalFormatRuleBuilder, ConditionalFormatRule * Add BooleanCriteria, InterpolationType, ConditionalFormatRuleBuilder, ConditionalFormatRule * Change updated date --- .../google-apps-script.calendar.d.ts | 4 +- .../google-apps-script.spreadsheet.d.ts | 408 +++++++++++++++++- 2 files changed, 404 insertions(+), 8 deletions(-) diff --git a/types/google-apps-script/google-apps-script.calendar.d.ts b/types/google-apps-script/google-apps-script.calendar.d.ts index 34a3d46a11..21770b6efb 100644 --- a/types/google-apps-script/google-apps-script.calendar.d.ts +++ b/types/google-apps-script/google-apps-script.calendar.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Google Apps Script 2017-05-12 +// Type definitions for Google Apps Script 2018-05-03 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen +// linlex // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -24,6 +25,7 @@ declare namespace GoogleAppsScript { deleteCalendar(): void; getColor(): string; getDescription(): string; + getEventById(iCalId: string): CalendarEvent; getEventSeriesById(iCalId: string): CalendarEventSeries; getEvents(startTime: Date, endTime: Date): CalendarEvent[]; getEvents(startTime: Date, endTime: Date, options: Object): CalendarEvent[]; diff --git a/types/google-apps-script/google-apps-script.spreadsheet.d.ts b/types/google-apps-script/google-apps-script.spreadsheet.d.ts index 7cd1cb8946..b656032a96 100644 --- a/types/google-apps-script/google-apps-script.spreadsheet.d.ts +++ b/types/google-apps-script/google-apps-script.spreadsheet.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Google Apps Script 2017-05-12 +// Type definitions for Google Apps Script 2018-05-03 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen +// linlex // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -11,7 +12,7 @@ declare namespace GoogleAppsScript { /** * This service allows scripts to create, access, and modify Google Sheets files. See also the guide to storing data in spreadsheets. - * + * * https://developers.google.com/apps-script/guides/sheets */ export module Spreadsheet { @@ -858,6 +859,7 @@ declare namespace GoogleAppsScript { autoResizeColumn(columnPosition: Integer): Sheet; clear(): Sheet; clear(options: Object): Sheet; + clearConditionalFormatRules(): void; clearContents(): Sheet; clearFormats(): Sheet; clearNotes(): Sheet; @@ -870,6 +872,7 @@ declare namespace GoogleAppsScript { getActiveRange(): Range; getCharts(): EmbeddedChart[]; getColumnWidth(columnPosition: Integer): Integer; + getConditionalFormatRules(): ConditionalFormatRule[]; getDataRange(): Range; getFrozenColumns(): Integer; getFrozenRows(): Integer; @@ -923,6 +926,8 @@ declare namespace GoogleAppsScript { setActiveSelection(range: Range): Range; setActiveSelection(a1Notation: string): Range; setColumnWidth(columnPosition: Integer, width: Integer): Sheet; + setConditionalFormatRules(rules: ReadonlyArray): void; + setCurrentCell(cell: Range): void; setFrozenColumns(columns: Integer): void; setFrozenRows(rows: Integer): void; setName(name: string): Sheet; @@ -1066,6 +1071,14 @@ declare namespace GoogleAppsScript { * An enumeration representing the data-validation criteria that can be set on a range. */ DataValidationCriteria: typeof DataValidationCriteria; + /** + * An enumeration representing the interpolation options for calculating a value to be used in a GradientCondition in a ConditionalFormatRule. + */ + InterpolationType: typeof InterpolationType; + /** + * An enumeration representing the boolean criteria that can be used in conditional format or filter. + */ + BooleanCriteria: typeof BooleanCriteria; /** * An enumeration representing the parts of a spreadsheet that can be protected from edits. */ @@ -1111,27 +1124,408 @@ declare namespace GoogleAppsScript { */ open(file: Drive.File): Spreadsheet; /** - * Opens the spreadsheet with the given ID. + * Opens the spreadsheet with the given ID. */ openById(id: string): Spreadsheet; /** - * Opens the spreadsheet with the given url. + * Opens the spreadsheet with the given url. */ openByUrl(url: string): Spreadsheet; /** - * Sets the active range for the application. + * Sets the active range for the application. */ setActiveRange(range: Range): Range; /** - * Sets the active sheet in a spreadsheet. + * Sets the active sheet in a spreadsheet. */ setActiveSheet(sheet: Sheet): Sheet; /** - * Sets the active spreadsheet. + * Sets the active spreadsheet. */ setActiveSpreadsheet(newActiveSpreadsheet: Spreadsheet): void; + /** + * Creates a builder for a conditional formatting rule. + */ + newConditionalFormatRule(): ConditionalFormatRuleBuilder; } + /** + * Access conditional formatting rules. To create a new rule, use SpreadsheetApp.newConditionalFormatRule() and + * ConditionalFormatRuleBuilder. You can use Sheet.setConditionalFormatRules(rules) to set the rules for a given + * sheet. + */ + export interface ConditionalFormatRule { + /** + * Returns a rule builder preset with this rule's settings. + */ + copy(): ConditionalFormatRuleBuilder; + + /** + * Retrieves the rule's BooleanCondition information if this rule uses boolean condition criteria. + */ + getBooleanCondition(): BooleanCondition; + + /** + * Retrieves the rule's GradientCondition information, if this rule uses gradient condition criteria. + */ + getGradientCondition(): GradientCondition; + + /** + * Retrieves the ranges to which this conditional format rule is applied. + */ + getRanges(): Range[]; + } + + /** + * Builder for conditional format rules. + */ + export interface ConditionalFormatRuleBuilder { + + /** + * Constructs a conditional format rule from the settings applied to the builder. + */ + build(): ConditionalFormatRule; + + /** + * Returns a rule builder preset with this rule's settings. + */ + copy(): ConditionalFormatRuleBuilder; + + /** + * Retrieves the rule's BooleanCondition information if this rule uses boolean condition criteria. + */ + getBooleanCondition(): BooleanCondition; + + /** + * Retrieves the rule's GradientCondition information, if this rule uses gradient condition criteria. + */ + getGradientCondition(): GradientCondition; + + /** + * Retrieves the ranges to which this conditional format rule is applied. + */ + getRanges(): Range[]; + + /** + * Sets the background color for the conditional format rule's format. + */ + setBackground(color: string): ConditionalFormatRuleBuilder; + + /** + * Sets text bolding for the conditional format rule's format. + */ + setBold(bold: boolean): ConditionalFormatRuleBuilder; + + /** + * Sets the font color for the conditional format rule's format. + */ + setFontColor(color: string): ConditionalFormatRuleBuilder; + + /** + * Clears the conditional format rule's gradient maxpoint value, and instead uses the maximum value in the rule's ranges. + */ + setGradientMaxpoint(color: string): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule's gradient maxpoint fields. + */ + setGradientMaxpointWithValue(color: string, type: InterpolationType, value: string): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule's gradient midpoint fields. + */ + setGradientMidpointWithValue(color: string, type: InterpolationType, value: string): ConditionalFormatRuleBuilder; + + /** + * Clears the conditional format rule's gradient minpoint value, and instead uses the minimum value in the rule's ranges. + */ + setGradientMinpoint(color: string): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule's gradient minpoint fields. + */ + setGradientMinpointWithValue(color: string, type: SpreadsheetApp.InterpolationType, value: string): ConditionalFormatRuleBuilder; + + /** + * Sets text italics for the conditional format rule's format. + */ + setItalic(italic: boolean): ConditionalFormatRuleBuilder; + + /** + * Sets one or more ranges to which this conditional format rule is applied. + */ + setRanges(ranges: ReadonlyArray): ConditionalFormatRuleBuilder; + + /** + * Sets text strikethrough for the conditional format rule's format. + */ + setStrikethrough(strikethrough: boolean): ConditionalFormatRuleBuilder; + + /** + * Sets text underlining for the conditional format rule's format. + */ + setUnderline(underline: boolean): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to trigger when the cell is empty. + */ + whenCellEmpty(): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to trigger when the cell is not empty. + */ + whenCellNotEmpty(): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to trigger when a date is after the given value. + */ + whenDateAfter(date: Date): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to trigger when a date is after the given relative date. + */ + whenDateAfter(date: Date): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to trigger when a date is before the given date. + */ + whenDateBefore(date: Date): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to trigger when a date is before the given relative date. + */ + whenDateBefore(date: Date): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to trigger when a date is equal to the given date. + */ + whenDateEqualTo(date: Date): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to trigger when a date is equal to the given relative date. + */ + whenDateEqualTo(date: Date): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to trigger when that the given formula evaluates to true. + */ + whenFormulaSatisfied(formula: string): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to trigger when a number falls between, or is either of, two specified values. + */ + whenNumberBetween(start: number, end: number): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to trigger when a number is equal to the given value. + */ + whenNumberEqualTo(number: number): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to trigger when a number is greater than the given value. + */ + whenNumberGreaterThan(number: number): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to trigger when a number is greater than or equal to the given value. + */ + whenNumberGreaterThanOrEqualTo(number: number): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional conditional format rule to trigger when a number less than the given value. + */ + whenNumberLessThan(number: number): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to trigger when a number less than or equal to the given value. + */ + whenNumberLessThanOrEqualTo(number: number): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to trigger when a number does not fall between, and is neither of, two specified values. + */ + whenNumberNotBetween(start: number, end: number): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to trigger when a number is not equal to the given value. + */ + whenNumberNotEqualTo(number: number): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to trigger when that the input contains the given value. + */ + whenTextContains(text: string): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to trigger when that the input does not contain the given value. + */ + whenTextDoesNotContain(text: string): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to trigger when that the input ends with the given value. + */ + whenTextEndsWith(text: string): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to trigger when that the input is equal to the given value. + */ + whenTextEqualTo(text: string): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to trigger when that the input starts with the given value. + */ + whenTextStartsWith(text: string): ConditionalFormatRuleBuilder; + + /** + * Sets the conditional format rule to criteria defined by BooleanCriteria values, typically taken from the criteria and arguments of an existing rule. + */ + withCriteria(criteria: BooleanCriteria, args: ReadonlyArray): ConditionalFormatRuleBuilder; + } + + /** + * An enumeration representing the boolean criteria that can be used in conditional format or filter. + */ + export enum BooleanCriteria { + /** + * The criteria is met when a cell is empty. + */ + CELL_EMPTY, + + /** + * The criteria is met when a cell is not empty. + */ + CELL_NOT_EMPTY, + + /** + * The criteria is met when a date is after the given value. + */ + DATE_AFTER, + + /** + * The criteria is met when a date is before the given value. + */ + DATE_BEFORE, + + /** + * The criteria is met when a date is equal to the given value. + */ + DATE_EQUAL_TO, + + /** + * The criteria is met when a date is after the relative date value. + */ + DATE_AFTER_RELATIVE, + + /** + * The criteria is met when a date is before the relative date value. + */ + DATE_BEFORE_RELATIVE, + + /** + * The criteria is met when a date is equal to the relative date value. + */ + DATE_EQUAL_TO_RELATIVE, + + /** + * The criteria is met when a number that is between the given values. + */ + NUMBER_BETWEEN, + + /** + * The criteria is met when a number that is equal to the given value. + */ + NUMBER_EQUAL_TO, + + /** + * The criteria is met when a number that is greater than the given value. + */ + NUMBER_GREATER_THAN, + + /** + * The criteria is met when a number that is greater than or equal to the given value. + */ + NUMBER_GREATER_THAN_OR_EQUAL_TO, + + /** + * The criteria is met when a number that is less than the given value. + */ + NUMBER_LESS_THAN, + + /** + * The criteria is met when a number that is less than or equal to the given value. + */ + NUMBER_LESS_THAN_OR_EQUAL_TO, + + /** + * The criteria is met when a number that is not between the given values. + */ + NUMBER_NOT_BETWEEN, + + /** + * The criteria is met when a number that is not equal to the given value. + */ + NUMBER_NOT_EQUAL_TO, + + /** + * The criteria is met when the input contains the given value. + */ + TEXT_CONTAINS, + + /** + * The criteria is met when the input does not contain the given value. + */ + TEXT_DOES_NOT_CONTAIN, + + /** + * The criteria is met when the input is equal to the given value. + */ + TEXT_EQUAL_TO, + + /** + * The criteria is met when the input begins with the given value. + */ + TEXT_STARTS_WITH, + + /** + * The criteria is met when the input ends with the given value. + */ + TEXT_ENDS_WITH, + + /** + * The criteria is met when the input makes the given formula evaluate to true. + */ + CUSTOM_FORMULA + } + + /** + * An enumeration representing the interpolation options for calculating a value to be used in a GradientCondition in a ConditionalFormatRule. + */ + export enum InterpolationType { + /** + * Use the number as as specific interpolation point for a gradient condition. + */ + NUMBER, + + /** + * Use the number as a percentage interpolation point for a gradient condition. + */ + PERCENT, + + /** + * Use the number as a percentile interpolation point for a gradient condition. + */ + PERCENTILE, + + /** + * Infer the minimum number as a specific interpolation point for a gradient condition. + */ + MIN, + + /** + * Infer the maximum number as a specific interpolation point for a gradient condition. + */ + MAX + } } } From 568b33e4c6edc0db640cf8dcc2cbf6e04dc92cc5 Mon Sep 17 00:00:00 2001 From: Fenying Date: Fri, 4 May 2018 03:37:35 +0800 Subject: [PATCH 1048/2153] [sequelize] Added exact key matching and partial update. (#25311) * More exactly key matching. * Applied more exact limitation on updating values --- types/sequelize/index.d.ts | 43 +++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index fd56cdbd7c..4adf48948d 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -2819,12 +2819,15 @@ declare namespace sequelize { /** * Get the value of the underlying data value */ - getDataValue(key: string): any; + getDataValue(key: keyof TAttributes): any; /** * Update the underlying data value */ - setDataValue(key: string, value: any): void; + setDataValue( + key: K, + value: TAttributes[K] + ): void; /** * If no key is given, returns all values of the instance, also invoking virtual getters. @@ -2834,7 +2837,7 @@ declare namespace sequelize { * * @param options.plain If set to true, included instances will be returned as plain objects */ - get(key: string, options?: { plain?: boolean, clone?: boolean }): any; + get(key: keyof TAttributes, options?: { plain?: boolean, clone?: boolean }): any; get(options?: { plain?: boolean, clone?: boolean }): TAttributes; /** @@ -2861,9 +2864,17 @@ declare namespace sequelize { * @param options.raw If set to true, field and virtual setters will be ignored * @param options.reset Clear all previously set data values */ - set(key: string, value: any, options?: InstanceSetOptions): this; + set( + key: K, + value: TAttributes[K], + options?: InstanceSetOptions + ): this; set(keys: Object, options?: InstanceSetOptions): this; - setAttributes(key: string, value: any, options?: InstanceSetOptions): this; + setAttributes( + key: K, + value: TAttributes[K], + options?: InstanceSetOptions + ): this; setAttributes(keys: Object, options?: InstanceSetOptions): this; /** @@ -2874,13 +2885,13 @@ declare namespace sequelize { * * If changed is called without an argument and no keys have changed, it will return `false`. */ - changed(key: string): boolean; + changed(key: keyof TAttributes): boolean; changed(): boolean | string[]; /** * Returns the previous value for key from `_previousDataValues`. */ - previous(key: string): any; + previous(key: keyof TAttributes): any; /** * Validate this instance, and if the validation passes, persist it to the database. @@ -2912,9 +2923,17 @@ declare namespace sequelize { /** * This is the same as calling `set` and then calling `save`. */ - update(key: string, value: any, options?: InstanceUpdateOptions): Promise; + update( + key: K, + value: TAttributes[K], + options?: InstanceUpdateOptions + ): Promise; update(keys: Object, options?: InstanceUpdateOptions): Promise; - updateAttributes(key: string, value: any, options?: InstanceUpdateOptions): Promise; + updateAttributes( + key: K, + value: TAttributes[K], + options?: InstanceUpdateOptions + ): Promise; updateAttributes(keys: Object, options?: InstanceUpdateOptions): Promise; /** @@ -2948,7 +2967,7 @@ declare namespace sequelize { * If an array is provided, the same is true for each column. * If and object is provided, each column is incremented by the value given. */ - increment(fields: string | string[] | Object, + increment(fields: Partial | Array | keyof TAttributes, options?: InstanceIncrementDecrementOptions): Promise; /** @@ -2971,7 +2990,7 @@ declare namespace sequelize { * If an array is provided, the same is true for each column. * If and object is provided, each column is decremented by the value given */ - decrement(fields: string | string[] | Object, + decrement(fields: Partial | Array | keyof TAttributes, options?: InstanceIncrementDecrementOptions): Promise; /** @@ -4050,7 +4069,7 @@ declare namespace sequelize { * elements. The first element is always the number of affected rows, while the second element is the actual * affected rows (only supported in postgres with `options.returning` true.) */ - update(values: TAttributes, options?: UpdateOptions): Promise<[number, TInstance[]]>; + update(values: Partial, options?: UpdateOptions): Promise<[number, TInstance[]]>; /** * Run a describe query on the table. The result will be return to the listener as a hash of attributes and From 89c307ca876427f1fb0659afca592bf086165a49 Mon Sep 17 00:00:00 2001 From: Lloyd Brookes Date: Thu, 3 May 2018 21:02:28 +0100 Subject: [PATCH 1049/2153] Updated types for command-line-args v5.0.2 (#24873) * Updated types for command-line-args v5.0.2 * command-line-args: create v4 sub-folder for previous major version * Re-able lint rules. Fix lint issues. --- .../command-line-args-tests.ts | 24 ++- types/command-line-args/index.d.ts | 155 +++++++++--------- types/command-line-args/tslint.json | 74 --------- .../v4/command-line-args-tests.ts | 21 +++ types/command-line-args/v4/index.d.ts | 73 +++++++++ types/command-line-args/v4/tsconfig.json | 26 +++ types/command-line-args/v4/tslint.json | 5 + 7 files changed, 223 insertions(+), 155 deletions(-) create mode 100644 types/command-line-args/v4/command-line-args-tests.ts create mode 100644 types/command-line-args/v4/index.d.ts create mode 100644 types/command-line-args/v4/tsconfig.json create mode 100644 types/command-line-args/v4/tslint.json diff --git a/types/command-line-args/command-line-args-tests.ts b/types/command-line-args/command-line-args-tests.ts index 11848ee202..89d310cb14 100644 --- a/types/command-line-args/command-line-args-tests.ts +++ b/types/command-line-args/command-line-args-tests.ts @@ -1,10 +1,24 @@ import commandLineArgs = require('command-line-args'); -const optionDefinitions = [ - { name: 'verbose', alias: 'v', type: Boolean }, - { name: 'src', type: String, multiple: true, defaultOption: true }, - { name: 'timeout', alias: 't', type: Number } +const optionDefinitions: commandLineArgs.OptionDefinition[] = [ + { + name: 'something', + alias: 's', + type: String, + defaultValue: '1', + multiple: true, + lazyMultiple: true, + defaultOption: true, + group: 'one' + } ]; -const options = commandLineArgs(optionDefinitions); +const options = commandLineArgs(optionDefinitions, { + argv: [ '--one', '1' ], + partial: true, + stopAtFirstUnknown: true, + camelCase: true +}); +const unknown = options._unknown; +const something = options.something; diff --git a/types/command-line-args/index.d.ts b/types/command-line-args/index.d.ts index 332368d827..5172a2f74a 100644 --- a/types/command-line-args/index.d.ts +++ b/types/command-line-args/index.d.ts @@ -1,87 +1,90 @@ -// Type definitions for command-line-args 4.0.7 +// Type definitions for command-line-args 5.0 // Project: https://github.com/75lb/command-line-args -// Definitions by: CzBuCHi +// Definitions by: Lloyd Brookes // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /** - * Returns an object containing all options set on the command line. By default it parses the global [`process.argv`](https://nodejs.org/api/process.html#process_process_argv) array. - * - * By default, an exception is thrown if the user sets an unknown option (one without a valid [definition](#exp_module_definition--OptionDefinition)). To enable __partial parsing__, invoke `commandLineArgs` with the `partial` option - all unknown arguments will be returned in the `_unknown` property. - * - * - * @param {module:definition[]} - An array of [OptionDefinition](#exp_module_definition--OptionDefinition) objects - * @param [options] {object} - Options. - * @param [options.argv] {string[]} - An array of strings, which if passed will be parsed instead of `process.argv`. - * @param [options.partial] {boolean} - If `true`, an array of unknown arguments is returned in the `_unknown` property of the output. - * @returns {object} - * @throws `UNKNOWN_OPTION` if `options.partial` is false and the user set an undefined option - * @throws `NAME_MISSING` if an option definition is missing the required `name` property - * @throws `INVALID_TYPE` if an option definition has a `type` value that's not a function - * @throws `INVALID_ALIAS` if an alias is numeric, a hyphen or a length other than 1 - * @throws `DUPLICATE_NAME` if an option definition name was used more than once - * @throws `DUPLICATE_ALIAS` if an option definition alias was used more than once - * @throws `DUPLICATE_DEFAULT_OPTION` if more than one option definition has `defaultOption: true` - * @alias module:command-line-args + * Returns an object containing option values parsed from the command line. By default it parses the global `process.argv` array. + * Parsing is strict by default. To be more permissive, enable `partial` or `stopAtFirstUnknown` modes. */ -declare function commandLineArgs(optionDefinitions: commandLineArgs.OptionDefinition[], options?: commandLineArgs.Options): any; +declare function commandLineArgs(optionDefinitions: commandLineArgs.OptionDefinition[], options?: commandLineArgs.ParseOptions): commandLineArgs.CommandLineOptions; -declare module commandLineArgs { +declare namespace commandLineArgs { + interface CommandLineOptions { + /** + * Command-line arguments not parsed by `commandLineArgs`. + */ + _unknown?: string[]; + [propName: string]: any; + } - export interface OptionDefinition { - /** - * The only required definition property is name, the value of each option will be either a Boolean or string. - */ - name: string, - /** - * The type value is a setter function (you receive the output from this), - * enabling you to be specific about the type and value received. - */ - type?: (arg: string) => any, - /** - * getopt-style short option names. Can be any single character (unicode included) except a digit or hypen. - */ - alias?: string, - /** - * Set this flag if the option takes a list of values. You will receive an array of values, each passed - * through the type function (if specified). - */ - multiple?: boolean, - /** - * Any unclaimed command-line args will be set on this option. This flag is typically set on - * the most commonly-used option to make for more concise usage - * (i.e. $ myapp *.js instead of $ myapp --files *.js). - */ - defaultOption?: boolean, - /** - * An initial value for the option. - */ - defaultValue?: any, - /** - * When your app has a large amount of options it makes sense to organise them in groups. - * There are two automatic groups: _all (contains all options) and _none (contains options - * without a group specified in their definition). - */ - group?: string | string[], - /** - * Describes the option. - */ - description?: string, - /** - * A label for the type, e.g. . - */ - typeLabel?: string; - } + interface ParseOptions { + /** + * An array of strings which if present will be parsed instead of `process.argv`. + */ + argv?: string[]; - export interface Options { - /** - * An array of strings, which if passed will be parsed instead of `process.argv`. - */ - argv?: string[]; - /** - * If `true`, an array of unknown arguments is returned in the `_unknown` property of the output. - */ - partial?: boolean; - } + /** + * If `true`, `commandLineArgs` will not throw on unknown options or values, instead returning them in the `_unknown` property of the output. + */ + partial?: boolean; + + /** + * If `true`, `commandLineArgs` will not throw on unknown options or values. Instead, parsing will stop at the first unknown argument + * and the remaining arguments returned in the `_unknown` property of the output. If set, `partial: true` is implied. + */ + stopAtFirstUnknown?: boolean; + + /** + * If `true`, options with hypenated names (e.g. `move-to`) will be returned in camel-case (e.g. `moveTo`). + */ + camelCase?: boolean; + } + + interface OptionDefinition { + /** + * The long option name. + */ + name: string; + + /** + * A setter function (you receive the output from this) enabling you to be specific about the type and value received. Typical values + * are `String` (the default), `Number` and `Boolean` but you can use a custom function. If no option value was set you will receive `null`. + */ + type?: (input: string) => any; + + /** + * A getopt-style short option name. Can be any single character except a digit or hyphen. + */ + alias?: string; + + /** + * Set this flag if the option accepts multiple values. In the output, you will receive an array of values each passed through the `type` function. + */ + multiple?: boolean; + + /** + * Identical to `multiple` but with greedy parsing disabled. + */ + lazyMultiple?: boolean; + + /** + * Any values unaccounted for by an option definition will be set on the `defaultOption`. This flag is typically set + * on the most commonly-used option to enable more concise usage. + */ + defaultOption?: boolean; + + /** + * An initial value for the option. + */ + defaultValue?: any; + + /** + * One or more group names the option belongs to. + */ + group?: string | string[]; + } } export = commandLineArgs; diff --git a/types/command-line-args/tslint.json b/types/command-line-args/tslint.json index a41bf5d19a..495d29983d 100644 --- a/types/command-line-args/tslint.json +++ b/types/command-line-args/tslint.json @@ -1,79 +1,5 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false } } diff --git a/types/command-line-args/v4/command-line-args-tests.ts b/types/command-line-args/v4/command-line-args-tests.ts new file mode 100644 index 0000000000..c99d64b1a2 --- /dev/null +++ b/types/command-line-args/v4/command-line-args-tests.ts @@ -0,0 +1,21 @@ +import commandLineArgs = require('command-line-args'); + +const optionDefinitions: commandLineArgs.OptionDefinition[] = [ + { + name: 'something', + alias: 's', + type: String, + defaultValue: '1', + multiple: true, + defaultOption: true, + group: 'one' + } +]; + +const options = commandLineArgs(optionDefinitions, { + argv: [ '--one', '1' ], + partial: true +}); + +const unknown = options._unknown; +const something = options.something; diff --git a/types/command-line-args/v4/index.d.ts b/types/command-line-args/v4/index.d.ts new file mode 100644 index 0000000000..a5c8250827 --- /dev/null +++ b/types/command-line-args/v4/index.d.ts @@ -0,0 +1,73 @@ +// Type definitions for command-line-args 4.0 +// Project: https://github.com/75lb/command-line-args +// Definitions by: CzBuCHi , Lloyd Brookes +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/** + * Returns an object containing option values parsed from the command line. By default it parses the global `process.argv` array. + */ +declare function commandLineArgs(optionDefinitions: commandLineArgs.OptionDefinition[], options?: commandLineArgs.ParseOptions): commandLineArgs.CommandLineOptions; + +declare namespace commandLineArgs { + interface CommandLineOptions { + /** + * Command-line arguments not parsed by `commandLineArgs`. + */ + _unknown?: string[]; + [propName: string]: any; + } + + interface ParseOptions { + /** + * An array of strings which if present will be parsed instead of `process.argv`. + */ + argv?: string[]; + + /** + * If `true`, `commandLineArgs` will not throw on unknown options or values, instead returning them in the `_unknown` property of the output. + */ + partial?: boolean; + } + + interface OptionDefinition { + /** + * The long option name. + */ + name: string; + + /** + * A setter function (you receive the output from this) enabling you to be specific about the type and value received. Typical values + * are `String` (the default), `Number` and `Boolean` but you can use a custom function. If no option value was set you will receive `null`. + */ + type?: (input: string) => any; + + /** + * A getopt-style short option name. Can be any single character except a digit or hyphen. + */ + alias?: string; + + /** + * Set this flag if the option accepts multiple values. In the output, you will receive an array of values each passed through the `type` function. + */ + multiple?: boolean; + + /** + * Any values unaccounted for by an option definition will be set on the `defaultOption`. This flag is typically set + * on the most commonly-used option to enable more concise usage. + */ + defaultOption?: boolean; + + /** + * An initial value for the option. + */ + defaultValue?: any; + + /** + * One or more group names the option belongs to. + */ + group?: string | string[]; + } +} + +export = commandLineArgs; diff --git a/types/command-line-args/v4/tsconfig.json b/types/command-line-args/v4/tsconfig.json new file mode 100644 index 0000000000..3517f0823e --- /dev/null +++ b/types/command-line-args/v4/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "command-line-args": [ "command-line-args/v4" ] + } + }, + "files": [ + "index.d.ts", + "command-line-args-tests.ts" + ] +} diff --git a/types/command-line-args/v4/tslint.json b/types/command-line-args/v4/tslint.json new file mode 100644 index 0000000000..495d29983d --- /dev/null +++ b/types/command-line-args/v4/tslint.json @@ -0,0 +1,5 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + } +} From 9c60961534286eb0a369dba401de2940d763585e Mon Sep 17 00:00:00 2001 From: Donald Hruska Date: Thu, 3 May 2018 15:56:05 -0500 Subject: [PATCH 1050/2153] Remove extraneous character in react-native types Remove extraneous `}` in `FlatList` `renderItem` definition --- types/react-native/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 3da848137d..756ef2b340 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -3700,7 +3700,7 @@ export interface FlatListProps extends VirtualizedListProps { * ``` * _renderItem = ({item}) => ( * this._onPress(item)}> - * {item.title}} + * {item.title} * * ); * ... From 1e7f4242377340083bb988f6cbc58869b603d44a Mon Sep 17 00:00:00 2001 From: AJ Richardson Date: Thu, 3 May 2018 21:22:50 -0400 Subject: [PATCH 1051/2153] lodash: improve omit/unset/mergeAll (#25361,#25365,#25382), fix partial --- types/lodash/common/common.d.ts | 3 + types/lodash/common/object.d.ts | 36 ++- types/lodash/fp.d.ts | 329 +++++++++++++++++++++++++--- types/lodash/lodash-tests.ts | 36 +-- types/lodash/scripts/generate-fp.ts | 35 ++- types/lowdb/_lodash.d.ts | 20 +- 6 files changed, 392 insertions(+), 67 deletions(-) diff --git a/types/lodash/common/common.d.ts b/types/lodash/common/common.d.ts index 28c4437073..b5da2a8080 100644 --- a/types/lodash/common/common.d.ts +++ b/types/lodash/common/common.d.ts @@ -217,6 +217,9 @@ declare module "../index" { type PropertyName = string | number | symbol; type PropertyPath = Many; + type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; + type Omit = Pick>; + /** Common interface between Arrays and jQuery objects */ type List = ArrayLike; diff --git a/types/lodash/common/object.d.ts b/types/lodash/common/object.d.ts index e0b1f3ebf1..5e2d539c23 100644 --- a/types/lodash/common/object.d.ts +++ b/types/lodash/common/object.d.ts @@ -2860,15 +2860,23 @@ declare module "../index" { */ omit( object: T | null | undefined, - ...paths: PropertyPath[] + ...paths: Array> ): T; + /** + * @see _.omit + */ + omit( + object: T | null | undefined, + ...paths: Array> + ): Omit; + /** * @see _.omit */ omit( object: T | null | undefined, - ...paths: PropertyPath[] + ...paths: Array> ): PartialObject; } @@ -2878,15 +2886,23 @@ declare module "../index" { */ omit( this: LoDashImplicitWrapper, - ...paths: PropertyPath[] + ...paths: Array> ): LoDashImplicitWrapper; + /** + * @see _.omit + */ + omit( + this: LoDashImplicitWrapper, + ...paths: Array> + ): LoDashImplicitWrapper>; + /** * @see _.omit */ omit( this: LoDashImplicitWrapper, - ...paths: PropertyPath[] + ...paths: Array> ): LoDashImplicitWrapper>; } @@ -2896,15 +2912,23 @@ declare module "../index" { */ omit( this: LoDashExplicitWrapper, - ...paths: PropertyPath[] + ...paths: Array> ): LoDashExplicitWrapper; + /** + * @see _.omit + */ + omit( + this: LoDashExplicitWrapper, + ...paths: Array> + ): LoDashExplicitWrapper>; + /** * @see _.omit */ omit( this: LoDashExplicitWrapper, - ...paths: PropertyPath[] + ...paths: Array> ): LoDashExplicitWrapper>; } diff --git a/types/lodash/fp.d.ts b/types/lodash/fp.d.ts index d577414aa4..da68ea250e 100644 --- a/types/lodash/fp.d.ts +++ b/types/lodash/fp.d.ts @@ -1,6 +1,6 @@ // AUTO-GENERATED: do not modify this file directly. // If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp +// npm install && npm run generate import lodash = require("./index"); @@ -60,7 +60,14 @@ declare namespace _ { } type LodashAssign1x1 = (source: TSource) => TObject & TSource; type LodashAssign1x2 = (object: TObject) => TObject & TSource; - type LodashAssignAll = (object: ReadonlyArray) => any; + interface LodashAssignAll { + (object: [TObject, TSource]): TObject & TSource; + (object: [TObject, TSource1, TSource2]): TObject & TSource1 & TSource2; + (object: [TObject, TSource1, TSource2, TSource3]): TObject & TSource1 & TSource2 & TSource3; + (object: [TObject, TSource1, TSource2, TSource3, TSource4]): TObject & TSource1 & TSource2 & TSource3 & TSource4; + (object: [TObject]): TObject; + (object: ReadonlyArray): any; + } interface LodashAssignAllWith { (customizer: lodash.AssignCustomizer): LodashAssignAllWith1x1; (customizer: lodash.__, args: ReadonlyArray): LodashAssignAllWith1x2; @@ -75,7 +82,14 @@ declare namespace _ { } type LodashAssignIn1x1 = (source: TSource) => TObject & TSource; type LodashAssignIn1x2 = (object: TObject) => TObject & TSource; - type LodashAssignInAll = (object: ReadonlyArray) => TResult; + interface LodashAssignInAll { + (object: [TObject, TSource]): TObject & TSource; + (object: [TObject, TSource1, TSource2]): TObject & TSource1 & TSource2; + (object: [TObject, TSource1, TSource2, TSource3]): TObject & TSource1 & TSource2 & TSource3; + (object: [TObject, TSource1, TSource2, TSource3, TSource4]): TObject & TSource1 & TSource2 & TSource3 & TSource4; + (object: [TObject]): TObject; + (object: ReadonlyArray): TResult; + } interface LodashAssignInAllWith { (customizer: lodash.AssignCustomizer): LodashAssignInAllWith1x1; (customizer: lodash.__, args: ReadonlyArray): LodashAssignInAllWith1x2; @@ -453,7 +467,14 @@ declare namespace _ { } type LodashDefaults1x1 = (object: TObject) => TSource & TObject; type LodashDefaults1x2 = (source: TSource) => TSource & TObject; - type LodashDefaultsAll = (object: ReadonlyArray) => any; + interface LodashDefaultsAll { + (object: [TObject, TSource]): TSource & TObject; + (object: [TObject, TSource1, TSource2]): TSource2 & TSource1 & TObject; + (object: [TObject, TSource1, TSource2, TSource3]): TSource3 & TSource2 & TSource1 & TObject; + (object: [TObject, TSource1, TSource2, TSource3, TSource4]): TSource4 & TSource3 & TSource2 & TSource1 & TObject; + (object: [TObject]): TObject; + (object: ReadonlyArray): any; + } interface LodashDefaultsDeep { (sources: any): LodashDefaultsDeep1x1; (sources: lodash.__, object: any): LodashDefaultsDeep1x2; @@ -546,11 +567,11 @@ declare namespace _ { type LodashDifferenceWith1x6 = (comparator: lodash.Comparator2) => T1[]; interface LodashUnset { (path: lodash.PropertyPath): LodashUnset1x1; - (path: lodash.__, object: any): LodashUnset1x2; - (path: lodash.PropertyPath, object: any): boolean; + (path: lodash.__, object: T): LodashUnset1x2; + (path: lodash.PropertyPath, object: T): T; } - type LodashUnset1x1 = (object: any) => boolean; - type LodashUnset1x2 = (path: lodash.PropertyPath) => boolean; + type LodashUnset1x1 = (object: T) => T; + type LodashUnset1x2 = (path: lodash.PropertyPath) => T; interface LodashDivide { (dividend: number): LodashDivide1x1; (dividend: lodash.__, divisor: number): LodashDivide1x2; @@ -704,7 +725,14 @@ declare namespace _ { } type LodashExtend1x1 = (source: TSource) => TObject & TSource; type LodashExtend1x2 = (object: TObject) => TObject & TSource; - type LodashExtendAll = (object: ReadonlyArray) => TResult; + interface LodashExtendAll { + (object: [TObject, TSource]): TObject & TSource; + (object: [TObject, TSource1, TSource2]): TObject & TSource1 & TSource2; + (object: [TObject, TSource1, TSource2, TSource3]): TObject & TSource1 & TSource2 & TSource3; + (object: [TObject, TSource1, TSource2, TSource3, TSource4]): TObject & TSource1 & TSource2 & TSource3 & TSource4; + (object: [TObject]): TObject; + (object: ReadonlyArray): TResult; + } interface LodashExtendAllWith { (customizer: lodash.AssignCustomizer): LodashExtendAllWith1x1; (customizer: lodash.__, args: ReadonlyArray): LodashExtendAllWith1x2; @@ -2171,7 +2199,13 @@ declare namespace _ { } type LodashMerge1x1 = (source: TSource) => TObject & TSource; type LodashMerge1x2 = (object: TObject) => TObject & TSource; - type LodashMergeAll = (object: ReadonlyArray) => any; + interface LodashMergeAll { + (object: [TObject, TSource]): TObject & TSource; + (object: [TObject, TSource1, TSource2]): TObject & TSource1 & TSource2; + (object: [TObject, TSource1, TSource2, TSource3]): TObject & TSource1 & TSource2 & TSource3; + (object: [TObject, TSource1, TSource2, TSource3, TSource4]): TObject & TSource1 & TSource2 & TSource3 & TSource4; + (object: ReadonlyArray): any; + } interface LodashMergeAllWith { (customizer: lodash.MergeWithCustomizer): LodashMergeAllWith1x1; (customizer: lodash.__, args: ReadonlyArray): LodashMergeAllWith1x2; @@ -2235,18 +2269,24 @@ declare namespace _ { type LodashNth1x2 = (n: number) => T | undefined; type LodashNthArg = (n: number) => (...args: any[]) => any; interface LodashOmit { - (paths: lodash.PropertyPath): LodashOmit1x1; + (paths: lodash.Many): LodashOmit1x1; (paths: lodash.__, object: T | null | undefined): LodashOmit1x2; - (paths: lodash.PropertyPath, object: T | null | undefined): T; + (paths: lodash.Many, object: T | null | undefined): T; + (paths: lodash.Many): LodashOmit2x1; (paths: lodash.__, object: T | null | undefined): LodashOmit2x2; - (paths: lodash.PropertyPath, object: T | null | undefined): lodash.PartialObject; + (paths: lodash.Many, object: T | null | undefined): lodash.Omit; + (paths: lodash.Many, object: T | null | undefined): lodash.PartialObject; } interface LodashOmit1x1 { (object: T | null | undefined): T; (object: T | null | undefined): lodash.PartialObject; } - type LodashOmit1x2 = (paths: lodash.PropertyPath) => T; - type LodashOmit2x2 = (paths: lodash.PropertyPath) => lodash.PartialObject; + type LodashOmit1x2 = (paths: lodash.Many) => T; + type LodashOmit2x1 = (object: T | null | undefined) => lodash.Omit; + interface LodashOmit2x2 { + (paths: lodash.Many): lodash.Omit; + (paths: lodash.Many): lodash.PartialObject; + } interface LodashOmitBy { (predicate: lodash.ValueKeyIteratee): LodashOmitBy1x1; (predicate: lodash.__, object: T | null | undefined): LodashOmitBy1x2; @@ -2435,21 +2475,252 @@ declare namespace _ { type LodashParseInt1x1 = (string: string) => number; type LodashParseInt1x2 = (radix: number) => number; interface LodashPartial { - (args: ReadonlyArray): LodashPartial1x1; - (args: lodash.__, func: (...args: any[]) => any): LodashPartial1x2; - (args: ReadonlyArray, func: (...args: any[]) => any): (...args: any[]) => any; + (func: lodash.Function1): LodashPartial1x1; + (func: lodash.__, arg1: [T1]): LodashPartial1x2; + (func: lodash.Function1, arg1: [T1]): lodash.Function0; + (func: lodash.Function2): LodashPartial2x1; + (func: lodash.Function2, arg1: [T1]): lodash.Function1< T2, R>; + (func: lodash.__, plc1: [lodash.__, T2]): LodashPartial3x2; + (func: lodash.Function2, plc1: [lodash.__, T2]): lodash.Function1; + (func: lodash.__, arg1: [T1, T2]): LodashPartial4x2; + (func: lodash.Function2, arg1: [T1, T2]): lodash.Function0< R>; + (func: lodash.Function3): LodashPartial5x1; + (func: lodash.Function3, arg1: [T1]): lodash.Function2< T2, T3, R>; + (func: lodash.Function3, plc1: [lodash.__, T2]): lodash.Function2; + (func: lodash.Function3, arg1: [T1, T2]): lodash.Function1< T3, R>; + (func: lodash.__, plc1: [lodash.__, lodash.__, T3]): LodashPartial8x2; + (func: lodash.Function3, plc1: [lodash.__, lodash.__, T3]): lodash.Function2; + (func: lodash.__, arg1: [T1, lodash.__, T3]): LodashPartial9x2; + (func: lodash.Function3, arg1: [T1, lodash.__, T3]): lodash.Function1< T2, R>; + (func: lodash.__, plc1: [lodash.__, T2, T3]): LodashPartial10x2; + (func: lodash.Function3, plc1: [lodash.__, T2, T3]): lodash.Function1; + (func: lodash.__, arg1: [T1, T2, T3]): LodashPartial11x2; + (func: lodash.Function3, arg1: [T1, T2, T3]): lodash.Function0< R>; + (func: lodash.Function4): LodashPartial12x1; + (func: lodash.Function4, arg1: [T1]): lodash.Function3< T2, T3, T4, R>; + (func: lodash.Function4, plc1: [lodash.__, T2]): lodash.Function3; + (func: lodash.Function4, arg1: [T1, T2]): lodash.Function2< T3, T4, R>; + (func: lodash.Function4, plc1: [lodash.__, lodash.__, T3]): lodash.Function3; + (func: lodash.Function4, arg1: [T1, lodash.__, T3]): lodash.Function2< T2, T4, R>; + (func: lodash.Function4, plc1: [lodash.__, T2, T3]): lodash.Function2; + (func: lodash.Function4, arg1: [T1, T2, T3]): lodash.Function1< T4, R>; + (func: lodash.__, plc1: [lodash.__, lodash.__, lodash.__, T4]): LodashPartial19x2; + (func: lodash.Function4, plc1: [lodash.__, lodash.__, lodash.__, T4]): lodash.Function3; + (func: lodash.__, arg1: [T1, lodash.__, lodash.__, T4]): LodashPartial20x2; + (func: lodash.Function4, arg1: [T1, lodash.__, lodash.__, T4]): lodash.Function2< T2, T3, R>; + (func: lodash.__, plc1: [lodash.__, T2, lodash.__, T4]): LodashPartial21x2; + (func: lodash.Function4, plc1: [lodash.__, T2, lodash.__, T4]): lodash.Function2; + (func: lodash.__, arg1: [T1, T2, lodash.__, T4]): LodashPartial22x2; + (func: lodash.Function4, arg1: [T1, T2, lodash.__, T4]): lodash.Function1< T3, R>; + (func: lodash.__, plc1: [lodash.__, lodash.__, T3, T4]): LodashPartial23x2; + (func: lodash.Function4, plc1: [lodash.__, lodash.__, T3, T4]): lodash.Function2; + (func: lodash.__, arg1: [T1, lodash.__, T3, T4]): LodashPartial24x2; + (func: lodash.Function4, arg1: [T1, lodash.__, T3, T4]): lodash.Function1< T2, R>; + (func: lodash.__, plc1: [lodash.__, T2, T3, T4]): LodashPartial25x2; + (func: lodash.Function4, plc1: [lodash.__, T2, T3, T4]): lodash.Function1; + (func: lodash.__, arg1: [T1, T2, T3, T4]): LodashPartial26x2; + (func: lodash.Function4, arg1: [T1, T2, T3, T4]): lodash.Function0< R>; + (func: (...args: any[]) => any): LodashPartial27x1; + (func: lodash.__, args: ReadonlyArray): LodashPartial27x2; + (func: (...args: any[]) => any, args: ReadonlyArray): (...args: any[]) => any; placeholder: lodash.__; } - type LodashPartial1x1 = (func: (...args: any[]) => any) => (...args: any[]) => any; - type LodashPartial1x2 = (args: ReadonlyArray) => (...args: any[]) => any; + type LodashPartial1x1 = (arg1: [T1]) => lodash.Function0; + interface LodashPartial1x2 { + (func: lodash.Function1): lodash.Function0; + (func: lodash.Function2): lodash.Function1< T2, R>; + (func: lodash.Function3): lodash.Function2< T2, T3, R>; + (func: lodash.Function4): lodash.Function3< T2, T3, T4, R>; + } + interface LodashPartial2x1 { + (arg1: [T1]): lodash.Function1< T2, R>; + (plc1: [lodash.__, T2]): lodash.Function1; + (arg1: [T1, T2]): lodash.Function0< R>; + } + interface LodashPartial3x2 { + (func: lodash.Function2): lodash.Function1; + (func: lodash.Function3): lodash.Function2; + (func: lodash.Function4): lodash.Function3; + } + interface LodashPartial4x2 { + (func: lodash.Function2): lodash.Function0< R>; + (func: lodash.Function3): lodash.Function1< T3, R>; + (func: lodash.Function4): lodash.Function2< T3, T4, R>; + } + interface LodashPartial5x1 { + (arg1: [T1]): lodash.Function2< T2, T3, R>; + (plc1: [lodash.__, T2]): lodash.Function2; + (arg1: [T1, T2]): lodash.Function1< T3, R>; + (plc1: [lodash.__, lodash.__, T3]): lodash.Function2; + (arg1: [T1, lodash.__, T3]): lodash.Function1< T2, R>; + (plc1: [lodash.__, T2, T3]): lodash.Function1; + (arg1: [T1, T2, T3]): lodash.Function0< R>; + } + interface LodashPartial8x2 { + (func: lodash.Function3): lodash.Function2; + (func: lodash.Function4): lodash.Function3; + } + interface LodashPartial9x2 { + (func: lodash.Function3): lodash.Function1< T2, R>; + (func: lodash.Function4): lodash.Function2< T2, T4, R>; + } + interface LodashPartial10x2 { + (func: lodash.Function3): lodash.Function1; + (func: lodash.Function4): lodash.Function2; + } + interface LodashPartial11x2 { + (func: lodash.Function3): lodash.Function0< R>; + (func: lodash.Function4): lodash.Function1< T4, R>; + } + interface LodashPartial12x1 { + (arg1: [T1]): lodash.Function3< T2, T3, T4, R>; + (plc1: [lodash.__, T2]): lodash.Function3; + (arg1: [T1, T2]): lodash.Function2< T3, T4, R>; + (plc1: [lodash.__, lodash.__, T3]): lodash.Function3; + (arg1: [T1, lodash.__, T3]): lodash.Function2< T2, T4, R>; + (plc1: [lodash.__, T2, T3]): lodash.Function2; + (arg1: [T1, T2, T3]): lodash.Function1< T4, R>; + (plc1: [lodash.__, lodash.__, lodash.__, T4]): lodash.Function3; + (arg1: [T1, lodash.__, lodash.__, T4]): lodash.Function2< T2, T3, R>; + (plc1: [lodash.__, T2, lodash.__, T4]): lodash.Function2; + (arg1: [T1, T2, lodash.__, T4]): lodash.Function1< T3, R>; + (plc1: [lodash.__, lodash.__, T3, T4]): lodash.Function2; + (arg1: [T1, lodash.__, T3, T4]): lodash.Function1< T2, R>; + (plc1: [lodash.__, T2, T3, T4]): lodash.Function1; + (arg1: [T1, T2, T3, T4]): lodash.Function0< R>; + } + type LodashPartial19x2 = (func: lodash.Function4) => lodash.Function3; + type LodashPartial20x2 = (func: lodash.Function4) => lodash.Function2< T2, T3, R>; + type LodashPartial21x2 = (func: lodash.Function4) => lodash.Function2; + type LodashPartial22x2 = (func: lodash.Function4) => lodash.Function1< T3, R>; + type LodashPartial23x2 = (func: lodash.Function4) => lodash.Function2; + type LodashPartial24x2 = (func: lodash.Function4) => lodash.Function1< T2, R>; + type LodashPartial25x2 = (func: lodash.Function4) => lodash.Function1; + type LodashPartial26x2 = (func: lodash.Function4) => lodash.Function0< R>; + type LodashPartial27x1 = (args: ReadonlyArray) => (...args: any[]) => any; + type LodashPartial27x2 = (func: (...args: any[]) => any) => (...args: any[]) => any; interface LodashPartialRight { - (args: ReadonlyArray): LodashPartialRight1x1; - (args: lodash.__, func: (...args: any[]) => any): LodashPartialRight1x2; - (args: ReadonlyArray, func: (...args: any[]) => any): (...args: any[]) => any; + (func: lodash.Function1): LodashPartialRight1x1; + (func: lodash.__, arg1: [T1]): LodashPartialRight1x2; + (func: lodash.Function1, arg1: [T1]): lodash.Function0; + (func: lodash.Function2): LodashPartialRight2x1; + (func: lodash.__, arg1: [T1, lodash.__]): LodashPartialRight2x2; + (func: lodash.Function2, arg1: [T1, lodash.__]): lodash.Function1< T2, R>; + (func: lodash.__, arg2: [T2]): LodashPartialRight3x2; + (func: lodash.Function2, arg2: [T2]): lodash.Function1; + (func: lodash.__, arg1: [T1, T2]): LodashPartialRight4x2; + (func: lodash.Function2, arg1: [T1, T2]): lodash.Function0< R>; + (func: lodash.Function3): LodashPartialRight5x1; + (func: lodash.__, arg1: [T1, lodash.__, lodash.__]): LodashPartialRight5x2; + (func: lodash.Function3, arg1: [T1, lodash.__, lodash.__]): lodash.Function2< T2, T3, R>; + (func: lodash.__, arg2: [T2, lodash.__]): LodashPartialRight6x2; + (func: lodash.Function3, arg2: [T2, lodash.__]): lodash.Function2; + (func: lodash.__, arg1: [T1, T2, lodash.__]): LodashPartialRight7x2; + (func: lodash.Function3, arg1: [T1, T2, lodash.__]): lodash.Function1< T3, R>; + (func: lodash.__, arg3: [T3]): LodashPartialRight8x2; + (func: lodash.Function3, arg3: [T3]): lodash.Function2; + (func: lodash.__, arg1: [T1, lodash.__, T3]): LodashPartialRight9x2; + (func: lodash.Function3, arg1: [T1, lodash.__, T3]): lodash.Function1< T2, R>; + (func: lodash.__, arg2: [T2, T3]): LodashPartialRight10x2; + (func: lodash.Function3, arg2: [T2, T3]): lodash.Function1; + (func: lodash.__, arg1: [T1, T2, T3]): LodashPartialRight11x2; + (func: lodash.Function3, arg1: [T1, T2, T3]): lodash.Function0< R>; + (func: lodash.Function4): LodashPartialRight12x1; + (func: lodash.__, arg1: [T1, lodash.__, lodash.__, lodash.__]): LodashPartialRight12x2; + (func: lodash.Function4, arg1: [T1, lodash.__, lodash.__, lodash.__]): lodash.Function3< T2, T3, T4, R>; + (func: lodash.__, arg2: [T2, lodash.__, lodash.__]): LodashPartialRight13x2; + (func: lodash.Function4, arg2: [T2, lodash.__, lodash.__]): lodash.Function3; + (func: lodash.__, arg1: [T1, T2, lodash.__, lodash.__]): LodashPartialRight14x2; + (func: lodash.Function4, arg1: [T1, T2, lodash.__, lodash.__]): lodash.Function2< T3, T4, R>; + (func: lodash.__, arg3: [T3, lodash.__]): LodashPartialRight15x2; + (func: lodash.Function4, arg3: [T3, lodash.__]): lodash.Function3; + (func: lodash.__, arg1: [T1, lodash.__, T3, lodash.__]): LodashPartialRight16x2; + (func: lodash.Function4, arg1: [T1, lodash.__, T3, lodash.__]): lodash.Function2< T2, T4, R>; + (func: lodash.__, arg2: [T2, T3, lodash.__]): LodashPartialRight17x2; + (func: lodash.Function4, arg2: [T2, T3, lodash.__]): lodash.Function2; + (func: lodash.__, arg1: [T1, T2, T3, lodash.__]): LodashPartialRight18x2; + (func: lodash.Function4, arg1: [T1, T2, T3, lodash.__]): lodash.Function1< T4, R>; + (func: lodash.__, arg4: [T4]): LodashPartialRight19x2; + (func: lodash.Function4, arg4: [T4]): lodash.Function3; + (func: lodash.__, arg1: [T1, lodash.__, lodash.__, T4]): LodashPartialRight20x2; + (func: lodash.Function4, arg1: [T1, lodash.__, lodash.__, T4]): lodash.Function2< T2, T3, R>; + (func: lodash.__, arg2: [T2, lodash.__, T4]): LodashPartialRight21x2; + (func: lodash.Function4, arg2: [T2, lodash.__, T4]): lodash.Function2; + (func: lodash.__, arg1: [T1, T2, lodash.__, T4]): LodashPartialRight22x2; + (func: lodash.Function4, arg1: [T1, T2, lodash.__, T4]): lodash.Function1< T3, R>; + (func: lodash.__, arg3: [T3, T4]): LodashPartialRight23x2; + (func: lodash.Function4, arg3: [T3, T4]): lodash.Function2; + (func: lodash.__, arg1: [T1, lodash.__, T3, T4]): LodashPartialRight24x2; + (func: lodash.Function4, arg1: [T1, lodash.__, T3, T4]): lodash.Function1< T2, R>; + (func: lodash.__, arg2: [T2, T3, T4]): LodashPartialRight25x2; + (func: lodash.Function4, arg2: [T2, T3, T4]): lodash.Function1; + (func: lodash.__, arg1: [T1, T2, T3, T4]): LodashPartialRight26x2; + (func: lodash.Function4, arg1: [T1, T2, T3, T4]): lodash.Function0< R>; + (func: (...args: any[]) => any): LodashPartialRight27x1; + (func: lodash.__, args: ReadonlyArray): LodashPartialRight27x2; + (func: (...args: any[]) => any, args: ReadonlyArray): (...args: any[]) => any; placeholder: lodash.__; } - type LodashPartialRight1x1 = (func: (...args: any[]) => any) => (...args: any[]) => any; - type LodashPartialRight1x2 = (args: ReadonlyArray) => (...args: any[]) => any; + type LodashPartialRight1x1 = (arg1: [T1]) => lodash.Function0; + type LodashPartialRight1x2 = (func: lodash.Function1) => lodash.Function0; + interface LodashPartialRight2x1 { + (arg1: [T1, lodash.__]): lodash.Function1< T2, R>; + (arg2: [T2]): lodash.Function1; + (arg1: [T1, T2]): lodash.Function0< R>; + } + type LodashPartialRight2x2 = (func: lodash.Function2) => lodash.Function1< T2, R>; + type LodashPartialRight3x2 = (func: lodash.Function2) => lodash.Function1; + type LodashPartialRight4x2 = (func: lodash.Function2) => lodash.Function0< R>; + interface LodashPartialRight5x1 { + (arg1: [T1, lodash.__, lodash.__]): lodash.Function2< T2, T3, R>; + (arg2: [T2, lodash.__]): lodash.Function2; + (arg1: [T1, T2, lodash.__]): lodash.Function1< T3, R>; + (arg3: [T3]): lodash.Function2; + (arg1: [T1, lodash.__, T3]): lodash.Function1< T2, R>; + (arg2: [T2, T3]): lodash.Function1; + (arg1: [T1, T2, T3]): lodash.Function0< R>; + } + type LodashPartialRight5x2 = (func: lodash.Function3) => lodash.Function2< T2, T3, R>; + type LodashPartialRight6x2 = (func: lodash.Function3) => lodash.Function2; + type LodashPartialRight7x2 = (func: lodash.Function3) => lodash.Function1< T3, R>; + type LodashPartialRight8x2 = (func: lodash.Function3) => lodash.Function2; + type LodashPartialRight9x2 = (func: lodash.Function3) => lodash.Function1< T2, R>; + type LodashPartialRight10x2 = (func: lodash.Function3) => lodash.Function1; + type LodashPartialRight11x2 = (func: lodash.Function3) => lodash.Function0< R>; + interface LodashPartialRight12x1 { + (arg1: [T1, lodash.__, lodash.__, lodash.__]): lodash.Function3< T2, T3, T4, R>; + (arg2: [T2, lodash.__, lodash.__]): lodash.Function3; + (arg1: [T1, T2, lodash.__, lodash.__]): lodash.Function2< T3, T4, R>; + (arg3: [T3, lodash.__]): lodash.Function3; + (arg1: [T1, lodash.__, T3, lodash.__]): lodash.Function2< T2, T4, R>; + (arg2: [T2, T3, lodash.__]): lodash.Function2; + (arg1: [T1, T2, T3, lodash.__]): lodash.Function1< T4, R>; + (arg4: [T4]): lodash.Function3; + (arg1: [T1, lodash.__, lodash.__, T4]): lodash.Function2< T2, T3, R>; + (arg2: [T2, lodash.__, T4]): lodash.Function2; + (arg1: [T1, T2, lodash.__, T4]): lodash.Function1< T3, R>; + (arg3: [T3, T4]): lodash.Function2; + (arg1: [T1, lodash.__, T3, T4]): lodash.Function1< T2, R>; + (arg2: [T2, T3, T4]): lodash.Function1; + (arg1: [T1, T2, T3, T4]): lodash.Function0< R>; + } + type LodashPartialRight12x2 = (func: lodash.Function4) => lodash.Function3< T2, T3, T4, R>; + type LodashPartialRight13x2 = (func: lodash.Function4) => lodash.Function3; + type LodashPartialRight14x2 = (func: lodash.Function4) => lodash.Function2< T3, T4, R>; + type LodashPartialRight15x2 = (func: lodash.Function4) => lodash.Function3; + type LodashPartialRight16x2 = (func: lodash.Function4) => lodash.Function2< T2, T4, R>; + type LodashPartialRight17x2 = (func: lodash.Function4) => lodash.Function2; + type LodashPartialRight18x2 = (func: lodash.Function4) => lodash.Function1< T4, R>; + type LodashPartialRight19x2 = (func: lodash.Function4) => lodash.Function3; + type LodashPartialRight20x2 = (func: lodash.Function4) => lodash.Function2< T2, T3, R>; + type LodashPartialRight21x2 = (func: lodash.Function4) => lodash.Function2; + type LodashPartialRight22x2 = (func: lodash.Function4) => lodash.Function1< T3, R>; + type LodashPartialRight23x2 = (func: lodash.Function4) => lodash.Function2; + type LodashPartialRight24x2 = (func: lodash.Function4) => lodash.Function1< T2, R>; + type LodashPartialRight25x2 = (func: lodash.Function4) => lodash.Function1; + type LodashPartialRight26x2 = (func: lodash.Function4) => lodash.Function0< R>; + type LodashPartialRight27x1 = (args: ReadonlyArray) => (...args: any[]) => any; + type LodashPartialRight27x2 = (func: (...args: any[]) => any) => (...args: any[]) => any; interface LodashPartition { (callback: lodash.ValueIteratee): LodashPartition1x1; (callback: lodash.__, collection: lodash.List | null | undefined): LodashPartition1x2; @@ -4055,7 +4326,13 @@ declare namespace _ { } type LodashZip1x1 = (arrays2: lodash.List) => Array<[T1 | undefined, T2 | undefined]>; type LodashZip1x2 = (arrays1: lodash.List) => Array<[T1 | undefined, T2 | undefined]>; - type LodashZipAll = (arrays: ReadonlyArray | null | undefined>) => Array>; + interface LodashZipAll { + (arrays1: [lodash.List, lodash.List]): Array<[T1 | undefined, T2 | undefined]>; + (arrays1: [lodash.List, lodash.List, lodash.List]): Array<[T1 | undefined, T2 | undefined, T3 | undefined]>; + (arrays1: [lodash.List, lodash.List, lodash.List, lodash.List]): Array<[T1 | undefined, T2 | undefined, T3 | undefined, T4 | undefined]>; + (arrays1: [lodash.List, lodash.List, lodash.List, lodash.List, lodash.List]): Array<[T1 | undefined, T2 | undefined, T3 | undefined, T4 | undefined, T5 | undefined]>; + (arrays: ReadonlyArray | null | undefined>): Array>; + } interface LodashZipObject { (props: lodash.List): LodashZipObject1x1; (props: lodash.__, values: lodash.List): LodashZipObject1x2; diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index fbb164c4c5..08dcd31639 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -5788,24 +5788,24 @@ fp.now(); // $ExpectType number const dictionary: _.Dictionary = anything; const numericDictionary: _.NumericDictionary = anything; - _.omit(obj, "a"); // $ExpectType Partial + _.omit(obj, "a"); // ExpectType Pick // NOTE: ExpectType disabled because it fails in TS2.4 _.omit(obj, ["b", 1], 0, "a"); // $ExpectType Partial _.omit(dictionary, "a"); // $ExpectType Dictionary _.omit(numericDictionary, "a"); // $ExpectType NumericDictionary - _(obj).omit("a"); // $ExpectType LoDashImplicitWrapper> + _(obj).omit("a"); // ExpectType LoDashImplicitWrapper> // NOTE: ExpectType disabled because it fails in TS2.4 _(obj).omit(["b", 1], 0, "a"); // $ExpectType LoDashImplicitWrapper> _(dictionary).omit("a"); // $ExpectType LoDashImplicitWrapper> _(numericDictionary).omit("a"); // $ExpectType LoDashImplicitWrapper> - _.chain(obj).omit("a"); // $ExpectType LoDashExplicitWrapper> + _.chain(obj).omit("a"); // ExpectType LoDashExplicitWrapper> // NOTE: ExpectType disabled because it fails in TS2.4 _.chain(obj).omit(["b", 1], 0, "a"); // $ExpectType LoDashExplicitWrapper> _.chain(dictionary).omit("a"); // $ExpectType LoDashExplicitWrapper> _.chain(numericDictionary).omit("a"); // $ExpectType LoDashExplicitWrapper> - fp.omit("a", obj); // $ExpectType Partial - fp.omit("a")(obj); // $ExpectType Partial - fp.omit(["a", "b"])(obj); // $ExpectType Partial + fp.omit("a", obj); // ExpectType Pick // NOTE: ExpectType disabled because it fails in TS2.4 + fp.omit("a")(obj); // ExpectType Pick // NOTE: ExpectType disabled because it fails in TS2.3 + fp.omit(["a", "b"])(obj); // ExpectType Pick // NOTE: ExpectType disabled because it fails in TS2.3 } // _.omitBy @@ -5825,7 +5825,7 @@ fp.now(); // $ExpectType number const obj1: AbcObject | null | undefined = anything; const obj2: AbcObject = anything; const readonlyArray: string[] = ["a", "b"]; // TODO: Should be ReadonlyArray, but see comment on type Many - const literalsArray = ["a" as "a", "b" as "b"]; + const literalsArray: Array<"a" | "b"> = ["a", "b"]; const roLiteralsArray: Array<"a" | "b"> = literalsArray; // TODO: Should be ReadonlyArray, but see comment on type Many _.pick(obj1, "a"); // $ExpectType PartialDeep @@ -5857,7 +5857,7 @@ fp.now(); // $ExpectType number fp.pick("a", obj2); // $ExpectType Pick fp.pick("a")(obj2); // $ExpectType Pick - fp.pick(["a" as "a", "b" as "b"])(obj2); // $ExpectType Pick + fp.pick(literalsArray)(obj2); // $ExpectType Pick } // _.pickBy @@ -6060,9 +6060,10 @@ fp.now(); // $ExpectType number _(object).unset(["a", "b"]); // $ExpectType LoDashImplicitWrapper _.chain(object).unset("a.b"); // $ExpectType LoDashExplicitWrapper _.chain(object).unset(["a", "b"]); // $ExpectType LoDashExplicitWrapper - fp.unset("a.b", object); // $ExpectType boolean - fp.unset("a.b")(object); // $ExpectType boolean - fp.unset(["a", "b"])(object); // $ExpectType boolean + + fp.unset("a.b", object); // $ExpectType { a: { b: string; c: boolean; }; } + fp.unset("a.b")(object); // $ExpectType { a: { b: string; c: boolean; }; } + fp.unset(["a", "b"])(object); // $ExpectType { a: { b: string; c: boolean; }; } } // _.update @@ -7251,11 +7252,10 @@ _.templateSettings; // $ExpectType TemplateSettings // with arity 3 function _.partialRight(func3, 42, _, true); - fp.partial([], func0); // $ExpectType (...args: any[]) => any - fp.partial([])(func0); // $ExpectType (...args: any[]) => any - fp.partial([42])(func1); // $ExpectType (...args: any[]) => any - fp.partial([fp.partial.placeholder, "foo"])(func2); - fp.partialRight([])(func0); // $ExpectType (...args: any[]) => any - fp.partialRight([42])(func1); // $ExpectType (...args: any[]) => any - fp.partialRight([fp.partialRight.placeholder, "foo"])(func2); + fp.partial(func1, [42]); // $ExpectType Function0 + fp.partial(func1)([42]); // $ExpectType Function0 + fp.partial(func2)([fp.partial.placeholder, "foo"]); // $ExpectType Function1 + fp.partialRight(func1, [42]); // $ExpectType Function0 + fp.partialRight(func1)([42]); // $ExpectType Function0 + fp.partialRight(func2)([42, fp.partialRight.placeholder]); // $ExpectType Function1 } diff --git a/types/lodash/scripts/generate-fp.ts b/types/lodash/scripts/generate-fp.ts index 77f11b46ac..9a03fef544 100644 --- a/types/lodash/scripts/generate-fp.ts +++ b/types/lodash/scripts/generate-fp.ts @@ -174,15 +174,14 @@ async function processDefinitions(filePaths: string[], commonTypes: string[]): P } else if (args.length > 4 || definition.name === "flow" || definition.name === "flowRight") { // Arity wasn't fixed by convert() isFixed = false; - } else { - // For some reason, convert() doesn't seems to tell us which functions have unchanged argument order. - // So we have to hard-code it. - const unchangedOrders = ["add", "assign", "assignIn", "bind", "bindKey", "concat", "difference", "divide", "eq", - "gt", "gte", "isEqual", "lt", "lte", "matchesProperty", "merge", "multiply", "overArgs", "partial", "partialRight", - "propertyOf", "random", "range", "rangeRight", "subtract", "zip", "zipObject", "zipObjectDeep"]; - if (unchangedOrders.includes(definition.name)) - args = _.sortBy(args as number[][], (a: number[]) => a[0]); } + // For some reason, convert() doesn't seems to tell us which functions have unchanged argument order. + // So we have to hard-code it. + const unchangedOrders = ["add", "assign", "assignIn", "bind", "bindKey", "concat", "difference", "divide", "eq", + "gt", "gte", "isEqual", "lt", "lte", "matchesProperty", "merge", "multiply", "overArgs", "partial", "partialRight", + "propertyOf", "random", "range", "rangeRight", "subtract", "zip", "zipObject", "zipObjectDeep"]; + if (unchangedOrders.includes(definition.name)) + args = _.sortBy(args, a => typeof a === "number" ? a : a[0]); return () => curryDefinition(definition, _.flatten(args), spreadIndex, isFixed); }; @@ -324,6 +323,12 @@ function parseDefinitions(definitionString: string, startIndex: number, endIndex .map(o => _.trim(o, ",")) .filter(o => !!o); overload.returnType = overloadString.substring(paramEndIndex + 2).trim(); + // Special case for unset: the return type should be the input type, not bolean. See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/25361 + if (name === "unset") { + overload.typeParams = [{ name: "T" }]; + overload.params[0] = overload.params[0].replace(/\bany\b/, "T"); + overload.returnType = "T"; + } currentDefinition.overloads.push(overload); } else { // This overload actually points to an interface. Try to find said interface and get the overloads from there. @@ -433,25 +438,33 @@ function curryDefinition(definition: Definition, paramOrder: number[], spreadInd // Spread/rest parameters could be in any of the following formats: // 1. The rest parameter is at spreadIndex, and it is the last parameter. // 2. The rest parameter is immediately after spreadIndex, e.g. assign(object, ...sources[]). In this case, convert it to assignAll(...object[]) - // 3. The rest parameter is not the last parameter, e.g. assignWith(object, ...sources[], customizer) + // 3. The overload defines no rest parameters, e.g. mergeAll(T1, T2, T3) + // 4. The rest parameter is not the last parameter, e.g. assignWith(object, ...sources[], customizer) if (spreadIndex === arity - 1) { - // cases 1-2 for (let i = 0; i < overloads.length; ++i) { const overload = overloads[i]; if (overload.params.length === arity && overload.params[spreadIndex] && overload.params[spreadIndex].startsWith("...")) { + // case 1 overload.params[spreadIndex] = overload.params[spreadIndex].replace("...", ""); } else if (overload.params.length === arity + 1 && overload.params[spreadIndex + 1] && overload.params[spreadIndex + 1].startsWith("...")) { + // case 2 overload.params.splice(spreadIndex + 1, 1); const parts = overload.params[spreadIndex].split(":").map(_.trim); parts[1] = `ReadonlyArray<${parts[1]}>`; overload.params[spreadIndex] = `${parts[0]}: ${parts[1]}`; + } else if (overload.params.length >= arity && overload.params[spreadIndex] && !overload.params.some(p => p.startsWith("..."))) { + // case 3 + const paramName = getParamName(overload.params[spreadIndex]); + const spreadParamTypes = overload.params.slice(spreadIndex).map(getParamType); + overload.params = overload.params.slice(0, spreadIndex); + overload.params.push(`${paramName}: [${spreadParamTypes.join(", ")}]`); } else { _.pull(overloads, overload); --i; } } } else { - // case 3 + // case 4 const overload = overloads[0]; overloads = [{ jsdoc: overload.jsdoc, diff --git a/types/lowdb/_lodash.d.ts b/types/lowdb/_lodash.d.ts index 78ff4901af..982826fe5b 100644 --- a/types/lowdb/_lodash.d.ts +++ b/types/lowdb/_lodash.d.ts @@ -127,7 +127,7 @@ declare module "./index" { first(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; flatten(this: LoDashExplicitSyncWrapper<_.List<_.Many> | null | undefined>): LoDashExplicitSyncWrapper; flattenDeep(this: LoDashExplicitSyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>): LoDashExplicitSyncWrapper; - flattenDepth(this: LoDashExplicitSyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>, depth?: number): LoDashExplicitSyncWrapper; + flattenDepth(this: LoDashExplicitSyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>, depth?: number): LoDashExplicitSyncWrapper; fromPairs( this: LoDashExplicitSyncWrapper<_.List<[_.PropertyName, T]> | null | undefined> ): LoDashExplicitSyncWrapper<_.Dictionary>; @@ -1263,11 +1263,15 @@ declare module "./index" { ): LoDashExplicitSyncWrapper; omit( this: LoDashExplicitSyncWrapper, - ...paths: _.PropertyPath[] + ...paths: Array<_.Many<_.PropertyName>> ): LoDashExplicitSyncWrapper; + omit( + this: LoDashExplicitSyncWrapper, + ...paths: Array<_.Many> + ): LoDashExplicitSyncWrapper<_.Omit>; omit( this: LoDashExplicitSyncWrapper, - ...paths: _.PropertyPath[] + ...paths: Array<_.Many<_.PropertyName>> ): LoDashExplicitSyncWrapper<_.PartialObject>; omitBy( this: LoDashExplicitSyncWrapper, @@ -1691,7 +1695,7 @@ declare module "./index" { first(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; flatten(this: LoDashExplicitAsyncWrapper<_.List<_.Many> | null | undefined>): LoDashExplicitAsyncWrapper; flattenDeep(this: LoDashExplicitAsyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>): LoDashExplicitAsyncWrapper; - flattenDepth(this: LoDashExplicitAsyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>, depth?: number): LoDashExplicitAsyncWrapper; + flattenDepth(this: LoDashExplicitAsyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>, depth?: number): LoDashExplicitAsyncWrapper; fromPairs( this: LoDashExplicitAsyncWrapper<_.List<[_.PropertyName, T]> | null | undefined> ): LoDashExplicitAsyncWrapper<_.Dictionary>; @@ -2827,11 +2831,15 @@ declare module "./index" { ): LoDashExplicitAsyncWrapper; omit( this: LoDashExplicitAsyncWrapper, - ...paths: _.PropertyPath[] + ...paths: Array<_.Many<_.PropertyName>> ): LoDashExplicitAsyncWrapper; + omit( + this: LoDashExplicitAsyncWrapper, + ...paths: Array<_.Many> + ): LoDashExplicitAsyncWrapper<_.Omit>; omit( this: LoDashExplicitAsyncWrapper, - ...paths: _.PropertyPath[] + ...paths: Array<_.Many<_.PropertyName>> ): LoDashExplicitAsyncWrapper<_.PartialObject>; omitBy( this: LoDashExplicitAsyncWrapper, From 32050c38149f3f323f34c7c1219d0abda7fc6aa2 Mon Sep 17 00:00:00 2001 From: akizimov Date: Fri, 4 May 2018 15:43:28 +0300 Subject: [PATCH 1052/2153] redux-testkit defines --- types/redux-testkit/index.d.ts | 96 ++++++++-------------- types/redux-testkit/package.json | 7 ++ types/redux-testkit/redux-testkit-tests.ts | 35 ++++---- types/redux-testkit/tsconfig.json | 1 + 4 files changed, 61 insertions(+), 78 deletions(-) create mode 100644 types/redux-testkit/package.json diff --git a/types/redux-testkit/index.d.ts b/types/redux-testkit/index.d.ts index 0e9dc4ff74..daf8c2af43 100644 --- a/types/redux-testkit/index.d.ts +++ b/types/redux-testkit/index.d.ts @@ -2,68 +2,44 @@ // Project: https://github.com/wix/redux-testkit#readme // Definitions by: Andrey Kizimov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import * as Redux from 'redux'; +import { ThunkAction } from 'redux-thunk'; -//----------------------------------------------------------------------- +export function Reducer(action: Redux.Reducer): { + withState(state: any): { + expect: (action: Redux.Action) => { + toReturnState(expected: any): any, + toStayTheSame(): any; + toChangeInState(expectedChanges: any): any; + }, + execute(action: Redux.Action): any; + }; -interface ReducerMainCommands { - expect(action: Redux.AnyAction): InternalReducerCommands; - execute(action: Redux.AnyAction): any; + expect: (action: Redux.Action) => { + toReturnState(expected: any): any, + toStayTheSame(): any; + toChangeInState(expectedChanges: any): any; + }; + execute(action: Redux.Action): any; +}; + +export function Selector(selector: (state: any, action: any) => any): { + expect(state: any, ...args: any[]): any; + execute(state: any, ...args: any[]): any; +}; + +export function Thunk(thunkFunc: ThunkAction, extraArg?: any): { + execute(...args: any[]): any; + withState(state: any): { + execute(...args: any[]): any; + } +}; + +export namespace FlushThunks { + function createMiddleware(): { + flush(): any; + reset(): any; + }; } - -interface InternalReducerCommands { - toReturnState(expected: Redux.AnyAction): any; - toStayTheSame(): any; - toChangeInState(expectedChanges: any): any; -} - -interface ReducerAction extends ReducerMainCommands { - withState(state: any): ReducerMainCommands; -} - -//----------------------------------------------------------------------- - -interface SelectorExpect { - toReturn(expected: any): any; -} -interface SelectorAction { - expect(state: any, ...arg: any[]): SelectorExpect; - execute(state: any, ...arg: any[]): any; -} - -//----------------------------------------------------------------------- - -interface DispatchObject { - isFunction(): boolean, - isPlainObject(): boolean, - getType(): any, - getAction(): any, - getName(): any -} - -interface ThunkMainCommands { - execute(...arg: any[]): DispatchObject[]; -} - -interface ThunkAction extends ThunkMainCommands { - withState(state: any): ThunkMainCommands; -} - -//----------------------------------------------------------------------- - -interface FlushThunksMiddleware { - flush(): void; - reset(): void; -} - -export class FlushThunks { - static createMiddleware(): FlushThunksMiddleware; -} - -//----------------------------------------------------------------------- - -export function Reducer(action: Redux.Reducer): ReducerAction; -export function Selector(action: Redux.Reducer): SelectorAction; -export function Thunk(action: Redux.Reducer): ThunkAction; - diff --git a/types/redux-testkit/package.json b/types/redux-testkit/package.json new file mode 100644 index 0000000000..f682c6113f --- /dev/null +++ b/types/redux-testkit/package.json @@ -0,0 +1,7 @@ +{ + "private": true, + "dependencies": { + "redux": "^3.6.0", + "redux-thunk": "^2.2.0" + } +} diff --git a/types/redux-testkit/redux-testkit-tests.ts b/types/redux-testkit/redux-testkit-tests.ts index 3e0fa7b1be..efbab291dc 100644 --- a/types/redux-testkit/redux-testkit-tests.ts +++ b/types/redux-testkit/redux-testkit-tests.ts @@ -1,5 +1,5 @@ -import {Reducer, Selector, FlushThunks, Thunk} from 'redux-testkit'; -import {Action, Dispatch} from 'redux'; +import { Reducer, Selector, FlushThunks, Thunk } from 'redux-testkit'; +import { Action, Dispatch } from 'redux'; interface SimpleState { currentState: string; @@ -8,11 +8,8 @@ interface SimpleState { const TO_FINISH_STATE = 'TO_FINISH_STATE'; const TO_INITIAL_STATE = 'TO_INITIAL_STATE'; - -enum NumberType { - ODD = 'ODD', - EVEN = 'EVEN' -} +const ODD_NUMBERS = 'ODD_NUMBERS'; +const EVEN_NUMBERS = 'EVEN_NUMBERS'; const simpleState: SimpleState = { currentState: "initial", @@ -23,21 +20,23 @@ const simpleAction = (state: SimpleState = simpleState, action: Action): SimpleS if (action.type === TO_FINISH_STATE) { return {...state, currentState: 'finish'}; } - else if (action.type === TO_INITIAL_STATE) { + + if (action.type === TO_INITIAL_STATE) { return {...state, currentState: 'initial'}; } return state; }; -const getNumbers = (state: SimpleState = simpleState, type: NumberType = NumberType.EVEN): number[] => { +const getNumbers = (state: SimpleState = simpleState, type: string): number[] => { return state.numbers.filter(element => { const division = element % 2; - if (division === 0 && type === NumberType.EVEN) { + if (division === 0 && type === ODD_NUMBERS) { return element; } - else if (division !== 0 && type === NumberType.ODD) { + + if (division !== 0 && type === EVEN_NUMBERS) { return element; } }); @@ -52,9 +51,9 @@ const thunkAction2: Action = { }; const thunk = () => { - return function (dispatch: Dispatch) { - dispatch({ thunkAction1 }); - dispatch({ thunkAction2 }); + return (dispatch: Dispatch): void => { + dispatch(thunkAction1); + dispatch(thunkAction2); }; }; @@ -62,8 +61,8 @@ Reducer(simpleAction).expect({ type: 'WRONG_TYPE' }).toStayTheSame(); Reducer(simpleAction).withState(simpleState).expect({ type: TO_FINISH_STATE }).toChangeInState({ currentState: 'finish' }); Reducer(simpleAction).expect({ type: TO_INITIAL_STATE }).toReturnState(simpleState); -Selector(getNumbers).expect(simpleState, NumberType.EVEN).toReturn([2, 4, 6, 8]); +Selector(getNumbers).expect(simpleState, EVEN_NUMBERS).toReturn([2, 4, 6, 8]); +Selector(getNumbers).execute(simpleState, ODD_NUMBERS); -const odd = Selector(getNumbers).execute(simpleState, NumberType.ODD); - -const dispatches = Thunk(thunk).execute(); +Thunk(thunk).execute(); +Thunk(thunk).withState(simpleState).execute(); diff --git a/types/redux-testkit/tsconfig.json b/types/redux-testkit/tsconfig.json index be52e915a3..82c91d335a 100644 --- a/types/redux-testkit/tsconfig.json +++ b/types/redux-testkit/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" From ecbd9b2da8a90b2791c90bae81e3588ee9e1b3de Mon Sep 17 00:00:00 2001 From: akizimov Date: Fri, 4 May 2018 16:54:10 +0300 Subject: [PATCH 1053/2153] redux-testkit defines --- types/redux-testkit/index.d.ts | 44 +++++++++++----------- types/redux-testkit/redux-testkit-tests.ts | 24 ++++++++++-- 2 files changed, 41 insertions(+), 27 deletions(-) diff --git a/types/redux-testkit/index.d.ts b/types/redux-testkit/index.d.ts index daf8c2af43..47aa006cd2 100644 --- a/types/redux-testkit/index.d.ts +++ b/types/redux-testkit/index.d.ts @@ -7,39 +7,37 @@ import * as Redux from 'redux'; import { ThunkAction } from 'redux-thunk'; -export function Reducer(action: Redux.Reducer): { - withState(state: any): { - expect: (action: Redux.Action) => { - toReturnState(expected: any): any, - toStayTheSame(): any; - toChangeInState(expectedChanges: any): any; - }, - execute(action: Redux.Action): any; - }; - +export interface ReducerTestkit { expect: (action: Redux.Action) => { - toReturnState(expected: any): any, - toStayTheSame(): any; - toChangeInState(expectedChanges: any): any; + toReturnState(expected: any): void, + toStayTheSame(): void; + toChangeInState(expectedChanges: any): void; }; - execute(action: Redux.Action): any; + execute(action: Redux.Action): any; // state +} + +export interface ThunkTestkit { + execute(...args: any[]): any; +} + +export function Reducer(action: Redux.Reducer): ReducerTestkit & { + withState(state: any): ReducerTestkit; }; export function Selector(selector: (state: any, action: any) => any): { - expect(state: any, ...args: any[]): any; + expect(state: any, ...args: any[]): { + toReturn(expected: any): void; + }; execute(state: any, ...args: any[]): any; }; -export function Thunk(thunkFunc: ThunkAction, extraArg?: any): { - execute(...args: any[]): any; - withState(state: any): { - execute(...args: any[]): any; - } +export function Thunk(thunkFunc: ThunkAction, extraArg?: any): ThunkTestkit & { + withState(state: any): ThunkTestkit; }; export namespace FlushThunks { - function createMiddleware(): { - flush(): any; - reset(): any; + function createMiddleware(): Redux.Middleware & { + flush(): void; + reset(): void; }; } diff --git a/types/redux-testkit/redux-testkit-tests.ts b/types/redux-testkit/redux-testkit-tests.ts index efbab291dc..2fdbf14856 100644 --- a/types/redux-testkit/redux-testkit-tests.ts +++ b/types/redux-testkit/redux-testkit-tests.ts @@ -1,5 +1,6 @@ import { Reducer, Selector, FlushThunks, Thunk } from 'redux-testkit'; -import { Action, Dispatch } from 'redux'; +import { Action, Dispatch, createStore, applyMiddleware } from 'redux'; +import thunk from 'redux-thunk'; interface SimpleState { currentState: string; @@ -42,6 +43,14 @@ const getNumbers = (state: SimpleState = simpleState, type: string): number[] => }); }; +const reducer = (state = { count: 0 }, action: Action): any => { + if (action.type === 'count') { + state.count++; + } + + return state; +}; + const thunkAction1: Action = { type: TO_FINISH_STATE }; @@ -50,7 +59,7 @@ const thunkAction2: Action = { type: TO_INITIAL_STATE }; -const thunk = () => { +const thunkAction = () => { return (dispatch: Dispatch): void => { dispatch(thunkAction1); dispatch(thunkAction2); @@ -64,5 +73,12 @@ Reducer(simpleAction).expect({ type: TO_INITIAL_STATE }).toReturnState(simpleSta Selector(getNumbers).expect(simpleState, EVEN_NUMBERS).toReturn([2, 4, 6, 8]); Selector(getNumbers).execute(simpleState, ODD_NUMBERS); -Thunk(thunk).execute(); -Thunk(thunk).withState(simpleState).execute(); +Thunk(thunkAction).execute(); +Thunk(thunkAction).withState(simpleState).execute(); + +const flushThunks = FlushThunks.createMiddleware(); + +const store = createStore(reducer, applyMiddleware(flushThunks, thunk)); + +flushThunks.flush(); +flushThunks.reset(); From b94b775e93d30f94ff0b13ecb14f97823d7aa2b7 Mon Sep 17 00:00:00 2001 From: Thanh Ngo Date: Fri, 4 May 2018 11:01:42 -0400 Subject: [PATCH 1054/2153] [idyll] add type declaration for idyll (#25454) * add type declaration for idyll * incorrect export: expected a function export --- types/idyll/idyll-tests.ts | 7 ++ types/idyll/index.d.ts | 130 +++++++++++++++++++++++++++++++++++++ types/idyll/tsconfig.json | 16 +++++ types/idyll/tslint.json | 3 + 4 files changed, 156 insertions(+) create mode 100644 types/idyll/idyll-tests.ts create mode 100644 types/idyll/index.d.ts create mode 100644 types/idyll/tsconfig.json create mode 100644 types/idyll/tslint.json diff --git a/types/idyll/idyll-tests.ts b/types/idyll/idyll-tests.ts new file mode 100644 index 0000000000..3f4b90c18c --- /dev/null +++ b/types/idyll/idyll-tests.ts @@ -0,0 +1,7 @@ +import idyll = require("idyll"); + +// $ExpectType IdyllInstance +idyll({ + watch: true, + datasets: "." +}); diff --git a/types/idyll/index.d.ts b/types/idyll/index.d.ts new file mode 100644 index 0000000000..a2f1846a7a --- /dev/null +++ b/types/idyll/index.d.ts @@ -0,0 +1,130 @@ +// Type definitions for idyll 2.10 +// Project: https://github.com/idyll-lang/idyll/tree/master/packages/idyll-cli +// Definitions by: Thanh Ngo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { EventEmitter } from "events"; +import { Options as CompilerOptions } from "idyll-compiler"; + +interface Options { + /** + * Monitor input files and rebuild on changes + */ + watch?: boolean; + /** + * The datasets directory + */ + datasets?: string; + /** + * Whether to minify output build + */ + minify?: boolean; + /** + * + * Pre-render HTML as part of the build + */ + ssr?: boolean; + /** + * The components directory + */ + components?: boolean; + /** + * The default component directory + * This corresponds to where the idyll-components package stays + */ + defaultComponents?: boolean; + /** + * The layout defined in idyll-layouts package + */ + layout?: string; + /** + * The theme defined in idyll-theme package + */ + theme?: string; + /** + * The output directory for compiled documents + */ + output?: string; + /** + * Custom port to bind the local server to. + */ + port?: number; + /** + * Temporary directory used by idyll + */ + temp?: string; + /** + * path to HTML template + * + */ + template?: string; + + /** + * Custom CSS file to include in output + */ + css?: string; + /** + * Custom browserify transforms to apply. + */ + transform?: string[]; + /** + * Compiler options + */ + compiler?: CompilerOptions; + /** + * the idyll file to be compiled into + */ + inputFile?: string; + + /** + * used internally by IdyllInstance + */ + inputConfig?: { + components: any; + transform: any[]; + compiler: CompilerOptions; + }; +} + +type PredefinedFile = + | "APP_PATH" + | "CSS_INPUT_FILE" + | "DATA_DIR" + | "HTML_TEMPLATE_FILE" + | "IDYLL_INPUT_FILE" + | "INPUT_DIR" + | "PACKAGE_FILE" + | "OUTPUT_DIR" + | "TMP_DIR" + | "CSS_OUTPUT_FILE" + | "HTML_OUTPUT_FILE" + | "JS_OUTPUT_FILE"; + +type ComponentFiles = "COMPONENT_DIRS" | "DEFAULT_COMPONENT_DIRS"; + +type Paths = Record & Record; + +declare class IdyllInstance extends EventEmitter { + /** + * Returns internal paths used by idyll-cli + */ + getPaths(): Paths; + /** + * Returns idyll compiling's options + */ + getOptions(): Options; + /** + * + * if indexIdyllMarkup is provided, compiles it + * + * Otherwise, compiles and optionally watches + * the idyll file at IOptions.inputFile + * + */ + build(indexIdyllMarkup?: string | null): this; +} + +declare function idyll(options: Options, callback?: () => void): IdyllInstance; + +export = idyll; diff --git a/types/idyll/tsconfig.json b/types/idyll/tsconfig.json new file mode 100644 index 0000000000..6e24200367 --- /dev/null +++ b/types/idyll/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": ["index.d.ts", "idyll-tests.ts"] +} diff --git a/types/idyll/tslint.json b/types/idyll/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/idyll/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From b44bc3fe3e8fcf087f338961e3e866a8f2e7b0a1 Mon Sep 17 00:00:00 2001 From: Sean Kelley Date: Fri, 4 May 2018 09:15:48 -0700 Subject: [PATCH 1055/2153] Update shallowequal exports to allow '* as' imports. (#25488) --- types/shallowequal/index.d.ts | 9 +++++---- types/shallowequal/shallowequal-tests.ts | 13 +++++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/types/shallowequal/index.d.ts b/types/shallowequal/index.d.ts index d3971e15c9..29ffdab8f6 100644 --- a/types/shallowequal/index.d.ts +++ b/types/shallowequal/index.d.ts @@ -3,7 +3,8 @@ // Definitions by: Sean Kelley // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module 'shallowequal' { - function shallowEqual(objA: any, objB: any, compare?: (objA: any, objB: any, indexOrKey?: number | string) => boolean, compareContext?: any): boolean; - export = shallowEqual; -} +declare function shallowEqual(objA: any, objB: any, compare?: (objA: any, objB: any, indexOrKey?: number | string) => boolean, compareContext?: any): boolean; + +declare namespace shallowEqual { } + +export = shallowEqual; diff --git a/types/shallowequal/shallowequal-tests.ts b/types/shallowequal/shallowequal-tests.ts index d18b8a5536..2a8589fc32 100644 --- a/types/shallowequal/shallowequal-tests.ts +++ b/types/shallowequal/shallowequal-tests.ts @@ -1,10 +1,15 @@ -import shallowEqual = require('shallowequal'); +import shallowEqual_require = require('shallowequal'); +import * as shallowEqual_splat from 'shallowequal'; const a = {}, b = {}; function compare(a: any, b: any, indexOrKey?: number | string) { return false; } -shallowEqual(a, b); -shallowEqual(a, b, compare); -shallowEqual(a, b, compare, {}); +shallowEqual_require(a, b); +shallowEqual_require(a, b, compare); +shallowEqual_require(a, b, compare, {}); + +shallowEqual_splat(a, b); +shallowEqual_splat(a, b, compare); +shallowEqual_splat(a, b, compare, {}); From d2e888c5fe5b7b8439b47f3b555b43a195773ca2 Mon Sep 17 00:00:00 2001 From: Ika Date: Sat, 5 May 2018 04:48:44 +0800 Subject: [PATCH 1056/2153] fix(prettier): add missing props and fix wrong types (#25532) --- types/prettier/index.d.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/types/prettier/index.d.ts b/types/prettier/index.d.ts index e2fc00be38..0daaa14cca 100644 --- a/types/prettier/index.d.ts +++ b/types/prettier/index.d.ts @@ -109,9 +109,11 @@ export interface ParserOptions extends RequiredOptions { } export interface Plugin { - languages: SupportLanguage; + languages: SupportLanguage[]; parsers: { [parserName: string]: Parser }; printers: { [astFormat: string]: Printer }; + options?: SupportOption[]; + defaultOptions?: Partial; } export interface Parser { @@ -120,6 +122,7 @@ export interface Parser { hasPragma?: (text: string) => boolean; locStart: (node: any) => number; locEnd: (node: any) => number; + preprocess?: (text: string, options: ParserOptions) => string; } export interface Printer { @@ -232,7 +235,7 @@ export function clearConfigCache(): void; export interface SupportLanguage { name: string; - since: string; + since?: string; parsers: string[]; group?: string; tmScope: string; @@ -247,7 +250,7 @@ export interface SupportLanguage { } export interface SupportOption { - since: string; + since?: string; type: 'int' | 'boolean' | 'choice' | 'path'; array?: boolean; deprecated?: string; From 15df8a32afc04ac643d5cde067a4bec76f72d67f Mon Sep 17 00:00:00 2001 From: Retsam Date: Fri, 4 May 2018 16:49:31 -0400 Subject: [PATCH 1057/2153] Add type params to the KnockoutBindingHandler type (#25531) --- types/knockout/index.d.ts | 20 ++++++++++---------- types/knockout/test/index.ts | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/types/knockout/index.d.ts b/types/knockout/index.d.ts index d4031b2337..5076a05231 100644 --- a/types/knockout/index.d.ts +++ b/types/knockout/index.d.ts @@ -1,10 +1,10 @@ // Type definitions for Knockout v3.4.0 // Project: http://knockoutjs.com -// Definitions by: Boris Yankov , -// Igor Oleinikov , -// Clément Bourgeois , -// Matt Brooks , -// Benjamin Eckardt , +// Definitions by: Boris Yankov , +// Igor Oleinikov , +// Clément Bourgeois , +// Matt Brooks , +// Benjamin Eckardt , // Mathias Lorenzen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -150,10 +150,10 @@ interface KnockoutAllBindingsAccessor { has(name: string): boolean; } -interface KnockoutBindingHandler { +interface KnockoutBindingHandler { after?: Array; - init?: (element: any, valueAccessor: () => any, allBindingsAccessor: KnockoutAllBindingsAccessor, viewModel: any, bindingContext: KnockoutBindingContext) => void | { controlsDescendantBindings: boolean; }; - update?: (element: any, valueAccessor: () => any, allBindingsAccessor: KnockoutAllBindingsAccessor, viewModel: any, bindingContext: KnockoutBindingContext) => void; + init?: (element: E, valueAccessor: () => V, allBindingsAccessor: KnockoutAllBindingsAccessor, viewModel: VM, bindingContext: KnockoutBindingContext) => void | { controlsDescendantBindings: boolean; }; + update?: (element: E, valueAccessor: () => V, allBindingsAccessor: KnockoutAllBindingsAccessor, viewModel: VM, bindingContext: KnockoutBindingContext) => void; options?: any; preprocess?: (value: string, name: string, addBindingCallback?: (name: string, value: string) => void) => string; [s: string]: any; @@ -440,7 +440,7 @@ interface KnockoutStatic { contextFor(node: any): any; isSubscribable(instance: any): instance is KnockoutSubscribable; toJSON(viewModel: any, replacer?: Function, space?: any): string; - + toJS(viewModel: any): any; isObservable(instance: any): instance is KnockoutObservable; @@ -451,7 +451,7 @@ interface KnockoutStatic { isComputed(instance: any): instance is KnockoutComputed; isComputed(instance: KnockoutObservable | T): instance is KnockoutComputed; - + dataFor(node: any): any; removeNode(node: Node): void; cleanNode(node: Node): Node; diff --git a/types/knockout/test/index.ts b/types/knockout/test/index.ts index a106d7af9b..38f439efb7 100644 --- a/types/knockout/test/index.ts +++ b/types/knockout/test/index.ts @@ -192,7 +192,7 @@ function test_bindings() { var value = ko.utils.unwrapObservable(valueAccessor()); $(element).toggle(value); } - }; + } as KnockoutBindingHandler | boolean>; ko.bindingHandlers.hasFocus = { init: function (element, valueAccessor) { $(element).focus(function () { @@ -211,7 +211,7 @@ function test_bindings() { else element.blur(); } - }; + } as KnockoutBindingHandler>; ko.bindingHandlers.allowBindings = { init: function (elem, valueAccessor) { var shouldAllowBindings = ko.utils.unwrapObservable(valueAccessor()); @@ -749,4 +749,4 @@ interface MyObservableArray extends KnockoutObservableArray { interface MyComputed extends KnockoutComputed { isBeautiful?: boolean; -} \ No newline at end of file +} From ebf9f312594981863e6031a2643c64261b522d8f Mon Sep 17 00:00:00 2001 From: Philip Andersson Date: Fri, 4 May 2018 22:49:48 +0200 Subject: [PATCH 1058/2153] Mongoose model init (#25530) * Adding init method declaration on Model interface * Test init method on Model --- types/mongoose/index.d.ts | 10 ++++++++++ types/mongoose/mongoose-tests.ts | 1 + 2 files changed, 11 insertions(+) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 5723a9a881..362f549e67 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -2714,6 +2714,16 @@ declare module "mongoose" { insertMany(doc: any, callback?: (error: any, doc: T) => void): Promise; insertMany(doc: any, options?: { ordered?: boolean, rawResult?: boolean }, callback?: (error: any, doc: T) => void): Promise; + /** + * Performs any async initialization of this model against MongoDB. + * This function is called automatically, so you don't need to call it. + * This function is also idempotent, so you may call it to get back a promise + * that will resolve when your indexes are finished building as an alternative + * to `MyModel.on('index')` + * @param callback optional + */ + init(callback?: (err: any) => void): Promise; + /** * Executes a mapReduce command. * @param o an object specifying map-reduce options diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index a6fe9f406a..95f50a6e6f 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -1420,6 +1420,7 @@ var MongoModel = mongoose.model('MongoModel', new mongoose.Schema({ required: true } }), 'myCollection', true); +MongoModel.init().then(cb); MongoModel.find({}).$where('indexOf("val") !== -1').exec(function (err, docs) { docs[0].save(); docs[0].__v; From bfb5a55f8399f891b10811f19a44adef8041b263 Mon Sep 17 00:00:00 2001 From: Alan Plum Date: Fri, 4 May 2018 22:50:15 +0200 Subject: [PATCH 1059/2153] Add mobx-devtools-mst (#25537) --- types/mobx-devtools-mst/index.d.ts | 8 ++++++++ .../mobx-devtools-mst/mobx-devtools-mst-tests.ts | 7 +++++++ types/mobx-devtools-mst/tsconfig.json | 16 ++++++++++++++++ types/mobx-devtools-mst/tslint.json | 1 + 4 files changed, 32 insertions(+) create mode 100644 types/mobx-devtools-mst/index.d.ts create mode 100644 types/mobx-devtools-mst/mobx-devtools-mst-tests.ts create mode 100644 types/mobx-devtools-mst/tsconfig.json create mode 100644 types/mobx-devtools-mst/tslint.json diff --git a/types/mobx-devtools-mst/index.d.ts b/types/mobx-devtools-mst/index.d.ts new file mode 100644 index 0000000000..54a3f09bf6 --- /dev/null +++ b/types/mobx-devtools-mst/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for mobx-devtools-mst 0.9 +// Project: https://mobxjs.github.io/mobx +// Definitions by: Alan Plum +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +declare function makeInspectable(state: object): void; +export = makeInspectable; diff --git a/types/mobx-devtools-mst/mobx-devtools-mst-tests.ts b/types/mobx-devtools-mst/mobx-devtools-mst-tests.ts new file mode 100644 index 0000000000..a00d1c36af --- /dev/null +++ b/types/mobx-devtools-mst/mobx-devtools-mst-tests.ts @@ -0,0 +1,7 @@ +import makeInspectable = require("mobx-devtools-mst"); + +const myModel = { + /* some mst instance */ +}; + +makeInspectable(myModel); diff --git a/types/mobx-devtools-mst/tsconfig.json b/types/mobx-devtools-mst/tsconfig.json new file mode 100644 index 0000000000..06ccbf6965 --- /dev/null +++ b/types/mobx-devtools-mst/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "mobx-devtools-mst-tests.ts"] +} diff --git a/types/mobx-devtools-mst/tslint.json b/types/mobx-devtools-mst/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mobx-devtools-mst/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From ad30dc660ff4c20d627190bb4b787f0b763afd3b Mon Sep 17 00:00:00 2001 From: Christopher Deutsch Date: Fri, 4 May 2018 15:50:44 -0500 Subject: [PATCH 1060/2153] Add missing `open` parameter to `onSetOpen`, which is pretty important if you use it. (#25519) Add missing `defaultSidebarWidth` prop. Declare `sidebar` as a more restrictive/accurate type. --- types/react-sidebar/index.d.ts | 7 ++++--- types/react-sidebar/react-sidebar-tests.tsx | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/types/react-sidebar/index.d.ts b/types/react-sidebar/index.d.ts index 24684c4c76..da6d9e0f79 100644 --- a/types/react-sidebar/index.d.ts +++ b/types/react-sidebar/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-sidebar 2.2 +// Type definitions for react-sidebar 2.3 // Project: https://github.com/balloob/react-sidebar#readme // Definitions by: Jeroen Vervaeke // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -8,15 +8,16 @@ import { Component } from "react"; export interface SidebarProps { contentClassName?: string; + defaultSidebarWidth?: number; docked?: boolean; dragToggleDistance?: number; - onSetOpen?(): void; + onSetOpen?(open: boolean): void; open?: boolean; overlayClassName?: string; pullRight?: boolean; rootClassName?: string; shadow?: boolean; - sidebar?: any; + sidebar?: React.ReactNode; sidebarClassName?: string; styles?: SidebarStyles; transitions?: boolean; diff --git a/types/react-sidebar/react-sidebar-tests.tsx b/types/react-sidebar/react-sidebar-tests.tsx index 491bd3fb4f..caeaa3c37d 100644 --- a/types/react-sidebar/react-sidebar-tests.tsx +++ b/types/react-sidebar/react-sidebar-tests.tsx @@ -9,11 +9,12 @@ const sidebarStyle: SidebarStyles = { const sidebar1 = ( {}} + onSetOpen={(open: boolean) => { }} >

    Content

    From 3d1bed2f48cba3d1df96458035ff3cdf4a89b271 Mon Sep 17 00:00:00 2001 From: shreedhart Date: Fri, 4 May 2018 13:51:02 -0700 Subject: [PATCH 1061/2153] Adding Office.onReady() (#25518) Added declaration for Office.onReady() API. --- types/office-js/index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index e08e0f1ee0..629ccacb21 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -20,6 +20,13 @@ declare namespace Office { * @param reason Indicates how the app was initialized */ export function initialize(reason: InitializationReason): void; + /** + * Ensures that the Office JavaScript APIs are ready to be called by the add-in. If the framework hasn't initialized yet, the callback or promise will wait until the Office host is ready to accept API calls. + * Note that though this API is intended to be used inside an Office add-in, it can also be used outside the add-in. In that case, once Office.js determines that it is running outside of an Office host application, it will call the callback and resolve the promise with "null" for both the host and platform. + * @param callback - An optional callback method, that will receive the host and platform info. Alternatively, rather than use a callback, an add-in may simply wait for the Promise returned by the function to resolve. + * @returns A Promise that contains the host and platform info, once initialization is completed. + */ + export function onReady(callback?: (info: { host: HostType, platform: PlatformType} ) => any): Promise<{ host: HostType, platform: PlatformType }>; /** * Indicates if the large namespace for objects will be used or not. * @param useShortNamespace Indicates if 'true' that the short namespace will be used From 599b78752785aeff35876d10048386371fe6f0bf Mon Sep 17 00:00:00 2001 From: denisname Date: Fri, 4 May 2018 22:51:36 +0200 Subject: [PATCH 1062/2153] Update to 0.1.0 (#25515) Add interpolate functions Add jsDoc Activate `strictNullChecks ` --- types/d3-hsv/d3-hsv-tests.ts | 47 ++++++++++++++++++++----- types/d3-hsv/index.d.ts | 67 ++++++++++++++++++++++++++++++++++-- types/d3-hsv/tsconfig.json | 2 +- 3 files changed, 103 insertions(+), 13 deletions(-) diff --git a/types/d3-hsv/d3-hsv-tests.ts b/types/d3-hsv/d3-hsv-tests.ts index 0d3e564360..7aa6fb7817 100644 --- a/types/d3-hsv/d3-hsv-tests.ts +++ b/types/d3-hsv/d3-hsv-tests.ts @@ -6,19 +6,23 @@ * are not intended as functional tests. */ -import { hsv, HSVColor } from 'd3-hsv'; -import { rgb, RGBColor } from 'd3-color'; +import { hsv, HSVColor, interpolateHsv, interpolateHsvLong } from 'd3-hsv'; +import { rgb, hcl, RGBColor } from 'd3-color'; -let c: RGBColor; +let cRGB: RGBColor; let cHSV: HSVColor; let displayable: boolean; let cString: string; +let iString: (t: number) => string; +let nil: null; + +// Hsv signature -// hsv signature cHSV = hsv(120, 0.4, 0.5); cHSV = hsv(120, 0.4, 0.5, 0.5); -// specifier signature +// Specifier signature + cHSV = hsv('rgb(255, 255, 255)'); cHSV = hsv('rgb(10%, 20%, 30%)'); cHSV = hsv('rgba(255, 255, 255, 0.4)'); @@ -28,13 +32,16 @@ cHSV = hsv('hsla(120, 50%, 20%, 0.4)'); cHSV = hsv('#ffeeaa'); cHSV = hsv('#fea'); cHSV = hsv('steelblue'); +cHSV = hsv(''); -// color signature -c = rgb('steelblue'); -cHSV = hsv(c); +// Color signature + +cRGB = rgb('steelblue'); +cHSV = hsv(cRGB); cHSV = hsv(cHSV); -// method signatures +// Method signatures + cHSV = cHSV.brighter(); cHSV = cHSV.brighter(0.2); cHSV = cHSV.darker(); @@ -43,3 +50,25 @@ displayable = cHSV.displayable(); cString = cHSV.toString(); console.log('Channels = (h : %d, s: %d, v: %d)', cHSV.h, cHSV.s, cHSV.v); console.log('Opacity = %d', cHSV.opacity); + +// Interpolater + +iString = interpolateHsv('seagreen', 'steelblue'); +iString = interpolateHsv(rgb('seagreen'), hcl('steelblue')); +iString = interpolateHsv(rgb('seagreen'), hsv('steelblue')); + +iString = interpolateHsvLong('seagreen', 'steelblue'); +iString = interpolateHsvLong(rgb('seagreen'), hcl('steelblue')); +iString = interpolateHsvLong(rgb('seagreen'), hsv('steelblue')); + +// Prototype, instanceof and typeguard + +declare let color: RGBColor | HSVColor | null; + +if (color instanceof rgb) { + cRGB = color; +} else if (color instanceof hsv) { + cHSV = color; +} else { + nil = color; +} diff --git a/types/d3-hsv/index.d.ts b/types/d3-hsv/index.d.ts index 6a7a2c8560..1728af0874 100644 --- a/types/d3-hsv/index.d.ts +++ b/types/d3-hsv/index.d.ts @@ -1,28 +1,89 @@ -// Type definitions for D3JS d3-hsv module 0.0 +// Type definitions for D3JS d3-hsv module 0.1 // Project: https://github.com/d3/d3-hsv/ -// Definitions by: Yuri Feldman +// Definitions by: Yuri Feldman , denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Last module patch version validated against: 0.0.3 +// Last module patch version validated against: 0.1.0 import { Color, RGBColor, ColorSpaceObject, ColorCommonInstance } from 'd3-color'; export type ColorSpaceObjectWithHSV = ColorSpaceObject | HSVColor; export interface HSVColorFactory extends Function { + /** + * Constructs a new HSV color. + * @param h The hue of the returned color. + * @param s The saturation of the returned color. + * @param v The value of the returned color. + * @param opacity The opacity of the returned color. + */ (h: number, s: number, v: number, opacity?: number): HSVColor; + /** + * Constructs a new HSV color. + * @param cssColorSpecifier A CSS Color Module Level 3 specifier string, + * it is parsed and then converted to the HSV color space. + */ (cssColorSpecifier: string): HSVColor; + /** + * Constructs a new HSV color. + * @param color A color instance, it will be converted to the RGB color space + * using `color.rgb` and then converted to HSV. + */ (color: HSVColor | ColorSpaceObject | ColorCommonInstance): HSVColor; + + readonly prototype: HSVColor; } export interface HSVColor extends Color { + /** + * The color hue. + */ h: number; + /** + * The color saturation. + */ s: number; + /** + * The color value. + */ v: number; + /** + * The color opacity. + */ opacity: number; + + /** + * Returns a brighter copy of this color. + * @param k Controls how much brighter the returned color should be (defaults to 1). + */ brighter(k?: number): this; + + /** + * Returns a darker copy of this color. + * @param k Controls how much darker the returned color should be (defaults to 1). + */ darker(k?: number): this; + + /** + * Returns the RGB equivalent of this color. + */ rgb(): RGBColor; } export const hsv: HSVColorFactory; + +/** + * Returns an HSV color space interpolator between the two colors a and b. + * If either color’s hue or chroma is NaN, the opposing color’s channel value is used. + * The shortest path between hues is used. The return value of the interpolator is an RGB string. + * @param a The starting color; it will be converted to HSV using `d3.hsv`. + * @param b The ending color; it will be converted to HSV using `d3.hsv`. + */ +export function interpolateHsv(a: string | ColorCommonInstance, b: string | ColorCommonInstance): (t: number) => string; + +/** + * Like `interpolateHsv`, but does not use the shortest path between hues. + * @param a The starting color; it will be converted to HSV using `d3.hsv`. + * @param b The ending color; it will be converted to HSV using `d3.hsv`. + */ +export function interpolateHsvLong(a: string | ColorCommonInstance, b: string | ColorCommonInstance): (t: number) => string; diff --git a/types/d3-hsv/tsconfig.json b/types/d3-hsv/tsconfig.json index c92ce346b2..0f7de85da1 100644 --- a/types/d3-hsv/tsconfig.json +++ b/types/d3-hsv/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ From 44bc3b6c869d2ed59a7d359c74926024fcfe3938 Mon Sep 17 00:00:00 2001 From: Andre Z Sanchez Date: Fri, 4 May 2018 13:52:05 -0700 Subject: [PATCH 1063/2153] Fix Three.ParametricGeometry arguments (#25514) --- types/three/test/webgl/webgl_geometries.ts | 11 +++++++++++ types/three/three-core.d.ts | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/types/three/test/webgl/webgl_geometries.ts b/types/three/test/webgl/webgl_geometries.ts index d09b865c6d..d239d1ca3c 100644 --- a/types/three/test/webgl/webgl_geometries.ts +++ b/types/three/test/webgl/webgl_geometries.ts @@ -96,6 +96,17 @@ object.position.set(0, 0, -200); scene.add(object); + + object = new THREE.Mesh( + new THREE.ParametricGeometry( + (u:number, v:number, dest:THREE.Vector3):void => { + dest.set(u, v, 0); + }, + 25, + 25 + ) + ); + object = new THREE.AxesHelper(50); object.position.set(200, 0, -200); scene.add(object); diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index f97768d34f..f32f975fb1 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -7096,10 +7096,10 @@ export class OctahedronGeometry extends PolyhedronGeometry { } export class ParametricGeometry extends Geometry { - constructor(func: (u: number, v: number) => Vector3, slices: number, stacks: number); + constructor(func: (u: number, v: number, dest:Vector3) => void, slices: number, stacks: number); parameters: { - func: (u: number, v: number) => Vector3; + func: (u: number, v: number, dest:Vector3) => void; slices: number; stacks: number; }; From 430b5a755f617d89853a6b7108ca337a7a734868 Mon Sep 17 00:00:00 2001 From: James Bromwell <943160+thw0rted@users.noreply.github.com> Date: Fri, 4 May 2018 22:54:23 +0200 Subject: [PATCH 1064/2153] node: API docs never mention NodeBuffer, remove the definition (#25500) * node: API docs never mention NodeBuffer, remove the definition * Remove references to NodeBuffer from outdated packages --- .../fs-extra-promise-es6-tests.ts | 10 +- types/fs-extra-promise-es6/index.d.ts | 18 +-- .../fs-extra-promise-tests.ts | 10 +- types/fs-extra-promise/index.d.ts | 6 +- types/ip/index.d.ts | 16 +-- types/noble/noble-tests.ts | 10 +- types/node/index.d.ts | 115 +++++++++--------- types/node/v9/index.d.ts | 115 +++++++++--------- types/request/request-tests.ts | 2 +- 9 files changed, 146 insertions(+), 156 deletions(-) diff --git a/types/fs-extra-promise-es6/fs-extra-promise-es6-tests.ts b/types/fs-extra-promise-es6/fs-extra-promise-es6-tests.ts index 337dd1ca0f..bdff193912 100644 --- a/types/fs-extra-promise-es6/fs-extra-promise-es6-tests.ts +++ b/types/fs-extra-promise-es6/fs-extra-promise-es6-tests.ts @@ -14,7 +14,7 @@ declare const dir: string; declare const path: string; declare const data: any; declare const object: any; -let buffer: NodeBuffer; +let buffer: Buffer; declare const modeNum: number; declare const modeStr: string; declare const encoding: string; @@ -148,19 +148,19 @@ fs.futimes(fd, atime, mtime, errorCallback); fs.futimesSync(fd, atime, mtime); fs.fsync(fd, errorCallback); fs.fsyncSync(fd); -fs.write(fd, buffer, offset, length, position, (err: Error, written: number, buffer: NodeBuffer) => { +fs.write(fd, buffer, offset, length, position, (err: Error, written: number, buffer: Buffer) => { }); num = fs.writeSync(fd, buffer, offset, length, position); -fs.read(fd, buffer, offset, length, position, (err: Error, bytesRead: number, buffer: NodeBuffer) => { +fs.read(fd, buffer, offset, length, position, (err: Error, bytesRead: number, buffer: Buffer) => { }); num = fs.readSync(fd, buffer, offset, length, position); -fs.readFile(filename, (err: Error, data: NodeBuffer) => { +fs.readFile(filename, (err: Error, data: Buffer) => { }); fs.readFile(filename, encoding, (err: Error, data: string) => { }); fs.readFile(filename, openOpts, (err: Error, data: string) => { }); -fs.readFile(filename, (err: Error, data: NodeBuffer) => { +fs.readFile(filename, (err: Error, data: Buffer) => { }); buffer = fs.readFileSync(filename); str = fs.readFileSync(filename, encoding); diff --git a/types/fs-extra-promise-es6/index.d.ts b/types/fs-extra-promise-es6/index.d.ts index 0f52b5c02e..2b7dacd108 100644 --- a/types/fs-extra-promise-es6/index.d.ts +++ b/types/fs-extra-promise-es6/index.d.ts @@ -113,13 +113,13 @@ export function futimes(fd: number, atime: number, mtime: number, callback?: (er export function futimesSync(fd: number, atime: number, mtime: number): void; export function fsync(fd: number, callback?: (err: Error) => void): void; export function fsyncSync(fd: number): void; -export function write(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, written: number, buffer: NodeBuffer) => void): void; -export function writeSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number; -export function read(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, bytesRead: number, buffer: NodeBuffer) => void): void; -export function readSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number; +export function write(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: Error, written: number, buffer: Buffer) => void): void; +export function writeSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number; +export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: Error, bytesRead: number, buffer: Buffer) => void): void; +export function readSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number; export function readFile(filename: string, options: OpenOptions | string, callback: (err: Error, data: string) => void): void; -export function readFile(filename: string, callback: (err: Error, data: NodeBuffer) => void): void; -export function readFileSync(filename: string): NodeBuffer; +export function readFile(filename: string, callback: (err: Error, data: Buffer) => void): void; +export function readFileSync(filename: string): Buffer; export function readFileSync(filename: string, options: OpenOptions | string): string; export function writeFile(filename: string, data: any, callback?: (err: Error) => void): void; export function writeFile(filename: string, data: any, options: OpenOptions | string, callback?: (err: Error) => void): void; @@ -201,10 +201,10 @@ export function openAsync(path: string, flags: string, mode?: string): Promise; export function futimesAsync(fd: number, atime: number, mtime: number): Promise; export function fsyncAsync(fd: number): Promise; -export function writeAsync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): Promise<[number, NodeBuffer]>; -export function readAsync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): Promise<[number, NodeBuffer]>; +export function writeAsync(fd: number, buffer: Buffer, offset: number, length: number, position: number): Promise<[number, Buffer]>; +export function readAsync(fd: number, buffer: Buffer, offset: number, length: number, position: number): Promise<[number, Buffer]>; export function readFileAsync(filename: string, options: OpenOptions | string): Promise; -export function readFileAsync(filename: string): Promise; +export function readFileAsync(filename: string): Promise; export function writeFileAsync(filename: string, data: any, options?: OpenOptions | string): Promise; export function appendFileAsync(filename: string, data: any, option?: OpenOptions | string): Promise; diff --git a/types/fs-extra-promise/fs-extra-promise-tests.ts b/types/fs-extra-promise/fs-extra-promise-tests.ts index f273d6efb6..61549a55ad 100644 --- a/types/fs-extra-promise/fs-extra-promise-tests.ts +++ b/types/fs-extra-promise/fs-extra-promise-tests.ts @@ -16,7 +16,7 @@ declare const data: any; declare const object: object; declare const buf: Buffer; let strOrBuf: string | Buffer; -let buffer: NodeBuffer; +let buffer: Buffer; declare const modeNum: number; declare const modeStr: string; declare const encoding: string; @@ -148,19 +148,19 @@ fs.futimes(fd, atime, mtime, errorCallback); fs.futimesSync(fd, atime, mtime); fs.fsync(fd, errorCallback); fs.fsyncSync(fd); -fs.write(fd, buffer, offset, length, position, (err: Error, written: number, buffer: NodeBuffer) => { +fs.write(fd, buffer, offset, length, position, (err: Error, written: number, buffer: Buffer) => { }); num = fs.writeSync(fd, buffer, offset, length, position); -fs.read(fd, buffer, offset, length, position, (err: Error, bytesRead: number, buffer: NodeBuffer) => { +fs.read(fd, buffer, offset, length, position, (err: Error, bytesRead: number, buffer: Buffer) => { }); num = fs.readSync(fd, buffer, offset, length, position); -fs.readFile(filename, (err: Error, data: NodeBuffer) => { +fs.readFile(filename, (err: Error, data: Buffer) => { }); fs.readFile(filename, encoding, (err: Error, data: string) => { }); fs.readFile(filename, openOpts, (err: NodeJS.ErrnoException, data: Buffer) => { }); -fs.readFile(filename, (err: Error, data: NodeBuffer) => { +fs.readFile(filename, (err: Error, data: Buffer) => { }); buffer = fs.readFileSync(filename); str = fs.readFileSync(filename, encoding); diff --git a/types/fs-extra-promise/index.d.ts b/types/fs-extra-promise/index.d.ts index de47c81a1e..b4ac5be133 100644 --- a/types/fs-extra-promise/index.d.ts +++ b/types/fs-extra-promise/index.d.ts @@ -65,10 +65,10 @@ export function openAsync(path: string, flags: string, mode?: string): Promise; export function futimesAsync(fd: number, atime: number, mtime: number): Promise; export function fsyncAsync(fd: number): Promise; -export function writeAsync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): Promise<[number, NodeBuffer]>; -export function readAsync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): Promise<[number, NodeBuffer]>; +export function writeAsync(fd: number, buffer: Buffer, offset: number, length: number, position: number): Promise<[number, Buffer]>; +export function readAsync(fd: number, buffer: Buffer, offset: number, length: number, position: number): Promise<[number, Buffer]>; export function readFileAsync(filename: string, options: string | ReadOptions): Promise; -export function readFileAsync(filename: string): Promise; +export function readFileAsync(filename: string): Promise; export function writeFileAsync(filename: string, data: any, options?: string | WriteOptions): Promise; export function appendFileAsync(filename: string, data: any, option?: string | WriteOptions): Promise; diff --git a/types/ip/index.d.ts b/types/ip/index.d.ts index 602a71eed9..c51a8d37f5 100644 --- a/types/ip/index.d.ts +++ b/types/ip/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Peter Harris // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -interface NodeBuffer { } +/// interface SubnetInfo { networkAddress: string; @@ -26,16 +26,16 @@ declare module "ip" { /** * Convert an IP string into a buffer. **/ - export function toBuffer(ip: string, buffer?: number, offset?: number): NodeBuffer; + export function toBuffer(ip: string, buffer?: number, offset?: number): Buffer; /** * Convert an IP buffer into a string. **/ - export function toString(ip: NodeBuffer, offset?: number, length?: number): string; + export function toString(ip: Buffer, offset?: number, length?: number): string; /** * Get the subnet mask from a CIDR prefix length. - * + * * @param family The IP family is infered from the prefixLength, but can be explicity specified as either "ipv4" or "ipv6". **/ export function fromPrefixLen(prefixLength: number, family?:string): string; @@ -79,15 +79,15 @@ declare module "ip" { * Check whether an IP is a IPv4 address. **/ export function isV4Format(ip: string): boolean; - + /** * Check whether an IP is a IPv6 address. **/ export function isV6Format(ip: string): boolean; - + /** * Get the loopback address for an IP family. - * + * * @param family The family can be either "ipv4" or "ipv6". Default: "ipv4". **/ export function loopback(family?: string): string; @@ -95,7 +95,7 @@ declare module "ip" { /** * Get the address for the network interface on the current system with the specified 'name'. * If no interface name is specified, the first IPv4 address or loopback address is returned. - * + * * @param name The name can be any named interface, or 'public' or 'private'. * @param family The family can be either "ipv4" or "ipv6". Default: "ipv4". **/ diff --git a/types/noble/noble-tests.ts b/types/noble/noble-tests.ts index 5e00105433..0c8dcf6c20 100644 --- a/types/noble/noble-tests.ts +++ b/types/noble/noble-tests.ts @@ -59,7 +59,7 @@ peripheral.discoverAllServicesAndCharacteristics(); peripheral.discoverAllServicesAndCharacteristics((error: string, services: noble.Service[], characteristics: noble.Characteristic[]): void => {}); peripheral.discoverSomeServicesAndCharacteristics(["180d"], ["2a38"]); peripheral.discoverSomeServicesAndCharacteristics(["180d"], ["2a38"], (error: string, services: noble.Service[], characteristics: noble.Characteristic[]): void => {}); -peripheral.readHandle(new Buffer(1), (error: string, data: NodeBuffer): void => {}); +peripheral.readHandle(new Buffer(1), (error: string, data: Buffer): void => {}); peripheral.writeHandle(new Buffer(1), new Buffer(1), true, (error: string): void => {}); peripheral.on("connect", (error: string): void => {}); peripheral.on("disconnect", (error: string): void => {}); @@ -84,7 +84,7 @@ characteristic.name = ""; characteristic.type = ""; characteristic.properties = ["read", "notify"]; characteristic.read(); -characteristic.read((error: string, data: NodeBuffer): void => {}); +characteristic.read((error: string, data: Buffer): void => {}); characteristic.write(new Buffer(1), true); characteristic.write(new Buffer(1), true, (error: string): void => {}); characteristic.broadcast(true); @@ -93,7 +93,7 @@ characteristic.notify(true); characteristic.notify(true, (error: string): void => {}); characteristic.discoverDescriptors(); characteristic.discoverDescriptors((error: string, descriptors: noble.Descriptor[]): void => {}); -characteristic.on("read", (data: NodeBuffer, isNotification: boolean): void => {}); +characteristic.on("read", (data: Buffer, isNotification: boolean): void => {}); characteristic.on("write", true, (error: string): void => {}); characteristic.on("broadcast", (state: string): void => {}); characteristic.on("notify", (state: string): void => {}); @@ -108,9 +108,9 @@ descriptor.uuid = ""; descriptor.name = ""; descriptor.type = ""; descriptor.readValue(); -descriptor.readValue((error: string, data: NodeBuffer): void => {}); +descriptor.readValue((error: string, data: Buffer): void => {}); descriptor.writeValue(new Buffer(1)); descriptor.writeValue(new Buffer(1), (error: string): void => {}); -descriptor.on("valueRead", (error: string, data: NodeBuffer): void => {}); +descriptor.on("valueRead", (error: string, data: Buffer): void => {}); descriptor.on("valueWrite", (error: string): void => {}); diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 8074e3d328..4fd2bf8dc7 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -259,7 +259,61 @@ declare var SlowBuffer: { // Buffer class type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "latin1" | "binary" | "hex"; -interface Buffer extends NodeBuffer { } +interface Buffer extends Uint8Array { + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): { type: 'Buffer', data: any[] }; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAssert?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): this; + indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + entries(): IterableIterator<[number, number]>; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; + keys(): IterableIterator; + values(): IterableIterator; +} /** * Raw data is stored in instances of the Buffer class. @@ -913,65 +967,6 @@ declare namespace NodeJS { interface IterableIterator { } -/** - * @deprecated - */ -interface NodeBuffer extends Uint8Array { - write(string: string, offset?: number, length?: number, encoding?: string): number; - toString(encoding?: string, start?: number, end?: number): string; - toJSON(): { type: 'Buffer', data: any[] }; - equals(otherBuffer: Buffer): boolean; - compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; - copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; - slice(start?: number, end?: number): Buffer; - writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; - readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; - readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; - readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; - readUInt8(offset: number, noAssert?: boolean): number; - readUInt16LE(offset: number, noAssert?: boolean): number; - readUInt16BE(offset: number, noAssert?: boolean): number; - readUInt32LE(offset: number, noAssert?: boolean): number; - readUInt32BE(offset: number, noAssert?: boolean): number; - readInt8(offset: number, noAssert?: boolean): number; - readInt16LE(offset: number, noAssert?: boolean): number; - readInt16BE(offset: number, noAssert?: boolean): number; - readInt32LE(offset: number, noAssert?: boolean): number; - readInt32BE(offset: number, noAssert?: boolean): number; - readFloatLE(offset: number, noAssert?: boolean): number; - readFloatBE(offset: number, noAssert?: boolean): number; - readDoubleLE(offset: number, noAssert?: boolean): number; - readDoubleBE(offset: number, noAssert?: boolean): number; - swap16(): Buffer; - swap32(): Buffer; - swap64(): Buffer; - writeUInt8(value: number, offset: number, noAssert?: boolean): number; - writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; - writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; - writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; - writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; - writeInt8(value: number, offset: number, noAssert?: boolean): number; - writeInt16LE(value: number, offset: number, noAssert?: boolean): number; - writeInt16BE(value: number, offset: number, noAssert?: boolean): number; - writeInt32LE(value: number, offset: number, noAssert?: boolean): number; - writeInt32BE(value: number, offset: number, noAssert?: boolean): number; - writeFloatLE(value: number, offset: number, noAssert?: boolean): number; - writeFloatBE(value: number, offset: number, noAssert?: boolean): number; - writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; - writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; - fill(value: any, offset?: number, end?: number): this; - indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; - lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; - entries(): IterableIterator<[number, number]>; - includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; - keys(): IterableIterator; - values(): IterableIterator; -} - /************************************************ * * * MODULES * diff --git a/types/node/v9/index.d.ts b/types/node/v9/index.d.ts index af2ed7168d..66a96401c3 100644 --- a/types/node/v9/index.d.ts +++ b/types/node/v9/index.d.ts @@ -257,7 +257,61 @@ declare var SlowBuffer: { // Buffer class type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "latin1" | "binary" | "hex"; -interface Buffer extends NodeBuffer { } +interface Buffer extends Uint8Array { + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): { type: 'Buffer', data: any[] }; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAssert?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): this; + indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + entries(): IterableIterator<[number, number]>; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; + keys(): IterableIterator; + values(): IterableIterator; +} /** * Raw data is stored in instances of the Buffer class. @@ -904,65 +958,6 @@ declare namespace NodeJS { interface IterableIterator { } -/** - * @deprecated - */ -interface NodeBuffer extends Uint8Array { - write(string: string, offset?: number, length?: number, encoding?: string): number; - toString(encoding?: string, start?: number, end?: number): string; - toJSON(): { type: 'Buffer', data: any[] }; - equals(otherBuffer: Buffer): boolean; - compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; - copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; - slice(start?: number, end?: number): Buffer; - writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; - readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; - readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; - readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; - readUInt8(offset: number, noAssert?: boolean): number; - readUInt16LE(offset: number, noAssert?: boolean): number; - readUInt16BE(offset: number, noAssert?: boolean): number; - readUInt32LE(offset: number, noAssert?: boolean): number; - readUInt32BE(offset: number, noAssert?: boolean): number; - readInt8(offset: number, noAssert?: boolean): number; - readInt16LE(offset: number, noAssert?: boolean): number; - readInt16BE(offset: number, noAssert?: boolean): number; - readInt32LE(offset: number, noAssert?: boolean): number; - readInt32BE(offset: number, noAssert?: boolean): number; - readFloatLE(offset: number, noAssert?: boolean): number; - readFloatBE(offset: number, noAssert?: boolean): number; - readDoubleLE(offset: number, noAssert?: boolean): number; - readDoubleBE(offset: number, noAssert?: boolean): number; - swap16(): Buffer; - swap32(): Buffer; - swap64(): Buffer; - writeUInt8(value: number, offset: number, noAssert?: boolean): number; - writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; - writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; - writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; - writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; - writeInt8(value: number, offset: number, noAssert?: boolean): number; - writeInt16LE(value: number, offset: number, noAssert?: boolean): number; - writeInt16BE(value: number, offset: number, noAssert?: boolean): number; - writeInt32LE(value: number, offset: number, noAssert?: boolean): number; - writeInt32BE(value: number, offset: number, noAssert?: boolean): number; - writeFloatLE(value: number, offset: number, noAssert?: boolean): number; - writeFloatBE(value: number, offset: number, noAssert?: boolean): number; - writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; - writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; - fill(value: any, offset?: number, end?: number): this; - indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; - lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; - entries(): IterableIterator<[number, number]>; - includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; - keys(): IterableIterator; - values(): IterableIterator; -} - /************************************************ * * * MODULES * diff --git a/types/request/request-tests.ts b/types/request/request-tests.ts index 5f56f3bc9d..c2c377fcbd 100644 --- a/types/request/request-tests.ts +++ b/types/request/request-tests.ts @@ -11,7 +11,7 @@ let value: any; let str: string; let strOrUndef: string | undefined; let strOrTrueOrUndef: string | true | undefined; -const buffer: NodeBuffer = new Buffer('foo'); +const buffer: Buffer = new Buffer('foo'); let num = 0; let bool: boolean; let date: Date; From 50660e2820244490e3cd933f7ee9d1da56f08db9 Mon Sep 17 00:00:00 2001 From: Alexander Pepper Date: Fri, 4 May 2018 22:55:05 +0200 Subject: [PATCH 1065/2153] [urijs] Bugfix: segment(number) can also return undefined. (#25499) > const uri = new URI("http://example.org/foo/hello.html"); > > uri.segment(0) > => "foo" > > uri.segment(5) > => undefined --- types/urijs/index.d.ts | 2 +- types/urijs/urijs-tests.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/types/urijs/index.d.ts b/types/urijs/index.d.ts index 08c0611414..f158cb32e3 100644 --- a/types/urijs/index.d.ts +++ b/types/urijs/index.d.ts @@ -105,7 +105,7 @@ declare namespace uri { search(qry: Object): URI; segment(): string[]; segment(segments: string[]): URI; - segment(position: number): string; + segment(position: number): string | undefined; segment(position: number, level: string): URI; segment(segment: string): URI; segmentCoded(): string[]; diff --git a/types/urijs/urijs-tests.ts b/types/urijs/urijs-tests.ts index fc9911d274..435049ab57 100644 --- a/types/urijs/urijs-tests.ts +++ b/types/urijs/urijs-tests.ts @@ -45,6 +45,9 @@ URI('http://example.org/foo/hello.html').segment('bar'); URI('http://example.org/foo/hello.html').segment(0, 'bar'); URI('http://example.org/foo/hello.html').segment(['foo', 'bar', 'foobar.html']); +URI('http://example.org/foo/hello.html').segment(0); +URI('http://example.org/foo/hello.html').segment(100); + URI('http://example.org/foo/hello.html').segmentCoded('foo bar'); URI('http://example.org/foo/hello.html').segmentCoded(0, 'foo bar'); URI('http://example.org/foo/hello.html').segmentCoded(['foo bar', 'bar foo', 'foo bar.html']); From d33b437b8f568d3bab53492daae2d609aa8b9b0e Mon Sep 17 00:00:00 2001 From: FaithForHumans Date: Fri, 4 May 2018 15:56:22 -0500 Subject: [PATCH 1066/2153] [react-fontawesome] Changing props from a type union to an interface (#25483) * Changing props from a type union to in interface * Better html extends * Extending AllHTMLAttributes instead of HTMLAttributes --- types/react-fontawesome/index.d.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/types/react-fontawesome/index.d.ts b/types/react-fontawesome/index.d.ts index 118f6fb4cd..9fa93692b3 100644 --- a/types/react-fontawesome/index.d.ts +++ b/types/react-fontawesome/index.d.ts @@ -11,12 +11,16 @@ import * as React from 'react'; export = FontAwesome; +interface Intermediate extends React.AllHTMLAttributes { + size?: any; +} + declare namespace FontAwesome { type FontAwesomeSize = 'lg' | '2x' | '3x' | '4x' | '5x'; type FontAwesomeStack = '1x' | '2x'; type FontAwesomeFlip = 'horizontal' | 'vertical'; - type FontAwesomeProps = React.HTMLProps | { + interface FontAwesomeProps extends Intermediate { ariaLabel?: string; border?: boolean; cssModule?: any; @@ -30,7 +34,7 @@ declare namespace FontAwesome { spin?: boolean; stack?: FontAwesomeStack; tag?: string; - }; + } } declare class FontAwesome extends React.Component {} From da8016d71fdfab5eaacd5114298ac1a8efc75ead Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Fri, 4 May 2018 22:56:50 +0200 Subject: [PATCH 1067/2153] feat(algoliasearch): rewrite almost completely (#25486) * feat(algoliasearch): rewrite almost completely Changes are mainly: 1. now has a `lite.d.ts` file for `algoliasearch/lite` 2. fix some of the options in settings and queries 3. specify more result types * chore: update version number * chore: fix things by copying, pasting, and removing * test: remove header * chore: move to folder, it maybe helps --- types/algoliasearch/algoliasearch-tests.ts | 28 +- types/algoliasearch/index.d.ts | 1269 +++++++++----------- types/algoliasearch/lite/index.d.ts | 624 ++++++++++ types/algoliasearch/tsconfig.json | 3 +- 4 files changed, 1209 insertions(+), 715 deletions(-) create mode 100644 types/algoliasearch/lite/index.d.ts diff --git a/types/algoliasearch/algoliasearch-tests.ts b/types/algoliasearch/algoliasearch-tests.ts index 0814b0fc03..b8cd1db6c5 100644 --- a/types/algoliasearch/algoliasearch-tests.ts +++ b/types/algoliasearch/algoliasearch-tests.ts @@ -2,16 +2,16 @@ import * as algoliasearch from 'algoliasearch'; import { ClientOptions, SynonymOption, - AlgoliaApiKeyOptions, + ApiKeyOptions, SearchSynonymOptions, - AlgoliaResponse, - AlgoliaSecuredApiOptions, - AlgoliaIndexSettings, - AlgoliaQueryParameters, - AlgoliaIndex, + SecuredApiOptions, + Index, + Response, + IndexSettings, + QueryParameters, } from 'algoliasearch'; -let _algoliaResponse: AlgoliaResponse = { +let _algoliaResponse: Response = { hits: [{}, {}], page: 0, nbHits: 12, @@ -33,7 +33,7 @@ let _synonymOption: SynonymOption = { replaceExistingSynonyms: false, }; -let _algoliaApiKeyOptions: AlgoliaApiKeyOptions = { +let _algoliaApiKeyOptions: ApiKeyOptions = { validity: 0, maxQueriesPerIPPerHour: 0, indexes: [''], @@ -48,14 +48,14 @@ let _searchSynonymOptions: SearchSynonymOptions = { hitsPerPage: 0, }; -let _algoliaSecuredApiOptions: AlgoliaSecuredApiOptions = { +let _algoliaSecuredApiOptions: SecuredApiOptions = { filters: '', validUntil: 0, restrictIndices: '', userToken: '', }; -let _algoliaIndexSettings: AlgoliaIndexSettings = { +let _algoliaIndexSettings: IndexSettings = { attributesToIndex: [''], attributesForFaceting: [''], unretrievableAttributes: [''], @@ -63,7 +63,7 @@ let _algoliaIndexSettings: AlgoliaIndexSettings = { ranking: [''], customRanking: [''], replicas: [''], - maxValuesPerFacet: '', + maxValuesPerFacet: 100, attributesToHighlight: [''], attributesToSnippet: [''], highlightPreTag: '', @@ -96,13 +96,13 @@ let _algoliaIndexSettings: AlgoliaIndexSettings = { placeholders: '', }; -let _algoliaQueryParameters: AlgoliaQueryParameters = { +let _algoliaQueryParameters: QueryParameters = { query: '', filters: '', attributesToRetrieve: [''], restrictSearchableAttributes: [''], facets: '', - maxValuesPerFacet: '', + maxValuesPerFacet: 2, attributesToHighlight: [''], attributesToSnippet: [''], highlightPreTag: '', @@ -147,7 +147,7 @@ let _algoliaQueryParameters: AlgoliaQueryParameters = { minProximity: 0, }; -let index: AlgoliaIndex = algoliasearch('', '').initIndex(''); +let index: Index = algoliasearch('', '').initIndex(''); let search = index.search({ query: '' }); index.search({ query: '' }, (err, res) => {}); diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index 3304ad579d..fca13ac161 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for algoliasearch-client-js 3.24.8 +// Type definitions for algoliasearch-client-js 3.27.0 // Project: https://github.com/algolia/algoliasearch-client-js // Definitions by: Baptiste Coquelle // Haroen Viaene @@ -7,87 +7,44 @@ // TypeScript Version: 2.2 declare namespace algoliasearch { - interface AlgoliaResponse { - /** - * Contains all the hits matching the query - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - hits: any[]; - /** - * Current page - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - page: number; - /** - * Number of total hits matching the query - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - nbHits: number; - /** - * Number of pages - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - nbPages: number; - /** - * Number of hits per pages - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - hitsPerPage: number; - /** - * Engine processing time (excluding network transfer) - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - processingTimeMS: number; - /** - * Query used to perform the search - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - query: string; - /** - * GET parameters used to perform the search - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - params: string; - } - interface AlgoliaMultiResponse { - results: AlgoliaResponse[]; - } - /* - Interface for the algolia client object - */ - interface AlgoliaClient { + /** + * Interface for the algolia client object + */ + interface Client { /** * Initialization of the index - * @param name: index name - * return algolia index object * https://github.com/algolia/algoliasearch-client-js#init-index---initindex */ - initIndex(name: string): AlgoliaIndex; + initIndex(indexName: string): Index; /** * Query on multiple index - * @param queries index name, query and query parameters - * @param cb callback(err, res) * https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries */ search( queries: { indexName: string; query: string; - params: AlgoliaQueryParameters; + params: QueryParameters; }[], - cb: (err: Error, res: AlgoliaMultiResponse) => void + cb: (err: Error, res: MultiResponse) => void ): void; /** * Query on multiple index - * @param queries index name, query and query parameters - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries */ - search(queries: { - indexName: string; - query: string; - params: AlgoliaQueryParameters; - }[]): Promise; + search( + queries: { + indexName: string; + query: string; + params: QueryParameters; + }[] + ): Promise; + /** + * Query for facet values of a specific facet + */ + searchForFacetValues( + queries: [{ indexName: string; params: SearchForFacetValues.Parameters }] + ): Promise; /** * clear browser cache * https://github.com/algolia/algoliasearch-client-js#cache @@ -107,336 +64,256 @@ declare namespace algoliasearch { */ getExtraHeader(name: string): string; /** - * remove an extra header for all upcoming requests + * Remove an extra header for all upcoming requests */ unsetExtraHeader(name: string): void; /** * List all your indices along with their associated information (number of entries, disk size, etc.) - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#list-indices---listindexes */ listIndexes(cb: (err: Error, res: any) => void): void; /** * List all your indices along with their associated information (number of entries, disk size, etc.) - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#list-indices---listindexes */ listIndexes(): Promise; /** * Delete a specific index - * @param name - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#delete-index---deleteindex */ - deleteIndex(name: string, cb: (err: Error, res: any) => void): void; + deleteIndex(name: string, cb: (err: Error, res: Task) => void): void; /** * Delete a specific index - * @param name - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#delete-index---deleteindex */ - deleteIndex(name: string): Promise; + deleteIndex(name: string): Promise; /** * Copy an index from a specific index to a new one - * @param from origin index - * @param to destination index - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#copy-index---copyindex */ copyIndex( from: string, to: string, - cb: (err: Error, res: any) => void + scope: ('settings' | 'synonyms' | 'rules')[], + cb: (err: Error, res: Task) => void ): void; /** * Copy an index from a specific index to a new one - * @param from origin index - * @param to destination index - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#copy-index---copyindex */ - copyIndex(from: string, to: string): Promise; + copyIndex( + from: string, + to: string, + scope: ('settings' | 'synonyms' | 'rules')[] + ): Promise; /** * Move index to a new one (and will overwrite the original one) - * @param from origin index - * @param to destination index - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#move-index---moveindex */ moveIndex( from: string, to: string, - cb: (err: Error, res: any) => void + cb: (err: Error, res: Task) => void ): void; /** * Move index to a new one (and will overwrite the original one) - * @param from origin index - * @param to destination index - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#move-index---moveindex */ - moveIndex(from: string, to: string): Promise; + moveIndex(from: string, to: string): Promise; /** * Generate a public API key - * @param key api key - * @param filters * https://github.com/algolia/algoliasearch-client-js#generate-key---generatesecuredapikey */ - generateSecuredApiKey( - key: string, - filters: AlgoliaSecuredApiOptions - ): string; + generateSecuredApiKey(key: string, filters: SecuredApiOptions): string; /** * Perform multiple operations with one API call to reduce latency - * @param action - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch */ - batch(action: AlgoliaAction[], cb: (err: Error, res: any) => void): void; + batch(action: Action[], cb: (err: Error, res: Task) => void): void; /** * Perform multiple operations with one API call to reduce latency - * @param action - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch */ - batch(action: AlgoliaAction[]): Promise; + batch(action: Action[]): Promise; /** * Lists global API Keys - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse */ listApiKeys(cb: (err: Error, res: any) => void): void; /** * Lists global API Keys - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse */ listApiKeys(): Promise; /** * Add global API Keys - * @param scopes - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey */ - addApiKey(scopes: string[], cb: (err: Error, res: any) => void): void; + addApiKey(scopes: string[], cb: (err: Error, res: Task) => void): void; /** * Add global API Key - * @param scopes - * @param options - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey */ addApiKey( scopes: string[], - options: AlgoliaApiKeyOptions, - cb: (err: Error, res: any) => void + options: ApiKeyOptions, + cb: (err: Error, res: Task) => void ): void; /** * Add global API Keys - * @param scopes - * @param options - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey */ - addApiKey(scopes: string[], options?: AlgoliaApiKeyOptions): Promise; + addApiKey(scopes: string[], options?: ApiKeyOptions): Promise; /** * Update global API key - * @param key - * @param scopes - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey */ updateApiKey( key: string, scopes: string[], - cb: (err: Error, res: any) => void + cb: (err: Error, res: Task) => void ): void; /** * Update global API key - * @param key - * @param scopes - * @param options - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey */ updateApiKey( key: string, scopes: string[], - options: AlgoliaApiKeyOptions, - cb: (err: Error, res: any) => void + options: ApiKeyOptions, + cb: (err: Error, res: Task) => void ): void; /** * Update global API key - * @param key - * @param scopes - * @param options - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey */ updateApiKey( key: string, scopes: string[], - options?: AlgoliaApiKeyOptions - ): Promise; + options?: ApiKeyOptions + ): Promise; /** * Gets the rights of a global key - * @param key - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey */ getApiKey(key: string, cb: (err: Error, res: any) => void): void; /** * Gets the rights of a global key - * @param key - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey */ getApiKey(key: string): Promise; /** * Deletes a global key - * @param key - * @param cb(err,res) * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteapikey */ - deleteApiKey(key: string, cb: (err: Error, res: any) => void): void; + deleteApiKey(key: string, cb: (err: Error, res: Task) => void): void; /** * Deletes a global key - * @param key - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteapikey */ - deleteApiKey(key: string): Promise; + deleteApiKey(key: string): Promise; /** * Get 1000 last events - * @param options - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs */ - getLogs(options: LogsOptions, cb: (err: Error, res: any) => void): void; + getLogs( + options: LogsOptions, + cb: (err: Error, res: { logs: Log[] }) => void + ): void; /** * Get 1000 last events - * @param options - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs */ - getLogs(options: LogsOptions): Promise; + getLogs(options: LogsOptions): Promise<{ logs: Log[] }>; } /** * Interface for the index algolia object */ - interface AlgoliaIndex { + interface Index { /** * Gets a specific object - * @param objectID - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects */ - getObject(objectID: string, cb: (err: Error, res: any) => void): void; + getObject(objectID: string, cb: (err: Error, res: {}) => void): void; /** * Gets specific attributes from an object - * @param objectID - * @param attributes - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects */ getObject( objectID: string, attributes: string[], - cb: (err: Error, res: any) => void + cb: (err: Error, res: {}) => void ): void; /** * Gets a list of objects - * @param objectIDs - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects */ - getObjects(objectIDs: string[], cb: (err: Error, res: any) => void): void; + getObjects( + objectIDs: string[], + cb: (err: Error, res: { results: {}[] }) => void + ): void; /** * Add a specific object - * @param object without objectID - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects */ - addObject(object: {}, cb: (err: Error, res: any) => void): void; + addObject(object: {}, cb: (err: Error, res: Task) => void): void; /** * Add a list of objects - * @param object with objectID - * @param objectID - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects */ addObject( object: {}, objectID: string, - cb: (err: Error, res: any) => void + cb: (err: Error, res: Task) => void ): void; /** * Add list of objects - * @param objects - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects */ - addObjects(objects: {}[], cb: (err: Error, res: any) => void): void; + addObjects(objects: {}[], cb: (err: Error, res: Task) => void): void; /** * Add or replace a specific object - * @param object - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects */ - saveObject(object: {}, cb: (err: Error, res: any) => void): void; + saveObject(object: {}, cb: (err: Error, res: Task) => void): void; /** * Add or replace several objects - * @param objects - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects */ - saveObjects(objects: object[], cb: (err: Error, res: any) => void): void; + saveObjects(objects: object[], cb: (err: Error, res: Task) => void): void; /** * Update parameters of a specific object - * @param object - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects */ - partialUpdateObject(object: {}, cb: (err: Error, res: any) => void): void; + partialUpdateObject(object: {}, cb: (err: Error, res: Task) => void): void; /** * Update parameters of a list of objects - * @param objects - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects */ partialUpdateObjects( objects: {}[], - cb: (err: Error, res: any) => void + cb: (err: Error, res: Task) => void ): void; /** * Delete a specific object - * @param objectID - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects */ - deleteObject(objectID: string, cb: (err: Error, res: any) => void): void; + deleteObject(objectID: string, cb: (err: Error, res: Task) => void): void; /** * Delete a list of objects - * @param objectIDs - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects */ deleteObjects( objectIDs: string[], - cb: (err: Error, res: any) => void + cb: (err: Error, res: Task) => void ): void; /** * Delete objects that matches the query - * @param query - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery */ deleteByQuery(query: string, cb: (err: Error, res: any) => void): void; /** * Delete objects that matches the query - * @param query - * @param params of the object - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery */ deleteByQuery( @@ -446,34 +323,26 @@ declare namespace algoliasearch { ): void; /** * Delete objects that matches the query - * @param query - * @param params of the object - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deleteby */ - deleteBy(params: {}, cb: (err: Error, res: any) => void): void; + deleteBy(params: {}, cb: (err: Error, res: Task) => void): void; /** * Wait for an indexing task to be compete - * @param taskID - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#wait-for-operations---waittask */ waitTask(taskID: number, cb: (err: Error, res: any) => void): void; /** * Get an index settings - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#get-settings---getsettings */ - getSettings(cb: (err: Error, res: any) => void): void; + getSettings(cb: (err: Error, res: IndexSettings) => void): void; /** * Set an index settings - * @param settings - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings */ setSettings( - settings: AlgoliaIndexSettings, - cb: (err: Error, res: any) => void + settings: IndexSettings, + cb: (err: Error, res: Task) => void ): void; /** * Clear cache of an index @@ -482,66 +351,53 @@ declare namespace algoliasearch { clearCache(): void; /** * Clear an index content - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#clear-index---clearindex */ - clearIndex(cb: (err: Error, res: any) => void): void; + clearIndex(cb: (err: Error, res: Task) => void): void; /** * Save a synonym object - * @param synonym - * @param options - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym */ saveSynonym( - synonym: AlgoliaSynonym, + synonym: Synonym, options: SynonymOption, - cb: (err: Error, res: any) => void + cb: (err: Error, res: Task) => void ): void; /** * Save a synonym object - * @param synonyms - * @param options - * @param cb(err, res) */ batchSynonyms( - synonyms: AlgoliaSynonym[], + synonyms: Synonym[], options: SynonymOption, - cb: (err: Error, res: any) => void + cb: (err: Error, res: Task) => void ): void; /** * Delete a specific synonym - * @param identifier - * @param options - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#batch-synonyms---batchsynonyms */ deleteSynonym( identifier: string, options: SynonymOption, - cb: (err: Error, res: any) => void + cb: (err: Error, res: Task) => void ): void; /** * Clear all synonyms of an index - * @param options - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#clear-all-synonyms---clearsynonyms */ clearSynonyms( options: SynonymOption, - cb: (err: Error, res: any) => void + cb: (err: Error, res: Task) => void ): void; /** * Get a specific synonym - * @param identifier - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#get-synonym---getsynonym */ - getSynonym(identifier: string, cb: (err: Error, res: any) => void): void; + getSynonym( + identifier: string, + cb: (err: Error, res: Synonym) => void + ): void; /** * Search a synonyms - * @param options - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms */ searchSynonyms( @@ -550,57 +406,42 @@ declare namespace algoliasearch { ): void; /** * Save a rule object - * @param rule - * @param options - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#save-rule---saverule */ saveRule( - rule: AlgoliaRule, + rule: Rule, options: RuleOption, - cb: (err: Error, res: any) => void + cb: (err: Error, res: Task) => void ): void; /** * Save a rule object - * @param rules - * @param options - * @param cb(err, res) */ batchRules( - rules: AlgoliaRule[], + rules: Rule[], options: RuleOption, - cb: (err: Error, res: any) => void + cb: (err: Error, res: Task) => void ): void; /** * Delete a specific rule - * @param identifier - * @param options - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#batch-rules---batchrules */ deleteRule( identifier: string, options: RuleOption, - cb: (err: Error, res: any) => void + cb: (err: Error, res: Task) => void ): void; /** * Clear all rules of an index - * @param options - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#clear-all-rules---clearrules */ - clearRules(options: RuleOption, cb: (err: Error, res: any) => void): void; + clearRules(options: RuleOption, cb: (err: Error, res: Task) => void): void; /** * Get a specific rule - * @param identifier - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#get-rule---getrule */ - getRule(identifier: string, cb: (err: Error, res: any) => void): void; + getRule(identifier: string, cb: (err: Error, res: Rule) => void): void; /** * Search a rules - * @param options - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#search-rules---searchrules */ searchRules( @@ -609,403 +450,284 @@ declare namespace algoliasearch { ): void; /** * List index user keys - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#list-api-keys---listapikeys */ listApiKeys(cb: (err: Error, res: any) => void): void; /** * Add key for this index - * @param scopes - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey */ - addApiKey(scopes: string[], cb: (err: Error, res: any) => void): void; + addApiKey(scopes: string[], cb: (err: Error, res: Task) => void): void; /** * Add key for this index - * @param scopes - * @param options - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey */ addApiKey( scopes: string[], - options: AlgoliaApiKeyOptions, - cb: (err: Error, res: any) => void + options: ApiKeyOptions, + cb: (err: Error, res: Task) => void ): void; /** * Update a key for this index - * @param key - * @param scopes - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey */ updateApiKey( key: string, scopes: string[], - cb: (err: Error, res: any) => void + cb: (err: Error, res: Task) => void ): void; /** * Update a key for this index - * @param key - * @param scopes - * @param options - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey */ updateApiKey( key: string, scopes: string[], - options: AlgoliaApiKeyOptions, - cb: (err: Error, res: any) => void + options: ApiKeyOptions, + cb: (err: Error, res: Task) => void ): void; /** * Gets the rights of an index specific key - * @param key - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#get-key-permissions---getapikeyacl */ getApiKey(key: string, cb: (err: Error, res: any) => void): void; /** * Deletes an index specific key - * @param key - * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteapikey */ - deleteApiKey(key: string, cb: (err: Error, res: any) => void): void; + deleteApiKey(key: string, cb: (err: Error, res: Task) => void): void; /** * Gets specific attributes from an object - * @param objectID - * @param attributes - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects */ - getObject(objectID: string, attributes?: string[]): Promise; + getObject(objectID: string, attributes?: string[]): Promise<{}>; /** * Gets a list of objects - * @param objectIDs - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects */ - getObjects(objectIDs: string[]): Promise; + getObjects(objectIDs: string[]): Promise<{ results: {}[] }>; /** * Add a list of objects - * @param object with objectID - * @param objectID - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects */ - addObject(object: {}, objectID?: string): Promise; + addObject(object: {}, objectID?: string): Promise; /** * Add list of objects - * @param objects - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects */ - addObjects(objects: {}[]): Promise; + addObjects(objects: {}[]): Promise; /** * Add or replace a specific object - * @param object - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects */ - saveObject(object: {}): Promise; + saveObject(object: {}): Promise; /** * Add or replace several objects - * @param objects - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects */ - saveObjects(objects: object[]): Promise; + saveObjects(objects: object[]): Promise; /** * Update parameters of a specific object - * @param object - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects */ - partialUpdateObject(object: {}): Promise; + partialUpdateObject(object: {}): Promise; /** * Update parameters of a list of objects - * @param objects - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects */ - partialUpdateObjects(objects: {}[]): Promise; + partialUpdateObjects(objects: {}[]): Promise; /** * Delete a specific object - * @param objectID - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects */ - deleteObject(objectID: string): Promise; + deleteObject(objectID: string): Promise; /** * Delete a list of objects - * @param objectIDs - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects */ - deleteObjects(objectIDs: string[]): Promise; + deleteObjects(objectIDs: string[]): Promise; /** * Delete objects that matches the query - * @param query - * @param params of the object - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery */ deleteByQuery(query: string, params?: {}): Promise; /** * Delete objects that matches the query - * @param params of the search - * return {Promise} * https://www.algolia.com/doc/api-reference/api-methods/delete-by-query/ */ - deleteBy(params: {}): Promise; + deleteBy(params: {}): Promise; /** * Wait for an indexing task to be compete - * @param taskID - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#wait-for-operations---waittask */ waitTask(taskID: number): Promise; /** * Get an index settings - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#get-settings---getsettings */ - getSettings(): Promise; + getSettings(): Promise; /** * Set an index settings - * @param settings - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings */ - setSettings(settings: AlgoliaIndexSettings): Promise; + setSettings(settings: IndexSettings): Promise; /** * Search in an index - * @param params query parameter - * return {Promise} - * @param err() error callback * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search */ - search(params: AlgoliaQueryParameters): Promise; + search(params: QueryParameters): Promise; /** * Search in an index - * @param params query parameter - * @param cb(err, res) - * @param err() error callback * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search */ search( - params: AlgoliaQueryParameters, - cb: (err: Error, res: AlgoliaResponse) => void + params: QueryParameters, + cb: (err: Error, res: Response) => void ): void; /** * Search in an index - * @param params query parameter - * return {Promise} - * @param err() error callback * https://www.algolia.com/doc/api-reference/api-methods/search-for-facet-values/ */ - searchForFacetValues(options: { - facetName: string; - facetQuery: string; - } & AlgoliaQueryParameters): Promise; + searchForFacetValues( + options: SearchForFacetValues.Parameters + ): Promise; /** * Search in an index - * @param params query parameter - * @param cb(err, res) - * @param err() error callback * https://www.algolia.com/doc/api-reference/api-methods/search-for-facet-values/ */ - searchForFacetValues(options: { - facetName: string; - facetQuery: string; - } & AlgoliaQueryParameters, - cb: (err: Error, res: any) => void + searchForFacetValues( + options: SearchForFacetValues.Parameters, + cb: (err: Error, res: SearchForFacetValues.Response) => void ): void; /** * Browse an index - * @param query - * @param cb(err, content) * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse */ - browse(query: string, cb: (err: Error, res: any) => void): void; + browse(query: string, cb: (err: Error, res: BrowseResponse) => void): void; /** * Browse an index - * @param query - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse */ - browse(query: string): Promise; + browse(query: string): Promise; /** * Browse an index from a cursor - * @param cursor - * @param cb(err, content) * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse */ - browseFrom(cursor: string, cb: (err: Error, res: any) => void): void; + browseFrom( + cursor: string, + cb: (err: Error, res: BrowseResponse) => void + ): void; /** * Browse an index from a cursor - * @param cursor - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse */ - browseFrom(cursor: string): Promise; + browseFrom(cursor: string): Promise; /** * Browse an entire index - * return Promise * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse */ - browseAll(): Promise; + browseAll(): Promise; /** * Clear an index content - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#clear-index---clearindex */ - clearIndex(): Promise; + clearIndex(): Promise; /** * Save a synonym object - * @param synonym - * @param options - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym */ - saveSynonym(synonym: AlgoliaSynonym, options: SynonymOption): Promise; + saveSynonym(synonym: Synonym, options: SynonymOption): Promise; /** * Save a synonym object - * @param synonyms - * @param options - * return {Promise} */ - batchSynonyms( - synonyms: AlgoliaSynonym[], - options: SynonymOption - ): Promise; + batchSynonyms(synonyms: Synonym[], options: SynonymOption): Promise; /** * Delete a specific synonym - * @param identifier - * @param options - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#batch-synonyms---batchsynonyms */ - deleteSynonym(identifier: string, options: SynonymOption): Promise; + deleteSynonym(objectID: string, options: SynonymOption): Promise; /** * Clear all synonyms of an index - * @param options - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#clear-all-synonyms---clearsynonyms */ - clearSynonyms(options: SynonymOption): Promise; + clearSynonyms(options: SynonymOption): Promise; /** * Get a specific synonym - * @param identifier - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#get-synonym---getsynonym */ - getSynonym(identifier: string): Promise; + getSynonym(objectID: string): Promise; /** * Search a synonyms - * @param options - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms */ searchSynonyms(options: SearchSynonymOptions): Promise; /** * Save a rule object - * @param rule - * @param options - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#save-rule---saverule */ - saveRule(rule: AlgoliaRule, options: RuleOption): Promise; + saveRule(rule: Rule, options: RuleOption): Promise; /** * Save a rule object - * @param rules - * @param options - * return {Promise} */ - batchRules(rules: AlgoliaRule[], options: RuleOption): Promise; + batchRules(rules: Rule[], options: RuleOption): Promise; /** * Delete a specific rule - * @param identifier - * @param options - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#batch-rules---batchrules */ - deleteRule(identifier: string, options: RuleOption): Promise; + deleteRule(identifier: string, options: RuleOption): Promise; /** * Clear all query rules of an index - * @param options - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#clear-all-rules---clearrules */ - clearRules(options: RuleOption): Promise; + clearRules(options: RuleOption): Promise; /** * Get a specific query rule - * @param identifier - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#get-rule---getrule */ - getRule(identifier: string): Promise; + getRule(identifier: string): Promise; /** * Search for query rules - * @param options - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#search-rules---searchrules */ searchRules(options: SearchRuleOptions): Promise; /** * List index user keys - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#list-api-keys---listapikeys */ listApiKeys(): Promise; /** * Add key for this index - * @param scopes - * @param options - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey */ - addApiKey(scopes: string[], options?: AlgoliaApiKeyOptions): Promise; + addApiKey(scopes: string[], options?: ApiKeyOptions): Promise; /** * Update a key for this index - * @param key - * @param scopes - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey */ - updateApiKey(key: string, scopes: string[]): Promise; + updateApiKey(key: string, scopes: string[]): Promise; /** * Update a key for this index - * @param key - * @param scopes - * @param options - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey */ updateApiKey( key: string, scopes: string[], - options: AlgoliaApiKeyOptions - ): Promise; + options: ApiKeyOptions + ): Promise; /** * Gets the rights of an index specific key - * @param key - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#get-key-permissions---getapikeyacl */ getApiKey(key: string): Promise; /** * Deletes an index specific key - * @param key - * return {Promise} * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteapikey */ - deleteApiKey(key: string): Promise; + deleteApiKey(key: string): Promise; } - /* -Interface describing available options when initializing a client -*/ + /** + * Interface describing available options when initializing a client + */ interface ClientOptions { /** * Timeout for requests to our servers, in milliseconds @@ -1020,20 +742,20 @@ Interface describing available options when initializing a client */ protocol?: string; /** - * (node only) httpAgent instance to use when communicating with Algolia servers. + * (node only) httpAgent instance to use when communicating with servers. * https://github.com/algolia/algoliasearch-client-js#client-options */ httpAgent?: any; /** - * read: array of read hosts to use to call Algolia servers, computed automatically - * write: array of read hosts to use to call Algolia servers, computed automatically + * read: array of read hosts to use to call servers, computed automatically + * write: array of read hosts to use to call servers, computed automatically * https://github.com/algolia/algoliasearch-client-js#client-options */ hosts?: { read?: string[]; write?: string[] }; } - /* -Interface describing options available for gettings the logs -*/ + /** + * Interface describing options available for gettings the logs + */ interface LogsOptions { /** * Specify the first entry to retrieve (0-based, 0 is the most recent log entry). @@ -1062,11 +784,15 @@ Interface describing options available for gettings the logs * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs */ type?: string; + /** + * The index to request logs from + */ + indexName?: string; } /** * Describe the action object used for batch operation */ - interface AlgoliaAction { + interface Action { /** * Type of the batch action * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch @@ -1093,7 +819,7 @@ Interface describing options available for gettings the logs /** * Describes the option used when creating user key */ - interface AlgoliaApiKeyOptions { + interface ApiKeyOptions { /** * Add a validity period. The key will be valid for a specific period of time (in seconds). * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey @@ -1123,7 +849,7 @@ Interface describing options available for gettings the logs * Specify the list of query parameters * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey */ - queryParameters?: AlgoliaQueryParameters; + queryParameters?: QueryParameters; /** * Specify a description to describe where the key is used. * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey @@ -1216,9 +942,9 @@ Interface describing options available for gettings the logs */ hitsPerPage?: number; } - interface AlgoliaBrowseResponse { + interface BrowseResponse { cursor?: string; - hits: any[]; + hits: {}[]; params: string; query: string; processingTimeMS: number; @@ -1226,7 +952,7 @@ Interface describing options available for gettings the logs /** * Describes a synonym object */ - interface AlgoliaSynonym { + interface Synonym { /** * ObjectID of the synonym * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym @@ -1246,7 +972,7 @@ Interface describing options available for gettings the logs /** * Describes a query rule object */ - interface AlgoliaRule { + interface Rule { /** * ObjectID of the synonym * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym @@ -1332,7 +1058,7 @@ Interface describing options available for gettings the logs /** * Describes the options used when generating new api keys */ - interface AlgoliaSecuredApiOptions { + interface SecuredApiOptions { /** * Filter the query with numeric, facet or/and tag filters * default: "" @@ -1355,266 +1081,7 @@ Interface describing options available for gettings the logs */ userToken?: string; } - - /** - * Describes the settings available for configure your index - */ - interface AlgoliaIndexSettings { - /** - * The list of attributes you want index - * default: * - * https://github.com/algolia/algoliasearch-client-js#attributestoindex - */ - attributesToIndex?: string[]; - /** - * The list of attributes you want to use for faceting - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributesforfaceting - */ - attributesForFaceting?: string[]; - /** - * The list of attributes that cannot be retrieved at query time - * default: null - * https://github.com/algolia/algoliasearch-client-js#unretrievableattributes - */ - unretrievableAttributes?: string[]; - /** - * List of attributes you want to use for textual search - * default: [] - * https://github.com/algolia/algoliasearch-client-js#searchableattributes - */ - searchableAttributes?: string[]; - /** - * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer - * default: * - * https://github.com/algolia/algoliasearch-client-js#attributestoretrieve - */ - attributesToRetrieve?: string[]; - /** - * Controls the way results are sorted - * default: ['typo', 'geo', 'words', 'filters', 'proximity', 'attribute', 'exact', 'custom'] - * https://github.com/algolia/algoliasearch-client-js#ranking - */ - ranking?: string[]; - /** - * Lets you specify part of the ranking - * default: [] - * https://github.com/algolia/algoliasearch-client-js#customranking - */ - customRanking?: string[]; - /** - * The list of indices on which you want to replicate all write operations - * default: [] - * https://github.com/algolia/algoliasearch-client-js#replicas - */ - replicas?: string[]; - /** - * Limit the number of facet values returned for each facet - * default: "" - * https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet - */ - maxValuesPerFacet?: string; - /** - * Default list of attributes to highlight. If set to null, all indexed attributes are highlighted. - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestohighlight - */ - attributesToHighlight?: string[]; - /** - * Default list of attributes to snippet alongside the number of words to return - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestosnippet - */ - attributesToSnippet?: string[]; - /** - * Specify the string that is inserted before the highlighted parts in the query result - * default: - * https://github.com/algolia/algoliasearch-client-js#highlightpretag - */ - highlightPreTag?: string; - /** - * Specify the string that is inserted after the highlighted parts in the query result - * default: - * https://github.com/algolia/algoliasearch-client-js#highlightposttag - */ - highlightPostTag?: string; - /** - * String used as an ellipsis indicator when a snippet is truncated. - * default: … - * https://github.com/algolia/algoliasearch-client-js#snippetellipsistext - */ - snippetEllipsisText?: string; - /** - * If set to true, restrict arrays in highlights and snippets to items that matched the query at least partially else return all array items in highlights and snippets - * default: false - * https://github.com/algolia/algoliasearch-client-js#restricthighlightandsnippetarrays - */ - restrictHighlightAndSnippetArrays?: boolean; - /** - * Pagination parameter used to select the number of hits per page - * default: 20 - * https://github.com/algolia/algoliasearch-client-js#hitsperpage - */ - hitsPerPage?: number; - /** - * The minimum number of characters needed to accept one typo - * default: 4 - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor1typo - */ - minWordSizefor1Typo?: number; - /** - * The minimum number of characters needed to accept two typos. - * default: 8 - * https://github.com/algolia/algoliasearch-client-js#highlightposttag - */ - minWordSizefor2Typos?: number; - /** - * This option allows you to control the number of typos allowed in the result set - * default: true - * 'true' The typo tolerance is enabled and all matching hits are retrieved (default behavior). - * 'false' The typo tolerance is disabled. All results with typos will be hidden. - * 'min' Only keep results with the minimum number of typos. For example, if one result matches without typos, then all results with typos will be hidden. - * 'strict' Hits matching with 2 typos are not retrieved if there are some matching without typos. - * https://github.com/algolia/algoliasearch-client-js#typotolerance - */ - typoTolerance?: any; - /** - * If set to false, disables typo tolerance on numeric tokens (numbers). - * default: true - * https://github.com/algolia/algoliasearch-client-js#allowtyposonnumerictokens - */ - allowTyposOnNumericTokens?: boolean; - /** - * If set to true, plural won't be considered as a typo - * default: false - * https://github.com/algolia/algoliasearch-client-js#ignoreplurals - */ - ignorePlurals?: boolean; - /** - * List of attributes on which you want to disable typo tolerance - * default: "" - * https://github.com/algolia/algoliasearch-client-js#disabletypotoleranceonattributes - */ - disableTypoToleranceOnAttributes?: string; - /** - * Specify the separators (punctuation characters) to index. - * default: "" - * https://github.com/algolia/algoliasearch-client-js#separatorstoindex - */ - separatorsToIndex?: string; - /** - * Selects how the query words are interpreted - * default: 'prefixLast' - * 'prefixAll' All query words are interpreted as prefixes. This option is not recommended. - * 'prefixLast' Only the last word is interpreted as a prefix (default behavior). - * 'prefixNone' No query word is interpreted as a prefix. This option is not recommended. - * https://github.com/algolia/algoliasearch-client-js#querytype - */ - queryType?: any; - /** - * This option is used to select a strategy in order to avoid having an empty result page - * default: 'none' - * 'lastWords' When a query does not return any results, the last word will be added as optional - * 'firstWords' When a query does not return any results, the first word will be added as optional - * 'allOptional' When a query does not return any results, a second trial will be made with all words as optional - * 'none' No specific processing is done when a query does not return any results - * https://github.com/algolia/algoliasearch-client-js#removewordsifnoresults - */ - removeWordsIfNoResults?: string; - /** - * Enables the advanced query syntax - * default: false - * https://github.com/algolia/algoliasearch-client-js#advancedsyntax - */ - advancedSyntax?: boolean; - /** - * A string that contains the comma separated list of words that should be considered as optional when found in the query - * default: [] - * https://github.com/algolia/algoliasearch-client-js#optionalwords - */ - optionalWords?: string[]; - /** - * Remove stop words from the query before executing it - * default: false - * true|false: enable or disable stop words for all 41 supported languages; or - * a list of language ISO codes (as a comma-separated string) for which stop words should be enable - * https://github.com/algolia/algoliasearch-client-js#removestopwords - */ - removeStopWords?: string[]; - /** - * List of attributes on which you want to disable prefix matching - * default: [] - * https://github.com/algolia/algoliasearch-client-js#disableprefixonattributes - */ - disablePrefixOnAttributes?: string[]; - /** - * List of attributes on which you want to disable the computation of exact criteria - * default: [] - * https://github.com/algolia/algoliasearch-client-js#disableexactonattributes - */ - disableExactOnAttributes?: string[]; - /** - * This parameter control how the exact ranking criterion is computed when the query contains one word - * default: attribute - * 'none': no exact on single word query - * 'word': exact set to 1 if the query word is found in the record - * 'attribute': exact set to 1 if there is an attribute containing a string equals to the query - * https://github.com/algolia/algoliasearch-client-js#exactonsinglewordquery - */ - exactOnSingleWordQuery?: string; - /** - * Specify the list of approximation that should be considered as an exact match in the ranking formula - * default: ['ignorePlurals', 'singleWordSynonym'] - * 'ignorePlurals': alternative words added by the ignorePlurals feature - * 'singleWordSynonym': single-word synonym (For example "NY" = "NYC") - * 'multiWordsSynonym': multiple-words synonym - * https://github.com/algolia/algoliasearch-client-js#alternativesasexact - */ - alternativesAsExact?: any; - /** - * The name of the attribute used for the Distinct feature - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributefordistinct - */ - attributeForDistinct?: string; - /** - * If set to 1, enables the distinct feature, disabled by default, if the attributeForDistinct index setting is set. - * https://github.com/algolia/algoliasearch-client-js#distinct - */ - distinct?: any; - /** - * All numerical attributes are automatically indexed as numerical filters - * default '' - * https://github.com/algolia/algoliasearch-client-js#numericattributestoindex - */ - numericAttributesToIndex?: string[]; - /** - * Allows compression of big integer arrays. - * default: false - * https://github.com/algolia/algoliasearch-client-js#allowcompressionofintegerarray - */ - allowCompressionOfIntegerArray?: boolean; - /** - * Specify alternative corrections that you want to consider. - * default: [] - * https://github.com/algolia/algoliasearch-client-js#altcorrections - */ - altCorrections?: {}[]; - /** - * Configure the precision of the proximity ranking criterion - * default: 1 - * https://github.com/algolia/algoliasearch-client-js#minproximity - */ - minProximity?: number; - /** - * This is an advanced use-case to define a token substitutable by a list of words without having the original token searchable - * default: '' - * https://github.com/algolia/algoliasearch-client-js#placeholders - */ - placeholders?: any; - } - - interface AlgoliaQueryParameters { + interface QueryParameters { /** * Query string used to perform the search * default: '' @@ -1650,7 +1117,7 @@ Interface describing options available for gettings the logs * default: "" * https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet */ - maxValuesPerFacet?: string; + maxValuesPerFacet?: number; /** * Default list of attributes to highlight. If set to null, all indexed attributes are highlighted. * default: null @@ -1922,6 +1389,408 @@ Interface describing options available for gettings the logs * https://github.com/algolia/algoliasearch-client-js#minproximity */ minProximity?: number; + + nbShards?: number; + userData?: string | object; + } + + interface AlgoliaResponse { + /** + * Contains all the hits matching the query + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + hits: any[]; + /** + * Current page + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + page: number; + /** + * Number of total hits matching the query + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + nbHits: number; + /** + * Number of pages + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + nbPage: number; + /** + * Number of hits per pages + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + hitsPerPage: number; + /** + * Engine processing time (excluding network transfer) + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + processingTimeMS: number; + /** + * Query used to perform the search + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + query: string; + /** + * GET parameters used to perform the search + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + params: string; + facets: { + [facetName: string]: { [facetValue: string]: number }; + }; + } + + namespace SearchForFacetValues { + interface Parameters extends QueryParameters { + /** + * The facet to search in + */ + facetName: string; + /** + * The query for the search in this facet + */ + facetQuery: string; + } + + interface Response { + facetHits: { value: string; highlighted: string; count: number }[]; + exhaustiveFacetsCount: boolean; + processingTimeMS: number; + } + } + + interface Log { + timestamp: string; + method: string; + answer_code: number; + query_body: string; + answer: string; + url: string; + ip: string; + query_headers: string; + sha1: string; + nb_api_calls: string; + index: string; + query_params: string; + query_nb_hits: string; + processing_time_ms: string; + exhaustive_faceting?: false; + exhaustive_nb_hits?: false; + } + + interface Task { + taskID: number; + } + + interface IndexSettings { + /** + * The list of attributes you want index + * default: * + * https://github.com/algolia/algoliasearch-client-js#attributestoindex + */ + attributesToIndex?: string[]; + /** + * The list of attributes you want to use for faceting + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributesforfaceting + */ + attributesForFaceting?: string[]; + /** + * The list of attributes that cannot be retrieved at query time + * default: null + * https://github.com/algolia/algoliasearch-client-js#unretrievableattributes + */ + unretrievableAttributes?: string[]; + /** + * List of attributes you want to use for textual search + * default: [] + * https://github.com/algolia/algoliasearch-client-js#searchableattributes + */ + searchableAttributes?: string[]; + /** + * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer + * default: * + * https://github.com/algolia/algoliasearch-client-js#attributestoretrieve + */ + attributesToRetrieve?: string[]; + /** + * Controls the way results are sorted + * default: ['typo', 'geo', 'words', 'filters', 'proximity', 'attribute', 'exact', 'custom'] + * https://github.com/algolia/algoliasearch-client-js#ranking + */ + ranking?: string[]; + /** + * Lets you specify part of the ranking + * default: [] + * https://github.com/algolia/algoliasearch-client-js#customranking + */ + customRanking?: string[]; + /** + * The list of indices on which you want to replicate all write operations + * default: [] + * https://github.com/algolia/algoliasearch-client-js#replicas + */ + replicas?: string[]; + /** + * Limit the number of facet values returned for each facet + * default: "" + * https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet + */ + maxValuesPerFacet?: number; + /** + * Default list of attributes to highlight. If set to null, all indexed attributes are highlighted. + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributestohighlight + */ + attributesToHighlight?: string[]; + /** + * Default list of attributes to snippet alongside the number of words to return + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributestosnippet + */ + attributesToSnippet?: string[]; + /** + * Specify the string that is inserted before the highlighted parts in the query result + * default: + * https://github.com/algolia/algoliasearch-client-js#highlightpretag + */ + highlightPreTag?: string; + /** + * Specify the string that is inserted after the highlighted parts in the query result + * default: + * https://github.com/algolia/algoliasearch-client-js#highlightposttag + */ + highlightPostTag?: string; + /** + * String used as an ellipsis indicator when a snippet is truncated. + * default: … + * https://github.com/algolia/algoliasearch-client-js#snippetellipsistext + */ + snippetEllipsisText?: string; + /** + * If set to true, restrict arrays in highlights and snippets to items that matched the query at least partially else return all array items in highlights and snippets + * default: false + * https://github.com/algolia/algoliasearch-client-js#restricthighlightandsnippetarrays + */ + restrictHighlightAndSnippetArrays?: boolean; + /** + * Pagination parameter used to select the number of hits per page + * default: 20 + * https://github.com/algolia/algoliasearch-client-js#hitsperpage + */ + hitsPerPage?: number; + /** + * The minimum number of characters needed to accept one typo + * default: 4 + * https://github.com/algolia/algoliasearch-client-js#minwordsizefor1typo + */ + minWordSizefor1Typo?: number; + /** + * The minimum number of characters needed to accept two typos. + * default: 8 + * https://github.com/algolia/algoliasearch-client-js#highlightposttag + */ + minWordSizefor2Typos?: number; + /** + * This option allows you to control the number of typos allowed in the result set + * default: true + * 'true' The typo tolerance is enabled and all matching hits are retrieved (default behavior). + * 'false' The typo tolerance is disabled. All results with typos will be hidden. + * 'min' Only keep results with the minimum number of typos. For example, if one result matches without typos, then all results with typos will be hidden. + * 'strict' Hits matching with 2 typos are not retrieved if there are some matching without typos. + * https://github.com/algolia/algoliasearch-client-js#typotolerance + */ + typoTolerance?: any; + /** + * If set to false, disables typo tolerance on numeric tokens (numbers). + * default: true + * https://github.com/algolia/algoliasearch-client-js#allowtyposonnumerictokens + */ + allowTyposOnNumericTokens?: boolean; + /** + * If set to true, plural won't be considered as a typo + * default: false + * https://github.com/algolia/algoliasearch-client-js#ignoreplurals + */ + ignorePlurals?: boolean; + /** + * List of attributes on which you want to disable typo tolerance + * default: "" + * https://github.com/algolia/algoliasearch-client-js#disabletypotoleranceonattributes + */ + disableTypoToleranceOnAttributes?: string; + /** + * Specify the separators (punctuation characters) to index. + * default: "" + * https://github.com/algolia/algoliasearch-client-js#separatorstoindex + */ + separatorsToIndex?: string; + /** + * Selects how the query words are interpreted + * default: 'prefixLast' + * 'prefixAll' All query words are interpreted as prefixes. This option is not recommended. + * 'prefixLast' Only the last word is interpreted as a prefix (default behavior). + * 'prefixNone' No query word is interpreted as a prefix. This option is not recommended. + * https://github.com/algolia/algoliasearch-client-js#querytype + */ + queryType?: any; + /** + * This option is used to select a strategy in order to avoid having an empty result page + * default: 'none' + * 'lastWords' When a query does not return any results, the last word will be added as optional + * 'firstWords' When a query does not return any results, the first word will be added as optional + * 'allOptional' When a query does not return any results, a second trial will be made with all words as optional + * 'none' No specific processing is done when a query does not return any results + * https://github.com/algolia/algoliasearch-client-js#removewordsifnoresults + */ + removeWordsIfNoResults?: string; + /** + * Enables the advanced query syntax + * default: false + * https://github.com/algolia/algoliasearch-client-js#advancedsyntax + */ + advancedSyntax?: boolean; + /** + * A string that contains the comma separated list of words that should be considered as optional when found in the query + * default: [] + * https://github.com/algolia/algoliasearch-client-js#optionalwords + */ + optionalWords?: string[]; + /** + * Remove stop words from the query before executing it + * default: false + * true|false: enable or disable stop words for all 41 supported languages; or + * a list of language ISO codes (as a comma-separated string) for which stop words should be enable + * https://github.com/algolia/algoliasearch-client-js#removestopwords + */ + removeStopWords?: string[]; + /** + * List of attributes on which you want to apply word-splitting ("decompounding") for + * each of the languages supported (German, Dutch, and Finnish as of 05/2018) + * default: {de: [], nl: [], fi: []} + */ + decompoundedAttributes?: { [key in Partial<'nl' | 'de' | 'fi'>]: string[] }; + /** + * List of attributes on which you want to disable prefix matching + * default: [] + * https://github.com/algolia/algoliasearch-client-js#disableprefixonattributes + */ + disablePrefixOnAttributes?: string[]; + /** + * List of attributes on which you want to disable the computation of exact criteria + * default: [] + * https://github.com/algolia/algoliasearch-client-js#disableexactonattributes + */ + disableExactOnAttributes?: string[]; + /** + * This parameter control how the exact ranking criterion is computed when the query contains one word + * default: attribute + * 'none': no exact on single word query + * 'word': exact set to 1 if the query word is found in the record + * 'attribute': exact set to 1 if there is an attribute containing a string equals to the query + * https://github.com/algolia/algoliasearch-client-js#exactonsinglewordquery + */ + exactOnSingleWordQuery?: string; + /** + * Specify the list of approximation that should be considered as an exact match in the ranking formula + * default: ['ignorePlurals', 'singleWordSynonym'] + * 'ignorePlurals': alternative words added by the ignorePlurals feature + * 'singleWordSynonym': single-word synonym (For example "NY" = "NYC") + * 'multiWordsSynonym': multiple-words synonym + * https://github.com/algolia/algoliasearch-client-js#alternativesasexact + */ + alternativesAsExact?: any; + /** + * The name of the attribute used for the Distinct feature + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributefordistinct + */ + attributeForDistinct?: string; + /** + * If set to 1, enables the distinct feature, disabled by default, if the attributeForDistinct index setting is set. + * https://github.com/algolia/algoliasearch-client-js#distinct + */ + distinct?: any; + /** + * All numerical attributes are automatically indexed as numerical filters + * default '' + * https://github.com/algolia/algoliasearch-client-js#numericattributestoindex + */ + numericAttributesToIndex?: string[]; + /** + * Allows compression of big integer arrays. + * default: false + * https://github.com/algolia/algoliasearch-client-js#allowcompressionofintegerarray + */ + allowCompressionOfIntegerArray?: boolean; + /** + * Specify alternative corrections that you want to consider. + * default: [] + * https://github.com/algolia/algoliasearch-client-js#altcorrections + */ + altCorrections?: {}[]; + /** + * Configure the precision of the proximity ranking criterion + * default: 1 + * https://github.com/algolia/algoliasearch-client-js#minproximity + */ + minProximity?: number; + /** + * This is an advanced use-case to define a token substitutable by a list of words without having the original token searchable + * default: '' + * https://github.com/algolia/algoliasearch-client-js#placeholders + */ + placeholders?: any; + } + + interface Response { + /** + * Contains all the hits matching the query + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + hits: any[]; + /** + * Current page + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + page: number; + /** + * Number of total hits matching the query + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + nbHits: number; + /** + * Number of pages + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + nbPages: number; + /** + * Number of hits per pages + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + hitsPerPage: number; + /** + * Engine processing time (excluding network transfer) + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + processingTimeMS: number; + /** + * Query used to perform the search + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + query: string; + /** + * GET parameters used to perform the search + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + params: string; + facets?: { + [facetName: string]: { [facetValue: string]: number }; + }; + } + + interface MultiResponse { + results: Response[]; } } @@ -1929,5 +1798,5 @@ declare function algoliasearch( applicationId: string, apiKey: string, options?: algoliasearch.ClientOptions -): algoliasearch.AlgoliaClient; +): algoliasearch.Client; export = algoliasearch; diff --git a/types/algoliasearch/lite/index.d.ts b/types/algoliasearch/lite/index.d.ts new file mode 100644 index 0000000000..588e2ac543 --- /dev/null +++ b/types/algoliasearch/lite/index.d.ts @@ -0,0 +1,624 @@ +// Type definitions for algoliasearch-client-js 3.27.0 +// Project: https://github.com/algolia/algoliasearch-client-js +// Definitions by: Baptiste Coquelle +// Haroen Viaene +// Aurélien Hervé +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +declare namespace algoliasearch { + /* + Interface for the algolia client object + */ + interface Client { + /** + * Initialization of the index + * https://github.com/algolia/algoliasearch-client-js#init-index---initindex + */ + initIndex(indexName: string): Index; + /** + * Query on multiple index + * https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries + */ + search( + queries: { + indexName: string; + query: string; + params: QueryParameters; + }[], + cb: (err: Error, res: MultiResponse) => void + ): void; + /** + * Query on multiple index + * https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries + */ + search( + queries: { + indexName: string; + query: string; + params: QueryParameters; + }[] + ): Promise; + /** + * Query for facet values of a specific facet + */ + searchForFacetValues( + queries: [{ indexName: string; params: SearchForFacetValues.Parameters }] + ): Promise; + /** + * clear browser cache + * https://github.com/algolia/algoliasearch-client-js#cache + */ + clearCache(): void; + /** + * Add a header to be sent with all upcoming requests + */ + setExtraHeader(name: string, value: string): void; + /** + * Get the value of an extra header + */ + getExtraHeader(name: string): string; + /** + * remove an extra header for all upcoming requests + */ + unsetExtraHeader(name: string): void; + } + /** + * Interface for the index algolia object + */ + interface Index { + /** + * Gets a specific object + * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects + */ + getObject(objectID: string, cb: (err: Error, res: {}) => void): void; + /** + * Gets specific attributes from an object + * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects + */ + getObject( + objectID: string, + attributes: string[], + cb: (err: Error, res: {}) => void + ): void; + /** + * Gets a list of objects + * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects + */ + getObjects( + objectIDs: string[], + cb: (err: Error, res: { results: {}[] }) => void + ): void; + /** + * Gets a list of objects + * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects + */ + getObjects(objectIDs: string[]): Promise<{ results: {}[] }>; + /** + * Clear cache of an index + * https://github.com/algolia/algoliasearch-client-js#cache + */ + clearCache(): void; + /** + * Search in an index + * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search + */ + search( + params: QueryParameters, + cb: (err: Error, res: Response) => void + ): void; + /** + * Search in an index + * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search + */ + search(params: QueryParameters): Promise; + /** + * Search in an index + * https://www.algolia.com/doc/api-reference/api-methods/search-for-facet-values/ + */ + searchForFacetValues( + options: SearchForFacetValues.Parameters + ): Promise; + /** + * Search in an index + * https://www.algolia.com/doc/api-reference/api-methods/search-for-facet-values/ + */ + searchForFacetValues( + options: SearchForFacetValues.Parameters, + cb: (err: Error, res: SearchForFacetValues.Response) => void + ): void; + /** + * Browse an index + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browse(query: string, cb: (err: Error, res: BrowseResponse) => void): void; + /** + * Browse an index + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browse(query: string): Promise; + /** + * Browse an index from a cursor + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browseFrom( + cursor: string, + cb: (err: Error, res: BrowseResponse) => void + ): void; + /** + * Browse an index from a cursor + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browseFrom(cursor: string): Promise; + } + /** + * Interface describing available options when initializing a client + */ + interface ClientOptions { + /** + * Timeout for requests to our servers, in milliseconds + * default: 15s (node), 2s (browser) + * https://github.com/algolia/algoliasearch-client-js#client-options + */ + timeout?: number; + /** + * Protocol to use when communicating with algolia + * default: current protocol(browser), https(node) + * https://github.com/algolia/algoliasearch-client-js#client-options + */ + protocol?: string; + /** + * (node only) httpAgent instance to use when communicating with servers. + * https://github.com/algolia/algoliasearch-client-js#client-options + */ + httpAgent?: any; + /** + * read: array of read hosts to use to call servers, computed automatically + * write: array of read hosts to use to call servers, computed automatically + * https://github.com/algolia/algoliasearch-client-js#client-options + */ + hosts?: { read?: string[]; write?: string[] }; + } + interface BrowseResponse { + cursor?: string; + hits: {}[]; + params: string; + query: string; + processingTimeMS: number; + } + + interface QueryParameters { + /** + * Query string used to perform the search + * default: '' + * https://github.com/algolia/algoliasearch-client-js#query + */ + query?: string; + /** + * Filter the query with numeric, facet or/and tag filters + * default: "" + * https://github.com/algolia/algoliasearch-client-js#filters + */ + filters?: string; + /** + * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer. + * default: * + * https://github.com/algolia/algoliasearch-client-js#attributestoretrieve + */ + attributesToRetrieve?: string[]; + /** + * List of attributes you want to use for textual search + * default: attributeToIndex + * https://github.com/algolia/algoliasearch-client-js#restrictsearchableattributes + */ + restrictSearchableAttributes?: string[]; + /** + * You can use facets to retrieve only a part of your attributes declared in attributesForFaceting attributes + * default: "" + * https://github.com/algolia/algoliasearch-client-js#facets + */ + facets?: string; + /** + * Limit the number of facet values returned for each facet. + * default: "" + * https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet + */ + maxValuesPerFacet?: number; + /** + * Default list of attributes to highlight. If set to null, all indexed attributes are highlighted. + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributestohighlight + */ + attributesToHighlight?: string[]; + /** + * Default list of attributes to snippet alongside the number of words to return + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributestosnippet + */ + attributesToSnippet?: string[]; + /** + * Specify the string that is inserted before the highlighted parts in the query result + * default: + * https://github.com/algolia/algoliasearch-client-js#highlightpretag + */ + highlightPreTag?: string; + /** + * Specify the string that is inserted after the highlighted parts in the query result + * default: + * https://github.com/algolia/algoliasearch-client-js#highlightposttag + */ + highlightPostTag?: string; + /** + * String used as an ellipsis indicator when a snippet is truncated. + * default: … + * https://github.com/algolia/algoliasearch-client-js#snippetellipsistext + */ + snippetEllipsisText?: string; + /** + * If set to true, restrict arrays in highlights and snippets to items that matched the query at least partially else return all array items in highlights and snippets + * default: false + * https://github.com/algolia/algoliasearch-client-js#restricthighlightandsnippetarrays + */ + restrictHighlightAndSnippetArrays?: boolean; + /** + * Pagination parameter used to select the number of hits per page + * default: 20 + * https://github.com/algolia/algoliasearch-client-js#hitsperpage + */ + hitsPerPage?: number; + /** + * Pagination parameter used to select the page to retrieve. + * default: 0 + * https://github.com/algolia/algoliasearch-client-js#page + */ + page?: number; + /** + * Offset of the first hit to return + * default: null + * https://github.com/algolia/algoliasearch-client-js#offset + */ + offset?: number; + /** + * Number of hits to return. + * default: null + * https://github.com/algolia/algoliasearch-client-js#length + */ + length?: number; + /** + * The minimum number of characters needed to accept one typo. + * default: 4 + * https://github.com/algolia/algoliasearch-client-js#minwordsizefor1typo + */ + minWordSizefor1Typo?: number; + /** + * The minimum number of characters needed to accept two typo. + * fault: 8 + * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos + */ + minWordSizefor2Typos?: number; + /** + * This option allows you to control the number of typos allowed in the result set: + * default: true + * 'true' The typo tolerance is enabled and all matching hits are retrieved + * 'false' The typo tolerance is disabled. All results with typos will be hidden. + * 'min' Only keep results with the minimum number of typos + * 'strict' Hits matching with 2 typos are not retrieved if there are some matching without typos. + * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos + */ + typoTolerance?: boolean; + /** + * If set to false, disables typo tolerance on numeric tokens (numbers). + * default: + * https://github.com/algolia/algoliasearch-client-js#allowtyposonnumerictokens + */ + allowTyposOnNumericTokens?: boolean; + /** + * If set to true, plural won't be considered as a typo + * default: false + * https://github.com/algolia/algoliasearch-client-js#ignoreplurals + */ + ignorePlurals?: boolean; + /** + * List of attributes on which you want to disable typo tolerance + * default: "" + * https://github.com/algolia/algoliasearch-client-js#disabletypotoleranceonattributes + */ + disableTypoToleranceOnAttributes?: string; + /** + * Search for entries around a given location + * default: "" + * https://github.com/algolia/algoliasearch-client-js#aroundlatlng + */ + aroundLatLng?: string; + /** + * Search for entries around a given latitude/longitude automatically computed from user IP address. + * default: "" + * https://github.com/algolia/algoliasearch-client-js#aroundlatlngviaip + */ + aroundLatLngViaIP?: string; + /** + * Control the radius associated with a geo search. Defined in meters. + * default: null + * You can specify aroundRadius=all if you want to compute the geo distance without filtering in a geo area + * https://github.com/algolia/algoliasearch-client-js#aroundradius + */ + aroundRadius?: number | 'all'; + /** + * Control the precision of a geo search + * default: null + * https://github.com/algolia/algoliasearch-client-js#aroundprecision + */ + aroundPrecision?: number; + /** + * Define the minimum radius used for a geo search when aroundRadius is not set. + * default: null + * https://github.com/algolia/algoliasearch-client-js#minimumaroundradius + */ + minimumAroundRadius?: number; + /** + * Search entries inside a given area defined by the two extreme points of a rectangle + * default: null + * https://github.com/algolia/algoliasearch-client-js#insideboundingbox + */ + insideBoundingBox?: number[][]; + /** + * Selects how the query words are interpreted + * default: 'prefixLast' + * 'prefixAll' All query words are interpreted as prefixes. This option is not recommended. + * 'prefixLast' Only the last word is interpreted as a prefix (default behavior). + * 'prefixNone' No query word is interpreted as a prefix. This option is not recommended. + * https://github.com/algolia/algoliasearch-client-js#querytype + */ + queryType?: any; + /** + * Search entries inside a given area defined by a set of points + * defauly: '' + * https://github.com/algolia/algoliasearch-client-js#insidepolygon + */ + insidePolygon?: number[][]; + /** + * This option is used to select a strategy in order to avoid having an empty result page + * default: 'none' + * 'lastWords' When a query does not return any results, the last word will be added as optional + * 'firstWords' When a query does not return any results, the first word will be added as optional + * 'allOptional' When a query does not return any results, a second trial will be made with all words as optional + * 'none' No specific processing is done when a query does not return any results + * https://github.com/algolia/algoliasearch-client-js#removewordsifnoresults + */ + removeWordsIfNoResults?: string; + /** + * Enables the advanced query syntax + * default: false + * https://github.com/algolia/algoliasearch-client-js#advancedsyntax + */ + advancedSyntax?: boolean; + /** + * A string that contains the comma separated list of words that should be considered as optional when found in the query + * default: [] + * https://github.com/algolia/algoliasearch-client-js#optionalwords + */ + optionalWords?: string[]; + /** + * Remove stop words from the query before executing it + * default: false + * true|false: enable or disable stop words for all 41 supported languages; or + * a list of language ISO codes (as a comma-separated string) for which stop words should be enable + * https://github.com/algolia/algoliasearch-client-js#removestopwords + */ + removeStopWords?: string[]; + /** + * List of attributes on which you want to disable the computation of exact criteria + * default: [] + * https://github.com/algolia/algoliasearch-client-js#disableexactonattributes + */ + disableExactOnAttributes?: string[]; + /** + * This parameter control how the exact ranking criterion is computed when the query contains one word + * default: attribute + * 'none': no exact on single word query + * 'word': exact set to 1 if the query word is found in the record + * 'attribute': exact set to 1 if there is an attribute containing a string equals to the query + * https://github.com/algolia/algoliasearch-client-js#exactonsinglewordquery + */ + exactOnSingleWordQuery?: string; + /** + * Specify the list of approximation that should be considered as an exact match in the ranking formula + * default: ['ignorePlurals', 'singleWordSynonym'] + * 'ignorePlurals': alternative words added by the ignorePlurals feature + * 'singleWordSynonym': single-word synonym (For example "NY" = "NYC") + * 'multiWordsSynonym': multiple-words synonym + * https://github.com/algolia/algoliasearch-client-js#alternativesasexact + */ + alternativesAsExact?: any; + /** + * If set to 1, enables the distinct feature, disabled by default, if the attributeForDistinct index setting is set. + * https://github.com/algolia/algoliasearch-client-js#distinct + */ + distinct?: any; + /** + * If set to true, the result hits will contain ranking information in the _rankingInfo attribute. + * default: false + * https://github.com/algolia/algoliasearch-client-js#getrankinginfo + */ + getRankingInfo?: boolean; + /** + * All numerical attributes are automatically indexed as numerical filters + * default: '' + * https://github.com/algolia/algoliasearch-client-js#numericattributestoindex + */ + numericAttributesToIndex?: string[]; + /** + * @deprecated please use filters instead + * A string that contains the comma separated list of numeric filters you want to apply. + * https://github.com/algolia/algoliasearch-client-js#numericfilters-deprecated + */ + numericFilters?: string[]; + /** + * @deprecated + * Filter the query by a set of tags. + * https://github.com/algolia/algoliasearch-client-js#tagfilters-deprecated + */ + tagFilters?: string; + /** + * @deprecated + * Filter the query by a set of facets. + * https://github.com/algolia/algoliasearch-client-js#facetfilters-deprecated + */ + facetFilters?: string; + /** + * If set to false, this query will not be taken into account in the analytics feature. + * default true + * https://github.com/algolia/algoliasearch-client-js#analytics + */ + analytics?: boolean; + /** + * If set, tag your query with the specified identifiers + * default: null + * https://github.com/algolia/algoliasearch-client-js#analyticstags + */ + analyticsTags?: string[]; + /** + * If set to false, the search will not use the synonyms defined for the targeted index. + * default: true + * https://github.com/algolia/algoliasearch-client-js#synonyms + */ + synonyms?: boolean; + /** + * If set to false, words matched via synonym expansion will not be replaced by the matched synonym in the highlighted result. + * default: true + * https://github.com/algolia/algoliasearch-client-js#replacesynonymsinhighlight + */ + replaceSynonymsInHighlight?: boolean; + /** + * Configure the precision of the proximity ranking criterion + * default: 1 + * https://github.com/algolia/algoliasearch-client-js#minproximity + */ + minProximity?: number; + + nbShards?: number; + userData?: string | object; + } + + interface AlgoliaResponse { + /** + * Contains all the hits matching the query + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + hits: any[]; + /** + * Current page + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + page: number; + /** + * Number of total hits matching the query + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + nbHits: number; + /** + * Number of pages + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + nbPage: number; + /** + * Number of hits per pages + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + hitsPerPage: number; + /** + * Engine processing time (excluding network transfer) + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + processingTimeMS: number; + /** + * Query used to perform the search + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + query: string; + /** + * GET parameters used to perform the search + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + params: string; + facets: { + [facetName: string]: { [facetValue: string]: number }; + }; + } + + namespace SearchForFacetValues { + interface Parameters extends QueryParameters { + /** + * The facet to search in + */ + facetName: string; + /** + * The query for the search in this facet + */ + facetQuery: string; + } + + interface Response { + facetHits: { value: string; highlighted: string; count: number }[]; + exhaustiveFacetsCount: boolean; + processingTimeMS: number; + } + } + + interface Response { + /** + * Contains all the hits matching the query + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + hits: any[]; + /** + * Current page + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + page: number; + /** + * Number of total hits matching the query + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + nbHits: number; + /** + * Number of pages + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + nbPages: number; + /** + * Number of hits per pages + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + hitsPerPage: number; + /** + * Engine processing time (excluding network transfer) + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + processingTimeMS: number; + /** + * Query used to perform the search + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + query: string; + /** + * GET parameters used to perform the search + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + params: string; + facets?: { + [facetName: string]: { [facetValue: string]: number }; + }; + } + + interface MultiResponse { + results: Response[]; + } +} + +declare function algoliasearch( + applicationId: string, + apiKey: string, + options?: algoliasearch.ClientOptions +): algoliasearch.Client; +export = algoliasearch; diff --git a/types/algoliasearch/tsconfig.json b/types/algoliasearch/tsconfig.json index 3358732ba3..9a8a2a623c 100644 --- a/types/algoliasearch/tsconfig.json +++ b/types/algoliasearch/tsconfig.json @@ -18,6 +18,7 @@ }, "files": [ "index.d.ts", + "lite/index.d.ts", "algoliasearch-tests.ts" ] -} \ No newline at end of file +} From a1a7755d2a98a072b606dd1f2b51a970cc433402 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Fri, 4 May 2018 14:00:33 -0700 Subject: [PATCH 1068/2153] Add type definitions for w3cwebsocket in the websocket package (#25355) --- types/websocket/index.d.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/types/websocket/index.d.ts b/types/websocket/index.d.ts index 0087c7a3d1..cd17039b1c 100644 --- a/types/websocket/index.d.ts +++ b/types/websocket/index.d.ts @@ -670,6 +670,35 @@ declare class router extends events.EventEmitter { } +declare class w3cwebsocket { + static CONNECTING: number; + static OPEN: number; + static CLOSING: number; + static CLOSED: number; + + url: string; + readyState: number; + protocol?: string; + extenstions: IExtension[]; + bufferedAmount: number; + + CONNECTING: number; + OPEN: number; + CLOSING: number; + CLOSED: number; + + onopen: () => void; + onerror: (error: Error) => void; + onclose: () => void; + onmessage: (message: any) => void; + + constructor(url: string, protocols?: string[], origin?: string, headers?: any[], requestOptions?: object, clientConfig?: IClientConfig); + + send(data: Buffer): void; + send(data: IStringified): void; + close(code?: number, reason?: string): void; +} + export declare var version: string; export declare var constants: { DEBUG: boolean; From 58724510166c5d103b714d833a5443eed8fe6122 Mon Sep 17 00:00:00 2001 From: Moyuan Huang Date: Fri, 4 May 2018 14:05:17 -0700 Subject: [PATCH 1069/2153] Add 'cache' options for got (#25048) * Add definition for Keyv._getKeyPrefix() * Update interface of Keyv.set - For some Keyv built-in storage adapters, e.g. KeyvRedis, set() may return a value of undefined. https://github.com/lukechilds/keyv-redis/blob/master/src/index.js#L46 * Add interface for got's cache option --- types/got/got-tests.ts | 12 +++++++++++- types/got/index.d.ts | 8 +++++++- types/keyv/index.d.ts | 7 ++++--- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/types/got/got-tests.ts b/types/got/got-tests.ts index 8c88cef3bc..1eb2d89aa8 100644 --- a/types/got/got-tests.ts +++ b/types/got/got-tests.ts @@ -1,10 +1,12 @@ import got = require('got'); import cookie = require('cookie'); import FormData = require('form-data'); +import Keyv = require('keyv'); import * as fs from 'fs'; import * as http from 'http'; import * as https from 'https'; import * as url from 'url'; +import QuickLRU = require('quick-lru'); let str: string; let buf: Buffer; @@ -242,7 +244,15 @@ got('todomvc', { }); got('todomvc', { - cache: new Map() + cache: new Map(), +}).then(res => res.fromCache); + +got('todomvc', { + cache: new Keyv(), +}).then(res => res.fromCache); + +got('todomvc', { + cache: new QuickLRU(), }).then(res => res.fromCache); got(new url.URL('http://todomvc.com')); diff --git a/types/got/index.d.ts b/types/got/index.d.ts index 47c281fb53..f786af118e 100644 --- a/types/got/index.d.ts +++ b/types/got/index.d.ts @@ -119,7 +119,7 @@ declare namespace got { followRedirect?: boolean; decompress?: boolean; useElectronNet?: boolean; - cache?: Map; + cache?: Cache; agent?: http.Agent | boolean | AgentOptions; throwHttpErrors?: boolean; } @@ -137,6 +137,12 @@ declare namespace got { type RetryFunction = (retry: number, error: any) => number; + interface Cache { + set(key: string, value: any, ttl?: number): any; + get(key: string): any; + delete(key: string): any; + } + interface Response extends http.IncomingMessage { body: B; url: string; diff --git a/types/keyv/index.d.ts b/types/keyv/index.d.ts index 9d0e2c6404..69e644c2d9 100644 --- a/types/keyv/index.d.ts +++ b/types/keyv/index.d.ts @@ -3,9 +3,7 @@ // Definitions by: AryloYeung // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 - /// - interface KeyvOptions { /** Namespace for the current instance. */ namespace?: string; @@ -35,6 +33,9 @@ declare class Keyv extends NodeJS.EventEmitter { * @param opts The options object is also passed through to the storage adapter. Check your storage adapter docs for any extra options. */ constructor(uri?: string, opts?: KeyvOptions); + /** Returns the namespace of a key */ + _getKeyPrefix(key: string): string; + /** Returns the value. */ get(key: string): Promise; /** @@ -42,7 +43,7 @@ declare class Keyv extends NodeJS.EventEmitter { * * By default keys are persistent. You can set an expiry TTL in milliseconds. */ - set(key: string, value: any, ttl?: number): Promise; + set(key: string, value: any, ttl?: number): (Promise | undefined); /** * Deletes an entry. * From b3647b5bb5be4ca0c60b6f68db708ffc2c7afd13 Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Fri, 4 May 2018 23:05:41 +0200 Subject: [PATCH 1070/2153] provide argument option as already parsed url to http-proxy (#25164) --- types/http-proxy/http-proxy-tests.ts | 8 ++++++++ types/http-proxy/index.d.ts | 8 +++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/types/http-proxy/http-proxy-tests.ts b/types/http-proxy/http-proxy-tests.ts index 70ea803da6..1610befc7d 100644 --- a/types/http-proxy/http-proxy-tests.ts +++ b/types/http-proxy/http-proxy-tests.ts @@ -24,3 +24,11 @@ proxy.on("start", (req, res, target) => { http.createServer((req, res) => { proxy.web(req, res); }); + +const newProxy = HttpProxy.createProxyServer({ + target: { + host: 'localhost', + port: '9015' + }, + ws: true +}); diff --git a/types/http-proxy/index.d.ts b/types/http-proxy/index.d.ts index e9ef9a572d..fb7eb26abc 100644 --- a/types/http-proxy/index.d.ts +++ b/types/http-proxy/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for node-http-proxy 1.16 // Project: https://github.com/nodejitsu/node-http-proxy -// Definitions by: Maxime LUCE , Florian Oellerich +// Definitions by: Maxime LUCE +// Florian Oellerich +// Daniel Schmidt // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -166,9 +168,9 @@ declare namespace Server { /** Buffer */ buffer?: stream.Stream; /** URL string to be parsed with the url module. */ - target?: string; + target?: ProxyTargetUrl; /** URL string to be parsed with the url module. */ - forward?: string; + forward?: ProxyTargetUrl; /** Object to be passed to http(s).request. */ agent?: any; /** Object to be passed to https.createServer(). */ From 953b75640aca4ba92d42b1149eeb32f044431b2b Mon Sep 17 00:00:00 2001 From: Ben Gazzard Date: Fri, 4 May 2018 17:06:08 -0400 Subject: [PATCH 1071/2153] [draft-js] add missing entity methods to ContentState (#25379) Added additional methods as defined here: https://draftjs.org/docs/api-reference-content-state.html#replaceentitydata --- types/draft-js/index.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/draft-js/index.d.ts b/types/draft-js/index.d.ts index e83de2b303..4064c9b8a0 100644 --- a/types/draft-js/index.d.ts +++ b/types/draft-js/index.d.ts @@ -610,6 +610,7 @@ declare namespace Draft { import DraftBlockType = Draft.Model.Constants.DraftBlockType; import DraftEntityMutability = Draft.Model.Constants.DraftEntityMutability; import DraftEntityType = Draft.Model.Constants.DraftEntityType; + import DraftEntityInstance = Draft.Model.Entity.DraftEntityInstance; import DraftDecoratorType = Draft.Model.Decorators.DraftDecoratorType; @@ -754,6 +755,8 @@ declare namespace Draft { getEntity(key: string): EntityInstance; getLastCreatedEntityKey(): string; mergeEntityData(key: string, toMerge: { [key: string]: any }): ContentState; + replaceEntityData(key: string, toMerge: { [key: string]: any }): ContentState; + addEntity(instance: DraftEntityInstance): ContentState; getBlockMap(): BlockMap; From 19a7bc6ebd6e24113e1b4647f5c6844862d6a574 Mon Sep 17 00:00:00 2001 From: Yuri Albuquerque Date: Fri, 4 May 2018 18:06:21 -0300 Subject: [PATCH 1072/2153] Adding the new fields to react-sticky. (#25376) --- types/react-sticky/index.d.ts | 4 +++- types/react-sticky/react-sticky-tests.tsx | 12 +++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/types/react-sticky/index.d.ts b/types/react-sticky/index.d.ts index 9350069bcd..9dac505d85 100644 --- a/types/react-sticky/index.d.ts +++ b/types/react-sticky/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-sticky 5.0 +// Type definitions for react-sticky 6.0 // Project: https://github.com/captivationsoftware/react-sticky // Definitions by: Matej Lednicky , Curtis Warren // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -9,6 +9,7 @@ import * as React from "react"; export const StickyContainer: React.ComponentClass>; export interface StickyProps { + relative?: boolean; isActive?: boolean; className?: string; style?: any; @@ -18,6 +19,7 @@ export interface StickyProps { bottomOffset?: number; onStickyStateChange?(isSticky: boolean): void; disableCompensation?: boolean; + disableHardwareAcceleration?: boolean; } export const Sticky: React.ComponentClass; diff --git a/types/react-sticky/react-sticky-tests.tsx b/types/react-sticky/react-sticky-tests.tsx index f7cc460611..8284add89a 100644 --- a/types/react-sticky/react-sticky-tests.tsx +++ b/types/react-sticky/react-sticky-tests.tsx @@ -3,7 +3,17 @@ import * as React from "react"; const StickyAllOptions: JSX.Element = - undefined}> + undefined}>
    ; From a2a2edb6575687847190b6f0a542f26f2145b4e2 Mon Sep 17 00:00:00 2001 From: yamiscott Date: Fri, 4 May 2018 23:53:47 +0100 Subject: [PATCH 1073/2153] Fixed SwitchNavigatorConfig interface to use the correct backBehavior value for initialRoute. And added a test to cover this. (#25533) --- types/react-navigation/index.d.ts | 2 +- .../react-navigation-tests.tsx | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index db45006ef0..d5f9801b5d 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -631,7 +631,7 @@ export interface SwitchNavigatorConfig { initialRouteName: string; resetOnBlur?: boolean; paths?: NavigationPathsConfig; - backBehavior?: 'none' | 'intialRoute'; + backBehavior?: 'none' | 'initialRoute'; } // Return createNavigationContainer diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index fb6e72a623..6b8b5c99e8 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -288,6 +288,26 @@ function renderBasicSwitchNavigator(): JSX.Element { ); } +const switchNavigatorConfigWithInitialRoute: SwitchNavigatorConfig = { + initialRouteName: 'screen', + resetOnBlur: false, + backBehavior: 'initialRoute' +}; + +const SwitchNavigatorWithInitialRoute = SwitchNavigator( + routeConfigMap, + switchNavigatorConfigWithInitialRoute, +); + +function renderSwitchNavigatorWithInitialRoute(): JSX.Element { + return ( + { }} + style={viewStyle} + /> + ); +} + /** * Drawer navigator. */ From e9dce3019180d0e1ff5b896b44234f1220e10f83 Mon Sep 17 00:00:00 2001 From: JounQin Date: Sat, 5 May 2018 06:54:42 +0800 Subject: [PATCH 1074/2153] feat: add declarations for sw-precache (#25523) * feat: add declarations for sw-precache * add sw-toolbox as dependency --- types/sw-precache/index.d.ts | 71 ++++++++++++++++++++++++++ types/sw-precache/package.json | 6 +++ types/sw-precache/sw-precache-tests.ts | 5 ++ types/sw-precache/tsconfig.json | 23 +++++++++ types/sw-precache/tslint.json | 1 + 5 files changed, 106 insertions(+) create mode 100644 types/sw-precache/index.d.ts create mode 100644 types/sw-precache/package.json create mode 100644 types/sw-precache/sw-precache-tests.ts create mode 100644 types/sw-precache/tsconfig.json create mode 100644 types/sw-precache/tslint.json diff --git a/types/sw-precache/index.d.ts b/types/sw-precache/index.d.ts new file mode 100644 index 0000000000..6ade96a690 --- /dev/null +++ b/types/sw-precache/index.d.ts @@ -0,0 +1,71 @@ +// Type definitions for sw-precache 5.2 +// Project: https://github.com/googlechrome/sw-precache +// Definitions by: JounQin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +import { + Handler as SwToolboxHanlder, + Options as SwToolboxOptions, +} from 'sw-toolbox'; + +export type Handler = + | 'networkFirst' + | 'cacheFirst' + | 'fastest' + | 'cacheOnly' + | 'networkOnly' + | SwToolboxHanlder; + +export type Method = 'get' | 'post' | 'put' | 'delete' | 'head'; + +export interface Options { + cacheId?: string; + clientsClaim?: boolean; + directoryIndex?: string; + dontCacheBustUrlsMatching?: RegExp; + dynamicUrlToDependencies?: { + [url: string]: string | Buffer | string[]; + }; + handleFetch?: boolean; + ignoreUrlParametersMatching?: RegExp[]; + importScripts?: string[]; + logger?: Console['log']; + maximumFileSizeToCacheInBytes?: number; + navigateFallback?: string; + navigateFallbackWhitelist?: RegExp[]; + replacePrefix?: string; + runtimeCaching?: Array<{ + urlPattern: RegExp | string; + handler: Handler; + method?: Method; + options?: SwToolboxOptions; + }>; + skipWaiting?: boolean; + staticFileGlobs?: string[]; + stripPrefix?: string; + stripPrefixMulti?: { + [path: string]: string; + }; + templateFilePath?: string; + verbose?: boolean; +} + +export type Generate = ( + options?: Options, + callback?: ( + error: NodeJS.ErrnoException, + serviceWorkerString: string, + ) => void, +) => Promise; + +export type Write = ( + filePath: string, + options?: Options, + callback?: (error: NodeJS.ErrnoException) => void, +) => Promise; + +export const generate: Generate; +export const write: Write; diff --git a/types/sw-precache/package.json b/types/sw-precache/package.json new file mode 100644 index 0000000000..5d60bb29d0 --- /dev/null +++ b/types/sw-precache/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "sw-toolbox": "*" + } +} diff --git a/types/sw-precache/sw-precache-tests.ts b/types/sw-precache/sw-precache-tests.ts new file mode 100644 index 0000000000..21257d98c7 --- /dev/null +++ b/types/sw-precache/sw-precache-tests.ts @@ -0,0 +1,5 @@ +import * as swPrecache from 'sw-precache'; + +swPrecache.generate(); + +swPrecache.generate({}); diff --git a/types/sw-precache/tsconfig.json b/types/sw-precache/tsconfig.json new file mode 100644 index 0000000000..c718ce5bfd --- /dev/null +++ b/types/sw-precache/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes":true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "sw-precache-tests.ts" + ] +} diff --git a/types/sw-precache/tslint.json b/types/sw-precache/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/sw-precache/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From fb84e423e8211b7628c62718e0c88ce7a4b16ae7 Mon Sep 17 00:00:00 2001 From: Julien Chaumond Date: Fri, 4 May 2018 18:55:22 -0400 Subject: [PATCH 1075/2153] Fix profiling levels (#25521) --- types/mongodb/index.d.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 6963da082d..d1c47eff64 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -238,6 +238,8 @@ export interface ReplSetOptions extends SSLOptions, HighAvailabilityOptions { socketOptions?: SocketOptions; } +export type ProfilingLevel = 'off' | 'slow_only' | 'all'; + // Class documentation : http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html export class Db extends EventEmitter { constructor(databaseName: string, serverConfig: Server | ReplSet | Mongos, options?: DbCreateOptions); @@ -292,13 +294,14 @@ export class Db extends EventEmitter { /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#listCollections */ listCollections(filter?: Object, options?: { batchSize?: number, readPreference?: ReadPreference | string }): CommandCursor; /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#profilingInfo */ + /** @deprecated Query the system.profile collection directly. */ profilingInfo(callback: MongoCallback): void; profilingInfo(options?: { session?: ClientSession }): Promise; profilingInfo(options: { session?: ClientSession }, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#profilingLevel */ - profilingLevel(callback: MongoCallback): void; - profilingLevel(options?: { session?: ClientSession }): Promise; - profilingLevel(options: { session?: ClientSession }, callback: MongoCallback): void; + profilingLevel(callback: MongoCallback): void; + profilingLevel(options?: { session?: ClientSession }): Promise; + profilingLevel(options: { session?: ClientSession }, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#removeUser */ removeUser(username: string, callback: MongoCallback): void; removeUser(username: string, options?: CommonOptions): Promise; @@ -308,9 +311,9 @@ export class Db extends EventEmitter { renameCollection(fromCollection: string, toCollection: string, options?: { dropTarget?: boolean }): Promise>; renameCollection(fromCollection: string, toCollection: string, options: { dropTarget?: boolean }, callback: MongoCallback>): void; /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#setProfilingLevel */ - profilingLevel(level: string, callback: MongoCallback): void; - profilingLevel(level: string, options?: { session?: ClientSession }): Promise; - profilingLevel(level: string, options: { session?: ClientSession }, callback: MongoCallback): void; + setProfilingLevel(level: ProfilingLevel, callback: MongoCallback): void; + setProfilingLevel(level: ProfilingLevel, options?: { session?: ClientSession }): Promise; + setProfilingLevel(level: ProfilingLevel, options: { session?: ClientSession }, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.0/api/Db.html#stats */ stats(callback: MongoCallback): void; stats(options?: { scale?: number }): Promise; @@ -1527,7 +1530,7 @@ export interface LoggerState { } /** http://mongodb.github.io/node-mongodb-native/3.0/api/Logger.html */ -export class Logger{ +export class Logger { constructor(className: string, options?: LoggerOptions) // Log a message at the debug level debug(message: string, state: LoggerState):void From bfc59df972570de19c74bf55ec35f25cfad1270a Mon Sep 17 00:00:00 2001 From: Bradley Ayers Date: Sat, 5 May 2018 08:56:11 +1000 Subject: [PATCH 1076/2153] fix(prosemirror-*): replace void with undefined in return union types (#25520) * fix(prosemirror-*): replace void with undefined in return union types * fix(prosemirror-state): PluginSpec#appendTransaction return type * fix(prosemirror-model): remove unnecessary assertion * fix(prosemirror-state): remove unnecessary assertion --- types/prosemirror-collab/index.d.ts | 2 +- .../prosemirror-collab-tests.ts | 1 + types/prosemirror-inputrules/index.d.ts | 6 +-- .../prosemirror-inputrules-tests.ts | 5 +- types/prosemirror-model/index.d.ts | 40 ++++++++-------- .../prosemirror-model-tests.ts | 48 +++++++++++++++++-- types/prosemirror-state/index.d.ts | 8 ++-- .../prosemirror-state-tests.ts | 12 +++++ types/prosemirror-transform/index.d.ts | 14 +++--- .../prosemirror-transform-tests.ts | 14 ++++++ types/prosemirror-view/index.d.ts | 8 ++-- .../prosemirror-view-tests.ts | 12 +++++ 12 files changed, 127 insertions(+), 43 deletions(-) diff --git a/types/prosemirror-collab/index.d.ts b/types/prosemirror-collab/index.d.ts index cb4949bcba..6412b4b2e2 100644 --- a/types/prosemirror-collab/index.d.ts +++ b/types/prosemirror-collab/index.d.ts @@ -47,7 +47,7 @@ export function sendableSteps( steps: Array>; clientID: number | string; origins: Array>; -} | null | void; +} | null | undefined; /** * Get the version up to which the collab plugin has synced with the * central authority. diff --git a/types/prosemirror-collab/prosemirror-collab-tests.ts b/types/prosemirror-collab/prosemirror-collab-tests.ts index 9d892ca707..60dd42d7d9 100644 --- a/types/prosemirror-collab/prosemirror-collab-tests.ts +++ b/types/prosemirror-collab/prosemirror-collab-tests.ts @@ -10,3 +10,4 @@ plugin = collab.collab({ version: 1 }); plugin = collab.collab({ clientID: 1 }); const sendableSteps = collab.sendableSteps(state); +sendableSteps!.clientID; diff --git a/types/prosemirror-inputrules/index.d.ts b/types/prosemirror-inputrules/index.d.ts index 7c405530e0..7d14305ea6 100644 --- a/types/prosemirror-inputrules/index.d.ts +++ b/types/prosemirror-inputrules/index.d.ts @@ -42,7 +42,7 @@ export class InputRule { match: string[], start: number, end: number - ) => Transaction | null | void) + ) => Transaction | null) ); } /** @@ -81,7 +81,7 @@ export function undoInputRule( export function wrappingInputRule( regexp: RegExp, nodeType: NodeType, - getAttrs?: { [key: string]: any } | ((p: string[]) => { [key: string]: any } | null | void), + getAttrs?: { [key: string]: any } | ((p: string[]) => { [key: string]: any } | null | undefined), joinPredicate?: (p1: string[], p2: ProsemirrorNode) => boolean ): InputRule; /** @@ -95,7 +95,7 @@ export function wrappingInputRule( export function textblockTypeInputRule( regexp: RegExp, nodeType: NodeType, - getAttrs?: { [key: string]: any } | ((p: string[]) => { [key: string]: any } | null | void) + getAttrs?: { [key: string]: any } | ((p: string[]) => { [key: string]: any } | null | undefined) ): InputRule; /** * Converts double dashes to an emdash. diff --git a/types/prosemirror-inputrules/prosemirror-inputrules-tests.ts b/types/prosemirror-inputrules/prosemirror-inputrules-tests.ts index 0d59a02be7..25fa52e6af 100644 --- a/types/prosemirror-inputrules/prosemirror-inputrules-tests.ts +++ b/types/prosemirror-inputrules/prosemirror-inputrules-tests.ts @@ -1,5 +1,8 @@ import * as inputrules from 'prosemirror-inputrules'; import { NodeType } from 'prosemirror-model'; +import { Transaction } from 'prosemirror-state'; const nodeType = new NodeType(); -const rule: inputrules.InputRule = inputrules.wrappingInputRule(/^\$/, nodeType); +const rule1: inputrules.InputRule = inputrules.wrappingInputRule(/^\$/, nodeType); +const rule2 = new inputrules.InputRule(/^$/, 'str'); +const rule3 = new inputrules.InputRule(/^$/, () => null); diff --git a/types/prosemirror-model/index.d.ts b/types/prosemirror-model/index.d.ts index adb8a6141c..095b88f3ba 100644 --- a/types/prosemirror-model/index.d.ts +++ b/types/prosemirror-model/index.d.ts @@ -35,12 +35,12 @@ export class ContentMatch { * Match a node type and marks, returning a match after that node * if successful. */ - matchType(type: NodeType): ContentMatch | null | void; + matchType(type: NodeType): ContentMatch | null | undefined; /** * Try to match a fragment. Returns the resulting match when * successful. */ - matchFragment(frag: Fragment, start?: number, end?: number): ContentMatch | null | void; + matchFragment(frag: Fragment, start?: number, end?: number): ContentMatch | null | undefined; /** * Try to match the given fragment, and if that fails, see if it can * be made to match by inserting nodes in front of it. When @@ -49,14 +49,14 @@ export class ContentMatch { * return a fragment if the resulting match goes to the end of the * content expression. */ - fillBefore(after: Fragment, toEnd?: boolean, startIndex?: number): Fragment | null | void; + fillBefore(after: Fragment, toEnd?: boolean, startIndex?: number): Fragment | null | undefined; /** * Find a set of wrapping node types that would allow a node of the * given type to appear at this position. The result may be empty * (when it fits directly) and will be null when no such wrapping * exists. */ - findWrapping(target: NodeType): Array> | null | void; + findWrapping(target: NodeType): Array> | null | undefined; /** * Get the _n_th outgoing edge from this node in the finite automaton * that describes the content expression. @@ -89,7 +89,7 @@ export class Fragment { start: number, parent: ProsemirrorNode, index: number - ) => boolean | null | void, + ) => boolean | null | undefined | void, startPos?: number ): void; /** @@ -101,7 +101,7 @@ export class Fragment { node: ProsemirrorNode, pos: number, parent: ProsemirrorNode - ) => boolean | null | void + ) => boolean | null | undefined | void ): void; /** * Create a new fragment containing the combined content of this @@ -141,7 +141,7 @@ export class Fragment { /** * Get the child node at the given index, if it exists. */ - maybeChild(index: number): ProsemirrorNode | null | void; + maybeChild(index: number): ProsemirrorNode | null | undefined; /** * Call `f` for every child node, passing the node, its offset * into this parent node, and its index. @@ -151,14 +151,14 @@ export class Fragment { * Find the first position at which this fragment and another * fragment differ, or `null` if they are the same. */ - findDiffStart(other: Fragment): number | null | void; + findDiffStart(other: Fragment): number | null | undefined; /** * Find the first position, searching from the end, at which this * fragment and the given fragment differ, or `null` if they are the * same. Since this position will not be the same in both nodes, an * object with two separate positions is returned. */ - findDiffEnd(other: ProsemirrorNode): { a: number; b: number } | null | void; + findDiffEnd(other: ProsemirrorNode): { a: number; b: number } | null | undefined; /** * Return a debugging string that describes this fragment. */ @@ -166,7 +166,7 @@ export class Fragment { /** * Create a JSON-serializeable representation of this fragment. */ - toJSON(): { [key: string]: any } | null | void; + toJSON(): { [key: string]: any } | null | undefined; /** * Deserialize a fragment from its JSON representation. */ @@ -326,7 +326,7 @@ export interface ParseRule { * Called with a DOM Element for `tag` rules, and with a string (the * style's value) for `style` rules. */ - getAttrs?: ((p: Node | string) => { [key: string]: any } | false | null | void) | null; + getAttrs?: ((p: Node | string) => { [key: string]: any } | false | null | undefined) | null; /** * For `tag` rules that produce non-leaf nodes or marks, by default * the content of the DOM element is parsed as content of the mark @@ -507,7 +507,7 @@ declare class ProsemirrorNode { /** * Get the child node at the given index, if it exists. */ - maybeChild(index: number): ProsemirrorNode | null | void; + maybeChild(index: number): ProsemirrorNode | null | undefined; /** * Call `f` for every child node, passing the node, its offset * into this parent node, and its index. @@ -529,7 +529,7 @@ declare class ProsemirrorNode { pos: number, parent: ProsemirrorNode, index: number - ) => boolean | null | void, + ) => boolean | null | undefined | void, startPos?: number ): void; /** @@ -541,7 +541,7 @@ declare class ProsemirrorNode { node: ProsemirrorNode, pos: number, parent: ProsemirrorNode - ) => boolean | null | void + ) => boolean | null | undefined | void ): void; /** * Concatenates all the text nodes found in this fragment and its @@ -612,7 +612,7 @@ declare class ProsemirrorNode { /** * Find the node starting at the given position. */ - nodeAt(pos: number): ProsemirrorNode | null | void; + nodeAt(pos: number): ProsemirrorNode | null | undefined; /** * Find the (direct) child node after the given offset, if any, * and return it along with its index and offset relative to this @@ -769,7 +769,7 @@ export class Slice { /** * Convert a slice to a JSON-serializable representation. */ - toJSON(): { [key: string]: any } | null | void; + toJSON(): { [key: string]: any } | null | undefined; /** * Deserialize a slice from its JSON representation. */ @@ -892,7 +892,7 @@ export class ResolvedPos { * its parent node or its parent node isn't a textblock (in which * case no marks should be preserved). */ - marksAcross($end: ResolvedPos): Array> | null | void; + marksAcross($end: ResolvedPos): Array> | null | undefined; /** * The depth up to which this position and the given (non-resolved) * position share the same parent nodes. @@ -910,7 +910,7 @@ export class ResolvedPos { blockRange( other?: ResolvedPos, pred?: (p: ProsemirrorNode) => boolean - ): NodeRange | null | void; + ): NodeRange | null | undefined; /** * Query whether the given position shares the same parent node. */ @@ -1061,7 +1061,7 @@ export class NodeType { attrs?: { [key: string]: any }, content?: Fragment | ProsemirrorNode | Array>, marks?: Array> - ): ProsemirrorNode | null | void; + ): ProsemirrorNode | null | undefined; /** * Returns true if the given fragment is valid content for this node * type with the given attributes. @@ -1113,7 +1113,7 @@ export class MarkType { /** * Tests whether there is a mark of this type in the given set. */ - isInSet(set: Array>): Mark | null | void; + isInSet(set: Array>): Mark | null | undefined; /** * Queries whether a given mark type is * [excluded](#model.MarkSpec.excludes) by this one. diff --git a/types/prosemirror-model/prosemirror-model-tests.ts b/types/prosemirror-model/prosemirror-model-tests.ts index 98460d4313..b9041597e7 100644 --- a/types/prosemirror-model/prosemirror-model-tests.ts +++ b/types/prosemirror-model/prosemirror-model-tests.ts @@ -37,6 +37,48 @@ export const nodeSpec: model.NodeSpec = { } }; -const node = new model.Node(); -node.nodesBetween(0, 1, () => {}); -node.descendants(() => {}); +// Verify that non-null assertion operator can be used. + +const res1_1 = new model.Node(); +res1_1.nodesBetween(0, 1, () => {}); +res1_1.nodesBetween(0, 1, () => null); +res1_1.nodesBetween(0, 1, () => undefined); +res1_1.nodesBetween(0, 1, () => true); +res1_1.descendants(() => {}); +res1_1.descendants(() => null); +res1_1.descendants(() => undefined); +res1_1.descendants(() => true); +const res1_2: model.Node = res1_1.maybeChild(0)!; +const res1_3: model.Node = res1_1.nodeAt(0)!; + +const cm1 = new model.ContentMatch(); +const cm2: model.ContentMatch = cm1.matchType({} as any)!; +const cm3: model.ContentMatch = cm1.matchFragment({} as any)!; +const cm4: model.Fragment = cm1.fillBefore({} as any)!; +const cm5: model.NodeType[] = cm1.findWrapping({} as any)!; + +const f1 = new model.Fragment(); +f1.nodesBetween(0, 0, () => {}); +f1.nodesBetween(0, 0, () => null); +f1.nodesBetween(0, 0, () => undefined); +f1.nodesBetween(0, 0, () => true); + +f1.descendants(() => {}); +f1.descendants(() => null); +f1.descendants(() => undefined); +f1.descendants(() => true); + +const res2_1: model.Node = f1.maybeChild(0)!; +const res2_2: number = f1.findDiffStart(f1)!; +const res2_3: { a: number, b: number } = f1.findDiffEnd({} as any)!; +const res2_4: object = f1.toJSON()!; + +const res3_1 = new model.ResolvedPos(); +const res3_2: model.Mark[] = res3_1.marksAcross(res3_1)!; +const res3_3: model.NodeRange = res3_1.blockRange(res3_1)!; + +const res4_1 = new model.NodeType(); +const res4_2: model.Node = res4_1.createAndFill()!; + +const res5_1 = new model.MarkType(); +const res5_2: model.Mark = res5_1.isInSet([])!; diff --git a/types/prosemirror-state/index.d.ts b/types/prosemirror-state/index.d.ts index 6b210a73e1..db5a16e9d3 100644 --- a/types/prosemirror-state/index.d.ts +++ b/types/prosemirror-state/index.d.ts @@ -74,7 +74,7 @@ export interface PluginSpec { transactions: Transaction[], oldState: EditorState, newState: EditorState - ) => Transaction | null | void) + ) => Transaction | null | undefined | void) | null; } /** @@ -147,11 +147,11 @@ export class PluginKey { * Get the active plugin with this key, if any, from an editor * state. */ - get(state: EditorState): Plugin | null | void; + get(state: EditorState): Plugin | null | undefined; /** * Get the plugin's state from an editor state. */ - getState(state: EditorState): any | null | void; + getState(state: EditorState): any | null | undefined; } /** * Superclass for editor selections. Every selection type should @@ -263,7 +263,7 @@ export class Selection { $pos: ResolvedPos, dir: number, textOnly?: boolean - ): Selection | null | void; + ): Selection | null | undefined; /** * Find a valid cursor or leaf node selection near the given * position. Searches forward first by default, but if `bias` is diff --git a/types/prosemirror-state/prosemirror-state-tests.ts b/types/prosemirror-state/prosemirror-state-tests.ts index 0c1cddc24e..1668b844af 100644 --- a/types/prosemirror-state/prosemirror-state-tests.ts +++ b/types/prosemirror-state/prosemirror-state-tests.ts @@ -40,3 +40,15 @@ transaction = transaction.setNodeMarkup(0); transaction = transaction.split(0); transaction = transaction.join(0); transaction = transaction.step(step); + +const res1_1: state.PluginSpec["appendTransaction"] = null; +const res1_2: state.PluginSpec["appendTransaction"] = () => {}; +const res1_3: state.PluginSpec["appendTransaction"] = () => null; +const res1_4: state.PluginSpec["appendTransaction"] = () => undefined; +const res1_5: state.PluginSpec["appendTransaction"] = () => ({} as state.Transaction); + +const res2_1 = new state.PluginKey(); +const res2_2: state.Plugin = res2_1.get({} as state.EditorState)!; + +const res3_1 = new state.Selection({} as any, {} as any); +const res3_2: state.Selection = state.Selection.findFrom({} as model.ResolvedPos, 0)!; diff --git a/types/prosemirror-transform/index.d.ts b/types/prosemirror-transform/index.d.ts index c0b63136f4..e74fd9c094 100644 --- a/types/prosemirror-transform/index.d.ts +++ b/types/prosemirror-transform/index.d.ts @@ -403,7 +403,7 @@ export function replaceStep( from: number, to?: number, slice?: Slice -): Step | null | void; +): Step | null | undefined; /** * A step object represents an atomic change. It generally applies * only to the document it was created for, since the positions @@ -439,13 +439,13 @@ export class Step { * version of that step with its positions adjusted, or `null` if * the step was entirely deleted by the mapping. */ - map(mapping: Mappable): Step | null | void; + map(mapping: Mappable): Step | null | undefined; /** * Try to merge this step with another one, to be applied directly * after it. Returns the merged step when possible, null if the * steps can't be merged. */ - merge(other: Step): Step | null | void; + merge(other: Step): Step | null | undefined; /** * Create a JSON-serializeable representation of this step. When * defining this for a custom subclass, make sure the result object @@ -504,7 +504,7 @@ export class StepResult { * can be lifted. Will not go across * [isolating](#model.NodeSpec.isolating) parent nodes. */ -export function liftTarget(range: NodeRange): number | null | void; +export function liftTarget(range: NodeRange): number | null | undefined; /** * Try to find a valid way to wrap the content in the given range in a * node of the given type. May introduce extra nodes around and inside @@ -515,7 +515,7 @@ export function findWrapping( range: NodeRange, nodeType: NodeType, attrs?: { [key: string]: any } -): Array<{ type: NodeType; attrs?: { [key: string]: any } | null }> | null | void; +): Array<{ type: NodeType; attrs?: { [key: string]: any } | null }> | null | undefined; /** * Check whether splitting at the given position is allowed. */ @@ -535,7 +535,7 @@ export function canJoin(doc: ProsemirrorNode, pos: number): boolean; * block before (or after if `dir` is positive). Returns the joinable * point, if any. */ -export function joinPoint(doc: ProsemirrorNode, pos: number, dir?: number): number | null | void; +export function joinPoint(doc: ProsemirrorNode, pos: number, dir?: number): number | null | undefined; /** * Try to find a point where a node of the given type can be inserted * near `pos`, by searching up the node hierarchy when `pos` itself @@ -546,4 +546,4 @@ export function insertPoint( doc: ProsemirrorNode, pos: number, nodeType: NodeType -): number | null | void; +): number | null | undefined; diff --git a/types/prosemirror-transform/prosemirror-transform-tests.ts b/types/prosemirror-transform/prosemirror-transform-tests.ts index c3a18ef916..a61108a2a9 100644 --- a/types/prosemirror-transform/prosemirror-transform-tests.ts +++ b/types/prosemirror-transform/prosemirror-transform-tests.ts @@ -1,3 +1,17 @@ import * as transform from 'prosemirror-transform'; const stepmap = new transform.StepMap([]); + +// Verify non-null assertion operator can be used. + +const res1_1: transform.Step = transform.replaceStep({} as any, 0)!; +const res1_2: transform.Step = res1_1.map({} as any)!; +const res1_3: transform.Step = res1_1.merge({} as any)!; + +const res2_1: number = transform.liftTarget({} as any)!; + +const res3_1: any[] = transform.findWrapping({} as any, {} as any)!; + +const res4_1: number = transform.joinPoint({} as any, 0)!; + +const res5_1: number = transform.insertPoint({} as any, 0, {} as any)!; diff --git a/types/prosemirror-view/index.d.ts b/types/prosemirror-view/index.d.ts index f24a5270d1..dba4fb8aec 100644 --- a/types/prosemirror-view/index.d.ts +++ b/types/prosemirror-view/index.d.ts @@ -237,7 +237,7 @@ export class EditorView { posAtCoords(coords: { left: number; top: number; - }): { pos: number; inside: number } | null | void; + }): { pos: number; inside: number } | null | undefined; /** * Returns the viewport rectangle at a given document position. `left` * and `right` will be the same number, as this returns a flat @@ -404,7 +404,7 @@ export interface EditorProps { view: EditorView, anchor: ResolvedPos, head: ResolvedPos - ) => Selection | null | void) + ) => Selection | null | undefined) | null; /** * The [parser](#model.DOMParser) to use when reading editor changes @@ -482,7 +482,7 @@ export interface EditorProps { * A set of [document decorations](#view.Decoration) to show in the * view. */ - decorations?: ((state: EditorState) => DecorationSet | null | void) | null; + decorations?: ((state: EditorState) => DecorationSet | null | undefined) | null; /** * When this returns false, the content of the view is not directly * editable. @@ -500,7 +500,7 @@ export interface EditorProps { */ attributes?: | { [name: string]: string } - | ((p: EditorState) => { [name: string]: string } | null | void) + | ((p: EditorState) => { [name: string]: string } | null | undefined | void) | null; /** * Determines the distance (in pixels) between the cursor and the diff --git a/types/prosemirror-view/prosemirror-view-tests.ts b/types/prosemirror-view/prosemirror-view-tests.ts index fd6c0538eb..a3e76946b8 100644 --- a/types/prosemirror-view/prosemirror-view-tests.ts +++ b/types/prosemirror-view/prosemirror-view-tests.ts @@ -1,3 +1,15 @@ import * as view from 'prosemirror-view'; +import * as state from 'prosemirror-state'; const decoration = new view.Decoration(); + +const res1_1 = new view.EditorView({} as any, {} as any); +const res1_2: { pos: number, inside: number } = res1_1.posAtCoords({ left: 0, top: 0})!; + +const res2_1: view.EditorProps = {} as any; +const res2_2: state.Selection = res2_1.createSelectionBetween!({} as any, {} as any, {} as any)!; +const res2_3: view.DecorationSet = res2_1.decorations!({} as any)!; + +const res3_1: view.EditorProps["attributes"] = () => {}; +const res3_2: view.EditorProps["attributes"] = () => null; +const res3_3: view.EditorProps["attributes"] = () => undefined; From e94c84bd5e2136d9e1acd42ee662ac0193abed10 Mon Sep 17 00:00:00 2001 From: Stefano Orlando Date: Sat, 5 May 2018 01:10:31 +0200 Subject: [PATCH 1077/2153] [@types/puppeteer] Add evaluateHandle, focus, hover, tap, type to Frame definition (#25508) * Add evaluateHandle, focus, hover, tap, type to Frame definition * Removing duplicated methods --- types/puppeteer/index.d.ts | 85 ++++++++++++++++++++++---------------- 1 file changed, 49 insertions(+), 36 deletions(-) diff --git a/types/puppeteer/index.d.ts b/types/puppeteer/index.d.ts index 94b57c87b9..54ef9b722a 100644 --- a/types/puppeteer/index.d.ts +++ b/types/puppeteer/index.d.ts @@ -804,6 +804,15 @@ export interface FrameBase { /** Adds a `` tag into the page with the desired url or a `
    on the specified side. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/caption-side - */ - captionSide?: CSSGlobalValues | 'top' | 'bottom' | 'block-start' | 'block-end' | 'inline-start' | 'inline-end'; - - /** - * The clear CSS property specifies if an element can be positioned next to or must be positioned below the floating elements that precede it in the markup. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/clear - */ - clear?: CSSGlobalValues | 'none' | 'left' | 'right' | 'both'; - - /** - * Deprecated; see clip-path. - * Lets you specify the dimensions of an absolutely positioned element that should be visible, and the element is clipped into this shape, and displayed. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/clip - */ - clip?: any; - - /** - * Clipping crops an graphic, so that only a portion of the graphic is rendered, or filled. This clip-rule property, when used with the clip-path property, defines which clip rule, or algorithm, to use when filling the different parts of a graphics. - * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/clip-rule - */ - clipRule?: any; - - /** - * The color property sets the color of an element's foreground content (usually text), accepting any standard CSS color from keywords and hex values to RGB(a) and HSL(a). - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/color - */ - color?: CSSValue; - - /** - * Describes the number of columns of the element. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/column-count - */ - columnCount?: number; - - /** - * Specifies how to fill columns (balanced or sequential). - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/column-fill - */ - columnFill?: any; - - /** - * The column-gap property controls the width of the gap between columns in multi-column elements. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/column-gap - */ - columnGap?: any; - - /** - * Sets the width, style, and color of the rule between columns. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/column-rule - */ - columnRule?: any; - - /** - * Specifies the color of the rule between columns. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/column-rule-color - */ - columnRuleColor?: CSSValue; - - /** - * Specifies the width of the rule between columns. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/column-rule-width - */ - columnRuleWidth?: CSSValue; - - /** - * The column-span CSS property makes it possible for an element to span across all columns when its value is set to all. An element that spans more than one column is called a spanning element. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/column-span - */ - columnSpan?: any; - - /** - * Specifies the width of columns in multi-column elements. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/column-width - */ - columnWidth?: CSSValue; - - /** - * This property is a shorthand property for setting column-width and/or column-count. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/columns - */ - columns?: any; - - /** - * The content property is used with the :before and :after pseudo-elements, to insert generated content. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/content - */ - content?: CSSValueString; - - /** - * The counter-increment property accepts one or more names of counters (identifiers), each one optionally followed by an integer which specifies the value by which the counter should be incremented (e.g. if the value is 2, the counter increases by 2 each time it is invoked). - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/counter-increment - */ - counterIncrement?: any; - - /** - * The counter-reset property contains a list of one or more names of counters, each one optionally followed by an integer (otherwise, the integer defaults to 0.) Each time the given element is invoked, the counters specified by the property are set to the given integer. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/counter-reset - */ - counterReset?: any; - - /** - * The cue property specifies sound files (known as an "auditory icon") to be played by speech media agents before and after presenting an element's content; if only one file is specified, it is played both before and after. The volume at which the file(s) should be played, relative to the volume of the main element, may also be specified. The icon files may also be set separately with the cue-before and cue-after properties. - */ - cue?: any; - - /** - * The cue-after property specifies a sound file (known as an "auditory icon") to be played by speech media agents after presenting an element's content; the volume at which the file should be played may also be specified. The shorthand property cue sets cue sounds for both before and after the element is presented. - */ - cueAfter?: any; - - /** - * Specifies the mouse cursor displayed when the mouse pointer is over an element. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/cursor - */ - cursor?: CSSValue; - - /** - * The direction CSS property specifies the text direction/writing direction. The rtl is used for Hebrew or Arabic text, the ltr is for other languages. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/direction - */ - direction?: CSSGlobalValues | 'ltr' | 'rtl'; - - /** - * This property specifies the type of rendering box used for an element. It is a shorthand property for many other display properties. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/display - */ - display?: CSSValue; - - /** - * SVG: Used to determine or re-determine a scaled-baseline-table. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/dominant-baseline - */ - dominantBaseline?: 'auto' | 'use-script' | 'no-change' | 'reset-size' | 'ideographic' | 'alphabetic' | 'hanging' | 'mathematical' | 'central' | 'middle' | 'text-after-edge' | 'text-before-edge' | 'inherit'; - - /** - * The ‘empty-cells’ CSS property specifies how the user agent should render borders and backgrounds around cells that have no visible content. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/empty-cells - */ - emptyCells?: CSSGlobalValues | 'show' | 'hide'; - - /** - * The ‘fill’ property paints the interior of the given graphical element. The area to be painted consists of any areas inside the outline of the shape. To determine the inside of the shape, all subpaths are considered, and the interior is determined according to the rules associated with the current value of the ‘fill-rule’ property. The zero-width geometric outline of a shape is included in the area to be painted. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/fill - */ - fill?: CSSColor | 'context-stroke' | 'context-fill'; - - /** - * SVG: Specifies the opacity of the color or the content the current object is filled with. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/fill-opacity - */ - fillOpacity?: number; - - /** - * The ‘fill-rule’ property indicates the algorithm which is to be used to determine what parts of the canvas are included inside the shape. For a simple, non-intersecting path, it is intuitively clear what region lies "inside"; however, for a more complex path, such as a path that intersects itself or where one subpath encloses another, the interpretation of "inside" is not so obvious. - * The ‘fill-rule’ property provides two options for how the inside of a shape is determined: - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/fill-rule - */ - fillRule?: 'nonzero' | 'evenodd'; - - /** - * Applies various image processing effects. This property is largely unsupported. See Compatibility section for more information. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/filter - */ - filter?: string; - - /** - * Shorthand for `flex-grow`, `flex-shrink`, and `flex-basis`. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex - */ - flex?: number | string; - '-webkit-flex'?: number | string; - '-ms-flex'?: number | string; - - /** - * Obsolete, do not use. This property has been renamed to align-items. - * Specifies the alignment (perpendicular to the layout axis defined by the flex-direction property) of child elements of the object. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-align - */ - flexAlign?: any; - '-ms-flex-align'?: any; - '-webkit-flex-align'?: any; - - /** - * The flex-basis CSS property describes the initial main size of the flex item before any free space is distributed according to the flex factors described in the flex property (flex-grow and flex-shrink). - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis - */ - flexBasis?: any; - - /** - * The flex-direction CSS property describes how flex items are placed in the flex container, by setting the direction of the flex container's main axis. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction - */ - flexDirection?: any; - '-ms-flex-direction'?: any; - '-webkit-flex-direction'?: any; - - /** - * The flex-flow CSS property defines the flex container's main and cross axis. It is a shorthand property for the flex-direction and flex-wrap properties. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-flow - */ - flexFlow?: any; - - /** - * Specifies the flex grow factor of a flex item. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow - */ - flexGrow?: number; - '-ms-flex-grow'?: number; - '-webkit-flex-grow'?: number; - - /** - * Do not use. This property has been renamed to align-self - * Specifies the alignment (perpendicular to the layout axis defined by flex-direction) of child elements of the object. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-item-align - */ - flexItemAlign?: any; - - /** - * Do not use. This property has been renamed to align-content. - * Specifies how a flexbox's lines align within the flexbox when there is extra space along the axis that is perpendicular to the axis defined by the flex-direction property. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-line-pack - */ - flexLinePack?: any; - - flexPositive?: any; - '-ms-flex-positive'?: any; - '-webkit-flex-positive'?: any; - - flexNegative?: any; - '-ms-flex-negative'?: any; - '-webkit-flex-negative'?: any; - - /** - * Gets or sets a value that specifies the ordinal group that a flexbox element belongs to. This ordinal value identifies the display order for the group. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-order - */ - flexOrder?: any; - - /** - * Specifies the flex shrink factor of a flex item. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink - */ - flexShrink?: number; - '-ms-flex-shrink'?: number; - '-webkit-flex-shrink'?: number; - - /** - * Specifies whether flex items are forced into a single line or can be wrapped onto multiple lines. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap - */ - flexWrap?: CSSGlobalValues | 'nowrap' | 'wrap' | 'wrap-reverse'; - '-ms-flex-wrap'?: CSSGlobalValues | 'nowrap' | 'wrap' | 'wrap-reverse'; - '-webkit-flex-wrap'?: CSSGlobalValues | 'nowrap' | 'wrap' | 'wrap-reverse'; - - /** - * Elements which have the style float are floated horizontally. These elements can move as far to the left or right of the containing element. All elements after the floating element will flow around it, but elements before the floating element are not impacted. If several floating elements are placed after each other, they will float next to each other as long as there is room. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/float - */ - float?: CSSGlobalValues | 'left' | 'right' | 'none' | 'inline-start' | 'inline-end'; - - /** - * Flows content from a named flow (specified by a corresponding flow-into) through selected elements to form a dynamic chain of layout regions. - */ - flowFrom?: any; - - /** - * The font property is shorthand that allows you to do one of two things: you can either set up six of the most mature font properties in one line, or you can set one of a choice of keywords to adopt a system font setting. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font - */ - font?: any; - - /** - * The font-family property allows one or more font family names and/or generic family names to be specified for usage on the selected element(s)' text. The browser then goes through the list; for each character in the selection it applies the first font family that has an available glyph for that character. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-family - */ - fontFamily?: any; - - /** - * The font-kerning property allows contextual adjustment of inter-glyph spacing, i.e. the spaces between the characters in text. This property controls metric kerning - that utilizes adjustment data contained in the font. Optical Kerning is not supported as yet. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-kerning - */ - fontKerning?: CSSGlobalValues | 'auto' | 'normal' | 'none'; - - /** - * Specifies the size of the font. Used to compute em and ex units. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-size - */ - fontSize?: CSSValue; - - /** - * The font-size-adjust property adjusts the font-size of the fallback fonts defined with font-family, so that the x-height is the same no matter what font is used. This preserves the readability of the text when fallback happens. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-size-adjust - */ - fontSizeAdjust?: any; - - /** - * Allows you to expand or condense the widths for a normal, condensed, or expanded font face. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-stretch - */ - fontStretch?: CSSGlobalValues | 'normal' | 'ultra-condensed' | 'extra-condensed' | 'condensed' | 'semi-condensed' | 'semi-expanded' | 'expanded' | 'extra-expanded' | 'ultra-expanded'; - - /** - * The font-style property allows normal, italic, or oblique faces to be selected. Italic forms are generally cursive in nature while oblique faces are typically sloped versions of the regular face. Oblique faces can be simulated by artificially sloping the glyphs of the regular face. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-style - */ - fontStyle?: CSSGlobalValues | 'normal' | 'italic' | 'oblique'; - - /** - * This value specifies whether the user agent is allowed to synthesize bold or oblique font faces when a font family lacks bold or italic faces. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-synthesis - */ - fontSynthesis?: any; - - /** - * The font-variant property enables you to select the small-caps font within a font family. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant - */ - fontVariant?: any; - - /** - * Fonts can provide alternate glyphs in addition to default glyph for a character. This property provides control over the selection of these alternate glyphs. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-alternates - */ - fontVariantAlternates?: any; - - /** - * Specifies the weight or boldness of the font. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight - */ - fontWeight?: CSSFontWeight; - - /** - * Lays out one or more grid items bound by 4 grid lines. Shorthand for setting grid-column-start, grid-column-end, grid-row-start, and grid-row-end in a single declaration. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-area - */ - gridArea?: any; - - /** - * Specifies the size of an implicitly-created grid column track. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-columns - */ - gridAutoColumns?: any; - - /** - * Controls how the auto-placement algorithm works, specifying exactly how auto-placed items get flowed into the grid. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-flow - */ - gridAutoFlow?: any; - - /** - * Specifies the size of an implicitly-created grid row track. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-rows - */ - gridAutoRows?: any; - - /** - * Controls a grid item's placement in a grid area, particularly grid position and a grid span. Shorthand for setting grid-column-start and grid-column-end in a single declaration. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column - */ - gridColumn?: any; - - /** - * Specifies the gutter between grid columns. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-gap - */ - gridColumnGap?: any; - - /** - * Controls a grid item's placement in a grid area as well as grid position and a grid span. The grid-column-end property (with grid-row-start, grid-row-end, and grid-column-start) determines a grid item's placement by specifying the grid lines of a grid item's grid area. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-end - */ - gridColumnEnd?: any; - - /** - * Determines a grid item's placement by specifying the starting grid lines of a grid item's grid area . A grid item's placement in a grid area consists of a grid position and a grid span. See also ( grid-row-start, grid-row-end, and grid-column-end) - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-start - */ - gridColumnStart?: any; - - /** - * Specifies the gutters between grid rows and columns, Shorthand for for grid-row-gap and grid-column-gap in a single declaration. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-gap - */ - gridGap?: any; - - /** - * Gets or sets a value that indicates which row an element within a Grid should appear in. Shorthand for setting grid-row-start and grid-row-end in a single declaration. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row - */ - gridRow?: any; - - /** - * Determines a grid item’s placement by specifying the block-end. A grid item's placement in a grid area consists of a grid position and a grid span. The grid-row-end property (with grid-row-start, grid-column-start, and grid-column-end) determines a grid item's placement by specifying the grid lines of a grid item's grid area. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-end - */ - gridRowEnd?: any; - - /** - * Specifies the gutter between grid rows. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-gap - */ - gridRowGap?: any; - - /** - * Determines a grid item’s start position within the grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start edge of its grid area. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-start - */ - gridRowStart?: any; - - /** - * Specifies a row position based upon an integer location, string value, or desired row size. - * css/properties/grid-row is used as short-hand for grid-row-position and grid-row-position - */ - gridRowPosition?: any; - - gridRowSpan?: any; - - /** - * Is a shorthand property for defining grid columns, rows, and areas. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-areas - */ - gridTemplate?: any; - - /** - * Specifies named grid areas which are not associated with any particular grid item, but can be referenced from the grid-placement properties. The syntax of the grid-template-areas property also provides a visualization of the structure of the grid, making the overall layout of the grid container easier to understand. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-areas - */ - gridTemplateAreas?: any; - - /** - * Specifies (with grid-template-rows) the line names and track sizing functions of the grid. Each sizing function can be specified as a length, a percentage of the grid container’s size, a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns - */ - gridTemplateColumns?: any; - - /** - * Specifies (with grid-template-columns) the line names and track sizing functions of the grid. Each sizing function can be specified as a length, a percentage of the grid container’s size, a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-rows - */ - gridTemplateRows?: any; - - /** - * Sets the height of an element. The content area of the element height does not include the padding, border, and margin of the element. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/height - */ - height?: CSSValue<'auto' | CSSLength | CSSPercentage | CSSGlobalValues>; - - /** - * Specifies the minimum number of characters in a hyphenated word - * @see https://msdn.microsoft.com/en-us/library/hh771865(v=vs.85).aspx - */ - hyphenateLimitChars?: any; - - /** - * Indicates the maximum number of successive hyphenated lines in an element. The ‘no-limit’ value means that there is no limit. - * @see https://msdn.microsoft.com/en-us/library/hh771867(v=vs.85).aspx - */ - hyphenateLimitLines?: any; - - /** - * Specifies the maximum amount of trailing whitespace (before justification) that may be left in a line before hyphenation is triggered to pull part of a word from the next line back up into the current one. - * @see https://msdn.microsoft.com/en-us/library/hh771869(v=vs.85).aspx - */ - hyphenateLimitZone?: any; - - /** - * Specifies whether or not words in a sentence can be split by the use of a manual or automatic hyphenation mechanism. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens - */ - hyphens?: CSSGlobalValues | string | 'none' | 'manual' | 'auto'; - - /** - * Controls the state of the input method editor for text fields. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/ime-mode - */ - imeMode?: CSSGlobalValues | 'auto' | 'normal' | 'active' | 'inactive' | 'disabled'; - - /** - * Defines how the browser distributes space between and around flex items - * along the main-axis of their container. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content - */ - justifyContent?: JustifyContent; - '-webkit-justify-content'?: JustifyContent; - '-ms-flex-pack'?: string; - - /** - * Defines the default justify-self for all items of the box, given them the - * default way of justifying each box along the appropriate axis - */ - justifyItems?: JustifyItems; - - /** - * Defines the way of justifying a box inside its container along the appropriate axis. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self - */ - justifySelf?: JustifySelf; - - layoutGrid?: any; - - layoutGridChar?: any; - - layoutGridLine?: any; - - layoutGridMode?: any; - - layoutGridType?: any; - - /** - * Sets the left edge of an element - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/left - */ - left?: CSSValue<'auto' | CSSLength | CSSPercentage | CSSGlobalValues>; - - /** - * The letter-spacing CSS property specifies the spacing behavior between text characters. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/letter-spacing - */ - letterSpacing?: any; - - /** - * Deprecated. Gets or sets line-breaking rules for text in selected languages such as Japanese, Chinese, and Korean. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-break - */ - lineBreak?: any; - - lineClamp?: number; - - /** - * Specifies the height of an inline block level element. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height - */ - lineHeight?: CSSValue; - - /** - * Shorthand property that sets the list-style-type, list-style-position and list-style-image properties in one declaration. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/list-style - */ - listStyle?: any; - - /** - * This property sets the image that will be used as the list item marker. When the image is available, it will replace the marker set with the 'list-style-type' marker. That also means that if the image is not available, it will show the style specified by list-style-property - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-image - */ - listStyleImage?: any; - - /** - * Specifies if the list-item markers should appear inside or outside the content flow. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-position - */ - listStylePosition?: CSSGlobalValues | 'inside' | 'outside'; - - /** - * Specifies the type of list-item marker in a list. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-type - */ - listStyleType?: any; - - /** - * The margin property is shorthand to allow you to set all four margins of an element at once. Its equivalent longhand properties are margin-top, margin-right, margin-bottom and margin-left. Negative values are also allowed. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/margin - */ - margin?: any; - - /** - * margin-bottom sets the bottom margin of an element. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom - */ - marginBottom?: any; - - /** - * margin-left sets the left margin of an element. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left - */ - marginLeft?: any; - - /** - * margin-right sets the right margin of an element. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right - */ - marginRight?: any; - - /** - * margin-top sets the top margin of an element. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top - */ - marginTop?: CSSValueGeneral; - - /** - * The marquee-direction determines the initial direction in which the marquee content moves. - */ - marqueeDirection?: any; - - /** - * The 'marquee-style' property determines a marquee's scrolling behavior. - */ - marqueeStyle?: any; - - /** - * This property is shorthand for setting mask-image, mask-mode, mask-repeat, mask-position, mask-clip, mask-origin, mask-composite and mask-size. Omitted values are set to their original properties' initial values. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/mask - */ - mask?: any; - - /** - * This property is shorthand for setting mask-border-source, mask-border-slice, mask-border-width, mask-border-outset, and mask-border-repeat. Omitted values are set to their original properties' initial values. - */ - maskBorder?: any; - - /** - * This property specifies how the images for the sides and the middle part of the mask image are scaled and tiled. The first keyword applies to the horizontal sides, the second one applies to the vertical ones. If the second keyword is absent, it is assumed to be the same as the first, similar to the CSS border-image-repeat property. - */ - maskBorderRepeat?: any; - - /** - * This property specifies inward offsets from the top, right, bottom, and left edges of the mask image, dividing it into nine regions: four corners, four edges, and a middle. The middle image part is discarded and treated as fully transparent black unless the fill keyword is present. The four values set the top, right, bottom and left offsets in that order, similar to the CSS border-image-slice property. - */ - maskBorderSlice?: any; - - /** - * Specifies an image to be used as a mask. An image that is empty, fails to download, is non-existent, or cannot be displayed is ignored and does not mask the element. - */ - maskBorderSource?: any; - - /** - * This property sets the width of the mask box image, similar to the CSS border-image-width property. - */ - maskBorderWidth?: CSSValue; - - /** - * Determines the mask painting area, which defines the area that is affected by the mask. The painted content of an element may be restricted to this area. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/mask-clip - */ - maskClip?: any; - - /** - * For elements rendered as a single box, specifies the mask positioning area. For elements rendered as multiple boxes (e.g., inline boxes on several lines, boxes on several pages) specifies which boxes box-decoration-break operates on to determine the mask positioning area(s). - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/mask-origin - */ - maskOrigin?: any; - - /** - * This property must not be used. It is no longer included in any standard or standard track specification, nor is it implemented in any browser. It is only used when the text-align-last property is set to size. It controls allowed adjustments of font-size to fit line content. - */ - maxFontSize?: any; - - /** - * Sets the maximum height for an element. It prevents the height of the element to exceed the specified value. If min-height is specified and is greater than max-height, max-height is overridden. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/max-height - */ - maxHeight?: CSSValue; - - /** - * Sets the maximum width for an element. It limits the width property to be larger than the value specified in max-width. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/max-width - */ - maxWidth?: CSSValue; - - /** - * Sets the minimum height for an element. It prevents the height of the element to be smaller than the specified value. The value of min-height overrides both max-height and height. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/min-height - */ - minHeight?: CSSValue; - - /** - * Sets the minimum width of an element. It limits the width property to be not smaller than the value specified in min-width. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/min-width - */ - minWidth?: CSSValue; - - /** - * The blend mode defines the formula that must be used to mix the colors with the backdrop - * @see https://drafts.fxtf.org/compositing-1/#mix-blend-mode - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode - */ - mixBlendMode?: CSSValue; - - /** - * Specifies how the contents of a replaced element should be fitted to the box established by its used height and width. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit - */ - objectFit?: CSSObjectFit; - - /** - * Determines the alignment of the element inside its box. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/object-position - */ - objectPosition?: string | CSSGlobalValues; - - /** - * Specifies the transparency of an element. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/opacity - */ - opacity?: number | CSSGlobalValues; - - /** - * Specifies the order used to lay out flex items in their flex container. - * Elements are laid out in the ascending order of the order value. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/order - */ - order?: number; - - /** - * In paged media, this property defines the minimum number of lines in - * a block container that must be left at the bottom of the page. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/orphans - */ - orphans?: number; - - /** - * The CSS outline property is a shorthand property for setting one or more of the individual outline properties outline-style, outline-width and outline-color in a single rule. In most cases the use of this shortcut is preferable and more convenient. - * Outlines differ from borders in the following ways: • Outlines do not take up space, they are drawn above the content. - * • Outlines may be non-rectangular. They are rectangular in Gecko/Firefox. Internet Explorer attempts to place the smallest contiguous outline around all elements or shapes that are indicated to have an outline. Opera draws a non-rectangular shape around a construct. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/outline - */ - outline?: any; - - /** - * The outline-color property sets the color of the outline of an element. An outline is a line that is drawn around elements, outside the border edge, to make the element stand out. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/outline-color - */ - outlineColor?: CSSValue; - - /** - * The outline-style property sets the style of the outline of an element. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/outline-style - */ - outlineStyle?: CSSGlobalValues | 'auto' | 'none' | 'dotted' | 'dashed' | 'solid' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset'; - - /** - * The outline-offset property offsets the outline and draw it beyond the border edge. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/outline-offset - */ - outlineOffset?: any; - - /** - * The outline-width CSS property is used to set the width of the outline of an element. An outline is a line that is drawn around elements, outside the border edge, to make the element stand out - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/outline-width - */ - outlineWidth?: CSSGlobalValues | 'thin' | 'medium' | 'thick' | CSSLength; - - /** - * The overflow property controls how extra content exceeding the bounding box of an element is rendered. It can be used in conjunction with an element that has a fixed width and height, to eliminate text-induced page distortion. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/overflow - */ - overflow?: CSSValue; - - /** - * Specifies the preferred scrolling methods for elements that overflow. - */ - overflowStyle?: any; - - /** - * The overflow-wrap CSS property specifies whether or not the browser should insert line breaks within words to prevent - * text from overflowing its content box. In contrast to word-break, overflow-wrap will only create a break if an entire - * word cannot be placed on its own line without overflowing. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap - */ - overflowWrap?: CSSGlobalValues | 'normal' | 'break-word'; - - /** - * Controls how extra content exceeding the x-axis of the bounding box of an element is rendered. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-x - */ - overflowX?: CSSValue; - - /** - * Controls how extra content exceeding the y-axis of the bounding box of an element is rendered. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-y - */ - overflowY?: CSSValue; - - /** - * The padding optional CSS property sets the required padding space on one to four sides of an element. The padding area is the space between an element and its border. Negative values are not allowed but decimal values are permitted. The element size is treated as fixed, and the content of the element shifts toward the center as padding is increased. - * The padding property is a shorthand to avoid setting each side separately (padding-top, padding-right, padding-bottom, padding-left). - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/padding - */ - padding?: any; - - /** - * The padding-bottom CSS property of an element sets the padding space required on the bottom of an element. The padding area is the space between the content of the element and its border. Contrary to margin-bottom values, negative values of padding-bottom are invalid. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/padding-bottom - */ - paddingBottom?: CSSValue; - - /** - * The padding-left CSS property of an element sets the padding space required on the left side of an element. The padding area is the space between the content of the element and its border. Contrary to margin-left values, negative values of padding-left are invalid. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/padding-left - */ - paddingLeft?: CSSValue; - - /** - * The padding-right CSS property of an element sets the padding space required on the right side of an element. The padding area is the space between the content of the element and its border. Contrary to margin-right values, negative values of padding-right are invalid. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/padding-right - */ - paddingRight?: CSSValue; - - /** - * The padding-top CSS property of an element sets the padding space required on the top of an element. The padding area is the space between the content of the element and its border. Contrary to margin-top values, negative values of padding-top are invalid. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/padding-top - */ - paddingTop?: CSSValue; - - /** - * The page-break-after property is supported in all major browsers. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/page-break-after - */ - pageBreakAfter?: CSSGlobalValues | 'auto' | 'always' | 'avoid' | 'left' | 'right' | 'recto' | 'verso'; - - /** - * The page-break-before property sets the page-breaking behavior before an element. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/page-break-before - */ - pageBreakBefore?: CSSGlobalValues | 'auto' | 'always' | 'avoid' | 'left' | 'right' | 'recto' | 'verso'; - - /** - * Sets the page-breaking behavior inside an element. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/page-break-inside - */ - pageBreakInside?: CSSGlobalValues | 'auto' | 'avoid'; - - /** - * The pause property determines how long a speech media agent should pause before and after presenting an element. It is a shorthand for the pause-before and pause-after properties. - */ - pause?: any; - - /** - * The pause-after property determines how long a speech media agent should pause after presenting an element. It may be replaced by the shorthand property pause, which sets pause time before and after. - */ - pauseAfter?: any; - - /** - * The pause-before property determines how long a speech media agent should pause before presenting an element. It may be replaced by the shorthand property pause, which sets pause time before and after. - */ - pauseBefore?: any; - - /** - * The perspective property defines how far an element is placed from the view on the z-axis, from the screen to the viewer. - * Perspective defines how an object is viewed. In graphic arts, perspective is the representation on a flat surface of what the viewer's eye would see in a 3D space. (See Wikipedia for more information about graphical perspective and for related illustrations.) - * The illusion of perspective on a flat surface, such as a computer screen, is created by projecting points on the flat surface as they would appear if the flat surface were a window through which the viewer was looking at the object. In discussion of virtual environments, this flat surface is called a projection plane. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/perspective - */ - perspective?: any; - - /** - * The perspective-origin property establishes the origin for the perspective property. It effectively sets the X and Y position at which the viewer appears to be looking at the children of the element. - * When used with perspective, perspective-origin changes the appearance of an object, as if a viewer were looking at it from a different origin. An object appears differently if a viewer is looking directly at it versus looking at it from below, above, or from the side. Thus, the perspective-origin is like a vanishing point. - * The default value of perspective-origin is 50% 50%. This displays an object as if the viewer's eye were positioned directly at the center of the screen, both top-to-bottom and left-to-right. A value of 0% 0% changes the object as if the viewer was looking toward the top left angle. A value of 100% 100% changes the appearance as if viewed toward the bottom right angle. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/perspective-origin - */ - perspectiveOrigin?: any; - - /** - * The pointer-events property allows you to control whether an element can be the target for the pointing device (e.g, mouse, pen) events. - * @see https://developer.mozilla.org/en/docs/Web/CSS/pointer-events - */ - pointerEvents?: CSSGlobalValues | 'auto' | 'none' | 'visiblePainted' | 'visibleFill' | 'visibleStroke' | 'visible' | 'painted' | 'fill' | 'stroke' | 'all'; - - /** - * The position property controls the type of positioning used by an element within its parent elements. The effect of the position property depends on a lot of factors, for example the position property of parent elements. - * @see https://developer.mozilla.org/en/docs/Web/CSS/position - */ - position?: CSSValue; - - /** - * Obsolete: unsupported. - * This property determines whether or not a full-width punctuation mark character should be trimmed if it appears at the beginning of a line, so that its "ink" lines up with the first glyph in the line above and below. - */ - punctuationTrim?: any; - - /** - * Sets the type of quotation marks for embedded quotations. - * @see https://developer.mozilla.org/en/docs/Web/CSS/quotes - */ - quotes?: any; - - /** - * Controls whether the last region in a chain displays additional 'overset' content according its default overflow property, or if it displays a fragment of content as if it were flowing into a subsequent region. - */ - regionFragment?: any; - - /** - * The resize CSS property lets you control the resizability of an element. - * @see https://developer.mozilla.org/en/docs/Web/CSS/resize - */ - resize?: CSSGlobalValues | 'none' | 'both ' | 'horizontal' | 'vertical'; - - /** - * The rest-after property determines how long a speech media agent should pause after presenting an element's main content, before presenting that element's exit cue sound. It may be replaced by the shorthand property rest, which sets rest time before and after. - */ - restAfter?: any; - - /** - * The rest-before property determines how long a speech media agent should pause after presenting an intro cue sound for an element, before presenting that element's main content. It may be replaced by the shorthand property rest, which sets rest time before and after. - */ - restBefore?: any; - - /** - * Specifies the position an element in relation to the right side of the containing element. - * @see https://developer.mozilla.org/en/docs/Web/CSS/right - */ - right?: CSSValue<'auto' | CSSLength | CSSPercentage | CSSGlobalValues>; - - /** - * Specifies the distribution of the different ruby elements over the base. - * @see https://developer.mozilla.org/en/docs/Web/CSS/ruby-align - */ - rubyAlign?: CSSGlobalValues | 'start' | 'center' | 'space-between' | 'space-around'; - - /** - * Specifies the position of a ruby element relatives to its base element. It can be position over the element (over), under it (under), or between the characters, on their right side (inter-character). - * @see https://developer.mozilla.org/en/docs/Web/CSS/ruby-position - */ - rubyPosition?: CSSGlobalValues | 'over' | 'under' | 'inter-character'; - - /** - * SVG: For the element, this attribute defines the x-radius of the element. A value of zero disables rendering of the element. - * https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/rx - */ - rx?: number; - - /** - * SVG: For the element, this attribute defines the y-radius of the element. A value of zero disables rendering of the element. - * https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/ry - */ - ry?: number; - - /** - * Defines the alpha channel threshold used to extract a shape from an image. Can be thought of as a "minimum opacity" threshold; that is, a value of 0.5 means that the shape will enclose all the pixels that are more than 50% opaque. - * @see https://developer.mozilla.org/en/docs/Web/CSS/shape-image-threshold - */ - shapeImageThreshold?: any; - - /** - * A future level of CSS Shapes will define a shape-inside property, which will define a shape to wrap content within the element. See Editor's Draft and CSSWG wiki page on next-level plans - */ - shapeInside?: any; - - /** - * Adds a margin to a shape-outside. In effect, defines a new shape that is the smallest contour around all the points that are the shape-margin distance outward perpendicular to each point on the underlying shape. For points where a perpendicular direction is not defined (e.g., a triangle corner), takes all points on a circle centered at the point and with a radius of the shape-margin distance. This property accepts only non-negative values. - * @see https://developer.mozilla.org/en/docs/Web/CSS/shape-margin - */ - shapeMargin?: any; - - /** - * Declares a shape around which text should be wrapped, with possible modifications from the shape-margin property. The shape defined by shape-outside and shape-margin changes the geometry of a float element's float area. - * @see https://developer.mozilla.org/en/docs/Web/CSS/shape-outside - */ - shapeOutside?: any; - - /** - * The speak property determines whether or not a speech synthesizer will read aloud the contents of an element. - */ - speak?: any; - - /** - * The speak-as property determines how the speech synthesizer interprets the content: words as whole words or as a sequence of letters, numbers as a numerical value or a sequence of digits, punctuation as pauses in speech or named punctuation characters. - */ - speakAs?: any; - - /** - * Location of a font-face. Used with the @font-face at rule - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src - */ - src?: CSSValueString; - - /** - * SVG: Defines the color of the outline on a given graphical element. - * @see https://developer.mozilla.org/en/docs/Web/CSS/stroke - */ - stroke?: string; - - /** - * SVG: Controls the pattern of dashes and gaps used to stroke paths. - * @see https://developer.mozilla.org/en/docs/Web/CSS/stroke-dasharray - */ - strokeDasharray?: number[]; - - /** - * SVG: Specifies the distance into the dash pattern to start the dash - * @see https://developer.mozilla.org/en/docs/Web/SVG/Attribute/stroke-dashoffset - */ - strokeDashoffset?: CSSValue; - - /** - * SVG: Specifies the shape to be used at the end of open subpaths when they are stroked. - * @see https://developer.mozilla.org/en/docs/Web/SVG/Attribute/stroke-linecap - */ - strokeLinecap?: CSSGlobalValues | 'butt' | 'round' | 'square'; - - /** - * SVG: Specifies the opacity of the outline on the current object. - * @see https://developer.mozilla.org/en/docs/Web/CSS/stroke-opacity - */ - strokeOpacity?: number; - - /** - * SVG: Specifies the width of the outline on the current object. - * @see https://developer.mozilla.org/en/docs/Web/CSS/stroke-width - */ - strokeWidth?: CSSValue; - - /** - * The tab-size CSS property is used to customise the width of a tab (U+0009) character. - * @see https://developer.mozilla.org/en/docs/Web/CSS/tab-size - */ - tabSize?: any; - - /** - * The 'table-layout' property controls the algorithm used to lay out the table cells, rows, and columns. - * @see https://developer.mozilla.org/en/docs/Web/CSS/table-layout - */ - tableLayout?: any; - - /** - * SVG: The text-anchor attribute is used to align (start-, middle- or end-alignment) a string of text relative to a given point. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/text-anchor - */ - textAnchor?: 'start' | 'middle' | 'end' | 'inherit'; - - /** - * The text-align CSS property describes how inline content like text is aligned in its parent block element. text-align does not control the alignment of block elements itself, only their inline content. - * @see https://developer.mozilla.org/en/docs/Web/CSS/text-align - */ - textAlign?: CSSGlobalValues | 'start' | 'end' | 'left' | 'right' | 'center' | 'justify' | 'justify-all' | 'match-parent'; - - /** - * The text-align-last CSS property describes how the last line of a block element or a line before line break is aligned in its parent block element. - * @see https://developer.mozilla.org/en/docs/Web/CSS/text-align-last - */ - textAlignLast?: CSSGlobalValues | 'auto' | 'start' | 'end' | 'left' | 'right' | 'center' | 'justify'; - - /** - * The text-decoration CSS property is used to set the text formatting to underline, overline, line-through or blink. - * underline and overline decorations are positioned under the text, line-through over it. - * @see https://developer.mozilla.org/en/docs/Web/CSS/text-decoration - */ - textDecoration?: any; - - /** - * Sets the color of any text decoration, such as underlines, overlines, and strike throughs. - * @see https://developer.mozilla.org/en/docs/Web/CSS/text-decoration-color - */ - textDecorationColor?: CSSValue; - - /** - * Sets what kind of line decorations are added to an element, such as underlines, overlines, etc. - * @see https://developer.mozilla.org/en/docs/Web/CSS/text-decoration-line - */ - textDecorationLine?: any; - - textDecorationLineThrough?: any; - - textDecorationNone?: any; - - textDecorationOverline?: any; - - /** - * Specifies what parts of an element’s content are skipped over when applying any text decoration. - * @see https://developer.mozilla.org/en/docs/Web/CSS/text-decoration-skip - */ - textDecorationSkip?: any; - - /** - * This property specifies the style of the text decoration line drawn on the specified element. The intended meaning for the values are the same as those of the border-style-properties. - * @see https://developer.mozilla.org/en/docs/Web/CSS/text-decoration-style - */ - textDecorationStyle?: CSSGlobalValues | 'solid' | 'double' | 'dotted' | 'dashed' | 'wavy'; - - textDecorationUnderline?: any; - - /** - * The text-emphasis property will apply special emphasis marks to the elements text. Slightly similar to the text-decoration property only that this property can have affect on the line-height. It also is noted that this is shorthand for text-emphasis-style and for text-emphasis-color. - * @see https://developer.mozilla.org/en/docs/Web/CSS/text-emphasis - */ - textEmphasis?: any; - - /** - * The text-emphasis-color property specifies the foreground color of the emphasis marks. - * @see https://developer.mozilla.org/en/docs/Web/CSS/text-emphasis-color - */ - textEmphasisColor?: CSSValue; - - /** - * The text-emphasis-style property applies special emphasis marks to an element's text. - * @see https://developer.mozilla.org/en/docs/Web/CSS/text-emphasis-style - */ - textEmphasisStyle?: any; - - /** - * This property helps determine an inline box's block-progression dimension, derived from the text-height and font-size properties for non-replaced elements, the height or the width for replaced elements, and the stacked block-progression dimension for inline-block elements. The block-progression dimension determines the position of the padding, border and margin for the element. - */ - textHeight?: CSSValue; - - /** - * Specifies the amount of space horizontally that should be left on the first line of the text of an element. This horizontal spacing is at the beginning of the first line and is in respect to the left edge of the containing block box. - * @see https://developer.mozilla.org/en/docs/Web/CSS/text-indent - */ - textIndent?: any; - - textJustifyTrim?: any; - - textKashidaSpace?: any; - - /** - * The text-line-through property is a shorthand property for text-line-through-style, text-line-through-color and text-line-through-mode. (Considered obsolete; use text-decoration instead.) - */ - textLineThrough?: any; - - /** - * Specifies the line colors for the line-through text decoration. - * (Considered obsolete; use text-decoration-color instead.) - */ - textLineThroughColor?: CSSValue; - - /** - * Sets the mode for the line-through text decoration, determining whether the text decoration affects the space characters or not. - * (Considered obsolete; use text-decoration-skip instead.) - */ - textLineThroughMode?: any; - - /** - * Specifies the line style for line-through text decoration. - * (Considered obsolete; use text-decoration-style instead.) - */ - textLineThroughStyle?: any; - - /** - * Specifies the line width for the line-through text decoration. - */ - textLineThroughWidth?: CSSValue; - - /** - * The text-overflow shorthand CSS property determines how overflowed content that is not displayed is signaled to the users. It can be clipped, display an ellipsis ('…', U+2026 HORIZONTAL ELLIPSIS) or a Web author-defined string. It covers the two long-hand properties text-overflow-mode and text-overflow-ellipsis - * @see https://developer.mozilla.org/en/docs/Web/CSS/text-overflow - */ - textOverflow?: CSSGlobalValues | 'clip' | 'ellipsis' | string; - - /** - * The text-overline property is the shorthand for the text-overline-style, text-overline-width, text-overline-color, and text-overline-mode properties. - */ - textOverline?: any; - - /** - * Specifies the line color for the overline text decoration. - */ - textOverlineColor?: CSSValue; - - /** - * Sets the mode for the overline text decoration, determining whether the text decoration affects the space characters or not. - */ - textOverlineMode?: any; - - /** - * Specifies the line style for overline text decoration. - */ - textOverlineStyle?: any; - - /** - * Specifies the line width for the overline text decoration. - */ - textOverlineWidth?: CSSValue; - - /** - * The text-rendering CSS property provides information to the browser about how to optimize when rendering text. Options are: legibility, speed or geometric precision. - * @see https://developer.mozilla.org/en/docs/Web/CSS/text-rendering - */ - textRendering?: CSSGlobalValues | 'auto' | 'optimizeSpeed' | 'optimizeLegibility' | 'geometricPrecision'; - - /** - * Obsolete: unsupported. - */ - textScript?: any; - - /** - * The CSS text-shadow property applies one or more drop shadows to the text and of an element. Each shadow is specified as an offset from the text, along with optional color and blur radius values. - * @see https://developer.mozilla.org/en/docs/Web/CSS/text-shadow - */ - textShadow?: any; - - /** - * This property transforms text for styling purposes. (It has no effect on the underlying content.) - * @see https://developer.mozilla.org/en/docs/Web/CSS/text-transform - */ - textTransform?: CSSGlobalValues | 'none' | 'capitalize' | 'uppercase' | 'lowercase' | 'full-width'; - - /** - * Unsupported. - * This property will add a underline position value to the element that has an underline defined. - */ - textUnderlinePosition?: any; - - /** - * After review this should be replaced by text-decoration should it not? - * This property will set the underline style for text with a line value for underline, overline, and line-through. - */ - textUnderlineStyle?: any; - - /** - * This property specifies how far an absolutely positioned box's top margin edge is offset below the top edge of the box's containing block. For relatively positioned boxes, the offset is with respect to the top edges of the box itself (i.e., the box is given a position in the normal flow, then offset from that position according to these properties). - * @see https://developer.mozilla.org/en/docs/Web/CSS/top - */ - top?: CSSValue<'auto' | CSSLength | CSSPercentage | CSSGlobalValues>; - - /** - * Determines whether touch input may trigger default behavior supplied by the user agent, such as panning or zooming. - * @see https://developer.mozilla.org/en/docs/Web/CSS/touch-action - */ - touchAction?: CSSGlobalValues | 'auto' | 'none' | 'pan-x' | 'pan-left' | 'pan-right' | 'pan-y' | 'pan-up' | 'pan-down' | 'manipulation'; - - /** - * CSS transforms allow elements styled with CSS to be transformed in two-dimensional or three-dimensional space. Using this property, elements can be translated, rotated, scaled, and skewed. The value list may consist of 2D and/or 3D transform values. - * @see https://developer.mozilla.org/en/docs/Web/CSS/transform - */ - transform?: CSSTransformFunction; - - /** - * This property defines the origin of the transformation axes relative to the element to which the transformation is applied. - * @see https://developer.mozilla.org/en/docs/Web/CSS/transform-origin - */ - transformOrigin?: any; - - /** - * This property allows you to define the relative position of the origin of the transformation grid along the z-axis. - */ - transformOriginZ?: any; - - /** - * This property specifies how nested elements are rendered in 3D space relative to their parent. - * @see https://developer.mozilla.org/en/docs/Web/CSS/transform-style - */ - transformStyle?: CSSGlobalValues | 'flat' | 'preserve-3d'; - - /** - * The transition CSS property is a shorthand property for transition-property, transition-duration, transition-timing-function, and transition-delay. It allows to define the transition between two states of an element. - * @see https://developer.mozilla.org/en/docs/Web/CSS/transition - */ - transition?: any; - - /** - * Defines when the transition will start. A value of ‘0s’ means the transition will execute as soon as the property is changed. Otherwise, the value specifies an offset from the moment the property is changed, and the transition will delay execution by that offset. - * @see https://developer.mozilla.org/en/docs/Web/CSS/transition-delay - */ - transitionDelay?: any; - - /** - * The 'transition-duration' property specifies the length of time a transition animation takes to complete. - * @see https://developer.mozilla.org/en/docs/Web/CSS/transition-duration - */ - transitionDuration?: any; - - /** - * The 'transition-property' property specifies the name of the CSS property to which the transition is applied. - * @see https://developer.mozilla.org/en/docs/Web/CSS/transition-property - */ - transitionProperty?: CSSValueString; - - /** - * Sets the pace of action within a transition - * @see https://developer.mozilla.org/en/docs/Web/CSS/transition-timing-function - */ - transitionTimingFunction?: CSSTimingFunction; - - /** - * The unicode-bidi CSS property specifies the level of embedding with respect to the bidirectional algorithm. - * @see https://developer.mozilla.org/en/docs/Web/CSS/unicode-bidi - */ - unicodeBidi?: any; - - /** - * unicode-range allows you to set a specific range of characters to be downloaded from a font (embedded using @font-face) and made available for use on the current page. - * @see https://developer.mozilla.org/en/docs/Web/CSS/unicode-range - */ - unicodeRange?: any; - - /** - * This is for all the high level UX stuff. - */ - userFocus?: any; - - /** - * For inputing user content - */ - userInput?: any; - - /** - * User select - * @see https://developer.mozilla.org/en/docs/Web/CSS/user-select - */ - userSelect?: 'auto' | 'text' | 'none' | 'contain' | 'all'; - '-moz-user-select'?: 'auto' | 'text' | 'none' | 'contain' | 'all'; - '-webkit-user-select'?: 'auto' | 'text' | 'none' | 'contain' | 'all'; - '-ms-user-select'?: 'auto' | 'text' | 'none' | 'contain' | 'all'; - - /** - * The vertical-align property controls how inline elements or text are vertically aligned compared to the baseline. If this property is used on table-cells it controls the vertical alignment of content of the table cell. - * @see https://developer.mozilla.org/en/docs/Web/CSS/vertical-align - */ - verticalAlign?: CSSGlobalValues | 'baseline' | 'sub' | 'super' | 'text-top' | 'text-bottom' | 'middle' | 'top' | 'bottom' | CSSLength | CSSPercentage; - - /** - * The visibility property specifies whether the boxes generated by an element are rendered. - * @see https://developer.mozilla.org/en/docs/Web/CSS/visibility - */ - visibility?: CSSGlobalValues | 'visible' | 'hidden' | 'collapse'; - - /** - * The voice-balance property sets the apparent position (in stereo sound) of the synthesized voice for spoken media. - */ - voiceBalance?: any; - - /** - * The voice-duration property allows the author to explicitly set the amount of time it should take a speech synthesizer to read an element's content, for example to allow the speech to be synchronized with other media. With a value of auto (the default) the length of time it takes to read the content is determined by the content itself and the voice-rate property. - */ - voiceDuration?: any; - - /** - * The voice-family property sets the speaker's voice used by a speech media agent to read an element. The speaker may be specified as a named character (to match a voice option in the speech reading software) or as a generic description of the age and gender of the voice. Similar to the font-family property for visual media, a comma-separated list of fallback options may be given in case the speech reader does not recognize the character name or cannot synthesize the requested combination of generic properties. - */ - voiceFamily?: any; - - /** - * The voice-pitch property sets pitch or tone (high or low) for the synthesized speech when reading an element; the pitch may be specified absolutely or relative to the normal pitch for the voice-family used to read the text. - */ - voicePitch?: any; - - /** - * The voice-range property determines how much variation in pitch or tone will be created by the speech synthesize when reading an element. Emphasized text, grammatical structures and punctuation may all be rendered as changes in pitch, this property determines how strong or obvious those changes are; large ranges are associated with enthusiastic or emotional speech, while small ranges are associated with flat or mechanical speech. - */ - voiceRange?: any; - - /** - * The voice-rate property sets the speed at which the voice synthesized by a speech media agent will read content. - */ - voiceRate?: any; - - /** - * The voice-stress property sets the level of vocal emphasis to be used for synthesized speech reading the element. - */ - voiceStress?: any; - - /** - * The voice-volume property sets the volume for spoken content in speech media. It replaces the deprecated volume property. - */ - voiceVolume?: any; - - /** - * The white-space property controls whether and how white space inside the element is collapsed, and whether lines may wrap at unforced "soft wrap" opportunities. - * @see https://developer.mozilla.org/en/docs/Web/CSS/white-space - */ - whiteSpace?: CSSGlobalValues | 'normal' | 'nowrap' | 'pre' | 'pre-line' | 'pre-wrap'; - - /** - * Obsolete: unsupported. - */ - whiteSpaceTreatment?: any; - - /** - * In paged media, this property defines the mimimum number of lines - * that must be left at the top of the second page. - * @see https://developer.mozilla.org/en/docs/Web/CSS/widows - */ - widows?: number; - - /** - * Specifies the width of the content area of an element. The content area of the element width does not include the padding, border, and margin of the element. - * @see https://developer.mozilla.org/en/docs/Web/CSS/width - */ - width?: CSSValue<'auto' | CSSLength | CSSPercentage | CSSGlobalValues>; - - /** - * The ‘will-change’ CSS property provides a way for authors to hint browsers about the kind of changes to be expected on an element, so that the browser can set up appropriate optimizations ahead of time before the element is actually changed. These kind of optimizations can increase the responsiveness of a page by doing potentially expensive work ahead of time before they are actually required. - * @see https://developer.mozilla.org/en-US/docs/Web/CSS/will-change - */ - willChange?: CSSValue<'auto' | 'scroll-position' | 'contents' | CSSValueString>; - - /** - * The word-break property is often used when there is long generated content that is strung together without and spaces or hyphens to beak apart. A common case of this is when there is a long URL that does not have any hyphens. This case could potentially cause the breaking of the layout as it could extend past the parent element. - * @see https://developer.mozilla.org/en/docs/Web/CSS/word-break - */ - wordBreak?: CSSGlobalValues | 'normal' | 'break-all' | 'keep-all'; - - /** - * The word-spacing CSS property specifies the spacing behavior between "words". - * @see https://developer.mozilla.org/en/docs/Web/CSS/word-spacing - */ - wordSpacing?: CSSGlobalValues | 'normal' | CSSLength | CSSPercentage; - - /** - * An alias of css/properties/overflow-wrap, word-wrap defines whether to break words when the content exceeds the boundaries of its container. - * @see https://developer.mozilla.org/en/docs/Web/CSS/word-wrap - */ - wordWrap?: CSSGlobalValues | 'normal' | 'break-word'; - - /** - * Specifies how exclusions affect inline content within block-level elements. Elements lay out their inline content in their content area but wrap around exclusion areas. - */ - wrapFlow?: any; - - /** - * Set the value that is used to offset the inner wrap shape from other shapes. Inline content that intersects a shape with this property will be pushed by this shape's margin. - */ - wrapMargin?: any; - - /** - * Obsolete and unsupported. Do not use. - * This CSS property controls the text when it reaches the end of the block in which it is enclosed. - */ - wrapOption?: any; - - /** - * writing-mode specifies if lines of text are laid out horizontally or vertically, and the direction which lines of text and blocks progress. - * @see https://developer.mozilla.org/en/docs/Web/CSS/writing-mode - */ - writingMode?: CSSGlobalValues | 'horizontal-tb' | 'vertical-rl' | 'vertical-lr' | 'sideways-rl' | 'sideways-lr'; - - /** - * The z-index property specifies the z-order of an element and its descendants. - * When elements overlap, z-order determines which one covers the other. - * @see https://developer.mozilla.org/en/docs/Web/CSS/z-index - */ - zIndex?: CSSGlobalValues | 'auto' | number; - - /** - * Sets the initial zoom factor of a document defined by @viewport. - * @see https://developer.mozilla.org/en/docs/Web/CSS/zoom - */ - zoom?: 'auto' | number; - - // VENDOR prefixes - // non-authoritative source: http://peter.sh/experiments/vendor-prefixed-css-property-overview/ - '-apple-trailing-word'?: CSSValueGeneral; - '-epub-caption-side'?: CSSValueGeneral; - '-epub-hyphens'?: CSSValueGeneral; - '-epub-text-combine'?: CSSValueGeneral; - '-epub-text-emphasis'?: CSSValueGeneral; - '-epub-text-emphasis-color'?: CSSValueGeneral; - '-epub-text-emphasis-style'?: CSSValueGeneral; - '-epub-text-orientation'?: CSSValueGeneral; - '-epub-text-transform'?: CSSValueGeneral; - '-epub-word-break'?: CSSValueGeneral; - '-epub-writing-mode'?: CSSValueGeneral; - '-internal-marquee-direction'?: CSSValueGeneral; - '-internal-marquee-increment'?: CSSValueGeneral; - '-internal-marquee-repetition'?: CSSValueGeneral; - '-internal-marquee-speed'?: CSSValueGeneral; - '-internal-marquee-style'?: CSSValueGeneral; - '-moz-appearance'?: CSSValueGeneral; - '-moz-binding'?: CSSValueGeneral; - '-moz-border-bottom-colors'?: CSSValueGeneral; - '-moz-border-end'?: CSSValueGeneral; - '-moz-border-end-color'?: CSSValueGeneral; - '-moz-border-end-style'?: CSSValueGeneral; - '-moz-border-end-width'?: CSSValueGeneral; - '-moz-border-left-colors'?: CSSValueGeneral; - '-moz-border-right-colors'?: CSSValueGeneral; - '-moz-border-start'?: CSSValueGeneral; - '-moz-border-start-color'?: CSSValueGeneral; - '-moz-border-start-style'?: CSSValueGeneral; - '-moz-border-start-width'?: CSSValueGeneral; - '-moz-border-top-colors'?: CSSValueGeneral; - '-moz-box-align'?: CSSValueGeneral; - '-moz-box-direction'?: CSSValueGeneral; - '-moz-box-flex'?: CSSValueGeneral; - '-moz-box-ordinal-group'?: CSSValueGeneral; - '-moz-box-orient'?: CSSValueGeneral; - '-moz-box-pack'?: CSSValueGeneral; - '-moz-column-count'?: CSSValueGeneral; - '-moz-column-fill'?: CSSValueGeneral; - '-moz-column-gap'?: CSSValueGeneral; - '-moz-column-rule'?: CSSValueGeneral; - '-moz-column-rule-color'?: CSSValueGeneral; - '-moz-column-rule-style'?: CSSValueGeneral; - '-moz-column-rule-width'?: CSSValueGeneral; - '-moz-column-width'?: CSSValueGeneral; - '-moz-columns'?: CSSValueGeneral; - '-moz-control-character-visibility'?: CSSValueGeneral; - '-moz-float-edge'?: CSSValueGeneral; - '-moz-force-broken-image-icon'?: CSSValueGeneral; - '-moz-hyphens'?: CSSValueGeneral; - '-moz-image-region'?: CSSValueGeneral; - '-moz-margin-end'?: CSSValueGeneral; - '-moz-margin-start'?: CSSValueGeneral; - '-moz-math-display'?: CSSValueGeneral; - '-moz-math-variant'?: CSSValueGeneral; - '-moz-min-font-size-ratio'?: CSSValueGeneral; - '-moz-orient'?: CSSValueGeneral; - '-moz-osx-font-smoothing'?: CSSValueGeneral; - '-moz-outline-radius'?: CSSValueGeneral; - '-moz-outline-radius-bottomleft'?: CSSValueGeneral; - '-moz-outline-radius-bottomright'?: CSSValueGeneral; - '-moz-outline-radius-topleft'?: CSSValueGeneral; - '-moz-outline-radius-topright'?: CSSValueGeneral; - '-moz-padding-end'?: CSSValueGeneral; - '-moz-padding-start'?: CSSValueGeneral; - '-moz-script-level'?: CSSValueGeneral; - '-moz-script-min-size'?: CSSValueGeneral; - '-moz-script-size-multiplier'?: CSSValueGeneral; - '-moz-stack-sizing'?: CSSValueGeneral; - '-moz-tab-size'?: CSSValueGeneral; - '-moz-text-align-last'?: CSSValueGeneral; - '-moz-text-decoration-color'?: CSSValueGeneral; - '-moz-text-decoration-line'?: CSSValueGeneral; - '-moz-text-decoration-style'?: CSSValueGeneral; - '-moz-text-size-adjust'?: CSSValueGeneral; - '-moz-top-layer'?: CSSValueGeneral; - '-moz-transform'?: CSSValueGeneral; - '-moz-user-focus'?: CSSValueGeneral; - '-moz-user-input'?: CSSValueGeneral; - '-moz-user-modify'?: CSSValueGeneral; - '-moz-window-dragging'?: CSSValueGeneral; - '-moz-window-shadow'?: CSSValueGeneral; - '-ms-accelerator'?: CSSValueGeneral; - '-ms-animation'?: CSSValueGeneral; - '-ms-animation-delay'?: CSSValueGeneral; - '-ms-animation-direction'?: CSSValueGeneral; - '-ms-animation-duration'?: CSSValueGeneral; - '-ms-animation-fill-mode'?: CSSValueGeneral; - '-ms-animation-iteration-count'?: CSSValueGeneral; - '-ms-animation-name'?: CSSValueGeneral; - '-ms-animation-play-state'?: CSSValueGeneral; - '-ms-animation-timing-function'?: CSSValueGeneral; - '-ms-backface-visibility'?: CSSValueGeneral; - '-ms-background-position-x'?: CSSValueGeneral; - '-ms-background-position-y'?: CSSValueGeneral; - '-ms-behavior'?: CSSValueGeneral; - '-ms-block-progression'?: CSSValueGeneral; - '-ms-content-zoom-chaining'?: CSSValueGeneral; - '-ms-content-zoom-limit'?: CSSValueGeneral; - '-ms-content-zoom-limit-max'?: CSSValueGeneral; - '-ms-content-zoom-limit-min'?: CSSValueGeneral; - '-ms-content-zoom-snap'?: CSSValueGeneral; - '-ms-content-zoom-snap-points'?: CSSValueGeneral; - '-ms-content-zoom-snap-type'?: CSSValueGeneral; - '-ms-content-zooming'?: CSSValueGeneral; - '-ms-filter'?: CSSValueGeneral; - '-ms-flex-flow'?: CSSValueGeneral; - '-ms-flex-line-pack'?: CSSValueGeneral; - '-ms-flex-order'?: CSSValueGeneral; - '-ms-flex-preferred-size'?: CSSValueGeneral; - '-ms-flow-from'?: CSSValueGeneral; - '-ms-flow-into'?: CSSValueGeneral; - '-ms-font-feature-settings'?: CSSValueGeneral; - '-ms-grid-column'?: CSSValueGeneral; - '-ms-grid-column-align'?: CSSValueGeneral; - '-ms-grid-column-span'?: CSSValueGeneral; - '-ms-grid-columns'?: CSSValueGeneral; - '-ms-grid-row'?: CSSValueGeneral; - '-ms-grid-row-align'?: CSSValueGeneral; - '-ms-grid-row-span'?: CSSValueGeneral; - '-ms-grid-rows'?: CSSValueGeneral; - '-ms-high-contrast-adjust'?: CSSValueGeneral; - '-ms-hyphenate-limit-chars'?: CSSValueGeneral; - '-ms-hyphenate-limit-lines'?: CSSValueGeneral; - '-ms-hyphenate-limit-zone'?: CSSValueGeneral; - '-ms-hyphens'?: CSSValueGeneral; - '-ms-ime-align'?: CSSValueGeneral; - '-ms-ime-mode'?: CSSValueGeneral; - '-ms-interpolation-mode'?: CSSValueGeneral; - '-ms-layout-flow'?: CSSValueGeneral; - '-ms-layout-grid'?: CSSValueGeneral; - '-ms-layout-grid-char'?: CSSValueGeneral; - '-ms-layout-grid-line'?: CSSValueGeneral; - '-ms-layout-grid-mode'?: CSSValueGeneral; - '-ms-layout-grid-type'?: CSSValueGeneral; - '-ms-line-break'?: CSSValueGeneral; - '-ms-overflow-style'?: CSSValueGeneral; - '-ms-overflow-x'?: CSSValueGeneral; - '-ms-overflow-y'?: CSSValueGeneral; - '-ms-perspective'?: CSSValueGeneral; - '-ms-perspective-origin'?: CSSValueGeneral; - '-ms-perspective-origin-x'?: CSSValueGeneral; - '-ms-perspective-origin-y'?: CSSValueGeneral; - '-ms-scroll-chaining'?: CSSValueGeneral; - '-ms-scroll-limit'?: CSSValueGeneral; - '-ms-scroll-limit-x-max'?: CSSValueGeneral; - '-ms-scroll-limit-x-min'?: CSSValueGeneral; - '-ms-scroll-limit-y-max'?: CSSValueGeneral; - '-ms-scroll-limit-y-min'?: CSSValueGeneral; - '-ms-scroll-rails'?: CSSValueGeneral; - '-ms-scroll-snap-points-x'?: CSSValueGeneral; - '-ms-scroll-snap-points-y'?: CSSValueGeneral; - '-ms-scroll-snap-type'?: CSSValueGeneral; - '-ms-scroll-snap-x'?: CSSValueGeneral; - '-ms-scroll-snap-y'?: CSSValueGeneral; - '-ms-scroll-translation'?: CSSValueGeneral; - '-ms-scrollbar-3dlight-color'?: CSSValueGeneral; - '-ms-scrollbar-arrow-color'?: CSSValueGeneral; - '-ms-scrollbar-base-color'?: CSSValueGeneral; - '-ms-scrollbar-darkshadow-color'?: CSSValueGeneral; - '-ms-scrollbar-face-color'?: CSSValueGeneral; - '-ms-scrollbar-highlight-color'?: CSSValueGeneral; - '-ms-scrollbar-shadow-color'?: CSSValueGeneral; - '-ms-scrollbar-track-color'?: CSSValueGeneral; - '-ms-text-align-last'?: CSSValueGeneral; - '-ms-text-autospace'?: CSSValueGeneral; - '-ms-text-combine-horizontal'?: CSSValueGeneral; - '-ms-text-justify'?: CSSValueGeneral; - '-ms-text-kashida-space'?: CSSValueGeneral; - '-ms-text-overflow'?: CSSValueGeneral; - '-ms-text-size-adjust'?: CSSValueGeneral; - '-ms-text-underline-position'?: CSSValueGeneral; - '-ms-touch-action'?: CSSValueGeneral; - '-ms-touch-select'?: CSSValueGeneral; - '-ms-transform'?: CSSValueGeneral; - '-ms-transform-origin'?: CSSValueGeneral; - '-ms-transform-origin-x'?: CSSValueGeneral; - '-ms-transform-origin-y'?: CSSValueGeneral; - '-ms-transform-origin-z'?: CSSValueGeneral; - '-ms-transform-style'?: CSSValueGeneral; - '-ms-transition'?: CSSValueGeneral; - '-ms-transition-delay'?: CSSValueGeneral; - '-ms-transition-duration'?: CSSValueGeneral; - '-ms-transition-property'?: CSSValueGeneral; - '-ms-transition-timing-function'?: CSSValueGeneral; - '-ms-word-break'?: CSSValueGeneral; - '-ms-word-wrap'?: CSSValueGeneral; - '-ms-wrap-flow'?: CSSValueGeneral; - '-ms-wrap-margin'?: CSSValueGeneral; - '-ms-wrap-through'?: CSSValueGeneral; - '-ms-writing-mode'?: CSSValueGeneral; - '-ms-zoom'?: CSSValueGeneral; - '-webkit-align-content'?: CSSValueGeneral; - '-webkit-alt'?: CSSValueGeneral; - '-webkit-animation'?: CSSValueGeneral; - '-webkit-animation-delay'?: CSSValueGeneral; - '-webkit-animation-direction'?: CSSValueGeneral; - '-webkit-animation-duration'?: CSSValueGeneral; - '-webkit-animation-fill-mode'?: CSSValueGeneral; - '-webkit-animation-iteration-count'?: CSSValueGeneral; - '-webkit-animation-name'?: CSSValueGeneral; - '-webkit-animation-play-state'?: CSSValueGeneral; - '-webkit-animation-timing-function'?: CSSValueGeneral; - '-webkit-animation-trigger'?: CSSValueGeneral; - '-webkit-app-region'?: CSSValueGeneral; - '-webkit-appearance'?: CSSValueGeneral; - '-webkit-aspect-ratio'?: CSSValueGeneral; - '-webkit-backdrop-filter'?: CSSValueGeneral; - '-webkit-backface-visibility'?: CSSValueGeneral; - '-webkit-background-clip'?: CSSValueGeneral; - '-webkit-background-composite'?: CSSValueGeneral; - '-webkit-background-origin'?: CSSValueGeneral; - '-webkit-background-size'?: CSSValueGeneral; - '-webkit-border-after'?: CSSValueGeneral; - '-webkit-border-after-color'?: CSSValueGeneral; - '-webkit-border-after-style'?: CSSValueGeneral; - '-webkit-border-after-width'?: CSSValueGeneral; - '-webkit-border-before'?: CSSValueGeneral; - '-webkit-border-before-color'?: CSSValueGeneral; - '-webkit-border-before-style'?: CSSValueGeneral; - '-webkit-border-before-width'?: CSSValueGeneral; - '-webkit-border-bottom-left-radius'?: CSSValueGeneral; - '-webkit-border-bottom-right-radius'?: CSSValueGeneral; - '-webkit-border-end'?: CSSValueGeneral; - '-webkit-border-end-color'?: CSSValueGeneral; - '-webkit-border-end-style'?: CSSValueGeneral; - '-webkit-border-end-width'?: CSSValueGeneral; - '-webkit-border-fit'?: CSSValueGeneral; - '-webkit-border-horizontal-spacing'?: CSSValueGeneral; - '-webkit-border-image'?: CSSValueGeneral; - '-webkit-border-radius'?: CSSValueGeneral; - '-webkit-border-start'?: CSSValueGeneral; - '-webkit-border-start-color'?: CSSValueGeneral; - '-webkit-border-start-style'?: CSSValueGeneral; - '-webkit-border-start-width'?: CSSValueGeneral; - '-webkit-border-top-left-radius'?: CSSValueGeneral; - '-webkit-border-top-right-radius'?: CSSValueGeneral; - '-webkit-border-vertical-spacing'?: CSSValueGeneral; - '-webkit-box-align'?: CSSValueGeneral; - '-webkit-box-decoration-break'?: CSSValueGeneral; - '-webkit-box-direction'?: CSSValueGeneral; - '-webkit-box-flex'?: CSSValueGeneral; - '-webkit-box-flex-group'?: CSSValueGeneral; - '-webkit-box-lines'?: CSSValueGeneral; - '-webkit-box-ordinal-group'?: CSSValueGeneral; - '-webkit-box-orient'?: CSSValueGeneral; - '-webkit-box-pack'?: CSSValueGeneral; - '-webkit-box-reflect'?: CSSValueGeneral; - '-webkit-box-shadow'?: CSSValueGeneral; - '-webkit-clip-path'?: CSSValueGeneral; - '-webkit-color-correction'?: CSSValueGeneral; - '-webkit-column-axis'?: CSSValueGeneral; - '-webkit-column-break-after'?: CSSValueGeneral; - '-webkit-column-break-before'?: CSSValueGeneral; - '-webkit-column-break-inside'?: CSSValueGeneral; - '-webkit-column-count'?: CSSValueGeneral; - '-webkit-column-fill'?: CSSValueGeneral; - '-webkit-column-gap'?: CSSValueGeneral; - '-webkit-column-progression'?: CSSValueGeneral; - '-webkit-column-rule'?: CSSValueGeneral; - '-webkit-column-rule-color'?: CSSValueGeneral; - '-webkit-column-rule-style'?: CSSValueGeneral; - '-webkit-column-rule-width'?: CSSValueGeneral; - '-webkit-column-span'?: CSSValueGeneral; - '-webkit-column-width'?: CSSValueGeneral; - '-webkit-columns'?: CSSValueGeneral; - '-webkit-cursor-visibility'?: CSSValueGeneral; - '-webkit-dashboard-region'?: CSSValueGeneral; - '-webkit-filter'?: CSSValueGeneral; - '-webkit-flex-basis'?: CSSValueGeneral; - '-webkit-flex-flow'?: CSSValueGeneral; - '-webkit-flow-from'?: CSSValueGeneral; - '-webkit-flow-into'?: CSSValueGeneral; - '-webkit-font-feature-settings'?: CSSValueGeneral; - '-webkit-font-kerning'?: CSSValueGeneral; - '-webkit-font-size-delta'?: CSSValueGeneral; - '-webkit-font-smoothing'?: CSSValueGeneral; - '-webkit-font-variant-ligatures'?: CSSValueGeneral; - '-webkit-grid'?: CSSValueGeneral; - '-webkit-grid-area'?: CSSValueGeneral; - '-webkit-grid-auto-columns'?: CSSValueGeneral; - '-webkit-grid-auto-flow'?: CSSValueGeneral; - '-webkit-grid-auto-rows'?: CSSValueGeneral; - '-webkit-grid-column'?: CSSValueGeneral; - '-webkit-grid-column-end'?: CSSValueGeneral; - '-webkit-grid-column-gap'?: CSSValueGeneral; - '-webkit-grid-column-start'?: CSSValueGeneral; - '-webkit-grid-gap'?: CSSValueGeneral; - '-webkit-grid-row'?: CSSValueGeneral; - '-webkit-grid-row-end'?: CSSValueGeneral; - '-webkit-grid-row-gap'?: CSSValueGeneral; - '-webkit-grid-row-start'?: CSSValueGeneral; - '-webkit-grid-template'?: CSSValueGeneral; - '-webkit-grid-template-areas'?: CSSValueGeneral; - '-webkit-grid-template-columns'?: CSSValueGeneral; - '-webkit-grid-template-rows'?: CSSValueGeneral; - '-webkit-highlight'?: CSSValueGeneral; - '-webkit-hyphenate-character'?: CSSValueGeneral; - '-webkit-hyphenate-limit-after'?: CSSValueGeneral; - '-webkit-hyphenate-limit-before'?: CSSValueGeneral; - '-webkit-hyphenate-limit-lines'?: CSSValueGeneral; - '-webkit-hyphens'?: CSSValueGeneral; - '-webkit-initial-letter'?: CSSValueGeneral; - '-webkit-justify-items'?: CSSValueGeneral; - '-webkit-justify-self'?: CSSValueGeneral; - '-webkit-line-align'?: CSSValueGeneral; - '-webkit-line-box-contain'?: CSSValueGeneral; - '-webkit-line-break'?: CSSValueGeneral; - '-webkit-line-clamp'?: CSSValueGeneral; - '-webkit-line-grid'?: CSSValueGeneral; - '-webkit-line-snap'?: CSSValueGeneral; - '-webkit-locale'?: CSSValueGeneral; - '-webkit-logical-height'?: CSSValueGeneral; - '-webkit-logical-width'?: CSSValueGeneral; - '-webkit-margin-after'?: CSSValueGeneral; - '-webkit-margin-after-collapse'?: CSSValueGeneral; - '-webkit-margin-before'?: CSSValueGeneral; - '-webkit-margin-before-collapse'?: CSSValueGeneral; - '-webkit-margin-bottom-collapse'?: CSSValueGeneral; - '-webkit-margin-collapse'?: CSSValueGeneral; - '-webkit-margin-end'?: CSSValueGeneral; - '-webkit-margin-start'?: CSSValueGeneral; - '-webkit-margin-top-collapse'?: CSSValueGeneral; - '-webkit-marquee'?: CSSValueGeneral; - '-webkit-marquee-direction'?: CSSValueGeneral; - '-webkit-marquee-increment'?: CSSValueGeneral; - '-webkit-marquee-repetition'?: CSSValueGeneral; - '-webkit-marquee-speed'?: CSSValueGeneral; - '-webkit-marquee-style'?: CSSValueGeneral; - '-webkit-mask'?: CSSValueGeneral; - '-webkit-mask-box-image'?: CSSValueGeneral; - '-webkit-mask-box-image-outset'?: CSSValueGeneral; - '-webkit-mask-box-image-repeat'?: CSSValueGeneral; - '-webkit-mask-box-image-slice'?: CSSValueGeneral; - '-webkit-mask-box-image-source'?: CSSValueGeneral; - '-webkit-mask-box-image-width'?: CSSValueGeneral; - '-webkit-mask-clip'?: CSSValueGeneral; - '-webkit-mask-composite'?: CSSValueGeneral; - '-webkit-mask-image'?: CSSValueGeneral; - '-webkit-mask-origin'?: CSSValueGeneral; - '-webkit-mask-position'?: CSSValueGeneral; - '-webkit-mask-position-x'?: CSSValueGeneral; - '-webkit-mask-position-y'?: CSSValueGeneral; - '-webkit-mask-repeat'?: CSSValueGeneral; - '-webkit-mask-repeat-x'?: CSSValueGeneral; - '-webkit-mask-repeat-y'?: CSSValueGeneral; - '-webkit-mask-size'?: CSSValueGeneral; - '-webkit-mask-source-type'?: CSSValueGeneral; - '-webkit-max-logical-height'?: CSSValueGeneral; - '-webkit-max-logical-width'?: CSSValueGeneral; - '-webkit-min-logical-height'?: CSSValueGeneral; - '-webkit-min-logical-width'?: CSSValueGeneral; - '-webkit-nbsp-mode'?: CSSValueGeneral; - '-webkit-opacity'?: CSSValueGeneral; - '-webkit-order'?: CSSValueGeneral; - '-webkit-padding-after'?: CSSValueGeneral; - '-webkit-padding-before'?: CSSValueGeneral; - '-webkit-padding-end'?: CSSValueGeneral; - '-webkit-padding-start'?: CSSValueGeneral; - '-webkit-perspective'?: CSSValueGeneral; - '-webkit-perspective-origin'?: CSSValueGeneral; - '-webkit-perspective-origin-x'?: CSSValueGeneral; - '-webkit-perspective-origin-y'?: CSSValueGeneral; - '-webkit-print-color-adjust'?: CSSValueGeneral; - '-webkit-region-break-after'?: CSSValueGeneral; - '-webkit-region-break-before'?: CSSValueGeneral; - '-webkit-region-break-inside'?: CSSValueGeneral; - '-webkit-region-fragment'?: CSSValueGeneral; - '-webkit-rtl-ordering'?: CSSValueGeneral; - '-webkit-ruby-position'?: CSSValueGeneral; - '-webkit-scroll-snap-coordinate'?: CSSValueGeneral; - '-webkit-scroll-snap-destination'?: CSSValueGeneral; - '-webkit-scroll-snap-points-x'?: CSSValueGeneral; - '-webkit-scroll-snap-points-y'?: CSSValueGeneral; - '-webkit-scroll-snap-type'?: CSSValueGeneral; - '-webkit-shape-image-threshold'?: CSSValueGeneral; - '-webkit-shape-margin'?: CSSValueGeneral; - '-webkit-shape-outside'?: CSSValueGeneral; - '-webkit-svg-shadow'?: CSSValueGeneral; - '-webkit-tap-highlight-color'?: CSSValueGeneral; - '-webkit-text-align-last'?: CSSValueGeneral; - '-webkit-text-combine'?: CSSValueGeneral; - '-webkit-text-decoration'?: CSSValueGeneral; - '-webkit-text-decoration-color'?: CSSValueGeneral; - '-webkit-text-decoration-line'?: CSSValueGeneral; - '-webkit-text-decoration-skip'?: CSSValueGeneral; - '-webkit-text-decoration-style'?: CSSValueGeneral; - '-webkit-text-decorations-in-effect'?: CSSValueGeneral; - '-webkit-text-emphasis'?: CSSValueGeneral; - '-webkit-text-emphasis-color'?: CSSValueGeneral; - '-webkit-text-emphasis-position'?: CSSValueGeneral; - '-webkit-text-emphasis-style'?: CSSValueGeneral; - '-webkit-text-fill-color'?: CSSValueGeneral; - '-webkit-text-justify'?: CSSValueGeneral; - '-webkit-text-orientation'?: CSSValueGeneral; - '-webkit-text-security'?: CSSValueGeneral; - '-webkit-text-size-adjust'?: CSSValueGeneral; - '-webkit-text-stroke'?: CSSValueGeneral; - '-webkit-text-stroke-color'?: CSSValueGeneral; - '-webkit-text-stroke-width'?: CSSValueGeneral; - '-webkit-text-underline-position'?: CSSValueGeneral; - '-webkit-text-zoom'?: CSSValueGeneral; - '-webkit-touch-callout'?: CSSValueGeneral; - '-webkit-transform'?: CSSValueGeneral; - '-webkit-transform-origin'?: CSSValueGeneral; - '-webkit-transform-origin-x'?: CSSValueGeneral; - '-webkit-transform-origin-y'?: CSSValueGeneral; - '-webkit-transform-origin-z'?: CSSValueGeneral; - '-webkit-transform-style'?: CSSValueGeneral; - '-webkit-transition'?: CSSValueGeneral; - '-webkit-transition-delay'?: CSSValueGeneral; - '-webkit-transition-duration'?: CSSValueGeneral; - '-webkit-transition-property'?: CSSValueGeneral; - '-webkit-transition-timing-function'?: CSSValueGeneral; - '-webkit-user-drag'?: CSSValueGeneral; - '-webkit-user-modify'?: CSSValueGeneral; - '-webkit-writing-mode'?: CSSValueGeneral; +export type CSSProperties = { + [K in keyof csstype.Properties]: CSSValue } - -export type PseudoCssKey = - | ':active' - | ':any' - | ':checked' - | ':default' - | ':disabled' - | ':empty' - | ':enabled' - | ':first' - | ':first-child' - | ':first-of-type' - | ':fullscreen' - | ':focus' - | ':hover' - | ':indeterminate' - | ':in-range' - | ':invalid' - | ':last-child' - | ':last-of-type' - | ':left' - | ':link' - | ':only-child' - | ':only-of-type' - | ':optional' - | ':out-of-range' - | ':read-only' - | ':read-write' - | ':required' - | ':right' - | ':root' - | ':scope' - | ':target' - | ':valid' - | ':visited' - // TODO - // | ':dir()' - // | ':lang()' - // | ':not()' - // | ':nth-child()' - // | ':nth-last-child()' - // | ':nth-last-of-type()' - // | ':nth-of-type()' - | '::after' - | '::before' - | '::cue' - | '::first-letter' - | '::first-line' - | '::selection' - | '::backdrop ' - | '::placeholder ' - | '::marker ' - | '::spelling-error ' - | '::grammar-error '; - -export type PseudoCss = Partial>; - export interface JssProps { - '@global'?: CSSProperties & PseudoCss; + '@global'?: CSSProperties; extend?: string; composes?: string | string[]; } @@ -2876,5 +161,5 @@ export interface JssExpand { export type JssExpandArr = { [k in keyof JssExpand]?: JssExpand[k] | Array }; -export type SimpleStyle = CSSProperties & PseudoCss & JssProps & JssExpandArr; +export type SimpleStyle = CSSProperties & JssProps & JssExpandArr; export type Style = Observable | SimpleStyle; diff --git a/types/jss/package.json b/types/jss/package.json new file mode 100644 index 0000000000..448ec0ab3f --- /dev/null +++ b/types/jss/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "csstype": "^1.5.0" + } +} From 53952c7f36ad40bc38bd4ef35bc58b70e0c89820 Mon Sep 17 00:00:00 2001 From: Tom Crockett Date: Mon, 12 Feb 2018 09:24:31 -0800 Subject: [PATCH 0029/2153] Upgrade csstype, remove hacks --- types/jss/css.d.ts | 41 +---------------------------------------- types/jss/jss-tests.ts | 2 +- 2 files changed, 2 insertions(+), 41 deletions(-) diff --git a/types/jss/css.d.ts b/types/jss/css.d.ts index fb886a6a61..125571309d 100644 --- a/types/jss/css.d.ts +++ b/types/jss/css.d.ts @@ -3,47 +3,8 @@ import { Observable } from './observable' import * as csstype from 'csstype' -/** - * Value of a CSS Property. Could be a single value or a list of fallbacks - * NOTE: array is for fallbacks - */ -export type CSSValue = T | Observable; - -/** - * Remove the variants of the second union of string literals from - * the first. - */ -export type Diff = ( - & { [P in T]: P } - & { [P in U]: never } - & { [x: string]: never } -)[T]; - -/** - * Drop keys `K` from `T`. - */ -export type Omit = Pick>; - -export interface SimpleProperties extends Omit< - csstype.Properties, - 'display' | 'width' | 'height' -> { - // https://github.com/frenic/csstype/issues/7 - width: number | string; - height: number | string; - // https://github.com/frenic/csstype/issues/8 - display: - | csstype.All - | csstype.DisplayOutside - | csstype.DisplayInside - | csstype.DisplayInternal - | csstype.DisplayBox - | csstype.DisplayLegacy - ; -} - export type CSSProperties = { - [K in keyof csstype.Properties]: CSSValue + [K in keyof csstype.Properties]: csstype.Properties[K] | Observable } export interface JssProps { diff --git a/types/jss/jss-tests.ts b/types/jss/jss-tests.ts index 06e4ab2eb6..28db02b91b 100644 --- a/types/jss/jss-tests.ts +++ b/types/jss/jss-tests.ts @@ -65,7 +65,7 @@ styleSheet.addRule('badProperty', { }); styleSheet.addRule('badValue', { // $ExpectError - display: 'thisIsNotAValidDisplayValue', + alignItems: 'thisIsNotAValidValue', }); styleSheet.detach(); From 310a20441b46d9405113cf2e6499f9fe86b64478 Mon Sep 17 00:00:00 2001 From: Tom Crockett Date: Mon, 12 Feb 2018 09:41:26 -0800 Subject: [PATCH 0030/2153] Allow kebab case anywhere, and allow only kebab case in observables --- types/jss/css.d.ts | 10 +++++++--- types/jss/jss-tests.ts | 7 ++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/types/jss/css.d.ts b/types/jss/css.d.ts index 125571309d..06a9c620cf 100644 --- a/types/jss/css.d.ts +++ b/types/jss/css.d.ts @@ -3,10 +3,14 @@ import { Observable } from './observable' import * as csstype from 'csstype' -export type CSSProperties = { - [K in keyof csstype.Properties]: csstype.Properties[K] | Observable +export type ObservableProperties

    = { + [K in keyof P]: P[K] | Observable } +export type CSSProperties = + & ObservableProperties + & ObservableProperties; + export interface JssProps { '@global'?: CSSProperties; extend?: string; @@ -123,4 +127,4 @@ export interface JssExpand { export type JssExpandArr = { [k in keyof JssExpand]?: JssExpand[k] | Array }; export type SimpleStyle = CSSProperties & JssProps & JssExpandArr; -export type Style = Observable | SimpleStyle; +export type Style = SimpleStyle | Observable; diff --git a/types/jss/jss-tests.ts b/types/jss/jss-tests.ts index 28db02b91b..8e53780988 100644 --- a/types/jss/jss-tests.ts +++ b/types/jss/jss-tests.ts @@ -14,6 +14,10 @@ const styleSheet = jss.createStyleSheet( const next = typeof observer === 'function' ? observer : observer.next; next({ background: 'blue', display: 'flex' }); next({ invalidKey: 'blueish' }); // $ExpectError + + // only kebab case allowed in observables + next({ 'align-items': 'center' }); + next({ alignItems: 'center' }); // $ExpectError return { unsubscribe() {} }; @@ -21,6 +25,7 @@ const styleSheet = jss.createStyleSheet( }, container: { display: 'flex', + 'align-items': 'center', width: 100, opacity: .5, }, @@ -65,7 +70,7 @@ styleSheet.addRule('badProperty', { }); styleSheet.addRule('badValue', { // $ExpectError - alignItems: 'thisIsNotAValidValue', + 'align-items': 'thisIsNotAValidValue', }); styleSheet.detach(); From 3d625ea5b689b29092fc9cb35ac52132b2a1a8b3 Mon Sep 17 00:00:00 2001 From: Tom Crockett Date: Mon, 12 Feb 2018 09:44:36 -0800 Subject: [PATCH 0031/2153] Require at least csstype 1.6 --- types/jss/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/jss/package.json b/types/jss/package.json index 448ec0ab3f..201f7e2d14 100644 --- a/types/jss/package.json +++ b/types/jss/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "csstype": "^1.5.0" + "csstype": "^1.6.0" } } From 858289bfccaed5dedb9d6025805eb8e398b82e4a Mon Sep 17 00:00:00 2001 From: Fredrik Nicol Date: Mon, 5 Mar 2018 08:40:11 +0100 Subject: [PATCH 0032/2153] Add generic argument to csstype interfaces --- types/jss/css.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/jss/css.d.ts b/types/jss/css.d.ts index 06a9c620cf..3f01be6a62 100644 --- a/types/jss/css.d.ts +++ b/types/jss/css.d.ts @@ -8,8 +8,8 @@ export type ObservableProperties

    = { } export type CSSProperties = - & ObservableProperties - & ObservableProperties; + & ObservableProperties> + & ObservableProperties>; export interface JssProps { '@global'?: CSSProperties; @@ -127,4 +127,4 @@ export interface JssExpand { export type JssExpandArr = { [k in keyof JssExpand]?: JssExpand[k] | Array }; export type SimpleStyle = CSSProperties & JssProps & JssExpandArr; -export type Style = SimpleStyle | Observable; +export type Style = SimpleStyle | Observable>; From 7277381533f80f40bf11a191187ef4348063351c Mon Sep 17 00:00:00 2001 From: Ricardo De Pena Date: Wed, 7 Mar 2018 23:23:25 -0500 Subject: [PATCH 0033/2153] OpenFin Application namespace in line with .30 release. --- types/openfin/v30/index.d.ts | 1756 ++++++++++++++++++++++++++++ types/openfin/v30/openfin-tests.ts | 728 ++++++++++++ types/openfin/v30/tsconfig.json | 24 + types/openfin/v30/tslint.json | 6 + types/openfin/v30/v30 | 1736 +++++++++++++++++++++++++++ 5 files changed, 4250 insertions(+) create mode 100644 types/openfin/v30/index.d.ts create mode 100644 types/openfin/v30/openfin-tests.ts create mode 100644 types/openfin/v30/tsconfig.json create mode 100644 types/openfin/v30/tslint.json create mode 100644 types/openfin/v30/v30 diff --git a/types/openfin/v30/index.d.ts b/types/openfin/v30/index.d.ts new file mode 100644 index 0000000000..1e69b3b713 --- /dev/null +++ b/types/openfin/v30/index.d.ts @@ -0,0 +1,1756 @@ +// Type definitions for OpenFin API 17.0 +// Project: https://openfin.co/ +// Definitions by: Chris Barker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// based on v6.49.17.14 +// see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean + +/** + * JavaScript API + * The JavaScript API allows you to create an HTML/JavaScript application that has access to the native windowing environment, + * can communicate with other applications and has access to sandboxed system-level features. + * + * API Ready + * When using the OpenFin API, it is important to ensure that it has been fully loaded before making any API calls. To verify + * that the API is in fact ready, be sure to make any API calls either from within the fin.desktop.main() method or explicitly + * after it has returned. This avoids the situation of trying to access methods that are not yet fully injected. + * + * Overview + * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API + * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "document" objects. + */ +declare namespace fin { + const desktop: OpenFinDesktop; + + interface OpenFinDesktop { + main(f: () => any): void; + Application: OpenFinApplicationStatic; + ExternalApp: OpenFinExternalApplicationStatic; + InterApplicationBus: OpenFinInterApplicationBus; + Notification: OpenFinNotificationStatic; + System: OpenFinSystem; + Window: OpenFinWindowStatic; + } + + interface OpenFinApplicationStatic { + /** + * Creates a new Application. + * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. + */ + new ( + options: ApplicationOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; + /** + * Launches the given Application manifest. + */ + createFromManifest(manifestUrl: string, callback?: (app: OpenFinApplication) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Returns an Application object that represents an existing application. + */ + getCurrent(): OpenFinApplication; + /** + * Returns an Application object that represents an existing application. + */ + wrap(uuid: string): OpenFinApplication; + } + + /** + * Application + * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. + */ + interface OpenFinApplication { + /** + * Returns an instance of the main Window of the application + */ + getWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinApplicationEventType, + listener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Closes the application and any child windows created by the application. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. + */ + getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. + */ + getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. + */ + getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. + */ + getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves current configuration of application's shortcuts. + */ + getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves information about the application. + */ + getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves information about the system tray. + */ + getTrayIconInfo(callback?: (trayInfo: TrayIconInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the application is currently running. + */ + isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Registers a username and an app name for licensing purposes. + */ + registerUser(userName: string, appName: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinApplicationEventType, + previouslyRegisteredListener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => any, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the application's icon from the tray. + */ + removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restarts the application. + */ + restart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Runs the application. When the application is created, run must be called. + */ + run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Tells the rvm to relaunch the main application once upon a complete shutdown + */ + scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets new shortcut configuration for current application. + * Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to + * be able to change shortcut states. + */ + setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Adds a customizable icon in the system tray and notifies the application when clicked. + */ + setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the application by terminating its process. + */ + terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application + * to continue and to generate another "not-responding" message after a certain period of time. + */ + wait(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * The Application's uuid + */ + uuid: string; + } + + interface ShortCutConfig { + /** + * application has a shortcut on the desktop + */ + desktop?: boolean; + /** + * application has no shortcut in the start menu + */ + startMenu?: boolean; + /** + * application will be launched on system startup + */ + systemStartup?: boolean; + } + + interface SuccessObj { + httpResponseCode: number; + } + + interface NetworkErrorInfo extends ErrorInfo { + networkErrorCode: number; + } + + interface ErrorInfo { + stack: string; + message: string; + } + + interface ApplicationOptions { + /** + * The name of the application. + */ + name?: string; + /** + * The url to the application. + */ + url?: string; + /** + * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. + */ + uuid?: string; + /** + * Enable Flash at the application level. Default: false. + */ + plugins?: boolean; + /** + * The options of the main window of the application. + */ + mainWindowOptions?: WindowOptions; + } + + interface WindowOptions { + /** + * Enable keyboard shortcuts for devtools and zoom. Default: false for both. + */ + accelerator?: { + devtools?: boolean, + zoom?: boolean, + reload?: boolean, + reloadIgnoreCache?: boolean, + }; + /** + * A flag to always position the window at the top of the window stack. Default: false. + * Updatable + */ + alwaysOnTop?: boolean; + /** + * A flag to automatically show the Window when it is created. Default: false. + */ + autoShow?: boolean; + /** + * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true + * Updatable + */ + contextMenu?: boolean; + /** + * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. + * Updatable + */ + cornerRounding?: { + width?: number; + height?: number; + }; + /** + * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. + */ + customData?: any; + /** + * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the position from before the window was closed is used. + * This option overrides defaultLeft and defaultTop. Default: false. + */ + defaultCentered?: boolean; + /** + * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. + */ + defaultHeight?: number; + /** + * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. + */ + defaultWidth?: number; + /** + * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. + */ + defaultTop?: number; + /** + * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. + */ + defaultLeft?: number; + /** + * A flag to show the frame. Default: true. + * Updatable + */ + frame?: boolean; + /** + * A flag to allow a window to be hidden when the close button is clicked.Default: false. + * Updatable + */ + hideOnClose?: boolean; + /** + * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. + * Updatable + */ + icon?: string; + /** + * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxHeight?: number; + /** + * A flag that lets the window be maximized.Default: true. + * Updatable + */ + maximizable?: boolean; + /** + * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxWidth?: number; + /** + * The minimum height of a window.Default: 0. + * Updatable + */ + minHeight?: number; + /** + * A flag that lets the window be minimized.Default: true. + */ + minimizable?: boolean; + /** + * The minimum width of a window.Default: 0. + */ + minWidth?: number; + /** + * The name for the window which must be unique within the context of the invoking Application. + */ + name?: string; + /** + * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. + * Updatable + */ + opacity?: number; + /** + * A flag to drop to allow the user to resize the window.Default: true. + * Updatable + */ + resizable?: boolean; + /** + * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. + * Updatable + */ + resizeRegion?: { + /** + * The size in pixels (Default: 2), + */ + size?: number; + /** + * The size in pixels of an additional + * square resizable region located at the + * bottom right corner of a + * frameless window. (Default: 4) + */ + bottomRightCorner?: number; + }; + /** + * A flag to show the Window's icon in the taskbar. Default: true. + */ + showTaskbarIcon?: boolean; + /** + * A flag to cache the location of the window or not. Default: true. + */ + saveWindowState?: boolean; + /** + * Specify a taskbar group for the window. Default: app's uuid. + */ + taskbarIconGroup?: string; + /** + * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". + */ + state?: string; + /** + * The URL of the window. Default: "about:blank". + */ + url?: string; + /** + * When set to false, the window will render before the "load" event is fired on the content's window. + * Caution, when false you will see an initial empty white window. Default: true. + */ + waitForPageLoad?: boolean; + } + + /** + * Clipboard + * Clipboard API allows reading and writting to the clipboard in multiple formats. + */ + interface OpenFinClipboard { + /** + * Reads available formats for the clipboard type + */ + availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Reads available formats for the clipboard type + */ + readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as Rtf + */ + readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as plain text + */ + readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard + */ + write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Html + */ + writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Rtf + */ + writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as plain text + */ + writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + interface OpenFinExternalApplicationStatic { + /** + * Returns an External Application object that represents an existing external application. + */ + wrap(uuid: string): OpenFinExternalApplication; + } + /** + * ExternalApplication + * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. + */ + interface OpenFinExternalApplication { + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + /** + * InterApplicationBus + * A messaging bus that allows for pub/sub messaging between different applications. + */ + interface OpenFinInterApplicationBus { + /** + * Adds a listener that gets called when applications subscribe to the current application's messages. + */ + addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Adds a listener that gets called when applications unsubscribe to the current application's messages. + */ + addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered subscribe listener. + */ + removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered unsubscribe listener. + */ + removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. + */ + publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sends a message to a specific application on a specific topic. + */ + send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], + * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. + */ + subscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + subscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Unsubscribes to messages from the specified application on the specified topic. + */ + unsubscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + unsubscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + } + + interface OpenFinNotificationStatic { + /** + * ctor + */ + new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; + /** + * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. + */ + getCurrent(): OpenFinNotification; + } + + /** + * Notification + * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. + * A notification is typically used to alert the user of some important event which requires his or her attention. + * Notifications are a child or your application that are controlled by the runtime. + */ + interface OpenFinNotification { + /** + * Closes the notification. + */ + close(callback?: () => void): void; + /** + * Sends a message to the notification. + */ + sendMessage(message: any, callback?: () => void): void; + /** + * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. + */ + sendMessageToApplication(message: any, callback?: () => void): void; + } + + interface NotificationOptions { + /** + * A boolean that will force dismissal even if the mouse is hovering over the notification + */ + ignoreMouseOver?: boolean; + /** + * A message of any primitive or composite-primitive type to be passed to the notification upon creation. + */ + message?: any; + /** + * The timeout for displaying a notification.Can be in milliseconds or "never". + */ + duration?: number | "never"; + /** + * The url of the notification + */ + url?: string; + /** + * A function that is called when a notification is clicked. + */ + onClick?(callback: () => void): void; + /** + * Invoked when the notification is closed via .close() method on the created notification instance + * or the by the notification itself via fin.desktop.Notification.getCurrent().close(). + * NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss + */ + onClose?(callback: () => void): void; + /** + * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. + */ + onDismiss?(callback: () => void): void; + /** + * A function that is called when an error occurs.The reason for the error is passed as an argument. + */ + onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * The onMessage function will respond to messages sent from notification.sendMessageToApplication. + * The function is passed the message, which can be of any primitive or composite-primitive type. + */ + onMessage?(callback: (message: any) => void): void; + /** + * A function that is called when a notification is shown. + */ + onShow?(callback: (successObj: SuccessObj) => void): void; + } + + /** + * System + * An object representing the core of OpenFin Runtime. + * Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. + */ + interface OpenFinSystem { + Clipboard: OpenFinClipboard; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Clears cached data containing window state/positions, + * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. + */ + clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Clears all cached data when OpenFin Runtime exits. + */ + deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Downloads the given application asset + */ + downloadAsset( + assetObj: AppAssetInfo, + progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, + callback?: (successObj: { path: string }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Exits the Runtime. + */ + exit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all applications. + */ + getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all external applications. + */ + getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data (name, ids, bounds) for all application windows. + */ + getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the command line argument string that started OpenFin Runtime. + */ + getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the configuration object that started the OpenFin Runtime. + */ + getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the value of a given environment variable on the computer on which the runtime is installed. + */ + getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves system information. + */ + getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the contents of the log with the specified filename. + */ + getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing information for each log file. + */ + getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. + */ + getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the mouse in virtual screen coordinates (left, top). + */ + getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of all of the runtime processes that are currently running. + * Each element in the array is an object containing the uuid and the name of the application to which the process belongs. + */ + getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the Proxy settings. + */ + getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns information about the running RVM in an object. + */ + getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. + */ + getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Runs an executable or batch file. + */ + launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Writes the passed message into both the log file and the console. + */ + log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Monitors a running process. + */ + monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Opens the passed URL in the default web browser. + */ + openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * This function call will register a unique id and produce a token. The token can be used to broker an external connection. + */ + registerExternalConnection( + uuid: string, + callback?: (detail: { + /** + * this will be unique each time + */ + token: string; + /** + * "remote-connection-uuid" + */ + uuid: string; + }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). + */ + releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the Chrome Developer Tools for the specified window. + */ + showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. + */ + terminateExternalProcess( + processUuid: string, + timeout: number, + killTree: boolean, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + terminateExternalProcess( + processUuid: string, + timeout: number, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Update the OpenFin Runtime Proxy settings. + */ + updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface CacheOptions { + cache?: boolean; + cookies?: boolean; + localStorage?: boolean; + appcache?: boolean; + userData?: boolean; + } + + interface AppAssetInfo { + src?: string; + alias?: string; + version?: string; + target?: string; + args?: string; + } + + interface ApplicationInfo { + /** + * true when the application is running. + */ + isRunning?: boolean; + /** + * uuid of the application. + */ + uuid?: string; + /** + * uuid of the application that launches this application. + */ + parentUuid?: string; + } + + interface WindowDetails { + uuid?: string; + mainWindow?: WindowInfo; + childWindows?: WindowInfo[]; + } + + interface WindowInfo { + /** + * name of the child window + */ + name?: string; + /** + * top-most coordinate of the child window + */ + top?: number; + /** + * right-most coordinate of the child window + */ + right?: number; + /** + * bottom-most coordinate of the child window + */ + bottom?: number; + /** + * left-most coordinate of the child window + */ + left?: number; + } + + interface HostSpecInfo { + /** + * "x86" for 32-bit or "x86_64" for 64-bit + */ + arch: string; + /** + * Same payload as Node's os.cpus() + */ + cpus: NodeCpuInfo[]; + gpu: { + /** + * Graphics card name + */ + name: string; + }; + /** + * Same payload as Node's os.totalmem() + */ + memory: number; + /** + * OS name and version/edition + */ + name: string; + } + + interface NodeCpuInfo { + model: string; + /** + * in MHz + */ + speed: number; + times: { + /** + * The number of milliseconds the CPU has spent in user mode. + */ + user: number; + /** + * The number of milliseconds the CPU has spent in nice mode. + */ + nice: number; + /** + * The number of milliseconds the CPU has spent in sys mode. + */ + sys: number; + /** + * The number of milliseconds the CPU has spent in idle mode. + */ + idle: number; + /** + * The number of milliseconds the CPU has spent in irq mode. + */ + irq: number; + }; + } + + interface LogInfo { + /** + * the filename of the log + */ + name?: string; + /** + * the size of the log in bytes + */ + size?: number; + /** + * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" + */ + date?: string; + } + + interface ProcessInfo { + /** + * the percentage of total CPU usage + */ + cpuUsage?: number; + /** + * the application name + */ + name?: string; + /** + * the current nonpaged pool usage in bytes + */ + nonPagedPoolUsage?: number; + /** + * the number of page faults + */ + pageFaultCount?: number; + /** + * the current paged pool usage in bytes + */ + pagedPoolUsage?: number; + /** + * the total amount of memory in bytes that the memory manager has committed + */ + pagefileUsage?: number; + /** + * the peak nonpaged pool usage in bytes + */ + peakNonPagedPoolUsage?: number; + /** + * the peak paged pool usage in bytes + */ + peakPagedPoolUsage?: number; + /** + * the peak value in bytes of pagefileUsage during the lifetime of this process + */ + peakPagefileUsage?: number; + /** + * the peak working set size in bytes + */ + peakWorkingSetSize?: number; + /** + * the native process identifier + */ + processId?: number; + /** + * the application UUID + */ + uuid?: string; + /** + * the current working set size (both shared and private data) in bytes + */ + workingSetSize?: number; + } + + interface ProxyInfo { + /** + * the configured Proxy Address + */ + proxyAddress?: string; + /** + * the configured Proxy port + */ + proxyPort?: number; + /** + * Proxy Type + */ + type?: string; + } + + interface RvmInfo { + version?: string; + "start-time"?: string; + } + + interface ExternalProcessLaunchInfo { + path?: string; + /** + * Additionally note that the executable found in the zip file specified in appAssets + * will default to the one mentioned by appAssets.target + * If the the path below refers to a specific path it will override this default + */ + alias?: string; + /** + * When using alias; if no arguments are passed then the arguments (if any) + * are taken from the 'app.json' file, from the 'args' parameter + * of the 'appAssets' Object with the relevant 'alias'. + * If 'arguments' is passed as a parameter it takes precedence + * over any 'args' set in the 'app.json'. + */ + arguments?: string; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + certificate?: CertificationInfo; + } + + interface CertificationInfo { + /** + * A hex string with or without spaces + */ + serial?: string; + /** + * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields + */ + subject?: string; + /** + * A hex string with or without spaces + */ + publickey?: string; + /** + * A hex string with or without spaces + */ + thumbprint?: string; + /** + * A boolean indicating that the certificate is trusted and not revoked + */ + trusted?: boolean; + } + + interface ExternalProcessInfo { + pid?: number; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + } + + interface OpenFinWindowStatic { + /** + * Class: Window + * + * new Window(options, callbackopt, errorCallbackopt) + * + * Creates a new OpenFin Window + * + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + * @param options - The options of the window + * @param [callback] - Called if the window creation was successful + * @param [callback.successObj] - httpResponseCode + */ + new ( + options: WindowOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; + /** + * Returns an instance of the current window. + * @returns Current window + */ + getCurrent(): OpenFinWindow; + /** + * Returns a Window object that wraps an existing window. + */ + wrap(appUuid: string, windowName: string): OpenFinWindow; + } + + /** + * Window + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + */ + interface OpenFinWindow { + /** + * Name of window + */ + name: string; + /** + * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, + * otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the + * contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. + * Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). + * @returns Native window + */ + getNativeWindow(): Window; + /** + * Gets the parent application. + * @returns Parent application + */ + getParentApplication(): OpenFinApplication; + /** + * Gets the parent window. + */ + getParentWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Performs the specified window transitions + */ + animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Provides credentials to authentication requests + */ + authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes focus from the window. + */ + blur(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Brings the window to the front of the OpenFin window stack. + */ + bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the window. + * @param Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Prevents a user from changing a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-disabled' is generated when an enabled frame becomes disabled. + */ + disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Re-enables user changes to a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-enabled' is generated when a disabled frame has becomes enabled. + */ + enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Flashes the window's frame and taskbar icon until the window is activated. + */ + flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gives focus to the window. + */ + focus(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current bounds (top, left, width, height) of the window. + */ + getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. + * Please note that calling window is included in the result array. + */ + getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current settings of the window. + */ + getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets a base64 encoded PNG snapshot of the window. + */ + getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current state ("minimized", "maximized", or "restored") of the window. + */ + getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the zoom level of the window. + */ + getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; + /** + * Hides the window. + */ + hide(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the window is currently showing. + */ + isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Joins the same window group as the specified window. + */ + joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Leaves the current window group so that the window can be move independently of those in the group. + */ + leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Maximizes the window. + */ + maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Merges the instance's window group with the same window group as the specified window + */ + mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Minimizes the window. + */ + minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window by a specified amount. + */ + moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window to a specified location. + */ + moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restores the window to its normal state (i.e., unminimized, unmaximized). + */ + restore(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Will bring the window to the front of the entire stack and give it focus. + */ + setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the window's size and position + */ + setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the zoom level of the window. + */ + setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden. + * @param Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. + */ + show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. + */ + showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Stops the taskbar icon from flashing. + */ + stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Updates the window using the passed options + */ + updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface ApplicationBaseEvent { + topic: string; + type: OpenFinApplicationEventType; + uuid: string; + } + + interface TrayIconClickedEvent extends ApplicationBaseEvent { + button: number; // 0 for left, 1 for middle, 2 for right + monitorInfo: MonitorInfo; + x: number; // the cursor x coordinate + y: number; // the cursor y coordinate + } + + interface WindowEvent extends ApplicationBaseEvent { + name: string; + } + + interface WindowAlertRequestedEvent extends WindowEvent { + message: string; + url: string; + } + + interface WindowAuthRequested extends WindowEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowNavigationRejectedEvent extends WindowEvent { + sourceName: string; + url: string; + } + + interface WindowEndLoadEvent extends WindowEvent { + documentName: string; + isMain: boolean; + } + + interface MonitorInfoChangedEvent extends MonitorInfo { + topic: "system"; + type: "monitor-info-changed"; + } + + interface MonitorInfo { + nonPrimaryMonitors: MonitorInfoDetail[]; + primaryMonitor: MonitorInfoDetail; + reason: string; + taskbar: { + edge: "left" | "right" | "top" | "bottom", + rect: MontiorCoordinates + }; + topic: "system"; + type: "monitor-info-changed"; + virtualScreen: MontiorCoordinates; + } + + interface TrayIconInfo { + x: number; + y: number; + bounds: { + x: number; + y: number; + width: number; + height: number; + } + monitorInfo: MonitorInfo + } + + interface MonitorInfoDetail { + availableRect: MontiorCoordinates; + deviceId: string; + displayDeviceActive: boolean; + monitorRect: MontiorCoordinates; + name: string; + } + + interface MontiorCoordinates { + bottom: number; + left: number; + right: number; + top: number; + } + + interface VirtualScreenCoordinates { + left: number; + top: number; + } + + interface SystemBaseEvent { + topic: string; + type: OpenFinSystemEventType; + uuid: string; + } + + interface DesktopIconClickedEvent { + mouse: { + /** + * the left virtual screen coordinate of the mouse + */ + left: number, + /** + * the top virtual screen coordinate of the mouse + */ + top: number + }; + /** + * the number of milliseconds that have elapsed since the system was started, + */ + tickCount: number; + topic: "system"; + type: "desktop-icon-clicked"; + } + + interface IdleStateChangedEvent { + /** + * How long in milliseconds since the user has been idle. + */ + elapsedTime: number; + /** + * true when the user is idle,false when the user has returned; + */ + isIdle: boolean; + topic: "system"; + type: "idle-state-changed"; + } + + interface WindowBaseEvent { + /** + * the name of the window + */ + name: string; + /** + * always window + */ + topic: "window"; + /** + * window event type + */ + type: OpenFinWindowEventType; + /** + * the UUID of the application the window belongs to + */ + uuid: string; + } + + interface WindowAuthRequestedEvent extends WindowBaseEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowBoundsEvent extends WindowBaseEvent { + /** + * describes what kind of change occurred. + * 0 means a change in position. + * 1 means a change in size. + * 2 means a change in position and size. + */ + changeType: number; + /** + * true when pending changes have been applied to the window. + */ + deferred: boolean; + /** + * the new height of the window. + */ + height: number; + /** + * the left-most coordinate of the window. + */ + left: number; + /** + * the top-most coordinate of the window. + */ + top: number; + + type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; + /** + * the new width of the window. + */ + width: number; + } + + interface WindowExternalProcessStartedEvent extends WindowBaseEvent { + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-started"; + } + + interface WindowExternalProcessExited extends WindowBaseEvent { + /** + * the process exit code + */ + exitCode: number; + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-exited"; + } + + interface WindowGroupChangedEvent extends WindowBaseEvent { + /** + * Which group array the window that the event listener was registered on is included in: + * 'source' The window is included in sourceGroup. + * 'target' The window is included in targetGroup. + * 'nothing' The window is not included in sourceGroup nor targetGroup. + */ + memberOf: "source" | "target" | "nothing"; + /** + * The reason this event was triggered. + * 'leave' A window has left the group due to a leave or merge with group. + * 'join' A window has joined the group. + * 'merge' Two groups have been merged together. + * 'disband' There are no other windows in the group. + */ + reason: "leave" | "join" | "merge" | "disband"; + /** + * All the windows in the group the sourceWindow originated from. + */ + sourceGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. + */ + sourceWindowAppUuid: string; + /** + * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. + */ + sourceWindowName: string; + /** + * All the windows in the group the targetWindow orginated from + */ + targetGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowAppUuid: string; + /** + * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowName: string; + type: "group-changed"; + } + + interface WindowOfGroupInfo { + /** + * The UUID of the application this window entry belongs to. + */ + appUuid: string; + /** + * The name of this window entry. + */ + windowName: string; + } + + interface WindowHiddenEvent extends WindowBaseEvent { + /** + * What action prompted the close. + * The reasons are: "hide", "hide-on-close" + */ + reason: "hide" | "hide-on-close"; + type: "hidden"; + } + + interface Window_NavigationRejectedEvent { + name: string; + /** + * source of navigation window name + */ + sourceName: string; + topic: "navigation-rejected"; + /** + * Url that was not reached "http://blocked-content.url" + */ + url: string; + /** + * the UUID of the application the window belongs to. + */ + uuid: string; + } + + interface AnimationTransition { + opacity?: { + /** + * This value is clamped from 0.0 to 1.0 + */ + opacity?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'opacity' as absolute or as a delta. Defaults to false. + */ + relative?: boolean; + }; + position?: { + /** + * Defaults to the window's current left position in virtual screen coordinates. + */ + left?: number; + /** + * Defaults to the window's current top position in virtual screen coordinates. + */ + top?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + size?: { + /** + * Optional if height is present. Defaults to the window's current width. + */ + width?: number; + /** + * Optional if width is present. Defaults to the window's current height. + */ + height?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + } + + interface AnimationOptions { + /** + * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. + */ + interrupt?: boolean; + /** + * Transition effect. Defaults to 'ease-in-out'. + */ + tween?: OpenFinTweenType; + } + + interface WindowBounds { + /** + * the height of the window. + */ + height?: number; + /** + * left-most coordinate of the window. + */ + left?: number; + /** + * top-most coordinate of the window. + */ + top?: number; + /** + * the width of the window. + */ + width?: number; + } + + interface SessionChangedEvent { + /** + * the action that triggered this event: + */ + reason: "lock" + | "unlock" + | "remote-connect" + | "remote-disconnect" + | "unknown"; + topic: "system"; + type: "session-changed"; + } + + interface LaunchInfo { + launchMode: "fin-protocol" + | "fins-protocol" + | "shortcut" + | "command-line" + | "adapter" + | "other" + | string; + } + + type OpenFinTweenType = "linear" + | "ease-in" + | "ease-out" + | "ease-in-out" + | "ease-in-quad" + | "ease-out-quad" + | "ease-in-out-quad" + | "ease-in-cubic" + | "ease-out-cubic" + | "ease-in-out-cubic" + | "ease-out-bounce" + | "ease-in-back" + | "ease-out-back" + | "ease-in-out-back" + | "ease-in-elastic" + | "ease-out-elastic" + | "ease-in-out-elastic"; + + type OpenFinApplicationEventType = "closed" + | "connected" + | "crashed" + | "initialized" + | "manifest-changed" + | "not-responding" + | "out-of-memory" + | "responding" + | "run-requested" + | "started" + | "tray-icon-clicked" + | "window-alert-requested" + | "window-auth-requested" + | "window-closed" + | "window-created" + | "window-end-load" + | "window-navigation-rejected" + | "window-show-requested" + | "window-start-load"; + + type OpenFinExternalApplicationEventType = "connected" + | "disconnected"; + + type OpenFinSystemEventType = "application-closed" + | "application-crashed" + | "application-created" + | "application-started" + | "desktop-icon-clicked" + | "idle-state-changed" + | "monitor-info-changed" + | "session-changed"; + + type OpenFinWindowEventType = "auth-requested" + | "blurred" + | "bounds-changed" + | "bounds-changing" + | "close-requested" + | "closed" + | "disabled-frame-bounds-changed" + | "disabled-frame-bounds-changing" + | "embedded" + | "external-process-exited" + | "external-process-started" + | "focused" + | "frame-disabled" + | "frame-enabled" + | "group-changed" + | "hidden" + | "initialized" + | "maximized" + | "minimized" + | "navigation-rejected" + | "restored" + | "show-requested" + | "shown"; + + type OpenFinAnchor = "top-left" + | "top-right" + | "bottom-left" + | "bottom-right"; +} diff --git a/types/openfin/v30/openfin-tests.ts b/types/openfin/v30/openfin-tests.ts new file mode 100644 index 0000000000..ce49b14f5c --- /dev/null +++ b/types/openfin/v30/openfin-tests.ts @@ -0,0 +1,728 @@ +/// + +function test_application() { + let application: fin.OpenFinApplication; + // constructor + application = new fin.desktop.Application({ + url: "application.html", + uuid: "74BED629-2D8E-4141-8582-73E364BDFA74", + name: "Application Name", + plugins: false, + mainWindowOptions: { + defaultHeight: 600, + defaultWidth: 800, + defaultTop: 300, + defaultLeft: 300, + autoShow: true + } + }, (successObj) => { + console.log("Application successfully created, HTTP response code:", successObj); + application.run(); + }, (error) => { + console.log("Error creating application:", error); + }); + //createFromManifest + fin.desktop.Application.createFromManifest("http://stuf.com/app.json", (app) => { + console.log(app.uuid); + }, err => console.log(err)); + // getCurrent + application = fin.desktop.Application.getCurrent(); + // wrap + application = fin.desktop.Application.wrap("454C7F31-A915-4EA2-83F2-CFA655453C52"); + // getWindow + application.getWindow(); + // addEventListener + application.addEventListener("closed", (event) => { + console.log("The application has closed"); + }, () => { + console.log("The registration was successful"); + }, reason => { + console.log("failure: " + reason); + }); + // close + application.close(); + // getChildWindows + application.getChildWindows(children => { + children.forEach(childWindow => { + console.log("Showing child: " + childWindow.name); + childWindow.show(); + }); + }); + // getGroups + application.getGroups(allGroups => { + console.log(`There are a total of ${allGroups.length} groups.`); + + let groupCounter = 1; + allGroups.forEach(windowGroup => { + console.log(`Group ${groupCounter} contains ${windowGroup.length} windows.`); + ++groupCounter; + }); + }); + // getManifest + application.getManifest(manifest => { + console.log("Application manifest:"); + console.log(manifest); + }); + // getParentUuid + application.getParentUuid(parentUuid => { + console.log("UUID of parent application:"); + console.log(parentUuid); + }); + // getShortcuts + application.getShortcuts(config => { + console.log("Desktop shortcut is enabled: ", config.desktop); + console.log("Start Menu shortcut is enabled: ", config.startMenu); + console.log("System Startup shortcut is enabled: ", config.systemStartup); + }); + // getInfo + application.getInfo(info => { + console.log(`Launch mode: ${info.launchMode}`); + }); + // getTrayIconInfo + application.getTrayIconInfo(info => { + console.log(info.x, info.y, info.bounds.x, info.bounds.y, info.bounds.height, info.bounds.width, + info.monitorInfo.type, info.monitorInfo.reason); + }); + // isRunning + application.isRunning(running => { + console.log("the application is", running ? "running" : "not running"); + }); + // registerCustomData + application.registerUser("a", "b", () => console.log("done"), err => console.log(err)); + // removeEventListener + const previousCallback = (event: fin.WindowEvent) => { }; + application.removeEventListener("closed", previousCallback, () => { + console.log("The unregistration was successful"); + }, err => { + console.log("failure:", err); + }); + // removeTrayIcon + application.removeTrayIcon(() => { + console.log("Removed the tray icon."); + }, err => { + console.log("failure:", err); + }); + // restart + application.restart(() => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // schedule restart + application.scheduleRestart(() => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // setShortcuts + application.setShortcuts({ + desktop: true, + startMenu: false, + systemStartup: true + }, () => { + console.log("Successfully set new shortcut states"); + }, error => { + console.log("Failed to set new shortcut states. Error: ", error); + }); + // setTrayIcon + application.setTrayIcon("https://developer.openf.in/download/openfin.png", clickInfo => { + console.log(`The mouse has clicked at (${clickInfo.x}, ${clickInfo.y})`); + }); + // terminate + application.terminate(); + // wait + application.addEventListener("not-responding", () => { + console.log("waiting for hung application"); + application.wait(); + }); + //uuid + let hasUuid = application.uuid; +} + +function test_external_application() { + let externalApp: fin.OpenFinExternalApplication; + // wrap + externalApp = fin.desktop.ExternalApp.wrap('my-uuid'); + // addEventListener + externalApp.addEventListener('connected', () => { + console.log('external app connected'); + }, () => { + console.log('The registration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); + // removeEventListener + const previousCallback = () => { }; + externalApp.removeEventListener('connected', previousCallback, () => { + console.log('The unregistration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); +} + +function test_inter_application_bus() { + // addSubscribeListener + fin.desktop.InterApplicationBus.addSubscribeListener((uuid, topic, name) => { + console.log(`The application ${uuid} has subscribed to ${topic}`); + }); + // addUnsubscribeListener + fin.desktop.InterApplicationBus.addUnsubscribeListener((uuid, topic, name) => { + console.log(`The application ${uuid} has unsubscribed to ${topic}`); + }); + // removeSubscribeListener + const aRegisteredListener = (uuid: string, topic: string, name: string) => { }; + fin.desktop.InterApplicationBus.removeSubscribeListener(aRegisteredListener); + // removeUnsubscribeListener + fin.desktop.InterApplicationBus.removeUnsubscribeListener(aRegisteredListener); + // publish + fin.desktop.InterApplicationBus.publish("a topic", { + field1: "value1", + field2: "value2" + }); + // send + fin.desktop.InterApplicationBus.send("an application's uuid", "a topic", { + field1: "value1", + field2: "value2" + }); + // subscribe + fin.desktop.InterApplicationBus.subscribe("*", "a topic", (message, uuid, name) => { + console.log(`The application ${uuid} sent this message: ${message}`); + }); + // unsubscribe + const aRegisteredMessageListener = (message: any, senderUuid: string) => { + console.log(message, senderUuid); + }; + fin.desktop.InterApplicationBus.unsubscribe("*", "a topic", aRegisteredMessageListener); +} + +function test_notification() { + let notification: fin.OpenFinNotification; + // getCurrent + notification = fin.desktop.Notification.getCurrent(); + // close + notification.close(); + // sendMessage + notification = new fin.desktop.Notification({ + duration: 10, + url: "http://localhost:5000/Account/Register", + message: "Hello", + onShow: () => { }, + // onClose: () => { }, + onDismiss: () => { }, + // onClick: () => { }, + onMessage: () => { }, + onError: () => { } + }); + // sendMessageToApplication + notification.sendMessageToApplication("some message"); +} + +function test_system() { + // addEventListener + fin.desktop.System.addEventListener('monitor-info-changed', event => { + console.log("The monitor information has changed to: ", event); + }, () => { + console.log("The registration was successful"); + }, err => { + console.log("failure: " + err); + }); + // clearCache + fin.desktop.System.clearCache({ + cache: true, + cookies: true, + localStorage: true, + appcache: true, + userData: true + }); + // deleteCacheOnExit + fin.desktop.System.deleteCacheOnExit(() => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // downloadAsset + const dirAppAsset = { + src: 'http://local:8000/dir.zip', + alias: 'dirApp', + version: '1.23.24', + target: 'dir.bat', + args: '' + }; + fin.desktop.System.downloadAsset(dirAppAsset, progress => { + const downloadedPercent = Math.floor((progress.downloadedBytes / progress.totalBytes) * 100); + console.log(`Downloaded ${downloadedPercent}%`); + }, p => { + console.log(`Downlod complete, can be found on ${p.path}`); + // lets launch our application asset. + // launchDirApp(); + }, (reason, err) => { + console.log(reason, err); + }); + // exit + fin.desktop.System.exit(() => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // getAllApplications + fin.desktop.System.getAllApplications(applicationInfoList => { + applicationInfoList.forEach(applicationInfo => { + console.log("Showing information for application with uuid: " + + applicationInfo.uuid); + console.log("isRunning: ", applicationInfo.isRunning); + }); + }); + // getAllExternalApplications + fin.desktop.System.getAllExternalApplications(externalAppsInfoList => { + externalAppsInfoList.forEach(appInfo => { + console.log(`External app connected to the runtime with UUID ${appInfo.uuid}`); + }); + }); + // getAllWindows + fin.desktop.System.getAllWindows(windowInfoList => { + windowInfoList.forEach(windowInfo => { + console.log("Showing information for application with uuid: ", windowInfo.uuid); + console.log("Main window: ", windowInfo.mainWindow); + console.log("Child windows: ", windowInfo.childWindows); + }); + }); + // getCommandLineArguments + fin.desktop.System.getCommandLineArguments(args => { + console.log("The command line arguments are " + args); + }); + // getDeviceId + fin.desktop.System.getDeviceId(id => { + console.log("The id of the device is: " + id); + }); + // getEnvironmentVariable + fin.desktop.System.getEnvironmentVariable("APPDATA", variable => { + console.log("this is the APPDATA value", variable); + }); + // getHostSpecs + fin.desktop.System.getHostSpecs(info => { + console.log(info); + }, error => { + console.log('There was an error:', error); + }); + // getLog + fin.desktop.System.getLog('debug-2015-01-08-22-27-53.log', log => { + console.log(log); + }); + // getLogList + fin.desktop.System.getLogList(logList => { + logList.forEach(logInfo => { + console.log(`The filename of the log is ${logInfo.name}, the size is ${logInfo.size}, and the date of creation is ${logInfo.date}`); + }); + }); + // getMonitorInfo + fin.desktop.System.getMonitorInfo(monitorInfo => { + console.log("This object contains information about all monitors: ", monitorInfo); + }); + // getMousePosition + fin.desktop.System.getMousePosition(mousePosition => { + console.log(`The mouse is located at left: ${mousePosition.left}, top: ${mousePosition.top}`); + }); + // getProcessList + fin.desktop.System.getProcessList(list => { + list.forEach(process => { + console.log(`UUID: ${process.uuid}, Application Name: ${process.name}`); + }); + }); + // getProxySettings + fin.desktop.System.getProxySettings(proxy => { + console.log(proxy); + }); + // getRvmInfo + fin.desktop.System.getRvmInfo(rvmInfoObject => { + console.log("RVM version:", rvmInfoObject.version); + console.log("RVM has been running since:", rvmInfoObject["start-time"]); + }, err => { + console.log("Failed to get rvm info, error message:", err); + }); + // getVersion + fin.desktop.System.getVersion(version => { + console.log("The version is " + version); + }); + // launchExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + // Additionally note that the executable found in the zip file specified in appAssets + // will default to the one mentioned by appAssets.target + // If the the path below refers to a specific path it will override this default + alias: "myApp", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + alias: "myApp", + arguments: "e f g", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + path: "C:\Users\ExampleUser\AppData\Local\OpenFin\OpenFinRVM.exe", + arguments: "--version", + certificate: { + trusted: true, + subject: 'O=OpenFin INC., L=New York, S=NY, C=US', + thumbprint: '3c a5 28 19 83 05 fe 69 88 e6 8f 4b 3a af c5 c5 1b 07 80 5b' + }, + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // log + fin.desktop.System.log("info", "An example log message", () => { + console.log("message successfully logged"); + }, err => { + console.log(err); + }); + // monitorExternalProcess + fin.desktop.System.monitorExternalProcess({ + pid: 2508, + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log("The process is now being monitored: ", payload.uuid); + }, error => { + console.log("Error:", error); + }); + // openUrlWithBrowser + fin.desktop.System.openUrlWithBrowser("https://developer.openf.in/", () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // registerExternalConnection + fin.desktop.System.registerExternalConnection("remote-connection-uuid", (...args: any[]) => { + console.log(args); + }); + // releaseExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener(result) { + console.log("The exit code", result.exitCode); + } + }, result => { + console.log("Result UUID is " + result.uuid); + + // release it. + fin.desktop.System.releaseExternalProcess(result.uuid, () => { + console.log("Process has been unmapped!"); + }, reason => { + console.log("failure: " + reason); + }); + }); + // removeEventListener + const aRegisteredListener = (event: fin.SystemBaseEvent) => { }; + fin.desktop.System.removeEventListener("monitor-info-changed", aRegisteredListener, () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // showDeveloperTools + fin.desktop.System.showDeveloperTools("uuid", "name", () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // terminateExternalProcess + fin.desktop.System.launchExternalProcess({ + // notepad is in the system's PATH + path: "notepad", + arguments: "", + listener(result) { + console.log("The exit code", result.exitCode); + } + }, result => { + console.log("Result UUID is " + result.uuid); + + // Attempt to close the process. Terminate after 4 seconds if it + // has not done so. + fin.desktop.System.terminateExternalProcess(result.uuid, 4000, info => { + console.log("Termination result " + info.result); + }, reason => { + console.log("failure: " + reason); + }); + }); + // updateProxySettings + fin.desktop.System.updateProxySettings("type", "proxyAddress", 8080, () => { + console.log('success'); + }, err => { + console.log(err); + }); +} + +function test_system_clipboard() { + // availableFormats + fin.desktop.System.Clipboard.availableFormats(null, formats => { + formats.forEach(format => console.log(`The format ${format} is available to read`)); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readHtml + fin.desktop.System.Clipboard.readHtml(null, html => { + console.log(`This is the html from the clipboard: ${html}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readRtf + fin.desktop.System.Clipboard.readRtf(null, rtf => { + console.log(`This is the rtf from the clipboard: ${rtf}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readText + fin.desktop.System.Clipboard.readText(null, text => { + console.log(`This is the text from the clipboard: ${text}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // write + fin.desktop.System.Clipboard.write({ + text: 'Hello Text!', + html: '

    Hello Html

    ', + rtf: 'Hello Rtf' + }, null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeHtml + fin.desktop.System.Clipboard.writeHtml('

    Hello World

    ', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeRtf + fin.desktop.System.Clipboard.writeRtf('Hello World!', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeText + fin.desktop.System.Clipboard.writeText('Hello World', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); +} + +function test_window() { + let finWindow: fin.OpenFinWindow; + // constructor + finWindow = new fin.desktop.Window({ + name: "childWindow", + url: "child.html", + defaultWidth: 320, + defaultHeight: 320, + defaultTop: 10, + defaultLeft: 300, + frame: false, + resizable: false, + state: "normal" + }, () => { + const _win = finWindow.getNativeWindow(); + _win.addEventListener("DOMContentLoaded", () => { finWindow.show(); }); + }, error => { + console.log("Error creating window:", error); + }); + // getCurrent + finWindow = fin.desktop.Window.getCurrent(); + // getNativeWindow + let nativeWindow: Window; + nativeWindow = finWindow.getNativeWindow(); + // getParentApplication + let parentApp: fin.OpenFinApplication; + parentApp = finWindow.getParentApplication(); + // getParentWindow + let parentFinWindow: fin.OpenFinWindow; + parentFinWindow = finWindow.getParentWindow(); + // wrap + finWindow = fin.desktop.Window.wrap("uuid", "name"); + // addEventListener + finWindow.addEventListener("bounds-changed", event => { + console.log("The window has been moved or resized"); + }, () => { + console.log("The registration was successful"); + }, reason => { + console.log("failure:" + reason); + }); + // animate + finWindow.animate({ + opacity: { + opacity: 0.15, + duration: 1000 + }, + position: { + left: 10, + top: 10, + duration: 3000 + } + }, { + interrupt: false + }, evt => { + // Callback will only fire after both "opacity" and "position" have finished animating. + }); + // authenticate + finWindow.addEventListener('auth-requested', evt => { + finWindow.authenticate('userName', 'P@assw0rd', () => { }, (reason, err) => { + console.log("failure:", err); + }); + }); + // blur + finWindow.blur(); + // bringToFront + finWindow.bringToFront(); + // close + finWindow.close(); + // disableFrame + finWindow.disableFrame(); + // enableFrame + finWindow.enableFrame(); + // flash + finWindow.flash(); + // focus + finWindow.focus(); + // getBounds + finWindow.getBounds(bounds => { + console.log(`top: ${bounds.top} left: ${bounds.left} height: ${bounds.height} width: ${bounds.width}`); + }); + // getOptions + finWindow.getOptions(options => { + console.log(options); + }); + // getSnapshot + finWindow.getSnapshot(base64Snapshot => { + console.log("data:image/png;base64," + base64Snapshot); + }); + // getState + finWindow.getState(state => { + console.log("state: " + state); + }); + // getZoomLevel + finWindow.getZoomLevel(level => { + console.log("zoom level: " + level); + }, error => { + console.log('error:', error); + }); + // hide + finWindow.hide(); + // isShowing + finWindow.isShowing(showing => { + console.log("the window is " + (showing ? "showing" : "hidden")); + }); + // joinGroup + let secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, () => { + // When mainWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow); + }); + // leaveGroup + secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, () => { + // When finWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow, () => { + // once we are in the group, lets leave it. + secondWindow.leaveGroup(); + }); + }); + // maximize + finWindow.maximize(); + // mergeGroups + { + const finWindowOne = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowOne", + autoShow: true + }); + const finWindowTwo = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowTwo", + autoShow: true + }); + const finWindowThree = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowThree", + autoShow: true + }); + const finWindowFour = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowFour", + autoShow: true + }); + // When finWindowOne moves or is moved, finWindowTwo moves by the same amount + finWindowOne.joinGroup(finWindowTwo); + // When finWindowThree moves or is moved, finWindowFour moves by the same amount + finWindowThree.joinGroup(finWindowFour); + // finWindowOne, finWindowTwo, finWindowThree, and finWindowFour now move together in the same group + finWindowOne.mergeGroups(finWindowThree); + } + // minimize + finWindow.minimize(); + // moveBy + finWindow.moveBy(10, 10); + // moveTo + finWindow.moveTo(100, 200); + // removeEventListener + const aRegisteredListener = (event: fin.WindowBaseEvent) => { }; + finWindow.removeEventListener("bounds-changed", aRegisteredListener); + // resizeBy + finWindow.resizeBy(10, 10, "top-right"); + // resizeTo + finWindow.resizeTo(10, 10, "top-right"); + // restore + finWindow.restore(); + // setAsForeground + finWindow.setAsForeground(); + // setBounds + finWindow.setBounds(100, 200, 400, 400); + // setZoomLevel + finWindow.setZoomLevel(10); + // show + finWindow.show(); + // showAt + finWindow.showAt(10, 10, false); + // stopFlashing + finWindow.stopFlashing(); + // updateOptions + finWindow.updateOptions({ + frame: false, + maxWidth: 500 + }); +} diff --git a/types/openfin/v30/tsconfig.json b/types/openfin/v30/tsconfig.json new file mode 100644 index 0000000000..fd3199ceb7 --- /dev/null +++ b/types/openfin/v30/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "openfin-tests.ts" + ] +} \ No newline at end of file diff --git a/types/openfin/v30/tslint.json b/types/openfin/v30/tslint.json new file mode 100644 index 0000000000..64aace11d6 --- /dev/null +++ b/types/openfin/v30/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "max-line-length": false + } +} diff --git a/types/openfin/v30/v30 b/types/openfin/v30/v30 new file mode 100644 index 0000000000..5c40c47ae0 --- /dev/null +++ b/types/openfin/v30/v30 @@ -0,0 +1,1736 @@ +// Type definitions for OpenFin API 17.0 +// Project: https://openfin.co/ +// Definitions by: Chris Barker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// based on v6.49.17.14 +// see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean + +/** + * JavaScript API + * The JavaScript API allows you to create an HTML/JavaScript application that has access to the native windowing environment, + * can communicate with other applications and has access to sandboxed system-level features. + * + * API Ready + * When using the OpenFin API, it is important to ensure that it has been fully loaded before making any API calls. To verify + * that the API is in fact ready, be sure to make any API calls either from within the fin.desktop.main() method or explicitly + * after it has returned. This avoids the situation of trying to access methods that are not yet fully injected. + * + * Overview + * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API + * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "document" objects. + */ +declare namespace fin { + const desktop: OpenFinDesktop; + + interface OpenFinDesktop { + main(f: () => any): void; + Application: OpenFinApplicationStatic; + ExternalApp: OpenFinExternalApplicationStatic; + InterApplicationBus: OpenFinInterApplicationBus; + Notification: OpenFinNotificationStatic; + System: OpenFinSystem; + Window: OpenFinWindowStatic; + } + + interface OpenFinApplicationStatic { + /** + * Creates a new Application. + * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. + */ + new ( + options: ApplicationOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; + /** + * Returns an Application object that represents an existing application. + */ + getCurrent(): OpenFinApplication; + /** + * Returns an Application object that represents an existing application. + */ + wrap(uuid: string): OpenFinApplication; + } + + /** + * Application + * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. + */ + interface OpenFinApplication { + /** + * Returns an instance of the main Window of the application + */ + getWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinApplicationEventType, + listener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Closes the application and any child windows created by the application. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. + */ + getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. + */ + getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. + */ + getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. + */ + getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves current configuration of application's shortcuts. + */ + getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves information about the application. + */ + getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the application is currently running. + */ + isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Passes in custom data that will be relayed to the RVM + */ + registerCustomData(data: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinApplicationEventType, + previouslyRegisteredListener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => any, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the application's icon from the tray. + */ + removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restarts the application. + */ + restart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Runs the application. When the application is created, run must be called. + */ + run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Tells the rvm to relaunch the main application once upon a complete shutdown + */ + scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets new shortcut configuration for current application. + * Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to + * be able to change shortcut states. + */ + setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Adds a customizable icon in the system tray and notifies the application when clicked. + */ + setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the application by terminating its process. + */ + terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application + * to continue and to generate another "not-responding" message after a certain period of time. + */ + wait(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * The Application's uuid + */ + uuid: string; + } + + interface ShortCutConfig { + /** + * application has a shortcut on the desktop + */ + desktop?: boolean; + /** + * application has no shortcut in the start menu + */ + startMenu?: boolean; + /** + * application will be launched on system startup + */ + systemStartup?: boolean; + } + + interface SuccessObj { + httpResponseCode: number; + } + + interface NetworkErrorInfo extends ErrorInfo { + networkErrorCode: number; + } + + interface ErrorInfo { + stack: string; + message: string; + } + + interface ApplicationOptions { + /** + * The name of the application. + */ + name?: string; + /** + * The url to the application. + */ + url?: string; + /** + * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. + */ + uuid?: string; + /** + * Enable Flash at the application level. Default: false. + */ + plugins?: boolean; + /** + * The options of the main window of the application. + */ + mainWindowOptions?: WindowOptions; + } + + interface WindowOptions { + /** + * Enable keyboard shortcuts for devtools and zoom. Default: false for both. + */ + accelerator?: { + devtools?: boolean, + zoom?: boolean, + reload?: boolean, + reloadIgnoreCache?: boolean, + }; + /** + * A flag to always position the window at the top of the window stack. Default: false. + * Updatable + */ + alwaysOnTop?: boolean; + /** + * A flag to automatically show the Window when it is created. Default: false. + */ + autoShow?: boolean; + /** + * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true + * Updatable + */ + contextMenu?: boolean; + /** + * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. + * Updatable + */ + cornerRounding?: { + width?: number; + height?: number; + }; + /** + * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. + */ + customData?: any; + /** + * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the position from before the window was closed is used. + * This option overrides defaultLeft and defaultTop. Default: false. + */ + defaultCentered?: boolean; + /** + * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. + */ + defaultHeight?: number; + /** + * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. + */ + defaultWidth?: number; + /** + * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. + */ + defaultTop?: number; + /** + * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. + */ + defaultLeft?: number; + /** + * A flag to show the frame. Default: true. + * Updatable + */ + frame?: boolean; + /** + * A flag to allow a window to be hidden when the close button is clicked.Default: false. + * Updatable + */ + hideOnClose?: boolean; + /** + * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. + * Updatable + */ + icon?: string; + /** + * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxHeight?: number; + /** + * A flag that lets the window be maximized.Default: true. + * Updatable + */ + maximizable?: boolean; + /** + * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxWidth?: number; + /** + * The minimum height of a window.Default: 0. + * Updatable + */ + minHeight?: number; + /** + * A flag that lets the window be minimized.Default: true. + */ + minimizable?: boolean; + /** + * The minimum width of a window.Default: 0. + */ + minWidth?: number; + /** + * The name for the window which must be unique within the context of the invoking Application. + */ + name?: string; + /** + * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. + * Updatable + */ + opacity?: number; + /** + * A flag to drop to allow the user to resize the window.Default: true. + * Updatable + */ + resizable?: boolean; + /** + * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. + * Updatable + */ + resizeRegion?: { + /** + * The size in pixels (Default: 2), + */ + size?: number; + /** + * The size in pixels of an additional + * square resizable region located at the + * bottom right corner of a + * frameless window. (Default: 4) + */ + bottomRightCorner?: number; + }; + /** + * A flag to show the Window's icon in the taskbar. Default: true. + */ + showTaskbarIcon?: boolean; + /** + * A flag to cache the location of the window or not. Default: true. + */ + saveWindowState?: boolean; + /** + * Specify a taskbar group for the window. Default: app's uuid. + */ + taskbarIconGroup?: string; + /** + * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". + */ + state?: string; + /** + * The URL of the window. Default: "about:blank". + */ + url?: string; + /** + * When set to false, the window will render before the "load" event is fired on the content's window. + * Caution, when false you will see an initial empty white window. Default: true. + */ + waitForPageLoad?: boolean; + } + + /** + * Clipboard + * Clipboard API allows reading and writting to the clipboard in multiple formats. + */ + interface OpenFinClipboard { + /** + * Reads available formats for the clipboard type + */ + availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Reads available formats for the clipboard type + */ + readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as Rtf + */ + readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as plain text + */ + readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard + */ + write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Html + */ + writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Rtf + */ + writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as plain text + */ + writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + interface OpenFinExternalApplicationStatic { + /** + * Returns an External Application object that represents an existing external application. + */ + wrap(uuid: string): OpenFinExternalApplication; + } + /** + * ExternalApplication + * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. + */ + interface OpenFinExternalApplication { + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + /** + * InterApplicationBus + * A messaging bus that allows for pub/sub messaging between different applications. + */ + interface OpenFinInterApplicationBus { + /** + * Adds a listener that gets called when applications subscribe to the current application's messages. + */ + addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Adds a listener that gets called when applications unsubscribe to the current application's messages. + */ + addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered subscribe listener. + */ + removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered unsubscribe listener. + */ + removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. + */ + publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sends a message to a specific application on a specific topic. + */ + send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], + * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. + */ + subscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + subscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Unsubscribes to messages from the specified application on the specified topic. + */ + unsubscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + unsubscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + } + + interface OpenFinNotificationStatic { + /** + * ctor + */ + new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; + /** + * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. + */ + getCurrent(): OpenFinNotification; + } + + /** + * Notification + * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. + * A notification is typically used to alert the user of some important event which requires his or her attention. + * Notifications are a child or your application that are controlled by the runtime. + */ + interface OpenFinNotification { + /** + * Closes the notification. + */ + close(callback?: () => void): void; + /** + * Sends a message to the notification. + */ + sendMessage(message: any, callback?: () => void): void; + /** + * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. + */ + sendMessageToApplication(message: any, callback?: () => void): void; + } + + interface NotificationOptions { + /** + * A boolean that will force dismissal even if the mouse is hovering over the notification + */ + ignoreMouseOver?: boolean; + /** + * A message of any primitive or composite-primitive type to be passed to the notification upon creation. + */ + message?: any; + /** + * The timeout for displaying a notification.Can be in milliseconds or "never". + */ + duration?: number | "never"; + /** + * The url of the notification + */ + url?: string; + /** + * A function that is called when a notification is clicked. + */ + onClick?(callback: () => void): void; + /** + * Invoked when the notification is closed via .close() method on the created notification instance + * or the by the notification itself via fin.desktop.Notification.getCurrent().close(). + * NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss + */ + onClose?(callback: () => void): void; + /** + * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. + */ + onDismiss?(callback: () => void): void; + /** + * A function that is called when an error occurs.The reason for the error is passed as an argument. + */ + onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * The onMessage function will respond to messages sent from notification.sendMessageToApplication. + * The function is passed the message, which can be of any primitive or composite-primitive type. + */ + onMessage?(callback: (message: any) => void): void; + /** + * A function that is called when a notification is shown. + */ + onShow?(callback: (successObj: SuccessObj) => void): void; + } + + /** + * System + * An object representing the core of OpenFin Runtime. + * Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. + */ + interface OpenFinSystem { + Clipboard: OpenFinClipboard; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Clears cached data containing window state/positions, + * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. + */ + clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Clears all cached data when OpenFin Runtime exits. + */ + deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Downloads the given application asset + */ + downloadAsset( + assetObj: AppAssetInfo, + progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, + callback?: (successObj: { path: string }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Exits the Runtime. + */ + exit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all applications. + */ + getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all external applications. + */ + getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data (name, ids, bounds) for all application windows. + */ + getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the command line argument string that started OpenFin Runtime. + */ + getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the configuration object that started the OpenFin Runtime. + */ + getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the value of a given environment variable on the computer on which the runtime is installed. + */ + getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves system information. + */ + getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the contents of the log with the specified filename. + */ + getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing information for each log file. + */ + getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. + */ + getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the mouse in virtual screen coordinates (left, top). + */ + getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of all of the runtime processes that are currently running. + * Each element in the array is an object containing the uuid and the name of the application to which the process belongs. + */ + getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the Proxy settings. + */ + getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns information about the running RVM in an object. + */ + getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. + */ + getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Runs an executable or batch file. + */ + launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Writes the passed message into both the log file and the console. + */ + log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Monitors a running process. + */ + monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Opens the passed URL in the default web browser. + */ + openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * This function call will register a unique id and produce a token. The token can be used to broker an external connection. + */ + registerExternalConnection( + uuid: string, + callback?: (detail: { + /** + * this will be unique each time + */ + token: string; + /** + * "remote-connection-uuid" + */ + uuid: string; + }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). + */ + releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the Chrome Developer Tools for the specified window. + */ + showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. + */ + terminateExternalProcess( + processUuid: string, + timeout: number, + killTree: boolean, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + terminateExternalProcess( + processUuid: string, + timeout: number, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Update the OpenFin Runtime Proxy settings. + */ + updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface CacheOptions { + cache?: boolean; + cookies?: boolean; + localStorage?: boolean; + appcache?: boolean; + userData?: boolean; + } + + interface AppAssetInfo { + src?: string; + alias?: string; + version?: string; + target?: string; + args?: string; + } + + interface ApplicationInfo { + /** + * true when the application is running. + */ + isRunning?: boolean; + /** + * uuid of the application. + */ + uuid?: string; + /** + * uuid of the application that launches this application. + */ + parentUuid?: string; + } + + interface WindowDetails { + uuid?: string; + mainWindow?: WindowInfo; + childWindows?: WindowInfo[]; + } + + interface WindowInfo { + /** + * name of the child window + */ + name?: string; + /** + * top-most coordinate of the child window + */ + top?: number; + /** + * right-most coordinate of the child window + */ + right?: number; + /** + * bottom-most coordinate of the child window + */ + bottom?: number; + /** + * left-most coordinate of the child window + */ + left?: number; + } + + interface HostSpecInfo { + /** + * "x86" for 32-bit or "x86_64" for 64-bit + */ + arch: string; + /** + * Same payload as Node's os.cpus() + */ + cpus: NodeCpuInfo[]; + gpu: { + /** + * Graphics card name + */ + name: string; + }; + /** + * Same payload as Node's os.totalmem() + */ + memory: number; + /** + * OS name and version/edition + */ + name: string; + } + + interface NodeCpuInfo { + model: string; + /** + * in MHz + */ + speed: number; + times: { + /** + * The number of milliseconds the CPU has spent in user mode. + */ + user: number; + /** + * The number of milliseconds the CPU has spent in nice mode. + */ + nice: number; + /** + * The number of milliseconds the CPU has spent in sys mode. + */ + sys: number; + /** + * The number of milliseconds the CPU has spent in idle mode. + */ + idle: number; + /** + * The number of milliseconds the CPU has spent in irq mode. + */ + irq: number; + }; + } + + interface LogInfo { + /** + * the filename of the log + */ + name?: string; + /** + * the size of the log in bytes + */ + size?: number; + /** + * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" + */ + date?: string; + } + + interface ProcessInfo { + /** + * the percentage of total CPU usage + */ + cpuUsage?: number; + /** + * the application name + */ + name?: string; + /** + * the current nonpaged pool usage in bytes + */ + nonPagedPoolUsage?: number; + /** + * the number of page faults + */ + pageFaultCount?: number; + /** + * the current paged pool usage in bytes + */ + pagedPoolUsage?: number; + /** + * the total amount of memory in bytes that the memory manager has committed + */ + pagefileUsage?: number; + /** + * the peak nonpaged pool usage in bytes + */ + peakNonPagedPoolUsage?: number; + /** + * the peak paged pool usage in bytes + */ + peakPagedPoolUsage?: number; + /** + * the peak value in bytes of pagefileUsage during the lifetime of this process + */ + peakPagefileUsage?: number; + /** + * the peak working set size in bytes + */ + peakWorkingSetSize?: number; + /** + * the native process identifier + */ + processId?: number; + /** + * the application UUID + */ + uuid?: string; + /** + * the current working set size (both shared and private data) in bytes + */ + workingSetSize?: number; + } + + interface ProxyInfo { + /** + * the configured Proxy Address + */ + proxyAddress?: string; + /** + * the configured Proxy port + */ + proxyPort?: number; + /** + * Proxy Type + */ + type?: string; + } + + interface RvmInfo { + version?: string; + "start-time"?: string; + } + + interface ExternalProcessLaunchInfo { + path?: string; + /** + * Additionally note that the executable found in the zip file specified in appAssets + * will default to the one mentioned by appAssets.target + * If the the path below refers to a specific path it will override this default + */ + alias?: string; + /** + * When using alias; if no arguments are passed then the arguments (if any) + * are taken from the 'app.json' file, from the 'args' parameter + * of the 'appAssets' Object with the relevant 'alias'. + * If 'arguments' is passed as a parameter it takes precedence + * over any 'args' set in the 'app.json'. + */ + arguments?: string; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + certificate?: CertificationInfo; + } + + interface CertificationInfo { + /** + * A hex string with or without spaces + */ + serial?: string; + /** + * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields + */ + subject?: string; + /** + * A hex string with or without spaces + */ + publickey?: string; + /** + * A hex string with or without spaces + */ + thumbprint?: string; + /** + * A boolean indicating that the certificate is trusted and not revoked + */ + trusted?: boolean; + } + + interface ExternalProcessInfo { + pid?: number; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + } + + interface OpenFinWindowStatic { + /** + * Class: Window + * + * new Window(options, callbackopt, errorCallbackopt) + * + * Creates a new OpenFin Window + * + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + * @param options - The options of the window + * @param [callback] - Called if the window creation was successful + * @param [callback.successObj] - httpResponseCode + */ + new ( + options: WindowOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; + /** + * Returns an instance of the current window. + * @returns Current window + */ + getCurrent(): OpenFinWindow; + /** + * Returns a Window object that wraps an existing window. + */ + wrap(appUuid: string, windowName: string): OpenFinWindow; + } + + /** + * Window + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + */ + interface OpenFinWindow { + /** + * Name of window + */ + name: string; + /** + * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, + * otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the + * contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. + * Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). + * @returns Native window + */ + getNativeWindow(): Window; + /** + * Gets the parent application. + * @returns Parent application + */ + getParentApplication(): OpenFinApplication; + /** + * Gets the parent window. + */ + getParentWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Performs the specified window transitions + */ + animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Provides credentials to authentication requests + */ + authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes focus from the window. + */ + blur(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Brings the window to the front of the OpenFin window stack. + */ + bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the window. + * @param Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Prevents a user from changing a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-disabled' is generated when an enabled frame becomes disabled. + */ + disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Re-enables user changes to a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-enabled' is generated when a disabled frame has becomes enabled. + */ + enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Flashes the window's frame and taskbar icon until the window is activated. + */ + flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gives focus to the window. + */ + focus(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current bounds (top, left, width, height) of the window. + */ + getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. + * Please note that calling window is included in the result array. + */ + getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current settings of the window. + */ + getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets a base64 encoded PNG snapshot of the window. + */ + getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current state ("minimized", "maximized", or "restored") of the window. + */ + getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the zoom level of the window. + */ + getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; + /** + * Hides the window. + */ + hide(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the window is currently showing. + */ + isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Joins the same window group as the specified window. + */ + joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Leaves the current window group so that the window can be move independently of those in the group. + */ + leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Maximizes the window. + */ + maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Merges the instance's window group with the same window group as the specified window + */ + mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Minimizes the window. + */ + minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window by a specified amount. + */ + moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window to a specified location. + */ + moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restores the window to its normal state (i.e., unminimized, unmaximized). + */ + restore(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Will bring the window to the front of the entire stack and give it focus. + */ + setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the window's size and position + */ + setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the zoom level of the window. + */ + setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden. + * @param Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. + */ + show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. + */ + showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Stops the taskbar icon from flashing. + */ + stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Updates the window using the passed options + */ + updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface ApplicationBaseEvent { + topic: string; + type: OpenFinApplicationEventType; + uuid: string; + } + + interface TrayIconClickedEvent extends ApplicationBaseEvent { + button: number; // 0 for left, 1 for middle, 2 for right + monitorInfo: MonitorInfo; + x: number; // the cursor x coordinate + y: number; // the cursor y coordinate + } + + interface WindowEvent extends ApplicationBaseEvent { + name: string; + } + + interface WindowAlertRequestedEvent extends WindowEvent { + message: string; + url: string; + } + + interface WindowAuthRequested extends WindowEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowNavigationRejectedEvent extends WindowEvent { + sourceName: string; + url: string; + } + + interface WindowEndLoadEvent extends WindowEvent { + documentName: string; + isMain: boolean; + } + + interface MonitorInfoChangedEvent extends MonitorInfo { + topic: "system"; + type: "monitor-info-changed"; + } + + interface MonitorInfo { + nonPrimaryMonitors: MonitorInfoDetail[]; + primaryMonitor: MonitorInfoDetail; + reason: string; + taskbar: { + edge: "left" | "right" | "top" | "bottom", + rect: MontiorCoordinates + }; + topic: "system"; + type: "monitor-info-changed"; + virtualScreen: MontiorCoordinates; + } + + interface MonitorInfoDetail { + availableRect: MontiorCoordinates; + deviceId: string; + displayDeviceActive: boolean; + monitorRect: MontiorCoordinates; + name: string; + } + + interface MontiorCoordinates { + bottom: number; + left: number; + right: number; + top: number; + } + + interface VirtualScreenCoordinates { + left: number; + top: number; + } + + interface SystemBaseEvent { + topic: string; + type: OpenFinSystemEventType; + uuid: string; + } + + interface DesktopIconClickedEvent { + mouse: { + /** + * the left virtual screen coordinate of the mouse + */ + left: number, + /** + * the top virtual screen coordinate of the mouse + */ + top: number + }; + /** + * the number of milliseconds that have elapsed since the system was started, + */ + tickCount: number; + topic: "system"; + type: "desktop-icon-clicked"; + } + + interface IdleStateChangedEvent { + /** + * How long in milliseconds since the user has been idle. + */ + elapsedTime: number; + /** + * true when the user is idle,false when the user has returned; + */ + isIdle: boolean; + topic: "system"; + type: "idle-state-changed"; + } + + interface WindowBaseEvent { + /** + * the name of the window + */ + name: string; + /** + * always window + */ + topic: "window"; + /** + * window event type + */ + type: OpenFinWindowEventType; + /** + * the UUID of the application the window belongs to + */ + uuid: string; + } + + interface WindowAuthRequestedEvent extends WindowBaseEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowBoundsEvent extends WindowBaseEvent { + /** + * describes what kind of change occurred. + * 0 means a change in position. + * 1 means a change in size. + * 2 means a change in position and size. + */ + changeType: number; + /** + * true when pending changes have been applied to the window. + */ + deferred: boolean; + /** + * the new height of the window. + */ + height: number; + /** + * the left-most coordinate of the window. + */ + left: number; + /** + * the top-most coordinate of the window. + */ + top: number; + + type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; + /** + * the new width of the window. + */ + width: number; + } + + interface WindowExternalProcessStartedEvent extends WindowBaseEvent { + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-started"; + } + + interface WindowExternalProcessExited extends WindowBaseEvent { + /** + * the process exit code + */ + exitCode: number; + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-exited"; + } + + interface WindowGroupChangedEvent extends WindowBaseEvent { + /** + * Which group array the window that the event listener was registered on is included in: + * 'source' The window is included in sourceGroup. + * 'target' The window is included in targetGroup. + * 'nothing' The window is not included in sourceGroup nor targetGroup. + */ + memberOf: "source" | "target" | "nothing"; + /** + * The reason this event was triggered. + * 'leave' A window has left the group due to a leave or merge with group. + * 'join' A window has joined the group. + * 'merge' Two groups have been merged together. + * 'disband' There are no other windows in the group. + */ + reason: "leave" | "join" | "merge" | "disband"; + /** + * All the windows in the group the sourceWindow originated from. + */ + sourceGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. + */ + sourceWindowAppUuid: string; + /** + * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. + */ + sourceWindowName: string; + /** + * All the windows in the group the targetWindow orginated from + */ + targetGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowAppUuid: string; + /** + * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowName: string; + type: "group-changed"; + } + + interface WindowOfGroupInfo { + /** + * The UUID of the application this window entry belongs to. + */ + appUuid: string; + /** + * The name of this window entry. + */ + windowName: string; + } + + interface WindowHiddenEvent extends WindowBaseEvent { + /** + * What action prompted the close. + * The reasons are: "hide", "hide-on-close" + */ + reason: "hide" | "hide-on-close"; + type: "hidden"; + } + + interface Window_NavigationRejectedEvent { + name: string; + /** + * source of navigation window name + */ + sourceName: string; + topic: "navigation-rejected"; + /** + * Url that was not reached "http://blocked-content.url" + */ + url: string; + /** + * the UUID of the application the window belongs to. + */ + uuid: string; + } + + interface AnimationTransition { + opacity?: { + /** + * This value is clamped from 0.0 to 1.0 + */ + opacity?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'opacity' as absolute or as a delta. Defaults to false. + */ + relative?: boolean; + }; + position?: { + /** + * Defaults to the window's current left position in virtual screen coordinates. + */ + left?: number; + /** + * Defaults to the window's current top position in virtual screen coordinates. + */ + top?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + size?: { + /** + * Optional if height is present. Defaults to the window's current width. + */ + width?: number; + /** + * Optional if width is present. Defaults to the window's current height. + */ + height?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + } + + interface AnimationOptions { + /** + * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. + */ + interrupt?: boolean; + /** + * Transition effect. Defaults to 'ease-in-out'. + */ + tween?: OpenFinTweenType; + } + + interface WindowBounds { + /** + * the height of the window. + */ + height?: number; + /** + * left-most coordinate of the window. + */ + left?: number; + /** + * top-most coordinate of the window. + */ + top?: number; + /** + * the width of the window. + */ + width?: number; + } + + interface SessionChangedEvent { + /** + * the action that triggered this event: + */ + reason: "lock" + | "unlock" + | "remote-connect" + | "remote-disconnect" + | "unknown"; + topic: "system"; + type: "session-changed"; + } + + interface LaunchInfo { + launchMode: "fin-protocol" + | "fins-protocol" + | "shortcut" + | "command-line" + | "adapter" + | "other" + | string; + } + + type OpenFinTweenType = "linear" + | "ease-in" + | "ease-out" + | "ease-in-out" + | "ease-in-quad" + | "ease-out-quad" + | "ease-in-out-quad" + | "ease-in-cubic" + | "ease-out-cubic" + | "ease-in-out-cubic" + | "ease-out-bounce" + | "ease-in-back" + | "ease-out-back" + | "ease-in-out-back" + | "ease-in-elastic" + | "ease-out-elastic" + | "ease-in-out-elastic"; + + type OpenFinApplicationEventType = "closed" + | "connected" + | "crashed" + | "initialized" + | "manifest-changed" + | "not-responding" + | "out-of-memory" + | "responding" + | "run-requested" + | "started" + | "tray-icon-clicked" + | "window-alert-requested" + | "window-auth-requested" + | "window-closed" + | "window-created" + | "window-end-load" + | "window-navigation-rejected" + | "window-show-requested" + | "window-start-load"; + + type OpenFinExternalApplicationEventType = "connected" + | "disconnected"; + + type OpenFinSystemEventType = "application-closed" + | "application-crashed" + | "application-created" + | "application-started" + | "desktop-icon-clicked" + | "idle-state-changed" + | "monitor-info-changed" + | "session-changed"; + + type OpenFinWindowEventType = "auth-requested" + | "blurred" + | "bounds-changed" + | "bounds-changing" + | "close-requested" + | "closed" + | "disabled-frame-bounds-changed" + | "disabled-frame-bounds-changing" + | "embedded" + | "external-process-exited" + | "external-process-started" + | "focused" + | "frame-disabled" + | "frame-enabled" + | "group-changed" + | "hidden" + | "initialized" + | "maximized" + | "minimized" + | "navigation-rejected" + | "restored" + | "show-requested" + | "shown"; + + type OpenFinAnchor = "top-left" + | "top-right" + | "bottom-left" + | "bottom-right"; +} From b82cc7afb982c10c2997249381920e2529d00b90 Mon Sep 17 00:00:00 2001 From: DABH Date: Fri, 9 Mar 2018 23:02:48 -0800 Subject: [PATCH 0034/2153] colors.js now bundles typings, remove from DT --- notNeededPackages.json | 8 ++- types/colors/colors-tests.ts | 21 ------ types/colors/index.d.ts | 133 ----------------------------------- types/colors/safe.d.ts | 40 ----------- types/colors/tsconfig.json | 24 ------- types/colors/tslint.json | 1 - 6 files changed, 7 insertions(+), 220 deletions(-) delete mode 100644 types/colors/colors-tests.ts delete mode 100644 types/colors/index.d.ts delete mode 100644 types/colors/safe.d.ts delete mode 100644 types/colors/tsconfig.json delete mode 100644 types/colors/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 8c587f7c43..06417dd58d 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -174,7 +174,7 @@ "sourceRepoURL": "https://github.com/MikeMcl/bignumber.js/", "asOfVersion": "5.0.0" }, - { + { "libraryName": "bingmaps", "typingsPackageName": "bingmaps", "sourceRepoURL": "https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions", @@ -234,6 +234,12 @@ "sourceRepoURL": "https://github.com/saltyrtc/chunked-dc-js", "asOfVersion": "0.2.2" }, + { + "libraryName": "colors.js (colors)", + "typingsPackageName": "colors", + "sourceRepoURL": "https://github.com/Marak/colors.js", + "asOfVersion": "1.2.0" + }, { "libraryName": "commander", "typingsPackageName": "commander", diff --git a/types/colors/colors-tests.ts b/types/colors/colors-tests.ts deleted file mode 100644 index fcac0323f6..0000000000 --- a/types/colors/colors-tests.ts +++ /dev/null @@ -1,21 +0,0 @@ -import colors = require("colors"); -import { zalgo } from "colors/safe"; - -let str: string; - -str = zalgo(""); - -colors.enabled = true; - -str = colors.black.underline('test'); -str = colors.rainbow.black.blue.gray('test'); -str = colors.random.reset.bgWhite.dim('test'); -str = colors.random.reset.bgWhite.strip('test'); -str = 'test'.black.underline; -str = 'test'.rainbow.black.blue.gray; -str = 'test'.random.reset.bgWhite.dim; -str = 'test'.random.reset.bgWhite.dim.stripColors; - -colors.enabled = false; - -str = colors.black.underline('test'); diff --git a/types/colors/index.d.ts b/types/colors/index.d.ts deleted file mode 100644 index a5494aa945..0000000000 --- a/types/colors/index.d.ts +++ /dev/null @@ -1,133 +0,0 @@ -// Type definitions for Colors.js 1.1 -// Project: https://github.com/Marak/colors.js -// Definitions by: Bart van der Schoor , Staffan Eketorp -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export interface Color { - (text: string): string; - - strip: Color; - stripColors: Color; - - black: Color; - red: Color; - green: Color; - yellow: Color; - blue: Color; - magenta: Color; - cyan: Color; - white: Color; - gray: Color; - grey: Color; - - bgBlack: Color; - bgRed: Color; - bgGreen: Color; - bgYellow: Color; - bgBlue: Color; - bgMagenta: Color; - bgCyan: Color; - bgWhite: Color; - - reset: Color; - bold: Color; - dim: Color; - italic: Color; - underline: Color; - inverse: Color; - hidden: Color; - strikethrough: Color; - - rainbow: Color; - zebra: Color; - america: Color; - trap: Color; - random: Color; - zalgo: Color; -} - -export function setTheme(theme: any): void; - -export let enabled: boolean; - -export const strip: Color; -export const stripColors: Color; - -export const black: Color; -export const red: Color; -export const green: Color; -export const yellow: Color; -export const blue: Color; -export const magenta: Color; -export const cyan: Color; -export const white: Color; -export const gray: Color; -export const grey: Color; - -export const bgBlack: Color; -export const bgRed: Color; -export const bgGreen: Color; -export const bgYellow: Color; -export const bgBlue: Color; -export const bgMagenta: Color; -export const bgCyan: Color; -export const bgWhite: Color; - -export const reset: Color; -export const bold: Color; -export const dim: Color; -export const italic: Color; -export const underline: Color; -export const inverse: Color; -export const hidden: Color; -export const strikethrough: Color; - -export const rainbow: Color; -export const zebra: Color; -export const america: Color; -export const trap: Color; -export const random: Color; -export const zalgo: Color; - -declare global { - interface String { - strip: string; - stripColors: string; - - black: string; - red: string; - green: string; - yellow: string; - blue: string; - magenta: string; - cyan: string; - white: string; - gray: string; - grey: string; - - bgBlack: string; - bgRed: string; - bgGreen: string; - bgYellow: string; - bgBlue: string; - bgMagenta: string; - bgCyan: string; - bgWhite: string; - - reset: string; - bold: string; - dim: string; - italic: string; - underline: string; - inverse: string; - hidden: string; - strikethrough: string; - - rainbow: string; - zebra: string; - america: string; - trap: string; - random: string; - zalgo: string; - } -} diff --git a/types/colors/safe.d.ts b/types/colors/safe.d.ts deleted file mode 100644 index 306b656b2b..0000000000 --- a/types/colors/safe.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -export const enabled: boolean; - -export function strip(str: string): string; -export function stripColors(str: string): string; - -export function black(str: string): string; -export function red(str: string): string; -export function green(str: string): string; -export function yellow(str: string): string; -export function blue(str: string): string; -export function magenta(str: string): string; -export function cyan(str: string): string; -export function white(str: string): string; -export function gray(str: string): string; -export function grey(str: string): string; - -export function bgBlack(str: string): string; -export function bgRed(str: string): string; -export function bgGreen(str: string): string; -export function bgYellow(str: string): string; -export function bgBlue(str: string): string; -export function bgMagenta(str: string): string; -export function bgCyan(str: string): string; -export function bgWhite(str: string): string; - -export function reset(str: string): string; -export function bold(str: string): string; -export function dim(str: string): string; -export function italic(str: string): string; -export function underline(str: string): string; -export function inverse(str: string): string; -export function hidden(str: string): string; -export function strikethrough(str: string): string; - -export function rainbow(str: string): string; -export function zebra(str: string): string; -export function america(str: string): string; -export function trap(str: string): string; -export function random(str: string): string; -export function zalgo(str: string): string; diff --git a/types/colors/tsconfig.json b/types/colors/tsconfig.json deleted file mode 100644 index 99d78ad72d..0000000000 --- a/types/colors/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es5" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "colors-tests.ts", - "safe.d.ts" - ] -} \ No newline at end of file diff --git a/types/colors/tslint.json b/types/colors/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/colors/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } From f9083401863c617d17f5703d66f89dc55dd752b1 Mon Sep 17 00:00:00 2001 From: Rasmus Eneman Date: Fri, 1 Dec 2017 14:30:39 +0100 Subject: [PATCH 0035/2153] [recompose]: Improve type inference of withHandlers I went ahead and added the correspondeing tests on withStateHandlers as well to make sure it also works as expected --- types/recompose/index.d.ts | 23 +++++++++++--- types/recompose/recompose-tests.tsx | 48 +++++++++++++++++++++++++++-- 2 files changed, 63 insertions(+), 8 deletions(-) diff --git a/types/recompose/index.d.ts b/types/recompose/index.d.ts index edff2061b5..c057521570 100644 --- a/types/recompose/index.d.ts +++ b/types/recompose/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Iskander Sierra // Samuel DeSota // Curtis Layne +// Rasmus Eneman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -78,13 +79,25 @@ declare module 'recompose' { // withHandlers: https://github.com/acdlite/recompose/blob/master/docs/API.md#withhandlers type EventHandler = Function; - type HandleCreators = { - [handlerName in keyof THandlers]: mapper; + // This type is required to infer TOutter + type HandleCreatorsStructure = { + [handlerName: string]: mapper; }; - type HandleCreatorsFactory = (initialProps: TOutter) => HandleCreators; + // This type is required to infer THandlers + type HandleCreatorsHandlers = { + [P in keyof THandlers]: (props: TOutter) => THandlers[P]; + }; + type HandleCreators = + & HandleCreatorsStructure + & HandleCreatorsHandlers + type HandleCreatorsFactory = (initialProps: TOutter) => + HandleCreators; + export function withHandlers( - handlerCreators: HandleCreators | HandleCreatorsFactory - ): InferableComponentEnhancerWithProps; + handlerCreators: + | HandleCreators + | HandleCreatorsFactory + ): InferableComponentEnhancerWithProps; // defaultProps: https://github.com/acdlite/recompose/blob/master/docs/API.md#defaultprops export function defaultProps( diff --git a/types/recompose/recompose-tests.tsx b/types/recompose/recompose-tests.tsx index 1504ab563a..c239cbacb1 100644 --- a/types/recompose/recompose-tests.tsx +++ b/types/recompose/recompose-tests.tsx @@ -120,10 +120,35 @@ function testWithHandlers() { /> ) - const handlerNameTypecheckProof = withHandlers({ + const handlerNameTypecheckProof = withHandlers({ // $ExpectError onChange: () => () => {}, - notAKeyOnHandlerProps: () => () => {}, // $ExpectError + notAKeyOnHandlerProps: () => () => {}, }); + + // The inner props should be fully inferrable + const enhancer3 = withHandlers({ + onChange: (props: OutterProps) => (e: any) => {}, + onSubmit: (props: OutterProps) => (e: React.MouseEvent) => {}, + }); + const Enhanced3 = enhancer3(({onChange, onSubmit, out}) => +
    {out}
    ); + const rendered3 = ( + + ) + + const enhancer4 = withHandlers((props: OutterProps) => ({ + onChange: (props) => (e: any) => {}, + onSubmit: (props) => (e: React.MouseEvent) => {}, + })); + const Enhanced4 = enhancer4(({onChange, onSubmit, out}) => +
    {out}
    ); + const rendered4 = ( + + ) } function testDefaultProps() { @@ -220,7 +245,24 @@ function testWithStateHandlers() { (props: OutterProps) => ({ counter: props.initialCounter }), { notAKeyOfUpdaters: (state, props) => n => ({ ...state, counter: state.counter + n ** props.power }), }, // $ExpectError ); - } + + // The inner props should be fully inferrable + const enhancer2 = withStateHandlers( + (props: OutterProps) => ({ counter: props.initialCounter }), + { + add: (state, props) => n => ({ ...state, counter: state.counter + n ** props.power }), + }, + ); + const Enhanced2 = enhancer((props) => +
    +
    {`Counts from: ${props.initialCounter}`}
    +
    {`Counter: ${props.counter}`}
    +
    props.add(2)}>
    +
    ); + const rendered2 = ( + + ); +} function testWithReducer() { interface State { count: number } From d4d064b7c57f3feddfe25a417bed0cdf70ea214f Mon Sep 17 00:00:00 2001 From: orblazer Date: Sun, 11 Mar 2018 14:32:47 +0100 Subject: [PATCH 0036/2153] Fix "this" context on "on" functions --- types/ws/index.d.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/types/ws/index.d.ts b/types/ws/index.d.ts index 303dcc3875..fbfc3713c3 100644 --- a/types/ws/index.d.ts +++ b/types/ws/index.d.ts @@ -67,14 +67,14 @@ declare class WebSocket extends events.EventEmitter { removeEventListener(method: string, listener?: () => void): void; // Events - on(event: 'close', listener: (code: number, reason: string) => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'upgrade', listener: (request: http.IncomingMessage) => void): this; - on(event: 'message', listener: (data: WebSocket.Data) => void): this; - on(event: 'open' , listener: () => void): this; - on(event: 'ping' | 'pong', listener: (data: Buffer) => void): this; - on(event: 'unexpected-response', listener: (request: http.ClientRequest, response: http.IncomingMessage) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: 'close', listener: (this: WebSocket, code: number, reason: string) => void): this; + on(event: 'error', listener: (this: WebSocket, err: Error) => void): this; + on(event: 'upgrade', listener: (this: WebSocket, request: http.IncomingMessage) => void): this; + on(event: 'message', listener: (this: WebSocket, data: WebSocket.Data) => void): this; + on(event: 'open' , listener: (this: WebSocket) => void): this; + on(event: 'ping' | 'pong', listener: (this: WebSocket, data: Buffer) => void): this; + on(event: 'unexpected-response', listener: (this: WebSocket, request: http.ClientRequest, response: http.IncomingMessage) => void): this; + on(event: string | symbol, listener: (this: WebSocket, ...args: any[]) => void): this; addListener(event: 'close', listener: (code: number, message: string) => void): this; addListener(event: 'error', listener: (err: Error) => void): this; @@ -181,11 +181,11 @@ declare namespace WebSocket { shouldHandle(request: http.IncomingMessage): boolean; // Events - on(event: 'connection', cb: (socket: WebSocket, request: http.IncomingMessage) => void): this; - on(event: 'error', cb: (error: Error) => void): this; - on(event: 'headers', cb: (headers: string[], request: http.IncomingMessage) => void): this; - on(event: 'listening', cb: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: 'connection', cb: (this: WebSocket, socket: WebSocket, request: http.IncomingMessage) => void): this; + on(event: 'error', cb: (this: WebSocket, error: Error) => void): this; + on(event: 'headers', cb: (this: WebSocket, headers: string[], request: http.IncomingMessage) => void): this; + on(event: 'listening', cb: (this: WebSocket) => void): this; + on(event: string | symbol, listener: (this: WebSocket, ...args: any[]) => void): this; addListener(event: 'connection', cb: (client: WebSocket) => void): this; addListener(event: 'error', cb: (err: Error) => void): this; From 15412bfd248a0efdafd8aa6641c74128d6eb5406 Mon Sep 17 00:00:00 2001 From: orblazer Date: Sun, 11 Mar 2018 14:36:07 +0100 Subject: [PATCH 0037/2153] Add missing contribution --- types/ws/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/ws/index.d.ts b/types/ws/index.d.ts index fbfc3713c3..7848bf3992 100644 --- a/types/ws/index.d.ts +++ b/types/ws/index.d.ts @@ -4,6 +4,7 @@ // Matt Silverlock // Margus Lamp // Philippe D'Alva +// Orblazer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// From dbd9ce2952c633fe63ebe9a1a03103ce1a218742 Mon Sep 17 00:00:00 2001 From: Behind The Math Date: Sun, 11 Mar 2018 13:19:15 -0400 Subject: [PATCH 0038/2153] [sqlite3] Add return type for .verbose() --- types/sqlite3/index.d.ts | 17 +++++++++++++++-- types/sqlite3/sqlite3-tests.ts | 4 ++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/types/sqlite3/index.d.ts b/types/sqlite3/index.d.ts index 921845e5a0..1116cc6388 100644 --- a/types/sqlite3/index.d.ts +++ b/types/sqlite3/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for sqlite3 3.1 +// Type definitions for sqlite3 3.1.13 // Project: https://github.com/mapbox/node-sqlite3 // Definitions by: Nick Malaguti // Sumant Manne +// Behind The Math // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -85,4 +86,16 @@ export class Database extends events.EventEmitter { on(event: string, listener: (...args: any[]) => void): this; } -export function verbose(): void; +export function verbose(): sqlite3; + +// tslint:disable-next-line:strict-export-declare-modifiers +interface sqlite3 { + OPEN_READONLY: number; + OPEN_READWRITE: number; + OPEN_CREATE: number; + cached: typeof cached; + RunResult: RunResult; + Statement: typeof Statement; + Database: typeof Database; + verbose(): this; +} diff --git a/types/sqlite3/sqlite3-tests.ts b/types/sqlite3/sqlite3-tests.ts index 4ddfa0a502..cc2ace853c 100644 --- a/types/sqlite3/sqlite3-tests.ts +++ b/types/sqlite3/sqlite3-tests.ts @@ -1,5 +1,5 @@ -import sqlite3 = require('sqlite3'); -sqlite3.verbose(); +import * as sqlite from 'sqlite3'; +const sqlite3 = sqlite.verbose(); let db: sqlite3.Database = new sqlite3.Database('chain.sqlite3', () => {}); From 6d7596886844c498730bf91e34287d62a1459689 Mon Sep 17 00:00:00 2001 From: Behind The Math Date: Sun, 11 Mar 2018 16:10:12 -0400 Subject: [PATCH 0039/2153] Bug fixes --- types/sqlite3/index.d.ts | 2 +- types/sqlite3/sqlite3-tests.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/sqlite3/index.d.ts b/types/sqlite3/index.d.ts index 1116cc6388..7461cf82b7 100644 --- a/types/sqlite3/index.d.ts +++ b/types/sqlite3/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for sqlite3 3.1.13 +// Type definitions for sqlite3 3.1 // Project: https://github.com/mapbox/node-sqlite3 // Definitions by: Nick Malaguti // Sumant Manne diff --git a/types/sqlite3/sqlite3-tests.ts b/types/sqlite3/sqlite3-tests.ts index cc2ace853c..fe897f73ec 100644 --- a/types/sqlite3/sqlite3-tests.ts +++ b/types/sqlite3/sqlite3-tests.ts @@ -1,7 +1,7 @@ import * as sqlite from 'sqlite3'; const sqlite3 = sqlite.verbose(); -let db: sqlite3.Database = new sqlite3.Database('chain.sqlite3', () => {}); +let db: sqlite.Database = new sqlite3.Database('chain.sqlite3', () => {}); function createDb() { console.log("createDb chain"); From 30f94c40cc9cab5ed6445bab96c949b1c39bdea0 Mon Sep 17 00:00:00 2001 From: Jason Dreyzehner Date: Sun, 11 Mar 2018 16:38:30 -0400 Subject: [PATCH 0040/2153] del: arrays are not required to be mutable --- types/del/del-tests.ts | 58 ++++++++++++++++++++++++------------------ types/del/index.d.ts | 13 +++++++--- 2 files changed, 43 insertions(+), 28 deletions(-) diff --git a/types/del/del-tests.ts b/types/del/del-tests.ts index fc6c63b6fa..f9d01f644f 100644 --- a/types/del/del-tests.ts +++ b/types/del/del-tests.ts @@ -1,39 +1,47 @@ -import del = require("del"); +import del = require('del'); -let paths = ["build", "dist/**/*.js"]; +let paths = ['build', 'dist/**/*.js']; -del(["tmp/*.js", "!tmp/unicorn.js"]); -del(["tmp/*.js", "!tmp/unicorn.js"], {force: true}); -del(["tmp/*.js", "!tmp/unicorn.js"], {dryRun: true}); -del(["tmp/*.js", "!tmp/unicorn.js"], {concurrency: 20}); -del(["tmp/*.js", "!tmp/unicorn.js"], {cwd: ''}); +del(['tmp/*.js', '!tmp/unicorn.js']); +del(['tmp/*.js', '!tmp/unicorn.js'], { force: true }); +del(['tmp/*.js', '!tmp/unicorn.js'], { dryRun: true }); +del(['tmp/*.js', '!tmp/unicorn.js'], { concurrency: 20 }); +del(['tmp/*.js', '!tmp/unicorn.js'], { cwd: '' }); -del(["tmp/*.js", "!tmp/unicorn.js"]).then((paths: string[]) => { +del(['tmp/*.js', '!tmp/unicorn.js']).then((paths: string[]) => { console.log('Deleted files/folders:\n', paths.join('\n')); }); -del(["tmp/*.js", "!tmp/unicorn.js"], {force: true}).then((paths: string[]) => { +del(['tmp/*.js', '!tmp/unicorn.js'], { force: true }).then( + (paths: string[]) => { + console.log('Deleted files/folders:\n', paths.join('\n')); + } +); + +del('tmp/*.js'); +del('tmp/*.js', { force: true }); +del('tmp/*.js', { dryRun: true }); +del('tmp/*.js', { concurrency: 20 }); +del('tmp/*.js', { cwd: '' }); +del('tmp/*.js').then((paths: string[]) => { console.log('Deleted files/folders:\n', paths.join('\n')); }); -del("tmp/*.js"); -del("tmp/*.js", {force: true}); -del("tmp/*.js", {dryRun: true}); -del("tmp/*.js", {concurrency: 20}); -del("tmp/*.js", {cwd: ''}); -del("tmp/*.js").then((paths: string[]) => { +del('tmp/*.js', { force: true }).then((paths: string[]) => { console.log('Deleted files/folders:\n', paths.join('\n')); }); -del("tmp/*.js", {force: true}).then((paths: string[]) => { - console.log('Deleted files/folders:\n', paths.join('\n')); -}); +paths = del.sync(['tmp/*.js', '!tmp/unicorn.js']); +paths = del.sync(['tmp/*.js', '!tmp/unicorn.js'], { force: true }); -paths = del.sync(["tmp/*.js", "!tmp/unicorn.js"]); -paths = del.sync(["tmp/*.js", "!tmp/unicorn.js"], {force: true}); +paths = del.sync('tmp/*.js'); +paths = del.sync('tmp/*.js', { force: true }); +paths = del.sync('tmp/*.js', { dryRun: true }); +paths = del.sync('tmp/*.js', { concurrency: 20 }); +paths = del.sync('tmp/*.js', { cwd: '' }); -paths = del.sync("tmp/*.js"); -paths = del.sync("tmp/*.js", {force: true}); -paths = del.sync("tmp/*.js", {dryRun: true}); -paths = del.sync("tmp/*.js", {concurrency: 20}); -paths = del.sync("tmp/*.js", {cwd: ''}); +const immutable: ReadonlyArray = ['tmp/*.js', '!tmp/unicorn.js']; +const mutable = del(immutable); +const mutablePaths = del.sync(immutable); +mutable.then(paths => paths.push('test')); +mutablePaths.push('test'); diff --git a/types/del/index.d.ts b/types/del/index.d.ts index e3c250e69b..ec92f96c84 100644 --- a/types/del/index.d.ts +++ b/types/del/index.d.ts @@ -3,14 +3,21 @@ // Definitions by: Asana // Aya Morisawa // BendingBender +// Jason Dreyzehner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import glob = require("glob"); +import glob = require('glob'); -declare function del(patterns: string | string[], options?: del.Options): Promise; +declare function del( + patterns: string | ReadonlyArray, + options?: del.Options +): Promise; declare namespace del { - function sync(patterns: string | string[], options?: Options): string[]; + function sync( + patterns: string | ReadonlyArray, + options?: Options + ): string[]; interface Options extends glob.IOptions { force?: boolean; From c26e70977e412cdcb7367d59b7936ac848ebb2d8 Mon Sep 17 00:00:00 2001 From: Ulf Schwekendiek Date: Sun, 11 Mar 2018 16:44:49 -0700 Subject: [PATCH 0041/2153] Adding missing ContentState argument to draft decorators See https://github.com/facebook/draft-js/blob/master/src/model/decorators/DraftDecoratorType.js --- types/draft-js/draft-js-tests.tsx | 29 ++++++++++++++++++++++++++--- types/draft-js/index.d.ts | 5 +++-- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/types/draft-js/draft-js-tests.tsx b/types/draft-js/draft-js-tests.tsx index 63821eda98..857671d13d 100644 --- a/types/draft-js/draft-js-tests.tsx +++ b/types/draft-js/draft-js-tests.tsx @@ -22,7 +22,8 @@ import { DraftEntityMutability, DraftEntityType, convertFromHTML, - convertToRaw + convertToRaw, + CompositeDecorator, } from 'draft-js'; const SPLIT_HEADER_BLOCK = 'split-header-block'; @@ -38,6 +39,14 @@ export const KEYCODES: Record = { type SyntheticKeyboardEvent = React.KeyboardEvent<{}>; +const HANDLE_REGEX = /\@[\w]+/g; + +class HandleSpan extends React.Component { + render() { + return {this.props.children} + } +} + class RichEditorExample extends React.Component<{}, { editorState: EditorState }> { constructor() { super({}); @@ -51,8 +60,22 @@ class RichEditorExample extends React.Component<{}, { editorState: EditorState } blocksFromHTML.contentBlocks, blocksFromHTML.entityMap, ); - - this.state = { editorState: EditorState.createWithContent(state) }; + const decorator = new CompositeDecorator([{ + strategy: ( + block: ContentBlock, + callback: (start: number, end: number) => void, + contentState: ContentState + ) => { + const text = block.getText(); + let matchArr, start; + while ((matchArr = HANDLE_REGEX.exec(text)) !== null) { + start = matchArr.index; + callback(start, start + matchArr[0].length); + } + }, + component: HandleSpan, + }]); + this.state = { editorState: EditorState.createWithContent(state, decorator) }; } onChange: (editorState: EditorState) => void = (editorState: EditorState) => this.setState({ editorState }); diff --git a/types/draft-js/index.d.ts b/types/draft-js/index.d.ts index e545fa347d..749841e71d 100644 --- a/types/draft-js/index.d.ts +++ b/types/draft-js/index.d.ts @@ -7,6 +7,7 @@ // Michael Wu // Willis Plummer // Santiago Vilar +// Ulf Schwekendiek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -398,7 +399,7 @@ declare namespace Draft { /** * Given a `ContentBlock`, return an immutable List of decorator keys. */ - getDecorations(block: ContentBlock): Immutable.List; + getDecorations(block: ContentBlock, contentState: ContentState): Immutable.List; /** * Given a decorator key, return the component to use when rendering @@ -456,7 +457,7 @@ declare namespace Draft { class CompositeDraftDecorator { constructor(decorators: Array); - getDecorations(block: ContentBlock): Immutable.List; + getDecorations(block: ContentBlock, contentState: ContentState): Immutable.List; getComponentForKey(key: string): Function; getPropsForKey(key: string): Object; } From 822ee026b2a11eeb85070b95d989d931047340b4 Mon Sep 17 00:00:00 2001 From: Ulf Schwekendiek Date: Sun, 11 Mar 2018 16:50:53 -0700 Subject: [PATCH 0042/2153] increase version number --- types/draft-js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/draft-js/index.d.ts b/types/draft-js/index.d.ts index 749841e71d..8227088418 100644 --- a/types/draft-js/index.d.ts +++ b/types/draft-js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Draft.js v0.10.4 +// Type definitions for Draft.js v0.10.5 // Project: https://facebook.github.io/draft-js/ // Definitions by: Dmitry Rogozhny // Eelco Lempsink From 2c742a405926c84884e4bb5c718b799e60294530 Mon Sep 17 00:00:00 2001 From: DABH Date: Mon, 12 Mar 2018 05:56:10 +0000 Subject: [PATCH 0043/2153] should be v1.2.1; v1.2.0 had an issue with npm pubilsh --- notNeededPackages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notNeededPackages.json b/notNeededPackages.json index 06417dd58d..5c649d2368 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -238,7 +238,7 @@ "libraryName": "colors.js (colors)", "typingsPackageName": "colors", "sourceRepoURL": "https://github.com/Marak/colors.js", - "asOfVersion": "1.2.0" + "asOfVersion": "1.2.1" }, { "libraryName": "commander", From 8dda31f4f0a1e583cfc20159d0ec3fcacfc0b1c1 Mon Sep 17 00:00:00 2001 From: Fredrik Nicol Date: Mon, 12 Mar 2018 08:49:18 +0100 Subject: [PATCH 0044/2153] Add length to expanded properties --- types/jss/css.d.ts | 232 +++++++++++++++++++++++---------------------- 1 file changed, 118 insertions(+), 114 deletions(-) diff --git a/types/jss/css.d.ts b/types/jss/css.d.ts index 3f01be6a62..3e5f81c582 100644 --- a/types/jss/css.d.ts +++ b/types/jss/css.d.ts @@ -1,130 +1,134 @@ // These CSS typings adapted from TypeStyle: https://github.com/typestyle/typestyle -import { Observable } from './observable' -import * as csstype from 'csstype' +import { Observable } from './observable'; +import * as csstype from 'csstype'; + +type Length = string | number; export type ObservableProperties

    = { - [K in keyof P]: P[K] | Observable -} + [K in keyof P]: P[K] | Observable +}; export type CSSProperties = - & ObservableProperties> - & ObservableProperties>; + & ObservableProperties> + & ObservableProperties>; export interface JssProps { - '@global'?: CSSProperties; - extend?: string; - composes?: string | string[]; + '@global'?: CSSProperties; + extend?: string; + composes?: string | string[]; } export interface JssExpand { - animation: - | { - delay: CSSProperties['animationDelay']; - direction: CSSProperties['animationDirection']; - duration: CSSProperties['animationDuration']; - iterationCount: CSSProperties['animationIterationCount']; - name: CSSProperties['animationName']; - playState: CSSProperties['animationPlayState']; - timingFunction: any; - } - | CSSProperties['animation']; - background: - | { - attachment: CSSProperties['backgroundAttachment']; - color: CSSProperties['backgroundColor']; - image: CSSProperties['backgroundImage']; - position: CSSProperties['backgroundPosition'] | number[]; // Can be written using array e.g. `[0 0]` - repeat: CSSProperties['backgroundRepeat']; - size: Array; // Can be written using array e.g. `['center' 'center']` - } - | CSSProperties['background']; - border: - | { - color: CSSProperties['borderColor']; - style: CSSProperties['borderStyle']; - width: CSSProperties['borderWidth']; - } - | CSSProperties['border']; - boxShadow: - | { - x: any; - y: any; - blur: any; - spread: any; - color: CSSProperties['color']; - inset?: 'inset'; // If you want to add inset you need to write "inset: 'inset'" - } - | CSSProperties['boxShadow']; - flex: - | { - basis: CSSProperties['flexBasis']; - direction: CSSProperties['flexDirection']; - flow: CSSProperties['flexFlow']; - grow: CSSProperties['flexGrow']; - shrink: CSSProperties['flexShrink']; - wrap: CSSProperties['flexWrap']; - } - | CSSProperties['flex']; - font: - | { - family: CSSProperties['fontFamily']; - size: CSSProperties['fontSize']; - stretch: CSSProperties['fontStretch']; - style: CSSProperties['fontStyle']; - variant: CSSProperties['fontVariant']; - weight: CSSProperties['fontWeight']; - } - | CSSProperties['font']; - listStyle: - | { - image: CSSProperties['listStyleImage']; - position: CSSProperties['listStylePosition']; - type: CSSProperties['listStyleType']; - } - | CSSProperties['listStyle']; - margin: - | { - bottom: CSSProperties['marginBottom']; - left: CSSProperties['marginLeft']; - right: CSSProperties['marginRight']; - top: CSSProperties['marginTop']; - } - | CSSProperties['margin']; - padding: - | { - bottom: CSSProperties['paddingBottom']; - left: CSSProperties['paddingLeft']; - right: CSSProperties['paddingRight']; - top: CSSProperties['paddingTop']; - } - | CSSProperties['padding']; - outline: - | { - color: CSSProperties['outlineColor']; - style: 'none' | 'hidden' | 'dotted' | 'dashed' | 'solid' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset'; - width: any; - } - | CSSProperties['outline']; - textShadow: - | { - x: any; - y: any; - blur: any; - color: CSSProperties['color']; - } - | CSSProperties['textShadow']; - transition: - | { - delay: CSSProperties['transitionDelay']; - duration: CSSProperties['transitionDuration']; - property: CSSProperties['transitionProperty']; - timingFunction: CSSProperties['transitionTimingFunction']; - } - | CSSProperties['transition']; + animation: + | { + delay: CSSProperties['animationDelay']; + direction: CSSProperties['animationDirection']; + duration: CSSProperties['animationDuration']; + iterationCount: CSSProperties['animationIterationCount']; + name: CSSProperties['animationName']; + playState: CSSProperties['animationPlayState']; + timingFunction: CSSProperties['animationTimingFunction']; + } + | CSSProperties['animation']; + background: + | { + attachment: CSSProperties['backgroundAttachment']; + color: CSSProperties['backgroundColor']; + image: CSSProperties['backgroundImage']; + position: CSSProperties['backgroundPosition'] | number[]; // Can be written using array e.g. `[0 0]` + repeat: CSSProperties['backgroundRepeat']; + size: + | CSSProperties['backgroundSize'] + | Array; // Can be written using array e.g. `['center' 'center']` + } + | CSSProperties['background']; + border: + | { + color: CSSProperties['borderColor']; + style: CSSProperties['borderStyle']; + width: CSSProperties['borderWidth']; + } + | CSSProperties['border']; + boxShadow: + | { + x: Length; + y: Length; + blur: Length; + spread: Length; + color: CSSProperties['color']; + inset?: 'inset'; // If you want to add inset you need to write 'inset: 'inset'' + } + | CSSProperties['boxShadow']; + flex: + | { + basis: CSSProperties['flexBasis']; + direction: CSSProperties['flexDirection']; + flow: CSSProperties['flexFlow']; + grow: CSSProperties['flexGrow']; + shrink: CSSProperties['flexShrink']; + wrap: CSSProperties['flexWrap']; + } + | CSSProperties['flex']; + font: + | { + family: CSSProperties['fontFamily']; + size: CSSProperties['fontSize']; + stretch: CSSProperties['fontStretch']; + style: CSSProperties['fontStyle']; + variant: CSSProperties['fontVariant']; + weight: CSSProperties['fontWeight']; + } + | CSSProperties['font']; + listStyle: + | { + image: CSSProperties['listStyleImage']; + position: CSSProperties['listStylePosition']; + type: CSSProperties['listStyleType']; + } + | CSSProperties['listStyle']; + margin: + | { + bottom: CSSProperties['marginBottom']; + left: CSSProperties['marginLeft']; + right: CSSProperties['marginRight']; + top: CSSProperties['marginTop']; + } + | CSSProperties['margin']; + padding: + | { + bottom: CSSProperties['paddingBottom']; + left: CSSProperties['paddingLeft']; + right: CSSProperties['paddingRight']; + top: CSSProperties['paddingTop']; + } + | CSSProperties['padding']; + outline: + | { + color: CSSProperties['outlineColor']; + style: CSSProperties['outlineStyle']; + width: CSSProperties['outlineWidth']; + } + | CSSProperties['outline']; + textShadow: + | { + x: Length; + y: Length; + blur: Length; + color: CSSProperties['color']; + } + | CSSProperties['textShadow']; + transition: + | { + delay: CSSProperties['transitionDelay']; + duration: CSSProperties['transitionDuration']; + property: CSSProperties['transitionProperty']; + timingFunction: CSSProperties['transitionTimingFunction']; + } + | CSSProperties['transition']; } export type JssExpandArr = { [k in keyof JssExpand]?: JssExpand[k] | Array }; export type SimpleStyle = CSSProperties & JssProps & JssExpandArr; -export type Style = SimpleStyle | Observable>; +export type Style = SimpleStyle | Observable>; From 26ca06f493969175e10f7b96260e1fc40a453cd4 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 12 Mar 2018 13:20:20 +0100 Subject: [PATCH 0045/2153] Add type for getFinalCoverage http://gotwarlost.github.io/istanbul/public/apidocs/files/lib_collector.js.html#l97 --- types/istanbul/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/istanbul/index.d.ts b/types/istanbul/index.d.ts index ee23e27782..fe45802865 100644 --- a/types/istanbul/index.d.ts +++ b/types/istanbul/index.d.ts @@ -24,6 +24,7 @@ declare namespace istanbul { interface Collector { new (options?: any): Collector; add(coverage: any, testName?: string): void; + getFinalCoverage(): any; } interface Config { From 46673df4bb096c17b876f83f771127b585131663 Mon Sep 17 00:00:00 2001 From: Calum MacRae Date: Mon, 12 Mar 2018 15:41:33 +0000 Subject: [PATCH 0046/2153] Return date --- types/twix/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/twix/index.d.ts b/types/twix/index.d.ts index 8ca402e8e6..5b37054eb9 100644 --- a/types/twix/index.d.ts +++ b/types/twix/index.d.ts @@ -80,6 +80,7 @@ export interface Twix { asDuration(period: string): Duration; isValid(): boolean; + toDate(): Date; } export interface TwixStatic { From 73cbb770780005e11a3bbb71dd66ea76d1b7553e Mon Sep 17 00:00:00 2001 From: frantic1048 Date: Tue, 13 Mar 2018 15:30:21 +0800 Subject: [PATCH 0047/2153] yup: add definition for `.notRequired()` added in 0.24.1 --- types/yup/index.d.ts | 1 + types/yup/yup-tests.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/types/yup/index.d.ts b/types/yup/index.d.ts index e6dc35c1ea..c8c3f2dda4 100644 --- a/types/yup/index.d.ts +++ b/types/yup/index.d.ts @@ -46,6 +46,7 @@ export interface Schema { default(value?: any): this; nullable(isNullable: boolean): this; required(message?: string): this; + notRequired(): this; typeError(message?: string): this; oneOf(arrayOfValues: any[], message?: string): this; notOneOf(arrayOfValues: any[], message?: string): this; diff --git a/types/yup/yup-tests.ts b/types/yup/yup-tests.ts index 9dd02ced73..0c0aa04c47 100644 --- a/types/yup/yup-tests.ts +++ b/types/yup/yup-tests.ts @@ -100,6 +100,7 @@ mixed.default(() => ({ number: 5})); mixed.default(); mixed.nullable(true); mixed.required(); +mixed.notRequired(); // $ExpectType MixedSchema mixed.typeError('type error'); mixed.oneOf(['hello', 'world'], 'message'); mixed.notOneOf(['hello', 'world'], 'message'); From c86365e2fc5609b466de1636a02234a90ff4e64a Mon Sep 17 00:00:00 2001 From: Leonard Thieu Date: Thu, 1 Mar 2018 18:30:34 +0300 Subject: [PATCH 0048/2153] react-select typings update: - defaultMenuRenderer - Option component - other minor updates --- types/react-select/index.d.ts | 21 +++++- types/react-select/lib/Option/index.d.ts | 5 ++ .../lib/utils/defaultMenuRenderer/index.d.ts | 3 + types/react-select/react-select-tests.tsx | 74 ++++++++++++++++++- types/react-select/tsconfig.json | 4 +- 5 files changed, 104 insertions(+), 3 deletions(-) create mode 100644 types/react-select/lib/Option/index.d.ts create mode 100644 types/react-select/lib/utils/defaultMenuRenderer/index.d.ts diff --git a/types/react-select/index.d.ts b/types/react-select/index.d.ts index d256bb437e..d5383d3d86 100644 --- a/types/react-select/index.d.ts +++ b/types/react-select/index.d.ts @@ -11,6 +11,7 @@ // Ian Johnson // Anton Novik // David Schkalee +// Arthur Udalov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -18,12 +19,15 @@ import * as React from 'react'; export default class ReactSelectClass extends React.Component> { focus(): void; + setValue(value: Option): void; } // Other components export class Creatable extends React.Component> { } export class Async extends React.Component> { } export class AsyncCreatable extends React.Component & ReactCreatableSelectProps> { } +export type OptionComponentType = React.ComponentType>; + export type HandlerRendererResult = JSX.Element | null | false; // Handlers @@ -128,6 +132,16 @@ export interface MenuRendererProps { * Array of currently selected options. */ valueArray: Options; + + /** + * Callback to remove selection from option; receives the option as a parameter. + */ + removeValue: SelectValueHandler; + + /** + * function which returns a custom way to render the options in the menu + */ + optionRenderer: OptionRendererHandler; } export interface OptionComponentProps { @@ -196,6 +210,11 @@ export interface ArrowRendererProps { * Arrow mouse down event handler. */ onMouseDown: React.MouseEventHandler; + + /** + * whether the Select is open or not. + */ + isOpen: boolean; } export interface ReactSelectProps extends React.Props> { @@ -449,7 +468,7 @@ export interface ReactSelectProps extends React.Props>; + optionComponent?: OptionComponentType; /** * function which returns a custom way to render the options in the menu */ diff --git a/types/react-select/lib/Option/index.d.ts b/types/react-select/lib/Option/index.d.ts new file mode 100644 index 0000000000..0f9e97d540 --- /dev/null +++ b/types/react-select/lib/Option/index.d.ts @@ -0,0 +1,5 @@ +import { OptionComponentType } from '../../'; + +declare const OptionComponent: OptionComponentType; + +export default OptionComponent; diff --git a/types/react-select/lib/utils/defaultMenuRenderer/index.d.ts b/types/react-select/lib/utils/defaultMenuRenderer/index.d.ts new file mode 100644 index 0000000000..baf530d59d --- /dev/null +++ b/types/react-select/lib/utils/defaultMenuRenderer/index.d.ts @@ -0,0 +1,3 @@ +import { MenuRendererProps } from '../../../'; + +export default function defaultMenuRenderer(props: MenuRendererProps): JSX.Element[]; diff --git a/types/react-select/react-select-tests.tsx b/types/react-select/react-select-tests.tsx index 3635fe3145..a6b450f513 100644 --- a/types/react-select/react-select-tests.tsx +++ b/types/react-select/react-select-tests.tsx @@ -1,5 +1,7 @@ import * as React from "react"; import ReactSelect, * as ReactSelectModule from "react-select"; +import defaultMenuRenderer from 'react-select/lib/utils/defaultMenuRenderer'; +import DefaultOptionComponent from 'react-select/lib/Option'; declare function describe(desc: string, f: () => void): void; declare function it(desc: string, f: () => void): void; @@ -126,6 +128,22 @@ describe("react-select", () => { } }); + it("setValue method", () => { + class Component extends React.PureComponent { + private readonly selectRef = (component: ReactSelect) => { + component.setValue({ + value: 'value' + }); + } + + render() { + return ; + } + } + }); + it("Overriding default key-down behavior with onInputKeyDown", () => { const keyDownHandler: ReactSelectModule.OnInputKeyDownHandler = (event => { const divEvent = event as React.KeyboardEvent; @@ -246,7 +264,13 @@ describe("Examples", () => { private readonly menuRenderer: ReactSelectModule.MenuRendererHandler = props => { const options = props.options.map(option => { - return

    {option.label}
    ; + return ( +
    +
    {option.label}
    +
    {props.optionRenderer({})}
    +
    + ); }); return
    {options}
    ; @@ -289,6 +313,41 @@ describe("Examples", () => { } }); + it("Extend default menu renderer", () => { + return class Component extends React.Component { + private readonly menuRenderer: ReactSelectModule.MenuRendererHandler = props => { + return
    defaultMenuRenderer(props)
    ; + } + + render() { + return ; + } + }; + }); + + it("Extend default Option component", () => { + function OptionComponent(props: ReactSelectModule.OptionComponentProps) { + const {option, isFocused, isSelected} = props; + + return ( + + + {isSelected ? '+' : '-'} + {option.label} + + + ); + } + + return ( + + ); + }); + it("Input render example", () => { class Component extends React.Component { private readonly onSelectChange: ReactSelectModule.OnChangeSingleHandler = option => { @@ -330,6 +389,19 @@ describe("Examples", () => { />; }); + it("Arrow render example", () => { + return ( + ( +
    + )} + /> + ); + }); + it("Option render with custom value option", () => { const optionRenderer = (option: ReactSelectModule.Option): ReactSelectModule.HandlerRendererResult => null; diff --git a/types/react-select/tsconfig.json b/types/react-select/tsconfig.json index 727747e72c..7855eceaf1 100644 --- a/types/react-select/tsconfig.json +++ b/types/react-select/tsconfig.json @@ -1,6 +1,8 @@ { "files": [ "index.d.ts", + "lib/Option/index.d.ts", + "lib/utils/defaultMenuRenderer/index.d.ts", "react-select-tests.tsx" ], "compilerOptions": { @@ -22,4 +24,4 @@ "noEmit": true, "forceConsistentCasingInFileNames": true } -} \ No newline at end of file +} From 8e98757a32779cbc0c4a4fb260d490c9ad70f9ec Mon Sep 17 00:00:00 2001 From: Andyma <66229754@qq.com> Date: Wed, 14 Mar 2018 14:05:27 +0800 Subject: [PATCH 0049/2153] Update index.d.ts Change accordingly to datatable. --- types/datatables.net/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/datatables.net/index.d.ts b/types/datatables.net/index.d.ts index cdddc98789..7941d0586f 100644 --- a/types/datatables.net/index.d.ts +++ b/types/datatables.net/index.d.ts @@ -1297,7 +1297,7 @@ declare namespace DataTables { /** * Data to use as the display data for the table. Since: 1.10 */ - data?: object; + data?: Object[]; //#endregion "Data" @@ -1931,6 +1931,7 @@ declare namespace DataTables { } interface ColumnLegacy { + idx: number; aDataSort: any; asSorting: string[]; bSearchable: boolean; From 68e71f096b02e611a134fb7b571fb0a6075dfefb Mon Sep 17 00:00:00 2001 From: Andyma <66229754@qq.com> Date: Wed, 14 Mar 2018 14:46:17 +0800 Subject: [PATCH 0050/2153] Update index.d.ts Add style api --- types/datatables.net-select/index.d.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/types/datatables.net-select/index.d.ts b/types/datatables.net-select/index.d.ts index e24f6b8ab6..5ceac21eaf 100644 --- a/types/datatables.net-select/index.d.ts +++ b/types/datatables.net-select/index.d.ts @@ -46,4 +46,17 @@ declare namespace DataTables { */ style?: string; } + + interface Api { + select: { + /* + * Get the current selection style applied to the table + */ + style(): string; + /* + * Set the table's selection style + */ + style(s: "api" | "single" | "multi" | "os"): Api; + } + } } From 50f05dff6452f785ad9f4e2cba9cea52cc0f7a27 Mon Sep 17 00:00:00 2001 From: Andyma <66229754@qq.com> Date: Wed, 14 Mar 2018 14:51:26 +0800 Subject: [PATCH 0051/2153] Update index.d.ts --- types/datatables.net-select/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/datatables.net-select/index.d.ts b/types/datatables.net-select/index.d.ts index 5ceac21eaf..aa68f64969 100644 --- a/types/datatables.net-select/index.d.ts +++ b/types/datatables.net-select/index.d.ts @@ -44,7 +44,7 @@ declare namespace DataTables { /* * Set the selection style for end user interaction with the table */ - style?: string; + style?: "api" | "single" | "multi" | "os" | "multi+shift"; } interface Api { From 2b79d89122b30b01ad4b09a7955567ea0ec3563a Mon Sep 17 00:00:00 2001 From: George Date: Wed, 14 Mar 2018 11:40:49 +0300 Subject: [PATCH 0052/2153] Removed dubplicated TSError: Duplicate identifier 'original'. --- types/react-table/index.d.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/types/react-table/index.d.ts b/types/react-table/index.d.ts index 20a1c5a1fb..cc7e2f48e1 100644 --- a/types/react-table/index.d.ts +++ b/types/react-table/index.d.ts @@ -645,9 +645,6 @@ export interface RowInfo { /** An array of any expandable sub-rows contained in this row */ subRows: any[]; - - /** Original object passed to row */ - original: any; } export interface FinalState extends TableProps { From bc2147e2b91880f8bfc1d6ba27bd72d6d8bcacb6 Mon Sep 17 00:00:00 2001 From: Alban Gicquel Date: Mon, 26 Feb 2018 16:44:43 -0500 Subject: [PATCH 0053/2153] Added support for async return types being promises as stipulated by inquirer doc --- types/inquirer/index.d.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/types/inquirer/index.d.ts b/types/inquirer/index.d.ts index 67d8fd29ac..37141876a7 100644 --- a/types/inquirer/index.d.ts +++ b/types/inquirer/index.d.ts @@ -4,6 +4,7 @@ // Parvez // Jouderian // Qibang +// Synarque // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -89,29 +90,29 @@ declare namespace inquirer { * Default value(s) to use if nothing is entered, or a function that returns the default value(s). * If defined as a function, the first parameter will be the current inquirer session answers. */ - default?: any | ((answers: T) => any); + default?: any | ((answers: T) => any) | ((answers: T) => Promise); /** * Choices array or a function returning a choices array. If defined as a function, * the first parameter will be the current inquirer session answers. * Array values can be simple strings, or objects containing a name (to display) and a value properties * (to save in the answers hash). Values can also be a Separator. */ - choices?: ChoiceType[] | ((answers: T) => ChoiceType[]); + choices?: ChoiceType[] | ((answers: T) => ChoiceType[]) | ((answers: T) => Promise); /** * Receive the user input and should return true if the value is valid, and an error message (String) * otherwise. If false is returned, a default error message is provided. */ - validate?(input: string, answers?: T): boolean | string; + validate?(input: string, answers?: T): boolean | string | Promise; /** * Receive the user input and return the filtered value to be used inside the program. * The value returned will be added to the Answers hash. */ - filter?(input: string): string; + filter?(input: string): string | Promise; /** * Receive the current user answers hash and should return true or false depending on whether or * not this question should be asked. The value can also be a simple boolean. */ - when?: boolean | ((answers: T) => boolean); + when?: boolean | ((answers: T) => boolean) | ((answers: T) => Promise); paginated?: boolean; /** * Change the number of lines that will be rendered when using list, rawList, expand or checkbox. From b31ffd962e2563b73599a721b2cd9ab0f35ceb41 Mon Sep 17 00:00:00 2001 From: stephentuso Date: Wed, 14 Mar 2018 16:17:27 -0400 Subject: [PATCH 0054/2153] [dynogels] Fix return type for Item#get --- types/dynogels/dynogels-tests.ts | 6 ++++-- types/dynogels/index.d.ts | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/types/dynogels/dynogels-tests.ts b/types/dynogels/dynogels-tests.ts index ca16707256..a7634548e7 100644 --- a/types/dynogels/dynogels-tests.ts +++ b/types/dynogels/dynogels-tests.ts @@ -148,12 +148,14 @@ dynogels.dynamoDriver(dynamodb); // Saving Models To DynamoDB Account.create({ email: 'foo@example.com', name: 'Foo Bar', age: 21 }, (err, acc) => { - acc.get('email'); + const email = acc.get('email') as string; + console.log(`Created account ${email}`); }); const acc = new Account({ email: 'test@example.com', name: 'Test Example' }); acc.save((err) => { - acc.get('email'); + const email = acc.get('email') as string; + console.log(`Created account ${email}`); }); BlogPost.create({ diff --git a/types/dynogels/index.d.ts b/types/dynogels/index.d.ts index 2e4c5acbf4..ea82c74609 100644 --- a/types/dynogels/index.d.ts +++ b/types/dynogels/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for dynogels 8.0 +// Type definitions for dynogels 9.0 // Project: https://github.com/clarkie/dynogels#readme // Definitions by: Spartan Labs +// Stephen Tuso // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -152,7 +153,8 @@ export interface ModelConfig { // Dynogels Item export interface Item { - get(key?: string): { [key: string]: any }; + get(): { [key: string]: any }; + get(key: string): any; set(params: {}): Item; save(callback?: DynogelsItemCallback): void; update(options: UpdateItemOptions, callback?: DynogelsItemCallback): void; From 821905199ee36b1296938d74dd27b2a772ec8773 Mon Sep 17 00:00:00 2001 From: ckboyjiy Date: Thu, 15 Mar 2018 15:32:57 +0900 Subject: [PATCH 0055/2153] Added type definitions for Naver maps --- navermaps/index.d.ts | 1354 ++++++++++++++++++++++++++++++++++ navermaps/navermaps-tests.ts | 148 ++++ navermaps/tsconfig.json | 24 + navermaps/tslint.json | 79 ++ 4 files changed, 1605 insertions(+) create mode 100644 navermaps/index.d.ts create mode 100644 navermaps/navermaps-tests.ts create mode 100644 navermaps/tsconfig.json create mode 100644 navermaps/tslint.json diff --git a/navermaps/index.d.ts b/navermaps/index.d.ts new file mode 100644 index 0000000000..a367238bf1 --- /dev/null +++ b/navermaps/index.d.ts @@ -0,0 +1,1354 @@ +// Definitions by: Ckboyjiy +// Type definitions for Naver Maps JavaScript API 3.0 +// Project: https://navermaps.github.io +// Definitions by: Ckboyjiy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +declare namespace naver.maps { + /** + * Types + */ + type PointArrayLiteral = [number, number]; + type PointLiteral = naver.maps.PointArrayLiteral | naver.maps.PointObjectLiteral; + type SizeArrayLiteral = [number, number]; + type SizeLiteral = naver.maps.SizeArrayLiteral | naver.maps.SizeObjectLiteral; + type LatLngLiteral = naver.maps.PointLiteral | naver.maps.LatLngObjectLiteral; + type PointBoundsArrayLiteral = [number, number, number, number]; + type PointBoundsLiteral = naver.maps.PointBoundsArrayLiteral | naver.maps.PointBoundsObjectLiteral; + type LatLngBoundsLiteral = naver.maps.PointBoundsLiteral | naver.maps.LatLngBoundsObjectLiteral; + type BoundsLiteral = naver.maps.PointBoundsLiteral | naver.maps.LatLngBoundsLiteral; + type CoordLiteral = naver.maps.PointLiteral | naver.maps.LatLngLiteral; + type Coord = naver.maps.Point | naver.maps.LatLng; + type Bounds = naver.maps.PointBounds | naver.maps.LatLngBounds; + type DOMEvent = Event; + type StylingFunction = (feature: naver.maps.Feature) => naver.maps.StyleOptions; + type ArrayOfCoords = naver.maps.Point[] | naver.maps.LatLng[]; + type ArrayOfBounds = naver.maps.PointBounds[] | naver.maps.LatLngBounds[]; + type ArrayOfBoundsLiteral = naver.maps.PointBoundsLiteral[] | naver.maps.LatLngBoundsLiteral[]; + type forEachOverlayCallback = (overlay: naver.maps.Marker | naver.maps.Polyline | naver.maps.Polygon, index: number) => void; + type GeoJSON = object; + type GPX = object; + type KML = object; + type KVOArrayOfCoords = any; + type ArrayOfCoordsLiteral = naver.maps.PointLiteral[] | naver.maps.LatLngLiteral[]; + type strokeStyleType = 'solid' | 'shortdash' | 'shortdot' | 'shortdashdot' | 'shortdashdotdot' | 'dot' | 'dash' | + 'longdash' | 'dashdot' | 'longdashdot' | 'longdashdotdot'; + type strokeLineCapType = 'butt' | 'round' | 'square'; + type strokeLineJoinType = 'miter' | 'round ' | 'bevel'; + + /** + * Interfaces + */ + export interface PointObjectLiteral { + x: number; + y: number; + } + export interface SizeObjectLiteral { + width: number; + height: number; + } + export interface LatLngObjectLiteral { + lat: number; + lng: number; + } + export interface PointBoundsObjectLiteral { + minX: number; + minY: number; + maxX: number; + maxY: number; + } + export interface LatLngBoundsObjectLiteral { + north: number; + east: number; + south: number; + west: number; + } + export interface MapSystemProjection extends KVO { + factor(zoom: number): number; + fromCoordToOffset(coord: naver.maps.Coord): naver.maps.Point; + fromCoordToPoint(coord: naver.maps.Coord): naver.maps.Point; + fromOffsetToCoord(offset: naver.maps.Point): naver.maps.Coord; + fromOffsetToPoint(offset: naver.maps.Point): naver.maps.Point; + fromPointToCoord(point: naver.maps.Point): naver.maps.Coord; + fromPointToOffset(point: naver.maps.Point): naver.maps.Point; + getDestinationCoord(fromCoord: naver.maps.Coord, angle: number, meter: number): naver.maps.Coord; + getDistance(coord1: naver.maps.Coord, coord2: naver.maps.Coord): number; + getProjectionName(): number; + scaleDown(operand: number | naver.maps.Point | naver.maps.Size, zoom: number): number | naver.maps.Point | naver.maps.Size; + scaleUp(operand: number | naver.maps.Point | naver.maps.Size, zoom: number): number | naver.maps.Point | naver.maps.Size; + + } + export interface MapOptions { + background?: string; + baseTileOpacity?: number; + bounds?: any; + center?: any; + disableDoubleClickZoom?: boolean; + disableDoubleTapZoom?: boolean; + disableKineticPan?: boolean; + disableTwoFingerTapZoom?: boolean; + draggable?: boolean; + keyboardShortcuts?: boolean; + logoControl?: boolean; + logoControlOptions?: any; + mapDataControl?: boolean; + mapDataControlOptions?: any; + mapTypeControl?: boolean; + mapTypeControlOptions?: any; + mapTypeId?: string; + mapTypes?: any; + maxBounds?: any; + maxZoom?: number; + minZoom?: number; + padding?: any; + pinchZoom?: boolean; + resizeOrigin?: any; + scaleControl?: boolean; + scaleControlOptions?: any; + scrollWheel?: boolean; + size?: any; + overlayZoomEffect?: null | string; + tileSpare?: number; + tileTransition?: boolean; + zoom?: number; + zoomControl?: boolean; + zoomControlOptions?: any; + zoomOrigin?: any; + } + export interface MarkerOptions { + animation?: any; + map?: Map; + position?: any; + icon?: any; + shape?: any; + title?: string; + cursor?: string; + clickable?: boolean; + draggable?: boolean; + visible?: boolean; + zIndex?: number; + } + export interface MapPanes { + overlayLayer: HTMLElement; + overlayImage: HTMLElement; + floatPane: HTMLElement; + } + export interface MapEventListener { + eventName: string; + listener: Function; + listenerId: string; + target: object; + } + export interface InfoWindowOptions { + position: naver.maps.Coord | naver.maps.CoordLiteral; + content: string | HTMLElement; + zIndex?: number; + maxWidth?: number; + pixelOffset?: naver.maps.Point | naver.maps.PointLiteral; + backgroundColor?: string; + borderColor?: string; + borderWidth?: number; + disableAutoPan?: boolean; + disableAnchor?: boolean; + anchorSkew?: boolean; + anchorSize?: naver.maps.Size | naver.maps.SizeLiteral; + anchorColor?: string; + } + export interface ImageTileOptions { + urls: string[]; + imgonload?: Function; + imgonerror?: Function; + opacity?: number; + transition?: boolean; + offset?: naver.maps.Point; + zIndex?: number; + size?: naver.maps.Size; + pane?: HTMLElement; + } + export interface ImageMapTypeOptions { + name: string; + maxZoom: number; + minZoom: number; + projection: naver.maps.Projection; + tileSize?: naver.maps.Size | naver.maps.SizeLiteral; + repeatX?: boolean; + vendor?: string; + provider?: naver.maps.MapDataProvider; + uid?: string; + darktheme?: boolean; + getTileUrl?: Function; + tileSet?: string | string[]; + } + export interface GroundOverlayOptions { + clickable?: boolean; + map?: naver.maps.Map | null; + opacity?: number; + } + export interface EllipseOptions { + map?: naver.maps.Map; + bounds: naver.maps.Bounds | naver.maps.BoundsLiteral; + strokeWeight?: number; + strokeOpacity?: number; + strokeColor?: string; + strokeStyle?: naver.maps.strokeStyleType; + strokeLineCap?: naver.maps.strokeLineCapType; + strokeLineJoin?: naver.maps.strokeLineJoinType; + fillColor?: string; + fillOpacity?: number; + clickable?: boolean; + visible?: boolean; + zIndex?: number; + } + export interface FeatureEvent { + feature: naver.maps.Feature; + } + export interface PointerEvent { + coord: naver.maps.Coord; + point: naver.maps.Point; + offset: naver.maps.Point; + pointerEvent: naver.maps.DOMEvent; + feature: naver.maps.Feature; + } + export interface PropertyEvent { + feature: naver.maps.Feature; + name: string; + oldValue: any; + newValue: any; + } + export interface StyleOptions { + strokeColor?: string; + strokeOpacity?: number; + strokeWeight?: number; + fillColor?: string; + fillOpacity?: number; + clickable?: boolean; + icon?: string | naver.maps.ImageIcon | naver.maps.SymbolIcon | naver.maps.HtmlIcon; + shape?: naver.maps.MarkerShape; + title?: string; + visible?: boolean; + zIndex?: number; + } + export interface ControlOptions { + position: naver.maps.Position; + } + export interface CircleOptions { + map?: naver.maps.Map; + center: naver.maps.Coord | naver.maps.CoordLiteral; + radius?: number; + strokeWeight?: number; + strokeOpacity?: number; + strokeColor?: string; + strokeStyle?: naver.maps.strokeStyleType; + strokeLineCap?: naver.maps.strokeLineCapType; + strokeLineJoin?: naver.maps.strokeLineJoinType; + fillColor?: string; + fillOpacity?: number; + clickable?: boolean; + visible?: boolean; + zIndex?: number; + } + export interface TileOptions { + opacity?: number; + transition?: boolean; + offset?: naver.maps.Point; + zIndex?: number; + size?: naver.maps.Size; + pane?: HTMLElement; + } + export interface TileIndex { + xIndex: number; + yIndex: number; + } + export interface CanvasTileOptions { + imageData?: ImageData; + opacity?: number; + transition?: boolean; + offset?: naver.maps.Point; + zIndex?: number; + size?: naver.maps.Size; + pane?: HTMLElement; + } + export interface CanvasMapTypeOptions { + name: string; + maxZoom: number; + minZoom: number; + projection: naver.maps.Projection; + tileSize?: naver.maps.Size | naver.maps.SizeLiteral; + repeatX?: boolean; + vendor?: string; + provider?: naver.maps.MapDataProvider; + uid?: string; + darktheme?: boolean; + getTileData?: Function; + } + export interface MapDataProvider { + title: string; + link: string; + bounds: naver.maps.Bounds | naver.maps.BoundsLiteral | naver.maps.ArrayOfBounds | naver.maps.ArrayOfBoundsLiteral; + } + export interface MapType { + maxZoom: number; + minZoom: number; + name: string; + projection: naver.maps.Projection; + tileSize: naver.maps.Size; + getTile(x: number, y: number, z: number): HTMLElement | naver.maps.Tile; + } + export interface Projection { + fromCoordToPoint(coord: naver.maps.Coord): naver.maps.Point; + fromPointToCoord(point: naver.maps.Point): Coord; + } + export interface CadastralLayerOptions { + overlayMap?: boolean; + zIndex?: number; + } + export interface AroundControlOptions { + position: naver.maps.Position; + } + export interface NaverImageMapTypeOptions { + maxZoom?: number; + minZoom?: number; + projection?: naver.maps.Projection; + tileSize?: naver.maps.Size; + hd?: string; + } + export interface LogoControlOptions { + position: naver.maps.Position; + } + export interface MapDataControlOptions { + position: naver.maps.Position; + } + export interface MapTypeControlOptions { + mapTypeIds: naver.maps.MapTypeId[] | null; + position: naver.maps.Position; + style: naver.maps.MapTypeControlStyle; + } + export interface ScaleControlOptions { + position: naver.maps.Position; + } + export interface ZoomControlOptions { + position: naver.maps.Position; + style: naver.maps.ZoomControlStyle; + legendDisabled: boolean; + } + export interface LayerOptions { + hd: boolean; + overlayMap: boolean; + zIndex: number; + } + export interface CadastralLayerOptions { + overlayMap: boolean; + zIndex: number; + } + export interface StreetLayerOptions { + overlayMap: boolean; + zIndex: number; + } + export interface TrafficLayerOptions { + interval: number; + overlayMap: boolean; + zIndex: number; + } + export interface HtmlIcon { + content: string | HTMLElement; + size?: naver.maps.Size | naver.maps.SizeLiteral; + anchor?: naver.maps.Point | naver.maps.PointLiteral | naver.maps.Position; + } + export interface ImageIcon { + url: string; + size?: naver.maps.Size | naver.maps.SizeLiteral; + scaledSize?: naver.maps.Size |naver.maps. SizeLiteral; + origin?: naver.maps.Point | naver.maps.PointLiteral; + anchor?: naver.maps.Point | naver.maps.PointLiteral | naver.maps.Position; + } + export interface MarkerShape { + coords: any[]; + type: string; + } + export interface SymbolIcon { + path: naver.maps.SymbolPath | naver.maps.Point[] | naver.maps.PointLiteral[]; + style?: naver.maps.SymbolStyle; + radius?: number; + fillColor?: string; + fillOpacity?: number; + strokeColor?: string; + strokeWeight?: number; + strokeOpacity?: number; + anchor?: naver.maps.Point | naver.maps.PointLiteral | naver.maps.Position; + } + export interface PolygonOptions { + map?: naver.maps.Map; + paths: naver.maps.ArrayOfCoords[] | naver.maps.KVOArrayOfCoords[] | naver.maps.ArrayOfCoordsLiteral[]; + strokeWeight?: number; + strokeOpacity?: number; + strokeColor?: string; + strokeStyle?: naver.maps.strokeStyleType; + strokeLineCap?: naver.maps.strokeLineCapType; + strokeLineJoin?: naver.maps.strokeLineJoinType; + fillColor?: string; + fillOpacity?: number; + clickable?: boolean; + visible?: boolean; + zIndex?: number; + } + export interface PolylineOptions { + map?: naver.maps.Map; + path: naver.maps.ArrayOfCoords | naver.maps.KVOArrayOfCoords | naver.maps.ArrayOfCoordsLiteral; + strokeWeight?: number; + strokeOpacity?: number; + strokeColor?: string; + strokeStyle?: naver.maps.strokeStyleType; + strokeLineCap?: naver.maps.strokeLineCapType; + strokeLineJoin?: naver.maps.strokeLineJoinType; + clickable?: boolean; + visible?: boolean; + zIndex?: number; + startIcon?: naver.maps.PointingIcon; + startIconSize?: number; + endIcon?: naver.maps.PointingIcon; + endIconSize?: number; + } + export interface RectangleOptions { + map?: naver.maps.Map; + bounds: naver.maps.Bounds | naver.maps.BoundsLiteral; + strokeWeight?: number; + strokeOpacity?: number; + strokeColor?: string; + strokeStyle?: naver.maps.strokeStyleType; + strokeLineCap?: naver.maps.strokeLineCapType; + strokeLineJoin?: naver.maps.strokeLineJoinType; + fillColor?: string; + fillOpacity?: number; + clickable?: boolean; + visible?: boolean; + zIndex?: number; + } + export interface PanoramaOptions { + size: naver.maps.Size | naver.maps.SizeLiteral; + panoId: string; + position: naver.maps.LatLng | naver.maps.LatLngLiteral; + pov: naver.maps.PanoramaPov; + visible: boolean; + minScale: number; + maxScale: number; + minZoom: number; + maxZoom: number; + logoControl: boolean; + logoControlOptions: naver.maps.LogoControlOptions; + zoomControl: boolean; + zoomControlOptions: naver.maps.ZoomControlOptions; + aroundControl: boolean; + aroundControlOptions: naver.maps.AroundControlOptions; + } + export interface PanoramaPov { + pan: number; + tilt: number; + fov: number; + } + export interface PanoramaLocation { + panoId: string; + title: string; + address: string; + coord: naver.maps.LatLng; + photodate: string; + } + export interface DOMEventListener { + eventName: string; + listener: Function; + target: HTMLElement; + } + + /** + * Enums + */ + export enum MapTypeControlStyle { + BUTTON, + DROPDOWN + } + export enum ZoomControlStyle { + LARGE, + SMALL + } + + /** + * Members + */ + export enum Animation { + BOUNCE = 1, + DROP + } + let jsContentLoaded: boolean; + export enum MapTypeId { // TODO. 확실하지 않음 + NORMAL, + TERRAIN, + SATELLITE, + HYBRID + } + export function onJSContentLoaded(...args: any[]): any; + export enum PointingIcon { + OPEN_ARROW = 1, + BLOCK_ARROW, + CIRCLE, + DIAMOND + } + export enum Position { + CENTER = 0, + TOP_LEFT, + TOP_CENTER, + TOP_RIGHT, + LEFT_CENTER, + LEFT_TOP, + LEFT_BOTTOM, + RIGHT_TOP, + RIGHT_CENTER, + RIGHT_BOTTOM, + BOTTOM_LEFT, + BOTTOM_CENTER, + BOTTOM_RIGHT + } + export enum SymbolPath { + BACKWARD_CLOSED_ARROW = 1, + BACKWARD_OPEN_ARROW, + CIRCLE, + FORWARD_CLOSED_ARROW, + FORWARD_OPEN_ARROW + } + export enum SymbolStyle { + CIRCLE = 'circle', + PATH = 'path', + CLOSED_PATH = 'closedPath' + } + + /** + * Classes + */ + // KVO + export class KVO { + constructor(); + addListener(eventName: any, listener: Function): naver.maps.MapEventListener; + addListenerOnce(eventName: string | any, listener: Function): naver.maps.MapEventListener; + bindTo(key: string, target: naver.maps.KVO, targetKey?: string): void; + clearListeners(eventName: string): void; + get(key: string): any; + hasListener(eventName: string): boolean; + removeListener(listeners: naver.maps.MapEventListener | MapEventListener[]): void; + set(key: string, value: any, silently?: boolean): void; + setValues(properties: object): void; + trigger(eventName: string, eventObject?: any): void; + unbind(key: string): void; + unbindAll(): void; + } + export class KVOArray extends naver.maps.KVO { + constructor(array: any[]); + clear(): void; + forEach(callback: (element: any, index: number) => void): void; + getArray(): any[]; + getAt(index: number): any; + getIndexOfElement(element: any): number; + getLength(): number; + insertAt(index: number, element: any): void; + pop(): any; + push(element: any): number; + removeAt(index: number): any; + removeElement(element: any): void; + setAt(index: number, element: any): void; + splice(startIndex: number, deleteCount: number, element?: any): any[]; + } + // Base + export class Point { + constructor(x: number, y: number); + add(point: naver.maps.Coord | naver.maps.PointLiteral): naver.maps.Point; + add(x: number, y: number): naver.maps.Point; + ceil(): naver.maps.Point; + clone(): naver.maps.Point; + div(point: naver.maps.Coord | naver.maps.PointLiteral); + div(x: number, y: number): naver.maps.Point; + equals(point: naver.maps.Point): boolean; + floor(): naver.maps.Point; + mul(point: naver.maps.Coord | naver.maps.PointLiteral): naver.maps.Point; + mul(x: number, y: number): naver.maps.Point; + round(): naver.maps.Point; + sub(point: naver.maps.Coord | naver.maps.PointLiteral): naver.maps.Point; + sub(x: number, y: number): naver.maps.Point; + toString(): string; + } + export class Size { + constructor(width: number, height: number); + add(size: naver.maps.Size | naver.maps.SizeLiteral): naver.maps.Size; + add(width: number, height: number): naver.maps.Size; + ceil(): naver.maps.Size; + clone(): naver.maps.Size; + div(width: number, height: number): naver.maps.Size; + div(size: naver.maps.Size | naver.maps.SizeLiteral): naver.maps.Size; + equals(size: naver.maps.Size | naver.maps.SizeLiteral): boolean; + floor(): naver.maps.Size; + mul(size: naver.maps.Size | naver.maps.SizeLiteral): naver.maps.Size; + mul(width: number, height: number): naver.maps.Size; + round(): naver.maps.Size; + sub(size: naver.maps.Size | naver.maps.SizeLiteral): naver.maps.Size; + sub(width: number, height: number): naver.maps.Size; + toString(): string; + } + export class PointBounds { + constructor(minPoint: naver.maps.Point, maxPoint: naver.maps.Point); + static bounds(point: naver.maps.Coord | naver.maps.PointLiteral, + pointN: naver.maps.Coord | naver.maps.PointLiteral): naver.maps.PointBounds; + clone(): naver.maps.PointBounds; + equals(bounds: naver.maps.Bounds | naver.maps.PointBoundsLiteral): boolean; + extend(point: naver.maps.Coord | naver.maps.PointLiteral): naver.maps.PointBounds; + getCenter(): naver.maps.Point; + getMax(): naver.maps.Point; + getMin(): naver.maps.Point; + hasBounds(bounds: naver.maps.Bounds | naver.maps.PointBoundsLiteral): boolean; + hasPoint(point: naver.maps.Coord | naver.maps.PointLiteral): boolean; + intersects(bounds: naver.maps.Bounds | naver.maps.PointBoundsLiteral): boolean; + maxX(): number; + maxY(): number; + minX(): number; + minY(): number; + toString(): string; + union(bounds: naver.maps.Bounds | naver.maps.PointBoundsLiteral): naver.maps.PointBounds; + } + export class LatLng extends Point { + constructor(lat: number, lng: number); + clone(): naver.maps.LatLng; + destinationPoint(angle: number, meter: number): naver.maps.LatLng; + equals(point: naver.maps.Coord | naver.maps.LatLngLiteral): boolean; + lat(): number; + lng(): number; + toPoint(): naver.maps.Point; + toString(): string; + } + export class LatLngBounds extends PointBounds { + constructor(sw: naver.maps.LatLng, ne: naver.maps.LatLng); + static bounds(latlng: naver.maps.Coord | naver.maps.LatLngLiteral, + latlngN: naver.maps.Coord | naver.maps.LatLngLiteral): naver.maps.LatLngBounds; + clone(): naver.maps.LatLngBounds; + east(): number; + equals(bounds: naver.maps.Bounds | naver.maps.LatLngBoundsLiteral): boolean; + extend(latlng: naver.maps.Coord | naver.maps.LatLngLiteral): naver.maps.LatLngBounds; + getCenter(): naver.maps.LatLng; + getNE(): naver.maps.LatLng; + getSW(): naver.maps.LatLng; + hasLatLng(latlng: naver.maps.Coord | naver.maps.LatLngLiteral): boolean; + intersects(bounds: naver.maps.Bounds | naver.maps.LatLngBoundsLiteral): boolean; + north(): number; + south(): number; + toPointBounds(): naver.maps.PointBounds; + union(bounds: naver.maps.Bounds | naver.maps.LatLngBoundsLiteral): naver.maps.LatLngBounds; + west(): number; + } + // Map + export class Map { + controls: any; + data: any; + layers: any; + mapTypes: any; + mapSystemProjection: any; + constructor(mapDiv: string, mapOptions: MapOptions); + addPane(name: string, elementOrIndex: HTMLElement | number): void; + destory(): void; + fitBounds(bounds: any, margin: any): void; + getBounds(): any; + getSize(): any; + } + // Map.Tile + export class Tile extends naver.maps.KVO { + constructor(element: HTMLElement, tileOptions?: naver.maps.TileOptions); + appendTo(parentNode: HTMLElement): void; + cancelFadeIn(): void; + destroy(): void; + fadeIn(callback: Function, startOpacity?: number): void; + getElement(): HTMLElement; + getOffset(): naver.maps.Point; + getOpacity(): number; + getSize(): naver.maps.Size; + getTileIndex(): naver.maps.TileIndex; + getZIndex(): number; + hide(): void; + load(tileOptions?: naver.maps.TileOptions): void; + remove(): void; + reset(mapType: naver.maps.MapType, zoom: number, tileOptions?: naver.maps.TileOptions): void; + setBlank(): void; + setOffset(offset: naver.maps.Point): void; + setOffset(x: number, y: number): void; + setOpacity(opacity: number): void; + setSize(size: naver.maps.Size): void; + setTileIndex(tileIndex: naver.maps.TileIndex): void; + setZIndex(zIndex: number): void; + show(): void; + + } + export class CanvasTile extends naver.maps.Tile { + constructor(canvasTileOptions: naver.maps.CanvasTileOptions); + } + export class ImageTile extends naver.maps.Tile { + constructor(imageTileOptions: naver.maps.ImageTileOptions); + getImageElements(): HTMLElement[]; + getUrls(): string[]; + setUrls(urls: string[]): void; + } + // Map.MapType + export class CanvasMapType implements naver.maps.MapType { + maxZoom: number; + minZoom: number; + name: string; + projection: naver.maps.Projection; + tileSize: naver.maps.Size; + constructor(canvasMapTypeOptions: naver.maps.CanvasMapTypeOptions); + getMapTypeOptions(): naver.maps.CanvasMapTypeOptions; + getMaxZoom(): number; + getMinZoom(): number; + getName(): string; + getTile(x: number, y: number, z: number): naver.maps.CanvasTile; + getTileData(x: number, y: number, z: number): ImageData; + setMapTypeOptions(canvasMapTypeOptions: naver.maps.CanvasMapTypeOptions): void; + } + export class ImageMapType implements naver.maps.MapType { + maxZoom: number; + minZoom: number; + name: string; + projection: naver.maps.Projection; + tileSize: naver.maps.Size; + constructor(imageMapTypeOptions); + getMapTypeOptions(): naver.maps.ImageMapTypeOptions; + getMaxZoom(): number; + getMinZoom(): number; + getName(): string; + getTile(x: number, y: number, z: number): naver.maps.ImageTile; + getTileUrls(x: number, y: number, z: number): string[]; + setMapTypeOptions(imageMapTypeOptions: naver.maps.ImageMapTypeOptions): void; + } + export class MapTypeRegistry extends naver.maps.KVO { + constructor(mapTypeInfo: object, defaultMapTypeId?: string); + getPreviousTypeId(): string; + getSelectedType(): naver.maps.MapType; + getSelectedTypeId(): string; + getTypeIds(): string[]; + set(mapTypeId: string, mapType: naver.maps.MapType): void; + setSelectedTypeId(mapTypeId: string): void; + } + // Map.MapType.Preset + export class NaverMapTypeOption { + constructor(options: naver.maps.NaverImageMapTypeOptions); + static getBicycleLayer(opts: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; + static getBlankMap(opts: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; + static getCadastralLayer(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; + static getHybridMap(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; + static getMapTypes(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.MapTypeRegistry; + static getNormalLabelLayer(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; + static getNormalMap(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; + static getSatelliteLabelLayer(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; + static getSatelliteMap(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; + static getStreetLayer(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; + static getTerrainMap(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; + static getTrafficLayer(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; + static getVectorMap(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; + static getWorldMap(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; + } + // Control + export class CustomControl extends naver.maps.KVO { + constructor(html: string, ControlOptions: naver.maps.ControlOptions); + getElement(): HTMLElement; + getMap(): naver.maps.Map | null; + getOptions(key?: string): any; + html(html?: string): string | undefined; + setMap(map?: naver.maps.Map | null): void; + setOptions(newOptions: naver.maps.ControlOptions): void; + setPosition(position: naver.maps.Position): void; + } + // Naver Controls + export class LogoControl extends naver.maps.CustomControl { + constructor(LogoControlOptions: naver.maps.LogoControlOptions); + } + export class MapDataControl extends naver.maps.CustomControl { + constructor(MapDataControlOptions); + } + export class MapTypeControl extends naver.maps.CustomControl { + constructor(MapTypeControlOptions: naver.maps.MapTypeControlOptions); + } + export class ScaleControl extends naver.maps.CustomControl { + constructor(ScaleControlOptions: naver.maps.ScaleControlOptions); + } + export class ZoomControl extends naver.maps.CustomControl { + constructor(ZoomControlOptions); + } + // Layer + export class Layer extends naver.maps.KVO { + constructor(name: string, MapTypeRegistry: naver.maps.MapTypeRegistry, options: naver.maps.LayerOptions); + getLayerType(): naver.maps.MapType; + getLayerTypeId(): string; + getMap(): naver.maps.Map | null; + getOpacity(): number; + getPaneElement(): HTMLElement; + refresh(noEffect?: boolean): void; + setLayerTypeId(typeId: string): void; + setMap(map: naver.maps.Map | null): void; + setOpacity(opacity: number): void; + } + // Naver Layers + export class LabelLayer extends naver.maps.Layer { + constructor(name: string, registry: naver.maps.ImageMapType, option: object); + } + export class CadastralLayer extends naver.maps.LabelLayer { + name: string; + constructor(option?: naver.maps.CadastralLayerOptions); + } + export class StreetLayer extends naver.maps.LabelLayer { + name: string; + constructor(option?: naver.maps.StreetLayerOptions); + } + export class TrafficLayer extends naver.maps.LabelLayer { + name: string; + constructor(option?: naver.maps.TrafficLayerOptions); + endAutoRefresh(): void; + startAutoRefresh(): void; + } + // Data Layer + export class Data extends naver.maps.KVO { + constructor(); + addFeature(feature: naver.maps.Feature, autoStyle: boolean): void; + addGeoJson(geojson: naver.maps.GeoJSON, autoStyle: boolean): void; + addGpx(xmlDoc: naver.maps.GPX, autoStyle: boolean): void; + addKml(xmlDoc: naver.maps.KML, autoStyle: boolean): void; + forEach(callback: (feature: naver.maps.Feature, index: number) => void): void; + getAllFeature(): naver.maps.Feature[]; + getFeatureById(id: string | number): naver.maps.Feature; + getMap(): naver.maps.Map | null; + getStyle(): naver.maps.StyleOptions | naver.maps.StylingFunction; + overrideStyle(feature: naver.maps.Feature, style: naver.maps.StyleOptions): void; + removeFeature(feature: naver.maps.Feature): void; + removeGeoJson(geojson: naver.maps.GeoJSON): void; + revertStyle(feature: naver.maps.Feature): void; + setMap(map: naver.maps.Map | null): void; + setStyle(style: naver.maps.StyleOptions | naver.maps.StylingFunction): void; + toGeoJson(): naver.maps.GeoJSON; + } + export class Feature extends naver.maps.KVO { + constructor(rawFeature: object); + forEachOverlay(callback: naver.maps.forEachOverlayCallback): void; + getBounds(): naver.maps.Bounds; + getGeometries(): naver.maps.Geometry[]; + getId(): string; + getOverlays(): naver.maps.Marker[] | naver.maps.Polyline[] | naver.maps.Polygon[]; + getProperty(name: string): any; + getRaw(): naver.maps.GeoJSON; + setProperty(name: string, value: any): void; + setStyle(styleOptions: naver.maps.StyleOptions); // naver.maps.Data.StyleOptions + } + export class Geometry extends naver.maps.KVO { + constructor(rawGeometry: object); + getCoords(): naver.maps.ArrayOfCoords; + getType(): string; + } + // Overlay + export abstract class OverlayView extends naver.maps.KVO { + draw(): void; + getContainerTopLeft(): naver.maps.Point; + getMap(): naver.maps.Map | null; + getPanes(): naver.maps.MapPanes; + getProjection(): naver.maps.MapSystemProjection; + abstract onAdd(): any; + abstract onRemove(): any; + setMap(map: naver.maps.Map | null): void; + } + // Naver Overlays + export abstract class Circle extends naver.maps.OverlayView { + constructor(options?: naver.maps.CircleOptions); + getAreaSize(): number; + getBounds(): naver.maps.Bounds; + getCenter(): naver.maps.Coord; + getClickable(): boolean; + getDrawingRect(): naver.maps.Bounds; + getOptions(key?: string): naver.maps.CircleOptions | any; + getRadius(): number; + getStyles(key: string): naver.maps.CircleOptions | any; + getVisible(): boolean; + getZIndex(): number; + setCenter(center): naver.maps.Coord | naver.maps.CoordLiteral; + setClickable(clickable: boolean): void; + setOptions(key: string, value: any): void; + setOptions(options: naver.maps.CircleOptions): void; + setRadius(radius: number): void; + setStyles(key: string, value: string): void; + setStyles(options: naver.maps.CircleOptions): void; + setVisible(visible: boolean): void; + setZIndex(zIndex: number): void; + } + export abstract class Ellipse extends naver.maps.OverlayView { + constructor(); + getAreaSize(): number; + getBounds(): naver.maps.Bounds; + getClickable(): boolean; + getDrawingRect(): naver.maps.Bounds; + getOptions(key?: string): naver.maps.EllipseOptions | any; + getStyles(key?: string): naver.maps.EllipseOptions | any; + getVisible(): boolean; + getZIndex(): number; + setBounds(bounds: naver.maps.Bounds | naver.maps.BoundsLiteral): void; + setOptions(options: naver.maps.EllipseOptions): void; + setOptions(key: string, value: any): void; + setStyles(options: naver.maps.EllipseOptions): void; + setStyles(key: string, value: any): void; + setVisible(visible: boolean): void; + setZIndex(zIndex: number): void; + } + export abstract class GroundOverlay extends naver.maps.OverlayView { + constructor(url: string, bounds: naver.maps.Bounds | naver.maps.BoundsLiteral, options?: naver.maps.GroundOverlayOptions); + getBounds(): naver.maps.Bounds; + getOpacity(): number; + getUrl(): string; + setOpacity(opacity: number): void; + } + export abstract class InfoWindow extends naver.maps.OverlayView { + constructor(options: naver.maps.InfoWindowOptions); + close(): void; + getContent(): HTMLElement; + getOptions(key?: string): naver.maps.InfoWindowOptions; + getPosition(): naver.maps.Coord; + getZIndex(): number; + open(map: naver.maps.Map, anchor: naver.maps.Coord | naver.maps.CoordLiteral | naver.maps.Marker ): void; + setContent(content: string | HTMLElement): void; + setOptions(options: naver.maps.InfoWindowOptions): void; + setPosition(position: naver.maps.Coord | naver.maps.CoordLiteral): void; + setZIndex(zIndex: number): void; + } + export abstract class Marker extends naver.maps.OverlayView { + constructor(options: MarkerOptions); + abstract draw(): void; + getAnimation(): naver.maps.Animation; + getClickable(): boolean; + getCursor(): string; + getDraggable(): boolean; + getDrawingRect(): naver.maps.Bounds; + getIcon(): naver.maps.ImageIcon | naver.maps.SymbolIcon | naver.maps.HtmlIcon; + getOptions(key?: string): naver.maps.MarkerOptions; + getPosition(): naver.maps.Coord; + getShape(): naver.maps.MarkerShape; + getTitle(): string; + getVisible(): boolean; + getZIndex(): number; + abstract onAdd(): void; + abstract onRemove(): void; + setAnimation(animation: naver.maps.Animation): void; + setClickable(clickable: boolean): void; + setCursor(cursor: string): void; + setDraggable(draggable: boolean): void; + setIcon(icon: string | naver.maps.ImageIcon | naver.maps.SymbolIcon | naver.maps.HtmlIcon): void; + setOptions(options: naver.maps.MarkerOptions): void; + setPosition(position: naver.maps.Coord | naver.maps.CoordLiteral): void; + setShape(shape: naver.maps.MarkerShape): void; + setTitle(title: string): void; + setVisible(visible: boolean): void; + setZIndex(zIndex: number): void; + } + export abstract class Polygon extends naver.maps.OverlayView { + constructor(options?: naver.maps.PolygonOptions); + getAreaSize(): number; + getBounds(): naver.maps.Bounds; + getClickable(): boolean; + getDrawingRect(): naver.maps.Bounds; + getOptions(key?: string): naver.maps.PolygonOptions | any; + getPath(): naver.maps.ArrayOfCoords | naver.maps.KVOArrayOfCoords; + getPaths(): ArrayOfCoords[] | KVOArrayOfCoords[]; + getStyles(key?: string): naver.maps.PolygonOptions | any; + getVisible(): boolean; + getZIndex(): number; + setClickable(clickable: boolean): void; + setOptions(key: string, value: any): void; + setOptions(options: naver.maps.PolygonOptions): void; + setPath(path: naver.maps.ArrayOfCoords | naver.maps.KVOArrayOfCoords | naver.maps.ArrayOfCoordsLiteral): void; + setPaths(paths: naver.maps.ArrayOfCoords[] | naver.maps.ArrayOfCoordsLiteral | any): void; // TODO. KVOArray. + setStyles(key: string, value: any): void; + setStyles(options: naver.maps.PolygonOptions): void; + setVisible(visible: boolean): void; + setZIndex(zIndex: number): void; + } + export abstract class Polyline extends naver.maps.OverlayView { + constructor(options?: naver.maps.PolylineOptions); + getBounds(): naver.maps.Bounds; + getClickable(): boolean; + getDistance(): number; + getDrawingRect(): naver.maps.Bounds; + getOptions(key?: string): naver.maps.PolylineOptions | any; + getPath(): naver.maps.ArrayOfCoords | naver.maps.KVOArrayOfCoords; + getStyles(key?: string): naver.maps.PolylineOptions | any; + getVisible(): boolean; + getZIndex(): number; + setClickable(clickable: boolean): void; + setOptions(key: string, value: any): void; + setOptions(options: naver.maps.PolylineOptions): void; + setPath(path: naver.maps.ArrayOfCoords | naver.maps.KVOArrayOfCoords | naver.maps.ArrayOfCoordsLiteral): void; + setStyles(key: string, value: any): void; + setStyles(options: naver.maps.PolylineOptions): void; + setVisible(visible: boolean): void; + setZIndex(zIndex: number): void; + } + export abstract class Rectangle extends naver.maps.OverlayView { + constructor(options?: naver.maps.RectangleOptions); + getAreaSize(): number; + getBounds(): naver.maps.Bounds; + getClickable(): boolean; + getDrawingRect(): naver.maps.Bounds; + getOptions(key?: string): naver.maps.RectangleOptions | any; + getStyles(key?: string): naver.maps.RectangleOptions | any; + getVisible(): boolean; + getZIndex(): number; + setBounds(bounds: naver.maps.Bounds | naver.maps.BoundsLiteral): void; + setClickable(clickable: boolean): void; + setOptions(options: naver.maps.RectangleOptions): void; + setOptions(key: string, value: any): void; + setStyles(key: string, value: any): void; + setStyles(options: naver.maps.RectangleOptions): void; + setVisible(visible: boolean): void; + setZIndex(zIndex: number): void; + } + + // Sub module: panorama + export class PanoramaProjection extends naver.maps.KVO { + fromCoordToPov(coord: naver.maps.LatLng): naver.maps.PanoramaPov; + } + export class Panorama extends naver.maps.KVO { + constructor(panoramaDiv: string | HTMLElement, panoramaOptions: naver.maps.PanoramaOptions); + getLocation(): naver.maps.PanoramaLocation; + getMaxScale(): number; + getMaxZoom(): number; + getMinScale(): number; + getMinZoom(): number; + getPanoId(): string; + getPosition(): naver.maps.LatLng; + getPov(): naver.maps.PanoramaPov; + getProjection(): naver.maps.PanoramaProjection; + getScale(): number; + getSize(): naver.maps.Size; + getVisible(): boolean; + getZoom(): number; + setOptions(key: string, value: any); + setOptions(newOptions: naver.maps.PanoramaOptions | object); + setPanoId(panoId: string): void; + setPanoIdWithPov(panoId: string, pov: naver.maps.PanoramaPov): void; + setPosition(position: naver.maps.LatLng | naver.maps.LatLngLiteral): void; + setPov(pov: naver.maps.PanoramaPov): void; + setScale(scale: number): void; + setSize(size: naver.maps.Size | naver.maps.SizeLiteral): void; + setVisible(visible: boolean): void; + setZoom(zoom: number): void; + zoomIn(): void; + zoomOut(): void; + } + export class FlightSpot extends naver.maps.KVO { + constructor(); + getMap(): naver.maps.Map | null; + setMap(map: naver.maps.Map | null): void; + } + export class AroundControl extends naver.maps.CustomControl { + constructor(aroundControlOptions: AroundControlOptions); + } + + // Sub module: drawing + export module drawing { + export interface DrawingOptions { + map?: naver.maps.Map; + drawingControl?: naver.maps.drawing.DrawingMode[]; + drawingControlOptions?: naver.maps.drawing.drawingControlOptions; + drawingMode?: naver.maps.drawing.DrawingMode; + controlPointOptions?: naver.maps.drawing.controlPointOptions; + rectangleOptions?: naver.maps.RectangleOptions; + ellipseOptions?: naver.maps.EllipseOptions; + polylineOptions?: naver.maps.PolylineOptions; + arrowlineOptions?: naver.maps.PolylineOptions; + polygonOptions?: naver.maps.PolygonOptions; + markerOptions?: naver.maps.MarkerOptions; + } + type drawingControlOptions = DrawingControlOptions; + export interface DrawingControlOptions { + position?: naver.maps.Position; + style?: naver.maps.drawing.DrawingStyle; + } + type controlPointOptions = ControlPointOptions; + export interface ControlPointOptions { + anchorPointOptions: naver.maps.CircleOptions; + midPointOptions: naver.maps.CircleOptions; + } + export interface DrawingOverlay { + id: string; + name: string; + setEditable: (editable: boolean, controlPointOptions?: naver.maps.drawing.controlPointOptions) => void; + } + export enum DrawingStyle { + HORIZONTAL = 0, + VERTICAL, + HORIZONTAL_2, + VERTICAL_2 + } + export enum DrawingMode { + HAND = 0, + RECTANGLE, + ELLIPSE, + POLYLINE, + ARROWLINE, + POLYGON, + MARKER + } + export enum DrawingEvent { + ADD, + REMOVE, + SELECT, + Added, + Removed, + Selected + } + export class DrawingManager extends naver.maps.KVO { + constructor(options?: naver.maps.drawing.DrawingOptions); + addDrawing(overlay: naver.maps.drawing.DrawingOverlay, drawingMode: naver.maps.drawing.DrawingMode, id?: string): void; + addListener(eventName: naver.maps.drawing.DrawingEvent, + listener: (overlay: naver.maps.drawing.DrawingOverlay) => void): naver.maps.MapEventListener; + destroy(): void; + getDrawing(id: string): naver.maps.drawing.DrawingOverlay; + getDrawings(): object; + getMap(): naver.maps.Map | null; + setMap(map: naver.maps.Map | null): void; + toGeoJson(): object; + } + } + + // Sub module: visualization + export module visualization { + export interface DotMapOptions { + map: naver.maps.Map; + data: naver.maps.LatLng[] | naver.maps.PointArrayLiteral[] | naver.maps.visualization.WeightedLocation[]; + opacity?: number; + radius?: number; + strokeWeight?: number; + strokeColor?: string; + strokeLineCap?: naver.maps.strokeLineCapType; + strokeLineJoin?: naver.maps.strokeLineJoinType; + fillColor?: string; + } + export interface HeatMapOptions { + map: naver.maps.Map; + data: naver.maps.LatLng[] | naver.maps.PointArrayLiteral[] | naver.maps.visualization.WeightedLocation[]; + opacity?: number; + radius?: number; + colorMap?: naver.maps.visualization.SpectrumStyle; + } + export enum SpectrumStyle { + JET, + HSV, + HOT, + COOL, + GREYS, + YIGnBu, + YIOrRd, + RdBu, + RAINBOW, + PORTLAND, + OXYGEN + } + export class DotMap extends naver.maps.KVO { + constructor(dotMapOptions?: naver.maps.visualization.DotMapOptions); + addDrawing(overlay: naver.maps.drawing.DrawingOverlay, drawingMode: naver.maps.drawing.DrawingMode, id?: string): void; + addListener(eventName: naver.maps.drawing.DrawingEvent, + listener: (overlay: naver.maps.drawing.DrawingOverlay) => void): naver.maps.MapEventListener; + destroy(): void; + getDrawing(id: string): naver.maps.drawing.DrawingOverlay; + getDrawings(): object; + getMap(): naver.maps.Map | null; + setMap(map: naver.maps.Map | null): void; + toGeoJson(): object; + } + export class HeatMap { + constructor(heatMapOptions?: naver.maps.visualization.HeatMapOptions); + getColorMap(): naver.maps.visualization.SpectrumStyle; + getData(): naver.maps.LatLng[] | naver.maps.PointArrayLiteral[]; + getMap(): naver.maps.Map | null; + getOptions(key?: string): naver.maps.visualization.HeatMapOptions | any; + redraw(): void; + setColorMap(colormap: naver.maps.visualization.SpectrumStyle, inReverse: boolean): void; + setData(data: naver.maps.LatLng[] | naver.maps.PointArrayLiteral[]): void; + setMap(map: naver.maps.Map | null): void; + setOptions(key: string, value: any): void; + setOptions(options: naver.maps.visualization.HeatMapOptions): void; + } + export class WeightedLocation { + constructor(lat: number, lng: number, weight?: number); + clone(): naver.maps.visualization.WeightedLocation; + getLocation(): naver.maps.LatLng; + getWeight(): number; + lat(): number; + lng(): number; + toString(): string; + } + } + + // Sub module: geocoder + export module Service { + export interface ServiceOptions { + encoding?: any; + coordType?: any; + } + export interface GeocodeServiceOptions extends ServiceOptions { + address?: string; + } + export interface ReverseServiceOptions extends ServiceOptions { + location?: Coord | CoordLiteral; + } + export interface AddressItem { + address: string; + addrdetail: { + country: string; + sido: string; + sigugun: string; + dongmyun: string; + rest: string; + }; + } + export interface GeocodeResponse { + result: { + userquery: object; + total: number; + items: naver.maps.Service.AddressItem[]; + }; + } + export interface ReverseGeocodeResponse { + result: { + userquery: string; + total: number; + items: naver.maps.Service.AddressItem[]; + }; + } + export enum CoordType { + LATLNG = 'latlng', + TM128 = 'tm128' + } + export enum Encoding { + UTF_8 = 'utf-8', + EUC_KR = 'euc-kr' + } + export enum Status { + OK = 200, + ERROR = 500 + } + + function fromAddrToCoord(); + function fromCoordToAddr(); + function geocode(options: naver.maps.Service.GeocodeServiceOptions, + callback?: (status: naver.maps.Service.Status, response: naver.maps.Service.GeocodeResponse) => void); + function reverseGeocode(options: naver.maps.Service.ReverseServiceOptions, + callback?: (status: naver.maps.Service.Status, response: naver.maps.Service.ReverseGeocodeResponse) => void); + } + + export module TransCoord { + function fromEPSG3857ToLatLng(coord: naver.maps.Point): naver.maps.LatLng; + function fromEPSG3857ToNaver(coord: naver.maps.Point): naver.maps.Point; + function fromEPSG3857ToTM128(coord: naver.maps.Point): naver.maps.Point; + function fromEPSG3857ToUTMK(coord: naver.maps.Point): naver.maps.Point; + function fromLatLngToEPSG3857(latlng: naver.maps.Coord): naver.maps.Point; + function fromLatLngToNaver(latlng: naver.maps.Coord): naver.maps.Point; + function fromLatLngToTM128(latlng: naver.maps.Coord): naver.maps.Point; + function fromLatLngToUTMK(latlng: naver.maps.Coord): naver.maps.Point; + function fromNaverToEPSG3857(n: naver.maps.Point): naver.maps.Point; + function fromNaverToLatLng(n: naver.maps.Point): naver.maps.LatLng; + function fromNaverToTM128(n: naver.maps.Point): naver.maps.Point; + function fromNaverToUTMK(n: naver.maps.Point): naver.maps.Point; + function fromTM128ToEPSG3857(tm128: naver.maps.Point): naver.maps.Point; + function fromTM128ToLatLng(tm128: naver.maps.Point): naver.maps.LatLng; + function fromTM128ToNaver(tm128: naver.maps.Point): naver.maps.Point; + function fromTM128ToUTMK(tm128: naver.maps.Point): naver.maps.Point; + function fromUTMKToEPSG3857(utmk: naver.maps.Point): naver.maps.Point; + function fromUTMKToLatLng(utmk: naver.maps.Point): naver.maps.LatLng; + function fromUTMKToNaver(utmk: naver.maps.Point): naver.maps.Point; + function fromUTMKToTM128(utmk: naver.maps.Point): naver.maps.Point; + } + + export module Event { + function addDOMListener(element: HTMLElement, eventName: string, listener: Function): void; + function addListener(target: object, eventName: string, listener: Function): naver.maps.MapEventListener; + function clearInstanceListeners(target: object): void; + function clearListeners(target: object, fromEventName: string): void; + function forward(source: object, fromEventName: string, target: object, toEventName: string): naver.maps.MapEventListener; + function hasListener(target: object, eventName: string): boolean; + function once(target: object, eventName: string, listener: Function): naver.maps.MapEventListener; + function removeDOMListener(element: HTMLElement, eventName: string, listener: Function): void; + function removeDOMListener(listeners: naver.maps.DOMEventListener | naver.maps.DOMEventListener[]): void; + function removeListener(listeners: naver.maps.MapEventListener | naver.maps.MapEventListener[]): void; + function resumeDispatch(target: object, eventName: string): void; + function stopDispatch(target: object, eventName: string): void; + function trigger(target: object, eventName: string, eventObject?: any): void; + } + + // Projection + export module EPSG3857 { // implements naver.maps.Projection + function fromCoordToPoint(coord: naver.maps.Coord): naver.maps.Point; + function fromLatLngToPoint(latlng: naver.maps.LatLng): naver.maps.Point; + function fromPointToCoord(point: naver.maps.Point): naver.maps.LatLng; + function fromPointToLatLng(point: naver.maps.Point): naver.maps.LatLng; + function getDestinationCoord(fromLatLng: naver.maps.LatLng, angle: number, meter: number): naver.maps.LatLng; + function getDistance(latlng1: naver.maps.LatLng, latlng2: naver.maps.LatLng): number; + } + export class UTMK { + name: string; + pointPerMeter: number; + static fromCoordToPoint(latlng: naver.maps.LatLng): naver.maps.Point; + static fromCoordToUTMK(latlng: naver.maps.LatLng): naver.maps.Point; + static fromLatLngToPoint(latlng: naver.maps.LatLng): naver.maps.Point; + static fromLatLngToUTMK(latlng: naver.maps.LatLng): naver.maps.Point; + static fromPointToCoord(point: naver.maps.Point): naver.maps.LatLng; + static fromPointToLatLng(point: naver.maps.Point): naver.maps.LatLng; + static fromPointToUTMK(point: naver.maps.Point): naver.maps.Point; + static fromUTMKToCoord(utmk: naver.maps.Point): naver.maps.LatLng; + static fromUTMKToLatLng(utmk: naver.maps.Point): naver.maps.LatLng; + static fromUTMKToPoint(utmk: naver.maps.Point): naver.maps.Point; + static getDestinationCoord(fromLatLng: naver.maps.LatLng, angle: number, meter: number): naver.maps.LatLng; + static getDistance(latlng1: naver.maps.LatLng, latlng2: naver.maps.LatLng): number; + } + export class UTMK_NAVER { // extends naver.maps.UTMK + name: string; + pointPerMeter: number; + static fromCoordToNaver(latlng: naver.maps.LatLng): naver.maps.Point; + static fromLatLngToNaver(latlng: naver.maps.LatLng): naver.maps.Point; + static fromNaverToCoord(naverPoint: naver.maps.Point): naver.maps.LatLng; + static fromNaverToLatLng(naverPoint: naver.maps.Point): naver.maps.LatLng; + static fromNaverToPoint(naverPoint: naver.maps.Point): naver.maps.Point; + static fromNaverToUTMK(naverPoint: naver.maps.Point): naver.maps.Point; + static fromPointToNaver(point: naver.maps.Point): naver.maps.Point; + static fromUTMKToNaver(utmk: naver.maps.Point): naver.maps.Point; + } + export class EPSG3857Coord { + static fromCoordToLatLng(coord: naver.maps.Point): naver.maps.LatLng; + static fromCoordToPoint(coord: naver.maps.Point): naver.maps.Point; + static fromEPSG3857ToLatLng(coord: naver.maps.Point): naver.maps.LatLng; + static fromEPSG3857ToPoint(coord: naver.maps.Point): naver.maps.Point; + static fromLatLngToCoord(coord: naver.maps.Coord): naver.maps.Point; + static fromLatLngToEPSG3857(coord: naver.maps.Coord): naver.maps.Point; + static fromPointToCoord(point: naver.maps.Point): naver.maps.Point; + static fromPointToEPSG3857(point: naver.maps.Point): naver.maps.Point; + } + export class TM128 { // extends naver.maps.TM128Coord + static fromCoordToPoint(latlng: naver.maps.Coord): naver.maps.Point; + static fromPointToCoord(point: naver.maps.Point): naver.maps.LatLng; + } + export class TM128Coord { // extends naver.maps.UTMK + static fromCoordToLatLng(tm128: naver.maps.Point): naver.maps.LatLng; + static fromCoordToPoint(tm128: naver.maps.Point): naver.maps.Point; + static fromLatLngToCoord(latlng: naver.maps.Coord): naver.maps.Point; + static fromLatLngToTM128(latlng: naver.maps.Coord): naver.maps.Point; + static fromPointToCoord(point: naver.maps.Point): naver.maps.Point; + static fromPointToTM128(point: naver.maps.Point): naver.maps.Point; + static fromTM128ToLatLng(tm128: naver.maps.Point): naver.maps.LatLng; + static fromTM128ToPoint(tm128: naver.maps.Point): naver.maps.Point; + static fromTM128ToUTMK(tm128: naver.maps.Point): naver.maps.Point; + static fromUTMKToTM128(utmk: naver.maps.Point): naver.maps.Point; + } + export class UTMK_NAVERCoord { // extends naver.maps.UTMK_NAVER + static fromCoordToLatLng(n: naver.maps.Point): naver.maps.LatLng; + static fromCoordToPoint(n: naver.maps.Point): naver.maps.Point; + static fromLatLngToCoord(latlng: naver.maps.Coord): naver.maps.Point; + static fromPointToCoord(point: naver.maps.Point): naver.maps.Point; + } + export class UTMKCoord { // extends naver.maps.UTMK + static fromCoordToLatLng(utmk: naver.maps.Point): naver.maps.LatLng; + static fromCoordToPoint(utmk: naver.maps.Point): naver.maps.Point; + static fromLatLngToCoord(latlng: naver.maps.Coord): naver.maps.Point; + static fromPointToCoord(point: naver.maps.Point): naver.maps.Point; + } +} diff --git a/navermaps/navermaps-tests.ts b/navermaps/navermaps-tests.ts new file mode 100644 index 0000000000..a3e84e94a2 --- /dev/null +++ b/navermaps/navermaps-tests.ts @@ -0,0 +1,148 @@ +var map = new naver.maps.Map('map'); +map.setMapTypeId(naver.maps.MapTypeId.HYBRID); + + +var jeju = new naver.maps.LatLng(33.3590628, 126.534361); + +map.setCenter(jeju); // 중심 좌표 이동 +map.setZoom(13); // 줌 레벨 변경 + +var seoul = new naver.maps.LatLngBounds( + new naver.maps.LatLng(37.42829747263545, 126.76620435615891), + new naver.maps.LatLng(37.7010174173061, 127.18379493229875)); + +map.fitBounds(seoul); // 좌표 경계 이동 + +map.panBy(new naver.maps.Point(10, 10)); // 우측 하단으로 10 픽셀 이동 + +var map = new naver.maps.Map('map', { + mapTypeId: naver.maps.MapTypeId.HYBRID +}); + +var registry = new naver.maps.MapTypeRegistry(); + +var map = new naver.maps.Map('map', { + mapTypes: registry, + mapTypeId: naver.maps.MapTypeId.SATELLITE +}); + +map.mapTypes.set(naver.maps.MapTypeId.SATELLITE, naver.maps.NaverMapTypeOption.getSatelliteMap()); +map.mapTypes.set(naver.maps.MapTypeId.HYBRID, naver.maps.NaverMapTypeOption.getHybridMap()); + +map.setMapTypeId(naver.maps.MapTypeId.NORMAL); // error thrown + +var MyMapType = { + name: "Alphabet", + minZoom: 0, + maxZoom: 22, + projection: naver.maps.EPSG3857, + tileSize: new naver.maps.Size(50, 50), + getTile: function(x, y, z) { + var w = this.tileSize.width, + h = this.tileSize.height; + + var ascii = parseInt(Math.abs(x + y) % 26, 10) + 65; + alphabet = String.fromCharCode(ascii); + var tile = document.createElement('div'); + + tile.style.width = w +'px'; + tile.style.height = w +'px'; + + return tile; + } +}; + +var map = new naver.maps.Map('map', { + center: new naver.maps.LatLng(37.3595704, 127.105399), + zoom: 10, + mapTypeId: 'mine', + mapTypes: new naver.maps.MapTypeRegistry({ + 'mine': MyMapType + }), + mapTypeControl: true, + mapTypeControlOptions: { + style: naver.maps.MapTypeControlStyle.DROPDOWN + } +}); + +var GTA5MapTypeOption = function(name, type) { + this.name = name; + this.type = type; +}; +GTA5MapTypeOption.prototype = { + constructor: GTA5MapTypeOption, + + name: '', + type: '', + projection: naver.maps.EPSG3857, + minZoom: 1, + maxZoom: 6, + tileSize: new naver.maps.Size(256, 256), + TRANSPARENT_URL: 'http://static.naver.net/maps/dot.gif', + tileRanges: [1, 2, 4, 8, 16, 32], + + getName: function() { + return this.name; + }, + + getTileUrl: function(x, y, z) { + var tileRange = this.tileRanges[z - 1]; + + if ((x >=0 && x < tileRange) && (y >=0 && y < tileRange)) { + return "http://gta-5-map.com/" +this.type+'/'+z+'-'+x+'_'+y+".png"; + } else { + return this.TRANSPARENT_URL; + } + }, + + onerror: function(tileImg) { + tileImg.src = this.TRANSPARENT_URL; + } +}; + +var map = new naver.maps.Map('map', { + center: new naver.maps.LatLng(74.92514151088395, -127.880859375), + zoom: 2, + mapTypes: new naver.maps.MapTypeRegistry({ + "Atlas": new naver.maps.ImageMapType(new GTA5MapTypeOption("Atlas", "Tiles_ATLAS")), + "Satellite": new naver.maps.ImageMapType(new GTA5MapTypeOption("Satellite", "Tiles_SAT")), + }) +}); + +map.setMapTypeId("Atlas"); + +var MyMapType = { + name: "Alphabet", + minZoom: 0, + maxZoom: 22, + tileSize: new naver.maps.Size(50, 50), + getTileData: function(x, y, z) { + var w = this.tileSize.width, + h = this.tileSize.height, + canvas = document.createElement("canvas"), + ctx = canvas.getContext("2d"); + + var ascii = parseInt(Math.abs(x + y) % 26, 10) + 65; + alphabet = String.fromCharCode(ascii); + + canvas.width = w; + canvas.height = h; + + ctx.globalAlpha = 1 - ((ascii - 65) * 0.04); + + ctx.rect(0, 0, w, h); + ctx.fillStyle = "#000"; + ctx.fill(); + ctx.lineWidth = 1; + ctx.strokeStyle = "#aaa"; + ctx.stroke(); + + ctx.font = "bold " + (Math.min(w, h) - 10) + "px Arial"; + ctx.textBaseline = "middle"; + ctx.textAlign = "center"; + ctx.fillStyle = "#fff"; + ctx.fillText(alphabet, w / 2, h / 2); + + return ctx.getImageData(0, 0, w, h); + } +}; diff --git a/navermaps/tsconfig.json b/navermaps/tsconfig.json new file mode 100644 index 0000000000..5e1beca4fb --- /dev/null +++ b/navermaps/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "navermaps-tests.ts" + ] +} diff --git a/navermaps/tslint.json b/navermaps/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/navermaps/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} From 190c8aab89a85575da49bce0ba08094f980c00c5 Mon Sep 17 00:00:00 2001 From: teppeis Date: Thu, 15 Mar 2018 20:23:59 +0900 Subject: [PATCH 0056/2153] fix(node-rsa): improve node-rsa typing --- types/node-rsa/index.d.ts | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/types/node-rsa/index.d.ts b/types/node-rsa/index.d.ts index 63d569378d..84f583b1c8 100644 --- a/types/node-rsa/index.d.ts +++ b/types/node-rsa/index.d.ts @@ -31,7 +31,10 @@ declare class NodeRSA { /** * Export key to PEM string, PEM/DER Buffer or components. */ - exportKey(format?: NodeRSA.Format): NodeRSA.Key; + exportKey(): string; + exportKey(format: NodeRSA.FormatPem): string; + exportKey(format: NodeRSA.FormatDer): Buffer; + exportKey(format: NodeRSA.FormatComponents): NodeRSA.KeyComponents; isPrivate(): boolean; @@ -88,17 +91,22 @@ declare namespace NodeRSA { type Key = string | Buffer | KeyComponents; type Data = string | object | any[]; - type Format = + type FormatPem = | 'private' | 'public' - | 'pkcs1' | 'pkcs1-pem' | 'pkcs1-der' - | 'pkcs1-private' | 'pkcs1-private-pem' | 'pkcs1-private-der' - | 'pkcs1-public' | 'pkcs1-public-pem' | 'pkcs1-public-der' - | 'pkcs8' | 'pkcs8-pem' | 'pkcs8-der' - | 'pkcs8-private' | 'pkcs8-private-pem' | 'pkcs8-private-der' - | 'pkcs8-public' | 'pkcs8-public-pem' | 'pkcs8-public-der' + | 'pkcs1' | 'pkcs1-pem' + | 'pkcs1-private' | 'pkcs1-private-pem' + | 'pkcs1-public' | 'pkcs1-public-pem' + | 'pkcs8' | 'pkcs8-pem' + | 'pkcs8-private' | 'pkcs8-private-pem' + | 'pkcs8-public' | 'pkcs8-public-pem'; + type FormatDer = + | 'pkcs1-der' | 'pkcs1-private-der' | 'pkcs1-public-der' + | 'pkcs8-der' | 'pkcs8-private-der' | 'pkcs8-public-der'; + type FormatComponents = | 'components' | 'components-pem' | 'components-der' | 'components-private' | 'components-private-pem' | 'components-private-der' | 'components-public' | 'components-public-pem' | 'components-public-der'; + type Format = FormatPem | FormatDer | FormatComponents; type EncryptionScheme = 'pkcs1_oaep' | 'pkcs1'; From c3545db618098defce0d82cb5ebe742c23b1bfe2 Mon Sep 17 00:00:00 2001 From: Mykolas Kairys Date: Thu, 15 Mar 2018 14:21:40 +0200 Subject: [PATCH 0057/2153] react-router-redux typings update for createMatchSelector function --- types/react-router-redux/index.d.ts | 4 ++++ types/react-router-redux/react-router-redux-tests.tsx | 6 +++++- types/react-router-redux/tslint.json | 5 ++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/types/react-router-redux/index.d.ts b/types/react-router-redux/index.d.ts index 0ce965b397..89ef136014 100644 --- a/types/react-router-redux/index.d.ts +++ b/types/react-router-redux/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/ReactTraining/react-router/tree/master/packages/react-router-redux // Definitions by: Huy Nguyen // Shoya Tanaka +// Mykolas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -19,6 +20,7 @@ import { LocationDescriptor } from 'history'; import * as React from 'react'; +import { match } from 'react-router'; export interface ConnectedRouterProps { store?: Store; @@ -77,3 +79,5 @@ export interface LocationChangeAction { } export function routerMiddleware(history: History): Middleware; + +export function createMatchSelector(path: string): (state: State) => match | null; diff --git a/types/react-router-redux/react-router-redux-tests.tsx b/types/react-router-redux/react-router-redux-tests.tsx index b6927fb7bf..bf2575ae26 100644 --- a/types/react-router-redux/react-router-redux-tests.tsx +++ b/types/react-router-redux/react-router-redux-tests.tsx @@ -7,7 +7,7 @@ import { Provider } from 'react-redux'; import createHistory from 'history/createBrowserHistory'; import { Route } from 'react-router'; -import { ConnectedRouter, routerReducer, routerMiddleware, push, RouterState } from 'react-router-redux'; +import { ConnectedRouter, routerReducer, routerMiddleware, push, RouterState, createMatchSelector } from 'react-router-redux'; // Create a history of your choosing (we're using a browser history in this case) const history = createHistory(); @@ -44,3 +44,7 @@ ReactDOM.render( // Now you can dispatch navigation actions from anywhere! store.dispatch(push('/foo')); + +// And match location path using createMatchSelector +const matchSelector = createMatchSelector('/:foo'); +const match = matchSelector(store.getState()); diff --git a/types/react-router-redux/tslint.json b/types/react-router-redux/tslint.json index f93cf8562a..71ee04c4e1 100644 --- a/types/react-router-redux/tslint.json +++ b/types/react-router-redux/tslint.json @@ -1,3 +1,6 @@ { - "extends": "dtslint/dt.json" + "extends": "dtslint/dt.json", + "rules": { + "no-unnecessary-generics": false + } } From b13cd56680d5ff64393bd8d6098337f8e239e9f4 Mon Sep 17 00:00:00 2001 From: nevace Date: Thu, 15 Mar 2018 12:54:04 +0000 Subject: [PATCH 0058/2153] change Response type to 'any' --- types/twit/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/twit/index.d.ts b/types/twit/index.d.ts index 3fbd57283a..79106ce66e 100644 --- a/types/twit/index.d.ts +++ b/types/twit/index.d.ts @@ -224,7 +224,7 @@ declare module 'twit' { } } - export type Response = object + export type Response = any interface MediaParam { file_path: string From 7d4697c40bfe7926725373985d2ead98be10e4a3 Mon Sep 17 00:00:00 2001 From: teppeis Date: Thu, 15 Mar 2018 21:51:26 +0900 Subject: [PATCH 0059/2153] fix(node-rsa): improve node-rsa and the tests --- types/node-rsa/index.d.ts | 22 ++++++++++++++-------- types/node-rsa/node-rsa-tests.ts | 17 +++++++++++++++-- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/types/node-rsa/index.d.ts b/types/node-rsa/index.d.ts index 84f583b1c8..f7e92c071b 100644 --- a/types/node-rsa/index.d.ts +++ b/types/node-rsa/index.d.ts @@ -31,10 +31,10 @@ declare class NodeRSA { /** * Export key to PEM string, PEM/DER Buffer or components. */ - exportKey(): string; - exportKey(format: NodeRSA.FormatPem): string; + exportKey(format?: NodeRSA.FormatPem): string; exportKey(format: NodeRSA.FormatDer): Buffer; - exportKey(format: NodeRSA.FormatComponents): NodeRSA.KeyComponents; + exportKey(format: NodeRSA.FormatComponentsPrivate): NodeRSA.KeyComponentsPrivate; + exportKey(format: NodeRSA.FormatComponentsPublic): NodeRSA.KeyComponentsPublic; isPrivate(): boolean; @@ -88,7 +88,7 @@ declare class NodeRSA { } declare namespace NodeRSA { - type Key = string | Buffer | KeyComponents; + type Key = string | Buffer | KeyComponentsPrivate | KeyComponentsPublic; type Data = string | object | any[]; type FormatPem = @@ -102,11 +102,12 @@ declare namespace NodeRSA { type FormatDer = | 'pkcs1-der' | 'pkcs1-private-der' | 'pkcs1-public-der' | 'pkcs8-der' | 'pkcs8-private-der' | 'pkcs8-public-der'; - type FormatComponents = + type FormatComponentsPrivate = | 'components' | 'components-pem' | 'components-der' - | 'components-private' | 'components-private-pem' | 'components-private-der' + | 'components-private' | 'components-private-pem' | 'components-private-der'; + type FormatComponentsPublic = | 'components-public' | 'components-public-pem' | 'components-public-der'; - type Format = FormatPem | FormatDer | FormatComponents; + type Format = FormatPem | FormatDer | FormatComponentsPrivate | FormatComponentsPublic; type EncryptionScheme = 'pkcs1_oaep' | 'pkcs1'; @@ -132,7 +133,7 @@ declare namespace NodeRSA { | 'ascii' | 'utf8' | 'utf16le' | 'ucs2' | 'latin1' | 'base64' | 'hex' | 'binary' | 'buffer'; - interface KeyComponents { + interface KeyComponentsPrivate { n: Buffer; e: Buffer | number; d: Buffer; @@ -143,6 +144,11 @@ declare namespace NodeRSA { coeff: Buffer; } + interface KeyComponentsPublic { + n: Buffer; + e: Buffer | number; + } + interface KeyBits { /** * The length of the key in bits. diff --git a/types/node-rsa/node-rsa-tests.ts b/types/node-rsa/node-rsa-tests.ts index 0f8defacbd..eac9a0397b 100644 --- a/types/node-rsa/node-rsa-tests.ts +++ b/types/node-rsa/node-rsa-tests.ts @@ -26,8 +26,10 @@ Es+KCn25OKXR/FJ5fu6A6A+MptABL3r8SEjlpLc= const keyData = '-----BEGIN PUBLIC KEY----- ... -----END PUBLIC KEY-----'; key.importKey(keyData, 'pkcs8'); -const publicDer = key.exportKey('pkcs8-public-der'); -const privateDer = key.exportKey('pkcs1-der'); +const defaultPem: string = key.exportKey(); +const publicPem: string = key.exportKey('pkcs8-public-pem'); +const publicDer: Buffer = key.exportKey('pkcs8-public-der'); +const privateDer: Buffer = key.exportKey('pkcs1-der'); key.importKey({ n: new Buffer('0086fa9ba066685845fc03833a9699c8baefb53cfbf19052a7f10f1eaa30488cec1ceb752bdff2df9fad6c64b3498956e7dbab4035b4823c99a44cc57088a23783', 'hex'), e: 65537, @@ -39,6 +41,17 @@ key.importKey({ coeff: new Buffer('00b399675e5e81506b729a777cc03026f0b2119853dfc5eb124610c0ab82999e45', 'hex') }, 'components'); const publicComponents = key.exportKey('components-public'); +let b: Buffer = publicComponents.n; +let bn: Buffer|number = publicComponents.e; +const privateComponents = key.exportKey('components-private'); +b = privateComponents.n; +bn = privateComponents.e; +b = privateComponents.d; +b = privateComponents.p; +b = privateComponents.q; +b = privateComponents.dmp1; +b = privateComponents.dmq1; +b = privateComponents.coeff; key.isPrivate(); key.isPublic(true); From 08928fb325a5c19b139cf811c6df7d002660833a Mon Sep 17 00:00:00 2001 From: Mathieu Masy Date: Thu, 15 Mar 2018 10:23:12 -0400 Subject: [PATCH 0060/2153] [react-form] SelectProps' placeholder is not required --- types/react-form/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-form/index.d.ts b/types/react-form/index.d.ts index 4dc7e4b1b2..4114f3b7ee 100644 --- a/types/react-form/index.d.ts +++ b/types/react-form/index.d.ts @@ -142,7 +142,7 @@ export type SelectOptions = Array<{ export interface SelectProps extends FieldProps, React.SelectHTMLAttributes { options: SelectOptions; - placeholder: string; + placeholder?: string; } export const Select: React.StatelessComponent; From a7c606fea92885f8c23eea56761db388c165da40 Mon Sep 17 00:00:00 2001 From: nevace Date: Thu, 15 Mar 2018 14:23:54 +0000 Subject: [PATCH 0061/2153] added cursor param --- types/twit/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/twit/index.d.ts b/types/twit/index.d.ts index 79106ce66e..4100f95349 100644 --- a/types/twit/index.d.ts +++ b/types/twit/index.d.ts @@ -260,6 +260,7 @@ declare module 'twit' { long?: number, follow?: boolean, include_email?: boolean, + cursor?: number } export interface PromiseResponse { data: Response, From 89a712404fcb22541cbee4d661445a6734d89b48 Mon Sep 17 00:00:00 2001 From: nevace Date: Thu, 15 Mar 2018 14:25:59 +0000 Subject: [PATCH 0062/2153] remove previous change --- types/twit/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/twit/index.d.ts b/types/twit/index.d.ts index 4100f95349..27f33ad97d 100644 --- a/types/twit/index.d.ts +++ b/types/twit/index.d.ts @@ -224,7 +224,7 @@ declare module 'twit' { } } - export type Response = any + export type Response = object interface MediaParam { file_path: string From 2fe747bc0fadb216d1ef359eef870c8a4fa848d3 Mon Sep 17 00:00:00 2001 From: nevace Date: Thu, 15 Mar 2018 14:28:56 +0000 Subject: [PATCH 0063/2153] remove right change --- types/twit/index.d.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/types/twit/index.d.ts b/types/twit/index.d.ts index 27f33ad97d..30baf8c5d8 100644 --- a/types/twit/index.d.ts +++ b/types/twit/index.d.ts @@ -224,7 +224,7 @@ declare module 'twit' { } } - export type Response = object + export type Response = any interface MediaParam { file_path: string @@ -259,8 +259,7 @@ declare module 'twit' { lat?: number, long?: number, follow?: boolean, - include_email?: boolean, - cursor?: number + include_email?: boolean } export interface PromiseResponse { data: Response, From 4026a2cc259d6d2e9a7b9e5050bb190b0d4d177a Mon Sep 17 00:00:00 2001 From: nevace Date: Thu, 15 Mar 2018 14:29:45 +0000 Subject: [PATCH 0064/2153] comma --- types/twit/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/twit/index.d.ts b/types/twit/index.d.ts index 30baf8c5d8..79106ce66e 100644 --- a/types/twit/index.d.ts +++ b/types/twit/index.d.ts @@ -259,7 +259,7 @@ declare module 'twit' { lat?: number, long?: number, follow?: boolean, - include_email?: boolean + include_email?: boolean, } export interface PromiseResponse { data: Response, From 8b910ced688d7a90c338c2bb833185e0353deed7 Mon Sep 17 00:00:00 2001 From: nevace Date: Thu, 15 Mar 2018 14:31:33 +0000 Subject: [PATCH 0065/2153] add cursor param --- types/twit/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/twit/index.d.ts b/types/twit/index.d.ts index 79106ce66e..ce6a1327f1 100644 --- a/types/twit/index.d.ts +++ b/types/twit/index.d.ts @@ -260,6 +260,7 @@ declare module 'twit' { long?: number, follow?: boolean, include_email?: boolean, + cursor?: number, } export interface PromiseResponse { data: Response, From f61789e131db99d372f98fb64d45ae402d7be404 Mon Sep 17 00:00:00 2001 From: nevace Date: Thu, 15 Mar 2018 14:37:47 +0000 Subject: [PATCH 0066/2153] remove previous change --- types/twit/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/twit/index.d.ts b/types/twit/index.d.ts index ce6a1327f1..6b82dd6b65 100644 --- a/types/twit/index.d.ts +++ b/types/twit/index.d.ts @@ -224,7 +224,7 @@ declare module 'twit' { } } - export type Response = any + export type Response = object interface MediaParam { file_path: string From 4ae235a416378c87087274d69d3c18d59855fea7 Mon Sep 17 00:00:00 2001 From: Craig Kovatch Date: Thu, 15 Mar 2018 12:12:39 -0700 Subject: [PATCH 0067/2153] Add missing 'aria-controls' attribute to React WAI-ARIA typings --- types/react/index.d.ts | 5 +++++ types/react/v15/index.d.ts | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index d56d9571e1..df7716f8a9 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -2533,6 +2533,11 @@ declare namespace React { * @see aria-colindex @see aria-rowspan. */ 'aria-colspan'?: number; + /** + * Identifies the element (or elements) whose contents or presence are controlled by the current element. + * @see aria-owns. + */ + 'aria-controls'?: string; /** Indicates the element that represents the current item within a container or set of related elements. */ 'aria-current'?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time'; /** diff --git a/types/react/v15/index.d.ts b/types/react/v15/index.d.ts index 534d92de29..2111008d0d 100644 --- a/types/react/v15/index.d.ts +++ b/types/react/v15/index.d.ts @@ -2481,6 +2481,11 @@ declare namespace React { * @see aria-colindex @see aria-rowspan. */ 'aria-colspan'?: number; + /** + * Identifies the element (or elements) whose contents or presence are controlled by the current element. + * @see aria-owns. + */ + 'aria-controls'?: string; /** Indicates the element that represents the current item within a container or set of related elements. */ 'aria-current'?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time'; /** From b9369a91f4d64121b1d36b70de37354a3e8b4e81 Mon Sep 17 00:00:00 2001 From: naughton Date: Thu, 15 Mar 2018 13:14:44 -0700 Subject: [PATCH 0068/2153] fix signatures for listQueues and listTopics fix Subscription and Topic CountDetails property add ServiceBusClient between ServicebusServiceClient and EventEmitter ...to expose host, port and protocol. --- types/azure-sb/azure-sb-tests.ts | 4 ++-- types/azure-sb/index.d.ts | 24 ++++++++----------- types/azure-sb/lib/servicebusservice.d.ts | 8 +++++-- .../azure-sb/lib/servicebusserviceclient.d.ts | 7 +++--- types/azure-sb/lib/serviceclient.d.ts | 8 +++++++ types/azure-sb/tsconfig.json | 3 ++- 6 files changed, 31 insertions(+), 23 deletions(-) create mode 100644 types/azure-sb/lib/serviceclient.d.ts diff --git a/types/azure-sb/azure-sb-tests.ts b/types/azure-sb/azure-sb-tests.ts index 411862a3b2..14d2ba9054 100644 --- a/types/azure-sb/azure-sb-tests.ts +++ b/types/azure-sb/azure-sb-tests.ts @@ -14,14 +14,14 @@ function ResponseCallback(err: Error | null, response: Azure.ServiceBus.Response const ServiceBus = AzureSB.createServiceBusService('connectionstring'); // Queues -ServiceBus.listQueues('', createResultCallback()); +ServiceBus.listQueues(createResultCallback()); ServiceBus.createQueue('test', createResultCallback()); ServiceBus.createQueueIfNotExists('test', createResultCallback()); ServiceBus.getQueue('test', createResultCallback()); ServiceBus.deleteQueue('test', ResponseCallback); // Topics -ServiceBus.listTopics('', createResultCallback()); +ServiceBus.listTopics(createResultCallback()); ServiceBus.createTopic('test', createResultCallback()); ServiceBus.createTopicIfNotExists('test', createResultCallback()); ServiceBus.getTopic('test', createResultCallback()); diff --git a/types/azure-sb/index.d.ts b/types/azure-sb/index.d.ts index ba92395c0f..9f9d07d3dc 100644 --- a/types/azure-sb/index.d.ts +++ b/types/azure-sb/index.d.ts @@ -214,15 +214,15 @@ export namespace Azure.ServiceBus { // [x: string]: string | Dictionary; // } + export const ActiveMessageCount = 'd2p1:ActiveMessageCount'; + export const DeadLetterMessageCount = 'd2p1:DeadLetterMessageCount'; + export const ScheduledMessageCount = 'd2p1:ScheduledMessageCount'; + export const TransferMessageCount = 'd2p1:TransferMessageCount'; + export const TransferDeadLetterMessageCount = 'd2p1:TransferDeadLetterMessageCount'; + export interface Topic extends ExtendedBase { AccessedAt: DateString; - CountDetails: { - 'd2p1:ActiveMessageCount': string; - 'd2p1:DeadLetterMessageCount': string; - 'd2p1:ScheduledMessageCount': string; - 'd2p1:TransferMessageCount': string; - 'd2p1:TransferDeadLetterMessageCount': string; - }; + CountDetails: { [key: string]: string }; EnableSubscriptionPartitioning: string; FilteringMessagesBeforePublishing: string; IsExpress: string; @@ -242,13 +242,7 @@ export namespace Azure.ServiceBus { } export interface Subscription extends ExtendedBase { - CountDetails: { - 'd3p1:ActiveMessageCount': string; - 'd3p1:DeadLetterMessageCount': string; - 'd3p1:ScheduledMessageCount': string; - 'd3p1:TransferMessageCount': string; - 'd3p1:TransferDeadLetterMessageCount': string; - }; + CountDetails: { [key: string]: string }; DeadLetteringOnFilterEvaluationExceptions: string; DeadLetteringOnMessageExpiration: string; LockDuration: string; @@ -315,6 +309,8 @@ export namespace Azure.ServiceBus { export type CreateSubscriptionOptions = Partial; export type ListSubscriptionsOptions = Partial; export type ListRulesOptions = Partial; + export type ListTopicsOptions = Partial; + export type ListQueuesOptions = Partial; export type CreateRuleOptions = Partial; export type CreateNotificationHubOptions = Partial; export type ListNotificationHubsOptions = Partial; diff --git a/types/azure-sb/lib/servicebusservice.d.ts b/types/azure-sb/lib/servicebusservice.d.ts index 44f2b2c522..45600a1661 100644 --- a/types/azure-sb/lib/servicebusservice.d.ts +++ b/types/azure-sb/lib/servicebusservice.d.ts @@ -11,6 +11,8 @@ import CreateTopicOptions = Azure.ServiceBus.CreateTopicOptions; import ListNotificationHubsOptions = Azure.ServiceBus.ListNotificationHubsOptions; import ListRulesOptions = Azure.ServiceBus.ListRulesOptions; import ListSubscriptionsOptions = Azure.ServiceBus.ListSubscriptionsOptions; +import ListTopicsOptions = Azure.ServiceBus.ListTopicsOptions; +import ListQueuesOptions = Azure.ServiceBus.ListQueuesOptions; import MessageOrName = Azure.ServiceBus.MessageOrName; import Queue = Azure.ServiceBus.Results.Models.Queue; import ReceiveQueueMessageOptions = Azure.ServiceBus.ReceiveQueueMessageOptions; @@ -88,7 +90,8 @@ declare class ServiceBusService extends ServiceBusServiceBase { public getQueue(queuePath: string, callback: TypedResultAndResponseCallback): void; - public listQueues(queuePath: string, + public listQueues(callback: TypedResultAndResponseCallback): void; + public listQueues(options: ListQueuesOptions, callback: TypedResultAndResponseCallback): void; /* @@ -115,7 +118,8 @@ declare class ServiceBusService extends ServiceBusServiceBase { public getTopic(topicPath: string, callback: TypedResultAndResponseCallback): void; - public listTopics(topicPath: string, + public listTopics(callback: TypedResultAndResponseCallback): void; + public listTopics(options: ListTopicsOptions, callback: TypedResultAndResponseCallback): void; /* diff --git a/types/azure-sb/lib/servicebusserviceclient.d.ts b/types/azure-sb/lib/servicebusserviceclient.d.ts index c97b1e3107..1730b642c3 100644 --- a/types/azure-sb/lib/servicebusserviceclient.d.ts +++ b/types/azure-sb/lib/servicebusserviceclient.d.ts @@ -1,14 +1,13 @@ -/// -import EventEmitter = NodeJS.EventEmitter; +import ServiceClient = require('azure-sb/lib/serviceclient'); -declare class ServiceBusServiceClient extends EventEmitter { +declare class ServiceBusServiceClient extends ServiceClient { constructor(accessKey?: string, issuer?: string, sharedAccessKeyName?: string, sharedAccessKeyValue?: string, host?: string, acsHost?: string, - authenticationProvider?: object); + authenticationProvider?: object); } export = ServiceBusServiceClient; diff --git a/types/azure-sb/lib/serviceclient.d.ts b/types/azure-sb/lib/serviceclient.d.ts new file mode 100644 index 0000000000..3e39052235 --- /dev/null +++ b/types/azure-sb/lib/serviceclient.d.ts @@ -0,0 +1,8 @@ +/// +import EventEmitter = NodeJS.EventEmitter; +declare class ServiceClient extends EventEmitter { + public host: string; + public port: number; + public protocol: string; +} +export = ServiceClient; diff --git a/types/azure-sb/tsconfig.json b/types/azure-sb/tsconfig.json index 6e015480dc..61e37ac754 100644 --- a/types/azure-sb/tsconfig.json +++ b/types/azure-sb/tsconfig.json @@ -30,6 +30,7 @@ "lib/models/subscriptionresult.d.ts", "lib/models/notificationhubresult.d.ts", "lib/models/resourceresult.d.ts", + "lib/serviceclient.d.ts", "lib/servicebusserviceclient.d.ts", "lib/gcmservice.d.ts", "lib/wnsservice.d.ts", @@ -38,4 +39,4 @@ "azure-sb-tests.ts", "index.d.ts" ] -} \ No newline at end of file +} From b470489bc1825274193db2734b59b95e7add857a Mon Sep 17 00:00:00 2001 From: Ethan Resnick Date: Thu, 15 Mar 2018 16:23:40 -0400 Subject: [PATCH 0069/2153] ramda: support providing partially-applied prop(s) return type upfront --- types/ramda/index.d.ts | 2 ++ types/ramda/ramda-tests.ts | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 9b4ebf5a24..eb4b4569c6 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -1481,6 +1481,7 @@ declare namespace R { */ prop

    (p: P, obj: T): T[P]; prop

    (p: P): (obj: Record) => T; + prop

    (p: P): (obj: Record) => T; /** * Determines whether the given property of an object has a specific @@ -1519,6 +1520,7 @@ declare namespace R { */ props

    (ps: ReadonlyArray

    , obj: Record): T[]; props

    (ps: ReadonlyArray

    ): (obj: Record) => T[]; + props

    (ps: ReadonlyArray

    ): (obj: Record) => T[]; /** * Returns true if the specified object property satisfies the given predicate; false otherwise. diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index 933b468f09..dbb697e658 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -724,7 +724,9 @@ interface Obj { const list: Book[] = [{id: "xyz", title: "A"}, {id: "abc", title: "B"}]; const a1 = R.indexBy(R.prop("id"), list); const a2 = R.indexBy(R.prop("id"))(list); - const a3 = R.indexBy<{ id: string }>(R.prop("id"))(list); + const a3 = R.indexBy<{ id: string }>(R.prop("id"))(list); + const a4 = R.indexBy(R.prop<"id", string>("id"))(list); + const a5 = R.indexBy<{ id: string }>(R.prop<"id", string>("id"))(list); const titlesIndexedByTitles: { [k: string]: string } = R.pipe( R.map((x: Book) => x.title), @@ -1161,7 +1163,8 @@ type Pair = KeyValuePair; () => { const x = R.prop("x"); - const a: boolean = R.tryCatch(R.prop("x"), R.F)({x: true}); // => true + const a: boolean = R.tryCatch(R.prop("x"), R.F)({x: true}); // => true + const a1: boolean = R.tryCatch(R.prop<"x", true>("x"), R.F)({x: true}); // => true const b: boolean = R.tryCatch(R.prop("x"), R.F)(null); // => false const c: boolean = R.tryCatch(R.and, R.F)(true, true); // => true }; @@ -1754,7 +1757,7 @@ class Rectangle { const format = R.converge( R.call, [ - R.pipe<{}, number, (s: string) => string>(R.prop("indent"), indentN), + R.pipe(R.prop<"indent", number>("indent"), indentN), R.prop("value") ] ); From a82c070b7e48d432588658b5e8821e54f139fcd3 Mon Sep 17 00:00:00 2001 From: ckboyjiy Date: Fri, 16 Mar 2018 10:47:17 +0900 Subject: [PATCH 0070/2153] Added type definitions for Naver maps # Modification by reviewer's request --- navermaps/index.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/navermaps/index.d.ts b/navermaps/index.d.ts index a367238bf1..994c7218ff 100644 --- a/navermaps/index.d.ts +++ b/navermaps/index.d.ts @@ -1,6 +1,5 @@ -// Definitions by: Ckboyjiy // Type definitions for Naver Maps JavaScript API 3.0 -// Project: https://navermaps.github.io +// Project: https://navermaps.github.io/maps.js // Definitions by: Ckboyjiy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace naver.maps { From 07098e8640e36f41b2fcda505423f5806c6000f6 Mon Sep 17 00:00:00 2001 From: Peter Tribe Date: Thu, 15 Mar 2018 23:23:30 -0700 Subject: [PATCH 0071/2153] Fixed: added VRFrameData declare so you can now do the required 'new VRFrameData()' --- types/webvr-api/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/webvr-api/index.d.ts b/types/webvr-api/index.d.ts index afebeda0a9..72fea2097b 100644 --- a/types/webvr-api/index.d.ts +++ b/types/webvr-api/index.d.ts @@ -162,6 +162,11 @@ interface VRFrameData { readonly timestamp: number; } +declare var VRFrameData: { + prototype: VRFrameData + new(): VRFrameData +} + interface VRPose { readonly angularAcceleration: Float32Array | null; readonly angularVelocity: Float32Array | null; From e6406805ec9569e9820b4624df5c386ce99a526b Mon Sep 17 00:00:00 2001 From: Oblosys Date: Thu, 15 Mar 2018 11:50:12 +0100 Subject: [PATCH 0072/2153] [react] Add supressHydrationWarning to React.HTMLAttributes interface Added in 16.1.0 (https://github.com/facebook/react/releases/tag/v16.1.0) Docs: https://reactjs.org/docs/dom-elements.html#suppresshydrationwarning --- types/react/index.d.ts | 1 + types/react/test/tsx.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index d56d9571e1..e685f78d07 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -2450,6 +2450,7 @@ declare namespace React { defaultChecked?: boolean; defaultValue?: string | string[]; suppressContentEditableWarning?: boolean; + suppressHydrationWarning?: boolean; // Standard HTML Attributes accessKey?: string; diff --git a/types/react/test/tsx.tsx b/types/react/test/tsx.tsx index 4ad5a3e2c8..7fa151fd29 100644 --- a/types/react/test/tsx.tsx +++ b/types/react/test/tsx.tsx @@ -37,6 +37,7 @@ StatelessComponent2.defaultProps = { defaultValue="some value" contentEditable suppressContentEditableWarning + suppressHydrationWarning > foo

    ; From a8dfe1e8c0650aa5b8658e93a2e90fcfa29941c2 Mon Sep 17 00:00:00 2001 From: Oblosys Date: Thu, 15 Mar 2018 12:19:10 +0100 Subject: [PATCH 0073/2153] [react] Bump minor version: 16.0 ~> 16.1 --- types/react/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index e685f78d07..513a5cd2ce 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for React 16.0 +// Type definitions for React 16.1 // Project: http://facebook.github.io/react/ // Definitions by: Asana // AssureSign From dd181a9856463bd7eba25f02e0f2d4f1e87453cc Mon Sep 17 00:00:00 2001 From: Volker Nauruhn Date: Fri, 16 Mar 2018 17:11:04 +0100 Subject: [PATCH 0074/2153] corrected signature for generic named methods executed by triggerMethod in collectionView --- types/backbone.marionette/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/backbone.marionette/index.d.ts b/types/backbone.marionette/index.d.ts index cd8ccd3821..52f316ace1 100644 --- a/types/backbone.marionette/index.d.ts +++ b/types/backbone.marionette/index.d.ts @@ -1394,27 +1394,27 @@ export class CollectionView, childView: TView): void; /** * This callback function allows you to know when a child / child view * instance has been added to the collection view. It provides access to * the view instance for the child that was added. */ - onAddChild(childView: TView): void; + onAddChild(collectionView: CollectionView, childView: TView): void; /** * This callback function allows you to know when a childView instance is * about to be removed from the collectionView. It provides access to the * view instance for the child that was removed. */ - onBeforeRemoveChild(childView: TView): void; + onBeforeRemoveChild(collectionView: CollectionView, childView: TView): void; /** * This callback function allows you to know when a child / childView * instance has been deleted or removed from the collection. */ - onRemoveChild(childView: TView): void; + onRemoveChild(collectionView: CollectionView, childView: TView): void; /** * Automatically destroys this Collection's children and cleans up From 11421a98b0b55b6cd28cc3561960f4aa02653b05 Mon Sep 17 00:00:00 2001 From: Volker Nauruhn Date: Fri, 16 Mar 2018 17:14:57 +0100 Subject: [PATCH 0075/2153] added me to contributor list --- types/backbone.marionette/index.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/types/backbone.marionette/index.d.ts b/types/backbone.marionette/index.d.ts index 52f316ace1..7626d60d56 100644 --- a/types/backbone.marionette/index.d.ts +++ b/types/backbone.marionette/index.d.ts @@ -1,6 +1,9 @@ // Type definitions for Marionette 3.3 // Project: https://github.com/marionettejs/ -// Definitions by: Zeeshan Hamid , Natan Vivo , Sven Tschui +// Definitions by: Zeeshan Hamid , +// Natan Vivo , +// Sven Tschui , +// Volker Nauruhn // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 From 0284a8f28960e7abc252365e8426051871d9c089 Mon Sep 17 00:00:00 2001 From: Christian Rackerseder Date: Sat, 17 Mar 2018 00:37:23 +0100 Subject: [PATCH 0076/2153] Exports missing interface --- types/tiny-slider-react/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/tiny-slider-react/index.d.ts b/types/tiny-slider-react/index.d.ts index b509595f81..9cf22beab7 100644 --- a/types/tiny-slider-react/index.d.ts +++ b/types/tiny-slider-react/index.d.ts @@ -5,7 +5,7 @@ // TypeScript Version: 2.6 import * as React from "react"; -interface CommonOptions { +export interface CommonOptions { /** * The initial index of the slider. * @defaultValue 0 From f3e8b658b7353545455099e49b5b7ca69230d59d Mon Sep 17 00:00:00 2001 From: denis Date: Sat, 17 Mar 2018 13:06:42 +0100 Subject: [PATCH 0077/2153] Remove useless events functions --- types/select2/index.d.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/types/select2/index.d.ts b/types/select2/index.d.ts index 51e297a9a8..4ded9f2c23 100644 --- a/types/select2/index.d.ts +++ b/types/select2/index.d.ts @@ -199,16 +199,6 @@ interface JQuery { on(events: "select2-loaded", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; on(events: "select2-focus", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; on(events: "select2-blur", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2-opening", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2-open", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2-close", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2-highlight", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2-selecting", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2-removing", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2-removed", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2-loaded", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2-focus", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2-blur", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; } declare class Select2 { From 68bd62d8e499526b4fe00f57fe3b9efbfb980d8a Mon Sep 17 00:00:00 2001 From: denis Date: Sat, 17 Mar 2018 13:07:46 +0100 Subject: [PATCH 0078/2153] Copy content of select2 dir to select2/v3 --- types/select2/v3/index.d.ts | 217 ++++++++++++++++++++++++++++ types/select2/v3/select2-tests.ts | 230 ++++++++++++++++++++++++++++++ types/select2/v3/tsconfig.json | 24 ++++ types/select2/v3/tslint.json | 79 ++++++++++ 4 files changed, 550 insertions(+) create mode 100644 types/select2/v3/index.d.ts create mode 100644 types/select2/v3/select2-tests.ts create mode 100644 types/select2/v3/tsconfig.json create mode 100644 types/select2/v3/tslint.json diff --git a/types/select2/v3/index.d.ts b/types/select2/v3/index.d.ts new file mode 100644 index 0000000000..4ded9f2c23 --- /dev/null +++ b/types/select2/v3/index.d.ts @@ -0,0 +1,217 @@ +// Type definitions for Select2 4.0.1 +// Project: http://ivaynberg.github.com/select2/ +// Definitions by: Boris Yankov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + + +/// + +interface Select2QueryOptions { + term?: string; + page?: number; + context?: any; + callback?: (result: { results: any; more?: boolean; context?: any; }) => void; +} + +interface AjaxFunction { + (settings: JQueryAjaxSettings, success?: (data: any) => null, failure?: () => null): JQueryXHR; +} + +interface Select2AjaxOptions extends JQueryAjaxSettings { + transport?: AjaxFunction; + /** + * Url to make request to, Can be string or a function returning a string. + */ + url?: any; + dataType?: string; + delay?: number; + headers?: any; + cache?: boolean; + data?: (params: Select2QueryOptions, page: number, context: any) => any; + results?: (term: any, page: number, context: any) => any; + processResults?: (data: any, params: any) => any; + templateResult?: (data: any) => any; + templateSelection?: (data: any) => any; +} + +interface IdTextPair { + id: any; + text: string; +} + +interface Select2Options { + amdBase?: string; + amdLanguageBase?: string; + width?: string; + dropdownAutoWidth?: boolean; + minimumInputLength?: number; + maximumInputLength?: number; + minimumResultsForSearch?: number; + maximumSelectionLength?: number; + placeholder?: string | IdTextPair; + separator?: string; + allowClear?: boolean; + multiple?: boolean; + disabled?: boolean; + closeOnSelect?: boolean; + openOnEnter?: boolean; + id?: (object: any) => string; + matcher?: (term: string, text: string, option: any) => boolean; + formatSelection?: (object: any, container: JQuery, escapeMarkup: (markup: string) => string) => string; + formatResult?: (object: any, container: JQuery, query: any, escapeMarkup: (markup: string) => string) => string; + formatResultCssClass?: (object: any) => string; + formatNoMatches?: (term: string) => string; + formatSearching?: () => string; + formatInputTooShort?: (term: string, minLength: number) => string; + formatSelectionTooBig?: (maxSize: number) => string; + formatLoadMore?: (pageNumber: number) => string; + createSearchChoice?: (term: string, data: any) => any; + initSelection?: (element: JQuery, callback: (data: any) => void) => void; + tokenizer?: (input: string, selection: any[], selectCallback: () => void, options: Select2Options) => string; + tokenSeparators?: string[]; + query?: (options: Select2QueryOptions) => void; + ajax?: Select2AjaxOptions; + data?: any; + tags?: any; + createTag?: any; + containerCss?: any; + containerCssClass?: any; + dropdownCss?: any; + dropdownCssClass?: any; + escapeMarkup?: (markup: string) => string; + theme?: string; + /** + * Template can return both plain string that will be HTML escaped and a jquery object that can render HTML + */ + templateSelection?: (object: Select2SelectionObject, container: JQuery) => any; + templateResult?: (object: Select2SelectionObject) => any; + language?: string | string[] | {}; + selectOnClose?: boolean; + sorter?: (data: any[]) => any[]; + dropdownParent?: JQuery; + debug?: boolean; + dropdownAdapter?: any; + selectionAdapter?: any; + resultsAdapter?: any; +} + +interface Select2JQueryEventObject extends JQueryEventObject { + val: any; + added: any; + removed: any; + choice: { + id: any; + text: string; + }; +} + +interface Select2SelectionObject { + loading: boolean; + disabled: boolean; + element: HTMLOptionElement; + id: string; + selected: boolean; + text: string; + title: string; +} + +interface Select2Plugin { + amd: any; + + (): JQuery; + (it: IdTextPair): JQuery; + + /** + * Get the id value of the current selection + */ + (method: 'val'): any; + /** + * Set the id value of the current selection + * @params value Value to set the id to + * @params triggerChange Should a change event be triggered + */ + (method: 'val', value: any, triggerChange?: boolean): any; + /** + * Get the data object of the current selection + */ + (method: 'data'): any; + /** + * Set the data of the current selection + * @params value Object to set the data to + * @params triggerChange Should a change event be triggered + */ + (method: 'data', value: any, triggerChange?: boolean): any; + /** + * Reverts changes to DOM done by Select2. Any selection done via Select2 will be preserved. + */ + (method: 'destroy'): JQuery; + /** + * Opens the dropdown + */ + (method: 'open'): JQuery; + /** + * Closes the dropdown + */ + (method: 'close'): JQuery; + /** + * Enables or disables Select2 and its underlying form component + * @param value True if it should be enabled false if it should be disabled + */ + (method: 'enable', value: boolean): JQuery; + /** + * Toggles readonly mode on Select2 and its underlying form component + * @param value True if it should be readonly false if it should be read write + */ + (method: 'readonly', value: boolean): JQuery; + /** + * Retrieves the main container element that wraps all of DOM added by Select2 + */ + (method: 'container'): JQuery; + /** + * Notifies Select2 that a drag and drop sorting operation has started + */ + (method: 'onSortStart'): JQuery; + /** + * Notifies Select2 that a drag and drop sorting operation has finished + */ + (method: 'onSortEnd'): JQuery; + + (method: string): any; + (method: string, value: any, trigger?: boolean): any; + (options: Select2Options): JQuery; +} + +interface JQuery { + select2: Select2Plugin; + off(events?: "change", selector?: any, handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + + on(events: "change", selector?: string, data?: any, handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + on(events: "change", selector?: string, handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + on(events: "change", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + on(events: "select2-opening", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + on(events: "select2-open", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + on(events: "select2-close", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + on(events: "select2-highlight", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + on(events: "select2-selecting", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + on(events: "select2-removing", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + on(events: "select2-removed", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + on(events: "select2-loaded", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + on(events: "select2-focus", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + on(events: "select2-blur", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; +} + +declare class Select2 { + constructor(element: JQuery, options: Select2Options); + focus(): void; + destroy(): void; + on(event: string, callback: Function): void; + selection: any; + dropdown: any; + results: any; + $container: JQuery; + $dropdown: JQuery; + $selection: JQuery; + $results: JQuery; + options: { options: Select2Options }; +} diff --git a/types/select2/v3/select2-tests.ts b/types/select2/v3/select2-tests.ts new file mode 100644 index 0000000000..29da3b6f81 --- /dev/null +++ b/types/select2/v3/select2-tests.ts @@ -0,0 +1,230 @@ +$("#e9").select2(); +$("#e2").select2({ + placeholder: "Select a State", + allowClear: true +}); +$("#e2_2").select2({ + placeholder: "Select a State" +}); +$("#e2_3").select2({ + placeholder: { id: "1", text: "Select options" } +}); +$("#e3").select2({ + minimumInputLength: 2 +}); +function format(state) { + if (!state.id) return state.text; + return "" + state.text; +} +$("#e4").select2({ + formatResult: format, + formatSelection: format +}); +$("#e5").select2({ + minimumInputLength: 1, + query: function (query) { + var data = { results: [] }, i, j, s; + for (i = 1; i < 5; i++) { + s = ""; + for (j = 0; j < i; j++) { s = s + query.term; } + data.results.push({ id: query.term + i, text: s }); + } + } +}); + +$("#e19").select2({ maximumSelectionLength: 3 }); +$("#e10").select2({ + data: [{ id: 0, text: 'enhancement' }, { id: 1, text: 'bug' }, { id: 2, text: 'duplicate' }, { id: 3, text: 'invalid' }, { id: 4, text: 'wontfix' }] +}); + +var data = [{ id: 0, tag: 'enhancement' }, { id: 1, tag: 'bug' }, { id: 2, tag: 'duplicate' }, { id: 3, tag: 'invalid' }, { id: 4, tag: 'wontfix' }]; + +$("#e10_2").select2({ + data: { results: data, text: 'tag' }, + formatSelection: format, + formatResult: format +}); + +$("#e10_3").select2({ + data: { results: data, text: function (item) { console.log('called with', item); return item.tag; } }, + formatSelection: format, + formatResult: format +}); +var movieFormatResult, movieFormatSelection; +$("#e6").select2({ + placeholder: "Search for a movie", + minimumInputLength: 1, + ajax: { + url: "http://api.rottentomatoes.com/api/public/v1.0/movies.json", + dataType: 'jsonp', + cache: false, + data: function (params, page) { + return { + q: params.term, + page_limit: 10, + apikey: "ju6z9mjyajq2djue3gbvv26t" + }; + }, + results: function (data, page) { + return { results: data.movies }; + } + }, + formatResult: movieFormatResult, + formatSelection: movieFormatSelection, + dropdownCssClass: "bigdrop" +}); +$("#e6").select2({ + placeholder: "Search for a movie", + minimumInputLength: 1, + ajax: { + url: () => { return "http://api.rottentomatoes.com/api/public/v1.0/movies.json"; }, + dataType: 'jsonp', + data: function (params, page) { + return { + q: params.term, + page_limit: 10, + apikey: "ju6z9mjyajq2djue3gbvv26t" + }; + }, + results: function (data, page) { + return { results: data.movies }; + } + }, + formatResult: movieFormatResult, + formatSelection: movieFormatSelection, + dropdownCssClass: "bigdrop" +}); +$("#e6").select2({ + placeholder: "Search for a movie", + minimumInputLength: 1, + ajax: { + url: "http://api.rottentomatoes.com/api/public/v1.0/movies.json", + type: 'GET', + dataType: 'jsonp', + cache: false, + data: function (params, page) { + return { + q: params.term, + page_limit: 10, + apikey: "ju6z9mjyajq2djue3gbvv26t" + }; + }, + results: function (data, page) { + return { results: data.movies }; + } + }, + formatResult: movieFormatResult, + formatSelection: movieFormatSelection, + dropdownCssClass: "bigdrop" +}); +$("#e7").select2({ + placeholder: "Search for a movie", + minimumInputLength: 3, + ajax: { + url: "http://api.rottentomatoes.com/api/public/v1.0/movies.json", + dataType: 'jsonp', + delay: 100, + data: function (params, page) { + return { + q: params.term, + page_limit: 10, + page: page, + apikey: "ju6z9mjyajq2djue3gbvv26t" + }; + }, + results: function (data, page) { + var more = (page * 10) < data.total; + return { results: data.movies, more: more }; + } + }, + formatResult: movieFormatResult, + formatSelection: movieFormatSelection, + dropdownCssClass: "bigdrop" +}); + +function sort(elements) { + return elements.sort(); +} +$("#e20").select2({ + sorter: sort +}); + +$("#e8").select2(); +$("#e8_get").click(function () { alert("Selected value is: " + $("#e8").select2("val")); }); +$("#e8_set").click(function () { $("#e8").select2("val", "CA"); }); +$("#e8_cl").click(function () { $("#e8").select2("val", ""); }); +$("#e8_get2").click(function () { alert("Selected data is: " + JSON.stringify($("#e8").select2("data"))); }); +$("#e8_set2").click(function () { $("#e8").select2("data", { id: "CA", text: "California" }); }); +$("#e8_open").click(function () { $("#e8").select2("open"); }); +$("#e8_close").click(function () { $("#e8").select2("close"); }); +$("#e8_2").select2(); +$("#e8_2_get").click(function () { alert("Selected value is: " + $("#e8_2").select2("val")); }); +$("#e8_2_set").click(function () { $("#e8_2").select2("val", ["CA", "MA"]); }); +$("#e8_2_get2").click(function () { alert("Selected value is: " + JSON.stringify($("#e8_2").select2("data"))); }); +$("#e8_2_set2").click(function () { $("#e8_2").select2("data", [{ id: "CA", text: "California" }, { id: "MA", text: "Massachusetts" }]); }); +$("#e8_2_cl").click(function () { $("#e8_2").select2("val", ""); }); +$("#e8_2_open").click(function () { $("#e8_2").select2("open"); }); +$("#e8_2_close").click(function () { $("#e8_2").select2("close"); }); +$("#e11").select2({ + placeholder: "Select report type", + allowClear: true, + data: [{ id: 0, text: 'story' }, { id: 1, text: 'bug' }, { id: 2, text: 'task' }] +}); +$("#e11_2").select2({ + createSearchChoice: function (term, data) { if ($(data).filter(function () { return this.textContent.localeCompare(term) === 0; }).length === 0) { return { id: term, text: term }; } }, + multiple: true, + data: [{ id: 0, text: 'story' }, { id: 1, text: 'bug' }, { id: 2, text: 'task' }] +}); +function log(e) { + var item = $("
  • " + e + "
  • "); + $("#events_11").append(item); + item.animate({ opacity: 1 }, 10000, 'linear', function () { item.animate({ opacity: 0 }, 2000, 'linear', function () { item.remove(); }); }); +} +$("#e11") + // TS 0.9.5: correct overload not resolved https://typescript.codeplex.com/discussions/472172 + .on("change", function (e: Select2JQueryEventObject) { log(JSON.stringify({ val: e.val, added: e.added, removed: e.removed })); }) + .on("open", function () { log("open"); }); +$("#e11_2") + .on("change", function (e: Select2JQueryEventObject) { log(JSON.stringify({ val: e.val, added: e.added, removed: e.removed })); }) + .on("open", function () { log("open"); }); +$("#e12").select2({ tags: ["red", "green", "blue"] }); +$("#e20").select2({ + tags: ["red", "green", "blue"], + tokenSeparators: [",", " "] +}); +$("#e13").select2(); +$("#e13_ca").click(function () { $("#e13").val("CA").trigger("change"); }); +$("#e13_ak_co").click(function () { $("#e13").val(["AK", "CO"]).trigger("change"); }); +$("#e14").val(["AL", "AZ"]).select2(); +$("#e14_init").click(function () { $("#e14").select2(); }); +$("#e14_destroy").click(function () { $("#e14").select2("destroy"); }); +$("#e15").select2({ tags: ["red", "green", "blue", "orange", "white", "black", "purple", "cyan", "teal"] }); +$("#e15").on("change", function () { $("#e15_val").html($("#e15").val() as string); }); + +$("#e16").select2(); +$("#e16_2").select2(); +$("#e16_enable").click(function () { $("#e16,#e16_2").select2("enable"); }); +$("#e16_disable").click(function () { $("#e16,#e16_2").select2("disable"); }); +$("#e17").select2({ + matcher: function (term, text) { return text.toUpperCase().indexOf(term.toUpperCase()) == 0; } +}); +$("#e17_2").select2({ + matcher: function (term, text, opt) { + return text.toUpperCase().indexOf(term.toUpperCase()) >= 0 + || opt.attr("alt").toUpperCase().indexOf(term.toUpperCase()) >= 0; + } +}); +$("#e18,#e18_2").select2(); +alert("Selected value is: " + $("#e8").select2("val")); $("#e8").select2("val", { id: "CA", text: "Califoria" }); + +$("#e8").select2("val"); +$("#e8").select2("val", "CA"); +$("#e8").select2("data"); +$("#e8").select2("data", { id: "CA", text: "Califoria" }); +$("#e8").select2("destroy"); +$("#e8").select2("open"); +$("#e8").select2("enable", false); +$("#e8").select2("readonly", false); +$("#e8").select2('container'); +$("#e8").select2('onSortStart'); +$("#e8").select2('onSortEnd'); diff --git a/types/select2/v3/tsconfig.json b/types/select2/v3/tsconfig.json new file mode 100644 index 0000000000..292cf878b4 --- /dev/null +++ b/types/select2/v3/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": false, + "noImplicitThis": false, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "select2-tests.ts" + ] +} \ No newline at end of file diff --git a/types/select2/v3/tslint.json b/types/select2/v3/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/select2/v3/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} From 21d69f189b359c49fde94f3c7a7fe4028e102de9 Mon Sep 17 00:00:00 2001 From: denis Date: Sat, 17 Mar 2018 13:24:00 +0100 Subject: [PATCH 0079/2153] Remove v4 types in v3 --- types/select2/v3/index.d.ts | 73 +++++++------------------------ types/select2/v3/select2-tests.ts | 28 +++++------- types/select2/v3/tsconfig.json | 9 +++- 3 files changed, 33 insertions(+), 77 deletions(-) diff --git a/types/select2/v3/index.d.ts b/types/select2/v3/index.d.ts index 4ded9f2c23..21bb2611c7 100644 --- a/types/select2/v3/index.d.ts +++ b/types/select2/v3/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Select2 4.0.1 +// Type definitions for Select2 3.5 // Project: http://ivaynberg.github.com/select2/ // Definitions by: Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -15,7 +15,8 @@ interface Select2QueryOptions { } interface AjaxFunction { - (settings: JQueryAjaxSettings, success?: (data: any) => null, failure?: () => null): JQueryXHR; + (settings: JQueryAjaxSettings): JQueryXHR; + (url: string, settings?: JQueryAjaxSettings): JQueryXHR; } interface Select2AjaxOptions extends JQueryAjaxSettings { @@ -25,14 +26,12 @@ interface Select2AjaxOptions extends JQueryAjaxSettings { */ url?: any; dataType?: string; - delay?: number; - headers?: any; + quietMillis?: number; cache?: boolean; - data?: (params: Select2QueryOptions, page: number, context: any) => any; + jsonpCallback?: any; + data?: (term: string, page: number, context: any) => any; results?: (term: any, page: number, context: any) => any; - processResults?: (data: any, params: any) => any; - templateResult?: (data: any) => any; - templateSelection?: (data: any) => any; + params?: any; } interface IdTextPair { @@ -41,19 +40,16 @@ interface IdTextPair { } interface Select2Options { - amdBase?: string; - amdLanguageBase?: string; width?: string; dropdownAutoWidth?: boolean; minimumInputLength?: number; maximumInputLength?: number; minimumResultsForSearch?: number; - maximumSelectionLength?: number; - placeholder?: string | IdTextPair; + maximumSelectionSize?: number; + placeholder?: string; separator?: string; allowClear?: boolean; multiple?: boolean; - disabled?: boolean; closeOnSelect?: boolean; openOnEnter?: boolean; id?: (object: any) => string; @@ -74,26 +70,11 @@ interface Select2Options { ajax?: Select2AjaxOptions; data?: any; tags?: any; - createTag?: any; containerCss?: any; containerCssClass?: any; dropdownCss?: any; dropdownCssClass?: any; escapeMarkup?: (markup: string) => string; - theme?: string; - /** - * Template can return both plain string that will be HTML escaped and a jquery object that can render HTML - */ - templateSelection?: (object: Select2SelectionObject, container: JQuery) => any; - templateResult?: (object: Select2SelectionObject) => any; - language?: string | string[] | {}; - selectOnClose?: boolean; - sorter?: (data: any[]) => any[]; - dropdownParent?: JQuery; - debug?: boolean; - dropdownAdapter?: any; - selectionAdapter?: any; - resultsAdapter?: any; } interface Select2JQueryEventObject extends JQueryEventObject { @@ -106,19 +87,7 @@ interface Select2JQueryEventObject extends JQueryEventObject { }; } -interface Select2SelectionObject { - loading: boolean; - disabled: boolean; - element: HTMLOptionElement; - id: string; - selected: boolean; - text: string; - title: string; -} - interface Select2Plugin { - amd: any; - (): JQuery; (it: IdTextPair): JQuery; @@ -158,7 +127,7 @@ interface Select2Plugin { * Enables or disables Select2 and its underlying form component * @param value True if it should be enabled false if it should be disabled */ - (method: 'enable', value: boolean): JQuery; + (method: 'enable', value?: boolean): JQuery; /** * Toggles readonly mode on Select2 and its underlying form component * @param value True if it should be readonly false if it should be read write @@ -176,9 +145,11 @@ interface Select2Plugin { * Notifies Select2 that a drag and drop sorting operation has finished */ (method: 'onSortEnd'): JQuery; + /** + * Executes a new search using the provided value. Example: $("#tags").select2("search", "California") + */ + (method: 'search'): JQuery; - (method: string): any; - (method: string, value: any, trigger?: boolean): any; (options: Select2Options): JQuery; } @@ -194,24 +165,10 @@ interface JQuery { on(events: "select2-close", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; on(events: "select2-highlight", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; on(events: "select2-selecting", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + on(events: "select2-clearing", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; on(events: "select2-removing", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; on(events: "select2-removed", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; on(events: "select2-loaded", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; on(events: "select2-focus", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; on(events: "select2-blur", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; } - -declare class Select2 { - constructor(element: JQuery, options: Select2Options); - focus(): void; - destroy(): void; - on(event: string, callback: Function): void; - selection: any; - dropdown: any; - results: any; - $container: JQuery; - $dropdown: JQuery; - $selection: JQuery; - $results: JQuery; - options: { options: Select2Options }; -} diff --git a/types/select2/v3/select2-tests.ts b/types/select2/v3/select2-tests.ts index 29da3b6f81..3b331cec3b 100644 --- a/types/select2/v3/select2-tests.ts +++ b/types/select2/v3/select2-tests.ts @@ -6,9 +6,6 @@ $("#e2").select2({ $("#e2_2").select2({ placeholder: "Select a State" }); -$("#e2_3").select2({ - placeholder: { id: "1", text: "Select options" } -}); $("#e3").select2({ minimumInputLength: 2 }); @@ -32,7 +29,7 @@ $("#e5").select2({ } }); -$("#e19").select2({ maximumSelectionLength: 3 }); +$("#e19").select2({ maximumSelectionSize: 3 }); $("#e10").select2({ data: [{ id: 0, text: 'enhancement' }, { id: 1, text: 'bug' }, { id: 2, text: 'duplicate' }, { id: 3, text: 'invalid' }, { id: 4, text: 'wontfix' }] }); @@ -58,9 +55,9 @@ $("#e6").select2({ url: "http://api.rottentomatoes.com/api/public/v1.0/movies.json", dataType: 'jsonp', cache: false, - data: function (params, page) { + data: function (term, page) { return { - q: params.term, + q: term, page_limit: 10, apikey: "ju6z9mjyajq2djue3gbvv26t" }; @@ -79,9 +76,9 @@ $("#e6").select2({ ajax: { url: () => { return "http://api.rottentomatoes.com/api/public/v1.0/movies.json"; }, dataType: 'jsonp', - data: function (params, page) { + data: function (term, page) { return { - q: params.term, + q: term, page_limit: 10, apikey: "ju6z9mjyajq2djue3gbvv26t" }; @@ -102,9 +99,9 @@ $("#e6").select2({ type: 'GET', dataType: 'jsonp', cache: false, - data: function (params, page) { + data: function (term, page) { return { - q: params.term, + q: term, page_limit: 10, apikey: "ju6z9mjyajq2djue3gbvv26t" }; @@ -123,10 +120,10 @@ $("#e7").select2({ ajax: { url: "http://api.rottentomatoes.com/api/public/v1.0/movies.json", dataType: 'jsonp', - delay: 100, - data: function (params, page) { + quietMillis: 100, + data: function (term, page) { return { - q: params.term, + q: term, page_limit: 10, page: page, apikey: "ju6z9mjyajq2djue3gbvv26t" @@ -145,9 +142,6 @@ $("#e7").select2({ function sort(elements) { return elements.sort(); } -$("#e20").select2({ - sorter: sort -}); $("#e8").select2(); $("#e8_get").click(function () { alert("Selected value is: " + $("#e8").select2("val")); }); @@ -204,7 +198,7 @@ $("#e15").on("change", function () { $("#e15_val").html($("#e15").val() as strin $("#e16").select2(); $("#e16_2").select2(); $("#e16_enable").click(function () { $("#e16,#e16_2").select2("enable"); }); -$("#e16_disable").click(function () { $("#e16,#e16_2").select2("disable"); }); +$("#e16_disable").click(function () { $("#e16,#e16_2").select2("enable", false); }); $("#e17").select2({ matcher: function (term, text) { return text.toUpperCase().indexOf(term.toUpperCase()) == 0; } }); diff --git a/types/select2/v3/tsconfig.json b/types/select2/v3/tsconfig.json index 292cf878b4..8b8f30ed05 100644 --- a/types/select2/v3/tsconfig.json +++ b/types/select2/v3/tsconfig.json @@ -9,11 +9,16 @@ "noImplicitThis": false, "strictNullChecks": false, "strictFunctionTypes": true, - "baseUrl": "../", + "baseUrl": "../../", "typeRoots": [ - "../" + "../../" ], "types": [], + "paths": { + "select2": [ + "select2/v3" + ] + }, "noEmit": true, "forceConsistentCasingInFileNames": true }, From 2b9ce28409b9a8b26b20b4f7bd8e8aabf73658f6 Mon Sep 17 00:00:00 2001 From: denis Date: Sat, 17 Mar 2018 13:30:32 +0100 Subject: [PATCH 0080/2153] Remove v3 types in v4 --- types/select2/index.d.ts | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/types/select2/index.d.ts b/types/select2/index.d.ts index 4ded9f2c23..0d7da1fe0f 100644 --- a/types/select2/index.d.ts +++ b/types/select2/index.d.ts @@ -1,10 +1,9 @@ -// Type definitions for Select2 4.0.1 +// Type definitions for Select2 4.0 // Project: http://ivaynberg.github.com/select2/ // Definitions by: Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 - /// interface Select2QueryOptions { @@ -66,7 +65,6 @@ interface Select2Options { formatInputTooShort?: (term: string, minLength: number) => string; formatSelectionTooBig?: (maxSize: number) => string; formatLoadMore?: (pageNumber: number) => string; - createSearchChoice?: (term: string, data: any) => any; initSelection?: (element: JQuery, callback: (data: any) => void) => void; tokenizer?: (input: string, selection: any[], selectCallback: () => void, options: Select2Options) => string; tokenSeparators?: string[]; @@ -92,8 +90,6 @@ interface Select2Options { dropdownParent?: JQuery; debug?: boolean; dropdownAdapter?: any; - selectionAdapter?: any; - resultsAdapter?: any; } interface Select2JQueryEventObject extends JQueryEventObject { @@ -189,22 +185,22 @@ interface JQuery { on(events: "change", selector?: string, data?: any, handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; on(events: "change", selector?: string, handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; on(events: "change", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2-opening", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2-open", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2-close", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2-highlight", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2-selecting", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2-removing", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2-removed", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2-loaded", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2-focus", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2-blur", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + on(events: "select2:closing", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + on(events: "select2:close", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + on(events: "select2:opening", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + on(events: "select2:open", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + on(events: "select2:selecting", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + on(events: "select2:select", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + on(events: "select2:unselecting", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; + on(events: "select2:unselect", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; } declare class Select2 { constructor(element: JQuery, options: Select2Options); focus(): void; destroy(): void; + // TODO: Don't use 'Function' as a type. + // tslint:disable-next-line:ban-types on(event: string, callback: Function): void; selection: any; dropdown: any; From cee3ed319799b5acb1670b22576bdec220481fd6 Mon Sep 17 00:00:00 2001 From: denis Date: Sat, 17 Mar 2018 13:57:01 +0100 Subject: [PATCH 0081/2153] Linting v4 Remove all but unified-signatures rules in tslint. Activate noImplicitAny and noImplicitThis. Change code in select2-test and index according to the new styling rules. --- types/select2/index.d.ts | 13 ++-- types/select2/select2-tests.ts | 116 ++++++++++++++++++--------------- types/select2/tsconfig.json | 4 +- types/select2/tslint.json | 75 +-------------------- 4 files changed, 71 insertions(+), 137 deletions(-) diff --git a/types/select2/index.d.ts b/types/select2/index.d.ts index 0d7da1fe0f..3f04a52414 100644 --- a/types/select2/index.d.ts +++ b/types/select2/index.d.ts @@ -13,15 +13,14 @@ interface Select2QueryOptions { callback?: (result: { results: any; more?: boolean; context?: any; }) => void; } -interface AjaxFunction { - (settings: JQueryAjaxSettings, success?: (data: any) => null, failure?: () => null): JQueryXHR; -} +type AjaxFunction = + (settings: JQueryAjaxSettings, success?: (data: any) => null, failure?: () => null) => JQueryXHR; interface Select2AjaxOptions extends JQueryAjaxSettings { transport?: AjaxFunction; /** - * Url to make request to, Can be string or a function returning a string. - */ + * Url to make request to, can be string or a function returning a string. + */ url?: any; dataType?: string; delay?: number; @@ -80,8 +79,8 @@ interface Select2Options { escapeMarkup?: (markup: string) => string; theme?: string; /** - * Template can return both plain string that will be HTML escaped and a jquery object that can render HTML - */ + * Template can return both plain string that will be HTML escaped and a jquery object that can render HTML + */ templateSelection?: (object: Select2SelectionObject, container: JQuery) => any; templateResult?: (object: Select2SelectionObject) => any; language?: string | string[] | {}; diff --git a/types/select2/select2-tests.ts b/types/select2/select2-tests.ts index 29da3b6f81..0a5458063a 100644 --- a/types/select2/select2-tests.ts +++ b/types/select2/select2-tests.ts @@ -12,9 +12,9 @@ $("#e2_3").select2({ $("#e3").select2({ minimumInputLength: 2 }); -function format(state) { +function format(state: any) { if (!state.id) return state.text; - return "" + state.text; + return `` + state.text; } $("#e4").select2({ formatResult: format, @@ -22,11 +22,11 @@ $("#e4").select2({ }); $("#e5").select2({ minimumInputLength: 1, - query: function (query) { - var data = { results: [] }, i, j, s; - for (i = 1; i < 5; i++) { - s = ""; - for (j = 0; j < i; j++) { s = s + query.term; } + query(query) { + const data = { results: [] as IdTextPair[] }; + for (let i = 1; i < 5; i++) { + let s = ""; + for (let j = 0; j < i; j++) { s = s + query.term; } data.results.push({ id: query.term + i, text: s }); } } @@ -37,7 +37,7 @@ $("#e10").select2({ data: [{ id: 0, text: 'enhancement' }, { id: 1, text: 'bug' }, { id: 2, text: 'duplicate' }, { id: 3, text: 'invalid' }, { id: 4, text: 'wontfix' }] }); -var data = [{ id: 0, tag: 'enhancement' }, { id: 1, tag: 'bug' }, { id: 2, tag: 'duplicate' }, { id: 3, tag: 'invalid' }, { id: 4, tag: 'wontfix' }]; +const data = [{ id: 0, tag: 'enhancement' }, { id: 1, tag: 'bug' }, { id: 2, tag: 'duplicate' }, { id: 3, tag: 'invalid' }, { id: 4, tag: 'wontfix' }]; $("#e10_2").select2({ data: { results: data, text: 'tag' }, @@ -46,11 +46,18 @@ $("#e10_2").select2({ }); $("#e10_3").select2({ - data: { results: data, text: function (item) { console.log('called with', item); return item.tag; } }, + data: { + results: data, + text: (item: {tag: string}) => { + console.log('called with', item); + return item.tag; + }}, formatSelection: format, formatResult: format }); -var movieFormatResult, movieFormatSelection; + +let movieFormatResult; +let movieFormatSelection; $("#e6").select2({ placeholder: "Search for a movie", minimumInputLength: 1, @@ -58,14 +65,14 @@ $("#e6").select2({ url: "http://api.rottentomatoes.com/api/public/v1.0/movies.json", dataType: 'jsonp', cache: false, - data: function (params, page) { + data(params, page) { return { q: params.term, page_limit: 10, apikey: "ju6z9mjyajq2djue3gbvv26t" }; }, - results: function (data, page) { + results(data, page) { return { results: data.movies }; } }, @@ -73,20 +80,22 @@ $("#e6").select2({ formatSelection: movieFormatSelection, dropdownCssClass: "bigdrop" }); + +let t: ArrayLike; $("#e6").select2({ placeholder: "Search for a movie", minimumInputLength: 1, ajax: { - url: () => { return "http://api.rottentomatoes.com/api/public/v1.0/movies.json"; }, + url: () => "http://api.rottentomatoes.com/api/public/v1.0/movies.json", dataType: 'jsonp', - data: function (params, page) { + data(params, page) { return { q: params.term, page_limit: 10, apikey: "ju6z9mjyajq2djue3gbvv26t" }; }, - results: function (data, page) { + results(data, page) { return { results: data.movies }; } }, @@ -102,14 +111,14 @@ $("#e6").select2({ type: 'GET', dataType: 'jsonp', cache: false, - data: function (params, page) { + data(params, page) { return { q: params.term, page_limit: 10, apikey: "ju6z9mjyajq2djue3gbvv26t" }; }, - results: function (data, page) { + results(data, page) { return { results: data.movies }; } }, @@ -124,17 +133,17 @@ $("#e7").select2({ url: "http://api.rottentomatoes.com/api/public/v1.0/movies.json", dataType: 'jsonp', delay: 100, - data: function (params, page) { + data(params, aPage) { return { q: params.term, page_limit: 10, - page: page, + page: aPage, apikey: "ju6z9mjyajq2djue3gbvv26t" }; }, - results: function (data, page) { - var more = (page * 10) < data.total; - return { results: data.movies, more: more }; + results(data, page) { + const moreValue = (page * 10) < data.total; + return { results: data.movies, more: moreValue }; } }, formatResult: movieFormatResult, @@ -142,7 +151,7 @@ $("#e7").select2({ dropdownCssClass: "bigdrop" }); -function sort(elements) { +function sort(elements: any) { return elements.sort(); } $("#e20").select2({ @@ -150,66 +159,65 @@ $("#e20").select2({ }); $("#e8").select2(); -$("#e8_get").click(function () { alert("Selected value is: " + $("#e8").select2("val")); }); -$("#e8_set").click(function () { $("#e8").select2("val", "CA"); }); -$("#e8_cl").click(function () { $("#e8").select2("val", ""); }); -$("#e8_get2").click(function () { alert("Selected data is: " + JSON.stringify($("#e8").select2("data"))); }); -$("#e8_set2").click(function () { $("#e8").select2("data", { id: "CA", text: "California" }); }); -$("#e8_open").click(function () { $("#e8").select2("open"); }); -$("#e8_close").click(function () { $("#e8").select2("close"); }); +$("#e8_get").click(() => alert("Selected value is: " + $("#e8").select2("val"))); +$("#e8_set").click(() => $("#e8").select2("val", "CA")); +$("#e8_cl").click(() => $("#e8").select2("val", "")); +$("#e8_get2").click(() => alert("Selected data is: " + JSON.stringify($("#e8").select2("data")))); +$("#e8_set2").click(() => $("#e8").select2("data", { id: "CA", text: "California" })); +$("#e8_open").click(() => $("#e8").select2("open")); +$("#e8_close").click(() => $("#e8").select2("close")); $("#e8_2").select2(); -$("#e8_2_get").click(function () { alert("Selected value is: " + $("#e8_2").select2("val")); }); -$("#e8_2_set").click(function () { $("#e8_2").select2("val", ["CA", "MA"]); }); -$("#e8_2_get2").click(function () { alert("Selected value is: " + JSON.stringify($("#e8_2").select2("data"))); }); -$("#e8_2_set2").click(function () { $("#e8_2").select2("data", [{ id: "CA", text: "California" }, { id: "MA", text: "Massachusetts" }]); }); -$("#e8_2_cl").click(function () { $("#e8_2").select2("val", ""); }); -$("#e8_2_open").click(function () { $("#e8_2").select2("open"); }); -$("#e8_2_close").click(function () { $("#e8_2").select2("close"); }); +$("#e8_2_get").click(() => alert("Selected value is: " + $("#e8_2").select2("val"))); +$("#e8_2_set").click(() => $("#e8_2").select2("val", ["CA", "MA"])); +$("#e8_2_get2").click(() => alert("Selected value is: " + JSON.stringify($("#e8_2").select2("data")))); +$("#e8_2_set2").click(() => $("#e8_2").select2("data", [{ id: "CA", text: "California" }, { id: "MA", text: "Massachusetts" }])); +$("#e8_2_cl").click(() => $("#e8_2").select2("val", "")); +$("#e8_2_open").click(() => $("#e8_2").select2("open")); +$("#e8_2_close").click(() => $("#e8_2").select2("close")); $("#e11").select2({ placeholder: "Select report type", allowClear: true, data: [{ id: 0, text: 'story' }, { id: 1, text: 'bug' }, { id: 2, text: 'task' }] }); $("#e11_2").select2({ - createSearchChoice: function (term, data) { if ($(data).filter(function () { return this.textContent.localeCompare(term) === 0; }).length === 0) { return { id: term, text: term }; } }, multiple: true, data: [{ id: 0, text: 'story' }, { id: 1, text: 'bug' }, { id: 2, text: 'task' }] }); -function log(e) { - var item = $("
  • " + e + "
  • "); +function log(e: string) { + const item = $(`
  • ${e}
  • `); $("#events_11").append(item); - item.animate({ opacity: 1 }, 10000, 'linear', function () { item.animate({ opacity: 0 }, 2000, 'linear', function () { item.remove(); }); }); + item.animate({ opacity: 1 }, 10000, 'linear', () => item.animate({ opacity: 0 }, 2000, 'linear', () => item.remove())); } $("#e11") // TS 0.9.5: correct overload not resolved https://typescript.codeplex.com/discussions/472172 - .on("change", function (e: Select2JQueryEventObject) { log(JSON.stringify({ val: e.val, added: e.added, removed: e.removed })); }) - .on("open", function () { log("open"); }); + .on("change", (e: Select2JQueryEventObject) => log(JSON.stringify({ val: e.val, added: e.added, removed: e.removed }))) + .on("open", () => log("open")); $("#e11_2") - .on("change", function (e: Select2JQueryEventObject) { log(JSON.stringify({ val: e.val, added: e.added, removed: e.removed })); }) - .on("open", function () { log("open"); }); + .on("change", (e: Select2JQueryEventObject) => log(JSON.stringify({ val: e.val, added: e.added, removed: e.removed }))) + .on("open", () => log("open")); $("#e12").select2({ tags: ["red", "green", "blue"] }); $("#e20").select2({ tags: ["red", "green", "blue"], tokenSeparators: [",", " "] }); $("#e13").select2(); -$("#e13_ca").click(function () { $("#e13").val("CA").trigger("change"); }); -$("#e13_ak_co").click(function () { $("#e13").val(["AK", "CO"]).trigger("change"); }); +$("#e13_ca").click(() => $("#e13").val("CA").trigger("change")); +$("#e13_ak_co").click(() => $("#e13").val(["AK", "CO"]).trigger("change")); $("#e14").val(["AL", "AZ"]).select2(); -$("#e14_init").click(function () { $("#e14").select2(); }); -$("#e14_destroy").click(function () { $("#e14").select2("destroy"); }); +$("#e14_init").click(() => $("#e14").select2()); +$("#e14_destroy").click(() => $("#e14").select2("destroy")); $("#e15").select2({ tags: ["red", "green", "blue", "orange", "white", "black", "purple", "cyan", "teal"] }); -$("#e15").on("change", function () { $("#e15_val").html($("#e15").val() as string); }); +$("#e15").on("change", () => $("#e15_val").html($("#e15").val() as string)); $("#e16").select2(); $("#e16_2").select2(); -$("#e16_enable").click(function () { $("#e16,#e16_2").select2("enable"); }); -$("#e16_disable").click(function () { $("#e16,#e16_2").select2("disable"); }); +$("#e16_enable").click(() => $("#e16,#e16_2").select2("enable")); +$("#e16_disable").click(() => $("#e16,#e16_2").select2("disable")); $("#e17").select2({ - matcher: function (term, text) { return text.toUpperCase().indexOf(term.toUpperCase()) == 0; } + matcher: (term, text) => text.toUpperCase().indexOf(term.toUpperCase()) === 0 }); $("#e17_2").select2({ - matcher: function (term, text, opt) { + matcher: (term, text, opt) => { return text.toUpperCase().indexOf(term.toUpperCase()) >= 0 || opt.attr("alt").toUpperCase().indexOf(term.toUpperCase()) >= 0; } diff --git a/types/select2/tsconfig.json b/types/select2/tsconfig.json index 292cf878b4..257d07ea49 100644 --- a/types/select2/tsconfig.json +++ b/types/select2/tsconfig.json @@ -5,8 +5,8 @@ "es6", "dom" ], - "noImplicitAny": false, - "noImplicitThis": false, + "noImplicitAny": true, + "noImplicitThis": true, "strictNullChecks": false, "strictFunctionTypes": true, "baseUrl": "../", diff --git a/types/select2/tslint.json b/types/select2/tslint.json index a41bf5d19a..08b1465cd6 100644 --- a/types/select2/tslint.json +++ b/types/select2/tslint.json @@ -1,79 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "unified-signatures": false } } From e6fa76027fb04efbde589f8d19e7aa1496838118 Mon Sep 17 00:00:00 2001 From: Sebastiaan Dammann Date: Sat, 17 Mar 2018 20:34:40 +0100 Subject: [PATCH 0082/2153] Typeof T is still valid for isObservable / isWriteableObservable --- types/knockout/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/knockout/index.d.ts b/types/knockout/index.d.ts index 0964d24284..d4031b2337 100644 --- a/types/knockout/index.d.ts +++ b/types/knockout/index.d.ts @@ -444,10 +444,10 @@ interface KnockoutStatic { toJS(viewModel: any): any; isObservable(instance: any): instance is KnockoutObservable; - isObservable(instance: KnockoutObservable): instance is KnockoutObservable; + isObservable(instance: KnockoutObservable | T): instance is KnockoutObservable; isWriteableObservable(instance: any): instance is KnockoutObservable; - isWriteableObservable(instance: KnockoutObservable): instance is KnockoutObservable; + isWriteableObservable(instance: KnockoutObservable | T): instance is KnockoutObservable; isComputed(instance: any): instance is KnockoutComputed; isComputed(instance: KnockoutObservable | T): instance is KnockoutComputed; From b4ad1412f1cc4f7d6e71cb8fc9dae1ae159cacfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Boun=C3=A9?= Date: Sat, 17 Mar 2018 18:04:31 -0700 Subject: [PATCH 0083/2153] stylus: fix incorrect method signature --- types/stylus/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/stylus/index.d.ts b/types/stylus/index.d.ts index 58a41872b1..5db1979770 100644 --- a/types/stylus/index.d.ts +++ b/types/stylus/index.d.ts @@ -1190,7 +1190,7 @@ declare namespace Stylus { /** * Merges this query list with the `other`. */ - merge(other: MediaQueryList): MediaQueryList; + merge(other: QueryList): QueryList; /** * Return a JSON representation of this node. From b9596736b01e6d583fee5fff16bac43d8342c998 Mon Sep 17 00:00:00 2001 From: Behind The Math Date: Sat, 17 Mar 2018 21:53:04 -0400 Subject: [PATCH 0084/2153] Fix indentation --- types/sqlite3/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/sqlite3/index.d.ts b/types/sqlite3/index.d.ts index 7461cf82b7..d4fb7c9599 100644 --- a/types/sqlite3/index.d.ts +++ b/types/sqlite3/index.d.ts @@ -90,12 +90,12 @@ export function verbose(): sqlite3; // tslint:disable-next-line:strict-export-declare-modifiers interface sqlite3 { - OPEN_READONLY: number; - OPEN_READWRITE: number; - OPEN_CREATE: number; + OPEN_READONLY: number; + OPEN_READWRITE: number; + OPEN_CREATE: number; cached: typeof cached; RunResult: RunResult; Statement: typeof Statement; Database: typeof Database; - verbose(): this; + verbose(): this; } From fd309d4e391c8748b2f4802b0fb6a133cd854c6c Mon Sep 17 00:00:00 2001 From: Jackson Delahunt Date: Sun, 18 Mar 2018 16:37:16 +1000 Subject: [PATCH 0085/2153] finalize is not a promise - fixed Docs state @return void: https://github.com/archiverjs/node-archiver/blob/0bc4872daf94055ba3fafd958d6769711fa39652/lib/core.js#L131 --- types/archiver/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/archiver/index.d.ts b/types/archiver/index.d.ts index df15f9ff65..d33e8ec6dd 100644 --- a/types/archiver/index.d.ts +++ b/types/archiver/index.d.ts @@ -35,7 +35,7 @@ declare namespace archiver { directory(dirpath: string, destpath: false | string, data?: EntryData | EntryDataFunction): this; file(filename: string, data: EntryData): this; glob(pattern: string, options?: glob.IOptions, data?: EntryData): this; - finalize(): Promise; + finalize(): void; setFormat(format: string): this; setModule(module: Function): this; From 4a0594d983cabc194f072baa54c3c91bb75cabb2 Mon Sep 17 00:00:00 2001 From: AndersonFriaca Date: Sun, 18 Mar 2018 11:41:46 -0400 Subject: [PATCH 0086/2153] Types for Nivo-Slider --- types/nivo-slider/index.d.ts | 39 ++++++++++++++++++++++++++ types/nivo-slider/nivo-slider-tests.ts | 23 +++++++++++++++ types/nivo-slider/tsconfig.json | 25 +++++++++++++++++ types/nivo-slider/tslint.json | 1 + 4 files changed, 88 insertions(+) create mode 100644 types/nivo-slider/index.d.ts create mode 100644 types/nivo-slider/nivo-slider-tests.ts create mode 100644 types/nivo-slider/tsconfig.json create mode 100644 types/nivo-slider/tslint.json diff --git a/types/nivo-slider/index.d.ts b/types/nivo-slider/index.d.ts new file mode 100644 index 0000000000..f30f6d445b --- /dev/null +++ b/types/nivo-slider/index.d.ts @@ -0,0 +1,39 @@ +// Type definitions for Nivo Slider 3.2 +// Project: https://github.com/Codeinwp/Nivo-Slider-jQuery +// Definitions by: Anderson Friaça +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +export type EffectType = 'sliceDown' | 'sliceDownLeft' | 'sliceUp' | 'sliceUpLeft' | 'sliceUpDown' | 'sliceUpDownLeft' | + 'fold' | 'fade' | 'random' | 'slideInRight' | 'slideInLeft' | 'boxRandom' | 'boxRain' | 'boxRainReverse' | + 'boxRainGrow' | 'boxRainGrowReverse'; + +export interface Options { + effect?: EffectType; + slices?: number; + boxCols?: number; + boxRows?: number; + animSpeed?: number; + pauseTime?: number; + startSlide?: number; + directionNav?: boolean; + controlNav?: boolean; + controlNavThumbs?: boolean; + pauseOnHover?: boolean; + manualAdvance?: boolean; + prevText?: string; + nextText?: string; + randomStart?: boolean; + beforeChange?: () => void; + afterChange?: () => void; + slideshowEnd?: () => void; + lastSlide?: () => void; + afterLoad?: () => void; +} +declare global { + interface JQuery { + nivoSlider(options?: Options): JQuery; + } +} diff --git a/types/nivo-slider/nivo-slider-tests.ts b/types/nivo-slider/nivo-slider-tests.ts new file mode 100644 index 0000000000..a82ec64106 --- /dev/null +++ b/types/nivo-slider/nivo-slider-tests.ts @@ -0,0 +1,23 @@ +import { Options } from "nivo-slider"; + +// basic usage +$('#slider').nivoSlider(); + +// with options +const options: Options = { + effect: 'random', + slices: 15, + boxCols: 8, + boxRows: 4, + animSpeed: 500, + pauseTime: 3000, + startSlide: 0, + directionNav: true, + controlNav: true, + controlNavThumbs: false, + pauseOnHover: true, + manualAdvance: false, + prevText: 'Prev', + nextText: 'Next' +}; +$('#slider').nivoSlider(options); diff --git a/types/nivo-slider/tsconfig.json b/types/nivo-slider/tsconfig.json new file mode 100644 index 0000000000..4275013350 --- /dev/null +++ b/types/nivo-slider/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "nivo-slider-tests.ts" + ] +} \ No newline at end of file diff --git a/types/nivo-slider/tslint.json b/types/nivo-slider/tslint.json new file mode 100644 index 0000000000..d04fe2e1fa --- /dev/null +++ b/types/nivo-slider/tslint.json @@ -0,0 +1 @@ +{"extends": "dtslint/dt.json"} \ No newline at end of file From a6d6391ceaa3312026ce12a2a8372ec7bc02d439 Mon Sep 17 00:00:00 2001 From: Stanislav Termosa Date: Sun, 18 Mar 2018 18:09:23 +0200 Subject: [PATCH 0087/2153] [is-empty] add types --- types/is-empty/index.d.ts | 11 +++++++++++ types/is-empty/is-empty-tests.ts | 10 ++++++++++ types/is-empty/tsconfig.json | 23 +++++++++++++++++++++++ types/is-empty/tslint.json | 1 + 4 files changed, 45 insertions(+) create mode 100644 types/is-empty/index.d.ts create mode 100644 types/is-empty/is-empty-tests.ts create mode 100644 types/is-empty/tsconfig.json create mode 100644 types/is-empty/tslint.json diff --git a/types/is-empty/index.d.ts b/types/is-empty/index.d.ts new file mode 100644 index 0000000000..5ac0a155c2 --- /dev/null +++ b/types/is-empty/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for is-empty 1.2 +// Project: https://github.com/ianstormtaylor/is-empty +// Definitions by: Stanislav Termosa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Test if a value is empty + */ +declare function isEmpty(value: any): boolean; + +export default isEmpty; diff --git a/types/is-empty/is-empty-tests.ts b/types/is-empty/is-empty-tests.ts new file mode 100644 index 0000000000..538ae6cc71 --- /dev/null +++ b/types/is-empty/is-empty-tests.ts @@ -0,0 +1,10 @@ +import isEmpty from 'is-empty'; + +isEmpty({}); +isEmpty(null); +isEmpty(undefined); +isEmpty(9); +isEmpty(new Object()); +isEmpty(Array); +isEmpty(''); +isEmpty(() => {}); diff --git a/types/is-empty/tsconfig.json b/types/is-empty/tsconfig.json new file mode 100644 index 0000000000..c9e999956e --- /dev/null +++ b/types/is-empty/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "is-empty-tests.ts" + ] +} diff --git a/types/is-empty/tslint.json b/types/is-empty/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-empty/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From e927158b93feaa90b6d0150db7b8c6dfa9c953ae Mon Sep 17 00:00:00 2001 From: Shane Liesegang Date: Sun, 18 Mar 2018 13:08:16 -0400 Subject: [PATCH 0088/2153] Fixing return values from TextMarker.Find Find doesn't return a standard Range object; the `from` and `to` values are just positions and not callable. --- types/codemirror/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/codemirror/index.d.ts b/types/codemirror/index.d.ts index ef075b9d45..06c3b39f96 100644 --- a/types/codemirror/index.d.ts +++ b/types/codemirror/index.d.ts @@ -669,7 +669,7 @@ declare namespace CodeMirror { /** Returns a {from, to} object (both holding document positions), indicating the current position of the marked range, or undefined if the marker is no longer in the document. */ - find(): CodeMirror.Range; + find(): {from: CodeMirror.Position, to: CodeMirror.Position}; /** Returns an object representing the options for the marker. If copyWidget is given true, it will clone the value of the replacedWith option, if any. */ getOptions(copyWidget: boolean): CodeMirror.TextMarkerOptions; From cd9e2541db660bb37ae5fc53f412edbffd7248c5 Mon Sep 17 00:00:00 2001 From: Noah Santschi-Cooney Date: Sun, 18 Mar 2018 21:50:20 +0000 Subject: [PATCH 0089/2153] Removed undefined method for NightmareJS `userAgent()` isnt defined on type Nightmare in the JS version according to the error below. `useragent()` is defined and is probably what people want to use. ``` TypeError: nightmare.userAgent is not a function at login (/home/noah/Go/src/github.com/Strum355/UserBenchmark-Scraper/typescript/js/main.js:31:14) at Object. (/home/noah/Go/src/github.com/Strum355/UserBenchmark-Scraper/typescript/js/main.js:12:5) at Module._compile (module.js:649:30) at Object.Module._extensions..js (module.js:660:10) at Module.load (module.js:561:32) at tryModuleLoad (module.js:501:12) at Function.Module._load (module.js:493:3) at Function.Module.runMain (module.js:690:10) at startup (bootstrap_node.js:194:16) at bootstrap_node.js:666:3``` --- types/nightmare/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/nightmare/index.d.ts b/types/nightmare/index.d.ts index 061f22bd10..e848ce3fdd 100644 --- a/types/nightmare/index.d.ts +++ b/types/nightmare/index.d.ts @@ -12,7 +12,7 @@ declare class Nightmare { constructor(options?: Nightmare.IConstructorOptions); // Interact - userAgent(agent: string): Nightmare; + // userAgent(agent: string): Nightmare; end(): Nightmare; then(fn: (value: T) => R): Promise; halt(error: string, cb: () => void): Nightmare; From 49f613d038c5da5fa6b52087fa2c398e17ef2754 Mon Sep 17 00:00:00 2001 From: taoqf Date: Mon, 19 Mar 2018 14:40:00 +0800 Subject: [PATCH 0090/2153] add type yazl --- types/yazl/index.d.ts | 46 ++++++++++++++++++++++++++++++++++++++++ types/yazl/tsconfig.json | 23 ++++++++++++++++++++ types/yazl/tslint.json | 1 + types/yazl/yazl-tests.ts | 22 +++++++++++++++++++ 4 files changed, 92 insertions(+) create mode 100644 types/yazl/index.d.ts create mode 100644 types/yazl/tsconfig.json create mode 100644 types/yazl/tslint.json create mode 100644 types/yazl/yazl-tests.ts diff --git a/types/yazl/index.d.ts b/types/yazl/index.d.ts new file mode 100644 index 0000000000..45288eaad5 --- /dev/null +++ b/types/yazl/index.d.ts @@ -0,0 +1,46 @@ +// Type definitions for yazl 2.4 +// Project: https://github.com/thejoshwolfe/yazl +// Definitions by: taoqf +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +import { Readable, Writable } from 'stream'; +import { Buffer } from 'buffer'; + +export interface Options { + mtime: Date; + mode: number; + compress: boolean; + forceZip64Format: boolean; +} + +export interface ReadStreamOptions extends Options { + size: number; +} + +export interface DirectoryOptions { + mtime: Date; + mode: number; +} + +export interface EndOptions { + forceZip64Format: boolean; +} + +export interface DosDateTime { + date: number; + time: number; +} + +export class ZipFile { + addFile(realPath: string, metadataPath: string, options?: Partial): void; + outputStream: Writable; + addReadStream(input: Readable, metadataPath: string, options?: Partial): void; + addBuffer(buffer: Buffer, metadataPath: string, options?: Partial): void; + end(optoins?: EndOptions, finalSizeCallback?: () => void): void; + + addEmptyDirectory(metadataPath: string, options?: Partial): void; + dateToDosDateTime(jsDate: Date): DosDateTime; +} diff --git a/types/yazl/tsconfig.json b/types/yazl/tsconfig.json new file mode 100644 index 0000000000..124a83ec4d --- /dev/null +++ b/types/yazl/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "yazl-tests.ts" + ] +} diff --git a/types/yazl/tslint.json b/types/yazl/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/yazl/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/yazl/yazl-tests.ts b/types/yazl/yazl-tests.ts new file mode 100644 index 0000000000..dfc5cd3c27 --- /dev/null +++ b/types/yazl/yazl-tests.ts @@ -0,0 +1,22 @@ +import { ZipFile } from "yazl"; +import fs = require('fs'); + +const zipfile = new ZipFile(); +zipfile.addFile("file1.txt", "file1.txt"); +// (add only files, not directories) +zipfile.addFile("path/to/file.txt", "path/in/zipfile.txt"); +// pipe() can be called any time after the constructor +zipfile.outputStream.pipe(fs.createWriteStream("output.zip")).on("close", () => { + console.log("done"); +}); +// alternate apis for adding files: +zipfile.addReadStream(process.stdin, "stdin.txt", { + mtime: new Date(), + mode: parseInt("0100664", 8), // -rw-rw-r-- +}); +zipfile.addBuffer(new Buffer("hello"), "hello.txt", { + mtime: new Date(), + mode: parseInt("0100664", 8), // -rw-rw-r-- +}); +// call end() after all the files have been added +zipfile.end(); From 011941d5c8518d51043ba370857dfb210e49b05c Mon Sep 17 00:00:00 2001 From: Arylo Date: Mon, 19 Mar 2018 15:01:04 +0800 Subject: [PATCH 0091/2153] Add type definition for keyv --- types/keyv/index.d.ts | 30 ++++++++++++++++++++++++++++++ types/keyv/keyv-tests.ts | 20 ++++++++++++++++++++ types/keyv/tsconfig.json | 23 +++++++++++++++++++++++ types/keyv/tslint.json | 1 + 4 files changed, 74 insertions(+) create mode 100644 types/keyv/index.d.ts create mode 100644 types/keyv/keyv-tests.ts create mode 100644 types/keyv/tsconfig.json create mode 100644 types/keyv/tslint.json diff --git a/types/keyv/index.d.ts b/types/keyv/index.d.ts new file mode 100644 index 0000000000..4de9e75fff --- /dev/null +++ b/types/keyv/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for keyv 3.0 +// Project: https://github.com/lukechilds/keyv +// Definitions by: AryloYeung +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +// import * as events from 'events'; + +interface KeyvOptions { + namespace?: string; + serialize: (data: any) => string; + deserialize: (data: string) => any; + uri?: string; + store?: any; + ttl?: number; + adapter?: string; +} + +declare class Keyv extends NodeJS.EventEmitter { + constructor(uri?: string, opts?: KeyvOptions); + constructor(opts?: KeyvOptions); + get(key: string): Promise; + set(key: string, value: any, ttl?: number): Promise; + delete(key: string): Promise; + clear(): Promise; +} + +export = Keyv; diff --git a/types/keyv/keyv-tests.ts b/types/keyv/keyv-tests.ts new file mode 100644 index 0000000000..fc0c2f3ff1 --- /dev/null +++ b/types/keyv/keyv-tests.ts @@ -0,0 +1,20 @@ +import Keyv = require("keyv"); + +new Keyv('mongodb://user:pass@localhost:27017/dbname'); +new Keyv('redis://user:pass@localhost:6379'); +new Keyv('sqlite://path/to/database.sqlite'); +new Keyv('postgresql://user:pass@localhost:5432/dbname'); +new Keyv('mysql://user:pass@localhost:3306/dbname'); +new Keyv(); + +(async () => { + const keyv = new Keyv(); + + keyv.on('error', err => console.log('Connection Error', err)); + + await keyv.set('foo', 'expires in 1 second', 1000); // true + await keyv.set('foo', 'never expires'); // true + await keyv.get('foo'); // 'never expires' + await keyv.delete('foo'); // true + await keyv.clear(); // undefined +})(); diff --git a/types/keyv/tsconfig.json b/types/keyv/tsconfig.json new file mode 100644 index 0000000000..21b4bcb7f1 --- /dev/null +++ b/types/keyv/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": false, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "keyv-tests.ts" + ] +} diff --git a/types/keyv/tslint.json b/types/keyv/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/keyv/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From d98e689d3fe0264aacc90f1ba1e347df21209309 Mon Sep 17 00:00:00 2001 From: Arylo Date: Mon, 19 Mar 2018 15:13:43 +0800 Subject: [PATCH 0092/2153] Add Annotations --- types/keyv/index.d.ts | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/types/keyv/index.d.ts b/types/keyv/index.d.ts index 4de9e75fff..11e1895c9a 100644 --- a/types/keyv/index.d.ts +++ b/types/keyv/index.d.ts @@ -6,24 +6,50 @@ /// -// import * as events from 'events'; - interface KeyvOptions { + /** Namespace for the current instance. */ namespace?: string; + /** A custom serialization function. */ serialize: (data: any) => string; + /** A custom deserialization function. */ deserialize: (data: string) => any; + /** The connection string URI. */ uri?: string; + /** The storage adapter instance to be used by Keyv. */ store?: any; + /** Default TTL. Can be overridden by specififying a TTL on `.set()`. */ ttl?: number; + /** Specify an adapter to use. e.g `'redis'` or `'mongodb'`. */ adapter?: string; } declare class Keyv extends NodeJS.EventEmitter { + /** + * @param uri The connection string URI. + * + * Merged into the options object as options.uri. + * @param opts The options object is also passed through to the storage adapter. Check your storage adapter docs for any extra options. + */ constructor(uri?: string, opts?: KeyvOptions); + /** + * @param opts The options object is also passed through to the storage adapter. Check your storage adapter docs for any extra options. + */ constructor(opts?: KeyvOptions); + /** Returns the value. */ get(key: string): Promise; + /** + * Set a value. + * + * By default keys are persistent. You can set an expiry TTL in milliseconds. + */ set(key: string, value: any, ttl?: number): Promise; + /** + * Deletes an entry. + * + * Returns `true` if the key existed, `false` if not. + */ delete(key: string): Promise; + /** Delete all entries in the current namespace. */ clear(): Promise; } From f32382e9fd85e3cb351f1a5bccb1909c9c6ce293 Mon Sep 17 00:00:00 2001 From: Arylo Date: Mon, 19 Mar 2018 15:17:36 +0800 Subject: [PATCH 0093/2153] Modify `strictFunctionTypes` to `true` --- types/keyv/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/keyv/tsconfig.json b/types/keyv/tsconfig.json index 21b4bcb7f1..47eab45180 100644 --- a/types/keyv/tsconfig.json +++ b/types/keyv/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ From 47742853c94a95edc5ce70596adcaadf2fe3d849 Mon Sep 17 00:00:00 2001 From: Arylo Date: Mon, 19 Mar 2018 15:29:01 +0800 Subject: [PATCH 0094/2153] Fix KeyvOptions --- types/keyv/index.d.ts | 12 ++++++------ types/keyv/keyv-tests.ts | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/types/keyv/index.d.ts b/types/keyv/index.d.ts index 11e1895c9a..9d0e2c6404 100644 --- a/types/keyv/index.d.ts +++ b/types/keyv/index.d.ts @@ -10,9 +10,9 @@ interface KeyvOptions { /** Namespace for the current instance. */ namespace?: string; /** A custom serialization function. */ - serialize: (data: any) => string; + serialize?: (data: any) => string; /** A custom deserialization function. */ - deserialize: (data: string) => any; + deserialize?: (data: string) => any; /** The connection string URI. */ uri?: string; /** The storage adapter instance to be used by Keyv. */ @@ -24,6 +24,10 @@ interface KeyvOptions { } declare class Keyv extends NodeJS.EventEmitter { + /** + * @param opts The options object is also passed through to the storage adapter. Check your storage adapter docs for any extra options. + */ + constructor(opts?: KeyvOptions); /** * @param uri The connection string URI. * @@ -31,10 +35,6 @@ declare class Keyv extends NodeJS.EventEmitter { * @param opts The options object is also passed through to the storage adapter. Check your storage adapter docs for any extra options. */ constructor(uri?: string, opts?: KeyvOptions); - /** - * @param opts The options object is also passed through to the storage adapter. Check your storage adapter docs for any extra options. - */ - constructor(opts?: KeyvOptions); /** Returns the value. */ get(key: string): Promise; /** diff --git a/types/keyv/keyv-tests.ts b/types/keyv/keyv-tests.ts index fc0c2f3ff1..7ee4cac90e 100644 --- a/types/keyv/keyv-tests.ts +++ b/types/keyv/keyv-tests.ts @@ -1,5 +1,10 @@ import Keyv = require("keyv"); +new Keyv({ + uri: 'redis://user:pass@localhost:6379', + namespace: "redis" +}); + new Keyv('mongodb://user:pass@localhost:27017/dbname'); new Keyv('redis://user:pass@localhost:6379'); new Keyv('sqlite://path/to/database.sqlite'); From e107cb09c5c71a5e87262373c70d2bcb0e7a4d8a Mon Sep 17 00:00:00 2001 From: Fredrik Nicol Date: Mon, 19 Mar 2018 09:00:29 +0100 Subject: [PATCH 0095/2153] Change to a test value that will certainly ever happen String literals are not reliable to expect errors on since the spec may change and accept `string` --- types/jss/jss-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/jss/jss-tests.ts b/types/jss/jss-tests.ts index 8e53780988..063c265c4e 100644 --- a/types/jss/jss-tests.ts +++ b/types/jss/jss-tests.ts @@ -70,7 +70,7 @@ styleSheet.addRule('badProperty', { }); styleSheet.addRule('badValue', { // $ExpectError - 'align-items': 'thisIsNotAValidValue', + 'align-items': Symbol(), }); styleSheet.detach(); From 8ae1dd4c851ff6bf21eda475db52db8f0bd08396 Mon Sep 17 00:00:00 2001 From: Fredrik Nicol Date: Mon, 19 Mar 2018 09:15:13 +0100 Subject: [PATCH 0096/2153] Make tests happy --- types/jss/index.d.ts | 6 +++--- types/jss/jss-tests.ts | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/types/jss/index.d.ts b/types/jss/index.d.ts index 3661ba099a..b22ed4a240 100644 --- a/types/jss/index.d.ts +++ b/types/jss/index.d.ts @@ -105,11 +105,11 @@ export interface RuleOptions { } export declare class SheetsRegistry { constructor(); - registry: ReadonlyArray>; + registry: ReadonlyArray; readonly index: number; - add(sheet: StyleSheet): void; + add(sheet: StyleSheet): void; reset(): void; - remove(sheet: StyleSheet): void; + remove(sheet: StyleSheet): void; toString(options?: ToCssOptions): string; } declare class JSS { diff --git a/types/jss/jss-tests.ts b/types/jss/jss-tests.ts index f71f643595..b0400c2ae3 100644 --- a/types/jss/jss-tests.ts +++ b/types/jss/jss-tests.ts @@ -92,7 +92,11 @@ sheetsRegistry.add(styleSheet); const secondStyleSheet = jss.createStyleSheet( { ruleWithMockObservable: { - subscribe() {} + subscribe() { + return { + unsubscribe() {} + }; + } }, container2: { display: 'flex', From 9ef7415615c0feb97a6ec5fbe85e4544273fd352 Mon Sep 17 00:00:00 2001 From: Mike Cook Date: Mon, 19 Mar 2018 09:52:05 +0000 Subject: [PATCH 0097/2153] Add typings for nodecredstash --- types/nodecredstash/index.d.ts | 45 +++++++++++++++++ types/nodecredstash/nodecredstash-tests.ts | 59 ++++++++++++++++++++++ types/nodecredstash/tsconfig.json | 22 ++++++++ types/nodecredstash/tslint.json | 1 + 4 files changed, 127 insertions(+) create mode 100644 types/nodecredstash/index.d.ts create mode 100644 types/nodecredstash/nodecredstash-tests.ts create mode 100644 types/nodecredstash/tsconfig.json create mode 100644 types/nodecredstash/tslint.json diff --git a/types/nodecredstash/index.d.ts b/types/nodecredstash/index.d.ts new file mode 100644 index 0000000000..d2489178a4 --- /dev/null +++ b/types/nodecredstash/index.d.ts @@ -0,0 +1,45 @@ +// Type definitions for nodecredstash 2.0 +// Project: https://github.com/DavidTanner/nodecredstash#readme +// Definitions by: Mike Cook +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +import * as AWS from 'aws-sdk'; + +interface ICredstashConfig { + table?: string; + awsOpts?: AWS.KMS.ClientConfiguration; + dynamoOpts?: AWS.DynamoDB.ClientConfiguration; + kmsKey?: string; + kmsOpts?: AWS.KMS.ClientConfiguration; +} + +interface ICredstashContext { + [key: string]: string; +} + +interface IPutSecretOptions { + name: string; + secret: string; + context: ICredstashContext; + digest?: string; + version?: number; +} + +interface ICredstash { + getHighestVersion: (options: { name: string }) => Promise; + incrementVersion: (options: { name: string }) => Promise; + putSecret: (options: IPutSecretOptions) => Promise; + decryptStash: (stash: { key: string; }, context?: ICredstashContext) => Promise; + getAllVersions: (options: { name: string, context?: ICredstashContext, limit?: number }) => Promise>; + getSecret: (options: { name: string, context?: ICredstashContext, version?: number }) => Promise; + deleteSecrets: (options: { name: string }) => Promise>; + deleteSecret: (options: { name: string, version: number }) => Promise; + listSecrets: () => Promise; + getAllSecrets: (options: { version?: number, context?: ICredstashContext, startsWith?: string }) => Promise<{ [key: string]: string }>; + createDdbTable: () => Promise; +} + +declare function Credstash(config: ICredstashConfig): ICredstash; + +export = Credstash; diff --git a/types/nodecredstash/nodecredstash-tests.ts b/types/nodecredstash/nodecredstash-tests.ts new file mode 100644 index 0000000000..f3788adc55 --- /dev/null +++ b/types/nodecredstash/nodecredstash-tests.ts @@ -0,0 +1,59 @@ +import Credstash = require('nodecredstash'); + +const credstash = Credstash({ + awsOpts: { region: 'us-east-1' }, + dynamoOpts: { accessKeyId: 'foo' }, + kmsKey: 'bar', + kmsOpts: { accessKeyId: 'baz' }, + table: 'something' +}); + +credstash.decryptStash({ key: 'foo' }).then((result) => { + return { + id: result.KeyId, + text: result.Plaintext + }; +}); + +credstash.deleteSecret({ name: 'foo', version: 1 }).then((result) => { + if (result.Attributes) return result.Attributes['blah']; + if (result.ConsumedCapacity) return result.ConsumedCapacity.TableName; + if (result.ItemCollectionMetrics) return result.ItemCollectionMetrics.ItemCollectionKey; +}); + +credstash.deleteSecrets({ name: 'foo' }).then((results) => { + const result = results[0]; + if (result.Attributes) return result.Attributes['blah'].toUpperCase(); + if (result.ConsumedCapacity) return result.ConsumedCapacity.TableName; + if (result.ItemCollectionMetrics) return result.ItemCollectionMetrics.ItemCollectionKey; +}); + +credstash.getAllSecrets({ version: 1 }).then((result) => { + return result['foo'].toUpperCase(); +}); + +credstash.getAllVersions({ name: 'foo', context: { bar: 'baz' }, limit: 1 }).then((result) => { + return result[0].secret.toUpperCase() + result[0].version.toUpperCase(); +}); + +credstash.getHighestVersion({ name: 'foo' }).then((result) => { + return result['foo'].S; +}); + +credstash.getSecret({ name: 'foo', version: 1, context: { bar: 'baz' } }).then((result) => { + return result.toUpperCase(); +}); + +credstash.incrementVersion({ name: 'foo' }).then((result) => { + return result.toUpperCase(); +}); + +credstash.listSecrets().then((result) => { + return result.map((str) => str.toUpperCase()); +}); + +credstash.putSecret({ name: 'foo', secret: 'bar', context: { baz: 'qux' }, digest: 'quux', version: 1 }).then((result) => { + if (result.Attributes) return result.Attributes['foo']; + if (result.ConsumedCapacity) return result.ConsumedCapacity.TableName; + if (result.ItemCollectionMetrics) return result.ItemCollectionMetrics.ItemCollectionKey; +}); diff --git a/types/nodecredstash/tsconfig.json b/types/nodecredstash/tsconfig.json new file mode 100644 index 0000000000..da430c0182 --- /dev/null +++ b/types/nodecredstash/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "nodecredstash-tests.ts" + ] +} diff --git a/types/nodecredstash/tslint.json b/types/nodecredstash/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/nodecredstash/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From a626af102fb70b84e03389a55edb3db026700e4b Mon Sep 17 00:00:00 2001 From: Mike Cook Date: Mon, 19 Mar 2018 10:02:26 +0000 Subject: [PATCH 0098/2153] Dependencies and linting updates --- types/nodecredstash/index.d.ts | 24 ++++++++++++------------ types/nodecredstash/package.json | 6 ++++++ types/nodecredstash/tsconfig.json | 1 + 3 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 types/nodecredstash/package.json diff --git a/types/nodecredstash/index.d.ts b/types/nodecredstash/index.d.ts index d2489178a4..76375aac21 100644 --- a/types/nodecredstash/index.d.ts +++ b/types/nodecredstash/index.d.ts @@ -6,7 +6,7 @@ /// import * as AWS from 'aws-sdk'; -interface ICredstashConfig { +interface CredstashConfig { table?: string; awsOpts?: AWS.KMS.ClientConfiguration; dynamoOpts?: AWS.DynamoDB.ClientConfiguration; @@ -14,32 +14,32 @@ interface ICredstashConfig { kmsOpts?: AWS.KMS.ClientConfiguration; } -interface ICredstashContext { +interface CredstashContext { [key: string]: string; } -interface IPutSecretOptions { +interface PutSecretOptions { name: string; secret: string; - context: ICredstashContext; + context: CredstashContext; digest?: string; version?: number; } -interface ICredstash { +interface Credstash { getHighestVersion: (options: { name: string }) => Promise; incrementVersion: (options: { name: string }) => Promise; - putSecret: (options: IPutSecretOptions) => Promise; - decryptStash: (stash: { key: string; }, context?: ICredstashContext) => Promise; - getAllVersions: (options: { name: string, context?: ICredstashContext, limit?: number }) => Promise>; - getSecret: (options: { name: string, context?: ICredstashContext, version?: number }) => Promise; - deleteSecrets: (options: { name: string }) => Promise>; + putSecret: (options: PutSecretOptions) => Promise; + decryptStash: (stash: { key: string; }, context?: CredstashContext) => Promise; + getAllVersions: (options: { name: string, context?: CredstashContext, limit?: number }) => Promise>; + getSecret: (options: { name: string, context?: CredstashContext, version?: number }) => Promise; + deleteSecrets: (options: { name: string }) => Promise; deleteSecret: (options: { name: string, version: number }) => Promise; listSecrets: () => Promise; - getAllSecrets: (options: { version?: number, context?: ICredstashContext, startsWith?: string }) => Promise<{ [key: string]: string }>; + getAllSecrets: (options: { version?: number, context?: CredstashContext, startsWith?: string }) => Promise<{ [key: string]: string }>; createDdbTable: () => Promise; } -declare function Credstash(config: ICredstashConfig): ICredstash; +declare function Credstash(config: CredstashConfig): Credstash; export = Credstash; diff --git a/types/nodecredstash/package.json b/types/nodecredstash/package.json new file mode 100644 index 0000000000..0347abc684 --- /dev/null +++ b/types/nodecredstash/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "aws-sdk": "^2.211.0" + }, + "private": true +} diff --git a/types/nodecredstash/tsconfig.json b/types/nodecredstash/tsconfig.json index da430c0182..ec4305243c 100644 --- a/types/nodecredstash/tsconfig.json +++ b/types/nodecredstash/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" From fc89e65611bedf181bc934995b57715575f958d9 Mon Sep 17 00:00:00 2001 From: Johan Isaksson Date: Mon, 19 Mar 2018 14:51:13 +0100 Subject: [PATCH 0099/2153] Missing function editNotification(...) added. See editNotification() description at https://github.com/igorprado/react-notification-system. --- types/react-notification-system/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react-notification-system/index.d.ts b/types/react-notification-system/index.d.ts index 8176ad097c..a993f6cc4d 100644 --- a/types/react-notification-system/index.d.ts +++ b/types/react-notification-system/index.d.ts @@ -12,6 +12,7 @@ declare namespace NotificationSystem { addNotification(notification: Notification): Notification; removeNotification(uidOrNotification: number | string | Notification): void; clearNotifications(): void; + editNotification(uidOrNotification: number | string | Notification, newNotification: Notification): void; } export type CallBackFunction = (notification: Notification) => void; From 5ebbb231c8ca23e47ed4c240b8bb67fb7a73df96 Mon Sep 17 00:00:00 2001 From: Alban Gicquel Date: Mon, 19 Mar 2018 10:16:43 -0400 Subject: [PATCH 0100/2153] typo in merge --- types/inquirer/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/inquirer/index.d.ts b/types/inquirer/index.d.ts index 7c4e9a1f2e..e2e897741d 100644 --- a/types/inquirer/index.d.ts +++ b/types/inquirer/index.d.ts @@ -100,7 +100,7 @@ declare namespace inquirer { */ choices?: | ReadonlyArray - | ((answers: T) => ReadonlyArray); + | ((answers: T) => ReadonlyArray) | ((answers: T) => Promise>); /** * Receive the user input and should return true if the value is valid, and an error message (String) From 4b26c77b3ccd58041802c624b1b6f10c9ecacb1e Mon Sep 17 00:00:00 2001 From: Matthew Zartman Date: Mon, 19 Mar 2018 11:55:53 -0400 Subject: [PATCH 0101/2153] Adds new module to fit Meteor suggested styling --- types/meteor-roles/index.d.ts | 254 ++++++++++++++++++++++++++++++++++ 1 file changed, 254 insertions(+) diff --git a/types/meteor-roles/index.d.ts b/types/meteor-roles/index.d.ts index 80a4b02c90..ed91f96ab5 100644 --- a/types/meteor-roles/index.d.ts +++ b/types/meteor-roles/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for Meteor Roles 1.2.14 // Project: https://github.com/alanning/meteor-roles/ // Definitions by: Robbie Van Gorkom +// Matthew Zartman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -262,3 +263,256 @@ declare namespace Roles { declare namespace Meteor { var roles : Mongo.Collection; } + + +/* Declaring in the format prescribed by Meteor */ +declare module "meteor/alanning:roles" { + namespace Roles { + /** + * Constant used to reference the special 'global' group that + * can be used to apply blanket permissions across all groups. + * + * @example + * Roles.addUsersToRoles(user, 'admin', Roles.GLOBAL_GROUP) + * Roles.userIsInRole(user, 'admin') // => true + * + * Roles.setUserRoles(user, 'support-staff', Roles.GLOBAL_GROUP) + * Roles.userIsInRole(user, 'support-staff') // => true + * Roles.userIsInRole(user, 'admin') // => false + * + * @property GLOBAL_GROUP + * @type String + * @static + * @final + */ + var GLOBAL_GROUP : string; + + /** + * Subscription handle for the currently logged in user's permissions. + * + * NOTE: The corresponding publish function, `_roles`, depends on + * `this.userId` so it will automatically re-run when the currently + * logged-in user changes. + * + * @example + * + * `Roles.subscription.ready()` // => `true` if user roles have been loaded + * + * @property subscription + * @type Object + * @for Roles + */ + var subscription : Subscription; + + /** + * Add users to roles. Will create roles as needed. + * + * NOTE: Mixing grouped and non-grouped roles for the same user + * is not supported and will throw an error. + * + * Makes 2 calls to database: + * 1. retrieve list of all existing roles + * 2. update users' roles + * + * @example + * Roles.addUsersToRoles(userId, 'admin') + * Roles.addUsersToRoles(userId, ['view-secrets'], 'example.com') + * Roles.addUsersToRoles([user1, user2], ['user','editor']) + * Roles.addUsersToRoles([user1, user2], ['glorious-admin', 'perform-action'], 'example.org') + * Roles.addUsersToRoles(userId, 'admin', Roles.GLOBAL_GROUP) + * + * @method addUsersToRoles + * @param {Array|String} users User id(s) or object(s) with an _id field + * @param {Array|String} roles Name(s) of roles/permissions to add users to + * @param {String} [group] Optional group name. If supplied, roles will be + * specific to that group. + * Group names can not start with '$' or numbers. + * Periods in names '.' are automatically converted + * to underscores. + * The special group Roles.GLOBAL_GROUP provides + * a convenient way to assign blanket roles/permissions + * across all groups. The roles/permissions in the + * Roles.GLOBAL_GROUP group will be automatically + * included in checks for any group. + */ + function addUsersToRoles( + user : string|string[]|Object|Object[], + roles : string|string[], + group? : string + ) : void; + + /** + * Create a new role. Whitespace will be trimmed. + * + * @method createRole + * @param {String} role Name of role + * @return {String} id of new role + */ + function createRole(role : string) : string; + + /** + * Delete an existing role. Will throw "Role in use" error if any users + * are currently assigned to the target role. + * + * @method deleteRole + * @param {String} role Name of role + */ + function deleteRole (role : string) : void; + + /** + * Retrieve set of all existing roles + * + * @method getAllRoles + * @return {Cursor} cursor of existing roles + */ + function getAllRoles() : Mongo.Cursor; + + /** + * Retrieve users groups, if any + * + * @method getGroupsForUser + * @param {String|Object} user User Id or actual user object + * @param {String} [role] Optional name of roles to restrict groups to. + * + * @return {Array} Array of user's groups, unsorted. Roles.GLOBAL_GROUP will be omitted + */ + function getGroupsForUser( + user : string|Object, + role? : string + ) : string[]; + + /** + * Retrieve users roles + * + * @method getRolesForUser + * @param {String|Object} user User Id or actual user object + * @param {String} [group] Optional name of group to restrict roles to. + * User's Roles.GLOBAL_GROUP will also be included. + * @return {Array} Array of user's roles, unsorted. + */ + function getRolesForUser( + user : string|Object, + group? : string + ) : string[]; + + /** + * Retrieve all users who are in target role. + * + * NOTE: This is an expensive query; it performs a full collection scan + * on the users collection since there is no index set on the 'roles' field. + * This is by design as most queries will specify an _id so the _id index is + * used automatically. + * + * @method getUsersInRole + * @param {Array|String} role Name of role/permission. If array, users + * returned will have at least one of the roles + * specified but need not have _all_ roles. + * @param {String} [group] Optional name of group to restrict roles to. + * User's Roles.GLOBAL_GROUP will also be checked. + * @param {Object} [options] Optional options which are passed directly + * through to `Meteor.users.find(query, options)` + * @return {Cursor} cursor of users in role + */ + function getUsersInRole( + role : string|string[], + group? : string, + options? : { + sort?: Mongo.SortSpecifier; + skip?: number; + limit?: number; + fields?: Mongo.FieldSpecifier; + reactive?: boolean; + transform?: Function; + }) : Mongo.Cursor; + + /** + * Remove users from roles + * + * @example + * Roles.removeUsersFromRoles(users.bob, 'admin') + * Roles.removeUsersFromRoles([users.bob, users.joe], ['editor']) + * Roles.removeUsersFromRoles([users.bob, users.joe], ['editor', 'user']) + * Roles.removeUsersFromRoles(users.eve, ['user'], 'group1') + * + * @method removeUsersFromRoles + * @param {Array|String} users User id(s) or object(s) with an _id field + * @param {Array|String} roles Name(s) of roles to add users to + * @param {String} [group] Optional. Group name. If supplied, only that + * group will have roles removed. + */ + function removeUsersFromRoles( + user : string|string[]|Object|Object[], + roles? : string[], + group? : string + ) : void; + + /** + * Set a users roles/permissions. + * + * @example + * Roles.setUserRoles(userId, 'admin') + * Roles.setUserRoles(userId, ['view-secrets'], 'example.com') + * Roles.setUserRoles([user1, user2], ['user','editor']) + * Roles.setUserRoles([user1, user2], ['glorious-admin', 'perform-action'], 'example.org') + * Roles.setUserRoles(userId, 'admin', Roles.GLOBAL_GROUP) + * + * @method setUserRoles + * @param {Array|String} users User id(s) or object(s) with an _id field + * @param {Array|String} roles Name(s) of roles/permissions to add users to + * @param {String} [group] Optional group name. If supplied, roles will be + * specific to that group. + * Group names can not start with '$'. + * Periods in names '.' are automatically converted + * to underscores. + * The special group Roles.GLOBAL_GROUP provides + * a convenient way to assign blanket roles/permissions + * across all groups. The roles/permissions in the + * Roles.GLOBAL_GROUP group will be automatically + * included in checks for any group. + */ + function setUserRoles ( + user : string|string[]|Object|Object[], + roles : string|string[], + group? : string + ) : void; + + /** + * Check if user has specified permissions/roles + * + * @example + * // non-group usage + * Roles.userIsInRole(user, 'admin') + * Roles.userIsInRole(user, ['admin','editor']) + * Roles.userIsInRole(userId, 'admin') + * Roles.userIsInRole(userId, ['admin','editor']) + * + * // per-group usage + * Roles.userIsInRole(user, ['admin','editor'], 'group1') + * Roles.userIsInRole(userId, ['admin','editor'], 'group1') + * Roles.userIsInRole(userId, ['admin','editor'], Roles.GLOBAL_GROUP) + * + * // this format can also be used as short-hand for Roles.GLOBAL_GROUP + * Roles.userIsInRole(user, 'admin') + * + * @method userIsInRole + * @param {String|Object} user User Id or actual user object + * @param {String|Array} roles Name of role/permission or Array of + * roles/permissions to check against. If array, + * will return true if user is in _any_ role. + * @param {String} [group] Optional. Name of group. If supplied, limits check + * to just that group. + * The user's Roles.GLOBAL_GROUP will always be checked + * whether group is specified or not. + * @return {Boolean} true if user is in _any_ of the target roles + */ + function userIsInRole( + user : string|string[]|Object|Object[], + roles : string|string[], + group? : string + ) : boolean; + + interface Role { + name : string; + } + } +} From 8e89cb103e290565d514ece49a969ddbe5f6f6d3 Mon Sep 17 00:00:00 2001 From: pvavrik Date: Mon, 19 Mar 2018 16:56:56 +0100 Subject: [PATCH 0102/2153] Three: add TextBufferGeometry --- types/three/three-core.d.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 31c8cbebe0..d16bc73140 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -7103,6 +7103,7 @@ export interface TextGeometryParameters { bevelEnabled?: boolean; bevelThickness?: number; bevelSize?: number; + bevelSegments?: number; } export class TextGeometry extends ExtrudeGeometry { @@ -7116,6 +7117,33 @@ export class TextGeometry extends ExtrudeGeometry { bevelEnabled: boolean; bevelThickness: number; bevelSize: number; + bevelSegments: number; + }; +} + +export interface TextBufferGeometryParameters { + font?: Font; + size?: number; + height?: number; + curveSegments?: number; + bevelEnabled?: boolean; + bevelThickness?: number; + bevelSize?: number; + bevelSegments?: number; +} + +export class TextBufferGeometry extends ExtrudeBufferGeometry { + constructor(text: string, parameters?: TextBufferGeometryParameters); + + parameters: { + font: Font; + size: number; + height: number; + curveSegments: number; + bevelEnabled: boolean; + bevelThickness: number; + bevelSize: number; + bevelSegments: number; }; } From ae9aff4a0c0ccdc224583f0f7f84d3a5b7bc3483 Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Mon, 19 Mar 2018 10:46:03 -0700 Subject: [PATCH 0103/2153] js-yaml: more strict loader return types --- types/js-yaml/index.d.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/types/js-yaml/index.d.ts b/types/js-yaml/index.d.ts index 2fa264cbd9..0adda9646a 100644 --- a/types/js-yaml/index.d.ts +++ b/types/js-yaml/index.d.ts @@ -4,8 +4,10 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -export function safeLoad(str: string, opts?: LoadOptions): any; -export function load(str: string, opts?: LoadOptions): any; +export type DocumentLoadResult = object | undefined; + +export function safeLoad(str: string, opts?: LoadOptions): DocumentLoadResult; +export function load(str: string, opts?: LoadOptions): DocumentLoadResult; export class Type { constructor(tag: string, opts?: TypeConstructorOptions); @@ -26,8 +28,8 @@ export class Schema implements SchemaDefinition { static create(schemas: Schema[] | Schema, types: Type[] | Type): Schema; } -export function safeLoadAll(str: string, iterator?: (doc: any) => void, opts?: LoadOptions): any; -export function loadAll(str: string, iterator?: (doc: any) => void, opts?: LoadOptions): any; +export function safeLoadAll(str: string, iterator?: (doc: any) => void, opts?: LoadOptions): DocumentLoadResult[] | undefined; +export function loadAll(str: string, iterator?: (doc: any) => void, opts?: LoadOptions): DocumentLoadResult[] | undefined; export function safeDump(obj: any, opts?: DumpOptions): string; export function dump(obj: any, opts?: DumpOptions): string; From dbe58aecc853b54c709a7dd98df7f0bc94e152a9 Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Mon, 19 Mar 2018 10:53:22 -0700 Subject: [PATCH 0104/2153] update version --- types/js-yaml/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/js-yaml/index.d.ts b/types/js-yaml/index.d.ts index 0adda9646a..da745e5d26 100644 --- a/types/js-yaml/index.d.ts +++ b/types/js-yaml/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for js-yaml 3.10 +// Type definitions for js-yaml 3.11 // Project: https://github.com/nodeca/js-yaml // Definitions by: Bart van der Schoor , Sebastian Clausen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 97ca4f14ed97ce40d5954796bc0bd645b68d2e1e Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Mon, 19 Mar 2018 10:59:34 -0700 Subject: [PATCH 0105/2153] got tests running, fix up types --- types/js-yaml/index.d.ts | 8 ++++++-- types/js-yaml/js-yaml-tests.ts | 24 ++++++++++++++---------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/types/js-yaml/index.d.ts b/types/js-yaml/index.d.ts index da745e5d26..5cd852ab3f 100644 --- a/types/js-yaml/index.d.ts +++ b/types/js-yaml/index.d.ts @@ -28,8 +28,12 @@ export class Schema implements SchemaDefinition { static create(schemas: Schema[] | Schema, types: Type[] | Type): Schema; } -export function safeLoadAll(str: string, iterator?: (doc: any) => void, opts?: LoadOptions): DocumentLoadResult[] | undefined; -export function loadAll(str: string, iterator?: (doc: any) => void, opts?: LoadOptions): DocumentLoadResult[] | undefined; +export function safeLoadAll(str: string, iterator?: undefined, opts?: LoadOptions): DocumentLoadResult[]; +export function safeLoadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): undefined; + +export function loadAll(str: string, iterator?: undefined, opts?: LoadOptions): DocumentLoadResult[]; + +export function loadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): undefined; export function safeDump(obj: any, opts?: DumpOptions): string; export function dump(obj: any, opts?: DumpOptions): string; diff --git a/types/js-yaml/js-yaml-tests.ts b/types/js-yaml/js-yaml-tests.ts index 3d5ecc17bf..9a61da204f 100644 --- a/types/js-yaml/js-yaml-tests.ts +++ b/types/js-yaml/js-yaml-tests.ts @@ -109,40 +109,44 @@ type.styleAliases; // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -// $ExpectType any +// $ExpectType DocumentLoadResult yaml.safeLoad(str); -// $ExpectType any +// $ExpectType DocumentLoadResult yaml.safeLoad(str, loadOpts); -// $ExpectType any +// $ExpectType DocumentLoadResult yaml.load(str); -// $ExpectType any +// $ExpectType DocumentLoadResult yaml.load(str, loadOpts); // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -// $ExpectType any +// $ExpectType DocumentLoadResult[] yaml.safeLoadAll(str); -// $ExpectType any + +// $ExpectType undefined yaml.safeLoadAll(str, (doc) => { value = doc; }); -// $ExpectType any +// $ExpectType undefined yaml.safeLoadAll(str, (doc) => { value = doc; }, loadOpts); +// $ExpectType DocumentLoadResult[] value = yaml.safeLoadAll(str, undefined, loadOpts); -// $ExpectType any +// $ExpectType DocumentLoadResult[] value = yaml.loadAll(str); -// $ExpectType any + +// $ExpectType undefined yaml.loadAll(str, (doc) => { value = doc; }); -// $ExpectType any +// $ExpectType undefined yaml.loadAll(str, (doc) => { value = doc; }, loadOpts); +// $ExpectType DocumentLoadResult[] value = yaml.loadAll(str, undefined, loadOpts); // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- From 5104d46ff772bdb80ef7666028eadbb5c7d0f098 Mon Sep 17 00:00:00 2001 From: Christian Moniz Date: Mon, 19 Mar 2018 15:59:55 -0700 Subject: [PATCH 0106/2153] Add `setOptions` to `node-rsa` class definition --- types/node-rsa/index.d.ts | 6 ++++++ types/node-rsa/node-rsa-tests.ts | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/types/node-rsa/index.d.ts b/types/node-rsa/index.d.ts index 63d569378d..c697ee0db4 100644 --- a/types/node-rsa/index.d.ts +++ b/types/node-rsa/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for node-rsa 0.4 // Project: https://github.com/rzcoder/node-rsa // Definitions by: Ali Taheri +// Christian Moniz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -17,6 +18,11 @@ declare class NodeRSA { */ constructor(key: NodeRSA.Key, format?: NodeRSA.Format, options?: NodeRSA.Options); + /** + * Set and validate options for key instance. + */ + setOptions(options: NodeRSA.Options): void; + /** * @param bits Key size in bits. 2048 by default. * @param exponent public exponent. 65537 by default. diff --git a/types/node-rsa/node-rsa-tests.ts b/types/node-rsa/node-rsa-tests.ts index 0f8defacbd..4a2360ce14 100644 --- a/types/node-rsa/node-rsa-tests.ts +++ b/types/node-rsa/node-rsa-tests.ts @@ -2,6 +2,11 @@ import NodeRSA = require('node-rsa'); const key = new NodeRSA({ b: 512 }); +key.setOptions({ + encryptionScheme: 'pkcs1_oaep', + signingScheme: 'pkcs1' +}); + const text = 'Hello RSA!'; const encrypted = key.encrypt(text, 'base64'); const decrypted = key.decrypt(encrypted, 'utf8'); From 7ad3c1e81cf65d5b355d20a636b1e194943c3ff2 Mon Sep 17 00:00:00 2001 From: Christian Moniz Date: Mon, 19 Mar 2018 16:06:04 -0700 Subject: [PATCH 0107/2153] Bump version in `index.d.ts` to 0.4.2 --- types/node-rsa/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/node-rsa/index.d.ts b/types/node-rsa/index.d.ts index c697ee0db4..05ebb24547 100644 --- a/types/node-rsa/index.d.ts +++ b/types/node-rsa/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for node-rsa 0.4 +// Type definitions for node-rsa 0.4.2 // Project: https://github.com/rzcoder/node-rsa // Definitions by: Ali Taheri // Christian Moniz From 94ae11d0d90af7f7cd877d2dae5b77b3d85a6c4b Mon Sep 17 00:00:00 2001 From: Christian Moniz Date: Mon, 19 Mar 2018 16:11:22 -0700 Subject: [PATCH 0108/2153] Remove patch version from header --- types/node-rsa/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/node-rsa/index.d.ts b/types/node-rsa/index.d.ts index 05ebb24547..c697ee0db4 100644 --- a/types/node-rsa/index.d.ts +++ b/types/node-rsa/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for node-rsa 0.4.2 +// Type definitions for node-rsa 0.4 // Project: https://github.com/rzcoder/node-rsa // Definitions by: Ali Taheri // Christian Moniz From 984170a6915ba81296258d947593afc24607968a Mon Sep 17 00:00:00 2001 From: Justin Rockwood Date: Mon, 19 Mar 2018 17:57:09 -0700 Subject: [PATCH 0109/2153] fix(inquirer): allow promises in some Question options #18105 According to the docs at at https://github.com/SBoudrias/Inquirer.js/#objects, the following should allow functions that return promises: default, choices, validate, filter, and when. --- types/inquirer/index.d.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/types/inquirer/index.d.ts b/types/inquirer/index.d.ts index 4fc2ca4ce0..17ae8092df 100644 --- a/types/inquirer/index.d.ts +++ b/types/inquirer/index.d.ts @@ -5,6 +5,7 @@ // Jouderian // Qibang // Jason Dreyzehner +// Justin Rockwood // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -90,7 +91,7 @@ declare namespace inquirer { * Default value(s) to use if nothing is entered, or a function that returns the default value(s). * If defined as a function, the first parameter will be the current inquirer session answers. */ - default?: any | ((answers: T) => any); + default?: any | ((answers: T) => any) | ((answers: T) => Promise); /** * Choices array or a function returning a choices array. If defined as a function, * the first parameter will be the current inquirer session answers. @@ -99,22 +100,23 @@ declare namespace inquirer { */ choices?: | ReadonlyArray - | ((answers: T) => ReadonlyArray); + | ((answers: T) => ReadonlyArray) + | ((answers: T) => Promise>); /** * Receive the user input and should return true if the value is valid, and an error message (String) * otherwise. If false is returned, a default error message is provided. */ - validate?(input: string, answers?: T): boolean | string; + validate?(input: string, answers?: T): boolean | string | Promise; /** * Receive the user input and return the filtered value to be used inside the program. * The value returned will be added to the Answers hash. */ - filter?(input: string): string; + filter?(input: string): string | Promise; /** * Receive the current user answers hash and should return true or false depending on whether or * not this question should be asked. The value can also be a simple boolean. */ - when?: boolean | ((answers: T) => boolean); + when?: boolean | ((answers: T) => boolean) | ((answers: T) => Promise); paginated?: boolean; /** * Change the number of lines that will be rendered when using list, rawList, expand or checkbox. From b3888abd05465d4f8464490b5852e71d6a276886 Mon Sep 17 00:00:00 2001 From: Justin Rockwood Date: Mon, 19 Mar 2018 18:00:02 -0700 Subject: [PATCH 0110/2153] fix(inquirer): allow 'any' for ChoiceOption according to docs #17368 --- types/inquirer/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/inquirer/index.d.ts b/types/inquirer/index.d.ts index 17ae8092df..c0aba80f23 100644 --- a/types/inquirer/index.d.ts +++ b/types/inquirer/index.d.ts @@ -242,7 +242,7 @@ declare namespace inquirer { interface ChoiceOption { name?: string; - value?: string; + value?: any; type?: string; extra?: any; key?: string; From d88053b9f98c289f0797850a14c9ee159c7d80ab Mon Sep 17 00:00:00 2001 From: Ricardo De Pena Date: Mon, 19 Mar 2018 22:23:46 -0400 Subject: [PATCH 0111/2153] Changes added for OpenFin version .29 --- types/openfin/v29/index.d.ts | 1891 ++++++++++++++++++++++ types/openfin/v29/openfin-tests.ts | 797 +++++++++ types/openfin/{v30 => v29}/tsconfig.json | 7 +- types/openfin/{v30 => v29}/tslint.json | 0 types/openfin/v30/index.d.ts | 1756 -------------------- types/openfin/v30/openfin-tests.ts | 728 --------- types/openfin/v30/v30 | 1736 -------------------- 7 files changed, 2694 insertions(+), 4221 deletions(-) create mode 100644 types/openfin/v29/index.d.ts create mode 100644 types/openfin/v29/openfin-tests.ts rename types/openfin/{v30 => v29}/tsconfig.json (83%) rename types/openfin/{v30 => v29}/tslint.json (100%) delete mode 100644 types/openfin/v30/index.d.ts delete mode 100644 types/openfin/v30/openfin-tests.ts delete mode 100644 types/openfin/v30/v30 diff --git a/types/openfin/v29/index.d.ts b/types/openfin/v29/index.d.ts new file mode 100644 index 0000000000..3ddbdf2edd --- /dev/null +++ b/types/openfin/v29/index.d.ts @@ -0,0 +1,1891 @@ +// Type definitions for OpenFin API 29.0 +// Project: https://openfin.co/ +// Definitions by: Chris Barker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// based on v8.56.29.51 +// see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean + +/** + * JavaScript API + * The JavaScript API allows you to create an HTML/JavaScript application that has access to the native windowing environment, + * can communicate with other applications and has access to sandboxed system-level features. + * + * API Ready + * When using the OpenFin API, it is important to ensure that it has been fully loaded before making any API calls. To verify + * that the API is in fact ready, be sure to make any API calls either from within the fin.desktop.main() method or explicitly + * after it has returned. This avoids the situation of trying to access methods that are not yet fully injected. + * + * Overview + * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API + * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "documennt" objects. + */ +declare namespace fin { + const desktop: OpenFinDesktop; + + interface OpenFinDesktop { + main(f: () => any): void; + Application: OpenFinApplicationStatic; + ExternalApp: OpenFinExternalApplicationStatic; + InterApplicationBus: OpenFinInterApplicationBus; + Notification: OpenFinNotificationStatic; + System: OpenFinSystem; + Window: OpenFinWindowStatic; + Frame: OpenFinFrameStatic; + } + + interface OpenFinApplicationStatic { + /** + * Creates a new Application. + * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. + */ + new ( + options: ApplicationOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; + /** + * Launches the given Application manifest. + */ + createFromManifest(manifestUrl: string, callback?: (app: OpenFinApplication) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Returns an Application object that represents an existing application. + */ + getCurrent(): OpenFinApplication; + /** + * Returns an Application object that represents an existing application. + */ + wrap(uuid: string): OpenFinApplication; + } + + /** + * Application + * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. + */ + interface OpenFinApplication { + /** + * Returns an instance of the main Window of the application + */ + getWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinApplicationEventType, + listener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Closes the application and any child windows created by the application. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. + */ + getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. + */ + getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. + */ + getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. + */ + getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves current configuration of application's shortcuts. + */ + getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves information about the application. + */ + getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves information about the system tray. + */ + getTrayIconInfo(callback?: (trayInfo: TrayIconInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the application is currently running. + */ + isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Registers a username and an app name for licensing purposes. + */ + registerUser(userName: string, appName: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinApplicationEventType, + previouslyRegisteredListener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => any, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the application's icon from the tray. + */ + removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restarts the application. + */ + restart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Runs the application. When the application is created, run must be called. + */ + run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Tells the rvm to relaunch the main application once upon a complete shutdown + */ + scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets new shortcut configuration for current application. + * Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to + * be able to change shortcut states. + */ + setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Adds a customizable icon in the system tray and notifies the application when clicked. + */ + setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the application by terminating its process. + */ + terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application + * to continue and to generate another "not-responding" message after a certain period of time. + */ + wait(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * The Application's uuid + */ + uuid: string; + } + + interface ShortCutConfig { + /** + * application has a shortcut on the desktop + */ + desktop?: boolean; + /** + * application has no shortcut in the start menu + */ + startMenu?: boolean; + /** + * application will be launched on system startup + */ + systemStartup?: boolean; + } + + interface SuccessObj { + httpResponseCode: number; + } + + interface NetworkErrorInfo extends ErrorInfo { + networkErrorCode: number; + } + + interface ErrorInfo { + stack: string; + message: string; + } + + interface ApplicationOptions { + /** + * The name of the application. + */ + name?: string; + /** + * The url to the application. + */ + url?: string; + /** + * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. + */ + uuid?: string; + /** + * Enable Flash at the application level. Default: false. + */ + plugins?: boolean; + /** + * The options of the main window of the application. + */ + mainWindowOptions?: WindowOptions; + } + + interface WindowOptions { + /** + * Enable keyboard shortcuts for devtools and zoom. Default: false for both. + */ + accelerator?: { + devtools?: boolean, + zoom?: boolean, + reload?: boolean, + reloadIgnoreCache?: boolean, + }; + /** + * A flag to always position the window at the top of the window stack. Default: false. + * Updatable + */ + alwaysOnTop?: boolean; + /** + * A flag to automatically show the Window when it is created. Default: false. + */ + autoShow?: boolean; + /** + * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true + * Updatable + */ + contextMenu?: boolean; + /** + * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. + * Updatable + */ + cornerRounding?: { + width?: number; + height?: number; + }; + /** + * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. + */ + customData?: any; + /** + * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the position from before the window was closed is used. + * This option overrides defaultLeft and defaultTop. Default: false. + */ + defaultCentered?: boolean; + /** + * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. + */ + defaultHeight?: number; + /** + * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. + */ + defaultWidth?: number; + /** + * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. + */ + defaultTop?: number; + /** + * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. + */ + defaultLeft?: number; + /** + * A flag to show the frame. Default: true. + * Updatable + */ + frame?: boolean; + /** + * A flag to allow a window to be hidden when the close button is clicked.Default: false. + * Updatable + */ + hideOnClose?: boolean; + /** + * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. + * Updatable + */ + icon?: string; + /** + * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxHeight?: number; + /** + * A flag that lets the window be maximized.Default: true. + * Updatable + */ + maximizable?: boolean; + /** + * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxWidth?: number; + /** + * The minimum height of a window.Default: 0. + * Updatable + */ + minHeight?: number; + /** + * A flag that lets the window be minimized.Default: true. + */ + minimizable?: boolean; + /** + * The minimum width of a window.Default: 0. + */ + minWidth?: number; + /** + * The name for the window which must be unique within the context of the invoking Application. + */ + name?: string; + /** + * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. + * Updatable + */ + opacity?: number; + /** + * A flag to drop to allow the user to resize the window.Default: true. + * Updatable + */ + resizable?: boolean; + /** + * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. + * Updatable + */ + resizeRegion?: { + /** + * The size in pixels (Default: 2), + */ + size?: number; + /** + * The size in pixels of an additional + * square resizable region located at the + * bottom right corner of a + * frameless window. (Default: 4) + */ + bottomRightCorner?: number; + }; + /** + * A flag to show the Window's icon in the taskbar. Default: true. + */ + showTaskbarIcon?: boolean; + /** + * A flag to cache the location of the window or not. Default: true. + */ + saveWindowState?: boolean; + /** + * Specify a taskbar group for the window. Default: app's uuid. + */ + taskbarIconGroup?: string; + /** + * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". + */ + state?: string; + /** + * The URL of the window. Default: "about:blank". + */ + url?: string; + /** + * When set to false, the window will render before the "load" event is fired on the content's window. + * Caution, when false you will see an initial empty white window. Default: true. + */ + waitForPageLoad?: boolean; + } + + /** + * Clipboard + * Clipboard API allows reading and writting to the clipboard in multiple formats. + */ + interface OpenFinClipboard { + /** + * Reads available formats for the clipboard type + */ + availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Reads available formats for the clipboard type + */ + readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as Rtf + */ + readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as plain text + */ + readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard + */ + write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Html + */ + writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Rtf + */ + writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as plain text + */ + writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + interface OpenFinExternalApplicationStatic { + /** + * Returns an External Application object that represents an existing external application. + */ + wrap(uuid: string): OpenFinExternalApplication; + } + /** + * ExternalApplication + * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. + */ + interface OpenFinExternalApplication { + /** + * Retrieves information about the application. + */ + getInfo(callback?: (info: ExternalApplicationInfo) => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + /** + * InterApplicationBus + * A messaging bus that allows for pub/sub messaging between different applications. + */ + interface OpenFinInterApplicationBus { + /** + * Adds a listener that gets called when applications subscribe to the current application's messages. + */ + addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Adds a listener that gets called when applications unsubscribe to the current application's messages. + */ + addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered subscribe listener. + */ + removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered unsubscribe listener. + */ + removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. + */ + publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sends a message to a specific application on a specific topic. + */ + send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], + * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. + */ + subscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + subscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Unsubscribes to messages from the specified application on the specified topic. + */ + unsubscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + unsubscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + } + + interface OpenFinNotificationStatic { + /** + * ctor + */ + new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; + /** + * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. + */ + getCurrent(): OpenFinNotification; + } + + /** + * Notification + * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. + * A notification is typically used to alert the user of some important event which requires his or her attention. + * Notifications are a child or your application that are controlled by the runtime. + */ + interface OpenFinNotification { + /** + * Closes the notification. + */ + close(callback?: () => void): void; + /** + * Sends a message to the notification. + */ + sendMessage(message: any, callback?: () => void): void; + /** + * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. + */ + sendMessageToApplication(message: any, callback?: () => void): void; + } + + interface NotificationOptions { + /** + * A boolean that will force dismissal even if the mouse is hovering over the notification + */ + ignoreMouseOver?: boolean; + /** + * A message of any primitive or composite-primitive type to be passed to the notification upon creation. + */ + message?: any; + /** + * The timeout for displaying a notification.Can be in milliseconds or "never". + */ + duration?: number | "never"; + /** + * The url of the notification + */ + url?: string; + /** + * A function that is called when a notification is clicked. + */ + onClick?(callback: () => void): void; + /** + * Invoked when the notification is closed via .close() method on the created notification instance + * or the by the notification itself via fin.desktop.Notification.getCurrent().close(). + * NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss + */ + onClose?(callback: () => void): void; + /** + * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. + */ + onDismiss?(callback: () => void): void; + /** + * A function that is called when an error occurs.The reason for the error is passed as an argument. + */ + onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * The onMessage function will respond to messages sent from notification.sendMessageToApplication. + * The function is passed the message, which can be of any primitive or composite-primitive type. + */ + onMessage?(callback: (message: any) => void): void; + /** + * A function that is called when a notification is shown. + */ + onShow?(callback: (successObj: SuccessObj) => void): void; + } + + /** + * System + * An object representing the core of OpenFin Runtime. + * Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. + */ + interface OpenFinSystem { + Clipboard: OpenFinClipboard; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Clears cached data containing window state/positions, + * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. + */ + clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Clears all cached data when OpenFin Runtime exits. + */ + deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Downloads the given application asset + */ + downloadAsset( + assetObj: AppAssetInfo, + progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, + callback?: (successObj: { path: string }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + + /** + * Download preload scripts from given URLs + */ + downloadPreloadScripts(scripts: Array, callback?: (downloadInfo: Array) => void, + errorCallback?: (reason: string) => void): void; + /** + * Downloads the given OpenFin Runtime. + */ + downloadRuntime(options: RuntimeDownloadOptions, onProgress?: (progress: RuntimeDownloadProgress) => void, onComplete?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Exits the Runtime. + */ + exit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Writes any unwritten cookies data to disk. + */ + flushCookieStore(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all applications. + */ + getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all external applications. + */ + getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data (name, ids, bounds) for all application windows. + */ + getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns information about the app asset. + */ + getAppAssetInfo(options: AppAssetOptions, callback?: (appAssetInfo: AppAssetInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Get additional info of cookies. + */ + getCookies(option: CookieOption, callback?: (info: Array) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the command line argument string that started OpenFin Runtime. + */ + getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the configuration object that started the OpenFin Runtime. + */ + getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns a hex encoded hash of the mac address and the currently logged in user name + */ + getDeviceUserId(callback?: (id: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns an Entity info object relating to the entity specified by the uuid and name passed in. The possible types are 'window', 'iframe', 'external connection' or 'unknown'. + */ + getEntityInfo(uuid: string, name: string, callback?: (info: EntityInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the value of a given environment variable on the computer on which the runtime is installed. + */ + getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves currently focused window identity. + */ + getFocusedWindow(callback?: (focusedWindowIdentity: Identity) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves system information. + */ + getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the contents of the log with the specified filename. + */ + getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing information for each log file. + */ + getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the minimum (inclusive) logging level that is currently being written to the logs. + */ + getMinLogLevel(callback?: (logLevel: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. + */ + getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the mouse in virtual screen coordinates (left, top). + */ + getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of all of the runtime processes that are currently running. + * Each element in the array is an object containing the uuid and the name of the application to which the process belongs. + */ + getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the Proxy settings. + */ + getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns information about the running RVM in an object. + */ + getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. + */ + getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Runs an executable or batch file. + */ + launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Writes the passed message into both the log file and the console. + */ + log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Monitors a running process. + */ + monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Opens the passed URL in the default web browser. + */ + openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Opens the passed URL in the default web browser. + */ + readRegistryValue(rootKey: string, subkey: string, value: string, callback?: (info: RegistryInfo) => void, + errorCallback?: (reason: string) => void): void; + /** + * This function call will register a unique id and produce a token. The token can be used to broker an external connection. + */ + registerExternalConnection( + uuid: string, + callback?: (detail: { + /** + * this will be unique each time + */ + token: string; + /** + * "remote-connection-uuid" + */ + uuid: string; + }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). + */ + releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Set the minimum log level above which logs will be written to the OpenFin log + */ + setMinLogLevel(logLevel: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the Chrome Developer Tools for the specified window. + */ + showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. + */ + terminateExternalProcess( + processUuid: string, + timeout: number, + killTree: boolean, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + terminateExternalProcess( + processUuid: string, + timeout: number, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Update the OpenFin Runtime Proxy settings. + */ + updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface CacheOptions { + cache?: boolean; + cookies?: boolean; + localStorage?: boolean; + appcache?: boolean; + userData?: boolean; + } + + interface AppAssetInfo { + src?: string; + alias?: string; + version?: string; + target?: string; + args?: string; + mandatory?: boolean; + } + + interface AppAssetOptions { + alias: string; + } + + interface ApplicationInfo { + /** + * true when the application is running. + */ + isRunning?: boolean; + /** + * uuid of the application. + */ + uuid?: string; + /** + * uuid of the application that launches this application. + */ + parentUuid?: string; + } + + interface Identity { + uuid: string; + name: string; + } + + interface EntityInfo { + name: string; + uuid: string; + parent: Identity; + entityType: string; + } + + interface DownloadPreloadOption { + url: string; + } + + interface DownloadPreloadInfo { + success: boolean; + url?: string; + error: string; + } + + + interface CookieInfo { + name: string; + // expirationDate: Date; + domain: string; + path: string; + } + + interface CookieOption { + name: string; + } + + interface RegistryInfo { + data: any; + rootKey: string; + subkey: string; + type: string; + value: string; + } + + interface RuntimeDownloadOptions { + version: string; + } + + interface RuntimeDownloadProgress { + downloadedBytes: number; + totalBytes: number; + } + + interface WindowDetails { + uuid?: string; + mainWindow?: WindowInfo; + childWindows?: WindowInfo[]; + } + + interface WindowInfo { + /** + * name of the child window + */ + name?: string; + /** + * top-most coordinate of the child window + */ + top?: number; + /** + * right-most coordinate of the child window + */ + right?: number; + /** + * bottom-most coordinate of the child window + */ + bottom?: number; + /** + * left-most coordinate of the child window + */ + left?: number; + } + + interface HostSpecInfo { + /** + * "x86" for 32-bit or "x86_64" for 64-bit + */ + arch: string; + /** + * Same payload as Node's os.cpus() + */ + cpus: NodeCpuInfo[]; + gpu: { + /** + * Graphics card name + */ + name: string; + }; + /** + * Same payload as Node's os.totalmem() + */ + memory: number; + /** + * OS name and version/edition + */ + name: string; + } + + interface NodeCpuInfo { + model: string; + /** + * in MHz + */ + speed: number; + times: { + /** + * The number of milliseconds the CPU has spent in user mode. + */ + user: number; + /** + * The number of milliseconds the CPU has spent in nice mode. + */ + nice: number; + /** + * The number of milliseconds the CPU has spent in sys mode. + */ + sys: number; + /** + * The number of milliseconds the CPU has spent in idle mode. + */ + idle: number; + /** + * The number of milliseconds the CPU has spent in irq mode. + */ + irq: number; + }; + } + + interface LogInfo { + /** + * the filename of the log + */ + name?: string; + /** + * the size of the log in bytes + */ + size?: number; + /** + * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" + */ + date?: string; + } + + interface ProcessInfo { + /** + * the percentage of total CPU usage + */ + cpuUsage?: number; + /** + * the application name + */ + name?: string; + /** + * the current nonpaged pool usage in bytes + */ + nonPagedPoolUsage?: number; + /** + * the number of page faults + */ + pageFaultCount?: number; + /** + * the current paged pool usage in bytes + */ + pagedPoolUsage?: number; + /** + * the total amount of memory in bytes that the memory manager has committed + */ + pagefileUsage?: number; + /** + * the peak nonpaged pool usage in bytes + */ + peakNonPagedPoolUsage?: number; + /** + * the peak paged pool usage in bytes + */ + peakPagedPoolUsage?: number; + /** + * the peak value in bytes of pagefileUsage during the lifetime of this process + */ + peakPagefileUsage?: number; + /** + * the peak working set size in bytes + */ + peakWorkingSetSize?: number; + /** + * the native process identifier + */ + processId?: number; + /** + * the application UUID + */ + uuid?: string; + /** + * the current working set size (both shared and private data) in bytes + */ + workingSetSize?: number; + } + + interface ProxyInfo { + /** + * the configured Proxy Address + */ + proxyAddress?: string; + /** + * the configured Proxy port + */ + proxyPort?: number; + /** + * Proxy Type + */ + type?: string; + } + + interface RvmInfo { + version?: string; + "start-time"?: string; + } + + interface ExternalProcessLaunchInfo { + path?: string; + /** + * Additionally note that the executable found in the zip file specified in appAssets + * will default to the one mentioned by appAssets.target + * If the the path below refers to a specific path it will override this default + */ + alias?: string; + /** + * When using alias; if no arguments are passed then the arguments (if any) + * are taken from the 'app.json' file, from the 'args' parameter + * of the 'appAssets' Object with the relevant 'alias'. + * If 'arguments' is passed as a parameter it takes precedence + * over any 'args' set in the 'app.json'. + */ + arguments?: string; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + certificate?: CertificationInfo; + } + + interface CertificationInfo { + /** + * A hex string with or without spaces + */ + serial?: string; + /** + * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields + */ + subject?: string; + /** + * A hex string with or without spaces + */ + publickey?: string; + /** + * A hex string with or without spaces + */ + thumbprint?: string; + /** + * A boolean indicating that the certificate is trusted and not revoked + */ + trusted?: boolean; + } + + interface ExternalProcessInfo { + pid?: number; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + } + + interface OpenFinWindowStatic { + /** + * Class: Window + * + * new Window(options, callbackopt, errorCallbackopt) + * + * Creates a new OpenFin Window + * + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + * @param options - The options of the window + * @param [callback] - Called if the window creation was successful + * @param [callback.successObj] - httpResponseCode + */ + new ( + options: WindowOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; + /** + * Returns an instance of the current window. + * @returns Current window + */ + getCurrent(): OpenFinWindow; + /** + * Returns a Window object that wraps an existing window. + */ + wrap(appUuid: string, windowName: string): OpenFinWindow; + } + + /** + * Window + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + */ + interface OpenFinWindow { + /** + * Name of window + */ + name: string; + /** + * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, + * otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the + * contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. + * Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). + * @returns Native window + */ + getNativeWindow(): Window; + /** + * Gets the parent application. + * @returns Parent application + */ + getParentApplication(): OpenFinApplication; + /** + * Gets the parent window. + */ + getParentWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Performs the specified window transitions + */ + animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Provides credentials to authentication requests + */ + authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes focus from the window. + */ + blur(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Brings the window to the front of the OpenFin window stack. + */ + bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the window. + * @param Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Prevents a user from changing a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-disabled' is generated when an enabled frame becomes disabled. + */ + disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Re-enables user changes to a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-enabled' is generated when a disabled frame has becomes enabled. + */ + enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Flashes the window's frame and taskbar icon until the window is activated. + */ + flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gives focus to the window. + */ + focus(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current bounds (top, left, width, height) of the window. + */ + getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. + * Please note that calling window is included in the result array. + */ + getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current settings of the window. + */ + getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets a base64 encoded PNG snapshot of the window. + */ + getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current state ("minimized", "maximized", or "restored") of the window. + */ + getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the zoom level of the window. + */ + getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; + /** + * Hides the window. + */ + hide(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the window is currently showing. + */ + isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Joins the same window group as the specified window. + */ + joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Leaves the current window group so that the window can be move independently of those in the group. + */ + leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Maximizes the window. + */ + maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Merges the instance's window group with the same window group as the specified window + */ + mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Minimizes the window. + */ + minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window by a specified amount. + */ + moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window to a specified location. + */ + moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restores the window to its normal state (i.e., unminimized, unmaximized). + */ + restore(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Will bring the window to the front of the entire stack and give it focus. + */ + setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the window's size and position + */ + setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the zoom level of the window. + */ + setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden. + * @param Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. + */ + show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. + */ + showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Stops the taskbar icon from flashing. + */ + stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Updates the window using the passed options + */ + updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface OpenFinFrameStatic { + wrap(uuid: string, name: string): OpenFinFrame; + + getCurrent(): OpenFinFrame; + } + + interface OpenFinFrame { + name: string; + uuid: string; + + addEventListener(type: string, listener: () => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + + getParentWindow(callback?: (entityInfo: EntityInfo) => void, errorCallback?: (reason: string) => void): void; + + getInfo(callback?: (entityInfo: EntityInfo) => void, errorCallback?: (reason: string) => void): void; + + removeEventListener(type: string, listener: () => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface ApplicationBaseEvent { + topic: string; + type: OpenFinApplicationEventType; + uuid: string; + } + + interface TrayIconClickedEvent extends ApplicationBaseEvent { + button: number; // 0 for left, 1 for middle, 2 for right + monitorInfo: MonitorInfo; + x: number; // the cursor x coordinate + y: number; // the cursor y coordinate + } + + interface WindowEvent extends ApplicationBaseEvent { + name: string; + } + + interface WindowAlertRequestedEvent extends WindowEvent { + message: string; + url: string; + } + + interface WindowAuthRequested extends WindowEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowNavigationRejectedEvent extends WindowEvent { + sourceName: string; + url: string; + } + + interface WindowEndLoadEvent extends WindowEvent { + documentName: string; + isMain: boolean; + } + + interface MonitorInfoChangedEvent extends MonitorInfo { + topic: "system"; + type: "monitor-info-changed"; + } + + interface MonitorInfo { + nonPrimaryMonitors: MonitorInfoDetail[]; + primaryMonitor: MonitorInfoDetail; + reason: string; + taskbar: { + edge: "left" | "right" | "top" | "bottom", + rect: MontiorCoordinates + }; + topic: "system"; + type: "monitor-info-changed"; + virtualScreen: MontiorCoordinates; + } + + interface TrayIconInfo { + x: number; + y: number; + bounds: { + x: number; + y: number; + width: number; + height: number; + } + monitorInfo: MonitorInfo + } + + interface MonitorInfoDetail { + availableRect: MontiorCoordinates; + deviceId: string; + displayDeviceActive: boolean; + monitorRect: MontiorCoordinates; + name: string; + } + + interface MontiorCoordinates { + bottom: number; + left: number; + right: number; + top: number; + } + + interface VirtualScreenCoordinates { + left: number; + top: number; + } + + interface SystemBaseEvent { + topic: string; + type: OpenFinSystemEventType; + uuid: string; + } + + interface DesktopIconClickedEvent { + mouse: { + /** + * the left virtual screen coordinate of the mouse + */ + left: number, + /** + * the top virtual screen coordinate of the mouse + */ + top: number + }; + /** + * the number of milliseconds that have elapsed since the system was started, + */ + tickCount: number; + topic: "system"; + type: "desktop-icon-clicked"; + } + + interface IdleStateChangedEvent { + /** + * How long in milliseconds since the user has been idle. + */ + elapsedTime: number; + /** + * true when the user is idle,false when the user has returned; + */ + isIdle: boolean; + topic: "system"; + type: "idle-state-changed"; + } + + interface WindowBaseEvent { + /** + * the name of the window + */ + name: string; + /** + * always window + */ + topic: "window"; + /** + * window event type + */ + type: OpenFinWindowEventType; + /** + * the UUID of the application the window belongs to + */ + uuid: string; + } + + interface WindowAuthRequestedEvent extends WindowBaseEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowBoundsEvent extends WindowBaseEvent { + /** + * describes what kind of change occurred. + * 0 means a change in position. + * 1 means a change in size. + * 2 means a change in position and size. + */ + changeType: number; + /** + * true when pending changes have been applied to the window. + */ + deferred: boolean; + /** + * the new height of the window. + */ + height: number; + /** + * the left-most coordinate of the window. + */ + left: number; + /** + * the top-most coordinate of the window. + */ + top: number; + + type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; + /** + * the new width of the window. + */ + width: number; + } + + interface WindowExternalProcessStartedEvent extends WindowBaseEvent { + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-started"; + } + + interface WindowExternalProcessExited extends WindowBaseEvent { + /** + * the process exit code + */ + exitCode: number; + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-exited"; + } + + interface WindowGroupChangedEvent extends WindowBaseEvent { + /** + * Which group array the window that the event listener was registered on is included in: + * 'source' The window is included in sourceGroup. + * 'target' The window is included in targetGroup. + * 'nothing' The window is not included in sourceGroup nor targetGroup. + */ + memberOf: "source" | "target" | "nothing"; + /** + * The reason this event was triggered. + * 'leave' A window has left the group due to a leave or merge with group. + * 'join' A window has joined the group. + * 'merge' Two groups have been merged together. + * 'disband' There are no other windows in the group. + */ + reason: "leave" | "join" | "merge" | "disband"; + /** + * All the windows in the group the sourceWindow originated from. + */ + sourceGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. + */ + sourceWindowAppUuid: string; + /** + * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. + */ + sourceWindowName: string; + /** + * All the windows in the group the targetWindow orginated from + */ + targetGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowAppUuid: string; + /** + * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowName: string; + type: "group-changed"; + } + + interface WindowOfGroupInfo { + /** + * The UUID of the application this window entry belongs to. + */ + appUuid: string; + /** + * The name of this window entry. + */ + windowName: string; + } + + interface WindowHiddenEvent extends WindowBaseEvent { + /** + * What action prompted the close. + * The reasons are: "hide", "hide-on-close" + */ + reason: "hide" | "hide-on-close"; + type: "hidden"; + } + + interface Window_NavigationRejectedEvent { + name: string; + /** + * source of navigation window name + */ + sourceName: string; + topic: "navigation-rejected"; + /** + * Url that was not reached "http://blocked-content.url" + */ + url: string; + /** + * the UUID of the application the window belongs to. + */ + uuid: string; + } + + interface AnimationTransition { + opacity?: { + /** + * This value is clamped from 0.0 to 1.0 + */ + opacity?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'opacity' as absolute or as a delta. Defaults to false. + */ + relative?: boolean; + }; + position?: { + /** + * Defaults to the window's current left position in virtual screen coordinates. + */ + left?: number; + /** + * Defaults to the window's current top position in virtual screen coordinates. + */ + top?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + size?: { + /** + * Optional if height is present. Defaults to the window's current width. + */ + width?: number; + /** + * Optional if width is present. Defaults to the window's current height. + */ + height?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + } + + interface AnimationOptions { + /** + * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. + */ + interrupt?: boolean; + /** + * Transition effect. Defaults to 'ease-in-out'. + */ + tween?: OpenFinTweenType; + } + + interface WindowBounds { + /** + * the height of the window. + */ + height?: number; + /** + * left-most coordinate of the window. + */ + left?: number; + /** + * top-most coordinate of the window. + */ + top?: number; + /** + * the width of the window. + */ + width?: number; + } + + interface ExternalApplicationInfo { + parent: { + uuid: string; + name: string; + } + } + + interface SessionChangedEvent { + /** + * the action that triggered this event: + */ + reason: "lock" + | "unlock" + | "remote-connect" + | "remote-disconnect" + | "unknown"; + topic: "system"; + type: "session-changed"; + } + + interface LaunchInfo { + launchMode: "fin-protocol" + | "fins-protocol" + | "shortcut" + | "command-line" + | "adapter" + | "other" + | string; + } + + type OpenFinTweenType = "linear" + | "ease-in" + | "ease-out" + | "ease-in-out" + | "ease-in-quad" + | "ease-out-quad" + | "ease-in-out-quad" + | "ease-in-cubic" + | "ease-out-cubic" + | "ease-in-out-cubic" + | "ease-out-bounce" + | "ease-in-back" + | "ease-out-back" + | "ease-in-out-back" + | "ease-in-elastic" + | "ease-out-elastic" + | "ease-in-out-elastic"; + + type OpenFinApplicationEventType = "closed" + | "connected" + | "crashed" + | "initialized" + | "manifest-changed" + | "not-responding" + | "out-of-memory" + | "responding" + | "run-requested" + | "started" + | "tray-icon-clicked" + | "window-alert-requested" + | "window-auth-requested" + | "window-closed" + | "window-created" + | "window-end-load" + | "window-navigation-rejected" + | "window-show-requested" + | "window-start-load"; + + type OpenFinExternalApplicationEventType = "connected" + | "disconnected"; + + type OpenFinSystemEventType = "application-closed" + | "application-crashed" + | "application-created" + | "application-started" + | "desktop-icon-clicked" + | "idle-state-changed" + | "monitor-info-changed" + | "session-changed"; + + type OpenFinWindowEventType = "auth-requested" + | "blurred" + | "bounds-changed" + | "bounds-changing" + | "close-requested" + | "closed" + | "disabled-frame-bounds-changed" + | "disabled-frame-bounds-changing" + | "embedded" + | "external-process-exited" + | "external-process-started" + | "focused" + | "frame-disabled" + | "frame-enabled" + | "group-changed" + | "hidden" + | "initialized" + | "maximized" + | "minimized" + | "navigation-rejected" + | "restored" + | "show-requested" + | "shown"; + + type OpenFinAnchor = "top-left" + | "top-right" + | "bottom-left" + | "bottom-right"; +} diff --git a/types/openfin/v29/openfin-tests.ts b/types/openfin/v29/openfin-tests.ts new file mode 100644 index 0000000000..2b5237c1e8 --- /dev/null +++ b/types/openfin/v29/openfin-tests.ts @@ -0,0 +1,797 @@ +function test_application() { + let application: fin.OpenFinApplication; + // constructor + application = new fin.desktop.Application({ + url: "application.html", + uuid: "74BED629-2D8E-4141-8582-73E364BDFA74", + name: "Application Name", + plugins: false, + mainWindowOptions: { + defaultHeight: 600, + defaultWidth: 800, + defaultTop: 300, + defaultLeft: 300, + autoShow: true + } + }, (successObj) => { + console.log("Application successfully created, HTTP response code:", successObj); + application.run(); + }, (error) => { + console.log("Error creating application:", error); + }); + //createFromManifest + fin.desktop.Application.createFromManifest("http://stuf.com/app.json", (app) => { + console.log(app.uuid); + }, err => console.log(err)); + // getCurrent + application = fin.desktop.Application.getCurrent(); + // wrap + application = fin.desktop.Application.wrap("454C7F31-A915-4EA2-83F2-CFA655453C52"); + // getWindow + application.getWindow(); + // addEventListener + application.addEventListener("closed", (event) => { + console.log("The application has closed"); + }, () => { + console.log("The registration was successful"); + }, reason => { + console.log("failure: " + reason); + }); + // close + application.close(); + // getChildWindows + application.getChildWindows(children => { + children.forEach(childWindow => { + console.log("Showing child: " + childWindow.name); + childWindow.show(); + }); + }); + // getGroups + application.getGroups(allGroups => { + console.log(`There are a total of ${allGroups.length} groups.`); + + let groupCounter = 1; + allGroups.forEach(windowGroup => { + console.log(`Group ${groupCounter} contains ${windowGroup.length} windows.`); + ++groupCounter; + }); + }); + // getManifest + application.getManifest(manifest => { + console.log("Application manifest:"); + console.log(manifest); + }); + // getParentUuid + application.getParentUuid(parentUuid => { + console.log("UUID of parent application:"); + console.log(parentUuid); + }); + // getShortcuts + application.getShortcuts(config => { + console.log("Desktop shortcut is enabled: ", config.desktop); + console.log("Start Menu shortcut is enabled: ", config.startMenu); + console.log("System Startup shortcut is enabled: ", config.systemStartup); + }); + // getInfo + application.getInfo(info => { + console.log(`Launch mode: ${info.launchMode}`); + }); + // getTrayIconInfo + application.getTrayIconInfo(info => { + console.log(info.x, info.y, info.bounds.x, info.bounds.y, info.bounds.height, info.bounds.width, + info.monitorInfo.type, info.monitorInfo.reason); + }); + // isRunning + application.isRunning(running => { + console.log("the application is", running ? "running" : "not running"); + }); + // registerCustomData + application.registerUser("a", "b", () => console.log("done"), err => console.log(err)); + // removeEventListener + const previousCallback = (event: fin.WindowEvent) => { }; + application.removeEventListener("closed", previousCallback, () => { + console.log("The unregistration was successful"); + }, err => { + console.log("failure:", err); + }); + // removeTrayIcon + application.removeTrayIcon(() => { + console.log("Removed the tray icon."); + }, err => { + console.log("failure:", err); + }); + // restart + application.restart(() => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // schedule restart + application.scheduleRestart(() => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // setShortcuts + application.setShortcuts({ + desktop: true, + startMenu: false, + systemStartup: true + }, () => { + console.log("Successfully set new shortcut states"); + }, error => { + console.log("Failed to set new shortcut states. Error: ", error); + }); + // setTrayIcon + application.setTrayIcon("https://developer.openf.in/download/openfin.png", clickInfo => { + console.log(`The mouse has clicked at (${clickInfo.x}, ${clickInfo.y})`); + }); + // terminate + application.terminate(); + // wait + application.addEventListener("not-responding", () => { + console.log("waiting for hung application"); + application.wait(); + }); + //uuid + let hasUuid = application.uuid; +} + +function test_external_application() { + let externalApp: fin.OpenFinExternalApplication; + // wrap + externalApp = fin.desktop.ExternalApp.wrap('my-uuid'); + // addEventListener + externalApp.addEventListener('connected', () => { + console.log('external app connected'); + }, () => { + console.log('The registration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); + // removeEventListener + const previousCallback = () => { }; + externalApp.removeEventListener('connected', previousCallback, () => { + console.log('The unregistration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); + + // getInfo + externalApp.getInfo(info => { + console.log(info.parent.uuid, info.parent.name); + }, err => console.log(err)); +} + +function test_inter_application_bus() { + // addSubscribeListener + fin.desktop.InterApplicationBus.addSubscribeListener((uuid, topic, name) => { + console.log(`The application ${uuid} has subscribed to ${topic}`); + }); + // addUnsubscribeListener + fin.desktop.InterApplicationBus.addUnsubscribeListener((uuid, topic, name) => { + console.log(`The application ${uuid} has unsubscribed to ${topic}`); + }); + // removeSubscribeListener + const aRegisteredListener = (uuid: string, topic: string, name: string) => { }; + fin.desktop.InterApplicationBus.removeSubscribeListener(aRegisteredListener); + // removeUnsubscribeListener + fin.desktop.InterApplicationBus.removeUnsubscribeListener(aRegisteredListener); + // publish + fin.desktop.InterApplicationBus.publish("a topic", { + field1: "value1", + field2: "value2" + }); + // send + fin.desktop.InterApplicationBus.send("an application's uuid", "a topic", { + field1: "value1", + field2: "value2" + }); + // subscribe + fin.desktop.InterApplicationBus.subscribe("*", "a topic", (message, uuid, name) => { + console.log(`The application ${uuid} sent this message: ${message}`); + }); + // unsubscribe + const aRegisteredMessageListener = (message: any, senderUuid: string) => { + console.log(message, senderUuid); + }; + fin.desktop.InterApplicationBus.unsubscribe("*", "a topic", aRegisteredMessageListener); +} + +function test_notification() { + let notification: fin.OpenFinNotification; + // getCurrent + notification = fin.desktop.Notification.getCurrent(); + // close + notification.close(); + // sendMessage + notification = new fin.desktop.Notification({ + duration: 10, + url: "http://localhost:5000/Account/Register", + message: "Hello", + onShow: () => { }, + // onClose: () => { }, + onDismiss: () => { }, + // onClick: () => { }, + onMessage: () => { }, + onError: () => { } + }); + // sendMessageToApplication + notification.sendMessageToApplication("some message"); +} + +function test_system() { + // addEventListener + fin.desktop.System.addEventListener('monitor-info-changed', event => { + console.log("The monitor information has changed to: ", event); + }, () => { + console.log("The registration was successful"); + }, err => { + console.log("failure: " + err); + }); + // clearCache + fin.desktop.System.clearCache({ + cache: true, + cookies: true, + localStorage: true, + appcache: true, + userData: true + }); + // deleteCacheOnExit + fin.desktop.System.deleteCacheOnExit(() => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // downloadAsset + const dirAppAsset = { + src: 'http://local:8000/dir.zip', + alias: 'dirApp', + version: '1.23.24', + target: 'dir.bat', + args: '' + }; + fin.desktop.System.downloadAsset(dirAppAsset, progress => { + const downloadedPercent = Math.floor((progress.downloadedBytes / progress.totalBytes) * 100); + console.log(`Downloaded ${downloadedPercent}%`); + }, p => { + console.log(`Downlod complete, can be found on ${p.path}`); + // lets launch our application asset. + // launchDirApp(); + }, (reason, err) => { + console.log(reason, err); + }); + // downloadRuntime + fin.desktop.System.downloadRuntime({ version: '9.61.31.56' }, progress => { + console.log(progress.downloadedBytes, progress.downloadedBytes); + }, () => console.log('download complete'), err => console.error(err)); + // downloadPreloadScript + const preloadScripts = [ + { url: 'http://whatever.com/script.js' } + ]; + fin.desktop.System.downloadPreloadScripts(preloadScripts, info => { + const downloadInfo = info[0]; + console.log(downloadInfo.success, downloadInfo.url, downloadInfo.error); + }, err => { + console.log(err); + }); + // exit + fin.desktop.System.exit(() => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + //flushCookieStore + fin.desktop.System.flushCookieStore(() => { + console.log('successful'); + }, err => { + console.log('failure', err); + }); + // getAllApplications + fin.desktop.System.getAllApplications(applicationInfoList => { + applicationInfoList.forEach(applicationInfo => { + console.log("Showing information for application with uuid: " + + applicationInfo.uuid); + console.log("isRunning: ", applicationInfo.isRunning); + }); + }); + // getAllExternalApplications + fin.desktop.System.getAllExternalApplications(externalAppsInfoList => { + externalAppsInfoList.forEach(appInfo => { + console.log(`External app connected to the runtime with UUID ${appInfo.uuid}`); + }); + }); + // getAllWindows + fin.desktop.System.getAllWindows(windowInfoList => { + windowInfoList.forEach(windowInfo => { + console.log("Showing information for application with uuid: ", windowInfo.uuid); + console.log("Main window: ", windowInfo.mainWindow); + console.log("Child windows: ", windowInfo.childWindows); + }); + }); + // getAppAssetInfo + fin.desktop.System.getAppAssetInfo({ alias: 'myAppAsset' }, info => { + console.log(info.alias, info.args, info.mandatory, info.src, info.target, info.version); + }, err => console.log(err)); + // getCommandLineArguments + fin.desktop.System.getCommandLineArguments(args => { + console.log("The command line arguments are " + args); + }); + //getCookieInfo + fin.desktop.System.getCookies({ name: 'myCookie1'}, cookies => { + const cookie1 = cookies[0]; + console.log(cookie1.name, cookie1.domain, cookie1.path); + }, err => console.log(err)); + // getDeviceId + fin.desktop.System.getDeviceId(id => { + console.log("The id of the device is: " + id); + }); + // getDeviceUserId + fin.desktop.System.getDeviceUserId(id => console.log(id), err => console.error(err)); + // getEntityInfo + fin.desktop.System.getEntityInfo('uuid', 'name', info => { + console.log(info.entityType, info.name, info.uuid, info.parent.name, info.parent.uuid); + }, err => console.log(err)); + // getEnvironmentVariable + fin.desktop.System.getEnvironmentVariable("APPDATA", variable => { + console.log("this is the APPDATA value", variable); + }); + // getFocusedWindow + fin.desktop.System.getFocusedWindow(win => { + console.log(win.uuid, win.name); + }, err => console.log(err)); + // getHostSpecs + fin.desktop.System.getHostSpecs(info => { + console.log(info); + }, error => { + console.log('There was an error:', error); + }); + // getLog + fin.desktop.System.getLog('debug-2015-01-08-22-27-53.log', log => { + console.log(log); + }); + // getLogList + fin.desktop.System.getLogList(logList => { + logList.forEach(logInfo => { + console.log(`The filename of the log is ${logInfo.name}, the size is ${logInfo.size}, and the date of creation is ${logInfo.date}`); + }); + }); + //getMinLogLevel + fin.desktop.System.getMinLogLevel(level => console.log(level), err => console.log(err)); + // getMonitorInfo + fin.desktop.System.getMonitorInfo(monitorInfo => { + console.log("This object contains information about all monitors: ", monitorInfo); + }); + // getMousePosition + fin.desktop.System.getMousePosition(mousePosition => { + console.log(`The mouse is located at left: ${mousePosition.left}, top: ${mousePosition.top}`); + }); + // getProcessList + fin.desktop.System.getProcessList(list => { + list.forEach(process => { + console.log(`UUID: ${process.uuid}, Application Name: ${process.name}`); + }); + }); + // getProxySettings + fin.desktop.System.getProxySettings(proxy => { + console.log(proxy); + }); + // getRvmInfo + fin.desktop.System.getRvmInfo(rvmInfoObject => { + console.log("RVM version:", rvmInfoObject.version); + console.log("RVM has been running since:", rvmInfoObject["start-time"]); + }, err => { + console.log("Failed to get rvm info, error message:", err); + }); + // getVersion + fin.desktop.System.getVersion(version => { + console.log("The version is " + version); + }); + // launchExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + // Additionally note that the executable found in the zip file specified in appAssets + // will default to the one mentioned by appAssets.target + // If the the path below refers to a specific path it will override this default + alias: "myApp", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + alias: "myApp", + arguments: "e f g", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + path: "C:\Users\ExampleUser\AppData\Local\OpenFin\OpenFinRVM.exe", + arguments: "--version", + certificate: { + trusted: true, + subject: 'O=OpenFin INC., L=New York, S=NY, C=US', + thumbprint: '3c a5 28 19 83 05 fe 69 88 e6 8f 4b 3a af c5 c5 1b 07 80 5b' + }, + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // log + fin.desktop.System.log("info", "An example log message", () => { + console.log("message successfully logged"); + }, err => { + console.log(err); + }); + // monitorExternalProcess + fin.desktop.System.monitorExternalProcess({ + pid: 2508, + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log("The process is now being monitored: ", payload.uuid); + }, error => { + console.log("Error:", error); + }); + // openUrlWithBrowser + fin.desktop.System.openUrlWithBrowser("https://developer.openf.in/", () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // readRegistryValue + fin.desktop.System.readRegistryValue('HKEY_SOMETHING', 'HARDWARE\\SOMETHING', 'BootSomething', info => { + console.log(info.data, info.rootKey, info.subkey, info.type, info.value); + }, err => console.log(err)); + // registerExternalConnection + fin.desktop.System.registerExternalConnection("remote-connection-uuid", (...args: any[]) => { + console.log(args); + }); + // releaseExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener(result) { + console.log("The exit code", result.exitCode); + } + }, result => { + console.log("Result UUID is " + result.uuid); + + // release it. + fin.desktop.System.releaseExternalProcess(result.uuid, () => { + console.log("Process has been unmapped!"); + }, reason => { + console.log("failure: " + reason); + }); + }); + // removeEventListener + const aRegisteredListener = (event: fin.SystemBaseEvent) => { }; + fin.desktop.System.removeEventListener("monitor-info-changed", aRegisteredListener, () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + //setMinLogLevel + fin.desktop.System.setMinLogLevel("log level", () => console.log('Success'), err => console.error(err)); + // showDeveloperTools + fin.desktop.System.showDeveloperTools("uuid", "name", () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // terminateExternalProcess + fin.desktop.System.launchExternalProcess({ + // notepad is in the system's PATH + path: "notepad", + arguments: "", + listener(result) { + console.log("The exit code", result.exitCode); + } + }, result => { + console.log("Result UUID is " + result.uuid); + + // Attempt to close the process. Terminate after 4 seconds if it + // has not done so. + fin.desktop.System.terminateExternalProcess(result.uuid, 4000, info => { + console.log("Termination result " + info.result); + }, reason => { + console.log("failure: " + reason); + }); + }); + // updateProxySettings + fin.desktop.System.updateProxySettings("type", "proxyAddress", 8080, () => { + console.log('success'); + }, err => { + console.log(err); + }); +} + +function test_system_clipboard() { + // availableFormats + fin.desktop.System.Clipboard.availableFormats(null, formats => { + formats.forEach(format => console.log(`The format ${format} is available to read`)); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readHtml + fin.desktop.System.Clipboard.readHtml(null, html => { + console.log(`This is the html from the clipboard: ${html}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readRtf + fin.desktop.System.Clipboard.readRtf(null, rtf => { + console.log(`This is the rtf from the clipboard: ${rtf}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readText + fin.desktop.System.Clipboard.readText(null, text => { + console.log(`This is the text from the clipboard: ${text}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // write + fin.desktop.System.Clipboard.write({ + text: 'Hello Text!', + html: '

    Hello Html

    ', + rtf: 'Hello Rtf' + }, null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeHtml + fin.desktop.System.Clipboard.writeHtml('

    Hello World

    ', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeRtf + fin.desktop.System.Clipboard.writeRtf('Hello World!', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeText + fin.desktop.System.Clipboard.writeText('Hello World', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); +} + +function test_window() { + let finWindow: fin.OpenFinWindow; + // constructor + finWindow = new fin.desktop.Window({ + name: "childWindow", + url: "child.html", + defaultWidth: 320, + defaultHeight: 320, + defaultTop: 10, + defaultLeft: 300, + frame: false, + resizable: false, + state: "normal" + }, () => { + const _win = finWindow.getNativeWindow(); + _win.addEventListener("DOMContentLoaded", () => { finWindow.show(); }); + }, error => { + console.log("Error creating window:", error); + }); + // getCurrent + finWindow = fin.desktop.Window.getCurrent(); + // getNativeWindow + let nativeWindow: Window; + nativeWindow = finWindow.getNativeWindow(); + // getParentApplication + let parentApp: fin.OpenFinApplication; + parentApp = finWindow.getParentApplication(); + // getParentWindow + let parentFinWindow: fin.OpenFinWindow; + parentFinWindow = finWindow.getParentWindow(); + // wrap + finWindow = fin.desktop.Window.wrap("uuid", "name"); + // addEventListener + finWindow.addEventListener("bounds-changed", event => { + console.log("The window has been moved or resized"); + }, () => { + console.log("The registration was successful"); + }, reason => { + console.log("failure:" + reason); + }); + // animate + finWindow.animate({ + opacity: { + opacity: 0.15, + duration: 1000 + }, + position: { + left: 10, + top: 10, + duration: 3000 + } + }, { + interrupt: false + }, evt => { + // Callback will only fire after both "opacity" and "position" have finished animating. + }); + // authenticate + finWindow.addEventListener('auth-requested', evt => { + finWindow.authenticate('userName', 'P@assw0rd', () => { }, (reason, err) => { + console.log("failure:", err); + }); + }); + // blur + finWindow.blur(); + // bringToFront + finWindow.bringToFront(); + // close + finWindow.close(); + // disableFrame + finWindow.disableFrame(); + // enableFrame + finWindow.enableFrame(); + // flash + finWindow.flash(); + // focus + finWindow.focus(); + // getBounds + finWindow.getBounds(bounds => { + console.log(`top: ${bounds.top} left: ${bounds.left} height: ${bounds.height} width: ${bounds.width}`); + }); + // getOptions + finWindow.getOptions(options => { + console.log(options); + }); + // getSnapshot + finWindow.getSnapshot(base64Snapshot => { + console.log("data:image/png;base64," + base64Snapshot); + }); + // getState + finWindow.getState(state => { + console.log("state: " + state); + }); + // getZoomLevel + finWindow.getZoomLevel(level => { + console.log("zoom level: " + level); + }, error => { + console.log('error:', error); + }); + // hide + finWindow.hide(); + // isShowing + finWindow.isShowing(showing => { + console.log("the window is " + (showing ? "showing" : "hidden")); + }); + // joinGroup + let secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, () => { + // When mainWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow); + }); + // leaveGroup + secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, () => { + // When finWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow, () => { + // once we are in the group, lets leave it. + secondWindow.leaveGroup(); + }); + }); + // maximize + finWindow.maximize(); + // mergeGroups + { + const finWindowOne = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowOne", + autoShow: true + }); + const finWindowTwo = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowTwo", + autoShow: true + }); + const finWindowThree = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowThree", + autoShow: true + }); + const finWindowFour = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowFour", + autoShow: true + }); + // When finWindowOne moves or is moved, finWindowTwo moves by the same amount + finWindowOne.joinGroup(finWindowTwo); + // When finWindowThree moves or is moved, finWindowFour moves by the same amount + finWindowThree.joinGroup(finWindowFour); + // finWindowOne, finWindowTwo, finWindowThree, and finWindowFour now move together in the same group + finWindowOne.mergeGroups(finWindowThree); + } + // minimize + finWindow.minimize(); + // moveBy + finWindow.moveBy(10, 10); + // moveTo + finWindow.moveTo(100, 200); + // removeEventListener + const aRegisteredListener = (event: fin.WindowBaseEvent) => { }; + finWindow.removeEventListener("bounds-changed", aRegisteredListener); + // resizeBy + finWindow.resizeBy(10, 10, "top-right"); + // resizeTo + finWindow.resizeTo(10, 10, "top-right"); + // restore + finWindow.restore(); + // setAsForeground + finWindow.setAsForeground(); + // setBounds + finWindow.setBounds(100, 200, 400, 400); + // setZoomLevel + finWindow.setZoomLevel(10); + // show + finWindow.show(); + // showAt + finWindow.showAt(10, 10, false); + // stopFlashing + finWindow.stopFlashing(); + // updateOptions + finWindow.updateOptions({ + frame: false, + maxWidth: 500 + }); +} + +function test_frame() { + //wrap + const frame = fin.desktop.Frame.wrap('uuid', 'name'); + //getCurrent + const currentFrame = fin.desktop.Frame.getCurrent(); + // addEventlistener + frame.addEventListener('event', () => console.log('on event'), () => console.log('success'), err => console.error(err)); + //removeEventListener + frame.removeEventListener('event', () => console.log('on event'), () => console.log('success'), err => console.error(err)); + // getInfo + frame.getInfo(info => { + console.log(info.uuid, info.name, info.entityType, info.parent.uuid, info.parent.name); + }, err => console.error(err)); + // getParentWindow + frame.getParentWindow(parent => { + console.log(parent.uuid, parent.name, parent.entityType, parent.parent.uuid, parent.parent.name); + }, err => console.error(err)); +} diff --git a/types/openfin/v30/tsconfig.json b/types/openfin/v29/tsconfig.json similarity index 83% rename from types/openfin/v30/tsconfig.json rename to types/openfin/v29/tsconfig.json index fd3199ceb7..a590982714 100644 --- a/types/openfin/v30/tsconfig.json +++ b/types/openfin/v29/tsconfig.json @@ -14,6 +14,11 @@ "../" ], "types": [], + "paths": { + "openfin": [ + "openfin/v29" + ] + }, "noEmit": true, "forceConsistentCasingInFileNames": true }, @@ -21,4 +26,4 @@ "index.d.ts", "openfin-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/openfin/v30/tslint.json b/types/openfin/v29/tslint.json similarity index 100% rename from types/openfin/v30/tslint.json rename to types/openfin/v29/tslint.json diff --git a/types/openfin/v30/index.d.ts b/types/openfin/v30/index.d.ts deleted file mode 100644 index 1e69b3b713..0000000000 --- a/types/openfin/v30/index.d.ts +++ /dev/null @@ -1,1756 +0,0 @@ -// Type definitions for OpenFin API 17.0 -// Project: https://openfin.co/ -// Definitions by: Chris Barker -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// based on v6.49.17.14 -// see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean - -/** - * JavaScript API - * The JavaScript API allows you to create an HTML/JavaScript application that has access to the native windowing environment, - * can communicate with other applications and has access to sandboxed system-level features. - * - * API Ready - * When using the OpenFin API, it is important to ensure that it has been fully loaded before making any API calls. To verify - * that the API is in fact ready, be sure to make any API calls either from within the fin.desktop.main() method or explicitly - * after it has returned. This avoids the situation of trying to access methods that are not yet fully injected. - * - * Overview - * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API - * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "document" objects. - */ -declare namespace fin { - const desktop: OpenFinDesktop; - - interface OpenFinDesktop { - main(f: () => any): void; - Application: OpenFinApplicationStatic; - ExternalApp: OpenFinExternalApplicationStatic; - InterApplicationBus: OpenFinInterApplicationBus; - Notification: OpenFinNotificationStatic; - System: OpenFinSystem; - Window: OpenFinWindowStatic; - } - - interface OpenFinApplicationStatic { - /** - * Creates a new Application. - * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. - */ - new ( - options: ApplicationOptions, - callback?: (successObj: { httpResponseCode: number }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; - /** - * Launches the given Application manifest. - */ - createFromManifest(manifestUrl: string, callback?: (app: OpenFinApplication) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Returns an Application object that represents an existing application. - */ - getCurrent(): OpenFinApplication; - /** - * Returns an Application object that represents an existing application. - */ - wrap(uuid: string): OpenFinApplication; - } - - /** - * Application - * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. - */ - interface OpenFinApplication { - /** - * Returns an instance of the main Window of the application - */ - getWindow(): OpenFinWindow; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinApplicationEventType, - listener: (event: ApplicationBaseEvent - | TrayIconClickedEvent - | WindowEvent - | WindowAlertRequestedEvent - | WindowAuthRequested - | WindowNavigationRejectedEvent - | WindowEndLoadEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Closes the application and any child windows created by the application. - */ - close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. - */ - getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. - */ - getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. - */ - getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. - */ - getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves current configuration of application's shortcuts. - */ - getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves information about the application. - */ - getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves information about the system tray. - */ - getTrayIconInfo(callback?: (trayInfo: TrayIconInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Determines if the application is currently running. - */ - isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; - /** - * Registers a username and an app name for licensing purposes. - */ - registerUser(userName: string, appName: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinApplicationEventType, - previouslyRegisteredListener: (event: ApplicationBaseEvent - | TrayIconClickedEvent - | WindowEvent - | WindowAlertRequestedEvent - | WindowAuthRequested - | WindowNavigationRejectedEvent - | WindowEndLoadEvent) => any, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Removes the application's icon from the tray. - */ - removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Restarts the application. - */ - restart(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Runs the application. When the application is created, run must be called. - */ - run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * Tells the rvm to relaunch the main application once upon a complete shutdown - */ - scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets new shortcut configuration for current application. - * Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to - * be able to change shortcut states. - */ - setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Adds a customizable icon in the system tray and notifies the application when clicked. - */ - setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Closes the application by terminating its process. - */ - terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application - * to continue and to generate another "not-responding" message after a certain period of time. - */ - wait(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * The Application's uuid - */ - uuid: string; - } - - interface ShortCutConfig { - /** - * application has a shortcut on the desktop - */ - desktop?: boolean; - /** - * application has no shortcut in the start menu - */ - startMenu?: boolean; - /** - * application will be launched on system startup - */ - systemStartup?: boolean; - } - - interface SuccessObj { - httpResponseCode: number; - } - - interface NetworkErrorInfo extends ErrorInfo { - networkErrorCode: number; - } - - interface ErrorInfo { - stack: string; - message: string; - } - - interface ApplicationOptions { - /** - * The name of the application. - */ - name?: string; - /** - * The url to the application. - */ - url?: string; - /** - * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. - */ - uuid?: string; - /** - * Enable Flash at the application level. Default: false. - */ - plugins?: boolean; - /** - * The options of the main window of the application. - */ - mainWindowOptions?: WindowOptions; - } - - interface WindowOptions { - /** - * Enable keyboard shortcuts for devtools and zoom. Default: false for both. - */ - accelerator?: { - devtools?: boolean, - zoom?: boolean, - reload?: boolean, - reloadIgnoreCache?: boolean, - }; - /** - * A flag to always position the window at the top of the window stack. Default: false. - * Updatable - */ - alwaysOnTop?: boolean; - /** - * A flag to automatically show the Window when it is created. Default: false. - */ - autoShow?: boolean; - /** - * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true - * Updatable - */ - contextMenu?: boolean; - /** - * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. - * Updatable - */ - cornerRounding?: { - width?: number; - height?: number; - }; - /** - * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. - */ - customData?: any; - /** - * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the position from before the window was closed is used. - * This option overrides defaultLeft and defaultTop. Default: false. - */ - defaultCentered?: boolean; - /** - * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. - */ - defaultHeight?: number; - /** - * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. - */ - defaultWidth?: number; - /** - * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. - */ - defaultTop?: number; - /** - * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. - */ - defaultLeft?: number; - /** - * A flag to show the frame. Default: true. - * Updatable - */ - frame?: boolean; - /** - * A flag to allow a window to be hidden when the close button is clicked.Default: false. - * Updatable - */ - hideOnClose?: boolean; - /** - * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. - * Updatable - */ - icon?: string; - /** - * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. - * Updatable - */ - maxHeight?: number; - /** - * A flag that lets the window be maximized.Default: true. - * Updatable - */ - maximizable?: boolean; - /** - * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. - * Updatable - */ - maxWidth?: number; - /** - * The minimum height of a window.Default: 0. - * Updatable - */ - minHeight?: number; - /** - * A flag that lets the window be minimized.Default: true. - */ - minimizable?: boolean; - /** - * The minimum width of a window.Default: 0. - */ - minWidth?: number; - /** - * The name for the window which must be unique within the context of the invoking Application. - */ - name?: string; - /** - * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. - * Updatable - */ - opacity?: number; - /** - * A flag to drop to allow the user to resize the window.Default: true. - * Updatable - */ - resizable?: boolean; - /** - * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. - * Updatable - */ - resizeRegion?: { - /** - * The size in pixels (Default: 2), - */ - size?: number; - /** - * The size in pixels of an additional - * square resizable region located at the - * bottom right corner of a - * frameless window. (Default: 4) - */ - bottomRightCorner?: number; - }; - /** - * A flag to show the Window's icon in the taskbar. Default: true. - */ - showTaskbarIcon?: boolean; - /** - * A flag to cache the location of the window or not. Default: true. - */ - saveWindowState?: boolean; - /** - * Specify a taskbar group for the window. Default: app's uuid. - */ - taskbarIconGroup?: string; - /** - * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". - */ - state?: string; - /** - * The URL of the window. Default: "about:blank". - */ - url?: string; - /** - * When set to false, the window will render before the "load" event is fired on the content's window. - * Caution, when false you will see an initial empty white window. Default: true. - */ - waitForPageLoad?: boolean; - } - - /** - * Clipboard - * Clipboard API allows reading and writting to the clipboard in multiple formats. - */ - interface OpenFinClipboard { - /** - * Reads available formats for the clipboard type - */ - availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Reads available formats for the clipboard type - */ - readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Read the content of the clipboard as Rtf - */ - readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Read the content of the clipboard as plain text - */ - readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard - */ - write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as Html - */ - writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as Rtf - */ - writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as plain text - */ - writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - } - - interface OpenFinExternalApplicationStatic { - /** - * Returns an External Application object that represents an existing external application. - */ - wrap(uuid: string): OpenFinExternalApplication; - } - /** - * ExternalApplication - * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. - */ - interface OpenFinExternalApplication { - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinExternalApplicationEventType, - listener: () => void, - callback?: () => void, - errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinExternalApplicationEventType, - listener: () => void, - callback?: () => void, - errorCallback?: (reason: string, error: ErrorInfo) => void): void; - } - - /** - * InterApplicationBus - * A messaging bus that allows for pub/sub messaging between different applications. - */ - interface OpenFinInterApplicationBus { - /** - * Adds a listener that gets called when applications subscribe to the current application's messages. - */ - addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Adds a listener that gets called when applications unsubscribe to the current application's messages. - */ - addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Removes a previously registered subscribe listener. - */ - removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Removes a previously registered unsubscribe listener. - */ - removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. - */ - publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sends a message to a specific application on a specific topic. - */ - send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], - * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. - */ - subscribe( - senderUuid: string, - name: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - subscribe( - senderUuid: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Unsubscribes to messages from the specified application on the specified topic. - */ - unsubscribe( - senderUuid: string, - name: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - unsubscribe( - senderUuid: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - } - - interface OpenFinNotificationStatic { - /** - * ctor - */ - new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; - /** - * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. - */ - getCurrent(): OpenFinNotification; - } - - /** - * Notification - * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. - * A notification is typically used to alert the user of some important event which requires his or her attention. - * Notifications are a child or your application that are controlled by the runtime. - */ - interface OpenFinNotification { - /** - * Closes the notification. - */ - close(callback?: () => void): void; - /** - * Sends a message to the notification. - */ - sendMessage(message: any, callback?: () => void): void; - /** - * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. - */ - sendMessageToApplication(message: any, callback?: () => void): void; - } - - interface NotificationOptions { - /** - * A boolean that will force dismissal even if the mouse is hovering over the notification - */ - ignoreMouseOver?: boolean; - /** - * A message of any primitive or composite-primitive type to be passed to the notification upon creation. - */ - message?: any; - /** - * The timeout for displaying a notification.Can be in milliseconds or "never". - */ - duration?: number | "never"; - /** - * The url of the notification - */ - url?: string; - /** - * A function that is called when a notification is clicked. - */ - onClick?(callback: () => void): void; - /** - * Invoked when the notification is closed via .close() method on the created notification instance - * or the by the notification itself via fin.desktop.Notification.getCurrent().close(). - * NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss - */ - onClose?(callback: () => void): void; - /** - * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. - */ - onDismiss?(callback: () => void): void; - /** - * A function that is called when an error occurs.The reason for the error is passed as an argument. - */ - onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * The onMessage function will respond to messages sent from notification.sendMessageToApplication. - * The function is passed the message, which can be of any primitive or composite-primitive type. - */ - onMessage?(callback: (message: any) => void): void; - /** - * A function that is called when a notification is shown. - */ - onShow?(callback: (successObj: SuccessObj) => void): void; - } - - /** - * System - * An object representing the core of OpenFin Runtime. - * Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. - */ - interface OpenFinSystem { - Clipboard: OpenFinClipboard; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinSystemEventType, - listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Clears cached data containing window state/positions, - * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. - */ - clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Clears all cached data when OpenFin Runtime exits. - */ - deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Downloads the given application asset - */ - downloadAsset( - assetObj: AppAssetInfo, - progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, - callback?: (successObj: { path: string }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * Exits the Runtime. - */ - exit(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data for all applications. - */ - getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data for all external applications. - */ - getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data (name, ids, bounds) for all application windows. - */ - getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the command line argument string that started OpenFin Runtime. - */ - getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the configuration object that started the OpenFin Runtime. - */ - getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the value of a given environment variable on the computer on which the runtime is installed. - */ - getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves system information. - */ - getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the contents of the log with the specified filename. - */ - getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array containing information for each log file. - */ - getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. - */ - getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the mouse in virtual screen coordinates (left, top). - */ - getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of all of the runtime processes that are currently running. - * Each element in the array is an object containing the uuid and the name of the application to which the process belongs. - */ - getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the Proxy settings. - */ - getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns information about the running RVM in an object. - */ - getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. - */ - getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Runs an executable or batch file. - */ - launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; - /** - * Writes the passed message into both the log file and the console. - */ - log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Monitors a running process. - */ - monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; - /** - * Opens the passed URL in the default web browser. - */ - openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * This function call will register a unique id and produce a token. The token can be used to broker an external connection. - */ - registerExternalConnection( - uuid: string, - callback?: (detail: { - /** - * this will be unique each time - */ - token: string; - /** - * "remote-connection-uuid" - */ - uuid: string; - }) => void, - errorCallback?: (reason: string) => void): void; - /** - * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). - */ - releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinSystemEventType, - listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the Chrome Developer Tools for the specified window. - */ - showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. - */ - terminateExternalProcess( - processUuid: string, - timeout: number, - killTree: boolean, - callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, - errorCallback?: (reason: string) => void): void; - terminateExternalProcess( - processUuid: string, - timeout: number, - callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, - errorCallback?: (reason: string) => void): void; - /** - * Update the OpenFin Runtime Proxy settings. - */ - updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface CacheOptions { - cache?: boolean; - cookies?: boolean; - localStorage?: boolean; - appcache?: boolean; - userData?: boolean; - } - - interface AppAssetInfo { - src?: string; - alias?: string; - version?: string; - target?: string; - args?: string; - } - - interface ApplicationInfo { - /** - * true when the application is running. - */ - isRunning?: boolean; - /** - * uuid of the application. - */ - uuid?: string; - /** - * uuid of the application that launches this application. - */ - parentUuid?: string; - } - - interface WindowDetails { - uuid?: string; - mainWindow?: WindowInfo; - childWindows?: WindowInfo[]; - } - - interface WindowInfo { - /** - * name of the child window - */ - name?: string; - /** - * top-most coordinate of the child window - */ - top?: number; - /** - * right-most coordinate of the child window - */ - right?: number; - /** - * bottom-most coordinate of the child window - */ - bottom?: number; - /** - * left-most coordinate of the child window - */ - left?: number; - } - - interface HostSpecInfo { - /** - * "x86" for 32-bit or "x86_64" for 64-bit - */ - arch: string; - /** - * Same payload as Node's os.cpus() - */ - cpus: NodeCpuInfo[]; - gpu: { - /** - * Graphics card name - */ - name: string; - }; - /** - * Same payload as Node's os.totalmem() - */ - memory: number; - /** - * OS name and version/edition - */ - name: string; - } - - interface NodeCpuInfo { - model: string; - /** - * in MHz - */ - speed: number; - times: { - /** - * The number of milliseconds the CPU has spent in user mode. - */ - user: number; - /** - * The number of milliseconds the CPU has spent in nice mode. - */ - nice: number; - /** - * The number of milliseconds the CPU has spent in sys mode. - */ - sys: number; - /** - * The number of milliseconds the CPU has spent in idle mode. - */ - idle: number; - /** - * The number of milliseconds the CPU has spent in irq mode. - */ - irq: number; - }; - } - - interface LogInfo { - /** - * the filename of the log - */ - name?: string; - /** - * the size of the log in bytes - */ - size?: number; - /** - * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" - */ - date?: string; - } - - interface ProcessInfo { - /** - * the percentage of total CPU usage - */ - cpuUsage?: number; - /** - * the application name - */ - name?: string; - /** - * the current nonpaged pool usage in bytes - */ - nonPagedPoolUsage?: number; - /** - * the number of page faults - */ - pageFaultCount?: number; - /** - * the current paged pool usage in bytes - */ - pagedPoolUsage?: number; - /** - * the total amount of memory in bytes that the memory manager has committed - */ - pagefileUsage?: number; - /** - * the peak nonpaged pool usage in bytes - */ - peakNonPagedPoolUsage?: number; - /** - * the peak paged pool usage in bytes - */ - peakPagedPoolUsage?: number; - /** - * the peak value in bytes of pagefileUsage during the lifetime of this process - */ - peakPagefileUsage?: number; - /** - * the peak working set size in bytes - */ - peakWorkingSetSize?: number; - /** - * the native process identifier - */ - processId?: number; - /** - * the application UUID - */ - uuid?: string; - /** - * the current working set size (both shared and private data) in bytes - */ - workingSetSize?: number; - } - - interface ProxyInfo { - /** - * the configured Proxy Address - */ - proxyAddress?: string; - /** - * the configured Proxy port - */ - proxyPort?: number; - /** - * Proxy Type - */ - type?: string; - } - - interface RvmInfo { - version?: string; - "start-time"?: string; - } - - interface ExternalProcessLaunchInfo { - path?: string; - /** - * Additionally note that the executable found in the zip file specified in appAssets - * will default to the one mentioned by appAssets.target - * If the the path below refers to a specific path it will override this default - */ - alias?: string; - /** - * When using alias; if no arguments are passed then the arguments (if any) - * are taken from the 'app.json' file, from the 'args' parameter - * of the 'appAssets' Object with the relevant 'alias'. - * If 'arguments' is passed as a parameter it takes precedence - * over any 'args' set in the 'app.json'. - */ - arguments?: string; - listener?(result: { - /** - * "Exited" Or "released" on a call to releaseExternalProcess - */ - topic?: string; - /** - * The mapped UUID which identifies the launched process - */ - uuid?: string; - /* - * Process exit code - */ - exitCode?: number; - }): void; - certificate?: CertificationInfo; - } - - interface CertificationInfo { - /** - * A hex string with or without spaces - */ - serial?: string; - /** - * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields - */ - subject?: string; - /** - * A hex string with or without spaces - */ - publickey?: string; - /** - * A hex string with or without spaces - */ - thumbprint?: string; - /** - * A boolean indicating that the certificate is trusted and not revoked - */ - trusted?: boolean; - } - - interface ExternalProcessInfo { - pid?: number; - listener?(result: { - /** - * "Exited" Or "released" on a call to releaseExternalProcess - */ - topic?: string; - /** - * The mapped UUID which identifies the launched process - */ - uuid?: string; - /* - * Process exit code - */ - exitCode?: number; - }): void; - } - - interface OpenFinWindowStatic { - /** - * Class: Window - * - * new Window(options, callbackopt, errorCallbackopt) - * - * Creates a new OpenFin Window - * - * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, - * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. - * The new window appears in the same process as the parent window. - * @param options - The options of the window - * @param [callback] - Called if the window creation was successful - * @param [callback.successObj] - httpResponseCode - */ - new ( - options: WindowOptions, - callback?: (successObj: { httpResponseCode: number }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; - /** - * Returns an instance of the current window. - * @returns Current window - */ - getCurrent(): OpenFinWindow; - /** - * Returns a Window object that wraps an existing window. - */ - wrap(appUuid: string, windowName: string): OpenFinWindow; - } - - /** - * Window - * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, - * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. - * The new window appears in the same process as the parent window. - */ - interface OpenFinWindow { - /** - * Name of window - */ - name: string; - /** - * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, - * otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the - * contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. - * Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). - * @returns Native window - */ - getNativeWindow(): Window; - /** - * Gets the parent application. - * @returns Parent application - */ - getParentApplication(): OpenFinApplication; - /** - * Gets the parent window. - */ - getParentWindow(): OpenFinWindow; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinWindowEventType, - listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Performs the specified window transitions - */ - animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; - /** - * Provides credentials to authentication requests - */ - authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Removes focus from the window. - */ - blur(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Brings the window to the front of the OpenFin window stack. - */ - bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Closes the window. - * @param Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. - */ - close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Prevents a user from changing a window's size/position when using the window's frame. - * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. - * 'disabled-frame-bounds-changed' is generated after a user move/size operation. - * The events provide the bounds that would have been applied if the frame was enabled. - * 'frame-disabled' is generated when an enabled frame becomes disabled. - */ - disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Re-enables user changes to a window's size/position when using the window's frame. - * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. - * 'disabled-frame-bounds-changed' is generated after a user move/size operation. - * The events provide the bounds that would have been applied if the frame was enabled. - * 'frame-enabled' is generated when a disabled frame has becomes enabled. - */ - enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Flashes the window's frame and taskbar icon until the window is activated. - */ - flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Gives focus to the window. - */ - focus(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current bounds (top, left, width, height) of the window. - */ - getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. - * Please note that calling window is included in the result array. - */ - getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current settings of the window. - */ - getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets a base64 encoded PNG snapshot of the window. - */ - getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current state ("minimized", "maximized", or "restored") of the window. - */ - getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the zoom level of the window. - */ - getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; - /** - * Hides the window. - */ - hide(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Determines if the window is currently showing. - */ - isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; - /** - * Joins the same window group as the specified window. - */ - joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Leaves the current window group so that the window can be move independently of those in the group. - */ - leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Maximizes the window. - */ - maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Merges the instance's window group with the same window group as the specified window - */ - mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Minimizes the window. - */ - minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Moves the window by a specified amount. - */ - moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Moves the window to a specified location. - */ - moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinWindowEventType, - listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Resizes the window by a specified amount. - */ - resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Resizes the window by a specified amount. - */ - resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Restores the window to its normal state (i.e., unminimized, unmaximized). - */ - restore(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Will bring the window to the front of the entire stack and give it focus. - */ - setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets the window's size and position - */ - setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets the zoom level of the window. - */ - setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the window if it is hidden. - * @param Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. - */ - show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. - */ - showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Stops the taskbar icon from flashing. - */ - stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Updates the window using the passed options - */ - updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface ApplicationBaseEvent { - topic: string; - type: OpenFinApplicationEventType; - uuid: string; - } - - interface TrayIconClickedEvent extends ApplicationBaseEvent { - button: number; // 0 for left, 1 for middle, 2 for right - monitorInfo: MonitorInfo; - x: number; // the cursor x coordinate - y: number; // the cursor y coordinate - } - - interface WindowEvent extends ApplicationBaseEvent { - name: string; - } - - interface WindowAlertRequestedEvent extends WindowEvent { - message: string; - url: string; - } - - interface WindowAuthRequested extends WindowEvent { - authInfo: { - host: string; - isProxy: boolean; - port: number; - realm: string; - scheme: string; - }; - } - - interface WindowNavigationRejectedEvent extends WindowEvent { - sourceName: string; - url: string; - } - - interface WindowEndLoadEvent extends WindowEvent { - documentName: string; - isMain: boolean; - } - - interface MonitorInfoChangedEvent extends MonitorInfo { - topic: "system"; - type: "monitor-info-changed"; - } - - interface MonitorInfo { - nonPrimaryMonitors: MonitorInfoDetail[]; - primaryMonitor: MonitorInfoDetail; - reason: string; - taskbar: { - edge: "left" | "right" | "top" | "bottom", - rect: MontiorCoordinates - }; - topic: "system"; - type: "monitor-info-changed"; - virtualScreen: MontiorCoordinates; - } - - interface TrayIconInfo { - x: number; - y: number; - bounds: { - x: number; - y: number; - width: number; - height: number; - } - monitorInfo: MonitorInfo - } - - interface MonitorInfoDetail { - availableRect: MontiorCoordinates; - deviceId: string; - displayDeviceActive: boolean; - monitorRect: MontiorCoordinates; - name: string; - } - - interface MontiorCoordinates { - bottom: number; - left: number; - right: number; - top: number; - } - - interface VirtualScreenCoordinates { - left: number; - top: number; - } - - interface SystemBaseEvent { - topic: string; - type: OpenFinSystemEventType; - uuid: string; - } - - interface DesktopIconClickedEvent { - mouse: { - /** - * the left virtual screen coordinate of the mouse - */ - left: number, - /** - * the top virtual screen coordinate of the mouse - */ - top: number - }; - /** - * the number of milliseconds that have elapsed since the system was started, - */ - tickCount: number; - topic: "system"; - type: "desktop-icon-clicked"; - } - - interface IdleStateChangedEvent { - /** - * How long in milliseconds since the user has been idle. - */ - elapsedTime: number; - /** - * true when the user is idle,false when the user has returned; - */ - isIdle: boolean; - topic: "system"; - type: "idle-state-changed"; - } - - interface WindowBaseEvent { - /** - * the name of the window - */ - name: string; - /** - * always window - */ - topic: "window"; - /** - * window event type - */ - type: OpenFinWindowEventType; - /** - * the UUID of the application the window belongs to - */ - uuid: string; - } - - interface WindowAuthRequestedEvent extends WindowBaseEvent { - authInfo: { - host: string; - isProxy: boolean; - port: number; - realm: string; - scheme: string; - }; - } - - interface WindowBoundsEvent extends WindowBaseEvent { - /** - * describes what kind of change occurred. - * 0 means a change in position. - * 1 means a change in size. - * 2 means a change in position and size. - */ - changeType: number; - /** - * true when pending changes have been applied to the window. - */ - deferred: boolean; - /** - * the new height of the window. - */ - height: number; - /** - * the left-most coordinate of the window. - */ - left: number; - /** - * the top-most coordinate of the window. - */ - top: number; - - type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; - /** - * the new width of the window. - */ - width: number; - } - - interface WindowExternalProcessStartedEvent extends WindowBaseEvent { - /** - * the process handle uuid - */ - processUuid: string; - type: "external-process-started"; - } - - interface WindowExternalProcessExited extends WindowBaseEvent { - /** - * the process exit code - */ - exitCode: number; - /** - * the process handle uuid - */ - processUuid: string; - type: "external-process-exited"; - } - - interface WindowGroupChangedEvent extends WindowBaseEvent { - /** - * Which group array the window that the event listener was registered on is included in: - * 'source' The window is included in sourceGroup. - * 'target' The window is included in targetGroup. - * 'nothing' The window is not included in sourceGroup nor targetGroup. - */ - memberOf: "source" | "target" | "nothing"; - /** - * The reason this event was triggered. - * 'leave' A window has left the group due to a leave or merge with group. - * 'join' A window has joined the group. - * 'merge' Two groups have been merged together. - * 'disband' There are no other windows in the group. - */ - reason: "leave" | "join" | "merge" | "disband"; - /** - * All the windows in the group the sourceWindow originated from. - */ - sourceGroup: WindowOfGroupInfo[]; - /** - * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. - */ - sourceWindowAppUuid: string; - /** - * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. - */ - sourceWindowName: string; - /** - * All the windows in the group the targetWindow orginated from - */ - targetGroup: WindowOfGroupInfo[]; - /** - * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). - */ - targetWindowAppUuid: string; - /** - * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). - */ - targetWindowName: string; - type: "group-changed"; - } - - interface WindowOfGroupInfo { - /** - * The UUID of the application this window entry belongs to. - */ - appUuid: string; - /** - * The name of this window entry. - */ - windowName: string; - } - - interface WindowHiddenEvent extends WindowBaseEvent { - /** - * What action prompted the close. - * The reasons are: "hide", "hide-on-close" - */ - reason: "hide" | "hide-on-close"; - type: "hidden"; - } - - interface Window_NavigationRejectedEvent { - name: string; - /** - * source of navigation window name - */ - sourceName: string; - topic: "navigation-rejected"; - /** - * Url that was not reached "http://blocked-content.url" - */ - url: string; - /** - * the UUID of the application the window belongs to. - */ - uuid: string; - } - - interface AnimationTransition { - opacity?: { - /** - * This value is clamped from 0.0 to 1.0 - */ - opacity?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'opacity' as absolute or as a delta. Defaults to false. - */ - relative?: boolean; - }; - position?: { - /** - * Defaults to the window's current left position in virtual screen coordinates. - */ - left?: number; - /** - * Defaults to the window's current top position in virtual screen coordinates. - */ - top?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. - */ - relative?: boolean; - }; - size?: { - /** - * Optional if height is present. Defaults to the window's current width. - */ - width?: number; - /** - * Optional if width is present. Defaults to the window's current height. - */ - height?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. - */ - relative?: boolean; - }; - } - - interface AnimationOptions { - /** - * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. - */ - interrupt?: boolean; - /** - * Transition effect. Defaults to 'ease-in-out'. - */ - tween?: OpenFinTweenType; - } - - interface WindowBounds { - /** - * the height of the window. - */ - height?: number; - /** - * left-most coordinate of the window. - */ - left?: number; - /** - * top-most coordinate of the window. - */ - top?: number; - /** - * the width of the window. - */ - width?: number; - } - - interface SessionChangedEvent { - /** - * the action that triggered this event: - */ - reason: "lock" - | "unlock" - | "remote-connect" - | "remote-disconnect" - | "unknown"; - topic: "system"; - type: "session-changed"; - } - - interface LaunchInfo { - launchMode: "fin-protocol" - | "fins-protocol" - | "shortcut" - | "command-line" - | "adapter" - | "other" - | string; - } - - type OpenFinTweenType = "linear" - | "ease-in" - | "ease-out" - | "ease-in-out" - | "ease-in-quad" - | "ease-out-quad" - | "ease-in-out-quad" - | "ease-in-cubic" - | "ease-out-cubic" - | "ease-in-out-cubic" - | "ease-out-bounce" - | "ease-in-back" - | "ease-out-back" - | "ease-in-out-back" - | "ease-in-elastic" - | "ease-out-elastic" - | "ease-in-out-elastic"; - - type OpenFinApplicationEventType = "closed" - | "connected" - | "crashed" - | "initialized" - | "manifest-changed" - | "not-responding" - | "out-of-memory" - | "responding" - | "run-requested" - | "started" - | "tray-icon-clicked" - | "window-alert-requested" - | "window-auth-requested" - | "window-closed" - | "window-created" - | "window-end-load" - | "window-navigation-rejected" - | "window-show-requested" - | "window-start-load"; - - type OpenFinExternalApplicationEventType = "connected" - | "disconnected"; - - type OpenFinSystemEventType = "application-closed" - | "application-crashed" - | "application-created" - | "application-started" - | "desktop-icon-clicked" - | "idle-state-changed" - | "monitor-info-changed" - | "session-changed"; - - type OpenFinWindowEventType = "auth-requested" - | "blurred" - | "bounds-changed" - | "bounds-changing" - | "close-requested" - | "closed" - | "disabled-frame-bounds-changed" - | "disabled-frame-bounds-changing" - | "embedded" - | "external-process-exited" - | "external-process-started" - | "focused" - | "frame-disabled" - | "frame-enabled" - | "group-changed" - | "hidden" - | "initialized" - | "maximized" - | "minimized" - | "navigation-rejected" - | "restored" - | "show-requested" - | "shown"; - - type OpenFinAnchor = "top-left" - | "top-right" - | "bottom-left" - | "bottom-right"; -} diff --git a/types/openfin/v30/openfin-tests.ts b/types/openfin/v30/openfin-tests.ts deleted file mode 100644 index ce49b14f5c..0000000000 --- a/types/openfin/v30/openfin-tests.ts +++ /dev/null @@ -1,728 +0,0 @@ -/// - -function test_application() { - let application: fin.OpenFinApplication; - // constructor - application = new fin.desktop.Application({ - url: "application.html", - uuid: "74BED629-2D8E-4141-8582-73E364BDFA74", - name: "Application Name", - plugins: false, - mainWindowOptions: { - defaultHeight: 600, - defaultWidth: 800, - defaultTop: 300, - defaultLeft: 300, - autoShow: true - } - }, (successObj) => { - console.log("Application successfully created, HTTP response code:", successObj); - application.run(); - }, (error) => { - console.log("Error creating application:", error); - }); - //createFromManifest - fin.desktop.Application.createFromManifest("http://stuf.com/app.json", (app) => { - console.log(app.uuid); - }, err => console.log(err)); - // getCurrent - application = fin.desktop.Application.getCurrent(); - // wrap - application = fin.desktop.Application.wrap("454C7F31-A915-4EA2-83F2-CFA655453C52"); - // getWindow - application.getWindow(); - // addEventListener - application.addEventListener("closed", (event) => { - console.log("The application has closed"); - }, () => { - console.log("The registration was successful"); - }, reason => { - console.log("failure: " + reason); - }); - // close - application.close(); - // getChildWindows - application.getChildWindows(children => { - children.forEach(childWindow => { - console.log("Showing child: " + childWindow.name); - childWindow.show(); - }); - }); - // getGroups - application.getGroups(allGroups => { - console.log(`There are a total of ${allGroups.length} groups.`); - - let groupCounter = 1; - allGroups.forEach(windowGroup => { - console.log(`Group ${groupCounter} contains ${windowGroup.length} windows.`); - ++groupCounter; - }); - }); - // getManifest - application.getManifest(manifest => { - console.log("Application manifest:"); - console.log(manifest); - }); - // getParentUuid - application.getParentUuid(parentUuid => { - console.log("UUID of parent application:"); - console.log(parentUuid); - }); - // getShortcuts - application.getShortcuts(config => { - console.log("Desktop shortcut is enabled: ", config.desktop); - console.log("Start Menu shortcut is enabled: ", config.startMenu); - console.log("System Startup shortcut is enabled: ", config.systemStartup); - }); - // getInfo - application.getInfo(info => { - console.log(`Launch mode: ${info.launchMode}`); - }); - // getTrayIconInfo - application.getTrayIconInfo(info => { - console.log(info.x, info.y, info.bounds.x, info.bounds.y, info.bounds.height, info.bounds.width, - info.monitorInfo.type, info.monitorInfo.reason); - }); - // isRunning - application.isRunning(running => { - console.log("the application is", running ? "running" : "not running"); - }); - // registerCustomData - application.registerUser("a", "b", () => console.log("done"), err => console.log(err)); - // removeEventListener - const previousCallback = (event: fin.WindowEvent) => { }; - application.removeEventListener("closed", previousCallback, () => { - console.log("The unregistration was successful"); - }, err => { - console.log("failure:", err); - }); - // removeTrayIcon - application.removeTrayIcon(() => { - console.log("Removed the tray icon."); - }, err => { - console.log("failure:", err); - }); - // restart - application.restart(() => { - console.log("You will not read this."); - }, err => { - console.log("failure:", err); - }); - // schedule restart - application.scheduleRestart(() => { - console.log("You will not read this."); - }, err => { - console.log("failure:", err); - }); - // setShortcuts - application.setShortcuts({ - desktop: true, - startMenu: false, - systemStartup: true - }, () => { - console.log("Successfully set new shortcut states"); - }, error => { - console.log("Failed to set new shortcut states. Error: ", error); - }); - // setTrayIcon - application.setTrayIcon("https://developer.openf.in/download/openfin.png", clickInfo => { - console.log(`The mouse has clicked at (${clickInfo.x}, ${clickInfo.y})`); - }); - // terminate - application.terminate(); - // wait - application.addEventListener("not-responding", () => { - console.log("waiting for hung application"); - application.wait(); - }); - //uuid - let hasUuid = application.uuid; -} - -function test_external_application() { - let externalApp: fin.OpenFinExternalApplication; - // wrap - externalApp = fin.desktop.ExternalApp.wrap('my-uuid'); - // addEventListener - externalApp.addEventListener('connected', () => { - console.log('external app connected'); - }, () => { - console.log('The registration was successful'); - }, (reason, err) => { - console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); - }); - // removeEventListener - const previousCallback = () => { }; - externalApp.removeEventListener('connected', previousCallback, () => { - console.log('The unregistration was successful'); - }, (reason, err) => { - console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); - }); -} - -function test_inter_application_bus() { - // addSubscribeListener - fin.desktop.InterApplicationBus.addSubscribeListener((uuid, topic, name) => { - console.log(`The application ${uuid} has subscribed to ${topic}`); - }); - // addUnsubscribeListener - fin.desktop.InterApplicationBus.addUnsubscribeListener((uuid, topic, name) => { - console.log(`The application ${uuid} has unsubscribed to ${topic}`); - }); - // removeSubscribeListener - const aRegisteredListener = (uuid: string, topic: string, name: string) => { }; - fin.desktop.InterApplicationBus.removeSubscribeListener(aRegisteredListener); - // removeUnsubscribeListener - fin.desktop.InterApplicationBus.removeUnsubscribeListener(aRegisteredListener); - // publish - fin.desktop.InterApplicationBus.publish("a topic", { - field1: "value1", - field2: "value2" - }); - // send - fin.desktop.InterApplicationBus.send("an application's uuid", "a topic", { - field1: "value1", - field2: "value2" - }); - // subscribe - fin.desktop.InterApplicationBus.subscribe("*", "a topic", (message, uuid, name) => { - console.log(`The application ${uuid} sent this message: ${message}`); - }); - // unsubscribe - const aRegisteredMessageListener = (message: any, senderUuid: string) => { - console.log(message, senderUuid); - }; - fin.desktop.InterApplicationBus.unsubscribe("*", "a topic", aRegisteredMessageListener); -} - -function test_notification() { - let notification: fin.OpenFinNotification; - // getCurrent - notification = fin.desktop.Notification.getCurrent(); - // close - notification.close(); - // sendMessage - notification = new fin.desktop.Notification({ - duration: 10, - url: "http://localhost:5000/Account/Register", - message: "Hello", - onShow: () => { }, - // onClose: () => { }, - onDismiss: () => { }, - // onClick: () => { }, - onMessage: () => { }, - onError: () => { } - }); - // sendMessageToApplication - notification.sendMessageToApplication("some message"); -} - -function test_system() { - // addEventListener - fin.desktop.System.addEventListener('monitor-info-changed', event => { - console.log("The monitor information has changed to: ", event); - }, () => { - console.log("The registration was successful"); - }, err => { - console.log("failure: " + err); - }); - // clearCache - fin.desktop.System.clearCache({ - cache: true, - cookies: true, - localStorage: true, - appcache: true, - userData: true - }); - // deleteCacheOnExit - fin.desktop.System.deleteCacheOnExit(() => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // downloadAsset - const dirAppAsset = { - src: 'http://local:8000/dir.zip', - alias: 'dirApp', - version: '1.23.24', - target: 'dir.bat', - args: '' - }; - fin.desktop.System.downloadAsset(dirAppAsset, progress => { - const downloadedPercent = Math.floor((progress.downloadedBytes / progress.totalBytes) * 100); - console.log(`Downloaded ${downloadedPercent}%`); - }, p => { - console.log(`Downlod complete, can be found on ${p.path}`); - // lets launch our application asset. - // launchDirApp(); - }, (reason, err) => { - console.log(reason, err); - }); - // exit - fin.desktop.System.exit(() => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // getAllApplications - fin.desktop.System.getAllApplications(applicationInfoList => { - applicationInfoList.forEach(applicationInfo => { - console.log("Showing information for application with uuid: " - + applicationInfo.uuid); - console.log("isRunning: ", applicationInfo.isRunning); - }); - }); - // getAllExternalApplications - fin.desktop.System.getAllExternalApplications(externalAppsInfoList => { - externalAppsInfoList.forEach(appInfo => { - console.log(`External app connected to the runtime with UUID ${appInfo.uuid}`); - }); - }); - // getAllWindows - fin.desktop.System.getAllWindows(windowInfoList => { - windowInfoList.forEach(windowInfo => { - console.log("Showing information for application with uuid: ", windowInfo.uuid); - console.log("Main window: ", windowInfo.mainWindow); - console.log("Child windows: ", windowInfo.childWindows); - }); - }); - // getCommandLineArguments - fin.desktop.System.getCommandLineArguments(args => { - console.log("The command line arguments are " + args); - }); - // getDeviceId - fin.desktop.System.getDeviceId(id => { - console.log("The id of the device is: " + id); - }); - // getEnvironmentVariable - fin.desktop.System.getEnvironmentVariable("APPDATA", variable => { - console.log("this is the APPDATA value", variable); - }); - // getHostSpecs - fin.desktop.System.getHostSpecs(info => { - console.log(info); - }, error => { - console.log('There was an error:', error); - }); - // getLog - fin.desktop.System.getLog('debug-2015-01-08-22-27-53.log', log => { - console.log(log); - }); - // getLogList - fin.desktop.System.getLogList(logList => { - logList.forEach(logInfo => { - console.log(`The filename of the log is ${logInfo.name}, the size is ${logInfo.size}, and the date of creation is ${logInfo.date}`); - }); - }); - // getMonitorInfo - fin.desktop.System.getMonitorInfo(monitorInfo => { - console.log("This object contains information about all monitors: ", monitorInfo); - }); - // getMousePosition - fin.desktop.System.getMousePosition(mousePosition => { - console.log(`The mouse is located at left: ${mousePosition.left}, top: ${mousePosition.top}`); - }); - // getProcessList - fin.desktop.System.getProcessList(list => { - list.forEach(process => { - console.log(`UUID: ${process.uuid}, Application Name: ${process.name}`); - }); - }); - // getProxySettings - fin.desktop.System.getProxySettings(proxy => { - console.log(proxy); - }); - // getRvmInfo - fin.desktop.System.getRvmInfo(rvmInfoObject => { - console.log("RVM version:", rvmInfoObject.version); - console.log("RVM has been running since:", rvmInfoObject["start-time"]); - }, err => { - console.log("Failed to get rvm info, error message:", err); - }); - // getVersion - fin.desktop.System.getVersion(version => { - console.log("The version is " + version); - }); - // launchExternalProcess - fin.desktop.System.launchExternalProcess({ - path: "notepad", - arguments: "", - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // - fin.desktop.System.launchExternalProcess({ - // Additionally note that the executable found in the zip file specified in appAssets - // will default to the one mentioned by appAssets.target - // If the the path below refers to a specific path it will override this default - alias: "myApp", - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // - fin.desktop.System.launchExternalProcess({ - alias: "myApp", - arguments: "e f g", - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // - fin.desktop.System.launchExternalProcess({ - path: "C:\Users\ExampleUser\AppData\Local\OpenFin\OpenFinRVM.exe", - arguments: "--version", - certificate: { - trusted: true, - subject: 'O=OpenFin INC., L=New York, S=NY, C=US', - thumbprint: '3c a5 28 19 83 05 fe 69 88 e6 8f 4b 3a af c5 c5 1b 07 80 5b' - }, - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // log - fin.desktop.System.log("info", "An example log message", () => { - console.log("message successfully logged"); - }, err => { - console.log(err); - }); - // monitorExternalProcess - fin.desktop.System.monitorExternalProcess({ - pid: 2508, - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log("The process is now being monitored: ", payload.uuid); - }, error => { - console.log("Error:", error); - }); - // openUrlWithBrowser - fin.desktop.System.openUrlWithBrowser("https://developer.openf.in/", () => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // registerExternalConnection - fin.desktop.System.registerExternalConnection("remote-connection-uuid", (...args: any[]) => { - console.log(args); - }); - // releaseExternalProcess - fin.desktop.System.launchExternalProcess({ - path: "notepad", - arguments: "", - listener(result) { - console.log("The exit code", result.exitCode); - } - }, result => { - console.log("Result UUID is " + result.uuid); - - // release it. - fin.desktop.System.releaseExternalProcess(result.uuid, () => { - console.log("Process has been unmapped!"); - }, reason => { - console.log("failure: " + reason); - }); - }); - // removeEventListener - const aRegisteredListener = (event: fin.SystemBaseEvent) => { }; - fin.desktop.System.removeEventListener("monitor-info-changed", aRegisteredListener, () => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // showDeveloperTools - fin.desktop.System.showDeveloperTools("uuid", "name", () => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // terminateExternalProcess - fin.desktop.System.launchExternalProcess({ - // notepad is in the system's PATH - path: "notepad", - arguments: "", - listener(result) { - console.log("The exit code", result.exitCode); - } - }, result => { - console.log("Result UUID is " + result.uuid); - - // Attempt to close the process. Terminate after 4 seconds if it - // has not done so. - fin.desktop.System.terminateExternalProcess(result.uuid, 4000, info => { - console.log("Termination result " + info.result); - }, reason => { - console.log("failure: " + reason); - }); - }); - // updateProxySettings - fin.desktop.System.updateProxySettings("type", "proxyAddress", 8080, () => { - console.log('success'); - }, err => { - console.log(err); - }); -} - -function test_system_clipboard() { - // availableFormats - fin.desktop.System.Clipboard.availableFormats(null, formats => { - formats.forEach(format => console.log(`The format ${format} is available to read`)); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // readHtml - fin.desktop.System.Clipboard.readHtml(null, html => { - console.log(`This is the html from the clipboard: ${html}`); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // readRtf - fin.desktop.System.Clipboard.readRtf(null, rtf => { - console.log(`This is the rtf from the clipboard: ${rtf}`); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // readText - fin.desktop.System.Clipboard.readText(null, text => { - console.log(`This is the text from the clipboard: ${text}`); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // write - fin.desktop.System.Clipboard.write({ - text: 'Hello Text!', - html: '

    Hello Html

    ', - rtf: 'Hello Rtf' - }, null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // writeHtml - fin.desktop.System.Clipboard.writeHtml('

    Hello World

    ', null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // writeRtf - fin.desktop.System.Clipboard.writeRtf('Hello World!', null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // writeText - fin.desktop.System.Clipboard.writeText('Hello World', null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); -} - -function test_window() { - let finWindow: fin.OpenFinWindow; - // constructor - finWindow = new fin.desktop.Window({ - name: "childWindow", - url: "child.html", - defaultWidth: 320, - defaultHeight: 320, - defaultTop: 10, - defaultLeft: 300, - frame: false, - resizable: false, - state: "normal" - }, () => { - const _win = finWindow.getNativeWindow(); - _win.addEventListener("DOMContentLoaded", () => { finWindow.show(); }); - }, error => { - console.log("Error creating window:", error); - }); - // getCurrent - finWindow = fin.desktop.Window.getCurrent(); - // getNativeWindow - let nativeWindow: Window; - nativeWindow = finWindow.getNativeWindow(); - // getParentApplication - let parentApp: fin.OpenFinApplication; - parentApp = finWindow.getParentApplication(); - // getParentWindow - let parentFinWindow: fin.OpenFinWindow; - parentFinWindow = finWindow.getParentWindow(); - // wrap - finWindow = fin.desktop.Window.wrap("uuid", "name"); - // addEventListener - finWindow.addEventListener("bounds-changed", event => { - console.log("The window has been moved or resized"); - }, () => { - console.log("The registration was successful"); - }, reason => { - console.log("failure:" + reason); - }); - // animate - finWindow.animate({ - opacity: { - opacity: 0.15, - duration: 1000 - }, - position: { - left: 10, - top: 10, - duration: 3000 - } - }, { - interrupt: false - }, evt => { - // Callback will only fire after both "opacity" and "position" have finished animating. - }); - // authenticate - finWindow.addEventListener('auth-requested', evt => { - finWindow.authenticate('userName', 'P@assw0rd', () => { }, (reason, err) => { - console.log("failure:", err); - }); - }); - // blur - finWindow.blur(); - // bringToFront - finWindow.bringToFront(); - // close - finWindow.close(); - // disableFrame - finWindow.disableFrame(); - // enableFrame - finWindow.enableFrame(); - // flash - finWindow.flash(); - // focus - finWindow.focus(); - // getBounds - finWindow.getBounds(bounds => { - console.log(`top: ${bounds.top} left: ${bounds.left} height: ${bounds.height} width: ${bounds.width}`); - }); - // getOptions - finWindow.getOptions(options => { - console.log(options); - }); - // getSnapshot - finWindow.getSnapshot(base64Snapshot => { - console.log("data:image/png;base64," + base64Snapshot); - }); - // getState - finWindow.getState(state => { - console.log("state: " + state); - }); - // getZoomLevel - finWindow.getZoomLevel(level => { - console.log("zoom level: " + level); - }, error => { - console.log('error:', error); - }); - // hide - finWindow.hide(); - // isShowing - finWindow.isShowing(showing => { - console.log("the window is " + (showing ? "showing" : "hidden")); - }); - // joinGroup - let secondWindow = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "secondWindow", - autoShow: true - }, () => { - // When mainWindow moves or is moved, secondWindow moves by the same amount - secondWindow.joinGroup(finWindow); - }); - // leaveGroup - secondWindow = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "secondWindow", - autoShow: true - }, () => { - // When finWindow moves or is moved, secondWindow moves by the same amount - secondWindow.joinGroup(finWindow, () => { - // once we are in the group, lets leave it. - secondWindow.leaveGroup(); - }); - }); - // maximize - finWindow.maximize(); - // mergeGroups - { - const finWindowOne = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowOne", - autoShow: true - }); - const finWindowTwo = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowTwo", - autoShow: true - }); - const finWindowThree = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowThree", - autoShow: true - }); - const finWindowFour = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowFour", - autoShow: true - }); - // When finWindowOne moves or is moved, finWindowTwo moves by the same amount - finWindowOne.joinGroup(finWindowTwo); - // When finWindowThree moves or is moved, finWindowFour moves by the same amount - finWindowThree.joinGroup(finWindowFour); - // finWindowOne, finWindowTwo, finWindowThree, and finWindowFour now move together in the same group - finWindowOne.mergeGroups(finWindowThree); - } - // minimize - finWindow.minimize(); - // moveBy - finWindow.moveBy(10, 10); - // moveTo - finWindow.moveTo(100, 200); - // removeEventListener - const aRegisteredListener = (event: fin.WindowBaseEvent) => { }; - finWindow.removeEventListener("bounds-changed", aRegisteredListener); - // resizeBy - finWindow.resizeBy(10, 10, "top-right"); - // resizeTo - finWindow.resizeTo(10, 10, "top-right"); - // restore - finWindow.restore(); - // setAsForeground - finWindow.setAsForeground(); - // setBounds - finWindow.setBounds(100, 200, 400, 400); - // setZoomLevel - finWindow.setZoomLevel(10); - // show - finWindow.show(); - // showAt - finWindow.showAt(10, 10, false); - // stopFlashing - finWindow.stopFlashing(); - // updateOptions - finWindow.updateOptions({ - frame: false, - maxWidth: 500 - }); -} diff --git a/types/openfin/v30/v30 b/types/openfin/v30/v30 deleted file mode 100644 index 5c40c47ae0..0000000000 --- a/types/openfin/v30/v30 +++ /dev/null @@ -1,1736 +0,0 @@ -// Type definitions for OpenFin API 17.0 -// Project: https://openfin.co/ -// Definitions by: Chris Barker -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// based on v6.49.17.14 -// see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean - -/** - * JavaScript API - * The JavaScript API allows you to create an HTML/JavaScript application that has access to the native windowing environment, - * can communicate with other applications and has access to sandboxed system-level features. - * - * API Ready - * When using the OpenFin API, it is important to ensure that it has been fully loaded before making any API calls. To verify - * that the API is in fact ready, be sure to make any API calls either from within the fin.desktop.main() method or explicitly - * after it has returned. This avoids the situation of trying to access methods that are not yet fully injected. - * - * Overview - * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API - * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "document" objects. - */ -declare namespace fin { - const desktop: OpenFinDesktop; - - interface OpenFinDesktop { - main(f: () => any): void; - Application: OpenFinApplicationStatic; - ExternalApp: OpenFinExternalApplicationStatic; - InterApplicationBus: OpenFinInterApplicationBus; - Notification: OpenFinNotificationStatic; - System: OpenFinSystem; - Window: OpenFinWindowStatic; - } - - interface OpenFinApplicationStatic { - /** - * Creates a new Application. - * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. - */ - new ( - options: ApplicationOptions, - callback?: (successObj: { httpResponseCode: number }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; - /** - * Returns an Application object that represents an existing application. - */ - getCurrent(): OpenFinApplication; - /** - * Returns an Application object that represents an existing application. - */ - wrap(uuid: string): OpenFinApplication; - } - - /** - * Application - * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. - */ - interface OpenFinApplication { - /** - * Returns an instance of the main Window of the application - */ - getWindow(): OpenFinWindow; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinApplicationEventType, - listener: (event: ApplicationBaseEvent - | TrayIconClickedEvent - | WindowEvent - | WindowAlertRequestedEvent - | WindowAuthRequested - | WindowNavigationRejectedEvent - | WindowEndLoadEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Closes the application and any child windows created by the application. - */ - close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. - */ - getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. - */ - getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. - */ - getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. - */ - getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves current configuration of application's shortcuts. - */ - getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves information about the application. - */ - getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Determines if the application is currently running. - */ - isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; - /** - * Passes in custom data that will be relayed to the RVM - */ - registerCustomData(data: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinApplicationEventType, - previouslyRegisteredListener: (event: ApplicationBaseEvent - | TrayIconClickedEvent - | WindowEvent - | WindowAlertRequestedEvent - | WindowAuthRequested - | WindowNavigationRejectedEvent - | WindowEndLoadEvent) => any, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Removes the application's icon from the tray. - */ - removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Restarts the application. - */ - restart(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Runs the application. When the application is created, run must be called. - */ - run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * Tells the rvm to relaunch the main application once upon a complete shutdown - */ - scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets new shortcut configuration for current application. - * Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to - * be able to change shortcut states. - */ - setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Adds a customizable icon in the system tray and notifies the application when clicked. - */ - setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Closes the application by terminating its process. - */ - terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application - * to continue and to generate another "not-responding" message after a certain period of time. - */ - wait(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * The Application's uuid - */ - uuid: string; - } - - interface ShortCutConfig { - /** - * application has a shortcut on the desktop - */ - desktop?: boolean; - /** - * application has no shortcut in the start menu - */ - startMenu?: boolean; - /** - * application will be launched on system startup - */ - systemStartup?: boolean; - } - - interface SuccessObj { - httpResponseCode: number; - } - - interface NetworkErrorInfo extends ErrorInfo { - networkErrorCode: number; - } - - interface ErrorInfo { - stack: string; - message: string; - } - - interface ApplicationOptions { - /** - * The name of the application. - */ - name?: string; - /** - * The url to the application. - */ - url?: string; - /** - * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. - */ - uuid?: string; - /** - * Enable Flash at the application level. Default: false. - */ - plugins?: boolean; - /** - * The options of the main window of the application. - */ - mainWindowOptions?: WindowOptions; - } - - interface WindowOptions { - /** - * Enable keyboard shortcuts for devtools and zoom. Default: false for both. - */ - accelerator?: { - devtools?: boolean, - zoom?: boolean, - reload?: boolean, - reloadIgnoreCache?: boolean, - }; - /** - * A flag to always position the window at the top of the window stack. Default: false. - * Updatable - */ - alwaysOnTop?: boolean; - /** - * A flag to automatically show the Window when it is created. Default: false. - */ - autoShow?: boolean; - /** - * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true - * Updatable - */ - contextMenu?: boolean; - /** - * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. - * Updatable - */ - cornerRounding?: { - width?: number; - height?: number; - }; - /** - * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. - */ - customData?: any; - /** - * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the position from before the window was closed is used. - * This option overrides defaultLeft and defaultTop. Default: false. - */ - defaultCentered?: boolean; - /** - * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. - */ - defaultHeight?: number; - /** - * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. - */ - defaultWidth?: number; - /** - * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. - */ - defaultTop?: number; - /** - * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. - */ - defaultLeft?: number; - /** - * A flag to show the frame. Default: true. - * Updatable - */ - frame?: boolean; - /** - * A flag to allow a window to be hidden when the close button is clicked.Default: false. - * Updatable - */ - hideOnClose?: boolean; - /** - * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. - * Updatable - */ - icon?: string; - /** - * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. - * Updatable - */ - maxHeight?: number; - /** - * A flag that lets the window be maximized.Default: true. - * Updatable - */ - maximizable?: boolean; - /** - * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. - * Updatable - */ - maxWidth?: number; - /** - * The minimum height of a window.Default: 0. - * Updatable - */ - minHeight?: number; - /** - * A flag that lets the window be minimized.Default: true. - */ - minimizable?: boolean; - /** - * The minimum width of a window.Default: 0. - */ - minWidth?: number; - /** - * The name for the window which must be unique within the context of the invoking Application. - */ - name?: string; - /** - * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. - * Updatable - */ - opacity?: number; - /** - * A flag to drop to allow the user to resize the window.Default: true. - * Updatable - */ - resizable?: boolean; - /** - * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. - * Updatable - */ - resizeRegion?: { - /** - * The size in pixels (Default: 2), - */ - size?: number; - /** - * The size in pixels of an additional - * square resizable region located at the - * bottom right corner of a - * frameless window. (Default: 4) - */ - bottomRightCorner?: number; - }; - /** - * A flag to show the Window's icon in the taskbar. Default: true. - */ - showTaskbarIcon?: boolean; - /** - * A flag to cache the location of the window or not. Default: true. - */ - saveWindowState?: boolean; - /** - * Specify a taskbar group for the window. Default: app's uuid. - */ - taskbarIconGroup?: string; - /** - * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". - */ - state?: string; - /** - * The URL of the window. Default: "about:blank". - */ - url?: string; - /** - * When set to false, the window will render before the "load" event is fired on the content's window. - * Caution, when false you will see an initial empty white window. Default: true. - */ - waitForPageLoad?: boolean; - } - - /** - * Clipboard - * Clipboard API allows reading and writting to the clipboard in multiple formats. - */ - interface OpenFinClipboard { - /** - * Reads available formats for the clipboard type - */ - availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Reads available formats for the clipboard type - */ - readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Read the content of the clipboard as Rtf - */ - readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Read the content of the clipboard as plain text - */ - readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard - */ - write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as Html - */ - writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as Rtf - */ - writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as plain text - */ - writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - } - - interface OpenFinExternalApplicationStatic { - /** - * Returns an External Application object that represents an existing external application. - */ - wrap(uuid: string): OpenFinExternalApplication; - } - /** - * ExternalApplication - * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. - */ - interface OpenFinExternalApplication { - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinExternalApplicationEventType, - listener: () => void, - callback?: () => void, - errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinExternalApplicationEventType, - listener: () => void, - callback?: () => void, - errorCallback?: (reason: string, error: ErrorInfo) => void): void; - } - - /** - * InterApplicationBus - * A messaging bus that allows for pub/sub messaging between different applications. - */ - interface OpenFinInterApplicationBus { - /** - * Adds a listener that gets called when applications subscribe to the current application's messages. - */ - addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Adds a listener that gets called when applications unsubscribe to the current application's messages. - */ - addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Removes a previously registered subscribe listener. - */ - removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Removes a previously registered unsubscribe listener. - */ - removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. - */ - publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sends a message to a specific application on a specific topic. - */ - send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], - * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. - */ - subscribe( - senderUuid: string, - name: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - subscribe( - senderUuid: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Unsubscribes to messages from the specified application on the specified topic. - */ - unsubscribe( - senderUuid: string, - name: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - unsubscribe( - senderUuid: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - } - - interface OpenFinNotificationStatic { - /** - * ctor - */ - new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; - /** - * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. - */ - getCurrent(): OpenFinNotification; - } - - /** - * Notification - * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. - * A notification is typically used to alert the user of some important event which requires his or her attention. - * Notifications are a child or your application that are controlled by the runtime. - */ - interface OpenFinNotification { - /** - * Closes the notification. - */ - close(callback?: () => void): void; - /** - * Sends a message to the notification. - */ - sendMessage(message: any, callback?: () => void): void; - /** - * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. - */ - sendMessageToApplication(message: any, callback?: () => void): void; - } - - interface NotificationOptions { - /** - * A boolean that will force dismissal even if the mouse is hovering over the notification - */ - ignoreMouseOver?: boolean; - /** - * A message of any primitive or composite-primitive type to be passed to the notification upon creation. - */ - message?: any; - /** - * The timeout for displaying a notification.Can be in milliseconds or "never". - */ - duration?: number | "never"; - /** - * The url of the notification - */ - url?: string; - /** - * A function that is called when a notification is clicked. - */ - onClick?(callback: () => void): void; - /** - * Invoked when the notification is closed via .close() method on the created notification instance - * or the by the notification itself via fin.desktop.Notification.getCurrent().close(). - * NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss - */ - onClose?(callback: () => void): void; - /** - * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. - */ - onDismiss?(callback: () => void): void; - /** - * A function that is called when an error occurs.The reason for the error is passed as an argument. - */ - onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * The onMessage function will respond to messages sent from notification.sendMessageToApplication. - * The function is passed the message, which can be of any primitive or composite-primitive type. - */ - onMessage?(callback: (message: any) => void): void; - /** - * A function that is called when a notification is shown. - */ - onShow?(callback: (successObj: SuccessObj) => void): void; - } - - /** - * System - * An object representing the core of OpenFin Runtime. - * Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. - */ - interface OpenFinSystem { - Clipboard: OpenFinClipboard; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinSystemEventType, - listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Clears cached data containing window state/positions, - * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. - */ - clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Clears all cached data when OpenFin Runtime exits. - */ - deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Downloads the given application asset - */ - downloadAsset( - assetObj: AppAssetInfo, - progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, - callback?: (successObj: { path: string }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * Exits the Runtime. - */ - exit(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data for all applications. - */ - getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data for all external applications. - */ - getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data (name, ids, bounds) for all application windows. - */ - getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the command line argument string that started OpenFin Runtime. - */ - getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the configuration object that started the OpenFin Runtime. - */ - getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the value of a given environment variable on the computer on which the runtime is installed. - */ - getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves system information. - */ - getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the contents of the log with the specified filename. - */ - getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array containing information for each log file. - */ - getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. - */ - getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the mouse in virtual screen coordinates (left, top). - */ - getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of all of the runtime processes that are currently running. - * Each element in the array is an object containing the uuid and the name of the application to which the process belongs. - */ - getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the Proxy settings. - */ - getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns information about the running RVM in an object. - */ - getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. - */ - getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Runs an executable or batch file. - */ - launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; - /** - * Writes the passed message into both the log file and the console. - */ - log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Monitors a running process. - */ - monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; - /** - * Opens the passed URL in the default web browser. - */ - openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * This function call will register a unique id and produce a token. The token can be used to broker an external connection. - */ - registerExternalConnection( - uuid: string, - callback?: (detail: { - /** - * this will be unique each time - */ - token: string; - /** - * "remote-connection-uuid" - */ - uuid: string; - }) => void, - errorCallback?: (reason: string) => void): void; - /** - * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). - */ - releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinSystemEventType, - listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the Chrome Developer Tools for the specified window. - */ - showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. - */ - terminateExternalProcess( - processUuid: string, - timeout: number, - killTree: boolean, - callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, - errorCallback?: (reason: string) => void): void; - terminateExternalProcess( - processUuid: string, - timeout: number, - callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, - errorCallback?: (reason: string) => void): void; - /** - * Update the OpenFin Runtime Proxy settings. - */ - updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface CacheOptions { - cache?: boolean; - cookies?: boolean; - localStorage?: boolean; - appcache?: boolean; - userData?: boolean; - } - - interface AppAssetInfo { - src?: string; - alias?: string; - version?: string; - target?: string; - args?: string; - } - - interface ApplicationInfo { - /** - * true when the application is running. - */ - isRunning?: boolean; - /** - * uuid of the application. - */ - uuid?: string; - /** - * uuid of the application that launches this application. - */ - parentUuid?: string; - } - - interface WindowDetails { - uuid?: string; - mainWindow?: WindowInfo; - childWindows?: WindowInfo[]; - } - - interface WindowInfo { - /** - * name of the child window - */ - name?: string; - /** - * top-most coordinate of the child window - */ - top?: number; - /** - * right-most coordinate of the child window - */ - right?: number; - /** - * bottom-most coordinate of the child window - */ - bottom?: number; - /** - * left-most coordinate of the child window - */ - left?: number; - } - - interface HostSpecInfo { - /** - * "x86" for 32-bit or "x86_64" for 64-bit - */ - arch: string; - /** - * Same payload as Node's os.cpus() - */ - cpus: NodeCpuInfo[]; - gpu: { - /** - * Graphics card name - */ - name: string; - }; - /** - * Same payload as Node's os.totalmem() - */ - memory: number; - /** - * OS name and version/edition - */ - name: string; - } - - interface NodeCpuInfo { - model: string; - /** - * in MHz - */ - speed: number; - times: { - /** - * The number of milliseconds the CPU has spent in user mode. - */ - user: number; - /** - * The number of milliseconds the CPU has spent in nice mode. - */ - nice: number; - /** - * The number of milliseconds the CPU has spent in sys mode. - */ - sys: number; - /** - * The number of milliseconds the CPU has spent in idle mode. - */ - idle: number; - /** - * The number of milliseconds the CPU has spent in irq mode. - */ - irq: number; - }; - } - - interface LogInfo { - /** - * the filename of the log - */ - name?: string; - /** - * the size of the log in bytes - */ - size?: number; - /** - * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" - */ - date?: string; - } - - interface ProcessInfo { - /** - * the percentage of total CPU usage - */ - cpuUsage?: number; - /** - * the application name - */ - name?: string; - /** - * the current nonpaged pool usage in bytes - */ - nonPagedPoolUsage?: number; - /** - * the number of page faults - */ - pageFaultCount?: number; - /** - * the current paged pool usage in bytes - */ - pagedPoolUsage?: number; - /** - * the total amount of memory in bytes that the memory manager has committed - */ - pagefileUsage?: number; - /** - * the peak nonpaged pool usage in bytes - */ - peakNonPagedPoolUsage?: number; - /** - * the peak paged pool usage in bytes - */ - peakPagedPoolUsage?: number; - /** - * the peak value in bytes of pagefileUsage during the lifetime of this process - */ - peakPagefileUsage?: number; - /** - * the peak working set size in bytes - */ - peakWorkingSetSize?: number; - /** - * the native process identifier - */ - processId?: number; - /** - * the application UUID - */ - uuid?: string; - /** - * the current working set size (both shared and private data) in bytes - */ - workingSetSize?: number; - } - - interface ProxyInfo { - /** - * the configured Proxy Address - */ - proxyAddress?: string; - /** - * the configured Proxy port - */ - proxyPort?: number; - /** - * Proxy Type - */ - type?: string; - } - - interface RvmInfo { - version?: string; - "start-time"?: string; - } - - interface ExternalProcessLaunchInfo { - path?: string; - /** - * Additionally note that the executable found in the zip file specified in appAssets - * will default to the one mentioned by appAssets.target - * If the the path below refers to a specific path it will override this default - */ - alias?: string; - /** - * When using alias; if no arguments are passed then the arguments (if any) - * are taken from the 'app.json' file, from the 'args' parameter - * of the 'appAssets' Object with the relevant 'alias'. - * If 'arguments' is passed as a parameter it takes precedence - * over any 'args' set in the 'app.json'. - */ - arguments?: string; - listener?(result: { - /** - * "Exited" Or "released" on a call to releaseExternalProcess - */ - topic?: string; - /** - * The mapped UUID which identifies the launched process - */ - uuid?: string; - /* - * Process exit code - */ - exitCode?: number; - }): void; - certificate?: CertificationInfo; - } - - interface CertificationInfo { - /** - * A hex string with or without spaces - */ - serial?: string; - /** - * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields - */ - subject?: string; - /** - * A hex string with or without spaces - */ - publickey?: string; - /** - * A hex string with or without spaces - */ - thumbprint?: string; - /** - * A boolean indicating that the certificate is trusted and not revoked - */ - trusted?: boolean; - } - - interface ExternalProcessInfo { - pid?: number; - listener?(result: { - /** - * "Exited" Or "released" on a call to releaseExternalProcess - */ - topic?: string; - /** - * The mapped UUID which identifies the launched process - */ - uuid?: string; - /* - * Process exit code - */ - exitCode?: number; - }): void; - } - - interface OpenFinWindowStatic { - /** - * Class: Window - * - * new Window(options, callbackopt, errorCallbackopt) - * - * Creates a new OpenFin Window - * - * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, - * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. - * The new window appears in the same process as the parent window. - * @param options - The options of the window - * @param [callback] - Called if the window creation was successful - * @param [callback.successObj] - httpResponseCode - */ - new ( - options: WindowOptions, - callback?: (successObj: { httpResponseCode: number }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; - /** - * Returns an instance of the current window. - * @returns Current window - */ - getCurrent(): OpenFinWindow; - /** - * Returns a Window object that wraps an existing window. - */ - wrap(appUuid: string, windowName: string): OpenFinWindow; - } - - /** - * Window - * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, - * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. - * The new window appears in the same process as the parent window. - */ - interface OpenFinWindow { - /** - * Name of window - */ - name: string; - /** - * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, - * otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the - * contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. - * Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). - * @returns Native window - */ - getNativeWindow(): Window; - /** - * Gets the parent application. - * @returns Parent application - */ - getParentApplication(): OpenFinApplication; - /** - * Gets the parent window. - */ - getParentWindow(): OpenFinWindow; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinWindowEventType, - listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Performs the specified window transitions - */ - animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; - /** - * Provides credentials to authentication requests - */ - authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Removes focus from the window. - */ - blur(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Brings the window to the front of the OpenFin window stack. - */ - bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Closes the window. - * @param Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. - */ - close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Prevents a user from changing a window's size/position when using the window's frame. - * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. - * 'disabled-frame-bounds-changed' is generated after a user move/size operation. - * The events provide the bounds that would have been applied if the frame was enabled. - * 'frame-disabled' is generated when an enabled frame becomes disabled. - */ - disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Re-enables user changes to a window's size/position when using the window's frame. - * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. - * 'disabled-frame-bounds-changed' is generated after a user move/size operation. - * The events provide the bounds that would have been applied if the frame was enabled. - * 'frame-enabled' is generated when a disabled frame has becomes enabled. - */ - enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Flashes the window's frame and taskbar icon until the window is activated. - */ - flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Gives focus to the window. - */ - focus(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current bounds (top, left, width, height) of the window. - */ - getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. - * Please note that calling window is included in the result array. - */ - getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current settings of the window. - */ - getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets a base64 encoded PNG snapshot of the window. - */ - getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current state ("minimized", "maximized", or "restored") of the window. - */ - getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the zoom level of the window. - */ - getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; - /** - * Hides the window. - */ - hide(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Determines if the window is currently showing. - */ - isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; - /** - * Joins the same window group as the specified window. - */ - joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Leaves the current window group so that the window can be move independently of those in the group. - */ - leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Maximizes the window. - */ - maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Merges the instance's window group with the same window group as the specified window - */ - mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Minimizes the window. - */ - minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Moves the window by a specified amount. - */ - moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Moves the window to a specified location. - */ - moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinWindowEventType, - listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Resizes the window by a specified amount. - */ - resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Resizes the window by a specified amount. - */ - resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Restores the window to its normal state (i.e., unminimized, unmaximized). - */ - restore(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Will bring the window to the front of the entire stack and give it focus. - */ - setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets the window's size and position - */ - setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets the zoom level of the window. - */ - setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the window if it is hidden. - * @param Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. - */ - show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. - */ - showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Stops the taskbar icon from flashing. - */ - stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Updates the window using the passed options - */ - updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface ApplicationBaseEvent { - topic: string; - type: OpenFinApplicationEventType; - uuid: string; - } - - interface TrayIconClickedEvent extends ApplicationBaseEvent { - button: number; // 0 for left, 1 for middle, 2 for right - monitorInfo: MonitorInfo; - x: number; // the cursor x coordinate - y: number; // the cursor y coordinate - } - - interface WindowEvent extends ApplicationBaseEvent { - name: string; - } - - interface WindowAlertRequestedEvent extends WindowEvent { - message: string; - url: string; - } - - interface WindowAuthRequested extends WindowEvent { - authInfo: { - host: string; - isProxy: boolean; - port: number; - realm: string; - scheme: string; - }; - } - - interface WindowNavigationRejectedEvent extends WindowEvent { - sourceName: string; - url: string; - } - - interface WindowEndLoadEvent extends WindowEvent { - documentName: string; - isMain: boolean; - } - - interface MonitorInfoChangedEvent extends MonitorInfo { - topic: "system"; - type: "monitor-info-changed"; - } - - interface MonitorInfo { - nonPrimaryMonitors: MonitorInfoDetail[]; - primaryMonitor: MonitorInfoDetail; - reason: string; - taskbar: { - edge: "left" | "right" | "top" | "bottom", - rect: MontiorCoordinates - }; - topic: "system"; - type: "monitor-info-changed"; - virtualScreen: MontiorCoordinates; - } - - interface MonitorInfoDetail { - availableRect: MontiorCoordinates; - deviceId: string; - displayDeviceActive: boolean; - monitorRect: MontiorCoordinates; - name: string; - } - - interface MontiorCoordinates { - bottom: number; - left: number; - right: number; - top: number; - } - - interface VirtualScreenCoordinates { - left: number; - top: number; - } - - interface SystemBaseEvent { - topic: string; - type: OpenFinSystemEventType; - uuid: string; - } - - interface DesktopIconClickedEvent { - mouse: { - /** - * the left virtual screen coordinate of the mouse - */ - left: number, - /** - * the top virtual screen coordinate of the mouse - */ - top: number - }; - /** - * the number of milliseconds that have elapsed since the system was started, - */ - tickCount: number; - topic: "system"; - type: "desktop-icon-clicked"; - } - - interface IdleStateChangedEvent { - /** - * How long in milliseconds since the user has been idle. - */ - elapsedTime: number; - /** - * true when the user is idle,false when the user has returned; - */ - isIdle: boolean; - topic: "system"; - type: "idle-state-changed"; - } - - interface WindowBaseEvent { - /** - * the name of the window - */ - name: string; - /** - * always window - */ - topic: "window"; - /** - * window event type - */ - type: OpenFinWindowEventType; - /** - * the UUID of the application the window belongs to - */ - uuid: string; - } - - interface WindowAuthRequestedEvent extends WindowBaseEvent { - authInfo: { - host: string; - isProxy: boolean; - port: number; - realm: string; - scheme: string; - }; - } - - interface WindowBoundsEvent extends WindowBaseEvent { - /** - * describes what kind of change occurred. - * 0 means a change in position. - * 1 means a change in size. - * 2 means a change in position and size. - */ - changeType: number; - /** - * true when pending changes have been applied to the window. - */ - deferred: boolean; - /** - * the new height of the window. - */ - height: number; - /** - * the left-most coordinate of the window. - */ - left: number; - /** - * the top-most coordinate of the window. - */ - top: number; - - type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; - /** - * the new width of the window. - */ - width: number; - } - - interface WindowExternalProcessStartedEvent extends WindowBaseEvent { - /** - * the process handle uuid - */ - processUuid: string; - type: "external-process-started"; - } - - interface WindowExternalProcessExited extends WindowBaseEvent { - /** - * the process exit code - */ - exitCode: number; - /** - * the process handle uuid - */ - processUuid: string; - type: "external-process-exited"; - } - - interface WindowGroupChangedEvent extends WindowBaseEvent { - /** - * Which group array the window that the event listener was registered on is included in: - * 'source' The window is included in sourceGroup. - * 'target' The window is included in targetGroup. - * 'nothing' The window is not included in sourceGroup nor targetGroup. - */ - memberOf: "source" | "target" | "nothing"; - /** - * The reason this event was triggered. - * 'leave' A window has left the group due to a leave or merge with group. - * 'join' A window has joined the group. - * 'merge' Two groups have been merged together. - * 'disband' There are no other windows in the group. - */ - reason: "leave" | "join" | "merge" | "disband"; - /** - * All the windows in the group the sourceWindow originated from. - */ - sourceGroup: WindowOfGroupInfo[]; - /** - * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. - */ - sourceWindowAppUuid: string; - /** - * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. - */ - sourceWindowName: string; - /** - * All the windows in the group the targetWindow orginated from - */ - targetGroup: WindowOfGroupInfo[]; - /** - * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). - */ - targetWindowAppUuid: string; - /** - * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). - */ - targetWindowName: string; - type: "group-changed"; - } - - interface WindowOfGroupInfo { - /** - * The UUID of the application this window entry belongs to. - */ - appUuid: string; - /** - * The name of this window entry. - */ - windowName: string; - } - - interface WindowHiddenEvent extends WindowBaseEvent { - /** - * What action prompted the close. - * The reasons are: "hide", "hide-on-close" - */ - reason: "hide" | "hide-on-close"; - type: "hidden"; - } - - interface Window_NavigationRejectedEvent { - name: string; - /** - * source of navigation window name - */ - sourceName: string; - topic: "navigation-rejected"; - /** - * Url that was not reached "http://blocked-content.url" - */ - url: string; - /** - * the UUID of the application the window belongs to. - */ - uuid: string; - } - - interface AnimationTransition { - opacity?: { - /** - * This value is clamped from 0.0 to 1.0 - */ - opacity?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'opacity' as absolute or as a delta. Defaults to false. - */ - relative?: boolean; - }; - position?: { - /** - * Defaults to the window's current left position in virtual screen coordinates. - */ - left?: number; - /** - * Defaults to the window's current top position in virtual screen coordinates. - */ - top?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. - */ - relative?: boolean; - }; - size?: { - /** - * Optional if height is present. Defaults to the window's current width. - */ - width?: number; - /** - * Optional if width is present. Defaults to the window's current height. - */ - height?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. - */ - relative?: boolean; - }; - } - - interface AnimationOptions { - /** - * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. - */ - interrupt?: boolean; - /** - * Transition effect. Defaults to 'ease-in-out'. - */ - tween?: OpenFinTweenType; - } - - interface WindowBounds { - /** - * the height of the window. - */ - height?: number; - /** - * left-most coordinate of the window. - */ - left?: number; - /** - * top-most coordinate of the window. - */ - top?: number; - /** - * the width of the window. - */ - width?: number; - } - - interface SessionChangedEvent { - /** - * the action that triggered this event: - */ - reason: "lock" - | "unlock" - | "remote-connect" - | "remote-disconnect" - | "unknown"; - topic: "system"; - type: "session-changed"; - } - - interface LaunchInfo { - launchMode: "fin-protocol" - | "fins-protocol" - | "shortcut" - | "command-line" - | "adapter" - | "other" - | string; - } - - type OpenFinTweenType = "linear" - | "ease-in" - | "ease-out" - | "ease-in-out" - | "ease-in-quad" - | "ease-out-quad" - | "ease-in-out-quad" - | "ease-in-cubic" - | "ease-out-cubic" - | "ease-in-out-cubic" - | "ease-out-bounce" - | "ease-in-back" - | "ease-out-back" - | "ease-in-out-back" - | "ease-in-elastic" - | "ease-out-elastic" - | "ease-in-out-elastic"; - - type OpenFinApplicationEventType = "closed" - | "connected" - | "crashed" - | "initialized" - | "manifest-changed" - | "not-responding" - | "out-of-memory" - | "responding" - | "run-requested" - | "started" - | "tray-icon-clicked" - | "window-alert-requested" - | "window-auth-requested" - | "window-closed" - | "window-created" - | "window-end-load" - | "window-navigation-rejected" - | "window-show-requested" - | "window-start-load"; - - type OpenFinExternalApplicationEventType = "connected" - | "disconnected"; - - type OpenFinSystemEventType = "application-closed" - | "application-crashed" - | "application-created" - | "application-started" - | "desktop-icon-clicked" - | "idle-state-changed" - | "monitor-info-changed" - | "session-changed"; - - type OpenFinWindowEventType = "auth-requested" - | "blurred" - | "bounds-changed" - | "bounds-changing" - | "close-requested" - | "closed" - | "disabled-frame-bounds-changed" - | "disabled-frame-bounds-changing" - | "embedded" - | "external-process-exited" - | "external-process-started" - | "focused" - | "frame-disabled" - | "frame-enabled" - | "group-changed" - | "hidden" - | "initialized" - | "maximized" - | "minimized" - | "navigation-rejected" - | "restored" - | "show-requested" - | "shown"; - - type OpenFinAnchor = "top-left" - | "top-right" - | "bottom-left" - | "bottom-right"; -} From bacb3f54af840f2585caf4b2fa457157a7699d5a Mon Sep 17 00:00:00 2001 From: Justin Rockwood Date: Mon, 19 Mar 2018 20:00:59 -0700 Subject: [PATCH 0112/2153] fix(inquirer): add missing transformer function --- types/inquirer/index.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/inquirer/index.d.ts b/types/inquirer/index.d.ts index c0aba80f23..804f96411f 100644 --- a/types/inquirer/index.d.ts +++ b/types/inquirer/index.d.ts @@ -112,6 +112,12 @@ declare namespace inquirer { * The value returned will be added to the Answers hash. */ filter?(input: string): string | Promise; + /** + * Receive the user input and return the transformed value to be displayed to the user. The + * transformation only impacts what is shown while editing. It does not impact the answers + * hash. + */ + transformer?(input: string): string; /** * Receive the current user answers hash and should return true or false depending on whether or * not this question should be asked. The value can also be a simple boolean. From 054f23c54d01e69681daa8e18cb138fd051f3e1b Mon Sep 17 00:00:00 2001 From: Justin Rockwood Date: Mon, 19 Mar 2018 20:01:27 -0700 Subject: [PATCH 0113/2153] test(inquirer): add tests for added functionality --- types/inquirer/inquirer-tests.ts | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/types/inquirer/inquirer-tests.ts b/types/inquirer/inquirer-tests.ts index 7cc0fddd2a..aa545adae0 100644 --- a/types/inquirer/inquirer-tests.ts +++ b/types/inquirer/inquirer-tests.ts @@ -584,3 +584,45 @@ inquirer.prompt( console.log(JSON.stringify(answers, null, ' ')); } ); + +// +// Other tests not covered in the examples provided with inquirer +// + +// Tests promises from default, choices, validate, filter, and when + +interface AsyncAnswers { + choice: 'ONE' | 'TWO' | 'THREE'; + choseTwo: boolean; + confirmation: string; +} + +async function testAsyncPrompt(): Promise { + const answers: AsyncAnswers = await inquirer.prompt([ + { + type: 'list', + name: 'choice', + message: 'How many do you want?', + default: () => Promise.resolve('two'), + choices: () => Promise.resolve(['one', 'two', 'three']), + filter: (input: string) => Promise.resolve(input.toUpperCase()), + }, + { + type: 'confirm', + name: 'choseTwo', + message: 'Are you sure you want two?', + when: (choices: AsyncAnswers) => Promise.resolve(choices.choice === 'TWO'), + }, + { + type: 'input', + name: 'confirmation', + message: 'Type YES if you really, really want it', + validate: (input: string) => Promise.resolve(input.toUpperCase() === 'YES' ? true : 'Enter YES'), + transformer: (input: string) => input.toUpperCase(), + }, + ]); + + console.log(JSON.stringify(answers, null, ' ')); +} + +testAsyncPrompt(); From f6b30970cb0fbbfc2d6bf06c49edbfbf77b18b39 Mon Sep 17 00:00:00 2001 From: Todd Bealmear Date: Mon, 19 Mar 2018 21:09:25 -0700 Subject: [PATCH 0114/2153] :bug: Fix regression in Model.scope --- types/sequelize/index.d.ts | 2 +- types/sequelize/sequelize-tests.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index 7d72a0b096..7f0a5d6da4 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -3793,7 +3793,7 @@ declare namespace sequelize { * @return Model A reference to the model, with the scope(s) applied. Calling scope again on the returned * model will clear the previous scope. */ - scope(options?: string | ScopeOptions | AnyWhereOptions | Array): Model; + scope(options?: string | ScopeOptions | AnyWhereOptions | Array): this; /** * Search for multiple instances. diff --git a/types/sequelize/sequelize-tests.ts b/types/sequelize/sequelize-tests.ts index 5d1f6eed34..9436ea0306 100644 --- a/types/sequelize/sequelize-tests.ts +++ b/types/sequelize/sequelize-tests.ts @@ -10,10 +10,14 @@ import Bluebird = require('bluebird'); interface AnyAttributes { [name: string]: boolean | number | string | object; }; interface AnyInstance extends Sequelize.Instance { }; +interface UserModel extends Sequelize.Model { + findUser?(arbitraryThing: any): Promise; +} + var s = new Sequelize( '' ); var sequelize = s; var DataTypes = Sequelize; -var User = s.define( 'user', {} ); +var User: UserModel = s.define( 'user', {} ); var user = User.build(); var Task = s.define( 'task', {} ); var Group = s.define( 'group', {} ); @@ -893,6 +897,7 @@ User.addScope('lowAccessWithParam', function(id: number) { } ); User.scope( 'lowAccess' ).count(); +User.scope( 'lowAccess' ).findUser( 'foo' ); User.scope( { where : { parent_id : 2 } } ); User.scope( [ 'lowAccess', { method: ['lowAccessWithParam', 2] }, { where : { parent_id : 2 } } ] ) From e1f320d2d696601fc1a6008baf6e40954e0c1dbc Mon Sep 17 00:00:00 2001 From: pvavrik Date: Tue, 20 Mar 2018 09:16:47 +0100 Subject: [PATCH 0115/2153] Three: add ExtrudeBufferGeometry needed by TextBufferGeometry --- types/three/three-core.d.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index d16bc73140..0886cb63d5 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -6913,6 +6913,18 @@ export class ExtrudeGeometry extends Geometry { addShape(shape: Shape, options?: any): void; } +export class ExtrudeBufferGeometry extends BufferGeometry { + constructor(shapes?: Shape[], options?: any); + + static WorldUVGenerator: { + generateTopUV(geometry: Geometry, vertices: number[], indexA: number, indexB: number, indexC: number): Vector2[]; + generateSideWallUV(geometry: Geometry, vertices: number[], indexA: number, indexB: number, indexC: number, indexD: number): Vector2[]; + }; + + addShapeList(shapes: Shape[], options?: any): void; + addShape(shape: Shape, options?: any): void; +} + export class IcosahedronBufferGeometry extends PolyhedronBufferGeometry { constructor(radius?: number, detail?: number); } From 5e48bc7dcd71a91a94be913280efe4b00828e673 Mon Sep 17 00:00:00 2001 From: Bleser Date: Tue, 20 Mar 2018 16:04:55 +0500 Subject: [PATCH 0116/2153] Added type definition for function "pdf()" with buffer in callback. --- types/nightmare/index.d.ts | 1 + types/nightmare/nightmare-tests.ts | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/types/nightmare/index.d.ts b/types/nightmare/index.d.ts index 7be47c2d30..f3895b90c0 100644 --- a/types/nightmare/index.d.ts +++ b/types/nightmare/index.d.ts @@ -107,6 +107,7 @@ declare class Nightmare { html(path: string, saveType: 'MHTML'): Nightmare; pdf(path: string): Nightmare; pdf(path: string, options: Object): Nightmare; + pdf(cd:(err:Error, data:Buffer)=>void): Nightmare; title(): string; title(cb: (title: string) => void): Nightmare; url(cb: (url: string) => void): Nightmare; diff --git a/types/nightmare/nightmare-tests.ts b/types/nightmare/nightmare-tests.ts index 1dfe655c94..65391e8ef9 100644 --- a/types/nightmare/nightmare-tests.ts +++ b/types/nightmare/nightmare-tests.ts @@ -189,6 +189,14 @@ new Nightmare() .pdf('test/test.pdf') .run(done); +new Nightmare() + .goto("http://yahoo.com") + .pdf((err,data)=>{ + console.log(Buffer.isBuffer(data)) + }) + .run(done) + + new Nightmare() .goto('http://www.google.com/') .wait('input') From 96b71e75cdba7b4aeb17daf4a3500d20223ef1b2 Mon Sep 17 00:00:00 2001 From: Bleser Date: Tue, 20 Mar 2018 16:09:10 +0500 Subject: [PATCH 0117/2153] Correction --- types/nightmare/index.d.ts | 2 +- types/nightmare/nightmare-tests.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/types/nightmare/index.d.ts b/types/nightmare/index.d.ts index f3895b90c0..bb21444d88 100644 --- a/types/nightmare/index.d.ts +++ b/types/nightmare/index.d.ts @@ -107,7 +107,7 @@ declare class Nightmare { html(path: string, saveType: 'MHTML'): Nightmare; pdf(path: string): Nightmare; pdf(path: string, options: Object): Nightmare; - pdf(cd:(err:Error, data:Buffer)=>void): Nightmare; + pdf(cb: (err: Error, data: Buffer) => void): Nightmare; title(): string; title(cb: (title: string) => void): Nightmare; url(cb: (url: string) => void): Nightmare; diff --git a/types/nightmare/nightmare-tests.ts b/types/nightmare/nightmare-tests.ts index 65391e8ef9..81790dda5f 100644 --- a/types/nightmare/nightmare-tests.ts +++ b/types/nightmare/nightmare-tests.ts @@ -196,7 +196,6 @@ new Nightmare() }) .run(done) - new Nightmare() .goto('http://www.google.com/') .wait('input') From 857aabbfae57337c55cf7efef3df3627522bd098 Mon Sep 17 00:00:00 2001 From: Jan Lohage Date: Sat, 27 Jan 2018 20:34:11 +0100 Subject: [PATCH 0118/2153] [@feathersjs] add @feathersjs/socket-commons import to @feathersjs/socketio and @feathersjs/primus packages --- types/feathersjs__primus/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/feathersjs__primus/index.d.ts b/types/feathersjs__primus/index.d.ts index 5d93843822..1012be54e4 100644 --- a/types/feathersjs__primus/index.d.ts +++ b/types/feathersjs__primus/index.d.ts @@ -6,5 +6,7 @@ /// +/// + // primus removed its typings from the repo https://github.com/primus/primus/pull/623, as of 01/2018 there are none on DT export default function feathersPrimus(options: any, callback?: (primus: any) => void): () => void; From eedbe4b77476b6cf33771f1ec6e3648a13cbf9b6 Mon Sep 17 00:00:00 2001 From: Jan Lohage Date: Sat, 27 Jan 2018 20:38:08 +0100 Subject: [PATCH 0119/2153] [@feathersjs] really fix ts version in @feathersjs/socketio and @feathersjs/primus packages --- types/feathersjs__primus/index.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/types/feathersjs__primus/index.d.ts b/types/feathersjs__primus/index.d.ts index 1012be54e4..5d93843822 100644 --- a/types/feathersjs__primus/index.d.ts +++ b/types/feathersjs__primus/index.d.ts @@ -6,7 +6,5 @@ /// -/// - // primus removed its typings from the repo https://github.com/primus/primus/pull/623, as of 01/2018 there are none on DT export default function feathersPrimus(options: any, callback?: (primus: any) => void): () => void; From 39f4c4ccee47af000fefbe166bb409ae308cb034 Mon Sep 17 00:00:00 2001 From: Jan Lohage Date: Tue, 20 Mar 2018 13:05:44 +0100 Subject: [PATCH 0120/2153] @feathersjs/multiple correctly type behavior of combined commonJS and ES module default exports `module.exports.default = module.exports` --- types/feathersjs__authentication-client/index.d.ts | 4 +++- types/feathersjs__authentication-jwt/index.d.ts | 4 +++- types/feathersjs__authentication-local/index.d.ts | 4 +++- types/feathersjs__authentication-oauth1/index.d.ts | 4 +++- types/feathersjs__authentication-oauth2/index.d.ts | 4 +++- types/feathersjs__authentication/index.d.ts | 4 +++- types/feathersjs__express/index.d.ts | 4 +++- types/feathersjs__feathers/index.d.ts | 4 +++- 8 files changed, 24 insertions(+), 8 deletions(-) diff --git a/types/feathersjs__authentication-client/index.d.ts b/types/feathersjs__authentication-client/index.d.ts index 04275eb93c..9d1972bebc 100644 --- a/types/feathersjs__authentication-client/index.d.ts +++ b/types/feathersjs__authentication-client/index.d.ts @@ -3,8 +3,10 @@ // Definitions by: Abraao Alves , Jan Lohage // Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript // TypeScript Version: 2.3 +import * as self from '@feathersjs/authentication-client'; -export default function feathersAuthClient(config?: FeathersAuthClientConfig): () => void; +declare const feathersAuthClient: ((config?: FeathersAuthClientConfig) => () => void) & typeof self; +export default feathersAuthClient; export interface FeathersAuthClientConfig { storage?: Storage; diff --git a/types/feathersjs__authentication-jwt/index.d.ts b/types/feathersjs__authentication-jwt/index.d.ts index b55adeed46..ab6a7f6dbe 100644 --- a/types/feathersjs__authentication-jwt/index.d.ts +++ b/types/feathersjs__authentication-jwt/index.d.ts @@ -6,8 +6,10 @@ import { Application } from '@feathersjs/feathers'; import { Request } from 'express'; +import * as self from '@feathersjs/authentication-jwt'; -export default function feathersAuthenticationJwt(options?: FeathersAuthenticationJWTOptions): () => void; +declare const feathersAuthenticationJwt: ((options?: FeathersAuthenticationJWTOptions) => () => void) & typeof self; +export default feathersAuthenticationJwt; export interface FeathersAuthenticationJWTOptions { /** diff --git a/types/feathersjs__authentication-local/index.d.ts b/types/feathersjs__authentication-local/index.d.ts index e935419263..e15b101258 100644 --- a/types/feathersjs__authentication-local/index.d.ts +++ b/types/feathersjs__authentication-local/index.d.ts @@ -10,8 +10,10 @@ import { Paginated } from '@feathersjs/feathers'; import { Request } from 'express'; +import * as self from '@feathersjs/authentication-local'; -export default function feathersAuthenticationLocal(options?: FeathersAuthenticationLocalOptions): () => void; +declare const feathersAuthenticationLocal: ((options?: FeathersAuthenticationLocalOptions) => () => void) & typeof self; +export default feathersAuthenticationLocal; export interface FeathersAuthenticationLocalOptions { /** diff --git a/types/feathersjs__authentication-oauth1/index.d.ts b/types/feathersjs__authentication-oauth1/index.d.ts index eee59fd64a..fa993c1cd0 100644 --- a/types/feathersjs__authentication-oauth1/index.d.ts +++ b/types/feathersjs__authentication-oauth1/index.d.ts @@ -9,8 +9,10 @@ import { Paginated } from '@feathersjs/feathers'; import { Request } from 'express'; +import * as self from '@feathersjs/authentication-oauth1'; -export default function feathersAuthenticationOAuth1(options?: FeathersAuthenticationOAuth1Options): () => void; +declare const feathersAuthenticationOAuth1: ((options?: FeathersAuthenticationOAuth1Options) => () => void) & typeof self; +export default feathersAuthenticationOAuth1; export interface FeathersAuthenticationOAuth1Options { /** diff --git a/types/feathersjs__authentication-oauth2/index.d.ts b/types/feathersjs__authentication-oauth2/index.d.ts index fbce7514cd..3037c1c47a 100644 --- a/types/feathersjs__authentication-oauth2/index.d.ts +++ b/types/feathersjs__authentication-oauth2/index.d.ts @@ -9,8 +9,10 @@ import { Paginated } from '@feathersjs/feathers'; import { Request } from 'express'; +import * as self from '@feathersjs/authentication-oauth2'; -export default function feathersAuthenticationOAuth2(options?: FeathersAuthenticationOAuth2Options): () => void; +declare const feathersAuthenticationOAuth2: ((options?: FeathersAuthenticationOAuth2Options) => () => void) & typeof self; +export default feathersAuthenticationOAuth2; export interface FeathersAuthenticationOAuth2Options { /** diff --git a/types/feathersjs__authentication/index.d.ts b/types/feathersjs__authentication/index.d.ts index 3a4722f12e..f451b0deda 100644 --- a/types/feathersjs__authentication/index.d.ts +++ b/types/feathersjs__authentication/index.d.ts @@ -4,8 +4,10 @@ // Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript import { Hook } from '@feathersjs/feathers'; +import * as self from '@feathersjs/authentication'; -export default function feathersAuthentication(config?: FeathersAuthenticationOptions): () => void; +declare const feathersAuthentication: ((config?: FeathersAuthenticationOptions) => () => void) & typeof self; +export default feathersAuthentication; export const hooks: AuthHooks.Hooks; diff --git a/types/feathersjs__express/index.d.ts b/types/feathersjs__express/index.d.ts index f50203432f..693e863989 100644 --- a/types/feathersjs__express/index.d.ts +++ b/types/feathersjs__express/index.d.ts @@ -6,8 +6,10 @@ import { Application as FeathersApplication } from '@feathersjs/feathers'; import * as express from 'express'; +import * as self from '@feathersjs/express'; -export default function feathersExpress(app: FeathersApplication): Application; +declare const feathersExpress: ((app: FeathersApplication) => Application) & typeof self; +export default feathersExpress; export type Application = express.Application & FeathersApplication; export function errorHandler(options?: any): express.ErrorRequestHandler; diff --git a/types/feathersjs__feathers/index.d.ts b/types/feathersjs__feathers/index.d.ts index 6ae7b22238..c0fa3d9946 100644 --- a/types/feathersjs__feathers/index.d.ts +++ b/types/feathersjs__feathers/index.d.ts @@ -8,8 +8,10 @@ /// import { EventEmitter } from 'events'; +import * as self from '@feathersjs/feathers'; -export default function feathers(): Application; +declare const feathers: (() => Application) & typeof self; +export default feathers; export const version: string; From 85764dcd2b63e8548b4e3beb429d4617d9e914b7 Mon Sep 17 00:00:00 2001 From: Nicolas Graziano Date: Tue, 20 Mar 2018 18:17:28 +0100 Subject: [PATCH 0121/2153] [express-jwt] Correct error in callback for secret. Correct error for secret type in long callback. Split the callbacks in two interfaces. Add some test case. --- types/express-jwt/express-jwt-tests.ts | 21 ++++++++++++++++++++- types/express-jwt/index.d.ts | 6 ++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/types/express-jwt/express-jwt-tests.ts b/types/express-jwt/express-jwt-tests.ts index 798818b728..9de759adb2 100644 --- a/types/express-jwt/express-jwt-tests.ts +++ b/types/express-jwt/express-jwt-tests.ts @@ -13,6 +13,25 @@ app.use(jwt({ userProperty: 'auth' })); +app.use(jwt({ + secret: (req: express.Request, + payload: any, + done: (err: any, secret: string) => void) => { + done(null, 'shhhhhhared-secret'); + }, + userProperty: 'auth' +})); + +app.use(jwt({ + secret: (req: express.Request, + header: any, + payload: any, + done: (err: any, secret: string) => void) => { + done(null, 'shhhhhhared-secret'); + }, + userProperty: 'auth' +})); + var jwtCheck = jwt({ secret: 'shhhhhhared-secret' }); @@ -28,4 +47,4 @@ app.use(function (err: any, req: express.Request, res: express.Response, next: e } else { next(err); } -}); \ No newline at end of file +}); diff --git a/types/express-jwt/index.d.ts b/types/express-jwt/index.d.ts index de0a2dd337..33c1206254 100644 --- a/types/express-jwt/index.d.ts +++ b/types/express-jwt/index.d.ts @@ -12,8 +12,10 @@ export = jwt; declare function jwt(options: jwt.Options): jwt.RequestHandler; declare namespace jwt { export type secretType = string | Buffer + export interface SecretCallbackLong { + (req: express.Request, header: any, payload: any, done: (err: any, secret?: secretType) => void): void; + } export interface SecretCallback { - (req: express.Request, header: any, payload: any, done: (err: any, secret?: boolean) => void): void; (req: express.Request, payload: any, done: (err: any, secret?: secretType) => void): void; } @@ -25,7 +27,7 @@ declare namespace jwt { (req: express.Request): any; } export interface Options { - secret: secretType | SecretCallback; + secret: secretType | SecretCallback | SecretCallbackLong; userProperty?: string; skip?: string[]; credentialsRequired?: boolean; From a08dc13b212d796cc3747ae30d0915cb858ef566 Mon Sep 17 00:00:00 2001 From: TristonJ Date: Tue, 20 Mar 2018 10:33:26 -0700 Subject: [PATCH 0122/2153] [stellar-sdk] changeTrust limit should be optional --- types/stellar-sdk/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/stellar-sdk/index.d.ts b/types/stellar-sdk/index.d.ts index 955360d3f0..b098ea0896 100644 --- a/types/stellar-sdk/index.d.ts +++ b/types/stellar-sdk/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for stellar-sdk 0.8 // Project: https://github.com/stellar/js-stellar-sdk // Definitions by: Carl Foster +// Triston Jones // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -596,7 +597,7 @@ export namespace Operation { } interface ChangeTrustOptions { asset: Asset; - limit: string; + limit?: string; source?: string; } function changeTrust(options: ChangeTrustOptions): xdr.Operation; From 0cdf91a543126d20f7bbd61c8b24cf49ccf9dff8 Mon Sep 17 00:00:00 2001 From: Ben Gazzard Date: Tue, 20 Mar 2018 16:04:05 -0400 Subject: [PATCH 0123/2153] Expose the BlockMap type BlockMap is the return/parameter type of several draft functions. --- types/draft-js/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/draft-js/index.d.ts b/types/draft-js/index.d.ts index e545fa347d..aeb497cbe9 100644 --- a/types/draft-js/index.d.ts +++ b/types/draft-js/index.d.ts @@ -957,6 +957,7 @@ import ContentBlock = Draft.Model.ImmutableData.ContentBlock; import ContentState = Draft.Model.ImmutableData.ContentState; import SelectionState = Draft.Model.ImmutableData.SelectionState; import DraftInlineStyle = Draft.Model.ImmutableData.DraftInlineStyle; +import BlockMap = Draft.Model.ImmutableData.BlockMap; import AtomicBlockUtils = Draft.Model.Modifier.AtomicBlockUtils; import KeyBindingUtil = Draft.Component.Utils.KeyBindingUtil; @@ -1005,6 +1006,7 @@ export { ContentState, SelectionState, DraftInlineStyle, + BlockMap, AtomicBlockUtils, KeyBindingUtil, From dca48ce9743abc02d4349500e56cb074ad553ffc Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 20 Mar 2018 14:51:47 -0700 Subject: [PATCH 0124/2153] Added jsoneditor-for-react types --- types/jsoneditor-for-react/index.d.ts | 16 +++++++++++++ .../jsoneditor-for-react-tests.tsx | 4 ++++ types/jsoneditor-for-react/tsconfig.json | 23 +++++++++++++++++++ types/jsoneditor-for-react/tslint.json | 1 + 4 files changed, 44 insertions(+) create mode 100644 types/jsoneditor-for-react/index.d.ts create mode 100644 types/jsoneditor-for-react/jsoneditor-for-react-tests.tsx create mode 100644 types/jsoneditor-for-react/tsconfig.json create mode 100644 types/jsoneditor-for-react/tslint.json diff --git a/types/jsoneditor-for-react/index.d.ts b/types/jsoneditor-for-react/index.d.ts new file mode 100644 index 0000000000..cb5af6e2bb --- /dev/null +++ b/types/jsoneditor-for-react/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for jsoneditor-for-react 0.0.1 +// Project: https://github.com/mixj93/jsoneditor-for-react#readme +// Definitions by: JoshGoldberg +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as React from "react" +import JSONEditor, { JSONEditorOptions } from "jsoneditor" + +export interface IReactJsoneditorProps { + values: Object +} + +export default class ReactJsoneditor extends React.Component { + private editor?: JSONEditor + private options?: JSONEditorOptions +} diff --git a/types/jsoneditor-for-react/jsoneditor-for-react-tests.tsx b/types/jsoneditor-for-react/jsoneditor-for-react-tests.tsx new file mode 100644 index 0000000000..fc8211e628 --- /dev/null +++ b/types/jsoneditor-for-react/jsoneditor-for-react-tests.tsx @@ -0,0 +1,4 @@ +import * as React from "react"; +import ReactJsonEditor from "jsoneditor-for-react"; + +const component = ; diff --git a/types/jsoneditor-for-react/tsconfig.json b/types/jsoneditor-for-react/tsconfig.json new file mode 100644 index 0000000000..bc56d95c74 --- /dev/null +++ b/types/jsoneditor-for-react/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jsoneditor-for-react-tests.tsx" + ] +} diff --git a/types/jsoneditor-for-react/tslint.json b/types/jsoneditor-for-react/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jsoneditor-for-react/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From b87aa359830da2e05f7d60d8a3b8c282e3444c6a Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 20 Mar 2018 15:27:38 -0700 Subject: [PATCH 0125/2153] Bumped TS to version 2.6 --- types/jsoneditor-for-react/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/jsoneditor-for-react/index.d.ts b/types/jsoneditor-for-react/index.d.ts index cb5af6e2bb..731820af30 100644 --- a/types/jsoneditor-for-react/index.d.ts +++ b/types/jsoneditor-for-react/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/mixj93/jsoneditor-for-react#readme // Definitions by: JoshGoldberg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 import * as React from "react" import JSONEditor, { JSONEditorOptions } from "jsoneditor" From 7a98540cd08a2be909c0104964768a31dd8cee6f Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 20 Mar 2018 15:44:58 -0700 Subject: [PATCH 0126/2153] Added strictFunctionTypes --- types/jsoneditor-for-react/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/types/jsoneditor-for-react/tsconfig.json b/types/jsoneditor-for-react/tsconfig.json index bc56d95c74..7a855a2dc9 100644 --- a/types/jsoneditor-for-react/tsconfig.json +++ b/types/jsoneditor-for-react/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "jsx": "react", "typeRoots": [ From 2de73dedb7ade81167148adf6545130b1da42ee6 Mon Sep 17 00:00:00 2001 From: tonyholt Date: Tue, 20 Mar 2018 21:23:34 -0400 Subject: [PATCH 0127/2153] Select2 missing dataAdapter in Select2Options interface --- types/select2/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/select2/index.d.ts b/types/select2/index.d.ts index 51e297a9a8..1fe95ee6e8 100644 --- a/types/select2/index.d.ts +++ b/types/select2/index.d.ts @@ -94,6 +94,7 @@ interface Select2Options { dropdownAdapter?: any; selectionAdapter?: any; resultsAdapter?: any; + dataAdapter?: any; } interface Select2JQueryEventObject extends JQueryEventObject { From f2d6f88dc636fe2f68b913a717a578418f354d38 Mon Sep 17 00:00:00 2001 From: Abdulsattar Mohammed Date: Wed, 21 Mar 2018 11:48:50 +0530 Subject: [PATCH 0128/2153] Make renderTarget in setRenderTarget optional RenderTarget can be null in `WebGLRenderer` which can be used to unbind the frame buffer. It is actually used by `WebGLRenderer#render` which accepts a `null` `renderTarget` to and calls `setRenderTarget` with that null value. --- types/three/three-core.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 31c8cbebe0..57b060c597 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -5417,7 +5417,7 @@ export class WebGLRenderer implements Renderer { * @deprecated Use {@link WebGLRenderer#getRenderTarget .getRenderTarget()} instead. */ getCurrentRenderTarget(): RenderTarget; - setRenderTarget(renderTarget: RenderTarget): void; + setRenderTarget(renderTarget?: RenderTarget): void; readRenderTargetPixels( renderTarget: RenderTarget, x: number, y: number, width: number, height: number, buffer: any ): void; /** From 49e76eb838d9fdcc5a7a9975a11542eb14f660a2 Mon Sep 17 00:00:00 2001 From: pvavrik Date: Wed, 21 Mar 2018 10:09:37 +0100 Subject: [PATCH 0129/2153] Three: remove TextBufferGeometryParameters iface, reuse TextGeometryParameters instead --- types/three/three-core.d.ts | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 0886cb63d5..fe50f41a39 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -7133,19 +7133,8 @@ export class TextGeometry extends ExtrudeGeometry { }; } -export interface TextBufferGeometryParameters { - font?: Font; - size?: number; - height?: number; - curveSegments?: number; - bevelEnabled?: boolean; - bevelThickness?: number; - bevelSize?: number; - bevelSegments?: number; -} - export class TextBufferGeometry extends ExtrudeBufferGeometry { - constructor(text: string, parameters?: TextBufferGeometryParameters); + constructor(text: string, parameters?: TextGeometryParameters); parameters: { font: Font; From 050405d280b519bc3c7fd53f1152b3f65c4052d9 Mon Sep 17 00:00:00 2001 From: Margus Lamp Date: Wed, 21 Mar 2018 11:59:46 +0200 Subject: [PATCH 0130/2153] Changed types reflecting flow types, added validationRules --- .../express-graphql/express-graphql-tests.ts | 18 +++-- types/express-graphql/index.d.ts | 80 ++++++++++++++----- 2 files changed, 71 insertions(+), 27 deletions(-) diff --git a/types/express-graphql/express-graphql-tests.ts b/types/express-graphql/express-graphql-tests.ts index 6fdfc0d945..4ac6b38224 100644 --- a/types/express-graphql/express-graphql-tests.ts +++ b/types/express-graphql/express-graphql-tests.ts @@ -1,31 +1,35 @@ import express = require('express'); import 'express-session'; import graphqlHTTP = require('express-graphql'); +import { GraphQLSchema } from 'graphql/type/schema'; const app = express(); -const schema = {}; +const schema = {} as GraphQLSchema; -const graphqlOption: graphqlHTTP.OptionsObj = { +const graphqlOption: graphqlHTTP.OptionsData = { graphiql: true, schema: schema, formatError: (error: Error) => ({ message: error.message }), - extensions: (args) => { } + validationRules: [() => false, () => true], + extensions: ({ document, variables, operationName, result }) => ({ key: "value", key2: "value"}), }; -const graphqlOptionRequest = (request: express.Request, response: express.Response): graphqlHTTP.OptionsObj => ({ +const graphqlOptionRequest = (request: express.Request): graphqlHTTP.OptionsData => ({ graphiql: true, schema: schema, - context: request.session + context: request.session, + validationRules: [() => false, () => true], }); -const graphqlOptionRequestAsync = async (request: express.Request, response: express.Response): Promise => { +const graphqlOptionRequestAsync = async (request: express.Request): Promise => { return { graphiql: true, schema: await Promise.resolve(schema), context: request.session, - extensions: async (args) => { } + extensions: async (args) => { }, + validationRules: [() => false, () => true], }; }; diff --git a/types/express-graphql/index.d.ts b/types/express-graphql/index.d.ts index ade08f1729..cbb0409318 100644 --- a/types/express-graphql/index.d.ts +++ b/types/express-graphql/index.d.ts @@ -1,14 +1,15 @@ -// Type definitions for express-graphql -// Project: https://www.npmjs.org/package/express-graphql +// Type definitions for express-graphql 0.6.12 +// Project: https://github.com/graphql/express-graphql // Definitions by: Isman Usoh // Nitin Tutlani // Daniel Fader // Ehsan Ziya +// Margus Lamp // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 import { Request, Response } from "express"; - +import { DocumentNode, GraphQLSchema, GraphQLError } from 'graphql'; export = graphqlHTTP; declare namespace graphqlHTTP { @@ -16,12 +17,15 @@ declare namespace graphqlHTTP { * Used to configure the graphQLHTTP middleware by providing a schema * and other configuration options. */ - export type Options = ((req: Request, res: Response) => OptionsObj) | ((req: Request, res: Response) => Promise) | OptionsObj - export type OptionsObj = { + export type Options = ((request: Request, + response: Response, + params?: GraphQLParams) => OptionsResult) | OptionsResult; + export type OptionsResult = OptionsData | Promise; + export type OptionsData = { /** * A GraphQL schema from graphql-js. */ - schema: Object, + schema: GraphQLSchema, /** * A value to pass as the context to the graphql() function. @@ -43,27 +47,63 @@ declare namespace graphqlHTTP { * fulfilling a GraphQL operation. If no function is provided, GraphQL's * default spec-compliant `formatError` function will be used. */ - formatError?: Function, + formatError?: (error: GraphQLError) => any, + + /** + * An optional array of validation rules that will be applied on the document + * in additional to those defined by the GraphQL spec. + */ + validationRules?: any[], + + /** + * An optional function for adding additional metadata to the GraphQL response + * as a key-value object. The result will be added to "extensions" field in + * the resulting JSON. This is often a useful place to add development time + * info such as the runtime of a query or the amount of resources consumed. + * + * Information about the request is provided to be used. + * + * This function may be async. + */ + extensions?: (info: RequestInfo) => { [key: string]: any }, /** * A boolean to optionally enable GraphiQL mode. */ graphiql?: boolean, - - /** - * An optional function for adding additional metadata to the GraphQL response as a key-value object. - * The result will be added to "extensions" field in the resulting JSON. - */ - extensions?: ((args: ExtenstionsArgs) => any) | ((args: ExtenstionsArgs) => Promise); - }; - interface ExtenstionsArgs { - document: object, - variables: object, - operationName: any, - result: object - } + /** + * All information about a GraphQL request. + */ + export type RequestInfo = { + /** + * The parsed GraphQL document. + */ + document?: DocumentNode, + + /** + * The variable values used at runtime. + */ + variables?: { [name: string]: any }, + + /** + * The (optional) operation name requested. + */ + operationName?: string, + + /** + * The result of executing the operation. + */ + result?: any, + }; + + export type GraphQLParams = { + query?: string, + variables?: { [name: string]: any }, + operationName?: string, + raw?: boolean, + }; type Middleware = (request: Request, response: Response) => void; } From e6b06f80d9ef0d5331f8fec9a7708c91c0c05262 Mon Sep 17 00:00:00 2001 From: Margus Lamp Date: Wed, 21 Mar 2018 13:25:29 +0200 Subject: [PATCH 0131/2153] Removing some of the tslint rules, for better code --- .../express-graphql/express-graphql-tests.ts | 16 +++- types/express-graphql/index.d.ts | 60 +++++++-------- types/express-graphql/tslint.json | 75 +------------------ 3 files changed, 44 insertions(+), 107 deletions(-) diff --git a/types/express-graphql/express-graphql-tests.ts b/types/express-graphql/express-graphql-tests.ts index 4ac6b38224..1557c4c0ac 100644 --- a/types/express-graphql/express-graphql-tests.ts +++ b/types/express-graphql/express-graphql-tests.ts @@ -4,11 +4,21 @@ import graphqlHTTP = require('express-graphql'); import { GraphQLSchema } from 'graphql/type/schema'; const app = express(); -const schema = {} as GraphQLSchema; +const schema: GraphQLSchema = { + getQueryType: null, + getMutationType: null, + getSubscriptionType: null, + getTypeMap: null, + getType: null, + getPossibleTypes: null, + isPossibleType: null, + getDirective: null, + getDirectives: null, +}; const graphqlOption: graphqlHTTP.OptionsData = { graphiql: true, - schema: schema, + schema, formatError: (error: Error) => ({ message: error.message }), @@ -18,7 +28,7 @@ const graphqlOption: graphqlHTTP.OptionsData = { const graphqlOptionRequest = (request: express.Request): graphqlHTTP.OptionsData => ({ graphiql: true, - schema: schema, + schema, context: request.session, validationRules: [() => false, () => true], }); diff --git a/types/express-graphql/index.d.ts b/types/express-graphql/index.d.ts index cbb0409318..4b2d10c99b 100644 --- a/types/express-graphql/index.d.ts +++ b/types/express-graphql/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for express-graphql 0.6.12 +// Type definitions for express-graphql 0.6 // Project: https://github.com/graphql/express-graphql // Definitions by: Isman Usoh // Nitin Tutlani @@ -21,39 +21,39 @@ declare namespace graphqlHTTP { response: Response, params?: GraphQLParams) => OptionsResult) | OptionsResult; export type OptionsResult = OptionsData | Promise; - export type OptionsData = { + export interface OptionsData { /** * A GraphQL schema from graphql-js. */ - schema: GraphQLSchema, + schema: GraphQLSchema; /** * A value to pass as the context to the graphql() function. */ - context?: Object, + context?: any; /** * An object to pass as the rootValue to the graphql() function. */ - rootValue?: Object, + rootValue?: any; /** * A boolean to configure whether the output should be pretty-printed. */ - pretty?: boolean, + pretty?: boolean; /** * An optional function which will be used to format any errors produced by * fulfilling a GraphQL operation. If no function is provided, GraphQL's * default spec-compliant `formatError` function will be used. */ - formatError?: (error: GraphQLError) => any, + formatError?: (error: GraphQLError) => any; /** * An optional array of validation rules that will be applied on the document * in additional to those defined by the GraphQL spec. */ - validationRules?: any[], + validationRules?: any[]; /** * An optional function for adding additional metadata to the GraphQL response @@ -65,51 +65,51 @@ declare namespace graphqlHTTP { * * This function may be async. */ - extensions?: (info: RequestInfo) => { [key: string]: any }, + extensions?: (info: RequestInfo) => { [key: string]: any }; /** * A boolean to optionally enable GraphiQL mode. */ - graphiql?: boolean, - }; + graphiql?: boolean; + } /** * All information about a GraphQL request. */ - export type RequestInfo = { + export interface RequestInfo { /** * The parsed GraphQL document. */ - document?: DocumentNode, - + document?: DocumentNode; + /** * The variable values used at runtime. */ - variables?: { [name: string]: any }, - + variables?: { [name: string]: any }; + /** * The (optional) operation name requested. */ - operationName?: string, - + operationName?: string; + /** * The result of executing the operation. */ - result?: any, - }; - - export type GraphQLParams = { - query?: string, - variables?: { [name: string]: any }, - operationName?: string, - raw?: boolean, - }; + result?: any; + } + + export interface GraphQLParams { + query?: string; + variables?: { [name: string]: any }; + operationName?: string; + raw?: boolean; + } type Middleware = (request: Request, response: Response) => void; } /** -* Middleware for express; takes an options object or function as input to -* configure behavior, and returns an express middleware. -*/ + * Middleware for express; takes an options object or function as input to + * configure behavior, and returns an express middleware. + */ declare function graphqlHTTP(options: graphqlHTTP.Options): graphqlHTTP.Middleware; diff --git a/types/express-graphql/tslint.json b/types/express-graphql/tslint.json index a41bf5d19a..4c4fc86ace 100644 --- a/types/express-graphql/tslint.json +++ b/types/express-graphql/tslint.json @@ -1,79 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "strict-export-declare-modifiers": false } } From 3a4346adbc05847d5724f69857be817ef0c74cdf Mon Sep 17 00:00:00 2001 From: Johannes Maximilian Toball Date: Wed, 21 Mar 2018 13:39:21 +0100 Subject: [PATCH 0132/2153] visible and exists have optional callback --- types/nightmare/index.d.ts | 6 +++--- types/nightmare/nightmare-tests.ts | 14 ++++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/types/nightmare/index.d.ts b/types/nightmare/index.d.ts index 061f22bd10..0ed68ef33b 100644 --- a/types/nightmare/index.d.ts +++ b/types/nightmare/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Nightmare 2.10.0 +// Type definitions for Nightmare 2.10.1 // Project: https://github.com/segmentio/nightmare // Definitions by: horiuchi // Sam Yang @@ -57,8 +57,8 @@ declare class Nightmare { run(cb?: (err: any, nightmare: Nightmare) => void): Nightmare; // Extract - exists(selector: string, cb: (result: boolean) => void): Nightmare; - visible(selector: string, cb: (result: boolean) => void): Nightmare; + exists(selector: string, cb?: (result: boolean) => void): Nightmare; + visible(selector: string, cb?: (result: boolean) => void): Nightmare; on(event: string, cb: () => void): Nightmare; on(event: 'initialized', cb: () => void): Nightmare; on(event: 'loadStarted', cb: () => void): Nightmare; diff --git a/types/nightmare/nightmare-tests.ts b/types/nightmare/nightmare-tests.ts index 7eb376b996..ba7cc4998c 100644 --- a/types/nightmare/nightmare-tests.ts +++ b/types/nightmare/nightmare-tests.ts @@ -52,6 +52,16 @@ new Nightmare() }) .run(done); +new Nightmare() + .goto('http://www.wikipedia.org/') + .exists('a.link-box') + .then((exists: boolean) => { }) + +new Nightmare() + .goto('http://www.wikipedia.org/') + .visible('a.link-box') + .then((isVisible: boolean) => { }) + new Nightmare() .goto('http://www.wikipedia.org/') .title(function (title) { @@ -387,7 +397,3 @@ new Nightmare({ executionTimeout: 1000 }) }, 2000) }) }) - - - - From 17805e6b66c507944861b965495cd7a2cb9c1bb9 Mon Sep 17 00:00:00 2001 From: Chris Moyer Date: Wed, 21 Mar 2018 10:24:37 -0400 Subject: [PATCH 0133/2153] Adds _enableImpersonation config option for auth0-lock This is available as of Lock 11.4. --- types/auth0-lock/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/auth0-lock/index.d.ts b/types/auth0-lock/index.d.ts index 7dd99af9e6..dd3e6aa7ee 100644 --- a/types/auth0-lock/index.d.ts +++ b/types/auth0-lock/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for auth0-lock 10.16 +// Type definitions for auth0-lock 11.4 // Project: http://auth0.com // Definitions by: Brian Caruso // Dan Caddigan @@ -143,6 +143,7 @@ interface Auth0LockConstructorOptions { socialButtonStyle?: "big" | "small"; theme?: Auth0LockThemeOptions; usernameStyle?: string; + _enableImpersonation?: boolean; } interface Auth0LockFlashMessageOptions { From b1c423f0f9e2b07671ba56c72d94cf5e6ef72800 Mon Sep 17 00:00:00 2001 From: marcofalsitta Date: Thu, 22 Mar 2018 08:23:27 +0100 Subject: [PATCH 0134/2153] master: adding size option to LocalDatabaseConfiguration --- types/pouchdb-core/index.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/pouchdb-core/index.d.ts b/types/pouchdb-core/index.d.ts index e636c3e7c1..4b1d56d860 100644 --- a/types/pouchdb-core/index.d.ts +++ b/types/pouchdb-core/index.d.ts @@ -514,6 +514,12 @@ declare namespace PouchDB { * How many old revisions we keep track (not a copy) of. */ revs_limit?: number; + /** + * Size of the database (Most significant for Safari) + * option to set the max size in MB that Safari will grant to the local database. Valid options are: 10, 50, 100, 500 and 1000 + * ex_ new PouchDB("dbName", {size:100}); + */ + size?: number; } interface RemoteRequesterConfiguration { From 94588ea50dc064f0de21cf79a33e2476ac71d8dd Mon Sep 17 00:00:00 2001 From: Edward Sammut Alessi Date: Thu, 22 Mar 2018 12:08:08 +0100 Subject: [PATCH 0135/2153] Steamid typings --- types/steamid/index.d.ts | 134 +++++++++++++++++++++++++++++++++ types/steamid/steamid-tests.ts | 19 +++++ types/steamid/tsconfig.json | 23 ++++++ types/steamid/tslint.json | 1 + 4 files changed, 177 insertions(+) create mode 100644 types/steamid/index.d.ts create mode 100644 types/steamid/steamid-tests.ts create mode 100644 types/steamid/tsconfig.json create mode 100644 types/steamid/tslint.json diff --git a/types/steamid/index.d.ts b/types/steamid/index.d.ts new file mode 100644 index 0000000000..37967db201 --- /dev/null +++ b/types/steamid/index.d.ts @@ -0,0 +1,134 @@ +// Type definitions for steamid 1.1 +// Project: https://github.com/DoctorMcKay/node-steamid +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/** + * Render this SteamID into Steam2 textual format + * @param newerFormat [newerFormat=false] - true if you want to use 1 in place of the leading 0 for the public universe + */ +type getSteam2RenderedID = (newerFormat?: boolean) => string; + +/** + * Render this SteamID into Steam3 textual format + */ +type getSteam3RenderedID = () => string; + +/** + * Render this SteamID into 64-bit numeric format + */ +type getSteamID64 = () => string; + +declare class SteamID { + universe: SteamID.Universe; + type: SteamID.Type; + instance: SteamID.Instance; + accountid: number; + + /** + * You can create a SteamID object from a Steam2 rendered ID, a Steam3 rendered ID, a SteamID64, or from the four parts that make up a SteamID. + * @param input SteamID string + */ + constructor(input: string); + + /** + * Check whether this SteamID is valid (according to Steam's rules) + */ + isValid(): boolean; + + /** + * Check whether this chat SteamID is tied to a Steam group. + */ + isGroupChat(): boolean; + + /** + * Check whether this chat SteamID is a Steam lobby. + */ + isLobby(): boolean; + + getSteam2RenderedID: getSteam2RenderedID; + steam2: getSteam2RenderedID; + + getSteam3RenderedID: getSteam3RenderedID; + steam3: getSteam3RenderedID; + + getSteamID64: getSteamID64; + toString: getSteamID64; +} + +declare namespace SteamID { + // Universe constants + enum Universe { + INVALID = 0, + PUBLIC = 1, + BETA = 2, + INTERNAL = 3, + DEV = 4, + } + + // Type constants + enum Type { + INVALID = 0, + INDIVIDUAL = 1, + MULTISEAT = 2, + GAMESERVER = 3, + ANON_GAMESERVER = 4, + PENDING = 5, + CONTENT_SERVER = 6, + CLAN = 7, + CHAT = 8, + P2P_SUPER_SEEDER = 9, + ANON_USER = 10, + } + + // Instance constants + enum Instance { + ALL = 0, + DESKTOP = 1, + CONSOLE = 2, + WEB = 4, + } + + // Type chars + enum TypeChars { + I = Type.INVALID, + U = Type.INDIVIDUAL, + M = Type.MULTISEAT, + G = Type.GAMESERVER, + A = Type.ANON_GAMESERVER, + P = Type.PENDING, + C = Type.CONTENT_SERVER, + g = Type.CLAN, + T = Type.CHAT, + a = Type.ANON_USER, + } + + const AccountIDMask = 0xFFFFFFFF; + const AccountInstanceMask = 0x000FFFFF; + + enum ChatInstanceFlags { + /** + * (AccountInstanceMask + 1) >> 1 + */ + Clan = (0x000FFFFF + 1) >> 1, + + /** + * (AccountInstanceMask + 1) >> 2 + */ + Lobby = (0x000FFFFF + 1) >> 2, + + /** + * (AccountInstanceMask + 1) >> 3 + */ + MMSLobby = (0x000FFFFF + 1) >> 3, + } + + /** + * Create an individual SteamID in the public universe given an accountid + * @param accountid - The user's account ID + */ + function fromIndividualAccountID(accountid: number | string): SteamID; +} + +export = SteamID; diff --git a/types/steamid/steamid-tests.ts b/types/steamid/steamid-tests.ts new file mode 100644 index 0000000000..bbf556c100 --- /dev/null +++ b/types/steamid/steamid-tests.ts @@ -0,0 +1,19 @@ +import SteamID = require("steamid"); + +let sid: SteamID; + +sid = new SteamID("76561198006409530"); +sid = SteamID.fromIndividualAccountID(46143802); + +sid.universe = SteamID.Universe.PUBLIC; +sid.type = SteamID.Type.INDIVIDUAL; +sid.instance = SteamID.Instance.DESKTOP; +sid.accountid = 46143802; + +sid.isValid(); +sid.isGroupChat(); +sid.isLobby(); +sid.getSteam2RenderedID(); +sid.getSteam2RenderedID(true); +sid.getSteam3RenderedID(); +sid.getSteamID64(); diff --git a/types/steamid/tsconfig.json b/types/steamid/tsconfig.json new file mode 100644 index 0000000000..dca75b64b2 --- /dev/null +++ b/types/steamid/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "steamid-tests.ts" + ] +} diff --git a/types/steamid/tslint.json b/types/steamid/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/steamid/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 9456c18a19a0b6087e9369fa43feb7e63bf4ec56 Mon Sep 17 00:00:00 2001 From: Aaron Reisman Date: Thu, 22 Mar 2018 20:00:02 +0700 Subject: [PATCH 0136/2153] Update index.d.ts --- types/i18next-express-middleware/index.d.ts | 192 +++++++++++--------- 1 file changed, 109 insertions(+), 83 deletions(-) diff --git a/types/i18next-express-middleware/index.d.ts b/types/i18next-express-middleware/index.d.ts index f9877b2659..d28a334429 100644 --- a/types/i18next-express-middleware/index.d.ts +++ b/types/i18next-express-middleware/index.d.ts @@ -5,104 +5,130 @@ // TypeScript Version: 2.3 declare namespace I18next { - interface I18nextOptions extends i18nextExpressMiddleware.I18nextOptions { } + interface I18nextOptions extends i18nextExpressMiddleware.I18nextOptions {} } declare namespace i18nextExpressMiddleware { - /** - * @summary Interface for Language detector options. - * @interface - */ - interface LanguageDetectorOptions { - caches?: Array|boolean; - cookieDomain?: string; - cookieExpirationDate?: Date; - lookupCookie?: string; - lookupFromPathIndex?: number; - lookupQuerystring?: string; - lookupSession?: string; - order?: Array; - } + /** + * @summary Interface for Language detector options. + * @interface + */ + interface LanguageDetectorOptions { + caches?: Array | boolean + cookieDomain?: string + cookieExpirationDate?: Date + lookupCookie?: string + lookupFromPathIndex?: number + lookupQuerystring?: string + lookupSession?: string + order?: Array + } - /** - * @summary i18next options. - * @interface - */ - interface I18nextOptions { - detection?: LanguageDetectorOptions; - } + /** + * @summary i18next options. + * @interface + */ + interface I18nextOptions { + detection?: LanguageDetectorOptions + } } -declare module "i18next-express-middleware" { - import express = require("express"); - import i18next = require("i18next"); +declare module 'i18next-express-middleware' { + import express = require('express') + import i18next = require('i18next') + + /** + * @summary Interface for middleware to use i18next in express.js. + * @interface + */ + export interface i18nextExpressMiddleware { + LanguageDetector(): express.Handler + missingKeyHandler(): express.Handler + } + + /** + * @summary Interface for own detection functionality. + */ + export interface i18nextCustomDetection { + name: string + lookup: ( + req: express.Request, + res: express.Response, + options?: Object + ) => void + cacheUserLanguage: ( + req: express.Request, + res: express.Response, + lng?: any, + options?: Object + ) => void + } + + /** + * @summary Detects user language from current request. + * @class + */ + export class LanguageDetector { + /** + * @summary Constructor. + * @constructor + * @param {any} services The services. + * @param {Object} options The options. + * @param {Object} allOptions The all options. + */ + constructor(services?: any, options?: Object, allOptions?: Object) /** - * @summary Interface for middleware to use i18next in express.js. - * @interface + * @summary Adds detector. + * @param {i18nextCustomDetection} detector The detector to add. */ - export interface i18nextExpressMiddleware { - LanguageDetector(): express.Handler; - missingKeyHandler(): express.Handler; - } + addDetector(detector: i18nextCustomDetection): void + + // NOTE: add documentation + cacheUserLanguage( + req: express.Request, + res: express.Response, + detectionOrder: any + ): void /** - * @summary Interface for own detection functionality. + * @summary Detects the language. + * @param {Request} req The HTTP request. + * @param {Response} res The HTTP response. + * @param {detectionOrder} detectionOrder The detection order. */ - export interface i18nextCustomDetection { - name: string; - lookup: (req: express.Request, res: express.Response, options?: Object) => void; - cacheUserLanguage: (req: express.Request, res: express.Response, lng?: any, options?: Object) => void; - } + detect( + req: express.Request, + res: express.Response, + detectionOrder: any + ): void /** - * @summary Detects user language from current request. - * @class + * @summary Initializes class. + * @param {any} services The services. + * @param {Object} options The options. + * @param {Object} allOptions The all options. */ - export class LanguageDetector { - /** - * @summary Constructor. - * @constructor - * @param {any} services The services. - * @param {Object} options The options. - * @param {Object} allOptions The all options. - */ - constructor(services?: any, options?: Object, allOptions?: Object); + init(services: any, options?: Object, allOptions?: Object): void + } - /** - * @summary Adds detector. - * @param {i18nextCustomDetection} detector The detector to add. - */ - addDetector(detector: i18nextCustomDetection): void; + export function getResourcesHandler( + i18next: i18next.i18n, + options: Object + ): express.Handler + export function handle( + i18next: i18next.i18n, + options?: Object + ): express.Handler - // NOTE: add documentation - cacheUserLanguage(req: express.Request, res: express.Response, detectionOrder: any): void; - - /** - * @summary Detects the language. - * @param {Request} req The HTTP request. - * @param {Response} res The HTTP response. - * @param {detectionOrder} detectionOrder The detection order. - */ - detect(req: express.Request, res: express.Response, detectionOrder: any): void; - - /** - * @summary Initializes class. - * @param {any} services The services. - * @param {Object} options The options. - * @param {Object} allOptions The all options. - */ - init(services: any, options?: Object, allOptions?: Object): void; - } - - export function getResourcesHandler(i18next: i18next.i18n, options: Object): express.Handler; - export function handle(i18next: i18next.i18n, options?: Object): express.Handler; - - /** - * @summary Gets handler for missing key. - * @param {I18nextStatic} i18next The i18next. - * @param {Object} options The options. - * @return {express.Handler} The express handler. - */ - export function missingKeyHandler(i18next: i18next.i18n, options: Object): express.Handler; + /** + * @summary Gets handler for missing key. + * @param {I18nextStatic} i18next The i18next. + * @param {Object} options The options. + * @return {express.Handler} The express handler. + */ + export function missingKeyHandler( + i18next: i18next.i18n, + options?: Object + ): express.Handler } From 1e7e3727777e6e95cf289dc47038a0474a5ba989 Mon Sep 17 00:00:00 2001 From: Valentin Sundermann Date: Thu, 22 Mar 2018 15:56:40 +0100 Subject: [PATCH 0137/2153] Change return type of valueOf to bigi --- types/bigi/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/bigi/index.d.ts b/types/bigi/index.d.ts index c991b13fac..7b44ff75e4 100644 --- a/types/bigi/index.d.ts +++ b/types/bigi/index.d.ts @@ -87,7 +87,7 @@ declare class bigi { static fromDERInteger(byteArray?: any): number; static fromHex(hex: string): bigi; static isBigInteger(obj: any, check_ver: any): obj is bigi; - static valueOf(i: any): number; + static valueOf(i: any): bigi; } declare namespace bigi { interface Constants { From 0eb9a227403ee4430624fbb7fe16b13941e4586e Mon Sep 17 00:00:00 2001 From: Valentin Sundermann Date: Thu, 22 Mar 2018 15:57:25 +0100 Subject: [PATCH 0138/2153] Expand tests to cover the previous change --- types/bigi/bigi-tests.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types/bigi/bigi-tests.ts b/types/bigi/bigi-tests.ts index ef9d7421d3..0e4822aeb6 100644 --- a/types/bigi/bigi-tests.ts +++ b/types/bigi/bigi-tests.ts @@ -7,3 +7,10 @@ const b3 = b1.multiply(b2); console.log(b3.toHex()); // => ae499bfe762edfb416d0ce71447af67ff33d1760cbebd70874be1d7a5564b0439a59808cb1856a91974f7023f72132 + +const b4 = BigInteger.valueOf(42); +const b5 = BigInteger.valueOf(10); +const b6 = b4.multiply(b5); + +console.log(b6); +// => BigInteger { '0': 420, '1': 0, t: 1, s: 0 } From 2efa8936a13d2f8273b04d626658e31f06930780 Mon Sep 17 00:00:00 2001 From: Behind The Math Date: Thu, 22 Mar 2018 15:53:25 -0400 Subject: [PATCH 0139/2153] Remove the need for lint exception --- types/sqlite3/index.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/sqlite3/index.d.ts b/types/sqlite3/index.d.ts index d4fb7c9599..8b988b5b22 100644 --- a/types/sqlite3/index.d.ts +++ b/types/sqlite3/index.d.ts @@ -88,8 +88,7 @@ export class Database extends events.EventEmitter { export function verbose(): sqlite3; -// tslint:disable-next-line:strict-export-declare-modifiers -interface sqlite3 { +export interface sqlite3 { OPEN_READONLY: number; OPEN_READWRITE: number; OPEN_CREATE: number; From dbb40c14f8a9901796e293d64adcad9c1fe9b789 Mon Sep 17 00:00:00 2001 From: Michael Zabka Date: Thu, 22 Mar 2018 21:17:22 +0100 Subject: [PATCH 0140/2153] Allow omit second key argument in crypto-js Hash functions * Fixes DefinitelyTyped/DefinitelyTyped#24425 --- types/crypto-js/crypto-js-tests.ts | 2 ++ types/crypto-js/index.d.ts | 52 +++++++++++++++++++----------- 2 files changed, 36 insertions(+), 18 deletions(-) diff --git a/types/crypto-js/crypto-js-tests.ts b/types/crypto-js/crypto-js-tests.ts index 9b5dd1be6f..59f1d684ed 100644 --- a/types/crypto-js/crypto-js-tests.ts +++ b/types/crypto-js/crypto-js-tests.ts @@ -4,9 +4,11 @@ import CryptoJS = require('crypto-js'); var wordArray: CryptoJS.WordArray; wordArray = CryptoJS.MD5('some message'); wordArray = CryptoJS.MD5('some message', 'some key'); +wordArray = CryptoJS.MD5('some message', { any: true }); wordArray = CryptoJS.SHA1('some message'); wordArray = CryptoJS.SHA1('some message', 'some key', { any: true }); +wordArray = CryptoJS.SHA1('some message', { any: true }); wordArray = CryptoJS.format.OpenSSL('some message'); wordArray = CryptoJS.format.OpenSSL('some message', 'some key'); diff --git a/types/crypto-js/index.d.ts b/types/crypto-js/index.d.ts index c066204df2..db9ed6c30e 100644 --- a/types/crypto-js/index.d.ts +++ b/types/crypto-js/index.d.ts @@ -8,7 +8,6 @@ export as namespace CryptoJS; declare var CryptoJS: CryptoJS.Hashes; declare namespace CryptoJS { - type Hash = (message: string | LibWordArray, key?: string | WordArray, ...options: any[]) => WordArray; interface Cipher { encrypt(message: string, secretPassphrase: string | WordArray, option?: CipherOption): WordArray; decrypt(encryptedMessage: string | WordArray, secretPassphrase: string | WordArray, option?: CipherOption): DecryptedMessage; @@ -54,23 +53,40 @@ declare namespace CryptoJS { interface Padding {} export interface Hashes { - MD5: Hash; - SHA1: Hash; - SHA256: Hash; - SHA224: Hash; - SHA512: Hash; - SHA384: Hash; - SHA3: Hash; - RIPEMD160: Hash; - HmacMD5: Hash; - HmacSHA1: Hash; - HmacSHA256: Hash; - HmacSHA224: Hash; - HmacSHA512: Hash; - HmacSHA384: Hash; - HmacSHA3: Hash; - HmacRIPEMD160: Hash; - PBKDF2: Hash; + MD5(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + MD5(message: string | LibWordArray, ...options: any[]): WordArray; + SHA1(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + SHA1(message: string | LibWordArray, ...options: any[]): WordArray; + SHA256(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + SHA256(message: string | LibWordArray, ...options: any[]): WordArray; + SHA224(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + SHA224(message: string | LibWordArray, ...options: any[]): WordArray; + SHA512(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + SHA512(message: string | LibWordArray, ...options: any[]): WordArray; + SHA384(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + SHA384(message: string | LibWordArray, ...options: any[]): WordArray; + SHA3(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + SHA3(message: string | LibWordArray, ...options: any[]): WordArray; + RIPEMD160(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + RIPEMD160(message: string | LibWordArray, ...options: any[]): WordArray; + HmacMD5(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacMD5(message: string | LibWordArray, ...options: any[]): WordArray; + HmacSHA1(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacSHA1(message: string | LibWordArray, ...options: any[]): WordArray; + HmacSHA256(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacSHA256(message: string | LibWordArray, ...options: any[]): WordArray; + HmacSHA224(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacSHA224(message: string | LibWordArray, ...options: any[]): WordArray; + HmacSHA512(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacSHA512(message: string | LibWordArray, ...options: any[]): WordArray; + HmacSHA384(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacSHA384(message: string | LibWordArray, ...options: any[]): WordArray; + HmacSHA3(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacSHA3(message: string | LibWordArray, ...options: any[]): WordArray; + HmacRIPEMD160(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacRIPEMD160(message: string | LibWordArray, ...options: any[]): WordArray; + PBKDF2(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + PBKDF2(message: string | LibWordArray, ...options: any[]): WordArray; AES: Cipher; DES: Cipher; TripleDES: Cipher; From e1806c890eadd0e83c4af8512feee44621b13ac1 Mon Sep 17 00:00:00 2001 From: Alvis HT Tang Date: Thu, 22 Mar 2018 23:48:26 +0000 Subject: [PATCH 0141/2153] highland: add the definition for the new isNil() for type guarding This commit add the definition for the a very simple, and yet essential, isNil function for type checking. This function is particularly useful in a consume handler. Example: ``` source.consume(function (err, x, push, next) { if (err) { // pass errors along the stream and consume next value push(err); next(); } else if (_.isNil(x)) { // type guard is only possible with this function // pass nil (end event) along the stream push(null, x); } else { // pass on the value only if the value passes the predicate if (f(x)) { push(null, x); } next(); } }); ``` See https://github.com/caolan/highland/pull/645 --- types/highland/index.d.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/types/highland/index.d.ts b/types/highland/index.d.ts index eff8fb2769..473e93880a 100644 --- a/types/highland/index.d.ts +++ b/types/highland/index.d.ts @@ -89,6 +89,17 @@ interface HighlandStatic { // UTILS // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + /** + * Returns true if `x` is the end of stream marker. + * + * @id isNil + * @section Streams + * @name _.isNil(x) + * @param x - the object to test + * @api public + */ + isNil(x: R | Highland.Nil): x is Highland.Nil; + /** * Returns true if `x` is a Highland Stream. * From a16cd3ea3211250b557fff6eb614a1d490e7d454 Mon Sep 17 00:00:00 2001 From: Alvis HT Tang Date: Thu, 22 Mar 2018 23:54:08 +0000 Subject: [PATCH 0142/2153] highland: add a test for the new isNil() --- types/highland/highland-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/highland/highland-tests.ts b/types/highland/highland-tests.ts index 5f1c734395..a1c48c944b 100644 --- a/types/highland/highland-tests.ts +++ b/types/highland/highland-tests.ts @@ -337,6 +337,8 @@ fooStream.toCallback((err: Error) => {}); // UTILS // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool = _.isNil(x); + bool = _.isStream(x); bool = _.isStream(fooStream); From bd2d2d91b8c87554328298281314cd929152cc80 Mon Sep 17 00:00:00 2001 From: piq9117 Date: Thu, 22 Mar 2018 19:01:21 -0500 Subject: [PATCH 0143/2153] Sanctuary replaced all Array inputs to ReadonlyArray. --- types/sanctuary/index.d.ts | 75 +++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/types/sanctuary/index.d.ts b/types/sanctuary/index.d.ts index 0d61fe22aa..b0a8fd7750 100644 --- a/types/sanctuary/index.d.ts +++ b/types/sanctuary/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/sanctuary-js/sanctuary#readme // Definitions by: David Chambers // Juan J. Jimenez-Anca +// Ken Aguilar // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare var S: Sanctuary.Environment; @@ -73,12 +74,12 @@ interface Contravariant {} interface ListToMaybeList { (xs: string): Maybe; - (xs: A[]): Maybe; + (xs: ReadonlyArray): Maybe; } interface MatchObj { match: string; - groups: Array>; + groups: ReadonlyArray>; } declare namespace Sanctuary { @@ -108,13 +109,13 @@ declare namespace Sanctuary { max(x: Ord): (y: Ord) => A; id(p: TypeRep): Fn | Category; concat(x: Semigroup): (y: Semigroup) => Semigroup; - concat(x: A[]): (y: A[]) => A[]; + concat(x: ReadonlyArray): (y: ReadonlyArray) => A[]; concat(x: StrMap): (y: StrMap) => StrMap; concat(x: string): (y: string) => string; empty(p: TypeRep): Monoid; map(p: Fn): { (q: Fn): Fn; - (q: A[]): B[]; + (q: ReadonlyArray): B[]; (q: StrMap): StrMap; (q: Functor): Functor; }; @@ -125,7 +126,7 @@ declare namespace Sanctuary { }; alt(x: Alt): (y: Alt) => Alt; zero(p: TypeRep): Plus; - reduce(p: Fn2): (q: B) => (r: A[] | StrMap | Maybe | Either | Foldable) => B; + reduce(p: Fn2): (q: B) => (r: ReadonlyArray | StrMap | Maybe | Either | Foldable) => B; traverse(typeRep: TypeRep): (f: Fn>) => (traversable: Traversable) => Applicative>; sequence(typeRep: TypeRep): (traversable: Traversable>) => Applicative>; ap(p: Apply>): (q: Apply) => Apply; @@ -144,7 +145,7 @@ declare namespace Sanctuary { chain(f: Fn2): (chain_: Fn) => Fn; chain(f: Fn >): (chain_: Chain) => Chain; join(chain_: Fn2): Fn; - join(chain_: A[][]): A[]; + join(chain_: ReadonlyArray>): A[]; join(chain_: Maybe>): Maybe; join(chain_: Chain>): Chain; chainRec(typeRep: TypeRep): { @@ -158,11 +159,11 @@ declare namespace Sanctuary { (contravariant: Contravariant): Contravariant; }; filter (pred: Predicate): { - (m: A[]): A[]; + (m: ReadonlyArray): A[]; (m: Foldable): Foldable; }; filterM(pred: Predicate): { - (m: A[]): A[]; + (m: ReadonlyArray): A[]; (m: Foldable): Foldable; }; takeWhile(pred: Predicate): (foldable: Foldable) => Foldable; @@ -185,7 +186,7 @@ declare namespace Sanctuary { pipe(fs: [Fn, Fn, Fn]): (x: A) => D; pipe(fs: [Fn, Fn, Fn, Fn]): (x: A) => E; pipe(fs: [Fn, Fn, Fn, Fn, Fn]): (x: A) => F; - pipe(fs: Array>): (x: any) => any; + pipe(fs: ReadonlyArray>): (x: any) => any; on(p: Fn2): (q: Fn) => (r: A) => Fn; // TODO: Maybe isNothing(p: Maybe): boolean; @@ -196,7 +197,7 @@ declare namespace Sanctuary { toMaybe(p: A | null | undefined): Maybe; maybe(p: B): (q: Fn) => (r: Maybe) => B; maybe_(p: Thunk): (q: Fn) => (r: Maybe) => B; - justs(p: Array>): A[]; + justs(p: ReadonlyArray>): A[]; mapMaybe(p: Fn>): (q: A[]) => A[]; encase(p: Fn): Fn>; encase2(p: Fn2): Fn2>; @@ -208,8 +209,8 @@ declare namespace Sanctuary { fromEither(p: B): (q: Either) => B; toEither(p: A): (q: B | null | undefined) => Either; either(p: Fn): (q: Fn) => (r: Either) => C; - lefts(p: Array>): A[]; - rights(p: Array>): B[]; + lefts(p: ReadonlyArray>): A[]; + rights(p: ReadonlyArray>): B[]; tagBy(p: Predicate): (q: A) => Either; encaseEither(p: Fn): (q: Fn) => Fn>; encaseEither2(p: Fn): (q: Fn2) => Fn2>; @@ -223,22 +224,22 @@ declare namespace Sanctuary { ifElse(p: Predicate): (q: Fn) => (r: Fn) => Fn; when(p: Predicate): (q: Fn) => Fn; unless(p: Predicate): (q: Fn) => Fn; - allPass(p: Array>): Predicate; - anyPass(p: Array>): Predicate; + allPass(p: ReadonlyArray>): Predicate; + anyPass(p: ReadonlyArray>): Predicate; // List slice(p: Integer): (q: Integer) => ListToMaybeList; at(p: Integer): { (q: string): Maybe; - (q: A[]): Maybe; + (q: ReadonlyArray): Maybe; }; head(xs: string): Maybe; - head(xs: A[]): Maybe; + head(xs: ReadonlyArray): Maybe; last(xs: string): Maybe; - last(xs: A[]): Maybe; + last(xs: ReadonlyArray): Maybe; tail(xs: string): Maybe; - tail(xs: A[]): Maybe; + tail(xs: ReadonlyArray): Maybe; init(xs: string): Maybe; - init(xs: A[]): Maybe; + init(xs: ReadonlyArray): Maybe; take(n: Integer): ListToMaybeList; takeLast(n: Integer): ListToMaybeList; drop(n: Integer): ListToMaybeList; @@ -246,33 +247,33 @@ declare namespace Sanctuary { // Array // TODO: Fantasyland overloads, non-curried versions append(x: A): { - (xs: A[]): A[]; + (xs: ReadonlyArray): A[]; (xs: Applicative): Applicative; }; prepend(x: A): { - (xs: A[]): A[]; + (xs: ReadonlyArray): A[]; (xs: Applicative): Applicative; }; - joinWith(p: string): (q: string[]) => string; - elem(p: A): (q: Foldable | StrMap | A[]) => boolean; - find(p: Predicate): (q: A[] | StrMap | Foldable) => Maybe; + joinWith(p: string): (q: ReadonlyArray) => string; + elem(p: A): (q: Foldable | StrMap | ReadonlyArray) => boolean; + find(p: Predicate): (q: ReadonlyArray | StrMap | Foldable) => Maybe; pluck(key: string): (xs: Functor) => Functor; unfoldr(f: Fn>>): (x: B) => A[]; range(from: Integer): (to: Integer) => Integer[]; - groupBy(f: Fn2): (xs: A[]) => A[][]; - reverse(foldable: A[]): A[]; + groupBy(f: Fn2): (xs: ReadonlyArray) => A[][]; + reverse(foldable: ReadonlyArray): A[]; reverse(foldable: Foldable): Foldable; - sort(foldable: A[]): A[]; + sort(foldable: ReadonlyArray): A[]; sort(foldable: Foldable): Foldable; sortBy(f: Fn>): { - (foldable: A[]): A[]; + (foldable: ReadonlyArray): A[]; (foldable: Foldable): Foldable; }; // Object prop(p: string): (q: any) => any; - props(p: string[]): (q: any) => any; + props(p: ReadonlyArray): (q: any) => any; get(p: Predicate): (q: string) => (r: any) => Maybe; - gets(p: Predicate): (q: string[]) => (r: any) => Maybe; + gets(p: Predicate): (q: ReadonlyArray) => (r: any) => Maybe; // StrMap keys(p: StrMap): string[]; values(p: StrMap): A[]; @@ -280,13 +281,13 @@ declare namespace Sanctuary { // Number negate(n: ValidNumber): ValidNumber; add(p: FiniteNumber): (q: FiniteNumber) => FiniteNumber; - sum(p: Foldable | FiniteNumber[]): FiniteNumber; + sum(p: Foldable | ReadonlyArray): FiniteNumber; sub(p: FiniteNumber): (q: FiniteNumber) => FiniteNumber; mult(x: FiniteNumber): (q: FiniteNumber) => FiniteNumber; - product(p: Foldable | FiniteNumber[]): FiniteNumber; + product(p: Foldable | ReadonlyArray): FiniteNumber; div(p: NonZeroFiniteNumber): (q: FiniteNumber) => FiniteNumber; pow(p: FiniteNumber): (q: FiniteNumber) => FiniteNumber; - mean(p: Foldable | FiniteNumber[]): Maybe; + mean(p: Foldable | ReadonlyArray): Maybe; // Integer even(n: Integer): boolean; odd(n: Integer): boolean; @@ -308,15 +309,15 @@ declare namespace Sanctuary { stripPrefix(prefix: string): (q: string) => Maybe; stripSuffix(suffix: string): (q: string) => Maybe; words(s: string): string[]; - unwords(xs: string[]): string; + unwords(xs: ReadonlyArray): string; lines(s: string): string[]; - unlines(xs: string[]): string; + unlines(xs: ReadonlyArray): string; splitOn(separator: string): (q: string) => string[]; splitOnRegex(pattern: RegExp): (q: string) => string[]; } interface Environment extends Static { - env: any[]; - create(opts: {checkTypes: boolean, env: any[]}): Static; + env: ReadonlyArray; + create(opts: {checkTypes: boolean, env: ReadonlyArray}): Static; } } From 8d0bdd3e2edac1c405035243999848b3fd0ba375 Mon Sep 17 00:00:00 2001 From: Ricardo De Pena Date: Thu, 22 Mar 2018 22:41:18 -0400 Subject: [PATCH 0144/2153] Fixed review items. --- types/openfin/v29/tsconfig.json | 2 +- types/openfin/v29/tslint.json | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/types/openfin/v29/tsconfig.json b/types/openfin/v29/tsconfig.json index a590982714..df2dae8b79 100644 --- a/types/openfin/v29/tsconfig.json +++ b/types/openfin/v29/tsconfig.json @@ -8,7 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/openfin/v29/tslint.json b/types/openfin/v29/tslint.json index 64aace11d6..f93cf8562a 100644 --- a/types/openfin/v29/tslint.json +++ b/types/openfin/v29/tslint.json @@ -1,6 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "max-line-length": false - } + "extends": "dtslint/dt.json" } From ed99f72403ef6aacba6ffe81ab14f65ee74a91ee Mon Sep 17 00:00:00 2001 From: Craig Bruce Date: Fri, 23 Mar 2018 14:15:59 +1100 Subject: [PATCH 0145/2153] Initial commit of cast types --- .../cast.framework.breaks.d.ts | 110 + .../cast.framework.d.ts | 773 +++++++ .../cast.framework.events.d.ts | 421 ++++ .../cast.framework.messages.d.ts | 1777 +++++++++++++++++ .../cast.framework.system.d.ts | 177 ++ .../cast.framework.ui.d.ts | 194 ++ .../chromecast-caf-receiver-tests.ts | 66 + types/chromecast-caf-receiver/index.d.ts | 25 + types/chromecast-caf-receiver/tsconfig.json | 22 + types/chromecast-caf-receiver/tslint.json | 1 + 10 files changed, 3566 insertions(+) create mode 100644 types/chromecast-caf-receiver/cast.framework.breaks.d.ts create mode 100644 types/chromecast-caf-receiver/cast.framework.d.ts create mode 100644 types/chromecast-caf-receiver/cast.framework.events.d.ts create mode 100644 types/chromecast-caf-receiver/cast.framework.messages.d.ts create mode 100644 types/chromecast-caf-receiver/cast.framework.system.d.ts create mode 100644 types/chromecast-caf-receiver/cast.framework.ui.d.ts create mode 100644 types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts create mode 100644 types/chromecast-caf-receiver/index.d.ts create mode 100644 types/chromecast-caf-receiver/tsconfig.json create mode 100644 types/chromecast-caf-receiver/tslint.json diff --git a/types/chromecast-caf-receiver/cast.framework.breaks.d.ts b/types/chromecast-caf-receiver/cast.framework.breaks.d.ts new file mode 100644 index 0000000000..4fed094a12 --- /dev/null +++ b/types/chromecast-caf-receiver/cast.framework.breaks.d.ts @@ -0,0 +1,110 @@ +// Type definitions for chromecast-caf-receiver 3.x +// Project: https://developers.google.com/cast/docs/reference/caf_receiver/ +// Definitions by: Craig Bruce https://github.com/craigrbruce +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// +/// +/// +/// +/// + +import { Break, BreakClip } from './cast.framework.messages'; + +export = cast.framework.breaks; + +declare namespace cast.framework.breaks { + export class BreakSeekData { + constructor(seekFrom: number, seekTo: number, breaks: Break[]); + + /** + * List of breaks + */ + breaks: Break[]; + + /** + * Current playback time + */ + seekFrom: number; + + /** + * The time to seek to + */ + seekTo: number; + } + + /** Provide context information for break clip load interceptor. */ + export class BreakClipLoadInterceptorContext { + constructor(brk: Break); + + /** + * The container break for the break clip + */ + break: Break; + } + + /** Interface to manage breaks */ + export interface BreakManager { + /** + * Get current media break by id. + * @param {*} id + */ + getBreakById(id: string): Break; + + /** + * Get current media break clip by id + * @param {*} id + */ + getBreakClipById(id: string): BreakClip; + + /** Get current media break clips. */ + getBreakClips(): BreakClip[]; + + /** Get current media breaks. */ + getBreaks(): Break[]; + + /** Returns true if watched breaks should be played. */ + getPlayWatchedBreak(): boolean; + + /** + * Provide an interceptor to allow developer to insert more break clips or modify current break clip before a break is started. + * If interceptor is null it will reset the interceptor to default one. + * By default VAST fetching and parsing logic in default interceptor. + * So if customized interceptor is set by developer; + * the VAST logic will be overridden and developers should implement their own VAST fetching and parsing logic in the provided interceptor. + * @param {*} interceptor + */ + setBreakClipLoadInterceptor( + interceptor: ( + breakClip: BreakClip, + breakClipLoaderContext?: BreakClipLoadInterceptorContext + ) => void + ): void; + + /** + * Provide an interceptor for developer to specify what breaks they want to play after seek. + * @param {*} seekInterceptor + */ + setBreakSeekInterceptor( + seekInterceptor: (breakSeekData: BreakSeekData) => void + ): void; + + /** + * Set a flag to control if the watched client stitching break should be played. + * @param {*} playWatchedBreak + */ + setPlayWatchedBreak(playWatchedBreak: boolean): void; + + /** + * Provide an interceptor to modify VAST tracking URL before it is being sent to server. + * The input of the interceptor is a string of the tracking URL. + * The interceptor can either return a modified string of URL or a Promise of modified string of URL. + * The interceptor can also return null if you want to send the tracking URL by your own code instead of by CAF. + * @param {*} interceptor + */ + setVastTrackingInterceptor( + interceptor?: (trackingUrl: string) => void + ): void; + } +} diff --git a/types/chromecast-caf-receiver/cast.framework.d.ts b/types/chromecast-caf-receiver/cast.framework.d.ts new file mode 100644 index 0000000000..a22e9a24b9 --- /dev/null +++ b/types/chromecast-caf-receiver/cast.framework.d.ts @@ -0,0 +1,773 @@ +// Type definitions for chromecast-caf-receiver 3.x +// Project: https://developers.google.com/cast/docs/reference/caf_receiver/ +// Definitions by: Craig Bruce https://github.com/craigrbruce +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// +/// +/// +/// +/// + +import { EventType } from './cast.framework.events'; +import { + PlayerState, + PlayStringId, + ErrorType, + ErrorReason, + IdleReason, + MessageType, + Track, + TextTrackStyle, + QueueItem, + LoadRequestData, + QueueData, + Break, + LiveSeekableRange, + MediaInformation, + ErrorData, + RequestData, +} from './cast.framework.messages'; +import { BreakManager } from './cast.framework.breaks'; +import { EventHandler, RequestHandler, BinaryHandler } from './cast'; +import { + ApplicationData, + Sender, + StandbyState, + SystemState, +} from './cast.framework.system'; + +export = cast.framework; + +declare namespace cast.framework { + export type LoggerLevel = + | 'DEBUG' + | 'VERBOSE' + | 'INFO' + | 'WARNING' + | 'ERROR' + | 'NONE'; + + export type ContentProtection = + | 'NONE' + | 'CLEARKEY' + | 'PLAYREADY' + | 'WIDEVINE'; + + /** + * Manages text tracks. + */ + export class TextTracksManager { + constructor(params: any); + + /** + * Adds text tracks to the list. + */ + addTracks(tracks: Track[]): void; + + /** + * Creates a text track. + */ + createTrack(): Track; + + /** + * Gets all active text ids. + */ + getActiveIds(): number[]; + + /** + * Gets all active text tracks. + */ + getActiveTracks(): Track[]; + + /** + * Returns the current text track style. + */ + getTextTracksStyle(): TextTrackStyle; + + /** + * Gets text track by id. + */ + getTrackById(id: number): Track; + + /** + * Returns all text tracks. + */ + getTracks(): Track[]; + + /** + * Gets text tracks by language. + */ + getTracksByLanguage(language: string): Track[]; + + /** + * Sets text tracks to be active by id. + */ + setActiveByIds(newIds: number[]): void; + + /** + * Sets text tracks to be active by language. + */ + setActiveByLanguage(language: string): void; + + /** + * Sets text track style. + */ + setTextTrackStyle(style: TextTrackStyle): void; + } + + /** + * QueueManager exposes several queue manipulation APIs to developers. + */ + export class QueueManager { + constructor(params: any); + + /** + * Returns the current queue item. + */ + getCurrentItem(): QueueItem; + + /** + * Returns the index of the current queue item. + */ + getCurrentItemIndex(): number; + + /** + * Returns the queue items. + */ + getItems(): QueueItem[]; + + /** + * Inserts items into the queue. + */ + insertItems(items: QueueItem[], insertBefore?: number): void; + + /** + * Removes items from the queue. + */ + removeItems(itemIds: number[]): void; + + /** + * Sets whether to limit the number of queue items to be reported in Media Status (default is true). + */ + setQueueStatusLimit(limitQueueItemsInStatus: boolean): void; + + /** + * Updates existing queue items by matching itemId. + */ + updateItems(items: QueueItem[]): void; + } + + /** + * Base implementation of a queue. + */ + export class QueueBase { + /** + * Fetches a window of items using the specified item id as reference; called by the receiver MediaManager when it needs more queue items; often as a request from senders. If only one of nextCount and prevCount is non-zero; fetchItems should only return items after or before the reference item; if both nextCount and prevCount are non-zero; a window of items including the reference item should be returned. + */ + fetchItems( + itemId: number, + nextCount: number, + prevCount: number + ): QueueItem[] | Promise; + + /** + * Initializes the queue with the requestData. This is called when a new LOAD request comes in to the receiver. If this returns or resolves to null; our default queueing implementation will create a queue based on queueData.items or the single media in the load request data. + */ + initialize(requestData: LoadRequestData): QueueData | Promise; + + /** + * Returns next items after the reference item; often the end of the current queue; called by the receiver MediaManager. + */ + nextItems(itemId?: number): QueueItem[] | Promise; + + /** + * Sets the current item with the itemId; called by the receiver MediaManager when it changes the current playing item. + */ + onCurrentItemIdChanged(itemId: number): void; + + /** + * A callback for informing the following items have been inserted into the receiver queue in this session. A cloud based implementation can optionally choose to update its queue based on the new information. + */ + onItemsInserted(items: QueueItem[], insertBefore?: number): void; + + /** + * A callback for informing the following items have been removed from the receiver queue in this session. A cloud based implementation can optionally choose to update its queue based on the new information. + */ + onItemsRemoved(itemIds: number[]): void; + + /** + * Returns previous items before the reference item; often at the beginning of the queue; called by the receiver MediaManager. + */ + prevItems(itemId?: number): QueueItem[] | Promise; + + /** + * Shuffles the queue and returns new queue items. Returns null if the operation is not supported. + */ + shuffle(): QueueItem[] | Promise; + } + + /** + * Controls and monitors media playback. + */ + export class PlayerManager { + constructor(params: any); + + /** + * Adds an event listener for player event. + */ + addEventListener: ( + eventType: EventType | EventType[], + eventListener: EventHandler + ) => void; + + /** + * Sends a media status message to all senders (broadcast). Applications use this to send a custom state change. + */ + broadcastStatus( + includeMedia?: boolean, + requestId?: number, + customData?: any, + includeQueueItems?: boolean + ): void; + + /** + * + */ + getAudioTracksManager(): AudioTracksManager; + + /** + * Returns current time in sec in currently-playing break clip. + */ + getBreakClipCurrentTimeSec(): number; + + /** + * Returns duration in sec of currently-playing break clip. + */ + getBreakClipDurationSec(): number; + + /** + * Obtain the breaks (Ads) manager. + */ + getBreakManager(): BreakManager; + + /** + * Returns list of breaks. + */ + getBreaks(): Break[]; + + /** + * Gets current time in sec of current media. + */ + getCurrentTimeSec(): number; + + /** + * Gets duration in sec of currently playing media. + */ + getDurationSec(): number; + + /** + * Returns live seekable range with start and end time in seconds. The values are media time based. + */ + getLiveSeekableRange(): LiveSeekableRange; + + /** + * Gets media information of current media. + */ + getMediaInformation(): MediaInformation; + + /** + * Returns playback configuration. + */ + getPlaybackConfig(): PlaybackConfig; + + /** + * Returns current playback rate. + */ + getPlaybackRate(): number; + + /** + * Gets player state. + */ + getPlayerState(): PlayerState; + + /** + * Get the preferred playback rate. (Can be used on shutdown event to save latest preferred playback rate to a persistent storage; so it can be used in next session in the cast options). + */ + getPreferredPlaybackRate(): number; + + /** + * Get the preferred text track language. + */ + getPreferredTextLanguage(): string; + + /** + * Obtain QueueManager API. + */ + getQueueManager(): QueueManager; + + /** + * + */ + getTextTracksManager(): TextTracksManager; + + /** + * Loads media. + */ + load(loadRequest: LoadRequestData): Promise; + + /** + * Pauses currently playing media. + */ + pause(): void; + + /** + * Plays currently paused media. + */ + play(): void; + + /** + * Requests a text string to be played back locally on the receiver device. + */ + playString(stringId: PlayStringId, args?: string[]): Promise; + + /** + * Request Google Assistant to refresh the credentials. Only works if the original credentials came from the assistant. + */ + refreshCredentials(): Promise; + + /** + * Removes the event listener added for given player event. If event listener is not added; it will be ignored. + */ + removeEventListener( + eventType: EventType | EventType[], + eventListener: EventHandler + ): void; + + /** + * Seeks in current media. + */ + seek(seekTime: number): void; + + /** + * Sends an error to a specific sender + */ + sendError( + senderId: string, + requestId: number, + type: ErrorType, + reason?: ErrorReason, + customData?: any + ): void; + + /** + * Send local media request. + */ + sendLocalMediaRequest(request: RequestData): void; + + /** + * Sends a media status message to a specific sender. + */ + sendStatus( + senderId: string, + requestId: number, + includeMedia?: boolean, + customData?: any, + includeQueueItems?: boolean + ): void; + + /** + * Sets the IDLE reason. This allows applications that want to force the IDLE state to indicate the reason that made the player going to IDLE state (a custom error; for example). The idle reason will be sent in the next status message. NOTE: Most applications do not need to set this value; it is only needed if they want to make the player go to IDLE in special circumstances and the default idleReason does not reflect their intended behavior. + */ + setIdleReason(idleReason: IdleReason): void; + + /** + * Sets MediaElement to use. If Promise of MediaElement is set; media begins playback after Promise is resolved. + */ + setMediaElement(mediaElement: HTMLMediaElement): void; + + /** + * Sets media information. + */ + setMediaInformation( + mediaInformation: MediaInformation, + opt_broadcast?: boolean + ): void; + + /** + * Sets a handler to return or modify PlaybackConfig; for a specific load request. The handler paramaters are the load request data and default playback config for the receiver (provided in the context options). The handler should returns a modified playback config; or null to prevent the media from playing. The return value can be a promise to allow waiting for data from the server. + */ + setMediaPlaybackInfoHandler( + handler: ( + loadRequestData: LoadRequestData, + playbackConfig: PlaybackConfig + ) => void + ): void; + + /** + * Sets a handler to return the media url for a load request. This handler can be used to avoid having the media content url published as part of the media status. By default the media contentId is used as the content url. + */ + setMediaUrlResolver( + resolver: (loadRequestData: LoadRequestData) => void + ): void; + + /** + * Provide an interceptor of incoming and outgoing messages. The interceptor can update the request data; and return updated data; a promise of updated data if need to get more data from the server; or null if the request should not be handled. Note that if load message interceptor is provided; and no interceptor is provided for preload - the load interceptor will be called for preload messages. + */ + setMessageInterceptor( + type: MessageType, + interceptor: (requestData: RequestData) => Promise + ): void; + + /** + * Sets playback configuration on the PlayerManager. + */ + setPlaybackConfig(playbackConfig: PlaybackConfig): void; + + /** + * Set the preferred playback rate for follow up load or media items. The preferred playback rate will be updated automatically to the latest playback rate that was provided by a load request or explicit set of playback rate. + */ + setPreferredPlaybackRate(preferredPlaybackRate: number): void; + + /** + * Set the preferred text track language. The preferred text track language will be updated automatically to the latest enabled language by a load request or explicit change to text tracks. (Should be called only in idle state; and Will only apply to next loaded media). + */ + setPreferredTextLanguage(preferredTextLanguage: string): void; + + /** + * Stops currently playing media. + */ + stop(): void; + } + + /** + * Configuration to customize playback behavior. + */ + export class PlaybackConfig { + /** + * Duration of buffered media in seconds to start buffering. + */ + autoPauseDuration?: number; + + /** + * Duration of buffered media in seconds to start/resume playback after auto-paused due to buffering. + */ + autoResumeDuration?: number; + + /** + * Minimum number of buffered segments to start/resume playback. + */ + autoResumeNumberOfSegments?: number; + + /** + * A function to customize request to get a caption segment. + */ + captionsRequestHandler?: RequestHandler; + + /** + * Initial bandwidth in bits in per second. + */ + initialBandwidth?: number; + + /** + * Custom license data. + */ + licenseCustomData?: string; + + /** + * Handler to process license data. The handler is passed the license data; and returns the modified license data. + */ + licenseHandler?: BinaryHandler; + + /** + * A function to customize request to get a license. + */ + licenseRequestHandler?: RequestHandler; + + /** + * Url for acquiring the license. + */ + licenseUrl?: string; + + /** + * Handler to process manifest data. The handler is passed the manifest; and returns the modified manifest. + */ + manifestHandler?: (manifest: string) => string; + + /** + * A function to customize request to get a manifest. + */ + manifestRequestHandler?: RequestHandler; + + /** + * Preferred protection system to use for decrypting content. + */ + protectionSystem: ContentProtection; + + /** + * Handler to process segment data. The handler is passed the segment data; and returns the modified segment data. + */ + segmentHandler?: BinaryHandler; + + /** + * A function to customize request information to get a media segment. + */ + segmentRequestHandler?: RequestHandler; + + /** + * Maximum number of times to retry a network request for a segment. + */ + segmentRequestRetryLimit?: number; + } + /** + * HTTP(s) Request/Response information. + */ + export class NetworkRequestInfo { + /** + * The content of the request. Can be used to modify license request body. + */ + content: Uint8Array; + + /** + * An object containing properties that you would like to send in the header. + */ + headers: any; + + /** + * The URL requested. + */ + url: string; + + /** + * Indicates whether CORS Access-Control requests should be made using credentials such as cookies or authorization headers. + */ + withCredentials: boolean; + } + /** Cast receiver context options. All options are optionals. */ + export class CastReceiverOptions { + /** + * Optional map of custom messages namespaces to initialize and their types. + * Custom messages namespaces need to be initiated before the application started; + * so it is best to provide the namespaces in the receiver options. + * (The default type of a message bus is JSON; if not provided here). + */ + customNamespaces?: any; + + /** + * Sender id used for local requests. Default value is 'local'. + */ + localSenderId?: string; + + /** + * Maximum time in seconds before closing an idle sender connection. + * Setting this value enables a heartbeat message to keep the connection alive. + * Used to detect unresponsive senders faster than typical TCP timeouts. + * The minimum value is 5 seconds; there is no upper bound enforced but practically it's minutes before platform TCP timeouts come into play. + * Default value is 10 seconds. + */ + maxInactivity?: number; + + /** + * Optional media element to play content with. Default behavior is to use the first found media element in the page. + */ + mediaElement?: HTMLMediaElement; + + /** + * Optional playback configuration. + */ + playbackConfig?: PlaybackConfig; + + /** + * If this is true; the watched client stitching break will also be played. + */ + playWatchedBreak?: boolean; + + /** + * Preferred value for player playback rate. It is used if playback rate value is not provided in the load request. + */ + preferredPlaybackRate?: number; + + /** + * Preferred text track language. It is used if no active track is provided in the load request. + */ + preferredTextLanguage?: string; + + /** + * Optional queue implementation. + */ + queue?: QueueBase; + + /** + * Text that represents the application status. + * It should meet internationalization rules as may be displayed by the sender application. + */ + statusText?: string; + + /** + * A bitmask of media commands supported by the application. + * LOAD; PLAY; STOP; GET_STATUS must always be supported. + * If this value is not provided; then PAUSE; SEEK; STREAM_VOLUME; STREAM_MUTE are assumed to be supported too. + */ + supportedCommands?: number; + + /** + * Indicate that MPL should be used for DASH content. + */ + useLegacyDashSupport?: boolean; + + /** + * An integer used as an internal version number. + * This number is used only to distinguish between receiver releases and higher numbers do not necessarily have to represent newer releases. + */ + versionCode?: number; + } + + /** Manages loading of underlying libraries and initializes underlying cast receiver SDK. */ + export class CastReceiverContext { + /** Returns the CastReceiverContext singleton instance. */ + static getInstance(): CastReceiverContext; + + constructor(params: any); + + /** + * Sets message listener on custom message channel. + */ + addCustomMessageListener(namespace: string, listener: EventHandler): void; + + /** + * Add listener to cast system events. + */ + addEventListener(type: EventType, handler: EventHandler): void; + + /** + * Checks if the given media params of video or audio streams are supported by the platform. + */ + canDisplayType( + mimeType: string, + codecs?: string, + width?: number, + height?: number, + framerate?: number + ): boolean; + + /** + * Provides application information once the system is ready; otherwise it will be null. + */ + getApplicationData(): ApplicationData; + + /** + * Provides device capabilities information once the system is ready; otherwise it will be null. + * If an empty object is returned; the device does not expose any capabilities information. + */ + getDeviceCapabilities(): any; + + /** + * Get Player instance that can control and monitor media playback. + */ + getPlayerManager(): PlayerManager; + + /** + * Get a sender by sender id + */ + getSender(senderId: string): Sender; + + /** + * Gets a list of currently-connected senders. + */ + getSenders(): Sender[]; + + /** + * Reports if the cast application's HDMI input is in standby. + */ + getStandbyState(): StandbyState; + + /** + * Provides application information about the system state. + */ + getSystemState(): SystemState; + + /** + * Reports if the cast application is the HDMI active input. + */ + getVisibilityState(): VisibilityState; + + /** + * When the application calls start; the system will send the ready event to indicate + * that the application information is ready and the application can send messages as soon as there is one sender connected. + */ + isSystemReady(): boolean; + + /** + * Start loading player js. This can be used to start loading the players js code in early stage of starting the receiver before calling start. + * This function is a no-op if players were already loaded (start was called). + */ + loadPlayerLibraries(useLegacyDashSupport?: boolean): void; + + /** + * Remove a message listener on custom message channel. + */ + removeCustomMessageListener( + namespace: string, + listener: EventHandler + ): void; + + /** + * Remove listener to cast system events. + */ + removeEventListener(type: EventType, handler: EventHandler): void; + + /** + * Sends a message to a specific sender. + */ + sendCustomMessage(namespace: string, senderId: string, message: any): void; + + /** + * This function should be called in response to the feedbackstarted event if the application + * add debug state information to log in the feedback report. + * It takes in a parameter ‘message’ that is a string that represents the debug information that the application wants to log. + */ + sendFeedbackMessage(feedbackMessage: string): void; + + /** + * Sets the application state. The application should call this when its state changes. + * If undefined or set to an empty string; the value of the Application Name established during application + * registration is used for the application state by default. + */ + setApplicationState(statusText: string): void; + + /** + * Sets the receiver inactivity timeout. + * It is recommended to set the maximum inactivity value when calling Start and not changing it. + * This API is just provided for development/debugging purposes. + */ + setInactivityTimeout(maxInactivity: number): void; + + /** + * Sets the log verbosity level. + */ + setLoggerLevel(level: LoggerLevel): void; + + /** + * Initializes system manager and media manager; so that receiver app can receive requests from senders. + */ + start(options?: CastReceiverOptions): CastReceiverContext; + + /** + * Shutdown receiver application. + */ + stop(): void; + } + + /** Manages audio tracks. */ + export class AudioTracksManager { + constructor(params: any); + getActiveId(): number; + getActiveTrack(): Track; + getTrackById(id: number): Track; + getTracks(): Track[]; + getTracksByLanguage(language: string): Track[]; + setActiveById(id: number): void; + setActiveByLanguage(language: string): void; + } +} diff --git a/types/chromecast-caf-receiver/cast.framework.events.d.ts b/types/chromecast-caf-receiver/cast.framework.events.d.ts new file mode 100644 index 0000000000..c5e2e71771 --- /dev/null +++ b/types/chromecast-caf-receiver/cast.framework.events.d.ts @@ -0,0 +1,421 @@ +// Type definitions for chromecast-caf-receiver 3.x +// Project: https://developers.google.com/cast/docs/reference/caf_receiver/ +// Definitions by: Craig Bruce https://github.com/craigrbruce +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// +/// +/// +/// +/// + +import { + RequestData, + MediaInformation, + Track, + MediaStatus, +} from './cast.framework.messages'; +export = cast.framework.events; + +declare namespace cast.framework.events { + export type EventType = + | 'ALL' + | 'ABORT' + | 'CAN_PLAY' + | 'CAN_PLAY_THROUGH' + | 'DURATION_CHANGE' + | 'EMPTIED' + | 'ENDED' + | 'LOADED_DATA' + | 'LOADED_METADATA' + | 'LOAD_START' + | 'PAUSE' + | 'PLAY' + | 'PLAYING' + | 'PROGRESS' + | 'RATE_CHANGE' + | 'SEEKED' + | 'SEEKING' + | 'STALLED' + | 'TIME_UPDATE' + | 'SUSPEND' + | 'WAITING' + | 'BITRATE_CHANGED' + | 'BREAK_STARTED' + | 'BREAK_ENDED' + | 'BREAK_CLIP_LOADING' + | 'BREAK_CLIP_STARTED' + | 'BREAK_CLIP_ENDED' + | 'BUFFERING' + | 'CACHE_LOADED' + | 'CACHE_HIT' + | 'CACHE_INSERTED' + | 'CLIP_STARTED' + | 'CLIP_ENDED' + | 'EMSG' + | 'ERROR' + | 'ID3' + | 'MEDIA_STATUS' + | 'MEDIA_FINISHED' + | 'PLAYER_PRELOADING' + | 'PLAYER_PRELOADING_CANCELLED' + | 'PLAYER_LOAD_COMPLETE' + | 'PLAYER_LOADING' + | 'SEGMENT_DOWNLOADED' + | 'REQUEST_SEEK' + | 'REQUEST_LOAD' + | 'REQUEST_STOP' + | 'REQUEST_PAUSE' + | 'REQUEST_PLAY' + | 'REQUEST_PLAY_AGAIN' + | 'REQUEST_PLAYBACK_RATE_CHANGE' + | 'REQUEST_SKIP_AD' + | 'REQUEST_VOLUME_CHANGE' + | 'REQUEST_EDIT_TRACKS_INFO' + | 'REQUEST_EDIT_AUDIO_TRACKS' + | 'REQUEST_SET_CREDENTIALS' + | 'REQUEST_LOAD_BY_ENTITY' + | 'REQUEST_USER_ACTION' + | 'REQUEST_DISPLAY_STATUS' + | 'REQUEST_CUSTOM_COMMAND' + | 'REQUEST_FOCUS_STATE' + | 'REQUEST_QUEUE_LOAD' + | 'REQUEST_QUEUE_INSERT' + | 'REQUEST_QUEUE_UPDATE' + | 'REQUEST_QUEUE_REMOVE' + | 'REQUEST_QUEUE_REORDER' + | 'REQUEST_QUEUE_GET_ITEM_RANGE' + | 'REQUEST_QUEUE_GET_ITEMS' + | 'REQUEST_QUEUE_GET_ITEM_IDS' + | 'REQUEST_PRECACHE'; + + export type DetailedErrorCode = + | 'MEDIA_UNKNOWN' + | 'MEDIA_ABORTED' + | 'MEDIA_DECODE' + | 'MEDIA_NETWORK' + | 'MEDIA_SRC_NOT_SUPPORTED' + | 'SOURCE_BUFFER_FAILURE' + | 'MEDIAKEYS_UNKNOWN' + | 'MEDIAKEYS_NETWORK' + | 'MEDIAKEYS_UNSUPPORTED' + | 'MEDIAKEYS_WEBCRYPTO' + | 'NETWORK_UNKNOWN' + | 'SEGMENT_NETWORK' + | 'HLS_NETWORK_MASTER_PLAYLIST' + | 'HLS_NETWORK_PLAYLIST' + | 'HLS_NETWORK_NO_KEY_RESPONSE' + | 'HLS_NETWORK_KEY_LOAD' + | 'HLS_NETWORK_INVALID_SEGMENT' + | 'HLS_SEGMENT_PARSING' + | 'DASH_NETWORK' + | 'DASH_NO_INIT' + | 'SMOOTH_NETWORK' + | 'SMOOTH_NO_MEDIA_DATA' + | 'MANIFEST_UNKNOWN' + | 'HLS_MANIFEST_MASTER' + | 'HLS_MANIFEST_PLAYLIST' + | 'DASH_MANIFEST_UNKNOWN' + | 'DASH_MANIFEST_NO_PERIODS' + | 'DASH_MANIFEST_NO_MIMETYPE' + | 'DASH_INVALID_SEGMENT_INFO' + | 'SMOOTH_MANIFEST' + | 'SEGMENT_UNKNOWN' + | 'TEXT_UNKNOWN' + | 'APP' + | 'BREAK_CLIP_LOADING_ERROR' + | 'BREAK_SEEK_INTERCEPTOR_ERROR' + | 'IMAGE_ERROR' + | 'LOAD_INTERRUPTED' + | 'GENERIC'; + + export type EndedReason = + | 'END_OF_STREAM' + | 'ERROR' + | 'STOPPED' + | 'INTERRUPTED' + | 'SKIPPED' + | 'BREAK_SWITCH'; + + /** + * Event data for @see{@link EventType.SEGMENT_DOWNLOADED} event. + */ + export class SegmentDownloadedEvent { + constructor(downloadTime?: number, size?: number); + + /** + * The time it took to download the segment; in milliseconds. + */ + downloadTime?: number; + + /** + * The number of bytes in the segment. + */ + size?: number; + } + + /** + * Event data for all events that represent requests made to the receiver. + */ + export class RequestEvent { + constructor(type: EventType, requestData?: RequestData, senderId?: string); + + /** + * The data that was sent with the request. + */ + requestData?: RequestData; + + /** + * The sender id the request came from. + */ + senderId?: string; + } + + /** + * Event data for @see{@link EventType.MEDIA_STATUS} event. + */ + export class MediaStatusEvent { + constructor(mediaStatus?: MediaStatus); + + /** + * The media status that was sent. + */ + mediaStatus?: MediaStatus; + } + /** + * Event data for pause events forwarded from the MediaElement. + */ + export class MediaPauseEvent { + constructor(currentMediaTime?: number, ended?: boolean); + + /** + * Indicate if the media ended (indicates the pause was fired due to stream reached the end). + */ + ended?: boolean; + } + /** + * Event data for @see{@link EventType.MEDIA_FINISHED} event. + */ + export class MediaFinishedEvent { + constructor(currentMediaTime?: number, endedReason?: EndedReason); + + /** + * The time when the media finished (in seconds). For an item in a queue; this value represents the time in the currently playing queue item ( where 0 means the queue item has just started). + */ + currentTime?: number; + + /** + * The reason the media finished. + */ + endedReason?: EndedReason; + } + /** + * Event data for all events forwarded from the MediaElement. + */ + export class MediaElementEvent { + constructor(type: EventType, currentMediaTime?: number); + + /** + * The time in the currently playing clip when the event was fired (in seconds). Undefined if playback has not started yet. + */ + currentMediaTime?: number; + } + /** + * Event data for all events pertaining to processing a load / preload request. made to the player. + */ + export class LoadEvent { + constructor(type: EventType, media?: MediaInformation); + + /** + * Information about the media being loaded. + */ + media: MediaInformation; + } + /** + * Event data for @see{@link EventType.INBAND_TRACK_ADDED} event. + */ + export class InbandTrackAddedEvent { + constructor(track: Track); + + /** + * Added track. + */ + track: Track; + } + + /** Event data for @see{@link EventType.ID3} event. */ + export class Id3Event { + constructor(segmentData: Uint8Array); + + /** + * The segment data. + */ + segmentData: Uint8Array; + } + /** + * Event data superclass for all events dispatched by @see{@link PlayerManager} + */ + export class Event { + constructor(type: EventType); + + /** + * Type of the event. + */ + type: EventType; + } + /** + * Event data for @see{@link EventType.EMSG} event. + */ + export class EmsgEvent { + constructor(emsgData: any); + + /** + * The time that the event ends (in presentation time). Undefined if using legacy Dash support. + */ + endTime: any; + + /** + * The duration of the event (in units of timescale). Undefined if using legacy Dash support. + */ + eventDuration: any; + + /** + * A field identifying this instance of the message. Undefined if using legacy Dash support. + */ + id: any; + + /** + * Body of the message. Undefined if using legacy Dash support. + */ + messageData: any; + + /** + * The offset that the event starts; relative to the start of the segment this is contained in (in units of timescale). Undefined if using legacy Dash support. + */ + presentationTimeDelta: any; + + /** + * Identifies the message scheme. Undefined if using legacy Dash support. + */ + schemeIdUri: any; + + /** + * The segment data. This is only defined if using legacy Dash support. + */ + segmentData: any; + + /** + * The time that the event starts (in presentation time). Undefined if using legacy Dash support. + */ + startTime: any; + + /** + * Provides the timescale; in ticks per second. Undefined if using legacy Dash support. + */ + timescale: any; + + /** + * Specifies the value for the event. Undefined if using legacy Dash support. + */ + value: any; + } + /** + * Event data for @see{@link EventType.CLIP_ENDED} event. + */ + export class ClipEndedEvent { + constructor(currentMediaTime: number, endedReason?: EndedReason); + + /** + * The time in media (in seconds) when clip ended. + */ + currentMediaTime: number; + + /** + * The reason the clip ended. + */ + endedReason?: EndedReason; + } + + /** + * Event data for @see{@link EventType.CACHE_LOADED} event. + */ + export class CacheLoadedEvent { + constructor(media?: MediaInformation); + + /** + * Information about the media being cached. + */ + media: MediaInformation; + } + + export class CacheItemEvent { + constructor(type: EventType, url: string); + + /** + * The URL of data fetched from cache + */ + url: string; + } + + export class BufferingEvent { + constructor(isBuffering: boolean); + + /** + * True if the player is entering a buffering state. + */ + isBuffering: boolean; + } + + export class BreaksEvent { + constructor( + type: EventType, + currentMediaTime?: number, + index?: number, + total?: number, + whenSkippable?: number, + endedReason?: EndedReason, + breakClipId?: string + ); + + /** + * The break clip's id. Refer to BreakClip.id + */ + breakClipId: string; + + /** + * The time in the currently playing media when the break event occurred. + */ + currentMediaTime: string; + + /** + * The reason the break clip ended. + */ + endedReason: EndedReason; + + /** + * Index of break clip; which starts from 1. + */ + index: number; + + /** + * Total number of break clips. + */ + total: number; + + /** + * When to skip current break clip in sec; after break clip begins to play. + */ + whenSkippable: number; + } + + /** + * Event data for @see {@link EventType.BITRATE_CHANGED} event. + */ + export class BitrateChangedEvent { + constructor(totalBitrate?: number); + + /** The bitrate of the media (audio and video) in bits per second. */ + totalBitrate: number; + } +} diff --git a/types/chromecast-caf-receiver/cast.framework.messages.d.ts b/types/chromecast-caf-receiver/cast.framework.messages.d.ts new file mode 100644 index 0000000000..dc5c1ac07b --- /dev/null +++ b/types/chromecast-caf-receiver/cast.framework.messages.d.ts @@ -0,0 +1,1777 @@ +// Type definitions for chromecast-caf-receiver 3.x +// Project: https://developers.google.com/cast/docs/reference/caf_receiver/ +// Definitions by: Craig Bruce https://github.com/craigrbruce +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// +/// +/// +/// +/// + +import { DetailedErrorCode } from './cast.framework.events'; +export = cast.framework.messages; + +declare namespace cast.framework.messages { + export type UserAction = + | 'LIKE' + | 'DISLIKE' + | 'FOLLOW' + | 'UNFOLLOW' + | 'FLAG' + | 'SKIP_AD'; + + export type UserActionContext = + | 'UNKNOWN_CONTEXT' + | 'ALBUM' + | 'ARTIST' + | 'PLAYLIST' + | 'EPISODE' + | 'SERIES' + | 'MOVIE' + | 'CHANNEL' + | 'TEAM' + | 'PLAYER' + | 'COACH'; + + export type TextTrackType = + | 'SUBTITLES' + | 'CAPTIONS' + | 'DESCRIPTIONS' + | 'CHAPTERS' + | 'METADATA'; + + export type TextTrackWindowType = 'NONE' | 'NORMAL' | 'ROUNDED_CORNERS'; + + export type TrackType = 'TEXT' | 'AUDIO' | 'VIDEO'; + + export type TextTrackFontGenericFamily = + | 'SANS_SERIF' + | 'MONOSPACED_SANS_SERIF' + | 'SERIF' + | 'MONOSPACED_SERIF' + | 'CASUAL' + | 'CURSIVE' + | 'SMALL_CAPITALS'; + + export type TextTrackFontStyle = 'NORMAL' | 'BOLD' | 'BOLD_ITALIC' | 'ITALIC'; + + export type TextTrackEdgeType = + | 'NONE' + | 'OUTLINE' + | 'DROP_SHADOW' + | 'RAISED' + | 'DEPRESSED'; + + export type Command = + | 'PAUSE' + | 'SEEK' + | 'STREAM_VOLUME' + | 'STREAM_MUTE' + | 'ALL_BASIC_MEDIA' + | 'QUEUE_NEXT' + | 'QUEUE_PREV' + | 'QUEUE_SHUFFLE' + | 'SKIP_AD'; + + export type SeekResumeState = 'PLAYBACK_START' | 'PLAYBACK_PAUSE'; + + export type StreamingProtocolType = + | 'UNKNOWN' + | 'MPEG_DASH' + | 'HLS' + | 'SMOOTH_STREAMING'; + + export type StreamType = 'BUFFERED' | 'LIVE' | 'NONE'; + + export type FocusState = 'IN_FOCUS' | 'NOT_IN_FOCUS'; + + export type ExtendedPlayerState = 'LOADING'; + + export type ErrorType = + | 'INVALID_PLAYER_STATE' + | 'LOAD_FAILED' + | 'LOAD_CANCELLED' + | 'INVALID_REQUEST' + | 'ERROR'; + + export type ErrorReason = + | 'INVALID_COMMAND' + | 'INVALID_PARAMS' + | 'INVALID_MEDIA_SESSION_ID' + | 'SKIP_LIMIT_REACHED' + | 'NOT_SUPPORTED' + | 'LANGUAGE_NOT_SUPPORTED' + | 'END_OF_QUEUE' + | 'APP_ERROR' + | 'AUTHENTICATION_EXPIRED' + | 'PREMIUM_ACCOUNT_REQUIRED' + | 'CONCURRENT_STREAM_LIMIT' + | 'PARENTAL_CONTROL_RESTRICTED' + | 'NOT_AVAILABLE_IN_REGION' + | 'CONTENT_ALREADY_PLAYING' + | 'INVALID_REQUEST' + | 'GENERIC_LOAD_ERROR'; + + export type RepeatMode = + | 'REPEAT_OFF' + | 'REPEAT_ALL' + | 'REPEAT_SINGLE' + | 'REPEAT_ALL_AND_SHUFFLE'; + + export type IdleReason = 'CANCELLED' | 'INTERRUPTED' | 'FINISHED' | 'ERROR'; + + export type HlsSegmentFormat = 'AAC' | 'AC3' | 'MP3' | 'TS' | 'TS_AAC'; + + export type HdrType = 'SDR' | 'HDR' | 'DV'; + + export type PlayStringId = + | 'FREE_TRIAL_ABOUT_TO_EXPIRE' + | 'SUBSCRIPTION_ABOUT_TO_EXPIRE' + | 'STREAM_HIJACKED'; + + export type GetStatusOptions = 'NO_METADATA' | 'NO_QUEUE_ITEMS'; + + export type MessageType = + | 'MEDIA_STATUS' + | 'CLOUD_STATUS' + | 'QUEUE_CHANGE' + | 'QUEUE_ITEMS' + | 'QUEUE_ITEM_IDS' + | 'GET_STATUS' + | 'LOAD' + | 'PAUSE' + | 'STOP' + | 'PLAY' + | 'SKIP_AD' + | 'PLAY_AGAIN' + | 'SEEK' + | 'SET_PLAYBACK_RATE' + | 'SET_VOLUME' + | 'EDIT_TRACKS_INFO' + | 'EDIT_AUDIO_TRACKS' + | 'PRECACHE' + | 'PRELOAD' + | 'QUEUE_LOAD' + | 'QUEUE_INSERT' + | 'QUEUE_UPDATE' + | 'QUEUE_REMOVE' + | 'QUEUE_REORDER' + | 'QUEUE_NEXT' + | 'QUEUE_PREV' + | 'QUEUE_GET_ITEM_RANGE' + | 'QUEUE_GET_ITEMS' + | 'QUEUE_GET_ITEM_IDS' + | 'QUEUE_SHUFFLE' + | 'SET_CREDENTIALS' + | 'LOAD_BY_ENTITY' + | 'USER_ACTION' + | 'DISPLAY_STATUS' + | 'FOCUS_STATE' + | 'CUSTOM_COMMAND'; + + export type PlayerState = 'IDLE' | 'PLAYING' | 'PAUSED' | 'BUFFERING'; + + export type QueueChangeType = + | 'INSERT' + | 'REMOVE' + | 'ITEMS_CHANGE' + | 'UPDATE' + | 'NO_CHANGE'; + + export type QueueType = + | 'ALBUM' + | 'PLAYLIST' + | 'AUDIOBOOK' + | 'RADIO_STATION' + | 'PODCAST_SERIES' + | 'TV_SERIES' + | 'VIDEO_PLAYLIST' + | 'LIVE_TV' + | 'MOVIE'; + + export type MetadataType = + | 'GENERIC' + | 'MOVIE' + | 'TV_SHOW' + | 'MUSIC_TRACK' + | 'PHOTO'; + + /** + * RefreshCredentials request data. + */ + export interface RefreshCredentialsRequestData { } + + /** + * Media event SET_VOLUME request data. + */ + export interface VolumeRequestData extends RequestData { + /** + * The media stream volume + */ + volume?: Volume; + } + + /** + * Represents the volume of a media session stream. + */ + export interface Volume { + /** + * Value from 0 to 1 that represents the current stream volume level. + */ + level?: number; + + /** + * Whether the stream is muted. + */ + muted?: boolean; + } + + /** + * Video information such as video resolution and High Dynamic Range (HDR). + */ + export class VideoInformation { + constructor(width: number, height: number, hdrType: HdrType); + + /** + * + */ + width: number; + + /** + * + */ + height: number; + + /** + * + */ + hdrType: HdrType; + } + + /** + * VAST ad request configuration. + */ + export interface VastAdsRequest { + /** + * Specifies a VAST document to be used as the ads response instead of making a request via an ad tag url. This can be useful for debugging and other situations where a VAST response is already available. + */ + adsResponse?: string; + + /** + * URL for VAST file. + */ + adTagUrl?: string; + } + + /** + * UserAction request data. + */ + export interface UserActionRequestData { + /** + * Optional request source. It contain the assistent query that initiate the request. + */ + source?: string; + + /** + * User action to be handled by the application. + */ + userAction?: UserAction; + + /** + * Optional context information for the user action. + */ + userActionContext?: UserActionContext; + } + + /** + * A TV episode media description. + */ + export interface TvShowMediaMetadata { + /** + * TV episode number. A positive integer. + */ + episode?: number; + + /** + * @deprecated use episode instead + */ + episodeNumber?: number; + + /** + * @deprecated use episode instead + */ + episodeTitle?: string; + + /** + * Content images. Examples would include cover art or a thumbnail of the currently playing media. + */ + images?: Image[]; + + /** + * ISO 8601 date when the episode originally aired; e.g. 2014-02-10. + */ + originalAirdate?: string; + + /** + * @deprecated use originalAirdate instead. + */ + releaseYear?: number; + + /** + * TV episode season. A positive integer. + */ + season?: number; + + /** + * @deprecated use season instead. + */ + seasonNumber?: number; + + /** + * TV series title. + */ + seriesTitle?: string; + + /** + * TV episode title. + */ + title?: string; + } + /** + * Describes track metadata information. + */ + export class Track { + constructor(trackId: number, trackType: TrackType); + + /** + * Custom data set by the receiver application. + */ + customData?: string; + + /** + * Language tag as per RFC 5646 (If subtype is “SUBTITLES” it is mandatory). + */ + language?: string; + + /** + * A descriptive; human readable name for the track. For example "Spanish". + */ + name?: string; + + /** + * For text tracks; the type of text track. + */ + subtype?: string; + + /** + * It can be the url of the track or any other identifier that allows the receiver to find the content (when the track is not inband or included in the manifest). For example it can be the url of a vtt file. + */ + trackContentId?: string; + + /** + * It represents the MIME type of the track content. For example if the track is a vtt file it will be ‘text/vtt’. This field is needed for out of band tracks; so it is usually provided if a trackContentId has also been provided. It is not mandatory if the receiver has a way to identify the content from the trackContentId; but recommended. The track content type; if provided; must be consistent with the track type. + */ + trackContentType?: string; + + /** + * Unique identifier of the track within the context of a MediaInformation object. + */ + trackId?: number; + + /** + * The type of track. + */ + type: TrackType; + } + /** + * Describes style information for a text track. + */ + export interface TextTrackStyle { + /** + * The background 32 bit RGBA color. The alpha channel should be used for transparent backgrounds. + */ + backgroundColor?: string; + + /** + * Custom data set by the receiver application. + */ + customData?: any; + + /** + * RGBA color for the edge; this value will be ignored if edgeType is NONE. + */ + edgeColor?: string; + + /** + * + */ + edgeType?: TextTrackEdgeType; + + /** + * If the font is not available in the receiver the fontGenericFamily will be used. + */ + fontFamily?: string; + + /** + * The text track generic family. + */ + fontGenericFamily?: TextTrackFontGenericFamily; + + /** + * The font scaling factor for the text track (the default is 1). + */ + fontScale?: number; + + /** + * The text track font style. + */ + fontStyle?: TextTrackFontStyle; + + /** + * The foreground 32 bit RGBA color. + */ + foregroundColor?: string; + + /** + * 32 bit RGBA color for the window. This value will be ignored if windowType is NONE. + */ + windowColor?: string; + + /** + * Rounded corner radius absolute value in pixels (px). This value will be ignored if windowType is not ROUNDED_CORNERS. + */ + windowRoundedCornerRadius?: number; + + /** + * The window concept is defined in CEA-608 and CEA-708. In WebVTT is called a region. + */ + windowType?: TextTrackWindowType; + } + + /** + * Media event playback rate request data. + */ + export interface SetPlaybackRateRequestData extends RequestData { + /** + * New playback rate (>0). + */ + playbackRate?: number; + + /** + * New playback rate relative to current playback rate. New rate will be the result of multiplying the current rate with the value. For example a value of 1.1 will increase rate by 10%. (Only used if the playbackRate value is not provided). + */ + relativePlaybackRate?: number; + } + + /** + * SetCredentials request data. + */ + export interface SetCredentialsRequestData { + /** + * Credentials to use by receiver. + */ + credentials?: string; + + /** + * If it is a response for refresh credentials; it will indicate the request id of the refresh credentials request. + */ + forRequestId?: number; + + /** + * Optional request source. It contain the assistent query that initiate the request. + */ + source?: string; + } + + /** + * Media event SEEK request data. + */ + export interface SeekRequestData extends RequestData { + /** + * Seconds since beginning of content. + */ + currentTime?: number; + + /** + * Seconds relative to the current playback position. If this field is defined; the currentTime field will be ignored. + */ + relativeTime?: number; + + /** + * The playback state after a SEEK request. + */ + resumeState?: SeekResumeState; + } + + /** + * Provides seekable range in seconds. + */ + export class SeekableRange { + constructor(start?: number, end?: number); + + /** + * End of the seekable range in seconds. + */ + end?: number; + + /** + * Start of the seekable range in seconds. + */ + start?: number; + } + + /** + * Media event request data. + */ + export class RequestData { + constructor(type: MessageType); + + /** + * Application-specific data for this request. It enables the sender and receiver to easily extend the media protocol without having to use a new namespace with custom messages. + */ + customData?: any; + + /** + * Id of the media session that the request applies to. + */ + mediaSessionId?: number; + + /** + * Id of the request; used to correlate request/response. + */ + requestId: number; + } + + /** + * Media event UPDATE queue request data. + */ + export interface QueueUpdateRequestData { + /** + * ID of the current media Item after the deletion (if not provided; the currentItem value will be the same as before the deletion; if it does not exist because it has been deleted; the currentItem will point to the next logical item in the list). + */ + currentItemId?: number; + + /** + * Seconds since the beginning of content to start playback of the current item. If provided; this value will take precedence over the startTime value provided at the QueueItem level but only the first time the item is played. This is to cover the common case where the user jumps to the middle of an item so the currentTime does not apply to the item permanently like the QueueItem startTime does. It avoids having to reset the startTime dynamically (that may not be possible if the phone has gone to sleep). + */ + currentTime?: number; + + /** + * List of queue items to be updated. No reordering will happen; the items will retain the existing order. + */ + items?: QueueItem[]; + + /** + * Skip/Go back number of items with respect to the position of currentItem (it can be negative). If it is out of boundaries; the currentItem will be the next logical item in the queue wrapping around the boundaries. The new currentItem position will follow the rules of the queue repeat behavior. + */ + jump?: number; + + /** + * Behavior of the queue when all items have been played. + */ + repeatMode?: RepeatMode; + + /** + * Shuffle the queue items when the update is processed. After the queue items are shuffled; the item at the currentItem position will be loaded. + */ + shuffle?: boolean; + } + + /** + * Media event queue REORDER request data. + */ + export class QueueReorderRequestData extends RequestData { + constructor(itemIds: number[]); + + /** + * ID of the current media Item after the deletion (if not provided; the currentItem value will be the same as before the deletion; if it does not exist because it has been deleted; the currentItem will point to the next logical item in the list). + */ + currentItemId?: number; + + /** + * Seconds since the beginning of content to start playback of the current item. If provided; this value will take precedence over the startTime value provided at the QueueItem level but only the first time the item is played. This is to cover the common case where the user jumps to the middle of an item so the currentTime does not apply to the item permanently like the QueueItem startTime does. It avoids having to reset the startTime dynamically (that may not be possible if the phone has gone to sleep). + */ + currentTime?: number; + + /** + * ID of the item that will be located immediately after the reordered list. If the ID is not found or it is not provided; the reordered list will be appended at the end of the existing list. + */ + insertBefore?: number; + + /** + * IDs of the items to be reordered; in the new order. Items not provided will keep their existing order. The provided list will be inserted at the position determined by insertBefore. For example: + + If insertBefore is not specified Existing queue: “A”;”D”;”G”;”H”;”B”;”E” itemIds: “D”;”H”;”B” New Order: “A”;”G”;”E”;“D”;”H”;”B” + + If insertBefore is “A” Existing queue: “A”;”D”;”G”;”H”;”B” itemIds: “D”;”H”;”B” New Order: “D”;”H”;”B”;“A”;”G”;”E” + + If insertBefore is “G” Existing queue: “A”;”D”;”G”;”H”;”B” itemIds: “D”;”H”;”B” New Order: “A”;“D”;”H”;”B”;”G”;”E” + */ + itemIds: number[]; + } + + /** + * Media event queue REMOVE request data. + */ + export class QueueRemoveRequestData extends RequestData { + constructor(itemIds: number[]); + + /** + * ID of the current media Item after the deletion (if not provided; the currentItem value will be the same as before the deletion; if it does not exist because it has been deleted; the currentItem will point to the next logical item in the list). + */ + currentItemId?: number; + + /** + * Seconds since the beginning of content to start playback of the current item. If provided; this value will take precedence over the startTime value provided at the QueueItem level but only the first time the item is played. This is to cover the common case where the user jumps to the middle of an item so the currentTime does not apply to the item permanently like the QueueItem startTime does. It avoids having to reset the startTime dynamically (that may not be possible if the phone has gone to sleep). + */ + currentTime?: number; + + /** + * IDs of queue items to be deleted. + */ + itemIds?: number[]; + } + /** + * Media event queue LOAD request data. + */ + export interface QueueLoadRequestData extends RequestData { + constructor(items: QueueItem[]): QueueLoadRequestData; + + /** + * Seconds (since the beginning of content) to start playback of the first item to be played. If provided; this value will take precedence over the startTime value provided at the QueueItem level but only the first time the item is played. This is to cover the common case where the user casts the item that was playing locally so the currentTime does not apply to the item permanently like the QueueItem startTime does. It avoids having to reset the startTime dynamically (that may not be possible if the phone has gone to sleep). + */ + currentTime?: number; + + /** + * Behavior of the queue when all items have been played. + */ + items: QueueItem[]; + + /** + * Id of the request; used to correlate request/response. + */ + repeatMode?: RepeatMode; + + /** + * The index of the item in the items array that must be the first currentItem (the item that will be played first). Note this is the index of the array (starts at 0) and not the itemId (as it is not known until the queue is created). If repeatMode is REPEAT_OFF playback will end when the last item in the array is played (elements before the startIndex will not be played). This may be useful for continuation scenarios where the user was already using the sender app and in the middle decides to cast. In this way the sender app does not need to map between the local and remote queue positions or saves one extra QUEUE_UPDATE request. + */ + startIndex?: number; + } + + /** + * Queue item information. Application developers may need to create a QueueItem to insert a queue element using InsertQueueItems. In this case they should not provide an itemId (as the actual itemId will be assigned when the item is inserted in the queue). This prevents ID collisions with items added from a sender app. + */ + export class QueueItem { + constructor(opt_itemId?: number); + + /** + * Array of Track trackIds that are active. If the array is not provided; the default tracks will be active. + */ + activeTrackIds?: number[]; + + /** + * If the autoplay parameter is not specified or is true; the media player will begin playing the element in the queue when the item becomes the currentItem. + */ + autoplay?: boolean; + + /** + * The application can define any extra queue item information needed. + */ + customData?: any; + + /** + * Unique identifier of the item in the queue. The attribute is optional because for LOAD or INSERT should not be provided (as it will be assigned by the receiver when an item is first created/inserted). + */ + itemId?: number; + + /** + * Metadata (including contentId) of the playlist element. + */ + media?: MediaInformation; + + /** + * Playback duration of the item; if it is larger than the actual duration - startTime it will be ignored (default behavior). It can be negative; in such case the duration will be the actual asset duration minus the duration provided. It can be used for photo slideshows to control the duration the item should be presented or for live events to control the duration that the program should be played. It may be useful for autoplay scenarios to avoid displaying all the credits after an episode has ended. + */ + playbackDuration?: number; + + /** + * This parameter is a hint for the receiver to preload this media item before it is played. It allows for a smooth transition between items played from the queue. The time is expressed in seconds; relative to the beginning of this item playback (usually the end of the previous item playback). Only positive values are valid. For example; if the value is 10 seconds; this item will be preloaded 10 seconds before the previous item has finished. The receiver will try to honor this value but will not guarantee it; for example if the value is larger than the previous item duration the receiver may just preload this item shortly after the previous item has started playing (there will never be two items being preloaded in parallel). Also; if an item is inserted in the queue just after the currentItem and the time to preload is higher than the time left on the currentItem; the preload will just happen as soon as possible. + */ + preloadTime?: number; + + /** + * Seconds since beginning of content. If the content is live content; and startTime is not specified; the stream will start at the live position. + */ + startTime?: number; + } + + /** + * Media event queue INSERT request data. + */ + export class QueueInsertRequestData extends RequestData { + constructor(items: QueueItem[]); + + /** + * ID of the current media Item after the insertion (if not provided; the currentItem value will be the same as before the insertion). + */ + currentItemId?: number; + + /** + * Index (relative to the items array; starting with 0) of the new current media Item. For inserted items we use the index (similar to startIndex in QUEUE_LOAD) and not currentItemId; because the itemId is unknown until the items are inserted. If not provided; the currentItem value will be the same as before the insertion (unless currentItemId is provided). This param allows to make atomic the common use case of insert and play an item. + */ + currentItemIndex?: number; + + /** + * Seconds since the beginning of content to start playback of the current item. If provided; this value will take precedence over the startTime value provided at the QueueItem level but only the first time the item is played. This is to cover the common case where the user jumps to the middle of an item so the currentTime does not apply to the item permanently like the QueueItem startTime does. It avoids having to reset the startTime dynamically (that may not be possible if the phone has gone to sleep). + */ + currentTime?: number; + + /** + * ID of the item that will be located immediately after the inserted list. If the ID is not found or it is not provided; the list will be appended at the end of the existing list. + */ + insertBefore?: number; + + /** + * List of queue items. The itemId field of the items should be empty. It is sorted (first element will be played first). + */ + items: QueueItem[]; + } + + /** + * Represents a data message containing the full list of queue ids. + */ + export interface QueueIds { + /** + * List of queue item ids. + */ + itemIds?: number[]; + + /** + * The corresponding request id. + */ + requestId?: number; + + /** + * + */ + type: MessageType; + } + + /** + * Queue data as part of the LOAD request. + */ + export class QueueData { + constructor( + id?: string, + name?: string, + description?: string, + repeatMode?: RepeatMode, + items?: QueueItem[], + startIndex?: number, + startTime?: number + ); + + /** + * Description of the queue. + */ + description?: string; + + /** + * Optional Queue entity id; provide Google Assistant deep link. + */ + entity?: string; + + /** + * Id of the queue. + */ + id?: string; + + /** + * Array of queue items. It is sorted (first element will be played first). + */ + items?: QueueItem[]; + + /** + * Name of the queue. + */ + name?: string; + + /** + * Queue type; e.g. album; playlist; radio station; tv series; etc. + */ + queueType?: QueueType; + + /** + * Continuous playback behavior of the queue. + */ + repeatMode?: RepeatMode; + + /** + * The index of the item in the queue that should be used to start playback first. + */ + startIndex?: number; + + /** + * Seconds (since the beginning of content) to start playback of the first item. + */ + startTime?: number; + } + + /** + * Represents a queue change message; such as insert; remove; and update. + */ + export interface QueueChange { + /** + * The actual queue change type. + */ + changeType?: QueueChangeType; + + /** + * The id to insert the list of itemIds before. + */ + insertBefore?: number; + + /** + * List of changed itemIds. + */ + itemIds?: number[]; + + /** + * The corresponding request id. + */ + requestId?: number; + + /** + * The queue change sequence ID. Used to coordinate state sync between various senders and the receiver. + */ + sequenceNumber?: number; + + /** + * + */ + type: MessageType; + } + + /** + * Media event PRELOAD request data. + */ + export class PreloadRequestData implements LoadRequestData { + /** + * Array of trackIds that are active. If the array is not provided; the default tracks will be active. + */ + activeTrackIds: number[]; + /** + * If the autoplay parameter is specified; the media player will begin playing the content when it is loaded. Even if autoplay is not specified;the media player implementation may choose to begin playback immediately. + */ + autoplay?: boolean; + /** + * Optional user credentials. + */ + credentials?: string; + /** + * Optional credentials type. The type 'cloud' is a reserved type used by load requests that were originated by voice assistant commands. + */ + credentialsType?: string; + /** + * Seconds since beginning of content. If the content is live content; and currentTime is not specified; the stream will start at the live position. + */ + currentTime?: number; + /** + * If the autoplay parameter is specified; the media player will begin playing the content when it is loaded. Even if autoplay is not specified; the media player implementation may choose to begin playback immediately. + */ + media: MediaInformation; + /** + * The media playback rate. + */ + playbackRate?: number; + /** + * Queue data. + */ + queueData: QueueData; + /** + * Application-specific data for this request. It enables the sender and receiver to easily extend the media protocol without having to use a new namespace with custom messages. + */ + customData?: any; + /** + * Id of the media session that the request applies to. + */ + mediaSessionId?: number; + /** + * Id of the request; used to correlate request/response. + */ + requestId: number; + constructor(itemId: number); + + /** + * The ID of the queue item. + */ + itemId: number; + } + + /** + * Media event PRECACHE request data. (Some fields of the load request; like autoplay and queueData; are ignored). + */ + export class PrecacheRequestData implements LoadRequestData { + /** + * Array of trackIds that are active. If the array is not provided; the default tracks will be active. + */ + activeTrackIds: number[]; + /** + * If the autoplay parameter is specified; the media player will begin playing the content when it is loaded. Even if autoplay is not specified;the media player implementation may choose to begin playback immediately. + */ + autoplay?: boolean; + /** + * Optional user credentials. + */ + credentials?: string; + /** + * Optional credentials type. The type 'cloud' is a reserved type used by load requests that were originated by voice assistant commands. + */ + credentialsType?: string; + /** + * Seconds since beginning of content. If the content is live content; and currentTime is not specified; the stream will start at the live position. + */ + currentTime?: number; + /** + * If the autoplay parameter is specified; the media player will begin playing the content when it is loaded. Even if autoplay is not specified; the media player implementation may choose to begin playback immediately. + */ + media: MediaInformation; + /** + * The media playback rate. + */ + playbackRate?: number; + /** + * Queue data. + */ + queueData: QueueData; + /** + * Application-specific data for this request. It enables the sender and receiver to easily extend the media protocol without having to use a new namespace with custom messages. + */ + customData?: any; + /** + * Id of the media session that the request applies to. + */ + mediaSessionId?: number; + /** + * Id of the request; used to correlate request/response. + */ + requestId: number; + constructor(data?: string); + + /** + * Application precache data. + */ + precacheData?: string; + } + + /** + * PlayString request data. + */ + export class PlayStringRequestData { + constructor(stringId: PlayStringId, opt_arguments?: string[]); + + /** + * An optional array of string values to be filled into the text. + */ + arguments?: string[]; + + /** + * An identifier for the text to be played back. + */ + stringId: PlayStringId; + } + + /** + * A photo media description. + */ + export interface PhotoMediaMetadata { + /** + * Name of the photographer. + */ + artist?: string; + + /** + * ISO 8601 date and time the photo was taken; e.g. 2014-02-10T15:47:00Z. + */ + creationDateTime?: string; + + /** + * Photo height; in pixels. + */ + height?: number; + + /** + * Images associated with the content. Examples would include a photo thumbnail. + */ + images: Image[]; + + /** + * Latitude. + */ + latitude?: number; + + /** + * Location where the photo was taken. For example; "Seattle; Washington; USA". + */ + location?: string; + + /** + * Longitude. + */ + longitude?: number; + + /** + * Photo title. + */ + title?: string; + + /** + * Photo width; in pixels. + */ + width?: number; + } + + /** + * A music track media description. + */ + export interface MusicTrackMediaMetadata { + /** + * Album artist name. + */ + albumArtist?: string; + + /** + * Album name. + */ + albumName?: string; + + /** + * Track artist name. + */ + artist?: string; + + /** + * @deprecated: use @see{@link artist} instead + */ + artistName: string; + + /** + * Track composer name. + */ + composer?: string; + + /** + * Disc number. A positive integer. + */ + discNumber?: number; + + /** + * Content images. Examples would include cover art or a thumbnail of the currently playing media. + */ + images: Image[]; + + /** + * ISO 8601 date when the track was released; e.g. 2014-02-10. + */ + releaseDate?: string; + + /** + * @deprecated: Use @see{@link releaseDate} instead + */ + releaseYear?: string; + + /** + * Track name. + */ + songName?: string; + + /** + * Track title. + */ + title?: string; + + /** + * Track number in album. A positive integer. + */ + trackNumber?: number; + } + + /** + * A movie media description. + */ + export interface MovieMediaMetadata { + /** + * Content images. Examples would include cover art or a thumbnail of the currently playing media. + */ + images: Image[]; + + /** + * ISO 8601 date when the movie was released; e.g. 2014-02-10. + */ + releaseDate?: string; + + /** + * @deprecated: use @see{@link releaseDate} instead + */ + releaseYear?: number; + + /** + * Movie studio. + */ + studio?: string; + + /** + * Movie subtitle. + */ + subtitle?: string; + + /** + * Movie title. + */ + title?: string; + } + /** + * Represents the status of a media session. + */ + export interface MediaStatus { + /** + * List of IDs corresponding to the active tracks. + */ + activeTrackIds: number[]; + + /** + * Status of break; if receiver is playing break. This field will be defined only when receiver is playing break. + */ + breakStatus: BreakStatus; + + /** + * ID of this media item (the item that originated the status change). + */ + currentItemId?: number; + + /** + * The current playback position. + */ + currentTime: number; + + /** + * Application-specific media status. + */ + customData?: any; + + /** + * Extended media status information. + */ + extendedStatus: ExtendedMediaStatus; + + /** + * If the state is IDLE; the reason the player went to IDLE state. + */ + idleReason: IdleReason; + + /** + * List of media queue items. + */ + items: QueueItem[]; + + /** + * Seekable range of a live or event stream. It uses relative media time in seconds. It will be undefined for VOD streams. + */ + liveSeekableRange: LiveSeekableRange; + + /** + * ID of the media Item currently loading. If there is no item being loaded; it will be undefined. + */ + loadingItemId?: number; + + /** + * The media information. + */ + media: MediaInformation; + + /** + * Unique id for the session. + */ + mediaSessionId: number; + + /** + * The playback rate. + */ + playbackRate: number; + + /** + * The playback state. + */ + playerState: PlayerState; + + /** + * ID of the next Item; only available if it has been preloaded. Media items can be preloaded and cached temporarily in memory; so when they are loaded later on; the process is faster (as the media does not have to be fetched from the network). + */ + preloadedItemId?: number; + + /** + * Queue data. + */ + queueData: QueueData; + + /** + * The behavior of the queue when all items have been played. + */ + repeatMode: RepeatMode; + + /** + * The commands supported by this player. + */ + supportedMediaCommands: number; + + /** + * + */ + type: MessageType; + + /** + * The video information. + */ + videoInfo: VideoInformation; + + /** + * The current stream volume. + */ + volume: Volume; + } + /** + * Common media metadata used as part of MediaInformation + */ + export class MediaMetadata { + constructor(type: MetadataType); + + /** + * The type of metadata + */ + metadataType: MetadataType; + } + + /** + * Represents the media information. + */ + export interface MediaInformation { + /** + * Partial list of break clips that includes current break clip that receiver is playing or ones that receiver will play shortly after; instead of sending whole list of clips. This is to avoid overflow of MediaStatus message. + */ + breakClips: BreakClip[]; + + /** + * List of breaks. + */ + breaks: Break[]; + + /** + * Typically the url of the media. + */ + contentId: string; + + /** + * The content MIME type. + */ + contentType: string; + + /** + * Optional media url; to allow using contentId for real id. If contentUrl is provided; it will be used as media url; otherwise the contentId will be used as the media url. + */ + contentUrl?: string; + + /** + * Application-specific media information. + */ + customData?: any; + + /** + * The media duration. + */ + duration?: number; + + /** + * Optional Media entity; provide Google Assistant deep link. + */ + entity?: string; + + /** + * The format of the HLS media segment. + */ + hlsSegmentFormat: HlsSegmentFormat; + + /** + * The media metadata. + */ + metadata: MediaMetadata; + + /** + * The stream type. + */ + streamType: StreamType; + + /** + * The style of text track. + */ + textTrackStyle: TextTrackStyle; + + /** + * The media tracks. + */ + tracks: Track[]; + } + + /** + * Media event LOAD request data. + */ + export interface LoadRequestData extends RequestData { + /** + * Array of trackIds that are active. If the array is not provided; the default tracks will be active. + */ + activeTrackIds: number[]; + + /** + * If the autoplay parameter is specified; the media player will begin playing the content when it is loaded. Even if autoplay is not specified;the media player implementation may choose to begin playback immediately. + */ + autoplay?: boolean; + + /** + * Optional user credentials. + */ + credentials?: string; + + /** + * Optional credentials type. The type 'cloud' is a reserved type used by load requests that were originated by voice assistant commands. + */ + credentialsType?: string; + + /** + * Seconds since beginning of content. If the content is live content; and currentTime is not specified; the stream will start at the live position. + */ + currentTime?: number; + + /** + * If the autoplay parameter is specified; the media player will begin playing the content when it is loaded. Even if autoplay is not specified; the media player implementation may choose to begin playback immediately. + */ + media: MediaInformation; + + /** + * The media playback rate. + */ + playbackRate?: number; + + /** + * Queue data. + */ + queueData: QueueData; + } + + /** + * LoadByEntity request data. + */ + export interface LoadByEntityRequestData { + /** + * Content entity information; typically represented by a stringified JSON object + */ + entity: string; + + /** + * Shuffle the items to play. + */ + shuffle?: boolean; + + /** + * Optional request source. It contain the assistent query that initiate the request. + */ + source?: string; + } + + /** + * Provides live seekable range with start and end time in seconds and two more attributes. + */ + export class LiveSeekableRange { + constructor( + start?: number, + end?: number, + isMovingWindow?: boolean, + isLiveDone?: boolean + ); + + /** + * A boolean value indicates whether a live stream is ended. If it is done; the end of live seekable range should stop updating. + */ + isLiveDone?: boolean; + + /** + * A boolean value indicates whether the live seekable range is a moving window. If false; it will be either a expanding range or a fixed range meaning live has ended. + */ + isMovingWindow?: boolean; + } + + /** + * Represents a data message containing item information for each requested ids. + */ + export interface ItemsInfo { + /** + * List of changed itemIds. + */ + items: QueueItem[]; + + /** + * The corresponding request id. + */ + requestId?: number; + + /** + * + */ + type: MessageType; + } + + /** + * An image that describes a receiver application or media item. + * This could be an application icon; cover art; or a thumbnail. + */ + export class Image { + constructor(url: string); + + /** + * The height of the image. + */ + height?: number; + + /** + * the URL to the image + */ + url: string; + + /** + * The width of the image + */ + width?: number; + } + /** Media event GET_STATUS request data. */ + export interface GetStatusRequestData extends RequestData { + /** + * The options of a GET_STATUS request. + */ + options: GetStatusOptions; + } + + /** + * Get items info request data. + */ + export interface GetItemsInfoRequestData extends RequestData { + constructor(itemIds: number[]): GetItemsInfoRequestData; + + /** + * List of item ids to be requested. + */ + itemIds: number[]; + } + /** + * A generic media description. + */ + export interface GenericMediaMetadata { + /** + * Content images. Examples would include cover art or a thumbnail of the currently playing media. + */ + images: Image[]; + + /** + * ISO 8601 date and/or time when the content was released; e.g. 2014-02-10. + */ + releaseDate?: string; + + /** + *@deprecated - use @see{@link releaseDate} instead + */ + releaseYear?: number; + + /** + * Content subtitle. + */ + subtitle?: string; + + /** + * Content title. + */ + title?: string; + } + + /** + * Focus state change message. + */ + export interface FocusStateRequestData { + /** + * The focus state of the app. + */ + state: FocusState; + } + + /** Fetch items request data. */ + export class FetchItemsRequestData extends RequestData { + constructor(itemId: number, nextCount: number, prevCount: number); + + /** + * ID of the reference media item for fetching more items. + */ + itemId: number; + + /** + * Number of items after the reference item to be fetched. + */ + nextCount: number; + + /** + * Number of items before the reference item to be fetched. + */ + prevCount: number; + } + + /** + * Extended media status information + */ + export class ExtendedMediaStatus { + constructor(playerState: MediaInformation, opt_media?: MediaInformation); + + /** + * + */ + media: MediaInformation; + + /** + * + */ + playerState: ExtendedPlayerState; + } + + /** Event data for @see{@link EventType.ERROR} event. */ + export class ErrorEvent { + constructor(detailedErrorCode?: DetailedErrorCode, error?: any); + /** + * An error code representing the cause of the error. + */ + detailedErrorCode?: DetailedErrorCode; + + /** + * The error object. + * This could be an Error object (e.g.; if an Error was thrown in an event handler) + * or an object with error information (e.g.; if the receiver received an invalid command). + */ + error?: any; + } + + export class ErrorData { + constructor(type: ErrorType); + + /** + * Application-specific data for this request. + * It enables the sender and receiver to easily extend the media protocol without having to use a new namespace with custom messages. + */ + customData?: any; + + /** + Id of the request; used to correlate request/response. + */ + requestId?: number; + } + + /** Media event EDIT_TRACKS_INFO request data. */ + export interface EditTracksInfoRequestData extends RequestData { + /** + * Array of the Track trackIds that should be active. + * If it is not provided; the active tracks will not change. + * If the array is empty; no track will be active. + */ + activeTrackIds?: number[]; + + /** + * Flag to enable or disable text tracks. + * If false it will disable all text tracks; + * if true it will enable the first text track; or the previous active text tracks. + * This flag is ignored if activeTrackIds or language is provided. + */ + enableTextTracks?: boolean; + + /** + * Indicates that the provided language was not explicit user request; but rather inferred from used language in voice query. + * It allows receiver apps to use user saved preference instead of spoken language. + */ + isSuggestedLanguage?: boolean; + + /** + * Language for the tracks that should be active. The language field will take precedence over activeTrackIds if both are specified. + */ + language?: string; + + /** + * + */ + textTrackStyle?: TextTrackStyle; + } + + /** + * Media event EDIT_AUDIO_TRACKS request data. If language is not provided; the default audio track for the media will be enabled. + */ + export interface EditAudioTracksRequestData extends RequestData { + /** + * Indicates that the provided language was not explicit user request; but rather inferred from used language in voice query. + * It allows receiver apps to use user saved preference instead of spoken language. + */ + isSuggestedLanguage?: boolean; + + /** + * + */ + language?: string; + } + + /** DisplayStatus request data. */ + export interface DisplayStatusRequestData { + /** + * Optional request source. It contain the assistent query that initiate the request. + */ + source: string; + } + + /** CustomCommand request data. */ + export interface CustomCommandRequestData { + /** + * Custom Data; typically represented by a stringified JSON object. + */ + data: string; + + /** + * Optional request source. It contain the assistent query that initiate the request. + */ + source: string; + } + /** Cloud media status. Media status that is only sent to the cloud sender. */ + export class CloudMediaStatus { + constructor(); + } + + export class BreakStatus { + constructor(currentBreakTime: number, currentBreakClipTime: number); + + /** + * Id of current break clip. + */ + breakClipId: string; + + /** + * Id of current break. + */ + breakId: string; + + /** + * Time in sec elapsed after current break clip starts. + */ + currentBreakClipTime: number; + + /** + * Time in sec elapsed after current break starts. + */ + currentBreakTime: number; + + /** + * The time in sec when this break clip becomes skippable. + * 5 means that end user can skip this break clip after 5 seconds. + * If this field is not defined; it means that current break clip is not skippable. + */ + whenSkippable: number; + } + + /** + * Represents break clip (e.g. a clip of ad during ad break) + */ + export class BreakClip { + constructor(id: string); + + /** + * Url of page that sender will display; when end user clicks link on sender UI; while receiver is playing this clip. + */ + clickThroughUrl?: string; + /** + * Typically the url of the break media (playing on the receiver). + */ + contentId?: string; + /** + * The content MIME type. + */ + contentType?: string; + /** + * Optional break media url; to allow using contentId for real id. + * If contentUrl is provided; it will be used as media url; otherwise the contentId will be used as the media url. + */ + contentUrl?: string; + /** + * Application-specific break clip data. + */ + customData?: any; + /** + * Duration of break clip in sec. + */ + duration?: number; + /** + * The format of the HLS media segment. + */ + hlsSegmentFormat: HlsSegmentFormat; + /** + * Unique id of break clip. + */ + id: string; + /** + * Url of content that sender will display while receiver is playing this clip. + */ + posterUrl?: string; + /** + * Title of break clip. Sender might display this on its screen; if provided. + */ + title?: string; + /** + * VAST ad request configuration. Used if contentId or contentUrl is not provided. + */ + vastAdsRequest: VastAdsRequest; + /** + * The time in sec when this break clip becomes skippable. + * 5 means that end user can skip this break clip after 5 seconds. + * If this field is not defined; it means that current break clip is not skippable. + */ + whenSkippable?: number; + } + + /** Represents break (e.g. ad break) included in main video. */ + export class Break { + constructor(id: string, breakClipIds: string[], position: number); + /** + * List of ids of break clip that this break includes. + */ + breakClipIds: string[]; + /** + * Duration of break in sec. + */ + duration?: number; + /** + * Unique id of break. + */ + id: string; + /** + * If true; indicates this is embedded break in main stream. + */ + isEmbedded?: boolean; + /** + * Whether break is watched. + * Sender can change color of progress bar marker corresponding to this break once this field changes from false to true; + * denoting that the end-user already watched this break. + */ + isWatched: boolean; + /** + * Where the break is located inside main video. -1 represents the end of main video. + */ + position: number; + } +} diff --git a/types/chromecast-caf-receiver/cast.framework.system.d.ts b/types/chromecast-caf-receiver/cast.framework.system.d.ts new file mode 100644 index 0000000000..1f465761b0 --- /dev/null +++ b/types/chromecast-caf-receiver/cast.framework.system.d.ts @@ -0,0 +1,177 @@ +// Type definitions for chromecast-caf-receiver 3.x +// Project: https://developers.google.com/cast/docs/reference/caf_receiver/ +// Definitions by: Craig Bruce https://github.com/craigrbruce +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// +/// +/// +/// +/// + +import { EventType } from './cast.framework.events'; +export = cast.framework.system; + +declare namespace cast.framework.system { + export type SystemState = + | 'NOT_STARTED' + | 'STARTING_IN_BACKGROUND' + | 'STARTING' + | 'READY' + | 'STOPPING_IN_BACKGROUND' + | 'STOPPING'; + + export type StandbyState = 'STANDBY' | 'NOT_STANDBY' | 'UNKNOWN'; + + export type DisconnectReason = 'REQUESTED_BY_SENDER' | 'ERROR' | 'UNKNOWN'; + + /** + * Event dispatched by @see{@link CastReceiverManager} when the visibility of the application changes (HDMI input change; TV is turned off). + */ + export class VisibilityChangedEvent { + constructor(isVisible: boolean); + + /** + * Whether the Cast device is the active input or not. + */ + isVisible: boolean; + } + + /** + * Represents the system volume data. + */ + export interface SystemVolumeData { + /** + * The level (from 0.0 to 1.0) of the system volume. + */ + level: number; + + /** + * Whether the system volume is muted or not. + */ + muted: boolean; + } + /** + * Event dispatched by @see{CastReceiverManager} when the system volume changes. + */ + export class SystemVolumeChangedEvent extends Event { + constructor(volume: SystemVolumeData); + + /** + * The system volume data + */ + data: SystemVolumeData; + } + /** + * Event dispatched by @see{@link CastReceiverManager} when the TV enters/leaves the standby state. + */ + export class StandbyChangedEvent { + constructor(isStandby: boolean); + + /** + * + */ + isStandby: boolean; + } + /** + * Whether the TV is in standby or not. + */ + export interface ShutdownEvent extends Event {} + + /** + * Event dispatched by @see{@link CastReceiverManager} when a sender is disconnected. + */ + export class SenderDisconnectedEvent extends Event { + constructor(senderId: string, userAgent: string); + /** + * The ID of the sender connected. + */ + senderId: string; + + /** + * The user agent of the sender. + */ + userAgent: string; + + /** + * The reason the sender was disconnected. + */ + reason?: DisconnectReason; + } + + /** + * Event dispatched by @see{@link CastReceiverManager} when a sender is connected. + */ + export class SenderConnectedEvent extends Event { + constructor(senderId: string, userAgent: string); + /** + * The ID of the sender connected. + */ + senderId: string; + + /** + * The user agent of the sender. + */ + userAgent: string; + } + + /** + * Represents the data of a connected sender device. + */ + export interface Sender { + /** + * The sender Id. + */ + id: string; + + /** + * Indicate the sender supports large messages (>64KB). + */ + largeMessageSupported?: boolean; + + /** + * The userAgent of the sender. + */ + userAgent?: string; + } + + /** + * Event dispatched by CastReceiverManager when the system is ready. + */ + export class ReadyEvent { + constructor(applicationData: ApplicationData); + + /** + * The application data + */ + data: ApplicationData; + } + + /** + * Event dispatched by @see{@link CastReceiverManager} when the system needs to update the restriction on maximum video resolution. + */ + export class MaxVideoResolutionChangedEvent extends Event { + constructor(height: number); + + /** + * Maximum video resolution requested by the system. The value of 0 means there is no restriction. + */ + height: number; + } + /** Event dispatched by @see{@link CastReceiverManager} when the systems starts to create feedback report. */ + export interface FeedbackStartedEvent extends Event {} + /** Event dispatched by @see{@link CastReceiverContext} which contains system information. */ + export class Event { + constructor(type: EventType, data?: any); + } + + /** Represents the data of the launched application. */ + export interface ApplicationData { + id(): string; + launchingSenderId(): string; + name(): string; + namespaces(): string[]; + sessionId(): number; + } +} diff --git a/types/chromecast-caf-receiver/cast.framework.ui.d.ts b/types/chromecast-caf-receiver/cast.framework.ui.d.ts new file mode 100644 index 0000000000..fbc61f56d0 --- /dev/null +++ b/types/chromecast-caf-receiver/cast.framework.ui.d.ts @@ -0,0 +1,194 @@ +// Type definitions for chromecast-caf-receiver 3.x +// Project: https://developers.google.com/cast/docs/reference/caf_receiver/ +// Definitions by: Craig Bruce https://github.com/craigrbruce +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// +/// +/// +/// +/// + +import { PlayerDataEventType } from './cast.framework.ui'; +import { MediaMetadata } from './cast.framework.messages'; + +export = cast.framework.ui; + +declare namespace cast.framework.ui { + export type ContentType = 'VIDEO' | 'AUDIO' | 'IMAGE'; + + export type State = + | 'LAUNCHING' + | 'IDLE' + | 'LOADING' + | 'BUFFERING' + | 'PAUSED' + | 'PLAYING'; + + export type PlayerDataEventType = + | 'ANY_CHANGE' + | 'STATE_CHANGED' + | 'IS_SEEKING_CHANGED' + | 'DURATION_CHANGED' + | 'CURRENT_TIME_CHANGED' + | 'METADATA_CHANGED' + | 'TITLE_CHANGED' + | 'SUBTITLE_CHANGED' + | 'THUMBNAIL_URL_CHANGED' + | 'NEXT_TITLE_CHANGED' + | 'NEXT_SUBTITLE_CHANGED' + | 'NEXT_THUMBNAIL_URL_CHANGED' + | 'PRELOADING_NEXT_CHANGED' + | 'CONTENT_TYPE_CHANGED' + | 'IS_LIVE_CHANGED' + | 'BREAK_PERCENTAGE_POSITIONS_CHANGED' + | 'IS_PLAYING_BREAK_CHANGED' + | 'IS_BREAK_SKIPPABLE_CHANGED' + | 'WHEN_SKIPPABLE_CHANGED' + | 'NUMBER_BREAK_CLIPS_CHANGED' + | 'CURRENT_BREAK_CLIP_NUMBER_CHANGED' + | 'DISPLAY_STATUS_CHANGED'; + + /** + * Player data changed event. Provides the changed field (type); and new value. + */ + export class PlayerDataChangedEvent { + constructor(type: PlayerDataEventType, field: string, value: any); + + /** + * The field name that was changed. + */ + field: string; + + /** + * + */ + type: PlayerDataEventType; + + /** + * The new field value. + */ + value: any; + } + /** + * Player data binder. Bind a player data object to the player state. The player data will be updated to reflect correctly the current player state without firing any change event. + */ + export class PlayerDataBinder { + constructor(playerData: PlayerData | any); + + /** + * Add listener to player data changes. + */ + // addEventListener: (type: PlayerDataEventType; listener: PlayerDataChangedEventHandler); + + /** + * Remove listener to player data changes. + */ + // removeEventListener: (type: PlayerDataEventType; listener: PlayerDataChangedEventHandler); + } + /** + * Player data. Provide the player media and break state. + */ + export interface PlayerData { + /** + * Array of breaks positions in percentage. + */ + breakPercentagePositions: number[]; + + /** + * Content Type. + */ + contentType: ContentType; + + /** + * The number of the current playing break clip in the break. + */ + currentBreakClipNumber: number; + + /** + * Media current position in seconds; or break current position if playing break. + */ + currentTime: number; + + /** + * Whether the player metadata (ie: title; currentTime) should be displayed. This will be true if at least one field in the metadata should be displayed. In some cases; displayStatus will be true; but parts of the metadata should be hidden (ie: the media title while media is seeking). In these cases; additional css can be applied to hide those elements. For cases where the media is audio-only; this will almost always be true. In cases where the media is video; this will be true when: (1) the video is loading; buffering; or seeking (2) a play request was made in the last five seconds while media is already playing; (3) there is a request made to show the status in the last five seconds; or (4) the media was paused in the last five seconds. + */ + displayStatus: boolean; + + /** + * Media duration in seconds; Or break duration if playing break. + */ + duration: number; + + /** + * Indicate break clip can be skipped. + */ + isBreakSkippable: boolean; + + /** + * Indicate if the content is a live stream. + */ + isLive: boolean; + + /** + * Indicate that the receiver is playing a break. + */ + isPlayingBreak: boolean; + + /** + * Indicate the player is seeking (can be either during playing or pausing). + */ + isSeeking: boolean; + + /** + * Media metadata. + */ + metadata: MediaMetadata | any; + + /** + * Next Item subtitle. + */ + nextSubtitle: string; + + /** + * Next Item thumbnail url. + */ + nextThumbnailUrl: string; + + /** + * Next Item title. + */ + nextTitle: string; + + /** + * Number of break clips in current break. + */ + numberBreakClips: number; + + /** + * Flag to show/hide next item metadata. + */ + preloadingNext: boolean; + + /** + * Current player state. + */ + state: State; + + /** + * Content thumbnail url. + */ + thumbnailUrl: string; + + /** + * Content title. + */ + title: string; + + /** + * Provide the time a break is skipable - relative to current playback time. Undefined if not skippable. + */ + whenSkippable?: number; + } +} diff --git a/types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts b/types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts new file mode 100644 index 0000000000..a4f59bd985 --- /dev/null +++ b/types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts @@ -0,0 +1,66 @@ +// Type definitions for chromecast-caf-receiver 3.x +// Project: https://developers.google.com/cast/docs/reference/caf_receiver/ +// Definitions by: Craig Bruce https://github.com/craigrbruce +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// +/// +/// +/// +/// +/// + +import { TextTracksManager } from "cast.framework"; +import { StandbyChangedEvent } from "cast.framework.system"; +import { PlayerData, ContentType } from "cast.framework.ui"; +import { BreakManager } from "cast.framework.breaks"; +import { MediaStatusEvent } from "cast.framework.events"; +import { Track, Break, MediaStatus, QueueData } from "cast.framework.messages"; + +const ct = ContentType.VIDEO; +// framework tests +const track = new Track(123, {}); +const ttm = new TextTracksManager({}); +ttm.addTracks(track); + +// $ExpectError +ttm.addTracks("should fail"); + +// system tests +const sce = new StandbyChangedEvent(true); +// $ExpectError +const wrongSce = new StandbyChangedEvent("error"); + +const result: boolean = sce.isStandby; +// $ExpectError +const failure: string = sce.isStandby; + +// ui tests +const pd = new PlayerData(); + +const cn: number = pd.currentBreakClipNumber; +// $ExpectError +const wrongCn: boolean = pd.currentBreakClipNumber; + +// breaks tests +const bm: BreakManager = new BreakManager(); +const brk1: Break = bm.getBreakById("123"); +// $ExpectError +const brk2: string = bm.getBreakById("123"); +// $ExpectError +const brk3: Break = bm.getBreakById(123); +// events tests + +const evt: MediaStatusEvent = new MediaStatusEvent(); +const ms: MediaStatus = evt.mediaStatus; +// $ExpectError +const ms: string = evt.mediaStatus; + +// messages tests +const qd = new QueueData("id", "name", "description", "mode"); +// $ExpectError +const wrongQd = new QueueData({}); +const name: string = qd.name; +// $ExpectError +const wrongName: number = qd.name; diff --git a/types/chromecast-caf-receiver/index.d.ts b/types/chromecast-caf-receiver/index.d.ts new file mode 100644 index 0000000000..5dc89456e6 --- /dev/null +++ b/types/chromecast-caf-receiver/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for chromecast-caf-receiver 3.x +// Project: https://developers.google.com/cast/docs/reference/caf_receiver/ +// Definitions by: Craig Bruce https://github.com/craigrbruce +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// +/// +/// +/// +/// + +import { PlayerDataChangedEvent } from './cast.framework.ui'; +import { NetworkRequestInfo } from './cast.framework'; +import { Event } from './cast.framework.events'; + +export = cast; +declare namespace cast { + export type EventHandler = (event: Event) => void; + export type PlayerDataChangedEventHandler = ( + event: PlayerDataChangedEvent + ) => void; + export type RequestHandler = (request: NetworkRequestInfo) => void; + export type BinaryHandler = (data: Uint8Array) => Uint8Array; +} diff --git a/types/chromecast-caf-receiver/tsconfig.json b/types/chromecast-caf-receiver/tsconfig.json new file mode 100644 index 0000000000..5c13aa8765 --- /dev/null +++ b/types/chromecast-caf-receiver/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "chromecast-caf-receiver-tests.ts" + ] +} diff --git a/types/chromecast-caf-receiver/tslint.json b/types/chromecast-caf-receiver/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/chromecast-caf-receiver/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From d6c651c1b3a98c9ca5a7464bff678605b5e77c04 Mon Sep 17 00:00:00 2001 From: Tim Wang Date: Fri, 23 Mar 2018 13:16:51 +0800 Subject: [PATCH 0146/2153] Add back params generic and remove remain action generic. Add support for stateless screen. --- types/react-navigation/index.d.ts | 65 ++++++++++--------- .../react-navigation-tests.tsx | 31 +++++++-- 2 files changed, 62 insertions(+), 34 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 0e6bb2d94c..47304a1856 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-navigation 1.2 +// Type definitions for react-navigation 1.5 // Project: https://github.com/react-navigation/react-navigation // Definitions by: Huhuanming // mhcgrq @@ -45,7 +45,6 @@ export interface HeaderProps extends NavigationSceneRendererProps { mode: HeaderMode; router: NavigationRouter< NavigationState, - NavigationAction, NavigationStackScreenOptions >; getScreenDetails: (navigationScene: NavigationScene) => NavigationScreenDetails< @@ -75,9 +74,9 @@ export interface NavigationState { routes: any[]; } -export type NavigationRoute = NavigationLeafRoute | NavigationStateRoute; +export type NavigationRoute = NavigationLeafRoute | NavigationStateRoute; -export interface NavigationLeafRoute { +export interface NavigationLeafRoute { /** * React's key used by some navigators. No need to specify these manually, * they will be defined by the router. @@ -96,23 +95,23 @@ export interface NavigationLeafRoute { * Params passed to this route when navigating to it, * e.g. `{ car_id: 123 }` in a route that displays a car. */ - params?: NavigationParams; + params?: Params; } -export type NavigationStateRoute = NavigationLeafRoute & NavigationState; +export type NavigationStateRoute = NavigationLeafRoute & NavigationState; export type NavigationScreenOptionsGetter = ( - navigation: NavigationScreenProp, + navigation: NavigationScreenProp>, screenProps?: { [key: string]: any } ) => Options; -export interface NavigationRouter { +export interface NavigationRouter { /** * The reducer that outputs the new navigation state for a given action, with * an optional previous state. When the action is considered handled but the * state is unchanged, the output state is null. */ - getStateForAction: (action: Action, lastState?: State) => (State | null); + getStateForAction: (action: NavigationAction, lastState?: State) => (State | null); /** * Maps a URI-like string to an action. This can be mapped to a state @@ -121,7 +120,7 @@ export interface NavigationRouter { getActionForPathAndParams: ( path: string, params?: NavigationParams - ) => (Action | null); + ) => (NavigationAction | null); getPathAndParamsForState: ( state: State @@ -175,16 +174,24 @@ export type NavigationScreenConfig = export type NavigationComponent = NavigationScreenComponent - | NavigationNavigator; + | NavigationNavigator + | any; -export interface NavigationScreenComponent extends React.ComponentClass { - navigationOptions?: NavigationScreenConfig; -} +export type NavigationScreenComponent< + Options = {}, + Props = {} +> = React.ComponentType & Props> & +({} | { navigationOptions: NavigationScreenConfig }); -export interface NavigationNavigator extends React.ComponentClass { - router?: NavigationRouter; - navigationOptions?: NavigationScreenConfig; -} + +export type NavigationNavigator< + State = NavigationState, + Options = {}, + Props = {} +> = React.ComponentType & Props> & { + router: NavigationRouter, + navigationOptions?: NavigationScreenConfig | any, +}; export interface NavigationParams { [key: string]: any; @@ -452,10 +459,10 @@ export interface NavigationScreenProp { popToTop: (params?: { immediate?: boolean }) => boolean; } -export interface NavigationNavigatorProps { +export interface NavigationNavigatorProps { navigation?: NavigationProp; screenProps?: { [key: string]: any }; - navigationOptions?: any; + navigationOptions?: O; } /** @@ -587,7 +594,7 @@ export interface NavigationContainerProps { export interface NavigationContainer extends React.ComponentClass< NavigationContainerProps & NavigationNavigatorProps > { - router: NavigationRouter; + router: NavigationRouter; screenProps: { [key: string]: any }; navigationOptions: any; state: { nav: NavigationState | null }; @@ -810,7 +817,7 @@ export class Transitioner extends React.Component< export function TabRouter( routeConfigs: NavigationRouteConfigMap, config: NavigationTabRouterConfig -): NavigationRouter; +): NavigationRouter; /** * Stack Router @@ -820,19 +827,19 @@ export function TabRouter( export function StackRouter( routeConfigs: NavigationRouteConfigMap, config: NavigationTabRouterConfig -): NavigationRouter; +): NavigationRouter; /** * Create Navigator * * @see https://github.com/react-navigation/react-navigation/blob/master/src/navigators/createNavigator.js */ -export function createNavigator( - router: NavigationRouter, +export function createNavigator( + router: NavigationRouter, routeConfigs?: NavigationRouteConfigMap, navigatorConfig?: {} | null, navigatorType?: NavigatorType -): (NavigationView: React.ComponentClass) => NavigationNavigator; +): (NavigationView: React.ComponentClass) => NavigationNavigator; /** * Create an HOC that injects the navigation and manages the navigation state @@ -843,7 +850,7 @@ export function createNavigator( * @see https://github.com/react-navigation/react-navigation/blob/master/src/createNavigationContainer.js */ export function createNavigationContainer( - Component: NavigationNavigator + Component: NavigationNavigator ): NavigationContainer; /** * END MANUAL DEFINITIONS OUTSIDE OF TYPEDEFINITION.JS @@ -853,8 +860,8 @@ export function createNavigationContainer( * BEGIN CUSTOM CONVENIENCE INTERFACES */ -export interface NavigationScreenProps { - navigation: NavigationScreenProp; +export interface NavigationScreenProps { + navigation: NavigationScreenProp>; screenProps?: { [key: string]: any }; navigationOptions?: NavigationScreenConfig; } diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index d0e65dfc8e..4c8ff5dd99 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -36,6 +36,7 @@ import { NavigationParams, NavigationPopAction, NavigationPopToTopAction, + NavigationScreenComponent, } from 'react-navigation'; // Constants @@ -48,14 +49,19 @@ const viewStyle: ViewStyle = { const ROUTE_NAME_START_SCREEN = "StartScreen"; +interface StartScreenNavigationParams { + id: number; + s: string; +} + /** * @desc Simple screen component class with typed component props that should * receive the navigation prop from the AppNavigator. */ -class StartScreen extends React.Component { +class StartScreen extends React.Component> { render() { // Implicit type checks. - const navigationStateParams = this.props.navigation.state.params; + const navigationStateParams: StartScreenNavigationParams | void = this.props.navigation.state.params; const id = this.props.navigation.state.params && this.props.navigation.state.params.id; const s = this.props.navigation.state.params && this.props.navigation.state.params.s; @@ -84,10 +90,15 @@ class StartScreen extends React.Component { const ROUTE_NAME_NEXT_SCREEN = "NextScreen"; -class NextScreen extends React.Component { +interface NextScreenNavigationParams { + id: number; + name: string; +} + +class NextScreen extends React.Component> { render() { // Implicit type checks. - const navigationStateParams = this.props.navigation.state.params; + const navigationStateParams: NextScreenNavigationParams | void = this.props.navigation.state.params; const id = this.props.navigation.state.params && this.props.navigation.state.params.id; const name = this.props.navigation.state.params && this.props.navigation.state.params.name; @@ -100,7 +111,7 @@ class NextScreen extends React.Component { const navigationOptions = { headerBackTitle: null, }; -const initialRouteParams: NavigationParams = { +const initialRouteParams: StartScreenNavigationParams = { id: 1, s: "Start", }; @@ -123,6 +134,16 @@ export const AppNavigator = StackNavigator( }, ); +const StatelessScreen: NavigationScreenComponent<{}, {}> = () => ; + +const SimpleStackNavigator = StackNavigator( + { + simple: { + screen: StatelessScreen, + }, + } +) + /** * Router. */ From 8731027ec5db8ba1465e0b82492ee55ed63beaa5 Mon Sep 17 00:00:00 2001 From: Tim Wang Date: Fri, 23 Mar 2018 13:29:00 +0800 Subject: [PATCH 0147/2153] Fix CI --- types/react-navigation/index.d.ts | 1 - types/react-navigation/react-navigation-tests.tsx | 8 ++++---- types/react-navigation/tslint.json | 7 ++++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 47304a1856..3c6bffe130 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -183,7 +183,6 @@ export type NavigationScreenComponent< > = React.ComponentType & Props> & ({} | { navigationOptions: NavigationScreenConfig }); - export type NavigationNavigator< State = NavigationState, Options = {}, diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 4c8ff5dd99..5c03253d35 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -61,7 +61,7 @@ interface StartScreenNavigationParams { class StartScreen extends React.Component> { render() { // Implicit type checks. - const navigationStateParams: StartScreenNavigationParams | void = this.props.navigation.state.params; + const navigationStateParams: StartScreenNavigationParams | undefined = this.props.navigation.state.params; const id = this.props.navigation.state.params && this.props.navigation.state.params.id; const s = this.props.navigation.state.params && this.props.navigation.state.params.s; @@ -98,7 +98,7 @@ interface NextScreenNavigationParams { class NextScreen extends React.Component> { render() { // Implicit type checks. - const navigationStateParams: NextScreenNavigationParams | void = this.props.navigation.state.params; + const navigationStateParams: NextScreenNavigationParams | undefined = this.props.navigation.state.params; const id = this.props.navigation.state.params && this.props.navigation.state.params.id; const name = this.props.navigation.state.params && this.props.navigation.state.params.name; @@ -134,7 +134,7 @@ export const AppNavigator = StackNavigator( }, ); -const StatelessScreen: NavigationScreenComponent<{}, {}> = () => ; +const StatelessScreen: NavigationScreenComponent = () => ; const SimpleStackNavigator = StackNavigator( { @@ -142,7 +142,7 @@ const SimpleStackNavigator = StackNavigator( screen: StatelessScreen, }, } -) +); /** * Router. diff --git a/types/react-navigation/tslint.json b/types/react-navigation/tslint.json index 3db14f85ea..d9d49e375e 100644 --- a/types/react-navigation/tslint.json +++ b/types/react-navigation/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-any-union": false + } +} From 8d4ee5cd512c407721d8e33d507f1312a6e6f512 Mon Sep 17 00:00:00 2001 From: Jovica Zoric Date: Fri, 23 Mar 2018 10:09:33 +0100 Subject: [PATCH 0148/2153] fix(react-sortable-tree): Fix PreviousAnNextLocation type * Rename nextParent to nextParentNode * Remove prevParent because it doesn't exist --- types/react-sortable-tree/index.d.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/types/react-sortable-tree/index.d.ts b/types/react-sortable-tree/index.d.ts index 441e0bb61b..345bd3c601 100644 --- a/types/react-sortable-tree/index.d.ts +++ b/types/react-sortable-tree/index.d.ts @@ -52,12 +52,11 @@ export interface OnVisibilityToggleData extends FullTree, TreeNode { expanded: boolean; } export interface PreviousAnNextLocation { - prevPath: number[]; - prevParent: TreeItem; prevTreeIndex: number; - nextPath: number[]; - nextParent: TreeItem; + prevPath: number[]; nextTreeIndex: number; + nextPath: number[]; + nextParentNode: TreeItem; } export type NodeRenderer = React.ComponentClass; From f3b3166bb0713c90d2c37298f056b56863c3ab39 Mon Sep 17 00:00:00 2001 From: hisorange Date: Fri, 23 Mar 2018 10:16:38 +0100 Subject: [PATCH 0149/2153] Add missing 'bclient' type --- types/bull/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index 97cb7a23df..296009c4bd 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -41,7 +41,7 @@ declare namespace Bull { * When specified, the `Queue` will use this function to create new `ioredis` client connections. * This is useful if you want to re-use connections. */ - createClient?(type: 'client' | 'subscriber', redisOpts?: Redis.RedisOptions): Redis.Redis; + createClient?(type: 'client' | 'subscriber' | 'bclient', redisOpts?: Redis.RedisOptions): Redis.Redis; /** * Prefix to use for all redis keys From 93a7241b1e82e749fcceac58e2abe8e05760f178 Mon Sep 17 00:00:00 2001 From: Justin Chew Date: Fri, 23 Mar 2018 13:04:32 +0000 Subject: [PATCH 0150/2153] Correct casing for modernizr --- types/modernizr/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/modernizr/index.d.ts b/types/modernizr/index.d.ts index ff88e9f523..a9cfb92f54 100644 --- a/types/modernizr/index.d.ts +++ b/types/modernizr/index.d.ts @@ -448,6 +448,6 @@ interface ModernizrAPI { interface ModernizrStatic extends ModernizrAPI, FeatureDetects { } declare var Modernizr: ModernizrStatic; -declare module "Modernizr" { +declare module "modernizr" { export = Modernizr; } From 54b3965d34e7bdfb63b130fe1fe20bf26837b5bb Mon Sep 17 00:00:00 2001 From: Albert Yu Date: Fri, 23 Mar 2018 21:20:46 +0800 Subject: [PATCH 0151/2153] [@types/ember-qunit] add missing definition for `setupApplicationTest` --- types/ember-qunit/index.d.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/types/ember-qunit/index.d.ts b/types/ember-qunit/index.d.ts index a669b977e1..ea129ec3ec 100644 --- a/types/ember-qunit/index.d.ts +++ b/types/ember-qunit/index.d.ts @@ -44,6 +44,20 @@ declare module 'ember-qunit' { */ export function setResolver(resolver: Ember.Resolver): void; + /** + * Sets up acceptance tests. + * + * The `setupApplicationTest` function is used for all acceptance tests. It + * is invoked in the callback scope of a QUnit module (aka "nested module"). + * + * Once invoked, all subsequent hooks.beforeEach and test invocations will + * have access to the following: + * * `this.owner` - the owner object that been set on the test context. + * * `this.pauseTest` and `this.resumeTest` - allow easy pausing/resuming of tests. + * * `this.element` which returns the DOM element representing the application's root element. + */ + export function setupApplicationTest(hooks: NestedHooks): void; + /** * Sets up tests that need to render snippets of templates. * @@ -80,7 +94,7 @@ declare module 'ember-qunit' { */ export function setupTest(hooks: NestedHooks): void; - export class QUnitAdapter extends Ember.Test.Adapter {} + export class QUnitAdapter extends Ember.Test.Adapter { } export { module, test, skip, only, todo } from 'qunit'; } From 9526aa700f36ebea5c10c592e16506ff72b63061 Mon Sep 17 00:00:00 2001 From: Albert Yu Date: Fri, 23 Mar 2018 21:21:37 +0800 Subject: [PATCH 0152/2153] [@types/ember-qunit] improve `skip` definition to align with others --- types/ember-qunit/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/ember-qunit/index.d.ts b/types/ember-qunit/index.d.ts index ea129ec3ec..ad12f43ffc 100644 --- a/types/ember-qunit/index.d.ts +++ b/types/ember-qunit/index.d.ts @@ -161,9 +161,10 @@ declare module 'qunit' { * ignoring the callback argument and the respective global and module's * hooks. * - * @param Title of unit being tested + * @param name Title of unit being tested + * @param callback Function to close over assertions */ - export const skip: typeof QUnit.skip; + export function skip(name: string, callback: (this: TestContext, assert: Assert) => void): void; export default QUnit; } From 64dde8ee374ac9fbc642b5a7319dea63dcd49661 Mon Sep 17 00:00:00 2001 From: Edward Sammut Alessi Date: Fri, 23 Mar 2018 14:25:10 +0100 Subject: [PATCH 0153/2153] Update name of creator --- types/steamid/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/steamid/index.d.ts b/types/steamid/index.d.ts index 37967db201..e8b754ad57 100644 --- a/types/steamid/index.d.ts +++ b/types/steamid/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for steamid 1.1 // Project: https://github.com/DoctorMcKay/node-steamid -// Definitions by: My Self +// Definitions by: Edward Sammut Alessi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 From 371c3bad16e85ae06a2b8bd5b0ec240d02f1119f Mon Sep 17 00:00:00 2001 From: Lenny Date: Fri, 23 Mar 2018 08:39:11 -0500 Subject: [PATCH 0154/2153] @types\mapbox-gl Change RasterSource URL to optional. --- types/mapbox-gl/index.d.ts | 2 +- types/mapbox-gl/mapbox-gl-tests.ts | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index a51172daec..24dca985e4 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -610,7 +610,7 @@ declare namespace mapboxgl { interface RasterSource extends Source { type: 'raster'; - url: string; + url?: string; tiles?: string[]; minzoom?: number; maxzoom?: number; diff --git a/types/mapbox-gl/mapbox-gl-tests.ts b/types/mapbox-gl/mapbox-gl-tests.ts index 422cb3913d..ce10a26564 100644 --- a/types/mapbox-gl/mapbox-gl-tests.ts +++ b/types/mapbox-gl/mapbox-gl-tests.ts @@ -205,6 +205,22 @@ var videoSourceObj = new mapboxgl.VideoSource({ map.addSource('some id', videoSourceObj); // add map.removeSource('some id'); // remove +/** + * Add Raster Source /// made URL optional to allow only tiles. + */ +map.addSource('radar', { + type: 'raster', + tiles: ['https://nowcoast.noaa.gov/arcgis/services/nowcoast/radar_meteo_imagery_nexrad_time/MapServer/WmsServer?bbox={bbox-epsg-3857}&service=WMS&request=GetMap&version=1.3.0&layers=1&styles=&format=image/png&transparent=true&height=256&width=256&crs=EPSG:3857'], + tileSize: 256 +}) + +map.addLayer({ + id: 'radar', + type: 'raster', + source: 'radar', + paint: {} +}) + /** * Popup */ From e4edb35bf5f59e24129021c27ea6a2347e582ef8 Mon Sep 17 00:00:00 2001 From: Albert Yu Date: Fri, 23 Mar 2018 21:39:33 +0800 Subject: [PATCH 0155/2153] fix: let callback be optional to pass the test case --- types/ember-qunit/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/ember-qunit/index.d.ts b/types/ember-qunit/index.d.ts index ad12f43ffc..9dc93b980b 100644 --- a/types/ember-qunit/index.d.ts +++ b/types/ember-qunit/index.d.ts @@ -164,7 +164,7 @@ declare module 'qunit' { * @param name Title of unit being tested * @param callback Function to close over assertions */ - export function skip(name: string, callback: (this: TestContext, assert: Assert) => void): void; + export function skip(name: string, callback?: (this: TestContext, assert: Assert) => void): void; export default QUnit; } From f2b858e68f4c06db40dad388805b14ddac829963 Mon Sep 17 00:00:00 2001 From: doomsower Date: Fri, 23 Mar 2018 16:49:30 +0300 Subject: [PATCH 0156/2153] Some changes to react-navigation --- types/react-navigation/index.d.ts | 31 ++++++++--- .../react-navigation-tests.tsx | 52 ++++++++++++++++++- 2 files changed, 73 insertions(+), 10 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 0e6bb2d94c..379a24d4ba 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -77,7 +77,7 @@ export interface NavigationState { export type NavigationRoute = NavigationLeafRoute | NavigationStateRoute; -export interface NavigationLeafRoute { +export interface NavigationLeafRoute

    { /** * React's key used by some navigators. No need to specify these manually, * they will be defined by the router. @@ -96,7 +96,7 @@ export interface NavigationLeafRoute { * Params passed to this route when navigating to it, * e.g. `{ car_id: 123 }` in a route that displays a car. */ - params?: NavigationParams; + params?: P; } export type NavigationStateRoute = NavigationLeafRoute & NavigationState; @@ -175,6 +175,7 @@ export type NavigationScreenConfig = export type NavigationComponent = NavigationScreenComponent + | NavigationStatelessScreen | NavigationNavigator; export interface NavigationScreenComponent extends React.ComponentClass { @@ -299,7 +300,7 @@ export interface NavigationStackRouterConfig { initialRouteName?: string; initialRouteParams?: NavigationParams; paths?: NavigationPathsConfig; - navigationOptions?: NavigationScreenConfig; + navigationOptions?: NavigationScreenConfig; } export type NavigationStackAction = @@ -339,7 +340,7 @@ export interface NavigationPathsConfig { export interface NavigationTabRouterConfig { initialRouteName?: string; paths?: NavigationPathsConfig; - navigationOptions?: NavigationScreenConfig; + navigationOptions?: NavigationScreenConfig; order?: string[]; // todo: type these as the real route names rather than 'string' // Does the back button cause the router to switch to the initial tab @@ -433,7 +434,8 @@ export interface NavigationScreenProp { params?: P, action?: NavigationAction, ): boolean; - setParams: (newParams: NavigationParams) => boolean; + getParam: (param: T, fallback?: P[T]) => P[T]; + setParams: (newParams: P) => boolean; addListener: ( eventName: string, callback: NavigationEventCallback @@ -853,12 +855,25 @@ export function createNavigationContainer( * BEGIN CUSTOM CONVENIENCE INTERFACES */ -export interface NavigationScreenProps { - navigation: NavigationScreenProp; +export interface NavigationScreenProps

    { + navigation: NavigationScreenProp; screenProps?: { [key: string]: any }; - navigationOptions?: NavigationScreenConfig; + navigationOptions?: NavigationScreenConfig; } +export type AnyScreenOptions = + NavigationDrawerScreenOptions & + NavigationStackScreenOptions & + NavigationTabScreenOptions; + +export interface NavigationScreenStatic { + navigationOptions?: NavigationScreenConfig; +} + +export type NavigationStatelessScreen = + React.StatelessComponent> & + NavigationScreenStatic; + /** * END CUSTOM CONVENIENCE INTERFACES */ diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index d0e65dfc8e..496009688e 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -36,6 +36,10 @@ import { NavigationParams, NavigationPopAction, NavigationPopToTopAction, + NavigationScreenStatic, + NavigationScreenConfig, + AnyScreenOptions, + NavigationStatelessScreen, } from 'react-navigation'; // Constants @@ -84,12 +88,24 @@ class StartScreen extends React.Component { const ROUTE_NAME_NEXT_SCREEN = "NextScreen"; -class NextScreen extends React.Component { +interface NextScreenParams { + id: string; + name: string; +} + +class NextScreen extends React.Component> { + static navigationOptions: NavigationScreenConfig = { + tabBarLabel: 'Next tab', + drawerLabel: 'Next drawe label', + }; + render() { // Implicit type checks. const navigationStateParams = this.props.navigation.state.params; + // typeof id is any const id = this.props.navigation.state.params && this.props.navigation.state.params.id; - const name = this.props.navigation.state.params && this.props.navigation.state.params.name; + // typeof name is string + const name = this.props.navigation.getParam('name', 'Peter'); return ( @@ -97,6 +113,29 @@ class NextScreen extends React.Component { } } +const ROUTE_NAME_ANOTHER_SCREEN = "AnotherScreen"; + +interface AnotherScreenParams { + color: string; +} + +interface AnotherScreenProps { + apolloData: number[]; // Demonstrates that screen can be wrapped into HOCs +} + +// View below compiles without TS errors, because props and navigation params are strongly typed +const AnotherScreen: NavigationStatelessScreen = ({ apolloData, navigation }) => ( + +) + +// Demonstrates overriding navigationOptions on static components +AnotherScreen.navigationOptions = ({ navigation, navigationOptions }) => ({ + drawerLabel: navigation.state.params!.color + ' screen', +}); + const navigationOptions = { headerBackTitle: null, }; @@ -113,6 +152,15 @@ const routeConfigMap: NavigationRouteConfigMap = { path: "next", screen: NextScreen, }, + // Demonstrates stateless screen + [ROUTE_NAME_ANOTHER_SCREEN]: { + path: "another", + screen: AnotherScreen, + navigationOptions: { + // Demonstrates that stack entries can set optins for tab navigation (for deeper use) + tabBarVisible: false, + } + }, }; export const AppNavigator = StackNavigator( routeConfigMap, From 05bfe66185666bf56b2b4421bd8f38648d703b6d Mon Sep 17 00:00:00 2001 From: akizimov Date: Fri, 23 Mar 2018 17:10:38 +0300 Subject: [PATCH 0157/2153] defines --- types/redux-testkit/index.d.ts | 69 ++++++++++++++++++++++ types/redux-testkit/redux-testkit-tests.ts | 69 ++++++++++++++++++++++ types/redux-testkit/tsconfig.json | 22 +++++++ types/redux-testkit/tslint.json | 1 + 4 files changed, 161 insertions(+) create mode 100644 types/redux-testkit/index.d.ts create mode 100644 types/redux-testkit/redux-testkit-tests.ts create mode 100644 types/redux-testkit/tsconfig.json create mode 100644 types/redux-testkit/tslint.json diff --git a/types/redux-testkit/index.d.ts b/types/redux-testkit/index.d.ts new file mode 100644 index 0000000000..0e9dc4ff74 --- /dev/null +++ b/types/redux-testkit/index.d.ts @@ -0,0 +1,69 @@ +// Type definitions for redux-testkit 1.0 +// Project: https://github.com/wix/redux-testkit#readme +// Definitions by: Andrey Kizimov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as Redux from 'redux'; + +//----------------------------------------------------------------------- + +interface ReducerMainCommands { + expect(action: Redux.AnyAction): InternalReducerCommands; + execute(action: Redux.AnyAction): any; +} + +interface InternalReducerCommands { + toReturnState(expected: Redux.AnyAction): any; + toStayTheSame(): any; + toChangeInState(expectedChanges: any): any; +} + +interface ReducerAction extends ReducerMainCommands { + withState(state: any): ReducerMainCommands; +} + +//----------------------------------------------------------------------- + +interface SelectorExpect { + toReturn(expected: any): any; +} +interface SelectorAction { + expect(state: any, ...arg: any[]): SelectorExpect; + execute(state: any, ...arg: any[]): any; +} + +//----------------------------------------------------------------------- + +interface DispatchObject { + isFunction(): boolean, + isPlainObject(): boolean, + getType(): any, + getAction(): any, + getName(): any +} + +interface ThunkMainCommands { + execute(...arg: any[]): DispatchObject[]; +} + +interface ThunkAction extends ThunkMainCommands { + withState(state: any): ThunkMainCommands; +} + +//----------------------------------------------------------------------- + +interface FlushThunksMiddleware { + flush(): void; + reset(): void; +} + +export class FlushThunks { + static createMiddleware(): FlushThunksMiddleware; +} + +//----------------------------------------------------------------------- + +export function Reducer(action: Redux.Reducer): ReducerAction; +export function Selector(action: Redux.Reducer): SelectorAction; +export function Thunk(action: Redux.Reducer): ThunkAction; + diff --git a/types/redux-testkit/redux-testkit-tests.ts b/types/redux-testkit/redux-testkit-tests.ts new file mode 100644 index 0000000000..3e0fa7b1be --- /dev/null +++ b/types/redux-testkit/redux-testkit-tests.ts @@ -0,0 +1,69 @@ +import {Reducer, Selector, FlushThunks, Thunk} from 'redux-testkit'; +import {Action, Dispatch} from 'redux'; + +interface SimpleState { + currentState: string; + numbers: number[]; +} + +const TO_FINISH_STATE = 'TO_FINISH_STATE'; +const TO_INITIAL_STATE = 'TO_INITIAL_STATE'; + +enum NumberType { + ODD = 'ODD', + EVEN = 'EVEN' +} + +const simpleState: SimpleState = { + currentState: "initial", + numbers: [1, 2, 3, 4, 5, 6, 7, 8, 9] +}; + +const simpleAction = (state: SimpleState = simpleState, action: Action): SimpleState => { + if (action.type === TO_FINISH_STATE) { + return {...state, currentState: 'finish'}; + } + else if (action.type === TO_INITIAL_STATE) { + return {...state, currentState: 'initial'}; + } + + return state; +}; + +const getNumbers = (state: SimpleState = simpleState, type: NumberType = NumberType.EVEN): number[] => { + return state.numbers.filter(element => { + const division = element % 2; + + if (division === 0 && type === NumberType.EVEN) { + return element; + } + else if (division !== 0 && type === NumberType.ODD) { + return element; + } + }); +}; + +const thunkAction1: Action = { + type: TO_FINISH_STATE +}; + +const thunkAction2: Action = { + type: TO_INITIAL_STATE +}; + +const thunk = () => { + return function (dispatch: Dispatch) { + dispatch({ thunkAction1 }); + dispatch({ thunkAction2 }); + }; +}; + +Reducer(simpleAction).expect({ type: 'WRONG_TYPE' }).toStayTheSame(); +Reducer(simpleAction).withState(simpleState).expect({ type: TO_FINISH_STATE }).toChangeInState({ currentState: 'finish' }); +Reducer(simpleAction).expect({ type: TO_INITIAL_STATE }).toReturnState(simpleState); + +Selector(getNumbers).expect(simpleState, NumberType.EVEN).toReturn([2, 4, 6, 8]); + +const odd = Selector(getNumbers).execute(simpleState, NumberType.ODD); + +const dispatches = Thunk(thunk).execute(); diff --git a/types/redux-testkit/tsconfig.json b/types/redux-testkit/tsconfig.json new file mode 100644 index 0000000000..be52e915a3 --- /dev/null +++ b/types/redux-testkit/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "redux-testkit-tests.ts" + ] +} diff --git a/types/redux-testkit/tslint.json b/types/redux-testkit/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/redux-testkit/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From ec2685287a29cdbcd146db59b460391d49487596 Mon Sep 17 00:00:00 2001 From: Justin Chew Date: Fri, 23 Mar 2018 14:14:15 +0000 Subject: [PATCH 0158/2153] Remove module declaration --- types/modernizr/index.d.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/types/modernizr/index.d.ts b/types/modernizr/index.d.ts index a9cfb92f54..ca5e6753f9 100644 --- a/types/modernizr/index.d.ts +++ b/types/modernizr/index.d.ts @@ -448,6 +448,4 @@ interface ModernizrAPI { interface ModernizrStatic extends ModernizrAPI, FeatureDetects { } declare var Modernizr: ModernizrStatic; -declare module "modernizr" { - export = Modernizr; -} +export = Modernizr; From 4b7cd30a28e597d5f839afd3cb1a7e92a7617b00 Mon Sep 17 00:00:00 2001 From: Clement Allen Date: Fri, 23 Mar 2018 14:27:09 +0000 Subject: [PATCH 0159/2153] [sumo-logger] - Added methods and config options from new version --- types/sumo-logger/index.d.ts | 23 ++++++++++++++++++++++- types/sumo-logger/sumo-logger-tests.ts | 7 ++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/types/sumo-logger/index.d.ts b/types/sumo-logger/index.d.ts index bc89e0eaa8..8e3cd3a27e 100644 --- a/types/sumo-logger/index.d.ts +++ b/types/sumo-logger/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for js-logging-sdk 1.0 +// Type definitions for js-logging-sdk 1.3 // Project: https://github.com/SumoLogic/js-logging-sdk // Definitions by: forabi +// clementallen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -67,6 +68,11 @@ declare namespace SumoLogger { * This value sets the Source Name for the logged message. */ sourceName?: string; + + /** + * This value enabled and disables sending data as graphite metrics + */ + graphite?: boolean; } interface PerMessageOptions { @@ -124,6 +130,21 @@ declare class SumoLogger { * messages are sent to Sumo Logic. */ flushLogs(): void; + + /** + * Stop sending batched logs + */ + stopLogSending(): void; + + /** + * Start sending batched logs at the preconfigured interval + */ + startLogSending(): void; + + /** + * Empty the current queue of logs + */ + emptyLogQueue(): void; } export = SumoLogger; diff --git a/types/sumo-logger/sumo-logger-tests.ts b/types/sumo-logger/sumo-logger-tests.ts index 2a0066a4e4..dab4945906 100644 --- a/types/sumo-logger/sumo-logger-tests.ts +++ b/types/sumo-logger/sumo-logger-tests.ts @@ -6,14 +6,15 @@ const onSuccessSpy = expect.createSpy(); const logger = new SumoLogger({ endpoint: 'http://example.com/', - onSuccess() { - console.log('success'); - }, + onSuccess: onSuccessSpy, onError: onErrorSpy, }); expect(logger.flushLogs).toExist(); expect(logger.log).toExist(); +expect(logger.emptyLogQueue).toExist(); +expect(logger.startLogSending).toExist(); +expect(logger.stopLogSending).toExist(); logger.log('message'); logger.log({ json: 'object' }); From 3da30314df2e65115588a10ea76b2c5726b1787a Mon Sep 17 00:00:00 2001 From: Menushka Weeratunga Date: Fri, 23 Mar 2018 10:27:10 -0400 Subject: [PATCH 0160/2153] Added types for FBInstant --- types/fbinstant/fbinstant-tests.ts | 60 ++++++++ types/fbinstant/index.d.ts | 221 +++++++++++++++++++++++++++++ types/fbinstant/tsconfig.json | 23 +++ types/fbinstant/tslint.json | 8 ++ 4 files changed, 312 insertions(+) create mode 100644 types/fbinstant/fbinstant-tests.ts create mode 100644 types/fbinstant/index.d.ts create mode 100644 types/fbinstant/tsconfig.json create mode 100644 types/fbinstant/tslint.json diff --git a/types/fbinstant/fbinstant-tests.ts b/types/fbinstant/fbinstant-tests.ts new file mode 100644 index 0000000000..f4a72ea70e --- /dev/null +++ b/types/fbinstant/fbinstant-tests.ts @@ -0,0 +1,60 @@ +declare const FBInstant: FBInstant; + +export class FBInstantTest { + winStreak: number; + + init() { + FBInstant.initializeAsync().then(() => { + FBInstant.setLoadingProgress(100); + FBInstant.startGameAsync().then(() => { + this.startGame(); + }); + }); + } + + startGame() { + const contextId = FBInstant.context.getID(); + const contextType = FBInstant.context.getType(); + + const playerName = FBInstant.player.getName(); + const playerPic = FBInstant.player.getPhoto(); + const playerId = FBInstant.player.getID(); + } + + saveState() { + FBInstant.player.setDataAsync({ + score: this.winStreak + }); + } + + getState() { + FBInstant.player.getDataAsync(['score']) + .then((data) => { + if (typeof data['score'] !== 'undefined') { + this.winStreak = +data['score']; + } + }); + } + + update() { + FBInstant.updateAsync({ + action: 'CUSTOM', + cta: 'Play', + image: '', + text: { + default: 'Edgar played their move', + localizations: { + en_US: 'Edgar played their move', + es_LA: '\u00A1Edgar jug\u00F3 su jugada!' + } + }, + template: 'play_turn', + data: { myReplayData: '...' }, + strategy: 'IMMEDIATE', + notification: 'NO_PUSH' + }).then(() => { + // closes the game after the update is posted. + FBInstant.quit(); + }); + } +} diff --git a/types/fbinstant/index.d.ts b/types/fbinstant/index.d.ts new file mode 100644 index 0000000000..c2237c749c --- /dev/null +++ b/types/fbinstant/index.d.ts @@ -0,0 +1,221 @@ +// Type definitions for FBInstant 6.1 +// Project: https://developers.facebook.com/docs/games/instant-games +// Definitions by: Menushka Weeratunga +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare class FBInstant { + player: Player; + context: Context; + payments: Payments; + + getLocale(): string; + getPlatform(): string; + getSDKVersion(): string; + initializeAsync(): Promise; + setLoadingProgress(progress: number): void; + getSupportedAPIs(): string[]; + getEntryPointData(): any; + getEntryPointAsync(): Promise; + setSessionData(sessionData: any): void; + startGameAsync(): Promise; + shareAsync(payload: SharePayload): Promise; + updateAsync(payload: UpdatePayload): Promise; + switchGameAsync(appID: string, data: string): Promise; + canCreateShortcutAsync(): Promise; + createShortcutAsync(): Promise; + quit(): void; + logEvent(eventName: string, valueToSum?: number, parameter?: any): APIError; + onPause(func: () => void): void; + getInterstitialAdAsync(placementID: string): Promise; + getRewardedVideoAsync(placementID: string): Promise; + matchPlayerAsync(matchTag: string, switchContextWhenMatched?: boolean): Promise; + checkCanPlayerMatchAsync(): Promise; + getLeaderboardAsync(name: string): Promise; +} + +declare class Player { + getID(): string; + getSignedPlayerInfoAsync(requestPayload: string): Promise; + canSubscribeBotAsync(): Promise; + subscribeBotAsync(): Promise; + getName(): string; + getPhoto(): string; + getDataAsync(keys: string[]): Promise; + setDataAsync(data: DataObject): Promise; + flushDataAsync(): Promise; + getStatsAsync(keys: string[]): Promise; + setStatsAsync(stats: StatsObject): Promise; + incrementStatsAsync(increments: IncrementObject): Promise; + getConnectedPlayersAsync(): Promise; +} + +declare class Context { + getID(): string; + getType(): Type; + isSizeBetween(minSize: number, maxSize: number): ContextSizeResponse; + switchAsync(id: string): Promise; + chooseAsync(options: ContextOptions): Promise; + createAsync(playerID: string): Promise; + getPlayersAsync(): Promise; +} + +declare class Leaderboard { + getName(): string; + getContextID(): string; + getEntryCountAsync(): Promise; + setScoreAsync(score: number, extraData: string): Promise; + getPlayerEntryAsync(): Promise; + getEntriesAsync(count: number, offset: number): Promise; +} + +declare class LeaderboardEntry { + getScore(): number; + getFormattedScore(): string; + getTimestamp(): number; + getRank(): number; + getExtraData(): string; + getPlayer(): LeaderboardPlayer; +} + +declare class LeaderboardPlayer { + getName(): string; + getPhoto(): string; + getID(): string; +} + +declare class ConnectedPlayer { + getID(): string; + getName(): string; + getPhoto(): string; +} + +declare class SignedPlayerInfo { + getPlayerID(): string; + getSignature(): string; +} + +declare class ContextPlayer { + getID(): string; + getName(): string; + getPhoto(): string; +} + +declare class AdInstance { + getPlacementID(): string; + loadAsync(): Promise; + showAsync(): Promise; +} + +declare class Payments { + purchaseAsync(purchaseConfig: PurchaseConfig): Promise; + getPurchasesAsync(): Promise; + consumePurchaseAsync(purchaseToken: string): Promise; + onReady(callback: () => void): void; +} + +declare interface Product { + title: string; + productID: string; + description?: string; + imageURI?: string; + price: string; + priceCurrencyCode: string; +} + +declare interface ContextSizeResponse { + answer: boolean; + minSize?: number; + maxSize?: number; +} + +declare interface Purchase { + developerPayload?: string; + paymentID: string; + productID: string; + purchaseTime: string; + purchaseToken: string; + signedRequest: SignedPurchaseRequest; +} + +declare interface ContextOptions { + filters?: ContextFilter[]; + maxSize?: number; + minSize?: number; +} + +declare interface SharePayload { + intent?: Intent; + image?: string; + text?: string; + data?: any; +} + +declare interface APIError { + code: ErrorCodeType; + message: string; +} + +declare interface PurchaseConfig { + productID: string; + developerPayload?: string; +} + +declare interface UpdatePayload { + action?: UpdateAction; + template?: string; + cta?: (string | LocalizableContent); + image?: string; + text?: (string | LocalizableContent); + data?: any; + strategy?: string; + notification?: string; +} + +declare interface LeaderboardUpdatePayload { + action: UpdateAction; + name: string; + text?: string; +} + +declare interface LocalizableContent { + default: string; + localizations: LocalizationsDict; +} + +declare interface DataObject { [ key: string ]: string | number; } + +declare interface StatsObject { [ key: string ]: string | number; } + +declare interface IncrementObject { [ key: string ]: number; } + +declare type LocalizationsDict = any; + +declare type SignedPurchaseRequest = string; + +declare type ContextFilter = "NEW_CONTEXT_ONLY" | "INCLUDE_EXISTING_CHALLENGES" | "NEW_PLAYERS_ONLY"; + +declare type UpdateAction = "CUSTOM" | "LEADERBOARD"; + +declare type Platform = "IOS" | "ANDROID" | "WEB" | "MOBILE_WEB"; + +declare type Type = "POST" | "THREAD" | "GROUP" | "SOLO"; + +declare type Intent = "INVITE" | "REQUEST" | "CHALLENGE" | "SHARE"; + +declare type ErrorCodeType = "ADS_FREQUENT_LOAD" | + "ADS_NO_FILL" | + "ADS_NOT_LOADED" | + "ADS_TOO_MANY_INSTANCES" | + "ANALYTICS_POST_EXCEPTION" | + "CLIENT_REQUIRES_UPDATE" | + "CLIENT_UNSUPPORTED_OPERATION" | + "INVALID_OPERATION" | + "INVALID_PARAM" | + "LEADERBOARD_NOT_FOUND" | + "LEADERBOARD_WRONG_CONTEXT" | + "NETWORK_FAILURE" | + "PENDING_REQUEST" | + "RATE_LIMITED" | + "SAME_CONTEXT" | + "UNKNOWN" | + "USER_INPUT"; diff --git a/types/fbinstant/tsconfig.json b/types/fbinstant/tsconfig.json new file mode 100644 index 0000000000..7cb5ffc8ae --- /dev/null +++ b/types/fbinstant/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "fbinstant-tests.ts" + ] +} diff --git a/types/fbinstant/tslint.json b/types/fbinstant/tslint.json new file mode 100644 index 0000000000..71918edac3 --- /dev/null +++ b/types/fbinstant/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // Needs to be declares as it cannot be imported in typescript + // using the standard import statement + "strict-export-declare-modifiers": false + } +} From 97b9d47d3a5cc5d8a176a05705f528a73854f2c7 Mon Sep 17 00:00:00 2001 From: doomsower Date: Fri, 23 Mar 2018 17:46:30 +0300 Subject: [PATCH 0161/2153] fix linter --- types/react-navigation/react-navigation-tests.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 496009688e..5ffabdef46 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -129,7 +129,7 @@ const AnotherScreen: NavigationStatelessScreen -) +); // Demonstrates overriding navigationOptions on static components AnotherScreen.navigationOptions = ({ navigation, navigationOptions }) => ({ @@ -159,7 +159,7 @@ const routeConfigMap: NavigationRouteConfigMap = { navigationOptions: { // Demonstrates that stack entries can set optins for tab navigation (for deeper use) tabBarVisible: false, - } + }, }, }; export const AppNavigator = StackNavigator( From 48662ad8dc57000bfa968fc021f54346615fb122 Mon Sep 17 00:00:00 2001 From: Justin Chew Date: Fri, 23 Mar 2018 14:48:12 +0000 Subject: [PATCH 0162/2153] Reverse commit --- types/modernizr/index.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/types/modernizr/index.d.ts b/types/modernizr/index.d.ts index ca5e6753f9..71046d3840 100644 --- a/types/modernizr/index.d.ts +++ b/types/modernizr/index.d.ts @@ -447,5 +447,7 @@ interface ModernizrAPI { interface ModernizrStatic extends ModernizrAPI, FeatureDetects { } -declare var Modernizr: ModernizrStatic; -export = Modernizr; +declare var Modernizr: ModernizrStatic;declare module "Modernizr" { +declare module "Modernizr" { + export = Modernizr; +} From ff63f28d065ff53dc50e86c9191cc33222850e57 Mon Sep 17 00:00:00 2001 From: Justin Chew Date: Fri, 23 Mar 2018 14:55:47 +0000 Subject: [PATCH 0163/2153] Fix duplicate --- types/modernizr/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/modernizr/index.d.ts b/types/modernizr/index.d.ts index 71046d3840..a9cfb92f54 100644 --- a/types/modernizr/index.d.ts +++ b/types/modernizr/index.d.ts @@ -447,7 +447,7 @@ interface ModernizrAPI { interface ModernizrStatic extends ModernizrAPI, FeatureDetects { } -declare var Modernizr: ModernizrStatic;declare module "Modernizr" { -declare module "Modernizr" { +declare var Modernizr: ModernizrStatic; +declare module "modernizr" { export = Modernizr; } From 22d2e5efbb99c765d59d661f145209eaceb1b12e Mon Sep 17 00:00:00 2001 From: Justin Chew Date: Fri, 23 Mar 2018 14:57:11 +0000 Subject: [PATCH 0164/2153] Set declare-module tslint to true --- types/modernizr/tslint.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/modernizr/tslint.json b/types/modernizr/tslint.json index 2279635eb4..bd2b0c4334 100644 --- a/types/modernizr/tslint.json +++ b/types/modernizr/tslint.json @@ -1,7 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "no-single-declare-module": false, + "no-single-declare-module": true, "no-empty-interface": false } } From a5dcf5b5994927caa3bcb1d50d8ae0c9b66c8d1d Mon Sep 17 00:00:00 2001 From: Menushka Weeratunga Date: Fri, 23 Mar 2018 10:59:29 -0400 Subject: [PATCH 0165/2153] Move into single class and namspace to avoid name conflicts --- types/fbinstant/index.d.ts | 390 +++++++++++++++++++------------------ 1 file changed, 196 insertions(+), 194 deletions(-) diff --git a/types/fbinstant/index.d.ts b/types/fbinstant/index.d.ts index c2237c749c..9b337bbc5e 100644 --- a/types/fbinstant/index.d.ts +++ b/types/fbinstant/index.d.ts @@ -4,9 +4,9 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare class FBInstant { - player: Player; - context: Context; - payments: Payments; + player: FBInstant.Player; + context: FBInstant.Context; + payments: FBInstant.Payments; getLocale(): string; getPlatform(): string; @@ -18,204 +18,206 @@ declare class FBInstant { getEntryPointAsync(): Promise; setSessionData(sessionData: any): void; startGameAsync(): Promise; - shareAsync(payload: SharePayload): Promise; - updateAsync(payload: UpdatePayload): Promise; + shareAsync(payload: FBInstant.SharePayload): Promise; + updateAsync(payload: FBInstant.UpdatePayload): Promise; switchGameAsync(appID: string, data: string): Promise; canCreateShortcutAsync(): Promise; createShortcutAsync(): Promise; quit(): void; - logEvent(eventName: string, valueToSum?: number, parameter?: any): APIError; + logEvent(eventName: string, valueToSum?: number, parameter?: any): FBInstant.APIError; onPause(func: () => void): void; - getInterstitialAdAsync(placementID: string): Promise; - getRewardedVideoAsync(placementID: string): Promise; + getInterstitialAdAsync(placementID: string): Promise; + getRewardedVideoAsync(placementID: string): Promise; matchPlayerAsync(matchTag: string, switchContextWhenMatched?: boolean): Promise; checkCanPlayerMatchAsync(): Promise; - getLeaderboardAsync(name: string): Promise; + getLeaderboardAsync(name: string): Promise; } -declare class Player { - getID(): string; - getSignedPlayerInfoAsync(requestPayload: string): Promise; - canSubscribeBotAsync(): Promise; - subscribeBotAsync(): Promise; - getName(): string; - getPhoto(): string; - getDataAsync(keys: string[]): Promise; - setDataAsync(data: DataObject): Promise; - flushDataAsync(): Promise; - getStatsAsync(keys: string[]): Promise; - setStatsAsync(stats: StatsObject): Promise; - incrementStatsAsync(increments: IncrementObject): Promise; - getConnectedPlayersAsync(): Promise; +declare namespace FBInstant { + class Player { + getID(): string; + getSignedPlayerInfoAsync(requestPayload: string): Promise; + canSubscribeBotAsync(): Promise; + subscribeBotAsync(): Promise; + getName(): string; + getPhoto(): string; + getDataAsync(keys: string[]): Promise; + setDataAsync(data: DataObject): Promise; + flushDataAsync(): Promise; + getStatsAsync(keys: string[]): Promise; + setStatsAsync(stats: StatsObject): Promise; + incrementStatsAsync(increments: IncrementObject): Promise; + getConnectedPlayersAsync(): Promise; + } + + class Context { + getID(): string; + getType(): Type; + isSizeBetween(minSize: number, maxSize: number): ContextSizeResponse; + switchAsync(id: string): Promise; + chooseAsync(options: ContextOptions): Promise; + createAsync(playerID: string): Promise; + getPlayersAsync(): Promise; + } + + class Leaderboard { + getName(): string; + getContextID(): string; + getEntryCountAsync(): Promise; + setScoreAsync(score: number, extraData: string): Promise; + getPlayerEntryAsync(): Promise; + getEntriesAsync(count: number, offset: number): Promise; + } + + class LeaderboardEntry { + getScore(): number; + getFormattedScore(): string; + getTimestamp(): number; + getRank(): number; + getExtraData(): string; + getPlayer(): LeaderboardPlayer; + } + + class LeaderboardPlayer { + getName(): string; + getPhoto(): string; + getID(): string; + } + + class ConnectedPlayer { + getID(): string; + getName(): string; + getPhoto(): string; + } + + class SignedPlayerInfo { + getPlayerID(): string; + getSignature(): string; + } + + class ContextPlayer { + getID(): string; + getName(): string; + getPhoto(): string; + } + + class AdInstance { + getPlacementID(): string; + loadAsync(): Promise; + showAsync(): Promise; + } + + class Payments { + purchaseAsync(purchaseConfig: PurchaseConfig): Promise; + getPurchasesAsync(): Promise; + consumePurchaseAsync(purchaseToken: string): Promise; + onReady(callback: () => void): void; + } + + interface Product { + title: string; + productID: string; + description?: string; + imageURI?: string; + price: string; + priceCurrencyCode: string; + } + + interface ContextSizeResponse { + answer: boolean; + minSize?: number; + maxSize?: number; + } + + interface Purchase { + developerPayload?: string; + paymentID: string; + productID: string; + purchaseTime: string; + purchaseToken: string; + signedRequest: SignedPurchaseRequest; + } + + interface ContextOptions { + filters?: ContextFilter[]; + maxSize?: number; + minSize?: number; + } + + interface SharePayload { + intent?: Intent; + image?: string; + text?: string; + data?: any; + } + + interface APIError { + code: ErrorCodeType; + message: string; + } + + interface PurchaseConfig { + productID: string; + developerPayload?: string; + } + + interface UpdatePayload { + action?: UpdateAction; + template?: string; + cta?: (string | LocalizableContent); + image?: string; + text?: (string | LocalizableContent); + data?: any; + strategy?: string; + notification?: string; + } + + interface LeaderboardUpdatePayload { + action: UpdateAction; + name: string; + text?: string; + } + + interface LocalizableContent { + default: string; + localizations: LocalizationsDict; + } + + interface DataObject { [ key: string ]: string | number; } + + interface StatsObject { [ key: string ]: string | number; } + + interface IncrementObject { [ key: string ]: number; } + + type LocalizationsDict = any; + + type SignedPurchaseRequest = string; + + type ContextFilter = "NEW_CONTEXT_ONLY" | "INCLUDE_EXISTING_CHALLENGES" | "NEW_PLAYERS_ONLY"; + + type UpdateAction = "CUSTOM" | "LEADERBOARD"; + + type Platform = "IOS" | "ANDROID" | "WEB" | "MOBILE_WEB"; + + type Type = "POST" | "THREAD" | "GROUP" | "SOLO"; + + type Intent = "INVITE" | "REQUEST" | "CHALLENGE" | "SHARE"; + + type ErrorCodeType = "ADS_FREQUENT_LOAD" | + "ADS_NO_FILL" | + "ADS_NOT_LOADED" | + "ADS_TOO_MANY_INSTANCES" | + "ANALYTICS_POST_EXCEPTION" | + "CLIENT_REQUIRES_UPDATE" | + "CLIENT_UNSUPPORTED_OPERATION" | + "INVALID_OPERATION" | + "INVALID_PARAM" | + "LEADERBOARD_NOT_FOUND" | + "LEADERBOARD_WRONG_CONTEXT" | + "NETWORK_FAILURE" | + "PENDING_REQUEST" | + "RATE_LIMITED" | + "SAME_CONTEXT" | + "UNKNOWN" | + "USER_INPUT"; } - -declare class Context { - getID(): string; - getType(): Type; - isSizeBetween(minSize: number, maxSize: number): ContextSizeResponse; - switchAsync(id: string): Promise; - chooseAsync(options: ContextOptions): Promise; - createAsync(playerID: string): Promise; - getPlayersAsync(): Promise; -} - -declare class Leaderboard { - getName(): string; - getContextID(): string; - getEntryCountAsync(): Promise; - setScoreAsync(score: number, extraData: string): Promise; - getPlayerEntryAsync(): Promise; - getEntriesAsync(count: number, offset: number): Promise; -} - -declare class LeaderboardEntry { - getScore(): number; - getFormattedScore(): string; - getTimestamp(): number; - getRank(): number; - getExtraData(): string; - getPlayer(): LeaderboardPlayer; -} - -declare class LeaderboardPlayer { - getName(): string; - getPhoto(): string; - getID(): string; -} - -declare class ConnectedPlayer { - getID(): string; - getName(): string; - getPhoto(): string; -} - -declare class SignedPlayerInfo { - getPlayerID(): string; - getSignature(): string; -} - -declare class ContextPlayer { - getID(): string; - getName(): string; - getPhoto(): string; -} - -declare class AdInstance { - getPlacementID(): string; - loadAsync(): Promise; - showAsync(): Promise; -} - -declare class Payments { - purchaseAsync(purchaseConfig: PurchaseConfig): Promise; - getPurchasesAsync(): Promise; - consumePurchaseAsync(purchaseToken: string): Promise; - onReady(callback: () => void): void; -} - -declare interface Product { - title: string; - productID: string; - description?: string; - imageURI?: string; - price: string; - priceCurrencyCode: string; -} - -declare interface ContextSizeResponse { - answer: boolean; - minSize?: number; - maxSize?: number; -} - -declare interface Purchase { - developerPayload?: string; - paymentID: string; - productID: string; - purchaseTime: string; - purchaseToken: string; - signedRequest: SignedPurchaseRequest; -} - -declare interface ContextOptions { - filters?: ContextFilter[]; - maxSize?: number; - minSize?: number; -} - -declare interface SharePayload { - intent?: Intent; - image?: string; - text?: string; - data?: any; -} - -declare interface APIError { - code: ErrorCodeType; - message: string; -} - -declare interface PurchaseConfig { - productID: string; - developerPayload?: string; -} - -declare interface UpdatePayload { - action?: UpdateAction; - template?: string; - cta?: (string | LocalizableContent); - image?: string; - text?: (string | LocalizableContent); - data?: any; - strategy?: string; - notification?: string; -} - -declare interface LeaderboardUpdatePayload { - action: UpdateAction; - name: string; - text?: string; -} - -declare interface LocalizableContent { - default: string; - localizations: LocalizationsDict; -} - -declare interface DataObject { [ key: string ]: string | number; } - -declare interface StatsObject { [ key: string ]: string | number; } - -declare interface IncrementObject { [ key: string ]: number; } - -declare type LocalizationsDict = any; - -declare type SignedPurchaseRequest = string; - -declare type ContextFilter = "NEW_CONTEXT_ONLY" | "INCLUDE_EXISTING_CHALLENGES" | "NEW_PLAYERS_ONLY"; - -declare type UpdateAction = "CUSTOM" | "LEADERBOARD"; - -declare type Platform = "IOS" | "ANDROID" | "WEB" | "MOBILE_WEB"; - -declare type Type = "POST" | "THREAD" | "GROUP" | "SOLO"; - -declare type Intent = "INVITE" | "REQUEST" | "CHALLENGE" | "SHARE"; - -declare type ErrorCodeType = "ADS_FREQUENT_LOAD" | - "ADS_NO_FILL" | - "ADS_NOT_LOADED" | - "ADS_TOO_MANY_INSTANCES" | - "ANALYTICS_POST_EXCEPTION" | - "CLIENT_REQUIRES_UPDATE" | - "CLIENT_UNSUPPORTED_OPERATION" | - "INVALID_OPERATION" | - "INVALID_PARAM" | - "LEADERBOARD_NOT_FOUND" | - "LEADERBOARD_WRONG_CONTEXT" | - "NETWORK_FAILURE" | - "PENDING_REQUEST" | - "RATE_LIMITED" | - "SAME_CONTEXT" | - "UNKNOWN" | - "USER_INPUT"; From 768b5c94e563c1fccaa9d8a72576e0b8f54cd320 Mon Sep 17 00:00:00 2001 From: Justin Chew Date: Fri, 23 Mar 2018 15:05:33 +0000 Subject: [PATCH 0166/2153] Fix tslint --- types/modernizr/tslint.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/modernizr/tslint.json b/types/modernizr/tslint.json index bd2b0c4334..9edbcd99ab 100644 --- a/types/modernizr/tslint.json +++ b/types/modernizr/tslint.json @@ -1,7 +1,8 @@ { "extends": "dtslint/dt.json", "rules": { - "no-single-declare-module": true, - "no-empty-interface": false + "no-single-declare-module": false, + "no-empty-interface": false, + "no-declare-current-package": false } } From 51256153206267f2a4113da390152a4c8efbc1bb Mon Sep 17 00:00:00 2001 From: Git Automerge Date: Fri, 23 Mar 2018 10:18:46 -0500 Subject: [PATCH 0167/2153] added aggregate and distinct to Parse --- types/parse/index.d.ts | 15 ++++++++++++++- types/parse/parse-tests.ts | 12 +++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/types/parse/index.d.ts b/types/parse/index.d.ts index 15d653a791..9a158d9287 100644 --- a/types/parse/index.d.ts +++ b/types/parse/index.d.ts @@ -607,6 +607,7 @@ declare namespace Parse { static or(...var_args: Query[]): Query; + aggregate(pipeline: Query.AggregationOptions|Query.AggregationOptions[]): Query; addAscending(key: string): Query; addAscending(key: string[]): Query; addDescending(key: string): Query; @@ -623,6 +624,7 @@ declare namespace Parse { doesNotExist(key: string): Query; doesNotMatchKeyInQuery(key: string, queryKey: string, query: Query): Query; doesNotMatchQuery(key: string, query: Query): Query; + distinct(key: string): Query; each(callback: Function, options?: Query.EachOptions): Promise; endsWith(key: string, suffix: string): Query; equalTo(key: string, value: any): Query; @@ -659,6 +661,17 @@ declare namespace Parse { interface FindOptions extends SuccessFailureOptions, ScopeOptions { } interface FirstOptions extends SuccessFailureOptions, ScopeOptions { } interface GetOptions extends SuccessFailureOptions, ScopeOptions { } + + // According to http://docs.parseplatform.org/rest/guide/#aggregate-queries + interface AggregationOptions { + group?: { objectId?: string, [key:string]: any }; + match?: {[key: string]: any}; + project?: {[key: string]: any}; + limit?: number; + skip?: number; + // Sort documentation https://docs.mongodb.com/v3.2/reference/operator/aggregation/sort/#pipe._S_sort + sort?: {[key: string]: 1|-1}; + } } /** @@ -1151,4 +1164,4 @@ declare module "parse/node" { declare module "parse" { import * as parse from "parse/node"; export = parse -} \ No newline at end of file +} diff --git a/types/parse/parse-tests.ts b/types/parse/parse-tests.ts index ceb5693087..60b688ec6e 100644 --- a/types/parse/parse-tests.ts +++ b/types/parse/parse-tests.ts @@ -134,6 +134,16 @@ function test_query() { query.include("score"); query.include(["score.team"]); + // Find objects that match the aggregation pipeline + query.aggregate({ + group:{ + objectId: '$name' + } + }); + + // Find objects with distinct key + query.distinct('name'); + const testQuery = Parse.Query.or(query, query); } @@ -396,7 +406,7 @@ function test_cloud_functions() { Parse.Cloud.beforeSave('MyCustomClass', (request: Parse.Cloud.BeforeSaveRequest, response: Parse.Cloud.BeforeSaveResponse) => { - + if (request.object.isNew()) { if (!request.object.has('immutable')) return response.error('Field immutable is required') } else { From bdc72814b1fd0c6599aa2a8c120d62e304a78348 Mon Sep 17 00:00:00 2001 From: Git Automerge Date: Fri, 23 Mar 2018 10:21:07 -0500 Subject: [PATCH 0168/2153] space --- types/parse/parse-tests.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/parse/parse-tests.ts b/types/parse/parse-tests.ts index 60b688ec6e..b72ae74d7f 100644 --- a/types/parse/parse-tests.ts +++ b/types/parse/parse-tests.ts @@ -406,7 +406,6 @@ function test_cloud_functions() { Parse.Cloud.beforeSave('MyCustomClass', (request: Parse.Cloud.BeforeSaveRequest, response: Parse.Cloud.BeforeSaveResponse) => { - if (request.object.isNew()) { if (!request.object.has('immutable')) return response.error('Field immutable is required') } else { From c474a09bc9e6fdc0633d31c4ffe339ff393b521c Mon Sep 17 00:00:00 2001 From: Git Automerge Date: Fri, 23 Mar 2018 10:21:38 -0500 Subject: [PATCH 0169/2153] back to normal --- types/parse/parse-tests.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/parse/parse-tests.ts b/types/parse/parse-tests.ts index b72ae74d7f..60b688ec6e 100644 --- a/types/parse/parse-tests.ts +++ b/types/parse/parse-tests.ts @@ -406,6 +406,7 @@ function test_cloud_functions() { Parse.Cloud.beforeSave('MyCustomClass', (request: Parse.Cloud.BeforeSaveRequest, response: Parse.Cloud.BeforeSaveResponse) => { + if (request.object.isNew()) { if (!request.object.has('immutable')) return response.error('Field immutable is required') } else { From 912bf84d30b37e0d9331968386338a7836af7e79 Mon Sep 17 00:00:00 2001 From: ozum Date: Fri, 23 Mar 2018 18:22:18 +0300 Subject: [PATCH 0170/2153] [cosmiconfig] cosmiconfig npm module added --- types/cosmiconfig/cosmiconfig-tests.ts | 26 +++++++++++++++++++++ types/cosmiconfig/index.d.ts | 31 ++++++++++++++++++++++++++ types/cosmiconfig/tsconfig.json | 22 ++++++++++++++++++ types/cosmiconfig/tslint.json | 1 + 4 files changed, 80 insertions(+) create mode 100644 types/cosmiconfig/cosmiconfig-tests.ts create mode 100644 types/cosmiconfig/index.d.ts create mode 100644 types/cosmiconfig/tsconfig.json create mode 100644 types/cosmiconfig/tslint.json diff --git a/types/cosmiconfig/cosmiconfig-tests.ts b/types/cosmiconfig/cosmiconfig-tests.ts new file mode 100644 index 0000000000..5eb1045305 --- /dev/null +++ b/types/cosmiconfig/cosmiconfig-tests.ts @@ -0,0 +1,26 @@ +import cosmiconfig = require("cosmiconfig"); + +const explorer = cosmiconfig("yourModuleName", { + packageProp: "yourModuleName", + rc: ".yourModuleNamerc", + js: "yourModuleName.config.js", + rcStrictJson: false, + rcExtensions: false, + stopDir: "someDir", + cache: true, + sync: false, + transform: ({ config, filePath }) => ({ config, filePath }), + format: "js" +}); + +Promise.all([ + explorer.load(), + explorer.load("start/search/here"), + explorer.load(null, "load/this/file.json") +]).then(result => result); + +explorer.load().then(({ config, filePath }) => ({ config, filePath })); + +explorer.clearFileCache(); +explorer.clearDirectoryCache(); +explorer.clearCaches(); diff --git a/types/cosmiconfig/index.d.ts b/types/cosmiconfig/index.d.ts new file mode 100644 index 0000000000..ffbd2e4e3c --- /dev/null +++ b/types/cosmiconfig/index.d.ts @@ -0,0 +1,31 @@ +type Options = { + packageProp?: string | false; + rc?: string | false; + js?: string | false; + rcStrictJson?: boolean; + rcExtensions?: boolean; + stopDir?: string; + cache?: boolean; + sync?: boolean; + transform?: (result: Result) => Promise | Result; + configPath?: string; + format?: "json" | "yaml" | "js"; +}; + +type Result = { + config: Object; + filePath: string; +}; + +declare interface Explorer { + load(searchPath?: string): Promise; + load(searchPath?: null | undefined, configPath?: string): Promise; + + clearFileCache(): void; + clearDirectoryCache(): void; + clearCaches(): void; +} + +declare function cosmiconfig(moduleName: string, options?: Options): Explorer; + +export = cosmiconfig; diff --git a/types/cosmiconfig/tsconfig.json b/types/cosmiconfig/tsconfig.json new file mode 100644 index 0000000000..a30b1e37cf --- /dev/null +++ b/types/cosmiconfig/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cosmiconfig-tests.ts" + ] +} diff --git a/types/cosmiconfig/tslint.json b/types/cosmiconfig/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cosmiconfig/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From ae78157df74dc4367b9eb741c10e8c443a3d98af Mon Sep 17 00:00:00 2001 From: Git Automerge Date: Fri, 23 Mar 2018 10:29:32 -0500 Subject: [PATCH 0171/2153] added right api version number and changed project link --- types/parse/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/parse/index.d.ts b/types/parse/index.d.ts index 9a158d9287..d454f1a4d2 100644 --- a/types/parse/index.d.ts +++ b/types/parse/index.d.ts @@ -1,5 +1,5 @@ -// Type definitions for parse 2.4 -// Project: https://parse.com/ +// Type definitions for parse 1.11.1 +// Project: https://parseplatform.org/ // Definitions by: Ullisen Media Group // David Poetzsch-Heffter // Cedric Kemp From 8d3043c949c4c75148a0bba11cd726cdaca4a415 Mon Sep 17 00:00:00 2001 From: ozum Date: Fri, 23 Mar 2018 18:34:36 +0300 Subject: [PATCH 0172/2153] =?UTF-8?q?[cosmiconfig]=C2=A0Headers=20added?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/cosmiconfig/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/cosmiconfig/index.d.ts b/types/cosmiconfig/index.d.ts index ffbd2e4e3c..824a555b6b 100644 --- a/types/cosmiconfig/index.d.ts +++ b/types/cosmiconfig/index.d.ts @@ -1,3 +1,8 @@ +// Type definitions for cosmiconfig 4.0.0 +// Project: https://github.com/davidtheclark/cosmiconfig +// Definitions by: ozum +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + type Options = { packageProp?: string | false; rc?: string | false; From 7fa71c0fb6382d94163c04c4d04c12b6b76cc5de Mon Sep 17 00:00:00 2001 From: Git Automerge Date: Fri, 23 Mar 2018 10:39:09 -0500 Subject: [PATCH 0173/2153] added new definitions contributor --- types/parse/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/parse/index.d.ts b/types/parse/index.d.ts index d454f1a4d2..9f63ed97fb 100644 --- a/types/parse/index.d.ts +++ b/types/parse/index.d.ts @@ -5,6 +5,7 @@ // Cedric Kemp // Flavio Negrão // Wes Grimes +// Otherwise SAS // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 From 5588f282068abb82802f9a0dabb4ce2b7109b602 Mon Sep 17 00:00:00 2001 From: Jacob Hilker Date: Fri, 23 Mar 2018 11:46:50 -0400 Subject: [PATCH 0174/2153] [@types/find-root] Fix typo --- types/find-root/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/find-root/index.d.ts b/types/find-root/index.d.ts index b2fe6f572a..050781eacf 100644 --- a/types/find-root/index.d.ts +++ b/types/find-root/index.d.ts @@ -10,7 +10,7 @@ type FindRootCheckFn = (dir: string) => boolean; /** * Returns the path for the nearest directory to startingPath containing a package.json file. If a check function is * provided, then this will return the nearest directory for which the function returns true. - * @param startingPath The path to start searching form, e.g. __dirname + * @param startingPath The path to start searching from, e.g. __dirname * @param check The check predicate * @throws {Error} if package.json cannot be found or if the function never returns true */ From 7c20629f4f629b7a1e67b916d0324f567b10bf8c Mon Sep 17 00:00:00 2001 From: ozum Date: Fri, 23 Mar 2018 18:52:48 +0300 Subject: [PATCH 0175/2153] [cosmiconfig] Fixed lint errors --- types/cosmiconfig/index.d.ts | 18 ++++++++++-------- types/cosmiconfig/tsconfig.json | 14 ++++---------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/types/cosmiconfig/index.d.ts b/types/cosmiconfig/index.d.ts index 824a555b6b..ddb9fdbbc3 100644 --- a/types/cosmiconfig/index.d.ts +++ b/types/cosmiconfig/index.d.ts @@ -1,9 +1,10 @@ -// Type definitions for cosmiconfig 4.0.0 +// Type definitions for cosmiconfig 4.0 // Project: https://github.com/davidtheclark/cosmiconfig // Definitions by: ozum // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 -type Options = { +interface Options { packageProp?: string | false; rc?: string | false; js?: string | false; @@ -15,16 +16,17 @@ type Options = { transform?: (result: Result) => Promise | Result; configPath?: string; format?: "json" | "yaml" | "js"; -}; +} -type Result = { - config: Object; +interface Result { + config: object; filePath: string; -}; +} -declare interface Explorer { +interface Explorer { + // You should provide either searchPath or configPath for load method. To disallow both, overloaded definitions added. load(searchPath?: string): Promise; - load(searchPath?: null | undefined, configPath?: string): Promise; + load(searchPath: null | undefined, configPath?: string): Promise; clearFileCache(): void; clearDirectoryCache(): void; diff --git a/types/cosmiconfig/tsconfig.json b/types/cosmiconfig/tsconfig.json index a30b1e37cf..6f0f0ac3a2 100644 --- a/types/cosmiconfig/tsconfig.json +++ b/types/cosmiconfig/tsconfig.json @@ -1,22 +1,16 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6" - ], + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": [ - "../" - ], + "typeRoots": ["../"], "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, - "files": [ - "index.d.ts", - "cosmiconfig-tests.ts" - ] + "files": ["index.d.ts", "cosmiconfig-tests.ts"] } From 2fabcc3cedbbba186fd55b643174a4d3bfde7029 Mon Sep 17 00:00:00 2001 From: Thilak Rao Date: Fri, 23 Mar 2018 17:10:19 +0100 Subject: [PATCH 0176/2153] Added fields for disabling cookies in UniversalAnalytics namespace --- types/google.analytics/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/google.analytics/index.d.ts b/types/google.analytics/index.d.ts index b71fdef286..9f522b3b9b 100644 --- a/types/google.analytics/index.d.ts +++ b/types/google.analytics/index.d.ts @@ -525,6 +525,8 @@ declare namespace UniversalAnalytics { socialTarget?: string; some?: string; step?: boolean | number; + storage?: string; + storeGac?: boolean; tax?: string; timingCategory?: string; timingLabel?: string; From f32280e2c637ee0c4f4f4dd217471da91ffb0279 Mon Sep 17 00:00:00 2001 From: ozum Date: Fri, 23 Mar 2018 19:34:00 +0300 Subject: [PATCH 0177/2153] [cosmiconfig] Added: refinement for async and sync method. --- types/cosmiconfig/cosmiconfig-tests.ts | 31 ++++++++++++++----- types/cosmiconfig/index.d.ts | 43 ++++++++++++++++++++------ 2 files changed, 57 insertions(+), 17 deletions(-) diff --git a/types/cosmiconfig/cosmiconfig-tests.ts b/types/cosmiconfig/cosmiconfig-tests.ts index 5eb1045305..2676c58407 100644 --- a/types/cosmiconfig/cosmiconfig-tests.ts +++ b/types/cosmiconfig/cosmiconfig-tests.ts @@ -1,6 +1,6 @@ import cosmiconfig = require("cosmiconfig"); -const explorer = cosmiconfig("yourModuleName", { +const asyncExplorer = cosmiconfig("yourModuleName", { packageProp: "yourModuleName", rc: ".yourModuleNamerc", js: "yourModuleName.config.js", @@ -14,13 +14,28 @@ const explorer = cosmiconfig("yourModuleName", { }); Promise.all([ - explorer.load(), - explorer.load("start/search/here"), - explorer.load(null, "load/this/file.json") + asyncExplorer.load(), + asyncExplorer.load("start/search/here"), + asyncExplorer.load(null, "load/this/file.json") ]).then(result => result); -explorer.load().then(({ config, filePath }) => ({ config, filePath })); +asyncExplorer.load().then(({ config, filePath }) => ({ config, filePath })); -explorer.clearFileCache(); -explorer.clearDirectoryCache(); -explorer.clearCaches(); +asyncExplorer.clearFileCache(); +asyncExplorer.clearDirectoryCache(); +asyncExplorer.clearCaches(); + +const syncExplorer = cosmiconfig("yourModuleName", { + packageProp: "yourModuleName", + rc: ".yourModuleNamerc", + js: "yourModuleName.config.js", + rcStrictJson: false, + rcExtensions: false, + stopDir: "someDir", + cache: true, + sync: true, + transform: ({ config, filePath }) => ({ config, filePath }), + format: "js" +}); + +const { config, filePath } = syncExplorer.load(); diff --git a/types/cosmiconfig/index.d.ts b/types/cosmiconfig/index.d.ts index ddb9fdbbc3..032f570d6f 100644 --- a/types/cosmiconfig/index.d.ts +++ b/types/cosmiconfig/index.d.ts @@ -4,6 +4,11 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 +interface Result { + config: object; + filePath: string; +} + interface Options { packageProp?: string | false; rc?: string | false; @@ -12,27 +17,47 @@ interface Options { rcExtensions?: boolean; stopDir?: string; cache?: boolean; - sync?: boolean; transform?: (result: Result) => Promise | Result; configPath?: string; format?: "json" | "yaml" | "js"; } -interface Result { - config: object; - filePath: string; +// Default is false and makes load() method async +interface AsyncOptions extends Options { + sync?: false; +} + +// Makes load() method sync +interface SyncOptions extends Options { + sync: true; } interface Explorer { - // You should provide either searchPath or configPath for load method. To disallow both, overloaded definitions added. - load(searchPath?: string): Promise; - load(searchPath: null | undefined, configPath?: string): Promise; - clearFileCache(): void; clearDirectoryCache(): void; clearCaches(): void; } -declare function cosmiconfig(moduleName: string, options?: Options): Explorer; +interface AsyncExplorer extends Explorer { + // You should provide either searchPath or configPath for load method. To disallow both, overloaded definitions added. + load(searchPath?: string): Promise; + load(searchPath: null | undefined, configPath?: string): Promise; +} + +interface SyncExplorer extends Explorer { + // You should provide either searchPath or configPath for load method. To disallow both, overloaded definitions added. + load(searchPath?: string): Result; + load(searchPath: null | undefined, configPath?: string): Result; +} + +declare function cosmiconfig( + moduleName: string, + options: SyncOptions +): SyncExplorer; + +declare function cosmiconfig( + moduleName: string, + options?: AsyncOptions +): AsyncExplorer; export = cosmiconfig; From 8821490d489bd309343993a8167b85972964123e Mon Sep 17 00:00:00 2001 From: Matt Meshulam Date: Fri, 23 Mar 2018 11:53:37 -0500 Subject: [PATCH 0178/2153] react-native-navigation: Add showAsAction optional field to NavigatorButton --- types/react-native-navigation/index.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/react-native-navigation/index.d.ts b/types/react-native-navigation/index.d.ts index 6699f5bf9f..96b21b01e2 100644 --- a/types/react-native-navigation/index.d.ts +++ b/types/react-native-navigation/index.d.ts @@ -241,6 +241,8 @@ export type SystemItemIOS = 'done' | 'cancel' | 'edit' | 'save' | 'add' | 'bookmarks' | 'search' | 'refresh' | 'stop' | 'camera' | 'trash' | 'play' | 'pause' | 'rewind' | 'fastForward' | 'undo' | 'redo'; +export type ShowAsActionAndroid = 'ifRoom' | 'always' | 'withText' | 'never'; + export interface NavigatorButton { id: string | IdAndroid; title?: string; @@ -254,6 +256,7 @@ export interface NavigatorButton { buttonFontSize?: number; buttonFontWeight?: string | number; systemItem?: SystemItemIOS; + showAsAction?: ShowAsActionAndroid; } export interface FABAndroid { From a2c6ea7283908d6af71818a0e68e36aab377a1a9 Mon Sep 17 00:00:00 2001 From: Mathieu Dumont Date: Fri, 23 Mar 2018 13:26:57 -0400 Subject: [PATCH 0179/2153] Fix react-i18next typings --- types/react-i18next/src/I18n.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-i18next/src/I18n.d.ts b/types/react-i18next/src/I18n.d.ts index 122249c6e8..6bc1cf8f0f 100644 --- a/types/react-i18next/src/I18n.d.ts +++ b/types/react-i18next/src/I18n.d.ts @@ -8,7 +8,7 @@ export interface Options { export interface i18nProps { wait?: boolean; - ns: string | string[]; + ns?: string | string[]; nsMode?: string; bindI18n?: string; bindStore?: string; From 9363c54fa9da9dcf7c7e2264464eee0b9ddf9c48 Mon Sep 17 00:00:00 2001 From: Daniel Imhoff Date: Fri, 23 Mar 2018 14:48:30 -0500 Subject: [PATCH 0180/2153] add `wordWrap` and `trim` options for wrap-ansi v3 --- types/wrap-ansi/index.d.ts | 4 +- types/wrap-ansi/v2/index.d.ts | 20 +++++++ types/wrap-ansi/v2/tsconfig.json | 26 +++++++++ types/wrap-ansi/v2/tslint.json | 79 +++++++++++++++++++++++++++ types/wrap-ansi/v2/wrap-ansi-tests.ts | 8 +++ types/wrap-ansi/wrap-ansi-tests.ts | 4 ++ 6 files changed, 139 insertions(+), 2 deletions(-) create mode 100644 types/wrap-ansi/v2/index.d.ts create mode 100644 types/wrap-ansi/v2/tsconfig.json create mode 100644 types/wrap-ansi/v2/tslint.json create mode 100644 types/wrap-ansi/v2/wrap-ansi-tests.ts diff --git a/types/wrap-ansi/index.d.ts b/types/wrap-ansi/index.d.ts index fcbdd756e2..1a1ed41cf8 100644 --- a/types/wrap-ansi/index.d.ts +++ b/types/wrap-ansi/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for wrap-ansi v2.0.0 +// Type definitions for wrap-ansi v3.0.0 // Project: https://www.npmjs.com/package/wrap-ansi // Definitions by: Klaus Reimer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -12,7 +12,7 @@ * @param options By default the wrap is soft, meaning long words may extend past the column width. Setting * this to true will make it hard wrap at the column width. */ -declare function wrapAnsi(input: string, columns: number, options?: { hard?: boolean }): string; +declare function wrapAnsi(input: string, columns: number, options?: { hard?: boolean; trim?: boolean; wordWrap?: boolean; }): string; declare namespace wrapAnsi {} diff --git a/types/wrap-ansi/v2/index.d.ts b/types/wrap-ansi/v2/index.d.ts new file mode 100644 index 0000000000..fcbdd756e2 --- /dev/null +++ b/types/wrap-ansi/v2/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for wrap-ansi v2.0.0 +// Project: https://www.npmjs.com/package/wrap-ansi +// Definitions by: Klaus Reimer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +/** + * Wrap words to the specified column width. + * + * @param input String with ANSI escape codes. Like one styled by chalk. + * @param columns Number of columns to wrap the text to. + * @param options By default the wrap is soft, meaning long words may extend past the column width. Setting + * this to true will make it hard wrap at the column width. + */ +declare function wrapAnsi(input: string, columns: number, options?: { hard?: boolean }): string; + +declare namespace wrapAnsi {} + +export = wrapAnsi; + diff --git a/types/wrap-ansi/v2/tsconfig.json b/types/wrap-ansi/v2/tsconfig.json new file mode 100644 index 0000000000..52f19a07de --- /dev/null +++ b/types/wrap-ansi/v2/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "wrap-ansi": ["wrap-ansi/v2"] + } + }, + "files": [ + "index.d.ts", + "wrap-ansi-tests.ts" + ] +} diff --git a/types/wrap-ansi/v2/tslint.json b/types/wrap-ansi/v2/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/wrap-ansi/v2/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/wrap-ansi/v2/wrap-ansi-tests.ts b/types/wrap-ansi/v2/wrap-ansi-tests.ts new file mode 100644 index 0000000000..e5ba8c294f --- /dev/null +++ b/types/wrap-ansi/v2/wrap-ansi-tests.ts @@ -0,0 +1,8 @@ + + +import wrapAnsi = require("wrap-ansi"); + +wrapAnsi("input", 80) === "output"; +wrapAnsi("input", 80, {}) === "output"; +wrapAnsi("input", 80, { hard: true }) === "output"; +wrapAnsi("input", 80, { hard: false }) === "output"; diff --git a/types/wrap-ansi/wrap-ansi-tests.ts b/types/wrap-ansi/wrap-ansi-tests.ts index e5ba8c294f..49e1b64efe 100644 --- a/types/wrap-ansi/wrap-ansi-tests.ts +++ b/types/wrap-ansi/wrap-ansi-tests.ts @@ -6,3 +6,7 @@ wrapAnsi("input", 80) === "output"; wrapAnsi("input", 80, {}) === "output"; wrapAnsi("input", 80, { hard: true }) === "output"; wrapAnsi("input", 80, { hard: false }) === "output"; +wrapAnsi("input", 80, { trim: true }) === "output"; +wrapAnsi("input", 80, { trim: false }) === "output"; +wrapAnsi("input", 80, { wordWrap: true }) === "output"; +wrapAnsi("input", 80, { wordWrap: false }) === "output"; From 6f6324a0ab089f94b8cf0fe2ac07ff8d4786798f Mon Sep 17 00:00:00 2001 From: Git Automerge Date: Fri, 23 Mar 2018 14:59:24 -0500 Subject: [PATCH 0181/2153] added Parse.Promise catch function --- types/parse/index.d.ts | 2 ++ types/parse/parse-tests.ts | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/types/parse/index.d.ts b/types/parse/index.d.ts index 9f63ed97fb..908281f84d 100644 --- a/types/parse/index.d.ts +++ b/types/parse/index.d.ts @@ -89,6 +89,7 @@ declare namespace Parse { then(resolvedCallback: (...values: T[]) => IPromise, rejectedCallback?: (reason: any) => IPromise): IPromise; then(resolvedCallback: (...values: T[]) => U, rejectedCallback?: (reason: any) => IPromise): IPromise; then(resolvedCallback: (...values: T[]) => U, rejectedCallback?: (reason: any) => U): IPromise; + catch(resolvedCallback: (...values: T[]) => U, rejectedCallback?: (reason: any) => U): IPromise; } class Promise implements IPromise { @@ -110,6 +111,7 @@ declare namespace Parse { rejectedCallback?: (reason: any) => IPromise): IPromise; then(resolvedCallback: (...values: T[]) => U, rejectedCallback?: (reason: any) => U): IPromise; + catch(resolvedCallback: (...values: T[]) => U, rejectedCallback?: (reason: any) => U): IPromise; } interface Pointer { diff --git a/types/parse/parse-tests.ts b/types/parse/parse-tests.ts index 60b688ec6e..acb194ed6a 100644 --- a/types/parse/parse-tests.ts +++ b/types/parse/parse-tests.ts @@ -514,6 +514,15 @@ function test_promise() { // failed }); + // Test promise with a query + const query = new Parse.Query('Test'); + query.find() + .then(() => { + // success + }).catch(() => { + // error + }); + // can check whether an object is a Parse.Promise object or not Parse.Promise.is(resolved); } From 75ff0e94a9e1c467ef06de1496585788f3346955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B8is=C3=A6ther=20Rasch?= Date: Fri, 23 Mar 2018 23:48:18 +0100 Subject: [PATCH 0182/2153] Enforce package.json checkout with LF line-endings (#24353) --- .gitattributes | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitattributes b/.gitattributes index dfe0770424..ac1e451d56 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,7 @@ # Auto detect text files and perform LF normalization * text=auto + +# Checkout NPM package files with forced LF lineendings +# to prevent git conflicts when running npm commands +package.json text eol=lf +package-lock.json text eol=lf From a99c09f5988bbc57f5edd68682060eff942aa621 Mon Sep 17 00:00:00 2001 From: Valentin Sundermann Date: Fri, 23 Mar 2018 23:50:58 +0100 Subject: [PATCH 0183/2153] Add compressed and network as attributes for ECPair --- types/bitcoinjs-lib/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/bitcoinjs-lib/index.d.ts b/types/bitcoinjs-lib/index.d.ts index 11d311a276..920df43d6e 100644 --- a/types/bitcoinjs-lib/index.d.ts +++ b/types/bitcoinjs-lib/index.d.ts @@ -71,6 +71,10 @@ export class ECPair { d: BigInteger; + readonly compressed: boolean; + + readonly network: Network; + getAddress(): string; getNetwork(): Network; From b08baf3d2639742aab5ee027d6d7023857a9bc58 Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Sat, 24 Mar 2018 02:01:46 +0300 Subject: [PATCH 0184/2153] add types for base64-url --- types/base64-url/base64-url-tests.ts | 9 +++++++++ types/base64-url/index.d.ts | 9 +++++++++ types/base64-url/tsconfig.json | 23 +++++++++++++++++++++++ types/base64-url/tslint.json | 1 + 4 files changed, 42 insertions(+) create mode 100644 types/base64-url/base64-url-tests.ts create mode 100644 types/base64-url/index.d.ts create mode 100644 types/base64-url/tsconfig.json create mode 100644 types/base64-url/tslint.json diff --git a/types/base64-url/base64-url-tests.ts b/types/base64-url/base64-url-tests.ts new file mode 100644 index 0000000000..fd5c07cac0 --- /dev/null +++ b/types/base64-url/base64-url-tests.ts @@ -0,0 +1,9 @@ +import * as base64url from 'base64-url'; + +base64url.encode('Node.js is awesome.'); // $ExpectType string +base64url.decode('Tm9kZS5qcyBpcyBhd2Vzb21lLg'); // $ExpectType string +base64url.escape('This+is/goingto+escape=='); // $ExpectType string +base64url.unescape('This-is_goingto-escape'); // $ExpectType string + +base64url.encode('string to encode', 'ascii'); // $ExpectType string +base64url.decode('string to decode', 'ascii'); // $ExpectType string diff --git a/types/base64-url/index.d.ts b/types/base64-url/index.d.ts new file mode 100644 index 0000000000..1065cb9115 --- /dev/null +++ b/types/base64-url/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for base64-url 2.2 +// Project: https://github.com/joaquimserafim/base64-url +// Definitions by: Uri Shaked +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function decode(value: string, encoding?: string): string; +export function encode(value: string, encoding?: string): string; +export function escape(value: string): string; +export function unescape(value: string): string; diff --git a/types/base64-url/tsconfig.json b/types/base64-url/tsconfig.json new file mode 100644 index 0000000000..26ccd93511 --- /dev/null +++ b/types/base64-url/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "base64-url-tests.ts" + ] +} diff --git a/types/base64-url/tslint.json b/types/base64-url/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/base64-url/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 329bf5da38b21c5785ba3069372bc25568be648c Mon Sep 17 00:00:00 2001 From: Aleksey Klimenko Date: Sat, 24 Mar 2018 04:29:35 +0300 Subject: [PATCH 0185/2153] [feathersjs__express] clarified definitions and tests --- .../feathersjs__express-tests.ts | 11 +++++++---- types/feathersjs__express/index.d.ts | 17 ++++++++++++----- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/types/feathersjs__express/feathersjs__express-tests.ts b/types/feathersjs__express/feathersjs__express-tests.ts index 687191d0c6..6120ed483f 100644 --- a/types/feathersjs__express/feathersjs__express-tests.ts +++ b/types/feathersjs__express/feathersjs__express-tests.ts @@ -1,8 +1,11 @@ import feathers, { Application } from '@feathersjs/feathers'; -import feathersExpress, { original, rest, notFound, errorHandler } from '@feathersjs/express'; +import feathersExpress, * as express from "@feathersjs/express"; const app = feathersExpress(feathers()); -app.configure(rest()); -app.use(notFound()); -app.use(errorHandler()); +app.use(express.json()); +app.use(express.urlencoded({ extended: true })); +app.use('/', express.static('./public')); +app.configure(express.rest()); +app.use(express.notFound()); +app.use(express.errorHandler({ logger: console })); diff --git a/types/feathersjs__express/index.d.ts b/types/feathersjs__express/index.d.ts index f50203432f..7e1eea1a1d 100644 --- a/types/feathersjs__express/index.d.ts +++ b/types/feathersjs__express/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for @feathersjs/express 1.1 // Project: http://feathersjs.com/ // Definitions by: Jan Lohage +// Aleksey Klimenko // Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript // TypeScript Version: 2.3 @@ -10,12 +11,18 @@ import * as express from 'express'; export default function feathersExpress(app: FeathersApplication): Application; export type Application = express.Application & FeathersApplication; -export function errorHandler(options?: any): express.ErrorRequestHandler; +export function errorHandler(options?: { + public?: string, + logger?: { error?: (msg: string) => void }, + html?: any, + json?: any, +}): express.ErrorRequestHandler; export function notFound(): express.RequestHandler; -export const rest: { - (): () => void; - formatter: express.RequestHandler; -}; + +export function rest(): (handler?: express.RequestHandler) => void; +export namespace rest { + export let formatter: express.RequestHandler; +} /* * Re-export of the express package. From dc1dc45ee36ed1e10a8bdb56877587d708ef04da Mon Sep 17 00:00:00 2001 From: ckboyjiy Date: Sat, 24 Mar 2018 10:58:03 +0900 Subject: [PATCH 0186/2153] Added type definitions for Naver maps # modified tslint.json # move to /types --- navermaps/tslint.json | 79 ------------------- {navermaps => scripts/navermaps}/index.d.ts | 0 .../navermaps}/navermaps-tests.ts | 0 .../navermaps}/tsconfig.json | 0 scripts/navermaps/tslint.json | 3 + 5 files changed, 3 insertions(+), 79 deletions(-) delete mode 100644 navermaps/tslint.json rename {navermaps => scripts/navermaps}/index.d.ts (100%) rename {navermaps => scripts/navermaps}/navermaps-tests.ts (100%) rename {navermaps => scripts/navermaps}/tsconfig.json (100%) create mode 100644 scripts/navermaps/tslint.json diff --git a/navermaps/tslint.json b/navermaps/tslint.json deleted file mode 100644 index a41bf5d19a..0000000000 --- a/navermaps/tslint.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} diff --git a/navermaps/index.d.ts b/scripts/navermaps/index.d.ts similarity index 100% rename from navermaps/index.d.ts rename to scripts/navermaps/index.d.ts diff --git a/navermaps/navermaps-tests.ts b/scripts/navermaps/navermaps-tests.ts similarity index 100% rename from navermaps/navermaps-tests.ts rename to scripts/navermaps/navermaps-tests.ts diff --git a/navermaps/tsconfig.json b/scripts/navermaps/tsconfig.json similarity index 100% rename from navermaps/tsconfig.json rename to scripts/navermaps/tsconfig.json diff --git a/scripts/navermaps/tslint.json b/scripts/navermaps/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/scripts/navermaps/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 60b5b351f07a5b15dbbcb74c2c119af4d7fe3d26 Mon Sep 17 00:00:00 2001 From: ckboyjiy Date: Sat, 24 Mar 2018 11:06:13 +0900 Subject: [PATCH 0187/2153] Added type definitions for Naver maps # modified tslint.json # move to /types --- {scripts => types}/navermaps/index.d.ts | 0 {scripts => types}/navermaps/navermaps-tests.ts | 0 {scripts => types}/navermaps/tsconfig.json | 0 {scripts => types}/navermaps/tslint.json | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename {scripts => types}/navermaps/index.d.ts (100%) rename {scripts => types}/navermaps/navermaps-tests.ts (100%) rename {scripts => types}/navermaps/tsconfig.json (100%) rename {scripts => types}/navermaps/tslint.json (100%) diff --git a/scripts/navermaps/index.d.ts b/types/navermaps/index.d.ts similarity index 100% rename from scripts/navermaps/index.d.ts rename to types/navermaps/index.d.ts diff --git a/scripts/navermaps/navermaps-tests.ts b/types/navermaps/navermaps-tests.ts similarity index 100% rename from scripts/navermaps/navermaps-tests.ts rename to types/navermaps/navermaps-tests.ts diff --git a/scripts/navermaps/tsconfig.json b/types/navermaps/tsconfig.json similarity index 100% rename from scripts/navermaps/tsconfig.json rename to types/navermaps/tsconfig.json diff --git a/scripts/navermaps/tslint.json b/types/navermaps/tslint.json similarity index 100% rename from scripts/navermaps/tslint.json rename to types/navermaps/tslint.json From 0f9cfb309b928e7b91f1fc365936631f5ee884fd Mon Sep 17 00:00:00 2001 From: Moritz Raguschat Date: Sat, 24 Mar 2018 03:09:12 +0100 Subject: [PATCH 0188/2153] [koa-session] ContextStore constructor takes an argument of type Koa.Context --- types/koa-session/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/koa-session/index.d.ts b/types/koa-session/index.d.ts index 8650a07d91..2fe4a37b95 100644 --- a/types/koa-session/index.d.ts +++ b/types/koa-session/index.d.ts @@ -166,7 +166,7 @@ declare namespace session { * ContextStore must be a class which claims three instance methods demonstrated above. * new ContextStore(ctx) will be executed on every request. */ - ContextStore?: { new(): stores }; + ContextStore?: { new(ctx: Koa.Context): stores }; /** * If you want to add prefix for all external session id, you can use options.prefix, it will not work if options.genid present. From ceb451152428810ab9e0bb858b51cad1ba68c99e Mon Sep 17 00:00:00 2001 From: AndersonFriaca Date: Fri, 23 Mar 2018 22:13:48 -0400 Subject: [PATCH 0189/2153] Types for JQuery Pin --- types/jquery.pin/index.d.ts | 22 ++++++++++++++++++++++ types/jquery.pin/jquery.pin-tests.ts | 17 +++++++++++++++++ types/jquery.pin/tsconfig.json | 25 +++++++++++++++++++++++++ types/jquery.pin/tslint.json | 1 + 4 files changed, 65 insertions(+) create mode 100644 types/jquery.pin/index.d.ts create mode 100644 types/jquery.pin/jquery.pin-tests.ts create mode 100644 types/jquery.pin/tsconfig.json create mode 100644 types/jquery.pin/tslint.json diff --git a/types/jquery.pin/index.d.ts b/types/jquery.pin/index.d.ts new file mode 100644 index 0000000000..df132c6571 --- /dev/null +++ b/types/jquery.pin/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for JQuery Pin 1.0 +// Project: https://github.com/webpop/jquery.pin +// Definitions by: Anderson Friaça +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +export interface Options { + minWidth?: number; + activeClass?: string; + containerSelector?: string; + padding?: { + top?: number; + bottom?: number; + }; +} +declare global { + interface JQuery { + pin(options?: Options): JQuery; + } +} diff --git a/types/jquery.pin/jquery.pin-tests.ts b/types/jquery.pin/jquery.pin-tests.ts new file mode 100644 index 0000000000..b43c6e7881 --- /dev/null +++ b/types/jquery.pin/jquery.pin-tests.ts @@ -0,0 +1,17 @@ +import { Options } from "jquery.pin"; + +// basic usage +$(".pinned").pin(); + +// with options +const options: Options = { + activeClass: 'active', + minWidth: 940, + containerSelector: '.container', + padding: { + top: 10, + bottom: 10 + } +}; + +$(".pinned").pin(options); diff --git a/types/jquery.pin/tsconfig.json b/types/jquery.pin/tsconfig.json new file mode 100644 index 0000000000..4e880d5205 --- /dev/null +++ b/types/jquery.pin/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "jquery.pin-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jquery.pin/tslint.json b/types/jquery.pin/tslint.json new file mode 100644 index 0000000000..d04fe2e1fa --- /dev/null +++ b/types/jquery.pin/tslint.json @@ -0,0 +1 @@ +{"extends": "dtslint/dt.json"} \ No newline at end of file From 240454d11c296e054d5b4ccf29a902d064d7918f Mon Sep 17 00:00:00 2001 From: Aleksey Klimenko Date: Sat, 24 Mar 2018 11:33:15 +0300 Subject: [PATCH 0190/2153] fix(@feathersjs/express): removed redudant export --- types/feathersjs__express/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/feathersjs__express/index.d.ts b/types/feathersjs__express/index.d.ts index 7e1eea1a1d..16bff00cd4 100644 --- a/types/feathersjs__express/index.d.ts +++ b/types/feathersjs__express/index.d.ts @@ -21,7 +21,7 @@ export function notFound(): express.RequestHandler; export function rest(): (handler?: express.RequestHandler) => void; export namespace rest { - export let formatter: express.RequestHandler; + let formatter: express.RequestHandler; } /* From 840bdf168b550909f88a9549d2a323133d47c22e Mon Sep 17 00:00:00 2001 From: Stanislav Termosa Date: Sat, 24 Mar 2018 10:53:23 +0200 Subject: [PATCH 0191/2153] Change `export default` to `export =` --- types/is-empty/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/is-empty/index.d.ts b/types/is-empty/index.d.ts index 5ac0a155c2..ca712b74cb 100644 --- a/types/is-empty/index.d.ts +++ b/types/is-empty/index.d.ts @@ -8,4 +8,4 @@ */ declare function isEmpty(value: any): boolean; -export default isEmpty; +export = isEmpty; From 11843a76f28167f56c3ae08102c492bc1d60a98c Mon Sep 17 00:00:00 2001 From: Stanislav Termosa Date: Sat, 24 Mar 2018 10:59:11 +0200 Subject: [PATCH 0192/2153] Change test to require isEmpty dependency --- types/is-empty/is-empty-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/is-empty/is-empty-tests.ts b/types/is-empty/is-empty-tests.ts index 538ae6cc71..3c49359089 100644 --- a/types/is-empty/is-empty-tests.ts +++ b/types/is-empty/is-empty-tests.ts @@ -1,4 +1,4 @@ -import isEmpty from 'is-empty'; +import isEmpty = require('is-empty'); isEmpty({}); isEmpty(null); From 8037f2788aa868f1186183e2de1d5957a0aa6eac Mon Sep 17 00:00:00 2001 From: Gareth Parker Date: Sat, 24 Mar 2018 09:06:24 +0000 Subject: [PATCH 0193/2153] Moved typings to types folder --- {glue => types/glue}/hapi-glue-test.ts | 0 {glue => types/glue}/index.d.ts | 0 {glue => types/glue}/tsconfig.json | 0 {glue => types/glue}/tslint.json | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename {glue => types/glue}/hapi-glue-test.ts (100%) rename {glue => types/glue}/index.d.ts (100%) rename {glue => types/glue}/tsconfig.json (100%) rename {glue => types/glue}/tslint.json (100%) diff --git a/glue/hapi-glue-test.ts b/types/glue/hapi-glue-test.ts similarity index 100% rename from glue/hapi-glue-test.ts rename to types/glue/hapi-glue-test.ts diff --git a/glue/index.d.ts b/types/glue/index.d.ts similarity index 100% rename from glue/index.d.ts rename to types/glue/index.d.ts diff --git a/glue/tsconfig.json b/types/glue/tsconfig.json similarity index 100% rename from glue/tsconfig.json rename to types/glue/tsconfig.json diff --git a/glue/tslint.json b/types/glue/tslint.json similarity index 100% rename from glue/tslint.json rename to types/glue/tslint.json From 1fbf0acb08b4ea083194bb25c1b98aae4f358e45 Mon Sep 17 00:00:00 2001 From: Vladimir Tikhonov Date: Sat, 24 Mar 2018 11:57:25 +0300 Subject: [PATCH 0194/2153] THREE.js: Vector2 improvements * Added applyMatrix3 method. * Fixed signature of fromBufferAttribute method. * Added some missing docs. --- types/three/test/math/test_unit_math.ts | 19 +++- types/three/three-core.d.ts | 117 +++++++++++++++++++++--- 2 files changed, 120 insertions(+), 16 deletions(-) diff --git a/types/three/test/math/test_unit_math.ts b/types/three/test/math/test_unit_math.ts index d49a60632c..b6c536085f 100644 --- a/types/three/test/math/test_unit_math.ts +++ b/types/three/test/math/test_unit_math.ts @@ -3,7 +3,7 @@ declare function ok(cond: any, desc?: string): void; declare function deepEqual(a: T, b: T, desc?: string): void; declare function equal(a: T, b: T, desc?: string): void; -// https://github.com/mrdoob/three.js/tree/master/test/unit/math +// https://github.com/mrdoob/three.js/tree/master/test/unit/src/math ()=>{ // -------------------------------------------- Constants @@ -2743,6 +2743,14 @@ declare function equal(a: T, b: T, desc?: string): void; ok( b.y == -y, "Passed!" ); }); + test( "applyMatrix3", function () { + var a = new THREE.Vector2( x, y ); + var m = new THREE.Matrix3().set( 2, 3, 5, 7, 11, 13, 17, 19, 23 ); + + a.applyMatrix3( m ); + ok( a.x == 18, "Passed!" ); + ok( a.y == 60, "Passed!" ); + }); test( "min/max/clamp", function() { var a = new THREE.Vector2( x, y ); @@ -2898,6 +2906,15 @@ declare function equal(a: T, b: T, desc?: string): void; ok( b.equals( a ), "Passed!" ); }); + test( "fromBufferAttribute", function() { + var a = new THREE.Vector2(); + var attr = new THREE.BufferAttribute( new Float32Array( [ 1, 2, 3, 4 ] ), 2 ); + + a.fromBufferAttribute( attr, 0 ); + ok( a.x == 1, "Passed!" ); + ok( a.y == 2, "Passed!" ); + }); + // -------------------------------------------- Vector3 test( "constructor", function() { var a = new THREE.Vector3(); diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index e7e421b93d..2b012cd7e2 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -4319,6 +4319,9 @@ export class Vector2 implements Vector { */ set(x: number, y: number): Vector2; + /** + * Sets the x and y values of this vector both equal to scalar. + */ setScalar(scalar: number): Vector2; /** @@ -4335,11 +4338,11 @@ export class Vector2 implements Vector { * Sets a component of this vector. */ setComponent(index: number, value: number): void; - /** * Gets a component of this vector. */ getComponent(index: number): number; + /** * Clones this vector. */ @@ -4353,29 +4356,44 @@ export class Vector2 implements Vector { * Adds v to this vector. */ add(v: Vector2): Vector2; - + /** + * Adds the scalar value s to this vector's x and y values. + */ + addScalar(s: number): Vector2; /** * Sets this vector to a + b. */ - addScalar(s: number): Vector2; addVectors(a: Vector2, b: Vector2): Vector2; - addScaledVector( v: Vector2, s: number ): Vector2; + /** + * Adds the multiple of v and s to this vector. + */ + addScaledVector(v: Vector2, s: number): Vector2; + /** * Subtracts v from this vector. - */ + */ sub(v: Vector2): Vector2; - + /** + * Subtracts s from this vector's x and y components. + */ + subScalar(s: number): Vector2; /** * Sets this vector to a - b. */ subVectors(a: Vector2, b: Vector2): Vector2; + /** + * Multiplies this vector by v. + */ multiply(v: Vector2): Vector2; /** * Multiplies this vector by scalar s. */ multiplyScalar(scalar: number): Vector2; + /** + * Divides this vector by v. + */ divide(v: Vector2): Vector2; /** * Divides this vector by scalar s. @@ -4383,15 +4401,57 @@ export class Vector2 implements Vector { */ divideScalar(s: number): Vector2; - min(v: Vector2): Vector2; + /** + * Multiplies this vector (with an implicit 1 as the 3rd component) by m. + */ + applyMatrix3(m: Matrix3): Vector2; + /** + * If this vector's x or y value is greater than v's x or y value, replace that value with the corresponding min value. + */ + min(v: Vector2): Vector2; + /** + * If this vector's x or y value is less than v's x or y value, replace that value with the corresponding max value. + */ max(v: Vector2): Vector2; + + /** + * If this vector's x or y value is greater than the max vector's x or y value, it is replaced by the corresponding value. + * If this vector's x or y value is less than the min vector's x or y value, it is replaced by the corresponding value. + * @param min the minimum x and y values. + * @param max the maximum x and y values in the desired range. + */ clamp(min: Vector2, max: Vector2): Vector2; + /** + * If this vector's x or y values are greater than the max value, they are replaced by the max value. + * If this vector's x or y values are less than the min value, they are replaced by the min value. + * @param min the minimum value the components will be clamped to. + * @param max the maximum value the components will be clamped to. + */ clampScalar(min: number, max: number): Vector2; + /** + * If this vector's length is greater than the max value, it is replaced by the max value. + * If this vector's length is less than the min value, it is replaced by the min value. + * @param min the minimum value the length will be clamped to. + * @param max the maximum value the length will be clamped to. + */ clampLength(min: number, max: number): Vector2; + + /** + * The components of the vector are rounded down to the nearest integer value. + */ floor(): Vector2; + /** + * The x and y components of the vector are rounded up to the nearest integer value. + */ ceil(): Vector2; + /** + * The components of the vector are rounded to the nearest integer value. + */ round(): Vector2; + /** + * The components of the vector are rounded towards zero (up if negative, down if positive) to an integer value. + */ roundToZero(): Vector2; /** @@ -4433,12 +4493,10 @@ export class Vector2 implements Vector { * Computes distance of this vector to v. */ distanceTo(v: Vector2): number; - /** * Computes squared distance of this vector to v. */ distanceToSquared(v: Vector2): number; - /** * @deprecated Use {@link Vector2#manhattanDistanceTo .manhattanDistanceTo()} instead. */ @@ -4449,8 +4507,18 @@ export class Vector2 implements Vector { */ setLength(length: number): Vector2; + /** + * Linearly interpolates between this vector and v, where alpha is the distance along the line - alpha = 0 will be this vector, and alpha = 1 will be v. + * @param v vector to interpolate towards. + * @param alpha interpolation factor in the closed interval [0, 1]. + */ lerp(v: Vector2, alpha: number): Vector2; - + /** + * Sets this vector to be the vector linearly interpolated between v1 and v2 where alpha is the distance along the line connecting the two vectors - alpha = 0 will be v1, and alpha = 1 will be v2. + * @param v1 the starting vector. + * @param v2 vector to interpolate towards. + * @param alpha interpolation factor in the closed interval [0, 1]. + */ lerpVectors(v1: Vector2, v2: Vector2, alpha: number): Vector2; /** @@ -4458,13 +4526,32 @@ export class Vector2 implements Vector { */ equals(v: Vector2): boolean; - fromArray(xy: number[], offset?: number): Vector2; + /** + * Sets this vector's x value to be array[offset] and y value to be array[offset + 1]. + * @param array the source array. + * @param offset (optional) offset into the array. Default is 0. + */ + fromArray(array: number[], offset?: number): Vector2; + /** + * Returns an array [x, y], or copies x and y into the provided array. + * @param array (optional) array to store the vector to. If this is not provided, a new array will be created. + * @param offset (optional) optional offset into the array. + */ + toArray(array?: number[], offset?: number): number[]; - toArray(xy?: number[], offset?: number): number[]; + /** + * Sets this vector's x and y values from the attribute. + * @param attribute the source attribute. + * @param index index in the attribute. + */ + fromBufferAttribute(attribute: BufferAttribute, index: number): Vector2; - fromBufferAttribute( attribute: BufferAttribute, index: number, offset?: number): Vector2; - - rotateAround( center: Vector2, angle: number ): Vector2; + /** + * Rotates the vector around center by angle radians. + * @param center the point around which to rotate. + * @param angle the angle to rotate, in radians. + */ + rotateAround(center: Vector2, angle: number): Vector2; /** * Computes the Manhattan length of this vector. From 95c06982ebea38a2dfcb65a69bed021c817fc42f Mon Sep 17 00:00:00 2001 From: Gareth Parker Date: Sat, 24 Mar 2018 09:57:13 +0000 Subject: [PATCH 0195/2153] Fixing build --- .../glue/{hapi-glue-test.ts => glue-tests.ts} | 4 +- types/glue/index.d.ts | 54 +++++++++---------- types/glue/tsconfig.json | 2 +- 3 files changed, 28 insertions(+), 32 deletions(-) rename types/glue/{hapi-glue-test.ts => glue-tests.ts} (90%) diff --git a/types/glue/hapi-glue-test.ts b/types/glue/glue-tests.ts similarity index 90% rename from types/glue/hapi-glue-test.ts rename to types/glue/glue-tests.ts index 2d34fdb489..7ac309352c 100644 --- a/types/glue/hapi-glue-test.ts +++ b/types/glue/glue-tests.ts @@ -15,6 +15,6 @@ const manifest: Glue.Manifest = { } ] } -} +}; -Glue.compose(manifest); \ No newline at end of file +Glue.compose(manifest); diff --git a/types/glue/index.d.ts b/types/glue/index.d.ts index 5f40ba924b..e7f12c7a68 100644 --- a/types/glue/index.d.ts +++ b/types/glue/index.d.ts @@ -1,35 +1,31 @@ // Type definitions for glue // Project: https://github.com/hapijs/glue -// Definitions by: Gareth Parker +// Definitions by: Gareth Parker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.7 -declare module "glue" { - - import { Server, ServerOptions } from "hapi"; - - export interface Options { - relativeTo: string; - preConnections?: (Server:Server, next:(err:any)=>void ) => void; - preRegister?: (Server:Server, next:(err:any)=>void ) => void; - } - - interface Plugin { - plugin: string | { - register:string; - options?:any; - }; - options?: any; - routes?: any - } - - interface Manifest { - server: ServerOptions; - register?: { - plugins: Array - } - } - - export function compose(manifest: Manifest, options?: Options): Server; +import { Server, ServerOptions } from "hapi"; +export interface Options { + relativeTo: string; + preConnections?: (Server:Server, next:(err:any)=>void ) => void; + preRegister?: (Server:Server, next:(err:any)=>void ) => void; } + +interface Plugin { + plugin: string | { + register:string; + options?:any; + }; + options?: any; + routes?: any +} + +interface Manifest { + server: ServerOptions; + register?: { + plugins: Array + } +} + +export function compose(manifest: Manifest, options?: Options): Server; + diff --git a/types/glue/tsconfig.json b/types/glue/tsconfig.json index f2d4fcee28..2d9b76b8f7 100644 --- a/types/glue/tsconfig.json +++ b/types/glue/tsconfig.json @@ -21,6 +21,6 @@ }, "files": [ "index.d.ts", - "hapi-glue-test.ts" + "glue-tests.ts" ] } \ No newline at end of file From 23083887e514e10c6be89a42ec8cb27ad7a84d0d Mon Sep 17 00:00:00 2001 From: Gareth Parker Date: Sat, 24 Mar 2018 10:01:39 +0000 Subject: [PATCH 0196/2153] Added typescript version --- types/glue/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/glue/index.d.ts b/types/glue/index.d.ts index e7f12c7a68..39b339e575 100644 --- a/types/glue/index.d.ts +++ b/types/glue/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/hapijs/glue // Definitions by: Gareth Parker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 import { Server, ServerOptions } from "hapi"; From 4e49fe797e19118bf7b25a462ac94b99e05e6e0c Mon Sep 17 00:00:00 2001 From: Gareth Parker Date: Sat, 24 Mar 2018 10:16:02 +0000 Subject: [PATCH 0197/2153] Fixing linting errors --- types/glue/index.d.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/types/glue/index.d.ts b/types/glue/index.d.ts index 39b339e575..e4dfb76e92 100644 --- a/types/glue/index.d.ts +++ b/types/glue/index.d.ts @@ -4,18 +4,22 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 +/// + import { Server, ServerOptions } from "hapi"; +// import hapi = require('hapi'); + export interface Options { relativeTo: string; - preConnections?: (Server:Server, next:(err:any)=>void ) => void; - preRegister?: (Server:Server, next:(err:any)=>void ) => void; + preConnections?: (Server: Server, next:( err: any ) => void ) => void; + preRegister?: (Server: Server, next:( err: any ) => void ) => void; } interface Plugin { plugin: string | { - register:string; - options?:any; + register: string; + options?: any; }; options?: any; routes?: any @@ -24,9 +28,8 @@ interface Plugin { interface Manifest { server: ServerOptions; register?: { - plugins: Array - } + plugins: Plugin[] + }; } export function compose(manifest: Manifest, options?: Options): Server; - From aa39b8c5b18661f82b283387d7c643c858e6ff5a Mon Sep 17 00:00:00 2001 From: Gareth Parker Date: Sat, 24 Mar 2018 10:23:18 +0000 Subject: [PATCH 0198/2153] Fixing linting errors --- types/glue/index.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/types/glue/index.d.ts b/types/glue/index.d.ts index e4dfb76e92..47cc987f10 100644 --- a/types/glue/index.d.ts +++ b/types/glue/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for glue +// Type definitions for glue 5.0 // Project: https://github.com/hapijs/glue // Definitions by: Gareth Parker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -12,20 +12,20 @@ import { Server, ServerOptions } from "hapi"; export interface Options { relativeTo: string; - preConnections?: (Server: Server, next:( err: any ) => void ) => void; - preRegister?: (Server: Server, next:( err: any ) => void ) => void; + preConnections?: (Server: Server, next: (err: any) => void) => void; + preRegister?: (Server: Server, next: (err: any) => void) => void; } -interface Plugin { +export interface Plugin { plugin: string | { register: string; options?: any; }; options?: any; - routes?: any + routes?: any; } -interface Manifest { +export interface Manifest { server: ServerOptions; register?: { plugins: Plugin[] From 22385d414c3c042f13862853668b0e725ef820e4 Mon Sep 17 00:00:00 2001 From: Gareth Parker Date: Sat, 24 Mar 2018 10:28:15 +0000 Subject: [PATCH 0199/2153] Removed reference to hapi --- types/glue/index.d.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/types/glue/index.d.ts b/types/glue/index.d.ts index 47cc987f10..8e710d233a 100644 --- a/types/glue/index.d.ts +++ b/types/glue/index.d.ts @@ -4,12 +4,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 -/// - import { Server, ServerOptions } from "hapi"; -// import hapi = require('hapi'); - export interface Options { relativeTo: string; preConnections?: (Server: Server, next: (err: any) => void) => void; From 64c4bcef505364ffe74ab943a420114df2f268b5 Mon Sep 17 00:00:00 2001 From: ckboyjiy Date: Sat, 24 Mar 2018 20:04:12 +0900 Subject: [PATCH 0200/2153] Added type definitions for Naver maps --- types/navermaps/index.d.ts | 1396 ++++++++++++++-------------- types/navermaps/navermaps-tests.ts | 205 ++-- 2 files changed, 821 insertions(+), 780 deletions(-) diff --git a/types/navermaps/index.d.ts b/types/navermaps/index.d.ts index 994c7218ff..92409a44b0 100644 --- a/types/navermaps/index.d.ts +++ b/types/navermaps/index.d.ts @@ -7,28 +7,28 @@ declare namespace naver.maps { * Types */ type PointArrayLiteral = [number, number]; - type PointLiteral = naver.maps.PointArrayLiteral | naver.maps.PointObjectLiteral; + type PointLiteral = PointArrayLiteral | PointObjectLiteral; type SizeArrayLiteral = [number, number]; - type SizeLiteral = naver.maps.SizeArrayLiteral | naver.maps.SizeObjectLiteral; - type LatLngLiteral = naver.maps.PointLiteral | naver.maps.LatLngObjectLiteral; + type SizeLiteral = SizeArrayLiteral | SizeObjectLiteral; + type LatLngLiteral = PointLiteral | LatLngObjectLiteral; type PointBoundsArrayLiteral = [number, number, number, number]; - type PointBoundsLiteral = naver.maps.PointBoundsArrayLiteral | naver.maps.PointBoundsObjectLiteral; - type LatLngBoundsLiteral = naver.maps.PointBoundsLiteral | naver.maps.LatLngBoundsObjectLiteral; - type BoundsLiteral = naver.maps.PointBoundsLiteral | naver.maps.LatLngBoundsLiteral; - type CoordLiteral = naver.maps.PointLiteral | naver.maps.LatLngLiteral; - type Coord = naver.maps.Point | naver.maps.LatLng; - type Bounds = naver.maps.PointBounds | naver.maps.LatLngBounds; + type PointBoundsLiteral = PointBoundsArrayLiteral | PointBoundsObjectLiteral; + type LatLngBoundsLiteral = PointBoundsLiteral | LatLngBoundsObjectLiteral; + type BoundsLiteral = PointBoundsLiteral | LatLngBoundsLiteral; + type CoordLiteral = PointLiteral | LatLngLiteral; + type Coord = Point | LatLng; + type Bounds = PointBounds | LatLngBounds; type DOMEvent = Event; - type StylingFunction = (feature: naver.maps.Feature) => naver.maps.StyleOptions; - type ArrayOfCoords = naver.maps.Point[] | naver.maps.LatLng[]; - type ArrayOfBounds = naver.maps.PointBounds[] | naver.maps.LatLngBounds[]; - type ArrayOfBoundsLiteral = naver.maps.PointBoundsLiteral[] | naver.maps.LatLngBoundsLiteral[]; - type forEachOverlayCallback = (overlay: naver.maps.Marker | naver.maps.Polyline | naver.maps.Polygon, index: number) => void; - type GeoJSON = object; - type GPX = object; - type KML = object; + type StylingFunction = (feature: Feature) => StyleOptions; + type ArrayOfCoords = Point[] | LatLng[]; + type ArrayOfBounds = PointBounds[] | LatLngBounds[]; + type ArrayOfBoundsLiteral = PointBoundsLiteral[] | LatLngBoundsLiteral[]; + type forEachOverlayCallback = (overlay: Marker | Polyline | Polygon, index: number) => void; + type GeoJSON = any; + type GPX = any; + type KML = any; type KVOArrayOfCoords = any; - type ArrayOfCoordsLiteral = naver.maps.PointLiteral[] | naver.maps.LatLngLiteral[]; + type ArrayOfCoordsLiteral = PointLiteral[] | LatLngLiteral[]; type strokeStyleType = 'solid' | 'shortdash' | 'shortdot' | 'shortdashdot' | 'shortdashdotdot' | 'dot' | 'dash' | 'longdash' | 'dashdot' | 'longdashdot' | 'longdashdotdot'; type strokeLineCapType = 'butt' | 'round' | 'square'; @@ -37,46 +37,51 @@ declare namespace naver.maps { /** * Interfaces */ - export interface PointObjectLiteral { + interface MapEventListener { + eventName: string; + listener: () => any; + listenerId: string; + target: any; + } + interface PointObjectLiteral { x: number; y: number; } - export interface SizeObjectLiteral { + interface SizeObjectLiteral { width: number; height: number; } - export interface LatLngObjectLiteral { + interface LatLngObjectLiteral { lat: number; lng: number; } - export interface PointBoundsObjectLiteral { + interface PointBoundsObjectLiteral { minX: number; minY: number; maxX: number; maxY: number; } - export interface LatLngBoundsObjectLiteral { + interface LatLngBoundsObjectLiteral { north: number; east: number; south: number; west: number; } - export interface MapSystemProjection extends KVO { + interface MapSystemProjection extends KVO { factor(zoom: number): number; - fromCoordToOffset(coord: naver.maps.Coord): naver.maps.Point; - fromCoordToPoint(coord: naver.maps.Coord): naver.maps.Point; - fromOffsetToCoord(offset: naver.maps.Point): naver.maps.Coord; - fromOffsetToPoint(offset: naver.maps.Point): naver.maps.Point; - fromPointToCoord(point: naver.maps.Point): naver.maps.Coord; - fromPointToOffset(point: naver.maps.Point): naver.maps.Point; - getDestinationCoord(fromCoord: naver.maps.Coord, angle: number, meter: number): naver.maps.Coord; - getDistance(coord1: naver.maps.Coord, coord2: naver.maps.Coord): number; + fromCoordToOffset(coord: Coord): Point; + fromCoordToPoint(coord: Coord): Point; + fromOffsetToCoord(offset: Point): Coord; + fromOffsetToPoint(offset: Point): Point; + fromPointToCoord(point: Point): Coord; + fromPointToOffset(point: Point): Point; + getDestinationCoord(fromCoord: Coord, angle: number, meter: number): Coord; + getDistance(coord1: Coord, coord2: Coord): number; getProjectionName(): number; - scaleDown(operand: number | naver.maps.Point | naver.maps.Size, zoom: number): number | naver.maps.Point | naver.maps.Size; - scaleUp(operand: number | naver.maps.Point | naver.maps.Size, zoom: number): number | naver.maps.Point | naver.maps.Size; - + scaleDown(operand: number | Point | Size, zoom: number): number | Point | Size; + scaleUp(operand: number | Point | Size, zoom: number): number | Point | Size; } - export interface MapOptions { + interface MapOptions { background?: string; baseTileOpacity?: number; bounds?: any; @@ -113,7 +118,7 @@ declare namespace naver.maps { zoomControlOptions?: any; zoomOrigin?: any; } - export interface MarkerOptions { + interface MarkerOptions { animation?: any; map?: Map; position?: any; @@ -126,344 +131,349 @@ declare namespace naver.maps { visible?: boolean; zIndex?: number; } - export interface MapPanes { + interface MapPanes { overlayLayer: HTMLElement; overlayImage: HTMLElement; floatPane: HTMLElement; } - export interface MapEventListener { - eventName: string; - listener: Function; - listenerId: string; - target: object; - } - export interface InfoWindowOptions { - position: naver.maps.Coord | naver.maps.CoordLiteral; + interface InfoWindowOptions { + position?: Coord | CoordLiteral; content: string | HTMLElement; zIndex?: number; maxWidth?: number; - pixelOffset?: naver.maps.Point | naver.maps.PointLiteral; + pixelOffset?: Point | PointLiteral; backgroundColor?: string; borderColor?: string; borderWidth?: number; disableAutoPan?: boolean; disableAnchor?: boolean; anchorSkew?: boolean; - anchorSize?: naver.maps.Size | naver.maps.SizeLiteral; + anchorSize?: Size | SizeLiteral; anchorColor?: string; } - export interface ImageTileOptions { + interface ImageTileOptions { urls: string[]; - imgonload?: Function; - imgonerror?: Function; + imgonload?: () => any; + imgonerror?: () => any; opacity?: number; transition?: boolean; - offset?: naver.maps.Point; + offset?: Point; zIndex?: number; - size?: naver.maps.Size; + size?: Size; pane?: HTMLElement; } - export interface ImageMapTypeOptions { + interface ImageMapTypeOptions { name: string; maxZoom: number; minZoom: number; - projection: naver.maps.Projection; - tileSize?: naver.maps.Size | naver.maps.SizeLiteral; + projection: Projection; + tileSize?: Size | SizeLiteral; repeatX?: boolean; vendor?: string; - provider?: naver.maps.MapDataProvider; + provider?: MapDataProvider[]; uid?: string; darktheme?: boolean; - getTileUrl?: Function; + getTileUrl?: () => any; tileSet?: string | string[]; } - export interface GroundOverlayOptions { + interface GroundOverlayOptions { clickable?: boolean; - map?: naver.maps.Map | null; + map?: Map | null; opacity?: number; } - export interface EllipseOptions { - map?: naver.maps.Map; - bounds: naver.maps.Bounds | naver.maps.BoundsLiteral; + interface EllipseOptions { + map?: Map; + bounds: Bounds | BoundsLiteral; strokeWeight?: number; strokeOpacity?: number; strokeColor?: string; - strokeStyle?: naver.maps.strokeStyleType; - strokeLineCap?: naver.maps.strokeLineCapType; - strokeLineJoin?: naver.maps.strokeLineJoinType; + strokeStyle?: strokeStyleType; + strokeLineCap?: strokeLineCapType; + strokeLineJoin?: strokeLineJoinType; fillColor?: string; fillOpacity?: number; clickable?: boolean; visible?: boolean; zIndex?: number; } - export interface FeatureEvent { - feature: naver.maps.Feature; + interface FeatureEvent { + feature: Feature; } - export interface PointerEvent { - coord: naver.maps.Coord; - point: naver.maps.Point; - offset: naver.maps.Point; - pointerEvent: naver.maps.DOMEvent; - feature: naver.maps.Feature; + interface PointerEvent { + coord: Coord; + point: Point; + offset: Point; + pointerEvent: DOMEvent; + feature: Feature; } - export interface PropertyEvent { - feature: naver.maps.Feature; + interface PropertyEvent { + feature: Feature; name: string; oldValue: any; newValue: any; } - export interface StyleOptions { + interface StyleOptions { strokeColor?: string; strokeOpacity?: number; strokeWeight?: number; fillColor?: string; fillOpacity?: number; clickable?: boolean; - icon?: string | naver.maps.ImageIcon | naver.maps.SymbolIcon | naver.maps.HtmlIcon; - shape?: naver.maps.MarkerShape; + icon?: string | ImageIcon | SymbolIcon | HtmlIcon; + shape?: MarkerShape; title?: string; visible?: boolean; zIndex?: number; } - export interface ControlOptions { - position: naver.maps.Position; + interface ControlOptions { + position: Position; } - export interface CircleOptions { - map?: naver.maps.Map; - center: naver.maps.Coord | naver.maps.CoordLiteral; + interface CircleOptions { + map?: Map; + center: Coord | CoordLiteral; radius?: number; strokeWeight?: number; strokeOpacity?: number; strokeColor?: string; - strokeStyle?: naver.maps.strokeStyleType; - strokeLineCap?: naver.maps.strokeLineCapType; - strokeLineJoin?: naver.maps.strokeLineJoinType; + strokeStyle?: strokeStyleType; + strokeLineCap?: strokeLineCapType; + strokeLineJoin?: strokeLineJoinType; fillColor?: string; fillOpacity?: number; clickable?: boolean; visible?: boolean; zIndex?: number; } - export interface TileOptions { + interface TileOptions { opacity?: number; transition?: boolean; - offset?: naver.maps.Point; + offset?: Point; zIndex?: number; - size?: naver.maps.Size; + size?: Size; pane?: HTMLElement; } - export interface TileIndex { + interface TileIndex { xIndex: number; yIndex: number; } - export interface CanvasTileOptions { + interface CanvasTileOptions { imageData?: ImageData; opacity?: number; transition?: boolean; - offset?: naver.maps.Point; + offset?: Point; zIndex?: number; - size?: naver.maps.Size; + size?: Size; pane?: HTMLElement; } - export interface CanvasMapTypeOptions { + interface CanvasMapTypeOptions { name: string; maxZoom: number; minZoom: number; - projection: naver.maps.Projection; - tileSize?: naver.maps.Size | naver.maps.SizeLiteral; + projection: Projection; + tileSize?: Size | SizeLiteral; repeatX?: boolean; vendor?: string; - provider?: naver.maps.MapDataProvider; + provider?: MapDataProvider[]; uid?: string; darktheme?: boolean; - getTileData?: Function; + getTileData?: () => any; } - export interface MapDataProvider { + interface MapDataProvider { title: string; - link: string; - bounds: naver.maps.Bounds | naver.maps.BoundsLiteral | naver.maps.ArrayOfBounds | naver.maps.ArrayOfBoundsLiteral; + link?: string; + bounds?: Bounds | BoundsLiteral | ArrayOfBounds | ArrayOfBoundsLiteral; } - export interface MapType { + interface MapType { maxZoom: number; minZoom: number; name: string; - projection: naver.maps.Projection; - tileSize: naver.maps.Size; - getTile(x: number, y: number, z: number): HTMLElement | naver.maps.Tile; + projection: Projection; + tileSize: Size; + getTile(x: number, y: number, z: number): HTMLElement | Tile; } - export interface Projection { - fromCoordToPoint(coord: naver.maps.Coord): naver.maps.Point; - fromPointToCoord(point: naver.maps.Point): Coord; + interface Projection { + fromCoordToPoint(coord: Coord): Point; + fromPointToCoord(point: Point): Coord; } - export interface CadastralLayerOptions { - overlayMap?: boolean; - zIndex?: number; + interface CadastralLayerOptions { + overlayMap: boolean | undefined; + zIndex: number | undefined; } - export interface AroundControlOptions { - position: naver.maps.Position; + interface AroundControlOptions { + position: Position; } - export interface NaverImageMapTypeOptions { + interface NaverImageMapTypeOptions { maxZoom?: number; minZoom?: number; - projection?: naver.maps.Projection; - tileSize?: naver.maps.Size; + projection?: Projection; + tileSize?: Size; hd?: string; } - export interface LogoControlOptions { - position: naver.maps.Position; + interface LogoControlOptions { + position: Position; } - export interface MapDataControlOptions { - position: naver.maps.Position; + interface MapDataControlOptions { + position: Position; } - export interface MapTypeControlOptions { - mapTypeIds: naver.maps.MapTypeId[] | null; - position: naver.maps.Position; - style: naver.maps.MapTypeControlStyle; + interface MapTypeControlOptions { + mapTypeIds: MapTypeId[] | null; + position: Position; + style: MapTypeControlStyle; } - export interface ScaleControlOptions { - position: naver.maps.Position; + interface ScaleControlOptions { + position: Position; } - export interface ZoomControlOptions { - position: naver.maps.Position; - style: naver.maps.ZoomControlStyle; + interface ZoomControlOptions { + position: Position; + style: ZoomControlStyle; legendDisabled: boolean; } - export interface LayerOptions { + interface LayerOptions { hd: boolean; - overlayMap: boolean; - zIndex: number; + overlayMap: boolean | undefined; + zIndex: number | undefined; } - export interface CadastralLayerOptions { - overlayMap: boolean; - zIndex: number; + interface CadastralLayerOptions { + overlayMap: boolean | undefined; + zIndex: number | undefined; } - export interface StreetLayerOptions { - overlayMap: boolean; - zIndex: number; + interface StreetLayerOptions { + overlayMap: boolean | undefined; + zIndex: number | undefined; } - export interface TrafficLayerOptions { + interface TrafficLayerOptions { interval: number; - overlayMap: boolean; - zIndex: number; + overlayMap: boolean | undefined; + zIndex: number | undefined; } - export interface HtmlIcon { + interface HtmlIcon { content: string | HTMLElement; - size?: naver.maps.Size | naver.maps.SizeLiteral; - anchor?: naver.maps.Point | naver.maps.PointLiteral | naver.maps.Position; + size?: Size | SizeLiteral; + anchor?: Point | PointLiteral | Position; } - export interface ImageIcon { + interface ImageIcon { url: string; - size?: naver.maps.Size | naver.maps.SizeLiteral; - scaledSize?: naver.maps.Size |naver.maps. SizeLiteral; - origin?: naver.maps.Point | naver.maps.PointLiteral; - anchor?: naver.maps.Point | naver.maps.PointLiteral | naver.maps.Position; + size?: Size | SizeLiteral; + scaledSize?: Size | SizeLiteral; + origin?: Point | PointLiteral; + anchor?: Point | PointLiteral | Position; } - export interface MarkerShape { + interface MarkerShape { coords: any[]; type: string; } - export interface SymbolIcon { - path: naver.maps.SymbolPath | naver.maps.Point[] | naver.maps.PointLiteral[]; - style?: naver.maps.SymbolStyle; + interface SymbolIcon { + path: SymbolPath | Point[] | PointLiteral[]; + style?: SymbolStyle; radius?: number; fillColor?: string; fillOpacity?: number; strokeColor?: string; strokeWeight?: number; strokeOpacity?: number; - anchor?: naver.maps.Point | naver.maps.PointLiteral | naver.maps.Position; + anchor?: Point | PointLiteral | Position; } - export interface PolygonOptions { - map?: naver.maps.Map; - paths: naver.maps.ArrayOfCoords[] | naver.maps.KVOArrayOfCoords[] | naver.maps.ArrayOfCoordsLiteral[]; + interface PolygonOptions { + map?: Map; + paths: ArrayOfCoords[] | KVOArrayOfCoords[] | ArrayOfCoordsLiteral[]; strokeWeight?: number; strokeOpacity?: number; strokeColor?: string; - strokeStyle?: naver.maps.strokeStyleType; - strokeLineCap?: naver.maps.strokeLineCapType; - strokeLineJoin?: naver.maps.strokeLineJoinType; + strokeStyle?: strokeStyleType; + strokeLineCap?: strokeLineCapType; + strokeLineJoin?: strokeLineJoinType; fillColor?: string; fillOpacity?: number; clickable?: boolean; visible?: boolean; zIndex?: number; } - export interface PolylineOptions { - map?: naver.maps.Map; - path: naver.maps.ArrayOfCoords | naver.maps.KVOArrayOfCoords | naver.maps.ArrayOfCoordsLiteral; + interface PolylineOptions { + map?: Map; + path: ArrayOfCoords | KVOArrayOfCoords | ArrayOfCoordsLiteral; strokeWeight?: number; strokeOpacity?: number; strokeColor?: string; - strokeStyle?: naver.maps.strokeStyleType; - strokeLineCap?: naver.maps.strokeLineCapType; - strokeLineJoin?: naver.maps.strokeLineJoinType; + strokeStyle?: strokeStyleType; + strokeLineCap?: strokeLineCapType; + strokeLineJoin?: strokeLineJoinType; clickable?: boolean; visible?: boolean; zIndex?: number; - startIcon?: naver.maps.PointingIcon; + startIcon?: PointingIcon; startIconSize?: number; - endIcon?: naver.maps.PointingIcon; + endIcon?: PointingIcon; endIconSize?: number; } - export interface RectangleOptions { - map?: naver.maps.Map; - bounds: naver.maps.Bounds | naver.maps.BoundsLiteral; + interface RectangleOptions { + map?: Map; + bounds: Bounds | BoundsLiteral; strokeWeight?: number; strokeOpacity?: number; strokeColor?: string; - strokeStyle?: naver.maps.strokeStyleType; - strokeLineCap?: naver.maps.strokeLineCapType; - strokeLineJoin?: naver.maps.strokeLineJoinType; + strokeStyle?: strokeStyleType; + strokeLineCap?: strokeLineCapType; + strokeLineJoin?: strokeLineJoinType; fillColor?: string; fillOpacity?: number; clickable?: boolean; visible?: boolean; zIndex?: number; } - export interface PanoramaOptions { - size: naver.maps.Size | naver.maps.SizeLiteral; + interface PanoramaOptions { + size: Size | SizeLiteral; panoId: string; - position: naver.maps.LatLng | naver.maps.LatLngLiteral; - pov: naver.maps.PanoramaPov; + position: LatLng | LatLngLiteral; + pov: PanoramaPov; visible: boolean; minScale: number; maxScale: number; minZoom: number; maxZoom: number; logoControl: boolean; - logoControlOptions: naver.maps.LogoControlOptions; + logoControlOptions: LogoControlOptions; zoomControl: boolean; - zoomControlOptions: naver.maps.ZoomControlOptions; + zoomControlOptions: ZoomControlOptions; aroundControl: boolean; - aroundControlOptions: naver.maps.AroundControlOptions; + aroundControlOptions: AroundControlOptions; } - export interface PanoramaPov { + interface PanoramaPov { pan: number; tilt: number; fov: number; } - export interface PanoramaLocation { + interface PanoramaLocation { panoId: string; title: string; address: string; - coord: naver.maps.LatLng; + coord: LatLng; photodate: string; } - export interface DOMEventListener { + interface DOMEventListener { eventName: string; - listener: Function; + listener: () => any; target: HTMLElement; } + interface Margin { + top?: number; + right?: number; + bottom?: number; + left?: number; + } + + interface TransitionOptions { + duration?: number; + easing?: string; + } /** * Enums */ - export enum MapTypeControlStyle { + enum MapTypeControlStyle { BUTTON, DROPDOWN } - export enum ZoomControlStyle { + enum ZoomControlStyle { LARGE, SMALL } @@ -471,25 +481,26 @@ declare namespace naver.maps { /** * Members */ - export enum Animation { + enum Animation { BOUNCE = 1, DROP } let jsContentLoaded: boolean; - export enum MapTypeId { // TODO. 확실하지 않음 - NORMAL, - TERRAIN, - SATELLITE, - HYBRID + type MapTypeId = string; + namespace MapTypeId { // TODO. 확실하지 않음 + let NORMAL: string; + let TERRAIN: string; + let SATELLITE: string; + let HYBRID: string; } - export function onJSContentLoaded(...args: any[]): any; - export enum PointingIcon { + function onJSContentLoaded(...args: any[]): any; + enum PointingIcon { OPEN_ARROW = 1, BLOCK_ARROW, CIRCLE, DIAMOND } - export enum Position { + enum Position { CENTER = 0, TOP_LEFT, TOP_CENTER, @@ -504,39 +515,40 @@ declare namespace naver.maps { BOTTOM_CENTER, BOTTOM_RIGHT } - export enum SymbolPath { + enum SymbolPath { BACKWARD_CLOSED_ARROW = 1, BACKWARD_OPEN_ARROW, CIRCLE, FORWARD_CLOSED_ARROW, FORWARD_OPEN_ARROW } - export enum SymbolStyle { - CIRCLE = 'circle', - PATH = 'path', - CLOSED_PATH = 'closedPath' + type SymbolStyle = string; + namespace SymbolStyle { + let CIRCLE: string; + let PATH: string; + let CLOSED_PATH: string; } /** * Classes */ - // KVO - export class KVO { + // KVO + class KVO { constructor(); - addListener(eventName: any, listener: Function): naver.maps.MapEventListener; - addListenerOnce(eventName: string | any, listener: Function): naver.maps.MapEventListener; - bindTo(key: string, target: naver.maps.KVO, targetKey?: string): void; + addListener(eventName: any, listener: () => any): MapEventListener; + addListenerOnce(eventName: any, listener: () => any): MapEventListener; + bindTo(key: string, target: KVO, targetKey?: string): void; clearListeners(eventName: string): void; get(key: string): any; hasListener(eventName: string): boolean; - removeListener(listeners: naver.maps.MapEventListener | MapEventListener[]): void; + removeListener(listeners: MapEventListener | MapEventListener[]): void; set(key: string, value: any, silently?: boolean): void; - setValues(properties: object): void; + setValues(properties: any): void; trigger(eventName: string, eventObject?: any): void; unbind(key: string): void; unbindAll(): void; } - export class KVOArray extends naver.maps.KVO { + class KVOArray extends KVO { constructor(array: any[]); clear(): void; forEach(callback: (element: any, index: number) => void): void; @@ -553,533 +565,559 @@ declare namespace naver.maps { splice(startIndex: number, deleteCount: number, element?: any): any[]; } // Base - export class Point { + class Point { constructor(x: number, y: number); - add(point: naver.maps.Coord | naver.maps.PointLiteral): naver.maps.Point; - add(x: number, y: number): naver.maps.Point; - ceil(): naver.maps.Point; - clone(): naver.maps.Point; - div(point: naver.maps.Coord | naver.maps.PointLiteral); - div(x: number, y: number): naver.maps.Point; - equals(point: naver.maps.Point): boolean; - floor(): naver.maps.Point; - mul(point: naver.maps.Coord | naver.maps.PointLiteral): naver.maps.Point; - mul(x: number, y: number): naver.maps.Point; - round(): naver.maps.Point; - sub(point: naver.maps.Coord | naver.maps.PointLiteral): naver.maps.Point; - sub(x: number, y: number): naver.maps.Point; + add(point: Coord | PointLiteral): Point; + add(x: number, y: number): Point; + ceil(): Point; + clone(): Point; + div(point: Coord | PointLiteral): void; + div(x: number, y: number): Point; + equals(point: Point): boolean; + floor(): Point; + mul(point: Coord | PointLiteral): Point; + mul(x: number, y: number): Point; + round(): Point; + sub(point: Coord | PointLiteral): Point; + sub(x: number, y: number): Point; toString(): string; } - export class Size { + class Size { + width: number; + height: number; constructor(width: number, height: number); - add(size: naver.maps.Size | naver.maps.SizeLiteral): naver.maps.Size; - add(width: number, height: number): naver.maps.Size; - ceil(): naver.maps.Size; - clone(): naver.maps.Size; - div(width: number, height: number): naver.maps.Size; - div(size: naver.maps.Size | naver.maps.SizeLiteral): naver.maps.Size; - equals(size: naver.maps.Size | naver.maps.SizeLiteral): boolean; - floor(): naver.maps.Size; - mul(size: naver.maps.Size | naver.maps.SizeLiteral): naver.maps.Size; - mul(width: number, height: number): naver.maps.Size; - round(): naver.maps.Size; - sub(size: naver.maps.Size | naver.maps.SizeLiteral): naver.maps.Size; - sub(width: number, height: number): naver.maps.Size; + add(size: Size | SizeLiteral): Size; + add(width: number, height: number): Size; + ceil(): Size; + clone(): Size; + div(width: number, height: number): Size; + div(size: Size | SizeLiteral): Size; + equals(size: Size | SizeLiteral): boolean; + floor(): Size; + mul(size: Size | SizeLiteral): Size; + mul(width: number, height: number): Size; + round(): Size; + sub(size: Size | SizeLiteral): Size; + sub(width: number, height: number): Size; toString(): string; } - export class PointBounds { - constructor(minPoint: naver.maps.Point, maxPoint: naver.maps.Point); - static bounds(point: naver.maps.Coord | naver.maps.PointLiteral, - pointN: naver.maps.Coord | naver.maps.PointLiteral): naver.maps.PointBounds; - clone(): naver.maps.PointBounds; - equals(bounds: naver.maps.Bounds | naver.maps.PointBoundsLiteral): boolean; - extend(point: naver.maps.Coord | naver.maps.PointLiteral): naver.maps.PointBounds; - getCenter(): naver.maps.Point; - getMax(): naver.maps.Point; - getMin(): naver.maps.Point; - hasBounds(bounds: naver.maps.Bounds | naver.maps.PointBoundsLiteral): boolean; - hasPoint(point: naver.maps.Coord | naver.maps.PointLiteral): boolean; - intersects(bounds: naver.maps.Bounds | naver.maps.PointBoundsLiteral): boolean; + class PointBounds { + constructor(minPoint: Point, maxPoint: Point); + static bounds(point: Coord | PointLiteral, + pointN: Coord | PointLiteral): PointBounds; + clone(): PointBounds; + equals(bounds: Bounds | PointBoundsLiteral): boolean; + extend(point: Coord | PointLiteral): PointBounds; + getCenter(): Point; + getMax(): Point; + getMin(): Point; + hasBounds(bounds: Bounds | PointBoundsLiteral): boolean; + hasPoint(point: Coord | PointLiteral): boolean; + intersects(bounds: Bounds | PointBoundsLiteral): boolean; maxX(): number; maxY(): number; minX(): number; minY(): number; toString(): string; - union(bounds: naver.maps.Bounds | naver.maps.PointBoundsLiteral): naver.maps.PointBounds; + union(bounds: Bounds | PointBoundsLiteral): PointBounds; } - export class LatLng extends Point { + class LatLng extends Point { constructor(lat: number, lng: number); - clone(): naver.maps.LatLng; - destinationPoint(angle: number, meter: number): naver.maps.LatLng; - equals(point: naver.maps.Coord | naver.maps.LatLngLiteral): boolean; + clone(): LatLng; + destinationPoint(angle: number, meter: number): LatLng; + equals(point: Coord | LatLngLiteral): boolean; lat(): number; lng(): number; - toPoint(): naver.maps.Point; + toPoint(): Point; toString(): string; } - export class LatLngBounds extends PointBounds { - constructor(sw: naver.maps.LatLng, ne: naver.maps.LatLng); - static bounds(latlng: naver.maps.Coord | naver.maps.LatLngLiteral, - latlngN: naver.maps.Coord | naver.maps.LatLngLiteral): naver.maps.LatLngBounds; - clone(): naver.maps.LatLngBounds; + class LatLngBounds extends PointBounds { + constructor(sw: LatLng, ne: LatLng); + static bounds(latlng: Coord | LatLngLiteral, + latlngN: Coord | LatLngLiteral): LatLngBounds; + clone(): LatLngBounds; east(): number; - equals(bounds: naver.maps.Bounds | naver.maps.LatLngBoundsLiteral): boolean; - extend(latlng: naver.maps.Coord | naver.maps.LatLngLiteral): naver.maps.LatLngBounds; - getCenter(): naver.maps.LatLng; - getNE(): naver.maps.LatLng; - getSW(): naver.maps.LatLng; - hasLatLng(latlng: naver.maps.Coord | naver.maps.LatLngLiteral): boolean; - intersects(bounds: naver.maps.Bounds | naver.maps.LatLngBoundsLiteral): boolean; + equals(bounds: Bounds | LatLngBoundsLiteral): boolean; + extend(latlng: Coord | LatLngLiteral): LatLngBounds; + getCenter(): LatLng; + getNE(): LatLng; + getSW(): LatLng; + hasLatLng(latlng: Coord | LatLngLiteral): boolean; + intersects(bounds: Bounds | LatLngBoundsLiteral): boolean; north(): number; south(): number; - toPointBounds(): naver.maps.PointBounds; - union(bounds: naver.maps.Bounds | naver.maps.LatLngBoundsLiteral): naver.maps.LatLngBounds; + toPointBounds(): PointBounds; + union(bounds: Bounds | LatLngBoundsLiteral): LatLngBounds; west(): number; } // Map - export class Map { + class Map extends KVO { controls: any; data: any; layers: any; mapTypes: any; mapSystemProjection: any; - constructor(mapDiv: string, mapOptions: MapOptions); + constructor(mapDiv: string, mapOptions?: MapOptions); addPane(name: string, elementOrIndex: HTMLElement | number): void; destory(): void; - fitBounds(bounds: any, margin: any): void; - getBounds(): any; - getSize(): any; + fitBounds(bounds: any, margin?: any): void; + getBounds(): Bounds; + getCenter(): Coord; + getCenterPoint(): Coord; + getElement(): HTMLElement; + getMapTypeId(): string; + getOptions(key?: string): any; + getPanes(): MapPanes; + getPrimitiveProjection(): Projection; + getProjection(): MapSystemProjection; + getSize(): Size; + getZoom(): number; + morph(coord: Coord | CoordLiteral, zoom?: number, transitionOptions?: TransitionOptions): void; + panBy(offset: Point | PointLiteral): void; + panTo(coord: Coord | CoordLiteral, transitionOptions: TransitionOptions): void; + panToBounds(bounds: Bounds | BoundsLiteral, transitionOptions: TransitionOptions, margin?: Margin): void; + refresh(noEffect?: boolean): void; + removePane(name: string): void; + setCenter(center: Coord | CoordLiteral): void; + setCenterPoint(point: Point | PointLiteral): void; + setMapTypeId(mapTypeId: string): void; + setOptions(newOptionsOrKey: any, value?: any): void; + setSize(size: Size | SizeLiteral): void; + setZoom(zoom: number, effect?: boolean): void; + updateBy(coord: Coord | CoordLiteral, zoom: number): void; + zoomBy(deltaZoom: number, zoomOrigin?: Coord | CoordLiteral, effect?: boolean): void; } // Map.Tile - export class Tile extends naver.maps.KVO { - constructor(element: HTMLElement, tileOptions?: naver.maps.TileOptions); + class Tile extends KVO { + constructor(element: HTMLElement, tileOptions?: TileOptions); appendTo(parentNode: HTMLElement): void; cancelFadeIn(): void; destroy(): void; - fadeIn(callback: Function, startOpacity?: number): void; + fadeIn(callback: () => any, startOpacity?: number): void; getElement(): HTMLElement; - getOffset(): naver.maps.Point; + getOffset(): Point; getOpacity(): number; - getSize(): naver.maps.Size; - getTileIndex(): naver.maps.TileIndex; + getSize(): Size; + getTileIndex(): TileIndex; getZIndex(): number; hide(): void; - load(tileOptions?: naver.maps.TileOptions): void; + load(tileOptions?: TileOptions): void; remove(): void; - reset(mapType: naver.maps.MapType, zoom: number, tileOptions?: naver.maps.TileOptions): void; + reset(mapType: MapType, zoom: number, tileOptions?: TileOptions): void; setBlank(): void; - setOffset(offset: naver.maps.Point): void; + setOffset(offset: Point): void; setOffset(x: number, y: number): void; setOpacity(opacity: number): void; - setSize(size: naver.maps.Size): void; - setTileIndex(tileIndex: naver.maps.TileIndex): void; + setSize(size: Size): void; + setTileIndex(tileIndex: TileIndex): void; setZIndex(zIndex: number): void; show(): void; - } - export class CanvasTile extends naver.maps.Tile { - constructor(canvasTileOptions: naver.maps.CanvasTileOptions); + class CanvasTile extends Tile { + constructor(canvasTileOptions: CanvasTileOptions); } - export class ImageTile extends naver.maps.Tile { - constructor(imageTileOptions: naver.maps.ImageTileOptions); + class ImageTile extends Tile { + constructor(imageTileOptions: ImageTileOptions); getImageElements(): HTMLElement[]; getUrls(): string[]; setUrls(urls: string[]): void; } // Map.MapType - export class CanvasMapType implements naver.maps.MapType { + class CanvasMapType implements MapType { maxZoom: number; minZoom: number; name: string; - projection: naver.maps.Projection; - tileSize: naver.maps.Size; - constructor(canvasMapTypeOptions: naver.maps.CanvasMapTypeOptions); - getMapTypeOptions(): naver.maps.CanvasMapTypeOptions; + projection: Projection; + tileSize: Size; + constructor(canvasMapTypeOptions: CanvasMapTypeOptions); + getMapTypeOptions(): CanvasMapTypeOptions; getMaxZoom(): number; getMinZoom(): number; getName(): string; - getTile(x: number, y: number, z: number): naver.maps.CanvasTile; + getTile(x: number, y: number, z: number): CanvasTile; getTileData(x: number, y: number, z: number): ImageData; - setMapTypeOptions(canvasMapTypeOptions: naver.maps.CanvasMapTypeOptions): void; + setMapTypeOptions(canvasMapTypeOptions: CanvasMapTypeOptions): void; } - export class ImageMapType implements naver.maps.MapType { + class ImageMapType implements MapType { maxZoom: number; minZoom: number; name: string; - projection: naver.maps.Projection; - tileSize: naver.maps.Size; - constructor(imageMapTypeOptions); - getMapTypeOptions(): naver.maps.ImageMapTypeOptions; + projection: Projection; + tileSize: Size; + constructor(imageMapTypeOptions: ImageMapTypeOptions); + getMapTypeOptions(): ImageMapTypeOptions; getMaxZoom(): number; getMinZoom(): number; getName(): string; - getTile(x: number, y: number, z: number): naver.maps.ImageTile; + getTile(x: number, y: number, z: number): ImageTile; getTileUrls(x: number, y: number, z: number): string[]; - setMapTypeOptions(imageMapTypeOptions: naver.maps.ImageMapTypeOptions): void; + setMapTypeOptions(imageMapTypeOptions: ImageMapTypeOptions): void; } - export class MapTypeRegistry extends naver.maps.KVO { - constructor(mapTypeInfo: object, defaultMapTypeId?: string); + class MapTypeRegistry extends KVO { + constructor(mapTypeInfo?: any, defaultMapTypeId?: string); getPreviousTypeId(): string; - getSelectedType(): naver.maps.MapType; + getSelectedType(): MapType; getSelectedTypeId(): string; getTypeIds(): string[]; - set(mapTypeId: string, mapType: naver.maps.MapType): void; + set(mapTypeId: string, mapType: MapType): void; setSelectedTypeId(mapTypeId: string): void; } + // Map.MapType.Preset - export class NaverMapTypeOption { - constructor(options: naver.maps.NaverImageMapTypeOptions); - static getBicycleLayer(opts: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getBlankMap(opts: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getCadastralLayer(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getHybridMap(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getMapTypes(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.MapTypeRegistry; - static getNormalLabelLayer(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getNormalMap(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getSatelliteLabelLayer(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getSatelliteMap(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getStreetLayer(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getTerrainMap(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getTrafficLayer(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getVectorMap(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getWorldMap(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; + function NaverMapTypeOption(options: NaverImageMapTypeOptions): void; + namespace NaverMapTypeOption { + function getBicycleLayer(opts: NaverImageMapTypeOptions): ImageMapType; + function getBlankMap(opts: NaverImageMapTypeOptions): ImageMapType; + function getCadastralLayer(opts?: NaverImageMapTypeOptions): ImageMapType; + function getHybridMap(opts?: NaverImageMapTypeOptions): ImageMapType; + function getMapTypes(opts?: NaverImageMapTypeOptions): MapTypeRegistry; + function getNormalLabelLayer(opts?: NaverImageMapTypeOptions): ImageMapType; + function getNormalMap(opts?: NaverImageMapTypeOptions): ImageMapType; + function getSatelliteLabelLayer(opts?: NaverImageMapTypeOptions): ImageMapType; + function getSatelliteMap(opts?: NaverImageMapTypeOptions): ImageMapType; + function getStreetLayer(opts?: NaverImageMapTypeOptions): ImageMapType; + function getTerrainMap(opts?: NaverImageMapTypeOptions): ImageMapType; + function getTrafficLayer(opts?: NaverImageMapTypeOptions): ImageMapType; + function getVectorMap(opts?: NaverImageMapTypeOptions): ImageMapType; + function getWorldMap(opts?: NaverImageMapTypeOptions): ImageMapType; } + // Control - export class CustomControl extends naver.maps.KVO { - constructor(html: string, ControlOptions: naver.maps.ControlOptions); + class CustomControl extends KVO { + constructor(html: string, ControlOptions: ControlOptions); getElement(): HTMLElement; - getMap(): naver.maps.Map | null; + getMap(): Map | null; getOptions(key?: string): any; html(html?: string): string | undefined; - setMap(map?: naver.maps.Map | null): void; - setOptions(newOptions: naver.maps.ControlOptions): void; - setPosition(position: naver.maps.Position): void; + setMap(map?: Map | null): void; + setOptions(newOptions: ControlOptions): void; + setPosition(position: Position): void; } // Naver Controls - export class LogoControl extends naver.maps.CustomControl { - constructor(LogoControlOptions: naver.maps.LogoControlOptions); + class LogoControl extends CustomControl { + constructor(LogoControlOptions: LogoControlOptions); } - export class MapDataControl extends naver.maps.CustomControl { - constructor(MapDataControlOptions); + class MapDataControl extends CustomControl { + constructor(MapDataControlOptions: MapDataControlOptions); } - export class MapTypeControl extends naver.maps.CustomControl { - constructor(MapTypeControlOptions: naver.maps.MapTypeControlOptions); + class MapTypeControl extends CustomControl { + constructor(MapTypeControlOptions: MapTypeControlOptions); } - export class ScaleControl extends naver.maps.CustomControl { - constructor(ScaleControlOptions: naver.maps.ScaleControlOptions); + class ScaleControl extends CustomControl { + constructor(ScaleControlOptions: ScaleControlOptions); } - export class ZoomControl extends naver.maps.CustomControl { - constructor(ZoomControlOptions); + class ZoomControl extends CustomControl { + constructor(ZoomControlOptions: ZoomControlOptions); } // Layer - export class Layer extends naver.maps.KVO { - constructor(name: string, MapTypeRegistry: naver.maps.MapTypeRegistry, options: naver.maps.LayerOptions); - getLayerType(): naver.maps.MapType; + class Layer extends KVO { + constructor(name: string, MapTypeRegistry: MapTypeRegistry, options: LayerOptions); + getLayerType(): MapType; getLayerTypeId(): string; - getMap(): naver.maps.Map | null; + getMap(): Map | null; getOpacity(): number; getPaneElement(): HTMLElement; refresh(noEffect?: boolean): void; setLayerTypeId(typeId: string): void; - setMap(map: naver.maps.Map | null): void; + setMap(map: Map | null): void; setOpacity(opacity: number): void; } // Naver Layers - export class LabelLayer extends naver.maps.Layer { - constructor(name: string, registry: naver.maps.ImageMapType, option: object); + class LabelLayer extends Layer { + constructor(name: string, registry: ImageMapType, option: any); } - export class CadastralLayer extends naver.maps.LabelLayer { + class CadastralLayer extends LabelLayer { name: string; - constructor(option?: naver.maps.CadastralLayerOptions); + constructor(option?: CadastralLayerOptions); } - export class StreetLayer extends naver.maps.LabelLayer { + class StreetLayer extends LabelLayer { name: string; - constructor(option?: naver.maps.StreetLayerOptions); + constructor(option?: StreetLayerOptions); } - export class TrafficLayer extends naver.maps.LabelLayer { + class TrafficLayer extends LabelLayer { name: string; - constructor(option?: naver.maps.TrafficLayerOptions); + constructor(option?: TrafficLayerOptions); endAutoRefresh(): void; startAutoRefresh(): void; } // Data Layer - export class Data extends naver.maps.KVO { + class Data extends KVO { constructor(); - addFeature(feature: naver.maps.Feature, autoStyle: boolean): void; - addGeoJson(geojson: naver.maps.GeoJSON, autoStyle: boolean): void; - addGpx(xmlDoc: naver.maps.GPX, autoStyle: boolean): void; - addKml(xmlDoc: naver.maps.KML, autoStyle: boolean): void; - forEach(callback: (feature: naver.maps.Feature, index: number) => void): void; - getAllFeature(): naver.maps.Feature[]; - getFeatureById(id: string | number): naver.maps.Feature; - getMap(): naver.maps.Map | null; - getStyle(): naver.maps.StyleOptions | naver.maps.StylingFunction; - overrideStyle(feature: naver.maps.Feature, style: naver.maps.StyleOptions): void; - removeFeature(feature: naver.maps.Feature): void; - removeGeoJson(geojson: naver.maps.GeoJSON): void; - revertStyle(feature: naver.maps.Feature): void; - setMap(map: naver.maps.Map | null): void; - setStyle(style: naver.maps.StyleOptions | naver.maps.StylingFunction): void; - toGeoJson(): naver.maps.GeoJSON; + addFeature(feature: Feature, autoStyle: boolean): void; + addGeoJson(geojson: GeoJSON, autoStyle: boolean): void; + addGpx(xmlDoc: GPX, autoStyle: boolean): void; + addKml(xmlDoc: KML, autoStyle: boolean): void; + forEach(callback: (feature: Feature, index: number) => void): void; + getAllFeature(): Feature[]; + getFeatureById(id: string | number): Feature; + getMap(): Map | null; + getStyle(): StyleOptions | StylingFunction; + overrideStyle(feature: Feature, style: StyleOptions): void; + removeFeature(feature: Feature): void; + removeGeoJson(geojson: GeoJSON): void; + revertStyle(feature: Feature): void; + setMap(map: Map | null): void; + setStyle(style: StyleOptions | StylingFunction): void; + toGeoJson(): GeoJSON; } - export class Feature extends naver.maps.KVO { - constructor(rawFeature: object); - forEachOverlay(callback: naver.maps.forEachOverlayCallback): void; - getBounds(): naver.maps.Bounds; - getGeometries(): naver.maps.Geometry[]; + class Feature extends KVO { + constructor(rawFeature: any); + forEachOverlay(callback: forEachOverlayCallback): void; + getBounds(): Bounds; + getGeometries(): Geometry[]; getId(): string; - getOverlays(): naver.maps.Marker[] | naver.maps.Polyline[] | naver.maps.Polygon[]; + getOverlays(): Marker[] | Polyline[] | Polygon[]; getProperty(name: string): any; - getRaw(): naver.maps.GeoJSON; + getRaw(): GeoJSON; setProperty(name: string, value: any): void; - setStyle(styleOptions: naver.maps.StyleOptions); // naver.maps.Data.StyleOptions + setStyle(styleOptions: StyleOptions): void; // Data.StyleOptions } - export class Geometry extends naver.maps.KVO { - constructor(rawGeometry: object); - getCoords(): naver.maps.ArrayOfCoords; + class Geometry extends KVO { + constructor(rawGeometry: any); + getCoords(): ArrayOfCoords; getType(): string; } // Overlay - export abstract class OverlayView extends naver.maps.KVO { + class OverlayView extends KVO { draw(): void; - getContainerTopLeft(): naver.maps.Point; - getMap(): naver.maps.Map | null; - getPanes(): naver.maps.MapPanes; - getProjection(): naver.maps.MapSystemProjection; - abstract onAdd(): any; - abstract onRemove(): any; - setMap(map: naver.maps.Map | null): void; + getContainerTopLeft(): Point; + getMap(): Map | null; + getPanes(): MapPanes; + getProjection(): MapSystemProjection; + onAdd(): any; + onRemove(): any; + setMap(map: Map | null): void; } // Naver Overlays - export abstract class Circle extends naver.maps.OverlayView { - constructor(options?: naver.maps.CircleOptions); + class Circle extends OverlayView { + constructor(options?: CircleOptions); getAreaSize(): number; - getBounds(): naver.maps.Bounds; - getCenter(): naver.maps.Coord; + getBounds(): Bounds; + getCenter(): Coord; getClickable(): boolean; - getDrawingRect(): naver.maps.Bounds; - getOptions(key?: string): naver.maps.CircleOptions | any; + getDrawingRect(): Bounds; + getOptions(key?: string): CircleOptions; getRadius(): number; - getStyles(key: string): naver.maps.CircleOptions | any; + getStyles(key: string): CircleOptions; getVisible(): boolean; getZIndex(): number; - setCenter(center): naver.maps.Coord | naver.maps.CoordLiteral; + setCenter(center: Coord | CoordLiteral): void; setClickable(clickable: boolean): void; setOptions(key: string, value: any): void; - setOptions(options: naver.maps.CircleOptions): void; + setOptions(options: CircleOptions): void; setRadius(radius: number): void; setStyles(key: string, value: string): void; - setStyles(options: naver.maps.CircleOptions): void; + setStyles(options: CircleOptions): void; setVisible(visible: boolean): void; setZIndex(zIndex: number): void; } - export abstract class Ellipse extends naver.maps.OverlayView { - constructor(); + class Ellipse extends OverlayView { + constructor(options?: EllipseOptions); getAreaSize(): number; - getBounds(): naver.maps.Bounds; + getBounds(): Bounds; getClickable(): boolean; - getDrawingRect(): naver.maps.Bounds; - getOptions(key?: string): naver.maps.EllipseOptions | any; - getStyles(key?: string): naver.maps.EllipseOptions | any; + getDrawingRect(): Bounds; + getOptions(key?: string): EllipseOptions; + getStyles(key?: string): EllipseOptions; getVisible(): boolean; getZIndex(): number; - setBounds(bounds: naver.maps.Bounds | naver.maps.BoundsLiteral): void; - setOptions(options: naver.maps.EllipseOptions): void; + setBounds(bounds: Bounds | BoundsLiteral): void; + setOptions(options: EllipseOptions): void; setOptions(key: string, value: any): void; - setStyles(options: naver.maps.EllipseOptions): void; + setStyles(options: EllipseOptions): void; setStyles(key: string, value: any): void; setVisible(visible: boolean): void; setZIndex(zIndex: number): void; } - export abstract class GroundOverlay extends naver.maps.OverlayView { - constructor(url: string, bounds: naver.maps.Bounds | naver.maps.BoundsLiteral, options?: naver.maps.GroundOverlayOptions); - getBounds(): naver.maps.Bounds; + class GroundOverlay extends OverlayView { + constructor(url: string, bounds: Bounds | BoundsLiteral, options?: GroundOverlayOptions); + getBounds(): Bounds; getOpacity(): number; getUrl(): string; setOpacity(opacity: number): void; } - export abstract class InfoWindow extends naver.maps.OverlayView { - constructor(options: naver.maps.InfoWindowOptions); + class InfoWindow extends OverlayView { + constructor(options: InfoWindowOptions); close(): void; getContent(): HTMLElement; - getOptions(key?: string): naver.maps.InfoWindowOptions; - getPosition(): naver.maps.Coord; + getOptions(key?: string): InfoWindowOptions; + getPosition(): Coord; getZIndex(): number; - open(map: naver.maps.Map, anchor: naver.maps.Coord | naver.maps.CoordLiteral | naver.maps.Marker ): void; + open(map: Map, anchor: Coord | CoordLiteral | Marker): void; setContent(content: string | HTMLElement): void; - setOptions(options: naver.maps.InfoWindowOptions): void; - setPosition(position: naver.maps.Coord | naver.maps.CoordLiteral): void; + setOptions(options: InfoWindowOptions): void; + setPosition(position: Coord | CoordLiteral): void; setZIndex(zIndex: number): void; } - export abstract class Marker extends naver.maps.OverlayView { + class Marker extends OverlayView { constructor(options: MarkerOptions); - abstract draw(): void; - getAnimation(): naver.maps.Animation; + draw(): void; + getAnimation(): Animation; getClickable(): boolean; getCursor(): string; getDraggable(): boolean; - getDrawingRect(): naver.maps.Bounds; - getIcon(): naver.maps.ImageIcon | naver.maps.SymbolIcon | naver.maps.HtmlIcon; - getOptions(key?: string): naver.maps.MarkerOptions; - getPosition(): naver.maps.Coord; - getShape(): naver.maps.MarkerShape; + getDrawingRect(): Bounds; + getIcon(): ImageIcon | SymbolIcon | HtmlIcon; + getOptions(key?: string): MarkerOptions; + getPosition(): Coord; + getShape(): MarkerShape; getTitle(): string; getVisible(): boolean; getZIndex(): number; - abstract onAdd(): void; - abstract onRemove(): void; - setAnimation(animation: naver.maps.Animation): void; + onAdd(): void; + onRemove(): void; + setAnimation(animation: Animation): void; setClickable(clickable: boolean): void; setCursor(cursor: string): void; setDraggable(draggable: boolean): void; - setIcon(icon: string | naver.maps.ImageIcon | naver.maps.SymbolIcon | naver.maps.HtmlIcon): void; - setOptions(options: naver.maps.MarkerOptions): void; - setPosition(position: naver.maps.Coord | naver.maps.CoordLiteral): void; - setShape(shape: naver.maps.MarkerShape): void; + setIcon(icon: string | ImageIcon | SymbolIcon | HtmlIcon): void; + setOptions(options: MarkerOptions): void; + setPosition(position: Coord | CoordLiteral): void; + setShape(shape: MarkerShape): void; setTitle(title: string): void; setVisible(visible: boolean): void; setZIndex(zIndex: number): void; } - export abstract class Polygon extends naver.maps.OverlayView { - constructor(options?: naver.maps.PolygonOptions); + class Polygon extends OverlayView { + constructor(options?: PolygonOptions); getAreaSize(): number; - getBounds(): naver.maps.Bounds; + getBounds(): Bounds; getClickable(): boolean; - getDrawingRect(): naver.maps.Bounds; - getOptions(key?: string): naver.maps.PolygonOptions | any; - getPath(): naver.maps.ArrayOfCoords | naver.maps.KVOArrayOfCoords; + getDrawingRect(): Bounds; + getOptions(key?: string): PolygonOptions; + getPath(): ArrayOfCoords | KVOArrayOfCoords; getPaths(): ArrayOfCoords[] | KVOArrayOfCoords[]; - getStyles(key?: string): naver.maps.PolygonOptions | any; + getStyles(key?: string): PolygonOptions; getVisible(): boolean; getZIndex(): number; setClickable(clickable: boolean): void; setOptions(key: string, value: any): void; - setOptions(options: naver.maps.PolygonOptions): void; - setPath(path: naver.maps.ArrayOfCoords | naver.maps.KVOArrayOfCoords | naver.maps.ArrayOfCoordsLiteral): void; - setPaths(paths: naver.maps.ArrayOfCoords[] | naver.maps.ArrayOfCoordsLiteral | any): void; // TODO. KVOArray. + setOptions(options: PolygonOptions): void; + setPath(path: ArrayOfCoords | KVOArrayOfCoords | ArrayOfCoordsLiteral): void; + setPaths(paths: ArrayOfCoords[] | ArrayOfCoordsLiteral): void; // TODO. KVOArray. setStyles(key: string, value: any): void; - setStyles(options: naver.maps.PolygonOptions): void; + setStyles(options: PolygonOptions): void; setVisible(visible: boolean): void; setZIndex(zIndex: number): void; } - export abstract class Polyline extends naver.maps.OverlayView { - constructor(options?: naver.maps.PolylineOptions); - getBounds(): naver.maps.Bounds; + class Polyline extends OverlayView { + constructor(options?: PolylineOptions); + getBounds(): Bounds; getClickable(): boolean; getDistance(): number; - getDrawingRect(): naver.maps.Bounds; - getOptions(key?: string): naver.maps.PolylineOptions | any; - getPath(): naver.maps.ArrayOfCoords | naver.maps.KVOArrayOfCoords; - getStyles(key?: string): naver.maps.PolylineOptions | any; + getDrawingRect(): Bounds; + getOptions(key?: string): PolylineOptions; + getPath(): ArrayOfCoords | KVOArrayOfCoords; + getStyles(key?: string): PolylineOptions; getVisible(): boolean; getZIndex(): number; setClickable(clickable: boolean): void; setOptions(key: string, value: any): void; - setOptions(options: naver.maps.PolylineOptions): void; - setPath(path: naver.maps.ArrayOfCoords | naver.maps.KVOArrayOfCoords | naver.maps.ArrayOfCoordsLiteral): void; + setOptions(options: PolylineOptions): void; + setPath(path: ArrayOfCoords | KVOArrayOfCoords | ArrayOfCoordsLiteral): void; setStyles(key: string, value: any): void; - setStyles(options: naver.maps.PolylineOptions): void; + setStyles(options: PolylineOptions): void; setVisible(visible: boolean): void; setZIndex(zIndex: number): void; } - export abstract class Rectangle extends naver.maps.OverlayView { - constructor(options?: naver.maps.RectangleOptions); + class Rectangle extends OverlayView { + constructor(options?: RectangleOptions); getAreaSize(): number; - getBounds(): naver.maps.Bounds; + getBounds(): Bounds; getClickable(): boolean; - getDrawingRect(): naver.maps.Bounds; - getOptions(key?: string): naver.maps.RectangleOptions | any; - getStyles(key?: string): naver.maps.RectangleOptions | any; + getDrawingRect(): Bounds; + getOptions(key?: string): RectangleOptions; + getStyles(key?: string): RectangleOptions; getVisible(): boolean; getZIndex(): number; - setBounds(bounds: naver.maps.Bounds | naver.maps.BoundsLiteral): void; + setBounds(bounds: Bounds | BoundsLiteral): void; setClickable(clickable: boolean): void; - setOptions(options: naver.maps.RectangleOptions): void; + setOptions(options: RectangleOptions): void; setOptions(key: string, value: any): void; setStyles(key: string, value: any): void; - setStyles(options: naver.maps.RectangleOptions): void; + setStyles(options: RectangleOptions): void; setVisible(visible: boolean): void; setZIndex(zIndex: number): void; } // Sub module: panorama - export class PanoramaProjection extends naver.maps.KVO { - fromCoordToPov(coord: naver.maps.LatLng): naver.maps.PanoramaPov; + class PanoramaProjection extends KVO { + fromCoordToPov(coord: LatLng): PanoramaPov; } - export class Panorama extends naver.maps.KVO { - constructor(panoramaDiv: string | HTMLElement, panoramaOptions: naver.maps.PanoramaOptions); - getLocation(): naver.maps.PanoramaLocation; + class Panorama extends KVO { + constructor(panoramaDiv: string | HTMLElement, panoramaOptions: PanoramaOptions); + getLocation(): PanoramaLocation; getMaxScale(): number; getMaxZoom(): number; getMinScale(): number; getMinZoom(): number; getPanoId(): string; - getPosition(): naver.maps.LatLng; - getPov(): naver.maps.PanoramaPov; - getProjection(): naver.maps.PanoramaProjection; + getPosition(): LatLng; + getPov(): PanoramaPov; + getProjection(): PanoramaProjection; getScale(): number; - getSize(): naver.maps.Size; + getSize(): Size; getVisible(): boolean; getZoom(): number; - setOptions(key: string, value: any); - setOptions(newOptions: naver.maps.PanoramaOptions | object); + setOptions(key: string, value: any): void; + setOptions(newOptions: PanoramaOptions): void; setPanoId(panoId: string): void; - setPanoIdWithPov(panoId: string, pov: naver.maps.PanoramaPov): void; - setPosition(position: naver.maps.LatLng | naver.maps.LatLngLiteral): void; - setPov(pov: naver.maps.PanoramaPov): void; + setPanoIdWithPov(panoId: string, pov: PanoramaPov): void; + setPosition(position: LatLng | LatLngLiteral): void; + setPov(pov: PanoramaPov): void; setScale(scale: number): void; - setSize(size: naver.maps.Size | naver.maps.SizeLiteral): void; + setSize(size: Size | SizeLiteral): void; setVisible(visible: boolean): void; setZoom(zoom: number): void; zoomIn(): void; zoomOut(): void; } - export class FlightSpot extends naver.maps.KVO { + class FlightSpot extends KVO { constructor(); - getMap(): naver.maps.Map | null; - setMap(map: naver.maps.Map | null): void; + getMap(): Map | null; + setMap(map: Map | null): void; } - export class AroundControl extends naver.maps.CustomControl { + class AroundControl extends CustomControl { constructor(aroundControlOptions: AroundControlOptions); } // Sub module: drawing - export module drawing { - export interface DrawingOptions { - map?: naver.maps.Map; - drawingControl?: naver.maps.drawing.DrawingMode[]; - drawingControlOptions?: naver.maps.drawing.drawingControlOptions; - drawingMode?: naver.maps.drawing.DrawingMode; - controlPointOptions?: naver.maps.drawing.controlPointOptions; - rectangleOptions?: naver.maps.RectangleOptions; - ellipseOptions?: naver.maps.EllipseOptions; - polylineOptions?: naver.maps.PolylineOptions; - arrowlineOptions?: naver.maps.PolylineOptions; - polygonOptions?: naver.maps.PolygonOptions; - markerOptions?: naver.maps.MarkerOptions; + namespace drawing { + interface DrawingOptions { + map?: Map; + drawingControl?: DrawingMode[]; + drawingControlOptions?: drawingControlOptions; + drawingMode?: DrawingMode; + controlPointOptions?: controlPointOptions; + rectangleOptions?: RectangleOptions; + ellipseOptions?: EllipseOptions; + polylineOptions?: PolylineOptions; + arrowlineOptions?: PolylineOptions; + polygonOptions?: PolygonOptions; + markerOptions?: MarkerOptions; } type drawingControlOptions = DrawingControlOptions; - export interface DrawingControlOptions { - position?: naver.maps.Position; - style?: naver.maps.drawing.DrawingStyle; + interface DrawingControlOptions { + position?: Position; + style?: DrawingStyle; } type controlPointOptions = ControlPointOptions; - export interface ControlPointOptions { - anchorPointOptions: naver.maps.CircleOptions; - midPointOptions: naver.maps.CircleOptions; + interface ControlPointOptions { + anchorPointOptions: CircleOptions; + midPointOptions: CircleOptions; } - export interface DrawingOverlay { + interface DrawingOverlay { id: string; name: string; - setEditable: (editable: boolean, controlPointOptions?: naver.maps.drawing.controlPointOptions) => void; + setEditable: (editable: boolean, controlPointOptions?: controlPointOptions) => void; } - export enum DrawingStyle { + enum DrawingStyle { HORIZONTAL = 0, VERTICAL, HORIZONTAL_2, VERTICAL_2 } - export enum DrawingMode { + enum DrawingMode { HAND = 0, RECTANGLE, ELLIPSE, @@ -1088,7 +1126,7 @@ declare namespace naver.maps { POLYGON, MARKER } - export enum DrawingEvent { + enum DrawingEvent { ADD, REMOVE, SELECT, @@ -1096,41 +1134,41 @@ declare namespace naver.maps { Removed, Selected } - export class DrawingManager extends naver.maps.KVO { - constructor(options?: naver.maps.drawing.DrawingOptions); - addDrawing(overlay: naver.maps.drawing.DrawingOverlay, drawingMode: naver.maps.drawing.DrawingMode, id?: string): void; - addListener(eventName: naver.maps.drawing.DrawingEvent, - listener: (overlay: naver.maps.drawing.DrawingOverlay) => void): naver.maps.MapEventListener; + class DrawingManager extends KVO { + constructor(options?: DrawingOptions); + addDrawing(overlay: DrawingOverlay, drawingMode: DrawingMode, id?: string): void; + addListener(eventName: DrawingEvent, + listener: (overlay: DrawingOverlay) => void): MapEventListener; destroy(): void; - getDrawing(id: string): naver.maps.drawing.DrawingOverlay; - getDrawings(): object; - getMap(): naver.maps.Map | null; - setMap(map: naver.maps.Map | null): void; - toGeoJson(): object; + getDrawing(id: string): DrawingOverlay; + getDrawings(): any; + getMap(): Map | null; + setMap(map: Map | null): void; + toGeoJson(): any; } } // Sub module: visualization - export module visualization { - export interface DotMapOptions { - map: naver.maps.Map; - data: naver.maps.LatLng[] | naver.maps.PointArrayLiteral[] | naver.maps.visualization.WeightedLocation[]; + namespace visualization { + interface DotMapOptions { + map: Map; + data: LatLng[] | PointArrayLiteral[] | WeightedLocation[]; opacity?: number; radius?: number; strokeWeight?: number; strokeColor?: string; - strokeLineCap?: naver.maps.strokeLineCapType; - strokeLineJoin?: naver.maps.strokeLineJoinType; + strokeLineCap?: strokeLineCapType; + strokeLineJoin?: strokeLineJoinType; fillColor?: string; } - export interface HeatMapOptions { - map: naver.maps.Map; - data: naver.maps.LatLng[] | naver.maps.PointArrayLiteral[] | naver.maps.visualization.WeightedLocation[]; + interface HeatMapOptions { + map: Map; + data: LatLng[] | PointArrayLiteral[] | WeightedLocation[]; opacity?: number; radius?: number; - colorMap?: naver.maps.visualization.SpectrumStyle; + colorMap?: SpectrumStyle; } - export enum SpectrumStyle { + enum SpectrumStyle { JET, HSV, HOT, @@ -1143,35 +1181,35 @@ declare namespace naver.maps { PORTLAND, OXYGEN } - export class DotMap extends naver.maps.KVO { - constructor(dotMapOptions?: naver.maps.visualization.DotMapOptions); - addDrawing(overlay: naver.maps.drawing.DrawingOverlay, drawingMode: naver.maps.drawing.DrawingMode, id?: string): void; - addListener(eventName: naver.maps.drawing.DrawingEvent, - listener: (overlay: naver.maps.drawing.DrawingOverlay) => void): naver.maps.MapEventListener; + class DotMap extends KVO { + constructor(dotMapOptions?: DotMapOptions); + addDrawing(overlay: drawing.DrawingOverlay, drawingMode: drawing.DrawingMode, id?: string): void; + addListener(eventName: drawing.DrawingEvent, + listener: (overlay: drawing.DrawingOverlay) => void): MapEventListener; destroy(): void; - getDrawing(id: string): naver.maps.drawing.DrawingOverlay; - getDrawings(): object; - getMap(): naver.maps.Map | null; - setMap(map: naver.maps.Map | null): void; - toGeoJson(): object; + getDrawing(id: string): drawing.DrawingOverlay; + getDrawings(): any; + getMap(): Map | null; + setMap(map: Map | null): void; + toGeoJson(): any; } - export class HeatMap { - constructor(heatMapOptions?: naver.maps.visualization.HeatMapOptions); - getColorMap(): naver.maps.visualization.SpectrumStyle; - getData(): naver.maps.LatLng[] | naver.maps.PointArrayLiteral[]; - getMap(): naver.maps.Map | null; - getOptions(key?: string): naver.maps.visualization.HeatMapOptions | any; + class HeatMap { + constructor(heatMapOptions?: HeatMapOptions); + getColorMap(): SpectrumStyle; + getData(): LatLng[] | PointArrayLiteral[]; + getMap(): Map | null; + getOptions(key?: string): HeatMapOptions; redraw(): void; - setColorMap(colormap: naver.maps.visualization.SpectrumStyle, inReverse: boolean): void; - setData(data: naver.maps.LatLng[] | naver.maps.PointArrayLiteral[]): void; - setMap(map: naver.maps.Map | null): void; + setColorMap(colormap: SpectrumStyle, inReverse: boolean): void; + setData(data: LatLng[] | PointArrayLiteral[]): void; + setMap(map: Map | null): void; setOptions(key: string, value: any): void; - setOptions(options: naver.maps.visualization.HeatMapOptions): void; + setOptions(options: HeatMapOptions): void; } - export class WeightedLocation { + class WeightedLocation { constructor(lat: number, lng: number, weight?: number); - clone(): naver.maps.visualization.WeightedLocation; - getLocation(): naver.maps.LatLng; + clone(): WeightedLocation; + getLocation(): LatLng; getWeight(): number; lat(): number; lng(): number; @@ -1180,18 +1218,18 @@ declare namespace naver.maps { } // Sub module: geocoder - export module Service { - export interface ServiceOptions { + namespace Service { + interface ServiceOptions { encoding?: any; coordType?: any; } - export interface GeocodeServiceOptions extends ServiceOptions { + interface GeocodeServiceOptions extends ServiceOptions { address?: string; } - export interface ReverseServiceOptions extends ServiceOptions { + interface ReverseServiceOptions extends ServiceOptions { location?: Coord | CoordLiteral; } - export interface AddressItem { + interface AddressItem { address: string; addrdetail: { country: string; @@ -1201,153 +1239,153 @@ declare namespace naver.maps { rest: string; }; } - export interface GeocodeResponse { + interface GeocodeResponse { result: { - userquery: object; + userquery: any; total: number; - items: naver.maps.Service.AddressItem[]; + items: AddressItem[]; }; } - export interface ReverseGeocodeResponse { + interface ReverseGeocodeResponse { result: { userquery: string; total: number; - items: naver.maps.Service.AddressItem[]; + items: AddressItem[]; }; } - export enum CoordType { - LATLNG = 'latlng', - TM128 = 'tm128' + enum CoordType { + LATLNG, + TM128 } - export enum Encoding { - UTF_8 = 'utf-8', - EUC_KR = 'euc-kr' + enum Encoding { + UTF_8, + EUC_KR } - export enum Status { - OK = 200, - ERROR = 500 + enum Status { + OK, + ERROR } - function fromAddrToCoord(); - function fromCoordToAddr(); - function geocode(options: naver.maps.Service.GeocodeServiceOptions, - callback?: (status: naver.maps.Service.Status, response: naver.maps.Service.GeocodeResponse) => void); - function reverseGeocode(options: naver.maps.Service.ReverseServiceOptions, - callback?: (status: naver.maps.Service.Status, response: naver.maps.Service.ReverseGeocodeResponse) => void); + function fromAddrToCoord(): void; + function fromCoordToAddr(): void; + function geocode(options: GeocodeServiceOptions, + callback?: (status: Status, response: GeocodeResponse) => void): void; + function reverseGeocode(options: ReverseServiceOptions, + callback?: (status: Status, response: ReverseGeocodeResponse) => void): void; } - export module TransCoord { - function fromEPSG3857ToLatLng(coord: naver.maps.Point): naver.maps.LatLng; - function fromEPSG3857ToNaver(coord: naver.maps.Point): naver.maps.Point; - function fromEPSG3857ToTM128(coord: naver.maps.Point): naver.maps.Point; - function fromEPSG3857ToUTMK(coord: naver.maps.Point): naver.maps.Point; - function fromLatLngToEPSG3857(latlng: naver.maps.Coord): naver.maps.Point; - function fromLatLngToNaver(latlng: naver.maps.Coord): naver.maps.Point; - function fromLatLngToTM128(latlng: naver.maps.Coord): naver.maps.Point; - function fromLatLngToUTMK(latlng: naver.maps.Coord): naver.maps.Point; - function fromNaverToEPSG3857(n: naver.maps.Point): naver.maps.Point; - function fromNaverToLatLng(n: naver.maps.Point): naver.maps.LatLng; - function fromNaverToTM128(n: naver.maps.Point): naver.maps.Point; - function fromNaverToUTMK(n: naver.maps.Point): naver.maps.Point; - function fromTM128ToEPSG3857(tm128: naver.maps.Point): naver.maps.Point; - function fromTM128ToLatLng(tm128: naver.maps.Point): naver.maps.LatLng; - function fromTM128ToNaver(tm128: naver.maps.Point): naver.maps.Point; - function fromTM128ToUTMK(tm128: naver.maps.Point): naver.maps.Point; - function fromUTMKToEPSG3857(utmk: naver.maps.Point): naver.maps.Point; - function fromUTMKToLatLng(utmk: naver.maps.Point): naver.maps.LatLng; - function fromUTMKToNaver(utmk: naver.maps.Point): naver.maps.Point; - function fromUTMKToTM128(utmk: naver.maps.Point): naver.maps.Point; + namespace TransCoord { + function fromEPSG3857ToLatLng(coord: Point): LatLng; + function fromEPSG3857ToNaver(coord: Point): Point; + function fromEPSG3857ToTM128(coord: Point): Point; + function fromEPSG3857ToUTMK(coord: Point): Point; + function fromLatLngToEPSG3857(latlng: Coord): Point; + function fromLatLngToNaver(latlng: Coord): Point; + function fromLatLngToTM128(latlng: Coord): Point; + function fromLatLngToUTMK(latlng: Coord): Point; + function fromNaverToEPSG3857(n: Point): Point; + function fromNaverToLatLng(n: Point): LatLng; + function fromNaverToTM128(n: Point): Point; + function fromNaverToUTMK(n: Point): Point; + function fromTM128ToEPSG3857(tm128: Point): Point; + function fromTM128ToLatLng(tm128: Point): LatLng; + function fromTM128ToNaver(tm128: Point): Point; + function fromTM128ToUTMK(tm128: Point): Point; + function fromUTMKToEPSG3857(utmk: Point): Point; + function fromUTMKToLatLng(utmk: Point): LatLng; + function fromUTMKToNaver(utmk: Point): Point; + function fromUTMKToTM128(utmk: Point): Point; } - export module Event { - function addDOMListener(element: HTMLElement, eventName: string, listener: Function): void; - function addListener(target: object, eventName: string, listener: Function): naver.maps.MapEventListener; - function clearInstanceListeners(target: object): void; - function clearListeners(target: object, fromEventName: string): void; - function forward(source: object, fromEventName: string, target: object, toEventName: string): naver.maps.MapEventListener; - function hasListener(target: object, eventName: string): boolean; - function once(target: object, eventName: string, listener: Function): naver.maps.MapEventListener; - function removeDOMListener(element: HTMLElement, eventName: string, listener: Function): void; - function removeDOMListener(listeners: naver.maps.DOMEventListener | naver.maps.DOMEventListener[]): void; - function removeListener(listeners: naver.maps.MapEventListener | naver.maps.MapEventListener[]): void; - function resumeDispatch(target: object, eventName: string): void; - function stopDispatch(target: object, eventName: string): void; - function trigger(target: object, eventName: string, eventObject?: any): void; + namespace Event { + function addDOMListener(element: HTMLElement, eventName: string, listener: () => any): void; + function addListener(target: any, eventName: string, listener: () => any): MapEventListener; + function clearInstanceListeners(target: any): void; + function clearListeners(target: any, fromEventName: string): void; + function forward(source: any, fromEventName: string, target: any, toEventName: string): MapEventListener; + function hasListener(target: any, eventName: string): boolean; + function once(target: any, eventName: string, listener: () => any): MapEventListener; + function removeDOMListener(element: HTMLElement, eventName: string, listener: () => any): void; + function removeDOMListener(listeners: DOMEventListener | DOMEventListener[]): void; + function removeListener(listeners: MapEventListener | MapEventListener[]): void; + function resumeDispatch(target: any, eventName: string): void; + function stopDispatch(target: any, eventName: string): void; + function trigger(target: any, eventName: string, eventObject?: any): void; } // Projection - export module EPSG3857 { // implements naver.maps.Projection - function fromCoordToPoint(coord: naver.maps.Coord): naver.maps.Point; - function fromLatLngToPoint(latlng: naver.maps.LatLng): naver.maps.Point; - function fromPointToCoord(point: naver.maps.Point): naver.maps.LatLng; - function fromPointToLatLng(point: naver.maps.Point): naver.maps.LatLng; - function getDestinationCoord(fromLatLng: naver.maps.LatLng, angle: number, meter: number): naver.maps.LatLng; - function getDistance(latlng1: naver.maps.LatLng, latlng2: naver.maps.LatLng): number; + namespace EPSG3857 { // implements Projection + function fromCoordToPoint(coord: Coord): Point; + function fromLatLngToPoint(latlng: LatLng): Point; + function fromPointToCoord(point: Point): LatLng; + function fromPointToLatLng(point: Point): LatLng; + function getDestinationCoord(fromLatLng: LatLng, angle: number, meter: number): LatLng; + function getDistance(latlng1: LatLng, latlng2: LatLng): number; } - export class UTMK { - name: string; - pointPerMeter: number; - static fromCoordToPoint(latlng: naver.maps.LatLng): naver.maps.Point; - static fromCoordToUTMK(latlng: naver.maps.LatLng): naver.maps.Point; - static fromLatLngToPoint(latlng: naver.maps.LatLng): naver.maps.Point; - static fromLatLngToUTMK(latlng: naver.maps.LatLng): naver.maps.Point; - static fromPointToCoord(point: naver.maps.Point): naver.maps.LatLng; - static fromPointToLatLng(point: naver.maps.Point): naver.maps.LatLng; - static fromPointToUTMK(point: naver.maps.Point): naver.maps.Point; - static fromUTMKToCoord(utmk: naver.maps.Point): naver.maps.LatLng; - static fromUTMKToLatLng(utmk: naver.maps.Point): naver.maps.LatLng; - static fromUTMKToPoint(utmk: naver.maps.Point): naver.maps.Point; - static getDestinationCoord(fromLatLng: naver.maps.LatLng, angle: number, meter: number): naver.maps.LatLng; - static getDistance(latlng1: naver.maps.LatLng, latlng2: naver.maps.LatLng): number; + namespace UTMK { + let name: string; + let pointPerMeter: number; + function fromCoordToPoint(latlng: LatLng): Point; + function fromCoordToUTMK(latlng: LatLng): Point; + function fromLatLngToPoint(latlng: LatLng): Point; + function fromLatLngToUTMK(latlng: LatLng): Point; + function fromPointToCoord(point: Point): LatLng; + function fromPointToLatLng(point: Point): LatLng; + function fromPointToUTMK(point: Point): Point; + function fromUTMKToCoord(utmk: Point): LatLng; + function fromUTMKToLatLng(utmk: Point): LatLng; + function fromUTMKToPoint(utmk: Point): Point; + function getDestinationCoord(fromLatLng: LatLng, angle: number, meter: number): LatLng; + function getDistance(latlng1: LatLng, latlng2: LatLng): number; } - export class UTMK_NAVER { // extends naver.maps.UTMK - name: string; - pointPerMeter: number; - static fromCoordToNaver(latlng: naver.maps.LatLng): naver.maps.Point; - static fromLatLngToNaver(latlng: naver.maps.LatLng): naver.maps.Point; - static fromNaverToCoord(naverPoint: naver.maps.Point): naver.maps.LatLng; - static fromNaverToLatLng(naverPoint: naver.maps.Point): naver.maps.LatLng; - static fromNaverToPoint(naverPoint: naver.maps.Point): naver.maps.Point; - static fromNaverToUTMK(naverPoint: naver.maps.Point): naver.maps.Point; - static fromPointToNaver(point: naver.maps.Point): naver.maps.Point; - static fromUTMKToNaver(utmk: naver.maps.Point): naver.maps.Point; + namespace UTMK_NAVER { // extends UTMK + let name: string; + let pointPerMeter: number; + function fromCoordToNaver(latlng: LatLng): Point; + function fromLatLngToNaver(latlng: LatLng): Point; + function fromNaverToCoord(naverPoint: Point): LatLng; + function fromNaverToLatLng(naverPoint: Point): LatLng; + function fromNaverToPoint(naverPoint: Point): Point; + function fromNaverToUTMK(naverPoint: Point): Point; + function fromPointToNaver(point: Point): Point; + function fromUTMKToNaver(utmk: Point): Point; } - export class EPSG3857Coord { - static fromCoordToLatLng(coord: naver.maps.Point): naver.maps.LatLng; - static fromCoordToPoint(coord: naver.maps.Point): naver.maps.Point; - static fromEPSG3857ToLatLng(coord: naver.maps.Point): naver.maps.LatLng; - static fromEPSG3857ToPoint(coord: naver.maps.Point): naver.maps.Point; - static fromLatLngToCoord(coord: naver.maps.Coord): naver.maps.Point; - static fromLatLngToEPSG3857(coord: naver.maps.Coord): naver.maps.Point; - static fromPointToCoord(point: naver.maps.Point): naver.maps.Point; - static fromPointToEPSG3857(point: naver.maps.Point): naver.maps.Point; + namespace EPSG3857Coord { + function fromCoordToLatLng(coord: Point): LatLng; + function fromCoordToPoint(coord: Point): Point; + function fromEPSG3857ToLatLng(coord: Point): LatLng; + function fromEPSG3857ToPoint(coord: Point): Point; + function fromLatLngToCoord(coord: Coord): Point; + function fromLatLngToEPSG3857(coord: Coord): Point; + function fromPointToCoord(point: Point): Point; + function fromPointToEPSG3857(point: Point): Point; } - export class TM128 { // extends naver.maps.TM128Coord - static fromCoordToPoint(latlng: naver.maps.Coord): naver.maps.Point; - static fromPointToCoord(point: naver.maps.Point): naver.maps.LatLng; + namespace TM128 { // extends TM128Coord + function fromCoordToPoint(latlng: Coord): Point; + function fromPointToCoord(point: Point): LatLng; } - export class TM128Coord { // extends naver.maps.UTMK - static fromCoordToLatLng(tm128: naver.maps.Point): naver.maps.LatLng; - static fromCoordToPoint(tm128: naver.maps.Point): naver.maps.Point; - static fromLatLngToCoord(latlng: naver.maps.Coord): naver.maps.Point; - static fromLatLngToTM128(latlng: naver.maps.Coord): naver.maps.Point; - static fromPointToCoord(point: naver.maps.Point): naver.maps.Point; - static fromPointToTM128(point: naver.maps.Point): naver.maps.Point; - static fromTM128ToLatLng(tm128: naver.maps.Point): naver.maps.LatLng; - static fromTM128ToPoint(tm128: naver.maps.Point): naver.maps.Point; - static fromTM128ToUTMK(tm128: naver.maps.Point): naver.maps.Point; - static fromUTMKToTM128(utmk: naver.maps.Point): naver.maps.Point; + namespace TM128Coord { // extends UTMK + function fromCoordToLatLng(tm128: Point): LatLng; + function fromCoordToPoint(tm128: Point): Point; + function fromLatLngToCoord(latlng: Coord): Point; + function fromLatLngToTM128(latlng: Coord): Point; + function fromPointToCoord(point: Point): Point; + function fromPointToTM128(point: Point): Point; + function fromTM128ToLatLng(tm128: Point): LatLng; + function fromTM128ToPoint(tm128: Point): Point; + function fromTM128ToUTMK(tm128: Point): Point; + function fromUTMKToTM128(utmk: Point): Point; } - export class UTMK_NAVERCoord { // extends naver.maps.UTMK_NAVER - static fromCoordToLatLng(n: naver.maps.Point): naver.maps.LatLng; - static fromCoordToPoint(n: naver.maps.Point): naver.maps.Point; - static fromLatLngToCoord(latlng: naver.maps.Coord): naver.maps.Point; - static fromPointToCoord(point: naver.maps.Point): naver.maps.Point; + namespace UTMK_NAVERCoord { // extends UTMK_NAVER + function fromCoordToLatLng(n: Point): LatLng; + function fromCoordToPoint(n: Point): Point; + function fromLatLngToCoord(latlng: Coord): Point; + function fromPointToCoord(point: Point): Point; } - export class UTMKCoord { // extends naver.maps.UTMK - static fromCoordToLatLng(utmk: naver.maps.Point): naver.maps.LatLng; - static fromCoordToPoint(utmk: naver.maps.Point): naver.maps.Point; - static fromLatLngToCoord(latlng: naver.maps.Coord): naver.maps.Point; - static fromPointToCoord(point: naver.maps.Point): naver.maps.Point; + namespace UTMKCoord { // extends UTMK + function fromCoordToLatLng(utmk: Point): LatLng; + function fromCoordToPoint(utmk: Point): Point; + function fromLatLngToCoord(latlng: Coord): Point; + function fromPointToCoord(point: Point): Point; } } diff --git a/types/navermaps/navermaps-tests.ts b/types/navermaps/navermaps-tests.ts index a3e84e94a2..81bbe620f5 100644 --- a/types/navermaps/navermaps-tests.ts +++ b/types/navermaps/navermaps-tests.ts @@ -1,13 +1,12 @@ -var map = new naver.maps.Map('map'); +let map = new naver.maps.Map('map'); map.setMapTypeId(naver.maps.MapTypeId.HYBRID); - -var jeju = new naver.maps.LatLng(33.3590628, 126.534361); +const jeju = new naver.maps.LatLng(33.3590628, 126.534361); map.setCenter(jeju); // 중심 좌표 이동 map.setZoom(13); // 줌 레벨 변경 -var seoul = new naver.maps.LatLngBounds( +const seoul = new naver.maps.LatLngBounds( new naver.maps.LatLng(37.42829747263545, 126.76620435615891), new naver.maps.LatLng(37.7010174173061, 127.18379493229875)); @@ -15,13 +14,13 @@ map.fitBounds(seoul); // 좌표 경계 이동 map.panBy(new naver.maps.Point(10, 10)); // 우측 하단으로 10 픽셀 이동 -var map = new naver.maps.Map('map', { +map = new naver.maps.Map('map', { mapTypeId: naver.maps.MapTypeId.HYBRID }); -var registry = new naver.maps.MapTypeRegistry(); +const registry = new naver.maps.MapTypeRegistry(); -var map = new naver.maps.Map('map', { +map = new naver.maps.Map('map', { mapTypes: registry, mapTypeId: naver.maps.MapTypeId.SATELLITE }); @@ -31,118 +30,122 @@ map.mapTypes.set(naver.maps.MapTypeId.HYBRID, naver.maps.NaverMapTypeOption.getH map.setMapTypeId(naver.maps.MapTypeId.NORMAL); // error thrown -var MyMapType = { - name: "Alphabet", +const GTA5MapTypeOption1 = { minZoom: 0, maxZoom: 22, projection: naver.maps.EPSG3857, - tileSize: new naver.maps.Size(50, 50), - getTile: function(x, y, z) { - var w = this.tileSize.width, - h = this.tileSize.height; - - var ascii = parseInt(Math.abs(x + y) % 26, 10) + 65; - alphabet = String.fromCharCode(ascii); - var tile = document.createElement('div'); - - tile.style.width = w +'px'; - tile.style.height = w +'px'; - - return tile; - } -}; - -var map = new naver.maps.Map('map', { - center: new naver.maps.LatLng(37.3595704, 127.105399), - zoom: 10, - mapTypeId: 'mine', - mapTypes: new naver.maps.MapTypeRegistry({ - 'mine': MyMapType - }), - mapTypeControl: true, - mapTypeControlOptions: { - style: naver.maps.MapTypeControlStyle.DROPDOWN - } -}); - -var GTA5MapTypeOption = function(name, type) { - this.name = name; - this.type = type; -}; -GTA5MapTypeOption.prototype = { - constructor: GTA5MapTypeOption, - - name: '', - type: '', - projection: naver.maps.EPSG3857, - minZoom: 1, - maxZoom: 6, + name: '세계 지도', tileSize: new naver.maps.Size(256, 256), - TRANSPARENT_URL: 'http://static.naver.net/maps/dot.gif', - tileRanges: [1, 2, 4, 8, 16, 32], - - getName: function() { - return this.name; - }, - - getTileUrl: function(x, y, z) { - var tileRange = this.tileRanges[z - 1]; - - if ((x >=0 && x < tileRange) && (y >=0 && y < tileRange)) { - return "http://gta-5-map.com/" +this.type+'/'+z+'-'+x+'_'+y+".png"; - } else { - return this.TRANSPARENT_URL; - } - }, - - onerror: function(tileImg) { - tileImg.src = this.TRANSPARENT_URL; - } + repeatX: true, + vendor: 'MyCorp.', + provider: [{ + title: "내 지도 ver 1.0" + }, { + title: "OpenStreetMap", + link: "http://www.openstreetmap.org/copyright" + }, { + title: "/인천광역시", + bounds: new naver.maps.LatLngBounds( + new naver.maps.LatLng(36.915887, 125.690716), + new naver.maps.LatLng(37.687529, 126.853252)) + }], + tileSet: [ + "http://mymap1.com/tiles/world/{z}/{x}/{y}.png", + "http://mymap2.com/tiles/world/{z}/{x}/{y}.png", + "http://mymap3.com/tiles/world/{z}/{x}/{y}.png", + "http://mymap4.com/tiles/world/{z}/{x}/{y}.png" + ] }; -var map = new naver.maps.Map('map', { +map = new naver.maps.Map('map', { center: new naver.maps.LatLng(74.92514151088395, -127.880859375), zoom: 2, mapTypes: new naver.maps.MapTypeRegistry({ - "Atlas": new naver.maps.ImageMapType(new GTA5MapTypeOption("Atlas", "Tiles_ATLAS")), - "Satellite": new naver.maps.ImageMapType(new GTA5MapTypeOption("Satellite", "Tiles_SAT")), + Atlas: new naver.maps.ImageMapType(GTA5MapTypeOption1) }) }); map.setMapTypeId("Atlas"); -var MyMapType = { - name: "Alphabet", - minZoom: 0, - maxZoom: 22, - tileSize: new naver.maps.Size(50, 50), - getTileData: function(x, y, z) { - var w = this.tileSize.width, - h = this.tileSize.height, - canvas = document.createElement("canvas"), - ctx = canvas.getContext("2d"); +const map2 = new naver.maps.Map('map', { + center: new naver.maps.LatLng(37.3595704, 127.105399), + zoom: 10 +}); - var ascii = parseInt(Math.abs(x + y) % 26, 10) + 65; - alphabet = String.fromCharCode(ascii); +const marker = new naver.maps.Marker({ + position: new naver.maps.LatLng(37.3595704, 127.105399), + map: map2 +}); - canvas.width = w; - canvas.height = h; +const HOME_PATH = ''; - ctx.globalAlpha = 1 - ((ascii - 65) * 0.04); +const cityhall = new naver.maps.LatLng(37.5666805, 126.9784147); +const map3 = new naver.maps.Map('map', { + center: cityhall.destinationPoint(0, 500), + zoom: 10 +}); +const marker2 = new naver.maps.Marker({ + map: map3, + position: cityhall +}); - ctx.rect(0, 0, w, h); - ctx.fillStyle = "#000"; - ctx.fill(); - ctx.lineWidth = 1; - ctx.strokeStyle = "#aaa"; - ctx.stroke(); +const contentString = [ + `

    ` + ].join(''); - ctx.font = "bold " + (Math.min(w, h) - 10) + "px Arial"; - ctx.textBaseline = "middle"; - ctx.textAlign = "center"; - ctx.fillStyle = "#fff"; - ctx.fillText(alphabet, w / 2, h / 2); +const infowindow = new naver.maps.InfoWindow({ + content: contentString +}); - return ctx.getImageData(0, 0, w, h); +naver.maps.Event.addListener(marker2, "click", () => { + if (infowindow.getMap()) { + infowindow.close(); + } else { + infowindow.open(map3, marker2); } -}; +}); + +infowindow.open(map3, marker2); + +const GREEN_FACTORY = new naver.maps.LatLng(37.3595953, 127.1053971); + +const map4 = new naver.maps.Map('map', { + center: GREEN_FACTORY, + zoom: 3 +}); + +const rectangle = new naver.maps.Rectangle({ + map: map4, + bounds: new naver.maps.LatLngBounds( + new naver.maps.LatLng(37.1793196, 125.8795594), + new naver.maps.LatLng(37.5398662, 126.3312422) + ) +}); + +const circle = new naver.maps.Circle({ + map: map4, + center: GREEN_FACTORY, + radius: 20000, + fillColor: 'crimson', + fillOpacity: 0.8 +}); + +const ellipse = new naver.maps.Ellipse({ + map: map4, + bounds: new naver.maps.LatLngBounds( + new naver.maps.LatLng(37.1793196, 127.6795594), + new naver.maps.LatLng(37.5398662, 128.4312422) + ), + strokeColor: 'yellowgreen', + strokeOpacity: 1, + strokeWeight: 3, + fillColor: 'yellowgreen', + fillOpacity: 0.3 +}); From ad2322608dababe5b16451b7712fd7bb975aac48 Mon Sep 17 00:00:00 2001 From: Kyle Roach Date: Sat, 24 Mar 2018 08:15:07 -0400 Subject: [PATCH 0201/2153] Add onSearchCloseRequested prop to react-native-material-ui --- types/react-native-material-ui/index.d.ts | 1 + .../react-native-material-ui-tests.tsx | 27 ++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/types/react-native-material-ui/index.d.ts b/types/react-native-material-ui/index.d.ts index e643b4198f..89b01d13bc 100644 --- a/types/react-native-material-ui/index.d.ts +++ b/types/react-native-material-ui/index.d.ts @@ -426,6 +426,7 @@ export interface Searchable { onSearchClosed?(): void; onSearchPressed?(): void; onSubmitEditing?(): void; + onSearchCloseRequested?(): void; } export interface ToolBarRightElement { diff --git a/types/react-native-material-ui/react-native-material-ui-tests.tsx b/types/react-native-material-ui/react-native-material-ui-tests.tsx index b4380fc388..5aed665ec4 100644 --- a/types/react-native-material-ui/react-native-material-ui-tests.tsx +++ b/types/react-native-material-ui/react-native-material-ui-tests.tsx @@ -11,7 +11,8 @@ import { Checkbox, Dialog, DialogDefaultActions, - BottomNavigation + BottomNavigation, + Toolbar } from 'react-native-material-ui'; const theme = { @@ -113,3 +114,27 @@ class BottomNavigationExample extends React.Component { ); } } + +class ToolbarExample extends React.Component<{}, {search: string}> { + state = { + search: '' + }; + + handleResults(search: string) { + this.setState({ search }); + } + + render() { + return ( + this.handleResults(text), + onSearchCloseRequested: () => this.handleResults(''), + }} + /> + ); + } +} From 08a358732a872a66d9c3404ce66959e791f7b302 Mon Sep 17 00:00:00 2001 From: Jan Vennemann Date: Tue, 13 Mar 2018 19:00:44 -0300 Subject: [PATCH 0202/2153] Update Titanium Mobile types to 7.1.0 --- types/titanium/index.d.ts | 71586 ++++++++++++++++++++++++++--- types/titanium/titanium-tests.ts | 61 +- types/titanium/tsconfig.json | 4 +- types/titanium/tslint.json | 70 +- 4 files changed, 64710 insertions(+), 7011 deletions(-) diff --git a/types/titanium/index.d.ts b/types/titanium/index.d.ts index 3cacf3c29e..b191fd2766 100644 --- a/types/titanium/index.d.ts +++ b/types/titanium/index.d.ts @@ -1,7001 +1,64767 @@ -// Type definitions for Titanium Mobile 3.5.0 -// Project: http://www.appcelerator.com/ -// Definitions by: Craig Younkins +// Type definitions for Titanium 7.1 +// Project: https://github.com/appcelerator/titanium_mobile +// Definitions by: Axway Appcelerator +// Jan Vennemann // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 -declare namespace Ti { - export var apiName : string; - export var bubbleParent : boolean; - export var buildDate : string; - export var buildHash : string; - export var userAgent : string; - export var version : string; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createBuffer (params: CreateBufferArgs) : Ti.Buffer; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function getBuildDate () : string; - export function getBuildHash () : string; - export function getUserAgent () : string; - export function getVersion () : string; - export function include (name: string) : void; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setUserAgent (userAgent: string) : void; - export module XML { - export var apiName : string; - export var bubbleParent : boolean; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function parseString (xml: string) : Ti.XML.Document; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function serializeToString (node: Ti.XML.Node) : string; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface Entity extends Ti.XML.Node { - notationName : string; - publicId : string; - systemId : string; - getNotationName () : string; - getPublicId () : string; - getSystemId () : string; - } - export interface Node extends Ti.Proxy { - ATTRIBUTE_NODE : number; - CDATA_SECTION_NODE : number; - COMMENT_NODE : number; - DOCUMENT_FRAGMENT_NODE : number; - DOCUMENT_NODE : number; - DOCUMENT_TYPE_NODE : number; - ELEMENT_NODE : number; - ENTITY_NODE : number; - ENTITY_REFERENCE_NODE : number; - NOTATION_NODE : number; - PROCESSING_INSTRUCTION_NODE : number; - TEXT_NODE : number; - attributes : Ti.XML.NamedNodeMap; - childNodes : Ti.XML.NodeList; - firstChild : Ti.XML.Node; - lastChild : Ti.XML.Node; - localName : string; - namespaceURI : string; - nextSibling : Ti.XML.Node; - nodeName : string; - nodeType : number; - nodeValue : string; - ownerDocument : Ti.XML.Document; - parentNode : Ti.XML.Node; - prefix : string; - previousSibling : Ti.XML.Node; - text : string; - textContent : string; - appendChild (newChild: Ti.XML.Node) : Ti.XML.Node; - cloneNode (deep: boolean) : Ti.XML.Node; - getAttributes () : Ti.XML.NamedNodeMap; - getChildNodes () : Ti.XML.NodeList; - getFirstChild () : Ti.XML.Node; - getLastChild () : Ti.XML.Node; - getLocalName () : string; - getNamespaceURI () : string; - getNextSibling () : Ti.XML.Node; - getNodeName () : string; - getNodeType () : number; - getNodeValue () : string; - getOwnerDocument () : Ti.XML.Document; - getParentNode () : Ti.XML.Node; - getPrefix () : string; - getPreviousSibling () : Ti.XML.Node; - getText () : string; - getTextContent () : string; - hasAttributes () : boolean; - hasChildNodes () : boolean; - insertBefore (newChild: Ti.XML.Node, refChild: Ti.XML.Node) : Ti.XML.Node; - isSupported (feature: string, version: string) : boolean; - normalize () : void; - removeChild (oldChild: Ti.XML.Node) : Ti.XML.Node; - replaceChild (newChild: Ti.XML.Node, oldChild: Ti.XML.Node) : Ti.XML.Node; - setLocalName (localName: string) : void; - setNodeValue (nodeValue: string) : void; - setPrefix (prefix: string) : void; - } - export enum EntityReference { +declare const Ti: typeof Titanium; - } - export interface CharacterData extends Ti.XML.Node { - data : string; - length : number; - appendData (arg: string) : void; - deleteData (offset: number, count: number) : void; - getData () : string; - getLength () : number; - insertData (offset: number, arg: string) : void; - replaceData (offset: number, count: number, arg: string) : void; - setData (data: string) : void; - substringData (offset: number, count: number) : string; - } - export interface DOMImplementation extends Ti.Proxy { - createDocument (namespaceURI: string, qualifiedName: string, doctype: Ti.XML.DocumentType) : Ti.XML.Document; - createDocumentType (qualifiedName: string, publicId: string, systemId: string) : Ti.XML.DocumentType; - hasFeature (feature: string, version: string) : boolean; - } - export interface Document extends Ti.XML.Node { - doctype : Ti.XML.DocumentType; - documentElement : Ti.XML.Element; - implementation : Ti.XML.DOMImplementation; - createAttribute (name: string) : Ti.XML.Attr; - createAttributeNS (namespaceURI: string, name: string) : Ti.XML.Attr; - createCDATASection (data: string) : Ti.XML.CDATASection; - createComment (data: string) : Ti.XML.Comment; - createDocumentFragment () : Ti.XML.DocumentFragment; - createElement (tagName: string) : Ti.XML.Element; - createElementNS (namespaceURI: string, name: string) : Ti.XML.Element; - createEntityReference (name: string) : Ti.XML.EntityReference; - createProcessingInstruction (target: string, data: string) : Ti.XML.ProcessingInstruction; - createTextNode (data: string) : Ti.XML.Text; - getDoctype () : Ti.XML.DocumentType; - getDocumentElement () : Ti.XML.Element; - getElementById (elementId: string) : Ti.XML.Element; - getElementsByTagName (tagname: string) : Ti.XML.NodeList; - getElementsByTagNameNS (namespaceURI: string, localname: string) : Ti.XML.NodeList; - getImplementation () : Ti.XML.DOMImplementation; - importNode (importedNode: Ti.XML.Node, deep: boolean) : Ti.XML.Node; - } - export interface Attr extends Ti.XML.Node { - name : string; - ownerElement : Ti.XML.Element; - specified : boolean; - value : string; - getName () : string; - getOwnerElement () : Ti.XML.Element; - getSpecified () : boolean; - getValue () : string; - setValue (value: string) : void; - } - export interface ProcessingInstruction extends Ti.Proxy { - data : string; - target : string; - getData () : string; - getTarget () : string; - setData (data: string) : void; - } - export interface NamedNodeMap extends Ti.Proxy { - length : number; - getLength () : number; - getNamedItem (name: string) : Ti.XML.Node; - getNamedItemNS (namespaceURI: string, localName: string) : Ti.XML.Node; - item (index: number) : Ti.XML.Node; - removeNamedItem (name: string) : Ti.XML.Node; - removeNamedItemNS (namespaceURI: string, localName: string) : Ti.XML.Node; - setNamedItem (node: Ti.XML.Node) : Ti.XML.Node; - setNamedItemNS (node: Ti.XML.Node) : Ti.XML.Node; - } - export enum CDATASection { +/** + * The top-level Titanium module. + */ +declare namespace Titanium { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; - } - export interface Text extends Ti.XML.CharacterData { - splitText (offset: number) : Ti.XML.Text; - } - export enum Comment { + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; - } - export enum DocumentFragment { + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; - } - export interface Notation extends Ti.Proxy { - publicId : string; - systemId : string; - getPublicId () : string; - getSystemId () : string; - } - export interface NodeList extends Ti.Proxy { - length : number; - getLength () : number; - item (index: number) : Ti.XML.Node; - } - export interface DocumentType extends Ti.XML.Node { - entities : Ti.XML.NamedNodeMap; - internalSubset : string; - name : string; - notations : Ti.XML.NamedNodeMap; - publicId : string; - systemId : string; - getEntities () : Ti.XML.NamedNodeMap; - getInternalSubset () : string; - getName () : string; - getNotations () : Ti.XML.NamedNodeMap; - getPublicId () : string; - getSystemId () : string; - } - export interface Element extends Ti.XML.Node { - tagName : string; - getAttribute (name: string) : string; - getAttributeNS (namespaceURI: string, localName: string) : string; - getAttributeNode (name: string) : Ti.XML.Attr; - getAttributeNodeNS (namespaceURI: string, localName: string) : Ti.XML.Attr; - getElementsByTagName (name: string) : Ti.XML.NodeList; - getElementsByTagNameNS (namespaceURI: string, localName: string) : Ti.XML.NodeList; - getTagName () : string; - hasAttribute (name: string) : boolean; - hasAttributeNS (namespaceURI: string, localName: string) : boolean; - removeAttribute (name: string) : void; - removeAttributeNS (namespaceURI: string, localName: string) : void; - removeAttributeNode (oldAttr: Ti.XML.Attr) : void; - setAttribute (name: string, value: string) : void; - setAttributeNS (namespaceURI: string, qualifiedName: string, value: string) : void; - setAttributeNode (newAttr: Ti.XML.Attr) : Ti.XML.Attr; - setAttributeNodeNS (newAttr: Ti.XML.Attr) : Ti.XML.Attr; - } - } - export enum BlobStream { + /** + * User-agent string used by Titanium. + */ + let userAgent: string; + + /** + * Version of Titanium that is executing. + */ + const version: string; + + /** + * Date of the Titanium build. + */ + const buildDate: string; + + /** + * Git hash of the Titanium build. + */ + const buildHash: string; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Creates a new buffer based on the params. + */ + function createBuffer(params: CreateBufferArgs): Titanium.Buffer; + + /** + * Creates and returns an instance of . + */ + function createProxy(parameters?: any): Titanium.Proxy; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getUserAgent(): string; + + /** + * Sets the value of the property. + */ + function setUserAgent(userAgent: string): void; + + /** + * Gets the value of the property. + */ + function getVersion(): string; + + /** + * Gets the value of the property. + */ + function getBuildDate(): string; + + /** + * Gets the value of the property. + */ + function getBuildHash(): string; + + /** + * The base for all Titanium objects. + */ + interface Proxy { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + readonly apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + lifecycleContainer?: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Adds the specified callback as an event listener for the named event. + */ + addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + getApiName(): string; + + /** + * Gets the value of the property. + */ + getLifecycleContainer?(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + setLifecycleContainer?(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + setLifecycleContainer?(lifecycleContainer: Titanium.UI.TabGroup): void; } - export interface IOStream extends Ti.Proxy { - close () : void; - isReadable () : boolean; - isWriteable () : boolean; - read (buffer: Ti.Buffer, offset?: number, length?: number) : number; - write (buffer: Ti.Buffer, offset?: number, length?: number) : number; - } - export module UI { - export var ANIMATION_CURVE_EASE_IN : number; - export var ANIMATION_CURVE_EASE_IN_OUT : number; - export var ANIMATION_CURVE_EASE_OUT : number; - export var ANIMATION_CURVE_LINEAR : number; - export var AUTODETECT_ADDRESS : number; - export var AUTODETECT_ALL : number; - export var AUTODETECT_CALENDAR : number; - export var AUTODETECT_LINK : number; - export var AUTODETECT_NONE : number; - export var AUTODETECT_PHONE : number; - export var AUTOLINK_ALL : number; - export var AUTOLINK_CALENDAR : number; - export var AUTOLINK_EMAIL_ADDRESSES : number; - export var AUTOLINK_MAP_ADDRESSES : number; - export var AUTOLINK_NONE : number; - export var AUTOLINK_PHONE_NUMBERS : number; - export var AUTOLINK_URLS : number; - export var BLEND_MODE_CLEAR : number; - export var BLEND_MODE_COLOR : number; - export var BLEND_MODE_COLOR_BURN : number; - export var BLEND_MODE_COLOR_DODGE : number; - export var BLEND_MODE_COPY : number; - export var BLEND_MODE_DARKEN : number; - export var BLEND_MODE_DESTINATION_ATOP : number; - export var BLEND_MODE_DESTINATION_IN : number; - export var BLEND_MODE_DESTINATION_OUT : number; - export var BLEND_MODE_DESTINATION_OVER : number; - export var BLEND_MODE_DIFFERENCE : number; - export var BLEND_MODE_EXCLUSION : number; - export var BLEND_MODE_HARD_LIGHT : number; - export var BLEND_MODE_HUE : number; - export var BLEND_MODE_LIGHTEN : number; - export var BLEND_MODE_LUMINOSITY : number; - export var BLEND_MODE_MULTIPLY : number; - export var BLEND_MODE_NORMAL : number; - export var BLEND_MODE_OVERLAY : number; - export var BLEND_MODE_PLUS_DARKER : number; - export var BLEND_MODE_PLUS_LIGHTER : number; - export var BLEND_MODE_SATURATION : number; - export var BLEND_MODE_SCREEN : number; - export var BLEND_MODE_SOFT_LIGHT : number; - export var BLEND_MODE_SOURCE_ATOP : number; - export var BLEND_MODE_SOURCE_IN : number; - export var BLEND_MODE_SOURCE_OUT : number; - export var BLEND_MODE_XOR : number; - export var EXTEND_EDGE_ALL : number; - export var EXTEND_EDGE_BOTTOM : number; - export var EXTEND_EDGE_LEFT : number; - export var EXTEND_EDGE_NONE : number; - export var EXTEND_EDGE_RIGHT : number; - export var EXTEND_EDGE_TOP : number; - export var FACE_DOWN : number; - export var FACE_UP : number; - export var FILL : string; - export var INHERIT : string; - export var INPUT_BORDERSTYLE_BEZEL : number; - export var INPUT_BORDERSTYLE_LINE : number; - export var INPUT_BORDERSTYLE_NONE : number; - export var INPUT_BORDERSTYLE_ROUNDED : number; - export var INPUT_BUTTONMODE_ALWAYS : number; - export var INPUT_BUTTONMODE_NEVER : number; - export var INPUT_BUTTONMODE_ONBLUR : number; - export var INPUT_BUTTONMODE_ONFOCUS : number; - export var KEYBOARD_APPEARANCE_ALERT : number; - export var KEYBOARD_APPEARANCE_DEFAULT : number; - export var KEYBOARD_ASCII : number; - export var KEYBOARD_DECIMAL_PAD : number; - export var KEYBOARD_DEFAULT : number; - export var KEYBOARD_EMAIL : number; - export var KEYBOARD_NAMEPHONE_PAD : number; - export var KEYBOARD_NUMBERS_PUNCTUATION : number; - export var KEYBOARD_NUMBER_PAD : number; - export var KEYBOARD_PHONE_PAD : number; - export var KEYBOARD_URL : number; - export var LANDSCAPE_LEFT : number; - export var LANDSCAPE_RIGHT : number; - export var LIST_ACCESSORY_TYPE_CHECKMARK : number; - export var LIST_ACCESSORY_TYPE_DETAIL : number; - export var LIST_ACCESSORY_TYPE_DISCLOSURE : number; - export var LIST_ACCESSORY_TYPE_NONE : number; - export var LIST_ITEM_TEMPLATE_CONTACTS : number; - export var LIST_ITEM_TEMPLATE_DEFAULT : number; - export var LIST_ITEM_TEMPLATE_SETTINGS : number; - export var LIST_ITEM_TEMPLATE_SUBTITLE : number; - export var NOTIFICATION_DURATION_LONG : number; - export var NOTIFICATION_DURATION_SHORT : number; - export var PICKER_TYPE_COUNT_DOWN_TIMER : number; - export var PICKER_TYPE_DATE : number; - export var PICKER_TYPE_DATE_AND_TIME : number; - export var PICKER_TYPE_PLAIN : number; - export var PICKER_TYPE_TIME : number; - export var PORTRAIT : number; - export var RETURNKEY_DEFAULT : number; - export var RETURNKEY_DONE : number; - export var RETURNKEY_EMERGENCY_CALL : number; - export var RETURNKEY_GO : number; - export var RETURNKEY_GOOGLE : number; - export var RETURNKEY_JOIN : number; - export var RETURNKEY_NEXT : number; - export var RETURNKEY_ROUTE : number; - export var RETURNKEY_SEARCH : number; - export var RETURNKEY_SEND : number; - export var RETURNKEY_YAHOO : number; - export var SIZE : string; - export var TEXT_ALIGNMENT_CENTER : any; - export var TEXT_ALIGNMENT_LEFT : any; - export var TEXT_ALIGNMENT_RIGHT : any; - export var TEXT_AUTOCAPITALIZATION_ALL : number; - export var TEXT_AUTOCAPITALIZATION_NONE : number; - export var TEXT_AUTOCAPITALIZATION_SENTENCES : number; - export var TEXT_AUTOCAPITALIZATION_WORDS : number; - export var TEXT_STYLE_BODY : string; - export var TEXT_STYLE_CAPTION1 : string; - export var TEXT_STYLE_CAPTION2 : string; - export var TEXT_STYLE_FOOTNOTE : string; - export var TEXT_STYLE_HEADLINE : string; - export var TEXT_STYLE_SUBHEADLINE : string; - export var TEXT_VERTICAL_ALIGNMENT_BOTTOM : any; - export var TEXT_VERTICAL_ALIGNMENT_CENTER : any; - export var TEXT_VERTICAL_ALIGNMENT_TOP : any; - export var UNIT_CM : string; - export var UNIT_DIP : string; - export var UNIT_IN : string; - export var UNIT_MM : string; - export var UNIT_PX : string; - export var UNKNOWN : number; - export var UPSIDE_PORTRAIT : number; - export var URL_ERROR_AUTHENTICATION : number; - export var URL_ERROR_BAD_URL : number; - export var URL_ERROR_CONNECT : number; - export var URL_ERROR_FILE : number; - export var URL_ERROR_FILE_NOT_FOUND : number; - export var URL_ERROR_HOST_LOOKUP : number; - export var URL_ERROR_REDIRECT_LOOP : number; - export var URL_ERROR_SSL_FAILED : number; - export var URL_ERROR_TIMEOUT : number; - export var URL_ERROR_UNKNOWN : number; - export var URL_ERROR_UNSUPPORTED_SCHEME : number; - export var apiName : string; - export var backgroundColor : string; - export var backgroundImage : string; - export var bubbleParent : boolean; - export var currentTab : Ti.UI.Tab; - export var currentWindow : Ti.UI.Window; - export var orientation : number; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function convertUnits (convertFromValue: string, convertToUnits: number) : number; - export function create2DMatrix (parameters?: MatrixCreationDict) : Ti.UI._2DMatrix; - export function create3DMatrix (parameters?: Dictionary) : Ti.UI._3DMatrix; - export function createActivityIndicator (parameters?: Dictionary) : Ti.UI.ActivityIndicator; - export function createAlertDialog (parameters?: Dictionary) : Ti.UI.AlertDialog; - export function createAnimation (parameters?: Dictionary) : Ti.UI.Animation; - export function createButton (parameters?: Dictionary) : Ti.UI.Button; - export function createButtonBar (parameters?: Dictionary) : Ti.UI.ButtonBar; - export function createCoverFlowView (parameters?: Dictionary) : Ti.UI.CoverFlowView; - export function createDashboardItem (parameters?: Dictionary) : Ti.UI.DashboardItem; - export function createDashboardView (parameters?: Dictionary) : Ti.UI.DashboardView; - export function createEmailDialog (parameters?: Dictionary) : Ti.UI.EmailDialog; - export function createImageView (parameters?: Dictionary) : Ti.UI.ImageView; - export function createLabel (parameters?: Dictionary) : Ti.UI.Label; - export function createListSection (parameters?: Dictionary) : Ti.UI.ListSection; - export function createListView (parameters?: Dictionary) : Ti.UI.ListView; - export function createMaskedImage (parameters?: Dictionary) : Ti.UI.MaskedImage; - export function createNotification (parameters?: Dictionary) : Ti.UI.Notification; - export function createOptionDialog (parameters?: Dictionary) : Ti.UI.OptionDialog; - export function createPicker (parameters?: Dictionary) : Ti.UI.Picker; - export function createPickerColumn (parameters?: Dictionary) : Ti.UI.PickerColumn; - export function createPickerRow (parameters?: Dictionary) : Ti.UI.PickerRow; - export function createProgressBar (parameters?: Dictionary) : Ti.UI.ProgressBar; - export function createRefreshControl (parameters?: Dictionary) : Ti.UI.RefreshControl; - export function createSMSDialog (parameters?: Dictionary) : Ti.UI.SMSDialog; - export function createScrollView (parameters?: Dictionary) : Ti.UI.ScrollView; - export function createScrollableView (parameters?: Dictionary) : Ti.UI.ScrollableView; - export function createSearchBar (parameters?: Dictionary) : Ti.UI.SearchBar; - export function createSlider (parameters?: Dictionary) : Ti.UI.Slider; - export function createSwitch (parameters?: Dictionary) : Ti.UI.Switch; - export function createTab (parameters?: Dictionary) : Ti.UI.Tab; - export function createTabGroup (parameters?: Dictionary) : Ti.UI.TabGroup; - export function createTabbedBar (parameters?: Dictionary) : Ti.UI.TabbedBar; - export function createTableView (parameters?: Dictionary) : Ti.UI.TableView; - export function createTableViewRow (parameters?: Dictionary) : Ti.UI.TableViewRow; - export function createTableViewSection (parameters?: Dictionary) : Ti.UI.TableViewSection; - export function createTextArea (parameters?: Dictionary) : Ti.UI.TextArea; - export function createTextField (parameters?: Dictionary) : Ti.UI.TextField; - export function createToolbar (parameters?: Dictionary) : Ti.UI.Toolbar; - export function createView (parameters?: Dictionary) : Ti.UI.View; - export function createWebView (parameters?: Dictionary) : Ti.UI.WebView; - export function createWindow (parameters?: Dictionary) : Ti.UI.Window; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBackgroundColor () : string; - export function getBackgroundImage () : string; - export function getBubbleParent () : boolean; - export function getCurrentTab () : Ti.UI.Tab; - export function getCurrentWindow () : Ti.UI.Window; - export function getOrientation () : number; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBackgroundColor (backgroundColor: string) : void; - export function setBackgroundImage (backgroundImage: string) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setCurrentTab (currentTab: Ti.UI.Tab) : void; - export function setOrientation (orientation: number) : void; - export module iPad { - export var POPOVER_ARROW_DIRECTION_ANY : number; - export var POPOVER_ARROW_DIRECTION_DOWN : number; - export var POPOVER_ARROW_DIRECTION_LEFT : number; - export var POPOVER_ARROW_DIRECTION_RIGHT : number; - export var POPOVER_ARROW_DIRECTION_UNKNOWN : number; - export var POPOVER_ARROW_DIRECTION_UP : number; - export var apiName : string; - export var bubbleParent : boolean; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createDocumentViewer (parameters?: Dictionary) : Ti.UI.iPad.DocumentViewer; - export function createPopover (parameters?: Dictionary) : Ti.UI.iPad.Popover; - export function createSplitWindow (parameters?: Dictionary) : Ti.UI.iPad.SplitWindow; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface SplitWindow extends Ti.UI.Window { - detailView : Ti.UI.View; - masterView : Ti.UI.View; - showMasterInPortrait : boolean; - getDetailView () : Ti.UI.View; - getMasterView () : Ti.UI.View; - getShowMasterInPortrait () : boolean; - setShowMasterInPortrait (showMasterInPortrait: boolean) : void; - } - export interface DocumentViewer extends Ti.UI.View { - setUrl (url: string) : void; - show () : void; - } - export interface Popover extends Ti.Proxy { - arrowDirection : number; - contentView : Ti.UI.View; - height : any; - leftNavButton : any; - passthroughViews : Array; - rightNavButton : any; - title : string; - width : any; - add () : void; - getArrowDirection () : number; - getContentView () : Ti.UI.View; - getHeight () : any; - getLeftNavButton () : any; - getPassthroughViews () : Array; - getRightNavButton () : any; - getTitle () : string; - getWidth () : any; - hide (options: PopoverParams) : void; - remove () : void; - setArrowDirection (arrowDirection: number) : void; - setContentView (contentView: Ti.UI.View) : void; - setHeight (height: number) : void; - setHeight (height: string) : void; - setLeftNavButton (leftNavButton: any) : void; - setPassthroughViews (passthroughViews: Array) : void; - setRightNavButton (rightNavButton: any) : void; - setTitle (title: string) : void; - setWidth (width: number) : void; - setWidth (width: string) : void; - show (params: PopoverParams) : void; - } - } - export module iOS { - export var AD_SIZE_LANDSCAPE : string; - export var AD_SIZE_PORTRAIT : string; - export var ANIMATION_CURVE_EASE_IN : number; - export var ANIMATION_CURVE_EASE_IN_OUT : number; - export var ANIMATION_CURVE_EASE_OUT : number; - export var ANIMATION_CURVE_LINEAR : number; - export var ATTRIBUTE_BACKGROUND_COLOR : number; - export var ATTRIBUTE_BASELINE_OFFSET : number; - export var ATTRIBUTE_EXPANSION : number; - export var ATTRIBUTE_FONT : number; - export var ATTRIBUTE_FOREGROUND_COLOR : number; - export var ATTRIBUTE_KERN : number; - export var ATTRIBUTE_LETTERPRESS_STYLE : number; - export var ATTRIBUTE_LIGATURE : number; - export var ATTRIBUTE_LINK : number; - export var ATTRIBUTE_OBLIQUENESS : number; - export var ATTRIBUTE_SHADOW : number; - export var ATTRIBUTE_STRIKETHROUGH_COLOR : number; - export var ATTRIBUTE_STRIKETHROUGH_STYLE : number; - export var ATTRIBUTE_STROKE_COLOR : number; - export var ATTRIBUTE_STROKE_WIDTH : number; - export var ATTRIBUTE_TEXT_EFFECT : number; - export var ATTRIBUTE_UNDERLINES_STYLE : number; - export var ATTRIBUTE_UNDERLINE_BY_WORD : number; - export var ATTRIBUTE_UNDERLINE_COLOR : number; - export var ATTRIBUTE_UNDERLINE_PATTERN_DASH : number; - export var ATTRIBUTE_UNDERLINE_PATTERN_DASH_DOT : number; - export var ATTRIBUTE_UNDERLINE_PATTERN_DASH_DOT_DOT : number; - export var ATTRIBUTE_UNDERLINE_PATTERN_DOT : number; - export var ATTRIBUTE_UNDERLINE_PATTERN_SOLID : number; - export var ATTRIBUTE_UNDERLINE_STYLE_DOUBLE : number; - export var ATTRIBUTE_UNDERLINE_STYLE_NONE : number; - export var ATTRIBUTE_UNDERLINE_STYLE_SINGLE : number; - export var ATTRIBUTE_UNDERLINE_STYLE_THICK : number; - export var ATTRIBUTE_WRITING_DIRECTION : number; - export var ATTRIBUTE_WRITING_DIRECTION_EMBEDDING : number; - export var ATTRIBUTE_WRITING_DIRECTION_LEFT_TO_RIGHT : number; - export var ATTRIBUTE_WRITING_DIRECTION_NATURAL : number; - export var ATTRIBUTE_WRITING_DIRECTION_OVERRIDE : number; - export var ATTRIBUTE_WRITING_DIRECTION_RIGHT_TO_LEFT : number; - export var AUTODETECT_ADDRESS : number; - export var AUTODETECT_ALL : number; - export var AUTODETECT_CALENDAR : number; - export var AUTODETECT_LINK : number; - export var AUTODETECT_NONE : number; - export var AUTODETECT_PHONE : number; - export var BLEND_MODE_CLEAR : number; - export var BLEND_MODE_COLOR : number; - export var BLEND_MODE_COLOR_BURN : number; - export var BLEND_MODE_COLOR_DODGE : number; - export var BLEND_MODE_COPY : number; - export var BLEND_MODE_DARKEN : number; - export var BLEND_MODE_DESTINATION_ATOP : number; - export var BLEND_MODE_DESTINATION_IN : number; - export var BLEND_MODE_DESTINATION_OUT : number; - export var BLEND_MODE_DESTINATION_OVER : number; - export var BLEND_MODE_DIFFERENCE : number; - export var BLEND_MODE_EXCLUSION : number; - export var BLEND_MODE_HARD_LIGHT : number; - export var BLEND_MODE_HUE : number; - export var BLEND_MODE_LIGHTEN : number; - export var BLEND_MODE_LUMINOSITY : number; - export var BLEND_MODE_MULTIPLY : number; - export var BLEND_MODE_NORMAL : number; - export var BLEND_MODE_OVERLAY : number; - export var BLEND_MODE_PLUS_DARKER : number; - export var BLEND_MODE_PLUS_LIGHTER : number; - export var BLEND_MODE_SATURATION : number; - export var BLEND_MODE_SCREEN : number; - export var BLEND_MODE_SOFT_LIGHT : number; - export var BLEND_MODE_SOURCE_ATOP : number; - export var BLEND_MODE_SOURCE_IN : number; - export var BLEND_MODE_SOURCE_OUT : number; - export var BLEND_MODE_XOR : number; - export var CLIP_MODE_DEFAULT : number; - export var CLIP_MODE_DISABLED : number; - export var CLIP_MODE_ENABLED : number; - export var COLLISION_MODE_ALL : number; - export var COLLISION_MODE_BOUNDARY : number; - export var COLLISION_MODE_ITEM : number; - export var COLOR_GROUP_TABLEVIEW_BACKGROUND : string; - export var COLOR_SCROLLVIEW_BACKGROUND : string; - export var COLOR_UNDER_PAGE_BACKGROUND : string; - export var COLOR_VIEW_FLIPSIDE_BACKGROUND : string; - export var PUSH_MODE_CONTINUOUS : number; - export var PUSH_MODE_INSTANTANEOUS : number; - export var SCROLL_DECELERATION_RATE_FAST : number; - export var SCROLL_DECELERATION_RATE_NORMAL : number; - export var WEBVIEW_NAVIGATIONTYPE_BACK_FORWARD : number; - export var WEBVIEW_NAVIGATIONTYPE_FORM_RESUBMITTED : number; - export var WEBVIEW_NAVIGATIONTYPE_FORM_SUBMITTED : number; - export var WEBVIEW_NAVIGATIONTYPE_LINK_CLICKED : number; - export var WEBVIEW_NAVIGATIONTYPE_OTHER : number; - export var WEBVIEW_NAVIGATIONTYPE_RELOAD : number; - export var apiName : string; - export var bubbleParent : boolean; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function create3DMatrix (parameters?: Dictionary) : Ti.UI.iOS._3DMatrix; - export function createAdView (parameters?: Dictionary) : Ti.UI.iOS.AdView; - export function createAnchorAttachmentBehavior (parameters?: Dictionary) : Ti.UI.iOS.AnchorAttachmentBehavior; - export function createAnimator (parameters?: Dictionary) : Ti.UI.iOS.Animator; - export function createAttributedString (parameters?: Dictionary) : Ti.UI.iOS.AttributedString; - export function createCollisionBehavior (parameters?: Dictionary) : Ti.UI.iOS.CollisionBehavior; - export function createCoverFlowView (parameters?: Dictionary) : Ti.UI.iOS.CoverFlowView; - export function createDocumentViewer (parameters?: Dictionary) : Ti.UI.iOS.DocumentViewer; - export function createDynamicItemBehavior (parameters?: Dictionary) : Ti.UI.iOS.DynamicItemBehavior; - export function createGravityBehavior (parameters?: Dictionary) : Ti.UI.iOS.GravityBehavior; - export function createNavigationWindow (parameters?: Dictionary) : Ti.UI.iOS.NavigationWindow; - export function createPushBehavior (parameters?: Dictionary) : Ti.UI.iOS.PushBehavior; - export function createSnapBehavior (parameters?: Dictionary) : Ti.UI.iOS.SnapBehavior; - export function createTabbedBar (parameters?: Dictionary) : Ti.UI.iOS.TabbedBar; - export function createToolbar (parameters?: Dictionary) : Ti.UI.iOS.Toolbar; - export function createTransitionAnimation (transition: transitionAnimationParam) : Ti.Proxy; - export function createViewAttachmentBehavior (parameters?: Dictionary) : Ti.UI.iOS.ViewAttachmentBehavior; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface Animator extends Ti.Proxy { - behaviors : Array; - referenceView : Ti.UI.View; - running : boolean; - addBehavior (behavior: Ti.Proxy) : void; - getBehaviors () : Array; - getReferenceView () : Ti.UI.View; - getRunning () : boolean; - removeAllBehaviors () : void; - removeBehavior (behavior: Ti.Proxy) : void; - setBehaviors (behaviors: Array) : void; - setReferenceView (referenceView: Ti.UI.View) : void; - startAnimator () : void; - stopAnimator () : void; - updateItemUsingCurrentState (item: Ti.UI.View) : void; - } - export interface DynamicItemBehavior extends Ti.Proxy { - allowsRotation : boolean; - angularResistance : number; - density : number; - elasticity : number; - friction : number; - items : Array; - resistance : number; - addAngularVelocityForItem (item: Ti.UI.View, velocity: number) : void; - addItem (item: Ti.UI.View) : void; - addLinearVelocityForItem (item: Ti.UI.View, velocity: Point) : void; - angularVelocityForItem (item: Ti.UI.View) : number; - getAllowsRotation () : boolean; - getAngularResistance () : number; - getDensity () : number; - getElasticity () : number; - getFriction () : number; - getItems () : Array; - getResistance () : number; - linearVelocityForItem (item: Ti.UI.View) : Point; - removeItem (item: Ti.UI.View) : void; - setAllowsRotation (allowsRotation: boolean) : void; - setAngularResistance (angularResistance: number) : void; - setDensity (density: number) : void; - setElasticity (elasticity: number) : void; - setFriction (friction: number) : void; - setResistance (resistance: number) : void; - } - export interface SnapBehavior extends Ti.Proxy { - damping : number; - item : Ti.UI.View; - snapPoint : Point; - getDamping () : number; - getItem () : Ti.UI.View; - getSnapPoint () : Point; - setDamping (damping: number) : void; - setItem (item: Ti.UI.View) : void; - setSnapPoint (snapPoint: Point) : void; - } - export interface GravityBehavior extends Ti.Proxy { - angle : number; - gravityDirection : Point; - items : Array; - magnitude : number; - addItem (item: Ti.UI.View) : void; - getAngle () : number; - getGravityDirection () : Point; - getItems () : Array; - getMagnitude () : number; - removeItem (item: Ti.UI.View) : void; - setAngle (angle: number) : void; - setGravityDirection (gravityDirection: Point) : void; - setMagnitude (magnitude: number) : void; - } - export interface CollisionBehavior extends Ti.Proxy { - boundaryIdentifiers : Array; - collisionMode : number; - items : Array; - referenceInsets : ReferenceInsets; - treatReferenceAsBoundary : boolean; - addBoundary (boundary: BoundaryIdentifier) : void; - addItem (item: Ti.UI.View) : void; - getBoundaryIdentifiers () : Array; - getCollisionMode () : number; - getItems () : Array; - getReferenceInsets () : ReferenceInsets; - getTreatReferenceAsBoundary () : boolean; - removeAllBoundaries () : void; - removeBoundary (boundary: BoundaryIdentifier) : void; - removeItem (item: Ti.UI.View) : void; - setCollisionMode (collisionMode: number) : void; - setReferenceInsets (referenceInsets: ReferenceInsets) : void; - setTreatReferenceAsBoundary (treatReferenceAsBoundary: boolean) : void; - } - export interface Toolbar extends Ti.UI.View { - barColor : string; - borderBottom : boolean; - borderTop : boolean; - extendBackground : boolean; - items : Array; - translucent : boolean; - getBarColor () : string; - getBorderBottom () : boolean; - getBorderTop () : boolean; - getExtendBackground () : boolean; - getItems () : Array; - getTranslucent () : boolean; - setBarColor (barColor: string) : void; - setBorderBottom (borderBottom: boolean) : void; - setBorderTop (borderTop: boolean) : void; - setItems (items: Array) : void; - setTranslucent (translucent: boolean) : void; - } - export interface ViewAttachmentBehavior extends Ti.Proxy { - anchorItem : Ti.UI.View; - anchorOffset : Point; - damping : number; - distance : number; - frequency : number; - item : Ti.UI.View; - itemOffset : Point; - getAnchorItem () : Ti.UI.View; - getAnchorOffset () : Point; - getDamping () : number; - getDistance () : number; - getFrequency () : number; - getItem () : Ti.UI.View; - getItemOffset () : Point; - setAnchorItem (anchorItem: Ti.UI.View) : void; - setAnchorOffset (anchorOffset: Point) : void; - setDamping (damping: number) : void; - setDistance (distance: number) : void; - setFrequency (frequency: number) : void; - setItem (item: Ti.UI.View) : void; - setItemOffset (itemOffset: Point) : void; - } - export interface PushBehavior extends Ti.Proxy { - active : boolean; - angle : number; - items : Array; - magnitude : number; - pushDirection : Point; - pushMode : number; - addItem (item: Ti.UI.View) : void; - getActive () : boolean; - getAngle () : number; - getItems () : Array; - getMagnitude () : number; - getPushDirection () : Point; - getPushMode () : number; - removeItem (item: Ti.UI.View) : void; - setActive (active: boolean) : void; - setAngle (angle: number) : void; - setMagnitude (magnitude: number) : void; - setPushDirection (pushDirection: Point) : void; - setPushMode (pushMode: number) : void; - } - export interface CoverFlowView extends Ti.UI.View { - images : any; - selected : number; - getImages () : any; - getSelected () : number; - setImage (index: number, image: string) : void; - setImage (image: Ti.Blob) : void; - setImage (image: Ti.Filesystem.File) : void; - setImage (index: number, image: CoverFlowImageType) : void; - setImages (images: Array) : void; - setImages (images: Array) : void; - setImages (images: Array) : void; - setImages (images: Array) : void; - setSelected (selected: number) : void; - } - export interface DocumentViewer extends Ti.UI.View { - name : string; - url : string; - getName () : string; - getUrl () : string; - hide (options?: DocumentViewerOptions) : void; - setUrl (url: string) : void; - show (options?: DocumentViewerOptions) : void; - } - export interface NavigationWindow extends Ti.UI.Window { - window : Ti.UI.Window; - closeWindow (window: Ti.UI.Window, options: Dictionary) : void; - getWindow () : Ti.UI.Window; - openWindow (window: Ti.UI.Window, options: Dictionary) : void; - } - export interface AttributedString extends Ti.Proxy { - attributes : Array; - text : string; - addAttribute (attribute: Attribute) : void; - getAttributes () : Array; - getText () : string; - setAttributes (attributes: Array) : void; - setText (text: string) : void; - } - export interface AnchorAttachmentBehavior extends Ti.Proxy { - anchor : Point; - damping : number; - distance : number; - frequency : number; - item : Ti.UI.View; - offset : Point; - getAnchor () : Point; - getDamping () : number; - getDistance () : number; - getFrequency () : number; - getItem () : Ti.UI.View; - getOffset () : Point; - setAnchor (anchor: Point) : void; - setDamping (damping: number) : void; - setDistance (distance: number) : void; - setFrequency (frequency: number) : void; - setItem (item: Ti.UI.View) : void; - setOffset (offset: Point) : void; - } - export interface TabbedBar extends Ti.UI.View { - index : number; - labels : any; - style : number; - getIndex () : number; - getLabels () : any; - getStyle () : number; - setIndex (index: number) : void; - setLabels (labels: Array) : void; - setLabels (labels: Array) : void; - setStyle (style: number) : void; - } - export interface _3DMatrix extends Ti.Proxy { - m11 : number; - m12 : number; - m13 : number; - m14 : number; - m21 : number; - m22 : number; - m23 : number; - m24 : number; - m31 : number; - m32 : number; - m33 : number; - m34 : number; - m41 : number; - m42 : number; - m43 : number; - m44 : number; - getM11 () : number; - getM12 () : number; - getM13 () : number; - getM14 () : number; - getM21 () : number; - getM22 () : number; - getM23 () : number; - getM24 () : number; - getM31 () : number; - getM32 () : number; - getM33 () : number; - getM34 () : number; - getM41 () : number; - getM42 () : number; - getM43 () : number; - getM44 () : number; - invert () : Ti.UI._3DMatrix; - multiply (t2: Ti.UI._3DMatrix) : Ti.UI._3DMatrix; - rotate (angle: number, x: number, y: number, z: number) : Ti.UI._3DMatrix; - scale (sx: number, sy: number, sz: number) : Ti.UI._3DMatrix; - setM11 (m11: number) : void; - setM12 (m12: number) : void; - setM13 (m13: number) : void; - setM14 (m14: number) : void; - setM21 (m21: number) : void; - setM22 (m22: number) : void; - setM23 (m23: number) : void; - setM24 (m24: number) : void; - setM31 (m31: number) : void; - setM32 (m32: number) : void; - setM33 (m33: number) : void; - setM34 (m34: number) : void; - setM41 (m41: number) : void; - setM42 (m42: number) : void; - setM43 (m43: number) : void; - setM44 (m44: number) : void; - translate (tx: number, ty: number, tz: number) : Ti.UI._3DMatrix; - } - export interface AdView extends Ti.UI.View { - adSize : string; - cancelAction () : void; - getAdSize () : string; - setAdSize (adSize: string) : void; - } - } - export module iPhone { - export var MODAL_PRESENTATION_CURRENT_CONTEXT : number; - export var MODAL_PRESENTATION_FORMSHEET : number; - export var MODAL_PRESENTATION_FULLSCREEN : number; - export var MODAL_PRESENTATION_PAGESHEET : number; - export var MODAL_TRANSITION_STYLE_COVER_VERTICAL : number; - export var MODAL_TRANSITION_STYLE_CROSS_DISSOLVE : number; - export var MODAL_TRANSITION_STYLE_FLIP_HORIZONTAL : number; - export var MODAL_TRANSITION_STYLE_PARTIAL_CURL : number; - export var apiName : string; - export var appBadge : number; - export var appSupportsShakeToEdit : boolean; - export var bubbleParent : boolean; - export var statusBarHidden : boolean; - export var statusBarStyle : number; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createNavigationGroup (parameters?: Dictionary) : Ti.UI.iPhone.NavigationGroup; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getAppBadge () : number; - export function getAppSupportsShakeToEdit () : boolean; - export function getBubbleParent () : boolean; - export function getStatusBarHidden () : boolean; - export function getStatusBarStyle () : number; - export function hideStatusBar (params?: hideStatusBarParams) : void; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setAppBadge (appBadge: number) : void; - export function setAppSupportsShakeToEdit (appSupportsShakeToEdit: boolean) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function showStatusBar (params?: showStatusBarParams) : void; - export enum ScrollIndicatorStyle { - BLACK, - DEFAULT, - WHITE - } - export enum SystemButtonStyle { - BAR, - BORDERED, - DONE, - PLAIN - } - export enum ListViewStyle { - GROUPED, - PLAIN - } - export enum StatusBar { - ANIMATION_STYLE_FADE, - ANIMATION_STYLE_NONE, - ANIMATION_STYLE_SLIDE, - DEFAULT, - GRAY, - GREY, - LIGHT_CONTENT, - OPAQUE_BLACK, - TRANSLUCENT_BLACK - } - export enum SystemButton { - ACTION, - ACTIVITY, - ADD, - BOOKMARKS, - CAMERA, - CANCEL, - COMPOSE, - CONTACT_ADD, - DISCLOSURE, - DONE, - EDIT, - FAST_FORWARD, - FIXED_SPACE, - FLEXIBLE_SPACE, - INFO_DARK, - INFO_LIGHT, - ORGANIZE, - PAUSE, - PLAY, - REFRESH, - REPLY, - REWIND, - SAVE, - SPINNER, - STOP, - TRASH - } - export enum TableViewStyle { - GROUPED, - PLAIN - } - export enum SystemIcon { - BOOKMARKS, - CONTACTS, - DOWNLOADS, - FAVORITES, - FEATURED, - HISTORY, - MORE, - MOST_RECENT, - MOST_VIEWED, - RECENTS, - SEARCH, - TOP_RATED - } - export enum ActivityIndicatorStyle { - BIG, - DARK, - PLAIN - } - export enum ProgressBarStyle { - BAR, - DEFAULT, - PLAIN - } - export enum ListViewSeparatorStyle { - NONE, - SINGLE_LINE - } - export enum RowAnimationStyle { - BOTTOM, - FADE, - LEFT, - NONE, - RIGHT, - TOP - } - export enum AnimationStyle { - CURL_DOWN, - CURL_UP, - FLIP_FROM_LEFT, - FLIP_FROM_RIGHT, - NONE - } - export interface NavigationGroup extends Ti.UI.View { - window : Ti.UI.Window; - close (window: Ti.UI.Window, options: Dictionary) : void; - getWindow () : Ti.UI.Window; - open (window: Ti.UI.Window, options: Dictionary) : void; - } - export enum TableViewScrollPosition { - BOTTOM, - MIDDLE, - NONE, - TOP - } - export enum AlertDialogStyle { - DEFAULT, - LOGIN_AND_PASSWORD_INPUT, - PLAIN_TEXT_INPUT, - SECURE_TEXT_INPUT - } - export enum ListViewScrollPosition { - BOTTOM, - MIDDLE, - NONE, - TOP - } - export enum TableViewCellSelectionStyle { - BLUE, - GRAY, - NONE - } - export enum ListViewCellSelectionStyle { - BLUE, - GRAY, - NONE - } - export enum TableViewSeparatorStyle { - NONE, - SINGLE_LINE - } - } - export interface TextArea extends Ti.UI.View { - appearance : number; - attributedString : Ti.UI.iOS.AttributedString; - autoLink : number; - autocapitalization : number; - autocorrect : boolean; - clearOnEdit : boolean; - color : string; - editable : boolean; - ellipsize : boolean; - enableReturnKey : boolean; - font : Font; - handleLinks : boolean; - hintText : string; - keyboardToolbar : any; - keyboardToolbarColor : string; - keyboardToolbarHeight : number; - keyboardType : number; - maxLength : number; - returnKeyType : number; - scrollable : boolean; - scrollsToTop : boolean; - selection : textAreaSelectedParams; - suppressReturn : boolean; - textAlign : any; - value : string; - verticalAlign : any; - blur () : void; - focus () : void; - getAppearance () : number; - getAttributedString () : Ti.UI.iOS.AttributedString; - getAutoLink () : number; - getAutocapitalization () : number; - getAutocorrect () : boolean; - getClearOnEdit () : boolean; - getColor () : string; - getEditable () : boolean; - getEllipsize () : boolean; - getEnableReturnKey () : boolean; - getFont () : Font; - getHandleLinks () : boolean; - getHintText () : string; - getKeyboardToolbar () : any; - getKeyboardToolbarColor () : string; - getKeyboardToolbarHeight () : number; - getKeyboardType () : number; - getMaxLength () : number; - getReturnKeyType () : number; - getScrollable () : boolean; - getScrollsToTop () : boolean; - getSelection () : textAreaSelectedParams; - getSuppressReturn () : boolean; - getTextAlign () : any; - getValue () : string; - getVerticalAlign () : any; - hasText () : boolean; - setAppearance (appearance: number) : void; - setAttributedString (attributedString: Ti.UI.iOS.AttributedString) : void; - setAutoLink (autoLink: number) : void; - setAutocapitalization (autocapitalization: number) : void; - setAutocorrect (autocorrect: boolean) : void; - setClearOnEdit (clearOnEdit: boolean) : void; - setColor (color: string) : void; - setEditable (editable: boolean) : void; - setEllipsize (ellipsize: boolean) : void; - setEnableReturnKey (enableReturnKey: boolean) : void; - setFont (font: Font) : void; - setHandleLinks (handleLinks: boolean) : void; - setHintText (hintText: string) : void; - setKeyboardToolbar (keyboardToolbar: Array) : void; - setKeyboardToolbar (keyboardToolbar: Ti.UI.iOS.Toolbar) : void; - setKeyboardToolbarColor (keyboardToolbarColor: string) : void; - setKeyboardToolbarHeight (keyboardToolbarHeight: number) : void; - setKeyboardType (keyboardType: number) : void; - setMaxLength (maxLength: number) : void; - setReturnKeyType (returnKeyType: number) : void; - setScrollable (scrollable: boolean) : void; - setScrollsToTop (scrollsToTop: boolean) : void; - setSelection (start: number, end: number) : void; - setSuppressReturn (suppressReturn: boolean) : void; - setTextAlign (textAlign: string) : void; - setTextAlign (textAlign: number) : void; - setValue (value: string) : void; - setVerticalAlign (verticalAlign: number) : void; - setVerticalAlign (verticalAlign: string) : void; - } - export interface View extends Ti.Proxy { - accessibilityHidden : boolean; - accessibilityHint : string; - accessibilityLabel : string; - accessibilityValue : string; - anchorPoint : Point; - animatedCenter : Point; - backgroundColor : string; - backgroundDisabledColor : string; - backgroundDisabledImage : string; - backgroundFocusedColor : string; - backgroundFocusedImage : string; - backgroundGradient : Gradient; - backgroundImage : string; - backgroundLeftCap : number; - backgroundRepeat : boolean; - backgroundSelectedColor : string; - backgroundSelectedImage : string; - backgroundTopCap : number; - borderColor : string; - borderRadius : number; - borderWidth : number; - bottom : any; - center : Point; - children : Array; - clipMode : number; - enabled : boolean; - focusable : boolean; - height : any; - horizontalWrap : boolean; - keepScreenOn : boolean; - layout : string; - left : any; - opacity : number; - overrideCurrentAnimation : boolean; - pullBackgroundColor : string; - rect : Dimension; - right : any; - size : Dimension; - softKeyboardOnFocus : number; - tintColor : any; - top : any; - touchEnabled : boolean; - transform : any; - viewShadowColor : string; - viewShadowOffset : Point; - viewShadowRadius : number; - visible : boolean; - width : any; - zIndex : number; - add (view: Ti.UI.View) : void; - animate (animation: Ti.UI.Animation, callback: (...args : any[]) => any) : void; - animate (animation: Dictionary, callback: (...args : any[]) => any) : void; - convertPointToView (point: Point, destinationView: Ti.UI.View) : Point; - finishLayout () : void; - getAccessibilityHidden () : boolean; - getAccessibilityHint () : string; - getAccessibilityLabel () : string; - getAccessibilityValue () : string; - getAnchorPoint () : Point; - getAnimatedCenter () : Point; - getBackgroundColor () : string; - getBackgroundDisabledColor () : string; - getBackgroundDisabledImage () : string; - getBackgroundFocusedColor () : string; - getBackgroundFocusedImage () : string; - getBackgroundGradient () : Gradient; - getBackgroundImage () : string; - getBackgroundLeftCap () : number; - getBackgroundRepeat () : boolean; - getBackgroundSelectedColor () : string; - getBackgroundSelectedImage () : string; - getBackgroundTopCap () : number; - getBorderColor () : string; - getBorderRadius () : number; - getBorderWidth () : number; - getBottom () : any; - getCenter () : Point; - getChildren () : Array; - getClipMode () : number; - getEnabled () : boolean; - getFocusable () : boolean; - getHeight () : any; - getHorizontalWrap () : boolean; - getKeepScreenOn () : boolean; - getLayout () : string; - getLeft () : any; - getOpacity () : number; - getOverrideCurrentAnimation () : boolean; - getPullBackgroundColor () : string; - getRect () : Dimension; - getRight () : any; - getSize () : Dimension; - getSoftKeyboardOnFocus () : number; - getTintColor () : string; - getTop () : any; - getTouchEnabled () : boolean; - getTransform () : any; - getViewShadowColor () : string; - getViewShadowOffset () : Point; - getViewShadowRadius () : number; - getVisible () : boolean; - getWidth () : any; - getZIndex () : number; - hide () : void; - remove (view: Ti.UI.View) : void; - removeAllChildren () : void; - setAccessibilityHidden (accessibilityHidden: boolean) : void; - setAccessibilityHint (accessibilityHint: string) : void; - setAccessibilityLabel (accessibilityLabel: string) : void; - setAccessibilityValue (accessibilityValue: string) : void; - setAnchorPoint (anchorPoint: Point) : void; - setBackgroundColor (backgroundColor: string) : void; - setBackgroundDisabledColor (backgroundDisabledColor: string) : void; - setBackgroundDisabledImage (backgroundDisabledImage: string) : void; - setBackgroundFocusedColor (backgroundFocusedColor: string) : void; - setBackgroundFocusedImage (backgroundFocusedImage: string) : void; - setBackgroundGradient (backgroundGradient: Gradient) : void; - setBackgroundImage (backgroundImage: string) : void; - setBackgroundLeftCap (backgroundLeftCap: number) : void; - setBackgroundRepeat (backgroundRepeat: boolean) : void; - setBackgroundSelectedColor (backgroundSelectedColor: string) : void; - setBackgroundSelectedImage (backgroundSelectedImage: string) : void; - setBackgroundTopCap (backgroundTopCap: number) : void; - setBorderColor (borderColor: string) : void; - setBorderRadius (borderRadius: number) : void; - setBorderWidth (borderWidth: number) : void; - setBottom (bottom: number) : void; - setBottom (bottom: string) : void; - setCenter (center: Point) : void; - setClipMode (clipMode: number) : void; - setEnabled (enabled: boolean) : void; - setFocusable (focusable: boolean) : void; - setHeight (height: number) : void; - setHeight (height: string) : void; - setHorizontalWrap (horizontalWrap: boolean) : void; - setKeepScreenOn (keepScreenOn: boolean) : void; - setLayout (layout: string) : void; - setLeft (left: number) : void; - setLeft (left: string) : void; - setOpacity (opacity: number) : void; - setPullBackgroundColor (pullBackgroundColor: string) : void; - setRight (right: number) : void; - setRight (right: string) : void; - setSoftKeyboardOnFocus (softKeyboardOnFocus: number) : void; - setTintColor (tintColor: string) : void; - setTop (top: number) : void; - setTop (top: string) : void; - setTouchEnabled (touchEnabled: boolean) : void; - setTransform (transform: Ti.UI._2DMatrix) : void; - setTransform (transform: Ti.UI._3DMatrix) : void; - setViewShadowColor (viewShadowColor: string) : void; - setViewShadowOffset (viewShadowOffset: Point) : void; - setViewShadowRadius (viewShadowRadius: number) : void; - setVisible (visible: boolean) : void; - setWidth (width: number) : void; - setWidth (width: string) : void; - setZIndex (zIndex: number) : void; - show () : void; - startLayout () : void; - toImage (callback?: (...args : any[]) => any, honorScaleFactor?: boolean) : Ti.Blob; - updateLayout (params: Dictionary) : void; - } - export enum ActivityIndicatorStyle { - BIG, - BIG_DARK, - DARK, - PLAIN - } - export interface Switch extends Ti.UI.View { - color : string; - font : Font; - onTintColor : string; - style : number; - textAlign : any; - thumbTintColor : string; - tintColor : string; - title : string; - titleOff : string; - titleOn : string; - value : boolean; - verticalAlign : any; - getColor () : string; - getFont () : Font; - getOnTintColor () : string; - getStyle () : number; - getTextAlign () : any; - getThumbTintColor () : string; - getTitle () : string; - getTitleOff () : string; - getTitleOn () : string; - getValue () : boolean; - getVerticalAlign () : any; - setColor (color: string) : void; - setFont (font: Font) : void; - setOnTintColor (onTintColor: string) : void; - setStyle (style: number) : void; - setTextAlign (textAlign: string) : void; - setTextAlign (textAlign: number) : void; - setThumbTintColor (thumbTintColor: string) : void; - setTitle (title: string) : void; - setTitleOff (titleOff: string) : void; - setTitleOn (titleOn: string) : void; - setValue (value: boolean) : void; - setVerticalAlign (verticalAlign: number) : void; - setVerticalAlign (verticalAlign: string) : void; - } - export interface DashboardItem extends Ti.Proxy { - badge : number; - canDelete : boolean; - image : any; - selectedImage : any; - getBadge () : number; - getCanDelete () : boolean; - getImage () : any; - getSelectedImage () : any; - setBadge (badge: number) : void; - setCanDelete (canDelete: boolean) : void; - setImage (image: string) : void; - setImage (image: Ti.Blob) : void; - setSelectedImage (selectedImage: string) : void; - setSelectedImage (selectedImage: Ti.Blob) : void; - } - export interface Tab extends Ti.UI.View { - active : boolean; - activeIcon : string; - activeIconIsMask : any; - badge : string; - icon : string; - iconIsmask : any; - title : string; - titleid : string; - window : Ti.UI.Window; - close (window: Ti.UI.Window, options?: any) : void; - getActive () : boolean; - getActiveIcon () : string; - getActiveIconIsMask () : boolean; - getBadge () : string; - getIcon () : string; - getIconIsmask () : boolean; - getTitle () : string; - getTitleid () : string; - getWindow () : Ti.UI.Window; - open (window: Ti.UI.Window, options: any) : void; - setActive (active: boolean) : void; - setActiveIcon (activeIcon: string) : void; - setActiveIconIsMask (activeIconIsMask: boolean) : void; - setBadge (badge: string) : void; - setIcon (icon: string) : void; - setIconIsmask (iconIsmask: boolean) : void; - setTitle (title: string) : void; - setTitleid (titleid: string) : void; - setWindow (window: Ti.UI.Window) : void; - } - export interface TableViewRow extends Ti.UI.View { - className : string; - color : string; - editable : boolean; - font : Font; - hasCheck : boolean; - hasChild : boolean; - hasDetail : boolean; - indentionLevel : number; - leftImage : string; - moveable : boolean; - rightImage : string; - selectedBackgroundColor : string; - selectedBackgroundImage : string; - selectedColor : string; - selectionStyle : number; - title : string; - getClassName () : string; - getColor () : string; - getEditable () : boolean; - getFont () : Font; - getHasCheck () : boolean; - getHasChild () : boolean; - getHasDetail () : boolean; - getIndentionLevel () : number; - getLeftImage () : string; - getMoveable () : boolean; - getRightImage () : string; - getSelectedBackgroundColor () : string; - getSelectedBackgroundImage () : string; - getSelectedColor () : string; - getSelectionStyle () : number; - getTitle () : string; - setClassName (className: string) : void; - setColor (color: string) : void; - setEditable (editable: boolean) : void; - setFont (font: Font) : void; - setHasCheck (hasCheck: boolean) : void; - setHasChild (hasChild: boolean) : void; - setHasDetail (hasDetail: boolean) : void; - setIndentionLevel (indentionLevel: number) : void; - setLeftImage (leftImage: string) : void; - setMoveable (moveable: boolean) : void; - setRightImage (rightImage: string) : void; - setSelectedBackgroundColor (selectedBackgroundColor: string) : void; - setSelectedBackgroundImage (selectedBackgroundImage: string) : void; - setSelectedColor (selectedColor: string) : void; - setSelectionStyle (selectionStyle: number) : void; - setTitle (title: string) : void; - } - export interface PickerRow extends Ti.UI.View { - color : string; - font : Font; - fontSize : number; - title : string; - getColor () : string; - getFont () : Font; - getFontSize () : number; - getTitle () : string; - setColor (color: string) : void; - setFont (font: Font) : void; - setFontSize (fontSize: number) : void; - setTitle (title: string) : void; - } - export interface ButtonBar extends Ti.UI.View { - index : number; - labels : any; - style : number; - getIndex () : number; - getLabels () : any; - getStyle () : number; - setIndex (index: number) : void; - setLabels (labels: Array) : void; - setLabels (labels: Array) : void; - setStyle (style: number) : void; - } - export interface Slider extends Ti.UI.View { - disabledLeftTrackImage : string; - disabledRightTrackImage : string; - disabledThumbImage : string; - highlightedLeftTrackImage : string; - highlightedRightTrackImage : string; - highlightedThumbImage : string; - leftTrackImage : string; - leftTrackLeftCap : number; - leftTrackTopCap : number; - max : number; - maxRange : number; - min : number; - minRange : number; - rightTrackImage : string; - rightTrackLeftCap : number; - rightTrackTopCap : number; - selectedLeftTrackImage : string; - selectedRightTrackImage : string; - selectedThumbImage : string; - thumbImage : any; - value : string; - getDisabledLeftTrackImage () : string; - getDisabledRightTrackImage () : string; - getDisabledThumbImage () : string; - getHighlightedLeftTrackImage () : string; - getHighlightedRightTrackImage () : string; - getHighlightedThumbImage () : string; - getLeftTrackImage () : string; - getLeftTrackLeftCap () : number; - getLeftTrackTopCap () : number; - getMax () : number; - getMaxRange () : number; - getMin () : number; - getMinRange () : number; - getRightTrackImage () : string; - getRightTrackLeftCap () : number; - getRightTrackTopCap () : number; - getSelectedLeftTrackImage () : string; - getSelectedRightTrackImage () : string; - getSelectedThumbImage () : string; - getThumbImage () : any; - getValue () : string; - setDisabledLeftTrackImage (disabledLeftTrackImage: string) : void; - setDisabledRightTrackImage (disabledRightTrackImage: string) : void; - setDisabledThumbImage (disabledThumbImage: string) : void; - setHighlightedLeftTrackImage (highlightedLeftTrackImage: string) : void; - setHighlightedRightTrackImage (highlightedRightTrackImage: string) : void; - setHighlightedThumbImage (highlightedThumbImage: string) : void; - setLeftTrackImage (leftTrackImage: string) : void; - setLeftTrackLeftCap (leftTrackLeftCap: number) : void; - setLeftTrackTopCap (leftTrackTopCap: number) : void; - setMax (max: number) : void; - setMaxRange (maxRange: number) : void; - setMin (min: number) : void; - setMinRange (minRange: number) : void; - setRightTrackImage (rightTrackImage: string) : void; - setRightTrackLeftCap (rightTrackLeftCap: number) : void; - setRightTrackTopCap (rightTrackTopCap: number) : void; - setSelectedLeftTrackImage (selectedLeftTrackImage: string) : void; - setSelectedRightTrackImage (selectedRightTrackImage: string) : void; - setSelectedThumbImage (selectedThumbImage: string) : void; - setThumbImage (thumbImage: string) : void; - setThumbImage (thumbImage: Ti.Blob) : void; - setValue (value: number, options?: Dictionary) : void; - } - export module Android { - export var LINKIFY_ALL : number; - export var LINKIFY_EMAIL_ADDRESSES : number; - export var LINKIFY_MAP_ADDRESSES : number; - export var LINKIFY_PHONE_NUMBERS : number; - export var LINKIFY_WEB_URLS : number; - export var OVER_SCROLL_ALWAYS : number; - export var OVER_SCROLL_IF_CONTENT_SCROLLS : number; - export var OVER_SCROLL_NEVER : number; - export var PIXEL_FORMAT_A_8 : number; - export var PIXEL_FORMAT_LA_88 : number; - export var PIXEL_FORMAT_L_8 : number; - export var PIXEL_FORMAT_OPAQUE : number; - export var PIXEL_FORMAT_RGBA_4444 : number; - export var PIXEL_FORMAT_RGBA_5551 : number; - export var PIXEL_FORMAT_RGBA_8888 : number; - export var PIXEL_FORMAT_RGBX_8888 : number; - export var PIXEL_FORMAT_RGB_332 : number; - export var PIXEL_FORMAT_RGB_565 : number; - export var PIXEL_FORMAT_RGB_888 : number; - export var PIXEL_FORMAT_TRANSLUCENT : number; - export var PIXEL_FORMAT_TRANSPARENT : number; - export var PIXEL_FORMAT_UNKNOWN : number; - export var PROGRESS_INDICATOR_DETERMINANT : number; - export var PROGRESS_INDICATOR_DIALOG : number; - export var PROGRESS_INDICATOR_INDETERMINANT : number; - export var PROGRESS_INDICATOR_STATUS_BAR : number; - export var SOFT_INPUT_ADJUST_PAN : number; - export var SOFT_INPUT_ADJUST_RESIZE : number; - export var SOFT_INPUT_ADJUST_UNSPECIFIED : number; - export var SOFT_INPUT_STATE_ALWAYS_HIDDEN : number; - export var SOFT_INPUT_STATE_ALWAYS_VISIBLE : number; - export var SOFT_INPUT_STATE_HIDDEN : number; - export var SOFT_INPUT_STATE_UNSPECIFIED : number; - export var SOFT_INPUT_STATE_VISIBLE : number; - export var SOFT_KEYBOARD_DEFAULT_ON_FOCUS : number; - export var SOFT_KEYBOARD_HIDE_ON_FOCUS : number; - export var SOFT_KEYBOARD_SHOW_ON_FOCUS : number; - export var SWITCH_STYLE_CHECKBOX : number; - export var SWITCH_STYLE_TOGGLEBUTTON : number; - export var WEBVIEW_LOAD_CACHE_ELSE_NETWORK : number; - export var WEBVIEW_LOAD_CACHE_ONLY : number; - export var WEBVIEW_LOAD_DEFAULT : number; - export var WEBVIEW_LOAD_NO_CACHE : number; - export var WEBVIEW_PLUGINS_OFF : number; - export var WEBVIEW_PLUGINS_ON : number; - export var WEBVIEW_PLUGINS_ON_DEMAND : number; - export var apiName : string; - export var bubbleParent : boolean; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createProgressIndicator (parameters?: Dictionary) : Ti.UI.Android.ProgressIndicator; - export function createSearchView (parameters?: Dictionary) : Ti.UI.Android.SearchView; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function hideSoftKeyboard () : void; - export function openPreferences () : void; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface SearchView extends Ti.UI.View { - hintText : string; - iconified : boolean; - iconifiedByDefault : boolean; - submitEnabled : boolean; - value : string; - blur () : void; - focus () : void; - getHintText () : string; - getIconified () : boolean; - getIconifiedByDefault () : boolean; - getSubmitEnabled () : boolean; - getValue () : string; - setHintText (hintText: string) : void; - setIconified (iconified: boolean) : void; - setIconifiedByDefault (iconifiedByDefault: boolean) : void; - setSubmitEnabled (submitEnabled: boolean) : void; - setValue (value: string) : void; - } - export interface ProgressIndicator extends Ti.Proxy { - cancelable : boolean; - location : number; - max : number; - message : string; - messageid : string; - min : number; - type : number; - getCancelable () : boolean; - getLocation () : number; - getMax () : number; - getMessage () : string; - getMessageid () : string; - getMin () : number; - getType () : number; - hide () : void; - setCancelable (cancelable: boolean) : void; - setLocation (location: number) : void; - setMax (max: number) : void; - setMessage (message: string) : void; - setMessageid (messageid: string) : void; - setMin (min: number) : void; - setType (type: number) : void; - show () : void; - } - } - export interface DashboardView extends Ti.UI.View { - columnCount : number; - data : Array; - editable : boolean; - rowCount : number; - wobble : boolean; - getColumnCount () : number; - getData () : Array; - getEditable () : boolean; - getRowCount () : number; - getWobble () : boolean; - setData (data: Array) : void; - setEditable (editable: boolean) : void; - setWobble (wobble: boolean) : void; - startEditing () : void; - stopEditing () : void; - } - export interface ListItem extends Ti.Proxy { - accessoryType : number; - backgroundColor : string; - backgroundGradient : Gradient; - backgroundImage : string; - canEdit : boolean; - canMove : boolean; - color : string; - font : Font; - height : any; - image : string; - itemId : string; - searchableText : string; - selectedBackgroundColor : string; - selectedBackgroundGradient : Gradient; - selectedBackgroundImage : string; - selectionStyle : number; - subtitle : string; - title : string; - } - export interface AlertDialog extends Ti.Proxy { - androidView : Ti.UI.View; - buttonNames : Array; - cancel : number; - message : string; - messageid : string; - ok : string; - okid : string; - persistent : boolean; - style : number; - title : string; - titleid : string; - getAndroidView () : Ti.UI.View; - getButtonNames () : Array; - getCancel () : number; - getMessage () : string; - getOk () : string; - getPersistent () : boolean; - getStyle () : number; - getTitle () : string; - hide () : void; - setAndroidView (androidView: Ti.UI.View) : void; - setCancel (cancel: number) : void; - setMessage (message: string) : void; - setOk (ok: string) : void; - setPersistent (persistent: boolean) : void; - setStyle (style: number) : void; - setTitle (title: string) : void; - show () : void; - } - export interface _2DMatrix extends Ti.Proxy { - a : number; - b : number; - c : number; - d : number; - tx : number; - ty : number; - getA () : number; - getB () : number; - getC () : number; - getD () : number; - getTx () : number; - getTy () : number; - invert () : Ti.UI._2DMatrix; - multiply (t2: Ti.UI._2DMatrix) : Ti.UI._2DMatrix; - rotate (angle: number, toAngle?: number) : Ti.UI._2DMatrix; - scale (sx: number, sy: number, toSx?: number, toSy?: number) : Ti.UI._2DMatrix; - setA (a: number) : void; - setB (b: number) : void; - setC (c: number) : void; - setD (d: number) : void; - setTx (tx: number) : void; - setTy (ty: number) : void; - translate (tx: number, ty: number) : Ti.UI._2DMatrix; - } - export interface TabbedBar extends Ti.UI.View { - index : number; - labels : any; - style : number; - getIndex () : number; - getLabels () : any; - getStyle () : number; - setIndex (index: number) : void; - setLabels (labels: Array) : void; - setLabels (labels: Array) : void; - setStyle (style: number) : void; - } - export interface Window extends Ti.UI.View { - activity : Ti.Android.Activity; - autoAdjustScrollViewInsets : boolean; - backButtonTitle : string; - backButtonTitleImage : any; - barColor : string; - barImage : string; - exitOnClose : boolean; - extendEdges : Array; - flagSecure : boolean; - fullscreen : boolean; - hideShadow : boolean; - includeOpaqueBars : boolean; - leftNavButton : Ti.UI.View; - leftNavButtons : Array; - modal : boolean; - navBarHidden : boolean; - navTintColor : any; - orientation : number; - orientationModes : Array; - rightNavButton : Ti.UI.View; - rightNavButtons : Array; - shadowImage : string; - statusBarStyle : any; - tabBarHidden : boolean; - theme : string; - title : string; - titleAttributes : titleAttributesParams; - titleControl : Ti.UI.View; - titleImage : string; - titlePrompt : string; - titleid : string; - titlepromptid : string; - toolbar : Array; - transitionAnimation : Ti.Proxy; - translucent : boolean; - url : string; - windowFlags : number; - windowPixelFormat : number; - windowSoftInputMode : number; - close (params?: Dictionary) : void; - close (params?: closeWindowParams) : void; - getActivity () : Ti.Android.Activity; - getAutoAdjustScrollViewInsets () : boolean; - getBackButtonTitle () : string; - getBackButtonTitleImage () : any; - getBarColor () : string; - getBarImage () : string; - getExitOnClose () : boolean; - getExtendEdges () : Array; - getFlagSecure () : boolean; - getFullscreen () : boolean; - getHideShadow () : boolean; - getIncludeOpaqueBars () : boolean; - getLeftNavButton () : Ti.UI.View; - getLeftNavButtons () : Array; - getModal () : boolean; - getNavBarHidden () : boolean; - getNavTintColor () : string; - getOrientation () : number; - getOrientationModes () : Array; - getRightNavButton () : Ti.UI.View; - getRightNavButtons () : Array; - getShadowImage () : string; - getStatusBarStyle () : number; - getTabBarHidden () : boolean; - getTheme () : string; - getTitle () : string; - getTitleAttributes () : titleAttributesParams; - getTitleControl () : Ti.UI.View; - getTitleImage () : string; - getTitlePrompt () : string; - getTitleid () : string; - getTitlepromptid () : string; - getToolbar () : Array; - getTransitionAnimation () : Ti.Proxy; - getTranslucent () : boolean; - getUrl () : string; - getWindowFlags () : number; - getWindowPixelFormat () : number; - getWindowSoftInputMode () : number; - hideNavBar (options?: Dictionary) : void; - hideTabBar () : void; - open (params?: openWindowParams) : void; - setAutoAdjustScrollViewInsets (autoAdjustScrollViewInsets: boolean) : void; - setBackButtonTitle (backButtonTitle: string) : void; - setBackButtonTitleImage (backButtonTitleImage: string) : void; - setBackButtonTitleImage (backButtonTitleImage: Ti.Blob) : void; - setBarColor (barColor: string) : void; - setBarImage (barImage: string) : void; - setExitOnClose (exitOnClose: boolean) : void; - setExtendEdges (extendEdges: Array) : void; - setFullscreen (fullscreen: boolean) : void; - setHideShadow (hideShadow: boolean) : void; - setIncludeOpaqueBars (includeOpaqueBars: boolean) : void; - setLeftNavButton (leftNavButton: Ti.UI.View) : void; - setLeftNavButtons (leftNavButtons: Array) : void; - setModal (modal: boolean) : void; - setNavBarHidden (navBarHidden: boolean) : void; - setNavTintColor (navTintColor: string) : void; - setOrientationModes (orientationModes: Array) : void; - setRightNavButton (rightNavButton: Ti.UI.View) : void; - setRightNavButtons (rightNavButtons: Array) : void; - setShadowImage (shadowImage: string) : void; - setStatusBarStyle (statusBarStyle: number) : void; - setTabBarHidden (tabBarHidden: boolean) : void; - setTitle (title: string) : void; - setTitleAttributes (titleAttributes: titleAttributesParams) : void; - setTitleControl (titleControl: Ti.UI.View) : void; - setTitleImage (titleImage: string) : void; - setTitlePrompt (titlePrompt: string) : void; - setTitleid (titleid: string) : void; - setTitlepromptid (titlepromptid: string) : void; - setToolbar (items: Array, params?: windowToolbarParam) : void; - setTransitionAnimation (transitionAnimation: Ti.Proxy) : void; - setTranslucent (translucent: boolean) : void; - setWindowPixelFormat (windowPixelFormat: number) : void; - showNavBar (options?: Dictionary) : void; - } - export interface TextField extends Ti.UI.View { - appearance : number; - attributedHintText : Ti.UI.iOS.AttributedString; - attributedString : Ti.UI.iOS.AttributedString; - autoLink : number; - autocapitalization : number; - autocorrect : boolean; - borderStyle : number; - clearButtonMode : number; - clearOnEdit : boolean; - color : string; - editable : boolean; - ellipsize : boolean; - enableReturnKey : boolean; - font : Font; - hintText : string; - keyboardToolbar : any; - keyboardToolbarColor : string; - keyboardToolbarHeight : number; - keyboardType : number; - leftButton : any; - leftButtonMode : number; - leftButtonPadding : number; - maxLength : number; - minimumFontSize : number; - paddingLeft : number; - paddingRight : number; - passwordMask : boolean; - returnKeyType : number; - rightButton : any; - rightButtonMode : number; - rightButtonPadding : number; - selection : textFieldSelectedParams; - suppressReturn : boolean; - textAlign : any; - value : string; - verticalAlign : any; - blur () : void; - focus () : void; - getAppearance () : number; - getAttributedHintText () : Ti.UI.iOS.AttributedString; - getAttributedString () : Ti.UI.iOS.AttributedString; - getAutoLink () : number; - getAutocapitalization () : number; - getAutocorrect () : boolean; - getBorderStyle () : number; - getClearButtonMode () : number; - getClearOnEdit () : boolean; - getColor () : string; - getEditable () : boolean; - getEllipsize () : boolean; - getEnableReturnKey () : boolean; - getFont () : Font; - getHintText () : string; - getKeyboardToolbar () : any; - getKeyboardToolbarColor () : string; - getKeyboardToolbarHeight () : number; - getKeyboardType () : number; - getLeftButton () : any; - getLeftButtonMode () : number; - getLeftButtonPadding () : number; - getMaxLength () : number; - getMinimumFontSize () : number; - getPaddingLeft () : number; - getPaddingRight () : number; - getPasswordMask () : boolean; - getReturnKeyType () : number; - getRightButton () : any; - getRightButtonMode () : number; - getRightButtonPadding () : number; - getSelection () : textFieldSelectedParams; - getSuppressReturn () : boolean; - getTextAlign () : any; - getValue () : string; - getVerticalAlign () : any; - hasText () : boolean; - setAppearance (appearance: number) : void; - setAttributedHintText (attributedHintText: Ti.UI.iOS.AttributedString) : void; - setAttributedString (attributedString: Ti.UI.iOS.AttributedString) : void; - setAutoLink (autoLink: number) : void; - setAutocapitalization (autocapitalization: number) : void; - setAutocorrect (autocorrect: boolean) : void; - setBorderStyle (borderStyle: number) : void; - setClearButtonMode (clearButtonMode: number) : void; - setClearOnEdit (clearOnEdit: boolean) : void; - setColor (color: string) : void; - setEditable (editable: boolean) : void; - setEllipsize (ellipsize: boolean) : void; - setEnableReturnKey (enableReturnKey: boolean) : void; - setFont (font: Font) : void; - setHintText (hintText: string) : void; - setKeyboardToolbar (keyboardToolbar: Array) : void; - setKeyboardToolbar (keyboardToolbar: Ti.UI.iOS.Toolbar) : void; - setKeyboardToolbarColor (keyboardToolbarColor: string) : void; - setKeyboardToolbarHeight (keyboardToolbarHeight: number) : void; - setKeyboardType (keyboardType: number) : void; - setLeftButton (leftButton: any) : void; - setLeftButtonMode (leftButtonMode: number) : void; - setLeftButtonPadding (leftButtonPadding: number) : void; - setMaxLength (maxLength: number) : void; - setMinimumFontSize (minimumFontSize: number) : void; - setPaddingLeft (paddingLeft: number) : void; - setPaddingRight (paddingRight: number) : void; - setPasswordMask (passwordMask: boolean) : void; - setReturnKeyType (returnKeyType: number) : void; - setRightButton (rightButton: any) : void; - setRightButtonMode (rightButtonMode: number) : void; - setRightButtonPadding (rightButtonPadding: number) : void; - setSelection (start: number, end: number) : void; - setSuppressReturn (suppressReturn: boolean) : void; - setTextAlign (textAlign: string) : void; - setTextAlign (textAlign: number) : void; - setValue (value: string) : void; - setVerticalAlign (verticalAlign: number) : void; - setVerticalAlign (verticalAlign: string) : void; - } - export interface _3DMatrix extends Ti.Proxy { - m11 : number; - m12 : number; - m13 : number; - m14 : number; - m21 : number; - m22 : number; - m23 : number; - m24 : number; - m31 : number; - m32 : number; - m33 : number; - m34 : number; - m41 : number; - m42 : number; - m43 : number; - m44 : number; - getM11 () : number; - getM12 () : number; - getM13 () : number; - getM14 () : number; - getM21 () : number; - getM22 () : number; - getM23 () : number; - getM24 () : number; - getM31 () : number; - getM32 () : number; - getM33 () : number; - getM34 () : number; - getM41 () : number; - getM42 () : number; - getM43 () : number; - getM44 () : number; - invert () : Ti.UI._3DMatrix; - multiply (t2: Ti.UI._3DMatrix) : Ti.UI._3DMatrix; - rotate (angle: number, x: number, y: number, z: number) : Ti.UI._3DMatrix; - scale (sx: number, sy: number, sz: number) : Ti.UI._3DMatrix; - setM11 (m11: number) : void; - setM12 (m12: number) : void; - setM13 (m13: number) : void; - setM14 (m14: number) : void; - setM21 (m21: number) : void; - setM22 (m22: number) : void; - setM23 (m23: number) : void; - setM24 (m24: number) : void; - setM31 (m31: number) : void; - setM32 (m32: number) : void; - setM33 (m33: number) : void; - setM34 (m34: number) : void; - setM41 (m41: number) : void; - setM42 (m42: number) : void; - setM43 (m43: number) : void; - setM44 (m44: number) : void; - translate (tx: number, ty: number, tz: number) : Ti.UI._3DMatrix; - } - export interface WebView extends Ti.UI.View { - cacheMode : number; - data : any; - disableBounce : boolean; - enableZoomControls : boolean; - handlePlatformUrl : boolean; - hideLoadIndicator : boolean; - html : string; - ignoreSslError : boolean; - lightTouchEnabled : boolean; - loading : boolean; - onCreateWindow : (...args : any[]) => any; - overScrollMode : number; - pluginState : number; - scalesPageToFit : boolean; - scrollsToTop : boolean; - showScrollbars : boolean; - url : string; - userAgent : string; - willHandleTouches : boolean; - canGoBack () : boolean; - canGoForward () : boolean; - evalJS (code: string) : string; - getCacheMode () : number; - getData () : any; - getDisableBounce () : boolean; - getEnableZoomControls () : boolean; - getHandlePlatformUrl () : boolean; - getHideLoadIndicator () : boolean; - getHtml () : string; - getIgnoreSslError () : boolean; - getLightTouchEnabled () : boolean; - getLoading () : boolean; - getOnCreateWindow () : (...args : any[]) => any; - getOverScrollMode () : number; - getPluginState () : number; - getScalesPageToFit () : boolean; - getScrollsToTop () : boolean; - getShowScrollbars () : boolean; - getUrl () : string; - getUserAgent () : string; - getWillHandleTouches () : boolean; - goBack () : void; - goForward () : void; - pause () : void; - release () : void; - reload () : void; - repaint () : void; - resume () : void; - setBasicAuthentication (username: string, password: string) : void; - setCacheMode (cacheMode: number) : void; - setData (data: Ti.Blob) : void; - setData (data: Ti.Filesystem.File) : void; - setDisableBounce (disableBounce: boolean) : void; - setEnableZoomControls (enableZoomControls: boolean) : void; - setHandlePlatformUrl (handlePlatformUrl: boolean) : void; - setHideLoadIndicator (hideLoadIndicator: boolean) : void; - setHtml (html: any, options?: Dictionary) : void; - setIgnoreSslError (ignoreSslError: boolean) : void; - setLightTouchEnabled (lightTouchEnabled: boolean) : void; - setLoading (loading: boolean) : void; - setOnCreateWindow (onCreateWindow: (...args : any[]) => any) : void; - setOverScrollMode (overScrollMode: number) : void; - setPluginState (pluginState: number) : void; - setScalesPageToFit (scalesPageToFit: boolean) : void; - setScrollsToTop (scrollsToTop: boolean) : void; - setShowScrollbars (showScrollbars: boolean) : void; - setUrl (url: string) : void; - setUserAgent (userAgent: string) : void; - setWillHandleTouches (willHandleTouches: boolean) : void; - stopLoading (hardStop: boolean) : void; - } - export interface Clipboard { - clearData (type?: string) : void; - clearText () : void; - getData (type: string) : any; - getText () : string; - hasData (type: string) : boolean; - hasText () : any; - setData (type: string, data: any) : void; - setText (text: string) : void; - } - export interface ScrollableView extends Ti.UI.View { - cacheSize : number; - clipViews : boolean; - currentPage : number; - disableBounce : boolean; - hitRect : Dimension; - overScrollMode : number; - overlayEnabled : boolean; - pagingControlAlpha : number; - pagingControlColor : string; - pagingControlHeight : number; - pagingControlOnTop : boolean; - pagingControlTimeout : number; - scrollingEnabled : boolean; - showPagingControl : boolean; - views : Array; - addView (view: Ti.UI.View) : void; - getCacheSize () : number; - getClipViews () : boolean; - getCurrentPage () : number; - getDisableBounce () : boolean; - getHitRect () : Dimension; - getOverScrollMode () : number; - getOverlayEnabled () : boolean; - getPagingControlAlpha () : number; - getPagingControlColor () : string; - getPagingControlHeight () : number; - getPagingControlOnTop () : boolean; - getPagingControlTimeout () : number; - getScrollingEnabled () : boolean; - getShowPagingControl () : boolean; - getViews () : Array; - moveNext () : void; - movePrevious () : void; - removeView (view: number) : void; - removeView (view: Ti.UI.View) : void; - scrollToView (view: number) : void; - scrollToView (view: Ti.UI.View) : void; - setCacheSize (cacheSize: number) : void; - setCurrentPage (currentPage: number) : void; - setDisableBounce (disableBounce: boolean) : void; - setHitRect (hitRect: Dimension) : void; - setOverScrollMode (overScrollMode: number) : void; - setOverlayEnabled (overlayEnabled: boolean) : void; - setPagingControlAlpha (pagingControlAlpha: number) : void; - setPagingControlColor (pagingControlColor: string) : void; - setPagingControlHeight (pagingControlHeight: number) : void; - setPagingControlOnTop (pagingControlOnTop: boolean) : void; - setScrollingEnabled (scrollingEnabled: boolean) : void; - setShowPagingControl (showPagingControl: boolean) : void; - setViews (views: Array) : void; - } - export interface ListSection extends Ti.Proxy { - footerTitle : string; - footerView : Ti.UI.View; - headerTitle : string; - headerView : Ti.UI.View; - items : Array; - appendItems (dataItems: Array, animation?: ListViewAnimationProperties) : void; - deleteItemsAt (itemIndex: number, count: number, animation?: ListViewAnimationProperties) : void; - getFooterTitle () : string; - getFooterView () : Ti.UI.View; - getHeaderTitle () : string; - getHeaderView () : Ti.UI.View; - getItemAt (itemIndex: number) : ListDataItem; - getItems () : Array; - insertItemsAt (itemIndex: number, dataItems: Array, animation?: ListViewAnimationProperties) : void; - replaceItemsAt (index: number, count: number, dataItems: Array, animation?: ListViewAnimationProperties) : void; - setFooterTitle (footerTitle: string) : void; - setFooterView (footerView: Ti.UI.View) : void; - setHeaderTitle (headerTitle: string) : void; - setHeaderView (headerView: Ti.UI.View) : void; - setItems (dataItems: Array, animation?: ListViewAnimationProperties) : void; - updateItemAt (index: number, dataItem: ListDataItem, animation?: ListViewAnimationProperties) : void; - } - export interface ScrollView extends Ti.UI.View { - canCancelEvents : boolean; - contentHeight : any; - contentOffset : Dictionary; - contentWidth : any; - decelerationRate : number; - disableBounce : boolean; - horizontalBounce : boolean; - maxZoomScale : number; - minZoomScale : number; - overScrollMode : number; - scrollIndicatorStyle : number; - scrollType : string; - scrollingEnabled : boolean; - scrollsToTop : boolean; - showHorizontalScrollIndicator : boolean; - showVerticalScrollIndicator : boolean; - verticalBounce : boolean; - zoomScale : number; - getCanCancelEvents () : boolean; - getContentHeight () : any; - getContentOffset () : Dictionary; - getContentWidth () : any; - getDecelerationRate () : number; - getDisableBounce () : boolean; - getHorizontalBounce () : boolean; - getMaxZoomScale () : number; - getMinZoomScale () : number; - getOverScrollMode () : number; - getScrollIndicatorStyle () : number; - getScrollType () : string; - getScrollingEnabled () : boolean; - getScrollsToTop () : boolean; - getShowHorizontalScrollIndicator () : boolean; - getShowVerticalScrollIndicator () : boolean; - getVerticalBounce () : boolean; - getZoomScale () : number; - scrollTo (x: number, y: number) : void; - scrollToBottom () : void; - setCanCancelEvents (canCancelEvents: boolean) : void; - setContentHeight (contentHeight: number) : void; - setContentHeight (contentHeight: string) : void; - setContentOffset (contentOffset: Dictionary, animated?: contentOffsetOption) : void; - setContentWidth (contentWidth: number) : void; - setContentWidth (contentWidth: string) : void; - setDecelerationRate (decelerationRate: number) : void; - setDisableBounce (disableBounce: boolean) : void; - setHorizontalBounce (horizontalBounce: boolean) : void; - setMaxZoomScale (maxZoomScale: number) : void; - setMinZoomScale (minZoomScale: number) : void; - setOverScrollMode (overScrollMode: number) : void; - setScrollIndicatorStyle (scrollIndicatorStyle: number) : void; - setScrollingEnabled (scrollingEnabled: boolean) : void; - setScrollsToTop (scrollsToTop: boolean) : void; - setShowHorizontalScrollIndicator (showHorizontalScrollIndicator: boolean) : void; - setShowVerticalScrollIndicator (showVerticalScrollIndicator: boolean) : void; - setVerticalBounce (verticalBounce: boolean) : void; - setZoomScale (zoomScale: number, animated?: zoomScaleOption) : void; - } - export interface ListView extends Ti.UI.View { - allowsSelection : boolean; - canScroll : boolean; - caseInsensitiveSearch : boolean; - defaultItemTemplate : any; - editing : boolean; - footerDividersEnabled : boolean; - footerTitle : string; - footerView : Ti.UI.View; - headerDividersEnabled : boolean; - headerTitle : string; - headerView : Ti.UI.View; - keepSectionsInSearch : boolean; - pruneSectionsOnEdit : boolean; - pullView : Ti.UI.View; - refreshControl : Ti.UI.RefreshControl; - scrollIndicatorStyle : number; - searchText : string; - searchView : any; - sectionCount : number; - sectionIndexTitles : Array; - sections : Array; - separatorColor : string; - separatorInsets : Dictionary; - separatorStyle : number; - showVerticalScrollIndicator : boolean; - style : number; - templates : Dictionary; - willScrollOnStatusTap : boolean; - appendSection (section: Ti.UI.ListSection, animation?: ListViewAnimationProperties) : void; - appendSection (section: Array, animation?: ListViewAnimationProperties) : void; - deleteSectionAt (sectionIndex: number, animation?: ListViewAnimationProperties) : void; - deselectItem (sectionIndex: number, itemIndex: number) : void; - getAllowsSelection () : boolean; - getCanScroll () : boolean; - getCaseInsensitiveSearch () : boolean; - getDefaultItemTemplate () : any; - getEditing () : boolean; - getFooterDividersEnabled () : boolean; - getFooterTitle () : string; - getFooterView () : Ti.UI.View; - getHeaderDividersEnabled () : boolean; - getHeaderTitle () : string; - getHeaderView () : Ti.UI.View; - getKeepSectionsInSearch () : boolean; - getPruneSectionsOnEdit () : boolean; - getPullView () : Ti.UI.View; - getRefreshControl () : Ti.UI.RefreshControl; - getScrollIndicatorStyle () : number; - getSearchText () : string; - getSearchView () : any; - getSectionCount () : number; - getSectionIndexTitles () : Array; - getSections () : Array; - getSeparatorColor () : string; - getSeparatorInsets () : Dictionary; - getSeparatorStyle () : number; - getShowVerticalScrollIndicator () : boolean; - getStyle () : number; - getTemplates () : Dictionary; - getWillScrollOnStatusTap () : boolean; - insertSectionAt (sectionIndex: number, section: Ti.UI.ListSection, animation?: ListViewAnimationProperties) : void; - insertSectionAt (sectionIndex: number, section: Array, animation?: ListViewAnimationProperties) : void; - replaceSectionAt (sectionIndex: number, section: Ti.UI.ListSection, animation: ListViewAnimationProperties) : void; - scrollToItem (sectionIndex: number, itemIndex: number, animation?: ListViewAnimationProperties) : void; - selectItem (sectionIndex: number, itemIndex: number) : void; - setAllowsSelection (allowsSelection: boolean) : void; - setCanScroll (canScroll: boolean) : void; - setCaseInsensitiveSearch (caseInsensitiveSearch: boolean) : void; - setContentInsets (edgeInsets: ListViewEdgeInsets, animated?: ListViewContentInsetOption) : void; - setDefaultItemTemplate (defaultItemTemplate: string) : void; - setDefaultItemTemplate (defaultItemTemplate: number) : void; - setEditing (editing: boolean) : void; - setFooterTitle (footerTitle: string) : void; - setFooterView (footerView: Ti.UI.View) : void; - setHeaderTitle (headerTitle: string) : void; - setHeaderView (headerView: Ti.UI.View) : void; - setKeepSectionsInSearch (keepSectionsInSearch: boolean) : void; - setMarker (markerProps: ListViewMarkerProps) : void; - setPruneSectionsOnEdit (pruneSectionsOnEdit: boolean) : void; - setPullView (pullView: Ti.UI.View) : void; - setRefreshControl (refreshControl: Ti.UI.RefreshControl) : void; - setScrollIndicatorStyle (scrollIndicatorStyle: number) : void; - setSearchText (searchText: string) : void; - setSearchView (searchView: Ti.UI.SearchBar) : void; - setSearchView (searchView: Ti.UI.Android.SearchView) : void; - setSectionIndexTitles (sectionIndexTitles: Array) : void; - setSections (sections: Array) : void; - setSeparatorColor (separatorColor: string) : void; - setSeparatorInsets (separatorInsets: Dictionary) : void; - setSeparatorStyle (separatorStyle: number) : void; - setShowVerticalScrollIndicator (showVerticalScrollIndicator: boolean) : void; - setWillScrollOnStatusTap (willScrollOnStatusTap: boolean) : void; - } - export interface TabGroup extends Ti.UI.View { - activeTab : Ti.UI.Tab; - activeTabBackgroundColor : string; - activeTabBackgroundDisabledColor : string; - activeTabBackgroundDisabledImage : string; - activeTabBackgroundFocusedColor : string; - activeTabBackgroundFocusedImage : string; - activeTabBackgroundImage : string; - activeTabBackgroundSelectedColor : string; - activeTabBackgroundSelectedImage : string; - activeTabIconTint : string; - activity : Ti.Android.Activity; - allowUserCustomization : boolean; - barColor : string; - editButtonTitle : string; - exitOnClose : boolean; - navBarHidden : boolean; - navTintColor : any; - shadowImage : string; - tabDividerColor : string; - tabDividerWidth : any; - tabHeight : any; - tabs : Array; - tabsAtBottom : boolean; - tabsBackgroundColor : string; - tabsBackgroundDisabledColor : string; - tabsBackgroundDisabledImage : string; - tabsBackgroundFocusedColor : string; - tabsBackgroundFocusedImage : string; - tabsBackgroundImage : string; - tabsBackgroundSelectedColor : string; - tabsBackgroundSelectedImage : string; - tabsTintColor : any; - title : string; - titleAttributes : titleAttributesParams; - translucent : boolean; - windowSoftInputMode : number; - addTab (tab: Ti.UI.Tab) : void; - close () : void; - getActiveTab () : Ti.UI.Tab; - getActiveTabBackgroundColor () : string; - getActiveTabBackgroundDisabledColor () : string; - getActiveTabBackgroundDisabledImage () : string; - getActiveTabBackgroundFocusedColor () : string; - getActiveTabBackgroundFocusedImage () : string; - getActiveTabBackgroundImage () : string; - getActiveTabBackgroundSelectedColor () : string; - getActiveTabBackgroundSelectedImage () : string; - getActiveTabIconTint () : string; - getActivity () : Ti.Android.Activity; - getAllowUserCustomization () : boolean; - getBarColor () : string; - getEditButtonTitle () : string; - getExitOnClose () : boolean; - getNavBarHidden () : boolean; - getNavTintColor () : string; - getShadowImage () : string; - getTabDividerColor () : string; - getTabDividerWidth () : any; - getTabHeight () : any; - getTabs () : Array; - getTabsAtBottom () : boolean; - getTabsBackgroundColor () : string; - getTabsBackgroundDisabledColor () : string; - getTabsBackgroundDisabledImage () : string; - getTabsBackgroundFocusedColor () : string; - getTabsBackgroundFocusedImage () : string; - getTabsBackgroundImage () : string; - getTabsBackgroundSelectedColor () : string; - getTabsBackgroundSelectedImage () : string; - getTabsTintColor () : string; - getTitle () : string; - getTitleAttributes () : titleAttributesParams; - getTranslucent () : boolean; - getWindowSoftInputMode () : number; - open () : void; - removeTab (tab: Ti.UI.Tab) : void; - setActiveTab (indexOrObject: number) : void; - setActiveTab (indexOrObject: Ti.UI.Tab) : void; - setActiveTabBackgroundColor (activeTabBackgroundColor: string) : void; - setActiveTabBackgroundDisabledColor (activeTabBackgroundDisabledColor: string) : void; - setActiveTabBackgroundDisabledImage (activeTabBackgroundDisabledImage: string) : void; - setActiveTabBackgroundFocusedColor (activeTabBackgroundFocusedColor: string) : void; - setActiveTabBackgroundFocusedImage (activeTabBackgroundFocusedImage: string) : void; - setActiveTabBackgroundImage (activeTabBackgroundImage: string) : void; - setActiveTabBackgroundSelectedColor (activeTabBackgroundSelectedColor: string) : void; - setActiveTabBackgroundSelectedImage (activeTabBackgroundSelectedImage: string) : void; - setActiveTabIconTint (activeTabIconTint: string) : void; - setAllowUserCustomization (allowUserCustomization: boolean) : void; - setBarColor (barColor: string) : void; - setEditButtonTitle (editButtonTitle: string) : void; - setExitOnClose (exitOnClose: boolean) : void; - setNavBarHidden (navBarHidden: boolean) : void; - setNavTintColor (navTintColor: string) : void; - setShadowImage (shadowImage: string) : void; - setTabDividerColor (tabDividerColor: string) : void; - setTabDividerWidth (tabDividerWidth: number) : void; - setTabDividerWidth (tabDividerWidth: string) : void; - setTabHeight (tabHeight: number) : void; - setTabHeight (tabHeight: string) : void; - setTabs (tabs: Array) : void; - setTabsAtBottom (tabsAtBottom: boolean) : void; - setTabsBackgroundColor (tabsBackgroundColor: string) : void; - setTabsBackgroundDisabledColor (tabsBackgroundDisabledColor: string) : void; - setTabsBackgroundDisabledImage (tabsBackgroundDisabledImage: string) : void; - setTabsBackgroundFocusedColor (tabsBackgroundFocusedColor: string) : void; - setTabsBackgroundFocusedImage (tabsBackgroundFocusedImage: string) : void; - setTabsBackgroundImage (tabsBackgroundImage: string) : void; - setTabsBackgroundSelectedColor (tabsBackgroundSelectedColor: string) : void; - setTabsBackgroundSelectedImage (tabsBackgroundSelectedImage: string) : void; - setTabsTintColor (tabsTintColor: string) : void; - setTitle (title: string) : void; - setTitleAttributes (titleAttributes: titleAttributesParams) : void; - setTranslucent (translucent: boolean) : void; - } - export interface TableView extends Ti.UI.View { - allowsSelection : boolean; - allowsSelectionDuringEditing : boolean; - data : any; - editable : boolean; - editing : boolean; - filterAnchored : boolean; - filterAttribute : string; - filterCaseInsensitive : boolean; - footerDividersEnabled : boolean; - footerTitle : string; - footerView : Ti.UI.View; - headerDividersEnabled : boolean; - headerPullView : Ti.UI.View; - headerTitle : string; - headerView : Ti.UI.View; - hideSearchOnSelection : boolean; - index : Array; - maxRowHeight : number; - minRowHeight : number; - moveable : boolean; - moving : boolean; - overScrollMode : number; - refreshControl : Ti.UI.RefreshControl; - rowHeight : number; - scrollIndicatorStyle : number; - scrollable : boolean; - scrollsToTop : boolean; - search : any; - searchAsChild : boolean; - searchHidden : boolean; - sectionCount : number; - sections : Array; - separatorColor : string; - separatorInsets : Dictionary; - separatorStyle : number; - showVerticalScrollIndicator : boolean; - style : number; - appendRow (row: Ti.UI.TableViewRow, animation?: TableViewAnimationProperties) : void; - appendRow (row: Dictionary, animation?: TableViewAnimationProperties) : void; - appendRow (row: Array, animation?: TableViewAnimationProperties) : void; - appendRow (row: Array>, animation?: TableViewAnimationProperties) : void; - appendSection (section: Ti.UI.TableViewSection, animation?: TableViewAnimationProperties) : void; - appendSection (section: Dictionary, animation?: TableViewAnimationProperties) : void; - appendSection (section: Array, animation?: TableViewAnimationProperties) : void; - appendSection (section: Array>, animation?: TableViewAnimationProperties) : void; - deleteRow (row: number, animation?: TableViewAnimationProperties) : void; - deleteRow (row: Ti.UI.TableViewRow, animation?: TableViewAnimationProperties) : void; - deleteSection (section: number, animation?: TableViewAnimationProperties) : void; - deselectRow (row: number) : void; - getAllowsSelection () : boolean; - getAllowsSelectionDuringEditing () : boolean; - getData () : any; - getEditable () : boolean; - getEditing () : boolean; - getFilterAnchored () : boolean; - getFilterAttribute () : string; - getFilterCaseInsensitive () : boolean; - getFooterDividersEnabled () : boolean; - getFooterTitle () : string; - getFooterView () : Ti.UI.View; - getHeaderDividersEnabled () : boolean; - getHeaderPullView () : Ti.UI.View; - getHeaderTitle () : string; - getHeaderView () : Ti.UI.View; - getHideSearchOnSelection () : boolean; - getIndex () : Array; - getMaxRowHeight () : number; - getMinRowHeight () : number; - getMoveable () : boolean; - getMoving () : boolean; - getOverScrollMode () : number; - getRefreshControl () : Ti.UI.RefreshControl; - getRowHeight () : number; - getScrollIndicatorStyle () : number; - getScrollable () : boolean; - getScrollsToTop () : boolean; - getSearch () : any; - getSearchAsChild () : boolean; - getSearchHidden () : boolean; - getSectionCount () : number; - getSections () : Array; - getSeparatorColor () : string; - getSeparatorInsets () : Dictionary; - getSeparatorStyle () : number; - getShowVerticalScrollIndicator () : boolean; - getStyle () : number; - insertRowAfter (index: number, row: Ti.UI.TableViewRow, animation?: TableViewAnimationProperties) : void; - insertRowAfter (index: number, row: Dictionary, animation?: TableViewAnimationProperties) : void; - insertRowBefore (index: number, row: Ti.UI.TableViewRow, animation?: TableViewAnimationProperties) : void; - insertRowBefore (index: number, row: Dictionary, animation?: TableViewAnimationProperties) : void; - insertSectionAfter (index: number, section: Ti.UI.TableViewSection, animation?: TableViewAnimationProperties) : void; - insertSectionAfter (index: number, section: Dictionary, animation?: TableViewAnimationProperties) : void; - insertSectionBefore (index: number, section: Ti.UI.TableViewSection, animation?: TableViewAnimationProperties) : void; - insertSectionBefore (index: number, section: Dictionary, animation?: TableViewAnimationProperties) : void; - scrollToIndex (index: number, animation?: TableViewAnimationProperties) : void; - scrollToTop (top: number, animation?: TableViewAnimationProperties) : void; - selectRow (row: number) : void; - setAllowsSelection (allowsSelection: boolean) : void; - setAllowsSelectionDuringEditing (allowsSelectionDuringEditing: boolean) : void; - setContentInsets (edgeInsets: TableViewEdgeInsets, animated?: TableViewContentInsetOption) : void; - setData (data: Array, animation: TableViewAnimationProperties) : void; - setData (data: Array>, animation: TableViewAnimationProperties) : void; - setData (data: Array, animation: TableViewAnimationProperties) : void; - setEditable (editable: boolean) : void; - setEditing (editing: boolean) : void; - setFilterAnchored (filterAnchored: boolean) : void; - setFilterAttribute (filterAttribute: string) : void; - setFilterCaseInsensitive (filterCaseInsensitive: boolean) : void; - setFooterTitle (footerTitle: string) : void; - setFooterView (footerView: Ti.UI.View) : void; - setHeaderPullView (view: Ti.UI.View) : void; - setHeaderTitle (headerTitle: string) : void; - setHeaderView (headerView: Ti.UI.View) : void; - setHideSearchOnSelection (hideSearchOnSelection: boolean) : void; - setIndex (index: Array) : void; - setMaxRowHeight (maxRowHeight: number) : void; - setMinRowHeight (minRowHeight: number) : void; - setMoveable (moveable: boolean) : void; - setMoving (moving: boolean) : void; - setOverScrollMode (overScrollMode: number) : void; - setRefreshControl (refreshControl: Ti.UI.RefreshControl) : void; - setRowHeight (rowHeight: number) : void; - setScrollIndicatorStyle (scrollIndicatorStyle: number) : void; - setScrollable (scrollable: boolean) : void; - setScrollsToTop (scrollsToTop: boolean) : void; - setSearch (search: Ti.UI.SearchBar) : void; - setSearch (search: Ti.UI.Android.SearchView) : void; - setSearchAsChild (searchAsChild: boolean) : void; - setSearchHidden (searchHidden: boolean) : void; - setSections (sections: Array) : void; - setSeparatorColor (separatorColor: string) : void; - setSeparatorInsets (separatorInsets: Dictionary) : void; - setSeparatorStyle (separatorStyle: number) : void; - setShowVerticalScrollIndicator (showVerticalScrollIndicator: boolean) : void; - setStyle (style: number) : void; - updateRow (index: number, row: Ti.UI.TableViewRow, animation: TableViewAnimationProperties) : void; - updateSection (index: number, section: Ti.UI.TableViewSection, animation: TableViewAnimationProperties) : void; - } - export interface Button extends Ti.UI.View { - color : string; - disabledColor : string; - font : Font; - image : any; - selectedColor : string; - shadowColor : string; - shadowOffset : Dictionary; - shadowRadius : number; - style : number; - systemButton : number; - textAlign : any; - title : string; - titleid : string; - verticalAlign : any; - getColor () : string; - getDisabledColor () : string; - getFont () : Font; - getImage () : any; - getSelectedColor () : string; - getShadowColor () : string; - getShadowOffset () : Dictionary; - getShadowRadius () : number; - getStyle () : number; - getSystemButton () : number; - getTextAlign () : any; - getTitle () : string; - getTitleid () : string; - getVerticalAlign () : any; - setColor (color: string) : void; - setDisabledColor (disabledColor: string) : void; - setFont (font: Font) : void; - setImage (image: string) : void; - setImage (image: Ti.Blob) : void; - setSelectedColor (selectedColor: string) : void; - setShadowColor (shadowColor: string) : void; - setShadowOffset (shadowOffset: Dictionary) : void; - setShadowRadius (shadowRadius: number) : void; - setStyle (style: number) : void; - setSystemButton (systemButton: number) : void; - setTextAlign (textAlign: string) : void; - setTextAlign (textAlign: number) : void; - setTitle (title: string) : void; - setTitleid (titleid: string) : void; - setVerticalAlign (verticalAlign: number) : void; - setVerticalAlign (verticalAlign: string) : void; - } - export interface OptionDialog extends Ti.Proxy { - androidView : Ti.UI.View; - buttonNames : Array; - cancel : number; - destructive : number; - opaquebackground : boolean; - options : Array; - persistent : boolean; - selectedIndex : number; - title : string; - titleid : string; - getAndroidView () : Ti.UI.View; - getButtonNames () : Array; - getCancel () : number; - getDestructive () : number; - getOpaquebackground () : boolean; - getOptions () : Array; - getPersistent () : boolean; - getSelectedIndex () : number; - getTitle () : string; - getTitleid () : string; - hide (params?: hideParams) : void; - setAndroidView (androidView: Ti.UI.View) : void; - setCancel (cancel: number) : void; - setOpaquebackground (opaquebackground: boolean) : void; - setPersistent (persistent: boolean) : void; - setTitle (title: string) : void; - setTitleid (titleid: string) : void; - show (params?: showParams) : void; - } - export interface RefreshControl extends Ti.Proxy { - tintColor : string; - title : Ti.UI.iOS.AttributedString; - beginRefreshing () : void; - endRefreshing () : void; - getTintColor () : string; - getTitle () : Ti.UI.iOS.AttributedString; - setTintColor (tintColor: string) : void; - setTitle (title: Ti.UI.iOS.AttributedString) : void; - } - export interface EmailDialog extends Ti.Proxy { - CANCELLED : number; - FAILED : number; - SAVED : number; - SENT : number; - barColor : string; - bccRecipients : Array; - ccRecipients : Array; - html : boolean; - messageBody : string; - subject : string; - toRecipients : Array; - addAttachment (attachment: Ti.Blob) : void; - addAttachment (attachment: Ti.Filesystem.File) : void; - getBarColor () : string; - getBccRecipients () : Array; - getCcRecipients () : Array; - getHtml () : boolean; - getMessageBody () : string; - getSubject () : string; - getToRecipients () : Array; - isSupported () : boolean; - open (properties: any) : void; - setBarColor (barColor: string) : void; - setBccRecipients (bccRecipients: Array) : void; - setCcRecipients (ccRecipients: Array) : void; - setHtml (html: boolean) : void; - setMessageBody (messageBody: string) : void; - setSubject (subject: string) : void; - setToRecipients (toRecipients: Array) : void; - } - export interface CoverFlowView extends Ti.UI.View { - images : any; - selected : number; - getImages () : any; - getSelected () : number; - setImage (index: number, image: string) : void; - setImage (image: Ti.Blob) : void; - setImage (image: Ti.Filesystem.File) : void; - setImage (index: number, image: CoverFlowImageType) : void; - setImages (images: Array) : void; - setImages (images: Array) : void; - setImages (images: Array) : void; - setImages (images: Array) : void; - setSelected (selected: number) : void; - } - export interface ImageView extends Ti.UI.View { - animating : boolean; - autorotate : boolean; - decodeRetries : number; - defaultImage : string; - duration : number; - enableZoomControls : boolean; - hires : boolean; - image : any; - images : any; - paused : boolean; - preventDefaultImage : boolean; - repeatCount : number; - reverse : boolean; - url : string; - getAnimating () : boolean; - getAutorotate () : boolean; - getDecodeRetries () : number; - getDefaultImage () : string; - getDuration () : number; - getEnableZoomControls () : boolean; - getHires () : boolean; - getImage () : any; - getImages () : any; - getPaused () : boolean; - getPreventDefaultImage () : boolean; - getRepeatCount () : number; - getReverse () : boolean; - getUrl () : string; - pause () : void; - resume () : void; - setDecodeRetries (decodeRetries: number) : void; - setDefaultImage (defaultImage: string) : void; - setDuration (duration: number) : void; - setEnableZoomControls (enableZoomControls: boolean) : void; - setHires (hires: boolean) : void; - setImage (image: string) : void; - setImage (image: Ti.Blob) : void; - setImage (image: Ti.Filesystem.File) : void; - setImages (images: Array) : void; - setImages (images: Array) : void; - setImages (images: Array) : void; - setPreventDefaultImage (preventDefaultImage: boolean) : void; - setRepeatCount (repeatCount: number) : void; - setReverse (reverse: boolean) : void; - setUrl (url: string) : void; - start () : void; - stop () : void; - toBlob () : void; - } - export interface MaskedImage extends Ti.UI.View { - image : string; - mask : string; - mode : number; - tint : string; - getImage () : string; - getMask () : string; - getMode () : number; - getTint () : string; - setImage (image: string) : void; - setMask (mask: string) : void; - setMode (mode: number) : void; - setTint (tint: string) : void; - } - export interface ProgressBar extends Ti.UI.View { - color : string; - font : Font; - max : number; - message : string; - min : number; - style : number; - value : number; - getColor () : string; - getFont () : Font; - getMax () : number; - getMessage () : string; - getMin () : number; - getStyle () : number; - getValue () : number; - setColor (color: string) : void; - setFont (font: Font) : void; - setMax (max: number) : void; - setMessage (message: string) : void; - setMin (min: number) : void; - setStyle (style: number) : void; - setValue (value: number) : void; - } - export module MobileWeb { - export var apiName : string; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createNavigationGroup (parameters?: Dictionary) : Ti.UI.MobileWeb.NavigationGroup; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export enum TableViewSeparatorStyle { - NONE, - SINGLE_LINE - } - export interface NavigationGroup extends Ti.UI.View { - navBarAtTop : boolean; - window : Ti.UI.Window; - close (window: Ti.UI.Window, options: Dictionary) : void; - getNavBarAtTop () : boolean; - getWindow () : Ti.UI.Window; - open (window: Ti.UI.Window, options: Dictionary) : void; - setNavBarAtTop (navBarAtTop: boolean) : void; - } - } - export interface Label extends Ti.UI.View { - attributedString : Ti.UI.iOS.AttributedString; - autoLink : number; - backgroundPaddingBottom : number; - backgroundPaddingLeft : number; - backgroundPaddingRight : number; - backgroundPaddingTop : number; - color : string; - ellipsize : boolean; - font : Font; - highlightedColor : string; - html : string; - includeFontPadding : boolean; - minimumFontSize : number; - shadowColor : string; - shadowOffset : Dictionary; - shadowRadius : number; - text : string; - textAlign : any; - textid : string; - verticalAlign : any; - wordWrap : boolean; - getAttributedString () : Ti.UI.iOS.AttributedString; - getAutoLink () : number; - getBackgroundPaddingBottom () : number; - getBackgroundPaddingLeft () : number; - getBackgroundPaddingRight () : number; - getBackgroundPaddingTop () : number; - getColor () : string; - getEllipsize () : boolean; - getFont () : Font; - getHighlightedColor () : string; - getHtml () : string; - getIncludeFontPadding () : boolean; - getMinimumFontSize () : number; - getShadowColor () : string; - getShadowOffset () : Dictionary; - getShadowRadius () : number; - getText () : string; - getTextAlign () : any; - getTextid () : string; - getVerticalAlign () : any; - getWordWrap () : boolean; - setAttributedString (attributedString: Ti.UI.iOS.AttributedString) : void; - setAutoLink (autoLink: number) : void; - setBackgroundPaddingBottom (backgroundPaddingBottom: number) : void; - setBackgroundPaddingLeft (backgroundPaddingLeft: number) : void; - setBackgroundPaddingRight (backgroundPaddingRight: number) : void; - setBackgroundPaddingTop (backgroundPaddingTop: number) : void; - setColor (color: string) : void; - setEllipsize (ellipsize: boolean) : void; - setFont (font: Font) : void; - setHighlightedColor (highlightedColor: string) : void; - setHtml (html: string) : void; - setIncludeFontPadding (includeFontPadding: boolean) : void; - setMinimumFontSize (minimumFontSize: number) : void; - setShadowColor (shadowColor: string) : void; - setShadowOffset (shadowOffset: Dictionary) : void; - setShadowRadius (shadowRadius: number) : void; - setText (text: string) : void; - setTextAlign (textAlign: string) : void; - setTextAlign (textAlign: number) : void; - setTextid (textid: string) : void; - setVerticalAlign (verticalAlign: number) : void; - setVerticalAlign (verticalAlign: string) : void; - setWordWrap (wordWrap: boolean) : void; - } - export interface SearchBar extends Ti.UI.View { - autocapitalization : number; - autocorrect : boolean; - barColor : string; - hintText : string; - hinttextid : string; - keyboardType : number; - prompt : string; - promptid : string; - showBookmark : boolean; - showCancel : boolean; - value : string; - blur () : void; - focus () : void; - getAutocapitalization () : number; - getAutocorrect () : boolean; - getBarColor () : string; - getHintText () : string; - getHinttextid () : string; - getKeyboardType () : number; - getPrompt () : string; - getPromptid () : string; - getShowBookmark () : boolean; - getShowCancel () : boolean; - getValue () : string; - setAutocapitalization (autocapitalization: number) : void; - setAutocorrect (autocorrect: boolean) : void; - setBarColor (barColor: string) : void; - setHintText (hintText: string) : void; - setHinttextid (hinttextid: string) : void; - setKeyboardType (keyboardType: number) : void; - setPrompt (prompt: string) : void; - setPromptid (promptid: string) : void; - setShowBookmark (showBookmark: boolean) : void; - setShowCancel (showCancel: boolean, animated?: Dictionary) : void; - setValue (value: string) : void; - } - export interface SMSDialog extends Ti.Proxy { - CANCELLED : number; - FAILED : number; - SENT : number; - messageBody : string; - toRecipients : Array; - getMessageBody () : string; - getToRecipients () : Array; - isSupported () : boolean; - open () : void; - setMessageBody (messageBody: string) : void; - setToRecipients (toRecipients: Array) : void; - } - export interface TableViewSection extends Ti.Proxy { - footerTitle : string; - footerView : Ti.UI.View; - headerTitle : string; - headerView : Ti.UI.View; - rowCount : number; - rows : Array; - add (row: Ti.UI.TableViewRow) : void; - getFooterTitle () : string; - getFooterView () : Ti.UI.View; - getHeaderTitle () : string; - getHeaderView () : Ti.UI.View; - getRowCount () : number; - getRows () : Array; - remove (row: Ti.UI.TableViewRow) : void; - rowAtIndex (index: number) : Ti.UI.TableViewRow; - setFooterTitle (footerTitle: string) : void; - setFooterView (footerView: Ti.UI.View) : void; - setHeaderTitle (headerTitle: string) : void; - setHeaderView (headerView: Ti.UI.View) : void; - } - export interface Animation extends Ti.Proxy { - anchorPoint : Point; - autoreverse : boolean; - backgroundColor : string; - bottom : number; - center : any; - color : string; - curve : number; - delay : number; - duration : number; - height : number; - left : number; - opacity : number; - opaque : boolean; - repeat : number; - right : number; - top : number; - transform : any; - transition : number; - view : Ti.UI.View; - visible : boolean; - width : number; - zIndex : number; - getAnchorPoint () : Point; - getAutoreverse () : boolean; - getBackgroundColor () : string; - getBottom () : number; - getCenter () : any; - getColor () : string; - getCurve () : number; - getDelay () : number; - getDuration () : number; - getHeight () : number; - getLeft () : number; - getOpacity () : number; - getOpaque () : boolean; - getRepeat () : number; - getRight () : number; - getTop () : number; - getTransform () : any; - getTransition () : number; - getView () : Ti.UI.View; - getVisible () : boolean; - getWidth () : number; - getZIndex () : number; - setAnchorPoint (anchorPoint: Point) : void; - setAutoreverse (autoreverse: boolean) : void; - setBackgroundColor (backgroundColor: string) : void; - setBottom (bottom: number) : void; - setCenter (center: any) : void; - setColor (color: string) : void; - setCurve (curve: number) : void; - setDelay (delay: number) : void; - setDuration (duration: number) : void; - setHeight (height: number) : void; - setLeft (left: number) : void; - setOpacity (opacity: number) : void; - setOpaque (opaque: boolean) : void; - setRepeat (repeat: number) : void; - setRight (right: number) : void; - setTop (top: number) : void; - setTransform (transform: Ti.UI._2DMatrix) : void; - setTransform (transform: Ti.UI._3DMatrix) : void; - setTransition (transition: number) : void; - setView (view: Ti.UI.View) : void; - setVisible (visible: boolean) : void; - setWidth (width: number) : void; - setZIndex (zIndex: number) : void; - } - export interface Toolbar extends Ti.UI.View { - barColor : string; - borderBottom : boolean; - borderTop : boolean; - items : Array; - translucent : boolean; - getBarColor () : string; - getBorderBottom () : boolean; - getBorderTop () : boolean; - getItems () : Array; - getTranslucent () : boolean; - setBarColor (barColor: string) : void; - setBorderBottom (borderBottom: boolean) : void; - setBorderTop (borderTop: boolean) : void; - setItems (items: Array) : void; - setTranslucent (translucent: boolean) : void; - } - export interface Notification extends Ti.UI.View { - duration : number; - horizontalMargin : number; - message : string; - verticalMargin : number; - xOffset : number; - yOffset : number; - getDuration () : number; - getHorizontalMargin () : number; - getMessage () : string; - getVerticalMargin () : number; - getXOffset () : number; - getYOffset () : number; - setDuration (duration: number) : void; - setHorizontalMargin (horizontalMargin: number) : void; - setMessage (message: string) : void; - setVerticalMargin (verticalMargin: number) : void; - setXOffset (xOffset: number) : void; - setYOffset (yOffset: number) : void; - } - export interface PickerColumn extends Ti.UI.View { - font : Font; - rowCount : number; - rows : Array; - selectedRow : Ti.UI.PickerRow; - addRow (row: Ti.UI.PickerRow) : void; - getFont () : Font; - getRowCount () : number; - getRows () : Array; - getSelectedRow () : Ti.UI.PickerRow; - removeRow (row: Ti.UI.PickerRow) : void; - setFont (font: Font) : void; - setSelectedRow (selectedRow: Ti.UI.PickerRow) : void; - } - export interface ActivityIndicator extends Ti.Proxy { - bottom : any; - color : string; - font : Font; - height : string; - indicatorColor : string; - indicatorDiameter : string; - left : any; - message : string; - messageid : string; - right : any; - style : number; - top : any; - width : string; - add () : void; - getBottom () : any; - getColor () : string; - getFont () : Font; - getHeight () : string; - getIndicatorColor () : string; - getIndicatorDiameter () : string; - getLeft () : any; - getMessage () : string; - getMessageid () : string; - getRight () : any; - getStyle () : number; - getTop () : any; - getWidth () : string; - hide () : void; - remove () : void; - setBottom (bottom: number) : void; - setBottom (bottom: string) : void; - setColor (color: string) : void; - setFont (font: Font) : void; - setHeight (height: string) : void; - setIndicatorColor (indicatorColor: string) : void; - setIndicatorDiameter (indicatorDiameter: string) : void; - setLeft (left: number) : void; - setLeft (left: string) : void; - setMessage (message: string) : void; - setMessageid (messageid: string) : void; - setRight (right: number) : void; - setRight (right: string) : void; - setStyle (style: number) : void; - setTop (top: number) : void; - setTop (top: string) : void; - setWidth (width: string) : void; - show () : void; - } - export interface Picker extends Ti.UI.View { - calendarViewShown : boolean; - columns : Array; - countDownDuration : number; - font : Font; - format24 : boolean; - locale : string; - maxDate : Date; - minDate : Date; - minuteInterval : number; - selectionIndicator : boolean; - type : number; - useSpinner : boolean; - value : Date; - visibleItems : number; - add (data: Array) : void; - add (data: Ti.UI.PickerRow) : void; - add (data: Array) : void; - add (data: Ti.UI.PickerColumn) : void; - getCalendarViewShown () : boolean; - getColumns () : Array; - getCountDownDuration () : number; - getFont () : Font; - getFormat24 () : boolean; - getLocale () : string; - getMaxDate () : Date; - getMinDate () : Date; - getMinuteInterval () : number; - getSelectedRow (index: number) : Ti.UI.PickerRow; - getSelectionIndicator () : boolean; - getType () : number; - getUseSpinner () : boolean; - getValue () : Date; - getVisibleItems () : number; - reloadColumn (column: Ti.UI.PickerColumn) : void; - setCalendarViewShown (calendarViewShown: boolean) : void; - setColumns (columns: Array) : void; - setCountDownDuration (countDownDuration: number) : void; - setFont (font: Font) : void; - setFormat24 (format24: boolean) : void; - setLocale (locale: string) : void; - setMaxDate (maxDate: Date) : void; - setMinDate (minDate: Date) : void; - setMinuteInterval (minuteInterval: number) : void; - setSelectedRow (column: number, row: number, animated?: boolean) : void; - setSelectionIndicator (selectionIndicator: boolean) : void; - setType (type: number) : void; - setUseSpinner (useSpinner: boolean) : void; - setValue (date: any, suppressEvent: boolean) : Ti.UI.PickerRow; - setVisibleItems (visibleItems: number) : void; - showDatePickerDialog (dictObj: any) : void; - showTimePickerDialog (dictObj: any) : void; - } - } - export enum Module { + + /** + * A container for binary data. + */ + interface Blob extends Titanium.Proxy { + /** + * File object represented by this blob, or `null` if this blob is not + * associated with a file. + */ + readonly file: Titanium.Filesystem.File; + + /** + * Length of this blob in bytes. + */ + readonly length: number; + + /** + * UTF-8 string representation of the data in this blob. + */ + readonly text: string; + + /** + * Mime type of the data in this blob. + */ + readonly mimeType: string; + + /** + * If this blob represents an image, this is the height of the image in pixels. + */ + readonly height: number; + + /** + * If this blob represents an image, this is the width of the image in pixels. + */ + readonly width: number; + + /** + * If this blob represents a [File](Titanium.Filesystem.File), this is the file URL + * that represents it. + */ + readonly nativePath: string; + + /** + * Size of the blob in pixels (for image blobs) or bytes (for all other blobs). + */ + readonly size: number; + + /** + * Returns a string representation of this blob. + */ + toString(): string; + + /** + * Appends the data from another blob to this blob. + */ + append(blob: Titanium.Blob): void; + + /** + * Creates a new blob by cropping the underlying image to the specified dimensions. + */ + imageAsCropped(options: any): Titanium.Blob; + + /** + * Creates a new blob by resizing and scaling the underlying image to the specified dimensions. + */ + imageAsResized(width: number, height: number): Titanium.Blob; + + /** + * Creates a new blob by compressing the underlying image to the specified quality. + */ + imageAsCompressed(quality: number): Titanium.Blob; + + /** + * Returns a thumbnail version of the underlying image, optionally with a border and rounded corners. + */ + imageAsThumbnail(size: number, borderSize?: number, cornerRadius?: number): Titanium.Blob; + + /** + * Returns a copy of the underlying image with an added alpha channel. + */ + imageWithAlpha(): Titanium.Blob; + + /** + * Returns a copy of the underlying image with rounded corners added. + */ + imageWithRoundedCorner(cornerSize: number, borderSize?: number): Titanium.Blob; + + /** + * Returns a copy of the underlying image with an added transparent border. + */ + imageWithTransparentBorder(size: number): Titanium.Blob; + + /** + * Gets the value of the property. + */ + getFile(): Titanium.Filesystem.File; + + /** + * Gets the value of the property. + */ + getLength(): number; + + /** + * Gets the value of the property. + */ + getText(): string; + + /** + * Gets the value of the property. + */ + getMimeType(): string; + + /** + * Gets the value of the property. + */ + getHeight(): number; + + /** + * Gets the value of the property. + */ + getWidth(): number; + + /** + * Gets the value of the property. + */ + getNativePath(): string; + + /** + * Gets the value of the property. + */ + getSize(): number; } - export interface API { - debug (message: Array) : void; - debug (message: string) : void; - error (message: Array) : void; - error (message: string) : void; - info (message: Array) : void; - info (message: string) : void; - log (level: string, message: Array) : void; - log (level: string, message: string) : void; - timestamp (message: Array) : void; - timestamp (message: string) : void; - trace (message: Array) : void; - trace (message: string) : void; - warn (message: Array) : void; - warn (message: string) : void; + + /** + * Wrapper around that implements the interface. + */ + interface BlobStream extends Titanium.Proxy { + /** + * Reads data from this stream into a buffer. + */ + read(buffer: Titanium.Buffer, offset?: number, length?: number): number; + + /** + * Writes data from a buffer to this stream. + */ + write(buffer: Titanium.Buffer, offset?: number, length?: number): number; + + /** + * Indicates whether this stream is writable. + */ + isWritable(): boolean; + + /** + * Indicates whether this stream is readable. + */ + isReadable(): boolean; + + /** + * Closes this stream. + */ + close(): void; + } - export module Geolocation { - export var ACCURACY_BEST : number; - export var ACCURACY_BEST_FOR_NAVIGATION : number; - export var ACCURACY_HIGH : number; - export var ACCURACY_HUNDRED_METERS : number; - export var ACCURACY_KILOMETER : number; - export var ACCURACY_LOW : number; - export var ACCURACY_NEAREST_TEN_METERS : number; - export var ACCURACY_THREE_KILOMETERS : number; - export var ACTIVITYTYPE_AUTOMOTIVE_NAVIGATION : string; - export var ACTIVITYTYPE_FITNESS : string; - export var ACTIVITYTYPE_OTHER : string; - export var ACTIVITYTYPE_OTHER_NAVIGATION : string; - export var AUTHORIZATION_ALWAYS : number; - export var AUTHORIZATION_AUTHORIZED : number; - export var AUTHORIZATION_DENIED : number; - export var AUTHORIZATION_RESTRICTED : number; - export var AUTHORIZATION_UNKNOWN : number; - export var AUTHORIZATION_WHEN_IN_USE : number; - export var ERROR_DENIED : number; - export var ERROR_HEADING_FAILURE : number; - export var ERROR_LOCATION_UNKNOWN : number; - export var ERROR_NETWORK : number; - export var ERROR_REGION_MONITORING_DELAYED : number; - export var ERROR_REGION_MONITORING_DENIED : number; - export var ERROR_REGION_MONITORING_FAILURE : number; - export var ERROR_TIMEOUT : number; - export var PROVIDER_GPS : string; - export var PROVIDER_NETWORK : string; - export var PROVIDER_PASSIVE : string; - export var accuracy : number; - export var activityType : number; - export var apiName : string; - export var bubbleParent : boolean; - export var distanceFilter : number; - export var frequency : number; - export var hasCompass : boolean; - export var headingFilter : number; - export var lastGeolocation : string; - export var locationServicesAuthorization : number; - export var locationServicesEnabled : boolean; - export var pauseLocationUpdateAutomatically : boolean; - export var preferredProvider : string; - export var purpose : string; - export var showCalibration : boolean; - export var trackSignificantLocationChange : boolean; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function fireEvent (name: string, event: Dictionary) : void; - export function forwardGeocoder (address: string, callback: (...args : any[]) => any) : void; - export function getAccuracy () : number; - export function getActivityType () : number; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function getCurrentHeading (callback: (...args : any[]) => any) : void; - export function getCurrentPosition (callback: (...args : any[]) => any) : void; - export function getDistanceFilter () : number; - export function getFrequency () : number; - export function getHasCompass () : boolean; - export function getHeadingFilter () : number; - export function getLastGeolocation () : string; - export function getLocationServicesAuthorization () : number; - export function getLocationServicesEnabled () : boolean; - export function getPauseLocationUpdateAutomatically () : boolean; - export function getPreferredProvider () : string; - export function getPurpose () : string; - export function getShowCalibration () : boolean; - export function getTrackSignificantLocationChange () : boolean; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function reverseGeocoder (latitude: number, longitude: number, callback: (...args : any[]) => any) : void; - export function setAccuracy (accuracy: number) : void; - export function setActivityType (activityType: number) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setDistanceFilter (distanceFilter: number) : void; - export function setFrequency (frequency: number) : void; - export function setHeadingFilter (headingFilter: number) : void; - export function setLocationServicesAuthorization (locationServicesAuthorization: number) : void; - export function setPauseLocationUpdateAutomatically (pauseLocationUpdateAutomatically: boolean) : void; - export function setPreferredProvider (preferredProvider: string) : void; - export function setPurpose (purpose: string) : void; - export function setShowCalibration (showCalibration: boolean) : void; - export function setTrackSignificantLocationChange (trackSignificantLocationChange: boolean) : void; - export module Android { - export var apiName : string; - export var bubbleParent : boolean; - export var manualMode : boolean; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function addLocationProvider (provider: Ti.Geolocation.Android.LocationProvider) : void; - export function addLocationRule (rule: Ti.Geolocation.Android.LocationRule) : void; - export function applyProperties (props: Dictionary) : void; - export function createLocationProvider (parameters?: Dictionary) : Ti.Geolocation.Android.LocationProvider; - export function createLocationRule (parameters?: Dictionary) : Ti.Geolocation.Android.LocationRule; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function getManualMode () : boolean; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function removeLocationProvider (provider: Ti.Geolocation.Android.LocationProvider) : void; - export function removeLocationRule (rule: Ti.Geolocation.Android.LocationRule) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setManualMode (manualMode: boolean) : void; - export interface LocationProvider extends Ti.Proxy { - minUpdateDistance : number; - minUpdateTime : number; - name : string; - getMinUpdateDistance () : number; - getMinUpdateTime () : number; - getName () : string; - setMinUpdateDistance (minUpdateDistance: number) : void; - setMinUpdateTime (minUpdateTime: number) : void; - setName (name: string) : void; + + /** + * Buffer is a mutable, resizable container for raw data. + */ + interface Buffer extends Titanium.Proxy { + /** + * Length of the buffer in bytes. + */ + length: number; + + /** + * Data to be encoded. + */ + value: number | string; + + /** + * The type of data encoding to use with `value`. + */ + type: string; + + /** + * Byte order of this buffer. + */ + byteOrder: number; + + /** + * Appends `sourceBuffer` to the this buffer. + */ + append(sourceBuffer: Titanium.Buffer, sourceOffset?: number, sourceLength?: number): number; + + /** + * Inserts data from `sourceBuffer` into this buffer at `offset`. + */ + insert(sourceBuffer: Titanium.Buffer, offset: number, sourceOffset?: number, sourceLength?: number): number; + + /** + * Copies data from `sourceBuffer` into the current buffer at `offset`. + */ + copy(sourceBuffer: Titanium.Buffer, offset: number, sourceOffset?: number, sourceLength?: number): number; + + /** + * Creates a complete or partial copy of this buffer. + */ + clone(offset?: number, length?: number): Titanium.Buffer; + + /** + * Fills this buffer with the specified byte value. + */ + fill(fillByte: number, offset?: number, length?: number): void; + + /** + * Clears this buffer's contents but does not change the size of the buffer. + */ + clear(): void; + + /** + * Releases the space allocated to the buffer, and sets its length to 0. + */ + release(): void; + + /** + * Converts this buffer to a String. + */ + toString(): string; + + /** + * Converts this buffer to a . + */ + toBlob(): Titanium.Blob; + + /** + * Gets the value of the property. + */ + getLength(): number; + + /** + * Sets the value of the property. + */ + setLength(length: number): void; + + /** + * Gets the value of the property. + */ + getValue(): number | string; + + /** + * Sets the value of the property. + */ + setValue(value: number): void; + + /** + * Sets the value of the property. + */ + setValue(value: string): void; + + /** + * Gets the value of the property. + */ + getType(): string; + + /** + * Sets the value of the property. + */ + setType(type: string): void; + + /** + * Gets the value of the property. + */ + getByteOrder(): number; + + /** + * Sets the value of the property. + */ + setByteOrder(byteOrder: number): void; + + } + + /** + * Wrapper around that implements the interface. + */ + interface BufferStream extends Titanium.Proxy { + /** + * Reads data from this stream into a buffer. + */ + read(buffer: Titanium.Buffer, offset?: number, length?: number): number; + + /** + * Writes data from a buffer to this stream. + */ + write(buffer: Titanium.Buffer, offset?: number, length?: number): number; + + /** + * Indicates whether this stream is writable. + */ + isWritable(): boolean; + + /** + * Indicates whether this stream is readable. + */ + isReadable(): boolean; + + /** + * Closes this stream. + */ + close(): void; + + } + + /** + * The base type for all Titanium events. + */ + interface Event { + /** + * Source object that fired the event. + */ + readonly source: any; + + /** + * Name of the event fired. + */ + readonly type: string; + + /** + * True if the event will try to bubble up if possible. + */ + readonly bubbles: boolean; + + /** + * Set to true to stop the event from bubbling. + */ + cancelBubble: boolean; + + } + + /** + * IOStream is the interface that all stream types implement. + */ + // tslint:disable-next-line:interface-name + interface IOStream extends Titanium.Proxy { + /** + * Reads data from this stream into a buffer. + */ + read(buffer: Titanium.Buffer, offset?: number, length?: number): number; + + /** + * Writes data from a buffer to this stream. + */ + write(buffer: Titanium.Buffer, offset?: number, length?: number): number; + + /** + * Indicates whether this stream is writable. + */ + isWritable(): boolean; + + /** + * Indicates whether this stream is readable. + */ + isReadable(): boolean; + + /** + * Closes this stream. + */ + close(): void; + + } + + + /** + * The main module. + */ + namespace UI { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Use with [Animation.curve](Titanium.UI.Animation.curve) to specify an animation that starts + * slowly and speeds up. + */ + const ANIMATION_CURVE_EASE_IN: number; + + /** + * Use with [Animation.curve](Titanium.UI.Animation.curve) to specify an animation that starts + * slowly, and speeds up, then slows down at the end of the animation. + */ + const ANIMATION_CURVE_EASE_IN_OUT: number; + + /** + * Use with [Animation.curve](Titanium.UI.Animation.curve) to specify an animation that starts + * quickly, then slows down at the end of the animation. + */ + const ANIMATION_CURVE_EASE_OUT: number; + + /** + * Use with [Animation.curve](Titanium.UI.Animation.curve) to specify an animation that proceeds + * at a constant rate. + */ + const ANIMATION_CURVE_LINEAR: number; + + /** + * Use with to specify a font. + */ + const ATTRIBUTE_FONT: number; + + /** + * Use with to specify a font color. + */ + const ATTRIBUTE_FOREGROUND_COLOR: number; + + /** + * Use with to specify a background color. + */ + const ATTRIBUTE_BACKGROUND_COLOR: number; + + /** + * Use with to enable or disable ligatures. + */ + const ATTRIBUTE_LIGATURE: number; + + /** + * Use with to use a letterpress text effect. + */ + const ATTRIBUTE_LETTERPRESS_STYLE: number; + + /** + * Use with to specify kerning (space between characters). + */ + const ATTRIBUTE_KERN: number; + + /** + * Use with to place a horizontal line through the text. + */ + const ATTRIBUTE_STRIKETHROUGH_STYLE: number; + + /** + * Use with to place a horizontal line under the text. + */ + const ATTRIBUTE_UNDERLINES_STYLE: number; + + /** + * Use with to place the text in an upper position. + */ + const ATTRIBUTE_SUPERSCRIPT_STYLE: number; + + /** + * Use with to place the text in a lower position. + */ + const ATTRIBUTE_SUBSCRIPT_STYLE: number; + + /** + * Use with to specify a color for the stroke text. + */ + const ATTRIBUTE_STROKE_COLOR: number; + + /** + * Use with to specify the width of the stroke text. + */ + const ATTRIBUTE_STROKE_WIDTH: number; + + /** + * Use with to display a shadow behind the text. + */ + const ATTRIBUTE_SHADOW: number; + + /** + * Use with to control the direction of the text. + */ + const ATTRIBUTE_WRITING_DIRECTION: number; + + /** + * Use with to apply a text effect. + */ + const ATTRIBUTE_TEXT_EFFECT: number; + + /** + * Use with to create a link. + */ + const ATTRIBUTE_LINK: number; + + /** + * Use with to apply a different baseline to the text. + */ + const ATTRIBUTE_BASELINE_OFFSET: number; + + /** + * Use with to change the color of the horizontal line. + */ + const ATTRIBUTE_UNDERLINE_COLOR: number; + + /** + * Use with to change the color of the horizontal line. + */ + const ATTRIBUTE_STRIKETHROUGH_COLOR: number; + + /** + * Use with to skew the text. + */ + const ATTRIBUTE_OBLIQUENESS: number; + + /** + * Use with to stretch the text horizontally. + */ + const ATTRIBUTE_EXPANSION: number; + + /** + * Use with to wrap and truncate the text. + */ + const ATTRIBUTE_LINE_BREAK: number; + + /** + * Use with to not draw a line. + */ + const ATTRIBUTE_UNDERLINE_STYLE_NONE: number; + + /** + * Use with to draw a single line. + */ + const ATTRIBUTE_UNDERLINE_STYLE_SINGLE: number; + + /** + * Use with to draw a thick line. + */ + const ATTRIBUTE_UNDERLINE_STYLE_THICK: number; + + /** + * Use with to draw a double line. + */ + const ATTRIBUTE_UNDERLINE_STYLE_DOUBLE: number; + + /** + * Use with to draw a solid line. + */ + const ATTRIBUTE_UNDERLINE_PATTERN_SOLID: number; + + /** + * Use with to draw a dotted line. + */ + const ATTRIBUTE_UNDERLINE_PATTERN_DOT: number; + + /** + * Use with to draw a dashed line. + */ + const ATTRIBUTE_UNDERLINE_PATTERN_DASH: number; + + /** + * Use with to draw an alternating line of dashes and dots. + */ + const ATTRIBUTE_UNDERLINE_PATTERN_DASH_DOT: number; + + /** + * Use with to draw an alternating line of dashes and two dots. + */ + const ATTRIBUTE_UNDERLINE_PATTERN_DASH_DOT_DOT: number; + + /** + * Use with to draw a line only underneath or through words. + */ + const ATTRIBUTE_UNDERLINE_BY_WORD: number; + + /** + * Use with to use the embedded text direction. + */ + const ATTRIBUTE_WRITING_DIRECTION_EMBEDDING: number; + + /** + * Use with to override the text direction. + */ + const ATTRIBUTE_WRITING_DIRECTION_OVERRIDE: number; + + /** + * Use with to use the + * [Unicode Bidirection Algorithm rules P2 and P3](http://www.unicode.org/reports/tr9/#The_Paragraph_Level) + * to determine which direction to use. + */ + const ATTRIBUTE_WRITING_DIRECTION_NATURAL: number; + + /** + * Use with to write text left to right. + */ + const ATTRIBUTE_WRITING_DIRECTION_LEFT_TO_RIGHT: number; + + /** + * Use with to write text right to left. + */ + const ATTRIBUTE_WRITING_DIRECTION_RIGHT_TO_LEFT: number; + + /** + * Use with to wrap words at word boundaries. + */ + const ATTRIBUTE_LINE_BREAK_BY_WORD_WRAPPING: number; + + /** + * Use with to wrap words at word boundaries. + */ + const ATTRIBUTE_LINE_BREAK_BY_CHAR_WRAPPING: number; + + /** + * Use with to set lines to not draw past the edge of the text container. + */ + const ATTRIBUTE_LINE_BREAK_BY_CLIPPING: number; + + /** + * Use with to use ellipsis glyph at the beginning of the line for missing text. + */ + const ATTRIBUTE_LINE_BREAK_BY_TRUNCATING_HEAD: number; + + /** + * Use with to use ellipsis glyph at the middle of the line for missing text. + */ + const ATTRIBUTE_LINE_BREAK_BY_TRUNCATING_MIDDLE: number; + + /** + * Use with to use ellipsis glyph at the end of the line for missing text. + */ + const ATTRIBUTE_LINE_BREAK_BY_TRUNCATING_TAIL: number; + + /** + * Converts strings formatted as addresses into clickable links. + */ + const AUTODETECT_ADDRESS: number; + + /** + * Converts all detectable types of data into clickable links. + */ + const AUTODETECT_ALL: number; + + /** + * Converts strings formatted as calendar events into clickable links. + */ + const AUTODETECT_CALENDAR: number; + + /** + * Converts strings formatted as URLs into clickable links. + */ + const AUTODETECT_LINK: number; + + /** + * Disables converting strings into clickable links. + */ + const AUTODETECT_NONE: number; + + /** + * Converts strings formatted as phone numbers into clickable links. + */ + const AUTODETECT_PHONE: number; + + /** + * Specifies the expectation of an account or login name. + */ + const AUTOFILL_TYPE_USERNAME: string; + + /** + * Specifies the expectation of a password. + */ + const AUTOFILL_TYPE_PASSWORD: string; + + /** + * Specifies the expectation of a name. + */ + const AUTOFILL_TYPE_NAME: string; + + /** + * Specifies the expectation of a prefix or title, such as 'Dr.' + */ + const AUTOFILL_TYPE_NAME_PREFIX: string; + + /** + * Specifies the expectation of a given name. + */ + const AUTOFILL_TYPE_GIVEN_NAME: string; + + /** + * Specifies the expectation of a middle name. + */ + const AUTOFILL_TYPE_MIDDLE_NAME: string; + + /** + * Specifies the expectation of a family name. + */ + const AUTOFILL_TYPE_FAMILY_NAME: string; + + /** + * Specifies the expectation of a suffix, such as 'Jr.' + */ + const AUTOFILL_TYPE_NAME_SUFFIX: string; + + /** + * Specifies the expectation of a nickname. + */ + const AUTOFILL_TYPE_NICKNAME: string; + + /** + * Specifies the expectation of a job title. + */ + const AUTOFILL_TYPE_JOB_TITLE: string; + + /** + * Specifies the expectation of an organization name. + */ + const AUTOFILL_TYPE_ORGANIZATION_NAME: string; + + /** + * Specifies the expectation of a location, such as a point of interest, an address, or another way to identify a location. + */ + const AUTOFILL_TYPE_LOCATION: string; + + /** + * Specifies the expectation of an address. + */ + const AUTOFILL_TYPE_ADDRESS: string; + + /** + * Specifies the expectation of the first line of a street address. + */ + const AUTOFILL_TYPE_ADDRESS_LINE1: string; + + /** + * Specifies the expectation of the second line of a street address. + */ + const AUTOFILL_TYPE_ADDRESS_LINE2: string; + + /** + * Specifies the expectation of a city name. + */ + const AUTOFILL_TYPE_ADDRESS_CITY: string; + + /** + * Specifies the expectation of a state name. + */ + const AUTOFILL_TYPE_ADDRESS_STATE: string; + + /** + * Specifies the expectation of a city name combined with a state name. + */ + const AUTOFILL_TYPE_ADDRESS_CITY_STATE: string; + + /** + * Specifies the expectation of a sublocality. + */ + const AUTOFILL_TYPE_SUBLOCALITY: string; + + /** + * Specifies the expectation of a country name. + */ + const AUTOFILL_TYPE_COUNTRY_NAME: string; + + /** + * Specifies the expectation of a postal code. + */ + const AUTOFILL_TYPE_POSTAL_CODE: string; + + /** + * Specifies the expectation of a telephone number. + */ + const AUTOFILL_TYPE_PHONE: string; + + /** + * Specifies the expectation of an email address. + */ + const AUTOFILL_TYPE_EMAIL: string; + + /** + * Specifies the expectation of a URL. + */ + const AUTOFILL_TYPE_URL: string; + + /** + * Specifies the expectation of a card number. + */ + const AUTOFILL_TYPE_CARD_NUMBER: string; + + /** + * Specifies the expectation of a card security code. + */ + const AUTOFILL_TYPE_CARD_SECURITY_CODE: string; + + /** + * Specifies the expectation of a card expiration date. + */ + const AUTOFILL_TYPE_CARD_EXPIRATION_DATE: string; + + /** + * Specifies the expectation of a card expectation day. + */ + const AUTOFILL_TYPE_CARD_EXPIRATION_DAY: string; + + /** + * Specifies the expectation of a card expectation month. + */ + const AUTOFILL_TYPE_CARD_EXPIRATION_MONTH: string; + + /** + * Specifies the expectation of a card expectation year. + */ + const AUTOFILL_TYPE_CARD_EXPIRATION_YEAR: string; + + /** + * Converts strings formatted as addresses into clickable links. + */ + const AUTOLINK_MAP_ADDRESSES: number; + + /** + * Converts all detectable types of data into clickable links. + */ + const AUTOLINK_ALL: number; + + /** + * Converts strings formatted as calendar events into clickable links. + */ + const AUTOLINK_CALENDAR: number; + + /** + * Converts strings formatted as URLs into clickable links. + */ + const AUTOLINK_URLS: number; + + /** + * Disables converting strings into clickable links. + */ + const AUTOLINK_NONE: number; + + /** + * Converts strings formatted as phone numbers into clickable links. + */ + const AUTOLINK_PHONE_NUMBERS: number; + + /** + * Converts strings formatted as email addresses into clickable links. + */ + const AUTOLINK_EMAIL_ADDRESSES: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_CLEAR: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_COLOR: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_COLOR_BURN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_COLOR_DODGE: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_COPY: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DARKEN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DESTINATION_ATOP: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DESTINATION_IN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DESTINATION_OUT: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DESTINATION_OVER: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DIFFERENCE: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_EXCLUSION: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_HARD_LIGHT: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_HUE: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_LIGHTEN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_LUMINOSITY: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_MULTIPLY: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_NORMAL: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_OVERLAY: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_PLUS_DARKER: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_PLUS_LIGHTER: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SATURATION: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SCREEN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SOFT_LIGHT: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SOURCE_ATOP: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SOURCE_IN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SOURCE_OUT: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_XOR: number; + + /** + * Use when creating a TextField to specify the hintType as static. + */ + const HINT_TYPE_STATIC: number; + + /** + * Use when creating a TextField to specify the hintType as animated. + */ + const HINT_TYPE_ANIMATED: number; + + /** + * Add ellipses at word boundaries, unless the word itself doesn't fit on a single line. + */ + const TEXT_ELLIPSIZE_TRUNCATE_WORD_WRAP: number; + + /** + * Add ellipses before the first character that doesnt fit. + */ + const TEXT_ELLIPSIZE_TRUNCATE_CHAR_WRAP: number; + + /** + * Lines are simply not drawn past the edge of the text container. + */ + const TEXT_ELLIPSIZE_TRUNCATE_CLIP: number; + + /** + * Add ellipses at the beginning of the label if the text is too large to fit. + */ + const TEXT_ELLIPSIZE_TRUNCATE_START: number; + + /** + * Add ellipses in the middle of the label if the text is too large to fit. + */ + const TEXT_ELLIPSIZE_TRUNCATE_MIDDLE: number; + + /** + * Add ellipses at the end of the label if the text is too large to fit. + */ + const TEXT_ELLIPSIZE_TRUNCATE_END: number; + + /** + * Turns on a marquee effect of the label if the text is too large to fit. (This requires to be true) + */ + const TEXT_ELLIPSIZE_TRUNCATE_MARQUEE: number; + + /** + * Disables ellipsizing of the label. The text will be cut off if it is too long. + */ + const TEXT_ELLIPSIZE_TRUNCATE_NONE: number; + + /** + * Specifies that the top edge of the window can extend. + */ + const EXTEND_EDGE_TOP: number; + + /** + * Specifies that the bottom edge of the window can extend. + */ + const EXTEND_EDGE_BOTTOM: number; + + /** + * Specifies that the left edge of the window can extend. + */ + const EXTEND_EDGE_LEFT: number; + + /** + * Specifies that the right edge of the window can extend. + */ + const EXTEND_EDGE_RIGHT: number; + + /** + * Specifies that none of the edges of the window can extend. + */ + const EXTEND_EDGE_NONE: number; + + /** + * Specifies that all the edges of the window can extend. + */ + const EXTEND_EDGE_ALL: number; + + /** + * Constant value for face-down orientation. + */ + const FACE_DOWN: number; + + /** + * Constant value for face-up orientation. + */ + const FACE_UP: number; + + /** + * FILL behavior for UI layout. + */ + const FILL: string; + + /** + * Release free space when hiding an object. + */ + const HIDDEN_BEHAVIOR_GONE: number; + + /** + * Keeps free space when hiding an object. + */ + const HIDDEN_BEHAVIOR_INVISIBLE: number; + + /** + * Use a bezel-style border on the input field. + */ + const INPUT_BORDERSTYLE_BEZEL: number; + + /** + * Use a simple line border on the input field. + */ + const INPUT_BORDERSTYLE_LINE: number; + + /** + * Use no border on the input field. + */ + const INPUT_BORDERSTYLE_NONE: number; + + /** + * Use a rounded-rectangle border on the input field. + */ + const INPUT_BORDERSTYLE_ROUNDED: number; + + /** + * Always show buttons on the input field. + */ + const INPUT_BUTTONMODE_ALWAYS: number; + + /** + * Never show buttons on the input field. + */ + const INPUT_BUTTONMODE_NEVER: number; + + /** + * Show buttons on the input field when it loses focus. + */ + const INPUT_BUTTONMODE_ONBLUR: number; + + /** + * Show buttons on the input field when it gains focus. + */ + const INPUT_BUTTONMODE_ONFOCUS: number; + + /** + * Use a keyboard with a number pad only, with the pad keyboard layout. Accepts only numbers. + */ + const INPUT_TYPE_CLASS_NUMBER: number; + + /** + * Use an ASCII keyboard, with the standard keyboard layout. + */ + const INPUT_TYPE_CLASS_TEXT: number; + + /** + * Use a keyboard appearance suitable for entering text on an alert. + */ + const KEYBOARD_APPEARANCE_ALERT: number; + + /** + * Use the platform-specific default keyboard appearance. + */ + const KEYBOARD_APPEARANCE_DEFAULT: number; + + /** + * Use the platform-specific dark keyboard appearance. + */ + const KEYBOARD_APPEARANCE_DARK: number; + + /** + * Use the platform-specific light keyboard appearance. + */ + const KEYBOARD_APPEARANCE_LIGHT: number; + + /** + * Use an ASCII keyboard, with the standard keyboard layout. + */ + const KEYBOARD_ASCII: number; + + /** + * Use a keyboard with decimal numbers only, with the pad keyboard layout. + */ + const KEYBOARD_DECIMAL_PAD: number; + + /** + * Use the default keyboard, depending on the platform. + */ + const KEYBOARD_DEFAULT: number; + + /** + * Use a keyboard suitable for composing email, with the standard keyboard layout. + */ + const KEYBOARD_EMAIL: number; + + /** + * Use a keyboard suitable for entering names and phone numbers, with the pad keyboard layout. + */ + const KEYBOARD_NAMEPHONE_PAD: number; + + /** + * Use a keyboard with numbers and punctuation only, with the standard keyboard layout. + */ + const KEYBOARD_NUMBERS_PUNCTUATION: number; + + /** + * Use a keyboard with a number pad only, with the pad keyboard layout. + */ + const KEYBOARD_NUMBER_PAD: number; + + /** + * Use a keyboard with a phone-style number pad, with the pad keyboard layout. + */ + const KEYBOARD_PHONE_PAD: number; + + /** + * Use a keyboard optimized for entering URLs, with the standard keyboard layout. + */ + const KEYBOARD_URL: number; + + /** + * Use a keyboard with decimal numbers only, with the pad keyboard layout. + */ + const KEYBOARD_TYPE_DECIMAL_PAD: number; + + /** + * Use an ASCII keyboard, with the standard keyboard layout. + */ + const KEYBOARD_TYPE_ASCII: number; + + /** + * Use the default keyboard, depending on the platform. + */ + const KEYBOARD_TYPE_DEFAULT: number; + + /** + * Use a keyboard suitable for composing email, with the standard keyboard layout. + */ + const KEYBOARD_TYPE_EMAIL: number; + + /** + * Use a keyboard suitable for entering names and phone numbers, with the pad keyboard layout. + */ + const KEYBOARD_TYPE_NAMEPHONE_PAD: number; + + /** + * Use a keyboard with numbers and punctuation only, with the standard keyboard layout. + */ + const KEYBOARD_TYPE_NUMBERS_PUNCTUATION: number; + + /** + * Use a keyboard with a number pad only, with the pad keyboard layout. + */ + const KEYBOARD_TYPE_NUMBER_PAD: number; + + /** + * Use a keyboard with a phone-style number pad, with the pad keyboard layout. + */ + const KEYBOARD_TYPE_PHONE_PAD: number; + + /** + * Use a keyboard optimized for web search terms and URL entry. + */ + const KEYBOARD_TYPE_WEBSEARCH: number; + + /** + * Use a keyboard optimized for twitter text entry, with easy access to the @ and + */ + const KEYBOARD_TYPE_TWITTER: number; + + /** + * Use a keyboard optimized for entering URLs, with the standard keyboard layout. + */ + const KEYBOARD_TYPE_URL: number; + + /** + * Standard landscape orientation (home button on left). + */ + const LANDSCAPE_LEFT: number; + + /** + * Reverse landscape orientation (home button on right). + */ + const LANDSCAPE_RIGHT: number; + + /** + * Do not display anything on the right side of an item in a list view. + */ + const LIST_ACCESSORY_TYPE_NONE: number; + + /** + * Displays a checkmark on the right side of an item in a list view. + */ + const LIST_ACCESSORY_TYPE_CHECKMARK: number; + + /** + * Displays a detail disclosure button on the right side of an item in a list view. + */ + const LIST_ACCESSORY_TYPE_DETAIL: number; + + /** + * Displays a disclosure indicator on the right side of an item in a list view. + */ + const LIST_ACCESSORY_TYPE_DISCLOSURE: number; + + /** + * A built-in style for an item with an image view and left-aligned title label. + */ + const LIST_ITEM_TEMPLATE_DEFAULT: number; + + /** + * A built-in style for a item with an image view; a left-aligned title label; and a + * right-aligned subtitle label. + */ + const LIST_ITEM_TEMPLATE_SETTINGS: number; + + /** + * A built-in style for an item with a right-aligned title label on the left side of the cell, + * which is next to a left-aligned subtitle label. + */ + const LIST_ITEM_TEMPLATE_CONTACTS: number; + + /** + * A built-in style for an item with an image view; a black, left-aligned title label across the + * top of the cell and a subtitle label below it. + */ + const LIST_ITEM_TEMPLATE_SUBTITLE: number; + + /** + * Specifies a long duration for an Android Toast notification (). + */ + const NOTIFICATION_DURATION_LONG: number; + + /** + * Specifies a short duration for an Android Toast notification (). + */ + const NOTIFICATION_DURATION_SHORT: number; + + /** + * Specifies that the clipboard items should not be available to other devices through Handoff. + */ + const CLIPBOARD_OPTION_LOCAL_ONLY: string; + + /** + * Specifies the time and date that you want the system to remove the clipboard items from the clipboard. + */ + const CLIPBOARD_OPTION_EXPIRATION_DATE: string; + + /** + * Use a picker with a countdown timer appearance, showing hours and minutes. + */ + const PICKER_TYPE_COUNT_DOWN_TIMER: number; + + /** + * Use a date picker. + */ + const PICKER_TYPE_DATE: number; + + /** + * Use a date and time picker. + */ + const PICKER_TYPE_DATE_AND_TIME: number; + + /** + * Use a plain picker (for values other than date or time). + */ + const PICKER_TYPE_PLAIN: number; + + /** + * Use a time picker. + */ + const PICKER_TYPE_TIME: number; + + /** + * Orientation constant for portrait mode orientation. + */ + const PORTRAIT: number; + + /** + * Set the return key text to "Continue". + */ + const RETURNKEY_CONTINUE: number; + + /** + * Use the default return key on the virtual keyboard. + */ + const RETURNKEY_DEFAULT: number; + + /** + * Set the return key text to "Done". + */ + const RETURNKEY_DONE: number; + + /** + * Set the return key text to "Emergency Call". + */ + const RETURNKEY_EMERGENCY_CALL: number; + + /** + * Set the return key text to "Go". + */ + const RETURNKEY_GO: number; + + /** + * Set the return key text to "Google". + */ + const RETURNKEY_GOOGLE: number; + + /** + * Set the return key text to "Join". + */ + const RETURNKEY_JOIN: number; + + /** + * Set the return key text to "Next". + */ + const RETURNKEY_NEXT: number; + + /** + * Set the return key text to "Route". + */ + const RETURNKEY_ROUTE: number; + + /** + * Set the return key text to "Search". + */ + const RETURNKEY_SEARCH: number; + + /** + * Set the return key text to "Send". + */ + const RETURNKEY_SEND: number; + + /** + * Set the return key text to "Yahoo". + */ + const RETURNKEY_YAHOO: number; + + /** + * SIZE behavior for UI layout. + */ + const SIZE: string; + + /** + * The row divider is hidden. + */ + const TABLE_VIEW_SEPARATOR_STYLE_NONE: number; + + /** + * The row divider is shown as a single line. + */ + const TABLE_VIEW_SEPARATOR_STYLE_SINGLE_LINE: number; + + /** + * Center align text. + */ + const TEXT_ALIGNMENT_CENTER: number | string; + + /** + * Justify align text. + */ + const TEXT_ALIGNMENT_JUSTIFY: number | string; + + /** + * Left align text. + */ + const TEXT_ALIGNMENT_LEFT: number | string; + + /** + * Right align text. + */ + const TEXT_ALIGNMENT_RIGHT: number | string; + + /** + * Auto-capitalize all text in the input field. + */ + const TEXT_AUTOCAPITALIZATION_ALL: number; + + /** + * Do not auto-capitalize. + */ + const TEXT_AUTOCAPITALIZATION_NONE: number; + + /** + * Use sentence-style auto-capitalization in the input field. + */ + const TEXT_AUTOCAPITALIZATION_SENTENCES: number; + + /** + * Auto-capitalize the first letter of each word in the input field. + */ + const TEXT_AUTOCAPITALIZATION_WORDS: number; + + /** + * Specifies the text style for the Object. + */ + const TEXT_STYLE_HEADLINE: string; + + /** + * Specifies the text style for the Object. + */ + const TEXT_STYLE_SUBHEADLINE: string; + + /** + * Specifies the text style for the Object. + */ + const TEXT_STYLE_BODY: string; + + /** + * Specifies the text style for the Object. + */ + const TEXT_STYLE_FOOTNOTE: string; + + /** + * Specifies the text style for the Object. + */ + const TEXT_STYLE_CAPTION1: string; + + /** + * Specifies the text style for the Object. + */ + const TEXT_STYLE_CAPTION2: string; + + /** + * Specifies the text style for the Object. + */ + const TEXT_STYLE_CALLOUT: string; + + /** + * Specifies the text style for the Object. + */ + const TEXT_STYLE_TITLE1: string; + + /** + * Specifies the text style for the Object. + */ + const TEXT_STYLE_TITLE2: string; + + /** + * Specifies the text style for the Object. + */ + const TEXT_STYLE_TITLE3: string; + + /** + * Align text to the bottom of the view. + */ + const TEXT_VERTICAL_ALIGNMENT_BOTTOM: number | string; + + /** + * Vertically align text to the center of the view. + */ + const TEXT_VERTICAL_ALIGNMENT_CENTER: number | string; + + /** + * Align text to the top of the view. + */ + const TEXT_VERTICAL_ALIGNMENT_TOP: number | string; + + /** + * Unit constant representing units in centimeters. + */ + const UNIT_CM: string; + + /** + * Unit constant representing units in density-independent pixels. + */ + const UNIT_DIP: string; + + /** + * Unit constant representing units in inches. + */ + const UNIT_IN: string; + + /** + * Unit constant representing units in millimeters. + */ + const UNIT_MM: string; + + /** + * Unit constant representing units in pixels. + */ + const UNIT_PX: string; + + /** + * Orientation constant representing an unknown orientation. + */ + const UNKNOWN: number; + + /** + * Orientation constant for inverted portait orientation. + */ + const UPSIDE_PORTRAIT: number; + + /** + * Authentication error code reported via . + */ + const URL_ERROR_AUTHENTICATION: number; + + /** + * Bad url error code reported via . + */ + const URL_ERROR_BAD_URL: number; + + /** + * Error code reported via for a failure to connect to host. + */ + const URL_ERROR_CONNECT: number; + + /** + * Error code reported via for an SSL failure. + */ + const URL_ERROR_SSL_FAILED: number; + + /** + * Error code reported via for a failure to access a file resource on a host, except "file not found", which has its own constant. + */ + const URL_ERROR_FILE: number; + + /** + * Error code reported via when a requested file does not exist on the host. + */ + const URL_ERROR_FILE_NOT_FOUND: number; + + /** + * Error code reported via when a host name cannot be resolved, such as via a DNS lookup error. + */ + const URL_ERROR_HOST_LOOKUP: number; + + /** + * Error code reported via when a redirect loop is detected. + */ + const URL_ERROR_REDIRECT_LOOP: number; + + /** + * Error code reported via when a timeout occurs. + */ + const URL_ERROR_TIMEOUT: number; + + /** + * Error code reported via when an unknown error occurs. + */ + const URL_ERROR_UNKNOWN: number; + + /** + * Error code reported via when a url contains an unsupported scheme. + */ + const URL_ERROR_UNSUPPORTED_SCHEME: number; + + /** + * Sets the background color of the master view (when there are no windows or other top-level + * controls displayed). + */ + let backgroundColor: string; + + /** + * Local path or URL to an image file for setting a background for the master view (when there + * are no windows or other top-level controls displayed). + */ + let backgroundImage: string; + + /** + * The currently active tab, if a tab group is open. + */ + let currentTab: Titanium.UI.Tab; + + /** + * The active window associated with the executing JavaScript context. + */ + const currentWindow: Titanium.UI.Window; + + /** + * Updates the orientation of the current window to the specified orientation value. + */ + let orientation: number; + + /** + * Sets the global tint color of the application. It is inherited by the child views and can be + * overwritten by them using the `tintColor` property. + */ + let tintColor: string; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Creates and returns an instance of . + */ + function create2DMatrix(parameters?: MatrixCreationDict): Titanium.UI.Matrix2D; + + /** + * Converts one type of unit to another using the metrics of the main display. + */ + function convertUnits(convertFromValue: string, convertToUnits: number): number; + + /** + * Creates and returns an instance of . + */ + function createView(parameters?: any): Titanium.UI.View; + + /** + * Creates and returns an instance of . + */ + function create3DMatrix(parameters?: any): Titanium.UI.Matrix3D; + + /** + * Creates and returns an instance of . + */ + function createActivityIndicator(parameters?: any): Titanium.UI.ActivityIndicator; + + /** + * Creates and returns an instance of . + */ + function createAlertDialog(parameters?: any): Titanium.UI.AlertDialog; + + /** + * Creates and returns an instance of . + */ + function createAnimation(parameters?: any): Titanium.UI.Animation; + + /** + * Creates and returns an instance of . + */ + function createAttributedString(parameters?: any): Titanium.UI.AttributedString; + + /** + * Creates and returns an instance of . + */ + function createButton(parameters?: any): Titanium.UI.Button; + + /** + * Creates and returns an instance of . + */ + function createButtonBar(parameters?: any): Titanium.UI.ButtonBar; + + /** + * Creates and returns an instance of . + */ + function createCoverFlowView(parameters?: any): Titanium.UI.CoverFlowView; + + /** + * Creates and returns an instance of . + */ + function createDashboardItem(parameters?: any): Titanium.UI.DashboardItem; + + /** + * Creates and returns an instance of . + */ + function createDashboardView(parameters?: any): Titanium.UI.DashboardView; + + /** + * Creates and returns an instance of . + */ + function createEmailDialog(parameters?: any): Titanium.UI.EmailDialog; + + /** + * Creates and returns an instance of . + */ + function createImageView(parameters?: any): Titanium.UI.ImageView; + + /** + * Creates and returns an instance of . + */ + function createLabel(parameters?: any): Titanium.UI.Label; + + /** + * Creates and returns an instance of . + */ + function createListSection(parameters?: any): Titanium.UI.ListSection; + + /** + * Creates and returns an instance of . + */ + function createListView(parameters?: any): Titanium.UI.ListView; + + /** + * Creates and returns an instance of . + */ + function createMaskedImage(parameters?: any): Titanium.UI.MaskedImage; + + /** + * Creates and returns an instance of . + */ + function createNotification(parameters?: any): Titanium.UI.Notification; + + /** + * Creates and returns an instance of . + */ + function createOptionDialog(parameters?: any): Titanium.UI.OptionDialog; + + /** + * Creates and returns an instance of . + */ + function createPicker(parameters?: any): Titanium.UI.Picker; + + /** + * Creates and returns an instance of . + */ + function createPickerColumn(parameters?: any): Titanium.UI.PickerColumn; + + /** + * Creates and returns an instance of . + */ + function createPickerRow(parameters?: any): Titanium.UI.PickerRow; + + /** + * Creates and returns an instance of . + */ + function createProgressBar(parameters?: any): Titanium.UI.ProgressBar; + + /** + * Creates and returns an instance of . + */ + function createRefreshControl(parameters?: any): Titanium.UI.RefreshControl; + + /** + * Creates and returns an instance of . + */ + function createScrollView(parameters?: any): Titanium.UI.ScrollView; + + /** + * Creates and returns an instance of . + */ + function createScrollableView(parameters?: any): Titanium.UI.ScrollableView; + + /** + * Creates and returns an instance of . + */ + function createSearchBar(parameters?: any): Titanium.UI.SearchBar; + + /** + * Creates and returns an instance of . + */ + function createSlider(parameters?: any): Titanium.UI.Slider; + + /** + * Creates and returns an instance of . + */ + function createSwitch(parameters?: any): Titanium.UI.Switch; + + /** + * Creates and returns an instance of . + */ + function createTab(parameters?: any): Titanium.UI.Tab; + + /** + * Creates and returns an instance of . + */ + function createTabGroup(parameters?: any): Titanium.UI.TabGroup; + + /** + * Creates and returns an instance of . + */ + function createTabbedBar(parameters?: any): Titanium.UI.TabbedBar; + + /** + * Creates and returns an instance of . + */ + function createTableView(parameters?: any): Titanium.UI.TableView; + + /** + * Creates and returns an instance of . + */ + function createTableViewRow(parameters?: any): Titanium.UI.TableViewRow; + + /** + * Creates and returns an instance of . + */ + function createTableViewSection(parameters?: any): Titanium.UI.TableViewSection; + + /** + * Creates and returns an instance of . + */ + function createTextArea(parameters?: any): Titanium.UI.TextArea; + + /** + * Creates and returns an instance of . + */ + function createTextField(parameters?: any): Titanium.UI.TextField; + + /** + * Creates and returns an instance of . + */ + function createToolbar(parameters?: any): Titanium.UI.Toolbar; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + function setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + function getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + function setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + function getCurrentTab(): Titanium.UI.Tab; + + /** + * Sets the value of the property. + */ + function setCurrentTab(currentTab: Titanium.UI.Tab): void; + + /** + * Gets the value of the property. + */ + function getCurrentWindow(): Titanium.UI.Window; + + /** + * Gets the value of the property. + */ + function getOrientation(): number; + + /** + * Sets the value of the property. + */ + function setOrientation(orientation: number): void; + + /** + * Gets the value of the property. + */ + function getTintColor(): string; + + /** + * Sets the value of the property. + */ + function setTintColor(tintColor: string): void; + + /** + * Creates and returns an instance of . + */ + function createWebView(parameters?: any): Titanium.UI.WebView; + + /** + * Creates and returns an instance of . + */ + function createWindow(parameters?: any): Titanium.UI.Window; + + /** + * An empty drawing surface or container + */ + interface View extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * Disabled background color of the view, as a color name or hex triplet. + */ + backgroundDisabledColor: string; + + /** + * Disabled background image for the view, specified as a local file path or URL. + */ + backgroundDisabledImage: string; + + /** + * Focused background color of the view, as a color name or hex triplet. + */ + backgroundFocusedColor: string; + + /** + * Focused background image for the view, specified as a local file path or URL. + */ + backgroundFocusedImage: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Selected background color of the view, as a color name or hex triplet. + */ + backgroundSelectedColor: string; + + /** + * Selected background image url for the view, specified as a local file path or URL. + */ + backgroundSelectedImage: string; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * Base elevation of the view relative to its parent in pixels. + */ + elevation: number; + + /** + * Whether view should be focusable while navigating with the trackball. + */ + focusable: boolean; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * Sets the behavior when hiding an object to release or keep the free space + */ + hiddenBehavior: number; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * When on, animate call overrides current animation if applicable. + */ + overrideCurrentAnimation: boolean; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * Clockwise 2D rotation of the view in degrees. + */ + rotation: number; + + /** + * Clockwise rotation of the view in degrees (x-axis). + */ + rotationX: number; + + /** + * Clockwise rotation of the view in degrees (y-axis). + */ + rotationY: number; + + /** + * Scaling of the view in x-axis in pixels. + */ + scaleX: number; + + /** + * Scaling of the view in y-axis in pixels. + */ + scaleY: number; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * Determines keyboard behavior when this view is focused. + */ + softKeyboardOnFocus: number; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * A material design visual construct that provides an instantaneous visual confirmation of touch point. + */ + touchFeedback: boolean; + + /** + * Optional touch feedback ripple color. This has no effect unless `touchFeedback` is true. + */ + touchFeedbackColor: string; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Horizontal location of the view relative to its left position in pixels. + */ + translationX: number; + + /** + * Vertical location of the view relative to its top position in pixels. + */ + translationY: number; + + /** + * Depth of the view relative to its elevation in pixels. + */ + translationZ: number; + + /** + * A name to identify this view in activity transition. + */ + transitionName: string; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Determines whether to keep the device screen on. + */ + keepScreenOn: boolean; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledColor(backgroundDisabledColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledImage(backgroundDisabledImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedColor(backgroundFocusedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedImage(backgroundFocusedImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedColor(backgroundSelectedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedImage(backgroundSelectedImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getElevation(): number; + + /** + * Sets the value of the property. + */ + setElevation(elevation: number): void; + + /** + * Gets the value of the property. + */ + getFocusable(): boolean; + + /** + * Sets the value of the property. + */ + setFocusable(focusable: boolean): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getHiddenBehavior(): number; + + /** + * Sets the value of the property. + */ + setHiddenBehavior(hiddenBehavior: number): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getOverrideCurrentAnimation(): boolean; + + /** + * Sets the value of the property. + */ + setOverrideCurrentAnimation(overrideCurrentAnimation: boolean): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getRotation(): number; + + /** + * Sets the value of the property. + */ + setRotation(rotation: number): void; + + /** + * Gets the value of the property. + */ + getRotationX(): number; + + /** + * Sets the value of the property. + */ + setRotationX(rotationX: number): void; + + /** + * Gets the value of the property. + */ + getRotationY(): number; + + /** + * Sets the value of the property. + */ + setRotationY(rotationY: number): void; + + /** + * Gets the value of the property. + */ + getScaleX(): number; + + /** + * Sets the value of the property. + */ + setScaleX(scaleX: number): void; + + /** + * Gets the value of the property. + */ + getScaleY(): number; + + /** + * Sets the value of the property. + */ + setScaleY(scaleY: number): void; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getSoftKeyboardOnFocus(): number; + + /** + * Sets the value of the property. + */ + setSoftKeyboardOnFocus(softKeyboardOnFocus: number): void; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedback(): boolean; + + /** + * Sets the value of the property. + */ + setTouchFeedback(touchFeedback: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedbackColor(): string; + + /** + * Sets the value of the property. + */ + setTouchFeedbackColor(touchFeedbackColor: string): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getTranslationX(): number; + + /** + * Sets the value of the property. + */ + setTranslationX(translationX: number): void; + + /** + * Gets the value of the property. + */ + getTranslationY(): number; + + /** + * Sets the value of the property. + */ + setTranslationY(translationY: number): void; + + /** + * Gets the value of the property. + */ + getTranslationZ(): number; + + /** + * Sets the value of the property. + */ + setTranslationZ(translationZ: number): void; + + /** + * Gets the value of the property. + */ + getTransitionName(): string; + + /** + * Sets the value of the property. + */ + setTransitionName(transitionName: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getKeepScreenOn(): boolean; + + /** + * Sets the value of the property. + */ + setKeepScreenOn(keepScreenOn: boolean): void; + + } + + /** + * An empty drawing surface or container + */ + interface View { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * Disabled background color of the view, as a color name or hex triplet. + */ + backgroundDisabledColor: string; + + /** + * Disabled background image for the view, specified as a local file path or URL. + */ + backgroundDisabledImage: string; + + /** + * Focused background color of the view, as a color name or hex triplet. + */ + backgroundFocusedColor: string; + + /** + * Focused background image for the view, specified as a local file path or URL. + */ + backgroundFocusedImage: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Selected background color of the view, as a color name or hex triplet. + */ + backgroundSelectedColor: string; + + /** + * Selected background image url for the view, specified as a local file path or URL. + */ + backgroundSelectedImage: string; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * Base elevation of the view relative to its parent in pixels. + */ + elevation: number; + + /** + * Whether view should be focusable while navigating with the trackball. + */ + focusable: boolean; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * Sets the behavior when hiding an object to release or keep the free space + */ + hiddenBehavior: number; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * When on, animate call overrides current animation if applicable. + */ + overrideCurrentAnimation: boolean; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * Clockwise 2D rotation of the view in degrees. + */ + rotation: number; + + /** + * Clockwise rotation of the view in degrees (x-axis). + */ + rotationX: number; + + /** + * Clockwise rotation of the view in degrees (y-axis). + */ + rotationY: number; + + /** + * Scaling of the view in x-axis in pixels. + */ + scaleX: number; + + /** + * Scaling of the view in y-axis in pixels. + */ + scaleY: number; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * Determines keyboard behavior when this view is focused. + */ + softKeyboardOnFocus: number; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * A material design visual construct that provides an instantaneous visual confirmation of touch point. + */ + touchFeedback: boolean; + + /** + * Optional touch feedback ripple color. This has no effect unless `touchFeedback` is true. + */ + touchFeedbackColor: string; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Horizontal location of the view relative to its left position in pixels. + */ + translationX: number; + + /** + * Vertical location of the view relative to its top position in pixels. + */ + translationY: number; + + /** + * Depth of the view relative to its elevation in pixels. + */ + translationZ: number; + + /** + * A name to identify this view in activity transition. + */ + transitionName: string; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Determines whether to keep the device screen on. + */ + keepScreenOn: boolean; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledColor(backgroundDisabledColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledImage(backgroundDisabledImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedColor(backgroundFocusedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedImage(backgroundFocusedImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedColor(backgroundSelectedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedImage(backgroundSelectedImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getElevation(): number; + + /** + * Sets the value of the property. + */ + setElevation(elevation: number): void; + + /** + * Gets the value of the property. + */ + getFocusable(): boolean; + + /** + * Sets the value of the property. + */ + setFocusable(focusable: boolean): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getHiddenBehavior(): number; + + /** + * Sets the value of the property. + */ + setHiddenBehavior(hiddenBehavior: number): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getOverrideCurrentAnimation(): boolean; + + /** + * Sets the value of the property. + */ + setOverrideCurrentAnimation(overrideCurrentAnimation: boolean): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getRotation(): number; + + /** + * Sets the value of the property. + */ + setRotation(rotation: number): void; + + /** + * Gets the value of the property. + */ + getRotationX(): number; + + /** + * Sets the value of the property. + */ + setRotationX(rotationX: number): void; + + /** + * Gets the value of the property. + */ + getRotationY(): number; + + /** + * Sets the value of the property. + */ + setRotationY(rotationY: number): void; + + /** + * Gets the value of the property. + */ + getScaleX(): number; + + /** + * Sets the value of the property. + */ + setScaleX(scaleX: number): void; + + /** + * Gets the value of the property. + */ + getScaleY(): number; + + /** + * Sets the value of the property. + */ + setScaleY(scaleY: number): void; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getSoftKeyboardOnFocus(): number; + + /** + * Sets the value of the property. + */ + setSoftKeyboardOnFocus(softKeyboardOnFocus: number): void; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedback(): boolean; + + /** + * Sets the value of the property. + */ + setTouchFeedback(touchFeedback: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedbackColor(): string; + + /** + * Sets the value of the property. + */ + setTouchFeedbackColor(touchFeedbackColor: string): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getTranslationX(): number; + + /** + * Sets the value of the property. + */ + setTranslationX(translationX: number): void; + + /** + * Gets the value of the property. + */ + getTranslationY(): number; + + /** + * Sets the value of the property. + */ + setTranslationY(translationY: number): void; + + /** + * Gets the value of the property. + */ + getTranslationZ(): number; + + /** + * Sets the value of the property. + */ + setTranslationZ(translationZ: number): void; + + /** + * Gets the value of the property. + */ + getTransitionName(): string; + + /** + * Sets the value of the property. + */ + setTransitionName(transitionName: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getKeepScreenOn(): boolean; + + /** + * Sets the value of the property. + */ + setKeepScreenOn(keepScreenOn: boolean): void; + + } + + /** + * The 2D Matrix is an object for holding values for an affine transformation matrix. + */ + interface Matrix2D extends Titanium.Proxy { + /** + * The entry at position [1,1] in the matrix. + */ + a: number; + + /** + * The entry at position [1,2] in the matrix. + */ + b: number; + + /** + * The entry at position [2,1] in the matrix. + */ + c: number; + + /** + * The entry at position [2,2] in the matrix. + */ + d: number; + + /** + * The entry at position [3,1] in the matrix. + */ + tx: number; + + /** + * The entry at position [3,2] in the matrix. + */ + ty: number; + + /** + * Returns a matrix constructed by inverting this matrix. + */ + invert(): Titanium.UI.Matrix2D; + + /** + * Returns a matrix constructed by combining two existing matrices. + */ + multiply(t2: Titanium.UI.Matrix2D): Titanium.UI.Matrix2D; + + /** + * Returns a matrix constructed by rotating this matrix. + */ + rotate(angle: number, toAngle?: number): Titanium.UI.Matrix2D; + + /** + * Returns a `2DMatrix` object that specifies a scaling animation from one scale to another. + */ + scale(sx: number, sy: number, toSx?: number, toSy?: number): Titanium.UI.Matrix2D; + + /** + * Returns a matrix constructed by applying a translation transform to this matrix. + */ + translate(tx: number, ty: number): Titanium.UI.Matrix2D; + + /** + * Gets the value of the property. + */ + getA(): number; + + /** + * Sets the value of the property. + */ + setA(a: number): void; + + /** + * Gets the value of the property. + */ + getB(): number; + + /** + * Sets the value of the property. + */ + setB(b: number): void; + + /** + * Gets the value of the property. + */ + getC(): number; + + /** + * Sets the value of the property. + */ + setC(c: number): void; + + /** + * Gets the value of the property. + */ + getD(): number; + + /** + * Sets the value of the property. + */ + setD(d: number): void; + + /** + * Gets the value of the property. + */ + getTx(): number; + + /** + * Sets the value of the property. + */ + setTx(tx: number): void; + + /** + * Gets the value of the property. + */ + getTy(): number; + + /** + * Sets the value of the property. + */ + setTy(ty: number): void; + + } + + /** + * The 3D Matrix is an object for holding values for a 3D affine transform. + */ + interface Matrix3D extends Titanium.Proxy { + /** + * The entry at position [1,1] in the matrix. + */ + m11: number; + + /** + * The entry at position [1,2] in the matrix. + */ + m12: number; + + /** + * The entry at position [1,3] in the matrix. + */ + m13: number; + + /** + * The entry at position [1,4] in the matrix. + */ + m14: number; + + /** + * The entry at position [2,1] in the matrix. + */ + m21: number; + + /** + * The entry at position [2,2] in the matrix. + */ + m22: number; + + /** + * The entry at position [2,3] in the matrix. + */ + m23: number; + + /** + * The entry at position [2,4] in the matrix. + */ + m24: number; + + /** + * The entry at position [3,1] in the matrix. + */ + m31: number; + + /** + * The entry at position [3,2] in the matrix. + */ + m32: number; + + /** + * The entry at position [3,3] in the matrix. + */ + m33: number; + + /** + * The entry at position [3,4] in the matrix. + */ + m34: number; + + /** + * The entry at position [4,1] in the matrix. + */ + m41: number; + + /** + * The entry at position [4,2] in the matrix. + */ + m42: number; + + /** + * The entry at position [4,3] in the matrix. + */ + m43: number; + + /** + * The entry at position [4,4] in the matrix. + */ + m44: number; + + /** + * Returns a matrix constructed by inverting this matrix. + */ + invert(): Titanium.UI.Matrix3D; + + /** + * Returns a matrix constructed by combining two existing matrix. + */ + multiply(t2: Titanium.UI.Matrix3D): Titanium.UI.Matrix3D; + + /** + * Returns a matrix constructed by rotating this matrix. + */ + rotate(angle: number, x: number, y: number, z: number): Titanium.UI.Matrix3D; + + /** + * Returns a matrix constructed by scaling this matrix. + */ + scale(sx: number, sy: number, sz: number): Titanium.UI.Matrix3D; + + /** + * Returns a matrix constructed by translating an existing matrix. + */ + translate(tx: number, ty: number, tz: number): Titanium.UI.Matrix3D; + + /** + * Gets the value of the property. + */ + getM11(): number; + + /** + * Sets the value of the property. + */ + setM11(m11: number): void; + + /** + * Gets the value of the property. + */ + getM12(): number; + + /** + * Sets the value of the property. + */ + setM12(m12: number): void; + + /** + * Gets the value of the property. + */ + getM13(): number; + + /** + * Sets the value of the property. + */ + setM13(m13: number): void; + + /** + * Gets the value of the property. + */ + getM14(): number; + + /** + * Sets the value of the property. + */ + setM14(m14: number): void; + + /** + * Gets the value of the property. + */ + getM21(): number; + + /** + * Sets the value of the property. + */ + setM21(m21: number): void; + + /** + * Gets the value of the property. + */ + getM22(): number; + + /** + * Sets the value of the property. + */ + setM22(m22: number): void; + + /** + * Gets the value of the property. + */ + getM23(): number; + + /** + * Sets the value of the property. + */ + setM23(m23: number): void; + + /** + * Gets the value of the property. + */ + getM24(): number; + + /** + * Sets the value of the property. + */ + setM24(m24: number): void; + + /** + * Gets the value of the property. + */ + getM31(): number; + + /** + * Sets the value of the property. + */ + setM31(m31: number): void; + + /** + * Gets the value of the property. + */ + getM32(): number; + + /** + * Sets the value of the property. + */ + setM32(m32: number): void; + + /** + * Gets the value of the property. + */ + getM33(): number; + + /** + * Sets the value of the property. + */ + setM33(m33: number): void; + + /** + * Gets the value of the property. + */ + getM34(): number; + + /** + * Sets the value of the property. + */ + setM34(m34: number): void; + + /** + * Gets the value of the property. + */ + getM41(): number; + + /** + * Sets the value of the property. + */ + setM41(m41: number): void; + + /** + * Gets the value of the property. + */ + getM42(): number; + + /** + * Sets the value of the property. + */ + setM42(m42: number): void; + + /** + * Gets the value of the property. + */ + getM43(): number; + + /** + * Sets the value of the property. + */ + setM43(m43: number): void; + + /** + * Gets the value of the property. + */ + getM44(): number; + + /** + * Sets the value of the property. + */ + setM44(m44: number): void; + + } + + /** + * An activity indicator that lets the user know an action is taking place. + */ + interface ActivityIndicator extends Titanium.UI.View { + /** + * Color of the message text, as a color name or hex triplet. + */ + color: string; + + /** + * Font used for the message text. + */ + font: Font; + + /** + * Message text. + */ + message: string; + + /** + * Key identifying a string in the locale file to use for the message text. + */ + messageid: string; + + /** + * The style for the activity indicator. + */ + style: number; + + /** + * Color of the animated indicator. + */ + indicatorColor: string; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + /** + * Gets the value of the property. + */ + getMessage(): string; + + /** + * Sets the value of the property. + */ + setMessage(message: string): void; + + /** + * Gets the value of the property. + */ + getMessageid(): string; + + /** + * Sets the value of the property. + */ + setMessageid(messageid: string): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + /** + * Gets the value of the property. + */ + getIndicatorColor(): string; + + /** + * Sets the value of the property. + */ + setIndicatorColor(indicatorColor: string): void; + + } + + /** + * An alert dialog is a modal view that includes an optional title, a message and buttons, + * positioned in the middle of the display. + */ + interface AlertDialog extends Titanium.UI.View { + /** + * View to load inside the message area, to create a custom layout. + */ + androidView: Titanium.UI.View; + + /** + * Name of each button to create. + */ + buttonNames: string[]; + + /** + * Index to define the cancel button. + */ + cancel: number; + + /** + * When this is set to `true`, the dialog is canceled when touched outside the window's bounds. + */ + canceledOnTouchOutside: boolean; + + /** + * Index to define the destructive button. + */ + destructive: number; + + /** + * Hint text of the text field inside the dialog. + */ + hintText: string; + + /** + * Key identifying a string from the locale file to use for the + * [hintText](Titanium.UI.AlertDialog.hintText) property. + */ + hinttextid: string; + + /** + * Keyboard type to display when this text field inside the dialog is focused. + */ + keyboardType: number; + + /** + * Keyboard appearance to be displayed when the text field inside the dialog is focused. + */ + keyboardAppearance: number; + + /** + * Placeholder of the login text field inside the dialog. + */ + loginPlaceholder: string; + + /** + * Hint text of the login text field inside the dialog. + */ + loginHintText: string; + + /** + * Key identifying a string from the locale file to use for the + * [loginHintText](Titanium.UI.AlertDialog.loginHintText) property. + */ + loginhinttextid: string; + + /** + * Specifies the text to display on the keyboard `Return` key when this field is focused. + */ + loginReturnKeyType: number; + + /** + * Value of the login text field inside the dialog. + */ + loginValue: string; + + /** + * Keyboard type to display when this text field inside the dialog is focused. + */ + loginKeyboardType: number; + + /** + * Dialog message. + */ + message: string; + + /** + * Key identifying a string in the locale file to use for the message text. + */ + messageid: string; + + /** + * Text for the `OK` button. + */ + ok: string; + + /** + * Key identifying a string in the locale file to use for the `ok` text. + */ + okid: string; + + /** + * Placeholder of the password text field inside the dialog. + */ + passwordPlaceholder: string; + + /** + * Hint text of the password text field inside the dialog. + */ + passwordHintText: string; + + /** + * Key identifying a string from the locale file to use for the + * [passwordHintText](Titanium.UI.AlertDialog.passwordHintText) property. + */ + passwordhinttextid: string; + + /** + * Specifies the text to display on the keyboard `Return` key when this field is focused. + */ + passwordReturnKeyType: number; + + /** + * Value of the password text field inside the dialog. + */ + passwordValue: string; + + /** + * Keyboard type to display when this text field inside the dialog is focused. + */ + passwordKeyboardType: number; + + /** + * Placeholder of the text field inside the dialog. + */ + placeholder: string; + + /** + * Boolean value indicating if the alert dialog should only be cancelled by user gesture or by hide method. + */ + persistent: boolean; + + /** + * Index to define the preferred button. + */ + preferred: number; + + /** + * Specifies the text to display on the keyboard `Return` key when this field is focused. + */ + returnKeyType: number; + + /** + * The style for the alert dialog. + */ + style: number; + + /** + * Title of the dialog. + */ + title: string; + + /** + * Key identifying a string in the locale file to use for the title text. + */ + titleid: string; + + /** + * Value of the text field inside the dialog. + */ + value: string; + + /** + * Gets the value of the property. + */ + getButtonNames(): string[]; + + /** + * Sets the value of the property. + */ + setButtonNames(buttonNames: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getCancel(): number; + + /** + * Sets the value of the property. + */ + setCancel(cancel: number): void; + + /** + * Gets the value of the property. + */ + getCanceledOnTouchOutside(): boolean; + + /** + * Sets the value of the property. + */ + setCanceledOnTouchOutside(canceledOnTouchOutside: boolean): void; + + /** + * Gets the value of the property. + */ + getDestructive(): number; + + /** + * Sets the value of the property. + */ + setDestructive(destructive: number): void; + + /** + * Gets the value of the property. + */ + getHintText(): string; + + /** + * Sets the value of the property. + */ + setHintText(hintText: string): void; + + /** + * Gets the value of the property. + */ + getHinttextid(): string; + + /** + * Sets the value of the property. + */ + setHinttextid(hinttextid: string): void; + + /** + * Gets the value of the property. + */ + getKeyboardType(): number; + + /** + * Sets the value of the property. + */ + setKeyboardType(keyboardType: number): void; + + /** + * Gets the value of the property. + */ + getKeyboardAppearance(): number; + + /** + * Sets the value of the property. + */ + setKeyboardAppearance(keyboardAppearance: number): void; + + /** + * Gets the value of the property. + */ + getLoginPlaceholder(): string; + + /** + * Sets the value of the property. + */ + setLoginPlaceholder(loginPlaceholder: string): void; + + /** + * Gets the value of the property. + */ + getLoginHintText(): string; + + /** + * Sets the value of the property. + */ + setLoginHintText(loginHintText: string): void; + + /** + * Gets the value of the property. + */ + getLoginhinttextid(): string; + + /** + * Sets the value of the property. + */ + setLoginhinttextid(loginhinttextid: string): void; + + /** + * Gets the value of the property. + */ + getLoginReturnKeyType(): number; + + /** + * Sets the value of the property. + */ + setLoginReturnKeyType(loginReturnKeyType: number): void; + + /** + * Gets the value of the property. + */ + getLoginValue(): string; + + /** + * Sets the value of the property. + */ + setLoginValue(loginValue: string): void; + + /** + * Gets the value of the property. + */ + getLoginKeyboardType(): number; + + /** + * Sets the value of the property. + */ + setLoginKeyboardType(loginKeyboardType: number): void; + + /** + * Gets the value of the property. + */ + getMessage(): string; + + /** + * Sets the value of the property. + */ + setMessage(message: string): void; + + /** + * Gets the value of the property. + */ + getMessageid(): string; + + /** + * Sets the value of the property. + */ + setMessageid(messageid: string): void; + + /** + * Gets the value of the property. + */ + getOk(): string; + + /** + * Sets the value of the property. + */ + setOk(ok: string): void; + + /** + * Gets the value of the property. + */ + getOkid(): string; + + /** + * Sets the value of the property. + */ + setOkid(okid: string): void; + + /** + * Gets the value of the property. + */ + getPasswordPlaceholder(): string; + + /** + * Sets the value of the property. + */ + setPasswordPlaceholder(passwordPlaceholder: string): void; + + /** + * Gets the value of the property. + */ + getPasswordHintText(): string; + + /** + * Sets the value of the property. + */ + setPasswordHintText(passwordHintText: string): void; + + /** + * Gets the value of the property. + */ + getPasswordhinttextid(): string; + + /** + * Sets the value of the property. + */ + setPasswordhinttextid(passwordhinttextid: string): void; + + /** + * Gets the value of the property. + */ + getPasswordReturnKeyType(): number; + + /** + * Sets the value of the property. + */ + setPasswordReturnKeyType(passwordReturnKeyType: number): void; + + /** + * Gets the value of the property. + */ + getPasswordValue(): string; + + /** + * Sets the value of the property. + */ + setPasswordValue(passwordValue: string): void; + + /** + * Gets the value of the property. + */ + getPasswordKeyboardType(): number; + + /** + * Sets the value of the property. + */ + setPasswordKeyboardType(passwordKeyboardType: number): void; + + /** + * Gets the value of the property. + */ + getPlaceholder(): string; + + /** + * Sets the value of the property. + */ + setPlaceholder(placeholder: string): void; + + /** + * Gets the value of the property. + */ + getPersistent(): boolean; + + /** + * Sets the value of the property. + */ + setPersistent(persistent: boolean): void; + + /** + * Gets the value of the property. + */ + getPreferred(): number; + + /** + * Sets the value of the property. + */ + setPreferred(preferred: number): void; + + /** + * Gets the value of the property. + */ + getReturnKeyType(): number; + + /** + * Sets the value of the property. + */ + setReturnKeyType(returnKeyType: number): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleid(): string; + + /** + * Sets the value of the property. + */ + setTitleid(titleid: string): void; + + /** + * Gets the value of the property. + */ + getValue(): string; + + /** + * Sets the value of the property. + */ + setValue(value: string): void; + + } + + /** + * The `Animation` object defines an animation that can be applied to a view. + */ + interface Animation extends Titanium.Proxy { + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Specifies if the animation should be replayed in reverse upon completion. + */ + autoreverse: boolean; + + /** + * Value of the `backgroundColor` property at the end of the animation, as a color name + * or hex triplet. + */ + backgroundColor: string; + + /** + * Value of the `bottom` property at the end of the animation. + */ + bottom: number; + + /** + * Value of the `center` property at the end of the animation. + */ + center: any; + + /** + * Value of the `color` property at the end of the animation, as a color name or hex triplet. + */ + color: string; + + /** + * Animation curve or easing function to apply to the animation. + */ + curve: number; + + /** + * Delay, in milliseconds before starting the animation. + */ + delay: number; + + /** + * Duration of the animation, in milliseconds. + */ + duration: number; + + /** + * Value of the `height` property at the end of the animation. + */ + height: number; + + /** + * Value of the `left` property at the end of the animation. + */ + left: number; + + /** + * Value of the `opacity` property at the end of the animation. + */ + opacity: number; + + /** + * Value of the `opaque` property at the end of the animation. + */ + opaque: boolean; + + /** + * Number of times the animation should be performed. + */ + repeat: number; + + /** + * Value of the `right` property at the end of the animation. + */ + right: number; + + /** + * Value of the `top` property at the end of the animation. + */ + top: number; + + /** + * Animate the view from its current tranform to the specified transform. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Transition type to use during a transition animation. + */ + transition: number; + + /** + * New view to transition to. + */ + view: Titanium.UI.View; + + /** + * Value of the `visible` property at the end of the animation. + */ + visible: boolean; + + /** + * Value of the `width` property at the end of the animation. + */ + width: number; + + /** + * Value of the `zIndex` property at the end of the animation. + */ + zIndex: number; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAutoreverse(): boolean; + + /** + * Sets the value of the property. + */ + setAutoreverse(autoreverse: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBottom(): number; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Gets the value of the property. + */ + getCenter(): any; + + /** + * Sets the value of the property. + */ + setCenter(center: any): void; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getCurve(): number; + + /** + * Sets the value of the property. + */ + setCurve(curve: number): void; + + /** + * Gets the value of the property. + */ + getDelay(): number; + + /** + * Sets the value of the property. + */ + setDelay(delay: number): void; + + /** + * Gets the value of the property. + */ + getDuration(): number; + + /** + * Sets the value of the property. + */ + setDuration(duration: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Gets the value of the property. + */ + getLeft(): number; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getOpaque(): boolean; + + /** + * Sets the value of the property. + */ + setOpaque(opaque: boolean): void; + + /** + * Gets the value of the property. + */ + getRepeat(): number; + + /** + * Sets the value of the property. + */ + setRepeat(repeat: number): void; + + /** + * Gets the value of the property. + */ + getRight(): number; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Gets the value of the property. + */ + getTop(): number; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getTransition(): number; + + /** + * Sets the value of the property. + */ + setTransition(transition: number): void; + + /** + * Gets the value of the property. + */ + getView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setView(view: any): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + } + + /** + * An attributed string proxy manages character strings and associated sets of attributes (for example, + * font and foregroundcolor) that apply to individual characters or ranges of characters in the string. + */ + interface AttributedString extends Titanium.Proxy { + /** + * The text applied to the attributed string. + */ + text: string; + + /** + * An array of attributes to add. + */ + attributes: Attribute[]; + + /** + * Adds an [attribute](Attribute) with the given name and value to the characters in the specified range. + */ + addAttribute(attribute: Attribute): void; + + /** + * Gets the value of the property. + */ + getText(): string; + + /** + * Sets the value of the property. + */ + setText(text: string): void; + + /** + * Gets the value of the property. + */ + getAttributes(): Attribute[]; + + /** + * Sets the value of the property. + */ + setAttributes(attributes: ReadonlyArray): void; + + } + + /** + * A button widget that has four states: normal, disabled, focused and selected. + */ + interface Button extends Titanium.UI.View { + /** + * Default button text color, as a color name or hex triplet. + */ + color: string; + + /** + * Text color of the button in its disabled state, as a color name or hex triplet. + */ + disabledColor: string; + + /** + * Set to `true` to enable the button, `false` to disable the button. + */ + enabled: boolean; + + /** + * Font to use for the button text. + */ + font: Font; + + /** + * Image to display on the button, specified as a local path, URL or a `Blob`. + */ + image: string | Titanium.Blob; + + /** + * Button text color used to indicate the selected state, as a color name or hex triplet. + */ + selectedColor: string; + + /** + * Shadow color of the [title](Titanium.UI.Button.title), as a color name or hex triplet. + */ + shadowColor: string; + + /** + * Shadow offset of the [title](Titanium.UI.Button.title), as a dictionary with the properties `x` and `y`. + */ + shadowOffset: any; + + /** + * Shadow radius of the [title](Titanium.UI.Button.title). + */ + shadowRadius: number; + + /** + * Style constant for the button, as defined in . + */ + style: number; + + /** + * Specifies an iOS system button appearance, as defined in . + */ + systemButton: number; + + /** + * Text alignment, specified using one of the text alignment constants. + */ + textAlign: string | number; + + /** + * Button title. + */ + title: string; + + /** + * Key identifying a string from the locale file to use for the button title. + */ + titleid: string; + + /** + * Vertical alignment for the text field, specified using one of the + * vertical alignment constants from . + */ + verticalAlign: number | string; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getDisabledColor(): string; + + /** + * Sets the value of the property. + */ + setDisabledColor(disabledColor: string): void; + + /** + * Gets the value of the property. + */ + getEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setEnabled(enabled: boolean): void; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + /** + * Gets the value of the property. + */ + getImage(): string | Titanium.Blob; + + /** + * Sets the value of the property. + */ + setImage(image: string): void; + + /** + * Sets the value of the property. + */ + setImage(image: Titanium.Blob): void; + + /** + * Gets the value of the property. + */ + getSelectedColor(): string; + + /** + * Sets the value of the property. + */ + setSelectedColor(selectedColor: string): void; + + /** + * Gets the value of the property. + */ + getShadowColor(): string; + + /** + * Sets the value of the property. + */ + setShadowColor(shadowColor: string): void; + + /** + * Gets the value of the property. + */ + getShadowOffset(): any; + + /** + * Sets the value of the property. + */ + setShadowOffset(shadowOffset: any): void; + + /** + * Gets the value of the property. + */ + getShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setShadowRadius(shadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + /** + * Gets the value of the property. + */ + getSystemButton(): number; + + /** + * Sets the value of the property. + */ + setSystemButton(systemButton: number): void; + + /** + * Gets the value of the property. + */ + getTextAlign(): string | number; + + /** + * Sets the value of the property. + */ + setTextAlign(textAlign: string): void; + + /** + * Sets the value of the property. + */ + setTextAlign(textAlign: number): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleid(): string; + + /** + * Sets the value of the property. + */ + setTitleid(titleid: string): void; + + /** + * Gets the value of the property. + */ + getVerticalAlign(): number | string; + + /** + * Sets the value of the property. + */ + setVerticalAlign(verticalAlign: number): void; + + /** + * Sets the value of the property. + */ + setVerticalAlign(verticalAlign: string): void; + + } + + /** + * An iOS button bar component. + */ + interface ButtonBar extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Index of the currently selected button. + */ + index: number; + + /** + * Array of labels for the button bar. + */ + labels: string[] | BarItemType[]; + + /** + * Style of the button bar. + */ + style: number; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getIndex(): number; + + /** + * Sets the value of the property. + */ + setIndex(index: number): void; + + /** + * Gets the value of the property. + */ + getLabels(): string[] | BarItemType[]; + + /** + * Sets the value of the property. + */ + setLabels(labels: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setLabels(labels: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + } + + /** + * The cover flow view is a container showing animated three-dimensional images in a style + * consistent with the cover flow presentation used for iPod, iTunes, and file browsing. + */ + interface CoverFlowView extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Array of images to display in the view. + */ + images: string[] | Titanium.Blob[] | Titanium.Filesystem.File[] | CoverFlowImageType[]; + + /** + * Index to make selected. + */ + selected: number; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Changes the image for a specified index. + */ + setImage(index: number, image: string): void; + + /** + * Changes the image for a specified index. + */ + setImage(index: number, image: Titanium.Blob): void; + + /** + * Changes the image for a specified index. + */ + setImage(index: number, image: Titanium.Filesystem.File): void; + + /** + * Changes the image for a specified index. + */ + setImage(index: number, image: CoverFlowImageType): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getImages(): string[] | Titanium.Blob[] | Titanium.Filesystem.File[] | CoverFlowImageType[]; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getSelected(): number; + + /** + * Sets the value of the property. + */ + setSelected(selected: number): void; + + } + + /** + * A dashboard item is a view that is displayed as an icon in a . + */ + interface DashboardItem extends Titanium.Proxy { + /** + * Integer value displayed in a badge. + */ + badge: number; + + /** + * Determines whether this item can be deleted when it edit mode. + */ + canDelete: boolean; + + /** + * Image or path to image to display in the item by default. + */ + image: string | Titanium.Blob; + + /** + * Image or path to image to display in the item as it is selected. + */ + selectedImage: string | Titanium.Blob; + + /** + * Gets the value of the property. + */ + getBadge(): number; + + /** + * Sets the value of the property. + */ + setBadge(badge: number): void; + + /** + * Gets the value of the property. + */ + getCanDelete(): boolean; + + /** + * Sets the value of the property. + */ + setCanDelete(canDelete: boolean): void; + + /** + * Gets the value of the property. + */ + getImage(): string | Titanium.Blob; + + /** + * Sets the value of the property. + */ + setImage(image: string): void; + + /** + * Sets the value of the property. + */ + setImage(image: Titanium.Blob): void; + + /** + * Gets the value of the property. + */ + getSelectedImage(): string | Titanium.Blob; + + /** + * Sets the value of the property. + */ + setSelectedImage(selectedImage: string): void; + + /** + * Sets the value of the property. + */ + setSelectedImage(selectedImage: Titanium.Blob): void; + + } + + /** + * A dashboard view is an iOS Springboard-like view of items that may + * be deleted and reordered by the user using its built-in edit mode. + */ + interface DashboardView extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * The number of columns of items in the view. + */ + columnCount: number; + + /** + * The number of rows of items in the view. + */ + rowCount: number; + + /** + * Items to display in this view. + */ + data: Titanium.UI.DashboardItem[]; + + /** + * Determines whether edit mode is activated by a longpress of an item. + */ + editable: boolean; + + /** + * Determines whether the wobble visual editing cue is enabled in edit mode. + */ + wobble: boolean; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Enable edit mode. + */ + startEditing(): void; + + /** + * Disable edit mode. + */ + stopEditing(): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getColumnCount(): number; + + /** + * Sets the value of the property. + */ + setColumnCount(columnCount: number): void; + + /** + * Gets the value of the property. + */ + getRowCount(): number; + + /** + * Sets the value of the property. + */ + setRowCount(rowCount: number): void; + + /** + * Gets the value of the property. + */ + getData(): Titanium.UI.DashboardItem[]; + + /** + * Sets the value of the property. + */ + setData(data: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getEditable(): boolean; + + /** + * Sets the value of the property. + */ + setEditable(editable: boolean): void; + + /** + * Gets the value of the property. + */ + getWobble(): boolean; + + /** + * Sets the value of the property. + */ + setWobble(wobble: boolean): void; + + } + + /** + * An email dialog is a modal window that allows users to compose and send an email. + */ + interface EmailDialog extends Titanium.UI.View { + /** + * Constant for the `CANCELLED` status result. On Android, this property exists but is not used. + */ + readonly CANCELLED: number; + + /** + * Constant for the `FAILED` status result. + */ + readonly FAILED: number; + + /** + * Constant for the `SAVED` status result. On Android, this property exists but is not used. + */ + readonly SAVED: number; + + /** + * Constant for the `SENT` status result. + */ + readonly SENT: number; + + /** + * Bar color of the email dialog window, as a color name or hex triplet. + */ + barColor: string; + + /** + * Recipients of the email included via the `BCC` (Blind Carbon Copy) field. + */ + bccRecipients: string[]; + + /** + * Recipients of the email included via the `CC` (Carbon Copy) field. + */ + ccRecipients: string[]; + + /** + * Determines whether the email message, specifically the contents of + * [messageBody](Titanium.UI.EmailDialog.messageBody), should be sent as HTML content type + * rather than plain text. + */ + html: boolean; + + /** + * Email message body. + */ + messageBody: string; + + /** + * Subject line for the email. + */ + subject: string; + + /** + * Recipients of the email included via the main `TO` field. + */ + toRecipients: string[]; + + /** + * Adds an attachment. + */ + addAttachment(attachment: Titanium.Blob): void; + + /** + * Adds an attachment. + */ + addAttachment(attachment: Titanium.Filesystem.File): void; + + /** + * Indicates whether sending email is supported by the system. + */ + isSupported(): boolean; + + /** + * Opens this email dialog. + */ + open(properties: any): void; + + /** + * Gets the value of the property. + */ + getBarColor(): string; + + /** + * Sets the value of the property. + */ + setBarColor(barColor: string): void; + + /** + * Gets the value of the property. + */ + getBccRecipients(): string[]; + + /** + * Sets the value of the property. + */ + setBccRecipients(bccRecipients: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getCcRecipients(): string[]; + + /** + * Sets the value of the property. + */ + setCcRecipients(ccRecipients: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getHtml(): boolean; + + /** + * Sets the value of the property. + */ + setHtml(html: boolean): void; + + /** + * Gets the value of the property. + */ + getMessageBody(): string; + + /** + * Sets the value of the property. + */ + setMessageBody(messageBody: string): void; + + /** + * Gets the value of the property. + */ + getSubject(): string; + + /** + * Sets the value of the property. + */ + setSubject(subject: string): void; + + /** + * Gets the value of the property. + */ + getToRecipients(): string[]; + + /** + * Sets the value of the property. + */ + setToRecipients(toRecipients: ReadonlyArray): void; + + } + + /** + * A view to display a single image or series of animated images. + */ + interface ImageView extends Titanium.UI.View { + /** + * Indicates whether animation is running. + */ + readonly animating: boolean; + + /** + * Indicates whether the image should be rotated based on exif orientation data. + * By default, this is false on android and true on iOS. + */ + autorotate: boolean; + + /** + * Number of times to retry decoding the bitmap at a URL. + */ + decodeRetries: number; + + /** + * Local path to the default image to display while loading a remote image. + */ + defaultImage: string; + + /** + * Amount of time in milliseconds to animate one cycle. + */ + duration: number; + + /** + * Show zoom controls when the user touches the image view. + */ + enableZoomControls: boolean; + + /** + * Set to `true` to prevent scaling of 2x-resolution remote images for Retina + * displays. + */ + hires: boolean; + + /** + * Image to display. + */ + image: string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Array of images to animate, defined using local filesystem paths, `File` objects, + * remote URLs (Android only), or `Blob` objects containing image data. + * When using this property, an initial `start()` needs to be called upon the ImageView before any image will show in this imageview. + * Related properties/methods to look at: `start`, `stop`, `pause`, `reverse`, `resume` and `repeatCount` + */ + images: string[] | Titanium.Blob[] | Titanium.Filesystem.File[]; + + /** + * Indicates whether the animation is paused. + */ + readonly paused: boolean; + + /** + * Prevent the default image from being displayed while loading a remote image. This property + * is ignored when the `defaultImage` property is set. + */ + preventDefaultImage: boolean; + + /** + * Number of times to repeat the image animation. + */ + repeatCount: number; + + /** + * Run the animation in reverse. + */ + reverse: boolean; + + /** + * URL to the image to display. + */ + url: string; + + /** + * Pauses a running animation. Use `resume` method to continue. + */ + pause(): void; + + /** + * Resumes an animation from a `pause` state. + */ + resume(): void; + + /** + * Starts the image animation. On Android, also resets `index` to the first image. + */ + start(): void; + + /** + * Stops a running animation. On iOS, also resets `index` to the first image. + */ + stop(): void; + + /** + * Returns the image as a Blob object. + */ + toBlob(): Titanium.Blob; + + /** + * Gets the value of the property. + */ + getAnimating(): boolean; + + /** + * Gets the value of the property. + */ + getAutorotate(): boolean; + + /** + * Sets the value of the property. + */ + setAutorotate(autorotate: boolean): void; + + /** + * Gets the value of the property. + */ + getDecodeRetries(): number; + + /** + * Sets the value of the property. + */ + setDecodeRetries(decodeRetries: number): void; + + /** + * Gets the value of the property. + */ + getDefaultImage(): string; + + /** + * Sets the value of the property. + */ + setDefaultImage(defaultImage: string): void; + + /** + * Gets the value of the property. + */ + getDuration(): number; + + /** + * Sets the value of the property. + */ + setDuration(duration: number): void; + + /** + * Gets the value of the property. + */ + getEnableZoomControls(): boolean; + + /** + * Sets the value of the property. + */ + setEnableZoomControls(enableZoomControls: boolean): void; + + /** + * Gets the value of the property. + */ + getHires(): boolean; + + /** + * Sets the value of the property. + */ + setHires(hires: boolean): void; + + /** + * Gets the value of the property. + */ + getImage(): string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Sets the value of the property. + */ + setImage(image: string): void; + + /** + * Sets the value of the property. + */ + setImage(image: Titanium.Blob): void; + + /** + * Sets the value of the property. + */ + setImage(image: Titanium.Filesystem.File): void; + + /** + * Gets the value of the property. + */ + getImages(): string[] | Titanium.Blob[] | Titanium.Filesystem.File[]; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getPaused(): boolean; + + /** + * Gets the value of the property. + */ + getPreventDefaultImage(): boolean; + + /** + * Sets the value of the property. + */ + setPreventDefaultImage(preventDefaultImage: boolean): void; + + /** + * Gets the value of the property. + */ + getRepeatCount(): number; + + /** + * Sets the value of the property. + */ + setRepeatCount(repeatCount: number): void; + + /** + * Gets the value of the property. + */ + getReverse(): boolean; + + /** + * Sets the value of the property. + */ + setReverse(reverse: boolean): void; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + } + + /** + * A text label, with optional background image. + */ + interface Label extends Titanium.UI.View { + /** + * Specify an attributed string for the label. + */ + attributedString: Titanium.UI.AttributedString; + + /** + * Automatically convert certain text items in the label to clickable links. + */ + autoLink: number; + + /** + * Number of pixels to extend the background image past the label on the bottom. + */ + backgroundPaddingBottom: number; + + /** + * Number of pixels to extend the background image past the label on the left. + */ + backgroundPaddingLeft: number; + + /** + * Number of pixels to extend the background image past the label on the right. + */ + backgroundPaddingRight: number; + + /** + * Number of pixels to extend the background image past the label on the top. + */ + backgroundPaddingTop: number; + + /** + * Color of the label text, as a color name or hex triplet. + */ + color: string; + + /** + * Causes words in the text that are longer than the view is wide to be ellipsized instead of broken in the middle. + */ + ellipsize: number; + + /** + * Font to use for the label text. + */ + font: Font; + + /** + * Color of the label when in the highlighted state, as a color name or hex triplet. + */ + highlightedColor: string; + + /** + * Simple HTML formatting. + */ + html: string; + + /** + * Includes extra top and bottom padding to make room for accents that go above normal ascent and descent. + */ + includeFontPadding: boolean; + + /** + * Makes the label be exactly this many lines tall. + */ + lines: number; + + /** + * Line spacing of the [text](Titanium.UI.Label.text), as a dictionary with the properties `add` and `multiply`. + */ + lineSpacing: any; + + /** + * Makes the label at most this many lines tall. + */ + maxLines: number; + + /** + * Minimum font size when the font is sized based on the contents. + */ + minimumFontSize: number; + + /** + * Shadow color of the [text](Titanium.UI.Label.text), as a color name or hex triplet. + */ + shadowColor: string; + + /** + * Shadow offset of the [text](Titanium.UI.Label.text), as a dictionary with the properties `x` and `y`. + */ + shadowOffset: any; + + /** + * Shadow radius of the [text](Titanium.UI.Label.text). + */ + shadowRadius: number; + + /** + * Label text. + */ + text: string; + + /** + * Text alignment. + */ + textAlign: string | number; + + /** + * Key identifying a string from the locale file to use for the label text. + */ + textid: string; + + /** + * Enable or disable word wrapping in the label. + */ + wordWrap: boolean; + + /** + * Vertical text alignment, specified using one of the vertical alignment constants + * from . + */ + verticalAlign: number | string; + + /** + * Gets the value of the property. + */ + getAttributedString(): Titanium.UI.AttributedString; + + /** + * Sets the value of the property. + */ + setAttributedString(attributedString: Titanium.UI.AttributedString): void; + + /** + * Gets the value of the property. + */ + getAutoLink(): number; + + /** + * Sets the value of the property. + */ + setAutoLink(autoLink: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundPaddingBottom(): number; + + /** + * Sets the value of the property. + */ + setBackgroundPaddingBottom(backgroundPaddingBottom: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundPaddingLeft(): number; + + /** + * Sets the value of the property. + */ + setBackgroundPaddingLeft(backgroundPaddingLeft: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundPaddingRight(): number; + + /** + * Sets the value of the property. + */ + setBackgroundPaddingRight(backgroundPaddingRight: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundPaddingTop(): number; + + /** + * Sets the value of the property. + */ + setBackgroundPaddingTop(backgroundPaddingTop: number): void; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getEllipsize(): number; + + /** + * Sets the value of the property. + */ + setEllipsize(ellipsize: number): void; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + /** + * Gets the value of the property. + */ + getHighlightedColor(): string; + + /** + * Sets the value of the property. + */ + setHighlightedColor(highlightedColor: string): void; + + /** + * Gets the value of the property. + */ + getHtml(): string; + + /** + * Sets the value of the property. + */ + setHtml(html: string): void; + + /** + * Gets the value of the property. + */ + getIncludeFontPadding(): boolean; + + /** + * Sets the value of the property. + */ + setIncludeFontPadding(includeFontPadding: boolean): void; + + /** + * Gets the value of the property. + */ + getLines(): number; + + /** + * Sets the value of the property. + */ + setLines(lines: number): void; + + /** + * Gets the value of the property. + */ + getLineSpacing(): any; + + /** + * Sets the value of the property. + */ + setLineSpacing(lineSpacing: any): void; + + /** + * Gets the value of the property. + */ + getMaxLines(): number; + + /** + * Sets the value of the property. + */ + setMaxLines(maxLines: number): void; + + /** + * Gets the value of the property. + */ + getMinimumFontSize(): number; + + /** + * Sets the value of the property. + */ + setMinimumFontSize(minimumFontSize: number): void; + + /** + * Gets the value of the property. + */ + getShadowColor(): string; + + /** + * Sets the value of the property. + */ + setShadowColor(shadowColor: string): void; + + /** + * Gets the value of the property. + */ + getShadowOffset(): any; + + /** + * Sets the value of the property. + */ + setShadowOffset(shadowOffset: any): void; + + /** + * Gets the value of the property. + */ + getShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setShadowRadius(shadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getText(): string; + + /** + * Sets the value of the property. + */ + setText(text: string): void; + + /** + * Gets the value of the property. + */ + getTextAlign(): string | number; + + /** + * Sets the value of the property. + */ + setTextAlign(textAlign: string): void; + + /** + * Sets the value of the property. + */ + setTextAlign(textAlign: number): void; + + /** + * Gets the value of the property. + */ + getTextid(): string; + + /** + * Sets the value of the property. + */ + setTextid(textid: string): void; + + /** + * Gets the value of the property. + */ + getWordWrap(): boolean; + + /** + * Sets the value of the property. + */ + setWordWrap(wordWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getVerticalAlign(): number | string; + + /** + * Sets the value of the property. + */ + setVerticalAlign(verticalAlign: number): void; + + /** + * Sets the value of the property. + */ + setVerticalAlign(verticalAlign: string): void; + + } + + /** + * A list item is an individual item in a list section. + */ + interface ListItem extends Titanium.Proxy { + /** + * A user defined string that gets passed to events. + */ + itemId: string; + + /** + * Sets an accessory on the right side of an item. + */ + accessoryType: number; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * Background image to render when the item is not selected. + */ + backgroundImage: string; + + /** + * Background gradient to render when the item is not selected. + */ + backgroundGradient: Gradient; + + /** + * Background color of the view, as a color name or hex triplet when item is selected. + */ + selectedBackgroundColor: string; + + /** + * Background image to render when the item is selected. + */ + selectedBackgroundImage: string; + + /** + * Background gradient to render when the item is selected. + */ + selectedBackgroundGradient: Gradient; + + /** + * Specifies if the item can be deleted by a user initiated action. + */ + canEdit: boolean; + + /** + * Specifies if the item can be inserted by a user initiated action. + */ + canInsert: boolean; + + /** + * Specifies if the item can be reordered within the list view by a user initiated action. + */ + canMove: boolean; + + /** + * Specifies custom action items to be shown when when a list item is edited. + */ + editActions: RowActionType[]; + + /** + * The text to match against when the [ListView](Titanium.UI.ListView) is performing a search. + */ + searchableText: string; + + /** + * Default text color of the item when not selected, as a color name or hex triplet. + */ + color: string; + + /** + * Default text color of the subtitle, as a color name or hex triplet. + */ + subtitleColor: string; + + /** + * Color to use for the item title when the item is selected, as a color name or hex triplet. + */ + selectedColor: string; + + /** + * Color to use for the item subtitle when the item is selected, as a color name or hex triplet. + */ + selectedSubtitleColor: string; + + /** + * Font to use for the item title. + */ + font: Font; + + /** + * Row height in platform-specific units. + */ + height: number | string; + + /** + * Image to render in the image area of the item, specified as a local path or URL. + */ + image: string; + + /** + * Title to set in the text area of the item. + */ + title: string; + + /** + * Selection style constant to control the selection color. + */ + selectionStyle: number; + + /** + * Subtitle to set in the text area of the item. + */ + subtitle: string; + + /** + * Gets the value of the property. + */ + getEditActions(): RowActionType[]; + + /** + * Sets the value of the property. + */ + setEditActions(editActions: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getSelectedColor(): string; + + /** + * Sets the value of the property. + */ + setSelectedColor(selectedColor: string): void; + + /** + * Gets the value of the property. + */ + getSelectedSubtitleColor(): string; + + /** + * Sets the value of the property. + */ + setSelectedSubtitleColor(selectedSubtitleColor: string): void; + + } + + /** + * A list section is a container within a list view used to organize list items. + */ + interface ListSection extends Titanium.Proxy { + /** + * Title of this section footer. + */ + footerTitle: string; + + /** + * View to use for this section footer. + */ + footerView: Titanium.UI.View; + + /** + * Title of this section header. + */ + headerTitle: string; + + /** + * View to use for this section header. + */ + headerView: Titanium.UI.View; + + /** + * Items of this list section. + */ + items: ListDataItem[]; + + /** + * Sets the data entries in the list section. + */ + setItems(dataItems: ReadonlyArray, animation?: ListViewAnimationProperties): void; + + /** + * Appends the data entries to the end of the list section. + */ + appendItems(dataItems: ReadonlyArray, animation?: ListViewAnimationProperties): void; + + /** + * Inserts data entries to the list section at the specified index. + */ + insertItemsAt(itemIndex: number, dataItems: ReadonlyArray, animation?: ListViewAnimationProperties): void; + + /** + * Removes count entries from the list section at the specified index, + * then inserts data entries to the list section at the same index. + */ + replaceItemsAt(index: number, count: number, dataItems: ReadonlyArray, animation?: ListViewAnimationProperties): void; + + /** + * Removes count entries from the list section at the specified index. + */ + deleteItemsAt(itemIndex: number, count: number, animation?: ListViewAnimationProperties): void; + + /** + * Returns the item entry from the list view at the specified index. + */ + getItemAt(itemIndex: number): ListDataItem; + + /** + * Updates an item at the specified index. + */ + updateItemAt(index: number, dataItem: ListDataItem, animation?: ListViewAnimationProperties): void; + + /** + * Gets the value of the property. + */ + getFooterTitle(): string; + + /** + * Sets the value of the property. + */ + setFooterTitle(footerTitle: string): void; + + /** + * Gets the value of the property. + */ + getFooterView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setFooterView(footerView: any): void; + + /** + * Gets the value of the property. + */ + getHeaderTitle(): string; + + /** + * Sets the value of the property. + */ + setHeaderTitle(headerTitle: string): void; + + /** + * Gets the value of the property. + */ + getHeaderView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setHeaderView(headerView: any): void; + + /** + * Gets the value of the property. + */ + getItems(): ListDataItem[]; + + } + + /** + * A list view is used to present information, organized in to sections and items, + * in a vertically-scrolling view. + */ + interface ListView extends Titanium.UI.View { + /** + * Determines whether this item can be selected. + */ + allowsSelection: boolean; + + /** + * Determines if the list view can scroll in response to user actions. + */ + canScroll: boolean; + + /** + * Determines whether the scroll-bounce of the list view should be disabled. + */ + disableBounce: boolean; + + /** + * Determines if the list view is currently in editing mode. + */ + editing: boolean; + + /** + * Determines whether this list view items can be selected while editing the table. + */ + allowsSelectionDuringEditing: boolean; + + /** + * Determines whether multiple items of this list view can be selected at the same time while editing the table. + */ + allowsMultipleSelectionDuringEditing: boolean; + + /** + * Determines if the list view should use lazy loading to load remote images. + */ + lazyLoadingEnabled: boolean; + + /** + * Determines if empty sections are retained when the user completes editing the list view. + */ + pruneSectionsOnEdit: boolean; + + /** + * Contain key-value pairs mapping a style name (key) to an (value). + */ + templates: any; + + /** + * Sections of this list. + */ + sections: Titanium.UI.ListSection[]; + + /** + * Sets the default template for list data items that do not specify the `template` property. + */ + defaultItemTemplate: string | number; + + /** + * height of the ListView separator. + */ + separatorHeight: string | number; + + /** + * When set to false, the ListView will not draw the divider before the footer view. + */ + footerDividersEnabled: boolean; + + /** + * List view footer title. + */ + footerTitle: string; + + /** + * List view footer as a view that will be rendered instead of a label. + */ + footerView: Titanium.UI.View; + + /** + * When set to false, the ListView will not draw the divider after the header view. + */ + headerDividersEnabled: boolean; + + /** + * List view header title. + */ + headerTitle: string; + + /** + * List view header as a view that will be rendered instead of a label. + */ + headerView: Titanium.UI.View; + + /** + * View positioned above the first row that is only revealed when the user drags the list view contents down. + */ + pullView: Titanium.UI.View; + + /** + * View positioned above the first row that is only revealed when the user drags the list view contents down. + */ + refreshControl: Titanium.UI.RefreshControl; + + /** + * Search field to use for the list view. + */ + searchView: Titanium.UI.SearchBar | Titanium.UI.Android.SearchView; + + /** + * The string to use as the search parameter. + */ + searchText: string; + + /** + * Determines if the search performed is case insensitive. + */ + caseInsensitiveSearch: boolean; + + /** + * Determines if the section information is displayed in the search results when using the `searchText` property. + */ + keepSectionsInSearch: boolean; + + /** + * The manner in which the keyboard is dismissed when a drag begins in the list view. + */ + keyboardDismissMode: number; + + /** + * Array of objects (with `title` and `index` properties) to control the list view index. + */ + sectionIndexTitles: ListViewIndexEntry[]; + + /** + * Style of the scrollbar. + */ + scrollIndicatorStyle: number; + + /** + * Controls the scroll-to-top gesture. + */ + willScrollOnStatusTap: boolean; + + /** + * Number of sections in this list view. + */ + readonly sectionCount: number; + + /** + * Determines whether this list view displays a vertical scroll indicator. + */ + showVerticalScrollIndicator: boolean; + + /** + * Separator line color between items, as a color name or hex triplet. + */ + separatorColor: string; + + /** + * The insets for list view separators (applies to all cells). This property is applicable on iOS 7 and greater. + */ + separatorInsets: any; + + /** + * Separator style constant. + */ + separatorStyle: number; + + /** + * Style of the list view. + */ + style: number; + + /** + * The insets for the table view header and footer. This property is applicable on iOS 7 and greater. + */ + tableSeparatorInsets: any; + + /** + * The insets for the list view header and footer. This property is applicable on iOS 7 and greater. + */ + listSeparatorInsets: any; + + /** + * The insets for list view cells (applies to all cells). This property is applicable on iOS 7 and greater. + */ + rowSeparatorInsets: any; + + /** + * A Boolean indicating whether the underlying content is dimmed during a search. + */ + dimBackgroundForSearch: boolean; + + /** + * The background color of the search results (iOS-only). + */ + resultsBackgroundColor: string; + + /** + * Separator line color between rows inside search results, + * as a color name or hex triplet (iOS-only). + */ + resultsSeparatorColor: string; + + /** + * The separator style of the search results (iOS-only). + */ + resultsSeparatorStyle: number; + + /** + * The insets for search results separators (applies to all cells & iOS-only). + */ + resultsSeparatorInsets: any; + + /** + * Returns the selected list view items. + */ + selectedItems: ListItemEventType[]; + + /** + * Scrolls to a specific item. + */ + scrollToItem(sectionIndex: number, itemIndex: number, animation?: ListViewAnimationProperties): void; + + /** + * Deselects a specific item. + */ + deselectItem(sectionIndex: number, itemIndex: number): void; + + /** + * Appends a single section or an array of sections to the end of the list. + */ + appendSection(section: Titanium.UI.ListSection, animation?: ListViewAnimationProperties): void; + + /** + * Appends a single section or an array of sections to the end of the list. + */ + appendSection(section: ReadonlyArray, animation?: ListViewAnimationProperties): void; + + /** + * Deletes an existing section. + */ + deleteSectionAt(sectionIndex: number, animation?: ListViewAnimationProperties): void; + + /** + * Inserts a section or an array of sections at a specific index. + */ + insertSectionAt(sectionIndex: number, section: Titanium.UI.ListSection, animation?: ListViewAnimationProperties): void; + + /** + * Inserts a section or an array of sections at a specific index. + */ + insertSectionAt(sectionIndex: number, section: ReadonlyArray, animation?: ListViewAnimationProperties): void; + + /** + * Replaces an existing section. + */ + replaceSectionAt(sectionIndex: number, section: Titanium.UI.ListSection, animation: ListViewAnimationProperties): void; + + /** + * Selects an item in the list using the specified item and section indices. + */ + selectItem(sectionIndex: number, itemIndex: number): void; + + /** + * Sets this list view's content insets. + */ + setContentInsets(edgeInsets: ListViewEdgeInsets, animated?: ListViewContentInsetOption): void; + + /** + * Sets the value of the content offset of the list view without animation by default. + */ + setContentOffset(contentOffset: any): void; + + /** + * Sets a reference item in the list view. + */ + setMarker(markerProps: ListViewMarkerProps): void; + + /** + * Adds a reference item in the list view. + */ + addMarker(markerProps: ListViewMarkerProps): void; + + /** + * Gets the value of the property. + */ + getAllowsSelection(): boolean; + + /** + * Sets the value of the property. + */ + setAllowsSelection(allowsSelection: boolean): void; + + /** + * Gets the value of the property. + */ + getCanScroll(): boolean; + + /** + * Sets the value of the property. + */ + setCanScroll(canScroll: boolean): void; + + /** + * Gets the value of the property. + */ + getDisableBounce(): boolean; + + /** + * Sets the value of the property. + */ + setDisableBounce(disableBounce: boolean): void; + + /** + * Gets the value of the property. + */ + getEditing(): boolean; + + /** + * Sets the value of the property. + */ + setEditing(editing: boolean): void; + + /** + * Gets the value of the property. + */ + getAllowsSelectionDuringEditing(): boolean; + + /** + * Sets the value of the property. + */ + setAllowsSelectionDuringEditing(allowsSelectionDuringEditing: boolean): void; + + /** + * Gets the value of the property. + */ + getAllowsMultipleSelectionDuringEditing(): boolean; + + /** + * Sets the value of the property. + */ + setAllowsMultipleSelectionDuringEditing(allowsMultipleSelectionDuringEditing: boolean): void; + + /** + * Gets the value of the property. + */ + getLazyLoadingEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setLazyLoadingEnabled(lazyLoadingEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getPruneSectionsOnEdit(): boolean; + + /** + * Sets the value of the property. + */ + setPruneSectionsOnEdit(pruneSectionsOnEdit: boolean): void; + + /** + * Gets the value of the property. + */ + getTemplates(): any; + + /** + * Sets the value of the property. + */ + setTemplates(templates: any): void; + + /** + * Gets the value of the property. + */ + getSections(): Titanium.UI.ListSection[]; + + /** + * Sets the value of the property. + */ + setSections(sections: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getDefaultItemTemplate(): string | number; + + /** + * Sets the value of the property. + */ + setDefaultItemTemplate(defaultItemTemplate: string): void; + + /** + * Sets the value of the property. + */ + setDefaultItemTemplate(defaultItemTemplate: number): void; + + /** + * Gets the value of the property. + */ + getSeparatorHeight(): string | number; + + /** + * Sets the value of the property. + */ + setSeparatorHeight(separatorHeight: string): void; + + /** + * Sets the value of the property. + */ + setSeparatorHeight(separatorHeight: number): void; + + /** + * Gets the value of the property. + */ + getFooterDividersEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setFooterDividersEnabled(footerDividersEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getFooterTitle(): string; + + /** + * Sets the value of the property. + */ + setFooterTitle(footerTitle: string): void; + + /** + * Gets the value of the property. + */ + getFooterView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setFooterView(footerView: any): void; + + /** + * Gets the value of the property. + */ + getHeaderDividersEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setHeaderDividersEnabled(headerDividersEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getHeaderTitle(): string; + + /** + * Sets the value of the property. + */ + setHeaderTitle(headerTitle: string): void; + + /** + * Gets the value of the property. + */ + getHeaderView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setHeaderView(headerView: any): void; + + /** + * Gets the value of the property. + */ + getPullView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setPullView(pullView: any): void; + + /** + * Gets the value of the property. + */ + getRefreshControl(): Titanium.UI.RefreshControl; + + /** + * Sets the value of the property. + */ + setRefreshControl(refreshControl: Titanium.UI.RefreshControl): void; + + /** + * Gets the value of the property. + */ + getSearchView(): Titanium.UI.SearchBar | Titanium.UI.Android.SearchView; + + /** + * Sets the value of the property. + */ + setSearchView(searchView: Titanium.UI.SearchBar): void; + + /** + * Sets the value of the property. + */ + setSearchView(searchView: Titanium.UI.Android.SearchView): void; + + /** + * Gets the value of the property. + */ + getSearchText(): string; + + /** + * Sets the value of the property. + */ + setSearchText(searchText: string): void; + + /** + * Gets the value of the property. + */ + getCaseInsensitiveSearch(): boolean; + + /** + * Sets the value of the property. + */ + setCaseInsensitiveSearch(caseInsensitiveSearch: boolean): void; + + /** + * Gets the value of the property. + */ + getKeepSectionsInSearch(): boolean; + + /** + * Sets the value of the property. + */ + setKeepSectionsInSearch(keepSectionsInSearch: boolean): void; + + /** + * Gets the value of the property. + */ + getKeyboardDismissMode(): number; + + /** + * Sets the value of the property. + */ + setKeyboardDismissMode(keyboardDismissMode: number): void; + + /** + * Gets the value of the property. + */ + getSectionIndexTitles(): ListViewIndexEntry[]; + + /** + * Sets the value of the property. + */ + setSectionIndexTitles(sectionIndexTitles: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getScrollIndicatorStyle(): number; + + /** + * Sets the value of the property. + */ + setScrollIndicatorStyle(scrollIndicatorStyle: number): void; + + /** + * Gets the value of the property. + */ + getWillScrollOnStatusTap(): boolean; + + /** + * Sets the value of the property. + */ + setWillScrollOnStatusTap(willScrollOnStatusTap: boolean): void; + + /** + * Gets the value of the property. + */ + getSectionCount(): number; + + /** + * Gets the value of the property. + */ + getShowVerticalScrollIndicator(): boolean; + + /** + * Sets the value of the property. + */ + setShowVerticalScrollIndicator(showVerticalScrollIndicator: boolean): void; + + /** + * Gets the value of the property. + */ + getSeparatorColor(): string; + + /** + * Sets the value of the property. + */ + setSeparatorColor(separatorColor: string): void; + + /** + * Gets the value of the property. + */ + getSeparatorInsets(): any; + + /** + * Sets the value of the property. + */ + setSeparatorInsets(separatorInsets: any): void; + + /** + * Gets the value of the property. + */ + getSeparatorStyle(): number; + + /** + * Sets the value of the property. + */ + setSeparatorStyle(separatorStyle: number): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + /** + * Gets the value of the property. + */ + getTableSeparatorInsets(): any; + + /** + * Sets the value of the property. + */ + setTableSeparatorInsets(tableSeparatorInsets: any): void; + + /** + * Gets the value of the property. + */ + getListSeparatorInsets(): any; + + /** + * Sets the value of the property. + */ + setListSeparatorInsets(listSeparatorInsets: any): void; + + /** + * Gets the value of the property. + */ + getRowSeparatorInsets(): any; + + /** + * Sets the value of the property. + */ + setRowSeparatorInsets(rowSeparatorInsets: any): void; + + /** + * Gets the value of the property. + */ + getDimBackgroundForSearch(): boolean; + + /** + * Sets the value of the property. + */ + setDimBackgroundForSearch(dimBackgroundForSearch: boolean): void; + + /** + * Gets the value of the property. + */ + getResultsBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setResultsBackgroundColor(resultsBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getResultsSeparatorColor(): string; + + /** + * Sets the value of the property. + */ + setResultsSeparatorColor(resultsSeparatorColor: string): void; + + /** + * Gets the value of the property. + */ + getResultsSeparatorStyle(): number; + + /** + * Sets the value of the property. + */ + setResultsSeparatorStyle(resultsSeparatorStyle: number): void; + + /** + * Gets the value of the property. + */ + getResultsSeparatorInsets(): any; + + /** + * Sets the value of the property. + */ + setResultsSeparatorInsets(resultsSeparatorInsets: any): void; + + /** + * Gets the value of the property. + */ + getSelectedItems(): ListItemEventType[]; + + /** + * Sets the value of the property. + */ + setSelectedItems(selectedItems: ReadonlyArray): void; + + } + + /** + * A control that displays an image composited with a background image or color. + */ + interface MaskedImage extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Image drawn as the background image. + */ + mask: string; + + /** + * Image drawn as the Foreground image. + */ + image: string; + + /** + * Blend mode to use to combine layers. + */ + mode: number; + + /** + * Color to combine with the image, as a color name or hex triplet. + */ + tint: string; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getMask(): string; + + /** + * Sets the value of the property. + */ + setMask(mask: string): void; + + /** + * Gets the value of the property. + */ + getImage(): string; + + /** + * Sets the value of the property. + */ + setImage(image: string): void; + + /** + * Gets the value of the property. + */ + getMode(): number; + + /** + * Sets the value of the property. + */ + setMode(mode: number): void; + + /** + * Gets the value of the property. + */ + getTint(): string; + + /** + * Sets the value of the property. + */ + setTint(tint: string): void; + + } + + /** + * A toast notification. + */ + interface Notification extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * Disabled background color of the view, as a color name or hex triplet. + */ + backgroundDisabledColor: string; + + /** + * Disabled background image for the view, specified as a local file path or URL. + */ + backgroundDisabledImage: string; + + /** + * Focused background color of the view, as a color name or hex triplet. + */ + backgroundFocusedColor: string; + + /** + * Focused background image for the view, specified as a local file path or URL. + */ + backgroundFocusedImage: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Selected background color of the view, as a color name or hex triplet. + */ + backgroundSelectedColor: string; + + /** + * Selected background image url for the view, specified as a local file path or URL. + */ + backgroundSelectedImage: string; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * Base elevation of the view relative to its parent in pixels. + */ + elevation: number; + + /** + * Whether view should be focusable while navigating with the trackball. + */ + focusable: boolean; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * Sets the behavior when hiding an object to release or keep the free space + */ + hiddenBehavior: number; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * When on, animate call overrides current animation if applicable. + */ + overrideCurrentAnimation: boolean; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * Clockwise 2D rotation of the view in degrees. + */ + rotation: number; + + /** + * Clockwise rotation of the view in degrees (x-axis). + */ + rotationX: number; + + /** + * Clockwise rotation of the view in degrees (y-axis). + */ + rotationY: number; + + /** + * Scaling of the view in x-axis in pixels. + */ + scaleX: number; + + /** + * Scaling of the view in y-axis in pixels. + */ + scaleY: number; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * Determines keyboard behavior when this view is focused. + */ + softKeyboardOnFocus: number; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * A material design visual construct that provides an instantaneous visual confirmation of touch point. + */ + touchFeedback: boolean; + + /** + * Optional touch feedback ripple color. This has no effect unless `touchFeedback` is true. + */ + touchFeedbackColor: string; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Horizontal location of the view relative to its left position in pixels. + */ + translationX: number; + + /** + * Vertical location of the view relative to its top position in pixels. + */ + translationY: number; + + /** + * Depth of the view relative to its elevation in pixels. + */ + translationZ: number; + + /** + * A name to identify this view in activity transition. + */ + transitionName: string; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Determines whether to keep the device screen on. + */ + keepScreenOn: boolean; + + /** + * Notification text to display. + */ + message: string; + + /** + * Determines how long the notification stays on screen. + */ + duration: number; + + /** + * Determines the location at which the notification should appear on the screen. + */ + gravity: number; + + /** + * X offset from the default position, in pixels. + */ + xOffset: number; + + /** + * Y offset from the default position, in pixels. + */ + yOffset: number; + + /** + * Horizontal placement of the notification, *as a fraction of the screen width*. + */ + horizontalMargin: number; + + /** + * Vertical placement of the notifcation, *as a fraction of the screen height*. + */ + verticalMargin: number; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Show the notification. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledColor(backgroundDisabledColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledImage(backgroundDisabledImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedColor(backgroundFocusedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedImage(backgroundFocusedImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedColor(backgroundSelectedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedImage(backgroundSelectedImage: string): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getElevation(): number; + + /** + * Sets the value of the property. + */ + setElevation(elevation: number): void; + + /** + * Gets the value of the property. + */ + getFocusable(): boolean; + + /** + * Sets the value of the property. + */ + setFocusable(focusable: boolean): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getHiddenBehavior(): number; + + /** + * Sets the value of the property. + */ + setHiddenBehavior(hiddenBehavior: number): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getOverrideCurrentAnimation(): boolean; + + /** + * Sets the value of the property. + */ + setOverrideCurrentAnimation(overrideCurrentAnimation: boolean): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getRotation(): number; + + /** + * Sets the value of the property. + */ + setRotation(rotation: number): void; + + /** + * Gets the value of the property. + */ + getRotationX(): number; + + /** + * Sets the value of the property. + */ + setRotationX(rotationX: number): void; + + /** + * Gets the value of the property. + */ + getRotationY(): number; + + /** + * Sets the value of the property. + */ + setRotationY(rotationY: number): void; + + /** + * Gets the value of the property. + */ + getScaleX(): number; + + /** + * Sets the value of the property. + */ + setScaleX(scaleX: number): void; + + /** + * Gets the value of the property. + */ + getScaleY(): number; + + /** + * Sets the value of the property. + */ + setScaleY(scaleY: number): void; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getSoftKeyboardOnFocus(): number; + + /** + * Sets the value of the property. + */ + setSoftKeyboardOnFocus(softKeyboardOnFocus: number): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedback(): boolean; + + /** + * Sets the value of the property. + */ + setTouchFeedback(touchFeedback: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedbackColor(): string; + + /** + * Sets the value of the property. + */ + setTouchFeedbackColor(touchFeedbackColor: string): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getTranslationX(): number; + + /** + * Sets the value of the property. + */ + setTranslationX(translationX: number): void; + + /** + * Gets the value of the property. + */ + getTranslationY(): number; + + /** + * Sets the value of the property. + */ + setTranslationY(translationY: number): void; + + /** + * Gets the value of the property. + */ + getTranslationZ(): number; + + /** + * Sets the value of the property. + */ + setTranslationZ(translationZ: number): void; + + /** + * Gets the value of the property. + */ + getTransitionName(): string; + + /** + * Sets the value of the property. + */ + setTransitionName(transitionName: string): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getKeepScreenOn(): boolean; + + /** + * Sets the value of the property. + */ + setKeepScreenOn(keepScreenOn: boolean): void; + + /** + * Gets the value of the property. + */ + getMessage(): string; + + /** + * Sets the value of the property. + */ + setMessage(message: string): void; + + /** + * Gets the value of the property. + */ + getDuration(): number; + + /** + * Sets the value of the property. + */ + setDuration(duration: number): void; + + /** + * Gets the value of the property. + */ + getGravity(): number; + + /** + * Sets the value of the property. + */ + setGravity(gravity: number): void; + + /** + * Gets the value of the property. + */ + getXOffset(): number; + + /** + * Sets the value of the property. + */ + setXOffset(xOffset: number): void; + + /** + * Gets the value of the property. + */ + getYOffset(): number; + + /** + * Sets the value of the property. + */ + setYOffset(yOffset: number): void; + + /** + * Gets the value of the property. + */ + getHorizontalMargin(): number; + + /** + * Sets the value of the property. + */ + setHorizontalMargin(horizontalMargin: number): void; + + /** + * Gets the value of the property. + */ + getVerticalMargin(): number; + + /** + * Sets the value of the property. + */ + setVerticalMargin(verticalMargin: number): void; + + } + + /** + * An option dialog is a modal view that includes a message and one or more option items positioned + * in the middle of the display on Android and at the bottom edge on iOS. On Android, buttons may + * be added below the options. + */ + interface OptionDialog extends Titanium.UI.View { + /** + * View to load inside the message area, to create a custom layout. + */ + androidView: Titanium.UI.View; + + /** + * List of button names. + */ + buttonNames: string[]; + + /** + * Index to define the cancel option. + */ + cancel: number; + + /** + * Index to define the destructive option, indicated by a visual cue when rendered. + */ + destructive: number; + + /** + * List of option names to display in the dialog. + */ + options: string[]; + + /** + * Boolean value indicating if the option dialog should have an opaque background. + */ + opaquebackground: boolean; + + /** + * Boolean value indicating if the option dialog should only be cancelled by user gesture or by hide method. + */ + persistent: boolean; + + /** + * Defines the default selected option. + */ + selectedIndex: number; + + /** + * Title of the dialog. + */ + title: string; + + /** + * Key identifying a string in the locale file to use for the title text. + */ + titleid: string; + + /** + * Gets the value of the property. + */ + getAndroidView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setAndroidView(androidView: any): void; + + /** + * Gets the value of the property. + */ + getButtonNames(): string[]; + + /** + * Sets the value of the property. + */ + setButtonNames(buttonNames: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getCancel(): number; + + /** + * Sets the value of the property. + */ + setCancel(cancel: number): void; + + /** + * Gets the value of the property. + */ + getDestructive(): number; + + /** + * Sets the value of the property. + */ + setDestructive(destructive: number): void; + + /** + * Gets the value of the property. + */ + getOptions(): string[]; + + /** + * Sets the value of the property. + */ + setOptions(options: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getOpaquebackground(): boolean; + + /** + * Sets the value of the property. + */ + setOpaquebackground(opaquebackground: boolean): void; + + /** + * Gets the value of the property. + */ + getPersistent(): boolean; + + /** + * Sets the value of the property. + */ + setPersistent(persistent: boolean): void; + + /** + * Gets the value of the property. + */ + getSelectedIndex(): number; + + /** + * Sets the value of the property. + */ + setSelectedIndex(selectedIndex: number): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleid(): string; + + /** + * Sets the value of the property. + */ + setTitleid(titleid: string): void; + + } + + /** + * A control used to select one or more fixed values. + */ + interface Picker extends Titanium.UI.View { + /** + * Columns used for this picker, as an array of objects. + */ + columns: Titanium.UI.PickerColumn[]; + + /** + * Duration in milliseconds used for a Countdown Timer picker. + */ + countDownDuration: number; + + /** + * Sets the text color of date- and time-pickers. + */ + dateTimeColor: string; + + /** + * Determines whether the Time pickers display in 24-hour or 12-hour clock format. + */ + format24: boolean; + + /** + * Locale used when displaying Date and Time picker values. + */ + locale: string; + + /** + * Maximum date displayed when a Date picker is in use. + */ + maxDate: Date; + + /** + * Minimum date displayed when a Date picker is in use. + */ + minDate: Date; + + /** + * Interval in minutes displayed when one of the Time types of pickers is in use. + */ + minuteInterval: number; + + /** + * Determines whether the visual selection indicator is shown. + */ + selectionIndicator: boolean; + + /** + * Determines whether calling the method `setSelectedRow` opens when called + */ + selectionOpens: boolean; + + /** + * Determines the type of picker displayed + */ + type: number; + + /** + * Determines whether the non-native Android control, with a spinning wheel that looks and + * behaves like the iOS picker, is invoked rather than the default native "dropdown" style. + */ + useSpinner: boolean; + + /** + * Creates a native Android control for creating a Time Spinner with Type `Ti.UI.PICKER_TYPE_TIME`. + * This is invoked rather than the default native "dropdown" style. + */ + nativeSpinner: boolean; + + /** + * Date and time value for Date and Time pickers. + */ + value: Date; + + /** + * Number of visible rows to display. This is only applicable to a plain picker and when the + * `useSpinner` is `true`. + */ + visibleItems: number; + + /** + * Determines whether the calenderView is visible. + */ + calendarViewShown: boolean; + + /** + * Font to use for text. + */ + font: Font; + + /** + * Gets the selected row for a column, or `null` if none exists. + */ + getSelectedRow(index: number): Titanium.UI.PickerRow; + + /** + * Repopulates values for a column. + */ + reloadColumn(column: Titanium.UI.PickerColumn): void; + + /** + * Selects a column's row. + */ + setSelectedRow(column: number, row: number, animated?: boolean): void; + + /** + * Sets the date and time value property for Date pickers. + */ + setValue(date: any, suppressEvent: boolean): Titanium.UI.PickerRow; + + /** + * Shows Date picker as a modal dialog. + */ + showDatePickerDialog(dictObj: any): void; + + /** + * Shows Time picker as a modal dialog. + */ + showTimePickerDialog(dictObj: any): void; + + /** + * Gets the value of the property. + */ + getColumns(): Titanium.UI.PickerColumn[]; + + /** + * Sets the value of the property. + */ + setColumns(columns: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getCountDownDuration(): number; + + /** + * Sets the value of the property. + */ + setCountDownDuration(countDownDuration: number): void; + + /** + * Gets the value of the property. + */ + getDateTimeColor(): string; + + /** + * Sets the value of the property. + */ + setDateTimeColor(dateTimeColor: string): void; + + /** + * Gets the value of the property. + */ + getFormat24(): boolean; + + /** + * Sets the value of the property. + */ + setFormat24(format24: boolean): void; + + /** + * Gets the value of the property. + */ + getLocale(): string; + + /** + * Sets the value of the property. + */ + setLocale(locale: string): void; + + /** + * Gets the value of the property. + */ + getMaxDate(): Date; + + /** + * Sets the value of the property. + */ + setMaxDate(maxDate: Date): void; + + /** + * Gets the value of the property. + */ + getMinDate(): Date; + + /** + * Sets the value of the property. + */ + setMinDate(minDate: Date): void; + + /** + * Gets the value of the property. + */ + getMinuteInterval(): number; + + /** + * Sets the value of the property. + */ + setMinuteInterval(minuteInterval: number): void; + + /** + * Gets the value of the property. + */ + getSelectionIndicator(): boolean; + + /** + * Sets the value of the property. + */ + setSelectionIndicator(selectionIndicator: boolean): void; + + /** + * Gets the value of the property. + */ + getSelectionOpens(): boolean; + + /** + * Sets the value of the property. + */ + setSelectionOpens(selectionOpens: boolean): void; + + /** + * Gets the value of the property. + */ + getType(): number; + + /** + * Sets the value of the property. + */ + setType(type: number): void; + + /** + * Gets the value of the property. + */ + getUseSpinner(): boolean; + + /** + * Sets the value of the property. + */ + setUseSpinner(useSpinner: boolean): void; + + /** + * Gets the value of the property. + */ + getNativeSpinner(): boolean; + + /** + * Sets the value of the property. + */ + setNativeSpinner(nativeSpinner: boolean): void; + + /** + * Gets the value of the property. + */ + getValue(): Date; + + /** + * Sets the value of the property. + */ + setValue(value: Date): void; + + /** + * Gets the value of the property. + */ + getVisibleItems(): number; + + /** + * Sets the value of the property. + */ + setVisibleItems(visibleItems: number): void; + + /** + * Gets the value of the property. + */ + getCalendarViewShown(): boolean; + + /** + * Sets the value of the property. + */ + setCalendarViewShown(calendarViewShown: boolean): void; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + } + + /** + * A picker column, representing a selectable group of items in a . + */ + interface PickerColumn extends Titanium.UI.View { + /** + * Number of rows in this column. + */ + readonly rowCount: number; + + /** + * Rows of this column. + */ + readonly rows: Titanium.UI.PickerRow[]; + + /** + * Font to use for text. + */ + font: Font; + + /** + * Adds a row to this column. + */ + addRow(row: Titanium.UI.PickerRow): void; + + /** + * Removes a row from this column. + */ + removeRow(row: Titanium.UI.PickerRow): void; + + /** + * Gets the value of the property. + */ + getRowCount(): number; + + /** + * Gets the value of the property. + */ + getRows(): Titanium.UI.PickerRow[]; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + } + + /** + * A picker row, representing a selectable item in a . + */ + interface PickerRow extends Titanium.UI.View { + /** + * Color of the item text, as a color name or hex triplet. + */ + color: string; + + /** + * Font to use for the item text. + */ + font: Font; + + /** + * Item text. + */ + title: string; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + } + + /** + * A progress bar. + */ + interface ProgressBar extends Titanium.UI.View { + /** + * Color of the progress bar message, as a color name or hex triplet. + */ + color: string; + + /** + * Font for the progress bar text. + */ + font: Font; + + /** + * Maximum value of the progress bar. + */ + max: number; + + /** + * Progress bar text. + */ + message: string; + + /** + * The color shown for the portion of the progress bar that is not filled. + */ + trackTintColor: string; + + /** + * Minimum value of the progress bar. + */ + min: number; + + /** + * Style of the progress bar. + */ + style: number; + + /** + * Current value of the progress bar. + */ + value: number; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + /** + * Gets the value of the property. + */ + getMax(): number; + + /** + * Sets the value of the property. + */ + setMax(max: number): void; + + /** + * Gets the value of the property. + */ + getMessage(): string; + + /** + * Sets the value of the property. + */ + setMessage(message: string): void; + + /** + * Gets the value of the property. + */ + getTrackTintColor(): string; + + /** + * Sets the value of the property. + */ + setTrackTintColor(trackTintColor: string): void; + + /** + * Gets the value of the property. + */ + getMin(): number; + + /** + * Sets the value of the property. + */ + setMin(min: number): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + /** + * Gets the value of the property. + */ + getValue(): number; + + /** + * Sets the value of the property. + */ + setValue(value: number): void; + + } + + /** + * The RefreshControl is a representation of the native iOS + * [UIRefreshControl](https://developer.apple.com/library/ios/documentation/uikit/reference/UIRefreshControl_class/Reference/Reference.html) + * and Android [SwipeRefreshLayout](https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.html). + */ + interface RefreshControl extends Titanium.Proxy { + /** + * The attributed title of the control. + */ + title: Titanium.UI.AttributedString; + + /** + * The tint color for the refresh control, as a color name or hex triplet. + */ + tintColor: string; + + /** + * Tells the control that a refresh operation was started programmatically. + */ + beginRefreshing(): void; + + /** + * Tells the control that a refresh operation has ended. + */ + endRefreshing(): void; + + /** + * Gets the value of the property. + */ + getTitle(): Titanium.UI.AttributedString; + + /** + * Sets the value of the property. + */ + setTitle(title: Titanium.UI.AttributedString): void; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + } + + /** + * A view that contains a horizontally and/or vertically-scrollable region of content. + */ + interface ScrollView extends Titanium.UI.View { + /** + * Determines whether this scroll view can cancel subview touches in order to scroll instead. + */ + canCancelEvents: boolean; + + /** + * Height of the scrollable region. + */ + contentHeight: number | string; + + /** + * X and Y coordinates to which to reposition the top-left point of the scrollable region. + */ + contentOffset: any; + + /** + * Width of the scrollable region. + */ + contentWidth: number | string; + + /** + * The deceleration rate of the ScrollView. + */ + decelerationRate: number; + + /** + * Determines whether scroll bounce of the scrollable region is enabled. + */ + disableBounce: boolean; + + /** + * Determines whether horizontal scroll bounce of the scrollable region is enabled. + */ + horizontalBounce: boolean; + + /** + * The manner in which the keyboard is dismissed when a drag begins in the scroll view. + */ + keyboardDismissMode: number; + + /** + * Maximum scaling factor of the scrollable region and its content. + */ + maxZoomScale: number; + + /** + * Minimum scaling factor of the scrollable region and its content. + */ + minZoomScale: number; + + /** + * Determines the behavior when the user overscolls the view. + */ + overScrollMode: number; + + /** + * View positioned above the first row that is only revealed when the user drags the scroll view contents down. + */ + refreshControl: Titanium.UI.RefreshControl; + + /** + * Controls whether the scroll-to-top gesture is effective. + */ + scrollsToTop: boolean; + + /** + * Style of the scrollbar. + */ + scrollIndicatorStyle: number; + + /** + * Limits the direction of the scrollable region, overriding the deduced setting. Set to + * `horizontal` or `vertical`. + */ + scrollType: string; + + /** + * Determines whether scrolling is enabled for the view. + */ + scrollingEnabled: boolean; + + /** + * Determines whether the horizontal scroll indicator is visible. + */ + showHorizontalScrollIndicator: boolean; + + /** + * Determines whether the vertical scroll indicator is visible. + */ + showVerticalScrollIndicator: boolean; + + /** + * Determines whether vertical scroll bounce of the scrollable region is enabled. + */ + verticalBounce: boolean; + + /** + * Scaling factor of the scroll view's content. + */ + zoomScale: number; + + /** + * Moves the specified coordinate of the scrollable region into the viewable area. + */ + scrollTo(x: number, y: number, animation?: ScrollViewAnimationProperties): void; + + /** + * Sets the value of the [contentOffset](Titanium.UI.ScrollView.contentOffset) property. + */ + setContentOffset(contentOffset: any, animated?: contentOffsetOption): void; + + /** + * Sets the value of the [zoomScale](Titanium.UI.ScrollView.zoomScale) property. + */ + setZoomScale(zoomScale: number, animated?: zoomScaleOption): void; + + /** + * Moves the end of the scrollable region into the viewable area. + */ + scrollToBottom(): void; + + /** + * Moves the top of the scrollable region into the viewable area. + */ + scrollToTop(): void; + + /** + * Gets the value of the property. + */ + getCanCancelEvents(): boolean; + + /** + * Sets the value of the property. + */ + setCanCancelEvents(canCancelEvents: boolean): void; + + /** + * Gets the value of the property. + */ + getContentHeight(): number | string; + + /** + * Sets the value of the property. + */ + setContentHeight(contentHeight: number): void; + + /** + * Sets the value of the property. + */ + setContentHeight(contentHeight: string): void; + + /** + * Gets the value of the property. + */ + getContentOffset(): any; + + /** + * Sets the value of the property. + */ + setContentOffset(contentOffset: any): void; + + /** + * Gets the value of the property. + */ + getContentWidth(): number | string; + + /** + * Sets the value of the property. + */ + setContentWidth(contentWidth: number): void; + + /** + * Sets the value of the property. + */ + setContentWidth(contentWidth: string): void; + + /** + * Gets the value of the property. + */ + getDecelerationRate(): number; + + /** + * Sets the value of the property. + */ + setDecelerationRate(decelerationRate: number): void; + + /** + * Gets the value of the property. + */ + getDisableBounce(): boolean; + + /** + * Sets the value of the property. + */ + setDisableBounce(disableBounce: boolean): void; + + /** + * Gets the value of the property. + */ + getHorizontalBounce(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalBounce(horizontalBounce: boolean): void; + + /** + * Gets the value of the property. + */ + getKeyboardDismissMode(): number; + + /** + * Sets the value of the property. + */ + setKeyboardDismissMode(keyboardDismissMode: number): void; + + /** + * Gets the value of the property. + */ + getMaxZoomScale(): number; + + /** + * Sets the value of the property. + */ + setMaxZoomScale(maxZoomScale: number): void; + + /** + * Gets the value of the property. + */ + getMinZoomScale(): number; + + /** + * Sets the value of the property. + */ + setMinZoomScale(minZoomScale: number): void; + + /** + * Gets the value of the property. + */ + getOverScrollMode(): number; + + /** + * Sets the value of the property. + */ + setOverScrollMode(overScrollMode: number): void; + + /** + * Gets the value of the property. + */ + getRefreshControl(): Titanium.UI.RefreshControl; + + /** + * Sets the value of the property. + */ + setRefreshControl(refreshControl: Titanium.UI.RefreshControl): void; + + /** + * Gets the value of the property. + */ + getScrollsToTop(): boolean; + + /** + * Sets the value of the property. + */ + setScrollsToTop(scrollsToTop: boolean): void; + + /** + * Gets the value of the property. + */ + getScrollIndicatorStyle(): number; + + /** + * Sets the value of the property. + */ + setScrollIndicatorStyle(scrollIndicatorStyle: number): void; + + /** + * Gets the value of the property. + */ + getScrollType(): string; + + /** + * Sets the value of the property. + */ + setScrollType(scrollType: string): void; + + /** + * Gets the value of the property. + */ + getScrollingEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setScrollingEnabled(scrollingEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getShowHorizontalScrollIndicator(): boolean; + + /** + * Sets the value of the property. + */ + setShowHorizontalScrollIndicator(showHorizontalScrollIndicator: boolean): void; + + /** + * Gets the value of the property. + */ + getShowVerticalScrollIndicator(): boolean; + + /** + * Sets the value of the property. + */ + setShowVerticalScrollIndicator(showVerticalScrollIndicator: boolean): void; + + /** + * Gets the value of the property. + */ + getVerticalBounce(): boolean; + + /** + * Sets the value of the property. + */ + setVerticalBounce(verticalBounce: boolean): void; + + /** + * Gets the value of the property. + */ + getZoomScale(): number; + + } + + /** + * A view that encapsulates a horizontally-scrolling set of child views, known as pages, navigable + * using its built-in horizontal swipe gestures. + */ + interface ScrollableView extends Titanium.UI.View { + /** + * Number of pages to cache (pre-render). + */ + cacheSize: number; + + /** + * Index of the active page. + */ + currentPage: number; + + /** + * Color for the current page of the paging control, as a color name or hex triplet. + */ + currentPageIndicatorColor: string; + + /** + * Determines whether page bouncing effect is disabled. + */ + disableBounce: boolean; + + /** + * Determines the behavior when the user overscolls the view. + */ + overScrollMode: number; + + /** + * Color of the paging control, as a color name or hex triplet. + */ + pagingControlColor: string; + + /** + * Height of the paging control, in pixels. + */ + pagingControlHeight: number; + + /** + * Color of the paging control, as a color name or hex triplet. + */ + pageIndicatorColor: string; + + /** + * Determines whether the paging control is visible. + */ + showPagingControl: boolean; + + /** + * Number of milliseconds to wait before hiding the paging control. + */ + pagingControlTimeout: number; + + /** + * Alpha value of the paging control. + */ + pagingControlAlpha: number; + + /** + * Determines whether the paging control is displayed at the top or bottom of the view. + */ + pagingControlOnTop: boolean; + + /** + * Determines whether the paging control is added as an overlay to the view. + */ + overlayEnabled: boolean; + + /** + * Determines whether scrolling is enabled for the view. + */ + scrollingEnabled: boolean; + + /** + * Sets the pages within this Scrollable View. + */ + views: Titanium.UI.View[]; + + /** + * Determines whether the previous and next pages are clipped, so that they are not visible + * adjacent to the current page. + */ + clipViews: boolean; + + /** + * Sets the region where this view responds to gestures. + */ + hitRect: Dimension; + + /** + * Inserts views at the specified position in the [views](Titanium.UI.ScrollableView.views) array. + */ + insertViewsAt(position: number, views: any[]): void; + + /** + * Adds a new page to this Scrollable View. + */ + addView(view: any): void; + + /** + * Sets the current page to the next consecutive page in . + */ + moveNext(): void; + + /** + * Sets the current page to the previous consecutive page in . + */ + movePrevious(): void; + + /** + * Removes an existing page from this Scrollable View. + */ + removeView(view: number): void; + + /** + * Removes an existing page from this Scrollable View. + */ + removeView(view: any): void; + + /** + * Scrolls to the specified page in . + */ + scrollToView(view: number): void; + + /** + * Scrolls to the specified page in . + */ + scrollToView(view: any): void; + + /** + * Gets the value of the property. + */ + getCacheSize(): number; + + /** + * Sets the value of the property. + */ + setCacheSize(cacheSize: number): void; + + /** + * Gets the value of the property. + */ + getCurrentPage(): number; + + /** + * Sets the value of the property. + */ + setCurrentPage(currentPage: number): void; + + /** + * Gets the value of the property. + */ + getCurrentPageIndicatorColor(): string; + + /** + * Sets the value of the property. + */ + setCurrentPageIndicatorColor(currentPageIndicatorColor: string): void; + + /** + * Gets the value of the property. + */ + getDisableBounce(): boolean; + + /** + * Sets the value of the property. + */ + setDisableBounce(disableBounce: boolean): void; + + /** + * Gets the value of the property. + */ + getOverScrollMode(): number; + + /** + * Sets the value of the property. + */ + setOverScrollMode(overScrollMode: number): void; + + /** + * Gets the value of the property. + */ + getPagingControlColor(): string; + + /** + * Sets the value of the property. + */ + setPagingControlColor(pagingControlColor: string): void; + + /** + * Gets the value of the property. + */ + getPagingControlHeight(): number; + + /** + * Sets the value of the property. + */ + setPagingControlHeight(pagingControlHeight: number): void; + + /** + * Gets the value of the property. + */ + getPageIndicatorColor(): string; + + /** + * Sets the value of the property. + */ + setPageIndicatorColor(pageIndicatorColor: string): void; + + /** + * Gets the value of the property. + */ + getShowPagingControl(): boolean; + + /** + * Sets the value of the property. + */ + setShowPagingControl(showPagingControl: boolean): void; + + /** + * Gets the value of the property. + */ + getPagingControlTimeout(): number; + + /** + * Sets the value of the property. + */ + setPagingControlTimeout(pagingControlTimeout: number): void; + + /** + * Gets the value of the property. + */ + getPagingControlAlpha(): number; + + /** + * Sets the value of the property. + */ + setPagingControlAlpha(pagingControlAlpha: number): void; + + /** + * Gets the value of the property. + */ + getPagingControlOnTop(): boolean; + + /** + * Sets the value of the property. + */ + setPagingControlOnTop(pagingControlOnTop: boolean): void; + + /** + * Gets the value of the property. + */ + getOverlayEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setOverlayEnabled(overlayEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getScrollingEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setScrollingEnabled(scrollingEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getViews(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setViews(views: any[]): void; + + /** + * Gets the value of the property. + */ + getClipViews(): boolean; + + /** + * Sets the value of the property. + */ + setClipViews(clipViews: boolean): void; + + /** + * Gets the value of the property. + */ + getHitRect(): Dimension; + + /** + * Sets the value of the property. + */ + setHitRect(hitRect: Dimension): void; + + } + + /** + * A specialized text field for entering search text. + */ + interface SearchBar extends Titanium.UI.View { + /** + * Determines how text is capitalized during typing. + */ + autocapitalization: number; + + /** + * Determines whether the text in the search bar is autocorrected during typing. + */ + autocorrect: boolean; + + /** + * Bar color of the search bar view, as a color name or hex triplet. + */ + barColor: string; + + /** + * The title of the cancel button when the search bar field is focused. + */ + cancelButtonTitle: string; + + /** + * Color of the text in this text field, as a color name or hex triplet. + */ + color: string; + + /** + * Text to show when the search bar field is not focused. + */ + hintText: string; + + /** + * Hint text color to display when the field is empty. + */ + hintTextColor: string; + + /** + * Key identifying a string from the locale file to use for the + * [hintText](Titanium.UI.SearchBar.hintText) property. + */ + hinttextid: string; + + /** + * Keyboard type constant to use when the field is focused. + */ + keyboardType: number; + + /** + * Determines the appearance of the keyboard to be displayed the field is focused. + */ + keyboardAppearance: number; + + /** + * Single line of text displayed at the top of the search bar. + */ + prompt: string; + + /** + * Key identifying a string from the locale file to use for the + * [prompt](Titanium.UI.SearchBar.prompt) property. + */ + promptid: string; + + /** + * Determines whether the bookmark button is displayed. + */ + showBookmark: boolean; + + /** + * Determines whether the cancel button is displayed. + */ + showCancel: boolean; + + /** + * Determines the style of the search bar. + */ + style: number; + + /** + * Value of the search bar. + */ + value: string; + + /** + * Causes the search bar to lose focus. + */ + blur(): void; + + /** + * Causes the search bar to gain focus. + */ + focus(): void; + + /** + * Shows or hides the cancel button. + */ + setShowCancel(showCancel: boolean, animated?: any): void; + + /** + * Gets the value of the property. + */ + getAutocapitalization(): number; + + /** + * Sets the value of the property. + */ + setAutocapitalization(autocapitalization: number): void; + + /** + * Gets the value of the property. + */ + getAutocorrect(): boolean; + + /** + * Sets the value of the property. + */ + setAutocorrect(autocorrect: boolean): void; + + /** + * Gets the value of the property. + */ + getBarColor(): string; + + /** + * Sets the value of the property. + */ + setBarColor(barColor: string): void; + + /** + * Gets the value of the property. + */ + getCancelButtonTitle(): string; + + /** + * Sets the value of the property. + */ + setCancelButtonTitle(cancelButtonTitle: string): void; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getHintText(): string; + + /** + * Sets the value of the property. + */ + setHintText(hintText: string): void; + + /** + * Gets the value of the property. + */ + getHintTextColor(): string; + + /** + * Sets the value of the property. + */ + setHintTextColor(hintTextColor: string): void; + + /** + * Gets the value of the property. + */ + getHinttextid(): string; + + /** + * Sets the value of the property. + */ + setHinttextid(hinttextid: string): void; + + /** + * Gets the value of the property. + */ + getKeyboardType(): number; + + /** + * Sets the value of the property. + */ + setKeyboardType(keyboardType: number): void; + + /** + * Gets the value of the property. + */ + getKeyboardAppearance(): number; + + /** + * Sets the value of the property. + */ + setKeyboardAppearance(keyboardAppearance: number): void; + + /** + * Gets the value of the property. + */ + getPrompt(): string; + + /** + * Sets the value of the property. + */ + setPrompt(prompt: string): void; + + /** + * Gets the value of the property. + */ + getPromptid(): string; + + /** + * Sets the value of the property. + */ + setPromptid(promptid: string): void; + + /** + * Gets the value of the property. + */ + getShowBookmark(): boolean; + + /** + * Sets the value of the property. + */ + setShowBookmark(showBookmark: boolean): void; + + /** + * Gets the value of the property. + */ + getShowCancel(): boolean; + + /** + * Sets the value of the property. + */ + setShowCancel(showCancel: boolean): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + /** + * Gets the value of the property. + */ + getValue(): string; + + /** + * Sets the value of the property. + */ + setValue(value: string): void; + + } + + /** + * A slider component with a draggable thumb. + */ + interface Slider extends Titanium.UI.View { + /** + * Image URL of the slider left track when in the disabled state. + */ + disabledLeftTrackImage: string; + + /** + * Image URL of the slider right track when in the disabled state. + */ + disabledRightTrackImage: string; + + /** + * Image URL of the slider thumb when in the disabled state. + */ + disabledThumbImage: string; + + /** + * Boolean to indicate the enabled state of the slider. + */ + enabled: boolean; + + /** + * Image URL of the slider left track when in the highlighted state. + */ + highlightedLeftTrackImage: string; + + /** + * Image URL of the slider right track when in the highlighted state. + */ + highlightedRightTrackImage: string; + + /** + * Image URL of the slider thumb when in the highlighted state. + */ + highlightedThumbImage: string; + + /** + * Image URL of the slider left track. + */ + leftTrackImage: string; + + /** + * Size of the left end cap for the leftTrackImage, disabledLeftTrackImage, highlightedLeftTrackImage and selectedLeftTrackImage properties. + */ + leftTrackLeftCap: number; + + /** + * Size of the top end cap for the leftTrackImage, disabledLeftTrackImage, highlightedLeftTrackImage and selectedLeftTrackImage properties. + */ + leftTrackTopCap: number; + + /** + * Maximum value of the slider. + */ + max: number; + + /** + * Upper limit on the slider value that can be selected. + */ + maxRange: number; + + /** + * Minimum value of the slider. + */ + min: number; + + /** + * Lower limit on the slider value that can be selected. + */ + minRange: number; + + /** + * Image URL of the slider right track. + */ + rightTrackImage: string; + + /** + * Size of the left end cap for the rightTrackImage, disabledRightTrackImage, highlightedRightTrackImage and selectedRightTrackImage properties. + */ + rightTrackLeftCap: number; + + /** + * Size of the top end cap for the rightTrackImage, disabledRightTrackImage, highlightedRightTrackImage and selectedRightTrackImage properties. + */ + rightTrackTopCap: number; + + /** + * Image URL of the slider left track when in the selected state. + */ + selectedLeftTrackImage: string; + + /** + * Image URL of the slider right track when in the selected state. + */ + selectedRightTrackImage: string; + + /** + * Image URL of the slider thumb when in the selected state. + */ + selectedThumbImage: string; + + /** + * Separates the thumbImage from the slider track. + */ + splitTrack: boolean; + + /** + * Image for the slider thumb. + */ + thumbImage: string | Titanium.Blob; + + /** + * Current value of the slider. + */ + value: string; + + /** + * Sets the [value](Titanium.UI.Slider.value) property. + */ + setValue(value: number, options?: any): void; + + /** + * Gets the value of the property. + */ + getDisabledLeftTrackImage(): string; + + /** + * Sets the value of the property. + */ + setDisabledLeftTrackImage(disabledLeftTrackImage: string): void; + + /** + * Gets the value of the property. + */ + getDisabledRightTrackImage(): string; + + /** + * Sets the value of the property. + */ + setDisabledRightTrackImage(disabledRightTrackImage: string): void; + + /** + * Gets the value of the property. + */ + getDisabledThumbImage(): string; + + /** + * Sets the value of the property. + */ + setDisabledThumbImage(disabledThumbImage: string): void; + + /** + * Gets the value of the property. + */ + getEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setEnabled(enabled: boolean): void; + + /** + * Gets the value of the property. + */ + getHighlightedLeftTrackImage(): string; + + /** + * Sets the value of the property. + */ + setHighlightedLeftTrackImage(highlightedLeftTrackImage: string): void; + + /** + * Gets the value of the property. + */ + getHighlightedRightTrackImage(): string; + + /** + * Sets the value of the property. + */ + setHighlightedRightTrackImage(highlightedRightTrackImage: string): void; + + /** + * Gets the value of the property. + */ + getHighlightedThumbImage(): string; + + /** + * Sets the value of the property. + */ + setHighlightedThumbImage(highlightedThumbImage: string): void; + + /** + * Gets the value of the property. + */ + getLeftTrackImage(): string; + + /** + * Sets the value of the property. + */ + setLeftTrackImage(leftTrackImage: string): void; + + /** + * Gets the value of the property. + */ + getLeftTrackLeftCap(): number; + + /** + * Sets the value of the property. + */ + setLeftTrackLeftCap(leftTrackLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getLeftTrackTopCap(): number; + + /** + * Sets the value of the property. + */ + setLeftTrackTopCap(leftTrackTopCap: number): void; + + /** + * Gets the value of the property. + */ + getMax(): number; + + /** + * Sets the value of the property. + */ + setMax(max: number): void; + + /** + * Gets the value of the property. + */ + getMaxRange(): number; + + /** + * Sets the value of the property. + */ + setMaxRange(maxRange: number): void; + + /** + * Gets the value of the property. + */ + getMin(): number; + + /** + * Sets the value of the property. + */ + setMin(min: number): void; + + /** + * Gets the value of the property. + */ + getMinRange(): number; + + /** + * Sets the value of the property. + */ + setMinRange(minRange: number): void; + + /** + * Gets the value of the property. + */ + getRightTrackImage(): string; + + /** + * Sets the value of the property. + */ + setRightTrackImage(rightTrackImage: string): void; + + /** + * Gets the value of the property. + */ + getRightTrackLeftCap(): number; + + /** + * Sets the value of the property. + */ + setRightTrackLeftCap(rightTrackLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getRightTrackTopCap(): number; + + /** + * Sets the value of the property. + */ + setRightTrackTopCap(rightTrackTopCap: number): void; + + /** + * Gets the value of the property. + */ + getSelectedLeftTrackImage(): string; + + /** + * Sets the value of the property. + */ + setSelectedLeftTrackImage(selectedLeftTrackImage: string): void; + + /** + * Gets the value of the property. + */ + getSelectedRightTrackImage(): string; + + /** + * Sets the value of the property. + */ + setSelectedRightTrackImage(selectedRightTrackImage: string): void; + + /** + * Gets the value of the property. + */ + getSelectedThumbImage(): string; + + /** + * Sets the value of the property. + */ + setSelectedThumbImage(selectedThumbImage: string): void; + + /** + * Gets the value of the property. + */ + getSplitTrack(): boolean; + + /** + * Sets the value of the property. + */ + setSplitTrack(splitTrack: boolean): void; + + /** + * Gets the value of the property. + */ + getThumbImage(): string | Titanium.Blob; + + /** + * Sets the value of the property. + */ + setThumbImage(thumbImage: string): void; + + /** + * Sets the value of the property. + */ + setThumbImage(thumbImage: Titanium.Blob): void; + + /** + * Gets the value of the property. + */ + getValue(): string; + + } + + /** + * An on/off switch control. + */ + interface Switch extends Titanium.UI.View { + /** + * Determines if there is animation when the switch value changes. + */ + animated: boolean; + + /** + * Color to use for switch text, as a color name or hex triplet. + */ + color: string; + + /** + * Determines whether the switch is enabled. + */ + enabled: boolean; + + /** + * Font to use for the switch text. + */ + font: Font; + + /** + * Style of the switch. + */ + style: number; + + /** + * Horizontal text alignment of the switch title. + */ + textAlign: string | number; + + /** + * Text to display next to the switch, when the checkbox style is in use. + */ + title: string; + + /** + * Text to display on the switch in its "off" state, when the toggle button style is in use. + */ + titleOff: string; + + /** + * Text to display on the switch in its "on" state, when the toggle button style is in use. + */ + titleOn: string; + + /** + * The color used to tint the appearance of the switch when it is turned on. + */ + onTintColor: string; + + /** + * The color used to tint the appearance of the thumb. + */ + thumbTintColor: string; + + /** + * Indicates whether the switch has been turned on or off by the user. May also be set + * programmatically. + */ + value: boolean; + + /** + * Vertical alignment for the text field. + */ + verticalAlign: number | string; + + /** + * Gets the value of the property. + */ + getAnimated(): boolean; + + /** + * Sets the value of the property. + */ + setAnimated(animated: boolean): void; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setEnabled(enabled: boolean): void; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + /** + * Gets the value of the property. + */ + getTextAlign(): string | number; + + /** + * Sets the value of the property. + */ + setTextAlign(textAlign: string): void; + + /** + * Sets the value of the property. + */ + setTextAlign(textAlign: number): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleOff(): string; + + /** + * Sets the value of the property. + */ + setTitleOff(titleOff: string): void; + + /** + * Gets the value of the property. + */ + getTitleOn(): string; + + /** + * Sets the value of the property. + */ + setTitleOn(titleOn: string): void; + + /** + * Gets the value of the property. + */ + getOnTintColor(): string; + + /** + * Sets the value of the property. + */ + setOnTintColor(onTintColor: string): void; + + /** + * Gets the value of the property. + */ + getThumbTintColor(): string; + + /** + * Sets the value of the property. + */ + setThumbTintColor(thumbTintColor: string): void; + + /** + * Gets the value of the property. + */ + getValue(): boolean; + + /** + * Sets the value of the property. + */ + setValue(value: boolean): void; + + /** + * Gets the value of the property. + */ + getVerticalAlign(): number | string; + + /** + * Sets the value of the property. + */ + setVerticalAlign(verticalAlign: number): void; + + /** + * Sets the value of the property. + */ + setVerticalAlign(verticalAlign: string): void; + + } + + /** + * A tab instance for a [TabGroup](Titanium.UI.TabGroup). + */ + interface Tab extends Titanium.UI.View { + /** + * `true` if this tab is active, `false` if it is not. + */ + active: boolean; + + /** + * Icon URL for this tab when active. + */ + activeIcon: string; + + /** + * Badge value for this tab. `null` indicates no badge. + */ + badge: string; + + /** + * If this item displays a badge, this color will be used for the badge's background. + * If set to null, the default background color will be used instead. + */ + badgeColor: string; + + /** + * Icon URL for this tab. + */ + icon: string; + + /** + * The icon inset or outset for each edge. + */ + iconInsets: TabIconInsets; + + /** + * Defines if the icon property of the tab must be used as a mask. This property is applicable on iOS 7 and greater. + */ + iconIsMask: boolean; + + /** + * Defines if the active icon property of the tab must be used as a mask. This property is applicable on iOS 7 and greater. + */ + activeIconIsMask: boolean; + + /** + * Title for this tab. + */ + title: string; + + /** + * Key identifying a string from the locale file to use for the tab title. Only one of `title` or `titleid` should be specified. + */ + titleid: string; + + /** + * Defines the color of the title of tab when it's inactive. + */ + titleColor: string; + + /** + * Defines the color of the title of tab when it's active. + */ + activeTitleColor: string; + + /** + * Root-level tab window. All tabs must have at least one root-level tab window. + */ + window: Titanium.UI.Window; + + /** + * Opens a new window. + */ + open(window: Titanium.UI.Window, options?: any): void; + + /** + * Closes the top-level window for this tab. + */ + close(window: Titanium.UI.Window, options?: any): void; + + /** + * Sets the root window that appears in the tab. + */ + setWindow(window: Titanium.UI.Window): void; + + /** + * Closes all windows that are currently opened inside the tab. + */ + popToRootWindow(options: any): void; + + /** + * Gets the value of the property. + */ + getActive(): boolean; + + /** + * Sets the value of the property. + */ + setActive(active: boolean): void; + + /** + * Gets the value of the property. + */ + getActiveIcon(): string; + + /** + * Sets the value of the property. + */ + setActiveIcon(activeIcon: string): void; + + /** + * Gets the value of the property. + */ + getBadge(): string; + + /** + * Sets the value of the property. + */ + setBadge(badge: string): void; + + /** + * Gets the value of the property. + */ + getBadgeColor(): string; + + /** + * Sets the value of the property. + */ + setBadgeColor(badgeColor: string): void; + + /** + * Gets the value of the property. + */ + getIcon(): string; + + /** + * Sets the value of the property. + */ + setIcon(icon: string): void; + + /** + * Gets the value of the property. + */ + getIconInsets(): TabIconInsets; + + /** + * Sets the value of the property. + */ + setIconInsets(iconInsets: TabIconInsets): void; + + /** + * Gets the value of the property. + */ + getIconIsMask(): boolean; + + /** + * Sets the value of the property. + */ + setIconIsMask(iconIsMask: boolean): void; + + /** + * Gets the value of the property. + */ + getActiveIconIsMask(): boolean; + + /** + * Sets the value of the property. + */ + setActiveIconIsMask(activeIconIsMask: boolean): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleid(): string; + + /** + * Sets the value of the property. + */ + setTitleid(titleid: string): void; + + /** + * Gets the value of the property. + */ + getTitleColor(): string; + + /** + * Sets the value of the property. + */ + setTitleColor(titleColor: string): void; + + /** + * Gets the value of the property. + */ + getActiveTitleColor(): string; + + /** + * Sets the value of the property. + */ + setActiveTitleColor(activeTitleColor: string): void; + + /** + * Gets the value of the property. + */ + getWindow(): Titanium.UI.Window; + + } + + /** + * A tabbed group of windows. + */ + interface TabGroup extends Titanium.UI.View { + /** + * Active tab. + */ + activeTab: Titanium.UI.Tab; + + /** + * Reference to the Android Activity object associated with this tab group. + */ + readonly activity: Titanium.Android.Activity; + + /** + * Allow the user to reorder tabs in the tab group using the **Edit** button on the **More** + * tab. + */ + allowUserCustomization: boolean; + + /** + * Default navigation bar color (typically for the **More** tab), as a color name or hex triplet. + */ + barColor: string; + + /** + * Boolean value indicating if the nav bar (typically for the **More** tab), is translucent. + */ + translucent: boolean; + + /** + * Title text attributes of the window to be applied on the **More** tab. + */ + titleAttributes: titleAttributesParams; + + /** + * The tintColor to apply to the navigation bar (typically for the **More** tab). + */ + navTintColor: string; + + /** + * Title for the edit button on the **More** tab. + */ + editButtonTitle: string; + + /** + * Boolean value indicating if the application should exit when closing the tab group, whether via Android + * back button or the [close](Titanium.UI.TabGroup.close) method. + */ + exitOnClose: boolean; + + /** + * Boolean value indicating if tab navigation can be done by swipes, in addition to tab clicks. + */ + swipeable: boolean; + + /** + * Boolean value indicating if changing pages by tab clicks is animated. + */ + smoothScrollOnTabClick: boolean; + + /** + * Tabs managed by the tab group. + */ + tabs: Titanium.UI.Tab[]; + + /** + * Determines how the tab group is treated when a soft input method (such as a virtual keyboard) + * is displayed. + */ + windowSoftInputMode: number; + + /** + * Default background color for inactive tabs, as a color name or hex triplet. + */ + tabsBackgroundColor: string; + + /** + * The tintColor to apply to the tabs. + */ + tabsTintColor: string; + + /** + * A Boolean value that indicates whether the tab bar is translucent. + */ + tabsTranslucent: boolean; + + /** + * Title for this tabGroup. + */ + title: string; + + /** + * Default background image for tabs. + */ + tabsBackgroundImage: string; + + /** + * Unselected items in this tab group will be tinted with this color. Setting this value to null + * indicates that the tab group should use its default value instead. + */ + unselectedItemTintColor: string; + + /** + * Image of the shadow placed between the tab bar and the content area. + */ + shadowImage: string; + + /** + * Color applied to active tabs icons, as a color name or hex triplet, where the tab's activeIcon was not defined. + */ + activeTabIconTint: string; + + /** + * Default background selected color for tabs, as a color name or hex triplet. + */ + tabsBackgroundSelectedColor: string; + + /** + * Default background image for the active tab. + */ + activeTabBackgroundImage: string; + + /** + * Adds a tab to the tab group. + */ + addTab(tab: Titanium.UI.Tab): void; + + /** + * Closes the tab group and removes it from the UI. + */ + close(): void; + + /** + * Disable (or re-enable) tab navigation. If tab navigation is disabled, the tabs are hidden and + * the last selected tab window is shown. + */ + disableTabNavigation(disable: boolean): void; + + /** + * Gets the currently-active tab. + */ + getActiveTab(): Titanium.UI.Tab; + + /** + * Opens the tab group and makes it visible. + */ + open(): void; + + /** + * Removes a tab from the tab group. + */ + removeTab(tab: Titanium.UI.Tab): void; + + /** + * Selects the currently active tab in a tab group. + */ + setActiveTab(indexOrObject: number): void; + + /** + * Selects the currently active tab in a tab group. + */ + setActiveTab(indexOrObject: Titanium.UI.Tab): void; + + /** + * Gets all tabs that are managed by the tab group. + */ + getTabs(): Titanium.UI.Tab[]; + + /** + * Gets the value of the property. + */ + getActiveTab(): Titanium.UI.Tab; + + /** + * Sets the value of the property. + */ + setActiveTab(activeTab: Titanium.UI.Tab): void; + + /** + * Gets the value of the property. + */ + getActivity(): Titanium.Android.Activity; + + /** + * Gets the value of the property. + */ + getAllowUserCustomization(): boolean; + + /** + * Sets the value of the property. + */ + setAllowUserCustomization(allowUserCustomization: boolean): void; + + /** + * Gets the value of the property. + */ + getBarColor(): string; + + /** + * Sets the value of the property. + */ + setBarColor(barColor: string): void; + + /** + * Gets the value of the property. + */ + getTranslucent(): boolean; + + /** + * Sets the value of the property. + */ + setTranslucent(translucent: boolean): void; + + /** + * Gets the value of the property. + */ + getTitleAttributes(): titleAttributesParams; + + /** + * Sets the value of the property. + */ + setTitleAttributes(titleAttributes: titleAttributesParams): void; + + /** + * Gets the value of the property. + */ + getNavTintColor(): string; + + /** + * Sets the value of the property. + */ + setNavTintColor(navTintColor: string): void; + + /** + * Gets the value of the property. + */ + getEditButtonTitle(): string; + + /** + * Sets the value of the property. + */ + setEditButtonTitle(editButtonTitle: string): void; + + /** + * Gets the value of the property. + */ + getExitOnClose(): boolean; + + /** + * Sets the value of the property. + */ + setExitOnClose(exitOnClose: boolean): void; + + /** + * Gets the value of the property. + */ + getSwipeable(): boolean; + + /** + * Sets the value of the property. + */ + setSwipeable(swipeable: boolean): void; + + /** + * Gets the value of the property. + */ + getSmoothScrollOnTabClick(): boolean; + + /** + * Sets the value of the property. + */ + setSmoothScrollOnTabClick(smoothScrollOnTabClick: boolean): void; + + /** + * Gets the value of the property. + */ + getTabs(): Titanium.UI.Tab[]; + + /** + * Sets the value of the property. + */ + setTabs(tabs: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getWindowSoftInputMode(): number; + + /** + * Sets the value of the property. + */ + setWindowSoftInputMode(windowSoftInputMode: number): void; + + /** + * Gets the value of the property. + */ + getTabsBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setTabsBackgroundColor(tabsBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getTabsTintColor(): string; + + /** + * Sets the value of the property. + */ + setTabsTintColor(tabsTintColor: string): void; + + /** + * Gets the value of the property. + */ + getTabsTranslucent(): boolean; + + /** + * Sets the value of the property. + */ + setTabsTranslucent(tabsTranslucent: boolean): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTabsBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setTabsBackgroundImage(tabsBackgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getUnselectedItemTintColor(): string; + + /** + * Sets the value of the property. + */ + setUnselectedItemTintColor(unselectedItemTintColor: string): void; + + /** + * Gets the value of the property. + */ + getShadowImage(): string; + + /** + * Sets the value of the property. + */ + setShadowImage(shadowImage: string): void; + + /** + * Gets the value of the property. + */ + getActiveTabIconTint(): string; + + /** + * Sets the value of the property. + */ + setActiveTabIconTint(activeTabIconTint: string): void; + + /** + * Gets the value of the property. + */ + getTabsBackgroundSelectedColor(): string; + + /** + * Sets the value of the property. + */ + setTabsBackgroundSelectedColor(tabsBackgroundSelectedColor: string): void; + + /** + * Gets the value of the property. + */ + getActiveTabBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setActiveTabBackgroundImage(activeTabBackgroundImage: string): void; + + } + + /** + * A button bar that maintains a selected state. + */ + interface TabbedBar extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Index of the currently selected button. + */ + index: number; + + /** + * Array of labels for the tabbed bar. + */ + labels: string[] | BarItemType[]; + + /** + * Style of the tabbed bar. + */ + style: number; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getIndex(): number; + + /** + * Sets the value of the property. + */ + setIndex(index: number): void; + + /** + * Gets the value of the property. + */ + getLabels(): string[] | BarItemType[]; + + /** + * Sets the value of the property. + */ + setLabels(labels: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setLabels(labels: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + } + + /** + * A table view is used to present information, organized in sections and rows, in a + * vertically-scrolling view. + */ + interface TableView extends Titanium.UI.View { + /** + * Determines whether this table's rows can be selected. + */ + allowsSelection: boolean; + + /** + * Determines whether this table's rows can be selected while editing the table. + */ + allowsSelectionDuringEditing: boolean; + + /** + * Rows of the table view. + */ + data: Titanium.UI.TableViewRow[] | Titanium.UI.TableViewSection[]; + + /** + * Determines the rows' default editable behavior, which allows them to be deleted by the user + * when the table is in `editing` or `moving` mode. + */ + editable: boolean; + + /** + * Determines whether row editing mode is active. + */ + editing: boolean; + + /** + * Filter attribute to be used when searching. + */ + filterAttribute: string; + + /** + * Determines whether the search is limited to the start of the string + */ + filterAnchored: boolean; + + /** + * Determines whether the search is case insensitive. + */ + filterCaseInsensitive: boolean; + + /** + * When set to false, the ListView will not draw the divider before the footer view. + */ + footerDividersEnabled: boolean; + + /** + * Table view footer title. + */ + footerTitle: string; + + /** + * Max number of row class names. + */ + maxClassname: number; + + /** + * View positioned above the first row that is only revealed when the user drags the table + * contents down. + */ + headerPullView: Titanium.UI.View; + + /** + * View positioned above the first row that is only revealed when the user drags the list view contents down. + */ + refreshControl: Titanium.UI.RefreshControl; + + /** + * Determines whether the search field should hide on completion. + */ + hideSearchOnSelection: boolean; + + /** + * Table view footer as a view that will be rendered instead of a label. + */ + footerView: Titanium.UI.View; + + /** + * When set to false, the ListView will not draw the divider after the header view. + */ + headerDividersEnabled: boolean; + + /** + * Table view header title. + */ + headerTitle: string; + + /** + * Table view header as a view that will be rendered instead of a label. + */ + headerView: Titanium.UI.View; + + /** + * Array of objects (with `title` and `index` properties) to control the table view index. + */ + index: TableViewIndexEntry[]; + + /** + * Maximum row height for table view rows. + */ + maxRowHeight: number; + + /** + * Minimum row height for table view rows. + */ + minRowHeight: number; + + /** + * Determines the rows' default moveable behavior, which allows them to be re-ordered by the + * user when the table is in `editing` or `moving` mode. + */ + moveable: boolean; + + /** + * Determines whether row moving mode is active. + */ + moving: boolean; + + /** + * Determines the behavior when the user overscrolls the view. + */ + overScrollMode: number; + + /** + * Default row height for table view rows. + */ + rowHeight: number; + + /** + * If `true`, the tableview can be scrolled. + */ + scrollable: boolean; + + /** + * Style of the scrollbar. + */ + scrollIndicatorStyle: number; + + /** + * Controls whether the scroll-to-top gesture is effective. + */ + scrollsToTop: boolean; + + /** + * Search field to use for the table view. + */ + search: Titanium.UI.SearchBar | Titanium.UI.Android.SearchView; + + /** + * A Boolean indicating whether the underlying content is dimmed during a search. + */ + dimBackgroundForSearch: boolean; + + /** + * Determines whether the [SearchBar](Titanium.UI.SearchBar) or [SearchView](Titanium.UI.Android.SearchView) appears as part of the TableView. + */ + searchAsChild: boolean; + + /** + * Determines whether the search field is visible. + */ + searchHidden: boolean; + + /** + * Number of sections in this table view. + */ + readonly sectionCount: number; + + /** + * Sections of this table. + */ + sections: Titanium.UI.TableViewSection[]; + + /** + * Separator line color between rows, as a color name or hex triplet. + */ + separatorColor: string; + + /** + * The insets for table view separators (applies to all cells). This property is applicable on iOS 7 and greater. + */ + separatorInsets: any; + + /** + * The insets for the table view header and footer. This property is applicable on iOS 7 and greater. + */ + tableSeparatorInsets: any; + + /** + * The insets for table view cells (applies to all cells). This property is applicable on iOS 7 and greater. + */ + rowSeparatorInsets: any; + + /** + * Separator style constant. + */ + separatorStyle: number; + + /** + * Determines whether this table view displays a vertical scroll indicator. + */ + showVerticalScrollIndicator: boolean; + + /** + * Style of the table view, specified using one of the constants from + * . + */ + style: number; + + /** + * Appends a single row or an array of rows to the end of the table. + */ + appendRow(row: any, animation?: TableViewAnimationProperties): void; + + /** + * Appends a single section or an array of sections to the end of the table. + */ + appendSection(section: any, animation?: TableViewAnimationProperties): void; + + /** + * Deletes an existing row. + */ + deleteRow(row: number, animation?: TableViewAnimationProperties): void; + + /** + * Deletes an existing row. + */ + deleteRow(row: Titanium.UI.TableViewRow, animation?: TableViewAnimationProperties): void; + + /** + * Deletes an existing section. + */ + deleteSection(section: number, animation?: TableViewAnimationProperties): void; + + /** + * Programmatically deselects a row. + */ + deselectRow(row: number): void; + + /** + * Inserts a row after another row. + */ + insertRowAfter(index: number, row: any, animation?: TableViewAnimationProperties): void; + + /** + * Inserts a section after another section. + */ + insertSectionAfter(index: number, section: any, animation?: TableViewAnimationProperties): void; + + /** + * Inserts a row before another row. + */ + insertRowBefore(index: number, row: any, animation?: TableViewAnimationProperties): void; + + /** + * Inserts a section before another section. + */ + insertSectionBefore(index: number, section: any, animation?: TableViewAnimationProperties): void; + + /** + * Scrolls the table view to ensure that the specified row is on screen. + */ + scrollToIndex(index: number, animation?: TableViewAnimationProperties): void; + + /** + * Scrolls the table to a specific top position where 0 is the topmost y position in the + * table view. + */ + scrollToTop(top: number, animation?: TableViewAnimationProperties): void; + + /** + * Sets this tableview's content insets. + */ + setContentInsets(edgeInsets: TableViewEdgeInsets, animated?: TableViewContentInsetOption): void; + + /** + * Sets the value of the content offset of the table view without animation by default. + */ + setContentOffset(contentOffset: any): void; + + /** + * Programmatically selects a row. In Android, it sets the currently selected item. If in touch mode, + * the item will not be selected but it will still be positioned appropriately. If the specified + * selection position is less than 0, then the item at position 0 will be selected. + */ + selectRow(row: number): void; + + /** + * Sets the data in the table. + */ + setData(data: any, animation: TableViewAnimationProperties): void; + + /** + * Sets the value of the [Titanium.UI.TableView.headerPullView] property. + */ + setHeaderPullView(view: any): void; + + /** + * Updates an existing row, optionally with animation. + */ + updateRow(index: number, row: Titanium.UI.TableViewRow, animation: TableViewAnimationProperties): void; + + /** + * Updates an existing section, optionally with animation. + */ + updateSection(index: number, section: Titanium.UI.TableViewSection, animation: TableViewAnimationProperties): void; + + /** + * Gets the value of the property. + */ + getAllowsSelection(): boolean; + + /** + * Sets the value of the property. + */ + setAllowsSelection(allowsSelection: boolean): void; + + /** + * Gets the value of the property. + */ + getAllowsSelectionDuringEditing(): boolean; + + /** + * Sets the value of the property. + */ + setAllowsSelectionDuringEditing(allowsSelectionDuringEditing: boolean): void; + + /** + * Gets the value of the property. + */ + getData(): Titanium.UI.TableViewRow[] | Titanium.UI.TableViewSection[]; + + /** + * Sets the value of the property. + */ + setData(data: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setData(data: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getEditable(): boolean; + + /** + * Sets the value of the property. + */ + setEditable(editable: boolean): void; + + /** + * Gets the value of the property. + */ + getEditing(): boolean; + + /** + * Sets the value of the property. + */ + setEditing(editing: boolean): void; + + /** + * Gets the value of the property. + */ + getFilterAttribute(): string; + + /** + * Sets the value of the property. + */ + setFilterAttribute(filterAttribute: string): void; + + /** + * Gets the value of the property. + */ + getFilterAnchored(): boolean; + + /** + * Sets the value of the property. + */ + setFilterAnchored(filterAnchored: boolean): void; + + /** + * Gets the value of the property. + */ + getFilterCaseInsensitive(): boolean; + + /** + * Sets the value of the property. + */ + setFilterCaseInsensitive(filterCaseInsensitive: boolean): void; + + /** + * Gets the value of the property. + */ + getFooterDividersEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setFooterDividersEnabled(footerDividersEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getFooterTitle(): string; + + /** + * Sets the value of the property. + */ + setFooterTitle(footerTitle: string): void; + + /** + * Gets the value of the property. + */ + getMaxClassname(): number; + + /** + * Sets the value of the property. + */ + setMaxClassname(maxClassname: number): void; + + /** + * Gets the value of the property. + */ + getHeaderPullView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setHeaderPullView(headerPullView: any): void; + + /** + * Gets the value of the property. + */ + getRefreshControl(): Titanium.UI.RefreshControl; + + /** + * Sets the value of the property. + */ + setRefreshControl(refreshControl: Titanium.UI.RefreshControl): void; + + /** + * Gets the value of the property. + */ + getHideSearchOnSelection(): boolean; + + /** + * Sets the value of the property. + */ + setHideSearchOnSelection(hideSearchOnSelection: boolean): void; + + /** + * Gets the value of the property. + */ + getFooterView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setFooterView(footerView: any): void; + + /** + * Gets the value of the property. + */ + getHeaderDividersEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setHeaderDividersEnabled(headerDividersEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getHeaderTitle(): string; + + /** + * Sets the value of the property. + */ + setHeaderTitle(headerTitle: string): void; + + /** + * Gets the value of the property. + */ + getHeaderView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setHeaderView(headerView: any): void; + + /** + * Gets the value of the property. + */ + getIndex(): TableViewIndexEntry[]; + + /** + * Sets the value of the property. + */ + setIndex(index: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getMaxRowHeight(): number; + + /** + * Sets the value of the property. + */ + setMaxRowHeight(maxRowHeight: number): void; + + /** + * Gets the value of the property. + */ + getMinRowHeight(): number; + + /** + * Sets the value of the property. + */ + setMinRowHeight(minRowHeight: number): void; + + /** + * Gets the value of the property. + */ + getMoveable(): boolean; + + /** + * Sets the value of the property. + */ + setMoveable(moveable: boolean): void; + + /** + * Gets the value of the property. + */ + getMoving(): boolean; + + /** + * Sets the value of the property. + */ + setMoving(moving: boolean): void; + + /** + * Gets the value of the property. + */ + getOverScrollMode(): number; + + /** + * Sets the value of the property. + */ + setOverScrollMode(overScrollMode: number): void; + + /** + * Gets the value of the property. + */ + getRowHeight(): number; + + /** + * Sets the value of the property. + */ + setRowHeight(rowHeight: number): void; + + /** + * Gets the value of the property. + */ + getScrollable(): boolean; + + /** + * Sets the value of the property. + */ + setScrollable(scrollable: boolean): void; + + /** + * Gets the value of the property. + */ + getScrollIndicatorStyle(): number; + + /** + * Sets the value of the property. + */ + setScrollIndicatorStyle(scrollIndicatorStyle: number): void; + + /** + * Gets the value of the property. + */ + getScrollsToTop(): boolean; + + /** + * Sets the value of the property. + */ + setScrollsToTop(scrollsToTop: boolean): void; + + /** + * Gets the value of the property. + */ + getSearch(): Titanium.UI.SearchBar | Titanium.UI.Android.SearchView; + + /** + * Sets the value of the property. + */ + setSearch(search: Titanium.UI.SearchBar): void; + + /** + * Sets the value of the property. + */ + setSearch(search: Titanium.UI.Android.SearchView): void; + + /** + * Gets the value of the property. + */ + getDimBackgroundForSearch(): boolean; + + /** + * Sets the value of the property. + */ + setDimBackgroundForSearch(dimBackgroundForSearch: boolean): void; + + /** + * Gets the value of the property. + */ + getSearchAsChild(): boolean; + + /** + * Sets the value of the property. + */ + setSearchAsChild(searchAsChild: boolean): void; + + /** + * Gets the value of the property. + */ + getSearchHidden(): boolean; + + /** + * Sets the value of the property. + */ + setSearchHidden(searchHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getSectionCount(): number; + + /** + * Gets the value of the property. + */ + getSections(): Titanium.UI.TableViewSection[]; + + /** + * Sets the value of the property. + */ + setSections(sections: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getSeparatorColor(): string; + + /** + * Sets the value of the property. + */ + setSeparatorColor(separatorColor: string): void; + + /** + * Gets the value of the property. + */ + getSeparatorInsets(): any; + + /** + * Sets the value of the property. + */ + setSeparatorInsets(separatorInsets: any): void; + + /** + * Gets the value of the property. + */ + getTableSeparatorInsets(): any; + + /** + * Sets the value of the property. + */ + setTableSeparatorInsets(tableSeparatorInsets: any): void; + + /** + * Gets the value of the property. + */ + getRowSeparatorInsets(): any; + + /** + * Sets the value of the property. + */ + setRowSeparatorInsets(rowSeparatorInsets: any): void; + + /** + * Gets the value of the property. + */ + getSeparatorStyle(): number; + + /** + * Sets the value of the property. + */ + setSeparatorStyle(separatorStyle: number): void; + + /** + * Gets the value of the property. + */ + getShowVerticalScrollIndicator(): boolean; + + /** + * Sets the value of the property. + */ + setShowVerticalScrollIndicator(showVerticalScrollIndicator: boolean): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + } + + /** + * A table view row is an individual item in a table, organized into table view sections. + */ + interface TableViewRow extends Titanium.UI.View { + /** + * Class name for the row. + */ + className: string; + + /** + * Default text color of the row when not selected, as a color name or hex triplet. + */ + color: string; + + /** + * Text to display on the delete button when editable is enabled + */ + deleteButtonTitle: string; + + /** + * Determines the rows' editable behavior, which allows them to be deleted by the user when the + * table is in `editing` or `moving` mode. + */ + editable: boolean; + + /** + * Font to use for the row title. + */ + font: Font; + + /** + * The footer title of the row. + */ + footer: string; + + /** + * Determines whether a system-provided checkmark is displayed on the right-hand side of + * the row. + */ + hasCheck: boolean; + + /** + * Determines whether a system-provided arrow is displayed on the right-hand side of the row. + */ + hasChild: boolean; + + /** + * Determines whether a system-provided detail disclosure button is displayed on the right-hand + * side of the row. + */ + hasDetail: boolean; + + /** + * The header title of the row. + */ + header: string; + + /** + * Indention level for the row. + */ + indentionLevel: number; + + /** + * Image to render in the left image area of the row, specified as a local path or URL. + */ + leftImage: string; + + /** + * Determines the rows' moveable behavior, which allows them to be re-ordered by the user when + * the table is in `editing` or `moving` mode. + */ + moveable: boolean; + + /** + * Image to render in the right image area of the row, specified as a local path or URL. + */ + rightImage: string; + + /** + * Background color to render when the row is selected, as a color name or hex triplet. + */ + selectedBackgroundColor: string; + + /** + * Background image to render when the row is selected. + */ + selectedBackgroundImage: string; + + /** + * Color of the row text when the row is selected, as a color name or hex triplet. + */ + selectedColor: string; + + /** + * Selection style constant to control the selection color. + */ + selectionStyle: number; + + /** + * Text to display on the row. + */ + title: string; + + /** + * Gets the value of the property. + */ + getClassName(): string; + + /** + * Sets the value of the property. + */ + setClassName(className: string): void; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getDeleteButtonTitle(): string; + + /** + * Sets the value of the property. + */ + setDeleteButtonTitle(deleteButtonTitle: string): void; + + /** + * Gets the value of the property. + */ + getEditable(): boolean; + + /** + * Sets the value of the property. + */ + setEditable(editable: boolean): void; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + /** + * Gets the value of the property. + */ + getFooter(): string; + + /** + * Sets the value of the property. + */ + setFooter(footer: string): void; + + /** + * Gets the value of the property. + */ + getHasCheck(): boolean; + + /** + * Sets the value of the property. + */ + setHasCheck(hasCheck: boolean): void; + + /** + * Gets the value of the property. + */ + getHasChild(): boolean; + + /** + * Sets the value of the property. + */ + setHasChild(hasChild: boolean): void; + + /** + * Gets the value of the property. + */ + getHasDetail(): boolean; + + /** + * Sets the value of the property. + */ + setHasDetail(hasDetail: boolean): void; + + /** + * Gets the value of the property. + */ + getHeader(): string; + + /** + * Sets the value of the property. + */ + setHeader(header: string): void; + + /** + * Gets the value of the property. + */ + getIndentionLevel(): number; + + /** + * Sets the value of the property. + */ + setIndentionLevel(indentionLevel: number): void; + + /** + * Gets the value of the property. + */ + getLeftImage(): string; + + /** + * Sets the value of the property. + */ + setLeftImage(leftImage: string): void; + + /** + * Gets the value of the property. + */ + getMoveable(): boolean; + + /** + * Sets the value of the property. + */ + setMoveable(moveable: boolean): void; + + /** + * Gets the value of the property. + */ + getRightImage(): string; + + /** + * Sets the value of the property. + */ + setRightImage(rightImage: string): void; + + /** + * Gets the value of the property. + */ + getSelectedBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setSelectedBackgroundColor(selectedBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getSelectedBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setSelectedBackgroundImage(selectedBackgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getSelectedColor(): string; + + /** + * Sets the value of the property. + */ + setSelectedColor(selectedColor: string): void; + + /** + * Gets the value of the property. + */ + getSelectionStyle(): number; + + /** + * Sets the value of the property. + */ + setSelectionStyle(selectionStyle: number): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + } + + /** + * A table view section is a container within a table used to organize table view rows. + */ + interface TableViewSection extends Titanium.Proxy { + /** + * Title of this section footer. + */ + footerTitle: string; + + /** + * View to use for this section footer. + */ + footerView: Titanium.UI.View; + + /** + * Title of this section header. + */ + headerTitle: string; + + /** + * View to use for this section header. + */ + headerView: Titanium.UI.View; + + /** + * Number of rows in this section. + */ + readonly rowCount: number; + + /** + * Rows in this section. + */ + readonly rows: Titanium.UI.TableViewRow[]; + + /** + * Adds a table view row to this section. + */ + add(row: Titanium.UI.TableViewRow): void; + + /** + * Removes a table view row from this section. + */ + remove(row: Titanium.UI.TableViewRow): void; + + /** + * Returns a row in this section. + */ + rowAtIndex(index: number): Titanium.UI.TableViewRow; + + /** + * Gets the value of the property. + */ + getFooterTitle(): string; + + /** + * Sets the value of the property. + */ + setFooterTitle(footerTitle: string): void; + + /** + * Gets the value of the property. + */ + getFooterView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setFooterView(footerView: any): void; + + /** + * Gets the value of the property. + */ + getHeaderTitle(): string; + + /** + * Sets the value of the property. + */ + setHeaderTitle(headerTitle: string): void; + + /** + * Gets the value of the property. + */ + getHeaderView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setHeaderView(headerView: any): void; + + /** + * Gets the value of the property. + */ + getRowCount(): number; + + /** + * Gets the value of the property. + */ + getRows(): Titanium.UI.TableViewRow[]; + + } + + /** + * A multiline text field that supports editing and scrolling. + */ + interface TextArea extends Titanium.UI.View { + /** + * Determines the appearance of the keyboard displayed when this text area is focused. + */ + appearance: number; + + /** + * Determines the appearance of the keyboard displayed when this text area is focused. + */ + keyboardAppearance: number; + + /** + * Hint text attributed string. + */ + attributedHintText: Titanium.UI.AttributedString; + + /** + * TextArea attributed string. + */ + attributedString: Titanium.UI.AttributedString; + + /** + * Determines how text is capitalized during typing. + */ + autocapitalization: number; + + /** + * Determines whether to automatically correct text entered into this text area. + */ + autocorrect: boolean; + + /** + * Sets the autofill type for the text area. + */ + autofillType: string; + + /** + * Automatically convert text to clickable links. + */ + autoLink: number; + + /** + * Determines whether the value of this text area should be cleared when it is focused. + */ + clearOnEdit: boolean; + + /** + * Color of the text in this text area, as a color name or hex triplet. + */ + color: string; + + /** + * Determines whether this field can be edited. + */ + editable: boolean; + + /** + * Determines whether an ellipsis (`...`) should be used to indicate truncated text. + */ + ellipsize: boolean; + + /** + * Determines whether the return key is enabled automatically when there is text in this text + * area. + */ + enableReturnKey: boolean; + + /** + * Font to use for text. + */ + font: Font; + + /** + * Leave some space above the keyboard in landscape mode or not. + */ + fullscreen: boolean; + + /** + * Hint text to display when the field is empty. + */ + hintText: string; + + /** + * Color of hint text that displays when field is empty. + */ + hintTextColor: string; + + /** + * Hint type to display on the text field. + */ + hintType: number; + + /** + * Specifies if the text area should allow user interaction with the given URL in the given range of text. + */ + handleLinks: boolean; + + /** + * Array of toolbar button objects or a [toolbar](Titanium.UI.iOS.Toolbar) to be used when the + * keyboard is displayed. + */ + keyboardToolbar: Titanium.UI.View[] | Titanium.UI.iOS.Toolbar; + + /** + * Color of the keyboard toolbar if keyboardToolbar is an array, as a color name or hex triplet. + */ + keyboardToolbarColor: string; + + /** + * Height of the keyboard toolbar if keyboardToolbar is an array. + */ + keyboardToolbarHeight: number; + + /** + * Keyboard type to display when this text area is focused. + */ + keyboardType: number; + + /** + * Maximum length of text field input. + */ + maxLength: number; + + /** + * Sets the left and right padding of this TextArea. The text will always be vertically centered. + */ + padding: TextAreaPadding; + + /** + * Specifies the text to display on the keyboard `Return` key when this text area is focused. + */ + returnKeyType: number; + + /** + * Controls whether the scroll-to-top gesture is effective. + */ + scrollsToTop: boolean; + + /** + * Determinates if the undo and redo buttons on the left side of the keyboard should be displayed or not. Only valid on iOS9 and above. This property can only be set upon creation. + */ + showUndoRedoActions: boolean; + + /** + * Determines if the return key should be suppressed during text entry. + */ + suppressReturn: boolean; + + /** + * Text alignment within this text area. + * This has no effect on `hintText` when `hintType` is Ti.UI.HINT_TYPE_ANIMATED. + */ + textAlign: string | number; + + /** + * Value of this text area, which may be set programmatically and modified by the user. + */ + value: string; + + /** + * Determines whether this text area can be scrolled. + */ + scrollable: boolean; + + /** + * Returns the currently selected text of the text area. + */ + readonly selection: textAreaSelectedParams; + + /** + * Vertical alignment within this text area. + */ + verticalAlign: number | string; + + /** + * Forces this text area to lose focus. + */ + blur(): void; + + /** + * Forces this text area to gain focus. + */ + focus(): void; + + /** + * Returns `true` if this text area contains text. + */ + hasText(): boolean; + + /** + * Selects the text in range (start, end). + */ + setSelection(start: number, end: number): void; + + /** + * Gets the value of the property. + */ + getAppearance(): number; + + /** + * Sets the value of the property. + */ + setAppearance(appearance: number): void; + + /** + * Gets the value of the property. + */ + getKeyboardAppearance(): number; + + /** + * Sets the value of the property. + */ + setKeyboardAppearance(keyboardAppearance: number): void; + + /** + * Gets the value of the property. + */ + getAttributedHintText(): Titanium.UI.AttributedString; + + /** + * Sets the value of the property. + */ + setAttributedHintText(attributedHintText: Titanium.UI.AttributedString): void; + + /** + * Gets the value of the property. + */ + getAttributedString(): Titanium.UI.AttributedString; + + /** + * Sets the value of the property. + */ + setAttributedString(attributedString: Titanium.UI.AttributedString): void; + + /** + * Gets the value of the property. + */ + getAutocapitalization(): number; + + /** + * Sets the value of the property. + */ + setAutocapitalization(autocapitalization: number): void; + + /** + * Gets the value of the property. + */ + getAutocorrect(): boolean; + + /** + * Sets the value of the property. + */ + setAutocorrect(autocorrect: boolean): void; + + /** + * Gets the value of the property. + */ + getAutofillType(): string; + + /** + * Sets the value of the property. + */ + setAutofillType(autofillType: string): void; + + /** + * Gets the value of the property. + */ + getAutoLink(): number; + + /** + * Sets the value of the property. + */ + setAutoLink(autoLink: number): void; + + /** + * Gets the value of the property. + */ + getClearOnEdit(): boolean; + + /** + * Sets the value of the property. + */ + setClearOnEdit(clearOnEdit: boolean): void; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getEditable(): boolean; + + /** + * Sets the value of the property. + */ + setEditable(editable: boolean): void; + + /** + * Gets the value of the property. + */ + getEllipsize(): boolean; + + /** + * Sets the value of the property. + */ + setEllipsize(ellipsize: boolean): void; + + /** + * Gets the value of the property. + */ + getEnableReturnKey(): boolean; + + /** + * Sets the value of the property. + */ + setEnableReturnKey(enableReturnKey: boolean): void; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + /** + * Gets the value of the property. + */ + getFullscreen(): boolean; + + /** + * Sets the value of the property. + */ + setFullscreen(fullscreen: boolean): void; + + /** + * Gets the value of the property. + */ + getHintText(): string; + + /** + * Sets the value of the property. + */ + setHintText(hintText: string): void; + + /** + * Gets the value of the property. + */ + getHintTextColor(): string; + + /** + * Sets the value of the property. + */ + setHintTextColor(hintTextColor: string): void; + + /** + * Gets the value of the property. + */ + getHintType(): number; + + /** + * Sets the value of the property. + */ + setHintType(hintType: number): void; + + /** + * Gets the value of the property. + */ + getHandleLinks(): boolean; + + /** + * Sets the value of the property. + */ + setHandleLinks(handleLinks: boolean): void; + + /** + * Gets the value of the property. + */ + getKeyboardToolbar(): Titanium.UI.View[] | Titanium.UI.iOS.Toolbar; + + /** + * Sets the value of the property. + */ + setKeyboardToolbar(keyboardToolbar: any[]): void; + + /** + * Sets the value of the property. + */ + setKeyboardToolbar(keyboardToolbar: Titanium.UI.iOS.Toolbar): void; + + /** + * Gets the value of the property. + */ + getKeyboardToolbarColor(): string; + + /** + * Sets the value of the property. + */ + setKeyboardToolbarColor(keyboardToolbarColor: string): void; + + /** + * Gets the value of the property. + */ + getKeyboardToolbarHeight(): number; + + /** + * Sets the value of the property. + */ + setKeyboardToolbarHeight(keyboardToolbarHeight: number): void; + + /** + * Gets the value of the property. + */ + getKeyboardType(): number; + + /** + * Sets the value of the property. + */ + setKeyboardType(keyboardType: number): void; + + /** + * Gets the value of the property. + */ + getMaxLength(): number; + + /** + * Sets the value of the property. + */ + setMaxLength(maxLength: number): void; + + /** + * Gets the value of the property. + */ + getPadding(): TextAreaPadding; + + /** + * Sets the value of the property. + */ + setPadding(padding: TextAreaPadding): void; + + /** + * Gets the value of the property. + */ + getReturnKeyType(): number; + + /** + * Sets the value of the property. + */ + setReturnKeyType(returnKeyType: number): void; + + /** + * Gets the value of the property. + */ + getScrollsToTop(): boolean; + + /** + * Sets the value of the property. + */ + setScrollsToTop(scrollsToTop: boolean): void; + + /** + * Gets the value of the property. + */ + getShowUndoRedoActions(): boolean; + + /** + * Sets the value of the property. + */ + setShowUndoRedoActions(showUndoRedoActions: boolean): void; + + /** + * Gets the value of the property. + */ + getSuppressReturn(): boolean; + + /** + * Sets the value of the property. + */ + setSuppressReturn(suppressReturn: boolean): void; + + /** + * Gets the value of the property. + */ + getTextAlign(): string | number; + + /** + * Sets the value of the property. + */ + setTextAlign(textAlign: string): void; + + /** + * Sets the value of the property. + */ + setTextAlign(textAlign: number): void; + + /** + * Gets the value of the property. + */ + getValue(): string; + + /** + * Sets the value of the property. + */ + setValue(value: string): void; + + /** + * Gets the value of the property. + */ + getScrollable(): boolean; + + /** + * Sets the value of the property. + */ + setScrollable(scrollable: boolean): void; + + /** + * Gets the value of the property. + */ + getSelection(): textAreaSelectedParams; + + /** + * Gets the value of the property. + */ + getVerticalAlign(): number | string; + + /** + * Sets the value of the property. + */ + setVerticalAlign(verticalAlign: number): void; + + /** + * Sets the value of the property. + */ + setVerticalAlign(verticalAlign: string): void; + + } + + /** + * A single line text field. + */ + interface TextField extends Titanium.UI.View { + /** + * Determines the appearance of the keyboard displayed when this field is focused. + */ + appearance: number; + + /** + * Determines the appearance of the keyboard displayed when this field is focused. + */ + keyboardAppearance: number; + + /** + * TextField attributed string. + */ + attributedString: Titanium.UI.AttributedString; + + /** + * Hint text attributed string. + */ + attributedHintText: Titanium.UI.AttributedString; + + /** + * Determines how text is capitalized during typing. + */ + autocapitalization: number; + + /** + * Determines whether to automatically correct text entered into this text field. + */ + autocorrect: boolean; + + /** + * Sets the autofill type for the text field. + */ + autofillType: string; + + /** + * Automatically convert text to clickable links. + */ + autoLink: number; + + /** + * Border style for the field. + */ + borderStyle: number; + + /** + * Determines when the clear button is displayed. + */ + clearButtonMode: number; + + /** + * Determines whether the value of this text field should be cleared when it is focused. + */ + clearOnEdit: boolean; + + /** + * Color of the text in this text field, as a color name or hex triplet. + */ + color: string; + + /** + * Determines whether this field can be edited. + */ + editable: boolean; + + /** + * Determines whether an ellipsis (`...`) should be used to indicate truncated text. + */ + ellipsize: boolean; + + /** + * Determines whether the return key is enabled automatically when there is text in this text + * field. + */ + enableReturnKey: boolean; + + /** + * Font to use for text. + */ + font: Font; + + /** + * Leave some space above the keyboard in landscape mode or not. + */ + fullscreen: boolean; + + /** + * Hint text to display when the field is empty. + */ + hintText: string; + + /** + * Hint text color to display when the field is empty. + */ + hintTextColor: string; + + /** + * Key identifying a string from the locale file to use for the + * [hintText](Titanium.UI.TextField.hintText) property. + */ + hinttextid: string; + + /** + * Hint type to display on the text field. + */ + hintType: number; + + /** + * Input type to accept in the text field. Also influences the Keyboard type to display. + */ + inputType: number[]; + + /** + * Array of toolbar button objects or a [toolbar](Titanium.UI.iOS.Toolbar) to be used when the + * keyboard is displayed. + */ + keyboardToolbar: Titanium.UI.View[] | Titanium.UI.iOS.Toolbar; + + /** + * Color of the keyboard toolbar if keyboardToolbar is an array, as a color name or hex triplet. + */ + keyboardToolbarColor: string; + + /** + * Height of the keyboard toolbar if keyboardToolbar is an array. + */ + keyboardToolbarHeight: number; + + /** + * Keyboard type to display when this text field is focused. + */ + keyboardType: number; + + /** + * Left button view to display in the `TextField`. + */ + leftButton: any; + + /** + * Determines when to display the left button view. + */ + leftButtonMode: number; + + /** + * Padding between the left button and the edge of the field. + */ + leftButtonPadding: number; + + /** + * Minimum size of the font when the font is sized based on the contents. Enables font + * scaling to fit. + */ + minimumFontSize: number; + + /** + * Sets the padding of this text field. + */ + padding: TextFieldPadding; + + /** + * Left padding of this text field. + */ + paddingLeft: number; + + /** + * Right padding of this text field. + */ + paddingRight: number; + + /** + * Obscure the input text from the user. + */ + passwordMask: boolean; + + /** + * Specifies the text to display on the keyboard `Return` key when this field is focused. + */ + returnKeyType: number; + + /** + * Right button view. + */ + rightButton: any; + + /** + * Determines when to display the right button view. + */ + rightButtonMode: number; + + /** + * Padding between the right button and the edge of the field. + */ + rightButtonPadding: number; + + /** + * Determines whether the return key should be suppressed during entry. + */ + suppressReturn: boolean; + + /** + * Returns the currently selected text of the text field. + */ + readonly selection: textFieldSelectedParams; + + /** + * Determinates if the undo and redo buttons on the left side of the keyboard should be displayed or not. Only valid on iOS9 and above. + */ + showUndoRedoActions: boolean; + + /** + * Text alignment within this text field. + * This has no effect on `hintText` when `hintType` is Ti.UI.HINT_TYPE_ANIMATED. + */ + textAlign: string | number; + + /** + * Value of this text field, which may be set programmatically and modified by the user. + */ + value: string; + + /** + * Vertical alignment within this text field. + */ + verticalAlign: number | string; + + /** + * Maximum length of text field input. + */ + maxLength: number; + + /** + * Forces the field to lose focus. + */ + blur(): void; + + /** + * Forces the field to gain focus. + */ + focus(): void; + + /** + * Returns `true` if this text field contains text. + */ + hasText(): boolean; + + /** + * Selects the text in range (start, end). + */ + setSelection(start: number, end: number): void; + + /** + * Gets the value of the property. + */ + getAppearance(): number; + + /** + * Sets the value of the property. + */ + setAppearance(appearance: number): void; + + /** + * Gets the value of the property. + */ + getKeyboardAppearance(): number; + + /** + * Sets the value of the property. + */ + setKeyboardAppearance(keyboardAppearance: number): void; + + /** + * Gets the value of the property. + */ + getAttributedString(): Titanium.UI.AttributedString; + + /** + * Sets the value of the property. + */ + setAttributedString(attributedString: Titanium.UI.AttributedString): void; + + /** + * Gets the value of the property. + */ + getAttributedHintText(): Titanium.UI.AttributedString; + + /** + * Sets the value of the property. + */ + setAttributedHintText(attributedHintText: Titanium.UI.AttributedString): void; + + /** + * Gets the value of the property. + */ + getAutocapitalization(): number; + + /** + * Sets the value of the property. + */ + setAutocapitalization(autocapitalization: number): void; + + /** + * Gets the value of the property. + */ + getAutocorrect(): boolean; + + /** + * Sets the value of the property. + */ + setAutocorrect(autocorrect: boolean): void; + + /** + * Gets the value of the property. + */ + getAutofillType(): string; + + /** + * Sets the value of the property. + */ + setAutofillType(autofillType: string): void; + + /** + * Gets the value of the property. + */ + getAutoLink(): number; + + /** + * Sets the value of the property. + */ + setAutoLink(autoLink: number): void; + + /** + * Gets the value of the property. + */ + getBorderStyle(): number; + + /** + * Sets the value of the property. + */ + setBorderStyle(borderStyle: number): void; + + /** + * Gets the value of the property. + */ + getClearButtonMode(): number; + + /** + * Sets the value of the property. + */ + setClearButtonMode(clearButtonMode: number): void; + + /** + * Gets the value of the property. + */ + getClearOnEdit(): boolean; + + /** + * Sets the value of the property. + */ + setClearOnEdit(clearOnEdit: boolean): void; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getEditable(): boolean; + + /** + * Sets the value of the property. + */ + setEditable(editable: boolean): void; + + /** + * Gets the value of the property. + */ + getEllipsize(): boolean; + + /** + * Sets the value of the property. + */ + setEllipsize(ellipsize: boolean): void; + + /** + * Gets the value of the property. + */ + getEnableReturnKey(): boolean; + + /** + * Sets the value of the property. + */ + setEnableReturnKey(enableReturnKey: boolean): void; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + /** + * Gets the value of the property. + */ + getFullscreen(): boolean; + + /** + * Sets the value of the property. + */ + setFullscreen(fullscreen: boolean): void; + + /** + * Gets the value of the property. + */ + getHintText(): string; + + /** + * Sets the value of the property. + */ + setHintText(hintText: string): void; + + /** + * Gets the value of the property. + */ + getHintTextColor(): string; + + /** + * Sets the value of the property. + */ + setHintTextColor(hintTextColor: string): void; + + /** + * Gets the value of the property. + */ + getHinttextid(): string; + + /** + * Sets the value of the property. + */ + setHinttextid(hinttextid: string): void; + + /** + * Gets the value of the property. + */ + getHintType(): number; + + /** + * Sets the value of the property. + */ + setHintType(hintType: number): void; + + /** + * Gets the value of the property. + */ + getInputType(): number[]; + + /** + * Sets the value of the property. + */ + setInputType(inputType: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getKeyboardToolbar(): Titanium.UI.View[] | Titanium.UI.iOS.Toolbar; + + /** + * Sets the value of the property. + */ + setKeyboardToolbar(keyboardToolbar: any[]): void; + + /** + * Sets the value of the property. + */ + setKeyboardToolbar(keyboardToolbar: Titanium.UI.iOS.Toolbar): void; + + /** + * Gets the value of the property. + */ + getKeyboardToolbarColor(): string; + + /** + * Sets the value of the property. + */ + setKeyboardToolbarColor(keyboardToolbarColor: string): void; + + /** + * Gets the value of the property. + */ + getKeyboardToolbarHeight(): number; + + /** + * Sets the value of the property. + */ + setKeyboardToolbarHeight(keyboardToolbarHeight: number): void; + + /** + * Gets the value of the property. + */ + getKeyboardType(): number; + + /** + * Sets the value of the property. + */ + setKeyboardType(keyboardType: number): void; + + /** + * Gets the value of the property. + */ + getLeftButton(): any; + + /** + * Sets the value of the property. + */ + setLeftButton(leftButton: any): void; + + /** + * Gets the value of the property. + */ + getLeftButtonMode(): number; + + /** + * Sets the value of the property. + */ + setLeftButtonMode(leftButtonMode: number): void; + + /** + * Gets the value of the property. + */ + getLeftButtonPadding(): number; + + /** + * Sets the value of the property. + */ + setLeftButtonPadding(leftButtonPadding: number): void; + + /** + * Gets the value of the property. + */ + getMinimumFontSize(): number; + + /** + * Sets the value of the property. + */ + setMinimumFontSize(minimumFontSize: number): void; + + /** + * Gets the value of the property. + */ + getPadding(): TextFieldPadding; + + /** + * Sets the value of the property. + */ + setPadding(padding: TextFieldPadding): void; + + /** + * Gets the value of the property. + */ + getPaddingLeft(): number; + + /** + * Sets the value of the property. + */ + setPaddingLeft(paddingLeft: number): void; + + /** + * Gets the value of the property. + */ + getPaddingRight(): number; + + /** + * Sets the value of the property. + */ + setPaddingRight(paddingRight: number): void; + + /** + * Gets the value of the property. + */ + getPasswordMask(): boolean; + + /** + * Sets the value of the property. + */ + setPasswordMask(passwordMask: boolean): void; + + /** + * Gets the value of the property. + */ + getReturnKeyType(): number; + + /** + * Sets the value of the property. + */ + setReturnKeyType(returnKeyType: number): void; + + /** + * Gets the value of the property. + */ + getRightButton(): any; + + /** + * Sets the value of the property. + */ + setRightButton(rightButton: any): void; + + /** + * Gets the value of the property. + */ + getRightButtonMode(): number; + + /** + * Sets the value of the property. + */ + setRightButtonMode(rightButtonMode: number): void; + + /** + * Gets the value of the property. + */ + getRightButtonPadding(): number; + + /** + * Sets the value of the property. + */ + setRightButtonPadding(rightButtonPadding: number): void; + + /** + * Gets the value of the property. + */ + getSuppressReturn(): boolean; + + /** + * Sets the value of the property. + */ + setSuppressReturn(suppressReturn: boolean): void; + + /** + * Gets the value of the property. + */ + getSelection(): textFieldSelectedParams; + + /** + * Gets the value of the property. + */ + getShowUndoRedoActions(): boolean; + + /** + * Sets the value of the property. + */ + setShowUndoRedoActions(showUndoRedoActions: boolean): void; + + /** + * Gets the value of the property. + */ + getTextAlign(): string | number; + + /** + * Sets the value of the property. + */ + setTextAlign(textAlign: string): void; + + /** + * Sets the value of the property. + */ + setTextAlign(textAlign: number): void; + + /** + * Gets the value of the property. + */ + getValue(): string; + + /** + * Sets the value of the property. + */ + setValue(value: string): void; + + /** + * Gets the value of the property. + */ + getVerticalAlign(): number | string; + + /** + * Sets the value of the property. + */ + setVerticalAlign(verticalAlign: number): void; + + /** + * Sets the value of the property. + */ + setVerticalAlign(verticalAlign: string): void; + + /** + * Gets the value of the property. + */ + getMaxLength(): number; + + /** + * Sets the value of the property. + */ + setMaxLength(maxLength: number): void; + + } + + /** + * A toolbar, which can contain buttons and certain other controls. + */ + interface Toolbar extends Titanium.UI.View { + /** + * Background color for the toolbar, as a color name or hex triplet. + */ + barColor: string; + + /** + * An array of buttons (or other widgets) contained in the toolbar. + */ + items: Titanium.UI.View[]; + + /** + * If `true`, the background of the toolbar extends upwards. + */ + extendBackground: boolean; + + /** + * If `true`, a translucent background color is used for the toolbar. + */ + translucent: boolean; + + /** + * Returns the margin after the toolbar's content when there are action buttons. + */ + contentInsetEndWithActions: number; + + /** + * Returns the margin at the toolbar's content start when there is a navigation button. + */ + contentInsetStartWithNavigation: number; + + /** + * Image to be used as a logo in the Toolbar. + */ + logo: string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Image to be used for a navigation icon. + */ + navigationIcon: string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Image to be used for the overflow menu. + */ + overflowIcon: string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Text of the subtitle. + */ + subtitle: string; + + /** + * Color for toolbar's subtitle + */ + subtitleTextColor: string; + + /** + * Text of the title. + */ + title: string; + + /** + * Color string with any Titanium supported format + */ + titleTextColor: string; + + /** + * Collapses expanded ActionViews if there is any + */ + collapseActionViews(): void; + + /** + * Collapses expandend ActionViews and hides overflow menu + */ + dismissPopupMenus(): void; + + /** + * Returns the margin at the toolbar's content end. + */ + getContentInsetEnd(): number; + + /** + * Returns the margin on the left of the toolbar's content. + */ + getContentInsetLeft(): number; + + /** + * Returns the margin on the right of the toolbar's content. + */ + getContentInsetRight(): number; + + /** + * Returns the margin at the toolbar's content start. + */ + getContentInsetStart(): number; + + /** + * Returns the margin at the toolbar's content end that will be used with the current configuration of the toolbar. + */ + getCurrentContentInsetEnd(): number; + + /** + * Returns the margin on the left of the toolbar's content that will be used with the current configuration of the toolbar. + */ + getCurrentContentInsetLeft(): number; + + /** + * Returns the margin on the right of the toolbar's content that will be used with the current configuration of the toolbar. + */ + getCurrentContentInsetRight(): number; + + /** + * Returns the margin at the toolbar's content start that will be used with the current configuration of the toolbar. + */ + getCurrentContentInsetStart(): number; + + /** + * Checks if the toolbar is currently hosting an expanded action view. + */ + hasExpandedActionView(): boolean; + + /** + * Hides the overflow menu if there is one. + */ + hideOverflowMenu(): void; + + /** + * Checks if the toolbar is currently hosting an expanded action view. + */ + isOverflowMenuShowing(): boolean; + + /** + * Sets the content margins of the toolbar + */ + setContentInsetsAbsolute(insetLeft: number, insetRight: number): void; + + /** + * Sets the content margins relative to the layout direction + */ + setContentInsetsRelative(insetStart: number, insetEnd: number): void; + + /** + * Shows the overflow menu if there is one + */ + showOverflowMenu(): void; + + /** + * Gets the value of the property. + */ + getBarColor(): string; + + /** + * Sets the value of the property. + */ + setBarColor(barColor: string): void; + + /** + * Gets the value of the property. + */ + getItems(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setItems(items: any[]): void; + + /** + * Gets the value of the property. + */ + getTranslucent(): boolean; + + /** + * Sets the value of the property. + */ + setTranslucent(translucent: boolean): void; + + /** + * Gets the value of the property. + */ + getContentInsetEndWithActions(): number; + + /** + * Sets the value of the property. + */ + setContentInsetEndWithActions(contentInsetEndWithActions: number): void; + + /** + * Gets the value of the property. + */ + getContentInsetStartWithNavigation(): number; + + /** + * Sets the value of the property. + */ + setContentInsetStartWithNavigation(contentInsetStartWithNavigation: number): void; + + /** + * Gets the value of the property. + */ + getLogo(): string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Sets the value of the property. + */ + setLogo(logo: string): void; + + /** + * Sets the value of the property. + */ + setLogo(logo: Titanium.Blob): void; + + /** + * Sets the value of the property. + */ + setLogo(logo: Titanium.Filesystem.File): void; + + /** + * Gets the value of the property. + */ + getNavigationIcon(): string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Sets the value of the property. + */ + setNavigationIcon(navigationIcon: string): void; + + /** + * Sets the value of the property. + */ + setNavigationIcon(navigationIcon: Titanium.Blob): void; + + /** + * Sets the value of the property. + */ + setNavigationIcon(navigationIcon: Titanium.Filesystem.File): void; + + /** + * Gets the value of the property. + */ + getOverflowIcon(): string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Sets the value of the property. + */ + setOverflowIcon(overflowIcon: string): void; + + /** + * Sets the value of the property. + */ + setOverflowIcon(overflowIcon: Titanium.Blob): void; + + /** + * Sets the value of the property. + */ + setOverflowIcon(overflowIcon: Titanium.Filesystem.File): void; + + /** + * Gets the value of the property. + */ + getSubtitle(): string; + + /** + * Sets the value of the property. + */ + setSubtitle(subtitle: string): void; + + /** + * Gets the value of the property. + */ + getSubtitleTextColor(): string; + + /** + * Sets the value of the property. + */ + setSubtitleTextColor(subtitleTextColor: string): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleTextColor(): string; + + /** + * Sets the value of the property. + */ + setTitleTextColor(titleTextColor: string): void; + + } + + /** + * The web view allows you to open an HTML5 based view which can load either local or remote content. + */ + interface WebView extends Titanium.UI.View { + /** + * A Boolean value that determines whether pressing on a link displays a preview of the + * destination for the link. + */ + allowsLinkPreview: boolean; + + /** + * An array of url strings to blacklist. + */ + blacklistedURLs: string[]; + + /** + * Web content to load. + */ + data: Titanium.Blob | Titanium.Filesystem.File; + + /** + * Determines whether the view will bounce when scrolling to the edge of the scrollable region. + */ + disableBounce: boolean; + + /** + * Determines whether or not the webview should not be able to display the context menu. + */ + disableContextMenu: boolean; + + /** + * Enable adding javascript interfaces internally to webview prior to JELLY_BEAN_MR1 (Android 4.2) + */ + enableJavascriptInterface: boolean; + + /** + * Lets the webview handle platform supported urls + */ + handlePlatformUrl: boolean; + + /** + * Hides activity indicator when loading remote URL. + */ + hideLoadIndicator: boolean; + + /** + * HTML content of this web view. + */ + html: string; + + /** + * A Boolean value indicating whether web content can programmatically display the keyboard. + */ + keyboardDisplayRequiresUserAction: boolean; + + /** + * Controls whether to ignore invalid SSL certificates or not. + */ + ignoreSslError: boolean; + + /** + * Indicates if the webview is loading content. + */ + loading: boolean; + + /** + * Callback function called when there is a request for the application to create a new window + * to host new content. + */ + onCreateWindow: (param0: any) => any; + + /** + * Determines the behavior when the user overscrolls the view. + */ + overScrollMode: number; + + /** + * Determines how a cache is used in this web view. + */ + cacheMode: number; + + /** + * Determines how to treat content that requires plugins in this web view. + */ + pluginState: number; + + /** + * Controls whether the scroll-to-top gesture is effective. + */ + scrollsToTop: boolean; + + /** + * If `true`, zoom controls are enabled. + */ + enableZoomControls: boolean; + + /** + * If `true`, scale contents to fit the web view. + */ + scalesPageToFit: boolean; + + /** + * URL to the web document. + */ + url: string; + + /** + * The User-Agent header used by the web view when requesting content. + */ + userAgent: string; + + /** + * Explicitly specifies if this web view handles touches. + */ + willHandleTouches: boolean; + + /** + * Enables using light touches to make a selection and activate mouseovers. + */ + lightTouchEnabled: boolean; + + /** + * Sets extra request headers for this web view to use on subsequent URL requests. + */ + requestHeaders: any; + + /** + * Sets the value of [html](Titanium.UI.WebView.html) property. + */ + setHtml(html: any, options?: any): void; + + /** + * Returns `true` if the web view can go back in its history list. + */ + canGoBack(): boolean; + + /** + * Returns `true` if the web view can go forward in its history list. + */ + canGoForward(): boolean; + + /** + * Evaluates a JavaScript expression inside the context of the web view and + * optionally, returns a result. + */ + evalJS(code: string): string; + + /** + * Goes back one entry in the web view's history list, to the previous page. + */ + goBack(): void; + + /** + * Goes forward one entry in this web view's history list, if possible. + */ + goForward(): void; + + /** + * Pauses native webview plugins. + */ + pause(): void; + + /** + * Reloads the current webpage. + */ + reload(): void; + + /** + * Forces the web view to repaint its contents. + */ + repaint(): void; + + /** + * Releases memory when the web view is no longer needed. + */ + release(): void; + + /** + * Resume native webview plugins. + */ + resume(): void; + + /** + * Sets the basic authentication for this web view to use on subsequent URl requests. + */ + setBasicAuthentication(username: string, password: string): void; + + /** + * Stops loading a currently loading page. + */ + stopLoading(): void; + + /** + * Gets the value of the property. + */ + getAllowsLinkPreview(): boolean; + + /** + * Sets the value of the property. + */ + setAllowsLinkPreview(allowsLinkPreview: boolean): void; + + /** + * Gets the value of the property. + */ + getBlacklistedURLs(): string[]; + + /** + * Sets the value of the property. + */ + setBlacklistedURLs(blacklistedURLs: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getData(): Titanium.Blob | Titanium.Filesystem.File; + + /** + * Sets the value of the property. + */ + setData(data: Titanium.Blob): void; + + /** + * Sets the value of the property. + */ + setData(data: Titanium.Filesystem.File): void; + + /** + * Gets the value of the property. + */ + getDisableBounce(): boolean; + + /** + * Sets the value of the property. + */ + setDisableBounce(disableBounce: boolean): void; + + /** + * Gets the value of the property. + */ + getDisableContextMenu(): boolean; + + /** + * Sets the value of the property. + */ + setDisableContextMenu(disableContextMenu: boolean): void; + + /** + * Gets the value of the property. + */ + getEnableJavascriptInterface(): boolean; + + /** + * Sets the value of the property. + */ + setEnableJavascriptInterface(enableJavascriptInterface: boolean): void; + + /** + * Gets the value of the property. + */ + getHandlePlatformUrl(): boolean; + + /** + * Sets the value of the property. + */ + setHandlePlatformUrl(handlePlatformUrl: boolean): void; + + /** + * Gets the value of the property. + */ + getHideLoadIndicator(): boolean; + + /** + * Sets the value of the property. + */ + setHideLoadIndicator(hideLoadIndicator: boolean): void; + + /** + * Gets the value of the property. + */ + getHtml(): string; + + /** + * Sets the value of the property. + */ + setHtml(html: string): void; + + /** + * Gets the value of the property. + */ + getKeyboardDisplayRequiresUserAction(): boolean; + + /** + * Sets the value of the property. + */ + setKeyboardDisplayRequiresUserAction(keyboardDisplayRequiresUserAction: boolean): void; + + /** + * Gets the value of the property. + */ + getIgnoreSslError(): boolean; + + /** + * Sets the value of the property. + */ + setIgnoreSslError(ignoreSslError: boolean): void; + + /** + * Gets the value of the property. + */ + getLoading(): boolean; + + /** + * Sets the value of the property. + */ + setLoading(loading: boolean): void; + + /** + * Gets the value of the property. + */ + getOnCreateWindow(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnCreateWindow(onCreateWindow: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOverScrollMode(): number; + + /** + * Sets the value of the property. + */ + setOverScrollMode(overScrollMode: number): void; + + /** + * Gets the value of the property. + */ + getCacheMode(): number; + + /** + * Sets the value of the property. + */ + setCacheMode(cacheMode: number): void; + + /** + * Gets the value of the property. + */ + getPluginState(): number; + + /** + * Sets the value of the property. + */ + setPluginState(pluginState: number): void; + + /** + * Gets the value of the property. + */ + getScrollsToTop(): boolean; + + /** + * Sets the value of the property. + */ + setScrollsToTop(scrollsToTop: boolean): void; + + /** + * Gets the value of the property. + */ + getEnableZoomControls(): boolean; + + /** + * Sets the value of the property. + */ + setEnableZoomControls(enableZoomControls: boolean): void; + + /** + * Gets the value of the property. + */ + getScalesPageToFit(): boolean; + + /** + * Sets the value of the property. + */ + setScalesPageToFit(scalesPageToFit: boolean): void; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + /** + * Gets the value of the property. + */ + getUserAgent(): string; + + /** + * Sets the value of the property. + */ + setUserAgent(userAgent: string): void; + + /** + * Gets the value of the property. + */ + getWillHandleTouches(): boolean; + + /** + * Sets the value of the property. + */ + setWillHandleTouches(willHandleTouches: boolean): void; + + /** + * Gets the value of the property. + */ + getLightTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setLightTouchEnabled(lightTouchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getRequestHeaders(): any; + + /** + * Sets the value of the property. + */ + setRequestHeaders(requestHeaders: any): void; + + } + + /** + * The Window is an empty drawing surface or container. + */ + interface Window extends Titanium.UI.View { + /** + * For lightweight windows, this property returns undefined. + * For heavyweight windows, this property contains a reference to the + * Android Activity object associated with this window. + */ + readonly activity: Titanium.Android.Activity; + + /** + * Title for the back button. This is only valid when the window is a child of a tab. + */ + backButtonTitle: string; + + /** + * The image to show as the back button. This is only valid when the window is a child of a tab. + */ + backButtonTitleImage: string | Titanium.Blob; + + /** + * Background color for the nav bar, as a color name or hex triplet. + */ + barColor: string; + + /** + * Background image for the nav bar, specified as a URL to a local image. + */ + barImage: string; + + /** + * Boolean value indicating if the application should exit when the Android + * Back button is pressed while the window is being shown or when the window + * is closed programmatically. + */ + exitOnClose: boolean; + + /** + * An array of supported values specified using the EXTEND_EDGE constants in . Valid on iOS 7 and greater. + */ + extendEdges: number[]; + + /** + * Treat the content of the window as secure, preventing it from appearing in screenshots or from being viewed on non-secure displays. + */ + flagSecure: boolean; + + /** + * Specifies if the edges should extend beyond opaque bars (navigation bar, tab bar, toolbar). Valid on iOS 7 and greater. + */ + includeOpaqueBars: boolean; + + /** + * Specifies whether or not the view controller should automatically adjust its scroll view insets. Valid on iOS 7 and greater. + */ + autoAdjustScrollViewInsets: boolean; + + /** + * Specifies whether the content (subviews) of the window will render inside the safe-area or not. + * Only used in iOS 11.0 and later. + */ + extendSafeArea: boolean; + + /** + * Boolean value indicating if the window is fullscreen. + */ + fullscreen: boolean; + + /** + * Set this to true to hide the shadow image of the navigation bar. + */ + hideShadow: boolean; + + /** + * Set this to true to hide the navigation bar on swipe. + */ + hidesBarsOnSwipe: boolean; + + /** + * Set this to true to hide the navigation bar on tap. + */ + hidesBarsOnTap: boolean; + + /** + * Set this to true to hide the navigation bar when the keyboard appears. + */ + hidesBarsWhenKeyboardAppears: boolean; + + /** + * A Boolean value indicating whether the title should be displayed in a large format. + */ + largeTitleEnabled: string; + + /** + * The mode to use when displaying the title of the navigation bar. + */ + largeTitleDisplayMode: number; + + /** + * View to show in the left nav bar area. + */ + leftNavButton: Titanium.UI.View; + + /** + * An Array of views to show in the left nav bar area. + */ + leftNavButtons: Titanium.UI.View[]; + + /** + * Indicates to open a modal window or not. + */ + modal: boolean; + + /** + * Hides the navigation bar (`true`) or shows the navigation bar (`false`). + */ + navBarHidden: boolean; + + /** + * The tintColor to apply to the navigation bar. This property is applicable on iOS 7 and greater. + */ + navTintColor: string; + + /** + * Callback function that overrides the default behavior when the user presses the **Back** + * button. + */ + onBack: (param0: any) => any; + + /** + * Array of supported orientation modes, specified using the orientation + * constants defined in . + */ + orientationModes: number[]; + + /** + * Current orientation of the window. + */ + readonly orientation: number; + + /** + * View to show in the right nav bar area. + */ + rightNavButton: Titanium.UI.View; + + /** + * An Array of views to show in the right nav bar area. + */ + rightNavButtons: Titanium.UI.View[]; + + /** + * Shadow image for the navigation bar, specified as a URL to a local image.. + */ + shadowImage: string; + + /** + * Boolean value to enable split action bar. + */ + splitActionBar: boolean; + + /** + * The status bar style associated with this window. + */ + statusBarStyle: number; + + /** + * Maintain a sustainable level of performance. + */ + sustainedPerformanceMode: boolean; + + /** + * Boolean value indicating if the user should be able to close a window using a swipe gesture. + */ + swipeToClose: boolean; + + /** + * Boolean value indicating if the tab bar should be hidden. + */ + tabBarHidden: boolean; + + /** + * Name of the theme to apply to the window. + */ + theme: string; + + /** + * Title of the window. + */ + title: string; + + /** + * Title text attributes of the window. + */ + titleAttributes: titleAttributesParams; + + /** + * View to show in the title area of the nav bar. + */ + titleControl: Titanium.UI.View; + + /** + * Image to show in the title area of the nav bar, specified as a local file path or URL. + */ + titleImage: string; + + /** + * Title prompt for the window. + */ + titlePrompt: string; + + /** + * Key identifying a string from the locale file to use for the window title. + */ + titleid: string; + + /** + * Key identifying a string from the locale file to use for the window title prompt. + */ + titlepromptid: string; + + /** + * Array of button objects to show in the window's toolbar. + */ + toolbar: any[]; + + /** + * Use a transition animation when opening or closing windows in a + * or . + */ + transitionAnimation: Titanium.Proxy; + + /** + * Boolean value indicating if the nav bar is translucent. + */ + translucent: boolean; + + /** + * Loads a JavaScript file from a local URL. + */ + url: string; + + /** + * Additional flags to set on the Activity Window. + */ + windowFlags: number; + + /** + * Determines whether a heavyweight window's soft input area (ie software keyboard) is visible + * as it receives focus and how the window behaves in order to accomodate it while keeping its + * contents in view. + */ + windowSoftInputMode: number; + + /** + * Set the pixel format for the Activity's Window. + */ + windowPixelFormat: number; + + /** + * The type of transition used when activity is exiting. + */ + activityExitTransition: number; + + /** + * The type of transition used when activity is entering. + */ + activityEnterTransition: number; + + /** + * The type of transition used when returning from a previously started activity. + */ + activityReturnTransition: number; + + /** + * The type of transition used when reentering to a previously started activity. + */ + activityReenterTransition: number; + + /** + * The type of exit transition used when animating shared elements between two activities. + */ + activitySharedElementExitTransition: number; + + /** + * The type of enter transition used when animating shared elements between two activities. + */ + activitySharedElementEnterTransition: number; + + /** + * The type of return transition used when animating shared elements between two activities. + */ + activitySharedElementReturnTransition: number; + + /** + * The type of reenter transition used when animating shared elements between two activities. + */ + activitySharedElementReenterTransition: number; + + /** + * Adds a common UI element to participate in window transition animation. + */ + addSharedElement(view: any, transitionName: string): void; + + /** + * Closes the window. + */ + close(params?: any): void; + + /** + * Hides the navigation bar. + */ + hideNavBar(options?: any): void; + + /** + * Hides the tab bar. Must be called before opening the window. + */ + hideTabBar(): void; + + /** + * Opens the window. + */ + open(params?: openWindowParams): void; + + /** + * Clears all added shared elements. + */ + removeAllSharedElements(): void; + + /** + * Sets the array of items to show in the window's toolbar. + */ + setToolbar(items: ReadonlyArray, params?: windowToolbarParam): void; + + /** + * Makes the navigation bar visible. + */ + showNavBar(options?: any): void; + + /** + * Makes the bottom toolbar visible. + */ + showToolbar(options?: any): void; + + /** + * Makes the bottom toolbar invisible. + */ + hideToolbar(options?: any): void; + + /** + * Gets the value of the property. + */ + getActivity(): Titanium.Android.Activity; + + /** + * Gets the value of the property. + */ + getBackButtonTitle(): string; + + /** + * Sets the value of the property. + */ + setBackButtonTitle(backButtonTitle: string): void; + + /** + * Gets the value of the property. + */ + getBackButtonTitleImage(): string | Titanium.Blob; + + /** + * Sets the value of the property. + */ + setBackButtonTitleImage(backButtonTitleImage: string): void; + + /** + * Sets the value of the property. + */ + setBackButtonTitleImage(backButtonTitleImage: Titanium.Blob): void; + + /** + * Gets the value of the property. + */ + getBarColor(): string; + + /** + * Sets the value of the property. + */ + setBarColor(barColor: string): void; + + /** + * Gets the value of the property. + */ + getBarImage(): string; + + /** + * Sets the value of the property. + */ + setBarImage(barImage: string): void; + + /** + * Gets the value of the property. + */ + getExitOnClose(): boolean; + + /** + * Sets the value of the property. + */ + setExitOnClose(exitOnClose: boolean): void; + + /** + * Gets the value of the property. + */ + getExtendEdges(): number[]; + + /** + * Sets the value of the property. + */ + setExtendEdges(extendEdges: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getFlagSecure(): boolean; + + /** + * Sets the value of the property. + */ + setFlagSecure(flagSecure: boolean): void; + + /** + * Gets the value of the property. + */ + getIncludeOpaqueBars(): boolean; + + /** + * Sets the value of the property. + */ + setIncludeOpaqueBars(includeOpaqueBars: boolean): void; + + /** + * Gets the value of the property. + */ + getAutoAdjustScrollViewInsets(): boolean; + + /** + * Sets the value of the property. + */ + setAutoAdjustScrollViewInsets(autoAdjustScrollViewInsets: boolean): void; + + /** + * Gets the value of the property. + */ + getExtendSafeArea(): boolean; + + /** + * Sets the value of the property. + */ + setExtendSafeArea(extendSafeArea: boolean): void; + + /** + * Gets the value of the property. + */ + getFullscreen(): boolean; + + /** + * Sets the value of the property. + */ + setFullscreen(fullscreen: boolean): void; + + /** + * Gets the value of the property. + */ + getHideShadow(): boolean; + + /** + * Sets the value of the property. + */ + setHideShadow(hideShadow: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsOnSwipe(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsOnSwipe(hidesBarsOnSwipe: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsOnTap(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsOnTap(hidesBarsOnTap: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsWhenKeyboardAppears(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsWhenKeyboardAppears(hidesBarsWhenKeyboardAppears: boolean): void; + + /** + * Gets the value of the property. + */ + getLargeTitleEnabled(): string; + + /** + * Sets the value of the property. + */ + setLargeTitleEnabled(largeTitleEnabled: string): void; + + /** + * Gets the value of the property. + */ + getLargeTitleDisplayMode(): number; + + /** + * Sets the value of the property. + */ + setLargeTitleDisplayMode(largeTitleDisplayMode: number): void; + + /** + * Gets the value of the property. + */ + getLeftNavButton(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setLeftNavButton(leftNavButton: any): void; + + /** + * Gets the value of the property. + */ + getLeftNavButtons(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setLeftNavButtons(leftNavButtons: any[]): void; + + /** + * Gets the value of the property. + */ + getModal(): boolean; + + /** + * Sets the value of the property. + */ + setModal(modal: boolean): void; + + /** + * Gets the value of the property. + */ + getNavBarHidden(): boolean; + + /** + * Sets the value of the property. + */ + setNavBarHidden(navBarHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getNavTintColor(): string; + + /** + * Sets the value of the property. + */ + setNavTintColor(navTintColor: string): void; + + /** + * Gets the value of the property. + */ + getOnBack(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnBack(onBack: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOrientationModes(): number[]; + + /** + * Sets the value of the property. + */ + setOrientationModes(orientationModes: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getOrientation(): number; + + /** + * Gets the value of the property. + */ + getRightNavButton(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setRightNavButton(rightNavButton: any): void; + + /** + * Gets the value of the property. + */ + getRightNavButtons(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setRightNavButtons(rightNavButtons: any[]): void; + + /** + * Gets the value of the property. + */ + getShadowImage(): string; + + /** + * Sets the value of the property. + */ + setShadowImage(shadowImage: string): void; + + /** + * Gets the value of the property. + */ + getSplitActionBar(): boolean; + + /** + * Sets the value of the property. + */ + setSplitActionBar(splitActionBar: boolean): void; + + /** + * Gets the value of the property. + */ + getStatusBarStyle(): number; + + /** + * Sets the value of the property. + */ + setStatusBarStyle(statusBarStyle: number): void; + + /** + * Gets the value of the property. + */ + getSustainedPerformanceMode(): boolean; + + /** + * Sets the value of the property. + */ + setSustainedPerformanceMode(sustainedPerformanceMode: boolean): void; + + /** + * Gets the value of the property. + */ + getSwipeToClose(): boolean; + + /** + * Sets the value of the property. + */ + setSwipeToClose(swipeToClose: boolean): void; + + /** + * Gets the value of the property. + */ + getTabBarHidden(): boolean; + + /** + * Sets the value of the property. + */ + setTabBarHidden(tabBarHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getTheme(): string; + + /** + * Sets the value of the property. + */ + setTheme(theme: string): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleAttributes(): titleAttributesParams; + + /** + * Sets the value of the property. + */ + setTitleAttributes(titleAttributes: titleAttributesParams): void; + + /** + * Gets the value of the property. + */ + getTitleControl(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setTitleControl(titleControl: any): void; + + /** + * Gets the value of the property. + */ + getTitleImage(): string; + + /** + * Sets the value of the property. + */ + setTitleImage(titleImage: string): void; + + /** + * Gets the value of the property. + */ + getTitlePrompt(): string; + + /** + * Sets the value of the property. + */ + setTitlePrompt(titlePrompt: string): void; + + /** + * Gets the value of the property. + */ + getTitleid(): string; + + /** + * Sets the value of the property. + */ + setTitleid(titleid: string): void; + + /** + * Gets the value of the property. + */ + getTitlepromptid(): string; + + /** + * Sets the value of the property. + */ + setTitlepromptid(titlepromptid: string): void; + + /** + * Gets the value of the property. + */ + getToolbar(): any[]; + + /** + * Sets the value of the property. + */ + setToolbar(toolbar: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getTransitionAnimation(): Titanium.Proxy; + + /** + * Sets the value of the property. + */ + setTransitionAnimation(transitionAnimation: Titanium.Proxy): void; + + /** + * Gets the value of the property. + */ + getTranslucent(): boolean; + + /** + * Sets the value of the property. + */ + setTranslucent(translucent: boolean): void; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + /** + * Gets the value of the property. + */ + getWindowFlags(): number; + + /** + * Sets the value of the property. + */ + setWindowFlags(windowFlags: number): void; + + /** + * Gets the value of the property. + */ + getWindowSoftInputMode(): number; + + /** + * Sets the value of the property. + */ + setWindowSoftInputMode(windowSoftInputMode: number): void; + + /** + * Gets the value of the property. + */ + getWindowPixelFormat(): number; + + /** + * Sets the value of the property. + */ + setWindowPixelFormat(windowPixelFormat: number): void; + + /** + * Gets the value of the property. + */ + getActivityExitTransition(): number; + + /** + * Sets the value of the property. + */ + setActivityExitTransition(activityExitTransition: number): void; + + /** + * Gets the value of the property. + */ + getActivityEnterTransition(): number; + + /** + * Sets the value of the property. + */ + setActivityEnterTransition(activityEnterTransition: number): void; + + /** + * Gets the value of the property. + */ + getActivityReturnTransition(): number; + + /** + * Sets the value of the property. + */ + setActivityReturnTransition(activityReturnTransition: number): void; + + /** + * Gets the value of the property. + */ + getActivityReenterTransition(): number; + + /** + * Sets the value of the property. + */ + setActivityReenterTransition(activityReenterTransition: number): void; + + /** + * Gets the value of the property. + */ + getActivitySharedElementExitTransition(): number; + + /** + * Sets the value of the property. + */ + setActivitySharedElementExitTransition(activitySharedElementExitTransition: number): void; + + /** + * Gets the value of the property. + */ + getActivitySharedElementEnterTransition(): number; + + /** + * Sets the value of the property. + */ + setActivitySharedElementEnterTransition(activitySharedElementEnterTransition: number): void; + + /** + * Gets the value of the property. + */ + getActivitySharedElementReturnTransition(): number; + + /** + * Sets the value of the property. + */ + setActivitySharedElementReturnTransition(activitySharedElementReturnTransition: number): void; + + /** + * Gets the value of the property. + */ + getActivitySharedElementReenterTransition(): number; + + /** + * Sets the value of the property. + */ + setActivitySharedElementReenterTransition(activitySharedElementReenterTransition: number): void; + + } + + + /** + * A set of constants for the styles available for objects. + */ + namespace ActivityIndicatorStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Large white spinning indicator. + */ + const BIG: number; + + /** + * Small gray spinning indicator. + */ + const DARK: number; + + /** + * Large gray spinning indicator. + */ + const BIG_DARK: number; + + /** + * Small white spinning indicator (default). + */ + const PLAIN: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + } + + /** + * The Android-specific UI capabilities. All properties, methods and events in this namespace will + * only work on Android systems. + */ + namespace Android { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Raw bit controlling whether the right/bottom edge is clipped to its container, based on the gravity direction being applied. + */ + const GRAVITY_AXIS_CLIP: number; + + /** + * Raw bit controlling how the right/bottom edge is placed. + */ + const GRAVITY_AXIS_PULL_AFTER: number; + + /** + * Raw bit controlling how the left/top edge is placed. + */ + const GRAVITY_AXIS_PULL_BEFORE: number; + + /** + * Raw bit indicating the gravity for an axis has been specified. + */ + const GRAVITY_AXIS_SPECIFIED: number; + + /** + * Bits defining the horizontal axis. + */ + const GRAVITY_AXIS_X_SHIFT: number; + + /** + * Bits defining the vertical axis. + */ + const GRAVITY_AXIS_Y_SHIFT: number; + + /** + * Push object to the bottom of its container, not changing its size. + */ + const GRAVITY_BOTTOM: number; + + /** + * Place the object in the center of its container in both the vertical and horizontal axis, not changing its size. + */ + const GRAVITY_CENTER: number; + + /** + * Place object in the horizontal center of its container, not changing its size. + */ + const GRAVITY_CENTER_HORIZONTAL: number; + + /** + * Place object in the vertical center of its container, not changing its size. + */ + const GRAVITY_CENTER_VERTICAL: number; + + /** + * Flag to clip the edges of the object to its container along the horizontal axis. + */ + const GRAVITY_CLIP_HORIZONTAL: number; + + /** + * Flag to clip the edges of the object to its container along the vertical axis. + */ + const GRAVITY_CLIP_VERTICAL: number; + + /** + * Special constant to enable clipping to an overall display along the horizontal dimension. + */ + const GRAVITY_DISPLAY_CLIP_HORIZONTAL: number; + + /** + * Special constant to enable clipping to an overall display along the vertical dimension. + */ + const GRAVITY_DISPLAY_CLIP_VERTICAL: number; + + /** + * Push object to x-axis position at the end of its container, not changing its size. + */ + const GRAVITY_END: number; + + /** + * Grow the horizontal and vertical size of the object if needed so it completely fills its container. + */ + const GRAVITY_FILL: number; + + /** + * Grow the horizontal size of the object if needed so it completely fills its container. + */ + const GRAVITY_FILL_HORIZONTAL: number; + + /** + * Grow the vertical size of the object if needed so it completely fills its container. + */ + const GRAVITY_FILL_VERTICAL: number; + + /** + * Binary mask to get the absolute horizontal gravity of a gravity. + */ + const GRAVITY_HORIZONTAL_GRAVITY_MASK: number; + + /** + * Push object to the left of its container, not changing its size. + */ + const GRAVITY_LEFT: number; + + /** + * Constant indicating that no gravity has been set + */ + const GRAVITY_NO_GRAVITY: number; + + /** + * Binary mask for the horizontal gravity and script specific direction bit. + */ + const GRAVITY_RELATIVE_HORIZONTAL_GRAVITY_MASK: number; + + /** + * Raw bit controlling whether the layout direction is relative or not (GRAVITY_START/GRAVITY_END instead of absolute GRAVITY_LEFT/GRAVITY_RIGHT). + */ + const GRAVITY_RELATIVE_LAYOUT_DIRECTION: number; + + /** + * Push object to the right of its container, not changing its size. + */ + const GRAVITY_RIGHT: number; + + /** + * Push object to x-axis position at the start of its container, not changing its size. + */ + const GRAVITY_START: number; + + /** + * Push object to the top of its container, not changing its size. + */ + const GRAVITY_TOP: number; + + /** + * Binary mask to get the vertical gravity of a gravity. + */ + const GRAVITY_VERTICAL_GRAVITY_MASK: number; + + /** + * Converts all detectable types of data into clickable links. + */ + const LINKIFY_ALL: number; + + /** + * Converts strings formatted as email addresses into clickable links. + */ + const LINKIFY_EMAIL_ADDRESSES: number; + + /** + * Converts strings formatted as addresses into clickable links. + */ + const LINKIFY_MAP_ADDRESSES: number; + + /** + * Converts strings formatted as phone numbers into clickable links. + */ + const LINKIFY_PHONE_NUMBERS: number; + + /** + * Converts strings formatted as URLs into clickable links. + */ + const LINKIFY_WEB_URLS: number; + + /** + * Always allow a user to over-scroll this view, provided it is a view that can scroll. + */ + const OVER_SCROLL_ALWAYS: number; + + /** + * Allow a user to over-scroll this view only if the content is large enough to meaningfully scroll, provided it is a view that can scroll. + */ + const OVER_SCROLL_IF_CONTENT_SCROLLS: number; + + /** + * Never allow a user to over-scroll this view. + */ + const OVER_SCROLL_NEVER: number; + + /** + * Android A_8 pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_A_8: number; + + /** + * Android LA_88 pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_LA_88: number; + + /** + * Android L_8 pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_L_8: number; + + /** + * Android OPAQUE pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_OPAQUE: number; + + /** + * Android RGBA_4444 pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_RGBA_4444: number; + + /** + * Android RGBA_5551 pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_RGBA_5551: number; + + /** + * Android RGBA_8888 pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_RGBA_8888: number; + + /** + * Android RGBX_8888 pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_RGBX_8888: number; + + /** + * Android RGB_332 pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_RGB_332: number; + + /** + * Android RGB_565 pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_RGB_565: number; + + /** + * Android RGB_888 pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_RGB_888: number; + + /** + * Android TRANSLUCENT pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_TRANSLUCENT: number; + + /** + * Android A_8 pixel format for . Selecting the correct pixel format can + * improve image clarity and performance. + */ + const PIXEL_FORMAT_TRANSPARENT: number; + + /** + * Android UNKNOWN pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_UNKNOWN: number; + + /** + * Display as a modal dialog. (default) + */ + const PROGRESS_INDICATOR_DIALOG: number; + + /** + * Display as a horizontal progress bar in the title of + * the window. + */ + const PROGRESS_INDICATOR_STATUS_BAR: number; + + /** + * Used with the property to indicate an ongoing + * activity of indeterminate length. (default) + */ + const PROGRESS_INDICATOR_INDETERMINANT: number; + + /** + * Used with the property to indicate an ongoing + * activity of determinate length. + */ + const PROGRESS_INDICATOR_DETERMINANT: number; + + /** + * Pan the current heavyweight window when the input method (ie software keyboard) is shown, to + * ensure that its contents are not obscured. + */ + const SOFT_INPUT_ADJUST_PAN: number; + + /** + * Resize the current heavyweight window when the input method (ie software keyboard) is shown, + * to ensure that its contents are not obscured. + */ + const SOFT_INPUT_ADJUST_RESIZE: number; + + /** + * Use the system-default behavior to determine how the soft input area (ie software keyboard) + * is accomodated by the current heavyweight window when it receives focus (default.) + */ + const SOFT_INPUT_ADJUST_UNSPECIFIED: number; + + /** + * Always hide the soft input area (ie software keyboard) when the current heavyweight window + * receives focus. + */ + const SOFT_INPUT_STATE_ALWAYS_HIDDEN: number; + + /** + * Always show the soft input area (ie software keyboard) when the current heavyweight window + * receives focus. + */ + const SOFT_INPUT_STATE_ALWAYS_VISIBLE: number; + + /** + * Attempt to hide the soft input area (ie software keyboard) when the current heavyweight + * window receives focus. + */ + const SOFT_INPUT_STATE_HIDDEN: number; + + /** + * Use the system-default behavior to determine whether to show the soft input area + * (ie software keyboard) when the current heavyweight window receives focus. + */ + const SOFT_INPUT_STATE_UNSPECIFIED: number; + + /** + * Attempt to show the soft input area (ie software keyboard) when the current heavyweight + * window receives focus. + */ + const SOFT_INPUT_STATE_VISIBLE: number; + + /** + * Use Android default behavior to handle keyboard visibility when a view receives focus. + * (default) + */ + const SOFT_KEYBOARD_DEFAULT_ON_FOCUS: number; + + /** + * Attempt to hide the soft keyboard when a view receives focus. Note: system can override + * request. + */ + const SOFT_KEYBOARD_HIDE_ON_FOCUS: number; + + /** + * Attempt to show the soft keyboard when a view receives focus. Note: system can override + * request. + */ + const SOFT_KEYBOARD_SHOW_ON_FOCUS: number; + + /** + * Display a checkbox. + */ + const SWITCH_STYLE_CHECKBOX: number; + + /** + * Display a toggle button. + */ + const SWITCH_STYLE_TOGGLEBUTTON: number; + + /** + * Display a switch. + */ + const SWITCH_STYLE_SWITCH: number; + + /** + * Use with [WebView.pluginState](Titanium.UI.WebView.pluginState) to disable plugins in a web view. + */ + const WEBVIEW_PLUGINS_OFF: number; + + /** + * Use with [WebView.pluginState](Titanium.UI.WebView.pluginState) to enable plugins in a web view. + */ + const WEBVIEW_PLUGINS_ON: number; + + /** + * Display a placeholder and only load plugins when user selects it. + */ + const WEBVIEW_PLUGINS_ON_DEMAND: number; + + /** + * Use with [WebView.cacheMode](Titanium.UI.WebView.cacheMode) to override how the cache is used in a web view. + */ + const WEBVIEW_LOAD_DEFAULT: number; + + /** + * Use with [WebView.cacheMode](Titanium.UI.WebView.cacheMode) to override how the cache is used in a web view. + */ + const WEBVIEW_LOAD_NO_CACHE: number; + + /** + * Use with [WebView.cacheMode](Titanium.UI.WebView.cacheMode) to override how the cache is used in a web view. + */ + const WEBVIEW_LOAD_CACHE_ONLY: number; + + /** + * Use with [WebView.cacheMode](Titanium.UI.WebView.cacheMode) to override how the cache is used in a web view. + */ + const WEBVIEW_LOAD_CACHE_ELSE_NETWORK: number; + + /** + * Moves views in or out from the edges of the scene. + */ + const TRANSITION_EXPLODE: number; + + /** + * Fades in the views. + */ + const TRANSITION_FADE_IN: number; + + /** + * Fades out the views. + */ + const TRANSITION_FADE_OUT: number; + + /** + * Moves views to top. + */ + const TRANSITION_SLIDE_TOP: number; + + /** + * Moves views to right. + */ + const TRANSITION_SLIDE_RIGHT: number; + + /** + * Moves views to bottom. + */ + const TRANSITION_SLIDE_BOTTOM: number; + + /** + * Moves views to left. + */ + const TRANSITION_SLIDE_LEFT: number; + + /** + * Captures layout bounds of target views before and after the scene change and animates those changes during the transition. + */ + const TRANSITION_CHANGE_BOUNDS: number; + + /** + * Captures the clip bounds before and after the scene change and animates those changes during the transition. + */ + const TRANSITION_CHANGE_CLIP_BOUNDS: number; + + /** + * Captures scale and rotation for Views before and after the scene change and animates those changes during the transition. + */ + const TRANSITION_CHANGE_TRANSFORM: number; + + /** + * Captures an ImageView's matrix before and after the scene change and animates it during the transition. + */ + const TRANSITION_CHANGE_IMAGE_TRANSFORM: number; + + /** + * Resets transition to platform default. + */ + const TRANSITION_NONE: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Hides the soft keyboard. + */ + function hideSoftKeyboard(): void; + + /** + * Opens an application preferences dialog, using the native Android system settings interface, + * defined by the platform-specific `preferences.xml` and `array.xml` files. + */ + function openPreferences(): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Creates and returns an instance of . + */ + function createCardView(parameters?: any): Titanium.UI.Android.CardView; + + /** + * Creates and returns an instance of . + */ + function createDrawerLayout(parameters?: any): Titanium.UI.Android.DrawerLayout; + + /** + * Creates and returns an instance of . + */ + function createProgressIndicator(parameters?: any): Titanium.UI.Android.ProgressIndicator; + + /** + * Creates and returns an instance of . + */ + function createSearchView(parameters?: any): Titanium.UI.Android.SearchView; + + /** + * An elevated view with rounded corners. + */ + interface CardView extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Background color for CardView as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * Disabled background color of the view, as a color name or hex triplet. + */ + backgroundDisabledColor: string; + + /** + * Disabled background image for the view, specified as a local file path or URL. + */ + backgroundDisabledImage: string; + + /** + * Focused background color of the view, as a color name or hex triplet. + */ + backgroundFocusedColor: string; + + /** + * Focused background image for the view, specified as a local file path or URL. + */ + backgroundFocusedImage: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Selected background color of the view, as a color name or hex triplet. + */ + backgroundSelectedColor: string; + + /** + * Selected background image url for the view, specified as a local file path or URL. + */ + backgroundSelectedImage: string; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Corner radius for CardView. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * Elevation for CardView. + */ + elevation: number; + + /** + * Whether view should be focusable while navigating with the trackball. + */ + focusable: boolean; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * Sets the behavior when hiding an object to release or keep the free space + */ + hiddenBehavior: number; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * When on, animate call overrides current animation if applicable. + */ + overrideCurrentAnimation: boolean; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * Clockwise 2D rotation of the view in degrees. + */ + rotation: number; + + /** + * Clockwise rotation of the view in degrees (x-axis). + */ + rotationX: number; + + /** + * Clockwise rotation of the view in degrees (y-axis). + */ + rotationY: number; + + /** + * Scaling of the view in x-axis in pixels. + */ + scaleX: number; + + /** + * Scaling of the view in y-axis in pixels. + */ + scaleY: number; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * Determines keyboard behavior when this view is focused. + */ + softKeyboardOnFocus: number; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * A material design visual construct that provides an instantaneous visual confirmation of touch point. + */ + touchFeedback: boolean; + + /** + * Optional touch feedback ripple color. This has no effect unless `touchFeedback` is true. + */ + touchFeedbackColor: string; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Horizontal location of the view relative to its left position in pixels. + */ + translationX: number; + + /** + * Vertical location of the view relative to its top position in pixels. + */ + translationY: number; + + /** + * Depth of the view relative to its elevation in pixels. + */ + translationZ: number; + + /** + * A name to identify this view in activity transition. + */ + transitionName: string; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Determines whether to keep the device screen on. + */ + keepScreenOn: boolean; + + /** + * Background color for CardView as a color name or hex triplet. + */ + cardBackgroundColor: string; + + /** + * Corner radius for CardView. + */ + cardCornerRadius: number; + + /** + * Elevation for CardView. + */ + cardElevation: number; + + /** + * Maximum Elevation for CardView. + */ + cardMaxElevation: number; + + /** + * Maximum Elevation for CardView. + */ + maxElevation: number; + + /** + * Add padding to CardView on API level 20 and before to prevent intersections between + * the Card content and rounded corners. + */ + cardPreventCornerOverlap: boolean; + + /** + * Add padding to CardView on API level 20 and before to prevent intersections between + * the Card content and rounded corners. + */ + preventCornerOverlap: boolean; + + /** + * Add padding on API level 21 and above to have the same measurements with previous versions. + */ + cardUseCompatPadding: boolean; + + /** + * Add padding on API level 21 and above to have the same measurements with previous versions. + */ + useCompatPadding: boolean; + + /** + * Inner padding between the edges of the Card and children of the CardView. + */ + contentPadding: number; + + /** + * Inner padding between the edges of the Card and children of the CardView. + */ + padding: number; + + /** + * Inner padding between the bottom edge of the Card and children of the CardView. + */ + contentPaddingBottom: number; + + /** + * Inner padding between the bottom edge of the Card and children of the CardView. + */ + paddingBottom: number; + + /** + * Inner padding between the left edge of the Card and children of the CardView. + */ + contentPaddingLeft: number; + + /** + * Inner padding between the left edge of the Card and children of the CardView. + */ + paddingLeft: number; + + /** + * Inner padding between the right edge of the Card and children of the CardView. + */ + contentPaddingRight: number; + + /** + * Inner padding between the right edge of the Card and children of the CardView. + */ + paddingRight: number; + + /** + * Inner padding between the top edge of the Card and children of the CardView. + */ + contentPaddingTop: number; + + /** + * Inner padding between the top edge of the Card and children of the CardView. + */ + paddingTop: number; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledColor(backgroundDisabledColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledImage(backgroundDisabledImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedColor(backgroundFocusedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedImage(backgroundFocusedImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedColor(backgroundSelectedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedImage(backgroundSelectedImage: string): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getElevation(): number; + + /** + * Sets the value of the property. + */ + setElevation(elevation: number): void; + + /** + * Gets the value of the property. + */ + getFocusable(): boolean; + + /** + * Sets the value of the property. + */ + setFocusable(focusable: boolean): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getHiddenBehavior(): number; + + /** + * Sets the value of the property. + */ + setHiddenBehavior(hiddenBehavior: number): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getOverrideCurrentAnimation(): boolean; + + /** + * Sets the value of the property. + */ + setOverrideCurrentAnimation(overrideCurrentAnimation: boolean): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getRotation(): number; + + /** + * Sets the value of the property. + */ + setRotation(rotation: number): void; + + /** + * Gets the value of the property. + */ + getRotationX(): number; + + /** + * Sets the value of the property. + */ + setRotationX(rotationX: number): void; + + /** + * Gets the value of the property. + */ + getRotationY(): number; + + /** + * Sets the value of the property. + */ + setRotationY(rotationY: number): void; + + /** + * Gets the value of the property. + */ + getScaleX(): number; + + /** + * Sets the value of the property. + */ + setScaleX(scaleX: number): void; + + /** + * Gets the value of the property. + */ + getScaleY(): number; + + /** + * Sets the value of the property. + */ + setScaleY(scaleY: number): void; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getSoftKeyboardOnFocus(): number; + + /** + * Sets the value of the property. + */ + setSoftKeyboardOnFocus(softKeyboardOnFocus: number): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedback(): boolean; + + /** + * Sets the value of the property. + */ + setTouchFeedback(touchFeedback: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedbackColor(): string; + + /** + * Sets the value of the property. + */ + setTouchFeedbackColor(touchFeedbackColor: string): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getTranslationX(): number; + + /** + * Sets the value of the property. + */ + setTranslationX(translationX: number): void; + + /** + * Gets the value of the property. + */ + getTranslationY(): number; + + /** + * Sets the value of the property. + */ + setTranslationY(translationY: number): void; + + /** + * Gets the value of the property. + */ + getTranslationZ(): number; + + /** + * Sets the value of the property. + */ + setTranslationZ(translationZ: number): void; + + /** + * Gets the value of the property. + */ + getTransitionName(): string; + + /** + * Sets the value of the property. + */ + setTransitionName(transitionName: string): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getKeepScreenOn(): boolean; + + /** + * Sets the value of the property. + */ + setKeepScreenOn(keepScreenOn: boolean): void; + + /** + * Gets the value of the property. + */ + getCardBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setCardBackgroundColor(cardBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getCardCornerRadius(): number; + + /** + * Sets the value of the property. + */ + setCardCornerRadius(cardCornerRadius: number): void; + + /** + * Gets the value of the property. + */ + getCardElevation(): number; + + /** + * Sets the value of the property. + */ + setCardElevation(cardElevation: number): void; + + /** + * Gets the value of the property. + */ + getCardMaxElevation(): number; + + /** + * Sets the value of the property. + */ + setCardMaxElevation(cardMaxElevation: number): void; + + /** + * Gets the value of the property. + */ + getMaxElevation(): number; + + /** + * Sets the value of the property. + */ + setMaxElevation(maxElevation: number): void; + + /** + * Gets the value of the property. + */ + getCardPreventCornerOverlap(): boolean; + + /** + * Sets the value of the property. + */ + setCardPreventCornerOverlap(cardPreventCornerOverlap: boolean): void; + + /** + * Gets the value of the property. + */ + getPreventCornerOverlap(): boolean; + + /** + * Sets the value of the property. + */ + setPreventCornerOverlap(preventCornerOverlap: boolean): void; + + /** + * Gets the value of the property. + */ + getCardUseCompatPadding(): boolean; + + /** + * Sets the value of the property. + */ + setCardUseCompatPadding(cardUseCompatPadding: boolean): void; + + /** + * Gets the value of the property. + */ + getUseCompatPadding(): boolean; + + /** + * Sets the value of the property. + */ + setUseCompatPadding(useCompatPadding: boolean): void; + + /** + * Gets the value of the property. + */ + getContentPadding(): number; + + /** + * Sets the value of the property. + */ + setContentPadding(contentPadding: number): void; + + /** + * Gets the value of the property. + */ + getPadding(): number; + + /** + * Sets the value of the property. + */ + setPadding(padding: number): void; + + /** + * Gets the value of the property. + */ + getContentPaddingBottom(): number; + + /** + * Sets the value of the property. + */ + setContentPaddingBottom(contentPaddingBottom: number): void; + + /** + * Gets the value of the property. + */ + getPaddingBottom(): number; + + /** + * Sets the value of the property. + */ + setPaddingBottom(paddingBottom: number): void; + + /** + * Gets the value of the property. + */ + getContentPaddingLeft(): number; + + /** + * Sets the value of the property. + */ + setContentPaddingLeft(contentPaddingLeft: number): void; + + /** + * Gets the value of the property. + */ + getPaddingLeft(): number; + + /** + * Sets the value of the property. + */ + setPaddingLeft(paddingLeft: number): void; + + /** + * Gets the value of the property. + */ + getContentPaddingRight(): number; + + /** + * Sets the value of the property. + */ + setContentPaddingRight(contentPaddingRight: number): void; + + /** + * Gets the value of the property. + */ + getPaddingRight(): number; + + /** + * Sets the value of the property. + */ + setPaddingRight(paddingRight: number): void; + + /** + * Gets the value of the property. + */ + getContentPaddingTop(): number; + + /** + * Sets the value of the property. + */ + setContentPaddingTop(contentPaddingTop: number): void; + + /** + * Gets the value of the property. + */ + getPaddingTop(): number; + + /** + * Sets the value of the property. + */ + setPaddingTop(paddingTop: number): void; + } - export interface LocationRule extends Ti.Proxy { - accuracy : number; - maxAge : number; - minAge : number; - name : string; - getAccuracy () : number; - getMaxAge () : number; - getMinAge () : number; - getName () : string; - setAccuracy (accuracy: number) : void; - setMaxAge (maxAge: number) : void; - setMinAge (minAge: number) : void; - setName (name: string) : void; + + /** + * A panel that displays the app's main navigation options on the left edge of the screen. + */ + interface DrawerLayout extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * Disabled background color of the view, as a color name or hex triplet. + */ + backgroundDisabledColor: string; + + /** + * Disabled background image for the view, specified as a local file path or URL. + */ + backgroundDisabledImage: string; + + /** + * Focused background color of the view, as a color name or hex triplet. + */ + backgroundFocusedColor: string; + + /** + * Focused background image for the view, specified as a local file path or URL. + */ + backgroundFocusedImage: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Selected background color of the view, as a color name or hex triplet. + */ + backgroundSelectedColor: string; + + /** + * Selected background image url for the view, specified as a local file path or URL. + */ + backgroundSelectedImage: string; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * Base elevation of the view relative to its parent in pixels. + */ + elevation: number; + + /** + * Whether view should be focusable while navigating with the trackball. + */ + focusable: boolean; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * Sets the behavior when hiding an object to release or keep the free space + */ + hiddenBehavior: number; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * When on, animate call overrides current animation if applicable. + */ + overrideCurrentAnimation: boolean; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * Clockwise 2D rotation of the view in degrees. + */ + rotation: number; + + /** + * Clockwise rotation of the view in degrees (x-axis). + */ + rotationX: number; + + /** + * Clockwise rotation of the view in degrees (y-axis). + */ + rotationY: number; + + /** + * Scaling of the view in x-axis in pixels. + */ + scaleX: number; + + /** + * Scaling of the view in y-axis in pixels. + */ + scaleY: number; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * Determines keyboard behavior when this view is focused. + */ + softKeyboardOnFocus: number; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * A material design visual construct that provides an instantaneous visual confirmation of touch point. + */ + touchFeedback: boolean; + + /** + * Optional touch feedback ripple color. This has no effect unless `touchFeedback` is true. + */ + touchFeedbackColor: string; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Horizontal location of the view relative to its left position in pixels. + */ + translationX: number; + + /** + * Vertical location of the view relative to its top position in pixels. + */ + translationY: number; + + /** + * Depth of the view relative to its elevation in pixels. + */ + translationZ: number; + + /** + * A name to identify this view in activity transition. + */ + transitionName: string; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Determines whether to keep the device screen on. + */ + keepScreenOn: boolean; + + /** + * Use with [DrawerLayout.drawerLockMode](Titanium.UI.Android.DrawerLayout.drawerLockMode) to specify the drawer is locked closed. + */ + readonly LOCK_MODE_LOCKED_CLOSED: number; + + /** + * Use with [DrawerLayout.drawerLockMode](Titanium.UI.Android.DrawerLayout.drawerLockMode) to specify the drawer is locked opened. + */ + readonly LOCK_MODE_LOCKED_OPEN: number; + + /** + * Use with [DrawerLayout.drawerLockMode](Titanium.UI.Android.DrawerLayout.drawerLockMode) to specify the drawer is reset to default lock state. + */ + readonly LOCK_MODE_UNDEFINED: number; + + /** + * Use with [DrawerLayout.drawerLockMode](Titanium.UI.Android.DrawerLayout.drawerLockMode) to specify the drawer is unlocked. + */ + readonly LOCK_MODE_UNLOCKED: number; + + /** + * Determine whether the left drawer is open + */ + isLeftOpen: boolean; + + /** + * Determine whether the right drawer is open + */ + isRightOpen: boolean; + + /** + * Determine whether the left drawer is visible + */ + isLeftVisible: boolean; + + /** + * Determine whether the right drawer is visible + */ + isRightVisible: boolean; + + /** + * Get or set the width of the left drawer + */ + leftWidth: number; + + /** + * Get or set the width of the right drawer + */ + rightWidth: number; + + /** + * Get or set the view of the left drawer + */ + leftView: Titanium.UI.View; + + /** + * Get or set the view of the right drawer + */ + rightView: Titanium.UI.View; + + /** + * Get or set the center view + */ + centerView: Titanium.UI.View; + + /** + * Determine the drawer indicator status + */ + drawerIndicatorEnabled: boolean; + + /** + * Get or set the drawerLockMode + */ + drawerLockMode: number; + + /** + * Determine whether to enable the toolbar. + */ + toolbarEnabled: boolean; + + /** + * A Toolbar instance to use as a toolbar. + */ + toolbar: Titanium.UI.Toolbar; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Toggle the visibility of the left view. + */ + toggleLeft(): void; + + /** + * Open the left view. + */ + openLeft(): void; + + /** + * Close the left view. + */ + closeLeft(): void; + + /** + * Toggle the visibility of the right view. + */ + toggleRight(): void; + + /** + * Open the right view. + */ + openRight(): void; + + /** + * Close the right view. + */ + closeRight(): void; + + /** + * Disallow touch events on a specific view. + */ + interceptTouchEvent(view: any, disallowIntercept: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledColor(backgroundDisabledColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledImage(backgroundDisabledImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedColor(backgroundFocusedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedImage(backgroundFocusedImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedColor(backgroundSelectedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedImage(backgroundSelectedImage: string): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getElevation(): number; + + /** + * Sets the value of the property. + */ + setElevation(elevation: number): void; + + /** + * Gets the value of the property. + */ + getFocusable(): boolean; + + /** + * Sets the value of the property. + */ + setFocusable(focusable: boolean): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getHiddenBehavior(): number; + + /** + * Sets the value of the property. + */ + setHiddenBehavior(hiddenBehavior: number): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getOverrideCurrentAnimation(): boolean; + + /** + * Sets the value of the property. + */ + setOverrideCurrentAnimation(overrideCurrentAnimation: boolean): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getRotation(): number; + + /** + * Sets the value of the property. + */ + setRotation(rotation: number): void; + + /** + * Gets the value of the property. + */ + getRotationX(): number; + + /** + * Sets the value of the property. + */ + setRotationX(rotationX: number): void; + + /** + * Gets the value of the property. + */ + getRotationY(): number; + + /** + * Sets the value of the property. + */ + setRotationY(rotationY: number): void; + + /** + * Gets the value of the property. + */ + getScaleX(): number; + + /** + * Sets the value of the property. + */ + setScaleX(scaleX: number): void; + + /** + * Gets the value of the property. + */ + getScaleY(): number; + + /** + * Sets the value of the property. + */ + setScaleY(scaleY: number): void; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getSoftKeyboardOnFocus(): number; + + /** + * Sets the value of the property. + */ + setSoftKeyboardOnFocus(softKeyboardOnFocus: number): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedback(): boolean; + + /** + * Sets the value of the property. + */ + setTouchFeedback(touchFeedback: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedbackColor(): string; + + /** + * Sets the value of the property. + */ + setTouchFeedbackColor(touchFeedbackColor: string): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getTranslationX(): number; + + /** + * Sets the value of the property. + */ + setTranslationX(translationX: number): void; + + /** + * Gets the value of the property. + */ + getTranslationY(): number; + + /** + * Sets the value of the property. + */ + setTranslationY(translationY: number): void; + + /** + * Gets the value of the property. + */ + getTranslationZ(): number; + + /** + * Sets the value of the property. + */ + setTranslationZ(translationZ: number): void; + + /** + * Gets the value of the property. + */ + getTransitionName(): string; + + /** + * Sets the value of the property. + */ + setTransitionName(transitionName: string): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getKeepScreenOn(): boolean; + + /** + * Sets the value of the property. + */ + setKeepScreenOn(keepScreenOn: boolean): void; + + /** + * Gets the value of the property. + */ + getIsLeftOpen(): boolean; + + /** + * Sets the value of the property. + */ + setIsLeftOpen(isLeftOpen: boolean): void; + + /** + * Gets the value of the property. + */ + getIsRightOpen(): boolean; + + /** + * Sets the value of the property. + */ + setIsRightOpen(isRightOpen: boolean): void; + + /** + * Gets the value of the property. + */ + getIsLeftVisible(): boolean; + + /** + * Sets the value of the property. + */ + setIsLeftVisible(isLeftVisible: boolean): void; + + /** + * Gets the value of the property. + */ + getIsRightVisible(): boolean; + + /** + * Sets the value of the property. + */ + setIsRightVisible(isRightVisible: boolean): void; + + /** + * Gets the value of the property. + */ + getLeftWidth(): number; + + /** + * Sets the value of the property. + */ + setLeftWidth(leftWidth: number): void; + + /** + * Gets the value of the property. + */ + getRightWidth(): number; + + /** + * Sets the value of the property. + */ + setRightWidth(rightWidth: number): void; + + /** + * Gets the value of the property. + */ + getLeftView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setLeftView(leftView: any): void; + + /** + * Gets the value of the property. + */ + getRightView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setRightView(rightView: any): void; + + /** + * Gets the value of the property. + */ + getCenterView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setCenterView(centerView: any): void; + + /** + * Gets the value of the property. + */ + getDrawerIndicatorEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setDrawerIndicatorEnabled(drawerIndicatorEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getDrawerLockMode(): number; + + /** + * Sets the value of the property. + */ + setDrawerLockMode(drawerLockMode: number): void; + + /** + * Gets the value of the property. + */ + getToolbarEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setToolbarEnabled(toolbarEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getToolbar(): Titanium.UI.Toolbar; + + /** + * Sets the value of the property. + */ + setToolbar(toolbar: Titanium.UI.Toolbar): void; + } + + /** + * A progress dialog or a horizontal progress bar in the title of the window. + */ + interface ProgressIndicator extends Titanium.Proxy { + /** + * Base elevation of the view relative to its parent in pixels. + */ + elevation: number; + + /** + * Sets the behavior when hiding an object to release or keep the free space + */ + hiddenBehavior: number; + + /** + * Clockwise 2D rotation of the view in degrees. + */ + rotation: number; + + /** + * Clockwise rotation of the view in degrees (x-axis). + */ + rotationX: number; + + /** + * Clockwise rotation of the view in degrees (y-axis). + */ + rotationY: number; + + /** + * Scaling of the view in x-axis in pixels. + */ + scaleX: number; + + /** + * Scaling of the view in y-axis in pixels. + */ + scaleY: number; + + /** + * A material design visual construct that provides an instantaneous visual confirmation of touch point. + */ + touchFeedback: boolean; + + /** + * Optional touch feedback ripple color. This has no effect unless `touchFeedback` is true. + */ + touchFeedbackColor: string; + + /** + * Horizontal location of the view relative to its left position in pixels. + */ + translationX: number; + + /** + * Vertical location of the view relative to its top position in pixels. + */ + translationY: number; + + /** + * Depth of the view relative to its elevation in pixels. + */ + translationZ: number; + + /** + * A name to identify this view in activity transition. + */ + transitionName: string; + + /** + * When `true` allows the user to cancel the progress dialog by pressing the BACK button. + */ + cancelable: boolean; + + /** + * When `cancelable` is set to `true` and this is set to `true`, the dialog is canceled when touched outside the window's bounds. + */ + canceledOnTouchOutside: boolean; + + /** + * Message text. + */ + message: string; + + /** + * Key identifying a string in the locale file to use for the message text. + */ + messageid: string; + + /** + * Minimum value of the progress bar. + */ + min: number; + + /** + * Maximum value of the progress bar. + */ + max: number; + + /** + * Location for the progress indicator. + */ + location: number; + + /** + * Type for the progress indicator. + */ + type: number; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides the progress indicator and stops the animation. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Shows the progress indicator and starts the animation. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getElevation(): number; + + /** + * Sets the value of the property. + */ + setElevation(elevation: number): void; + + /** + * Gets the value of the property. + */ + getHiddenBehavior(): number; + + /** + * Sets the value of the property. + */ + setHiddenBehavior(hiddenBehavior: number): void; + + /** + * Gets the value of the property. + */ + getRotation(): number; + + /** + * Sets the value of the property. + */ + setRotation(rotation: number): void; + + /** + * Gets the value of the property. + */ + getRotationX(): number; + + /** + * Sets the value of the property. + */ + setRotationX(rotationX: number): void; + + /** + * Gets the value of the property. + */ + getRotationY(): number; + + /** + * Sets the value of the property. + */ + setRotationY(rotationY: number): void; + + /** + * Gets the value of the property. + */ + getScaleX(): number; + + /** + * Sets the value of the property. + */ + setScaleX(scaleX: number): void; + + /** + * Gets the value of the property. + */ + getScaleY(): number; + + /** + * Sets the value of the property. + */ + setScaleY(scaleY: number): void; + + /** + * Gets the value of the property. + */ + getTouchFeedback(): boolean; + + /** + * Sets the value of the property. + */ + setTouchFeedback(touchFeedback: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedbackColor(): string; + + /** + * Sets the value of the property. + */ + setTouchFeedbackColor(touchFeedbackColor: string): void; + + /** + * Gets the value of the property. + */ + getTranslationX(): number; + + /** + * Sets the value of the property. + */ + setTranslationX(translationX: number): void; + + /** + * Gets the value of the property. + */ + getTranslationY(): number; + + /** + * Sets the value of the property. + */ + setTranslationY(translationY: number): void; + + /** + * Gets the value of the property. + */ + getTranslationZ(): number; + + /** + * Sets the value of the property. + */ + setTranslationZ(translationZ: number): void; + + /** + * Gets the value of the property. + */ + getTransitionName(): string; + + /** + * Sets the value of the property. + */ + setTransitionName(transitionName: string): void; + + /** + * Gets the value of the property. + */ + getCancelable(): boolean; + + /** + * Sets the value of the property. + */ + setCancelable(cancelable: boolean): void; + + /** + * Gets the value of the property. + */ + getCanceledOnTouchOutside(): boolean; + + /** + * Sets the value of the property. + */ + setCanceledOnTouchOutside(canceledOnTouchOutside: boolean): void; + + /** + * Gets the value of the property. + */ + getMessage(): string; + + /** + * Sets the value of the property. + */ + setMessage(message: string): void; + + /** + * Gets the value of the property. + */ + getMessageid(): string; + + /** + * Sets the value of the property. + */ + setMessageid(messageid: string): void; + + /** + * Gets the value of the property. + */ + getMin(): number; + + /** + * Sets the value of the property. + */ + setMin(min: number): void; + + /** + * Gets the value of the property. + */ + getMax(): number; + + /** + * Sets the value of the property. + */ + setMax(max: number): void; + + /** + * Gets the value of the property. + */ + getLocation(): number; + + /** + * Sets the value of the property. + */ + setLocation(location: number): void; + + /** + * Gets the value of the property. + */ + getType(): number; + + /** + * Sets the value of the property. + */ + setType(type: number): void; + + } + + /** + * A specialized text field for entering search text. + */ + interface SearchView extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * Disabled background color of the view, as a color name or hex triplet. + */ + backgroundDisabledColor: string; + + /** + * Disabled background image for the view, specified as a local file path or URL. + */ + backgroundDisabledImage: string; + + /** + * Focused background color of the view, as a color name or hex triplet. + */ + backgroundFocusedColor: string; + + /** + * Focused background image for the view, specified as a local file path or URL. + */ + backgroundFocusedImage: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Selected background color of the view, as a color name or hex triplet. + */ + backgroundSelectedColor: string; + + /** + * Selected background image url for the view, specified as a local file path or URL. + */ + backgroundSelectedImage: string; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * Base elevation of the view relative to its parent in pixels. + */ + elevation: number; + + /** + * Whether view should be focusable while navigating with the trackball. + */ + focusable: boolean; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * Sets the behavior when hiding an object to release or keep the free space + */ + hiddenBehavior: number; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * When on, animate call overrides current animation if applicable. + */ + overrideCurrentAnimation: boolean; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * Clockwise 2D rotation of the view in degrees. + */ + rotation: number; + + /** + * Clockwise rotation of the view in degrees (x-axis). + */ + rotationX: number; + + /** + * Clockwise rotation of the view in degrees (y-axis). + */ + rotationY: number; + + /** + * Scaling of the view in x-axis in pixels. + */ + scaleX: number; + + /** + * Scaling of the view in y-axis in pixels. + */ + scaleY: number; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * Determines keyboard behavior when this view is focused. + */ + softKeyboardOnFocus: number; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * A material design visual construct that provides an instantaneous visual confirmation of touch point. + */ + touchFeedback: boolean; + + /** + * Optional touch feedback ripple color. This has no effect unless `touchFeedback` is true. + */ + touchFeedbackColor: string; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Horizontal location of the view relative to its left position in pixels. + */ + translationX: number; + + /** + * Vertical location of the view relative to its top position in pixels. + */ + translationY: number; + + /** + * Depth of the view relative to its elevation in pixels. + */ + translationZ: number; + + /** + * A name to identify this view in activity transition. + */ + transitionName: string; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Determines whether to keep the device screen on. + */ + keepScreenOn: boolean; + + /** + * Color of the text in this SearchView, as a color name or hex triplet. + */ + color: string; + + /** + * Text to show when the search view field is not focused. + */ + hintText: string; + + /** + * Value of the search view. + */ + value: string; + + /** + * Iconifies or expands the search view + */ + iconified: boolean; + + /** + * Sets the default or resting state of the search view + */ + iconifiedByDefault: boolean; + + /** + * Whether to display the submit button when necessary or never display. + */ + submitEnabled: boolean; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Causes the search view to lose focus. + */ + blur(): void; + + /** + * Causes the search view to gain focus. + */ + focus(): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledColor(backgroundDisabledColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledImage(backgroundDisabledImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedColor(backgroundFocusedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedImage(backgroundFocusedImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedColor(backgroundSelectedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedImage(backgroundSelectedImage: string): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getElevation(): number; + + /** + * Sets the value of the property. + */ + setElevation(elevation: number): void; + + /** + * Gets the value of the property. + */ + getFocusable(): boolean; + + /** + * Sets the value of the property. + */ + setFocusable(focusable: boolean): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getHiddenBehavior(): number; + + /** + * Sets the value of the property. + */ + setHiddenBehavior(hiddenBehavior: number): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getOverrideCurrentAnimation(): boolean; + + /** + * Sets the value of the property. + */ + setOverrideCurrentAnimation(overrideCurrentAnimation: boolean): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getRotation(): number; + + /** + * Sets the value of the property. + */ + setRotation(rotation: number): void; + + /** + * Gets the value of the property. + */ + getRotationX(): number; + + /** + * Sets the value of the property. + */ + setRotationX(rotationX: number): void; + + /** + * Gets the value of the property. + */ + getRotationY(): number; + + /** + * Sets the value of the property. + */ + setRotationY(rotationY: number): void; + + /** + * Gets the value of the property. + */ + getScaleX(): number; + + /** + * Sets the value of the property. + */ + setScaleX(scaleX: number): void; + + /** + * Gets the value of the property. + */ + getScaleY(): number; + + /** + * Sets the value of the property. + */ + setScaleY(scaleY: number): void; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getSoftKeyboardOnFocus(): number; + + /** + * Sets the value of the property. + */ + setSoftKeyboardOnFocus(softKeyboardOnFocus: number): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedback(): boolean; + + /** + * Sets the value of the property. + */ + setTouchFeedback(touchFeedback: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedbackColor(): string; + + /** + * Sets the value of the property. + */ + setTouchFeedbackColor(touchFeedbackColor: string): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getTranslationX(): number; + + /** + * Sets the value of the property. + */ + setTranslationX(translationX: number): void; + + /** + * Gets the value of the property. + */ + getTranslationY(): number; + + /** + * Sets the value of the property. + */ + setTranslationY(translationY: number): void; + + /** + * Gets the value of the property. + */ + getTranslationZ(): number; + + /** + * Sets the value of the property. + */ + setTranslationZ(translationZ: number): void; + + /** + * Gets the value of the property. + */ + getTransitionName(): string; + + /** + * Sets the value of the property. + */ + setTransitionName(transitionName: string): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getKeepScreenOn(): boolean; + + /** + * Sets the value of the property. + */ + setKeepScreenOn(keepScreenOn: boolean): void; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getHintText(): string; + + /** + * Sets the value of the property. + */ + setHintText(hintText: string): void; + + /** + * Gets the value of the property. + */ + getValue(): string; + + /** + * Sets the value of the property. + */ + setValue(value: string): void; + + /** + * Gets the value of the property. + */ + getIconified(): boolean; + + /** + * Sets the value of the property. + */ + setIconified(iconified: boolean): void; + + /** + * Gets the value of the property. + */ + getIconifiedByDefault(): boolean; + + /** + * Sets the value of the property. + */ + setIconifiedByDefault(iconifiedByDefault: boolean): void; + + /** + * Gets the value of the property. + */ + getSubmitEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setSubmitEnabled(submitEnabled: boolean): void; + + } + } - export interface MobileWeb { - forwardGeocoderTimeout : number; - locationTimeout : number; - maximumHeadingAge : number; - maximumLocationAge : number; - reverseGeocoderTimeout : number; - getForwardGeocoderTimeout () : number; - getLocationTimeout () : number; - getMaximumHeadingAge () : number; - getMaximumLocationAge () : number; - getReverseGeocoderTimeout () : number; - setForwardGeocoderTimeout (forwardGeocoderTimeout: number) : void; - setLocationTimeout (locationTimeout: number) : void; - setMaximumHeadingAge (maximumHeadingAge: number) : void; - setMaximumLocationAge (maximumLocationAge: number) : void; - setReverseGeocoderTimeout (reverseGeocoderTimeout: number) : void; + + /** + * A module used for accessing clipboard data. + */ + namespace Clipboard { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Create a new named clipboard. + */ + let name: string; + + /** + * Create a new clipboard identified by a unique system-generated name. + */ + let unique: boolean; + + /** + * Create a clipboard identified by name if it doesn't exist. + */ + let allowCreation: boolean; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Deletes data of the specified MIME type stored in the clipboard. If MIME type omitted, all + * data is deleted. + */ + function clearData(type?: string): void; + + /** + * Deletes all text data stored in the clipboard. + */ + function clearText(): void; + + /** + * Gets data of the specified MIME type stored in the clipboard. + */ + function getData(type: string): string | Titanium.Blob; + + /** + * Gets text data stored in the clipboard. + */ + function getText(): string; + + /** + * Indicates whether any data of the specified MIME type is stored in the clipboard. + */ + function hasData(type: string): boolean; + + /** + * Indicates whether any text data is stored in the clipboard. + */ + function hasText(): boolean; + + /** + * Indicates whether any URLs are stored in the clipboard. + */ + function hasURLs(): boolean; + + /** + * Indicates whether any images are stored in the clipboard. + */ + function hasImages(): boolean; + + /** + * Indicates whether any colors are stored in the clipboard. + */ + function hasColors(): boolean; + + /** + * Stores data of the specified MIME type in the clipboard. + */ + function setData(type: string, data: any): void; + + /** + * Stores text data in the clipboard. + */ + function setText(text: string): void; + + /** + * Adds an array of items to a clipboard, and sets privacy options for all included items. + */ + function setItems(items: ClipboardItemsType): void; + + /** + * Gets the items that have been specified earlier using . + */ + function getItems(): any[]; + + /** + * Removes the clipboard. + */ + function remove(): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getName(): string; + + /** + * Sets the value of the property. + */ + function setName(name: string): void; + + /** + * Gets the value of the property. + */ + function getUnique(): boolean; + + /** + * Sets the value of the property. + */ + function setUnique(unique: boolean): void; + + /** + * Gets the value of the property. + */ + function getAllowCreation(): boolean; + + /** + * Sets the value of the property. + */ + function setAllowCreation(allowCreation: boolean): void; + } - } - export interface Proxy { - apiName : string; - bubbleParent : boolean; - addEventListener (name: string, callback: (...args : any[]) => any) : void; - applyProperties (props: Dictionary) : void; - fireEvent (name: string, event: Dictionary) : void; - getApiName () : string; - getBubbleParent () : boolean; - removeEventListener (name: string, callback: (...args : any[]) => any) : void; - setBubbleParent (bubbleParent: boolean) : void; - } - export module Map { - export var ANNOTATION_DRAG_STATE_CANCEL : number; - export var ANNOTATION_DRAG_STATE_DRAG : number; - export var ANNOTATION_DRAG_STATE_END : number; - export var ANNOTATION_DRAG_STATE_NONE : number; - export var ANNOTATION_DRAG_STATE_START : number; - export var ANNOTATION_GREEN : number; - export var ANNOTATION_PURPLE : number; - export var ANNOTATION_RED : number; - export var HYBRID_TYPE : number; - export var SATELLITE_TYPE : number; - export var STANDARD_TYPE : number; - export var TERRAIN_TYPE : number; - export var apiName : string; - export var bubbleParent : boolean; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createAnnotation (parameters?: Dictionary) : Ti.Map.Annotation; - export function createView (parameters?: Dictionary) : Ti.Map.View; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface View extends Ti.UI.View { - animated : boolean; - annotations : Array; - hideAnnotationWhenTouchMap : boolean; - latitudeDelta : number; - longitudeDelta : number; - mapType : number; - region : MapRegionType; - regionFit : boolean; - userLocation : boolean; - addAnnotation (annotation: Dictionary) : void; - addAnnotation (annotation: Ti.Map.Annotation) : void; - addAnnotations (annotations: Array) : void; - addAnnotations (annotations: Array>) : void; - addRoute (route: MapRouteType) : void; - deselectAnnotation (annotation: string) : void; - deselectAnnotation (annotation: Ti.Map.Annotation) : void; - getAnimate () : boolean; - getAnimated () : boolean; - getAnnotations () : Array; - getHideAnnotationWhenTouchMap () : boolean; - getLatitudeDelta () : number; - getLongitudeDelta () : number; - getMapType () : number; - getRegion () : MapRegionType; - getRegionFit () : boolean; - getUserLocation () : boolean; - removeAllAnnotations () : void; - removeAnnotation (annotation: string) : void; - removeAnnotation (annotation: Ti.Map.Annotation) : void; - removeAnnotations (annotations: Array) : void; - removeAnnotations (annotations: Array) : void; - removeRoute (route: MapRouteType) : void; - selectAnnotation (annotation: string) : void; - selectAnnotation (annotation: Ti.Map.Annotation) : void; - setAnimate (animate: boolean) : void; - setAnimated (animated: boolean) : void; - setAnnotations (annotations: Array) : void; - setHideAnnotationWhenTouchMap (hideAnnotationWhenTouchMap: boolean) : void; - setLocation (location: MapLocationType) : void; - setMapType (mapType: number) : void; - setRegion (region: MapRegionType) : void; - setRegionFit (regionFit: boolean) : void; - setUserLocation (userLocation: boolean) : void; - zoom (level: number) : void; - } - export interface Annotation extends Ti.Proxy { - animate : boolean; - canShowCallout : boolean; - centerOffset : Point; - customView : Ti.UI.View; - draggable : boolean; - image : any; - latitude : number; - leftButton : any; - leftView : Ti.UI.View; - longitude : number; - pinImage : string; - pincolor : number; - rightButton : any; - rightView : Ti.UI.View; - subtitle : string; - subtitleid : string; - title : string; - titleid : string; - getAnimate () : boolean; - getCanShowCallout () : boolean; - getCenterOffset () : Point; - getCustomView () : Ti.UI.View; - getDraggable () : boolean; - getImage () : any; - getLatitude () : number; - getLeftButton () : any; - getLeftView () : Ti.UI.View; - getLongitude () : number; - getPinImage () : string; - getPincolor () : number; - getRightButton () : any; - getRightView () : Ti.UI.View; - getSubtitle () : string; - getSubtitleid () : string; - getTitle () : string; - getTitleid () : string; - setAnimate (animate: boolean) : void; - setCanShowCallout (canShowCallout: boolean) : void; - setCenterOffset (centerOffset: Point) : void; - setCustomView (customView: Ti.UI.View) : void; - setDraggable (draggable: boolean) : void; - setImage (image: string) : void; - setImage (image: Ti.Blob) : void; - setLatitude (latitude: number) : void; - setLeftButton (leftButton: number) : void; - setLeftButton (leftButton: string) : void; - setLeftView (leftView: Ti.UI.View) : void; - setLongitude (longitude: number) : void; - setPinImage (pinImage: string) : void; - setPincolor (pincolor: number) : void; - setRightButton (rightButton: number) : void; - setRightButton (rightButton: string) : void; - setRightView (rightView: Ti.UI.View) : void; - setSubtitle (subtitle: string) : void; - setSubtitleid (subtitleid: string) : void; - setTitle (title: string) : void; - setTitleid (titleid: string) : void; - } - } - export module Cloud { - export var accessToken : string; - export var apiName : string; - export var bubbleParent : boolean; - export var debug : boolean; - export var expiresIn : number; - export var ondatastream : (...args : any[]) => any; - export var onsendstream : (...args : any[]) => any; - export var sessionId : string; - export var useSecure : boolean; - export function applyProperties (props: Dictionary) : void; - export function getAccessToken () : string; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function getDebug () : boolean; - export function getExpiresIn () : number; - export function getOndatastream () : (...args : any[]) => any; - export function getOnsendstream () : (...args : any[]) => any; - export function getSessionId () : string; - export function getUseSecure () : boolean; - export function hasStoredSession () : boolean; - export function retrieveStoredSession () : string; - export function sendRequest (parameters: Dictionary, callback: (...args : any[]) => any) : void; - export function setAccessToken (accessToken: string) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setDebug (debug: boolean) : void; - export function setOndatastream (ondatastream: (...args : any[]) => any) : void; - export function setOnsendstream (onsendstream: (...args : any[]) => any) : void; - export function setSessionId (sessionId: string) : void; - export function setUseSecure (useSecure: boolean) : void; - export interface Objects { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - show (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface SocialIntegrations { - externalAccountLink (parameters: Dictionary, callback: (...args : any[]) => any) : void; - externalAccountLogin (parameters: Dictionary, callback: (...args : any[]) => any) : void; - externalAccountUnlink (parameters: Dictionary, callback: (...args : any[]) => any) : void; - searchFacebookFriends (callback: (...args : any[]) => any) : void; - } - export interface PushNotifications { - notify (parameters: Dictionary, callback: (...args : any[]) => any) : void; - notifyTokens (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters: Dictionary, callback: (...args : any[]) => any) : void; - queryChannels (parameters: Dictionary, callback: (...args : any[]) => any) : void; - resetBadge (parameters: Dictionary, callback: (...args : any[]) => any) : void; - setBadge (parameters: Dictionary, callback: (...args : any[]) => any) : void; - showChannels (parameters: Dictionary, callback: (...args : any[]) => any) : void; - subscribe (parameters: Dictionary, callback: (...args : any[]) => any) : void; - subscribeToken (parameters: Dictionary, callback: (...args : any[]) => any) : void; - unsubscribe (parameters: Dictionary, callback: (...args : any[]) => any) : void; - unsubscribeToken (parameters: Dictionary, callback: (...args : any[]) => any) : void; - updateSubscription (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Clients { - geolocate (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - } - export interface ACLs { - addUser (parameters: Dictionary, callback: (...args : any[]) => any) : void; - checkUser (parameters: Dictionary, callback: (...args : any[]) => any) : void; - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - removeUser (parameters: Dictionary, callback: (...args : any[]) => any) : void; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - update (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - } - export interface Users { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - login (parameters: Dictionary, callback: (...args : any[]) => any) : void; - logout (callback: (...args : any[]) => any) : void; - query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - requestResetPassword (parameters: Dictionary, callback: (...args : any[]) => any) : void; - resendConfirmation (parameters: Dictionary, callback: (...args : any[]) => any) : void; - search (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - secureCreate (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - secureLogin (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - secureStatus () : boolean; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - showMe (callback: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Messages { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - removeThread (parameters: Dictionary, callback: (...args : any[]) => any) : void; - reply (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - showInbox (parameters: Dictionary, callback: (...args : any[]) => any) : void; - showSent (parameters: Dictionary, callback: (...args : any[]) => any) : void; - showThread (parameters: Dictionary, callback: (...args : any[]) => any) : void; - showThreads (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Events { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - queryOccurrences (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - search (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - searchOccurrences (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - show (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - showOccurrences (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Reviews { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters: Dictionary, callback: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Chats { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - getChatGroups (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - query (parameters: Dictionary, callback: (...args : any[]) => any) : void; - queryChatGroups (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface KeyValues { - append (parameters: Dictionary, callback: (...args : any[]) => any) : void; - get (parameters: Dictionary, callback: (...args : any[]) => any) : void; - increment (parameters: Dictionary, callback: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - set (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface GeoFences { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Checkins { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Friends { - add (parameters: Dictionary, callback: (...args : any[]) => any) : void; - approve (parameters: Dictionary, callback: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - requests (parameters: Dictionary, callback: (...args : any[]) => any) : void; - search (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Files { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface PushSchedules { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters: Dictionary, callback: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Likes { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Photos { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - search (parameters: Dictionary, callback: (...args : any[]) => any) : void; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Statuses { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - delete (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - search (parameters: Dictionary, callback: (...args : any[]) => any) : void; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface PhotoCollections { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - search (parameters: Dictionary, callback: (...args : any[]) => any) : void; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - showPhotos (parameters: Dictionary, callback: (...args : any[]) => any) : void; - showSubCollections (parameters: Dictionary, callback: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Posts { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Emails { - send (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Places { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - search (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - } - export interface Blob extends Ti.Proxy { - file : Ti.Filesystem.File; - height : number; - length : number; - mimeType : string; - nativePath : string; - size : number; - text : string; - width : number; - append (blob: Ti.Blob) : void; - getFile () : Ti.Filesystem.File; - getHeight () : number; - getLength () : number; - getMimeType () : string; - getNativePath () : string; - getSize () : number; - getText () : string; - getWidth () : number; - imageAsCropped (options: Dictionary) : Ti.Blob; - imageAsResized (width: number, height: number) : Ti.Blob; - imageAsThumbnail (size: number, borderSize?: number, cornerRadius?: number) : Ti.Blob; - imageWithAlpha () : Ti.Blob; - imageWithRoundedCorner (cornerSize: number, borderSize?: number) : Ti.Blob; - imageWithTransparentBorder (size: number) : Ti.Blob; - toString () : string; - } - export interface Codec { - BIG_ENDIAN : number; - CHARSET_ASCII : string; - CHARSET_ISO_LATIN_1 : string; - CHARSET_UTF16 : string; - CHARSET_UTF16BE : string; - CHARSET_UTF16LE : string; - CHARSET_UTF8 : string; - LITTLE_ENDIAN : number; - TYPE_BYTE : string; - TYPE_DOUBLE : string; - TYPE_FLOAT : string; - TYPE_INT : string; - TYPE_LONG : string; - TYPE_SHORT : string; - decodeNumber (options: DecodeNumberDict) : number; - decodeString (options: DecodeStringDict) : string; - encodeNumber (options: EncodeNumberDict) : number; - encodeString (options: Dictionary) : number; - getNativeByteOrder () : number; - } - export interface Locale { - currentCountry : string; - currentLanguage : string; - currentLocale : string; - formatTelephoneNumber (number: string) : string; - getCurrencyCode (locale: string) : string; - getCurrencySymbol (currencyCode: string) : string; - getCurrentCountry () : string; - getCurrentLanguage () : string; - getCurrentLocale () : string; - getLocaleCurrencySymbol (locale: string) : string; - getString (key: string, hint?: string) : string; - } - export module App { - export var EVENT_ACCESSIBILITY_ANNOUNCEMENT : string; - export var EVENT_ACCESSIBILITY_CHANGED : string; - export var accessibilityEnabled : boolean; - export var analytics : boolean; - export var apiName : string; - export var bubbleParent : boolean; - export var copyright : string; - export var deployType : string; - export var description : string; - export var disableNetworkActivityIndicator : boolean; - export var forceSplashAsSnapshot : boolean; - export var guid : string; - export var id : string; - export var idleTimerDisabled : boolean; - export var installId : string; - export var keyboardVisible : boolean; - export var name : string; - export var proximityDetection : boolean; - export var proximityState : boolean; - export var publisher : string; - export var sessionId : string; - export var url : string; - export var version : string; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function fireEvent (name: string, event: Dictionary) : void; - export function fireSystemEvent (eventName: string, param?: any) : void; - export function getAccessibilityEnabled () : boolean; - export function getAnalytics () : boolean; - export function getApiName () : string; - export function getArguments () : launchOptions; - export function getBubbleParent () : boolean; - export function getCopyright () : string; - export function getDeployType () : string; - export function getDescription () : string; - export function getDisableNetworkActivityIndicator () : boolean; - export function getForceSplashAsSnapshot () : boolean; - export function getGuid () : string; - export function getId () : string; - export function getIdleTimerDisabled () : boolean; - export function getInstallId () : string; - export function getKeyboardVisible () : boolean; - export function getName () : string; - export function getProximityDetection () : boolean; - export function getProximityState () : boolean; - export function getPublisher () : string; - export function getSessionId () : string; - export function getUrl () : string; - export function getVersion () : string; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setDisableNetworkActivityIndicator (disableNetworkActivityIndicator: boolean) : void; - export function setForceSplashAsSnapshot (forceSplashAsSnapshot: boolean) : void; - export function setIdleTimerDisabled (idleTimerDisabled: boolean) : void; - export function setProximityDetection (proximityDetection: boolean) : void; - export module Android { - export var R : Ti.App.Android.R; - export var apiName : string; - export var appVersionCode : number; - export var appVersionName : string; - export var bubbleParent : boolean; - export var launchIntent : Ti.Android.Intent; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getAppVersionCode () : number; - export function getAppVersionName () : string; - export function getBubbleParent () : boolean; - export function getLaunchIntent () : Ti.Android.Intent; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface R { + + /** + * Apple iOS specific UI capabilities. All properties, methods and events in this namespace will + * only work on Apple iOS devices. + */ + namespace iOS { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Automatically use the large out-of-line title based on the state of the p + * revious item in the navigation bar. + */ + const LARGE_TITLE_DISPLAY_MODE_AUTOMATIC: number; + + /** + * Always use a larger title when this item is top most. + */ + const LARGE_TITLE_DISPLAY_MODE_ALWAYS: number; + + /** + * Never use a larger title when this item is top most. + */ + const LARGE_TITLE_DISPLAY_MODE_NEVER: number; + + /** + * Include treatments so this image can be shown directly over the content + * of the Live Photo. + */ + const LIVEPHOTO_BADGE_OPTIONS_OVER_CONTENT: number; + + /** + * To indicate that the Live Photo aspect is turned off and it will + * be treated as a still (e.g. for sharing). + */ + const LIVEPHOTO_BADGE_OPTIONS_LIVE_OFF: number; + + /** + * Use with [Animation.curve](Titanium.UI.Animation.curve) to specify an animation that starts + * slowly and speeds up. + */ + const ANIMATION_CURVE_EASE_IN: number; + + /** + * Use with [Animation.curve](Titanium.UI.Animation.curve) to specify an animation that starts + * slowly, and speeds up, then slows down at the end of the animation. + */ + const ANIMATION_CURVE_EASE_IN_OUT: number; + + /** + * Use with [Animation.curve](Titanium.UI.Animation.curve) to specify an animation that starts + * quickly, then slows down at the end of the animation. + */ + const ANIMATION_CURVE_EASE_OUT: number; + + /** + * Use with [Animation.curve](Titanium.UI.Animation.curve) to specify an animation that proceeds + * at a constant rate. + */ + const ANIMATION_CURVE_LINEAR: number; + + /** + * Use with to specify a font. + */ + const ATTRIBUTE_FONT: number; + + /** + * Use with to specify a font color. + */ + const ATTRIBUTE_FOREGROUND_COLOR: number; + + /** + * Use with to specify a background color. + */ + const ATTRIBUTE_BACKGROUND_COLOR: number; + + /** + * Use with to enable or disable ligatures. + */ + const ATTRIBUTE_LIGATURE: number; + + /** + * Use with to use a letterpress text effect. + */ + const ATTRIBUTE_LETTERPRESS_STYLE: number; + + /** + * Use with to specify kerning (space between characters). + */ + const ATTRIBUTE_KERN: number; + + /** + * Use with to place a horizontal line through the text. + */ + const ATTRIBUTE_STRIKETHROUGH_STYLE: number; + + /** + * Use with to place a horizontal line under the text. + */ + const ATTRIBUTE_UNDERLINES_STYLE: number; + + /** + * Use with to specify a color for the stroke text. + */ + const ATTRIBUTE_STROKE_COLOR: number; + + /** + * Use with to specify the width of the stroke text. + */ + const ATTRIBUTE_STROKE_WIDTH: number; + + /** + * Use with to display a shadow behind the text. + */ + const ATTRIBUTE_SHADOW: number; + + /** + * Use with to control the direction of the text. + */ + const ATTRIBUTE_WRITING_DIRECTION: number; + + /** + * Use with to apply a text effect. + */ + const ATTRIBUTE_TEXT_EFFECT: number; + + /** + * Use with to create a link. + */ + const ATTRIBUTE_LINK: number; + + /** + * Use with to apply a different baseline to the text. + */ + const ATTRIBUTE_BASELINE_OFFSET: number; + + /** + * Use with to change the color of the horizontal line. + */ + const ATTRIBUTE_UNDERLINE_COLOR: number; + + /** + * Use with to change the color of the horizontal line. + */ + const ATTRIBUTE_STRIKETHROUGH_COLOR: number; + + /** + * Use with to skew the text. + */ + const ATTRIBUTE_OBLIQUENESS: number; + + /** + * Use with to stretch the text horizontally. + */ + const ATTRIBUTE_EXPANSION: number; + + /** + * Use with to not draw a line. + */ + const ATTRIBUTE_UNDERLINE_STYLE_NONE: number; + + /** + * Use with to draw a single line. + */ + const ATTRIBUTE_UNDERLINE_STYLE_SINGLE: number; + + /** + * Use with to draw a thick line. + */ + const ATTRIBUTE_UNDERLINE_STYLE_THICK: number; + + /** + * Use with to draw a double line. + */ + const ATTRIBUTE_UNDERLINE_STYLE_DOUBLE: number; + + /** + * Use with to draw a solid line. + */ + const ATTRIBUTE_UNDERLINE_PATTERN_SOLID: number; + + /** + * Use with to draw a dotted line. + */ + const ATTRIBUTE_UNDERLINE_PATTERN_DOT: number; + + /** + * Use with to draw a dashed line. + */ + const ATTRIBUTE_UNDERLINE_PATTERN_DASH: number; + + /** + * Use with to draw an alternating line of dashes and dots. + */ + const ATTRIBUTE_UNDERLINE_PATTERN_DASH_DOT: number; + + /** + * Use with to draw an alternating line of dashes and two dots. + */ + const ATTRIBUTE_UNDERLINE_PATTERN_DASH_DOT_DOT: number; + + /** + * Use with to draw a line only underneath or through words. + */ + const ATTRIBUTE_UNDERLINE_BY_WORD: number; + + /** + * Use with to use the embedded text direction. + */ + const ATTRIBUTE_WRITING_DIRECTION_EMBEDDING: number; + + /** + * Use with to override the text direction. + */ + const ATTRIBUTE_WRITING_DIRECTION_OVERRIDE: number; + + /** + * Use with to use the + * [Unicode Bidirection Algorithm rules P2 and P3](http://www.unicode.org/reports/tr9/#The_Paragraph_Level) + * to determine which direction to use. + */ + const ATTRIBUTE_WRITING_DIRECTION_NATURAL: number; + + /** + * Use with to write text left to right. + */ + const ATTRIBUTE_WRITING_DIRECTION_LEFT_TO_RIGHT: number; + + /** + * Use with to write text right to left. + */ + const ATTRIBUTE_WRITING_DIRECTION_RIGHT_TO_LEFT: number; + + /** + * Converts strings formatted as addresses into clickable links. + */ + const AUTODETECT_ADDRESS: number; + + /** + * Converts all detectable types of data into clickable links. + */ + const AUTODETECT_ALL: number; + + /** + * Converts strings formatted as calendar events into clickable links. + */ + const AUTODETECT_CALENDAR: number; + + /** + * Converts strings formatted as URLs into clickable links. + */ + const AUTODETECT_LINK: number; + + /** + * Disables converting strings into clickable links. + */ + const AUTODETECT_NONE: number; + + /** + * Converts strings formatted as phone numbers into clickable links. + */ + const AUTODETECT_PHONE: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_CLEAR: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_COLOR: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_COLOR_BURN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_COLOR_DODGE: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_COPY: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DARKEN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DESTINATION_ATOP: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DESTINATION_IN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DESTINATION_OUT: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DESTINATION_OVER: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DIFFERENCE: number; + + /** + * Image mode constant. Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_EXCLUSION: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_HARD_LIGHT: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_HUE: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_LIGHTEN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_LUMINOSITY: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_MULTIPLY: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_NORMAL: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_OVERLAY: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_PLUS_DARKER: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_PLUS_LIGHTER: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SATURATION: number; + + /** + * Image mode constant. Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SCREEN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SOFT_LIGHT: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SOURCE_ATOP: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SOURCE_IN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SOURCE_OUT: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_XOR: number; + + /** + * Use with [BlurView.effect](Titanium.UI.iOS.BlurView.effect) to specify a blur effect. + */ + const BLUR_EFFECT_STYLE_EXTRA_LIGHT: number; + + /** + * Use with [BlurView.effect](Titanium.UI.iOS.BlurView.effect) to specify a blur effect. + */ + const BLUR_EFFECT_STYLE_LIGHT: number; + + /** + * Use with [BlurView.effect](Titanium.UI.iOS.BlurView.effect) to specify a blur effect. + */ + const BLUR_EFFECT_STYLE_DARK: number; + + /** + * Use with [BlurView.effect](Titanium.UI.iOS.BlurView.effect) to specify a blur effect. + */ + const BLUR_EFFECT_STYLE_REGULAR: number; + + /** + * Use with [BlurView.effect](Titanium.UI.iOS.BlurView.effect) to specify a blur effect. + */ + const BLUR_EFFECT_STYLE_PROMINENT: number; + + /** + * Use with [AdView.adSize](Titanium.UI.iOS.AdView.adSize) to specify a banner ad size + * appropriate for portrait orientations. + */ + const AD_SIZE_PORTRAIT: string; + + /** + * Use with [AdView.adSize](Titanium.UI.iOS.AdView.adSize) to specify a banner ad size + * appropriate for landscape orientations. + */ + const AD_SIZE_LANDSCAPE: string; + + /** + * Use with to specify clipping behavior. + */ + const CLIP_MODE_DEFAULT: number; + + /** + * Use with to specify clipping behavior. + */ + const CLIP_MODE_DISABLED: number; + + /** + * Use with to specify clipping behavior. + */ + const CLIP_MODE_ENABLED: number; + + /** + * Use with to specify collisions with both items and + * boundaries. + */ + const COLLISION_MODE_ALL: number; + + /** + * Use with to specify collisions with + * boundaries only. + */ + const COLLISION_MODE_BOUNDARY: number; + + /** + * Use with to specify collisions with items only. + */ + const COLLISION_MODE_ITEM: number; + + /** + * Returns the iOS system texture used to render the background on a group table view. + */ + const COLOR_GROUP_TABLEVIEW_BACKGROUND: string; + + /** + * Returns the iOS system texture used to render the area behind scrollable content. + */ + const COLOR_SCROLLVIEW_BACKGROUND: string; + + /** + * Returns the iOS system texture used for the back side of a view while it is being flipped. + */ + const COLOR_VIEW_FLIPSIDE_BACKGROUND: string; + + /** + * Returns the iOS system texture used to render the background of a page. + */ + const COLOR_UNDER_PAGE_BACKGROUND: string; + + /** + * Determines if the 3D-Touch capability "Force Touch" is supported (`true`) or not (`false`) by the device. + */ + const forceTouchSupported: boolean; + + /** + * The feedback type to be used when specifying a selection in . + */ + const FEEDBACK_GENERATOR_TYPE_SELECTION: number; + + /** + * The feedback type to be used when specifying an impact in . + */ + const FEEDBACK_GENERATOR_TYPE_IMPACT: number; + + /** + * The feedback type to be used when specifying a received notification in . + */ + const FEEDBACK_GENERATOR_TYPE_NOTIFICATION: number; + + /** + * The success notification type used as the argument in . + */ + const FEEDBACK_GENERATOR_NOTIFICATION_TYPE_SUCCESS: number; + + /** + * The warning notification type used as the argument in . + */ + const FEEDBACK_GENERATOR_NOTIFICATION_TYPE_WARNING: number; + + /** + * The error notification type used as the argument in . + */ + const FEEDBACK_GENERATOR_NOTIFICATION_TYPE_ERROR: number; + + /** + * The light impact style used as the `style` argument when creating a with the + * type . + */ + const FEEDBACK_GENERATOR_IMPACT_STYLE_LIGHT: number; + + /** + * The medium impact style used as the `style` argument when creating a with the + * type . + */ + const FEEDBACK_GENERATOR_IMPACT_STYLE_MEDIUM: number; + + /** + * The heavy impact style used as the `style` argument when creating a with the + * type . + */ + const FEEDBACK_GENERATOR_IMPACT_STYLE_HEAVY: number; + + /** + * Plays back the entire motion and sound content of the Live Photo, including transition + * effects at the start and end. + */ + const LIVEPHOTO_PLAYBACK_STYLE_FULL: number; + + /** + * Plays back only a brief section of the motion content of the Live Photo, without sound. + */ + const LIVEPHOTO_PLAYBACK_STYLE_HINT: number; + + /** + * An arrow that points upward. + */ + const MENU_POPUP_ARROW_DIRECTION_UP: number; + + /** + * An arrow that points downward. + */ + const MENU_POPUP_ARROW_DIRECTION_DOWN: number; + + /** + * An arrow that points toward the left. + */ + const MENU_POPUP_ARROW_DIRECTION_LEFT: number; + + /** + * An arrow that points toward the right. + */ + const MENU_POPUP_ARROW_DIRECTION_RIGHT: number; + + /** + * An arrow that is automatically aligned. + */ + const MENU_POPUP_ARROW_DIRECTION_DEFAULT: number; + + /** + * View presented with the same style as its parent window. + */ + let MODAL_PRESENTATION_CURRENT_CONTEXT: number; + + /** + * Window width and height are smaller than those of the screen and the view is centered on + * the screen. + */ + const MODAL_PRESENTATION_FORMSHEET: number; + + /** + * Window covers the screen. + */ + const MODAL_PRESENTATION_FULLSCREEN: number; + + /** + * Window height is the height of the screen and width is equal to screen width in a portrait + * orientation. + */ + const MODAL_PRESENTATION_PAGESHEET: number; + + /** + * When the window is presented, its view slides up from the bottom of the screen. On dismissal, + * the view slides back down (default.) + */ + const MODAL_TRANSITION_STYLE_COVER_VERTICAL: number; + + /** + * When the window is presented, the current view fades out while the new view fades in at the + * same time. On dismissal, a similar type of cross-fade is used to return to the original view. + */ + const MODAL_TRANSITION_STYLE_CROSS_DISSOLVE: number; + + /** + * When the window is presented, the current view initiates a horizontal 3D flip from + * right-to-left, resulting in the revealing of the new view as if it were on the back of the + * previous view. On dismissal, the flip occurs from left-to-right, returning to the original + * view. + */ + const MODAL_TRANSITION_STYLE_FLIP_HORIZONTAL: number; + + /** + * When the window is presented, one corner of the current view curls up to reveal the modal + * view underneath. On dismissal, the curled up page unfurls itself back on top of the modal + * view. + */ + const MODAL_TRANSITION_STYLE_PARTIAL_CURL: number; + + /** + * Use with to specifiy a continuous force. + */ + const PUSH_MODE_CONTINUOUS: number; + + /** + * Use with to specifiy an instantaneous force. + */ + const PUSH_MODE_INSTANTANEOUS: number; + + /** + * The normal style for preview actions. + */ + const PREVIEW_ACTION_STYLE_DEFAULT: number; + + /** + * The selected style for preview actions. + */ + const PREVIEW_ACTION_STYLE_SELECTED: number; + + /** + * The destructive style for preview actions. + */ + const PREVIEW_ACTION_STYLE_DESTRUCTIVE: number; + + /** + * The default style for . + */ + const ROW_ACTION_STYLE_DEFAULT: number; + + /** + * The destructive style for . + */ + const ROW_ACTION_STYLE_DESTRUCTIVE: number; + + /** + * The normal style for . + */ + const ROW_ACTION_STYLE_NORMAL: number; + + /** + * Use with to control deceleration rate. + */ + const SCROLL_DECELERATION_RATE_FAST: number; + + /** + * Use with to control deceleration rate. + */ + const SCROLL_DECELERATION_RATE_NORMAL: number; + + /** + * Use with to control keyboard dismiss mode. + */ + const KEYBOARD_DISMISS_MODE_NONE: number; + + /** + * Use with to control keyboard dismiss mode. + */ + const KEYBOARD_DISMISS_MODE_ON_DRAG: number; + + /** + * Use with to control keyboard dismiss mode. + */ + const KEYBOARD_DISMISS_MODE_INTERACTIVE: number; + + /** + * Use with to change the search bar style. + */ + const SEARCH_BAR_STYLE_PROMINENT: number; + + /** + * Use with to change the search bar style. + */ + const SEARCH_BAR_STYLE_MINIMAL: number; + + /** + * User tapped a link. + */ + const WEBVIEW_NAVIGATIONTYPE_LINK_CLICKED: number; + + /** + * User submitted a form. + */ + const WEBVIEW_NAVIGATIONTYPE_FORM_SUBMITTED: number; + + /** + * User tapped the back or forward button. + */ + const WEBVIEW_NAVIGATIONTYPE_BACK_FORWARD: number; + + /** + * User tapped the reload button. + */ + const WEBVIEW_NAVIGATIONTYPE_RELOAD: number; + + /** + * User resubmitted a form. + */ + const WEBVIEW_NAVIGATIONTYPE_FORM_RESUBMITTED: number; + + /** + * Some other action occurred. + */ + const WEBVIEW_NAVIGATIONTYPE_OTHER: number; + + /** + * String that represents the magnifying glass on the table view index bar + */ + const TABLEVIEW_INDEX_SEARCH: string; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_COMPOSE: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_PLAY: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_PAUSE: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_ADD: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_LOCATION: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_SEARCH: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_SHARE: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_PROHIBIT: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_CONTACT: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_HOME: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_MARK_LOCATION: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_FAVORITE: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_LOVE: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_CLOUD: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_INVITATION: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_CONFIRMATION: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_MAIL: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_MESSAGE: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_DATE: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_TIME: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_CAPTURE_PHOTO: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_CAPTURE_VIDEO: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_TASK: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_TASK_COMPLETED: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_ALARM: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_BOOKMARK: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_SHUFFLE: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_AUDIO: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_UPDATE: number; + + /** + * Value of the badge for the application's springboard icon. + */ + let appBadge: number; + + /** + * Determines whether the shake to edit system-wide capability is enabled. + */ + let appSupportsShakeToEdit: boolean; + + /** + * Sets the global status bar background color for the application. + */ + let statusBarBackgroundColor: string; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Creates a transition animation when opening or closing windows in a + * or . + */ + function createTransitionAnimation(transition: transitionAnimationParam): Titanium.Proxy; + + /** + * Creates a live photo badge to be used together with the + * API. + */ + function createLivePhotoBadge(type: number): Titanium.Blob; + + /** + * Creates and returns an instance of . + */ + function create3DMatrix(parameters?: any): Titanium.UI.iOS.Matrix3D; + + /** + * Creates and returns an instance of . + */ + function createAdView(parameters?: any): Titanium.UI.iOS.AdView; + + /** + * Creates and returns an instance of . + */ + function createAnchorAttachmentBehavior(parameters?: any): Titanium.UI.iOS.AnchorAttachmentBehavior; + + /** + * Creates and returns an instance of . + */ + function createAnimator(parameters?: any): Titanium.UI.iOS.Animator; + + /** + * Creates and returns an instance of . + */ + function createApplicationShortcuts(parameters?: any): Titanium.UI.iOS.ApplicationShortcuts; + + /** + * Creates and returns an instance of . + */ + function createAttribute(parameters?: any): Titanium.UI.iOS.Attribute; + + /** + * Creates and returns an instance of . + */ + function createAttributedString(parameters?: any): Titanium.UI.iOS.AttributedString; + + /** + * Creates and returns an instance of . + */ + function createBlurView(parameters?: any): Titanium.UI.iOS.BlurView; + + /** + * Creates and returns an instance of . + */ + function createCollisionBehavior(parameters?: any): Titanium.UI.iOS.CollisionBehavior; + + /** + * Creates and returns an instance of . + */ + function createCoverFlowView(parameters?: any): Titanium.UI.iOS.CoverFlowView; + + /** + * Creates and returns an instance of . + */ + function createDocumentViewer(parameters?: any): Titanium.UI.iOS.DocumentViewer; + + /** + * Creates and returns an instance of . + */ + function createDynamicItemBehavior(parameters?: any): Titanium.UI.iOS.DynamicItemBehavior; + + /** + * Creates and returns an instance of . + */ + function createFeedbackGenerator(parameters?: any): Titanium.UI.iOS.FeedbackGenerator; + + /** + * Creates and returns an instance of . + */ + function createGravityBehavior(parameters?: any): Titanium.UI.iOS.GravityBehavior; + + /** + * Creates and returns an instance of . + */ + function createLivePhotoView(parameters?: any): Titanium.UI.iOS.LivePhotoView; + + /** + * Creates and returns an instance of . + */ + function createMenuPopup(parameters?: any): Titanium.UI.iOS.MenuPopup; + + /** + * Creates and returns an instance of . + */ + function createNavigationWindow(parameters?: any): Titanium.UI.iOS.NavigationWindow; + + /** + * Creates and returns an instance of . + */ + function createPreviewAction(parameters?: any): Titanium.UI.iOS.PreviewAction; + + /** + * Creates and returns an instance of . + */ + function createPreviewActionGroup(parameters?: any): Titanium.UI.iOS.PreviewActionGroup; + + /** + * Creates and returns an instance of . + */ + function createPreviewContext(parameters?: any): Titanium.UI.iOS.PreviewContext; + + /** + * Creates and returns an instance of . + */ + function createPushBehavior(parameters?: any): Titanium.UI.iOS.PushBehavior; + + /** + * Creates and returns an instance of . + */ + function createSnapBehavior(parameters?: any): Titanium.UI.iOS.SnapBehavior; + + /** + * Creates and returns an instance of . + */ + function createSplitWindow(parameters?: any): Titanium.UI.iOS.SplitWindow; + + /** + * Creates and returns an instance of . + */ + function createStepper(parameters?: any): Titanium.UI.iOS.Stepper; + + /** + * Creates and returns an instance of . + */ + function createTabbedBar(parameters?: any): Titanium.UI.iOS.TabbedBar; + + /** + * Creates and returns an instance of . + */ + function createToolbar(parameters?: any): Titanium.UI.iOS.Toolbar; + + /** + * Creates and returns an instance of . + */ + function createViewAttachmentBehavior(parameters?: any): Titanium.UI.iOS.ViewAttachmentBehavior; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getForceTouchSupported(): boolean; + + /** + * Sets the value of the property. + */ + function setMODAL_PRESENTATION_CURRENT_CONTEXT(MODAL_PRESENTATION_CURRENT_CONTEXT: number): void; + + /** + * Gets the value of the property. + */ + function getAppBadge(): number; + + /** + * Sets the value of the property. + */ + function setAppBadge(appBadge: number): void; + + /** + * Gets the value of the property. + */ + function getAppSupportsShakeToEdit(): boolean; + + /** + * Sets the value of the property. + */ + function setAppSupportsShakeToEdit(appSupportsShakeToEdit: boolean): void; + + /** + * Gets the value of the property. + */ + function getStatusBarBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + function setStatusBarBackgroundColor(statusBarBackgroundColor: string): void; + + /** + * The 3D Matrix is an object for holding values for a 3D affine transform. + */ + interface Matrix3D extends Titanium.Proxy { + /** + * The entry at position [1,1] in the matrix. + */ + m11: number; + + /** + * The entry at position [1,2] in the matrix. + */ + m12: number; + + /** + * The entry at position [1,3] in the matrix. + */ + m13: number; + + /** + * The entry at position [1,4] in the matrix. + */ + m14: number; + + /** + * The entry at position [2,1] in the matrix. + */ + m21: number; + + /** + * The entry at position [2,2] in the matrix. + */ + m22: number; + + /** + * The entry at position [2,3] in the matrix. + */ + m23: number; + + /** + * The entry at position [2,4] in the matrix. + */ + m24: number; + + /** + * The entry at position [3,1] in the matrix. + */ + m31: number; + + /** + * The entry at position [3,2] in the matrix. + */ + m32: number; + + /** + * The entry at position [3,3] in the matrix. + */ + m33: number; + + /** + * The entry at position [3,4] in the matrix. + */ + m34: number; + + /** + * The entry at position [4,1] in the matrix. + */ + m41: number; + + /** + * The entry at position [4,2] in the matrix. + */ + m42: number; + + /** + * The entry at position [4,3] in the matrix. + */ + m43: number; + + /** + * The entry at position [4,4] in the matrix. + */ + m44: number; + + /** + * Returns a matrix constructed by inverting an existing matrix. + */ + invert(): Titanium.UI.Matrix3D; + + /** + * Returns a matrix constructed by combining two existing matrices. + */ + multiply(t2: Titanium.UI.Matrix3D): Titanium.UI.Matrix3D; + + /** + * Returns a matrix constructed by rotating an existing matrix. + */ + rotate(angle: number, x: number, y: number, z: number): Titanium.UI.Matrix3D; + + /** + * Returns a matrix constructed by scaling an existing matrix. + */ + scale(sx: number, sy: number, sz: number): Titanium.UI.Matrix3D; + + /** + * Returns a matrix constructed by translating an existing matrix. + */ + translate(tx: number, ty: number, tz: number): Titanium.UI.Matrix3D; + + /** + * Gets the value of the property. + */ + getM11(): number; + + /** + * Sets the value of the property. + */ + setM11(m11: number): void; + + /** + * Gets the value of the property. + */ + getM12(): number; + + /** + * Sets the value of the property. + */ + setM12(m12: number): void; + + /** + * Gets the value of the property. + */ + getM13(): number; + + /** + * Sets the value of the property. + */ + setM13(m13: number): void; + + /** + * Gets the value of the property. + */ + getM14(): number; + + /** + * Sets the value of the property. + */ + setM14(m14: number): void; + + /** + * Gets the value of the property. + */ + getM21(): number; + + /** + * Sets the value of the property. + */ + setM21(m21: number): void; + + /** + * Gets the value of the property. + */ + getM22(): number; + + /** + * Sets the value of the property. + */ + setM22(m22: number): void; + + /** + * Gets the value of the property. + */ + getM23(): number; + + /** + * Sets the value of the property. + */ + setM23(m23: number): void; + + /** + * Gets the value of the property. + */ + getM24(): number; + + /** + * Sets the value of the property. + */ + setM24(m24: number): void; + + /** + * Gets the value of the property. + */ + getM31(): number; + + /** + * Sets the value of the property. + */ + setM31(m31: number): void; + + /** + * Gets the value of the property. + */ + getM32(): number; + + /** + * Sets the value of the property. + */ + setM32(m32: number): void; + + /** + * Gets the value of the property. + */ + getM33(): number; + + /** + * Sets the value of the property. + */ + setM33(m33: number): void; + + /** + * Gets the value of the property. + */ + getM34(): number; + + /** + * Sets the value of the property. + */ + setM34(m34: number): void; + + /** + * Gets the value of the property. + */ + getM41(): number; + + /** + * Sets the value of the property. + */ + setM41(m41: number): void; + + /** + * Gets the value of the property. + */ + getM42(): number; + + /** + * Sets the value of the property. + */ + setM42(m42: number): void; + + /** + * Gets the value of the property. + */ + getM43(): number; + + /** + * Sets the value of the property. + */ + setM43(m43: number): void; + + /** + * Gets the value of the property. + */ + getM44(): number; + + /** + * Sets the value of the property. + */ + setM44(m44: number): void; + + } + + /** + * The AdView is a view for display Apple iAds. + */ + interface AdView extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Size of the advertisement when minimized. + */ + adSize: string; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Cancel a banner to uncover the user interface. + */ + cancelAction(): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getAdSize(): string; + + /** + * Sets the value of the property. + */ + setAdSize(adSize: string): void; + + } + + /** + * Dynamic behavior to support connections between an anchor point and an item. + */ + interface AnchorAttachmentBehavior extends Titanium.Proxy { + /** + * Anchor point for the attachment behavior relative to the animator's coordinate system. + */ + anchor: Point; + + /** + * Amount of damping to apply to the attachment behavior. + */ + damping: number; + + /** + * Distance, in points, between the two attachment points. + */ + distance: number; + + /** + * Frequency of oscillation for the behavior. + */ + frequency: number; + + /** + * Item to connect to use the attachment behavior. + */ + item: Titanium.UI.View; + + /** + * Offset from the center point of the item for the attachment. + */ + offset: Point; + + /** + * Gets the value of the property. + */ + getAnchor(): Point; + + /** + * Sets the value of the property. + */ + setAnchor(anchor: Point): void; + + /** + * Gets the value of the property. + */ + getDamping(): number; + + /** + * Sets the value of the property. + */ + setDamping(damping: number): void; + + /** + * Gets the value of the property. + */ + getDistance(): number; + + /** + * Sets the value of the property. + */ + setDistance(distance: number): void; + + /** + * Gets the value of the property. + */ + getFrequency(): number; + + /** + * Sets the value of the property. + */ + setFrequency(frequency: number): void; + + /** + * Gets the value of the property. + */ + getItem(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setItem(item: any): void; + + /** + * Gets the value of the property. + */ + getOffset(): Point; + + /** + * Sets the value of the property. + */ + setOffset(offset: Point): void; + + } + + /** + * Provides support for the built-in iOS dynamic animations + */ + interface Animator extends Titanium.Proxy { + /** + * Behaviors associated with this animator. + */ + behaviors: Titanium.Proxy[]; + + /** + * Titanium View object to initialize as the reference view for the animator. + */ + referenceView: Titanium.UI.View; + + /** + * Returns `true` if the animator is running else `false`. + */ + readonly running: boolean; + + /** + * Adds a dynamic behavior to the animator. + */ + addBehavior(behavior: Titanium.Proxy): void; + + /** + * Removes all behaviors from this animator. + */ + removeAllBehaviors(): void; + + /** + * Removes the specified behavior from the animator. + */ + removeBehavior(behavior: Titanium.Proxy): void; + + /** + * Starts the animation behaviors. + */ + startAnimator(): void; + + /** + * Stops the animation behaviors. + */ + stopAnimator(): void; + + /** + * Updates the animator's state information with the current state of the specified item. + */ + updateItemUsingCurrentState(item: any): void; + + /** + * Gets the value of the property. + */ + getBehaviors(): Titanium.Proxy[]; + + /** + * Sets the value of the property. + */ + setBehaviors(behaviors: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getReferenceView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setReferenceView(referenceView: any): void; + + /** + * Gets the value of the property. + */ + getRunning(): boolean; + + } + + /** + * The Home screen quick actions API is for adding shortcuts to your app icon that anticipate and accelerate a + * user's interaction with your app. + */ + interface ApplicationShortcuts extends Titanium.Proxy { + /** + * Returns an array of the application shortcuts created dynamically. + */ + listDynamicShortcuts(): ShortcutParams[]; + + /** + * Returns an array of the application shortcuts listed in your tiapp.xml file. + */ + listStaticShortcuts(): ShortcutParams[]; + + /** + * Removes all dynamically created application shortcuts. + */ + removeAllDynamicShortcuts(): void; + + /** + * Returns true or false depending if the provided shortcut object already exists. + */ + dynamicShortcutExists(itemtype: string): boolean; + + /** + * Creates a new dynamic application shortcut item. + */ + addDynamicShortcut(params: ShortcutParams): void; + + /** + * Removes the dynamic application shortcut item identified by the `itemtype`. + */ + removeDynamicShortcut(itemtype: string): void; + + /** + * Gets the dynamic application shortcut item identified by the `itemtype`. + */ + getDynamicShortcut(itemtype: string): void; + + } + + /** + * An abstract datatype for specifying an attributed string attribute. + */ + interface Attribute extends Titanium.Proxy { + /** + * Attribute to apply to the text. + */ + type: number; + + /** + * Attribute value. + */ + value: number; + + /** + * Attribute range. + */ + range: number[]; + + /** + * Gets the value of the property. + */ + getType(): number; + + /** + * Sets the value of the property. + */ + setType(type: number): void; + + /** + * Gets the value of the property. + */ + getValue(): number; + + /** + * Sets the value of the property. + */ + setValue(value: number): void; + + /** + * Gets the value of the property. + */ + getRange(): number[]; + + /** + * Sets the value of the property. + */ + setRange(range: ReadonlyArray): void; + + } + + /** + * An attributed string proxy manages character strings and associated sets of attributes (for example, + * font and kerning) that apply to individual characters or ranges of characters in the string. + */ + interface AttributedString extends Titanium.Proxy { + /** + * The text applied to the attributed string. + */ + text: string; + + /** + * An array of attributes to add. + */ + attributes: Attribute[]; + + /** + * Adds an [attribute](Attribute) with the given name and value to the characters in the specified range. + */ + addAttribute(attribute: Attribute): void; + + /** + * Gets the value of the property. + */ + getText(): string; + + /** + * Sets the value of the property. + */ + setText(text: string): void; + + /** + * Gets the value of the property. + */ + getAttributes(): Attribute[]; + + /** + * Sets the value of the property. + */ + setAttributes(attributes: ReadonlyArray): void; + + } + + /** + * A object gives you an easy way implement some complex visual effects. + * The blur effect is applied to every view the blur view is added to by default. You can also place the + * blur view above other views and all visible views layered under the blur view are blurred as well. + * For more information on BlurView, please refer to the official [Apple documentation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIVisualEffectView/). + * Note: Apple introduced two new constants and in + * iOS 10. These are internally mapped to and . + */ + interface BlurView extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * The effect you provide for the view. + */ + effect: number; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getEffect(): number; + + /** + * Sets the value of the property. + */ + setEffect(effect: number): void; + + } + + /** + * Dynamic behavior to support collisions between items and boundaries. + */ + interface CollisionBehavior extends Titanium.Proxy { + /** + * Boundary identfiers added to this behavior. + */ + readonly boundaryIdentifiers: BoundaryIdentifier[]; + + /** + * Specifies the collision behavior. + */ + collisionMode: number; + + /** + * Items added to this behavior. + */ + readonly items: Titanium.UI.View[]; + + /** + * Insets to apply when using the animator's reference view as the boundary. + */ + referenceInsets: ReferenceInsets; + + /** + * Use the animator's reference view as the boundary. + */ + treatReferenceAsBoundary: boolean; + + /** + * Adds a boundary to this behavior. + */ + addBoundary(boundary: BoundaryIdentifier): void; + + /** + * Adds an item to this behavior. + */ + addItem(item: any): void; + + /** + * Removes all boundaries from this behavior. + */ + removeAllBoundaries(): void; + + /** + * Removes the specified boundary from this behavior. + */ + removeBoundary(boundary: BoundaryIdentifier): void; + + /** + * Removes the specified item from this behavior. + */ + removeItem(item: any): void; + + /** + * Gets the value of the property. + */ + getBoundaryIdentifiers(): BoundaryIdentifier[]; + + /** + * Gets the value of the property. + */ + getCollisionMode(): number; + + /** + * Sets the value of the property. + */ + setCollisionMode(collisionMode: number): void; + + /** + * Gets the value of the property. + */ + getItems(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getReferenceInsets(): ReferenceInsets; + + /** + * Sets the value of the property. + */ + setReferenceInsets(referenceInsets: ReferenceInsets): void; + + /** + * Gets the value of the property. + */ + getTreatReferenceAsBoundary(): boolean; + + /** + * Sets the value of the property. + */ + setTreatReferenceAsBoundary(treatReferenceAsBoundary: boolean): void; + + } + + /** + * The cover flow view is a container showing animated three-dimensional images in a style + * consistent with the cover flow presentation style used for iPod, iTunes, and file browsing. + */ + interface CoverFlowView extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Images to display in the view. + */ + images: string[] | Titanium.Blob[] | Titanium.Filesystem.File[] | CoverFlowImageType[]; + + /** + * Index to make selected. + */ + selected: number; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Changes the image for a specified index. + */ + setImage(index: number, image: string): void; + + /** + * Changes the image for a specified index. + */ + setImage(index: number, image: Titanium.Blob): void; + + /** + * Changes the image for a specified index. + */ + setImage(index: number, image: Titanium.Filesystem.File): void; + + /** + * Changes the image for a specified index. + */ + setImage(index: number, image: CoverFlowImageType): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getImages(): string[] | Titanium.Blob[] | Titanium.Filesystem.File[] | CoverFlowImageType[]; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getSelected(): number; + + /** + * Sets the value of the property. + */ + setSelected(selected: number): void; + + } + + /** + * A DocumentViewer provides in-app support for managing user interactions with files on the + * local system. + */ + interface DocumentViewer extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Name of the file (without the path). + */ + readonly name: string; + + /** + * URL of the document being previewed. + */ + url: string; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Dismisses the document viewer. + */ + hide(options?: DocumentViewerOptions): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Displays the document viewer over the current view. + */ + show(options?: DocumentViewerOptions): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + } + + /** + * Base dynamic configuration for an item. + */ + interface DynamicItemBehavior extends Titanium.Proxy { + /** + * Specifies if this item can rotate. + */ + allowsRotation: boolean; + + /** + * Specifies the angular resistance of this item. + */ + angularResistance: number; + + /** + * Specifies the relative mass density of this item. + */ + density: number; + + /** + * Specifies the elasticity applied to collisions for this item. + */ + elasticity: number; + + /** + * Specifies the linear resistance of the item when it slides against another item. + */ + friction: number; + + /** + * Items added to this behavior. + */ + readonly items: Titanium.UI.View[]; + + /** + * Specifies the linear resistance of this item which reduces linear velocity over time. + */ + resistance: number; + + /** + * Adds a specified angular velocity for the item. + */ + addAngularVelocityForItem(item: any, velocity: number): void; + + /** + * Adds an item to this behavior. + */ + addItem(item: any): void; + + /** + * Adds a specified linear velocity for the item. + */ + addLinearVelocityForItem(item: any, velocity: Point): void; + + /** + * Returns the angular velocity of the item. + */ + angularVelocityForItem(item: any): number; + + /** + * Returns the linear velocity of the item. + */ + linearVelocityForItem(item: any): Point; + + /** + * Removes the specified item from this behavior. + */ + removeItem(item: any): void; + + /** + * Gets the value of the property. + */ + getAllowsRotation(): boolean; + + /** + * Sets the value of the property. + */ + setAllowsRotation(allowsRotation: boolean): void; + + /** + * Gets the value of the property. + */ + getAngularResistance(): number; + + /** + * Sets the value of the property. + */ + setAngularResistance(angularResistance: number): void; + + /** + * Gets the value of the property. + */ + getDensity(): number; + + /** + * Sets the value of the property. + */ + setDensity(density: number): void; + + /** + * Gets the value of the property. + */ + getElasticity(): number; + + /** + * Sets the value of the property. + */ + setElasticity(elasticity: number): void; + + /** + * Gets the value of the property. + */ + getFriction(): number; + + /** + * Sets the value of the property. + */ + setFriction(friction: number): void; + + /** + * Gets the value of the property. + */ + getItems(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getResistance(): number; + + /** + * Sets the value of the property. + */ + setResistance(resistance: number): void; + + } + + /** + * The feedback generator API is introduced in iOS 10 to handle the haptic feedback when using an iPhone 7 or + * later devices. + */ + interface FeedbackGenerator extends Titanium.Proxy { + /** + * The type of feedback generator you want to create. + */ + type: number; + + /** + * Used to prepare the haptic sensor for the upcoming interaction with it. + */ + prepare(): void; + + /** + * Used to trigger a haptic feedback after a selection has been made. + */ + selectionChanged(): void; + + /** + * Used to trigger a haptic feedback after an impact occurred. + */ + impactOccurred(): void; + + /** + * Used to trigger a haptic feedback after a notification has been received. + */ + notificationOccurred(notificationType: number): void; + + /** + * Gets the value of the property. + */ + getType(): number; + + /** + * Sets the value of the property. + */ + setType(type: number): void; + + } + + /** + * Gravitational force to apply to an item. + */ + interface GravityBehavior extends Titanium.Proxy { + /** + * Specifies the angle of the gravity vector in radians. + */ + angle: number; + + /** + * Specifies the direction of the gravity vector as an x, y pair. + */ + gravityDirection: Point; + + /** + * Items added to this behavior. + */ + readonly items: Titanium.UI.View[]; + + /** + * Specifies the magnitude of the gravity vector. + */ + magnitude: number; + + /** + * Adds an item to this behavior. + */ + addItem(item: any): void; + + /** + * Removes the specified item from this behavior. + */ + removeItem(item: any): void; + + /** + * Gets the value of the property. + */ + getAngle(): number; + + /** + * Sets the value of the property. + */ + setAngle(angle: number): void; + + /** + * Gets the value of the property. + */ + getGravityDirection(): Point; + + /** + * Sets the value of the property. + */ + setGravityDirection(gravityDirection: Point): void; + + /** + * Gets the value of the property. + */ + getItems(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getMagnitude(): number; + + /** + * Sets the value of the property. + */ + setMagnitude(magnitude: number): void; + + } + + /** + * A set of constants for the style that can be used for the `selectionStyle` property of a + * ListItem, which is set in the `properties` dictionary of either the or + * . + */ + interface ListViewCellSelectionStyle extends Titanium.Proxy { + /** + * The cell when selected has a blue background. This is the default value. + */ + readonly BLUE: number; + + /** + * The cell when selected has a gray background. + */ + readonly GRAY: number; + + /** + * The cell has no distinct style for when it is selected. + */ + readonly NONE: number; + + } + + /** + * A set of constants for the position value that can be used for the `position` property of + * when invoking the ListView's `scrollToItem`, `appendSection`, + * `deleteSectionAt`, `insertSectionAt` and `replaceSectionAt` methods. + */ + interface ListViewScrollPosition extends Titanium.Proxy { + /** + * The list view scrolls the row of interest to the bottom of the visible list view. + */ + readonly BOTTOM: number; + + /** + * The list view scrolls the row of interest to the middle of the list table view. + */ + readonly MIDDLE: number; + + /** + * The table view scrolls the row of interest to be fully visible with a minimal movement. + * If the row is already fully visible, no scrolling occurs. For example, if the row is above the + * visible area, the behavior is identical to that specified by `TOP`. This is the default. + */ + readonly NONE: number; + + /** + * The list view scrolls the row of interest to the top of the visible list view. + */ + readonly TOP: number; + + } + + /** + * A set of constants for the style that can be used for the `style` property of + * . + */ + interface ListViewStyle extends Titanium.Proxy { + /** + * A list view whose sections present distinct groups of rows. The section headers and footers + * do not float. + */ + readonly GROUPED: number; + + /** + * A plain list view. Any section headers or footers are displayed as inline separators and + * float when the list view is scrolled. + */ + readonly PLAIN: number; + + } + + /** + * Abstract object representing a live photo used in . + */ + interface LivePhoto extends Titanium.Proxy { + } + + /** + * A view to display a object introduced in iOS 9.1. + */ + interface LivePhotoView extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * The Live Photo displayed in the view. + */ + livePhoto: Titanium.UI.iOS.LivePhoto; + + /** + * A Boolean value that determines whether the view plays the audio content of its Live Photo. + */ + muted: boolean; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Begins playback of Live Photo content in the view. + */ + startPlaybackWithStyle(playbackStyle: number): void; + + /** + * Ends playback of Live Photo content in the view. + */ + stopPlayback(): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getLivePhoto(): Titanium.UI.iOS.LivePhoto; + + /** + * Sets the value of the property. + */ + setLivePhoto(livePhoto: Titanium.UI.iOS.LivePhoto): void; + + /** + * Gets the value of the property. + */ + getMuted(): boolean; + + /** + * Sets the value of the property. + */ + setMuted(muted: boolean): void; + + } + + /** + * A menu popup provides the ability to create custom tooltip options using the `items` property + * covering the native `UIMenuController` class. + * See also: + * * [iOS Developer Library: UIMenuController](https://developer.apple.com/library/prerelease/ios/documentation/iPhone/Reference/UIMenuController_Class/index.html) + */ + interface MenuPopup extends Titanium.Proxy { + /** + * The items of the menu popup. + */ + items: string; + + /** + * Shows the menu popup. + */ + show(params: MenuPopupShowParams): void; + + /** + * Hides the menu popup. + */ + hide(params?: MenuPopupHideParams): void; + + /** + * Indicates whether the menu popup is currently visible. + */ + isVisible(): void; + + /** + * Gets the value of the property. + */ + getItems(): string; + + /** + * Sets the value of the property. + */ + setItems(items: string): void; + + } + + /** + * A `NavigationWindow` implements a specialized view that manages the navigation of hierarchical + * content. + */ + interface NavigationWindow extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the window, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * Window's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * Window's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * The opacity from 0.0-1.0. + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * Window's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * Window's top position, in platform-specific units. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * An array of supported values specified using the EXTEND_EDGE constants in . Valid on iOS 7 and greater. + */ + extendEdges: number[]; + + /** + * Specifies if the edges should extend beyond opaque bars (navigation bar, tab bar, toolbar). Valid on iOS 7 and greater. + */ + includeOpaqueBars: boolean; + + /** + * Specifies whether or not the view controller should automatically adjust its scroll view insets. Valid on iOS 7 and greater. + */ + autoAdjustScrollViewInsets: boolean; + + /** + * Specifies whether the content (subviews) of the window will render inside the safe-area or not. + * Only used in iOS 11.0 and later. + */ + extendSafeArea: boolean; + + /** + * Boolean value indicating if the window is fullscreen. + */ + fullscreen: boolean; + + /** + * Set this to true to hide the navigation bar on swipe. + */ + hidesBarsOnSwipe: boolean; + + /** + * Set this to true to hide the navigation bar on tap. + */ + hidesBarsOnTap: boolean; + + /** + * Set this to true to hide the navigation bar when the keyboard appears. + */ + hidesBarsWhenKeyboardAppears: boolean; + + /** + * A Boolean value indicating whether the title should be displayed in a large format. + */ + largeTitleEnabled: string; + + /** + * The mode to use when displaying the title of the navigation bar. + */ + largeTitleDisplayMode: number; + + /** + * An Array of views to show in the left nav bar area. + */ + leftNavButtons: Titanium.UI.View[]; + + /** + * Indicates to open a modal window or not. + */ + modal: boolean; + + /** + * Array of supported orientation modes, specified using the orientation + * constants defined in . + */ + orientationModes: number[]; + + /** + * Current orientation of the window. + */ + readonly orientation: number; + + /** + * An Array of views to show in the right nav bar area. + */ + rightNavButtons: Titanium.UI.View[]; + + /** + * The status bar style associated with this window. + */ + statusBarStyle: number; + + /** + * Title text attributes of the window. + */ + titleAttributes: titleAttributesParams; + + /** + * Window to add to this navigation window. + */ + window: Titanium.UI.Window; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Closes the window. + */ + close(params?: any): void; + + /** + * Hides the navigation bar. + */ + hideNavBar(options?: any): void; + + /** + * Opens the window. + */ + open(params?: openWindowParams): void; + + /** + * Makes the navigation bar visible. + */ + showNavBar(options?: any): void; + + /** + * Makes the bottom toolbar visible. + */ + showToolbar(options?: any): void; + + /** + * Makes the bottom toolbar invisible. + */ + hideToolbar(options?: any): void; + + /** + * Closes a window and removes it from the navigation window. + */ + closeWindow(window: Titanium.UI.Window, options: any): void; + + /** + * Opens a window within the navigation window. + */ + openWindow(window: Titanium.UI.Window, options: any): void; + + /** + * Closes all windows that are currently opened inside the navigation window. + */ + popToRootWindow(options: any): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getExtendEdges(): number[]; + + /** + * Sets the value of the property. + */ + setExtendEdges(extendEdges: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getIncludeOpaqueBars(): boolean; + + /** + * Sets the value of the property. + */ + setIncludeOpaqueBars(includeOpaqueBars: boolean): void; + + /** + * Gets the value of the property. + */ + getAutoAdjustScrollViewInsets(): boolean; + + /** + * Sets the value of the property. + */ + setAutoAdjustScrollViewInsets(autoAdjustScrollViewInsets: boolean): void; + + /** + * Gets the value of the property. + */ + getExtendSafeArea(): boolean; + + /** + * Sets the value of the property. + */ + setExtendSafeArea(extendSafeArea: boolean): void; + + /** + * Gets the value of the property. + */ + getFullscreen(): boolean; + + /** + * Sets the value of the property. + */ + setFullscreen(fullscreen: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsOnSwipe(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsOnSwipe(hidesBarsOnSwipe: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsOnTap(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsOnTap(hidesBarsOnTap: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsWhenKeyboardAppears(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsWhenKeyboardAppears(hidesBarsWhenKeyboardAppears: boolean): void; + + /** + * Gets the value of the property. + */ + getLargeTitleEnabled(): string; + + /** + * Sets the value of the property. + */ + setLargeTitleEnabled(largeTitleEnabled: string): void; + + /** + * Gets the value of the property. + */ + getLargeTitleDisplayMode(): number; + + /** + * Sets the value of the property. + */ + setLargeTitleDisplayMode(largeTitleDisplayMode: number): void; + + /** + * Gets the value of the property. + */ + getLeftNavButtons(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setLeftNavButtons(leftNavButtons: any[]): void; + + /** + * Gets the value of the property. + */ + getModal(): boolean; + + /** + * Sets the value of the property. + */ + setModal(modal: boolean): void; + + /** + * Gets the value of the property. + */ + getOrientationModes(): number[]; + + /** + * Sets the value of the property. + */ + setOrientationModes(orientationModes: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getOrientation(): number; + + /** + * Gets the value of the property. + */ + getRightNavButtons(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setRightNavButtons(rightNavButtons: any[]): void; + + /** + * Gets the value of the property. + */ + getStatusBarStyle(): number; + + /** + * Sets the value of the property. + */ + setStatusBarStyle(statusBarStyle: number): void; + + /** + * Gets the value of the property. + */ + getTitleAttributes(): titleAttributesParams; + + /** + * Sets the value of the property. + */ + setTitleAttributes(titleAttributes: titleAttributesParams): void; + + /** + * Gets the value of the property. + */ + getWindow(): Titanium.UI.Window; + + /** + * Sets the value of the property. + */ + setWindow(window: Titanium.UI.Window): void; + + } + + /** + * A PreviewAction provides options to configure actions used by the iOS 9 3D-Touch "Peek and Pop" + * feature. + */ + interface PreviewAction extends Titanium.Proxy { + /** + * The title of the action. + */ + title: string; + + /** + * The style of the action. + */ + style: number; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + } + + /** + * A PreviewActionGroup provides options to configure a group of actions used by the iOS9 3D-Touch + * feature "Peek and Pop". + */ + interface PreviewActionGroup extends Titanium.Proxy { + /** + * The title of the action group. + */ + title: string; + + /** + * The style of the action group. + */ + style: number; + + /** + * The preview actions assigned to this preview action group. + */ + actions: Titanium.UI.iOS.PreviewAction[]; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + /** + * Gets the value of the property. + */ + getActions(): Titanium.UI.iOS.PreviewAction[]; + + /** + * Sets the value of the property. + */ + setActions(actions: ReadonlyArray): void; + + } + + /** + * A PreviewContext provides options to configure the iOS 9 3D-Touch "Peek and Pop" feature. + */ + interface PreviewContext extends Titanium.Proxy { + /** + * The preview actions and preview action groups. + */ + actions: Titanium.UI.iOS.PreviewAction[]; + + /** + * The height of the preview. + */ + contentHeight: number; + + /** + * The preview view. + */ + preview: Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getActions(): Titanium.UI.iOS.PreviewAction[]; + + /** + * Sets the value of the property. + */ + setActions(actions: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getContentHeight(): number; + + /** + * Sets the value of the property. + */ + setContentHeight(contentHeight: number): void; + + /** + * Gets the value of the property. + */ + getPreview(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setPreview(preview: any): void; + + } + + /** + * Continuous or instantaneous force to apply to an item. + */ + interface PushBehavior extends Titanium.Proxy { + /** + * State of the push behavior's force. + */ + active: boolean; + + /** + * Specifies the angle of the force vector in radians. + */ + angle: number; + + /** + * Items added to this behavior. + */ + readonly items: Titanium.UI.View[]; + + /** + * Specifies the magnitude of the force vector. + */ + magnitude: number; + + /** + * Specifies the direction of the force vector as an x, y pair. + */ + pushDirection: Point; + + /** + * Specifies the push mode. + */ + pushMode: number; + + /** + * Adds an item to this behavior. + */ + addItem(item: any): void; + + /** + * Removes the specified item from this behavior. + */ + removeItem(item: any): void; + + /** + * Gets the value of the property. + */ + getActive(): boolean; + + /** + * Sets the value of the property. + */ + setActive(active: boolean): void; + + /** + * Gets the value of the property. + */ + getAngle(): number; + + /** + * Sets the value of the property. + */ + setAngle(angle: number): void; + + /** + * Gets the value of the property. + */ + getItems(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getMagnitude(): number; + + /** + * Sets the value of the property. + */ + setMagnitude(magnitude: number): void; + + /** + * Gets the value of the property. + */ + getPushDirection(): Point; + + /** + * Sets the value of the property. + */ + setPushDirection(pushDirection: Point): void; + + /** + * Gets the value of the property. + */ + getPushMode(): number; + + /** + * Sets the value of the property. + */ + setPushMode(pushMode: number): void; + + } + + /** + * Dynamic behavior defining an item's movement to a specific point. + */ + interface SnapBehavior extends Titanium.Proxy { + /** + * Specifies the amount of oscillation during the conclusion of the snap. + */ + damping: number; + + /** + * Item to add to this behavior. + */ + item: Titanium.UI.View; + + /** + * Specifies the point to snap to. + */ + snapPoint: Point; + + /** + * Gets the value of the property. + */ + getDamping(): number; + + /** + * Sets the value of the property. + */ + setDamping(damping: number): void; + + /** + * Gets the value of the property. + */ + getItem(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setItem(item: any): void; + + /** + * Gets the value of the property. + */ + getSnapPoint(): Point; + + /** + * Sets the value of the property. + */ + setSnapPoint(snapPoint: Point): void; + + } + + /** + * A SplitWindow is a window that manages the presentation of two side-by-side view + * controllers. + */ + interface SplitWindow extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the window, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * Window's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * Window's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * The opacity from 0.0-1.0. + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * Window's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * Window's top position, in platform-specific units. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Title for the back button. This is only valid when the window is a child of a tab. + */ + backButtonTitle: string; + + /** + * The image to show as the back button. This is only valid when the window is a child of a tab. + */ + backButtonTitleImage: string | Titanium.Blob; + + /** + * Background color for the nav bar, as a color name or hex triplet. + */ + barColor: string; + + /** + * Background image for the nav bar, specified as a URL to a local image. + */ + barImage: string; + + /** + * An array of supported values specified using the EXTEND_EDGE constants in . Valid on iOS 7 and greater. + */ + extendEdges: number[]; + + /** + * Specifies if the edges should extend beyond opaque bars (navigation bar, tab bar, toolbar). Valid on iOS 7 and greater. + */ + includeOpaqueBars: boolean; + + /** + * Specifies whether or not the view controller should automatically adjust its scroll view insets. Valid on iOS 7 and greater. + */ + autoAdjustScrollViewInsets: boolean; + + /** + * Specifies whether the content (subviews) of the window will render inside the safe-area or not. + * Only used in iOS 11.0 and later. + */ + extendSafeArea: boolean; + + /** + * Boolean value indicating if the window is fullscreen. + */ + fullscreen: boolean; + + /** + * Set this to true to hide the shadow image of the navigation bar. + */ + hideShadow: boolean; + + /** + * Set this to true to hide the navigation bar on swipe. + */ + hidesBarsOnSwipe: boolean; + + /** + * Set this to true to hide the navigation bar on tap. + */ + hidesBarsOnTap: boolean; + + /** + * Set this to true to hide the navigation bar when the keyboard appears. + */ + hidesBarsWhenKeyboardAppears: boolean; + + /** + * A Boolean value indicating whether the title should be displayed in a large format. + */ + largeTitleEnabled: string; + + /** + * The mode to use when displaying the title of the navigation bar. + */ + largeTitleDisplayMode: number; + + /** + * View to show in the left nav bar area. + */ + leftNavButton: Titanium.UI.View; + + /** + * An Array of views to show in the left nav bar area. + */ + leftNavButtons: Titanium.UI.View[]; + + /** + * Indicates to open a modal window or not. + */ + modal: boolean; + + /** + * Hides the navigation bar (`true`) or shows the navigation bar (`false`). + */ + navBarHidden: boolean; + + /** + * The tintColor to apply to the navigation bar. This property is applicable on iOS 7 and greater. + */ + navTintColor: string; + + /** + * Array of supported orientation modes, specified using the orientation + * constants defined in . + */ + orientationModes: number[]; + + /** + * Current orientation of the window. + */ + readonly orientation: number; + + /** + * View to show in the right nav bar area. + */ + rightNavButton: Titanium.UI.View; + + /** + * An Array of views to show in the right nav bar area. + */ + rightNavButtons: Titanium.UI.View[]; + + /** + * Shadow image for the navigation bar, specified as a URL to a local image.. + */ + shadowImage: string; + + /** + * The status bar style associated with this window. + */ + statusBarStyle: number; + + /** + * Boolean value indicating if the tab bar should be hidden. + */ + tabBarHidden: boolean; + + /** + * Title of the window. + */ + title: string; + + /** + * Title text attributes of the window. + */ + titleAttributes: titleAttributesParams; + + /** + * View to show in the title area of the nav bar. + */ + titleControl: Titanium.UI.View; + + /** + * Image to show in the title area of the nav bar, specified as a local file path or URL. + */ + titleImage: string; + + /** + * Title prompt for the window. + */ + titlePrompt: string; + + /** + * Key identifying a string from the locale file to use for the window title. + */ + titleid: string; + + /** + * Key identifying a string from the locale file to use for the window title prompt. + */ + titlepromptid: string; + + /** + * Array of button objects to show in the window's toolbar. + */ + toolbar: any[]; + + /** + * Boolean value indicating if the nav bar is translucent. + */ + translucent: boolean; + + /** + * Loads a JavaScript file from a local URL. + */ + url: string; + + /** + * View for the detail view section of the SplitWindow. + */ + detailView: Titanium.UI.View; + + /** + * View for the master view section of the SplitWindow. + */ + masterView: Titanium.UI.View; + + /** + * Determines whether to show the master view in portrait orientation. + */ + showMasterInPortrait: boolean; + + /** + * Determines whether to show the master view is overlayed in portrait orientation. + */ + masterIsOverlayed: boolean; + + /** + * Determines the width of the `masterView` in portrait mode. + */ + portraitSplit: number; + + /** + * Determines the width of the `masterView` in landscape mode. + */ + landscapeSplit: number; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Closes the window. + */ + close(params?: any): void; + + /** + * Hides the navigation bar. + */ + hideNavBar(options?: any): void; + + /** + * Hides the tab bar. Must be called before opening the window. + */ + hideTabBar(): void; + + /** + * Opens the window. + */ + open(params?: openWindowParams): void; + + /** + * Sets the array of items to show in the window's toolbar. + */ + setToolbar(items: ReadonlyArray, params?: windowToolbarParam): void; + + /** + * Makes the navigation bar visible. + */ + showNavBar(options?: any): void; + + /** + * Makes the bottom toolbar visible. + */ + showToolbar(options?: any): void; + + /** + * Makes the bottom toolbar invisible. + */ + hideToolbar(options?: any): void; + + /** + * Sets the value of the [showMasterInPortrait](Titanium.UI.iOS.SplitWindow.showMasterInPortrait) property. + */ + setShowMasterInPortrait(showMasterInPortrait: boolean, animated?: animationOption): void; + + /** + * Sets the value of the [masterIsOverlayed](Titanium.UI.iOS.SplitWindow.masterIsOverlayed) property. + */ + setMasterIsOverlayed(masterIsOverlayed: boolean, animated?: animationOption): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getBackButtonTitle(): string; + + /** + * Sets the value of the property. + */ + setBackButtonTitle(backButtonTitle: string): void; + + /** + * Gets the value of the property. + */ + getBackButtonTitleImage(): string | Titanium.Blob; + + /** + * Sets the value of the property. + */ + setBackButtonTitleImage(backButtonTitleImage: string): void; + + /** + * Sets the value of the property. + */ + setBackButtonTitleImage(backButtonTitleImage: Titanium.Blob): void; + + /** + * Gets the value of the property. + */ + getBarColor(): string; + + /** + * Sets the value of the property. + */ + setBarColor(barColor: string): void; + + /** + * Gets the value of the property. + */ + getBarImage(): string; + + /** + * Sets the value of the property. + */ + setBarImage(barImage: string): void; + + /** + * Gets the value of the property. + */ + getExtendEdges(): number[]; + + /** + * Sets the value of the property. + */ + setExtendEdges(extendEdges: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getIncludeOpaqueBars(): boolean; + + /** + * Sets the value of the property. + */ + setIncludeOpaqueBars(includeOpaqueBars: boolean): void; + + /** + * Gets the value of the property. + */ + getAutoAdjustScrollViewInsets(): boolean; + + /** + * Sets the value of the property. + */ + setAutoAdjustScrollViewInsets(autoAdjustScrollViewInsets: boolean): void; + + /** + * Gets the value of the property. + */ + getExtendSafeArea(): boolean; + + /** + * Sets the value of the property. + */ + setExtendSafeArea(extendSafeArea: boolean): void; + + /** + * Gets the value of the property. + */ + getFullscreen(): boolean; + + /** + * Sets the value of the property. + */ + setFullscreen(fullscreen: boolean): void; + + /** + * Gets the value of the property. + */ + getHideShadow(): boolean; + + /** + * Sets the value of the property. + */ + setHideShadow(hideShadow: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsOnSwipe(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsOnSwipe(hidesBarsOnSwipe: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsOnTap(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsOnTap(hidesBarsOnTap: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsWhenKeyboardAppears(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsWhenKeyboardAppears(hidesBarsWhenKeyboardAppears: boolean): void; + + /** + * Gets the value of the property. + */ + getLargeTitleEnabled(): string; + + /** + * Sets the value of the property. + */ + setLargeTitleEnabled(largeTitleEnabled: string): void; + + /** + * Gets the value of the property. + */ + getLargeTitleDisplayMode(): number; + + /** + * Sets the value of the property. + */ + setLargeTitleDisplayMode(largeTitleDisplayMode: number): void; + + /** + * Gets the value of the property. + */ + getLeftNavButton(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setLeftNavButton(leftNavButton: any): void; + + /** + * Gets the value of the property. + */ + getLeftNavButtons(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setLeftNavButtons(leftNavButtons: any[]): void; + + /** + * Gets the value of the property. + */ + getModal(): boolean; + + /** + * Sets the value of the property. + */ + setModal(modal: boolean): void; + + /** + * Gets the value of the property. + */ + getNavBarHidden(): boolean; + + /** + * Sets the value of the property. + */ + setNavBarHidden(navBarHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getNavTintColor(): string; + + /** + * Sets the value of the property. + */ + setNavTintColor(navTintColor: string): void; + + /** + * Gets the value of the property. + */ + getOrientationModes(): number[]; + + /** + * Sets the value of the property. + */ + setOrientationModes(orientationModes: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getOrientation(): number; + + /** + * Gets the value of the property. + */ + getRightNavButton(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setRightNavButton(rightNavButton: any): void; + + /** + * Gets the value of the property. + */ + getRightNavButtons(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setRightNavButtons(rightNavButtons: any[]): void; + + /** + * Gets the value of the property. + */ + getShadowImage(): string; + + /** + * Sets the value of the property. + */ + setShadowImage(shadowImage: string): void; + + /** + * Gets the value of the property. + */ + getStatusBarStyle(): number; + + /** + * Sets the value of the property. + */ + setStatusBarStyle(statusBarStyle: number): void; + + /** + * Gets the value of the property. + */ + getTabBarHidden(): boolean; + + /** + * Sets the value of the property. + */ + setTabBarHidden(tabBarHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleAttributes(): titleAttributesParams; + + /** + * Sets the value of the property. + */ + setTitleAttributes(titleAttributes: titleAttributesParams): void; + + /** + * Gets the value of the property. + */ + getTitleControl(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setTitleControl(titleControl: any): void; + + /** + * Gets the value of the property. + */ + getTitleImage(): string; + + /** + * Sets the value of the property. + */ + setTitleImage(titleImage: string): void; + + /** + * Gets the value of the property. + */ + getTitlePrompt(): string; + + /** + * Sets the value of the property. + */ + setTitlePrompt(titlePrompt: string): void; + + /** + * Gets the value of the property. + */ + getTitleid(): string; + + /** + * Sets the value of the property. + */ + setTitleid(titleid: string): void; + + /** + * Gets the value of the property. + */ + getTitlepromptid(): string; + + /** + * Sets the value of the property. + */ + setTitlepromptid(titlepromptid: string): void; + + /** + * Gets the value of the property. + */ + getToolbar(): any[]; + + /** + * Sets the value of the property. + */ + setToolbar(toolbar: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getTranslucent(): boolean; + + /** + * Sets the value of the property. + */ + setTranslucent(translucent: boolean): void; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + /** + * Gets the value of the property. + */ + getDetailView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setDetailView(detailView: any): void; + + /** + * Gets the value of the property. + */ + getMasterView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setMasterView(masterView: any): void; + + /** + * Gets the value of the property. + */ + getShowMasterInPortrait(): boolean; + + /** + * Sets the value of the property. + */ + setShowMasterInPortrait(showMasterInPortrait: boolean): void; + + /** + * Gets the value of the property. + */ + getMasterIsOverlayed(): boolean; + + /** + * Sets the value of the property. + */ + setMasterIsOverlayed(masterIsOverlayed: boolean): void; + + /** + * Gets the value of the property. + */ + getPortraitSplit(): number; + + /** + * Sets the value of the property. + */ + setPortraitSplit(portraitSplit: number): void; + + /** + * Gets the value of the property. + */ + getLandscapeSplit(): number; + + /** + * Sets the value of the property. + */ + setLandscapeSplit(landscapeSplit: number): void; + + } + + /** + * A widget used to increment and decrement a value. + */ + interface Stepper extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the stepper in its normal state, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * Sets the color for the widget, any backgroundImages added will be set to the same color. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Determines if the stepper is enabled or disabled. + */ + enabled: boolean; + + /** + * The current value of the stepper. + */ + value: number; + + /** + * If YES, value change events are sent immediately when the value changes during user interaction. + * If NO, a value change event is sent when user interaction ends. + * The default value is YES. + */ + continuous: boolean; + + /** + * If YES, the user pressing and holding on the stepper repeatedly alters value. + * The default value is YES. + */ + autorepeat: boolean; + + /** + * If YES, incrementing beyond sets value to . likewise, decrementing below + * sets value to . If NO, the stepper does not increment beyond nor + * does it decrement below but rather holds at those values. + * The default value is NO. + */ + wraps: boolean; + + /** + * The minimum value the stepper will be set to, the value must be smaller than the maximum value. + * If you attempt to set a value equal to or greater than maximum, the system will default the + * value to 0. + */ + minimum: number; + + /** + * The maximum value the stepper will be set to, the value must be greater than the minimum value. + * If you attempt to set a value equal to or lower than minimum, the system will default the + * value to 100. + */ + maximum: number; + + /** + * The value the stepper will increment and decrement by, default value for this property is 1. When setting + * a new value, it must be greater than 1. + */ + steps: number; + + /** + * Background image for the stepper decrement button in its normal state, specified as a local + * file path or URL. + */ + decrementImage: string; + + /** + * Background image for the stepper decrement button in its disabled state, specified as a local + * file path or URL. The decrement button enters a disabled state ones the value is equal to the + * minimumValue , setting the enabled property to false will have no effect to decrement button state. + */ + decrementDisabledImage: string; + + /** + * Background image for the stepper increment button in its normal state, specified as a local + * file path or URL. + */ + incrementImage: string; + + /** + * Background image for the stepper increment button in its disabled state, specified as a local + * file path or URL.The increment button enters a disabled state ones the value is equal to the + * maximumValue , setting the enabled property to false will have no effect to increment button state. + */ + incrementDisabledImage: string; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setEnabled(enabled: boolean): void; + + /** + * Gets the value of the property. + */ + getValue(): number; + + /** + * Sets the value of the property. + */ + setValue(value: number): void; + + /** + * Gets the value of the property. + */ + getContinuous(): boolean; + + /** + * Sets the value of the property. + */ + setContinuous(continuous: boolean): void; + + /** + * Gets the value of the property. + */ + getAutorepeat(): boolean; + + /** + * Sets the value of the property. + */ + setAutorepeat(autorepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getWraps(): boolean; + + /** + * Sets the value of the property. + */ + setWraps(wraps: boolean): void; + + /** + * Gets the value of the property. + */ + getMinimum(): number; + + /** + * Sets the value of the property. + */ + setMinimum(minimum: number): void; + + /** + * Gets the value of the property. + */ + getMaximum(): number; + + /** + * Sets the value of the property. + */ + setMaximum(maximum: number): void; + + /** + * Gets the value of the property. + */ + getSteps(): number; + + /** + * Sets the value of the property. + */ + setSteps(steps: number): void; + + /** + * Gets the value of the property. + */ + getDecrementImage(): string; + + /** + * Sets the value of the property. + */ + setDecrementImage(decrementImage: string): void; + + /** + * Gets the value of the property. + */ + getDecrementDisabledImage(): string; + + /** + * Sets the value of the property. + */ + setDecrementDisabledImage(decrementDisabledImage: string): void; + + /** + * Gets the value of the property. + */ + getIncrementImage(): string; + + /** + * Sets the value of the property. + */ + setIncrementImage(incrementImage: string): void; + + /** + * Gets the value of the property. + */ + getIncrementDisabledImage(): string; + + /** + * Sets the value of the property. + */ + setIncrementDisabledImage(incrementDisabledImage: string): void; + + } + + /** + * A button bar that maintains a selected state. + */ + interface TabbedBar extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Index of the currently selected button. + */ + index: number; + + /** + * Array of labels for the tabbed bar. + */ + labels: string[] | BarItemType[]; + + /** + * Style of the tabbed bar. + */ + style: number; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getIndex(): number; + + /** + * Sets the value of the property. + */ + setIndex(index: number): void; + + /** + * Gets the value of the property. + */ + getLabels(): string[] | BarItemType[]; + + /** + * Sets the value of the property. + */ + setLabels(labels: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setLabels(labels: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + } + + /** + * An iOS toolbar, which can contain buttons and certain other controls. + */ + interface Toolbar extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Background color for the toolbar, as a color name or hex triplet. + */ + barColor: string; + + /** + * An array of buttons (or other widgets) contained in the toolbar. + */ + items: Titanium.UI.View[]; + + /** + * If `true`, the background of the toolbar extends upwards. + */ + extendBackground: boolean; + + /** + * If `true`, a translucent background color is used for the toolbar. + */ + translucent: boolean; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getBarColor(): string; + + /** + * Sets the value of the property. + */ + setBarColor(barColor: string): void; + + /** + * Gets the value of the property. + */ + getItems(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setItems(items: any[]): void; + + /** + * Gets the value of the property. + */ + getExtendBackground(): boolean; + + /** + * Sets the value of the property. + */ + setExtendBackground(extendBackground: boolean): void; + + /** + * Gets the value of the property. + */ + getTranslucent(): boolean; + + /** + * Sets the value of the property. + */ + setTranslucent(translucent: boolean): void; + + } + + /** + * Dynamic behavior to support connections between two items. + */ + interface ViewAttachmentBehavior extends Titanium.Proxy { + /** + * Item to use as the anchor in this behavior. + */ + anchorItem: Titanium.UI.View; + + /** + * Offset from the center point of the anchor item for the attachment. + */ + anchorOffset: Point; + + /** + * Amount of damping to apply to the attachment behavior. + */ + damping: number; + + /** + * Distance, in points, between the two attachment points. + */ + distance: number; + + /** + * Frequency of oscillation for the behavior. + */ + frequency: number; + + /** + * Item to connect to use the attachment behavior. + */ + item: Titanium.UI.View; + + /** + * Offset from the center point of the item for the attachment. + */ + itemOffset: Point; + + /** + * Gets the value of the property. + */ + getAnchorItem(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setAnchorItem(anchorItem: any): void; + + /** + * Gets the value of the property. + */ + getAnchorOffset(): Point; + + /** + * Sets the value of the property. + */ + setAnchorOffset(anchorOffset: Point): void; + + /** + * Gets the value of the property. + */ + getDamping(): number; + + /** + * Sets the value of the property. + */ + setDamping(damping: number): void; + + /** + * Gets the value of the property. + */ + getDistance(): number; + + /** + * Sets the value of the property. + */ + setDistance(distance: number): void; + + /** + * Gets the value of the property. + */ + getFrequency(): number; + + /** + * Sets the value of the property. + */ + setFrequency(frequency: number): void; + + /** + * Gets the value of the property. + */ + getItem(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setItem(item: any): void; + + /** + * Gets the value of the property. + */ + getItemOffset(): Point; + + /** + * Sets the value of the property. + */ + setItemOffset(itemOffset: Point): void; + + } + + + /** + * A set of constants for the style that can be used for the `style` property of + * . + */ + namespace AlertDialogStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * A standard alert dialog. This is the default value. + */ + const DEFAULT: number; + + /** + * An alert dialog that allows the user to enter text. + */ + const PLAIN_TEXT_INPUT: number; + + /** + * An alert dialog that allows the user to enter text. The text field is obscured. + */ + const SECURE_TEXT_INPUT: number; + + /** + * An alert dialog that allows the user to enter login identifier and password. + */ + const LOGIN_AND_PASSWORD_INPUT: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the animation styles used for view transitions. + * One of the group of animation style constants + * * [CURL_DOWN](Titanium.UI.iOS.AnimationStyle.CURL_DOWN) + * * [CURL_UP](Titanium.UI.iOS.AnimationStyle.CURL_UP) + * * [FLIP_FROM_LEFT](Titanium.UI.iOS.AnimationStyle.FLIP_FROM_LEFT) + * * [FLIP_FROM_RIGHT](Titanium.UI.iOS.AnimationStyle.FLIP_FROM_RIGHT) + * * [FLIP_FROM_TOP](Titanium.UI.iOS.AnimationStyle.FLIP_FROM_TOP) + * * [FLIP_FROM_BOTTOM](Titanium.UI.iOS.AnimationStyle.FLIP_FROM_BOTTOM) + * * [CROSS_DISSOLVE](Titanium.UI.iOS.AnimationStyle.CROSS_DISSOLVE) + * * [NONE](Titanium.UI.iOS.AnimationStyle.NONE) + */ + namespace AnimationStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Curl downwards during a transition animation. + */ + const CURL_DOWN: number; + + /** + * Curl upwards during a transition animation. + */ + const CURL_UP: number; + + /** + * Flip from left to right during a transition animation. + */ + const FLIP_FROM_LEFT: number; + + /** + * Flip from right to left during a transition animation. + */ + const FLIP_FROM_RIGHT: number; + + /** + * Flip from top to bottom during a transition animation. + */ + const FLIP_FROM_TOP: number; + + /** + * Flip from bottom to top during a transition animation. + */ + const FLIP_FROM_BOTTOM: number; + + /** + * A transition that dissolves from one view to the next. + */ + const CROSS_DISSOLVE: number; + + /** + * No animation. + */ + const NONE: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the bar styles used on the `style` property of . + */ + namespace ProgressBarStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The style of progress view that is used in a toolbar. + */ + const BAR: number; + + /** + * he standard progress-view style. This is the default. + */ + const DEFAULT: number; + + /** + * The standard progress-view style. Same as `DEFAULT`. + */ + const PLAIN: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the Animation Styles used for transition on table view rows. + */ + namespace RowAnimationStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The inserted row or rows slides in from the bottom; the deleted row or rows slides out + * toward the bottom. + */ + const BOTTOM: number; + + /** + * The inserted or deleted row or rows fades into or out of the table view. + */ + const FADE: number; + + /** + * The inserted row or rows slides in from the left; the deleted row or rows slides out to the + * left. + */ + const LEFT: number; + + /** + * No animation is performed. The new cell value appears as if the cell had just been reloaded. + */ + const NONE: number; + + /** + * The inserted row or rows slides in from the right; the deleted row or rows slides out to + * the right. + */ + const RIGHT: number; + + /** + * The inserted row or rows slides in from the top; the deleted row or rows slides out toward + * the top. + */ + const TOP: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the styles available for scrollbars used with and properties. + */ + namespace ScrollIndicatorStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * A style of indicator which is black smaller than the default style. This style is good + * against a white content background. + */ + const BLACK: number; + + /** + * The default style of scroll indicator, which is black with a white border. This style is + * good against any content background. + */ + const DEFAULT: number; + + /** + * A style of indicator is white and smaller than the default style. This style is good against + * a black content background. + */ + const WHITE: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the status bar style. + */ + namespace StatusBar { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * No animation style, when the status bar is hidden or shown. + */ + const ANIMATION_STYLE_NONE: number; + + /** + * Slide animation style, when the status bar is hidden or shown. + */ + const ANIMATION_STYLE_SLIDE: number; + + /** + * Fade animation style, when the status bar is hidden or shown. + */ + const ANIMATION_STYLE_FADE: number; + + /** + * Default status bar style. + */ + const DEFAULT: number; + + /** + * Gray-colored status bar style. + */ + const GRAY: number; + + /** + * Gray-colored status bar style. + */ + const GREY: number; + + /** + * Status bar style to use with dark backgrounds. Valid on iOS 7 and above. + */ + const LIGHT_CONTENT: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for creating standard iOS system buttons. + */ + namespace SystemButton { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify an **Action** button. + */ + const ACTION: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to create an activity indicator that + * can be used in navigation bars and toolbars. + */ + const ACTIVITY: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify an **Add** button. + */ + const ADD: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Bookmarks** button. + */ + const BOOKMARKS: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Camera** button. + */ + const CAMERA: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Cancel** button. + */ + const CANCEL: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Compose** button. + */ + const COMPOSE: number; + + /** + * Use with [Button.style](Titanium.UI.Button.style) to specify a **ContactAdd** button. + */ + const CONTACT_ADD: number; + + /** + * Use with [Button.style](Titanium.UI.Button.style) to specify a **Disclosure** button. + */ + const DISCLOSURE: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Done** button. + */ + const DONE: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify an **Edit** button. + */ + const EDIT: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Fast Forward** button. + */ + const FAST_FORWARD: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to create a fixed-width blank space + * for spacing items in toolbars. + */ + const FIXED_SPACE: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to create a flexible blank space + * for spacing items in toolbars. + */ + const FLEXIBLE_SPACE: number; + + /** + * Use with [Button.style](Titanium.UI.Button.style) to specify a dark-colored **Info** button. + */ + const INFO_DARK: number; + + /** + * Use with [Button.style](Titanium.UI.Button.style) to specify a light-colored **Info** button. + */ + const INFO_LIGHT: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify an **Organize** button. + */ + const ORGANIZE: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Pause** button. + */ + const PAUSE: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Play** button. + */ + const PLAY: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Refresh** button. + */ + const REFRESH: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Reply** button. + */ + const REPLY: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Rewind** button. + */ + const REWIND: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Save** button. + */ + const SAVE: number; + + /** + * Identical to [ACTIVITY](Titanium.UI.iOS.SystemButton.ACTIVITY). + */ + const SPINNER: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Stop** button. + */ + const STOP: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Trash** button. + */ + const TRASH: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the system button styles that can be used for the button `style` property. + */ + namespace SystemButtonStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * A simple button style with a border. + */ + const BORDERED: number; + + /** + * The style for a **Done** button--for example, a button that completes some task and returns + * to the previous view. + */ + const DONE: number; + + /** + * Specifies a borderless button, the default style for toolbars, button bars, and tabbed bars. + */ + const PLAIN: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the system icon styles that can be used on a tab group tab. + */ + namespace SystemIcon { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Bookmark style icon + */ + const BOOKMARKS: number; + + /** + * Contacts style icon + */ + const CONTACTS: number; + + /** + * Downloads style icon + */ + const DOWNLOADS: number; + + /** + * Favorites style icon + */ + const FAVORITES: number; + + /** + * Featured style icon + */ + const FEATURED: number; + + /** + * History style icon + */ + const HISTORY: number; + + /** + * More style icon + */ + const MORE: number; + + /** + * Most recent style icon + */ + const MOST_RECENT: number; + + /** + * Most viewed style icon + */ + const MOST_VIEWED: number; + + /** + * Recents style icon + */ + const RECENTS: number; + + /** + * Search style icon + */ + const SEARCH: number; + + /** + * Top rated style icon + */ + const TOP_RATED: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the style that can be used for the `selectionStyle` property of + * . + */ + namespace TableViewCellSelectionStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The cell when selected has a blue background. This is the default value. + */ + const BLUE: number; + + /** + * Then cell when selected has a gray background. + */ + const GRAY: number; + + /** + * The cell has no distinct style for when it is selected. + */ + const NONE: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the position value that can be used for the `position` property of + * when invoking `scrollToIndex`. + */ + namespace TableViewScrollPosition { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The table view scrolls the row of interest to the bottom of the visible table view. + */ + const BOTTOM: number; + + /** + * The table view scrolls the row of interest to the middle of the visible table view. + */ + const MIDDLE: number; + + /** + * The table view scrolls the row of interest to be fully visible with a minimum of movement. If the row is already fully visible, no scrolling occurs. For example, if the row is above the visible area, the behavior is identical to that specified by `TOP`. This is the default. + */ + const NONE: number; + + /** + * The table view scrolls the row of interest to the top of the visible table view. + */ + const TOP: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the style that can be used for the button `style` property of + * . + */ + namespace TableViewStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * A table view whose sections present distinct groups of rows. The section headers and footers + * do not float. + */ + const GROUPED: number; + + /** + * A plain table view. Any section headers or footers are displayed as inline separators and + * float when the table view is scrolled. + */ + const PLAIN: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; } } - export module iOS { - export var BACKGROUNDFETCHINTERVAL_MIN : number; - export var BACKGROUNDFETCHINTERVAL_NEVER : number; - export var EVENT_ACCESSIBILITY_LAYOUT_CHANGED : string; - export var EVENT_ACCESSIBILITY_SCREEN_CHANGED : string; - export var USER_NOTIFICATION_ACTIVATION_MODE_BACKGROUND : number; - export var USER_NOTIFICATION_ACTIVATION_MODE_FOREGROUND : number; - export var USER_NOTIFICATION_TYPE_ALERT : number; - export var USER_NOTIFICATION_TYPE_BADGE : number; - export var USER_NOTIFICATION_TYPE_NONE : number; - export var USER_NOTIFICATION_TYPE_SOUND : number; - export var apiName : string; - export var applicationOpenSettingsURL : string; - export var bubbleParent : boolean; - export var currentUserNotificationSettings : UserNotificationSettings; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function cancelAllLocalNotifications () : void; - export function cancelLocalNotification (id: number) : void; - export function cancelLocalNotification (id: string) : void; - export function createUserNotificationAction (parameters?: Dictionary) : Ti.App.iOS.UserNotificationAction; - export function createUserNotificationCategory (parameters?: Dictionary) : Ti.App.iOS.UserNotificationCategory; - export function endBackgroundHandler (handlerID: string) : void; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getApplicationOpenSettingsURL () : string; - export function getBubbleParent () : boolean; - export function getCurrentUserNotificationSettings () : UserNotificationSettings; - export function registerBackgroundService (params: Dictionary) : Ti.App.iOS.BackgroundService; - export function registerUserNotificationSettings (params: UserNotificationSettings) : void; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function scheduleLocalNotification (params: NotificationParams) : Ti.App.iOS.LocalNotification; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setMinimumBackgroundFetchInterval (fetchInterval: number) : void; - export interface UserNotificationAction extends Ti.Proxy { - activationMode : number; - authenticationRequired : boolean; - destructive : boolean; - identifier : string; - title : string; - getActivationMode () : number; - getAuthenticationRequired () : boolean; - getDestructive () : boolean; - getIdentifier () : string; - getTitle () : string; + + /** + * iPad specific UI capabilities. + */ + namespace iPad { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * An arrow that points in any direction. + */ + const POPOVER_ARROW_DIRECTION_ANY: number; + + /** + * An arrow that points downward. + */ + const POPOVER_ARROW_DIRECTION_DOWN: number; + + /** + * An arrow that points toward the left. + */ + const POPOVER_ARROW_DIRECTION_LEFT: number; + + /** + * An arrow that points toward the right. + */ + const POPOVER_ARROW_DIRECTION_RIGHT: number; + + /** + * The status of the arrow is currently unknown. + */ + const POPOVER_ARROW_DIRECTION_UNKNOWN: number; + + /** + * An arrow that points upward. + */ + const POPOVER_ARROW_DIRECTION_UP: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Creates and returns an instance of . + */ + function createDocumentViewer(parameters?: any): Titanium.UI.iPad.DocumentViewer; + + /** + * Creates and returns an instance of . + */ + function createPopover(parameters?: any): Titanium.UI.iPad.Popover; + + /** + * Creates and returns an instance of . + */ + function createSplitWindow(parameters?: any): Titanium.UI.iPad.SplitWindow; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * A DocumentViewer provides in-app support for managing user interactions with files on the + * local system. + */ + interface DocumentViewer extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Displays the document viewer over the current view. + */ + show(animated: boolean, view: any): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Sets the url of the document viewer. + */ + setUrl(url: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + } - export interface LocalNotification extends Ti.Proxy { - cancel () : void; + + /** + * A Popover is used to manage the presentation of content in a popover. + */ + interface Popover extends Titanium.Proxy { + /** + * Sets the background color of the popover. + */ + backgroundColor: string; + + /** + * Height of the popover. + */ + height: number | string; + + /** + * Width of the popover. + */ + width: number | string; + + /** + * Indicates the arrow direction of the popover. + */ + arrowDirection: number; + + /** + * View to use for the popover content. Must be set before calling the `show()` method. + */ + contentView: Titanium.UI.View; + + /** + * Left button in the navigation area of the popover. + */ + leftNavButton: any; + + /** + * Passthrough views to use when the popover is shown. + */ + passthroughViews: Titanium.UI.View[]; + + /** + * Right button in the navigation area of the popover. + */ + rightNavButton: any; + + /** + * Title of the navigation area of the popover. + */ + title: string; + + /** + * Adds a child to the popover. + */ + add(view: any): void; + + /** + * Adds a child to the popover. + */ + add(view: any[]): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides the popover. + */ + hide(options: PopoverParams): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child from the popover. + */ + remove(view: any): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Displays the popover. + */ + show(params: PopoverParams): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getArrowDirection(): number; + + /** + * Sets the value of the property. + */ + setArrowDirection(arrowDirection: number): void; + + /** + * Gets the value of the property. + */ + getContentView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setContentView(contentView: any): void; + + /** + * Gets the value of the property. + */ + getLeftNavButton(): any; + + /** + * Sets the value of the property. + */ + setLeftNavButton(leftNavButton: any): void; + + /** + * Gets the value of the property. + */ + getPassthroughViews(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setPassthroughViews(passthroughViews: any[]): void; + + /** + * Gets the value of the property. + */ + getRightNavButton(): any; + + /** + * Sets the value of the property. + */ + setRightNavButton(rightNavButton: any): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + } - export interface UserNotificationCategory extends Ti.Proxy { - actionsForDefaultContext : Array; - actionsForMinimalContext : Array; - identifier : string; - getActionsForDefaultContext () : Array; - getActionsForMinimalContext () : Array; - getIdentifier () : string; - } - export interface BackgroundService extends Ti.Proxy { - url : string; - getUrl () : string; - stop () : void; - unregister () : void; + + /** + * A SplitWindow is a window that manages the presentation of two side-by-side view + * controllers. + */ + interface SplitWindow extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the window, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * Window's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * Window's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * The opacity from 0.0-1.0. + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * Window's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * Window's top position, in platform-specific units. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Title for the back button. This is only valid when the window is a child of a tab. + */ + backButtonTitle: string; + + /** + * The image to show as the back button. This is only valid when the window is a child of a tab. + */ + backButtonTitleImage: string | Titanium.Blob; + + /** + * Background color for the nav bar, as a color name or hex triplet. + */ + barColor: string; + + /** + * Background image for the nav bar, specified as a URL to a local image. + */ + barImage: string; + + /** + * An array of supported values specified using the EXTEND_EDGE constants in . Valid on iOS 7 and greater. + */ + extendEdges: number[]; + + /** + * Specifies if the edges should extend beyond opaque bars (navigation bar, tab bar, toolbar). Valid on iOS 7 and greater. + */ + includeOpaqueBars: boolean; + + /** + * Specifies whether or not the view controller should automatically adjust its scroll view insets. Valid on iOS 7 and greater. + */ + autoAdjustScrollViewInsets: boolean; + + /** + * Specifies whether the content (subviews) of the window will render inside the safe-area or not. + * Only used in iOS 11.0 and later. + */ + extendSafeArea: boolean; + + /** + * Boolean value indicating if the window is fullscreen. + */ + fullscreen: boolean; + + /** + * Set this to true to hide the shadow image of the navigation bar. + */ + hideShadow: boolean; + + /** + * Set this to true to hide the navigation bar on swipe. + */ + hidesBarsOnSwipe: boolean; + + /** + * Set this to true to hide the navigation bar on tap. + */ + hidesBarsOnTap: boolean; + + /** + * Set this to true to hide the navigation bar when the keyboard appears. + */ + hidesBarsWhenKeyboardAppears: boolean; + + /** + * A Boolean value indicating whether the title should be displayed in a large format. + */ + largeTitleEnabled: string; + + /** + * The mode to use when displaying the title of the navigation bar. + */ + largeTitleDisplayMode: number; + + /** + * View to show in the left nav bar area. + */ + leftNavButton: Titanium.UI.View; + + /** + * An Array of views to show in the left nav bar area. + */ + leftNavButtons: Titanium.UI.View[]; + + /** + * Indicates to open a modal window or not. + */ + modal: boolean; + + /** + * Hides the navigation bar (`true`) or shows the navigation bar (`false`). + */ + navBarHidden: boolean; + + /** + * The tintColor to apply to the navigation bar. This property is applicable on iOS 7 and greater. + */ + navTintColor: string; + + /** + * Array of supported orientation modes, specified using the orientation + * constants defined in . + */ + orientationModes: number[]; + + /** + * Current orientation of the window. + */ + readonly orientation: number; + + /** + * View to show in the right nav bar area. + */ + rightNavButton: Titanium.UI.View; + + /** + * An Array of views to show in the right nav bar area. + */ + rightNavButtons: Titanium.UI.View[]; + + /** + * Shadow image for the navigation bar, specified as a URL to a local image.. + */ + shadowImage: string; + + /** + * The status bar style associated with this window. + */ + statusBarStyle: number; + + /** + * Boolean value indicating if the tab bar should be hidden. + */ + tabBarHidden: boolean; + + /** + * Title of the window. + */ + title: string; + + /** + * Title text attributes of the window. + */ + titleAttributes: titleAttributesParams; + + /** + * View to show in the title area of the nav bar. + */ + titleControl: Titanium.UI.View; + + /** + * Image to show in the title area of the nav bar, specified as a local file path or URL. + */ + titleImage: string; + + /** + * Title prompt for the window. + */ + titlePrompt: string; + + /** + * Key identifying a string from the locale file to use for the window title. + */ + titleid: string; + + /** + * Key identifying a string from the locale file to use for the window title prompt. + */ + titlepromptid: string; + + /** + * Array of button objects to show in the window's toolbar. + */ + toolbar: any[]; + + /** + * Boolean value indicating if the nav bar is translucent. + */ + translucent: boolean; + + /** + * Loads a JavaScript file from a local URL. + */ + url: string; + + /** + * View for the detail view section of the SplitWindow. + */ + detailView: Titanium.UI.View; + + /** + * View for the master view section of the SplitWindow. + */ + masterView: Titanium.UI.View; + + /** + * Determines whether to show the master view in portrait orientation. + */ + showMasterInPortrait: boolean; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Closes the window. + */ + close(params?: any): void; + + /** + * Hides the navigation bar. + */ + hideNavBar(options?: any): void; + + /** + * Hides the tab bar. Must be called before opening the window. + */ + hideTabBar(): void; + + /** + * Opens the window. + */ + open(params?: openWindowParams): void; + + /** + * Sets the array of items to show in the window's toolbar. + */ + setToolbar(items: ReadonlyArray, params?: windowToolbarParam): void; + + /** + * Makes the navigation bar visible. + */ + showNavBar(options?: any): void; + + /** + * Makes the bottom toolbar visible. + */ + showToolbar(options?: any): void; + + /** + * Makes the bottom toolbar invisible. + */ + hideToolbar(options?: any): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getBackButtonTitle(): string; + + /** + * Sets the value of the property. + */ + setBackButtonTitle(backButtonTitle: string): void; + + /** + * Gets the value of the property. + */ + getBackButtonTitleImage(): string | Titanium.Blob; + + /** + * Sets the value of the property. + */ + setBackButtonTitleImage(backButtonTitleImage: string): void; + + /** + * Sets the value of the property. + */ + setBackButtonTitleImage(backButtonTitleImage: Titanium.Blob): void; + + /** + * Gets the value of the property. + */ + getBarColor(): string; + + /** + * Sets the value of the property. + */ + setBarColor(barColor: string): void; + + /** + * Gets the value of the property. + */ + getBarImage(): string; + + /** + * Sets the value of the property. + */ + setBarImage(barImage: string): void; + + /** + * Gets the value of the property. + */ + getExtendEdges(): number[]; + + /** + * Sets the value of the property. + */ + setExtendEdges(extendEdges: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getIncludeOpaqueBars(): boolean; + + /** + * Sets the value of the property. + */ + setIncludeOpaqueBars(includeOpaqueBars: boolean): void; + + /** + * Gets the value of the property. + */ + getAutoAdjustScrollViewInsets(): boolean; + + /** + * Sets the value of the property. + */ + setAutoAdjustScrollViewInsets(autoAdjustScrollViewInsets: boolean): void; + + /** + * Gets the value of the property. + */ + getExtendSafeArea(): boolean; + + /** + * Sets the value of the property. + */ + setExtendSafeArea(extendSafeArea: boolean): void; + + /** + * Gets the value of the property. + */ + getFullscreen(): boolean; + + /** + * Sets the value of the property. + */ + setFullscreen(fullscreen: boolean): void; + + /** + * Gets the value of the property. + */ + getHideShadow(): boolean; + + /** + * Sets the value of the property. + */ + setHideShadow(hideShadow: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsOnSwipe(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsOnSwipe(hidesBarsOnSwipe: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsOnTap(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsOnTap(hidesBarsOnTap: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsWhenKeyboardAppears(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsWhenKeyboardAppears(hidesBarsWhenKeyboardAppears: boolean): void; + + /** + * Gets the value of the property. + */ + getLargeTitleEnabled(): string; + + /** + * Sets the value of the property. + */ + setLargeTitleEnabled(largeTitleEnabled: string): void; + + /** + * Gets the value of the property. + */ + getLargeTitleDisplayMode(): number; + + /** + * Sets the value of the property. + */ + setLargeTitleDisplayMode(largeTitleDisplayMode: number): void; + + /** + * Gets the value of the property. + */ + getLeftNavButton(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setLeftNavButton(leftNavButton: any): void; + + /** + * Gets the value of the property. + */ + getLeftNavButtons(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setLeftNavButtons(leftNavButtons: any[]): void; + + /** + * Gets the value of the property. + */ + getModal(): boolean; + + /** + * Sets the value of the property. + */ + setModal(modal: boolean): void; + + /** + * Gets the value of the property. + */ + getNavBarHidden(): boolean; + + /** + * Sets the value of the property. + */ + setNavBarHidden(navBarHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getNavTintColor(): string; + + /** + * Sets the value of the property. + */ + setNavTintColor(navTintColor: string): void; + + /** + * Gets the value of the property. + */ + getOrientationModes(): number[]; + + /** + * Sets the value of the property. + */ + setOrientationModes(orientationModes: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getOrientation(): number; + + /** + * Gets the value of the property. + */ + getRightNavButton(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setRightNavButton(rightNavButton: any): void; + + /** + * Gets the value of the property. + */ + getRightNavButtons(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setRightNavButtons(rightNavButtons: any[]): void; + + /** + * Gets the value of the property. + */ + getShadowImage(): string; + + /** + * Sets the value of the property. + */ + setShadowImage(shadowImage: string): void; + + /** + * Gets the value of the property. + */ + getStatusBarStyle(): number; + + /** + * Sets the value of the property. + */ + setStatusBarStyle(statusBarStyle: number): void; + + /** + * Gets the value of the property. + */ + getTabBarHidden(): boolean; + + /** + * Sets the value of the property. + */ + setTabBarHidden(tabBarHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleAttributes(): titleAttributesParams; + + /** + * Sets the value of the property. + */ + setTitleAttributes(titleAttributes: titleAttributesParams): void; + + /** + * Gets the value of the property. + */ + getTitleControl(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setTitleControl(titleControl: any): void; + + /** + * Gets the value of the property. + */ + getTitleImage(): string; + + /** + * Sets the value of the property. + */ + setTitleImage(titleImage: string): void; + + /** + * Gets the value of the property. + */ + getTitlePrompt(): string; + + /** + * Sets the value of the property. + */ + setTitlePrompt(titlePrompt: string): void; + + /** + * Gets the value of the property. + */ + getTitleid(): string; + + /** + * Sets the value of the property. + */ + setTitleid(titleid: string): void; + + /** + * Gets the value of the property. + */ + getTitlepromptid(): string; + + /** + * Sets the value of the property. + */ + setTitlepromptid(titlepromptid: string): void; + + /** + * Gets the value of the property. + */ + getToolbar(): any[]; + + /** + * Sets the value of the property. + */ + setToolbar(toolbar: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getTranslucent(): boolean; + + /** + * Sets the value of the property. + */ + setTranslucent(translucent: boolean): void; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + /** + * Gets the value of the property. + */ + getDetailView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setDetailView(detailView: any): void; + + /** + * Gets the value of the property. + */ + getMasterView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setMasterView(masterView: any): void; + + /** + * Gets the value of the property. + */ + getShowMasterInPortrait(): boolean; + + /** + * Sets the value of the property. + */ + setShowMasterInPortrait(showMasterInPortrait: boolean): void; + } + } - export interface Properties { - getBool (property: string, _default?: boolean) : boolean; - getDouble (property: string, _default?: number) : number; - getInt (property: string, _default?: number) : number; - getList (property: string, _default?: Array) : Array; - getObject (property: string, _default?: any) : any; - getString (property: string, _default?: string) : string; - hasProperty (property: string) : boolean; - listProperties () : Array; - removeProperty (property: string) : void; - setBool (property: string, value: boolean) : void; - setDouble (property: string, value: number) : void; - setInt (property: string, value: number) : void; - setList (property: string, value: Array) : void; - setObject (property: string, value: any) : void; - setString (property: string, value: string) : void; - } - export interface Tizen { - categories : Array; - iconPath : string; - id : string; - installDate : Date; - name : string; - show : boolean; - size : number; - exit () : void; - getCategories () : Array; - getIconPath () : string; - getId () : string; - getInstallDate () : Date; - getName () : string; - getShow () : boolean; - getSize () : number; - hide () : void; + + /** + * The iPhone/iPad-specific UI capabilities. All properties, methods and events in this namespace + * will only work on Apple iOS systems. + */ + namespace iPhone { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * View presented with the same style as its parent window. + */ + const MODAL_PRESENTATION_CURRENT_CONTEXT: number; + + /** + * Window width and height are smaller than those of the screen and the view is centered on + * the screen. + */ + const MODAL_PRESENTATION_FORMSHEET: number; + + /** + * Window covers the screen. + */ + const MODAL_PRESENTATION_FULLSCREEN: number; + + /** + * Window height is the height of the screen and width is equal to screen width in a portrait + * orientation. + */ + const MODAL_PRESENTATION_PAGESHEET: number; + + /** + * When the window is presented, its view slides up from the bottom of the screen. On dismissal, + * the view slides back down (default.) + */ + const MODAL_TRANSITION_STYLE_COVER_VERTICAL: number; + + /** + * When the window is presented, the current view fades out while the new view fades in at the + * same time. On dismissal, a similar type of cross-fade is used to return to the original view. + */ + const MODAL_TRANSITION_STYLE_CROSS_DISSOLVE: number; + + /** + * When the window is presented, the current view initiates a horizontal 3D flip from + * right-to-left, resulting in the revealing of the new view as if it were on the back of the + * previous view. On dismissal, the flip occurs from left-to-right, returning to the original + * view. + */ + const MODAL_TRANSITION_STYLE_FLIP_HORIZONTAL: number; + + /** + * When the window is presented, one corner of the current view curls up to reveal the modal + * view underneath. On dismissal, the curled up page unfurls itself back on top of the modal + * view. + */ + const MODAL_TRANSITION_STYLE_PARTIAL_CURL: number; + + /** + * Value of the badge for the application's springboard icon. + */ + let appBadge: number; + + /** + * Determines whether the shake to edit system-wide capability is enabled. + */ + let appSupportsShakeToEdit: boolean; + + /** + * Determines whether the status bar is hidden. + */ + const statusBarHidden: boolean; + + /** + * Determines the status bar color style. + */ + const statusBarStyle: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Hides the status bar. + */ + function hideStatusBar(params?: hideStatusBarParams): void; + + /** + * Shows the status bar. + */ + function showStatusBar(params?: showStatusBarParams): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getAppBadge(): number; + + /** + * Sets the value of the property. + */ + function setAppBadge(appBadge: number): void; + + /** + * Gets the value of the property. + */ + function getAppSupportsShakeToEdit(): boolean; + + /** + * Sets the value of the property. + */ + function setAppSupportsShakeToEdit(appSupportsShakeToEdit: boolean): void; + + /** + * Gets the value of the property. + */ + function getStatusBarHidden(): boolean; + + /** + * Gets the value of the property. + */ + function getStatusBarStyle(): number; + + /** + * A set of constants for the style that can be used for the `selectionStyle` property of a + * ListItem, which is set in the `properties` dictionary of either the or + * . + */ + interface ListViewCellSelectionStyle extends Titanium.Proxy { + /** + * The cell when selected has a blue background. This is the default value. + */ + readonly BLUE: number; + + /** + * The cell when selected has a gray background. + */ + readonly GRAY: number; + + /** + * The cell has no distinct style for when it is selected. + */ + readonly NONE: number; + + } + + /** + * A set of constants for the position value that can be used for the `position` property of + * when invoking the ListView's `scrollToItem`, `appendSection`, + * `deleteSectionAt`, `insertSectionAt` and `replaceSectionAt` methods. + */ + interface ListViewScrollPosition extends Titanium.Proxy { + /** + * The list view scrolls the row of interest to the bottom of the visible list view. + */ + readonly BOTTOM: number; + + /** + * The list view scrolls the row of interest to the middle of the list table view. + */ + readonly MIDDLE: number; + + /** + * The table view scrolls the row of interest to be fully visible with a minimal movement. + * If the row is already fully visible, no scrolling occurs. For example, if the row is above the + * visible area, the behavior is identical to that specified by `TOP`. This is the default. + */ + readonly NONE: number; + + /** + * The list view scrolls the row of interest to the top of the visible list view. + */ + readonly TOP: number; + + } + + /** + * A set of constants for the style that can be used for the `style` property of + * . + */ + interface ListViewStyle extends Titanium.Proxy { + /** + * A list view whose sections present distinct groups of rows. The section headers and footers + * do not float. + */ + readonly GROUPED: number; + + /** + * A plain list view. Any section headers or footers are displayed as inline separators and + * float when the list view is scrolled. + */ + readonly PLAIN: number; + + } + + + /** + * A set of constants for the styles available for objects. + */ + namespace ActivityIndicatorStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Large white spinning indicator. + */ + const BIG: number; + + /** + * Small gray spinning indicator. + */ + const DARK: number; + + /** + * Small white spinning indicator (default.) + */ + const PLAIN: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the style that can be used for the `style` property of + * . + */ + namespace AlertDialogStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * A standard alert dialog. This is the default value. + */ + const DEFAULT: number; + + /** + * An alert dialog that allows the user to enter text. + */ + const PLAIN_TEXT_INPUT: number; + + /** + * An alert dialog that allows the user to enter text. The text field is obscured. + */ + const SECURE_TEXT_INPUT: number; + + /** + * An alert dialog that allows the user to enter login identifier and password. + */ + const LOGIN_AND_PASSWORD_INPUT: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the animation styles used for view transitions. + */ + namespace AnimationStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Curl downwards during a transition animation. + */ + const CURL_DOWN: number; + + /** + * Curl upwards during a transition animation. + */ + const CURL_UP: number; + + /** + * Flip from left to right during a transition animation. + */ + const FLIP_FROM_LEFT: number; + + /** + * Flip from right to left during a transition animation. + */ + const FLIP_FROM_RIGHT: number; + + /** + * No animation. + */ + const NONE: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the style that can be used for the `separatorStyle` property of + * . + */ + namespace ListViewSeparatorStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The separator cell has no distinct style. + */ + const NONE: number; + + /** + * The separator cell has a single line running across its width. This is the default value. + */ + const SINGLE_LINE: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the bar styles used on the `style` property of . + */ + namespace ProgressBarStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The style of progress view that is used in a toolbar. + */ + const BAR: number; + + /** + * he standard progress-view style. This is the default. + */ + const DEFAULT: number; + + /** + * The standard progress-view style. Same as `DEFAULT`. + */ + const PLAIN: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the Animation Styles used for transition on table view rows. + */ + namespace RowAnimationStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The inserted row or rows slides in from the bottom; the deleted row or rows slides out + * toward the bottom. + */ + const BOTTOM: number; + + /** + * The inserted or deleted row or rows fades into or out of the table view. + */ + const FADE: number; + + /** + * The inserted row or rows slides in from the left; the deleted row or rows slides out to the + * left. + */ + const LEFT: number; + + /** + * No animation is performed. The new cell value appears as if the cell had just been reloaded. + */ + const NONE: number; + + /** + * The inserted row or rows slides in from the right; the deleted row or rows slides out to + * the right. + */ + const RIGHT: number; + + /** + * The inserted row or rows slides in from the top; the deleted row or rows slides out toward + * the top. + */ + const TOP: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the styles available for scrollbars used with and properties. + */ + namespace ScrollIndicatorStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * A style of indicator which is black smaller than the default style. This style is good + * against a white content background. + */ + const BLACK: number; + + /** + * The default style of scroll indicator, which is black with a white border. This style is + * good against any content background. + */ + const DEFAULT: number; + + /** + * A style of indicator is white and smaller than the default style. This style is good against + * a black content background. + */ + const WHITE: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the status bar style. + */ + namespace StatusBar { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * No animation style, when the status bar is hidden or shown. + */ + const ANIMATION_STYLE_NONE: number; + + /** + * Slide animation style, when the status bar is hidden or shown. + */ + const ANIMATION_STYLE_SLIDE: number; + + /** + * Fade animation style, when the status bar is hidden or shown. + */ + const ANIMATION_STYLE_FADE: number; + + /** + * Default status bar style. + */ + const DEFAULT: number; + + /** + * Gray-colored status bar style. + */ + const GRAY: number; + + /** + * Gray-colored status bar style. + */ + const GREY: number; + + /** + * Status bar style to use with dark backgrounds. Valid on iOS 7 and above. + */ + const LIGHT_CONTENT: number; + + /** + * Opaque black-colored status bar style. + */ + const OPAQUE_BLACK: number; + + /** + * Translucent black-colored status bar style, which provides some degree of transparency to + * the device background. + */ + const TRANSLUCENT_BLACK: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for creating standard iOS system buttons. + */ + namespace SystemButton { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify an **Action** button. + */ + const ACTION: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to create an activity indicator that + * can be used in navigation bars and toolbars. + */ + const ACTIVITY: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify an **Add** button. + */ + const ADD: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Bookmarks** button. + */ + const BOOKMARKS: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Camera** button. + */ + const CAMERA: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Cancel** button. + */ + const CANCEL: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Compose** button. + */ + const COMPOSE: number; + + /** + * Use with [Button.style](Titanium.UI.Button.style) to specify a **ContactAdd** button. + */ + const CONTACT_ADD: number; + + /** + * Use with [Button.style](Titanium.UI.Button.style) to specify a **Disclosure** button. + */ + const DISCLOSURE: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Done** button. + */ + const DONE: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify an **Edit** button. + */ + const EDIT: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Fast Forward** button. + */ + const FAST_FORWARD: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to create a fixed-width blank space + * for spacing items in toolbars. + */ + const FIXED_SPACE: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to create a flexible blank space + * for spacing items in toolbars. + */ + const FLEXIBLE_SPACE: number; + + /** + * Use with [Button.style](Titanium.UI.Button.style) to specify a dark-colored **Info** button. + */ + const INFO_DARK: number; + + /** + * Use with [Button.style](Titanium.UI.Button.style) to specify a light-colored **Info** button. + */ + const INFO_LIGHT: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify an **Organize** button. + */ + const ORGANIZE: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Pause** button. + */ + const PAUSE: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Play** button. + */ + const PLAY: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Refresh** button. + */ + const REFRESH: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Reply** button. + */ + const REPLY: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Rewind** button. + */ + const REWIND: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Save** button. + */ + const SAVE: number; + + /** + * Identical to [ACTIVITY](Titanium.UI.iPhone.SystemButton.ACTIVITY). + */ + const SPINNER: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Stop** button. + */ + const STOP: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Trash** button. + */ + const TRASH: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the system button styles that can be used for the button `style` property. + */ + namespace SystemButtonStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Used with [ButtonBar](Titanium.UI.ButtonBar) or [TabbedBar](Titanium.UI.iOS.TabbedBar) only, + * to use the more condensed style used in nav bars and tool bars. + */ + const BAR: number; + + /** + * A simple button style with a border. + */ + const BORDERED: number; + + /** + * The style for a **Done** button--for example, a button that completes some task and returns + * to the previous view. + */ + const DONE: number; + + /** + * Specifies a borderless button, the default style for toolbars, button bars, and tabbed bars. + */ + const PLAIN: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the system icon styles that can be used on a tab group tab. + */ + namespace SystemIcon { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Bookmark style icon + */ + const BOOKMARKS: number; + + /** + * Contacts style icon + */ + const CONTACTS: number; + + /** + * Downloads style icon + */ + const DOWNLOADS: number; + + /** + * Favorites style icon + */ + const FAVORITES: number; + + /** + * Featured style icon + */ + const FEATURED: number; + + /** + * History style icon + */ + const HISTORY: number; + + /** + * More style icon + */ + const MORE: number; + + /** + * Most recent style icon + */ + const MOST_RECENT: number; + + /** + * Most viewed style icon + */ + const MOST_VIEWED: number; + + /** + * Recents style icon + */ + const RECENTS: number; + + /** + * Search style icon + */ + const SEARCH: number; + + /** + * Top rated style icon + */ + const TOP_RATED: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the style that can be used for the `selectionStyle` property of + * . + */ + namespace TableViewCellSelectionStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The cell when selected has a blue background. This is the default value. + */ + const BLUE: number; + + /** + * Then cell when selected has a gray background. + */ + const GRAY: number; + + /** + * The cell has no distinct style for when it is selected. + */ + const NONE: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the position value that can be used for the `position` property of + * when invoking `scrollToIndex`. + */ + namespace TableViewScrollPosition { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The table view scrolls the row of interest to the bottom of the visible table view. + */ + const BOTTOM: number; + + /** + * The table view scrolls the row of interest to the middle of the visible table view. + */ + const MIDDLE: number; + + /** + * The table view scrolls the row of interest to be fully visible with a minimum of movement. If the row is already fully visible, no scrolling occurs. For example, if the row is above the visible area, the behavior is identical to that specified by `TOP`. This is the default. + */ + const NONE: number; + + /** + * The table view scrolls the row of interest to the top of the visible table view. + */ + const TOP: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the style that can be used for the `separatorStyle` property of + * . + */ + namespace TableViewSeparatorStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The separator cell has no distinct style. + */ + const NONE: number; + + /** + * The separator cell has a single line running across its width. This is the default value. + */ + const SINGLE_LINE: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the style that can be used for the button `style` property of + * . + */ + namespace TableViewStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * A table view whose sections present distinct groups of rows. The section headers and footers + * do not float. + */ + const GROUPED: number; + + /** + * A plain table view. Any section headers or footers are displayed as inline separators and + * float when the table view is scrolled. + */ + const PLAIN: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } } } - export module Android { - export var ACTION_AIRPLANE_MODE_CHANGED : string; - export var ACTION_ALL_APPS : string; - export var ACTION_ANSWER : string; - export var ACTION_ATTACH_DATA : string; - export var ACTION_BATTERY_CHANGED : string; - export var ACTION_BATTERY_LOW : string; - export var ACTION_BATTERY_OKAY : string; - export var ACTION_BOOT_COMPLETED : string; - export var ACTION_BUG_REPORT : string; - export var ACTION_CALL : string; - export var ACTION_CALL_BUTTON : string; - export var ACTION_CAMERA_BUTTON : string; - export var ACTION_CHOOSER : string; - export var ACTION_CLOSE_SYSTEM_DIALOGS : string; - export var ACTION_CONFIGURATION_CHANGED : string; - export var ACTION_CREATE_SHORTCUT : string; - export var ACTION_DATE_CHANGED : string; - export var ACTION_DEFAULT : string; - export var ACTION_DELETE : string; - export var ACTION_DEVICE_STORAGE_LOW : string; - export var ACTION_DIAL : string; - export var ACTION_EDIT : string; - export var ACTION_GET_CONTENT : string; - export var ACTION_GTALK_SERVICE_CONNECTED : string; - export var ACTION_GTALK_SERVICE_DISCONNECTED : string; - export var ACTION_HEADSET_PLUG : string; - export var ACTION_INPUT_METHOD_CHANGED : string; - export var ACTION_INSERT : string; - export var ACTION_INSERT_OR_EDIT : string; - export var ACTION_MAIN : string; - export var ACTION_MANAGE_PACKAGE_STORAGE : string; - export var ACTION_MEDIA_BAD_REMOVAL : string; - export var ACTION_MEDIA_BUTTON : string; - export var ACTION_MEDIA_CHECKING : string; - export var ACTION_MEDIA_EJECT : string; - export var ACTION_MEDIA_MOUNTED : string; - export var ACTION_MEDIA_NOFS : string; - export var ACTION_MEDIA_REMOVED : string; - export var ACTION_MEDIA_SCANNER_FINISHED : string; - export var ACTION_MEDIA_SCANNER_SCAN_FILE : string; - export var ACTION_MEDIA_SCANNER_STARTED : string; - export var ACTION_MEDIA_SHARED : string; - export var ACTION_MEDIA_UNMOUNTABLE : string; - export var ACTION_MEDIA_UNMOUNTED : string; - export var ACTION_NEW_OUTGOING_CALL : string; - export var ACTION_PACKAGE_ADDED : string; - export var ACTION_PACKAGE_CHANGED : string; - export var ACTION_PACKAGE_DATA_CLEARED : string; - export var ACTION_PACKAGE_INSTALL : string; - export var ACTION_PACKAGE_REMOVED : string; - export var ACTION_PACKAGE_REPLACED : string; - export var ACTION_PACKAGE_RESTARTED : string; - export var ACTION_PICK : string; - export var ACTION_PICK_ACTIVITY : string; - export var ACTION_POWER_CONNECTED : string; - export var ACTION_POWER_DISCONNECTED : string; - export var ACTION_POWER_USAGE_SUMMARY : string; - export var ACTION_PROVIDER_CHANGED : string; - export var ACTION_REBOOT : string; - export var ACTION_RUN : string; - export var ACTION_SCREEN_OFF : string; - export var ACTION_SCREEN_ON : string; - export var ACTION_SEARCH : string; - export var ACTION_SEARCH_LONG_PRESS : string; - export var ACTION_SEND : string; - export var ACTION_SENDTO : string; - export var ACTION_SEND_MULTIPLE : string; - export var ACTION_SET_WALLPAPER : string; - export var ACTION_SHUTDOWN : string; - export var ACTION_SYNC : string; - export var ACTION_SYSTEM_TUTORIAL : string; - export var ACTION_TIME_CHANGED : string; - export var ACTION_TIME_TICK : string; - export var ACTION_UID_REMOVED : string; - export var ACTION_UMS_CONNECTED : string; - export var ACTION_UMS_DISCONNECTED : string; - export var ACTION_USER_PRESENT : string; - export var ACTION_VIEW : string; - export var ACTION_VOICE_COMMAND : string; - export var ACTION_WALLPAPER_CHANGED : string; - export var ACTION_WEB_SEARCH : string; - export var CATEGORY_ALTERNATIVE : string; - export var CATEGORY_BROWSABLE : string; - export var CATEGORY_DEFAULT : string; - export var CATEGORY_DEVELOPMENT_PREFERENCE : string; - export var CATEGORY_EMBED : string; - export var CATEGORY_FRAMEWORK_INSTRUMENTATION_TEST : string; - export var CATEGORY_HOME : string; - export var CATEGORY_INFO : string; - export var CATEGORY_LAUNCHER : string; - export var CATEGORY_MONKEY : string; - export var CATEGORY_OPENABLE : string; - export var CATEGORY_PREFERENCE : string; - export var CATEGORY_SAMPLE_CODE : string; - export var CATEGORY_SELECTED_ALTERNATIVE : string; - export var CATEGORY_TAB : string; - export var CATEGORY_TEST : string; - export var CATEGORY_UNIT_TEST : string; - export var DEFAULT_ALL : number; - export var DEFAULT_LIGHTS : number; - export var DEFAULT_SOUND : number; - export var DEFAULT_VIBRATE : number; - export var EXTRA_ALARM_COUNT : string; - export var EXTRA_BCC : string; - export var EXTRA_CC : string; - export var EXTRA_DATA_REMOVED : string; - export var EXTRA_DONT_KILL_APP : string; - export var EXTRA_EMAIL : string; - export var EXTRA_INTENT : string; - export var EXTRA_KEY_EVENT : string; - export var EXTRA_PHONE_NUMBER : string; - export var EXTRA_REPLACING : string; - export var EXTRA_SHORTCUT_ICON : string; - export var EXTRA_SHORTCUT_ICON_RESOURCE : string; - export var EXTRA_SHORTCUT_INTENT : string; - export var EXTRA_SHORTCUT_NAME : string; - export var EXTRA_STREAM : string; - export var EXTRA_SUBJECT : string; - export var EXTRA_TEMPLATE : string; - export var EXTRA_TEXT : string; - export var EXTRA_TITLE : string; - export var EXTRA_UID : string; - export var FILL_IN_ACTION : number; - export var FILL_IN_CATEGORIES : number; - export var FILL_IN_COMPONENT : number; - export var FILL_IN_DATA : number; - export var FILL_IN_PACKAGE : number; - export var FLAG_ACTIVITY_BROUGHT_TO_FRONT : number; - export var FLAG_ACTIVITY_CLEAR_TOP : number; - export var FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET : number; - export var FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS : number; - export var FLAG_ACTIVITY_FORWARD_RESULT : number; - export var FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY : number; - export var FLAG_ACTIVITY_MULTIPLE_TASK : number; - export var FLAG_ACTIVITY_NEW_TASK : number; - export var FLAG_ACTIVITY_NO_ANIMATION : number; - export var FLAG_ACTIVITY_NO_HISTORY : number; - export var FLAG_ACTIVITY_NO_USER_ACTION : number; - export var FLAG_ACTIVITY_PREVIOUS_IS_TOP : number; - export var FLAG_ACTIVITY_REORDER_TO_FRONT : number; - export var FLAG_ACTIVITY_RESET_TASK_IF_NEEDED : number; - export var FLAG_ACTIVITY_SINGLE_TOP : number; - export var FLAG_AUTO_CANCEL : number; - export var FLAG_CANCEL_CURRENT : number; - export var FLAG_DEBUG_LOG_RESOLUTION : number; - export var FLAG_FROM_BACKGROUND : number; - export var FLAG_GRANT_READ_URI_PERMISSION : number; - export var FLAG_GRANT_WRITE_URI_PERMISSION : number; - export var FLAG_INSISTENT : number; - export var FLAG_NO_CLEAR : number; - export var FLAG_NO_CREATE : number; - export var FLAG_ONE_SHOT : number; - export var FLAG_ONGOING_EVENT : number; - export var FLAG_ONLY_ALERT_ONCE : number; - export var FLAG_RECEIVER_REGISTERED_ONLY : number; - export var FLAG_SHOW_LIGHTS : number; - export var FLAG_UPDATE_CURRENT : number; - export var NAVIGATION_MODE_STANDARD : number; - export var NAVIGATION_MODE_TABS : number; - export var PENDING_INTENT_FOR_ACTIVITY : number; - export var PENDING_INTENT_FOR_BROADCAST : number; - export var PENDING_INTENT_FOR_SERVICE : number; - export var PENDING_INTENT_MAX_VALUE : number; - export var R : Ti.Android.R; - export var RESULT_CANCELED : number; - export var RESULT_FIRST_USER : number; - export var RESULT_OK : number; - export var SCREEN_ORIENTATION_BEHIND : number; - export var SCREEN_ORIENTATION_LANDSCAPE : number; - export var SCREEN_ORIENTATION_NOSENSOR : number; - export var SCREEN_ORIENTATION_PORTRAIT : number; - export var SCREEN_ORIENTATION_SENSOR : number; - export var SCREEN_ORIENTATION_UNSPECIFIED : number; - export var SCREEN_ORIENTATION_USER : number; - export var SHOW_AS_ACTION_ALWAYS : number; - export var SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW : number; - export var SHOW_AS_ACTION_IF_ROOM : number; - export var SHOW_AS_ACTION_NEVER : number; - export var SHOW_AS_ACTION_WITH_TEXT : number; - export var START_NOT_STICKY : number; - export var START_REDELIVER_INTENT : number; - export var STREAM_ALARM : number; - export var STREAM_DEFAULT : number; - export var STREAM_MUSIC : number; - export var STREAM_NOTIFICATION : number; - export var STREAM_RING : number; - export var STREAM_SYSTEM : number; - export var STREAM_VOICE_CALL : number; - export var URI_INTENT_SCHEME : number; - export var apiName : string; - export var bubbleParent : boolean; - export var currentActivity : Ti.Android.Activity; - export var currentService : Ti.Android.Service; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createBroadcastIntent (options: BroadcastIntentOptions) : Ti.Android.Intent; - export function createBroadcastReceiver (parameters?: Dictionary) : Ti.Android.BroadcastReceiver; - export function createIntent (parameters?: Dictionary) : Ti.Android.Intent; - export function createIntentChooser (intent: Ti.Android.Intent, title: string) : Ti.Android.Intent; - export function createNotification (parameters?: Dictionary) : Ti.Android.Notification; - export function createPendingIntent (parameters?: Dictionary) : Ti.Android.PendingIntent; - export function createRemoteViews (parameters?: Dictionary) : Ti.Android.RemoteViews; - export function createService (intent: Ti.Android.Intent) : Ti.Android.Service; - export function createServiceIntent (options: ServiceIntentOptions) : Ti.Android.Intent; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function getCurrentActivity () : Ti.Android.Activity; - export function getCurrentService () : Ti.Android.Service; - export function isServiceRunning (intent: Ti.Android.Intent) : boolean; - export function registerBroadcastReceiver (broadcastReceiver: Ti.Android.BroadcastReceiver, actions: Array) : void; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function startService (intent: Ti.Android.Intent) : void; - export function stopService (intent: Ti.Android.Intent) : void; - export function unregisterBroadcastReceiver (broadcastReceiver: Ti.Android.BroadcastReceiver) : void; - export interface Intent extends Ti.Proxy { - action : string; - className : string; - data : string; - flags : number; - packageName : string; - type : string; - url : string; - addCategory (name: string) : void; - addFlags (flags: number) : void; - getAction () : string; - getBlobExtra (name: string) : Ti.Blob; - getBooleanExtra (name: string) : boolean; - getClassName () : string; - getData () : string; - getDoubleExtra (name: string) : number; - getFlags () : number; - getIntExtra (name: string) : number; - getLongExtra (name: string) : number; - getPackageName () : string; - getStringExtra (name: string) : string; - getType () : string; - getUrl () : string; - hasExtra (name: string) : boolean; - putExtra (name: string, value: any) : void; - putExtraUri (name: string, value: string) : void; - setFlags (flags: number) : void; - } - export interface Notification extends Ti.Proxy { - audioStreamType : number; - contentIntent : Ti.Android.PendingIntent; - contentText : string; - contentTitle : string; - contentView : Ti.Android.RemoteViews; - defaults : number; - deleteIntent : Ti.Android.PendingIntent; - flags : number; - icon : any; - ledARGB : number; - ledOffMS : number; - ledOnMS : number; - number : number; - sound : string; - tickerText : string; - when : any; - getAudioStreamType () : number; - getContentIntent () : Ti.Android.PendingIntent; - getContentText () : string; - getContentTitle () : string; - getDefaults () : number; - getDeleteIntent () : Ti.Android.PendingIntent; - getFlags () : number; - getIcon () : any; - getLedARGB () : number; - getLedOffMS () : number; - getLedOnMS () : number; - getNumber () : number; - getSound () : string; - getTickerText () : string; - getWhen () : any; - setAudioStreamType (audioStreamType: number) : void; - setContentIntent (contentIntent: Ti.Android.PendingIntent) : void; - setContentText (contentText: string) : void; - setContentTitle (contentTitle: string) : void; - setContentView (contentView: Ti.Android.RemoteViews) : void; - setDefaults (defaults: number) : void; - setDeleteIntent (deleteIntent: Ti.Android.PendingIntent) : void; - setFlags (flags: number) : void; - setIcon (icon: number) : void; - setIcon (icon: string) : void; - setLatestEventInfo (contentTitle: string, contentText: string, contentIntent: Ti.Android.PendingIntent) : void; - setLedARGB (ledARGB: number) : void; - setLedOffMS (ledOffMS: number) : void; - setLedOnMS (ledOnMS: number) : void; - setNumber (number: number) : void; - setSound (sound: string) : void; - setTickerText (tickerText: string) : void; - setWhen (when: Date) : void; - setWhen (when: number) : void; - } - export module Calendar { - export var METHOD_ALERT : number; - export var METHOD_DEFAULT : number; - export var METHOD_EMAIL : number; - export var METHOD_SMS : number; - export var STATE_DISMISSED : number; - export var STATE_FIRED : number; - export var STATE_SCHEDULED : number; - export var STATUS_CANCELED : number; - export var STATUS_CONFIRMED : number; - export var STATUS_TENTATIVE : number; - export var VISIBILITY_CONFIDENTIAL : number; - export var VISIBILITY_DEFAULT : number; - export var VISIBILITY_PRIVATE : number; - export var VISIBILITY_PUBLIC : number; - export var allAlerts : Array; - export var allCalendars : Array; - export var apiName : string; - export var bubbleParent : boolean; - export var selectableCalendars : Array; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function fireEvent (name: string, event: Dictionary) : void; - export function getAllAlerts () : Array; - export function getAllCalendars () : Array; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function getCalendarById (id: number) : Ti.Android.Calendar.Calendar; - export function getSelectableCalendars () : Array; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface Event extends Ti.Proxy { - alerts : Array; - allDay : boolean; - begin : Date; - description : string; - end : Date; - extendedProperties : Dictionary; - hasAlarm : boolean; - hasExtendedProperties : boolean; - id : string; - location : string; - reminders : Array; - status : number; - title : string; - visibility : number; - createAlert (data: Dictionary) : Ti.Android.Calendar.Alert; - createReminder (data: Dictionary) : Ti.Android.Calendar.Reminder; - getAlerts () : Array; - getAllDay () : boolean; - getBegin () : Date; - getDescription () : string; - getEnd () : Date; - getExtendedProperties () : Dictionary; - getExtendedProperty (name: string) : string; - getHasAlarm () : boolean; - getHasExtendedProperties () : boolean; - getId () : string; - getLocation () : string; - getReminders () : Array; - getStatus () : number; - getTitle () : string; - getVisibility () : number; - setExtendedProperty (name: string, value: string) : void; - } - export interface Reminder extends Ti.Proxy { - id : string; - method : number; - minutes : number; - getId () : string; - getMethod () : number; - getMinutes () : number; - } - export interface Calendar extends Ti.Proxy { - hidden : boolean; - id : string; - name : string; - selected : boolean; - createEvent (properties: Dictionary) : Ti.Android.Calendar.Event; - getEventById (id: number) : Ti.Android.Calendar.Event; - getEventsBetweenDates (date1: Date, date2: Date) : Array; - getEventsInDate (year: number, month: number, day: number) : Array; - getEventsInMonth (year: number, month: number) : Array; - getEventsInYear (year: number) : Array; - getHidden () : boolean; - getId () : string; - getName () : string; - getSelected () : boolean; - } - export interface Alert extends Ti.Proxy { - alarmTime : Date; - begin : Date; - end : Date; - eventId : number; - id : string; - minutes : number; - state : number; - getAlarmTime () : Date; - getBegin () : Date; - getEnd () : Date; - getEventId () : number; - getId () : string; - getMinutes () : number; - getState () : number; - } - } - export interface MenuItem extends Ti.Proxy { - actionView : Ti.UI.View; - actionViewExpanded : boolean; - checkable : boolean; - checked : boolean; - enabled : boolean; - groupId : number; - icon : any; - itemId : number; - order : number; - showAsAction : number; - title : string; - titleCondensed : string; - visible : boolean; - collapseActionView () : void; - expandActionView () : void; - getActionView () : Ti.UI.View; - getGroupId () : number; - getItemId () : number; - getOrder () : number; - getTitle () : string; - getTitleCondensed () : string; - isActionViewExpanded () : boolean; - isCheckable () : boolean; - isChecked () : boolean; - isEnabled () : boolean; - isVisible () : boolean; - setActionView (actionView: Ti.UI.View) : void; - setCheckable (checkable: boolean) : void; - setChecked (enabled: boolean) : void; - setEnabled (enabled: boolean) : void; - setIcon (icon: number) : void; - setIcon (icon: string) : void; - setShowAsAction (showAsAction: number) : void; - setTitle (title: string) : void; - setTitleCondensed (titleCondensed: string) : void; - setVisible (visible: boolean) : void; - } - export interface NotificationManager { - DEFAULT_ALL : number; - DEFAULT_LIGHTS : number; - DEFAULT_SOUND : number; - DEFAULT_VIBRATE : number; - FLAG_AUTO_CANCEL : number; - FLAG_INSISTENT : number; - FLAG_NO_CLEAR : number; - FLAG_ONGOING_EVENT : number; - FLAG_ONLY_ALERT_ONCE : number; - FLAG_SHOW_LIGHTS : number; - STREAM_DEFAULT : number; - cancel (id: number) : void; - cancelAll () : void; - notify (id: number, notification: Ti.Android.Notification) : void; - } - export interface R extends Ti.Proxy { - anim : any; - array : any; - attr : any; - color : any; - dimen : any; - drawable : any; - id : any; - integer : any; - layout : any; - string : any; - style : any; - styleable : any; - } - export interface ActionBar extends Ti.Proxy { - backgroundImage : string; - displayHomeAsUp : boolean; - homeButtonEnabled : boolean; - icon : string; - logo : string; - navigationMode : number; - onHomeIconItemSelected : (...args : any[]) => any; - subtitle : string; - title : string; - getNavigationMode () : number; - getSubtitle () : string; - getTitle () : string; - hide () : void; - setBackgroundImage (backgroundImage: string) : void; - setDisplayHomeAsUp (displayHomeAsUp: boolean) : void; - setDisplayShowHomeEnabled (show: boolean) : void; - setDisplayShowTitleEnabled (show: boolean) : void; - setHomeButtonEnabled (homeButtonEnabled: boolean) : void; - setIcon (icon: string) : void; - setLogo (logo: string) : void; - setNavigationMode (navigationMode: number) : void; - setOnHomeIconItemSelected (onHomeIconItemSelected: (...args : any[]) => any) : void; - setSubtitle (subtitle: string) : void; - setTitle (title: string) : void; - show () : void; - } - export interface BroadcastReceiver extends Ti.Proxy { - onReceived : (...args : any[]) => any; - url : string; - getOnReceived () : (...args : any[]) => any; - getUrl () : string; - setOnReceived (onReceived: (...args : any[]) => any) : void; - setUrl (url: string) : void; - } - export interface Menu extends Ti.Proxy { - items : Array; - add (options: any) : Ti.Android.MenuItem; - clear () : void; - close () : void; - findItem (item: number) : Ti.Android.MenuItem; - findItem (item: Ti.Android.MenuItem) : Ti.Android.MenuItem; - getItem (index: number) : Ti.Android.MenuItem; - getItems () : Array; - hasVisibleItems () : boolean; - removeGroup (groupId: number) : void; - removeItem (itemId: number) : void; - setGroupEnabled (groupId: number, enabled: boolean) : void; - setGroupVisible (groupId: number, visible: boolean) : void; - size () : number; - } - export interface Activity extends Ti.Proxy { - actionBar : Ti.Android.ActionBar; - intent : Ti.Android.Intent; - onCreate : (...args : any[]) => any; - onCreateOptionsMenu : (...args : any[]) => any; - onDestroy : (...args : any[]) => any; - onPause : (...args : any[]) => any; - onPrepareOptionsMenu : (...args : any[]) => any; - onRestart : (...args : any[]) => any; - onResume : (...args : any[]) => any; - onStart : (...args : any[]) => any; - onStop : (...args : any[]) => any; - requestedOrientation : number; - finish () : void; - getActionBar () : Ti.Android.ActionBar; - getIntent () : Ti.Android.Intent; - getOnCreate () : (...args : any[]) => any; - getOnCreateOptionsMenu () : (...args : any[]) => any; - getOnDestroy () : (...args : any[]) => any; - getOnPause () : (...args : any[]) => any; - getOnPrepareOptionsMenu () : (...args : any[]) => any; - getOnRestart () : (...args : any[]) => any; - getOnResume () : (...args : any[]) => any; - getOnStart () : (...args : any[]) => any; - getOnStop () : (...args : any[]) => any; - getString (resourceId: number, format: any) : string; - invalidateOptionsMenu () : void; - openOptionsMenu () : void; - sendBroadcast (intent: Ti.Android.Intent) : void; - sendBroadcastWithPermission (intent: Ti.Android.Intent, receiverPermission?: string) : void; - setOnCreate (onCreate: (...args : any[]) => any) : void; - setOnCreateOptionsMenu (onCreateOptionsMenu: (...args : any[]) => any) : void; - setOnDestroy (onDestroy: (...args : any[]) => any) : void; - setOnPause (onPause: (...args : any[]) => any) : void; - setOnPrepareOptionsMenu (onPrepareOptionsMenu: (...args : any[]) => any) : void; - setOnRestart (onRestart: (...args : any[]) => any) : void; - setOnResume (onResume: (...args : any[]) => any) : void; - setOnStart (onStart: (...args : any[]) => any) : void; - setOnStop (onStop: (...args : any[]) => any) : void; - setRequestedOrientation (orientation: number) : void; - setResult (resultCode: number, intent?: Ti.Android.Intent) : void; - startActivity (intent: Ti.Android.Intent) : void; - startActivityForResult (intent: Ti.Android.Intent, callback: (...args : any[]) => any) : void; - } - export interface Service extends Ti.Proxy { - intent : Ti.Android.Intent; - serviceInstanceId : number; - getIntent () : Ti.Android.Intent; - getServiceInstanceId () : number; - start () : void; - stop () : void; - } - export interface RemoteViews extends Ti.Proxy { - layoutId : number; - packageName : string; - getLayoutId () : number; - getPackageName () : string; - setBoolean (viewId: number, methodName: string, value: boolean) : void; - setChronometer (viewId: number, base: Date, format: string, started: boolean) : void; - setDouble (viewId: number, methodName: string, value: number) : void; - setImageViewResource (viewId: number, srcId: number) : void; - setImageViewUri (viewId: number, uri: string) : void; - setInt (viewId: number, methodName: string, value: number) : void; - setOnClickPendingIntent (viewId: number, pendingIntent: Ti.Android.PendingIntent) : void; - setProgressBar (viewId: number, max: number, progress: number, indeterminate: boolean) : void; - setString (viewId: number, methodName: string, value: string) : void; - setTextColor (viewId: number, color: number) : void; - setTextViewText (viewId: number, text: string) : void; - setUri (viewId: number, methodName: string, value: string) : void; - setViewVisibility (viewId: number, visibility: number) : void; - } - export interface PendingIntent extends Ti.Proxy { - flags : number; - intent : Ti.Android.Intent; - updateCurrentIntent : boolean; - getFlags () : number; - getIntent () : Ti.Android.Intent; - getUpdateCurrentIntent () : boolean; - } - } - export module Database { - export var FIELD_TYPE_DOUBLE : number; - export var FIELD_TYPE_FLOAT : number; - export var FIELD_TYPE_INT : number; - export var FIELD_TYPE_STRING : number; - export var apiName : string; - export var bubbleParent : boolean; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function install (path: string, dbName: string) : Ti.Database.DB; - export function open (dbName: string) : Ti.Database.DB; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface ResultSet extends Ti.Proxy { - rowCount : number; - validRow : boolean; - close () : void; - field (index: number, type?: number) : any; - fieldByName (name: string, type?: number) : any; - fieldCount () : number; - fieldName (index: number) : string; - getFieldCount () : number; - getFieldName (index: number) : string; - getRowCount () : number; - getValidRow () : boolean; - isValidRow () : boolean; - next () : boolean; - } - export interface DB extends Ti.Proxy { - file : Ti.Filesystem.File; - lastInsertRowId : number; - name : string; - rowsAffected : number; - close () : void; - execute (sql: string, vararg?: string) : Ti.Database.ResultSet; - execute (vararg?: Array) : Ti.Database.ResultSet; - execute (vararg?: any) : Ti.Database.ResultSet; - execute (sql: string, vararg?: Array) : Ti.Database.ResultSet; - getFile () : Ti.Filesystem.File; - getLastInsertRowId () : number; - getName () : string; - getRowsAffected () : number; - remove () : void; - setLastInsertRowId (lastInsertRowId: number) : void; - setName (name: string) : void; - setRowsAffected (rowsAffected: number) : void; - } - } - export module Contacts { - export var AUTHORIZATION_AUTHORIZED : number; - export var AUTHORIZATION_DENIED : number; - export var AUTHORIZATION_RESTRICTED : number; - export var AUTHORIZATION_UNKNOWN : number; - export var CONTACTS_KIND_ORGANIZATION : number; - export var CONTACTS_KIND_PERSON : number; - export var CONTACTS_SORT_FIRST_NAME : number; - export var CONTACTS_SORT_LAST_NAME : number; - export var apiName : string; - export var bubbleParent : boolean; - export var contactsAuthorization : number; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createGroup (parameters?: Dictionary) : Ti.Contacts.Group; - export function createPerson (parameters?: Dictionary) : Ti.Contacts.Person; - export function fireEvent (name: string, event: Dictionary) : void; - export function getAllGroups () : Array; - export function getAllPeople (limit: number) : Array; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function getContactsAuthorization () : number; - export function getGroupByID (id: number) : Ti.Contacts.Group; - export function getPeopleWithName (name: string) : Array; - export function getPersonByID (id: number) : Ti.Contacts.Person; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function removeGroup (group: Ti.Contacts.Group) : void; - export function removePerson (person: Ti.Contacts.Person) : void; - export function requestAuthorization (callback: (...args : any[]) => any) : void; - export function revert () : void; - export function save (contacts: Array) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function showContacts (params: showContactsParams) : void; - export module Tizen { - export var apiName : string; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function fireEvent (name: string, event: Dictionary) : void; - export function getAllPeople (callback: (...args : any[]) => any) : void; - export function getApiName () : string; - export function getPeopleWithName (name: string, callback: (...args : any[]) => any) : void; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export interface Group { - members (group: Ti.Contacts.Group, callback: (...args : any[]) => any) : void; - sortedMembers (sortBy: number, group: Ti.Contacts.Group, callback: (...args : any[]) => any) : void; - } - } - export interface Group extends Ti.Proxy { - name : string; - recordId : number; - add (person: Ti.Contacts.Person) : void; - getName () : string; - getRecordId () : number; - members () : Array; - remove (person: Ti.Contacts.Person) : void; - setName (name: string) : void; - setRecordId (recordId: number) : void; - sortedMembers (sortBy: number) : Array; - } - export interface Person extends Ti.Proxy { - address : Dictionary; - birthday : string; - created : string; - date : Dictionary; - department : string; - email : Dictionary; - firstName : string; - firstPhonetic : string; - fullName : string; - id : number; - image : Ti.Blob; - instantMessage : Dictionary; - jobTitle : string; - kind : number; - lastName : string; - lastPhonetic : string; - middleName : string; - middlePhonetic : string; - modified : string; - nickname : string; - note : string; - organization : string; - phone : Dictionary; - prefix : string; - recordId : number; - relatedNames : Dictionary; - suffix : string; - url : Dictionary; - getAddress () : Dictionary; - getBirthday () : string; - getCreated () : string; - getDate () : Dictionary; - getDepartment () : string; - getEmail () : Dictionary; - getFirstName () : string; - getFirstPhonetic () : string; - getFullName () : string; - getId () : number; - getImage () : Ti.Blob; - getInstantMessage () : Dictionary; - getJobTitle () : string; - getKind () : number; - getLastName () : string; - getLastPhonetic () : string; - getMiddleName () : string; - getMiddlePhonetic () : string; - getModified () : string; - getNickname () : string; - getNote () : string; - getOrganization () : string; - getPhone () : Dictionary; - getPrefix () : string; - getRecordId () : number; - getRelatedNames () : Dictionary; - getSuffix () : string; - getUrl () : Dictionary; - setAddress (address: Dictionary) : void; - setBirthday (birthday: string) : void; - setDate (date: Dictionary) : void; - setDepartment (department: string) : void; - setEmail (email: Dictionary) : void; - setFirstName (firstName: string) : void; - setFirstPhonetic (firstPhonetic: string) : void; - setImage (image: Ti.Blob) : void; - setInstantMessage (instantMessage: Dictionary) : void; - setJobTitle (jobTitle: string) : void; - setKind (kind: number) : void; - setLastName (lastName: string) : void; - setLastPhonetic (lastPhonetic: string) : void; - setMiddleName (middleName: string) : void; - setMiddlePhonetic (middlePhonetic: string) : void; - setNickname (nickname: string) : void; - setNote (note: string) : void; - setOrganization (organization: string) : void; - setPhone (phone: Dictionary) : void; - setRecordId (recordId: number) : void; - setRelatedNames (relatedNames: Dictionary) : void; - setUrl (url: Dictionary) : void; - } - } - export interface CloudPush { - SERVICE_DISABLED : number; - SERVICE_INVALID : number; - SERVICE_MISSING : number; - SERVICE_VERSION_UPDATE_REQUIRED : number; - SUCCESS : number; - enabled : boolean; - focusAppOnPush : boolean; - showAppOnTrayClick : boolean; - showTrayNotification : boolean; - showTrayNotificationsWhenFocused : boolean; - singleCallback : boolean; - clearStatus () : void; - getEnabled () : boolean; - getFocusAppOnPush () : boolean; - getShowAppOnTrayClick () : boolean; - getShowTrayNotification () : boolean; - getShowTrayNotificationsWhenFocused () : boolean; - getSingleCallback () : boolean; - isGooglePlayServicesAvailable () : number; - retrieveDeviceToken (config: CloudPushNotificationConfig) : void; - setEnabled (enabled: boolean) : void; - setFocusAppOnPush (focusAppOnPush: boolean) : void; - setShowAppOnTrayClick (showAppOnTrayClick: boolean) : void; - setShowTrayNotification (showTrayNotification: boolean) : void; - setShowTrayNotificationsWhenFocused (showTrayNotificationsWhenFocused: boolean) : void; - setSingleCallback (singleCallback: boolean) : void; - } - export module Media { - export var AUDIO_FILEFORMAT_3GP2 : number; - export var AUDIO_FILEFORMAT_3GPP : number; - export var AUDIO_FILEFORMAT_AIFF : number; - export var AUDIO_FILEFORMAT_AMR : number; - export var AUDIO_FILEFORMAT_CAF : number; - export var AUDIO_FILEFORMAT_MP3 : number; - export var AUDIO_FILEFORMAT_MP4 : number; - export var AUDIO_FILEFORMAT_MP4A : number; - export var AUDIO_FILEFORMAT_WAVE : number; - export var AUDIO_FORMAT_AAC : number; - export var AUDIO_FORMAT_ALAW : number; - export var AUDIO_FORMAT_APPLE_LOSSLESS : number; - export var AUDIO_FORMAT_ILBC : number; - export var AUDIO_FORMAT_IMA4 : number; - export var AUDIO_FORMAT_LINEAR_PCM : number; - export var AUDIO_FORMAT_ULAW : number; - export var AUDIO_HEADPHONES : number; - export var AUDIO_HEADPHONES_AND_MIC : number; - export var AUDIO_HEADSET_INOUT : number; - export var AUDIO_LINEOUT : number; - export var AUDIO_MICROPHONE : number; - export var AUDIO_MUTED : number; - export var AUDIO_RECEIVER_AND_MIC : number; - export var AUDIO_SESSION_CATEGORY_AMBIENT : string; - export var AUDIO_SESSION_CATEGORY_PLAYBACK : string; - export var AUDIO_SESSION_CATEGORY_PLAY_AND_RECORD : string; - export var AUDIO_SESSION_CATEGORY_RECORD : string; - export var AUDIO_SESSION_CATEGORY_SOLO_AMBIENT : string; - export var AUDIO_SESSION_MODE_AMBIENT : number; - export var AUDIO_SESSION_MODE_PLAYBACK : number; - export var AUDIO_SESSION_MODE_PLAY_AND_RECORD : number; - export var AUDIO_SESSION_MODE_RECORD : number; - export var AUDIO_SESSION_MODE_SOLO_AMBIENT : number; - export var AUDIO_SESSION_OVERRIDE_ROUTE_NONE : number; - export var AUDIO_SESSION_OVERRIDE_ROUTE_SPEAKER : number; - export var AUDIO_SESSION_PORT_AIRPLAY : string; - export var AUDIO_SESSION_PORT_BLUETOOTHA2DP : string; - export var AUDIO_SESSION_PORT_BLUETOOTHHFP : string; - export var AUDIO_SESSION_PORT_BLUETOOTHLE : string; - export var AUDIO_SESSION_PORT_BUILTINMIC : string; - export var AUDIO_SESSION_PORT_BUILTINRECEIVER : string; - export var AUDIO_SESSION_PORT_BUILTINSPEAKER : string; - export var AUDIO_SESSION_PORT_CARAUDIO : string; - export var AUDIO_SESSION_PORT_HDMI : string; - export var AUDIO_SESSION_PORT_HEADPHONES : string; - export var AUDIO_SESSION_PORT_HEADSETMIC : string; - export var AUDIO_SESSION_PORT_LINEIN : string; - export var AUDIO_SESSION_PORT_LINEOUT : string; - export var AUDIO_SESSION_PORT_USBAUDIO : string; - export var AUDIO_SPEAKER : number; - export var AUDIO_UNAVAILABLE : number; - export var AUDIO_UNKNOWN : number; - export var CAMERA_FLASH_AUTO : number; - export var CAMERA_FLASH_OFF : number; - export var CAMERA_FLASH_ON : number; - export var CAMERA_FRONT : number; - export var CAMERA_REAR : number; - export var DEVICE_BUSY : number; - export var MEDIA_TYPE_PHOTO : string; - export var MEDIA_TYPE_VIDEO : string; - export var MUSIC_MEDIA_GROUP_ALBUM : number; - export var MUSIC_MEDIA_GROUP_ALBUM_ARTIST : number; - export var MUSIC_MEDIA_GROUP_ARTIST : number; - export var MUSIC_MEDIA_GROUP_COMPOSER : number; - export var MUSIC_MEDIA_GROUP_GENRE : number; - export var MUSIC_MEDIA_GROUP_PLAYLIST : number; - export var MUSIC_MEDIA_GROUP_PODCAST_TITLE : number; - export var MUSIC_MEDIA_GROUP_TITLE : number; - export var MUSIC_MEDIA_TYPE_ALL : number; - export var MUSIC_MEDIA_TYPE_ANY_AUDIO : number; - export var MUSIC_MEDIA_TYPE_AUDIOBOOK : number; - export var MUSIC_MEDIA_TYPE_MUSIC : number; - export var MUSIC_MEDIA_TYPE_PODCAST : number; - export var MUSIC_PLAYER_REPEAT_ALL : number; - export var MUSIC_PLAYER_REPEAT_DEFAULT : number; - export var MUSIC_PLAYER_REPEAT_NONE : number; - export var MUSIC_PLAYER_REPEAT_ONE : number; - export var MUSIC_PLAYER_SHUFFLE_ALBUMS : number; - export var MUSIC_PLAYER_SHUFFLE_DEFAULT : number; - export var MUSIC_PLAYER_SHUFFLE_NONE : number; - export var MUSIC_PLAYER_SHUFFLE_SONGS : number; - export var MUSIC_PLAYER_STATE_INTERRUPTED : number; - export var MUSIC_PLAYER_STATE_PAUSED : number; - export var MUSIC_PLAYER_STATE_PLAYING : number; - export var MUSIC_PLAYER_STATE_SEEK_BACKWARD : number; - export var MUSIC_PLAYER_STATE_SEEK_FORWARD : number; - export var MUSIC_PLAYER_STATE_STOPPED : number; - export var NO_CAMERA : number; - export var NO_VIDEO : number; - export var QUALITY_HIGH : number; - export var QUALITY_LOW : number; - export var QUALITY_MEDIUM : number; - export var UNKNOWN_ERROR : number; - export var VIDEO_CONTROL_DEFAULT : number; - export var VIDEO_CONTROL_EMBEDDED : number; - export var VIDEO_CONTROL_FULLSCREEN : number; - export var VIDEO_CONTROL_HIDDEN : number; - export var VIDEO_CONTROL_NONE : number; - export var VIDEO_CONTROL_VOLUME_ONLY : number; - export var VIDEO_FINISH_REASON_PLAYBACK_ENDED : number; - export var VIDEO_FINISH_REASON_PLAYBACK_ERROR : number; - export var VIDEO_FINISH_REASON_USER_EXITED : number; - export var VIDEO_LOAD_STATE_PLAYABLE : number; - export var VIDEO_LOAD_STATE_PLAYTHROUGH_OK : number; - export var VIDEO_LOAD_STATE_STALLED : number; - export var VIDEO_LOAD_STATE_UNKNOWN : number; - export var VIDEO_MEDIA_TYPE_AUDIO : number; - export var VIDEO_MEDIA_TYPE_NONE : number; - export var VIDEO_MEDIA_TYPE_VIDEO : number; - export var VIDEO_PLAYBACK_STATE_INTERRUPTED : number; - export var VIDEO_PLAYBACK_STATE_PAUSED : number; - export var VIDEO_PLAYBACK_STATE_PLAYING : number; - export var VIDEO_PLAYBACK_STATE_SEEKING_BACKWARD : number; - export var VIDEO_PLAYBACK_STATE_SEEKING_FORWARD : number; - export var VIDEO_PLAYBACK_STATE_STOPPED : number; - export var VIDEO_REPEAT_MODE_NONE : number; - export var VIDEO_REPEAT_MODE_ONE : number; - export var VIDEO_SCALING_ASPECT_FILL : number; - export var VIDEO_SCALING_ASPECT_FIT : number; - export var VIDEO_SCALING_MODE_FILL : number; - export var VIDEO_SCALING_NONE : number; - export var VIDEO_SOURCE_TYPE_FILE : number; - export var VIDEO_SOURCE_TYPE_STREAMING : number; - export var VIDEO_SOURCE_TYPE_UNKNOWN : number; - export var VIDEO_TIME_OPTION_EXACT : number; - export var VIDEO_TIME_OPTION_NEAREST_KEYFRAME : number; - export var apiName : string; - export var appMusicPlayer : Ti.Media.MusicPlayer; - export var audioLineType : number; - export var audioPlaying : boolean; - export var audioSessionCategory : number; - export var audioSessionMode : number; - export var availableCameraMediaTypes : Array; - export var availableCameras : Array; - export var availablePhotoGalleryMediaTypes : Array; - export var availablePhotoMediaTypes : Array; - export var averageMicrophonePower : number; - export var bubbleParent : boolean; - export var cameraFlashMode : number; - export var canRecord : boolean; - export var currentRoute : RouteDescription; - export var isCameraSupported : boolean; - export var peakMicrophonePower : number; - export var systemMusicPlayer : Ti.Media.MusicPlayer; - export var volume : number; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function beep () : void; - export function createAudioPlayer (parameters?: Dictionary) : Ti.Media.AudioPlayer; - export function createAudioRecorder (parameters?: Dictionary) : Ti.Media.AudioRecorder; - export function createItem (parameters?: Dictionary) : Ti.Media.Item; - export function createMusicPlayer (parameters?: Dictionary) : Ti.Media.MusicPlayer; - export function createSound (parameters?: Dictionary) : Ti.Media.Sound; - export function createVideoPlayer (parameters?: Dictionary) : Ti.Media.VideoPlayer; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getAppMusicPlayer () : Ti.Media.MusicPlayer; - export function getAudioLineType () : number; - export function getAudioPlaying () : boolean; - export function getAudioSessionCategory () : number; - export function getAudioSessionMode () : number; - export function getAvailableCameraMediaTypes () : Array; - export function getAvailableCameras () : Array; - export function getAvailablePhotoGalleryMediaTypes () : Array; - export function getAvailablePhotoMediaTypes () : Array; - export function getAverageMicrophonePower () : number; - export function getBubbleParent () : boolean; - export function getCameraFlashMode () : number; - export function getCanRecord () : boolean; - export function getCurrentRoute () : RouteDescription; - export function getIsCameraSupported () : boolean; - export function getPeakMicrophonePower () : number; - export function getSystemMusicPlayer () : Ti.Media.MusicPlayer; - export function getVolume () : number; - export function hideCamera () : void; - export function hideMusicLibrary () : void; - export function isMediaTypeSupported (source: string, type: string) : boolean; - export function openMusicLibrary (options: MusicLibraryOptionsType) : void; - export function openPhotoGallery (options: PhotoGalleryOptionsType) : void; - export function previewImage (options: Dictionary) : void; - export function queryMusicLibrary (query: MediaQueryType) : Array; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function requestAuthorization (callback: (...args : any[]) => any) : void; - export function saveToPhotoGallery (media: Ti.Blob, callbacks: any) : void; - export function saveToPhotoGallery (media: Ti.Filesystem.File, callbacks: any) : void; - export function setAudioSessionCategory (audioSessionCategory: number) : void; - export function setAudioSessionMode (audioSessionMode: number) : void; - export function setAvailableCameraMediaTypes (availableCameraMediaTypes: Array) : void; - export function setAvailablePhotoGalleryMediaTypes (availablePhotoGalleryMediaTypes: Array) : void; - export function setAvailablePhotoMediaTypes (availablePhotoMediaTypes: Array) : void; - export function setAverageMicrophonePower (averageMicrophonePower: number) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setCameraFlashMode (cameraFlashMode: number) : void; - export function setOverrideAudioRoute (route: number) : void; - export function showCamera (options: CameraOptionsType) : void; - export function startMicrophoneMonitor () : void; - export function stopMicrophoneMonitor () : void; - export function switchCamera (camera: number) : void; - export function takePicture () : void; - export function takeScreenshot (callback: (...args : any[]) => any) : void; - export function vibrate (pattern?: Array) : void; - export interface Sound extends Ti.Proxy { - STATE_BUFFERING : number; - STATE_INITIALIZED : number; - STATE_PAUSED : number; - STATE_PLAYING : number; - STATE_STARTING : number; - STATE_STOPPED : number; - STATE_STOPPING : number; - STATE_WAITING_FOR_DATA : number; - STATE_WAITING_FOR_QUEUE : number; - allowBackground : boolean; - duration : number; - looping : boolean; - paused : boolean; - playing : boolean; - time : number; - url : string; - volume : number; - getDuration () : number; - getTime () : number; - getUrl () : string; - getVolume () : number; - isLooping () : boolean; - isPaused () : boolean; - isPlaying () : boolean; - pause () : void; - play () : void; - release () : void; - reset () : void; - setLooping (looping: boolean) : void; - setPaused (paused: boolean) : void; - setTime (time: number) : void; - setUrl (url: string) : void; - setVolume (volume: number) : void; - stop () : void; - } - export interface VideoPlayer extends Ti.UI.View { - allowsAirPlay : boolean; - autoplay : boolean; - contentURL : string; - currentPlaybackTime : number; - duration : number; - endPlaybackTime : number; - fullscreen : boolean; - initialPlaybackTime : number; - loadState : number; - media : any; - mediaControlStyle : number; - mediaTypes : number; - movieControlMode : number; - naturalSize : MovieSize; - playableDuration : number; - playbackState : number; - playing : boolean; - repeatMode : number; - scalingMode : number; - sourceType : number; - url : any; - useApplicationAudioSession : boolean; - volume : number; - cancelAllThumbnailImageRequests () : void; - getAllowsAirPlay () : boolean; - getAutoplay () : boolean; - getContentURL () : string; - getCurrentPlaybackTime () : number; - getDuration () : number; - getEndPlaybackTime () : number; - getFullscreen () : boolean; - getInitialPlaybackTime () : number; - getLoadState () : number; - getMediaControlStyle () : number; - getMediaTypes () : number; - getMovieControlMode () : number; - getNaturalSize () : MovieSize; - getPlayableDuration () : number; - getPlaybackState () : number; - getPlaying () : boolean; - getRepeatMode () : number; - getScalingMode () : number; - getSourceType () : number; - getUrl () : any; - getUseApplicationAudioSession () : boolean; - getVolume () : number; - pause () : void; - play () : void; - release () : void; - requestThumbnailImagesAtTimes (times: Array, option: number, callback: (...args : any[]) => any) : void; - setAllowsAirPlay (allowsAirPlay: boolean) : void; - setAutoplay (autoplay: boolean) : void; - setBackgroundView (view: Ti.UI.View) : void; - setContentURL (contentURL: string) : void; - setCurrentPlaybackTime (currentPlaybackTime: number) : void; - setDuration (duration: number) : void; - setEndPlaybackTime (endPlaybackTime: number) : void; - setFullscreen (fullscreen: boolean) : void; - setInitialPlaybackTime (initialPlaybackTime: number) : void; - setMedia (media: Ti.Blob) : void; - setMedia (media: Ti.Filesystem.File) : void; - setMedia (media: string) : void; - setMediaControlStyle (mediaControlStyle: number) : void; - setMediaTypes (mediaTypes: number) : void; - setMovieControlMode (movieControlMode: number) : void; - setNaturalSize (naturalSize: MovieSize) : void; - setRepeatMode (repeatMode: number) : void; - setScalingMode (scalingMode: number) : void; - setSourceType (sourceType: number) : void; - setUrl (url: string) : void; - setUrl (url: Array) : void; - setUseApplicationAudioSession (useApplicationAudioSession: boolean) : void; - setVolume (volume: number) : void; - stop () : void; - thumbnailImageAtTime (time: number, option: number) : Ti.Blob; - } - export interface AudioRecorder extends Ti.Proxy { - compression : number; - format : number; - paused : boolean; - recording : boolean; - stopped : boolean; - getCompression () : number; - getFormat () : number; - getPaused () : boolean; - getRecording () : boolean; - getStopped () : boolean; - pause () : void; - resume () : void; - setCompression (compression: number) : void; - setFormat (format: number) : void; - start () : void; - stop () : Ti.Filesystem.File; - } - export interface Item extends Ti.Proxy { - albumArtist : string; - albumTitle : string; - albumTrackCount : number; - albumTrackNumber : number; - artist : string; - artwork : Ti.Blob; - composer : string; - discCount : number; - discNumber : number; - genre : string; - isCompilation : boolean; - lyrics : string; - mediaType : number; - playCount : number; - playbackDuration : number; - podcastTitle : string; - rating : number; - skipCount : number; - title : string; - getAlbumArtist () : string; - getAlbumTitle () : string; - getAlbumTrackCount () : number; - getAlbumTrackNumber () : number; - getArtist () : string; - getArtwork () : Ti.Blob; - getComposer () : string; - getDiscCount () : number; - getDiscNumber () : number; - getGenre () : string; - getIsCompilation () : boolean; - getLyrics () : string; - getMediaType () : number; - getPlayCount () : number; - getPlaybackDuration () : number; - getPodcastTitle () : string; - getRating () : number; - getSkipCount () : number; - getTitle () : string; - } - export interface MusicPlayer extends Ti.Proxy { - currentPlaybackTime : number; - nowPlaying : Ti.Media.Item; - playbackState : number; - repeatMode : number; - shuffleMode : number; - volume : number; - getCurrentPlaybackTime () : number; - getNowPlaying () : Ti.Media.Item; - getPlaybackState () : number; - getRepeatMode () : number; - getShuffleMode () : number; - getVolume () : number; - pause () : void; - play () : void; - seekBackward () : void; - seekForward () : void; - setCurrentPlaybackTime (currentPlaybackTime: number) : void; - setQueue (queue: Ti.Media.Item) : void; - setQueue (queue: Array) : void; - setQueue (queue: PlayerQueue) : void; - setRepeatMode (repeatMode: number) : void; - setShuffleMode (shuffleMode: number) : void; - setVolume (volume: number) : void; - skipToBeginning () : void; - skipToNext () : void; - skipToPrevious () : void; - stop () : void; - stopSeeking () : void; - } - export interface AudioPlayer extends Ti.Proxy { - STATE_BUFFERING : number; - STATE_INITIALIZED : number; - STATE_PAUSED : number; - STATE_PLAYING : number; - STATE_STARTING : number; - STATE_STOPPED : number; - STATE_STOPPING : number; - STATE_WAITING_FOR_DATA : number; - STATE_WAITING_FOR_QUEUE : number; - allowBackground : boolean; - autoplay : boolean; - bitRate : number; - bufferSize : number; - duration : number; - idle : boolean; - paused : boolean; - playing : boolean; - progress : number; - state : number; - time : number; - url : string; - volume : number; - waiting : boolean; - getAllowBackground () : boolean; - getAutoplay () : boolean; - getBitRate () : number; - getBufferSize () : number; - getDuration () : number; - getIdle () : boolean; - getPaused () : boolean; - getPlaying () : boolean; - getProgress () : number; - getState () : number; - getTime () : number; - getUrl () : string; - getVolume () : number; - getWaiting () : boolean; - isPaused () : boolean; - isPlaying () : boolean; - pause () : void; - play () : void; - release () : void; - setBitRate (bitRate: number) : void; - setBufferSize (bufferSize: number) : void; - setPaused (paused: boolean) : void; - setTime (time: number) : void; - setUrl (url: string) : void; - setVolume (volume: number) : void; - start () : void; - stateDescription (state: number) : string; - stop () : void; - } - export interface Android { - scanMediaFiles (paths: Array, mimeTypes: Array, callback: (...args : any[]) => any) : void; - setSystemWallpaper (image: Ti.Blob, scale: boolean) : void; - } - } - export module Platform { - export var BATTERY_STATE_CHARGING : number; - export var BATTERY_STATE_FULL : number; - export var BATTERY_STATE_UNKNOWN : number; - export var BATTERY_STATE_UNPLUGGED : number; - export var address : string; - export var apiName : string; - export var architecture : string; - export var availableMemory : number; - export var batteryLevel : number; - export var batteryMonitoring : boolean; - export var batteryState : number; - export var bubbleParent : boolean; - export var displayCaps : Ti.Platform.DisplayCaps; - export var id : string; - export var locale : string; - export var macaddress : string; - export var manufacturer : string; - export var model : string; - export var name : string; - export var netmask : string; - export var osname : string; - export var ostype : string; - export var processorCount : number; - export var runtime : string; - export var username : string; - export var version : string; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function canOpenURL (url: string) : boolean; - export function createUUID () : string; - export function fireEvent (name: string, event: Dictionary) : void; - export function getAddress () : string; - export function getApiName () : string; - export function getArchitecture () : string; - export function getAvailableMemory () : number; - export function getBatteryLevel () : number; - export function getBatteryMonitoring () : boolean; - export function getBatteryState () : number; - export function getBubbleParent () : boolean; - export function getDisplayCaps () : Ti.Platform.DisplayCaps; - export function getId () : string; - export function getLocale () : string; - export function getMacaddress () : string; - export function getManufacturer () : string; - export function getModel () : string; - export function getName () : string; - export function getNetmask () : string; - export function getOsname () : string; - export function getOstype () : string; - export function getProcessorCount () : number; - export function getRuntime () : string; - export function getUsername () : string; - export function getVersion () : string; - export function is24HourTimeFormat () : boolean; - export function openURL (url: string) : boolean; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBatteryMonitoring (batteryMonitoring: boolean) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface DisplayCaps extends Ti.Proxy { - density : string; - dpi : number; - logicalDensityFactor : number; - platformHeight : number; - platformWidth : number; - xdpi : number; - ydpi : number; - getDensity () : string; - getDpi () : number; - getLogicalDensityFactor () : number; - getPlatformHeight () : number; - getPlatformWidth () : number; - getXdpi () : number; - getYdpi () : number; - } - export interface Android { - API_LEVEL : number; - PHYSICAL_SIZE_CATEGORY_LARGE : number; - PHYSICAL_SIZE_CATEGORY_NORMAL : number; - PHYSICAL_SIZE_CATEGORY_SMALL : number; - PHYSICAL_SIZE_CATEGORY_UNDEFINED : number; - PHYSICAL_SIZE_CATEGORY_XLARGE : number; - physicalSizeCategory : number; - getPhysicalSizeCategory () : number; - } - } - export interface Buffer extends Ti.Proxy { - byteOrder : number; - length : number; - type : string; - value : any; - append (sourceBuffer: Ti.Buffer, sourceOffset?: number, sourceLength?: number) : number; - clear () : void; - clone (offset?: number, length?: number) : Ti.Buffer; - copy (sourceBuffer: Ti.Buffer, offset: number, sourceOffset?: number, sourceLength?: number) : number; - fill (fillByte: number, offset?: number, length?: number) : void; - getByteOrder () : number; - getLength () : number; - getType () : string; - getValue () : any; - insert (sourceBuffer: Ti.Buffer, offset: number, sourceOffset?: number, sourceLength?: number) : number; - release () : void; - setLength (length: number) : void; - toBlob () : Ti.Blob; - toString () : string; - } - export enum BufferStream { + + /** + * Base type for all Titanium modules. + */ + namespace Module { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; } - export module Calendar { - export var AUTHORIZATION_AUTHORIZED : number; - export var AUTHORIZATION_DENIED : number; - export var AUTHORIZATION_RESTRICTED : number; - export var AUTHORIZATION_UNKNOWN : number; - export var AVAILABILITY_BUSY : number; - export var AVAILABILITY_FREE : number; - export var AVAILABILITY_NOTSUPPORTED : number; - export var AVAILABILITY_TENTATIVE : number; - export var AVAILABILITY_UNAVAILABLE : number; - export var METHOD_ALERT : number; - export var METHOD_DEFAULT : number; - export var METHOD_EMAIL : number; - export var METHOD_SMS : number; - export var RECURRENCEFREQUENCY_DAILY : number; - export var RECURRENCEFREQUENCY_MONTHLY : number; - export var RECURRENCEFREQUENCY_WEEKLY : number; - export var RECURRENCEFREQUENCY_YEARLY : number; - export var SPAN_FUTUREEVENTS : number; - export var SPAN_THISEVENT : number; - export var STATE_DISMISSED : number; - export var STATE_FIRED : number; - export var STATE_SCHEDULED : number; - export var STATUS_CANCELED : number; - export var STATUS_CONFIRMED : number; - export var STATUS_NONE : number; - export var STATUS_TENTATIVE : number; - export var VISIBILITY_CONFIDENTIAL : number; - export var VISIBILITY_DEFAULT : number; - export var VISIBILITY_PRIVATE : number; - export var VISIBILITY_PUBLIC : number; - export var allAlerts : Array; - export var allCalendars : Array; - export var allEditableCalendars : Array; - export var apiName : string; - export var bubbleParent : boolean; - export var defaultCalendar : Ti.Calendar.Calendar; - export var eventsAuthorization : number; - export var selectableCalendars : Array; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function fireEvent (name: string, event: Dictionary) : void; - export function getAllAlerts () : Array; - export function getAllCalendars () : Array; - export function getAllEditableCalendars () : Array; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function getCalendarById (id: string) : Ti.Calendar.Calendar; - export function getDefaultCalendar () : Ti.Calendar.Calendar; - export function getEventsAuthorization () : number; - export function getSelectableCalendars () : Array; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function requestEventsAuthorization (callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface Calendar extends Ti.Proxy { - hidden : boolean; - id : string; - name : string; - selected : boolean; - createEvent (properties: Dictionary) : Ti.Calendar.Event; - getEventById (id: number) : Ti.Calendar.Event; - getEventsBetweenDates (date1: Date, date2: Date) : Array; - getEventsInDate (year: number, month: number, day: number) : Array; - getEventsInMonth (year: number, month: number) : Array; - getEventsInYear (year: number) : Array; - getHidden () : boolean; - getId () : string; - getName () : string; - getSelected () : boolean; - } - export interface Reminder extends Ti.Proxy { - id : string; - method : number; - minutes : number; - getId () : string; - getMethod () : number; - getMinutes () : number; - } - export interface Event extends Ti.Proxy { - alerts : Array; - allDay : boolean; - availability : number; - begin : Date; - description : string; - end : Date; - extendedProperties : Dictionary; - hasAlarm : boolean; - id : string; - isDetached : boolean; - location : string; - notes : string; - recurenceRule : Ti.Calendar.RecurrenceRule; - recurenceRules : Array; - reminders : Array; - status : number; - title : string; - visibility : number; - addRecurrenceRule (rule: Ti.Calendar.RecurrenceRule) : void; - createAlert (data: Dictionary) : Ti.Calendar.Alert; - createRecurenceRule (data: Dictionary) : Ti.Calendar.RecurrenceRule; - createReminder (data: Dictionary) : Ti.Calendar.Reminder; - getAlerts () : Array; - getAllDay () : boolean; - getAvailability () : number; - getBegin () : Date; - getDescription () : string; - getEnd () : Date; - getExtendedProperties () : Dictionary; - getExtendedProperty (name: string) : string; - getHasAlarm () : boolean; - getId () : string; - getIsDetached () : boolean; - getLocation () : string; - getNotes () : string; - getRecurenceRule () : Ti.Calendar.RecurrenceRule; - getRecurenceRules () : Array; - getReminders () : Array; - getStatus () : number; - getTitle () : string; - getVisibility () : number; - refresh () : boolean; - remove (span: number) : boolean; - removeRecurenceRule (rule: Ti.Calendar.RecurrenceRule) : void; - save (span: number) : boolean; - setAlerts (alerts: Array) : void; - setAllDay (allDay: boolean) : void; - setBegin (begin: Date) : void; - setEnd (end: Date) : void; - setExtendedProperty (name: string, value: string) : void; - setLocation (location: string) : void; - setNotes (notes: string) : void; - setRecurenceRule (recurenceRule: Ti.Calendar.RecurrenceRule) : void; - setRecurenceRules (recurenceRules: Array) : void; - setTitle (title: string) : void; - } - export interface RecurrenceRule extends Ti.Proxy { - calendarID : string; - daysOfTheMonth : Array; - daysOfTheWeek : daysOfTheWeekDictionary; - daysOfTheYear : Array; - end : recurrenceEndDictionary; - frequency : number; - interval : number; - monthsOfTheYear : Array; - setPositions : Array; - weeksOfTheYear : Array; - getCalendarID () : string; - getDaysOfTheMonth () : Array; - getDaysOfTheWeek () : daysOfTheWeekDictionary; - getDaysOfTheYear () : Array; - getEnd () : recurrenceEndDictionary; - getFrequency () : number; - getInterval () : number; - getMonthsOfTheYear () : Array; - getSetPositions () : Array; - getWeeksOfTheYear () : Array; - } - export interface Alert extends Ti.Proxy { - absoluteDate : Date; - alarmTime : Date; - begin : Date; - end : Date; - eventId : number; - id : string; - minutes : number; - relativeOffset : number; - state : number; - getAbsoluteDate () : Date; - getAlarmTime () : Date; - getBegin () : Date; - getEnd () : Date; - getEventId () : number; - getId () : string; - getMinutes () : number; - getRelativeOffset () : number; - getState () : number; - setAbsoluteDate (absoluteDate: Date) : void; - setRelativeOffset (relativeOffset: number) : void; - } + + /** + * The top-level API module, containing methods to output messages to the system log. + */ + namespace API { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Logs messages with a `debug` severity-level. + */ + function debug(message: ReadonlyArray): void; + + /** + * Logs messages with a `debug` severity-level. + */ + function debug(message: string): void; + + /** + * Logs messages with an `error` severity-level. + */ + function error(message: ReadonlyArray): void; + + /** + * Logs messages with an `error` severity-level. + */ + function error(message: string): void; + + /** + * Logs messages with an `info` severity-level. + */ + function info(message: ReadonlyArray): void; + + /** + * Logs messages with an `info` severity-level. + */ + function info(message: string): void; + + /** + * Logs messages with the specified severity-level. + */ + function log(level: string, message: ReadonlyArray): void; + + /** + * Logs messages with the specified severity-level. + */ + function log(level: string, message: string): void; + + /** + * Logs messages with a `timestamp` severity-level, prefixed with a timestamp float number + * representing the number of seconds since January 1st, 2001. + */ + function timestamp(message: ReadonlyArray): void; + + /** + * Logs messages with a `timestamp` severity-level, prefixed with a timestamp float number + * representing the number of seconds since January 1st, 2001. + */ + function timestamp(message: string): void; + + /** + * Logs messages with a `trace` severity-level. + */ + function trace(message: ReadonlyArray): void; + + /** + * Logs messages with a `trace` severity-level. + */ + function trace(message: string): void; + + /** + * Logs messages with a `warn` severity-level. + */ + function warn(message: ReadonlyArray): void; + + /** + * Logs messages with a `warn` severity-level. + */ + function warn(message: string): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + } - export module Filesystem { - export var MODE_APPEND : number; - export var MODE_READ : number; - export var MODE_WRITE : number; - export var apiName : string; - export var applicationCacheDirectory : string; - export var applicationDataDirectory : string; - export var applicationDirectory : string; - export var applicationSupportDirectory : string; - export var bubbleParent : boolean; - export var externalStorageDirectory : string; - export var lineEnding : string; - export var resRawDirectory : string; - export var resourcesDirectory : string; - export var separator : string; - export var tempDirectory : string; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createTempDirectory () : Ti.Filesystem.File; - export function createTempFile () : Ti.Filesystem.File; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getApplicationCacheDirectory () : string; - export function getApplicationDataDirectory () : string; - export function getApplicationDirectory () : string; - export function getApplicationSupportDirectory () : string; - export function getBubbleParent () : boolean; - export function getExternalStorageDirectory () : string; - export function getFile (path: string, ...extraPaths: string[]) : Ti.Filesystem.File; - export function getLineEnding () : string; - export function getResRawDirectory () : string; - export function getResourcesDirectory () : string; - export function getSeparator () : string; - export function getTempDirectory () : string; - export function isExternalStoragePresent () : boolean; - export function openStream (mode: number, path: string, ...extraPaths: string[]) : Ti.Filesystem.FileStream; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface File extends Ti.Proxy { - executable : boolean; - hidden : boolean; - name : string; - nativePath : string; - parent : Ti.Filesystem.File; - readonly : boolean; - remoteBackup : boolean; - size : number; - symbolicLink : boolean; - writable : boolean; - writeable : boolean; - append (data: string) : boolean; - append (data: Ti.Blob) : boolean; - append (data: Ti.Filesystem.File) : boolean; - copy (destinationPath: string) : boolean; - createDirectory () : boolean; - createFile () : boolean; - createTimestamp () : number; - deleteDirectory (recursive?: boolean) : boolean; - deleteFile () : boolean; - exists () : boolean; - extension () : string; - getDirectoryListing () : Array; - getExecutable () : boolean; - getHidden () : boolean; - getName () : string; - getNativePath () : string; - getParent () : any; - getReadonly () : boolean; - getRemoteBackup () : boolean; - getSize () : number; - getSymbolicLink () : boolean; - getWritable () : boolean; - getWriteable () : boolean; - isDirectory () : boolean; - isFile () : boolean; - modificationTimestamp () : number; - move (newpath: string) : boolean; - open (mode: number) : Ti.Filesystem.FileStream; - read () : Ti.Blob; - rename (newname: string) : boolean; - resolve () : string; - setHidden (hidden: boolean) : void; - setRemoteBackup (remoteBackup: boolean) : void; - spaceAvailable () : number; - write (data: string, append?: boolean) : boolean; - write (data: Ti.Filesystem.File, append?: boolean) : boolean; - write (data: Ti.Blob, append?: boolean) : boolean; + + /** + * The top-level Accelerometer module, used to determine the device's physical position. + */ + namespace Accelerometer { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + } + + /** + * Used for transmitting developer-defined Analytics events to the Appcelerator Analytics product. + */ + namespace Analytics { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * JSON representation of the last analytics event generated. + */ + const lastEvent: string; + + /** + * Sends a generic event for this application session. + * **Not displayed in Analytics UI**. + */ + function addEvent(type: string, name: string, data?: any): void; + + /** + * Sends a feature event for this application session. + */ + function featureEvent(name: string, data?: any): number; + + /** + * Sets a list of events that will not be sent to the analytics server. + */ + function filterEvents(events: ReadonlyArray): void; + + /** + * Sends a navigation event for this application session. + * **Not displayed in Analytics UI**. + */ + function navEvent(from: string, to: string, name?: string, data?: any): void; + + /** + * Sends a settings event for this application session. + * **Not displayed in Analytics UI**. + */ + function settingsEvent(name: string, data?: any): void; + + /** + * Send a timed event for this application session. + * **Not displayed in Analytics UI**. + */ + function timedEvent(name: string, start: Date, stop: Date, duration: number, data?: any): void; + + /** + * Sends a user event for this application session. **Not displayed in Analytics UI**. + */ + function userEvent(name: string, data?: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getLastEvent(): string; + + } + + /** + * The top-level Android module. + */ + namespace Android { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * User switched airplane mode on or off. + */ + const ACTION_AIRPLANE_MODE_CHANGED: string; + + /** + * List all applications. + */ + const ACTION_ALL_APPS: string; + + /** + * Handle an incoming phone call. + */ + const ACTION_ANSWER: string; + + /** + * Used to indicate that the data is an attachment. + */ + const ACTION_ATTACH_DATA: string; + + /** + * Listen to battery state change status. + */ + const ACTION_BATTERY_CHANGED: string; + + /** + * Indicates low battery condition on the device. + */ + const ACTION_BATTERY_LOW: string; + + /** + * Inidicates the battery is now okay after being low. + */ + const ACTION_BATTERY_OKAY: string; + + /** + * Indicates the system has finished booting. + */ + const ACTION_BOOT_COMPLETED: string; + + /** + * Show activity for reporting a bug. + */ + const ACTION_BUG_REPORT: string; + + /** + * Perform a call to someone specified by the `data` property. + */ + const ACTION_CALL: string; + + /** + * User pressed the call button. + */ + const ACTION_CALL_BUTTON: string; + + /** + * The camera button was pressed. + */ + const ACTION_CAMERA_BUTTON: string; + + /** + * Display an activity chooser. + */ + const ACTION_CHOOSER: string; + + /** + * User dismissed a temporary system dialog, such as the notification drawer or recent-app drawer. + */ + const ACTION_CLOSE_SYSTEM_DIALOGS: string; + + /** + * The device's configuration changed. + */ + const ACTION_CONFIGURATION_CHANGED: string; + + /** + * Create a shortcut. + */ + const ACTION_CREATE_SHORTCUT: string; + + /** + * Date changed. + */ + const ACTION_DATE_CHANGED: string; + + /** + * Default action, which is `Titanium.Android.ACTION_VIEW` + */ + const ACTION_DEFAULT: string; + + /** + * Delete the data specified by the Intent's `data` property. + */ + const ACTION_DELETE: string; + + /** + * Indicates a low memory condition on the device. + */ + const ACTION_DEVICE_STORAGE_LOW: string; + + /** + * Dial a number specified by the Intent's `data` property. + */ + const ACTION_DIAL: string; + + /** + * Provide editable access to the data specified by the Intent's `data` property. + */ + const ACTION_EDIT: string; + + /** + * Allow the user to select a particular kind of data specified by the Intent's `type` property. + */ + const ACTION_GET_CONTENT: string; + + /** + * GTalk connection has been established. + */ + const ACTION_GTALK_SERVICE_CONNECTED: string; + + /** + * GTalk connections has been disconnected. + */ + const ACTION_GTALK_SERVICE_DISCONNECTED: string; + + /** + * A wired headset has been plugged in or unplugged. + */ + const ACTION_HEADSET_PLUG: string; + + /** + * An input method has been changed. + */ + const ACTION_INPUT_METHOD_CHANGED: string; + + /** + * Insert an empty item into the given container. + */ + const ACTION_INSERT: string; + + /** + * Pick an existing item or insert an empty item, then edit it. + */ + const ACTION_INSERT_OR_EDIT: string; + + /** + * Start as the main entry point. + */ + const ACTION_MAIN: string; + + /** + * Indicates low memory condition notification acknowledged by user and package management should be started. + */ + const ACTION_MANAGE_PACKAGE_STORAGE: string; + + /** + * External media was removed from SD card slot, but mount point was not unmounted. + */ + const ACTION_MEDIA_BAD_REMOVAL: string; + + /** + * The media button was pressed. + */ + const ACTION_MEDIA_BUTTON: string; + + /** + * External media is present and being disk-checked + */ + const ACTION_MEDIA_CHECKING: string; + + /** + * User has expressed the desire to remove the external storage media. + */ + const ACTION_MEDIA_EJECT: string; + + /** + * External media is present and mounted at its mount point. + */ + const ACTION_MEDIA_MOUNTED: string; + + /** + * External media is present, but is using an incompatible filesystem or is blank. + */ + const ACTION_MEDIA_NOFS: string; + + /** + * External media has been removed. + */ + const ACTION_MEDIA_REMOVED: string; + + /** + * The media scanner has finished scanning a directory. + */ + const ACTION_MEDIA_SCANNER_FINISHED: string; + + /** + * Request the media scanner to scan a file and add it to the media database. + */ + const ACTION_MEDIA_SCANNER_SCAN_FILE: string; + + /** + * The media scanner has started scanning a directory. + */ + const ACTION_MEDIA_SCANNER_STARTED: string; + + /** + * External media is unmounted because it is being shared via USB mass storage. + */ + const ACTION_MEDIA_SHARED: string; + + /** + * Corresponds to the Android `Intent.ACTION_MEDIA_UNMOUNTABLE` constant. + */ + const ACTION_MEDIA_UNMOUNTABLE: string; + + /** + * External media is present, but not mounted at its mount point. + */ + const ACTION_MEDIA_UNMOUNTED: string; + + /** + * An outgoing call is about to be placed. + */ + const ACTION_NEW_OUTGOING_CALL: string; + + /** + * A new application package has been installed on the device. + */ + const ACTION_PACKAGE_ADDED: string; + + /** + * An existing application package has been changed. + */ + const ACTION_PACKAGE_CHANGED: string; + + /** + * The user has cleared the data of a package. + */ + const ACTION_PACKAGE_DATA_CLEARED: string; + + /** + * Trigger the download and eventual installation of a package. + */ + const ACTION_PACKAGE_INSTALL: string; + + /** + * An existing application package has been removed from the device. + */ + const ACTION_PACKAGE_REMOVED: string; + + /** + * A new version of an application package has been installed, replacing an existing version that was previously installed. + */ + const ACTION_PACKAGE_REPLACED: string; + + /** + * The user has restarted a package, and all of its processes have been killed. + */ + const ACTION_PACKAGE_RESTARTED: string; + + /** + * Pick an item from the directory indicated by the Intent's `data` property. + */ + const ACTION_PICK: string; + + /** + * Pick an activity given an intent. + */ + const ACTION_PICK_ACTIVITY: string; + + /** + * External power has been connected to the device. + */ + const ACTION_POWER_CONNECTED: string; + + /** + * External power has been disconnected from the device. + */ + const ACTION_POWER_DISCONNECTED: string; + + /** + * Show power usage information to the user. + */ + const ACTION_POWER_USAGE_SUMMARY: string; + + /** + * Content provider published new events or items. + */ + const ACTION_PROVIDER_CHANGED: string; + + /** + * Device rebooted. + */ + const ACTION_REBOOT: string; + + /** + * Run the data. + */ + const ACTION_RUN: string; + + /** + * Sent when the device goes to sleep and becomes non-interactive. + */ + const ACTION_SCREEN_OFF: string; + + /** + * Sent when the device wakes up and becomes interactive. + */ + const ACTION_SCREEN_ON: string; + + /** + * Perform a search. + */ + const ACTION_SEARCH: string; + + /** + * Start action associated with long pressing on the search key. + */ + const ACTION_SEARCH_LONG_PRESS: string; + + /** + * Deliver data to another activity. + */ + const ACTION_SEND: string; + + /** + * Deliver data to the recipient specified by the Intent's `data` property. + */ + const ACTION_SENDTO: string; + + /** + * Deliver multiple data to another activity. + */ + const ACTION_SEND_MULTIPLE: string; + + /** + * Show settings for choosing the system wallpaper. + */ + const ACTION_SET_WALLPAPER: string; + + /** + * Device is shutting down. + */ + const ACTION_SHUTDOWN: string; + + /** + * Perform data synchronization. + */ + const ACTION_SYNC: string; + + /** + * Start the platform-defined tutorial. + */ + const ACTION_SYSTEM_TUTORIAL: string; + + /** + * The time was set. + */ + const ACTION_TIME_CHANGED: string; + + /** + * The current time changed. Sent every minute. + */ + const ACTION_TIME_TICK: string; + + /** + * A user ID was removed from the system. + */ + const ACTION_UID_REMOVED: string; + + /** + * The device has entered USB Mass Storage mode. + */ + const ACTION_UMS_CONNECTED: string; + + /** + * The device has exited USB Mass Storage mode. + */ + const ACTION_UMS_DISCONNECTED: string; + + /** + * Sent when the user is present after device wakes up. + */ + const ACTION_USER_PRESENT: string; + + /** + * Display data to the user. + */ + const ACTION_VIEW: string; + + /** + * Start voice command. + */ + const ACTION_VOICE_COMMAND: string; + + /** + * The current system wallpaper has changed. + */ + const ACTION_WALLPAPER_CHANGED: string; + + /** + * Perform a web search. + */ + const ACTION_WEB_SEARCH: string; + + /** + * Set if the activity should be considered as an alternative action to the data the user is currently viewing. + */ + const CATEGORY_ALTERNATIVE: string; + + /** + * Activity can browse the Internet. + */ + const CATEGORY_BROWSABLE: string; + + /** + * Activity should be used as the default action to perform on a piece of data. + */ + const CATEGORY_DEFAULT: string; + + /** + * Activity is in the development preference panel. + */ + const CATEGORY_DEVELOPMENT_PREFERENCE: string; + + /** + * Activity can run inside a parent activity. + */ + const CATEGORY_EMBED: string; + + /** + * To be used as test code for framework instrumentation tests. + */ + const CATEGORY_FRAMEWORK_INSTRUMENTATION_TEST: string; + + /** + * Home activity, the first activity that is displayed when the device boots. + */ + const CATEGORY_HOME: string; + + /** + * Provides information about the package it is in. + */ + const CATEGORY_INFO: string; + + /** + * Activity is in the device's launcher. + */ + const CATEGORY_LAUNCHER: string; + + /** + * This activity may be exercised by the monkey or other automated test tools. + */ + const CATEGORY_MONKEY: string; + + /** + * Activity can open raw `file://` or `scheme://` URIs. + */ + const CATEGORY_OPENABLE: string; + + /** + * This activity is a preference panel. + */ + const CATEGORY_PREFERENCE: string; + + /** + * To be used as a sample code example (not part of the normal user experience). + */ + const CATEGORY_SAMPLE_CODE: string; + + /** + * Activity should be considered as an alternative selection action to the data the user + * has currently selected. + */ + const CATEGORY_SELECTED_ALTERNATIVE: string; + + /** + * Activity to be used in a tab activity. + */ + const CATEGORY_TAB: string; + + /** + * To be used as a test (not part of the normal user experience). + */ + const CATEGORY_TEST: string; + + /** + * To be used as a unit test (run through the Test Harness). + */ + const CATEGORY_UNIT_TEST: string; + + /** + * Integer indicating how many pending alarms are being delivered with the intent. + */ + const EXTRA_ALARM_COUNT: string; + + /** + * String array containing e-mail addresses for blind carbon copying. + */ + const EXTRA_BCC: string; + + /** + * String array containing e-mail addresses for carbon copying. + */ + const EXTRA_CC: string; + + /** + * Boolean indicating full uninstall (true) or partial uninstall (false). + */ + const EXTRA_DATA_REMOVED: string; + + /** + * Boolean indicating to restart the application or not. + */ + const EXTRA_DONT_KILL_APP: string; + + /** + * String array containing e-mail addresses. + */ + const EXTRA_EMAIL: string; + + /** + * An Intent describing the choices you would like shown. + */ + const EXTRA_INTENT: string; + + /** + * A KeyEvent object containing the event that triggered the creation of the Intent it is in. + */ + const EXTRA_KEY_EVENT: string; + + /** + * String holding the phone number to call or number that was called. + */ + const EXTRA_PHONE_NUMBER: string; + + /** + * Boolean indicating if the package is being replaced. + */ + const EXTRA_REPLACING: string; + + /** + * Bitmap icon. + */ + const EXTRA_SHORTCUT_ICON: string; + + /** + * Resource of the shortcut. + */ + const EXTRA_SHORTCUT_ICON_RESOURCE: string; + + /** + * Intent of a shortcut. + */ + const EXTRA_SHORTCUT_INTENT: string; + + /** + * Name of the shortcut. + */ + const EXTRA_SHORTCUT_NAME: string; + + /** + * URI containing the stream data. + */ + const EXTRA_STREAM: string; + + /** + * Subject line of a message. + */ + const EXTRA_SUBJECT: string; + + /** + * Initial data to place in a newly created record. + */ + const EXTRA_TEMPLATE: string; + + /** + * Corresponds to the Android `Intent.EXTRA_TEXT` constant. + */ + const EXTRA_TEXT: string; + + /** + * Corresponds to the Android `Intent.EXTRA_TITLE` constant. + */ + const EXTRA_TITLE: string; + + /** + * UID of the assigned packaged. + */ + const EXTRA_UID: string; + + /** + * Not used. + */ + const FILL_IN_ACTION: number; + + /** + * Not used. + */ + const FILL_IN_CATEGORIES: number; + + /** + * Not used. + */ + const FILL_IN_COMPONENT: number; + + /** + * Not used. + */ + const FILL_IN_DATA: number; + + /** + * Not used. + */ + const FILL_IN_PACKAGE: number; + + /** + * If activity is already running, bring it to the foreground. + */ + const FLAG_ACTIVITY_BROUGHT_TO_FRONT: number; + + /** + * If the activity is present, removes any activities on top of it to make it the foreground activity. + */ + const FLAG_ACTIVITY_CLEAR_TOP: number; + + /** + * Corresponds to the Android `Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET` constant. + */ + const FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET: number; + + /** + * Exclude the activity from recently launched activities. + */ + const FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS: number; + + /** + * Return result to the original calling activity. + */ + const FLAG_ACTIVITY_FORWARD_RESULT: number; + + /** + * Activity was launched from history. + */ + const FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY: number; + + /** + * Start the activity as a new task even if it exists. + */ + const FLAG_ACTIVITY_MULTIPLE_TASK: number; + + /** + * Activity will be the start of a new task (collection of activities). + */ + const FLAG_ACTIVITY_NEW_TASK: number; + + /** + * Prevent transition animation. + */ + const FLAG_ACTIVITY_NO_ANIMATION: number; + + /** + * Do not keep the activity in the history stack. + */ + const FLAG_ACTIVITY_NO_HISTORY: number; + + /** + * Disables the [onUserLeaveHint()](http://developer.android.com/reference/android/app/Activity.html#onUserLeaveHint()) callback. + */ + const FLAG_ACTIVITY_NO_USER_ACTION: number; + + /** + * Corresponds to the Android `Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP` constant. + */ + const FLAG_ACTIVITY_PREVIOUS_IS_TOP: number; + + /** + * If the activity already exists, place it at the top of the history stack. + */ + const FLAG_ACTIVITY_REORDER_TO_FRONT: number; + + /** + * If the task already exists, resets the task to its initial state. + */ + const FLAG_ACTIVITY_RESET_TASK_IF_NEEDED: number; + + /** + * Do not launch the activity if it is already running. + */ + const FLAG_ACTIVITY_SINGLE_TOP: number; + + /** + * Enable a log message to print out the resolution of the intent. + */ + const FLAG_DEBUG_LOG_RESOLUTION: number; + + /** + * Indicates the intent is coming from a background operation. + */ + const FLAG_FROM_BACKGROUND: number; + + /** + * Grant read permission on the URI in the Intent's data or clipboard. + */ + const FLAG_GRANT_READ_URI_PERMISSION: number; + + /** + * Grants write permission on the URI in the Intent's data or clipboard. + */ + const FLAG_GRANT_WRITE_URI_PERMISSION: number; + + /** + * When sending a broadcast, only registered receivers will be called. + */ + const FLAG_RECEIVER_REGISTERED_ONLY: number; + + /** + * Cancel the current pending intent before creating a new one. + */ + const FLAG_CANCEL_CURRENT: number; + + /** + * If the current intent does not exist, do not create it. + */ + const FLAG_NO_CREATE: number; + + /** + * The pending intent can only be used once. + */ + const FLAG_ONE_SHOT: number; + + /** + * If the current pending intent already exists, only update the current intent's extra data. + */ + const FLAG_UPDATE_CURRENT: number; + + /** + * Notification category indicating an alarm or timer. + */ + const CATEGORY_ALARM: string; + + /** + * Notification category indicating an incoming call (voice or video) or similar synchronous + * communication request. + */ + const CATEGORY_CALL: string; + + /** + * Notification category indicating an asynchronous bulk message (email). + */ + const CATEGORY_EMAIL: string; + + /** + * Notification category indicating an error in background operation or authentication status. + */ + const CATEGORY_ERROR: string; + + /** + * Notification category indicating a calendar event. + */ + const CATEGORY_EVENT: string; + + /** + * Notification category indicating an incoming direct message (SMS, instant message, etc.). + */ + const CATEGORY_MESSAGE: string; + + /** + * Notification category indicating the progress of a long-running background operation. + */ + const CATEGORY_PROGRESS: string; + + /** + * Notification category indicating a promotion or advertisement. + */ + const CATEGORY_PROMO: string; + + /** + * Notification category indicating a specific, timely recommendation for a single thing. + */ + const CATEGORY_RECOMMENDATION: string; + + /** + * Notification category for a running background service. + */ + const CATEGORY_SERVICE: string; + + /** + * Notification category for a social network or sharing update. + */ + const CATEGORY_SOCIAL: string; + + /** + * Notification category indicating ongoing information about device or contextual status. + */ + const CATEGORY_STATUS: string; + + /** + * Notification category indicating media transport control for playback. + */ + const CATEGORY_TRANSPORT: string; + + /** + * Use all default settings for a notification; see + * [Notification.defaults](Titanium.Android.Notification.defaults). + */ + const DEFAULT_ALL: number; + + /** + * Use the default light settings for a notification; see + * [Notification.defaults](Titanium.Android.Notification.defaults). + */ + const DEFAULT_LIGHTS: number; + + /** + * Use the default sound settings for a notification; see + * [Notification.defaults](Titanium.Android.Notification.defaults). + */ + const DEFAULT_SOUND: number; + + /** + * Use the default vibration settings for a notification; see + * [Notification.defaults](Titanium.Android.Notification.defaults). + */ + const DEFAULT_VIBRATE: number; + + /** + * Cancel the notification when it is clicked by the user. + */ + const FLAG_AUTO_CANCEL: number; + + /** + * Repeat audio until the notification is cancelled or the notification window + * is opened. + */ + const FLAG_INSISTENT: number; + + /** + * Do not cancel the notification when the user clicks the Clear All button. + */ + const FLAG_NO_CLEAR: number; + + /** + * Specifies that a notification is in reference to something that is ongoing, like a phone call. + */ + const FLAG_ONGOING_EVENT: number; + + /** + * Play an alert (sound, lights, and/or vibration) once each time the notification is sent, even if it has not been canceled before that. + */ + const FLAG_ONLY_ALERT_ONCE: number; + + /** + * Use LED lights to alert the user to the notification. + */ + const FLAG_SHOW_LIGHTS: number; + + /** + * Use for urgent or time-critical notifications, for example, turn-by-turn directions or + * emergency alerts. + */ + const PRIORITY_MAX: number; + + /** + * Use for high priority notifications like real-time chat messages. + */ + const PRIORITY_HIGH: number; + + /** + * Default priority if it does no fit into another priority category. + */ + const PRIORITY_DEFAULT: number; + + /** + * Use for low priority notifications like software updates. + */ + const PRIORITY_LOW: number; + + /** + * Use for expired events. + */ + const PRIORITY_MIN: number; + + /** + * Shows basic information about the notification. + */ + const VISIBILITY_PRIVATE: number; + + /** + * Shows the notification's full content on the lockscreen. This is the system default if visibility is left unspecified. + */ + const VISIBILITY_PUBLIC: number; + + /** + * Shows the most minimal information of the notification on the lockscreen. + */ + const VISIBILITY_SECRET: number; + + /** + * QuickSettings tile is unavailble. + */ + const TILE_STATE_UNAVAILABLE: number; + + /** + * QuickSettings tile is inactive. + */ + const TILE_STATE_INACTIVE: number; + + /** + * QuickSettings tile is active. + */ + const TILE_STATE_ACTIVE: number; + + /** + * Ensures that the CPU is running; the screen and keyboard backlight will be allowed to go off. + */ + const WAKE_LOCK_PARTIAL: number; + + /** + * Ensures that the screen and keyboard backlight are on at full brightness. + */ + const WAKE_LOCK_FULL: number; + + /** + * Ensures that the screen is on (but may be dimmed); the keyboard backlight will be allowed to go off. + */ + const WAKE_LOCK_SCREEN_DIM: number; + + /** + * Ensures that the screen is on at full brightness; the keyboard backlight will be allowed to go off. + */ + const WAKE_LOCK_SCREEN_BRIGHT: number; + + /** + * Turn the screen on when the wake lock is acquired. + */ + const WAKE_LOCK_ACQUIRE_CAUSES_WAKEUP: number; + + /** + * When this wake lock is released, poke the user activity timer so the screen stays on for a little longer. + */ + const WAKE_LOCK_ON_AFTER_RELEASE: number; + + /** + * Not used. + */ + const PENDING_INTENT_FOR_ACTIVITY: number; + + /** + * Not used. + */ + const PENDING_INTENT_FOR_BROADCAST: number; + + /** + * Not used. + */ + const PENDING_INTENT_FOR_SERVICE: number; + + /** + * Not used. + */ + const PENDING_INTENT_MAX_VALUE: number; + + /** + * Used with [setResult](Titanium.Android.Activity.setResult) to specify that + * an activity was canceled. + */ + const RESULT_CANCELED: number; + + /** + * Used with [setResult](Titanium.Android.Activity.setResult) to specify a + * user-defined result. + */ + const RESULT_FIRST_USER: number; + + /** + * Used with [setResult](Titanium.Android.Activity.setResult) to specify that + * an activity succeeded. + */ + const RESULT_OK: number; + + /** + * Use with [requestedOrientation](Titanium.Android.Activity.requestedOrientation) to + * specify the activity should run in the same orientation as the activity behind it + * in the activity stack. + */ + const SCREEN_ORIENTATION_BEHIND: number; + + /** + * Use with [requestedOrientation](Titanium.Android.Activity.requestedOrientation) to + * specify a landscape screen orientation. + */ + const SCREEN_ORIENTATION_LANDSCAPE: number; + + /** + * Use with [requestedOrientation](Titanium.Android.Activity.requestedOrientation) to + * specify that the sensor should be ignored and the display should not rotate. + */ + const SCREEN_ORIENTATION_NOSENSOR: number; + + /** + * Use with [requestedOrientation](Titanium.Android.Activity.requestedOrientation) to + * specify a portrait screen orientation. + */ + const SCREEN_ORIENTATION_PORTRAIT: number; + + /** + * Use with [requestedOrientation](Titanium.Android.Activity.requestedOrientation) to + * specify that orientation should be determined by the orientation sensor. + */ + const SCREEN_ORIENTATION_SENSOR: number; + + /** + * Use with [requestedOrientation](Titanium.Android.Activity.requestedOrientation) to + * specify that the system should use its default rules for determining the best + * orientation. + */ + const SCREEN_ORIENTATION_UNSPECIFIED: number; + + /** + * Use with [requestedOrientation](Titanium.Android.Activity.requestedOrientation) to + * specify that the system should use the user's preferred orientation. + */ + const SCREEN_ORIENTATION_USER: number; + + /** + * Always show this item as an action button in the action bar. + */ + const SHOW_AS_ACTION_ALWAYS: number; + + /** + * The action view can collapse to a normal menu item. + */ + const SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW: number; + + /** + * Show this item as an action button if the system decides there is room for it. + */ + const SHOW_AS_ACTION_IF_ROOM: number; + + /** + * Never display this item as an action button in the action bar. + */ + const SHOW_AS_ACTION_NEVER: number; + + /** + * When this item is in the action bar, always show it with a text label. + */ + const SHOW_AS_ACTION_WITH_TEXT: number; + + /** + * Standard Action Bar navigation mode + */ + const NAVIGATION_MODE_STANDARD: number; + + /** + * Action Bar tab navigation mode + */ + const NAVIGATION_MODE_TABS: number; + + /** + * A Service start mode indicating that if the host application is stopped by Android, the service should not be restarted automatically. + */ + const START_NOT_STICKY: number; + + /** + * A Service start mode indicating that if the host application is stopped by Android, the service should be restarted automatically and the original Intent re-sent. + */ + const START_REDELIVER_INTENT: number; + + /** + * Use with [audioStreamType](Titanium.Android.Notification.audioStreamType) to + * request that the alarm stream type for notifications be used. + */ + const STREAM_ALARM: number; + + /** + * Use with [audioStreamType](Titanium.Android.Notification.audioStreamType) to request that the + * default stream type for notifications be used. + */ + const STREAM_DEFAULT: number; + + /** + * Use with [audioStreamType](Titanium.Android.Notification.audioStreamType) to + * request that the music stream type for notifications be used. + */ + const STREAM_MUSIC: number; + + /** + * Use with [audioStreamType](Titanium.Android.Notification.audioStreamType) to request that the + * notification stream type for notifications be used. + */ + const STREAM_NOTIFICATION: number; + + /** + * Use with [audioStreamType](Titanium.Android.Notification.audioStreamType) to request that the + * ring stream type for notifications be used. + */ + const STREAM_RING: number; + + /** + * Use with [audioStreamType](Titanium.Android.Notification.audioStreamType) to request that the + * system stream type for notifications be used. + */ + const STREAM_SYSTEM: number; + + /** + * Use with [audioStreamType](Titanium.Android.Notification.audioStreamType) to request that the + * voice call stream type for notifications be used. + */ + const STREAM_VOICE_CALL: number; + + /** + * The URI scheme used for intent URIs. + */ + const URI_INTENT_SCHEME: number; + + /** + * Used with [NotificationChannel](Titanium.Android.NotificationChannel) to specify an importance level. + */ + const IMPORTANCE_DEFAULT: number; + + /** + * Used with [NotificationChannel](Titanium.Android.NotificationChannel) to specify an importance level. + */ + const IMPORTANCE_HIGH: number; + + /** + * Used with [NotificationChannel](Titanium.Android.NotificationChannel) to specify an importance level. + */ + const IMPORTANCE_LOW: number; + + /** + * Used with [NotificationChannel](Titanium.Android.NotificationChannel) to specify an importance level. + */ + const IMPORTANCE_MAX: number; + + /** + * Used with [NotificationChannel](Titanium.Android.NotificationChannel) to specify an importance level. + */ + const IMPORTANCE_MIN: number; + + /** + * Used with [NotificationChannel](Titanium.Android.NotificationChannel) to specify an importance level. + */ + const IMPORTANCE_NONE: number; + + /** + * Used with [NotificationChannel](Titanium.Android.NotificationChannel) to specify an importance level. + */ + const IMPORTANCE_UNSPECIFIED: number; + + /** + * Activity of the active context. + */ + const currentActivity: Titanium.Android.Activity; + + /** + * Service in the active context. + */ + const currentService: Titanium.Android.Service; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Creates an activity chooser intent, used to allow the user to select a target activity + * for an intent. + */ + function createIntentChooser(intent: Titanium.Android.Intent, title: string): Titanium.Android.Intent; + + /** + * Creates a [PendingIntent](Titanium.Android.PendingIntent) to be used inside a + * [Notification](Titanium.Android.Notification). + */ + function createPendingIntent(parameters?: any): Titanium.Android.PendingIntent; + + /** + * Create a so you can start/stop it and listen for events from it. + */ + function createService(intent: Titanium.Android.Intent): Titanium.Android.Service; + + /** + * Create an `Intent` to be used to start a service. + */ + function createServiceIntent(options: ServiceIntentOptions): Titanium.Android.Intent; + + /** + * Creates a [DrawerLayout](Titanium.UI.Android.DrawerLayout). + */ + function createDrawerLayout(parameters?: any): Titanium.UI.Android.DrawerLayout; + + /** + * Returns `true` if the app has permission access. + */ + function hasPermission(permission: string): boolean; + + /** + * Returns `true` if the app has permission access. + */ + function hasPermission(permission: ReadonlyArray): boolean; + + /** + * Request for permission access. + */ + function requestPermissions(permissions: string, callback?: (param0: RequestPermissionAccessResult) => any): void; + + /** + * Request for permission access. + */ + function requestPermissions(permissions: ReadonlyArray, callback?: (param0: RequestPermissionAccessResult) => any): void; + + /** + * Check on state of Service. + */ + function isServiceRunning(intent: Titanium.Android.Intent): boolean; + + /** + * Registers broadcast receiver for the given actions + */ + function registerBroadcastReceiver(broadcastReceiver: Titanium.Android.BroadcastReceiver, actions: ReadonlyArray): void; + + /** + * Unregisters a broadcast receiver + */ + function unregisterBroadcastReceiver(broadcastReceiver: Titanium.Android.BroadcastReceiver): void; + + /** + * Starts a simple service. + */ + function startService(intent: Titanium.Android.Intent): void; + + /** + * Stop a simple service that was started with `startService`. + */ + function stopService(intent: Titanium.Android.Intent): void; + + /** + * Create an `Intent` to be used in a broadcast. + */ + function createBroadcastIntent(parameters?: any): Titanium.Android.Intent; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Creates and returns an instance of . + */ + function createBigPictureStyle(parameters?: any): Titanium.Android.BigPictureStyle; + + /** + * Creates and returns an instance of . + */ + function createBigTextStyle(parameters?: any): Titanium.Android.BigTextStyle; + + /** + * Creates and returns an instance of . + */ + function createBroadcastReceiver(parameters?: any): Titanium.Android.BroadcastReceiver; + + /** + * Creates and returns an instance of . + */ + function createIntent(parameters?: any): Titanium.Android.Intent; + + /** + * Creates and returns an instance of . + */ + function createNotification(parameters?: any): Titanium.Android.Notification; + + /** + * Creates and returns an instance of . + */ + function createNotificationChannel(parameters?: any): Titanium.Android.NotificationChannel; + + /** + * Creates and returns an instance of . + */ + function createQuickSettingsService(parameters?: any): Titanium.Android.QuickSettingsService; + + /** + * Creates and returns an instance of . + */ + function createRemoteViews(parameters?: any): Titanium.Android.RemoteViews; + + /** + * An action bar is a window feature that identifies the application and user location, + * and provides user actions and navigation modes. + */ + interface ActionBar extends Titanium.Proxy { + /** + * The background image for the action bar, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Displays an "up" affordance on the "home" area of the action bar. + */ + displayHomeAsUp: boolean; + + /** + * Enable or disable the "home" button in the corner of the action bar. + */ + homeButtonEnabled: boolean; + + /** + * Sets the application icon displayed in the "home" area of the action bar, specified as a local file path or URL. + */ + icon: string; + + /** + * Sets the application logo displayed in the "home" area of the action bar, specified as a local file path or URL. + */ + logo: string; + + /** + * Controls the navigation mode. + */ + navigationMode: number; + + /** + * Callback function called when the home icon is clicked. + */ + onHomeIconItemSelected: () => any; + + /** + * Sets the subtitle of the action bar. + */ + subtitle: string; + + /** + * Sets the title of the action bar. + */ + title: string; + + /** + * Sets a view to be used for a custom navigation mode. + */ + customView: Titanium.UI.View; + + /** + * Hides the action bar if it is currently showing. + */ + hide(): void; + + /** + * Shows or hides the action bar home icon + */ + setDisplayShowHomeEnabled(show: boolean): void; + + /** + * Shows or hides the action bar title/subtitle + */ + setDisplayShowTitleEnabled(show: boolean): void; + + /** + * Shows the action bar if it is currently hidden. + */ + show(): void; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Sets the value of the property. + */ + setDisplayHomeAsUp(displayHomeAsUp: boolean): void; + + /** + * Sets the value of the property. + */ + setHomeButtonEnabled(homeButtonEnabled: boolean): void; + + /** + * Sets the value of the property. + */ + setIcon(icon: string): void; + + /** + * Sets the value of the property. + */ + setLogo(logo: string): void; + + /** + * Gets the value of the property. + */ + getNavigationMode(): number; + + /** + * Sets the value of the property. + */ + setNavigationMode(navigationMode: number): void; + + /** + * Sets the value of the property. + */ + setOnHomeIconItemSelected(onHomeIconItemSelected: () => any): void; + + /** + * Gets the value of the property. + */ + getSubtitle(): string; + + /** + * Sets the value of the property. + */ + setSubtitle(subtitle: string): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getCustomView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setCustomView(customView: any): void; + } - export enum FileStream { + + /** + * The Titanium binding of an Android Activity. + */ + interface Activity extends Titanium.Proxy { + /** + * The action bar for this activity. + */ + readonly actionBar: Titanium.Android.ActionBar; + + /** + * The `Intent` that was used to start this Activity. + */ + readonly intent: Titanium.Android.Intent; + + /** + * Callback function called when the Android activity is created. + */ + onCreate: (param0: any) => any; + + /** + * Callback function called to initially create an Android options menu + * for this Activity when the user presses the **Menu** button. + */ + onCreateOptionsMenu: (param0: any) => any; + + /** + * Callback function called when the Android activity is destroyed. + */ + onDestroy: (param0: any) => any; + + /** + * Callback function called when the Android activity is paused. + */ + onPause: (param0: any) => any; + + /** + * Callback function called to prepare an options menu for display when the user presses + * the **Menu** button. + */ + onPrepareOptionsMenu: (param0: any) => any; + + /** + * Callback function called when the Android activity is restarted. + */ + onRestart: (param0: any) => any; + + /** + * Callback function called when the Android activity is resumed. + */ + onResume: (param0: any) => any; + + /** + * Callback function called when the Android activity is started. + */ + onStart: (param0: any) => any; + + /** + * Callback function called when the Android activity is stopped. + */ + onStop: (param0: any) => any; + + /** + * Specifies a specific orientation for this activity. + */ + requestedOrientation: number; + + /** + * Toolbar instance that serves as ActionBar + */ + supportToolbar: Titanium.UI.Toolbar; + + /** + * Closes this activity. + */ + finish(): void; + + /** + * Gets an Android or Application string using the specified Resource ID and optional format arguments. + */ + getString(resourceId: number, format: any): string; + + /** + * Declares that the option menu has changed and should be recreated. + */ + invalidateOptionsMenu(): void; + + /** + * Sets the requested Activity orientation. + */ + setRequestedOrientation(orientation: number): void; + + /** + * Sets the result of this activity using an `Intent`. + */ + setResult(resultCode: number, intent?: Titanium.Android.Intent): void; + + /** + * Sets a toolbar instance to be used as an ActionBar. + */ + setSupportActionBar(toolbar: Titanium.UI.Toolbar): void; + + /** + * Starts a new activity, using the passed in `Intent` as the description. + */ + startActivity(intent: Titanium.Android.Intent): void; + + /** + * The same as `startActivity`, but also accepts a callback function for handling the result of the started Activity. + */ + startActivityForResult(intent: Titanium.Android.Intent, callback: (param0: ActivityResult) => any): void; + + /** + * Programmatically opens the options menu. + */ + openOptionsMenu(): void; + + /** + * Broadcast the passed in `Intent` to all `BroadcastReceiver`s. + */ + sendBroadcast(intent: Titanium.Android.Intent): void; + + /** + * Broadcast the passed in `Intent` to all `BroadcastReceiver`s with an optional permission. + */ + sendBroadcastWithPermission(intent: Titanium.Android.Intent, receiverPermission?: string): void; + + /** + * Gets the value of the property. + */ + getActionBar(): Titanium.Android.ActionBar; + + /** + * Gets the value of the property. + */ + getIntent(): Titanium.Android.Intent; + + /** + * Gets the value of the property. + */ + getOnCreate(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnCreate(onCreate: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOnCreateOptionsMenu(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnCreateOptionsMenu(onCreateOptionsMenu: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOnDestroy(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnDestroy(onDestroy: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOnPause(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnPause(onPause: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOnPrepareOptionsMenu(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnPrepareOptionsMenu(onPrepareOptionsMenu: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOnRestart(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnRestart(onRestart: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOnResume(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnResume(onResume: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOnStart(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnStart(onStart: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOnStop(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnStop(onStop: (param0: any) => any): void; + + /** + * Sets the value of the property. + */ + setRequestedOrientation(requestedOrientation: number): void; + + /** + * Gets the value of the property. + */ + getSupportToolbar(): Titanium.UI.Toolbar; + + /** + * Sets the value of the property. + */ + setSupportToolbar(supportToolbar: Titanium.UI.Toolbar): void; + + } + + /** + * Helper object for generating large-format notifications that include a large image attachment. + */ + interface BigPictureStyle extends Titanium.Proxy { + /** + * Override the when the big notification is shown. + */ + bigLargeIcon: number | string; + + /** + * Provide the bitmap to be used as the payload for the BigPicture notification. + */ + bigPicture: number | string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Overrides in the big form of the notification. This defaults to the value passed to . + */ + bigContentTitle: string; + + /** + * Number of times to retry decoding the bitmap at bigPicture URL. + */ + decodeRetries: number; + + /** + * Set the first line of text after the detail section in the big form of the notification. + */ + summaryText: string; + + /** + * Gets the value of the property. + */ + getBigLargeIcon(): number | string; + + /** + * Sets the value of the property. + */ + setBigLargeIcon(bigLargeIcon: number): void; + + /** + * Sets the value of the property. + */ + setBigLargeIcon(bigLargeIcon: string): void; + + /** + * Gets the value of the property. + */ + getBigPicture(): number | string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Sets the value of the property. + */ + setBigPicture(bigPicture: number): void; + + /** + * Sets the value of the property. + */ + setBigPicture(bigPicture: string): void; + + /** + * Sets the value of the property. + */ + setBigPicture(bigPicture: Titanium.Blob): void; + + /** + * Sets the value of the property. + */ + setBigPicture(bigPicture: Titanium.Filesystem.File): void; + + /** + * Gets the value of the property. + */ + getBigContentTitle(): string; + + /** + * Sets the value of the property. + */ + setBigContentTitle(bigContentTitle: string): void; + + /** + * Gets the value of the property. + */ + getDecodeRetries(): number; + + /** + * Sets the value of the property. + */ + setDecodeRetries(decodeRetries: number): void; + + /** + * Gets the value of the property. + */ + getSummaryText(): string; + + /** + * Sets the value of the property. + */ + setSummaryText(summaryText: string): void; + + } + + /** + * Helper object for generating large-format notifications that include a lot of text. + */ + interface BigTextStyle extends Titanium.Proxy { + /** + * Sets the longer text to be displayed in the big form of the notification in place of the content text. + */ + bigText: string; + + /** + * Overrides in the big form of the notification. This defaults to the value passed to . + */ + bigContentTitle: string; + + /** + * Set the first line of text after the detail section in the big form of the notification. + */ + summaryText: string; + + /** + * Gets the value of the property. + */ + getBigText(): string; + + /** + * Sets the value of the property. + */ + setBigText(bigText: string): void; + + /** + * Gets the value of the property. + */ + getBigContentTitle(): string; + + /** + * Sets the value of the property. + */ + setBigContentTitle(bigContentTitle: string): void; + + /** + * Gets the value of the property. + */ + getSummaryText(): string; + + /** + * Sets the value of the property. + */ + setSummaryText(summaryText: string): void; + + } + + /** + * Monitor and handle Android system broadcasts. + */ + interface BroadcastReceiver extends Titanium.Proxy { + /** + * The function called when a broadcast is received. + */ + onReceived: (param0: any) => any; + + /** + * URL of the JavaScript file to handle the broadcast. + */ + url: string; + + /** + * Gets the value of the property. + */ + getOnReceived(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnReceived(onReceived: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + } + + /** + * Message objects passed between Android application components. + */ + interface Intent extends Titanium.Proxy { + /** + * The action associated with this intent. + */ + action: string; + + /** + * The Java class name of the activity associated with this intent + * ([packageName](Titanium.Android.Intent.packageName) must also be set). + */ + className: string; + + /** + * The Intent's Data URI. + */ + readonly data: string; + + /** + * Intent flags. + */ + flags: number; + + /** + * The fully-qualified Java package name of the activity. + */ + packageName: string; + + /** + * The MIME type for this Intent. + */ + readonly type: string; + + /** + * The URL to a Titanium JavaScript Activity. + */ + url: string; + + /** + * Adds a category to this Intent. + */ + addCategory(name: string): void; + + /** + * Adds to the existing flags on the `Intent`. + */ + addFlags(flags: number): void; + + /** + * Get a property from this `Intent`. + */ + getBlobExtra(name: string): Titanium.Blob; + + /** + * Get a boolean property from this Intent. + */ + getBooleanExtra(name: string): boolean; + + /** + * Get the Data URI from this `Intent`. + */ + getData(): string; + + /** + * Get a double property from this `Intent`. + */ + getDoubleExtra(name: string): number; + + /** + * Get an integer property from this `Intent`. + */ + getIntExtra(name: string): number; + + /** + * Get a long property from this `Intent`. + */ + getLongExtra(name: string): number; + + /** + * Get a string property from this `Intent`. + */ + getStringExtra(name: string): string; + + /** + * Returns `true` if this `Intent` has the specified property. + */ + hasExtra(name: string): boolean; + + /** + * Puts an extra property on this `Intent`. + */ + putExtra(name: string, value: any): void; + + /** + * Put a URI property on this `Intent` (useful for ). + */ + putExtraUri(name: string, value: any): void; + + /** + * Gets the value of the property. + */ + getAction(): string; + + /** + * Sets the value of the property. + */ + setAction(action: string): void; + + /** + * Gets the value of the property. + */ + getClassName(): string; + + /** + * Sets the value of the property. + */ + setClassName(className: string): void; + + /** + * Gets the value of the property. + */ + getData(): string; + + /** + * Gets the value of the property. + */ + getFlags(): number; + + /** + * Sets the value of the property. + */ + setFlags(flags: number): void; + + /** + * Gets the value of the property. + */ + getPackageName(): string; + + /** + * Sets the value of the property. + */ + setPackageName(packageName: string): void; + + /** + * Gets the value of the property. + */ + getType(): string; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + } + + /** + * The Titanium binding of an Android Options Menu. + */ + interface Menu extends Titanium.Proxy { + /** + * Array of menu items in this menu. + */ + readonly items: Titanium.Android.MenuItem[]; + + /** + * Creates a from the passed creation options. + */ + add(options: any): Titanium.Android.MenuItem; + + /** + * Clears all items from this menu. + */ + clear(): void; + + /** + * Closes the menu, if visible. + */ + close(): void; + + /** + * Locates a [MenuItem](Titanium.Android.MenuItem) in this menu, by item ID or reference. + */ + findItem(item: number): Titanium.Android.MenuItem; + + /** + * Locates a [MenuItem](Titanium.Android.MenuItem) in this menu, by item ID or reference. + */ + findItem(item: Titanium.Android.MenuItem): Titanium.Android.MenuItem; + + /** + * Returns the [MenuItem](Titanium.Android.MenuItem) at a specific index. + */ + getItem(index: number): Titanium.Android.MenuItem; + + /** + * Returns `true` if this menu has visible items. + */ + hasVisibleItems(): boolean; + + /** + * Removes all menu items with the specified + * [groupId](Titanium.Android.MenuItem.groupId). + */ + removeGroup(groupId: number): void; + + /** + * Removes a specific [MenuItem](Titanium.Android.MenuItem) identified by its + * [itemId](Titanium.Android.MenuItem.itemId). + */ + removeItem(itemId: number): void; + + /** + * Enables or disables a group of menu items identified by a + * [groupId](Titanium.Android.MenuItem.groupId). + */ + setGroupEnabled(groupId: number, enabled: boolean): void; + + /** + * Shows or hides a group of menu items identified by a + * [groupId](Titanium.Android.MenuItem.groupId). + */ + setGroupVisible(groupId: number, visible: boolean): void; + + /** + * Number of items in this menu. + */ + size(): number; + + /** + * Gets the value of the property. + */ + getItems(): Titanium.Android.MenuItem[]; + + } + + /** + * The Titanium binding of an Android menu item. + */ + interface MenuItem extends Titanium.Proxy { + /** + * Custom view that replaces the default menu item button. + */ + actionView: Titanium.UI.View; + + /** + * True if this menu item's action view has been expanded. + */ + readonly actionViewExpanded: boolean; + + /** + * Determines if the item can be checked. + */ + checkable: boolean; + + /** + * Determines if the item is checked. + */ + checked: boolean; + + /** + * Determines if the item is enabled. + */ + enabled: boolean; + + /** + * Group ID for this item. + */ + readonly groupId: number; + + /** + * Icon to display for the this menu item. + */ + icon: number | string; + + /** + * Item ID for this item. + */ + readonly itemId: number; + + /** + * Integer used for controlling the category and sort order for menu items. + */ + readonly order: number; + + /** + * A set of flags that controls how this item appears in the action bar. + */ + showAsAction: number; + + /** + * Title of the item. + */ + title: string; + + /** + * Shortened version of the item's title. + */ + titleCondensed: string; + + /** + * Determines whether the menu item is visible. + */ + visible: boolean; + + /** + * Collapse the action view associated with this menu item. + */ + collapseActionView(): void; + + /** + * Expand the action view associated with this menu item. + */ + expandActionView(): void; + + /** + * Returns the [actionViewExpanded](Titanium.Android.MenuItem.actionViewExpanded) state of the menu item. + */ + isActionViewExpanded(): boolean; + + /** + * Returns the [checkable](Titanium.Android.MenuItem.checkable) state of the menu item. + */ + isCheckable(): boolean; + + /** + * Returns the [checked](Titanium.Android.MenuItem.checked) state of the menu item. + */ + isChecked(): boolean; + + /** + * Returns the [enabled](Titanium.Android.MenuItem.enabled) state of the menu item. + */ + isEnabled(): boolean; + + /** + * Returns the [visible](Titanium.Android.MenuItem.visible) state of the menu item. + */ + isVisible(): boolean; + + /** + * Sets the [checkable](Titanium.Android.MenuItem.checkable) state of the menu item. + */ + setCheckable(checkable: boolean): void; + + /** + * Sets the [checked](Titanium.Android.MenuItem.checked) state of the menu item. + */ + setChecked(enabled: boolean): void; + + /** + * Sets the [enabled](Titanium.Android.MenuItem.enabled) state of the menu item. + */ + setEnabled(enabled: boolean): void; + + /** + * Sets the [visible](Titanium.Android.MenuItem.visible) state of the menu item. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getActionView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setActionView(actionView: any): void; + + /** + * Gets the value of the property. + */ + getGroupId(): number; + + /** + * Sets the value of the property. + */ + setIcon(icon: number): void; + + /** + * Sets the value of the property. + */ + setIcon(icon: string): void; + + /** + * Gets the value of the property. + */ + getItemId(): number; + + /** + * Gets the value of the property. + */ + getOrder(): number; + + /** + * Sets the value of the property. + */ + setShowAsAction(showAsAction: number): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleCondensed(): string; + + /** + * Sets the value of the property. + */ + setTitleCondensed(titleCondensed: string): void; + + } + + /** + * UI notifications that can be sent while the application is in the background. + */ + interface Notification extends Titanium.Proxy { + /** + * The audio stream type to use when playing the sound. + */ + audioStreamType: number; + + /** + * Sets the notification's category. + */ + category: string; + + /** + * The `PendingIntent` to execute when the expanded status entry is clicked. + */ + contentIntent: Titanium.Android.PendingIntent; + + /** + * Description text of the notification. + */ + contentText: string; + + /** + * Title of the notification. + */ + contentTitle: string; + + /** + * Custom layout to display in the notification. + */ + contentView: Titanium.Android.RemoteViews; + + /** + * Specifies which values should be taken from the defaults. + */ + defaults: number; + + /** + * The `PendingIntent` to execute when the status entry is deleted by the user with the "Clear All Notifications" button. + */ + deleteIntent: Titanium.Android.PendingIntent; + + /** + * Set of flags for the notification. + */ + flags: number; + + /** + * The group key that the notification will belong to. + */ + groupKey: string; + + /** + * Specifies if this is a group summary notification. + */ + groupSummary: boolean; + + /** + * Notification icon, specified as an Android resource ID, or a local URL to a density-specific image. + */ + icon: number | string; + + /** + * Add a large icon to the notification (and the ticker on some devices) specified as an Android resource ID, or a local URL to a density-specific image. + */ + largeIcon: number | string; + + /** + * Accent color used behind icon. + */ + color: string; + + /** + * The color for the LED to blink. + */ + ledARGB: number; + + /** + * The number of milliseconds for the LED to be off while it's flashing. + */ + ledOffMS: number; + + /** + * The number of milliseconds for the LED to be on while it's flashing. + */ + ledOnMS: number; + + /** + * The number of events that this notification represents. + */ + number: number; + + /** + * Sets the priority of the notification. + */ + priority: number; + + /** + * A URL to the sound to play. + */ + sound: string; + + /** + * Style object that can apply a rich notification style. + */ + style: Titanium.Android.BigTextStyle | Titanium.Android.BigPictureStyle; + + /** + * Text to scroll across the screen when this item is added to the status bar. + */ + tickerText: string; + + /** + * Allows user to conceal private information of the notification on the lockscreen. + */ + visibility: number; + + /** + * Will wake up the device for the given time (in milliseconds) when the notification is shown. + * The application needs to also set the `android.permission.WAKE_LOCK` permission + * in the Android manifest section of the `tiapp.xml` file. + * + * + * + * + * + * + * + */ + wakeLock: wakeLockOptions; + + /** + * The timestamp for the notification (defaults to the current time). + */ + when: Date | number; + + /** + * Sets the latest event info using the built-in notification view for this notification. + */ + setLatestEventInfo(contentTitle: string, contentText: string, contentIntent: Titanium.Android.PendingIntent): void; + + /** + * Set the progress this notification represents. + */ + setProgress(max: number, progress: number, indeterminate: boolean): void; + + /** + * Add an action button to the notification + */ + addAction(icon: number, title: string, intent: Titanium.Android.PendingIntent): void; + + /** + * Add an action button to the notification + */ + addAction(icon: string, title: string, intent: Titanium.Android.PendingIntent): void; + + /** + * Gets the value of the property. + */ + getAudioStreamType(): number; + + /** + * Sets the value of the property. + */ + setAudioStreamType(audioStreamType: number): void; + + /** + * Gets the value of the property. + */ + getCategory(): string; + + /** + * Sets the value of the property. + */ + setCategory(category: string): void; + + /** + * Gets the value of the property. + */ + getContentIntent(): Titanium.Android.PendingIntent; + + /** + * Sets the value of the property. + */ + setContentIntent(contentIntent: Titanium.Android.PendingIntent): void; + + /** + * Gets the value of the property. + */ + getContentText(): string; + + /** + * Sets the value of the property. + */ + setContentText(contentText: string): void; + + /** + * Gets the value of the property. + */ + getContentTitle(): string; + + /** + * Sets the value of the property. + */ + setContentTitle(contentTitle: string): void; + + /** + * Sets the value of the property. + */ + setContentView(contentView: Titanium.Android.RemoteViews): void; + + /** + * Gets the value of the property. + */ + getDefaults(): number; + + /** + * Sets the value of the property. + */ + setDefaults(defaults: number): void; + + /** + * Gets the value of the property. + */ + getDeleteIntent(): Titanium.Android.PendingIntent; + + /** + * Sets the value of the property. + */ + setDeleteIntent(deleteIntent: Titanium.Android.PendingIntent): void; + + /** + * Gets the value of the property. + */ + getFlags(): number; + + /** + * Sets the value of the property. + */ + setFlags(flags: number): void; + + /** + * Gets the value of the property. + */ + getGroupKey(): string; + + /** + * Sets the value of the property. + */ + setGroupKey(groupKey: string): void; + + /** + * Gets the value of the property. + */ + getGroupSummary(): boolean; + + /** + * Sets the value of the property. + */ + setGroupSummary(groupSummary: boolean): void; + + /** + * Gets the value of the property. + */ + getIcon(): number | string; + + /** + * Sets the value of the property. + */ + setIcon(icon: number): void; + + /** + * Sets the value of the property. + */ + setIcon(icon: string): void; + + /** + * Gets the value of the property. + */ + getLargeIcon(): number | string; + + /** + * Sets the value of the property. + */ + setLargeIcon(largeIcon: number): void; + + /** + * Sets the value of the property. + */ + setLargeIcon(largeIcon: string): void; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getLedARGB(): number; + + /** + * Sets the value of the property. + */ + setLedARGB(ledARGB: number): void; + + /** + * Gets the value of the property. + */ + getLedOffMS(): number; + + /** + * Sets the value of the property. + */ + setLedOffMS(ledOffMS: number): void; + + /** + * Gets the value of the property. + */ + getLedOnMS(): number; + + /** + * Sets the value of the property. + */ + setLedOnMS(ledOnMS: number): void; + + /** + * Gets the value of the property. + */ + getNumber(): number; + + /** + * Sets the value of the property. + */ + setNumber(number: number): void; + + /** + * Gets the value of the property. + */ + getPriority(): number; + + /** + * Sets the value of the property. + */ + setPriority(priority: number): void; + + /** + * Gets the value of the property. + */ + getSound(): string; + + /** + * Sets the value of the property. + */ + setSound(sound: string): void; + + /** + * Gets the value of the property. + */ + getStyle(): Titanium.Android.BigTextStyle | Titanium.Android.BigPictureStyle; + + /** + * Sets the value of the property. + */ + setStyle(style: Titanium.Android.BigTextStyle): void; + + /** + * Sets the value of the property. + */ + setStyle(style: Titanium.Android.BigPictureStyle): void; + + /** + * Gets the value of the property. + */ + getTickerText(): string; + + /** + * Sets the value of the property. + */ + setTickerText(tickerText: string): void; + + /** + * Gets the value of the property. + */ + getVisibility(): number; + + /** + * Sets the value of the property. + */ + setVisibility(visibility: number): void; + + /** + * Gets the value of the property. + */ + getWakeLock(): wakeLockOptions; + + /** + * Sets the value of the property. + */ + setWakeLock(wakeLock: wakeLockOptions): void; + + /** + * Gets the value of the property. + */ + getWhen(): Date | number; + + /** + * Sets the value of the property. + */ + setWhen(when: Date): void; + + /** + * Sets the value of the property. + */ + setWhen(when: number): void; + + } + + /** + * Module for notification channels. + */ + interface NotificationChannel extends Titanium.Proxy { + /** + * Whether or not notifications posted to this channel can interrupt the user. + */ + bypassDnd: boolean; + + /** + * User visible description of this channel. + */ + description: string; + + /** + * Whether notifications posted to this channel should display notification lights + */ + enableLights: boolean; + + /** + * Whether notification posted to this channel should vibrate. + */ + enableVibration: boolean; + + /** + * Group id this channel belongs to. + */ + groupId: string; + + /** + * The audio stream type to use when playing the sound. + */ + importance: number; + + /** + * The channel id specified for the notification channel. + */ + id: string; + + /** + * The notification light color for notifications posted to this channel. + */ + lightColor: number; + + /** + * Whether or not notifications posted to this channel are shown on the lockscreen in full or redacted form. + */ + lockscreenVisibility: number; + + /** + * Whether notifications posted to this channel can appear as application icon badges in a Launcher. + */ + showBadge: boolean; + + /** + * The vibration pattern for notifications posted to this channel. + */ + vibratePattern: number[]; + + /** + * Gets the value of the property. + */ + getBypassDnd(): boolean; + + /** + * Sets the value of the property. + */ + setBypassDnd(bypassDnd: boolean): void; + + /** + * Gets the value of the property. + */ + getDescription(): string; + + /** + * Sets the value of the property. + */ + setDescription(description: string): void; + + /** + * Gets the value of the property. + */ + getEnableLights(): boolean; + + /** + * Sets the value of the property. + */ + setEnableLights(enableLights: boolean): void; + + /** + * Gets the value of the property. + */ + getEnableVibration(): boolean; + + /** + * Sets the value of the property. + */ + setEnableVibration(enableVibration: boolean): void; + + /** + * Gets the value of the property. + */ + getGroupId(): string; + + /** + * Sets the value of the property. + */ + setGroupId(groupId: string): void; + + /** + * Gets the value of the property. + */ + getImportance(): number; + + /** + * Sets the value of the property. + */ + setImportance(importance: number): void; + + /** + * Gets the value of the property. + */ + getId(): string; + + /** + * Sets the value of the property. + */ + setId(id: string): void; + + /** + * Gets the value of the property. + */ + getLightColor(): number; + + /** + * Sets the value of the property. + */ + setLightColor(lightColor: number): void; + + /** + * Gets the value of the property. + */ + getLockscreenVisibility(): number; + + /** + * Sets the value of the property. + */ + setLockscreenVisibility(lockscreenVisibility: number): void; + + /** + * Gets the value of the property. + */ + getShowBadge(): boolean; + + /** + * Sets the value of the property. + */ + setShowBadge(showBadge: boolean): void; + + /** + * Gets the value of the property. + */ + getVibratePattern(): number[]; + + /** + * Sets the value of the property. + */ + setVibratePattern(vibratePattern: ReadonlyArray): void; + + } + + /** + * The Titanium binding of an Android `PendingIntent`. + */ + interface PendingIntent extends Titanium.Proxy { + /** + * Flags used for creating the Pending Intent. + */ + flags: number; + + /** + * The intent data to pass to the [Activity](Titanium.Android.Activity) launched by this `PendingIntent`. + */ + intent: Titanium.Android.Intent; + + /** + * If this property is true, flag will be + * appended to `flags` automatically. Default value is true. + */ + updateCurrentIntent: boolean; + + /** + * Gets the value of the property. + */ + getFlags(): number; + + /** + * Sets the value of the property. + */ + setFlags(flags: number): void; + + /** + * Gets the value of the property. + */ + getIntent(): Titanium.Android.Intent; + + /** + * Sets the value of the property. + */ + setIntent(intent: Titanium.Android.Intent): void; + + /** + * Gets the value of the property. + */ + getUpdateCurrentIntent(): boolean; + + /** + * Sets the value of the property. + */ + setUpdateCurrentIntent(updateCurrentIntent: boolean): void; + + } + + /** + * Android service for creating custom quick settings tiles and handling user's interaction with them. + */ + interface QuickSettingsService extends Titanium.Proxy { + /** + * The intent used to start or bind to the Service. + */ + readonly intent: Titanium.Android.Intent; + + /** + * A service can be started more than once -- this number (based on an incrementing integer) + * indicates which "start number" in the sequence the current service instance is. + */ + readonly serviceInstanceId: number; + + /** + * Starts the Service. + */ + start(): void; + + /** + * Stops this running instance of the Service. + */ + stop(): void; + + /** + * Applies current tile's properties. + */ + updateTile(): void; + + /** + * Changes the Tile's icon. + */ + setIcon(icon: string): void; + + /** + * Changes the Tile's icon. + */ + setIcon(icon: Titanium.Blob): void; + + /** + * Changes the Tile's icon. + */ + setIcon(icon: Titanium.Filesystem.File): void; + + /** + * Sets the state of the Tile. + */ + setState(state: number): void; + + /** + * Changes the Tile's label. + */ + setLabel(label: string): void; + + /** + * Returns the Tile's current icon. + */ + getIcon(): string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Returns the Tile's current state. + */ + getState(): number; + + /** + * Returns 'true' if the device is in secure state, 'false' otherwise. + */ + isSecure(): boolean; + + /** + * Opens an Alert dialog. + */ + showDialog(options: showParams): void; + + /** + * Colapses the quick settings menu and starts an activity for the passed Intent. + */ + startActivityAndCollapse(intent: Titanium.Android.Intent): void; + + /** + * Prompts the user to unlock the device and runs the JS code. + */ + unlockAndRun(jsCode: string): void; + + /** + * Gets the value of the property. + */ + getIntent(): Titanium.Android.Intent; + + /** + * Gets the value of the property. + */ + getServiceInstanceId(): number; + + } + + /** + * The Titanium binding of [Android RemoteViews](http://developer.android.com/reference/android/widget/RemoteViews.html). + */ + interface RemoteViews extends Titanium.Proxy { + /** + * Android layout resource ID for the view to display. Required. + */ + layoutId: number; + + /** + * Package name that the resource ID lives in. Optional. + */ + packageName: string; + + /** + * Calls a method taking a single `boolean` argument on a view in the remote view + * hierarchy. See Android's documentation for + * [setBoolean](http://developer.android.com/reference/android/widget/RemoteViews.html#setBoolean(int, java.lang.String, boolean)). + */ + setBoolean(viewId: number, methodName: string, value: boolean): void; + + /** + * Sets the base time, format string, and started flag for a chronometer + * in the remote view hierarchy. + */ + setChronometer(viewId: number, base: Date, format: string, started: boolean): void; + + /** + * Calls a method taking a single `double` argument on a view in the remote view + * hierarchy. + */ + setDouble(viewId: number, methodName: string, value: number): void; + + /** + * Sets the image for an image view in the remote view hierarchy using an Android drawable resource. + */ + setImageViewResource(viewId: number, srcId: number): void; + + /** + * Sets the image for an image view in the remote view hierarchy using a URI. + */ + setImageViewUri(viewId: number, uri: string): void; + + /** + * Calls a method taking a single `int` argument on a view in the remote view hierarchy. + */ + setInt(viewId: number, methodName: string, value: number): void; + + /** + * Launches a when the specified view is clicked. + */ + setOnClickPendingIntent(viewId: number, pendingIntent: Titanium.Android.PendingIntent): void; + + /** + * Sets the progress, max value, and indeterminate flag of a progress bar in the + * remote view hierarchy. + */ + setProgressBar(viewId: number, max: number, progress: number, indeterminate: boolean): void; + + /** + * Calls a method taking a single String argument on a view in the remote view + * hierarchy. + */ + setString(viewId: number, methodName: string, value: string): void; + + /** + * Sets the text color of a view in the remote view hierarchy. + */ + setTextColor(viewId: number, color: number): void; + + /** + * Sets the text of a text view in the remote view hierarchy. + */ + setTextViewText(viewId: number, text: string): void; + + /** + * Calls a method taking one URI on a view in the remote view hierarchy. + */ + setUri(viewId: number, methodName: string, value: string): void; + + /** + * Sets the visibility of a view in the remote view hierarchy. + */ + setViewVisibility(viewId: number, visibility: number): void; + + /** + * Gets the value of the property. + */ + getLayoutId(): number; + + /** + * Sets the value of the property. + */ + setLayoutId(layoutId: number): void; + + /** + * Gets the value of the property. + */ + getPackageName(): string; + + /** + * Sets the value of the property. + */ + setPackageName(packageName: string): void; + + } + + /** + * Android application component that executes in the background. + */ + interface Service extends Titanium.Proxy { + /** + * The intent used to start or bind to the Service. + */ + readonly intent: Titanium.Android.Intent; + + /** + * A service can be started more than once -- this number (based on an incrementing integer) + * indicates which "start number" in the sequence the current service instance is. + */ + readonly serviceInstanceId: number; + + /** + * Starts the Service. + */ + start(): void; + + /** + * Stops this running instance of the Service. + */ + stop(): void; + + /** + * Gets the value of the property. + */ + getIntent(): Titanium.Android.Intent; + + /** + * Gets the value of the property. + */ + getServiceInstanceId(): number; + + } + + + /** + * The Android.Calendar module provides proxies and methods for accessing the native Android + * calendar functionality. + */ + namespace Calendar { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Reminder alert delivery method. + */ + const METHOD_ALERT: number; + + /** + * Reminder default delivery method. + */ + const METHOD_DEFAULT: number; + + /** + * Reminder email delivery method. + */ + const METHOD_EMAIL: number; + + /** + * Reminder SMS delivery method. + */ + const METHOD_SMS: number; + + /** + * Alert dismissed state. + */ + const STATE_DISMISSED: number; + + /** + * Alert fired state. + */ + const STATE_FIRED: number; + + /** + * Alert scheduled status. + */ + const STATE_SCHEDULED: number; + + /** + * Event canceled status. + */ + const STATUS_CANCELED: number; + + /** + * Event confirmed status. + */ + const STATUS_CONFIRMED: number; + + /** + * Event tentative status. + */ + const STATUS_TENTATIVE: number; + + /** + * Event confidential visibility. + */ + const VISIBILITY_CONFIDENTIAL: number; + + /** + * Event default visibility. + */ + const VISIBILITY_DEFAULT: number; + + /** + * Event private visibility. + */ + const VISIBILITY_PRIVATE: number; + + /** + * Event public visibility. + */ + const VISIBILITY_PUBLIC: number; + + /** + * All alerts in selected calendars. + */ + const allAlerts: Titanium.Android.Calendar.Alert[]; + + /** + * All calendars known to the native calendar app. + */ + const allCalendars: Titanium.Android.Calendar.Calendar[]; + + /** + * All calendars selected within the native calendar app, which may be a subset of `allCalendars`. + */ + const selectableCalendars: Titanium.Android.Calendar.Calendar[]; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the calendar with the specified identifier. + */ + function getCalendarById(id: number): Titanium.Android.Calendar.Calendar; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getAllAlerts(): Titanium.Android.Calendar.Alert[]; + + /** + * Gets the value of the property. + */ + function getAllCalendars(): Titanium.Android.Calendar.Calendar[]; + + /** + * Gets the value of the property. + */ + function getSelectableCalendars(): Titanium.Android.Calendar.Calendar[]; + + /** + * An object that represents a single alert for an event in an Android calendar. + */ + interface Alert extends Titanium.Proxy { + /** + * Date/time at which this alert alarm is set to trigger. + */ + readonly alarmTime: Date; + + /** + * Start date/time for the corresponding event. + */ + readonly begin: Date; + + /** + * End date/time for the corresponding event. + */ + readonly end: Date; + + /** + * Identifier of the event for which this alert is set. + */ + readonly eventId: number; + + /** + * Identifier of this alert. + */ + readonly id: string; + + /** + * Reminder notice period in minutes, that determines how long prior to the event this alert + * should trigger. + */ + readonly minutes: number; + + /** + * The current state of the alert. + */ + readonly state: number; + + /** + * Gets the value of the property. + */ + getAlarmTime(): Date; + + /** + * Gets the value of the property. + */ + getBegin(): Date; + + /** + * Gets the value of the property. + */ + getEnd(): Date; + + /** + * Gets the value of the property. + */ + getEventId(): number; + + /** + * Gets the value of the property. + */ + getId(): string; + + /** + * Gets the value of the property. + */ + getMinutes(): number; + + /** + * Gets the value of the property. + */ + getState(): number; + + } + + /** + * An object that represents a single calendar on Android. + */ + interface Calendar extends Titanium.Proxy { + /** + * Indicates whether this calendar is hidden. + */ + readonly hidden: boolean; + + /** + * Identifier of this calendar. + */ + readonly id: string; + + /** + * Display name of this calendar. + */ + readonly name: string; + + /** + * Indicates whether the calendar is selected. + */ + readonly selected: boolean; + + /** + * Creates an event in this calendar. + */ + createEvent(properties: any): Titanium.Android.Calendar.Event; + + /** + * Gets the event with the specified identifier. + */ + getEventById(id: number): Titanium.Android.Calendar.Event; + + /** + * Gets events that occur between two dates. + */ + getEventsBetweenDates(date1: Date, date2: Date): Titanium.Android.Calendar.Event[]; + + /** + * Gets events that occur on a specified date. + */ + getEventsInDate(year: number, month: number, day: number): Titanium.Android.Calendar.Event[]; + + /** + * Gets events that occur during a specified month. + */ + getEventsInMonth(year: number, month: number): Titanium.Android.Calendar.Event[]; + + /** + * Gets all events that occur during a specified year. + */ + getEventsInYear(year: number): Titanium.Android.Calendar.Event[]; + + /** + * Gets the value of the property. + */ + getHidden(): boolean; + + /** + * Gets the value of the property. + */ + getId(): string; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Gets the value of the property. + */ + getSelected(): boolean; + + } + + /** + * An object that represents a single event in an Android calendar. + */ + interface Event extends Titanium.Proxy { + /** + * Existing alerts for this event. + */ + readonly alerts: Titanium.Android.Calendar.Alert[]; + + /** + * Indicates whether this event is all day. + */ + readonly allDay: boolean; + + /** + * Start date/time of this event. + */ + readonly begin: Date; + + /** + * Description of this event. + */ + readonly description: string; + + /** + * End date/time of this event. + */ + readonly end: Date; + + /** + * Extended properties of this event. + */ + readonly extendedProperties: any; + + /** + * Indicates whether an alarm is scheduled for this event. + */ + readonly hasAlarm: boolean; + + /** + * Indicates whether [extendedProperties](Titanium.Android.Calendar.Event.extendedProperties) + * exists for this event. + */ + readonly hasExtendedProperties: boolean; + + /** + * Identifier of this event. + */ + readonly id: string; + + /** + * Location of this event. + */ + readonly location: string; + + /** + * Existing reminders for this event. + */ + readonly reminders: Titanium.Android.Calendar.Reminder[]; + + /** + * Status of this event. + */ + readonly status: number; + + /** + * Title of this event. + */ + readonly title: string; + + /** + * Visibility of this event. + */ + readonly visibility: number; + + /** + * Creates an alert for this event. + */ + createAlert(data: any): Titanium.Android.Calendar.Alert; + + /** + * Creates a reminder for this event. + */ + createReminder(data: any): Titanium.Android.Calendar.Reminder; + + /** + * Gets the value of the specified extended property. + */ + getExtendedProperty(name: string): string; + + /** + * Sets the value of the specified extended property. + */ + setExtendedProperty(name: string, value: string): void; + + /** + * Gets the value of the property. + */ + getAlerts(): Titanium.Android.Calendar.Alert[]; + + /** + * Gets the value of the property. + */ + getAllDay(): boolean; + + /** + * Gets the value of the property. + */ + getBegin(): Date; + + /** + * Gets the value of the property. + */ + getDescription(): string; + + /** + * Gets the value of the property. + */ + getEnd(): Date; + + /** + * Gets the value of the property. + */ + getExtendedProperties(): any; + + /** + * Gets the value of the property. + */ + getHasAlarm(): boolean; + + /** + * Gets the value of the property. + */ + getHasExtendedProperties(): boolean; + + /** + * Gets the value of the property. + */ + getId(): string; + + /** + * Gets the value of the property. + */ + getLocation(): string; + + /** + * Gets the value of the property. + */ + getReminders(): Titanium.Android.Calendar.Reminder[]; + + /** + * Gets the value of the property. + */ + getStatus(): number; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Gets the value of the property. + */ + getVisibility(): number; + + } + + /** + * An object that represents a single reminder for an event in an Android calendar. + */ + interface Reminder extends Titanium.Proxy { + /** + * Identifier of this reminder. + */ + readonly id: string; + + /** + * Method by which this reminder will be delivered. + */ + readonly method: number; + + /** + * Reminder notice period in minutes, that determines how long prior to the event this reminder + * should trigger. + */ + readonly minutes: number; + + /** + * Gets the value of the property. + */ + getId(): string; + + /** + * Gets the value of the property. + */ + getMethod(): number; + + /** + * Gets the value of the property. + */ + getMinutes(): number; + + } + + } + + /** + * Module for managing notifications. + */ + namespace NotificationManager { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Use instead. + */ + const DEFAULT_ALL: number; + + /** + * Use instead. + */ + const DEFAULT_LIGHTS: number; + + /** + * Use instead. + */ + const DEFAULT_SOUND: number; + + /** + * Use instead. + */ + const DEFAULT_VIBRATE: number; + + /** + * Use instead. + */ + const FLAG_AUTO_CANCEL: number; + + /** + * Use instead. + */ + const FLAG_INSISTENT: number; + + /** + * Use instead. + */ + const FLAG_NO_CLEAR: number; + + /** + * Use instead. + */ + const FLAG_ONGOING_EVENT: number; + + /** + * Use instead. + */ + const FLAG_ONLY_ALERT_ONCE: number; + + /** + * Use instead. + */ + const FLAG_SHOW_LIGHTS: number; + + /** + * Use instead. + */ + const STREAM_DEFAULT: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Cancels a previously displayed notification. + */ + function cancel(id: number): void; + + /** + * Cancels all previously displayed notifications. + */ + function cancelAll(): void; + + /** + * Adds a persistent notification to the status bar. + */ + function notify(id: number, notification: Titanium.Android.Notification): void; + + /** + * Create a notification channel. + */ + function createNotificationChannel(parameters: any): Titanium.Android.NotificationChannel; + + /** + * Returns whether showing notifications is enabled for the application. + */ + function areNotificationsEnabled(): boolean; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + } + + /** + * The Titanium binding of the Android system-wide resources class. + */ + namespace R { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Animation resources. See + * [R.anim](http://developer.android.com/reference/android/R.anim.html) + * in the Android Developer Reference. + */ + const anim: any; + + /** + * Array resources. See [R.array](http://developer.android.com/reference/android/R.array.html) + * in the Android Developer Reference. + */ + const array: any; + + /** + * Attribute resources. See + * [R.attr](http://developer.android.com/reference/android/R.attr.html) + * in the Android Developer Reference. + */ + const attr: any; + + /** + * Color resources. See + * [R.color](http://developer.android.com/reference/android/R.color.html) + * in the Android Developer Reference. + */ + const color: any; + + /** + * Dimension resources. See + * [http://developer.android.com/reference/android/R.dimen.html](http://developer.android.com/reference/android/R.dimen.html) + * in the Android Developer Reference. + */ + const dimen: any; + + /** + * Drawable resources. See + * [R.drawable](http://developer.android.com/reference/android/R.drawable.html) + * in the Android Developer Reference. + * Accessing drawables using Ti.Android.R.drawable is deprecated and not a recommended practice since the system provided + * drawables can be removed across Android versions. Prefer to copy the images to application res folder. + */ + const drawable: any; + + /** + * ID resources. See + * [R.id](http://developer.android.com/reference/android/R.id.html) + * in the Android Developer Reference. + */ + const id: any; + + /** + * Integer resources. See + * [R.integer](http://developer.android.com/reference/android/R.integer.html) + * in the Android Developer Reference. + */ + const integer: any; + + /** + * Layout resources. See + * [R.layout](http://developer.android.com/reference/android/R.layout.html) + * in the Android Developer Reference. + */ + const layout: any; + + /** + * String resources. See + * [R.string](http://developer.android.com/reference/android/R.string.html) + * in the Android Developer Reference. + */ + const string: any; + + /** + * Style resources. See + * [R.style](http://developer.android.com/reference/android/R.style.html) + * in the Android Developer Reference. + */ + const style: any; + + /** + * Styleable reosurces. See + * [R.styleable](http://developer.android.com/reference/android/R.styleable.html) + * in the Android Developer Reference. + */ + const styleable: any; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; } } - export module Network { - export var INADDR_ANY : string; - export var NETWORK_LAN : number; - export var NETWORK_MOBILE : number; - export var NETWORK_NONE : number; - export var NETWORK_UNKNOWN : number; - export var NETWORK_WIFI : number; - export var NOTIFICATION_TYPE_ALERT : number; - export var NOTIFICATION_TYPE_BADGE : number; - export var NOTIFICATION_TYPE_NEWSSTAND : number; - export var NOTIFICATION_TYPE_SOUND : number; - export var PROGRESS_UNKNOWN : number; - export var READ_MODE : number; - export var READ_WRITE_MODE : number; - export var SOCKET_CLOSED : number; - export var SOCKET_CONNECTED : number; - export var SOCKET_ERROR : number; - export var SOCKET_INITIALIZED : number; - export var SOCKET_LISTENING : number; - export var TLS_VERSION_1_0 : number; - export var TLS_VERSION_1_1 : number; - export var TLS_VERSION_1_2 : number; - export var WRITE_MODE : number; - export var allHTTPCookies : Array; - export var apiName : string; - export var bubbleParent : boolean; - export var httpURLFormatter : (...args : any[]) => any; - export var networkType : number; - export var networkTypeName : string; - export var online : boolean; - export var remoteDeviceUUID : string; - export var remoteNotificationTypes : Array; - export var remoteNotificationsEnabled : boolean; - export function addConnectivityListener (callback: (...args : any[]) => any) : void; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function addHTTPCookie (cookie: Ti.Network.Cookie) : void; - export function addSystemCookie (cookie: Ti.Network.Cookie) : void; - export function applyProperties (props: Dictionary) : void; - export function createBonjourBrowser (serviceType: string, domain: string, parameters?: Dictionary) : Ti.Network.BonjourBrowser; - export function createBonjourService (name: string, type: string, domain: string, parameters?: Dictionary) : Ti.Network.BonjourService; - export function createCookie (parameters?: Dictionary) : Ti.Network.Cookie; - export function createHTTPClient (parameters?: Dictionary) : Ti.Network.HTTPClient; - export function createTCPSocket (hostName: string, port: number, mode: number, parameters: Dictionary) : Ti.Network.TCPSocket; - export function decodeURIComponent (value: string) : string; - export function encodeURIComponent (value: string) : string; - export function fireEvent (name: string, event: Dictionary) : void; - export function getAllHTTPCookies () : Array; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function getHTTPCookies (domain: string, path: string, name: string) : Array; - export function getHTTPCookiesForDomain (domain: string) : Array; - export function getHttpURLFormatter () : (...args : any[]) => any; - export function getNetworkType () : number; - export function getNetworkTypeName () : string; - export function getOnline () : boolean; - export function getRemoteDeviceUUID () : string; - export function getRemoteNotificationTypes () : Array; - export function getRemoteNotificationsEnabled () : boolean; - export function getSystemCookies (domain: string, path: string, name: string) : Array; - export function registerForPushNotifications (config: PushNotificationConfig) : void; - export function removeAllHTTPCookies () : void; - export function removeAllSystemCookies () : void; - export function removeConnectivityListener (callback: (...args : any[]) => any) : void; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function removeHTTPCookie (domain: string, path: string, name: string) : void; - export function removeHTTPCookiesForDomain (domain: string) : void; - export function removeSystemCookie (domain: string, path: string, name: string) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setHttpURLFormatter (httpURLFormatter: (...args : any[]) => any) : void; - export function unregisterForPushNotifications () : void; - export interface TCPSocket extends Ti.Proxy { - hostName : string; - isValid : boolean; - mode : number; - port : number; - stripTerminator : boolean; - close () : void; - connect () : void; - getHostName () : string; - getIsValid () : boolean; - getMode () : number; - getPort () : number; - getStripTerminator () : boolean; - listen () : void; - setHostName (hostName: string) : void; - setIsValid (isValid: boolean) : void; - setMode (mode: number) : void; - setPort (port: number) : void; - setStripTerminator (stripTerminator: boolean) : void; - write (data: any, sendTo: number) : void; - write (data: string, sendTo: number) : void; - } - export module Socket { - export var CLOSED : number; - export var CONNECTED : number; - export var ERROR : number; - export var INITIALIZED : number; - export var LISTENING : number; - export var apiName : string; - export var bubbleParent : boolean; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createTCP (params?: Dictionary) : Ti.Network.Socket.TCP; - export function createUDP (params?: Dictionary) : Ti.Network.Socket.UDP; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface UDP extends Ti.IOStream { - data : (...args : any[]) => any; - error : (...args : any[]) => any; - port : number; - started : (...args : any[]) => any; - getData () : (...args : any[]) => any; - getError () : (...args : any[]) => any; - getPort () : number; - getStarted () : (...args : any[]) => any; - sendBytes (port: number, host: string, data: Array) : void; - sendString (port: number, host: string, data: string) : void; - setData (data: (...args : any[]) => any) : void; - setError (error: (...args : any[]) => any) : void; - setPort (port: number) : void; - setStarted (started: (...args : any[]) => any) : void; - start (port: number) : void; - stop () : void; + + /** + * The top-level App module is mainly used for accessing information about the + * application at runtime, and for sending or listening for system events. + */ + namespace App { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Convenience constant for system event "accessibilityannouncement". + */ + const EVENT_ACCESSIBILITY_ANNOUNCEMENT: string; + + /** + * Convenience constant for system event "accessibilitychanged". + */ + const EVENT_ACCESSIBILITY_CHANGED: string; + + /** + * Indicates whether Accessibility is enabled by the system. + */ + const accessibilityEnabled: boolean; + + /** + * Indicates whether Analytics is enabled, determined by `tiapp.xml`. + */ + const analytics: boolean; + + /** + * Application copyright statement, determined by `tiapp.xml`. + */ + const copyright: string; + + /** + * Build type that reflects how the application was packaged. + * Returns one of the following values: + * * `development` (Simulator) + * * `test` (Device) + * * `production` (App Store / Adhoc) + */ + const deployType: string; + + /** + * Application description, determined by `tiapp.xml`. + */ + const description: string; + + /** + * Application globally-unique ID, determined by `tiapp.xml`. + */ + const guid: string; + + /** + * Shows the application's splash screen on app resume. + */ + let forceSplashAsSnapshot: boolean; + + /** + * Application ID, from `tiapp.xml`. + */ + const id: string; + + /** + * The install ID for this application. + */ + const installId: string; + + /** + * Determines whether the screen is locked when the device is idle. + */ + let idleTimerDisabled: boolean; + + /** + * Application name, determined by `tiapp.xml`. + */ + const name: string; + + /** + * Determines whether proximity detection is enabled. + */ + let proximityDetection: boolean; + + /** + * Indicates the state of the device's proximity sensor, according to the + * event. + */ + const proximityState: boolean; + + /** + * Prevents network activity indicator from being displayed. + */ + let disableNetworkActivityIndicator: boolean; + + /** + * Application publisher, from `tiapp.xml`. + */ + const publisher: string; + + /** + * Unique session identifier for the current continuous run of the application. + */ + const sessionId: string; + + /** + * Application URL, from `tiapp.xml`. + */ + const url: string; + + /** + * Application version, from `tiapp.xml`. + */ + const version: string; + + /** + * Indicates whether or not the soft keyboard is visible. + */ + const keyboardVisible: boolean; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Fire a system-level event such as . + */ + function fireSystemEvent(eventName: string, param?: any): void; + + /** + * Returns the arguments passed to the application on startup. + */ + function getArguments(): launchOptions; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getAccessibilityEnabled(): boolean; + + /** + * Gets the value of the property. + */ + function getAnalytics(): boolean; + + /** + * Gets the value of the property. + */ + function getCopyright(): string; + + /** + * Gets the value of the property. + */ + function getDeployType(): string; + + /** + * Gets the value of the property. + */ + function getDescription(): string; + + /** + * Gets the value of the property. + */ + function getGuid(): string; + + /** + * Gets the value of the property. + */ + function getForceSplashAsSnapshot(): boolean; + + /** + * Sets the value of the property. + */ + function setForceSplashAsSnapshot(forceSplashAsSnapshot: boolean): void; + + /** + * Gets the value of the property. + */ + function getId(): string; + + /** + * Gets the value of the property. + */ + function getInstallId(): string; + + /** + * Gets the value of the property. + */ + function getIdleTimerDisabled(): boolean; + + /** + * Sets the value of the property. + */ + function setIdleTimerDisabled(idleTimerDisabled: boolean): void; + + /** + * Gets the value of the property. + */ + function getName(): string; + + /** + * Gets the value of the property. + */ + function getProximityDetection(): boolean; + + /** + * Sets the value of the property. + */ + function setProximityDetection(proximityDetection: boolean): void; + + /** + * Gets the value of the property. + */ + function getProximityState(): boolean; + + /** + * Gets the value of the property. + */ + function getDisableNetworkActivityIndicator(): boolean; + + /** + * Sets the value of the property. + */ + function setDisableNetworkActivityIndicator(disableNetworkActivityIndicator: boolean): void; + + /** + * Gets the value of the property. + */ + function getPublisher(): string; + + /** + * Gets the value of the property. + */ + function getSessionId(): string; + + /** + * Gets the value of the property. + */ + function getUrl(): string; + + /** + * Gets the value of the property. + */ + function getVersion(): string; + + /** + * Gets the value of the property. + */ + function getKeyboardVisible(): boolean; + + + /** + * A module used to access Android application resources. + */ + namespace Android { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * The `R` namespace for application resources. + */ + const R: Titanium.App.Android.R; + + /** + * The version number of the application. + */ + const appVersionCode: number; + + /** + * The version name of the application. + */ + const appVersionName: string; + + /** + * Return the intent that was used to launch the application. + */ + const launchIntent: Titanium.Android.Intent; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getAppVersionCode(): number; + + /** + * Gets the value of the property. + */ + function getAppVersionName(): string; + + /** + * Gets the value of the property. + */ + function getLaunchIntent(): Titanium.Android.Intent; + + /** + * The Titanium binding of the native Android `R` class, giving access to application resources. + */ + interface R extends Titanium.Proxy { } - export interface TCP extends Ti.IOStream { - accepted : (...args : any[]) => any; - connected : (...args : any[]) => any; - error : (...args : any[]) => any; - host : string; - listenQueueSize : number; - port : number; - state : number; - timeout : number; - accept (options: AcceptDict) : void; - connect () : void; - getAccepted () : (...args : any[]) => any; - getConnected () : (...args : any[]) => any; - getError () : (...args : any[]) => any; - getHost () : string; - getListenQueueSize () : number; - getPort () : number; - getState () : number; - getTimeout () : number; - listen () : void; - setAccepted (accepted: (...args : any[]) => any) : void; - setConnected (connected: (...args : any[]) => any) : void; - setError (error: (...args : any[]) => any) : void; - setHost (host: string) : void; - setListenQueueSize (listenQueueSize: number) : void; - setPort (port: number) : void; - setTimeout (timeout: number) : void; + + } + + /** + * The App Properties module is used for storing application-related data in property/value pairs + * that persist beyond application sessions and device power cycles. + */ + namespace Properties { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Returns the value of a property as a boolean data type. + */ + function getBool(property: string, defaultValue?: boolean): boolean; + + /** + * Returns the value of a property as a double (double-precision, floating point) data type. + */ + function getDouble(property: string, defaultValue?: number): number; + + /** + * Returns the value of a property as an integer data type. + */ + function getInt(property: string, defaultValue?: number): number; + + /** + * Returns the value of a property as an array data type. + */ + function getList(property: string, defaultValue?: ReadonlyArray): any[]; + + /** + * Returns the value of a property as an object. + */ + function getObject(property: string, defaultValue?: any): any; + + /** + * Returns the value of a property as a string data type. + */ + function getString(property: string, defaultValue?: string): string; + + /** + * Indicates whether a property exists. + */ + function hasProperty(property: string): boolean; + + /** + * Returns an array of property names. + */ + function listProperties(): any[]; + + /** + * Removes a property if it exists, or does nothing otherwise. + */ + function removeProperty(property: string): void; + + /** + * Removes all properties that have been set by the user on runtime, or does nothing otherwise. + */ + function removeAllProperties(): void; + + /** + * Sets the value of a property as a boolean data type. The property will be created if it + * does not exist. + */ + function setBool(property: string, value: boolean): void; + + /** + * Sets the value of a property as a double (double-precision, floating point) data type. The + * property will be created if it does not exist. + */ + function setDouble(property: string, value: number): void; + + /** + * Sets the value of a property as an integer data type. The property will be created if it + * does not exist. + */ + function setInt(property: string, value: number): void; + + /** + * Sets the value of a property as an array data type. The property will be created if it + * does not exist. + */ + function setList(property: string, value: ReadonlyArray): void; + + /** + * Sets the value of a property as an object data type. The property will be created if it + * does not exist. + */ + function setObject(property: string, value: any): void; + + /** + * Sets the value of a property as a string data type. The property will be created if it + * does not exist. + */ + function setString(property: string, value: string): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + } + + /** + * The top-level App iOS module, available only to iOS devices, that includes the facilities to + * create and manage local notifications and background services. + */ + namespace iOS { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Convenience constant for system event "accessibilitylayoutchanged". + */ + const EVENT_ACCESSIBILITY_LAYOUT_CHANGED: string; + + /** + * Convenience constant for system event "accessibilityscreenchanged". + */ + const EVENT_ACCESSIBILITY_SCREEN_CHANGED: string; + + /** + * Use with [setMinimumBackgroundFetchInterval](Titanium.App.iOS.setMinimumBackgroundFetchInterval) method. + * Specifies the smallest fetch interval supported by the system. + */ + const BACKGROUNDFETCHINTERVAL_MIN: number; + + /** + * Use with [setMinimumBackgroundFetchInterval](Titanium.App.iOS.setMinimumBackgroundFetchInterval) method. + * Used to specify a fetch interval large enough to prevent fetch operations from occurring. + */ + const BACKGROUNDFETCHINTERVAL_NEVER: number; + + /** + * The application may not present any UI upon a notification being received. + * Use with the [types](UserNotificationSettings.types) property. + */ + const USER_NOTIFICATION_TYPE_NONE: number; + + /** + * The application may badge its icon upon a notification being received. + * Use with the [types](UserNotificationSettings.types) property. + */ + const USER_NOTIFICATION_TYPE_BADGE: number; + + /** + * The application may play a sound upon a notification being received. + * Use with the [types](UserNotificationSettings.types) property. + */ + const USER_NOTIFICATION_TYPE_SOUND: number; + + /** + * The application may display an alert upon a notification being received. + * Use with the [types](UserNotificationSettings.types) property. + */ + const USER_NOTIFICATION_TYPE_ALERT: number; + + /** + * The action will execute in background. Use with the + * [activationMode](Titanium.App.iOS.UserNotificationAction.activationMode) property. + */ + const USER_NOTIFICATION_ACTIVATION_MODE_BACKGROUND: number; + + /** + * The action will launch the application and execute in the foreground. + * Use with the [activationMode](Titanium.App.iOS.UserNotificationAction.activationMode) property. + */ + const USER_NOTIFICATION_ACTIVATION_MODE_FOREGROUND: number; + + /** + * Default action behavior with no additional action support. + */ + const USER_NOTIFICATION_BEHAVIOR_DEFAULT: number; + + /** + * Provides a textfield with the notification for the user to enter a text response. + */ + const USER_NOTIFICATION_BEHAVIOR_TEXTINPUT: number; + + /** + * Uniform type identifier for all text types. + */ + const UTTYPE_TEXT: string; + + /** + * Uniform type identifier for a plain text type, equivalent to MIME type text/plain. + */ + const UTTYPE_PLAIN_TEXT: string; + + /** + * Uniform type identifier for Unicode-8 plain text type. + */ + const UTTYPE_UTF8_PLAIN_TEXT: string; + + /** + * Uniform type identifier for Unicode-16 with byte-order mark (BOM), or if BOM is not present, + * an external representation byte order (big-endian). + */ + const UTTYPE_UTF16_EXTERNAL_PLAIN_TEXT: string; + + /** + * Uniform type identifier for Unicode-16, native byte order, with an optional byte-order mark (BOM). + */ + const UTTYPE_UTF16_PLAIN_TEXT: string; + + /** + * Uniform type identifier for Rich Text. + */ + const UTTYPE_RTF: string; + + /** + * Uniform type identifier for HTML. + */ + const UTTYPE_HTML: string; + + /** + * Uniform type identifier for XML. + */ + const UTTYPE_XML: string; + + /** + * Uniform type identifier for PDF data. + */ + const UTTYPE_PDF: string; + + /** + * Uniform type identifier for Rich Text Format Directory, that is, Rich Text with content embedding, on-disk format. + */ + const UTTYPE_RTFD: string; + + /** + * Uniform type identifier for Rich Text with content embedding, pasteboard format. + */ + const UTTYPE_FLAT_RTFD: string; + + /** + * Uniform type identifier for MLTE (Textension) format for mixed text and multimedia data. + */ + const UTTYPE_TXN_TEXT_AND_MULTIMEDIA_DATA: string; + + /** + * Uniform type identifier for WebKit webarchive format. + */ + const UTTYPE_WEB_ARCHIVE: string; + + /** + * Uniform type identifier for all image types. + */ + const UTTYPE_IMAGE: string; + + /** + * Uniform type identifier for JPEG images. + */ + const UTTYPE_JPEG: string; + + /** + * Uniform type identifier for JPEG 2000 images. + */ + const UTTYPE_JPEG2000: string; + + /** + * Uniform type identifier for TIFF images. + */ + const UTTYPE_TIFF: string; + + /** + * Uniform type identifier for PICT images. + */ + const UTTYPE_PICT: string; + + /** + * Uniform type identifier for GIF images. + */ + const UTTYPE_GIF: string; + + /** + * Uniform type identifier for PNG images. + */ + const UTTYPE_PNG: string; + + /** + * Uniform type identifier for QuickTime images. + */ + const UTTYPE_QUICKTIME_IMAGE: string; + + /** + * Uniform type identifier for Mac OS icon images. + */ + const UTTYPE_APPLE_ICNS: string; + + /** + * Uniform type identifier for Windows bitmap images. + */ + const UTTYPE_BMP: string; + + /** + * Uniform type identifier for Windows icon images. + */ + const UTTYPE_ICO: string; + + /** + * Uniform type identifier for all audiovisual content. + */ + const UTTYPE_MOVIE: string; + + /** + * Uniform type identifier for all video content without audio. + */ + const UTTYPE_VIDEO: string; + + /** + * Uniform type identifier for all audio content. + */ + const UTTYPE_AUDIO: string; + + /** + * Uniform type identifier for QuickTime movies. + */ + const UTTYPE_QUICKTIME_MOVIE: string; + + /** + * Uniform type identifier for MPEG-1 and MPEG-2 content. + */ + const UTTYPE_MPEG: string; + + /** + * Uniform type identifier for MPEG-4 content. + */ + const UTTYPE_MPEG4: string; + + /** + * Uniform type identifier for MP3 audio. + */ + const UTTYPE_MP3: string; + + /** + * Uniform type identifier for MPEG-4 audio. + */ + const UTTYPE_MPEG4_AUDIO: string; + + /** + * Uniform type identifier for protected MPEG-4 audio (iTunes music store format). + */ + const UTTYPE_APPLE_PROTECTED_MPEG4_AUDIO: string; + + /** + * Notification types and user notification categories the application is registered to use + * (available on iOS 8 and later). + */ + const currentUserNotificationSettings: UserNotificationSettings; + + /** + * Provides an Array of the NSUserActivityTypes keys defined within your Titanium project. + * (available on iOS 8 and later). + */ + const supportedUserActivityTypes: string[]; + + /** + * Returns a URL to open the app's settings. + */ + const applicationOpenSettingsURL: string; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Creates and returns an instance of Titanium.App.iOS.UserDefaults. + */ + function createUserDefaults(parameters: any): Titanium.App.iOS.UserDefaults; + + /** + * Cancels all scheduled local notifications. + */ + function cancelAllLocalNotifications(): void; + + /** + * Cancels a local notification. + */ + function cancelLocalNotification(id: number): void; + + /** + * Cancels a local notification. + */ + function cancelLocalNotification(id: string): void; + + /** + * Registers a service to run when the application is placed in the background. + */ + function registerBackgroundService(params: any): Titanium.App.iOS.BackgroundService; + + /** + * Registers the application to use the requested notification types and categories + * (for devices running iOS 8 or later). + */ + function registerUserNotificationSettings(params: UserNotificationSettings): void; + + /** + * Schedule a local notification. + */ + function scheduleLocalNotification(params: NotificationParams): Titanium.App.iOS.LocalNotification; + + /** + * Specifies the minimum amount of time that must elapse between background fetch operations. + * Available only on iOS 7 and later. + */ + function setMinimumBackgroundFetchInterval(fetchInterval: number): void; + + /** + * Marks the end of the app execution after initiating the download operation. Available only on iOS 7 and later. + */ + function endBackgroundHandler(handlerID: string): void; + + /** + * Marks the end of an `openParentApplication:reply` execution by a WatchKit extension. + */ + function sendWatchExtensionReply(handlerId: string, userInfo: any): void; + + /** + * Creates and returns an instance of . + */ + function createSearchQuery(parameters?: any): Titanium.App.iOS.SearchQuery; + + /** + * Creates and returns an instance of . + */ + function createSearchableIndex(parameters?: any): Titanium.App.iOS.SearchableIndex; + + /** + * Creates and returns an instance of . + */ + function createSearchableItem(parameters?: any): Titanium.App.iOS.SearchableItem; + + /** + * Creates and returns an instance of . + */ + function createSearchableItemAttributeSet(parameters?: any): Titanium.App.iOS.SearchableItemAttributeSet; + + /** + * Creates and returns an instance of . + */ + function createUserActivity(parameters?: any): Titanium.App.iOS.UserActivity; + + /** + * Creates and returns an instance of . + */ + function createUserNotificationAction(parameters?: any): Titanium.App.iOS.UserNotificationAction; + + /** + * Creates and returns an instance of . + */ + function createUserNotificationCategory(parameters?: any): Titanium.App.iOS.UserNotificationCategory; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getCurrentUserNotificationSettings(): UserNotificationSettings; + + /** + * Gets the value of the property. + */ + function getSupportedUserActivityTypes(): string[]; + + /** + * Gets the value of the property. + */ + function getApplicationOpenSettingsURL(): string; + + /** + * A service that runs when the application is placed in the background. + */ + interface BackgroundService extends Titanium.Proxy { + /** + * A local URL to a JavaScript file containing the code to run in the background. + */ + url: string; + + /** + * Stops the service from running during the current background session to conserve resources. + */ + stop(): void; + + /** + * Unregisters the background service. + */ + unregister(): void; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + } - } - export interface BonjourService extends Ti.Proxy { - domain : string; - isLocal : boolean; - name : string; - socket : any; - type : string; - getDomain () : string; - getIsLocal () : boolean; - getName () : string; - getSocket () : any; - getType () : string; - publish (socket: any) : void; - resolve (timeout: number) : void; - setDomain (domain: string) : void; - setIsLocal (isLocal: boolean) : void; - setName (name: string) : void; - setSocket (socket: any) : void; - setType (type: string) : void; - stop () : void; - } - export interface HTTPClient extends Ti.Proxy { - DONE : number; - HEADERS_RECEIVED : number; - LOADING : number; - OPENED : number; - UNSENT : number; - allResponseHeaders : string; - autoEncodeUrl : boolean; - autoRedirect : boolean; - cache : boolean; - connected : boolean; - connectionType : string; - domain : string; - enableKeepAlive : boolean; - file : string; - location : string; - ondatastream : (...args : any[]) => any; - onerror : (...args : any[]) => any; - onload : (...args : any[]) => any; - onreadystatechange : (...args : any[]) => any; - onsendstream : (...args : any[]) => any; - password : string; - readyState : number; - responseData : Ti.Blob; - responseText : string; - responseXML : Ti.XML.Document; - securityManager : SecurityManagerProtocol; - status : number; - statusText : string; - timeout : number; - tlsVersion : number; - username : string; - validatesSecureCertificate : boolean; - withCredentials : boolean; - abort () : void; - addAuthFactory (scheme: string, factory: any) : void; - addKeyManager (X509KeyManager: any) : void; - addTrustManager (X509TrustManager: any) : void; - clearCookies (host: string) : void; - getAllResponseHeaders () : string; - getAutoEncodeUrl () : boolean; - getAutoRedirect () : boolean; - getCache () : boolean; - getConnected () : boolean; - getConnectionType () : string; - getDomain () : string; - getEnableKeepAlive () : boolean; - getFile () : string; - getLocation () : string; - getOndatastream () : (...args : any[]) => any; - getOnerror () : (...args : any[]) => any; - getOnload () : (...args : any[]) => any; - getOnreadystatechange () : (...args : any[]) => any; - getOnsendstream () : (...args : any[]) => any; - getPassword () : string; - getReadyState () : number; - getResponseData () : Ti.Blob; - getResponseHeader (name: string) : string; - getResponseText () : string; - getResponseXML () : Ti.XML.Document; - getSecurityManager () : SecurityManagerProtocol; - getStatus () : number; - getStatusText () : string; - getTimeout () : number; - getTlsVersion () : number; - getUsername () : string; - getValidatesSecureCertificate () : boolean; - getWithCredentials () : boolean; - open (method: string, url: string, async?: boolean) : void; - send (data?: any) : void; - send (data?: string) : void; - send (data?: Ti.Filesystem.File) : void; - send (data?: Ti.Blob) : void; - setAutoEncodeUrl (autoEncodeUrl: boolean) : void; - setAutoRedirect (autoRedirect: boolean) : void; - setCache (cache: boolean) : void; - setDomain (domain: string) : void; - setEnableKeepAlive (enableKeepAlive: boolean) : void; - setFile (file: string) : void; - setOndatastream (ondatastream: (...args : any[]) => any) : void; - setOnerror (onerror: (...args : any[]) => any) : void; - setOnload (onload: (...args : any[]) => any) : void; - setOnreadystatechange (onreadystatechange: (...args : any[]) => any) : void; - setOnsendstream (onsendstream: (...args : any[]) => any) : void; - setPassword (password: string) : void; - setRequestHeader (name: string, value: string) : void; - setTimeout (timeout: number) : void; - setTlsVersion (tlsVersion: number) : void; - setUsername (username: string) : void; - setValidatesSecureCertificate (validatesSecureCertificate: boolean) : void; - setWithCredentials (withCredentials: boolean) : void; - } - export interface BonjourBrowser extends Ti.Proxy { - domain : string; - isSearching : boolean; - serviceType : string; - getDomain () : string; - getIsSearching () : boolean; - getServiceType () : string; - search () : void; - setDomain (domain: string) : void; - setIsSearching (isSearching: boolean) : void; - setServiceType (serviceType: string) : void; - stopSearch () : void; - } - export interface Cookie extends Ti.Proxy { - comment : string; - domain : string; - expiryDate : string; - httponly : boolean; - name : string; - originalUrl : string; - path : string; - secure : boolean; - value : string; - version : number; - getComment () : string; - getDomain () : string; - getExpiryDate () : string; - getHttponly () : boolean; - getName () : string; - getOriginalUrl () : string; - getPath () : string; - getSecure () : boolean; - getValue () : string; - getVersion () : number; - isValid () : boolean; - setComment (comment: string) : void; - setDomain (domain: string) : void; - setExpiryDate (expiryDate: string) : void; - setHttponly (httponly: boolean) : void; - setOriginalUrl (originalUrl: string) : void; - setPath (path: string) : void; - setSecure (secure: boolean) : void; - setValue (value: string) : void; - setVersion (version: number) : void; + + /** + * A local notification to alert the user of new or pending application information. + */ + interface LocalNotification extends Titanium.Proxy { + /** + * Cancels the pending notification. + */ + cancel(): void; + + } + + /** + * A search query object manages the criteria to apply when searching app content that you have previously + * indexed by using the Core Spotlight APIs. + */ + interface SearchQuery extends Titanium.Proxy { + /** + * A formatted string that defines the matching criteria to apply to indexed items. + */ + queryString: string; + + /** + * An array of strings that represent the attributes of indexed items. + */ + attributes: string[]; + + /** + * Asynchronously queries the index for items that match the query object's specifications. + */ + start(): void; + + /** + * Cancels a query operation. + */ + cancel(): void; + + /** + * A Boolean value that indicates if the query has been cancelled (`true`) or not (`false`). + */ + isCancelled(): boolean; + + } + + /** + * The SearchableIndex module is used to add or remove Ti.App.iOS.SearchableItem objects from the device search index. + */ + interface SearchableIndex extends Titanium.Proxy { + /** + * Indicates whether indexing is supported by the device. + */ + isSupported(): boolean; + + /** + * Adds an array of Titanium.App.iOS.SearchableItem objects to the default search index. + */ + addToDefaultSearchableIndex(Array: ReadonlyArray, callback: (param0: any) => any): void; + + /** + * Removes all search items added by the application. + */ + deleteAllSearchableItems(callback: (param0: any) => any): void; + + /** + * Removes search items based on an array of domain identifiers. + */ + deleteAllSearchableItemByDomainIdenifiers(Array: ReadonlyArray, callback: (param0: any) => any): void; + + /** + * Removes search items based on an array of identifiers. + */ + deleteSearchableItemsByIdentifiers(Array: ReadonlyArray, callback: (param0: any) => any): void; + + } + + /** + * Used to create a unique object containing all of the search information that will appear in the device search index. + */ + interface SearchableItem extends Titanium.Proxy { + /** + * Set of metadata properties to display for the item. + */ + attributeSet: Titanium.App.iOS.SearchableItemAttributeSet; + + /** + * Identifier that represents the "domain" or owner of this item. + */ + domainIdentifier: string; + + /** + * Searchable items have an expiration date or time to live. By default it is set to one month. + */ + expirationDate: string; + + /** + * Unique identifier to your application group. + */ + uniqueIdentifier: string; + + /** + * Gets the value of the property. + */ + getDomainIdentifier(): string; + + /** + * Sets the value of the property. + */ + setDomainIdentifier(domainIdentifier: string): void; + + /** + * Gets the value of the property. + */ + getExpirationDate(): string; + + /** + * Sets the value of the property. + */ + setExpirationDate(expirationDate: string): void; + + /** + * Gets the value of the property. + */ + getUniqueIdentifier(): string; + + /** + * Sets the value of the property. + */ + setUniqueIdentifier(uniqueIdentifier: string): void; + + } + + /** + * The SearchableItemAttributeSet module defines metadata properties for SearchItem and UserActivity objects. + */ + interface SearchableItemAttributeSet extends Titanium.Proxy { + /** + * Content type of the attribute set. + */ + itemContentType: string; + + /** + * A localized string to be displayed in the UI for this item. + */ + displayName: string; + + /** + * An array of localized strings of alternate display names for this item. + */ + alternateNames: string[]; + + /** + * The complete path to the item. + */ + path: string; + + /** + * File URL representing the content to be indexed. + */ + contentURL: string; + + /** + * File URL pointing to a thumbnail image for this item. + */ + thumbnailURL: string; + + /** + * Image data for thumbnail for this item. + */ + thumbnailData: string | Titanium.Blob; + + /** + * For activities this is the unique identifier for the item this activity is related to. + */ + relatedUniqueIdentifier: string; + + /** + * The date that the last metadata attribute was changed. + */ + metadataModificationDate: string; + + /** + * UTI Type pedigree for an item. + */ + contentType: string; + + /** + * Array of strings related to the content tree of the item. + */ + contentTypeTree: string[]; + + /** + * Represents keywords associated with this particular item. Example keywords might be Birthday etc. + */ + keywords: string[]; + + /** + * The title of the particular item. + */ + title: string; + + /** + * Subject of the the item. + */ + subject: string; + + /** + * Theme of the the item. + */ + theme: string; + + /** + * An account of the content of the resource. + */ + contentDescription: string; + + /** + * Used to reference to the resource within a given context. + */ + identifier: string; + + /** + * A class of entity for whom the resource is intended or useful. + */ + audiences: string[]; + + /** + * Size of the document in MB. + */ + fileSize: number; + + /** + * Number of pages in the item. + */ + pageCount: number; + + /** + * Width in points (72 points per inch) of the document page. + */ + pageWidth: number; + + /** + * Height in points (72 points per inch) of the document page. + */ + pageHeight: number; + + /** + * Security (encryption) method used in the file. + */ + securityMethod: string; + + /** + * Application used to create the document content (e.g. "Word","Framemaker", etc.). + */ + creator: string; + + /** + * Software used to convert the original content into a PDF stream. + */ + encodingApplications: string[]; + + /** + * Kind that the item represents. + */ + kind: string; + + /** + * Array of font names used in the item. + */ + fontNames: string[]; + + /** + * The sample rate of the audio data contained in the file. + */ + audioSampleRate: number; + + /** + * The number of channels in the audio data contained in the file. + */ + audioChannelCount: number; + + /** + * The tempo of the music contained in the audio file in Beats Per Minute. + */ + tempo: number; + + /** + * The musical key of the song/composition contained in an audio file. + */ + keySignature: string; + + /** + * The time signature of the musical composition contained in the audio/MIDI file. + */ + timeSignature: string; + + /** + * The name of the application that encoded the data contained in the audio file. + */ + audioEncodingApplication: string; + + /** + * The composer of the song/composition contained in the audio file. + */ + composer: string; + + /** + * The lyricist/text writer for song/composition contained in the audio file. + */ + lyricist: string; + + /** + * The title for a collection of media. + */ + album: string; + + /** + * The artist for the media. + */ + artist: string; + + /** + * The track number of a song/composition when it is part of an album. + */ + audioTrackNumber: number; + + /** + * The recording date of the song/composition. + */ + recordingDate: string; + + /** + * The musical genre of the song/composition contained in the audio file. + */ + musicalGenre: string; + + /** + * Used to indicates whether the MIDI sequence contained in the file is setup for use with a General MIDI device. + */ + generalMIDISequence: number; + + /** + * Metadata attribute that stores the category of instrument. + */ + musicalInstrumentCategory: string; + + /** + * Metadata attribute that stores the name of instrument. + */ + musicalInstrumentName: string; + + /** + * Used to indicate that using the phone number is appropriate. + */ + supportsPhoneCall: number; + + /** + * Used to determine if navigation is supported. + */ + supportsNavigation: number; + + /** + * Title displayed in the search container + */ + containerTitle: string; + + /** + * Display of the search container + */ + containerDisplayName: string; + + /** + * Identifier for the search container + */ + containerIdentifier: string; + + /** + * Order the search container is displayed. + */ + containerOrder: number; + + /** + * The list of editor/editors that have worked on this item. + */ + editors: string[]; + + /** + * The list of people who are visible in an image or movie or written about in a document. + */ + participants: string[]; + + /** + * The list of projects that this item is part of. + */ + projects: string[]; + + /** + * The date that the file was last downloaded / received. + */ + downloadedDate: string; + + /** + * The date that the item was last used. + */ + lastUsedDate: string; + + /** + * The date that the contents of the item were created. + */ + contentCreationDate: string; + + /** + * The date that the contents of the item were last modified. + */ + contentModificationDate: string; + + /** + * The date that the item was moved into the current location. + */ + addedDate: string; + + /** + * Used to indicate where the item was obtained from. + */ + contentSources: string[]; + + /** + * Comment related to a file. + */ + comment: string; + + /** + * Copyright of the content. + */ + copyright: string; + + /** + * Duration in seconds of the content of the item (if appropriate). + */ + duration: number; + + /** + * A list of contacts that are somehow associated with this document beyond what is captured as Author. + */ + contactKeywords: string[]; + + /** + * The codecs used to encode/decode the media. + */ + codecs: string[]; + + /** + * Used to indicate company/Organization that created the document. + */ + organizations: string[]; + + /** + * Media types present in the content. + */ + mediaTypes: string[]; + + /** + * A version specifier for this item. + */ + version: string; + + /** + * Used to indicate the role of the document creator. + */ + role: string; + + /** + * Whether the content is prepared for streaming. Set to `0` for not streamable and `1` for streamable. + */ + streamable: number; + + /** + * The total bit rate (audio and video combined) of the media. + */ + totalBitRate: number; + + /** + * The video bit rate. + */ + videoBitRate: number; + + /** + * The audio bit rate. + */ + audioBitRate: number; + + /** + * The delivery type of the item. Set to `0` for fast start and `1` for RTSP. + */ + deliveryType: number; + + /** + * Used to designate the languages of the intellectual content of the resource. + */ + languages: string[]; + + /** + * Used to provide a link to information about rights held in and over resource. + */ + rights: string[]; + + /** + * Used to designate the entity responsible for making the resource available. + */ + publishers: string[]; + + /** + * Used to designate the entity responsible for making contributions to the content of the resource. + */ + contributors: string[]; + + /** + * Used to designate the extent or scope of the content of the resource. + */ + coverage: string[]; + + /** + * User rating of this item out of 5 stars. + */ + rating: number; + + /** + * A description of the rating, for example, the number of reviewers. + */ + ratingDescription: string; + + /** + * User play count of this item. + */ + playCount: number; + + /** + * Information about the item. + */ + information: string; + + /** + * Director of the item, for example, the movie director. + */ + director: string; + + /** + * Producer of the content. + */ + producer: string; + + /** + * Genre of the item, for example, movie genre. + */ + genre: string; + + /** + * Performers in the movie. + */ + performers: string[]; + + /** + * Original format of the movie. + */ + originalFormat: string; + + /** + * Original source of the movie. + */ + originalSource: string; + + /** + * Whether or not the item is local. Set to `1` if true and `0` otherwise. + */ + local: number; + + /** + * Whether or not the item has explicit content. Set to `1` for explicit or `0` for clean. + */ + contentRating: number; + + /** + * URL of the item. + */ + url: string; + + /** + * The fully formatted address of the item (obtained from MapKit). + */ + fullyFormattedAddress: string; + + /** + * The sub-location (e.g., street number) for the item according to guidelines established by the provider. + */ + subThoroughfare: string; + + /** + * The location (e.g., street name) for the item according to guidelines established by the provider. + */ + thoroughfare: string; + + /** + * The postal code for the item according to guidelines established by the provider. + */ + postalCode: string; + + /** + * Gets the value of the property. + */ + getDisplayName(): string; + + /** + * Sets the value of the property. + */ + setDisplayName(displayName: string): void; + + /** + * Gets the value of the property. + */ + getAlternateNames(): string[]; + + /** + * Sets the value of the property. + */ + setAlternateNames(alternateNames: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getPath(): string; + + /** + * Sets the value of the property. + */ + setPath(path: string): void; + + /** + * Gets the value of the property. + */ + getContentURL(): string; + + /** + * Sets the value of the property. + */ + setContentURL(contentURL: string): void; + + /** + * Gets the value of the property. + */ + getThumbnailURL(): string; + + /** + * Sets the value of the property. + */ + setThumbnailURL(thumbnailURL: string): void; + + /** + * Gets the value of the property. + */ + getThumbnailData(): string | Titanium.Blob; + + /** + * Sets the value of the property. + */ + setThumbnailData(thumbnailData: string): void; + + /** + * Sets the value of the property. + */ + setThumbnailData(thumbnailData: Titanium.Blob): void; + + /** + * Gets the value of the property. + */ + getRelatedUniqueIdentifier(): string; + + /** + * Sets the value of the property. + */ + setRelatedUniqueIdentifier(relatedUniqueIdentifier: string): void; + + /** + * Gets the value of the property. + */ + getMetadataModificationDate(): string; + + /** + * Sets the value of the property. + */ + setMetadataModificationDate(metadataModificationDate: string): void; + + /** + * Gets the value of the property. + */ + getContentType(): string; + + /** + * Sets the value of the property. + */ + setContentType(contentType: string): void; + + /** + * Gets the value of the property. + */ + getContentTypeTree(): string[]; + + /** + * Sets the value of the property. + */ + setContentTypeTree(contentTypeTree: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getKeywords(): string[]; + + /** + * Sets the value of the property. + */ + setKeywords(keywords: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getSubject(): string; + + /** + * Sets the value of the property. + */ + setSubject(subject: string): void; + + /** + * Gets the value of the property. + */ + getTheme(): string; + + /** + * Sets the value of the property. + */ + setTheme(theme: string): void; + + /** + * Gets the value of the property. + */ + getContentDescription(): string; + + /** + * Sets the value of the property. + */ + setContentDescription(contentDescription: string): void; + + /** + * Gets the value of the property. + */ + getIdentifier(): string; + + /** + * Sets the value of the property. + */ + setIdentifier(identifier: string): void; + + /** + * Gets the value of the property. + */ + getAudiences(): string[]; + + /** + * Sets the value of the property. + */ + setAudiences(audiences: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getFileSize(): number; + + /** + * Sets the value of the property. + */ + setFileSize(fileSize: number): void; + + /** + * Gets the value of the property. + */ + getPageCount(): number; + + /** + * Sets the value of the property. + */ + setPageCount(pageCount: number): void; + + /** + * Gets the value of the property. + */ + getPageWidth(): number; + + /** + * Sets the value of the property. + */ + setPageWidth(pageWidth: number): void; + + /** + * Gets the value of the property. + */ + getPageHeight(): number; + + /** + * Sets the value of the property. + */ + setPageHeight(pageHeight: number): void; + + /** + * Gets the value of the property. + */ + getSecurityMethod(): string; + + /** + * Sets the value of the property. + */ + setSecurityMethod(securityMethod: string): void; + + /** + * Gets the value of the property. + */ + getCreator(): string; + + /** + * Sets the value of the property. + */ + setCreator(creator: string): void; + + /** + * Gets the value of the property. + */ + getEncodingApplications(): string[]; + + /** + * Sets the value of the property. + */ + setEncodingApplications(encodingApplications: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getKind(): string; + + /** + * Sets the value of the property. + */ + setKind(kind: string): void; + + /** + * Gets the value of the property. + */ + getFontNames(): string[]; + + /** + * Sets the value of the property. + */ + setFontNames(fontNames: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getAudioSampleRate(): number; + + /** + * Sets the value of the property. + */ + setAudioSampleRate(audioSampleRate: number): void; + + /** + * Gets the value of the property. + */ + getAudioChannelCount(): number; + + /** + * Sets the value of the property. + */ + setAudioChannelCount(audioChannelCount: number): void; + + /** + * Gets the value of the property. + */ + getTempo(): number; + + /** + * Sets the value of the property. + */ + setTempo(tempo: number): void; + + /** + * Gets the value of the property. + */ + getKeySignature(): string; + + /** + * Sets the value of the property. + */ + setKeySignature(keySignature: string): void; + + /** + * Gets the value of the property. + */ + getTimeSignature(): string; + + /** + * Sets the value of the property. + */ + setTimeSignature(timeSignature: string): void; + + /** + * Gets the value of the property. + */ + getAudioEncodingApplication(): string; + + /** + * Sets the value of the property. + */ + setAudioEncodingApplication(audioEncodingApplication: string): void; + + /** + * Gets the value of the property. + */ + getComposer(): string; + + /** + * Sets the value of the property. + */ + setComposer(composer: string): void; + + /** + * Gets the value of the property. + */ + getLyricist(): string; + + /** + * Sets the value of the property. + */ + setLyricist(lyricist: string): void; + + /** + * Gets the value of the property. + */ + getAlbum(): string; + + /** + * Sets the value of the property. + */ + setAlbum(album: string): void; + + /** + * Gets the value of the property. + */ + getArtist(): string; + + /** + * Sets the value of the property. + */ + setArtist(artist: string): void; + + /** + * Gets the value of the property. + */ + getAudioTrackNumber(): number; + + /** + * Sets the value of the property. + */ + setAudioTrackNumber(audioTrackNumber: number): void; + + /** + * Gets the value of the property. + */ + getRecordingDate(): string; + + /** + * Sets the value of the property. + */ + setRecordingDate(recordingDate: string): void; + + /** + * Gets the value of the property. + */ + getMusicalGenre(): string; + + /** + * Sets the value of the property. + */ + setMusicalGenre(musicalGenre: string): void; + + /** + * Gets the value of the property. + */ + getGeneralMIDISequence(): number; + + /** + * Sets the value of the property. + */ + setGeneralMIDISequence(generalMIDISequence: number): void; + + /** + * Gets the value of the property. + */ + getMusicalInstrumentCategory(): string; + + /** + * Sets the value of the property. + */ + setMusicalInstrumentCategory(musicalInstrumentCategory: string): void; + + /** + * Gets the value of the property. + */ + getMusicalInstrumentName(): string; + + /** + * Sets the value of the property. + */ + setMusicalInstrumentName(musicalInstrumentName: string): void; + + /** + * Gets the value of the property. + */ + getSupportsPhoneCall(): number; + + /** + * Sets the value of the property. + */ + setSupportsPhoneCall(supportsPhoneCall: number): void; + + /** + * Gets the value of the property. + */ + getSupportsNavigation(): number; + + /** + * Sets the value of the property. + */ + setSupportsNavigation(supportsNavigation: number): void; + + /** + * Gets the value of the property. + */ + getContainerTitle(): string; + + /** + * Sets the value of the property. + */ + setContainerTitle(containerTitle: string): void; + + /** + * Gets the value of the property. + */ + getContainerDisplayName(): string; + + /** + * Sets the value of the property. + */ + setContainerDisplayName(containerDisplayName: string): void; + + /** + * Gets the value of the property. + */ + getContainerIdentifier(): string; + + /** + * Sets the value of the property. + */ + setContainerIdentifier(containerIdentifier: string): void; + + /** + * Gets the value of the property. + */ + getContainerOrder(): number; + + /** + * Sets the value of the property. + */ + setContainerOrder(containerOrder: number): void; + + /** + * Gets the value of the property. + */ + getEditors(): string[]; + + /** + * Sets the value of the property. + */ + setEditors(editors: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getParticipants(): string[]; + + /** + * Sets the value of the property. + */ + setParticipants(participants: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getProjects(): string[]; + + /** + * Sets the value of the property. + */ + setProjects(projects: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getDownloadedDate(): string; + + /** + * Sets the value of the property. + */ + setDownloadedDate(downloadedDate: string): void; + + /** + * Gets the value of the property. + */ + getLastUsedDate(): string; + + /** + * Sets the value of the property. + */ + setLastUsedDate(lastUsedDate: string): void; + + /** + * Gets the value of the property. + */ + getContentCreationDate(): string; + + /** + * Sets the value of the property. + */ + setContentCreationDate(contentCreationDate: string): void; + + /** + * Gets the value of the property. + */ + getContentModificationDate(): string; + + /** + * Sets the value of the property. + */ + setContentModificationDate(contentModificationDate: string): void; + + /** + * Gets the value of the property. + */ + getAddedDate(): string; + + /** + * Sets the value of the property. + */ + setAddedDate(addedDate: string): void; + + /** + * Gets the value of the property. + */ + getContentSources(): string[]; + + /** + * Sets the value of the property. + */ + setContentSources(contentSources: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getComment(): string; + + /** + * Sets the value of the property. + */ + setComment(comment: string): void; + + /** + * Gets the value of the property. + */ + getCopyright(): string; + + /** + * Sets the value of the property. + */ + setCopyright(copyright: string): void; + + /** + * Gets the value of the property. + */ + getDuration(): number; + + /** + * Sets the value of the property. + */ + setDuration(duration: number): void; + + /** + * Gets the value of the property. + */ + getContactKeywords(): string[]; + + /** + * Sets the value of the property. + */ + setContactKeywords(contactKeywords: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getCodecs(): string[]; + + /** + * Sets the value of the property. + */ + setCodecs(codecs: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getOrganizations(): string[]; + + /** + * Sets the value of the property. + */ + setOrganizations(organizations: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getMediaTypes(): string[]; + + /** + * Sets the value of the property. + */ + setMediaTypes(mediaTypes: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getVersion(): string; + + /** + * Sets the value of the property. + */ + setVersion(version: string): void; + + /** + * Gets the value of the property. + */ + getRole(): string; + + /** + * Sets the value of the property. + */ + setRole(role: string): void; + + /** + * Gets the value of the property. + */ + getStreamable(): number; + + /** + * Sets the value of the property. + */ + setStreamable(streamable: number): void; + + /** + * Gets the value of the property. + */ + getTotalBitRate(): number; + + /** + * Sets the value of the property. + */ + setTotalBitRate(totalBitRate: number): void; + + /** + * Gets the value of the property. + */ + getVideoBitRate(): number; + + /** + * Sets the value of the property. + */ + setVideoBitRate(videoBitRate: number): void; + + /** + * Gets the value of the property. + */ + getAudioBitRate(): number; + + /** + * Sets the value of the property. + */ + setAudioBitRate(audioBitRate: number): void; + + /** + * Gets the value of the property. + */ + getDeliveryType(): number; + + /** + * Sets the value of the property. + */ + setDeliveryType(deliveryType: number): void; + + /** + * Gets the value of the property. + */ + getLanguages(): string[]; + + /** + * Sets the value of the property. + */ + setLanguages(languages: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getRights(): string[]; + + /** + * Sets the value of the property. + */ + setRights(rights: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getPublishers(): string[]; + + /** + * Sets the value of the property. + */ + setPublishers(publishers: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getContributors(): string[]; + + /** + * Sets the value of the property. + */ + setContributors(contributors: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getCoverage(): string[]; + + /** + * Sets the value of the property. + */ + setCoverage(coverage: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getRating(): number; + + /** + * Sets the value of the property. + */ + setRating(rating: number): void; + + /** + * Gets the value of the property. + */ + getRatingDescription(): string; + + /** + * Sets the value of the property. + */ + setRatingDescription(ratingDescription: string): void; + + /** + * Gets the value of the property. + */ + getPlayCount(): number; + + /** + * Sets the value of the property. + */ + setPlayCount(playCount: number): void; + + /** + * Gets the value of the property. + */ + getInformation(): string; + + /** + * Sets the value of the property. + */ + setInformation(information: string): void; + + /** + * Gets the value of the property. + */ + getDirector(): string; + + /** + * Sets the value of the property. + */ + setDirector(director: string): void; + + /** + * Gets the value of the property. + */ + getProducer(): string; + + /** + * Sets the value of the property. + */ + setProducer(producer: string): void; + + /** + * Gets the value of the property. + */ + getGenre(): string; + + /** + * Sets the value of the property. + */ + setGenre(genre: string): void; + + /** + * Gets the value of the property. + */ + getPerformers(): string[]; + + /** + * Sets the value of the property. + */ + setPerformers(performers: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getOriginalFormat(): string; + + /** + * Sets the value of the property. + */ + setOriginalFormat(originalFormat: string): void; + + /** + * Gets the value of the property. + */ + getOriginalSource(): string; + + /** + * Sets the value of the property. + */ + setOriginalSource(originalSource: string): void; + + /** + * Gets the value of the property. + */ + getLocal(): number; + + /** + * Sets the value of the property. + */ + setLocal(local: number): void; + + /** + * Gets the value of the property. + */ + getContentRating(): number; + + /** + * Sets the value of the property. + */ + setContentRating(contentRating: number): void; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + /** + * Gets the value of the property. + */ + getFullyFormattedAddress(): string; + + /** + * Sets the value of the property. + */ + setFullyFormattedAddress(fullyFormattedAddress: string): void; + + /** + * Gets the value of the property. + */ + getSubThoroughfare(): string; + + /** + * Sets the value of the property. + */ + setSubThoroughfare(subThoroughfare: string): void; + + /** + * Gets the value of the property. + */ + getThoroughfare(): string; + + /** + * Sets the value of the property. + */ + setThoroughfare(thoroughfare: string): void; + + /** + * Gets the value of the property. + */ + getPostalCode(): string; + + /** + * Sets the value of the property. + */ + setPostalCode(postalCode: string): void; + + } + + /** + * The UserActivity module is used to enable device Handoff and to create User Activities. + */ + interface UserActivity extends Titanium.Proxy { + /** + * Name of the activity type. + */ + activityType: string; + + /** + * Set to `true` if the user activity can be publicly accessed by all iOS users. + */ + eligibleForPublicIndexing: boolean; + + /** + * Set to true if the user activity should be added to the on-device index. + */ + eligibleForSearch: boolean; + + /** + * Set to true if this user activity should be eligible to be handed off to another device + */ + eligibleForHandoff: boolean; + + /** + * Absolute date after which the activity is no longer eligible to be indexed or handed off. + */ + expirationDate: string; + + /** + * An array of string keywords representing words or phrases that might help the user to find the activity in the application history. + */ + keywords: string[]; + + /** + * Set to true everytime you have updated the user activity and need the changes to be saved before handing it off to another device. + */ + needsSave: boolean; + + /** + * An array of String keys from the userInfo property which represent the minimal information about the user activity that should be stored for later restoration. + */ + requiredUserInfoKeys: string[]; + + /** + * Determines if user activities are supported (`true`) or not (`false`) by the device. + */ + supported: boolean; + + /** + * An optional, user-visible title for this activity such as a document name or web page title. + */ + title: string; + + /** + * The userInfo dictionary contains application-specific state needed to continue an activity on another device. + */ + userInfo: any; + + /** + * When no suitable application is installed on a resuming device and the `webpageURL` property is set, + * the user activity will instead be continued in a web browser by loading the specified URL. + */ + webpageURL: string; + + /** + * Adds a Titanium.App.iOS.SearchableItemAttributeSet to the user activity. + */ + addContentAttributeSet(contentAttributeSet: Titanium.App.iOS.SearchableItemAttributeSet): void; + + /** + * Marks the activity as currently in use by the user. + */ + becomeCurrent(): void; + + /** + * Invalidates an activity when it is no longer eligible for continuation. + */ + invalidate(): void; + + /** + * Marks the activity as currently **not** in use and ineligible to be continued. + */ + resignCurrent(): void; + + /** + * Determines if user activities are supported (`true`) or not (`false`) by the device. + */ + isSupported(): boolean; + + /** + * Gets the value of the property. + */ + getActivityType(): string; + + /** + * Sets the value of the property. + */ + setActivityType(activityType: string): void; + + /** + * Gets the value of the property. + */ + getEligibleForPublicIndexing(): boolean; + + /** + * Sets the value of the property. + */ + setEligibleForPublicIndexing(eligibleForPublicIndexing: boolean): void; + + /** + * Gets the value of the property. + */ + getEligibleForSearch(): boolean; + + /** + * Sets the value of the property. + */ + setEligibleForSearch(eligibleForSearch: boolean): void; + + /** + * Gets the value of the property. + */ + getEligibleForHandoff(): boolean; + + /** + * Sets the value of the property. + */ + setEligibleForHandoff(eligibleForHandoff: boolean): void; + + /** + * Gets the value of the property. + */ + getExpirationDate(): string; + + /** + * Sets the value of the property. + */ + setExpirationDate(expirationDate: string): void; + + /** + * Gets the value of the property. + */ + getKeywords(): string[]; + + /** + * Sets the value of the property. + */ + setKeywords(keywords: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getNeedsSave(): boolean; + + /** + * Sets the value of the property. + */ + setNeedsSave(needsSave: boolean): void; + + /** + * Gets the value of the property. + */ + getRequiredUserInfoKeys(): string[]; + + /** + * Sets the value of the property. + */ + setRequiredUserInfoKeys(requiredUserInfoKeys: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getSupported(): boolean; + + /** + * Sets the value of the property. + */ + setSupported(supported: boolean): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getUserInfo(): any; + + /** + * Sets the value of the property. + */ + setUserInfo(userInfo: any): void; + + /** + * Gets the value of the property. + */ + getWebpageURL(): string; + + /** + * Sets the value of the property. + */ + setWebpageURL(webpageURL: string): void; + + } + + /** + * The UserDefaults module is used for storing application-related data in property/value pairs + * that persist beyond application sessions and device power cycles. UserDefaults allows the suiteName + * of the UserDefaults to be specified at creation time. + */ + interface UserDefaults extends Titanium.Proxy { + /** + * Sets the name of the suite to be used to access UserDefaults. + */ + suiteName: string; + + /** + * Returns the value of a property as a boolean data type. + */ + getBool(property: string, defaultValue?: boolean): boolean; + + /** + * Returns the value of a property as a double (double-precision, floating point) data type. + */ + getDouble(property: string, defaultValue?: number): number; + + /** + * Returns the value of a property as an integer data type. + */ + getInt(property: string, defaultValue?: number): number; + + /** + * Returns the value of a property as an array data type. + */ + getList(property: string, defaultValue?: ReadonlyArray): any[]; + + /** + * Returns the value of a property as an object. + */ + getObject(property: string, defaultValue?: any): any; + + /** + * Returns the value of a property as a string data type. + */ + getString(property: string, defaultValue?: string): string; + + /** + * Indicates whether a property exists. + */ + hasProperty(property: string): boolean; + + /** + * Returns an array of property names. + */ + listProperties(): any[]; + + /** + * Removes a property if it exists, or does nothing otherwise. + */ + removeProperty(property: string): void; + + /** + * Removes all properties that have been set by the user on runtime, or does nothing otherwise. + */ + removeAllProperties(): void; + + /** + * Sets the value of a property as a boolean data type. The property will be created if it + * does not exist. + */ + setBool(property: string, value: boolean): void; + + /** + * Sets the value of a property as a double (double-precision, floating point) data type. The + * property will be created if it does not exist. + */ + setDouble(property: string, value: number): void; + + /** + * Sets the value of a property as an integer data type. The property will be created if it + * does not exist. + */ + setInt(property: string, value: number): void; + + /** + * Sets the value of a property as an array data type. The property will be created if it + * does not exist. + */ + setList(property: string, value: ReadonlyArray): void; + + /** + * Sets the value of a property as an object data type. The property will be created if it + * does not exist. + */ + setObject(property: string, value: any): void; + + /** + * Sets the value of a property as a string data type. The property will be created if it + * does not exist. + */ + setString(property: string, value: string): void; + + /** + * Gets the value of the property. + */ + getSuiteName(): string; + + /** + * Sets the value of the property. + */ + setSuiteName(suiteName: string): void; + + } + + /** + * An action the user selects in response to an interactive notification. + */ + interface UserNotificationAction extends Titanium.Proxy { + /** + * Selects how to activate the application. + */ + activationMode: number; + + /** + * Custom behavior the user notification supports. + */ + behavior: number; + + /** + * Set to true if the action requires the device to be unlocked. On the Apple Watch actions never require authentication. + */ + authenticationRequired: boolean; + + /** + * Set to true if the action causes destructive behavior to the user's data or the application. + */ + destructive: boolean; + + /** + * Identifier for this action. Used to identify the action the user pressed. + */ + identifier: string; + + /** + * Title of the button displayed in the notification. + */ + title: string; + + /** + * Gets the value of the property. + */ + getActivationMode(): number; + + /** + * Sets the value of the property. + */ + setActivationMode(activationMode: number): void; + + /** + * Gets the value of the property. + */ + getBehavior(): number; + + /** + * Sets the value of the property. + */ + setBehavior(behavior: number): void; + + } + + /** + * A set of notification actions to associate with a notification. + */ + interface UserNotificationCategory extends Titanium.Proxy { + /** + * Array of notification actions to associate with the group. + */ + actionsForDefaultContext: Titanium.App.iOS.UserNotificationAction[]; + + /** + * Array of notification actions to display for non-dialog-style notification. + */ + actionsForMinimalContext: Titanium.App.iOS.UserNotificationAction[]; + + /** + * Identifier for this category. + */ + identifier: string; + + } + } } - export interface Yahoo { - yql (yql: string, callback: (...args : any[]) => any) : void; + + /** + * The Calendar module provides an API for accessing the native calendar functionality. + */ + namespace Calendar { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Reminder alert delivery method. + */ + const METHOD_ALERT: number; + + /** + * Reminder default delivery method. + */ + const METHOD_DEFAULT: number; + + /** + * Reminder email delivery method. + */ + const METHOD_EMAIL: number; + + /** + * Reminder SMS delivery method. + */ + const METHOD_SMS: number; + + /** + * Alert dismissed state. + */ + const STATE_DISMISSED: number; + + /** + * Alert fired state. + */ + const STATE_FIRED: number; + + /** + * Alert scheduled status. + */ + const STATE_SCHEDULED: number; + + /** + * Event has no status. + */ + const STATUS_NONE: number; + + /** + * Event canceled status. + */ + const STATUS_CANCELLED: number; + + /** + * Event canceled status. + */ + const STATUS_CANCELED: number; + + /** + * Event confirmed status. + */ + const STATUS_CONFIRMED: number; + + /** + * Event tentative status. + */ + const STATUS_TENTATIVE: number; + + /** + * Availability settings are not supported by the event's calendar. + */ + const AVAILABILITY_NOTSUPPORTED: number; + + /** + * Event has a busy availability setting. + */ + const AVAILABILITY_BUSY: number; + + /** + * Event has a free availability setting. + */ + const AVAILABILITY_FREE: number; + + /** + * Event has a tentative availability setting. + */ + const AVAILABILITY_TENTATIVE: number; + + /** + * Event has a tentative availability setting. + */ + const AVAILABILITY_UNAVAILABLE: number; + + /** + * A [eventsAuthorization](Titanium.Calendar.eventsAuthorization) value + * indicating that the application is authorized to use events in the Calendar. + */ + const AUTHORIZATION_AUTHORIZED: number; + + /** + * A [eventsAuthorization](Titanium.Calendar.eventsAuthorization) value + * indicating that the application is not authorized to use events in the Calendar. + */ + const AUTHORIZATION_DENIED: number; + + /** + * A [eventsAuthorization](Titanium.Calendar.eventsAuthorization) value + * indicating that the application is not authorized to use events in the Calendar. + * the user cannot change this application's status. + */ + const AUTHORIZATION_RESTRICTED: number; + + /** + * A [eventsAuthorization](Titanium.Calendar.eventsAuthorization) value + * indicating that the authorization state is unknown. + */ + const AUTHORIZATION_UNKNOWN: number; + + /** + * A [save](Titanium.Calendar.Event.save)/[remove](Titanium.Calendar.Event.remove) event value, + * indicating modifications to this event instance should affect only this instance. + */ + const SPAN_THISEVENT: number; + + /** + * A [save](Titanium.Calendar.Event.save)/[remove](Titanium.Calendar.Event.remove) event value, + * indicating modifications to this event instance should also affect future instances of this event. + */ + const SPAN_FUTUREEVENTS: number; + + /** + * Indicates a daily recurrence rule for a events reccurance frequency. + */ + const RECURRENCEFREQUENCY_DAILY: number; + + /** + * Indicates a weekly recurrence rule for a events reccurance frequency. + */ + const RECURRENCEFREQUENCY_WEEKLY: number; + + /** + * Indicates a monthly recurrence rule for a events reccurance frequency. + */ + const RECURRENCEFREQUENCY_MONTHLY: number; + + /** + * Indicates a yearly recurrence rule for a events reccurance frequency. + */ + const RECURRENCEFREQUENCY_YEARLY: number; + + /** + * Event confidential visibility. + */ + const VISIBILITY_CONFIDENTIAL: number; + + /** + * Event default visibility. + */ + const VISIBILITY_DEFAULT: number; + + /** + * Event private visibility. + */ + const VISIBILITY_PRIVATE: number; + + /** + * Event public visibility. + */ + const VISIBILITY_PUBLIC: number; + + /** + * Attendee status is unknown. + */ + const ATTENDEE_STATUS_UNKNOWN: number; + + /** + * Attendee status is pending. + */ + const ATTENDEE_STATUS_PENDING: number; + + /** + * Attendee status is accepted. + */ + const ATTENDEE_STATUS_ACCEPTED: number; + + /** + * Attendee status is declined. + */ + const ATTENDEE_STATUS_DECLINED: number; + + /** + * Attendee status is tentative. + */ + const ATTENDEE_STATUS_TENTATIVE: number; + + /** + * Attendee status is invited. + */ + const ATTENDEE_STATUS_INVITED: number; + + /** + * There is no Attendee status. + */ + const ATTENDEE_STATUS_NONE: number; + + /** + * Attendee status is delegated. + */ + const ATTENDEE_STATUS_DELEGATED: number; + + /** + * Attendee status is in process. + */ + const ATTENDEE_STATUS_IN_PROCESS: number; + + /** + * Relationship is attendee. + */ + const RELATIONSHIP_ATTENDEE: number; + + /** + * There is no relationship. + */ + const RELATIONSHIP_NONE: number; + + /** + * Attendee is organizer. + */ + const RELATIONSHIP_ORGANIZER: number; + + /** + * Attendee is performer. + */ + const RELATIONSHIP_PERFORMER: number; + + /** + * Attendee is speaker. + */ + const RELATIONSHIP_SPEAKER: number; + + /** + * Relationship is unknown. + */ + const RELATIONSHIP_UNKNOWN: number; + + /** + * Attendee role is unknown. + */ + const ATTENDEE_ROLE_UNKNOWN: number; + + /** + * Attendee role is optional. + */ + const ATTENDEE_ROLE_OPTIONAL: number; + + /** + * Attendee role is required. + */ + const ATTENDEE_ROLE_REQUIRED: number; + + /** + * Attendee role is chair. + */ + const ATTENDEE_ROLE_CHAIR: number; + + /** + * Attendee is not a participant. + */ + const ATTENDEE_ROLE_NON_PARTICIPANT: number; + + /** + * Attendee type is unknown. + */ + const ATTENDEE_TYPE_UNKNOWN: number; + + /** + * Attendee type is person. + */ + const ATTENDEE_TYPE_PERSON: number; + + /** + * Attendee type is room. + */ + const ATTENDEE_TYPE_ROOM: number; + + /** + * Attendee type is resource. + */ + const ATTENDEE_TYPE_RESOURCE: number; + + /** + * There is not attendee type. + */ + const ATTENDEE_TYPE_NONE: number; + + /** + * Attendee type is required. + */ + const ATTENDEE_TYPE_REQUIRED: number; + + /** + * Attendee type is group. + */ + const ATTENDEE_TYPE_GROUP: number; + + /** + * A local calendar source. + */ + const SOURCE_TYPE_LOCAL: number; + + /** + * A microsoft exchange calendar source. + */ + const SOURCE_TYPE_EXCHANGE: number; + + /** + * A calDev calendar source. + */ + const SOURCE_TYPE_CALDAV: number; + + /** + * A mobileMe calendar source. + */ + const SOURCE_TYPE_MOBILEME: number; + + /** + * A subscribed calendar source. + */ + const SOURCE_TYPE_SUBSCRIBED: number; + + /** + * A birthday calendar source. + */ + const SOURCE_TYPE_BIRTHDAYS: number; + + /** + * Returns an authorization constant indicating if the application has access to the events in the EventKit. + */ + const eventsAuthorization: number; + + /** + * Returns an authorization constant indicating if the application has access to the events in the EventKit. + */ + const calendarAuthorization: number; + + /** + * All alerts in selected calendars. + */ + const allAlerts: Titanium.Calendar.Alert[]; + + /** + * All calendars known to the native calendar app. + */ + const allCalendars: Titanium.Calendar.Calendar[]; + + /** + * All calendars known to the native calendar app that can add, edit, and + * delete items in the calendar. + */ + const allEditableCalendars: Titanium.Calendar.Calendar[]; + + /** + * All calendars selected within the native calendar app, which may be a subset of `allCalendars`. + */ + const selectableCalendars: Titanium.Calendar.Calendar[]; + + /** + * Calendar that events are added to by default, as specified by user settings. + */ + const defaultCalendar: Titanium.Calendar.Calendar; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the calendar with the specified identifier. + */ + function getCalendarById(id: string): Titanium.Calendar.Calendar; + + /** + * Returns `true` if the app has calendar access. + */ + function hasCalendarPermissions(): boolean; + + /** + * Requests for calendar access. + */ + function requestCalendarPermissions(callback: (param0: EventsAuthorizationResponse) => any): void; + + /** + * If authorization is unknown, will bring up a dialog requesting permission. + */ + function requestEventsAuthorization(callback: (param0: EventsAuthorizationResponse) => any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getEventsAuthorization(): number; + + /** + * Gets the value of the property. + */ + function getCalendarAuthorization(): number; + + /** + * Gets the value of the property. + */ + function getAllAlerts(): Titanium.Calendar.Alert[]; + + /** + * Gets the value of the property. + */ + function getAllCalendars(): Titanium.Calendar.Calendar[]; + + /** + * Gets the value of the property. + */ + function getAllEditableCalendars(): Titanium.Calendar.Calendar[]; + + /** + * Gets the value of the property. + */ + function getSelectableCalendars(): Titanium.Calendar.Calendar[]; + + /** + * Gets the value of the property. + */ + function getDefaultCalendar(): Titanium.Calendar.Calendar; + + /** + * An object that represents a single alert for an event in an calendar. + */ + interface Alert extends Titanium.Proxy { + /** + * The absolute date for the alarm. + */ + absoluteDate: Date; + + /** + * The offset from the start of an event, at which the alarm fires. + */ + relativeOffset: number; + + /** + * Date/time at which this alert alarm is set to trigger. + */ + readonly alarmTime: Date; + + /** + * Start date/time for the corresponding event. + */ + readonly begin: Date; + + /** + * End date/time for the corresponding event. + */ + readonly end: Date; + + /** + * Identifier of the event for which this alert is set. + */ + readonly eventId: number; + + /** + * Identifier of this alert. + */ + readonly id: string; + + /** + * Reminder notice period in minutes, that determines how long prior to the event this alert + * should trigger. + */ + readonly minutes: number; + + /** + * The current state of the alert. + */ + readonly state: number; + + /** + * Gets the value of the property. + */ + getAbsoluteDate(): Date; + + /** + * Sets the value of the property. + */ + setAbsoluteDate(absoluteDate: Date): void; + + /** + * Gets the value of the property. + */ + getRelativeOffset(): number; + + /** + * Sets the value of the property. + */ + setRelativeOffset(relativeOffset: number): void; + + /** + * Gets the value of the property. + */ + getAlarmTime(): Date; + + /** + * Gets the value of the property. + */ + getBegin(): Date; + + /** + * Gets the value of the property. + */ + getEnd(): Date; + + /** + * Gets the value of the property. + */ + getEventId(): number; + + /** + * Gets the value of the property. + */ + getId(): string; + + /** + * Gets the value of the property. + */ + getMinutes(): number; + + /** + * Gets the value of the property. + */ + getState(): number; + + } + + /** + * An object that represents a single attendee of an event. + */ + interface Attendee extends Titanium.Proxy { + /** + * Indicates whether this attendee is the event organizer. + */ + isOrganizer: boolean; + + /** + * The attendee name. + */ + name: string; + + /** + * The attendee email. + */ + email: string; + + /** + * The role of the attendee. + */ + role: number; + + /** + * The type of the attendee. + */ + type: number; + + /** + * The status of the attendee. + */ + status: number; + + /** + * Gets the value of the property. + */ + getIsOrganizer(): boolean; + + /** + * Sets the value of the property. + */ + setIsOrganizer(isOrganizer: boolean): void; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Sets the value of the property. + */ + setName(name: string): void; + + /** + * Gets the value of the property. + */ + getEmail(): string; + + /** + * Sets the value of the property. + */ + setEmail(email: string): void; + + /** + * Gets the value of the property. + */ + getRole(): number; + + /** + * Sets the value of the property. + */ + setRole(role: number): void; + + /** + * Gets the value of the property. + */ + getType(): number; + + /** + * Sets the value of the property. + */ + setType(type: number): void; + + /** + * Gets the value of the property. + */ + getStatus(): number; + + /** + * Sets the value of the property. + */ + setStatus(status: number): void; + + } + + /** + * An object that represents a single calendar. + */ + interface Calendar extends Titanium.Proxy { + /** + * Indicates whether this calendar can be edited or deleted. + */ + readonly hidden: boolean; + + /** + * Identifier of this calendar. Available only in iOS 5.0 and above. + */ + readonly id: string; + + /** + * Display name of this calendar. + */ + readonly name: string; + + /** + * Indicates whether the calendar is selected. + */ + readonly selected: boolean; + + /** + * Displays the source title. + */ + readonly sourceTitle: string; + + /** + * Displays the source type. + */ + readonly sourceType: number; + + /** + * Displays the source identifier. + */ + readonly sourceIdentifier: string; + + /** + * Creates an event in this calendar. + */ + createEvent(properties: any): Titanium.Calendar.Event; + + /** + * Gets the event with the specified identifier. + */ + getEventById(id: number): Titanium.Calendar.Event; + + /** + * Gets events that occur between two dates. + */ + getEventsBetweenDates(date1: Date, date2: Date | string): Titanium.Calendar.Event[]; + + /** + * Gets events that occur between two dates. + */ + getEventsBetweenDates(date1: string, date2: Date | string): Titanium.Calendar.Event[]; + + /** + * Gets events that occur between two dates. + */ + getEventsBetweenDates(date1: Date | string, date2: Date): Titanium.Calendar.Event[]; + + /** + * Gets events that occur between two dates. + */ + getEventsBetweenDates(date1: Date | string, date2: string): Titanium.Calendar.Event[]; + + /** + * Gets events that occur on a specified date. + */ + getEventsInDate(year: number, month: number, day: number): Titanium.Calendar.Event[]; + + /** + * Gets events that occur during a specified month. + */ + getEventsInMonth(year: number, month: number): Titanium.Calendar.Event[]; + + /** + * Gets all events that occur during a specified year. + */ + getEventsInYear(year: number): Titanium.Calendar.Event[]; + + /** + * Gets the value of the property. + */ + getHidden(): boolean; + + /** + * Gets the value of the property. + */ + getId(): string; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Gets the value of the property. + */ + getSelected(): boolean; + + /** + * Gets the value of the property. + */ + getSourceTitle(): string; + + /** + * Gets the value of the property. + */ + getSourceType(): number; + + /** + * Gets the value of the property. + */ + getSourceIdentifier(): string; + + } + + /** + * An object that represents a single event in a calendar. + */ + interface Event extends Titanium.Proxy { + /** + * Alarms associated with the calendar item, as an array of objects. + */ + alerts: Titanium.Calendar.Alert[]; + + /** + * Indicates whether this event is all day. + */ + allDay: boolean; + + /** + * Start date/time of this event. + */ + begin: Date; + + /** + * Notes for this event. + */ + notes: string; + + /** + * Description of this event. + */ + readonly description: string; + + /** + * End date/time of this event. + */ + end: Date; + + /** + * Extended properties of this event. + */ + readonly extendedProperties: any; + + /** + * Indicates whether an alarm is scheduled for this event. + */ + readonly hasAlarm: boolean; + + /** + * Identifier of this event. + */ + readonly id: string; + + /** + * Location of this event. + */ + location: string; + + /** + * Existing reminders for this event. + */ + readonly reminders: Titanium.Calendar.Reminder[]; + + /** + * Status of this event. + */ + readonly status: number; + + /** + * Availability of this event. + */ + readonly availability: number; + + /** + * Boolean value that indicates whether an event is a detached instance of a + * repeating event. + */ + readonly isDetached: boolean; + + /** + * Title of this event. + */ + title: string; + + /** + * Recurrence rule associated with the event. (Available in iOS 4.0 through iOS 5.1.) + */ + recurrenceRule: Titanium.Calendar.RecurrenceRule; + + /** + * The recurrence rules for the calendar item. (Available in iOS 5.1 and above.) + */ + recurrenceRules: Titanium.Calendar.RecurrenceRule[]; + + /** + * Visibility of this event. + */ + readonly visibility: number; + + /** + * The list of event attendees. This list will be empty if the event has no attendees. + */ + readonly attendees: Titanium.Calendar.Attendee[]; + + /** + * Creates an alert for this event. + */ + createAlert(data: any): Titanium.Calendar.Alert; + + /** + * Creates a reminder for this event. + */ + createReminder(data: any): Titanium.Calendar.Reminder; + + /** + * Gets the value of the specified extended property. + */ + getExtendedProperty(name: string): string; + + /** + * Sets the value of the specified extended property. + */ + setExtendedProperty(name: string, value: string): void; + + /** + * Creates an recurrence pattern for a recurring event. + * All of the properties for the recurrence rule must be set during creation. + * The recurrence rule properties cannot be modified. + */ + createRecurrenceRule(data: any): Titanium.Calendar.RecurrenceRule; + + /** + * Saves changes to an event permanently. + */ + save(span: number): boolean; + + /** + * Removes an event from the event store. + */ + remove(span: number): boolean; + + /** + * Updates the event's data with the current information in the Calendar database. + */ + refresh(): boolean; + + /** + * Adds a recurrence rule to the recurrence rule array. + */ + addRecurrenceRule(rule: Titanium.Calendar.RecurrenceRule): void; + + /** + * Removes a recurrence rule to the recurrence rule array. + */ + removeRecurrenceRule(rule: Titanium.Calendar.RecurrenceRule): void; + + /** + * Gets the value of the property. + */ + getAlerts(): Titanium.Calendar.Alert[]; + + /** + * Sets the value of the property. + */ + setAlerts(alerts: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getAllDay(): boolean; + + /** + * Sets the value of the property. + */ + setAllDay(allDay: boolean): void; + + /** + * Gets the value of the property. + */ + getBegin(): Date; + + /** + * Sets the value of the property. + */ + setBegin(begin: Date): void; + + /** + * Gets the value of the property. + */ + getNotes(): string; + + /** + * Sets the value of the property. + */ + setNotes(notes: string): void; + + /** + * Gets the value of the property. + */ + getDescription(): string; + + /** + * Gets the value of the property. + */ + getEnd(): Date; + + /** + * Sets the value of the property. + */ + setEnd(end: Date): void; + + /** + * Gets the value of the property. + */ + getExtendedProperties(): any; + + /** + * Gets the value of the property. + */ + getHasAlarm(): boolean; + + /** + * Gets the value of the property. + */ + getId(): string; + + /** + * Gets the value of the property. + */ + getLocation(): string; + + /** + * Sets the value of the property. + */ + setLocation(location: string): void; + + /** + * Gets the value of the property. + */ + getReminders(): Titanium.Calendar.Reminder[]; + + /** + * Gets the value of the property. + */ + getStatus(): number; + + /** + * Gets the value of the property. + */ + getAvailability(): number; + + /** + * Gets the value of the property. + */ + getIsDetached(): boolean; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getRecurrenceRule(): Titanium.Calendar.RecurrenceRule; + + /** + * Sets the value of the property. + */ + setRecurrenceRule(recurrenceRule: Titanium.Calendar.RecurrenceRule): void; + + /** + * Gets the value of the property. + */ + getRecurrenceRules(): Titanium.Calendar.RecurrenceRule[]; + + /** + * Sets the value of the property. + */ + setRecurrenceRules(recurrenceRules: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getVisibility(): number; + + /** + * Gets the value of the property. + */ + getAttendees(): Titanium.Calendar.Attendee[]; + + } + + /** + * An object that is used to describe the recurrence pattern for a recurring event. + */ + interface RecurrenceRule extends Titanium.Proxy { + /** + * Identifier for the recurrence rule's calendar. + */ + readonly calendarID: string; + + /** + * Frequency of the recurrence rule. + */ + readonly frequency: number; + + /** + * The interval between instances of this recurrence. For example, a weekly + * recurrence rule with an interval of 2 occurs every other week. Must be greater than 0. + */ + readonly interval: number; + + /** + * The days of the week that the event occurs, as an Dictionay of `daysOfWeek` and `Week`. + */ + readonly daysOfTheWeek: daysOfTheWeekDictionary; + + /** + * The days of the month that the event occurs, as an array of number objects. + * Values can be from 1 to 31 and from -1 to -31. This parameter is only valid for + * recurrence rules of type + * [RECURRENCEFREQUENCY_MONTHLY](Titanium.Calendar.RECURRENCEFREQUENCY_MONTHLY). + */ + readonly daysOfTheMonth: number[]; + + /** + * The months of the year that the event occurs, as an array of Number objects. + * Values can be from 1 to 12. This parameter is only valid for recurrence rules of + * type [RECURRENCEFREQUENCY_YEARLY](Titanium.Calendar.RECURRENCEFREQUENCY_YEARLY). + */ + readonly monthsOfTheYear: number[]; + + /** + * The weeks of the year that the event occurs, as an array of number objects. + * Values can be from 1 to 53 and from -1 to -53. This parameter is only valid for + * recurrence rules of type [RECURRENCEFREQUENCY_YEARLY](Titanium.Calendar.RECURRENCEFREQUENCY_YEARLY). + */ + readonly weeksOfTheYear: number[]; + + /** + * The days of the year that the event occurs, as an array of number objects. + * Values can be from 1 to 366 and from -1 to -366. This parameter is only valid for + * recurrence rules of type [RECURRENCEFREQUENCY_YEARLY](Titanium.Calendar.RECURRENCEFREQUENCY_YEARLY). + */ + readonly daysOfTheYear: number[]; + + /** + * An array of ordinal numbers that filters which recurrences to include in the + * recurrence rule's frequency. For example, a yearly recurrence rule that has a + * [daysOfTheWeek](Titanium.Calendar.RecurrenceRule.daysOfTheWeek) value that specifies + * Monday through Friday, and a `setPositions` array containing 2 and -1, occurs only + * on the second weekday and last weekday of every year. + */ + readonly setPositions: number[]; + + /** + * End of a recurrence rule. + */ + readonly end: recurrenceEndDictionary; + + /** + * Gets the value of the property. + */ + getCalendarID(): string; + + /** + * Gets the value of the property. + */ + getFrequency(): number; + + /** + * Gets the value of the property. + */ + getInterval(): number; + + /** + * Gets the value of the property. + */ + getDaysOfTheWeek(): daysOfTheWeekDictionary; + + /** + * Gets the value of the property. + */ + getDaysOfTheMonth(): number[]; + + /** + * Gets the value of the property. + */ + getMonthsOfTheYear(): number[]; + + /** + * Gets the value of the property. + */ + getWeeksOfTheYear(): number[]; + + /** + * Gets the value of the property. + */ + getDaysOfTheYear(): number[]; + + /** + * Gets the value of the property. + */ + getSetPositions(): number[]; + + /** + * Gets the value of the property. + */ + getEnd(): recurrenceEndDictionary; + + } + + /** + * An object that represents a single reminder for an event in a calendar. + */ + interface Reminder extends Titanium.Proxy { + /** + * Identifier of this reminder. + */ + readonly id: string; + + /** + * Method by which this reminder will be delivered. + */ + readonly method: number; + + /** + * Reminder notice period in minutes, that determines how long prior to the event this reminder + * should trigger. + */ + readonly minutes: number; + + /** + * Gets the value of the property. + */ + getId(): string; + + /** + * Gets the value of the property. + */ + getMethod(): number; + + /** + * Gets the value of the property. + */ + getMinutes(): number; + + } + } - export interface Gesture { - landscape : boolean; - orientation : number; - portrait : boolean; - getLandscape () : boolean; - getOrientation () : number; - getPortrait () : boolean; - isFaceDown () : boolean; - isFaceUp () : boolean; - isLandscape () : boolean; - isPortrait () : boolean; + + /** + * A module for translating between primitive types and raw byte streams. + */ + namespace Codec { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * ASCII character encoding.. + */ + const CHARSET_ASCII: string; + + /** + * ISO 8859-1 (Latin-1) character encoding. + */ + const CHARSET_ISO_LATIN_1: string; + + /** + * UTF-8 character encoding. + */ + const CHARSET_UTF8: string; + + /** + * UTF-16 character encoding with default byte order. + */ + const CHARSET_UTF16: string; + + /** + * UTF-16 character encoding with big endian byte order. + */ + const CHARSET_UTF16BE: string; + + /** + * UTF-16 character encoding with little endian byte order. + */ + const CHARSET_UTF16LE: string; + + /** + * 8-bit integer encoding type. + */ + const TYPE_BYTE: string; + + /** + * 16-bit integer encoding type. + */ + const TYPE_SHORT: string; + + /** + * 32-bit integer encoding type. + */ + const TYPE_INT: string; + + /** + * 32-bit single precision floating-point type. + */ + const TYPE_FLOAT: string; + + /** + * 64-bit integer encoding type. + */ + const TYPE_LONG: string; + + /** + * 64-bit double precision floating-point type. + */ + const TYPE_DOUBLE: string; + + /** + * Big endian (network) byte order -- that is, the most significant byte first. + */ + const BIG_ENDIAN: number; + + /** + * Little endian byte order -- that is, the least significant byte first. + */ + const LITTLE_ENDIAN: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Get the OS native byte order (either or + * ). + */ + function getNativeByteOrder(): number; + + /** + * Encodes a number and writes it to a buffer. + */ + function encodeNumber(options: EncodeNumberDict): number; + + /** + * Decodes a number from the `source` buffer using the specified data type. + */ + function decodeNumber(options: DecodeNumberDict): number; + + /** + * Encodes a string into a series of bytes in a buffer using the specified character set. + */ + function encodeString(options: any): number; + + /** + * Decodes the source buffer into a String using the supplied character set. + */ + function decodeString(options: DecodeStringDict): string; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + } - export interface Analytics { - lastEvent : string; - addEvent (type: string, name: string, data?: any) : void; - featureEvent (name: string, data?: any) : void; - getLastEvent () : string; - navEvent (from: string, to: string, name?: string, data?: any) : void; - settingsEvent (name: string, data?: any) : void; - timedEvent (name: string, start: Date, stop: Date, duration: number, data?: any) : void; - userEvent (name: string, data?: any) : void; + + /** + * The top-level Contacts module, used for accessing and modifying the system contacts address book. + */ + namespace Contacts { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Specifies that a contact is an organization. + */ + const CONTACTS_KIND_ORGANIZATION: number; + + /** + * Specifies that a contact is a person. + */ + const CONTACTS_KIND_PERSON: number; + + /** + * Specifies that group members will be sorted by first name. + */ + const CONTACTS_SORT_FIRST_NAME: number; + + /** + * Specifies that group members will be sorted by last name. + */ + const CONTACTS_SORT_LAST_NAME: number; + + /** + * A [contactsAuthorization](Titanium.Contacts.contactsAuthorization) value + * indicating that the application is authorized to use the address book. + */ + const AUTHORIZATION_AUTHORIZED: number; + + /** + * A [contactsAuthorization](Titanium.Contacts.contactsAuthorization) value + * indicating that the application is not authorized to use the address book. + */ + const AUTHORIZATION_DENIED: number; + + /** + * A [contactsAuthorization](Titanium.Contacts.contactsAuthorization) value + * indicating that the application is not authorized to use the address book *and* + * the user cannot change this application's status. + */ + const AUTHORIZATION_RESTRICTED: number; + + /** + * A [contactsAuthorization](Titanium.Contacts.contactsAuthorization) value + * indicating that the authorization state is unknown. + */ + const AUTHORIZATION_UNKNOWN: number; + + /** + * Returns an authorization constant indicating if the application has access to the address book. + */ + const contactsAuthorization: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Creates and returns an instance of . + */ + function createGroup(parameters?: any): Titanium.Contacts.Group; + + /** + * Creates and returns an instance of , and commits all pending + * changes to the underlying contacts database. + */ + function createPerson(parameters?: any): Titanium.Contacts.Person; + + /** + * Gets all groups. + */ + function getAllGroups(): Titanium.Contacts.Group[]; + + /** + * Gets all people, unless a limit is specified. + */ + function getAllPeople(limit: number): Titanium.Contacts.Person[]; + + /** + * Gets the group with the specified identifier. Deprecated for >= iOS9. Use instead. + */ + function getGroupByID(id: number): Titanium.Contacts.Group; + + /** + * Gets the group with the specified identifier. + */ + function getGroupByIdentifier(id: string): Titanium.Contacts.Group; + + /** + * Gets people with a `firstName`, `middleName` or `lastName` field, or a combination + * of these fields, that match the specified name. + */ + function getPeopleWithName(name: string): Titanium.Contacts.Person[]; + + /** + * Gets the person with the specified identifier. Deprecated for >= iOS9. Use instead. + */ + function getPersonByID(id: number): Titanium.Contacts.Person; + + /** + * Gets the person with the specified identifier. + */ + function getPersonByIdentifier(id: number): Titanium.Contacts.Person; + + /** + * Removes a group from the address book. + */ + function removeGroup(group: Titanium.Contacts.Group): void; + + /** + * Removes a contact from the address book. + */ + function removePerson(person: Titanium.Contacts.Person): void; + + /** + * Reverts all changes made by the previous save to the address book. Deprecated for >= iOS9. + */ + function revert(): void; + + /** + * Commits all pending changes to the underlying contacts database. + */ + function save(contacts: ReadonlyArray): void; + + /** + * Displays a picker that allows a person to be selected. + */ + function showContacts(params: showContactsParams): void; + + /** + * Returns `true` if the app has contacts access. + */ + function hasContactsPermissions(): boolean; + + /** + * Requests for contacts access. + */ + function requestContactsPermissions(callback: (param0: ContactsAuthorizationResponse) => any): void; + + /** + * If authorization is unknown, will bring up a dialog requesting permission. + */ + function requestAuthorization(callback: (param0: ContactsAuthorizationResponse) => any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getContactsAuthorization(): number; + + /** + * An object which represents a group in the system contacts address book. + */ + interface Group extends Titanium.Proxy { + /** + * Name of this group. + */ + name: string; + + /** + * Record identifier of the group. Single value. Deprecated for >= iOS9. + */ + recordId: number; + + /** + * Identifier of the group. + */ + readonly identifier: string; + + /** + * Adds a person to this group. + */ + add(person: Titanium.Contacts.Person): void; + + /** + * Gets people that are members of this group. + */ + members(): Titanium.Contacts.Person[]; + + /** + * Removes a person from this group. For >= iOS9, it is not + * required to call after calling this method. + */ + remove(person: Titanium.Contacts.Person): void; + + /** + * Gets people that are members of this group, sorted in the specified order. + */ + sortedMembers(sortBy: number): Titanium.Contacts.Person[]; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Sets the value of the property. + */ + setName(name: string): void; + + /** + * Gets the value of the property. + */ + getRecordId(): number; + + /** + * Sets the value of the property. + */ + setRecordId(recordId: number): void; + + /** + * Gets the value of the property. + */ + getIdentifier(): string; + + } + + /** + * An object that represents a contact record for a person or organization in the system contacts + * address book. + */ + interface Person extends Titanium.Proxy { + /** + * Addresses for the person. Multi-value. Read-only on Android. + */ + address: any; + + /** + * Date of birth of the person. Single value. + */ + birthday: string; + + /** + * Alternate birthday of the person. Single Dictionary. + */ + alternateBirthday: any; + + /** + * Date and time that the person record was created. Single value. Deprecated since iOS 9. + */ + readonly created: string; + + /** + * Dates associated with the person. Multi-value. + */ + date: any; + + /** + * Department of the person. Single value. + */ + department: string; + + /** + * Email addresses for the person. Multi-value. Read-only on Android. + */ + email: any; + + /** + * First name of the person. Single value. + */ + firstName: string; + + /** + * Phonetic first name of the person. Single value. + */ + firstPhonetic: string; + + /** + * Localized full name of the person. Single value. Read-only on Android. + */ + readonly fullName: string; + + /** + * Record identifier of the person. Single value. + */ + readonly id: number; + + /** + * Identifier of the person. + */ + readonly identifier: string; + + /** + * Image for the person. Single value. Read-only for >= iOS9 + */ + image: Titanium.Blob; + + /** + * Instant messenger information of the person. Multi-value. + */ + instantMessage: any; + + /** + * Social profile information of the person. Multi-value. + */ + socialProfile: any; + + /** + * Job title of the person. Single value. + */ + jobTitle: string; + + /** + * Determines the type of information the person record contains; either person or organization. + * Read-only on Android. + */ + kind: number; + + /** + * Last name of the person. Single value. + */ + lastName: string; + + /** + * Phonetic last name of the person. Single value. + */ + lastPhonetic: string; + + /** + * Middle name of the person. Single value. + */ + middleName: string; + + /** + * Phonetic middle name of the person. Single value. + */ + middlePhonetic: string; + + /** + * Date and time that the person record was last modified. Single value. Deprecated since iOS 9. + */ + readonly modified: string; + + /** + * Nickname of the person. Single value. + */ + nickname: string; + + /** + * Notes for the person. Single value. + */ + note: string; + + /** + * Organization to which the person belongs. Single value. + */ + organization: string; + + /** + * Phone numbers for the person. Multi-value. Read-only on Android. + */ + phone: any; + + /** + * Prefix for the person. Single value. + */ + readonly prefix: string; + + /** + * Record identifier of the person. Single value. Deprecated since iOS 9. + */ + recordId: number; + + /** + * Names of people to which the person is related. Multi-value. + */ + relatedNames: any; + + /** + * Suffix for the person. Single value. + */ + readonly suffix: string; + + /** + * URLs of webpages associated with the person. Multi-value. + */ + url: any; + + /** + * Gets the value of the property. + */ + getAddress(): any; + + /** + * Sets the value of the property. + */ + setAddress(address: any): void; + + /** + * Gets the value of the property. + */ + getBirthday(): string; + + /** + * Sets the value of the property. + */ + setBirthday(birthday: string): void; + + /** + * Gets the value of the property. + */ + getAlternateBirthday(): any; + + /** + * Sets the value of the property. + */ + setAlternateBirthday(alternateBirthday: any): void; + + /** + * Gets the value of the property. + */ + getCreated(): string; + + /** + * Gets the value of the property. + */ + getDate(): any; + + /** + * Sets the value of the property. + */ + setDate(date: any): void; + + /** + * Gets the value of the property. + */ + getDepartment(): string; + + /** + * Sets the value of the property. + */ + setDepartment(department: string): void; + + /** + * Gets the value of the property. + */ + getEmail(): any; + + /** + * Sets the value of the property. + */ + setEmail(email: any): void; + + /** + * Gets the value of the property. + */ + getFirstName(): string; + + /** + * Sets the value of the property. + */ + setFirstName(firstName: string): void; + + /** + * Gets the value of the property. + */ + getFirstPhonetic(): string; + + /** + * Sets the value of the property. + */ + setFirstPhonetic(firstPhonetic: string): void; + + /** + * Gets the value of the property. + */ + getFullName(): string; + + /** + * Gets the value of the property. + */ + getId(): number; + + /** + * Gets the value of the property. + */ + getIdentifier(): string; + + /** + * Gets the value of the property. + */ + getImage(): Titanium.Blob; + + /** + * Sets the value of the property. + */ + setImage(image: Titanium.Blob): void; + + /** + * Gets the value of the property. + */ + getInstantMessage(): any; + + /** + * Sets the value of the property. + */ + setInstantMessage(instantMessage: any): void; + + /** + * Gets the value of the property. + */ + getSocialProfile(): any; + + /** + * Sets the value of the property. + */ + setSocialProfile(socialProfile: any): void; + + /** + * Gets the value of the property. + */ + getJobTitle(): string; + + /** + * Sets the value of the property. + */ + setJobTitle(jobTitle: string): void; + + /** + * Gets the value of the property. + */ + getKind(): number; + + /** + * Sets the value of the property. + */ + setKind(kind: number): void; + + /** + * Gets the value of the property. + */ + getLastName(): string; + + /** + * Sets the value of the property. + */ + setLastName(lastName: string): void; + + /** + * Gets the value of the property. + */ + getLastPhonetic(): string; + + /** + * Sets the value of the property. + */ + setLastPhonetic(lastPhonetic: string): void; + + /** + * Gets the value of the property. + */ + getMiddleName(): string; + + /** + * Sets the value of the property. + */ + setMiddleName(middleName: string): void; + + /** + * Gets the value of the property. + */ + getMiddlePhonetic(): string; + + /** + * Sets the value of the property. + */ + setMiddlePhonetic(middlePhonetic: string): void; + + /** + * Gets the value of the property. + */ + getModified(): string; + + /** + * Gets the value of the property. + */ + getNickname(): string; + + /** + * Sets the value of the property. + */ + setNickname(nickname: string): void; + + /** + * Gets the value of the property. + */ + getNote(): string; + + /** + * Sets the value of the property. + */ + setNote(note: string): void; + + /** + * Gets the value of the property. + */ + getOrganization(): string; + + /** + * Sets the value of the property. + */ + setOrganization(organization: string): void; + + /** + * Gets the value of the property. + */ + getPhone(): any; + + /** + * Sets the value of the property. + */ + setPhone(phone: any): void; + + /** + * Gets the value of the property. + */ + getPrefix(): string; + + /** + * Gets the value of the property. + */ + getRecordId(): number; + + /** + * Sets the value of the property. + */ + setRecordId(recordId: number): void; + + /** + * Gets the value of the property. + */ + getRelatedNames(): any; + + /** + * Sets the value of the property. + */ + setRelatedNames(relatedNames: any): void; + + /** + * Gets the value of the property. + */ + getSuffix(): string; + + /** + * Gets the value of the property. + */ + getUrl(): any; + + /** + * Sets the value of the property. + */ + setUrl(url: any): void; + + } + } - export module Facebook { - export var BUTTON_STYLE_NORMAL : number; - export var BUTTON_STYLE_WIDE : number; - export var accessToken : string; - export var apiName : string; - export var appid : string; - export var bubbleParent : boolean; - export var expirationDate : Date; - export var forceDialogAuth : boolean; - export var loggedIn : boolean; - export var permissions : Array; - export var uid : string; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function authorize () : void; - export function createLoginButton (parameters?: Dictionary) : Ti.Facebook.LoginButton; - export function dialog (action: string, params: any, callback: (...args : any[]) => any) : void; - export function fireEvent (name: string, event: Dictionary) : void; - export function getAccessToken () : string; - export function getApiName () : string; - export function getAppid () : string; - export function getBubbleParent () : boolean; - export function getExpirationDate () : Date; - export function getForceDialogAuth () : boolean; - export function getLoggedIn () : boolean; - export function getPermissions () : Array; - export function getUid () : string; - export function logout () : void; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function request (method: string, params: any, callback: (...args : any[]) => any) : void; - export function requestWithGraphPath (path: string, params: Dictionary, httpMethod: string, callback: (...args : any[]) => any) : void; - export function setAccessToken (accessToken: string) : void; - export function setAppid (appid: string) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setExpirationDate (expirationDate: Date) : void; - export function setForceDialogAuth (forceDialogAuth: boolean) : void; - export function setLoggedIn (loggedIn: boolean) : void; - export function setPermissions (permissions: Array) : void; - export function setUid (uid: string) : void; - export interface LoginButton extends Ti.UI.View { - style : string; - getStyle () : string; - setStyle (style: string) : void; + + /** + * The top-level `Database` module, used for creating and accessing the + * in-application SQLite database. + */ + namespace Database { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Constant for requesting a column's value returned in double form. + */ + const FIELD_TYPE_DOUBLE: number; + + /** + * Constant for requesting a column's value returned in float form. + */ + const FIELD_TYPE_FLOAT: number; + + /** + * Constant for requesting a column's value returned in integer form. + */ + const FIELD_TYPE_INT: number; + + /** + * Constant for requesting a column's value returned in string form. + */ + const FIELD_TYPE_STRING: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Installs an SQLite database to device's internal storage. + */ + function install(path: string, dbName: string): Titanium.Database.DB; + + /** + * Opens an SQLite database. + */ + function open(dbName: string): Titanium.Database.DB; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * The `Database` instance returned by or . + */ + interface DB extends Titanium.Proxy { + /** + * A `File` object representing the file where this database is stored. Must only be used for + * setting file properties. + */ + readonly file: Titanium.Filesystem.File; + + /** + * The identifier of the last populated row. + */ + lastInsertRowId: number; + + /** + * The name of the database. + */ + name: string; + + /** + * The number of rows affected by the last query. + */ + rowsAffected: number; + + /** + * Closes the database and releases resources from memory. Once closed, this instance is no + * longer valid and should not be used. On iOS, also closes all + * instances that exist. + */ + close(): void; + + /** + * Executes an SQL statement against the database and returns a `ResultSet`. + */ + execute(sql: string, vararg?: string): Titanium.Database.ResultSet; + + /** + * Executes an SQL statement against the database and returns a `ResultSet`. + */ + execute(sql: string, vararg?: ReadonlyArray): Titanium.Database.ResultSet; + + /** + * Executes an SQL statement against the database and returns a `ResultSet`. + */ + execute(sql: string, vararg?: any): Titanium.Database.ResultSet; + + /** + * Executes an SQL statement against the database and returns a `ResultSet`. + */ + execute(sql: string, vararg?: ReadonlyArray): Titanium.Database.ResultSet; + + /** + * Removes the database files for this instance from disk. WARNING: this is a destructive + * operation and cannot be reversed. All data in the database will be lost; use with caution. + */ + remove(): void; + + /** + * Gets the value of the property. + */ + getFile(): Titanium.Filesystem.File; + + /** + * Gets the value of the property. + */ + getLastInsertRowId(): number; + + /** + * Sets the value of the property. + */ + setLastInsertRowId(lastInsertRowId: number): void; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Sets the value of the property. + */ + setName(name: string): void; + + /** + * Gets the value of the property. + */ + getRowsAffected(): number; + + /** + * Sets the value of the property. + */ + setRowsAffected(rowsAffected: number): void; + + } + + /** + * The ResultSet instance returned by . + */ + interface ResultSet extends Titanium.Proxy { + /** + * The number of columns in this result set. + */ + readonly fieldCount: number; + + /** + * The number of rows in this result set. + */ + readonly rowCount: number; + + /** + * Indicates whether the current row is valid. + */ + readonly validRow: boolean; + + /** + * Closes this result set and release resources. Once closed, the result set must no longer + * be used. + */ + close(): void; + + /** + * Retrieves the value for the specified field in the current row, + * and casts it to the specified type (String, Integer, Float or Double.) + */ + field(index: number, type?: number): string | number | Titanium.Blob; + + /** + * Retrieves the value for the specified field in the current row, + * and casts it to the specified type (String, Integer, Float or Double.) + */ + fieldByName(name: string, type?: number): string | number | Titanium.Blob; + + /** + * Returns the field name for the specified field index. + */ + fieldName(index: number): string; + + /** + * Returns the field name for the specified field index. + */ + getFieldName(index: number): string; + + /** + * Returns whether the current row is valid. + */ + isValidRow(): boolean; + + /** + * Advances to the next row in the result set and returns `true` if one exists, + * or `false` otherwise. + */ + next(): boolean; + + /** + * Gets the value of the property. + */ + getFieldCount(): number; + + /** + * Gets the value of the property. + */ + getRowCount(): number; + + /** + * Gets the value of the property. + */ + getValidRow(): boolean; + + } + + } + + /** + * The top level filesystem module, used to access files and directories on the device. + */ + namespace Filesystem { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Constant for append mode for file operations. + */ + const MODE_APPEND: number; + + /** + * Constant for read mode for file operations. + */ + const MODE_READ: number; + + /** + * Constant for write mode for file operations. + */ + const MODE_WRITE: number; + + /** + * Constant used to set protection key to NSFileProtectionNone in file attributes. + */ + const IOS_FILE_PROTECTION_NONE: string; + + /** + * Constant used to set protection key to NSFileProtectionComplete in file attributes. + */ + const IOS_FILE_PROTECTION_COMPLETE: string; + + /** + * Constant used to set protection key to NSFileProtectionCompleteUnlessOpen in file attributes. + */ + const IOS_FILE_PROTECTION_COMPLETE_UNLESS_OPEN: string; + + /** + * Constant used to set protection key to NSFileProtectionCompleteUntilFirstUserAuthentication in file attributes. + */ + const IOS_FILE_PROTECTION_COMPLETE_UNTIL_FIRST_USER_AUTHENTICATION: string; + + /** + * Path to the application's internal cache directory. + */ + const applicationCacheDirectory: string; + + /** + * Path to the application's data directory. + */ + const applicationDataDirectory: string; + + /** + * Path to the iOS application directory. + */ + const applicationDirectory: string; + + /** + * Path to the application support directory. + */ + const applicationSupportDirectory: string; + + /** + * Path to a directory on removable storage, such as SD card. + */ + const externalStorageDirectory: string; + + /** + * Platform-specific line ending constant. + */ + const lineEnding: string; + + /** + * Path to the application's resource directory. + */ + const resourcesDirectory: string; + + /** + * Path to the application's raw resource directory. + */ + const resRawDirectory: string; + + /** + * Platform-specific path separator constant. + */ + const separator: string; + + /** + * Path for the application's temporary directory. + */ + const tempDirectory: string; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Creates a temporary directory and returns a [File](Titanium.Filesystem.File) object representing the new directory. + */ + function createTempDirectory(): Titanium.Filesystem.File; + + /** + * Creates a temporary file and returns a [File](Titanium.Filesystem.File) object representing the new file. + */ + function createTempFile(): Titanium.Filesystem.File; + + /** + * Returns a `File` object representing the file identified by the path arguments. + */ + function getFile(...paths: string[]): Titanium.Filesystem.File; + + /** + * Returns a `Blob` object representing the asset catalog image identified by the path arguments. + */ + function getAsset(path: string): Titanium.Blob; + + /** + * Returns `true` if the device supports external storage *and* the external storage device is mounted. + */ + function isExternalStoragePresent(): boolean; + + /** + * Returns `true` if the app has storage permissions. + */ + function hasStoragePermissions(): boolean; + + /** + * Requests for storage permissions + */ + function requestStoragePermissions(callback: (param0: RequestStorageAccessResult) => any): void; + + /** + * Opens file using the interface. + */ + function openStream(mode: number, path: string): Titanium.Filesystem.FileStream; + + /** + * Returns the path to the container directory associated with the specified security application group ID. + */ + function directoryForSuite(suiteName: string): string; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getApplicationCacheDirectory(): string; + + /** + * Gets the value of the property. + */ + function getApplicationDataDirectory(): string; + + /** + * Gets the value of the property. + */ + function getApplicationDirectory(): string; + + /** + * Gets the value of the property. + */ + function getApplicationSupportDirectory(): string; + + /** + * Gets the value of the property. + */ + function getExternalStorageDirectory(): string; + + /** + * Gets the value of the property. + */ + function getLineEnding(): string; + + /** + * Gets the value of the property. + */ + function getResourcesDirectory(): string; + + /** + * Gets the value of the property. + */ + function getResRawDirectory(): string; + + /** + * Gets the value of the property. + */ + function getSeparator(): string; + + /** + * Gets the value of the property. + */ + function getTempDirectory(): string; + + /** + * Object representing a path to a file or directory in the device's persistent storage. + */ + interface File extends Titanium.Proxy { + /** + * `true` if the file is executable. + */ + readonly executable: boolean; + + /** + * Set to `true` if the file is hidden. + */ + hidden: boolean; + + /** + * Name of the file. + */ + readonly name: string; + + /** + * Native path associated with this file object, as a file URL. + */ + readonly nativePath: string; + + /** + * A `File` object representing the parent directory of the file identified by this object. + */ + readonly parent: Titanium.Filesystem.File; + + /** + * `true` if the file identified by this object is read-only. + */ + readonly readonly: boolean; + + /** + * Size, in bytes, of the file identified by this object. + */ + readonly size: number; + + /** + * Value indicating whether or not to back up to a cloud service. + */ + remoteBackup: boolean; + + /** + * `true` if the file identified by this object is a symbolic link. + */ + readonly symbolicLink: boolean; + + /** + * `true` if the file identified by this object is writable. + */ + readonly writable: boolean; + + /** + * `true` if the file identified by this object is writable. + */ + readonly writeable: boolean; + + /** + * Appends data to the file identified by this file object. + */ + append(data: string): boolean; + + /** + * Appends data to the file identified by this file object. + */ + append(data: Titanium.Blob): boolean; + + /** + * Appends data to the file identified by this file object. + */ + append(data: Titanium.Filesystem.File): boolean; + + /** + * Copies the file identified by this file object to a new path. + */ + copy(destinationPath: string): boolean; + + /** + * Creates a directory at the path identified by this file object. + */ + createDirectory(): boolean; + + /** + * Creates a file at the path identified by this file object. + */ + createFile(): boolean; + + /** + * Returns the creation timestamp for the file identified by this file object. + */ + createTimestamp(): number; + + /** + * Deletes the directory identified by this file object. + */ + deleteDirectory(recursive?: boolean): boolean; + + /** + * Deletes the file identified by this file object. + */ + deleteFile(): boolean; + + /** + * Returns `true` if the file or directory identified by this file object exists on the device. + */ + exists(): boolean; + + /** + * Returns the extension for the file identified by this file object. + */ + extension(): string; + + /** + * Returns a listing of the directory identified by this file object, or `null` + * if this object doesn't identify a directory. + */ + getDirectoryListing(): string[]; + + /** + * Returns the path of the parent directory holding the file identified by this + * file object, as a String (deprecated) **or** as a `File` object. + */ + getParent(): string | Titanium.Filesystem.File; + + /** + * Returns the protection key value of this file object. + * Returns `null` if there's an error. + */ + getProtectionKey(): string; + + /** + * Returns `true` if this file object represents a directory. + */ + isDirectory(): boolean; + + /** + * Returns `true` if this file object represents an ordinary file. + */ + isFile(): boolean; + + /** + * Returns the last modification time for this file. + */ + modificationTimestamp(): number; + + /** + * Moves the file identified by this file object to another path. + */ + move(newpath: string): boolean; + + /** + * Opens the file identified by this file object for random access. + */ + open(mode: number): Titanium.Filesystem.FileStream; + + /** + * Returns the contents of the file identified by this file object as a `Blob`. + */ + read(): Titanium.Blob; + + /** + * Renames the file identified by this file object. + */ + rename(newname: string): boolean; + + /** + * Returns the fully-resolved native path associated with this file object. + */ + resolve(): string; + + /** + * Sets the protection key as an attribute to the file identified by this file object. + */ + setProtectionKey(fileProtectionType: string): boolean; + + /** + * Returns the amount of free space available on the device where the file identified by this file object is stored. + */ + spaceAvailable(): number; + + /** + * Writes the specified data to the file identified by this file object. + */ + write(data: string, append?: boolean): boolean; + + /** + * Writes the specified data to the file identified by this file object. + */ + write(data: Titanium.Filesystem.File, append?: boolean): boolean; + + /** + * Writes the specified data to the file identified by this file object. + */ + write(data: Titanium.Blob, append?: boolean): boolean; + + /** + * Gets the value of the property. + */ + getExecutable(): boolean; + + /** + * Gets the value of the property. + */ + getHidden(): boolean; + + /** + * Sets the value of the property. + */ + setHidden(hidden: boolean): void; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Gets the value of the property. + */ + getNativePath(): string; + + /** + * Gets the value of the property. + */ + getParent(): Titanium.Filesystem.File; + + /** + * Gets the value of the property. + */ + getReadonly(): boolean; + + /** + * Gets the value of the property. + */ + getSize(): number; + + /** + * Gets the value of the property. + */ + getRemoteBackup(): boolean; + + /** + * Sets the value of the property. + */ + setRemoteBackup(remoteBackup: boolean): void; + + /** + * Gets the value of the property. + */ + getSymbolicLink(): boolean; + + /** + * Gets the value of the property. + */ + getWritable(): boolean; + + /** + * Gets the value of the property. + */ + getWriteable(): boolean; + + } + + /** + * Wrapper around `Titanium.Filesystem.File` that implements the `Titanium.IOStream` interface + */ + interface FileStream extends Titanium.Proxy { + /** + * Reads data from this stream into a buffer. + */ + read(buffer: Titanium.Buffer, offset?: number, length?: number): number; + + /** + * Writes data from a buffer to this stream. + */ + write(buffer: Titanium.Buffer, offset?: number, length?: number): number; + + /** + * Indicates whether this stream is writable. + */ + isWritable(): boolean; + + /** + * Indicates whether this stream is readable. + */ + isReadable(): boolean; + + /** + * closes file stream, exception is thrown on error + */ + close(): void; + + } + + } + + /** + * The top level Geolocation module. The Geolocation module is used for accessing device location based information. + */ + namespace Geolocation { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Use with [accuracy](Titanium.Geolocation.accuracy) to request the best + * accuracy available. + */ + const ACCURACY_BEST: number; + + /** + * Use with [accuracy](Titanium.Geolocation.accuracy) to request location + * updates accurate to the nearest 100 meters. + */ + const ACCURACY_HUNDRED_METERS: number; + + /** + * Use with [accuracy](Titanium.Geolocation.accuracy) to request location + * updates accurate to the nearest kilometer. + */ + const ACCURACY_KILOMETER: number; + + /** + * Use with [accuracy](Titanium.Geolocation.accuracy) to request location + * updates accurate to the nearest 10 meters. + */ + const ACCURACY_NEAREST_TEN_METERS: number; + + /** + * Use with [accuracy](Titanium.Geolocation.accuracy) to request location + * updates accurate to the nearest three kilometers. + */ + const ACCURACY_THREE_KILOMETERS: number; + + /** + * Use with [accuracy](Titanium.Geolocation.accuracy) to request more + * accurate location updates with higher battery usage. + */ + const ACCURACY_HIGH: number; + + /** + * Use with [accuracy](Titanium.Geolocation.accuracy) to request highest possible + * accuracy and combine it with additional sensor data. + */ + const ACCURACY_BEST_FOR_NAVIGATION: number; + + /** + * Use with [accuracy](Titanium.Geolocation.accuracy) to request less + * accurate location updates with lower battery usage. + */ + const ACCURACY_LOW: number; + + /** + * A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value + * indicating that the application is authorized to use location services. + */ + const AUTHORIZATION_AUTHORIZED: number; + + /** + * A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value + * indicating that the application is not authorized to use location services, *or* + * location services are disabled. + */ + const AUTHORIZATION_DENIED: number; + + /** + * A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value + * indicating that the application is not authorized to use location servies *and* + * the user cannot change this application's status. + */ + const AUTHORIZATION_RESTRICTED: number; + + /** + * A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value + * indicating that the authorization state is unknown. + */ + const AUTHORIZATION_UNKNOWN: number; + + /** + * A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value + * indicating that the application is authorized to start location services at any time. This authorization + * includes the use of all location services, including monitoring regions and significant location changes. + */ + const AUTHORIZATION_ALWAYS: number; + + /** + * A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value + * indicating that the application is authorized to start most location services only while running in the foreground. + */ + const AUTHORIZATION_WHEN_IN_USE: number; + + /** + * Error code indicating that the user denied access to the location service. + */ + const ERROR_DENIED: number; + + /** + * Error code indicating that the heading could not be determined. + */ + const ERROR_HEADING_FAILURE: number; + + /** + * Error code indicating that the user's location could not be determined. + */ + const ERROR_LOCATION_UNKNOWN: number; + + /** + * Error code indicating that the network was unavailable. + */ + const ERROR_NETWORK: number; + + /** + * Error code indicating that region monitoring is delayed. + */ + const ERROR_REGION_MONITORING_DELAYED: number; + + /** + * Error code indicating that region monitoring is denied. + */ + const ERROR_REGION_MONITORING_DENIED: number; + + /** + * Error code indicating a region monitoring failure. + */ + const ERROR_REGION_MONITORING_FAILURE: number; + + /** + * Specifies the GPS location provider. + */ + const PROVIDER_GPS: string; + + /** + * Specifies the network location provider. + */ + const PROVIDER_NETWORK: string; + + /** + * Specifies the passive location provider. + */ + const PROVIDER_PASSIVE: string; + + /** + * The location data is being used for an unknown activity. + */ + const ACTIVITYTYPE_OTHER: string; + + /** + * The location data is used for tracking location changes to the automobile specifically during vehicular navigation. + */ + const ACTIVITYTYPE_AUTOMOTIVE_NAVIGATION: string; + + /** + * The location data is used for tracking any pedestrian-related activity. + */ + const ACTIVITYTYPE_FITNESS: string; + + /** + * The location data is used for tracking movements of other types of vehicular + * navigation that are not automobile related. + */ + const ACTIVITYTYPE_OTHER_NAVIGATION: string; + + /** + * Specifies the requested accuracy for location updates. + */ + let accuracy: number; + + /** + * The minimum change of position (in meters) before a 'location' event is fired. + */ + let distanceFilter: number; + + /** + * Requested frequency for location updates, in milliseconds. + */ + let frequency: number; + + /** + * Indicates whether the current device supports a compass. + */ + const hasCompass: boolean; + + /** + * Minimum heading change (in degrees) before a `heading` event is fired. + */ + let headingFilter: number; + + /** + * Returns an authorization constant indicating if the application has access to location services. + */ + let locationServicesAuthorization: number; + + /** + * Indicates if the user has enabled or disabled location services for the device (not the application). + */ + const locationServicesEnabled: boolean; + + /** + * Determines the preferred location provider. + */ + let preferredProvider: string; + + /** + * Text to display in the permission dialog when requesting location + * services. + */ + let purpose: string; + + /** + * Determines whether the compass calibration UI is shown if needed. + */ + let showCalibration: boolean; + + /** + * Indicates if the location changes should be updated only when a significant change + * in location occurs. + */ + let trackSignificantLocationChange: boolean; + + /** + * Determines if the app can do background location updates. + */ + let allowsBackgroundLocationUpdates: boolean; + + /** + * The type of user activity to be associated with the location updates. Available in iOS 6.0 and later. + */ + let activityType: number; + + /** + * Indicates whether the location updates may be paused. Available in iOS 6.0 and later. + */ + let pauseLocationUpdateAutomatically: boolean; + + /** + * JSON representation of the last geolocation received. + */ + const lastGeolocation: string; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Resolves an address to a location. + */ + function forwardGeocoder(address: string, callback: (param0: ForwardGeocodeResponse) => any): void; + + /** + * Retrieves the current compass heading. + */ + function getCurrentHeading(callback: (param0: HeadingResponse) => any): void; + + /** + * Retrieves the last known location from the device. + */ + function getCurrentPosition(callback: (param0: LocationResults) => any): void; + + /** + * Returns `true` if the app has location access. + */ + function hasLocationPermissions(authorizationType: number): boolean; + + /** + * Requests for location access. + */ + function requestLocationPermissions(authorizationType: number, callback: (param0: LocationAuthorizationResponse) => any): void; + + /** + * Tries to resolve a location to an address. + */ + function reverseGeocoder(latitude: number, longitude: number, callback: (param0: ReverseGeocodeResponse) => any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getAccuracy(): number; + + /** + * Sets the value of the property. + */ + function setAccuracy(accuracy: number): void; + + /** + * Gets the value of the property. + */ + function getDistanceFilter(): number; + + /** + * Sets the value of the property. + */ + function setDistanceFilter(distanceFilter: number): void; + + /** + * Gets the value of the property. + */ + function getFrequency(): number; + + /** + * Sets the value of the property. + */ + function setFrequency(frequency: number): void; + + /** + * Gets the value of the property. + */ + function getHasCompass(): boolean; + + /** + * Gets the value of the property. + */ + function getHeadingFilter(): number; + + /** + * Sets the value of the property. + */ + function setHeadingFilter(headingFilter: number): void; + + /** + * Gets the value of the property. + */ + function getLocationServicesAuthorization(): number; + + /** + * Sets the value of the property. + */ + function setLocationServicesAuthorization(locationServicesAuthorization: number): void; + + /** + * Gets the value of the property. + */ + function getLocationServicesEnabled(): boolean; + + /** + * Gets the value of the property. + */ + function getPreferredProvider(): string; + + /** + * Sets the value of the property. + */ + function setPreferredProvider(preferredProvider: string): void; + + /** + * Gets the value of the property. + */ + function getPurpose(): string; + + /** + * Sets the value of the property. + */ + function setPurpose(purpose: string): void; + + /** + * Gets the value of the property. + */ + function getShowCalibration(): boolean; + + /** + * Sets the value of the property. + */ + function setShowCalibration(showCalibration: boolean): void; + + /** + * Gets the value of the property. + */ + function getTrackSignificantLocationChange(): boolean; + + /** + * Sets the value of the property. + */ + function setTrackSignificantLocationChange(trackSignificantLocationChange: boolean): void; + + /** + * Gets the value of the property. + */ + function getAllowsBackgroundLocationUpdates(): boolean; + + /** + * Sets the value of the property. + */ + function setAllowsBackgroundLocationUpdates(allowsBackgroundLocationUpdates: boolean): void; + + /** + * Gets the value of the property. + */ + function getActivityType(): number; + + /** + * Sets the value of the property. + */ + function setActivityType(activityType: number): void; + + /** + * Gets the value of the property. + */ + function getPauseLocationUpdateAutomatically(): boolean; + + /** + * Sets the value of the property. + */ + function setPauseLocationUpdateAutomatically(pauseLocationUpdateAutomatically: boolean): void; + + /** + * Gets the value of the property. + */ + function getLastGeolocation(): string; + + + /** + * Module for Android-specific geolocation functionality. + */ + namespace Android { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Set to `true` to enable manual configuration of location updates through this module. + */ + let manualMode: boolean; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Adds and enables the specified location provider, possibly replacing an existing one. + */ + function addLocationProvider(provider: Titanium.Geolocation.Android.LocationProvider): void; + + /** + * Disables and removes the specified location provider. + */ + function removeLocationProvider(provider: Titanium.Geolocation.Android.LocationProvider): void; + + /** + * Adds and enables the specified location rule. + */ + function addLocationRule(rule: Titanium.Geolocation.Android.LocationRule): void; + + /** + * Disables and removes the specified location rule. + */ + function removeLocationRule(rule: Titanium.Geolocation.Android.LocationRule): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getManualMode(): boolean; + + /** + * Sets the value of the property. + */ + function setManualMode(manualMode: boolean): void; + + /** + * Creates and returns an instance of . + */ + function createLocationProvider(parameters?: any): Titanium.Geolocation.Android.LocationProvider; + + /** + * Creates and returns an instance of . + */ + function createLocationRule(parameters?: any): Titanium.Geolocation.Android.LocationRule; + + /** + * Represents a source of location information, such as GPS. + */ + interface LocationProvider extends Titanium.Proxy { + /** + * Type of location provider: [PROVIDER_GPS](Titanium.Geolocation.PROVIDER_GPS), + * [PROVIDER_NETWORK](Titanium.Geolocation.PROVIDER_NETWORK), or + * [PROVIDER_PASSIVE](Titanium.Geolocation.PROVIDER_PASSIVE). + */ + name: string; + + /** + * Limits the frequency of location updates to no more than one per `minUpdateTime` seconds. + */ + minUpdateTime: number; + + /** + * Don't send a location update unless the location has changed at least `minUpdateDistance` + * meters since the previous update. + */ + minUpdateDistance: number; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Sets the value of the property. + */ + setName(name: string): void; + + /** + * Gets the value of the property. + */ + getMinUpdateTime(): number; + + /** + * Sets the value of the property. + */ + setMinUpdateTime(minUpdateTime: number): void; + + /** + * Gets the value of the property. + */ + getMinUpdateDistance(): number; + + /** + * Sets the value of the property. + */ + setMinUpdateDistance(minUpdateDistance: number): void; + + } + + /** + * A location rule to filter the results returned by location providers. + */ + interface LocationRule extends Titanium.Proxy { + /** + * If specified, this rule only applies to updates generated + * by the specified provider. If `null`, this rule applies to all updates. + */ + name: string; + + /** + * Minimum accuracy required for a location update. + */ + accuracy: number; + + /** + * Controls the frequency of location updates. + */ + minAge: number; + + /** + * Controls the freshness of location updates. Do not forward an update + * unless it is newer than `maxAge` milliseconds. + */ + maxAge: number; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Sets the value of the property. + */ + setName(name: string): void; + + /** + * Gets the value of the property. + */ + getAccuracy(): number; + + /** + * Sets the value of the property. + */ + setAccuracy(accuracy: number): void; + + /** + * Gets the value of the property. + */ + getMinAge(): number; + + /** + * Sets the value of the property. + */ + setMinAge(minAge: number): void; + + /** + * Gets the value of the property. + */ + getMaxAge(): number; + + /** + * Sets the value of the property. + */ + setMaxAge(maxAge: number): void; + + } + } } - export enum Accelerometer { + + /** + * The Gesture module is responsible for high-level device gestures such as orientation changes + * and shake gestures. + */ + namespace Gesture { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Indicates if the device is currently held in portrait form. + */ + const portrait: boolean; + + /** + * Indicates if the device is currently held in landscape form. + */ + const landscape: boolean; + + /** + * Orientation of the device. + */ + const orientation: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Returns whether or not the device is currently held in landscape form. + */ + function isLandscape(): boolean; + + /** + * Returns whether or not the device is currently held in portrait form. + */ + function isPortrait(): boolean; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getOrientation(): number; } - export interface Utils { - base64decode (obj: string) : Ti.Blob; - base64decode (obj: Ti.Blob) : Ti.Blob; - base64encode (obj: string) : Ti.Blob; - base64encode (obj: Ti.Blob) : Ti.Blob; - base64encode (obj: Ti.Filesystem.File) : Ti.Blob; - md5HexDigest (obj: string) : string; - md5HexDigest (obj: Ti.Blob) : string; - sha1 (obj: string) : string; - sha1 (obj: Ti.Blob) : string; - sha256 (obj: string) : string; - sha256 (obj: Ti.Blob) : string; + + /** + * The top level Locale module. + */ + namespace Locale { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Country of the current system locale, as an ISO 2-letter code. + */ + const currentCountry: string; + + /** + * Language of the current system locale, as an ISO 2-letter code. + */ + const currentLanguage: string; + + /** + * Current system locale, as a combination of ISO 2-letter language and country codes. + */ + const currentLocale: string; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Formats a telephone number according to the current system locale. + */ + function formatTelephoneNumber(number: string): string; + + /** + * Returns the ISO 3-letter currency code for the specified locale. + */ + function getCurrencyCode(locale: string): string; + + /** + * Returns the currency symbol for the specified currency code. + */ + function getCurrencySymbol(currencyCode: string): string; + + /** + * Sets the current language of the application. + */ + function setLanguage(language: string): void; + + /** + * Returns the currency symbol for the specified locale. + */ + function getLocaleCurrencySymbol(locale: string): string; + + /** + * Returns a string, localized according to the current system locale using the appropriate + * `/i18n/LANG/strings.xml` localization file. + */ + function getString(key: string, hint?: string): string; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getCurrentCountry(): string; + + /** + * Gets the value of the property. + */ + function getCurrentLanguage(): string; + + /** + * Gets the value of the property. + */ + function getCurrentLocale(): string; + } - export interface Event { - bubbles : boolean; - cancelBubble : boolean; - source : any; - type : string; + + /** + * The top level Map module. The Map module is used for creating in-application native maps. + */ + namespace Map { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Used in the [pinchangedragstate](Titanium.Map.View.pinchangedragstate) event + * to indicate that the annotation is not being dragged. + */ + const ANNOTATION_DRAG_STATE_NONE: number; + + /** + * Used in the [pinchangedragstate](Titanium.Map.View.pinchangedragstate) event + * to indicate that the user started dragging the annotation. + */ + const ANNOTATION_DRAG_STATE_START: number; + + /** + * Used in the [pinchangedragstate](Titanium.Map.View.pinchangedragstate) event + * to indicate that the user moved the annotation. + */ + const ANNOTATION_DRAG_STATE_DRAG: number; + + /** + * Used in the [pinchangedragstate](Titanium.Map.View.pinchangedragstate) event + * to indicate that the user canceled the drag action. + */ + const ANNOTATION_DRAG_STATE_CANCEL: number; + + /** + * Used in the [pinchangedragstate](Titanium.Map.View.pinchangedragstate) event + * to indicate that the user finished moving the annotation. + */ + const ANNOTATION_DRAG_STATE_END: number; + + /** + * Color constant used to set a map annotation to green via the + * property. + */ + const ANNOTATION_GREEN: number; + + /** + * Color constant used to set a map annotation to purple via the + * property. + */ + const ANNOTATION_PURPLE: number; + + /** + * Color constant used to set a map annotation to red via the + * property. + */ + const ANNOTATION_RED: number; + + /** + * Used with [mapType](Titanium.Map.View.mapType) to display a satellite image of the area with road and road name information layered on top. + */ + const HYBRID_TYPE: number; + + /** + * Used with [mapType](Titanium.Map.View.mapType) to display satellite imagery of the area. + */ + const SATELLITE_TYPE: number; + + /** + * Used with [mapType](Titanium.Map.View.mapType) to display a street map that shows the position of all roads and some road names. + */ + const STANDARD_TYPE: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Creates and returns an instance of . + */ + function createAnnotation(parameters?: any): Titanium.Map.Annotation; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Creates and returns an instance of . + */ + function createView(parameters?: any): Titanium.Map.View; + + /** + * Represents a labeled point of interest on the map that the user can click on. + */ + interface Annotation extends Titanium.Proxy { + /** + * Boolean to indicate whether the pin should animate when dropped. + */ + animate: boolean; + + /** + * Defines whether the annotation view is able to display extra information in a callout bubble. + */ + canShowCallout: boolean; + + /** + * Defines a center offset point for the annotation. + */ + centerOffset: Point; + + /** + * Defines a custom view to be used by the annotation. + */ + customView: Titanium.UI.View; + + /** + * Determines whether the pin can be dragged by the user. + */ + draggable: boolean; + + /** + * Image to use for the the pin. + */ + image: string | Titanium.Blob; + + /** + * Latitude of the annotation, in decimal degrees. + */ + latitude: number; + + /** + * Longitude of the annotation, in decimal degrees. + */ + longitude: number; + + /** + * Left button image on the annotation, specified as an image URL or an iOS + * button constant. + */ + leftButton: number | string; + + /** + * Left view that is displayed on the annotation. + */ + leftView: Titanium.UI.View; + + /** + * Image for the pin instead of the default image. + */ + pinImage: string; + + /** + * Pin color. Specify one of: , + * or . + */ + pincolor: number; + + /** + * Right button image on the annotation, specified as an image URL or an iOS + * button constant. + */ + rightButton: number | string; + + /** + * Right view that is displayed on the annotation. + */ + rightView: Titanium.UI.View; + + /** + * Secondary title of the annotation view. + */ + subtitle: string; + + /** + * Key in the locale file to use for the subtitle property. + */ + subtitleid: string; + + /** + * Primary title of the annotation view. + */ + title: string; + + /** + * Key in the locale file to use for the title property. + */ + titleid: string; + + /** + * Gets the value of the property. + */ + getAnimate(): boolean; + + /** + * Sets the value of the property. + */ + setAnimate(animate: boolean): void; + + /** + * Gets the value of the property. + */ + getCanShowCallout(): boolean; + + /** + * Sets the value of the property. + */ + setCanShowCallout(canShowCallout: boolean): void; + + /** + * Gets the value of the property. + */ + getCenterOffset(): Point; + + /** + * Sets the value of the property. + */ + setCenterOffset(centerOffset: Point): void; + + /** + * Gets the value of the property. + */ + getCustomView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setCustomView(customView: any): void; + + /** + * Gets the value of the property. + */ + getDraggable(): boolean; + + /** + * Sets the value of the property. + */ + setDraggable(draggable: boolean): void; + + /** + * Gets the value of the property. + */ + getImage(): string | Titanium.Blob; + + /** + * Sets the value of the property. + */ + setImage(image: string): void; + + /** + * Sets the value of the property. + */ + setImage(image: Titanium.Blob): void; + + /** + * Gets the value of the property. + */ + getLatitude(): number; + + /** + * Sets the value of the property. + */ + setLatitude(latitude: number): void; + + /** + * Gets the value of the property. + */ + getLongitude(): number; + + /** + * Sets the value of the property. + */ + setLongitude(longitude: number): void; + + /** + * Gets the value of the property. + */ + getLeftButton(): number | string; + + /** + * Sets the value of the property. + */ + setLeftButton(leftButton: number): void; + + /** + * Sets the value of the property. + */ + setLeftButton(leftButton: string): void; + + /** + * Gets the value of the property. + */ + getLeftView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setLeftView(leftView: any): void; + + /** + * Gets the value of the property. + */ + getPinImage(): string; + + /** + * Sets the value of the property. + */ + setPinImage(pinImage: string): void; + + /** + * Gets the value of the property. + */ + getPincolor(): number; + + /** + * Sets the value of the property. + */ + setPincolor(pincolor: number): void; + + /** + * Gets the value of the property. + */ + getRightButton(): number | string; + + /** + * Sets the value of the property. + */ + setRightButton(rightButton: number): void; + + /** + * Sets the value of the property. + */ + setRightButton(rightButton: string): void; + + /** + * Gets the value of the property. + */ + getRightView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setRightView(rightView: any): void; + + /** + * Gets the value of the property. + */ + getSubtitle(): string; + + /** + * Sets the value of the property. + */ + setSubtitle(subtitle: string): void; + + /** + * Gets the value of the property. + */ + getSubtitleid(): string; + + /** + * Sets the value of the property. + */ + setSubtitleid(subtitleid: string): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleid(): string; + + /** + * Sets the value of the property. + */ + setTitleid(titleid: string): void; + + } + + /** + * Map view is used for embedding native mapping capabilities as a view in your application. + */ + interface View extends Titanium.UI.View { + /** + * An array of annotations to add to the map. + */ + annotations: Titanium.Map.Annotation[]; + + /** + * Hide the annotation when clicking in the map view outside of the annotation. + */ + hideAnnotationWhenTouchMap: boolean; + + /** + * Map type, either: , or . + */ + mapType: number; + + /** + * A dictionary specifying the location and zoom level of the map. + * On the iOS platform, this property can only be set after the map view is loaded. + * To ensure this property is set when the application starts, wait for the + * [complete][Titanium.UI.Map-event-complete] event. + */ + region: MapRegionType; + + /** + * Boolean indicating if the map region should be modified + * to fit the map view's aspect ratio. + */ + regionFit: boolean; + + /** + * Boolean indicating if the user's current device location should be shown on the + * map. + */ + userLocation: boolean; + + /** + * The amount of north-to-south distance displayed on the map, measured in decimal degrees. + */ + readonly latitudeDelta: number; + + /** + * The amount of east-to-west distance displayed on the map, measured in decimal degrees. + */ + readonly longitudeDelta: number; + + /** + * Adds a new annotation to the map. + */ + addAnnotation(annotation: any): void; + + /** + * Adds one or more new annotations to the map. + */ + addAnnotations(annotations: any): void; + + /** + * Adds a route to the map. + */ + addRoute(route: MapRouteType): void; + + /** + * Deselects the specified annotation, so the main annotation is hidden and only + * a pin image is shown. + */ + deselectAnnotation(annotation: string): void; + + /** + * Deselects the specified annotation, so the main annotation is hidden and only + * a pin image is shown. + */ + deselectAnnotation(annotation: Titanium.Map.Annotation): void; + + /** + * Removes all annotations from the map. + */ + removeAllAnnotations(): void; + + /** + * Removes an existing annotation from the map. + */ + removeAnnotation(annotation: string): void; + + /** + * Removes an existing annotation from the map. + */ + removeAnnotation(annotation: Titanium.Map.Annotation): void; + + /** + * Removes one or more existing annotations from the map. + */ + removeAnnotations(annotations: ReadonlyArray): void; + + /** + * Removes one or more existing annotations from the map. + */ + removeAnnotations(annotations: ReadonlyArray): void; + + /** + * Remove a previously added route. + */ + removeRoute(route: MapRouteType): void; + + /** + * Selects the annoation, showing the full annotation. + */ + selectAnnotation(annotation: string): void; + + /** + * Selects the annoation, showing the full annotation. + */ + selectAnnotation(annotation: Titanium.Map.Annotation): void; + + /** + * Sets the map location and zoom level. + */ + setLocation(location: MapLocationType): void; + + /** + * Sets the type of map (satellite, hybrid, or standard). + */ + setMapType(mapType: number): void; + + /** + * Zooms in or out of the map. + */ + zoom(level: number): void; + + /** + * Gets the value of the property. + */ + getAnimate(): boolean; + + /** + * Sets the value of the property. + */ + setAnimate(animate: boolean): void; + + /** + * Gets the value of the property. + */ + getAnnotations(): Titanium.Map.Annotation[]; + + /** + * Sets the value of the property. + */ + setAnnotations(annotations: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getHideAnnotationWhenTouchMap(): boolean; + + /** + * Sets the value of the property. + */ + setHideAnnotationWhenTouchMap(hideAnnotationWhenTouchMap: boolean): void; + + /** + * Gets the value of the property. + */ + getMapType(): number; + + /** + * Sets the value of the property. + */ + setMapType(mapType: number): void; + + /** + * Gets the value of the property. + */ + getRegion(): MapRegionType; + + /** + * Sets the value of the property. + */ + setRegion(region: MapRegionType): void; + + /** + * Gets the value of the property. + */ + getRegionFit(): boolean; + + /** + * Sets the value of the property. + */ + setRegionFit(regionFit: boolean): void; + + /** + * Gets the value of the property. + */ + getUserLocation(): boolean; + + /** + * Sets the value of the property. + */ + setUserLocation(userLocation: boolean): void; + + /** + * Gets the value of the property. + */ + getLatitudeDelta(): number; + + /** + * Gets the value of the property. + */ + getLongitudeDelta(): number; + + } + } - export interface Stream { - MODE_APPEND : number; - MODE_READ : number; - MODE_WRITE : number; - createStream (params: CreateStreamArgs) : Ti.IOStream; - pump (inputStream: Ti.IOStream, handler: (...args : any[]) => any, maxChunkSize: number, isAsync?: boolean) : void; - read (sourceStream: Ti.IOStream, buffer: Ti.Buffer, offset?: number, length?: number, resultsCallback?: (...args : any[]) => any) : void; - readAll (sourceStream: Ti.IOStream, buffer?: Ti.Buffer, resultsCallback?: (...args : any[]) => any) : any; - write (outputStream: Ti.IOStream, buffer: Ti.Buffer, offset?: number, length?: number, resultsCallback?: (...args : any[]) => any) : void; - writeStream (inputStream: Ti.IOStream, outputStream: Ti.IOStream, maxChunkSize: number, resultsCallback?: (...args : any[]) => any) : void; + + /** + * The top-level Media module. + */ + namespace Media { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Audio file format 3GPP2. + */ + const AUDIO_FILEFORMAT_3GP2: number; + + /** + * Audio file format 3GPP. + */ + const AUDIO_FILEFORMAT_3GPP: number; + + /** + * Audio file format Audio Interchange File Format (AIFF). + */ + const AUDIO_FILEFORMAT_AIFF: number; + + /** + * Audio file format Adaptive Multi-Rate (AMR). + */ + const AUDIO_FILEFORMAT_AMR: number; + + /** + * Audio file format Apple Compressed Audio Format (CAF). + */ + const AUDIO_FILEFORMAT_CAF: number; + + /** + * Audio file format MP3. + */ + const AUDIO_FILEFORMAT_MP3: number; + + /** + * Audio file format MP4. + */ + const AUDIO_FILEFORMAT_MP4: number; + + /** + * Audio file format MP4A. + */ + const AUDIO_FILEFORMAT_MP4A: number; + + /** + * Audio file format WAVE. + */ + const AUDIO_FILEFORMAT_WAVE: number; + + /** + * Audio format MPEG4 AAC encoding. + */ + const AUDIO_FORMAT_AAC: number; + + /** + * Audio format 8-bit aLaw encoding. + */ + const AUDIO_FORMAT_ALAW: number; + + /** + * Audio format Apple lossless encoding. + */ + const AUDIO_FORMAT_APPLE_LOSSLESS: number; + + /** + * Audio format iLBC encoding. + */ + const AUDIO_FORMAT_ILBC: number; + + /** + * Audio format Apple IMA4 encoding. + */ + const AUDIO_FORMAT_IMA4: number; + + /** + * Audio format 16-bit, linear PCM encoding. + */ + const AUDIO_FORMAT_LINEAR_PCM: number; + + /** + * Audio format 8-bit muLaw encoding. + */ + const AUDIO_FORMAT_ULAW: number; + + /** + * Line-type constant for headphones. + */ + const AUDIO_HEADPHONES: number; + + /** + * Line-type constant for headphones and microphone. + */ + const AUDIO_HEADPHONES_AND_MIC: number; + + /** + * Line-type constant for headset in/out. + */ + const AUDIO_HEADSET_INOUT: number; + + /** + * Line-type constant for line-out. + */ + const AUDIO_LINEOUT: number; + + /** + * Line-type constant for microphone. + */ + const AUDIO_MICROPHONE: number; + + /** + * Line-type constant indicated mute switch is on. + */ + const AUDIO_MUTED: number; + + /** + * Line-type constant indicating receiver and microphone. + */ + const AUDIO_RECEIVER_AND_MIC: number; + + /** + * For long-duration sounds such as rain, car engine noise, and so on. + */ + const AUDIO_SESSION_CATEGORY_AMBIENT: string; + + /** + * Session mode for playing recorded music or other sounds that are central to the successful use of your application. + */ + const AUDIO_SESSION_CATEGORY_PLAYBACK: string; + + /** + * Session mode for recording (input) and playback (output) of audio, such as for a VOIP (voice over IP) application. + */ + const AUDIO_SESSION_CATEGORY_PLAY_AND_RECORD: string; + + /** + * Session mode for recording audio; it silences playback audio. + */ + const AUDIO_SESSION_CATEGORY_RECORD: string; + + /** + * Session mode for long-duration sounds such as rain, car engine noise, and so on. + */ + const AUDIO_SESSION_CATEGORY_SOLO_AMBIENT: string; + + /** + * For long-duration sounds such as rain, car engine noise, and so on. + */ + const AUDIO_SESSION_MODE_AMBIENT: number; + + /** + * Session mode for playing recorded music or other sounds that are central to the successful use of your application. + */ + const AUDIO_SESSION_MODE_PLAYBACK: number; + + /** + * Session mode for recording (input) and playback (output) of audio, such as for a VOIP (voice over IP) application. + */ + const AUDIO_SESSION_MODE_PLAY_AND_RECORD: number; + + /** + * Session mode for recording audio; it silences playback audio. + */ + const AUDIO_SESSION_MODE_RECORD: number; + + /** + * Session mode for long-duration sounds such as rain, car engine noise, and so on. + */ + const AUDIO_SESSION_MODE_SOLO_AMBIENT: number; + + /** + * Constant that specifies audio should output to the default audio route. See for more information. + */ + const AUDIO_SESSION_OVERRIDE_ROUTE_NONE: number; + + /** + * Constant that specifies audio should output to the speaker. See for more information. + */ + const AUDIO_SESSION_OVERRIDE_ROUTE_SPEAKER: number; + + /** + * Constant for line level input on a dock connector. This is an input port. + */ + const AUDIO_SESSION_PORT_LINEIN: string; + + /** + * Constant for built-in microphone on an iOS device. This is an input port. + */ + const AUDIO_SESSION_PORT_BUILTINMIC: string; + + /** + * Constant for microphone on a wired headset. This is an input port. + */ + const AUDIO_SESSION_PORT_HEADSETMIC: string; + + /** + * Constant for line level output on a dock connector. This is an output port. + */ + const AUDIO_SESSION_PORT_LINEOUT: string; + + /** + * Constant for headphone or headset output. This is an output port. + */ + const AUDIO_SESSION_PORT_HEADPHONES: string; + + /** + * Constant for output on a Bluetooth A2DP device. This is an output port. + */ + const AUDIO_SESSION_PORT_BLUETOOTHA2DP: string; + + /** + * Constant for the speaker you hold to your ear when on a phone call. This is an output port. + */ + const AUDIO_SESSION_PORT_BUILTINRECEIVER: string; + + /** + * Constant for built-in speaker on an iOS device. This is an output port. + */ + const AUDIO_SESSION_PORT_BUILTINSPEAKER: string; + + /** + * Constant for output via High-Definition Multimedia Interface. This is an output port + */ + const AUDIO_SESSION_PORT_HDMI: string; + + /** + * Constant for output on a remote Air Play device. This is an output port. + */ + const AUDIO_SESSION_PORT_AIRPLAY: string; + + /** + * Constant for input or output on a Bluetooth Hands-Free Profile device. This can be both an input and output port. + */ + const AUDIO_SESSION_PORT_BLUETOOTHHFP: string; + + /** + * Constant for input or output on a Universal Serial Bus device. This can be both an input and output port. + */ + const AUDIO_SESSION_PORT_USBAUDIO: string; + + /** + * Constant for output on a Bluetooth Low Energy device. This is an output port. This is available on iOS7 and later. + */ + const AUDIO_SESSION_PORT_BLUETOOTHLE: string; + + /** + * Constant for Input or output via Car Audio. This can be both an input and output port. This is available on iOS7 and later. + */ + const AUDIO_SESSION_PORT_CARAUDIO: string; + + /** + * Line-type constant for speaker output. + */ + const AUDIO_SPEAKER: number; + + /** + * Line-type constant indicating that audio is unavailable. + */ + const AUDIO_UNAVAILABLE: number; + + /** + * Line-type constant indicating that line-type is unknown or not determined. + */ + const AUDIO_UNKNOWN: number; + + /** + * Constant specifying to have the device determine to use the flash or not. + */ + const CAMERA_FLASH_AUTO: number; + + /** + * Constant specifying to never fire the flash. + */ + const CAMERA_FLASH_OFF: number; + + /** + * Constant specifying to always fire the flash. + */ + const CAMERA_FLASH_ON: number; + + /** + * Constant specifying the front camera. + */ + const CAMERA_FRONT: number; + + /** + * Constant indicating the rear camera. + */ + const CAMERA_REAR: number; + + /** + * Constant specifying that app is authorized to use camera. This is available on iOS7 and later. + */ + const CAMERA_AUTHORIZATION_AUTHORIZED: number; + + /** + * Constant specifying that app is denied usage of camera. This is available on iOS7 and later. + */ + const CAMERA_AUTHORIZATION_DENIED: number; + + /** + * Constant specifying that app is restricted from using camera. This is available on iOS7 and later. + */ + const CAMERA_AUTHORIZATION_RESTRICTED: number; + + /** + * Constant specifying that app is not yet authorized to use camera. This is available on iOS7 and later. + */ + const CAMERA_AUTHORIZATION_NOT_DETERMINED: number; + + /** + * Constant specifying that app is not yet authorized to use camera. This is available on iOS7 and later. + */ + const CAMERA_AUTHORIZATION_UNKNOWN: number; + + /** + * Constant for media device busy error. + */ + const DEVICE_BUSY: number; + + /** + * Media type constant for photo media. + */ + const MEDIA_TYPE_PHOTO: string; + + /** + * Media type constant for live photo media. + */ + const MEDIA_TYPE_LIVEPHOTO: string; + + /** + * Media type constant for video media. + */ + const MEDIA_TYPE_VIDEO: string; + + /** + * Music library media containing any type of content. + */ + const MUSIC_MEDIA_TYPE_ALL: number; + + /** + * Music library media containing any type of audio content. + */ + const MUSIC_MEDIA_TYPE_ANY_AUDIO: number; + + /** + * Music library media containing audiobook content. + */ + const MUSIC_MEDIA_TYPE_AUDIOBOOK: number; + + /** + * Music library media containing music content. + */ + const MUSIC_MEDIA_TYPE_MUSIC: number; + + /** + * Music library media containing podcast content. + */ + const MUSIC_MEDIA_TYPE_PODCAST: number; + + /** + * Constant for grouping query results by title. + */ + const MUSIC_MEDIA_GROUP_TITLE: number; + + /** + * Constant for grouping query results by album. + */ + const MUSIC_MEDIA_GROUP_ALBUM: number; + + /** + * Constant for grouping query results by artist. + */ + const MUSIC_MEDIA_GROUP_ARTIST: number; + + /** + * Constant for grouping query results by album and artist. + */ + const MUSIC_MEDIA_GROUP_ALBUM_ARTIST: number; + + /** + * Constant for grouping query results by composer. + */ + const MUSIC_MEDIA_GROUP_COMPOSER: number; + + /** + * Constant for grouping query results by genre. + */ + const MUSIC_MEDIA_GROUP_GENRE: number; + + /** + * Constant for grouping query results by playlist. + */ + const MUSIC_MEDIA_GROUP_PLAYLIST: number; + + /** + * Constant for grouping query results by podcast title. + */ + const MUSIC_MEDIA_GROUP_PODCAST_TITLE: number; + + /** + * Constant for "Repeat All" setting. + */ + const MUSIC_PLAYER_REPEAT_ALL: number; + + /** + * Constant for user's default repeat setting. + */ + const MUSIC_PLAYER_REPEAT_DEFAULT: number; + + /** + * Constant for "No Repeat" setting. + */ + const MUSIC_PLAYER_REPEAT_NONE: number; + + /** + * Constant for "Repeat one item" setting. + */ + const MUSIC_PLAYER_REPEAT_ONE: number; + + /** + * Constant for shuffling complete albums setting. + */ + const MUSIC_PLAYER_SHUFFLE_ALBUMS: number; + + /** + * Constant for user's default shuffle setting. + */ + const MUSIC_PLAYER_SHUFFLE_DEFAULT: number; + + /** + * Constant for "no shuffle" setting. + */ + const MUSIC_PLAYER_SHUFFLE_NONE: number; + + /** + * Constant for shuffling songs setting. + */ + const MUSIC_PLAYER_SHUFFLE_SONGS: number; + + /** + * Constant for interrupted state. + */ + const MUSIC_PLAYER_STATE_INTERRUPTED: number; + + /** + * Constant for paused state. + */ + const MUSIC_PLAYER_STATE_PAUSED: number; + + /** + * Constant for playing state. + */ + const MUSIC_PLAYER_STATE_PLAYING: number; + + /** + * Constant for backward seek state. + */ + const MUSIC_PLAYER_STATE_SEEK_BACKWARD: number; + + /** + * Constant for forward seek state. + */ + const MUSIC_PLAYER_STATE_SEEK_FORWARD: number; + + /** + * Constant for stopped state. + */ + const MUSIC_PLAYER_STATE_STOPPED: number; + + /** + * Constant for media no camera error. + */ + const NO_CAMERA: number; + + /** + * Constant for media no video error. + */ + const NO_VIDEO: number; + + /** + * Media type constant for high-quality video recording. + */ + const QUALITY_HIGH: number; + + /** + * Media type constant for low-quality video recording. + */ + const QUALITY_LOW: number; + + /** + * Media type constant for medium-quality video recording. + */ + const QUALITY_MEDIUM: number; + + /** + * Media type constant for medium-quality video recording. + */ + const QUALITY_640x480: number; + + /** + * Media type constant for medium-quality video recording. + */ + const QUALITY_IFRAME_1280x720: number; + + /** + * Media type constant for medium-quality video recording. + */ + const QUALITY_IFRAME_960x540: number; + + /** + * Constant for unknown media error. + */ + const UNKNOWN_ERROR: number; + + /** + * Constant for default video controls. + */ + const VIDEO_CONTROL_DEFAULT: number; + + /** + * Constant for video controls for an embedded view. + */ + const VIDEO_CONTROL_EMBEDDED: number; + + /** + * Constant for fullscreen video controls. + */ + const VIDEO_CONTROL_FULLSCREEN: number; + + /** + * Constant for video controls hidden. + */ + const VIDEO_CONTROL_HIDDEN: number; + + /** + * Constant for no video controls. + */ + const VIDEO_CONTROL_NONE: number; + + /** + * Constant for video controls volume only. + */ + const VIDEO_CONTROL_VOLUME_ONLY: number; + + /** + * Video playback ended normally. + */ + const VIDEO_FINISH_REASON_PLAYBACK_ENDED: number; + + /** + * Video playback ended abnormally. + */ + const VIDEO_FINISH_REASON_PLAYBACK_ERROR: number; + + /** + * Video playback ended by user action (such as clicking the `Done` button). + */ + const VIDEO_FINISH_REASON_USER_EXITED: number; + + /** + * Indicates that the player can no longer play media items because of an error. + */ + const VIDEO_LOAD_STATE_FAILED: number; + + /** + * Current media is playable. + */ + const VIDEO_LOAD_STATE_PLAYABLE: number; + + /** + * Playback will be automatically started in this state when `autoplay` is true. + */ + const VIDEO_LOAD_STATE_PLAYTHROUGH_OK: number; + + /** + * Playback will be automatically paused in this state, if started. + */ + const VIDEO_LOAD_STATE_STALLED: number; + + /** + * Current load state is not known. + */ + const VIDEO_LOAD_STATE_UNKNOWN: number; + + /** + * A audio type of media in the movie returned by `mediaTypes` property. + */ + const VIDEO_MEDIA_TYPE_AUDIO: number; + + /** + * An unknown type of media in the movie returned by `mediaTypes` property. + */ + const VIDEO_MEDIA_TYPE_NONE: number; + + /** + * A video type of media in the movie returned by `mediaTypes` property. + */ + const VIDEO_MEDIA_TYPE_VIDEO: number; + + /** + * Video playback has been interrupted. + */ + const VIDEO_PLAYBACK_STATE_INTERRUPTED: number; + + /** + * Video playback is paused. + */ + const VIDEO_PLAYBACK_STATE_PAUSED: number; + + /** + * Video is being played. + */ + const VIDEO_PLAYBACK_STATE_PLAYING: number; + + /** + * Video playback is rewinding. + */ + const VIDEO_PLAYBACK_STATE_SEEKING_BACKWARD: number; + + /** + * Video playback is seeking forward. + */ + const VIDEO_PLAYBACK_STATE_SEEKING_FORWARD: number; + + /** + * Video playback is stopped. + */ + const VIDEO_PLAYBACK_STATE_STOPPED: number; + + /** + * Constant for disabling repeat on video playback. + */ + const VIDEO_REPEAT_MODE_NONE: number; + + /** + * Constant for repeating one video (i.e., the one video will repeat constantly) during playback. + */ + const VIDEO_REPEAT_MODE_ONE: number; + + /** + * Scale video to fill the screen, clipping edges if necessary. + */ + const VIDEO_SCALING_ASPECT_FILL: number; + + /** + * Scale video to fit the screen, letterboxing if necessary. + */ + const VIDEO_SCALING_ASPECT_FIT: number; + + /** + * Video is scaled until both dimensions fit the screen exactly, stretching if necessary. + */ + const VIDEO_SCALING_MODE_FILL: number; + + /** + * Video scaling is disabled. + */ + const VIDEO_SCALING_NONE: number; + + /** + * Specifies that the video should be stretched to fill the bounds of layer. + */ + const VIDEO_SCALING_RESIZE: string; + + /** + * Specifies that the player should preserve the aspect ratio of video and fit the video within the bounds of layer. + */ + const VIDEO_SCALING_RESIZE_ASPECT: string; + + /** + * Specifies that the player should preserve the aspect ratio of video and fill the bounds of layer. + */ + const VIDEO_SCALING_RESIZE_ASPECT_FILL: string; + + /** + * Video source type is a file. + */ + const VIDEO_SOURCE_TYPE_FILE: number; + + /** + * Video source type is a remote stream. + */ + const VIDEO_SOURCE_TYPE_STREAMING: number; + + /** + * Video source type is unknown. + */ + const VIDEO_SOURCE_TYPE_UNKNOWN: number; + + /** + * Use the exact time. + */ + const VIDEO_TIME_OPTION_EXACT: number; + + /** + * Use the closest keyframe in the time. + */ + const VIDEO_TIME_OPTION_NEAREST_KEYFRAME: number; + + /** + * Use the closest sync (or key) frame at given the time. + */ + const VIDEO_TIME_OPTION_CLOSEST_SYNC: number; + + /** + * Use the sync (or key) frame located right after or at given the time. + */ + const VIDEO_TIME_OPTION_NEXT_SYNC: number; + + /** + * Use the sync (or key) frame located right before or at given the time. + */ + const VIDEO_TIME_OPTION_PREVIOUS_SYNC: number; + + /** + * An instance of representing the app-specific music player. + */ + const appMusicPlayer: Titanium.Media.MusicPlayer; + + /** + * Returns the line type constant for the current line type. + */ + const audioLineType: number; + + /** + * Returns `true` if the device is playing audio. + */ + const audioPlaying: boolean; + + /** + * A constant for the audio session category to be used. + */ + let audioSessionCategory: number; + + /** + * A constant for the audio session mode to be used. + */ + let audioSessionMode: number; + + /** + * Array indicating which cameras are available, `CAMERA_FRONT`, `CAMERA_REAR` or both. + */ + const availableCameras: number[]; + + /** + * Array of media type constants supported for the camera. + */ + let availableCameraMediaTypes: any[]; + + /** + * Array of media type constants supported for saving to the device's camera roll or saved images album. + */ + let availablePhotoGalleryMediaTypes: any[]; + + /** + * Array of media type constants supported for the photo library. + */ + let availablePhotoMediaTypes: any[]; + + /** + * Current average microphone level in dB or -1 if microphone monitoring is disabled. + */ + let averageMicrophonePower: number; + + /** + * Determines how the flash is fired when using the device's camera. + */ + let cameraFlashMode: number; + + /** + * `true` if the device has a recording input device available. + */ + const canRecord: boolean; + + /** + * Returns a description of the current route, consisting of zero or more input ports and zero or more output ports. + */ + const currentRoute: RouteDescription; + + /** + * `true` if the device has camera support. + */ + const isCameraSupported: boolean; + + /** + * Returns the authorization status for the camera. + */ + const cameraAuthorizationStatus: number; + + /** + * Returns the authorization status for the camera. + */ + const cameraAuthorization: number; + + /** + * Current microphone level peak power in dB or -1 if microphone monitoring is disabled. + */ + const peakMicrophonePower: number; + + /** + * An instance of representing the system-wide music player. + */ + const systemMusicPlayer: Titanium.Media.MusicPlayer; + + /** + * Current volume of the playback device. + */ + const volume: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Plays a device beep notification. + */ + function beep(): void; + + /** + * Hides the device camera UI. + */ + function hideCamera(): void; + + /** + * Hides the music library. + */ + function hideMusicLibrary(): void; + + /** + * Returns `true` if the source supports the specified media type. + */ + function isMediaTypeSupported(source: string, type: string): boolean; + + /** + * Shows the music library and allows the user to select one or more tracks. + */ + function openMusicLibrary(options: MusicLibraryOptionsType): void; + + /** + * Opens the photo gallery image picker. + */ + function openPhotoGallery(options: PhotoGalleryOptionsType): void; + + /** + * Displays the given image. + */ + function previewImage(options: any): void; + + /** + * Saves media to the device's photo gallery / camera roll. + */ + function saveToPhotoGallery(media: Titanium.Blob, callbacks: any): void; + + /** + * Saves media to the device's photo gallery / camera roll. + */ + function saveToPhotoGallery(media: Titanium.Filesystem.File, callbacks: any): void; + + /** + * Overrides the default audio route when using the session mode. + */ + function setOverrideAudioRoute(route: number): void; + + /** + * Shows the camera. + */ + function showCamera(options: CameraOptionsType): void; + + /** + * Returns `true` if the app has camera access. + */ + function hasMusicLibraryPermissions(): boolean; + + /** + * Request permissions for the native music-library. + */ + function requestMusicLibraryPermissions(callback: (param0: RequestMusicLibraryAccessResult) => any): void; + + /** + * Searches the music library for items matching the specified search predicates. + */ + function queryMusicLibrary(query: MediaQueryType): Titanium.Media.Item[]; + + /** + * Starts monitoring the microphone sound level. + */ + function startMicrophoneMonitor(): void; + + /** + * Stops monitoring the microphone sound level. + */ + function stopMicrophoneMonitor(): void; + + /** + * Uses the device camera to capture a photo. + */ + function takePicture(): void; + + /** + * Starts video capture using the camera specified. + */ + function startVideoCapture(): void; + + /** + * Stops video capture using the camera specified. + */ + function stopVideoCapture(): void; + + /** + * Switches between front and rear-facing cameras. Make sure to set one of the below constants to determine + * the camera you want to switch to. + */ + function switchCamera(camera: number): void; + + /** + * Returns `true` if the app has camera access. + */ + function hasCameraPermissions(): boolean; + + /** + * Requests for camera access. + */ + function requestCameraPermissions(callback: (param0: RequestCameraAccessResult) => any): void; + + /** + * Returns `true` if the app has photo gallery permissions. + */ + function hasPhotoGalleryPermissions(): boolean; + + /** + * Requests for photo gallery permissions. + */ + function requestPhotoGalleryPermissions(callback: (param0: RequestPhotoGalleryAccessResult) => any): void; + + /** + * Requests for camera access. + */ + function requestCameraAccess(callback: (param0: RequestCameraAccessResult) => any): void; + + /** + * Takes a screen shot of the visible UI on the device. + */ + function takeScreenshot(callback: (param0: ScreenshotResult) => any): void; + + /** + * Makes the device vibrate. + */ + function vibrate(pattern?: ReadonlyArray): void; + + /** + * Request the user's permission for audio recording. + */ + function requestAuthorization(callback: (param0: MediaAuthorizationResponse) => any): void; + + /** + * Returns `true` if the app has audio permissions. + */ + function hasAudioPermissions(): boolean; + + /** + * Returns `true` if the app has audio permissions. + */ + function hasAudioRecorderPermissions(): boolean; + + /** + * Request the user's permission for audio recording. + */ + function requestAudioPermissions(callback: (param0: MediaAuthorizationResponse) => any): void; + + /** + * Request the user's permission for audio recording. + */ + function requestAudioRecorderPermissions(callback: (param0: MediaAuthorizationResponse) => any): void; + + /** + * Creates and returns an instance of . + */ + function createAudioPlayer(parameters?: any): Titanium.Media.AudioPlayer; + + /** + * Creates and returns an instance of . + */ + function createAudioRecorder(parameters?: any): Titanium.Media.AudioRecorder; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getQUALITY_640x480(): number; + + /** + * Gets the value of the property. + */ + function getQUALITY_IFRAME_1280x720(): number; + + /** + * Gets the value of the property. + */ + function getQUALITY_IFRAME_960x540(): number; + + /** + * Gets the value of the property. + */ + function getAppMusicPlayer(): Titanium.Media.MusicPlayer; + + /** + * Gets the value of the property. + */ + function getAudioLineType(): number; + + /** + * Gets the value of the property. + */ + function getAudioPlaying(): boolean; + + /** + * Gets the value of the property. + */ + function getAudioSessionCategory(): number; + + /** + * Sets the value of the property. + */ + function setAudioSessionCategory(audioSessionCategory: number): void; + + /** + * Gets the value of the property. + */ + function getAudioSessionMode(): number; + + /** + * Sets the value of the property. + */ + function setAudioSessionMode(audioSessionMode: number): void; + + /** + * Gets the value of the property. + */ + function getAvailableCameras(): number[]; + + /** + * Gets the value of the property. + */ + function getAvailableCameraMediaTypes(): any[]; + + /** + * Sets the value of the property. + */ + function setAvailableCameraMediaTypes(availableCameraMediaTypes: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + function getAvailablePhotoGalleryMediaTypes(): any[]; + + /** + * Sets the value of the property. + */ + function setAvailablePhotoGalleryMediaTypes(availablePhotoGalleryMediaTypes: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + function getAvailablePhotoMediaTypes(): any[]; + + /** + * Sets the value of the property. + */ + function setAvailablePhotoMediaTypes(availablePhotoMediaTypes: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + function getAverageMicrophonePower(): number; + + /** + * Sets the value of the property. + */ + function setAverageMicrophonePower(averageMicrophonePower: number): void; + + /** + * Gets the value of the property. + */ + function getCameraFlashMode(): number; + + /** + * Sets the value of the property. + */ + function setCameraFlashMode(cameraFlashMode: number): void; + + /** + * Gets the value of the property. + */ + function getCanRecord(): boolean; + + /** + * Gets the value of the property. + */ + function getCurrentRoute(): RouteDescription; + + /** + * Gets the value of the property. + */ + function getIsCameraSupported(): boolean; + + /** + * Gets the value of the property. + */ + function getCameraAuthorizationStatus(): number; + + /** + * Gets the value of the property. + */ + function getCameraAuthorization(): number; + + /** + * Gets the value of the property. + */ + function getPeakMicrophonePower(): number; + + /** + * Gets the value of the property. + */ + function getSystemMusicPlayer(): Titanium.Media.MusicPlayer; + + /** + * Gets the value of the property. + */ + function getVolume(): number; + + /** + * Creates and returns an instance of . + */ + function createSound(parameters?: any): Titanium.Media.Sound; + + /** + * Creates and returns an instance of . + */ + function createSystemAlert(parameters?: any): Titanium.Media.SystemAlert; + + /** + * Creates and returns an instance of . + */ + function createVideoPlayer(parameters?: any): Titanium.Media.VideoPlayer; + + /** + * An audio player object used for streaming audio to the device, and low-level control of the audio playback. + */ + interface AudioPlayer extends Titanium.Proxy { + /** + * Audio data is being buffered from the network. + */ + readonly STATE_BUFFERING: number; + + /** + * Audio playback is being initialized. + */ + readonly STATE_INITIALIZED: number; + + /** + * Playback is paused. + */ + readonly STATE_PAUSED: number; + + /** + * Audio playback is active. + */ + readonly STATE_PLAYING: number; + + /** + * Audio playback is starting. + */ + readonly STATE_STARTING: number; + + /** + * Audio playback is stopped. + */ + readonly STATE_STOPPED: number; + + /** + * Audio playback is stopping. + */ + readonly STATE_STOPPING: number; + + /** + * Player is waiting for audio data from the network. + */ + readonly STATE_WAITING_FOR_DATA: number; + + /** + * Player is waiting for audio data to fill the queue. + */ + readonly STATE_WAITING_FOR_QUEUE: number; + + /** + * Used to identify the volume of audio streams for alarms. + */ + readonly AUDIO_TYPE_ALARM: number; + + /** + * Used to identify the volume of audio streams for DTMF tones or beeps. + */ + readonly AUDIO_TYPE_SIGNALLING: number; + + /** + * Used to identify the volume of audio streams for media playback. + */ + readonly AUDIO_TYPE_MEDIA: number; + + /** + * Used to identify the volume of audio streams for notifications. + */ + readonly AUDIO_TYPE_NOTIFICATION: number; + + /** + * Used to identify the volume of audio streams for the phone ring. + */ + readonly AUDIO_TYPE_RING: number; + + /** + * Used to identify the volume of audio streams for voice calls. + */ + readonly AUDIO_TYPE_VOICE: number; + + /** + * Boolean to indicate if audio should continue playing even if the associated + * Android [Activity](Titanium.Android.Activity) is paused. + */ + allowBackground: boolean; + + /** + * Focuses on the current audio player and stops other audio playing. + */ + audioFocus: boolean; + + /** + * Changes the audio-stream-type. + */ + audioType: number; + + /** + * Bit rate of the current playback stream. + */ + bitRate: number; + + /** + * Estimated duration in milliseconds of the file being played. + */ + readonly duration: number; + + /** + * Boolean indicating if the player is idle. + */ + readonly idle: boolean; + + /** + * Boolean indicating if audio playback is paused. + */ + paused: boolean; + + /** + * Boolean indicating if audio is currently playing. + */ + readonly playing: boolean; + + /** + * Current playback progress, in milliseconds. + */ + readonly progress: number; + + /** + * Current state of playback, specified using one of the `STATE` constants defined on this object. + */ + readonly state: number; + + /** + * URL for the audio stream. + */ + url: string; + + /** + * Volume of the audio, from 0.0 (muted) to 1.0 (loudest). + */ + volume: number; + + /** + * Boolean indicating if the playback is waiting for audio data from the network. + */ + readonly waiting: boolean; + + /** + * Size of the buffer used for streaming, in bytes. + */ + bufferSize: number; + + /** + * Current playback position of the audio. + */ + time: number; + + /** + * Returns the value of the [paused](Titanium.Media.AudioPlayer.paused) property. + */ + getPaused(): boolean; + + /** + * Returns the value of the [paused](Titanium.Media.AudioPlayer.paused) property. + */ + isPaused(): boolean; + + /** + * Returns the value of the [playing](Titanium.Media.AudioPlayer.playing) property. + */ + getPlaying(): boolean; + + /** + * Returns the value of the [playing](Titanium.Media.AudioPlayer.playing) property. + */ + isPlaying(): boolean; + + /** + * Pauses audio playback. + */ + pause(): void; + + /** + * Starts or resumes audio playback. + */ + play(): void; + + /** + * Sets the value of the [paused](Titanium.Media.AudioPlayer.paused) property. + */ + setPaused(paused: boolean): void; + + /** + * Stops buffering audio data and releases audio resources. + */ + release(): void; + + /** + * Returns the audio session id. + */ + getAudioSessionId(): number; + + /** + * Starts or resumes audio playback. + */ + start(): void; + + /** + * Converts a [state](Titanium.Media.AudioPlayer.state) value into a text description + * suitable for display. + */ + stateDescription(state: number): string; + + /** + * Stops audio playback. + */ + stop(): void; + + /** + * Gets the value of the property. + */ + getAllowBackground(): boolean; + + /** + * Sets the value of the property. + */ + setAllowBackground(allowBackground: boolean): void; + + /** + * Gets the value of the property. + */ + getAudioFocus(): boolean; + + /** + * Sets the value of the property. + */ + setAudioFocus(audioFocus: boolean): void; + + /** + * Gets the value of the property. + */ + getAudioType(): number; + + /** + * Sets the value of the property. + */ + setAudioType(audioType: number): void; + + /** + * Gets the value of the property. + */ + getBitRate(): number; + + /** + * Sets the value of the property. + */ + setBitRate(bitRate: number): void; + + /** + * Gets the value of the property. + */ + getDuration(): number; + + /** + * Gets the value of the property. + */ + getIdle(): boolean; + + /** + * Gets the value of the property. + */ + getPaused(): boolean; + + /** + * Sets the value of the property. + */ + setPaused(paused: boolean): void; + + /** + * Gets the value of the property. + */ + getPlaying(): boolean; + + /** + * Gets the value of the property. + */ + getProgress(): number; + + /** + * Gets the value of the property. + */ + getState(): number; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + /** + * Gets the value of the property. + */ + getVolume(): number; + + /** + * Sets the value of the property. + */ + setVolume(volume: number): void; + + /** + * Gets the value of the property. + */ + getWaiting(): boolean; + + /** + * Gets the value of the property. + */ + getBufferSize(): number; + + /** + * Sets the value of the property. + */ + setBufferSize(bufferSize: number): void; + + /** + * Gets the value of the property. + */ + getTime(): number; + + /** + * Sets the value of the property. + */ + setTime(time: number): void; + + } + + /** + * An audio recorder object used for recording audio from the device microphone. + */ + interface AudioRecorder extends Titanium.Proxy { + /** + * Audio compression to be used for the recording. + */ + compression: number; + + /** + * Audio format to be used for the recording. + */ + format: number; + + /** + * Indicates if the audio recorder is paused. + */ + readonly paused: boolean; + + /** + * Indicates if the audio recorder is recording. + */ + readonly recording: boolean; + + /** + * Indicates if the audio recorder is stopped. + */ + readonly stopped: boolean; + + /** + * Pauses the current audio recording. + */ + pause(): void; + + /** + * Resumes a paused recording. + */ + resume(): void; + + /** + * Starts an audio recording. + */ + start(): void; + + /** + * Stops the current audio recording and returns the recorded audio file. + */ + stop(): Titanium.Filesystem.File; + + /** + * Gets the value of the property. + */ + getCompression(): number; + + /** + * Sets the value of the property. + */ + setCompression(compression: number): void; + + /** + * Gets the value of the property. + */ + getFormat(): number; + + /** + * Sets the value of the property. + */ + setFormat(format: number): void; + + /** + * Gets the value of the property. + */ + getPaused(): boolean; + + /** + * Gets the value of the property. + */ + getRecording(): boolean; + + /** + * Gets the value of the property. + */ + getStopped(): boolean; + + } + + /** + * A representation of a media item returned by [openMusicLibrary](Titanium.Media.openMusicLibrary) or [queryMusicLibrary](Titanium.Media.queryMusicLibrary). + */ + interface Item extends Titanium.Proxy { + /** + * Artist credited for the album containing this item. + */ + readonly albumArtist: string; + + /** + * The persistent identifier for an album artist. + */ + readonly albumArtistPersistentID: number; + + /** + * The key for the persistent identifier for an album. + */ + readonly albumPersistentID: number; + + /** + * Title of the album containing this item. + */ + readonly albumTitle: string; + + /** + * Number of tracks for the album containing this item. + */ + readonly albumTrackCount: number; + + /** + * Track number for this item. + */ + readonly albumTrackNumber: number; + + /** + * Artist credited for this item. + */ + readonly artist: string; + + /** + * Image for the item's artwork as a `Blob` object, or `null` if no artwork is + * available. + */ + readonly artwork: Titanium.Blob; + + /** + * A URL pointing to the media item. + */ + readonly assetURL: string; + + /** + * The number of musical beats per minute for the media item, corresponding + * to the "BPM" field in the Info tab in the "Get Info" dialog in iTunes. + */ + readonly beatsPerMinute: number; + + /** + * The user's place in the media item the most recent time it was played. + */ + readonly bookmarkTime: string; + + /** + * Textual information about the media item, corresponding to the "Comments" + * field in in the Info tab in the Get Info dialog in iTunes. + */ + readonly comments: string; + + /** + * Composer of this item. + */ + readonly composer: string; + + /** + * Date when the item was added to the music library. + */ + readonly dateAdded: Date; + + /** + * Total number of discs for the album containing this item. + */ + readonly discCount: number; + + /** + * Disc number for this item in the album. + */ + readonly discNumber: number; + + /** + * Genre of this item. + */ + readonly genre: string; + + /** + * The persistent identifier for a genre. + */ + readonly genrePersistentID: number; + + /** + * True if the item represents a protected asset. + */ + readonly hasProtectedAsset: boolean; + + /** + * True if the media item is an iCloud item. + */ + readonly isCloudItem: boolean; + + /** + * True if this item is part of a compilation album. + */ + readonly isCompilation: boolean; + + /** + * True if this item is marked as "Explicit". + */ + readonly isExplicit: boolean; + + /** + * The most recent calendar date on which the user played the media item. + */ + readonly lastPlayedDate: Date; + + /** + * Lyrics for this item. + */ + readonly lyrics: string; + + /** + * The type of the media. + */ + readonly mediaType: number; + + /** + * The key for the persistent identifier for the media item. + */ + readonly persistentID: string; + + /** + * Number of times the item has been played. + */ + readonly playCount: number; + + /** + * Length (in seconds) of this item. + */ + readonly playbackDuration: number; + + /** + * Used to enqueue store tracks by their ID. + */ + readonly playbackStoreID: number; + + /** + * Title of a podcast item. + */ + readonly podcastTitle: string; + + /** + * The persistent identifier for an audio podcast. + */ + readonly podcastPersistentID: number; + + /** + * Rating for this item. + */ + readonly rating: number; + + /** + * Date when this this item was released. + */ + readonly releaseDate: Date; + + /** + * Number of times this item has been skipped. + */ + readonly skipCount: number; + + /** + * Title of this item. + */ + readonly title: string; + + /** + * Corresponds to the "Grouping" field in the Info tab in the "Get Info" + * dialog in iTunes. + */ + readonly userGrouping: string; + + /** + * Gets the value of the property. + */ + getAlbumArtist(): string; + + /** + * Gets the value of the property. + */ + getAlbumArtistPersistentID(): number; + + /** + * Gets the value of the property. + */ + getAlbumPersistentID(): number; + + /** + * Gets the value of the property. + */ + getAlbumTitle(): string; + + /** + * Gets the value of the property. + */ + getAlbumTrackCount(): number; + + /** + * Gets the value of the property. + */ + getAlbumTrackNumber(): number; + + /** + * Gets the value of the property. + */ + getArtist(): string; + + /** + * Gets the value of the property. + */ + getArtwork(): Titanium.Blob; + + /** + * Gets the value of the property. + */ + getAssetURL(): string; + + /** + * Gets the value of the property. + */ + getBeatsPerMinute(): number; + + /** + * Gets the value of the property. + */ + getBookmarkTime(): string; + + /** + * Gets the value of the property. + */ + getComments(): string; + + /** + * Gets the value of the property. + */ + getComposer(): string; + + /** + * Gets the value of the property. + */ + getDateAdded(): Date; + + /** + * Gets the value of the property. + */ + getDiscCount(): number; + + /** + * Gets the value of the property. + */ + getDiscNumber(): number; + + /** + * Gets the value of the property. + */ + getGenre(): string; + + /** + * Gets the value of the property. + */ + getGenrePersistentID(): number; + + /** + * Gets the value of the property. + */ + getHasProtectedAsset(): boolean; + + /** + * Gets the value of the property. + */ + getIsCloudItem(): boolean; + + /** + * Gets the value of the property. + */ + getIsCompilation(): boolean; + + /** + * Gets the value of the property. + */ + getIsExplicit(): boolean; + + /** + * Gets the value of the property. + */ + getLastPlayedDate(): Date; + + /** + * Gets the value of the property. + */ + getLyrics(): string; + + /** + * Gets the value of the property. + */ + getMediaType(): number; + + /** + * Gets the value of the property. + */ + getPersistentID(): string; + + /** + * Gets the value of the property. + */ + getPlayCount(): number; + + /** + * Gets the value of the property. + */ + getPlaybackDuration(): number; + + /** + * Gets the value of the property. + */ + getPlaybackStoreID(): number; + + /** + * Gets the value of the property. + */ + getPodcastTitle(): string; + + /** + * Gets the value of the property. + */ + getPodcastPersistentID(): number; + + /** + * Gets the value of the property. + */ + getRating(): number; + + /** + * Gets the value of the property. + */ + getReleaseDate(): Date; + + /** + * Gets the value of the property. + */ + getSkipCount(): number; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Gets the value of the property. + */ + getUserGrouping(): string; + + } + + /** + * This object represents a music controller. + */ + interface MusicPlayer extends Titanium.Proxy { + /** + * Current point in song playback, in seconds. + */ + currentPlaybackTime: number; + + /** + * An `Item` object representing the currently playing media item. + */ + readonly nowPlaying: Titanium.Media.Item; + + /** + * Playback state. + */ + readonly playbackState: number; + + /** + * Repeat setting. + */ + repeatMode: number; + + /** + * Shuffle setting. + */ + shuffleMode: number; + + /** + * Volume level for the music player from 0.0 (muted) to 1.0 (loudest). + */ + volume: number; + + /** + * Pauses playback of the current media item. + */ + pause(): void; + + /** + * Begins playback of the current media item. + */ + play(): void; + + /** + * Begins seeking backward in the currently playing media. + */ + seekBackward(): void; + + /** + * Begins seeking forward in the currently playing media item. + */ + seekForward(): void; + + /** + * Sets the media queue. + */ + setQueue(queue: Titanium.Media.Item): void; + + /** + * Sets the media queue. + */ + setQueue(queue: ReadonlyArray): void; + + /** + * Sets the media queue. + */ + setQueue(queue: string): void; + + /** + * Skips to the beginning of the currently playing media item. + */ + skipToBeginning(): void; + + /** + * Skips to the next media item in the queue. + */ + skipToNext(): void; + + /** + * Skips to the previous media item in the queue. + */ + skipToPrevious(): void; + + /** + * Stops playback of the current media queue. + */ + stop(): void; + + /** + * Ends a seek operation and returns to the previous playback state. + * See also: [seekForward](Titanium.Media.MusicPlayer.seekForward) and + * [seekBackward](Titanium.Media.MusicPlayer.seekBackward). + */ + stopSeeking(): void; + + /** + * Gets the value of the property. + */ + getCurrentPlaybackTime(): number; + + /** + * Sets the value of the property. + */ + setCurrentPlaybackTime(currentPlaybackTime: number): void; + + /** + * Gets the value of the property. + */ + getNowPlaying(): Titanium.Media.Item; + + /** + * Gets the value of the property. + */ + getPlaybackState(): number; + + /** + * Gets the value of the property. + */ + getRepeatMode(): number; + + /** + * Sets the value of the property. + */ + setRepeatMode(repeatMode: number): void; + + /** + * Gets the value of the property. + */ + getShuffleMode(): number; + + /** + * Sets the value of the property. + */ + setShuffleMode(shuffleMode: number): void; + + /** + * Gets the value of the property. + */ + getVolume(): number; + + /** + * Sets the value of the property. + */ + setVolume(volume: number): void; + + } + + /** + * An object for playing basic audio resources. + */ + interface Sound extends Titanium.Proxy { + /** + * Audio data is being buffered from the network. + */ + readonly STATE_BUFFERING: number; + + /** + * Audio playback is being initialized. + */ + readonly STATE_INITIALIZED: number; + + /** + * Playback is paused. + */ + readonly STATE_PAUSED: number; + + /** + * Audio playback is active. + */ + readonly STATE_PLAYING: number; + + /** + * Audio playback is starting. + */ + readonly STATE_STARTING: number; + + /** + * Audio playback is stopped. + */ + readonly STATE_STOPPED: number; + + /** + * Audio playback is stopping. + */ + readonly STATE_STOPPING: number; + + /** + * Player is waiting for audio data from the network. + */ + readonly STATE_WAITING_FOR_DATA: number; + + /** + * Player is waiting for audio data to fill the queue. + */ + readonly STATE_WAITING_FOR_QUEUE: number; + + /** + * Used to identify the volume of audio streams for alarms. + */ + readonly AUDIO_TYPE_ALARM: number; + + /** + * Used to identify the volume of audio streams for DTMF tones or beeps. + */ + readonly AUDIO_TYPE_SIGNALLING: number; + + /** + * Used to identify the volume of audio streams for media playback. + */ + readonly AUDIO_TYPE_MEDIA: number; + + /** + * Used to identify the volume of audio streams for notifications. + */ + readonly AUDIO_TYPE_NOTIFICATION: number; + + /** + * Used to identify the volume of audio streams for the phone ring. + */ + readonly AUDIO_TYPE_RING: number; + + /** + * Used to identify the volume of audio streams for voice calls. + */ + readonly AUDIO_TYPE_VOICE: number; + + /** + * Determines whether the audio should continue playing even when its activity is paused. + */ + allowBackground: boolean; + + /** + * Changes the audio-stream-type. + */ + audioType: number; + + /** + * Duration of the audio resource. + */ + readonly duration: number; + + /** + * Determines whether the audio should loop upon completion. + */ + looping: boolean; + + /** + * Indicates if the audio is paused. + */ + paused: boolean; + + /** + * Indicates if the audio is playing. + */ + readonly playing: boolean; + + /** + * Current playback position of the audio. + */ + time: number; + + /** + * URL identifying the audio resource. + */ + url: string; + + /** + * Volume of the audio from 0.0 (muted) to 1.0 (loudest). + */ + volume: number; + + /** + * Returns the value of the [looping](Titanium.Media.Sound.looping) property. + */ + isLooping(): boolean; + + /** + * Returns the value of the [paused](Titanium.Media.Sound.paused) property. + */ + isPaused(): boolean; + + /** + * Returns the value of the [playing](Titanium.Media.Sound.playing) property. + */ + isPlaying(): boolean; + + /** + * Pauses the audio. + */ + pause(): void; + + /** + * Starting playing the sound, or resume playing a paused sound. + */ + play(): void; + + /** + * Releases all internal resources. + */ + release(): void; + + /** + * Resets the audio playback position to the beginning. + */ + reset(): void; + + /** + * Sets the value of the [looping](Titanium.Media.Sound.looping) property. + */ + setLooping(looping: boolean): void; + + /** + * Sets the value of the [paused](Titanium.Media.Sound.paused) property. + */ + setPaused(paused: boolean): void; + + /** + * Stops playing the audio and resets the playback position to the beginning of the clip. + */ + stop(): void; + + /** + * Gets the value of the property. + */ + getAudioType(): number; + + /** + * Sets the value of the property. + */ + setAudioType(audioType: number): void; + + /** + * Gets the value of the property. + */ + getDuration(): number; + + /** + * Gets the value of the property. + */ + getTime(): number; + + /** + * Sets the value of the property. + */ + setTime(time: number): void; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + /** + * Gets the value of the property. + */ + getVolume(): number; + + /** + * Sets the value of the property. + */ + setVolume(volume: number): void; + + } + + /** + * An object for playing system sounds. + */ + interface SystemAlert extends Titanium.Proxy { + /** + * URL identifying the audio resource. + */ + url: string; + + /** + * Start playing the system alert. + */ + play(): void; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + } + + /** + * A native control for playing videos. + */ + interface VideoPlayer extends Titanium.UI.View { + /** + * Whether or not the current movie can be played on a remote device. + */ + allowsAirPlay: boolean; + + /** + * Indicates if a movie should automatically start playback. + */ + autoplay: boolean; + + /** + * Sets the background view for customization which is always displayed behind movie content. + */ + backgroundView: Titanium.UI.View; + + /** + * URL of the media to play. + */ + contentURL: string; + + /** + * Current playback time of the current movie in milliseconds. + */ + currentPlaybackTime: number; + + /** + * The duration of the current movie in milliseconds, or 0.0 if not known. + */ + duration: number; + + /** + * The end time of movie playback, in milliseconds. + */ + endPlaybackTime: number; + + /** + * Determines if the movie is presented in the entire screen (obscuring all other application content). + */ + fullscreen: boolean; + + /** + * The start time of movie playback, in milliseconds. + */ + initialPlaybackTime: number; + + /** + * Returns the network load state of the movie player. + */ + readonly loadState: number; + + /** + * Media object to play, as either a `File`, a `Blob`, or a URL. + */ + media: Titanium.Blob | Titanium.Filesystem.File | string; + + /** + * The style of the playback controls. + */ + mediaControlStyle: number; + + /** + * The types of media in the movie, or if not known. + */ + mediaTypes: number; + + /** + * Style of the media playback controls. + */ + movieControlMode: number; + + /** + * Returns the status of the movie player. + */ + readonly moviePlayerStatus: number; + + /** + * Returns the natural size of the movie. + */ + naturalSize: MovieSize; + + /** + * Use the overlay view to add additional custom views between the video content and the controls. + */ + overlayView: Titanium.UI.View; + + /** + * Whether or not the receiver allows Picture in Picture playback. + */ + pictureInPictureEnabled: boolean; + + /** + * Currently playable duration of the movie, in milliseconds, for progressively + * downloaded network content, or 0.0 if not known. + */ + readonly playableDuration: number; + + /** + * Current playback state of the video player. + */ + readonly playbackState: number; + + /** + * Boolean to indicate if the player has started playing. + */ + readonly playing: boolean; + + /** + * Determines how the movie player repeats when reaching the end of playback. + */ + repeatMode: number; + + /** + * Determines how the content scales to fit the view. + */ + scalingMode: number; + + /** + * Whether or not the receiver shows playback controls. Default is YES. + */ + showsControls: boolean; + + /** + * The playback type of the movie. + */ + sourceType: number; + + /** + * URL of the media to play. + */ + url: string | string[]; + + /** + * Indicates if the movie player should inherit the application's audio session + * instead of creating a new session. + */ + useApplicationAudioSession: boolean; + + /** + * Volume of the audio portion of the video. + */ + volume: number; + + /** + * Cancels all pending asynchronous thumbnail requests. + */ + cancelAllThumbnailImageRequests(): void; + + /** + * Pauses playing the video. + */ + pause(): void; + + /** + * Starts playing the video. + */ + play(): void; + + /** + * Releases the internal video resources immediately. + */ + release(): void; + + /** + * Asynchronously request thumbnail images for one or more points in time in the video. + */ + requestThumbnailImagesAtTimes(times: ReadonlyArray, option: number, callback: (param0: ThumbnailResponse) => any): void; + + /** + * Stops playing the video. + */ + stop(): void; + + /** + * Returns a thumbnail image for the video at the specified time. + */ + thumbnailImageAtTime(time: number, option: number): Titanium.Blob; + + /** + * Gets the value of the property. + */ + getAllowsAirPlay(): boolean; + + /** + * Sets the value of the property. + */ + setAllowsAirPlay(allowsAirPlay: boolean): void; + + /** + * Gets the value of the property. + */ + getAutoplay(): boolean; + + /** + * Sets the value of the property. + */ + setAutoplay(autoplay: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setBackgroundView(backgroundView: any): void; + + /** + * Gets the value of the property. + */ + getContentURL(): string; + + /** + * Sets the value of the property. + */ + setContentURL(contentURL: string): void; + + /** + * Gets the value of the property. + */ + getCurrentPlaybackTime(): number; + + /** + * Sets the value of the property. + */ + setCurrentPlaybackTime(currentPlaybackTime: number): void; + + /** + * Gets the value of the property. + */ + getDuration(): number; + + /** + * Sets the value of the property. + */ + setDuration(duration: number): void; + + /** + * Gets the value of the property. + */ + getEndPlaybackTime(): number; + + /** + * Sets the value of the property. + */ + setEndPlaybackTime(endPlaybackTime: number): void; + + /** + * Gets the value of the property. + */ + getFullscreen(): boolean; + + /** + * Sets the value of the property. + */ + setFullscreen(fullscreen: boolean): void; + + /** + * Gets the value of the property. + */ + getInitialPlaybackTime(): number; + + /** + * Sets the value of the property. + */ + setInitialPlaybackTime(initialPlaybackTime: number): void; + + /** + * Gets the value of the property. + */ + getLoadState(): number; + + /** + * Sets the value of the property. + */ + setMedia(media: Titanium.Blob): void; + + /** + * Sets the value of the property. + */ + setMedia(media: Titanium.Filesystem.File): void; + + /** + * Sets the value of the property. + */ + setMedia(media: string): void; + + /** + * Gets the value of the property. + */ + getMediaControlStyle(): number; + + /** + * Sets the value of the property. + */ + setMediaControlStyle(mediaControlStyle: number): void; + + /** + * Gets the value of the property. + */ + getMediaTypes(): number; + + /** + * Sets the value of the property. + */ + setMediaTypes(mediaTypes: number): void; + + /** + * Gets the value of the property. + */ + getMovieControlMode(): number; + + /** + * Sets the value of the property. + */ + setMovieControlMode(movieControlMode: number): void; + + /** + * Gets the value of the property. + */ + getMoviePlayerStatus(): number; + + /** + * Gets the value of the property. + */ + getNaturalSize(): MovieSize; + + /** + * Sets the value of the property. + */ + setNaturalSize(naturalSize: MovieSize): void; + + /** + * Gets the value of the property. + */ + getOverlayView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setOverlayView(overlayView: any): void; + + /** + * Gets the value of the property. + */ + getPictureInPictureEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setPictureInPictureEnabled(pictureInPictureEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getPlayableDuration(): number; + + /** + * Gets the value of the property. + */ + getPlaybackState(): number; + + /** + * Gets the value of the property. + */ + getPlaying(): boolean; + + /** + * Gets the value of the property. + */ + getRepeatMode(): number; + + /** + * Sets the value of the property. + */ + setRepeatMode(repeatMode: number): void; + + /** + * Gets the value of the property. + */ + getScalingMode(): number; + + /** + * Sets the value of the property. + */ + setScalingMode(scalingMode: number): void; + + /** + * Gets the value of the property. + */ + getShowsControls(): boolean; + + /** + * Sets the value of the property. + */ + setShowsControls(showsControls: boolean): void; + + /** + * Gets the value of the property. + */ + getSourceType(): number; + + /** + * Sets the value of the property. + */ + setSourceType(sourceType: number): void; + + /** + * Gets the value of the property. + */ + getUrl(): string | string[]; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + /** + * Sets the value of the property. + */ + setUrl(url: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getUseApplicationAudioSession(): boolean; + + /** + * Sets the value of the property. + */ + setUseApplicationAudioSession(useApplicationAudioSession: boolean): void; + + /** + * Gets the value of the property. + */ + getVolume(): number; + + /** + * Sets the value of the property. + */ + setVolume(volume: number): void; + + } + + + /** + * Android-specific media-related functionality. + */ + namespace Android { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Scans newly created or downloaded media files to make them available to other + * Android media providers, such as the Gallery. + */ + function scanMediaFiles(paths: ReadonlyArray, mimeTypes: ReadonlyArray, callback: (param0: MediaScannerResponse) => any): void; + + /** + * Set the system homescreen wallpaper. + */ + function setSystemWallpaper(image: Titanium.Blob, scale: boolean): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + } + } + + /** + * The top level network module. + */ + namespace Network { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Special hostname value for listening sockets, representing all + * locally available network interfaces. + */ + const INADDR_ANY: string; + + /** + * A [networkType](Titanium.Network.networkType) value indicating that the device is + * communicating over a local-area network. + */ + const NETWORK_LAN: number; + + /** + * A [networkType](Titanium.Network.networkType) value indicating that the device is + * communicating over a mobile network. + */ + const NETWORK_MOBILE: number; + + /** + * A [networkType](Titanium.Network.networkType) value indicating that no + * network is available. + */ + const NETWORK_NONE: number; + + /** + * A [networkType](Titanium.Network.networkType) value indicating that the + * current network type is unknown. + */ + const NETWORK_UNKNOWN: number; + + /** + * A [networkType](Titanium.Network.networkType) value indicating that the + * device is communicating over a WiFi network. + */ + const NETWORK_WIFI: number; + + /** + * Constant value for an Alert style push notification. + */ + const NOTIFICATION_TYPE_ALERT: number; + + /** + * Constant value for a Badge style push notification. + */ + const NOTIFICATION_TYPE_BADGE: number; + + /** + * Constant value for a Sound style push notification. + */ + const NOTIFICATION_TYPE_SOUND: number; + + /** + * Constant value for a Newsstand style push notification. Only available on iOS5 and later + */ + const NOTIFICATION_TYPE_NEWSSTAND: number; + + /** + * Constant value specifying read-only mode for sockets. + */ + const READ_MODE: number; + + /** + * Constant value specifying read-write mode for sockets. + */ + const READ_WRITE_MODE: number; + + /** + * Constant value representing a socket in the CLOSED state. + */ + const SOCKET_CLOSED: number; + + /** + * Constant value representing a socket in the CONNECTED state. + */ + const SOCKET_CONNECTED: number; + + /** + * Constant value representing a socket in the ERROR state. + */ + const SOCKET_ERROR: number; + + /** + * Constant value representing a socket in the INITIALIZED state. + */ + const SOCKET_INITIALIZED: number; + + /** + * Constant value representing a socket in the LISTENING state. + */ + const SOCKET_LISTENING: number; + + /** + * Constant value specifying write-only mode for sockets. + */ + const WRITE_MODE: number; + + /** + * Constant value specifying TLS version 1.0 for SSL. + */ + const TLS_VERSION_1_0: number; + + /** + * Constant value specifying TLS version 1.1 for SSL. + */ + const TLS_VERSION_1_1: number; + + /** + * Constant value specifying TLS version 1.2 for SSL. + */ + const TLS_VERSION_1_2: number; + + /** + * Constant value specifying that the progress of a download can not be calculated. + */ + const PROGRESS_UNKNOWN: number; + + /** + * A list of all cookies in the cookie storage. + */ + const allHTTPCookies: Titanium.Network.Cookie[]; + + /** + * Network type value as a constant. + */ + const networkType: number; + + /** + * Network type as a String. Returns one of `NONE`, `WIFI`, `LAN`, `MOBILE`, or `UNKNOWN`. + */ + const networkTypeName: string; + + /** + * Boolean value indicating if the device can reach the Internet. + */ + const online: boolean; + + /** + * Remote device UUID if the device is registered with the Apple Push Notification + * Service, or null if it is not registered. + */ + const remoteDeviceUUID: string; + + /** + * Array of push notification type constants enabled for the application. + */ + const remoteNotificationTypes: number[]; + + /** + * Indicates whether push notifications have been enabled using + * [registerForPushNotifications](Titanium.Network.registerForPushNotifications). + */ + const remoteNotificationsEnabled: boolean; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Legacy method to add a connectivity listener to listen for network changes. + */ + function addConnectivityListener(callback: (param0: any) => any): void; + + /** + * Adds a cookie to the HTTP client cookie store. + */ + function addHTTPCookie(cookie: Titanium.Network.Cookie): void; + + /** + * Adds a cookie to the system cookie store. + */ + function addSystemCookie(cookie: Titanium.Network.Cookie): void; + + /** + * Creates and returns a `BonjourBrowser` object. + */ + function createBonjourBrowser(serviceType: string, domain: string, parameters?: any): Titanium.Network.BonjourBrowser; + + /** + * Creates and returns a `BonjourService` object. + */ + function createBonjourService(name: string, type: string, domain: string, parameters?: any): Titanium.Network.BonjourService; + + /** + * Legacy method to create and return an instance of . + */ + function createTCPSocket(hostName: string, port: number, mode: number, parameters: any): Titanium.Network.TCPSocket; + + /** + * Returns a decoded version of a URI encoded value. + */ + function decodeURIComponent(value: string): string; + + /** + * Returns a URI encoded version of the specified URI component. + */ + function encodeURIComponent(value: string): string; + + /** + * Gets all the cookies with the domain, path and name matched with the given values from the HTTP client cookie store. + */ + function getHTTPCookies(domain: string, path: string, name: string): Titanium.Network.Cookie[]; + + /** + * Gets all the cookies with the domain matched with the given values from the HTTP client cookie store. + */ + function getHTTPCookiesForDomain(domain: string): Titanium.Network.Cookie[]; + + /** + * Gets all the cookies with the domain, path and name matched with the given values from the system cookie store. + */ + function getSystemCookies(domain: string, path: string, name: string): Titanium.Network.Cookie[]; + + /** + * Removes all the cookies from the HTTP client cookie store. + */ + function removeAllHTTPCookies(): void; + + /** + * Removes all the cookie from the system client cookie store. + */ + function removeAllSystemCookies(): void; + + /** + * Removes the cookie with the domain, path and name exactly the same as the given values from the HTTP client cookie store. + */ + function removeHTTPCookie(domain: string, path: string, name: string): void; + + /** + * Removes the cookies with the domain matched with the given values from the HTTP client cookie store. + */ + function removeHTTPCookiesForDomain(domain: string): void; + + /** + * Removes the cookie with the domain, path and name exactly the same as the given values from the system cookie store. + */ + function removeSystemCookie(domain: string, path: string, name: string): void; + + /** + * Registers for push notifications with the Apple Push Notification Service. + */ + function registerForPushNotifications(config: PushNotificationConfig): void; + + /** + * Legacy method to remove a connectivity listener. + */ + function removeConnectivityListener(callback: (param0: any) => any): void; + + /** + * Unregisters the application for push notifications. + */ + function unregisterForPushNotifications(): void; + + /** + * Creates and returns an instance of . + */ + function createCookie(parameters?: any): Titanium.Network.Cookie; + + /** + * Creates and returns an instance of . + */ + function createHTTPClient(parameters?: any): Titanium.Network.HTTPClient; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getAllHTTPCookies(): Titanium.Network.Cookie[]; + + /** + * Gets the value of the property. + */ + function getNetworkType(): number; + + /** + * Gets the value of the property. + */ + function getNetworkTypeName(): string; + + /** + * Gets the value of the property. + */ + function getOnline(): boolean; + + /** + * Gets the value of the property. + */ + function getRemoteDeviceUUID(): string; + + /** + * Gets the value of the property. + */ + function getRemoteNotificationTypes(): number[]; + + /** + * Gets the value of the property. + */ + function getRemoteNotificationsEnabled(): boolean; + + /** + * A browser for the discovery and retrieval of Bonjour services available on the network. + */ + interface BonjourBrowser extends Titanium.Proxy { + /** + * The domain the browser is searching in + */ + domain: string; + + /** + * Whether or not the browser is currently searching + */ + isSearching: boolean; + + /** + * The type of the service the browser searches for + */ + serviceType: string; + + /** + * Conduct a search for Bonjour services matching the type and domain specified during creation + */ + search(): void; + + /** + * Halt an ongoing search + */ + stopSearch(): void; + + /** + * Gets the value of the property. + */ + getDomain(): string; + + /** + * Sets the value of the property. + */ + setDomain(domain: string): void; + + /** + * Gets the value of the property. + */ + getIsSearching(): boolean; + + /** + * Sets the value of the property. + */ + setIsSearching(isSearching: boolean): void; + + /** + * Gets the value of the property. + */ + getServiceType(): string; + + /** + * Sets the value of the property. + */ + setServiceType(serviceType: string): void; + + } + + /** + * Describes a service on the network which is published by Bonjour. + */ + interface BonjourService extends Titanium.Proxy { + /** + * the domain of the service + */ + domain: string; + + /** + * whether or not the service is local to the device + */ + isLocal: boolean; + + /** + * the name of the service + */ + name: string; + + /** + * the TCPSocket object that is used to connect to the service + */ + socket: any; + + /** + * the type of the service + */ + type: string; + + /** + * Publish a Bonjour service to the network. Only works if isLocal is TRUE + */ + publish(socket: any): void; + + /** + * Resolve a Bonjour service from the network. Must be done before attempting to access the service's socket information, if a remote service. You cannot resolve a locally published service. + */ + resolve(timeout: number): void; + + /** + * Halts publication of a service. + */ + stop(): void; + + /** + * Gets the value of the property. + */ + getDomain(): string; + + /** + * Sets the value of the property. + */ + setDomain(domain: string): void; + + /** + * Gets the value of the property. + */ + getIsLocal(): boolean; + + /** + * Sets the value of the property. + */ + setIsLocal(isLocal: boolean): void; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Sets the value of the property. + */ + setName(name: string): void; + + /** + * Gets the value of the property. + */ + getSocket(): any; + + /** + * Sets the value of the property. + */ + setSocket(socket: any): void; + + /** + * Gets the value of the property. + */ + getType(): string; + + /** + * Sets the value of the property. + */ + setType(type: string): void; + + } + + /** + * Cookie object used to manage the system cookie store and HTTP client cookie store. + */ + interface Cookie extends Titanium.Proxy { + /** + * The comment describing the purpose of this cookie + */ + comment: string; + + /** + * The domain attribute of the cookie. + */ + domain: string; + + /** + * The expiration Date of the cookie. + */ + expiryDate: string; + + /** + * Sets the Max-Age attribute of a Cookie, in delta-seconds. + */ + maxAge: number; + + /** + * The httponly attribute of the cookie. + */ + httponly: boolean; + + /** + * The name of the cookie. + */ + readonly name: string; + + /** + * The origual url attribute of the cookie. + */ + originalUrl: string; + + /** + * The path attribute of the cookie. + */ + path: string; + + /** + * The secure attribute of the cookie. + */ + secure: boolean; + + /** + * The value of the cookie. + */ + value: string; + + /** + * The version of the cookie specification to which this cookie conforms. + */ + version: number; + + /** + * Returns true if the cookie is valid. + */ + isValid(): boolean; + + /** + * Gets the value of the property. + */ + getComment(): string; + + /** + * Sets the value of the property. + */ + setComment(comment: string): void; + + /** + * Gets the value of the property. + */ + getDomain(): string; + + /** + * Sets the value of the property. + */ + setDomain(domain: string): void; + + /** + * Gets the value of the property. + */ + getExpiryDate(): string; + + /** + * Sets the value of the property. + */ + setExpiryDate(expiryDate: string): void; + + /** + * Gets the value of the property. + */ + getMaxAge(): number; + + /** + * Sets the value of the property. + */ + setMaxAge(maxAge: number): void; + + /** + * Gets the value of the property. + */ + getHttponly(): boolean; + + /** + * Sets the value of the property. + */ + setHttponly(httponly: boolean): void; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Gets the value of the property. + */ + getOriginalUrl(): string; + + /** + * Sets the value of the property. + */ + setOriginalUrl(originalUrl: string): void; + + /** + * Gets the value of the property. + */ + getPath(): string; + + /** + * Sets the value of the property. + */ + setPath(path: string): void; + + /** + * Gets the value of the property. + */ + getSecure(): boolean; + + /** + * Sets the value of the property. + */ + setSecure(secure: boolean): void; + + /** + * Gets the value of the property. + */ + getValue(): string; + + /** + * Sets the value of the property. + */ + setValue(value: string): void; + + /** + * Gets the value of the property. + */ + getVersion(): number; + + /** + * Sets the value of the property. + */ + setVersion(version: number): void; + + } + + /** + * HTTP client object that (mostly) implements the XMLHttpRequest specification. + */ + interface HTTPClient extends Titanium.Proxy { + /** + * Ready state constant indicating that the request is complete. + */ + readonly DONE: number; + + /** + * Ready state constant indicating that response headers have been received. + */ + readonly HEADERS_RECEIVED: number; + + /** + * Ready state constant indicating that response data is being received from the remote server. + */ + readonly LOADING: number; + + /** + * Ready state constant indicating that the connection has been opened, but the request has + * not yet been sent. + */ + readonly OPENED: number; + + /** + * Ready state constant indicating that HTTPClient request has not been opened or sent. + */ + readonly UNSENT: number; + + /** + * All of the response headers. + */ + readonly allResponseHeaders: string; + + /** + * Returns all the response headers returned with the request. + */ + readonly responseHeaders: any; + + /** + * Determines whether automatic encoding is enabled for the specified URL. + */ + autoEncodeUrl: boolean; + + /** + * Determines whether automatic automatic handling of HTTP redirects is enabled. + */ + autoRedirect: boolean; + + /** + * Indicates whether the response was successful. + */ + readonly connected: boolean; + + /** + * Connection type, normally either `GET`, `POST` or `PATCH`. + */ + readonly connectionType: string; + + /** + * Sets the domain parameter for authentication credentials. + */ + domain: string; + + /** + * Determines whether the client should attempt to keep a persistent connection. + */ + enableKeepAlive: boolean; + + /** + * Target local file to receive data. + */ + file: string; + + /** + * Absolute URL of the request. + */ + readonly location: string; + + /** + * Function to be called at regular intervals as the request data is being received. + */ + ondatastream: (param0: any) => any; + + /** + * Function to be called upon a error response. + */ + onerror: (param0: FailureResponse) => any; + + /** + * Function to be called upon a successful response. + */ + onload: (param0: SuccessResponse) => any; + + /** + * Function to be called for each [readyState](Titanium.Network.HTTPClient.readyState) change. + */ + onreadystatechange: (param0: any) => any; + + /** + * Function to be called at regular intervals as the request data is being transmitted. + */ + onsendstream: (param0: any) => any; + + /** + * Sets the password parameter for authentication credentials. + */ + password: string; + + /** + * The current ready state of this HTTP request. + */ + readonly readyState: number; + + /** + * Response data as a `Blob` object. + */ + readonly responseData: Titanium.Blob; + + /** + * Response as text. + */ + readonly responseText: string; + + /** + * Response object as an XML DOM Document object. + */ + readonly responseXML: Titanium.XML.Document; + + /** + * The Security Manager for this client. + */ + securityManager: SecurityManagerProtocol; + + /** + * Response HTTP status code. + */ + readonly status: number; + + /** + * Human-readable status message associated with the status code. + */ + readonly statusText: string; + + /** + * Timeout in milliseconds when the connection should be aborted. + */ + timeout: number; + + /** + * Sets the username parameter for authentication credentials. + */ + username: string; + + /** + * Determines how SSL certification validation is performed on connection. + */ + validatesSecureCertificate: boolean; + + /** + * Sets the TLS version to use for handshakes. + */ + tlsVersion: number; + + /** + * Determines whether HTTP responses are cached. + */ + cache: boolean; + + /** + * Cancels a pending request. + */ + abort(): void; + + /** + * Registers a new AuthSchemeFactory for a given scheme. + */ + addAuthFactory(scheme: string, factory: any): void; + + /** + * Adds a custom key manager. + */ + addKeyManager(X509KeyManager: any): void; + + /** + * Adds a custom trust manager. + */ + addTrustManager(X509TrustManager: any): void; + + /** + * Clears any cookies stored for the host. + */ + clearCookies(host: string): void; + + /** + * Returns the value of the specified response header. + */ + getResponseHeader(name: string): string; + + /** + * Opens the request and prepares the connection. + */ + open(method: string, url: string, async?: boolean): void; + + /** + * Sends the request. + */ + send(data?: any): void; + + /** + * Sends the request. + */ + send(data?: string): void; + + /** + * Sends the request. + */ + send(data?: Titanium.Filesystem.File): void; + + /** + * Sends the request. + */ + send(data?: Titanium.Blob): void; + + /** + * Sets the value for the specified request header. Must be called after `open` but before `send`. + */ + setRequestHeader(name: string, value: string): void; + + /** + * Sets the request timeout. + */ + setTimeout(timeout: number): void; + + /** + * Gets the value of the property. + */ + getAllResponseHeaders(): string; + + /** + * Gets the value of the property. + */ + getResponseHeaders(): any; + + /** + * Gets the value of the property. + */ + getAutoEncodeUrl(): boolean; + + /** + * Sets the value of the property. + */ + setAutoEncodeUrl(autoEncodeUrl: boolean): void; + + /** + * Gets the value of the property. + */ + getAutoRedirect(): boolean; + + /** + * Sets the value of the property. + */ + setAutoRedirect(autoRedirect: boolean): void; + + /** + * Gets the value of the property. + */ + getConnected(): boolean; + + /** + * Gets the value of the property. + */ + getConnectionType(): string; + + /** + * Gets the value of the property. + */ + getDomain(): string; + + /** + * Sets the value of the property. + */ + setDomain(domain: string): void; + + /** + * Gets the value of the property. + */ + getEnableKeepAlive(): boolean; + + /** + * Sets the value of the property. + */ + setEnableKeepAlive(enableKeepAlive: boolean): void; + + /** + * Gets the value of the property. + */ + getFile(): string; + + /** + * Sets the value of the property. + */ + setFile(file: string): void; + + /** + * Gets the value of the property. + */ + getLocation(): string; + + /** + * Gets the value of the property. + */ + getOndatastream(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOndatastream(ondatastream: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOnerror(): (param0: FailureResponse) => any; + + /** + * Sets the value of the property. + */ + setOnerror(onerror: (param0: FailureResponse) => any): void; + + /** + * Gets the value of the property. + */ + getOnload(): (param0: SuccessResponse) => any; + + /** + * Sets the value of the property. + */ + setOnload(onload: (param0: SuccessResponse) => any): void; + + /** + * Gets the value of the property. + */ + getOnreadystatechange(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnreadystatechange(onreadystatechange: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOnsendstream(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnsendstream(onsendstream: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getPassword(): string; + + /** + * Sets the value of the property. + */ + setPassword(password: string): void; + + /** + * Gets the value of the property. + */ + getReadyState(): number; + + /** + * Gets the value of the property. + */ + getResponseData(): Titanium.Blob; + + /** + * Gets the value of the property. + */ + getResponseText(): string; + + /** + * Gets the value of the property. + */ + getResponseXML(): Titanium.XML.Document; + + /** + * Gets the value of the property. + */ + getSecurityManager(): SecurityManagerProtocol; + + /** + * Sets the value of the property. + */ + setSecurityManager(securityManager: SecurityManagerProtocol): void; + + /** + * Gets the value of the property. + */ + getStatus(): number; + + /** + * Gets the value of the property. + */ + getStatusText(): string; + + /** + * Gets the value of the property. + */ + getTimeout(): number; + + /** + * Sets the value of the property. + */ + setTimeout(timeout: number): void; + + /** + * Gets the value of the property. + */ + getUsername(): string; + + /** + * Sets the value of the property. + */ + setUsername(username: string): void; + + /** + * Gets the value of the property. + */ + getValidatesSecureCertificate(): boolean; + + /** + * Sets the value of the property. + */ + setValidatesSecureCertificate(validatesSecureCertificate: boolean): void; + + /** + * Gets the value of the property. + */ + getTlsVersion(): number; + + /** + * Sets the value of the property. + */ + setTlsVersion(tlsVersion: number): void; + + /** + * Gets the value of the property. + */ + getCache(): boolean; + + /** + * Sets the value of the property. + */ + setCache(cache: boolean): void; + + } + + /** + * The TCPSocket instance returned from . This object + * represents a socket which either listens locally on the device for connections, + * or connects to a remote machine. + */ + interface TCPSocket extends Titanium.Proxy { + /** + * the host name to connect to. Must be or an identifier for the local device in order to listen + */ + hostName: string; + + /** + * whether or not the socket is valid + */ + isValid: boolean; + + /** + * the socket's mode + */ + mode: number; + + /** + * the port to connect/listen on + */ + port: number; + + /** + * strip terminating null character when sending string data; default is false + */ + stripTerminator: boolean; + + /** + * close the socket + */ + close(): void; + + /** + * connect the scocket to a TCP server + */ + connect(): void; + + /** + * set up the socket to receive connections + */ + listen(): void; + + /** + * write data to the socket, if the mode is WRITE_MODE or READ_WRITE_MODE + */ + write(data: any, sendTo: number): void; + + /** + * write data to the socket, if the mode is WRITE_MODE or READ_WRITE_MODE + */ + write(data: string, sendTo: number): void; + + /** + * Gets the value of the property. + */ + getHostName(): string; + + /** + * Sets the value of the property. + */ + setHostName(hostName: string): void; + + /** + * Gets the value of the property. + */ + getIsValid(): boolean; + + /** + * Sets the value of the property. + */ + setIsValid(isValid: boolean): void; + + /** + * Gets the value of the property. + */ + getMode(): number; + + /** + * Sets the value of the property. + */ + setMode(mode: number): void; + + /** + * Gets the value of the property. + */ + getPort(): number; + + /** + * Sets the value of the property. + */ + setPort(port: number): void; + + /** + * Gets the value of the property. + */ + getStripTerminator(): boolean; + + /** + * Sets the value of the property. + */ + setStripTerminator(stripTerminator: boolean): void; + + } + + + /** + * Socket module, used for creating sockets. + */ + namespace Socket { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * State value representing an initialized socket. + */ + const INITIALIZED: number; + + /** + * State value representing a connected socket. + */ + const CONNECTED: number; + + /** + * State value representing a socket that is listening for connections. + */ + const LISTENING: number; + + /** + * State value representing a closed socket. + */ + const CLOSED: number; + + /** + * State value indicating an error has occurred on the socket. + */ + const ERROR: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Returns a new TCP socket object. + */ + function createTCP(params?: any): Titanium.Network.Socket.TCP; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * TCP socket that implements the `Titanium.IOStream` interface. + */ + interface TCP extends Titanium.Proxy { + /** + * The host to connect to or listen on. + */ + host: string; + + /** + * The port to connect to or listen on. + */ + port: number; + + /** + * Max number of pending incoming connections to be allowed when the socket is in the [LISTENING](Titanium.Network.Socket.LISTENING) state. + */ + listenQueueSize: number; + + /** + * Timeout, in milliseconds, for `connect` and all `write` operations. + */ + timeout: number; + + /** + * Callback to be fired when the socket enters the "connected" state. + */ + connected: (param0: ConnectedCallbackArgs) => any; + + /** + * Callback to be fired when the socket enters the [ERROR](Titanium.Network.Socket.ERROR) state. + */ + error: (param0: ErrorCallbackArgs) => any; + + /** + * Callback to be fired when a listener accepts a connection. + */ + accepted: (param0: AcceptedCallbackArgs) => any; + + /** + * Current state of the socket. + */ + readonly state: number; + + /** + * Reads data from this stream into a buffer. + */ + read(buffer: Titanium.Buffer, offset?: number, length?: number): number; + + /** + * Writes data from a buffer to this stream. + */ + write(buffer: Titanium.Buffer, offset?: number, length?: number): number; + + /** + * Indicates whether this stream is writable. + */ + isWritable(): boolean; + + /** + * Indicates whether this stream is readable. + */ + isReadable(): boolean; + + /** + * Closes a socket. + */ + close(): void; + + /** + * Attempts to connect the socket to its host/port. + */ + connect(): void; + + /** + * Attempts to start listening on the socket's host/port. + */ + listen(): void; + + /** + * Tells a [LISTENING](Titanium.Network.Socket.LISTENING) socket to accept a connection request at the top of a listener's request queue when one becomes available. + */ + accept(options: AcceptDict): void; + + /** + * Gets the value of the property. + */ + getHost(): string; + + /** + * Sets the value of the property. + */ + setHost(host: string): void; + + /** + * Gets the value of the property. + */ + getPort(): number; + + /** + * Sets the value of the property. + */ + setPort(port: number): void; + + /** + * Gets the value of the property. + */ + getListenQueueSize(): number; + + /** + * Sets the value of the property. + */ + setListenQueueSize(listenQueueSize: number): void; + + /** + * Gets the value of the property. + */ + getTimeout(): number; + + /** + * Sets the value of the property. + */ + setTimeout(timeout: number): void; + + /** + * Gets the value of the property. + */ + getConnected(): (param0: ConnectedCallbackArgs) => any; + + /** + * Sets the value of the property. + */ + setConnected(connected: (param0: ConnectedCallbackArgs) => any): void; + + /** + * Gets the value of the property. + */ + getError(): (param0: ErrorCallbackArgs) => any; + + /** + * Sets the value of the property. + */ + setError(error: (param0: ErrorCallbackArgs) => any): void; + + /** + * Gets the value of the property. + */ + getAccepted(): (param0: AcceptedCallbackArgs) => any; + + /** + * Sets the value of the property. + */ + setAccepted(accepted: (param0: AcceptedCallbackArgs) => any): void; + + /** + * Gets the value of the property. + */ + getState(): number; + + } + + } + } + + /** + * The top-level Platform module. The Platform module is used to access the device's platform-related + * functionality. + */ + namespace Platform { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Constant to indicate that the system is plugged in and currently being charged. + */ + const BATTERY_STATE_CHARGING: number; + + /** + * Constant to indicate that the battery is fully charged. + */ + const BATTERY_STATE_FULL: number; + + /** + * Constant to indicate that the battery state is not known or monitoring is disabled. + */ + const BATTERY_STATE_UNKNOWN: number; + + /** + * Constant to indicate that the system is unplugged. + */ + const BATTERY_STATE_UNPLUGGED: number; + + /** + * System's WIFI IP address. No other network types are supported. + */ + const address: string; + + /** + * System's processor architecture. + */ + const architecture: string; + + /** + * System's unused memory, measured in megabytes on iOS and bytes on Android. + */ + const availableMemory: number; + + /** + * Battery level in percent, accessible only when `batteryMonitoring` is enabled. Measured + * in 5% increments on iPhone/iPad. + */ + const batteryLevel: number; + + /** + * Determines whether battery monitoring is enabled. + */ + let batteryMonitoring: boolean; + + /** + * Indicates the state of the battery. Accessible only when `batteryMonitoring` is enabled. + */ + const batteryState: number; + + /** + * Returns the DisplayCaps object. + */ + const displayCaps: Titanium.Platform.DisplayCaps; + + /** + * Applications's globally-unique ID (UUID). + */ + const id: string; + + /** + * An alphanumeric string that uniquely identifies a device to the app's vendor. + */ + const identifierForVendor: string; + + /** + * An alphanumeric string unique to each device, used only for serving advertisements. + */ + let identifierForAdvertising: string; + + /** + * A Boolean value that indicates whether the user has limited ad tracking. + */ + const isAdvertisingTrackingEnabled: boolean; + + /** + * System's default language. + */ + const locale: string; + + /** + * System's network interface mac address, or app UUID. + */ + const macaddress: string; + + /** + * Manufacturer of the device. + */ + const manufacturer: string; + + /** + * Model of the device. + */ + const model: string; + + /** + * Name of the platform. Returns `android` for the Android platform, `iPhone OS` for the iOS + * platform (iPhone, iPad, or iPod Touch), and `windows` for the Windows platform. + * Since iOS 10 this property returns `iOS` for for the iOS platform (iPhone, iPad, or iPod Touch). + */ + const name: string; + + /** + * System's WIFI network mask. No other network types are supported. + */ + const netmask: string; + + /** + * Short name of the system's Operating System. Returns `android` for the Android platfrom, + * `iphone` for the iPhone or iPod Touch, `ipad` for the iPad, `windowsphone` for Windows Phone, and `windowsstore` for Windows Store + * platform. + */ + const osname: string; + + /** + * Operating System architecture. On Android, this is `32bit`. + */ + const ostype: string; + + /** + * Number of processing cores. + */ + const processorCount: number; + + /** + * Short name of the JavaScript runtime in use. + */ + const runtime: string; + + /** + * System name, if set. On iOS, this can be found in Settings > General > About > Name. + */ + const username: string; + + /** + * System's OS version. + */ + const version: string; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Returns whether the system is configured with a default application to handle the URL's protocol. + */ + function canOpenURL(url: string): boolean; + + /** + * Creates a globally-unique identifier. + */ + function createUUID(): string; + + /** + * Opens this URL using the system's default application for its protocol. + */ + function openURL(url: string): boolean; + + /** + * Returns whether the system settings are configured to show times in 24-hour format. + */ + function is24HourTimeFormat(): boolean; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getAddress(): string; + + /** + * Gets the value of the property. + */ + function getArchitecture(): string; + + /** + * Gets the value of the property. + */ + function getAvailableMemory(): number; + + /** + * Gets the value of the property. + */ + function getBatteryLevel(): number; + + /** + * Gets the value of the property. + */ + function getBatteryMonitoring(): boolean; + + /** + * Sets the value of the property. + */ + function setBatteryMonitoring(batteryMonitoring: boolean): void; + + /** + * Gets the value of the property. + */ + function getBatteryState(): number; + + /** + * Gets the value of the property. + */ + function getDisplayCaps(): Titanium.Platform.DisplayCaps; + + /** + * Gets the value of the property. + */ + function getId(): string; + + /** + * Gets the value of the property. + */ + function getIdentifierForVendor(): string; + + /** + * Gets the value of the property. + */ + function getIdentifierForAdvertising(): string; + + /** + * Sets the value of the property. + */ + function setIdentifierForAdvertising(identifierForAdvertising: string): void; + + /** + * Gets the value of the property. + */ + function getIsAdvertisingTrackingEnabled(): boolean; + + /** + * Gets the value of the property. + */ + function getLocale(): string; + + /** + * Gets the value of the property. + */ + function getMacaddress(): string; + + /** + * Gets the value of the property. + */ + function getManufacturer(): string; + + /** + * Gets the value of the property. + */ + function getModel(): string; + + /** + * Gets the value of the property. + */ + function getName(): string; + + /** + * Gets the value of the property. + */ + function getNetmask(): string; + + /** + * Gets the value of the property. + */ + function getOsname(): string; + + /** + * Gets the value of the property. + */ + function getOstype(): string; + + /** + * Gets the value of the property. + */ + function getProcessorCount(): number; + + /** + * Gets the value of the property. + */ + function getRuntime(): string; + + /** + * Gets the value of the property. + */ + function getUsername(): string; + + /** + * Gets the value of the property. + */ + function getVersion(): string; + + /** + * The Display Caps object returned by the property. + */ + interface DisplayCaps extends Titanium.Proxy { + /** + * Logical density of the display. + */ + readonly density: string; + + /** + * Display density expressed as dots-per-inch. + */ + readonly dpi: number; + + /** + * Logical density of the display, as a scaling factor for the Density Independent Pixel (dip) + * unit. + */ + readonly logicalDensityFactor: number; + + /** + * Absolute height of the display in relation to UI orientation. Measured in platform-specific + * units; pixels on Android and density-independent pixels (dip) on iOS. + */ + readonly platformHeight: number; + + /** + * Absolute width of the display in relation to UI orientation. Measured in platform-specific + * units; pixels on Android and density-independent pixels (dip) on iOS. + */ + readonly platformWidth: number; + + /** + * Physical pixels per inch of the display in the X dimension. + */ + readonly xdpi: number; + + /** + * Physical pixels per inch of the display in the Y dimension. + */ + readonly ydpi: number; + + /** + * Gets the value of the property. + */ + getDensity(): string; + + /** + * Gets the value of the property. + */ + getDpi(): number; + + /** + * Gets the value of the property. + */ + getLogicalDensityFactor(): number; + + /** + * Gets the value of the property. + */ + getPlatformHeight(): number; + + /** + * Gets the value of the property. + */ + getPlatformWidth(): number; + + /** + * Gets the value of the property. + */ + getXdpi(): number; + + /** + * Gets the value of the property. + */ + getYdpi(): number; + + } + + + /** + * The Android-specific Platform module, used to access the device's platform-related functionality. + */ + namespace Android { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Android API level identifier of the Operating System. + */ + const API_LEVEL: number; + + /** + * Constant to indicate that the physical size category of the current device/emulator is large + */ + const PHYSICAL_SIZE_CATEGORY_LARGE: number; + + /** + * Constant to indicate that the physical size category of the current device/emulator is normal + */ + const PHYSICAL_SIZE_CATEGORY_NORMAL: number; + + /** + * Constant to indicate that the physical size category of the current device/emulator is small + */ + const PHYSICAL_SIZE_CATEGORY_SMALL: number; + + /** + * Constant to indicate that the physical size category of the current device/emulator is undefined + */ + const PHYSICAL_SIZE_CATEGORY_UNDEFINED: number; + + /** + * Constant to indicate that the physical size category of the current device/emulator is extra large + */ + const PHYSICAL_SIZE_CATEGORY_XLARGE: number; + + /** + * The physical size category of the Android device or emulator. + */ + const physicalSizeCategory: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getPhysicalSizeCategory(): number; + + } + } + + /** + * Stream module containing stream utility methods. + */ + namespace Stream { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Use with [createStream](Titanium.Stream.createStream) to open a stream in read + * mode. + */ + const MODE_READ: number; + + /** + * Use with [createStream](Titanium.Stream.createStream) to open a stream in write + * mode. + */ + const MODE_WRITE: number; + + /** + * Use with [createStream](Titanium.Stream.createStream) to open a stream in append + * mode. + */ + const MODE_APPEND: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Creates stream from a `Buffer` or `Blob` object. + */ + function createStream(params: CreateStreamArgs): Titanium.IOStream; + + /** + * Asynchronously reads data from an [IOStream](Titanium.IOStream) into a buffer. + */ + function read(sourceStream: Titanium.IOStream, buffer: Titanium.Buffer, offset?: number, length?: number, resultsCallback?: (param0: ReadCallbackArgs) => any): void; + + /** + * Reads all data from the specified [IOStream](Titanium.IOStream). + */ + function readAll(sourceStream: Titanium.IOStream, buffer?: Titanium.Buffer, resultsCallback?: (param0: ReadCallbackArgs) => any): Titanium.Buffer | void; + + /** + * Asynchronously writes data from a buffer to an [IOStream](Titanium.IOStream). + */ + function write(outputStream: Titanium.IOStream, buffer: Titanium.Buffer, offset?: number, length?: number, resultsCallback?: (param0: WriteCallbackArgs) => any): void; + + /** + * Writes all data from an input stream to an output stream. + */ + function writeStream(inputStream: Titanium.IOStream, outputStream: Titanium.IOStream, maxChunkSize: number, resultsCallback?: (param0: WriteStreamCallbackArgs) => any): void; + + /** + * Reads data from input stream and passes it to a handler method. + */ + function pump(inputStream: Titanium.IOStream, handler: (param0: PumpCallbackArgs) => any, maxChunkSize: number, isAsync?: boolean): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + } + + /** + * The top-level Utils module, containing a set of JavaScript methods that are often useful when + * building applications. + */ + namespace Utils { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Returns the specified data decoded from Base64. + */ + function base64decode(obj: string): Titanium.Blob; + + /** + * Returns the specified data decoded from Base64. + */ + function base64decode(obj: Titanium.Blob): Titanium.Blob; + + /** + * Returns the specified data decoded from Base64. + */ + function base64decode(obj: Titanium.Filesystem.File): Titanium.Blob; + + /** + * Returns the specified data encoded to Base64. + */ + function base64encode(obj: string): Titanium.Blob; + + /** + * Returns the specified data encoded to Base64. + */ + function base64encode(obj: Titanium.Blob): Titanium.Blob; + + /** + * Returns the specified data encoded to Base64. + */ + function base64encode(obj: Titanium.Filesystem.File): Titanium.Blob; + + /** + * Returns a MD5 digest of the specified data as a hex-based String. + */ + function md5HexDigest(obj: string): string; + + /** + * Returns a MD5 digest of the specified data as a hex-based String. + */ + function md5HexDigest(obj: Titanium.Blob): string; + + /** + * Returns a SHA-1 hash of the specified data as a hex-based String. + */ + function sha1(obj: string): string; + + /** + * Returns a SHA-1 hash of the specified data as a hex-based String. + */ + function sha1(obj: Titanium.Blob): string; + + /** + * Returns a SHA-256 hash of the specified data as a hex-based String. + */ + function sha256(obj: string): string; + + /** + * Returns a SHA-256 hash of the specified data as a hex-based String. + */ + function sha256(obj: Titanium.Blob): string; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + } + + /** + * Used to enable data and file transfers between a watchOS and iOS application. + */ + namespace WatchSession { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Returns the current activation state of the watch. + */ + const activationState: number; + + /** + * The watch is currently not activated. + */ + const ACTIVATION_STATE_NOT_ACTIVATED: number; + + /** + * The watch is currently inactive. + */ + const ACTIVATION_STATE_INACTIVE: number; + + /** + * The watch is currently activated. + */ + const ACTIVATION_STATE_ACTIVATED: number; + + /** + * Returns `true` if there is more content for the session to deliver. + */ + const hasContentPending: boolean; + + /** + * The number of calls remaining to `transferCurrentComplication` before the system starts + * transferring the complicationUserInfo as regular userInfos. + */ + const remainingComplicationUserInfoTransfers: number; + + /** + * Returns `true` if the device supports watch connectivity. + */ + const isSupported: boolean; + + /** + * Returns `true` if the device is paired with a watch. + */ + const isPaired: boolean; + + /** + * Returns `true` if the accompanying watch app is installed. + */ + const isWatchAppInstalled: boolean; + + /** + * Returns `true` if complication is enabled on the installed watch app. + */ + const isComplicationEnabled: boolean; + + /** + * Returns `true` if the watch is currently reachable. + */ + const isReachable: boolean; + + /** + * Returns `true` if the watch is currently activated. + */ + const isActivated: boolean; + + /** + * The most recent application context sent to the watch app. + */ + const recentApplicationContext: any; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Activates the watch session + */ + function activateSession(): void; + + /** + * Sends a message to the apple watch. + */ + function sendMessage(message: any, reply?: (param0: MessageReply) => any): void; + + /** + * Sends an app context update to the apple watch. + */ + function updateApplicationContext(params: any): void; + + /** + * Transfers an user info to the apple watch. + */ + function transferUserInfo(params: any): void; + + /** + * Transfers a file to the apple watch. + */ + function transferFile(params: any): void; + + /** + * Transfers complication data to the watch application. + */ + function transferCurrentComplication(params: any): void; + + /** + * Cancels all incomplete user info and complication transfers to the apple watch. + */ + function cancelAllUserInfoTransfers(): void; + + /** + * Cancels all incomplete file transfers to the apple watch. + */ + function cancelAllFileTransfers(): void; + + /** + * Cancels all incomplete transfers to the apple watch. + */ + function cancelAllTransfers(): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getActivationState(): number; + + /** + * Gets the value of the property. + */ + function getHasContentPending(): boolean; + + /** + * Gets the value of the property. + */ + function getRemainingComplicationUserInfoTransfers(): number; + + /** + * Gets the value of the property. + */ + function getIsSupported(): boolean; + + /** + * Gets the value of the property. + */ + function getIsPaired(): boolean; + + /** + * Gets the value of the property. + */ + function getIsWatchAppInstalled(): boolean; + + /** + * Gets the value of the property. + */ + function getIsComplicationEnabled(): boolean; + + /** + * Gets the value of the property. + */ + function getIsReachable(): boolean; + + /** + * Gets the value of the property. + */ + function getIsActivated(): boolean; + + /** + * Gets the value of the property. + */ + function getRecentApplicationContext(): any; + + } + + /** + * The top level XML module. The XML module is used for parsing and processing XML-based content. + */ + namespace XML { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Parses an XML string into a object. + */ + function parseString(xml: string): Titanium.XML.Document; + + /** + * Serializes a [Node](Titanium.XML.Node) object into a string. + */ + function serializeToString(node: Titanium.XML.Node): string; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Represents an attribute of an [Element](Titanium.XML.Element). + */ + interface Attr extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * Attribute name + */ + readonly name: string; + + /** + * The to which the attribute belongs. + */ + readonly ownerElement: Titanium.XML.Element; + + /** + * True if this attribute was explicitly given a value in the instance document, false otherwise. + */ + readonly specified: boolean; + + /** + * The attribute value as a string. + */ + value: string; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Gets the value of the property. + */ + getOwnerElement(): Titanium.XML.Element; + + /** + * Gets the value of the property. + */ + getSpecified(): boolean; + + /** + * Gets the value of the property. + */ + getValue(): string; + + /** + * Sets the value of the property. + */ + setValue(value: string): void; + + } + + /** + * Used to include blocks of literal text containing characters that would otherwise need + * to be escaped. + */ + interface CDATASection extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * The character data of the node that implements this interface. Throws an exception during setting if this node is readonly. + */ + data: string; + + /** + * The number of characters that are available through data and the substringData method. This may have the value zero, i.e., may be empty. + */ + readonly length: number; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Append the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and the string specified. Throws an exception if this node is readonly. + */ + appendData(arg: string): void; + + /** + * Remove a range of characters from the node. Upon success, data and length reflect the change. Throws an exception if this node is readonly, if offset is negative, offset is beyond the data's length, or if count is negative. + */ + deleteData(offset: number, count: number): void; + + /** + * Insert a string at the specified offset. Throws an exception if this node is readonly, if offset is negative, or if offset is beyond the data's length. + */ + insertData(offset: number, arg: string): void; + + /** + * Replace the characters starting at the specified offset with the specified string. Throws an exception if this node is readonly, if offset is negative, offset is beyond the data's length, or if count is negative. + */ + replaceData(offset: number, count: number, arg: string): void; + + /** + * Extracts a range of data from the node. Throws an exception if offset is negative, offset is beyond the data's length, or if count is negative. + */ + substringData(offset: number, count: number): string; + + /** + * Breaks this node into two nodes at the specified by offset, and returns a new node of the same type, which contains all the content at and after the offset point. Throws an exception if the specified offset is negative or if this node is read only. + */ + splitText(offset: number): Titanium.XML.Text; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getData(): string; + + /** + * Sets the value of the property. + */ + setData(data: string): void; + + /** + * Gets the value of the property. + */ + getLength(): number; + + } + + /** + * An interface extending with a set of attributes and methods for accessing character data in the DOM. + * Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-FF21A306) on Android and iOS. For reasons of compatibility with the javascript engine, text is represented by UTF-8 instead of UTF-16 on Android and iOS. + */ + interface CharacterData extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * The character data of the node that implements this interface. Throws an exception during setting if this node is readonly. + */ + data: string; + + /** + * The number of characters that are available through data and the substringData method. This may have the value zero, i.e., may be empty. + */ + readonly length: number; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Append the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and the string specified. Throws an exception if this node is readonly. + */ + appendData(arg: string): void; + + /** + * Remove a range of characters from the node. Upon success, data and length reflect the change. Throws an exception if this node is readonly, if offset is negative, offset is beyond the data's length, or if count is negative. + */ + deleteData(offset: number, count: number): void; + + /** + * Insert a string at the specified offset. Throws an exception if this node is readonly, if offset is negative, or if offset is beyond the data's length. + */ + insertData(offset: number, arg: string): void; + + /** + * Replace the characters starting at the specified offset with the specified string. Throws an exception if this node is readonly, if offset is negative, offset is beyond the data's length, or if count is negative. + */ + replaceData(offset: number, count: number, arg: string): void; + + /** + * Extracts a range of data from the node. Throws an exception if offset is negative, offset is beyond the data's length, or if count is negative. + */ + substringData(offset: number, count: number): string; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getData(): string; + + /** + * Sets the value of the property. + */ + setData(data: string): void; + + /** + * Gets the value of the property. + */ + getLength(): number; + + } + + /** + * Represents the contents of an XML comment. + */ + interface Comment extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * The character data of the node that implements this interface. Throws an exception during setting if this node is readonly. + */ + data: string; + + /** + * The number of characters that are available through data and the substringData method. This may have the value zero, i.e., may be empty. + */ + readonly length: number; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Append the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and the string specified. Throws an exception if this node is readonly. + */ + appendData(arg: string): void; + + /** + * Remove a range of characters from the node. Upon success, data and length reflect the change. Throws an exception if this node is readonly, if offset is negative, offset is beyond the data's length, or if count is negative. + */ + deleteData(offset: number, count: number): void; + + /** + * Insert a string at the specified offset. Throws an exception if this node is readonly, if offset is negative, or if offset is beyond the data's length. + */ + insertData(offset: number, arg: string): void; + + /** + * Replace the characters starting at the specified offset with the specified string. Throws an exception if this node is readonly, if offset is negative, offset is beyond the data's length, or if count is negative. + */ + replaceData(offset: number, count: number, arg: string): void; + + /** + * Extracts a range of data from the node. Throws an exception if offset is negative, offset is beyond the data's length, or if count is negative. + */ + substringData(offset: number, count: number): string; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getData(): string; + + /** + * Sets the value of the property. + */ + setData(data: string): void; + + /** + * Gets the value of the property. + */ + getLength(): number; + + } + + /** + * The interface provides a number of methods for performing operations that are independent of any particular instance of the document object model.Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490) on Android and iOS. + */ + interface DOMImplementation extends Titanium.Proxy { + /** + * Creates an object of the specified type with its document element. Raises an exception if qualifiedName is malformed, contains an illegal character, or is inconsistent with namespaceURI. Also raises an exception if doctype has already been used with a different document. + */ + createDocument(namespaceURI: string, qualifiedName: string, doctype: Titanium.XML.DocumentType): Titanium.XML.Document; + + /** + * Creates an empty node. Entity declarations and notations are not made available. Entity reference expansions and default attribute additions do not occur. Raises an exception if qualifiedName is malformed or contains an illegal character. + */ + createDocumentType(qualifiedName: string, publicId: string, systemId: string): Titanium.XML.DocumentType; + + /** + * Test if the implements a specific feature. + */ + hasFeature(feature: string, version: string): boolean; + + } + + /** + * The DOM Document returned from . + */ + interface Document extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * An interface to the list of entities that are defined for the document, such as via a Document Type Definition (DTD). + */ + readonly doctype: Titanium.XML.DocumentType; + + /** + * Root element of this document. + */ + readonly documentElement: Titanium.XML.Element; + + /** + * [DOMImplementation](Titanium.XML.DOMImplementation) object associated with this + * document. + */ + readonly implementation: Titanium.XML.DOMImplementation; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Creates an attribute with the given name. + */ + createAttribute(name: string): Titanium.XML.Attr; + + /** + * Creates an attribute with the given name and namespace. + */ + createAttributeNS(namespaceURI: string, name: string): Titanium.XML.Attr; + + /** + * Creates and returns a [CDATASection](Titanium.XML.CDATASection). + */ + createCDATASection(data: string): Titanium.XML.CDATASection; + + /** + * Creates a [Comment](Titanium.XML.Comment) with the supplied string data. + */ + createComment(data: string): Titanium.XML.Comment; + + /** + * Creates an empty [DocumentFragment](Titanium.XML.DocumentFragment). + */ + createDocumentFragment(): Titanium.XML.DocumentFragment; + + /** + * Creates an element with the given tag name. + */ + createElement(tagName: string): Titanium.XML.Element; + + /** + * Create a new element with the given namespace and name. + */ + createElementNS(namespaceURI: string, name: string): Titanium.XML.Element; + + /** + * Creates an [EntityReference](Titanium.XML.EntityReference) with the given name. + */ + createEntityReference(name: string): Titanium.XML.EntityReference; + + /** + * Creates a processing instruction for inserting into the DOM tree. + */ + createProcessingInstruction(target: string, data: string): Titanium.XML.ProcessingInstruction; + + /** + * Creates a text node. + */ + createTextNode(data: string): Titanium.XML.Text; + + /** + * Returns an [Element](Titanium.XML.Element) that has an ID attribute with the given value. + */ + getElementById(elementId: string): Titanium.XML.Element; + + /** + * Returns a node list of elements in the document which have the given tag. + */ + getElementsByTagName(tagname: string): Titanium.XML.NodeList; + + /** + * Returns a node list of elements in the document which belong to the given namespace and have the given tag name. + */ + getElementsByTagNameNS(namespaceURI: string, localname: string): Titanium.XML.NodeList; + + /** + * Imports a node from another document to this document, + * without altering or removing the source node from the original document. + */ + importNode(importedNode: Titanium.XML.Node, deep: boolean): Titanium.XML.Node; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getDoctype(): Titanium.XML.DocumentType; + + /** + * Gets the value of the property. + */ + getDocumentElement(): Titanium.XML.Element; + + /** + * Gets the value of the property. + */ + getImplementation(): Titanium.XML.DOMImplementation; + + } + + /** + * A lightweight document object used as a container for a group of nodes. + */ + interface DocumentFragment extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + } + + /** + * Each has a `doctype` attribute whose value is either 'null' or a object. + */ + interface DocumentType extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * A containing the general entities, both external and internal, declared in the DTD. Parameter entities are not contained. Duplicates are discarded. + */ + readonly entities: Titanium.XML.NamedNodeMap; + + /** + * The internal subset as a string. + */ + readonly internalSubset: string; + + /** + * The name of DTD; i.e., the name immediately following the `DOCTYPE` keyword. + */ + readonly name: string; + + /** + * A containing the notations declared in the DTD. Duplicates are discarded. Every node in this map also implements the interface. + */ + readonly notations: Titanium.XML.NamedNodeMap; + + /** + * The public identifier of the external subset. + */ + readonly publicId: string; + + /** + * The system identifier of the external subset. + */ + readonly systemId: string; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getEntities(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getInternalSubset(): string; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Gets the value of the property. + */ + getNotations(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getPublicId(): string; + + /** + * Gets the value of the property. + */ + getSystemId(): string; + + } + + /** + * Represents an element in a DOM document, a defined by a start-tag and end-tag (or an empty tag). Elements may have [attributes](Titanium.XML.Attr) associated with them. + * Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-745549614) on Android and iOS with some non-standard extensions. + */ + interface Element extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * The name of the element, as defined by its tag. + */ + readonly tagName: string; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Retrieves an attribute value by name, returning it as a string. + */ + getAttribute(name: string): string; + + /** + * Adds a new attribute. Any attribute with the same name is replaced. Throws an exception if the element is read-only, or if the name contains an illegal character. + */ + setAttribute(name: string, value: string): void; + + /** + * Removes an attribute by name. If the attribute has a default value, it is immediately replaced with this default, including namespace URI and local name. Throws an exception if the element is read-only. + */ + removeAttribute(name: string): void; + + /** + * Retrieves an attribute value by name, returning it as a object. + */ + getAttributeNode(name: string): Titanium.XML.Attr; + + /** + * Adds a new attribute. Any attribute with the same `nodeName` as the argument is replaced. Throws an exception if the element is read-only, if `newAttr` is from a different document, or if `newAttr` is already an attribute of another element. + */ + setAttributeNode(newAttr: Titanium.XML.Attr): Titanium.XML.Attr; + + /** + * Removes the specified attribute node. If the removed attribute has a default value, it is replaced immediately, with the same namespace and local name as the removed attribute, if applicable. Throws an exception if the element is read-only, or the attribute is not an attribute of the element. + */ + removeAttributeNode(oldAttr: Titanium.XML.Attr): void; + + /** + * Retrieves a of all descendant elements with a given tag name, in preorder traversal. + */ + getElementsByTagName(name: string): Titanium.XML.NodeList; + + /** + * Retrieves an attribute value by local name and namespace URI, returning it as a string. + */ + getAttributeNS(namespaceURI: string, localName: string): string; + + /** + * Adds a new attribute. Any attribute with the same local name and namespace URI is present on the element is replaced, with its prefix changed to that of the `qualifiedName` parameter. Throws an exception if the element is read-only, if the name contains an illegal character, or if the qualified name contains an error. + */ + setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; + + /** + * Removes an attribute by local name and namespace URI. If the attribute has a default value, it is immediately replaced with this default, including namespace URI and local name. Throws an exception if the element is read-only. + */ + removeAttributeNS(namespaceURI: string, localName: string): void; + + /** + * Retrieves an attribute value by local name and namespace URI, returning it as a object. + */ + getAttributeNodeNS(namespaceURI: string, localName: string): Titanium.XML.Attr; + + /** + * Adds a new attribute. Any attribute with the same local name and namespace URI is replaced. Throws an exception if the element is read-only, if `newAttr` is from a different document, or if `newAttr` is already an attribute of another element. + */ + setAttributeNodeNS(newAttr: Titanium.XML.Attr): Titanium.XML.Attr; + + /** + * Retrieves a of all descendant elements with a given local name and namespace URI, in preorder traversal. + */ + getElementsByTagNameNS(namespaceURI: string, localName: string): Titanium.XML.NodeList; + + /** + * Determines whether or not an attribute with the given name is available in the element, or has a default value. + */ + hasAttribute(name: string): boolean; + + /** + * Determines whether or not an attribute with the given name is available in the element, or has a default value. + */ + hasAttributeNS(namespaceURI: string, localName: string): boolean; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getTagName(): string; + + } + + /** + * This interface represents an entity, either parsed or unparsed, in an XML document. Note that this models the entity itself not the entity declaration. The nodeName attribute that is inherited from Node contains the name of the entity. An Entity node does not have any parent. + * Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-527DCFF2) on Android and iOS. + */ + interface Entity extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * For unparsed entities, the name of the notation for the entity. For parsed entities, this is `null`. + */ + readonly notationName: string; + + /** + * The public identifier associated with the entity, if specified. If the public identifier was not specified, this is `null`. + */ + readonly publicId: string; + + /** + * The system identifier associated with the entity, if specified. If the system identifier was not specified, this is null. + */ + readonly systemId: string; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getNotationName(): string; + + /** + * Gets the value of the property. + */ + getPublicId(): string; + + /** + * Gets the value of the property. + */ + getSystemId(): string; + + } + + /** + * Represents an XML entity reference. + */ + interface EntityReference extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + } + + /** + * A key-value paired map that maps String objects to objects. + * Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1780488922) on Android and iOS. + */ + interface NamedNodeMap extends Titanium.Proxy { + /** + * The number of nodes in the map. The valid range of child node indices is 0-`length`-1, inclusive. + */ + readonly length: number; + + /** + * Retrieves a node specified by name. + */ + getNamedItem(name: string): Titanium.XML.Node; + + /** + * Adds a node using its `nodeName` attribute. If a node with that name is already present, it is replaced. Throws an exception if the argument is from a different document, the map is read-only, or the argument is an attribute of another element. + */ + setNamedItem(node: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Removes a node from the map specified by name. When this map contains attributes attached to an element, if the removed attribtue is known to have a default, it is replaced with that value. + */ + removeNamedItem(name: string): Titanium.XML.Node; + + /** + * Retrieves the node at the specified index of the map. Note that NamedNodeMaps are not ordered. + */ + item(index: number): Titanium.XML.Node; + + /** + * Retrieves a node specified by name and namespace. Returns `null` if no matching node is in the map. + */ + getNamedItemNS(namespaceURI: string, localName: string): Titanium.XML.Node; + + /** + * Adds a node using its `namespaceURI` and `localName` attributes. If a node with that name is already present, it is replaced. Throws an exception if the argument is from a different document, the map is read-only, or the argument is an attribute of another element. + */ + setNamedItemNS(node: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Removes a node from the map specified by local name and namespace URI. When this map contains attributes attached to an element, if the removed attribtue is known to have a default, it is replaced with that value. Returns the node removed from the map, or `null` if there is no corresponding node. + */ + removeNamedItemNS(namespaceURI: string, localName: string): Titanium.XML.Node; + + /** + * Gets the value of the property. + */ + getLength(): number; + + } + + /** + * A single node in the [Document](Titanium.XML.Document) tree. + */ + interface Node extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + } + + /** + * A list of objects. Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-536297177) on Android and iOS. + */ + interface NodeList extends Titanium.Proxy { + /** + * The length of the node list. + */ + readonly length: number; + + /** + * Returns the object at the specified index. + */ + item(index: number): Titanium.XML.Node; + + /** + * Gets the value of the property. + */ + getLength(): number; + + } + + /** + * Represents a notation declared in the DTD. Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-5431D1B9) on Android and iOS. + */ + interface Notation extends Titanium.Proxy { + /** + * The public identifier of this notation. If the public identifier was not specified, this is `null`. + */ + readonly publicId: string; + + /** + * The system identifier of this notation. If the system identifier was not specified, this is `null`. + */ + readonly systemId: string; + + /** + * Gets the value of the property. + */ + getPublicId(): string; + + /** + * Gets the value of the property. + */ + getSystemId(): string; + + } + + /** + * A way to keep processor-specific information in the text of the document. Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1004215813) on Android and iOS. + */ + interface ProcessingInstruction extends Titanium.Proxy { + /** + * Retrieve the content of this processing instruction. This from the first non white space character after the target to the character immediatly preceding the ?>. When setting a processing instruction, a DOMException may be thrown on an invalid instruction. + */ + data: string; + + /** + * Retrieve the target of this processing instruction. XML defines this as being the first token following the markup that begins the processing instruction. + */ + readonly target: string; + + /** + * Gets the value of the property. + */ + getData(): string; + + /** + * Sets the value of the property. + */ + setData(data: string): void; + + /** + * Gets the value of the property. + */ + getTarget(): string; + + } + + /** + * Represents the textual content of an or Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1312295772) on Android and iOS. + */ + interface Text extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * The character data of the node that implements this interface. Throws an exception during setting if this node is readonly. + */ + data: string; + + /** + * The number of characters that are available through data and the substringData method. This may have the value zero, i.e., may be empty. + */ + readonly length: number; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Append the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and the string specified. Throws an exception if this node is readonly. + */ + appendData(arg: string): void; + + /** + * Remove a range of characters from the node. Upon success, data and length reflect the change. Throws an exception if this node is readonly, if offset is negative, offset is beyond the data's length, or if count is negative. + */ + deleteData(offset: number, count: number): void; + + /** + * Insert a string at the specified offset. Throws an exception if this node is readonly, if offset is negative, or if offset is beyond the data's length. + */ + insertData(offset: number, arg: string): void; + + /** + * Replace the characters starting at the specified offset with the specified string. Throws an exception if this node is readonly, if offset is negative, offset is beyond the data's length, or if count is negative. + */ + replaceData(offset: number, count: number, arg: string): void; + + /** + * Extracts a range of data from the node. Throws an exception if offset is negative, offset is beyond the data's length, or if count is negative. + */ + substringData(offset: number, count: number): string; + + /** + * Breaks this node into two nodes at the specified by offset, and returns a new node of the same type, which contains all the content at and after the offset point. Throws an exception if the specified offset is negative or if this node is read only. + */ + splitText(offset: number): Titanium.XML.Text; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getData(): string; + + /** + * Sets the value of the property. + */ + setData(data: string): void; + + /** + * Gets the value of the property. + */ + getLength(): number; + + } + + } + + /** + * The top level Yahoo module. The Yahoo module is used for accessing Yahoo related API services. + */ + namespace Yahoo { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * invoke a Yahoo YQL query + */ + function yql(yql: string, callback: (param0: YQLResponse) => any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + } } - -declare class Dictionary { - -} - -declare class BarItemType { - accessibilityLabel : string; - enabled : boolean; - image : any; - title : string; - width : number; -} - -declare class MatrixCreationDict { - anchorPoint : Dictionary; - rotate : number; - scale : number; -} - -declare class TableViewIndexEntry { - index : number; - title : string; -} - -declare class FacebookRESTResponsev1 { - error : string; - method : string; - result : string; - success : boolean; -} - -declare class titleAttributesParams { - color : string; - font : Font; - shadow : shadowDict; -} - -declare class MapRegionType { - latitude : number; - latitudeDelta : number; - longitude : number; - longitudeDelta : number; -} - -declare class CropRectType { - height : number; - width : number; - x : number; - y : number; -} - -declare class LocationResults extends ErrorResponse { - coords : LocationCoordinates; - provider : LocationProviderDict; -} - -declare class ErrorResponse { - code : number; - error : string; - success : boolean; -} - -declare class CloudPushNotificationsQueryResponse extends CloudResponse { - subscriptions : Array>; -} - -declare class CloudResponse { - code : number; - error : boolean; - message : string; - meta : Dictionary; - success : boolean; -} - -declare enum CloudPushNotificationsResponse { - -} - -declare class textFieldSelectedParams { - length : number; - location : number; -} - -declare class recurrenceEndDictionary { - endDate : Date; - occurrenceCount : number; -} - -declare namespace Global { - export function L (key: string, hint?: string) : string; - export function alert (message: string) : void; - export function clearInterval (timerId: number) : void; - export function clearTimeout (timerId: number) : void; - export function decodeURIComponent (encodedURI: string) : string; - export function encodeURIComponent (string: string) : string; - export function require (moduleId: string) : any; - export function setInterval (_function: (...args : any[]) => any, delay: number) : number; - export function setTimeout (_function: (...args : any[]) => any, delay: number) : number; - export interface console { - debug (message: any) : void; - error (message: any) : void; - info (message: any) : void; - log (message: any) : void; - warn (message: any) : void; - } - export interface String { - format (formatString: string, value: string) : string; - format (formatString: string, value: number) : string; - formatCurrency (value: number) : string; - formatDate (date: Date, format?: string) : string; - formatDecimal (value: number, locale?: string, pattern?: string) : string; - formatTime (date: Date, format?: string) : string; - } - export interface JSON { - parse (text: string, reviver: (...args : any[]) => any) : any; - stringify (value: any, replacer?: (...args : any[]) => any, space?: number) : string; - stringify (value: any, replacer?: Array, space?: string) : string; - stringify (value: any, replacer?: Array, space?: number) : string; - stringify (value: any, replacer?: (...args : any[]) => any, space?: string) : string; - } -} - -declare class CloudGeoFenceResponse extends CloudResponse { - geo_fences : Array>; -} - -declare class ServiceIntentOptions { - startMode : number; - url : string; -} - -declare class AcceptedCallbackArgs { - inbound : Ti.Network.Socket.TCP; - socket : Ti.Network.Socket.TCP; -} - -declare class HeadingData { - accuracy : number; - magneticHeading : number; - timestamp : number; - trueHeading : number; - x : number; - y : number; - z : number; -} - -declare class FacebookGraphResponsev1 { - error : string; - path : string; - result : string; - success : boolean; -} - -declare class textAreaSelectedParams { - length : number; - location : number; -} - -declare class ThumbnailResponse extends ErrorResponse { - image : Ti.Blob; - time : number; -} - -declare class Dimension { - height : number; - width : number; - x : number; - y : number; -} - -declare class ReadCallbackArgs extends ErrorResponse { - bytesProcessed : number; - errorDescription : string; - errorState : number; - source : Ti.IOStream; -} - -declare class CloudACLsCheckResponse extends CloudResponse { - permission : Dictionary; -} - -declare class ViewTemplate { - bindId : string; - childTemplates : Array; - events : Dictionary; - properties : Dictionary; - type : string; -} - -declare class CloudChatsResponse extends CloudResponse { - chats : Array>; -} - -declare class MediaQueryType { - albumArtist : any; - albumTitle : any; - artist : any; - composer : any; - genre : any; - grouping : number; - isCompilation : any; - mediaType : any; - title : any; -} - -declare class WebAPIError { - code : number; - message : string; - name : string; -} - -declare class DocumentViewerOptions { - animated : boolean; - view : Ti.UI.View; -} - -declare class ListViewAnimationProperties { - animated : boolean; - animationStyle : number; - position : number; -} - -declare class CloudPushSchedulesResponse extends CloudResponse { - push_schedules : Array; -} - -declare class DataCallbackArgs { - address : string; - bytesData : Array; - port : string; - stringData : string; -} - -declare class CloudPushNotificationErrorArg { - error : string; -} - -declare class ScreenshotResult { - media : Ti.Blob; -} - -declare class YQLResponse extends ErrorResponse { - data : any; - message : string; -} - -declare class ForwardGeocodeResponse extends ErrorResponse { - accuracy : number; - address : string; - city : string; - country : string; - countryCode : string; - country_code : string; - displayAddress : string; - latitude : string; - longitude : string; - postalCode : string; - region1 : string; - region2 : string; - street : string; - street1 : string; -} - -declare class CloudEventsResponse extends CloudResponse { - events : Array>; -} - -declare class ReadyStatePayload { - readyState : number; -} - -declare class ErrorCallbackArgs { - errorCode : number; - socket : Ti.Network.Socket.TCP; -} - -declare class FailureResponse { - code: Number; - error: string; - success: boolean; -} - -declare class WriteCallbackArgs extends ErrorResponse { - bytesProcessed : number; - errorDescription : string; - errorState : number; - source : Ti.IOStream; -} - -declare class CloudPushNotificationSuccessArg { - deviceToken : string; -} - -declare class MapLocationType { - animate : boolean; - latitude : number; - latitudeDelta : number; - longitude : number; - longitudeDelta : number; - regionFit : boolean; -} - -declare class DecodeStringDict { - charset : string; - length : number; - position : number; - source : Ti.Buffer; -} - -declare class ListViewContentInsetOption { - animated : boolean; - duration : number; -} - -declare class RouteDescription { - inputs : Array; - outputs : Array; -} - -declare class CreateStreamArgs { - mode : number; - source : any; -} - -declare enum ContactsAuthorizationResponse { - -} - -declare class CloudCheckinsResponse extends CloudResponse { - checkins : Array>; -} - -declare class CreateBufferArgs { - byteOrder : number; - length : number; - type : string; - value : any; -} - -declare class CloudPushNotificationConfig { - error : (...args : any[]) => any; - success : (...args : any[]) => any; -} - -declare class CloudReviewsResponse extends CloudResponse { - reviews : Array>; -} - -declare class Point { - x : number; - y : number; -} - -declare class CloudPhotosResponse extends CloudResponse { - photos : Array>; -} - -declare class PushNotificationConfig { - callback : (...args : any[]) => any; - error : (...args : any[]) => any; - success : (...args : any[]) => any; - types : Array; -} - -declare class MapRouteType { - color : string; - name : string; - points : Array; - width : number; -} - -declare class AcceptDict { - error : (...args : any[]) => any; - timeout : number; -} - -declare class MediaQueryInfoType { - exact : boolean; - value : any; -} - -declare class PumpCallbackArgs extends ErrorResponse { - buffer : Ti.Buffer; - bytesProcessed : number; - errorDescription : string; - errorState : number; - source : Ti.IOStream; - totalBytesProcessed : number; -} - -declare class MusicLibraryOptionsType { - allowMultipleSelections : boolean; - animated : boolean; - autohide : boolean; - cancel : (...args : any[]) => any; - error : (...args : any[]) => any; - mediaTypes : any; - success : (...args : any[]) => any; -} - -declare class shadowDict { - blurRadius : number; - color : string; - offset : Dictionary; -} - -declare class launchOptions { - launchOptionsLocationKey : boolean; - source : string; - url : string; -} - -declare class WriteStreamCallbackArgs extends ErrorResponse { - bytesProcessed : number; - errorDescription : string; - errorState : number; - fromStream : Ti.IOStream; - toStream : Ti.IOStream; -} - -declare class CloudChatGroupsResponse extends CloudResponse { - chat_groups : Array>; -} - -declare class CloudPhotoCollectionsPhotosResponse extends CloudResponse { - photos : Array>; -} - -declare class DecodeNumberDict { - byteOrder : number; - position : number; - source : Ti.Buffer; - type : string; -} - -declare class ConnectedCallbackArgs { - socket : Ti.Network.Socket.TCP; -} - -declare class CloudPhotoCollectionsResponse extends CloudResponse { - collections : Array>; -} - -declare class CloudObjectsResponse extends CloudResponse { - classname : Array>; -} - -declare class PopoverParams { - animated : boolean; - rect : Dimension; - view : Ti.UI.View; -} - -declare class MediaScannerResponse { - path : string; - uri : string; -} - -declare class CloudPushNotificationsQueryChannelResponse extends CloudResponse { - push_channels : Array; -} - -declare class CloudPostsResponse extends CloudResponse { - posts : Array>; -} - -declare class CloudSocialIntegrationsResponse extends CloudResponse { - users : Array>; -} - -declare class APSConnectionDelegate { - -} - -declare class CameraOptionsType { - allowEditing : boolean; - animated : boolean; - arrowDirection : number; - autohide : boolean; - autorotate : boolean; - cancel : (...args : any[]) => any; - error : (...args : any[]) => any; - inPopOver : boolean; - mediaTypes : Array; - overlay : Ti.UI.View; - popoverView : Ti.UI.View; - saveToPhotoGallery : boolean; - showControls : boolean; - success : (...args : any[]) => any; - transform : Ti.UI._2DMatrix; - videoMaximumDuration : number; - videoQuality : number; -} - -declare class ListViewIndexEntry { - index : number; - title : string; -} - -declare class CloudStreamProgress { - progress : number; - url : string; -} - -declare class MusicLibraryResponseType { - items : Array; - representative : Ti.Media.Item; - types : number; -} - -declare class CloudEventOccurrencesResponse extends CloudResponse { - event_occurrences : Array>; -} - -declare class CloudUsersResponse extends CloudResponse { - users : Array>; -} - -declare class TableViewContentInsetOption { - animated : boolean; - duration : number; -} - -declare class CloudFriendRequestsResponse extends CloudResponse { - friend_requests : Array>; -} - -declare class CloudACLsResponse extends CloudResponse { - acls : Array>; -} - -declare class ListViewMarkerProps { - itemIndex : number; - sectionIndex : number; -} - -declare class EventsAuthorizationResponse { - code : number; - error : string; - success : boolean; +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudACLsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of ACL objects, if any exist. + */ + acls?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudACLsCheckResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Dictionary of permissions. + */ + permission?: any; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudChatsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `chats` objects, if any exist. + */ + chats?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudChatGroupsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `chat_groups` objects, if any exist. + */ + chat_groups?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudCheckinsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `checkins` objects, if any exist. + */ + checkins?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudClientsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * IP address of client. + */ + ip_address?: string; + + /** + * Location of client. + */ + location?: any; + +} + +/** + * Argument passed to the callback as a request is transmitted or received. + */ +interface CloudStreamProgress { + /** + * A value from 0.0-1.0 with the progress of the exchange. + */ + progress?: number; + + /** + * The URL for the request, to help identify it. + */ + url?: string; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudEmailsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudEventsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `event` objects, if any exist. + */ + events?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudEventOccurrencesResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `event` objects, if any exist. + */ + event_occurrences?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudFilesResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `file` objects, if any exist. + */ + files?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudFriendsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `user` objects, if any exist. + */ + users?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudFriendRequestsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `user` objects, if any exist. + */ + friend_requests?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudGeoFenceResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of geo-fence objects, if any exist. + */ + geo_fences?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudKeyValuesResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `keyvalues` objects, if any exist. + */ + keyvalues?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudLikesResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `like` objects, if any exist. + */ + likes?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudMessagesResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `message` objects, if any exist. + */ + messages?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudObjectsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `classname` objects, if any exist. + */ + classname?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudPhotoCollectionsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `collections` objects, if any exist. + */ + collections?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudPhotoCollectionsPhotosResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `photos` objects, if any exist. + */ + photos?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudPhotosResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `photos` objects, if any exist. + */ + photos?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudPlacesResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `places` objects, if any exist. + */ + places?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudPostsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `posts` objects, if any exist. + */ + posts?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudPushNotificationsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + +} + +/** + * Argument passed to the callback when a request finishes successfully. + */ +interface CloudPushNotificationsQueryChannelResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Array of `push_channel` names, if any exist. + */ + push_channels?: string[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully. + */ +interface CloudPushNotificationsShowChannelResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Dictionary containing counts of devices subscribed to a push channel, grouped by platform. + */ + devices?: any; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudPushNotificationsQueryResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `subscription` objects, if any exist. + */ + subscriptions?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully. + */ +interface CloudPushSchedulesResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Array of [schedules push notifications](http://docs.appcelerator.com/arrowdb/latest/#!/api/PushSchedules), if any exist. + */ + push_schedules?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudReviewsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `reviews` objects, if any exist. + */ + reviews?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudSocialIntegrationsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `users` objects, if any exist. + */ + users?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudStatusesResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `statuses` objects, if any exist. + */ + statuses?: any[]; + +} + +/** + * Properties for the modal dialog used in 3-Legged OAuth + */ +interface CloudUsersSecureDialog { + /** + * Defines the title for the dialog. + */ + title?: string; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudUsersResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `user` objects, if any exist. + */ + users?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudUsersSecureResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Identifies the current access token when using 3-Legged OAuth. + */ + accessToken?: string; + + /** + * Indicates the number of seconds before the access token expires. + */ + expiresIn?: number; + +} + +/** + * Simple object for specifying token retrieval options to [retrieveDeviceToken](Modules.CloudPush.retrieveDeviceToken). + */ +interface CloudPushNotificationConfig { + /** + * Callback function called when the push registration is successfully completed. + */ + success?: (param0: CloudPushNotificationSuccessArg) => any; + + /** + * Callback function called when an error occurs during registration. + */ + error?: (param0: CloudPushNotificationErrorArg) => any; + +} + +/** + * A simple object passed to the [retrieveDeviceToken](Modules.CloudPush.retrieveDeviceToken) success callback. + */ +interface CloudPushNotificationSuccessArg { + /** + * The device token which this device was registered for. + */ + deviceToken?: string; + +} + +/** + * A simple object passed to the [retrieveDeviceToken](Modules.CloudPush.retrieveDeviceToken) error callback. + */ +interface CloudPushNotificationErrorArg { + /** + * Description of the error. + */ + error?: string; + +} + +/** + * Optional Titanium modules. + */ +interface Modules { +} + +/** + * Simple object passed to the + * [startActivityForResult](Titanium.Android.Activity.startActivityForResult) callback. + */ +interface ActivityResult { + /** + * Unique, automatically generated integer request code. + */ + requestCode?: number; + + /** + * Integer result code that the started activity passed to + * [setResult](Titanium.Android.Activity.setResult). + */ + resultCode?: number; + + /** + * Intent that can contain data returned to the caller. Data can be attached to + * the intent as "extras"). + */ + intent?: Titanium.Android.Intent; + +} + +/** + * Options passed to . + */ +interface ServiceIntentOptions { + /** + * URL for the service's JavaScript. + */ + url?: string; + + /** + * One of the `START_` constants from to specify the "stickiness" of the Service when Android shuts down the host application. + */ + startMode?: number; + } -declare class PlayerQueue { - items : Array; +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface RequestPermissionAccessResult { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CalendarPermissionResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code, if any returned. + */ + code?: number; + +} + +/** + * Parameter for wakeLock + */ +interface wakeLockOptions { + /** + * Minimum time the device will be switched on (plus device switch-off time) + */ + time?: number; + + /** + * Wake lock level and flag. See [PowerManager.newWakeLock in the Android API Reference](https://developer.android.com/reference/android/os/PowerManager.html#newWakeLock(int,%20java.lang.String)) + */ + flags?: number; + +} + +/** + * Dictionary of options for the method. + */ +interface showParams { + /** + * String to be used as title for the dialog. + */ + title?: string; + + /** + * String to be used as a message for the dialog. + */ + message?: string; + + /** + * Array of String instances. + */ + buttonNames?: string[]; + + /** + * Array of String instances. + */ + options?: string[]; + + /** + * Determines whether to animate the dialog as it is shown. + */ + animated?: boolean; + + /** + * View to which to attach the dialog. + */ + view?: Titanium.UI.View; + + /** + * Positions the arrow of the option dialog relative to the attached view's dimensions. + */ + rect?: Dimension; + +} + +/** + * Dictionary describing the arguments passed to the application on startup. + * Use the [getArguments](Titanium.App.getArguments) method to retrieve the launch options. + */ +interface launchOptions { + /** + * This key indicates that the application was launched in order to open + * the specified URL. + */ + url?: string; + + /** + * This key indicates that the application was launched by another + * application with the specified bundle ID. + */ + source?: string; + + /** + * If set to `true`, this key indicates that the application was launched in response to an + * incoming location event. + */ + launchOptionsLocationKey?: boolean; + +} + +/** + * Dictionary object of parameters used to create a notification using + * . + */ +interface NotificationParams { + /** + * Alert button text ('Open', by default) or slider text ('slide to unlock...', by default) + * to display. + */ + alertAction?: string; + + /** + * Alert message to display. + */ + alertBody?: string; + + /** + * Alert title to display. Available since Titanium SDK 5.4.0. + */ + alertTitle?: string; + + /** + * Image to display instead of `Default.png` when launching the application. + */ + alertLaunchImage?: string; + + /** + * Application badge value. + */ + badge?: number; + + /** + * String identifier of category of actions to be displayed for an interactive + * notification (only for iOS 8 and above). + */ + category?: string; + + /** + * Date and time for the notification to occur. + */ + date?: Date; + + /** + * Interval to repeat the notification. One of `weekly`, `daily`, `yearly,` `monthly`. + */ + repeat?: string; + + /** + * Path to the sound file to play when notification occurs, relative to the `Resources` folder. + */ + sound?: string; + + /** + * Timezone of the date configured for the notification. If not set, the system timezone is used. + */ + timezone?: string; + + /** + * Data to pass to the application with the notification event. + */ + userInfo?: any; + + /** + * Region the notification will be triggered in. Allowed parameter are: + * - `latitude`: Latitude of the location center, in decimal degrees (required). + * - `longitude`: Longitude of the location center, in decimal degrees (required). + * - `triggersOnce`: Whether or not the notification will only fire once (optional, default: true). + * - `identifier`: Identifier of the region (optional). + */ + region?: any; + +} + +/** + * Dictionary object of parameters used to identify an incoming URL that is handled + * by the application. + */ +interface LaunchOptionsType { + /** + * The application or service that triggered the handled URL. + */ + source?: string; + + /** + * The url that was triggered by the application or service. + */ + url?: string; + +} + +/** + * Dictionary object of parameters used to register the application with local notifications using + * the method. + * To retrieve the current notification settings, use the + * property. + */ +interface UserNotificationSettings { + /** + * Notification types to use. + */ + types?: number[]; + + /** + * Set of categories of user notification actions required by the applicaiton to use. + */ + categories?: Titanium.App.iOS.UserNotificationCategory[]; + +} + +/** + * Simple object used to specify options for [imageAsCropped](Titanium.Blob.imageAsCropped). + */ +interface ImageAsCroppedDict { + /** + * Width to crop this image to. + */ + width?: number; + + /** + * Height to crop this image to. + */ + height?: number; + + /** + * Left coordinate of the cropped rectangle within the source image. + */ + x?: number; + + /** + * Top coordinate of the cropped rectangle within the source image. + */ + y?: number; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface EventsAuthorizationResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code, if any returned. + */ + code?: number; + +} + +/** + * Dictionary containing `daysOfWeek` and `week`. + */ +interface daysOfTheWeekDictionary { + /** + * The day of the week. Values are from 1 to 7, with Sunday being 1. + */ + daysOfWeek?: number; + + /** + * The week number of the day of the week. + * Values range from -53 to 53. A negative value indicates a value from the end of + * the range. 0 indicates the week number is irrelevant. + */ + week?: number; + +} + +/** + * Dictionary containing either `endDate` or `occurrenceCount` property. + */ +interface recurrenceEndDictionary { + /** + * End date of the recurrence end, or undefined if the recurrence end is count-based. + */ + endDate?: Date; + + /** + * Occurrence count of the recurrence end, or 0 if the recurrence end is date-based. + */ + occurrenceCount?: number; + +} + +/** + * Named parameters for . + */ +interface EncodeNumberDict { + /** + * Number to encode. + */ + source: number; + + /** + * Destination buffer. + */ + dest: Titanium.Buffer; + + /** + * Encoding type to use. + */ + type: string; + + /** + * Index in the `dest` buffer of the first byte of encoded data. + */ + position?: number; + + /** + * Byte order to encode with. + */ + byteOrder?: number; + +} + +/** + * Named parameters for . + */ +interface DecodeNumberDict { + /** + * Buffer to decode. + */ + source: Titanium.Buffer; + + /** + * The encoding type to use. + */ + type: string; + + /** + * Index in the `source` buffer of the first byte of data to decode. + */ + position?: number; + + /** + * byte order to decode with. + */ + byteOrder?: number; + +} + +/** + * Named parameters for . + */ +interface EncodeStringDict { + /** + * Source string to encode. + */ + source: string; + + /** + * Destination buffer. + */ + dest: Titanium.Buffer; + + /** + * Index in the `dest` buffer of the first byte of the encoded string. + */ + destPosition?: number; + + /** + * Position in `source` to start encoding. + */ + sourcePosition?: number; + + /** + * Number of characters in `source` to encode. + */ + sourceLength?: number; + + /** + * Character encoding to use when encoding this string to bytes. + */ + charset?: string; + +} + +/** + * Named parameters for . + */ +interface DecodeStringDict { + /** + * Buffer to decode. + */ + source: Titanium.Buffer; + + /** + * Index in the `source` buffer of the first byte of data to decode. + */ + position?: number; + + /** + * Number of bytes to decode. + */ + length?: number; + + /** + * Character set to use when encoding this string to bytes. + */ + charset?: string; + +} + +/** + * Dictionary of options for the method. + */ +interface showContactsParams { + /** + * Determines whether to animate the show/hide of the contacts picker (iPhone, iPad only.) + */ + animated?: boolean; + + /** + * Field names to show when selecting properties. By default, shows all available. + */ + fields?: string[]; + + /** + * Function to call when selection is canceled. + */ + cancel?: (param0: any) => any; + + /** + * Function to call when a person is selected. Must not be used with `selectedProperty` property. + */ + selectedPerson?: (param0: any) => any; + + /** + * Function to call when a property is selected. Must not be used with `selectedPerson` + * property. + * Note: If ringtone or texttone is selected, null values are returned, since these are unsupported + * by Apple. + * Since iOS 9.0, there is a native apple issue whereby it may return null if the birthday property + * is selected on certain device models. + * The callback contains the selected property and a 'person' object of type . + * Since iOS 9.0, apple only returns the person object with partial information. Currently it is known to + * at least contain the selected property and fullName. + */ + selectedProperty?: (param0: any) => any; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface ContactsAuthorizationResponse { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + +} + +/** + * Properties used in any event or callback which needs to report a success or failure. + */ +interface ErrorResponse { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + +} + +/** + * Properties used in any event or callback which needs to report a success. + */ +interface SuccessResponse { + /** + * Indicates if the operation succeeded. Returns `true`. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0. + */ + code?: number; + +} + +/** + * Properties used in any event or callback which needs to report a failure. + */ +interface FailureResponse { + /** + * Indicates if the operation succeeded. Returns `false`. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns a non-zero value. + */ + code?: number; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface RequestStorageAccessResult { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + +} + +/** + * Argument passed to the [getCurrentPosition](Titanium.Geolocation.getCurrentPosition) callback. + */ +interface LocationResults { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + + /** + * If `success` is true, object describing the location provider generating this update. + */ + provider?: LocationProviderDict; + + /** + * If `success` is true, actual location data for this update. + */ + coords?: LocationCoordinates; + +} + +/** + * Simple object holding the data for a location update. + */ +interface LocationCoordinates { + /** + * Latitude of the location update, in decimal degrees. + */ + latitude?: number; + + /** + * Longitude of the location update, in decimal degrees. + */ + longitude?: number; + + /** + * Altitude of the location update, in meters. + */ + altitude?: number; + + /** + * Accuracy of the location update, in meters. + */ + accuracy?: number; + + /** + * Vertical accuracy of the location update, in meters. + */ + altitudeAccuracy?: number; + + /** + * Compass heading, in degrees. May be unknown if device is not moving. On + * iOS, a negative value indicates that the heading data is not valid. + */ + heading?: number; + + /** + * Current speed in meters/second. On iOS, a negative value indicates that the + * heading data is not valid or the accuracy is configured incorrectly. + * Note: Due to the Apple Geolocation API, set the + * property to in order to properly + * measure speed changes and prevent the app from returning negative values. + */ + speed?: number; + + /** + * Timestamp for this location update, in milliseconds. + */ + timestamp?: number; + + /** + * The floor of the building on which the user is located. Available in iOS 8.0 and later. + */ + floor?: LocationCoordinatesFloor; + +} + +/** + * Simple object holding floor of the building on which the user is located. + * In places where floor information can be determined. + */ +interface LocationCoordinatesFloor { + /** + * The logical floor of the building. + */ + level?: number; + +} + +/** + * Simple object returned in the callback from the + * [forwardGeocoder](Titanium.Geolocation.forwardGeocoder) method. + * Note that Android includes a number of extra fields. + */ +interface ForwardGeocodeResponse { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + + /** + * Estimated accuracy of the geocoding, in meters. + */ + accuracy?: number; + + /** + * Longitude of the geocoded address. + */ + longitude?: string; + + /** + * Latitude of the geocoded address. + */ + latitude?: string; + + /** + * Street name, without street address. + */ + street?: string; + + /** + * Street name. + */ + street1?: string; + + /** + * City name. + */ + city?: string; + + /** + * First line of region. + */ + region1?: string; + + /** + * Not used. + */ + region2?: string; + + /** + * Postal code. + */ + postalCode?: string; + + /** + * Country name. + */ + country?: string; + + /** + * Country code. + */ + countryCode?: string; + + /** + * Country code. Same as `countryCode`. + */ + country_code?: string; + + /** + * Display address. Identical to `address`. + */ + displayAddress?: string; + + /** + * Full address. + */ + address?: string; + +} + +/** + * Argument passed to the [getCurrentHeading](Titanium.Geolocation.getCurrentHeading) callback. + */ +interface HeadingResponse { + /** + * Indicates a successful operation. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. + */ + code?: number; + + /** + * If `success` is true, the actual heading data. + */ + heading?: HeadingData; + +} + +/** + * Simple object holding compass heading data. + */ +interface HeadingData { + /** + * Accuracy of the compass heading, in platform-specific units. + */ + accuracy?: number; + + /** + * Declination in degrees from magnetic North. + */ + magneticHeading?: number; + + /** + * Declination in degrees from true North. + */ + trueHeading?: number; + + /** + * Timestamp for the heading data, in milliseconds. + */ + timestamp?: number; + + /** + * Raw geomagnetic data for the X axis. + */ + x?: number; + + /** + * Raw geomagnetic data for the Y axis. + */ + y?: number; + + /** + * Raw geomagnetic data for the Z axis. + */ + z?: number; + +} + +/** + * Simple object describing a location provider. + */ +interface LocationProviderDict { + /** + * Accuracy of the location provider, either fine (1) or coarse (2). + */ + accuracy?: number; + + /** + * Name of the location provider. + */ + name?: string; + + /** + * Power consumption for this provider, either low (1), medium (2), or high (3). + */ + power?: number; + +} + +/** + * Simple object returned in the callback from the + * [reverseGeocoder](Titanium.Geolocation.reverseGeocoder) method. + */ +interface ReverseGeocodeResponse { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + + /** + * An array of reverse-geocoded addresses matching the requested location. + */ + places?: GeocodedAddress[]; + +} + +/** + * Simple object representing a place, returned in the callback from the + * [reverseGeocoder](Titanium.Geolocation.reverseGeocoder) method. + */ +interface GeocodedAddress { + /** + * Street name, without street address. + */ + street?: string; + + /** + * Street name. + */ + street1?: string; + + /** + * City name. + */ + city?: string; + + /** + * First line of region. + */ + region1?: string; + + /** + * Not used. + */ + region2?: string; + + /** + * Postal code. On iOS, use `zipcode`. + */ + postalCode?: string; + + /** + * Postal code. On Android, use `postalCode`. + */ + zipcode?: string; + + /** + * Country name. + */ + country?: string; + + /** + * Country code. On iOS, use `country_code`. + */ + countryCode?: string; + + /** + * Country code. Same as `country_code`. + */ + country_code?: string; + + /** + * Longitude of the geocoded point. + */ + longitude?: string; + + /** + * Latitude of the geocoded point. + */ + latitude?: string; + + /** + * Display address. Identical to `address`. + */ + displayAddress?: string; + + /** + * Full address. + */ + address?: string; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface LocationAuthorizationResponse { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + +} + +/** + * Simple object representing a map location and zoom level. + */ +interface MapRegionType { + /** + * Longitude value for the center point of the map, in decimal degrees. + */ + longitude?: number; + + /** + * Latitude value for the center point of the map, in decimal degrees. + */ + latitude?: number; + + /** + * The amount of east-to-west distance displayed on the map, measured in decimal degrees. + */ + longitudeDelta?: number; + + /** + * The amount of north-to-south distance displayed on the map, measured in decimal degrees. + */ + latitudeDelta?: number; + +} + +/** + * Simple object used as an argument to [setLocation](Titanium.Map.View.setLocation). + */ +interface MapLocationType { + /** + * Longitude value for the center point of the map, in decimal degrees. + */ + longitude?: number; + + /** + * Latitude value for the center point of the map, in decimal degrees. + */ + latitude?: number; + + /** + * The amount of east-to-west distance displayed on the map, measured in decimal degrees. + */ + longitudeDelta?: number; + + /** + * The amount of north-to-south distance displayed on the map, measured in decimal degrees. + */ + latitudeDelta?: number; + + /** + * Set to `true` to animate the move to the new location. + */ + animate?: boolean; + + /** + * If `true`, the specified region is modified to fit the aspect ratio of the + * map view, while remaining centered on `latitude`,`longitude`. + */ + regionFit?: boolean; + +} + +/** + * Simple object defining a map route. + */ +interface MapRouteType { + /** + * Route name. + */ + name: string; + + /** + * Array of map points making up the route. + */ + points: MapPointType[]; + + /** + * Color to use when drawing the route, as a color name or hex triplet. + */ + color?: string; + + /** + * Line width to use when drawing the route. + */ + width?: number; + +} + +/** + * Simple object representing a point on the map. + */ +interface MapPointType { + /** + * Longitude value of the map point, in decimal degrees. + */ + longitude?: number; + + /** + * Latitude value of the map point, in decimal degrees. + */ + latitude?: number; + +} + +/** + * Simple object passed to the [scanMediaFiles](Titanium.Media.Android.scanMediaFiles) callback. + */ +interface MediaScannerResponse { + /** + * Path to the media file that was scanned. + */ + path?: string; + + /** + * URI to the file if it was scanned and added to the media library, or `null` + * if the file was not added. + */ + uri?: string; + +} + +/** + * Simple object for specifying options to [openMusicLibrary](Titanium.Media.openMusicLibrary). + */ +interface MusicLibraryOptionsType { + /** + * Function to call when the music library selection is made. + */ + success?: (param0: MusicLibraryResponseType) => any; + + /** + * Function to call upon receiving an error. + */ + error?: (param0: FailureResponse) => any; + + /** + * Function to call if the user presses the cancel button. + */ + cancel?: (param0: FailureResponse) => any; + + /** + * Specifies that the library should be hidden automatically after media selection is completed. + */ + autohide?: boolean; + + /** + * Boolean if the dialog should be animated when showing and hiding. + */ + animated?: boolean; + + /** + * An array of media type constants defining selectable media. + */ + mediaTypes?: number | number[]; + + /** + * Set to `true` to allow the user to select multiple items from the library. + */ + allowMultipleSelections?: boolean; + +} + +/** + * Simple object passed to the [openMusicLibrary](Titanium.Media.openMusicLibrary) + * `success` callback function. + */ +interface MusicLibraryResponseType { + /** + * A single representative of the selected items. + */ + representative?: Titanium.Media.Item; + + /** + * A list of all the items chosen by the user. + */ + items?: Titanium.Media.Item[]; + + /** + * Media types in this collection, represented as the bitwise OR of the media type + * values for all media types represented in `items`. + */ + types?: number; + +} + +/** + * A specifier for a media library query. By default, filters perform an exact match. + */ +interface MediaQueryType { + /** + * A constant that specifies the ordering of the result array. + */ + grouping?: number; + + /** + * The media type to filter on. + */ + mediaType?: MediaQueryInfoType | number; + + /** + * The title to filter on. Value should be a String. + */ + title?: MediaQueryInfoType | string; + + /** + * The album title to filter on. Value should be a String. + */ + albumTitle?: MediaQueryInfoType | string; + + /** + * The artist to filter on. Value should be a String. + */ + artist?: MediaQueryInfoType | string; + + /** + * The album artist to filter on. Value should be a String. + */ + albumArtist?: MediaQueryInfoType | string; + + /** + * The genre to filter on. Value should be a String. + */ + genre?: MediaQueryInfoType | string; + + /** + * The composer to filter on. Value should be a String. + */ + composer?: MediaQueryInfoType | string; + + /** + * Filter by whether or not the item is a compilation. + * The value should be a Boolean. + */ + isCompilation?: MediaQueryInfoType | boolean; + + /** + * The play count to filter on. Value should be a Number. + */ + playCount?: MediaQueryInfoType | number; + + /** + * The persistent ID to filter on. Value should be a Number. + */ + persistentID?: MediaQueryInfoType | number; + + /** + * The album persistent ID to filter on. Value should be a Number. + */ + albumPersistentID?: MediaQueryInfoType | number; + + /** + * The album artist persistent ID to filter on. Value should be a Number. + */ + albumArtistPersistentID?: MediaQueryInfoType | number; + + /** + * The genre persistent ID to filter on. Value should be a Number. + */ + genrePersistentID?: MediaQueryInfoType | number; + + /** + * The composer persistent ID to filter on. Value should be a Number. + */ + composerPersistentID?: MediaQueryInfoType | number; + + /** + * Filter by whether or not the item is a cloud item. + * Value should be a Boolean. + */ + isCloudItem?: MediaQueryInfoType | boolean; + + /** + * Filter by whether or not the item is a protected asset. + * Value should be a Boolean. + */ + hasProtectedAsset?: MediaQueryInfoType | boolean; + + /** + * The podcast title to filter on. Value should be a String. + */ + podcastTitle?: MediaQueryInfoType | string; + + /** + * The podcast persistent ID to filter on. Value should be a Number. + */ + podcastPersistentID?: MediaQueryInfoType | number; + +} + +/** + * A full query descriptor for a filtering predicate. + */ +interface MediaQueryInfoType { + /** + * The value for the given predicate. See the descriptions in for information about which properties require which values. + */ + value?: number | string | boolean; + + /** + * Whether or not the predicate is for an exact match. The default is `true`. + */ + exact?: boolean; + +} + +/** + * Simple object for specifying options to [showCamera](Titanium.Media.showCamera). + */ +interface CameraOptionsType { + /** + * Function to call when the camera is closed after a successful capture/selection. + */ + success?: (param0: CameraMediaItemType) => any; + + /** + * Function to call upon receiving an error. + */ + error?: (param0: FailureResponse) => any; + + /** + * Function to call if the user presses the cancel button. + */ + cancel?: (param0: FailureResponse) => any; + + /** + * Specifies if the camera should be hidden automatically after the media capture is completed. + */ + autohide?: boolean; + + /** + * Specifies if the dialog should be animated upon showing and hiding. + */ + animated?: boolean; + + /** + * Specifies if the media should be saved to the photo gallery upon successful capture. + */ + saveToPhotoGallery?: boolean; + + /** + * Specifies if the media should be editable after capture/selection. + */ + allowEditing?: boolean; + + /** + * Array of media type constants to allow. Note: If you want to select live photos, iOS only allows + * you to select existing live photos from the gallery, capturing new live photos is not supported by + * iOS public API, yet. + */ + mediaTypes?: string[]; + + /** + * Maximum duration (in milliseconds) to allow video capture before completing. + */ + videoMaximumDuration?: number; + + /** + * Constant to indicate the video quality during capture. + */ + videoQuality?: number; + + /** + * Opens the camera with the specified camera direction. + */ + whichCamera?: number; + + /** + * Indicates if the built-in camera controls should be displayed. + */ + showControls?: boolean; + + /** + * View to added as an overlay to the camera UI (on top). + */ + overlay?: Titanium.UI.View; + + /** + * Transformation matrix to apply to the camera or photogallery view. + */ + transform?: Titanium.UI.Matrix2D; + + /** + * Show the camera in a popover. + */ + inPopOver?: boolean; + + /** + * View to position the camera or photo gallery popover on top of. + */ + popoverView?: Titanium.UI.View; + + /** + * Controls the type of arrow and position of the popover. + */ + arrowDirection?: number; + + /** + * Determines if the camera preview should rotate or not. + */ + autorotate?: boolean; + +} + +/** + * Simple object for specifying options to + * [openPhotoGallery](Titanium.Media.openPhotoGallery). + */ +interface PhotoGalleryOptionsType { + /** + * Function to call when the photo gallery is closed after a successful selection. + */ + success?: (param0: CameraMediaItemType) => any; + + /** + * Function to call upon receiving an error. + */ + error?: (param0: FailureResponse) => any; + + /** + * Function to call if the user presses the cancel button. + */ + cancel?: (param0: FailureResponse) => any; + + /** + * Specifies if the photo gallery should be hidden automatically after the media + * selection is completed. + */ + autohide?: boolean; + + /** + * Specifies if the dialog should be animated upon showing and hiding. + */ + animated?: boolean; + + /** + * Specifies if the media should be editable after capture/selection. + */ + allowEditing?: boolean; + + /** + * Array of media type constants to allow. If you want to allow live photos with + * on iOS 9.1 and later, you also need to specify + * at least as a fallback. If you do not allow live + * photos, they still can be selected, but will be represented as a normal photo (static). + */ + mediaTypes?: string[]; + + /** + * View to position the photo gallery popover on top of. + */ + popoverView?: Titanium.UI.View; + + /** + * Controls the type of arrow and position of the popover. + */ + arrowDirection?: number; + + /** + * Specifies if the user should be able to select multiple photos. + */ + allowMultiple?: boolean; + +} + +/** + * A media object from the camera or photo gallery. + */ +interface CameraMediaItemType { + /** + * Indicates if the operation succeeded. Returns `true`. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0. + */ + code?: number; + + /** + * The media object, as a [Blob](Titanium.Blob). + */ + media?: Titanium.Blob; + + /** + * The type of media, either `MEDIA_TYPE_PHOTO`, `MEDIA_TYPE_LIVEPHOTO` or `MEDIA_TYPE_VIDEO` defined in . + */ + mediaType?: string; + + /** + * Simple object defining the user's selected crop rectangle, or `null` if the user has not edited the photo. + */ + cropRect?: CropRectType; + + /** + * Simple object defining the preview image size. + */ + previewRect?: PreviewRectType; + + /** + * The live photo object, as a and + * `undefined` if no live photo is selected. + */ + livePhoto?: Titanium.UI.iOS.LivePhoto; + +} + +/** + * Simple object for describing the crop rectangle for an image. + */ +interface CropRectType { + /** + * X coordinate of the crop rectangle's upper-left corner. + */ + x?: number; + + /** + * Y coordinate of the crop rectangle's upper-left corner. + */ + y?: number; + + /** + * Width of the crop rectangle, in pixels. + */ + width?: number; + + /** + * Height of the crop rectangle, in pixels. + */ + height?: number; + +} + +/** + * Simple object for describing the preview image rectangle. This will be undefined when custom camera overlay is not used. + */ +interface PreviewRectType { + /** + * Width preview image, in pixels. + */ + width?: number; + + /** + * Height preview image, in pixels. + */ + height?: number; + +} + +/** + * Options passed to . + */ +interface PreviewImageOptions { + /** + * The image to preview. Must be a blob based on a file, such as from . + */ + image?: Titanium.Blob; + + /** + * Function to be called back if the preview succeeds. No info is passed. + */ + success?: (param0: any) => any; + + /** + * Function called back if the preview fails. Check the `message` property of passed back parameter. + */ + error?: (param0: PreviewImageError) => any; + +} + +/** + * The parameter passed to the `error` callback of . + */ +interface PreviewImageError { + /** + * Indicates if the operation succeeded. Returns `false`. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code, if applicable. + */ + code?: number; + + /** + * Description of the error. + */ + message?: string; + +} + +/** + * The parameter passed to the callback. + */ +interface ScreenshotResult { + /** + * The screenshot image. + */ + media?: Titanium.Blob; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface MediaAuthorizationResponse { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface RequestCameraAccessResult { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface RequestMusicLibraryAccessResult { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface RequestPhotoGalleryAccessResult { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + +} + +/** + * An Object describing the current audio route. + */ +interface RouteDescription { + /** + * An Array of current input ports for the session. See the `AUDIO_SESSION_PORT` constants. + */ + inputs?: any[]; + + /** + * An Array of current output ports for the session. See the `AUDIO_SESSION_PORT` constants. + */ + outputs?: any[]; + +} + +/** + * Simple object passed to the thumbnail callback in response to the + * [requestThumbnailImagesAtTimes](Titanium.Media.VideoPlayer.requestThumbnailImagesAtTimes) + * method. + */ +interface ThumbnailResponse { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + + /** + * Thumbnail image, as a `Blob`. + */ + image?: Titanium.Blob; + + /** + * Time offset for the thumbnail, in seconds. + */ + time?: number; + +} + +/** + * Simple object used to describe the size of a movie. + */ +interface MovieSize { + /** + * Width of the movie. + */ + width?: number; + + /** + * Height of the movie. + */ + height?: number; + +} + +/** + * The protocol that the must implement. + */ +interface SecurityManagerProtocol { + /** + * Returns if the security manager will participate in authentication of this end point. + */ + willHandleURL(url: any): boolean; + + /** + * The for this connection. + */ + connectionDelegateForUrl(url: any): APSConnectionDelegate; + + /** + * Returns an array of objects implementing the [X509TrustManager](http://developer.android.com/reference/javax/net/ssl/X509TrustManager.html) protocol for the SSL Context. + */ + getTrustManagers(proxy: any): any[]; + + /** + * Returns an array of objects implementing the [X509KeyManager](http://developer.android.com/reference/javax/net/ssl/X509KeyManager.html) protocol for the SSL Context. + */ + getKeyManagers(proxy: any): any[]; + +} + +/** + * An extension of the [NSURLConnectionDelegate](https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLConnectionDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/NSURLConnectionDelegate) protocol to allow users to participate in authentication and resource management for this HTTPClient. + */ +interface APSConnectionDelegate { +} + +/** + * An Object describing the current ready state. See [onreadystatechange](Titanium.Network.HTTPClient.onreadystatechange) for more information. + */ +interface ReadyStatePayload { + /** + * The state for which `onreadystatechange` was invoked. Set to one of `Titanium.Network.HTTPClient` ready-state constants + */ + readyState?: number; + +} + +/** + * Simple object for specifying push notification options to + * [registerForPushNotifications](Titanium.Network.registerForPushNotifications). + */ +interface PushNotificationConfig { + /** + * Array of `NOTIFICATION_TYPE` constants that the application would like to receive. + */ + types?: number[]; + + /** + * Callback function called when the push registration is successfully completed. + */ + success?: (param0: PushNotificationSuccessArg) => any; + + /** + * Callback function called when an error occurs during registration. + */ + error?: (param0: PushNotificationErrorArg) => any; + + /** + * Callback function invoked upon receiving a new push notification. + */ + callback?: (param0: PushNotificationData) => any; + +} + +/** + * A simple object passed to the + * [registerForPushNotifications](Titanium.Network.registerForPushNotifications) success callback. + */ +interface PushNotificationSuccessArg { + /** + * Indicates if the operation succeeded. Returns `true`. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0. + */ + code?: number; + + /** + * The value of this string is always "remote". + */ + type?: string; + + /** + * The device token which this device was registered for. + */ + deviceToken?: string; + +} + +/** + * A simple object passed to the + * [registerForPushNotifications](Titanium.Network.registerForPushNotifications) error callback. + */ +interface PushNotificationErrorArg { + /** + * Indicates if the operation succeeded. Returns `false`. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns a non-zero value. + */ + code?: number; + + /** + * The value of this string is always "remote". + */ + type?: string; + +} + +/** + * A simple object representing a push notification. + */ +interface PushNotificationData { + /** + * The `userinfo` dictionary passed to the Apple Push Notification Service. + */ + data?: any; + + /** + * Boolean indicating if notification was received while app was in background. + * This property became available in Titanium Mobile 3.1.0 for iOS. + */ + inBackground?: boolean; + +} + +/** + * Argument object passed to the [connected](Titanium.Network.Socket.TCP.connected) callback when the socket connects. + */ +interface ConnectedCallbackArgs { + /** + * Socket instance that has been connected. + */ + socket?: Titanium.Network.Socket.TCP; + +} + +/** + * Object passed to the error callback when the socket enters the [ERROR](Titanium.Network.Socket.ERROR) state. + */ +interface ErrorCallbackArgs { + /** + * Indicates if the operation succeeded. Returns `false`. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns a non-zero value. + */ + code?: number; + + /** + * Socket that experienced the error. + */ + socket?: Titanium.Network.Socket.TCP; + + /** + * The error code of the error (potentially system-dependent). + */ + errorCode?: number; + +} + +/** + * Argument object passed to the [accepted](Titanium.Network.Socket.TCP.accepted) + * callback when a listener accepts a connection. + */ +interface AcceptedCallbackArgs { + /** + * Socket which received the connection. + */ + socket?: Titanium.Network.Socket.TCP; + + /** + * Socket which represents the inbound connection. + */ + inbound?: Titanium.Network.Socket.TCP; + +} + +/** + * Options object for the [accept](Titanium.Network.Socket.TCP.accept) method. + */ +interface AcceptDict { + /** + * Timeout, in milliseconds, for all `write` operations. + */ + timeout?: number; + + /** + * Callback to be fired when the socket enters the [ERROR](Titanium.Network.Socket.ERROR) state. + */ + error?: (param0: ErrorCallbackArgs) => any; + +} + +/** + * Argument passed to [createStream](Titanium.Stream.createStream). + */ +interface CreateStreamArgs { + /** + * Object that the stream will read from or write to. + */ + source?: Titanium.Blob | Titanium.Buffer; + + /** + * Mode to open the stream in. + */ + mode?: number; + +} + +/** + * Argument passed to the read callback when an asynchronous [read](Titanium.Stream.read) operation + * finishes. + */ +interface ReadCallbackArgs { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + + /** + * Stream being read. + */ + source?: Titanium.IOStream; + + /** + * Number of bytes processed, or -1 in the event of an error or end of stream. + */ + bytesProcessed?: number; + + /** + * Whether an error was encountered. Set to 1 in the case of an error, 0 + * otherwise. + */ + errorState?: number; + + /** + * Text description of the error. + */ + errorDescription?: string; + +} + +/** + * Argument passed to the write callback when an asynchronous + * [write](Titanium.Stream.write) operation + * finishes. + */ +interface WriteCallbackArgs { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + + /** + * Stream being written to. + */ + source?: Titanium.IOStream; + + /** + * Number of bytes processed, or -1 in the event of an error or end of stream. + */ + bytesProcessed?: number; + + /** + * Whether an error was encountered. Set to 1 in the case of an error, 0 + * otherwise. + */ + errorState?: number; + + /** + * Text description of the error. + */ + errorDescription?: string; + +} + +/** + * Argument passed to the callback when an asynchronous + * [writeStream](Titanium.Stream.writeStream) operation finishes. + */ +interface WriteStreamCallbackArgs { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + + /** + * Stream being read from. + */ + fromStream?: Titanium.IOStream; + + /** + * Stream being written to. + */ + toStream?: Titanium.IOStream; + + /** + * Number of bytes processed, or -1 in the event of an error or end of stream. + */ + bytesProcessed?: number; + + /** + * Whether an error was encountered. Set to 1 in the case of an error, 0 + * otherwise. + */ + errorState?: number; + + /** + * Text description of the error. + */ + errorDescription?: string; + +} + +/** + * Argument passed to the callback each time the + * [pump](Titanium.Stream.pump) operation has new data to deliver. + */ +interface PumpCallbackArgs { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + + /** + * Stream being read from. + */ + source?: Titanium.IOStream; + + /** + * Buffer object holding the data currently being pumped to the handler method. + */ + buffer?: Titanium.Buffer; + + /** + * Number of bytes being passed to this invocation of the handler, or + * -1 in the event of an error or end of stream. + */ + bytesProcessed?: number; + + /** + * Total number of bytes read from the stream so far, + * including the data passed to this current invocation of the handler. + */ + totalBytesProcessed?: number; + + /** + * Whether an error was encountered. Set to 1 in the case of an error, 0 + * otherwise. + */ + errorState?: number; + + /** + * Text description of the error. + */ + errorDescription?: string; + +} + +/** + * Arguments to be passed to createBuffer + */ +interface CreateBufferArgs { + /** + * An initial value which will be encoded and placed in the buffer. If value is a Number, type must also be set. (this is simply a convenient way of calling or and placing the encoded value in the returned buffer.) + */ + value?: string | number; + + /** + * The length of the buffer. + */ + length?: number; + + /** + * The type of data encoding to use with `value`. + */ + type?: string; + + /** + * The byte order of this buffer. + */ + byteOrder?: number; + +} + +/** + * Simple object passed to to initialize a matrix. + */ +interface MatrixCreationDict { + /** + * Scale the matrix by the specified scaling factor. The same scaling factor is used + * for both horizontal and vertical scaling. + */ + scale?: number; + + /** + * Rotation angle, in degrees. See the [rotate](Titanium.UI.2DMatrix.rotate) method + * for a discussion of rotation. + */ + rotate?: number; + + /** + * Point to rotate around, specified as a dictionary object with `x` and `y` + * properties, where { x: 0.5, y: 0.5 } represents the center of whatever is being + * rotated. + */ + anchorPoint?: any; + +} + +/** + * An abstract datatype for specifying an attributed string attribute. + */ +interface Attribute { + /** + * Attribute to apply to the text. + */ + type: number; + + /** + * Attribute value. + */ + value: number; + + /** + * Attribute range. + */ + range: number[]; + } + +/** + * Dictionary describing the items for . + */ +interface ClipboardItemsType { + /** + * An array of key-value items to add to the clipboard. The key must a valid mime-type + * matching the mime-type of the value. + */ + items?: any[]; + + /** + * The privacy options to apply to all the items on the clipboard. The available options are + * described in `Ti.UI.CLIPBOARD_OPTION_*`. Depending on the key, the value can be a Date or + * Boolean. + */ + options?: any; -declare class CoverFlowImageType { - height : number; - image : any; - width : number; } + +/** + * An abstract datatype for specifying a text font. + */ +interface Font { + /** + * Specifies the font family or specific font to use. + */ + fontFamily?: string; + + /** + * Font size, in platform-dependent units. + */ + fontSize?: number | string; + + /** + * Font weight. Valid values are "bold", "semibold", "normal", "thin", + * "light" and "ultralight". + */ + fontWeight?: string; + + /** + * Font style. Valid values are "italic" or "normal". + */ + fontStyle?: string; -declare class BroadcastIntentOptions { - action : string; - className : string; - data : string; - flags : number; - packageName : string; - url : string; + /** + * The text style for the font. + */ + textStyle?: string; + } + +/** + * Template that represents the basic appearance of a list item. + */ +interface ItemTemplate { + /** + * Contains key-value pairs of view properties and their values that are applied to the ListItem. + */ + properties?: any; + + /** + * Contains key-value pairs of view events and their listeners that are applied to the ListItem. + */ + events?: any; + + /** + * Contains an array of subview templates to be added (in order) as children to this view. + */ + childTemplates?: ViewTemplate[]; -declare class CloudUsersSecureResponse extends CloudResponse { - accessToken : string; - expiresIn : number; } + +/** + * Template that represents a view subcomponent of an . + */ +interface ViewTemplate { + /** + * View's class name, for example, `Ti.UI.Button`. + */ + type: string; + + /** + * View's ID (or set of IDs) used for data binding. This value must be unique. + */ + bindId?: string; + + /** + * Contains key-value pairs of view properties and their values that are applied to this view component. + */ + properties?: any; + + /** + * Contains key-value pairs of view events and their listeners that are applied to this view component. + */ + events?: any; -declare class CloudClientsResponse extends CloudResponse { - ip_address : string; - location : Dictionary; + /** + * Contains an array of subview templates to be added (in order) as children to this view. + */ + childTemplates?: ViewTemplate[]; + } + +/** + * Represents displayed item data. + */ +interface ListDataItem { + /** + * Template ID configured with the property or + * . + */ + template?: string | number; -declare class PushNotificationErrorArg { - type : string; + /** + * Contains key-value pairs of view properties and their values that are applied to the + * `ListItem`. + */ + properties?: any; + } + +/** + * Represents the custom edit action for a ListItem. + */ +interface RowActionType { + /** + * The title of the row action. + */ + title: string; -declare class CloudStatusesResponse extends CloudResponse { - statuses : Array>; + /** + * The [identifier](RowActionType. identifier) of the row action. Only included in the event + * if previously defined. Available in Titanium 6.0.0 and later. + */ + identifier?: string; + + /** + * The style of the row action. + */ + style: number; + + /** + * The background color of the row action. + */ + color?: string; + } + +/** + * A simple object for specifying the animation properties to use when inserting or deleting + * sections or cells, or scrolling the list. + */ +interface ListViewAnimationProperties { + /** + * Whether this list change should be animated. Ignored if any `animationStyle` value is specified. + */ + animated?: boolean; -declare class windowToolbarParam { - animated : boolean; - barColor : string; - tintColor : string; - translucent : boolean; + /** + * Type of animation to use for cell insertions and deletions. + */ + animationStyle?: number; + + /** + * Specifies what position to scroll the selected cell to. + */ + position?: number; + } + +/** + * A simple object that represents an index entry in a `ListView`. + */ +interface ListViewIndexEntry { + /** + * Title to display in the index bar. + */ + title?: string; + + /** + * Section index associated with this title. + */ + index?: number; -declare class GeocodedAddress { - address : string; - city : string; - country : string; - countryCode : string; - country_code : string; - displayAddress : string; - latitude : string; - longitude : string; - postalCode : string; - region1 : string; - region2 : string; - street : string; - street1 : string; - zipcode : string; } -declare class ContactsCallbackArgs extends ErrorResponse { - data : Array; +/** + * Optional parameter for [setContentInsets](Titanium.UI.ListView.setContentInsets) method. + */ +interface ListViewContentInsetOption { + /** + * Determines whether the list view's content inset change is animated. + */ + animated?: boolean; + + /** + * The duration in `milliseconds` for animation while the content inset is being changed. + */ + duration?: number; + } + +/** + * The parameter for [setMarker](Titanium.UI.ListView.setMarker) and [addMarker](Titanium.UI.ListView.addMarker) methods. + */ +interface ListViewMarkerProps { + /** + * The sectionIndex of the reference item. + */ + sectionIndex?: number; + + /** + * The itemIndex of the reference item. + */ + itemIndex?: number; -declare class zoomScaleOption { - animated : boolean; } -declare class LocationCoordinates { - accuracy : number; - altitude : number; - altitudeAccuracy : number; - heading : number; - latitude : number; - longitude : number; - speed : number; - timestamp : number; -} +/** + * The parameter for [setContentInsets](Titanium.UI.TableView.setContentInsets) method. + */ +interface ListViewEdgeInsets { + /** + * Value specifying the top insets for the enclosing scroll view of the list view. + */ + top?: number; + + /** + * Value specifying the left insets for the enclosing scroll view of the list view. + */ + left?: number; -declare class ActivityResult { - intent : Ti.Android.Intent; - requestCode : number; - resultCode : number; -} + /** + * Value specifying the right insets for the enclosing scroll view of the list view. + */ + right?: number; + + /** + * Value specifying the bottom insets for the enclosing scroll view of the list view. + */ + bottom?: number; + +} -declare class CloudUsersSecureDialog { - title : string; -} +/** + * The arguments for the and events. + */ +interface ListItemEventType { + /** + * List section if the item is contained in a list section. + */ + section?: Titanium.UI.ListSection; -declare class CloudFriendsResponse extends CloudResponse { - users : Array>; -} - -declare class PhotoGalleryOptionsType { - allowEditing : boolean; - animated : boolean; - arrowDirection : number; - autohide : boolean; - cancel : (...args : any[]) => any; - error : (...args : any[]) => any; - mediaTypes : Array; - popoverView : Ti.UI.View; - success : (...args : any[]) => any; -} - -declare class NotificationParams { - alertAction : string; - alertBody : string; - alertLaunchImage : string; - badge : number; - category : string; - date : Date; - repeat : string; - sound : string; - timezone : string; - userInfo : Dictionary; -} + /** + * Section index. + */ + sectionIndex?: number; -declare enum SuccessResponse { + /** + * Item index. + */ + itemIndex?: number; -} + /** + * The item ID bound to the list item that generated the event. + */ + itemId?: string; -declare class daysOfTheWeekDictionary { - daysOfWeek : number; - week : number; } -declare class Modules { +/** + * Dictionary of options for the method. + */ +interface hideParams { + /** + * Determines whether to animate the dialog as it is dismissed. + */ + animated?: boolean; -} +} -declare class ReferenceInsets { - bottom : number; - left : number; - right : number; - top : number; -} +/** + * Optional parameter for [setContentOffset](Titanium.UI.ScrollView.setContentOffset) method. + */ +interface contentOffsetOption { + /** + * Determines whether the scroll view's content area change is animated. + */ + animated?: boolean; + +} -declare class hideStatusBarParams { - animated : boolean; - animationStyle : number; -} +/** + * Optional parameter for [setZoomScale](Titanium.UI.ScrollView.setZoomScale) method. + */ +interface zoomScaleOption { + /** + * Determines whether the scroll view's zooming is animated. + */ + animated?: boolean; + +} + +/** + * A simple object for specifying the animation properties when scrolling the view. + */ +interface ScrollViewAnimationProperties { + /** + * When set to `true` it will scroll smoothly to the destination. + */ + animated?: boolean; -declare class PreviewImageOptions { - error : (...args : any[]) => any; - image : Ti.Blob; - success : (...args : any[]) => any; } -declare class ListDataItem { - properties : Dictionary; - template : any; -} +/** + * Dictionary to specify edge insets for . + */ +interface TabIconInsets { + /** + * Top inset. + */ + top?: number; + + /** + * Left inset. + */ + left?: number; -declare class ItemTemplate { - childTemplates : Array; - events : Dictionary; - properties : Dictionary; } -declare class MovieSize { - height : number; - width : number; -} - -declare class CameraMediaItemType { - cropRect : CropRectType; - media : Ti.Blob; - mediaType : string; -} +/** + * A simple object for specifying the animation properties to use when inserting or deleting rows, or scrolling the table. + */ +interface TableViewAnimationProperties { + /** + * Whether this table change should be animated. Ignored if any `animationStyle` value is specified. + */ + animated?: boolean; + + /** + * Type of animation to use for row insertions and deletions. + */ + animationStyle?: number; + + /** + * Specifies what position to scroll the selected row to. + */ + position?: number; + +} -declare class HeadingResponse extends ErrorResponse { - heading : HeadingData; -} +/** + * A simple object that represents an index entry in a `TableView`. + */ +interface TableViewIndexEntry { + /** + * Title to display in the index bar for this item. + */ + title?: string; + + /** + * Row index associated with this item. + */ + index?: number; + +} -declare class ListViewEdgeInsets { - bottom : number; - left : number; - right : number; - top : number; -} - -declare class BoundaryIdentifier { - identifier : string; - point1 : Point; - point2 : Point; -} - -declare enum CloudEmailsResponse { - -} - -declare class GradientColorRef { - color : string; - offset : number; -} - -declare class Font { - fontFamily : string; - fontSize : any; - fontStyle : string; - fontWeight : string; - textStyle : string; -} - -declare class CloudPlacesResponse extends CloudResponse { - places : Array>; -} - -declare class EncodeNumberDict { - byteOrder : number; - dest : Ti.Buffer; - position : number; - source : number; - type : string; -} - -declare class showContactsParams { - animated : boolean; - cancel : (...args : any[]) => any; - fields : Array; - selectedPerson : (...args : any[]) => any; - selectedProperty : (...args : any[]) => any; -} - -declare class LocationProviderDict { - accuracy : number; - name : string; - power : number; -} - -declare class FacebookDialogResponsev1 { - cancelled : boolean; - error : string; - result : string; - success : boolean; -} - -declare class CloudFilesResponse extends CloudResponse { - files : Array>; -} - -declare class hideParams { - animated : boolean; -} - -declare class SecurityManagerProtocol { - connectionDelegateForUrl (url: any) : APSConnectionDelegate; - getKeyManagers (proxy: any) : Array; - getTrustManagers (proxy: any) : Array; - willHandleURL (url: any) : boolean; -} - -declare class openWindowParams { - activityEnterAnimation : number; - activityExitAnimation : number; - animated : boolean; - bottom : any; - fullscreen : boolean; - height : any; - left : any; - modal : boolean; - modalStyle : number; - modalTransitionStyle : number; - navBarHidden : boolean; - right : any; - top : any; - transition : number; - width : any; -} - -declare class Gradient { - backfillEnd : boolean; - backfillStart : boolean; - colors : any; - endPoint : Point; - endRadius : number; - startPoint : Point; - startRadius : number; - type : string; -} - -declare class showStatusBarParams { - animated : boolean; - animationStyle : number; -} - -declare class transitionAnimationParam { - duration : number; - tranistionTo : Ti.UI.Animation; - transitionFrom : Ti.UI.Animation; -} - -declare class MapPointType { - latitude : number; - longitude : number; -} - -declare class CloudKeyValuesResponse extends CloudResponse { - keyvalues : Array>; -} - -declare class TableViewEdgeInsets { - bottom : number; - left : number; - right : number; - top : number; -} - -declare class ReverseGeocodeResponse extends ErrorResponse { - places : Array; -} - -declare class contentOffsetOption { - animated : boolean; -} - -declare class Attribute { - range : Array; - type : number; - value : number; -} - -declare class PushNotificationSuccessArg { - deviceToken : string; - type : string; -} - -declare class PushNotificationData { - data : Dictionary; - inBackground : boolean; -} - -declare class closeWindowParams { - activityEnterAnimation : number; - activityExitAnimation : number; - animated : boolean; -} - -declare class CloudLikesResponse extends CloudResponse { - likes : Array>; -} - -declare class showParams { - animated : boolean; - rect : Dimension; - view : Ti.UI.View; -} - -declare class PreviewImageError { - message : string; -} - -declare class CloudMessagesResponse extends CloudResponse { - messages : Array>; -} - -declare class CloudPushNotificationsShowChannelResponse extends CloudResponse { - devices : Dictionary; -} - -declare class ImageAsCroppedDict { - height : number; - width : number; - x : number; - y : number; -} - -declare class UserNotificationSettings { - categories : Array; - types : Array; -} - -declare class TableViewAnimationProperties { - animated : boolean; - animationStyle : number; - position : number; -} - -declare enum MediaAuthorizationResponse { - -} +/** + * Optional parameter for [setContentInsets](Titanium.UI.TableView.setContentInsets) method. + */ +interface TableViewContentInsetOption { + /** + * Determines whether the table view's content inset change is animated. + */ + animated?: boolean; + + /** + * The duration in `milleseconds` for animation while the content inset is being changed. + */ + duration?: number; + +} + +/** + * The parameter for [setContentInsets](Titanium.UI.TableView.setContentInsets) method. + */ +interface TableViewEdgeInsets { + /** + * Value specifying the top insets for the enclosing scroll view of the table. + */ + top?: number; + + /** + * Value specifying the left insets for the enclosing scroll view of the table. + */ + left?: number; + + /** + * Value specifying the right insets for the enclosing scroll view of the table. + */ + right?: number; + + /** + * Value specifying the bottom insets for the enclosing scroll view of the table. + */ + bottom?: number; + +} + +/** + * Dictionary object of parameters for the event and property that describes + * position and length of the selected text. + */ +interface textAreaSelectedParams { + /** + * Starting position of selected text. + */ + location?: number; + + /** + * Number of characters selected. + */ + length?: number; + +} + +/** + * Dictionary object of parameters for the that describes the padding + */ +interface TextAreaPadding { + /** + * Left padding + */ + left?: number; + + /** + * Right padding + */ + right?: number; + + /** + * Top padding + */ + top?: number; + + /** + * Bottom padding + */ + bottom?: number; + +} + +/** + * Dictionary object of parameters for the property that describes + * position and length of the selected text. + */ +interface textFieldSelectedParams { + /** + * Starting position of selected text. + */ + location?: number; + + /** + * Number of characters selected. + */ + length?: number; + +} + +/** + * Dictionary object of parameters for the that describes the padding + */ +interface TextFieldPadding { + /** + * Left padding + */ + left?: number; + + /** + * Right padding + */ + right?: number; + + /** + * Top padding (Android only, since 6.1.0) + */ + top?: number; + + /** + * Bottom padding (Android only, since 6.1.0) + */ + bottom?: number; + +} + +/** + * A pair of coordinates used to describe the location of a . + */ +interface Point { + /** + * The x-axis coordinate of this point. + */ + x?: number | string; + + /** + * The y-axis coordinate of this point. + */ + y?: number | string; + +} + +/** + * A simple object defining a color gradient. + */ +interface Gradient { + /** + * Type of gradient, either 'linear' or 'radial'. + */ + type?: string; + + /** + * Start point for the gradient. + */ + startPoint?: Point; + + /** + * End point for the gradient. + */ + endPoint?: Point; + + /** + * For a radial gradient, the radius at the `startPoint`. + */ + startRadius?: number; + + /** + * For a radial gradient, the radius at the `endPoint`. + */ + endRadius?: number; + + /** + * An array of colors, as a color name or hex triplet. + */ + colors?: string[] | GradientColorRef[]; + + /** + * Set to `true` to continue filling with the starting color beyond the `startPoint`. + */ + backfillStart?: boolean; + + /** + * Set to `true` to continue filling with the final color beyond the `endPoint`. + */ + backfillEnd?: boolean; + +} + +/** + * A simple object consisting of a color and an offset. + */ +interface GradientColorRef { + /** + * Color value at this point in the gradient, as a color name or hex triplet. + */ + color?: string; + + /** + * The color's normalized position within the gradient, ranging from 0 (start) to 1 (end). + */ + offset?: number; + +} + +/** + * A simple object consisting of the position and size measurements. + */ +interface Dimension { + /** + * The height measurement. + */ + height?: number; + + /** + * The width measurement. + */ + width?: number; + + /** + * The x-axis coordinate of the position. + */ + x?: number; + + /** + * The y-axis coordinate of the position. + */ + y?: number; + +} + +/** + * Optional parameter to enable animation to [hide](Titanium.UI.View.hide) and [show](Titanium.UI.View.show). + */ +interface AnimationOption { + /** + * Determines whether to enable a circular reveal animation. + */ + animated?: boolean; + +} + +/** + * Dictionary of options for the method. + */ +interface openWindowParams { + /** + * Determines whether to use an animated effect when the window is shown. + */ + animated?: boolean; + + /** + * Window's bottom position, in platform-specific units. + */ + bottom?: number | string; + + /** + * Determines if the window is fullscreen. + */ + fullscreen?: boolean; + + /** + * Window's height, in platform-specific units. + */ + height?: number | string; + + /** + * Window's left position, in platform-specific units. + */ + left?: number | string; + + /** + * Determines whether to open the window modal in front of other windows. + */ + modal?: boolean; + + /** + * Presentation style of this modal window. + */ + modalStyle?: number; + + /** + * Transition style of this modal window. + */ + modalTransitionStyle?: number; + + /** + * For modal windows, hides the nav bar (`true`) or shows the nav bar (`false`). + */ + navBarHidden?: boolean; + + /** + * Window's right position, in platform-specific units. + */ + right?: number | string; + + /** + * Window's top position, in platform-specific units. + */ + top?: number | string; + + /** + * Transition style of this non-modal window. + */ + transition?: number; + + /** + * Window's width, in platform-specific units. + */ + width?: number | string; + + /** + * Animation resource to run on the activity (heavyweight window) being opened. + */ + activityEnterAnimation?: number; + + /** + * Animation resource to run on the activity that is being put in background as a heavyweight window is being opened above it. + */ + activityExitAnimation?: number; + +} + +/** + * Dictionary of options for the method. + */ +interface windowToolbarParam { + /** + * Defines if the toolbar is translucent. + */ + translucent?: boolean; + + /** + * Defines if the toolbar appearance is animated. + */ + animated?: boolean; + + /** + * Background color for the toolbar, as a color name or hex triplet. + */ + barColor?: string; + + /** + * The tintColor to apply to the tool bar. Applicable on iOS 7 and above. + */ + tintColor?: string; + +} + +/** + * Dictionary of options for the method. + */ +interface closeWindowParams { + /** + * Determines whether to use an animated effect when the window is closed. + */ + animated?: boolean; + + /** + * Animation resource to use for the incoming activity. + */ + activityEnterAnimation?: number; + + /** + * Animation resource to use for the outgoing activity (heavyweight window). + */ + activityExitAnimation?: number; + +} + +/** + * Dictionary of options for the property. + */ +interface titleAttributesParams { + /** + * Color of the window title, as a color name or hex triplet. + */ + color?: string; + + /** + * Font to use for the window title. + */ + font?: Font; + + /** + * Shadow color and offset for the window title. + */ + shadow?: shadowDict; + +} + +/** + * Dictionary describing the shadow effect for text. + */ +interface shadowDict { + /** + * Specifies the blur radius of the shadow. + */ + blurRadius?: number; + + /** + * Color name or hex triplet specifying the color of the shadow. + */ + color?: string; + + /** + * Dictionary with the properties `width` and `height` used as the horizontal + * and vertical offset of the shadow, respectively. + */ + offset?: any; + +} + +/** + * Object of options for . + */ +interface ShortcutParams { + /** + * The unique key for the application shortcut. + */ + itemtype: string; + + /** + * The title of the application shortcut. + */ + title: string; + + /** + * The subtitle displayed on the application shortcut. + */ + subtitle?: string; + + /** + * The icon to be displayed on the application shortcut. You can either use one of the constants like + * , a local image specified by the image path or a reference to a + * . + */ + icon?: number | string | Titanium.Contacts.Person; + + /** + * The userInfo of the application shortcut. + */ + userInfo?: any; + +} + +/** + * Dictionary to specify a boundary identifier for . + */ +interface BoundaryIdentifier { + /** + * Arbitrary identifier for the boundary + */ + identifier?: string; + + /** + * Start point for the boundary + */ + point1?: Point; + + /** + * End point for the boundary + */ + point2?: Point; + +} + +/** + * Dictionary to specify edge insets for . + */ +interface ReferenceInsets { + /** + * Top inset. + */ + top?: number; + + /** + * Left inset. + */ + left?: number; + + /** + * Right inset. + */ + right?: number; + + /** + * Bottom inset. + */ + bottom?: number; + +} + +/** + * Simple object for defining a single image in a cover flow view. + */ +interface CoverFlowImageType { + /** + * Image to use, as a local file URL, `Blob`, or `File`. + */ + image?: string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Display width for the image, in Apple points. + */ + width?: number; + + /** + * Display height of the image, in Apple points. + */ + height?: number; + +} + +/** + * A simple object for specifying options when showing or dismissing a . + */ +interface DocumentViewerOptions { + /** + * Indicates whether to animate the transition. + */ + animated?: boolean; + + /** + * Anchors the options menu to the specified view. + */ + view?: Titanium.UI.View; + +} + +/** + * Dictionary of options for showing a menu popup with . + */ +interface MenuPopupShowParams { + /** + * The view where the menu pop is shown at. + */ + view: Titanium.UI.View; + + /** + * Determines whether the menu popup should be opened or closed animated. + */ + animated?: boolean; + + /** + * Indicates the arrow direction of the menu popup. + */ + arrowDirection?: number; + +} + +/** + * Dictionary of options for hiding a menu popup with . + */ +interface MenuPopupHideParams { + /** + * Determines whether the menu popup should be opened or closed animated. + */ + animated?: boolean; + +} + +/** + * Optional parameter for [setShowMasterInPortrait](Titanium.UI.iOS.SplitWindow.setShowMasterInPortrait) and + * [setMasterIsOverlayed](Titanium.UI.iOS.SplitWindow.setMasterIsOverlayed) methods. + */ +interface animationOption { + /** + * Determines whether the change is animated. + */ + animated?: boolean; + +} + +/** + * Object describing a button bar or tabbed bar item. + */ +interface BarItemType { + /** + * Button title, used if no `image` is specified. + */ + title?: string; + + /** + * Button icon. If specified, takes precedence over `title`. + */ + image?: string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Width for this button. + */ + width?: number; + + /** + * Whether the button is enabled initially. + */ + enabled?: boolean; + + /** + * A succint label associated with the bar item for the device's accessibility service. + */ + accessibilityLabel?: string; + +} + +/** + * Dictionary specifying the transition animation used with the method. + * Only supported on iOS 7 and later. + */ +interface transitionAnimationParam { + /** + * Length of the transition in milliseconds. + */ + duration?: number; + + /** + * Animation to hide the current window. + */ + transitionFrom?: Titanium.UI.Animation; + + /** + * Animation to show the new window. + */ + transitionTo?: Titanium.UI.Animation; + +} + +/** + * Dictionary of options for and . + */ +interface PopoverParams { + /** + * Indicates whether to animate showing or hiding the popover. + */ + animated?: boolean; + + /** + * Sets the arrow position of the popover relative to the attached view object's dimensions + * when showing the popover. + */ + rect?: Dimension; + + /** + * Attaches the popover to the specified view when showing the popover. + */ + view: Titanium.UI.View; + +} + +/** + * Dictionary of options for the method. + */ +interface hideStatusBarParams { + /** + * Determines whether to animate the dialog as it is hidden. + */ + animated?: boolean; + + /** + * Style of the animation. + */ + animationStyle?: number; + +} + +/** + * Dictionary of options for the method. + */ +interface showStatusBarParams { + /** + * Determines whether to animate the dialog as it is shown. + */ + animated?: boolean; + + /** + * Style of the animation. + */ + animationStyle?: number; + +} + +/** + * Reply message received from watch app. + */ +interface MessageReply { + /** + * Reply message from watchapp. + */ + message?: any; + + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + +} + +/** + * Properties passed to a yql callback to report a success or failure. + */ +interface YQLResponse { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + + /** + * Error message, if any returned. Use `error` instead + */ + message?: string; + + /** + * The data payload received from the YQL. + */ + data?: any; -declare class EncodeStringDict { - charset : string; - dest : Ti.Buffer; - destPosition : number; - source : string; - sourceLength : number; - sourcePosition : number; } diff --git a/types/titanium/titanium-tests.ts b/types/titanium/titanium-tests.ts index 9113f49835..bc5f4794c2 100644 --- a/types/titanium/titanium-tests.ts +++ b/types/titanium/titanium-tests.ts @@ -1,7 +1,5 @@ - - function test_window() { - var window: Ti.UI.Window = Ti.UI.createWindow({ + const window: Titanium.UI.Window = Ti.UI.createWindow({ title: 'Test', backgroundColor: 'white', borderRadius: 10 @@ -10,10 +8,10 @@ function test_window() { window.setBackgroundColor('blue'); window.opacity = 0.92; - var matrix = Ti.UI.create2DMatrix().scale(1.1, 1); + const matrix = Ti.UI.create2DMatrix().scale(1.1, 1); window.transform = matrix; - var label: Ti.UI.Label; + let label: Titanium.UI.Label; label = Ti.UI.createLabel({ color: '#900', text: 'Simple label' @@ -26,17 +24,17 @@ function test_window() { } function test_tableview() { - var data : Ti.UI.View[] = []; - for (var i = 0; i < 10; i++) { - var row = Ti.UI.createTableViewRow(); - var label = Ti.UI.createLabel({ + const data: Titanium.UI.TableViewRow[] = []; + for (let i = 0; i < 10; i++) { + const row = Ti.UI.createTableViewRow(); + const label = Ti.UI.createLabel({ left: 10, text: 'Row ' + (i + 1) }); - var image = Ti.UI.createImageView({ + const image = Ti.UI.createImageView({ url: 'KS_nav_ui.png' }); - var button = Ti.UI.createButton({ + const button = Ti.UI.createButton({ right: 10, height: 30, width: 80, @@ -47,19 +45,19 @@ function test_tableview() { row.add(button); data.push(row); } - var table = Ti.UI.createTableView({ - data: data, - style: Ti.UI.iPhone.TableViewStyle.PLAIN + const table = Ti.UI.createTableView({ + data, + style: Ti.UI.iOS.TableViewStyle.PLAIN }); } function test_fs() { - var imageDir = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory + 'downloaded_images'); + let imageDir = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory + 'downloaded_images'); if (!imageDir.exists()) { imageDir.createDirectory(); } - var data: Ti.Blob; - var imageFile = Ti.Filesystem.getFile(imageDir.resolve() + 'image.jpg'); + let data: Titanium.Blob; // tslint:disable-line:prefer-const + let imageFile = Ti.Filesystem.getFile(imageDir.resolve() + 'image.jpg'); if (!imageFile.write(data)) { Ti.UI.createAlertDialog({ message: 'IO Error' @@ -70,17 +68,17 @@ function test_fs() { } function test_network() { - var url = "http://www.appcelerator.com"; - var client = Ti.Network.createHTTPClient({ + const url = "http://www.appcelerator.com"; + const client = Ti.Network.createHTTPClient({ // function called when the response data is available - onload : function(e: SuccessResponse) { + onload: (e: SuccessResponse) => { alert(this.responseText); }, // function called when an error occurs, including a timeout - onerror : function(e: FailureResponse) { + onerror: (e: FailureResponse) => { alert(e.error); }, - timeout : 5000 // in milliseconds + timeout: 5000 // in milliseconds }); // Prepare the connection. client.open('GET', url); @@ -89,8 +87,8 @@ function test_network() { } function test_map() { - var win = Ti.UI.createWindow(); - var mountainView = Ti.Map.createAnnotation({ + const win = Ti.UI.createWindow(); + const mountainView = Ti.Map.createAnnotation({ animate: true, leftButton: '../images/appcelerator_small.png', myid: 1 @@ -101,19 +99,20 @@ function test_map() { mountainView.setSubtitle('Mountain View, CA'); mountainView.setPincolor(Ti.Map.ANNOTATION_RED); - var mapview = Ti.Map.createView({ + const mapview = Ti.Map.createView({ mapType: Ti.Map.STANDARD_TYPE, region: { - latitude:37.390749, longitude:-122.081651, - latitudeDelta:0.01, longitudeDelta:0.01}, - animate:true, + latitude: 37.390749, longitude: -122.081651, + latitudeDelta: 0.01, longitudeDelta: 0.01 + }, + animate: true, }); mapview.regionFit = true; mapview.userLocation = true; mapview.annotations = [mountainView]; - mapview.addEventListener('click', function(evt?) { - if (evt.clicksource === 'leftButton' || evt.clicksource === 'leftPane') { - alert(evt.title + ' left button clicked'); + mapview.addEventListener('click', event => { + if (event.clicksource === 'leftButton' || event.clicksource === 'leftPane') { + alert(event.title + ' left button clicked'); } }); win.add(mapview); diff --git a/types/titanium/tsconfig.json b/types/titanium/tsconfig.json index 86e5902e63..815fb8c48b 100644 --- a/types/titanium/tsconfig.json +++ b/types/titanium/tsconfig.json @@ -2,8 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6", - "dom" + "dom", + "es6" ], "noImplicitAny": true, "noImplicitThis": false, diff --git a/types/titanium/tslint.json b/types/titanium/tslint.json index a41bf5d19a..9a29b5bc8f 100644 --- a/types/titanium/tslint.json +++ b/types/titanium/tslint.json @@ -2,78 +2,12 @@ "extends": "dtslint/dt.json", "rules": { "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "max-line-length": false, + "unified-signatures": false } } From 370bb2b55d2bcfb9a0cda18f26f04a7172a6050f Mon Sep 17 00:00:00 2001 From: fhelwanger Date: Sat, 24 Mar 2018 22:57:25 -0300 Subject: [PATCH 0203/2153] Add react-native-elevated-view types --- types/react-native-elevated-view/index.d.ts | 14 +++++++++++ .../react-native-elevated-view-tests.tsx | 10 ++++++++ .../react-native-elevated-view/tsconfig.json | 24 +++++++++++++++++++ types/react-native-elevated-view/tslint.json | 1 + 4 files changed, 49 insertions(+) create mode 100644 types/react-native-elevated-view/index.d.ts create mode 100644 types/react-native-elevated-view/react-native-elevated-view-tests.tsx create mode 100644 types/react-native-elevated-view/tsconfig.json create mode 100644 types/react-native-elevated-view/tslint.json diff --git a/types/react-native-elevated-view/index.d.ts b/types/react-native-elevated-view/index.d.ts new file mode 100644 index 0000000000..4ad853294b --- /dev/null +++ b/types/react-native-elevated-view/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for react-native-elevated-view 0.0 +// Project: https://github.com/alekhurst/react-native-elevated-view +// Definitions by: fhelwanger +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from 'react'; +import * as ReactNative from 'react-native'; + +export interface ElevatedViewProperties extends ReactNative.ViewProperties { + elevation?: number; +} + +export default class ElevatedView extends React.Component {} diff --git a/types/react-native-elevated-view/react-native-elevated-view-tests.tsx b/types/react-native-elevated-view/react-native-elevated-view-tests.tsx new file mode 100644 index 0000000000..f66932b1bf --- /dev/null +++ b/types/react-native-elevated-view/react-native-elevated-view-tests.tsx @@ -0,0 +1,10 @@ +import * as React from "react"; +import ElevatedView from "react-native-elevated-view"; + +() => { + ; +}; + +() => { + ; +}; diff --git a/types/react-native-elevated-view/tsconfig.json b/types/react-native-elevated-view/tsconfig.json new file mode 100644 index 0000000000..89b476781c --- /dev/null +++ b/types/react-native-elevated-view/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-native-elevated-view-tests.tsx" + ] +} diff --git a/types/react-native-elevated-view/tslint.json b/types/react-native-elevated-view/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-native-elevated-view/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 3c228f9d1ed04042e9d090d583850baa27d72cd0 Mon Sep 17 00:00:00 2001 From: TeamworkGuy2 Date: Sun, 25 Mar 2018 02:53:12 +0000 Subject: [PATCH 0204/2153] [q] fix Promise not being assignable to IWhenable with strictFunctionTypes --- types/q/index.d.ts | 396 ++++++++++++++++++++++++++++++++---------- types/q/q-tests.ts | 110 ++++++------ types/q/tsconfig.json | 4 +- 3 files changed, 365 insertions(+), 145 deletions(-) diff --git a/types/q/index.d.ts b/types/q/index.d.ts index 724925d802..bdcd3c68ca 100644 --- a/types/q/index.d.ts +++ b/types/q/index.d.ts @@ -1,9 +1,10 @@ -// Type definitions for Q 1.0 +// Type definitions for Q 1.5 // Project: https://github.com/kriskowal/q // Definitions by: Barrie Nemetchek // Andrew Gaspar // John Reilly // Michel Boudreau +// TeamworkGuy2 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -28,74 +29,99 @@ declare namespace Q { export interface Deferred { promise: Promise; + /** + * Calling resolve with a pending promise causes promise to wait on the passed promise, becoming fulfilled with its + * fulfillment value or rejected with its rejection reason (or staying pending forever, if the passed promise does). + * Calling resolve with a rejected promise causes promise to be rejected with the passed promise's rejection reason. + * Calling resolve with a fulfilled promise causes promise to be fulfilled with the passed promise's fulfillment value. + * Calling resolve with a non-promise value causes promise to be fulfilled with that value. + */ resolve(value?: IWhenable): void; + /** + * Calling reject with a reason causes promise to be rejected with that reason. + */ reject(reason?: any): void; + /** + * Calling notify with a value causes promise to be notified of progress with that value. That is, any onProgress + * handlers registered with promise or promises derived from promise will be called with the progress value. + */ notify(value: any): void; + /** + * Returns a function suitable for passing to a Node.js API. That is, it has a signature (err, result) and will + * reject deferred.promise with err if err is given, or fulfill it with result if that is given. + */ makeNodeResolver(): (reason: any, value: T) => void; } export interface Promise { /** - * Like a finally clause, allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful for collecting resources - * regardless of whether a job succeeded, like closing a database connection, shutting a server down, or deleting an unneeded key from an object. finally returns a promise, which will become - * resolved with the same fulfillment value or rejection reason as promise. However, if callback returns a promise, the resolution of the returned promise will be delayed until the promise - * returned from callback is finished. + * The then method from the Promises/A+ specification, with an additional progress handler. */ - fin(finallyCallback: () => any): Promise; + then(onFulfill?: ((value: T) => IWhenable) | null, onReject?: ((error: any) => IWhenable) | null, onProgress?: ((progress: any) => any) | null): Promise; /** - * Like a finally clause, allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful for collecting resources - * regardless of whether a job succeeded, like closing a database connection, shutting a server down, or deleting an unneeded key from an object. finally returns a promise, which will become - * resolved with the same fulfillment value or rejection reason as promise. However, if callback returns a promise, the resolution of the returned promise will be delayed until the promise - * returned from callback is finished. + * Like a finally clause, allows you to observe either the fulfillment or rejection of a promise, but to do so + * without modifying the final value. This is useful for collecting resources regardless of whether a job succeeded, + * like closing a database connection, shutting a server down, or deleting an unneeded key from an object. + * finally returns a promise, which will become resolved with the same fulfillment value or rejection reason + * as promise. However, if callback returns a promise, the resolution of the returned promise will be delayed + * until the promise returned from callback is finished. Furthermore, if the returned promise rejects, that + * rejection will be passed down the chain instead of the previous result. */ finally(finallyCallback: () => any): Promise; /** - * The then method from the Promises/A+ specification, with an additional progress handler. + * Alias for finally() (for non-ES5 browsers) */ - then(onFulfill?: (value: T) => IWhenable, onReject?: (error: any) => IWhenable, onProgress?: (progress: any) => any): Promise; + fin(finallyCallback: () => any): Promise; /** - * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's - * rejection reason. - * + * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are + * rejected, instead calls onRejected with the first rejected promise's rejection reason. * This is especially useful in conjunction with all */ spread(onFulfill: (...args: any[]) => IWhenable, onReject?: (reason: any) => IWhenable): Promise; - fail(onRejected: (reason: any) => IWhenable): Promise; - /** * A sugar method, equivalent to promise.then(undefined, onRejected). */ catch(onRejected: (reason: any) => IWhenable): Promise; + /** + * Alias for catch() (for non-ES5 browsers) + */ + fail(onRejected: (reason: any) => IWhenable): Promise; + /** * A sugar method, equivalent to promise.then(undefined, undefined, onProgress). */ progress(onProgress: (progress: any) => any): Promise; /** - * Much like then, but with different behavior around unhandled rejection. If there is an unhandled rejection, either because promise is rejected and no onRejected callback was provided, or - * because onFulfilled or onRejected threw an error or returned a rejected promise, the resulting rejection reason is thrown as an exception in a future turn of the event loop. - * - * This method should be used to terminate chains of promises that will not be passed elsewhere. Since exceptions thrown in then callbacks are consumed and transformed into rejections, - * exceptions at the end of the chain are easy to accidentally, silently ignore. By arranging for the exception to be thrown in a future turn of the event loop, so that it won't be caught, it - * causes an onerror event on the browser window, or an uncaughtException event on Node.js's process object. - * - * Exceptions thrown by done will have long stack traces, if Q.longStackSupport is set to true. If Q.onerror is set, exceptions will be delivered there instead of thrown in a future turn. - * - * The Golden Rule of done vs. then usage is: either return your promise to someone else, or if the chain ends with you, call done to terminate it. + * Much like then, but with different behavior around unhandled rejection. If there is an unhandled rejection, + * either because promise is rejected and no onRejected callback was provided, or because onFulfilled or onRejected + * threw an error or returned a rejected promise, the resulting rejection reason is thrown as an exception in a + * future turn of the event loop. + * This method should be used to terminate chains of promises that will not be passed elsewhere. Since exceptions + * thrown in then callbacks are consumed and transformed into rejections, exceptions at the end of the chain are + * easy to accidentally, silently ignore. By arranging for the exception to be thrown in a future turn of the + * event loop, so that it won't be caught, it causes an onerror event on the browser window, or an uncaughtException + * event on Node.js's process object. + * Exceptions thrown by done will have long stack traces, if Q.longStackSupport is set to true. If Q.onerror is set, + * exceptions will be delivered there instead of thrown in a future turn. + * The Golden Rule of done vs. then usage is: either return your promise to someone else, or if the chain ends + * with you, call done to terminate it. Terminating with catch is not sufficient because the catch handler may + * itself throw an error. */ - done(onFulfilled?: (value: T) => any, onRejected?: (reason: any) => any, onProgress?: (progress: any) => any): void; + done(onFulfilled?: ((value: T) => any) | null, onRejected?: ((reason: any) => any) | null, onProgress?: ((progress: any) => any) | null): void; /** - * If callback is a function, assumes it's a Node.js-style callback, and calls it as either callback(rejectionReason) when/if promise becomes rejected, or as callback(null, fulfillmentValue) - * when/if promise becomes fulfilled. If callback is not a function, simply returns promise. + * If callback is a function, assumes it's a Node.js-style callback, and calls it as either callback(rejectionReason) + * when/if promise becomes rejected, or as callback(null, fulfillmentValue) when/if promise becomes fulfilled. + * If callback is not a function, simply returns promise. */ nodeify(callback: (reason: any, value: any) => void): Promise; @@ -112,8 +138,8 @@ declare namespace Q { delete(propertyName: string): Promise; /** - * Returns a promise for the result of calling the named method of an object with the given array of arguments. The object itself is this in the function, just like a synchronous method call. - * Essentially equivalent to + * Returns a promise for the result of calling the named method of an object with the given array of arguments. + * The object itself is this in the function, just like a synchronous method call. Essentially equivalent to * * @example * promise.then(function (o) { return o[methodName].apply(o, args); }); @@ -121,14 +147,11 @@ declare namespace Q { post(methodName: string, args: any[]): Promise; /** - * Returns a promise for the result of calling the named method of an object with the given variadic arguments. The object itself is this in the function, just like a synchronous method call. + * Returns a promise for the result of calling the named method of an object with the given variadic arguments. + * The object itself is this in the function, just like a synchronous method call. */ invoke(methodName: string, ...args: any[]): Promise; - fapply(args: any[]): Promise; - - fcall(...args: any[]): Promise; - /** * Returns a promise for an array of the property names of an object. Essentially equivalent to * @@ -137,6 +160,35 @@ declare namespace Q { */ keys(): Promise; + /** + * Returns a promise for the result of calling a function, with the given array of arguments. Essentially equivalent to + * + * @example + * promise.then(function (f) { + * return f.apply(undefined, args); + * }); + */ + fapply(args: any[]): Promise; + + /** + * Returns a promise for the result of calling a function, with the given variadic arguments. Has the same return + * value/thrown exception translation as explained above for fbind. + * In its static form, it is aliased as Q.try, since it has semantics similar to a try block (but handling both + * synchronous exceptions and asynchronous rejections). This allows code like + * + * @example + * Q.try(function () { + * if (!isConnectedToCloud()) { + * throw new Error("The cloud is down!"); + * } + * return syncToCloud(); + * }) + * .catch(function (error) { + * console.error("Couldn't sync to the cloud", error); + * }); + */ + fcall(...args: any[]): Promise; + /** * A sugar method, equivalent to promise.then(function () { return value; }). */ @@ -148,30 +200,39 @@ declare namespace Q { thenReject(reason?: any): Promise; /** - * Attaches a handler that will observe the value of the promise when it becomes fulfilled, returning a promise for that same value, perhaps deferred but not replaced by the promise returned - * by the onFulfilled handler. + * Attaches a handler that will observe the value of the promise when it becomes fulfilled, returning a promise for + * that same value, perhaps deferred but not replaced by the promise returned by the onFulfilled handler. */ tap(onFulfilled: (value: T) => any): Promise; + /** + * Returns a promise that will have the same result as promise, except that if promise is not fulfilled or rejected + * before ms milliseconds, the returned promise will be rejected with an Error with the given message. If message + * is not supplied, the message will be "Timed out after " + ms + " ms". + */ timeout(ms: number, message?: string): Promise; /** - * Returns a promise that will have the same result as promise, but will only be fulfilled or rejected after at least ms milliseconds have passed. + * Returns a promise that will have the same result as promise, but will only be fulfilled or rejected after at least + * ms milliseconds have passed. */ delay(ms: number): Promise; /** - * Returns whether a given promise is in the fulfilled state. When the static version is used on non-promises, the result is always true. + * Returns whether a given promise is in the fulfilled state. When the static version is used on non-promises, the + * result is always true. */ isFulfilled(): boolean; /** - * Returns whether a given promise is in the rejected state. When the static version is used on non-promises, the result is always false. + * Returns whether a given promise is in the rejected state. When the static version is used on non-promises, the + * result is always false. */ isRejected(): boolean; /** - * Returns whether a given promise is in the pending state. When the static version is used on non-promises, the result is always false. + * Returns whether a given promise is in the pending state. When the static version is used on non-promises, the + * result is always false. */ isPending(): boolean; @@ -193,6 +254,30 @@ declare namespace Q { reason?: any; } + /** + * Returns a "deferred" object with a: + * promise property + * resolve(value) method + * reject(reason) method + * notify(value) method + * makeNodeResolver() method + */ + export function defer(): Deferred; + + /** + * Calling resolve with a pending promise causes promise to wait on the passed promise, becoming fulfilled with its + * fulfillment value or rejected with its rejection reason (or staying pending forever, if the passed promise does). + * Calling resolve with a rejected promise causes promise to be rejected with the passed promise's rejection reason. + * Calling resolve with a fulfilled promise causes promise to be fulfilled with the passed promise's fulfillment value. + * Calling resolve with a non-promise value causes promise to be fulfilled with that value. + */ + export function resolve(object?: IWhenable): Promise; + + /** + * Returns a promise that is rejected with reason. + */ + export function reject(reason?: any): Promise; + // If no value provided, returned promise will be of void type export function when(): Promise; @@ -200,38 +285,168 @@ declare namespace Q { export function when(value: IWhenable): Promise; // If a non-promise value is provided, it will not reject or progress - export function when(value: IWhenable, onFulfilled: (val: T) => IWhenable, onRejected?: (reason: any) => IWhenable, onProgress?: (progress: any) => any): Promise; + export function when(value: IWhenable, onFulfilled: (val: T) => IWhenable, onRejected?: ((reason: any) => IWhenable) | null, onProgress?: ((progress: any) => any) | null): Promise; + /** + * (Deprecated) Returns a new function that calls a function asynchronously with the given variadic arguments, and returns a promise. + * Notably, any synchronous return values or thrown exceptions are transformed, respectively, into fulfillment values + * or rejection reasons for the promise returned by this new function. + * This method is especially useful in its static form for wrapping functions to ensure that they are always + * asynchronous, and that any thrown exceptions (intentional or accidental) are appropriately transformed into a + * returned rejected promise. For example: + * + * @example + * var getUserData = Q.fbind(function (userName) { + * if (!userName) { + * throw new Error("userName must be truthy!"); + * } + * if (localCache.has(userName)) { + * return localCache.get(userName); + * } + * return getUserFromCloud(userName); + * }); + */ export function fbind(method: (...args: any[]) => IWhenable, ...args: any[]): (...args: any[]) => Promise; + /** + * Returns a promise for the result of calling a function, with the given variadic arguments. Has the same return + * value/thrown exception translation as explained above for fbind. + * In its static form, it is aliased as Q.try, since it has semantics similar to a try block (but handling both synchronous + * exceptions and asynchronous rejections). This allows code like + * + * @example + * Q.try(function () { + * if (!isConnectedToCloud()) { + * throw new Error("The cloud is down!"); + * } + * return syncToCloud(); + * }) + * .catch(function (error) { + * console.error("Couldn't sync to the cloud", error); + * }); + */ export function fcall(method: (...args: any[]) => T, ...args: any[]): Promise; - // Try is an alias for fcall, but 'try' is a reserved word. This is the only way to get around this + // but 'try' is a reserved word. This is the only way to get around this + /** + * Alias for fcall() + */ export {fcall as try}; - export function send(obj: any, functionName: string, ...args: any[]): Promise; - + /** + * Returns a promise for the result of calling the named method of an object with the given variadic arguments. + * The object itself is this in the function, just like a synchronous method call. + */ export function invoke(obj: any, functionName: string, ...args: any[]): Promise; + /** + * Alias for invoke() + */ + export function send(obj: any, functionName: string, ...args: any[]): Promise; + + /** + * Alias for invoke() + */ export function mcall(obj: any, functionName: string, ...args: any[]): Promise; - export function denodeify(nodeFunction: (...args: any[]) => any, ...args: any[]): (...args: any[]) => Promise; - - export function nbind(nodeFunction: (...args: any[]) => any, thisArg: any, ...args: any[]): (...args: any[]) => Promise; - + /** + * Creates a promise-returning function from a Node.js-style function, optionally binding it with the given + * variadic arguments. An example: + * + * @example + * var readFile = Q.nfbind(FS.readFile); + * readFile("foo.txt", "utf-8").done(function (text) { + * //... + * }); + * + * Note that if you have a method that uses the Node.js callback pattern, as opposed to just a function, you will + * need to bind its this value before passing it to nfbind, like so: + * + * @example + * var Kitty = mongoose.model("Kitty"); + * var findKitties = Q.nfbind(Kitty.find.bind(Kitty)); + * + * The better strategy for methods would be to use Q.nbind, as shown below. + */ export function nfbind(nodeFunction: (...args: any[]) => any, ...args: any[]): (...args: any[]) => Promise; - export function nfcall(nodeFunction: (...args: any[]) => any, ...args: any[]): Promise; + /** + * Alias for nfbind() + */ + export function denodeify(nodeFunction: (...args: any[]) => any, ...args: any[]): (...args: any[]) => Promise; + /** + * Creates a promise-returning function from a Node.js-style method, optionally binding it with the given + * variadic arguments. An example: + * + * @example + * var Kitty = mongoose.model("Kitty"); + * var findKitties = Q.nbind(Kitty.find, Kitty); + * findKitties({ cute: true }).done(function (theKitties) { + * //... + * }); + */ + export function nbind(nodeFunction: (...args: any[]) => any, thisArg: any, ...args: any[]): (...args: any[]) => Promise; + + /** + * Calls a Node.js-style function with the given array of arguments, returning a promise that is fulfilled if the + * Node.js function calls back with a result, or rejected if it calls back with an error + * (or throws one synchronously). An example: + * + * @example + * Q.nfapply(FS.readFile, ["foo.txt", "utf-8"]).done(function (text) { + * }); + * + * Note that this example only works because FS.readFile is a function exported from a module, not a method on + * an object. For methods, e.g. redisClient.get, you must bind the method to an instance before passing it to + * Q.nfapply (or, generally, as an argument to any function call): + * + * @example + * Q.nfapply(redisClient.get.bind(redisClient), ["user:1:id"]).done(function (user) { + * }); + * + * The better strategy for methods would be to use Q.npost, as shown below. + */ export function nfapply(nodeFunction: (...args: any[]) => any, args: any[]): Promise; - export function ninvoke(nodeModule: any, functionName: string, ...args: any[]): Promise; + /** + * Calls a Node.js-style function with the given variadic arguments, returning a promise that is fulfilled if the + * Node.js function calls back with a result, or rejected if it calls back with an error + * (or throws one synchronously). An example: + * + * @example + * Q.nfcall(FS.readFile, "foo.txt", "utf-8").done(function (text) { + * }); + * + * The same warning about functions vs. methods applies for nfcall as it does for nfapply. In this case, the better + * strategy would be to use Q.ninvoke. + */ + export function nfcall(nodeFunction: (...args: any[]) => any, ...args: any[]): Promise; + /** + * Calls a Node.js-style method with the given arguments array, returning a promise that is fulfilled if the method + * calls back with a result, or rejected if it calls back with an error (or throws one synchronously). An example: + * + * @example + * Q.npost(redisClient, "get", ["user:1:id"]).done(function (user) { + * }); + */ export function npost(nodeModule: any, functionName: string, args: any[]): Promise; - export function nsend(nodeModule: any, functionName: string, ...args: any[]): Promise; + /** + * Calls a Node.js-style method with the given variadic arguments, returning a promise that is fulfilled if the + * method calls back with a result, or rejected if it calls back with an error (or throws one synchronously). An example: + * + * @example + * Q.ninvoke(redisClient, "get", "user:1:id").done(function (user) { + * }); + */ + export function ninvoke(nodeModule: any, functionName: string, ...args: any[]): Promise; - export function nmcall(nodeModule: any, functionName: string, ...args: any[]): Promise; + /** + * Alias for ninvoke() + */ + export function nsend(nodeModule: any, functionName: string, ...args: any[]): Promise; /** * Returns a promise that is fulfilled with an array containing the fulfillment value of each promise, or is rejected with the same rejection reason as the first promise to be rejected. @@ -267,21 +482,27 @@ declare namespace Q { export function race(promises: Array>): Promise; /** - * Returns a promise that is fulfilled with an array of promise state snapshots, but only after all the original promises have settled, i.e. become either fulfilled or rejected. + * Returns a promise that is fulfilled with an array of promise state snapshots, but only after all the original promises + * have settled, i.e. become either fulfilled or rejected. */ export function allSettled(promises: IWhenable>>): Promise>>; + /** + * Deprecated Alias for allSettled() + */ export function allResolved(promises: IWhenable>>): Promise>>; /** - * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection - * reason. This is especially useful in conjunction with all. + * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are + * rejected, instead calls onRejected with the first rejected promise's rejection reason. This is especially useful + * in conjunction with all. */ export function spread(promises: Array>, onFulfilled: (...args: T[]) => IWhenable, onRejected?: (reason: any) => IWhenable): Promise; /** - * Returns a promise that will have the same result as promise, except that if promise is not fulfilled or rejected before ms milliseconds, the returned promise will be rejected with an Error - * with the given message. If message is not supplied, the message will be "Timed out after " + ms + " ms". + * Returns a promise that will have the same result as promise, except that if promise is not fulfilled or rejected + * before ms milliseconds, the returned promise will be rejected with an Error with the given message. If message + * is not supplied, the message will be "Timed out after " + ms + " ms". */ export function timeout(promise: Promise, ms: number, message?: string): Promise; @@ -310,75 +531,64 @@ declare namespace Q { export function isPending(promiseOrObject: Promise | any): boolean; /** - * Returns a "deferred" object with a: - * promise property - * resolve(value) method - * reject(reason) method - * notify(value) method - * makeNodeResolver() method + * Synchronously calls resolver(resolve, reject, notify) and returns a promise whose state is controlled by the + * functions passed to resolver. This is an alternative promise-creation API that has the same power as the deferred + * concept, but without introducing another conceptual entity. + * If resolver throws an exception, the returned promise will be rejected with that thrown exception as the rejection reason. + * note: In the latest github, this method is called Q.Promise, but if you are using the npm package version 0.9.7 + * or below, the method is called Q.promise (lowercase vs uppercase p). */ - export function defer(): Deferred; - - /** - * Returns a promise that is rejected with reason. - */ - export function reject(reason?: any): Promise; - export function Promise(resolver: (resolve: (val?: IWhenable) => void, reject: (reason?: any) => void, notify: (progress: any) => void) => void): Promise; /** - * Creates a new version of func that accepts any combination of promise and non-promise values, converting them to their fulfillment values before calling the original func. The returned version - * also always returns a promise: if func does a return or throw, then Q.promised(func) will return fulfilled or rejected promise, respectively. - * - * This can be useful for creating functions that accept either promises or non-promise values, and for ensuring that the function always returns a promise even in the face of unintentional - * thrown exceptions. + * Creates a new version of func that accepts any combination of promise and non-promise values, converting them to their + * fulfillment values before calling the original func. The returned version also always returns a promise: if func does + * a return or throw, then Q.promised(func) will return fulfilled or rejected promise, respectively. + * This can be useful for creating functions that accept either promises or non-promise values, and for ensuring that + * the function always returns a promise even in the face of unintentional thrown exceptions. */ export function promised(callback: (...args: any[]) => T): (...args: any[]) => Promise; /** * Returns whether the given value is a Q promise. */ - export function isPromise(object: any): boolean; + export function isPromise(object: any): object is Promise; /** * Returns whether the given value is a promise (i.e. it's an object with a then function). */ - export function isPromiseAlike(object: any): boolean; + export function isPromiseAlike(object: any): object is IPromise; /** * If an object is not a promise, it is as "near" as possible. * If a promise is rejected, it is as "near" as possible too. - * If it’s a fulfilled promise, the fulfillment value is nearer. - * If it’s a deferred promise and the deferred has been resolved, the + * If it's a fulfilled promise, the fulfillment value is nearer. + * If it's a deferred promise and the deferred has been resolved, the * resolution is "nearer". */ export function nearer(promise: Promise): T; /** - * This is an experimental tool for converting a generator function into a deferred function. This has the potential of reducing nested callbacks in engines that support yield. + * This is an experimental tool for converting a generator function into a deferred function. This has the potential + * of reducing nested callbacks in engines that support yield. */ export function async(generatorFunction: any): (...args: any[]) => Promise; export function nextTick(callback: (...args: any[]) => any): void; /** - * A settable property that will intercept any uncaught errors that would otherwise be thrown in the next tick of the event loop, usually as a result of done. Can be useful for getting the full + * A settable property that will intercept any uncaught errors that would otherwise be thrown in the next tick of the + * event loop, usually as a result of done. Can be useful for getting the full * stack trace of an error in browsers, which is not usually possible with window.onerror. */ export let onerror: (reason: any) => void; /** - * A settable property that lets you turn on long stack trace support. If turned on, "stack jumps" will be tracked across asynchronous promise operations, so that if an uncaught error is thrown - * by done or a rejection reason's stack property is inspected in a rejection callback, a long stack trace is produced. + * A settable property that lets you turn on long stack trace support. If turned on, "stack jumps" will be tracked + * across asynchronous promise operations, so that if an uncaught error is thrown by done or a rejection reason's stack + * property is inspected in a rejection callback, a long stack trace is produced. */ export let longStackSupport: boolean; - /** - * Calling resolve with a pending promise causes promise to wait on the passed promise, becoming fulfilled with its fulfillment value or rejected with its rejection reason (or staying pending - * forever, if the passed promise does). Calling resolve with a rejected promise causes promise to be rejected with the passed promise's rejection reason. Calling resolve with a fulfilled promise - * causes promise to be fulfilled with the passed promise's fulfillment value. Calling resolve with a non-promise value causes promise to be fulfilled with that value. - */ - export function resolve(object?: IWhenable): Promise; - /** * Resets the global "Q" variable to the value it has before Q was loaded. * This will either be undefined if there was no version or the version of Q which was already loaded before. diff --git a/types/q/q-tests.ts b/types/q/q-tests.ts index c0c29d9642..226d86ced8 100644 --- a/types/q/q-tests.ts +++ b/types/q/q-tests.ts @@ -1,18 +1,20 @@ /// -import Q = require('q'); +import Q = require("q"); -Q(8).then(x => console.log(x.toExponential())); +const _when: Q.IWhenable = Q.resolve(0); // was an issue when strictFunctionTypes were enforced on all of DefinitelyTyped + +Q(8).then((x) => console.log(x.toExponential())); Q().then(() => console.log("nothing")); -const delay = (delay: number) => { +function delay(delay: number): Q.Promise { const d = Q.defer(); setTimeout(d.resolve, delay); return d.promise; -}; +} Q.when(delay(1000), (val) => { - console.log('Hello, World!'); + console.log("Hello, World!"); return; }); @@ -20,15 +22,15 @@ Q.when(delay(1000), (val) => { const otherPromise = Q.defer().promise; Q.defer().resolve(otherPromise); -Q.timeout(Q(new Date()), 1000, "My dates never arrived. :(").then(d => d.toJSON()); +Q.timeout(Q(new Date()), 1000, "My dates never arrived. :(").then((d) => d.toJSON()); -Q.delay(Q(8), 1000).then(x => x.toExponential()); -Q.delay(8, 1000).then(x => x.toExponential()); -Q.delay(Q("asdf"), 1000).then(x => x.length); -Q.delay("asdf", 1000).then(x => x.length); +Q.delay(Q(8), 1000).then((x) => x.toExponential()); +Q.delay(8, 1000).then((x) => x.toExponential()); +Q.delay(Q("asdf"), 1000).then((x) => x.length); +Q.delay("asdf", 1000).then((x) => x.length); -const eventualAdd = Q.promised((a?: number, b?: number) => a + b); -eventualAdd(Q(1), Q(2)).then(x => x.toExponential()); +const eventualAdd = Q.promised((a?: number, b?: number) => a + b); +eventualAdd(Q(1), Q(2)).then((x) => x.toExponential()); function eventually(eventually: T) { return Q.delay(eventually, 1000); @@ -36,6 +38,7 @@ function eventually(eventually: T) { const x = Q.all([1, 2, 3].map(eventually)); Q.when(x, (x) => { + const _x: number[] = x; console.log(x); }); @@ -81,10 +84,11 @@ Q.allResolved([]) Q(42) .tap(() => "hello") - .tap(x => { + .tap((x) => { console.log(x); }) - .then(x => { + .then((x) => { + const _x: number = x; console.log("42 == " + x); }); @@ -94,34 +98,34 @@ declare let stringPromise: Q.IPromise; declare function returnsNumPromise(text: string): Q.Promise; declare function returnsNumPromise(text: string): JQueryPromise; -Q(arrayPromise) // type specification required - .then(arr => arr.join(',')) - .then(returnsNumPromise) // requires specification - .then(num => num.toFixed()); +Q(arrayPromise) + .then((arr) => arr.join(',')) + .then(returnsNumPromise) // requires specification + .then((num) => num.toFixed()); declare let jPromise: JQueryPromise; // if jQuery promises definition supported generics, this could be more interesting example -Q(jPromise).then(str => str.split(',')); +Q(jPromise).then((str) => str.split(',')); jPromise.then(returnsNumPromise); // watch the typing flow through from jQueryPromise to Q.Promise -Q(jPromise).then(str => str.split(',')); +Q(jPromise).then((str) => str.split(',')); declare let promiseArray: Array>; -const qPromiseArray = promiseArray.map(p => { +const qPromiseArray = promiseArray.map((p) => { return Q(p); }); const myNums: any[] = [2, 3, Q(4), 5, Q(6), Q(7)]; -Q.all(promiseArray).then(nums => nums.map(num => num.toPrecision(2)).join(',')); +Q.all(promiseArray).then((nums) => nums.map((num) => num.toPrecision(2)).join(',')); -Q.all(myNums).then(nums => nums.map(Math.round)); +Q.all(myNums).then((nums) => nums.map(Math.round)); -Q.fbind((dateString?: string) => new Date(dateString), "11/11/1991")().then(d => d.toLocaleDateString()); +Q.fbind((dateString?: string) => new Date( dateString), "11/11/1991")().then((d) => d.toLocaleDateString()); -Q.when(8, num => num + "!"); -Q.when(Q(8), num => num + "!").then(str => str.split(',')); +Q.when(8, (num) => num + "!"); +Q.when(Q(8), (num) => num + "!").then((str) => str.split(',')); const voidPromise: Q.Promise = Q.when(); declare function saveToDisk(): Q.Promise; @@ -147,22 +151,27 @@ Q.nfapply(nodeStyle, ["foo"]).done((result: string) => { }); Q.nfcall(nodeStyle, "foo").done((result: string) => { }); -Q.denodeify(nodeStyle)('foo').done((result: string) => { +Q.denodeify(nodeStyle)("foo").done((result: string) => { }); -Q.nfbind(nodeStyle)('foo').done((result: string) => { +Q.nfbind(nodeStyle)("foo").done((result: string) => { }); +interface Kitty { + name: string; + cute: boolean; +} + class Repo { - private readonly items: any[] = [ - {name: 'Max', cute: false}, - {name: 'Annie', cute: true} + private readonly items: Kitty[] = [ + {name: "Max", cute: false}, + {name: "Annie", cute: true} ]; - find(options: any): Q.Promise { + find(options: {[K in keyof Kitty]: Kitty[K] }): Q.Promise { let result = this.items; for (const key in options) { - result = result.filter(i => i[key] === options[key]); + result = result.filter((i) => i[ key] === options[ key]); } return Q(result); @@ -170,7 +179,8 @@ class Repo { } const kitty = new Repo(); -Q.nbind(kitty.find, kitty)({cute: true}).done((kitties: any[]) => { +Q.nbind(kitty.find, kitty)({ cute: true }).done((kitties) => { + const _kitties: Kitty[] = kitties; }); /** @@ -194,10 +204,6 @@ function TestCanRethrowRejectedPromises() { .fail((error) => { console.log("Intermediate error handling"); - /* - * Cannot do this, because: - * error TS2322: Type 'Promise' is not assignable to type 'Promise' - */ return Q.reject(error); }); } @@ -206,10 +212,14 @@ function TestCanRethrowRejectedPromises() { .finally(() => { console.log("Cleanup"); }) - .done(); + .done((foo) => { + const _foo: Foo = foo; + }); } -// test Q.Promise.all +/** + * test Q.Promise.all + */ const y1 = Q().then(() => { const s = Q("hello"); const n = Q(1); @@ -222,9 +232,9 @@ const y2 = Q().then(() => { return <[typeof s, typeof n]> [s, n]; }); -const p2: Q.Promise<[string, number]> = y1.then(val => Q.all(val)); +const p2: Q.Promise<[string, number]> = y1.then((val) => Q.all(val)); const p3: Q.Promise<[string, number]> = Q.all(y1); -const p5: Q.Promise<[string, number]> = y2.then(val => Q.all(val)); +const p5: Q.Promise<[string, number]> = y2.then((val) => Q.all(val)); const p6: Q.Promise<[string, number]> = Q.all(y2); Q.try(() => { @@ -238,8 +248,8 @@ Q.try(() => { // thenReject, returning a Promise of the same type as the Promise it is called on function thenRejectSameType(arg: any): Q.Promise { if (!arg) { - return returnsNumPromise('') - .thenReject(new Error('failed')); + return returnsNumPromise("") + .thenReject(new Error("failed")); } return Q.resolve(2); } @@ -248,10 +258,10 @@ function thenRejectSameType(arg: any): Q.Promise { // The generic type argument is specified. function thenRejectSpecificOtherType(arg: any): Q.Promise { if (!arg) { - return returnsNumPromise('') - .thenReject(new Error('failed')); + return returnsNumPromise("") + .thenReject(new Error("failed")); } - return Q.resolve(''); + return Q.resolve(""); } // thenReject, returning a Promise of a different type to the Promise it is called on. @@ -262,9 +272,9 @@ function thenRejectSpecificOtherType(arg: any): Q.Promise { /* function thenRejectInferredOtherType(arg: any): Q.Promise { if (!arg) { - return returnsNumPromise('') - .thenReject(new Error('failed')); + return returnsNumPromise("") + .thenReject(new Error("failed")); } - return Q.resolve(''); + return Q.resolve(""); } */ diff --git a/types/q/tsconfig.json b/types/q/tsconfig.json index d78aa85a14..ba7c0d33d6 100644 --- a/types/q/tsconfig.json +++ b/types/q/tsconfig.json @@ -7,8 +7,8 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": false, + "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" From b2d16a83b3a76d63e80548b437eaa707ae144302 Mon Sep 17 00:00:00 2001 From: Jiaren Liu Date: Sun, 25 Mar 2018 11:04:38 +0800 Subject: [PATCH 0205/2153] add resourceQuery for webpack loader --- types/webpack/index.d.ts | 2 ++ types/webpack/webpack-tests.ts | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index c6f4ae6c12..8c93019f24 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -421,6 +421,8 @@ declare namespace webpack { include?: Condition | Condition[]; /** A Condition matched with the resource. */ resource?: Condition | Condition[]; + /** A Condition matched with the resource query. */ + resourceQuery?: Condition | Condition[]; /** A condition matched with the issuer */ issuer?: Condition | Condition[]; /** diff --git a/types/webpack/webpack-tests.ts b/types/webpack/webpack-tests.ts index 971df8cd78..4ce24fb25d 100644 --- a/types/webpack/webpack-tests.ts +++ b/types/webpack/webpack-tests.ts @@ -145,6 +145,15 @@ rule = { loader: "babel-loader" }; +rule = { + test: /\.css$/, + resourceQuery: /module/, + loader: 'css-loader', + options: { + modules: true + } +}; + declare const require: any; declare const path: any; configuration = { From e203ff0b228cc5800c54c0d5f67dcb0659120e27 Mon Sep 17 00:00:00 2001 From: Llorenc Muntaner Date: Sun, 25 Mar 2018 08:44:04 +0200 Subject: [PATCH 0206/2153] react-data-grid: add missing GridProp headerFiltersHeight --- types/react-data-grid/index.d.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/types/react-data-grid/index.d.ts b/types/react-data-grid/index.d.ts index 27f12bccb6..af6edce257 100644 --- a/types/react-data-grid/index.d.ts +++ b/types/react-data-grid/index.d.ts @@ -97,6 +97,11 @@ declare namespace AdazzleReactDataGrid { * @default rowHeight */ headerRowHeight?: number + /** + * The height of the header filter row in pixels. + * @default 45 + */ + headerFiltersHeight?: number /** * The minimum width of each column in pixels. * @default 80 @@ -163,11 +168,11 @@ declare namespace AdazzleReactDataGrid { enableCellSelect?: boolean /** - * Enables cells to be dragged and dropped + * Enables cells to be dragged and dropped * @default false */ enableDragAndDrop?: boolean - + /** * Called when a cell is selected. * @param coordinates The row and column indices of the selected cell. @@ -211,10 +216,10 @@ declare namespace AdazzleReactDataGrid { * @param props OnRowExpandToggle object */ onRowExpandToggle?: (props: OnRowExpandToggle ) => void - + /** * Responsible for returning an Array of values that can be used for filtering - * a column that is column.filterable and using a column.filterRenderer that + * a column that is column.filterable and using a column.filterRenderer that * displays a list of options. * @param columnKey the column key that we are looking to pull values from */ @@ -485,7 +490,7 @@ declare namespace AdazzleReactDataGrid { * Excel-like grid component built with React, with editors, keyboard navigation, copy & paste, and the like * http://adazzle.github.io/react-data-grid/ */ - export class ReactDataGrid extends React.Component { + export class ReactDataGrid extends React.Component { /** * Opens the editor for the cell (idx) in the given row (rowIdx). If the column is not editable then nothing will happen. */ From c6ff674097975aa2d1f356dfcdba921679e9c96e Mon Sep 17 00:00:00 2001 From: Siim Tiilen Date: Sun, 25 Mar 2018 13:23:08 +0300 Subject: [PATCH 0207/2153] jwplayer code is now located in github --- types/jwplayer/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/jwplayer/index.d.ts b/types/jwplayer/index.d.ts index cb40e26da7..5be14b2733 100644 --- a/types/jwplayer/index.d.ts +++ b/types/jwplayer/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for JW Player V8.0 -// Project: http://developer.longtailvideo.com/trac/ +// Project: https://github.com/jwplayer/jwplayer/ // Definitions by: Martin Duparc // Tomer Kruvi // Philipp Gürtler From f90b2f5f147ccb6280f8804aadc7ab3fa7d92cc4 Mon Sep 17 00:00:00 2001 From: Siim Tiilen Date: Sun, 25 Mar 2018 13:24:53 +0300 Subject: [PATCH 0208/2153] fix indent for getContainer and getEnvironment --- types/jwplayer/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/jwplayer/index.d.ts b/types/jwplayer/index.d.ts index 5be14b2733..58c656956c 100644 --- a/types/jwplayer/index.d.ts +++ b/types/jwplayer/index.d.ts @@ -255,8 +255,8 @@ interface JWPlayer { getSafeRegion(): Region; getState(): string; getVolume(): number; - getContainer(): HTMLElement; - getEnvironment(): Environment; + getContainer(): HTMLElement; + getEnvironment(): Environment; getWidth(): number; load(playlist: any[]): void; load(playlist: string): void; From 010136012882e6409764cbda9d9a0a6d118480c0 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Sun, 25 Mar 2018 13:06:31 +0200 Subject: [PATCH 0209/2153] fix: `shebang` should be optional in `ParseOptions` --- types/uglify-js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/uglify-js/index.d.ts b/types/uglify-js/index.d.ts index cab53cb4db..12bcefa7af 100644 --- a/types/uglify-js/index.d.ts +++ b/types/uglify-js/index.d.ts @@ -10,7 +10,7 @@ export interface ParseOptions { bare_returns?: boolean; html5_comments?: boolean; /** Support `#!command` as the first line */ - shebang: boolean; + shebang?: boolean; } export interface CompressOptions { From d18f4a1d002538fd53a44d109c152879170f6f99 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Sun, 25 Mar 2018 13:16:16 +0200 Subject: [PATCH 0210/2153] fix: add `warnings` to `MinifyOutput` --- types/uglify-js/index.d.ts | 1 + types/uglify-js/uglify-js-tests.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/uglify-js/index.d.ts b/types/uglify-js/index.d.ts index 12bcefa7af..eca756bd53 100644 --- a/types/uglify-js/index.d.ts +++ b/types/uglify-js/index.d.ts @@ -198,6 +198,7 @@ export interface MinifyOptions { export interface MinifyOutput { error?: Error; + warnings?: string[]; code: string; map: string; } diff --git a/types/uglify-js/uglify-js-tests.ts b/types/uglify-js/uglify-js-tests.ts index 6b146ab0e7..19c11dfdf1 100644 --- a/types/uglify-js/uglify-js-tests.ts +++ b/types/uglify-js/uglify-js-tests.ts @@ -20,7 +20,7 @@ minify(code, { } }); -minify(code, { +const output = minify(code, { warnings: 'verbose', mangle: { properties: { @@ -34,3 +34,7 @@ minify(code, { arguments: true } }); + +if (output.warnings) { + output.warnings.filter(x => x === 'Dropping unused variable'); +} From 5cb7a9ee17d9f14518d7eb771e9ed4384a40fc45 Mon Sep 17 00:00:00 2001 From: Austin Turner Date: Sun, 25 Mar 2018 09:47:48 -0600 Subject: [PATCH 0211/2153] updated react-beautiful-dnd to 6.0 Included updates from version 5.0 and version 6.0 as per the docs: https://github.com/atlassian/react-beautiful-dnd/releases/tag/v5.0.0 https://github.com/atlassian/react-beautiful-dnd/releases/tag/v6.0.0 --- types/react-beautiful-dnd/index.d.ts | 35 ++++++++++++------- .../react-beautiful-dnd-tests.tsx | 16 ++++++--- 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/types/react-beautiful-dnd/index.d.ts b/types/react-beautiful-dnd/index.d.ts index e1dd58a179..d02c86bbcf 100644 --- a/types/react-beautiful-dnd/index.d.ts +++ b/types/react-beautiful-dnd/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for react-beautiful-dnd 4.0 +// Type definitions for react-beautiful-dnd 6.0 // Project: https://github.com/atlassian/react-beautiful-dnd // Definitions by: varHarrie // Bradley Ayers +// Austin Turner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -12,12 +13,18 @@ export type DraggableId = Id; export type DroppableId = Id; export type TypeId = Id; export type ZIndex = number | string; +export type DropReason = 'DROP' | 'CANCEL'; +export type Announce = (message: string) => void; export interface DraggableLocation { droppableId: DroppableId; index: number; } +export interface HookProvided { + announce: Announce; +} + /** * DragDropContext */ @@ -32,17 +39,14 @@ export interface DragUpdate extends DragStart { destination?: DraggableLocation | null; } -export interface DropResult { - draggableId: DraggableId; - type: TypeId; - source: DraggableLocation; - destination?: DraggableLocation | null; +export interface DropResult extends DragUpdate { + reason: DropReason; } export interface DragDropContextProps { - onDragStart?(initial: DragStart): void; - onDragUpdate?(initial: DragUpdate): void; - onDragEnd(result: DropResult): void; + onDragStart?(initial: DragStart, provided: HookProvided): void; + onDragUpdate?(initial: DragUpdate, provided: HookProvided): void; + onDragEnd(result: DropResult, provided: HookProvided): void; } export class DragDropContext extends React.Component {} @@ -51,9 +55,14 @@ export class DragDropContext extends React.Component {} * Droppable */ +export interface DroppableProvidedProps { + // used for shared global styles + 'data-react-beautiful-dnd-droppable': string; +} export interface DroppableProvided { innerRef(element: HTMLElement | null): any; placeholder?: React.ReactElement | null; + droppableProps: DroppableProvidedProps; } export interface DroppableStateSnapshot { @@ -103,12 +112,14 @@ export interface DraggableProvidedDraggableProps { export interface DraggableProvidedDragHandleProps { onMouseDown: React.MouseEventHandler; onKeyDown: React.KeyboardEventHandler; - onClick: React.MouseEventHandler; + onTouchStart: React.TouchEventHandler; + onTouchMove: React.TouchEventHandler; + 'data-react-beautiful-dnd-drag-handle': string; + 'aria-roledescription': string; tabIndex: number; 'aria-grabbed': boolean; draggable: boolean; - onDragStart(): void; - onDrop(): void; + onDragStart: React.DragEventHandler; } export interface DraggableProvided { diff --git a/types/react-beautiful-dnd/react-beautiful-dnd-tests.tsx b/types/react-beautiful-dnd/react-beautiful-dnd-tests.tsx index b05ff46550..882b28a9ad 100644 --- a/types/react-beautiful-dnd/react-beautiful-dnd-tests.tsx +++ b/types/react-beautiful-dnd/react-beautiful-dnd-tests.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom'; -import { DragDropContext, Draggable, Droppable, DropResult } from 'react-beautiful-dnd'; +import { DragDropContext, Draggable, Droppable, DropResult, DragStart, DragUpdate, HookProvided } from 'react-beautiful-dnd'; interface Item { id: string; @@ -49,7 +49,15 @@ class App extends React.Component<{}, AppState> { this.onDragEnd = this.onDragEnd.bind(this); } - onDragEnd(result: DropResult) { + onDragStart(dragStart: DragStart, provided: HookProvided) { + // + } + + onDragUpdate(dragUpdate: DragUpdate, provided: HookProvided) { + // + } + + onDragEnd(result: DropResult, provided: HookProvided) { if (!result.destination) { return; } @@ -65,10 +73,10 @@ class App extends React.Component<{}, AppState> { render() { return ( - + {(provided, snapshot) => ( -
    +
    {this.state.items.map((item, index) => ( {(provided, snapshot) => ( From e43d96d643b07f17d3703e393d06d0a30ef73aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez?= Date: Sun, 25 Mar 2018 21:18:27 +0200 Subject: [PATCH 0212/2153] Fix async-retry's exports The exports of the package async-retry were misrepresenting the original package's. --- types/async-retry/async-retry-tests.ts | 3 ++- types/async-retry/index.d.ts | 30 +++++++++++++++++--------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/types/async-retry/async-retry-tests.ts b/types/async-retry/async-retry-tests.ts index 29c90b36c8..68327b66bd 100644 --- a/types/async-retry/async-retry-tests.ts +++ b/types/async-retry/async-retry-tests.ts @@ -1,4 +1,5 @@ -import { Options, RetryFunction, retry } from 'async-retry'; +import { Options, RetryFunction } from 'async-retry'; +import retry = require("async-retry"); const o: Options = { retries: 1, diff --git a/types/async-retry/index.d.ts b/types/async-retry/index.d.ts index 38d0d8aeec..fdbc9ecf24 100644 --- a/types/async-retry/index.d.ts +++ b/types/async-retry/index.d.ts @@ -1,17 +1,27 @@ -// Type definitions for async-retry 1.1 +// Type definitions for async-retry 1.2 // Project: https://github.com/zeit/async-retry#readme // Definitions by: Albert Wu +// Pablo Rodríguez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export function retry(fn: RetryFunction, opts: Options): Promise; +declare function AsyncRetry( + fn: AsyncRetry.RetryFunction, + opts: AsyncRetry.Options +): Promise; -export interface Options { - retries?: number; - factor?: number; - minTimeout?: number; - maxTimeout?: number; - randomize?: boolean; - onRetry?: (e: Error) => any; +declare namespace AsyncRetry { + function retry(fn: RetryFunction, opts: Options): Promise; + + interface Options { + retries?: number; + factor?: number; + minTimeout?: number; + maxTimeout?: number; + randomize?: boolean; + onRetry?: (e: Error) => any; + } + + type RetryFunction = (bail: (e: Error) => A, attempt: number) => A|Promise; } -export type RetryFunction = (bail: (e: Error) => A, attempt: number) => A|Promise; +export = AsyncRetry; From f113a24a8c3783fa8c773c78af72981e4d37f0d2 Mon Sep 17 00:00:00 2001 From: Aleksey Klimenko Date: Mon, 26 Mar 2018 02:13:46 +0300 Subject: [PATCH 0213/2153] fix(@feathersjs/express): defined 'rest' as calllable-object and fixed codystyle --- types/feathersjs__express/feathersjs__express-tests.ts | 2 +- types/feathersjs__express/index.d.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/types/feathersjs__express/feathersjs__express-tests.ts b/types/feathersjs__express/feathersjs__express-tests.ts index 6120ed483f..1bd1f5221a 100644 --- a/types/feathersjs__express/feathersjs__express-tests.ts +++ b/types/feathersjs__express/feathersjs__express-tests.ts @@ -1,5 +1,5 @@ import feathers, { Application } from '@feathersjs/feathers'; -import feathersExpress, * as express from "@feathersjs/express"; +import feathersExpress, * as express from '@feathersjs/express'; const app = feathersExpress(feathers()); diff --git a/types/feathersjs__express/index.d.ts b/types/feathersjs__express/index.d.ts index 16bff00cd4..d526a3db0c 100644 --- a/types/feathersjs__express/index.d.ts +++ b/types/feathersjs__express/index.d.ts @@ -19,10 +19,10 @@ export function errorHandler(options?: { }): express.ErrorRequestHandler; export function notFound(): express.RequestHandler; -export function rest(): (handler?: express.RequestHandler) => void; -export namespace rest { - let formatter: express.RequestHandler; -} +export const rest: { + (handler?: express.RequestHandler): () => void; + formatter: express.RequestHandler; +}; /* * Re-export of the express package. From fd991797cd15c8bffea86bc8406f3f027f48d48b Mon Sep 17 00:00:00 2001 From: Philip Jackson Date: Mon, 26 Mar 2018 14:37:03 +1300 Subject: [PATCH 0214/2153] Add `innerRef` prop to component An `innerRef` prop was added to in `react-router-dom@4.2` The node will be an anchor tag, which is why I made the callback accept an `HTMLAnchorElement` rather than an `HTMLElement`, however this isn't explicitly documented. --- types/react-router-dom/index.d.ts | 2 ++ types/react-router-dom/react-router-dom-tests.tsx | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/types/react-router-dom/index.d.ts b/types/react-router-dom/index.d.ts index c5b795761c..9165f1182e 100644 --- a/types/react-router-dom/index.d.ts +++ b/types/react-router-dom/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/ReactTraining/react-router // Definitions by: Tanguy Krotoff // Huy Nguyen +// Philip Jackson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -44,6 +45,7 @@ export class HashRouter extends React.Component {} export interface LinkProps extends React.AnchorHTMLAttributes { to: H.LocationDescriptor; replace?: boolean; + innerRef?: (node: HTMLAnchorElement | null) => void; } export class Link extends React.Component {} diff --git a/types/react-router-dom/react-router-dom-tests.tsx b/types/react-router-dom/react-router-dom-tests.tsx index c748405580..0fedbe412e 100644 --- a/types/react-router-dom/react-router-dom-tests.tsx +++ b/types/react-router-dom/react-router-dom-tests.tsx @@ -2,7 +2,8 @@ import * as React from 'react'; import { NavLink, NavLinkProps, - match + match, + Link } from 'react-router-dom'; import * as H from 'history'; @@ -19,3 +20,8 @@ export default function(props: Props) { ); } + +; + +const acceptRef = (node: HTMLAnchorElement | null) => {}; +; From 8206cfa97338fa0cd0b9cf64cb6747738c96da81 Mon Sep 17 00:00:00 2001 From: Ricardo De Pena Date: Sun, 25 Mar 2018 21:40:12 -0400 Subject: [PATCH 0215/2153] Backed up v17 definitions to the v17 folder, moved v29 definitions to the index folder. --- types/openfin/index.d.ts | 3581 +++++++++++----------- types/openfin/openfin-tests.ts | 1472 ++++----- types/openfin/tsconfig.json | 9 +- types/openfin/tslint.json | 5 +- types/openfin/v17/index.d.ts | 1732 +++++++++++ types/openfin/v17/openfin-tests.ts | 721 +++++ types/openfin/{v29 => v17}/tsconfig.json | 9 +- types/openfin/v17/tslint.json | 6 + types/openfin/v29/index.d.ts | 1891 ------------ types/openfin/v29/openfin-tests.ts | 797 ----- types/openfin/v29/tslint.json | 3 - 11 files changed, 5113 insertions(+), 5113 deletions(-) create mode 100644 types/openfin/v17/index.d.ts create mode 100644 types/openfin/v17/openfin-tests.ts rename types/openfin/{v29 => v17}/tsconfig.json (77%) create mode 100644 types/openfin/v17/tslint.json delete mode 100644 types/openfin/v29/index.d.ts delete mode 100644 types/openfin/v29/openfin-tests.ts delete mode 100644 types/openfin/v29/tslint.json diff --git a/types/openfin/index.d.ts b/types/openfin/index.d.ts index 30afded19b..3ddbdf2edd 100644 --- a/types/openfin/index.d.ts +++ b/types/openfin/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for OpenFin API 17.0 +// Type definitions for OpenFin API 29.0 // Project: https://openfin.co/ // Definitions by: Chris Barker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// based on v6.49.17.14 +// based on v8.56.29.51 // see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean /** @@ -18,1715 +18,1874 @@ * * Overview * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API - * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "document" objects. + * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "documennt" objects. */ declare namespace fin { - const desktop: OpenFinDesktop; - - interface OpenFinDesktop { - main(f: () => any): void; - Application: OpenFinApplicationStatic; - ExternalApp: OpenFinExternalApplicationStatic; - InterApplicationBus: OpenFinInterApplicationBus; - Notification: OpenFinNotificationStatic; - System: OpenFinSystem; - Window: OpenFinWindowStatic; - } - - interface OpenFinApplicationStatic { - /** - * Creates a new Application. - * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. - */ - new ( - options: ApplicationOptions, - callback?: (successObj: { httpResponseCode: number }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; - /** - * Returns an Application object that represents an existing application. - */ - getCurrent(): OpenFinApplication; - /** - * Returns an Application object that represents an existing application. - */ - wrap(uuid: string): OpenFinApplication; - } - - /** - * Application - * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. - */ - interface OpenFinApplication { - /** - * Returns an instance of the main Window of the application - */ - getWindow(): OpenFinWindow; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinApplicationEventType, - listener: (event: ApplicationBaseEvent - | TrayIconClickedEvent - | WindowEvent - | WindowAlertRequestedEvent - | WindowAuthRequested - | WindowNavigationRejectedEvent - | WindowEndLoadEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Closes the application and any child windows created by the application. - */ - close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. - */ - getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. - */ - getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. - */ - getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. - */ - getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves current configuration of application's shortcuts. - */ - getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves information about the application. - */ - getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Determines if the application is currently running. - */ - isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; - /** - * Passes in custom data that will be relayed to the RVM - */ - registerCustomData(data: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinApplicationEventType, - previouslyRegisteredListener: (event: ApplicationBaseEvent - | TrayIconClickedEvent - | WindowEvent - | WindowAlertRequestedEvent - | WindowAuthRequested - | WindowNavigationRejectedEvent - | WindowEndLoadEvent) => any, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Removes the application's icon from the tray. - */ - removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Restarts the application. - */ - restart(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Runs the application. When the application is created, run must be called. - */ - run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * Tells the rvm to relaunch the main application once upon a complete shutdown - */ - scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets new shortcut configuration for current application. - * Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to - * be able to change shortcut states. - */ - setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Adds a customizable icon in the system tray and notifies the application when clicked. - */ - setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Closes the application by terminating its process. - */ - terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application - * to continue and to generate another "not-responding" message after a certain period of time. - */ - wait(callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface ShortCutConfig { - /** - * application has a shortcut on the desktop - */ - desktop?: boolean; - /** - * application has no shortcut in the start menu - */ - startMenu?: boolean; - /** - * application will be launched on system startup - */ - systemStartup?: boolean; - } - - interface SuccessObj { - httpResponseCode: number; - } - - interface NetworkErrorInfo extends ErrorInfo { - networkErrorCode: number; - } - - interface ErrorInfo { - stack: string; - message: string; - } - - interface ApplicationOptions { - /** - * The name of the application. - */ - name?: string; - /** - * The url to the application. - */ - url?: string; - /** - * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. - */ - uuid?: string; - /** - * Enable Flash at the application level. Default: false. - */ - plugins?: boolean; - /** - * The options of the main window of the application. - */ - mainWindowOptions?: WindowOptions; - } - - interface WindowOptions { - /** - * Enable keyboard shortcuts for devtools and zoom. Default: false for both. - */ - accelerator?: { - devtools?: boolean, - zoom?: boolean, - reload?: boolean, - reloadIgnoreCache?: boolean, - }; - /** - * A flag to always position the window at the top of the window stack. Default: false. - * Updatable - */ - alwaysOnTop?: boolean; - /** - * A flag to automatically show the Window when it is created. Default: false. - */ - autoShow?: boolean; - /** - * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true - * Updatable - */ - contextMenu?: boolean; - /** - * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. - * Updatable - */ - cornerRounding?: { - width?: number; - height?: number; - }; - /** - * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. - */ - customData?: any; - /** - * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the position from before the window was closed is used. - * This option overrides defaultLeft and defaultTop. Default: false. - */ - defaultCentered?: boolean; - /** - * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. - */ - defaultHeight?: number; - /** - * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. - */ - defaultWidth?: number; - /** - * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. - */ - defaultTop?: number; - /** - * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. - */ - defaultLeft?: number; - /** - * A flag to show the frame. Default: true. - * Updatable - */ - frame?: boolean; - /** - * A flag to allow a window to be hidden when the close button is clicked.Default: false. - * Updatable - */ - hideOnClose?: boolean; - /** - * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. - * Updatable - */ - icon?: string; - /** - * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. - * Updatable - */ - maxHeight?: number; - /** - * A flag that lets the window be maximized.Default: true. - * Updatable - */ - maximizable?: boolean; - /** - * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. - * Updatable - */ - maxWidth?: number; - /** - * The minimum height of a window.Default: 0. - * Updatable - */ - minHeight?: number; - /** - * A flag that lets the window be minimized.Default: true. - */ - minimizable?: boolean; - /** - * The minimum width of a window.Default: 0. - */ - minWidth?: number; - /** - * The name for the window which must be unique within the context of the invoking Application. - */ - name?: string; - /** - * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. - * Updatable - */ - opacity?: number; - /** - * A flag to drop to allow the user to resize the window.Default: true. - * Updatable - */ - resizable?: boolean; - /** - * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. - * Updatable - */ - resizeRegion?: { - /** - * The size in pixels (Default: 2), - */ - size?: number; - /** - * The size in pixels of an additional - * square resizable region located at the - * bottom right corner of a - * frameless window. (Default: 4) - */ - bottomRightCorner?: number; - }; - /** - * A flag to show the Window's icon in the taskbar. Default: true. - */ - showTaskbarIcon?: boolean; - /** - * A flag to cache the location of the window or not. Default: true. - */ - saveWindowState?: boolean; - /** - * Specify a taskbar group for the window. Default: app's uuid. - */ - taskbarIconGroup?: string; - /** - * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". - */ - state?: string; - /** - * The URL of the window. Default: "about:blank". - */ - url?: string; - /** - * When set to false, the window will render before the "load" event is fired on the content's window. - * Caution, when false you will see an initial empty white window. Default: true. - */ - waitForPageLoad?: boolean; - } - - /** - * Clipboard - * Clipboard API allows reading and writting to the clipboard in multiple formats. - */ - interface OpenFinClipboard { - /** - * Reads available formats for the clipboard type - */ - availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Reads available formats for the clipboard type - */ - readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Read the content of the clipboard as Rtf - */ - readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Read the content of the clipboard as plain text - */ - readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard - */ - write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as Html - */ - writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as Rtf - */ - writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as plain text - */ - writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - } - - interface OpenFinExternalApplicationStatic { - /** - * Returns an External Application object that represents an existing external application. - */ - wrap(uuid: string): OpenFinExternalApplication; - } - /** - * ExternalApplication - * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. - */ - interface OpenFinExternalApplication { - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinExternalApplicationEventType, - listener: () => void, - callback?: () => void, - errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinExternalApplicationEventType, - listener: () => void, - callback?: () => void, - errorCallback?: (reason: string, error: ErrorInfo) => void): void; - } - - /** - * InterApplicationBus - * A messaging bus that allows for pub/sub messaging between different applications. - */ - interface OpenFinInterApplicationBus { - /** - * Adds a listener that gets called when applications subscribe to the current application's messages. - */ - addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Adds a listener that gets called when applications unsubscribe to the current application's messages. - */ - addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Removes a previously registered subscribe listener. - */ - removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Removes a previously registered unsubscribe listener. - */ - removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. - */ - publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sends a message to a specific application on a specific topic. - */ - send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], - * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. - */ - subscribe( - senderUuid: string, - name: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - subscribe( - senderUuid: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Unsubscribes to messages from the specified application on the specified topic. - */ - unsubscribe( - senderUuid: string, - name: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - unsubscribe( - senderUuid: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - } - - interface OpenFinNotificationStatic { - /** - * ctor - */ - new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; - /** - * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. - */ - getCurrent(): OpenFinNotification; - } - - /** - * Notification - * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. - * A notification is typically used to alert the user of some important event which requires his or her attention. - * Notifications are a child or your application that are controlled by the runtime. - */ - interface OpenFinNotification { - /** - * Closes the notification. - */ - close(callback?: () => void): void; - /** - * Sends a message to the notification. - */ - sendMessage(message: any, callback?: () => void): void; - /** - * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. - */ - sendMessageToApplication(message: any, callback?: () => void): void; - } - - interface NotificationOptions { - /** - * A boolean that will force dismissal even if the mouse is hovering over the notification - */ - ignoreMouseOver?: boolean; - /** - * A message of any primitive or composite-primitive type to be passed to the notification upon creation. - */ - message?: any; - /** - * The timeout for displaying a notification.Can be in milliseconds or "never". - */ - duration?: number | "never"; - /** - * The url of the notification - */ - url?: string; - /** - * A function that is called when a notification is clicked. - */ - onClick?(callback: () => void): void; - /** - * Invoked when the notification is closed via .close() method on the created notification instance - * or the by the notification itself via fin.desktop.Notification.getCurrent().close(). - * NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss - */ - onClose?(callback: () => void): void; - /** - * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. - */ - onDismiss?(callback: () => void): void; - /** - * A function that is called when an error occurs.The reason for the error is passed as an argument. - */ - onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * The onMessage function will respond to messages sent from notification.sendMessageToApplication. - * The function is passed the message, which can be of any primitive or composite-primitive type. - */ - onMessage?(callback: (message: any) => void): void; - /** - * A function that is called when a notification is shown. - */ - onShow?(callback: (successObj: SuccessObj) => void): void; - } - - /** - * System - * An object representing the core of OpenFin Runtime. - * Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. - */ - interface OpenFinSystem { - Clipboard: OpenFinClipboard; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinSystemEventType, - listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Clears cached data containing window state/positions, - * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. - */ - clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Clears all cached data when OpenFin Runtime exits. - */ - deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Downloads the given application asset - */ - downloadAsset( - assetObj: AppAssetInfo, - progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, - callback?: (successObj: { path: string }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * Exits the Runtime. - */ - exit(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data for all applications. - */ - getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data for all external applications. - */ - getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data (name, ids, bounds) for all application windows. - */ - getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the command line argument string that started OpenFin Runtime. - */ - getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the configuration object that started the OpenFin Runtime. - */ - getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the value of a given environment variable on the computer on which the runtime is installed. - */ - getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves system information. - */ - getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the contents of the log with the specified filename. - */ - getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array containing information for each log file. - */ - getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. - */ - getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the mouse in virtual screen coordinates (left, top). - */ - getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of all of the runtime processes that are currently running. - * Each element in the array is an object containing the uuid and the name of the application to which the process belongs. - */ - getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the Proxy settings. - */ - getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns information about the running RVM in an object. - */ - getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. - */ - getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Runs an executable or batch file. - */ - launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; - /** - * Writes the passed message into both the log file and the console. - */ - log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Monitors a running process. - */ - monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; - /** - * Opens the passed URL in the default web browser. - */ - openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * This function call will register a unique id and produce a token. The token can be used to broker an external connection. - */ - registerExternalConnection( - uuid: string, - callback?: (detail: { - /** - * this will be unique each time - */ - token: string; - /** - * "remote-connection-uuid" - */ - uuid: string; - }) => void, - errorCallback?: (reason: string) => void): void; - /** - * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). - */ - releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinSystemEventType, - listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the Chrome Developer Tools for the specified window. - */ - showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. - */ - terminateExternalProcess( - processUuid: string, - timeout: number, - killTree: boolean, - callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, - errorCallback?: (reason: string) => void): void; - terminateExternalProcess( - processUuid: string, - timeout: number, - callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, - errorCallback?: (reason: string) => void): void; - /** - * Update the OpenFin Runtime Proxy settings. - */ - updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface CacheOptions { - cache?: boolean; - cookies?: boolean; - localStorage?: boolean; - appcache?: boolean; - userData?: boolean; - } - - interface AppAssetInfo { - src?: string; - alias?: string; - version?: string; - target?: string; - args?: string; - } - - interface ApplicationInfo { - /** - * true when the application is running. - */ - isRunning?: boolean; - /** - * uuid of the application. - */ - uuid?: string; - /** - * uuid of the application that launches this application. - */ - parentUuid?: string; - } - - interface WindowDetails { - uuid?: string; - mainWindow?: WindowInfo; - childWindows?: WindowInfo[]; - } - - interface WindowInfo { - /** - * name of the child window - */ - name?: string; - /** - * top-most coordinate of the child window - */ - top?: number; - /** - * right-most coordinate of the child window - */ - right?: number; - /** - * bottom-most coordinate of the child window - */ - bottom?: number; - /** - * left-most coordinate of the child window - */ - left?: number; - } - - interface HostSpecInfo { - /** - * "x86" for 32-bit or "x86_64" for 64-bit - */ - arch: string; - /** - * Same payload as Node's os.cpus() - */ - cpus: NodeCpuInfo[]; - gpu: { - /** - * Graphics card name - */ - name: string; - }; - /** - * Same payload as Node's os.totalmem() - */ - memory: number; - /** - * OS name and version/edition - */ - name: string; - } - - interface NodeCpuInfo { - model: string; - /** - * in MHz - */ - speed: number; - times: { - /** - * The number of milliseconds the CPU has spent in user mode. - */ - user: number; - /** - * The number of milliseconds the CPU has spent in nice mode. - */ - nice: number; - /** - * The number of milliseconds the CPU has spent in sys mode. - */ - sys: number; - /** - * The number of milliseconds the CPU has spent in idle mode. - */ - idle: number; - /** - * The number of milliseconds the CPU has spent in irq mode. - */ - irq: number; - }; - } - - interface LogInfo { - /** - * the filename of the log - */ - name?: string; - /** - * the size of the log in bytes - */ - size?: number; - /** - * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" - */ - date?: string; - } - - interface ProcessInfo { - /** - * the percentage of total CPU usage - */ - cpuUsage?: number; - /** - * the application name - */ - name?: string; - /** - * the current nonpaged pool usage in bytes - */ - nonPagedPoolUsage?: number; - /** - * the number of page faults - */ - pageFaultCount?: number; - /** - * the current paged pool usage in bytes - */ - pagedPoolUsage?: number; - /** - * the total amount of memory in bytes that the memory manager has committed - */ - pagefileUsage?: number; - /** - * the peak nonpaged pool usage in bytes - */ - peakNonPagedPoolUsage?: number; - /** - * the peak paged pool usage in bytes - */ - peakPagedPoolUsage?: number; - /** - * the peak value in bytes of pagefileUsage during the lifetime of this process - */ - peakPagefileUsage?: number; - /** - * the peak working set size in bytes - */ - peakWorkingSetSize?: number; - /** - * the native process identifier - */ - processId?: number; - /** - * the application UUID - */ - uuid?: string; - /** - * the current working set size (both shared and private data) in bytes - */ - workingSetSize?: number; - } - - interface ProxyInfo { - /** - * the configured Proxy Address - */ - proxyAddress?: string; - /** - * the configured Proxy port - */ - proxyPort?: number; - /** - * Proxy Type - */ - type?: string; - } - - interface RvmInfo { - version?: string; - "start-time"?: string; - } - - interface ExternalProcessLaunchInfo { - path?: string; - /** - * Additionally note that the executable found in the zip file specified in appAssets - * will default to the one mentioned by appAssets.target - * If the the path below refers to a specific path it will override this default - */ - alias?: string; - /** - * When using alias; if no arguments are passed then the arguments (if any) - * are taken from the 'app.json' file, from the 'args' parameter - * of the 'appAssets' Object with the relevant 'alias'. - * If 'arguments' is passed as a parameter it takes precedence - * over any 'args' set in the 'app.json'. - */ - arguments?: string; - listener?(result: { - /** - * "Exited" Or "released" on a call to releaseExternalProcess - */ - topic?: string; - /** - * The mapped UUID which identifies the launched process - */ - uuid?: string; - /* - * Process exit code - */ - exitCode?: number; - }): void; - certificate?: CertificationInfo; - } - - interface CertificationInfo { - /** - * A hex string with or without spaces - */ - serial?: string; - /** - * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields - */ - subject?: string; - /** - * A hex string with or without spaces - */ - publickey?: string; - /** - * A hex string with or without spaces - */ - thumbprint?: string; - /** - * A boolean indicating that the certificate is trusted and not revoked - */ - trusted?: boolean; - } - - interface ExternalProcessInfo { - pid?: number; - listener?(result: { - /** - * "Exited" Or "released" on a call to releaseExternalProcess - */ - topic?: string; - /** - * The mapped UUID which identifies the launched process - */ - uuid?: string; - /* - * Process exit code - */ - exitCode?: number; - }): void; - } - - interface OpenFinWindowStatic { - /** - * Class: Window - * - * new Window(options, callbackopt, errorCallbackopt) - * - * Creates a new OpenFin Window - * - * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, - * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. - * The new window appears in the same process as the parent window. - * @param options - The options of the window - * @param [callback] - Called if the window creation was successful - * @param [callback.successObj] - httpResponseCode - */ - new ( - options: WindowOptions, - callback?: (successObj: { httpResponseCode: number }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; - /** - * Returns an instance of the current window. - * @returns Current window - */ - getCurrent(): OpenFinWindow; - /** - * Returns a Window object that wraps an existing window. - */ - wrap(appUuid: string, windowName: string): OpenFinWindow; - } - - /** - * Window - * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, - * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. - * The new window appears in the same process as the parent window. - */ - interface OpenFinWindow { - /** - * Name of window - */ - name: string; - /** - * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, - * otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the - * contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. - * Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). - * @returns Native window - */ - getNativeWindow(): Window; - /** - * Gets the parent application. - * @returns Parent application - */ - getParentApplication(): OpenFinApplication; - /** - * Gets the parent window. - */ - getParentWindow(): OpenFinWindow; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinWindowEventType, - listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Performs the specified window transitions - */ - animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; - /** - * Provides credentials to authentication requests - */ - authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Removes focus from the window. - */ - blur(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Brings the window to the front of the OpenFin window stack. - */ - bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Closes the window. - * @param Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. - */ - close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Prevents a user from changing a window's size/position when using the window's frame. - * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. - * 'disabled-frame-bounds-changed' is generated after a user move/size operation. - * The events provide the bounds that would have been applied if the frame was enabled. - * 'frame-disabled' is generated when an enabled frame becomes disabled. - */ - disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Re-enables user changes to a window's size/position when using the window's frame. - * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. - * 'disabled-frame-bounds-changed' is generated after a user move/size operation. - * The events provide the bounds that would have been applied if the frame was enabled. - * 'frame-enabled' is generated when a disabled frame has becomes enabled. - */ - enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Flashes the window's frame and taskbar icon until the window is activated. - */ - flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Gives focus to the window. - */ - focus(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current bounds (top, left, width, height) of the window. - */ - getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. - * Please note that calling window is included in the result array. - */ - getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current settings of the window. - */ - getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets a base64 encoded PNG snapshot of the window. - */ - getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current state ("minimized", "maximized", or "restored") of the window. - */ - getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the zoom level of the window. - */ - getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; - /** - * Hides the window. - */ - hide(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Determines if the window is currently showing. - */ - isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; - /** - * Joins the same window group as the specified window. - */ - joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Leaves the current window group so that the window can be move independently of those in the group. - */ - leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Maximizes the window. - */ - maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Merges the instance's window group with the same window group as the specified window - */ - mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Minimizes the window. - */ - minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Moves the window by a specified amount. - */ - moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Moves the window to a specified location. - */ - moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinWindowEventType, - listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Resizes the window by a specified amount. - */ - resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Resizes the window by a specified amount. - */ - resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Restores the window to its normal state (i.e., unminimized, unmaximized). - */ - restore(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Will bring the window to the front of the entire stack and give it focus. - */ - setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets the window's size and position - */ - setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets the zoom level of the window. - */ - setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the window if it is hidden. - * @param Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. - */ - show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. - */ - showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Stops the taskbar icon from flashing. - */ - stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Updates the window using the passed options - */ - updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface ApplicationBaseEvent { - topic: string; - type: OpenFinApplicationEventType; - uuid: string; - } - - interface TrayIconClickedEvent extends ApplicationBaseEvent { - button: number; // 0 for left, 1 for middle, 2 for right - monitorInfo: MonitorInfo; - x: number; // the cursor x coordinate - y: number; // the cursor y coordinate - } - - interface WindowEvent extends ApplicationBaseEvent { - name: string; - } - - interface WindowAlertRequestedEvent extends WindowEvent { - message: string; - url: string; - } - - interface WindowAuthRequested extends WindowEvent { - authInfo: { - host: string; - isProxy: boolean; - port: number; - realm: string; - scheme: string; - }; - } - - interface WindowNavigationRejectedEvent extends WindowEvent { - sourceName: string; - url: string; - } - - interface WindowEndLoadEvent extends WindowEvent { - documentName: string; - isMain: boolean; - } - - interface MonitorInfoChangedEvent extends MonitorInfo { - topic: "system"; - type: "monitor-info-changed"; - } - - interface MonitorInfo { - nonPrimaryMonitors: MonitorInfoDetail[]; - primaryMonitor: MonitorInfoDetail; - reason: string; - taskbar: { - edge: "left" | "right" | "top" | "bottom", - rect: MontiorCoordinates - }; - topic: "system"; - type: "monitor-info-changed"; - virtualScreen: MontiorCoordinates; - } - - interface MonitorInfoDetail { - availableRect: MontiorCoordinates; - deviceId: string; - displayDeviceActive: boolean; - monitorRect: MontiorCoordinates; - name: string; - } - - interface MontiorCoordinates { - bottom: number; - left: number; - right: number; - top: number; - } - - interface VirtualScreenCoordinates { - left: number; - top: number; - } - - interface SystemBaseEvent { - topic: string; - type: OpenFinSystemEventType; - uuid: string; - } - - interface DesktopIconClickedEvent { - mouse: { - /** - * the left virtual screen coordinate of the mouse - */ - left: number, - /** - * the top virtual screen coordinate of the mouse - */ - top: number - }; - /** - * the number of milliseconds that have elapsed since the system was started, - */ - tickCount: number; - topic: "system"; - type: "desktop-icon-clicked"; - } - - interface IdleStateChangedEvent { - /** - * How long in milliseconds since the user has been idle. - */ - elapsedTime: number; - /** - * true when the user is idle,false when the user has returned; - */ - isIdle: boolean; - topic: "system"; - type: "idle-state-changed"; - } - - interface WindowBaseEvent { - /** - * the name of the window - */ - name: string; - /** - * always window - */ - topic: "window"; - /** - * window event type - */ - type: OpenFinWindowEventType; - /** - * the UUID of the application the window belongs to - */ - uuid: string; - } - - interface WindowAuthRequestedEvent extends WindowBaseEvent { - authInfo: { - host: string; - isProxy: boolean; - port: number; - realm: string; - scheme: string; - }; - } - - interface WindowBoundsEvent extends WindowBaseEvent { - /** - * describes what kind of change occurred. - * 0 means a change in position. - * 1 means a change in size. - * 2 means a change in position and size. - */ - changeType: number; - /** - * true when pending changes have been applied to the window. - */ - deferred: boolean; - /** - * the new height of the window. - */ - height: number; - /** - * the left-most coordinate of the window. - */ - left: number; - /** - * the top-most coordinate of the window. - */ - top: number; - - type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; - /** - * the new width of the window. - */ - width: number; - } - - interface WindowExternalProcessStartedEvent extends WindowBaseEvent { - /** - * the process handle uuid - */ - processUuid: string; - type: "external-process-started"; - } - - interface WindowExternalProcessExited extends WindowBaseEvent { - /** - * the process exit code - */ - exitCode: number; - /** - * the process handle uuid - */ - processUuid: string; - type: "external-process-exited"; - } - - interface WindowGroupChangedEvent extends WindowBaseEvent { - /** - * Which group array the window that the event listener was registered on is included in: - * 'source' The window is included in sourceGroup. - * 'target' The window is included in targetGroup. - * 'nothing' The window is not included in sourceGroup nor targetGroup. - */ - memberOf: "source" | "target" | "nothing"; - /** - * The reason this event was triggered. - * 'leave' A window has left the group due to a leave or merge with group. - * 'join' A window has joined the group. - * 'merge' Two groups have been merged together. - * 'disband' There are no other windows in the group. - */ - reason: "leave" | "join" | "merge" | "disband"; - /** - * All the windows in the group the sourceWindow originated from. - */ - sourceGroup: WindowOfGroupInfo[]; - /** - * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. - */ - sourceWindowAppUuid: string; - /** - * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. - */ - sourceWindowName: string; - /** - * All the windows in the group the targetWindow orginated from - */ - targetGroup: WindowOfGroupInfo[]; - /** - * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). - */ - targetWindowAppUuid: string; - /** - * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). - */ - targetWindowName: string; - type: "group-changed"; - } - - interface WindowOfGroupInfo { - /** - * The UUID of the application this window entry belongs to. - */ - appUuid: string; - /** - * The name of this window entry. - */ - windowName: string; - } - - interface WindowHiddenEvent extends WindowBaseEvent { - /** - * What action prompted the close. - * The reasons are: "hide", "hide-on-close" - */ - reason: "hide" | "hide-on-close"; - type: "hidden"; - } - - interface Window_NavigationRejectedEvent { - name: string; - /** - * source of navigation window name - */ - sourceName: string; - topic: "navigation-rejected"; - /** - * Url that was not reached "http://blocked-content.url" - */ - url: string; - /** - * the UUID of the application the window belongs to. - */ - uuid: string; - } - - interface AnimationTransition { - opacity?: { - /** - * This value is clamped from 0.0 to 1.0 - */ - opacity?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'opacity' as absolute or as a delta. Defaults to false. - */ - relative?: boolean; - }; - position?: { - /** - * Defaults to the window's current left position in virtual screen coordinates. - */ - left?: number; - /** - * Defaults to the window's current top position in virtual screen coordinates. - */ - top?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. - */ - relative?: boolean; - }; - size?: { - /** - * Optional if height is present. Defaults to the window's current width. - */ - width?: number; - /** - * Optional if width is present. Defaults to the window's current height. - */ - height?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. - */ - relative?: boolean; - }; - } - - interface AnimationOptions { - /** - * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. - */ - interrupt?: boolean; - /** - * Transition effect. Defaults to 'ease-in-out'. - */ - tween?: OpenFinTweenType; - } - - interface WindowBounds { - /** - * the height of the window. - */ - height?: number; - /** - * left-most coordinate of the window. - */ - left?: number; - /** - * top-most coordinate of the window. - */ - top?: number; - /** - * the width of the window. - */ - width?: number; - } - - interface SessionChangedEvent { - /** - * the action that triggered this event: - */ - reason: "lock" - | "unlock" - | "remote-connect" - | "remote-disconnect" - | "unknown"; - topic: "system"; - type: "session-changed"; - } - - interface LaunchInfo { - launchMode: "fin-protocol" - | "fins-protocol" - | "shortcut" - | "command-line" - | "adapter" - | "other" - | string; - } - - type OpenFinTweenType = "linear" - | "ease-in" - | "ease-out" - | "ease-in-out" - | "ease-in-quad" - | "ease-out-quad" - | "ease-in-out-quad" - | "ease-in-cubic" - | "ease-out-cubic" - | "ease-in-out-cubic" - | "ease-out-bounce" - | "ease-in-back" - | "ease-out-back" - | "ease-in-out-back" - | "ease-in-elastic" - | "ease-out-elastic" - | "ease-in-out-elastic"; - - type OpenFinApplicationEventType = "closed" - | "connected" - | "crashed" - | "initialized" - | "manifest-changed" - | "not-responding" - | "out-of-memory" - | "responding" - | "run-requested" - | "started" - | "tray-icon-clicked" - | "window-alert-requested" - | "window-auth-requested" - | "window-closed" - | "window-created" - | "window-end-load" - | "window-navigation-rejected" - | "window-show-requested" - | "window-start-load"; - - type OpenFinExternalApplicationEventType = "connected" - | "disconnected"; - - type OpenFinSystemEventType = "application-closed" - | "application-crashed" - | "application-created" - | "application-started" - | "desktop-icon-clicked" - | "idle-state-changed" - | "monitor-info-changed" - | "session-changed"; - - type OpenFinWindowEventType = "auth-requested" - | "blurred" - | "bounds-changed" - | "bounds-changing" - | "close-requested" - | "closed" - | "disabled-frame-bounds-changed" - | "disabled-frame-bounds-changing" - | "embedded" - | "external-process-exited" - | "external-process-started" - | "focused" - | "frame-disabled" - | "frame-enabled" - | "group-changed" - | "hidden" - | "initialized" - | "maximized" - | "minimized" - | "navigation-rejected" - | "restored" - | "show-requested" - | "shown"; - - type OpenFinAnchor = "top-left" - | "top-right" - | "bottom-left" - | "bottom-right"; + const desktop: OpenFinDesktop; + + interface OpenFinDesktop { + main(f: () => any): void; + Application: OpenFinApplicationStatic; + ExternalApp: OpenFinExternalApplicationStatic; + InterApplicationBus: OpenFinInterApplicationBus; + Notification: OpenFinNotificationStatic; + System: OpenFinSystem; + Window: OpenFinWindowStatic; + Frame: OpenFinFrameStatic; + } + + interface OpenFinApplicationStatic { + /** + * Creates a new Application. + * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. + */ + new ( + options: ApplicationOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; + /** + * Launches the given Application manifest. + */ + createFromManifest(manifestUrl: string, callback?: (app: OpenFinApplication) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Returns an Application object that represents an existing application. + */ + getCurrent(): OpenFinApplication; + /** + * Returns an Application object that represents an existing application. + */ + wrap(uuid: string): OpenFinApplication; + } + + /** + * Application + * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. + */ + interface OpenFinApplication { + /** + * Returns an instance of the main Window of the application + */ + getWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinApplicationEventType, + listener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Closes the application and any child windows created by the application. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. + */ + getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. + */ + getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. + */ + getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. + */ + getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves current configuration of application's shortcuts. + */ + getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves information about the application. + */ + getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves information about the system tray. + */ + getTrayIconInfo(callback?: (trayInfo: TrayIconInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the application is currently running. + */ + isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Registers a username and an app name for licensing purposes. + */ + registerUser(userName: string, appName: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinApplicationEventType, + previouslyRegisteredListener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => any, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the application's icon from the tray. + */ + removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restarts the application. + */ + restart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Runs the application. When the application is created, run must be called. + */ + run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Tells the rvm to relaunch the main application once upon a complete shutdown + */ + scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets new shortcut configuration for current application. + * Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to + * be able to change shortcut states. + */ + setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Adds a customizable icon in the system tray and notifies the application when clicked. + */ + setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the application by terminating its process. + */ + terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application + * to continue and to generate another "not-responding" message after a certain period of time. + */ + wait(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * The Application's uuid + */ + uuid: string; + } + + interface ShortCutConfig { + /** + * application has a shortcut on the desktop + */ + desktop?: boolean; + /** + * application has no shortcut in the start menu + */ + startMenu?: boolean; + /** + * application will be launched on system startup + */ + systemStartup?: boolean; + } + + interface SuccessObj { + httpResponseCode: number; + } + + interface NetworkErrorInfo extends ErrorInfo { + networkErrorCode: number; + } + + interface ErrorInfo { + stack: string; + message: string; + } + + interface ApplicationOptions { + /** + * The name of the application. + */ + name?: string; + /** + * The url to the application. + */ + url?: string; + /** + * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. + */ + uuid?: string; + /** + * Enable Flash at the application level. Default: false. + */ + plugins?: boolean; + /** + * The options of the main window of the application. + */ + mainWindowOptions?: WindowOptions; + } + + interface WindowOptions { + /** + * Enable keyboard shortcuts for devtools and zoom. Default: false for both. + */ + accelerator?: { + devtools?: boolean, + zoom?: boolean, + reload?: boolean, + reloadIgnoreCache?: boolean, + }; + /** + * A flag to always position the window at the top of the window stack. Default: false. + * Updatable + */ + alwaysOnTop?: boolean; + /** + * A flag to automatically show the Window when it is created. Default: false. + */ + autoShow?: boolean; + /** + * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true + * Updatable + */ + contextMenu?: boolean; + /** + * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. + * Updatable + */ + cornerRounding?: { + width?: number; + height?: number; + }; + /** + * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. + */ + customData?: any; + /** + * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the position from before the window was closed is used. + * This option overrides defaultLeft and defaultTop. Default: false. + */ + defaultCentered?: boolean; + /** + * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. + */ + defaultHeight?: number; + /** + * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. + */ + defaultWidth?: number; + /** + * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. + */ + defaultTop?: number; + /** + * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. + */ + defaultLeft?: number; + /** + * A flag to show the frame. Default: true. + * Updatable + */ + frame?: boolean; + /** + * A flag to allow a window to be hidden when the close button is clicked.Default: false. + * Updatable + */ + hideOnClose?: boolean; + /** + * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. + * Updatable + */ + icon?: string; + /** + * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxHeight?: number; + /** + * A flag that lets the window be maximized.Default: true. + * Updatable + */ + maximizable?: boolean; + /** + * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxWidth?: number; + /** + * The minimum height of a window.Default: 0. + * Updatable + */ + minHeight?: number; + /** + * A flag that lets the window be minimized.Default: true. + */ + minimizable?: boolean; + /** + * The minimum width of a window.Default: 0. + */ + minWidth?: number; + /** + * The name for the window which must be unique within the context of the invoking Application. + */ + name?: string; + /** + * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. + * Updatable + */ + opacity?: number; + /** + * A flag to drop to allow the user to resize the window.Default: true. + * Updatable + */ + resizable?: boolean; + /** + * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. + * Updatable + */ + resizeRegion?: { + /** + * The size in pixels (Default: 2), + */ + size?: number; + /** + * The size in pixels of an additional + * square resizable region located at the + * bottom right corner of a + * frameless window. (Default: 4) + */ + bottomRightCorner?: number; + }; + /** + * A flag to show the Window's icon in the taskbar. Default: true. + */ + showTaskbarIcon?: boolean; + /** + * A flag to cache the location of the window or not. Default: true. + */ + saveWindowState?: boolean; + /** + * Specify a taskbar group for the window. Default: app's uuid. + */ + taskbarIconGroup?: string; + /** + * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". + */ + state?: string; + /** + * The URL of the window. Default: "about:blank". + */ + url?: string; + /** + * When set to false, the window will render before the "load" event is fired on the content's window. + * Caution, when false you will see an initial empty white window. Default: true. + */ + waitForPageLoad?: boolean; + } + + /** + * Clipboard + * Clipboard API allows reading and writting to the clipboard in multiple formats. + */ + interface OpenFinClipboard { + /** + * Reads available formats for the clipboard type + */ + availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Reads available formats for the clipboard type + */ + readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as Rtf + */ + readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as plain text + */ + readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard + */ + write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Html + */ + writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Rtf + */ + writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as plain text + */ + writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + interface OpenFinExternalApplicationStatic { + /** + * Returns an External Application object that represents an existing external application. + */ + wrap(uuid: string): OpenFinExternalApplication; + } + /** + * ExternalApplication + * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. + */ + interface OpenFinExternalApplication { + /** + * Retrieves information about the application. + */ + getInfo(callback?: (info: ExternalApplicationInfo) => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + /** + * InterApplicationBus + * A messaging bus that allows for pub/sub messaging between different applications. + */ + interface OpenFinInterApplicationBus { + /** + * Adds a listener that gets called when applications subscribe to the current application's messages. + */ + addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Adds a listener that gets called when applications unsubscribe to the current application's messages. + */ + addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered subscribe listener. + */ + removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered unsubscribe listener. + */ + removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. + */ + publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sends a message to a specific application on a specific topic. + */ + send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], + * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. + */ + subscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + subscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Unsubscribes to messages from the specified application on the specified topic. + */ + unsubscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + unsubscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + } + + interface OpenFinNotificationStatic { + /** + * ctor + */ + new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; + /** + * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. + */ + getCurrent(): OpenFinNotification; + } + + /** + * Notification + * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. + * A notification is typically used to alert the user of some important event which requires his or her attention. + * Notifications are a child or your application that are controlled by the runtime. + */ + interface OpenFinNotification { + /** + * Closes the notification. + */ + close(callback?: () => void): void; + /** + * Sends a message to the notification. + */ + sendMessage(message: any, callback?: () => void): void; + /** + * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. + */ + sendMessageToApplication(message: any, callback?: () => void): void; + } + + interface NotificationOptions { + /** + * A boolean that will force dismissal even if the mouse is hovering over the notification + */ + ignoreMouseOver?: boolean; + /** + * A message of any primitive or composite-primitive type to be passed to the notification upon creation. + */ + message?: any; + /** + * The timeout for displaying a notification.Can be in milliseconds or "never". + */ + duration?: number | "never"; + /** + * The url of the notification + */ + url?: string; + /** + * A function that is called when a notification is clicked. + */ + onClick?(callback: () => void): void; + /** + * Invoked when the notification is closed via .close() method on the created notification instance + * or the by the notification itself via fin.desktop.Notification.getCurrent().close(). + * NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss + */ + onClose?(callback: () => void): void; + /** + * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. + */ + onDismiss?(callback: () => void): void; + /** + * A function that is called when an error occurs.The reason for the error is passed as an argument. + */ + onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * The onMessage function will respond to messages sent from notification.sendMessageToApplication. + * The function is passed the message, which can be of any primitive or composite-primitive type. + */ + onMessage?(callback: (message: any) => void): void; + /** + * A function that is called when a notification is shown. + */ + onShow?(callback: (successObj: SuccessObj) => void): void; + } + + /** + * System + * An object representing the core of OpenFin Runtime. + * Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. + */ + interface OpenFinSystem { + Clipboard: OpenFinClipboard; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Clears cached data containing window state/positions, + * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. + */ + clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Clears all cached data when OpenFin Runtime exits. + */ + deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Downloads the given application asset + */ + downloadAsset( + assetObj: AppAssetInfo, + progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, + callback?: (successObj: { path: string }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + + /** + * Download preload scripts from given URLs + */ + downloadPreloadScripts(scripts: Array, callback?: (downloadInfo: Array) => void, + errorCallback?: (reason: string) => void): void; + /** + * Downloads the given OpenFin Runtime. + */ + downloadRuntime(options: RuntimeDownloadOptions, onProgress?: (progress: RuntimeDownloadProgress) => void, onComplete?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Exits the Runtime. + */ + exit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Writes any unwritten cookies data to disk. + */ + flushCookieStore(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all applications. + */ + getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all external applications. + */ + getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data (name, ids, bounds) for all application windows. + */ + getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns information about the app asset. + */ + getAppAssetInfo(options: AppAssetOptions, callback?: (appAssetInfo: AppAssetInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Get additional info of cookies. + */ + getCookies(option: CookieOption, callback?: (info: Array) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the command line argument string that started OpenFin Runtime. + */ + getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the configuration object that started the OpenFin Runtime. + */ + getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns a hex encoded hash of the mac address and the currently logged in user name + */ + getDeviceUserId(callback?: (id: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns an Entity info object relating to the entity specified by the uuid and name passed in. The possible types are 'window', 'iframe', 'external connection' or 'unknown'. + */ + getEntityInfo(uuid: string, name: string, callback?: (info: EntityInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the value of a given environment variable on the computer on which the runtime is installed. + */ + getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves currently focused window identity. + */ + getFocusedWindow(callback?: (focusedWindowIdentity: Identity) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves system information. + */ + getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the contents of the log with the specified filename. + */ + getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing information for each log file. + */ + getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the minimum (inclusive) logging level that is currently being written to the logs. + */ + getMinLogLevel(callback?: (logLevel: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. + */ + getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the mouse in virtual screen coordinates (left, top). + */ + getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of all of the runtime processes that are currently running. + * Each element in the array is an object containing the uuid and the name of the application to which the process belongs. + */ + getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the Proxy settings. + */ + getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns information about the running RVM in an object. + */ + getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. + */ + getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Runs an executable or batch file. + */ + launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Writes the passed message into both the log file and the console. + */ + log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Monitors a running process. + */ + monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Opens the passed URL in the default web browser. + */ + openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Opens the passed URL in the default web browser. + */ + readRegistryValue(rootKey: string, subkey: string, value: string, callback?: (info: RegistryInfo) => void, + errorCallback?: (reason: string) => void): void; + /** + * This function call will register a unique id and produce a token. The token can be used to broker an external connection. + */ + registerExternalConnection( + uuid: string, + callback?: (detail: { + /** + * this will be unique each time + */ + token: string; + /** + * "remote-connection-uuid" + */ + uuid: string; + }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). + */ + releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Set the minimum log level above which logs will be written to the OpenFin log + */ + setMinLogLevel(logLevel: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the Chrome Developer Tools for the specified window. + */ + showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. + */ + terminateExternalProcess( + processUuid: string, + timeout: number, + killTree: boolean, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + terminateExternalProcess( + processUuid: string, + timeout: number, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Update the OpenFin Runtime Proxy settings. + */ + updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface CacheOptions { + cache?: boolean; + cookies?: boolean; + localStorage?: boolean; + appcache?: boolean; + userData?: boolean; + } + + interface AppAssetInfo { + src?: string; + alias?: string; + version?: string; + target?: string; + args?: string; + mandatory?: boolean; + } + + interface AppAssetOptions { + alias: string; + } + + interface ApplicationInfo { + /** + * true when the application is running. + */ + isRunning?: boolean; + /** + * uuid of the application. + */ + uuid?: string; + /** + * uuid of the application that launches this application. + */ + parentUuid?: string; + } + + interface Identity { + uuid: string; + name: string; + } + + interface EntityInfo { + name: string; + uuid: string; + parent: Identity; + entityType: string; + } + + interface DownloadPreloadOption { + url: string; + } + + interface DownloadPreloadInfo { + success: boolean; + url?: string; + error: string; + } + + + interface CookieInfo { + name: string; + // expirationDate: Date; + domain: string; + path: string; + } + + interface CookieOption { + name: string; + } + + interface RegistryInfo { + data: any; + rootKey: string; + subkey: string; + type: string; + value: string; + } + + interface RuntimeDownloadOptions { + version: string; + } + + interface RuntimeDownloadProgress { + downloadedBytes: number; + totalBytes: number; + } + + interface WindowDetails { + uuid?: string; + mainWindow?: WindowInfo; + childWindows?: WindowInfo[]; + } + + interface WindowInfo { + /** + * name of the child window + */ + name?: string; + /** + * top-most coordinate of the child window + */ + top?: number; + /** + * right-most coordinate of the child window + */ + right?: number; + /** + * bottom-most coordinate of the child window + */ + bottom?: number; + /** + * left-most coordinate of the child window + */ + left?: number; + } + + interface HostSpecInfo { + /** + * "x86" for 32-bit or "x86_64" for 64-bit + */ + arch: string; + /** + * Same payload as Node's os.cpus() + */ + cpus: NodeCpuInfo[]; + gpu: { + /** + * Graphics card name + */ + name: string; + }; + /** + * Same payload as Node's os.totalmem() + */ + memory: number; + /** + * OS name and version/edition + */ + name: string; + } + + interface NodeCpuInfo { + model: string; + /** + * in MHz + */ + speed: number; + times: { + /** + * The number of milliseconds the CPU has spent in user mode. + */ + user: number; + /** + * The number of milliseconds the CPU has spent in nice mode. + */ + nice: number; + /** + * The number of milliseconds the CPU has spent in sys mode. + */ + sys: number; + /** + * The number of milliseconds the CPU has spent in idle mode. + */ + idle: number; + /** + * The number of milliseconds the CPU has spent in irq mode. + */ + irq: number; + }; + } + + interface LogInfo { + /** + * the filename of the log + */ + name?: string; + /** + * the size of the log in bytes + */ + size?: number; + /** + * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" + */ + date?: string; + } + + interface ProcessInfo { + /** + * the percentage of total CPU usage + */ + cpuUsage?: number; + /** + * the application name + */ + name?: string; + /** + * the current nonpaged pool usage in bytes + */ + nonPagedPoolUsage?: number; + /** + * the number of page faults + */ + pageFaultCount?: number; + /** + * the current paged pool usage in bytes + */ + pagedPoolUsage?: number; + /** + * the total amount of memory in bytes that the memory manager has committed + */ + pagefileUsage?: number; + /** + * the peak nonpaged pool usage in bytes + */ + peakNonPagedPoolUsage?: number; + /** + * the peak paged pool usage in bytes + */ + peakPagedPoolUsage?: number; + /** + * the peak value in bytes of pagefileUsage during the lifetime of this process + */ + peakPagefileUsage?: number; + /** + * the peak working set size in bytes + */ + peakWorkingSetSize?: number; + /** + * the native process identifier + */ + processId?: number; + /** + * the application UUID + */ + uuid?: string; + /** + * the current working set size (both shared and private data) in bytes + */ + workingSetSize?: number; + } + + interface ProxyInfo { + /** + * the configured Proxy Address + */ + proxyAddress?: string; + /** + * the configured Proxy port + */ + proxyPort?: number; + /** + * Proxy Type + */ + type?: string; + } + + interface RvmInfo { + version?: string; + "start-time"?: string; + } + + interface ExternalProcessLaunchInfo { + path?: string; + /** + * Additionally note that the executable found in the zip file specified in appAssets + * will default to the one mentioned by appAssets.target + * If the the path below refers to a specific path it will override this default + */ + alias?: string; + /** + * When using alias; if no arguments are passed then the arguments (if any) + * are taken from the 'app.json' file, from the 'args' parameter + * of the 'appAssets' Object with the relevant 'alias'. + * If 'arguments' is passed as a parameter it takes precedence + * over any 'args' set in the 'app.json'. + */ + arguments?: string; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + certificate?: CertificationInfo; + } + + interface CertificationInfo { + /** + * A hex string with or without spaces + */ + serial?: string; + /** + * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields + */ + subject?: string; + /** + * A hex string with or without spaces + */ + publickey?: string; + /** + * A hex string with or without spaces + */ + thumbprint?: string; + /** + * A boolean indicating that the certificate is trusted and not revoked + */ + trusted?: boolean; + } + + interface ExternalProcessInfo { + pid?: number; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + } + + interface OpenFinWindowStatic { + /** + * Class: Window + * + * new Window(options, callbackopt, errorCallbackopt) + * + * Creates a new OpenFin Window + * + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + * @param options - The options of the window + * @param [callback] - Called if the window creation was successful + * @param [callback.successObj] - httpResponseCode + */ + new ( + options: WindowOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; + /** + * Returns an instance of the current window. + * @returns Current window + */ + getCurrent(): OpenFinWindow; + /** + * Returns a Window object that wraps an existing window. + */ + wrap(appUuid: string, windowName: string): OpenFinWindow; + } + + /** + * Window + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + */ + interface OpenFinWindow { + /** + * Name of window + */ + name: string; + /** + * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, + * otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the + * contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. + * Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). + * @returns Native window + */ + getNativeWindow(): Window; + /** + * Gets the parent application. + * @returns Parent application + */ + getParentApplication(): OpenFinApplication; + /** + * Gets the parent window. + */ + getParentWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Performs the specified window transitions + */ + animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Provides credentials to authentication requests + */ + authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes focus from the window. + */ + blur(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Brings the window to the front of the OpenFin window stack. + */ + bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the window. + * @param Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Prevents a user from changing a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-disabled' is generated when an enabled frame becomes disabled. + */ + disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Re-enables user changes to a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-enabled' is generated when a disabled frame has becomes enabled. + */ + enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Flashes the window's frame and taskbar icon until the window is activated. + */ + flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gives focus to the window. + */ + focus(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current bounds (top, left, width, height) of the window. + */ + getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. + * Please note that calling window is included in the result array. + */ + getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current settings of the window. + */ + getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets a base64 encoded PNG snapshot of the window. + */ + getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current state ("minimized", "maximized", or "restored") of the window. + */ + getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the zoom level of the window. + */ + getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; + /** + * Hides the window. + */ + hide(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the window is currently showing. + */ + isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Joins the same window group as the specified window. + */ + joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Leaves the current window group so that the window can be move independently of those in the group. + */ + leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Maximizes the window. + */ + maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Merges the instance's window group with the same window group as the specified window + */ + mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Minimizes the window. + */ + minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window by a specified amount. + */ + moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window to a specified location. + */ + moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restores the window to its normal state (i.e., unminimized, unmaximized). + */ + restore(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Will bring the window to the front of the entire stack and give it focus. + */ + setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the window's size and position + */ + setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the zoom level of the window. + */ + setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden. + * @param Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. + */ + show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. + */ + showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Stops the taskbar icon from flashing. + */ + stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Updates the window using the passed options + */ + updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface OpenFinFrameStatic { + wrap(uuid: string, name: string): OpenFinFrame; + + getCurrent(): OpenFinFrame; + } + + interface OpenFinFrame { + name: string; + uuid: string; + + addEventListener(type: string, listener: () => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + + getParentWindow(callback?: (entityInfo: EntityInfo) => void, errorCallback?: (reason: string) => void): void; + + getInfo(callback?: (entityInfo: EntityInfo) => void, errorCallback?: (reason: string) => void): void; + + removeEventListener(type: string, listener: () => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface ApplicationBaseEvent { + topic: string; + type: OpenFinApplicationEventType; + uuid: string; + } + + interface TrayIconClickedEvent extends ApplicationBaseEvent { + button: number; // 0 for left, 1 for middle, 2 for right + monitorInfo: MonitorInfo; + x: number; // the cursor x coordinate + y: number; // the cursor y coordinate + } + + interface WindowEvent extends ApplicationBaseEvent { + name: string; + } + + interface WindowAlertRequestedEvent extends WindowEvent { + message: string; + url: string; + } + + interface WindowAuthRequested extends WindowEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowNavigationRejectedEvent extends WindowEvent { + sourceName: string; + url: string; + } + + interface WindowEndLoadEvent extends WindowEvent { + documentName: string; + isMain: boolean; + } + + interface MonitorInfoChangedEvent extends MonitorInfo { + topic: "system"; + type: "monitor-info-changed"; + } + + interface MonitorInfo { + nonPrimaryMonitors: MonitorInfoDetail[]; + primaryMonitor: MonitorInfoDetail; + reason: string; + taskbar: { + edge: "left" | "right" | "top" | "bottom", + rect: MontiorCoordinates + }; + topic: "system"; + type: "monitor-info-changed"; + virtualScreen: MontiorCoordinates; + } + + interface TrayIconInfo { + x: number; + y: number; + bounds: { + x: number; + y: number; + width: number; + height: number; + } + monitorInfo: MonitorInfo + } + + interface MonitorInfoDetail { + availableRect: MontiorCoordinates; + deviceId: string; + displayDeviceActive: boolean; + monitorRect: MontiorCoordinates; + name: string; + } + + interface MontiorCoordinates { + bottom: number; + left: number; + right: number; + top: number; + } + + interface VirtualScreenCoordinates { + left: number; + top: number; + } + + interface SystemBaseEvent { + topic: string; + type: OpenFinSystemEventType; + uuid: string; + } + + interface DesktopIconClickedEvent { + mouse: { + /** + * the left virtual screen coordinate of the mouse + */ + left: number, + /** + * the top virtual screen coordinate of the mouse + */ + top: number + }; + /** + * the number of milliseconds that have elapsed since the system was started, + */ + tickCount: number; + topic: "system"; + type: "desktop-icon-clicked"; + } + + interface IdleStateChangedEvent { + /** + * How long in milliseconds since the user has been idle. + */ + elapsedTime: number; + /** + * true when the user is idle,false when the user has returned; + */ + isIdle: boolean; + topic: "system"; + type: "idle-state-changed"; + } + + interface WindowBaseEvent { + /** + * the name of the window + */ + name: string; + /** + * always window + */ + topic: "window"; + /** + * window event type + */ + type: OpenFinWindowEventType; + /** + * the UUID of the application the window belongs to + */ + uuid: string; + } + + interface WindowAuthRequestedEvent extends WindowBaseEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowBoundsEvent extends WindowBaseEvent { + /** + * describes what kind of change occurred. + * 0 means a change in position. + * 1 means a change in size. + * 2 means a change in position and size. + */ + changeType: number; + /** + * true when pending changes have been applied to the window. + */ + deferred: boolean; + /** + * the new height of the window. + */ + height: number; + /** + * the left-most coordinate of the window. + */ + left: number; + /** + * the top-most coordinate of the window. + */ + top: number; + + type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; + /** + * the new width of the window. + */ + width: number; + } + + interface WindowExternalProcessStartedEvent extends WindowBaseEvent { + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-started"; + } + + interface WindowExternalProcessExited extends WindowBaseEvent { + /** + * the process exit code + */ + exitCode: number; + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-exited"; + } + + interface WindowGroupChangedEvent extends WindowBaseEvent { + /** + * Which group array the window that the event listener was registered on is included in: + * 'source' The window is included in sourceGroup. + * 'target' The window is included in targetGroup. + * 'nothing' The window is not included in sourceGroup nor targetGroup. + */ + memberOf: "source" | "target" | "nothing"; + /** + * The reason this event was triggered. + * 'leave' A window has left the group due to a leave or merge with group. + * 'join' A window has joined the group. + * 'merge' Two groups have been merged together. + * 'disband' There are no other windows in the group. + */ + reason: "leave" | "join" | "merge" | "disband"; + /** + * All the windows in the group the sourceWindow originated from. + */ + sourceGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. + */ + sourceWindowAppUuid: string; + /** + * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. + */ + sourceWindowName: string; + /** + * All the windows in the group the targetWindow orginated from + */ + targetGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowAppUuid: string; + /** + * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowName: string; + type: "group-changed"; + } + + interface WindowOfGroupInfo { + /** + * The UUID of the application this window entry belongs to. + */ + appUuid: string; + /** + * The name of this window entry. + */ + windowName: string; + } + + interface WindowHiddenEvent extends WindowBaseEvent { + /** + * What action prompted the close. + * The reasons are: "hide", "hide-on-close" + */ + reason: "hide" | "hide-on-close"; + type: "hidden"; + } + + interface Window_NavigationRejectedEvent { + name: string; + /** + * source of navigation window name + */ + sourceName: string; + topic: "navigation-rejected"; + /** + * Url that was not reached "http://blocked-content.url" + */ + url: string; + /** + * the UUID of the application the window belongs to. + */ + uuid: string; + } + + interface AnimationTransition { + opacity?: { + /** + * This value is clamped from 0.0 to 1.0 + */ + opacity?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'opacity' as absolute or as a delta. Defaults to false. + */ + relative?: boolean; + }; + position?: { + /** + * Defaults to the window's current left position in virtual screen coordinates. + */ + left?: number; + /** + * Defaults to the window's current top position in virtual screen coordinates. + */ + top?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + size?: { + /** + * Optional if height is present. Defaults to the window's current width. + */ + width?: number; + /** + * Optional if width is present. Defaults to the window's current height. + */ + height?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + } + + interface AnimationOptions { + /** + * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. + */ + interrupt?: boolean; + /** + * Transition effect. Defaults to 'ease-in-out'. + */ + tween?: OpenFinTweenType; + } + + interface WindowBounds { + /** + * the height of the window. + */ + height?: number; + /** + * left-most coordinate of the window. + */ + left?: number; + /** + * top-most coordinate of the window. + */ + top?: number; + /** + * the width of the window. + */ + width?: number; + } + + interface ExternalApplicationInfo { + parent: { + uuid: string; + name: string; + } + } + + interface SessionChangedEvent { + /** + * the action that triggered this event: + */ + reason: "lock" + | "unlock" + | "remote-connect" + | "remote-disconnect" + | "unknown"; + topic: "system"; + type: "session-changed"; + } + + interface LaunchInfo { + launchMode: "fin-protocol" + | "fins-protocol" + | "shortcut" + | "command-line" + | "adapter" + | "other" + | string; + } + + type OpenFinTweenType = "linear" + | "ease-in" + | "ease-out" + | "ease-in-out" + | "ease-in-quad" + | "ease-out-quad" + | "ease-in-out-quad" + | "ease-in-cubic" + | "ease-out-cubic" + | "ease-in-out-cubic" + | "ease-out-bounce" + | "ease-in-back" + | "ease-out-back" + | "ease-in-out-back" + | "ease-in-elastic" + | "ease-out-elastic" + | "ease-in-out-elastic"; + + type OpenFinApplicationEventType = "closed" + | "connected" + | "crashed" + | "initialized" + | "manifest-changed" + | "not-responding" + | "out-of-memory" + | "responding" + | "run-requested" + | "started" + | "tray-icon-clicked" + | "window-alert-requested" + | "window-auth-requested" + | "window-closed" + | "window-created" + | "window-end-load" + | "window-navigation-rejected" + | "window-show-requested" + | "window-start-load"; + + type OpenFinExternalApplicationEventType = "connected" + | "disconnected"; + + type OpenFinSystemEventType = "application-closed" + | "application-crashed" + | "application-created" + | "application-started" + | "desktop-icon-clicked" + | "idle-state-changed" + | "monitor-info-changed" + | "session-changed"; + + type OpenFinWindowEventType = "auth-requested" + | "blurred" + | "bounds-changed" + | "bounds-changing" + | "close-requested" + | "closed" + | "disabled-frame-bounds-changed" + | "disabled-frame-bounds-changing" + | "embedded" + | "external-process-exited" + | "external-process-started" + | "focused" + | "frame-disabled" + | "frame-enabled" + | "group-changed" + | "hidden" + | "initialized" + | "maximized" + | "minimized" + | "navigation-rejected" + | "restored" + | "show-requested" + | "shown"; + + type OpenFinAnchor = "top-left" + | "top-right" + | "bottom-left" + | "bottom-right"; } diff --git a/types/openfin/openfin-tests.ts b/types/openfin/openfin-tests.ts index 61b819018f..2b5237c1e8 100644 --- a/types/openfin/openfin-tests.ts +++ b/types/openfin/openfin-tests.ts @@ -1,721 +1,797 @@ function test_application() { - let application: fin.OpenFinApplication; - // constructor - application = new fin.desktop.Application({ - url: "application.html", - uuid: "74BED629-2D8E-4141-8582-73E364BDFA74", - name: "Application Name", - plugins: false, - mainWindowOptions: { - defaultHeight: 600, - defaultWidth: 800, - defaultTop: 300, - defaultLeft: 300, - autoShow: true - } - }, (successObj) => { - console.log("Application successfully created, HTTP response code:", successObj); - application.run(); - }, (error) => { - console.log("Error creating application:", error); - }); - // getCurrent - application = fin.desktop.Application.getCurrent(); - // wrap - application = fin.desktop.Application.wrap("454C7F31-A915-4EA2-83F2-CFA655453C52"); - // getWindow - application.getWindow(); - // addEventListener - application.addEventListener("closed", (event) => { - console.log("The application has closed"); - }, () => { - console.log("The registration was successful"); - }, reason => { - console.log("failure: " + reason); - }); - // close - application.close(); - // getChildWindows - application.getChildWindows(children => { - children.forEach(childWindow => { - console.log("Showing child: " + childWindow.name); - childWindow.show(); - }); - }); - // getGroups - application.getGroups(allGroups => { - console.log(`There are a total of ${allGroups.length} groups.`); + let application: fin.OpenFinApplication; + // constructor + application = new fin.desktop.Application({ + url: "application.html", + uuid: "74BED629-2D8E-4141-8582-73E364BDFA74", + name: "Application Name", + plugins: false, + mainWindowOptions: { + defaultHeight: 600, + defaultWidth: 800, + defaultTop: 300, + defaultLeft: 300, + autoShow: true + } + }, (successObj) => { + console.log("Application successfully created, HTTP response code:", successObj); + application.run(); + }, (error) => { + console.log("Error creating application:", error); + }); + //createFromManifest + fin.desktop.Application.createFromManifest("http://stuf.com/app.json", (app) => { + console.log(app.uuid); + }, err => console.log(err)); + // getCurrent + application = fin.desktop.Application.getCurrent(); + // wrap + application = fin.desktop.Application.wrap("454C7F31-A915-4EA2-83F2-CFA655453C52"); + // getWindow + application.getWindow(); + // addEventListener + application.addEventListener("closed", (event) => { + console.log("The application has closed"); + }, () => { + console.log("The registration was successful"); + }, reason => { + console.log("failure: " + reason); + }); + // close + application.close(); + // getChildWindows + application.getChildWindows(children => { + children.forEach(childWindow => { + console.log("Showing child: " + childWindow.name); + childWindow.show(); + }); + }); + // getGroups + application.getGroups(allGroups => { + console.log(`There are a total of ${allGroups.length} groups.`); - let groupCounter = 1; - allGroups.forEach(windowGroup => { - console.log(`Group ${groupCounter} contains ${windowGroup.length} windows.`); - ++groupCounter; - }); - }); - // getManifest - application.getManifest(manifest => { - console.log("Application manifest:"); - console.log(manifest); - }); - // getParentUuid - application.getParentUuid(parentUuid => { - console.log("UUID of parent application:"); - console.log(parentUuid); - }); - // getShortcuts - application.getShortcuts(config => { - console.log("Desktop shortcut is enabled: ", config.desktop); - console.log("Start Menu shortcut is enabled: ", config.startMenu); - console.log("System Startup shortcut is enabled: ", config.systemStartup); - }); - // getInfo - application.getInfo(info => { - console.log(`Launch mode: ${info.launchMode}`); - }); - // isRunning - application.isRunning(running => { - console.log("the application is", running ? "running" : "not running"); - }); - // registerCustomData - application.registerCustomData({ - someData: "this is custom" - }, () => { - console.log("You will not read this."); - }, err => { - console.log("failure:", err); - }); - // removeEventListener - const previousCallback = (event: fin.WindowEvent) => { }; - application.removeEventListener("closed", previousCallback, () => { - console.log("The unregistration was successful"); - }, err => { - console.log("failure:", err); - }); - // removeTrayIcon - application.removeTrayIcon(() => { - console.log("Removed the tray icon."); - }, err => { - console.log("failure:", err); - }); - // restart - application.restart(() => { - console.log("You will not read this."); - }, err => { - console.log("failure:", err); - }); - // schedule restart - application.scheduleRestart(() => { - console.log("You will not read this."); - }, err => { - console.log("failure:", err); - }); - // setShortcuts - application.setShortcuts({ - desktop: true, - startMenu: false, - systemStartup: true - }, () => { - console.log("Successfully set new shortcut states"); - }, error => { - console.log("Failed to set new shortcut states. Error: ", error); - }); - // setTrayIcon - application.setTrayIcon("https://developer.openf.in/download/openfin.png", clickInfo => { - console.log(`The mouse has clicked at (${clickInfo.x}, ${clickInfo.y})`); - }); - // terminate - application.terminate(); - // wait - application.addEventListener("not-responding", () => { - console.log("waiting for hung application"); - application.wait(); - }); + let groupCounter = 1; + allGroups.forEach(windowGroup => { + console.log(`Group ${groupCounter} contains ${windowGroup.length} windows.`); + ++groupCounter; + }); + }); + // getManifest + application.getManifest(manifest => { + console.log("Application manifest:"); + console.log(manifest); + }); + // getParentUuid + application.getParentUuid(parentUuid => { + console.log("UUID of parent application:"); + console.log(parentUuid); + }); + // getShortcuts + application.getShortcuts(config => { + console.log("Desktop shortcut is enabled: ", config.desktop); + console.log("Start Menu shortcut is enabled: ", config.startMenu); + console.log("System Startup shortcut is enabled: ", config.systemStartup); + }); + // getInfo + application.getInfo(info => { + console.log(`Launch mode: ${info.launchMode}`); + }); + // getTrayIconInfo + application.getTrayIconInfo(info => { + console.log(info.x, info.y, info.bounds.x, info.bounds.y, info.bounds.height, info.bounds.width, + info.monitorInfo.type, info.monitorInfo.reason); + }); + // isRunning + application.isRunning(running => { + console.log("the application is", running ? "running" : "not running"); + }); + // registerCustomData + application.registerUser("a", "b", () => console.log("done"), err => console.log(err)); + // removeEventListener + const previousCallback = (event: fin.WindowEvent) => { }; + application.removeEventListener("closed", previousCallback, () => { + console.log("The unregistration was successful"); + }, err => { + console.log("failure:", err); + }); + // removeTrayIcon + application.removeTrayIcon(() => { + console.log("Removed the tray icon."); + }, err => { + console.log("failure:", err); + }); + // restart + application.restart(() => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // schedule restart + application.scheduleRestart(() => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // setShortcuts + application.setShortcuts({ + desktop: true, + startMenu: false, + systemStartup: true + }, () => { + console.log("Successfully set new shortcut states"); + }, error => { + console.log("Failed to set new shortcut states. Error: ", error); + }); + // setTrayIcon + application.setTrayIcon("https://developer.openf.in/download/openfin.png", clickInfo => { + console.log(`The mouse has clicked at (${clickInfo.x}, ${clickInfo.y})`); + }); + // terminate + application.terminate(); + // wait + application.addEventListener("not-responding", () => { + console.log("waiting for hung application"); + application.wait(); + }); + //uuid + let hasUuid = application.uuid; } function test_external_application() { - let externalApp: fin.OpenFinExternalApplication; - // wrap - externalApp = fin.desktop.ExternalApp.wrap('my-uuid'); - // addEventListener - externalApp.addEventListener('connected', () => { - console.log('external app connected'); - }, () => { - console.log('The registration was successful'); - }, (reason, err) => { - console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); - }); - // removeEventListener - const previousCallback = () => { }; - externalApp.removeEventListener('connected', previousCallback, () => { - console.log('The unregistration was successful'); - }, (reason, err) => { - console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); - }); + let externalApp: fin.OpenFinExternalApplication; + // wrap + externalApp = fin.desktop.ExternalApp.wrap('my-uuid'); + // addEventListener + externalApp.addEventListener('connected', () => { + console.log('external app connected'); + }, () => { + console.log('The registration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); + // removeEventListener + const previousCallback = () => { }; + externalApp.removeEventListener('connected', previousCallback, () => { + console.log('The unregistration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); + + // getInfo + externalApp.getInfo(info => { + console.log(info.parent.uuid, info.parent.name); + }, err => console.log(err)); } function test_inter_application_bus() { - // addSubscribeListener - fin.desktop.InterApplicationBus.addSubscribeListener((uuid, topic, name) => { - console.log(`The application ${uuid} has subscribed to ${topic}`); - }); - // addUnsubscribeListener - fin.desktop.InterApplicationBus.addUnsubscribeListener((uuid, topic, name) => { - console.log(`The application ${uuid} has unsubscribed to ${topic}`); - }); - // removeSubscribeListener - const aRegisteredListener = (uuid: string, topic: string, name: string) => { }; - fin.desktop.InterApplicationBus.removeSubscribeListener(aRegisteredListener); - // removeUnsubscribeListener - fin.desktop.InterApplicationBus.removeUnsubscribeListener(aRegisteredListener); - // publish - fin.desktop.InterApplicationBus.publish("a topic", { - field1: "value1", - field2: "value2" - }); - // send - fin.desktop.InterApplicationBus.send("an application's uuid", "a topic", { - field1: "value1", - field2: "value2" - }); - // subscribe - fin.desktop.InterApplicationBus.subscribe("*", "a topic", (message, uuid, name) => { - console.log(`The application ${uuid} sent this message: ${message}`); - }); - // unsubscribe - const aRegisteredMessageListener = (message: any, senderUuid: string) => { - console.log(message, senderUuid); - }; - fin.desktop.InterApplicationBus.unsubscribe("*", "a topic", aRegisteredMessageListener); + // addSubscribeListener + fin.desktop.InterApplicationBus.addSubscribeListener((uuid, topic, name) => { + console.log(`The application ${uuid} has subscribed to ${topic}`); + }); + // addUnsubscribeListener + fin.desktop.InterApplicationBus.addUnsubscribeListener((uuid, topic, name) => { + console.log(`The application ${uuid} has unsubscribed to ${topic}`); + }); + // removeSubscribeListener + const aRegisteredListener = (uuid: string, topic: string, name: string) => { }; + fin.desktop.InterApplicationBus.removeSubscribeListener(aRegisteredListener); + // removeUnsubscribeListener + fin.desktop.InterApplicationBus.removeUnsubscribeListener(aRegisteredListener); + // publish + fin.desktop.InterApplicationBus.publish("a topic", { + field1: "value1", + field2: "value2" + }); + // send + fin.desktop.InterApplicationBus.send("an application's uuid", "a topic", { + field1: "value1", + field2: "value2" + }); + // subscribe + fin.desktop.InterApplicationBus.subscribe("*", "a topic", (message, uuid, name) => { + console.log(`The application ${uuid} sent this message: ${message}`); + }); + // unsubscribe + const aRegisteredMessageListener = (message: any, senderUuid: string) => { + console.log(message, senderUuid); + }; + fin.desktop.InterApplicationBus.unsubscribe("*", "a topic", aRegisteredMessageListener); } function test_notification() { - let notification: fin.OpenFinNotification; - // getCurrent - notification = fin.desktop.Notification.getCurrent(); - // close - notification.close(); - // sendMessage - notification = new fin.desktop.Notification({ - duration: 10, - url: "http://localhost:5000/Account/Register", - message: "Hello", - onShow: () => { }, - // onClose: () => { }, - onDismiss: () => { }, - // onClick: () => { }, - onMessage: () => { }, - onError: () => { } - }); - // sendMessageToApplication - notification.sendMessageToApplication("some message"); + let notification: fin.OpenFinNotification; + // getCurrent + notification = fin.desktop.Notification.getCurrent(); + // close + notification.close(); + // sendMessage + notification = new fin.desktop.Notification({ + duration: 10, + url: "http://localhost:5000/Account/Register", + message: "Hello", + onShow: () => { }, + // onClose: () => { }, + onDismiss: () => { }, + // onClick: () => { }, + onMessage: () => { }, + onError: () => { } + }); + // sendMessageToApplication + notification.sendMessageToApplication("some message"); } function test_system() { - // addEventListener - fin.desktop.System.addEventListener('monitor-info-changed', event => { - console.log("The monitor information has changed to: ", event); - }, () => { - console.log("The registration was successful"); - }, err => { - console.log("failure: " + err); - }); - // clearCache - fin.desktop.System.clearCache({ - cache: true, - cookies: true, - localStorage: true, - appcache: true, - userData: true - }); - // deleteCacheOnExit - fin.desktop.System.deleteCacheOnExit(() => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // downloadAsset - const dirAppAsset = { - src: 'http://local:8000/dir.zip', - alias: 'dirApp', - version: '1.23.24', - target: 'dir.bat', - args: '' - }; - fin.desktop.System.downloadAsset(dirAppAsset, progress => { - const downloadedPercent = Math.floor((progress.downloadedBytes / progress.totalBytes) * 100); - console.log(`Downloaded ${downloadedPercent}%`); - }, p => { - console.log(`Downlod complete, can be found on ${p.path}`); - // lets launch our application asset. - // launchDirApp(); - }, (reason, err) => { - console.log(reason, err); - }); - // exit - fin.desktop.System.exit(() => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // getAllApplications - fin.desktop.System.getAllApplications(applicationInfoList => { - applicationInfoList.forEach(applicationInfo => { - console.log("Showing information for application with uuid: " - + applicationInfo.uuid); - console.log("isRunning: ", applicationInfo.isRunning); - }); - }); - // getAllExternalApplications - fin.desktop.System.getAllExternalApplications(externalAppsInfoList => { - externalAppsInfoList.forEach(appInfo => { - console.log(`External app connected to the runtime with UUID ${appInfo.uuid}`); - }); - }); - // getAllWindows - fin.desktop.System.getAllWindows(windowInfoList => { - windowInfoList.forEach(windowInfo => { - console.log("Showing information for application with uuid: ", windowInfo.uuid); - console.log("Main window: ", windowInfo.mainWindow); - console.log("Child windows: ", windowInfo.childWindows); - }); - }); - // getCommandLineArguments - fin.desktop.System.getCommandLineArguments(args => { - console.log("The command line arguments are " + args); - }); - // getDeviceId - fin.desktop.System.getDeviceId(id => { - console.log("The id of the device is: " + id); - }); - // getEnvironmentVariable - fin.desktop.System.getEnvironmentVariable("APPDATA", variable => { - console.log("this is the APPDATA value", variable); - }); - // getHostSpecs - fin.desktop.System.getHostSpecs(info => { - console.log(info); - }, error => { - console.log('There was an error:', error); - }); - // getLog - fin.desktop.System.getLog('debug-2015-01-08-22-27-53.log', log => { - console.log(log); - }); - // getLogList - fin.desktop.System.getLogList(logList => { - logList.forEach(logInfo => { - console.log(`The filename of the log is ${logInfo.name}, the size is ${logInfo.size}, and the date of creation is ${logInfo.date}`); - }); - }); - // getMonitorInfo - fin.desktop.System.getMonitorInfo(monitorInfo => { - console.log("This object contains information about all monitors: ", monitorInfo); - }); - // getMousePosition - fin.desktop.System.getMousePosition(mousePosition => { - console.log(`The mouse is located at left: ${mousePosition.left}, top: ${mousePosition.top}`); - }); - // getProcessList - fin.desktop.System.getProcessList(list => { - list.forEach(process => { - console.log(`UUID: ${process.uuid}, Application Name: ${process.name}`); - }); - }); - // getProxySettings - fin.desktop.System.getProxySettings(proxy => { - console.log(proxy); - }); - // getRvmInfo - fin.desktop.System.getRvmInfo(rvmInfoObject => { - console.log("RVM version:", rvmInfoObject.version); - console.log("RVM has been running since:", rvmInfoObject["start-time"]); - }, err => { - console.log("Failed to get rvm info, error message:", err); - }); - // getVersion - fin.desktop.System.getVersion(version => { - console.log("The version is " + version); - }); - // launchExternalProcess - fin.desktop.System.launchExternalProcess({ - path: "notepad", - arguments: "", - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // - fin.desktop.System.launchExternalProcess({ - // Additionally note that the executable found in the zip file specified in appAssets - // will default to the one mentioned by appAssets.target - // If the the path below refers to a specific path it will override this default - alias: "myApp", - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // - fin.desktop.System.launchExternalProcess({ - alias: "myApp", - arguments: "e f g", - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // - fin.desktop.System.launchExternalProcess({ - path: "C:\Users\ExampleUser\AppData\Local\OpenFin\OpenFinRVM.exe", - arguments: "--version", - certificate: { - trusted: true, - subject: 'O=OpenFin INC., L=New York, S=NY, C=US', - thumbprint: '3c a5 28 19 83 05 fe 69 88 e6 8f 4b 3a af c5 c5 1b 07 80 5b' - }, - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // log - fin.desktop.System.log("info", "An example log message", () => { - console.log("message successfully logged"); - }, err => { - console.log(err); - }); - // monitorExternalProcess - fin.desktop.System.monitorExternalProcess({ - pid: 2508, - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log("The process is now being monitored: ", payload.uuid); - }, error => { - console.log("Error:", error); - }); - // openUrlWithBrowser - fin.desktop.System.openUrlWithBrowser("https://developer.openf.in/", () => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // registerExternalConnection - fin.desktop.System.registerExternalConnection("remote-connection-uuid", (...args: any[]) => { - console.log(args); - }); - // releaseExternalProcess - fin.desktop.System.launchExternalProcess({ - path: "notepad", - arguments: "", - listener(result) { - console.log("The exit code", result.exitCode); - } - }, result => { - console.log("Result UUID is " + result.uuid); + // addEventListener + fin.desktop.System.addEventListener('monitor-info-changed', event => { + console.log("The monitor information has changed to: ", event); + }, () => { + console.log("The registration was successful"); + }, err => { + console.log("failure: " + err); + }); + // clearCache + fin.desktop.System.clearCache({ + cache: true, + cookies: true, + localStorage: true, + appcache: true, + userData: true + }); + // deleteCacheOnExit + fin.desktop.System.deleteCacheOnExit(() => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // downloadAsset + const dirAppAsset = { + src: 'http://local:8000/dir.zip', + alias: 'dirApp', + version: '1.23.24', + target: 'dir.bat', + args: '' + }; + fin.desktop.System.downloadAsset(dirAppAsset, progress => { + const downloadedPercent = Math.floor((progress.downloadedBytes / progress.totalBytes) * 100); + console.log(`Downloaded ${downloadedPercent}%`); + }, p => { + console.log(`Downlod complete, can be found on ${p.path}`); + // lets launch our application asset. + // launchDirApp(); + }, (reason, err) => { + console.log(reason, err); + }); + // downloadRuntime + fin.desktop.System.downloadRuntime({ version: '9.61.31.56' }, progress => { + console.log(progress.downloadedBytes, progress.downloadedBytes); + }, () => console.log('download complete'), err => console.error(err)); + // downloadPreloadScript + const preloadScripts = [ + { url: 'http://whatever.com/script.js' } + ]; + fin.desktop.System.downloadPreloadScripts(preloadScripts, info => { + const downloadInfo = info[0]; + console.log(downloadInfo.success, downloadInfo.url, downloadInfo.error); + }, err => { + console.log(err); + }); + // exit + fin.desktop.System.exit(() => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + //flushCookieStore + fin.desktop.System.flushCookieStore(() => { + console.log('successful'); + }, err => { + console.log('failure', err); + }); + // getAllApplications + fin.desktop.System.getAllApplications(applicationInfoList => { + applicationInfoList.forEach(applicationInfo => { + console.log("Showing information for application with uuid: " + + applicationInfo.uuid); + console.log("isRunning: ", applicationInfo.isRunning); + }); + }); + // getAllExternalApplications + fin.desktop.System.getAllExternalApplications(externalAppsInfoList => { + externalAppsInfoList.forEach(appInfo => { + console.log(`External app connected to the runtime with UUID ${appInfo.uuid}`); + }); + }); + // getAllWindows + fin.desktop.System.getAllWindows(windowInfoList => { + windowInfoList.forEach(windowInfo => { + console.log("Showing information for application with uuid: ", windowInfo.uuid); + console.log("Main window: ", windowInfo.mainWindow); + console.log("Child windows: ", windowInfo.childWindows); + }); + }); + // getAppAssetInfo + fin.desktop.System.getAppAssetInfo({ alias: 'myAppAsset' }, info => { + console.log(info.alias, info.args, info.mandatory, info.src, info.target, info.version); + }, err => console.log(err)); + // getCommandLineArguments + fin.desktop.System.getCommandLineArguments(args => { + console.log("The command line arguments are " + args); + }); + //getCookieInfo + fin.desktop.System.getCookies({ name: 'myCookie1'}, cookies => { + const cookie1 = cookies[0]; + console.log(cookie1.name, cookie1.domain, cookie1.path); + }, err => console.log(err)); + // getDeviceId + fin.desktop.System.getDeviceId(id => { + console.log("The id of the device is: " + id); + }); + // getDeviceUserId + fin.desktop.System.getDeviceUserId(id => console.log(id), err => console.error(err)); + // getEntityInfo + fin.desktop.System.getEntityInfo('uuid', 'name', info => { + console.log(info.entityType, info.name, info.uuid, info.parent.name, info.parent.uuid); + }, err => console.log(err)); + // getEnvironmentVariable + fin.desktop.System.getEnvironmentVariable("APPDATA", variable => { + console.log("this is the APPDATA value", variable); + }); + // getFocusedWindow + fin.desktop.System.getFocusedWindow(win => { + console.log(win.uuid, win.name); + }, err => console.log(err)); + // getHostSpecs + fin.desktop.System.getHostSpecs(info => { + console.log(info); + }, error => { + console.log('There was an error:', error); + }); + // getLog + fin.desktop.System.getLog('debug-2015-01-08-22-27-53.log', log => { + console.log(log); + }); + // getLogList + fin.desktop.System.getLogList(logList => { + logList.forEach(logInfo => { + console.log(`The filename of the log is ${logInfo.name}, the size is ${logInfo.size}, and the date of creation is ${logInfo.date}`); + }); + }); + //getMinLogLevel + fin.desktop.System.getMinLogLevel(level => console.log(level), err => console.log(err)); + // getMonitorInfo + fin.desktop.System.getMonitorInfo(monitorInfo => { + console.log("This object contains information about all monitors: ", monitorInfo); + }); + // getMousePosition + fin.desktop.System.getMousePosition(mousePosition => { + console.log(`The mouse is located at left: ${mousePosition.left}, top: ${mousePosition.top}`); + }); + // getProcessList + fin.desktop.System.getProcessList(list => { + list.forEach(process => { + console.log(`UUID: ${process.uuid}, Application Name: ${process.name}`); + }); + }); + // getProxySettings + fin.desktop.System.getProxySettings(proxy => { + console.log(proxy); + }); + // getRvmInfo + fin.desktop.System.getRvmInfo(rvmInfoObject => { + console.log("RVM version:", rvmInfoObject.version); + console.log("RVM has been running since:", rvmInfoObject["start-time"]); + }, err => { + console.log("Failed to get rvm info, error message:", err); + }); + // getVersion + fin.desktop.System.getVersion(version => { + console.log("The version is " + version); + }); + // launchExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + // Additionally note that the executable found in the zip file specified in appAssets + // will default to the one mentioned by appAssets.target + // If the the path below refers to a specific path it will override this default + alias: "myApp", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + alias: "myApp", + arguments: "e f g", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + path: "C:\Users\ExampleUser\AppData\Local\OpenFin\OpenFinRVM.exe", + arguments: "--version", + certificate: { + trusted: true, + subject: 'O=OpenFin INC., L=New York, S=NY, C=US', + thumbprint: '3c a5 28 19 83 05 fe 69 88 e6 8f 4b 3a af c5 c5 1b 07 80 5b' + }, + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // log + fin.desktop.System.log("info", "An example log message", () => { + console.log("message successfully logged"); + }, err => { + console.log(err); + }); + // monitorExternalProcess + fin.desktop.System.monitorExternalProcess({ + pid: 2508, + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log("The process is now being monitored: ", payload.uuid); + }, error => { + console.log("Error:", error); + }); + // openUrlWithBrowser + fin.desktop.System.openUrlWithBrowser("https://developer.openf.in/", () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // readRegistryValue + fin.desktop.System.readRegistryValue('HKEY_SOMETHING', 'HARDWARE\\SOMETHING', 'BootSomething', info => { + console.log(info.data, info.rootKey, info.subkey, info.type, info.value); + }, err => console.log(err)); + // registerExternalConnection + fin.desktop.System.registerExternalConnection("remote-connection-uuid", (...args: any[]) => { + console.log(args); + }); + // releaseExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener(result) { + console.log("The exit code", result.exitCode); + } + }, result => { + console.log("Result UUID is " + result.uuid); - // release it. - fin.desktop.System.releaseExternalProcess(result.uuid, () => { - console.log("Process has been unmapped!"); - }, reason => { - console.log("failure: " + reason); - }); - }); - // removeEventListener - const aRegisteredListener = (event: fin.SystemBaseEvent) => { }; - fin.desktop.System.removeEventListener("monitor-info-changed", aRegisteredListener, () => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // showDeveloperTools - fin.desktop.System.showDeveloperTools("uuid", "name", () => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // terminateExternalProcess - fin.desktop.System.launchExternalProcess({ - // notepad is in the system's PATH - path: "notepad", - arguments: "", - listener(result) { - console.log("The exit code", result.exitCode); - } - }, result => { - console.log("Result UUID is " + result.uuid); + // release it. + fin.desktop.System.releaseExternalProcess(result.uuid, () => { + console.log("Process has been unmapped!"); + }, reason => { + console.log("failure: " + reason); + }); + }); + // removeEventListener + const aRegisteredListener = (event: fin.SystemBaseEvent) => { }; + fin.desktop.System.removeEventListener("monitor-info-changed", aRegisteredListener, () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + //setMinLogLevel + fin.desktop.System.setMinLogLevel("log level", () => console.log('Success'), err => console.error(err)); + // showDeveloperTools + fin.desktop.System.showDeveloperTools("uuid", "name", () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // terminateExternalProcess + fin.desktop.System.launchExternalProcess({ + // notepad is in the system's PATH + path: "notepad", + arguments: "", + listener(result) { + console.log("The exit code", result.exitCode); + } + }, result => { + console.log("Result UUID is " + result.uuid); - // Attempt to close the process. Terminate after 4 seconds if it - // has not done so. - fin.desktop.System.terminateExternalProcess(result.uuid, 4000, info => { - console.log("Termination result " + info.result); - }, reason => { - console.log("failure: " + reason); - }); - }); - // updateProxySettings - fin.desktop.System.updateProxySettings("type", "proxyAddress", 8080, () => { - console.log('success'); - }, err => { - console.log(err); - }); + // Attempt to close the process. Terminate after 4 seconds if it + // has not done so. + fin.desktop.System.terminateExternalProcess(result.uuid, 4000, info => { + console.log("Termination result " + info.result); + }, reason => { + console.log("failure: " + reason); + }); + }); + // updateProxySettings + fin.desktop.System.updateProxySettings("type", "proxyAddress", 8080, () => { + console.log('success'); + }, err => { + console.log(err); + }); } function test_system_clipboard() { - // availableFormats - fin.desktop.System.Clipboard.availableFormats(null, formats => { - formats.forEach(format => console.log(`The format ${format} is available to read`)); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // readHtml - fin.desktop.System.Clipboard.readHtml(null, html => { - console.log(`This is the html from the clipboard: ${html}`); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // readRtf - fin.desktop.System.Clipboard.readRtf(null, rtf => { - console.log(`This is the rtf from the clipboard: ${rtf}`); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // readText - fin.desktop.System.Clipboard.readText(null, text => { - console.log(`This is the text from the clipboard: ${text}`); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // write - fin.desktop.System.Clipboard.write({ - text: 'Hello Text!', - html: '

    Hello Html

    ', - rtf: 'Hello Rtf' - }, null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // writeHtml - fin.desktop.System.Clipboard.writeHtml('

    Hello World

    ', null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // writeRtf - fin.desktop.System.Clipboard.writeRtf('Hello World!', null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // writeText - fin.desktop.System.Clipboard.writeText('Hello World', null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); + // availableFormats + fin.desktop.System.Clipboard.availableFormats(null, formats => { + formats.forEach(format => console.log(`The format ${format} is available to read`)); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readHtml + fin.desktop.System.Clipboard.readHtml(null, html => { + console.log(`This is the html from the clipboard: ${html}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readRtf + fin.desktop.System.Clipboard.readRtf(null, rtf => { + console.log(`This is the rtf from the clipboard: ${rtf}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readText + fin.desktop.System.Clipboard.readText(null, text => { + console.log(`This is the text from the clipboard: ${text}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // write + fin.desktop.System.Clipboard.write({ + text: 'Hello Text!', + html: '

    Hello Html

    ', + rtf: 'Hello Rtf' + }, null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeHtml + fin.desktop.System.Clipboard.writeHtml('

    Hello World

    ', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeRtf + fin.desktop.System.Clipboard.writeRtf('Hello World!', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeText + fin.desktop.System.Clipboard.writeText('Hello World', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); } function test_window() { - let finWindow: fin.OpenFinWindow; - // constructor - finWindow = new fin.desktop.Window({ - name: "childWindow", - url: "child.html", - defaultWidth: 320, - defaultHeight: 320, - defaultTop: 10, - defaultLeft: 300, - frame: false, - resizable: false, - state: "normal" - }, () => { - const _win = finWindow.getNativeWindow(); - _win.addEventListener("DOMContentLoaded", () => { finWindow.show(); }); - }, error => { - console.log("Error creating window:", error); - }); - // getCurrent - finWindow = fin.desktop.Window.getCurrent(); - // getNativeWindow - let nativeWindow: Window; - nativeWindow = finWindow.getNativeWindow(); - // getParentApplication - let parentApp: fin.OpenFinApplication; - parentApp = finWindow.getParentApplication(); - // getParentWindow - let parentFinWindow: fin.OpenFinWindow; - parentFinWindow = finWindow.getParentWindow(); - // wrap - finWindow = fin.desktop.Window.wrap("uuid", "name"); - // addEventListener - finWindow.addEventListener("bounds-changed", event => { - console.log("The window has been moved or resized"); - }, () => { - console.log("The registration was successful"); - }, reason => { - console.log("failure:" + reason); - }); - // animate - finWindow.animate({ - opacity: { - opacity: 0.15, - duration: 1000 - }, - position: { - left: 10, - top: 10, - duration: 3000 - } - }, { - interrupt: false - }, evt => { - // Callback will only fire after both "opacity" and "position" have finished animating. - }); - // authenticate - finWindow.addEventListener('auth-requested', evt => { - finWindow.authenticate('userName', 'P@assw0rd', () => { }, (reason, err) => { - console.log("failure:", err); - }); - }); - // blur - finWindow.blur(); - // bringToFront - finWindow.bringToFront(); - // close - finWindow.close(); - // disableFrame - finWindow.disableFrame(); - // enableFrame - finWindow.enableFrame(); - // flash - finWindow.flash(); - // focus - finWindow.focus(); - // getBounds - finWindow.getBounds(bounds => { - console.log(`top: ${bounds.top} left: ${bounds.left} height: ${bounds.height} width: ${bounds.width}`); - }); - // getOptions - finWindow.getOptions(options => { - console.log(options); - }); - // getSnapshot - finWindow.getSnapshot(base64Snapshot => { - console.log("data:image/png;base64," + base64Snapshot); - }); - // getState - finWindow.getState(state => { - console.log("state: " + state); - }); - // getZoomLevel - finWindow.getZoomLevel(level => { - console.log("zoom level: " + level); - }, error => { - console.log('error:', error); - }); - // hide - finWindow.hide(); - // isShowing - finWindow.isShowing(showing => { - console.log("the window is " + (showing ? "showing" : "hidden")); - }); - // joinGroup - let secondWindow = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "secondWindow", - autoShow: true - }, () => { - // When mainWindow moves or is moved, secondWindow moves by the same amount - secondWindow.joinGroup(finWindow); - }); - // leaveGroup - secondWindow = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "secondWindow", - autoShow: true - }, () => { - // When finWindow moves or is moved, secondWindow moves by the same amount - secondWindow.joinGroup(finWindow, () => { - // once we are in the group, lets leave it. - secondWindow.leaveGroup(); - }); - }); - // maximize - finWindow.maximize(); - // mergeGroups - { - const finWindowOne = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowOne", - autoShow: true - }); - const finWindowTwo = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowTwo", - autoShow: true - }); - const finWindowThree = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowThree", - autoShow: true - }); - const finWindowFour = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowFour", - autoShow: true - }); - // When finWindowOne moves or is moved, finWindowTwo moves by the same amount - finWindowOne.joinGroup(finWindowTwo); - // When finWindowThree moves or is moved, finWindowFour moves by the same amount - finWindowThree.joinGroup(finWindowFour); - // finWindowOne, finWindowTwo, finWindowThree, and finWindowFour now move together in the same group - finWindowOne.mergeGroups(finWindowThree); - } - // minimize - finWindow.minimize(); - // moveBy - finWindow.moveBy(10, 10); - // moveTo - finWindow.moveTo(100, 200); - // removeEventListener - const aRegisteredListener = (event: fin.WindowBaseEvent) => { }; - finWindow.removeEventListener("bounds-changed", aRegisteredListener); - // resizeBy - finWindow.resizeBy(10, 10, "top-right"); - // resizeTo - finWindow.resizeTo(10, 10, "top-right"); - // restore - finWindow.restore(); - // setAsForeground - finWindow.setAsForeground(); - // setBounds - finWindow.setBounds(100, 200, 400, 400); - // setZoomLevel - finWindow.setZoomLevel(10); - // show - finWindow.show(); - // showAt - finWindow.showAt(10, 10, false); - // stopFlashing - finWindow.stopFlashing(); - // updateOptions - finWindow.updateOptions({ - frame: false, - maxWidth: 500 - }); + let finWindow: fin.OpenFinWindow; + // constructor + finWindow = new fin.desktop.Window({ + name: "childWindow", + url: "child.html", + defaultWidth: 320, + defaultHeight: 320, + defaultTop: 10, + defaultLeft: 300, + frame: false, + resizable: false, + state: "normal" + }, () => { + const _win = finWindow.getNativeWindow(); + _win.addEventListener("DOMContentLoaded", () => { finWindow.show(); }); + }, error => { + console.log("Error creating window:", error); + }); + // getCurrent + finWindow = fin.desktop.Window.getCurrent(); + // getNativeWindow + let nativeWindow: Window; + nativeWindow = finWindow.getNativeWindow(); + // getParentApplication + let parentApp: fin.OpenFinApplication; + parentApp = finWindow.getParentApplication(); + // getParentWindow + let parentFinWindow: fin.OpenFinWindow; + parentFinWindow = finWindow.getParentWindow(); + // wrap + finWindow = fin.desktop.Window.wrap("uuid", "name"); + // addEventListener + finWindow.addEventListener("bounds-changed", event => { + console.log("The window has been moved or resized"); + }, () => { + console.log("The registration was successful"); + }, reason => { + console.log("failure:" + reason); + }); + // animate + finWindow.animate({ + opacity: { + opacity: 0.15, + duration: 1000 + }, + position: { + left: 10, + top: 10, + duration: 3000 + } + }, { + interrupt: false + }, evt => { + // Callback will only fire after both "opacity" and "position" have finished animating. + }); + // authenticate + finWindow.addEventListener('auth-requested', evt => { + finWindow.authenticate('userName', 'P@assw0rd', () => { }, (reason, err) => { + console.log("failure:", err); + }); + }); + // blur + finWindow.blur(); + // bringToFront + finWindow.bringToFront(); + // close + finWindow.close(); + // disableFrame + finWindow.disableFrame(); + // enableFrame + finWindow.enableFrame(); + // flash + finWindow.flash(); + // focus + finWindow.focus(); + // getBounds + finWindow.getBounds(bounds => { + console.log(`top: ${bounds.top} left: ${bounds.left} height: ${bounds.height} width: ${bounds.width}`); + }); + // getOptions + finWindow.getOptions(options => { + console.log(options); + }); + // getSnapshot + finWindow.getSnapshot(base64Snapshot => { + console.log("data:image/png;base64," + base64Snapshot); + }); + // getState + finWindow.getState(state => { + console.log("state: " + state); + }); + // getZoomLevel + finWindow.getZoomLevel(level => { + console.log("zoom level: " + level); + }, error => { + console.log('error:', error); + }); + // hide + finWindow.hide(); + // isShowing + finWindow.isShowing(showing => { + console.log("the window is " + (showing ? "showing" : "hidden")); + }); + // joinGroup + let secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, () => { + // When mainWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow); + }); + // leaveGroup + secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, () => { + // When finWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow, () => { + // once we are in the group, lets leave it. + secondWindow.leaveGroup(); + }); + }); + // maximize + finWindow.maximize(); + // mergeGroups + { + const finWindowOne = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowOne", + autoShow: true + }); + const finWindowTwo = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowTwo", + autoShow: true + }); + const finWindowThree = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowThree", + autoShow: true + }); + const finWindowFour = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowFour", + autoShow: true + }); + // When finWindowOne moves or is moved, finWindowTwo moves by the same amount + finWindowOne.joinGroup(finWindowTwo); + // When finWindowThree moves or is moved, finWindowFour moves by the same amount + finWindowThree.joinGroup(finWindowFour); + // finWindowOne, finWindowTwo, finWindowThree, and finWindowFour now move together in the same group + finWindowOne.mergeGroups(finWindowThree); + } + // minimize + finWindow.minimize(); + // moveBy + finWindow.moveBy(10, 10); + // moveTo + finWindow.moveTo(100, 200); + // removeEventListener + const aRegisteredListener = (event: fin.WindowBaseEvent) => { }; + finWindow.removeEventListener("bounds-changed", aRegisteredListener); + // resizeBy + finWindow.resizeBy(10, 10, "top-right"); + // resizeTo + finWindow.resizeTo(10, 10, "top-right"); + // restore + finWindow.restore(); + // setAsForeground + finWindow.setAsForeground(); + // setBounds + finWindow.setBounds(100, 200, 400, 400); + // setZoomLevel + finWindow.setZoomLevel(10); + // show + finWindow.show(); + // showAt + finWindow.showAt(10, 10, false); + // stopFlashing + finWindow.stopFlashing(); + // updateOptions + finWindow.updateOptions({ + frame: false, + maxWidth: 500 + }); +} + +function test_frame() { + //wrap + const frame = fin.desktop.Frame.wrap('uuid', 'name'); + //getCurrent + const currentFrame = fin.desktop.Frame.getCurrent(); + // addEventlistener + frame.addEventListener('event', () => console.log('on event'), () => console.log('success'), err => console.error(err)); + //removeEventListener + frame.removeEventListener('event', () => console.log('on event'), () => console.log('success'), err => console.error(err)); + // getInfo + frame.getInfo(info => { + console.log(info.uuid, info.name, info.entityType, info.parent.uuid, info.parent.name); + }, err => console.error(err)); + // getParentWindow + frame.getParentWindow(parent => { + console.log(parent.uuid, parent.name, parent.entityType, parent.parent.uuid, parent.parent.name); + }, err => console.error(err)); } diff --git a/types/openfin/tsconfig.json b/types/openfin/tsconfig.json index fd3199ceb7..df2dae8b79 100644 --- a/types/openfin/tsconfig.json +++ b/types/openfin/tsconfig.json @@ -8,12 +8,17 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], + "paths": { + "openfin": [ + "openfin/v29" + ] + }, "noEmit": true, "forceConsistentCasingInFileNames": true }, @@ -21,4 +26,4 @@ "index.d.ts", "openfin-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/openfin/tslint.json b/types/openfin/tslint.json index 64aace11d6..f93cf8562a 100644 --- a/types/openfin/tslint.json +++ b/types/openfin/tslint.json @@ -1,6 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "max-line-length": false - } + "extends": "dtslint/dt.json" } diff --git a/types/openfin/v17/index.d.ts b/types/openfin/v17/index.d.ts new file mode 100644 index 0000000000..30afded19b --- /dev/null +++ b/types/openfin/v17/index.d.ts @@ -0,0 +1,1732 @@ +// Type definitions for OpenFin API 17.0 +// Project: https://openfin.co/ +// Definitions by: Chris Barker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// based on v6.49.17.14 +// see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean + +/** + * JavaScript API + * The JavaScript API allows you to create an HTML/JavaScript application that has access to the native windowing environment, + * can communicate with other applications and has access to sandboxed system-level features. + * + * API Ready + * When using the OpenFin API, it is important to ensure that it has been fully loaded before making any API calls. To verify + * that the API is in fact ready, be sure to make any API calls either from within the fin.desktop.main() method or explicitly + * after it has returned. This avoids the situation of trying to access methods that are not yet fully injected. + * + * Overview + * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API + * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "document" objects. + */ +declare namespace fin { + const desktop: OpenFinDesktop; + + interface OpenFinDesktop { + main(f: () => any): void; + Application: OpenFinApplicationStatic; + ExternalApp: OpenFinExternalApplicationStatic; + InterApplicationBus: OpenFinInterApplicationBus; + Notification: OpenFinNotificationStatic; + System: OpenFinSystem; + Window: OpenFinWindowStatic; + } + + interface OpenFinApplicationStatic { + /** + * Creates a new Application. + * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. + */ + new ( + options: ApplicationOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; + /** + * Returns an Application object that represents an existing application. + */ + getCurrent(): OpenFinApplication; + /** + * Returns an Application object that represents an existing application. + */ + wrap(uuid: string): OpenFinApplication; + } + + /** + * Application + * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. + */ + interface OpenFinApplication { + /** + * Returns an instance of the main Window of the application + */ + getWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinApplicationEventType, + listener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Closes the application and any child windows created by the application. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. + */ + getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. + */ + getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. + */ + getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. + */ + getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves current configuration of application's shortcuts. + */ + getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves information about the application. + */ + getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the application is currently running. + */ + isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Passes in custom data that will be relayed to the RVM + */ + registerCustomData(data: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinApplicationEventType, + previouslyRegisteredListener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => any, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the application's icon from the tray. + */ + removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restarts the application. + */ + restart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Runs the application. When the application is created, run must be called. + */ + run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Tells the rvm to relaunch the main application once upon a complete shutdown + */ + scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets new shortcut configuration for current application. + * Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to + * be able to change shortcut states. + */ + setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Adds a customizable icon in the system tray and notifies the application when clicked. + */ + setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the application by terminating its process. + */ + terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application + * to continue and to generate another "not-responding" message after a certain period of time. + */ + wait(callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface ShortCutConfig { + /** + * application has a shortcut on the desktop + */ + desktop?: boolean; + /** + * application has no shortcut in the start menu + */ + startMenu?: boolean; + /** + * application will be launched on system startup + */ + systemStartup?: boolean; + } + + interface SuccessObj { + httpResponseCode: number; + } + + interface NetworkErrorInfo extends ErrorInfo { + networkErrorCode: number; + } + + interface ErrorInfo { + stack: string; + message: string; + } + + interface ApplicationOptions { + /** + * The name of the application. + */ + name?: string; + /** + * The url to the application. + */ + url?: string; + /** + * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. + */ + uuid?: string; + /** + * Enable Flash at the application level. Default: false. + */ + plugins?: boolean; + /** + * The options of the main window of the application. + */ + mainWindowOptions?: WindowOptions; + } + + interface WindowOptions { + /** + * Enable keyboard shortcuts for devtools and zoom. Default: false for both. + */ + accelerator?: { + devtools?: boolean, + zoom?: boolean, + reload?: boolean, + reloadIgnoreCache?: boolean, + }; + /** + * A flag to always position the window at the top of the window stack. Default: false. + * Updatable + */ + alwaysOnTop?: boolean; + /** + * A flag to automatically show the Window when it is created. Default: false. + */ + autoShow?: boolean; + /** + * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true + * Updatable + */ + contextMenu?: boolean; + /** + * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. + * Updatable + */ + cornerRounding?: { + width?: number; + height?: number; + }; + /** + * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. + */ + customData?: any; + /** + * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the position from before the window was closed is used. + * This option overrides defaultLeft and defaultTop. Default: false. + */ + defaultCentered?: boolean; + /** + * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. + */ + defaultHeight?: number; + /** + * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. + */ + defaultWidth?: number; + /** + * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. + */ + defaultTop?: number; + /** + * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. + */ + defaultLeft?: number; + /** + * A flag to show the frame. Default: true. + * Updatable + */ + frame?: boolean; + /** + * A flag to allow a window to be hidden when the close button is clicked.Default: false. + * Updatable + */ + hideOnClose?: boolean; + /** + * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. + * Updatable + */ + icon?: string; + /** + * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxHeight?: number; + /** + * A flag that lets the window be maximized.Default: true. + * Updatable + */ + maximizable?: boolean; + /** + * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxWidth?: number; + /** + * The minimum height of a window.Default: 0. + * Updatable + */ + minHeight?: number; + /** + * A flag that lets the window be minimized.Default: true. + */ + minimizable?: boolean; + /** + * The minimum width of a window.Default: 0. + */ + minWidth?: number; + /** + * The name for the window which must be unique within the context of the invoking Application. + */ + name?: string; + /** + * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. + * Updatable + */ + opacity?: number; + /** + * A flag to drop to allow the user to resize the window.Default: true. + * Updatable + */ + resizable?: boolean; + /** + * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. + * Updatable + */ + resizeRegion?: { + /** + * The size in pixels (Default: 2), + */ + size?: number; + /** + * The size in pixels of an additional + * square resizable region located at the + * bottom right corner of a + * frameless window. (Default: 4) + */ + bottomRightCorner?: number; + }; + /** + * A flag to show the Window's icon in the taskbar. Default: true. + */ + showTaskbarIcon?: boolean; + /** + * A flag to cache the location of the window or not. Default: true. + */ + saveWindowState?: boolean; + /** + * Specify a taskbar group for the window. Default: app's uuid. + */ + taskbarIconGroup?: string; + /** + * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". + */ + state?: string; + /** + * The URL of the window. Default: "about:blank". + */ + url?: string; + /** + * When set to false, the window will render before the "load" event is fired on the content's window. + * Caution, when false you will see an initial empty white window. Default: true. + */ + waitForPageLoad?: boolean; + } + + /** + * Clipboard + * Clipboard API allows reading and writting to the clipboard in multiple formats. + */ + interface OpenFinClipboard { + /** + * Reads available formats for the clipboard type + */ + availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Reads available formats for the clipboard type + */ + readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as Rtf + */ + readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as plain text + */ + readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard + */ + write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Html + */ + writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Rtf + */ + writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as plain text + */ + writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + interface OpenFinExternalApplicationStatic { + /** + * Returns an External Application object that represents an existing external application. + */ + wrap(uuid: string): OpenFinExternalApplication; + } + /** + * ExternalApplication + * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. + */ + interface OpenFinExternalApplication { + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + /** + * InterApplicationBus + * A messaging bus that allows for pub/sub messaging between different applications. + */ + interface OpenFinInterApplicationBus { + /** + * Adds a listener that gets called when applications subscribe to the current application's messages. + */ + addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Adds a listener that gets called when applications unsubscribe to the current application's messages. + */ + addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered subscribe listener. + */ + removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered unsubscribe listener. + */ + removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. + */ + publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sends a message to a specific application on a specific topic. + */ + send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], + * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. + */ + subscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + subscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Unsubscribes to messages from the specified application on the specified topic. + */ + unsubscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + unsubscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + } + + interface OpenFinNotificationStatic { + /** + * ctor + */ + new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; + /** + * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. + */ + getCurrent(): OpenFinNotification; + } + + /** + * Notification + * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. + * A notification is typically used to alert the user of some important event which requires his or her attention. + * Notifications are a child or your application that are controlled by the runtime. + */ + interface OpenFinNotification { + /** + * Closes the notification. + */ + close(callback?: () => void): void; + /** + * Sends a message to the notification. + */ + sendMessage(message: any, callback?: () => void): void; + /** + * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. + */ + sendMessageToApplication(message: any, callback?: () => void): void; + } + + interface NotificationOptions { + /** + * A boolean that will force dismissal even if the mouse is hovering over the notification + */ + ignoreMouseOver?: boolean; + /** + * A message of any primitive or composite-primitive type to be passed to the notification upon creation. + */ + message?: any; + /** + * The timeout for displaying a notification.Can be in milliseconds or "never". + */ + duration?: number | "never"; + /** + * The url of the notification + */ + url?: string; + /** + * A function that is called when a notification is clicked. + */ + onClick?(callback: () => void): void; + /** + * Invoked when the notification is closed via .close() method on the created notification instance + * or the by the notification itself via fin.desktop.Notification.getCurrent().close(). + * NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss + */ + onClose?(callback: () => void): void; + /** + * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. + */ + onDismiss?(callback: () => void): void; + /** + * A function that is called when an error occurs.The reason for the error is passed as an argument. + */ + onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * The onMessage function will respond to messages sent from notification.sendMessageToApplication. + * The function is passed the message, which can be of any primitive or composite-primitive type. + */ + onMessage?(callback: (message: any) => void): void; + /** + * A function that is called when a notification is shown. + */ + onShow?(callback: (successObj: SuccessObj) => void): void; + } + + /** + * System + * An object representing the core of OpenFin Runtime. + * Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. + */ + interface OpenFinSystem { + Clipboard: OpenFinClipboard; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Clears cached data containing window state/positions, + * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. + */ + clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Clears all cached data when OpenFin Runtime exits. + */ + deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Downloads the given application asset + */ + downloadAsset( + assetObj: AppAssetInfo, + progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, + callback?: (successObj: { path: string }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Exits the Runtime. + */ + exit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all applications. + */ + getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all external applications. + */ + getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data (name, ids, bounds) for all application windows. + */ + getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the command line argument string that started OpenFin Runtime. + */ + getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the configuration object that started the OpenFin Runtime. + */ + getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the value of a given environment variable on the computer on which the runtime is installed. + */ + getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves system information. + */ + getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the contents of the log with the specified filename. + */ + getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing information for each log file. + */ + getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. + */ + getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the mouse in virtual screen coordinates (left, top). + */ + getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of all of the runtime processes that are currently running. + * Each element in the array is an object containing the uuid and the name of the application to which the process belongs. + */ + getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the Proxy settings. + */ + getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns information about the running RVM in an object. + */ + getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. + */ + getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Runs an executable or batch file. + */ + launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Writes the passed message into both the log file and the console. + */ + log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Monitors a running process. + */ + monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Opens the passed URL in the default web browser. + */ + openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * This function call will register a unique id and produce a token. The token can be used to broker an external connection. + */ + registerExternalConnection( + uuid: string, + callback?: (detail: { + /** + * this will be unique each time + */ + token: string; + /** + * "remote-connection-uuid" + */ + uuid: string; + }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). + */ + releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the Chrome Developer Tools for the specified window. + */ + showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. + */ + terminateExternalProcess( + processUuid: string, + timeout: number, + killTree: boolean, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + terminateExternalProcess( + processUuid: string, + timeout: number, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Update the OpenFin Runtime Proxy settings. + */ + updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface CacheOptions { + cache?: boolean; + cookies?: boolean; + localStorage?: boolean; + appcache?: boolean; + userData?: boolean; + } + + interface AppAssetInfo { + src?: string; + alias?: string; + version?: string; + target?: string; + args?: string; + } + + interface ApplicationInfo { + /** + * true when the application is running. + */ + isRunning?: boolean; + /** + * uuid of the application. + */ + uuid?: string; + /** + * uuid of the application that launches this application. + */ + parentUuid?: string; + } + + interface WindowDetails { + uuid?: string; + mainWindow?: WindowInfo; + childWindows?: WindowInfo[]; + } + + interface WindowInfo { + /** + * name of the child window + */ + name?: string; + /** + * top-most coordinate of the child window + */ + top?: number; + /** + * right-most coordinate of the child window + */ + right?: number; + /** + * bottom-most coordinate of the child window + */ + bottom?: number; + /** + * left-most coordinate of the child window + */ + left?: number; + } + + interface HostSpecInfo { + /** + * "x86" for 32-bit or "x86_64" for 64-bit + */ + arch: string; + /** + * Same payload as Node's os.cpus() + */ + cpus: NodeCpuInfo[]; + gpu: { + /** + * Graphics card name + */ + name: string; + }; + /** + * Same payload as Node's os.totalmem() + */ + memory: number; + /** + * OS name and version/edition + */ + name: string; + } + + interface NodeCpuInfo { + model: string; + /** + * in MHz + */ + speed: number; + times: { + /** + * The number of milliseconds the CPU has spent in user mode. + */ + user: number; + /** + * The number of milliseconds the CPU has spent in nice mode. + */ + nice: number; + /** + * The number of milliseconds the CPU has spent in sys mode. + */ + sys: number; + /** + * The number of milliseconds the CPU has spent in idle mode. + */ + idle: number; + /** + * The number of milliseconds the CPU has spent in irq mode. + */ + irq: number; + }; + } + + interface LogInfo { + /** + * the filename of the log + */ + name?: string; + /** + * the size of the log in bytes + */ + size?: number; + /** + * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" + */ + date?: string; + } + + interface ProcessInfo { + /** + * the percentage of total CPU usage + */ + cpuUsage?: number; + /** + * the application name + */ + name?: string; + /** + * the current nonpaged pool usage in bytes + */ + nonPagedPoolUsage?: number; + /** + * the number of page faults + */ + pageFaultCount?: number; + /** + * the current paged pool usage in bytes + */ + pagedPoolUsage?: number; + /** + * the total amount of memory in bytes that the memory manager has committed + */ + pagefileUsage?: number; + /** + * the peak nonpaged pool usage in bytes + */ + peakNonPagedPoolUsage?: number; + /** + * the peak paged pool usage in bytes + */ + peakPagedPoolUsage?: number; + /** + * the peak value in bytes of pagefileUsage during the lifetime of this process + */ + peakPagefileUsage?: number; + /** + * the peak working set size in bytes + */ + peakWorkingSetSize?: number; + /** + * the native process identifier + */ + processId?: number; + /** + * the application UUID + */ + uuid?: string; + /** + * the current working set size (both shared and private data) in bytes + */ + workingSetSize?: number; + } + + interface ProxyInfo { + /** + * the configured Proxy Address + */ + proxyAddress?: string; + /** + * the configured Proxy port + */ + proxyPort?: number; + /** + * Proxy Type + */ + type?: string; + } + + interface RvmInfo { + version?: string; + "start-time"?: string; + } + + interface ExternalProcessLaunchInfo { + path?: string; + /** + * Additionally note that the executable found in the zip file specified in appAssets + * will default to the one mentioned by appAssets.target + * If the the path below refers to a specific path it will override this default + */ + alias?: string; + /** + * When using alias; if no arguments are passed then the arguments (if any) + * are taken from the 'app.json' file, from the 'args' parameter + * of the 'appAssets' Object with the relevant 'alias'. + * If 'arguments' is passed as a parameter it takes precedence + * over any 'args' set in the 'app.json'. + */ + arguments?: string; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + certificate?: CertificationInfo; + } + + interface CertificationInfo { + /** + * A hex string with or without spaces + */ + serial?: string; + /** + * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields + */ + subject?: string; + /** + * A hex string with or without spaces + */ + publickey?: string; + /** + * A hex string with or without spaces + */ + thumbprint?: string; + /** + * A boolean indicating that the certificate is trusted and not revoked + */ + trusted?: boolean; + } + + interface ExternalProcessInfo { + pid?: number; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + } + + interface OpenFinWindowStatic { + /** + * Class: Window + * + * new Window(options, callbackopt, errorCallbackopt) + * + * Creates a new OpenFin Window + * + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + * @param options - The options of the window + * @param [callback] - Called if the window creation was successful + * @param [callback.successObj] - httpResponseCode + */ + new ( + options: WindowOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; + /** + * Returns an instance of the current window. + * @returns Current window + */ + getCurrent(): OpenFinWindow; + /** + * Returns a Window object that wraps an existing window. + */ + wrap(appUuid: string, windowName: string): OpenFinWindow; + } + + /** + * Window + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + */ + interface OpenFinWindow { + /** + * Name of window + */ + name: string; + /** + * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, + * otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the + * contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. + * Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). + * @returns Native window + */ + getNativeWindow(): Window; + /** + * Gets the parent application. + * @returns Parent application + */ + getParentApplication(): OpenFinApplication; + /** + * Gets the parent window. + */ + getParentWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Performs the specified window transitions + */ + animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Provides credentials to authentication requests + */ + authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes focus from the window. + */ + blur(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Brings the window to the front of the OpenFin window stack. + */ + bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the window. + * @param Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Prevents a user from changing a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-disabled' is generated when an enabled frame becomes disabled. + */ + disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Re-enables user changes to a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-enabled' is generated when a disabled frame has becomes enabled. + */ + enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Flashes the window's frame and taskbar icon until the window is activated. + */ + flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gives focus to the window. + */ + focus(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current bounds (top, left, width, height) of the window. + */ + getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. + * Please note that calling window is included in the result array. + */ + getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current settings of the window. + */ + getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets a base64 encoded PNG snapshot of the window. + */ + getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current state ("minimized", "maximized", or "restored") of the window. + */ + getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the zoom level of the window. + */ + getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; + /** + * Hides the window. + */ + hide(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the window is currently showing. + */ + isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Joins the same window group as the specified window. + */ + joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Leaves the current window group so that the window can be move independently of those in the group. + */ + leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Maximizes the window. + */ + maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Merges the instance's window group with the same window group as the specified window + */ + mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Minimizes the window. + */ + minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window by a specified amount. + */ + moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window to a specified location. + */ + moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restores the window to its normal state (i.e., unminimized, unmaximized). + */ + restore(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Will bring the window to the front of the entire stack and give it focus. + */ + setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the window's size and position + */ + setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the zoom level of the window. + */ + setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden. + * @param Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. + */ + show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. + */ + showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Stops the taskbar icon from flashing. + */ + stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Updates the window using the passed options + */ + updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface ApplicationBaseEvent { + topic: string; + type: OpenFinApplicationEventType; + uuid: string; + } + + interface TrayIconClickedEvent extends ApplicationBaseEvent { + button: number; // 0 for left, 1 for middle, 2 for right + monitorInfo: MonitorInfo; + x: number; // the cursor x coordinate + y: number; // the cursor y coordinate + } + + interface WindowEvent extends ApplicationBaseEvent { + name: string; + } + + interface WindowAlertRequestedEvent extends WindowEvent { + message: string; + url: string; + } + + interface WindowAuthRequested extends WindowEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowNavigationRejectedEvent extends WindowEvent { + sourceName: string; + url: string; + } + + interface WindowEndLoadEvent extends WindowEvent { + documentName: string; + isMain: boolean; + } + + interface MonitorInfoChangedEvent extends MonitorInfo { + topic: "system"; + type: "monitor-info-changed"; + } + + interface MonitorInfo { + nonPrimaryMonitors: MonitorInfoDetail[]; + primaryMonitor: MonitorInfoDetail; + reason: string; + taskbar: { + edge: "left" | "right" | "top" | "bottom", + rect: MontiorCoordinates + }; + topic: "system"; + type: "monitor-info-changed"; + virtualScreen: MontiorCoordinates; + } + + interface MonitorInfoDetail { + availableRect: MontiorCoordinates; + deviceId: string; + displayDeviceActive: boolean; + monitorRect: MontiorCoordinates; + name: string; + } + + interface MontiorCoordinates { + bottom: number; + left: number; + right: number; + top: number; + } + + interface VirtualScreenCoordinates { + left: number; + top: number; + } + + interface SystemBaseEvent { + topic: string; + type: OpenFinSystemEventType; + uuid: string; + } + + interface DesktopIconClickedEvent { + mouse: { + /** + * the left virtual screen coordinate of the mouse + */ + left: number, + /** + * the top virtual screen coordinate of the mouse + */ + top: number + }; + /** + * the number of milliseconds that have elapsed since the system was started, + */ + tickCount: number; + topic: "system"; + type: "desktop-icon-clicked"; + } + + interface IdleStateChangedEvent { + /** + * How long in milliseconds since the user has been idle. + */ + elapsedTime: number; + /** + * true when the user is idle,false when the user has returned; + */ + isIdle: boolean; + topic: "system"; + type: "idle-state-changed"; + } + + interface WindowBaseEvent { + /** + * the name of the window + */ + name: string; + /** + * always window + */ + topic: "window"; + /** + * window event type + */ + type: OpenFinWindowEventType; + /** + * the UUID of the application the window belongs to + */ + uuid: string; + } + + interface WindowAuthRequestedEvent extends WindowBaseEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowBoundsEvent extends WindowBaseEvent { + /** + * describes what kind of change occurred. + * 0 means a change in position. + * 1 means a change in size. + * 2 means a change in position and size. + */ + changeType: number; + /** + * true when pending changes have been applied to the window. + */ + deferred: boolean; + /** + * the new height of the window. + */ + height: number; + /** + * the left-most coordinate of the window. + */ + left: number; + /** + * the top-most coordinate of the window. + */ + top: number; + + type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; + /** + * the new width of the window. + */ + width: number; + } + + interface WindowExternalProcessStartedEvent extends WindowBaseEvent { + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-started"; + } + + interface WindowExternalProcessExited extends WindowBaseEvent { + /** + * the process exit code + */ + exitCode: number; + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-exited"; + } + + interface WindowGroupChangedEvent extends WindowBaseEvent { + /** + * Which group array the window that the event listener was registered on is included in: + * 'source' The window is included in sourceGroup. + * 'target' The window is included in targetGroup. + * 'nothing' The window is not included in sourceGroup nor targetGroup. + */ + memberOf: "source" | "target" | "nothing"; + /** + * The reason this event was triggered. + * 'leave' A window has left the group due to a leave or merge with group. + * 'join' A window has joined the group. + * 'merge' Two groups have been merged together. + * 'disband' There are no other windows in the group. + */ + reason: "leave" | "join" | "merge" | "disband"; + /** + * All the windows in the group the sourceWindow originated from. + */ + sourceGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. + */ + sourceWindowAppUuid: string; + /** + * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. + */ + sourceWindowName: string; + /** + * All the windows in the group the targetWindow orginated from + */ + targetGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowAppUuid: string; + /** + * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowName: string; + type: "group-changed"; + } + + interface WindowOfGroupInfo { + /** + * The UUID of the application this window entry belongs to. + */ + appUuid: string; + /** + * The name of this window entry. + */ + windowName: string; + } + + interface WindowHiddenEvent extends WindowBaseEvent { + /** + * What action prompted the close. + * The reasons are: "hide", "hide-on-close" + */ + reason: "hide" | "hide-on-close"; + type: "hidden"; + } + + interface Window_NavigationRejectedEvent { + name: string; + /** + * source of navigation window name + */ + sourceName: string; + topic: "navigation-rejected"; + /** + * Url that was not reached "http://blocked-content.url" + */ + url: string; + /** + * the UUID of the application the window belongs to. + */ + uuid: string; + } + + interface AnimationTransition { + opacity?: { + /** + * This value is clamped from 0.0 to 1.0 + */ + opacity?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'opacity' as absolute or as a delta. Defaults to false. + */ + relative?: boolean; + }; + position?: { + /** + * Defaults to the window's current left position in virtual screen coordinates. + */ + left?: number; + /** + * Defaults to the window's current top position in virtual screen coordinates. + */ + top?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + size?: { + /** + * Optional if height is present. Defaults to the window's current width. + */ + width?: number; + /** + * Optional if width is present. Defaults to the window's current height. + */ + height?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + } + + interface AnimationOptions { + /** + * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. + */ + interrupt?: boolean; + /** + * Transition effect. Defaults to 'ease-in-out'. + */ + tween?: OpenFinTweenType; + } + + interface WindowBounds { + /** + * the height of the window. + */ + height?: number; + /** + * left-most coordinate of the window. + */ + left?: number; + /** + * top-most coordinate of the window. + */ + top?: number; + /** + * the width of the window. + */ + width?: number; + } + + interface SessionChangedEvent { + /** + * the action that triggered this event: + */ + reason: "lock" + | "unlock" + | "remote-connect" + | "remote-disconnect" + | "unknown"; + topic: "system"; + type: "session-changed"; + } + + interface LaunchInfo { + launchMode: "fin-protocol" + | "fins-protocol" + | "shortcut" + | "command-line" + | "adapter" + | "other" + | string; + } + + type OpenFinTweenType = "linear" + | "ease-in" + | "ease-out" + | "ease-in-out" + | "ease-in-quad" + | "ease-out-quad" + | "ease-in-out-quad" + | "ease-in-cubic" + | "ease-out-cubic" + | "ease-in-out-cubic" + | "ease-out-bounce" + | "ease-in-back" + | "ease-out-back" + | "ease-in-out-back" + | "ease-in-elastic" + | "ease-out-elastic" + | "ease-in-out-elastic"; + + type OpenFinApplicationEventType = "closed" + | "connected" + | "crashed" + | "initialized" + | "manifest-changed" + | "not-responding" + | "out-of-memory" + | "responding" + | "run-requested" + | "started" + | "tray-icon-clicked" + | "window-alert-requested" + | "window-auth-requested" + | "window-closed" + | "window-created" + | "window-end-load" + | "window-navigation-rejected" + | "window-show-requested" + | "window-start-load"; + + type OpenFinExternalApplicationEventType = "connected" + | "disconnected"; + + type OpenFinSystemEventType = "application-closed" + | "application-crashed" + | "application-created" + | "application-started" + | "desktop-icon-clicked" + | "idle-state-changed" + | "monitor-info-changed" + | "session-changed"; + + type OpenFinWindowEventType = "auth-requested" + | "blurred" + | "bounds-changed" + | "bounds-changing" + | "close-requested" + | "closed" + | "disabled-frame-bounds-changed" + | "disabled-frame-bounds-changing" + | "embedded" + | "external-process-exited" + | "external-process-started" + | "focused" + | "frame-disabled" + | "frame-enabled" + | "group-changed" + | "hidden" + | "initialized" + | "maximized" + | "minimized" + | "navigation-rejected" + | "restored" + | "show-requested" + | "shown"; + + type OpenFinAnchor = "top-left" + | "top-right" + | "bottom-left" + | "bottom-right"; +} diff --git a/types/openfin/v17/openfin-tests.ts b/types/openfin/v17/openfin-tests.ts new file mode 100644 index 0000000000..61b819018f --- /dev/null +++ b/types/openfin/v17/openfin-tests.ts @@ -0,0 +1,721 @@ +function test_application() { + let application: fin.OpenFinApplication; + // constructor + application = new fin.desktop.Application({ + url: "application.html", + uuid: "74BED629-2D8E-4141-8582-73E364BDFA74", + name: "Application Name", + plugins: false, + mainWindowOptions: { + defaultHeight: 600, + defaultWidth: 800, + defaultTop: 300, + defaultLeft: 300, + autoShow: true + } + }, (successObj) => { + console.log("Application successfully created, HTTP response code:", successObj); + application.run(); + }, (error) => { + console.log("Error creating application:", error); + }); + // getCurrent + application = fin.desktop.Application.getCurrent(); + // wrap + application = fin.desktop.Application.wrap("454C7F31-A915-4EA2-83F2-CFA655453C52"); + // getWindow + application.getWindow(); + // addEventListener + application.addEventListener("closed", (event) => { + console.log("The application has closed"); + }, () => { + console.log("The registration was successful"); + }, reason => { + console.log("failure: " + reason); + }); + // close + application.close(); + // getChildWindows + application.getChildWindows(children => { + children.forEach(childWindow => { + console.log("Showing child: " + childWindow.name); + childWindow.show(); + }); + }); + // getGroups + application.getGroups(allGroups => { + console.log(`There are a total of ${allGroups.length} groups.`); + + let groupCounter = 1; + allGroups.forEach(windowGroup => { + console.log(`Group ${groupCounter} contains ${windowGroup.length} windows.`); + ++groupCounter; + }); + }); + // getManifest + application.getManifest(manifest => { + console.log("Application manifest:"); + console.log(manifest); + }); + // getParentUuid + application.getParentUuid(parentUuid => { + console.log("UUID of parent application:"); + console.log(parentUuid); + }); + // getShortcuts + application.getShortcuts(config => { + console.log("Desktop shortcut is enabled: ", config.desktop); + console.log("Start Menu shortcut is enabled: ", config.startMenu); + console.log("System Startup shortcut is enabled: ", config.systemStartup); + }); + // getInfo + application.getInfo(info => { + console.log(`Launch mode: ${info.launchMode}`); + }); + // isRunning + application.isRunning(running => { + console.log("the application is", running ? "running" : "not running"); + }); + // registerCustomData + application.registerCustomData({ + someData: "this is custom" + }, () => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // removeEventListener + const previousCallback = (event: fin.WindowEvent) => { }; + application.removeEventListener("closed", previousCallback, () => { + console.log("The unregistration was successful"); + }, err => { + console.log("failure:", err); + }); + // removeTrayIcon + application.removeTrayIcon(() => { + console.log("Removed the tray icon."); + }, err => { + console.log("failure:", err); + }); + // restart + application.restart(() => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // schedule restart + application.scheduleRestart(() => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // setShortcuts + application.setShortcuts({ + desktop: true, + startMenu: false, + systemStartup: true + }, () => { + console.log("Successfully set new shortcut states"); + }, error => { + console.log("Failed to set new shortcut states. Error: ", error); + }); + // setTrayIcon + application.setTrayIcon("https://developer.openf.in/download/openfin.png", clickInfo => { + console.log(`The mouse has clicked at (${clickInfo.x}, ${clickInfo.y})`); + }); + // terminate + application.terminate(); + // wait + application.addEventListener("not-responding", () => { + console.log("waiting for hung application"); + application.wait(); + }); +} + +function test_external_application() { + let externalApp: fin.OpenFinExternalApplication; + // wrap + externalApp = fin.desktop.ExternalApp.wrap('my-uuid'); + // addEventListener + externalApp.addEventListener('connected', () => { + console.log('external app connected'); + }, () => { + console.log('The registration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); + // removeEventListener + const previousCallback = () => { }; + externalApp.removeEventListener('connected', previousCallback, () => { + console.log('The unregistration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); +} + +function test_inter_application_bus() { + // addSubscribeListener + fin.desktop.InterApplicationBus.addSubscribeListener((uuid, topic, name) => { + console.log(`The application ${uuid} has subscribed to ${topic}`); + }); + // addUnsubscribeListener + fin.desktop.InterApplicationBus.addUnsubscribeListener((uuid, topic, name) => { + console.log(`The application ${uuid} has unsubscribed to ${topic}`); + }); + // removeSubscribeListener + const aRegisteredListener = (uuid: string, topic: string, name: string) => { }; + fin.desktop.InterApplicationBus.removeSubscribeListener(aRegisteredListener); + // removeUnsubscribeListener + fin.desktop.InterApplicationBus.removeUnsubscribeListener(aRegisteredListener); + // publish + fin.desktop.InterApplicationBus.publish("a topic", { + field1: "value1", + field2: "value2" + }); + // send + fin.desktop.InterApplicationBus.send("an application's uuid", "a topic", { + field1: "value1", + field2: "value2" + }); + // subscribe + fin.desktop.InterApplicationBus.subscribe("*", "a topic", (message, uuid, name) => { + console.log(`The application ${uuid} sent this message: ${message}`); + }); + // unsubscribe + const aRegisteredMessageListener = (message: any, senderUuid: string) => { + console.log(message, senderUuid); + }; + fin.desktop.InterApplicationBus.unsubscribe("*", "a topic", aRegisteredMessageListener); +} + +function test_notification() { + let notification: fin.OpenFinNotification; + // getCurrent + notification = fin.desktop.Notification.getCurrent(); + // close + notification.close(); + // sendMessage + notification = new fin.desktop.Notification({ + duration: 10, + url: "http://localhost:5000/Account/Register", + message: "Hello", + onShow: () => { }, + // onClose: () => { }, + onDismiss: () => { }, + // onClick: () => { }, + onMessage: () => { }, + onError: () => { } + }); + // sendMessageToApplication + notification.sendMessageToApplication("some message"); +} + +function test_system() { + // addEventListener + fin.desktop.System.addEventListener('monitor-info-changed', event => { + console.log("The monitor information has changed to: ", event); + }, () => { + console.log("The registration was successful"); + }, err => { + console.log("failure: " + err); + }); + // clearCache + fin.desktop.System.clearCache({ + cache: true, + cookies: true, + localStorage: true, + appcache: true, + userData: true + }); + // deleteCacheOnExit + fin.desktop.System.deleteCacheOnExit(() => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // downloadAsset + const dirAppAsset = { + src: 'http://local:8000/dir.zip', + alias: 'dirApp', + version: '1.23.24', + target: 'dir.bat', + args: '' + }; + fin.desktop.System.downloadAsset(dirAppAsset, progress => { + const downloadedPercent = Math.floor((progress.downloadedBytes / progress.totalBytes) * 100); + console.log(`Downloaded ${downloadedPercent}%`); + }, p => { + console.log(`Downlod complete, can be found on ${p.path}`); + // lets launch our application asset. + // launchDirApp(); + }, (reason, err) => { + console.log(reason, err); + }); + // exit + fin.desktop.System.exit(() => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // getAllApplications + fin.desktop.System.getAllApplications(applicationInfoList => { + applicationInfoList.forEach(applicationInfo => { + console.log("Showing information for application with uuid: " + + applicationInfo.uuid); + console.log("isRunning: ", applicationInfo.isRunning); + }); + }); + // getAllExternalApplications + fin.desktop.System.getAllExternalApplications(externalAppsInfoList => { + externalAppsInfoList.forEach(appInfo => { + console.log(`External app connected to the runtime with UUID ${appInfo.uuid}`); + }); + }); + // getAllWindows + fin.desktop.System.getAllWindows(windowInfoList => { + windowInfoList.forEach(windowInfo => { + console.log("Showing information for application with uuid: ", windowInfo.uuid); + console.log("Main window: ", windowInfo.mainWindow); + console.log("Child windows: ", windowInfo.childWindows); + }); + }); + // getCommandLineArguments + fin.desktop.System.getCommandLineArguments(args => { + console.log("The command line arguments are " + args); + }); + // getDeviceId + fin.desktop.System.getDeviceId(id => { + console.log("The id of the device is: " + id); + }); + // getEnvironmentVariable + fin.desktop.System.getEnvironmentVariable("APPDATA", variable => { + console.log("this is the APPDATA value", variable); + }); + // getHostSpecs + fin.desktop.System.getHostSpecs(info => { + console.log(info); + }, error => { + console.log('There was an error:', error); + }); + // getLog + fin.desktop.System.getLog('debug-2015-01-08-22-27-53.log', log => { + console.log(log); + }); + // getLogList + fin.desktop.System.getLogList(logList => { + logList.forEach(logInfo => { + console.log(`The filename of the log is ${logInfo.name}, the size is ${logInfo.size}, and the date of creation is ${logInfo.date}`); + }); + }); + // getMonitorInfo + fin.desktop.System.getMonitorInfo(monitorInfo => { + console.log("This object contains information about all monitors: ", monitorInfo); + }); + // getMousePosition + fin.desktop.System.getMousePosition(mousePosition => { + console.log(`The mouse is located at left: ${mousePosition.left}, top: ${mousePosition.top}`); + }); + // getProcessList + fin.desktop.System.getProcessList(list => { + list.forEach(process => { + console.log(`UUID: ${process.uuid}, Application Name: ${process.name}`); + }); + }); + // getProxySettings + fin.desktop.System.getProxySettings(proxy => { + console.log(proxy); + }); + // getRvmInfo + fin.desktop.System.getRvmInfo(rvmInfoObject => { + console.log("RVM version:", rvmInfoObject.version); + console.log("RVM has been running since:", rvmInfoObject["start-time"]); + }, err => { + console.log("Failed to get rvm info, error message:", err); + }); + // getVersion + fin.desktop.System.getVersion(version => { + console.log("The version is " + version); + }); + // launchExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + // Additionally note that the executable found in the zip file specified in appAssets + // will default to the one mentioned by appAssets.target + // If the the path below refers to a specific path it will override this default + alias: "myApp", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + alias: "myApp", + arguments: "e f g", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + path: "C:\Users\ExampleUser\AppData\Local\OpenFin\OpenFinRVM.exe", + arguments: "--version", + certificate: { + trusted: true, + subject: 'O=OpenFin INC., L=New York, S=NY, C=US', + thumbprint: '3c a5 28 19 83 05 fe 69 88 e6 8f 4b 3a af c5 c5 1b 07 80 5b' + }, + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // log + fin.desktop.System.log("info", "An example log message", () => { + console.log("message successfully logged"); + }, err => { + console.log(err); + }); + // monitorExternalProcess + fin.desktop.System.monitorExternalProcess({ + pid: 2508, + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log("The process is now being monitored: ", payload.uuid); + }, error => { + console.log("Error:", error); + }); + // openUrlWithBrowser + fin.desktop.System.openUrlWithBrowser("https://developer.openf.in/", () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // registerExternalConnection + fin.desktop.System.registerExternalConnection("remote-connection-uuid", (...args: any[]) => { + console.log(args); + }); + // releaseExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener(result) { + console.log("The exit code", result.exitCode); + } + }, result => { + console.log("Result UUID is " + result.uuid); + + // release it. + fin.desktop.System.releaseExternalProcess(result.uuid, () => { + console.log("Process has been unmapped!"); + }, reason => { + console.log("failure: " + reason); + }); + }); + // removeEventListener + const aRegisteredListener = (event: fin.SystemBaseEvent) => { }; + fin.desktop.System.removeEventListener("monitor-info-changed", aRegisteredListener, () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // showDeveloperTools + fin.desktop.System.showDeveloperTools("uuid", "name", () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // terminateExternalProcess + fin.desktop.System.launchExternalProcess({ + // notepad is in the system's PATH + path: "notepad", + arguments: "", + listener(result) { + console.log("The exit code", result.exitCode); + } + }, result => { + console.log("Result UUID is " + result.uuid); + + // Attempt to close the process. Terminate after 4 seconds if it + // has not done so. + fin.desktop.System.terminateExternalProcess(result.uuid, 4000, info => { + console.log("Termination result " + info.result); + }, reason => { + console.log("failure: " + reason); + }); + }); + // updateProxySettings + fin.desktop.System.updateProxySettings("type", "proxyAddress", 8080, () => { + console.log('success'); + }, err => { + console.log(err); + }); +} + +function test_system_clipboard() { + // availableFormats + fin.desktop.System.Clipboard.availableFormats(null, formats => { + formats.forEach(format => console.log(`The format ${format} is available to read`)); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readHtml + fin.desktop.System.Clipboard.readHtml(null, html => { + console.log(`This is the html from the clipboard: ${html}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readRtf + fin.desktop.System.Clipboard.readRtf(null, rtf => { + console.log(`This is the rtf from the clipboard: ${rtf}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readText + fin.desktop.System.Clipboard.readText(null, text => { + console.log(`This is the text from the clipboard: ${text}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // write + fin.desktop.System.Clipboard.write({ + text: 'Hello Text!', + html: '

    Hello Html

    ', + rtf: 'Hello Rtf' + }, null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeHtml + fin.desktop.System.Clipboard.writeHtml('

    Hello World

    ', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeRtf + fin.desktop.System.Clipboard.writeRtf('Hello World!', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeText + fin.desktop.System.Clipboard.writeText('Hello World', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); +} + +function test_window() { + let finWindow: fin.OpenFinWindow; + // constructor + finWindow = new fin.desktop.Window({ + name: "childWindow", + url: "child.html", + defaultWidth: 320, + defaultHeight: 320, + defaultTop: 10, + defaultLeft: 300, + frame: false, + resizable: false, + state: "normal" + }, () => { + const _win = finWindow.getNativeWindow(); + _win.addEventListener("DOMContentLoaded", () => { finWindow.show(); }); + }, error => { + console.log("Error creating window:", error); + }); + // getCurrent + finWindow = fin.desktop.Window.getCurrent(); + // getNativeWindow + let nativeWindow: Window; + nativeWindow = finWindow.getNativeWindow(); + // getParentApplication + let parentApp: fin.OpenFinApplication; + parentApp = finWindow.getParentApplication(); + // getParentWindow + let parentFinWindow: fin.OpenFinWindow; + parentFinWindow = finWindow.getParentWindow(); + // wrap + finWindow = fin.desktop.Window.wrap("uuid", "name"); + // addEventListener + finWindow.addEventListener("bounds-changed", event => { + console.log("The window has been moved or resized"); + }, () => { + console.log("The registration was successful"); + }, reason => { + console.log("failure:" + reason); + }); + // animate + finWindow.animate({ + opacity: { + opacity: 0.15, + duration: 1000 + }, + position: { + left: 10, + top: 10, + duration: 3000 + } + }, { + interrupt: false + }, evt => { + // Callback will only fire after both "opacity" and "position" have finished animating. + }); + // authenticate + finWindow.addEventListener('auth-requested', evt => { + finWindow.authenticate('userName', 'P@assw0rd', () => { }, (reason, err) => { + console.log("failure:", err); + }); + }); + // blur + finWindow.blur(); + // bringToFront + finWindow.bringToFront(); + // close + finWindow.close(); + // disableFrame + finWindow.disableFrame(); + // enableFrame + finWindow.enableFrame(); + // flash + finWindow.flash(); + // focus + finWindow.focus(); + // getBounds + finWindow.getBounds(bounds => { + console.log(`top: ${bounds.top} left: ${bounds.left} height: ${bounds.height} width: ${bounds.width}`); + }); + // getOptions + finWindow.getOptions(options => { + console.log(options); + }); + // getSnapshot + finWindow.getSnapshot(base64Snapshot => { + console.log("data:image/png;base64," + base64Snapshot); + }); + // getState + finWindow.getState(state => { + console.log("state: " + state); + }); + // getZoomLevel + finWindow.getZoomLevel(level => { + console.log("zoom level: " + level); + }, error => { + console.log('error:', error); + }); + // hide + finWindow.hide(); + // isShowing + finWindow.isShowing(showing => { + console.log("the window is " + (showing ? "showing" : "hidden")); + }); + // joinGroup + let secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, () => { + // When mainWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow); + }); + // leaveGroup + secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, () => { + // When finWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow, () => { + // once we are in the group, lets leave it. + secondWindow.leaveGroup(); + }); + }); + // maximize + finWindow.maximize(); + // mergeGroups + { + const finWindowOne = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowOne", + autoShow: true + }); + const finWindowTwo = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowTwo", + autoShow: true + }); + const finWindowThree = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowThree", + autoShow: true + }); + const finWindowFour = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowFour", + autoShow: true + }); + // When finWindowOne moves or is moved, finWindowTwo moves by the same amount + finWindowOne.joinGroup(finWindowTwo); + // When finWindowThree moves or is moved, finWindowFour moves by the same amount + finWindowThree.joinGroup(finWindowFour); + // finWindowOne, finWindowTwo, finWindowThree, and finWindowFour now move together in the same group + finWindowOne.mergeGroups(finWindowThree); + } + // minimize + finWindow.minimize(); + // moveBy + finWindow.moveBy(10, 10); + // moveTo + finWindow.moveTo(100, 200); + // removeEventListener + const aRegisteredListener = (event: fin.WindowBaseEvent) => { }; + finWindow.removeEventListener("bounds-changed", aRegisteredListener); + // resizeBy + finWindow.resizeBy(10, 10, "top-right"); + // resizeTo + finWindow.resizeTo(10, 10, "top-right"); + // restore + finWindow.restore(); + // setAsForeground + finWindow.setAsForeground(); + // setBounds + finWindow.setBounds(100, 200, 400, 400); + // setZoomLevel + finWindow.setZoomLevel(10); + // show + finWindow.show(); + // showAt + finWindow.showAt(10, 10, false); + // stopFlashing + finWindow.stopFlashing(); + // updateOptions + finWindow.updateOptions({ + frame: false, + maxWidth: 500 + }); +} diff --git a/types/openfin/v29/tsconfig.json b/types/openfin/v17/tsconfig.json similarity index 77% rename from types/openfin/v29/tsconfig.json rename to types/openfin/v17/tsconfig.json index df2dae8b79..fd3199ceb7 100644 --- a/types/openfin/v29/tsconfig.json +++ b/types/openfin/v17/tsconfig.json @@ -8,17 +8,12 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], - "paths": { - "openfin": [ - "openfin/v29" - ] - }, "noEmit": true, "forceConsistentCasingInFileNames": true }, @@ -26,4 +21,4 @@ "index.d.ts", "openfin-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/openfin/v17/tslint.json b/types/openfin/v17/tslint.json new file mode 100644 index 0000000000..64aace11d6 --- /dev/null +++ b/types/openfin/v17/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "max-line-length": false + } +} diff --git a/types/openfin/v29/index.d.ts b/types/openfin/v29/index.d.ts deleted file mode 100644 index 3ddbdf2edd..0000000000 --- a/types/openfin/v29/index.d.ts +++ /dev/null @@ -1,1891 +0,0 @@ -// Type definitions for OpenFin API 29.0 -// Project: https://openfin.co/ -// Definitions by: Chris Barker -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// based on v8.56.29.51 -// see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean - -/** - * JavaScript API - * The JavaScript API allows you to create an HTML/JavaScript application that has access to the native windowing environment, - * can communicate with other applications and has access to sandboxed system-level features. - * - * API Ready - * When using the OpenFin API, it is important to ensure that it has been fully loaded before making any API calls. To verify - * that the API is in fact ready, be sure to make any API calls either from within the fin.desktop.main() method or explicitly - * after it has returned. This avoids the situation of trying to access methods that are not yet fully injected. - * - * Overview - * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API - * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "documennt" objects. - */ -declare namespace fin { - const desktop: OpenFinDesktop; - - interface OpenFinDesktop { - main(f: () => any): void; - Application: OpenFinApplicationStatic; - ExternalApp: OpenFinExternalApplicationStatic; - InterApplicationBus: OpenFinInterApplicationBus; - Notification: OpenFinNotificationStatic; - System: OpenFinSystem; - Window: OpenFinWindowStatic; - Frame: OpenFinFrameStatic; - } - - interface OpenFinApplicationStatic { - /** - * Creates a new Application. - * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. - */ - new ( - options: ApplicationOptions, - callback?: (successObj: { httpResponseCode: number }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; - /** - * Launches the given Application manifest. - */ - createFromManifest(manifestUrl: string, callback?: (app: OpenFinApplication) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Returns an Application object that represents an existing application. - */ - getCurrent(): OpenFinApplication; - /** - * Returns an Application object that represents an existing application. - */ - wrap(uuid: string): OpenFinApplication; - } - - /** - * Application - * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. - */ - interface OpenFinApplication { - /** - * Returns an instance of the main Window of the application - */ - getWindow(): OpenFinWindow; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinApplicationEventType, - listener: (event: ApplicationBaseEvent - | TrayIconClickedEvent - | WindowEvent - | WindowAlertRequestedEvent - | WindowAuthRequested - | WindowNavigationRejectedEvent - | WindowEndLoadEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Closes the application and any child windows created by the application. - */ - close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. - */ - getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. - */ - getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. - */ - getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. - */ - getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves current configuration of application's shortcuts. - */ - getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves information about the application. - */ - getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves information about the system tray. - */ - getTrayIconInfo(callback?: (trayInfo: TrayIconInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Determines if the application is currently running. - */ - isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; - /** - * Registers a username and an app name for licensing purposes. - */ - registerUser(userName: string, appName: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinApplicationEventType, - previouslyRegisteredListener: (event: ApplicationBaseEvent - | TrayIconClickedEvent - | WindowEvent - | WindowAlertRequestedEvent - | WindowAuthRequested - | WindowNavigationRejectedEvent - | WindowEndLoadEvent) => any, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Removes the application's icon from the tray. - */ - removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Restarts the application. - */ - restart(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Runs the application. When the application is created, run must be called. - */ - run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * Tells the rvm to relaunch the main application once upon a complete shutdown - */ - scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets new shortcut configuration for current application. - * Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to - * be able to change shortcut states. - */ - setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Adds a customizable icon in the system tray and notifies the application when clicked. - */ - setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Closes the application by terminating its process. - */ - terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application - * to continue and to generate another "not-responding" message after a certain period of time. - */ - wait(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * The Application's uuid - */ - uuid: string; - } - - interface ShortCutConfig { - /** - * application has a shortcut on the desktop - */ - desktop?: boolean; - /** - * application has no shortcut in the start menu - */ - startMenu?: boolean; - /** - * application will be launched on system startup - */ - systemStartup?: boolean; - } - - interface SuccessObj { - httpResponseCode: number; - } - - interface NetworkErrorInfo extends ErrorInfo { - networkErrorCode: number; - } - - interface ErrorInfo { - stack: string; - message: string; - } - - interface ApplicationOptions { - /** - * The name of the application. - */ - name?: string; - /** - * The url to the application. - */ - url?: string; - /** - * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. - */ - uuid?: string; - /** - * Enable Flash at the application level. Default: false. - */ - plugins?: boolean; - /** - * The options of the main window of the application. - */ - mainWindowOptions?: WindowOptions; - } - - interface WindowOptions { - /** - * Enable keyboard shortcuts for devtools and zoom. Default: false for both. - */ - accelerator?: { - devtools?: boolean, - zoom?: boolean, - reload?: boolean, - reloadIgnoreCache?: boolean, - }; - /** - * A flag to always position the window at the top of the window stack. Default: false. - * Updatable - */ - alwaysOnTop?: boolean; - /** - * A flag to automatically show the Window when it is created. Default: false. - */ - autoShow?: boolean; - /** - * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true - * Updatable - */ - contextMenu?: boolean; - /** - * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. - * Updatable - */ - cornerRounding?: { - width?: number; - height?: number; - }; - /** - * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. - */ - customData?: any; - /** - * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the position from before the window was closed is used. - * This option overrides defaultLeft and defaultTop. Default: false. - */ - defaultCentered?: boolean; - /** - * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. - */ - defaultHeight?: number; - /** - * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. - */ - defaultWidth?: number; - /** - * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. - */ - defaultTop?: number; - /** - * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. - */ - defaultLeft?: number; - /** - * A flag to show the frame. Default: true. - * Updatable - */ - frame?: boolean; - /** - * A flag to allow a window to be hidden when the close button is clicked.Default: false. - * Updatable - */ - hideOnClose?: boolean; - /** - * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. - * Updatable - */ - icon?: string; - /** - * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. - * Updatable - */ - maxHeight?: number; - /** - * A flag that lets the window be maximized.Default: true. - * Updatable - */ - maximizable?: boolean; - /** - * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. - * Updatable - */ - maxWidth?: number; - /** - * The minimum height of a window.Default: 0. - * Updatable - */ - minHeight?: number; - /** - * A flag that lets the window be minimized.Default: true. - */ - minimizable?: boolean; - /** - * The minimum width of a window.Default: 0. - */ - minWidth?: number; - /** - * The name for the window which must be unique within the context of the invoking Application. - */ - name?: string; - /** - * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. - * Updatable - */ - opacity?: number; - /** - * A flag to drop to allow the user to resize the window.Default: true. - * Updatable - */ - resizable?: boolean; - /** - * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. - * Updatable - */ - resizeRegion?: { - /** - * The size in pixels (Default: 2), - */ - size?: number; - /** - * The size in pixels of an additional - * square resizable region located at the - * bottom right corner of a - * frameless window. (Default: 4) - */ - bottomRightCorner?: number; - }; - /** - * A flag to show the Window's icon in the taskbar. Default: true. - */ - showTaskbarIcon?: boolean; - /** - * A flag to cache the location of the window or not. Default: true. - */ - saveWindowState?: boolean; - /** - * Specify a taskbar group for the window. Default: app's uuid. - */ - taskbarIconGroup?: string; - /** - * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". - */ - state?: string; - /** - * The URL of the window. Default: "about:blank". - */ - url?: string; - /** - * When set to false, the window will render before the "load" event is fired on the content's window. - * Caution, when false you will see an initial empty white window. Default: true. - */ - waitForPageLoad?: boolean; - } - - /** - * Clipboard - * Clipboard API allows reading and writting to the clipboard in multiple formats. - */ - interface OpenFinClipboard { - /** - * Reads available formats for the clipboard type - */ - availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Reads available formats for the clipboard type - */ - readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Read the content of the clipboard as Rtf - */ - readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Read the content of the clipboard as plain text - */ - readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard - */ - write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as Html - */ - writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as Rtf - */ - writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as plain text - */ - writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - } - - interface OpenFinExternalApplicationStatic { - /** - * Returns an External Application object that represents an existing external application. - */ - wrap(uuid: string): OpenFinExternalApplication; - } - /** - * ExternalApplication - * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. - */ - interface OpenFinExternalApplication { - /** - * Retrieves information about the application. - */ - getInfo(callback?: (info: ExternalApplicationInfo) => void, - errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinExternalApplicationEventType, - listener: () => void, - callback?: () => void, - errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinExternalApplicationEventType, - listener: () => void, - callback?: () => void, - errorCallback?: (reason: string, error: ErrorInfo) => void): void; - } - - /** - * InterApplicationBus - * A messaging bus that allows for pub/sub messaging between different applications. - */ - interface OpenFinInterApplicationBus { - /** - * Adds a listener that gets called when applications subscribe to the current application's messages. - */ - addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Adds a listener that gets called when applications unsubscribe to the current application's messages. - */ - addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Removes a previously registered subscribe listener. - */ - removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Removes a previously registered unsubscribe listener. - */ - removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. - */ - publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sends a message to a specific application on a specific topic. - */ - send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], - * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. - */ - subscribe( - senderUuid: string, - name: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - subscribe( - senderUuid: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Unsubscribes to messages from the specified application on the specified topic. - */ - unsubscribe( - senderUuid: string, - name: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - unsubscribe( - senderUuid: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - } - - interface OpenFinNotificationStatic { - /** - * ctor - */ - new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; - /** - * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. - */ - getCurrent(): OpenFinNotification; - } - - /** - * Notification - * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. - * A notification is typically used to alert the user of some important event which requires his or her attention. - * Notifications are a child or your application that are controlled by the runtime. - */ - interface OpenFinNotification { - /** - * Closes the notification. - */ - close(callback?: () => void): void; - /** - * Sends a message to the notification. - */ - sendMessage(message: any, callback?: () => void): void; - /** - * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. - */ - sendMessageToApplication(message: any, callback?: () => void): void; - } - - interface NotificationOptions { - /** - * A boolean that will force dismissal even if the mouse is hovering over the notification - */ - ignoreMouseOver?: boolean; - /** - * A message of any primitive or composite-primitive type to be passed to the notification upon creation. - */ - message?: any; - /** - * The timeout for displaying a notification.Can be in milliseconds or "never". - */ - duration?: number | "never"; - /** - * The url of the notification - */ - url?: string; - /** - * A function that is called when a notification is clicked. - */ - onClick?(callback: () => void): void; - /** - * Invoked when the notification is closed via .close() method on the created notification instance - * or the by the notification itself via fin.desktop.Notification.getCurrent().close(). - * NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss - */ - onClose?(callback: () => void): void; - /** - * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. - */ - onDismiss?(callback: () => void): void; - /** - * A function that is called when an error occurs.The reason for the error is passed as an argument. - */ - onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * The onMessage function will respond to messages sent from notification.sendMessageToApplication. - * The function is passed the message, which can be of any primitive or composite-primitive type. - */ - onMessage?(callback: (message: any) => void): void; - /** - * A function that is called when a notification is shown. - */ - onShow?(callback: (successObj: SuccessObj) => void): void; - } - - /** - * System - * An object representing the core of OpenFin Runtime. - * Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. - */ - interface OpenFinSystem { - Clipboard: OpenFinClipboard; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinSystemEventType, - listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Clears cached data containing window state/positions, - * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. - */ - clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Clears all cached data when OpenFin Runtime exits. - */ - deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Downloads the given application asset - */ - downloadAsset( - assetObj: AppAssetInfo, - progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, - callback?: (successObj: { path: string }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; - - /** - * Download preload scripts from given URLs - */ - downloadPreloadScripts(scripts: Array, callback?: (downloadInfo: Array) => void, - errorCallback?: (reason: string) => void): void; - /** - * Downloads the given OpenFin Runtime. - */ - downloadRuntime(options: RuntimeDownloadOptions, onProgress?: (progress: RuntimeDownloadProgress) => void, onComplete?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Exits the Runtime. - */ - exit(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Writes any unwritten cookies data to disk. - */ - flushCookieStore(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data for all applications. - */ - getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data for all external applications. - */ - getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data (name, ids, bounds) for all application windows. - */ - getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns information about the app asset. - */ - getAppAssetInfo(options: AppAssetOptions, callback?: (appAssetInfo: AppAssetInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Get additional info of cookies. - */ - getCookies(option: CookieOption, callback?: (info: Array) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the command line argument string that started OpenFin Runtime. - */ - getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the configuration object that started the OpenFin Runtime. - */ - getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns a hex encoded hash of the mac address and the currently logged in user name - */ - getDeviceUserId(callback?: (id: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns an Entity info object relating to the entity specified by the uuid and name passed in. The possible types are 'window', 'iframe', 'external connection' or 'unknown'. - */ - getEntityInfo(uuid: string, name: string, callback?: (info: EntityInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the value of a given environment variable on the computer on which the runtime is installed. - */ - getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves currently focused window identity. - */ - getFocusedWindow(callback?: (focusedWindowIdentity: Identity) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves system information. - */ - getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the contents of the log with the specified filename. - */ - getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array containing information for each log file. - */ - getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the minimum (inclusive) logging level that is currently being written to the logs. - */ - getMinLogLevel(callback?: (logLevel: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. - */ - getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the mouse in virtual screen coordinates (left, top). - */ - getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of all of the runtime processes that are currently running. - * Each element in the array is an object containing the uuid and the name of the application to which the process belongs. - */ - getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the Proxy settings. - */ - getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns information about the running RVM in an object. - */ - getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. - */ - getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Runs an executable or batch file. - */ - launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; - /** - * Writes the passed message into both the log file and the console. - */ - log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Monitors a running process. - */ - monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; - /** - * Opens the passed URL in the default web browser. - */ - openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Opens the passed URL in the default web browser. - */ - readRegistryValue(rootKey: string, subkey: string, value: string, callback?: (info: RegistryInfo) => void, - errorCallback?: (reason: string) => void): void; - /** - * This function call will register a unique id and produce a token. The token can be used to broker an external connection. - */ - registerExternalConnection( - uuid: string, - callback?: (detail: { - /** - * this will be unique each time - */ - token: string; - /** - * "remote-connection-uuid" - */ - uuid: string; - }) => void, - errorCallback?: (reason: string) => void): void; - /** - * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). - */ - releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinSystemEventType, - listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Set the minimum log level above which logs will be written to the OpenFin log - */ - setMinLogLevel(logLevel: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the Chrome Developer Tools for the specified window. - */ - showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. - */ - terminateExternalProcess( - processUuid: string, - timeout: number, - killTree: boolean, - callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, - errorCallback?: (reason: string) => void): void; - terminateExternalProcess( - processUuid: string, - timeout: number, - callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, - errorCallback?: (reason: string) => void): void; - /** - * Update the OpenFin Runtime Proxy settings. - */ - updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface CacheOptions { - cache?: boolean; - cookies?: boolean; - localStorage?: boolean; - appcache?: boolean; - userData?: boolean; - } - - interface AppAssetInfo { - src?: string; - alias?: string; - version?: string; - target?: string; - args?: string; - mandatory?: boolean; - } - - interface AppAssetOptions { - alias: string; - } - - interface ApplicationInfo { - /** - * true when the application is running. - */ - isRunning?: boolean; - /** - * uuid of the application. - */ - uuid?: string; - /** - * uuid of the application that launches this application. - */ - parentUuid?: string; - } - - interface Identity { - uuid: string; - name: string; - } - - interface EntityInfo { - name: string; - uuid: string; - parent: Identity; - entityType: string; - } - - interface DownloadPreloadOption { - url: string; - } - - interface DownloadPreloadInfo { - success: boolean; - url?: string; - error: string; - } - - - interface CookieInfo { - name: string; - // expirationDate: Date; - domain: string; - path: string; - } - - interface CookieOption { - name: string; - } - - interface RegistryInfo { - data: any; - rootKey: string; - subkey: string; - type: string; - value: string; - } - - interface RuntimeDownloadOptions { - version: string; - } - - interface RuntimeDownloadProgress { - downloadedBytes: number; - totalBytes: number; - } - - interface WindowDetails { - uuid?: string; - mainWindow?: WindowInfo; - childWindows?: WindowInfo[]; - } - - interface WindowInfo { - /** - * name of the child window - */ - name?: string; - /** - * top-most coordinate of the child window - */ - top?: number; - /** - * right-most coordinate of the child window - */ - right?: number; - /** - * bottom-most coordinate of the child window - */ - bottom?: number; - /** - * left-most coordinate of the child window - */ - left?: number; - } - - interface HostSpecInfo { - /** - * "x86" for 32-bit or "x86_64" for 64-bit - */ - arch: string; - /** - * Same payload as Node's os.cpus() - */ - cpus: NodeCpuInfo[]; - gpu: { - /** - * Graphics card name - */ - name: string; - }; - /** - * Same payload as Node's os.totalmem() - */ - memory: number; - /** - * OS name and version/edition - */ - name: string; - } - - interface NodeCpuInfo { - model: string; - /** - * in MHz - */ - speed: number; - times: { - /** - * The number of milliseconds the CPU has spent in user mode. - */ - user: number; - /** - * The number of milliseconds the CPU has spent in nice mode. - */ - nice: number; - /** - * The number of milliseconds the CPU has spent in sys mode. - */ - sys: number; - /** - * The number of milliseconds the CPU has spent in idle mode. - */ - idle: number; - /** - * The number of milliseconds the CPU has spent in irq mode. - */ - irq: number; - }; - } - - interface LogInfo { - /** - * the filename of the log - */ - name?: string; - /** - * the size of the log in bytes - */ - size?: number; - /** - * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" - */ - date?: string; - } - - interface ProcessInfo { - /** - * the percentage of total CPU usage - */ - cpuUsage?: number; - /** - * the application name - */ - name?: string; - /** - * the current nonpaged pool usage in bytes - */ - nonPagedPoolUsage?: number; - /** - * the number of page faults - */ - pageFaultCount?: number; - /** - * the current paged pool usage in bytes - */ - pagedPoolUsage?: number; - /** - * the total amount of memory in bytes that the memory manager has committed - */ - pagefileUsage?: number; - /** - * the peak nonpaged pool usage in bytes - */ - peakNonPagedPoolUsage?: number; - /** - * the peak paged pool usage in bytes - */ - peakPagedPoolUsage?: number; - /** - * the peak value in bytes of pagefileUsage during the lifetime of this process - */ - peakPagefileUsage?: number; - /** - * the peak working set size in bytes - */ - peakWorkingSetSize?: number; - /** - * the native process identifier - */ - processId?: number; - /** - * the application UUID - */ - uuid?: string; - /** - * the current working set size (both shared and private data) in bytes - */ - workingSetSize?: number; - } - - interface ProxyInfo { - /** - * the configured Proxy Address - */ - proxyAddress?: string; - /** - * the configured Proxy port - */ - proxyPort?: number; - /** - * Proxy Type - */ - type?: string; - } - - interface RvmInfo { - version?: string; - "start-time"?: string; - } - - interface ExternalProcessLaunchInfo { - path?: string; - /** - * Additionally note that the executable found in the zip file specified in appAssets - * will default to the one mentioned by appAssets.target - * If the the path below refers to a specific path it will override this default - */ - alias?: string; - /** - * When using alias; if no arguments are passed then the arguments (if any) - * are taken from the 'app.json' file, from the 'args' parameter - * of the 'appAssets' Object with the relevant 'alias'. - * If 'arguments' is passed as a parameter it takes precedence - * over any 'args' set in the 'app.json'. - */ - arguments?: string; - listener?(result: { - /** - * "Exited" Or "released" on a call to releaseExternalProcess - */ - topic?: string; - /** - * The mapped UUID which identifies the launched process - */ - uuid?: string; - /* - * Process exit code - */ - exitCode?: number; - }): void; - certificate?: CertificationInfo; - } - - interface CertificationInfo { - /** - * A hex string with or without spaces - */ - serial?: string; - /** - * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields - */ - subject?: string; - /** - * A hex string with or without spaces - */ - publickey?: string; - /** - * A hex string with or without spaces - */ - thumbprint?: string; - /** - * A boolean indicating that the certificate is trusted and not revoked - */ - trusted?: boolean; - } - - interface ExternalProcessInfo { - pid?: number; - listener?(result: { - /** - * "Exited" Or "released" on a call to releaseExternalProcess - */ - topic?: string; - /** - * The mapped UUID which identifies the launched process - */ - uuid?: string; - /* - * Process exit code - */ - exitCode?: number; - }): void; - } - - interface OpenFinWindowStatic { - /** - * Class: Window - * - * new Window(options, callbackopt, errorCallbackopt) - * - * Creates a new OpenFin Window - * - * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, - * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. - * The new window appears in the same process as the parent window. - * @param options - The options of the window - * @param [callback] - Called if the window creation was successful - * @param [callback.successObj] - httpResponseCode - */ - new ( - options: WindowOptions, - callback?: (successObj: { httpResponseCode: number }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; - /** - * Returns an instance of the current window. - * @returns Current window - */ - getCurrent(): OpenFinWindow; - /** - * Returns a Window object that wraps an existing window. - */ - wrap(appUuid: string, windowName: string): OpenFinWindow; - } - - /** - * Window - * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, - * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. - * The new window appears in the same process as the parent window. - */ - interface OpenFinWindow { - /** - * Name of window - */ - name: string; - /** - * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, - * otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the - * contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. - * Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). - * @returns Native window - */ - getNativeWindow(): Window; - /** - * Gets the parent application. - * @returns Parent application - */ - getParentApplication(): OpenFinApplication; - /** - * Gets the parent window. - */ - getParentWindow(): OpenFinWindow; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinWindowEventType, - listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Performs the specified window transitions - */ - animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; - /** - * Provides credentials to authentication requests - */ - authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Removes focus from the window. - */ - blur(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Brings the window to the front of the OpenFin window stack. - */ - bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Closes the window. - * @param Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. - */ - close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Prevents a user from changing a window's size/position when using the window's frame. - * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. - * 'disabled-frame-bounds-changed' is generated after a user move/size operation. - * The events provide the bounds that would have been applied if the frame was enabled. - * 'frame-disabled' is generated when an enabled frame becomes disabled. - */ - disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Re-enables user changes to a window's size/position when using the window's frame. - * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. - * 'disabled-frame-bounds-changed' is generated after a user move/size operation. - * The events provide the bounds that would have been applied if the frame was enabled. - * 'frame-enabled' is generated when a disabled frame has becomes enabled. - */ - enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Flashes the window's frame and taskbar icon until the window is activated. - */ - flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Gives focus to the window. - */ - focus(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current bounds (top, left, width, height) of the window. - */ - getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. - * Please note that calling window is included in the result array. - */ - getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current settings of the window. - */ - getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets a base64 encoded PNG snapshot of the window. - */ - getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current state ("minimized", "maximized", or "restored") of the window. - */ - getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the zoom level of the window. - */ - getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; - /** - * Hides the window. - */ - hide(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Determines if the window is currently showing. - */ - isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; - /** - * Joins the same window group as the specified window. - */ - joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Leaves the current window group so that the window can be move independently of those in the group. - */ - leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Maximizes the window. - */ - maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Merges the instance's window group with the same window group as the specified window - */ - mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Minimizes the window. - */ - minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Moves the window by a specified amount. - */ - moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Moves the window to a specified location. - */ - moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinWindowEventType, - listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Resizes the window by a specified amount. - */ - resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Resizes the window by a specified amount. - */ - resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Restores the window to its normal state (i.e., unminimized, unmaximized). - */ - restore(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Will bring the window to the front of the entire stack and give it focus. - */ - setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets the window's size and position - */ - setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets the zoom level of the window. - */ - setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the window if it is hidden. - * @param Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. - */ - show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. - */ - showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Stops the taskbar icon from flashing. - */ - stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Updates the window using the passed options - */ - updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface OpenFinFrameStatic { - wrap(uuid: string, name: string): OpenFinFrame; - - getCurrent(): OpenFinFrame; - } - - interface OpenFinFrame { - name: string; - uuid: string; - - addEventListener(type: string, listener: () => void, callback?: () => void, errorCallback?: (reason: string) => void): void; - - getParentWindow(callback?: (entityInfo: EntityInfo) => void, errorCallback?: (reason: string) => void): void; - - getInfo(callback?: (entityInfo: EntityInfo) => void, errorCallback?: (reason: string) => void): void; - - removeEventListener(type: string, listener: () => void, callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface ApplicationBaseEvent { - topic: string; - type: OpenFinApplicationEventType; - uuid: string; - } - - interface TrayIconClickedEvent extends ApplicationBaseEvent { - button: number; // 0 for left, 1 for middle, 2 for right - monitorInfo: MonitorInfo; - x: number; // the cursor x coordinate - y: number; // the cursor y coordinate - } - - interface WindowEvent extends ApplicationBaseEvent { - name: string; - } - - interface WindowAlertRequestedEvent extends WindowEvent { - message: string; - url: string; - } - - interface WindowAuthRequested extends WindowEvent { - authInfo: { - host: string; - isProxy: boolean; - port: number; - realm: string; - scheme: string; - }; - } - - interface WindowNavigationRejectedEvent extends WindowEvent { - sourceName: string; - url: string; - } - - interface WindowEndLoadEvent extends WindowEvent { - documentName: string; - isMain: boolean; - } - - interface MonitorInfoChangedEvent extends MonitorInfo { - topic: "system"; - type: "monitor-info-changed"; - } - - interface MonitorInfo { - nonPrimaryMonitors: MonitorInfoDetail[]; - primaryMonitor: MonitorInfoDetail; - reason: string; - taskbar: { - edge: "left" | "right" | "top" | "bottom", - rect: MontiorCoordinates - }; - topic: "system"; - type: "monitor-info-changed"; - virtualScreen: MontiorCoordinates; - } - - interface TrayIconInfo { - x: number; - y: number; - bounds: { - x: number; - y: number; - width: number; - height: number; - } - monitorInfo: MonitorInfo - } - - interface MonitorInfoDetail { - availableRect: MontiorCoordinates; - deviceId: string; - displayDeviceActive: boolean; - monitorRect: MontiorCoordinates; - name: string; - } - - interface MontiorCoordinates { - bottom: number; - left: number; - right: number; - top: number; - } - - interface VirtualScreenCoordinates { - left: number; - top: number; - } - - interface SystemBaseEvent { - topic: string; - type: OpenFinSystemEventType; - uuid: string; - } - - interface DesktopIconClickedEvent { - mouse: { - /** - * the left virtual screen coordinate of the mouse - */ - left: number, - /** - * the top virtual screen coordinate of the mouse - */ - top: number - }; - /** - * the number of milliseconds that have elapsed since the system was started, - */ - tickCount: number; - topic: "system"; - type: "desktop-icon-clicked"; - } - - interface IdleStateChangedEvent { - /** - * How long in milliseconds since the user has been idle. - */ - elapsedTime: number; - /** - * true when the user is idle,false when the user has returned; - */ - isIdle: boolean; - topic: "system"; - type: "idle-state-changed"; - } - - interface WindowBaseEvent { - /** - * the name of the window - */ - name: string; - /** - * always window - */ - topic: "window"; - /** - * window event type - */ - type: OpenFinWindowEventType; - /** - * the UUID of the application the window belongs to - */ - uuid: string; - } - - interface WindowAuthRequestedEvent extends WindowBaseEvent { - authInfo: { - host: string; - isProxy: boolean; - port: number; - realm: string; - scheme: string; - }; - } - - interface WindowBoundsEvent extends WindowBaseEvent { - /** - * describes what kind of change occurred. - * 0 means a change in position. - * 1 means a change in size. - * 2 means a change in position and size. - */ - changeType: number; - /** - * true when pending changes have been applied to the window. - */ - deferred: boolean; - /** - * the new height of the window. - */ - height: number; - /** - * the left-most coordinate of the window. - */ - left: number; - /** - * the top-most coordinate of the window. - */ - top: number; - - type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; - /** - * the new width of the window. - */ - width: number; - } - - interface WindowExternalProcessStartedEvent extends WindowBaseEvent { - /** - * the process handle uuid - */ - processUuid: string; - type: "external-process-started"; - } - - interface WindowExternalProcessExited extends WindowBaseEvent { - /** - * the process exit code - */ - exitCode: number; - /** - * the process handle uuid - */ - processUuid: string; - type: "external-process-exited"; - } - - interface WindowGroupChangedEvent extends WindowBaseEvent { - /** - * Which group array the window that the event listener was registered on is included in: - * 'source' The window is included in sourceGroup. - * 'target' The window is included in targetGroup. - * 'nothing' The window is not included in sourceGroup nor targetGroup. - */ - memberOf: "source" | "target" | "nothing"; - /** - * The reason this event was triggered. - * 'leave' A window has left the group due to a leave or merge with group. - * 'join' A window has joined the group. - * 'merge' Two groups have been merged together. - * 'disband' There are no other windows in the group. - */ - reason: "leave" | "join" | "merge" | "disband"; - /** - * All the windows in the group the sourceWindow originated from. - */ - sourceGroup: WindowOfGroupInfo[]; - /** - * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. - */ - sourceWindowAppUuid: string; - /** - * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. - */ - sourceWindowName: string; - /** - * All the windows in the group the targetWindow orginated from - */ - targetGroup: WindowOfGroupInfo[]; - /** - * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). - */ - targetWindowAppUuid: string; - /** - * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). - */ - targetWindowName: string; - type: "group-changed"; - } - - interface WindowOfGroupInfo { - /** - * The UUID of the application this window entry belongs to. - */ - appUuid: string; - /** - * The name of this window entry. - */ - windowName: string; - } - - interface WindowHiddenEvent extends WindowBaseEvent { - /** - * What action prompted the close. - * The reasons are: "hide", "hide-on-close" - */ - reason: "hide" | "hide-on-close"; - type: "hidden"; - } - - interface Window_NavigationRejectedEvent { - name: string; - /** - * source of navigation window name - */ - sourceName: string; - topic: "navigation-rejected"; - /** - * Url that was not reached "http://blocked-content.url" - */ - url: string; - /** - * the UUID of the application the window belongs to. - */ - uuid: string; - } - - interface AnimationTransition { - opacity?: { - /** - * This value is clamped from 0.0 to 1.0 - */ - opacity?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'opacity' as absolute or as a delta. Defaults to false. - */ - relative?: boolean; - }; - position?: { - /** - * Defaults to the window's current left position in virtual screen coordinates. - */ - left?: number; - /** - * Defaults to the window's current top position in virtual screen coordinates. - */ - top?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. - */ - relative?: boolean; - }; - size?: { - /** - * Optional if height is present. Defaults to the window's current width. - */ - width?: number; - /** - * Optional if width is present. Defaults to the window's current height. - */ - height?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. - */ - relative?: boolean; - }; - } - - interface AnimationOptions { - /** - * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. - */ - interrupt?: boolean; - /** - * Transition effect. Defaults to 'ease-in-out'. - */ - tween?: OpenFinTweenType; - } - - interface WindowBounds { - /** - * the height of the window. - */ - height?: number; - /** - * left-most coordinate of the window. - */ - left?: number; - /** - * top-most coordinate of the window. - */ - top?: number; - /** - * the width of the window. - */ - width?: number; - } - - interface ExternalApplicationInfo { - parent: { - uuid: string; - name: string; - } - } - - interface SessionChangedEvent { - /** - * the action that triggered this event: - */ - reason: "lock" - | "unlock" - | "remote-connect" - | "remote-disconnect" - | "unknown"; - topic: "system"; - type: "session-changed"; - } - - interface LaunchInfo { - launchMode: "fin-protocol" - | "fins-protocol" - | "shortcut" - | "command-line" - | "adapter" - | "other" - | string; - } - - type OpenFinTweenType = "linear" - | "ease-in" - | "ease-out" - | "ease-in-out" - | "ease-in-quad" - | "ease-out-quad" - | "ease-in-out-quad" - | "ease-in-cubic" - | "ease-out-cubic" - | "ease-in-out-cubic" - | "ease-out-bounce" - | "ease-in-back" - | "ease-out-back" - | "ease-in-out-back" - | "ease-in-elastic" - | "ease-out-elastic" - | "ease-in-out-elastic"; - - type OpenFinApplicationEventType = "closed" - | "connected" - | "crashed" - | "initialized" - | "manifest-changed" - | "not-responding" - | "out-of-memory" - | "responding" - | "run-requested" - | "started" - | "tray-icon-clicked" - | "window-alert-requested" - | "window-auth-requested" - | "window-closed" - | "window-created" - | "window-end-load" - | "window-navigation-rejected" - | "window-show-requested" - | "window-start-load"; - - type OpenFinExternalApplicationEventType = "connected" - | "disconnected"; - - type OpenFinSystemEventType = "application-closed" - | "application-crashed" - | "application-created" - | "application-started" - | "desktop-icon-clicked" - | "idle-state-changed" - | "monitor-info-changed" - | "session-changed"; - - type OpenFinWindowEventType = "auth-requested" - | "blurred" - | "bounds-changed" - | "bounds-changing" - | "close-requested" - | "closed" - | "disabled-frame-bounds-changed" - | "disabled-frame-bounds-changing" - | "embedded" - | "external-process-exited" - | "external-process-started" - | "focused" - | "frame-disabled" - | "frame-enabled" - | "group-changed" - | "hidden" - | "initialized" - | "maximized" - | "minimized" - | "navigation-rejected" - | "restored" - | "show-requested" - | "shown"; - - type OpenFinAnchor = "top-left" - | "top-right" - | "bottom-left" - | "bottom-right"; -} diff --git a/types/openfin/v29/openfin-tests.ts b/types/openfin/v29/openfin-tests.ts deleted file mode 100644 index 2b5237c1e8..0000000000 --- a/types/openfin/v29/openfin-tests.ts +++ /dev/null @@ -1,797 +0,0 @@ -function test_application() { - let application: fin.OpenFinApplication; - // constructor - application = new fin.desktop.Application({ - url: "application.html", - uuid: "74BED629-2D8E-4141-8582-73E364BDFA74", - name: "Application Name", - plugins: false, - mainWindowOptions: { - defaultHeight: 600, - defaultWidth: 800, - defaultTop: 300, - defaultLeft: 300, - autoShow: true - } - }, (successObj) => { - console.log("Application successfully created, HTTP response code:", successObj); - application.run(); - }, (error) => { - console.log("Error creating application:", error); - }); - //createFromManifest - fin.desktop.Application.createFromManifest("http://stuf.com/app.json", (app) => { - console.log(app.uuid); - }, err => console.log(err)); - // getCurrent - application = fin.desktop.Application.getCurrent(); - // wrap - application = fin.desktop.Application.wrap("454C7F31-A915-4EA2-83F2-CFA655453C52"); - // getWindow - application.getWindow(); - // addEventListener - application.addEventListener("closed", (event) => { - console.log("The application has closed"); - }, () => { - console.log("The registration was successful"); - }, reason => { - console.log("failure: " + reason); - }); - // close - application.close(); - // getChildWindows - application.getChildWindows(children => { - children.forEach(childWindow => { - console.log("Showing child: " + childWindow.name); - childWindow.show(); - }); - }); - // getGroups - application.getGroups(allGroups => { - console.log(`There are a total of ${allGroups.length} groups.`); - - let groupCounter = 1; - allGroups.forEach(windowGroup => { - console.log(`Group ${groupCounter} contains ${windowGroup.length} windows.`); - ++groupCounter; - }); - }); - // getManifest - application.getManifest(manifest => { - console.log("Application manifest:"); - console.log(manifest); - }); - // getParentUuid - application.getParentUuid(parentUuid => { - console.log("UUID of parent application:"); - console.log(parentUuid); - }); - // getShortcuts - application.getShortcuts(config => { - console.log("Desktop shortcut is enabled: ", config.desktop); - console.log("Start Menu shortcut is enabled: ", config.startMenu); - console.log("System Startup shortcut is enabled: ", config.systemStartup); - }); - // getInfo - application.getInfo(info => { - console.log(`Launch mode: ${info.launchMode}`); - }); - // getTrayIconInfo - application.getTrayIconInfo(info => { - console.log(info.x, info.y, info.bounds.x, info.bounds.y, info.bounds.height, info.bounds.width, - info.monitorInfo.type, info.monitorInfo.reason); - }); - // isRunning - application.isRunning(running => { - console.log("the application is", running ? "running" : "not running"); - }); - // registerCustomData - application.registerUser("a", "b", () => console.log("done"), err => console.log(err)); - // removeEventListener - const previousCallback = (event: fin.WindowEvent) => { }; - application.removeEventListener("closed", previousCallback, () => { - console.log("The unregistration was successful"); - }, err => { - console.log("failure:", err); - }); - // removeTrayIcon - application.removeTrayIcon(() => { - console.log("Removed the tray icon."); - }, err => { - console.log("failure:", err); - }); - // restart - application.restart(() => { - console.log("You will not read this."); - }, err => { - console.log("failure:", err); - }); - // schedule restart - application.scheduleRestart(() => { - console.log("You will not read this."); - }, err => { - console.log("failure:", err); - }); - // setShortcuts - application.setShortcuts({ - desktop: true, - startMenu: false, - systemStartup: true - }, () => { - console.log("Successfully set new shortcut states"); - }, error => { - console.log("Failed to set new shortcut states. Error: ", error); - }); - // setTrayIcon - application.setTrayIcon("https://developer.openf.in/download/openfin.png", clickInfo => { - console.log(`The mouse has clicked at (${clickInfo.x}, ${clickInfo.y})`); - }); - // terminate - application.terminate(); - // wait - application.addEventListener("not-responding", () => { - console.log("waiting for hung application"); - application.wait(); - }); - //uuid - let hasUuid = application.uuid; -} - -function test_external_application() { - let externalApp: fin.OpenFinExternalApplication; - // wrap - externalApp = fin.desktop.ExternalApp.wrap('my-uuid'); - // addEventListener - externalApp.addEventListener('connected', () => { - console.log('external app connected'); - }, () => { - console.log('The registration was successful'); - }, (reason, err) => { - console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); - }); - // removeEventListener - const previousCallback = () => { }; - externalApp.removeEventListener('connected', previousCallback, () => { - console.log('The unregistration was successful'); - }, (reason, err) => { - console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); - }); - - // getInfo - externalApp.getInfo(info => { - console.log(info.parent.uuid, info.parent.name); - }, err => console.log(err)); -} - -function test_inter_application_bus() { - // addSubscribeListener - fin.desktop.InterApplicationBus.addSubscribeListener((uuid, topic, name) => { - console.log(`The application ${uuid} has subscribed to ${topic}`); - }); - // addUnsubscribeListener - fin.desktop.InterApplicationBus.addUnsubscribeListener((uuid, topic, name) => { - console.log(`The application ${uuid} has unsubscribed to ${topic}`); - }); - // removeSubscribeListener - const aRegisteredListener = (uuid: string, topic: string, name: string) => { }; - fin.desktop.InterApplicationBus.removeSubscribeListener(aRegisteredListener); - // removeUnsubscribeListener - fin.desktop.InterApplicationBus.removeUnsubscribeListener(aRegisteredListener); - // publish - fin.desktop.InterApplicationBus.publish("a topic", { - field1: "value1", - field2: "value2" - }); - // send - fin.desktop.InterApplicationBus.send("an application's uuid", "a topic", { - field1: "value1", - field2: "value2" - }); - // subscribe - fin.desktop.InterApplicationBus.subscribe("*", "a topic", (message, uuid, name) => { - console.log(`The application ${uuid} sent this message: ${message}`); - }); - // unsubscribe - const aRegisteredMessageListener = (message: any, senderUuid: string) => { - console.log(message, senderUuid); - }; - fin.desktop.InterApplicationBus.unsubscribe("*", "a topic", aRegisteredMessageListener); -} - -function test_notification() { - let notification: fin.OpenFinNotification; - // getCurrent - notification = fin.desktop.Notification.getCurrent(); - // close - notification.close(); - // sendMessage - notification = new fin.desktop.Notification({ - duration: 10, - url: "http://localhost:5000/Account/Register", - message: "Hello", - onShow: () => { }, - // onClose: () => { }, - onDismiss: () => { }, - // onClick: () => { }, - onMessage: () => { }, - onError: () => { } - }); - // sendMessageToApplication - notification.sendMessageToApplication("some message"); -} - -function test_system() { - // addEventListener - fin.desktop.System.addEventListener('monitor-info-changed', event => { - console.log("The monitor information has changed to: ", event); - }, () => { - console.log("The registration was successful"); - }, err => { - console.log("failure: " + err); - }); - // clearCache - fin.desktop.System.clearCache({ - cache: true, - cookies: true, - localStorage: true, - appcache: true, - userData: true - }); - // deleteCacheOnExit - fin.desktop.System.deleteCacheOnExit(() => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // downloadAsset - const dirAppAsset = { - src: 'http://local:8000/dir.zip', - alias: 'dirApp', - version: '1.23.24', - target: 'dir.bat', - args: '' - }; - fin.desktop.System.downloadAsset(dirAppAsset, progress => { - const downloadedPercent = Math.floor((progress.downloadedBytes / progress.totalBytes) * 100); - console.log(`Downloaded ${downloadedPercent}%`); - }, p => { - console.log(`Downlod complete, can be found on ${p.path}`); - // lets launch our application asset. - // launchDirApp(); - }, (reason, err) => { - console.log(reason, err); - }); - // downloadRuntime - fin.desktop.System.downloadRuntime({ version: '9.61.31.56' }, progress => { - console.log(progress.downloadedBytes, progress.downloadedBytes); - }, () => console.log('download complete'), err => console.error(err)); - // downloadPreloadScript - const preloadScripts = [ - { url: 'http://whatever.com/script.js' } - ]; - fin.desktop.System.downloadPreloadScripts(preloadScripts, info => { - const downloadInfo = info[0]; - console.log(downloadInfo.success, downloadInfo.url, downloadInfo.error); - }, err => { - console.log(err); - }); - // exit - fin.desktop.System.exit(() => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - //flushCookieStore - fin.desktop.System.flushCookieStore(() => { - console.log('successful'); - }, err => { - console.log('failure', err); - }); - // getAllApplications - fin.desktop.System.getAllApplications(applicationInfoList => { - applicationInfoList.forEach(applicationInfo => { - console.log("Showing information for application with uuid: " - + applicationInfo.uuid); - console.log("isRunning: ", applicationInfo.isRunning); - }); - }); - // getAllExternalApplications - fin.desktop.System.getAllExternalApplications(externalAppsInfoList => { - externalAppsInfoList.forEach(appInfo => { - console.log(`External app connected to the runtime with UUID ${appInfo.uuid}`); - }); - }); - // getAllWindows - fin.desktop.System.getAllWindows(windowInfoList => { - windowInfoList.forEach(windowInfo => { - console.log("Showing information for application with uuid: ", windowInfo.uuid); - console.log("Main window: ", windowInfo.mainWindow); - console.log("Child windows: ", windowInfo.childWindows); - }); - }); - // getAppAssetInfo - fin.desktop.System.getAppAssetInfo({ alias: 'myAppAsset' }, info => { - console.log(info.alias, info.args, info.mandatory, info.src, info.target, info.version); - }, err => console.log(err)); - // getCommandLineArguments - fin.desktop.System.getCommandLineArguments(args => { - console.log("The command line arguments are " + args); - }); - //getCookieInfo - fin.desktop.System.getCookies({ name: 'myCookie1'}, cookies => { - const cookie1 = cookies[0]; - console.log(cookie1.name, cookie1.domain, cookie1.path); - }, err => console.log(err)); - // getDeviceId - fin.desktop.System.getDeviceId(id => { - console.log("The id of the device is: " + id); - }); - // getDeviceUserId - fin.desktop.System.getDeviceUserId(id => console.log(id), err => console.error(err)); - // getEntityInfo - fin.desktop.System.getEntityInfo('uuid', 'name', info => { - console.log(info.entityType, info.name, info.uuid, info.parent.name, info.parent.uuid); - }, err => console.log(err)); - // getEnvironmentVariable - fin.desktop.System.getEnvironmentVariable("APPDATA", variable => { - console.log("this is the APPDATA value", variable); - }); - // getFocusedWindow - fin.desktop.System.getFocusedWindow(win => { - console.log(win.uuid, win.name); - }, err => console.log(err)); - // getHostSpecs - fin.desktop.System.getHostSpecs(info => { - console.log(info); - }, error => { - console.log('There was an error:', error); - }); - // getLog - fin.desktop.System.getLog('debug-2015-01-08-22-27-53.log', log => { - console.log(log); - }); - // getLogList - fin.desktop.System.getLogList(logList => { - logList.forEach(logInfo => { - console.log(`The filename of the log is ${logInfo.name}, the size is ${logInfo.size}, and the date of creation is ${logInfo.date}`); - }); - }); - //getMinLogLevel - fin.desktop.System.getMinLogLevel(level => console.log(level), err => console.log(err)); - // getMonitorInfo - fin.desktop.System.getMonitorInfo(monitorInfo => { - console.log("This object contains information about all monitors: ", monitorInfo); - }); - // getMousePosition - fin.desktop.System.getMousePosition(mousePosition => { - console.log(`The mouse is located at left: ${mousePosition.left}, top: ${mousePosition.top}`); - }); - // getProcessList - fin.desktop.System.getProcessList(list => { - list.forEach(process => { - console.log(`UUID: ${process.uuid}, Application Name: ${process.name}`); - }); - }); - // getProxySettings - fin.desktop.System.getProxySettings(proxy => { - console.log(proxy); - }); - // getRvmInfo - fin.desktop.System.getRvmInfo(rvmInfoObject => { - console.log("RVM version:", rvmInfoObject.version); - console.log("RVM has been running since:", rvmInfoObject["start-time"]); - }, err => { - console.log("Failed to get rvm info, error message:", err); - }); - // getVersion - fin.desktop.System.getVersion(version => { - console.log("The version is " + version); - }); - // launchExternalProcess - fin.desktop.System.launchExternalProcess({ - path: "notepad", - arguments: "", - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // - fin.desktop.System.launchExternalProcess({ - // Additionally note that the executable found in the zip file specified in appAssets - // will default to the one mentioned by appAssets.target - // If the the path below refers to a specific path it will override this default - alias: "myApp", - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // - fin.desktop.System.launchExternalProcess({ - alias: "myApp", - arguments: "e f g", - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // - fin.desktop.System.launchExternalProcess({ - path: "C:\Users\ExampleUser\AppData\Local\OpenFin\OpenFinRVM.exe", - arguments: "--version", - certificate: { - trusted: true, - subject: 'O=OpenFin INC., L=New York, S=NY, C=US', - thumbprint: '3c a5 28 19 83 05 fe 69 88 e6 8f 4b 3a af c5 c5 1b 07 80 5b' - }, - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // log - fin.desktop.System.log("info", "An example log message", () => { - console.log("message successfully logged"); - }, err => { - console.log(err); - }); - // monitorExternalProcess - fin.desktop.System.monitorExternalProcess({ - pid: 2508, - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log("The process is now being monitored: ", payload.uuid); - }, error => { - console.log("Error:", error); - }); - // openUrlWithBrowser - fin.desktop.System.openUrlWithBrowser("https://developer.openf.in/", () => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // readRegistryValue - fin.desktop.System.readRegistryValue('HKEY_SOMETHING', 'HARDWARE\\SOMETHING', 'BootSomething', info => { - console.log(info.data, info.rootKey, info.subkey, info.type, info.value); - }, err => console.log(err)); - // registerExternalConnection - fin.desktop.System.registerExternalConnection("remote-connection-uuid", (...args: any[]) => { - console.log(args); - }); - // releaseExternalProcess - fin.desktop.System.launchExternalProcess({ - path: "notepad", - arguments: "", - listener(result) { - console.log("The exit code", result.exitCode); - } - }, result => { - console.log("Result UUID is " + result.uuid); - - // release it. - fin.desktop.System.releaseExternalProcess(result.uuid, () => { - console.log("Process has been unmapped!"); - }, reason => { - console.log("failure: " + reason); - }); - }); - // removeEventListener - const aRegisteredListener = (event: fin.SystemBaseEvent) => { }; - fin.desktop.System.removeEventListener("monitor-info-changed", aRegisteredListener, () => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - //setMinLogLevel - fin.desktop.System.setMinLogLevel("log level", () => console.log('Success'), err => console.error(err)); - // showDeveloperTools - fin.desktop.System.showDeveloperTools("uuid", "name", () => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // terminateExternalProcess - fin.desktop.System.launchExternalProcess({ - // notepad is in the system's PATH - path: "notepad", - arguments: "", - listener(result) { - console.log("The exit code", result.exitCode); - } - }, result => { - console.log("Result UUID is " + result.uuid); - - // Attempt to close the process. Terminate after 4 seconds if it - // has not done so. - fin.desktop.System.terminateExternalProcess(result.uuid, 4000, info => { - console.log("Termination result " + info.result); - }, reason => { - console.log("failure: " + reason); - }); - }); - // updateProxySettings - fin.desktop.System.updateProxySettings("type", "proxyAddress", 8080, () => { - console.log('success'); - }, err => { - console.log(err); - }); -} - -function test_system_clipboard() { - // availableFormats - fin.desktop.System.Clipboard.availableFormats(null, formats => { - formats.forEach(format => console.log(`The format ${format} is available to read`)); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // readHtml - fin.desktop.System.Clipboard.readHtml(null, html => { - console.log(`This is the html from the clipboard: ${html}`); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // readRtf - fin.desktop.System.Clipboard.readRtf(null, rtf => { - console.log(`This is the rtf from the clipboard: ${rtf}`); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // readText - fin.desktop.System.Clipboard.readText(null, text => { - console.log(`This is the text from the clipboard: ${text}`); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // write - fin.desktop.System.Clipboard.write({ - text: 'Hello Text!', - html: '

    Hello Html

    ', - rtf: 'Hello Rtf' - }, null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // writeHtml - fin.desktop.System.Clipboard.writeHtml('

    Hello World

    ', null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // writeRtf - fin.desktop.System.Clipboard.writeRtf('Hello World!', null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // writeText - fin.desktop.System.Clipboard.writeText('Hello World', null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); -} - -function test_window() { - let finWindow: fin.OpenFinWindow; - // constructor - finWindow = new fin.desktop.Window({ - name: "childWindow", - url: "child.html", - defaultWidth: 320, - defaultHeight: 320, - defaultTop: 10, - defaultLeft: 300, - frame: false, - resizable: false, - state: "normal" - }, () => { - const _win = finWindow.getNativeWindow(); - _win.addEventListener("DOMContentLoaded", () => { finWindow.show(); }); - }, error => { - console.log("Error creating window:", error); - }); - // getCurrent - finWindow = fin.desktop.Window.getCurrent(); - // getNativeWindow - let nativeWindow: Window; - nativeWindow = finWindow.getNativeWindow(); - // getParentApplication - let parentApp: fin.OpenFinApplication; - parentApp = finWindow.getParentApplication(); - // getParentWindow - let parentFinWindow: fin.OpenFinWindow; - parentFinWindow = finWindow.getParentWindow(); - // wrap - finWindow = fin.desktop.Window.wrap("uuid", "name"); - // addEventListener - finWindow.addEventListener("bounds-changed", event => { - console.log("The window has been moved or resized"); - }, () => { - console.log("The registration was successful"); - }, reason => { - console.log("failure:" + reason); - }); - // animate - finWindow.animate({ - opacity: { - opacity: 0.15, - duration: 1000 - }, - position: { - left: 10, - top: 10, - duration: 3000 - } - }, { - interrupt: false - }, evt => { - // Callback will only fire after both "opacity" and "position" have finished animating. - }); - // authenticate - finWindow.addEventListener('auth-requested', evt => { - finWindow.authenticate('userName', 'P@assw0rd', () => { }, (reason, err) => { - console.log("failure:", err); - }); - }); - // blur - finWindow.blur(); - // bringToFront - finWindow.bringToFront(); - // close - finWindow.close(); - // disableFrame - finWindow.disableFrame(); - // enableFrame - finWindow.enableFrame(); - // flash - finWindow.flash(); - // focus - finWindow.focus(); - // getBounds - finWindow.getBounds(bounds => { - console.log(`top: ${bounds.top} left: ${bounds.left} height: ${bounds.height} width: ${bounds.width}`); - }); - // getOptions - finWindow.getOptions(options => { - console.log(options); - }); - // getSnapshot - finWindow.getSnapshot(base64Snapshot => { - console.log("data:image/png;base64," + base64Snapshot); - }); - // getState - finWindow.getState(state => { - console.log("state: " + state); - }); - // getZoomLevel - finWindow.getZoomLevel(level => { - console.log("zoom level: " + level); - }, error => { - console.log('error:', error); - }); - // hide - finWindow.hide(); - // isShowing - finWindow.isShowing(showing => { - console.log("the window is " + (showing ? "showing" : "hidden")); - }); - // joinGroup - let secondWindow = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "secondWindow", - autoShow: true - }, () => { - // When mainWindow moves or is moved, secondWindow moves by the same amount - secondWindow.joinGroup(finWindow); - }); - // leaveGroup - secondWindow = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "secondWindow", - autoShow: true - }, () => { - // When finWindow moves or is moved, secondWindow moves by the same amount - secondWindow.joinGroup(finWindow, () => { - // once we are in the group, lets leave it. - secondWindow.leaveGroup(); - }); - }); - // maximize - finWindow.maximize(); - // mergeGroups - { - const finWindowOne = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowOne", - autoShow: true - }); - const finWindowTwo = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowTwo", - autoShow: true - }); - const finWindowThree = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowThree", - autoShow: true - }); - const finWindowFour = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowFour", - autoShow: true - }); - // When finWindowOne moves or is moved, finWindowTwo moves by the same amount - finWindowOne.joinGroup(finWindowTwo); - // When finWindowThree moves or is moved, finWindowFour moves by the same amount - finWindowThree.joinGroup(finWindowFour); - // finWindowOne, finWindowTwo, finWindowThree, and finWindowFour now move together in the same group - finWindowOne.mergeGroups(finWindowThree); - } - // minimize - finWindow.minimize(); - // moveBy - finWindow.moveBy(10, 10); - // moveTo - finWindow.moveTo(100, 200); - // removeEventListener - const aRegisteredListener = (event: fin.WindowBaseEvent) => { }; - finWindow.removeEventListener("bounds-changed", aRegisteredListener); - // resizeBy - finWindow.resizeBy(10, 10, "top-right"); - // resizeTo - finWindow.resizeTo(10, 10, "top-right"); - // restore - finWindow.restore(); - // setAsForeground - finWindow.setAsForeground(); - // setBounds - finWindow.setBounds(100, 200, 400, 400); - // setZoomLevel - finWindow.setZoomLevel(10); - // show - finWindow.show(); - // showAt - finWindow.showAt(10, 10, false); - // stopFlashing - finWindow.stopFlashing(); - // updateOptions - finWindow.updateOptions({ - frame: false, - maxWidth: 500 - }); -} - -function test_frame() { - //wrap - const frame = fin.desktop.Frame.wrap('uuid', 'name'); - //getCurrent - const currentFrame = fin.desktop.Frame.getCurrent(); - // addEventlistener - frame.addEventListener('event', () => console.log('on event'), () => console.log('success'), err => console.error(err)); - //removeEventListener - frame.removeEventListener('event', () => console.log('on event'), () => console.log('success'), err => console.error(err)); - // getInfo - frame.getInfo(info => { - console.log(info.uuid, info.name, info.entityType, info.parent.uuid, info.parent.name); - }, err => console.error(err)); - // getParentWindow - frame.getParentWindow(parent => { - console.log(parent.uuid, parent.name, parent.entityType, parent.parent.uuid, parent.parent.name); - }, err => console.error(err)); -} diff --git a/types/openfin/v29/tslint.json b/types/openfin/v29/tslint.json deleted file mode 100644 index f93cf8562a..0000000000 --- a/types/openfin/v29/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "dtslint/dt.json" -} From 6983d94a0e080404939e4803cef68ccd5b116425 Mon Sep 17 00:00:00 2001 From: Derek Wickern Date: Sun, 25 Mar 2018 19:18:43 -0700 Subject: [PATCH 0216/2153] ember: mismatched get/set --- types/ember-data/index.d.ts | 4 +-- types/ember-data/test/belongs-to.ts | 7 +++++ types/ember-data/test/has-many.ts | 5 ++++ types/ember/index.d.ts | 41 +++++++++++++++-------------- 4 files changed, 35 insertions(+), 22 deletions(-) diff --git a/types/ember-data/index.d.ts b/types/ember-data/index.d.ts index 9eec5ed467..ea3de94436 100644 --- a/types/ember-data/index.d.ts +++ b/types/ember-data/index.d.ts @@ -71,7 +71,7 @@ declare module 'ember-data' { inverse?: string | null; polymorphic?: boolean; } - ): Ember.ComputedProperty>; + ): Ember.ComputedProperty, ModelRegistry[K]>; /** * `DS.hasMany` is used to define One-To-Many and Many-To-Many * relationships on a [DS.Model](/api/data/classes/DS.Model.html). @@ -91,7 +91,7 @@ declare module 'ember-data' { inverse?: string | null; polymorphic?: boolean; } - ): Ember.ComputedProperty>; + ): Ember.ComputedProperty, Ember.Array>; /** * This method normalizes a modelName into the format Ember Data uses * internally. diff --git a/types/ember-data/test/belongs-to.ts b/types/ember-data/test/belongs-to.ts index bd1037a65e..31977c148c 100644 --- a/types/ember-data/test/belongs-to.ts +++ b/types/ember-data/test/belongs-to.ts @@ -1,6 +1,8 @@ import DS from 'ember-data'; import { assertType } from './lib/assert'; +declare const store: DS.Store; + class Folder extends DS.Model { name = DS.attr('string'); children = DS.hasMany('folder', { inverse: 'parent' }); @@ -19,4 +21,9 @@ assertType(folder.get('parent').get('name')); folder.get('parent').then(parent => { assertType(parent); assertType(parent.get('name')); + folder.set('parent', parent); }); + +folder.set('parent', folder); +folder.set('parent', folder.get('parent')); +folder.set('parent', store.findRecord('folder', 3)); diff --git a/types/ember-data/test/has-many.ts b/types/ember-data/test/has-many.ts index e24fb1b814..480a6bd56d 100644 --- a/types/ember-data/test/has-many.ts +++ b/types/ember-data/test/has-many.ts @@ -1,3 +1,4 @@ +import Ember from 'ember'; import DS from 'ember-data'; import { assertType } from './lib/assert'; @@ -44,6 +45,10 @@ blogPost.get('commentsAsync').then(comments => { assertType(comments.get('firstObject')!.get('text')); }); +blogPost.set('commentsAsync', blogPost.get('commentsAsync')); +blogPost.set('commentsAsync', Ember.A()); +blogPost.set('commentsAsync', Ember.A([ comment! ])); + class PaymentMethod extends DS.Model {} declare module 'ember-data' { interface ModelRegistry { diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index dd3ed1ec64..3e776bd665 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -28,7 +28,8 @@ declare module 'ember' { /** * Deconstructs computed properties into the types which would be returned by `.get()`. */ - type ComputedProperties = { [K in keyof T]: Ember.ComputedProperty | ModuleComputed | T[K] }; + type ComputedPropertyGetters = { [K in keyof T]: Ember.ComputedProperty | ModuleComputed | T[K] }; + type ComputedPropertySetters = { [K in keyof T]: Ember.ComputedProperty | ModuleComputed | T[K] }; /** * Check that any arguments to `create()` match the type's properties. @@ -683,7 +684,7 @@ declare module 'ember' { will be cached. You can specify various properties that your computed property is dependent on. This will force the cached result to be recomputed if the dependencies are modified. **/ - class ComputedProperty { + class ComputedProperty { /** * Call on a computed property to set it into non-cached mode. When in this * mode the computed property will not automatically cache the return value. @@ -812,7 +813,7 @@ declare module 'ember' { static create(this: EmberClassConstructor): Fix; static create>( - this: EmberClassConstructor>, + this: EmberClassConstructor>, arg1: T1 & ThisType> ): Fix; @@ -822,7 +823,7 @@ declare module 'ember' { T1 extends EmberInstanceArguments, T2 extends EmberInstanceArguments >( - this: EmberClassConstructor>, + this: EmberClassConstructor>, arg1: T1 & ThisType>, arg2: T2 & ThisType> ): Fix; @@ -834,7 +835,7 @@ declare module 'ember' { T2 extends EmberInstanceArguments, T3 extends EmberInstanceArguments >( - this: EmberClassConstructor>, + this: EmberClassConstructor>, arg1: T1 & ThisType>, arg2: T2 & ThisType>, arg3: T3 & ThisType> @@ -1641,27 +1642,27 @@ declare module 'ember' { /** * Retrieves the value of a property from the object. */ - get(this: ComputedProperties, key: K): T[K]; + get(this: ComputedPropertyGetters, key: K): T[K]; /** * To get the values of multiple properties at once, call `getProperties` * with a list of strings or an array: */ - getProperties(this: ComputedProperties, list: K[]): Pick; + getProperties(this: ComputedPropertyGetters, list: K[]): Pick; getProperties( - this: ComputedProperties, + this: ComputedPropertyGetters, ...list: K[] ): Pick; /** * Sets the provided key or path to the value. */ - set(this: ComputedProperties, key: K, value: T[K]): T[K]; + set(this: ComputedPropertySetters, key: K, value: T[K]): T[K]; /** * Sets a list of properties at once. These properties are set inside * a single `beginPropertyChanges` and `endPropertyChanges` batch, so * observers will be buffered. */ setProperties( - this: ComputedProperties, + this: ComputedPropertySetters, hash: Pick ): Pick; /** @@ -1692,7 +1693,7 @@ declare module 'ember' { * property returns `undefined`. */ getWithDefault( - this: ComputedProperties, + this: ComputedPropertyGetters, key: K, defaultValue: T[K] ): T[K]; @@ -1715,7 +1716,7 @@ declare module 'ember' { * without accidentally invoking it if it is intended to be * generated lazily. */ - cacheFor(this: ComputedProperties, key: K): T[K] | undefined; + cacheFor(this: ComputedPropertyGetters, key: K): T[K] | undefined; } const Observable: Mixin; /** @@ -2989,7 +2990,7 @@ declare module 'ember' { * it to be created. */ function cacheFor( - obj: ComputedProperties, + obj: ComputedPropertyGetters, key: K ): T[K] | undefined; /** @@ -3028,12 +3029,12 @@ declare module 'ember' { * with an object followed by a list of strings or an array: */ function getProperties( - obj: ComputedProperties, + obj: ComputedPropertyGetters, list: K[] ): Pick; function getProperties(obj: T, list: K[]): Pick; // for dynamic K function getProperties( - obj: ComputedProperties, + obj: ComputedPropertyGetters, ...list: K[] ): Pick; function getProperties(obj: T, ...list: K[]): Pick; // for dynamic K @@ -3120,14 +3121,14 @@ declare module 'ember' { * the function will be invoked. If the property is not defined but the * object implements the `unknownProperty` method then that will be invoked. */ - function get(obj: ComputedProperties, key: K): T[K]; + function get(obj: ComputedPropertyGetters, key: K): T[K]; function get(obj: T, key: K): T[K]; // for dynamic K /** * Retrieves the value of a property from an Object, or a default value in the * case that the property returns `undefined`. */ function getWithDefault( - obj: ComputedProperties, + obj: ComputedPropertyGetters, key: K, defaultValue: T[K] ): T[K]; @@ -3139,7 +3140,7 @@ declare module 'ember' { * method then that will be invoked as well. */ function set( - obj: ComputedProperties, + obj: ComputedPropertySetters, key: K, value: V ): V; @@ -3155,7 +3156,7 @@ declare module 'ember' { * observers will be buffered. */ function setProperties( - obj: ComputedProperties, + obj: ComputedPropertySetters, hash: Pick ): Pick; function setProperties(obj: T, hash: Pick): Pick; // for dynamic K @@ -3534,7 +3535,7 @@ declare module '@ember/object' { declare module '@ember/object/computed' { import Ember from 'ember'; - export default class ComputedProperty extends Ember.ComputedProperty { } + export default class ComputedProperty extends Ember.ComputedProperty { } export const alias: typeof Ember.computed.alias; export const and: typeof Ember.computed.and; export const bool: typeof Ember.computed.bool; From ebf695c819b0126efb0f91c9197a85335d0bac1f Mon Sep 17 00:00:00 2001 From: Tim Wang Date: Mon, 26 Mar 2018 10:41:58 +0800 Subject: [PATCH 0217/2153] Remove any union type --- types/react-navigation/index.d.ts | 3 +-- types/react-navigation/tslint.json | 7 +------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 3c6bffe130..cb27a40d71 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -175,7 +175,6 @@ export type NavigationScreenConfig = export type NavigationComponent = NavigationScreenComponent | NavigationNavigator - | any; export type NavigationScreenComponent< Options = {}, @@ -189,7 +188,7 @@ export type NavigationNavigator< Props = {} > = React.ComponentType & Props> & { router: NavigationRouter, - navigationOptions?: NavigationScreenConfig | any, + navigationOptions?: NavigationScreenConfig, }; export interface NavigationParams { diff --git a/types/react-navigation/tslint.json b/types/react-navigation/tslint.json index d9d49e375e..3db14f85ea 100644 --- a/types/react-navigation/tslint.json +++ b/types/react-navigation/tslint.json @@ -1,6 +1 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "no-any-union": false - } -} +{ "extends": "dtslint/dt.json" } From 40f7502a236e5de5d0242e891f274a697bf37ad4 Mon Sep 17 00:00:00 2001 From: Tim Wang Date: Mon, 26 Mar 2018 10:50:07 +0800 Subject: [PATCH 0218/2153] Fix linter issues --- types/react-navigation/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index cb27a40d71..9ec404a6fb 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -174,7 +174,7 @@ export type NavigationScreenConfig = export type NavigationComponent = NavigationScreenComponent - | NavigationNavigator + | NavigationNavigator; export type NavigationScreenComponent< Options = {}, From ca5143816548211a809c714caeb6f1df32f4cf0d Mon Sep 17 00:00:00 2001 From: Edo Rivai Date: Mon, 26 Mar 2018 11:54:23 +0200 Subject: [PATCH 0219/2153] Add renew parameter to config --- types/koa-session/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/koa-session/index.d.ts b/types/koa-session/index.d.ts index 8650a07d91..d2561d61e2 100644 --- a/types/koa-session/index.d.ts +++ b/types/koa-session/index.d.ts @@ -156,6 +156,11 @@ declare namespace session { */ rolling?: boolean; + /** + * Renew session when session is nearly expired, so we can always keep user logged in. (default is false) + */ + renew?: boolean; + /** * You can store the session content in external stores(redis, mongodb or other DBs) */ From 26ff8e3b857cbe1e26699d527ae467f4de739348 Mon Sep 17 00:00:00 2001 From: Remko Date: Mon, 26 Mar 2018 11:54:43 +0200 Subject: [PATCH 0220/2153] updates c3 to use d3 v4 --- types/c3/index.d.ts | 71 +++++++++++++++++++++++++----------------- types/c3/tsconfig.json | 20 +++--------- 2 files changed, 47 insertions(+), 44 deletions(-) diff --git a/types/c3/index.d.ts b/types/c3/index.d.ts index 28f301237c..6b3968eeec 100644 --- a/types/c3/index.d.ts +++ b/types/c3/index.d.ts @@ -28,7 +28,7 @@ export interface ChartConfiguration { * Note: When chart is not binded, c3 starts observing if chart.element is binded by MutationObserver. In this case, polyfill is required in IE9 and IE10 becuase they do not support * MutationObserver. On the other hand, if chart always will be binded, polyfill will not be required because MutationObserver will never be called. */ - bindto?: string | HTMLElement | d3.Selection | null; + bindto?: string | HTMLElement | d3.Selection | null; size?: { /** * The desired width of the chart element. @@ -172,16 +172,18 @@ export interface ChartConfiguration { /** * Change the width of bar chart. If ratio is specified, change the width of bar chart by ratio. */ - width?: number | { - /** - * Set the width of each bar by ratio - */ - ratio: number, - /** - * Set max width of each bar - */ - max?: number - }; + width?: + | number + | { + /** + * Set the width of each bar by ratio + */ + ratio: number; + /** + * Set max width of each bar + */ + max?: number; + }; /** * Set if min or max value will be 0 on bar chart. */ @@ -205,7 +207,7 @@ export interface ChartConfiguration { /** * Set threshold to show/hide labels. */ - threshold?: number + threshold?: number; }; /** * Enable or disable expanding pie pieces. @@ -226,7 +228,7 @@ export interface ChartConfiguration { /** * Set threshold to show/hide labels. */ - threshold?: number + threshold?: number; }; /** * Enable or disable expanding pie pieces. @@ -280,7 +282,17 @@ export interface ChartConfiguration { /** * Set custom spline interpolation */ - type?: 'linear' | 'linear-closed' | 'basis' | 'basis-open' | 'basis-closed' | 'bundle' | 'cardinal' | 'cardinal-open' | 'cardinal-closed' | 'monotone'; + type?: + | "linear" + | "linear-closed" + | "basis" + | "basis-open" + | "basis-closed" + | "bundle" + | "cardinal" + | "cardinal-open" + | "cardinal-closed" + | "monotone"; }; }; } @@ -309,7 +321,7 @@ export interface Data { /** * Choose which JSON object keys correspond to desired data. */ - keys?: { x?: string; value: string[]; }; + keys?: { x?: string; value: string[] }; /** * Specify the key of x values in the data. * We can show the data with non-index x values by this option. This option is required when the type of x axis is timeseries. If this option is set on category axis, the values of the data @@ -365,9 +377,7 @@ export interface Data { * - j is the sub index of the data point where the label is shown. * Formatter function can be defined for each data by specifying as an object and D3 formatter function can be set (e.g. d3.format('$')) */ - labels?: boolean | - { format: FormatFunction } | - { format: { [key: string]: FormatFunction } }; + labels?: boolean | { format: FormatFunction } | { format: { [key: string]: FormatFunction } }; /** * Define the order of the data. * This option changes the order of stacking the data and pieces of pie/donut. If null specified, it will be the order the data loaded. If function specified, it will be used to sort the data @@ -387,11 +397,11 @@ export interface Data { * This option should a function and the specified function receives color (e.g. '#ff0000') and d that has data parameters like id, value, index, etc. And it must return a string that * represents color (e.g. '#00ff00'). */ - color?(color: string, d: any): string | d3.Rgb; + color?(color: string, d: any): string | d3.RGBColor; /** * Set color for each data. */ - colors?: { [key: string]: string | d3.Rgb | ((d: any) => string | d3.Rgb) }; + colors?: { [key: string]: string | d3.RGBColor | ((d: any) => string | d3.RGBColor) }; /** * Hide each data when the chart appears. * If true specified, all of data will be hidden. If multiple ids specified as an array, those will be hidden. @@ -813,7 +823,7 @@ export interface PointOptions { /** * The radius size of each point on focus. */ - r?: number + r?: number; }; }; @@ -877,7 +887,7 @@ export interface ChartAPI { load(args: { url?: string; json?: {}; - keys?: { x?: string; value: string[]; } + keys?: { x?: string; value: string[] }; rows?: PrimitiveArray[]; columns?: PrimitiveArray[]; xs?: { [key: string]: string }; @@ -885,7 +895,7 @@ export interface ChartAPI { classes?: { [key: string]: string }; categories?: string[]; axes?: { [key: string]: string }; - colors?: { [key: string]: string | d3.Rgb }; + colors?: { [key: string]: string | d3.RGBColor }; type?: string; types?: { [key: string]: string }; unload?: boolean | ArrayOrString; @@ -911,7 +921,7 @@ export interface ChartAPI { */ flow(args: { json?: {}; - keys?: { x?: string; value: string[]; } + keys?: { x?: string; value: string[] }; rows?: PrimitiveArray[]; columns?: PrimitiveArray[]; to?: any; @@ -997,7 +1007,7 @@ export interface ChartAPI { * Get and set colors of the data loaded in the chart. * @param colors If this argument is given, the colors of data will be updated. If not given, the current colors will be returned. The format of this argument is the same as data.colors. */ - colors(colors?: { [key: string]: string | d3.Rgb }): { [key: string]: string }; + colors(colors?: { [key: string]: string | d3.RGBColor }): { [key: string]: string }; /** * Get and set axes of the data loaded in the chart. * @param axes If this argument is given, the axes of data will be updated. If not given, the current axes will be returned. The format of this argument is the same as data.axes. @@ -1040,22 +1050,25 @@ export interface ChartAPI { * Get and set axis labels. * @param labels If labels is given, specified axis' label will be updated. */ - labels(labels?: { [key: string]: string }): { [key: string]: string } + labels(labels?: { [key: string]: string }): { [key: string]: string }; /** * Get and set axis min value. * @param min If min is given, specified axis' min value will be updated. If no argument is given, the current min values for each axis will be returned. */ - min(min?: number | { [key: string]: number }): number | { [key: string]: number } + min(min?: number | { [key: string]: number }): number | { [key: string]: number }; /** * Get and set axis max value. * @param max If max is given, specified axis' max value will be updated. If no argument is given, the current max values for each axis will be returned. */ - max(max?: number | { [key: string]: number }): number | { [key: string]: number } + max(max?: number | { [key: string]: number }): number | { [key: string]: number }; /** * Get and set axis min and max value. * @param range If range is given, specified axis' min and max value will be updated. If no argument is given, the current min and max values for each axis will be returned. */ - range(range?: { min?: number | { [key: string]: number }; max?: number | { [key: string]: number } }): { min: number | { [key: string]: number }; max: number | { [key: string]: number } } + range(range?: { + min?: number | { [key: string]: number }; + max?: number | { [key: string]: number }; + }): { min: number | { [key: string]: number }; max: number | { [key: string]: number } }; }; legend: { diff --git a/types/c3/tsconfig.json b/types/c3/tsconfig.json index fe3b00c503..6576ec1ed6 100644 --- a/types/c3/tsconfig.json +++ b/types/c3/tsconfig.json @@ -1,29 +1,19 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6", - "dom" - ], + "lib": ["es6", "dom"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": false, "baseUrl": "../", - "typeRoots": [ - "../" - ], + "typeRoots": ["../"], "types": [], "paths": { - "d3": [ - "d3/v3" - ] + "d3": ["d3/v4"] }, "noEmit": true, "forceConsistentCasingInFileNames": true }, - "files": [ - "index.d.ts", - "c3-tests.ts" - ] -} \ No newline at end of file + "files": ["index.d.ts", "c3-tests.ts"] +} From f4b0597fd67f8c404ab1c40d2ef9b2c2fb625687 Mon Sep 17 00:00:00 2001 From: Remko Date: Mon, 26 Mar 2018 12:02:14 +0200 Subject: [PATCH 0221/2153] updates dependencies --- types/c3/index.d.ts | 4 ++-- types/c3/tsconfig.json | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/types/c3/index.d.ts b/types/c3/index.d.ts index 6b3968eeec..a1dfaaf8f0 100644 --- a/types/c3/index.d.ts +++ b/types/c3/index.d.ts @@ -1,11 +1,11 @@ -// Type definitions for C3js 0.4 +// Type definitions for C3js 0.5 // Project: http://c3js.org/ // Definitions by: Marc Climent // Gerin Jacob // Bernd Hacker // Dzmitry Shyndzin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.3 import * as d3 from "d3"; diff --git a/types/c3/tsconfig.json b/types/c3/tsconfig.json index 6576ec1ed6..aa923e91c0 100644 --- a/types/c3/tsconfig.json +++ b/types/c3/tsconfig.json @@ -10,6 +10,7 @@ "typeRoots": ["../"], "types": [], "paths": { + "d3-scale": ["d3-scale/v1"], "d3": ["d3/v4"] }, "noEmit": true, From 20981072a3c2c15367c4e56f52ac69c3032f2eab Mon Sep 17 00:00:00 2001 From: Jackson Delahunt Date: Mon, 26 Mar 2018 21:42:12 +1000 Subject: [PATCH 0222/2153] update tests --- types/archiver/archiver-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/archiver/archiver-tests.ts b/types/archiver/archiver-tests.ts index 752d9cc944..dbb1df1de7 100644 --- a/types/archiver/archiver-tests.ts +++ b/types/archiver/archiver-tests.ts @@ -64,6 +64,6 @@ archiver.setModule(() => {}); archiver.pointer(); archiver.use(() => {}); -archiver.finalize().then(); +archiver.finalize(); archiver.symlink('./path', './target'); From 950988652bdeac071a88dbf383742564ea2808b1 Mon Sep 17 00:00:00 2001 From: ohbarye Date: Mon, 26 Mar 2018 20:10:12 +0900 Subject: [PATCH 0223/2153] yup: Fix TestOptions to accept Promise https://github.com/jquense/yup/issues/7#issuecomment-100676450 --- types/yup/index.d.ts | 4 ++-- types/yup/yup-tests.ts | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/types/yup/index.d.ts b/types/yup/index.d.ts index c8c3f2dda4..93a60450e7 100644 --- a/types/yup/index.d.ts +++ b/types/yup/index.d.ts @@ -51,7 +51,7 @@ export interface Schema { oneOf(arrayOfValues: any[], message?: string): this; notOneOf(arrayOfValues: any[], message?: string): this; when(keys: string | any[], builder: WhenOptions): this; - test(name: string, message: string, test: (value?: any) => boolean, callbackStyleAsync?: boolean): this; + test(name: string, message: string, test: (value?: any) => boolean | Promise, callbackStyleAsync?: boolean): this; test(options: TestOptions): this; transform(fn: TransformFunction): this; } @@ -190,7 +190,7 @@ export interface TestOptions { /** * Test function, determines schema validity */ - test: (value: any) => boolean; + test: (value: any) => boolean | Promise; /** * The validation error message diff --git a/types/yup/yup-tests.ts b/types/yup/yup-tests.ts index 0c0aa04c47..83e17abe3e 100644 --- a/types/yup/yup-tests.ts +++ b/types/yup/yup-tests.ts @@ -123,6 +123,7 @@ mixed.test({ message: '${path} must be less than 5 characters', test: value => value == null || value.length <= 5 }); +mixed.test('with-promise', 'It contains invalid value', value => new Promise(resolve => true)); yup.string().transform(function(this, value: any, originalvalue: any) { return this.isType(value) && value !== null ? value.toUpperCase() : value; @@ -252,6 +253,14 @@ const testOptions: TestOptions = { exclusive: true }; +const testOptionsWithPromise: TestOptions = { + name: 'name', + test: value => new Promise(resolve => true), + message: 'validation error message', + params: { param1: 'value'}, + exclusive: true +}; + const validateOptions: ValidateOptions = { strict: true, abortEarly: true, From 6b2795e39eac4c2cd15fe184201d8bbbe2bdb39b Mon Sep 17 00:00:00 2001 From: Menushka Weeratunga Date: Mon, 26 Mar 2018 08:28:03 -0400 Subject: [PATCH 0224/2153] Made proposed changes --- .../fbinstant-tests.ts | 4 +- .../index.d.ts | 80 +++++++++---------- .../tsconfig.json | 0 types/facebook-instant-games/tslint.json | 1 + types/fbinstant/tslint.json | 8 -- 5 files changed, 41 insertions(+), 52 deletions(-) rename types/{fbinstant => facebook-instant-games}/fbinstant-tests.ts (95%) rename types/{fbinstant => facebook-instant-games}/index.d.ts (76%) rename types/{fbinstant => facebook-instant-games}/tsconfig.json (100%) create mode 100644 types/facebook-instant-games/tslint.json delete mode 100644 types/fbinstant/tslint.json diff --git a/types/fbinstant/fbinstant-tests.ts b/types/facebook-instant-games/fbinstant-tests.ts similarity index 95% rename from types/fbinstant/fbinstant-tests.ts rename to types/facebook-instant-games/fbinstant-tests.ts index f4a72ea70e..8d33e2c970 100644 --- a/types/fbinstant/fbinstant-tests.ts +++ b/types/facebook-instant-games/fbinstant-tests.ts @@ -1,6 +1,4 @@ -declare const FBInstant: FBInstant; - -export class FBInstantTest { +class FBInstantTest { winStreak: number; init() { diff --git a/types/fbinstant/index.d.ts b/types/facebook-instant-games/index.d.ts similarity index 76% rename from types/fbinstant/index.d.ts rename to types/facebook-instant-games/index.d.ts index 9b337bbc5e..4239c134fb 100644 --- a/types/fbinstant/index.d.ts +++ b/types/facebook-instant-games/index.d.ts @@ -1,40 +1,38 @@ -// Type definitions for FBInstant 6.1 +// Type definitions for facebook-instant-games 6.1 // Project: https://developers.facebook.com/docs/games/instant-games // Definitions by: Menushka Weeratunga // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare class FBInstant { - player: FBInstant.Player; - context: FBInstant.Context; - payments: FBInstant.Payments; - - getLocale(): string; - getPlatform(): string; - getSDKVersion(): string; - initializeAsync(): Promise; - setLoadingProgress(progress: number): void; - getSupportedAPIs(): string[]; - getEntryPointData(): any; - getEntryPointAsync(): Promise; - setSessionData(sessionData: any): void; - startGameAsync(): Promise; - shareAsync(payload: FBInstant.SharePayload): Promise; - updateAsync(payload: FBInstant.UpdatePayload): Promise; - switchGameAsync(appID: string, data: string): Promise; - canCreateShortcutAsync(): Promise; - createShortcutAsync(): Promise; - quit(): void; - logEvent(eventName: string, valueToSum?: number, parameter?: any): FBInstant.APIError; - onPause(func: () => void): void; - getInterstitialAdAsync(placementID: string): Promise; - getRewardedVideoAsync(placementID: string): Promise; - matchPlayerAsync(matchTag: string, switchContextWhenMatched?: boolean): Promise; - checkCanPlayerMatchAsync(): Promise; - getLeaderboardAsync(name: string): Promise; -} - declare namespace FBInstant { - class Player { + let player: Player; + let context: Context; + let payments: Payments; + + function getLocale(): string; + function getPlatform(): string; + function getSDKVersion(): string; + function initializeAsync(): Promise; + function setLoadingProgress(progress: number): void; + function getSupportedAPIs(): string[]; + function getEntryPointData(): any; + function getEntryPointAsync(): Promise; + function setSessionData(sessionData: any): void; + function startGameAsync(): Promise; + function shareAsync(payload: SharePayload): Promise; + function updateAsync(payload: UpdatePayload): Promise; + function switchGameAsync(appID: string, data: string): Promise; + function canCreateShortcutAsync(): Promise; + function createShortcutAsync(): Promise; + function quit(): void; + function logEvent(eventName: string, valueToSum?: number, parameter?: any): APIError; + function onPause(func: () => void): void; + function getInterstitialAdAsync(placementID: string): Promise; + function getRewardedVideoAsync(placementID: string): Promise; + function matchPlayerAsync(matchTag: string, switchContextWhenMatched?: boolean): Promise; + function checkCanPlayerMatchAsync(): Promise; + function getLeaderboardAsync(name: string): Promise; + + interface Player { getID(): string; getSignedPlayerInfoAsync(requestPayload: string): Promise; canSubscribeBotAsync(): Promise; @@ -50,7 +48,7 @@ declare namespace FBInstant { getConnectedPlayersAsync(): Promise; } - class Context { + interface Context { getID(): string; getType(): Type; isSizeBetween(minSize: number, maxSize: number): ContextSizeResponse; @@ -60,7 +58,7 @@ declare namespace FBInstant { getPlayersAsync(): Promise; } - class Leaderboard { + interface Leaderboard { getName(): string; getContextID(): string; getEntryCountAsync(): Promise; @@ -69,7 +67,7 @@ declare namespace FBInstant { getEntriesAsync(count: number, offset: number): Promise; } - class LeaderboardEntry { + interface LeaderboardEntry { getScore(): number; getFormattedScore(): string; getTimestamp(): number; @@ -78,36 +76,36 @@ declare namespace FBInstant { getPlayer(): LeaderboardPlayer; } - class LeaderboardPlayer { + interface LeaderboardPlayer { getName(): string; getPhoto(): string; getID(): string; } - class ConnectedPlayer { + interface ConnectedPlayer { getID(): string; getName(): string; getPhoto(): string; } - class SignedPlayerInfo { + interface SignedPlayerInfo { getPlayerID(): string; getSignature(): string; } - class ContextPlayer { + interface ContextPlayer { getID(): string; getName(): string; getPhoto(): string; } - class AdInstance { + interface AdInstance { getPlacementID(): string; loadAsync(): Promise; showAsync(): Promise; } - class Payments { + interface Payments { purchaseAsync(purchaseConfig: PurchaseConfig): Promise; getPurchasesAsync(): Promise; consumePurchaseAsync(purchaseToken: string): Promise; diff --git a/types/fbinstant/tsconfig.json b/types/facebook-instant-games/tsconfig.json similarity index 100% rename from types/fbinstant/tsconfig.json rename to types/facebook-instant-games/tsconfig.json diff --git a/types/facebook-instant-games/tslint.json b/types/facebook-instant-games/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/facebook-instant-games/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/fbinstant/tslint.json b/types/fbinstant/tslint.json deleted file mode 100644 index 71918edac3..0000000000 --- a/types/fbinstant/tslint.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - // Needs to be declares as it cannot be imported in typescript - // using the standard import statement - "strict-export-declare-modifiers": false - } -} From 5e0d0d49a3573bc0aab9b245b30fe6c431f147c4 Mon Sep 17 00:00:00 2001 From: Firede Date: Mon, 26 Mar 2018 21:35:59 +0800 Subject: [PATCH 0225/2153] info.fieldName is readonly, see https://github.com/graphql/graphql-js/blob/v0.13.2/src/type/definition.js#L808 --- types/graphql-relay/graphql-relay-tests.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/types/graphql-relay/graphql-relay-tests.ts b/types/graphql-relay/graphql-relay-tests.ts index 6cc1f0f5ce..cebc90e2ca 100644 --- a/types/graphql-relay/graphql-relay-tests.ts +++ b/types/graphql-relay/graphql-relay-tests.ts @@ -44,7 +44,7 @@ backwardConnectionArgs.before = "b"; backwardConnectionArgs.last = 10; // connectionDefinitions returns a connectionType and its associated edgeType, given a node type. const resolve: GraphQLFieldResolver = (source, args, context, info) => { - info.fieldName = "f"; + context.flag = "f"; }; const fields: GraphQLFieldConfigMap = {}; let t: GraphQLObjectType; @@ -118,10 +118,10 @@ const resolver: GraphQLTypeResolver = () => { fields: {}, }); }; -const idFetcher = (id: string, context: number, info: GraphQLResolveInfo) => { - info.fieldName = "f"; +const idFetcher = (id: string, context: any, info: GraphQLResolveInfo) => { + context.flag = "f"; }; -const nodeDef = nodeDefinitions(idFetcher, resolver); +const nodeDef = nodeDefinitions(idFetcher, resolver); const nodeFieldConfig: GraphQLFieldConfig = nodeDef.nodeField; const nodesFieldConfig: GraphQLFieldConfig = nodeDef.nodesField; const interfaceType: GraphQLInterfaceType = nodeDef.nodeInterface; @@ -183,10 +183,10 @@ mutationWithClientMutationId({ inputFields: gifcm, mutateAndGetPayload: ( object: any, - ctx: any, + context: any, info: GraphQLResolveInfo) => { return new Promise((resolve) => { - resolve(info.fieldName); + resolve(context.flag); }); }, outputFields: gfcm, From 7b6d712a235710822a0c1f15be2e36cee7fc53c5 Mon Sep 17 00:00:00 2001 From: Menushka Weeratunga Date: Mon, 26 Mar 2018 09:38:39 -0400 Subject: [PATCH 0226/2153] Renamed test file --- .../{fbinstant-tests.ts => facebook-instant-games-tests.ts} | 0 types/facebook-instant-games/tsconfig.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename types/facebook-instant-games/{fbinstant-tests.ts => facebook-instant-games-tests.ts} (100%) diff --git a/types/facebook-instant-games/fbinstant-tests.ts b/types/facebook-instant-games/facebook-instant-games-tests.ts similarity index 100% rename from types/facebook-instant-games/fbinstant-tests.ts rename to types/facebook-instant-games/facebook-instant-games-tests.ts diff --git a/types/facebook-instant-games/tsconfig.json b/types/facebook-instant-games/tsconfig.json index 7cb5ffc8ae..5f1b7e6ccd 100644 --- a/types/facebook-instant-games/tsconfig.json +++ b/types/facebook-instant-games/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "fbinstant-tests.ts" + "facebook-instant-games-tests.ts" ] } From b34df70d54055f068afe1adad360674b7d4fb6c0 Mon Sep 17 00:00:00 2001 From: Firede Date: Mon, 26 Mar 2018 22:02:02 +0800 Subject: [PATCH 0227/2153] `parentType: GraphQLObjectType`, see https://github.com/graphql/graphql-js/pull/1033 --- types/graphql-list-fields/graphql-list-fields-tests.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/graphql-list-fields/graphql-list-fields-tests.ts b/types/graphql-list-fields/graphql-list-fields-tests.ts index 7624a3cbd8..ee9bcc6851 100644 --- a/types/graphql-list-fields/graphql-list-fields-tests.ts +++ b/types/graphql-list-fields/graphql-list-fields-tests.ts @@ -2,7 +2,6 @@ import getFieldNames = require("graphql-list-fields"); import { GraphQLID, - GraphQLInterfaceType, GraphQLObjectType, GraphQLResolveInfo, GraphQLSchema, @@ -13,7 +12,7 @@ const sampleGraphQLResolveInfo: GraphQLResolveInfo = { fieldName: "", fieldNodes: [], returnType: GraphQLString, - parentType: new GraphQLInterfaceType({ + parentType: new GraphQLObjectType({ name: "Sample", fields: { name: { type: GraphQLString } From b1b96d8190db1382f29db9593da1a494010bfe2e Mon Sep 17 00:00:00 2001 From: Menushka Weeratunga Date: Mon, 26 Mar 2018 10:32:39 -0400 Subject: [PATCH 0228/2153] Added missing optional tags --- types/facebook-instant-games/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/facebook-instant-games/index.d.ts b/types/facebook-instant-games/index.d.ts index 4239c134fb..82ea96e1f6 100644 --- a/types/facebook-instant-games/index.d.ts +++ b/types/facebook-instant-games/index.d.ts @@ -20,7 +20,7 @@ declare namespace FBInstant { function startGameAsync(): Promise; function shareAsync(payload: SharePayload): Promise; function updateAsync(payload: UpdatePayload): Promise; - function switchGameAsync(appID: string, data: string): Promise; + function switchGameAsync(appID: string, data?: string): Promise; function canCreateShortcutAsync(): Promise; function createShortcutAsync(): Promise; function quit(): void; @@ -28,7 +28,7 @@ declare namespace FBInstant { function onPause(func: () => void): void; function getInterstitialAdAsync(placementID: string): Promise; function getRewardedVideoAsync(placementID: string): Promise; - function matchPlayerAsync(matchTag: string, switchContextWhenMatched?: boolean): Promise; + function matchPlayerAsync(matchTag?: string, switchContextWhenMatched?: boolean): Promise; function checkCanPlayerMatchAsync(): Promise; function getLeaderboardAsync(name: string): Promise; @@ -39,10 +39,10 @@ declare namespace FBInstant { subscribeBotAsync(): Promise; getName(): string; getPhoto(): string; - getDataAsync(keys: string[]): Promise; + getDataAsync(keys?: string[]): Promise; setDataAsync(data: DataObject): Promise; flushDataAsync(): Promise; - getStatsAsync(keys: string[]): Promise; + getStatsAsync(keys?: string[]): Promise; setStatsAsync(stats: StatsObject): Promise; incrementStatsAsync(increments: IncrementObject): Promise; getConnectedPlayersAsync(): Promise; From a9c9972d1e7be73f60b9d6095d6986d5b0274d15 Mon Sep 17 00:00:00 2001 From: Jovica Zoric Date: Mon, 26 Mar 2018 16:44:37 +0200 Subject: [PATCH 0229/2153] Fix typo --- types/react-sortable-tree/index.d.ts | 4 ++-- types/react-sortable-tree/react-sortable-tree-tests.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/react-sortable-tree/index.d.ts b/types/react-sortable-tree/index.d.ts index 345bd3c601..0a0efc7f31 100644 --- a/types/react-sortable-tree/index.d.ts +++ b/types/react-sortable-tree/index.d.ts @@ -51,7 +51,7 @@ export interface ExtendedNodeData extends NodeData { export interface OnVisibilityToggleData extends FullTree, TreeNode { expanded: boolean; } -export interface PreviousAnNextLocation { +export interface PreviousAndNextLocation { prevTreeIndex: number; prevPath: number[]; nextTreeIndex: number; @@ -112,7 +112,7 @@ export interface ReactSortableTreeProps { onMoveNode?(data: NodeData & FullTree): void; onVisibilityToggle?(data: OnVisibilityToggleData): void; canDrag?: ((data: ExtendedNodeData) => boolean) | boolean; - canDrop?(data: PreviousAnNextLocation & NodeData): boolean; + canDrop?(data: PreviousAndNextLocation & NodeData): boolean; reactVirtualizedListProps?: ListProps; rowHeight?: ((info: Index) => number) | number; slideRegionSize?: number; diff --git a/types/react-sortable-tree/react-sortable-tree-tests.tsx b/types/react-sortable-tree/react-sortable-tree-tests.tsx index 154a7284c6..d67e6ad123 100644 --- a/types/react-sortable-tree/react-sortable-tree-tests.tsx +++ b/types/react-sortable-tree/react-sortable-tree-tests.tsx @@ -11,7 +11,7 @@ import SortableTree, ExtendedNodeData, FullTree, OnVisibilityToggleData, - PreviousAnNextLocation, + PreviousAndNextLocation, PlaceholderRendererProps } from "react-sortable-tree"; import { ListProps, ListRowRenderer } from "react-virtualized"; @@ -55,7 +55,7 @@ class Test extends React.Component { onMoveNode={(data: NodeData & FullTree) => {}} onVisibilityToggle={(data: OnVisibilityToggleData) => {}} canDrag={true} - canDrop={(data: PreviousAnNextLocation & NodeData) => true} + canDrop={(data: PreviousAndNextLocation & NodeData) => true} reactVirtualizedListProps={reactVirtualizedListProps} rowHeight={62} slideRegionSize={100} From 4f8a5c46b7e003f5a694c4817f23c0c50f897e0a Mon Sep 17 00:00:00 2001 From: Menushka Weeratunga Date: Mon, 26 Mar 2018 11:46:11 -0400 Subject: [PATCH 0230/2153] Minor fixes --- types/facebook-instant-games/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/facebook-instant-games/index.d.ts b/types/facebook-instant-games/index.d.ts index 82ea96e1f6..1e8a8d76fd 100644 --- a/types/facebook-instant-games/index.d.ts +++ b/types/facebook-instant-games/index.d.ts @@ -19,7 +19,7 @@ declare namespace FBInstant { function setSessionData(sessionData: any): void; function startGameAsync(): Promise; function shareAsync(payload: SharePayload): Promise; - function updateAsync(payload: UpdatePayload): Promise; + function updateAsync(payload: UpdatePayload | LeaderboardUpdatePayload): Promise; function switchGameAsync(appID: string, data?: string): Promise; function canCreateShortcutAsync(): Promise; function createShortcutAsync(): Promise; @@ -183,7 +183,7 @@ declare namespace FBInstant { interface DataObject { [ key: string ]: string | number; } - interface StatsObject { [ key: string ]: string | number; } + interface StatsObject { [ key: string ]: number; } interface IncrementObject { [ key: string ]: number; } From 68c613f2f5ec4c105c66199ab340f72bcd9c36c0 Mon Sep 17 00:00:00 2001 From: Pedro Antonio Souza Viegas Date: Mon, 26 Mar 2018 14:12:24 -0300 Subject: [PATCH 0231/2153] Adding Payments Lite Dialog params Hi! I am adding the dialog params for payments lite as it is different from normal payment ui params. --- types/facebook-js-sdk/index.d.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/types/facebook-js-sdk/index.d.ts b/types/facebook-js-sdk/index.d.ts index c380ee004d..4676cbf0fc 100644 --- a/types/facebook-js-sdk/index.d.ts +++ b/types/facebook-js-sdk/index.d.ts @@ -66,6 +66,11 @@ declare namespace facebook { */ ui(params: PayDialogParams, callback: (response: PayDialogResponse) => void): void; + /** + * @see https://developers.facebook.com/docs/games_payments/payments_lite + */ + ui(params: PaymentsLiteDialogParams, callback: (response: PaymentsLiteDialogResponse) => void): void; + /** * @see https://developers.facebook.com/docs/videos/live-video/exploring-live */ @@ -154,6 +159,14 @@ declare namespace facebook { request_id?: string; test_currency?: string; } + + interface PaymentsLiteDialogParams extends DialogParams { + method: 'pay'; + action: 'purchaseiap'; + product_id: string; + developer_payload?: string; + quantity?: number; + } interface LiveDialogParams extends DialogParams { method: 'live_broadcast'; @@ -199,6 +212,17 @@ declare namespace facebook { signed_request: string; } + interface PaymentsLiteDialogResponse { + developer_payload?: string; + payment_id: number; + product_id?: string; + purchase_time?: number; + purchase_token?: string; + signed_request?: string; + error_code?: number; + error_message?: string; + } + interface LiveDialogResponse { id: string; stream_url: string; From 5177c3bf93bf60ce3df9e6534b2e265dc50bee71 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 26 Mar 2018 11:16:08 -0700 Subject: [PATCH 0232/2153] Add `fn` to `is` --- types/is/index.d.ts | 21 ++++++++++++++++++--- types/is/is-tests.ts | 6 ++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/types/is/index.d.ts b/types/is/index.d.ts index b61bd6deee..3b70472d65 100644 --- a/types/is/index.d.ts +++ b/types/is/index.d.ts @@ -32,6 +32,11 @@ interface IsStatic { */ error(value: any): boolean; + /** + * Checks if the given value type is function. + */ + fn(value: any): boolean; + /** * Checks if the given value type is function. */ @@ -587,7 +592,7 @@ interface IsStaticApi { * Checks if the given value type is arguments. */ arguments(...value: any[]): boolean; - + /** * Checks if the given value type is arguments. */ @@ -633,6 +638,16 @@ interface IsStaticApi { */ error(value: any[]): boolean; + /** + * Checks if the given value type is function. + */ + fn(...value: any[]): boolean; + + /** + * Checks if the given value type is function. + */ + fn(value: any[]): boolean; + /** * Checks if the given value type is function. */ @@ -1234,12 +1249,12 @@ interface Is extends IsStatic { * Override RegExps if you think they suck. */ setRegexp(value: RegExp, regexp: 'url'): boolean; - + /** * Override RegExps if you think they suck. */ setRegexp(value: RegExp, regexp: 'email'): boolean; - + /** * Override RegExps if you think they suck. */ diff --git a/types/is/is-tests.ts b/types/is/is-tests.ts index 674d5ff761..0084de8990 100644 --- a/types/is/is-tests.ts +++ b/types/is/is-tests.ts @@ -36,6 +36,12 @@ is.all.error(new Error(), 'bar'); is.any.error(new Error(), 'bar'); is.all.error([new Error(), 'foo', 'bar']); +is.fn(toString); +is.not.fn({ foo: 'bar' }); +is.all.fn(toString, 'bar'); +is.any.fn(toString, 'bar'); +is.all.fn([toString, 'foo', 'bar']); + is.function(toString); is.not.function({ foo: 'bar' }); is.all.function(toString, 'bar'); From f41730728dd0fd4b0dac956c15553bec442073b8 Mon Sep 17 00:00:00 2001 From: Daniel Almaguer Date: Mon, 26 Mar 2018 14:25:03 -0500 Subject: [PATCH 0233/2153] navigo: update lastRouteResolved --- types/navigo/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/navigo/index.d.ts b/types/navigo/index.d.ts index ebc0ecb8c5..30fb656d45 100644 --- a/types/navigo/index.d.ts +++ b/types/navigo/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/krasimir/navigo // Definitions by: Adrian Ehrsam // Dancespiele +// Daniel Almaguer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -53,7 +54,7 @@ declare class Navigo { link(path: string): string; - lastRouteResolved(): {url: string, query: string}; + lastRouteResolved(): {url: string, query: string, hooks: NavigoHooks, params?: Params, name?: string}; disableIfAPINotAvailable(): void; From 2224db8ee54ee35869eb714f18bdc6959e710712 Mon Sep 17 00:00:00 2001 From: Pedro Antonio Souza Viegas Date: Mon, 26 Mar 2018 18:24:41 -0300 Subject: [PATCH 0234/2153] adding payment lite dialog example --- types/facebook-js-sdk/facebook-js-sdk-tests.ts | 9 +++++++++ types/facebook-js-sdk/index.d.ts | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/types/facebook-js-sdk/facebook-js-sdk-tests.ts b/types/facebook-js-sdk/facebook-js-sdk-tests.ts index f919e3290f..9652dbb86f 100644 --- a/types/facebook-js-sdk/facebook-js-sdk-tests.ts +++ b/types/facebook-js-sdk/facebook-js-sdk-tests.ts @@ -72,6 +72,15 @@ FB.ui({ console.log(data.payment_id); }); +FB.ui({ + method: 'pay', + action: 'purchaseiap', + product_id: 'com.fb.friendsmash.coins.10', + developer_payload: 'this_is_a_test_payload' +}, response => { + console.log(response); +}); + FB.ui({ method: 'pagetab', redirect_uri: 'YOUR_URL' diff --git a/types/facebook-js-sdk/index.d.ts b/types/facebook-js-sdk/index.d.ts index 4676cbf0fc..be9f71f6c9 100644 --- a/types/facebook-js-sdk/index.d.ts +++ b/types/facebook-js-sdk/index.d.ts @@ -186,7 +186,7 @@ declare namespace facebook { authResponse: { accessToken: string; expiresIn: number; - grantedScopes: string; + grantedScopes: string; signedRequest: string; userID: string; }; @@ -219,7 +219,7 @@ declare namespace facebook { purchase_time?: number; purchase_token?: string; signed_request?: string; - error_code?: number; + error_code?: number; error_message?: string; } From 386695a0cc5346b7ae76961b927e5bc2d021f381 Mon Sep 17 00:00:00 2001 From: Noah Santschi-Cooney Date: Mon, 26 Mar 2018 23:05:20 +0100 Subject: [PATCH 0235/2153] Removed userAgent() --- types/nightmare/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/nightmare/index.d.ts b/types/nightmare/index.d.ts index e848ce3fdd..923bcb6a37 100644 --- a/types/nightmare/index.d.ts +++ b/types/nightmare/index.d.ts @@ -12,7 +12,6 @@ declare class Nightmare { constructor(options?: Nightmare.IConstructorOptions); // Interact - // userAgent(agent: string): Nightmare; end(): Nightmare; then(fn: (value: T) => R): Promise; halt(error: string, cb: () => void): Nightmare; From d111b8e278658bc2772931bca46f345daea2e7e4 Mon Sep 17 00:00:00 2001 From: Andyma <66229754@qq.com> Date: Tue, 27 Mar 2018 09:08:59 +0800 Subject: [PATCH 0236/2153] Update index.d.ts Not all events have the same args. --- types/datatables.net/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/datatables.net/index.d.ts b/types/datatables.net/index.d.ts index 7941d0586f..f0d1b123fe 100644 --- a/types/datatables.net/index.d.ts +++ b/types/datatables.net/index.d.ts @@ -221,7 +221,7 @@ declare namespace DataTables { * @param event Event name to remove. * @param callback Specific callback function to remove if you want to unbind a single event listener. */ - off(event: string, callback?: ((e: Event, settings: Settings, json: any) => void)): Api; + off(event: string, callback?: ((e: Event, ...args: any[]) => void)): Api; /** * Table events listener. @@ -229,7 +229,7 @@ declare namespace DataTables { * @param event Event to listen for. * @param callback Specific callback function to remove if you want to unbind a single event listener. */ - on(event: string, callback: ((e: Event, settings: Settings, json: any) => void)): Api; + on(event: string, callback: ((e: Event, ...args: any[]) => void)): Api; /** * Listen for a table event once and then remove the listener. @@ -237,7 +237,7 @@ declare namespace DataTables { * @param event Event to listen for. * @param callback Specific callback function to remove if you want to unbind a single event listener. */ - one(event: string, callback: ((e: Event, settings: Settings, json: any) => void)): Api; + one(event: string, callback: ((e: Event, ...args: any[]) => void)): Api; /** * Page Methods / object From 934a9f1ba2f17bf20322feb0bfb5d70b49bd2851 Mon Sep 17 00:00:00 2001 From: Andyma <66229754@qq.com> Date: Tue, 27 Mar 2018 09:12:08 +0800 Subject: [PATCH 0237/2153] Update index.d.ts Add api interface for select extension --- types/datatables.net-select/index.d.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/types/datatables.net-select/index.d.ts b/types/datatables.net-select/index.d.ts index aa68f64969..c242027069 100644 --- a/types/datatables.net-select/index.d.ts +++ b/types/datatables.net-select/index.d.ts @@ -59,4 +59,26 @@ declare namespace DataTables { style(s: "api" | "single" | "multi" | "os"): Api; } } + + interface RowMethods { + /** + * Select a row + */ + select(): Api; + /** + * Deselect a row + */ + deselect: Api; + } + + interface RowsMethods { + /** + * Select multiple rows + */ + select(): Api; + /** + * Deselect a row + */ + deselect(): Api; + } } From d1cff7a8ff8a8dc30249d50163c8739fe696bd93 Mon Sep 17 00:00:00 2001 From: Andyma <66229754@qq.com> Date: Tue, 27 Mar 2018 09:16:54 +0800 Subject: [PATCH 0238/2153] Update index.d.ts --- types/datatables.net-select/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/datatables.net-select/index.d.ts b/types/datatables.net-select/index.d.ts index c242027069..a48cfe989b 100644 --- a/types/datatables.net-select/index.d.ts +++ b/types/datatables.net-select/index.d.ts @@ -68,7 +68,7 @@ declare namespace DataTables { /** * Deselect a row */ - deselect: Api; + deselect(): Api; } interface RowsMethods { From 8ea26416e7bb32cefa8a5f134f0f84d03b0764d9 Mon Sep 17 00:00:00 2001 From: Chris Krycho Date: Mon, 26 Mar 2018 20:40:10 -0600 Subject: [PATCH 0239/2153] Ember: Add `@ember/error` module export. --- types/ember/index.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index 3e776bd665..6d8adebae2 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -3500,6 +3500,12 @@ declare module '@ember/enumerable' { export default Enumerable; } +declare module '@ember/error' { + import Ember from 'ember'; + const Error: typeof Ember.Error; + export default Error; +} + declare module '@ember/instrumentation' { import Ember from 'ember'; export const instrument: typeof Ember.instrument; From 7fd7362840a0a70781c205e97ce73d01b61a543d Mon Sep 17 00:00:00 2001 From: Chris Krycho Date: Mon, 26 Mar 2018 20:49:55 -0600 Subject: [PATCH 0240/2153] Ember: Add test of import from '@ember/error'. --- types/ember/test/error.ts | 6 ++++++ types/ember/tsconfig.json | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 types/ember/test/error.ts diff --git a/types/ember/test/error.ts b/types/ember/test/error.ts new file mode 100644 index 0000000000..ad3c2ee8c3 --- /dev/null +++ b/types/ember/test/error.ts @@ -0,0 +1,6 @@ +import { assertType } from "./lib/assert"; + +import Ember from "ember"; +import EmberError from "@ember/error"; + +assertType(EmberError); diff --git a/types/ember/tsconfig.json b/types/ember/tsconfig.json index 19c8cf4b50..cbdb6b6afc 100755 --- a/types/ember/tsconfig.json +++ b/types/ember/tsconfig.json @@ -23,6 +23,7 @@ "test/lib/assert.ts", "test/application.ts", "test/ember-tests.ts", + "test/error.ts", "test/event.ts", "test/extend.ts", "test/create.ts", @@ -49,4 +50,4 @@ "test/route.ts", "test/view-utils.ts" ] -} \ No newline at end of file +} From 0925c2e41e5f9040e345141336adc3f3bd0bbb4b Mon Sep 17 00:00:00 2001 From: Vitor Cavalcanti Date: Tue, 27 Mar 2018 00:07:04 -0300 Subject: [PATCH 0241/2153] Add definition for is-color --- types/is-color/index.d.ts | 20 ++++++++++++++++++++ types/is-color/is-color-tests.ts | 23 +++++++++++++++++++++++ types/is-color/tsconfig.json | 23 +++++++++++++++++++++++ types/is-color/tslint.json | 1 + 4 files changed, 67 insertions(+) create mode 100644 types/is-color/index.d.ts create mode 100644 types/is-color/is-color-tests.ts create mode 100644 types/is-color/tsconfig.json create mode 100644 types/is-color/tslint.json diff --git a/types/is-color/index.d.ts b/types/is-color/index.d.ts new file mode 100644 index 0000000000..f6c545246f --- /dev/null +++ b/types/is-color/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for is-color 1.0 +// Project: https://github.com/morishitter/is-color +// Definitions by: Vitor Luiz Cavalcanti +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function isColor(str: string): boolean; + +declare namespace isColor { + function isRgb(str: string): boolean; + function isRgba(str: string): boolean; + function isHsl(str: string): boolean; + function isHsla(str: string): boolean; + function isHex(str: string): boolean; + function isKeyword(str: string): boolean; + function isInherit(str: string): str is 'inherit'; + function isCurrentColor(str: string): str is ('currentColor' | 'currentcolor'); + function isTransparent(str: string): str is 'transparent'; +} + +export = isColor; diff --git a/types/is-color/is-color-tests.ts b/types/is-color/is-color-tests.ts new file mode 100644 index 0000000000..a17ffc7b08 --- /dev/null +++ b/types/is-color/is-color-tests.ts @@ -0,0 +1,23 @@ +import isColor = require('is-color'); + +isColor('#000'); +// => boolean + +isColor.isHex('#000'); +// => boolean +isColor.isHsl('#000'); +// => boolean +isColor.isHsla('#000'); +// => boolean +isColor.isRgb('rgb(0, 0, 0)'); +// => boolean +isColor.isRgba('rgba(0,0,0, 0)'); +// => boolean +isColor.isKeyword('red'); +// => boolean +isColor.isInherit('inherit'); +// => is 'inherit' +isColor.isTransparent('transparent'); +// => is 'transparent' +isColor.isCurrentColor('currentColor'); +// => is 'currentColor'|'currentcolor' diff --git a/types/is-color/tsconfig.json b/types/is-color/tsconfig.json new file mode 100644 index 0000000000..41488170d8 --- /dev/null +++ b/types/is-color/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "is-color-tests.ts" + ] +} diff --git a/types/is-color/tslint.json b/types/is-color/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-color/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 357df72d924b2e3fdc76bb125c61b24eaeb682f2 Mon Sep 17 00:00:00 2001 From: Andyma <66229754@qq.com> Date: Tue, 27 Mar 2018 11:12:01 +0800 Subject: [PATCH 0242/2153] Update index.d.ts Datatables api should be array-like, and accessable with index like array --- types/datatables.net/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/datatables.net/index.d.ts b/types/datatables.net/index.d.ts index f0d1b123fe..6bbc2e1137 100644 --- a/types/datatables.net/index.d.ts +++ b/types/datatables.net/index.d.ts @@ -28,6 +28,10 @@ declare namespace DataTables { } interface Api extends CoreMethods { + /** + * API should be array-like + */ + [key: number]: any; /** * Returns DataTables API instance * From 59685b6f85c3e0cffe9aafe7692360226683e74f Mon Sep 17 00:00:00 2001 From: Mike Cook Date: Tue, 27 Mar 2018 08:04:13 +0100 Subject: [PATCH 0243/2153] Remove readme anchor from project link --- types/nodecredstash/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/nodecredstash/index.d.ts b/types/nodecredstash/index.d.ts index 76375aac21..9b2fed47c8 100644 --- a/types/nodecredstash/index.d.ts +++ b/types/nodecredstash/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for nodecredstash 2.0 -// Project: https://github.com/DavidTanner/nodecredstash#readme +// Project: https://github.com/DavidTanner/nodecredstash // Definitions by: Mike Cook // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 9f893b8e9e99a56f97cbaae0102fceeddff5f3cf Mon Sep 17 00:00:00 2001 From: Rafal2228 Date: Tue, 27 Mar 2018 10:15:32 +0200 Subject: [PATCH 0244/2153] fix(zapier-platform-core): add missing HTTP verb --- types/zapier-platform-core/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/zapier-platform-core/index.d.ts b/types/zapier-platform-core/index.d.ts index 525421abbf..474de4f0fd 100644 --- a/types/zapier-platform-core/index.d.ts +++ b/types/zapier-platform-core/index.d.ts @@ -15,7 +15,7 @@ export const version: string; export interface HttpRequestOptions { url?: string; - method?: "POST" | "GET" | "OPTIONS" | "HEAD" | "DELETE" | "PATCH"; + method?: "POST" | "GET" | "OPTIONS" | "HEAD" | "DELETE" | "PATCH" | "PUT"; body?: string | Buffer | NodeJS.ReadableStream | object | null; headers?: { [name: string]: string }; json?: object | any[] | null; From f0c93f3a89e7670953d927660c5d1f1d304df0f3 Mon Sep 17 00:00:00 2001 From: Andy Ma Date: Tue, 27 Mar 2018 17:59:11 +0800 Subject: [PATCH 0245/2153] Add typing for ColReorder extension --- .../datatables.net-colreorder-tests.ts | 12 ++++ types/datatables.net-colreorder/index.d.ts | 64 +++++++++++++++++++ types/datatables.net-colreorder/tsconfig.json | 24 +++++++ types/datatables.net-colreorder/tslint.json | 1 + 4 files changed, 101 insertions(+) create mode 100644 types/datatables.net-colreorder/datatables.net-colreorder-tests.ts create mode 100644 types/datatables.net-colreorder/index.d.ts create mode 100644 types/datatables.net-colreorder/tsconfig.json create mode 100644 types/datatables.net-colreorder/tslint.json diff --git a/types/datatables.net-colreorder/datatables.net-colreorder-tests.ts b/types/datatables.net-colreorder/datatables.net-colreorder-tests.ts new file mode 100644 index 0000000000..9b73f3f0e0 --- /dev/null +++ b/types/datatables.net-colreorder/datatables.net-colreorder-tests.ts @@ -0,0 +1,12 @@ +$(document).ready(() => { + const config: DataTables.Settings = { + // ColReorder extension options + colReorder: { + fixedColumnsLeft: 0, + fixedColumnsRight: 0, + order: [1,2,3], + realtime: true, + reorderCallback: ()=>{}, + } + }; +}); diff --git a/types/datatables.net-colreorder/index.d.ts b/types/datatables.net-colreorder/index.d.ts new file mode 100644 index 0000000000..80a9fa4e41 --- /dev/null +++ b/types/datatables.net-colreorder/index.d.ts @@ -0,0 +1,64 @@ +// Type definitions for datatables.net-colReorder 1.4 +// Project: https://datatables.net/extensions/colreorder/ +// Definitions by: Andy Ma +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// +/// + +declare namespace DataTables { + interface Settings { + /* + * colReorder extension options + */ + colReorder?: boolean | ColReorderSettings; + } + + interface ColReorderSettings { + /* + * Number of columns (counting from the left) to disallow reordering of, '0' in default + */ + fixedColumnsLeft?: number; + + /* + * Number of columns (counting from the right) to disallow reordering of, '0' in default + */ + fixedColumnsRight?: number; + + /* + * Set a default order for the columns in the table + */ + order?: number[]; + + /* + * Enable / disable live reordering of columns during a drag, 'true' in default + */ + realtime?: boolean; + /* + * Callback after reorder + */ + reorderCallback: Function; + } + + interface Api { + colReorder: { + /* + * Programmatically reorder columns + */ + move(from: number, to: number, drop: boolean, invalidate: boolean): Api; + /* + * Get / set column order + */ + order(newOrder?: number[], originalIndexes?: boolean): Api; + /* + * Restore the loaded column order + */ + reset(): Api; + /* + * Convert one or more column indexes to and from current and original indexes + */ + transpose(idx?: number | number[], direction?: "toCurrent" | "toOriginal" | "fromOriginal" | "fromCurrent"): Api; + } + } +} \ No newline at end of file diff --git a/types/datatables.net-colreorder/tsconfig.json b/types/datatables.net-colreorder/tsconfig.json new file mode 100644 index 0000000000..97ef7b2fc0 --- /dev/null +++ b/types/datatables.net-colreorder/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "datatables.net-colreorder-tests.ts" + ] +} \ No newline at end of file diff --git a/types/datatables.net-colreorder/tslint.json b/types/datatables.net-colreorder/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/datatables.net-colreorder/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From be3c84327f3727492c6e513945d4e7d13170d8c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Morch=C3=B3n=20Poveda?= Date: Tue, 27 Mar 2018 13:03:46 +0200 Subject: [PATCH 0246/2153] Update use with varargs --- types/jss/index.d.ts | 2 +- types/jss/jss-tests.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/types/jss/index.d.ts b/types/jss/index.d.ts index 0f77605b2c..37d2443e4a 100644 --- a/types/jss/index.d.ts +++ b/types/jss/index.d.ts @@ -125,7 +125,7 @@ declare class JSS { ): StyleSheet; removeStyleSheet(sheet: StyleSheet): this; setup(options?: Partial): this; - use(plugin: JSSPlugin): this; + use(...plugins: JSSPlugin[]): this; createRule(style: Style, options?: Partial): Rule; createRule(name: string, style: Style, options?: Partial): Rule; } diff --git a/types/jss/jss-tests.ts b/types/jss/jss-tests.ts index a5c6f34126..0211df99a8 100644 --- a/types/jss/jss-tests.ts +++ b/types/jss/jss-tests.ts @@ -7,6 +7,7 @@ import { } from 'jss'; const jss = createJSS().setup({}); +jss.use({}, {}); // $ExpectType JSS const styleSheet = jss.createStyleSheet( { From 3327220ff8a99ef392089105e9d6908c6747a588 Mon Sep 17 00:00:00 2001 From: Firede Date: Tue, 27 Mar 2018 19:48:25 +0800 Subject: [PATCH 0247/2153] Reformat all files using prettier. prettier --parser typescript --tab-width 4 --semi --trailing-comma es5 \ --write --print-width 120 \ types/graphql/**/*.d.ts related: #23142 #24532 --- types/graphql/error/GraphQLError.d.ts | 116 +-- types/graphql/error/formatError.d.ts | 12 +- types/graphql/error/index.d.ts | 12 +- types/graphql/error/locatedError.d.ts | 8 +- types/graphql/error/syntaxError.d.ts | 10 +- types/graphql/execution/execute.d.ts | 78 +- types/graphql/execution/index.d.ts | 10 +- types/graphql/execution/values.d.ts | 34 +- types/graphql/graphql.d.ts | 26 +- types/graphql/index.d.ts | 47 +- types/graphql/language/ast.d.ts | 758 +++++++++--------- types/graphql/language/index.d.ts | 22 +- types/graphql/language/kinds.d.ts | 86 +- types/graphql/language/lexer.d.ts | 95 ++- types/graphql/language/location.d.ts | 6 +- types/graphql/language/parser.d.ts | 104 ++- types/graphql/language/source.d.ts | 6 +- types/graphql/language/visitor.d.ts | 68 +- types/graphql/subscription/index.d.ts | 2 +- types/graphql/subscription/subscribe.d.ts | 46 +- types/graphql/type/definition.d.ts | 488 ++++++----- types/graphql/type/directives.d.ts | 68 +- types/graphql/type/index.d.ts | 70 +- types/graphql/type/introspection.d.ts | 36 +- types/graphql/type/scalars.d.ts | 2 +- types/graphql/type/schema.d.ts | 97 ++- types/graphql/utilities/TypeInfo.d.ts | 60 +- types/graphql/utilities/astFromValue.d.ts | 8 +- types/graphql/utilities/buildASTSchema.d.ts | 26 +- .../graphql/utilities/buildClientSchema.d.ts | 9 +- types/graphql/utilities/concatAST.d.ts | 2 +- types/graphql/utilities/extendSchema.d.ts | 9 +- .../utilities/findBreakingChanges.d.ts | 78 +- .../utilities/findDeprecatedUsages.d.ts | 11 +- types/graphql/utilities/getOperationAST.d.ts | 7 +- types/graphql/utilities/index.d.ts | 82 +- .../graphql/utilities/introspectionQuery.d.ts | 129 ++- types/graphql/utilities/isValidJSValue.d.ts | 2 +- .../utilities/isValidLiteralValue.d.ts | 9 +- types/graphql/utilities/schemaPrinter.d.ts | 6 +- .../graphql/utilities/separateOperations.d.ts | 6 +- types/graphql/utilities/typeComparators.d.ts | 20 +- types/graphql/utilities/typeFromAST.d.ts | 11 +- types/graphql/utilities/valueFromAST.d.ts | 19 +- types/graphql/validation/index.d.ts | 104 +-- .../rules/ArgumentsOfCorrectType.d.ts | 2 +- .../rules/DefaultValuesOfCorrectType.d.ts | 2 +- .../validation/rules/FieldsOnCorrectType.d.ts | 2 +- .../rules/FragmentsOnCompositeTypes.d.ts | 2 +- .../validation/rules/KnownArgumentNames.d.ts | 2 +- .../validation/rules/KnownDirectives.d.ts | 2 +- .../validation/rules/KnownFragmentNames.d.ts | 2 +- .../validation/rules/KnownTypeNames.d.ts | 2 +- .../rules/LoneAnonymousOperation.d.ts | 2 +- .../validation/rules/NoFragmentCycles.d.ts | 2 +- .../rules/NoUndefinedVariables.d.ts | 2 +- .../validation/rules/NoUnusedFragments.d.ts | 2 +- .../validation/rules/NoUnusedVariables.d.ts | 2 +- .../rules/OverlappingFieldsCanBeMerged.d.ts | 2 +- .../rules/PossibleFragmentSpreads.d.ts | 2 +- .../rules/ProvidedNonNullArguments.d.ts | 2 +- .../graphql/validation/rules/ScalarLeafs.d.ts | 2 +- .../rules/SingleFieldSubscriptions.d.ts | 2 +- .../validation/rules/UniqueArgumentNames.d.ts | 2 +- .../rules/UniqueDirectivesPerLocation.d.ts | 2 +- .../validation/rules/UniqueFragmentNames.d.ts | 2 +- .../rules/UniqueInputFieldNames.d.ts | 2 +- .../rules/UniqueOperationNames.d.ts | 2 +- .../validation/rules/UniqueVariableNames.d.ts | 2 +- .../rules/VariablesAreInputTypes.d.ts | 2 +- .../rules/VariablesInAllowedPosition.d.ts | 2 +- types/graphql/validation/specifiedRules.d.ts | 2 +- types/graphql/validation/validate.d.ts | 94 +-- 73 files changed, 1405 insertions(+), 1648 deletions(-) diff --git a/types/graphql/error/GraphQLError.d.ts b/types/graphql/error/GraphQLError.d.ts index abcc6be5b9..a4aa3f17c6 100644 --- a/types/graphql/error/GraphQLError.d.ts +++ b/types/graphql/error/GraphQLError.d.ts @@ -1,6 +1,6 @@ -import { getLocation } from '../language'; -import { ASTNode } from '../language/ast'; -import { Source } from '../language/source'; +import { getLocation } from "../language"; +import { ASTNode } from "../language/ast"; +import { Source } from "../language/source"; /** * A GraphQLError describes an Error found during the parse, validate, or @@ -9,66 +9,66 @@ import { Source } from '../language/source'; * GraphQL document and/or execution result that correspond to the Error. */ export class GraphQLError extends Error { - /** - * A message describing the Error for debugging purposes. - * - * Enumerable, and appears in the result of JSON.stringify(). - */ - message: string; + /** + * A message describing the Error for debugging purposes. + * + * Enumerable, and appears in the result of JSON.stringify(). + */ + message: string; - /** - * An array of { line, column } locations within the source GraphQL document - * which correspond to this error. - * - * Errors during validation often contain multiple locations, for example to - * point out two things with the same name. Errors during execution include a - * single location, the field which produced the error. - * - * Enumerable, and appears in the result of JSON.stringify(). - */ - locations?: Array<{ line: number; column: number }> | undefined; + /** + * An array of { line, column } locations within the source GraphQL document + * which correspond to this error. + * + * Errors during validation often contain multiple locations, for example to + * point out two things with the same name. Errors during execution include a + * single location, the field which produced the error. + * + * Enumerable, and appears in the result of JSON.stringify(). + */ + locations?: Array<{ line: number; column: number }> | undefined; - /** - * An array describing the JSON-path into the execution response which - * corresponds to this error. Only included for errors during execution. - * - * Enumerable, and appears in the result of JSON.stringify(). - */ - path?: Array | undefined; + /** + * An array describing the JSON-path into the execution response which + * corresponds to this error. Only included for errors during execution. + * + * Enumerable, and appears in the result of JSON.stringify(). + */ + path?: Array | undefined; - /** - * An array of GraphQL AST Nodes corresponding to this error. - */ - nodes?: ASTNode[] | undefined; + /** + * An array of GraphQL AST Nodes corresponding to this error. + */ + nodes?: ASTNode[] | undefined; - /** - * The source GraphQL document corresponding to this error. - */ - source?: Source | undefined; + /** + * The source GraphQL document corresponding to this error. + */ + source?: Source | undefined; - /** - * An array of character offsets within the source GraphQL document - * which correspond to this error. - */ - positions?: number[] | undefined; + /** + * An array of character offsets within the source GraphQL document + * which correspond to this error. + */ + positions?: number[] | undefined; - /** - * The original error thrown from a field resolver during execution. - */ - originalError?: Error; - - /** - * Extension fields to add to the formatted error. - */ - extensions?: { [key: string]: any } | undefined; + /** + * The original error thrown from a field resolver during execution. + */ + originalError?: Error; - constructor( - message: string, - nodes?: any[], - source?: Source, - positions?: number[], - path?: Array, - originalError?: Error, - extensions?: { [key: string]: any }, - ); + /** + * Extension fields to add to the formatted error. + */ + extensions?: { [key: string]: any } | undefined; + + constructor( + message: string, + nodes?: any[], + source?: Source, + positions?: number[], + path?: Array, + originalError?: Error, + extensions?: { [key: string]: any } + ); } diff --git a/types/graphql/error/formatError.d.ts b/types/graphql/error/formatError.d.ts index 26dbe0f743..a683da0375 100644 --- a/types/graphql/error/formatError.d.ts +++ b/types/graphql/error/formatError.d.ts @@ -1,4 +1,4 @@ -import { GraphQLError } from './GraphQLError'; +import { GraphQLError } from "./GraphQLError"; /** * Given a GraphQLError, format it according to the rules described by the @@ -7,12 +7,12 @@ import { GraphQLError } from './GraphQLError'; export function formatError(error: GraphQLError): GraphQLFormattedError; export interface GraphQLFormattedError { - message: string; - locations?: GraphQLErrorLocation[]; - path?: Array; + message: string; + locations?: GraphQLErrorLocation[]; + path?: Array; } export interface GraphQLErrorLocation { - line: number; - column: number; + line: number; + column: number; } diff --git a/types/graphql/error/index.d.ts b/types/graphql/error/index.d.ts index 0e9a557794..8d81175bcc 100644 --- a/types/graphql/error/index.d.ts +++ b/types/graphql/error/index.d.ts @@ -1,8 +1,4 @@ -export { GraphQLError } from './GraphQLError'; -export { syntaxError } from './syntaxError'; -export { locatedError } from './locatedError'; -export { - formatError, - GraphQLFormattedError, - GraphQLErrorLocation, -} from './formatError'; +export { GraphQLError } from "./GraphQLError"; +export { syntaxError } from "./syntaxError"; +export { locatedError } from "./locatedError"; +export { formatError, GraphQLFormattedError, GraphQLErrorLocation } from "./formatError"; diff --git a/types/graphql/error/locatedError.d.ts b/types/graphql/error/locatedError.d.ts index 64fadf49f4..c41fd0df50 100644 --- a/types/graphql/error/locatedError.d.ts +++ b/types/graphql/error/locatedError.d.ts @@ -1,12 +1,8 @@ -import { GraphQLError } from './GraphQLError'; +import { GraphQLError } from "./GraphQLError"; /** * Given an arbitrary Error, presumably thrown while attempting to execute a * GraphQL operation, produce a new GraphQLError aware of the location in the * document responsible for the original Error. */ -export function locatedError( - originalError: Error, - nodes: T[], - path: Array, -): GraphQLError; +export function locatedError(originalError: Error, nodes: T[], path: Array): GraphQLError; diff --git a/types/graphql/error/syntaxError.d.ts b/types/graphql/error/syntaxError.d.ts index ccf84044ca..bc33cd8107 100644 --- a/types/graphql/error/syntaxError.d.ts +++ b/types/graphql/error/syntaxError.d.ts @@ -1,12 +1,8 @@ -import { Source } from '../language/source'; -import { GraphQLError } from './GraphQLError'; +import { Source } from "../language/source"; +import { GraphQLError } from "./GraphQLError"; /** * Produces a GraphQLError representing a syntax error, containing useful * descriptive information about the syntax error's position in the source. */ -export function syntaxError( - source: Source, - position: number, - description: string, -): GraphQLError; +export function syntaxError(source: Source, position: number, description: string): GraphQLError; diff --git a/types/graphql/execution/execute.d.ts b/types/graphql/execution/execute.d.ts index ea6ab8ed39..387a3d4d73 100644 --- a/types/graphql/execution/execute.d.ts +++ b/types/graphql/execution/execute.d.ts @@ -1,19 +1,15 @@ -import { GraphQLError, locatedError } from '../error'; -import { GraphQLSchema } from '../type/schema'; +import { GraphQLError, locatedError } from "../error"; +import { GraphQLSchema } from "../type/schema"; +import { GraphQLField, GraphQLFieldResolver, ResponsePath } from "../type/definition"; import { - GraphQLField, - GraphQLFieldResolver, - ResponsePath, -} from '../type/definition'; -import { - DirectiveNode, - DocumentNode, - OperationDefinitionNode, - SelectionSetNode, - FieldNode, - InlineFragmentNode, - FragmentDefinitionNode, -} from '../language/ast'; + DirectiveNode, + DocumentNode, + OperationDefinitionNode, + SelectionSetNode, + FieldNode, + InlineFragmentNode, + FragmentDefinitionNode, +} from "../language/ast"; /** * Data that must be available at all points during query execution. * @@ -21,13 +17,13 @@ import { * and the fragments defined in the query document */ export interface ExecutionContext { - schema: GraphQLSchema; - fragments: { [key: string]: FragmentDefinitionNode }; - rootValue: any; - operation: OperationDefinitionNode; - variableValues: { [key: string]: any }; - fieldResolver: GraphQLFieldResolver; - errors: GraphQLError[]; + schema: GraphQLSchema; + fragments: { [key: string]: FragmentDefinitionNode }; + rootValue: any; + operation: OperationDefinitionNode; + variableValues: { [key: string]: any }; + fieldResolver: GraphQLFieldResolver; + errors: GraphQLError[]; } /** @@ -37,19 +33,19 @@ export interface ExecutionContext { * non-empty array if an error occurred. */ export interface ExecutionResult { - data?: { [key: string]: any }; - extensions?: { [key: string]: any }; - errors?: GraphQLError[]; + data?: { [key: string]: any }; + extensions?: { [key: string]: any }; + errors?: GraphQLError[]; } export type ExecutionArgs = { - schema: GraphQLSchema; - document: DocumentNode; - rootValue?: any; - contextValue?: any; - variableValues?: { [key: string]: any }; - operationName?: string; - fieldResolver?: GraphQLFieldResolver; + schema: GraphQLSchema; + document: DocumentNode; + rootValue?: any; + contextValue?: any; + variableValues?: { [key: string]: any }; + operationName?: string; + fieldResolver?: GraphQLFieldResolver; }; /** @@ -64,15 +60,15 @@ export type ExecutionArgs = { */ export function execute(args: ExecutionArgs): Promise; export function execute( - schema: GraphQLSchema, - document: DocumentNode, - rootValue?: any, - contextValue?: any, - variableValues?: { - [key: string]: any; - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver, + schema: GraphQLSchema, + document: DocumentNode, + rootValue?: any, + contextValue?: any, + variableValues?: { + [key: string]: any; + }, + operationName?: string, + fieldResolver?: GraphQLFieldResolver ): Promise; /** diff --git a/types/graphql/execution/index.d.ts b/types/graphql/execution/index.d.ts index a5c4980c0a..74aef224ce 100644 --- a/types/graphql/execution/index.d.ts +++ b/types/graphql/execution/index.d.ts @@ -1,9 +1,3 @@ -export { - execute, - defaultFieldResolver, - responsePathAsArray, - ExecutionArgs, - ExecutionResult, -} from './execute'; +export { execute, defaultFieldResolver, responsePathAsArray, ExecutionArgs, ExecutionResult } from "./execute"; -export { getDirectiveValues } from './values'; +export { getDirectiveValues } from "./values"; diff --git a/types/graphql/execution/values.d.ts b/types/graphql/execution/values.d.ts index 08e6041aa2..d8e1ec2e7e 100644 --- a/types/graphql/execution/values.d.ts +++ b/types/graphql/execution/values.d.ts @@ -1,15 +1,7 @@ -import { - GraphQLInputType, - GraphQLField, - GraphQLArgument, -} from '../type/definition'; -import { GraphQLDirective } from '../type/directives'; -import { GraphQLSchema } from '../type/schema'; -import { - FieldNode, - DirectiveNode, - VariableDefinitionNode, -} from '../language/ast'; +import { GraphQLInputType, GraphQLField, GraphQLArgument } from "../type/definition"; +import { GraphQLDirective } from "../type/directives"; +import { GraphQLSchema } from "../type/schema"; +import { FieldNode, DirectiveNode, VariableDefinitionNode } from "../language/ast"; /** * Prepares an object map of variableValues of the correct type based on the @@ -17,9 +9,9 @@ import { * parsed to match the variable definitions, a GraphQLError will be thrown. */ export function getVariableValues( - schema: GraphQLSchema, - varDefNodes: VariableDefinitionNode[], - inputs: { [key: string]: any }, + schema: GraphQLSchema, + varDefNodes: VariableDefinitionNode[], + inputs: { [key: string]: any } ): { [key: string]: any }; /** @@ -27,9 +19,9 @@ export function getVariableValues( * definitions and list of argument AST nodes. */ export function getArgumentValues( - def: GraphQLField | GraphQLDirective, - node: FieldNode | DirectiveNode, - variableValues?: { [key: string]: any }, + def: GraphQLField | GraphQLDirective, + node: FieldNode | DirectiveNode, + variableValues?: { [key: string]: any } ): { [key: string]: any }; /** @@ -40,7 +32,7 @@ export function getArgumentValues( * If the directive does not exist on the node, returns undefined. */ export function getDirectiveValues( - directiveDef: GraphQLDirective, - node: { directives?: Array }, - variableValues?: { [key: string]: any }, + directiveDef: GraphQLDirective, + node: { directives?: Array }, + variableValues?: { [key: string]: any } ): void | { [key: string]: any }; diff --git a/types/graphql/graphql.d.ts b/types/graphql/graphql.d.ts index f5469d7d8c..386cdd9e1b 100644 --- a/types/graphql/graphql.d.ts +++ b/types/graphql/graphql.d.ts @@ -1,7 +1,7 @@ -import { Source } from './language/source'; -import { GraphQLFieldResolver } from './type/definition'; -import { GraphQLSchema } from './type/schema'; -import { ExecutionResult } from './execution/execute'; +import { Source } from "./language/source"; +import { GraphQLFieldResolver } from "./type/definition"; +import { GraphQLSchema } from "./type/schema"; +import { ExecutionResult } from "./execution/execute"; /** * This is the primary entry point function for fulfilling GraphQL operations @@ -34,15 +34,15 @@ import { ExecutionResult } from './execution/execute'; * value or method on the source value with the field's name). */ export function graphql(args: { - schema: GraphQLSchema, - source: string | Source, - rootValue?: any, - contextValue?: any, + schema: GraphQLSchema; + source: string | Source; + rootValue?: any; + contextValue?: any; variableValues?: { - [key: string]: any - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver + [key: string]: any; + }; + operationName?: string; + fieldResolver?: GraphQLFieldResolver; }): Promise; export function graphql( schema: GraphQLSchema, @@ -50,7 +50,7 @@ export function graphql( rootValue?: any, contextValue?: any, variableValues?: { - [key: string]: any + [key: string]: any; }, operationName?: string, fieldResolver?: GraphQLFieldResolver diff --git a/types/graphql/index.d.ts b/types/graphql/index.d.ts index 49185e11a1..017f006787 100644 --- a/types/graphql/index.d.ts +++ b/types/graphql/index.d.ts @@ -17,17 +17,15 @@ // TypeScript Version: 2.3 // The primary entry point into fulfilling a GraphQL request. -export { - graphql -} from './graphql'; +export { graphql } from "./graphql"; // Create and operate on GraphQL type definitions and schema. -export * from './type'; +export * from "./type"; // Parse and operate on GraphQL language source files. -export * from './language'; +export * from "./language"; -export * from './subscription'; +export * from "./subscription"; // Execute GraphQL queries. export { @@ -37,16 +35,14 @@ export { getDirectiveValues, ExecutionArgs, ExecutionResult, -} from './execution'; +} from "./execution"; // Validate GraphQL queries. export { validate, ValidationContext, - // All validation rules in the GraphQL Specification. specifiedRules, - // Individual validation rules. ArgumentsOfCorrectTypeRule, DefaultValuesOfCorrectTypeRule, @@ -74,87 +70,60 @@ export { UniqueVariableNamesRule, VariablesAreInputTypesRule, VariablesInAllowedPositionRule, -} from './validation'; +} from "./validation"; // Create and format GraphQL errors. -export { - GraphQLError, - formatError, - GraphQLFormattedError, - GraphQLErrorLocation, -} from './error'; +export { GraphQLError, formatError, GraphQLFormattedError, GraphQLErrorLocation } from "./error"; // Utilities for operating on GraphQL type schema and parsed sources. export { // The GraphQL query recommended for a full schema introspection. introspectionQuery, - // Gets the target Operation from a Document getOperationAST, - // Build a GraphQLSchema from an introspection result. buildClientSchema, - // Build a GraphQLSchema from a parsed GraphQL Schema language AST. buildASTSchema, - // Build a GraphQLSchema from a GraphQL schema language document. buildSchema, - // Get the description of an AST node getDescription, - // Extends an existing GraphQLSchema from a parsed GraphQL Schema // language AST. extendSchema, - // Print a GraphQLSchema to GraphQL Schema language. printSchema, - // Print a GraphQLType to GraphQL Schema language. printType, - // Create a GraphQLType from a GraphQL language AST. typeFromAST, - // Create a JavaScript value from a GraphQL language AST. valueFromAST, - // Create a GraphQL language AST from a JavaScript value. astFromValue, - // A helper to use within recursive-descent visitors which need to be aware of // the GraphQL type system. TypeInfo, - // Determine if JavaScript values adhere to a GraphQL type. isValidJSValue, - // Determine if AST values adhere to a GraphQL type. isValidLiteralValue, - // Concatenates multiple AST together. concatAST, - // Separates an AST into an AST per Operation. separateOperations, - // Comparators for types isEqualType, isTypeSubTypeOf, doTypesOverlap, - // Asserts a string is a valid GraphQL name. assertValidName, - // Compares two GraphQLSchemas and detects breaking changes. findBreakingChanges, - // Report all deprecated usage within a GraphQL document. findDeprecatedUsages, - BreakingChange, - IntrospectionDirective, IntrospectionEnumType, IntrospectionEnumValue, @@ -172,4 +141,4 @@ export { IntrospectionType, IntrospectionTypeRef, IntrospectionUnionType, -} from './utilities'; +} from "./utilities"; diff --git a/types/graphql/language/ast.d.ts b/types/graphql/language/ast.d.ts index 1873caeb1f..21dbe83361 100644 --- a/types/graphql/language/ast.d.ts +++ b/types/graphql/language/ast.d.ts @@ -1,34 +1,34 @@ -import { Source } from './source'; +import { Source } from "./source"; /** * Contains a range of UTF-8 character offsets and token references that * identify the region of the source from which the AST derived. */ export interface Location { - /** - * The character offset at which this Node begins. - */ - start: number; + /** + * The character offset at which this Node begins. + */ + start: number; - /** - * The character offset at which this Node ends. - */ - end: number; + /** + * The character offset at which this Node ends. + */ + end: number; - /** - * The Token at which this Node begins. - */ - startToken: Token; + /** + * The Token at which this Node begins. + */ + startToken: Token; - /** - * The Token at which this Node ends. - */ - endToken: Token; + /** + * The Token at which this Node ends. + */ + endToken: Token; - /** - * The Source document the AST represents. - */ - source: Source; + /** + * The Source document the AST represents. + */ + source: Source; } /** @@ -37,346 +37,342 @@ export interface Location { * *only*. */ type TokenKind = - | '' - | '' - | '!' - | '$' - | '(' - | ')' - | '...' - | ':' - | '=' - | '@' - | '[' - | ']' - | '{' - | '|' - | '}' - | 'Name' - | 'Int' - | 'Float' - | 'String' - | 'BlockString' - | 'Comment'; + | "" + | "" + | "!" + | "$" + | "(" + | ")" + | "..." + | ":" + | "=" + | "@" + | "[" + | "]" + | "{" + | "|" + | "}" + | "Name" + | "Int" + | "Float" + | "String" + | "BlockString" + | "Comment"; /** * Represents a range of characters represented by a lexical token * within a Source. */ export interface Token { - /** - * The kind of Token. - */ - kind: TokenKind; + /** + * The kind of Token. + */ + kind: TokenKind; - /** - * The character offset at which this Node begins. - */ - start: number; + /** + * The character offset at which this Node begins. + */ + start: number; - /** - * The character offset at which this Node ends. - */ - end: number; + /** + * The character offset at which this Node ends. + */ + end: number; - /** - * The 1-indexed line number on which this Token appears. - */ - line: number; + /** + * The 1-indexed line number on which this Token appears. + */ + line: number; - /** - * The 1-indexed column number at which this Token begins. - */ - column: number; + /** + * The 1-indexed column number at which this Token begins. + */ + column: number; - /** - * For non-punctuation tokens, represents the interpreted value of the token. - */ - value: string | undefined; + /** + * For non-punctuation tokens, represents the interpreted value of the token. + */ + value: string | undefined; - /** - * Tokens exist as nodes in a double-linked-list amongst all tokens - * including ignored tokens. is always the first node and - * the last. - */ - prev?: Token; - next?: Token; + /** + * Tokens exist as nodes in a double-linked-list amongst all tokens + * including ignored tokens. is always the first node and + * the last. + */ + prev?: Token; + next?: Token; } /** * The list of all possible AST node types. */ export type ASTNode = - | NameNode - | DocumentNode - | OperationDefinitionNode - | VariableDefinitionNode - | VariableNode - | SelectionSetNode - | FieldNode - | ArgumentNode - | FragmentSpreadNode - | InlineFragmentNode - | FragmentDefinitionNode - | IntValueNode - | FloatValueNode - | StringValueNode - | BooleanValueNode - | NullValueNode - | EnumValueNode - | ListValueNode - | ObjectValueNode - | ObjectFieldNode - | DirectiveNode - | NamedTypeNode - | ListTypeNode - | NonNullTypeNode - | SchemaDefinitionNode - | OperationTypeDefinitionNode - | ScalarTypeDefinitionNode - | ObjectTypeDefinitionNode - | FieldDefinitionNode - | InputValueDefinitionNode - | InterfaceTypeDefinitionNode - | UnionTypeDefinitionNode - | EnumTypeDefinitionNode - | EnumValueDefinitionNode - | InputObjectTypeDefinitionNode - | ScalarTypeExtensionNode - | ObjectTypeExtensionNode - | InterfaceTypeExtensionNode - | UnionTypeExtensionNode - | EnumTypeExtensionNode - | InputObjectTypeExtensionNode - | DirectiveDefinitionNode; + | NameNode + | DocumentNode + | OperationDefinitionNode + | VariableDefinitionNode + | VariableNode + | SelectionSetNode + | FieldNode + | ArgumentNode + | FragmentSpreadNode + | InlineFragmentNode + | FragmentDefinitionNode + | IntValueNode + | FloatValueNode + | StringValueNode + | BooleanValueNode + | NullValueNode + | EnumValueNode + | ListValueNode + | ObjectValueNode + | ObjectFieldNode + | DirectiveNode + | NamedTypeNode + | ListTypeNode + | NonNullTypeNode + | SchemaDefinitionNode + | OperationTypeDefinitionNode + | ScalarTypeDefinitionNode + | ObjectTypeDefinitionNode + | FieldDefinitionNode + | InputValueDefinitionNode + | InterfaceTypeDefinitionNode + | UnionTypeDefinitionNode + | EnumTypeDefinitionNode + | EnumValueDefinitionNode + | InputObjectTypeDefinitionNode + | ScalarTypeExtensionNode + | ObjectTypeExtensionNode + | InterfaceTypeExtensionNode + | UnionTypeExtensionNode + | EnumTypeExtensionNode + | InputObjectTypeExtensionNode + | DirectiveDefinitionNode; /** * Utility type listing all nodes indexed by their kind. */ export interface ASTKindToNode { - Name: NameNode; - Document: DocumentNode; - OperationDefinition: OperationDefinitionNode; - VariableDefinition: VariableDefinitionNode; - Variable: VariableNode; - SelectionSet: SelectionSetNode; - Field: FieldNode; - Argument: ArgumentNode; - FragmentSpread: FragmentSpreadNode; - InlineFragment: InlineFragmentNode; - FragmentDefinition: FragmentDefinitionNode; - IntValue: IntValueNode; - FloatValue: FloatValueNode; - StringValue: StringValueNode; - BooleanValue: BooleanValueNode; - NullValue: NullValueNode; - EnumValue: EnumValueNode; - ListValue: ListValueNode; - ObjectValue: ObjectValueNode; - ObjectField: ObjectFieldNode; - Directive: DirectiveNode; - NamedType: NamedTypeNode; - ListType: ListTypeNode; - NonNullType: NonNullTypeNode; - SchemaDefinition: SchemaDefinitionNode; - OperationTypeDefinition: OperationTypeDefinitionNode; - ScalarTypeDefinition: ScalarTypeDefinitionNode; - ObjectTypeDefinition: ObjectTypeDefinitionNode; - FieldDefinition: FieldDefinitionNode; - InputValueDefinition: InputValueDefinitionNode; - InterfaceTypeDefinition: InterfaceTypeDefinitionNode; - UnionTypeDefinition: UnionTypeDefinitionNode; - EnumTypeDefinition: EnumTypeDefinitionNode; - EnumValueDefinition: EnumValueDefinitionNode; - InputObjectTypeDefinition: InputObjectTypeDefinitionNode; - ScalarTypeExtension: ScalarTypeExtensionNode; - ObjectTypeExtension: ObjectTypeExtensionNode; - InterfaceTypeExtension: InterfaceTypeExtensionNode; - UnionTypeExtension: UnionTypeExtensionNode; - EnumTypeExtension: EnumTypeExtensionNode; - InputObjectTypeExtension: InputObjectTypeExtensionNode; - DirectiveDefinition: DirectiveDefinitionNode; + Name: NameNode; + Document: DocumentNode; + OperationDefinition: OperationDefinitionNode; + VariableDefinition: VariableDefinitionNode; + Variable: VariableNode; + SelectionSet: SelectionSetNode; + Field: FieldNode; + Argument: ArgumentNode; + FragmentSpread: FragmentSpreadNode; + InlineFragment: InlineFragmentNode; + FragmentDefinition: FragmentDefinitionNode; + IntValue: IntValueNode; + FloatValue: FloatValueNode; + StringValue: StringValueNode; + BooleanValue: BooleanValueNode; + NullValue: NullValueNode; + EnumValue: EnumValueNode; + ListValue: ListValueNode; + ObjectValue: ObjectValueNode; + ObjectField: ObjectFieldNode; + Directive: DirectiveNode; + NamedType: NamedTypeNode; + ListType: ListTypeNode; + NonNullType: NonNullTypeNode; + SchemaDefinition: SchemaDefinitionNode; + OperationTypeDefinition: OperationTypeDefinitionNode; + ScalarTypeDefinition: ScalarTypeDefinitionNode; + ObjectTypeDefinition: ObjectTypeDefinitionNode; + FieldDefinition: FieldDefinitionNode; + InputValueDefinition: InputValueDefinitionNode; + InterfaceTypeDefinition: InterfaceTypeDefinitionNode; + UnionTypeDefinition: UnionTypeDefinitionNode; + EnumTypeDefinition: EnumTypeDefinitionNode; + EnumValueDefinition: EnumValueDefinitionNode; + InputObjectTypeDefinition: InputObjectTypeDefinitionNode; + ScalarTypeExtension: ScalarTypeExtensionNode; + ObjectTypeExtension: ObjectTypeExtensionNode; + InterfaceTypeExtension: InterfaceTypeExtensionNode; + UnionTypeExtension: UnionTypeExtensionNode; + EnumTypeExtension: EnumTypeExtensionNode; + InputObjectTypeExtension: InputObjectTypeExtensionNode; + DirectiveDefinition: DirectiveDefinitionNode; } // Name export interface NameNode { - kind: 'Name'; - loc?: Location; - value: string; + kind: "Name"; + loc?: Location; + value: string; } // Document export interface DocumentNode { - kind: 'Document'; - loc?: Location; - definitions: DefinitionNode[]; + kind: "Document"; + loc?: Location; + definitions: DefinitionNode[]; } -export type DefinitionNode = - | ExecutableDefinitionNode - | TypeSystemDefinitionNode; // experimental non-spec addition. +export type DefinitionNode = ExecutableDefinitionNode | TypeSystemDefinitionNode; // experimental non-spec addition. -export type ExecutableDefinitionNode = - | OperationDefinitionNode - | FragmentDefinitionNode; +export type ExecutableDefinitionNode = OperationDefinitionNode | FragmentDefinitionNode; export interface OperationDefinitionNode { - kind: 'OperationDefinition'; - loc?: Location; - operation: OperationTypeNode; - name?: NameNode; - variableDefinitions?: VariableDefinitionNode[]; - directives?: DirectiveNode[]; - selectionSet: SelectionSetNode; + kind: "OperationDefinition"; + loc?: Location; + operation: OperationTypeNode; + name?: NameNode; + variableDefinitions?: VariableDefinitionNode[]; + directives?: DirectiveNode[]; + selectionSet: SelectionSetNode; } // Note: subscription is an experimental non-spec addition. -export type OperationTypeNode = 'query' | 'mutation' | 'subscription'; +export type OperationTypeNode = "query" | "mutation" | "subscription"; export interface VariableDefinitionNode { - kind: 'VariableDefinition'; - loc?: Location; - variable: VariableNode; - type: TypeNode; - defaultValue?: ValueNode; + kind: "VariableDefinition"; + loc?: Location; + variable: VariableNode; + type: TypeNode; + defaultValue?: ValueNode; } export interface VariableNode { - kind: 'Variable'; - loc?: Location; - name: NameNode; + kind: "Variable"; + loc?: Location; + name: NameNode; } export interface SelectionSetNode { - kind: 'SelectionSet'; - loc?: Location; - selections: SelectionNode[]; + kind: "SelectionSet"; + loc?: Location; + selections: SelectionNode[]; } export type SelectionNode = FieldNode | FragmentSpreadNode | InlineFragmentNode; export interface FieldNode { - kind: 'Field'; - loc?: Location; - alias?: NameNode; - name: NameNode; - arguments?: ArgumentNode[]; - directives?: DirectiveNode[]; - selectionSet?: SelectionSetNode; + kind: "Field"; + loc?: Location; + alias?: NameNode; + name: NameNode; + arguments?: ArgumentNode[]; + directives?: DirectiveNode[]; + selectionSet?: SelectionSetNode; } export interface ArgumentNode { - kind: 'Argument'; - loc?: Location; - name: NameNode; - value: ValueNode; + kind: "Argument"; + loc?: Location; + name: NameNode; + value: ValueNode; } // Fragments export interface FragmentSpreadNode { - kind: 'FragmentSpread'; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; + kind: "FragmentSpread"; + loc?: Location; + name: NameNode; + directives?: DirectiveNode[]; } export interface InlineFragmentNode { - kind: 'InlineFragment'; - loc?: Location; - typeCondition?: NamedTypeNode; - directives?: DirectiveNode[]; - selectionSet: SelectionSetNode; + kind: "InlineFragment"; + loc?: Location; + typeCondition?: NamedTypeNode; + directives?: DirectiveNode[]; + selectionSet: SelectionSetNode; } export interface FragmentDefinitionNode { - kind: 'FragmentDefinition'; - loc?: Location; - name: NameNode; - // Note: fragment variable definitions are experimental and may be changed - // or removed in the future. - variableDefinitions?: VariableDefinitionNode[]; - typeCondition: NamedTypeNode; - directives?: DirectiveNode[]; - selectionSet: SelectionSetNode; + kind: "FragmentDefinition"; + loc?: Location; + name: NameNode; + // Note: fragment variable definitions are experimental and may be changed + // or removed in the future. + variableDefinitions?: VariableDefinitionNode[]; + typeCondition: NamedTypeNode; + directives?: DirectiveNode[]; + selectionSet: SelectionSetNode; } // Values export type ValueNode = - | VariableNode - | IntValueNode - | FloatValueNode - | StringValueNode - | BooleanValueNode - | NullValueNode - | EnumValueNode - | ListValueNode - | ObjectValueNode; + | VariableNode + | IntValueNode + | FloatValueNode + | StringValueNode + | BooleanValueNode + | NullValueNode + | EnumValueNode + | ListValueNode + | ObjectValueNode; export interface IntValueNode { - kind: 'IntValue'; - loc?: Location; - value: string; + kind: "IntValue"; + loc?: Location; + value: string; } export interface FloatValueNode { - kind: 'FloatValue'; - loc?: Location; - value: string; + kind: "FloatValue"; + loc?: Location; + value: string; } export interface StringValueNode { - kind: 'StringValue'; - loc?: Location; - value: string; + kind: "StringValue"; + loc?: Location; + value: string; } export interface BooleanValueNode { - kind: 'BooleanValue'; - loc?: Location; - value: boolean; + kind: "BooleanValue"; + loc?: Location; + value: boolean; } export interface NullValueNode { - kind: 'NullValue'; - loc?: Location; + kind: "NullValue"; + loc?: Location; } export interface EnumValueNode { - kind: 'EnumValue'; - loc?: Location; - value: string; + kind: "EnumValue"; + loc?: Location; + value: string; } export interface ListValueNode { - kind: 'ListValue'; - loc?: Location; - values: ValueNode[]; + kind: "ListValue"; + loc?: Location; + values: ValueNode[]; } export interface ObjectValueNode { - kind: 'ObjectValue'; - loc?: Location; - fields: ObjectFieldNode[]; + kind: "ObjectValue"; + loc?: Location; + fields: ObjectFieldNode[]; } export interface ObjectFieldNode { - kind: 'ObjectField'; - loc?: Location; - name: NameNode; - value: ValueNode; + kind: "ObjectField"; + loc?: Location; + name: NameNode; + value: ValueNode; } // Directives export interface DirectiveNode { - kind: 'Directive'; - loc?: Location; - name: NameNode; - arguments?: ArgumentNode[]; + kind: "Directive"; + loc?: Location; + name: NameNode; + arguments?: ArgumentNode[]; } // Type Reference @@ -384,198 +380,198 @@ export interface DirectiveNode { export type TypeNode = NamedTypeNode | ListTypeNode | NonNullTypeNode; export interface NamedTypeNode { - kind: 'NamedType'; - loc?: Location; - name: NameNode; + kind: "NamedType"; + loc?: Location; + name: NameNode; } export interface ListTypeNode { - kind: 'ListType'; - loc?: Location; - type: TypeNode; + kind: "ListType"; + loc?: Location; + type: TypeNode; } export interface NonNullTypeNode { - kind: 'NonNullType'; - loc?: Location; - type: NamedTypeNode | ListTypeNode; + kind: "NonNullType"; + loc?: Location; + type: NamedTypeNode | ListTypeNode; } // Type System Definition export type TypeSystemDefinitionNode = - | SchemaDefinitionNode - | TypeDefinitionNode - | TypeExtensionNode - | DirectiveDefinitionNode; + | SchemaDefinitionNode + | TypeDefinitionNode + | TypeExtensionNode + | DirectiveDefinitionNode; export interface SchemaDefinitionNode { - kind: 'SchemaDefinition'; - loc?: Location; - directives: DirectiveNode[]; - operationTypes: OperationTypeDefinitionNode[]; + kind: "SchemaDefinition"; + loc?: Location; + directives: DirectiveNode[]; + operationTypes: OperationTypeDefinitionNode[]; } export interface OperationTypeDefinitionNode { - kind: 'OperationTypeDefinition'; - loc?: Location; - operation: OperationTypeNode; - type: NamedTypeNode; + kind: "OperationTypeDefinition"; + loc?: Location; + operation: OperationTypeNode; + type: NamedTypeNode; } export type TypeDefinitionNode = - | ScalarTypeDefinitionNode - | ObjectTypeDefinitionNode - | InterfaceTypeDefinitionNode - | UnionTypeDefinitionNode - | EnumTypeDefinitionNode - | InputObjectTypeDefinitionNode; + | ScalarTypeDefinitionNode + | ObjectTypeDefinitionNode + | InterfaceTypeDefinitionNode + | UnionTypeDefinitionNode + | EnumTypeDefinitionNode + | InputObjectTypeDefinitionNode; export interface ScalarTypeDefinitionNode { - kind: 'ScalarTypeDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; + kind: "ScalarTypeDefinition"; + loc?: Location; + description?: StringValueNode; + name: NameNode; + directives?: DirectiveNode[]; } export interface ObjectTypeDefinitionNode { - kind: 'ObjectTypeDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - interfaces?: NamedTypeNode[]; - directives?: DirectiveNode[]; - fields: FieldDefinitionNode[]; + kind: "ObjectTypeDefinition"; + loc?: Location; + description?: StringValueNode; + name: NameNode; + interfaces?: NamedTypeNode[]; + directives?: DirectiveNode[]; + fields: FieldDefinitionNode[]; } export interface FieldDefinitionNode { - kind: 'FieldDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - arguments: InputValueDefinitionNode[]; - type: TypeNode; - directives?: DirectiveNode[]; + kind: "FieldDefinition"; + loc?: Location; + description?: StringValueNode; + name: NameNode; + arguments: InputValueDefinitionNode[]; + type: TypeNode; + directives?: DirectiveNode[]; } export interface InputValueDefinitionNode { - kind: 'InputValueDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - type: TypeNode; - defaultValue?: ValueNode; - directives?: DirectiveNode[]; + kind: "InputValueDefinition"; + loc?: Location; + description?: StringValueNode; + name: NameNode; + type: TypeNode; + defaultValue?: ValueNode; + directives?: DirectiveNode[]; } export interface InterfaceTypeDefinitionNode { - kind: 'InterfaceTypeDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; - fields: FieldDefinitionNode[]; + kind: "InterfaceTypeDefinition"; + loc?: Location; + description?: StringValueNode; + name: NameNode; + directives?: DirectiveNode[]; + fields: FieldDefinitionNode[]; } export interface UnionTypeDefinitionNode { - kind: 'UnionTypeDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; - types: NamedTypeNode[]; + kind: "UnionTypeDefinition"; + loc?: Location; + description?: StringValueNode; + name: NameNode; + directives?: DirectiveNode[]; + types: NamedTypeNode[]; } export interface EnumTypeDefinitionNode { - kind: 'EnumTypeDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; - values: EnumValueDefinitionNode[]; + kind: "EnumTypeDefinition"; + loc?: Location; + description?: StringValueNode; + name: NameNode; + directives?: DirectiveNode[]; + values: EnumValueDefinitionNode[]; } export interface EnumValueDefinitionNode { - kind: 'EnumValueDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; + kind: "EnumValueDefinition"; + loc?: Location; + description?: StringValueNode; + name: NameNode; + directives?: DirectiveNode[]; } export interface InputObjectTypeDefinitionNode { - kind: 'InputObjectTypeDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; - fields: InputValueDefinitionNode[]; + kind: "InputObjectTypeDefinition"; + loc?: Location; + description?: StringValueNode; + name: NameNode; + directives?: DirectiveNode[]; + fields: InputValueDefinitionNode[]; } export type TypeExtensionNode = - | ScalarTypeExtensionNode - | ObjectTypeExtensionNode - | InterfaceTypeExtensionNode - | UnionTypeExtensionNode - | EnumTypeExtensionNode - | InputObjectTypeExtensionNode; + | ScalarTypeExtensionNode + | ObjectTypeExtensionNode + | InterfaceTypeExtensionNode + | UnionTypeExtensionNode + | EnumTypeExtensionNode + | InputObjectTypeExtensionNode; export type ScalarTypeExtensionNode = { - kind: 'ScalarTypeExtension'; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; + kind: "ScalarTypeExtension"; + loc?: Location; + name: NameNode; + directives?: DirectiveNode[]; }; export type ObjectTypeExtensionNode = { - kind: 'ObjectTypeExtension'; - loc?: Location; - name: NameNode; - interfaces?: NamedTypeNode[]; - directives?: DirectiveNode[]; - fields?: FieldDefinitionNode[]; + kind: "ObjectTypeExtension"; + loc?: Location; + name: NameNode; + interfaces?: NamedTypeNode[]; + directives?: DirectiveNode[]; + fields?: FieldDefinitionNode[]; }; export type InterfaceTypeExtensionNode = { - kind: 'InterfaceTypeExtension'; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; - fields?: FieldDefinitionNode[]; + kind: "InterfaceTypeExtension"; + loc?: Location; + name: NameNode; + directives?: DirectiveNode[]; + fields?: FieldDefinitionNode[]; }; export type UnionTypeExtensionNode = { - kind: 'UnionTypeExtension'; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; - types?: NamedTypeNode[]; + kind: "UnionTypeExtension"; + loc?: Location; + name: NameNode; + directives?: DirectiveNode[]; + types?: NamedTypeNode[]; }; export type EnumTypeExtensionNode = { - kind: 'EnumTypeExtension'; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; - values?: EnumValueDefinitionNode[]; + kind: "EnumTypeExtension"; + loc?: Location; + name: NameNode; + directives?: DirectiveNode[]; + values?: EnumValueDefinitionNode[]; }; export type InputObjectTypeExtensionNode = { - kind: 'InputObjectTypeExtension'; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; - fields?: InputValueDefinitionNode[]; + kind: "InputObjectTypeExtension"; + loc?: Location; + name: NameNode; + directives?: DirectiveNode[]; + fields?: InputValueDefinitionNode[]; }; // Directive Definitions export interface DirectiveDefinitionNode { - kind: 'DirectiveDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - arguments?: InputValueDefinitionNode[]; - locations: NameNode[]; + kind: "DirectiveDefinition"; + loc?: Location; + description?: StringValueNode; + name: NameNode; + arguments?: InputValueDefinitionNode[]; + locations: NameNode[]; } diff --git a/types/graphql/language/index.d.ts b/types/graphql/language/index.d.ts index c8fe4b13ec..db088e6925 100644 --- a/types/graphql/language/index.d.ts +++ b/types/graphql/language/index.d.ts @@ -1,15 +1,9 @@ -export * from './ast'; -export { getLocation } from './location'; -import * as Kind from './kinds'; +export * from "./ast"; +export { getLocation } from "./location"; +import * as Kind from "./kinds"; export { Kind }; -export { createLexer, TokenKind, Lexer } from './lexer'; -export { parse, parseValue, parseType, ParseOptions } from './parser'; -export { print } from './printer'; -export { Source } from './source'; -export { - visit, - visitInParallel, - visitWithTypeInfo, - getVisitFn, - BREAK, -} from './visitor'; +export { createLexer, TokenKind, Lexer } from "./lexer"; +export { parse, parseValue, parseType, ParseOptions } from "./parser"; +export { print } from "./printer"; +export { Source } from "./source"; +export { visit, visitInParallel, visitWithTypeInfo, getVisitFn, BREAK } from "./visitor"; diff --git a/types/graphql/language/kinds.d.ts b/types/graphql/language/kinds.d.ts index f92826f891..2e7db3ad87 100644 --- a/types/graphql/language/kinds.d.ts +++ b/types/graphql/language/kinds.d.ts @@ -1,72 +1,72 @@ // Name -export const NAME: 'Name'; +export const NAME: "Name"; // Document -export const DOCUMENT: 'Document'; -export const OPERATION_DEFINITION: 'OperationDefinition'; -export const VARIABLE_DEFINITION: 'VariableDefinition'; -export const VARIABLE: 'Variable'; -export const SELECTION_SET: 'SelectionSet'; -export const FIELD: 'Field'; -export const ARGUMENT: 'Argument'; +export const DOCUMENT: "Document"; +export const OPERATION_DEFINITION: "OperationDefinition"; +export const VARIABLE_DEFINITION: "VariableDefinition"; +export const VARIABLE: "Variable"; +export const SELECTION_SET: "SelectionSet"; +export const FIELD: "Field"; +export const ARGUMENT: "Argument"; // Fragments -export const FRAGMENT_SPREAD: 'FragmentSpread'; -export const INLINE_FRAGMENT: 'InlineFragment'; -export const FRAGMENT_DEFINITION: 'FragmentDefinition'; +export const FRAGMENT_SPREAD: "FragmentSpread"; +export const INLINE_FRAGMENT: "InlineFragment"; +export const FRAGMENT_DEFINITION: "FragmentDefinition"; // Values -export const INT: 'IntValue'; -export const FLOAT: 'FloatValue'; -export const STRING: 'StringValue'; -export const BOOLEAN: 'BooleanValue'; -export const NULL: 'NullValue'; -export const ENUM: 'EnumValue'; -export const LIST: 'ListValue'; -export const OBJECT: 'ObjectValue'; -export const OBJECT_FIELD: 'ObjectField'; +export const INT: "IntValue"; +export const FLOAT: "FloatValue"; +export const STRING: "StringValue"; +export const BOOLEAN: "BooleanValue"; +export const NULL: "NullValue"; +export const ENUM: "EnumValue"; +export const LIST: "ListValue"; +export const OBJECT: "ObjectValue"; +export const OBJECT_FIELD: "ObjectField"; // Directives -export const DIRECTIVE: 'Directive'; +export const DIRECTIVE: "Directive"; // Types -export const NAMED_TYPE: 'NamedType'; -export const LIST_TYPE: 'ListType'; -export const NON_NULL_TYPE: 'NonNullType'; +export const NAMED_TYPE: "NamedType"; +export const LIST_TYPE: "ListType"; +export const NON_NULL_TYPE: "NonNullType"; // Type System Definitions -export const SCHEMA_DEFINITION: 'SchemaDefinition'; -export const OPERATION_TYPE_DEFINITION: 'OperationTypeDefinition'; +export const SCHEMA_DEFINITION: "SchemaDefinition"; +export const OPERATION_TYPE_DEFINITION: "OperationTypeDefinition"; // Type Definitions -export const SCALAR_TYPE_DEFINITION: 'ScalarTypeDefinition'; -export const OBJECT_TYPE_DEFINITION: 'ObjectTypeDefinition'; -export const FIELD_DEFINITION: 'FieldDefinition'; -export const INPUT_VALUE_DEFINITION: 'InputValueDefinition'; -export const INTERFACE_TYPE_DEFINITION: 'InterfaceTypeDefinition'; -export const UNION_TYPE_DEFINITION: 'UnionTypeDefinition'; -export const ENUM_TYPE_DEFINITION: 'EnumTypeDefinition'; -export const ENUM_VALUE_DEFINITION: 'EnumValueDefinition'; -export const INPUT_OBJECT_TYPE_DEFINITION: 'InputObjectTypeDefinition'; +export const SCALAR_TYPE_DEFINITION: "ScalarTypeDefinition"; +export const OBJECT_TYPE_DEFINITION: "ObjectTypeDefinition"; +export const FIELD_DEFINITION: "FieldDefinition"; +export const INPUT_VALUE_DEFINITION: "InputValueDefinition"; +export const INTERFACE_TYPE_DEFINITION: "InterfaceTypeDefinition"; +export const UNION_TYPE_DEFINITION: "UnionTypeDefinition"; +export const ENUM_TYPE_DEFINITION: "EnumTypeDefinition"; +export const ENUM_VALUE_DEFINITION: "EnumValueDefinition"; +export const INPUT_OBJECT_TYPE_DEFINITION: "InputObjectTypeDefinition"; // Type Extensions -export const TYPE_EXTENSION_DEFINITION: 'TypeExtensionDefinition'; -export const SCALAR_TYPE_EXTENSION: 'ScalarTypeExtension'; -export const OBJECT_TYPE_EXTENSION: 'ObjectTypeExtension'; -export const INTERFACE_TYPE_EXTENSION: 'InterfaceTypeExtension'; -export const UNION_TYPE_EXTENSION: 'UnionTypeExtension'; -export const ENUM_TYPE_EXTENSION: 'EnumTypeExtension'; -export const INPUT_OBJECT_TYPE_EXTENSION: 'InputObjectTypeExtension'; +export const TYPE_EXTENSION_DEFINITION: "TypeExtensionDefinition"; +export const SCALAR_TYPE_EXTENSION: "ScalarTypeExtension"; +export const OBJECT_TYPE_EXTENSION: "ObjectTypeExtension"; +export const INTERFACE_TYPE_EXTENSION: "InterfaceTypeExtension"; +export const UNION_TYPE_EXTENSION: "UnionTypeExtension"; +export const ENUM_TYPE_EXTENSION: "EnumTypeExtension"; +export const INPUT_OBJECT_TYPE_EXTENSION: "InputObjectTypeExtension"; // Directive Definitions -export const DIRECTIVE_DEFINITION: 'DirectiveDefinition'; +export const DIRECTIVE_DEFINITION: "DirectiveDefinition"; diff --git a/types/graphql/language/lexer.d.ts b/types/graphql/language/lexer.d.ts index 0db85434e2..27db5b04cc 100644 --- a/types/graphql/language/lexer.d.ts +++ b/types/graphql/language/lexer.d.ts @@ -1,6 +1,6 @@ -import { Token } from './ast'; -import { Source } from './source'; -import { syntaxError } from '../error'; +import { Token } from "./ast"; +import { Source } from "./source"; +import { syntaxError } from "../error"; /** * Given a Source object, this returns a Lexer for that source. @@ -10,42 +10,39 @@ import { syntaxError } from '../error'; * EOF, after which the lexer will repeatedly return the same EOF token * whenever called. */ -export function createLexer( - source: Source, - options: TOptions, -): Lexer; +export function createLexer(source: Source, options: TOptions): Lexer; /** * The return type of createLexer. */ export interface Lexer { - source: Source; - options: TOptions; + source: Source; + options: TOptions; - /** - * The previously focused non-ignored token. - */ - lastToken: Token; + /** + * The previously focused non-ignored token. + */ + lastToken: Token; - /** - * The currently focused non-ignored token. - */ - token: Token; + /** + * The currently focused non-ignored token. + */ + token: Token; - /** - * The (1-indexed) line containing the current token. - */ - line: number; + /** + * The (1-indexed) line containing the current token. + */ + line: number; - /** - * The character offset at which the current line begins. - */ - lineStart: number; + /** + * The character offset at which the current line begins. + */ + lineStart: number; - /** - * Advances the token stream to the next non-ignored token. - */ - advance(): Token; + /** + * Advances the token stream to the next non-ignored token. + */ + advance(): Token; } /** @@ -53,26 +50,26 @@ export interface Lexer { * lexer emits. */ export const TokenKind: { - SOF: ''; - EOF: ''; - BANG: '!'; - DOLLAR: '$'; - PAREN_L: '('; - PAREN_R: ')'; - SPREAD: '...'; - COLON: ':'; - EQUALS: '='; - AT: '@'; - BRACKET_L: '['; - BRACKET_R: ']'; - BRACE_L: '{'; - PIPE: '|'; - BRACE_R: '}'; - NAME: 'Name'; - INT: 'Int'; - FLOAT: 'Float'; - STRING: 'String'; - COMMENT: 'Comment'; + SOF: ""; + EOF: ""; + BANG: "!"; + DOLLAR: "$"; + PAREN_L: "("; + PAREN_R: ")"; + SPREAD: "..."; + COLON: ":"; + EQUALS: "="; + AT: "@"; + BRACKET_L: "["; + BRACKET_R: "]"; + BRACE_L: "{"; + PIPE: "|"; + BRACE_R: "}"; + NAME: "Name"; + INT: "Int"; + FLOAT: "Float"; + STRING: "String"; + COMMENT: "Comment"; }; /** diff --git a/types/graphql/language/location.d.ts b/types/graphql/language/location.d.ts index cb9744e0d5..4d7a13e314 100644 --- a/types/graphql/language/location.d.ts +++ b/types/graphql/language/location.d.ts @@ -1,8 +1,8 @@ -import { Source } from './source'; +import { Source } from "./source"; export interface SourceLocation { - line: number; - column: number; + line: number; + column: number; } export function getLocation(source: Source, position: number): SourceLocation; diff --git a/types/graphql/language/parser.d.ts b/types/graphql/language/parser.d.ts index ffafaae7fb..3cdb3462ae 100644 --- a/types/graphql/language/parser.d.ts +++ b/types/graphql/language/parser.d.ts @@ -1,66 +1,62 @@ -import { NamedTypeNode, TypeNode, ValueNode, DocumentNode } from './ast'; -import { Source } from './source'; -import { Lexer } from './lexer'; +import { NamedTypeNode, TypeNode, ValueNode, DocumentNode } from "./ast"; +import { Source } from "./source"; +import { Lexer } from "./lexer"; /** * Configuration options to control parser behavior */ export interface ParseOptions { + /** + * By default, the parser creates AST nodes that know the location + * in the source that they correspond to. This configuration flag + * disables that behavior for performance or testing. + */ + noLocation?: boolean; - /** - * By default, the parser creates AST nodes that know the location - * in the source that they correspond to. This configuration flag - * disables that behavior for performance or testing. - */ - noLocation?: boolean, + /** + * If enabled, the parser will parse empty fields sets in the Schema + * Definition Language. Otherwise, the parser will follow the current + * specification. + * + * This option is provided to ease adoption of the final SDL specification + * and will be removed in a future major release. + */ + allowLegacySDLEmptyFields?: boolean; - /** - * If enabled, the parser will parse empty fields sets in the Schema - * Definition Language. Otherwise, the parser will follow the current - * specification. - * - * This option is provided to ease adoption of the final SDL specification - * and will be removed in a future major release. - */ - allowLegacySDLEmptyFields?: boolean, + /** + * If enabled, the parser will parse implemented interfaces with no `&` + * character between each interface. Otherwise, the parser will follow the + * current specification. + * + * This option is provided to ease adoption of the final SDL specification + * and will be removed in a future major release. + */ + allowLegacySDLImplementsInterfaces?: boolean; - /** - * If enabled, the parser will parse implemented interfaces with no `&` - * character between each interface. Otherwise, the parser will follow the - * current specification. - * - * This option is provided to ease adoption of the final SDL specification - * and will be removed in a future major release. - */ - allowLegacySDLImplementsInterfaces?: boolean, - - /** - * EXPERIMENTAL: - * - * If enabled, the parser will understand and parse variable definitions - * contained in a fragment definition. They'll be represented in the - * `variableDefinitions` field of the FragmentDefinitionNode. - * - * The syntax is identical to normal, query-defined variables. For example: - * - * fragment A($var: Boolean = false) on T { - * ... - * } - * - * Note: this feature is experimental and may change or be removed in the - * future. - */ - experimentalFragmentVariables?: boolean, + /** + * EXPERIMENTAL: + * + * If enabled, the parser will understand and parse variable definitions + * contained in a fragment definition. They'll be represented in the + * `variableDefinitions` field of the FragmentDefinitionNode. + * + * The syntax is identical to normal, query-defined variables. For example: + * + * fragment A($var: Boolean = false) on T { + * ... + * } + * + * Note: this feature is experimental and may change or be removed in the + * future. + */ + experimentalFragmentVariables?: boolean; } /** * Given a GraphQL source, parses it into a Document. * Throws GraphQLError if a syntax error is encountered. */ -export function parse( - source: string | Source, - options?: ParseOptions, -): DocumentNode; +export function parse(source: string | Source, options?: ParseOptions): DocumentNode; /** * Given a string containing a GraphQL value, parse the AST for that value. @@ -69,10 +65,7 @@ export function parse( * This is useful within tools that operate upon GraphQL Values directly and * in isolation of complete GraphQL documents. */ -export function parseValue( - source: Source | string, - options?: ParseOptions, -): ValueNode; +export function parseValue(source: Source | string, options?: ParseOptions): ValueNode; /** * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for @@ -84,10 +77,7 @@ export function parseValue( * * Consider providing the results to the utility function: typeFromAST(). */ -export function parseType( - source: Source | string, - options?: ParseOptions, -): TypeNode; +export function parseType(source: Source | string, options?: ParseOptions): TypeNode; export function parseConstValue(lexer: Lexer): ValueNode; diff --git a/types/graphql/language/source.d.ts b/types/graphql/language/source.d.ts index 236028b7df..80e68f5557 100644 --- a/types/graphql/language/source.d.ts +++ b/types/graphql/language/source.d.ts @@ -1,5 +1,5 @@ export class Source { - body: string; - name: string; - constructor(body: string, name?: string); + body: string; + name: string; + constructor(body: string, name?: string); } diff --git a/types/graphql/language/visitor.d.ts b/types/graphql/language/visitor.d.ts index e7e9d67da0..320d181e4a 100644 --- a/types/graphql/language/visitor.d.ts +++ b/types/graphql/language/visitor.d.ts @@ -1,43 +1,43 @@ export const QueryDocumentKeys: { - Name: any[]; - Document: string[]; - OperationDefinition: string[]; - VariableDefinition: string[]; - Variable: string[]; - SelectionSet: string[]; - Field: string[]; - Argument: string[]; + Name: any[]; + Document: string[]; + OperationDefinition: string[]; + VariableDefinition: string[]; + Variable: string[]; + SelectionSet: string[]; + Field: string[]; + Argument: string[]; - FragmentSpread: string[]; - InlineFragment: string[]; - FragmentDefinition: string[]; + FragmentSpread: string[]; + InlineFragment: string[]; + FragmentDefinition: string[]; - IntValue: number[]; - FloatValue: number[]; - StringValue: string[]; - BooleanValue: boolean[]; - NullValue: null[]; - EnumValue: any[]; - ListValue: string[]; - ObjectValue: string[]; - ObjectField: string[]; + IntValue: number[]; + FloatValue: number[]; + StringValue: string[]; + BooleanValue: boolean[]; + NullValue: null[]; + EnumValue: any[]; + ListValue: string[]; + ObjectValue: string[]; + ObjectField: string[]; - Directive: string[]; + Directive: string[]; - NamedType: string[]; - ListType: string[]; - NonNullType: string[]; + NamedType: string[]; + ListType: string[]; + NonNullType: string[]; - ObjectTypeDefinition: string[]; - FieldDefinition: string[]; - InputValueDefinition: string[]; - InterfaceTypeDefinition: string[]; - UnionTypeDefinition: string[]; - ScalarTypeDefinition: string[]; - EnumTypeDefinition: string[]; - EnumValueDefinition: string[]; - InputObjectTypeDefinition: string[]; - TypeExtensionDefinition: string[]; + ObjectTypeDefinition: string[]; + FieldDefinition: string[]; + InputValueDefinition: string[]; + InterfaceTypeDefinition: string[]; + UnionTypeDefinition: string[]; + ScalarTypeDefinition: string[]; + EnumTypeDefinition: string[]; + EnumValueDefinition: string[]; + InputObjectTypeDefinition: string[]; + TypeExtensionDefinition: string[]; }; export const BREAK: any; diff --git a/types/graphql/subscription/index.d.ts b/types/graphql/subscription/index.d.ts index 11b0a7f26d..71583e7ff3 100644 --- a/types/graphql/subscription/index.d.ts +++ b/types/graphql/subscription/index.d.ts @@ -1 +1 @@ -export { subscribe, createSourceEventStream } from './subscribe'; +export { subscribe, createSourceEventStream } from "./subscribe"; diff --git a/types/graphql/subscription/subscribe.d.ts b/types/graphql/subscription/subscribe.d.ts index dc2c096b86..c4eec87ac9 100644 --- a/types/graphql/subscription/subscribe.d.ts +++ b/types/graphql/subscription/subscribe.d.ts @@ -1,29 +1,29 @@ -import { GraphQLSchema } from '../type/schema'; -import { DocumentNode } from '../language/ast'; -import { GraphQLFieldResolver } from '../type/definition'; -import { ExecutionResult } from '../execution/execute'; +import { GraphQLSchema } from "../type/schema"; +import { DocumentNode } from "../language/ast"; +import { GraphQLFieldResolver } from "../type/definition"; +import { ExecutionResult } from "../execution/execute"; export function subscribe( - schema: GraphQLSchema, - document: DocumentNode, - rootValue?: any, - contextValue?: any, - variableValues?: { - [key: string]: any; - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver, - subscribeFieldResolver?: GraphQLFieldResolver, + schema: GraphQLSchema, + document: DocumentNode, + rootValue?: any, + contextValue?: any, + variableValues?: { + [key: string]: any; + }, + operationName?: string, + fieldResolver?: GraphQLFieldResolver, + subscribeFieldResolver?: GraphQLFieldResolver ): Promise | ExecutionResult>; export function createSourceEventStream( - schema: GraphQLSchema, - document: DocumentNode, - rootValue?: any, - contextValue?: any, - variableValues?: { - [key: string]: any; - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver, + schema: GraphQLSchema, + document: DocumentNode, + rootValue?: any, + contextValue?: any, + variableValues?: { + [key: string]: any; + }, + operationName?: string, + fieldResolver?: GraphQLFieldResolver ): Promise>; diff --git a/types/graphql/type/definition.d.ts b/types/graphql/type/definition.d.ts index 098f7376ef..b31ac6bbed 100644 --- a/types/graphql/type/definition.d.ts +++ b/types/graphql/type/definition.d.ts @@ -1,33 +1,33 @@ import { - ScalarTypeDefinitionNode, - ObjectTypeDefinitionNode, - FieldDefinitionNode, - InputValueDefinitionNode, - InterfaceTypeDefinitionNode, - UnionTypeDefinitionNode, - EnumTypeDefinitionNode, - EnumValueDefinitionNode, - InputObjectTypeDefinitionNode, - TypeExtensionNode, - OperationDefinitionNode, - FieldNode, - FragmentDefinitionNode, - ValueNode, -} from '../language/ast'; -import { GraphQLSchema } from './schema'; + ScalarTypeDefinitionNode, + ObjectTypeDefinitionNode, + FieldDefinitionNode, + InputValueDefinitionNode, + InterfaceTypeDefinitionNode, + UnionTypeDefinitionNode, + EnumTypeDefinitionNode, + EnumValueDefinitionNode, + InputObjectTypeDefinitionNode, + TypeExtensionNode, + OperationDefinitionNode, + FieldNode, + FragmentDefinitionNode, + ValueNode, +} from "../language/ast"; +import { GraphQLSchema } from "./schema"; /** * These are all of the possible kinds of types. */ export type GraphQLType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList - | GraphQLNonNull; + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList + | GraphQLNonNull; export function isType(type: any): type is GraphQLType; @@ -37,16 +37,11 @@ export function assertType(type: any): GraphQLType; * These types may be used as input types for arguments and directives. */ export type GraphQLInputType = - | GraphQLScalarType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList - | GraphQLNonNull< - | GraphQLScalarType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList - >; + | GraphQLScalarType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList + | GraphQLNonNull>; export function isInputType(type: GraphQLType): type is GraphQLInputType; @@ -56,20 +51,20 @@ export function assertInputType(type: GraphQLType): GraphQLInputType; * These types may be used as output types as the result of fields. */ export type GraphQLOutputType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLList - | GraphQLNonNull< - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLList - >; + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLList + | GraphQLNonNull< + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLList + >; export function isOutputType(type: GraphQLType): type is GraphQLOutputType; @@ -87,14 +82,9 @@ export function assertLeafType(type: GraphQLType): GraphQLLeafType; /** * These types may describe the parent context of a selection set. */ -export type GraphQLCompositeType = - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType; +export type GraphQLCompositeType = GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType; -export function isCompositeType( - type: GraphQLType, -): type is GraphQLCompositeType; +export function isCompositeType(type: GraphQLType): type is GraphQLCompositeType; export function assertCompositeType(type: GraphQLType): GraphQLCompositeType; @@ -111,28 +101,26 @@ export function assertAbstractType(type: GraphQLType): GraphQLAbstractType; * These types can all accept null as a value. */ export type GraphQLNullableType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList; + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList; -export function getNullableType( - type: T, -): T & GraphQLNullableType; +export function getNullableType(type: T): T & GraphQLNullableType; /** * These named types do not include modifiers like List or NonNull. */ export type GraphQLNamedType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLInputObjectType; + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLInputObjectType; export function isNamedType(type: GraphQLType): boolean; @@ -164,30 +152,30 @@ export type Thunk = (() => T) | T; * */ export class GraphQLScalarType { - name: string; - description: string; - astNode?: ScalarTypeDefinitionNode; - constructor(config: GraphQLScalarTypeConfig); + name: string; + description: string; + astNode?: ScalarTypeDefinitionNode; + constructor(config: GraphQLScalarTypeConfig); - // Serializes an internal value to include in a response. - serialize(value: any): any; + // Serializes an internal value to include in a response. + serialize(value: any): any; - // Parses an externally provided value to use as an input. - parseValue(value: any): any; + // Parses an externally provided value to use as an input. + parseValue(value: any): any; - // Parses an externally provided literal value to use as an input. - parseLiteral(valueNode: ValueNode): any; + // Parses an externally provided literal value to use as an input. + parseLiteral(valueNode: ValueNode): any; - toString(): string; + toString(): string; } export interface GraphQLScalarTypeConfig { - name: string; - description?: string; - astNode?: ScalarTypeDefinitionNode; - serialize(value: any): TExternal | null | undefined; - parseValue?(value: any): TInternal | null | undefined; - parseLiteral?(valueNode: ValueNode): TInternal | null | undefined; + name: string; + description?: string; + astNode?: ScalarTypeDefinitionNode; + serialize(value: any): TExternal | null | undefined; + parseValue?(value: any): TInternal | null | undefined; + parseLiteral?(valueNode: ValueNode): TInternal | null | undefined; } /** @@ -228,123 +216,109 @@ export interface GraphQLScalarTypeConfig { * */ export class GraphQLObjectType { - name: string; - description: string; - astNode?: ObjectTypeDefinitionNode; - extensionASTNodes: Array; - isTypeOf: GraphQLIsTypeOfFn; + name: string; + description: string; + astNode?: ObjectTypeDefinitionNode; + extensionASTNodes: Array; + isTypeOf: GraphQLIsTypeOfFn; - constructor(config: GraphQLObjectTypeConfig); - getFields(): GraphQLFieldMap; - getInterfaces(): GraphQLInterfaceType[]; - toString(): string; + constructor(config: GraphQLObjectTypeConfig); + getFields(): GraphQLFieldMap; + getInterfaces(): GraphQLInterfaceType[]; + toString(): string; } export interface GraphQLObjectTypeConfig { - name: string; - interfaces?: Thunk; - fields: Thunk>; - isTypeOf?: GraphQLIsTypeOfFn; - description?: string; - astNode?: ObjectTypeDefinitionNode; - extensionASTNodes?: Array; + name: string; + interfaces?: Thunk; + fields: Thunk>; + isTypeOf?: GraphQLIsTypeOfFn; + description?: string; + astNode?: ObjectTypeDefinitionNode; + extensionASTNodes?: Array; } export type GraphQLTypeResolver = ( - value: TSource, - context: TContext, - info: GraphQLResolveInfo, + value: TSource, + context: TContext, + info: GraphQLResolveInfo ) => GraphQLObjectType | string | Promise; export type GraphQLIsTypeOfFn = ( - source: TSource, - context: TContext, - info: GraphQLResolveInfo, + source: TSource, + context: TContext, + info: GraphQLResolveInfo ) => boolean | Promise; -export type GraphQLFieldResolver< - TSource, - TContext, - TArgs = { [argName: string]: any } -> = ( - source: TSource, - args: TArgs, - context: TContext, - info: GraphQLResolveInfo, +export type GraphQLFieldResolver = ( + source: TSource, + args: TArgs, + context: TContext, + info: GraphQLResolveInfo ) => any; export interface GraphQLResolveInfo { - fieldName: string; - fieldNodes: FieldNode[]; - returnType: GraphQLOutputType; - parentType: GraphQLCompositeType; - path: ResponsePath; - schema: GraphQLSchema; - fragments: { [fragmentName: string]: FragmentDefinitionNode }; - rootValue: any; - operation: OperationDefinitionNode; - variableValues: { [variableName: string]: any }; + fieldName: string; + fieldNodes: FieldNode[]; + returnType: GraphQLOutputType; + parentType: GraphQLCompositeType; + path: ResponsePath; + schema: GraphQLSchema; + fragments: { [fragmentName: string]: FragmentDefinitionNode }; + rootValue: any; + operation: OperationDefinitionNode; + variableValues: { [variableName: string]: any }; } -export type ResponsePath = - | { prev: ResponsePath; key: string | number } - | undefined; +export type ResponsePath = { prev: ResponsePath; key: string | number } | undefined; -export interface GraphQLFieldConfig< - TSource, - TContext, - TArgs = { [argName: string]: any } -> { - type: GraphQLOutputType; - args?: GraphQLFieldConfigArgumentMap; - resolve?: GraphQLFieldResolver; - subscribe?: GraphQLFieldResolver; - deprecationReason?: string; - description?: string; - astNode?: FieldDefinitionNode; +export interface GraphQLFieldConfig { + type: GraphQLOutputType; + args?: GraphQLFieldConfigArgumentMap; + resolve?: GraphQLFieldResolver; + subscribe?: GraphQLFieldResolver; + deprecationReason?: string; + description?: string; + astNode?: FieldDefinitionNode; } export interface GraphQLFieldConfigArgumentMap { - [argName: string]: GraphQLArgumentConfig; + [argName: string]: GraphQLArgumentConfig; } export interface GraphQLArgumentConfig { - type: GraphQLInputType; - defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + type: GraphQLInputType; + defaultValue?: any; + description?: string; + astNode?: InputValueDefinitionNode; } export interface GraphQLFieldConfigMap { - [fieldName: string]: GraphQLFieldConfig; + [fieldName: string]: GraphQLFieldConfig; } -export interface GraphQLField< - TSource, - TContext, - TArgs = { [argName: string]: any } -> { - name: string; - description: string; - type: GraphQLOutputType; - args: GraphQLArgument[]; - resolve?: GraphQLFieldResolver; - subscribe?: GraphQLFieldResolver; - isDeprecated?: boolean; - deprecationReason?: string; - astNode?: FieldDefinitionNode; +export interface GraphQLField { + name: string; + description: string; + type: GraphQLOutputType; + args: GraphQLArgument[]; + resolve?: GraphQLFieldResolver; + subscribe?: GraphQLFieldResolver; + isDeprecated?: boolean; + deprecationReason?: string; + astNode?: FieldDefinitionNode; } export interface GraphQLArgument { - name: string; - type: GraphQLInputType; - defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + name: string; + type: GraphQLInputType; + defaultValue?: any; + description?: string; + astNode?: InputValueDefinitionNode; } export interface GraphQLFieldMap { - [fieldName: string]: GraphQLField; + [fieldName: string]: GraphQLField; } /** @@ -366,29 +340,29 @@ export interface GraphQLFieldMap { * */ export class GraphQLInterfaceType { - name: string; - description: string; - astNode?: InterfaceTypeDefinitionNode; - resolveType: GraphQLTypeResolver; + name: string; + description: string; + astNode?: InterfaceTypeDefinitionNode; + resolveType: GraphQLTypeResolver; - constructor(config: GraphQLInterfaceTypeConfig); + constructor(config: GraphQLInterfaceTypeConfig); - getFields(): GraphQLFieldMap; + getFields(): GraphQLFieldMap; - toString(): string; + toString(): string; } export interface GraphQLInterfaceTypeConfig { - name: string; - fields: Thunk>; - /** - * Optionally provide a custom type resolver function. If one is not provided, - * the default implementation will call `isTypeOf` on each implementing - * Object type. - */ - resolveType?: GraphQLTypeResolver; - description?: string; - astNode?: InterfaceTypeDefinitionNode; + name: string; + fields: Thunk>; + /** + * Optionally provide a custom type resolver function. If one is not provided, + * the default implementation will call `isTypeOf` on each implementing + * Object type. + */ + resolveType?: GraphQLTypeResolver; + description?: string; + astNode?: InterfaceTypeDefinitionNode; } /** @@ -415,29 +389,29 @@ export interface GraphQLInterfaceTypeConfig { * */ export class GraphQLUnionType { - name: string; - description: string; - astNode?: UnionTypeDefinitionNode; - resolveType: GraphQLTypeResolver; + name: string; + description: string; + astNode?: UnionTypeDefinitionNode; + resolveType: GraphQLTypeResolver; - constructor(config: GraphQLUnionTypeConfig); + constructor(config: GraphQLUnionTypeConfig); - getTypes(): GraphQLObjectType[]; + getTypes(): GraphQLObjectType[]; - toString(): string; + toString(): string; } export interface GraphQLUnionTypeConfig { - name: string; - types: Thunk; - /** - * Optionally provide a custom type resolver function. If one is not provided, - * the default implementation will call `isTypeOf` on each implementing - * Object type. - */ - resolveType?: GraphQLTypeResolver; - description?: string; - astNode?: UnionTypeDefinitionNode; + name: string; + types: Thunk; + /** + * Optionally provide a custom type resolver function. If one is not provided, + * the default implementation will call `isTypeOf` on each implementing + * Object type. + */ + resolveType?: GraphQLTypeResolver; + description?: string; + astNode?: UnionTypeDefinitionNode; } /** @@ -462,45 +436,45 @@ export interface GraphQLUnionTypeConfig { * will be used as its internal value. */ export class GraphQLEnumType { - name: string; - description: string; - astNode?: EnumTypeDefinitionNode; + name: string; + description: string; + astNode?: EnumTypeDefinitionNode; - constructor(config: GraphQLEnumTypeConfig); - getValues(): GraphQLEnumValue[]; - getValue(name: string): GraphQLEnumValue; - isValidValue(value: any): boolean; - serialize(value: any): string; - parseValue(value: any): any; - parseLiteral(valueNode: ValueNode): any; - toString(): string; + constructor(config: GraphQLEnumTypeConfig); + getValues(): GraphQLEnumValue[]; + getValue(name: string): GraphQLEnumValue; + isValidValue(value: any): boolean; + serialize(value: any): string; + parseValue(value: any): any; + parseLiteral(valueNode: ValueNode): any; + toString(): string; } export interface GraphQLEnumTypeConfig { - name: string; - values: GraphQLEnumValueConfigMap; - description?: string; - astNode?: EnumTypeDefinitionNode; + name: string; + values: GraphQLEnumValueConfigMap; + description?: string; + astNode?: EnumTypeDefinitionNode; } export interface GraphQLEnumValueConfigMap { - [valueName: string]: GraphQLEnumValueConfig; + [valueName: string]: GraphQLEnumValueConfig; } export interface GraphQLEnumValueConfig { - value?: any; - deprecationReason?: string; - description?: string; - astNode?: EnumValueDefinitionNode; + value?: any; + deprecationReason?: string; + description?: string; + astNode?: EnumValueDefinitionNode; } export interface GraphQLEnumValue { - name: string; - description: string; - isDeprecated?: boolean; - deprecationReason: string; - astNode?: EnumValueDefinitionNode; - value: any; + name: string; + description: string; + isDeprecated?: boolean; + deprecationReason: string; + astNode?: EnumValueDefinitionNode; + value: any; } /** @@ -524,42 +498,42 @@ export interface GraphQLEnumValue { * */ export class GraphQLInputObjectType { - name: string; - description: string; - astNode?: InputObjectTypeDefinitionNode; - constructor(config: GraphQLInputObjectTypeConfig); - getFields(): GraphQLInputFieldMap; - toString(): string; + name: string; + description: string; + astNode?: InputObjectTypeDefinitionNode; + constructor(config: GraphQLInputObjectTypeConfig); + getFields(): GraphQLInputFieldMap; + toString(): string; } export interface GraphQLInputObjectTypeConfig { - name: string; - fields: Thunk; - description?: string; - astNode?: InputObjectTypeDefinitionNode; + name: string; + fields: Thunk; + description?: string; + astNode?: InputObjectTypeDefinitionNode; } export interface GraphQLInputFieldConfig { - type: GraphQLInputType; - defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + type: GraphQLInputType; + defaultValue?: any; + description?: string; + astNode?: InputValueDefinitionNode; } export interface GraphQLInputFieldConfigMap { - [fieldName: string]: GraphQLInputFieldConfig; + [fieldName: string]: GraphQLInputFieldConfig; } export interface GraphQLInputField { - name: string; - type: GraphQLInputType; - defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + name: string; + type: GraphQLInputType; + defaultValue?: any; + description?: string; + astNode?: InputValueDefinitionNode; } export interface GraphQLInputFieldMap { - [fieldName: string]: GraphQLInputField; + [fieldName: string]: GraphQLInputField; } /** @@ -581,9 +555,9 @@ export interface GraphQLInputFieldMap { * */ export class GraphQLList { - ofType: T; - constructor(type: T); - toString(): string; + ofType: T; + constructor(type: T); + toString(): string; } /** @@ -607,9 +581,9 @@ export class GraphQLList { * Note: the enforcement of non-nullability occurs within the executor. */ export class GraphQLNonNull { - ofType: T; + ofType: T; - constructor(type: T); + constructor(type: T); - toString(): string; + toString(): string; } diff --git a/types/graphql/type/directives.d.ts b/types/graphql/type/directives.d.ts index b6962bc4ae..bf1fc8df16 100644 --- a/types/graphql/type/directives.d.ts +++ b/types/graphql/type/directives.d.ts @@ -1,27 +1,27 @@ -import { GraphQLFieldConfigArgumentMap, GraphQLArgument } from './definition'; -import { DirectiveDefinitionNode } from '../language/ast'; +import { GraphQLFieldConfigArgumentMap, GraphQLArgument } from "./definition"; +import { DirectiveDefinitionNode } from "../language/ast"; export const DirectiveLocation: { - // Operations - QUERY: 'QUERY'; - MUTATION: 'MUTATION'; - SUBSCRIPTION: 'SUBSCRIPTION'; - FIELD: 'FIELD'; - FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION'; - FRAGMENT_SPREAD: 'FRAGMENT_SPREAD'; - INLINE_FRAGMENT: 'INLINE_FRAGMENT'; - // Schema Definitions - SCHEMA: 'SCHEMA'; - SCALAR: 'SCALAR'; - OBJECT: 'OBJECT'; - FIELD_DEFINITION: 'FIELD_DEFINITION'; - ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION'; - INTERFACE: 'INTERFACE'; - UNION: 'UNION'; - ENUM: 'ENUM'; - ENUM_VALUE: 'ENUM_VALUE'; - INPUT_OBJECT: 'INPUT_OBJECT'; - INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION'; + // Operations + QUERY: "QUERY"; + MUTATION: "MUTATION"; + SUBSCRIPTION: "SUBSCRIPTION"; + FIELD: "FIELD"; + FRAGMENT_DEFINITION: "FRAGMENT_DEFINITION"; + FRAGMENT_SPREAD: "FRAGMENT_SPREAD"; + INLINE_FRAGMENT: "INLINE_FRAGMENT"; + // Schema Definitions + SCHEMA: "SCHEMA"; + SCALAR: "SCALAR"; + OBJECT: "OBJECT"; + FIELD_DEFINITION: "FIELD_DEFINITION"; + ARGUMENT_DEFINITION: "ARGUMENT_DEFINITION"; + INTERFACE: "INTERFACE"; + UNION: "UNION"; + ENUM: "ENUM"; + ENUM_VALUE: "ENUM_VALUE"; + INPUT_OBJECT: "INPUT_OBJECT"; + INPUT_FIELD_DEFINITION: "INPUT_FIELD_DEFINITION"; }; export type DirectiveLocationEnum = keyof typeof DirectiveLocation; @@ -31,21 +31,21 @@ export type DirectiveLocationEnum = keyof typeof DirectiveLocation; * behavior. Type system creators will usually not create these directly. */ export class GraphQLDirective { - name: string; - description?: string; - locations: DirectiveLocationEnum[]; - args: GraphQLArgument[]; - astNode?: DirectiveDefinitionNode; + name: string; + description?: string; + locations: DirectiveLocationEnum[]; + args: GraphQLArgument[]; + astNode?: DirectiveDefinitionNode; - constructor(config: GraphQLDirectiveConfig); + constructor(config: GraphQLDirectiveConfig); } export interface GraphQLDirectiveConfig { - name: string; - description?: string; - locations: DirectiveLocationEnum[]; - args?: GraphQLFieldConfigArgumentMap; - astNode?: DirectiveDefinitionNode; + name: string; + description?: string; + locations: DirectiveLocationEnum[]; + args?: GraphQLFieldConfigArgumentMap; + astNode?: DirectiveDefinitionNode; } /** @@ -61,7 +61,7 @@ export const GraphQLSkipDirective: GraphQLDirective; /** * Constant string used for default reason for a deprecation. */ -export const DEFAULT_DEPRECATION_REASON: 'No longer supported'; +export const DEFAULT_DEPRECATION_REASON: "No longer supported"; /** * Used to declare element of a GraphQL schema as deprecated. diff --git a/types/graphql/type/index.d.ts b/types/graphql/type/index.d.ts index 5fdfb1190a..551ade35e7 100644 --- a/types/graphql/type/index.d.ts +++ b/types/graphql/type/index.d.ts @@ -1,47 +1,41 @@ // GraphQL Schema definition -export { GraphQLSchema } from './schema'; +export { GraphQLSchema } from "./schema"; -export * from './definition'; +export * from "./definition"; export { - // "Enum" of Directive Locations - DirectiveLocation, - // Directives Definition - GraphQLDirective, - // Built-in Directives defined by the Spec - specifiedDirectives, - GraphQLIncludeDirective, - GraphQLSkipDirective, - GraphQLDeprecatedDirective, - // Constant Deprecation Reason - DEFAULT_DEPRECATION_REASON, -} from './directives'; + // "Enum" of Directive Locations + DirectiveLocation, + // Directives Definition + GraphQLDirective, + // Built-in Directives defined by the Spec + specifiedDirectives, + GraphQLIncludeDirective, + GraphQLSkipDirective, + GraphQLDeprecatedDirective, + // Constant Deprecation Reason + DEFAULT_DEPRECATION_REASON, +} from "./directives"; // Common built-in scalar instances. -export { - GraphQLInt, - GraphQLFloat, - GraphQLString, - GraphQLBoolean, - GraphQLID, -} from './scalars'; +export { GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID } from "./scalars"; export { - // "Enum" of Type Kinds - TypeKind, - // GraphQL Types for introspection. - __Schema, - __Directive, - __DirectiveLocation, - __Type, - __Field, - __InputValue, - __EnumValue, - __TypeKind, - // Meta-field definitions. - SchemaMetaFieldDef, - TypeMetaFieldDef, - TypeNameMetaFieldDef, -} from './introspection'; + // "Enum" of Type Kinds + TypeKind, + // GraphQL Types for introspection. + __Schema, + __Directive, + __DirectiveLocation, + __Type, + __Field, + __InputValue, + __EnumValue, + __TypeKind, + // Meta-field definitions. + SchemaMetaFieldDef, + TypeMetaFieldDef, + TypeNameMetaFieldDef, +} from "./introspection"; -export { DirectiveLocationEnum } from './directives'; +export { DirectiveLocationEnum } from "./directives"; diff --git a/types/graphql/type/introspection.d.ts b/types/graphql/type/introspection.d.ts index 48ac468ed0..042c3e2b6b 100644 --- a/types/graphql/type/introspection.d.ts +++ b/types/graphql/type/introspection.d.ts @@ -1,14 +1,14 @@ import { - GraphQLScalarType, - GraphQLObjectType, - GraphQLInterfaceType, - GraphQLUnionType, - GraphQLEnumType, - GraphQLInputObjectType, - GraphQLList, - GraphQLNonNull, -} from './definition'; -import { GraphQLField } from './definition'; + GraphQLScalarType, + GraphQLObjectType, + GraphQLInterfaceType, + GraphQLUnionType, + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLList, + GraphQLNonNull, +} from "./definition"; +import { GraphQLField } from "./definition"; export const __Schema: GraphQLObjectType; export const __Directive: GraphQLObjectType; @@ -19,14 +19,14 @@ export const __InputValue: GraphQLObjectType; export const __EnumValue: GraphQLObjectType; export const TypeKind: { - SCALAR: 'SCALAR'; - OBJECT: 'OBJECT'; - INTERFACE: 'INTERFACE'; - UNION: 'UNION'; - ENUM: 'ENUM'; - INPUT_OBJECT: 'INPUT_OBJECT'; - LIST: 'LIST'; - NON_NULL: 'NON_NULL'; + SCALAR: "SCALAR"; + OBJECT: "OBJECT"; + INTERFACE: "INTERFACE"; + UNION: "UNION"; + ENUM: "ENUM"; + INPUT_OBJECT: "INPUT_OBJECT"; + LIST: "LIST"; + NON_NULL: "NON_NULL"; }; export const __TypeKind: GraphQLEnumType; diff --git a/types/graphql/type/scalars.d.ts b/types/graphql/type/scalars.d.ts index 31a33aafad..287d99602a 100644 --- a/types/graphql/type/scalars.d.ts +++ b/types/graphql/type/scalars.d.ts @@ -1,4 +1,4 @@ -import { GraphQLScalarType } from './definition'; +import { GraphQLScalarType } from "./definition"; export const GraphQLInt: GraphQLScalarType; export const GraphQLFloat: GraphQLScalarType; diff --git a/types/graphql/type/schema.d.ts b/types/graphql/type/schema.d.ts index 26500c6ed3..bdd1089756 100644 --- a/types/graphql/type/schema.d.ts +++ b/types/graphql/type/schema.d.ts @@ -1,11 +1,7 @@ -import { GraphQLObjectType } from './definition'; -import { - GraphQLType, - GraphQLNamedType, - GraphQLAbstractType, -} from './definition'; -import { SchemaDefinitionNode } from '../language/ast'; -import { GraphQLDirective } from './directives'; +import { GraphQLObjectType } from "./definition"; +import { GraphQLType, GraphQLNamedType, GraphQLAbstractType } from "./definition"; +import { SchemaDefinitionNode } from "../language/ast"; +import { GraphQLDirective } from "./directives"; /** * Schema Definition @@ -34,59 +30,56 @@ import { GraphQLDirective } from './directives'; * */ export class GraphQLSchema { - astNode?: SchemaDefinitionNode; - // private _queryType: GraphQLObjectType; - // private _mutationType: GraphQLObjectType; - // private _subscriptionType: GraphQLObjectType; - // private _directives: Array; - // private _typeMap: TypeMap; - // private _implementations: { [interfaceName: string]: Array }; - // private _possibleTypeMap: { [abstractName: string]: { [possibleName: string]: boolean } }; + astNode?: SchemaDefinitionNode; + // private _queryType: GraphQLObjectType; + // private _mutationType: GraphQLObjectType; + // private _subscriptionType: GraphQLObjectType; + // private _directives: Array; + // private _typeMap: TypeMap; + // private _implementations: { [interfaceName: string]: Array }; + // private _possibleTypeMap: { [abstractName: string]: { [possibleName: string]: boolean } }; - constructor(config: GraphQLSchemaConfig); + constructor(config: GraphQLSchemaConfig); - getQueryType(): GraphQLObjectType; - getMutationType(): GraphQLObjectType | null | undefined; - getSubscriptionType(): GraphQLObjectType | null | undefined; - getTypeMap(): { [typeName: string]: GraphQLNamedType }; - getType(name: string): GraphQLNamedType; - getPossibleTypes(abstractType: GraphQLAbstractType): GraphQLObjectType[]; + getQueryType(): GraphQLObjectType; + getMutationType(): GraphQLObjectType | null | undefined; + getSubscriptionType(): GraphQLObjectType | null | undefined; + getTypeMap(): { [typeName: string]: GraphQLNamedType }; + getType(name: string): GraphQLNamedType; + getPossibleTypes(abstractType: GraphQLAbstractType): GraphQLObjectType[]; - isPossibleType( - abstractType: GraphQLAbstractType, - possibleType: GraphQLObjectType, - ): boolean; + isPossibleType(abstractType: GraphQLAbstractType, possibleType: GraphQLObjectType): boolean; - getDirectives(): GraphQLDirective[]; - getDirective(name: string): GraphQLDirective; + getDirectives(): GraphQLDirective[]; + getDirective(name: string): GraphQLDirective; } export type GraphQLSchemaValidationOptions = { - /** - * When building a schema from a GraphQL service's introspection result, it - * might be safe to assume the schema is valid. Set to true to assume the - * produced schema is valid. - * - * Default: false - */ - assumeValid?: boolean; + /** + * When building a schema from a GraphQL service's introspection result, it + * might be safe to assume the schema is valid. Set to true to assume the + * produced schema is valid. + * + * Default: false + */ + assumeValid?: boolean; - /** - * If provided, the schema will consider fields or types with names included - * in this list valid, even if they do not adhere to the specification's - * schema validation rules. - * - * This option is provided to ease adoption and may be removed in a future - * major release. - */ - allowedLegacyNames?: ReadonlyArray; + /** + * If provided, the schema will consider fields or types with names included + * in this list valid, even if they do not adhere to the specification's + * schema validation rules. + * + * This option is provided to ease adoption and may be removed in a future + * major release. + */ + allowedLegacyNames?: ReadonlyArray; }; export interface GraphQLSchemaConfig { - query: GraphQLObjectType; - mutation?: GraphQLObjectType; - subscription?: GraphQLObjectType; - types?: GraphQLNamedType[]; - directives?: GraphQLDirective[]; - astNode?: SchemaDefinitionNode; + query: GraphQLObjectType; + mutation?: GraphQLObjectType; + subscription?: GraphQLObjectType; + types?: GraphQLNamedType[]; + directives?: GraphQLDirective[]; + astNode?: SchemaDefinitionNode; } diff --git a/types/graphql/utilities/TypeInfo.d.ts b/types/graphql/utilities/TypeInfo.d.ts index a04a24a1a7..8b1ddc6206 100644 --- a/types/graphql/utilities/TypeInfo.d.ts +++ b/types/graphql/utilities/TypeInfo.d.ts @@ -1,15 +1,15 @@ -import { GraphQLSchema } from '../type/schema'; +import { GraphQLSchema } from "../type/schema"; import { - GraphQLOutputType, - GraphQLCompositeType, - GraphQLInputType, - GraphQLField, - GraphQLArgument, - GraphQLEnumValue, - GraphQLType, -} from '../type/definition'; -import { GraphQLDirective } from '../type/directives'; -import { ASTNode, FieldNode } from '../language/ast'; + GraphQLOutputType, + GraphQLCompositeType, + GraphQLInputType, + GraphQLField, + GraphQLArgument, + GraphQLEnumValue, + GraphQLType, +} from "../type/definition"; +import { GraphQLDirective } from "../type/directives"; +import { ASTNode, FieldNode } from "../language/ast"; /** * TypeInfo is a utility class which, given a GraphQL schema, can keep track @@ -17,27 +17,27 @@ import { ASTNode, FieldNode } from '../language/ast'; * AST during a recursive descent by calling `enter(node)` and `leave(node)`. */ export class TypeInfo { - constructor( - schema: GraphQLSchema, - // NOTE: this experimental optional second parameter is only needed in order - // to support non-spec-compliant codebases. You should never need to use it. - // It may disappear in the future. - getFieldDefFn?: getFieldDef, - ); + constructor( + schema: GraphQLSchema, + // NOTE: this experimental optional second parameter is only needed in order + // to support non-spec-compliant codebases. You should never need to use it. + // It may disappear in the future. + getFieldDefFn?: getFieldDef + ); - getType(): GraphQLOutputType; - getParentType(): GraphQLCompositeType; - getInputType(): GraphQLInputType; - getFieldDef(): GraphQLField; - getDirective(): GraphQLDirective; - getArgument(): GraphQLArgument; - getEnumValue(): GraphQLEnumValue; - enter(node: ASTNode): any; - leave(node: ASTNode): any; + getType(): GraphQLOutputType; + getParentType(): GraphQLCompositeType; + getInputType(): GraphQLInputType; + getFieldDef(): GraphQLField; + getDirective(): GraphQLDirective; + getArgument(): GraphQLArgument; + getEnumValue(): GraphQLEnumValue; + enter(node: ASTNode): any; + leave(node: ASTNode): any; } export type getFieldDef = ( - schema: GraphQLSchema, - parentType: GraphQLType, - fieldNode: FieldNode, + schema: GraphQLSchema, + parentType: GraphQLType, + fieldNode: FieldNode ) => GraphQLField; diff --git a/types/graphql/utilities/astFromValue.d.ts b/types/graphql/utilities/astFromValue.d.ts index 557a07dd9d..57f7f977ad 100644 --- a/types/graphql/utilities/astFromValue.d.ts +++ b/types/graphql/utilities/astFromValue.d.ts @@ -1,6 +1,6 @@ import { - ValueNode, - /* + ValueNode, + /* TODO: IntValueNode, FloatValueNode, @@ -10,8 +10,8 @@ import { ListValueNode, ObjectValueNode, */ -} from '../language/ast'; -import { GraphQLInputType } from '../type/definition'; +} from "../language/ast"; +import { GraphQLInputType } from "../type/definition"; /** * Produces a GraphQL Value AST given a JavaScript value. diff --git a/types/graphql/utilities/buildASTSchema.d.ts b/types/graphql/utilities/buildASTSchema.d.ts index 6b8aa56327..4d256fe180 100644 --- a/types/graphql/utilities/buildASTSchema.d.ts +++ b/types/graphql/utilities/buildASTSchema.d.ts @@ -1,16 +1,16 @@ -import { DocumentNode, Location, StringValueNode } from '../language/ast'; -import { Source } from '../language/source'; -import { GraphQLSchema, GraphQLSchemaValidationOptions } from '../type/schema'; +import { DocumentNode, Location, StringValueNode } from "../language/ast"; +import { Source } from "../language/source"; +import { GraphQLSchema, GraphQLSchemaValidationOptions } from "../type/schema"; interface BuildSchemaOptions extends GraphQLSchemaValidationOptions { - /** - * Descriptions are defined as preceding string literals, however an older - * experimental version of the SDL supported preceding comments as - * descriptions. Set to true to enable this deprecated behavior. - * - * Default: false - */ - commentDescriptions?: boolean; + /** + * Descriptions are defined as preceding string literals, however an older + * experimental version of the SDL supported preceding comments as + * descriptions. Set to true to enable this deprecated behavior. + * + * Default: false + */ + commentDescriptions?: boolean; } /** @@ -35,8 +35,8 @@ export function buildASTSchema(ast: DocumentNode): GraphQLSchema; * */ export function getDescription( - node: { description?: StringValueNode; loc?: Location }, - options: BuildSchemaOptions + node: { description?: StringValueNode; loc?: Location }, + options: BuildSchemaOptions ): string; /** diff --git a/types/graphql/utilities/buildClientSchema.d.ts b/types/graphql/utilities/buildClientSchema.d.ts index 26b0b3cdd5..80516c2111 100644 --- a/types/graphql/utilities/buildClientSchema.d.ts +++ b/types/graphql/utilities/buildClientSchema.d.ts @@ -1,5 +1,5 @@ -import { IntrospectionQuery } from './introspectionQuery'; -import { GraphQLSchema, GraphQLSchemaValidationOptions } from '../type/schema'; +import { IntrospectionQuery } from "./introspectionQuery"; +import { GraphQLSchema, GraphQLSchemaValidationOptions } from "../type/schema"; interface Options extends GraphQLSchemaValidationOptions {} @@ -12,7 +12,4 @@ interface Options extends GraphQLSchemaValidationOptions {} * represent the "resolver", "parse" or "serialize" functions or any other * server-internal mechanisms. */ -export function buildClientSchema( - introspection: IntrospectionQuery, - options?: Options, -): GraphQLSchema; +export function buildClientSchema(introspection: IntrospectionQuery, options?: Options): GraphQLSchema; diff --git a/types/graphql/utilities/concatAST.d.ts b/types/graphql/utilities/concatAST.d.ts index 405ac69936..6e4c33aed5 100644 --- a/types/graphql/utilities/concatAST.d.ts +++ b/types/graphql/utilities/concatAST.d.ts @@ -1,4 +1,4 @@ -import { DocumentNode } from '../language/ast'; +import { DocumentNode } from "../language/ast"; /** * Provided a collection of ASTs, presumably each from different files, diff --git a/types/graphql/utilities/extendSchema.d.ts b/types/graphql/utilities/extendSchema.d.ts index 389bd02d8b..027c4d5745 100644 --- a/types/graphql/utilities/extendSchema.d.ts +++ b/types/graphql/utilities/extendSchema.d.ts @@ -1,5 +1,5 @@ -import { DocumentNode } from '../language/ast'; -import { GraphQLSchema } from '../type/schema'; +import { DocumentNode } from "../language/ast"; +import { GraphQLSchema } from "../type/schema"; /** * Produces a new schema given an existing schema and a document which may @@ -13,7 +13,4 @@ import { GraphQLSchema } from '../type/schema'; * This algorithm copies the provided schema, applying extensions while * producing the copy. The original schema remains unaltered. */ -export function extendSchema( - schema: GraphQLSchema, - documentAST: DocumentNode, -): GraphQLSchema; +export function extendSchema(schema: GraphQLSchema, documentAST: DocumentNode): GraphQLSchema; diff --git a/types/graphql/utilities/findBreakingChanges.d.ts b/types/graphql/utilities/findBreakingChanges.d.ts index 0d5fc0041a..37b98dae34 100644 --- a/types/graphql/utilities/findBreakingChanges.d.ts +++ b/types/graphql/utilities/findBreakingChanges.d.ts @@ -1,88 +1,70 @@ import { - getNamedType, - GraphQLScalarType, - GraphQLEnumType, - GraphQLInputObjectType, - GraphQLInterfaceType, - GraphQLObjectType, - GraphQLUnionType, - GraphQLNamedType, -} from '../type/definition'; -import { GraphQLSchema } from '../type/schema'; + getNamedType, + GraphQLScalarType, + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLInterfaceType, + GraphQLObjectType, + GraphQLUnionType, + GraphQLNamedType, +} from "../type/definition"; +import { GraphQLSchema } from "../type/schema"; export const BreakingChangeType: { - FIELD_CHANGED_KIND: 'FIELD_CHANGED_KIND'; - FIELD_REMOVED: 'FIELD_REMOVED'; - TYPE_CHANGED_KIND: 'TYPE_CHANGED_KIND'; - TYPE_REMOVED: 'TYPE_REMOVED'; - TYPE_REMOVED_FROM_UNION: 'TYPE_REMOVED_FROM_UNION'; - VALUE_REMOVED_FROM_ENUM: 'VALUE_REMOVED_FROM_ENUM'; + FIELD_CHANGED_KIND: "FIELD_CHANGED_KIND"; + FIELD_REMOVED: "FIELD_REMOVED"; + TYPE_CHANGED_KIND: "TYPE_CHANGED_KIND"; + TYPE_REMOVED: "TYPE_REMOVED"; + TYPE_REMOVED_FROM_UNION: "TYPE_REMOVED_FROM_UNION"; + VALUE_REMOVED_FROM_ENUM: "VALUE_REMOVED_FROM_ENUM"; }; export type BreakingChangeKey = - | 'FIELD_CHANGED_KIND' - | 'FIELD_REMOVED' - | 'TYPE_CHANGED_KIND' - | 'TYPE_REMOVED' - | 'TYPE_REMOVED_FROM_UNION' - | 'VALUE_REMOVED_FROM_ENUM'; + | "FIELD_CHANGED_KIND" + | "FIELD_REMOVED" + | "TYPE_CHANGED_KIND" + | "TYPE_REMOVED" + | "TYPE_REMOVED_FROM_UNION" + | "VALUE_REMOVED_FROM_ENUM"; export interface BreakingChange { - type: BreakingChangeKey; - description: string; + type: BreakingChangeKey; + description: string; } /** * Given two schemas, returns an Array containing descriptions of all the types * of breaking changes covered by the other functions down below. */ -export function findBreakingChanges( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema, -): BreakingChange[]; +export function findBreakingChanges(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; /** * Given two schemas, returns an Array containing descriptions of any breaking * changes in the newSchema related to removing an entire type. */ -export function findRemovedTypes( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema, -): BreakingChange[]; +export function findRemovedTypes(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; /** * Given two schemas, returns an Array containing descriptions of any breaking * changes in the newSchema related to changing the type of a type. */ -export function findTypesThatChangedKind( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema, -): BreakingChange[]; +export function findTypesThatChangedKind(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; /** * Given two schemas, returns an Array containing descriptions of any breaking * changes in the newSchema related to the fields on a type. This includes if * a field has been removed from a type or if a field has changed type. */ -export function findFieldsThatChangedType( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema, -): BreakingChange[]; +export function findFieldsThatChangedType(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; /** * Given two schemas, returns an Array containing descriptions of any breaking * changes in the newSchema related to removing types from a union type. */ -export function findTypesRemovedFromUnions( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema, -): BreakingChange[]; +export function findTypesRemovedFromUnions(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; /** * Given two schemas, returns an Array containing descriptions of any breaking * changes in the newSchema related to removing values from an enum type. */ -export function findValuesRemovedFromEnums( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema, -): BreakingChange[]; +export function findValuesRemovedFromEnums(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; diff --git a/types/graphql/utilities/findDeprecatedUsages.d.ts b/types/graphql/utilities/findDeprecatedUsages.d.ts index 8cd844e15f..da99c98269 100644 --- a/types/graphql/utilities/findDeprecatedUsages.d.ts +++ b/types/graphql/utilities/findDeprecatedUsages.d.ts @@ -1,13 +1,10 @@ -import { GraphQLSchema } from '../type/schema'; -import { DocumentNode } from '../language/ast'; -import { GraphQLError } from '../error/GraphQLError'; +import { GraphQLSchema } from "../type/schema"; +import { DocumentNode } from "../language/ast"; +import { GraphQLError } from "../error/GraphQLError"; /** * A validation rule which reports deprecated usages. * * Returns a list of GraphQLError instances describing each deprecated use. */ -export function findDeprecatedUsages( - schema: GraphQLSchema, - ast: DocumentNode, -): GraphQLError[]; +export function findDeprecatedUsages(schema: GraphQLSchema, ast: DocumentNode): GraphQLError[]; diff --git a/types/graphql/utilities/getOperationAST.d.ts b/types/graphql/utilities/getOperationAST.d.ts index 0d5064d48d..5a1e0dc7a7 100644 --- a/types/graphql/utilities/getOperationAST.d.ts +++ b/types/graphql/utilities/getOperationAST.d.ts @@ -1,11 +1,8 @@ -import { DocumentNode, OperationDefinitionNode } from '../language/ast'; +import { DocumentNode, OperationDefinitionNode } from "../language/ast"; /** * Returns an operation AST given a document AST and optionally an operation * name. If a name is not provided, an operation is only returned if only one is * provided in the document. */ -export function getOperationAST( - documentAST: DocumentNode, - operationName?: string, -): OperationDefinitionNode; +export function getOperationAST(documentAST: DocumentNode, operationName?: string): OperationDefinitionNode; diff --git a/types/graphql/utilities/index.d.ts b/types/graphql/utilities/index.d.ts index c2b2c182ff..91777235d1 100644 --- a/types/graphql/utilities/index.d.ts +++ b/types/graphql/utilities/index.d.ts @@ -1,82 +1,74 @@ // The GraphQL query recommended for a full schema introspection. -export { introspectionQuery } from './introspectionQuery'; +export { introspectionQuery } from "./introspectionQuery"; export { - IntrospectionQuery, - IntrospectionSchema, - IntrospectionType, - IntrospectionScalarType, - IntrospectionObjectType, - IntrospectionInterfaceType, - IntrospectionUnionType, - IntrospectionEnumType, - IntrospectionInputObjectType, - IntrospectionTypeRef, - IntrospectionNamedTypeRef, - IntrospectionListTypeRef, - IntrospectionNonNullTypeRef, - IntrospectionField, - IntrospectionInputValue, - IntrospectionEnumValue, - IntrospectionDirective, -} from './introspectionQuery'; + IntrospectionQuery, + IntrospectionSchema, + IntrospectionType, + IntrospectionScalarType, + IntrospectionObjectType, + IntrospectionInterfaceType, + IntrospectionUnionType, + IntrospectionEnumType, + IntrospectionInputObjectType, + IntrospectionTypeRef, + IntrospectionNamedTypeRef, + IntrospectionListTypeRef, + IntrospectionNonNullTypeRef, + IntrospectionField, + IntrospectionInputValue, + IntrospectionEnumValue, + IntrospectionDirective, +} from "./introspectionQuery"; // Gets the target Operation from a Document -export { getOperationAST } from './getOperationAST'; +export { getOperationAST } from "./getOperationAST"; // Build a GraphQLSchema from an introspection result. -export { buildClientSchema } from './buildClientSchema'; +export { buildClientSchema } from "./buildClientSchema"; // Build a GraphQLSchema from GraphQL Schema language. -export { buildASTSchema, buildSchema, getDescription } from './buildASTSchema'; +export { buildASTSchema, buildSchema, getDescription } from "./buildASTSchema"; // Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST. -export { extendSchema } from './extendSchema'; +export { extendSchema } from "./extendSchema"; // Print a GraphQLSchema to GraphQL Schema language. -export { - printSchema, - printType, - printIntrospectionSchema, -} from './schemaPrinter'; +export { printSchema, printType, printIntrospectionSchema } from "./schemaPrinter"; // Create a GraphQLType from a GraphQL language AST. -export { typeFromAST } from './typeFromAST'; +export { typeFromAST } from "./typeFromAST"; // Create a JavaScript value from a GraphQL language AST. -export { valueFromAST } from './valueFromAST'; +export { valueFromAST } from "./valueFromAST"; // Create a GraphQL language AST from a JavaScript value. -export { astFromValue } from './astFromValue'; +export { astFromValue } from "./astFromValue"; // A helper to use within recursive-descent visitors which need to be aware of // the GraphQL type system. -export { TypeInfo } from './TypeInfo'; +export { TypeInfo } from "./TypeInfo"; // Determine if JavaScript values adhere to a GraphQL type. -export { isValidJSValue } from './isValidJSValue'; +export { isValidJSValue } from "./isValidJSValue"; // Determine if AST values adhere to a GraphQL type. -export { isValidLiteralValue } from './isValidLiteralValue'; +export { isValidLiteralValue } from "./isValidLiteralValue"; // Concatenates multiple AST together. -export { concatAST } from './concatAST'; +export { concatAST } from "./concatAST"; // Separates an AST into an AST per Operation. -export { separateOperations } from './separateOperations'; +export { separateOperations } from "./separateOperations"; // Comparators for types -export { - isEqualType, - isTypeSubTypeOf, - doTypesOverlap, -} from './typeComparators'; +export { isEqualType, isTypeSubTypeOf, doTypesOverlap } from "./typeComparators"; // Asserts that a string is a valid GraphQL name -export { assertValidName } from './assertValidName'; +export { assertValidName } from "./assertValidName"; // Compares two GraphQLSchemas and detects breaking changes. -export { findBreakingChanges } from './findBreakingChanges'; -export { BreakingChange } from './findBreakingChanges'; +export { findBreakingChanges } from "./findBreakingChanges"; +export { BreakingChange } from "./findBreakingChanges"; // Report all deprecated usage within a GraphQL document. -export { findDeprecatedUsages } from './findDeprecatedUsages'; +export { findDeprecatedUsages } from "./findDeprecatedUsages"; diff --git a/types/graphql/utilities/introspectionQuery.d.ts b/types/graphql/utilities/introspectionQuery.d.ts index f16b873a3a..10c3b0a200 100644 --- a/types/graphql/utilities/introspectionQuery.d.ts +++ b/types/graphql/utilities/introspectionQuery.d.ts @@ -1,4 +1,4 @@ -import { DirectiveLocationEnum } from '../type/directives'; +import { DirectiveLocationEnum } from "../type/directives"; /* query IntrospectionQuery { @@ -96,114 +96,111 @@ fragment TypeRef on __Type { export const introspectionQuery: string; export interface IntrospectionQuery { - __schema: IntrospectionSchema; + __schema: IntrospectionSchema; } export interface IntrospectionSchema { - queryType: IntrospectionNamedTypeRef; - mutationType?: IntrospectionNamedTypeRef; - subscriptionType?: IntrospectionNamedTypeRef; - types: IntrospectionType[]; - directives: IntrospectionDirective[]; + queryType: IntrospectionNamedTypeRef; + mutationType?: IntrospectionNamedTypeRef; + subscriptionType?: IntrospectionNamedTypeRef; + types: IntrospectionType[]; + directives: IntrospectionDirective[]; } export type IntrospectionType = - | IntrospectionScalarType - | IntrospectionObjectType - | IntrospectionInterfaceType - | IntrospectionUnionType - | IntrospectionEnumType - | IntrospectionInputObjectType; + | IntrospectionScalarType + | IntrospectionObjectType + | IntrospectionInterfaceType + | IntrospectionUnionType + | IntrospectionEnumType + | IntrospectionInputObjectType; export interface IntrospectionScalarType { - kind: 'SCALAR'; - name: string; - description?: string; + kind: "SCALAR"; + name: string; + description?: string; } export interface IntrospectionObjectType { - kind: 'OBJECT'; - name: string; - description?: string; - fields: IntrospectionField[]; - interfaces: IntrospectionNamedTypeRef[]; + kind: "OBJECT"; + name: string; + description?: string; + fields: IntrospectionField[]; + interfaces: IntrospectionNamedTypeRef[]; } export interface IntrospectionInterfaceType { - kind: 'INTERFACE'; - name: string; - description?: string; - fields: IntrospectionField[]; - possibleTypes: IntrospectionNamedTypeRef[]; + kind: "INTERFACE"; + name: string; + description?: string; + fields: IntrospectionField[]; + possibleTypes: IntrospectionNamedTypeRef[]; } export interface IntrospectionUnionType { - kind: 'UNION'; - name: string; - description?: string; - possibleTypes: IntrospectionNamedTypeRef[]; + kind: "UNION"; + name: string; + description?: string; + possibleTypes: IntrospectionNamedTypeRef[]; } export interface IntrospectionEnumType { - kind: 'ENUM'; - name: string; - description?: string; - enumValues: IntrospectionEnumValue[]; + kind: "ENUM"; + name: string; + description?: string; + enumValues: IntrospectionEnumValue[]; } export interface IntrospectionInputObjectType { - kind: 'INPUT_OBJECT'; - name: string; - description?: string; - inputFields: IntrospectionInputValue[]; + kind: "INPUT_OBJECT"; + name: string; + description?: string; + inputFields: IntrospectionInputValue[]; } -export type IntrospectionTypeRef = - | IntrospectionNamedTypeRef - | IntrospectionListTypeRef - | IntrospectionNonNullTypeRef; +export type IntrospectionTypeRef = IntrospectionNamedTypeRef | IntrospectionListTypeRef | IntrospectionNonNullTypeRef; export interface IntrospectionNamedTypeRef { - kind: string; - name: string; + kind: string; + name: string; } export interface IntrospectionListTypeRef { - kind: 'LIST'; - ofType?: IntrospectionTypeRef; + kind: "LIST"; + ofType?: IntrospectionTypeRef; } export interface IntrospectionNonNullTypeRef { - kind: 'NON_NULL'; - ofType?: IntrospectionTypeRef; + kind: "NON_NULL"; + ofType?: IntrospectionTypeRef; } export interface IntrospectionField { - name: string; - description?: string; - args: IntrospectionInputValue[]; - type: IntrospectionTypeRef; - isDeprecated: boolean; - deprecationReason?: string; + name: string; + description?: string; + args: IntrospectionInputValue[]; + type: IntrospectionTypeRef; + isDeprecated: boolean; + deprecationReason?: string; } export interface IntrospectionInputValue { - name: string; - description?: string; - type: IntrospectionTypeRef; - defaultValue?: string; + name: string; + description?: string; + type: IntrospectionTypeRef; + defaultValue?: string; } export interface IntrospectionEnumValue { - name: string; - description?: string; - isDeprecated: boolean; - deprecationReason?: string; + name: string; + description?: string; + isDeprecated: boolean; + deprecationReason?: string; } export interface IntrospectionDirective { - name: string; - description?: string; - locations: DirectiveLocationEnum[]; - args: IntrospectionInputValue[]; + name: string; + description?: string; + locations: DirectiveLocationEnum[]; + args: IntrospectionInputValue[]; } diff --git a/types/graphql/utilities/isValidJSValue.d.ts b/types/graphql/utilities/isValidJSValue.d.ts index 911d8fea67..557429c7f4 100644 --- a/types/graphql/utilities/isValidJSValue.d.ts +++ b/types/graphql/utilities/isValidJSValue.d.ts @@ -1,4 +1,4 @@ -import { GraphQLInputType } from '../type/definition'; +import { GraphQLInputType } from "../type/definition"; /** * Given a JavaScript value and a GraphQL type, determine if the value will be diff --git a/types/graphql/utilities/isValidLiteralValue.d.ts b/types/graphql/utilities/isValidLiteralValue.d.ts index 4ad03d1013..bf54f6bb22 100644 --- a/types/graphql/utilities/isValidLiteralValue.d.ts +++ b/types/graphql/utilities/isValidLiteralValue.d.ts @@ -1,5 +1,5 @@ -import { ValueNode } from '../language/ast'; -import { GraphQLInputType } from '../type/definition'; +import { ValueNode } from "../language/ast"; +import { GraphQLInputType } from "../type/definition"; /** * Utility for validators which determines if a value literal AST is valid given @@ -8,7 +8,4 @@ import { GraphQLInputType } from '../type/definition'; * Note that this only validates literal values, variables are assumed to * provide values of the correct type. */ -export function isValidLiteralValue( - type: GraphQLInputType, - valueNode: ValueNode, -): string[]; +export function isValidLiteralValue(type: GraphQLInputType, valueNode: ValueNode): string[]; diff --git a/types/graphql/utilities/schemaPrinter.d.ts b/types/graphql/utilities/schemaPrinter.d.ts index f9cf9ad209..d49e6aee58 100644 --- a/types/graphql/utilities/schemaPrinter.d.ts +++ b/types/graphql/utilities/schemaPrinter.d.ts @@ -1,8 +1,8 @@ -import { GraphQLSchema } from '../type/schema'; -import { GraphQLType } from '../type/definition'; +import { GraphQLSchema } from "../type/schema"; +import { GraphQLType } from "../type/definition"; export interface PrinterOptions { - commentDescriptions?: boolean; + commentDescriptions?: boolean; } export function printSchema(schema: GraphQLSchema, options?: PrinterOptions): string; diff --git a/types/graphql/utilities/separateOperations.d.ts b/types/graphql/utilities/separateOperations.d.ts index a10ad0a29e..8269b22d75 100644 --- a/types/graphql/utilities/separateOperations.d.ts +++ b/types/graphql/utilities/separateOperations.d.ts @@ -1,5 +1,3 @@ -import { DocumentNode, OperationDefinitionNode } from '../language/ast'; +import { DocumentNode, OperationDefinitionNode } from "../language/ast"; -export function separateOperations( - documentAST: DocumentNode, -): { [operationName: string]: DocumentNode }; +export function separateOperations(documentAST: DocumentNode): { [operationName: string]: DocumentNode }; diff --git a/types/graphql/utilities/typeComparators.d.ts b/types/graphql/utilities/typeComparators.d.ts index ca0cdaf6c2..7bf0b9ebdf 100644 --- a/types/graphql/utilities/typeComparators.d.ts +++ b/types/graphql/utilities/typeComparators.d.ts @@ -1,9 +1,5 @@ -import { - GraphQLType, - GraphQLCompositeType, - GraphQLAbstractType, -} from '../type/definition'; -import { GraphQLSchema } from '../type/schema'; +import { GraphQLType, GraphQLCompositeType, GraphQLAbstractType } from "../type/definition"; +import { GraphQLSchema } from "../type/schema"; /** * Provided two types, return true if the types are equal (invariant). @@ -14,11 +10,7 @@ export function isEqualType(typeA: GraphQLType, typeB: GraphQLType): boolean; * Provided a type and a super type, return true if the first type is either * equal or a subset of the second super type (covariant). */ -export function isTypeSubTypeOf( - schema: GraphQLSchema, - maybeSubType: GraphQLType, - superType: GraphQLType, -): boolean; +export function isTypeSubTypeOf(schema: GraphQLSchema, maybeSubType: GraphQLType, superType: GraphQLType): boolean; /** * Provided two composite types, determine if they "overlap". Two composite @@ -30,7 +22,7 @@ export function isTypeSubTypeOf( * This function is commutative. */ export function doTypesOverlap( - schema: GraphQLSchema, - typeA: GraphQLCompositeType, - typeB: GraphQLCompositeType, + schema: GraphQLSchema, + typeA: GraphQLCompositeType, + typeB: GraphQLCompositeType ): boolean; diff --git a/types/graphql/utilities/typeFromAST.d.ts b/types/graphql/utilities/typeFromAST.d.ts index 415cbd2636..79b7b24a38 100644 --- a/types/graphql/utilities/typeFromAST.d.ts +++ b/types/graphql/utilities/typeFromAST.d.ts @@ -1,8 +1,5 @@ -import { TypeNode } from '../language/ast'; -import { GraphQLType, GraphQLNullableType } from '../type/definition'; -import { GraphQLSchema } from '../type/schema'; +import { TypeNode } from "../language/ast"; +import { GraphQLType, GraphQLNullableType } from "../type/definition"; +import { GraphQLSchema } from "../type/schema"; -export function typeFromAST( - schema: GraphQLSchema, - typeNode: TypeNode, -): GraphQLType; +export function typeFromAST(schema: GraphQLSchema, typeNode: TypeNode): GraphQLType; diff --git a/types/graphql/utilities/valueFromAST.d.ts b/types/graphql/utilities/valueFromAST.d.ts index 0bfbf04981..e0b06b0506 100644 --- a/types/graphql/utilities/valueFromAST.d.ts +++ b/types/graphql/utilities/valueFromAST.d.ts @@ -1,15 +1,10 @@ -import { GraphQLInputType } from '../type/definition'; -import { - ValueNode, - VariableNode, - ListValueNode, - ObjectValueNode, -} from '../language/ast'; +import { GraphQLInputType } from "../type/definition"; +import { ValueNode, VariableNode, ListValueNode, ObjectValueNode } from "../language/ast"; export function valueFromAST( - valueNode: ValueNode, - type: GraphQLInputType, - variables?: { - [key: string]: any; - }, + valueNode: ValueNode, + type: GraphQLInputType, + variables?: { + [key: string]: any; + } ): any; diff --git a/types/graphql/validation/index.d.ts b/types/graphql/validation/index.d.ts index b8cb9ddd00..4353da53fa 100644 --- a/types/graphql/validation/index.d.ts +++ b/types/graphql/validation/index.d.ts @@ -1,128 +1,80 @@ -export { validate, ValidationContext } from './validate'; -export { specifiedRules } from './specifiedRules'; +export { validate, ValidationContext } from "./validate"; +export { specifiedRules } from "./specifiedRules"; // Spec Section: "Argument Values Type Correctness" -export { - ArgumentsOfCorrectType as ArgumentsOfCorrectTypeRule, -} from './rules/ArgumentsOfCorrectType'; +export { ArgumentsOfCorrectType as ArgumentsOfCorrectTypeRule } from "./rules/ArgumentsOfCorrectType"; // Spec Section: "Variable Default Values Are Correctly Typed" -export { - DefaultValuesOfCorrectType as DefaultValuesOfCorrectTypeRule, -} from './rules/DefaultValuesOfCorrectType'; +export { DefaultValuesOfCorrectType as DefaultValuesOfCorrectTypeRule } from "./rules/DefaultValuesOfCorrectType"; // Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" -export { - FieldsOnCorrectType as FieldsOnCorrectTypeRule, -} from './rules/FieldsOnCorrectType'; +export { FieldsOnCorrectType as FieldsOnCorrectTypeRule } from "./rules/FieldsOnCorrectType"; // Spec Section: "Fragments on Composite Types" -export { - FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule, -} from './rules/FragmentsOnCompositeTypes'; +export { FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule } from "./rules/FragmentsOnCompositeTypes"; // Spec Section: "Argument Names" -export { - KnownArgumentNames as KnownArgumentNamesRule, -} from './rules/KnownArgumentNames'; +export { KnownArgumentNames as KnownArgumentNamesRule } from "./rules/KnownArgumentNames"; // Spec Section: "Directives Are Defined" -export { - KnownDirectives as KnownDirectivesRule, -} from './rules/KnownDirectives'; +export { KnownDirectives as KnownDirectivesRule } from "./rules/KnownDirectives"; // Spec Section: "Fragment spread target defined" -export { - KnownFragmentNames as KnownFragmentNamesRule, -} from './rules/KnownFragmentNames'; +export { KnownFragmentNames as KnownFragmentNamesRule } from "./rules/KnownFragmentNames"; // Spec Section: "Fragment Spread Type Existence" -export { KnownTypeNames as KnownTypeNamesRule } from './rules/KnownTypeNames'; +export { KnownTypeNames as KnownTypeNamesRule } from "./rules/KnownTypeNames"; // Spec Section: "Lone Anonymous Operation" -export { - LoneAnonymousOperation as LoneAnonymousOperationRule, -} from './rules/LoneAnonymousOperation'; +export { LoneAnonymousOperation as LoneAnonymousOperationRule } from "./rules/LoneAnonymousOperation"; // Spec Section: "Fragments must not form cycles" -export { - NoFragmentCycles as NoFragmentCyclesRule, -} from './rules/NoFragmentCycles'; +export { NoFragmentCycles as NoFragmentCyclesRule } from "./rules/NoFragmentCycles"; // Spec Section: "All Variable Used Defined" -export { - NoUndefinedVariables as NoUndefinedVariablesRule, -} from './rules/NoUndefinedVariables'; +export { NoUndefinedVariables as NoUndefinedVariablesRule } from "./rules/NoUndefinedVariables"; // Spec Section: "Fragments must be used" -export { - NoUnusedFragments as NoUnusedFragmentsRule, -} from './rules/NoUnusedFragments'; +export { NoUnusedFragments as NoUnusedFragmentsRule } from "./rules/NoUnusedFragments"; // Spec Section: "All Variables Used" -export { - NoUnusedVariables as NoUnusedVariablesRule, -} from './rules/NoUnusedVariables'; +export { NoUnusedVariables as NoUnusedVariablesRule } from "./rules/NoUnusedVariables"; // Spec Section: "Field Selection Merging" -export { - OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule, -} from './rules/OverlappingFieldsCanBeMerged'; +export { OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule } from "./rules/OverlappingFieldsCanBeMerged"; // Spec Section: "Fragment spread is possible" -export { - PossibleFragmentSpreads as PossibleFragmentSpreadsRule, -} from './rules/PossibleFragmentSpreads'; +export { PossibleFragmentSpreads as PossibleFragmentSpreadsRule } from "./rules/PossibleFragmentSpreads"; // Spec Section: "Argument Optionality" -export { - ProvidedNonNullArguments as ProvidedNonNullArgumentsRule, -} from './rules/ProvidedNonNullArguments'; +export { ProvidedNonNullArguments as ProvidedNonNullArgumentsRule } from "./rules/ProvidedNonNullArguments"; // Spec Section: "Leaf Field Selections" -export { ScalarLeafs as ScalarLeafsRule } from './rules/ScalarLeafs'; +export { ScalarLeafs as ScalarLeafsRule } from "./rules/ScalarLeafs"; // Spec Section: "Subscriptions with Single Root Field" -export { - SingleFieldSubscriptions as SingleFieldSubscriptionsRule, -} from './rules/SingleFieldSubscriptions'; +export { SingleFieldSubscriptions as SingleFieldSubscriptionsRule } from "./rules/SingleFieldSubscriptions"; // Spec Section: "Argument Uniqueness" -export { - UniqueArgumentNames as UniqueArgumentNamesRule, -} from './rules/UniqueArgumentNames'; +export { UniqueArgumentNames as UniqueArgumentNamesRule } from "./rules/UniqueArgumentNames"; // Spec Section: "Directives Are Unique Per Location" -export { - UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule, -} from './rules/UniqueDirectivesPerLocation'; +export { UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule } from "./rules/UniqueDirectivesPerLocation"; // Spec Section: "Fragment Name Uniqueness" -export { - UniqueFragmentNames as UniqueFragmentNamesRule, -} from './rules/UniqueFragmentNames'; +export { UniqueFragmentNames as UniqueFragmentNamesRule } from "./rules/UniqueFragmentNames"; // Spec Section: "Input Object Field Uniqueness" -export { - UniqueInputFieldNames as UniqueInputFieldNamesRule, -} from './rules/UniqueInputFieldNames'; +export { UniqueInputFieldNames as UniqueInputFieldNamesRule } from "./rules/UniqueInputFieldNames"; // Spec Section: "Operation Name Uniqueness" -export { - UniqueOperationNames as UniqueOperationNamesRule, -} from './rules/UniqueOperationNames'; +export { UniqueOperationNames as UniqueOperationNamesRule } from "./rules/UniqueOperationNames"; // Spec Section: "Variable Uniqueness" -export { - UniqueVariableNames as UniqueVariableNamesRule, -} from './rules/UniqueVariableNames'; +export { UniqueVariableNames as UniqueVariableNamesRule } from "./rules/UniqueVariableNames"; // Spec Section: "Variables are Input Types" -export { - VariablesAreInputTypes as VariablesAreInputTypesRule, -} from './rules/VariablesAreInputTypes'; +export { VariablesAreInputTypes as VariablesAreInputTypesRule } from "./rules/VariablesAreInputTypes"; // Spec Section: "All Variable Usages Are Allowed" -export { - VariablesInAllowedPosition as VariablesInAllowedPositionRule, -} from './rules/VariablesInAllowedPosition'; +export { VariablesInAllowedPosition as VariablesInAllowedPositionRule } from "./rules/VariablesInAllowedPosition"; diff --git a/types/graphql/validation/rules/ArgumentsOfCorrectType.d.ts b/types/graphql/validation/rules/ArgumentsOfCorrectType.d.ts index f7247d0a9c..235db84162 100644 --- a/types/graphql/validation/rules/ArgumentsOfCorrectType.d.ts +++ b/types/graphql/validation/rules/ArgumentsOfCorrectType.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Argument values of correct type diff --git a/types/graphql/validation/rules/DefaultValuesOfCorrectType.d.ts b/types/graphql/validation/rules/DefaultValuesOfCorrectType.d.ts index 88b3a824f2..b617538a74 100644 --- a/types/graphql/validation/rules/DefaultValuesOfCorrectType.d.ts +++ b/types/graphql/validation/rules/DefaultValuesOfCorrectType.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Variable default values of correct type diff --git a/types/graphql/validation/rules/FieldsOnCorrectType.d.ts b/types/graphql/validation/rules/FieldsOnCorrectType.d.ts index 19609b2b65..247de1298c 100644 --- a/types/graphql/validation/rules/FieldsOnCorrectType.d.ts +++ b/types/graphql/validation/rules/FieldsOnCorrectType.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Fields on correct type diff --git a/types/graphql/validation/rules/FragmentsOnCompositeTypes.d.ts b/types/graphql/validation/rules/FragmentsOnCompositeTypes.d.ts index d6fffd4337..384f43beb3 100644 --- a/types/graphql/validation/rules/FragmentsOnCompositeTypes.d.ts +++ b/types/graphql/validation/rules/FragmentsOnCompositeTypes.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Fragments on composite type diff --git a/types/graphql/validation/rules/KnownArgumentNames.d.ts b/types/graphql/validation/rules/KnownArgumentNames.d.ts index 4477b62a75..bd56137311 100644 --- a/types/graphql/validation/rules/KnownArgumentNames.d.ts +++ b/types/graphql/validation/rules/KnownArgumentNames.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Known argument names diff --git a/types/graphql/validation/rules/KnownDirectives.d.ts b/types/graphql/validation/rules/KnownDirectives.d.ts index 68c6acf549..40e58ce0c3 100644 --- a/types/graphql/validation/rules/KnownDirectives.d.ts +++ b/types/graphql/validation/rules/KnownDirectives.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Known directives diff --git a/types/graphql/validation/rules/KnownFragmentNames.d.ts b/types/graphql/validation/rules/KnownFragmentNames.d.ts index b904f22d89..c5fa899995 100644 --- a/types/graphql/validation/rules/KnownFragmentNames.d.ts +++ b/types/graphql/validation/rules/KnownFragmentNames.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Known fragment names diff --git a/types/graphql/validation/rules/KnownTypeNames.d.ts b/types/graphql/validation/rules/KnownTypeNames.d.ts index 48b15318da..ab8abce9d5 100644 --- a/types/graphql/validation/rules/KnownTypeNames.d.ts +++ b/types/graphql/validation/rules/KnownTypeNames.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Known type names diff --git a/types/graphql/validation/rules/LoneAnonymousOperation.d.ts b/types/graphql/validation/rules/LoneAnonymousOperation.d.ts index 4ce6abcba9..f281df2bce 100644 --- a/types/graphql/validation/rules/LoneAnonymousOperation.d.ts +++ b/types/graphql/validation/rules/LoneAnonymousOperation.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Lone anonymous operation diff --git a/types/graphql/validation/rules/NoFragmentCycles.d.ts b/types/graphql/validation/rules/NoFragmentCycles.d.ts index fed5982fc8..4cce233cd5 100644 --- a/types/graphql/validation/rules/NoFragmentCycles.d.ts +++ b/types/graphql/validation/rules/NoFragmentCycles.d.ts @@ -1,3 +1,3 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; export function NoFragmentCycles(context: ValidationContext): any; diff --git a/types/graphql/validation/rules/NoUndefinedVariables.d.ts b/types/graphql/validation/rules/NoUndefinedVariables.d.ts index 51d30b8fd1..418e3cf2b5 100644 --- a/types/graphql/validation/rules/NoUndefinedVariables.d.ts +++ b/types/graphql/validation/rules/NoUndefinedVariables.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * No undefined variables diff --git a/types/graphql/validation/rules/NoUnusedFragments.d.ts b/types/graphql/validation/rules/NoUnusedFragments.d.ts index 7f4d431299..7a099e66be 100644 --- a/types/graphql/validation/rules/NoUnusedFragments.d.ts +++ b/types/graphql/validation/rules/NoUnusedFragments.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * No unused fragments diff --git a/types/graphql/validation/rules/NoUnusedVariables.d.ts b/types/graphql/validation/rules/NoUnusedVariables.d.ts index 6eb2d984aa..53692ed494 100644 --- a/types/graphql/validation/rules/NoUnusedVariables.d.ts +++ b/types/graphql/validation/rules/NoUnusedVariables.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * No unused variables diff --git a/types/graphql/validation/rules/OverlappingFieldsCanBeMerged.d.ts b/types/graphql/validation/rules/OverlappingFieldsCanBeMerged.d.ts index f21edbd2cb..302617386b 100644 --- a/types/graphql/validation/rules/OverlappingFieldsCanBeMerged.d.ts +++ b/types/graphql/validation/rules/OverlappingFieldsCanBeMerged.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Overlapping fields can be merged diff --git a/types/graphql/validation/rules/PossibleFragmentSpreads.d.ts b/types/graphql/validation/rules/PossibleFragmentSpreads.d.ts index 8defb47721..e9e10aca14 100644 --- a/types/graphql/validation/rules/PossibleFragmentSpreads.d.ts +++ b/types/graphql/validation/rules/PossibleFragmentSpreads.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Possible fragment spread diff --git a/types/graphql/validation/rules/ProvidedNonNullArguments.d.ts b/types/graphql/validation/rules/ProvidedNonNullArguments.d.ts index 4d5334b9fb..291a3ab5bc 100644 --- a/types/graphql/validation/rules/ProvidedNonNullArguments.d.ts +++ b/types/graphql/validation/rules/ProvidedNonNullArguments.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Provided required arguments diff --git a/types/graphql/validation/rules/ScalarLeafs.d.ts b/types/graphql/validation/rules/ScalarLeafs.d.ts index afdc575671..8505cc2512 100644 --- a/types/graphql/validation/rules/ScalarLeafs.d.ts +++ b/types/graphql/validation/rules/ScalarLeafs.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Scalar leafs diff --git a/types/graphql/validation/rules/SingleFieldSubscriptions.d.ts b/types/graphql/validation/rules/SingleFieldSubscriptions.d.ts index 01a2654a16..d6f8fa2c6b 100644 --- a/types/graphql/validation/rules/SingleFieldSubscriptions.d.ts +++ b/types/graphql/validation/rules/SingleFieldSubscriptions.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Subscriptions must only include one field. diff --git a/types/graphql/validation/rules/UniqueArgumentNames.d.ts b/types/graphql/validation/rules/UniqueArgumentNames.d.ts index 8cc166d07a..f4cc750b86 100644 --- a/types/graphql/validation/rules/UniqueArgumentNames.d.ts +++ b/types/graphql/validation/rules/UniqueArgumentNames.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Unique argument names diff --git a/types/graphql/validation/rules/UniqueDirectivesPerLocation.d.ts b/types/graphql/validation/rules/UniqueDirectivesPerLocation.d.ts index 70ea02cd9c..80d4a252c6 100644 --- a/types/graphql/validation/rules/UniqueDirectivesPerLocation.d.ts +++ b/types/graphql/validation/rules/UniqueDirectivesPerLocation.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Unique directive names per location diff --git a/types/graphql/validation/rules/UniqueFragmentNames.d.ts b/types/graphql/validation/rules/UniqueFragmentNames.d.ts index c505968f6a..525befc0a9 100644 --- a/types/graphql/validation/rules/UniqueFragmentNames.d.ts +++ b/types/graphql/validation/rules/UniqueFragmentNames.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Unique fragment names diff --git a/types/graphql/validation/rules/UniqueInputFieldNames.d.ts b/types/graphql/validation/rules/UniqueInputFieldNames.d.ts index cebd71b79b..f81fb25e5c 100644 --- a/types/graphql/validation/rules/UniqueInputFieldNames.d.ts +++ b/types/graphql/validation/rules/UniqueInputFieldNames.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Unique input field names diff --git a/types/graphql/validation/rules/UniqueOperationNames.d.ts b/types/graphql/validation/rules/UniqueOperationNames.d.ts index 5b12cc0eed..5080307d4b 100644 --- a/types/graphql/validation/rules/UniqueOperationNames.d.ts +++ b/types/graphql/validation/rules/UniqueOperationNames.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Unique operation names diff --git a/types/graphql/validation/rules/UniqueVariableNames.d.ts b/types/graphql/validation/rules/UniqueVariableNames.d.ts index ef8712fbc1..a0a029d165 100644 --- a/types/graphql/validation/rules/UniqueVariableNames.d.ts +++ b/types/graphql/validation/rules/UniqueVariableNames.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Unique variable names diff --git a/types/graphql/validation/rules/VariablesAreInputTypes.d.ts b/types/graphql/validation/rules/VariablesAreInputTypes.d.ts index df079e52f9..79846a3073 100644 --- a/types/graphql/validation/rules/VariablesAreInputTypes.d.ts +++ b/types/graphql/validation/rules/VariablesAreInputTypes.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Variables are input types diff --git a/types/graphql/validation/rules/VariablesInAllowedPosition.d.ts b/types/graphql/validation/rules/VariablesInAllowedPosition.d.ts index 6d3e513876..bd302a73b4 100644 --- a/types/graphql/validation/rules/VariablesInAllowedPosition.d.ts +++ b/types/graphql/validation/rules/VariablesInAllowedPosition.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from '../index'; +import { ValidationContext } from "../index"; /** * Variables passed to field arguments conform to type diff --git a/types/graphql/validation/specifiedRules.d.ts b/types/graphql/validation/specifiedRules.d.ts index c09c358cb1..5afc1a09e5 100644 --- a/types/graphql/validation/specifiedRules.d.ts +++ b/types/graphql/validation/specifiedRules.d.ts @@ -1,4 +1,4 @@ -import { ValidationContext } from './validate'; // It needs to check. +import { ValidationContext } from "./validate"; // It needs to check. /** * This set includes all validation rules defined by the GraphQL spec. diff --git a/types/graphql/validation/validate.d.ts b/types/graphql/validation/validate.d.ts index 9e2fd479f1..c60c3bf072 100644 --- a/types/graphql/validation/validate.d.ts +++ b/types/graphql/validation/validate.d.ts @@ -1,23 +1,23 @@ -import { GraphQLError } from '../error'; +import { GraphQLError } from "../error"; import { - DocumentNode, - OperationDefinitionNode, - VariableNode, - SelectionSetNode, - FragmentSpreadNode, - FragmentDefinitionNode, -} from '../language/ast'; -import { GraphQLSchema } from '../type/schema'; + DocumentNode, + OperationDefinitionNode, + VariableNode, + SelectionSetNode, + FragmentSpreadNode, + FragmentDefinitionNode, +} from "../language/ast"; +import { GraphQLSchema } from "../type/schema"; import { - GraphQLInputType, - GraphQLOutputType, - GraphQLCompositeType, - GraphQLField, - GraphQLArgument, -} from '../type/definition'; -import { GraphQLDirective } from '../type/directives'; -import { TypeInfo } from '../utilities/TypeInfo'; -import { specifiedRules } from './specifiedRules'; + GraphQLInputType, + GraphQLOutputType, + GraphQLCompositeType, + GraphQLField, + GraphQLArgument, +} from "../type/definition"; +import { GraphQLDirective } from "../type/directives"; +import { TypeInfo } from "../utilities/TypeInfo"; +import { specifiedRules } from "./specifiedRules"; /** * Implements the "Validation" section of the spec. @@ -32,11 +32,7 @@ import { specifiedRules } from './specifiedRules'; * (see the language/visitor API). Visitor methods are expected to return * GraphQLErrors, or Arrays of GraphQLErrors when invalid. */ -export function validate( - schema: GraphQLSchema, - ast: DocumentNode, - rules?: any[], -): GraphQLError[]; +export function validate(schema: GraphQLSchema, ast: DocumentNode, rules?: any[]): GraphQLError[]; /** * This uses a specialized visitor which runs multiple visitors in parallel, @@ -45,18 +41,16 @@ export function validate( * @internal */ export function visitUsingRules( - schema: GraphQLSchema, - typeInfo: TypeInfo, - documentAST: DocumentNode, - rules: any[], + schema: GraphQLSchema, + typeInfo: TypeInfo, + documentAST: DocumentNode, + rules: any[] ): GraphQLError[]; -export type NodeWithSelectionSet = - | OperationDefinitionNode - | FragmentDefinitionNode; +export type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode; export interface VariableUsage { - node: VariableNode; - type: GraphQLInputType; + node: VariableNode; + type: GraphQLInputType; } /** @@ -65,38 +59,34 @@ export interface VariableUsage { * validation rule. */ export class ValidationContext { - constructor(schema: GraphQLSchema, ast: DocumentNode, typeInfo: TypeInfo); - reportError(error: GraphQLError): void; + constructor(schema: GraphQLSchema, ast: DocumentNode, typeInfo: TypeInfo); + reportError(error: GraphQLError): void; - getErrors(): GraphQLError[]; + getErrors(): GraphQLError[]; - getSchema(): GraphQLSchema; + getSchema(): GraphQLSchema; - getDocument(): DocumentNode; + getDocument(): DocumentNode; - getFragment(name: string): FragmentDefinitionNode; + getFragment(name: string): FragmentDefinitionNode; - getFragmentSpreads(node: SelectionSetNode): FragmentSpreadNode[]; + getFragmentSpreads(node: SelectionSetNode): FragmentSpreadNode[]; - getRecursivelyReferencedFragments( - operation: OperationDefinitionNode, - ): FragmentDefinitionNode[]; + getRecursivelyReferencedFragments(operation: OperationDefinitionNode): FragmentDefinitionNode[]; - getVariableUsages(node: NodeWithSelectionSet): VariableUsage[]; + getVariableUsages(node: NodeWithSelectionSet): VariableUsage[]; - getRecursiveVariableUsages( - operation: OperationDefinitionNode, - ): VariableUsage[]; + getRecursiveVariableUsages(operation: OperationDefinitionNode): VariableUsage[]; - getType(): GraphQLOutputType; + getType(): GraphQLOutputType; - getParentType(): GraphQLCompositeType; + getParentType(): GraphQLCompositeType; - getInputType(): GraphQLInputType; + getInputType(): GraphQLInputType; - getFieldDef(): GraphQLField; + getFieldDef(): GraphQLField; - getDirective(): GraphQLDirective; + getDirective(): GraphQLDirective; - getArgument(): GraphQLArgument; + getArgument(): GraphQLArgument; } From a36ed3e3f1e9b078d734f367d36cd7d83d0eaa26 Mon Sep 17 00:00:00 2001 From: Andyma <66229754@qq.com> Date: Tue, 27 Mar 2018 21:35:01 +0800 Subject: [PATCH 0248/2153] Update index.d.ts Add new line at the end of file --- types/datatables.net-colreorder/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/datatables.net-colreorder/index.d.ts b/types/datatables.net-colreorder/index.d.ts index 80a9fa4e41..3aad7a3050 100644 --- a/types/datatables.net-colreorder/index.d.ts +++ b/types/datatables.net-colreorder/index.d.ts @@ -61,4 +61,4 @@ declare namespace DataTables { transpose(idx?: number | number[], direction?: "toCurrent" | "toOriginal" | "fromOriginal" | "fromCurrent"): Api; } } -} \ No newline at end of file +} From f15c95af975405503bc17137a3c7ad78e701da0c Mon Sep 17 00:00:00 2001 From: Andyma <66229754@qq.com> Date: Tue, 27 Mar 2018 21:35:30 +0800 Subject: [PATCH 0249/2153] Update tsconfig.json Add new line at the end of file --- types/datatables.net-colreorder/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/datatables.net-colreorder/tsconfig.json b/types/datatables.net-colreorder/tsconfig.json index 97ef7b2fc0..ec5e47bb49 100644 --- a/types/datatables.net-colreorder/tsconfig.json +++ b/types/datatables.net-colreorder/tsconfig.json @@ -21,4 +21,4 @@ "index.d.ts", "datatables.net-colreorder-tests.ts" ] -} \ No newline at end of file +} From 674904267086c4d9da061a888805901bfaceb95d Mon Sep 17 00:00:00 2001 From: Alex Dunne Date: Tue, 27 Mar 2018 14:46:53 +0100 Subject: [PATCH 0250/2153] [react-native] Added missing ReactART types --- types/react-native/index.d.ts | 56 +++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 5 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index ee2ad9adc1..934b738293 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -6,6 +6,7 @@ // Tim Wang // Kamal Mahyuddin // Naoufal El Yousfi +// Alex Dunne // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -8258,26 +8259,71 @@ interface ImageEditorStatic { ): void; } -export interface ARTShapeProps { - d: string; - strokeWidth: number; +export interface ARTNodeMixin { + opacity?: number; + originX?: number; + originY?: number; + scaleX?: number; + scaleY?: number; + scale?: number; + title?: string; + x?: number; + y?: number; + visible?: boolean; +} + +export interface ARTGroupProps extends ARTNodeMixin { + width?: number; + height?: number; +} + +export interface ARTClippingRectangleProps extends ARTNodeMixin { + width?: number; + height?: number; +} + +export interface ARTRenderableMixin extends ARTNodeMixin { + fill?: string; + stroke?: string; + strokeCap?: "butt" | "square" | "round"; strokeDash?: number[]; - stroke: string; + strokeJoin?: "bevel" | "miter" | "round"; + strokeWidth?: number; +} + +export interface ARTShapeProps extends ARTRenderableMixin { + d: string; + width?: number; + height?: number; +} + +export interface ARTTextProps extends ARTRenderableMixin { + font?: string; + alignment?: string; } export interface ARTSurfaceProps { - style: StyleProp; + style?: StyleProp; width: number; height: number; } +export interface ClippingRectangleStatic extends React.ComponentClass {} + +export interface GroupStatic extends React.ComponentClass {} + export interface ShapeStatic extends React.ComponentClass {} export interface SurfaceStatic extends React.ComponentClass {} +export interface ARTTextStatic extends React.ComponentClass {} + export interface ARTStatic { + ClippingRectangle: ClippingRectangleStatic; + Group: GroupStatic; Shape: ShapeStatic; Surface: SurfaceStatic; + Text: ARTTextStatic; } export interface KeyboardStatic extends NativeEventEmitter { From ecd09a22a92ecba606f474b9ec504ca72d12c9af Mon Sep 17 00:00:00 2001 From: Alex Cason Date: Tue, 27 Mar 2018 14:52:06 +0100 Subject: [PATCH 0251/2153] Update google drive API typing --- .../gapi.client.drive-tests.ts | 86 ++++++++++--------- types/gapi.client.drive/index.d.ts | 84 +++++++++++++----- types/gapi.client.drive/tsconfig.json | 2 +- 3 files changed, 111 insertions(+), 61 deletions(-) diff --git a/types/gapi.client.drive/gapi.client.drive-tests.ts b/types/gapi.client.drive/gapi.client.drive-tests.ts index f9fa0ce332..002b5e7eb6 100644 --- a/types/gapi.client.drive/gapi.client.drive-tests.ts +++ b/types/gapi.client.drive/gapi.client.drive-tests.ts @@ -43,15 +43,15 @@ gapi.load('client', () => { async function run() { /** Gets information about the user, the user's Drive, and system capabilities. */ - await gapi.client.about.get({ + await gapi.client.drive.about.get({ }); /** Gets the starting pageToken for listing future changes. */ - await gapi.client.changes.getStartPageToken({ + await gapi.client.drive.changes.getStartPageToken({ supportsTeamDrives: true, teamDriveId: "teamDriveId", }); /** Lists the changes for a user or Team Drive. */ - await gapi.client.changes.list({ + await gapi.client.drive.changes.list({ includeCorpusRemovals: true, includeRemoved: true, includeTeamDriveItems: true, @@ -63,7 +63,7 @@ gapi.load('client', () => { teamDriveId: "teamDriveId", }); /** Subscribes to changes for a user. */ - await gapi.client.changes.watch({ + await gapi.client.drive.changes.watch({ includeCorpusRemovals: true, includeRemoved: true, includeTeamDriveItems: true, @@ -75,25 +75,25 @@ gapi.load('client', () => { teamDriveId: "teamDriveId", }); /** Stop watching resources through this channel */ - await gapi.client.channels.stop({ + await gapi.client.drive.channels.stop({ }); /** Creates a new comment on a file. */ - await gapi.client.comments.create({ + await gapi.client.drive.comments.create({ fileId: "fileId", }); /** Deletes a comment. */ - await gapi.client.comments.delete({ + await gapi.client.drive.comments.delete({ commentId: "commentId", fileId: "fileId", }); /** Gets a comment by ID. */ - await gapi.client.comments.get({ + await gapi.client.drive.comments.get({ commentId: "commentId", fileId: "fileId", includeDeleted: true, }); /** Lists a file's comments. */ - await gapi.client.comments.list({ + await gapi.client.drive.comments.list({ fileId: "fileId", includeDeleted: true, pageSize: 3, @@ -101,12 +101,12 @@ gapi.load('client', () => { startModifiedTime: "startModifiedTime", }); /** Updates a comment with patch semantics. */ - await gapi.client.comments.update({ + await gapi.client.drive.comments.update({ commentId: "commentId", fileId: "fileId", }); /** Creates a copy of a file and applies any requested updates with patch semantics. */ - await gapi.client.files.copy({ + await gapi.client.drive.files.copy({ fileId: "fileId", ignoreDefaultVisibility: true, keepRevisionForever: true, @@ -114,7 +114,7 @@ gapi.load('client', () => { supportsTeamDrives: true, }); /** Creates a new file. */ - await gapi.client.files.create({ + await gapi.client.drive.files.create({ ignoreDefaultVisibility: true, keepRevisionForever: true, ocrLanguage: "ocrLanguage", @@ -125,31 +125,31 @@ gapi.load('client', () => { * Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a Team Drive the user must be an organizer on the * parent. If the target is a folder, all descendants owned by the user are also deleted. */ - await gapi.client.files.delete({ + await gapi.client.drive.files.delete({ fileId: "fileId", supportsTeamDrives: true, }); /** Permanently deletes all of the user's trashed files. */ - await gapi.client.files.emptyTrash({ + await gapi.client.drive.files.emptyTrash({ }); /** Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB. */ - await gapi.client.files.export({ + await gapi.client.drive.files.export({ fileId: "fileId", mimeType: "mimeType", }); /** Generates a set of file IDs which can be provided in create requests. */ - await gapi.client.files.generateIds({ + await gapi.client.drive.files.generateIds({ count: 1, space: "space", }); /** Gets a file's metadata or content by ID. */ - await gapi.client.files.get({ + await gapi.client.drive.files.get({ acknowledgeAbuse: true, fileId: "fileId", supportsTeamDrives: true, }); /** Lists or searches files. */ - await gapi.client.files.list({ + await gapi.client.drive.files.list({ corpora: "corpora", corpus: "corpus", includeTeamDriveItems: true, @@ -162,7 +162,7 @@ gapi.load('client', () => { teamDriveId: "teamDriveId", }); /** Updates a file's metadata and/or content with patch semantics. */ - await gapi.client.files.update({ + await gapi.client.drive.files.update({ addParents: "addParents", fileId: "fileId", keepRevisionForever: true, @@ -172,66 +172,71 @@ gapi.load('client', () => { useContentAsIndexableText: true, }); /** Subscribes to changes to a file */ - await gapi.client.files.watch({ + await gapi.client.drive.files.watch({ acknowledgeAbuse: true, fileId: "fileId", supportsTeamDrives: true, }); /** Creates a permission for a file or Team Drive. */ - await gapi.client.permissions.create({ + await gapi.client.drive.permissions.create({ emailMessage: "emailMessage", fileId: "fileId", sendNotificationEmail: true, supportsTeamDrives: true, transferOwnership: true, + useDomainAdminAccess: true, }); /** Deletes a permission. */ - await gapi.client.permissions.delete({ + await gapi.client.drive.permissions.delete({ fileId: "fileId", permissionId: "permissionId", supportsTeamDrives: true, + useDomainAdminAccess: true, }); /** Gets a permission by ID. */ - await gapi.client.permissions.get({ + await gapi.client.drive.permissions.get({ fileId: "fileId", permissionId: "permissionId", supportsTeamDrives: true, + useDomainAdminAccess: true, }); /** Lists a file's or Team Drive's permissions. */ - await gapi.client.permissions.list({ + await gapi.client.drive.permissions.list({ fileId: "fileId", pageSize: 2, pageToken: "pageToken", supportsTeamDrives: true, + useDomainAdminAccess: true, }); /** Updates a permission with patch semantics. */ - await gapi.client.permissions.update({ + await gapi.client.drive.permissions.update({ fileId: "fileId", permissionId: "permissionId", removeExpiration: true, supportsTeamDrives: true, transferOwnership: true, + useDomainAdminAccess: true, }); /** Creates a new reply to a comment. */ - await gapi.client.replies.create({ + await gapi.client.drive.replies.create({ commentId: "commentId", fileId: "fileId", }); /** Deletes a reply. */ - await gapi.client.replies.delete({ + await gapi.client.drive.replies.delete({ commentId: "commentId", fileId: "fileId", replyId: "replyId", }); /** Gets a reply by ID. */ - await gapi.client.replies.get({ + await gapi.client.drive.replies.get({ commentId: "commentId", fileId: "fileId", includeDeleted: true, replyId: "replyId", }); /** Lists a comment's replies. */ - await gapi.client.replies.list({ + await gapi.client.drive.replies.list({ commentId: "commentId", fileId: "fileId", includeDeleted: true, @@ -239,52 +244,55 @@ gapi.load('client', () => { pageToken: "pageToken", }); /** Updates a reply with patch semantics. */ - await gapi.client.replies.update({ + await gapi.client.drive.replies.update({ commentId: "commentId", fileId: "fileId", replyId: "replyId", }); /** Permanently deletes a revision. This method is only applicable to files with binary content in Drive. */ - await gapi.client.revisions.delete({ + await gapi.client.drive.revisions.delete({ fileId: "fileId", revisionId: "revisionId", }); /** Gets a revision's metadata or content by ID. */ - await gapi.client.revisions.get({ + await gapi.client.drive.revisions.get({ acknowledgeAbuse: true, fileId: "fileId", revisionId: "revisionId", }); /** Lists a file's revisions. */ - await gapi.client.revisions.list({ + await gapi.client.drive.revisions.list({ fileId: "fileId", pageSize: 2, pageToken: "pageToken", }); /** Updates a revision with patch semantics. */ - await gapi.client.revisions.update({ + await gapi.client.drive.revisions.update({ fileId: "fileId", revisionId: "revisionId", }); /** Creates a new Team Drive. */ - await gapi.client.teamdrives.create({ + await gapi.client.drive.teamdrives.create({ requestId: "requestId", }); /** Permanently deletes a Team Drive for which the user is an organizer. The Team Drive cannot contain any untrashed items. */ - await gapi.client.teamdrives.delete({ + await gapi.client.drive.teamdrives.delete({ teamDriveId: "teamDriveId", }); /** Gets a Team Drive's metadata by ID. */ - await gapi.client.teamdrives.get({ + await gapi.client.drive.teamdrives.get({ teamDriveId: "teamDriveId", + useDomainAdminAccess: true, }); /** Lists the user's Team Drives. */ - await gapi.client.teamdrives.list({ + await gapi.client.drive.teamdrives.list({ pageSize: 1, pageToken: "pageToken", + q: "q", + useDomainAdminAccess: true, }); /** Updates a Team Drive's metadata */ - await gapi.client.teamdrives.update({ + await gapi.client.drive.teamdrives.update({ teamDriveId: "teamDriveId", }); } diff --git a/types/gapi.client.drive/index.d.ts b/types/gapi.client.drive/index.d.ts index 7004e2c0bb..a2fbec1a34 100644 --- a/types/gapi.client.drive/index.d.ts +++ b/types/gapi.client.drive/index.d.ts @@ -16,28 +16,12 @@ declare namespace gapi.client { function load(name: "drive", version: "v3"): PromiseLike; function load(name: "drive", version: "v3", callback: () => any): void; - const about: drive.AboutResource; - - const changes: drive.ChangesResource; - - const channels: drive.ChannelsResource; - - const comments: drive.CommentsResource; - - const files: drive.FilesResource; - - const permissions: drive.PermissionsResource; - - const replies: drive.RepliesResource; - - const revisions: drive.RevisionsResource; - - const teamdrives: drive.TeamdrivesResource; - namespace drive { interface About { /** Whether the user has installed the requesting app. */ appInstalled?: boolean; + /** Whether the user can create Team Drives. */ + canCreateTeamDrives?: boolean; /** A map of source MIME type to possible targets for all supported exports. */ exportFormats?: Record; /** The currently supported folder colors as RGB hex strings. */ @@ -363,8 +347,9 @@ declare namespace gapi.client { owners?: User[]; /** * The IDs of the parent folders which contain the file. - * If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and - * removeParents parameters to modify the values. + * If not specified as part of a create request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy + * request, the file will inherit any discoverable parents of the source file. Update requests must use the addParents and removeParents parameters to + * modify the parents list. */ parents?: string[]; /** List of permission IDs for users with access to this file. */ @@ -683,6 +668,8 @@ declare namespace gapi.client { }; /** The color of this Team Drive as an RGB hex string. It can only be set on a drive.teamdrives.update request that does not set themeId. */ colorRgb?: string; + /** The time at which the Team Drive was created (RFC 3339 date-time). */ + createdTime?: string; /** The ID of this Team Drive which is also the ID of the top level folder for this Team Drive. */ id?: string; /** Identifies what kind of resource this is. Value: the fixed string "drive#teamDrive". */ @@ -1322,7 +1309,7 @@ declare namespace gapi.client { create(request: { /** Data format for the response. */ alt?: string; - /** A custom message to include in the notification email. */ + /** A plain text custom message to include in the notification email. */ emailMessage?: string; /** Selector specifying which fields to include in a partial response. */ fields?: string; @@ -1351,6 +1338,11 @@ declare namespace gapi.client { * the side effect. */ transferOwnership?: boolean; + /** + * Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they + * are an administrator of the domain to which the item belongs. + */ + useDomainAdminAccess?: boolean; /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ userIp?: string; }): Request; @@ -1377,6 +1369,11 @@ declare namespace gapi.client { quotaUser?: string; /** Whether the requesting application supports Team Drives. */ supportsTeamDrives?: boolean; + /** + * Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they + * are an administrator of the domain to which the item belongs. + */ + useDomainAdminAccess?: boolean; /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ userIp?: string; }): Request; @@ -1403,6 +1400,11 @@ declare namespace gapi.client { quotaUser?: string; /** Whether the requesting application supports Team Drives. */ supportsTeamDrives?: boolean; + /** + * Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they + * are an administrator of the domain to which the item belongs. + */ + useDomainAdminAccess?: boolean; /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ userIp?: string; }): Request; @@ -1434,6 +1436,11 @@ declare namespace gapi.client { quotaUser?: string; /** Whether the requesting application supports Team Drives. */ supportsTeamDrives?: boolean; + /** + * Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they + * are an administrator of the domain to which the item belongs. + */ + useDomainAdminAccess?: boolean; /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ userIp?: string; }): Request; @@ -1467,6 +1474,11 @@ declare namespace gapi.client { * the side effect. */ transferOwnership?: boolean; + /** + * Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they + * are an administrator of the domain to which the item belongs. + */ + useDomainAdminAccess?: boolean; /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ userIp?: string; }): Request; @@ -1777,6 +1789,11 @@ declare namespace gapi.client { quotaUser?: string; /** The ID of the Team Drive */ teamDriveId: string; + /** + * Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they + * are an administrator of the domain to which the Team Drive belongs. + */ + useDomainAdminAccess?: boolean; /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ userIp?: string; }): Request; @@ -1796,11 +1813,18 @@ declare namespace gapi.client { pageToken?: string; /** Returns response with indentations and line breaks. */ prettyPrint?: boolean; + /** Query string for searching Team Drives. */ + q?: string; /** * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. * Overrides userIp if both are provided. */ quotaUser?: string; + /** + * Whether the request should be treated as if it was issued by a domain administrator; if set to true, then all Team Drives of the domain in which the + * requester is an administrator are returned. + */ + useDomainAdminAccess?: boolean; /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ userIp?: string; }): Request; @@ -1827,5 +1851,23 @@ declare namespace gapi.client { userIp?: string; }): Request; } + + const about: drive.AboutResource; + + const changes: drive.ChangesResource; + + const channels: drive.ChannelsResource; + + const comments: drive.CommentsResource; + + const files: drive.FilesResource; + + const permissions: drive.PermissionsResource; + + const replies: drive.RepliesResource; + + const revisions: drive.RevisionsResource; + + const teamdrives: drive.TeamdrivesResource; } } diff --git a/types/gapi.client.drive/tsconfig.json b/types/gapi.client.drive/tsconfig.json index 0cdc6f7fab..6d5901b410 100644 --- a/types/gapi.client.drive/tsconfig.json +++ b/types/gapi.client.drive/tsconfig.json @@ -14,7 +14,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, "strictFunctionTypes": true }, "files": [ From 514ac95272fc18a82cd7f2795b2f75e69470c850 Mon Sep 17 00:00:00 2001 From: Fathy Boundjadj Date: Tue, 27 Mar 2018 15:53:10 +0200 Subject: [PATCH 0252/2153] Add Parcel environment typings --- types/parcel-env/index.d.ts | 177 +++++++++++++++++++++++++++ types/parcel-env/parcel-env-tests.ts | 76 ++++++++++++ types/parcel-env/tsconfig.json | 23 ++++ types/parcel-env/tslint.json | 79 ++++++++++++ 4 files changed, 355 insertions(+) create mode 100644 types/parcel-env/index.d.ts create mode 100644 types/parcel-env/parcel-env-tests.ts create mode 100644 types/parcel-env/tsconfig.json create mode 100644 types/parcel-env/tslint.json diff --git a/types/parcel-env/index.d.ts b/types/parcel-env/index.d.ts new file mode 100644 index 0000000000..3de90c93bf --- /dev/null +++ b/types/parcel-env/index.d.ts @@ -0,0 +1,177 @@ +// Type definitions for Parcel (module API) +// Project: https://github.com/parcel/parcel-bundler +// Definitions by: Fathy Boundjadj +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Based on @types/webpack-env + +/** + * Parcel module API - variables and global functions available inside modules + */ + +declare namespace __ParcelModuleApi { + interface RequireFunction { + /** + * Returns the exports from a dependency. The call is sync. No request to the server is fired. The compiler ensures that the dependency is available. + */ + (path: string): any; + (path: string): T; + } + + interface Module { + exports: any; + require(id: string): any; + require(id: string): T; + id: string; + filename: string; + loaded: boolean; + parent: any; + children: any[]; + hot?: Hot; + } + type ModuleId = string|number; + + interface Hot { + /** + * Accept code updates for the specified dependencies. The callback is called when dependencies were replaced. + * @param dependencies + * @param callback + */ + accept(dependencies: string[], callback: (updatedDependencies: ModuleId[]) => void): void; + /** + * Accept code updates for the specified dependencies. The callback is called when dependencies were replaced. + * @param dependency + * @param callback + */ + accept(dependency: string, callback: () => void): void; + /** + * Accept code updates for this module without notification of parents. + * This should only be used if the module doesn’t export anything. + * The errHandler can be used to handle errors that occur while loading the updated module. + * @param errHandler + */ + accept(errHandler?: (err: Error) => void): void; + /** + * Do not accept updates for the specified dependencies. If any dependencies is updated, the code update fails with code "decline". + */ + decline(dependencies: string[]): void; + /** + * Do not accept updates for the specified dependencies. If any dependencies is updated, the code update fails with code "decline". + */ + decline(dependency: string): void; + /** + * Flag the current module as not update-able. If updated the update code would fail with code "decline". + */ + decline(): void; + /** + * Add a one time handler, which is executed when the current module code is replaced. + * Here you should destroy/remove any persistent resource you have claimed/created. + * If you want to transfer state to the new module, add it to data object. + * The data will be available at module.hot.data on the new module. + * @param callback + */ + dispose(callback: (data: any) => void): void; + dispose(callback: (data: T) => void): void; + /** + * Add a one time handler, which is executed when the current module code is replaced. + * Here you should destroy/remove any persistent resource you have claimed/created. + * If you want to transfer state to the new module, add it to data object. + * The data will be available at module.hot.data on the new module. + * @param callback + */ + addDisposeHandler(callback: (data: any) => void): void; + addDisposeHandler(callback: (data: T) => void): void; + /** + * Remove a handler. + * This can useful to add a temporary dispose handler. You could i. e. replace code while in the middle of a multi-step async function. + * @param callback + */ + removeDisposeHandler(callback: (data: any) => void): void; + removeDisposeHandler(callback: (data: T) => void): void; + /** + * Throws an exceptions if status() is not idle. + * Check all currently loaded modules for updates and apply updates if found. + * If no update was found, the callback is called with null. + * If autoApply is truthy the callback will be called with all modules that were disposed. + * apply() is automatically called with autoApply as options parameter. + * If autoApply is not set the callback will be called with all modules that will be disposed on apply(). + * @param autoApply + * @param callback + */ + check(autoApply: boolean, callback: (err: Error, outdatedModules: ModuleId[]) => void): void; + /** + * Throws an exceptions if status() is not idle. + * Check all currently loaded modules for updates and apply updates if found. + * If no update was found, the callback is called with null. + * The callback will be called with all modules that will be disposed on apply(). + * @param callback + */ + check(callback: (err: Error, outdatedModules: ModuleId[]) => void): void; + /** + * If status() != "ready" it throws an error. + * Continue the update process. + * @param options + * @param callback + */ + apply(options: AcceptOptions, callback: (err: Error, outdatedModules: ModuleId[]) => void): void; + /** + * If status() != "ready" it throws an error. + * Continue the update process. + * @param callback + */ + apply(callback: (err: Error, outdatedModules: ModuleId[]) => void): void; + /** + * Return one of idle, check, watch, watch-delay, prepare, ready, dispose, apply, abort or fail. + */ + status(): string; + /** Register a callback on status change. */ + status(callback: (status: string) => void): void; + /** Register a callback on status change. */ + addStatusHandler(callback: (status: string) => void): void; + /** + * Remove a registered status change handler. + * @param callback + */ + removeStatusHandler(callback: (status: string) => void): void; + + active: boolean; + data: any; + } + + interface AcceptOptions { + /** + * If true the update process continues even if some modules are not accepted (and would bubble to the entry point). + */ + ignoreUnaccepted?: boolean; + /** + * Indicates that apply() is automatically called by check function + */ + autoApply?: boolean; + } + /** + * Inside env you can pass any variable + */ + interface NodeProcess { + env?: any; + } + + type __Require1 = (id: string) => any; + type __Require2 = (id: string) => T; + type RequireLambda = __Require1 & __Require2; +} + +interface NodeRequire extends __ParcelModuleApi.RequireFunction { +} + +declare var require: NodeRequire; + +interface NodeModule extends __ParcelModuleApi.Module {} + +declare var module: NodeModule; + +/** +* Declare process variable +*/ +declare namespace NodeJS { + interface Process extends __ParcelModuleApi.NodeProcess {} +} +declare var process: NodeJS.Process; diff --git a/types/parcel-env/parcel-env-tests.ts b/types/parcel-env/parcel-env-tests.ts new file mode 100644 index 0000000000..9c17be0748 --- /dev/null +++ b/types/parcel-env/parcel-env-tests.ts @@ -0,0 +1,76 @@ + + +interface SomeModule { + someMethod(): void; +} + +let someModule = require('./someModule'); +someModule.someMethod(); + +let otherModule = require('./otherModule'); +otherModule.otherMethod(); + +// check if HMR is enabled +if(module.hot) { + // accept update of dependency + module.hot.accept("./handler.js", function() { + //... + }); +} + +module.exports = null; + +// check if HMR is enabled +if(module.hot) { + + // accept itself + module.hot.accept(); + + // dispose handler + module.hot.dispose(function() { + // revoke the side effect + //... + }); +} + +class ModuleData { + updated: boolean; +} + +if (module.hot) { + module.hot.accept((err: Error) => { + //... + }); + + module.hot.decline("./someModule"); + + module.hot.dispose((data: ModuleData) => { + data.updated = true; + // ... + }); + + let disposeHandler: ((data: ModuleData) => void) = data => { + // ... + }; + module.hot.addDisposeHandler(disposeHandler); + module.hot.removeDisposeHandler(disposeHandler); + + module.hot.check(true, (err: Error, outdatedModules: (string|number)[]) => { + // ... + }); + + module.hot.apply({ ignoreUnaccepted: true }, (err: Error, outdatedModules: (string|number)[]) => { + // ... + }); + + var status: string = module.hot.status(); + let statusHandler: ((status: string) => void) = status => { + // ... + }; + module.hot.status(statusHandler); + module.hot.addStatusHandler(statusHandler); + module.hot.removeStatusHandler(statusHandler); +} + + + diff --git a/types/parcel-env/tsconfig.json b/types/parcel-env/tsconfig.json new file mode 100644 index 0000000000..bf765d8bae --- /dev/null +++ b/types/parcel-env/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "parcel-env-tests.ts" + ] +} diff --git a/types/parcel-env/tslint.json b/types/parcel-env/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/parcel-env/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} From 6e7636d31b361fa1c596875a3c83faf5ecd8b709 Mon Sep 17 00:00:00 2001 From: Alex Cason Date: Tue, 27 Mar 2018 15:09:08 +0100 Subject: [PATCH 0253/2153] Resolve linting errors --- types/gapi.client.drive/index.d.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/types/gapi.client.drive/index.d.ts b/types/gapi.client.drive/index.d.ts index a2fbec1a34..1b2a939a7d 100644 --- a/types/gapi.client.drive/index.d.ts +++ b/types/gapi.client.drive/index.d.ts @@ -1852,22 +1852,22 @@ declare namespace gapi.client { }): Request; } - const about: drive.AboutResource; + const about: AboutResource; - const changes: drive.ChangesResource; + const changes: ChangesResource; - const channels: drive.ChannelsResource; + const channels: ChannelsResource; - const comments: drive.CommentsResource; + const comments: CommentsResource; - const files: drive.FilesResource; + const files: FilesResource; - const permissions: drive.PermissionsResource; + const permissions: PermissionsResource; - const replies: drive.RepliesResource; + const replies: RepliesResource; - const revisions: drive.RevisionsResource; + const revisions: RevisionsResource; - const teamdrives: drive.TeamdrivesResource; + const teamdrives: TeamdrivesResource; } } From 5a64d54d733c4ae65806980bd0d36c68aadc260f Mon Sep 17 00:00:00 2001 From: ikokostya Date: Tue, 27 Mar 2018 17:54:26 +0300 Subject: [PATCH 0254/2153] @types/node: Add url.domainToASCII, url.domainToUnicode --- types/node/index.d.ts | 3 +++ types/node/node-tests.ts | 5 +++++ types/node/v7/index.d.ts | 3 +++ types/node/v7/node-tests.ts | 5 +++++ types/node/v8/index.d.ts | 3 +++ types/node/v8/node-tests.ts | 5 +++++ 6 files changed, 24 insertions(+) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 0994982b41..2e31fff6e6 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -2361,6 +2361,9 @@ declare module "url" { export function format(urlObject: UrlObject | string): string; export function resolve(from: string, to: string): string; + export function domainToASCII(domain: string): string; + export function domainToUnicode(domain: string): string; + export interface URLFormatOptions { auth?: boolean; fragment?: boolean; diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index 08dbb68b8a..89d87578d9 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -635,6 +635,11 @@ namespace url_tests { } } + { + const ascii: string = url.domainToASCII('español.com'); + const unicode: string = url.domainToUnicode('xn--espaol-zwa.com'); + } + { let myURL = new url.URL('https://theuser:thepwd@example.org:81/foo/path?query=string#bar'); assert.equal(myURL.hash, '#bar'); diff --git a/types/node/v7/index.d.ts b/types/node/v7/index.d.ts index 748f932d80..62e30f0f09 100644 --- a/types/node/v7/index.d.ts +++ b/types/node/v7/index.d.ts @@ -2024,6 +2024,9 @@ declare module "url" { export function format(urlObject: UrlObject | string): string; export function resolve(from: string, to: string): string; + export function domainToASCII(domain: string): string; + export function domainToUnicode(domain: string): string; + export interface URLFormatOptions { auth?: boolean; fragment?: boolean; diff --git a/types/node/v7/node-tests.ts b/types/node/v7/node-tests.ts index eb25e01f10..cc46b1f8e4 100644 --- a/types/node/v7/node-tests.ts +++ b/types/node/v7/node-tests.ts @@ -475,6 +475,11 @@ namespace url_tests { assert.equal(helloUrl.query.hello, 'world'); } + { + const ascii: string = url.domainToASCII('español.com'); + const unicode: string = url.domainToUnicode('xn--espaol-zwa.com'); + } + { let myURL = new url.URL('https://theuser:thepwd@example.org:81/foo/path?query=string#bar'); assert.equal(myURL.hash, '#bar'); diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index 1697093de7..fd1f5cafae 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -2350,6 +2350,9 @@ declare module "url" { export function format(urlObject: UrlObject | string): string; export function resolve(from: string, to: string): string; + export function domainToASCII(domain: string): string; + export function domainToUnicode(domain: string): string; + export interface URLFormatOptions { auth?: boolean; fragment?: boolean; diff --git a/types/node/v8/node-tests.ts b/types/node/v8/node-tests.ts index b63d494fbd..58c1319261 100644 --- a/types/node/v8/node-tests.ts +++ b/types/node/v8/node-tests.ts @@ -609,6 +609,11 @@ namespace url_tests { } } + { + const ascii: string = url.domainToASCII('español.com'); + const unicode: string = url.domainToUnicode('xn--espaol-zwa.com'); + } + { let myURL = new url.URL('https://theuser:thepwd@example.org:81/foo/path?query=string#bar'); assert.equal(myURL.hash, '#bar'); From b4dd9f41919bbe7efe99a7d6b9d1a1322a61037f Mon Sep 17 00:00:00 2001 From: Tom Wanzek Date: Tue, 27 Mar 2018 11:12:31 -0400 Subject: [PATCH 0255/2153] feat(d3-fetch): update to minor version 1.1 * Update d3-fetch to minor version 1.1. * Add `html(...)` * Add `svg(...)` * Add `xml(...)` Closes #24516 --- types/d3-fetch/d3-fetch-tests.ts | 11 +++++++++++ types/d3-fetch/index.d.ts | 34 ++++++++++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/types/d3-fetch/d3-fetch-tests.ts b/types/d3-fetch/d3-fetch-tests.ts index 941955c996..3cffde0c9e 100644 --- a/types/d3-fetch/d3-fetch-tests.ts +++ b/types/d3-fetch/d3-fetch-tests.ts @@ -49,3 +49,14 @@ promise1 = d3Fetch.tsv(url); promise1 = d3Fetch.tsv(url, init); promise2 = d3Fetch.tsv(url, parseRow); promise2 = d3Fetch.tsv(url, init, parseRow); + +let docPromise: Promise; +docPromise = d3Fetch.hmtl(url); +docPromise = d3Fetch.hmtl(url, init); + +docPromise = d3Fetch.svg(url); +docPromise = d3Fetch.svg(url, init); + +let xmlDocPromise: Promise; +xmlDocPromise = d3Fetch.xml(url); +xmlDocPromise = d3Fetch.xml(url, init); diff --git a/types/d3-fetch/index.d.ts b/types/d3-fetch/index.d.ts index 3eb11ce48a..fc0d5e0e66 100644 --- a/types/d3-fetch/index.d.ts +++ b/types/d3-fetch/index.d.ts @@ -1,10 +1,10 @@ -// Type definitions for d3-fetch 1.0 +// Type definitions for d3-fetch 1.1 // Project: https://d3js.org/d3-fetch/ // Definitions by: Hugues Stefanski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -// Last module patch version validated against: 1.0.1 +// Last module patch version validated against: 1.1.0 import { DSVParsedArray, DSVRowString, DSVRowAny } from 'd3-dsv'; @@ -146,6 +146,16 @@ export function dsv( row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null ): Promise>; +/** + * Fetches the file at the specified input URL as text, parses it as HTML and returns a Promise of an HTML DOM Document. + * + * If init is specified, it is passed along to the underlying call to fetch. + * + * @param url A valid URL string. + * @param init An optional request initialization object. + */ +export function hmtl(url: string, init?: RequestInit): Promise; + /** * Fetches the image at the specified input URL and returns a promise of an HTML image element. * @@ -168,6 +178,16 @@ export function image(url: string, init?: {[key: string]: any}): Promise(url: string, init?: RequestInit): Promise; +/** + * Fetches the file at the specified input URL as text, parses it as SVG and returns a Promise of an SVG Document. + * + * If init is specified, it is passed along to the underlying call to fetch. + * + * @param url A valid URL string. + * @param init An optional request initialization object. + */ +export function svg(url: string, init?: RequestInit): Promise; + /** * Fetches the text file at the specified input URL and returns it as a Promise of a string. * @@ -234,3 +254,13 @@ export function tsv( init: RequestInit, row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null ): Promise>; + +/** + * Fetches the file at the specified input URL as text, parses it as XML and returns a Promise of an XML Document. + * + * If init is specified, it is passed along to the underlying call to fetch. + * + * @param url A valid URL string. + * @param init An optional request initialization object. + */ +export function xml(url: string, init?: RequestInit): Promise; From fbe95c0b1a1d99de3309fbc4e49c752113ee94d0 Mon Sep 17 00:00:00 2001 From: Erik Moldtmann Date: Tue, 27 Mar 2018 17:24:14 +0200 Subject: [PATCH 0256/2153] allow JS strings and string arrays where Git.Strarray is required, because nodegit can automatically convert it to Git.Strarray --- types/nodegit/checkout-options.d.ts | 2 +- types/nodegit/diff-options.d.ts | 2 +- types/nodegit/fetch-options.d.ts | 2 +- types/nodegit/index_.d.ts | 6 +++--- types/nodegit/path-spec.d.ts | 2 +- types/nodegit/push-options.d.ts | 2 +- types/nodegit/remote.d.ts | 2 +- types/nodegit/reset.d.ts | 2 +- types/nodegit/status-options.d.ts | 2 +- types/nodegit/tag.d.ts | 2 +- types/nodegit/transport.d.ts | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/types/nodegit/checkout-options.d.ts b/types/nodegit/checkout-options.d.ts index d711ae7ba9..6971f59f3a 100644 --- a/types/nodegit/checkout-options.d.ts +++ b/types/nodegit/checkout-options.d.ts @@ -14,7 +14,7 @@ export class CheckoutOptions { notifyPayload?: undefined; progressCb?: any; progressPayload?: undefined; - paths?: Strarray; + paths?: Strarray | string | string[]; baseline?: Tree; baselineIndex?: Index; targetDirectory?: string; diff --git a/types/nodegit/diff-options.d.ts b/types/nodegit/diff-options.d.ts index 408a0530e1..3925f5c70c 100644 --- a/types/nodegit/diff-options.d.ts +++ b/types/nodegit/diff-options.d.ts @@ -4,7 +4,7 @@ export interface DiffOptions { version?: number; flags?: number; ignoreSubmodules?: number; - pathspec?: Strarray; + pathspec?: Strarray | string | string[]; notifyCb?: Function; contextLines?: number; interhunkLines?: number; diff --git a/types/nodegit/fetch-options.d.ts b/types/nodegit/fetch-options.d.ts index 77b5a9586c..6907db6bca 100644 --- a/types/nodegit/fetch-options.d.ts +++ b/types/nodegit/fetch-options.d.ts @@ -7,7 +7,7 @@ export interface FetchOptions { prune?: number; updateFetchhead?: number; downloadTags?: number; - customHeaders?: Strarray; + customHeaders?: Strarray | string | string[]; proxyOpts?: any; [key: string]: any; } diff --git a/types/nodegit/index_.d.ts b/types/nodegit/index_.d.ts index 3bf55c229d..aeea3c9b5a 100644 --- a/types/nodegit/index_.d.ts +++ b/types/nodegit/index_.d.ts @@ -26,7 +26,7 @@ export class Index { static open(indexPath: string): Promise; add(sourceEntry: IndexEntry): number; - addAll(pathspec: Strarray, flags: number, callback?: Function): Promise; + addAll(pathspec: Strarray | string | string[], flags: number, callback?: Function): Promise; addByPath(path: string): Promise; caps(): number; checksum(): Oid; @@ -44,11 +44,11 @@ export class Index { read(force: number): number; readTree(tree: Tree): number; remove(path: string, stage: number): number; - removeAll(pathspec: Strarray, callback?: Function): Promise; + removeAll(pathspec: Strarray | string | string[], callback?: Function): Promise; removeByPath(path: string): Promise; removeDirectory(dir: string, stage: number): number; setCaps(caps: number): number; - updateAll(pathspec: Strarray, callback?: Function): Promise; + updateAll(pathspec: Strarray | string | string[], callback?: Function): Promise; write(): number; writeTree(): Promise; writeTreeTo(repo: Repository): Promise; diff --git a/types/nodegit/path-spec.d.ts b/types/nodegit/path-spec.d.ts index 99435d5e0d..31b58f0149 100644 --- a/types/nodegit/path-spec.d.ts +++ b/types/nodegit/path-spec.d.ts @@ -23,7 +23,7 @@ export class Pathspec { static matchListEntrycount(m: any): number; static matchListFailedEntry(m: any, pos: number): string; static matchListFailedEntrycount(m: any): number; - static create(pathspec: Strarray): Pathspec; + static create(pathspec: Strarray | string | string[]): Pathspec; free(): void; matchDiff(diff: Diff, flags: number): Promise; diff --git a/types/nodegit/push-options.d.ts b/types/nodegit/push-options.d.ts index b736325f91..5f7625db2e 100644 --- a/types/nodegit/push-options.d.ts +++ b/types/nodegit/push-options.d.ts @@ -6,7 +6,7 @@ export interface PushOptions { version?: number; pbParallelism?: number; callbacks?: RemoteCallbacks; - customHeaders?: Strarray; + customHeaders?: Strarray | string | string[]; proxyOpts?: ProxyOptions; [key: string]: any; } diff --git a/types/nodegit/remote.d.ts b/types/nodegit/remote.d.ts index 61fdc63d1c..8a77f4ea69 100644 --- a/types/nodegit/remote.d.ts +++ b/types/nodegit/remote.d.ts @@ -62,7 +62,7 @@ export class Remote { stop(): void; updateTips(callbacks: RemoteCallbacks, updateFetchhead: number, downloadTags: number, reflogMessage: string): number; - upload(refspecs: Strarray, opts?: PushOptions): number; + upload(refspecs: Strarray | string | string[], opts?: PushOptions): number; url(): string; /** * Lists advertised references from a remote. You must connect to the remote before using referenceList. diff --git a/types/nodegit/reset.d.ts b/types/nodegit/reset.d.ts index 800ad34434..9051fa693b 100644 --- a/types/nodegit/reset.d.ts +++ b/types/nodegit/reset.d.ts @@ -20,7 +20,7 @@ export class Reset { /** * Look up a refs's commit. */ - static default(repo: Repository, target: Object, pathspecs: Strarray): Promise; + static default(repo: Repository, target: Object, pathspecs: Strarray | string | string[]): Promise; /** * Sets the current head to the specified commit oid and optionally resets the index and working tree to match. * This behaves like reset but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages. diff --git a/types/nodegit/status-options.d.ts b/types/nodegit/status-options.d.ts index 363dcd1fbb..f0189706bd 100644 --- a/types/nodegit/status-options.d.ts +++ b/types/nodegit/status-options.d.ts @@ -4,6 +4,6 @@ export interface StatusOptions { version?: number; show?: number; flags?: number; - pathspec?: Strarray; + pathspec?: Strarray | string | string[]; [key: string]: any; } diff --git a/types/nodegit/tag.d.ts b/types/nodegit/tag.d.ts index 3f6b5aa836..08d25859d2 100644 --- a/types/nodegit/tag.d.ts +++ b/types/nodegit/tag.d.ts @@ -10,7 +10,7 @@ export class Tag { static createLightweight(repo: Repository, tagName: string, target: Object, force: number): Promise; static delete(repo: Repository, tagName: string): Promise; static list(repo: Repository): Promise; - static listMatch(tagNames: Strarray, pattern: string, repo: Repository): number; + static listMatch(tagNames: Strarray | string | string[], pattern: string, repo: Repository): number; /** * Retrieves the tag pointed to by the oid * diff --git a/types/nodegit/transport.d.ts b/types/nodegit/transport.d.ts index 4cdd39f400..f4f4721333 100644 --- a/types/nodegit/transport.d.ts +++ b/types/nodegit/transport.d.ts @@ -9,7 +9,7 @@ export namespace Transport { } export class Transport { - static sshWithPaths(owner: Remote, payload: Strarray): Promise; + static sshWithPaths(owner: Remote, payload: Strarray | string | string[]): Promise; static unregister(prefix: string): number; init(version: number): number; smartCertificateCheck(cert: Cert, valid: number, hostName: string): number; From c4d02fc9c96e7149d79fd73435384a81f913fc3d Mon Sep 17 00:00:00 2001 From: Firede Date: Tue, 27 Mar 2018 23:52:58 +0800 Subject: [PATCH 0257/2153] update `graphql/error/*` -> `v0.13.2`. https://github.com/graphql/graphql-js/tree/v0.13.2/src/error --- types/graphql/error/GraphQLError.d.ts | 29 +++++++++++++++------------ types/graphql/error/formatError.d.ts | 14 ++++++------- types/graphql/error/index.d.ts | 3 ++- types/graphql/error/locatedError.d.ts | 7 ++++++- types/graphql/error/printError.d.ts | 7 +++++++ 5 files changed, 37 insertions(+), 23 deletions(-) create mode 100644 types/graphql/error/printError.d.ts diff --git a/types/graphql/error/GraphQLError.d.ts b/types/graphql/error/GraphQLError.d.ts index a4aa3f17c6..0be931bee0 100644 --- a/types/graphql/error/GraphQLError.d.ts +++ b/types/graphql/error/GraphQLError.d.ts @@ -1,6 +1,7 @@ import { getLocation } from "../language"; import { ASTNode } from "../language/ast"; import { Source } from "../language/source"; +import { SourceLocation } from "../language/location"; /** * A GraphQLError describes an Error found during the parse, validate, or @@ -13,6 +14,8 @@ export class GraphQLError extends Error { * A message describing the Error for debugging purposes. * * Enumerable, and appears in the result of JSON.stringify(). + * + * Note: should be treated as readonly, despite invariant usage. */ message: string; @@ -26,7 +29,7 @@ export class GraphQLError extends Error { * * Enumerable, and appears in the result of JSON.stringify(). */ - locations?: Array<{ line: number; column: number }> | undefined; + readonly locations: ReadonlyArray | undefined; /** * An array describing the JSON-path into the execution response which @@ -34,41 +37,41 @@ export class GraphQLError extends Error { * * Enumerable, and appears in the result of JSON.stringify(). */ - path?: Array | undefined; + readonly path: ReadonlyArray | undefined; /** * An array of GraphQL AST Nodes corresponding to this error. */ - nodes?: ASTNode[] | undefined; + readonly nodes: ReadonlyArray | undefined; /** * The source GraphQL document corresponding to this error. */ - source?: Source | undefined; + readonly source: Source | undefined; /** * An array of character offsets within the source GraphQL document * which correspond to this error. */ - positions?: number[] | undefined; + readonly positions: ReadonlyArray | undefined; /** * The original error thrown from a field resolver during execution. */ - originalError?: Error; + readonly originalError: Error | void; /** * Extension fields to add to the formatted error. */ - extensions?: { [key: string]: any } | undefined; + readonly extensions: { [key: string]: any } | void; constructor( message: string, - nodes?: any[], - source?: Source, - positions?: number[], - path?: Array, - originalError?: Error, - extensions?: { [key: string]: any } + nodes?: ReadonlyArray | ASTNode | undefined, + source?: Source | void, + positions?: ReadonlyArray | void, + path?: ReadonlyArray | void, + originalError?: Error | void, + extensions?: { [key: string]: any } | void ); } diff --git a/types/graphql/error/formatError.d.ts b/types/graphql/error/formatError.d.ts index a683da0375..7f13117cf0 100644 --- a/types/graphql/error/formatError.d.ts +++ b/types/graphql/error/formatError.d.ts @@ -1,4 +1,5 @@ import { GraphQLError } from "./GraphQLError"; +import { SourceLocation } from "../language/location"; /** * Given a GraphQLError, format it according to the rules described by the @@ -7,12 +8,9 @@ import { GraphQLError } from "./GraphQLError"; export function formatError(error: GraphQLError): GraphQLFormattedError; export interface GraphQLFormattedError { - message: string; - locations?: GraphQLErrorLocation[]; - path?: Array; -} - -export interface GraphQLErrorLocation { - line: number; - column: number; + readonly message: string; + readonly locations: ReadonlyArray | undefined; + readonly path: ReadonlyArray | undefined; + // Extensions + readonly [key: string]: any; } diff --git a/types/graphql/error/index.d.ts b/types/graphql/error/index.d.ts index 8d81175bcc..bed0763ed3 100644 --- a/types/graphql/error/index.d.ts +++ b/types/graphql/error/index.d.ts @@ -1,4 +1,5 @@ export { GraphQLError } from "./GraphQLError"; export { syntaxError } from "./syntaxError"; export { locatedError } from "./locatedError"; -export { formatError, GraphQLFormattedError, GraphQLErrorLocation } from "./formatError"; +export { printError } from "./printError"; +export { formatError, GraphQLFormattedError } from "./formatError"; diff --git a/types/graphql/error/locatedError.d.ts b/types/graphql/error/locatedError.d.ts index c41fd0df50..77dd470c63 100644 --- a/types/graphql/error/locatedError.d.ts +++ b/types/graphql/error/locatedError.d.ts @@ -1,8 +1,13 @@ import { GraphQLError } from "./GraphQLError"; +import { ASTNode } from "../language/ast"; /** * Given an arbitrary Error, presumably thrown while attempting to execute a * GraphQL operation, produce a new GraphQLError aware of the location in the * document responsible for the original Error. */ -export function locatedError(originalError: Error, nodes: T[], path: Array): GraphQLError; +export function locatedError( + originalError: Error, + nodes: ReadonlyArray, + path: ReadonlyArray +): GraphQLError; diff --git a/types/graphql/error/printError.d.ts b/types/graphql/error/printError.d.ts new file mode 100644 index 0000000000..924682f471 --- /dev/null +++ b/types/graphql/error/printError.d.ts @@ -0,0 +1,7 @@ +import { GraphQLError } from "./GraphQLError"; + +/** + * Prints a GraphQLError to a string, representing useful location information + * about the error's position in the source. + */ +export function printError(error: GraphQLError): string; From 85fe43f771d1f7564863890cb10043f964e15da9 Mon Sep 17 00:00:00 2001 From: WinUP Date: Tue, 27 Mar 2018 11:54:12 -0400 Subject: [PATCH 0258/2153] Update cron to 1.3.0 --- types/cron/cron-tests.ts | 5 ++ types/cron/index.d.ts | 125 ++++++++++++++++++++++++++++++++++----- 2 files changed, 114 insertions(+), 16 deletions(-) diff --git a/types/cron/cron-tests.ts b/types/cron/cron-tests.ts index 7eea73eeed..21e28f9c0f 100644 --- a/types/cron/cron-tests.ts +++ b/types/cron/cron-tests.ts @@ -47,7 +47,12 @@ var job = new CronJob({ start: false, timeZone: 'America/Los_Angeles' }); +console.log(job.lastDate()); +console.log(job.nextDates(1)); +console.log(job.running); +job.setTime(new CronTime('00 30 11 * * 1-2')); job.start(); +job.stop(); // How to check if a cron pattern is valid: try { diff --git a/types/cron/index.d.ts b/types/cron/index.d.ts index 780890c014..b27bfdf90c 100644 --- a/types/cron/index.d.ts +++ b/types/cron/index.d.ts @@ -1,25 +1,118 @@ -// Type definitions for cron 1.2 +// Type definitions for cron 1.3 // Project: https://www.npmjs.com/package/cron // Definitions by: Hiroki Horiuchi +// Lundarl Gholoi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export declare class CronTime { + /** + * Create a new ```CronTime```. + * @param source The time to fire off your job. This can be in the form of cron syntax or a JS ```Date``` object. + * @param zone Timezone name. You can check all timezones available at [Moment Timezone Website](http://momentjs.com/timezone/). + */ + constructor(source: string | Date, zone?: string); + /** + * Tells you when ```CronTime``` will be run. + * @param i Indicate which turn of run after now. If not given return next run time. + */ + public sendAt(i?: number): Date; + /** + * Get the number of milliseconds in the future at which to fire our callbacks. + */ + public getTimeout(): number; +} -interface CronJobStatic { - new (cronTime: string | Date, onTick: () => void, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean): CronJob; - new (options: { - cronTime: string | Date; onTick: () => void; onComplete?: () => void; start?: boolean; timeZone?: string; context?: any; runOnInit?: boolean - }): CronJob; +export declare interface CronJobParameters { + /** + * The time to fire off your job. This can be in the form of cron syntax or a JS ```Date``` object. + */ + cronTime: string | Date; + /** + * The function to fire at the specified time. + */ + onTick: () => void; + /** + * A function that will fire when the job is complete, when it is stopped. + */ + onComplete?: () => void; + /** + * Specifies whether to start the job just before exiting the constructor. By default this is set to false. If left at default you will need to call ```job.start()``` in order to start the job (assuming ```job``` is the variable you set the cronjob to). This does not immediately fire your onTick function, it just gives you more control over the behavior of your jobs. + */ + start?: boolean; + /** + * Specify the timezone for the execution. This will modify the actual time relative to your timezone. If the timezone is invalid, an error is thrown. You can check all timezones available at [Moment Timezone Website](http://momentjs.com/timezone/). + */ + timeZone?: string; + /** + * The context within which to execute the onTick method. This defaults to the cronjob itself allowing you to call ```this.stop()```. However, if you change this you'll have access to the functions and values within your context object. + */ + context?: any; + /** + * This will immediately fire your ```onTick``` function as soon as the requisit initialization has happened. This option is set to ```false``` by default for backwards compatibility. + */ + runOnInit?: boolean; } -interface CronJob { - start(): void; - stop(): void; - running: boolean | undefined; -} -export declare var CronJob: CronJobStatic; -interface CronTimeStatic { - new (time: string | Date): CronTime; +export declare class CronJob { + /** + * Return ```true``` if job is running. + */ + public running: boolean | undefined; + /** + * Function using to fire ```onTick```, default set to an inner private function. Overwrite this only if you have a really good reason to do so. + */ + public fireOnTick: Function; + + /** + * Create a new ```CronJob```. + * @param cronTime The time to fire off your job. This can be in the form of cron syntax or a JS ```Date``` object. + * @param onTick The function to fire at the specified time. + * @param onComplete A function that will fire when the job is complete, when it is stopped. + * @param start Specifies whether to start the job just before exiting the constructor. By default this is set to false. If left at default you will need to call ```job.start()``` in order to start the job (assuming ```job``` is the variable you set the cronjob to). This does not immediately fire your onTick function, it just gives you more control over the behavior of your jobs. + * @param timeZone Specify the timezone for the execution. This will modify the actual time relative to your timezone. If the timezone is invalid, an error is thrown. You can check all timezones available at [Moment Timezone Website](http://momentjs.com/timezone/). + * @param context The context within which to execute the onTick method. This defaults to the cronjob itself allowing you to call ```this.stop()```. However, if you change this you'll have access to the functions and values within your context object. + * @param runOnInit This will immediately fire your ```onTick``` function as soon as the requisit initialization has happened. This option is set to ```false``` by default for backwards compatibility. + */ + constructor(cronTime: string | Date, onTick: () => void, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean); + /** + * Create a new ```CronJob```. + * @param options Job parameters. + */ + constructor(options: CronJobParameters); + + /** + * Runs your job. + */ + public start(): void; + /** + * Stops your job. + */ + public stop(): void; + /** + * Change the time for the ```CronJob```. + * @param time Target time. + */ + public setTime(time: CronTime): void; + /** + * Tells you the last execution date. + */ + public lastDate(): Date; + /** + * Tells you when a ```CronTime``` will be run. + * @param i Indicate which turn of run after now. If not given return next run time. + */ + public nextDates(i?: number): Date; + /** + * Add another ```onTick``` function. + * @param callback Target function. + */ + public addCallback(callback: Function): void; } -interface CronTime { } -export declare var CronTime: CronTimeStatic; + +export declare var job: + ((cronTime: string | Date, onTick: () => void, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean) => CronJob) + | ((options: CronJobParameters) => CronJob); +export declare var time: (source: string | Date, zone?: string) => CronTime; +export declare var sendAt: (cronTime: CronTime) => Date; +export declare var timeout: (cronTime: CronTime) => number; From 9e573562f8ee3abc86ff6cfed0ae832b3708523e Mon Sep 17 00:00:00 2001 From: Firede Date: Tue, 27 Mar 2018 23:58:24 +0800 Subject: [PATCH 0259/2153] add `graphql/jsutils/MaybePromise`. https://github.com/graphql/graphql-js/blob/v0.13.2/src/jsutils/MaybePromise.js --- types/graphql/jsutils/MaybePromise.d.ts | 1 + 1 file changed, 1 insertion(+) create mode 100644 types/graphql/jsutils/MaybePromise.d.ts diff --git a/types/graphql/jsutils/MaybePromise.d.ts b/types/graphql/jsutils/MaybePromise.d.ts new file mode 100644 index 0000000000..5eb85a3f92 --- /dev/null +++ b/types/graphql/jsutils/MaybePromise.d.ts @@ -0,0 +1 @@ +export type MaybePromise = Promise | T; From 323e993b8f062d7fbe7e96e335d83373f7847135 Mon Sep 17 00:00:00 2001 From: Firede Date: Wed, 28 Mar 2018 00:13:02 +0800 Subject: [PATCH 0260/2153] update `graphql/execution/*` -> `v0.13.2`. https://github.com/graphql/graphql-js/tree/v0.13.2/src/execution --- types/graphql/execution/execute.d.ts | 136 +++++++++++++++++++++++---- types/graphql/execution/values.d.ts | 30 +++++- 2 files changed, 141 insertions(+), 25 deletions(-) diff --git a/types/graphql/execution/execute.d.ts b/types/graphql/execution/execute.d.ts index 387a3d4d73..424bb62b5a 100644 --- a/types/graphql/execution/execute.d.ts +++ b/types/graphql/execution/execute.d.ts @@ -1,6 +1,12 @@ import { GraphQLError, locatedError } from "../error"; import { GraphQLSchema } from "../type/schema"; -import { GraphQLField, GraphQLFieldResolver, ResponsePath } from "../type/definition"; +import { + GraphQLField, + GraphQLFieldResolver, + ResponsePath, + GraphQLObjectType, + GraphQLResolveInfo, +} from "../type/definition"; import { DirectiveNode, DocumentNode, @@ -10,6 +16,8 @@ import { InlineFragmentNode, FragmentDefinitionNode, } from "../language/ast"; +import { MaybePromise } from "../jsutils/MaybePromise"; + /** * Data that must be available at all points during query execution. * @@ -20,6 +28,7 @@ export interface ExecutionContext { schema: GraphQLSchema; fragments: { [key: string]: FragmentDefinitionNode }; rootValue: any; + contextValue: any; operation: OperationDefinitionNode; variableValues: { [key: string]: any }; fieldResolver: GraphQLFieldResolver; @@ -27,15 +36,14 @@ export interface ExecutionContext { } /** - * The result of execution. `data` is the result of executing the - * query, `extensions` represents additional metadata, `errors` is - * null if no errors occurred, and is a - * non-empty array if an error occurred. + * The result of GraphQL execution. + * + * - `errors` is included when any errors occurred as a non-empty array. + * - `data` is the result of a successful execution of the query. */ export interface ExecutionResult { + errors?: ReadonlyArray; data?: { [key: string]: any }; - extensions?: { [key: string]: any }; - errors?: GraphQLError[]; } export type ExecutionArgs = { @@ -43,41 +51,114 @@ export type ExecutionArgs = { document: DocumentNode; rootValue?: any; contextValue?: any; - variableValues?: { [key: string]: any }; - operationName?: string; - fieldResolver?: GraphQLFieldResolver; + variableValues?: { [key: string]: any } | void; + operationName?: string | void; + fieldResolver?: GraphQLFieldResolver | void; }; /** * Implements the "Evaluating requests" section of the GraphQL specification. * - * Returns a Promise that will eventually be resolved and never rejected. + * Returns either a synchronous ExecutionResult (if all encountered resolvers + * are synchronous), or a Promise of an ExecutionResult that will eventually be + * resolved and never rejected. * * If the arguments to this function do not result in a legal execution context, * a GraphQLError will be thrown immediately explaining the invalid input. * * Accepts either an object with named arguments, or individual arguments. */ -export function execute(args: ExecutionArgs): Promise; +export function execute(args: ExecutionArgs): MaybePromise; export function execute( schema: GraphQLSchema, document: DocumentNode, rootValue?: any, contextValue?: any, - variableValues?: { - [key: string]: any; - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver -): Promise; + variableValues?: { [key: string]: any } | void, + operationName?: string | void, + fieldResolver?: GraphQLFieldResolver | void +): MaybePromise; /** * Given a ResponsePath (found in the `path` entry in the information provided * as the last argument to a field resolver), return an Array of the path keys. */ -export function responsePathAsArray(path: ResponsePath): Array; +export function responsePathAsArray(path: ResponsePath): ReadonlyArray; -export function addPath(prev: ResponsePath, key: string | number): any; +/** + * Given a ResponsePath and a key, return a new ResponsePath containing the + * new key. + */ +export function addPath( + prev: ResponsePath | undefined, + key: string | number +): { prev: ResponsePath | undefined; key: string | number }; + +/** + * Essential assertions before executing to provide developer feedback for + * improper use of the GraphQL library. + */ +export function assertValidExecutionArguments( + schema: GraphQLSchema, + document: DocumentNode, + rawVariableValues: { [key: string]: any } | void +): void; + +/** + * Constructs a ExecutionContext object from the arguments passed to + * execute, which we will pass throughout the other execution methods. + * + * Throws a GraphQLError if a valid execution context cannot be created. + */ +export function buildExecutionContext( + schema: GraphQLSchema, + document: DocumentNode, + rootValue: any, + contextValue: any, + rawVariableValues: { [key: string]: any } | void, + operationName: string | void, + fieldResolver: GraphQLFieldResolver | void +): ReadonlyArray | ExecutionContext; + +/** + * Extracts the root type of the operation from the schema. + */ +export function getOperationRootType(schema: GraphQLSchema, operation: OperationDefinitionNode): GraphQLObjectType; + +/** + * Given a selectionSet, adds all of the fields in that selection to + * the passed in map of fields, and returns it at the end. + * + * CollectFields requires the "runtime type" of an object. For a field which + * returns an Interface or Union type, the "runtime type" will be the actual + * Object type returned by that field. + */ +export function collectFields( + exeContext: ExecutionContext, + runtimeType: GraphQLObjectType, + selectionSet: SelectionSetNode, + fields: { [key: string]: Array }, + visitedFragmentNames: { [key: string]: boolean } +): { [key: string]: Array }; + +export function buildResolveInfo( + exeContext: ExecutionContext, + fieldDef: GraphQLField, + fieldNodes: ReadonlyArray, + parentType: GraphQLObjectType, + path: ResponsePath +): GraphQLResolveInfo; + +// Isolates the "ReturnOrAbrupt" behavior to not de-opt the `resolveField` +// function. Returns the result of resolveFn or the abrupt-return Error object. +export function resolveFieldValueOrError( + exeContext: ExecutionContext, + fieldDef: GraphQLField, + fieldNodes: ReadonlyArray, + resolveFn: GraphQLFieldResolver, + source: TSource, + info: GraphQLResolveInfo +): Error | any; /** * If a resolve function is not given, then a default resolve behavior is used @@ -86,3 +167,18 @@ export function addPath(prev: ResponsePath, key: string | number): any; * of calling that function while passing along args and context. */ export const defaultFieldResolver: GraphQLFieldResolver; + +/** + * This method looks up the field on the given type defintion. + * It has special casing for the two introspection fields, __schema + * and __typename. __typename is special because it can always be + * queried as a field, even in situations where no other fields + * are allowed, like on a Union. __schema could get automatically + * added to the query type, but that would require mutating type + * definitions, which would cause issues. + */ +export function getFieldDef( + schema: GraphQLSchema, + parentType: GraphQLObjectType, + fieldName: string +): GraphQLField | void; diff --git a/types/graphql/execution/values.d.ts b/types/graphql/execution/values.d.ts index d8e1ec2e7e..fb629325e8 100644 --- a/types/graphql/execution/values.d.ts +++ b/types/graphql/execution/values.d.ts @@ -1,27 +1,41 @@ +import { GraphQLError } from "../error"; import { GraphQLInputType, GraphQLField, GraphQLArgument } from "../type/definition"; import { GraphQLDirective } from "../type/directives"; import { GraphQLSchema } from "../type/schema"; import { FieldNode, DirectiveNode, VariableDefinitionNode } from "../language/ast"; +interface CoercedVariableValues { + errors: ReadonlyArray | undefined; + coerced: { [key: string]: any } | undefined; +} + /** * Prepares an object map of variableValues of the correct type based on the * provided variable definitions and arbitrary input. If the input cannot be * parsed to match the variable definitions, a GraphQLError will be thrown. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. */ export function getVariableValues( schema: GraphQLSchema, varDefNodes: VariableDefinitionNode[], inputs: { [key: string]: any } -): { [key: string]: any }; +): CoercedVariableValues; /** * Prepares an object map of argument values given a list of argument * definitions and list of argument AST nodes. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. */ export function getArgumentValues( def: GraphQLField | GraphQLDirective, node: FieldNode | DirectiveNode, - variableValues?: { [key: string]: any } + variableValues?: { [key: string]: any } | void ): { [key: string]: any }; /** @@ -30,9 +44,15 @@ export function getArgumentValues( * of variable values. * * If the directive does not exist on the node, returns undefined. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. */ export function getDirectiveValues( directiveDef: GraphQLDirective, - node: { directives?: Array }, - variableValues?: { [key: string]: any } -): void | { [key: string]: any }; + node: { + readonly directives?: ReadonlyArray; + }, + variableValues?: { [key: string]: any } | void +): undefined | { [key: string]: any }; From 6729aab7a6c850df947b95708a1244552c4d7630 Mon Sep 17 00:00:00 2001 From: Firede Date: Wed, 28 Mar 2018 00:33:01 +0800 Subject: [PATCH 0261/2153] update `graphql/language/*` -> `v0.13.2`. https://github.com/graphql/graphql-js/tree/v0.13.2/src/language --- types/graphql/language/ast.d.ts | 461 +++++++++--------- types/graphql/language/blockStringValue.d.ts | 7 + types/graphql/language/directiveLocation.d.ts | 31 ++ types/graphql/language/index.d.ts | 16 +- types/graphql/language/kinds.d.ts | 123 +++-- types/graphql/language/lexer.d.ts | 15 +- types/graphql/language/location.d.ts | 11 +- types/graphql/language/parser.d.ts | 4 +- types/graphql/language/source.d.ts | 16 +- types/graphql/language/visitor.d.ts | 187 +++++-- 10 files changed, 517 insertions(+), 354 deletions(-) create mode 100644 types/graphql/language/blockStringValue.d.ts create mode 100644 types/graphql/language/directiveLocation.d.ts diff --git a/types/graphql/language/ast.d.ts b/types/graphql/language/ast.d.ts index 21dbe83361..21601385ff 100644 --- a/types/graphql/language/ast.d.ts +++ b/types/graphql/language/ast.d.ts @@ -1,4 +1,5 @@ import { Source } from "./source"; +import { TokenKindEnum } from "./lexer"; /** * Contains a range of UTF-8 character offsets and token references that @@ -8,57 +9,29 @@ export interface Location { /** * The character offset at which this Node begins. */ - start: number; + readonly start: number; /** * The character offset at which this Node ends. */ - end: number; + readonly end: number; /** * The Token at which this Node begins. */ - startToken: Token; + readonly startToken: Token; /** * The Token at which this Node ends. */ - endToken: Token; + readonly endToken: Token; /** * The Source document the AST represents. */ - source: Source; + readonly source: Source; } -/** - * Represents the different kinds of tokens in a GraphQL document. - * This type is not inlined in `Token` to fix syntax highlighting on GitHub - * *only*. - */ -type TokenKind = - | "" - | "" - | "!" - | "$" - | "(" - | ")" - | "..." - | ":" - | "=" - | "@" - | "[" - | "]" - | "{" - | "|" - | "}" - | "Name" - | "Int" - | "Float" - | "String" - | "BlockString" - | "Comment"; - /** * Represents a range of characters represented by a lexical token * within a Source. @@ -67,40 +40,40 @@ export interface Token { /** * The kind of Token. */ - kind: TokenKind; + readonly kind: TokenKindEnum; /** * The character offset at which this Node begins. */ - start: number; + readonly start: number; /** * The character offset at which this Node ends. */ - end: number; + readonly end: number; /** * The 1-indexed line number on which this Token appears. */ - line: number; + readonly line: number; /** * The 1-indexed column number at which this Token begins. */ - column: number; + readonly column: number; /** * For non-punctuation tokens, represents the interpreted value of the token. */ - value: string | undefined; + readonly value: string | undefined; /** * Tokens exist as nodes in a double-linked-list amongst all tokens * including ignored tokens. is always the first node and * the last. */ - prev?: Token; - next?: Token; + readonly prev: Token | null; + readonly next: Token | null; } /** @@ -201,17 +174,17 @@ export interface ASTKindToNode { // Name export interface NameNode { - kind: "Name"; - loc?: Location; - value: string; + readonly kind: "Name"; + readonly loc?: Location; + readonly value: string; } // Document export interface DocumentNode { - kind: "Document"; - loc?: Location; - definitions: DefinitionNode[]; + readonly kind: "Document"; + readonly loc?: Location; + readonly definitions: ReadonlyArray; } export type DefinitionNode = ExecutableDefinitionNode | TypeSystemDefinitionNode; // experimental non-spec addition. @@ -219,84 +192,83 @@ export type DefinitionNode = ExecutableDefinitionNode | TypeSystemDefinitionNode export type ExecutableDefinitionNode = OperationDefinitionNode | FragmentDefinitionNode; export interface OperationDefinitionNode { - kind: "OperationDefinition"; - loc?: Location; - operation: OperationTypeNode; - name?: NameNode; - variableDefinitions?: VariableDefinitionNode[]; - directives?: DirectiveNode[]; - selectionSet: SelectionSetNode; + readonly kind: "OperationDefinition"; + readonly loc?: Location; + readonly operation: OperationTypeNode; + readonly name?: NameNode; + readonly variableDefinitions?: ReadonlyArray; + readonly directives?: ReadonlyArray; + readonly selectionSet: SelectionSetNode; } -// Note: subscription is an experimental non-spec addition. export type OperationTypeNode = "query" | "mutation" | "subscription"; export interface VariableDefinitionNode { - kind: "VariableDefinition"; - loc?: Location; - variable: VariableNode; - type: TypeNode; - defaultValue?: ValueNode; + readonly kind: "VariableDefinition"; + readonly loc?: Location; + readonly variable: VariableNode; + readonly type: TypeNode; + readonly defaultValue?: ValueNode; } export interface VariableNode { - kind: "Variable"; - loc?: Location; - name: NameNode; + readonly kind: "Variable"; + readonly loc?: Location; + readonly name: NameNode; } export interface SelectionSetNode { kind: "SelectionSet"; loc?: Location; - selections: SelectionNode[]; + selections: ReadonlyArray; } export type SelectionNode = FieldNode | FragmentSpreadNode | InlineFragmentNode; export interface FieldNode { - kind: "Field"; - loc?: Location; - alias?: NameNode; - name: NameNode; - arguments?: ArgumentNode[]; - directives?: DirectiveNode[]; - selectionSet?: SelectionSetNode; + readonly kind: "Field"; + readonly loc?: Location; + readonly alias?: NameNode; + readonly name: NameNode; + readonly arguments?: ReadonlyArray; + readonly directives?: ReadonlyArray; + readonly selectionSet?: SelectionSetNode; } export interface ArgumentNode { - kind: "Argument"; - loc?: Location; - name: NameNode; - value: ValueNode; + readonly kind: "Argument"; + readonly loc?: Location; + readonly name: NameNode; + readonly value: ValueNode; } // Fragments export interface FragmentSpreadNode { - kind: "FragmentSpread"; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; + readonly kind: "FragmentSpread"; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; } export interface InlineFragmentNode { - kind: "InlineFragment"; - loc?: Location; - typeCondition?: NamedTypeNode; - directives?: DirectiveNode[]; - selectionSet: SelectionSetNode; + readonly kind: "InlineFragment"; + readonly loc?: Location; + readonly typeCondition?: NamedTypeNode; + readonly directives?: ReadonlyArray; + readonly selectionSet: SelectionSetNode; } export interface FragmentDefinitionNode { - kind: "FragmentDefinition"; - loc?: Location; - name: NameNode; + readonly kind: "FragmentDefinition"; + readonly loc?: Location; + readonly name: NameNode; // Note: fragment variable definitions are experimental and may be changed // or removed in the future. - variableDefinitions?: VariableDefinitionNode[]; - typeCondition: NamedTypeNode; - directives?: DirectiveNode[]; - selectionSet: SelectionSetNode; + readonly variableDefinitions?: ReadonlyArray; + readonly typeCondition: NamedTypeNode; + readonly directives?: ReadonlyArray; + readonly selectionSet: SelectionSetNode; } // Values @@ -313,66 +285,67 @@ export type ValueNode = | ObjectValueNode; export interface IntValueNode { - kind: "IntValue"; - loc?: Location; - value: string; + readonly kind: "IntValue"; + readonly loc?: Location; + readonly value: string; } export interface FloatValueNode { - kind: "FloatValue"; - loc?: Location; - value: string; + readonly kind: "FloatValue"; + readonly loc?: Location; + readonly value: string; } export interface StringValueNode { - kind: "StringValue"; - loc?: Location; - value: string; + readonly kind: "StringValue"; + readonly loc?: Location; + readonly value: string; + readonly block?: boolean; } export interface BooleanValueNode { - kind: "BooleanValue"; - loc?: Location; - value: boolean; + readonly kind: "BooleanValue"; + readonly loc?: Location; + readonly value: boolean; } export interface NullValueNode { - kind: "NullValue"; - loc?: Location; + readonly kind: "NullValue"; + readonly loc?: Location; } export interface EnumValueNode { - kind: "EnumValue"; - loc?: Location; - value: string; + readonly kind: "EnumValue"; + readonly loc?: Location; + readonly value: string; } export interface ListValueNode { - kind: "ListValue"; - loc?: Location; - values: ValueNode[]; + readonly kind: "ListValue"; + readonly loc?: Location; + readonly values: ReadonlyArray; } export interface ObjectValueNode { - kind: "ObjectValue"; - loc?: Location; - fields: ObjectFieldNode[]; + readonly kind: "ObjectValue"; + readonly loc?: Location; + readonly fields: ReadonlyArray; } export interface ObjectFieldNode { - kind: "ObjectField"; - loc?: Location; - name: NameNode; - value: ValueNode; + readonly kind: "ObjectField"; + readonly loc?: Location; + readonly name: NameNode; + readonly value: ValueNode; } // Directives export interface DirectiveNode { - kind: "Directive"; - loc?: Location; - name: NameNode; - arguments?: ArgumentNode[]; + readonly kind: "Directive"; + readonly loc?: Location; + readonly name: NameNode; + readonly arguments?: ReadonlyArray; } // Type Reference @@ -380,21 +353,21 @@ export interface DirectiveNode { export type TypeNode = NamedTypeNode | ListTypeNode | NonNullTypeNode; export interface NamedTypeNode { - kind: "NamedType"; - loc?: Location; - name: NameNode; + readonly kind: "NamedType"; + readonly loc?: Location; + readonly name: NameNode; } export interface ListTypeNode { - kind: "ListType"; - loc?: Location; - type: TypeNode; + readonly kind: "ListType"; + readonly loc?: Location; + readonly type: TypeNode; } export interface NonNullTypeNode { - kind: "NonNullType"; - loc?: Location; - type: NamedTypeNode | ListTypeNode; + readonly kind: "NonNullType"; + readonly loc?: Location; + readonly type: NamedTypeNode | ListTypeNode; } // Type System Definition @@ -406,19 +379,21 @@ export type TypeSystemDefinitionNode = | DirectiveDefinitionNode; export interface SchemaDefinitionNode { - kind: "SchemaDefinition"; - loc?: Location; - directives: DirectiveNode[]; - operationTypes: OperationTypeDefinitionNode[]; + readonly kind: "SchemaDefinition"; + readonly loc?: Location; + readonly directives: ReadonlyArray; + readonly operationTypes: ReadonlyArray; } export interface OperationTypeDefinitionNode { - kind: "OperationTypeDefinition"; - loc?: Location; - operation: OperationTypeNode; - type: NamedTypeNode; + readonly kind: "OperationTypeDefinition"; + readonly loc?: Location; + readonly operation: OperationTypeNode; + readonly type: NamedTypeNode; } +// Type Definition + export type TypeDefinitionNode = | ScalarTypeDefinitionNode | ObjectTypeDefinitionNode @@ -428,87 +403,89 @@ export type TypeDefinitionNode = | InputObjectTypeDefinitionNode; export interface ScalarTypeDefinitionNode { - kind: "ScalarTypeDefinition"; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; + readonly kind: "ScalarTypeDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; } export interface ObjectTypeDefinitionNode { - kind: "ObjectTypeDefinition"; - loc?: Location; - description?: StringValueNode; - name: NameNode; - interfaces?: NamedTypeNode[]; - directives?: DirectiveNode[]; - fields: FieldDefinitionNode[]; + readonly kind: "ObjectTypeDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly interfaces?: ReadonlyArray; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; } export interface FieldDefinitionNode { - kind: "FieldDefinition"; - loc?: Location; - description?: StringValueNode; - name: NameNode; - arguments: InputValueDefinitionNode[]; - type: TypeNode; - directives?: DirectiveNode[]; + readonly kind: "FieldDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly arguments?: ReadonlyArray; + readonly type: TypeNode; + readonly directives?: ReadonlyArray; } export interface InputValueDefinitionNode { - kind: "InputValueDefinition"; - loc?: Location; - description?: StringValueNode; - name: NameNode; - type: TypeNode; - defaultValue?: ValueNode; - directives?: DirectiveNode[]; + readonly kind: "InputValueDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly type: TypeNode; + readonly defaultValue?: ValueNode; + readonly directives?: ReadonlyArray; } export interface InterfaceTypeDefinitionNode { - kind: "InterfaceTypeDefinition"; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; - fields: FieldDefinitionNode[]; + readonly kind: "InterfaceTypeDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; } export interface UnionTypeDefinitionNode { - kind: "UnionTypeDefinition"; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; - types: NamedTypeNode[]; + readonly kind: "UnionTypeDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly types?: ReadonlyArray; } export interface EnumTypeDefinitionNode { - kind: "EnumTypeDefinition"; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; - values: EnumValueDefinitionNode[]; + readonly kind: "EnumTypeDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly values?: ReadonlyArray; } export interface EnumValueDefinitionNode { - kind: "EnumValueDefinition"; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; + readonly kind: "EnumValueDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; } export interface InputObjectTypeDefinitionNode { - kind: "InputObjectTypeDefinition"; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; - fields: InputValueDefinitionNode[]; + readonly kind: "InputObjectTypeDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; } +// Type Extensions + export type TypeExtensionNode = | ScalarTypeExtensionNode | ObjectTypeExtensionNode @@ -517,61 +494,61 @@ export type TypeExtensionNode = | EnumTypeExtensionNode | InputObjectTypeExtensionNode; -export type ScalarTypeExtensionNode = { - kind: "ScalarTypeExtension"; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; -}; +export interface ScalarTypeExtensionNode { + readonly kind: "ScalarTypeExtension"; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; +} -export type ObjectTypeExtensionNode = { - kind: "ObjectTypeExtension"; - loc?: Location; - name: NameNode; - interfaces?: NamedTypeNode[]; - directives?: DirectiveNode[]; - fields?: FieldDefinitionNode[]; -}; +export interface ObjectTypeExtensionNode { + readonly kind: "ObjectTypeExtension"; + readonly loc?: Location; + readonly name: NameNode; + readonly interfaces?: ReadonlyArray; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; +} -export type InterfaceTypeExtensionNode = { - kind: "InterfaceTypeExtension"; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; - fields?: FieldDefinitionNode[]; -}; +export interface InterfaceTypeExtensionNode { + readonly kind: "InterfaceTypeExtension"; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; +} -export type UnionTypeExtensionNode = { - kind: "UnionTypeExtension"; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; - types?: NamedTypeNode[]; -}; +export interface UnionTypeExtensionNode { + readonly kind: "UnionTypeExtension"; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly types?: ReadonlyArray; +} -export type EnumTypeExtensionNode = { - kind: "EnumTypeExtension"; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; - values?: EnumValueDefinitionNode[]; -}; +export interface EnumTypeExtensionNode { + readonly kind: "EnumTypeExtension"; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly values?: ReadonlyArray; +} -export type InputObjectTypeExtensionNode = { - kind: "InputObjectTypeExtension"; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; - fields?: InputValueDefinitionNode[]; -}; +export interface InputObjectTypeExtensionNode { + readonly kind: "InputObjectTypeExtension"; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; +} // Directive Definitions export interface DirectiveDefinitionNode { - kind: "DirectiveDefinition"; - loc?: Location; - description?: StringValueNode; - name: NameNode; - arguments?: InputValueDefinitionNode[]; - locations: NameNode[]; + readonly kind: "DirectiveDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly arguments?: ReadonlyArray; + readonly locations: ReadonlyArray; } diff --git a/types/graphql/language/blockStringValue.d.ts b/types/graphql/language/blockStringValue.d.ts new file mode 100644 index 0000000000..64fb87dafd --- /dev/null +++ b/types/graphql/language/blockStringValue.d.ts @@ -0,0 +1,7 @@ +/** + * Produces the value of a block string from its parsed raw value, similar to + * Coffeescript's block string, Python's docstring trim or Ruby's strip_heredoc. + * + * This implements the GraphQL spec's BlockStringValue() static algorithm. + */ +export default function blockStringValue(rawString: string): string; diff --git a/types/graphql/language/directiveLocation.d.ts b/types/graphql/language/directiveLocation.d.ts new file mode 100644 index 0000000000..412e3ad32a --- /dev/null +++ b/types/graphql/language/directiveLocation.d.ts @@ -0,0 +1,31 @@ +/** + * The set of allowed directive location values. + */ +export type DirectiveLocation = { + // Request Definitions + QUERY: "QUERY"; + MUTATION: "MUTATION"; + SUBSCRIPTION: "SUBSCRIPTION"; + FIELD: "FIELD"; + FRAGMENT_DEFINITION: "FRAGMENT_DEFINITION"; + FRAGMENT_SPREAD: "FRAGMENT_SPREAD"; + INLINE_FRAGMENT: "INLINE_FRAGMENT"; + + // Type System Definitions + SCHEMA: "SCHEMA"; + SCALAR: "SCALAR"; + OBJECT: "OBJECT"; + FIELD_DEFINITION: "FIELD_DEFINITION"; + ARGUMENT_DEFINITION: "ARGUMENT_DEFINITION"; + INTERFACE: "INTERFACE"; + UNION: "UNION"; + ENUM: "ENUM"; + ENUM_VALUE: "ENUM_VALUE"; + INPUT_OBJECT: "INPUT_OBJECT"; + INPUT_FIELD_DEFINITION: "INPUT_FIELD_DEFINITION"; +}; + +/** + * The enum type representing the directive location values. + */ +export type DirectiveLocationEnum = DirectiveLocation[keyof DirectiveLocation]; diff --git a/types/graphql/language/index.d.ts b/types/graphql/language/index.d.ts index db088e6925..d5e8f8004e 100644 --- a/types/graphql/language/index.d.ts +++ b/types/graphql/language/index.d.ts @@ -1,9 +1,19 @@ export * from "./ast"; export { getLocation } from "./location"; -import * as Kind from "./kinds"; -export { Kind }; +export { Kind, KindEnum } from "./kinds"; export { createLexer, TokenKind, Lexer } from "./lexer"; export { parse, parseValue, parseType, ParseOptions } from "./parser"; export { print } from "./printer"; export { Source } from "./source"; -export { visit, visitInParallel, visitWithTypeInfo, getVisitFn, BREAK } from "./visitor"; +export { + visit, + visitInParallel, + visitWithTypeInfo, + getVisitFn, + BREAK, + ASTVisitor, + Visitor, + VisitFn, + VisitorKeyMap, +} from "./visitor"; +export { DirectiveLocation, DirectiveLocationEnum } from "./directiveLocation"; diff --git a/types/graphql/language/kinds.d.ts b/types/graphql/language/kinds.d.ts index 2e7db3ad87..6e497cbc68 100644 --- a/types/graphql/language/kinds.d.ts +++ b/types/graphql/language/kinds.d.ts @@ -1,72 +1,71 @@ -// Name +/** + * The set of allowed kind values for AST nodes. + */ +export type Kind = { + // Name + NAME: "Name"; -export const NAME: "Name"; + // Document + DOCUMENT: "Document"; + OPERATION_DEFINITION: "OperationDefinition"; + VARIABLE_DEFINITION: "VariableDefinition"; + VARIABLE: "Variable"; + SELECTION_SET: "SelectionSet"; + FIELD: "Field"; + ARGUMENT: "Argument"; -// Document + // Fragments + FRAGMENT_SPREAD: "FragmentSpread"; + INLINE_FRAGMENT: "InlineFragment"; + FRAGMENT_DEFINITION: "FragmentDefinition"; -export const DOCUMENT: "Document"; -export const OPERATION_DEFINITION: "OperationDefinition"; -export const VARIABLE_DEFINITION: "VariableDefinition"; -export const VARIABLE: "Variable"; -export const SELECTION_SET: "SelectionSet"; -export const FIELD: "Field"; -export const ARGUMENT: "Argument"; + // Values + INT: "IntValue"; + FLOAT: "FloatValue"; + STRING: "StringValue"; + BOOLEAN: "BooleanValue"; + NULL: "NullValue"; + ENUM: "EnumValue"; + LIST: "ListValue"; + OBJECT: "ObjectValue"; + OBJECT_FIELD: "ObjectField"; -// Fragments + // Directives + DIRECTIVE: "Directive"; -export const FRAGMENT_SPREAD: "FragmentSpread"; -export const INLINE_FRAGMENT: "InlineFragment"; -export const FRAGMENT_DEFINITION: "FragmentDefinition"; + // Types + NAMED_TYPE: "NamedType"; + LIST_TYPE: "ListType"; + NON_NULL_TYPE: "NonNullType"; -// Values + // Type System Definitions + SCHEMA_DEFINITION: "SchemaDefinition"; + OPERATION_TYPE_DEFINITION: "OperationTypeDefinition"; -export const INT: "IntValue"; -export const FLOAT: "FloatValue"; -export const STRING: "StringValue"; -export const BOOLEAN: "BooleanValue"; -export const NULL: "NullValue"; -export const ENUM: "EnumValue"; -export const LIST: "ListValue"; -export const OBJECT: "ObjectValue"; -export const OBJECT_FIELD: "ObjectField"; + // Type Definitions + SCALAR_TYPE_DEFINITION: "ScalarTypeDefinition"; + OBJECT_TYPE_DEFINITION: "ObjectTypeDefinition"; + FIELD_DEFINITION: "FieldDefinition"; + INPUT_VALUE_DEFINITION: "InputValueDefinition"; + INTERFACE_TYPE_DEFINITION: "InterfaceTypeDefinition"; + UNION_TYPE_DEFINITION: "UnionTypeDefinition"; + ENUM_TYPE_DEFINITION: "EnumTypeDefinition"; + ENUM_VALUE_DEFINITION: "EnumValueDefinition"; + INPUT_OBJECT_TYPE_DEFINITION: "InputObjectTypeDefinition"; -// Directives + // Type Extensions + SCALAR_TYPE_EXTENSION: "ScalarTypeExtension"; + OBJECT_TYPE_EXTENSION: "ObjectTypeExtension"; + INTERFACE_TYPE_EXTENSION: "InterfaceTypeExtension"; + UNION_TYPE_EXTENSION: "UnionTypeExtension"; + ENUM_TYPE_EXTENSION: "EnumTypeExtension"; + INPUT_OBJECT_TYPE_EXTENSION: "InputObjectTypeExtension"; -export const DIRECTIVE: "Directive"; + // Directive Definitions + DIRECTIVE_DEFINITION: "DirectiveDefinition"; +}; -// Types - -export const NAMED_TYPE: "NamedType"; -export const LIST_TYPE: "ListType"; -export const NON_NULL_TYPE: "NonNullType"; - -// Type System Definitions - -export const SCHEMA_DEFINITION: "SchemaDefinition"; -export const OPERATION_TYPE_DEFINITION: "OperationTypeDefinition"; - -// Type Definitions - -export const SCALAR_TYPE_DEFINITION: "ScalarTypeDefinition"; -export const OBJECT_TYPE_DEFINITION: "ObjectTypeDefinition"; -export const FIELD_DEFINITION: "FieldDefinition"; -export const INPUT_VALUE_DEFINITION: "InputValueDefinition"; -export const INTERFACE_TYPE_DEFINITION: "InterfaceTypeDefinition"; -export const UNION_TYPE_DEFINITION: "UnionTypeDefinition"; -export const ENUM_TYPE_DEFINITION: "EnumTypeDefinition"; -export const ENUM_VALUE_DEFINITION: "EnumValueDefinition"; -export const INPUT_OBJECT_TYPE_DEFINITION: "InputObjectTypeDefinition"; - -// Type Extensions - -export const TYPE_EXTENSION_DEFINITION: "TypeExtensionDefinition"; -export const SCALAR_TYPE_EXTENSION: "ScalarTypeExtension"; -export const OBJECT_TYPE_EXTENSION: "ObjectTypeExtension"; -export const INTERFACE_TYPE_EXTENSION: "InterfaceTypeExtension"; -export const UNION_TYPE_EXTENSION: "UnionTypeExtension"; -export const ENUM_TYPE_EXTENSION: "EnumTypeExtension"; -export const INPUT_OBJECT_TYPE_EXTENSION: "InputObjectTypeExtension"; - -// Directive Definitions - -export const DIRECTIVE_DEFINITION: "DirectiveDefinition"; +/** + * The enum type representing the possible kind values of AST nodes. + */ +export type KindEnum = Kind[keyof Kind]; diff --git a/types/graphql/language/lexer.d.ts b/types/graphql/language/lexer.d.ts index 27db5b04cc..69fa3df460 100644 --- a/types/graphql/language/lexer.d.ts +++ b/types/graphql/language/lexer.d.ts @@ -43,17 +43,24 @@ export interface Lexer { * Advances the token stream to the next non-ignored token. */ advance(): Token; + + /** + * Looks ahead and returns the next non-ignored token, but does not change + * the Lexer's state. + */ + lookahead(): Token; } /** * An exported enum describing the different kinds of tokens that the * lexer emits. */ -export const TokenKind: { +export type TokenKind = { SOF: ""; EOF: ""; BANG: "!"; DOLLAR: "$"; + AMP: "&"; PAREN_L: "("; PAREN_R: ")"; SPREAD: "..."; @@ -69,9 +76,15 @@ export const TokenKind: { INT: "Int"; FLOAT: "Float"; STRING: "String"; + BLOCK_STRING: "BlockString"; COMMENT: "Comment"; }; +/** + * The enum type representing the token kinds values. + */ +export type TokenKindEnum = TokenKind[keyof TokenKind]; + /** * A helper function to describe a token as a string for debugging */ diff --git a/types/graphql/language/location.d.ts b/types/graphql/language/location.d.ts index 4d7a13e314..6090531718 100644 --- a/types/graphql/language/location.d.ts +++ b/types/graphql/language/location.d.ts @@ -1,8 +1,15 @@ import { Source } from "./source"; +/** + * Represents a location in a Source. + */ export interface SourceLocation { - line: number; - column: number; + readonly line: number; + readonly column: number; } +/** + * Takes a Source and a UTF-8 character offset, and returns the corresponding + * line and column as a SourceLocation. + */ export function getLocation(source: Source, position: number): SourceLocation; diff --git a/types/graphql/language/parser.d.ts b/types/graphql/language/parser.d.ts index 3cdb3462ae..b07db1ff38 100644 --- a/types/graphql/language/parser.d.ts +++ b/types/graphql/language/parser.d.ts @@ -65,7 +65,7 @@ export function parse(source: string | Source, options?: ParseOptions): Document * This is useful within tools that operate upon GraphQL Values directly and * in isolation of complete GraphQL documents. */ -export function parseValue(source: Source | string, options?: ParseOptions): ValueNode; +export function parseValue(source: string | Source, options?: ParseOptions): ValueNode; /** * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for @@ -77,7 +77,7 @@ export function parseValue(source: Source | string, options?: ParseOptions): Val * * Consider providing the results to the utility function: typeFromAST(). */ -export function parseType(source: Source | string, options?: ParseOptions): TypeNode; +export function parseType(source: string | Source, options?: ParseOptions): TypeNode; export function parseConstValue(lexer: Lexer): ValueNode; diff --git a/types/graphql/language/source.d.ts b/types/graphql/language/source.d.ts index 80e68f5557..26d89640c3 100644 --- a/types/graphql/language/source.d.ts +++ b/types/graphql/language/source.d.ts @@ -1,5 +1,19 @@ +interface Location { + line: number; + column: number; +} + +/** + * A representation of source input to GraphQL. + * `name` and `locationOffset` are optional. They are useful for clients who + * store GraphQL documents in source files; for example, if the GraphQL input + * starts at line 40 in a file named Foo.graphql, it might be useful for name to + * be "Foo.graphql" and location to be `{ line: 40, column: 0 }`. + * line and column in locationOffset are 1-indexed + */ export class Source { body: string; name: string; - constructor(body: string, name?: string); + locationOffset: Location; + constructor(body: string, name?: string, locationOffset?: Location); } diff --git a/types/graphql/language/visitor.d.ts b/types/graphql/language/visitor.d.ts index 320d181e4a..a137fa318e 100644 --- a/types/graphql/language/visitor.d.ts +++ b/types/graphql/language/visitor.d.ts @@ -1,55 +1,160 @@ -export const QueryDocumentKeys: { - Name: any[]; - Document: string[]; - OperationDefinition: string[]; - VariableDefinition: string[]; - Variable: string[]; - SelectionSet: string[]; - Field: string[]; - Argument: string[]; +import { ASTNode, ASTKindToNode } from "./ast"; +import { TypeInfo } from "../utilities/TypeInfo"; - FragmentSpread: string[]; - InlineFragment: string[]; - FragmentDefinition: string[]; +interface EnterLeave { + readonly enter?: T; + readonly leave?: T; +} - IntValue: number[]; - FloatValue: number[]; - StringValue: string[]; - BooleanValue: boolean[]; - NullValue: null[]; - EnumValue: any[]; - ListValue: string[]; - ObjectValue: string[]; - ObjectField: string[]; +type EnterLeaveVisitor = EnterLeave< + VisitFn | { [K in keyof KindToNode]?: VisitFn } +>; - Directive: string[]; - - NamedType: string[]; - ListType: string[]; - NonNullType: string[]; - - ObjectTypeDefinition: string[]; - FieldDefinition: string[]; - InputValueDefinition: string[]; - InterfaceTypeDefinition: string[]; - UnionTypeDefinition: string[]; - ScalarTypeDefinition: string[]; - EnumTypeDefinition: string[]; - EnumValueDefinition: string[]; - InputObjectTypeDefinition: string[]; - TypeExtensionDefinition: string[]; +type ShapeMapVisitor = { + [K in keyof KindToNode]?: VisitFn | EnterLeave> }; +export type ASTVisitor = Visitor; +export type Visitor = + | EnterLeaveVisitor + | ShapeMapVisitor; + +/** + * A visitor is comprised of visit functions, which are called on each node + * during the visitor's traversal. + */ +export type VisitFn = ( + // The current node being visiting. + node: TVisitedNode, + // The index or key to this node from the parent node or Array. + key: string | number | undefined, + // The parent immediately above this node, which may be an Array. + parent: TAnyNode | ReadonlyArray | undefined, + // The key path to get to this node from the root node. + path: ReadonlyArray, + // All nodes and Arrays visited before reaching this node. + // These correspond to array indices in `path`. + // Note: ancestors includes arrays which contain the visited node. + ancestors: ReadonlyArray> +) => any; + +/** + * A KeyMap describes each the traversable properties of each kind of node. + */ +export type VisitorKeyMap = { [P in keyof T]: ReadonlyArray }; + +export const QueryDocumentKeys: { [key: string]: string[] }; + export const BREAK: any; -export function visit(root: any, visitor: any, keyMap?: any): any; +/** + * visit() will walk through an AST using a depth first traversal, calling + * the visitor's enter function at each node in the traversal, and calling the + * leave function after visiting that node and all of its child nodes. + * + * By returning different values from the enter and leave functions, the + * behavior of the visitor can be altered, including skipping over a sub-tree of + * the AST (by returning false), editing the AST by returning a value or null + * to remove the value, or to stop the whole traversal by returning BREAK. + * + * When using visit() to edit an AST, the original AST will not be modified, and + * a new version of the AST with the changes applied will be returned from the + * visit function. + * + * const editedAST = visit(ast, { + * enter(node, key, parent, path, ancestors) { + * // @return + * // undefined: no action + * // false: skip visiting this node + * // visitor.BREAK: stop visiting altogether + * // null: delete this node + * // any value: replace this node with the returned value + * }, + * leave(node, key, parent, path, ancestors) { + * // @return + * // undefined: no action + * // false: no action + * // visitor.BREAK: stop visiting altogether + * // null: delete this node + * // any value: replace this node with the returned value + * } + * }); + * + * Alternatively to providing enter() and leave() functions, a visitor can + * instead provide functions named the same as the kinds of AST nodes, or + * enter/leave visitors at a named key, leading to four permutations of + * visitor API: + * + * 1) Named visitors triggered when entering a node a specific kind. + * + * visit(ast, { + * Kind(node) { + * // enter the "Kind" node + * } + * }) + * + * 2) Named visitors that trigger upon entering and leaving a node of + * a specific kind. + * + * visit(ast, { + * Kind: { + * enter(node) { + * // enter the "Kind" node + * } + * leave(node) { + * // leave the "Kind" node + * } + * } + * }) + * + * 3) Generic visitors that trigger upon entering and leaving any node. + * + * visit(ast, { + * enter(node) { + * // enter any node + * }, + * leave(node) { + * // leave any node + * } + * }) + * + * 4) Parallel visitors for entering and leaving nodes of a specific kind. + * + * visit(ast, { + * enter: { + * Kind(node) { + * // enter the "Kind" node + * } + * }, + * leave: { + * Kind(node) { + * // leave the "Kind" node + * } + * } + * }) + */ +export function visit( + root: ASTNode, + visitor: Visitor, + visitorKeys?: VisitorKeyMap // default: QueryDocumentKeys +): any; -export function visitInParallel(visitors: any): any; +/** + * Creates a new visitor instance which delegates to many visitors to run in + * parallel. Each visitor will be visited for each node before moving on. + * + * If a prior visitor edits a node, no following visitors will see that node. + */ +export function visitInParallel(visitors: Array>): Visitor; -export function visitWithTypeInfo(typeInfo: any, visitor: any): any; +/** + * Creates a new visitor instance which maintains a provided TypeInfo instance + * along with visiting visitor. + */ +export function visitWithTypeInfo(typeInfo: TypeInfo, visitor: Visitor): Visitor; /** * Given a visitor instance, if it is leaving or not, and a node kind, return * the function the visitor runtime should call. */ -export function getVisitFn(visitor: any, kind: any, isLeaving: any): any; +export function getVisitFn(visitor: Visitor, kind: string, isLeaving: boolean): VisitFn | void; From e0a99292454f4fe037fd78bebe22ca861af4208b Mon Sep 17 00:00:00 2001 From: Firede Date: Wed, 28 Mar 2018 00:36:53 +0800 Subject: [PATCH 0262/2153] update `graphql/subscription` -> `v0.13.2`. https://github.com/graphql/graphql-js/blob/v0.13.2/src/subscription/subscribe.js --- types/graphql/subscription/subscribe.d.ts | 69 +++++++++++++++++++---- 1 file changed, 57 insertions(+), 12 deletions(-) diff --git a/types/graphql/subscription/subscribe.d.ts b/types/graphql/subscription/subscribe.d.ts index c4eec87ac9..a9fe6b565e 100644 --- a/types/graphql/subscription/subscribe.d.ts +++ b/types/graphql/subscription/subscribe.d.ts @@ -3,27 +3,72 @@ import { DocumentNode } from "../language/ast"; import { GraphQLFieldResolver } from "../type/definition"; import { ExecutionResult } from "../execution/execute"; +/** + * Implements the "Subscribe" algorithm described in the GraphQL specification. + * + * Returns a Promise which resolves to either an AsyncIterator (if successful) + * or an ExecutionResult (client error). The promise will be rejected if a + * server error occurs. + * + * If the client-provided arguments to this function do not result in a + * compliant subscription, a GraphQL Response (ExecutionResult) with + * descriptive errors and no data will be returned. + * + * If the the source stream could not be created due to faulty subscription + * resolver logic or underlying systems, the promise will resolve to a single + * ExecutionResult containing `errors` and no `data`. + * + * If the operation succeeded, the promise resolves to an AsyncIterator, which + * yields a stream of ExecutionResults representing the response stream. + * + * Accepts either an object with named arguments, or individual arguments. + */ +export function subscribe(args: { + schema: GraphQLSchema; + document: DocumentNode; + rootValue?: any; + contextValue?: any; + variableValues?: { [key: string]: any } | void; + operationName?: string | void; + fieldResolver?: GraphQLFieldResolver | void; + subscribeFieldResolver?: GraphQLFieldResolver | void; +}): Promise | ExecutionResult>; + export function subscribe( schema: GraphQLSchema, document: DocumentNode, rootValue?: any, contextValue?: any, - variableValues?: { - [key: string]: any; - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver, - subscribeFieldResolver?: GraphQLFieldResolver + variableValues?: { [key: string]: any } | void, + operationName?: string | void, + fieldResolver?: GraphQLFieldResolver | void, + subscribeFieldResolver?: GraphQLFieldResolver | void ): Promise | ExecutionResult>; +/** + * Implements the "CreateSourceEventStream" algorithm described in the + * GraphQL specification, resolving the subscription source event stream. + * + * Returns a Promise. + * + * If the client-provided invalid arguments, the source stream could not be + * created, or the resolver did not return an AsyncIterable, this function will + * will throw an error, which should be caught and handled by the caller. + * + * A Source Event Stream represents a sequence of events, each of which triggers + * a GraphQL execution for that event. + * + * This may be useful when hosting the stateful subscription service in a + * different process or machine than the stateless GraphQL execution engine, + * or otherwise separating these two steps. For more on this, see the + * "Supporting Subscriptions at Scale" information in the GraphQL specification. + */ export function createSourceEventStream( schema: GraphQLSchema, document: DocumentNode, rootValue?: any, contextValue?: any, - variableValues?: { - [key: string]: any; - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver -): Promise>; + variableValues?: { [key: string]: any }, + operationName?: string | void, + fieldResolver?: GraphQLFieldResolver | void +): Promise | ExecutionResult>; From b1a1e3f9f199586a4a2de7640d962ce7f446c87c Mon Sep 17 00:00:00 2001 From: Firede Date: Wed, 28 Mar 2018 00:39:46 +0800 Subject: [PATCH 0263/2153] update `graphql/type/*` -> `v0.13.2`. https://github.com/graphql/graphql-js/tree/v0.13.2/src/type --- types/graphql/type/definition.d.ts | 355 +++++++++++++++----------- types/graphql/type/directives.d.ts | 43 +--- types/graphql/type/index.d.ts | 29 ++- types/graphql/type/introspection.d.ts | 5 + types/graphql/type/scalars.d.ts | 4 + types/graphql/type/schema.d.ts | 52 ++-- types/graphql/type/validate.d.ts | 17 ++ 7 files changed, 295 insertions(+), 210 deletions(-) create mode 100644 types/graphql/type/validate.d.ts diff --git a/types/graphql/type/definition.d.ts b/types/graphql/type/definition.d.ts index b31ac6bbed..ed87af50ad 100644 --- a/types/graphql/type/definition.d.ts +++ b/types/graphql/type/definition.d.ts @@ -1,3 +1,4 @@ +import { MaybePromise } from "../jsutils/MaybePromise"; import { ScalarTypeDefinitionNode, ObjectTypeDefinitionNode, @@ -8,7 +9,8 @@ import { EnumTypeDefinitionNode, EnumValueDefinitionNode, InputObjectTypeDefinitionNode, - TypeExtensionNode, + ObjectTypeExtensionNode, + InterfaceTypeExtensionNode, OperationDefinitionNode, FieldNode, FragmentDefinitionNode, @@ -33,6 +35,38 @@ export function isType(type: any): type is GraphQLType; export function assertType(type: any): GraphQLType; +export function isScalarType(type: GraphQLType): type is GraphQLScalarType; + +export function assertScalarType(type: GraphQLType): GraphQLScalarType; + +export function isObjectType(type: GraphQLType): type is GraphQLObjectType; + +export function assertObjectType(type: GraphQLType): GraphQLObjectType; + +export function isInterfaceType(type: GraphQLType): type is GraphQLInterfaceType; + +export function assertInterfaceType(type: GraphQLType): GraphQLInterfaceType; + +export function isUnionType(type: GraphQLType): type is GraphQLUnionType; + +export function assertUnionType(type: GraphQLType): GraphQLUnionType; + +export function isEnumType(type: GraphQLType): type is GraphQLEnumType; + +export function assertEnumType(type: GraphQLType): GraphQLEnumType; + +export function isInputObjectType(type: GraphQLType): type is GraphQLInputObjectType; + +export function assertInputObjectType(type: GraphQLType): GraphQLInputObjectType; + +export function isListType(type: GraphQLType): type is GraphQLList; + +export function assertListType(type: GraphQLType): GraphQLList; + +export function isNonNullType(type: GraphQLType): type is GraphQLNonNull; + +export function assertNonNullType(type: GraphQLType): GraphQLNonNull; + /** * These types may be used as input types for arguments and directives. */ @@ -97,6 +131,66 @@ export function isAbstractType(type: GraphQLType): type is GraphQLAbstractType; export function assertAbstractType(type: GraphQLType): GraphQLAbstractType; +/** + * List Modifier + * + * A list is a kind of type marker, a wrapping type which points to another + * type. Lists are often created within the context of defining the fields of + * an object type. + * + * Example: + * + * const PersonType = new GraphQLObjectType({ + * name: 'Person', + * fields: () => ({ + * parents: { type: new GraphQLList(Person) }, + * children: { type: new GraphQLList(Person) }, + * }) + * }) + * + */ +export class GraphQLList { + readonly ofType: T; + constructor(type: T); + toString(): string; + toJSON(): string; + inspect(): string; +} + +/** + * Non-Null Modifier + * + * A non-null is a kind of type marker, a wrapping type which points to another + * type. Non-null types enforce that their values are never null and can ensure + * an error is raised if this ever occurs during a request. It is useful for + * fields which you can make a strong guarantee on non-nullability, for example + * usually the id field of a database row will never be null. + * + * Example: + * + * const RowType = new GraphQLObjectType({ + * name: 'Row', + * fields: () => ({ + * id: { type: new GraphQLNonNull(GraphQLString) }, + * }) + * }) + * + * Note: the enforcement of non-nullability occurs within the executor. + */ +export class GraphQLNonNull { + readonly ofType: T; + constructor(type: T); + toString(): string; + toJSON(): string; + inspect(): string; +} + +export type GraphQLWrappingType = GraphQLList | GraphQLNonNull; + +export function isWrappingType(type: GraphQLType): type is GraphQLWrappingType; + +export function assertWrappingType(type: GraphQLType): GraphQLWrappingType; + /** * These types can all accept null as a value. */ @@ -109,7 +203,13 @@ export type GraphQLNullableType = | GraphQLInputObjectType | GraphQLList; -export function getNullableType(type: T): T & GraphQLNullableType; +export function isNullableType(type: GraphQLType): type is GraphQLNullableType; + +export function assertNullableType(type: GraphQLType): GraphQLNullableType; + +export function getNullableType(type: void): undefined; +export function getNullableType(type: T): T; +export function getNullableType(type: GraphQLNonNull): T; /** * These named types do not include modifiers like List or NonNull. @@ -122,10 +222,11 @@ export type GraphQLNamedType = | GraphQLEnumType | GraphQLInputObjectType; -export function isNamedType(type: GraphQLType): boolean; +export function isNamedType(type: GraphQLType): type is GraphQLNamedType; export function assertNamedType(type: GraphQLType): GraphQLNamedType; +export function getNamedType(type: void): undefined; export function getNamedType(type: GraphQLType): GraphQLNamedType; /** @@ -153,8 +254,8 @@ export type Thunk = (() => T) | T; */ export class GraphQLScalarType { name: string; - description: string; - astNode?: ScalarTypeDefinitionNode; + description: string | void; + astNode?: ScalarTypeDefinitionNode | void; constructor(config: GraphQLScalarTypeConfig); // Serializes an internal value to include in a response. @@ -164,18 +265,20 @@ export class GraphQLScalarType { parseValue(value: any): any; // Parses an externally provided literal value to use as an input. - parseLiteral(valueNode: ValueNode): any; + parseLiteral(valueNode: ValueNode, variables?: { [key: string]: any } | void): any; toString(): string; + toJSON(): string; + inspect(): string; } export interface GraphQLScalarTypeConfig { name: string; - description?: string; - astNode?: ScalarTypeDefinitionNode; - serialize(value: any): TExternal | null | undefined; - parseValue?(value: any): TInternal | null | undefined; - parseLiteral?(valueNode: ValueNode): TInternal | null | undefined; + description?: string | void; + astNode?: ScalarTypeDefinitionNode | void; + serialize(value: any): TExternal | void; + parseValue?(value: any): TInternal | void; + parseLiteral?(valueNode: ValueNode, variables: { [key: string]: any } | void): TInternal | void; } /** @@ -217,38 +320,40 @@ export interface GraphQLScalarTypeConfig { */ export class GraphQLObjectType { name: string; - description: string; - astNode?: ObjectTypeDefinitionNode; - extensionASTNodes: Array; - isTypeOf: GraphQLIsTypeOfFn; + description: string | void; + astNode: ObjectTypeDefinitionNode | void; + extensionASTNodes: ReadonlyArray | void; + isTypeOf: GraphQLIsTypeOfFn | void; constructor(config: GraphQLObjectTypeConfig); getFields(): GraphQLFieldMap; getInterfaces(): GraphQLInterfaceType[]; toString(): string; + toJSON(): string; + inspect(): string; } export interface GraphQLObjectTypeConfig { name: string; - interfaces?: Thunk; + interfaces?: Thunk; fields: Thunk>; - isTypeOf?: GraphQLIsTypeOfFn; - description?: string; - astNode?: ObjectTypeDefinitionNode; - extensionASTNodes?: Array; + isTypeOf?: GraphQLIsTypeOfFn | void; + description?: string | void; + astNode?: ObjectTypeDefinitionNode | void; + extensionASTNodes?: ReadonlyArray | void; } export type GraphQLTypeResolver = ( value: TSource, context: TContext, info: GraphQLResolveInfo -) => GraphQLObjectType | string | Promise; +) => MaybePromise; export type GraphQLIsTypeOfFn = ( source: TSource, context: TContext, info: GraphQLResolveInfo -) => boolean | Promise; +) => MaybePromise; export type GraphQLFieldResolver = ( source: TSource, @@ -258,68 +363,69 @@ export type GraphQLFieldResolver any; export interface GraphQLResolveInfo { - fieldName: string; - fieldNodes: FieldNode[]; - returnType: GraphQLOutputType; - parentType: GraphQLCompositeType; - path: ResponsePath; - schema: GraphQLSchema; - fragments: { [fragmentName: string]: FragmentDefinitionNode }; - rootValue: any; - operation: OperationDefinitionNode; - variableValues: { [variableName: string]: any }; + readonly fieldName: string; + readonly fieldNodes: ReadonlyArray; + readonly returnType: GraphQLOutputType; + readonly parentType: GraphQLObjectType; + readonly path: ResponsePath; + readonly schema: GraphQLSchema; + readonly fragments: { [key: string]: FragmentDefinitionNode }; + readonly rootValue: any; + readonly operation: OperationDefinitionNode; + readonly variableValues: { [variableName: string]: any }; } -export type ResponsePath = { prev: ResponsePath; key: string | number } | undefined; +export type ResponsePath = { + readonly prev: ResponsePath | undefined; + readonly key: string | number; +}; export interface GraphQLFieldConfig { type: GraphQLOutputType; args?: GraphQLFieldConfigArgumentMap; resolve?: GraphQLFieldResolver; subscribe?: GraphQLFieldResolver; - deprecationReason?: string; - description?: string; - astNode?: FieldDefinitionNode; + deprecationReason?: string | void; + description?: string | void; + astNode?: FieldDefinitionNode | void; } -export interface GraphQLFieldConfigArgumentMap { - [argName: string]: GraphQLArgumentConfig; -} +export type GraphQLFieldConfigArgumentMap = { [key: string]: GraphQLArgumentConfig }; export interface GraphQLArgumentConfig { type: GraphQLInputType; defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + description?: string | void; + astNode?: InputValueDefinitionNode | void; } -export interface GraphQLFieldConfigMap { - [fieldName: string]: GraphQLFieldConfig; -} +export type GraphQLFieldConfigMap = { + [key: string]: GraphQLFieldConfig; +}; -export interface GraphQLField { +export interface GraphQLField { name: string; - description: string; + description: string | void; type: GraphQLOutputType; args: GraphQLArgument[]; resolve?: GraphQLFieldResolver; subscribe?: GraphQLFieldResolver; isDeprecated?: boolean; - deprecationReason?: string; - astNode?: FieldDefinitionNode; + deprecationReason?: string | void; + astNode?: FieldDefinitionNode | void; } export interface GraphQLArgument { name: string; type: GraphQLInputType; defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + description?: string | void; + astNode?: InputValueDefinitionNode | void; } -export interface GraphQLFieldMap { - [fieldName: string]: GraphQLField; -} +export type GraphQLFieldMap = { + [key: string]: GraphQLField; +}; /** * Interface Type Definition @@ -341,15 +447,18 @@ export interface GraphQLFieldMap { */ export class GraphQLInterfaceType { name: string; - description: string; - astNode?: InterfaceTypeDefinitionNode; - resolveType: GraphQLTypeResolver; + description: string | void; + astNode?: InterfaceTypeDefinitionNode | void; + extensionASTNodes: ReadonlyArray | void; + resolveType: GraphQLTypeResolver | void; constructor(config: GraphQLInterfaceTypeConfig); getFields(): GraphQLFieldMap; toString(): string; + toJSON(): string; + inspect(): string; } export interface GraphQLInterfaceTypeConfig { @@ -360,9 +469,10 @@ export interface GraphQLInterfaceTypeConfig { * the default implementation will call `isTypeOf` on each implementing * Object type. */ - resolveType?: GraphQLTypeResolver; - description?: string; - astNode?: InterfaceTypeDefinitionNode; + resolveType?: GraphQLTypeResolver | void; + description?: string | void; + astNode?: InterfaceTypeDefinitionNode | void; + extensionASTNodes?: ReadonlyArray | void; } /** @@ -390,15 +500,17 @@ export interface GraphQLInterfaceTypeConfig { */ export class GraphQLUnionType { name: string; - description: string; - astNode?: UnionTypeDefinitionNode; - resolveType: GraphQLTypeResolver; + description: string | void; + astNode?: UnionTypeDefinitionNode | void; + resolveType: GraphQLTypeResolver | void; constructor(config: GraphQLUnionTypeConfig); getTypes(): GraphQLObjectType[]; toString(): string; + toJSON(): string; + inspect(): string; } export interface GraphQLUnionTypeConfig { @@ -409,9 +521,9 @@ export interface GraphQLUnionTypeConfig { * the default implementation will call `isTypeOf` on each implementing * Object type. */ - resolveType?: GraphQLTypeResolver; - description?: string; - astNode?: UnionTypeDefinitionNode; + resolveType?: GraphQLTypeResolver | void; + description?: string | void; + astNode?: UnionTypeDefinitionNode | void; } /** @@ -437,43 +549,42 @@ export interface GraphQLUnionTypeConfig { */ export class GraphQLEnumType { name: string; - description: string; - astNode?: EnumTypeDefinitionNode; + description: string | void; + astNode: EnumTypeDefinitionNode | void; constructor(config: GraphQLEnumTypeConfig); getValues(): GraphQLEnumValue[]; - getValue(name: string): GraphQLEnumValue; - isValidValue(value: any): boolean; - serialize(value: any): string; + getValue(name: string): GraphQLEnumValue | void; + serialize(value: any): string | void; parseValue(value: any): any; - parseLiteral(valueNode: ValueNode): any; + parseLiteral(valueNode: ValueNode, _variables: { [key: string]: any } | void): any; toString(): string; + toJSON(): string; + inspect(): string; } export interface GraphQLEnumTypeConfig { name: string; values: GraphQLEnumValueConfigMap; - description?: string; - astNode?: EnumTypeDefinitionNode; + description?: string | void; + astNode?: EnumTypeDefinitionNode | void; } -export interface GraphQLEnumValueConfigMap { - [valueName: string]: GraphQLEnumValueConfig; -} +export type GraphQLEnumValueConfigMap = { [key: string]: GraphQLEnumValueConfig }; export interface GraphQLEnumValueConfig { value?: any; - deprecationReason?: string; - description?: string; - astNode?: EnumValueDefinitionNode; + deprecationReason?: string | void; + description?: string | void; + astNode?: EnumValueDefinitionNode | void; } export interface GraphQLEnumValue { name: string; - description: string; + description: string | void; isDeprecated?: boolean; - deprecationReason: string; - astNode?: EnumValueDefinitionNode; + deprecationReason: string | void; + astNode?: EnumValueDefinitionNode | void; value: any; } @@ -499,91 +610,39 @@ export interface GraphQLEnumValue { */ export class GraphQLInputObjectType { name: string; - description: string; - astNode?: InputObjectTypeDefinitionNode; + description: string | void; + astNode: InputObjectTypeDefinitionNode | void; constructor(config: GraphQLInputObjectTypeConfig); getFields(): GraphQLInputFieldMap; toString(): string; + toJSON(): string; + inspect(): string; } export interface GraphQLInputObjectTypeConfig { name: string; fields: Thunk; - description?: string; - astNode?: InputObjectTypeDefinitionNode; + description?: string | void; + astNode?: InputObjectTypeDefinitionNode | void; } export interface GraphQLInputFieldConfig { type: GraphQLInputType; defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + description?: string | void; + astNode?: InputValueDefinitionNode | void; } -export interface GraphQLInputFieldConfigMap { - [fieldName: string]: GraphQLInputFieldConfig; -} +export type GraphQLInputFieldConfigMap = { + [key: string]: GraphQLInputFieldConfig; +}; export interface GraphQLInputField { name: string; type: GraphQLInputType; defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + description?: string | void; + astNode?: InputValueDefinitionNode | void; } -export interface GraphQLInputFieldMap { - [fieldName: string]: GraphQLInputField; -} - -/** - * List Modifier - * - * A list is a kind of type marker, a wrapping type which points to another - * type. Lists are often created within the context of defining the fields of - * an object type. - * - * Example: - * - * const PersonType = new GraphQLObjectType({ - * name: 'Person', - * fields: () => ({ - * parents: { type: new GraphQLList(Person) }, - * children: { type: new GraphQLList(Person) }, - * }) - * }) - * - */ -export class GraphQLList { - ofType: T; - constructor(type: T); - toString(): string; -} - -/** - * Non-Null Modifier - * - * A non-null is a kind of type marker, a wrapping type which points to another - * type. Non-null types enforce that their values are never null and can ensure - * an error is raised if this ever occurs during a request. It is useful for - * fields which you can make a strong guarantee on non-nullability, for example - * usually the id field of a database row will never be null. - * - * Example: - * - * const RowType = new GraphQLObjectType({ - * name: 'Row', - * fields: () => ({ - * id: { type: new GraphQLNonNull(GraphQLString) }, - * }) - * }) - * - * Note: the enforcement of non-nullability occurs within the executor. - */ -export class GraphQLNonNull { - ofType: T; - - constructor(type: T); - - toString(): string; -} +export type GraphQLInputFieldMap = { [key: string]: GraphQLInputField }; diff --git a/types/graphql/type/directives.d.ts b/types/graphql/type/directives.d.ts index bf1fc8df16..f6e19f674d 100644 --- a/types/graphql/type/directives.d.ts +++ b/types/graphql/type/directives.d.ts @@ -1,30 +1,11 @@ import { GraphQLFieldConfigArgumentMap, GraphQLArgument } from "./definition"; import { DirectiveDefinitionNode } from "../language/ast"; +import { DirectiveLocationEnum } from "../language/directiveLocation"; -export const DirectiveLocation: { - // Operations - QUERY: "QUERY"; - MUTATION: "MUTATION"; - SUBSCRIPTION: "SUBSCRIPTION"; - FIELD: "FIELD"; - FRAGMENT_DEFINITION: "FRAGMENT_DEFINITION"; - FRAGMENT_SPREAD: "FRAGMENT_SPREAD"; - INLINE_FRAGMENT: "INLINE_FRAGMENT"; - // Schema Definitions - SCHEMA: "SCHEMA"; - SCALAR: "SCALAR"; - OBJECT: "OBJECT"; - FIELD_DEFINITION: "FIELD_DEFINITION"; - ARGUMENT_DEFINITION: "ARGUMENT_DEFINITION"; - INTERFACE: "INTERFACE"; - UNION: "UNION"; - ENUM: "ENUM"; - ENUM_VALUE: "ENUM_VALUE"; - INPUT_OBJECT: "INPUT_OBJECT"; - INPUT_FIELD_DEFINITION: "INPUT_FIELD_DEFINITION"; -}; - -export type DirectiveLocationEnum = keyof typeof DirectiveLocation; +/** + * Test if the given value is a GraphQL directive. + */ +export function isDirective(directive: any): directive is GraphQLDirective; /** * Directives are used by the GraphQL runtime as a way of modifying execution @@ -32,20 +13,20 @@ export type DirectiveLocationEnum = keyof typeof DirectiveLocation; */ export class GraphQLDirective { name: string; - description?: string; + description: string | void; locations: DirectiveLocationEnum[]; args: GraphQLArgument[]; - astNode?: DirectiveDefinitionNode; + astNode: DirectiveDefinitionNode | void; constructor(config: GraphQLDirectiveConfig); } export interface GraphQLDirectiveConfig { name: string; - description?: string; + description?: string | void; locations: DirectiveLocationEnum[]; - args?: GraphQLFieldConfigArgumentMap; - astNode?: DirectiveDefinitionNode; + args?: GraphQLFieldConfigArgumentMap | void; + astNode?: DirectiveDefinitionNode | void; } /** @@ -71,4 +52,6 @@ export const GraphQLDeprecatedDirective: GraphQLDirective; /** * The full list of specified directives. */ -export const specifiedDirectives: GraphQLDirective[]; +export const specifiedDirectives: ReadonlyArray; + +export function isSpecifiedDirective(directive: GraphQLDirective): boolean; diff --git a/types/graphql/type/index.d.ts b/types/graphql/type/index.d.ts index 551ade35e7..39c510fc95 100644 --- a/types/graphql/type/index.d.ts +++ b/types/graphql/type/index.d.ts @@ -1,29 +1,46 @@ -// GraphQL Schema definition -export { GraphQLSchema } from "./schema"; +export { + // Predicate + isSchema, + // GraphQL Schema definition + GraphQLSchema, + GraphQLSchemaConfig, +} from "./schema"; export * from "./definition"; export { - // "Enum" of Directive Locations - DirectiveLocation, + // Predicate + isDirective, // Directives Definition GraphQLDirective, // Built-in Directives defined by the Spec + isSpecifiedDirective, specifiedDirectives, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, // Constant Deprecation Reason DEFAULT_DEPRECATION_REASON, + GraphQLDirectiveConfig, } from "./directives"; // Common built-in scalar instances. -export { GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID } from "./scalars"; +export { + isSpecifiedScalarType, + specifiedScalarTypes, + GraphQLInt, + GraphQLFloat, + GraphQLString, + GraphQLBoolean, + GraphQLID, +} from "./scalars"; export { // "Enum" of Type Kinds TypeKind, // GraphQL Types for introspection. + isIntrospectionType, + introspectionTypes, __Schema, __Directive, __DirectiveLocation, @@ -38,4 +55,4 @@ export { TypeNameMetaFieldDef, } from "./introspection"; -export { DirectiveLocationEnum } from "./directives"; +export { validateSchema, assertValidSchema } from "./validate"; diff --git a/types/graphql/type/introspection.d.ts b/types/graphql/type/introspection.d.ts index 042c3e2b6b..beed0ebeb2 100644 --- a/types/graphql/type/introspection.d.ts +++ b/types/graphql/type/introspection.d.ts @@ -35,6 +35,11 @@ export const __TypeKind: GraphQLEnumType; * Note that these are GraphQLField and not GraphQLFieldConfig, * so the format for args is different. */ + export const SchemaMetaFieldDef: GraphQLField; export const TypeMetaFieldDef: GraphQLField; export const TypeNameMetaFieldDef: GraphQLField; + +export const introspectionTypes: ReadonlyArray; + +export function isIntrospectionType(type: any): boolean; diff --git a/types/graphql/type/scalars.d.ts b/types/graphql/type/scalars.d.ts index 287d99602a..1476bf7ab8 100644 --- a/types/graphql/type/scalars.d.ts +++ b/types/graphql/type/scalars.d.ts @@ -5,3 +5,7 @@ export const GraphQLFloat: GraphQLScalarType; export const GraphQLString: GraphQLScalarType; export const GraphQLBoolean: GraphQLScalarType; export const GraphQLID: GraphQLScalarType; + +export const specifiedScalarTypes: ReadonlyArray; + +export function isSpecifiedScalarType(type: GraphQLScalarType): boolean; diff --git a/types/graphql/type/schema.d.ts b/types/graphql/type/schema.d.ts index bdd1089756..a7bb94f5c5 100644 --- a/types/graphql/type/schema.d.ts +++ b/types/graphql/type/schema.d.ts @@ -3,6 +3,11 @@ import { GraphQLType, GraphQLNamedType, GraphQLAbstractType } from "./definition import { SchemaDefinitionNode } from "../language/ast"; import { GraphQLDirective } from "./directives"; +/** + * Test if the given value is a GraphQL schema. + */ +export function isSchema(schema: any): schema is GraphQLSchema; + /** * Schema Definition * @@ -30,31 +35,26 @@ import { GraphQLDirective } from "./directives"; * */ export class GraphQLSchema { - astNode?: SchemaDefinitionNode; - // private _queryType: GraphQLObjectType; - // private _mutationType: GraphQLObjectType; - // private _subscriptionType: GraphQLObjectType; - // private _directives: Array; - // private _typeMap: TypeMap; - // private _implementations: { [interfaceName: string]: Array }; - // private _possibleTypeMap: { [abstractName: string]: { [possibleName: string]: boolean } }; + astNode: SchemaDefinitionNode | void; constructor(config: GraphQLSchemaConfig); - getQueryType(): GraphQLObjectType; - getMutationType(): GraphQLObjectType | null | undefined; - getSubscriptionType(): GraphQLObjectType | null | undefined; - getTypeMap(): { [typeName: string]: GraphQLNamedType }; - getType(name: string): GraphQLNamedType; - getPossibleTypes(abstractType: GraphQLAbstractType): GraphQLObjectType[]; + getQueryType(): GraphQLObjectType | void; + getMutationType(): GraphQLObjectType | void; + getSubscriptionType(): GraphQLObjectType | void; + getTypeMap(): TypeMap; + getType(name: string): GraphQLNamedType | void; + getPossibleTypes(abstractType: GraphQLAbstractType): ReadonlyArray; isPossibleType(abstractType: GraphQLAbstractType, possibleType: GraphQLObjectType): boolean; - getDirectives(): GraphQLDirective[]; - getDirective(name: string): GraphQLDirective; + getDirectives(): ReadonlyArray; + getDirective(name: string): GraphQLDirective | void; } -export type GraphQLSchemaValidationOptions = { +type TypeMap = { [key: string]: GraphQLNamedType }; + +export interface GraphQLSchemaValidationOptions { /** * When building a schema from a GraphQL service's introspection result, it * might be safe to assume the schema is valid. Set to true to assume the @@ -72,14 +72,14 @@ export type GraphQLSchemaValidationOptions = { * This option is provided to ease adoption and may be removed in a future * major release. */ - allowedLegacyNames?: ReadonlyArray; -}; + allowedLegacyNames?: ReadonlyArray | void; +} -export interface GraphQLSchemaConfig { - query: GraphQLObjectType; - mutation?: GraphQLObjectType; - subscription?: GraphQLObjectType; - types?: GraphQLNamedType[]; - directives?: GraphQLDirective[]; - astNode?: SchemaDefinitionNode; +export interface GraphQLSchemaConfig extends GraphQLSchemaValidationOptions { + query: GraphQLObjectType | void; + mutation?: GraphQLObjectType | void; + subscription?: GraphQLObjectType | void; + types?: GraphQLNamedType[] | void; + directives?: GraphQLDirective[] | void; + astNode?: SchemaDefinitionNode | void; } diff --git a/types/graphql/type/validate.d.ts b/types/graphql/type/validate.d.ts new file mode 100644 index 0000000000..e23f9e6386 --- /dev/null +++ b/types/graphql/type/validate.d.ts @@ -0,0 +1,17 @@ +import { GraphQLSchema } from "./schema"; +import { GraphQLError } from "../error/GraphQLError"; + +/** + * Implements the "Type Validation" sub-sections of the specification's + * "Type System" section. + * + * Validation runs synchronously, returning an array of encountered errors, or + * an empty array if no errors were encountered and the Schema is valid. + */ +export function validateSchema(schema: GraphQLSchema): ReadonlyArray; + +/** + * Utility function which asserts a schema is valid by throwing an error if + * it is invalid. + */ +export function assertValidSchema(schema: GraphQLSchema): void; From 107916a7eb10ceb150f4db68cd1c935649c42b06 Mon Sep 17 00:00:00 2001 From: Firede Date: Wed, 28 Mar 2018 00:49:50 +0800 Subject: [PATCH 0264/2153] update `graphql/utilities/*` -> `v0.13.2`. https://github.com/graphql/graphql-js/tree/v0.13.2/src/utilities --- types/graphql/utilities/TypeInfo.d.ts | 24 +- types/graphql/utilities/assertValidName.d.ts | 14 +- types/graphql/utilities/astFromValue.d.ts | 18 +- types/graphql/utilities/buildASTSchema.d.ts | 45 +++- .../graphql/utilities/buildClientSchema.d.ts | 3 + types/graphql/utilities/coerceValue.d.ts | 22 ++ types/graphql/utilities/concatAST.d.ts | 2 +- types/graphql/utilities/extendSchema.d.ts | 20 +- .../utilities/findBreakingChanges.d.ts | 120 +++++++-- types/graphql/utilities/getOperationAST.d.ts | 5 +- types/graphql/utilities/index.d.ts | 42 ++- .../utilities/introspectionFromSchema.d.ts | 13 + .../graphql/utilities/introspectionQuery.d.ts | 239 +++++++----------- types/graphql/utilities/isValidJSValue.d.ts | 4 +- .../utilities/isValidLiteralValue.d.ts | 9 +- .../utilities/lexicographicSortSchema.d.ts | 6 + types/graphql/utilities/schemaPrinter.d.ts | 17 +- .../graphql/utilities/separateOperations.d.ts | 8 +- types/graphql/utilities/typeFromAST.d.ts | 17 +- types/graphql/utilities/valueFromAST.d.ts | 26 +- .../utilities/valueFromASTUntyped.d.ts | 19 ++ 21 files changed, 440 insertions(+), 233 deletions(-) create mode 100644 types/graphql/utilities/coerceValue.d.ts create mode 100644 types/graphql/utilities/introspectionFromSchema.d.ts create mode 100644 types/graphql/utilities/lexicographicSortSchema.d.ts create mode 100644 types/graphql/utilities/valueFromASTUntyped.d.ts diff --git a/types/graphql/utilities/TypeInfo.d.ts b/types/graphql/utilities/TypeInfo.d.ts index 8b1ddc6206..1c2f139642 100644 --- a/types/graphql/utilities/TypeInfo.d.ts +++ b/types/graphql/utilities/TypeInfo.d.ts @@ -22,22 +22,26 @@ export class TypeInfo { // NOTE: this experimental optional second parameter is only needed in order // to support non-spec-compliant codebases. You should never need to use it. // It may disappear in the future. - getFieldDefFn?: getFieldDef + getFieldDefFn?: getFieldDef, + // Initial type may be provided in rare cases to facilitate traversals + // beginning somewhere other than documents. + initialType?: GraphQLType ); - getType(): GraphQLOutputType; - getParentType(): GraphQLCompositeType; - getInputType(): GraphQLInputType; - getFieldDef(): GraphQLField; - getDirective(): GraphQLDirective; - getArgument(): GraphQLArgument; - getEnumValue(): GraphQLEnumValue; + getType(): GraphQLOutputType | void; + getParentType(): GraphQLCompositeType | void; + getInputType(): GraphQLInputType | void; + getParentInputType(): GraphQLInputType | void; + getFieldDef(): GraphQLField | void; + getDirective(): GraphQLDirective | void; + getArgument(): GraphQLArgument | void; + getEnumValue(): GraphQLEnumValue | void; enter(node: ASTNode): any; leave(node: ASTNode): any; } -export type getFieldDef = ( +type getFieldDef = ( schema: GraphQLSchema, parentType: GraphQLType, fieldNode: FieldNode -) => GraphQLField; +) => GraphQLField | void; diff --git a/types/graphql/utilities/assertValidName.d.ts b/types/graphql/utilities/assertValidName.d.ts index 5ca2310a26..19f81e3991 100644 --- a/types/graphql/utilities/assertValidName.d.ts +++ b/types/graphql/utilities/assertValidName.d.ts @@ -1,2 +1,12 @@ -// Helper to assert that provided names are valid. -export function assertValidName(name: string): void; +import { GraphQLError } from "../error/GraphQLError"; +import { ASTNode } from "../language/ast"; + +/** + * Upholds the spec rules about naming. + */ +export function assertValidName(name: string): string; + +/** + * Returns an Error if a name is invalid. + */ +export function isValidNameError(name: string, node?: ASTNode | undefined): GraphQLError | undefined; diff --git a/types/graphql/utilities/astFromValue.d.ts b/types/graphql/utilities/astFromValue.d.ts index 57f7f977ad..9c2198e6d6 100644 --- a/types/graphql/utilities/astFromValue.d.ts +++ b/types/graphql/utilities/astFromValue.d.ts @@ -1,16 +1,4 @@ -import { - ValueNode, - /* - TODO: - IntValueNode, - FloatValueNode, - StringValueNode, - BooleanValueNode, - EnumValueNode, - ListValueNode, - ObjectValueNode, - */ -} from "../language/ast"; +import { ValueNode } from "../language/ast"; import { GraphQLInputType } from "../type/definition"; /** @@ -27,7 +15,7 @@ import { GraphQLInputType } from "../type/definition"; * | String | String / Enum Value | * | Number | Int / Float | * | Mixed | Enum Value | + * | null | NullValue | * */ -// TODO: this should set overloads according to above the table -export function astFromValue(value: any, type: GraphQLInputType): ValueNode; // Warning: there is a code in bottom: throw new TypeError +export function astFromValue(value: any, type: GraphQLInputType): ValueNode | void; diff --git a/types/graphql/utilities/buildASTSchema.d.ts b/types/graphql/utilities/buildASTSchema.d.ts index 4d256fe180..ebff50b4f7 100644 --- a/types/graphql/utilities/buildASTSchema.d.ts +++ b/types/graphql/utilities/buildASTSchema.d.ts @@ -1,6 +1,18 @@ -import { DocumentNode, Location, StringValueNode } from "../language/ast"; +import { + DocumentNode, + Location, + StringValueNode, + TypeDefinitionNode, + NamedTypeNode, + DirectiveDefinitionNode, + FieldDefinitionNode, +} from "../language/ast"; +import { GraphQLNamedType, GraphQLFieldConfig } from "../type/definition"; +import { GraphQLDirective } from "../type/directives"; import { Source } from "../language/source"; import { GraphQLSchema, GraphQLSchemaValidationOptions } from "../type/schema"; +import { ParseOptions } from "../language/parser"; +import blockStringValue from "../language/blockStringValue"; interface BuildSchemaOptions extends GraphQLSchemaValidationOptions { /** @@ -22,8 +34,29 @@ interface BuildSchemaOptions extends GraphQLSchemaValidationOptions { * * Given that AST it constructs a GraphQLSchema. The resulting schema * has no resolve methods, so execution will use default resolvers. + * + * Accepts options as a second argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * */ -export function buildASTSchema(ast: DocumentNode): GraphQLSchema; +export function buildASTSchema(ast: DocumentNode, options?: BuildSchemaOptions): GraphQLSchema; + +type TypeDefinitionsMap = { [key: string]: TypeDefinitionNode }; +type TypeResolver = (typeRef: NamedTypeNode) => GraphQLNamedType; + +export class ASTDefinitionBuilder { + constructor(typeDefinitionsMap: TypeDefinitionsMap, options: BuildSchemaOptions | void, resolveType: TypeResolver); + + buildTypes(nodes: ReadonlyArray): Array; + + buildType(node: NamedTypeNode | TypeDefinitionNode): GraphQLNamedType; + + buildDirective(directiveNode: DirectiveDefinitionNode): GraphQLDirective; + + buildField(field: FieldDefinitionNode): GraphQLFieldConfig; +} /** * Given an ast node, returns its string description. @@ -35,12 +68,12 @@ export function buildASTSchema(ast: DocumentNode): GraphQLSchema; * */ export function getDescription( - node: { description?: StringValueNode; loc?: Location }, - options: BuildSchemaOptions -): string; + node: { readonly description?: StringValueNode; readonly loc?: Location }, + options: BuildSchemaOptions | void +): string | undefined; /** * A helper function to build a GraphQLSchema directly from a source * document. */ -export function buildSchema(source: string | Source): GraphQLSchema; +export function buildSchema(source: string | Source, options?: BuildSchemaOptions & ParseOptions): GraphQLSchema; diff --git a/types/graphql/utilities/buildClientSchema.d.ts b/types/graphql/utilities/buildClientSchema.d.ts index 80516c2111..128c34ca48 100644 --- a/types/graphql/utilities/buildClientSchema.d.ts +++ b/types/graphql/utilities/buildClientSchema.d.ts @@ -11,5 +11,8 @@ interface Options extends GraphQLSchemaValidationOptions {} * tools, but cannot be used to execute a query, as introspection does not * represent the "resolver", "parse" or "serialize" functions or any other * server-internal mechanisms. + * + * This function expects a complete introspection result. Don't forget to check + * the "errors" field of a server response before calling this function. */ export function buildClientSchema(introspection: IntrospectionQuery, options?: Options): GraphQLSchema; diff --git a/types/graphql/utilities/coerceValue.d.ts b/types/graphql/utilities/coerceValue.d.ts new file mode 100644 index 0000000000..081eea4a32 --- /dev/null +++ b/types/graphql/utilities/coerceValue.d.ts @@ -0,0 +1,22 @@ +import { GraphQLError } from "../error"; +import { ASTNode } from "../language/ast"; +import { GraphQLInputType } from "../type/definition"; + +interface CoercedValue { + readonly errors: ReadonlyArray | undefined; + readonly value: any; +} + +interface Path { + readonly prev: Path | undefined; + readonly key: string | number; +} + +/** + * Coerces a JavaScript value given a GraphQL Type. + * + * Returns either a value which is valid for the provided type or a list of + * encountered coercion errors. + * + */ +export function coerceValue(value: any, type: GraphQLInputType, blameNode?: ASTNode, path?: Path): CoercedValue; diff --git a/types/graphql/utilities/concatAST.d.ts b/types/graphql/utilities/concatAST.d.ts index 6e4c33aed5..08c5104076 100644 --- a/types/graphql/utilities/concatAST.d.ts +++ b/types/graphql/utilities/concatAST.d.ts @@ -5,4 +5,4 @@ import { DocumentNode } from "../language/ast"; * concatenate the ASTs together into batched AST, useful for validating many * GraphQL source files which together represent one conceptual application. */ -export function concatAST(asts: DocumentNode[]): DocumentNode; +export function concatAST(asts: ReadonlyArray): DocumentNode; diff --git a/types/graphql/utilities/extendSchema.d.ts b/types/graphql/utilities/extendSchema.d.ts index 027c4d5745..7cde767ed7 100644 --- a/types/graphql/utilities/extendSchema.d.ts +++ b/types/graphql/utilities/extendSchema.d.ts @@ -1,5 +1,17 @@ import { DocumentNode } from "../language/ast"; import { GraphQLSchema } from "../type/schema"; +import { GraphQLSchemaValidationOptions } from "../type/schema"; + +interface Options extends GraphQLSchemaValidationOptions { + /** + * Descriptions are defined as preceding string literals, however an older + * experimental version of the SDL supported preceding comments as + * descriptions. Set to true to enable this deprecated behavior. + * + * Default: false + */ + commentDescriptions?: boolean; +} /** * Produces a new schema given an existing schema and a document which may @@ -12,5 +24,11 @@ import { GraphQLSchema } from "../type/schema"; * * This algorithm copies the provided schema, applying extensions while * producing the copy. The original schema remains unaltered. + * + * Accepts options as a third argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * */ -export function extendSchema(schema: GraphQLSchema, documentAST: DocumentNode): GraphQLSchema; +export function extendSchema(schema: GraphQLSchema, documentAST: DocumentNode, options?: Options): GraphQLSchema; diff --git a/types/graphql/utilities/findBreakingChanges.d.ts b/types/graphql/utilities/findBreakingChanges.d.ts index 37b98dae34..77f98f848a 100644 --- a/types/graphql/utilities/findBreakingChanges.d.ts +++ b/types/graphql/utilities/findBreakingChanges.d.ts @@ -8,27 +8,44 @@ import { GraphQLUnionType, GraphQLNamedType, } from "../type/definition"; +import { GraphQLDirective } from "../type/directives"; import { GraphQLSchema } from "../type/schema"; +import { DirectiveLocationEnum } from "../language/directiveLocation"; -export const BreakingChangeType: { +export type BreakingChangeType = { FIELD_CHANGED_KIND: "FIELD_CHANGED_KIND"; FIELD_REMOVED: "FIELD_REMOVED"; TYPE_CHANGED_KIND: "TYPE_CHANGED_KIND"; TYPE_REMOVED: "TYPE_REMOVED"; TYPE_REMOVED_FROM_UNION: "TYPE_REMOVED_FROM_UNION"; VALUE_REMOVED_FROM_ENUM: "VALUE_REMOVED_FROM_ENUM"; + ARG_REMOVED: "ARG_REMOVED"; + ARG_CHANGED_KIND: "ARG_CHANGED_KIND"; + NON_NULL_ARG_ADDED: "NON_NULL_ARG_ADDED"; + NON_NULL_INPUT_FIELD_ADDED: "NON_NULL_INPUT_FIELD_ADDED"; + INTERFACE_REMOVED_FROM_OBJECT: "INTERFACE_REMOVED_FROM_OBJECT"; + DIRECTIVE_REMOVED: "DIRECTIVE_REMOVED"; + DIRECTIVE_ARG_REMOVED: "DIRECTIVE_ARG_REMOVED"; + DIRECTIVE_LOCATION_REMOVED: "DIRECTIVE_LOCATION_REMOVED"; + NON_NULL_DIRECTIVE_ARG_ADDED: "NON_NULL_DIRECTIVE_ARG_ADDED"; }; -export type BreakingChangeKey = - | "FIELD_CHANGED_KIND" - | "FIELD_REMOVED" - | "TYPE_CHANGED_KIND" - | "TYPE_REMOVED" - | "TYPE_REMOVED_FROM_UNION" - | "VALUE_REMOVED_FROM_ENUM"; +export type DangerousChangeType = { + ARG_DEFAULT_VALUE_CHANGE: "ARG_DEFAULT_VALUE_CHANGE"; + VALUE_ADDED_TO_ENUM: "VALUE_ADDED_TO_ENUM"; + INTERFACE_ADDED_TO_OBJECT: "INTERFACE_ADDED_TO_OBJECT"; + TYPE_ADDED_TO_UNION: "TYPE_ADDED_TO_UNION"; + NULLABLE_INPUT_FIELD_ADDED: "NULLABLE_INPUT_FIELD_ADDED"; + NULLABLE_ARG_ADDED: "NULLABLE_ARG_ADDED"; +}; export interface BreakingChange { - type: BreakingChangeKey; + type: keyof BreakingChangeType; + description: string; +} + +export interface DangerousChange { + type: keyof DangerousChangeType; description: string; } @@ -36,35 +53,102 @@ export interface BreakingChange { * Given two schemas, returns an Array containing descriptions of all the types * of breaking changes covered by the other functions down below. */ -export function findBreakingChanges(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; +export function findBreakingChanges(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; + +/** + * Given two schemas, returns an Array containing descriptions of all the types + * of potentially dangerous changes covered by the other functions down below. + */ +export function findDangerousChanges(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; /** * Given two schemas, returns an Array containing descriptions of any breaking * changes in the newSchema related to removing an entire type. */ -export function findRemovedTypes(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; +export function findRemovedTypes(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; /** * Given two schemas, returns an Array containing descriptions of any breaking * changes in the newSchema related to changing the type of a type. */ -export function findTypesThatChangedKind(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; +export function findTypesThatChangedKind(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; /** - * Given two schemas, returns an Array containing descriptions of any breaking - * changes in the newSchema related to the fields on a type. This includes if - * a field has been removed from a type or if a field has changed type. + * Given two schemas, returns an Array containing descriptions of any + * breaking or dangerous changes in the newSchema related to arguments + * (such as removal or change of type of an argument, or a change in an + * argument's default value). */ -export function findFieldsThatChangedType(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; +export function findArgChanges( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema +): { + breakingChanges: Array; + dangerousChanges: Array; +}; + +export function findFieldsThatChangedTypeOnObjectOrInterfaceTypes( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema +): Array; + +export function findFieldsThatChangedTypeOnInputObjectTypes( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema +): { + breakingChanges: Array; + dangerousChanges: Array; +}; /** * Given two schemas, returns an Array containing descriptions of any breaking * changes in the newSchema related to removing types from a union type. */ -export function findTypesRemovedFromUnions(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; +export function findTypesRemovedFromUnions(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; + +/** + * Given two schemas, returns an Array containing descriptions of any dangerous + * changes in the newSchema related to adding types to a union type. + */ +export function findTypesAddedToUnions(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; /** * Given two schemas, returns an Array containing descriptions of any breaking * changes in the newSchema related to removing values from an enum type. */ -export function findValuesRemovedFromEnums(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; +export function findValuesRemovedFromEnums(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; + +/** + * Given two schemas, returns an Array containing descriptions of any dangerous + * changes in the newSchema related to adding values to an enum type. + */ +export function findValuesAddedToEnums(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; + +export function findInterfacesRemovedFromObjectTypes( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema +): Array; + +export function findInterfacesAddedToObjectTypes( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema +): Array; + +export function findRemovedDirectives(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; + +export function findRemovedDirectiveArgs(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; + +export function findAddedNonNullDirectiveArgs( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema +): Array; + +export function findRemovedLocationsForDirective( + oldDirective: GraphQLDirective, + newDirective: GraphQLDirective +): Array; + +export function findRemovedDirectiveLocations( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema +): Array; diff --git a/types/graphql/utilities/getOperationAST.d.ts b/types/graphql/utilities/getOperationAST.d.ts index 5a1e0dc7a7..81e9bd4cbe 100644 --- a/types/graphql/utilities/getOperationAST.d.ts +++ b/types/graphql/utilities/getOperationAST.d.ts @@ -5,4 +5,7 @@ import { DocumentNode, OperationDefinitionNode } from "../language/ast"; * name. If a name is not provided, an operation is only returned if only one is * provided in the document. */ -export function getOperationAST(documentAST: DocumentNode, operationName?: string): OperationDefinitionNode; +export function getOperationAST( + documentAST: DocumentNode, + operationName: string | void +): OperationDefinitionNode | void; diff --git a/types/graphql/utilities/index.d.ts b/types/graphql/utilities/index.d.ts index 91777235d1..f571c3ab76 100644 --- a/types/graphql/utilities/index.d.ts +++ b/types/graphql/utilities/index.d.ts @@ -1,9 +1,17 @@ // The GraphQL query recommended for a full schema introspection. -export { introspectionQuery } from "./introspectionQuery"; export { + getIntrospectionQuery, + // Deprecated, use getIntrospectionQuery() + introspectionQuery, +} from "./introspectionQuery"; + +export { + IntrospectionOptions, IntrospectionQuery, IntrospectionSchema, IntrospectionType, + IntrospectionInputType, + IntrospectionOutputType, IntrospectionScalarType, IntrospectionObjectType, IntrospectionInterfaceType, @@ -11,6 +19,8 @@ export { IntrospectionEnumType, IntrospectionInputObjectType, IntrospectionTypeRef, + IntrospectionInputTypeRef, + IntrospectionOutputTypeRef, IntrospectionNamedTypeRef, IntrospectionListTypeRef, IntrospectionNonNullTypeRef, @@ -23,24 +33,33 @@ export { // Gets the target Operation from a Document export { getOperationAST } from "./getOperationAST"; +// Convert a GraphQLSchema to an IntrospectionQuery +export { introspectionFromSchema } from "./introspectionFromSchema"; + // Build a GraphQLSchema from an introspection result. export { buildClientSchema } from "./buildClientSchema"; // Build a GraphQLSchema from GraphQL Schema language. -export { buildASTSchema, buildSchema, getDescription } from "./buildASTSchema"; +export { buildASTSchema, buildSchema, getDescription, BuildSchemaOptions } from "./buildASTSchema"; // Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST. export { extendSchema } from "./extendSchema"; +// Sort a GraphQLSchema. +export { lexicographicSortSchema } from "./lexicographicSortSchema"; + // Print a GraphQLSchema to GraphQL Schema language. export { printSchema, printType, printIntrospectionSchema } from "./schemaPrinter"; // Create a GraphQLType from a GraphQL language AST. export { typeFromAST } from "./typeFromAST"; -// Create a JavaScript value from a GraphQL language AST. +// Create a JavaScript value from a GraphQL language AST with a type. export { valueFromAST } from "./valueFromAST"; +// Create a JavaScript value from a GraphQL language AST without a type. +export { valueFromASTUntyped } from "./valueFromASTUntyped"; + // Create a GraphQL language AST from a JavaScript value. export { astFromValue } from "./astFromValue"; @@ -48,7 +67,10 @@ export { astFromValue } from "./astFromValue"; // the GraphQL type system. export { TypeInfo } from "./TypeInfo"; -// Determine if JavaScript values adhere to a GraphQL type. +// Coerces a JavaScript value to a GraphQL type, or produces errors. +export { coerceValue } from "./coerceValue"; + +// @deprecated use coerceValue export { isValidJSValue } from "./isValidJSValue"; // Determine if AST values adhere to a GraphQL type. @@ -64,11 +86,17 @@ export { separateOperations } from "./separateOperations"; export { isEqualType, isTypeSubTypeOf, doTypesOverlap } from "./typeComparators"; // Asserts that a string is a valid GraphQL name -export { assertValidName } from "./assertValidName"; +export { assertValidName, isValidNameError } from "./assertValidName"; // Compares two GraphQLSchemas and detects breaking changes. -export { findBreakingChanges } from "./findBreakingChanges"; -export { BreakingChange } from "./findBreakingChanges"; +export { + BreakingChangeType, + DangerousChangeType, + findBreakingChanges, + findDangerousChanges, + BreakingChange, + DangerousChange, +} from "./findBreakingChanges"; // Report all deprecated usage within a GraphQL document. export { findDeprecatedUsages } from "./findDeprecatedUsages"; diff --git a/types/graphql/utilities/introspectionFromSchema.d.ts b/types/graphql/utilities/introspectionFromSchema.d.ts new file mode 100644 index 0000000000..8733a35087 --- /dev/null +++ b/types/graphql/utilities/introspectionFromSchema.d.ts @@ -0,0 +1,13 @@ +import { GraphQLSchema } from "../type/schema"; +import { IntrospectionQuery, IntrospectionOptions } from "./introspectionQuery"; + +/** + * Build an IntrospectionQuery from a GraphQLSchema + * + * IntrospectionQuery is useful for utilities that care about type and field + * relationships, but do not need to traverse through those relationships. + * + * This is the inverse of buildClientSchema. The primary use case is outside + * of the server context, for instance when doing schema comparisons. + */ +export function introspectionFromSchema(schema: GraphQLSchema, options: IntrospectionOptions): IntrospectionQuery; diff --git a/types/graphql/utilities/introspectionQuery.d.ts b/types/graphql/utilities/introspectionQuery.d.ts index 10c3b0a200..750fe0d99c 100644 --- a/types/graphql/utilities/introspectionQuery.d.ts +++ b/types/graphql/utilities/introspectionQuery.d.ts @@ -1,110 +1,25 @@ -import { DirectiveLocationEnum } from "../type/directives"; +import { DirectiveLocationEnum } from "../language/directiveLocation"; -/* -query IntrospectionQuery { - __schema { - queryType { name } - mutationType { name } - subscriptionType { name } - types { - ...FullType - } - directives { - name - description - locations - args { - ...InputValue - } - } - } +export interface IntrospectionOptions { + // Whether to include descriptions in the introspection result. + // Default: true + descriptions: boolean; } -fragment FullType on __Type { - kind - name - description - fields(includeDeprecated: true) { - name - description - args { - ...InputValue - } - type { - ...TypeRef - } - isDeprecated - deprecationReason - } - inputFields { - ...InputValue - } - interfaces { - ...TypeRef - } - enumValues(includeDeprecated: true) { - name - description - isDeprecated - deprecationReason - } - possibleTypes { - ...TypeRef - } -} +export function getIntrospectionQuery(options?: IntrospectionOptions): string; -fragment InputValue on __InputValue { - name - description - type { ...TypeRef } - defaultValue -} - -fragment TypeRef on __Type { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - } - } - } - } - } - } - } -} -*/ export const introspectionQuery: string; export interface IntrospectionQuery { - __schema: IntrospectionSchema; + readonly __schema: IntrospectionSchema; } export interface IntrospectionSchema { - queryType: IntrospectionNamedTypeRef; - mutationType?: IntrospectionNamedTypeRef; - subscriptionType?: IntrospectionNamedTypeRef; - types: IntrospectionType[]; - directives: IntrospectionDirective[]; + readonly queryType: IntrospectionNamedTypeRef; + readonly mutationType: IntrospectionNamedTypeRef | void; + readonly subscriptionType: IntrospectionNamedTypeRef | void; + readonly types: ReadonlyArray; + readonly directives: ReadonlyArray; } export type IntrospectionType = @@ -115,92 +30,114 @@ export type IntrospectionType = | IntrospectionEnumType | IntrospectionInputObjectType; +export type IntrospectionOutputType = + | IntrospectionScalarType + | IntrospectionObjectType + | IntrospectionInterfaceType + | IntrospectionUnionType + | IntrospectionEnumType; + +export type IntrospectionInputType = IntrospectionScalarType | IntrospectionEnumType | IntrospectionInputObjectType; + export interface IntrospectionScalarType { - kind: "SCALAR"; - name: string; - description?: string; + readonly kind: "SCALAR"; + readonly name: string; + readonly description?: string | void; } export interface IntrospectionObjectType { - kind: "OBJECT"; - name: string; - description?: string; - fields: IntrospectionField[]; - interfaces: IntrospectionNamedTypeRef[]; + readonly kind: "OBJECT"; + readonly name: string; + readonly description?: string | void; + readonly fields: ReadonlyArray; + readonly interfaces: ReadonlyArray>; } export interface IntrospectionInterfaceType { - kind: "INTERFACE"; - name: string; - description?: string; - fields: IntrospectionField[]; - possibleTypes: IntrospectionNamedTypeRef[]; + readonly kind: "INTERFACE"; + readonly name: string; + readonly description?: string | void; + readonly fields: ReadonlyArray; + readonly possibleTypes: ReadonlyArray>; } export interface IntrospectionUnionType { - kind: "UNION"; - name: string; - description?: string; - possibleTypes: IntrospectionNamedTypeRef[]; + readonly kind: "UNION"; + readonly name: string; + readonly description?: string | void; + readonly possibleTypes: ReadonlyArray>; } export interface IntrospectionEnumType { - kind: "ENUM"; - name: string; - description?: string; - enumValues: IntrospectionEnumValue[]; + readonly kind: "ENUM"; + readonly name: string; + readonly description?: string | void; + readonly enumValues: ReadonlyArray; } export interface IntrospectionInputObjectType { - kind: "INPUT_OBJECT"; - name: string; - description?: string; - inputFields: IntrospectionInputValue[]; + readonly kind: "INPUT_OBJECT"; + readonly name: string; + readonly description?: string | void; + readonly inputFields: ReadonlyArray; } -export type IntrospectionTypeRef = IntrospectionNamedTypeRef | IntrospectionListTypeRef | IntrospectionNonNullTypeRef; - -export interface IntrospectionNamedTypeRef { - kind: string; - name: string; +export interface IntrospectionListTypeRef { + readonly kind: "LIST"; + readonly ofType: T; } -export interface IntrospectionListTypeRef { - kind: "LIST"; - ofType?: IntrospectionTypeRef; +export interface IntrospectionNonNullTypeRef { + readonly kind: "NON_NULL"; + readonly ofType: T; } -export interface IntrospectionNonNullTypeRef { - kind: "NON_NULL"; - ofType?: IntrospectionTypeRef; +export type IntrospectionTypeRef = + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef + | IntrospectionNonNullTypeRef | IntrospectionListTypeRef>; + +export type IntrospectionOutputTypeRef = + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef + | IntrospectionNonNullTypeRef | IntrospectionListTypeRef>; + +export type IntrospectionInputTypeRef = + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef + | IntrospectionNonNullTypeRef | IntrospectionListTypeRef>; + +export interface IntrospectionNamedTypeRef { + readonly kind: T["kind"]; + readonly name: string; } export interface IntrospectionField { - name: string; - description?: string; - args: IntrospectionInputValue[]; - type: IntrospectionTypeRef; - isDeprecated: boolean; - deprecationReason?: string; + readonly name: string; + readonly description?: string | void; + readonly args: ReadonlyArray; + readonly type: IntrospectionOutputTypeRef; + readonly isDeprecated: boolean; + readonly deprecationReason?: string | void; } export interface IntrospectionInputValue { - name: string; - description?: string; - type: IntrospectionTypeRef; - defaultValue?: string; + readonly name: string; + readonly description?: string | void; + readonly type: IntrospectionInputTypeRef; + readonly defaultValue?: string | void; } export interface IntrospectionEnumValue { - name: string; - description?: string; - isDeprecated: boolean; - deprecationReason?: string; + readonly name: string; + readonly description?: string | void; + readonly isDeprecated: boolean; + readonly deprecationReason?: string | void; } export interface IntrospectionDirective { - name: string; - description?: string; - locations: DirectiveLocationEnum[]; - args: IntrospectionInputValue[]; + readonly name: string; + readonly description?: string | void; + readonly locations: ReadonlyArray; + readonly args: ReadonlyArray; } diff --git a/types/graphql/utilities/isValidJSValue.d.ts b/types/graphql/utilities/isValidJSValue.d.ts index 557429c7f4..d45d104ffd 100644 --- a/types/graphql/utilities/isValidJSValue.d.ts +++ b/types/graphql/utilities/isValidJSValue.d.ts @@ -1,8 +1,6 @@ import { GraphQLInputType } from "../type/definition"; /** - * Given a JavaScript value and a GraphQL type, determine if the value will be - * accepted for that type. This is primarily useful for validating the - * runtime values of query variables. + * Deprecated. Use coerceValue() directly for richer information. */ export function isValidJSValue(value: any, type: GraphQLInputType): string[]; diff --git a/types/graphql/utilities/isValidLiteralValue.d.ts b/types/graphql/utilities/isValidLiteralValue.d.ts index bf54f6bb22..6a9275bce9 100644 --- a/types/graphql/utilities/isValidLiteralValue.d.ts +++ b/types/graphql/utilities/isValidLiteralValue.d.ts @@ -1,11 +1,10 @@ +import { GraphQLError } from "../error/GraphQLError"; import { ValueNode } from "../language/ast"; import { GraphQLInputType } from "../type/definition"; /** - * Utility for validators which determines if a value literal AST is valid given - * an input type. + * Utility which determines if a value literal node is valid for an input type. * - * Note that this only validates literal values, variables are assumed to - * provide values of the correct type. + * Deprecated. Rely on validation for documents containing literal values. */ -export function isValidLiteralValue(type: GraphQLInputType, valueNode: ValueNode): string[]; +export function isValidLiteralValue(type: GraphQLInputType, valueNode: ValueNode): ReadonlyArray; diff --git a/types/graphql/utilities/lexicographicSortSchema.d.ts b/types/graphql/utilities/lexicographicSortSchema.d.ts new file mode 100644 index 0000000000..24ec208bba --- /dev/null +++ b/types/graphql/utilities/lexicographicSortSchema.d.ts @@ -0,0 +1,6 @@ +import { GraphQLSchema } from "../type/schema"; + +/** + * Sort GraphQLSchema. + */ +export function lexicographicSortSchema(schema: GraphQLSchema): GraphQLSchema; diff --git a/types/graphql/utilities/schemaPrinter.d.ts b/types/graphql/utilities/schemaPrinter.d.ts index d49e6aee58..8e3aefe7fc 100644 --- a/types/graphql/utilities/schemaPrinter.d.ts +++ b/types/graphql/utilities/schemaPrinter.d.ts @@ -1,12 +1,19 @@ import { GraphQLSchema } from "../type/schema"; -import { GraphQLType } from "../type/definition"; +import { GraphQLType, GraphQLNamedType } from "../type/definition"; -export interface PrinterOptions { +export interface Options { commentDescriptions?: boolean; } -export function printSchema(schema: GraphQLSchema, options?: PrinterOptions): string; +/** + * Accepts options as a second argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * + */ +export function printSchema(schema: GraphQLSchema, options?: Options): string; -export function printIntrospectionSchema(schema: GraphQLSchema, options?: PrinterOptions): string; +export function printIntrospectionSchema(schema: GraphQLSchema, options?: Options): string; -export function printType(type: GraphQLType, options?: PrinterOptions): string; +export function printType(type: GraphQLNamedType, options?: Options): string; diff --git a/types/graphql/utilities/separateOperations.d.ts b/types/graphql/utilities/separateOperations.d.ts index 8269b22d75..6035084860 100644 --- a/types/graphql/utilities/separateOperations.d.ts +++ b/types/graphql/utilities/separateOperations.d.ts @@ -1,3 +1,9 @@ import { DocumentNode, OperationDefinitionNode } from "../language/ast"; -export function separateOperations(documentAST: DocumentNode): { [operationName: string]: DocumentNode }; +/** + * separateOperations accepts a single AST document which may contain many + * operations and fragments and returns a collection of AST documents each of + * which contains a single operation as well the fragment definitions it + * refers to. + */ +export function separateOperations(documentAST: DocumentNode): { [key: string]: DocumentNode }; diff --git a/types/graphql/utilities/typeFromAST.d.ts b/types/graphql/utilities/typeFromAST.d.ts index 79b7b24a38..f2adaa7762 100644 --- a/types/graphql/utilities/typeFromAST.d.ts +++ b/types/graphql/utilities/typeFromAST.d.ts @@ -1,5 +1,16 @@ -import { TypeNode } from "../language/ast"; -import { GraphQLType, GraphQLNullableType } from "../type/definition"; +import { TypeNode, NamedTypeNode, ListTypeNode, NonNullTypeNode } from "../language/ast"; +import { GraphQLType, GraphQLNullableType, GraphQLNamedType, GraphQLList, GraphQLNonNull } from "../type/definition"; import { GraphQLSchema } from "../type/schema"; -export function typeFromAST(schema: GraphQLSchema, typeNode: TypeNode): GraphQLType; +/** + * Given a Schema and an AST node describing a type, return a GraphQLType + * definition which applies to that type. For example, if provided the parsed + * AST node for `[User]`, a GraphQLList instance will be returned, containing + * the type called "User" found in the schema. If a type called "User" is not + * found in the schema, then undefined will be returned. + */ +export function typeFromAST(schema: GraphQLSchema, typeNode: NamedTypeNode): GraphQLNamedType | undefined; + +export function typeFromAST(schema: GraphQLSchema, typeNode: ListTypeNode): GraphQLList | undefined; + +export function typeFromAST(schema: GraphQLSchema, typeNode: NonNullTypeNode): GraphQLNonNull | undefined; diff --git a/types/graphql/utilities/valueFromAST.d.ts b/types/graphql/utilities/valueFromAST.d.ts index e0b06b0506..cd67108aad 100644 --- a/types/graphql/utilities/valueFromAST.d.ts +++ b/types/graphql/utilities/valueFromAST.d.ts @@ -1,10 +1,28 @@ import { GraphQLInputType } from "../type/definition"; import { ValueNode, VariableNode, ListValueNode, ObjectValueNode } from "../language/ast"; +/** + * Produces a JavaScript value given a GraphQL Value AST. + * + * A GraphQL type must be provided, which will be used to interpret different + * GraphQL Value literals. + * + * Returns `undefined` when the value could not be validly coerced according to + * the provided type. + * + * | GraphQL Value | JSON Value | + * | -------------------- | ------------- | + * | Input Object | Object | + * | List | Array | + * | Boolean | Boolean | + * | String | String | + * | Int / Float | Number | + * | Enum Value | Mixed | + * | NullValue | null | + * + */ export function valueFromAST( - valueNode: ValueNode, + valueNode: ValueNode | void, type: GraphQLInputType, - variables?: { - [key: string]: any; - } + variables?: { [key: string]: any } | void ): any; diff --git a/types/graphql/utilities/valueFromASTUntyped.d.ts b/types/graphql/utilities/valueFromASTUntyped.d.ts new file mode 100644 index 0000000000..98d3137694 --- /dev/null +++ b/types/graphql/utilities/valueFromASTUntyped.d.ts @@ -0,0 +1,19 @@ +import { ValueNode } from "../language/ast"; + +/** + * Produces a JavaScript value given a GraphQL Value AST. + * + * Unlike `valueFromAST()`, no type is provided. The resulting JavaScript value + * will reflect the provided GraphQL value AST. + * + * | GraphQL Value | JavaScript Value | + * | -------------------- | ---------------- | + * | Input Object | Object | + * | List | Array | + * | Boolean | Boolean | + * | String / Enum | String | + * | Int / Float | Number | + * | Null | null | + * + */ +export function valueFromASTUntyped(valueNode: ValueNode, variables?: { [key: string]: any } | void): any; From 2a02f2f7eeeb78a7131cd674902d20d4dde3fca6 Mon Sep 17 00:00:00 2001 From: Firede Date: Wed, 28 Mar 2018 00:52:32 +0800 Subject: [PATCH 0265/2153] update `graphql/graphql` -> `v0.13.2`. https://github.com/graphql/graphql-js/blob/v0.13.2/src/graphql.js --- types/graphql/graphql.d.ts | 43 +++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/types/graphql/graphql.d.ts b/types/graphql/graphql.d.ts index 386cdd9e1b..7282ea80f2 100644 --- a/types/graphql/graphql.d.ts +++ b/types/graphql/graphql.d.ts @@ -33,25 +33,40 @@ import { ExecutionResult } from "./execution/execute"; * If not provided, the default field resolver is used (which looks for a * value or method on the source value with the field's name). */ -export function graphql(args: { +export interface GraphQLArgs { schema: GraphQLSchema; - source: string | Source; + source: Source | string; rootValue?: any; contextValue?: any; - variableValues?: { - [key: string]: any; - }; - operationName?: string; - fieldResolver?: GraphQLFieldResolver; -}): Promise; + variableValues?: { [key: string]: any } | void; + operationName?: string | void; + fieldResolver?: GraphQLFieldResolver | void; +} + +export function graphql(args: GraphQLArgs): Promise; export function graphql( schema: GraphQLSchema, - source: string | Source, + source: Source | string, rootValue?: any, contextValue?: any, - variableValues?: { - [key: string]: any; - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver + variableValues?: { [key: string]: any } | void, + operationName?: string | void, + fieldResolver?: GraphQLFieldResolver | void ): Promise; + +/** + * The graphqlSync function also fulfills GraphQL operations by parsing, + * validating, and executing a GraphQL document along side a GraphQL schema. + * However, it guarantees to complete synchronously (or throw an error) assuming + * that all field resolvers are also synchronous. + */ +export function graphqlSync(args: GraphQLArgs): ExecutionResult; +export function graphqlSync( + schema: GraphQLSchema, + source: Source | string, + rootValue?: any, + contextValue?: any, + variableValues?: { [key: string]: any } | void, + operationName?: string | void, + fieldResolver?: GraphQLFieldResolver | void +): ExecutionResult; From 20b6406514e34d59f0b913973ef7725613d3224b Mon Sep 17 00:00:00 2001 From: nickp10 Date: Tue, 27 Mar 2018 11:23:23 -0600 Subject: [PATCH 0266/2153] Add types for the jwt-express package --- types/jwt-express/index.d.ts | 221 +++++++++++++++++++++++++ types/jwt-express/jwt-express-tests.ts | 54 ++++++ types/jwt-express/tsconfig.json | 24 +++ types/jwt-express/tslint.json | 1 + 4 files changed, 300 insertions(+) create mode 100644 types/jwt-express/index.d.ts create mode 100644 types/jwt-express/jwt-express-tests.ts create mode 100644 types/jwt-express/tsconfig.json create mode 100644 types/jwt-express/tslint.json diff --git a/types/jwt-express/index.d.ts b/types/jwt-express/index.d.ts new file mode 100644 index 0000000000..78e69c8a28 --- /dev/null +++ b/types/jwt-express/index.d.ts @@ -0,0 +1,221 @@ +// Type definitions for jwt-express 1.1 +// Project: https://github.com/AustP/jwt-express#readme +// Definitions by: Nick Paddock +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import express = require("express"); +import jsonwebtoken = require("jsonwebtoken"); + +declare global { + namespace Express { + interface Request { + jwt: JWT; + } + + interface JWT { + /** + * Indicates if the JWT is expired. valid will always be false if this is true. + */ + expired: boolean; + + /** + * The jwt-express options. + */ + options: JWTExpressOptions; + + /** + * The payload of the JWT (must be an object). jwt-express will add a stales key-value pair to the payload for stale. + */ + payload: any; + + /** + * The secret used to sign /verify the JWT. + */ + secret: string; + + /** + * Indicates if the JWT is stale. The default timeout before a JWT is considered stale is 15 minutes. + */ + stale: boolean; + + /** + * The signed token of the JWT. + */ + token: string; + + /** + * Indicates if this JWT is valid. This means that the payload hasn't been tampered with and that the JWT hasn't expired yet. + */ + valid: boolean; + + /** + * Resigns this JWT Objects's payload. + * + * @return this + */ + resign(): JWT; + + /** + * Calls the revoke function defined in the jwt.init() options with this JWT Object as the first parameter. + * + * @return this + */ + revoke(): JWT; + + /** + * Generates a signed token from the payload. + * + * @param payload The payload of the JWT (must be an object). + * @return this + */ + sign(payload: any): JWT; + + /** + * Stores this JWT in the cookie (if configured to use cookies). + * + * @param res The response in which to store the JWT. + * @return this + */ + store(res: express.Response): JWT; + + /** + * This function is called when the jwt is passed through JSON.stringify. + * We don't want the secret or options to be stringified. + * + * @return The JSON form of the object. + */ + toJSON(): any; + + /** + * Verify the token and load the info into this JWT. + * + * @param token The signed token to verify. + * @return this + */ + verify(token: string): JWT; + } + + interface JWTExpressOptions { + /** + * The name of the cookie (default: 'jwt-express') + */ + cookie?: string; + + /** + * Options to use when storing the cookie (default: {httpOnly: true}) + */ + cookieOptions?: express.CookieOptions; + + /** + * If true, will use cookies, otherwise will use the Authorization header (default: true) + */ + cookies?: boolean; + + /** + * Indicates if the JWT should be refreshed and stored every request (default: true) + */ + refresh?: boolean; + + /** + * The property of req to populate (default: 'jwt') + */ + reqProperty?: string; + + /** + * jwt.revoke() will call this function (default: function(jwt) {}) + */ + revoke?: (jwt: JWT) => void; + + /** + * Options to use when signing the JWT (default: {}) + */ + signOptions?: jsonwebtoken.SignOptions; + + /** + * Milliseconds when the jwt will go stale (default: 900000 (15 minutes)) + */ + stales?: number; + + /** + * Additional verification. Must return a boolean (default: function(jwt) {return true}) + */ + verify?: (jwt: JWT) => boolean; + + /** + * Options to use when verifying the JWT (default: {}) + */ + verifyOptions?: jsonwebtoken.VerifyOptions; + } + } +} + +export let options: Express.JWTExpressOptions; + +/** + * Returns a middleware function that ensures a JWT is valid and fresh. Useful to protect + * sensitive actions from CSRF. This method will trigger error handling if the JWT is not active. + * + * @return Express middleware + */ +export function active(): express.RequestHandler; + +/** + * If using cookies, this method will clear the current JWT out of the cookie. + * + * @return Express middleware + */ +export function clear(): express.RequestHandler; + +/** + * Returns a newly created / signed JWT Object from the payload. + * + * @param secret + * If secret is a string, that string will be used to verify / sign with. + * If secret is a function, that function will be called with the payload as its first parameter, + * and must return a string which will be used to verify / sign with. + * @param payload The payload of the JWT. + * @return JWT + */ +export function create(secret: string | ((payload: any) => string), payload: any): Express.JWT; + +/** + * The jwt.init() function returns a middleware function for Express so it must be called inside app.use(). + * It will automatically read in the JWT from either the cookie or the Authorization header (configured by you) + * and add a JWT object to the Request object (req). It will also add the jwt() method to the Response object (res) + * to create / store JWTs. jwt.init() must be called before any other jwt method. + * + * @param secret + * If secret is a string, that string will be used to verify / sign with. + * If secret is a function, that function will be called with the Express HTTP Request as its first parameter, + * and must return a string which will be used to verify / sign with. + * @param options The options of jwt-express. + * @return Express middleware + */ +export function init(secret: string | ((req: express.Request) => string), options?: Express.JWTExpressOptions): express.RequestHandler; + +/** + * Returns a middleware function that requires the payload to contain / match certain data. + * This method will trigger error handling if the JWT fails the requirement. + * + * @param key + * This is they key used to look up the value in the payload. + * If only this value is passed to jwt.require(), then the middleware function will check that the value is truthy. + * @param operator The operator to compare the information + * @param value The value to compare the payload data against + * @return Express middleware + */ +export function require(key: string, operator?: string, value?: any): express.RequestHandler; + +/** + * Returns a middleware function that ensures a JWT is valid. This method will trigger error handling if the JWT is not valid. + * + * @return Express middleware + */ +export function valid(): express.RequestHandler; + +export interface JWTExpressError extends Error { + name: string; + message: string; +} diff --git a/types/jwt-express/jwt-express-tests.ts b/types/jwt-express/jwt-express-tests.ts new file mode 100644 index 0000000000..c604dde550 --- /dev/null +++ b/types/jwt-express/jwt-express-tests.ts @@ -0,0 +1,54 @@ +import express = require("express"); +import jwt = require("jwt-express"); + +const app = express(); + +app.use(jwt.active()); +app.use(jwt.clear()); +let jwtObj = jwt.create("Secret", { }); +jwtObj = jwt.create((p) => "Secret", { }); +app.use(jwt.init("Secret")); +app.use(jwt.init(req => "Secret")); +app.use(jwt.init("Secret", { + cookie: "jwt-express", + cookieOptions: { + httpOnly: true + }, + cookies: true, + refresh: true, + reqProperty: "jwt", + revoke: (revokeJWT) => { jwtObj = revokeJWT; }, + signOptions: { + expiresIn: "1h" + }, + stales: 1000, + verify: (verifyJWT) => { jwtObj = verifyJWT; return true; }, + verifyOptions: { + ignoreExpiration: true + } +})); +app.use(jwt.require("key")); +app.use(jwt.require("key", "==", "value")); +app.use(jwt.valid()); + +let resObj: express.Response = {}; +app.use((err: jwt.JWTExpressError, req: express.Request, res: express.Response, next: express.NextFunction) => { + err.message.startsWith(""); + err.name.startsWith(""); + resObj = res; +}); + +jwtObj.expired.valueOf(); +app.use(jwt.init(req => "Secret", jwtObj.options)); +jwtObj.payload; +jwtObj.secret.startsWith(""); +jwtObj.stale.valueOf(); +jwtObj.token.startsWith(""); +jwtObj.valid.valueOf(); + +jwtObj = jwtObj.resign(); +jwtObj = jwtObj.revoke(); +jwtObj = jwtObj.sign(jwtObj.payload); +jwtObj = jwtObj.store(resObj); +jwtObj = jwtObj.verify(jwtObj.token); +jwtObj.toJSON(); diff --git a/types/jwt-express/tsconfig.json b/types/jwt-express/tsconfig.json new file mode 100644 index 0000000000..293e5e4548 --- /dev/null +++ b/types/jwt-express/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jwt-express-tests.ts" + ] +} diff --git a/types/jwt-express/tslint.json b/types/jwt-express/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jwt-express/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 06163d88898bbed112af9d288806a1486230ba42 Mon Sep 17 00:00:00 2001 From: nickp10 Date: Tue, 27 Mar 2018 11:34:37 -0600 Subject: [PATCH 0267/2153] Fix the TypeScript version to match express --- types/jwt-express/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/jwt-express/index.d.ts b/types/jwt-express/index.d.ts index 78e69c8a28..dcb579e804 100644 --- a/types/jwt-express/index.d.ts +++ b/types/jwt-express/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/AustP/jwt-express#readme // Definitions by: Nick Paddock // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// From ac7ab1c5c357cfd4c20d7450ebc637dc0ee896dd Mon Sep 17 00:00:00 2001 From: Scott Davis Date: Tue, 27 Mar 2018 10:49:50 -0700 Subject: [PATCH 0268/2153] Types for eventsource --- types/eventsource/eventsource-tests.ts | 15 ++++++++ types/eventsource/index.d.ts | 35 +++++++++++++++++++ .../lib/eventsource-polyfill/index.d.ts | 29 +++++++++++++++ types/eventsource/tsconfig.json | 25 +++++++++++++ types/eventsource/tslint.json | 1 + 5 files changed, 105 insertions(+) create mode 100644 types/eventsource/eventsource-tests.ts create mode 100644 types/eventsource/index.d.ts create mode 100644 types/eventsource/lib/eventsource-polyfill/index.d.ts create mode 100644 types/eventsource/tsconfig.json create mode 100644 types/eventsource/tslint.json diff --git a/types/eventsource/eventsource-tests.ts b/types/eventsource/eventsource-tests.ts new file mode 100644 index 0000000000..b476e112a8 --- /dev/null +++ b/types/eventsource/eventsource-tests.ts @@ -0,0 +1,15 @@ +import * as EventSource from "eventsource"; + +const eventSource = new EventSource("http://foobar"); +eventSource.onmessage = (x: any) => {}; +eventSource.onerror = (x: any) => {}; +eventSource.onopen = (x: any) => {}; +eventSource.close(); + +import * as EventSourcePolyfill from "eventsource/lib/eventsource-polyfill"; + +const eventSourcePolyfill = new EventSourcePolyfill("http://foobar"); +eventSourcePolyfill.onmessage = (x: any) => {}; +eventSourcePolyfill.onerror = (x: any) => {}; +eventSourcePolyfill.onopen = (x: any) => {}; +eventSourcePolyfill.close(); diff --git a/types/eventsource/index.d.ts b/types/eventsource/index.d.ts new file mode 100644 index 0000000000..3620b6116f --- /dev/null +++ b/types/eventsource/index.d.ts @@ -0,0 +1,35 @@ +// Type definitions for eventsource 1.0 +// Project: http://github.com/EventSource/eventsource +// Definitions by: Scott Lee Davis +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +declare class EventSource { + constructor(url: string, eventSourceInitDict?: EventSource.EventSourceInitDict); + + static CLOSED: EventSource.ReadyState; + static CONNECTING: EventSource.ReadyState; + static OPEN: EventSource.ReadyState; + + url: string; + readyState: EventSource.ReadyState; + onopen: EventListener; + onmessage: EventListener; + onerror: EventListener; + close(): void; +} + +declare namespace EventSource { + enum ReadyState {CONNECTING = 0, OPEN = 1, CLOSED = 2} + + interface EventSourceInitDict { + withCredentials?: boolean; + headers?: object; + proxy?: string; + https?: object; + rejectUnauthorized?: boolean; + } +} + +export = EventSource; +export as namespace EventSource; diff --git a/types/eventsource/lib/eventsource-polyfill/index.d.ts b/types/eventsource/lib/eventsource-polyfill/index.d.ts new file mode 100644 index 0000000000..6246355dfe --- /dev/null +++ b/types/eventsource/lib/eventsource-polyfill/index.d.ts @@ -0,0 +1,29 @@ +declare class EventSource { + constructor(url: string, eventSourceInitDict?: EventSource.EventSourceInitDict); + + static CLOSED: EventSource.ReadyState; + static CONNECTING: EventSource.ReadyState; + static OPEN: EventSource.ReadyState; + + url: string; + readyState: EventSource.ReadyState; + onopen: EventListener; + onmessage: EventListener; + onerror: EventListener; + close(): void; +} + +declare namespace EventSource { + enum ReadyState {CONNECTING = 0, OPEN = 1, CLOSED = 2} + + interface EventSourceInitDict { + withCredentials?: boolean; + headers?: object; + proxy?: string; + https?: object; + rejectUnauthorized?: boolean; + } +} + +export = EventSource; +export as namespace EventSource; diff --git a/types/eventsource/tsconfig.json b/types/eventsource/tsconfig.json new file mode 100644 index 0000000000..440f5427c3 --- /dev/null +++ b/types/eventsource/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": false, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "eventsource-tests.ts", + "lib/eventsource-polyfill/index.d.ts" + ] +} diff --git a/types/eventsource/tslint.json b/types/eventsource/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/eventsource/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From f8543da289e25dc8568714f9e8c6c747bb539157 Mon Sep 17 00:00:00 2001 From: Michael Zlatkovsky Date: Tue, 27 Mar 2018 10:58:20 -0700 Subject: [PATCH 0269/2153] Add placeholder comment markers for ease of tooling --- types/office-js/index.d.ts | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 3b1173505d..3e8fa0d012 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -8,6 +8,11 @@ office-js Copyright (c) Microsoft Corporation */ + +//////////////////////////////////////////////////////////////// +//////////////////// Begin Office namespace //////////////////// +//////////////////////////////////////////////////////////////// + declare namespace Office { export var context: Context; /** @@ -1548,6 +1553,12 @@ declare namespace Office { } +//////////////////////////////////////////////////////////////// +///////////////////// End Office namespace ///////////////////// +//////////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////// @@ -2886,6 +2897,18 @@ declare namespace OfficeExtension { } +//////////////////////////////////////////////////////////////// +///////////////// End OfficeExtension runtime ////////////////// +//////////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////////// +////////////////////// Begin OfficeCore //////////////////////// +//////////////////////////////////////////////////////////////// + declare namespace OfficeCore { /** @@ -2960,7 +2983,7 @@ declare namespace OfficeCore { //////////////////////////////////////////////////////////////// -///////////////// End OfficeExtension runtime ////////////////// +/////////////////////// End OfficeCore ///////////////////////// //////////////////////////////////////////////////////////////// @@ -22317,6 +22340,10 @@ declare namespace OneNote { +//////////////////////////////////////////////////////////////// + + + //////////////////////////////////////////////////////////////// /////////////////////// Begin Visio APIs /////////////////////// //////////////////////////////////////////////////////////////// From 30bb434d2f8d2e13631d7f9b044b9de26b9e55d2 Mon Sep 17 00:00:00 2001 From: Scott Davis Date: Tue, 27 Mar 2018 11:00:49 -0700 Subject: [PATCH 0270/2153] configured tslint up to spec. --- types/eventsource/tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/eventsource/tsconfig.json b/types/eventsource/tsconfig.json index 440f5427c3..4a714cf00a 100644 --- a/types/eventsource/tsconfig.json +++ b/types/eventsource/tsconfig.json @@ -6,8 +6,8 @@ "dom" ], "noImplicitAny": true, - "noImplicitThis": false, - "strictNullChecks": false, + "noImplicitThis": true, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ From a3021f80409f7f797bb32fa6f613e9da81dfd9f5 Mon Sep 17 00:00:00 2001 From: Firede Date: Wed, 28 Mar 2018 02:01:32 +0800 Subject: [PATCH 0271/2153] update `graphql/validation/*` -> `v0.13.2`. https://github.com/graphql/graphql-js/tree/v0.13.2/src/validation --- .../graphql/validation/ValidationContext.d.ts | 63 +++++++++++++++ types/graphql/validation/index.d.ts | 18 +++-- .../rules/ArgumentsOfCorrectType.d.ts | 9 --- .../rules/DefaultValuesOfCorrectType.d.ts | 9 --- .../rules/ExecutableDefinitions.d.ts | 12 +++ .../validation/rules/FieldsOnCorrectType.d.ts | 5 +- .../rules/FragmentsOnCompositeTypes.d.ts | 10 ++- .../validation/rules/KnownArgumentNames.d.ts | 18 ++++- .../validation/rules/KnownDirectives.d.ts | 9 ++- .../validation/rules/KnownFragmentNames.d.ts | 7 +- .../validation/rules/KnownTypeNames.d.ts | 7 +- .../rules/LoneAnonymousOperation.d.ts | 7 +- .../validation/rules/NoFragmentCycles.d.ts | 7 +- .../rules/NoUndefinedVariables.d.ts | 7 +- .../validation/rules/NoUnusedFragments.d.ts | 7 +- .../validation/rules/NoUnusedVariables.d.ts | 7 +- .../rules/OverlappingFieldsCanBeMerged.d.ts | 13 ++- .../rules/PossibleFragmentSpreads.d.ts | 10 ++- .../rules/ProvidedNonNullArguments.d.ts | 10 ++- .../graphql/validation/rules/ScalarLeafs.d.ts | 10 ++- .../rules/SingleFieldSubscriptions.d.ts | 7 +- .../validation/rules/UniqueArgumentNames.d.ts | 7 +- .../rules/UniqueDirectivesPerLocation.d.ts | 7 +- .../validation/rules/UniqueFragmentNames.d.ts | 7 +- .../rules/UniqueInputFieldNames.d.ts | 7 +- .../rules/UniqueOperationNames.d.ts | 7 +- .../validation/rules/UniqueVariableNames.d.ts | 7 +- .../validation/rules/ValuesOfCorrectType.d.ts | 16 ++++ .../rules/VariablesAreInputTypes.d.ts | 7 +- .../rules/VariablesDefaultValueAllowed.d.ts | 13 +++ .../rules/VariablesInAllowedPosition.d.ts | 8 +- types/graphql/validation/specifiedRules.d.ts | 5 +- types/graphql/validation/validate.d.ts | 81 ++----------------- 33 files changed, 277 insertions(+), 147 deletions(-) create mode 100644 types/graphql/validation/ValidationContext.d.ts delete mode 100644 types/graphql/validation/rules/ArgumentsOfCorrectType.d.ts delete mode 100644 types/graphql/validation/rules/DefaultValuesOfCorrectType.d.ts create mode 100644 types/graphql/validation/rules/ExecutableDefinitions.d.ts create mode 100644 types/graphql/validation/rules/ValuesOfCorrectType.d.ts create mode 100644 types/graphql/validation/rules/VariablesDefaultValueAllowed.d.ts diff --git a/types/graphql/validation/ValidationContext.d.ts b/types/graphql/validation/ValidationContext.d.ts new file mode 100644 index 0000000000..0f8a4ea8f7 --- /dev/null +++ b/types/graphql/validation/ValidationContext.d.ts @@ -0,0 +1,63 @@ +import { GraphQLError } from "../error"; +import { + DocumentNode, + OperationDefinitionNode, + VariableNode, + SelectionSetNode, + FragmentSpreadNode, + FragmentDefinitionNode, +} from "../language/ast"; +import { GraphQLSchema } from "../type/schema"; +import { + GraphQLInputType, + GraphQLOutputType, + GraphQLCompositeType, + GraphQLField, + GraphQLArgument, +} from "../type/definition"; +import { GraphQLDirective } from "../type/directives"; +import { TypeInfo } from "../utilities/TypeInfo"; + +type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode; +type VariableUsage = { node: VariableNode; type: GraphQLInputType | void }; + +/** + * An instance of this class is passed as the "this" context to all validators, + * allowing access to commonly useful contextual information from within a + * validation rule. + */ +export default class ValidationContext { + constructor(schema: GraphQLSchema, ast: DocumentNode, typeInfo: TypeInfo); + + reportError(error: GraphQLError): undefined; + + getErrors(): ReadonlyArray; + + getSchema(): GraphQLSchema; + + getDocument(): DocumentNode; + + getFragment(name: string): FragmentDefinitionNode | void; + + getFragmentSpreads(node: SelectionSetNode): ReadonlyArray; + + getRecursivelyReferencedFragments(operation: OperationDefinitionNode): ReadonlyArray; + + getVariableUsages(node: NodeWithSelectionSet): ReadonlyArray; + + getRecursiveVariableUsages(operation: OperationDefinitionNode): ReadonlyArray; + + getType(): GraphQLOutputType | void; + + getParentType(): GraphQLCompositeType | void; + + getInputType(): GraphQLInputType | void; + + getParentInputType(): GraphQLInputType | void; + + getFieldDef(): GraphQLField | void; + + getDirective(): GraphQLDirective | void; + + getArgument(): GraphQLArgument | void; +} diff --git a/types/graphql/validation/index.d.ts b/types/graphql/validation/index.d.ts index 4353da53fa..911c592432 100644 --- a/types/graphql/validation/index.d.ts +++ b/types/graphql/validation/index.d.ts @@ -1,12 +1,10 @@ -export { validate, ValidationContext } from "./validate"; +export { validate } from "./validate"; + +import ValidationContext from "./ValidationContext"; +export { ValidationContext }; + export { specifiedRules } from "./specifiedRules"; -// Spec Section: "Argument Values Type Correctness" -export { ArgumentsOfCorrectType as ArgumentsOfCorrectTypeRule } from "./rules/ArgumentsOfCorrectType"; - -// Spec Section: "Variable Default Values Are Correctly Typed" -export { DefaultValuesOfCorrectType as DefaultValuesOfCorrectTypeRule } from "./rules/DefaultValuesOfCorrectType"; - // Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" export { FieldsOnCorrectType as FieldsOnCorrectTypeRule } from "./rules/FieldsOnCorrectType"; @@ -73,8 +71,14 @@ export { UniqueOperationNames as UniqueOperationNamesRule } from "./rules/Unique // Spec Section: "Variable Uniqueness" export { UniqueVariableNames as UniqueVariableNamesRule } from "./rules/UniqueVariableNames"; +// Spec Section: "Values Type Correctness" +export { ValuesOfCorrectType as ValuesOfCorrectTypeRule } from "./rules/ValuesOfCorrectType"; + // Spec Section: "Variables are Input Types" export { VariablesAreInputTypes as VariablesAreInputTypesRule } from "./rules/VariablesAreInputTypes"; +// Spec Section: "Variables Default Value Is Allowed" +export { VariablesDefaultValueAllowed as VariablesDefaultValueAllowedRule } from "./rules/VariablesDefaultValueAllowed"; + // Spec Section: "All Variable Usages Are Allowed" export { VariablesInAllowedPosition as VariablesInAllowedPositionRule } from "./rules/VariablesInAllowedPosition"; diff --git a/types/graphql/validation/rules/ArgumentsOfCorrectType.d.ts b/types/graphql/validation/rules/ArgumentsOfCorrectType.d.ts deleted file mode 100644 index 235db84162..0000000000 --- a/types/graphql/validation/rules/ArgumentsOfCorrectType.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ValidationContext } from "../index"; - -/** - * Argument values of correct type - * - * A GraphQL document is only valid if all field argument literal values are - * of the type expected by their position. - */ -export function ArgumentsOfCorrectType(context: ValidationContext): any; diff --git a/types/graphql/validation/rules/DefaultValuesOfCorrectType.d.ts b/types/graphql/validation/rules/DefaultValuesOfCorrectType.d.ts deleted file mode 100644 index b617538a74..0000000000 --- a/types/graphql/validation/rules/DefaultValuesOfCorrectType.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ValidationContext } from "../index"; - -/** - * Variable default values of correct type - * - * A GraphQL document is only valid if all variable default values are of the - * type expected by their definition. - */ -export function DefaultValuesOfCorrectType(context: ValidationContext): any; diff --git a/types/graphql/validation/rules/ExecutableDefinitions.d.ts b/types/graphql/validation/rules/ExecutableDefinitions.d.ts new file mode 100644 index 0000000000..423e0dcad2 --- /dev/null +++ b/types/graphql/validation/rules/ExecutableDefinitions.d.ts @@ -0,0 +1,12 @@ +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function nonExecutableDefinitionMessage(defName: string): string; + +/** + * Executable definitions + * + * A GraphQL document is only valid for execution if all definitions are either + * operation or fragment definitions. + */ +export function ExecutableDefinitions(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/FieldsOnCorrectType.d.ts b/types/graphql/validation/rules/FieldsOnCorrectType.d.ts index 247de1298c..c5c7f053c2 100644 --- a/types/graphql/validation/rules/FieldsOnCorrectType.d.ts +++ b/types/graphql/validation/rules/FieldsOnCorrectType.d.ts @@ -1,4 +1,5 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; /** * Fields on correct type @@ -6,4 +7,4 @@ import { ValidationContext } from "../index"; * A GraphQL document is only valid if all fields selected are defined by the * parent type, or are an allowed meta field such as __typename. */ -export function FieldsOnCorrectType(context: ValidationContext): any; +export function FieldsOnCorrectType(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/FragmentsOnCompositeTypes.d.ts b/types/graphql/validation/rules/FragmentsOnCompositeTypes.d.ts index 384f43beb3..7c760e331f 100644 --- a/types/graphql/validation/rules/FragmentsOnCompositeTypes.d.ts +++ b/types/graphql/validation/rules/FragmentsOnCompositeTypes.d.ts @@ -1,4 +1,10 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; +import { GraphQLType } from "../../type/definition"; + +export function inlineFragmentOnNonCompositeErrorMessage(type: GraphQLType): string; + +export function fragmentOnNonCompositeErrorMessage(fragName: string, type: GraphQLType): string; /** * Fragments on composite type @@ -7,4 +13,4 @@ import { ValidationContext } from "../index"; * can only be spread into a composite type (object, interface, or union), the * type condition must also be a composite type. */ -export function FragmentsOnCompositeTypes(context: ValidationContext): any; +export function FragmentsOnCompositeTypes(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/KnownArgumentNames.d.ts b/types/graphql/validation/rules/KnownArgumentNames.d.ts index bd56137311..9602c34c43 100644 --- a/types/graphql/validation/rules/KnownArgumentNames.d.ts +++ b/types/graphql/validation/rules/KnownArgumentNames.d.ts @@ -1,4 +1,18 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function unknownArgMessage( + argName: string, + fieldName: string, + typeName: string, + suggestedArgs: Array +): string; + +export function unknownDirectiveArgMessage( + argName: string, + directiveName: string, + suggestedArgs: Array +): string; /** * Known argument names @@ -6,4 +20,4 @@ import { ValidationContext } from "../index"; * A GraphQL field is only valid if all supplied arguments are defined by * that field. */ -export function KnownArgumentNames(context: ValidationContext): any; +export function KnownArgumentNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/KnownDirectives.d.ts b/types/graphql/validation/rules/KnownDirectives.d.ts index 40e58ce0c3..179e65b9f7 100644 --- a/types/graphql/validation/rules/KnownDirectives.d.ts +++ b/types/graphql/validation/rules/KnownDirectives.d.ts @@ -1,4 +1,9 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function unknownDirectiveMessage(directiveName: string): string; + +export function misplacedDirectiveMessage(directiveName: string, location: string): string; /** * Known directives @@ -6,4 +11,4 @@ import { ValidationContext } from "../index"; * A GraphQL document is only valid if all `@directives` are known by the * schema and legally positioned. */ -export function KnownDirectives(context: ValidationContext): any; +export function KnownDirectives(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/KnownFragmentNames.d.ts b/types/graphql/validation/rules/KnownFragmentNames.d.ts index c5fa899995..40405f67dd 100644 --- a/types/graphql/validation/rules/KnownFragmentNames.d.ts +++ b/types/graphql/validation/rules/KnownFragmentNames.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function unknownFragmentMessage(fragName: string): string; /** * Known fragment names @@ -6,4 +9,4 @@ import { ValidationContext } from "../index"; * A GraphQL document is only valid if all `...Fragment` fragment spreads refer * to fragments defined in the same document. */ -export function KnownFragmentNames(context: ValidationContext): any; +export function KnownFragmentNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/KnownTypeNames.d.ts b/types/graphql/validation/rules/KnownTypeNames.d.ts index ab8abce9d5..6bef3661f9 100644 --- a/types/graphql/validation/rules/KnownTypeNames.d.ts +++ b/types/graphql/validation/rules/KnownTypeNames.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function unknownTypeMessage(typeName: string, suggestedTypes: Array): string; /** * Known type names @@ -6,4 +9,4 @@ import { ValidationContext } from "../index"; * A GraphQL document is only valid if referenced types (specifically * variable definitions and fragment conditions) are defined by the type schema. */ -export function KnownTypeNames(context: ValidationContext): any; +export function KnownTypeNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/LoneAnonymousOperation.d.ts b/types/graphql/validation/rules/LoneAnonymousOperation.d.ts index f281df2bce..881814c4d2 100644 --- a/types/graphql/validation/rules/LoneAnonymousOperation.d.ts +++ b/types/graphql/validation/rules/LoneAnonymousOperation.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function anonOperationNotAloneMessage(): string; /** * Lone anonymous operation @@ -6,4 +9,4 @@ import { ValidationContext } from "../index"; * A GraphQL document is only valid if when it contains an anonymous operation * (the query short-hand) that it contains only that one operation definition. */ -export function LoneAnonymousOperation(context: ValidationContext): any; +export function LoneAnonymousOperation(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/NoFragmentCycles.d.ts b/types/graphql/validation/rules/NoFragmentCycles.d.ts index 4cce233cd5..f119c5a487 100644 --- a/types/graphql/validation/rules/NoFragmentCycles.d.ts +++ b/types/graphql/validation/rules/NoFragmentCycles.d.ts @@ -1,3 +1,6 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; -export function NoFragmentCycles(context: ValidationContext): any; +export function cycleErrorMessage(fragName: string, spreadNames: Array): string; + +export function NoFragmentCycles(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/NoUndefinedVariables.d.ts b/types/graphql/validation/rules/NoUndefinedVariables.d.ts index 418e3cf2b5..611ad01a9b 100644 --- a/types/graphql/validation/rules/NoUndefinedVariables.d.ts +++ b/types/graphql/validation/rules/NoUndefinedVariables.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function undefinedVarMessage(varName: string, opName: string | void): string; /** * No undefined variables @@ -6,4 +9,4 @@ import { ValidationContext } from "../index"; * A GraphQL operation is only valid if all variables encountered, both directly * and via fragment spreads, are defined by that operation. */ -export function NoUndefinedVariables(context: ValidationContext): any; +export function NoUndefinedVariables(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/NoUnusedFragments.d.ts b/types/graphql/validation/rules/NoUnusedFragments.d.ts index 7a099e66be..6f757c16c2 100644 --- a/types/graphql/validation/rules/NoUnusedFragments.d.ts +++ b/types/graphql/validation/rules/NoUnusedFragments.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function unusedFragMessage(fragName: string): string; /** * No unused fragments @@ -6,4 +9,4 @@ import { ValidationContext } from "../index"; * A GraphQL document is only valid if all fragment definitions are spread * within operations, or spread within other fragments spread within operations. */ -export function NoUnusedFragments(context: ValidationContext): any; +export function NoUnusedFragments(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/NoUnusedVariables.d.ts b/types/graphql/validation/rules/NoUnusedVariables.d.ts index 53692ed494..10282cdacd 100644 --- a/types/graphql/validation/rules/NoUnusedVariables.d.ts +++ b/types/graphql/validation/rules/NoUnusedVariables.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function unusedVariableMessage(varName: string, opName: string | void): string; /** * No unused variables @@ -6,4 +9,4 @@ import { ValidationContext } from "../index"; * A GraphQL operation is only valid if all variables defined by an operation * are used, either directly or within a spread fragment. */ -export function NoUnusedVariables(context: ValidationContext): any; +export function NoUnusedVariables(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/OverlappingFieldsCanBeMerged.d.ts b/types/graphql/validation/rules/OverlappingFieldsCanBeMerged.d.ts index 302617386b..1dfa62a089 100644 --- a/types/graphql/validation/rules/OverlappingFieldsCanBeMerged.d.ts +++ b/types/graphql/validation/rules/OverlappingFieldsCanBeMerged.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function fieldsConflictMessage(responseName: string, reason: ConflictReasonMessage): string; /** * Overlapping fields can be merged @@ -7,4 +10,10 @@ import { ValidationContext } from "../index"; * fragments) either correspond to distinct response names or can be merged * without ambiguity. */ -export function OverlappingFieldsCanBeMerged(context: ValidationContext): any; +export function OverlappingFieldsCanBeMerged(context: ValidationContext): ASTVisitor; + +// Field name and reason. +type ConflictReason = [string, string]; + +// Reason is a string, or a nested list of conflicts. +type ConflictReasonMessage = string | Array; diff --git a/types/graphql/validation/rules/PossibleFragmentSpreads.d.ts b/types/graphql/validation/rules/PossibleFragmentSpreads.d.ts index e9e10aca14..f318cb189e 100644 --- a/types/graphql/validation/rules/PossibleFragmentSpreads.d.ts +++ b/types/graphql/validation/rules/PossibleFragmentSpreads.d.ts @@ -1,4 +1,10 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; +import { GraphQLType } from "../../type/definition"; + +export function typeIncompatibleSpreadMessage(fragName: string, parentType: GraphQLType, fragType: GraphQLType): string; + +export function typeIncompatibleAnonSpreadMessage(parentType: GraphQLType, fragType: GraphQLType): string; /** * Possible fragment spread @@ -7,4 +13,4 @@ import { ValidationContext } from "../index"; * be true: if there is a non-empty intersection of the possible parent types, * and possible types which pass the type condition. */ -export function PossibleFragmentSpreads(context: ValidationContext): any; +export function PossibleFragmentSpreads(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/ProvidedNonNullArguments.d.ts b/types/graphql/validation/rules/ProvidedNonNullArguments.d.ts index 291a3ab5bc..e442b47f83 100644 --- a/types/graphql/validation/rules/ProvidedNonNullArguments.d.ts +++ b/types/graphql/validation/rules/ProvidedNonNullArguments.d.ts @@ -1,4 +1,10 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; +import { GraphQLType } from "../../type/definition"; + +export function missingFieldArgMessage(fieldName: string, argName: string, type: GraphQLType): string; + +export function missingDirectiveArgMessage(directiveName: string, argName: string, type: GraphQLType): string; /** * Provided required arguments @@ -6,4 +12,4 @@ import { ValidationContext } from "../index"; * A field or directive is only valid if all required (non-null) field arguments * have been provided. */ -export function ProvidedNonNullArguments(context: ValidationContext): any; +export function ProvidedNonNullArguments(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/ScalarLeafs.d.ts b/types/graphql/validation/rules/ScalarLeafs.d.ts index 8505cc2512..5bbf85043a 100644 --- a/types/graphql/validation/rules/ScalarLeafs.d.ts +++ b/types/graphql/validation/rules/ScalarLeafs.d.ts @@ -1,4 +1,10 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; +import { GraphQLType } from "../../type/definition"; + +export function noSubselectionAllowedMessage(fieldName: string, type: GraphQLType): string; + +export function requiredSubselectionMessage(fieldName: string, type: GraphQLType): string; /** * Scalar leafs @@ -6,4 +12,4 @@ import { ValidationContext } from "../index"; * A GraphQL document is valid only if all leaf fields (fields without * sub selections) are of scalar or enum types. */ -export function ScalarLeafs(context: ValidationContext): any; +export function ScalarLeafs(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/SingleFieldSubscriptions.d.ts b/types/graphql/validation/rules/SingleFieldSubscriptions.d.ts index d6f8fa2c6b..fef0869710 100644 --- a/types/graphql/validation/rules/SingleFieldSubscriptions.d.ts +++ b/types/graphql/validation/rules/SingleFieldSubscriptions.d.ts @@ -1,8 +1,11 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function singleFieldOnlyMessage(name: string | void): string; /** * Subscriptions must only include one field. * * A GraphQL subscription is valid only if it contains a single root field. */ -export function SingleFieldSubscriptions(context: ValidationContext): any; +export function SingleFieldSubscriptions(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/UniqueArgumentNames.d.ts b/types/graphql/validation/rules/UniqueArgumentNames.d.ts index f4cc750b86..47a59c3362 100644 --- a/types/graphql/validation/rules/UniqueArgumentNames.d.ts +++ b/types/graphql/validation/rules/UniqueArgumentNames.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function duplicateArgMessage(argName: string): string; /** * Unique argument names @@ -6,4 +9,4 @@ import { ValidationContext } from "../index"; * A GraphQL field or directive is only valid if all supplied arguments are * uniquely named. */ -export function UniqueArgumentNames(context: ValidationContext): any; +export function UniqueArgumentNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/UniqueDirectivesPerLocation.d.ts b/types/graphql/validation/rules/UniqueDirectivesPerLocation.d.ts index 80d4a252c6..f3d6327c23 100644 --- a/types/graphql/validation/rules/UniqueDirectivesPerLocation.d.ts +++ b/types/graphql/validation/rules/UniqueDirectivesPerLocation.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function duplicateDirectiveMessage(directiveName: string): string; /** * Unique directive names per location @@ -6,4 +9,4 @@ import { ValidationContext } from "../index"; * A GraphQL document is only valid if all directives at a given location * are uniquely named. */ -export function UniqueDirectivesPerLocation(context: ValidationContext): any; +export function UniqueDirectivesPerLocation(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/UniqueFragmentNames.d.ts b/types/graphql/validation/rules/UniqueFragmentNames.d.ts index 525befc0a9..9a2554200c 100644 --- a/types/graphql/validation/rules/UniqueFragmentNames.d.ts +++ b/types/graphql/validation/rules/UniqueFragmentNames.d.ts @@ -1,8 +1,11 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function duplicateFragmentNameMessage(fragName: string): string; /** * Unique fragment names * * A GraphQL document is only valid if all defined fragments have unique names. */ -export function UniqueFragmentNames(context: ValidationContext): any; +export function UniqueFragmentNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/UniqueInputFieldNames.d.ts b/types/graphql/validation/rules/UniqueInputFieldNames.d.ts index f81fb25e5c..34d5b9845a 100644 --- a/types/graphql/validation/rules/UniqueInputFieldNames.d.ts +++ b/types/graphql/validation/rules/UniqueInputFieldNames.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function duplicateInputFieldMessage(fieldName: string): string; /** * Unique input field names @@ -6,4 +9,4 @@ import { ValidationContext } from "../index"; * A GraphQL input object value is only valid if all supplied fields are * uniquely named. */ -export function UniqueInputFieldNames(context: ValidationContext): any; +export function UniqueInputFieldNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/UniqueOperationNames.d.ts b/types/graphql/validation/rules/UniqueOperationNames.d.ts index 5080307d4b..221b1187c2 100644 --- a/types/graphql/validation/rules/UniqueOperationNames.d.ts +++ b/types/graphql/validation/rules/UniqueOperationNames.d.ts @@ -1,8 +1,11 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function duplicateOperationNameMessage(operationName: string): string; /** * Unique operation names * * A GraphQL document is only valid if all defined operations have unique names. */ -export function UniqueOperationNames(context: ValidationContext): any; +export function UniqueOperationNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/UniqueVariableNames.d.ts b/types/graphql/validation/rules/UniqueVariableNames.d.ts index a0a029d165..d0aaf0404e 100644 --- a/types/graphql/validation/rules/UniqueVariableNames.d.ts +++ b/types/graphql/validation/rules/UniqueVariableNames.d.ts @@ -1,8 +1,11 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function duplicateVariableMessage(variableName: string): string; /** * Unique variable names * * A GraphQL operation is only valid if all its variables are uniquely named. */ -export function UniqueVariableNames(context: ValidationContext): any; +export function UniqueVariableNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/ValuesOfCorrectType.d.ts b/types/graphql/validation/rules/ValuesOfCorrectType.d.ts new file mode 100644 index 0000000000..09314835ad --- /dev/null +++ b/types/graphql/validation/rules/ValuesOfCorrectType.d.ts @@ -0,0 +1,16 @@ +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function badValueMessage(typeName: string, valueName: string, message?: string): string; + +export function requiredFieldMessage(typeName: string, fieldName: string, fieldTypeName: string): string; + +export function unknownFieldMessage(typeName: string, fieldName: string, message?: string): string; + +/** + * Value literals of correct type + * + * A GraphQL document is only valid if all value literals are of the type + * expected at their position. + */ +export function ValuesOfCorrectType(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/VariablesAreInputTypes.d.ts b/types/graphql/validation/rules/VariablesAreInputTypes.d.ts index 79846a3073..32472e15fd 100644 --- a/types/graphql/validation/rules/VariablesAreInputTypes.d.ts +++ b/types/graphql/validation/rules/VariablesAreInputTypes.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function nonInputTypeOnVarMessage(variableName: string, typeName: string): string; /** * Variables are input types @@ -6,4 +9,4 @@ import { ValidationContext } from "../index"; * A GraphQL operation is only valid if all the variables it defines are of * input types (scalar, enum, or input object). */ -export function VariablesAreInputTypes(context: ValidationContext): any; +export function VariablesAreInputTypes(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/VariablesDefaultValueAllowed.d.ts b/types/graphql/validation/rules/VariablesDefaultValueAllowed.d.ts new file mode 100644 index 0000000000..1961eb645e --- /dev/null +++ b/types/graphql/validation/rules/VariablesDefaultValueAllowed.d.ts @@ -0,0 +1,13 @@ +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; +import { GraphQLType } from "../../type/definition"; + +export function defaultForRequiredVarMessage(varName: string, type: GraphQLType, guessType: GraphQLType): string; + +/** + * Variable's default value is allowed + * + * A GraphQL document is only valid if all variable default values are allowed + * due to a variable not being required. + */ +export function VariablesDefaultValueAllowed(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/VariablesInAllowedPosition.d.ts b/types/graphql/validation/rules/VariablesInAllowedPosition.d.ts index bd302a73b4..f21ed5c7fb 100644 --- a/types/graphql/validation/rules/VariablesInAllowedPosition.d.ts +++ b/types/graphql/validation/rules/VariablesInAllowedPosition.d.ts @@ -1,6 +1,10 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; +import { GraphQLType } from "../../type/definition"; + +export function badVarPosMessage(varName: string, varType: GraphQLType, expectedType: GraphQLType): string; /** * Variables passed to field arguments conform to type */ -export function VariablesInAllowedPosition(context: ValidationContext): any; +export function VariablesInAllowedPosition(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/specifiedRules.d.ts b/types/graphql/validation/specifiedRules.d.ts index 5afc1a09e5..eb69dc1b08 100644 --- a/types/graphql/validation/specifiedRules.d.ts +++ b/types/graphql/validation/specifiedRules.d.ts @@ -1,6 +1,9 @@ -import { ValidationContext } from "./validate"; // It needs to check. +import ValidationContext from "./ValidationContext"; /** * This set includes all validation rules defined by the GraphQL spec. + * + * The order of the rules in this list has been adjusted to lead to the + * most clear output when encountering multiple validation errors. */ export const specifiedRules: Array<(context: ValidationContext) => any>; diff --git a/types/graphql/validation/validate.d.ts b/types/graphql/validation/validate.d.ts index c60c3bf072..9a5092d258 100644 --- a/types/graphql/validation/validate.d.ts +++ b/types/graphql/validation/validate.d.ts @@ -1,23 +1,7 @@ import { GraphQLError } from "../error"; -import { - DocumentNode, - OperationDefinitionNode, - VariableNode, - SelectionSetNode, - FragmentSpreadNode, - FragmentDefinitionNode, -} from "../language/ast"; +import { DocumentNode } from "../language/ast"; import { GraphQLSchema } from "../type/schema"; -import { - GraphQLInputType, - GraphQLOutputType, - GraphQLCompositeType, - GraphQLField, - GraphQLArgument, -} from "../type/definition"; -import { GraphQLDirective } from "../type/directives"; import { TypeInfo } from "../utilities/TypeInfo"; -import { specifiedRules } from "./specifiedRules"; /** * Implements the "Validation" section of the spec. @@ -31,62 +15,13 @@ import { specifiedRules } from "./specifiedRules"; * Each validation rules is a function which returns a visitor * (see the language/visitor API). Visitor methods are expected to return * GraphQLErrors, or Arrays of GraphQLErrors when invalid. - */ -export function validate(schema: GraphQLSchema, ast: DocumentNode, rules?: any[]): GraphQLError[]; - -/** - * This uses a specialized visitor which runs multiple visitors in parallel, - * while maintaining the visitor skip and break API. * - * @internal + * Optionally a custom TypeInfo instance may be provided. If not provided, one + * will be created from the provided schema. */ -export function visitUsingRules( +export function validate( schema: GraphQLSchema, - typeInfo: TypeInfo, - documentAST: DocumentNode, - rules: any[] -): GraphQLError[]; - -export type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode; -export interface VariableUsage { - node: VariableNode; - type: GraphQLInputType; -} - -/** - * An instance of this class is passed as the "this" context to all validators, - * allowing access to commonly useful contextual information from within a - * validation rule. - */ -export class ValidationContext { - constructor(schema: GraphQLSchema, ast: DocumentNode, typeInfo: TypeInfo); - reportError(error: GraphQLError): void; - - getErrors(): GraphQLError[]; - - getSchema(): GraphQLSchema; - - getDocument(): DocumentNode; - - getFragment(name: string): FragmentDefinitionNode; - - getFragmentSpreads(node: SelectionSetNode): FragmentSpreadNode[]; - - getRecursivelyReferencedFragments(operation: OperationDefinitionNode): FragmentDefinitionNode[]; - - getVariableUsages(node: NodeWithSelectionSet): VariableUsage[]; - - getRecursiveVariableUsages(operation: OperationDefinitionNode): VariableUsage[]; - - getType(): GraphQLOutputType; - - getParentType(): GraphQLCompositeType; - - getInputType(): GraphQLInputType; - - getFieldDef(): GraphQLField; - - getDirective(): GraphQLDirective; - - getArgument(): GraphQLArgument; -} + ast: DocumentNode, + rules?: ReadonlyArray, + typeInfo?: TypeInfo +): ReadonlyArray; From fe4997e85f0369a748f9474807bcdbf35656cb26 Mon Sep 17 00:00:00 2001 From: Firede Date: Wed, 28 Mar 2018 02:26:25 +0800 Subject: [PATCH 0272/2153] update exports, bump version: 0.12 -> 0.13 --- types/graphql/index.d.ts | 262 ++++++++++++++++++- types/graphql/language/index.d.ts | 61 ++++- types/graphql/type/index.d.ts | 89 ++++++- types/graphql/validation/specifiedRules.d.ts | 81 ++++++ 4 files changed, 476 insertions(+), 17 deletions(-) diff --git a/types/graphql/index.d.ts b/types/graphql/index.d.ts index 017f006787..68e04d104d 100644 --- a/types/graphql/index.d.ts +++ b/types/graphql/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for graphql 0.12 +// Type definitions for graphql 0.13 // Project: https://www.npmjs.com/package/graphql // Definitions by: TonyYang // Caleb Meredith @@ -17,15 +17,221 @@ // TypeScript Version: 2.3 // The primary entry point into fulfilling a GraphQL request. -export { graphql } from "./graphql"; +export { graphql, graphqlSync, GraphQLArgs } from "./graphql"; // Create and operate on GraphQL type definitions and schema. -export * from "./type"; +export { + GraphQLSchema, + // Definitions + GraphQLScalarType, + GraphQLObjectType, + GraphQLInterfaceType, + GraphQLUnionType, + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLList, + GraphQLNonNull, + GraphQLDirective, + // "Enum" of Type Kinds + TypeKind, + // Scalars + specifiedScalarTypes, + GraphQLInt, + GraphQLFloat, + GraphQLString, + GraphQLBoolean, + GraphQLID, + // Built-in Directives defined by the Spec + specifiedDirectives, + GraphQLIncludeDirective, + GraphQLSkipDirective, + GraphQLDeprecatedDirective, + // Constant Deprecation Reason + DEFAULT_DEPRECATION_REASON, + // Meta-field definitions. + SchemaMetaFieldDef, + TypeMetaFieldDef, + TypeNameMetaFieldDef, + // GraphQL Types for introspection. + introspectionTypes, + __Schema, + __Directive, + __DirectiveLocation, + __Type, + __Field, + __InputValue, + __EnumValue, + __TypeKind, + // Predicates + isSchema, + isDirective, + isType, + isScalarType, + isObjectType, + isInterfaceType, + isUnionType, + isEnumType, + isInputObjectType, + isListType, + isNonNullType, + isInputType, + isOutputType, + isLeafType, + isCompositeType, + isAbstractType, + isWrappingType, + isNullableType, + isNamedType, + isSpecifiedScalarType, + isIntrospectionType, + isSpecifiedDirective, + // Assertions + assertType, + assertScalarType, + assertObjectType, + assertInterfaceType, + assertUnionType, + assertEnumType, + assertInputObjectType, + assertListType, + assertNonNullType, + assertInputType, + assertOutputType, + assertLeafType, + assertCompositeType, + assertAbstractType, + assertWrappingType, + assertNullableType, + assertNamedType, + // Un-modifiers + getNullableType, + getNamedType, + // Validate GraphQL schema. + validateSchema, + assertValidSchema, + // type + GraphQLType, + GraphQLInputType, + GraphQLOutputType, + GraphQLLeafType, + GraphQLCompositeType, + GraphQLAbstractType, + GraphQLWrappingType, + GraphQLNullableType, + GraphQLNamedType, + Thunk, + GraphQLSchemaConfig, + GraphQLArgument, + GraphQLArgumentConfig, + GraphQLEnumTypeConfig, + GraphQLEnumValue, + GraphQLEnumValueConfig, + GraphQLEnumValueConfigMap, + GraphQLField, + GraphQLFieldConfig, + GraphQLFieldConfigArgumentMap, + GraphQLFieldConfigMap, + GraphQLFieldMap, + GraphQLFieldResolver, + GraphQLInputField, + GraphQLInputFieldConfig, + GraphQLInputFieldConfigMap, + GraphQLInputFieldMap, + GraphQLInputObjectTypeConfig, + GraphQLInterfaceTypeConfig, + GraphQLIsTypeOfFn, + GraphQLObjectTypeConfig, + GraphQLResolveInfo, + ResponsePath, + GraphQLScalarTypeConfig, + GraphQLTypeResolver, + GraphQLUnionTypeConfig, + GraphQLDirectiveConfig, +} from "./type"; // Parse and operate on GraphQL language source files. -export * from "./language"; - -export * from "./subscription"; +export { + Source, + getLocation, + // Parse + parse, + parseValue, + parseType, + // Print + print, + // Visit + visit, + visitInParallel, + visitWithTypeInfo, + getVisitFn, + Kind, + TokenKind, + DirectiveLocation, + BREAK, + // type + Lexer, + ParseOptions, + SourceLocation, + // Visitor utilities + ASTVisitor, + Visitor, + VisitFn, + VisitorKeyMap, + // AST nodes + Location, + Token, + ASTNode, + ASTKindToNode, + NameNode, + DocumentNode, + DefinitionNode, + ExecutableDefinitionNode, + OperationDefinitionNode, + OperationTypeNode, + VariableDefinitionNode, + VariableNode, + SelectionSetNode, + SelectionNode, + FieldNode, + ArgumentNode, + FragmentSpreadNode, + InlineFragmentNode, + FragmentDefinitionNode, + ValueNode, + IntValueNode, + FloatValueNode, + StringValueNode, + BooleanValueNode, + NullValueNode, + EnumValueNode, + ListValueNode, + ObjectValueNode, + ObjectFieldNode, + DirectiveNode, + TypeNode, + NamedTypeNode, + ListTypeNode, + NonNullTypeNode, + TypeSystemDefinitionNode, + SchemaDefinitionNode, + OperationTypeDefinitionNode, + TypeDefinitionNode, + ScalarTypeDefinitionNode, + ObjectTypeDefinitionNode, + FieldDefinitionNode, + InputValueDefinitionNode, + InterfaceTypeDefinitionNode, + UnionTypeDefinitionNode, + EnumTypeDefinitionNode, + EnumValueDefinitionNode, + InputObjectTypeDefinitionNode, + TypeExtensionNode, + ObjectTypeExtensionNode, + DirectiveDefinitionNode, + KindEnum, + TokenKindEnum, + DirectiveLocationEnum, +} from "./language"; // Execute GraphQL queries. export { @@ -33,10 +239,13 @@ export { defaultFieldResolver, responsePathAsArray, getDirectiveValues, + // type ExecutionArgs, ExecutionResult, } from "./execution"; +export { subscribe, createSourceEventStream } from "./subscription"; + // Validate GraphQL queries. export { validate, @@ -44,8 +253,6 @@ export { // All validation rules in the GraphQL Specification. specifiedRules, // Individual validation rules. - ArgumentsOfCorrectTypeRule, - DefaultValuesOfCorrectTypeRule, FieldsOnCorrectTypeRule, FragmentsOnCompositeTypesRule, KnownArgumentNamesRule, @@ -68,44 +275,60 @@ export { UniqueInputFieldNamesRule, UniqueOperationNamesRule, UniqueVariableNamesRule, + ValuesOfCorrectTypeRule, VariablesAreInputTypesRule, + VariablesDefaultValueAllowedRule, VariablesInAllowedPositionRule, } from "./validation"; // Create and format GraphQL errors. -export { GraphQLError, formatError, GraphQLFormattedError, GraphQLErrorLocation } from "./error"; +export { GraphQLError, formatError, printError, GraphQLFormattedError } from "./error"; // Utilities for operating on GraphQL type schema and parsed sources. export { - // The GraphQL query recommended for a full schema introspection. + // Produce the GraphQL query recommended for a full schema introspection. + // Accepts optional IntrospectionOptions. + getIntrospectionQuery, + // Deprecated: use getIntrospectionQuery introspectionQuery, // Gets the target Operation from a Document getOperationAST, + // Convert a GraphQLSchema to an IntrospectionQuery + introspectionFromSchema, // Build a GraphQLSchema from an introspection result. buildClientSchema, // Build a GraphQLSchema from a parsed GraphQL Schema language AST. buildASTSchema, // Build a GraphQLSchema from a GraphQL schema language document. buildSchema, - // Get the description of an AST node + // Get the description from a schema AST node. getDescription, // Extends an existing GraphQLSchema from a parsed GraphQL Schema // language AST. extendSchema, + // Sort a GraphQLSchema. + lexicographicSortSchema, // Print a GraphQLSchema to GraphQL Schema language. printSchema, + // Prints the built-in introspection schema in the Schema Language + // format. + printIntrospectionSchema, // Print a GraphQLType to GraphQL Schema language. printType, // Create a GraphQLType from a GraphQL language AST. typeFromAST, - // Create a JavaScript value from a GraphQL language AST. + // Create a JavaScript value from a GraphQL language AST with a Type. valueFromAST, + // Create a JavaScript value from a GraphQL language AST without a Type. + valueFromASTUntyped, // Create a GraphQL language AST from a JavaScript value. astFromValue, // A helper to use within recursive-descent visitors which need to be aware of // the GraphQL type system. TypeInfo, - // Determine if JavaScript values adhere to a GraphQL type. + // Coerces a JavaScript value to a GraphQL type, or produces errors. + coerceValue, + // @deprecated use coerceValue isValidJSValue, // Determine if AST values adhere to a GraphQL type. isValidLiteralValue, @@ -119,22 +342,35 @@ export { doTypesOverlap, // Asserts a string is a valid GraphQL name. assertValidName, + // Determine if a string is a valid GraphQL name. + isValidNameError, // Compares two GraphQLSchemas and detects breaking changes. findBreakingChanges, + findDangerousChanges, + BreakingChangeType, + DangerousChangeType, // Report all deprecated usage within a GraphQL document. findDeprecatedUsages, + // type + BuildSchemaOptions, BreakingChange, + DangerousChange, + IntrospectionOptions, IntrospectionDirective, IntrospectionEnumType, IntrospectionEnumValue, IntrospectionField, IntrospectionInputObjectType, + IntrospectionInputType, + IntrospectionInputTypeRef, IntrospectionInputValue, IntrospectionInterfaceType, IntrospectionListTypeRef, IntrospectionNamedTypeRef, IntrospectionNonNullTypeRef, IntrospectionObjectType, + IntrospectionOutputType, + IntrospectionOutputTypeRef, IntrospectionQuery, IntrospectionScalarType, IntrospectionSchema, diff --git a/types/graphql/language/index.d.ts b/types/graphql/language/index.d.ts index d5e8f8004e..e36dcbbb91 100644 --- a/types/graphql/language/index.d.ts +++ b/types/graphql/language/index.d.ts @@ -1,7 +1,6 @@ -export * from "./ast"; -export { getLocation } from "./location"; +export { getLocation, SourceLocation } from "./location"; export { Kind, KindEnum } from "./kinds"; -export { createLexer, TokenKind, Lexer } from "./lexer"; +export { createLexer, TokenKind, Lexer, TokenKindEnum } from "./lexer"; export { parse, parseValue, parseType, ParseOptions } from "./parser"; export { print } from "./printer"; export { Source } from "./source"; @@ -11,9 +10,65 @@ export { visitWithTypeInfo, getVisitFn, BREAK, + // type ASTVisitor, Visitor, VisitFn, VisitorKeyMap, } from "./visitor"; + +export { + Location, + Token, + ASTNode, + ASTKindToNode, + // Each kind of AST node + NameNode, + DocumentNode, + DefinitionNode, + ExecutableDefinitionNode, + OperationDefinitionNode, + OperationTypeNode, + VariableDefinitionNode, + VariableNode, + SelectionSetNode, + SelectionNode, + FieldNode, + ArgumentNode, + FragmentSpreadNode, + InlineFragmentNode, + FragmentDefinitionNode, + ValueNode, + IntValueNode, + FloatValueNode, + StringValueNode, + BooleanValueNode, + NullValueNode, + EnumValueNode, + ListValueNode, + ObjectValueNode, + ObjectFieldNode, + DirectiveNode, + TypeNode, + NamedTypeNode, + ListTypeNode, + NonNullTypeNode, + TypeSystemDefinitionNode, + SchemaDefinitionNode, + OperationTypeDefinitionNode, + TypeDefinitionNode, + ScalarTypeDefinitionNode, + ObjectTypeDefinitionNode, + FieldDefinitionNode, + InputValueDefinitionNode, + InterfaceTypeDefinitionNode, + UnionTypeDefinitionNode, + EnumTypeDefinitionNode, + EnumValueDefinitionNode, + InputObjectTypeDefinitionNode, + TypeExtensionNode, + ObjectTypeExtensionNode, + DirectiveDefinitionNode, +} from "./ast"; + export { DirectiveLocation, DirectiveLocationEnum } from "./directiveLocation"; diff --git a/types/graphql/type/index.d.ts b/types/graphql/type/index.d.ts index 39c510fc95..c498f648e4 100644 --- a/types/graphql/type/index.d.ts +++ b/types/graphql/type/index.d.ts @@ -6,7 +6,93 @@ export { GraphQLSchemaConfig, } from "./schema"; -export * from "./definition"; +export { + // Predicates + isType, + isScalarType, + isObjectType, + isInterfaceType, + isUnionType, + isEnumType, + isInputObjectType, + isListType, + isNonNullType, + isInputType, + isOutputType, + isLeafType, + isCompositeType, + isAbstractType, + isWrappingType, + isNullableType, + isNamedType, + // Assertions + assertType, + assertScalarType, + assertObjectType, + assertInterfaceType, + assertUnionType, + assertEnumType, + assertInputObjectType, + assertListType, + assertNonNullType, + assertInputType, + assertOutputType, + assertLeafType, + assertCompositeType, + assertAbstractType, + assertWrappingType, + assertNullableType, + assertNamedType, + // Un-modifiers + getNullableType, + getNamedType, + // Definitions + GraphQLScalarType, + GraphQLObjectType, + GraphQLInterfaceType, + GraphQLUnionType, + GraphQLEnumType, + GraphQLInputObjectType, + // Type Wrappers + GraphQLList, + GraphQLNonNull, + // type + GraphQLType, + GraphQLInputType, + GraphQLOutputType, + GraphQLLeafType, + GraphQLCompositeType, + GraphQLAbstractType, + GraphQLWrappingType, + GraphQLNullableType, + GraphQLNamedType, + Thunk, + GraphQLArgument, + GraphQLArgumentConfig, + GraphQLEnumTypeConfig, + GraphQLEnumValue, + GraphQLEnumValueConfig, + GraphQLEnumValueConfigMap, + GraphQLField, + GraphQLFieldConfig, + GraphQLFieldConfigArgumentMap, + GraphQLFieldConfigMap, + GraphQLFieldMap, + GraphQLFieldResolver, + GraphQLInputField, + GraphQLInputFieldConfig, + GraphQLInputFieldConfigMap, + GraphQLInputFieldMap, + GraphQLInputObjectTypeConfig, + GraphQLInterfaceTypeConfig, + GraphQLIsTypeOfFn, + GraphQLObjectTypeConfig, + GraphQLResolveInfo, + ResponsePath, + GraphQLScalarTypeConfig, + GraphQLTypeResolver, + GraphQLUnionTypeConfig, +} from "./definition"; export { // Predicate @@ -21,6 +107,7 @@ export { GraphQLDeprecatedDirective, // Constant Deprecation Reason DEFAULT_DEPRECATION_REASON, + // type GraphQLDirectiveConfig, } from "./directives"; diff --git a/types/graphql/validation/specifiedRules.d.ts b/types/graphql/validation/specifiedRules.d.ts index eb69dc1b08..8e9815377f 100644 --- a/types/graphql/validation/specifiedRules.d.ts +++ b/types/graphql/validation/specifiedRules.d.ts @@ -1,3 +1,84 @@ +// Spec Section: "Executable Definitions" +import { ExecutableDefinitions } from "./rules/ExecutableDefinitions"; + +// Spec Section: "Operation Name Uniqueness" +import { UniqueOperationNames } from "./rules/UniqueOperationNames"; + +// Spec Section: "Lone Anonymous Operation" +import { LoneAnonymousOperation } from "./rules/LoneAnonymousOperation"; + +// Spec Section: "Subscriptions with Single Root Field" +import { SingleFieldSubscriptions } from "./rules/SingleFieldSubscriptions"; + +// Spec Section: "Fragment Spread Type Existence" +import { KnownTypeNames } from "./rules/KnownTypeNames"; + +// Spec Section: "Fragments on Composite Types" +import { FragmentsOnCompositeTypes } from "./rules/FragmentsOnCompositeTypes"; + +// Spec Section: "Variables are Input Types" +import { VariablesAreInputTypes } from "./rules/VariablesAreInputTypes"; + +// Spec Section: "Leaf Field Selections" +import { ScalarLeafs } from "./rules/ScalarLeafs"; + +// Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" +import { FieldsOnCorrectType } from "./rules/FieldsOnCorrectType"; + +// Spec Section: "Fragment Name Uniqueness" +import { UniqueFragmentNames } from "./rules/UniqueFragmentNames"; + +// Spec Section: "Fragment spread target defined" +import { KnownFragmentNames } from "./rules/KnownFragmentNames"; + +// Spec Section: "Fragments must be used" +import { NoUnusedFragments } from "./rules/NoUnusedFragments"; + +// Spec Section: "Fragment spread is possible" +import { PossibleFragmentSpreads } from "./rules/PossibleFragmentSpreads"; + +// Spec Section: "Fragments must not form cycles" +import { NoFragmentCycles } from "./rules/NoFragmentCycles"; + +// Spec Section: "Variable Uniqueness" +import { UniqueVariableNames } from "./rules/UniqueVariableNames"; + +// Spec Section: "All Variable Used Defined" +import { NoUndefinedVariables } from "./rules/NoUndefinedVariables"; + +// Spec Section: "All Variables Used" +import { NoUnusedVariables } from "./rules/NoUnusedVariables"; + +// Spec Section: "Directives Are Defined" +import { KnownDirectives } from "./rules/KnownDirectives"; + +// Spec Section: "Directives Are Unique Per Location" +import { UniqueDirectivesPerLocation } from "./rules/UniqueDirectivesPerLocation"; + +// Spec Section: "Argument Names" +import { KnownArgumentNames } from "./rules/KnownArgumentNames"; + +// Spec Section: "Argument Uniqueness" +import { UniqueArgumentNames } from "./rules/UniqueArgumentNames"; + +// Spec Section: "Value Type Correctness" +import { ValuesOfCorrectType } from "./rules/ValuesOfCorrectType"; + +// Spec Section: "Argument Optionality" +import { ProvidedNonNullArguments } from "./rules/ProvidedNonNullArguments"; + +// Spec Section: "Variables Default Value Is Allowed" +import { VariablesDefaultValueAllowed } from "./rules/VariablesDefaultValueAllowed"; + +// Spec Section: "All Variable Usages Are Allowed" +import { VariablesInAllowedPosition } from "./rules/VariablesInAllowedPosition"; + +// Spec Section: "Field Selection Merging" +import { OverlappingFieldsCanBeMerged } from "./rules/OverlappingFieldsCanBeMerged"; + +// Spec Section: "Input Object Field Uniqueness" +import { UniqueInputFieldNames } from "./rules/UniqueInputFieldNames"; + import ValidationContext from "./ValidationContext"; /** From d5cbb8d3cb0ac96269fff70c9174b820339e46e8 Mon Sep 17 00:00:00 2001 From: Mohsen Azimi Date: Tue, 27 Mar 2018 11:32:31 -0700 Subject: [PATCH 0273/2153] Add MultiHook and _pluginCompat to Tapable (#24527) * Fix Tapable types * .. * Clean up * Undo instance member change * Add constructor to Hookmap --- types/tapable/index.d.ts | 18 ++++++++++++++++++ types/tapable/tapable-tests.ts | 4 +++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/types/tapable/index.d.ts b/types/tapable/index.d.ts index c044a245ce..502b408e9e 100644 --- a/types/tapable/index.d.ts +++ b/types/tapable/index.d.ts @@ -9,6 +9,9 @@ export declare abstract class Tapable { [propName: string]: Tapable.Handler[] } + /** @deprecated Private internals. Do not use directly */ + _pluginCompat: Hook; + /** * @deprecated Tapable.plugin is deprecated. Use new API on `.hooks` instead * Register plugin(s) @@ -275,7 +278,9 @@ export class HookInterceptor { context: boolean; } +/** A HookMap is a helper class for a Map with Hooks */ export class HookMap { + constructor(fn: () => Hook); get: (key: any) => Hook | undefined; for: (key: any) => Hook; tap: (key: any, name: string | Tap, fn: (arg1: T1, arg2: T2, arg3: T3, ...args: any[]) => any) => void; @@ -287,3 +292,16 @@ export class HookMap { export class HookMapInterceptor { factory: (key: any, hook: Hook) => Hook; } + +/** + * A helper Hook-like class to redirect taps to multiple other hooks + * + * ``` + * const { MultiHook } = require("tapable"); + * + * this.hooks.allHooks = new MultiHook([this.hooks.hookA, this.hooks.hookB]); + * ``` + */ +export class MultiHook { + constructor(hooks: Hook[]) +} diff --git a/types/tapable/tapable-tests.ts b/types/tapable/tapable-tests.ts index 4d82e60a66..c78196c194 100644 --- a/types/tapable/tapable-tests.ts +++ b/types/tapable/tapable-tests.ts @@ -1,4 +1,4 @@ -import {Tapable} from "tapable"; +import {Tapable, MultiHook, SyncHook} from "tapable"; class DllPlugin { apply(compiler: Compiler) { @@ -43,3 +43,5 @@ compiler.applyPluginsAsyncWaterfall('doSomething', 'a', callback); compiler.applyPluginsParallel('doSomething', 'a', 'b'); compiler.applyPluginsParallelBailResult('doSomething', 'a', 'b'); compiler.applyPluginsParallelBailResult1('doSomething', 'a', callback); + +const multi = new MultiHook([new SyncHook(['hi'])]); From a5e131585fcf0439e55077703a957e026551d32e Mon Sep 17 00:00:00 2001 From: Scott Davis Date: Tue, 27 Mar 2018 12:40:49 -0700 Subject: [PATCH 0274/2153] Made changes as requested by sandersn --- types/eventsource/eventsource-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/eventsource/eventsource-tests.ts b/types/eventsource/eventsource-tests.ts index b476e112a8..d081e87e42 100644 --- a/types/eventsource/eventsource-tests.ts +++ b/types/eventsource/eventsource-tests.ts @@ -1,4 +1,4 @@ -import * as EventSource from "eventsource"; +import EventSource = require("eventsource"); const eventSource = new EventSource("http://foobar"); eventSource.onmessage = (x: any) => {}; @@ -6,7 +6,7 @@ eventSource.onerror = (x: any) => {}; eventSource.onopen = (x: any) => {}; eventSource.close(); -import * as EventSourcePolyfill from "eventsource/lib/eventsource-polyfill"; +import EventSourcePolyfill = require("eventsource/lib/eventsource-polyfill"); const eventSourcePolyfill = new EventSourcePolyfill("http://foobar"); eventSourcePolyfill.onmessage = (x: any) => {}; From 7c9424cf2433f8ac16a4031b270f1754cfcf2e52 Mon Sep 17 00:00:00 2001 From: Timur Amirov Date: Tue, 27 Mar 2018 22:20:29 +0200 Subject: [PATCH 0275/2153] curcuit-breaker-js: introduce @types/curcuit-breaker-js --- .../circuit-breaker-js-tests.ts | 12 ++++++ types/circuit-breaker-js/index.d.ts | 38 +++++++++++++++++++ types/circuit-breaker-js/tsconfig.json | 23 +++++++++++ types/circuit-breaker-js/tslint.json | 1 + 4 files changed, 74 insertions(+) create mode 100644 types/circuit-breaker-js/circuit-breaker-js-tests.ts create mode 100644 types/circuit-breaker-js/index.d.ts create mode 100644 types/circuit-breaker-js/tsconfig.json create mode 100644 types/circuit-breaker-js/tslint.json diff --git a/types/circuit-breaker-js/circuit-breaker-js-tests.ts b/types/circuit-breaker-js/circuit-breaker-js-tests.ts new file mode 100644 index 0000000000..1436e13e90 --- /dev/null +++ b/types/circuit-breaker-js/circuit-breaker-js-tests.ts @@ -0,0 +1,12 @@ +import CircuitBreaker = require('circuit-breaker-js'); + +const breaker = new CircuitBreaker(); +breaker.isOpen(); + +const options: CircuitBreaker.Options = {}; + +let status: number = CircuitBreaker.CLOSED; +status = CircuitBreaker.OPEN; + +breaker.forceOpen(); +breaker.forceClose(); diff --git a/types/circuit-breaker-js/index.d.ts b/types/circuit-breaker-js/index.d.ts new file mode 100644 index 0000000000..6fc58bd40d --- /dev/null +++ b/types/circuit-breaker-js/index.d.ts @@ -0,0 +1,38 @@ +// Type definitions for circuit-breaker-js 0.0 +// Project: http://yammer.github.io/circuit-breaker-js/ +// Definitions by: Timur Amirov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = CircuitBreaker; + +declare namespace CircuitBreaker { + interface Options { + windowDuration?: number; + numBuckets?: number; + timeoutDuration?: number; + errorThreshold?: number; + volumeThreshold?: number; + + onCircuitOpen?: (m: Metrics) => void; + onCircuitClose?: (m: Metrics) => void; + } + + interface Metrics { + totalCount: number; + errorCount: number; + errorPercentage: number; + } +} + +declare class CircuitBreaker { + static OPEN: 0; + static HALF_OPEN: 1; + static CLOSED: 2; + + constructor(options?: CircuitBreaker.Options); + run(command: () => void, fallback?: () => void): void; + forceClose(): void; + forceOpen(): void; + unforce(): void; + isOpen(): boolean; +} diff --git a/types/circuit-breaker-js/tsconfig.json b/types/circuit-breaker-js/tsconfig.json new file mode 100644 index 0000000000..67d9c57cc0 --- /dev/null +++ b/types/circuit-breaker-js/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "circuit-breaker-js-tests.ts" + ] +} diff --git a/types/circuit-breaker-js/tslint.json b/types/circuit-breaker-js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/circuit-breaker-js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 9ca4a519d10ec6ae6c48f6059e66bbdddd904bea Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 27 Mar 2018 13:43:37 -0700 Subject: [PATCH 0276/2153] yeoman-generator: Update required TypeScript version (#24567) --- types/yeoman-generator/index.d.ts | 2 +- types/yeoman-test/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/yeoman-generator/index.d.ts b/types/yeoman-generator/index.d.ts index fb5c1b881c..9db6a70946 100644 --- a/types/yeoman-generator/index.d.ts +++ b/types/yeoman-generator/index.d.ts @@ -4,7 +4,7 @@ // Jay Anslow // Ika // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 import { EventEmitter } from 'events'; import * as inquirer from 'inquirer'; diff --git a/types/yeoman-test/index.d.ts b/types/yeoman-test/index.d.ts index 7602d94a87..d6b2d50a09 100644 --- a/types/yeoman-test/index.d.ts +++ b/types/yeoman-test/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/yeoman/yeoman-test // Definitions by: Ika // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 import { EventEmitter } from 'events'; import Generator = require('yeoman-generator'); From a34abe5ba3a828d6e95d0c2d5a0b4f01d84bb10b Mon Sep 17 00:00:00 2001 From: nickp10 Date: Tue, 27 Mar 2018 14:46:19 -0600 Subject: [PATCH 0277/2153] Fix interface exports and add more tests --- types/jwt-express/index.d.ts | 270 ++++++++++++------------- types/jwt-express/jwt-express-tests.ts | 21 +- 2 files changed, 150 insertions(+), 141 deletions(-) diff --git a/types/jwt-express/index.d.ts b/types/jwt-express/index.d.ts index dcb579e804..7e33cc7e6b 100644 --- a/types/jwt-express/index.d.ts +++ b/types/jwt-express/index.d.ts @@ -9,150 +9,147 @@ import express = require("express"); import jsonwebtoken = require("jsonwebtoken"); -declare global { - namespace Express { - interface Request { - jwt: JWT; - } +export interface JWT { + /** + * Indicates if the JWT is expired. valid will always be false if this is true. + */ + expired: boolean; - interface JWT { - /** - * Indicates if the JWT is expired. valid will always be false if this is true. - */ - expired: boolean; + /** + * The jwt-express options. + */ + options: JWTExpressOptions; - /** - * The jwt-express options. - */ - options: JWTExpressOptions; + /** + * The payload of the JWT (must be an object). jwt-express will add a stales key-value pair to the payload for stale. + */ + payload: any; - /** - * The payload of the JWT (must be an object). jwt-express will add a stales key-value pair to the payload for stale. - */ - payload: any; + /** + * The secret used to sign /verify the JWT. + */ + secret: string; - /** - * The secret used to sign /verify the JWT. - */ - secret: string; + /** + * Indicates if the JWT is stale. The default timeout before a JWT is considered stale is 15 minutes. + */ + stale: boolean; - /** - * Indicates if the JWT is stale. The default timeout before a JWT is considered stale is 15 minutes. - */ - stale: boolean; + /** + * The signed token of the JWT. + */ + token: string; - /** - * The signed token of the JWT. - */ - token: string; + /** + * Indicates if this JWT is valid. This means that the payload hasn't been tampered with and that the JWT hasn't expired yet. + */ + valid: boolean; - /** - * Indicates if this JWT is valid. This means that the payload hasn't been tampered with and that the JWT hasn't expired yet. - */ - valid: boolean; + /** + * Resigns this JWT Objects's payload. + * + * @return this + */ + resign(): JWT; - /** - * Resigns this JWT Objects's payload. - * - * @return this - */ - resign(): JWT; + /** + * Calls the revoke function defined in the jwt.init() options with this JWT Object as the first parameter. + * + * @return this + */ + revoke(): JWT; - /** - * Calls the revoke function defined in the jwt.init() options with this JWT Object as the first parameter. - * - * @return this - */ - revoke(): JWT; + /** + * Generates a signed token from the payload. + * + * @param payload The payload of the JWT (must be an object). + * @return this + */ + sign(payload: any): JWT; - /** - * Generates a signed token from the payload. - * - * @param payload The payload of the JWT (must be an object). - * @return this - */ - sign(payload: any): JWT; + /** + * Stores this JWT in the cookie (if configured to use cookies). + * + * @param res The response in which to store the JWT. + * @return this + */ + store(res: express.Response): JWT; - /** - * Stores this JWT in the cookie (if configured to use cookies). - * - * @param res The response in which to store the JWT. - * @return this - */ - store(res: express.Response): JWT; + /** + * This function is called when the jwt is passed through JSON.stringify. + * We don't want the secret or options to be stringified. + * + * @return The JSON form of the object. + */ + toJSON(): any; - /** - * This function is called when the jwt is passed through JSON.stringify. - * We don't want the secret or options to be stringified. - * - * @return The JSON form of the object. - */ - toJSON(): any; - - /** - * Verify the token and load the info into this JWT. - * - * @param token The signed token to verify. - * @return this - */ - verify(token: string): JWT; - } - - interface JWTExpressOptions { - /** - * The name of the cookie (default: 'jwt-express') - */ - cookie?: string; - - /** - * Options to use when storing the cookie (default: {httpOnly: true}) - */ - cookieOptions?: express.CookieOptions; - - /** - * If true, will use cookies, otherwise will use the Authorization header (default: true) - */ - cookies?: boolean; - - /** - * Indicates if the JWT should be refreshed and stored every request (default: true) - */ - refresh?: boolean; - - /** - * The property of req to populate (default: 'jwt') - */ - reqProperty?: string; - - /** - * jwt.revoke() will call this function (default: function(jwt) {}) - */ - revoke?: (jwt: JWT) => void; - - /** - * Options to use when signing the JWT (default: {}) - */ - signOptions?: jsonwebtoken.SignOptions; - - /** - * Milliseconds when the jwt will go stale (default: 900000 (15 minutes)) - */ - stales?: number; - - /** - * Additional verification. Must return a boolean (default: function(jwt) {return true}) - */ - verify?: (jwt: JWT) => boolean; - - /** - * Options to use when verifying the JWT (default: {}) - */ - verifyOptions?: jsonwebtoken.VerifyOptions; - } - } + /** + * Verify the token and load the info into this JWT. + * + * @param token The signed token to verify. + * @return this + */ + verify(token: string): JWT; } -export let options: Express.JWTExpressOptions; +export interface JWTExpressOptions { + /** + * The name of the cookie (default: 'jwt-express') + */ + cookie?: string; + + /** + * Options to use when storing the cookie (default: {httpOnly: true}) + */ + cookieOptions?: express.CookieOptions; + + /** + * If true, will use cookies, otherwise will use the Authorization header (default: true) + */ + cookies?: boolean; + + /** + * Indicates if the JWT should be refreshed and stored every request (default: true) + */ + refresh?: boolean; + + /** + * The property of req to populate (default: 'jwt') + */ + reqProperty?: string; + + /** + * jwt.revoke() will call this function (default: function(jwt) {}) + */ + revoke?: (jwt: JWT) => void; + + /** + * Options to use when signing the JWT (default: {}) + */ + signOptions?: jsonwebtoken.SignOptions; + + /** + * Milliseconds when the jwt will go stale (default: 900000 (15 minutes)) + */ + stales?: number; + + /** + * Additional verification. Must return a boolean (default: function(jwt) {return true}) + */ + verify?: (jwt: JWT) => boolean; + + /** + * Options to use when verifying the JWT (default: {}) + */ + verifyOptions?: jsonwebtoken.VerifyOptions; +} + +export interface JWTExpressError extends Error { + name: string; + message: string; +} + +export let options: JWTExpressOptions; /** * Returns a middleware function that ensures a JWT is valid and fresh. Useful to protect @@ -179,7 +176,7 @@ export function clear(): express.RequestHandler; * @param payload The payload of the JWT. * @return JWT */ -export function create(secret: string | ((payload: any) => string), payload: any): Express.JWT; +export function create(secret: string | ((payload: any) => string), payload: any): JWT; /** * The jwt.init() function returns a middleware function for Express so it must be called inside app.use(). @@ -194,7 +191,7 @@ export function create(secret: string | ((payload: any) => string), payload: any * @param options The options of jwt-express. * @return Express middleware */ -export function init(secret: string | ((req: express.Request) => string), options?: Express.JWTExpressOptions): express.RequestHandler; +export function init(secret: string | ((req: express.Request) => string), options?: JWTExpressOptions): express.RequestHandler; /** * Returns a middleware function that requires the payload to contain / match certain data. @@ -216,7 +213,10 @@ export function require(key: string, operator?: string, value?: any): express.Re */ export function valid(): express.RequestHandler; -export interface JWTExpressError extends Error { - name: string; - message: string; +declare global { + namespace Express { + interface Request { + jwt: JWT; + } + } } diff --git a/types/jwt-express/jwt-express-tests.ts b/types/jwt-express/jwt-express-tests.ts index c604dde550..450f835ded 100644 --- a/types/jwt-express/jwt-express-tests.ts +++ b/types/jwt-express/jwt-express-tests.ts @@ -1,7 +1,7 @@ -import express = require("express"); +import exp = require("express"); import jwt = require("jwt-express"); -const app = express(); +const app = exp(); app.use(jwt.active()); app.use(jwt.clear()); @@ -17,12 +17,12 @@ app.use(jwt.init("Secret", { cookies: true, refresh: true, reqProperty: "jwt", - revoke: (revokeJWT) => { jwtObj = revokeJWT; }, + revoke: (revokeJWT: jwt.JWT) => { jwtObj = revokeJWT; }, signOptions: { expiresIn: "1h" }, stales: 1000, - verify: (verifyJWT) => { jwtObj = verifyJWT; return true; }, + verify: (verifyJWT: jwt.JWT) => { jwtObj = verifyJWT; return true; }, verifyOptions: { ignoreExpiration: true } @@ -31,11 +31,14 @@ app.use(jwt.require("key")); app.use(jwt.require("key", "==", "value")); app.use(jwt.valid()); -let resObj: express.Response = {}; -app.use((err: jwt.JWTExpressError, req: express.Request, res: express.Response, next: express.NextFunction) => { +let resObj: exp.Response = {}; +app.use((err: jwt.JWTExpressError, req: exp.Request, res: exp.Response, next: exp.NextFunction) => { err.message.startsWith(""); err.name.startsWith(""); resObj = res; + jwtObj = req.jwt; + req.jwt.payload; + req.hostname.startsWith(""); }); jwtObj.expired.valueOf(); @@ -52,3 +55,9 @@ jwtObj = jwtObj.sign(jwtObj.payload); jwtObj = jwtObj.store(resObj); jwtObj = jwtObj.verify(jwtObj.token); jwtObj.toJSON(); + +app.get("", (req: exp.Request, res: exp.Response, next: exp.NextFunction) => { + jwtObj = req.jwt; + req.jwt.payload; + req.hostname.startsWith(""); +}); From 853933598ab468fca5a6b508ddf6a3741d8e1d26 Mon Sep 17 00:00:00 2001 From: nickp10 Date: Tue, 27 Mar 2018 15:33:40 -0600 Subject: [PATCH 0278/2153] Add missing jwt function on the express response object --- types/jwt-express/index.d.ts | 11 +++++++++++ types/jwt-express/jwt-express-tests.ts | 2 ++ 2 files changed, 13 insertions(+) diff --git a/types/jwt-express/index.d.ts b/types/jwt-express/index.d.ts index 7e33cc7e6b..cbae9f5b8a 100644 --- a/types/jwt-express/index.d.ts +++ b/types/jwt-express/index.d.ts @@ -218,5 +218,16 @@ declare global { interface Request { jwt: JWT; } + + interface Response { + /** + * Returns a newly created / signed JWT Object from the payload. If you are using cookies, + * it will automatically store the JWT in the cookie as well. + * + * @param payload The payload of the JWT + * @return The newly created JWT + */ + jwt(payload: any): JWT; + } } } diff --git a/types/jwt-express/jwt-express-tests.ts b/types/jwt-express/jwt-express-tests.ts index 450f835ded..fedf8137b3 100644 --- a/types/jwt-express/jwt-express-tests.ts +++ b/types/jwt-express/jwt-express-tests.ts @@ -39,6 +39,7 @@ app.use((err: jwt.JWTExpressError, req: exp.Request, res: exp.Response, next: ex jwtObj = req.jwt; req.jwt.payload; req.hostname.startsWith(""); + jwtObj = res.jwt({ }); }); jwtObj.expired.valueOf(); @@ -60,4 +61,5 @@ app.get("", (req: exp.Request, res: exp.Response, next: exp.NextFunction) => { jwtObj = req.jwt; req.jwt.payload; req.hostname.startsWith(""); + jwtObj = res.jwt({ }); }); From 6eb449c46ddc7499c8394ba443265eb1bfeb4061 Mon Sep 17 00:00:00 2001 From: krauseStefan Date: Tue, 27 Mar 2018 23:23:55 +0200 Subject: [PATCH 0279/2153] Added uiGridConstants.scrollbars.WHEN_NEEDED The option is documented here: http://ui-grid.info/docs/#!/api/ui.grid.service:uiGridConstants#properties_scrollbars --- types/ui-grid/index.d.ts | 7 ++++--- types/ui-grid/ui-grid-tests.ts | 9 ++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/types/ui-grid/index.d.ts b/types/ui-grid/index.d.ts index 748dda3bf9..683c906087 100644 --- a/types/ui-grid/index.d.ts +++ b/types/ui-grid/index.d.ts @@ -127,6 +127,7 @@ declare namespace uiGrid { scrollbars: { NEVER: number; ALWAYS: number; + WHEN_NEEDED: number; }; } export type IGridInstance = IGridInstanceOf; @@ -627,7 +628,7 @@ declare namespace uiGrid { enableGridMenu?: boolean; /** * uiGridConstants.scrollbars.ALWAYS by default. This settings controls the horizontal scrollbar for the grid. - * Supported values: uiGridConstants.scrollbars.ALWAYS, uiGridConstants.scrollbars.NEVER + * Supported values: uiGridConstants.scrollbars.ALWAYS, uiGridConstants.scrollbars.NEVER, uiGridConstants.scrollbars.WHEN_NEEDED * @default 1 */ enableHorizontalScrollbar?: boolean | number; @@ -660,7 +661,7 @@ declare namespace uiGrid { enableSorting?: boolean; /** * uiGridConstants.scrollbars.ALWAYS by default. This settings controls the vertical scrollbar for the grid. - * Supported values: uiGridConstants.scrollbars.ALWAYS, uiGridConstants.scrollbars.NEVER + * Supported values: uiGridConstants.scrollbars.ALWAYS, uiGridConstants.scrollbars.NEVER, uiGridConstants.scrollbars.WHEN_NEEDED * @default 1 */ enableVerticalScrollbar?: boolean | number; @@ -897,7 +898,7 @@ declare namespace uiGrid { * which is provided when you want to remove an item. The id should be unique. */ - addToGridMenu(grid: IGridInstanceOf, items: Array): void; + addToGridMenu(grid: IGridInstanceOf, items: Array): void; /** * Clears all filters and optionally refreshes the visible rows. * @param {boolean} [refreshRows=true] Defaults to true. diff --git a/types/ui-grid/ui-grid-tests.ts b/types/ui-grid/ui-grid-tests.ts index e1d49a481d..1e424985fb 100644 --- a/types/ui-grid/ui-grid-tests.ts +++ b/types/ui-grid/ui-grid-tests.ts @@ -98,7 +98,7 @@ columnDef.sort = { priority: 1 }; columnDef.sortCellFiltered = false; -columnDef.sortDirectionCycle = [null, 'asc' , 'desc']; +columnDef.sortDirectionCycle = [null, 'asc', 'desc']; columnDef.sortingAlgorithm = (a: any, b: any, rowA: uiGrid.IGridRowOf, rowB: uiGrid.IGridRowOf, direction: string) => { return -1; }; @@ -113,6 +113,7 @@ var gridApi: uiGrid.IGridApiOf; var gridInstance: uiGrid.IGridInstanceOf; var menuItem: uiGrid.IMenuItem; var colProcessor: uiGrid.IColumnProcessor; +var uiGridConstants: uiGrid.IUiGridConstants; gridApi.core.clearAllFilters(true); gridApi.core.addToGridMenu(gridInstance, [menuItem]); @@ -131,6 +132,12 @@ var gridOptions: uiGrid.IGridOptionsOf = { } }; gridOptions.isRowSelectable = () => true; +gridOptions.enableVerticalScrollbar = uiGridConstants.scrollbars.ALWAYS; +gridOptions.enableVerticalScrollbar = uiGridConstants.scrollbars.WHEN_NEEDED; +gridOptions.enableVerticalScrollbar = uiGridConstants.scrollbars.NEVER; +gridOptions.enableHorizontalScrollbar = uiGridConstants.scrollbars.ALWAYS; +gridOptions.enableHorizontalScrollbar = uiGridConstants.scrollbars.WHEN_NEEDED; +gridOptions.enableHorizontalScrollbar = uiGridConstants.scrollbars.NEVER; interface IAnotherEntity { anObject: string From 1539c6a98b9a343b8c2bcf003c0f06da16fd019f Mon Sep 17 00:00:00 2001 From: Andy Ma Date: Wed, 28 Mar 2018 09:43:46 +0800 Subject: [PATCH 0280/2153] Fix build errors. --- .../datatables.net-colreorder-tests.ts | 4 ++-- types/datatables.net-colreorder/index.d.ts | 4 ++-- types/datatables.net-select/index.d.ts | 14 +++++++------- types/datatables.net/datatables.net-tests.ts | 2 +- types/datatables.net/index.d.ts | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/types/datatables.net-colreorder/datatables.net-colreorder-tests.ts b/types/datatables.net-colreorder/datatables.net-colreorder-tests.ts index 9b73f3f0e0..a6126baf44 100644 --- a/types/datatables.net-colreorder/datatables.net-colreorder-tests.ts +++ b/types/datatables.net-colreorder/datatables.net-colreorder-tests.ts @@ -4,9 +4,9 @@ $(document).ready(() => { colReorder: { fixedColumnsLeft: 0, fixedColumnsRight: 0, - order: [1,2,3], + order: [1, 2, 3], realtime: true, - reorderCallback: ()=>{}, + reorderCallback: () => {}, } }; }); diff --git a/types/datatables.net-colreorder/index.d.ts b/types/datatables.net-colreorder/index.d.ts index 3aad7a3050..8254cd71dc 100644 --- a/types/datatables.net-colreorder/index.d.ts +++ b/types/datatables.net-colreorder/index.d.ts @@ -38,7 +38,7 @@ declare namespace DataTables { /* * Callback after reorder */ - reorderCallback: Function; + reorderCallback: () => void; } interface Api { @@ -59,6 +59,6 @@ declare namespace DataTables { * Convert one or more column indexes to and from current and original indexes */ transpose(idx?: number | number[], direction?: "toCurrent" | "toOriginal" | "fromOriginal" | "fromCurrent"): Api; - } + }; } } diff --git a/types/datatables.net-select/index.d.ts b/types/datatables.net-select/index.d.ts index a48cfe989b..563a51fc25 100644 --- a/types/datatables.net-select/index.d.ts +++ b/types/datatables.net-select/index.d.ts @@ -46,7 +46,7 @@ declare namespace DataTables { */ style?: "api" | "single" | "multi" | "os" | "multi+shift"; } - + interface Api { select: { /* @@ -57,17 +57,17 @@ declare namespace DataTables { * Set the table's selection style */ style(s: "api" | "single" | "multi" | "os"): Api; - } + }; } - + interface RowMethods { /** * Select a row */ select(): Api; /** - * Deselect a row - */ + * Deselect a row + */ deselect(): Api; } @@ -77,8 +77,8 @@ declare namespace DataTables { */ select(): Api; /** - * Deselect a row - */ + * Deselect a row + */ deselect(): Api; } } diff --git a/types/datatables.net/datatables.net-tests.ts b/types/datatables.net/datatables.net-tests.ts index e5cb5184fd..0c9f3db3cc 100644 --- a/types/datatables.net/datatables.net-tests.ts +++ b/types/datatables.net/datatables.net-tests.ts @@ -225,7 +225,7 @@ let config: DataTables.Settings = { ], // Data ajax: "url", - data: {}, + data: [], // Features autoWidth: true, deferRender: true, diff --git a/types/datatables.net/index.d.ts b/types/datatables.net/index.d.ts index 6bbc2e1137..c0a37145ab 100644 --- a/types/datatables.net/index.d.ts +++ b/types/datatables.net/index.d.ts @@ -1301,7 +1301,7 @@ declare namespace DataTables { /** * Data to use as the display data for the table. Since: 1.10 */ - data?: Object[]; + data?: any[]; //#endregion "Data" From be1c86fffe1cf5e375f939795b9288f57d28c872 Mon Sep 17 00:00:00 2001 From: ckboyjiy Date: Wed, 28 Mar 2018 11:08:51 +0900 Subject: [PATCH 0281/2153] Modified submodules --- types/navermaps/index.d.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/types/navermaps/index.d.ts b/types/navermaps/index.d.ts index 92409a44b0..aa36578e63 100644 --- a/types/navermaps/index.d.ts +++ b/types/navermaps/index.d.ts @@ -1082,6 +1082,7 @@ declare namespace naver.maps { } // Sub module: drawing + function drawing(): void; namespace drawing { interface DrawingOptions { map?: Map; @@ -1149,6 +1150,7 @@ declare namespace naver.maps { } // Sub module: visualization + function visualization(): void; namespace visualization { interface DotMapOptions { map: Map; @@ -1218,6 +1220,7 @@ declare namespace naver.maps { } // Sub module: geocoder + function Service(): void; namespace Service { interface ServiceOptions { encoding?: any; @@ -1274,6 +1277,7 @@ declare namespace naver.maps { callback?: (status: Status, response: ReverseGeocodeResponse) => void): void; } + function TransCoord(): void; namespace TransCoord { function fromEPSG3857ToLatLng(coord: Point): LatLng; function fromEPSG3857ToNaver(coord: Point): Point; @@ -1297,6 +1301,7 @@ declare namespace naver.maps { function fromUTMKToTM128(utmk: Point): Point; } + function Event(): void; namespace Event { function addDOMListener(element: HTMLElement, eventName: string, listener: () => any): void; function addListener(target: any, eventName: string, listener: () => any): MapEventListener; @@ -1314,6 +1319,7 @@ declare namespace naver.maps { } // Projection + function EPSG3857(): void; namespace EPSG3857 { // implements Projection function fromCoordToPoint(coord: Coord): Point; function fromLatLngToPoint(latlng: LatLng): Point; @@ -1322,6 +1328,8 @@ declare namespace naver.maps { function getDestinationCoord(fromLatLng: LatLng, angle: number, meter: number): LatLng; function getDistance(latlng1: LatLng, latlng2: LatLng): number; } + + function UTMK(): void; namespace UTMK { let name: string; let pointPerMeter: number; @@ -1338,6 +1346,8 @@ declare namespace naver.maps { function getDestinationCoord(fromLatLng: LatLng, angle: number, meter: number): LatLng; function getDistance(latlng1: LatLng, latlng2: LatLng): number; } + + function UTMK_NAVER(): void; namespace UTMK_NAVER { // extends UTMK let name: string; let pointPerMeter: number; @@ -1350,6 +1360,8 @@ declare namespace naver.maps { function fromPointToNaver(point: Point): Point; function fromUTMKToNaver(utmk: Point): Point; } + + function EPSG3857Coord(): void; namespace EPSG3857Coord { function fromCoordToLatLng(coord: Point): LatLng; function fromCoordToPoint(coord: Point): Point; @@ -1360,10 +1372,14 @@ declare namespace naver.maps { function fromPointToCoord(point: Point): Point; function fromPointToEPSG3857(point: Point): Point; } + + function TM128(): void; namespace TM128 { // extends TM128Coord function fromCoordToPoint(latlng: Coord): Point; function fromPointToCoord(point: Point): LatLng; } + + function TM128Coord(): void; namespace TM128Coord { // extends UTMK function fromCoordToLatLng(tm128: Point): LatLng; function fromCoordToPoint(tm128: Point): Point; @@ -1376,12 +1392,16 @@ declare namespace naver.maps { function fromTM128ToUTMK(tm128: Point): Point; function fromUTMKToTM128(utmk: Point): Point; } + + function UTMK_NAVERCoord(): void; namespace UTMK_NAVERCoord { // extends UTMK_NAVER function fromCoordToLatLng(n: Point): LatLng; function fromCoordToPoint(n: Point): Point; function fromLatLngToCoord(latlng: Coord): Point; function fromPointToCoord(point: Point): Point; } + + function UTMKCoord(): void; namespace UTMKCoord { // extends UTMK function fromCoordToLatLng(utmk: Point): LatLng; function fromCoordToPoint(utmk: Point): Point; From 353076277e69d0b2f98fdcd2e3d0738b46b32aed Mon Sep 17 00:00:00 2001 From: Andy Ma Date: Wed, 28 Mar 2018 11:01:17 +0800 Subject: [PATCH 0282/2153] Add types for AutoFill extension --- .../datatables.net-autofill-tests.ts | 7 +++++ types/datatables.net-autofill/index.d.ts | 30 +++++++++++++++++++ types/datatables.net-autofill/tsconfig.json | 23 ++++++++++++++ types/datatables.net-autofill/tslint.json | 1 + 4 files changed, 61 insertions(+) create mode 100644 types/datatables.net-autofill/datatables.net-autofill-tests.ts create mode 100644 types/datatables.net-autofill/index.d.ts create mode 100644 types/datatables.net-autofill/tsconfig.json create mode 100644 types/datatables.net-autofill/tslint.json diff --git a/types/datatables.net-autofill/datatables.net-autofill-tests.ts b/types/datatables.net-autofill/datatables.net-autofill-tests.ts new file mode 100644 index 0000000000..50c178c6c5 --- /dev/null +++ b/types/datatables.net-autofill/datatables.net-autofill-tests.ts @@ -0,0 +1,7 @@ +const config: DataTables.Settings = { + // AutoFill extension options + autoFill: { + alwaysAsk: true, + enable: true + } +}; diff --git a/types/datatables.net-autofill/index.d.ts b/types/datatables.net-autofill/index.d.ts new file mode 100644 index 0000000000..e037c8dc47 --- /dev/null +++ b/types/datatables.net-autofill/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for datatables.net-autofill 2.2 +// Project: https://datatables.net +// Definitions by: Andy Ma +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// +/// + +declare namespace DataTables { + interface Settings { + /* + * autoFill extension options + */ + autoFill?: boolean | AutoFillSettings; + } + + interface AutoFillSettings { + /* + * Always ask the end user if an action should be taken or not + */ + alwaysAsk?: boolean; + + /* + * + * Initial enablement state of AutoFill + */ + enable?: boolean; + } +} diff --git a/types/datatables.net-autofill/tsconfig.json b/types/datatables.net-autofill/tsconfig.json new file mode 100644 index 0000000000..e17d5de5da --- /dev/null +++ b/types/datatables.net-autofill/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "datatables.net-autofill-tests.ts" + ] +} diff --git a/types/datatables.net-autofill/tslint.json b/types/datatables.net-autofill/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/datatables.net-autofill/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From d1b4a4aa93ca5ddfe329bfd146613945e1ff5b10 Mon Sep 17 00:00:00 2001 From: andy-maca <66229754@qq.com> Date: Wed, 28 Mar 2018 11:09:31 +0800 Subject: [PATCH 0283/2153] Add new property --- .../datatables.net-autofill/datatables.net-autofill-tests.ts | 3 ++- types/datatables.net-autofill/index.d.ts | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/types/datatables.net-autofill/datatables.net-autofill-tests.ts b/types/datatables.net-autofill/datatables.net-autofill-tests.ts index 50c178c6c5..0ad00b4395 100644 --- a/types/datatables.net-autofill/datatables.net-autofill-tests.ts +++ b/types/datatables.net-autofill/datatables.net-autofill-tests.ts @@ -2,6 +2,7 @@ const config: DataTables.Settings = { // AutoFill extension options autoFill: { alwaysAsk: true, - enable: true + enable: true, + columns: [1, 2] } }; diff --git a/types/datatables.net-autofill/index.d.ts b/types/datatables.net-autofill/index.d.ts index e037c8dc47..2d7eb0d856 100644 --- a/types/datatables.net-autofill/index.d.ts +++ b/types/datatables.net-autofill/index.d.ts @@ -20,7 +20,10 @@ declare namespace DataTables { * Always ask the end user if an action should be taken or not */ alwaysAsk?: boolean; - + /* + * Always ask the end user if an action should be taken or not + */ + columns: string | number[]; /* * * Initial enablement state of AutoFill From 4794a91ac5a35d67616d2a2426a8d3429c3ad5f4 Mon Sep 17 00:00:00 2001 From: andy-maca <66229754@qq.com> Date: Wed, 28 Mar 2018 11:28:11 +0800 Subject: [PATCH 0284/2153] Add property 'editor' --- types/datatables.net-autofill/index.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/types/datatables.net-autofill/index.d.ts b/types/datatables.net-autofill/index.d.ts index 2d7eb0d856..68075be5ca 100644 --- a/types/datatables.net-autofill/index.d.ts +++ b/types/datatables.net-autofill/index.d.ts @@ -21,9 +21,13 @@ declare namespace DataTables { */ alwaysAsk?: boolean; /* - * Always ask the end user if an action should be taken or not + * Select the columns that can be auto filled */ columns: string | number[]; + /* + * Attach an Editor instance for database updating + */ + editor: Object; /* * * Initial enablement state of AutoFill From 6ed5c800004cd6a5275056e137dcbb13a683edee Mon Sep 17 00:00:00 2001 From: Ke Zhang Date: Tue, 27 Mar 2018 21:06:48 -0700 Subject: [PATCH 0285/2153] Add proper type for AccessToken.token. --- types/simple-oauth2/index.d.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/types/simple-oauth2/index.d.ts b/types/simple-oauth2/index.d.ts index 499f39e56e..c1eb324348 100644 --- a/types/simple-oauth2/index.d.ts +++ b/types/simple-oauth2/index.d.ts @@ -44,8 +44,12 @@ export interface ModuleOptions { export type TokenType = "access_token" | "refresh_token"; +export interface Token { + [x: string]: any; +} + export interface AccessToken { - token: {}; + token: Token; /** Check if the access token is expired or not */ expired(): boolean; @@ -56,9 +60,6 @@ export interface AccessToken { revoke(tokenType: TokenType, callback?: (error: any) => void): Bluebird; } -export interface Token { - [x: string]: any; -} export type AuthorizationCode = string; export interface AuthorizationTokenConfig { code: AuthorizationCode; From 454e0ecd2826835f90963ccc24168fb15fe35eff Mon Sep 17 00:00:00 2001 From: Ke Zhang Date: Tue, 27 Mar 2018 21:29:18 -0700 Subject: [PATCH 0286/2153] Update package version of @type/simple-oauth2 --- types/simple-oauth2/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/simple-oauth2/index.d.ts b/types/simple-oauth2/index.d.ts index c1eb324348..b93bbc229f 100644 --- a/types/simple-oauth2/index.d.ts +++ b/types/simple-oauth2/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for simple-oauth2 1.0 +// Type definitions for simple-oauth2 1.1 // Project: https://github.com/lelylan/simple-oauth2 // Definitions by: [Michael Müller] // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 8988aee224efd4df06a9a70b543e6938a68f4302 Mon Sep 17 00:00:00 2001 From: Firede Date: Wed, 28 Mar 2018 14:39:26 +0800 Subject: [PATCH 0287/2153] Reformat all files using prettier. prettier --parser typescript --tab-width 4 --semi --trailing-comma es5 \ --write --print-width 120 \ types/express-graphql/*.ts related: #24552 --- .../express-graphql/express-graphql-tests.ts | 22 +++++++++---------- types/express-graphql/index.d.ts | 8 +++---- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/types/express-graphql/express-graphql-tests.ts b/types/express-graphql/express-graphql-tests.ts index 1557c4c0ac..958be4f5ff 100644 --- a/types/express-graphql/express-graphql-tests.ts +++ b/types/express-graphql/express-graphql-tests.ts @@ -1,7 +1,7 @@ -import express = require('express'); -import 'express-session'; -import graphqlHTTP = require('express-graphql'); -import { GraphQLSchema } from 'graphql/type/schema'; +import express = require("express"); +import "express-session"; +import graphqlHTTP = require("express-graphql"); +import { GraphQLSchema } from "graphql/type/schema"; const app = express(); const schema: GraphQLSchema = { @@ -20,10 +20,10 @@ const graphqlOption: graphqlHTTP.OptionsData = { graphiql: true, schema, formatError: (error: Error) => ({ - message: error.message + message: error.message, }), validationRules: [() => false, () => true], - extensions: ({ document, variables, operationName, result }) => ({ key: "value", key2: "value"}), + extensions: ({ document, variables, operationName, result }) => ({ key: "value", key2: "value" }), }; const graphqlOptionRequest = (request: express.Request): graphqlHTTP.OptionsData => ({ @@ -38,15 +38,15 @@ const graphqlOptionRequestAsync = async (request: express.Request): Promise { }, + extensions: async args => {}, validationRules: [() => false, () => true], }; }; -app.use('/graphql1', graphqlHTTP(graphqlOption)); +app.use("/graphql1", graphqlHTTP(graphqlOption)); -app.use('/graphql2', graphqlHTTP(graphqlOptionRequest)); +app.use("/graphql2", graphqlHTTP(graphqlOptionRequest)); -app.use('/graphqlasync', graphqlHTTP(graphqlOptionRequestAsync)); +app.use("/graphqlasync", graphqlHTTP(graphqlOptionRequestAsync)); -app.listen(8080, () => console.log('GraphQL Server running on localhost:8080')); +app.listen(8080, () => console.log("GraphQL Server running on localhost:8080")); diff --git a/types/express-graphql/index.d.ts b/types/express-graphql/index.d.ts index 4b2d10c99b..b00259e158 100644 --- a/types/express-graphql/index.d.ts +++ b/types/express-graphql/index.d.ts @@ -9,7 +9,7 @@ // TypeScript Version: 2.3 import { Request, Response } from "express"; -import { DocumentNode, GraphQLSchema, GraphQLError } from 'graphql'; +import { DocumentNode, GraphQLSchema, GraphQLError } from "graphql"; export = graphqlHTTP; declare namespace graphqlHTTP { @@ -17,9 +17,9 @@ declare namespace graphqlHTTP { * Used to configure the graphQLHTTP middleware by providing a schema * and other configuration options. */ - export type Options = ((request: Request, - response: Response, - params?: GraphQLParams) => OptionsResult) | OptionsResult; + export type Options = + | ((request: Request, response: Response, params?: GraphQLParams) => OptionsResult) + | OptionsResult; export type OptionsResult = OptionsData | Promise; export interface OptionsData { /** From 08716e9683a4c86ad8ea0bd9143d8387337156a7 Mon Sep 17 00:00:00 2001 From: Zev Spitz Date: Wed, 28 Mar 2018 08:47:59 +0200 Subject: [PATCH 0288/2153] Replace forEach with for...of in tests --- types/activex-wia/activex-wia-tests.ts | 39 ++++++++++++++------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/types/activex-wia/activex-wia-tests.ts b/types/activex-wia/activex-wia-tests.ts index c33385af14..8fc7dcfd2e 100644 --- a/types/activex-wia/activex-wia-tests.ts +++ b/types/activex-wia/activex-wia-tests.ts @@ -11,6 +11,9 @@ const collectionToArray = (col: { Item(key: any): T }): T[] => { return results; }; +WScript.Echo('Hello, world'); +WScript.Quit(); + // source -- https://msdn.microsoft.com/en-us/library/windows/desktop/ms630826(v=vs.85).aspx { const cd = new ActiveXObject('WIA.CommonDialog'); @@ -51,7 +54,7 @@ const collectionToArray = (col: { Item(key: any): T }): T[] => { { const dev = cd.ShowSelectDevice(); if (dev) { - collectionToArray(dev.Properties).forEach(p => { + for (const p of collectionToArray(dev.Properties)) { let s = `${p.Name} (${p.PropertyID}) = `; if (p.IsVector) { s += '[vector of data]'; @@ -84,7 +87,7 @@ const collectionToArray = (col: { Item(key: any): T }): T[] => { } WScript.Echo(s); - }); + } } } @@ -112,7 +115,7 @@ const collectionToArray = (col: { Item(key: any): T }): T[] => { { const img = cd.ShowAcquireImage(); if (img) { - collectionToArray(img.Properties).forEach(p => { + for (const p of collectionToArray(img.Properties)) { let contents = ''; if (p.IsVector) { contents = '[vector data not emitted]'; @@ -124,7 +127,7 @@ const collectionToArray = (col: { Item(key: any): T }): T[] => { contents = p.Value; } WScript.Echo(`${p.Name} (${p.PropertyID}) = ${contents}`); - }); + } } } @@ -133,12 +136,12 @@ const collectionToArray = (col: { Item(key: any): T }): T[] => { const dev = cd.ShowSelectDevice(); if (dev) { const actionEvent = WIA.WiaEventFlag.ActionEvent; - collectionToArray(dev.Events).forEach(e => { + for (const e of collectionToArray(dev.Events)) { const msg = (e.Type & actionEvent) === actionEvent ? `${e.Name} is an Action event` : `${e.Name} is not an Action event`; WScript.Echo(msg); - }); + } } } @@ -208,14 +211,14 @@ Frame count = ${img.FrameCount}} // Create an imageprocess object and enumerate filters { const ip = new ActiveXObject('WIA.ImageProcess'); - collectionToArray(ip.FilterInfos).forEach(fi => { + for (const fi of collectionToArray(ip.FilterInfos)) { const s = [ fi.Name, new Array(51).join('='), fi.Description ].join('\n'); WScript.Echo(s); - }); + } } // Create an imageprocess object and create one of each available filter @@ -269,11 +272,11 @@ Frame count = ${img.FrameCount}} WScript.Echo(s); }; - collectionToArray(ip.FilterInfos).forEach(fi => { + for (const fi of collectionToArray(ip.FilterInfos)) { ip.Filters.Add(fi.FilterID); listProperties(ip.Filters(1)); ip.Filters.Remove(1); - }); + } } // List the supported transfer formats @@ -308,14 +311,14 @@ Frame count = ${img.FrameCount}} { const dev = cd.ShowSelectDevice(); if (dev) { - collectionToArray(dev.Items).forEach(item => { + for (const item of collectionToArray(dev.Items)) { let s: string = item.Properties("Item Name").Value; if (item.Properties.Exists("Item Time Stamp")) { const v: WIA.Vector = item.Properties("Item Time Stamp").Value; if (v.Count === 8) { s += ` (${v.Date})`; } } WScript.Echo(s); - }); + } } } @@ -340,16 +343,16 @@ Frame count = ${img.FrameCount}} } // List all available devices by name and deviceid - collectionToArray(dm.DeviceInfos).forEach(di => { + for (const di of collectionToArray(dm.DeviceInfos)) { const name: string = di.Properties("Name").Value; WScript.Echo(`${name} (${di.DeviceID})`); - }); + } // Display all the properties for the selected device { const dev = cd.ShowSelectDevice(); if (dev) { - collectionToArray(dev.Properties).forEach(p => { + for (const p of collectionToArray(dev.Properties)) { const name = `${p.Name} (${p.PropertyID})`; let contents: string; if (p.IsVector) { @@ -360,7 +363,7 @@ Frame count = ${img.FrameCount}} contents = p.Value; } WScript.Echo(`${name} = ${contents}`); - }); + } } } @@ -430,7 +433,7 @@ Frame count = ${img.FrameCount}} if (args[0] === 'connect') { const deviceID = args[1].substr(12); const device = dm.DeviceInfos(deviceID).Connect(); - collectionToArray(device.Items).forEach(item => { + for (const item of collectionToArray(device.Items)) { const img = item.Transfer(); img.SaveFile(`C:\\${item.Properties('Item Name').Value}.${img.FileExtension}`); @@ -445,7 +448,7 @@ Frame count = ${img.FrameCount}} WScript.Echo(error); } } - }); + } WScript.Quit(); } break; From 73c777a74a44cb85e5be44e19d0afde8a94c44d8 Mon Sep 17 00:00:00 2001 From: Firede Date: Wed, 28 Mar 2018 14:49:05 +0800 Subject: [PATCH 0289/2153] Fixed the definition of some optional fields. `express-graphql` version: 0.6.12 --- types/express-graphql/index.d.ts | 34 ++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/types/express-graphql/index.d.ts b/types/express-graphql/index.d.ts index b00259e158..78c988204f 100644 --- a/types/express-graphql/index.d.ts +++ b/types/express-graphql/index.d.ts @@ -5,6 +5,7 @@ // Daniel Fader // Ehsan Ziya // Margus Lamp +// Firede // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -14,8 +15,11 @@ export = graphqlHTTP; declare namespace graphqlHTTP { /** - * Used to configure the graphQLHTTP middleware by providing a schema + * Used to configure the graphqlHTTP middleware by providing a schema * and other configuration options. + * + * Options can be provided as an Object, a Promise for an Object, or a Function + * that returns an Object or a Promise for an Object. */ export type Options = | ((request: Request, response: Response, params?: GraphQLParams) => OptionsResult) @@ -40,20 +44,20 @@ declare namespace graphqlHTTP { /** * A boolean to configure whether the output should be pretty-printed. */ - pretty?: boolean; + pretty?: boolean | null; /** * An optional function which will be used to format any errors produced by * fulfilling a GraphQL operation. If no function is provided, GraphQL's * default spec-compliant `formatError` function will be used. */ - formatError?: (error: GraphQLError) => any; + formatError?: ((error: GraphQLError) => any) | null; /** * An optional array of validation rules that will be applied on the document * in additional to those defined by the GraphQL spec. */ - validationRules?: any[]; + validationRules?: any[] | null; /** * An optional function for adding additional metadata to the GraphQL response @@ -65,12 +69,12 @@ declare namespace graphqlHTTP { * * This function may be async. */ - extensions?: (info: RequestInfo) => { [key: string]: any }; + extensions?: ((info: RequestInfo) => { [key: string]: any }) | null; /** * A boolean to optionally enable GraphiQL mode. */ - graphiql?: boolean; + graphiql?: boolean | null; } /** @@ -80,32 +84,32 @@ declare namespace graphqlHTTP { /** * The parsed GraphQL document. */ - document?: DocumentNode; + document: DocumentNode | null | undefined; /** * The variable values used at runtime. */ - variables?: { [name: string]: any }; + variables: { [name: string]: any } | null | undefined; /** * The (optional) operation name requested. */ - operationName?: string; + operationName: string | null | undefined; /** * The result of executing the operation. */ - result?: any; + result: any; } export interface GraphQLParams { - query?: string; - variables?: { [name: string]: any }; - operationName?: string; - raw?: boolean; + query: string | null | undefined; + variables: { [name: string]: any } | null | undefined; + operationName: string | null | undefined; + raw: boolean | null | undefined; } - type Middleware = (request: Request, response: Response) => void; + type Middleware = (request: Request, response: Response) => Promise; } /** From 3e6f8de9dc2724547d1e938787051a4d000ff8c7 Mon Sep 17 00:00:00 2001 From: Zev Spitz Date: Wed, 28 Mar 2018 09:04:28 +0200 Subject: [PATCH 0290/2153] Use ReadonlyArray --- types/activex-wia/activex-wia-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/activex-wia/activex-wia-tests.ts b/types/activex-wia/activex-wia-tests.ts index 8fc7dcfd2e..1effbe99ee 100644 --- a/types/activex-wia/activex-wia-tests.ts +++ b/types/activex-wia/activex-wia-tests.ts @@ -1,6 +1,6 @@ // Note -- running these tests under cscript requires some ES5 polyfills -const collectionToArray = (col: { Item(key: any): T }): T[] => { +const collectionToArray = (col: { Item(key: any): T }): ReadonlyArray => { const results: T[] = []; const enumerator = new Enumerator(col); enumerator.moveFirst(); From f7255883d0126c51a61a1bc874bf5de4b437c396 Mon Sep 17 00:00:00 2001 From: Zev Spitz Date: Wed, 28 Mar 2018 09:05:30 +0200 Subject: [PATCH 0291/2153] Undo ReadonlyArray --- types/activex-wia/activex-wia-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/activex-wia/activex-wia-tests.ts b/types/activex-wia/activex-wia-tests.ts index 1effbe99ee..8fc7dcfd2e 100644 --- a/types/activex-wia/activex-wia-tests.ts +++ b/types/activex-wia/activex-wia-tests.ts @@ -1,6 +1,6 @@ // Note -- running these tests under cscript requires some ES5 polyfills -const collectionToArray = (col: { Item(key: any): T }): ReadonlyArray => { +const collectionToArray = (col: { Item(key: any): T }): T[] => { const results: T[] = []; const enumerator = new Enumerator(col); enumerator.moveFirst(); From ac6eb13e40e93553c1d9743924a5aa408d548cf0 Mon Sep 17 00:00:00 2001 From: Firede Date: Wed, 28 Mar 2018 15:25:04 +0800 Subject: [PATCH 0292/2153] Defining `schema` the right way. Otherwise, it will cause the new version `@types/graphql` test to fail. Related: #24566 --- types/express-graphql/express-graphql-tests.ts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/types/express-graphql/express-graphql-tests.ts b/types/express-graphql/express-graphql-tests.ts index 958be4f5ff..52071cea07 100644 --- a/types/express-graphql/express-graphql-tests.ts +++ b/types/express-graphql/express-graphql-tests.ts @@ -1,20 +1,10 @@ import express = require("express"); import "express-session"; import graphqlHTTP = require("express-graphql"); -import { GraphQLSchema } from "graphql/type/schema"; +import { buildSchema } from "graphql"; const app = express(); -const schema: GraphQLSchema = { - getQueryType: null, - getMutationType: null, - getSubscriptionType: null, - getTypeMap: null, - getType: null, - getPossibleTypes: null, - isPossibleType: null, - getDirective: null, - getDirectives: null, -}; +const schema = buildSchema(`type Query { hello: String }`); const graphqlOption: graphqlHTTP.OptionsData = { graphiql: true, From cd800800a9ef8c060ac209ae6b88604fc1d5d6f2 Mon Sep 17 00:00:00 2001 From: Firede Date: Wed, 28 Mar 2018 16:05:34 +0800 Subject: [PATCH 0293/2153] Rewrite tests. `GraphQLResolveInfo` is usually generated internally by graphql. --- .../graphql-list-fields-tests.ts | 62 ++++++++----------- 1 file changed, 26 insertions(+), 36 deletions(-) diff --git a/types/graphql-list-fields/graphql-list-fields-tests.ts b/types/graphql-list-fields/graphql-list-fields-tests.ts index ee9bcc6851..e90d609f1d 100644 --- a/types/graphql-list-fields/graphql-list-fields-tests.ts +++ b/types/graphql-list-fields/graphql-list-fields-tests.ts @@ -1,41 +1,31 @@ import getFieldNames = require("graphql-list-fields"); -import { - GraphQLID, - GraphQLObjectType, - GraphQLResolveInfo, - GraphQLSchema, - GraphQLString -} from "graphql"; +import { GraphQLID, GraphQLObjectType, GraphQLSchema, GraphQLString } from "graphql"; -const sampleGraphQLResolveInfo: GraphQLResolveInfo = { - fieldName: "", - fieldNodes: [], - returnType: GraphQLString, - parentType: new GraphQLObjectType({ - name: "Sample", +const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: "SampleType", fields: { - name: { type: GraphQLString } - } + scalarField: { + type: GraphQLString, + resolve(source, args, context, info) { + const fieldNames: string[] = getFieldNames(info); + }, + }, + someType: { + type: new GraphQLObjectType({ + name: "SomeType", + fields: { + a: { type: GraphQLID }, + b: { type: GraphQLString }, + c: { type: GraphQLString }, + d: { type: GraphQLString }, + }, + }), + resolve(source, args, context, info) { + const fieldNames: string[] = getFieldNames(info); + }, + }, + }, }), - path: undefined, - schema: new GraphQLSchema({ - query: new GraphQLObjectType({ - name: "SampleType", - fields: {} - }) - }), - fragments: {}, - rootValue: null, - operation: { - kind: "OperationDefinition", - operation: "query", - selectionSet: { - kind: "SelectionSet", - selections: [] - } - }, - variableValues: {} -}; - -const fieldNames: string[] = getFieldNames(sampleGraphQLResolveInfo); +}); From 026dc969c2cf6077a21271d37cc3c912fa43be89 Mon Sep 17 00:00:00 2001 From: Mykolas Kairys Date: Wed, 28 Mar 2018 11:24:08 +0300 Subject: [PATCH 0294/2153] updated react-router-redux createMatchSelector definition to not have generic --- types/react-router-redux/index.d.ts | 2 +- types/react-router-redux/tslint.json | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/types/react-router-redux/index.d.ts b/types/react-router-redux/index.d.ts index 89ef136014..7c8d78ccc9 100644 --- a/types/react-router-redux/index.d.ts +++ b/types/react-router-redux/index.d.ts @@ -80,4 +80,4 @@ export interface LocationChangeAction { export function routerMiddleware(history: History): Middleware; -export function createMatchSelector(path: string): (state: State) => match | null; +export function createMatchSelector(path: string): (state: { router: RouterState }) => match<{}> | null; diff --git a/types/react-router-redux/tslint.json b/types/react-router-redux/tslint.json index 71ee04c4e1..f93cf8562a 100644 --- a/types/react-router-redux/tslint.json +++ b/types/react-router-redux/tslint.json @@ -1,6 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "no-unnecessary-generics": false - } + "extends": "dtslint/dt.json" } From 6fcf793f2aae2d70e737d08f0b42fb4f56d5846b Mon Sep 17 00:00:00 2001 From: bang Date: Wed, 28 Mar 2018 16:48:29 +0800 Subject: [PATCH 0295/2153] fix: optional T --- types/inquirer/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/inquirer/index.d.ts b/types/inquirer/index.d.ts index b793673215..d9258f7a48 100644 --- a/types/inquirer/index.d.ts +++ b/types/inquirer/index.d.ts @@ -17,7 +17,7 @@ import through = require('through'); declare namespace inquirer { type Prompts = { [name: string]: PromptModule }; type ChoiceType = string | objects.ChoiceOption | objects.Separator; - type Questions = + type Questions = | Question | ReadonlyArray> | Rx.Observable>; From cd12005ec0bd6bd4fb06aeb69b9b58aa1db259f7 Mon Sep 17 00:00:00 2001 From: Juan Jimenez-Anca Date: Wed, 28 Mar 2018 10:14:40 +0100 Subject: [PATCH 0296/2153] add Uint8Array for browsers --- types/ethereumjs-util/index.d.ts | 54 ++++++++++++++++---------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/types/ethereumjs-util/index.d.ts b/types/ethereumjs-util/index.d.ts index 7a29b38ff5..eb47d3a6a9 100644 --- a/types/ethereumjs-util/index.d.ts +++ b/types/ethereumjs-util/index.d.ts @@ -20,64 +20,64 @@ export function addHexPrefix(str: string): string; export function arrayContainsArray(superset: any, subset: any, some: any): any; -export function baToJSON(ba: Buffer | string[]): Buffer | string[]; +export function baToJSON(ba: Buffer | Uint8Array | string[]): Buffer | Uint8Array | string[]; -export function bufferToHex(buf: Buffer): string; +export function bufferToHex(buf: Buffer | Uint8Array): string; -export function bufferToInt(buf: Buffer): string; +export function bufferToInt(buf: Buffer | Uint8Array): string; export function defineProperties(self: {[k: string]: any}, fields: string[], data: {[k: string]: any}): {[k: string]: any}; -export function ecrecover(msgHash: Buffer, v: number, r: Buffer, s: Buffer): Buffer; +export function ecrecover(msgHash: Buffer | Uint8Array, v: number, r: Buffer | Uint8Array, s: Buffer | Uint8Array): Buffer | Uint8Array; -export function ecsign(msgHash: Buffer, privateKey: Buffer): {[k: string]: any}; +export function ecsign(msgHash: Buffer | Uint8Array, privateKey: Buffer | Uint8Array): {[k: string]: any}; export function fromRpcSig(sig: string): {[k: string]: any}; -export function fromSigned(num: Buffer): any; +export function fromSigned(num: Buffer | Uint8Array): any; -export function generateAddress(from: Buffer, nonce: Buffer): Buffer; +export function generateAddress(from: Buffer | Uint8Array, nonce: Buffer | Uint8Array): Buffer | Uint8Array; -export function hashPersonalMessage(message: string): Buffer; +export function hashPersonalMessage(message: string): Buffer | Uint8Array; -export function importPublic(publicKey: Buffer): Buffer; +export function importPublic(publicKey: Buffer | Uint8Array): Buffer | Uint8Array; export function isValidAddress(address: string): boolean; -export function isValidChecksumAddress(address: Buffer): boolean; +export function isValidChecksumAddress(address: Buffer | Uint8Array): boolean; -export function isValidPrivate(privateKey: Buffer): boolean; +export function isValidPrivate(privateKey: Buffer | Uint8Array): boolean; -export function isValidPublic(publicKey: Buffer, sanitize?: boolean): any; +export function isValidPublic(publicKey: Buffer | Uint8Array, sanitize?: boolean): any; -export function isValidSignature(v: Buffer, r: Buffer, s: Buffer, homestead?: boolean): boolean; +export function isValidSignature(v: Buffer | Uint8Array, r: Buffer | Uint8Array, s: Buffer | Uint8Array, homestead?: boolean): boolean; -export function privateToAddress(privateKey: Buffer): Buffer; +export function privateToAddress(privateKey: Buffer | Uint8Array): Buffer | Uint8Array; -export function privateToPublic(privateKey: Buffer): Buffer; +export function privateToPublic(privateKey: Buffer | Uint8Array): Buffer | Uint8Array; -export function pubToAddress(pubKey: Buffer, sanitize: boolean): Buffer; +export function pubToAddress(pubKey: Buffer | Uint8Array, sanitize: boolean): Buffer | Uint8Array; -export function ripemd160(a: Buffer | any[] | string | number, padded: boolean): Buffer; +export function ripemd160(a: Buffer | Uint8Array | any[] | string | number, padded: boolean): Buffer | Uint8Array; -export function rlphash(a: Buffer | any[] | string | number): Buffer; +export function rlphash(a: Buffer | Uint8Array | any[] | string | number): Buffer | Uint8Array; -export function setLengthLeft(msg: Buffer | any[], length: number, right?: boolean): Buffer | any[]; +export function setLengthLeft(msg: Buffer | Uint8Array | any[], length: number, right?: boolean): Buffer | Uint8Array | any[]; -export function setLengthRight(msg: Buffer | any[], length: number): Buffer | any[]; +export function setLengthRight(msg: Buffer | Uint8Array | any[], length: number): Buffer | Uint8Array | any[]; -export function sha256(a: Buffer | any[] | string | number): Buffer; +export function sha256(a: Buffer | Uint8Array | any[] | string | number): Buffer | Uint8Array; -export function sha3(a: Buffer | any[] | string | number, bits?: number): Buffer; +export function sha3(a: Buffer | Uint8Array | any[] | string | number, bits?: number): Buffer | Uint8Array; -export function toBuffer(v: any): Buffer; +export function toBuffer(v: any): Buffer | Uint8Array; export function toChecksumAddress(address: string): string; -export function toRpcSig(v: number, r: Buffer, s: Buffer): string; +export function toRpcSig(v: number, r: Buffer | Uint8Array, s: Buffer | Uint8Array): string; -export function toUnsigned(num: any): Buffer; +export function toUnsigned(num: any): Buffer | Uint8Array; -export function unpad(a: T): T; +export function unpad(a: T): T; -export function zeros(bytes: number): Buffer; +export function zeros(bytes: number): Buffer | Uint8Array; From 3ccca87866a0517cfb9ba67381430461d37efcca Mon Sep 17 00:00:00 2001 From: Firede Date: Wed, 28 Mar 2018 17:49:44 +0800 Subject: [PATCH 0297/2153] Fixed types. --- types/graphql/language/directiveLocation.d.ts | 7 +++++-- types/graphql/language/kinds.d.ts | 7 +++++-- types/graphql/language/lexer.d.ts | 7 +++++-- types/graphql/utilities/findBreakingChanges.d.ts | 14 ++++++++++---- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/types/graphql/language/directiveLocation.d.ts b/types/graphql/language/directiveLocation.d.ts index 412e3ad32a..16c42d7877 100644 --- a/types/graphql/language/directiveLocation.d.ts +++ b/types/graphql/language/directiveLocation.d.ts @@ -1,7 +1,10 @@ /** * The set of allowed directive location values. */ -export type DirectiveLocation = { +export const DirectiveLocation: _DirectiveLocation; + +// @internal +type _DirectiveLocation = { // Request Definitions QUERY: "QUERY"; MUTATION: "MUTATION"; @@ -28,4 +31,4 @@ export type DirectiveLocation = { /** * The enum type representing the directive location values. */ -export type DirectiveLocationEnum = DirectiveLocation[keyof DirectiveLocation]; +export type DirectiveLocationEnum = _DirectiveLocation[keyof _DirectiveLocation]; diff --git a/types/graphql/language/kinds.d.ts b/types/graphql/language/kinds.d.ts index 6e497cbc68..768f00addd 100644 --- a/types/graphql/language/kinds.d.ts +++ b/types/graphql/language/kinds.d.ts @@ -1,7 +1,10 @@ /** * The set of allowed kind values for AST nodes. */ -export type Kind = { +export const Kind: _Kind; + +// @internal +type _Kind = { // Name NAME: "Name"; @@ -68,4 +71,4 @@ export type Kind = { /** * The enum type representing the possible kind values of AST nodes. */ -export type KindEnum = Kind[keyof Kind]; +export type KindEnum = _Kind[keyof _Kind]; diff --git a/types/graphql/language/lexer.d.ts b/types/graphql/language/lexer.d.ts index 69fa3df460..19a57d3a11 100644 --- a/types/graphql/language/lexer.d.ts +++ b/types/graphql/language/lexer.d.ts @@ -55,7 +55,10 @@ export interface Lexer { * An exported enum describing the different kinds of tokens that the * lexer emits. */ -export type TokenKind = { +export const TokenKind: _TokenKind; + +// @internal +type _TokenKind = { SOF: ""; EOF: ""; BANG: "!"; @@ -83,7 +86,7 @@ export type TokenKind = { /** * The enum type representing the token kinds values. */ -export type TokenKindEnum = TokenKind[keyof TokenKind]; +export type TokenKindEnum = _TokenKind[keyof _TokenKind]; /** * A helper function to describe a token as a string for debugging diff --git a/types/graphql/utilities/findBreakingChanges.d.ts b/types/graphql/utilities/findBreakingChanges.d.ts index 77f98f848a..84f1bea158 100644 --- a/types/graphql/utilities/findBreakingChanges.d.ts +++ b/types/graphql/utilities/findBreakingChanges.d.ts @@ -12,7 +12,10 @@ import { GraphQLDirective } from "../type/directives"; import { GraphQLSchema } from "../type/schema"; import { DirectiveLocationEnum } from "../language/directiveLocation"; -export type BreakingChangeType = { +export const BreakingChangeType : _BreakingChangeType; + +// @internal +type _BreakingChangeType = { FIELD_CHANGED_KIND: "FIELD_CHANGED_KIND"; FIELD_REMOVED: "FIELD_REMOVED"; TYPE_CHANGED_KIND: "TYPE_CHANGED_KIND"; @@ -30,7 +33,10 @@ export type BreakingChangeType = { NON_NULL_DIRECTIVE_ARG_ADDED: "NON_NULL_DIRECTIVE_ARG_ADDED"; }; -export type DangerousChangeType = { +export const DangerousChangeType: _DangerousChangeType; + +// @internal +type _DangerousChangeType = { ARG_DEFAULT_VALUE_CHANGE: "ARG_DEFAULT_VALUE_CHANGE"; VALUE_ADDED_TO_ENUM: "VALUE_ADDED_TO_ENUM"; INTERFACE_ADDED_TO_OBJECT: "INTERFACE_ADDED_TO_OBJECT"; @@ -40,12 +46,12 @@ export type DangerousChangeType = { }; export interface BreakingChange { - type: keyof BreakingChangeType; + type: keyof _BreakingChangeType; description: string; } export interface DangerousChange { - type: keyof DangerousChangeType; + type: keyof _DangerousChangeType; description: string; } From 7addf7ae18cfc3f62fe74dd3a8a813606eb05029 Mon Sep 17 00:00:00 2001 From: Timur Amirov Date: Wed, 28 Mar 2018 13:14:26 +0200 Subject: [PATCH 0298/2153] Update typing for circuit-breaker-js --- types/circuit-breaker-js/circuit-breaker-js-tests.ts | 8 ++++++++ types/circuit-breaker-js/index.d.ts | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/types/circuit-breaker-js/circuit-breaker-js-tests.ts b/types/circuit-breaker-js/circuit-breaker-js-tests.ts index 1436e13e90..b9a3c70a63 100644 --- a/types/circuit-breaker-js/circuit-breaker-js-tests.ts +++ b/types/circuit-breaker-js/circuit-breaker-js-tests.ts @@ -10,3 +10,11 @@ status = CircuitBreaker.OPEN; breaker.forceOpen(); breaker.forceClose(); + +breaker.run((success, failure) => { + if (Math.random() > 0.5) { + success(); + } else { + failure(); + } +}); diff --git a/types/circuit-breaker-js/index.d.ts b/types/circuit-breaker-js/index.d.ts index 6fc58bd40d..7b6854e61f 100644 --- a/types/circuit-breaker-js/index.d.ts +++ b/types/circuit-breaker-js/index.d.ts @@ -30,7 +30,13 @@ declare class CircuitBreaker { static CLOSED: 2; constructor(options?: CircuitBreaker.Options); - run(command: () => void, fallback?: () => void): void; + run( + command: ( + success: () => void, + failure: () => void, + ) => void, + fallback?: () => void + ): void; forceClose(): void; forceOpen(): void; unforce(): void; From 19341e612be15bc974a94371d51f4b3e312e675c Mon Sep 17 00:00:00 2001 From: Andrija Dvorski Date: Wed, 28 Mar 2018 15:00:03 +0200 Subject: [PATCH 0299/2153] Added types for command-line-usage package --- .../command-line-usage-tests.ts | 24 ++++++++++ types/command-line-usage/index.d.ts | 48 +++++++++++++++++++ types/command-line-usage/tsconfig.json | 23 +++++++++ types/command-line-usage/tslint.json | 1 + 4 files changed, 96 insertions(+) create mode 100644 types/command-line-usage/command-line-usage-tests.ts create mode 100644 types/command-line-usage/index.d.ts create mode 100644 types/command-line-usage/tsconfig.json create mode 100644 types/command-line-usage/tslint.json diff --git a/types/command-line-usage/command-line-usage-tests.ts b/types/command-line-usage/command-line-usage-tests.ts new file mode 100644 index 0000000000..c4dd127cea --- /dev/null +++ b/types/command-line-usage/command-line-usage-tests.ts @@ -0,0 +1,24 @@ +import * as commandLineUsage from "command-line-usage"; + +const sections = [ + { + header: 'A typical app', + content: 'Generates something {italic very} important.' + }, + { + header: 'Options', + optionList: [ + { + name: 'input', + typeLabel: '{underline file}', + description: 'The input to process.' + }, + { + name: 'help', + description: 'Print this usage guide.' + } + ] + } +]; + +const usage = commandLineUsage(sections); diff --git a/types/command-line-usage/index.d.ts b/types/command-line-usage/index.d.ts new file mode 100644 index 0000000000..ac4f1d7606 --- /dev/null +++ b/types/command-line-usage/index.d.ts @@ -0,0 +1,48 @@ +// Type definitions for command-line-usage 5.0 +// Project: https://github.com/75lb/command-line-usage#readme +// Definitions by: Andrija Dvorski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +declare namespace commandLineUsage { + interface Section { + list: string[]; + + add(content: object): void; + emptyLine(): void; + header(text: string): void; + toString(): string; + } + + interface SectionData { + optionList?: OptionListData[]; + hide?: string[]; + group?: string[]; + header?: string; + reverseNameOrder?: boolean; + tableOptions?: any; + } + + interface OptionListData extends SectionData { + name: string; + typeLabel?: string; + description?: string; + } + + interface ContentSectionData extends SectionData { + content: string; + raw?: boolean; + } + + type CommandLineUsageInput = + SectionData + | SectionData[] + | OptionListData + | OptionListData[] + | ContentSectionData + | ContentSectionData[]; +} + +declare function commandLineUsage(sections: commandLineUsage.CommandLineUsageInput): string | undefined | commandLineUsage.Section; + +export = commandLineUsage; diff --git a/types/command-line-usage/tsconfig.json b/types/command-line-usage/tsconfig.json new file mode 100644 index 0000000000..9deee9ab63 --- /dev/null +++ b/types/command-line-usage/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "command-line-usage-tests.ts" + ] +} diff --git a/types/command-line-usage/tslint.json b/types/command-line-usage/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/command-line-usage/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 6623a7ee2549759ee82486e6f15159ed94bdcd00 Mon Sep 17 00:00:00 2001 From: Simon Schick Date: Wed, 28 Mar 2018 15:16:59 +0200 Subject: [PATCH 0300/2153] feat(types): add typings for bell --- types/bell/bell-tests.ts | 110 ++++++++++++++++ types/bell/index.d.ts | 273 +++++++++++++++++++++++++++++++++++++++ types/bell/tsconfig.json | 23 ++++ types/bell/tslint.json | 6 + 4 files changed, 412 insertions(+) create mode 100644 types/bell/bell-tests.ts create mode 100644 types/bell/index.d.ts create mode 100644 types/bell/tsconfig.json create mode 100644 types/bell/tslint.json diff --git a/types/bell/bell-tests.ts b/types/bell/bell-tests.ts new file mode 100644 index 0000000000..f8821f22ad --- /dev/null +++ b/types/bell/bell-tests.ts @@ -0,0 +1,110 @@ +import { RequestQuery, Server } from 'hapi'; +import * as bell from 'bell'; + +async function run() { + const server = new Server({ port: 8000 }); + await server.register(bell); + + // You'll need to go to https://developers.arcgis.com/en/applications and set up an application to get started + // Once you create your app you will get your ClientID and Client Secret. + // Also be sure to set redirect URL as well at the bottom of the screen in Redirect URIs section. + + server.auth.strategy('arcgisonline', 'bell', { + provider: 'twitter', + password: 'some cookie password', + location: 'http://example.com/oauth', + clientId: '', + clientSecret: '', + scope(request) { + const scopes = ['public_profile', 'email']; + if (( request.query).wantsSharePermission) { + scopes.push('publish_actions'); + } + return scopes; + } + }); + + const providers: bell.BellOptions[] = [{ + provider: 'discord', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '', + location: () => '', + }, + { + provider: 'facebook', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '', + location: server.info.uri + }, + { + provider: 'google', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '', + location: server.info.uri + }, + { + provider: 'linkedin', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '', + providerParams: { + redirect_uri: server.info.uri + '/bell/door' + } + }, + { + provider: 'meetup', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '', + scope: ['basic', 'ageless', 'group_edit', 'reporting'], + }, + { + provider: 'nest', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '' + }, + { + provider: 'office365', + clientId: '', + clientSecret: '', + password: 'cookie_encryption_password_secure', + providerParams: { + response_type: 'code' + }, + scope: ['openid', 'offline_access', 'profile'] + }, + { + provider: 'okta', + config: { uri: 'https://your-organization.okta.com' }, + password: 'cookie_encryption_password_secure', + isSecure: false, + location: 'http://127.0.0.1:8000', + clientId: '', + clientSecret: '' + }, + { + provider: 'slack', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '' + }, + { + provider: 'twitch', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '', + scope: ['user_read', 'channel_read'] + }]; +} diff --git a/types/bell/index.d.ts b/types/bell/index.d.ts new file mode 100644 index 0000000000..2af331b2b9 --- /dev/null +++ b/types/bell/index.d.ts @@ -0,0 +1,273 @@ +// Type definitions for bell 9.1 +// Project: https://github.com/hapijs/bell +// Definitions by: Simon Schick +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +import { Server, Request, Plugin, AuthCredentials } from 'hapi'; + +declare module 'hapi' { + interface ServerAuth { + strategy(name: string, scheme: 'bell', options: BellOptions): void; + strategy( + name: string, + scheme: 'bell', + mode: boolean | 'required' | 'optional' | 'try', + options: BellOptions, + ): void; + } +} + +export interface StringLikeMap { + [key: string]: string | number; +} +export type Provider = + 'arcgisonline' | + 'auth0' | + 'azuread' | + 'bitbucket' | + 'digitalocean' | + 'discord' | + 'dropbox' | + 'dropboxV2' | + 'facebook' | + 'fitbit' | + 'foursquare' | + 'github' | + 'gitlab' | + 'google' | + 'googleplus' | + 'instagram' | + 'linkedin' | + 'live' | + 'medium' | + 'meetup' | + 'mixer' | + 'nest' | + 'office365' | + 'okta' | + 'phabricator' | + 'pingfed' | + 'pinterest' | + 'reddit' | + 'salesforce' | + 'slack' | + 'spotify' | + 'stripe' | + 'trakt' | + 'tumblr' | + 'twitch' | + 'twitter' | + 'vk' | + 'wordpress' | + 'yahoo'; + +export type RequestPassThrough = ( + request: Request, + next: (err: Error | null, credentials: AuthCredentials) => void, +) => void; + +export interface OptionalOptions { + /** + * the name of the cookie used to manage the temporary state. + * Defaults to 'bell-provider' where 'provider' is the provider name (or 'custom' for custom providers). + * For example, the Twitter cookie name defaults to 'bell-twitter'. + */ + cookie?: string; + /** + * sets the cookie secure flag. + * Defaults to true. + */ + isSecure?: boolean; + /** + * sets the cookie HTTP only flag. + * Defaults to true. + */ + isHttpOnly?: boolean; + /** + * cookie time-to-live in milliseconds. + * Defaults to null (session time-life - cookies are deleted when the browser is closed). + */ + ttl?: number; + /** + * the domain scope. + * Defaults to null (no domain). + */ + domain?: string; + /** + * provider-specific query parameters for the authentication endpoint. + * It may be passed either as an object to merge into the query string, + * or a function which takes the client's request and returns an object. + * Each provider supports its own set of parameters which customize the user's login experience. + * For example: + * * Facebook supports `display` ('page', 'popup', or 'touch'), `auth_type`, `auth_nonce`. + * * Google supports `access_type`, `approval_prompt`, `prompt`, `login_hint`, `user_id`, `hd`. + * * Twitter supports `force_login`, `screen_name`. + * * Linkedin supports `fields`. + */ + providerParams?: StringLikeMap | ((request: Request) => StringLikeMap); + /** + * allows passing query parameters from a bell protected endpoint to the auth request. + * It will merge the query params you pass along with the providerParams and any other predefined ones. + * Be aware that this will override predefined query parameters! + * Default to false. + */ + allowRuntimeProviderParams?: StringLikeMap | boolean; + /** + * Each built-in vendor comes with the required scope for basic profile information. + * Use scope to specify a different scope as required by your application. + * It may be passed either as an object to merge into the query string, + * or a function which takes the client's request and returns an object. + * Consult the provider for their specific supported scopes. + */ + scope?: string[] | ((request: Request) => string[]); + /** + * skips obtaining a user profile from the provider. + * Useful if you need specific scopes, + * but not the user profile. + * Defaults to false. + */ + skipProfile?: boolean; + /** + * a configuration object used to customize the provider settings. + * The built-in 'twitter' provider accepts the `extendedProfile` & `getMethod` options. + * option which allows disabling the extra profile request when the provider + * returns the user information in the callback (defaults to true). + * The built-in 'github' and 'phabricator' providers accept the uri + * option which allows pointing to a private enterprise installation (e.g. 'https://vpn.example.com'). + * See Providers documentation for more information. + */ + config?: { extendedProfile?: boolean; getMethod?: string } | { uri?: string }; + /** + * an object of key-value pairs that specify additional + * URL query parameters to send with the profile request to the provider. + * The built-in facebook provider, + * for example, could have fields specified to determine the fields returned from the user's graph, + * which would then be available to you in the auth.credentials.profile.raw object. + */ + profileParams?: StringLikeMap; + /** + * allows passing additional OAuth state from initial request. + * This must be a function returning a string, + * which will be appended to the bell internal state parameter for OAuth code flow. + */ + runtimeStateCallback?(req: Request): string; + + // THESE ARE IN THE *REQUIRED* section but are actually not... + /** + * A boolean indicating whether or not you want the redirect_uri to be forced to https. + * Useful if your hapi application runs as http, but is accessed through https. + */ + forceHttps?: boolean; + /** + * Set the base redirect_uri manually if it cannot be inferred properly from server settings. + * Useful to override port, protocol, and host if proxied or forwarded. + */ + location?: string | ((req: Request) => string); +} + +export interface RequiredProviderOptions { + /** + * the cookie encryption password. + * Used to encrypt the temporary state cookie used by the module in + * between the authorization protocol steps. + */ + password: string; + /** + * the OAuth client identifier (consumer key). + */ + clientId: string; + /** + * the OAuth client secret (consumer secret) + */ + clientSecret: string; +} + +export interface KnownProviderOptions extends RequiredProviderOptions, OptionalOptions { + provider: Provider; +} + +/** + * @param uri the requested resource URI (bell will add the token or authentication header as needed). + * @param params any URI query parameters (cannot include them in the URI due to signature requirements). + */ +export type AuthedRequest = (uri: string, params: { [key: string]: string } | null) => Promise; + +export interface CustomProtocol { + /** + * the authorization protocol used. + */ + protocol: 'oauth' | 'oauth2'; + /** + * the OAuth signature method (OAuth 1.0a only). Must be one of: + * * 'HMAC-SHA1' - default + * * 'RSA-SHA1' - in that case, the clientSecret is your RSA private key + */ + signatureMethod?: 'HMAC-SHA1' | 'RSA-SHA1'; + /** + * the temporary credentials (request token) endpoint (OAuth 1.0a only). + */ + temporary?: string; + /** + * boolean that determines if OAuth client id and client secret will be sent + * as parameters as opposed to an Authorization header (OAuth 2.0 only). + * Defaults to false. + */ + useParamsAuth?: boolean; + /** + * the authorization endpoint URI. + */ + auth: string; + /** + * the access token endpoint URI. + */ + token: string; + /** + * the OAuth version. + */ + version?: string; + /** + * an array of scope strings (OAuth 2.0 only). + */ + scope?: string[] | ((query: StringLikeMap) => string[]); + /** + * the scope separator character (OAuth 2.0 only). Only required when a provider has a broken OAuth 2.0 implementation. Defaults to space (Facebook and GitHub default to comma). + */ + scopeSeparator?: string; + /** + * a headers object with additional headers required by the provider + * (e.g. GitHub required the 'User-Agent' header which is set by default). + */ + headers?: { + [key: string]: string; + }; + /** + * a function used to obtain user profile information and normalize it. + * @param credentials the credentials object. + * Change the object directly within the function (profile information is typically stored under credentials.profile). + * @param params the parsed information received from the provider (e.g. token, secret, and other custom fields). + * @param get an OAuth helper function to make authenticated requests using the credentials received. + */ + profile(credentials: any, params: { [key: string]: string }, get: AuthedRequest): Promise; +} + +export interface CustomProviderOptions extends RequiredProviderOptions, OptionalOptions { + provider: CustomProtocol; +} + +export type BellOptions = CustomProviderOptions | KnownProviderOptions; + +export const plugin: Plugin; +/* + * [See docs](https://github.com/hapijs/bell/blob/master/API.md#simulated-authentication) + */ + +/** + * Enables simulation mode. + */ +export function simulate(credentialsFunc: RequestPassThrough): void; +/** + * [See docs](https://github.com/hapijs/bell/blob/master/API.md#simulated-authentication) + * Disables simulation mode + */ +export function simulate(state: false): void; diff --git a/types/bell/tsconfig.json b/types/bell/tsconfig.json new file mode 100644 index 0000000000..4db30822b8 --- /dev/null +++ b/types/bell/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "strictFunctionTypes": true, + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitThis": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "bell-tests.ts" + ] +} diff --git a/types/bell/tslint.json b/types/bell/tslint.json new file mode 100644 index 0000000000..843d627f89 --- /dev/null +++ b/types/bell/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "unified-signatures": false // Disabling as it prevents me from using overloaded doctags + } +} From 17120c6111c99836e4a18b90f4c8c94817812117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20L=C3=B3pez?= Date: Wed, 28 Mar 2018 15:20:43 +0200 Subject: [PATCH 0301/2153] Add PolymerSplice and ArraySplice to the Polymer typings --- types/polymer/index.d.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/types/polymer/index.d.ts b/types/polymer/index.d.ts index eee6a6250f..936d3362f4 100644 --- a/types/polymer/index.d.ts +++ b/types/polymer/index.d.ts @@ -312,6 +312,18 @@ declare global { whenReady(cb: Function): void; } + interface PolymerSplice { + index: number; + removed: Array<{}>; + addedCount: number; + object: Array<{}>; + type: string; + } + + interface ArraySplice { + calculateSplices(current: ReadonlyArray, previous: ReadonlyArray): PolymerSplice[]; + } + interface ImportStatus extends RenderStatus { whenLoaded(cb: Function): void; } From 73f9ae00860eba66bcccae3a0a692eb2ec16d637 Mon Sep 17 00:00:00 2001 From: Ruben Date: Wed, 28 Mar 2018 15:24:51 +0200 Subject: [PATCH 0302/2153] Added ArraySplice to PolymerStatic, so it's available under Polymer.ArraySplice at runtime. --- types/polymer/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/polymer/index.d.ts b/types/polymer/index.d.ts index 936d3362f4..c206c08927 100644 --- a/types/polymer/index.d.ts +++ b/types/polymer/index.d.ts @@ -341,6 +341,8 @@ declare global { RenderStatus: RenderStatus + ArraySplice: ArraySplice; + /** @deprecated */ ImportStatus: ImportStatus } From c1fa2b114c40bcc7c84b0209cd18709694897950 Mon Sep 17 00:00:00 2001 From: Simon Schick Date: Wed, 28 Mar 2018 15:28:45 +0200 Subject: [PATCH 0303/2153] fixup! feat(types): add typings for bell --- types/bell/bell-tests.ts | 4 ---- types/bell/index.d.ts | 4 ---- 2 files changed, 8 deletions(-) diff --git a/types/bell/bell-tests.ts b/types/bell/bell-tests.ts index f8821f22ad..65b3e5f4d5 100644 --- a/types/bell/bell-tests.ts +++ b/types/bell/bell-tests.ts @@ -5,10 +5,6 @@ async function run() { const server = new Server({ port: 8000 }); await server.register(bell); - // You'll need to go to https://developers.arcgis.com/en/applications and set up an application to get started - // Once you create your app you will get your ClientID and Client Secret. - // Also be sure to set redirect URL as well at the bottom of the screen in Redirect URIs section. - server.auth.strategy('arcgisonline', 'bell', { provider: 'twitter', password: 'some cookie password', diff --git a/types/bell/index.d.ts b/types/bell/index.d.ts index 2af331b2b9..14cdc65cb9 100644 --- a/types/bell/index.d.ts +++ b/types/bell/index.d.ts @@ -258,10 +258,6 @@ export interface CustomProviderOptions extends RequiredProviderOptions, Optional export type BellOptions = CustomProviderOptions | KnownProviderOptions; export const plugin: Plugin; -/* - * [See docs](https://github.com/hapijs/bell/blob/master/API.md#simulated-authentication) - */ - /** * Enables simulation mode. */ From d87aadbf306bb63f210d4e33c99d11bab45f567b Mon Sep 17 00:00:00 2001 From: Christian Rackerseder Date: Wed, 28 Mar 2018 15:37:13 +0200 Subject: [PATCH 0304/2153] Added types for enquire.js --- types/enquire.js/enquire.js-tests.ts | 17 +++++++++++ types/enquire.js/index.d.ts | 43 ++++++++++++++++++++++++++++ types/enquire.js/tsconfig.json | 23 +++++++++++++++ types/enquire.js/tslint.json | 1 + 4 files changed, 84 insertions(+) create mode 100644 types/enquire.js/enquire.js-tests.ts create mode 100644 types/enquire.js/index.d.ts create mode 100644 types/enquire.js/tsconfig.json create mode 100644 types/enquire.js/tslint.json diff --git a/types/enquire.js/enquire.js-tests.ts b/types/enquire.js/enquire.js-tests.ts new file mode 100644 index 0000000000..7fce0dd571 --- /dev/null +++ b/types/enquire.js/enquire.js-tests.ts @@ -0,0 +1,17 @@ +import * as enquire from 'enquire.js'; + +enquire + .register('(min-width: 300px) and (max-width: 600px)', { + deferSetup: true, + match: () => {}, + unmatch: () => {}, + setup: () => {}, + destroy: () => {} + }) + .register('(min-width: 300px) and (max-width: 600px)', {}); + +enquire.register('(min-width: 300px) and (max-width: 600px)', [{}, {}], true); + +enquire.register('(min-width: 300px) and (max-width: 600px)', () => {}, true); + +enquire.unregister('(min-width: 300px) and (max-width: 600px)'); diff --git a/types/enquire.js/index.d.ts b/types/enquire.js/index.d.ts new file mode 100644 index 0000000000..d7dcafdc30 --- /dev/null +++ b/types/enquire.js/index.d.ts @@ -0,0 +1,43 @@ +// Type definitions for enquire.js 2.1 +// Project: https://github.com/WickyNilliams/enquire.js/ +// Definitions by: Christian Rackerseder +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +interface Options { + /** + * If set to true, defers execution of the setup function until the first time the media query is matched + */ + deferSetup?: boolean; + /** + * If supplied, triggered when a media query matches. + */ + match?(): void; + /** + * If supplied, triggered when the media query transitions from a matched state to an unmatched state. + */ + unmatch?(): void; + /** + * If supplied, triggered once, when the handler is registered. + */ + setup?(): void; + + /** + * If supplied, triggered when handler is unregistered. Place cleanup code here + */ + destroy?(): void; +} + +type Callback = () => void; + +interface EnquireJs { + register( + mediaQuery: string, + options: Options | Options[] | Callback, + shouldDegrade?: boolean, + ): EnquireJs; + unregister(mediaQuery: string, handler?: Callback | Options): void; +} + +declare const enquire: EnquireJs; +export = enquire; diff --git a/types/enquire.js/tsconfig.json b/types/enquire.js/tsconfig.json new file mode 100644 index 0000000000..ffbd13d6e2 --- /dev/null +++ b/types/enquire.js/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "enquire.js-tests.ts" + ] +} diff --git a/types/enquire.js/tslint.json b/types/enquire.js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/enquire.js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From c8b901e452b99fbba8ba3dca6801634e6ac3e64b Mon Sep 17 00:00:00 2001 From: Ruben Date: Wed, 28 Mar 2018 15:51:09 +0200 Subject: [PATCH 0305/2153] Include the notifySplices method, and also add a trivial test for the ArraySplice function with mutable and immutable arrays. --- types/polymer/index.d.ts | 2 ++ types/polymer/polymer-tests.ts | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/types/polymer/index.d.ts b/types/polymer/index.d.ts index c206c08927..a4eca3e70b 100644 --- a/types/polymer/index.d.ts +++ b/types/polymer/index.d.ts @@ -139,6 +139,8 @@ declare global { unshift?(path: string, ...item: any[]): number; + notifySplices?(path: string, splices: ReadonlyArray): void; + // ResolveUrl resolveUrl?(url: string): string; diff --git a/types/polymer/polymer-tests.ts b/types/polymer/polymer-tests.ts index dcad66f871..2b6631ffb7 100644 --- a/types/polymer/polymer-tests.ts +++ b/types/polymer/polymer-tests.ts @@ -82,3 +82,11 @@ class MyElement3 implements polymer.Base { } Polymer(MyElement3); + +// Test splice computation +const splices: polymer.PolymerSplice[] = Polymer.ArraySplice.calculateSplices( + [1,2,3], [1,2]); + +// Test that readonly arrays also work. +const splices2: polymer.PolymerSplice[] = Polymer.ArraySplice.calculateSplices( + Object.freeze([1,2,3]), Object.freeze([1,2])); From bf57bd768bcc45f01356c4f5816a4ab5a2a6f06c Mon Sep 17 00:00:00 2001 From: Feirell Date: Wed, 28 Mar 2018 17:03:24 +0200 Subject: [PATCH 0306/2153] Added PlaneHelper in three-core.d.ts --- types/three/three-core.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 5317e38396..8d153a65bc 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -7442,6 +7442,15 @@ export class VertexNormalsHelper extends LineSegments { update(object?: Object3D): void; } +export class PlaneHelper extends LineSegments { + constructor(plane: Plane, size?: number, hex?: number); + + plane: Plane; + size: number; + + updateMatrixWorld(force: boolean): void; +} + /** * @deprecated Use {@link WireframeGeometry THREE.WireframeGeometry} instead. */ From f5da07c596079918095a5b3af7d104488fe05f81 Mon Sep 17 00:00:00 2001 From: Christian Rackerseder Date: Wed, 28 Mar 2018 19:49:44 +0200 Subject: [PATCH 0307/2153] Fixed import in test --- types/enquire.js/enquire.js-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/enquire.js/enquire.js-tests.ts b/types/enquire.js/enquire.js-tests.ts index 7fce0dd571..a11ba053c2 100644 --- a/types/enquire.js/enquire.js-tests.ts +++ b/types/enquire.js/enquire.js-tests.ts @@ -1,4 +1,4 @@ -import * as enquire from 'enquire.js'; +import enquire = require('enquire.js'); enquire .register('(min-width: 300px) and (max-width: 600px)', { From cc06c0bd237623a251bbd41fe4696321533e7a3b Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 28 Mar 2018 11:13:16 -0700 Subject: [PATCH 0308/2153] Update react-flatpickr with flatpickr's new exports It switched to a default export that contains nested-nested types. --- types/react-flatpickr/index.d.ts | 6 +++--- types/react-flatpickr/react-flatpickr-tests.tsx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/types/react-flatpickr/index.d.ts b/types/react-flatpickr/index.d.ts index 68d79a2b6c..9683835e32 100644 --- a/types/react-flatpickr/index.d.ts +++ b/types/react-flatpickr/index.d.ts @@ -5,12 +5,12 @@ // TypeScript Version: 2.6 import { Component } from 'react'; -import { Options } from 'flatpickr'; +import flatpickr from 'flatpickr'; export interface DateTimePickerProps { defaultValue?: string; - options?: Options.Options; - onChange?: Options.Hook; + options?: flatpickr.Options.Options; + onChange?: flatpickr.Options.Hook; value?: string; } diff --git a/types/react-flatpickr/react-flatpickr-tests.tsx b/types/react-flatpickr/react-flatpickr-tests.tsx index c3dc0f4adc..fbbb6f45a7 100644 --- a/types/react-flatpickr/react-flatpickr-tests.tsx +++ b/types/react-flatpickr/react-flatpickr-tests.tsx @@ -1,4 +1,4 @@ -import { Instance } from 'flatpickr'; +import flatpickr from 'flatpickr'; import * as React from 'react'; import DatePicker from 'react-flatpickr'; @@ -12,7 +12,7 @@ const options = { const optionsElement = ; const onChange = ( - selectedDates: Date[], dateStr: string, instance: Instance, + selectedDates: Date[], dateStr: string, instance: flatpickr.Instance, elem: HTMLElement ) => null; const onChangeElement = ; From 6cbc3a5006231ed33094cec162bf1e783f9cf51e Mon Sep 17 00:00:00 2001 From: emzeroit Date: Wed, 28 Mar 2018 15:40:28 -0300 Subject: [PATCH 0309/2153] Added session property to strategy options --- types/passport-local/index.d.ts | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/types/passport-local/index.d.ts b/types/passport-local/index.d.ts index 2fe5bde949..9555046fed 100644 --- a/types/passport-local/index.d.ts +++ b/types/passport-local/index.d.ts @@ -6,20 +6,20 @@ /// - - -import { Strategy as PassportStrategy } from 'passport-strategy'; -import express = require('express'); +import { Strategy as PassportStrategy } from "passport-strategy"; +import express = require("express"); interface IStrategyOptions { usernameField?: string; passwordField?: string; + session?: boolean; passReqToCallback?: false; } interface IStrategyOptionsWithRequest { usernameField?: string; passwordField?: string; + session?: boolean; passReqToCallback: true; } @@ -28,15 +28,27 @@ interface IVerifyOptions { } interface VerifyFunctionWithRequest { - (req: express.Request, username: string, password: string, done: (error: any, user?: any, options?: IVerifyOptions) => void): void; + ( + req: express.Request, + username: string, + password: string, + done: (error: any, user?: any, options?: IVerifyOptions) => void + ): void; } interface VerifyFunction { - (username: string, password: string, done: (error: any, user?: any, options?: IVerifyOptions) => void): void; + ( + username: string, + password: string, + done: (error: any, user?: any, options?: IVerifyOptions) => void + ): void; } declare class Strategy extends PassportStrategy { - constructor(options: IStrategyOptionsWithRequest, verify: VerifyFunctionWithRequest); + constructor( + options: IStrategyOptionsWithRequest, + verify: VerifyFunctionWithRequest + ); constructor(options: IStrategyOptions, verify: VerifyFunction); constructor(verify: VerifyFunction); From 5c35553087fe172fbef3c1c5b10378c731e14d41 Mon Sep 17 00:00:00 2001 From: bmartinson Date: Wed, 28 Mar 2018 12:36:52 -0700 Subject: [PATCH 0310/2153] Add getActiveObjects Definition for fabric.Canvas --- types/fabric/fabric-impl.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/fabric/fabric-impl.d.ts b/types/fabric/fabric-impl.d.ts index 397ea8984a..31509435a5 100644 --- a/types/fabric/fabric-impl.d.ts +++ b/types/fabric/fabric-impl.d.ts @@ -1427,6 +1427,11 @@ export class Canvas { * @return active object */ getActiveObject(): Object; + /** + * Returns an array with the current selected objects + * @return {Object[]} array of active objects + */ + getActiveObjects(): Object[]; /** * Returns pointer coordinates relative to canvas. * @return object with "x" and "y" number values From 083f4fcee8e23b6f3c692ea21490a75aedd0c400 Mon Sep 17 00:00:00 2001 From: Ricardo de pena Date: Wed, 28 Mar 2018 15:52:15 -0400 Subject: [PATCH 0311/2153] Fixed lint issues --- types/openfin/index.d.ts | 74 ++++++++++++++++----------------- types/openfin/openfin-tests.ts | 41 +++++++++--------- types/openfin/tsconfig.json | 5 --- types/openfin/v17/tsconfig.json | 7 +++- 4 files changed, 65 insertions(+), 62 deletions(-) diff --git a/types/openfin/index.d.ts b/types/openfin/index.d.ts index 3ddbdf2edd..9428247938 100644 --- a/types/openfin/index.d.ts +++ b/types/openfin/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for OpenFin API 29.0 // Project: https://openfin.co/ // Definitions by: Chris Barker +// Ricardo de Pena // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // based on v8.56.29.51 @@ -641,8 +642,8 @@ declare namespace fin { /** * Download preload scripts from given URLs */ - downloadPreloadScripts(scripts: Array, callback?: (downloadInfo: Array) => void, - errorCallback?: (reason: string) => void): void; + downloadPreloadScripts(scripts: DownloadPreloadOption[], callback?: (downloadInfo: DownloadPreloadInfo[]) => void, + errorCallback?: (reason: string) => void): void; /** * Downloads the given OpenFin Runtime. */ @@ -674,7 +675,7 @@ declare namespace fin { /** * Get additional info of cookies. */ - getCookies(option: CookieOption, callback?: (info: Array) => void, errorCallback?: (reason: string) => void): void; + getCookies(option: CookieOption, callback?: (info: CookieInfo[]) => void, errorCallback?: (reason: string) => void): void; /** * Retrieves the command line argument string that started OpenFin Runtime. */ @@ -870,19 +871,18 @@ declare namespace fin { interface DownloadPreloadInfo { success: boolean; - url?: string; - error: string; - } + url?: string; + error: string; + } - - interface CookieInfo { + interface CookieInfo { name: string; // expirationDate: Date; domain: string; path: string; } - interface CookieOption { + interface CookieOption { name: string; } @@ -1145,8 +1145,8 @@ declare namespace fin { */ uuid?: string; /* - * Process exit code - */ + * Process exit code + */ exitCode?: number; }): void; } @@ -1215,13 +1215,13 @@ declare namespace fin { addEventListener( type: OpenFinWindowEventType, listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Performs the specified window transitions @@ -1335,13 +1335,13 @@ declare namespace fin { removeEventListener( type: OpenFinWindowEventType, listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; /** @@ -1466,17 +1466,17 @@ declare namespace fin { virtualScreen: MontiorCoordinates; } - interface TrayIconInfo { - x: number; - y: number; - bounds: { - x: number; - y: number; - width: number; - height: number; - } - monitorInfo: MonitorInfo - } + interface TrayIconInfo { + x: number; + y: number; + bounds: { + x: number; + y: number; + width: number; + height: number; + }; + monitorInfo: MonitorInfo; + } interface MonitorInfoDetail { availableRect: MontiorCoordinates; @@ -1784,7 +1784,7 @@ declare namespace fin { parent: { uuid: string; name: string; - } + }; } interface SessionChangedEvent { diff --git a/types/openfin/openfin-tests.ts b/types/openfin/openfin-tests.ts index 2b5237c1e8..6059f54de7 100644 --- a/types/openfin/openfin-tests.ts +++ b/types/openfin/openfin-tests.ts @@ -19,7 +19,7 @@ function test_application() { }, (error) => { console.log("Error creating application:", error); }); - //createFromManifest + // createFromManifest fin.desktop.Application.createFromManifest("http://stuf.com/app.json", (app) => { console.log(app.uuid); }, err => console.log(err)); @@ -88,8 +88,9 @@ function test_application() { // registerCustomData application.registerUser("a", "b", () => console.log("done"), err => console.log(err)); // removeEventListener - const previousCallback = (event: fin.WindowEvent) => { }; - application.removeEventListener("closed", previousCallback, () => { + application.removeEventListener("closed", (event: any) => { + console.log(event); + }, () => { console.log("The unregistration was successful"); }, err => { console.log("failure:", err); @@ -133,8 +134,8 @@ function test_application() { console.log("waiting for hung application"); application.wait(); }); - //uuid - let hasUuid = application.uuid; + // uuid + const hasUuid = application.uuid; } function test_external_application() { @@ -281,7 +282,7 @@ function test_system() { }, err => { console.log("failure: " + err); }); - //flushCookieStore + // flushCookieStore fin.desktop.System.flushCookieStore(() => { console.log('successful'); }, err => { @@ -317,7 +318,7 @@ function test_system() { fin.desktop.System.getCommandLineArguments(args => { console.log("The command line arguments are " + args); }); - //getCookieInfo + // getCookieInfo fin.desktop.System.getCookies({ name: 'myCookie1'}, cookies => { const cookie1 = cookies[0]; console.log(cookie1.name, cookie1.domain, cookie1.path); @@ -356,7 +357,7 @@ function test_system() { console.log(`The filename of the log is ${logInfo.name}, the size is ${logInfo.size}, and the date of creation is ${logInfo.date}`); }); }); - //getMinLogLevel + // getMinLogLevel fin.desktop.System.getMinLogLevel(level => console.log(level), err => console.log(err)); // getMonitorInfo fin.desktop.System.getMonitorInfo(monitorInfo => { @@ -399,7 +400,7 @@ function test_system() { }, error => { console.log('Error:', error); }); - // + // launch external process with an alias fin.desktop.System.launchExternalProcess({ // Additionally note that the executable found in the zip file specified in appAssets // will default to the one mentioned by appAssets.target @@ -491,14 +492,15 @@ function test_system() { }); }); // removeEventListener - const aRegisteredListener = (event: fin.SystemBaseEvent) => { }; - fin.desktop.System.removeEventListener("monitor-info-changed", aRegisteredListener, () => { + fin.desktop.System.removeEventListener("monitor-info-changed", (event) => { + console.log(event); + }, () => { console.log("successful"); - }, err => { + }, (err: any) => { console.log("failure: " + err); }); - //setMinLogLevel - fin.desktop.System.setMinLogLevel("log level", () => console.log('Success'), err => console.error(err)); + // setMinLogLevel + fin.desktop.System.setMinLogLevel("log level", () => console.log('Success'), (err: any) => console.error(err)); // showDeveloperTools fin.desktop.System.showDeveloperTools("uuid", "name", () => { console.log("successful"); @@ -750,8 +752,9 @@ function test_window() { // moveTo finWindow.moveTo(100, 200); // removeEventListener - const aRegisteredListener = (event: fin.WindowBaseEvent) => { }; - finWindow.removeEventListener("bounds-changed", aRegisteredListener); + finWindow.removeEventListener("bounds-changed", event => { + console.log(event); + }); // resizeBy finWindow.resizeBy(10, 10, "top-right"); // resizeTo @@ -778,13 +781,13 @@ function test_window() { } function test_frame() { - //wrap + // wrap const frame = fin.desktop.Frame.wrap('uuid', 'name'); - //getCurrent + // getCurrent const currentFrame = fin.desktop.Frame.getCurrent(); // addEventlistener frame.addEventListener('event', () => console.log('on event'), () => console.log('success'), err => console.error(err)); - //removeEventListener + // removeEventListener frame.removeEventListener('event', () => console.log('on event'), () => console.log('success'), err => console.error(err)); // getInfo frame.getInfo(info => { diff --git a/types/openfin/tsconfig.json b/types/openfin/tsconfig.json index df2dae8b79..5299a11917 100644 --- a/types/openfin/tsconfig.json +++ b/types/openfin/tsconfig.json @@ -14,11 +14,6 @@ "../" ], "types": [], - "paths": { - "openfin": [ - "openfin/v29" - ] - }, "noEmit": true, "forceConsistentCasingInFileNames": true }, diff --git a/types/openfin/v17/tsconfig.json b/types/openfin/v17/tsconfig.json index fd3199ceb7..f2ec7a21dc 100644 --- a/types/openfin/v17/tsconfig.json +++ b/types/openfin/v17/tsconfig.json @@ -14,6 +14,11 @@ "../" ], "types": [], + "paths": { + "openfin": [ + "openfin/v17" + ] + }, "noEmit": true, "forceConsistentCasingInFileNames": true }, @@ -21,4 +26,4 @@ "index.d.ts", "openfin-tests.ts" ] -} \ No newline at end of file +} From 27c85093ade7cf97873fa40e5d03d176ee8e3aea Mon Sep 17 00:00:00 2001 From: CodeAnimal Date: Wed, 28 Mar 2018 20:54:12 +0100 Subject: [PATCH 0312/2153] Add prorate option to subscription creation options with tests --- types/stripe/index.d.ts | 6 ++++++ types/stripe/stripe-tests.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index 361ee4c86b..71396c0183 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -4470,6 +4470,12 @@ declare namespace Stripe { * with month or year intervals, the day of the month for subsequent invoices. */ billing_cycle_anchor?: number; + + /** + * Boolean (default true). Use with a billing_cycle_anchor timestamp to determine whether the customer will be invoiced a prorated amount until + * the anchor date. If false, the anchor period will be free (similar to a trial). + */ + prorate?: boolean; } interface ISubscriptionCreationOptions extends ISubscriptionCustCreationOptions { diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index 1e7b47a3c7..3642645118 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -252,7 +252,7 @@ stripe.customers.create({ customer.cards.del("card_17xMvXBoqMA9o2xkq6W5gamx").then(function (confirmation) {}); customer.subscriptions.create({ items: [{ plan: "gold" }], trial_period_days: 7 }).then(function (subscription) { }); - customer.subscriptions.create({ items: [{ plan: "gold" }], trial_end: "now", billing_cycle_anchor: 1516881177 }).then(function (subscription) { }); + customer.subscriptions.create({ items: [{ plan: "gold" }], trial_end: "now", billing_cycle_anchor: 1516881177, prorate: true }).then(function (subscription) { }); customer.subscriptions.create({ items: [{ plan: "gold" }], trial_end: 1516881177, billing: "send_invoice", days_until_due: 7 }).then(function (subscription) { }); customer.subscriptions.create({ items: [{ plan: "gold" }], billing: "charge_automatically" }).then(function (subscription) { }); customer.subscriptions.retrieve("sub_8Eluur5KoIKxuy").then(function (subscription) { From 47c0bffc9a7f6346bcc4b2dcd70b31e14935cb72 Mon Sep 17 00:00:00 2001 From: bmartinson Date: Wed, 28 Mar 2018 13:00:29 -0700 Subject: [PATCH 0313/2153] Update Tests and Documentation --- types/fabric/index.d.ts | 1 + types/fabric/test/index.ts | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/types/fabric/index.d.ts b/types/fabric/index.d.ts index a0fa06629e..38277c5708 100644 --- a/types/fabric/index.d.ts +++ b/types/fabric/index.d.ts @@ -4,6 +4,7 @@ // Joseph Livecchi // Michael Randolph // Tiger Oakes +// Brian Martinson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 export import fabric = require("./fabric-impl"); diff --git a/types/fabric/test/index.ts b/types/fabric/test/index.ts index 0f51499c0b..dfdaafce06 100644 --- a/types/fabric/test/index.ts +++ b/types/fabric/test/index.ts @@ -1032,3 +1032,32 @@ function sample9() { canvas.setBackgroundImage('yolo.jpg', () => { "a"; }, { opacity: 45 }); canvas.setBackgroundImage('yolo.jpg', () => { "a"; }); } + +function sample10() { + const canvas = new fabric.Canvas('c'); + const objR = new fabric.Rect({ + top: 10, + left: 10, + width: 10, + height: 10, + fill: "#FF0000", + }); + const objG = new fabric.Rect({ + top: 15, + left: 15, + width: 10, + height: 10, + fill: "#00FF00", + }); + const objB = new fabric.Rect({ + top: 20, + left: 20, + width: 10, + height: 10, + fill: "#0000FF", + }); + canvas.add(objR); + canvas.add(objG); + canvas.add(objB); + const objArray = canvas.getActiveObjects(); +} From 5bfc432d9643d487a95addf4627d42bcdb3752e7 Mon Sep 17 00:00:00 2001 From: Ricardo de pena Date: Wed, 28 Mar 2018 16:18:46 -0400 Subject: [PATCH 0314/2153] Fixed base url for .17 --- types/openfin/v17/tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/openfin/v17/tsconfig.json b/types/openfin/v17/tsconfig.json index f2ec7a21dc..5f07a9e025 100644 --- a/types/openfin/v17/tsconfig.json +++ b/types/openfin/v17/tsconfig.json @@ -9,9 +9,9 @@ "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": false, - "baseUrl": "../", + "baseUrl": "../../", "typeRoots": [ - "../" + "../../" ], "types": [], "paths": { From f52ee65b221bfefeb5f209a4e8e4f6cd9444348e Mon Sep 17 00:00:00 2001 From: CodeAnimal Date: Thu, 29 Mar 2018 00:56:19 +0100 Subject: [PATCH 0315/2153] Add `cancel_at_period_end` option to sub update https://stripe.com/docs/api#update_subscription-cancel_at_period_end --- types/stripe/index.d.ts | 5 +++++ types/stripe/stripe-tests.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index 71396c0183..c43e3357a5 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -4562,6 +4562,11 @@ declare namespace Stripe { * String, unchanged (default) or now. This allows you to reset the billing cycle of a subscription. */ billing_cycle_anchor?: "unchanged" | "now"; + + /** + * Boolean indicating whether this subscription should cancel at the end of the current period. + */ + cancel_at_period_end?: boolean; } interface ISubscriptionCancellationOptions extends IDataOptions { diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index 3642645118..7a45ee9fca 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -259,7 +259,7 @@ stripe.customers.create({ customer.subscriptions.update("sub_8Eluur5KoIKxuy", { items: [{ id: subscription.items.data[0].id, plan: "silver" }] }).then(function (subscription) { }); }); customer.subscriptions.update("sub_8Eluur5KoIKxuy", { trial_end: "now", billing_cycle_anchor: "now" }); - customer.subscriptions.update("sub_8Eluur5KoIKxuy", { trial_end: 1516881177, billing: "send_invoice", days_until_due: 7, billing_cycle_anchor: "unchanged" }); + customer.subscriptions.update("sub_8Eluur5KoIKxuy", { trial_end: 1516881177, billing: "send_invoice", days_until_due: 7, billing_cycle_anchor: "unchanged", cancel_at_period_end: false }); customer.subscriptions.list().then(function (subscriptions) { }); customer.subscriptions.del("sub_8Eluur5KoIKxuy").then(function (subscription) { }); customer.subscriptions.deleteDiscount("sub_8Eluur5KoIKxuy").then(function (confirmation) { }); From a5d79c1ec641d288cd457f074a0ff5fca1ef3d3c Mon Sep 17 00:00:00 2001 From: Andrija Dvorski Date: Thu, 29 Mar 2018 08:09:24 +0200 Subject: [PATCH 0316/2153] Fixed import in tests --- types/command-line-usage/command-line-usage-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/command-line-usage/command-line-usage-tests.ts b/types/command-line-usage/command-line-usage-tests.ts index c4dd127cea..05dfadc7f3 100644 --- a/types/command-line-usage/command-line-usage-tests.ts +++ b/types/command-line-usage/command-line-usage-tests.ts @@ -1,4 +1,4 @@ -import * as commandLineUsage from "command-line-usage"; +import commandLineUsage = require("command-line-usage"); const sections = [ { From 81d759c7e84ebc5ff01057536adc4f67823ad356 Mon Sep 17 00:00:00 2001 From: andy-maca <66229754@qq.com> Date: Thu, 29 Mar 2018 15:04:56 +0800 Subject: [PATCH 0317/2153] Fix build errors --- types/datatables.net-autofill/index.d.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/types/datatables.net-autofill/index.d.ts b/types/datatables.net-autofill/index.d.ts index 68075be5ca..2f05d608be 100644 --- a/types/datatables.net-autofill/index.d.ts +++ b/types/datatables.net-autofill/index.d.ts @@ -24,10 +24,6 @@ declare namespace DataTables { * Select the columns that can be auto filled */ columns: string | number[]; - /* - * Attach an Editor instance for database updating - */ - editor: Object; /* * * Initial enablement state of AutoFill From 1824aef19428d49c2be91bc746f3c79384d1b6fc Mon Sep 17 00:00:00 2001 From: lincoln Date: Thu, 29 Mar 2018 15:20:04 +0800 Subject: [PATCH 0318/2153] update Upload interfaces --- types/dwt/addon.pdf.d.ts | 9 ++-- types/dwt/index.d.ts | 94 ++++++++++++++++++++++++---------------- 2 files changed, 62 insertions(+), 41 deletions(-) diff --git a/types/dwt/addon.pdf.d.ts b/types/dwt/addon.pdf.d.ts index 856291a647..87097471b0 100644 --- a/types/dwt/addon.pdf.d.ts +++ b/types/dwt/addon.pdf.d.ts @@ -1,4 +1,5 @@ /*! +* Dynamsoft WebTwain PDF Addon * Based on Dynamsoft WebTwain JavaScript Intellisense * Product: Dynamsoft Web Twain * Web Site: http://www.dynamsoft.com @@ -8,9 +9,9 @@ * Version: 13.4 */ -declare enum EnumDWT_ConverMode { +declare enum EnumDWT_ConvertMode { CM_DEFAULT = 0, - TWPT_CM_RENDERALLGRAY = 1 + CM_RENDERALL = 1 } /** @@ -42,10 +43,10 @@ interface PDF { /** * Set the image convert mode for PDF Rasterizer in Dynamic Web TWAIN. * @method Dynamsoft.WebTwain#SetConvertMode - * @param {EnumDWT_ConverMode} convertMode Specifies the image convert mode. + * @param {EnumDWT_ConvertMode} convertMode Specifies the image convert mode. * @return {boolean} */ - SetConvertMode(convertMode: EnumDWT_ConverMode): boolean; + SetConvertMode(convertMode: EnumDWT_ConvertMode): boolean; /** * Set the output resolution for the PDF Rasterizer in Dynamic Web TWAIN. diff --git a/types/dwt/index.d.ts b/types/dwt/index.d.ts index 69bd65bb9f..be362e680b 100644 --- a/types/dwt/index.d.ts +++ b/types/dwt/index.d.ts @@ -27,7 +27,19 @@ declare namespace Dynamsoft { Errors Events IntToColorStr LS OnGetImageByURL OnGetImageFromServer Path ProgressBar UI Uri addEventListener ajax all appendMessage appendRichMessage aryControlLoadImage attachAddon attachProperty base64 bio cancelFrome clearMessage closeAll closeProgress colorStrToInt config css currentStyle - debug detect detectButton dialog dialogShowStatus dlgProgress dlgRef drawBoxBorder drawImageWithHermite + debug*/ + + let detect: { + /*ignored + OnCreatWS OnDetectNext OnWebTwainPostExecute OnWebTwainPreExecute StartWSByIPTimeoutId StartWSTimeoutId + aryReconnectSTwains arySTwains arySTwainsByIP bFirst bNeedUpgradeEvent bNoControlEvent bOK bPromptJSOrServerOutdated + cUrlIndex dcpCallbackType dcpStatus detectType getVersionArray global_dlg hideMask isDWTVersionLatest onNoControl + onNotAllowedForChrome ports scriptLoaded showMask starting tryTimes*/ + ssl: boolean; + }; + + /*ignored + detectButton dialog dialogShowStatus dlgProgress dlgRef drawBoxBorder drawImageWithHermite each empty endsWith */ @@ -53,44 +65,47 @@ declare namespace Dynamsoft { */ } namespace WebTwainEnv { - let JSVersion: string; - let PluginVersion: string; - let ActiveXVersion: string; - let ServerVersionInfo: string; - - let Trial: boolean; - let AutoLoad: boolean; - let ProductKey: string; - let ResourcesPath: string; - - let IfUpdateService: boolean; - let IfUseActiveXForIE10Plus: boolean; - let UseDefaultInstallUI: string; let ActiveXInstallWithCAB: boolean; - let Debug: boolean; - + let ActiveXVersion: string; + let AutoLoad: boolean; + function CloseDialog(): void; let ContainerMap: {}; let Containers: Container[]; + function CreateDWTObject(newObjID: string, successFn: (dwtObject: WebTwain) => void, failurefn: (...args: any[]) => void): void; + function CreateDWTObject(newObjID: string, ip: number | string, port: number | string, portSSL: number | string, successFn: (dwtObject: WebTwain) => void, failurefn: (...args: any[]) => void): void; + let Debug: boolean; + function DeleteDWTObject(objID: string): void; let DynamicContainers: string[]; let DynamicDWTMap: {}; - - function CreateDWTObject(newObjID: string, successFn: (dwtObject: WebTwain) => void, failurefn: (...args: any[]) => void): void; function GetWebTwain(cid: string): WebTwain; - function DeleteDWTObject(objID: string): void; + let IfUpdateService: boolean; + let IfUseActiveXForIE10Plus: boolean; + let JSVersion: string; function Load(): void; - function Unload(): void; - function RegisterEvent(event: string, fn: (...args: any[]) => void): void; /*ignored - initQueue inited UseDefaultInstallUI - OnWebTwainInitMessage OnWebTwainNeedUpgrade OnWebTwainNeedUpgradeWebJavascript OnWebTwainNotFound OnWebTwainOldPluginNotAllowed OnWebTwainReady + OnWebTwainInitMessage OnWebTwainNeedUpgrade OnWebTwainNeedUpgradeWebJavascript OnWebTwainNotFound OnWebTwainOldPluginNotAllowed */ + function OnWebTwainPostExecute(): void; function OnWebTwainPreExecute(): void; + /*ignored + OnWebTwainReady + */ + + let PluginVersion: string; + let ProductKey: string; + function RegisterEvent(event: string, fn: (...args: any[]) => void): void; function RemoveAllAuthorizations(): void; + let ResourcesPath: string; + let ServerVersionInfo: string; function ShowDialog(_dialogWidth: number, _dialogHeight: number, _strDialogMessageWithHtmlFormat: string, _bChangeImage: boolean, bHideCloseButton: boolean): void; - function CloseDialog(): void; + let Trial: boolean; + function Unload(): void; + let UseDefaultInstallUI: string; + let initQueue: number[]; + let inited: boolean; } } @@ -2244,10 +2259,15 @@ interface WebTwain { */ Zoom: number; - /** ignored + /* ignored style _AutoCropMethod */ + + /* + *Methods + */ + /** * Displays the source's built-in interface to acquire image. * @method WebTwain#AcquireImage @@ -2916,7 +2936,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. * @return {boolean} */ - HTTPDownloadThroughPost(HTTPServer: string, HTTPRemoteFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPDownloadThroughPost(HTTPServer: string, HTTPRemoteFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Uploads the images specified by the indices to the HTTP server. @@ -2929,7 +2949,7 @@ interface WebTwain { * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. * @return {boolean} */ - HTTPUpload(url: string, indices: number[], enumImageType: EnumDWT_ImageType, dataFormat: EnumDWT_UploadDataFormat, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUpload(url: string, indices: number[], enumImageType: EnumDWT_ImageType, dataFormat: EnumDWT_UploadDataFormat, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Uploads all images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page TIFF. @@ -2941,7 +2961,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. * @return {boolean} */ - HTTPUploadAllThroughPostAsMultiPageTIFF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUploadAllThroughPostAsMultiPageTIFF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Uploads all images in the buffer to the HTTP server through HTTP Post method as a Multi-Page PDF. @@ -2953,7 +2973,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. * @return {boolean} */ - HTTPUploadAllThroughPostAsPDF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUploadAllThroughPostAsPDF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * [Deprecated.] Uploads all images in the buffer to the HTTP server through the HTTP Put method as a Multi-Page TIFF. @@ -2992,7 +3012,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. * @return {boolean} */ - HTTPUploadThroughPost(HTTPServer: string, sImageIndex: number, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUploadThroughPost(HTTPServer: string, sImageIndex: number, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Uploads the selected images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page TIFF. @@ -3004,7 +3024,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. * @return {boolean} */ - HTTPUploadThroughPostAsMultiPageTIFF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUploadThroughPostAsMultiPageTIFF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Uploads the selected images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page PDF. @@ -3016,7 +3036,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. * @return {boolean} */ - HTTPUploadThroughPostAsMultiPagePDF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUploadThroughPostAsMultiPagePDF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Directly upload a specific local file to the HTTP server through the HTTP POST method without loading it into Dynamic Web TWAIN. @@ -3029,7 +3049,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. * @return {boolean} */ - HTTPUploadThroughPostDirectly(HTTPServer: string, localFile: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUploadThroughPostDirectly(HTTPServer: string, localFile: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Uploads the image of a specified index in the buffer to the HTTP server as a specified image format through the HTTP POST method. @@ -3043,7 +3063,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadFailure. * @return {boolean} */ - HTTPUploadThroughPostEx(HTTPServer: string, sImageIndex: number, ActionPage: string, fileName: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUploadThroughPostEx(HTTPServer: string, sImageIndex: number, ActionPage: string, fileName: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * [Deprecated.] Uploads the image of a specified index in the buffer to the HTTP server through the HTTP PUT method. @@ -3244,10 +3264,10 @@ interface WebTwain { * Binds a specified function to an event, so that the function gets called whenever the event fires. * @method WebTwain#RegisterEvent * @param {string} name the name of the event that the function is bound to. - * @param {object} evt specifies the function to call when event fires. + * @param {any} evt specifies the function to call when event fires. * @return {boolean} */ - RegisterEvent(name: string, evt: object): boolean; + RegisterEvent(name: string, evt: any): boolean; /** * Removes all images in buffer. @@ -3415,7 +3435,7 @@ interface WebTwain { /** * Saves the selected images in buffer to base64 string. * @method WebTwain#SaveSelectedImagesToBase64Binary - * @return {string|bool} + * @return {string|boolean} */ SaveSelectedImagesToBase64Binary(optionalAsyncSuccessFunc?: (result: string[]) => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): string | boolean; From 72fcbb0d13eea8e0c5d64ebc699f4f8b1ee4e701 Mon Sep 17 00:00:00 2001 From: Alexander Marks Date: Thu, 29 Mar 2018 00:19:26 -0700 Subject: [PATCH 0319/2153] Add types for path-is-inside --- types/path-is-inside/index.d.ts | 8 +++++++ types/path-is-inside/path-is-inside-tests.ts | 3 +++ types/path-is-inside/tsconfig.json | 23 ++++++++++++++++++++ types/path-is-inside/tslint.json | 1 + 4 files changed, 35 insertions(+) create mode 100644 types/path-is-inside/index.d.ts create mode 100644 types/path-is-inside/path-is-inside-tests.ts create mode 100644 types/path-is-inside/tsconfig.json create mode 100644 types/path-is-inside/tslint.json diff --git a/types/path-is-inside/index.d.ts b/types/path-is-inside/index.d.ts new file mode 100644 index 0000000000..26a28e5db4 --- /dev/null +++ b/types/path-is-inside/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for path-is-inside 1.0 +// Project: https://github.com/domenic/path-is-inside#readme +// Definitions by: Alexander Marks +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function pathIsInside(thePath: string, + potentialParent: string): boolean; +export = pathIsInside; diff --git a/types/path-is-inside/path-is-inside-tests.ts b/types/path-is-inside/path-is-inside-tests.ts new file mode 100644 index 0000000000..723947124a --- /dev/null +++ b/types/path-is-inside/path-is-inside-tests.ts @@ -0,0 +1,3 @@ +import pathIsInside = require('path-is-inside'); + +pathIsInside('path', 'parent'); // $ExpectType boolean diff --git a/types/path-is-inside/tsconfig.json b/types/path-is-inside/tsconfig.json new file mode 100644 index 0000000000..50af237e9a --- /dev/null +++ b/types/path-is-inside/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "path-is-inside-tests.ts" + ] +} diff --git a/types/path-is-inside/tslint.json b/types/path-is-inside/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/path-is-inside/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 2007d0ea35b7918a407cae48fd57feaebbfa19d1 Mon Sep 17 00:00:00 2001 From: Sergey Solomentsev Date: Thu, 29 Mar 2018 11:37:34 +0300 Subject: [PATCH 0320/2153] Renamed Base class to Generator so to follow latest yeoman API. --- types/yeoman-generator/index.d.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/types/yeoman-generator/index.d.ts b/types/yeoman-generator/index.d.ts index 9db6a70946..a996185516 100644 --- a/types/yeoman-generator/index.d.ts +++ b/types/yeoman-generator/index.d.ts @@ -11,7 +11,7 @@ import * as inquirer from 'inquirer'; type Callback = (err: any) => void; -declare namespace Base { +declare namespace Generator { interface Question extends inquirer.Question { /** * whether to store the user's previous answer @@ -79,7 +79,7 @@ declare namespace Base { } } -declare class Base extends EventEmitter { +declare class Generator extends EventEmitter { constructor(args: string|string[], options: {}); env: { @@ -89,18 +89,18 @@ declare class Base extends EventEmitter { resolved: string; description: string; appname: string; - config: Base.Storage; - fs: Base.MemFsEditor; + config: Generator.Storage; + fs: Generator.MemFsEditor; options: {}; log(message?: string, context?: any): void; - argument(name: string, config: Base.ArgumentConfig): this; + argument(name: string, config: Generator.ArgumentConfig): this; composeWith(namespace: string, options: { [name: string]: any }, settings?: { local: string, link: 'weak'|'strong' }): this; destinationPath(...path: string[]): string; destinationRoot(rootPath?: string): string; determineAppname(): string; - option(name: string, config: Base.OptionConfig): this; - prompt(questions: Base.Questions): Promise; + option(name: string, config: Generator.OptionConfig): this; + prompt(questions: Generator.Questions): Promise; registerTransformStream(stream: {}|Array<{}>): this; rootGeneratorName(): string; rootGeneratorVersion(): string; @@ -149,7 +149,7 @@ declare class Base extends EventEmitter { * * @return Resolved if install successful, rejected otherwise */ - installDependencies(options?: Base.InstallOptions): Promise; + installDependencies(options?: Generator.InstallOptions): Promise; /** * Receives a list of `packages` and an `options` object to install through npm. * @@ -214,4 +214,4 @@ declare class Base extends EventEmitter { } }; } -export = Base; +export = Generator; \ No newline at end of file From 95deea0a8f70ee3f00c7263c2b1b939cbd9cc216 Mon Sep 17 00:00:00 2001 From: Jack Leigh Date: Thu, 29 Mar 2018 11:06:30 +0100 Subject: [PATCH 0321/2153] react-native: Export some useful union types --- types/react-native/index.d.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 934b738293..2a08edcdb1 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -1044,10 +1044,12 @@ export type KeyboardTypeIOS = | "twitter" | "web-search"; export type KeyboardTypeAndroid = "visible-password"; +export type KeyboardTypeOptions = KeyboardType | KeyboardTypeAndroid | KeyboardTypeIOS export type ReturnKeyType = "done" | "go" | "next" | "search" | "send"; export type ReturnKeyTypeAndroid = "none" | "previous"; export type ReturnKeyTypeIOS = "default" | "google" | "join" | "route" | "yahoo" | "emergency-call"; +export type ReturnKeyTypeOptions = ReturnKeyType | ReturnKeyTypeAndroid | ReturnKeyTypeIOS /** * @see https://facebook.github.io/react-native/docs/textinput.html#props @@ -1103,7 +1105,7 @@ export interface TextInputProperties * The following values work on iOS: - ascii-capable - numbers-and-punctuation - url - number-pad - name-phone-pad - decimal-pad - twitter - web-search * The following values work on Android: - visible-password */ - keyboardType?: KeyboardType | KeyboardTypeIOS | KeyboardTypeAndroid; + keyboardType?: KeyboardTypeOptions; /** * Limits the maximum number of characters that can be entered. @@ -1184,7 +1186,7 @@ export interface TextInputProperties * enum('default', 'go', 'google', 'join', 'next', 'route', 'search', 'send', 'yahoo', 'done', 'emergency-call') * Determines how the return key should look. */ - returnKeyType?: ReturnKeyType | ReturnKeyTypeAndroid | ReturnKeyTypeIOS; + returnKeyType?: ReturnKeyTypeOptions; /** * If true, the text input obscures the text entered so that sensitive text like passwords stay secure. @@ -3292,6 +3294,7 @@ interface ImagePropertiesAndroid { /** * @see https://facebook.github.io/react-native/docs/image.html */ +export type ImagePropertiesSourceOptions = ImageURISource | ImageURISource[] | ImageRequireSource; export interface ImageProperties extends ImagePropertiesIOS, ImagePropertiesAndroid, AccessibilityProperties { /** * onLayout function @@ -3387,7 +3390,7 @@ export interface ImageProperties extends ImagePropertiesIOS, ImagePropertiesAndr * their width and height. The native side will then choose the best `uri` to display * based on the measured size of the image container. */ - source: ImageURISource | ImageURISource[] | ImageRequireSource; + source: ImagePropertiesSourceOptions; /** * similarly to `source`, this property represents the resource used to render From 799bd0516ba14333958385034f79d7eb182dd0b1 Mon Sep 17 00:00:00 2001 From: Richard Hinkamp Date: Thu, 29 Mar 2018 12:13:05 +0200 Subject: [PATCH 0322/2153] Marker option icon same as leaflet marker --- types/leaflet-draw/index.d.ts | 2 +- types/leaflet-draw/leaflet-draw-tests.ts | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/types/leaflet-draw/index.d.ts b/types/leaflet-draw/index.d.ts index 7fd33f2152..62025a7c46 100644 --- a/types/leaflet-draw/index.d.ts +++ b/types/leaflet-draw/index.d.ts @@ -279,7 +279,7 @@ declare module 'leaflet' { * * Default value: L.Icon.Default() */ - icon?: Icon; + icon?: Icon | DivIcon; /** * This should be a high number to ensure that you can draw over all other layers on the map. diff --git a/types/leaflet-draw/leaflet-draw-tests.ts b/types/leaflet-draw/leaflet-draw-tests.ts index 54015fa404..7a51fe401f 100644 --- a/types/leaflet-draw/leaflet-draw-tests.ts +++ b/types/leaflet-draw/leaflet-draw-tests.ts @@ -121,3 +121,18 @@ function testExampleControlOptions() { } }); } + +function testMarkerOptionsIcon() { + const markerIcon = new L.Draw.Marker(map, { + icon: new L.Icon({ + iconUrl: 'my-icon.png', + iconSize: new L.Point(32, 32), + }), + }); + const markerDivIcon = new L.Draw.Marker(map, { + icon: new L.DivIcon({ + className: "marker-icon", + iconSize: new L.Point(32, 32), + }), + }); +} From 9f06b22b1f897ae39161c128a0c5b76e89eed8f3 Mon Sep 17 00:00:00 2001 From: Alexander Marks Date: Thu, 29 Mar 2018 03:22:37 -0700 Subject: [PATCH 0323/2153] Add types for whatwg-url --- types/whatwg-url/index.d.ts | 105 +++++++++++++++++++++++++++ types/whatwg-url/tsconfig.json | 23 ++++++ types/whatwg-url/tslint.json | 1 + types/whatwg-url/whatwg-url-tests.ts | 45 ++++++++++++ 4 files changed, 174 insertions(+) create mode 100644 types/whatwg-url/index.d.ts create mode 100644 types/whatwg-url/tsconfig.json create mode 100644 types/whatwg-url/tslint.json create mode 100644 types/whatwg-url/whatwg-url-tests.ts diff --git a/types/whatwg-url/index.d.ts b/types/whatwg-url/index.d.ts new file mode 100644 index 0000000000..8bbc271b9a --- /dev/null +++ b/types/whatwg-url/index.d.ts @@ -0,0 +1,105 @@ +// Type definitions for whatwg-url 6.4 +// Project: https://github.com/jsdom/whatwg-url#readme +// Definitions by: Alexander Marks +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +/** https://url.spec.whatwg.org/#url-representation */ +export interface URLRecord { + scheme: string; + username: string; + password: string; + host: string|number|IPv6Address|null; + port: number|null; + path: string[]; + query: string|null; + fragment: string|null; + cannotBeABaseURL?: boolean; +} + +/** https://url.spec.whatwg.org/#concept-ipv6 */ +export type IPv6Address = + [number, number, number, number, number, number, number, number]; + +/** https://url.spec.whatwg.org/#url-class */ +export class URL { + constructor(url: string, base?: string); + + href: string; + readonly origin: string; + protocol: string; + username: string; + password: string; + host: string; + hostname: string; + port: string; + pathname: string; + search: string; + readonly searchParams: URLSearchParams; + hash: string; + + toJSON(): string; +} + +/** https://url.spec.whatwg.org/#interface-urlsearchparams */ +export class URLSearchParams { + constructor(init: (Array<[string, string]>|Iterable<[string, string]>| + {[name: string]: string}|string)); + + append(name: string, value: string): void; + delete(name: string): void; + get(name: string): string|null; + getAll(name: string): string[]; + has(name: string): boolean; + set(name: string, value: string): void; + sort(): void; + + [Symbol.iterator](): IterableIterator<[string, string]>; +} + +/** https://url.spec.whatwg.org/#concept-url-parser */ +export function parseURL( + input: string, + options?: {baseURL?: string, encodingOverride?: string}): URLRecord|null; + +/** https://url.spec.whatwg.org/#concept-basic-url-parser */ +export function basicURLParse(input: string, options?: { + baseURL?: string, + encodingOverride?: string, + url?: URLRecord, + stateOverride?: StateOverride +}): URLRecord|null; + +/** https://url.spec.whatwg.org/#scheme-start-state */ +export type StateOverride = + 'scheme start'|'scheme'|'no scheme'|'special relative or authority'| + 'path or authority'|'relative'|'relative slash'|'special authority slashes'| + 'special authority ignore slashes'|'authority'|'host'|'hostname'|'port'| + 'file'|'file slash'|'file host'|'path start'|'path'| + 'cannot-be-a-base-URL path'|'query'|'fragment'; + +/** https://url.spec.whatwg.org/#concept-url-serializer */ +export function serializeURL( + urlRecord: URLRecord, excludeFragment?: boolean): string; + +/** https://url.spec.whatwg.org/#concept-host-serializer */ +export function serializeHost(host: string|number|IPv6Address): string; + +/** https://url.spec.whatwg.org/#serialize-an-integer */ +export function serializeInteger(number: number): string; + +/** https://html.spec.whatwg.org#ascii-serialisation-of-an-origin */ +export function serializeURLOrigin(urlRecord: URLRecord): string; + +/** https://url.spec.whatwg.org/#set-the-username */ +export function setTheUsername(urlRecord: URLRecord, username: string): void; + +/** https://url.spec.whatwg.org/#set-the-password */ +export function setThePassword(urlRecord: URLRecord, password: string): void; + +/** https://url.spec.whatwg.org/#cannot-have-a-username-password-port */ +export function cannotHaveAUsernamePasswordPort(urlRecord: URLRecord): boolean; + +/** https://url.spec.whatwg.org/#percent-decode */ +export function percentDecode(buffer: Buffer): Buffer; diff --git a/types/whatwg-url/tsconfig.json b/types/whatwg-url/tsconfig.json new file mode 100644 index 0000000000..9b32093c23 --- /dev/null +++ b/types/whatwg-url/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "whatwg-url-tests.ts" + ] +} diff --git a/types/whatwg-url/tslint.json b/types/whatwg-url/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/whatwg-url/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/whatwg-url/whatwg-url-tests.ts b/types/whatwg-url/whatwg-url-tests.ts new file mode 100644 index 0000000000..6aae6315eb --- /dev/null +++ b/types/whatwg-url/whatwg-url-tests.ts @@ -0,0 +1,45 @@ +import * as whatwgUrl from 'whatwg-url'; + +// $ExpectType URL +new whatwgUrl.URL('http://example.com'); + +// $ExpectType URL +new whatwgUrl.URL('foo', 'http://example.com'); + +// $ExpectType URLRecord | null +const urlRecord = whatwgUrl.parseURL('http://example.com'); + +if (urlRecord !== null) { + // $ExpectType URLRecord | null + whatwgUrl.basicURLParse('http://example.com', {url: urlRecord}); + + // $ExpectType string + whatwgUrl.serializeURL(urlRecord); + // + // $ExpectType string + whatwgUrl.serializeURLOrigin(urlRecord); + // + // $ExpectType void + whatwgUrl.setTheUsername(urlRecord, 'user'); + // + // $ExpectType void + whatwgUrl.setThePassword(urlRecord, 'secret'); + // + // $ExpectType boolean + whatwgUrl.cannotHaveAUsernamePasswordPort(urlRecord); +} + +// $ExpectType string +whatwgUrl.serializeHost('http://example.com'); + +// $ExpectType string +whatwgUrl.serializeHost(42); + +// $ExpectType string +whatwgUrl.serializeHost([0, 0, 0, 0, 0, 0, 0, 0]); + +// $ExpectType string +whatwgUrl.serializeInteger(42); + +// $ExpectType Buffer +whatwgUrl.percentDecode(Buffer.from('foo')); From 1fbf734a2c3887c3f3226924cd334cbf05462577 Mon Sep 17 00:00:00 2001 From: Po Chen Date: Thu, 29 Mar 2018 22:27:54 +1100 Subject: [PATCH 0324/2153] Update index.d.ts --- types/dagre/index.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/types/dagre/index.d.ts b/types/dagre/index.d.ts index 6c5e5e00ec..774fbf8f80 100644 --- a/types/dagre/index.d.ts +++ b/types/dagre/index.d.ts @@ -95,15 +95,15 @@ export interface NodeConfig { } export interface EdgeConfig { - minlen: number; - weight: number; - width: number; - height: number; - lablepos: 'l'|'c'|'r'; - labeloffest: number; + minlen?: number; + weight?: number; + width?: number; + height?: number; + lablepos?: 'l'|'c'|'r'; + labeloffest?: number; } -export function layout(graph: graphlib.Graph, layout?: GraphLabel&NodeConfig&EdgeConfig): void; +export function layout(graph: graphlib.Graph, layout?: GraphLabel & NodeConfig & EdgeConfig): void; export interface Edge { v: string; From 0d32bce4c3f7ed0606871f51968b9ac52e6f220d Mon Sep 17 00:00:00 2001 From: Sergey Solomentsev Date: Thu, 29 Mar 2018 15:14:22 +0300 Subject: [PATCH 0325/2153] Added new line to the end of the yeoman-generator definition file. --- types/yeoman-generator/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/yeoman-generator/index.d.ts b/types/yeoman-generator/index.d.ts index a996185516..c4a13695fb 100644 --- a/types/yeoman-generator/index.d.ts +++ b/types/yeoman-generator/index.d.ts @@ -214,4 +214,4 @@ declare class Generator extends EventEmitter { } }; } -export = Generator; \ No newline at end of file +export = Generator; From 06cf5d0caf42c49345eb2dafdca37d99dea23448 Mon Sep 17 00:00:00 2001 From: Eugene Arshinov Date: Thu, 29 Mar 2018 15:04:49 +0300 Subject: [PATCH 0326/2153] [ckeditor] Added typings for CKEDITOR.dtd Reference to CKEDITOR API documentation: https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dtd Added new `function test_dtd()` to `ckeditor-tests.ts`. --- types/ckeditor/ckeditor-tests.ts | 6 +++ types/ckeditor/index.d.ts | 82 +++++++++++++++++++------------- 2 files changed, 56 insertions(+), 32 deletions(-) diff --git a/types/ckeditor/ckeditor-tests.ts b/types/ckeditor/ckeditor-tests.ts index dd0ec92164..515996e90a 100644 --- a/types/ckeditor/ckeditor-tests.ts +++ b/types/ckeditor/ckeditor-tests.ts @@ -506,3 +506,9 @@ function test_editor_instance_event() { } }); } + +function test_dtd() { + var brConsideredEmptyTag = CKEDITOR.dtd.$empty["br"]; + var spanCanContainText = CKEDITOR.dtd["span"]["#"]; + var divCanContainSpan = CKEDITOR.dtd["div"]["span"]; +} diff --git a/types/ckeditor/index.d.ts b/types/ckeditor/index.d.ts index cf7cd0cc27..49ffce2fd9 100644 --- a/types/ckeditor/index.d.ts +++ b/types/ckeditor/index.d.ts @@ -24,8 +24,8 @@ declare namespace CKEDITOR { var DIALOG_RESIZE_HEIGHT: number; var DIALOG_RESIZE_NONE: number; var DIALOG_RESIZE_WIDTH: number; - var DIALOG_STATE_IDLE: number; - var DIALOG_STATE_BUSY: number; + var DIALOG_STATE_IDLE: number; + var DIALOG_STATE_BUSY: number; var ELEMENT_MODE_APPENDTO: number; var ELEMENT_MODE_INLINE: number; var ELEMENT_MODE_NONE: number; @@ -44,10 +44,10 @@ declare namespace CKEDITOR { var NODE_DOCUMENT_FRAGMENT: number; var NODE_ELEMENT: number; var NODE_TEXT: number; - var POSITION_BEFORE_START: number; - var POSITION_BEFORE_END: number; - var POSITION_AFTER_START: number; - var POSITION_AFTER_END: number; + var POSITION_BEFORE_START: number; + var POSITION_BEFORE_END: number; + var POSITION_AFTER_START: number; + var POSITION_AFTER_END: number; var SELECTION_ELEMENT: number; var SELECTION_NONE: number; var SELECTION_TEXT: number; @@ -55,9 +55,9 @@ declare namespace CKEDITOR { var SHRINK_ELEMENT: number; var SHRINK_TEXT: number; var START: number; - var STYLE_BLOCK: string; - var STYLE_INLINE: string; - var STYLE_OBJECT: string; + var STYLE_BLOCK: string; + var STYLE_INLINE: string; + var STYLE_OBJECT: string; var TRISTATE_DISABLED: number; var TRISTATE_OFF: number; var TRISTATE_ON: number; @@ -288,7 +288,7 @@ declare namespace CKEDITOR { class elementPath { constructor(startNode: element, root: element); - constructor(startNode: element); + constructor(startNode: element); block: element; blockLimit: element; root: element; @@ -342,7 +342,7 @@ declare namespace CKEDITOR { setStartAt(node: node, position: number): void; setEndAt(node: node, position: number): void; fixBlock(isStart: boolean, blockTag: Object): Object; - select(): selection; + select(): selection; splitBlock(blockTag: Object): Object; splitElement(toSplit: element): element; removeEmptyBlocksAtEnd(atEnd: boolean): void; @@ -836,7 +836,7 @@ declare namespace CKEDITOR { templates_files?: Object; templates_replaceContent?: boolean; title?: string | boolean; - toolbar?: string | (string | string[] | { name: string, items?: string[], groups?: string[] })[] | null; + toolbar?: string | (string | string[] | { name: string, items?: string[], groups?: string[] })[] | null; toolbarCanCollapse?: boolean; toolbarGroupCycling?: boolean; toolbarGroups?: (toolbarGroups | string)[]; @@ -869,19 +869,19 @@ declare namespace CKEDITOR { } module skin { - var icons: { [name: string]: { path: string } }; - function addIcon(name: string, path: string, offset?: number, bgsize?: string): void; - } + var icons: { [name: string]: { path: string } }; + function addIcon(name: string, path: string, offset?: number, bgsize?: string): void; + } class style { - constructor(something: { element: string, attributes: { [att: string]: string } }); - applyToRange(range: Range, editor: editor): void; - } + constructor(something: { element: string, attributes: { [att: string]: string } }); + applyToRange(range: Range, editor: editor): void; + } interface editable extends dom.element { - hasFocus: boolean; - attachListener(obj: event | editable, eventName: string, listenerFunction: (ei: eventInfo) => void, - scopeobj?: {}, listenerData?: any, priority?: number): listenerRegistration; + hasFocus: boolean; + attachListener(obj: event | editable, eventName: string, listenerFunction: (ei: eventInfo) => void, + scopeobj?: {}, listenerData?: any, priority?: number): listenerRegistration; } @@ -978,7 +978,7 @@ declare namespace CKEDITOR { destroy(widget: CKEDITOR.plugins.widget, offline?: boolean): void; destroyAll(offline?: boolean): void; finalizeCreation(container: any): void; - focused: widget; + focused: widget; fire(eventName: string, data: Object, editor: editor): any; // should be boolean | Object getByElement(element: any, checkWrapperOnly: boolean): CKEDITOR.plugins.widget; hasListeners(eventName: string): boolean; @@ -1089,7 +1089,7 @@ declare namespace CKEDITOR { interface IMenuItemDefinition { label:string, command:string, - icon: string + icon: string group:string, order:number } @@ -1142,7 +1142,7 @@ declare namespace CKEDITOR { createFakeParserElement(realElement: Object, className: Object, realElementType: Object, isResizable: Object): void; createRange(): dom.range; destroy(noUpdate?: boolean): void; - editable(): editable | null; + editable(): editable | null; editable(elementOrEditable: dom.element): void; editable(elementOrEditable: editable): void; elementPath(startNode?: dom.node): dom.elementPath; @@ -1300,14 +1300,14 @@ declare namespace CKEDITOR { stop(): void; } - module filter { - interface allowedContentRules { + module filter { + interface allowedContentRules { - } - } + } + } class filter { - allow(newRules: CKEDITOR.filter.allowedContentRules, featureName?: string, overrideCustom?: boolean): boolean; + allow(newRules: CKEDITOR.filter.allowedContentRules, featureName?: string, overrideCustom?: boolean): boolean; } @@ -1370,10 +1370,28 @@ declare namespace CKEDITOR { } - class dtd { - + interface dtdDefinition { + [outerTagName: string]: {[innerTagName: string]: 1}; + $block: {[tagName: string]: 1}; + $blockLimit: {[tagName: string]: 1}; + $cdata: {[tagName: string]: 1}; + $editable: {[tagName: string]: 1}; + $empty: {[tagName: string]: 1}; + $inline: {[tagName: string]: 1}; + $intermediate: {[tagName: string]: 1}; + $list: {[tagName: string]: 1}; + $listItem: {[tagName: string]: 1}; + $nonBodyContent: {[tagName: string]: 1}; + $nonEditable: {[tagName: string]: 1}; + $object: {[tagName: string]: 1}; + $removeEmpty: {[tagName: string]: 1}; + $tabIndex: {[tagName: string]: 1}; + $tableContent: {[tagName: string]: 1}; + $transparent: {[tagName: string]: 1}; } + var dtd: dtdDefinition; + class ui extends event { constructor(editor: editor); @@ -1819,7 +1837,7 @@ declare namespace CKEDITOR { children: any[]; type: number; add(node: node): number; - add(node: node, index: number): void; + add(node: node, index: number): void; clone(): element; filter(filter: filter): boolean; filterChildren(filter: filter): void; From 8f4585a0df5142369a6c29f7de22a8a0c3ada0f7 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Thu, 29 Mar 2018 18:13:07 +0530 Subject: [PATCH 0327/2153] 16.1.32 added --- types/ej.web.all/ej.web.all-tests.ts | 1344 +++++++++++++------------- types/ej.web.all/index.d.ts | 164 +++- 2 files changed, 802 insertions(+), 706 deletions(-) diff --git a/types/ej.web.all/ej.web.all-tests.ts b/types/ej.web.all/ej.web.all-tests.ts index 83ed128742..ddfdc39876 100644 --- a/types/ej.web.all/ej.web.all-tests.ts +++ b/types/ej.web.all/ej.web.all-tests.ts @@ -1,3 +1,7 @@ +/* tslint:disable */ + + + module AccordionComponent { $(function () { var sample = new ej.Accordion($("#basicAccordion"), { @@ -18,39 +22,39 @@ module AccordionComponent { }); } + - -module AutocompleteComponent { +module AutocompleteComponent{ var carList = [ - "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", - "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", - "Chevrolet Camaro", "Cadillac", - "Duesenberg J", "Dodge Sprinter", - "Elantra", "Excavator", - "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", - "GAZ Siber", - "Honda S2000", "Hyundai Santro", - "Isuzu Swift", "Infiniti Skyline", - "Jaguar XJS", - "Kia Sedona EX", "Koenigsegg Agera", - "Lotus Esprit", "Lamborghini Diablo", - "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", - "Nissan Qashqai", - "Oldsmobile S98", "Opel Superboss", - "Porsche 356", "Pontiac Sunbird", - "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", - "Triumph Spitfire", "Toyota 2000GT", - "Volvo P1800", "Volkswagen Shirako" - ]; - $(function () { - var autocompleteInstance = new ej.Autocomplete($("#selectCar"), { + "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", + "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", + "Chevrolet Camaro", "Cadillac", + "Duesenberg J", "Dodge Sprinter", + "Elantra", "Excavator", + "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", + "GAZ Siber", + "Honda S2000", "Hyundai Santro", + "Isuzu Swift", "Infiniti Skyline", + "Jaguar XJS", + "Kia Sedona EX", "Koenigsegg Agera", + "Lotus Esprit", "Lamborghini Diablo", + "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", + "Nissan Qashqai", + "Oldsmobile S98", "Opel Superboss", + "Porsche 356", "Pontiac Sunbird", + "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", + "Triumph Spitfire", "Toyota 2000GT", + "Volvo P1800", "Volkswagen Shirako" + ]; + $(function () { + var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { width: "100%", watermarkText: "Select a car", dataSource: carList, enableAutoFill: true, showPopupButton: true, multiSelectMode: "delimiter" - }); + }); }); } @@ -193,12 +197,12 @@ module ChartComponent { range: { min: 25, max: 50, interval: 5 }, labelFormat: "{value}%", title: { text: "Efficiency" }, - + }, commonSeriesOptions: - { + { type: 'line', enableAnimation: true, - tooltip: { visible: true, template: 'Tooltip' }, + tooltip:{ visible :true, template:'Tooltip'}, marker: { shape: 'circle', @@ -208,30 +212,30 @@ module ChartComponent { }, visible: true }, - border: { width: 2 } - }, - series: - [ + border : {width: 2} + }, + series: + [ + { + points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, + { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], + name: 'India' + }, { - points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 }, { x: 2007, y: 26 }, { x: 2008, y: 27 }, - { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], - name: 'India' + points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, + { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], + name: 'Germany' }, + { + points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, + { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], + name: 'England' + }, { - points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 }, { x: 2007, y: 30 }, { x: 2008, y: 36 }, - { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], - name: 'Germany' - }, - { - points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 }, { x: 2007, y: 34 }, { x: 2008, y: 41 }, - { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], - name: 'England' - }, - { - points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 }, { x: 2007, y: 40 }, { x: 2008, y: 44 }, - { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], - name: 'France' - } + points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, + { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], + name: 'France' + } ], isResponsive: true, load: function () { @@ -296,14 +300,14 @@ module ChartComponent { theme = "flatlight"; break; } - sender.model.theme = theme; + sender.model.theme = theme; } }, title: { text: 'Efficiency of oil-fired power production' }, size: { height: "600" }, - legend: { visible: true }, + legend: { visible: true}, }); - // chartsample.model.load="loadTheme"; + // chartsample.model.load="loadTheme"; }); } @@ -357,7 +361,7 @@ module circulargaugecomponent { backgroundColor: "#f5b43f", border: { color: "#f5b43f" } }] - }] + }] }); }); } @@ -376,21 +380,21 @@ module ColorPickerComponent { -module ComboBoxComponent { +module ComboBoxComponent{ var BikeList = [ { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, { empid: "bk4", text: "Discover" }, { empid: "bk5", text: "Dazzler" }, { empid: "bk6", text: "Flame" }, { empid: "bk7", text: "Fazzer" }, { empid: "bk8", text: "FZ-S" }, { empid: "bk9", text: "Pulsar" }, { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } ]; - $(function () { - var comboboxInstance = new ej.ComboBox($("#selectCar"), { + $(function () { + var comboboxInstance =new ej.ComboBox($("#selectCar"), { width: "100%", placeholder: "Select a Bike", - fields: { text: "text", value: "empid" }, + fields: { text: "text", value: "empid" }, dataSource: BikeList, autofill: true - }); + }); }); } @@ -462,8 +466,7 @@ $(function () { }), createNode({ name: "Project", width: 150, height: 100, offsetX: 300, offsetY: 430, labels: [createLabel({ "text": "Find Project \nmanager" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Decision }), createNode({ - name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process - }), + name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), createNode({ name: "Decision", width: 250, height: 60, offsetX: 550, offsetY: 60, labels: [createLabel({ "text": "Decision Process for new software ideas" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Card, fillColor: "#858585", borderColor: "#858585" }), createNode({ name: "Reject", width: 150, height: 60, offsetX: 550, offsetY: 285, labels: [createLabel({ "text": "Reject and write report" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), createNode({ name: "Resources", width: 150, height: 60, offsetX: 550, offsetY: 430, labels: [createLabel({ "text": "Hire new resources" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }) @@ -477,7 +480,7 @@ $(function () { createConnector({ name: "connector6", sourceNode: "Project", targetNode: "Resources", labels: [createLabel({ "text": "No" })] }) ] }); - + }); function createNode(option: ej.datavisualization.Diagram.Node) { @@ -498,11 +501,11 @@ function createConnector(option: ej.datavisualization.Diagram.Connector) { return option; } -function createLabel(options: any) { +function createLabel(options : any) { return options; } - + module DialogComponent { $(function () { @@ -510,17 +513,15 @@ module DialogComponent { width: 550, minWidth: 310, minHeight: 215, - target: ".control", - close: () => { - $("#btnOpen").show(); - } + target:".control", + close:()=>{ + $("#btnOpen").show();} }); var btnInstance = new ej.Button($("#btnOpen"), { size: "medium", - click: () => { - $("#btnOpen").hide(); - $("#basicDialog").ejDialog("open"); - }, + click: ()=>{ + $("#btnOpen").hide(); + $("#basicDialog").ejDialog("open");}, type: "button", height: 30, width: 150 @@ -554,7 +555,7 @@ module digitalgaugecomponent { } - + @@ -566,7 +567,7 @@ module DropDownListComponent { { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } ]; $(function () { - var sample = new ej.DropDownList($("#bikeList"), { + var sample = new ej.DropDownList($("#bikeList"),{ dataSource: BikeList, width: "100%", watermarkText: "Select a bike", @@ -574,12 +575,12 @@ module DropDownListComponent { enableFilterSearch: true, caseSensitiveSearch: true, enableIncrementalSearch: true, - enablePopupResize: true, + enablePopupResize: true, delimiterChar: ";", multiSelectMode: ej.MultiSelectMode.Delimiter, maxPopupHeight: "300px", - minPopupHeight: "150px", - maxPopupWidth: "500px", + minPopupHeight: "150px", + maxPopupWidth: "500px", minPopupWidth: "350px", showCheckbox: true, showRoundedCorner: true @@ -610,53 +611,53 @@ module ExplorerComponent { module GanttComponent { - $(function () { - var ganttInstance = new ej.Gantt($("#GanttContainer"), { - dataSource: (window).projectData, - allowColumnResize: true, - allowSorting: true, - allowSelection: true, - enableContextMenu: true, - taskIdMapping: "taskID", - allowDragAndDrop: true, - taskNameMapping: "taskName", - startDateMapping: "startDate", - showColumnChooser: true, - showColumnOptions: true, - progressMapping: "progress", - durationMapping: "duration", - endDateMapping: "endDate", - childMapping: "subtasks", - scheduleStartDate: "02/01/2017", - scheduleEndDate: "04/09/2017", - //Resources mapping - resourceInfoMapping: "resourceId", - resourceNameMapping: "resourceName", - resourceIdMapping: "resourceId", - resources: (window).projectResources, - predecessorMapping: "predecessor", - showResourceNames: true, - toolbarSettings: { - showToolbar: true, - toolbarItems: ["add", "edit", "delete", "update", "cancel", "indent", "outdent", "expandAll", "collapseAll", "search"] - }, - editSettings: { - allowEditing: true, - allowAdding: true, - allowDeleting: true, - allowIndent: true, - editMode: "cellEditing" - }, - sizeSettings: { - width: "100%", - height: "100%" - }, - dragTooltip: { showTooltip: true }, - showGridCellTooltip: true, - treeColumnIndex: 1, - isResponsive: true, - }); + $(function () { + var ganttInstance = new ej.Gantt($("#GanttContainer"), { + dataSource: (window).projectData, + allowColumnResize: true, + allowSorting: true, + allowSelection: true, + enableContextMenu: true, + taskIdMapping: "taskID", + allowDragAndDrop: true, + taskNameMapping: "taskName", + startDateMapping: "startDate", + showColumnChooser: true, + showColumnOptions: true, + progressMapping: "progress", + durationMapping: "duration", + endDateMapping: "endDate", + childMapping: "subtasks", + scheduleStartDate: "02/01/2017", + scheduleEndDate: "04/09/2017", + //Resources mapping + resourceInfoMapping: "resourceId", + resourceNameMapping: "resourceName", + resourceIdMapping: "resourceId", + resources: (window).projectResources, + predecessorMapping: "predecessor", + showResourceNames: true, + toolbarSettings: { + showToolbar: true, + toolbarItems: ["add","edit","delete","update","cancel","indent","outdent","expandAll","collapseAll","search"] + }, + editSettings: { + allowEditing: true, + allowAdding: true, + allowDeleting: true, + allowIndent: true, + editMode: "cellEditing" + }, + sizeSettings: { + width: "100%", + height: "100%" + }, + dragTooltip: { showTooltip: true }, + showGridCellTooltip: true, + treeColumnIndex: 1, + isResponsive: true, }); +}); } @@ -749,7 +750,7 @@ $(function () { module KanbanComponent { $(function () { var sample = new ej.Kanban($("#Kanban"), { - dataSource: new ej.DataManager((window).kanbanData).executeLocal(new ej.Query().take(20)), + dataSource: new ej.DataManager((window).kanbanData).executeLocal(new ej.Query().take(20)), columns: [ { headerText: "Backlog", key: "Open" }, { headerText: "In Progress", key: "InProgress" }, @@ -768,7 +769,7 @@ module KanbanComponent { }); } - + module lineargaugecomponent { @@ -794,14 +795,14 @@ module lineargaugecomponent { backgroundColor: "#E94649", border: { color: "#E94649" }, startWidth: 4, endWidth: 4 }] - }] + }] }); }); } + - - + module ListBoxComponent { $(function () { @@ -811,13 +812,13 @@ module ListBoxComponent { }); } - + module ListviewComponent { $(function () { var listviewInstance = new ej.ListView($("#defaultlistview"), { - enableCheckMark: true, - width: 400 + enableCheckMark: true, + width: 400 }); }); } @@ -1056,7 +1057,7 @@ module mapcomponenet { module MenuComponent { $(function () { - var sample = new ej.Menu($("#syncfusionProducts"), { + var sample = new ej.Menu($("#syncfusionProducts"),{ width: "100%", animationType: ej.AnimationType.Default, cssClass: 'gradient-lime ', @@ -1081,12 +1082,12 @@ module MenuComponent { - + module NavigationDrawerComponent { $(function () { var navigationdrawerInstance = new ej.NavigationDrawer($("#navpane"), { - targetId: "butdrawer", + targetId: "butdrawer", contentId: "content_container", type: "overlay", direction: "left", @@ -1097,8 +1098,8 @@ module NavigationDrawerComponent { }, position: "normal" }); - $("#navpane_listview").click(function (e: any) { - var text = e.target["text"] || $(e.target).closest("li.e-list").text(); + $("#navpane_listview").click(function(e: any) { + var text=e.target["text"]||$(e.target).closest("li.e-list").text(); $("#butdrawer").parent().children("h2").text(text); }); }); @@ -1109,7 +1110,7 @@ module NavigationDrawerComponent { module PDFViewerComponent { $(function () { var pdfviewerControl = new ej.PdfViewer($("#pdfviewer"), { - serviceUrl: (window).baseurl + "api/PdfViewer", + serviceUrl:(window).baseurl+ "api/PdfViewer", isResponsive: true }); }); @@ -1119,42 +1120,42 @@ module PDFViewerComponent { module PivotChartOlap { $(function () { - var sample = new ej.PivotChart($("#PivotChart"), { + var sample = new ej.PivotChart($("#PivotChart"),{ dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]" - } - ], - axis: "columns" - } - ], - filters: [] - }, - isResponsive: true, zooming: { enableScrollbar: true }, - commonSeriesOptions: { - type: "column" - }, - size: { height: "460px", width: "100%" }, - primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, - primaryYAxis: { title: { text: "Internet Sales Amount" } }, - legend: { visible: true, rowCount: 2 } - // load:"loadTheme" + data: "//bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]" + } + ], + axis: "columns" + } + ], + filters:[] + }, + isResponsive: true,zooming:{enableScrollbar: true}, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, + primaryYAxis: { title: { text: "Internet Sales Amount" } }, + legend: { visible: true, rowCount: 2 } + // load:"loadTheme" }); }); } @@ -1191,45 +1192,45 @@ var pivot_dataset = [ module PivotChartRelational { $(function () { - var sample = new ej.PivotChart($("#PivotChart"), { + var sample = new ej.PivotChart($("#PivotChart"),{ dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - fieldCaption: "Country" - }, - { - fieldName: "State", - fieldCaption: "State" - }, - { - fieldName: "Date", - fieldCaption: "Date" - } - ], - columns: [ - { - fieldName: "Product", - fieldCaption: "Product" - } - ], - values: [ - { - fieldName: "Amount", - fieldCaption: "Amount" - } - ], - filters: [] - }, - isResponsive: true, zooming: { enableScrollbar: true }, - commonSeriesOptions: { - type: "column" - }, - size: { height: "460px", width: "100%" }, - primaryYAxis: { title: { text: "Amount" } }, - legend: { visible: true } - // load:"loadTheme" + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + }, + { + fieldName: "Date", + fieldCaption: "Date" + } + ], + columns: [ + { + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + } + ], + filters:[] + }, + isResponsive: true,zooming:{enableScrollbar: true}, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryYAxis: { title: { text: "Amount" } }, + legend: { visible: true } + // load:"loadTheme" }); }); } @@ -1239,106 +1240,106 @@ module PivotChartRelational { module PivotGaugeOlap { $(function () { - var sample = new ej.PivotGauge($("#PivotGauge"), { + var sample = new ej.PivotGauge($("#PivotGauge"),{ dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]", - filterItems: { filterType: "include", values: ["[Date].[Fiscal].[Fiscal Year].&[2004]"] } - }, - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]" - }, - { - fieldName: "[Measures].[Internet Revenue Status]" - }, - { - fieldName: "[Measures].[Internet Revenue Trend]" - }, - { - fieldName: "[Measures].[Internet Revenue Goal]" - }, - ], - axis: "columns" - } - ], - filters: [] - }, + data: "//bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]", + filterItems: { filterType: "include", values: ["[Date].[Fiscal].[Fiscal Year].&[2004]"] } + }, + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]" + }, + { + fieldName: "[Measures].[Internet Revenue Status]" + }, + { + fieldName: "[Measures].[Internet Revenue Trend]" + }, + { + fieldName: "[Measures].[Internet Revenue Goal]" + }, + ], + axis: "columns" + } + ], + filters:[] + }, enableTooltip: true, isResponsive: true, labelFormatSettings: { decimalPlaces: 2 }, - scales: [{ - showRanges: true, - radius: 150, showScaleBar: true, size: 1, + scales: [{ + showRanges: true, + radius: 150, showScaleBar: true, size: 1, border: { - width: 0.5 - }, - showIndicators: true, showLabels: true, + width: 0.5 + }, + showIndicators: true, showLabels: true, pointers: [{ - showBackNeedle: true, - backNeedleLength: 20, - length: 120, - width: 7 + showBackNeedle: true, + backNeedleLength: 20, + length: 120, + width: 7 }, - { - type: "marker", - markerType: "diamond", - distanceFromScale: 5, - placement: "center", - backgroundColor: "#29A4D9", - length: 25, - width: 15 - }], + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], ticks: [{ - type: "major", + type: "major", distanceFromScale: 2, - height: 16, - width: 1, color: "#8c8c8c" - }, - { - type: "minor", - height: 6, - width: 1, - distanceFromScale: 2, - color: "#8c8c8c" - }], - labels: [{ + height: 16, + width: 1, color: "#8c8c8c" + }, + { + type: "minor", + height: 6, + width: 1, + distanceFromScale: 2, color: "#8c8c8c" }], + labels: [{ + color: "#8c8c8c" + }], ranges: [{ - distanceFromScale: -5, + distanceFromScale: -5, backgroundColor: "#fc0606", - border: { color: "#fc0606" } + border: { color: "#fc0606" } + }, + { + distanceFromScale: -5 + }], + customLabels: [{ + position: { x: 180, y: 290 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" }, - { - distanceFromScale: -5 - }], - customLabels: [{ - position: { x: 180, y: 290 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + { + position: { x: 180, y: 320 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" }, - { - position: { x: 180, y: 320 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }, - { - position: { x: 180, y: 150 }, - font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }] + { + position: { x: 180, y: 150 }, + font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }] }] }); - }); + }); } @@ -1372,94 +1373,94 @@ var pivot_dataset = [ module PivotGaugeRelational { $(function () { - var sample = new ej.PivotGauge($("#PivotGauge"), { + var sample = new ej.PivotGauge($("#PivotGauge"),{ dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - }, - { - fieldName: "State", - } - ], - columns: [ - { - fieldName: "Product", - } - ], + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + }, + { + fieldName: "State", + } + ], + columns: [ + { + fieldName: "Product", + } + ], values: [ - { - fieldName: "Amount", - }, - { - fieldName: "Quantity", - } - ] - }, + { + fieldName: "Amount", + }, + { + fieldName: "Quantity", + } + ] + }, enableTooltip: true, isResponsive: true, labelFormatSettings: { decimalPlaces: 2 }, - scales: [{ - showRanges: true, - radius: 150, showScaleBar: true, size: 1, + scales: [{ + showRanges: true, + radius: 150, showScaleBar: true, size: 1, border: { - width: 0.5 - }, - showIndicators: true, showLabels: true, + width: 0.5 + }, + showIndicators: true, showLabels: true, pointers: [{ - showBackNeedle: true, - backNeedleLength: 20, - length: 120, - width: 7 + showBackNeedle: true, + backNeedleLength: 20, + length: 120, + width: 7 }, - { - type: "marker", - markerType: "diamond", - distanceFromScale: 5, - placement: "center", - backgroundColor: "#29A4D9", - length: 25, - width: 15 - }], + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], ticks: [{ - type: "major", + type: "major", distanceFromScale: 2, - height: 16, - width: 1, color: "#8c8c8c" - }, - { - type: "minor", - height: 6, - width: 1, - distanceFromScale: 2, - color: "#8c8c8c" - }], - labels: [{ + height: 16, + width: 1, color: "#8c8c8c" + }, + { + type: "minor", + height: 6, + width: 1, + distanceFromScale: 2, color: "#8c8c8c" }], + labels: [{ + color: "#8c8c8c" + }], ranges: [{ - distanceFromScale: -5, + distanceFromScale: -5, backgroundColor: "#fc0606", - border: { color: "#fc0606" } + border: { color: "#fc0606" } + }, + { + distanceFromScale: -5 + }], + customLabels: [{ + position: { x: 180, y: 290 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" }, - { - distanceFromScale: -5 - }], - customLabels: [{ - position: { x: 180, y: 290 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + { + position: { x: 180, y: 320 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" }, - { - position: { x: 180, y: 320 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }, - { - position: { x: 180, y: 150 }, - font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }] + { + position: { x: 180, y: 150 }, + font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }] }] }); - }); + }); } @@ -1467,35 +1468,35 @@ module PivotGaugeRelational { module PivotGridOlap { $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"), { + var sample = new ej.PivotGrid($("#PivotGrid"),{ dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]", - } - ], - axis: "columns" - } - ], - filters: [] - }, - enableGroupingBar: true, - pivotTableFieldListID: "PivotSchemaDesigner" + data: "//bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]", + } + ], + axis: "columns" + } + ], + filters:[] + }, + enableGroupingBar: true, + pivotTableFieldListID:"PivotSchemaDesigner" }); $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); }); @@ -1532,41 +1533,41 @@ var pivot_dataset = [ module PivotGridRelational { $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"), { + var sample = new ej.PivotGrid($("#PivotGrid"),{ dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - fieldCaption: "Country" - }, - { - fieldName: "State", - fieldCaption: "State" - } - ], - columns: - [{ - fieldName: "Product", - fieldCaption: "Product" - } - ], - values: [ - { - fieldName: "Amount", - fieldCaption: "Amount" - }, - { - fieldName: "Quantity", - fieldCaption: "Quantity" - } - ], - filters: [] - }, - enableGroupingBar: true, - pivotTableFieldListID: "PivotSchemaDesigner" + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + } + ], + columns: + [{ + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + }, + { + fieldName: "Quantity", + fieldCaption: "Quantity" + } + ], + filters:[] + }, + enableGroupingBar: true, + pivotTableFieldListID:"PivotSchemaDesigner" }); - $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); + $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); }); } @@ -1575,33 +1576,33 @@ module PivotGridRelational { module PivotTreeMap { $(function () { - var sample = new ej.PivotTreeMap($("#PivotTreeMap"), { + var sample = new ej.PivotTreeMap($("#PivotTreeMap"),{ dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll;Locale Identifier=1033;", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - columns: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Customer Count]", - } - ], - axis: "columns" - } - ], - filters: [] - } + data: "//bi.syncfusion.com/olap/msmdpump.dll;Locale Identifier=1033;", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + columns: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Customer Count]", + } + ], + axis: "columns" + } + ], + filters:[] + } }); }); } @@ -1610,7 +1611,7 @@ module PivotTreeMap { module ProgressBarComponent { $(function () { - var sample = new ej.ProgressBar($("#progressBar"), { + var sample = new ej.ProgressBar($("#progressBar"),{ width: 200, value: 45, height: 20, @@ -1640,7 +1641,7 @@ module RadialMenuComponent { backImageClass: "backimageclass", targetElementId: "radialtarget1" }); - $("#radialtarget1").parent().css("position", "relative"); + $("#radialtarget1").parent().css("position", "relative"); } else { $("#contentDiv").html("Radial Menu is only supported from Internet Explorer Versioned 9 and above.").css({ "font-size": "20px", "color": "red" }); @@ -1707,12 +1708,12 @@ function redo(e: any) { } - + module RadialSliderComponent { $(function () { var radialsliderInstance = new ej.RadialSlider($("#radialSlider"), { - innerCircleImageUrl: "images/radialslider/chevron-right.png" + innerCircleImageUrl: "images/radialslider/chevron-right.png" }); }); } @@ -1809,8 +1810,8 @@ var data; data = GetData(); function GetData() { - var series1: any[] = []; - var series2: any[] = []; + var series1:any[]=[]; + var series2:any[]= []; var value = 100; var value1 = 120; for (var i = 1; i < 730; i++) { @@ -1837,7 +1838,7 @@ function GetData() { module RatingComponent { $(function () { - var sample1 = new ej.Rating($("#fullRating"), { + var sample1 = new ej.Rating($("#fullRating"),{ value: 4, precision: ej.Rating.Precision.Full, allowReset: true, @@ -1852,8 +1853,8 @@ module RatingComponent { shapeWidth: 25, showTooltip: true }); - - var sample2 = new ej.Rating($("#halfRating"), { + + var sample2 = new ej.Rating($("#halfRating"),{ precision: ej.Rating.Precision.Half, value: 3.5, allowReset: true, @@ -1869,7 +1870,7 @@ module RatingComponent { showTooltip: true }); - var sample3 = new ej.Rating($("#exactRating"), { + var sample3 = new ej.Rating($("#exactRating"),{ precision: ej.Rating.Precision.Exact, value: 3.7, allowReset: true, @@ -1883,7 +1884,7 @@ module RatingComponent { shapeHeight: 25, shapeWidth: 25, showTooltip: true - }); + }); }); } @@ -1891,15 +1892,15 @@ module RatingComponent { module ReportViewerComponent { - $(function () { - var report = new ej.ReportViewer($("#territoryReportViewer"), { - reportServiceUrl: (window).baseurl + 'api/ReportViewer', - reportServerUrl: 'http://104.207.134.201/reportserver', - processingMode: ej.ReportViewer.ProcessingMode.Remote, - reportPath: "/SSRSSamples2/Territory Sales new", - isResponsive: true - }); - }); + $(function () { + var report = new ej.ReportViewer($("#territoryReportViewer"), { + reportServiceUrl: (window).baseurl + 'api/ReportViewer', + reportServerUrl: 'http://104.207.134.201/reportserver', + processingMode: ej.ReportViewer.ProcessingMode.Remote, + reportPath: "/SSRSSamples2/Territory Sales new", + isResponsive: true + }); + }); } @@ -1916,7 +1917,7 @@ module RibbonComponent { toolTip: "Pin the Ribbon" }, applicationTab: { - type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } + type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } }, tabs: [{ id: "home", text: "HOME", groups: [{ @@ -1940,7 +1941,7 @@ module RibbonComponent { } }] }, - { + { text: "Clipboard", alignType: ej.Ribbon.AlignType.Columns, content: [{ groups: [{ id: "paste", @@ -1962,8 +1963,8 @@ module RibbonComponent { height: 70 } }, - { - groups: [{ + { + groups: [{ id: "cut", text: "Cut", toolTip: "Cut", @@ -1993,14 +1994,14 @@ module RibbonComponent { prefixIcon: "e-icon e-ribbon clearAll" } }], - defaults: { + defaults: { type: "button", width: 60, isBig: false } - }] - }, - { + }] + }, + { text: "Font", alignType: "rows", content: [{ groups: [{ id: "fontfamily", @@ -2299,7 +2300,7 @@ module RibbonComponent { groups: [{ id: "zoomin", text: "Zoom In", - toolTip: "Zoom In", + toolTip: "Zoom In", buttonSettings: { width: 58, click: "onClick", @@ -2311,7 +2312,7 @@ module RibbonComponent { { id: "zoomout", text: "Zoom Out", - toolTip: "Zoom Out", + toolTip: "Zoom Out", buttonSettings: { width: 70, click: "onClick", @@ -2323,7 +2324,7 @@ module RibbonComponent { { id: "fullscreen", text: "Full Screen", - toolTip: "Full Screen", + toolTip: "Full Screen", buttonSettings: { width: 73, click: "onClick", @@ -2339,7 +2340,7 @@ module RibbonComponent { } }] }] - }, { + },{ id: "insert", text: "INSERT", groups: [{ text: "Tables", alignType: ej.Ribbon.AlignType.Columns, content: [{ groups: [{ @@ -2484,7 +2485,7 @@ module RibbonComponent { } ], defaults: { - type: "button", + type: "button", width: 70, height: 70 } @@ -2566,7 +2567,7 @@ module RibbonComponent { } ] } - ], + ], create: function createControl(args) { var ribbon = $("#defaultRibbon").data("ejRibbon"); $("#fontcolor").ejColorPicker({ value: "#FFFF00", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fontcoloricon", select: colorHandler }); @@ -2578,7 +2579,7 @@ module RibbonComponent { function colorHandler(args:any) { (this._id.indexOf("fillcolor") != -1) ? $("#contenteditor").css('background-color', args.value) : document.execCommand('forecolor', false, args.value); } -function onClick(args: any) { +function onClick(args:any) { var val, prop = args.text; val = (ej.isNullOrUndefined(args.model.text)) ? args.model.activeText : args.model.text; if (action1.indexOf(val) != -1) @@ -2596,7 +2597,7 @@ function onClick(args: any) { - + module RotatorComponent { $(function () { @@ -2606,14 +2607,14 @@ module RotatorComponent { slideHeight: "auto", displayItemsCount: "1", navigateSteps: "1", - pagerPosition: "outside", + pagerPosition:"outside", orientation: "horizontal", showPager: true, enabled: true, showCaption: true, allowKeyboardNavigation: true, showPlayButton: true, - isResponsive: true, + isResponsive:true, animationType: "slide", }); }); @@ -2623,7 +2624,7 @@ module RotatorComponent { module RTEComponent { $(function () { - var sample = new ej.RTE($("#rteSample"), { + var sample = new ej.RTE($("#rteSample"),{ width: "100%", minWidth: "150px", showFooter: true, @@ -2759,7 +2760,7 @@ module ScheduleComponent { } }); }); -} +} @@ -2819,10 +2820,10 @@ module linesparkline { dataSource: [12, 14, 11, 12, 11, 15, 12, 10, 11, 12, 15, 13, 12, 11, 10, 13, 15, 12, 14, 16, 14, 12, 11], tooltip: { visible: true, - font: { size: "12px" } + font: { size:"12px" } }, type: "line", - size: { height: "40", width: "170" }, + size: { height: "40", width:"170" }, }); }); } @@ -2830,7 +2831,7 @@ module linesparkline { module columnsparkline { $(function () { var sparkcolumnsample = new ej.Sparkline($("#column"), { - dataSource: [2, 6, -1, 1, 12, 5, -2, 7, -3, 5, 8, 10, ], + dataSource: [2, 6, -1, 1, 12, 5, -2, 7, -3, 5, 8, 10,], negativePointColor: "red", highPointColor: "blue", tooltip: { @@ -2848,7 +2849,7 @@ module columnsparkline { module areasparkline { $(function () { var sparkareasample = new ej.Sparkline($("#area"), { - dataSource: [12, -10, 11, 8, 17, 6, 2, -17, 13, -6, 8, 10, ], + dataSource: [12, -10, 11, 8, 17, 6, 2, -17, 13, -6, 8, 10,], markerSettings: { visible: true }, highPointColor: "blue", lowPointColor: "orange", @@ -2868,7 +2869,7 @@ module areasparkline { module windlosssparkline { $(function () { var sparkwinlosssample = new ej.Sparkline($("#winloss"), { - dataSource: [12, 15, -11, 13, 17, 0, -12, 17, 13, -15, 8, 10, ], + dataSource: [12, 15, -11, 13, 17, 0, -12, 17, 13, -15, 8, 10,], type: "winloss", size: { height: "100", width: "150" }, }); @@ -2894,7 +2895,7 @@ module piesparkline1 { module piesparkline2 { $(function () { var sparkpiesample2 = new ej.Sparkline($("#pie2"), { - dataSource: [8, 9, 1, ], + dataSource: [8, 9, 1,], type: "pie", tooltip: { visible: true, @@ -2939,9 +2940,9 @@ module piesparkline4 { }); } + - - + module SplitterComponent { @@ -2951,10 +2952,10 @@ module SplitterComponent { width: "50%", orientation: ej.Orientation.Vertical, properties: [{}, { paneSize: 80 }], - isResponsive: true + isResponsive:true }); var splitterInstance1 = new ej.Splitter($("#innerSpliter"), { - isResponsive: true, + isResponsive:true, }); }); } @@ -2962,7 +2963,7 @@ module SplitterComponent { module SpreadsheetComponent { - $(function () { +$(function () { var sample = new ej.Spreadsheet($("#basicSpreadsheet"), { scrollSettings: { height: 550, @@ -2976,15 +2977,14 @@ module SpreadsheetComponent { pdfUrl: (window).baseurl + "api/Spreadsheet/PdfExport" }, sheets: [{ rangeSettings: [{ dataSource: (window).defaultData, startCell: "A1" }] }], - loadComplete: () => { - var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; - if (!(spreadsheet).isImport) { - spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); - xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); - xlFormat.format({ "type": "currency" }, "E2:H11"); - spreadsheet.XLRibbon.updateRibbonIcons(); - } - } + loadComplete: () => { + var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; + if (!(spreadsheet).isImport) { + spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); + xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); + xlFormat.format({ "type": "currency" }, "E2:H11"); + spreadsheet.XLRibbon.updateRibbonIcons(); + }} }); }); } @@ -2993,58 +2993,58 @@ module SpreadsheetComponent { var default_data: Array = [ - { Category: "Employees", Country: "USA", JobDescription: "Sales", JobGroup: "Executive", EmployeesCount: 50 }, - { Category: "Employees", Country: "USA", JobDescription: "Sales", JobGroup: "Analyst", EmployeesCount: 40 }, - { Category: "Employees", Country: "USA", JobDescription: "Marketing", EmployeesCount: 40 }, - { Category: "Employees", Country: "USA", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 55 }, - { Category: "Employees", Country: "USA", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 175 }, - { Category: "Employees", Country: "USA", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 70 }, - { Category: "Employees", Country: "USA", JobDescription: "Management", EmployeesCount: 40 }, - { Category: "Employees", Country: "USA", JobDescription: "Accounts", EmployeesCount: 60 }, - - { Category: "Employees", Country: "India", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 43 }, - { Category: "Employees", Country: "India", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 125 }, - { Category: "Employees", Country: "India", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 60 }, - { Category: "Employees", Country: "India", JobDescription: "HR Executives", EmployeesCount: 70 }, - { Category: "Employees", Country: "India", JobDescription: "Accounts", EmployeesCount: 45 }, - - { Category: "Employees", Country: "Germany", JobDescription: "Sales", JobGroup: "Executive", EmployeesCount: 30 }, - { Category: "Employees", Country: "Germany", JobDescription: "Sales", JobGroup: "Analyst", EmployeesCount: 40 }, - { Category: "Employees", Country: "Germany", JobDescription: "Marketing", EmployeesCount: 50 }, - { Category: "Employees", Country: "Germany", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 40 }, - { Category: "Employees", Country: "Germany", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 65 }, - { Category: "Employees", Country: "Germany", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 27 }, - { Category: "Employees", Country: "Germany", JobDescription: "Management", EmployeesCount: 33 }, - { Category: "Employees", Country: "Germany", JobDescription: "Accounts", EmployeesCount: 55 }, - - { Category: "Employees", Country: "UK", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 45 }, - { Category: "Employees", Country: "UK", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 96 }, - { Category: "Employees", Country: "UK", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 55 }, - { Category: "Employees", Country: "UK", JobDescription: "HR Executives", EmployeesCount: 60 }, - { Category: "Employees", Country: "UK", JobDescription: "Accounts", EmployeesCount: 30 }, - - { Category: "Employees", Country: "France", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 40 }, - { Category: "Employees", Country: "France", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 65 }, - { Category: "Employees", Country: "France", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 27 }, - { Category: "Employees", Country: "France", JobDescription: "Marketing", EmployeesCount: 50 } + { Category : "Employees", Country : "USA", JobDescription : "Sales", JobGroup:"Executive", EmployeesCount : 50 }, + { Category : "Employees", Country : "USA", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, + { Category : "Employees", Country : "USA", JobDescription : "Marketing", EmployeesCount : 40 }, + { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 55 }, + { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 175}, + { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 70 }, + { Category : "Employees", Country : "USA", JobDescription : "Management", EmployeesCount : 40 }, + { Category : "Employees", Country : "USA", JobDescription : "Accounts", EmployeesCount : 60 }, + + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 43 }, + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 125}, + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 60 }, + { Category : "Employees", Country : "India", JobDescription : "HR Executives", EmployeesCount : 70 }, + { Category : "Employees", Country : "India", JobDescription : "Accounts", EmployeesCount : 45 }, + + { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Executive", EmployeesCount : 30 }, + { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, + { Category : "Employees", Country : "Germany", JobDescription : "Marketing", EmployeesCount : 50 }, + { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, + { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, + { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, + { Category : "Employees", Country : "Germany", JobDescription : "Management", EmployeesCount : 33 }, + { Category : "Employees", Country : "Germany", JobDescription : "Accounts", EmployeesCount : 55 }, + + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 45 }, + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 96 }, + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 55 }, + { Category : "Employees", Country : "UK", JobDescription : "HR Executives", EmployeesCount : 60 }, + { Category : "Employees", Country : "UK", JobDescription: "Accounts", EmployeesCount: 30 }, + + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, + { Category : "Employees", Country : "France", JobDescription: "Marketing", EmployeesCount: 50 } ]; module sunburstcomponent { $(function () { var sunburstsample = new ej.SunburstChart($("#Sunburst"), { - valueMemberPath: "EmployeesCount", + valueMemberPath: "EmployeesCount", levels: [ - { groupMemberPath: "Country" }, - { groupMemberPath: "JobDescription" }, - { groupMemberPath: "JobGroup" }, - { groupMemberPath: "JobRole" } + {groupMemberPath: "Country"}, + {groupMemberPath: "JobDescription"}, + {groupMemberPath: "JobGroup"}, + {groupMemberPath: "JobRole"} ], dataSource: default_data, - dataLabelSettings: { visible: true }, - tooltip: { visible: false }, - enableAnimation: false, - size: { height: "600" }, - innerRadius: 0.2, + dataLabelSettings:{visible:true}, + tooltip:{visible:false}, + enableAnimation:false, + size:{height:"600"}, + innerRadius:0.2, load: function () { var sender = $("#Sunburst").data("ejSunburstChart"); var SunBurstTheme = (window).themeStyle + (window).themeColor + (window).themeVarient; @@ -3055,10 +3055,10 @@ module sunburstcomponent { SunBurstTheme = "flatlight"; sender.model.theme = SunBurstTheme; }, - title: { text: "Employees Count" }, - zoomSettings: { enable: false }, - legend: { visible: true, position: 'top' } - // load:"loadTheme" + title:{text:"Employees Count"}, + zoomSettings:{enable:false}, + legend:{visible:true,position:'top'} + // load:"loadTheme" }); }); } @@ -3068,7 +3068,7 @@ module sunburstcomponent { module TabComponent { $(function () { - var sample = new ej.Tab($("#defaultTab"), { + var sample = new ej.Tab($("#defaultTab"),{ width: "500px", collapsible: true, events: "click", @@ -3082,8 +3082,8 @@ module TabComponent { module TagCloudComponent { - - + + var websiteCollection = [ { text: "Google", url: "http://www.google.com", frequency: 12 }, { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, @@ -3114,7 +3114,7 @@ module TagCloudComponent { text: "text", url: "url", frequency: "frequency" } }); - + }); } @@ -3154,82 +3154,82 @@ module EditorComponent { - + module TileViewComponent { $(function () { var tile1 = new ej.Tile($("#tile1"), { - imagePosition: "fill", - caption: { text: "People" }, - tileSize: "medium", - imageUrl: 'content/images/tile/windows/people_1.png' + imagePosition:"fill", + caption:{text:"People"}, + tileSize:"medium", + imageUrl:'content/images/tile/windows/people_1.png' }); - var tile2 = new ej.Tile($("#tile2"), { - imagePosition: "center", - tileSize: "small", - imageUrl: 'content/images/tile/windows/alerts.png', - + var tile2 = new ej.Tile($("#tile2"), { + imagePosition:"center", + tileSize:"small", + imageUrl:'content/images/tile/windows/alerts.png', + }); - var tile3 = new ej.Tile($("#tile3"), { - imagePosition: "center", - tileSize: "small", - imageUrl: 'content/images/tile/windows/bing.png', + var tile3 = new ej.Tile($("#tile3"), { + imagePosition:"center", + tileSize:"small", + imageUrl:'content/images/tile/windows/bing.png', }); - var tile4 = new ej.Tile($("#tile4"), { - tileSize: "small", - imageUrl: 'content/images/tile/windows/camera.png', + var tile4 = new ej.Tile($("#tile4"), { + tileSize:"small", + imageUrl:'content/images/tile/windows/camera.png', }); - var tile5 = new ej.Tile($("#tile5"), { - imagePosition: "center", - tileSize: "small", - imageUrl: 'content/images/tile/windows/messages.png', + var tile5 = new ej.Tile($("#tile5"), { + imagePosition:"center", + tileSize:"small", + imageUrl:'content/images/tile/windows/messages.png', }); - var tile6 = new ej.Tile($("#tile6"), { - imagePosition: "center", - tileSize: "medium", - imageUrl: 'content/images/tile/windows/games.png', - caption: { text: "Play" } + var tile6 = new ej.Tile($("#tile6"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/games.png', + caption:{text:"Play"} }); - var tile7 = new ej.Tile($("#tile7"), { - tileSize: "medium", - imageUrl: 'content/images/tile/windows/map.png', - caption: { text: "Maps" } + var tile7 = new ej.Tile($("#tile7"), { + tileSize:"medium", + imageUrl:'content/images/tile/windows/map.png', + caption:{text:"Maps"} }); - var tile8 = new ej.Tile($("#tile8"), { - imagePosition: "fill", - tileSize: "wide", - imageUrl: 'content/images/tile/windows/sports.png', - caption: { text: "Sports" } + var tile8 = new ej.Tile($("#tile8"), { + imagePosition:"fill", + tileSize:"wide", + imageUrl:'content/images/tile/windows/sports.png', + caption:{text:"Sports"} }); - var tile9 = new ej.Tile($("#tile9"), { - imagePosition: "fill", - tileSize: "medium", - imageUrl: 'content/images/tile/windows/people_2.png', - caption: { text: "People" } + var tile9 = new ej.Tile($("#tile9"), { + imagePosition:"fill", + tileSize:"medium", + imageUrl:'content/images/tile/windows/people_2.png', + caption:{text:"People"} }); - var tile10 = new ej.Tile($("#tile10"), { - imagePosition: "center", - tileSize: "medium", - imageUrl: 'content/images/tile/windows/pictures.png', - caption: { text: "Photo" } + var tile10 = new ej.Tile($("#tile10"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/pictures.png', + caption:{text:"Photo"} }); - var tile11 = new ej.Tile($("#tile11"), { - imagePosition: "center", - tileSize: "wide", - imageUrl: 'content/images/tile/windows/weather.png', - caption: { text: "Weather" } + var tile11 = new ej.Tile($("#tile11"), { + imagePosition:"center", + tileSize:"wide", + imageUrl:'content/images/tile/windows/weather.png', + caption:{text:"Weather"} }); - var tile12 = new ej.Tile($("#tile12"), { - imagePosition: "center", - tileSize: "medium", - imageUrl: 'content/images/tile/windows/music.png', - caption: { text: "Music" } + var tile12 = new ej.Tile($("#tile12"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/music.png', + caption:{text:"Music"} }); - var tile13 = new ej.Tile($("#tile13"), { - imagePosition: "center", - tileSize: "medium", - imageUrl: 'content/images/tile/windows/favs.png', - caption: { text: "Favorites" } + var tile13 = new ej.Tile($("#tile13"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/favs.png', + caption:{text:"Favorites"} }); }); } @@ -3248,13 +3248,13 @@ module TimePickerComponent { module ToolbarComponent { - + $(function () { - var sample = new ej.Toolbar($("#editingToolbar"), { + var sample = new ej.Toolbar($("#editingToolbar"),{ width: "100%", cssClass: "gradient-lime", enableSeparator: true, - + isResponsive: true, orientation: ej.Orientation.Horizontal, showRoundedCorner: true @@ -3267,10 +3267,10 @@ module ToolbarComponent { module TooltipComponent { - + $(function () { - var sample1 = new ej.Tooltip($("#link1"), { + var sample1 = new ej.Tooltip($("#link1"),{ content: "ECMAScript (or ES) is a trademarked scripting-language specification standardized by Ecma International in ECMA-262 and ISO/IEC 16262.", associate: "mousefollow", autoCloseTimeout: 5000, @@ -3280,7 +3280,7 @@ module TooltipComponent { showShadow: true }); - var sample2 = new ej.Tooltip($("#link2"), { + var sample2 = new ej.Tooltip($("#link2"),{ content: "The World Wide Web (WWW) is an information space where documents and other web resources are identified by URLs, interlinked by hypertext links, and can be accessed via the Internet.", position: { stem: { @@ -3299,7 +3299,7 @@ module TooltipComponent { showShadow: true }); - var sample3 = new ej.Tooltip($("#link3"), { + var sample3 = new ej.Tooltip($("#link3"),{ content: 'Object-oriented programming (OOP) is a programming language model organized around objects rather than "actions" and data rather than logic.', position: { stem: { @@ -3326,43 +3326,43 @@ module TooltipComponent { module TreeGridComponent { $(function () { var treegridInstance = new ej.TreeGrid($("#TreeGridContainer"), { - dataSource: (window).treeGridData, - childMapping: "subtasks", - allowSorting: true, - allowMultiSorting: true, - enableAltRow: true, - allowFiltering: true, - treeColumnIndex: 1, - allowKeyboardNavigation: true, - showColumnChooser: true, - showColumnOptions: true, - contextMenuSettings: { - showContextMenu: true, - contextMenuItems: ["add", "edit", "delete"] - }, - columnDialogFields: ["field", "headerText", "editType", "width", "visible", "allowSorting", "textAlign", "headerTextAlign"], - editSettings: { - allowAdding: true, - allowEditing: true, - allowDeleting: true, - editMode: "cellEditing", - rowPosition: "belowSelectedRow" - }, - toolbarSettings: { - showToolbar: true, - toolbarItems: ["add", "edit", "delete", "update", "cancel", "expandAll", "collapseAll"] - }, - columns: [ - { field: "taskID", headerText: "Task Id", allowFiltering: false, editType: "numericedit", filterEditType: "numericedit" }, - { field: "taskName", headerText: "Task Name", editType: "stringedit", filterEditType: "stringedit" }, - { field: "startDate", headerText: "Start Date", editType: "datepicker", filterEditType: "datepicker", format: "{0:MM/dd/yyyy}" }, - { field: "endDate", headerText: "End Date", editType: "datepicker", filterEditType: "datepicker", format: "{0:MM/dd/yyyy}" }, - { field: "progress", headerText: "Progress", editType: "numericedit", filterEditType: "numericedit" } - ], - isResponsive: true, - }); + dataSource: (window).treeGridData, + childMapping: "subtasks", + allowSorting: true, + allowMultiSorting: true, + enableAltRow: true, + allowFiltering: true, + treeColumnIndex: 1, + allowKeyboardNavigation: true, + showColumnChooser: true, + showColumnOptions: true, + contextMenuSettings: { + showContextMenu: true, + contextMenuItems: ["add", "edit", "delete"] + }, + columnDialogFields: ["field", "headerText", "editType", "width", "visible", "allowSorting", "textAlign", "headerTextAlign"], + editSettings: { + allowAdding: true, + allowEditing: true, + allowDeleting: true, + editMode: "cellEditing", + rowPosition: "belowSelectedRow" + }, + toolbarSettings: { + showToolbar: true, + toolbarItems: ["add","edit","delete","update","cancel","expandAll","collapseAll"] + }, + columns: [ + { field: "taskID", headerText: "Task Id", allowFiltering: false, editType: "numericedit", filterEditType: "numericedit" }, + { field: "taskName", headerText: "Task Name", editType: "stringedit", filterEditType: "stringedit" }, + { field: "startDate", headerText: "Start Date", editType: "datepicker", filterEditType: "datepicker", format:"{0:MM/dd/yyyy}" }, + { field: "endDate", headerText: "End Date", editType: "datepicker", filterEditType: "datepicker", format:"{0:MM/dd/yyyy}" }, + { field: "progress", headerText: "Progress", editType: "numericedit", filterEditType: "numericedit" } + ], + isResponsive: true, }); -} +}); +} @@ -3407,7 +3407,7 @@ module treemapcomponent { - + module TreeViewComponent { $(function () { @@ -3424,9 +3424,9 @@ module TreeViewComponent { module UploadboxComponent { - + $(function () { - var sample = new ej.Uploadbox($("#UploadDefault"), { + var sample = new ej.Uploadbox($("#UploadDefault"),{ saveUrl: (window).baseurl + "api/uploadbox/Save", removeUrl: (window).baseurl + "api/uploadbox/Remove", buttonText: { @@ -3449,12 +3449,12 @@ module UploadboxComponent { module WaitingPopupComponent { $(function () { - var sample = new ej.WaitingPopup($("#target"), { + var sample = new ej.WaitingPopup($("#target"),{ showOnInit: true, showImage: true, text: 'waiting…', - target: "#target", - appendTo: "#waiting" + target: "#target", + appendTo: "#waiting" }); }); diff --git a/types/ej.web.all/index.d.ts b/types/ej.web.all/index.d.ts index 03f6b12c24..2342262ca6 100644 --- a/types/ej.web.all/index.d.ts +++ b/types/ej.web.all/index.d.ts @@ -2,13 +2,13 @@ // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version:2.3 /// /*! * filename: ej.web.all.d.ts -* version : 16.1.0.24 +* version : 16.1.0.32 * Copyright Syncfusion Inc. 2001 - 2018. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing @@ -378,7 +378,7 @@ declare namespace ej { update(dm: ej.DataManager, keyField: string, value: any, tableName: string): any; } class ForeignKeyAdaptor extends ej.JsonAdaptor { - constructor(); + constructor(data: any, type: string); processQuery(ds: any, query: ej.Query): any; insert(dm: ej.DataManager, data: any, tableName: string): { url: string; data: any }; update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { url: string; type: string; data: any }; @@ -9567,8 +9567,8 @@ declare namespace ej { */ cssClass?: string; - /** Sets the separator when the multiSelectMode with delimiter option or checkbox is enabled.When you enter the delimiter value, the text after the delimiter is considered as a - * separateword or query. The delimiter string is a single character and must be a symbol. Mostly,the delimiter symbol is used as comma (,), semi-colon (;), or any other special + /** Sets the separator when the multiSelectMode with delimiter option or checkbox is enabled. When you enter the delimiter value, the text after the delimiter is considered as a + * separate word or query. The delimiter string is a single character and must be a symbol. Mostly, the delimiter symbol is used as comma (,), semi-colon (;), or any other special * character. * @Default {,} */ @@ -9628,12 +9628,12 @@ declare namespace ej { */ readOnly?: boolean; - /** The DropDownTree’s textbox is displayed with rounded corner style. + /** The DropDownTree's textbox is displayed with rounded corner style. * @Default {false} */ showRoundedCorner?: boolean; - /** Specifies the targetID for the DropDownTree’s items. + /** Specifies the targetID for the DropDownTree's items. * @Default {null} */ targetID?: string; @@ -9653,8 +9653,8 @@ declare namespace ej { */ validationRules?: any; - /** Specifies the value (text content) for the DropDownTree control. For the single selection mode, the selected item’s value will be returned in its data type, and for - * MultiSelectMode, returns the selected items’ values separated by delimiter in string type. + /** Specifies the value (text content) for the DropDownTree control. For the single selection mode, the selected item's value will be returned in its data type, and for + * MultiSelectMode, returns the selected items values separated by delimiter in string type. * @Default {null} */ value?: string; @@ -9678,7 +9678,7 @@ declare namespace ej { */ blur?(e: BlurEventArgs): void; - /** Fires the action when the DropDownTree control’s value is changed. + /** Fires the action when the DropDownTree control's value is changed. */ change?(e: ChangeEventArgs): void; @@ -9744,15 +9744,15 @@ declare namespace ej { */ model?: any; - /** Selected item’s text. + /** Selected item's text. */ selectedText?: string; - /** Selected item’s text. + /** Selected item's text. */ text?: string; - /** Selected item’s value. + /** Selected item's value. */ value?: string; @@ -9779,11 +9779,11 @@ declare namespace ej { */ model?: any; - /** Selected item’s text. + /** Selected item's text. */ text?: string; - /** Selected item’s value. + /** Selected item's value. */ value?: string; @@ -9810,11 +9810,11 @@ declare namespace ej { */ model?: any; - /** Selected item’s text. + /** Selected item's text. */ text?: string; - /** Selected item’s value. + /** Selected item's value. */ value?: string; } @@ -9863,7 +9863,7 @@ declare namespace ej { */ model?: any; - /** Selected item’s text. + /** Selected item's text. */ selectedText?: string; @@ -9905,11 +9905,11 @@ declare namespace ej { */ model?: any; - /** Selected item’s text. + /** Selected item's text. */ text?: string; - /** Selected item’s value. + /** Selected item's value. */ value?: string; } @@ -9928,11 +9928,11 @@ declare namespace ej { */ model?: any; - /** Selected item’s text. + /** Selected item's text. */ text?: string; - /** Selected item’s value. + /** Selected item's value. */ value?: string; @@ -9961,7 +9961,7 @@ declare namespace ej { } } enum Textmode { - //When TextMode property is set to none, only selected/checked node’s text is presented. + //When TextMode property is set to none, only selected/checked node's text is presented. None, //When FullPath option is selected, the full path of the selected node is shown in the control. FullPath, @@ -19622,6 +19622,11 @@ declare namespace ej { */ value?: string|Date; + /** Specifies the water mark text to be displayed in input text. + * @Default {select a time} + */ + watermarkText?: string; + /** Defines the width of the TimePicker textbox. */ width?: string|number; @@ -30758,6 +30763,11 @@ declare namespace ej { */ operationalMode?: ej.Pivot.OperationalMode|string; + /** To override x axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. + * @Default {[]} + */ + axes?: any[]; + /** This is a horizontal axis that contains options to configure the axis and it is the primary x-axis for all series in the series array. To override x-axis for particular series, * create an axis object by providing a unique name by using the name property and add it to the axes array. Then, assign the name to the series’s xAxisName property to link both * the axis and the series. @@ -30818,10 +30828,6 @@ declare namespace ej { */ beforeServiceInvoke?(e: BeforeServiceInvokeEventArgs): void; - /** Triggers before the pivot engine starts to populate. - */ - beforePivotEnginePopulate?(e: BeforePivotEnginePopulateEventArgs): void; - /** Triggers when performing drill up/down operation in the pivot chart control. */ drillSuccess?(e: DrillSuccessEventArgs): void; @@ -30888,13 +30894,6 @@ declare namespace ej { element?: any; } - export interface BeforePivotEnginePopulateEventArgs { - - /** returns the current instance of PivotChart. - */ - chartObj?: any; - } - export interface DrillSuccessEventArgs { /** returns the current instance of PivotChart. @@ -33505,6 +33504,11 @@ declare namespace ej { */ allowInline?: boolean; + /** When set to false, disables the appointment delete option on the Scheduler. + * @Default {true} + */ + allowDelete?: boolean; + /** When set to true, Scheduler allows interaction through keyboard shortcut keys. * @Default {true} */ @@ -37077,6 +37081,11 @@ declare namespace ej { * @Default {0} */ weekStartDay?: number; + + /** Enable or disable the automatic timescale update on cell editing, dialog editing and taskbar editing. + * @Default {true} + */ + updateTimescaleView?: boolean; } export interface SelectedCellIndex { @@ -38114,6 +38123,14 @@ declare namespace ej { */ sortColumn(fieldName: string, columnSortDirection: string): void; + /** To move the TreeGrid rows programmatically with from index ,to index and position. + * @param {number} you can pass drag Index of the row + * @param {number} you can pass target Index of the row. + * @param {string} you can pass the drop position as above,below,child + * @returns {void} + */ + moveRow(fromIndex: number, toIndex: number, position: string): void; + /** To reorder the column with field name and target index values * @param {string} you can pass a name of column to reorder. * @param {string} you can pass a target column index to be inserted. @@ -38651,6 +38668,10 @@ declare namespace ej { */ rowDragStop?(e: RowDragStopEventArgs): void; + /** Triggered before row drop action begins. + */ + rowDropActionBegin?(e: RowDropActionBeginEventArgs): void; + /** Triggered before selecting a cell */ cellSelecting?(e: CellSelectingEventArgs): void; @@ -39378,6 +39399,45 @@ declare namespace ej { type?: string; } + export interface RowDropActionBeginEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the row which we start to drag. + */ + draggedRow?: any; + + /** Returns the row index which we start to drag. + */ + draggedRowIndex?: number; + + /** Returns the multiple dragged row collection for multiple reorder + */ + draggedRecords?: any[]; + + /** Returns the drop position. + */ + dropPosition?: string; + + /** Returns the row which we are dropped to row. + */ + targetRow?: any; + + /** Returns the row index which we are dropped to row. + */ + targetRowIndex?: number; + + /** Returns the TreeGrid model. + */ + model?: any; + + /** Returns the name of the event. + */ + type?: string; + } + export interface CellSelectingEventArgs { /** Returns the cancel option value. @@ -42693,6 +42753,8 @@ declare namespace ej { XLSort: Spreadsheet.XLSort; + XLSparkline: Spreadsheet.XLSparkline; + XLValidate: Spreadsheet.XLValidate; } export namespace Spreadsheet { @@ -43547,6 +43609,35 @@ declare namespace ej { sortByRange(range: any[]|string, columnName: string, direction: any): boolean; } + export interface XLSparkline { + + /** This method used for creating the sparkline chart for specified range in spreadsheet. + * @param {string} Pass the data range + * @param {string} Pass the location range + * @param {string} Pass the sparkline chart type + * @param {any} Pass the sparkline chart options + * @param {number} Pass the sheetIndex + * @returns {void} + */ + createSparkline(dataRange: string, locationRange: string, type: string, options: any, sheetIndex: number): void; + + /** This method used to change the sparkline color and marker point color in the spreadsheet. + * @param {string} Pass the sparkline ID + * @param {any} Pass the sparkline options + * @param {number} Optional. Pass the sheet index + * @returns {void} + */ + changePointColor(sparklineId: string, option: any, sheetIdx: number): void; + + /** This method used to change the sparkline type in the spreadsheet. + * @param {string} Pass the sparkline ID + * @param {string} Pass the sparkline type + * @param {number} Optional. Pass the sheet index + * @returns {void} + */ + changeType(sparklineId: string, type: string, sheetIdx: number): void; + } + export interface XLValidate { /** This method is used to apply data validation rules in a selected range of cells based on the defined condition in the Spreadsheet. @@ -43737,6 +43828,11 @@ declare namespace ej { */ allowSorting?: boolean; + /** Gets or sets a value that indicates whether to enable the sparkline feature in the Spreadsheet. + * @Default {false} + */ + allowSparkline?: boolean; + /** Gets or sets a value that indicates whether to enable or disable undo and redo feature in the Spreadsheet. * @Default {true} */ From d4a82fd0a56ba06d666663d0c9965bf8bd1acaf1 Mon Sep 17 00:00:00 2001 From: PG Herveou Date: Thu, 29 Mar 2018 09:03:00 -0700 Subject: [PATCH 0328/2153] Ora definition update - Add hideCursor option Add the `hideCursor` option to Ora See https://github.com/sindresorhus/ora#hidecursor --- types/ora/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/ora/index.d.ts b/types/ora/index.d.ts index d43a01c7cf..a3099f6cd9 100644 --- a/types/ora/index.d.ts +++ b/types/ora/index.d.ts @@ -83,6 +83,7 @@ interface Options { interval?: number; stream?: NodeJS.WritableStream; enabled?: boolean; + hideCursor?: boolean; } interface PersistOptions { From 729ee74fc57d40d9c3322eacd8fadb4e02e820cb Mon Sep 17 00:00:00 2001 From: "Narcisse D. ASSOGBA" Date: Thu, 29 Mar 2018 17:44:35 +0100 Subject: [PATCH 0329/2153] Add definitions for sql-bricks package --- types/sql-bricks/index.d.ts | 404 ++++++++++++ types/sql-bricks/sql-bricks-tests.ts | 935 +++++++++++++++++++++++++++ types/sql-bricks/tsconfig.json | 23 + types/sql-bricks/tslint.json | 10 + 4 files changed, 1372 insertions(+) create mode 100644 types/sql-bricks/index.d.ts create mode 100644 types/sql-bricks/sql-bricks-tests.ts create mode 100644 types/sql-bricks/tsconfig.json create mode 100644 types/sql-bricks/tslint.json diff --git a/types/sql-bricks/index.d.ts b/types/sql-bricks/index.d.ts new file mode 100644 index 0000000000..d09bfee715 --- /dev/null +++ b/types/sql-bricks/index.d.ts @@ -0,0 +1,404 @@ +// Type definitions for sql-bricks 2.0 +// Project: http://csnw.github.io/sql-bricks +// Definitions by: Narcisse Assogba +// Paleo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace SqlBricks { + /** + * Statement is an abstract base class for all statements (SELECT, INSERT, UPDATE, DELETE) + * and should never be instantiated directly. It is exposed because it can be used with the + * instanceof operator to easily determine whether something is a SQL Bricks statement: my_var instanceof Statement. + */ + interface Statement { + /** + * Clones a statement so that subsequent modifications do not affect the original statement. + */ + clone(): this + + /** + * Returns the non-parameterized SQL for the statement. This is called implicitly by Javascript when using a Statement anywhere that a string is expected (string concatenation, Array.join(), etc). + * While toString() is easy to use, it is not recommended in most cases because: + * It doesn't provide robust protection against SQL injection attacks (it just does basic escaping) + * It doesn't provide as much support for complex data types (objects, arrays, etc, are "stringified" before being passed to your database driver, which then has to interpret them correctly) + * It does not provide the same level of detail in error messages (see this issue) + * For the above reasons, it is usually better to use toParams(). + */ + toString(): string + + /** + * Returns an object with two properties: a parameterized text string and a values array. The values are populated with anything on the right-hand side + * of a WHERE criteria,as well as any values passed into an insert() or update() (they can be passed explicitly with val() or opted out of with sql()) + * @param options A placeholder option of '?%d' can be passed to generate placeholders compatible with node-sqlite3 (%d is replaced with the parameter #): + * @example + * update('person', {'first_name': 'Fred'}).where({'last_name': 'Flintstone'}).toParams({placeholder: '?%d'}); + * // {"text": "UPDATE person SET first_name = ?1 WHERE last_name = ?2", "values": ["Fred", "Flintstone"]} + */ + toParams(options?: { placeholder: string }): SqlBricksParam + } + + interface SqlBricksParam { + text: string + values: any[] + } + + type TableName = string | SelectStatement + + interface OnCriteria { + [column: string]: string + } + + interface WhereObject { + [column: string]: any + } + + interface WhereGroup { + op?: string + expressions: WhereExpression[] + } + + interface WhereBinary { + op: string + col: string | SelectStatement + val: any + quantifier: string + } + + /** + * When a non-expression object is passed somewhere a whereExpression is expected, + * each key/value pair will be ANDed together: + */ + type WhereExpression = WhereGroup | WhereBinary | WhereObject | string + + /** + * A SELECT statement + */ + interface SelectStatement extends Statement { + /** + * Appends additional columns to an existing query. + * @param columns can be passed as multiple arguments, a comma-delimited string or an array. + */ + select(...columns: string[]): SelectStatement + /** + * Appends additional columns to an existing query. + * @param columns can be passed as multiple arguments, a comma-delimited string or an array. + */ + select(columns: string[]): SelectStatement + select(...params): SelectStatement + as(alias: string): SelectStatement + + distinct(...columns): SelectStatement + + /** + * Makes the query a SELECT ... INTO query (which creates a new table with the results of the query). + * @alias intoTable + * @param tbl new table to create + */ + into(tbl: TableName): SelectStatement + /** + * Makes the query a SELECT ... INTO query (which creates a new table with the results of the query). + * @alias into + * @param tbl new table to create + */ + intoTable(tbl: TableName): SelectStatement + + intoTemp(tbl: TableName): SelectStatement, + intoTempTable(tbl: TableName): SelectStatement, + + /** + * Table names can be passed in as multiple string arguments, a comma-delimited string or an array. + * @param tbls table names + */ + from(...tbls: TableName[]): SelectStatement + /** + * Table names can be passed in as multiple string arguments, a comma-delimited string or an array. + * @param tbls array of table names + */ + from(tbls: TableName[]): SelectStatement + + /** + * Adds the specified join to the query. + * @alias innerJoin + * @param tbl can include an alias after a space or after the 'AS' keyword ('my_table my_alias'). + * @param onCriteria is optional if a joinCriteria function has been supplied. + */ + join(tbl: string, criteria?: OnCriteria | string[] | WhereExpression): SelectStatement + join(tbl: string, onCol1: string, onCol2: string): SelectStatement + join(firstTbl: string, ...otherTbls: string[]): SelectStatement + + leftJoin(tbl: string, criteria?: OnCriteria | string[] | WhereExpression): SelectStatement + leftJoin(tbl: string, onCol1: string, onCol2: string): SelectStatement + leftJoin(firstTbl: string, ...otherTbls: string[]): SelectStatement + rightJoin(tbl: string, criteria?: OnCriteria | string[] | WhereExpression): SelectStatement + rightJoin(tbl: string, onCol1: string, onCol2: string): SelectStatement + rightJoin(firstTbl: string, ...otherTbls: string[]): SelectStatement + fullJoin(tbl: string, criteria?: OnCriteria | string[] | WhereExpression): SelectStatement + fullJoin(tbl: string, onCol1: string, onCol2: string): SelectStatement + fullJoin(firstTbl: string, ...otherTbls: string[]): SelectStatement + crossJoin(tbl: string, criteria?: OnCriteria | string[] | WhereExpression): SelectStatement + crossJoin(tbl: string, onCol1: string, onCol2: string): SelectStatement + crossJoin(firstTbl: string, ...otherTbls: string[]): SelectStatement + innerJoin(tbl: string, criteria?: OnCriteria | string[] | WhereExpression): SelectStatement + innerJoin(tbl: string, onCol1: string, onCol2: string): SelectStatement + innerJoin(firstTbl: string, ...otherTbls: string[]): SelectStatement + leftOuterJoin(tbl: string, criteria?: OnCriteria | string[] | WhereExpression): SelectStatement + leftOuterJoin(tbl: string, onCol1: string, onCol2: string): SelectStatement + leftOuterJoin(firstTbl: string, ...otherTbls: string[]): SelectStatement + rightOuterJoin(tbl: string, criteria?: OnCriteria | string[] | WhereExpression): SelectStatement + rightOuterJoin(tbl: string, onCol1: string, onCol2: string): SelectStatement + rightOuterJoin(firstTbl: string, ...otherTbls: string[]): SelectStatement + fullOuterJoin(tbl: string, criteria?: OnCriteria | string[] | WhereExpression): SelectStatement + fullOuterJoin(tbl: string, onCol1: string, onCol2: string): SelectStatement + fullOuterJoin(firstTbl: string, ...otherTbls: string[]): SelectStatement + + on(onCriteria: OnCriteria | WhereExpression): SelectStatement, + on(onCol1: string, onCol2: string): SelectStatement, + + /** + * Joins using USING instead of ON. + * @param columnList columnList can be passed in as one or more string arguments, a comma-delimited string, or an array. + * @example + * select('*').from('person').join('address').using('address_id', 'country_id'); + * // SELECT * FROM person INNER JOIN address USING (address_id, country_id) + */ + using(...columnList: string[]): SelectStatement + using(columnList: string[]): SelectStatement + + /** + * Adds the specified natural join to the query. + * @param tbl can include an alias after a space or after the 'AS' keyword ('my_table my_alias'). + */ + naturalJoin(tbl: string): SelectStatement + naturalLeftJoin(tbl: string): SelectStatement + naturalRightJoin(tbl: string): SelectStatement + naturalFullJoin(tbl: string): SelectStatement + + naturalInnerJoin(tbl: string): SelectStatement + naturalLeftOuterJoin(tbl: string): SelectStatement + naturalRightOuterJoin(tbl: string): SelectStatement + naturalFullOuterJoin(tbl: string): SelectStatement + + where(column: string, value?: string): SelectStatement + where(whereExpr: WhereExpression): SelectStatement + where(...options): SelectStatement + + and(...options): SelectStatement + + /** + * Sets or extends the GROUP BY columns. + * @param columns can take multiple arguments, a single comma-delimited string or an array. + */ + groupBy(...columns: string[]): SelectStatement + groupBy(columns: string[]): SelectStatement + + having(column: string, value: string): SelectStatement + having(whereExpr: WhereExpression): SelectStatement + + /** + * Sets or extends the list of columns in the ORDER BY clause. + * @param columns can be passed as multiple arguments, a single comma-delimited string or an array. + */ + orderBy(...columns: string[]): SelectStatement + orderBy(columns: string[]): SelectStatement + order(...columns: string[]): SelectStatement + order(columns: string[]): SelectStatement + + forUpdate(...tbls: string[]): SelectStatement + of(tlb: string): SelectStatement + noWait(): SelectStatement + + union(...stmt: Statement[]): SelectStatement + intersect(...stmt: Statement[]): SelectStatement + minus(...stmt: Statement[]): SelectStatement + except(...stmt: Statement[]): SelectStatement + } + + /** + * An INSERT statement + */ + interface InsertStatement extends Statement { + into(tbl: TableName, ...columns: any[]): InsertStatement + intoTable(tbl: TableName, ...columns: any[]): InsertStatement + select(...params): SelectStatement, + values(...values): InsertStatement + } + + /** + * An UPDATE statement + */ + interface UpdateStatement extends Statement { + values(...values): UpdateStatement + set(...values): UpdateStatement, + where(...options): UpdateStatement, + and(...options): UpdateStatement, + } + + /** + * A DELETE statement + */ + interface DeleteStatement extends Statement { + from(...tbls: string[]): DeleteStatement, + using(...columnList): DeleteStatement, + where(...options): DeleteStatement, + and(...options): DeleteStatement, + } +} + +interface SqlBricksFn { + (...params: any[]): any + /** + * Wraps a value (user-supplied string, number, boolean, etc) so that it can be passed into SQL Bricks + * anywhere that a column is expected (the left-hand side of WHERE criteria and many other SQL Bricks APIs) + * @param value value to be wraped + */ + val(value): any + + /** + * Returns a new INSERT statement. It can be used with or without the new operator. + * @alias insertInto + * @param tbl table name + * @param values a values object or a columns list. Passing a set of columns (as multiple arguments, a comma-delimited string or an array) + * will put the statement into split keys/values mode, where a matching array of values is expected in values() + * @example + * insert('person', {'first_name': 'Fred', 'last_name': 'Flintstone'}); + * // INSERT INTO person (first_name, last_name) VALUES ('Fred', 'Flintstone') + */ + insert(tbl?: string, ...values): SqlBricks.InsertStatement + + /** + * Returns a new INSERT statement. It can be used with or without the new operator. + * @alias insert + * @param tbl table name + * @param values a values object or a columns list. Passing a set of columns (as multiple arguments, a comma-delimited string or an array) + * will put the statement into split keys/values mode, where a matching array of values is expected in values() + * @example + * insert('person', {'first_name': 'Fred', 'last_name': 'Flintstone'}); + * // INSERT INTO person (first_name, last_name) VALUES ('Fred', 'Flintstone') + */ + insertInto(tbl?: string, ...values): SqlBricks.InsertStatement + + /** + * Returns a new select statement, seeded with a set of columns. It can be used with or without the new keyword. + * @param columns it can be passed in here (or appended later via sel.select() or sel.distinct()) via multiple arguments + * or a comma-delimited string or an array. If no columns are specified, toString() will default to SELECT *. + */ + select(...columns: string[]): SqlBricks.SelectStatement + select(columns: string[] | SqlBricks.SelectStatement[]): SqlBricks.SelectStatement + select(...params): SqlBricks.SelectStatement + + /** + * Returns a new UPDATE statement. It can be used with or without the new operator. + * @param tbl table name + * @param values + */ + update(tbl: string, ...values): SqlBricks.UpdateStatement + + /** + * Returns a new DELETE statement. It can be used with or without the new operator. + * @alias deleteFrom + * @param tbl table name + */ + delete(tbl?: string): SqlBricks.DeleteStatement + /** + * Returns a new DELETE statement. It can be used with or without the new operator. + * @alias delete + * @param tbl table name + */ + deleteFrom(tbl?: string): SqlBricks.DeleteStatement + + /** + * Registers a set of frequently-used table aliases with SQL Bricks. + * These table aliases can then be used by themselves in from(), join(), etc + * and SQL Bricks will automatically expand them to include the table name as well as the alias. + * @param expansions + * @example + * sql.aliasExpansions({'psn': 'person', 'addr': 'address', 'zip': 'zipcode', 'usr': 'user'}); + * select().from('psn').join('addr', {'psn.addr_id': 'addr.id'}); + * // SELECT * FROM person psn INNER JOIN address addr ON psn.addr_id = addr.id + */ + aliasExpansions(expansions: { [tbl: string]: string }): void + + /** + * Sets a user-supplied function to automatically generate the .on() criteria for joins whenever it is not supplied explicitly. + * @param func + */ + joinCriteria(func?: (...args) => SqlBricks.OnCriteria): any + + _extension(): any + prop: number + conversions: any + + ////////////////////////////////////////// + ////// Where Expression functions ////// + ////////////////////////////////////////// + + /** + * Joins the passed expressions with AND + * @param whereExprs + */ + and(...whereExprs: SqlBricks.WhereExpression[]): SqlBricks.WhereGroup + + /** + * Joins the passed expressions with OR: + * @param whereExprs + */ + or(...whereExprs: SqlBricks.WhereExpression[]): SqlBricks.WhereGroup + + /** + * Negates the expression by wrapping it in NOT (...) + * (if it is at the top level, the parentheses are unnecessary and will be omitted) + * @param whereExpr + */ + not(whereExpr: SqlBricks.WhereExpression): SqlBricks.WhereGroup + + /** + * Generates a BETWEEN + * @param column + * @param value1 + * @param value2 + */ + between(column: string, value1, value2): SqlBricks.WhereExpression + isNull(column: string): SqlBricks.WhereExpression + isNotNull(column: string): SqlBricks.WhereExpression + like(column: string, value, escapeStr?: string): SqlBricks.WhereExpression + exists(stmt): SqlBricks.WhereExpression + in(column: string, stmt: SqlBricks.SelectStatement): SqlBricks.WhereExpression + in(column: string, ...values): SqlBricks.WhereExpression + + /** + * Generates the appropriate relational operator (=, <>, <, <=, > or >=). + * @param column column name or query result + * @param value column value + */ + eq(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + equal(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + notEq(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + lt(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + lte(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + gt(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + gte(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + + eqAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + notEqAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + ltAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + lteAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + gtAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + gteAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + + eqAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + notEqAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + ltAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + lteAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + gtAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + gteAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + + eqSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + notEqSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + ltSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + lteSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + gtSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + gteSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary +} + +declare const SqlBricks: SqlBricksFn +export = SqlBricks diff --git a/types/sql-bricks/sql-bricks-tests.ts b/types/sql-bricks/sql-bricks-tests.ts new file mode 100644 index 0000000000..94014d913d --- /dev/null +++ b/types/sql-bricks/sql-bricks-tests.ts @@ -0,0 +1,935 @@ +// Test file from sql-briks package tests +// https://github.com/CSNW/sql-bricks/blob/master/tests/tests.js +// taked the 03/29/2018. Some dtslint rules has been deabled to be +// close as possible of the original js file. + +import * as sql from "sql-bricks"; + +// tslint:disable-next-line:prefer-const +let assert; +const select = sql.select; +const insertInto = sql.insertInto, insert = sql.insert, + update = sql.update, del = sql.delete; +const and = sql.and, or = sql.or, like = sql.like, not = sql.not, $in = sql.in, + isNull = sql.isNull, isNotNull = sql.isNotNull, equal = sql.equal, eq = sql.eq, + notEq = sql.notEq, lt = sql.lt, lte = sql.lte, gt = sql.gt, gte = sql.gte, + between = sql.between, exists = sql.exists, eqAny = sql.eqAny, notEqAny = sql.notEqAny; + +const alias_expansions = { usr: 'user', psn: 'person', addr: 'address' }; +const table_to_alias = alias_expansions; +sql.aliasExpansions(alias_expansions); + +sql.joinCriteria(function(left_tbl, left_alias, right_tbl, right_alias) { + const criteria = {}; + criteria[left_alias + '.' + table_to_alias[right_tbl] + '_fk'] = right_alias + '.pk'; + return criteria; +}); + +describe('SQL Bricks', function() { + describe('parameterized sql', function() { + it('should generate for insert statements', function() { + const values = { first_name: 'Fred', last_name: 'Flintstone' }; + checkParams(insert('user', values), + 'INSERT INTO "user" (first_name, last_name) VALUES ($1, $2)', + ['Fred', 'Flintstone']); + }); + it('should generate for UPDATEs', function() { + const values = { first_name: 'Fred', last_name: 'Flintstone' }; + checkParams(update('user', values), + 'UPDATE "user" SET first_name = $1, last_name = $2', + ['Fred', 'Flintstone']); + }); + it('should generate for WHERE clauses', function() { + checkParams(select().from('user').where({ + removed: 0, + name: 'Fred Flintstone' + }), 'SELECT * FROM "user" WHERE removed = $1 AND name = $2', + [0, 'Fred Flintstone']); + }); + it('should generate WHERE clauses with arbitrary SQL', function() { + const stmt = select().from('time_limits'); + stmt.where(sql( + "tsrange(start_date_time, end_date_time, '[]') @> tsrange($1, $2, '[]')")); + check(stmt, + "SELECT * FROM time_limits WHERE tsrange(start_date_time, end_date_time, '[]') @> tsrange($1, $2, '[]')"); + }); + it('should generate WHERE clauses with arbitrary SQL and parameters', function() { + const stmt = select().from('time_limits'); + const time1 = '2014-12-06T22:35:00'; + const time2 = '2014-12-06T22:36:00'; + stmt.where(sql( + "tsrange(start_date_time, end_date_time, '[]') @> tsrange($, $, '[]')", time1, time2)); + checkParams(stmt, + "SELECT * FROM time_limits WHERE tsrange(start_date_time, end_date_time, '[]') @> tsrange($1, $2, '[]')", + ['2014-12-06T22:35:00', '2014-12-06T22:36:00']); + }); + it('should handle WHERE clauses with sql() and a null check', function() { + check(select().from('test').where(sql('my_col_val()'), null), + "SELECT * FROM test WHERE my_col_val() IS NULL"); + }); + it('should not escape single quotes in the values returned by toParams()', function() { + checkParams(update('user', { name: "Muad'Dib" }), + 'UPDATE "user" SET name = $1', + ["Muad'Dib"]); + }); + it('should not attempt to serialize arrays (should be done by subsequent layer)', function() { + checkParams(update('user', { name: ["Paul", "Muad'Dib"] }), + 'UPDATE "user" SET name = $1', + [["Paul", "Muad'Dib"]]); + }); + it('should not attempt to serialize dates', function() { + const dt = new Date(); + checkParams(update('user', { birthdate: dt }), + 'UPDATE "user" SET birthdate = $1', + [dt]); + }); + it('should generate node-sqlite3 style params', function() { + const values = { first_name: 'Fred', last_name: 'Flintstone' }; + const result = insert('user', values).toParams({ placeholder: '?%d' }); + assert.equal(result.text, 'INSERT INTO "user" (first_name, last_name) VALUES (?1, ?2)'); + assert.deepEqual(result.values, ['Fred', 'Flintstone']); + }); + it('should generate node-mysql style params', function() { + const values = { first_name: 'Fred', last_name: 'Flintstone' }; + const result = insert('user', values).toParams({ placeholder: '?' }); + assert.equal(result.text, 'INSERT INTO "user" (first_name, last_name) VALUES (?, ?)'); + assert.deepEqual(result.values, ['Fred', 'Flintstone']); + }); + it('should output non-numeric params in SQL order', function() { + const result = select().from('user').where($in(sql.val(5), [3, 5, 10])).toParams({ placeholder: '?' }); + assert.equal(result.text, 'SELECT * FROM "user" WHERE ? IN (?, ?, ?)'); + assert.deepEqual(result.values, [5, 3, 5, 10]); + }); + it('should properly parameterize subqueries', function() { + const values = { first_name: 'Fred' }; + checkParams(select(select('last_name').from('user').where(values)), + 'SELECT (SELECT last_name FROM "user" WHERE first_name = $1)', + ['Fred']); + }); + it('should properly parameterize subqueries with a join', function() { + const values = { first_name: 'Fred' }; + const query = select().from(select().from('user').where(values).as('subuser')) + .join('other_table', { 'other_table.id': 'subuser.id' }); + checkParams(query, + 'SELECT * FROM (SELECT * FROM "user" WHERE first_name = $1) subuser INNER JOIN other_table ON other_table.id = subuser.id', + ['Fred']); + }); + it('should properly parameterize subqueries in updates', function() { + const addr_id_for_usr = select('id').from('address').where('usr_id', sql('"user".id')).and('active', true); + checkParams(update('user').set('addr_id', addr_id_for_usr), + 'UPDATE "user" SET addr_id = (SELECT id FROM address WHERE usr_id = "user".id AND active = $1)', + [true]); + }); + it('should properly merge parameterized sub-expressions with $%d placeholders', function() { + checkParams(select().from('tbl').where(or(sql('a = $1', 444), sql('b = $1', 555), sql('c = $1', 666))), + 'SELECT * FROM tbl WHERE a = $1 OR b = $2 OR c = $3', + [444, 555, 666]); + }); + }); + + describe('value handling', function() { + it('should escape single quotes when toString() is used', function() { + check(update('user', { name: "Muad'Dib" }), + "UPDATE \"user\" SET name = 'Muad''Dib'"); + }); + it('should escape multiple single quotes in the same string', function() { + check(update('address', { city: "Liu'e, Hawai'i" }), + "UPDATE address SET city = 'Liu''e, Hawai''i'"); + }); + it('should support sql.val() to pass in values where columns are expected', function() { + check(select().from('user').where(sql.val('Fred'), sql('first_name')), + "SELECT * FROM \"user\" WHERE 'Fred' = first_name"); + }); + it('should support value objects with differing field orders', function() { + check(insert('user').values([{ id: 1, name: 'Fred' }, { name: 'Barney', id: 2 }]), + "INSERT INTO \"user\" (id, name) VALUES (1, 'Fred'), (2, 'Barney')"); + }); + + describe('.toString() value conversions', function() { + it('should, by default, convert dates to SQL TIMESTAMP WITH TIME ZONE format', function() { + check(update('user', { birthdate: new Date('1980-01-01T00:00:00Z') }), + "UPDATE \"user\" SET birthdate = TIMESTAMP WITH TIME ZONE '1980-01-01 00:00:00.000+00:00'"); + }); + it('should work with sql() SQL literal strings', function() { + check(select().from('person').where(sql('some_func($, $)', ['a', 'b'])), + "SELECT * FROM person WHERE some_func('a', 'b')"); + }); + it('should escape single quotes when sql() SQL literal strings are used', function() { + check(select().from('person').where(sql('some_func($)', ["Muad'Dib"])), + "SELECT * FROM person WHERE some_func('Muad''Dib')"); + }); + it('should support user-supplied conversions', function() { + const orig_bool = sql.conversions.Boolean; + sql.conversions.Boolean = function(bool) { return bool ? '1' : '0'; }; + const str = del('user').where('active', false).toString(); + sql.conversions.Boolean = orig_bool; + assert.equal(str, 'DELETE FROM "user" WHERE active = 0'); + }); + }); + }); + + it('should expand abbreviations in FROM and JOINs', function() { + check(select().from('usr').join('psn', { 'usr.psn_fk': 'psn.pk' }), + 'SELECT * FROM "user" usr INNER JOIN person psn ON usr.psn_fk = psn.pk'); + }); + + it('should expand left_tbl on all joins', function() { + const left_tbls: any[] = []; + const orig = sql.joinCriteria(); + sql.joinCriteria(function(left_tbl) { + left_tbls.push(left_tbl); + // return orig.apply(this, arguments); + return orig.apply(); + }); + + select().from('test').join('psn').join('usr').toString(); + sql.joinCriteria(orig); + assert(left_tbls.indexOf('person') > -1 && left_tbls.indexOf('psn') === -1, 'left_tbl is not expanded: [' + left_tbls.join(',') + ']'); + }); + + it('should support aliases', function() { + check(select().from('user usr2').join('address addr2'), + 'SELECT * FROM "user" usr2 INNER JOIN address addr2 ON usr2.addr_fk = addr2.pk'); + }); + + it('should auto-generate join criteria using supplied joinCriteria() function', function() { + check(select().from('usr').join('psn'), + 'SELECT * FROM "user" usr INNER JOIN person psn ON usr.psn_fk = psn.pk'); + }); + it('should auto-generate join criteria to multiple tables', function() { + check(select().from('usr').join('psn').join('addr'), + 'SELECT * FROM "user" usr ' + + 'INNER JOIN person psn ON usr.psn_fk = psn.pk ' + + 'INNER JOIN address addr ON psn.addr_fk = addr.pk'); + }); + it('should auto-generate join criteria from a single table to multiple tables', function() { + check(select().from('usr').join('psn', 'addr'), + 'SELECT * FROM "user" usr ' + + 'INNER JOIN person psn ON usr.psn_fk = psn.pk ' + + 'INNER JOIN address addr ON usr.addr_fk = addr.pk'); + }); + it('should handle unions', function() { + check(select().from('usr').where({ name: 'Roy' }) + .union(select().from('usr').where({ name: 'Moss' })) + .union(select().from('usr').where({ name: 'The elders of the internet' })), + "SELECT * FROM \"user\" usr WHERE name = 'Roy'" + + " UNION SELECT * FROM \"user\" usr WHERE name = 'Moss'" + + " UNION SELECT * FROM \"user\" usr WHERE name = 'The elders of the internet'"); + }); + it('should handle chained unions', function() { + check(select().from('usr').where({ name: 'Roy' }) + .union().select().from('usr').where({ name: 'blurns' }), + "SELECT * FROM \"user\" usr WHERE name = 'Roy'" + + " UNION SELECT * FROM \"user\" usr WHERE name = 'blurns'"); + }); + it('should handle chained unions with params', function() { + checkParams(select().from('usr').where({ name: 'Roy' }) + .union().select().from('usr').where({ name: 'Moss' }), + "SELECT * FROM \"user\" usr WHERE name = $1" + + " UNION SELECT * FROM \"user\" usr WHERE name = $2", ['Roy', 'Moss']); + }); + it('should handle unions with params', function() { + checkParams(select().from('usr').where({ name: 'Roy' }) + .union(select().from('usr').where({ name: 'Moss' })) + .union(select().from('usr').where({ name: 'The elders of the internet' })), + 'SELECT * FROM "user" usr WHERE name = $1' + + ' UNION SELECT * FROM "user" usr WHERE name = $2' + + ' UNION SELECT * FROM "user" usr WHERE name = $3', + ['Roy', 'Moss', 'The elders of the internet']); + }); + + describe('UPDATE statements', function() { + it('should handle .set() with (key, value)', function() { + check(update('user').set('name', 'Fred'), + "UPDATE \"user\" SET name = 'Fred'"); + }); + it('should handle .values() with an object literal', function() { + check(update('user').values({ name: 'Fred' }), + "UPDATE \"user\" SET name = 'Fred'"); + }); + it('should handle multiple .set()s with object literals', function() { + check(update('user').set({ name: 'Fred' }).set({ last_name: 'Flintstone' }), + "UPDATE \"user\" SET name = 'Fred', last_name = 'Flintstone'"); + }); + it('should handle multiple .values() with (key, value)', function() { + check(update('user').values('name', 'Fred').values('last_name', 'Flintstone'), + "UPDATE \"user\" SET name = 'Fred', last_name = 'Flintstone'"); + }); + it('should handle values argument', function() { + check(update('user', { name: 'Fred' }), + "UPDATE \"user\" SET name = 'Fred'"); + }); + }); + + describe('INSERT statements', function() { + it('should take an object of column/value pairs', function() { + check(insert('user', { id: 33, name: 'Fred' }), + "INSERT INTO \"user\" (id, name) VALUES (33, 'Fred')"); + }); + it('should insert a null for undefined', function() { + check(insert('user', { id: 33, name: undefined }), + "INSERT INTO \"user\" (id, name) VALUES (33, null)"); + }); + it('should insert a null for null', function() { + check(insert('user', { id: 33, name: null }), + "INSERT INTO \"user\" (id, name) VALUES (33, null)"); + }); + it('should take an array of columns & values', function() { + check(insert('user', ['id', 'name']).values([33, 'Fred']), + "INSERT INTO \"user\" (id, name) VALUES (33, 'Fred')"); + }); + it('should take multiple parameters of columns & values', function() { + check(insert('user', 'id', 'name').values(33, 'Fred'), + "INSERT INTO \"user\" (id, name) VALUES (33, 'Fred')"); + }); + it('should take an array of objects', function() { + check(insert('user', [{ id: 33, name: 'Fred' }, { id: 34, name: 'Wilma' }]), + "INSERT INTO \"user\" (id, name) VALUES (33, 'Fred'), (34, 'Wilma')"); + }); + + describe('.values()', function() { + it('should take an array of arrays', function() { + check(insert('user', ['id', 'name']).values([[33, 'Fred'], [34, 'Wilma']]), + "INSERT INTO \"user\" (id, name) VALUES (33, 'Fred'), (34, 'Wilma')"); + }); + }); + + describe('.into()', function() { + it('should take an object of column/value pairs', function() { + check(insert().into('user', { id: 33, name: 'Fred' }), + "INSERT INTO \"user\" (id, name) VALUES (33, 'Fred')"); + }); + it('should take an array of columns & values', function() { + check(insert().into('user', ['id', 'name']).values([33, 'Fred']), + "INSERT INTO \"user\" (id, name) VALUES (33, 'Fred')"); + }); + it('should take multiple parameters of columns & values', function() { + check(insert().into('user', 'id', 'name').values(33, 'Fred'), + "INSERT INTO \"user\" (id, name) VALUES (33, 'Fred')"); + }); + }); + }); + + describe('SELECT clause', function() { + it('should handle an array', function() { + check(select(['one', 'order']).from('user'), + 'SELECT one, "order" FROM "user"'); + }); + it('should handle multiple args', function() { + check(select('one', 'order').from('user'), + 'SELECT one, "order" FROM "user"'); + }); + it('should default to *', function() { + check(select().from('user'), + 'SELECT * FROM "user"'); + }); + it('should handle a comma-delimited str', function() { + check(select('one, order').from('user'), + 'SELECT one, "order" FROM "user"'); + }); + it('should handle being called multiple times', function() { + check(select('one, order').select(['two', 'desc']).select('three', 'four').from('user'), + 'SELECT one, "order", two, "desc", three, four FROM "user"'); + }); + it('should support DISTINCT', function() { + check(select('one, order').distinct('two, desc').from('user'), + 'SELECT DISTINCT one, "order", two, "desc" FROM "user"'); + }); + it('should support FOR UPDATE', function() { + check(select().from('user').forUpdate(), + 'SELECT * FROM "user" FOR UPDATE'); + }); + it('should support FOR UPDATE w/ col list', function() { + check(select().from('user').forUpdate().of('user'), + 'SELECT * FROM "user" FOR UPDATE OF "user"'); + }); + it('should support FOR UPDATE OF ... NO WAIT', function() { + check(select().from('user').forUpdate().of('user').noWait(), + 'SELECT * FROM "user" FOR UPDATE OF "user" NO WAIT'); + }); + }); + + describe('.from()', function() { + it('should handle an array', function() { + check(select().from(['one', 'two', 'usr']), + 'SELECT * FROM one, two, "user" usr'); + }); + it('should handle multiple args', function() { + check(select().from('one', 'two', 'usr'), + 'SELECT * FROM one, two, "user" usr'); + }); + it('should handle a comma-delimited string', function() { + check(select().from('one, two, usr'), + 'SELECT * FROM one, two, "user" usr'); + }); + it('should handle being called multiple times', function() { + check(select().from('one', 'usr').from(['two', 'psn']).from('three, addr'), + 'SELECT * FROM one, "user" usr, two, person psn, three, address addr'); + }); + it('should handle subquery object', function() { + check(select().from(select().from('user').as('subq')), + 'SELECT * FROM (SELECT * FROM "user") subq'); + }); + it('should handle subquery string', function() { + check(select().from('(SELECT * FROM "user") subq'), + 'SELECT * FROM (SELECT * FROM "user") subq'); + }); + }); + + describe('select().into() should insert into a new table', function() { + it('.into()', function() { + check(select().into('new_user').from('user'), + 'SELECT * INTO new_user FROM "user"'); + }); + it('.intoTable()', function() { + check(select().intoTable('new_user').from('user'), + 'SELECT * INTO new_user FROM "user"'); + }); + it('intoTemp()', function() { + check(select().intoTemp('new_user').from('user'), + 'SELECT * INTO TEMP new_user FROM "user"'); + }); + it('intoTempTable()', function() { + check(select().intoTempTable('new_user').from('user'), + 'SELECT * INTO TEMP new_user FROM "user"'); + }); + }); + + describe('insert().into() should insert into a preexisting table', function() { + it('insert().into().select()', function() { + check(insert().into('new_user', 'id', 'addr_id') + .select('id', 'addr_id').from('user'), + 'INSERT INTO new_user (id, addr_id) SELECT id, addr_id FROM "user"'); + }); + it('insert().into().select() with no columns', function() { + check(insert().into('new_user') + .select('id', 'addr_id').from('user'), + 'INSERT INTO new_user SELECT id, addr_id FROM "user"'); + }); + it('insert().select()', function() { + check(insert('new_user', 'id', 'addr_id') + .select('id', 'addr_id').from('user'), + 'INSERT INTO new_user (id, addr_id) SELECT id, addr_id FROM "user"'); + }); + it('insert().select() with params', function() { + check(insert('new_user', 'id', 'addr_id') + .select('id', 'addr_id').from('user').where({ active: true }).toParams().text, + 'INSERT INTO new_user (id, addr_id) SELECT id, addr_id FROM "user" WHERE active = $1'); + }); + }); + + describe('GROUP BY clause', function() { + it('should support single group by', function() { + check(select().from('user').groupBy('last_name'), + 'SELECT * FROM "user" GROUP BY last_name'); + }); + it('should support multiple groupBy() args w/ reserved words quoted', function() { + check(select().from('user').groupBy('last_name', 'order'), + 'SELECT * FROM "user" GROUP BY last_name, "order"'); + }); + it('should support .groupBy().groupBy()', function() { + check(select().from('user').groupBy('last_name').groupBy('order'), + 'SELECT * FROM "user" GROUP BY last_name, "order"'); + }); + it('should support an array', function() { + check(select().from('user').groupBy(['last_name', 'order']), + 'SELECT * FROM "user" GROUP BY last_name, "order"'); + }); + }); + + describe('.order() / .orderBy()', function() { + it('should support .orderBy(arg1, arg2)', function() { + check(select().from('user').orderBy('last_name', 'order'), + 'SELECT * FROM "user" ORDER BY last_name, "order"'); + }); + it('should support an array', function() { + check(select().from('user').orderBy(['last_name', 'order']), + 'SELECT * FROM "user" ORDER BY last_name, "order"'); + }); + it('should support being called multiple times', function() { + check(select().from('user').orderBy('last_name').orderBy('order'), + 'SELECT * FROM "user" ORDER BY last_name, "order"'); + }); + }); + + describe('joins', function() { + it('.join() should accept a comma-delimited string', function() { + check(select().from('usr').join('psn, addr'), + 'SELECT * FROM "user" usr ' + + 'INNER JOIN person psn ON usr.psn_fk = psn.pk ' + + 'INNER JOIN address addr ON usr.addr_fk = addr.pk'); + }); + it('.leftJoin() should generate a left join', function() { + check(select().from('usr').leftJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'LEFT JOIN address addr ON usr.addr_fk = addr.pk'); + }); + it('.leftOuterJoin() should generate a left join', function() { + check(select().from('usr').leftOuterJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'LEFT JOIN address addr ON usr.addr_fk = addr.pk'); + }); + it('.rightJoin() should generate a right join', function() { + check(select().from('usr').rightJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'RIGHT JOIN address addr ON usr.addr_fk = addr.pk'); + }); + it('.rightOuterJoin() should generate a right join', function() { + check(select().from('usr').rightOuterJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'RIGHT JOIN address addr ON usr.addr_fk = addr.pk'); + }); + it('.fullJoin() should generate a full join', function() { + check(select().from('usr').fullJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'FULL JOIN address addr ON usr.addr_fk = addr.pk'); + }); + it('.fullOuterJoin() should generate a full join', function() { + check(select().from('usr').fullOuterJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'FULL JOIN address addr ON usr.addr_fk = addr.pk'); + }); + it('.crossJoin() should generate a cross join', function() { + check(select().from('usr').crossJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'CROSS JOIN address addr'); + }); + it('join() should accept an expression for the on argument', function() { + check(select().from('usr').join('addr', eq('usr.addr_id', sql('addr.id'))), + 'SELECT * FROM "user" usr INNER JOIN address addr ON usr.addr_id = addr.id'); + }); + it('join() should accept an array for the on argument (for JOIN USING)', function() { + check(select().from('usr').join('addr', ['addr_id', 'country_id']), + 'SELECT * FROM "user" usr INNER JOIN address addr USING (addr_id, country_id)'); + }); + }); + + describe('.on()', function() { + it('should accept an object literal', function() { + check(select().from('usr').join('addr').on({ 'usr.addr_id': 'addr.id' }), + 'SELECT * FROM "user" usr ' + + 'INNER JOIN address addr ON usr.addr_id = addr.id'); + }); + it('should accept a (key, value) pair', function() { + check(select().from('usr').join('addr').on('usr.addr_id', 'addr.id'), + 'SELECT * FROM "user" usr ' + + 'INNER JOIN address addr ON usr.addr_id = addr.id'); + }); + it('can be called multiple times', function() { + check(select().from('usr', 'psn').join('addr').on({ 'usr.addr_id': 'addr.id' }) + .on('psn.addr_id', 'addr.id'), + 'SELECT * FROM "user" usr, person psn ' + + 'INNER JOIN address addr ON usr.addr_id = addr.id AND psn.addr_id = addr.id'); + }); + it('can be called multiple times w/ an object literal', function() { + check(select().from('usr', 'psn').join('addr').on({ 'usr.addr_id': 'addr.id' }) + .on({ 'psn.addr_id': 'addr.id' }), + 'SELECT * FROM "user" usr, person psn ' + + 'INNER JOIN address addr ON usr.addr_id = addr.id AND psn.addr_id = addr.id'); + }); + it('should accept an expression', function() { + check(select().from('usr').join('addr').on(eq('usr.addr_id', sql('addr.id'))), + 'SELECT * FROM "user" usr INNER JOIN address addr ON usr.addr_id = addr.id'); + }); + it('should not proceed if .using() has already been used', function() { + assert.throws(function() { + select().from('t1').join('t2').using('id').on({ 't1.t2_id': 't2.id' }); + }); + }); + }); + + describe('.using()', function() { + it('should accept a comma-delimited string', function() { + check(select().from('usr').join('addr').using('addr_id, contrived_id'), + 'SELECT * FROM "user" usr ' + + 'INNER JOIN address addr USING (addr_id, contrived_id)'); + }); + it('should accept multiple arguments', function() { + check(select().from('usr').join('addr').using('addr_id', 'contrived_id'), + 'SELECT * FROM "user" usr ' + + 'INNER JOIN address addr USING (addr_id, contrived_id)'); + }); + it('should accept an array literal', function() { + check(select().from('usr').join('addr').using(['addr_id', 'contrived_id']), + 'SELECT * FROM "user" usr ' + + 'INNER JOIN address addr USING (addr_id, contrived_id)'); + }); + it('should not proceed if .on() has already been used', function() { + assert.throws(function() { + select().from('t1').join('t2').on({ 't1.t2_id': 't2.id' }).using('id'); + }); + }); + }); + + describe('natural joins', function() { + it('.naturalJoin() should accept a comma-delimited string', function() { + check(select().from('usr').naturalJoin('psn, addr'), + 'SELECT * FROM "user" usr ' + + 'NATURAL INNER JOIN person psn ' + + 'NATURAL INNER JOIN address addr'); + }); + it('.naturalLeftJoin() should generate a natural left join', function() { + check(select().from('usr').naturalLeftJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'NATURAL LEFT JOIN address addr'); + }); + it('.naturalLeftOuterJoin() should generate a natural left join', function() { + check(select().from('usr').naturalLeftOuterJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'NATURAL LEFT JOIN address addr'); + }); + it('.naturalRightJoin() should generate a natural right join', function() { + check(select().from('usr').naturalRightJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'NATURAL RIGHT JOIN address addr'); + }); + it('.naturalRightOuterJoin() should generate a natural right join', function() { + check(select().from('usr').naturalRightOuterJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'NATURAL RIGHT JOIN address addr'); + }); + it('.naturalFullJoin() should generate a natural full join', function() { + check(select().from('usr').naturalFullJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'NATURAL FULL JOIN address addr'); + }); + it('.naturalFullOuterJoin() should generate a natural full join', function() { + check(select().from('usr').naturalFullOuterJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'NATURAL FULL JOIN address addr'); + }); + }); + + describe('WHERE clauses', function() { + it('should AND multiple where() criteria by default', function() { + check(select().from('user').where({ + first_name: 'Fred', + last_name: 'Flintstone' + }), + "SELECT * FROM \"user\" WHERE first_name = 'Fred' AND last_name = 'Flintstone'"); + }); + it('should AND multiple where()s by default', function() { + check(select().from('user').where({ first_name: 'Fred' }) + .where({ last_name: 'Flintstone' }), + "SELECT * FROM \"user\" WHERE first_name = 'Fred' AND last_name = 'Flintstone'"); + }); + it('should handle explicit .and() with (key, value) args', function() { + check(select().from('user').where('first_name', 'Fred') + .and('last_name', 'Flintstone'), + "SELECT * FROM \"user\" WHERE first_name = 'Fred' AND last_name = 'Flintstone'"); + }); + it('should handle nested and(or())', function() { + check(select().from('user').where(and({ last_name: 'Flintstone' }, or({ first_name: 'Fred' }, { first_name: 'Wilma' }))), + "SELECT * FROM \"user\" WHERE last_name = 'Flintstone' AND (first_name = 'Fred' OR first_name = 'Wilma')"); + }); + it('should handle or([...])', function() { + check(select().from('table').where({ this: 'test' }).and(or(['test1', 'test2'].map(function(val) { return eq('that', val); }))), + "SELECT * FROM \"table\" WHERE this = 'test' AND (that = 'test1' OR that = 'test2')"); + }); + it('and() should be implicit', function() { + check(select().from('user').where({ last_name: 'Flintstone' }, or({ first_name: 'Fred' }, { first_name: 'Wilma' })), + "SELECT * FROM \"user\" WHERE last_name = 'Flintstone' AND (first_name = 'Fred' OR first_name = 'Wilma')"); + }); + it('should handle like()', function() { + check(select().from('user').where(like('last_name', 'Flint%')), + "SELECT * FROM \"user\" WHERE last_name LIKE 'Flint%'"); + }); + it('should accept a 3rd escape param to like()', function() { + check(select().from('user').where(like('percent', '100\\%', '\\')), + "SELECT * FROM \"user\" WHERE percent LIKE '100\\%' ESCAPE '\\'"); + }); + it('should handle not()', function() { + check(select().from('user').where(not({ first_name: 'Fred' })), + "SELECT * FROM \"user\" WHERE NOT first_name = 'Fred'"); + }); + it('should handle in()', function() { + check(select().from('user').where($in('first_name', ['Fred', 'Wilma'])), + "SELECT * FROM \"user\" WHERE first_name IN ('Fred', 'Wilma')"); + }); + it('should handle .in() with multiple args', function() { + check(select().from('user').where($in('name', 'Jimmy', 'Owen')), + "SELECT * FROM \"user\" WHERE name IN ('Jimmy', 'Owen')"); + }); + it('should handle .in() with a subquery', function() { + check(select().from('user').where($in('addr_id', select('id').from('address'))), + 'SELECT * FROM "user" WHERE addr_id IN (SELECT id FROM address)'); + }); + it('should handle exists() with a subquery', function() { + check(select().from('user').where(exists(select().from('address').where({ 'user.addr_id': sql('address.id') }))), + 'SELECT * FROM "user" WHERE EXISTS (SELECT * FROM address WHERE "user".addr_id = address.id)'); + }); + it('should handle exists() with a subquery, parameterized', function() { + checkParams(select().from('user').where('active', true).where(exists(select().from('address').where({ 'user.addr_id': 37 }))), + 'SELECT * FROM "user" WHERE active = $1 AND EXISTS (SELECT * FROM address WHERE "user".addr_id = $2)', + [true, 37]); + }); + it('should handle isNull()', function() { + check(select().from('user').where(isNull('first_name')), + 'SELECT * FROM "user" WHERE first_name IS NULL'); + }); + it('should handle isNotNull()', function() { + check(select().from('user').where(isNotNull('first_name')), + 'SELECT * FROM "user" WHERE first_name IS NOT NULL'); + }); + it('should automatically generate IS NULL', function() { + check(select().from('user').where({ first_name: null }), + 'SELECT * FROM "user" WHERE first_name IS NULL'); + }); + it('should handle explicit equal()', function() { + check(select().from('user').where(equal('first_name', 'Fred')), + "SELECT * FROM \"user\" WHERE first_name = 'Fred'"); + }); + it('should automatically generate IS NOT NULL', function() { + check(select().from('user').where(notEq('first_name', null)), + "SELECT * FROM \"user\" WHERE first_name IS NOT NULL"); + }); + it('should handle lt()', function() { + check(select().from('user').where(lt('order', 5)), + 'SELECT * FROM "user" WHERE "order" < 5'); + }); + it('should handle lte()', function() { + check(select().from('user').where(lte('order', 5)), + 'SELECT * FROM "user" WHERE "order" <= 5'); + }); + it('should handle gt()', function() { + check(select().from('user').where(gt('order', 5)), + 'SELECT * FROM "user" WHERE "order" > 5'); + }); + it('should handle gte()', function() { + check(select().from('user').where(gte('order', 5)), + 'SELECT * FROM "user" WHERE "order" >= 5'); + }); + it('should handle between()', function() { + check(select().from('user').where(between('name', 'Frank', 'Fred')), + "SELECT * FROM \"user\" WHERE name BETWEEN 'Frank' AND 'Fred'"); + }); + it('should do nothing for null, undefined, {}', function() { + check(select().from('user').where(), + "SELECT * FROM \"user\""); + check(select().from('user').where(null), + "SELECT * FROM \"user\""); + check(select().from('user').where({}), + "SELECT * FROM \"user\""); + check(select().from('user').where(undefined), + "SELECT * FROM \"user\""); + }); + it('should not ignore the 2nd arg if the first is {}', function() { + check(select().from('user').where({}, { name: 'Fred' }), + "SELECT * FROM \"user\" WHERE name = 'Fred'"); + }); + + describe('customizations', function() { + it('should support customized criteria', function() { + check(select().from('table').where(arraysToOrs({ this: 'test', that: ['test1', 'test2'] })), + "SELECT * FROM \"table\" WHERE this = 'test' AND (that = 'test1' OR that = 'test2')"); + }); + + it('should support changing the default array handling', function() { + const proto = sql.select.prototype; + const orig = proto.where; + proto.where = function(criteria) { + // return orig.call(this, arraysToOrs(criteria)); + return orig.call() + }; + + check(select().from('table').where({ this: 'test', that: ['test1', 'test2'] }), + "SELECT * FROM \"table\" WHERE this = 'test' AND (that = 'test1' OR that = 'test2')"); + + proto.where = orig; + }); + + function arraysToOrs(criteria) { + const where = and(); + for (const col in criteria) { + const val = criteria[col]; + let expr; + if (Array.isArray(val)) + expr = or(val.map(function(val) { return eq(col, val); })); + else + expr = eq(col, val); + where.expressions.push(expr); + } + return where; + } + + it('should support converting expressions to string', function() { + check(and({ this: 'test' }, $in('that', ['v1', 'v2'])), + "(this = 'test' AND that IN ('v1', 'v2'))"); + }); + + it('should support raw sql blocks in expressions', function() { + check(and({ this: 'test' }, sql('field is null')), + "(this = 'test' AND field is null)"); + }); + + it('should support converting ?-parameterized sql blocks to string', function() { + check(sql('field = ?', 123).toString({ placeholder: '?' }), + "field = 123"); + }); + + it('should support converting default-parameterized sql blocks to string', function() { + check(sql('field = $1', 123), + "field = 123"); + }); + }); + }); + + describe('should quote column names with capitals in them', function() { + it('in SELECT', function() { + check(select('Name').from('user'), + 'SELECT "Name" FROM "user"'); + }); + it('in SELECT, after tbl prefix, before AS suffix', function() { + check(select('user.Name AS UserName').from('user'), + 'SELECT "user"."Name" AS UserName FROM "user"'); + }); + it('in SELECT, after tbl prefix, with the optional "AS" omitted', function() { + check(select('user.Name UserName').from('user'), + 'SELECT "user"."Name" UserName FROM "user"'); + }); + it('in SELECT, with the optional "AS" omitted', function() { + check(select('Name UserName').from('user'), + 'SELECT "Name" UserName FROM "user"'); + }); + }); + + describe('should quote table names that are reserved words or have capitals', function() { + it('in joins', function() { + check(select('Name UserName').from('person').join('user', { 'person.usr_id': 'user.id' }), + 'SELECT "Name" UserName FROM person INNER JOIN "user" ON person.usr_id = "user".id'); + }); + it('unless they are wrapped in sql() literals (to query reserved system tables)', function() { + check(select(sql('user.id')).from(sql('user')), + 'SELECT user.id FROM user'); + }); + }); + + describe('should quote reserved words in column names', function() { + it('in ORDER BY', function() { + check(select().from('usr').orderBy('order'), + 'SELECT * FROM "user" usr ORDER BY "order"'); + }); + it('in SELECT', function() { + check(select('desc').from('usr'), + 'SELECT "desc" FROM "user" usr'); + }); + it('in JOIN ONs', function() { + check(select().from('usr').join('psn', { 'usr.order': 'psn.order' }), + 'SELECT * FROM "user" usr INNER JOIN person psn ON usr."order" = psn."order"'); + }); + it('in JOIN USINGs', function() { + check(select().from('usr').join('psn').using('order'), + 'SELECT * FROM "user" usr INNER JOIN person psn USING ("order")'); + }); + it('in INSERT', function() { + check(insert('user').values({ order: 1 }), + 'INSERT INTO "user" ("order") VALUES (1)'); + }); + it('in alternative insert() API', function() { + check(insert('user', 'order').values(1), + 'INSERT INTO "user" ("order") VALUES (1)'); + }); + it('with a db and table prefix and a suffix', function() { + check(select('db.person.desc AS psn_desc').from('person'), + 'SELECT db.person."desc" AS psn_desc FROM person'); + }); + it('should quote sqlite reserved words', function() { + check(select('action').from('user'), + 'SELECT "action" FROM "user"'); + }); + it('should not quote reserved words in SELECT expressions', function() { + check(select("CASE WHEN name = 'Fred' THEN 1 ELSE 0 AS security_level").from('user'), + "SELECT CASE WHEN name = 'Fred' THEN 1 ELSE 0 AS security_level FROM \"user\""); + }); + }); + + describe('subqueries in <, >, etc', function() { + it('should support a subquery in >', function() { + const count_addrs_for_usr = select('count(*)').from('address').where({ 'user.addr_id': sql('address.id') }); + check(select().from('user').where(gt(count_addrs_for_usr, 5)), + 'SELECT * FROM "user" WHERE (SELECT count(*) FROM address WHERE "user".addr_id = address.id) > 5'); + }); + it('should support a subquery in <=', function() { + const count_addrs_for_usr = select('count(*)').from('address').where({ 'user.addr_id': sql('address.id') }); + check(select().from('user').where(lte(count_addrs_for_usr, 5)), + 'SELECT * FROM "user" WHERE (SELECT count(*) FROM address WHERE "user".addr_id = address.id) <= 5'); + }); + it('should support = ANY (subquery) quantifier', function() { + check(select().from('user').where(eqAny('user.id', select('user_id').from('address'))), + 'SELECT * FROM "user" WHERE "user".id = ANY (SELECT user_id FROM address)'); + }); + it('should support <> ANY (subquery) quantifier', function() { + check(select().from('user').where(notEqAny('user.id', select('user_id').from('address'))), + 'SELECT * FROM "user" WHERE "user".id <> ANY (SELECT user_id FROM address)'); + }); + }); + + describe('deep Statement.clone()', function() { + it('should deep clone WHERE expressions', function() { + const sel = select().from('user').where({ first_name: 'Fred' }); + sel.clone().where({ last_name: 'Flintstone' }); + check(sel, "SELECT * FROM \"user\" WHERE first_name = 'Fred'"); + }); + it('should deep clone .order()', function() { + const sel = select().from('user').order('name'); + sel.clone().order('last_name'); + check(sel, 'SELECT * FROM "user" ORDER BY name'); + }); + it('should deep clone .join()', function() { + const sel = select().from('user').join('addr'); + sel.clone().join('psn'); + check(sel, 'SELECT * FROM "user" INNER JOIN address addr ON "user".addr_fk = addr.pk'); + }); + it('should clone values', function() { + const ins = insert('user', { first_name: 'Fred' }); + ins.clone().values({ last_name: 'Flintstone' }); + check(ins, "INSERT INTO \"user\" (first_name) VALUES ('Fred')"); + }); + it('should clone $in subqueries', function() { + const sel = select().from('user').where($in('first_name', select('first_name').from('user'))); + sel.clone().where('last_name', 'Flintstone'); + check(sel, "SELECT * FROM \"user\" WHERE first_name IN (SELECT first_name FROM \"user\")"); + }); + }); + + describe('the AS keyword', function() { + it('should not generate invalid SQL', function() { + check(select().from('user AS usr').join('addr'), + 'SELECT * FROM "user" AS usr INNER JOIN address addr ON usr.addr_fk = addr.pk'); + }); + }); + + describe('delete()', function() { + it('should generate a DELETE statement', function() { + check(del('user'), + 'DELETE FROM "user"'); + }); + it('should support .from()', function() { + check(del().from('user'), + 'DELETE FROM "user"'); + }); + it('should generate a DELETE statement with a WHERE clause', function() { + check(del('user').where('first_name', 'Fred'), + "DELETE FROM \"user\" WHERE first_name = 'Fred'"); + }); + }); + + describe('_extension()', function() { + it('should shield base', function() { + const ext = sql._extension(); + + ext.prop = 1; + assert.equal(sql.prop, undefined); + + ext.select.prop = 1; + // assert.equal(sql.select.returning, undefined); + + assert(ext.select.prototype.clauses !== sql.select.prototype.clauses); + }); + }); +}); + +function describe(...param) { } +function it(...param) { } +function check(...param) { } +function checkParams(...param) { } diff --git a/types/sql-bricks/tsconfig.json b/types/sql-bricks/tsconfig.json new file mode 100644 index 0000000000..3c5db90a4f --- /dev/null +++ b/types/sql-bricks/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": false, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "sql-bricks-tests.ts" + ] +} \ No newline at end of file diff --git a/types/sql-bricks/tslint.json b/types/sql-bricks/tslint.json new file mode 100644 index 0000000000..1e7260a20f --- /dev/null +++ b/types/sql-bricks/tslint.json @@ -0,0 +1,10 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "only-arrow-functions": false, + "prefer-template": false, + "prefer-conditional-expression": false, + "one-variable-per-declaration": false, + "semicolon":false + } +} \ No newline at end of file From 6095ef105d0156ec9ad3a03621edf7f8df60cea4 Mon Sep 17 00:00:00 2001 From: Reid Weber Date: Thu, 29 Mar 2018 10:55:29 -0700 Subject: [PATCH 0330/2153] Added calendar to Expo Permissions --- types/expo/index.d.ts | 3 ++- types/expo/v24/expo-tests.tsx | 1 + types/expo/v24/index.d.ts | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 8661cac727..2cde351dbe 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -1701,7 +1701,7 @@ export namespace Pedometer { */ export namespace Permissions { type PermissionType = 'remoteNotifications' | 'location' | - 'camera' | 'contacts' | 'audioRecording'; + 'camera' | 'contacts' | 'audioRecording' | 'calendar'; type PermissionStatus = 'undetermined' | 'granted' | 'denied'; type PermissionExpires = 'never'; @@ -1733,6 +1733,7 @@ export namespace Permissions { const NOTIFICATIONS: RemoteNotificationPermission; const CONTACTS: 'contacts'; const SYSTEM_BRIGHTNESS: 'systemBrightness'; + const CALENDAR: 'calendar'; } /** diff --git a/types/expo/v24/expo-tests.tsx b/types/expo/v24/expo-tests.tsx index 8749a5993c..5ea1758270 100644 --- a/types/expo/v24/expo-tests.tsx +++ b/types/expo/v24/expo-tests.tsx @@ -528,6 +528,7 @@ Permissions.CONTACTS === 'contacts'; Permissions.NOTIFICATIONS === 'remoteNotifications'; Permissions.REMOTE_NOTIFICATIONS === 'remoteNotifications'; Permissions.SYSTEM_BRIGHTNESS === 'systemBrightness'; +Permissions.CALENDAR === 'calendar'; async () => { const result = await Permissions.askAsync(Permissions.CAMERA); diff --git a/types/expo/v24/index.d.ts b/types/expo/v24/index.d.ts index 829e9730a7..376f885073 100644 --- a/types/expo/v24/index.d.ts +++ b/types/expo/v24/index.d.ts @@ -1681,7 +1681,7 @@ export namespace Pedometer { */ export namespace Permissions { type PermissionType = 'remoteNotifications' | 'location' | - 'camera' | 'contacts' | 'audioRecording'; + 'camera' | 'contacts' | 'audioRecording' | 'calendar'; type PermissionStatus = 'undetermined' | 'granted' | 'denied'; type PermissionExpires = 'never'; @@ -1713,6 +1713,7 @@ export namespace Permissions { const NOTIFICATIONS: RemoteNotificationPermission; const CONTACTS: 'contacts'; const SYSTEM_BRIGHTNESS: 'systemBrightness'; + const CALENDAR: 'calendar'; } /** From 600231c52fc6fa43e605ef19ffb20b20b56fa752 Mon Sep 17 00:00:00 2001 From: "Narcisse D. ASSOGBA" Date: Thu, 29 Mar 2018 19:03:17 +0100 Subject: [PATCH 0331/2153] Add "noImplicitAny" constraint and other tslint constraints --- types/sql-bricks/index.d.ts | 121 ++++++++++++++------------- types/sql-bricks/sql-bricks-tests.ts | 64 ++++++++------ types/sql-bricks/tsconfig.json | 2 +- types/sql-bricks/tslint.json | 3 - 4 files changed, 103 insertions(+), 87 deletions(-) diff --git a/types/sql-bricks/index.d.ts b/types/sql-bricks/index.d.ts index d09bfee715..ccc7e523a7 100644 --- a/types/sql-bricks/index.d.ts +++ b/types/sql-bricks/index.d.ts @@ -78,16 +78,17 @@ declare namespace SqlBricks { * Appends additional columns to an existing query. * @param columns can be passed as multiple arguments, a comma-delimited string or an array. */ - select(...columns: string[]): SelectStatement + select(...columns: Array): SelectStatement /** * Appends additional columns to an existing query. * @param columns can be passed as multiple arguments, a comma-delimited string or an array. */ - select(columns: string[]): SelectStatement - select(...params): SelectStatement + select(columns: string[] | SelectStatement[]): SelectStatement + as(alias: string): SelectStatement - distinct(...columns): SelectStatement + distinct(...columns: Array): SelectStatement + distinct(columns: string[] | SelectStatement[]): SelectStatement /** * Makes the query a SELECT ... INTO query (which creates a new table with the results of the query). @@ -102,8 +103,8 @@ declare namespace SqlBricks { */ intoTable(tbl: TableName): SelectStatement - intoTemp(tbl: TableName): SelectStatement, - intoTempTable(tbl: TableName): SelectStatement, + intoTemp(tbl: TableName): SelectStatement + intoTempTable(tbl: TableName): SelectStatement /** * Table names can be passed in as multiple string arguments, a comma-delimited string or an array. @@ -151,8 +152,8 @@ declare namespace SqlBricks { fullOuterJoin(tbl: string, onCol1: string, onCol2: string): SelectStatement fullOuterJoin(firstTbl: string, ...otherTbls: string[]): SelectStatement - on(onCriteria: OnCriteria | WhereExpression): SelectStatement, - on(onCol1: string, onCol2: string): SelectStatement, + on(onCriteria: OnCriteria | WhereExpression): SelectStatement + on(onCol1: string, onCol2: string): SelectStatement /** * Joins using USING instead of ON. @@ -178,11 +179,10 @@ declare namespace SqlBricks { naturalRightOuterJoin(tbl: string): SelectStatement naturalFullOuterJoin(tbl: string): SelectStatement - where(column: string, value?: string): SelectStatement - where(whereExpr: WhereExpression): SelectStatement - where(...options): SelectStatement + where(column?: string | null, value?: any): SelectStatement + where(...whereExpr: WhereExpression[]): SelectStatement - and(...options): SelectStatement + and(...options: any[]): SelectStatement /** * Sets or extends the GROUP BY columns. @@ -219,28 +219,34 @@ declare namespace SqlBricks { interface InsertStatement extends Statement { into(tbl: TableName, ...columns: any[]): InsertStatement intoTable(tbl: TableName, ...columns: any[]): InsertStatement - select(...params): SelectStatement, - values(...values): InsertStatement + select(...columns: Array): SelectStatement + select(columns: string[] | SelectStatement[]): SelectStatement + values(...values: any[]): InsertStatement } /** * An UPDATE statement */ interface UpdateStatement extends Statement { - values(...values): UpdateStatement - set(...values): UpdateStatement, - where(...options): UpdateStatement, - and(...options): UpdateStatement, + values(...values: any[]): UpdateStatement + set(...values: any[]): UpdateStatement + where(column?: string | null, value?: any): SelectStatement + where(...whereExpr: WhereExpression[]): SelectStatement + and(column?: string | null, value?: any): SelectStatement + and(...whereExpr: WhereExpression[]): SelectStatement } /** * A DELETE statement */ interface DeleteStatement extends Statement { - from(...tbls: string[]): DeleteStatement, - using(...columnList): DeleteStatement, - where(...options): DeleteStatement, - and(...options): DeleteStatement, + from(...tbls: string[]): DeleteStatement + using(...columnList: string[]): SelectStatement + using(columnList: string[]): SelectStatement + where(column?: string | null, value?: any): SelectStatement + where(...whereExpr: WhereExpression[]): SelectStatement + and(column?: string | null, value?: any): SelectStatement + and(...whereExpr: WhereExpression[]): SelectStatement } } @@ -251,7 +257,7 @@ interface SqlBricksFn { * anywhere that a column is expected (the left-hand side of WHERE criteria and many other SQL Bricks APIs) * @param value value to be wraped */ - val(value): any + val(value: any): any /** * Returns a new INSERT statement. It can be used with or without the new operator. @@ -263,7 +269,7 @@ interface SqlBricksFn { * insert('person', {'first_name': 'Fred', 'last_name': 'Flintstone'}); * // INSERT INTO person (first_name, last_name) VALUES ('Fred', 'Flintstone') */ - insert(tbl?: string, ...values): SqlBricks.InsertStatement + insert(tbl?: string, ...values: any[]): SqlBricks.InsertStatement /** * Returns a new INSERT statement. It can be used with or without the new operator. @@ -275,23 +281,22 @@ interface SqlBricksFn { * insert('person', {'first_name': 'Fred', 'last_name': 'Flintstone'}); * // INSERT INTO person (first_name, last_name) VALUES ('Fred', 'Flintstone') */ - insertInto(tbl?: string, ...values): SqlBricks.InsertStatement + insertInto(tbl?: string, ...values: any[]): SqlBricks.InsertStatement /** * Returns a new select statement, seeded with a set of columns. It can be used with or without the new keyword. * @param columns it can be passed in here (or appended later via sel.select() or sel.distinct()) via multiple arguments * or a comma-delimited string or an array. If no columns are specified, toString() will default to SELECT *. */ - select(...columns: string[]): SqlBricks.SelectStatement + select(...columns: Array): SqlBricks.SelectStatement select(columns: string[] | SqlBricks.SelectStatement[]): SqlBricks.SelectStatement - select(...params): SqlBricks.SelectStatement /** * Returns a new UPDATE statement. It can be used with or without the new operator. * @param tbl table name * @param values */ - update(tbl: string, ...values): SqlBricks.UpdateStatement + update(tbl: string, ...values: any[]): SqlBricks.UpdateStatement /** * Returns a new DELETE statement. It can be used with or without the new operator. @@ -322,7 +327,7 @@ interface SqlBricksFn { * Sets a user-supplied function to automatically generate the .on() criteria for joins whenever it is not supplied explicitly. * @param func */ - joinCriteria(func?: (...args) => SqlBricks.OnCriteria): any + joinCriteria(func?: (...args: any[]) => SqlBricks.OnCriteria): any _extension(): any prop: number @@ -357,47 +362,47 @@ interface SqlBricksFn { * @param value1 * @param value2 */ - between(column: string, value1, value2): SqlBricks.WhereExpression + between(column: string, value1: any, value2: any): SqlBricks.WhereExpression isNull(column: string): SqlBricks.WhereExpression isNotNull(column: string): SqlBricks.WhereExpression - like(column: string, value, escapeStr?: string): SqlBricks.WhereExpression - exists(stmt): SqlBricks.WhereExpression + like(column: string, value: any, escapeStr?: string): SqlBricks.WhereExpression + exists(stmt: any): SqlBricks.WhereExpression in(column: string, stmt: SqlBricks.SelectStatement): SqlBricks.WhereExpression - in(column: string, ...values): SqlBricks.WhereExpression + in(column: string, ...values: any[]): SqlBricks.WhereExpression /** * Generates the appropriate relational operator (=, <>, <, <=, > or >=). * @param column column name or query result * @param value column value */ - eq(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - equal(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - notEq(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - lt(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - lte(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - gt(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - gte(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + eq(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + equal(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + notEq(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + lt(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + lte(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + gt(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + gte(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary - eqAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - notEqAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - ltAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - lteAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - gtAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - gteAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + eqAll(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + notEqAll(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + ltAll(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + lteAll(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + gtAll(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + gteAll(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary - eqAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - notEqAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - ltAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - lteAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - gtAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - gteAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + eqAny(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + notEqAny(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + ltAny(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + lteAny(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + gtAny(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + gteAny(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary - eqSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - notEqSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - ltSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - lteSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - gtSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - gteSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + eqSome(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + notEqSome(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + ltSome(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + lteSome(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + gtSome(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + gteSome(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary } declare const SqlBricks: SqlBricksFn diff --git a/types/sql-bricks/sql-bricks-tests.ts b/types/sql-bricks/sql-bricks-tests.ts index 94014d913d..8a5c7de5d7 100644 --- a/types/sql-bricks/sql-bricks-tests.ts +++ b/types/sql-bricks/sql-bricks-tests.ts @@ -6,22 +6,38 @@ import * as sql from "sql-bricks"; // tslint:disable-next-line:prefer-const -let assert; +let assert: any; const select = sql.select; -const insertInto = sql.insertInto, insert = sql.insert, - update = sql.update, del = sql.delete; -const and = sql.and, or = sql.or, like = sql.like, not = sql.not, $in = sql.in, - isNull = sql.isNull, isNotNull = sql.isNotNull, equal = sql.equal, eq = sql.eq, - notEq = sql.notEq, lt = sql.lt, lte = sql.lte, gt = sql.gt, gte = sql.gte, - between = sql.between, exists = sql.exists, eqAny = sql.eqAny, notEqAny = sql.notEqAny; +const insertInto = sql.insertInto; +const insert = sql.insert; +const update = sql.update; +const del = sql.delete; +const and = sql.and; +const or = sql.or; +const like = sql.like; +const not = sql.not; +const $in = sql.in; +const isNull = sql.isNull; +const isNotNull = sql.isNotNull; +const equal = sql.equal; +const eq = sql.eq; +const notEq = sql.notEq; +const lt = sql.lt; +const lte = sql.lte; +const gt = sql.gt; +const gte = sql.gte; +const between = sql.between; +const exists = sql.exists; +const eqAny = sql.eqAny; +const notEqAny = sql.notEqAny; const alias_expansions = { usr: 'user', psn: 'person', addr: 'address' }; -const table_to_alias = alias_expansions; +const table_to_alias: sql.OnCriteria = alias_expansions; sql.aliasExpansions(alias_expansions); -sql.joinCriteria(function(left_tbl, left_alias, right_tbl, right_alias) { - const criteria = {}; - criteria[left_alias + '.' + table_to_alias[right_tbl] + '_fk'] = right_alias + '.pk'; +sql.joinCriteria(function(left_tbl: string, left_alias: string, right_tbl: string, right_alias: string) { + const criteria: sql.OnCriteria = {}; + criteria[`${left_alias}.${table_to_alias[right_tbl]}_fk`] = right_alias + '.pk'; return criteria; }); @@ -160,7 +176,7 @@ describe('SQL Bricks', function() { }); it('should support user-supplied conversions', function() { const orig_bool = sql.conversions.Boolean; - sql.conversions.Boolean = function(bool) { return bool ? '1' : '0'; }; + sql.conversions.Boolean = function(bool: boolean) { return bool ? '1' : '0'; }; const str = del('user').where('active', false).toString(); sql.conversions.Boolean = orig_bool; assert.equal(str, 'DELETE FROM "user" WHERE active = 0'); @@ -184,7 +200,7 @@ describe('SQL Bricks', function() { select().from('test').join('psn').join('usr').toString(); sql.joinCriteria(orig); - assert(left_tbls.indexOf('person') > -1 && left_tbls.indexOf('psn') === -1, 'left_tbl is not expanded: [' + left_tbls.join(',') + ']'); + assert(left_tbls.indexOf('person') > -1 && left_tbls.indexOf('psn') === -1, `left_tbl is not expanded: [ ${left_tbls.join(',')} ]`); }); it('should support aliases', function() { @@ -727,9 +743,9 @@ describe('SQL Bricks', function() { it('should support changing the default array handling', function() { const proto = sql.select.prototype; const orig = proto.where; - proto.where = function(criteria) { + proto.where = function(criteria: sql.OnCriteria) { // return orig.call(this, arraysToOrs(criteria)); - return orig.call() + return orig.call(); }; check(select().from('table').where({ this: 'test', that: ['test1', 'test2'] }), @@ -738,15 +754,13 @@ describe('SQL Bricks', function() { proto.where = orig; }); - function arraysToOrs(criteria) { + function arraysToOrs(criteria: sql.WhereObject) { const where = and(); for (const col in criteria) { const val = criteria[col]; - let expr; - if (Array.isArray(val)) - expr = or(val.map(function(val) { return eq(col, val); })); - else - expr = eq(col, val); + let expr: sql.WhereExpression; + expr = Array.isArray(val) ? or(val.map(function(val) { return eq(col, val); })) + : expr = eq(col, val); where.expressions.push(expr); } return where; @@ -929,7 +943,7 @@ describe('SQL Bricks', function() { }); }); -function describe(...param) { } -function it(...param) { } -function check(...param) { } -function checkParams(...param) { } +function describe(...param: any[]) { } +function it(...param: any[]) { } +function check(...param: any[]) { } +function checkParams(...param: any[]) { } diff --git a/types/sql-bricks/tsconfig.json b/types/sql-bricks/tsconfig.json index 3c5db90a4f..4b321fc911 100644 --- a/types/sql-bricks/tsconfig.json +++ b/types/sql-bricks/tsconfig.json @@ -4,7 +4,7 @@ "lib": [ "es6" ], - "noImplicitAny": false, + "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, diff --git a/types/sql-bricks/tslint.json b/types/sql-bricks/tslint.json index 1e7260a20f..4ddaadda1f 100644 --- a/types/sql-bricks/tslint.json +++ b/types/sql-bricks/tslint.json @@ -2,9 +2,6 @@ "extends": "dtslint/dt.json", "rules": { "only-arrow-functions": false, - "prefer-template": false, - "prefer-conditional-expression": false, - "one-variable-per-declaration": false, "semicolon":false } } \ No newline at end of file From c6db43bf5edd247e458229e27e75d87ecfcd43e0 Mon Sep 17 00:00:00 2001 From: jphamilton Date: Thu, 29 Mar 2018 13:19:42 -0500 Subject: [PATCH 0332/2153] Adding xaxis/yaxis options --- types/highcharts/highstock.d.ts | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/types/highcharts/highstock.d.ts b/types/highcharts/highstock.d.ts index d2d81af469..5af463d0a2 100644 --- a/types/highcharts/highstock.d.ts +++ b/types/highcharts/highstock.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Highstock 2.1.5 +// Type definitions for Highstock 2.1.6 // Project: http://www.highcharts.com/ // Definitions by: David Deutsch @@ -87,12 +87,39 @@ declare namespace Highstock { scrollbar?: ScrollbarOptions; } + interface XAxisOptions extends AxisOptions { + ordinal?: boolean; + overscroll?: number; + } + + interface YAxisOptions extends AxisOptions { + height?: number | string; + maxLength?: number | string; + minLength?: number | string; + resize?: { + controlledAxis?: { + next?: Array; + prev?: Array; + }, + cursor?: string; + enabled?: boolean; + lineColor?: string; + lineDashStyle?: string; + lineWidth?: number; + x?: number; + y?: number; + }; + reversedStacks?: boolean; + tooltipValueFormat?: string; + top?: number | string; + } + interface Options extends Highcharts.Options { navigator?: NavigatorOptions; rangeSelector?: RangeSelectorOptions; scrollbar?: ScrollbarOptions; - xAxis?: AxisOptions[] | AxisOptions; - yAxis?: AxisOptions[] | AxisOptions; + xAxis?: XAxisOptions[] |XAxisOptions; + yAxis?: YAxisOptions[] | YAxisOptions; } interface Chart { From 4f0d4b66231ff3199b7331f623f23cdc26b727ef Mon Sep 17 00:00:00 2001 From: jphamilton Date: Thu, 29 Mar 2018 13:30:55 -0500 Subject: [PATCH 0333/2153] fixed lint errors --- types/highcharts/highstock.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/highcharts/highstock.d.ts b/types/highcharts/highstock.d.ts index 5af463d0a2..a97ae9effa 100644 --- a/types/highcharts/highstock.d.ts +++ b/types/highcharts/highstock.d.ts @@ -88,8 +88,8 @@ declare namespace Highstock { } interface XAxisOptions extends AxisOptions { - ordinal?: boolean; - overscroll?: number; + ordinal?: boolean; + overscroll?: number; } interface YAxisOptions extends AxisOptions { From 95cb5756a15d82ba8c729c3582a63588934deec7 Mon Sep 17 00:00:00 2001 From: Reid Weber Date: Thu, 29 Mar 2018 12:34:16 -0700 Subject: [PATCH 0334/2153] Removed v24 changes --- types/expo/v24/expo-tests.tsx | 1 - types/expo/v24/index.d.ts | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/types/expo/v24/expo-tests.tsx b/types/expo/v24/expo-tests.tsx index 5ea1758270..8749a5993c 100644 --- a/types/expo/v24/expo-tests.tsx +++ b/types/expo/v24/expo-tests.tsx @@ -528,7 +528,6 @@ Permissions.CONTACTS === 'contacts'; Permissions.NOTIFICATIONS === 'remoteNotifications'; Permissions.REMOTE_NOTIFICATIONS === 'remoteNotifications'; Permissions.SYSTEM_BRIGHTNESS === 'systemBrightness'; -Permissions.CALENDAR === 'calendar'; async () => { const result = await Permissions.askAsync(Permissions.CAMERA); diff --git a/types/expo/v24/index.d.ts b/types/expo/v24/index.d.ts index 376f885073..829e9730a7 100644 --- a/types/expo/v24/index.d.ts +++ b/types/expo/v24/index.d.ts @@ -1681,7 +1681,7 @@ export namespace Pedometer { */ export namespace Permissions { type PermissionType = 'remoteNotifications' | 'location' | - 'camera' | 'contacts' | 'audioRecording' | 'calendar'; + 'camera' | 'contacts' | 'audioRecording'; type PermissionStatus = 'undetermined' | 'granted' | 'denied'; type PermissionExpires = 'never'; @@ -1713,7 +1713,6 @@ export namespace Permissions { const NOTIFICATIONS: RemoteNotificationPermission; const CONTACTS: 'contacts'; const SYSTEM_BRIGHTNESS: 'systemBrightness'; - const CALENDAR: 'calendar'; } /** From 9dbca95dbdf4d9b2ba4b0a5e603d9373eeba1642 Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 29 Mar 2018 21:59:19 +0200 Subject: [PATCH 0335/2153] Node-Polyglot: Added method has to interface --- types/node-polyglot/index.d.ts | 2 ++ types/node-polyglot/node-polyglot-tests.ts | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/node-polyglot/index.d.ts b/types/node-polyglot/index.d.ts index 7587f77640..dac678b7c6 100644 --- a/types/node-polyglot/index.d.ts +++ b/types/node-polyglot/index.d.ts @@ -38,6 +38,8 @@ declare class Polyglot { locale(): string; locale(locale: string): void; + + has(phrase: string): boolean; } export = Polyglot; diff --git a/types/node-polyglot/node-polyglot-tests.ts b/types/node-polyglot/node-polyglot-tests.ts index bfb18339c0..0c84a3dea1 100644 --- a/types/node-polyglot/node-polyglot-tests.ts +++ b/types/node-polyglot/node-polyglot-tests.ts @@ -46,7 +46,10 @@ function translate(): void { polyglot.t("i_like_to_write_in_language", { _: "I like to write in %{language}.", language: "Javascript" - }); + }); + + polyglot.has("hello"); + polyglot.has("world"); polyglot.replace({ "hello": "hey", From 7a85f1ee36d7fad06041c1f83a8f57e40bc789fd Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 29 Mar 2018 22:02:39 +0200 Subject: [PATCH 0336/2153] Bumped version --- types/node-polyglot/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/node-polyglot/index.d.ts b/types/node-polyglot/index.d.ts index dac678b7c6..3133def496 100644 --- a/types/node-polyglot/index.d.ts +++ b/types/node-polyglot/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for node-polyglot v0.4.1 +// Type definitions for node-polyglot v0.4.2 // Project: https://github.com/airbnb/polyglot.js // Definitions by: Tim Jackson-Kiely // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 0ebbe5bd157a8aeffdd10eb1dd45cdf796d28060 Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 29 Mar 2018 22:13:15 +0200 Subject: [PATCH 0337/2153] Added tabs again --- types/node-polyglot/node-polyglot-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/node-polyglot/node-polyglot-tests.ts b/types/node-polyglot/node-polyglot-tests.ts index 0c84a3dea1..14efa8ad30 100644 --- a/types/node-polyglot/node-polyglot-tests.ts +++ b/types/node-polyglot/node-polyglot-tests.ts @@ -46,10 +46,10 @@ function translate(): void { polyglot.t("i_like_to_write_in_language", { _: "I like to write in %{language}.", language: "Javascript" - }); + }); - polyglot.has("hello"); - polyglot.has("world"); + polyglot.has("hello"); + polyglot.has("world"); polyglot.replace({ "hello": "hey", From e2d2716e8ca75ef7d17bd1cddc355ab666d47849 Mon Sep 17 00:00:00 2001 From: Feirell Date: Thu, 29 Mar 2018 23:07:15 +0200 Subject: [PATCH 0338/2153] [three] added test for PlaneHelper --- types/three/test/webgl/webgl_helpers.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/types/three/test/webgl/webgl_helpers.ts b/types/three/test/webgl/webgl_helpers.ts index 6b955968f4..9033ed5279 100644 --- a/types/three/test/webgl/webgl_helpers.ts +++ b/types/three/test/webgl/webgl_helpers.ts @@ -1,3 +1,4 @@ + // https://github.com/mrdoob/three.js/blob/master/examples/webgl_helpers.html () => { @@ -27,10 +28,14 @@ scene.add(new THREE.PointLightHelper(light, 5)); - var helper = new THREE.GridHelper(200, 10); - helper.setColors(0x0000ff, 0x808080); - helper.position.y = - 150; - scene.add(helper); + var gridHelper = new THREE.GridHelper(200, 10); + gridHelper.setColors(0x0000ff, 0x808080); + gridHelper.position.y = - 150; + scene.add(gridHelper); + + var plane = new THREE.Plane(new THREE.Vector3(1, 1, 0.2), 3); + var planeHelper = new THREE.PlaneHelper(plane, 1, 0xffff00); + scene.add(planeHelper); var loader = new THREE.JSONLoader(); loader.load('obj/leeperrysmith/LeePerrySmith.js', function (geometry, materials) { From cee5dc61ed0e84db7df24130c77b37793b43f338 Mon Sep 17 00:00:00 2001 From: "Matt R. Wilson" Date: Thu, 29 Mar 2018 15:48:36 -0600 Subject: [PATCH 0339/2153] [@types/newrelic] Add startSegment. --- types/newrelic/index.d.ts | 22 +++++++++++++++++++++- types/newrelic/newrelic-tests.ts | 6 ++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/types/newrelic/index.d.ts b/types/newrelic/index.d.ts index 83b6e409dc..f6c54f5a4b 100644 --- a/types/newrelic/index.d.ts +++ b/types/newrelic/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for newrelic 2.7 +// Type definitions for newrelic 3.3 // Project: http://github.com/newrelic/node-newrelic // Definitions by: Matt R. Wilson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -147,6 +147,23 @@ declare namespace newrelic { */ getBrowserTimingHeader(): string; + /** + * Instrument a particular method to improve visibility into a transaction, + * or optionally turn it into a metric. + * + * The name defines a name for the segment. This name will be visible in transaction traces and + * as a new metric in the New Relic UI. + * The record flag defines whether the segment should be recorded as a metric. + * The handler is the function you want to track as a segment. + * The optional callback is a function passed to the handler to fire after its work is done. + * + * The agent begins timing the segment when startSegment is called. + * The segment is ended when either the handler finishes executing, or callback is fired, if it is provided. + * If a promise is returned from the handler, the segment's ending will be tied to that promise resolving or rejecting. + */ + startSegment>(name: string, record: boolean, handler: T): T; + startSegment any>(name: string, record: boolean, handler: (cb?: C) => T, callback?: C): T; + /** * Instrument a particular callback to improve visibility into a transaction. * @@ -157,6 +174,9 @@ declare namespace newrelic { * * The agent begins timing the segment when createTracer is called, and ends the segment when the callback * defined by the callback argument finishes executing. + * + * @deprecated + * This method has been deprecated in favor of newrelic.startSegment() */ createTracer any>(name: string, handle: T): T; diff --git a/types/newrelic/newrelic-tests.ts b/types/newrelic/newrelic-tests.ts index 73cd53cc78..3f99152c66 100644 --- a/types/newrelic/newrelic-tests.ts +++ b/types/newrelic/newrelic-tests.ts @@ -29,6 +29,12 @@ newrelic.addIgnoringRule(/^[0-9]+$/); // $ExpectType void newrelic.getBrowserTimingHeader(); // $ExpectType string +newrelic.startSegment('foo', false, () => "bar"); // $ExpectType string +newrelic.startSegment('foo', false, () => "bar", () => "baz"); // $ExpectType string +newrelic.startSegment('foo', false, Promise.all([5, 7])).then(([a, b]: [number, number]) => { + console.log(a, b); +}); + const wrappedFn = newrelic.createTracer("foo", (x: number) => { return x * x; }); From 646191d20b2f1dc6949752d5d8d1ba67e8e5bf94 Mon Sep 17 00:00:00 2001 From: "Narcisse D. ASSOGBA" Date: Thu, 29 Mar 2018 23:04:14 +0100 Subject: [PATCH 0340/2153] Use import sql = require("sql-bricks") syntax for the module import --- types/sql-bricks/sql-bricks-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/sql-bricks/sql-bricks-tests.ts b/types/sql-bricks/sql-bricks-tests.ts index 8a5c7de5d7..effc01eca3 100644 --- a/types/sql-bricks/sql-bricks-tests.ts +++ b/types/sql-bricks/sql-bricks-tests.ts @@ -3,7 +3,7 @@ // taked the 03/29/2018. Some dtslint rules has been deabled to be // close as possible of the original js file. -import * as sql from "sql-bricks"; +import sql = require("sql-bricks"); // tslint:disable-next-line:prefer-const let assert: any; From 204e0d396a0bb36c0f1b4b34ad0c939f94bbc273 Mon Sep 17 00:00:00 2001 From: dcharbonnier Date: Fri, 30 Mar 2018 08:46:12 +0200 Subject: [PATCH 0341/2153] ServerInjectOptions.app is optional --- types/hapi/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index 3628a7a931..25d44b2732 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -2586,7 +2586,7 @@ export interface ServerInjectOptions extends Shot.RequestOptions { /** * sets the initial value of request.app, defaults to {}. */ - app: ApplicationState; + app?: ApplicationState; /** * sets the initial value of request.plugins, defaults to {}. */ From 7c35bcd4228ca48362b5fcaedf49ec9fd07800a6 Mon Sep 17 00:00:00 2001 From: doomsower Date: Fri, 30 Mar 2018 11:18:04 +0300 Subject: [PATCH 0342/2153] Stronger params for screen --- types/react-navigation/index.d.ts | 91 ++++++++++--------- .../react-navigation-tests.tsx | 7 +- 2 files changed, 52 insertions(+), 46 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 241232227e..88d510134d 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -46,10 +46,10 @@ export interface HeaderProps extends NavigationSceneRendererProps { router: NavigationRouter< NavigationState, NavigationStackScreenOptions - >; + >; getScreenDetails: (navigationScene: NavigationScene) => NavigationScreenDetails< NavigationStackScreenOptions - >; + >; style: StyleProp; } @@ -147,9 +147,9 @@ export interface NavigationRouter { export type NavigationScreenOption = T | (( - navigation: NavigationScreenProp, - config: T - ) => T); + navigation: NavigationScreenProp, + config: T +) => T); export interface NavigationScreenDetails { options: T; @@ -169,26 +169,27 @@ export interface NavigationScreenConfigProps { export type NavigationScreenConfig = Options | ((navigationOptionsContainer: NavigationScreenConfigProps & { - navigationOptions: NavigationScreenProp, - }) => Options); + navigationOptions: NavigationScreenProp, +}) => Options); export type NavigationComponent = - NavigationScreenComponent + NavigationScreenComponent | NavigationNavigator; export type NavigationScreenComponent< - Options = {}, - Props = {} -> = React.ComponentType & Props> & -{ navigationOptions?: NavigationScreenConfig }; + Params = NavigationParams, + Options = {}, + Props = {} + > = React.ComponentType & Props> & + { navigationOptions?: NavigationScreenConfig }; export type NavigationNavigator< - State = NavigationState, - Options = {}, - Props = {} -> = React.ComponentType & Props> & { - router: NavigationRouter, - navigationOptions?: NavigationScreenConfig, + State = NavigationState, + Options = {}, + Props = {} + > = React.ComponentType & Props> & { + router: NavigationRouter, + navigationOptions?: NavigationScreenConfig, }; export interface NavigationParams { @@ -332,9 +333,9 @@ export type NavigationRouteConfig = NavigationComponent | ({ } & NavigationScreenRouteConfig); export type NavigationScreenRouteConfig = NavigationComponent | { - screen: NavigationComponent, + screen: NavigationComponent, } | { - getScreen: () => NavigationComponent, + getScreen: () => NavigationComponent, }; export interface NavigationPathsConfig { @@ -351,22 +352,22 @@ export interface NavigationTabRouterConfig { backBehavior?: 'none' | 'initialRoute'; // defaults `initialRoute` } export interface TabScene { - route: NavigationRoute; - focused: boolean; - index: number; - tintColor?: string; + route: NavigationRoute; + focused: boolean; + index: number; + tintColor?: string; } export interface NavigationTabScreenOptions extends NavigationScreenOptions { tabBarIcon?: React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< - any + any > | null)); tabBarLabel?: string | React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< - any + any > | string | null)); tabBarVisible?: boolean; tabBarTestIDProps?: { testID?: string, accessibilityLabel?: string }; @@ -380,13 +381,13 @@ export interface NavigationDrawerScreenOptions extends NavigationScreenOptions { drawerIcon?: React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< - any + any > | null)); drawerLabel?: string | React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< - any + any > | null)); } @@ -402,11 +403,11 @@ export interface NavigationProp { } export type EventType = -| 'willFocus' -| 'didFocus' -| 'willBlur' -| 'didBlur' -| 'action'; + | 'willFocus' + | 'didFocus' + | 'willBlur' + | 'didBlur' + | 'action'; export interface NavigationEventPayload { type: EventType; @@ -429,17 +430,17 @@ export interface NavigationScreenProp { goBack: (routeKey?: string | null) => boolean; navigate(options: { routeName: string; - params?: P; + params?: NavigationParams; action?: NavigationAction; key?: string; }): boolean; navigate( routeNameOrOptions: string, - params?: P, + params?: NavigationParams, action?: NavigationAction, ): boolean; getParam: (param: T, fallback?: P[T]) => P[T]; - setParams: (newParams: NavigationParams) => boolean; + setParams: (newParams: P) => boolean; addListener: ( eventName: string, callback: NavigationEventCallback @@ -565,9 +566,9 @@ export interface LayoutEvent { } export type NavigatorType = -| 'react-navigation/STACK' -| 'react-navigation/TABS' -| 'react-navigation/DRAWER'; + | 'react-navigation/STACK' + | 'react-navigation/TABS' + | 'react-navigation/DRAWER'; export function addNavigationHelpers( navigation: { @@ -592,7 +593,7 @@ export interface NavigationContainerProps { export interface NavigationContainer extends React.ComponentClass< NavigationContainerProps & NavigationNavigatorProps -> { + > { router: NavigationRouter; screenProps: { [key: string]: any }; navigationOptions: any; @@ -657,7 +658,7 @@ export function DrawerNavigator( * Tab Navigator */ -// From views/TabView/TabView.js + // From views/TabView/TabView.js export interface TabViewConfig { tabBarComponent?: React.ReactType; tabBarPosition?: 'top' | 'bottom'; @@ -806,7 +807,7 @@ export interface TransitionerState { export class Transitioner extends React.Component< TransitionerProps, TransitionerState -> { } + > { } /** * Tab Router @@ -859,10 +860,10 @@ export function createNavigationContainer( * BEGIN CUSTOM CONVENIENCE INTERFACES */ -export interface NavigationScreenProps { - navigation: NavigationScreenProp>; +export interface NavigationScreenProps { + navigation: NavigationScreenProp, Params>; screenProps?: { [key: string]: any }; - navigationOptions?: NavigationScreenConfig; + navigationOptions?: NavigationScreenConfig; } /** diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index d70bca3ecd..7e956d2c1a 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -134,7 +134,12 @@ export const AppNavigator = StackNavigator( }, ); -const StatelessScreen: NavigationScreenComponent = () => ; +interface StatelessScreenParams { + testID: string; +} + +const StatelessScreen: NavigationScreenComponent = (props) => + ; StatelessScreen.navigationOptions = { title: 'Stateless' }; From 405c4937e623259c7093a193d4ae997a04363873 Mon Sep 17 00:00:00 2001 From: Christian Johansen Date: Fri, 30 Mar 2018 10:20:06 +0200 Subject: [PATCH 0343/2153] Changed react-beautiful-dnd ZIndex type to React.CSSProperties['z-Index'] instead of number | String --- types/react-beautiful-dnd/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-beautiful-dnd/index.d.ts b/types/react-beautiful-dnd/index.d.ts index d02c86bbcf..9f49eb5e96 100644 --- a/types/react-beautiful-dnd/index.d.ts +++ b/types/react-beautiful-dnd/index.d.ts @@ -12,7 +12,7 @@ export type Id = string; export type DraggableId = Id; export type DroppableId = Id; export type TypeId = Id; -export type ZIndex = number | string; +export type ZIndex = React.CSSProperties['z-Index']; export type DropReason = 'DROP' | 'CANCEL'; export type Announce = (message: string) => void; From 5575ff4dc1776255b373258b777489e455993475 Mon Sep 17 00:00:00 2001 From: doomsower Date: Fri, 30 Mar 2018 11:34:29 +0300 Subject: [PATCH 0344/2153] Fix whitespaces --- types/react-navigation/index.d.ts | 78 +++++++++++++++---------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 88d510134d..f86a47ccf5 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -46,10 +46,10 @@ export interface HeaderProps extends NavigationSceneRendererProps { router: NavigationRouter< NavigationState, NavigationStackScreenOptions - >; + >; getScreenDetails: (navigationScene: NavigationScene) => NavigationScreenDetails< NavigationStackScreenOptions - >; + >; style: StyleProp; } @@ -147,9 +147,9 @@ export interface NavigationRouter { export type NavigationScreenOption = T | (( - navigation: NavigationScreenProp, - config: T -) => T); + navigation: NavigationScreenProp, + config: T + ) => T); export interface NavigationScreenDetails { options: T; @@ -169,27 +169,27 @@ export interface NavigationScreenConfigProps { export type NavigationScreenConfig = Options | ((navigationOptionsContainer: NavigationScreenConfigProps & { - navigationOptions: NavigationScreenProp, -}) => Options); + navigationOptions: NavigationScreenProp, + }) => Options); export type NavigationComponent = NavigationScreenComponent | NavigationNavigator; export type NavigationScreenComponent< - Params = NavigationParams, - Options = {}, - Props = {} - > = React.ComponentType & Props> & - { navigationOptions?: NavigationScreenConfig }; + Params = NavigationParams, + Options = {}, + Props = {} +> = React.ComponentType & Props> & +{ navigationOptions?: NavigationScreenConfig }; export type NavigationNavigator< - State = NavigationState, - Options = {}, - Props = {} - > = React.ComponentType & Props> & { - router: NavigationRouter, - navigationOptions?: NavigationScreenConfig, + State = NavigationState, + Options = {}, + Props = {} +> = React.ComponentType & Props> & { + router: NavigationRouter, + navigationOptions?: NavigationScreenConfig, }; export interface NavigationParams { @@ -333,9 +333,9 @@ export type NavigationRouteConfig = NavigationComponent | ({ } & NavigationScreenRouteConfig); export type NavigationScreenRouteConfig = NavigationComponent | { - screen: NavigationComponent, + screen: NavigationComponent, } | { - getScreen: () => NavigationComponent, + getScreen: () => NavigationComponent, }; export interface NavigationPathsConfig { @@ -352,22 +352,22 @@ export interface NavigationTabRouterConfig { backBehavior?: 'none' | 'initialRoute'; // defaults `initialRoute` } export interface TabScene { - route: NavigationRoute; - focused: boolean; - index: number; - tintColor?: string; + route: NavigationRoute; + focused: boolean; + index: number; + tintColor?: string; } export interface NavigationTabScreenOptions extends NavigationScreenOptions { tabBarIcon?: React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< - any + any > | null)); tabBarLabel?: string | React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< - any + any > | string | null)); tabBarVisible?: boolean; tabBarTestIDProps?: { testID?: string, accessibilityLabel?: string }; @@ -381,13 +381,13 @@ export interface NavigationDrawerScreenOptions extends NavigationScreenOptions { drawerIcon?: React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< - any + any > | null)); drawerLabel?: string | React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< - any + any > | null)); } @@ -403,11 +403,11 @@ export interface NavigationProp { } export type EventType = - | 'willFocus' - | 'didFocus' - | 'willBlur' - | 'didBlur' - | 'action'; +| 'willFocus' +| 'didFocus' +| 'willBlur' +| 'didBlur' +| 'action'; export interface NavigationEventPayload { type: EventType; @@ -566,9 +566,9 @@ export interface LayoutEvent { } export type NavigatorType = - | 'react-navigation/STACK' - | 'react-navigation/TABS' - | 'react-navigation/DRAWER'; +| 'react-navigation/STACK' +| 'react-navigation/TABS' +| 'react-navigation/DRAWER'; export function addNavigationHelpers( navigation: { @@ -593,7 +593,7 @@ export interface NavigationContainerProps { export interface NavigationContainer extends React.ComponentClass< NavigationContainerProps & NavigationNavigatorProps - > { +> { router: NavigationRouter; screenProps: { [key: string]: any }; navigationOptions: any; @@ -658,7 +658,7 @@ export function DrawerNavigator( * Tab Navigator */ - // From views/TabView/TabView.js +// From views/TabView/TabView.js export interface TabViewConfig { tabBarComponent?: React.ReactType; tabBarPosition?: 'top' | 'bottom'; @@ -807,7 +807,7 @@ export interface TransitionerState { export class Transitioner extends React.Component< TransitionerProps, TransitionerState - > { } +> { } /** * Tab Router From 8444f10ce33c5f982349a2a4dbfa425d251e10d2 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Fri, 30 Mar 2018 17:36:01 +0900 Subject: [PATCH 0345/2153] export as namespace jsyaml --- types/js-yaml/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/js-yaml/index.d.ts b/types/js-yaml/index.d.ts index 5cd852ab3f..da2d2a36c8 100644 --- a/types/js-yaml/index.d.ts +++ b/types/js-yaml/index.d.ts @@ -4,6 +4,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 +export as namespace jsyaml; + export type DocumentLoadResult = object | undefined; export function safeLoad(str: string, opts?: LoadOptions): DocumentLoadResult; From 9b625f89758eedb929d149d4b3b626d37b65d5f9 Mon Sep 17 00:00:00 2001 From: JeyongOh Date: Fri, 30 Mar 2018 19:16:54 +0900 Subject: [PATCH 0346/2153] Change 'promiseTypeSeparator' to 'promiseTypeDelimiter' --- types/redux-promise-middleware/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/redux-promise-middleware/index.d.ts b/types/redux-promise-middleware/index.d.ts index 1317f65ae2..70eea32baa 100644 --- a/types/redux-promise-middleware/index.d.ts +++ b/types/redux-promise-middleware/index.d.ts @@ -5,4 +5,4 @@ import { Middleware } from 'redux'; -export default function promiseMiddleware(config?: { promiseTypeSuffixes?: string[], promiseTypeSeparator?: string }): Middleware; +export default function promiseMiddleware(config?: { promiseTypeSuffixes?: string[], promiseTypeDelimiter?: string }): Middleware; From 5c53d6ce4e7b32f0a524826904f11bdfee52832b Mon Sep 17 00:00:00 2001 From: Egor Shulga Date: Fri, 30 Mar 2018 16:15:53 +0300 Subject: [PATCH 0347/2153] Remove rrule package --- notNeededPackages.json | 6 ++ types/rrule/index.d.ts | 185 ----------------------------------- types/rrule/test/commonJs.ts | 2 - types/rrule/test/global.ts | 1 - types/rrule/test/rrule.ts | 62 ------------ types/rrule/tsconfig.json | 25 ----- types/rrule/tslint.json | 9 -- 7 files changed, 6 insertions(+), 284 deletions(-) delete mode 100644 types/rrule/index.d.ts delete mode 100644 types/rrule/test/commonJs.ts delete mode 100644 types/rrule/test/global.ts delete mode 100644 types/rrule/test/rrule.ts delete mode 100644 types/rrule/tsconfig.json delete mode 100644 types/rrule/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 5c649d2368..cbfcc651a1 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1272,6 +1272,12 @@ "sourceRepoURL": "https://github.com/router5/router5", "asOfVersion": "5.0.0" }, + { + "libraryName": "rrule", + "typingsPackageName": "rrule", + "sourceRepoURL": "https://github.com/jakubroztocil/rrule", + "asOfVersion": "2.2.9" + }, { "libraryName": "rvo2", "typingsPackageName": "rvo2", diff --git a/types/rrule/index.d.ts b/types/rrule/index.d.ts deleted file mode 100644 index f13aefb9c9..0000000000 --- a/types/rrule/index.d.ts +++ /dev/null @@ -1,185 +0,0 @@ -// Type definitions for rrule 2.1 -// Project: https://github.com/jkbrzt/rrule -// Definitions by: James Bracy -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export as namespace RRule; - -/** - * Use `import rrule = require("rrule")` for AMD and `import { RRule } from "rrule"` for CommonJS loading. - */ -export = RRule; - -// For CommonJS it must be imported as `require("rrule").RRule`. -import RRuleAlias = RRule; -declare module "rrule" { - type RRule = RRuleAlias; - const RRule: typeof RRuleAlias; -} - -declare namespace RRule { - /** - * see - * The only required option is `freq`, one of RRule.YEARLY, RRule.MONTHLY, ... - */ - interface Options { - freq: RRule.Frequency; - dtstart?: Date; - interval?: number; - wkst?: number | Weekday; - count?: number; - until?: Date; - bysetpos?: number | number[]; - bymonth?: number | number[]; - bymonthday?: number | number[]; - byyearday?: number | number[]; - byweekno?: number | number[]; - byweekday?: Weekday | Weekday[] | number | number[]; - byhour?: number | number[]; - byminute?: number | number[]; - bysecond?: number | number[]; - } - - class Weekday { - constructor(weekday: number, n: number); - - nth(n: number): Weekday; - - equals(other: Weekday): boolean; - - toString(): string; - - getJsWeekday(): number; - } -} - -declare class RRule { - /** - * @param options - see - * The only required option is `freq`, one of RRule.YEARLY, RRule.MONTHLY, ... - */ - constructor(options: RRule.Options, noCache?: boolean); - - options: RRule.Options; - - origOptions: RRule.Options; - - /** - * Returns the first recurrence after the given datetime instance. - * The inc keyword defines what happens if dt is an occurrence. - * With inc == True, if dt itself is an occurrence, it will be returned. - * @return Date or null - */ - after(dt: Date, inc?: boolean): Date; - - /** - * @param iterator - optional function that will be called - * on each date that is added. It can return false - * to stop the iteration. - * @return Array containing all recurrences. - */ - all(iterator?: (date: Date, index?: number) => void): Date[]; - - /** - * Returns all the occurrences of the rrule between after and before. - * The inc keyword defines what happens if after and/or before are - * themselves occurrences. With inc == True, they will be included in the - * list, if they are found in the recurrence set. - * @return Array - */ - between(a: Date, b: Date, inc?: boolean, iterator?: (date: Date, index: number) => void): Date[]; - - /** - * Returns the last recurrence before the given datetime instance. - * The inc keyword defines what happens if dt is an occurrence. - * With inc == True, if dt itself is an occurrence, it will be returned. - * @return Date or null - */ - before(dt: Date, inc?: boolean): Date; - - /** - * Returns the number of recurrences in this set. It will have go trough - * the whole recurrence, if this hasn't been done before. - */ - count(): number; - - /** - * Converts the rrule into its string representation - * @see - * @return String - */ - toString(): string; - - /** - * Will convert all rules described in nlp:ToText - * to text. - */ - toText(gettext?: (str: string) => string, language?: any): string; - - isFullyConvertibleToText(): boolean; - - clone(): RRule; -} - -declare namespace RRule { - const FREQUENCIES: "YEARLY" | "MONTHLY" | "WEEKLY" | "DAILY" | "HOURLY" | "MINUTELY" | "SECONDLY"; - - enum Frequency { - YEARLY = 0, - MONTHLY = 1, - WEEKLY = 2, - DAILY = 3, - HOURLY = 4, - MINUTELY = 5, - SECONDLY = 6 - } - - const YEARLY: Frequency; - const MONTHLY: Frequency; - const WEEKLY: Frequency; - const DAILY: Frequency; - const HOURLY: Frequency; - const MINUTELY: Frequency; - const SECONDLY: Frequency; - - const MO: Weekday; - const TU: Weekday; - const WE: Weekday; - const TH: Weekday; - const FR: Weekday; - const SA: Weekday; - const SU: Weekday; - - const DEFAULT_OPTIONS: RRule.Options; - - function parseText(text: string, language?: any): RRule.Options; - - function fromText(text: string, language?: any): RRule; - - function optionsToString(options: RRule.Options): string; - - function parseString(rfcString: string): RRule.Options; - - function fromString(value: string): RRule; - - class RRuleSet extends RRule { - /** - * @param noCache The same stratagy as RRule on cache, default to false - */ - constructor(noCache?: boolean); - rrule(rrule: RRule): void; - rdate(date: Date): void; - exrule(rrule: RRule): void; - exdate(date: Date): void; - valueOf(): string[]; - /** - * to generate recurrence field sush as: - * ["RRULE:FREQ=YEARLY;COUNT=2;BYDAY=TU;DTSTART=19970902T010000Z","RRULE:FREQ=YEARLY;COUNT=1;BYDAY=TH;DTSTART=19970902T010000Z"] - */ - toString(): string; - /** - * Create a new RRuleSet Object completely base on current instance - */ - clone(): RRuleSet; - } -} diff --git a/types/rrule/test/commonJs.ts b/types/rrule/test/commonJs.ts deleted file mode 100644 index f193febe91..0000000000 --- a/types/rrule/test/commonJs.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { RRule } from "rrule"; -const rule: RRule = new RRule({ freq: RRule.WEEKLY }); diff --git a/types/rrule/test/global.ts b/types/rrule/test/global.ts deleted file mode 100644 index 869d407e98..0000000000 --- a/types/rrule/test/global.ts +++ /dev/null @@ -1 +0,0 @@ -let rule: RRule = new RRule({ freq: RRule.WEEKLY }); diff --git a/types/rrule/test/rrule.ts b/types/rrule/test/rrule.ts deleted file mode 100644 index c455fa40d1..0000000000 --- a/types/rrule/test/rrule.ts +++ /dev/null @@ -1,62 +0,0 @@ -import RRule = require('rrule'); - -// Create a rule: -let rule: RRule = new RRule({ - freq: RRule.WEEKLY, - interval: 5, - byweekday: [RRule.MO, RRule.FR], - dtstart: new Date(2012, 1, 1, 10, 30), - until: new Date(2012, 12, 31) -}); - -let x: Date[]; -const y: string[] = []; - -// Get all occurrence dates (Date instances): -x = rule.all(); - -// Get a slice: -x = rule.between(new Date(2012, 7, 1), new Date(2012, 8, 1)); - -// Get an iCalendar RRULE string representation: -// The output can be used with RRule.fromString(). -y.push(rule.toString()); - -// Get a human-friendly text representation: -// The output can be used with RRule.fromText(). -y.push(rule.toText()); - -// Get full a string representation of all options, -// including the default and inferred ones. -y.push(RRule.optionsToString(rule.options)); - -// Cherry-pick only some options from an rrule: -y.push(RRule.optionsToString({ - freq: rule.options.freq, - dtstart: rule.options.dtstart, -})); - -rule = RRule.fromString("FREQ=WEEKLY;DTSTART=20120201T093000Z"); - -// This is equivalent -rule = new RRule(RRule.parseString("FREQ=WEEKLY;DTSTART=20120201T093000Z")); - -let options = RRule.parseString('FREQ=DAILY;INTERVAL=6'); -options.dtstart = new Date(2000, 1, 1); -rule = new RRule(options); - -rule = new RRule({ - freq: RRule.WEEKLY, - count: 23 -}); -y.push(rule.toText()); - -rule = RRule.fromText('every day for 3 times'); - -options = RRule.parseText('every day for 3 times'); -// {freq: 3, count: "3"} -options.dtstart = new Date(2000, 1, 1); -rule = new RRule(options); - -// Test arrays -const multipleInstance = new RRule({freq: 3, byhour: [6, 12, 18]}); diff --git a/types/rrule/tsconfig.json b/types/rrule/tsconfig.json deleted file mode 100644 index 3e64a1d17a..0000000000 --- a/types/rrule/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "test/rrule.ts", - "test/commonJs.ts", - "test/global.ts" - ] -} \ No newline at end of file diff --git a/types/rrule/tslint.json b/types/rrule/tslint.json deleted file mode 100644 index 96de5e929b..0000000000 --- a/types/rrule/tslint.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - // TODOs - "no-declare-current-package": false, - "no-mergeable-namespace": false, - "no-unnecessary-qualifier": false - } -} From d10703cbcad006706a75d8f26c0a4dcca7241e22 Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Fri, 30 Mar 2018 09:41:29 -0400 Subject: [PATCH 0348/2153] Add dom lib to tsconfig Some examples are using `document` --- types/plupload/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/plupload/tsconfig.json b/types/plupload/tsconfig.json index fc46738339..d7dc70a3bd 100644 --- a/types/plupload/tsconfig.json +++ b/types/plupload/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, From fe9fd3e5ec1f018b0b24c250bd0fef1b7bfcd695 Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Fri, 30 Mar 2018 09:42:43 -0400 Subject: [PATCH 0349/2153] Disable "noImplicitAny" on plupload tests Defining the uploader constructor: static Uploader(settings: plupload_settings): void; makes it always return an "any" type. Unless this is expanded out, you can't use the noImplicitAny option. --- types/plupload/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/plupload/tsconfig.json b/types/plupload/tsconfig.json index d7dc70a3bd..ae69b36956 100644 --- a/types/plupload/tsconfig.json +++ b/types/plupload/tsconfig.json @@ -5,7 +5,7 @@ "es6", "dom" ], - "noImplicitAny": true, + "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, "strictFunctionTypes": true, From 0296b85f4d4f8c23b3f2fa23d91af74be9f0d47a Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Fri, 30 Mar 2018 09:43:26 -0400 Subject: [PATCH 0350/2153] Adding test case from plupload README --- types/plupload/plupload-tests.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/types/plupload/plupload-tests.ts b/types/plupload/plupload-tests.ts index e69de29bb2..54f8b27a70 100644 --- a/types/plupload/plupload-tests.ts +++ b/types/plupload/plupload-tests.ts @@ -0,0 +1,26 @@ +import 'plupload'; + +{ + const uploader = new plupload.Uploader({ + browse_button: 'browse', // this can be an id of a DOM element or the DOM element itself + url: 'upload.php' + }); + + uploader.init(); + uploader.start(); + + + uploader.bind('FilesAdded', function (up: any, files: any) { + var html = ''; + plupload.each(files, function (file: any) { + html += '
  • ' + file.name + ' (' + plupload.formatSize(file.size) + ')
  • '; + }); + document.getElementById('filelist').innerHTML += html; + }); + + uploader.bind('Error', function (up: any, err: any) { + document.getElementById('console').innerHTML += "\nError #" + err.code + ": " + err.message; + }); + +} + From 83256df922861d309f0b25644397dd5af427c14f Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Fri, 30 Mar 2018 09:44:17 -0400 Subject: [PATCH 0351/2153] Add settings test --- types/plupload/plupload-tests.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/types/plupload/plupload-tests.ts b/types/plupload/plupload-tests.ts index 54f8b27a70..b03cc458ff 100644 --- a/types/plupload/plupload-tests.ts +++ b/types/plupload/plupload-tests.ts @@ -24,3 +24,26 @@ import 'plupload'; } +{ + const settings: plupload_settings = { + runtimes: 'html5', + browse_button: '#button', + container: '#container', + chunk_size: '1mb', + url: 'https://fakesite.com/upload', + flash_swf_url: './plupload.flash.swf', + silverlight_xap_url: '/Scripts/plupload/js/plupload.silverlight.xap', + filters: + { + max_file_size: '50mb', + mime_types: [{ title: 'title', extensions: '*' }] + }, + init: { + Error: function (up, args) { + } + } + }; + + const uploader = new plupload.Uploader(settings); + uploader.init(); +} From 3c89c85cdf0c54daeca57784e47b28e7de3123af Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Fri, 30 Mar 2018 09:44:45 -0400 Subject: [PATCH 0352/2153] Add typings for plupload static utility methods --- types/plupload/index.d.ts | 269 +++++++++++++++++++++++++++++++++++++- 1 file changed, 264 insertions(+), 5 deletions(-) diff --git a/types/plupload/index.d.ts b/types/plupload/index.d.ts index 614ba27261..a70423533d 100644 --- a/types/plupload/index.d.ts +++ b/types/plupload/index.d.ts @@ -18,7 +18,7 @@ interface plupload_settings { multipart_params?: any; /** Chunk */ - chunk_size?: number|string; + chunk_size?: number | string; /** Client-Side Image Resize */ resize?: plupload_resize; @@ -28,7 +28,7 @@ interface plupload_settings { /** Useful Options */ multi_selection?: boolean; - required_features?: string|any; + required_features?: string | any; unique_names?: boolean; /** Optional */ @@ -44,7 +44,7 @@ interface plupload_settings { interface plupload_filters { mime_types?: plupload_filters_mime_types[]; - max_file_size?: number|string; + max_file_size?: number | string; prevent_duplicates?: boolean; } @@ -138,7 +138,7 @@ interface plupload_error extends plupload_response { } declare class plupload { - static Uploader(settings: plupload_settings):void; + static Uploader(settings: plupload_settings): void; static VERSION: string; @@ -178,7 +178,7 @@ declare class plupload { /** Methods */ init(): any; - setOption(option: string|any, value?: any): any; + setOption(option: string | any, value?: any): any; getOption(option?: string): any; refresh(): any; start(): any; @@ -194,4 +194,263 @@ declare class plupload { unbind(name: string, func: any): any; unbindAll(): any; destroy(): any; + + /** Utility methods **/ + + /** + * Executes the callback function for each item in array/object. If you return false in the + * callback it will break the loop. + * + * @method each + * @static + * @param {Object} obj Object to iterate. + * @param {function} callback Callback function to execute for each item. + */ + static each(obj: Object, callback: Function): void; + + /** + * Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields. + * + * @method getPos + * @static + * @param {Element} node HTML element or element id to get x, y position from. + * @param {Element} root Optional root element to stop calculations at. + * @return {object} Absolute position of the specified element object with x, y fields. + */ + static getPos(node: Element, root: Element): Object; + + /** + * Returns the size of the specified node in pixels. + * + * @method getSize + * @static + * @param {Node} node Node to get the size of. + * @return {Object} Object with a w and h property. + */ + static getSize(node: Node): Object; + + /** + * Encodes the specified string. + * + * @method xmlEncode + * @static + * @param {String} s String to encode. + * @return {String} Encoded string. + */ + static xmlEncode(str: string): string; + + /** + * Forces anything into an array. + * + * @method toArray + * @static + * @param {Object} obj Object with length field. + * @return {Array} Array object containing all items. + */ + static toArray(obj: Object): Array; + + /** + * Find an element in array and return its index if present, otherwise return -1. + * + * @method inArray + * @static + * @param {mixed} needle Element to find + * @param {Array} array + * @return {Int} Index of the element, or -1 if not found + */ + static inArray(needle: any, array: Array): number; + + /** + Recieve an array of functions (usually async) to call in sequence, each function + receives a callback as first argument that it should call, when it completes. Finally, + after everything is complete, main callback is called. Passing truthy value to the + callback as a first argument will interrupt the sequence and invoke main callback + immediately. + @method inSeries + @static + @param {Array} queue Array of functions to call in sequence + @param {Function} cb Main callback that is called in the end, or in case of error + */ + static inSeries(queue: Array, callback: Function): void; + + /** + * Extends the language pack object with new items. + * + * @method addI18n + * @static + * @param {Object} pack Language pack items to add. + * @return {Object} Extended language pack object. + */ + static addI18n(pack: Object): Object; + + /** + * Translates the specified string by checking for the english string in the language pack lookup. + * + * @method translate + * @static + * @param {String} str String to look for. + * @return {String} Translated string or the input string if it wasn't found. + */ + static translate(str: string): string; + + /** + * Pseudo sprintf implementation - simple way to replace tokens with specified values. + * + * @param {String} str String with tokens + * @return {String} String with replaced tokens + */ + static sprintf(str: string): string; + + /** + * Checks if object is empty. + * + * @method isEmptyObj + * @static + * @param {Object} obj Object to check. + * @return {Boolean} + */ + static isEmptyObj(obj: Object): boolean; + + /** + * Checks if specified DOM element has specified class. + * + * @method hasClass + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Class name + */ + static hasClass(obj: Object, name: string): any; + + /** + * Adds specified className to specified DOM element. + * + * @method addClass + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Class name + */ + static addClass(obj: Object, name: string): any; + + /** + * Removes specified className from specified DOM element. + * + * @method removeClass + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Class name + */ + static removeClass(obj: Object, name: string): any; + + /** + * Returns a given computed style of a DOM element. + * + * @method getStyle + * @static + * @param {Object} obj DOM element like object. + * @param {String} name Style you want to get from the DOM element + */ + static getStyle(obj: Object, name: string): any; + + /** + * Adds an event handler to the specified object and store reference to the handler + * in objects internal Plupload registry (@see removeEvent). + * + * @method addEvent + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Name to add event listener to. + * @param {Function} callback Function to call when event occurs. + * @param {String} (optional) key that might be used to add specifity to the event record. + */ + static addEvent(obj: Object, name: string, callback: Function, key?: string); + + /** + * Remove event handler from the specified object. If third argument (callback) + * is not specified remove all events with the specified name. + * + * @method removeEvent + * @static + * @param {Object} obj DOM element to remove event listener(s) from. + * @param {String} name Name of event listener to remove. + * @param {Function|String} (optional) might be a callback or unique key to match. + */ + static removeEvent(obj: Object, name: string, optional?: Function | string); + + /** + * Remove all kind of events from the specified object + * + * @method removeAllEvents + * @static + * @param {Object} obj DOM element to remove event listeners from. + * @param {String} (optional) unique key to match, when removing events. + */ + static removeAllEvents(obj: Object, key?: string); + + /** + * Cleans the specified name from national characters (diacritics). The result will be a name with only a-z, 0-9 and _. + * + * @method cleanName + * @static + * @param {String} s String to clean up. + * @return {String} Cleaned string. + */ + static cleanName(name: string): string; + + /** + * Builds a full url out of a base URL and an object with items to append as query string items. + * + * @method buildUrl + * @static + * @param {String} url Base URL to append query string items to. + * @param {Object} items Name/value object to serialize as a querystring. + * @return {String} String with url + serialized query string items. + */ + static buildUrl(url, items): string; + + /** + * Formats the specified number as a size string for example 1024 becomes 1 KB. + * + * @method formatSize + * @static + * @param {Number} size Size to format as string. + * @return {String} Formatted size string. + */ + static formatSize(size: number): string; + + /** + * Parses the specified size string into a byte value. For example 10kb becomes 10240. + * + * @method parseSize + * @static + * @param {String|Number} size String to parse or number to just pass through. + * @return {Number} Size in bytes. + */ + static parseSize(size: number | string): number; + + + /** + * A way to predict what runtime will be choosen in the current environment with the + * specified settings. + * + * @method predictRuntime + * @static + * @param {Object|String} config Plupload settings to check + * @param {String} [runtimes] Comma-separated list of runtimes to check against + * @return {String} Type of compatible runtime + */ + static predictRuntime(config: Object | string, runtimes: string): string; + + /** + * Registers a filter that will be executed for each file added to the queue. + * If callback returns false, file will not be added. + * + * Callback receives two arguments: a value for the filter as it was specified in settings.filters + * and a file to be filtered. Callback is executed in the context of uploader instance. + * + * @method addFileFilter + * @static + * @param {String} name Name of the filter by which it can be referenced in settings.filters + * @param {String} cb Callback - the actual routine that every added file must pass + */ + static addFileFilter(name: string, cb: Function): void; } From 23e98c3d656f73d5b7b4f7ef6b3714d685c56a72 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 30 Mar 2018 07:29:20 -0700 Subject: [PATCH 0353/2153] socket.io: Expose as a global for backwards-compatibility (#24619) --- types/socket.io/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/socket.io/index.d.ts b/types/socket.io/index.d.ts index 1583eac66b..d63effe544 100644 --- a/types/socket.io/index.d.ts +++ b/types/socket.io/index.d.ts @@ -7,6 +7,8 @@ declare const SocketIO: SocketIOStatic; export = SocketIO; +/** @deprecated Available as a global for backwards-compatibility. */ +export as namespace SocketIO; interface SocketIOStatic { /** From 02230c95f483d325487efc428fdc4c6d6af1da58 Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Fri, 30 Mar 2018 10:32:18 -0400 Subject: [PATCH 0354/2153] Update "Object" type to "object" Follow guidelines based on "Common Mistakes" documentation --- types/plupload/index.d.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/types/plupload/index.d.ts b/types/plupload/index.d.ts index a70423533d..162898b928 100644 --- a/types/plupload/index.d.ts +++ b/types/plupload/index.d.ts @@ -206,7 +206,7 @@ declare class plupload { * @param {Object} obj Object to iterate. * @param {function} callback Callback function to execute for each item. */ - static each(obj: Object, callback: Function): void; + static each(obj: object, callback: Function): void; /** * Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields. @@ -217,7 +217,7 @@ declare class plupload { * @param {Element} root Optional root element to stop calculations at. * @return {object} Absolute position of the specified element object with x, y fields. */ - static getPos(node: Element, root: Element): Object; + static getPos(node: Element, root: Element): object; /** * Returns the size of the specified node in pixels. @@ -227,7 +227,7 @@ declare class plupload { * @param {Node} node Node to get the size of. * @return {Object} Object with a w and h property. */ - static getSize(node: Node): Object; + static getSize(node: Node): object; /** * Encodes the specified string. @@ -247,7 +247,7 @@ declare class plupload { * @param {Object} obj Object with length field. * @return {Array} Array object containing all items. */ - static toArray(obj: Object): Array; + static toArray(obj: object): Array; /** * Find an element in array and return its index if present, otherwise return -1. @@ -281,7 +281,7 @@ declare class plupload { * @param {Object} pack Language pack items to add. * @return {Object} Extended language pack object. */ - static addI18n(pack: Object): Object; + static addI18n(pack: object): object; /** * Translates the specified string by checking for the english string in the language pack lookup. @@ -309,7 +309,7 @@ declare class plupload { * @param {Object} obj Object to check. * @return {Boolean} */ - static isEmptyObj(obj: Object): boolean; + static isEmptyObj(obj: object): boolean; /** * Checks if specified DOM element has specified class. @@ -319,7 +319,7 @@ declare class plupload { * @param {Object} obj DOM element like object to add handler to. * @param {String} name Class name */ - static hasClass(obj: Object, name: string): any; + static hasClass(obj: object, name: string): any; /** * Adds specified className to specified DOM element. @@ -329,7 +329,7 @@ declare class plupload { * @param {Object} obj DOM element like object to add handler to. * @param {String} name Class name */ - static addClass(obj: Object, name: string): any; + static addClass(obj: object, name: string): any; /** * Removes specified className from specified DOM element. @@ -339,7 +339,7 @@ declare class plupload { * @param {Object} obj DOM element like object to add handler to. * @param {String} name Class name */ - static removeClass(obj: Object, name: string): any; + static removeClass(obj: object, name: string): any; /** * Returns a given computed style of a DOM element. @@ -349,7 +349,7 @@ declare class plupload { * @param {Object} obj DOM element like object. * @param {String} name Style you want to get from the DOM element */ - static getStyle(obj: Object, name: string): any; + static getStyle(obj: object, name: string): any; /** * Adds an event handler to the specified object and store reference to the handler @@ -362,7 +362,7 @@ declare class plupload { * @param {Function} callback Function to call when event occurs. * @param {String} (optional) key that might be used to add specifity to the event record. */ - static addEvent(obj: Object, name: string, callback: Function, key?: string); + static addEvent(obj: object, name: string, callback: Function, key?: string); /** * Remove event handler from the specified object. If third argument (callback) @@ -374,7 +374,7 @@ declare class plupload { * @param {String} name Name of event listener to remove. * @param {Function|String} (optional) might be a callback or unique key to match. */ - static removeEvent(obj: Object, name: string, optional?: Function | string); + static removeEvent(obj: object, name: string, optional?: Function | string); /** * Remove all kind of events from the specified object @@ -384,7 +384,7 @@ declare class plupload { * @param {Object} obj DOM element to remove event listeners from. * @param {String} (optional) unique key to match, when removing events. */ - static removeAllEvents(obj: Object, key?: string); + static removeAllEvents(obj: object, key?: string); /** * Cleans the specified name from national characters (diacritics). The result will be a name with only a-z, 0-9 and _. @@ -438,7 +438,7 @@ declare class plupload { * @param {String} [runtimes] Comma-separated list of runtimes to check against * @return {String} Type of compatible runtime */ - static predictRuntime(config: Object | string, runtimes: string): string; + static predictRuntime(config: object | string, runtimes: string): string; /** * Registers a filter that will be executed for each file added to the queue. From fa874deb3d439bfef5a105a41a2e9172c439b584 Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Fri, 30 Mar 2018 10:39:34 -0400 Subject: [PATCH 0355/2153] Change "object" type to "any" For backward compatibility with less than 2.2 TS. --- types/plupload/index.d.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/types/plupload/index.d.ts b/types/plupload/index.d.ts index 162898b928..aef17313f8 100644 --- a/types/plupload/index.d.ts +++ b/types/plupload/index.d.ts @@ -217,7 +217,7 @@ declare class plupload { * @param {Element} root Optional root element to stop calculations at. * @return {object} Absolute position of the specified element object with x, y fields. */ - static getPos(node: Element, root: Element): object; + static getPos(node: Element, root: Element): any; /** * Returns the size of the specified node in pixels. @@ -227,7 +227,7 @@ declare class plupload { * @param {Node} node Node to get the size of. * @return {Object} Object with a w and h property. */ - static getSize(node: Node): object; + static getSize(node: Node): any; /** * Encodes the specified string. @@ -247,7 +247,7 @@ declare class plupload { * @param {Object} obj Object with length field. * @return {Array} Array object containing all items. */ - static toArray(obj: object): Array; + static toArray(obj: any): Array; /** * Find an element in array and return its index if present, otherwise return -1. @@ -281,7 +281,7 @@ declare class plupload { * @param {Object} pack Language pack items to add. * @return {Object} Extended language pack object. */ - static addI18n(pack: object): object; + static addI18n(pack: any): any; /** * Translates the specified string by checking for the english string in the language pack lookup. @@ -309,7 +309,7 @@ declare class plupload { * @param {Object} obj Object to check. * @return {Boolean} */ - static isEmptyObj(obj: object): boolean; + static isEmptyObj(obj: any): boolean; /** * Checks if specified DOM element has specified class. @@ -319,7 +319,7 @@ declare class plupload { * @param {Object} obj DOM element like object to add handler to. * @param {String} name Class name */ - static hasClass(obj: object, name: string): any; + static hasClass(obj: any, name: string): any; /** * Adds specified className to specified DOM element. @@ -329,7 +329,7 @@ declare class plupload { * @param {Object} obj DOM element like object to add handler to. * @param {String} name Class name */ - static addClass(obj: object, name: string): any; + static addClass(obj: any, name: string): any; /** * Removes specified className from specified DOM element. @@ -339,7 +339,7 @@ declare class plupload { * @param {Object} obj DOM element like object to add handler to. * @param {String} name Class name */ - static removeClass(obj: object, name: string): any; + static removeClass(obj: any, name: string): any; /** * Returns a given computed style of a DOM element. @@ -349,7 +349,7 @@ declare class plupload { * @param {Object} obj DOM element like object. * @param {String} name Style you want to get from the DOM element */ - static getStyle(obj: object, name: string): any; + static getStyle(obj: any, name: string): any; /** * Adds an event handler to the specified object and store reference to the handler @@ -362,7 +362,7 @@ declare class plupload { * @param {Function} callback Function to call when event occurs. * @param {String} (optional) key that might be used to add specifity to the event record. */ - static addEvent(obj: object, name: string, callback: Function, key?: string); + static addEvent(obj: any, name: string, callback: Function, key?: string); /** * Remove event handler from the specified object. If third argument (callback) @@ -374,7 +374,7 @@ declare class plupload { * @param {String} name Name of event listener to remove. * @param {Function|String} (optional) might be a callback or unique key to match. */ - static removeEvent(obj: object, name: string, optional?: Function | string); + static removeEvent(obj: any, name: string, optional?: Function | string); /** * Remove all kind of events from the specified object @@ -384,7 +384,7 @@ declare class plupload { * @param {Object} obj DOM element to remove event listeners from. * @param {String} (optional) unique key to match, when removing events. */ - static removeAllEvents(obj: object, key?: string); + static removeAllEvents(obj: any, key?: string); /** * Cleans the specified name from national characters (diacritics). The result will be a name with only a-z, 0-9 and _. @@ -438,7 +438,7 @@ declare class plupload { * @param {String} [runtimes] Comma-separated list of runtimes to check against * @return {String} Type of compatible runtime */ - static predictRuntime(config: object | string, runtimes: string): string; + static predictRuntime(config: any, runtimes: string): string; /** * Registers a filter that will be executed for each file added to the queue. From 6ee9b39f1f85ebfad93d62a47354e84232fc6497 Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Fri, 30 Mar 2018 10:43:07 -0400 Subject: [PATCH 0356/2153] Fix a missing "object" to "any" --- types/plupload/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/plupload/index.d.ts b/types/plupload/index.d.ts index aef17313f8..00dd6c7d0b 100644 --- a/types/plupload/index.d.ts +++ b/types/plupload/index.d.ts @@ -206,7 +206,7 @@ declare class plupload { * @param {Object} obj Object to iterate. * @param {function} callback Callback function to execute for each item. */ - static each(obj: object, callback: Function): void; + static each(obj: any, callback: Function): void; /** * Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields. From 1ed52bceabec52ee4ebcf6fed9bf2e6a1bb1f4c3 Mon Sep 17 00:00:00 2001 From: Andrew Goodale Date: Fri, 30 Mar 2018 11:10:33 -0400 Subject: [PATCH 0357/2153] Fix declaration of `onMoveShouldSetResponderCapture` --- types/react-native/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 2a08edcdb1..b881476782 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -1526,7 +1526,7 @@ export interface GestureResponderHandlers { * So if a parent View wants to prevent the child from becoming responder on a touch start, * it should have a onStartShouldSetResponderCapture handler which returns true. */ - onMoveShouldSetResponderCapture?: () => void; + onMoveShouldSetResponderCapture?: (event: GestureResponderEvent) => boolean; } // @see https://facebook.github.io/react-native/docs/view.html#style From 0801530e9dfe4a7a130aa60dadb31dd6bbc7eedb Mon Sep 17 00:00:00 2001 From: "andy.patterson" Date: Fri, 30 Mar 2018 13:15:05 -0400 Subject: [PATCH 0358/2153] [@types/mathjs] fill out BigNumber and Fraction interfaces --- types/mathjs/index.d.ts | 19 ++++++++++--------- types/mathjs/package.json | 6 ++++++ 2 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 types/mathjs/package.json diff --git a/types/mathjs/index.d.ts b/types/mathjs/index.d.ts index ad3dec6d75..751f602a2a 100644 --- a/types/mathjs/index.d.ts +++ b/types/mathjs/index.d.ts @@ -1,9 +1,12 @@ +import { Decimal } from 'decimal.js'; // Type definitions for mathjs // Project: http://mathjs.org/ // Definitions by: Ilya Shestakov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare var math: mathjs.IMathJsStatic; +export as namespace math; +export = math; declare namespace mathjs { @@ -304,7 +307,7 @@ declare namespace mathjs { * @param x The base * @param y The exponent */ - pow(x: number|BigNumber|Complex|MathArray|Matrix, y: number|BigNumber|Complex): number|BigNumber|Complex|MathArray|Matrix; + pow(x: MathType, y: number|BigNumber|Complex): MathType; /** * Round a value towards the nearest integer. For matrices, the function is evaluated element wise. @@ -1333,12 +1336,14 @@ declare namespace mathjs { swapRows(i: number, j: number): Matrix; } - export interface BigNumber { + export interface BigNumber extends Decimal { } export interface Fraction { - + s: number; + n: number; + d: number; } export interface Complex { @@ -1349,9 +1354,9 @@ declare namespace mathjs { } export interface IPolarCoordinates { - r: number; + r: number; phi: number; - } + } export interface Unit { to(unit: string): Unit; @@ -2309,7 +2314,3 @@ declare namespace mathjs { toString(): string; } } - -declare module 'mathjs'{ - export = math; -} diff --git a/types/mathjs/package.json b/types/mathjs/package.json new file mode 100644 index 0000000000..23474e431e --- /dev/null +++ b/types/mathjs/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "decimal.js": "^10.0.0" + } +} From 30d6b3445bba07d627edc20c77eee17fb530c3ee Mon Sep 17 00:00:00 2001 From: "andy.patterson" Date: Fri, 30 Mar 2018 13:28:49 -0400 Subject: [PATCH 0359/2153] [@types/mathjs] import statement needs to come _after_ comment header --- types/mathjs/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/mathjs/index.d.ts b/types/mathjs/index.d.ts index 751f602a2a..0341d80c6b 100644 --- a/types/mathjs/index.d.ts +++ b/types/mathjs/index.d.ts @@ -1,9 +1,10 @@ -import { Decimal } from 'decimal.js'; // Type definitions for mathjs // Project: http://mathjs.org/ // Definitions by: Ilya Shestakov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +import { Decimal } from 'decimal.js'; + declare var math: mathjs.IMathJsStatic; export as namespace math; export = math; From 9c3030d32d6e9b9a5338dade566ba2217a244bb1 Mon Sep 17 00:00:00 2001 From: jewbre Date: Fri, 30 Mar 2018 19:36:32 +0200 Subject: [PATCH 0360/2153] types for named regexp group --- types/named-regexp-groups/index.d.ts | 38 +++++++++++++++++++ .../named-regexp-groups-tests.ts | 19 ++++++++++ types/named-regexp-groups/tsconfig.json | 23 +++++++++++ types/named-regexp-groups/tslint.json | 1 + 4 files changed, 81 insertions(+) create mode 100644 types/named-regexp-groups/index.d.ts create mode 100644 types/named-regexp-groups/named-regexp-groups-tests.ts create mode 100644 types/named-regexp-groups/tsconfig.json create mode 100644 types/named-regexp-groups/tslint.json diff --git a/types/named-regexp-groups/index.d.ts b/types/named-regexp-groups/index.d.ts new file mode 100644 index 0000000000..19426c352e --- /dev/null +++ b/types/named-regexp-groups/index.d.ts @@ -0,0 +1,38 @@ +// Type definitions for named-regexp-groups 1.0 +// Project: https://github.com/commenthol/named-regexp-groups/ +// Definitions by: Vilim Stubičan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +interface NamedRegExpExecArray extends RegExpExecArray { + groups: { [propName: string]: string }; +} + +declare class NamedRegExp { + constructor(pattern?: string | RegExp, flags?: string); + + /** + * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. + * @param string The String object or string literal on which to perform the search. + */ + exec(string: string): NamedRegExpExecArray | null; + + /** + * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. + * @param string String on which to perform the search. + */ + test(string: string): boolean; + + // Non-standard extensions + toString(): string; + + [Symbol.replace](str: string, replacement: string | ((match: string, ...capturedGroups: string[]) => string)): string; + + [Symbol.match](str: string): NamedRegExpExecArray; + + [Symbol.split](str: string): string[]; + + [Symbol.search](str: string): number; +} + +export = NamedRegExp; diff --git a/types/named-regexp-groups/named-regexp-groups-tests.ts b/types/named-regexp-groups/named-regexp-groups-tests.ts new file mode 100644 index 0000000000..cff4cc057e --- /dev/null +++ b/types/named-regexp-groups/named-regexp-groups-tests.ts @@ -0,0 +1,19 @@ +import NamedRegExp = require("named-regexp-groups"); + +// $ExpectType NamedRegExp +new NamedRegExp('aaa', 'gi'); + +// $ExpectType NamedRegExp +new NamedRegExp(/aaa/gi); + +// $ExpectType NamedRegExp +new NamedRegExp(); + +// $ExpectError +new NamedRegExp(1); + +// $ExpectError +new NamedRegExp({}); + +// $ExpectError +new NamedRegExp([]); diff --git a/types/named-regexp-groups/tsconfig.json b/types/named-regexp-groups/tsconfig.json new file mode 100644 index 0000000000..9ce09a5d74 --- /dev/null +++ b/types/named-regexp-groups/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "named-regexp-groups-tests.ts" + ] +} diff --git a/types/named-regexp-groups/tslint.json b/types/named-regexp-groups/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/named-regexp-groups/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 635dd53a9dba92ccc457922293321d4e114f50e6 Mon Sep 17 00:00:00 2001 From: jewbre Date: Fri, 30 Mar 2018 21:19:44 +0200 Subject: [PATCH 0361/2153] types for amp 0.3 --- types/amp/amp-tests.ts | 44 +++++++++++++++++++++++++++++++++++++++++ types/amp/index.d.ts | 19 ++++++++++++++++++ types/amp/tsconfig.json | 23 +++++++++++++++++++++ types/amp/tslint.json | 1 + 4 files changed, 87 insertions(+) create mode 100644 types/amp/amp-tests.ts create mode 100644 types/amp/index.d.ts create mode 100644 types/amp/tsconfig.json create mode 100644 types/amp/tslint.json diff --git a/types/amp/amp-tests.ts b/types/amp/amp-tests.ts new file mode 100644 index 0000000000..1e17bc8507 --- /dev/null +++ b/types/amp/amp-tests.ts @@ -0,0 +1,44 @@ +import { decode, encode, Stream } from 'amp'; + +// $ExpectType Buffer[] +decode(new Buffer('something')); + +// $ExpectType Buffer +encode([new Buffer('something'), new Buffer('something')]); + +// $ExpectError +decode(''); + +// $ExpectError +decode(1); + +// $ExpectError +decode(); + +// $ExpectError +encode(''); + +// $ExpectError +encode(1); + +// $ExpectError +encode(); + +// $ExpectType Stream +new Stream({}); + +// $ExpectType Stream +new Stream({ + highWaterMark: 1, + decodeStrings: true, + objectMode: true, + destroy: (error?: Error) => { + return 'handle error'; + }, + final: (callback: (error?: Error) => void) => { + // do nothing + } +}); + +// $ExpectError +new Stream({somethingNoneExisting: true}); diff --git a/types/amp/index.d.ts b/types/amp/index.d.ts new file mode 100644 index 0000000000..99b9fc7f45 --- /dev/null +++ b/types/amp/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for amp 0.3 +// Project: https://github.com/visionmedia/node-amp +// Definitions by: Vilim Stubičan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +import * as stream from 'stream'; + +export function decode(buf: Buffer): Buffer[]; + +export function encode(args: Buffer[]): Buffer; + +export class Stream extends stream.Writable { + constructor(opts: stream.WritableOptions); + + _write(chunk: any, encoding: string, fn: () => void): void; +} diff --git a/types/amp/tsconfig.json b/types/amp/tsconfig.json new file mode 100644 index 0000000000..4bb6a171ad --- /dev/null +++ b/types/amp/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "amp-tests.ts" + ] +} diff --git a/types/amp/tslint.json b/types/amp/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/amp/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From d26a8158cfdf94db3a6442d12c1633b2a7e20f38 Mon Sep 17 00:00:00 2001 From: Jeff Principe Date: Fri, 30 Mar 2018 11:54:40 -0700 Subject: [PATCH 0362/2153] [agenda] Support custom job.attrs.data types --- types/agenda/agenda-tests.ts | 6 ++-- types/agenda/index.d.ts | 57 ++++++++++++++++++++---------------- 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/types/agenda/agenda-tests.ts b/types/agenda/agenda-tests.ts index bbf945bd62..a7031d2ef8 100644 --- a/types/agenda/agenda-tests.ts +++ b/types/agenda/agenda-tests.ts @@ -5,8 +5,8 @@ var mongoConnectionString = "mongodb://127.0.0.1/agenda"; var agenda = new Agenda({ db: { address: mongoConnectionString } }); -agenda.define('delete old users', (job, done) => { - +agenda.define<{ foo: Error }>('delete old users', (job, done) => { + done(job.attrs.data.foo) }); agenda.on('ready', () => { @@ -62,7 +62,7 @@ agenda.schedule('tomorrow at noon', ['printAnalyticsReport', 'sendNotifications' agenda.now('do the hokey pokey'); -var job = agenda.create('printAnalyticsReport', { userCount: 100 }); +var job = agenda.create<{ userCount: number }>('printAnalyticsReport', { userCount: 100 }); job.save(function(err) { console.log("Job successfully saved"); }); diff --git a/types/agenda/index.d.ts b/types/agenda/index.d.ts index 12b0b76c38..b29158983d 100644 --- a/types/agenda/index.d.ts +++ b/types/agenda/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Agenda v1.0.0 -// Project: https://github.com/rschmukler/agenda +// Type definitions for Agenda v1.0.3 +// Project: https://github.com/agenda/agenda // Definitions by: Meir Gottlieb +// Jeff Principe // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -89,14 +90,14 @@ declare class Agenda extends EventEmitter { * @param name The name of the job. * @param data Data to associated with the job. */ - create(name: string, data?: any): Agenda.Job; + create(name: string, data?: T): Agenda.Job; /** * Find all Jobs matching `query` and pass same back in cb(). * @param query * @param cb */ - jobs(query: any, cb: ResultCallback): void; + jobs(query: any, cb: ResultCallback[]>): void; /** * Removes all jobs in the database without defined behaviors. Useful if you change a definition name and want @@ -113,8 +114,8 @@ declare class Agenda extends EventEmitter { * @param options The options for the job. * @param handler The handler to execute. */ - define(name: string, handler: (job: Agenda.Job, done: (err?: Error) => void) => void): void; - define(name: string, options: Agenda.JobOptions, handler: (job: Agenda.Job, done: (err?: Error) => void) => void): void; + define(name: string, handler: (job: Agenda.Job, done: (err?: Error) => void) => void): void; + define(name: string, options: Agenda.JobOptions, handler: (job: Agenda.Job, done: (err?: Error) => void) => void): void; /** * Runs job name at the given interval. Optionally, data and options can be passed in. @@ -124,8 +125,8 @@ declare class Agenda extends EventEmitter { * @param options An optional argument that will be passed to job.repeatEvery. * @param cb An optional callback function which will be called when the job has been persisted in the database. */ - every(interval: number | string, names: string, data?: any, options?: any, cb?: ResultCallback): Agenda.Job; - every(interval: number | string, names: string[], data?: any, options?: any, cb?: ResultCallback): Agenda.Job[]; + every(interval: number | string, names: string, data?: T, options?: any, cb?: ResultCallback>): Agenda.Job; + every(interval: number | string, names: string[], data?: T, options?: any, cb?: ResultCallback[]>): Agenda.Job[]; /** * Schedules a job to run name once at a given time. @@ -134,8 +135,8 @@ declare class Agenda extends EventEmitter { * @param data An optional argument that will be passed to the processing function under job.attrs.data. * @param cb An optional callback function which will be called when the job has been persisted in the database. */ - schedule(when: Date | string, names: string, data?: any, cb?: ResultCallback): Agenda.Job; - schedule(when: Date | string, names: string[], data?: any, cb?: ResultCallback): Agenda.Job[]; + schedule(when: Date | string, names: string, data?: T, cb?: ResultCallback>): Agenda.Job; + schedule(when: Date | string, names: string[], data?: T, cb?: ResultCallback[]>): Agenda.Job[]; /** * Schedules a job to run name once immediately. @@ -143,7 +144,7 @@ declare class Agenda extends EventEmitter { * @param data An optional argument that will be passed to the processing function under job.attrs.data. * @param cb An optional callback function which will be called when the job has been persisted in the database. */ - now(name: string, data?: any, cb?: ResultCallback): Agenda.Job; + now(name: string, data?: T, cb?: ResultCallback>): Agenda.Job; /** * Cancels any jobs matching the passed mongodb-native query, and removes them from the database. @@ -242,10 +243,14 @@ declare namespace Agenda { } } + interface JobAttributesData { + [key: string]: any; + } + /** * The database record associated with a job. */ - interface JobAttributes { + interface JobAttributes { /** * The record identity. */ @@ -264,7 +269,7 @@ declare namespace Agenda { /** * The job details. */ - data: { [name: string]: any }; + data: T; /** * The priority of the job. @@ -330,12 +335,12 @@ declare namespace Agenda { /** * A scheduled job. */ - interface Job { + interface Job { /** * The database record associated with the job. */ - attrs: JobAttributes; + attrs: JobAttributes; /** * The agenda that created the job. @@ -348,54 +353,54 @@ declare namespace Agenda { * @param options An optional argument that can include a timezone field. The timezone should be a string as * accepted by moment-timezone and is considered when using an interval in the cron string format. */ - repeatEvery(interval: string | number, options?: { timezone?: string }): Job + repeatEvery(interval: string | number, options?: { timezone?: string }): Job /** * Specifies a time when the job should repeat. [Possible values](https://github.com/matthewmueller/date#examples). * @param time */ - repeatAt(time: string): Job + repeatAt(time: string): Job /** * Disables the job. */ - disable(): Job; + disable(): Job; /** * Enables the job. */ - enable(): Job; + enable(): Job; /** * Ensure that only one instance of this job exists with the specified properties * @param value The properties associated with the job that must be unqiue. * @param opts */ - unique(value: any, opts?: { insertOnly?: boolean }): Job; + unique(value: any, opts?: { insertOnly?: boolean }): Job; /** * Specifies the next time at which the job should run. * @param time The next time at which the job should run. */ - schedule(time: string | Date): Job; + schedule(time: string | Date): Job; /** * Specifies the priority weighting of the job. * @param value The priority of the job (lowest|low|normal|high|highest|number). */ - priority(value: string | number): Job; + priority(value: string | number): Job; /** * Sets job.attrs.failedAt to now, and sets job.attrs.failReason to reason. * @param reason A message or Error object that indicates why the job failed. */ - fail(reason: string | Error): Job; + fail(reason: string | Error): Job; /** * Runs the given job and calls callback(err, job) upon completion. Normally you never need to call this manually * @param cb Called when the job is completed. */ - run(cb?: ResultCallback): Job; + run(cb?: ResultCallback>): Job; /** * Returns true if the job is running; otherwise, returns false. @@ -406,7 +411,7 @@ declare namespace Agenda { * Saves the job into the database. * @param cb Called when the job is saved. */ - save(cb?: ResultCallback): Job; + save(cb?: ResultCallback>): Job; /** * Removes the job from the database and cancels the job. @@ -424,7 +429,7 @@ declare namespace Agenda { /** * Calculates next time the job should run */ - computeNextRunAt(): Job; + computeNextRunAt(): Job; } interface JobOptions { From e4ec5a882157b97efd386b12cd27b2fb6c0c0012 Mon Sep 17 00:00:00 2001 From: Tim Chen Date: Fri, 30 Mar 2018 16:27:13 -0400 Subject: [PATCH 0363/2153] add destroy method to Player --- types/vimeo__player/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/vimeo__player/index.d.ts b/types/vimeo__player/index.d.ts index c2699d15d2..5709daa11b 100755 --- a/types/vimeo__player/index.d.ts +++ b/types/vimeo__player/index.d.ts @@ -60,6 +60,7 @@ export default class Player { getVideoUrl(): VimeoPromise; getVolume(): VimeoPromise; setVolume(volume: number): VimeoPromise; + destroy(): VimeoPromise; } export interface VimeoCuePoint { From 4c936956ecf063d75a3c653c4bcd3d4d1f81f65a Mon Sep 17 00:00:00 2001 From: Tim Chen Date: Fri, 30 Mar 2018 16:29:03 -0400 Subject: [PATCH 0364/2153] export Player separately from export default to allow for module augmentation to work on the Player class --- types/vimeo__player/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/vimeo__player/index.d.ts b/types/vimeo__player/index.d.ts index 5709daa11b..d5f224975e 100755 --- a/types/vimeo__player/index.d.ts +++ b/types/vimeo__player/index.d.ts @@ -25,7 +25,7 @@ export interface TypeError extends Error {name: "TypeError"; message: string; me export type EventName = "play" | "pause" | "ended" | "timeupdate" | "progress" | "seeked" | "texttrackchange" | "cuechange" | "cuepoint" | "volumechange" | "error" | "loaded" | string; export type EventCallback = (data: any) => any; -export default class Player { +export class Player { constructor(element: HTMLIFrameElement|HTMLElement|string, options: Options); on(event: EventName, callback: EventCallback): void; @@ -106,3 +106,4 @@ export interface VimeoPromise extends Promise { /*~ You can declare properties of the module using const, let, or var */ export const playerMap: WeakMap; export const readyMap: WeakMap; +export default Player; From d5ece63fb1ce09ee57df6dff8c951dfa21ded327 Mon Sep 17 00:00:00 2001 From: Jordan Miller Date: Fri, 30 Mar 2018 16:34:17 -0400 Subject: [PATCH 0365/2153] [react-navigation] Add optional `key` property to NavigationNavigateActionPayload --- types/react-navigation/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index f86a47ccf5..9d86c33ad4 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -202,6 +202,8 @@ export interface NavigationNavigateActionPayload { // The action to run inside the sub-router action?: NavigationNavigateAction; + + key?: string; } export interface NavigationNavigateAction extends NavigationNavigateActionPayload { From e050b6aa650a33a0f176d6ee4c5d0bb066ece325 Mon Sep 17 00:00:00 2001 From: Tim Chen Date: Fri, 30 Mar 2018 17:47:15 -0400 Subject: [PATCH 0366/2153] Revert "Merge pull request #24279 from eakarpov/patch-1" This reverts commit e35d00d7f5d0264c2dd1e2c926e8aced03237041, reversing changes made to 3ecef66f942b23ef4dc037f4791955b8563d81c2. --- types/react-table/index.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/react-table/index.d.ts b/types/react-table/index.d.ts index b463807003..503b5f4e02 100644 --- a/types/react-table/index.d.ts +++ b/types/react-table/index.d.ts @@ -642,6 +642,9 @@ export interface RowInfo { /** An array of any expandable sub-rows contained in this row */ subRows: any[]; + + /** Original object passed to row */ + original: any; } export interface FinalState extends TableProps { From 6e793449ca80f28060470a483538b865e73b6330 Mon Sep 17 00:00:00 2001 From: Abdallah Gamal Date: Sat, 31 Mar 2018 03:20:13 +0200 Subject: [PATCH 0367/2153] adding unique attribute in AssociationForeignKeyOptions adding the unique attribute in AssociationForeignKeyOptions this unique could be boolean or a string for composite unique indexes --- types/sequelize/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index 09af63c2ec..33ebcbe15f 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -1200,7 +1200,7 @@ declare namespace sequelize { * Attribute name for the relation */ name?: string; - + unique?: boolean | string; } /** From 6116dcfbdea4514b80829dcb1d0d280fb8f57e16 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 30 Mar 2018 19:36:48 -0700 Subject: [PATCH 0368/2153] fix: update es modules in arrify --- types/arrify/arrify-tests.ts | 2 +- types/arrify/index.d.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/types/arrify/arrify-tests.ts b/types/arrify/arrify-tests.ts index 319e86897a..12995781bf 100644 --- a/types/arrify/arrify-tests.ts +++ b/types/arrify/arrify-tests.ts @@ -1,4 +1,4 @@ -import arrify = require("arrify"); +import * as arrify from 'arrify'; arrify(null); arrify(null); diff --git a/types/arrify/index.d.ts b/types/arrify/index.d.ts index a1dda1b9ec..43c06af05f 100644 --- a/types/arrify/index.d.ts +++ b/types/arrify/index.d.ts @@ -14,4 +14,5 @@ * arrify([2, 3]) // returns [2, 3] */ declare function arrify(val: undefined | null | T | T[]): T[]; +declare namespace arrify {} export = arrify; From 3cd68af4a069513076f046c577a9058f1a991700 Mon Sep 17 00:00:00 2001 From: Elwyn Date: Sat, 31 Mar 2018 16:01:09 +1300 Subject: [PATCH 0369/2153] Add http2 types for "callback" Currently is typed against IncomingMessage / ServerResponse, changing to be a union type including the new Http2ServerRequest & Http2ServerResponse --- types/koa/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/koa/index.d.ts b/types/koa/index.d.ts index 2a5c49f110..07ddadc0c8 100644 --- a/types/koa/index.d.ts +++ b/types/koa/index.d.ts @@ -21,6 +21,7 @@ import * as accepts from "accepts"; import * as Cookies from "cookies"; import { EventEmitter } from "events"; import { IncomingMessage, ServerResponse, Server } from "http"; +import { Http2ServerRequest, Http2ServerResponse } from 'http2'; import httpAssert = require("http-assert"); import * as Keygrip from "keygrip"; import * as compose from "koa-compose"; @@ -500,9 +501,9 @@ declare class Application extends EventEmitter { /** * Return a request handler callback - * for node's native http server. + * for node's native http/http2 server. */ - callback(): (req: IncomingMessage, res: ServerResponse) => void; + callback(): (req: IncomingMessage | Http2ServerRequest, res: ServerResponse | Http2ServerResponse) => void; /** * Initialize a new context. From b4e6e495f88fae0937aeb1b48524220a1a1dc61e Mon Sep 17 00:00:00 2001 From: AndersonFriaca Date: Sat, 31 Mar 2018 01:28:40 -0400 Subject: [PATCH 0370/2153] Types for JQuery CountTo --- types/jquery-countto/index.d.ts | 57 ++++++++++++++++++++ types/jquery-countto/jquery.countto-tests.ts | 29 ++++++++++ types/jquery-countto/tsconfig.json | 25 +++++++++ types/jquery-countto/tslint.json | 1 + 4 files changed, 112 insertions(+) create mode 100644 types/jquery-countto/index.d.ts create mode 100644 types/jquery-countto/jquery.countto-tests.ts create mode 100644 types/jquery-countto/tsconfig.json create mode 100644 types/jquery-countto/tslint.json diff --git a/types/jquery-countto/index.d.ts b/types/jquery-countto/index.d.ts new file mode 100644 index 0000000000..a215abb7d4 --- /dev/null +++ b/types/jquery-countto/index.d.ts @@ -0,0 +1,57 @@ +// Type definitions for JQuery CountTo 1.2 +// Project: https://github.com/mhuggins/jquery-countTo +// Definitions by: Anderson Friaça +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +export interface Options { + /** + * The number to start counting from + */ + from?: number; + + /** + * The number to stop counting at + */ + to?: number; + + /** + * The number of milliseconds it should take to finish counting + */ + speed?: number; + + /** + * he number of milliseconds to wait between refreshing the counter + */ + refreshInterval?: number; + + /** + * The number of decimal places to show when using the default formatter + */ + decimals?: number; + + /** + * A handler that is used to format the current value before rendering to the DOM + */ + formatter: (value: number, options: Options) => string; + + /** + * A callback function that is triggered for every iteration that the counter updates + */ + onUpdate?: (value: number) => void; + + /** + * A callback function that is triggered when counting finishes + */ + onComplete?: (value: number) => void; +} + +export type Method = 'start' | 'stop' | 'toggle' | 'restart'; + +declare global { + interface JQuery { + countTo(methodOrOptions?: Method | Options): JQuery; + } +} diff --git a/types/jquery-countto/jquery.countto-tests.ts b/types/jquery-countto/jquery.countto-tests.ts new file mode 100644 index 0000000000..0bc7998f56 --- /dev/null +++ b/types/jquery-countto/jquery.countto-tests.ts @@ -0,0 +1,29 @@ +import { Options } from "jquery-countto"; + +// Basic usage +$('.timer').countTo(); + +// With options +const options: Options = { + from: 50, + to: 2500, + speed: 1000, + refreshInterval: 50, + formatter: (value: number, options: Options) => { + return value.toFixed(options.decimals); + }, + onUpdate: (value: number) => { + console.log(value); + }, + onComplete: (value: number) => { + console.log(value); + } + }; + +$('.timer').countTo(options); + +// Controls +$('.timer').countTo('start'); +$('.timer').countTo('stop'); +$('.timer').countTo('restart'); +$('.timer').countTo('toggle'); diff --git a/types/jquery-countto/tsconfig.json b/types/jquery-countto/tsconfig.json new file mode 100644 index 0000000000..855047ba62 --- /dev/null +++ b/types/jquery-countto/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "jquery.countto-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jquery-countto/tslint.json b/types/jquery-countto/tslint.json new file mode 100644 index 0000000000..d04fe2e1fa --- /dev/null +++ b/types/jquery-countto/tslint.json @@ -0,0 +1 @@ +{"extends": "dtslint/dt.json"} \ No newline at end of file From 4fab9de846d523cebe95f91e0c2b65837e0a981a Mon Sep 17 00:00:00 2001 From: AndersonFriaca Date: Sat, 31 Mar 2018 01:40:25 -0400 Subject: [PATCH 0371/2153] Adjustments --- .../{jquery.countto-tests.ts => jquery-countto-tests.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename types/jquery-countto/{jquery.countto-tests.ts => jquery-countto-tests.ts} (100%) diff --git a/types/jquery-countto/jquery.countto-tests.ts b/types/jquery-countto/jquery-countto-tests.ts similarity index 100% rename from types/jquery-countto/jquery.countto-tests.ts rename to types/jquery-countto/jquery-countto-tests.ts From cd5f204c1143c8dc63055ca32e596f5544fe35b1 Mon Sep 17 00:00:00 2001 From: AndersonFriaca Date: Sat, 31 Mar 2018 01:49:26 -0400 Subject: [PATCH 0372/2153] Adjustments --- types/jquery-countto/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/jquery-countto/tsconfig.json b/types/jquery-countto/tsconfig.json index 855047ba62..3d5cf520dd 100644 --- a/types/jquery-countto/tsconfig.json +++ b/types/jquery-countto/tsconfig.json @@ -20,6 +20,6 @@ }, "files": [ "index.d.ts", - "jquery.countto-tests.ts" + "jquery-countto-tests.ts" ] } \ No newline at end of file From 4bcf0f686635e86107f5841812b5c632e0eadba2 Mon Sep 17 00:00:00 2001 From: Blair Zajac Date: Fri, 30 Mar 2018 23:47:08 -0700 Subject: [PATCH 0373/2153] node: assert.fail() has never return type. --- types/node/index.d.ts | 4 ++-- types/node/v0/index.d.ts | 2 +- types/node/v4/index.d.ts | 2 +- types/node/v6/index.d.ts | 2 +- types/node/v7/index.d.ts | 2 +- types/node/v8/index.d.ts | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 2e31fff6e6..3404e37d46 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -5615,8 +5615,8 @@ declare module "assert" { }); } - export function fail(message: string): void; - export function fail(actual: any, expected: any, message?: string, operator?: string): void; + export function fail(message: string): never; + export function fail(actual: any, expected: any, message?: string, operator?: string): never; export function ok(value: any, message?: string): void; export function equal(actual: any, expected: any, message?: string): void; export function notEqual(actual: any, expected: any, message?: string): void; diff --git a/types/node/v0/index.d.ts b/types/node/v0/index.d.ts index 800a909c49..ef1c485d2d 100644 --- a/types/node/v0/index.d.ts +++ b/types/node/v0/index.d.ts @@ -1870,7 +1870,7 @@ declare module "assert" { operator?: string; stackStartFunction?: Function}); } - export function fail(actual?: any, expected?: any, message?: string, operator?: string): void; + export function fail(actual?: any, expected?: any, message?: string, operator?: string): never; export function ok(value: any, message?: string): void; export function equal(actual: any, expected: any, message?: string): void; export function notEqual(actual: any, expected: any, message?: string): void; diff --git a/types/node/v4/index.d.ts b/types/node/v4/index.d.ts index 16e54d002d..ada62b683e 100644 --- a/types/node/v4/index.d.ts +++ b/types/node/v4/index.d.ts @@ -2448,7 +2448,7 @@ declare module "assert" { operator?: string; stackStartFunction?: Function}); } - export function fail(actual: any, expected: any, message?: string, operator?: string): void; + export function fail(actual: any, expected: any, message?: string, operator?: string): never; export function ok(value: any, message?: string): void; export function equal(actual: any, expected: any, message?: string): void; export function notEqual(actual: any, expected: any, message?: string): void; diff --git a/types/node/v6/index.d.ts b/types/node/v6/index.d.ts index 3ca66a2df5..f38cdf01dd 100644 --- a/types/node/v6/index.d.ts +++ b/types/node/v6/index.d.ts @@ -3876,7 +3876,7 @@ declare module "assert" { }); } - export function fail(actual: any, expected: any, message?: string, operator?: string): void; + export function fail(actual: any, expected: any, message?: string, operator?: string): never; export function ok(value: any, message?: string): void; export function equal(actual: any, expected: any, message?: string): void; export function notEqual(actual: any, expected: any, message?: string): void; diff --git a/types/node/v7/index.d.ts b/types/node/v7/index.d.ts index 62e30f0f09..896b5a887f 100644 --- a/types/node/v7/index.d.ts +++ b/types/node/v7/index.d.ts @@ -3984,7 +3984,7 @@ declare module "assert" { }); } - export function fail(actual: any, expected: any, message?: string, operator?: string): void; + export function fail(actual: any, expected: any, message?: string, operator?: string): never; export function ok(value: any, message?: string): void; export function equal(actual: any, expected: any, message?: string): void; export function notEqual(actual: any, expected: any, message?: string): void; diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index fd1f5cafae..4bd4977d5f 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -5585,8 +5585,8 @@ declare module "assert" { }); } - export function fail(message: string): void; - export function fail(actual: any, expected: any, message?: string, operator?: string): void; + export function fail(message: string): never; + export function fail(actual: any, expected: any, message?: string, operator?: string): never; export function ok(value: any, message?: string): void; export function equal(actual: any, expected: any, message?: string): void; export function notEqual(actual: any, expected: any, message?: string): void; From 9d25183a8673d4797a60c93414efb9109eb31b04 Mon Sep 17 00:00:00 2001 From: Christian Johansen Date: Sat, 31 Mar 2018 11:27:00 +0200 Subject: [PATCH 0374/2153] Updated react-beautiful-dnd zIndex as per kingdaros review --- types/react-beautiful-dnd/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-beautiful-dnd/index.d.ts b/types/react-beautiful-dnd/index.d.ts index 9f49eb5e96..8d25e79407 100644 --- a/types/react-beautiful-dnd/index.d.ts +++ b/types/react-beautiful-dnd/index.d.ts @@ -12,7 +12,7 @@ export type Id = string; export type DraggableId = Id; export type DroppableId = Id; export type TypeId = Id; -export type ZIndex = React.CSSProperties['z-Index']; +export type ZIndex = React.CSSProperties['zIndex']; export type DropReason = 'DROP' | 'CANCEL'; export type Announce = (message: string) => void; From e22541686c4c15ad5ed82619719a8904c3d30ee0 Mon Sep 17 00:00:00 2001 From: naronA Date: Sat, 31 Mar 2018 18:39:52 +0900 Subject: [PATCH 0375/2153] puppeteer: add missing function setCacheEnable on Page class Page.setCacheEnable: https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagesetcacheenabledenabled --- types/puppeteer/index.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/puppeteer/index.d.ts b/types/puppeteer/index.d.ts index 2afb026648..9298d6c631 100644 --- a/types/puppeteer/index.d.ts +++ b/types/puppeteer/index.d.ts @@ -1041,6 +1041,12 @@ export interface Page extends EventEmitter, FrameBase { */ select(selector: string, ...values: string[]): Promise; + /** + * Determines whether cache is enabled on the page. + * @param enabled Whether or not to enable cache on the page. + */ + setCacheEnabled(enabled: boolean): Promise; + /** * Sets the cookies on the page. * @param cookies The cookies to set. From d7c6430b9d82e9b9029912529feb337d93c15f05 Mon Sep 17 00:00:00 2001 From: jewbre Date: Sat, 31 Mar 2018 12:03:15 +0200 Subject: [PATCH 0376/2153] types for amp message 0.1 --- types/amp-message/amp-message-tests.ts | 57 ++++++++++++++++++++++++++ types/amp-message/index.d.ts | 25 +++++++++++ types/amp-message/tsconfig.json | 23 +++++++++++ types/amp-message/tslint.json | 1 + 4 files changed, 106 insertions(+) create mode 100644 types/amp-message/amp-message-tests.ts create mode 100644 types/amp-message/index.d.ts create mode 100644 types/amp-message/tsconfig.json create mode 100644 types/amp-message/tslint.json diff --git a/types/amp-message/amp-message-tests.ts b/types/amp-message/amp-message-tests.ts new file mode 100644 index 0000000000..003949f3b7 --- /dev/null +++ b/types/amp-message/amp-message-tests.ts @@ -0,0 +1,57 @@ +import Message = require('amp-message'); + +// $ExpectType Message +new Message(new Buffer('aaa')); + +// $ExpectType Message +new Message([new Buffer('aaa'), new Buffer('bbb')]); + +const message = new Message([new Buffer('aaa'), new Buffer('bbb')]); + +// $ExpectType string +message.inspect(); + +// $ExpectType Buffer +message.toBuffer(); + +// $ExpectType number +message.push(new Buffer('ccc')); + +// $ExpectType Buffer | undefined +message.pop(); + +// $ExpectType Buffer | undefined +message.shift(); + +// $ExpectType number +message.unshift(new Buffer('ddd')); + +// $ExpectError +new Message(); + +// $ExpectError +new Message(1); + +// $ExpectError +new Message({}); + +// $ExpectError +new Message('aaa'); + +// $ExpectError +message.push(1); + +// $ExpectError +message.push({}); + +// $ExpectError +message.push('aaa'); + +// $ExpectError +message.unshift(1); + +// $ExpectError +message.unshift({}); + +// $ExpectError +message.unshift('aaa'); diff --git a/types/amp-message/index.d.ts b/types/amp-message/index.d.ts new file mode 100644 index 0000000000..f1ca520ae7 --- /dev/null +++ b/types/amp-message/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for amp-message 0.1 +// Project: https://github.com/visionmedia/node-amp-message +// Definitions by: Vilim Stubičan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +declare class Message { + constructor(args: Buffer | Buffer[]); + + inspect(): string; + + toBuffer(): Buffer; + + push(...items: Buffer[]): number; + + pop(): Buffer | undefined; + + shift(): Buffer | undefined; + + unshift(...items: Buffer[]): number; +} + +export = Message; diff --git a/types/amp-message/tsconfig.json b/types/amp-message/tsconfig.json new file mode 100644 index 0000000000..7b1826a6d8 --- /dev/null +++ b/types/amp-message/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "amp-message-tests.ts" + ] +} diff --git a/types/amp-message/tslint.json b/types/amp-message/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/amp-message/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 93d5d645d3c2dcf32f2d199d14e0208e9d85a889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez?= Date: Sat, 31 Mar 2018 13:37:43 +0200 Subject: [PATCH 0377/2153] Remove retry from the AsyncRetry namespace --- types/async-retry/index.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/types/async-retry/index.d.ts b/types/async-retry/index.d.ts index fdbc9ecf24..a2f65e00a4 100644 --- a/types/async-retry/index.d.ts +++ b/types/async-retry/index.d.ts @@ -10,8 +10,6 @@ declare function AsyncRetry( ): Promise; declare namespace AsyncRetry { - function retry(fn: RetryFunction, opts: Options): Promise; - interface Options { retries?: number; factor?: number; From c04fe2193edf7ce479904cb8ea087d3b90330564 Mon Sep 17 00:00:00 2001 From: jewbre Date: Sat, 31 Mar 2018 14:56:58 +0200 Subject: [PATCH 0378/2153] types for escape-regexp 0.0 --- types/escape-regexp/escape-regexp-tests.ts | 22 +++++++++++++++++++++ types/escape-regexp/index.d.ts | 9 +++++++++ types/escape-regexp/tsconfig.json | 23 ++++++++++++++++++++++ types/escape-regexp/tslint.json | 1 + 4 files changed, 55 insertions(+) create mode 100644 types/escape-regexp/escape-regexp-tests.ts create mode 100644 types/escape-regexp/index.d.ts create mode 100644 types/escape-regexp/tsconfig.json create mode 100644 types/escape-regexp/tslint.json diff --git a/types/escape-regexp/escape-regexp-tests.ts b/types/escape-regexp/escape-regexp-tests.ts new file mode 100644 index 0000000000..086ff36348 --- /dev/null +++ b/types/escape-regexp/escape-regexp-tests.ts @@ -0,0 +1,22 @@ +import escapeRegExp = require('escape-regexp'); + +// $ExpectType string +escapeRegExp('aaa'); + +// $ExpectError +escapeRegExp(); + +// $ExpectError +escapeRegExp({}); + +// $ExpectError +escapeRegExp(1); + +// $ExpectError +escapeRegExp([]); + +// $ExpectError +escapeRegExp(null); + +// $ExpectError +escapeRegExp(undefined); diff --git a/types/escape-regexp/index.d.ts b/types/escape-regexp/index.d.ts new file mode 100644 index 0000000000..ac5d20064c --- /dev/null +++ b/types/escape-regexp/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for escape-regexp 0.0 +// Project: https://github.com/baz/foo (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.) +// Definitions by: Vilim Stubičan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +declare function escapeRegExp(str: string): string; + +export = escapeRegExp; diff --git a/types/escape-regexp/tsconfig.json b/types/escape-regexp/tsconfig.json new file mode 100644 index 0000000000..1037db1961 --- /dev/null +++ b/types/escape-regexp/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "escape-regexp-tests.ts" + ] +} diff --git a/types/escape-regexp/tslint.json b/types/escape-regexp/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/escape-regexp/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 9ee1f10be8d96866bcc68bb5c42a870031d8164a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20D=C3=BCfel?= Date: Sat, 31 Mar 2018 17:51:55 +0200 Subject: [PATCH 0379/2153] cassandra-driver: update to 3.4.1 --- types/cassandra-driver/index.d.ts | 153 +++++++++++++++++++++++++----- 1 file changed, 128 insertions(+), 25 deletions(-) diff --git a/types/cassandra-driver/index.d.ts b/types/cassandra-driver/index.d.ts index 5c0578ccf2..33a9f5988f 100644 --- a/types/cassandra-driver/index.d.ts +++ b/types/cassandra-driver/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for cassandra-driver v3.2.2 +// Type definitions for cassandra-driver v3.4.1 // Project: https://github.com/datastax/nodejs-driver // Definitions by: Marc Fisher +// Christian D // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -115,7 +116,11 @@ export namespace policies { interface RetryPolicyStatic { new (): RetryPolicy; - retryDecision: any; + retryDecision: { + rethrow: number, + retry: number, + ignore: number + }; } interface RetryPolicy { @@ -126,15 +131,55 @@ export namespace policies { retryResult(): { decision: retryDecision, consistency: types.consistencies, useCurrentHost: boolean }; } } + + namespace speculativeExecution { + let NoSpeculativeExecutionPolicy: NoSpeculativeExecutionPolicyStatic + + interface SpeculativeExecutionPolicy { + init(client: Client): void; + newPlan(keyspace: string, queryInfo: string | Array): { + nextExecution: Function + } + } + + interface NoSpeculativeExecutionPolicyStatic { + new (): NoSpeculativeExecutionPolicy + } + + interface NoSpeculativeExecutionPolicy extends SpeculativeExecutionPolicy { } + + interface ConstantSpeculativeExecutionPolicyStatic { + new (delay: number, maxSpeculativeExecutions: number): ConstantSpeculativeExecutionPolicy + } + + interface ConstantSpeculativeExecutionPolicy extends SpeculativeExecutionPolicy { } + } + + namespace timestampGeneration { + let MonotonicTimestampGenerator: MonotonicTimestampGeneratorStatic + + interface TimestampGenerator { + next(client: Client): null | number | _Long + } + + interface MonotonicTimestampGeneratorStatic { + new (warningThreshold?: number, minLogInterval?: number): MonotonicTimestampGeneratorStatic + } + + interface MonotonicTimestampGenerator extends TimestampGenerator { + getDate(): number + } + } } export namespace types { let BigDecimal: BigDecimalStatic; + let Duration: DurationStatic; + let Long: _Long; let InetAddress: InetAddressStatic; let Integer: IntegerStatic; let LocalDate: LocalDateStatic; let LocalTime: LocalTimeStatic; - let Long: _Long; let ResultSet: ResultSetStatic; // let ResultStream: ResultStreamStatic; let Row: RowStatic; @@ -221,6 +266,19 @@ export namespace types { toJSON(): string; } + interface DurationStatic { + new (month: number, days: number, nanoseconds: number | _Long): Duration; + + fromBuffer(buffer: Buffer): Duration; + fromString(input: string): Duration; + } + + interface Duration { + equals(other: Duration): boolean; + toBuffer(): Buffer; + toString(): string; + } + interface InetAddressStatic { new (buffer: Buffer): InetAddress; @@ -336,13 +394,14 @@ export namespace types { } interface ResultSetStatic { - new (response: any, host: string, triedHost: { [key: string]: any }, consistency: consistencies): ResultSet; + new (response: any, host: string, triedHost: { [key: string]: any }, speculativeExecutions: number, consistency: consistencies): ResultSet; } interface ResultSet { info: { queriedHost: Host, triedHosts: { [key: string]: string; }, + speculativeExecutions: number, achievedConsistency: consistencies, traceId: Uuid, warnings: Array, @@ -352,11 +411,13 @@ export namespace types { rowLength: number; columns: Array<{ [key: string]: string; }>; pageState: string; - nextPage: any; // function + nextPage: Function; first(): Row; getPageState(): string; getColumns(): Array<{ [key: string]: string; }>; + wasApplied(): boolean; + [Symbol.iterator](): Iterator; } interface ResultStreamStatic { @@ -442,40 +503,50 @@ export let Encoder: EncoderStatic; export interface ClientOptions { contactPoints: Array, keyspace?: string, + refreshSchemaDelay?: number, + isMetadataSyncEnabled?: boolean, + prepareOnAllHosts?: boolean, + rePrepareOnUp?: boolean, + maxPrepared?: number, policies?: { - addressResolution?: policies.addressResolution.AddressTranslator, loadBalancing?: policies.loadBalancing.LoadBalancingPolicy, + retry?: policies.retry.RetryPolicy, reconnection?: policies.reconnection.ReconnectionPolicy, - retry?: policies.retry.RetryPolicy + addressResolution?: policies.addressResolution.AddressTranslator, + speculativeExecution?: policies.speculativeExecution.SpeculativeExecutionPolicy, + timestampGeneration?: policies.timestampGeneration.TimestampGenerator, }, queryOptions?: QueryOptions, pooling?: { - heartBeatInterval: number, - coreConnectionsPerHost: { [key: number]: number; }, - warmup: boolean; + heartBeatInterval?: number, + coreConnectionsPerHost?: { [key: number]: number; }, + maxRequestsPerConnection?: number, + warmup?: boolean; }, protocolOptions?: { - port: number, - maxSchemaAgreementWaitSeconds: number, - maxVersion: number + port?: number, + maxSchemaAgreementWaitSeconds?: number, + maxVersion?: number }, socketOptions?: { - connectTimeout: number, - defunctReadTimeoutThreshold: number, - keepAlive: boolean, - keepAliveDelay: number, - readTimeout: number, - tcpNoDelay: boolean, - coalescingThreshold: number + connectTimeout?: number, + defunctReadTimeoutThreshold?: number, + keepAlive?: boolean, + keepAliveDelay?: number, + readTimeout?: number, + tcpNoDelay?: boolean, + coalescingThreshold?: number }, authProvider?: auth.AuthProvider, sslOptions?: tls.ConnectionOptions, encoding?: { - map: Function, - set: Function, - copyBuffer: boolean, - useUndefinedAsUnset: boolean - } + map?: Function, + set?: Function, + copyBuffer?: boolean, + useUndefinedAsUnset?: boolean + }, + profiles?: Array, + promiseFactory?: Function, } export interface QueryOptions { @@ -483,8 +554,11 @@ export interface QueryOptions { captureStackTrace?: boolean; consistency?: number; customPayload?: any; + executionProfile?: string | ExecutionProfile; fetchSize?: number; hints?: Array | Array>; + isIdempotent?: boolean; + keyspace?: string; logged?: boolean; pageState?: Buffer | string; prepare?: boolean; @@ -520,6 +594,7 @@ export interface Client extends events.EventEmitter { execute(query: string, callback: ResultCallback): void; execute(query: string, params?: any, options?: QueryOptions): Promise; getReplicas(keyspace: string, token: Buffer): Array; // TODO: Should this be a more explicit return? + getState(): metadata.ClientState; shutdown(callback?: Callback): void; shutdown(): Promise; stream(query: string, params?: any, options?: QueryOptions, callback?: Callback): NodeJS.ReadableStream; @@ -548,6 +623,7 @@ export interface HostMapStatic { export interface HostMap extends events.EventEmitter { length: number; + clear(): Array; forEach(callback: Callback): void; get(key: string): Host; keys(): Array; @@ -566,6 +642,22 @@ export interface Encoder { encode(value: any, typeInfo?: string | number | { code: number, info?: any }): Buffer; } +interface ExecutionProfileOptions { + consistency: number, + loadBalancing: policies.loadBalancing.LoadBalancingPolicy, + name: string, + readTimeout: number, + retry: policies.retry.RetryPolicy, + serialConsistency: number +} + +export interface ExecutionProfileStatic { + new (name: string, options: ExecutionProfileOptions): ExecutionProfile +} + +export interface ExecutionProfile extends ExecutionProfileOptions { +} + export namespace auth { let Authenticator: AuthenticatorStatic; let PlainTextAuthProvider: PlainTextAuthProviderStatic; @@ -649,6 +741,17 @@ export namespace metadata { stateFunction: string; stateType: string; } + + interface ClientStateStatic { + new (): ClientState; + } + + interface ClientState { + getConnectedHosts(): Array; + getInFlightQueries(host: Host): number; + getOpenConnections(host: Host): number; + toString(): string; + } interface DataTypeInfo { code: number, From 21ed509e3e5446251b226585bd968272c48e6010 Mon Sep 17 00:00:00 2001 From: richseviora Date: Sat, 31 Mar 2018 13:21:28 -0700 Subject: [PATCH 0380/2153] Remove Rich Seviora from Authors List --- types/react/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index c38f57b0a7..0a2cdd403c 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -12,7 +12,6 @@ // Tanguy Krotoff // Dovydas Navickas // Stéphane Goetz -// Rich Seviora // Josh Rutherford // Guilherme Hübner // Josh Goldberg From a731287c7648df60442ace11b7b7f3ec3894dfba Mon Sep 17 00:00:00 2001 From: jewbre Date: Sun, 1 Apr 2018 01:36:19 +0200 Subject: [PATCH 0381/2153] Project defintion for npmjs --- types/escape-regexp/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/escape-regexp/index.d.ts b/types/escape-regexp/index.d.ts index ac5d20064c..b1a0ff1edf 100644 --- a/types/escape-regexp/index.d.ts +++ b/types/escape-regexp/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for escape-regexp 0.0 -// Project: https://github.com/baz/foo (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.) +// Project: https://www.npmjs.com/package/escape-regexp // Definitions by: Vilim Stubičan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 From 3369e2e196cbba76a57aedcd2678ae77de1d46b3 Mon Sep 17 00:00:00 2001 From: Blair Zajac Date: Sat, 31 Mar 2018 19:22:11 -0700 Subject: [PATCH 0382/2153] winston: add 'all', 'level' and 'message' as valid colorize values. Supports https://github.com/winstonjs/winston/commit/72273b1 . --- types/winston/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/winston/index.d.ts b/types/winston/index.d.ts index df360f1e01..dd6ab0e1aa 100644 --- a/types/winston/index.d.ts +++ b/types/winston/index.d.ts @@ -272,7 +272,7 @@ declare namespace winston { interface ConsoleTransportInstance extends TransportInstance { json: boolean; - colorize: boolean; + colorize: boolean | 'all' | 'level' | 'message'; prettyPrint: boolean; timestamp: boolean | (() => string | boolean); showLevel: boolean; @@ -294,7 +294,7 @@ declare namespace winston { interface FileTransportInstance extends TransportInstance { json: boolean; logstash: boolean; - colorize: boolean; + colorize: boolean | 'all' | 'level' | 'message'; maxsize: number|null; rotationFormat: boolean; zippedArchive: boolean; @@ -330,7 +330,7 @@ declare namespace winston { writeOutput: GenericTextTransportOptions[]; json: boolean; - colorize: boolean; + colorize: boolean | 'all' | 'level' | 'message'; prettyPrint: boolean; timestamp: boolean | (() => string | boolean); showLevel: boolean; @@ -390,7 +390,7 @@ declare namespace winston { interface GenericTextTransportOptions { json?: boolean; - colorize?: boolean; + colorize?: boolean | 'all' | 'level' | 'message'; colors?: any; prettyPrint?: boolean; showLevel?: boolean; From 6ab9f281fd54c6e6b235d340db1ffc770eb0f665 Mon Sep 17 00:00:00 2001 From: Bruno Lemos Date: Sat, 31 Mar 2018 23:22:57 -0300 Subject: [PATCH 0383/2153] [react-navigation] Add SafeAreaView export --- types/react-navigation/index.d.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index f86a47ccf5..c5fc09f62d 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -31,6 +31,7 @@ import * as React from 'react'; import { Animated, TextStyle, + ViewProperties, ViewStyle, StyleProp, } from 'react-native'; @@ -903,3 +904,20 @@ export function withNavigation( export function withNavigationFocus( Component: React.ComponentType ): React.ComponentType; + +/** + * SafeAreaView Component + */ +export type SafeAreaViewForceInsetValue = 'always' | 'never'; +export interface SafeAreaViewProps extends ViewProperties { + forceInset?: { + top?: SafeAreaViewForceInsetValue; + bottom?: SafeAreaViewForceInsetValue; + left?: SafeAreaViewForceInsetValue; + right?: SafeAreaViewForceInsetValue; + horizontal?: SafeAreaViewForceInsetValue; + vertical?: SafeAreaViewForceInsetValue; + }; +} + +export const SafeAreaView: React.ComponentClass; From d01a5c6b1bd0dfd28bf2c30d3e78c738c3826c25 Mon Sep 17 00:00:00 2001 From: ataru <> Date: Sun, 1 Apr 2018 14:11:40 +0900 Subject: [PATCH 0384/2153] fix sequelize update incorrect typings --- types/sequelize/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index 09af63c2ec..d0ed8efc50 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -4046,7 +4046,7 @@ declare namespace sequelize { * elements. The first element is always the number of affected rows, while the second element is the actual * affected rows (only supported in postgres with `options.returning` true.) */ - update(values: TAttributes, options: UpdateOptions): Promise<[number, TInstance[]]>; + update(values: TAttributes, options?: UpdateOptions): Promise<[number, TInstance[]]>; /** * Run a describe query on the table. The result will be return to the listener as a hash of attributes and From 90685eb26a801905ad6a4c44228a3a1d7636a28e Mon Sep 17 00:00:00 2001 From: Bruno Lemos Date: Sat, 31 Mar 2018 23:04:55 -0300 Subject: [PATCH 0385/2153] [react-navigation] Add indicatorStyle to TabBarTopProps https://reactnavigation.org/docs/tab-navigator.html#tabbaroptions-for-tabbartop-default-tab-bar-on-android --- types/react-navigation/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index f86a47ccf5..0a131dc098 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -702,6 +702,7 @@ export function TabNavigator( export interface TabBarTopProps { activeTintColor: string; inactiveTintColor: string; + indicatorStyle: StyleProp; showIcon: boolean; showLabel: boolean; upperCaseLabel: boolean; From 73cde47eb12ea09e02d8cd05902dc6e9693ddb79 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Mon, 2 Apr 2018 00:07:31 +0800 Subject: [PATCH 0386/2153] On newest node-fetch, arrayBuffer are supported. --- types/node-fetch/index.d.ts | 1 + types/node-fetch/node-fetch-tests.ts | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/types/node-fetch/index.d.ts b/types/node-fetch/index.d.ts index d39b6db22e..aaaf30a5e3 100644 --- a/types/node-fetch/index.d.ts +++ b/types/node-fetch/index.d.ts @@ -77,6 +77,7 @@ export class Body { json(): Promise; text(): Promise; buffer(): Promise; + arrayBuffer(): Promise; } export class Response extends Body { diff --git a/types/node-fetch/node-fetch-tests.ts b/types/node-fetch/node-fetch-tests.ts index dbf140225f..564a31fe79 100644 --- a/types/node-fetch/node-fetch-tests.ts +++ b/types/node-fetch/node-fetch-tests.ts @@ -30,6 +30,10 @@ function test_fetchUrl() { handlePromise(fetch("http://www.andlabs.net/html5/uCOR.php")); } +function test_fetchUrlArrayBuffer() { + handlePromise(fetch("http://www.andlabs.net/html5/uCOR.php"), true); +} + function test_fetchUrlWithRequestObject() { var requestOptions: RequestInit = { method: "POST", @@ -53,13 +57,17 @@ function test_globalFetchVar() { }); } -function handlePromise(promise: Promise) { - promise.then((response) => { +function handlePromise(promise: Promise, isArrayBuffer: boolean = false) { + promise.then((response):Promise => { if (response.type === 'basic') { // for test only } - return response.text(); - }).then((text) => { + if (isArrayBuffer) { + return response.arrayBuffer(); + } else { + return response.text(); + } + }).then((text:string | ArrayBuffer) => { console.log(text); }); } From 0dc7228f220436b37baa975358d5cf5ae2cc3a96 Mon Sep 17 00:00:00 2001 From: elvis Date: Sun, 1 Apr 2018 22:08:47 +0200 Subject: [PATCH 0387/2153] Types for jackrabbit 4.3.0 --- types/jackrabbit/index.d.ts | 66 ++++++++++++++++++++++++++++ types/jackrabbit/jackrabbit-tests.ts | 62 ++++++++++++++++++++++++++ types/jackrabbit/tsconfig.json | 16 +++++++ types/jackrabbit/tslint.json | 1 + 4 files changed, 145 insertions(+) create mode 100644 types/jackrabbit/index.d.ts create mode 100644 types/jackrabbit/jackrabbit-tests.ts create mode 100644 types/jackrabbit/tsconfig.json create mode 100644 types/jackrabbit/tslint.json diff --git a/types/jackrabbit/index.d.ts b/types/jackrabbit/index.d.ts new file mode 100644 index 0000000000..ec0ff27fa9 --- /dev/null +++ b/types/jackrabbit/index.d.ts @@ -0,0 +1,66 @@ +// Type definitions for jackrabbit 4.3 +// Project: https://github.com/hunterloftis/jackrabbit +// Definitions by: Elvis Adomnica +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +import { Connection, Options, Message } from 'amqplib'; + +declare namespace jackrabbit { + function jackrabbit(url: string): JackRabbit; + + interface JackRabbit extends NodeJS.EventEmitter { + default(): Exchange; + direct(name?: string): Exchange; + fanout(name?: string): Exchange; + topic(name?: string): Exchange; + close(callback: (e: Error) => any): void; + getInternals: () => { + amqp: any; + connection: Connection; + }; + } + + enum exchangeType { + direct = 'direct', + fanout = 'fanout', + topic = 'topic', + } + + interface Exchange extends NodeJS.EventEmitter { + name: string; + type: exchangeType; + options: Options.AssertExchange; + queue(options: QueueOptions): Queue; + connect(con: Connection): Exchange; + publish(message: any, options?: PublishOptions): Exchange; + } + + type PublishOptions = Options.Publish & { + key: string; + reply?: AckCallback; + }; + + type QueueOptions = Options.AssertQueue & { + name?: string; + key?: string; + keys?: ReadonlyArray; + prefetch?: number; + }; + + type AckCallback = (data?: any) => void; + + interface Queue extends NodeJS.EventEmitter { + name: string; + options: QueueOptions; + connect(con: Connection): void; + consume: ( + callback: (data: any, ack: AckCallback, nack: () => void, msg: Message) => void, + options?: Options.Consume + ) => void; + cancel(done: any): void; + purge(done: any): void; + } +} + +export default jackrabbit.jackrabbit; diff --git a/types/jackrabbit/jackrabbit-tests.ts b/types/jackrabbit/jackrabbit-tests.ts new file mode 100644 index 0000000000..57bd961259 --- /dev/null +++ b/types/jackrabbit/jackrabbit-tests.ts @@ -0,0 +1,62 @@ +import jackrabbit from 'jackrabbit'; + +const RABBIT_URL = 'amqp://localhost'; + +function onMessage(data: any) {} +function ack() {} + +// $ExpectError +jackrabbit(); +// $ExpectError +jackrabbit(1); + +const rabbit = jackrabbit(RABBIT_URL); + +// test default exchange based on '1-hello-world' example +const defaultExchange = rabbit.default(); +const hello = defaultExchange.queue({ name: 'hello' }); + +defaultExchange.publish('Hello World!', { key: 'hello' }); + +hello.consume(onMessage, { noAck: true }); + +// test fanout exchange based on '3-pubsub' example +const fanoutExchange = rabbit.fanout(); + +fanoutExchange.publish('this is a log'); + +const fanoutQueue = fanoutExchange.queue({ exclusive: true }); +fanoutQueue.consume(onMessage, { noAck: true }); + +// test direct exchange based on '4-routing' example +const directExchange = rabbit.direct('direct_logs'); + +directExchange.publish({ text: 'this is a harmless log' }, { key: 'info' }); +directExchange.publish({ text: 'this one is more important' }, { key: 'warning' }); +directExchange.publish({ text: 'pay attention to me!' }, { key: 'error' }); + +const errorsQueue = directExchange.queue({ exclusive: true, key: 'error' }); +const logsQueue = directExchange.queue({ exclusive: true, keys: ['info', 'warning'] }); + +errorsQueue.consume((onMessage, ack) => {}); +logsQueue.consume((onMessage, ack) => {}); + +// test reply based on '6-rpc' example +const exchange = rabbit.default(); +const rpc = exchange.queue({ name: 'rpc_queue', prefetch: 1, durable: false }); + +exchange.publish( + { n: 40 }, + { + key: 'rpc_queue', + reply: onReply, + } +); + +function onReply(data: any) {} + +rpc.consume(onRequest); + +function onRequest(data: any, reply: (data: any) => void) { + reply({ field: 'value' }); +} diff --git a/types/jackrabbit/tsconfig.json b/types/jackrabbit/tsconfig.json new file mode 100644 index 0000000000..3d053557b2 --- /dev/null +++ b/types/jackrabbit/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "jackrabbit-tests.ts"] +} diff --git a/types/jackrabbit/tslint.json b/types/jackrabbit/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jackrabbit/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 803aa84d97c02fcbac4ad8f78d4067c717094b3d Mon Sep 17 00:00:00 2001 From: Mikko Vuorinen Date: Sun, 1 Apr 2018 21:35:01 +0100 Subject: [PATCH 0388/2153] [hellojs] fix response type parameter type Add all valid response type values to the type HelloJSDisplayType as per OAuth 2.0 specification (https://www.iana.org/assignments/oauth-parameters/oauth-parameters.xhtml#endpoint) --- types/hellojs/index.d.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/types/hellojs/index.d.ts b/types/hellojs/index.d.ts index e8efdaf19c..5b23b29e07 100644 --- a/types/hellojs/index.d.ts +++ b/types/hellojs/index.d.ts @@ -53,7 +53,15 @@ declare namespace hello { type HelloJSResponseCallback = (r: any, headers: any) => void; - type HelloJSTokenResponseType = "token" | "code"; + type HelloJSTokenResponseType = + "code" + | "code id_token" + | "code id_token token" + | "code token" + | "id_token" + | "id_token token" + | "none" + | "token"; type HelloJSDisplayType = "popup" | "page" | "none"; From b6e18405ce0ddfe8e72ede6519b3315a1847a396 Mon Sep 17 00:00:00 2001 From: Mikko Vuorinen Date: Sun, 1 Apr 2018 21:48:11 +0100 Subject: [PATCH 0389/2153] [hellojs] add test for response_type parameter --- types/hellojs/hellojs-tests.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/hellojs/hellojs-tests.ts b/types/hellojs/hellojs-tests.ts index 4a4e068379..8cf42d11e4 100644 --- a/types/hellojs/hellojs-tests.ts +++ b/types/hellojs/hellojs-tests.ts @@ -4,7 +4,8 @@ hello.init({ oauth: { version: 2, auth: '', - grant: '' + grant: '', + response_type: 'id_token token' }, refresh: true, scope_delim: ' ', From 2af878bd6b2dfaa7258498253421d7ddc5696c83 Mon Sep 17 00:00:00 2001 From: Ian Mobley Date: Sun, 1 Apr 2018 14:48:32 -0700 Subject: [PATCH 0390/2153] Add types for ReactLoadablePlugin, getBundles --- types/react-loadable/index.d.ts | 1 + types/react-loadable/test/webpack.ts | 25 +++++++++++++++++++++++++ types/react-loadable/tsconfig.json | 4 +++- types/react-loadable/webpack.d.ts | 23 +++++++++++++++++++++++ 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 types/react-loadable/test/webpack.ts create mode 100644 types/react-loadable/webpack.d.ts diff --git a/types/react-loadable/index.d.ts b/types/react-loadable/index.d.ts index d2229d4bf6..beeb569d4c 100644 --- a/types/react-loadable/index.d.ts +++ b/types/react-loadable/index.d.ts @@ -4,6 +4,7 @@ // Oden S. // Ian Ker-Seymer // Tomek Łaziuk +// Ian Mobley // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 diff --git a/types/react-loadable/test/webpack.ts b/types/react-loadable/test/webpack.ts new file mode 100644 index 0000000000..089994a23d --- /dev/null +++ b/types/react-loadable/test/webpack.ts @@ -0,0 +1,25 @@ +import * as webpack from 'webpack'; +import { ReactLoadablePlugin, getBundles, Manifest } from 'react-loadable/webpack'; + +const config: webpack.Configuration = { + plugins: [ + new ReactLoadablePlugin(), + new ReactLoadablePlugin({ + filename: 'react-loadable.json' + }) + ] +}; + +const manifest: Manifest = { + react: [ + { + id: 0, + name: "./node_modules/react/index.js", + file: "main.js" + } + ] +}; + +const manifestIds = ['react']; + +const bundles = getBundles(manifest, manifestIds); diff --git a/types/react-loadable/tsconfig.json b/types/react-loadable/tsconfig.json index 9d46ae0de9..a2ad20875b 100644 --- a/types/react-loadable/tsconfig.json +++ b/types/react-loadable/tsconfig.json @@ -19,8 +19,10 @@ }, "files": [ "index.d.ts", + "webpack.d.ts", "test/index.tsx", + "test/webpack.ts", "test/imports/no-default.tsx", "test/imports/with-default.tsx" ] -} \ No newline at end of file +} diff --git a/types/react-loadable/webpack.d.ts b/types/react-loadable/webpack.d.ts new file mode 100644 index 0000000000..0e67a1a0bd --- /dev/null +++ b/types/react-loadable/webpack.d.ts @@ -0,0 +1,23 @@ +import * as webpack from 'webpack'; + +export namespace ReactLoadablePlugin { + interface Options { + filename: string; + } +} + +export class ReactLoadablePlugin extends webpack.Plugin { + constructor(opts?: ReactLoadablePlugin.Options); +} + +export interface Bundle { + id: number; + name: string; + file: string; +} + +export interface Manifest { + [moduleId: string]: Bundle[]; +} + +export function getBundles(manifest: Manifest, moduleIds: string[]): Bundle[]; From 000e4a6c0fe2a9f5ce0cdd4bc5497fe0190edbd7 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Mon, 2 Apr 2018 10:45:50 +0530 Subject: [PATCH 0391/2153] typescript file changed --- types/ej.web.all/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/ej.web.all/index.d.ts b/types/ej.web.all/index.d.ts index 2342262ca6..837a7393cc 100644 --- a/types/ej.web.all/index.d.ts +++ b/types/ej.web.all/index.d.ts @@ -1,8 +1,8 @@ -// Type definitions for ej.web.all 16.1 +// Type definitions for ej.web.all 16.1 // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version:2.3 +// TypeScript Version: 2.3 /// From 9427fe3dc5160e939807ae2465c64fa227aac335 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 2 Apr 2018 00:08:52 -0700 Subject: [PATCH 0392/2153] Lint fixups --- types/jsoneditor-for-react/index.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/types/jsoneditor-for-react/index.d.ts b/types/jsoneditor-for-react/index.d.ts index 731820af30..707f03c63e 100644 --- a/types/jsoneditor-for-react/index.d.ts +++ b/types/jsoneditor-for-react/index.d.ts @@ -1,17 +1,17 @@ -// Type definitions for jsoneditor-for-react 0.0.1 +// Type definitions for jsoneditor-for-react 0.0 // Project: https://github.com/mixj93/jsoneditor-for-react#readme // Definitions by: JoshGoldberg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 -import * as React from "react" -import JSONEditor, { JSONEditorOptions } from "jsoneditor" +import * as React from "react"; +import JSONEditor, { JSONEditorOptions } from "jsoneditor"; -export interface IReactJsoneditorProps { - values: Object +export interface ReactJsonEditorProps { + values: {}; } -export default class ReactJsoneditor extends React.Component { - private editor?: JSONEditor - private options?: JSONEditorOptions +export default class ReactJsoneditor extends React.Component { + private editor?: JSONEditor; + private options?: JSONEditorOptions; } From d9669207882e61a6092f374963899f79406642e7 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 2 Apr 2018 18:24:03 +1000 Subject: [PATCH 0393/2153] Added mailgun js types Add tslint and fix tsconfig Add strictFunctionTypes Fix lint errors and other misc Mo fixes Trigger the build again :/ Fix typescript version placement Trying a ting declare and export MailgunExport from types Remove whitespace, add comma --- types/mailgun-js/index.d.ts | 167 +++++++++++++++++++++++++++ types/mailgun-js/mailgun-js-tests.ts | 32 +++++ types/mailgun-js/tsconfig.json | 16 +++ types/mailgun-js/tslint.json | 1 + 4 files changed, 216 insertions(+) create mode 100644 types/mailgun-js/index.d.ts create mode 100644 types/mailgun-js/mailgun-js-tests.ts create mode 100644 types/mailgun-js/tsconfig.json create mode 100644 types/mailgun-js/tslint.json diff --git a/types/mailgun-js/index.d.ts b/types/mailgun-js/index.d.ts new file mode 100644 index 0000000000..0ab5efcf45 --- /dev/null +++ b/types/mailgun-js/index.d.ts @@ -0,0 +1,167 @@ +// Type definitions for mailgun-js 0.16 +// Project: https://github.com/bojand/mailgun-js +// Definitions by: Sampson Oliver +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +declare const out: Mailgun.MailgunExport; +export = out; + +declare namespace Mailgun { + interface ConstructorParams { + apiKey: string; + publicApiKey?: string; + domain: string; + mute?: boolean; + timeout?: number; + host?: string; + endpoint?: string; + protocol?: string; + port?: number; + retry?: + | number + | { + times: number; + interval: number; + }; + proxy?: string; + } + + interface Error { + statusCode: number; + message: string; + } + + interface AttachmentParams { + data: string | Buffer | NodeJS.ReadWriteStream; + filename?: string; + knownLength?: number; + contentType?: string; + } + + class Attachment { + constructor(params: AttachmentParams); + data: string | Buffer | NodeJS.ReadWriteStream; + filename?: string; + knownLength?: number; + contentType?: string; + getType(): string; + } + + interface MailgunExport { + new (options: ConstructorParams): Mailgun; + (options: ConstructorParams): Mailgun; + } + + namespace messages { + interface SendData { + from?: string; + to: string | string[]; + cc?: string; + bcc?: string; + subject?: string; + text?: string; + html?: string; + attachment?: string | Buffer | NodeJS.ReadWriteStream | Attachment; + } + + interface BatchData extends SendData { + "recipient-variables"?: BatchSendRecipientVars; + } + + interface BatchSendRecipientVars { + [email: string]: { + first: string; + id: number; + }; + } + + interface SendResponse { + message: string; + id: string; + } + } + + namespace lists { + interface MemberCreateData { + subscribed: boolean; + address: string; + name: string; + vars?: object; + } + + interface MemberUpdateData { + subscribed: boolean; + name: string; + vars?: object; + } + + interface Members { + create( + data: MemberCreateData, + callback?: (err: Error, data: any) => void + ): Promise; + + add( + data: MemberCreateData[], + callback?: (err: Error, data: any) => void + ): Promise; + + list(callback?: (err: Error, data: any) => void): Promise; + } + + interface Member { + update( + data: MemberUpdateData, + callback?: (err: Error, data: any) => void + ): Promise; + } + } + + namespace validation { + interface ParseResponse { + parsed: string[]; + unparseable: string[]; + } + + interface ValidateResponse { + is_valid: boolean; + } + } + + interface Mailgun { + messages(): Messages; + lists(list: string): Lists; + Attachment: typeof Attachment; + validateWebhook( + bodyTimestamp: number, + bodyToken: string, + bodySignature: string + ): boolean; + + parse( + addressList: string[], + callback?: (error: Error, body: validation.ValidateResponse) => void + ): Promise; + + validate( + address: string, + callback?: (error: Error, body: validation.ValidateResponse) => void + ): Promise; + } + + interface Lists { + info(callback?: (error: Error, data: any) => void): Promise; + members(): lists.Members; + members(member: string): lists.Member; + } + + interface Messages { + send( + data: messages.SendData | messages.BatchData, + callback?: (error: Error, body: messages.SendResponse) => void + ): Promise; + } +} diff --git a/types/mailgun-js/mailgun-js-tests.ts b/types/mailgun-js/mailgun-js-tests.ts new file mode 100644 index 0000000000..dfbe8ab4a1 --- /dev/null +++ b/types/mailgun-js/mailgun-js-tests.ts @@ -0,0 +1,32 @@ +import * as mailgunFactory from "mailgun-js"; +import mailgunFactory2 = require('mailgun-js'); + +const mailgun = new mailgunFactory({ + apiKey: "auth.api_key", + domain: "auth.domain" +}); + +const mailgun2 = new mailgunFactory2({ + apiKey: "auth.api_key", + domain: "auth.domain" +}); + +mailgun.messages().send( + { + to: "fixture.message.to" + }, + err => { + console.log; + } +); + +mailgun.messages().send( + { + to: "someone@email.com", + attachment: new mailgun.Attachment({ + data: "filepath", + filename: "my_custom_name.png" + }) + }, + (err, body) => {} +); diff --git a/types/mailgun-js/tsconfig.json b/types/mailgun-js/tsconfig.json new file mode 100644 index 0000000000..b6a747659c --- /dev/null +++ b/types/mailgun-js/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": false, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "mailgun-js-tests.ts"] +} diff --git a/types/mailgun-js/tslint.json b/types/mailgun-js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mailgun-js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 5a3e0b2f34ea208b7355e75b048d159bfe5735b5 Mon Sep 17 00:00:00 2001 From: Joha2n Date: Mon, 2 Apr 2018 12:59:11 +0200 Subject: [PATCH 0394/2153] feat(react): add StrictMode definition (#24629) --- types/react/index.d.ts | 4 +++- types/react/test/tsx.tsx | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index c38f57b0a7..96c23cded3 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for React 16.1 +// Type definitions for React 16.3 // Project: http://facebook.github.io/react/ // Definitions by: Asana // AssureSign @@ -16,6 +16,7 @@ // Josh Rutherford // Guilherme Hübner // Josh Goldberg +// Johann Rakotoharisoa // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -268,6 +269,7 @@ declare namespace React { const Children: ReactChildren; const Fragment: ComponentType; + const StrictMode: ComponentType; const version: string; // diff --git a/types/react/test/tsx.tsx b/types/react/test/tsx.tsx index 7fa151fd29..a9ce5138de 100644 --- a/types/react/test/tsx.tsx +++ b/types/react/test/tsx.tsx @@ -89,6 +89,13 @@ const StatelessComponentWithoutProps: React.SFC = (props) => { ; +// Strict Mode +
    + +
    + +
    ; + // Below tests that setState() works properly for both regular and callback modes class SetStateTest extends React.Component<{}, { foo: boolean, bar: boolean }> { handleSomething = () => { From 9a50625d28bc22297c4c210bd8a3dce3cbd73511 Mon Sep 17 00:00:00 2001 From: Diogo Franco Date: Mon, 2 Apr 2018 22:59:49 +0900 Subject: [PATCH 0395/2153] Add new React 16.3 lifecycle events (#24577) * Add new lifecycle events to React (16.3) * Add tests, fix lint * Bump version * Improve inference of snapshot * Improve tests * Correctly support returning partial state from getDerivedStateFromProps * Remove redundant type * Fix lint error * Write the incorrect subclassing test in a more verbose way --- types/react/index.d.ts | 153 ++++++++++++++++++++++++++++++++------- types/react/test/tsx.tsx | 35 +++++++++ 2 files changed, 162 insertions(+), 26 deletions(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 96c23cded3..13faef3d01 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -280,7 +280,7 @@ declare namespace React { // Base component for plain JS classes // tslint:disable-next-line:no-empty-interface - interface Component

    extends ComponentLifecycle { } + interface Component

    extends ComponentLifecycle { } class Component { constructor(props: P, context?: any); @@ -333,7 +333,7 @@ declare namespace React { displayName?: string; } - interface ComponentClass

    { + interface ComponentClass

    extends StaticLifecycle { new (props: P, context?: any): Component; propTypes?: ValidationMap

    ; contextTypes?: ValidationMap; @@ -361,24 +361,14 @@ declare namespace React { // Component Specs and Lifecycle // ---------------------------------------------------------------------- - interface ComponentLifecycle { - /** - * Called immediately before mounting occurs, and before `Component#render`. - * Avoid introducing any side-effects or subscriptions in this method. - */ - componentWillMount?(): void; + // This should actually be something like `Lifecycle | DeprecatedLifecycle`, + // as React will _not_ call the deprecated lifecycle methods if any of the new lifecycle + // methods are present. + interface ComponentLifecycle extends NewLifecycle, DeprecatedLifecycle { /** * Called immediately after a compoment is mounted. Setting state here will trigger re-rendering. */ componentDidMount?(): void; - /** - * Called when the component may be receiving new props. - * React may call this even if props have not changed, so be sure to compare new and existing - * props if you only want to handle changes. - * - * Calling `Component#setState` generally does not trigger this method. - */ - componentWillReceiveProps?(nextProps: Readonly

    , nextContext: any): void; /** * Called to determine whether the change in props and state should trigger a re-render. * @@ -390,16 +380,6 @@ declare namespace React { * and `componentDidUpdate` will not be called. */ shouldComponentUpdate?(nextProps: Readonly

    , nextState: Readonly, nextContext: any): boolean; - /** - * Called immediately before rendering when new props or state is received. Not called for the initial render. - * - * Note: You cannot call `Component#setState` here. - */ - componentWillUpdate?(nextProps: Readonly

    , nextState: Readonly, nextContext: any): void; - /** - * Called immediately after updating occurs. Not called for the initial render. - */ - componentDidUpdate?(prevProps: Readonly

    , prevState: Readonly, prevContext: any): void; /** * Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as * cancelled network requests, or cleaning up any DOM elements created in `componentDidMount`. @@ -412,6 +392,127 @@ declare namespace React { componentDidCatch?(error: Error, errorInfo: ErrorInfo): void; } + // Unfortunately, we have no way of declaring that the component constructor must implement this + interface StaticLifecycle { + getDerivedStateFromProps?: GetDerivedStateFromProps; + } + + type GetDerivedStateFromProps = + /** + * Returns an update to a component's state based on its new props and old state. + * + * Note: its presence prevents any of the deprecated lifecycle methods from being invoked + */ + (nextProps: Readonly

    , prevState: Readonly) => Partial | null; + + // This should be "infer SS" but can't use it yet + interface NewLifecycle { + /** + * Runs before React applies the result of `render` to the document, and + * returns an object to be given to componentDidUpdate. Useful for saving + * things such as scroll position before `render` causes changes to it. + * + * Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated + * lifecycle events from running. + */ + getSnapshotBeforeUpdate?(prevProps: Readonly

    , prevState: Readonly): SS | null; + /** + * Called immediately after updating occurs. Not called for the initial render. + * + * The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null. + */ + componentDidUpdate?(prevProps: Readonly

    , prevState: Readonly, snapshot?: SS): void; + } + + interface DeprecatedLifecycle { + /** + * Called immediately before mounting occurs, and before `Component#render`. + * Avoid introducing any side-effects or subscriptions in this method. + * + * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps + * prevents this from being invoked. + * + * @deprecated 16.3, use componentDidMount or the constructor instead; will stop working in React 17 + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path + */ + componentWillMount?(): void; + /** + * Called immediately before mounting occurs, and before `Component#render`. + * Avoid introducing any side-effects or subscriptions in this method. + * + * This method will not stop working in React 17. + * + * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps + * prevents this from being invoked. + * + * @deprecated 16.3, use componentDidMount or the constructor instead + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path + */ + UNSAFE_componentWillMount?(): void; + /** + * Called when the component may be receiving new props. + * React may call this even if props have not changed, so be sure to compare new and existing + * props if you only want to handle changes. + * + * Calling `Component#setState` generally does not trigger this method. + * + * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps + * prevents this from being invoked. + * + * @deprecated 16.3, use static getDerivedStateFromProps instead; will stop working in React 17 + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path + */ + componentWillReceiveProps?(nextProps: Readonly

    , nextContext: any): void; + /** + * Called when the component may be receiving new props. + * React may call this even if props have not changed, so be sure to compare new and existing + * props if you only want to handle changes. + * + * Calling `Component#setState` generally does not trigger this method. + * + * This method will not stop working in React 17. + * + * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps + * prevents this from being invoked. + * + * @deprecated 16.3, use static getDerivedStateFromProps instead + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path + */ + UNSAFE_componentWillReceiveProps?(nextProps: Readonly

    , nextContext: any): void; + /** + * Called immediately before rendering when new props or state is received. Not called for the initial render. + * + * Note: You cannot call `Component#setState` here. + * + * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps + * prevents this from being invoked. + * + * @deprecated 16.3, use getSnapshotBeforeUpdate instead; will stop working in React 17 + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path + */ + componentWillUpdate?(nextProps: Readonly

    , nextState: Readonly, nextContext: any): void; + /** + * Called immediately before rendering when new props or state is received. Not called for the initial render. + * + * Note: You cannot call `Component#setState` here. + * + * This method will not stop working in React 17. + * + * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps + * prevents this from being invoked. + * + * @deprecated 16.3, use getSnapshotBeforeUpdate instead + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path + */ + UNSAFE_componentWillUpdate?(nextProps: Readonly

    , nextState: Readonly, nextContext: any): void; + } + interface Mixin extends ComponentLifecycle { mixins?: Array>; statics?: { diff --git a/types/react/test/tsx.tsx b/types/react/test/tsx.tsx index a9ce5138de..b086e35f9f 100644 --- a/types/react/test/tsx.tsx +++ b/types/react/test/tsx.tsx @@ -129,3 +129,38 @@ export abstract class SetStateTestForAndedState extends React.Component { + static getDerivedStateFromProps: React.GetDerivedStateFromProps = (nextProps) => { + return { bar: `${nextProps.foo}bar` }; + } + + getSnapshotBeforeUpdate(prevProps: Readonly) { + return { baz: `${prevProps.foo}baz` }; + } + + componentDidUpdate(prevProps: Readonly, prevState: Readonly, snapshot: { baz: string }) { + return; + } + + render() { + return this.state.bar; + } +} + +class ComponentWithLargeState extends React.Component<{}, Record<'a'|'b'|'c', string>> { + static getDerivedStateFromProps: React.GetDerivedStateFromProps<{}, Record<'a'|'b'|'c', string>> = () => { + return { a: 'a' }; + } +} + +const componentWithBadLifecycle = new (class extends React.Component<{}, {}, number> {})({}); +componentWithBadLifecycle.getSnapshotBeforeUpdate = () => { // $ExpectError + return 'number'; +}; +componentWithBadLifecycle.componentDidUpdate = (prevProps: {}, prevState: {}, snapshot?: string) => { // $ExpectError + return; +}; From 6a93d242b93d1e31d92755dbe53d30d99f1c7ed3 Mon Sep 17 00:00:00 2001 From: doomsower Date: Mon, 2 Apr 2018 18:17:24 +0300 Subject: [PATCH 0396/2153] Update set/getBucketPolicy definitions --- types/minio/index.d.ts | 11 +++++------ types/minio/minio-tests.ts | 14 ++++++++++---- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/types/minio/index.d.ts b/types/minio/index.d.ts index 7e920428ff..94d28cdd5a 100644 --- a/types/minio/index.d.ts +++ b/types/minio/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for minio 4.0 +// Type definitions for minio 5.0 // Project: https://github.com/minio/minio-js#readme // Definitions by: Barin Britva // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -11,7 +11,6 @@ import EventEmitter = NodeJS.EventEmitter; // Exports only from typings export type Region = 'us-east-1'|'us-west-1'|'us-west-2'|'eu-west-1'|'eu-central-1'|'ap-southeast-1'|'ap-northeast-1'|'ap-southeast-2'|'sa-east-1'|'cn-north-1'|string; -export type PolicyValue = 'none'|'readonly'|'writeonly'|'readwrite'; export type NoResultCallback = (error: Error|null) => void; export type ResultCallback = (error: Error|null, result: T) => void; @@ -158,11 +157,11 @@ export class Client { // todo #low Specify events listenBucketNotification(bucketName: string, prefix: string, suffix: string, events: string[]): EventEmitter; - getBucketPolicy(bucketName: string, objectPrefix: string, callback: ResultCallback): void; - getBucketPolicy(bucketName: string, objectPrefix: string): Promise; + getBucketPolicy(bucketName: string, callback: ResultCallback): void; + getBucketPolicy(bucketName: string): Promise; - setBucketPolicy(bucketName: string, objectPrefix: string, bucketPolice: PolicyValue, callback: NoResultCallback): void; - setBucketPolicy(bucketName: string, objectPrefix: string, bucketPolice: PolicyValue): Promise; + setBucketPolicy(bucketName: string, bucketPolicy: string, callback: NoResultCallback): void; + setBucketPolicy(bucketName: string, bucketPolicy: string): Promise; // Other newPostPolicy(): PostPolicy; diff --git a/types/minio/minio-tests.ts b/types/minio/minio-tests.ts index 78a7fab267..9307e68b20 100644 --- a/types/minio/minio-tests.ts +++ b/types/minio/minio-tests.ts @@ -106,8 +106,14 @@ minio.removeAllBucketNotification('testBucket'); minio.listenBucketNotification('testBucket', 'pref_', '_suf', [ Minio.ObjectCreatedAll ]); -minio.getBucketPolicy('testBucket', 'pref_', (error: Error|null, policy: Minio.PolicyValue) => { console.log(error, policy); }); -minio.getBucketPolicy('testBucket', ''); +minio.getBucketPolicy('testBucket', (error: Error|null, policy: string) => { console.log(error, policy); }); +minio.getBucketPolicy('testBucket'); -minio.setBucketPolicy('testBucket', '', Minio.Policy.READWRITE, (error: Error|null) => { console.log(error); }); -minio.setBucketPolicy('testBucket', 'pref_', Minio.Policy.WRITEONLY); +const testPolicy = `{"Version":"2012-10-17","Statement":[{"Action":["s3:GetBucketLocation"],"Effect":"Allow", +"Principal":{"AWS":["*"]},"Resource":["arn:aws:s3:::bucketName"],"Sid":""},{"Action":["s3:ListBucket"], +"Condition":{"StringEquals":{"s3:prefix":["foo","prefix/"]}},"Effect":"Allow","Principal":{"AWS":["*"]}, +"Resource":["arn:aws:s3:::bucketName"],"Sid":""},{"Action":["s3:GetObject"],"Effect":"Allow", +"Principal":{"AWS":["*"]},"Resource":["arn:aws:s3:::bucketName/foo*","arn:aws:s3:::bucketName/prefix/*"],"Sid":""}]} +`; +minio.setBucketPolicy('testBucket', testPolicy, (error: Error|null) => { console.log(error); }); +minio.setBucketPolicy('testBucket', testPolicy); From 86eb0fa035a3ce4529c78eda782ed9886c8b0c2f Mon Sep 17 00:00:00 2001 From: doomsower Date: Mon, 2 Apr 2018 18:24:55 +0300 Subject: [PATCH 0397/2153] Also update bucketExists --- types/minio/index.d.ts | 4 ++-- types/minio/minio-tests.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/minio/index.d.ts b/types/minio/index.d.ts index 94d28cdd5a..2dda500396 100644 --- a/types/minio/index.d.ts +++ b/types/minio/index.d.ts @@ -84,8 +84,8 @@ export class Client { listBuckets(callback: ResultCallback): void; listBuckets(): Promise; - bucketExists(bucketName: string, callback: NoResultCallback): void; - bucketExists(bucketName: string): Promise; + bucketExists(bucketName: string, callback: ResultCallback): void; + bucketExists(bucketName: string): Promise; removeBucket(bucketName: string, callback: NoResultCallback): void; removeBucket(bucketName: string): Promise; diff --git a/types/minio/minio-tests.ts b/types/minio/minio-tests.ts index 9307e68b20..05f8283d32 100644 --- a/types/minio/minio-tests.ts +++ b/types/minio/minio-tests.ts @@ -16,7 +16,7 @@ minio.makeBucket('testBucket', 'region-not-from-list'); minio.listBuckets((error: Error|null, bucketList: Minio.BucketItemFromList[]) => { console.log(error, bucketList); }); minio.listBuckets(); -minio.bucketExists('testBucket', (error: Error|null) => { console.log(error); }); +minio.bucketExists('testBucket', (error: Error|null, exists: boolean) => { console.log(error, exists); }); minio.bucketExists('testBucket'); minio.removeBucket('testBucket', (error: Error|null) => { console.log(error); }); From 781b4af34b7d3a0f0e7847c773dc8ed72ef23170 Mon Sep 17 00:00:00 2001 From: Ian Mobley Date: Mon, 2 Apr 2018 09:06:19 -0700 Subject: [PATCH 0398/2153] Convert to match commonJS export syntax. I'm not entirely sure how to get the interfaces to export as well, but they're not really necessary beside for checking sanity of arguments. --- types/react-loadable/test/webpack.ts | 4 +-- types/react-loadable/webpack.d.ts | 39 ++++++++++++++++------------ 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/types/react-loadable/test/webpack.ts b/types/react-loadable/test/webpack.ts index 089994a23d..741d0d4733 100644 --- a/types/react-loadable/test/webpack.ts +++ b/types/react-loadable/test/webpack.ts @@ -1,5 +1,5 @@ import * as webpack from 'webpack'; -import { ReactLoadablePlugin, getBundles, Manifest } from 'react-loadable/webpack'; +import { ReactLoadablePlugin, getBundles } from 'react-loadable/webpack'; const config: webpack.Configuration = { plugins: [ @@ -10,7 +10,7 @@ const config: webpack.Configuration = { ] }; -const manifest: Manifest = { +const manifest = { react: [ { id: 0, diff --git a/types/react-loadable/webpack.d.ts b/types/react-loadable/webpack.d.ts index 0e67a1a0bd..54732527d8 100644 --- a/types/react-loadable/webpack.d.ts +++ b/types/react-loadable/webpack.d.ts @@ -1,23 +1,30 @@ -import * as webpack from 'webpack'; +import webpack = require("webpack"); -export namespace ReactLoadablePlugin { +declare namespace LoadableExport { interface Options { filename: string; } + + class ReactLoadablePlugin extends webpack.Plugin { + constructor(opts?: Options); + } + + interface Bundle { + id: number; + name: string; + file: string; + } + + interface Manifest { + [moduleId: string]: Bundle[]; + } + + function getBundles(manifest: Manifest, moduleIds: string[]): Bundle[]; } -export class ReactLoadablePlugin extends webpack.Plugin { - constructor(opts?: ReactLoadablePlugin.Options); -} +declare const exports: { + getBundles: typeof LoadableExport.getBundles; + ReactLoadablePlugin: typeof LoadableExport.ReactLoadablePlugin; +}; -export interface Bundle { - id: number; - name: string; - file: string; -} - -export interface Manifest { - [moduleId: string]: Bundle[]; -} - -export function getBundles(manifest: Manifest, moduleIds: string[]): Bundle[]; +export = exports; From fac20c19ebeb6961ed9269371469546b44fe243d Mon Sep 17 00:00:00 2001 From: Ian Mobley Date: Mon, 2 Apr 2018 10:10:57 -0700 Subject: [PATCH 0399/2153] quotes consistency --- types/react-loadable/test/webpack.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-loadable/test/webpack.ts b/types/react-loadable/test/webpack.ts index 741d0d4733..08885e418d 100644 --- a/types/react-loadable/test/webpack.ts +++ b/types/react-loadable/test/webpack.ts @@ -14,8 +14,8 @@ const manifest = { react: [ { id: 0, - name: "./node_modules/react/index.js", - file: "main.js" + name: './node_modules/react/index.js', + file: 'main.js' } ] }; From 40c185efab5f4ced5618490ece7dcdc79c8dc9e2 Mon Sep 17 00:00:00 2001 From: Emily Marigold Klassen Date: Mon, 2 Apr 2018 10:57:37 -0700 Subject: [PATCH 0400/2153] fix(dotenv): add missing "load" alias --- types/dotenv/dotenv-tests.ts | 2 ++ types/dotenv/index.d.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/types/dotenv/dotenv-tests.ts b/types/dotenv/dotenv-tests.ts index df05475c17..613da3b056 100644 --- a/types/dotenv/dotenv-tests.ts +++ b/types/dotenv/dotenv-tests.ts @@ -11,6 +11,8 @@ dotenv.config({ encoding: 'utf8' }); +dotenv.load(); + const parsed = dotenv.parse("ENVIRONMENT=production\nDEBUG=no\n"); const debug: string = parsed['DEBUG']; diff --git a/types/dotenv/index.d.ts b/types/dotenv/index.d.ts index 831790138c..4dd67b15c0 100644 --- a/types/dotenv/index.d.ts +++ b/types/dotenv/index.d.ts @@ -20,6 +20,7 @@ export function parse(src: string | Buffer): {[name: string]: string}; * Example: 'KEY=value' becomes { parsed: { KEY: 'value' } } */ export function config(options?: DotenvOptions): DotenvResult; +export const load: typeof config; export interface DotenvOptions { /** From 687e0c7a6d773db323d07196cbf50e7de2190825 Mon Sep 17 00:00:00 2001 From: Kerrick Long Date: Mon, 2 Apr 2018 14:32:55 -0500 Subject: [PATCH 0401/2153] fix(react-captcha): Add missing execute method Added in https://github.com/appleboy/react-recaptcha/pull/207 --- types/react-recaptcha/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react-recaptcha/index.d.ts b/types/react-recaptcha/index.d.ts index ecfd0db003..595cc1916e 100644 --- a/types/react-recaptcha/index.d.ts +++ b/types/react-recaptcha/index.d.ts @@ -34,4 +34,5 @@ declare class Recaptcha extends Component { static propTypes: any; static defaultProps: Recaptcha.RecaptchaProps; reset(): void; + execute(): void; } From ce01a4e456fb0f9530d833b8626ed285478909f0 Mon Sep 17 00:00:00 2001 From: Mohsen Azimi Date: Mon, 2 Apr 2018 17:47:15 -0700 Subject: [PATCH 0402/2153] Make stratgey an exported class --- types/passport/index.d.ts | 16 ++++++++-------- types/passport/passport-tests.ts | 12 ++++++++---- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/types/passport/index.d.ts b/types/passport/index.d.ts index 06c7f0b9db..cee220e901 100644 --- a/types/passport/index.d.ts +++ b/types/passport/index.d.ts @@ -5,6 +5,7 @@ // Igor Belagorudsky // Tomek Łaziuk // Daniel Perez Alvarez +// Mohsen Azimi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -75,12 +76,15 @@ declare namespace passport { Passport: PassportStatic["Authenticator"]; } - interface Strategy { + /** + * @param T Strategy option config + */ + export abstract class Strategy { name?: string; - authenticate(this: StrategyCreated, req: express.Request, options?: any): any; - } - interface StrategyCreatedStatic { + /** This method must be implemented by the subclass */ + abstract authenticate(req: express.Request, options?: T): any; + /** * Authenticate `user`, with optional `info`. * @@ -124,10 +128,6 @@ declare namespace passport { error(err: any): void; } - type StrategyCreated = { - [P in keyof O]: O[P]; - }; - interface Profile { provider: string; id: string; diff --git a/types/passport/passport-tests.ts b/types/passport/passport-tests.ts index 630091afc7..f7d988c56c 100644 --- a/types/passport/passport-tests.ts +++ b/types/passport/passport-tests.ts @@ -2,14 +2,18 @@ import * as passport from 'passport'; import express = require('express'); import 'express-session'; -class TestStrategy implements passport.Strategy { +class TestStrategy extends passport.Strategy { name = 'test'; - constructor() { } - authenticate(this: passport.StrategyCreated, req: express.Request) { + + authenticate(req: express.Request) { const user: TestUser = { id: 0, }; - this.success(user); + if (Math.random() > 0.5) { + this.fail(); + } else { + this.success(user); + } } } From 57de6ba750615bf1d723ae45403996ec6a7f38f0 Mon Sep 17 00:00:00 2001 From: Mohsen Azimi Date: Mon, 2 Apr 2018 18:16:51 -0700 Subject: [PATCH 0403/2153] extend --- types/passport-anonymous/index.d.ts | 4 ++-- types/passport-beam/index.d.ts | 4 ++-- types/passport-discord/index.d.ts | 4 ++-- types/passport-facebook/index.d.ts | 4 ++-- types/passport-github/index.d.ts | 4 ++-- types/passport-github2/index.d.ts | 4 ++-- types/passport-google-oauth/index.d.ts | 4 ++-- types/passport-http-bearer/index.d.ts | 4 ++-- types/passport-http/index.d.ts | 8 ++++---- types/passport-kakao/index.d.ts | 4 ++-- types/passport-oauth2/index.d.ts | 2 +- types/passport-saml/index.d.ts | 2 +- types/passport-twitter/index.d.ts | 4 ++-- types/passport-unique-token/index.d.ts | 4 ++-- 14 files changed, 28 insertions(+), 28 deletions(-) diff --git a/types/passport-anonymous/index.d.ts b/types/passport-anonymous/index.d.ts index 6e45ed3a23..969f158526 100644 --- a/types/passport-anonymous/index.d.ts +++ b/types/passport-anonymous/index.d.ts @@ -6,6 +6,6 @@ import * as passport from "passport"; -export class Strategy implements passport.Strategy { - authenticate: () => void; +export class Strategy extends passport.Strategy { + authenticate(): void; } diff --git a/types/passport-beam/index.d.ts b/types/passport-beam/index.d.ts index 6d7d1de430..65096a9bd6 100644 --- a/types/passport-beam/index.d.ts +++ b/types/passport-beam/index.d.ts @@ -10,10 +10,10 @@ import * as passport from 'passport'; import * as express from 'express'; -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: Strategy.IStrategyOption, verify: (accessToken: string, refreshToken: string, profile: Strategy.Profile, done: (error: any, user?: any) => void) => void); name: string; - authenticate: (req: express.Request, options?: Object) => void; + authenticate(req: express.Request, options?: Object): void; } export namespace Strategy { diff --git a/types/passport-discord/index.d.ts b/types/passport-discord/index.d.ts index 66b9474a2d..70553a25cd 100644 --- a/types/passport-discord/index.d.ts +++ b/types/passport-discord/index.d.ts @@ -8,10 +8,10 @@ import * as passport from 'passport'; import * as express from 'express'; -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: Strategy.StrategyOption, verify: (accessToken: string, refreshToken: string, profile: Strategy.Profile, done: (error: any, user?: any) => void) => void); name: string; - authenticate: (req: express.Request, options?: object) => void; + authenticate(req: express.Request, options?: object): void; authorizationParams(options: any): any; diff --git a/types/passport-facebook/index.d.ts b/types/passport-facebook/index.d.ts index 5d20f0d39c..89ce91b093 100644 --- a/types/passport-facebook/index.d.ts +++ b/types/passport-facebook/index.d.ts @@ -47,10 +47,10 @@ export type VerifyFunction = export type VerifyFunctionWithRequest = (req: express.Request, accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void; -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: StrategyOptionWithRequest, verify: VerifyFunctionWithRequest); constructor(options: StrategyOption, verify: VerifyFunction); name: string; - authenticate: (req: express.Request, options?: object) => void; + authenticate(req: express.Request, options?: object): void; } diff --git a/types/passport-github/index.d.ts b/types/passport-github/index.d.ts index c4a253016f..99c84bd391 100644 --- a/types/passport-github/index.d.ts +++ b/types/passport-github/index.d.ts @@ -26,10 +26,10 @@ export interface StrategyOption { userProfileURL?: string; } -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: StrategyOption, verify: (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void); userProfile: (accessToken: string, done?: (error: any, profile: Profile) => void) => void; name: string; - authenticate: (req: express.Request, options?: passport.AuthenticateOptions) => void; + authenticate(req: express.Request, options?: passport.AuthenticateOptions): void; } diff --git a/types/passport-github2/index.d.ts b/types/passport-github2/index.d.ts index b0310a6f3b..902bcea6e0 100644 --- a/types/passport-github2/index.d.ts +++ b/types/passport-github2/index.d.ts @@ -28,10 +28,10 @@ export interface StrategyOption { userProfileURL?: string; } -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: StrategyOption, verify: (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void); userProfile: (accessToken: string, done?: (error: any, profile: Profile) => void) => void; name: string; - authenticate: (req: express.Request, options?: passport.AuthenticateOptions) => void; + authenticate(req: express.Request, options?: passport.AuthenticateOptions): void; } diff --git a/types/passport-google-oauth/index.d.ts b/types/passport-google-oauth/index.d.ts index a56c91e73f..8b45504cb2 100644 --- a/types/passport-google-oauth/index.d.ts +++ b/types/passport-google-oauth/index.d.ts @@ -33,7 +33,7 @@ interface VerifyFunction { (error: any, user?: any, msg?: VerifyOptions): void; } -declare class OAuthStrategy implements passport.Strategy { +declare class OAuthStrategy extends passport.Strategy { constructor( options: IOAuthStrategyOption, verify: ( @@ -44,7 +44,7 @@ declare class OAuthStrategy implements passport.Strategy { ) => void ); name: string; - authenticate: (req: express.Request, options?: Object) => void; + authenticate(req: express.Request, options?: Object): void; } interface IOAuth2StrategyOption { diff --git a/types/passport-http-bearer/index.d.ts b/types/passport-http-bearer/index.d.ts index 698b0bfed5..58da308106 100644 --- a/types/passport-http-bearer/index.d.ts +++ b/types/passport-http-bearer/index.d.ts @@ -28,11 +28,11 @@ interface VerifyFunctionWithRequest { (req: express.Request, token: string, done: (error: any, user?: any, options?: IVerifyOptions | string) => void): void; } -declare class Strategy implements passport.Strategy { +declare class Strategy extends passport.Strategy { constructor(verify: VerifyFunction); constructor(options: IStrategyOptions, verify: VerifyFunction); constructor(options: IStrategyOptions, verify: VerifyFunctionWithRequest); name: string; - authenticate: (req: express.Request, options?: Object) => void; + authenticate(req: express.Request, options?: Object): void; } diff --git a/types/passport-http/index.d.ts b/types/passport-http/index.d.ts index fa3f968e7e..63527b6225 100644 --- a/types/passport-http/index.d.ts +++ b/types/passport-http/index.d.ts @@ -52,19 +52,19 @@ export type DigestValidateFunction = ( done: (error: any, valid: boolean) => void, ) => any; -export class BasicStrategy implements passport.Strategy { +export class BasicStrategy extends passport.Strategy { constructor(verify: BasicVerifyFunction); constructor(options: BasicStrategyOptions, verify: BasicVerifyFunction); constructor(options: BasicStrategyOptions, verify: BasicVerifyFunctionWithRequest); name: string; - authenticate: (req: express.Request, options?: object) => void; + authenticate(req: express.Request, options?: object): void; } -export class DigestStrategy implements passport.Strategy { +export class DigestStrategy extends passport.Strategy { constructor(secret: DigestSecretFunction, validate?: DigestValidateFunction); constructor(options: DigestStrategyOptions, secret: DigestSecretFunction, validate?: DigestValidateFunction); name: string; - authenticate: (req: express.Request, options?: object) => void; + authenticate(req: express.Request, options?: object): void; } diff --git a/types/passport-kakao/index.d.ts b/types/passport-kakao/index.d.ts index d99f608ab7..b005b45d98 100644 --- a/types/passport-kakao/index.d.ts +++ b/types/passport-kakao/index.d.ts @@ -27,9 +27,9 @@ export interface StrategyOption { export type VerifyFunction = (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void; -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: StrategyOption, verify: VerifyFunction); - authenticate: (req: express.Request, options?: any) => void; + authenticate(req: express.Request, options?: any): void; userProfile: (accessToken: string, done: (error: any, user?: any) => void) => void; } diff --git a/types/passport-oauth2/index.d.ts b/types/passport-oauth2/index.d.ts index 09facb2ef7..5dd811f342 100644 --- a/types/passport-oauth2/index.d.ts +++ b/types/passport-oauth2/index.d.ts @@ -7,7 +7,7 @@ import { Request } from 'express'; import { Strategy } from 'passport'; -declare class OAuth2Strategy implements Strategy { +declare class OAuth2Strategy extends Strategy { name: string; constructor(options: OAuth2Strategy.StrategyOptions, verify: OAuth2Strategy.VerifyFunction); diff --git a/types/passport-saml/index.d.ts b/types/passport-saml/index.d.ts index e93869ca87..5e24211008 100644 --- a/types/passport-saml/index.d.ts +++ b/types/passport-saml/index.d.ts @@ -24,7 +24,7 @@ export type VerifyWithRequest = (req: express.Request, profile: {}, done: Verifi export type VerifyWithoutRequest = (profile: {}, done: VerifiedCallback) => void; -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(config: SamlConfig, verify: VerifyWithRequest | VerifyWithoutRequest); authenticate(req: express.Request, options: AuthenticateOptions | AuthorizeOptions): void; logout(req: express.Request, callback: (err: Error | null, url: string) => void): void; diff --git a/types/passport-twitter/index.d.ts b/types/passport-twitter/index.d.ts index fe341a4b5b..ae8f192d79 100644 --- a/types/passport-twitter/index.d.ts +++ b/types/passport-twitter/index.d.ts @@ -44,12 +44,12 @@ interface IStrategyOptionWithRequest extends IStrategyOptionBase { passReqToCallback: true; } -declare class Strategy implements passport.Strategy { +declare class Strategy extends passport.Strategy { constructor(options: IStrategyOption, verify: (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void); constructor(options: IStrategyOptionWithRequest, verify: (req: express.Request, accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void); name: string; - authenticate: (req: express.Request, options?: Object) => void; + authenticate(req: express.Request, options?: Object): void; } diff --git a/types/passport-unique-token/index.d.ts b/types/passport-unique-token/index.d.ts index 081a85b29d..66887cdcde 100644 --- a/types/passport-unique-token/index.d.ts +++ b/types/passport-unique-token/index.d.ts @@ -33,11 +33,11 @@ export interface VerifyOptions { export type VerifyFunctionWithRequest = (req: express.Request, token: string, done: (error: any, user?: any, options?: VerifyOptions) => void) => void; export type VerifyFunction = (token: string, done: (error: any, user?: any, options?: VerifyOptions) => void) => void; -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: StrategyOptionsWithRequest, verify: VerifyFunctionWithRequest); constructor(options: StrategyOptions, verify: VerifyFunction); constructor(verify: VerifyFunction); name: string; - authenticate: (req: express.Request, options?: object) => void; + authenticate(req: express.Request, options?: object): void; } From f57ff453de489853e8e37a644ff1fa6d0c6907e9 Mon Sep 17 00:00:00 2001 From: Michael Dombrowski Date: Mon, 2 Apr 2018 21:25:27 -0400 Subject: [PATCH 0404/2153] Allow Edge arrows from to be left out of edge options network.setOptions({edges: {arrows: {to: true}}}); should be accepted since it works properly in vis, but previous @types/vis will fail type-checking. --- types/vis/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/vis/index.d.ts b/types/vis/index.d.ts index c0b33b27aa..44ab171de4 100644 --- a/types/vis/index.d.ts +++ b/types/vis/index.d.ts @@ -1861,7 +1861,7 @@ export interface EdgeOptions { enabled?: boolean, scaleFactor?: number, }, - from: boolean | { + from?: boolean | { enabled?: boolean, scaleFactor?: number, } From d1713bc84226d2a3656e609c2c351fb04cf9b747 Mon Sep 17 00:00:00 2001 From: Ian Mobley Date: Mon, 2 Apr 2018 19:27:04 -0700 Subject: [PATCH 0405/2153] Convert react-loadable/webpack test to commonJS It doesn't look like destructuring will work when using require. --- types/react-loadable/test/webpack.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/types/react-loadable/test/webpack.ts b/types/react-loadable/test/webpack.ts index 08885e418d..5549dfdc4e 100644 --- a/types/react-loadable/test/webpack.ts +++ b/types/react-loadable/test/webpack.ts @@ -1,11 +1,10 @@ -import * as webpack from 'webpack'; -import { ReactLoadablePlugin, getBundles } from 'react-loadable/webpack'; +import webpack = require('webpack'); +import Loadable = require('react-loadable/webpack'); const config: webpack.Configuration = { plugins: [ - new ReactLoadablePlugin(), - new ReactLoadablePlugin({ - filename: 'react-loadable.json' + new Loadable.ReactLoadablePlugin(), + new Loadable.ReactLoadablePlugin({ filename: 'react-loadable.json' }) ] }; @@ -22,4 +21,4 @@ const manifest = { const manifestIds = ['react']; -const bundles = getBundles(manifest, manifestIds); +const bundles = Loadable.getBundles(manifest, manifestIds); From 563f5321c0e5c63a69f022884727785835762955 Mon Sep 17 00:00:00 2001 From: Tim Wang Date: Tue, 3 Apr 2018 10:36:12 +0800 Subject: [PATCH 0406/2153] Add hasIcon static method --- types/react-native-vector-icons/Icon.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/react-native-vector-icons/Icon.d.ts b/types/react-native-vector-icons/Icon.d.ts index 98bda708b3..4b64503452 100644 --- a/types/react-native-vector-icons/Icon.d.ts +++ b/types/react-native-vector-icons/Icon.d.ts @@ -157,6 +157,9 @@ export class Icon extends React.Component { static loadFont( file?: string ): Promise; + static hasIcon( + name: string, + ): boolean; } export namespace Icon { From 1130d0942b48fea245cd8bd630b01e87c0e79442 Mon Sep 17 00:00:00 2001 From: Tim Wang Date: Tue, 3 Apr 2018 10:37:36 +0800 Subject: [PATCH 0407/2153] Bump version --- types/react-native-vector-icons/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native-vector-icons/index.d.ts b/types/react-native-vector-icons/index.d.ts index 05a140e3bb..2a2ef8fdce 100644 --- a/types/react-native-vector-icons/index.d.ts +++ b/types/react-native-vector-icons/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-native-vector-icons 4.4 +// Type definitions for react-native-vector-icons 4.6 // Project: https://github.com/oblador/react-native-vector-icons // Definitions by: Kyle Roach // Tim Wang From adb4937be9078febc05980a7d96c2f81a5de2e5a Mon Sep 17 00:00:00 2001 From: Ian Mobley Date: Mon, 2 Apr 2018 19:42:46 -0700 Subject: [PATCH 0408/2153] move filename back to newline --- types/react-loadable/test/webpack.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/react-loadable/test/webpack.ts b/types/react-loadable/test/webpack.ts index 5549dfdc4e..ecfa79cd53 100644 --- a/types/react-loadable/test/webpack.ts +++ b/types/react-loadable/test/webpack.ts @@ -4,7 +4,8 @@ import Loadable = require('react-loadable/webpack'); const config: webpack.Configuration = { plugins: [ new Loadable.ReactLoadablePlugin(), - new Loadable.ReactLoadablePlugin({ filename: 'react-loadable.json' + new Loadable.ReactLoadablePlugin({ + filename: 'react-loadable.json' }) ] }; From 2de350fc9abb352e9f840ae8797baaa2441b47a8 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Tue, 3 Apr 2018 11:24:54 +0530 Subject: [PATCH 0409/2153] BOM error fixed --- types/ej.web.all/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/ej.web.all/index.d.ts b/types/ej.web.all/index.d.ts index 837a7393cc..e95fb94b2b 100644 --- a/types/ej.web.all/index.d.ts +++ b/types/ej.web.all/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ej.web.all 16.1 +// Type definitions for ej.web.all 16.1 // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 50a74277a6158ca9663ffaaad42f7a264ffe9bd7 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Tue, 3 Apr 2018 11:55:43 +0530 Subject: [PATCH 0410/2153] Lint Error Fixed --- types/ej.web.all/ej.web.all-tests.ts | 1352 +++++++++++++------------- 1 file changed, 676 insertions(+), 676 deletions(-) diff --git a/types/ej.web.all/ej.web.all-tests.ts b/types/ej.web.all/ej.web.all-tests.ts index ddfdc39876..83ed128742 100644 --- a/types/ej.web.all/ej.web.all-tests.ts +++ b/types/ej.web.all/ej.web.all-tests.ts @@ -1,7 +1,3 @@ -/* tslint:disable */ - - - module AccordionComponent { $(function () { var sample = new ej.Accordion($("#basicAccordion"), { @@ -22,39 +18,39 @@ module AccordionComponent { }); } - -module AutocompleteComponent{ + +module AutocompleteComponent { var carList = [ - "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", - "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", - "Chevrolet Camaro", "Cadillac", - "Duesenberg J", "Dodge Sprinter", - "Elantra", "Excavator", - "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", - "GAZ Siber", - "Honda S2000", "Hyundai Santro", - "Isuzu Swift", "Infiniti Skyline", - "Jaguar XJS", - "Kia Sedona EX", "Koenigsegg Agera", - "Lotus Esprit", "Lamborghini Diablo", - "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", - "Nissan Qashqai", - "Oldsmobile S98", "Opel Superboss", - "Porsche 356", "Pontiac Sunbird", - "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", - "Triumph Spitfire", "Toyota 2000GT", - "Volvo P1800", "Volkswagen Shirako" - ]; - $(function () { - var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { + "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", + "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", + "Chevrolet Camaro", "Cadillac", + "Duesenberg J", "Dodge Sprinter", + "Elantra", "Excavator", + "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", + "GAZ Siber", + "Honda S2000", "Hyundai Santro", + "Isuzu Swift", "Infiniti Skyline", + "Jaguar XJS", + "Kia Sedona EX", "Koenigsegg Agera", + "Lotus Esprit", "Lamborghini Diablo", + "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", + "Nissan Qashqai", + "Oldsmobile S98", "Opel Superboss", + "Porsche 356", "Pontiac Sunbird", + "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", + "Triumph Spitfire", "Toyota 2000GT", + "Volvo P1800", "Volkswagen Shirako" + ]; + $(function () { + var autocompleteInstance = new ej.Autocomplete($("#selectCar"), { width: "100%", watermarkText: "Select a car", dataSource: carList, enableAutoFill: true, showPopupButton: true, multiSelectMode: "delimiter" - }); + }); }); } @@ -197,12 +193,12 @@ module ChartComponent { range: { min: 25, max: 50, interval: 5 }, labelFormat: "{value}%", title: { text: "Efficiency" }, - + }, commonSeriesOptions: - { + { type: 'line', enableAnimation: true, - tooltip:{ visible :true, template:'Tooltip'}, + tooltip: { visible: true, template: 'Tooltip' }, marker: { shape: 'circle', @@ -212,30 +208,30 @@ module ChartComponent { }, visible: true }, - border : {width: 2} - }, - series: - [ - { - points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, - { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], - name: 'India' - }, + border: { width: 2 } + }, + series: + [ { - points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, - { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], - name: 'Germany' + points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 }, { x: 2007, y: 26 }, { x: 2008, y: 27 }, + { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], + name: 'India' }, - { - points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, - { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], - name: 'England' - }, { - points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, - { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], - name: 'France' - } + points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 }, { x: 2007, y: 30 }, { x: 2008, y: 36 }, + { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], + name: 'Germany' + }, + { + points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 }, { x: 2007, y: 34 }, { x: 2008, y: 41 }, + { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], + name: 'England' + }, + { + points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 }, { x: 2007, y: 40 }, { x: 2008, y: 44 }, + { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], + name: 'France' + } ], isResponsive: true, load: function () { @@ -300,14 +296,14 @@ module ChartComponent { theme = "flatlight"; break; } - sender.model.theme = theme; + sender.model.theme = theme; } }, title: { text: 'Efficiency of oil-fired power production' }, size: { height: "600" }, - legend: { visible: true}, + legend: { visible: true }, }); - // chartsample.model.load="loadTheme"; + // chartsample.model.load="loadTheme"; }); } @@ -361,7 +357,7 @@ module circulargaugecomponent { backgroundColor: "#f5b43f", border: { color: "#f5b43f" } }] - }] + }] }); }); } @@ -380,21 +376,21 @@ module ColorPickerComponent { -module ComboBoxComponent{ +module ComboBoxComponent { var BikeList = [ { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, { empid: "bk4", text: "Discover" }, { empid: "bk5", text: "Dazzler" }, { empid: "bk6", text: "Flame" }, { empid: "bk7", text: "Fazzer" }, { empid: "bk8", text: "FZ-S" }, { empid: "bk9", text: "Pulsar" }, { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } ]; - $(function () { - var comboboxInstance =new ej.ComboBox($("#selectCar"), { + $(function () { + var comboboxInstance = new ej.ComboBox($("#selectCar"), { width: "100%", placeholder: "Select a Bike", - fields: { text: "text", value: "empid" }, + fields: { text: "text", value: "empid" }, dataSource: BikeList, autofill: true - }); + }); }); } @@ -466,7 +462,8 @@ $(function () { }), createNode({ name: "Project", width: 150, height: 100, offsetX: 300, offsetY: 430, labels: [createLabel({ "text": "Find Project \nmanager" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Decision }), createNode({ - name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), + name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process + }), createNode({ name: "Decision", width: 250, height: 60, offsetX: 550, offsetY: 60, labels: [createLabel({ "text": "Decision Process for new software ideas" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Card, fillColor: "#858585", borderColor: "#858585" }), createNode({ name: "Reject", width: 150, height: 60, offsetX: 550, offsetY: 285, labels: [createLabel({ "text": "Reject and write report" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), createNode({ name: "Resources", width: 150, height: 60, offsetX: 550, offsetY: 430, labels: [createLabel({ "text": "Hire new resources" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }) @@ -480,7 +477,7 @@ $(function () { createConnector({ name: "connector6", sourceNode: "Project", targetNode: "Resources", labels: [createLabel({ "text": "No" })] }) ] }); - + }); function createNode(option: ej.datavisualization.Diagram.Node) { @@ -501,11 +498,11 @@ function createConnector(option: ej.datavisualization.Diagram.Connector) { return option; } -function createLabel(options : any) { +function createLabel(options: any) { return options; } - + module DialogComponent { $(function () { @@ -513,15 +510,17 @@ module DialogComponent { width: 550, minWidth: 310, minHeight: 215, - target:".control", - close:()=>{ - $("#btnOpen").show();} + target: ".control", + close: () => { + $("#btnOpen").show(); + } }); var btnInstance = new ej.Button($("#btnOpen"), { size: "medium", - click: ()=>{ - $("#btnOpen").hide(); - $("#basicDialog").ejDialog("open");}, + click: () => { + $("#btnOpen").hide(); + $("#basicDialog").ejDialog("open"); + }, type: "button", height: 30, width: 150 @@ -555,7 +554,7 @@ module digitalgaugecomponent { } - + @@ -567,7 +566,7 @@ module DropDownListComponent { { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } ]; $(function () { - var sample = new ej.DropDownList($("#bikeList"),{ + var sample = new ej.DropDownList($("#bikeList"), { dataSource: BikeList, width: "100%", watermarkText: "Select a bike", @@ -575,12 +574,12 @@ module DropDownListComponent { enableFilterSearch: true, caseSensitiveSearch: true, enableIncrementalSearch: true, - enablePopupResize: true, + enablePopupResize: true, delimiterChar: ";", multiSelectMode: ej.MultiSelectMode.Delimiter, maxPopupHeight: "300px", - minPopupHeight: "150px", - maxPopupWidth: "500px", + minPopupHeight: "150px", + maxPopupWidth: "500px", minPopupWidth: "350px", showCheckbox: true, showRoundedCorner: true @@ -611,53 +610,53 @@ module ExplorerComponent { module GanttComponent { - $(function () { - var ganttInstance = new ej.Gantt($("#GanttContainer"), { - dataSource: (window).projectData, - allowColumnResize: true, - allowSorting: true, - allowSelection: true, - enableContextMenu: true, - taskIdMapping: "taskID", - allowDragAndDrop: true, - taskNameMapping: "taskName", - startDateMapping: "startDate", - showColumnChooser: true, - showColumnOptions: true, - progressMapping: "progress", - durationMapping: "duration", - endDateMapping: "endDate", - childMapping: "subtasks", - scheduleStartDate: "02/01/2017", - scheduleEndDate: "04/09/2017", - //Resources mapping - resourceInfoMapping: "resourceId", - resourceNameMapping: "resourceName", - resourceIdMapping: "resourceId", - resources: (window).projectResources, - predecessorMapping: "predecessor", - showResourceNames: true, - toolbarSettings: { - showToolbar: true, - toolbarItems: ["add","edit","delete","update","cancel","indent","outdent","expandAll","collapseAll","search"] - }, - editSettings: { - allowEditing: true, - allowAdding: true, - allowDeleting: true, - allowIndent: true, - editMode: "cellEditing" - }, - sizeSettings: { - width: "100%", - height: "100%" - }, - dragTooltip: { showTooltip: true }, - showGridCellTooltip: true, - treeColumnIndex: 1, - isResponsive: true, + $(function () { + var ganttInstance = new ej.Gantt($("#GanttContainer"), { + dataSource: (window).projectData, + allowColumnResize: true, + allowSorting: true, + allowSelection: true, + enableContextMenu: true, + taskIdMapping: "taskID", + allowDragAndDrop: true, + taskNameMapping: "taskName", + startDateMapping: "startDate", + showColumnChooser: true, + showColumnOptions: true, + progressMapping: "progress", + durationMapping: "duration", + endDateMapping: "endDate", + childMapping: "subtasks", + scheduleStartDate: "02/01/2017", + scheduleEndDate: "04/09/2017", + //Resources mapping + resourceInfoMapping: "resourceId", + resourceNameMapping: "resourceName", + resourceIdMapping: "resourceId", + resources: (window).projectResources, + predecessorMapping: "predecessor", + showResourceNames: true, + toolbarSettings: { + showToolbar: true, + toolbarItems: ["add", "edit", "delete", "update", "cancel", "indent", "outdent", "expandAll", "collapseAll", "search"] + }, + editSettings: { + allowEditing: true, + allowAdding: true, + allowDeleting: true, + allowIndent: true, + editMode: "cellEditing" + }, + sizeSettings: { + width: "100%", + height: "100%" + }, + dragTooltip: { showTooltip: true }, + showGridCellTooltip: true, + treeColumnIndex: 1, + isResponsive: true, + }); }); -}); } @@ -750,7 +749,7 @@ $(function () { module KanbanComponent { $(function () { var sample = new ej.Kanban($("#Kanban"), { - dataSource: new ej.DataManager((window).kanbanData).executeLocal(new ej.Query().take(20)), + dataSource: new ej.DataManager((window).kanbanData).executeLocal(new ej.Query().take(20)), columns: [ { headerText: "Backlog", key: "Open" }, { headerText: "In Progress", key: "InProgress" }, @@ -769,7 +768,7 @@ module KanbanComponent { }); } - + module lineargaugecomponent { @@ -795,14 +794,14 @@ module lineargaugecomponent { backgroundColor: "#E94649", border: { color: "#E94649" }, startWidth: 4, endWidth: 4 }] - }] + }] }); }); } - - + + module ListBoxComponent { $(function () { @@ -812,13 +811,13 @@ module ListBoxComponent { }); } - + module ListviewComponent { $(function () { var listviewInstance = new ej.ListView($("#defaultlistview"), { - enableCheckMark: true, - width: 400 + enableCheckMark: true, + width: 400 }); }); } @@ -1057,7 +1056,7 @@ module mapcomponenet { module MenuComponent { $(function () { - var sample = new ej.Menu($("#syncfusionProducts"),{ + var sample = new ej.Menu($("#syncfusionProducts"), { width: "100%", animationType: ej.AnimationType.Default, cssClass: 'gradient-lime ', @@ -1082,12 +1081,12 @@ module MenuComponent { - + module NavigationDrawerComponent { $(function () { var navigationdrawerInstance = new ej.NavigationDrawer($("#navpane"), { - targetId: "butdrawer", + targetId: "butdrawer", contentId: "content_container", type: "overlay", direction: "left", @@ -1098,8 +1097,8 @@ module NavigationDrawerComponent { }, position: "normal" }); - $("#navpane_listview").click(function(e: any) { - var text=e.target["text"]||$(e.target).closest("li.e-list").text(); + $("#navpane_listview").click(function (e: any) { + var text = e.target["text"] || $(e.target).closest("li.e-list").text(); $("#butdrawer").parent().children("h2").text(text); }); }); @@ -1110,7 +1109,7 @@ module NavigationDrawerComponent { module PDFViewerComponent { $(function () { var pdfviewerControl = new ej.PdfViewer($("#pdfviewer"), { - serviceUrl:(window).baseurl+ "api/PdfViewer", + serviceUrl: (window).baseurl + "api/PdfViewer", isResponsive: true }); }); @@ -1120,42 +1119,42 @@ module PDFViewerComponent { module PivotChartOlap { $(function () { - var sample = new ej.PivotChart($("#PivotChart"),{ + var sample = new ej.PivotChart($("#PivotChart"), { dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]" - } - ], - axis: "columns" - } - ], - filters:[] - }, - isResponsive: true,zooming:{enableScrollbar: true}, - commonSeriesOptions: { - type: "column" - }, - size: { height: "460px", width: "100%" }, - primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, - primaryYAxis: { title: { text: "Internet Sales Amount" } }, - legend: { visible: true, rowCount: 2 } - // load:"loadTheme" + data: "//bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]" + } + ], + axis: "columns" + } + ], + filters: [] + }, + isResponsive: true, zooming: { enableScrollbar: true }, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, + primaryYAxis: { title: { text: "Internet Sales Amount" } }, + legend: { visible: true, rowCount: 2 } + // load:"loadTheme" }); }); } @@ -1192,45 +1191,45 @@ var pivot_dataset = [ module PivotChartRelational { $(function () { - var sample = new ej.PivotChart($("#PivotChart"),{ + var sample = new ej.PivotChart($("#PivotChart"), { dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - fieldCaption: "Country" - }, - { - fieldName: "State", - fieldCaption: "State" - }, - { - fieldName: "Date", - fieldCaption: "Date" - } - ], - columns: [ - { - fieldName: "Product", - fieldCaption: "Product" - } - ], - values: [ - { - fieldName: "Amount", - fieldCaption: "Amount" - } - ], - filters:[] - }, - isResponsive: true,zooming:{enableScrollbar: true}, - commonSeriesOptions: { - type: "column" - }, - size: { height: "460px", width: "100%" }, - primaryYAxis: { title: { text: "Amount" } }, - legend: { visible: true } - // load:"loadTheme" + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + }, + { + fieldName: "Date", + fieldCaption: "Date" + } + ], + columns: [ + { + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + } + ], + filters: [] + }, + isResponsive: true, zooming: { enableScrollbar: true }, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryYAxis: { title: { text: "Amount" } }, + legend: { visible: true } + // load:"loadTheme" }); }); } @@ -1240,106 +1239,106 @@ module PivotChartRelational { module PivotGaugeOlap { $(function () { - var sample = new ej.PivotGauge($("#PivotGauge"),{ + var sample = new ej.PivotGauge($("#PivotGauge"), { dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]", - filterItems: { filterType: "include", values: ["[Date].[Fiscal].[Fiscal Year].&[2004]"] } - }, - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]" - }, - { - fieldName: "[Measures].[Internet Revenue Status]" - }, - { - fieldName: "[Measures].[Internet Revenue Trend]" - }, - { - fieldName: "[Measures].[Internet Revenue Goal]" - }, - ], - axis: "columns" - } - ], - filters:[] - }, + data: "//bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]", + filterItems: { filterType: "include", values: ["[Date].[Fiscal].[Fiscal Year].&[2004]"] } + }, + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]" + }, + { + fieldName: "[Measures].[Internet Revenue Status]" + }, + { + fieldName: "[Measures].[Internet Revenue Trend]" + }, + { + fieldName: "[Measures].[Internet Revenue Goal]" + }, + ], + axis: "columns" + } + ], + filters: [] + }, enableTooltip: true, isResponsive: true, labelFormatSettings: { decimalPlaces: 2 }, - scales: [{ - showRanges: true, - radius: 150, showScaleBar: true, size: 1, + scales: [{ + showRanges: true, + radius: 150, showScaleBar: true, size: 1, border: { - width: 0.5 - }, - showIndicators: true, showLabels: true, - pointers: [{ - showBackNeedle: true, - backNeedleLength: 20, - length: 120, - width: 7 + width: 0.5 }, - { - type: "marker", - markerType: "diamond", - distanceFromScale: 5, - placement: "center", - backgroundColor: "#29A4D9", - length: 25, - width: 15 - }], + showIndicators: true, showLabels: true, + pointers: [{ + showBackNeedle: true, + backNeedleLength: 20, + length: 120, + width: 7 + }, + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], ticks: [{ - type: "major", + type: "major", distanceFromScale: 2, - height: 16, - width: 1, color: "#8c8c8c" - }, - { - type: "minor", - height: 6, - width: 1, - distanceFromScale: 2, - color: "#8c8c8c" - }], + height: 16, + width: 1, color: "#8c8c8c" + }, + { + type: "minor", + height: 6, + width: 1, + distanceFromScale: 2, + color: "#8c8c8c" + }], labels: [{ color: "#8c8c8c" - }], - ranges: [{ - distanceFromScale: -5, - backgroundColor: "#fc0606", - border: { color: "#fc0606" } - }, - { - distanceFromScale: -5 }], - customLabels: [{ - position: { x: 180, y: 290 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + ranges: [{ + distanceFromScale: -5, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } }, - { - position: { x: 180, y: 320 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + { + distanceFromScale: -5 + }], + customLabels: [{ + position: { x: 180, y: 290 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" }, - { - position: { x: 180, y: 150 }, - font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }] + { + position: { x: 180, y: 320 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }, + { + position: { x: 180, y: 150 }, + font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }] }] }); - }); + }); } @@ -1373,94 +1372,94 @@ var pivot_dataset = [ module PivotGaugeRelational { $(function () { - var sample = new ej.PivotGauge($("#PivotGauge"),{ + var sample = new ej.PivotGauge($("#PivotGauge"), { dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - }, - { - fieldName: "State", - } - ], - columns: [ - { - fieldName: "Product", - } - ], + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + }, + { + fieldName: "State", + } + ], + columns: [ + { + fieldName: "Product", + } + ], values: [ - { - fieldName: "Amount", - }, - { - fieldName: "Quantity", - } - ] - }, + { + fieldName: "Amount", + }, + { + fieldName: "Quantity", + } + ] + }, enableTooltip: true, isResponsive: true, labelFormatSettings: { decimalPlaces: 2 }, - scales: [{ - showRanges: true, - radius: 150, showScaleBar: true, size: 1, + scales: [{ + showRanges: true, + radius: 150, showScaleBar: true, size: 1, border: { - width: 0.5 - }, - showIndicators: true, showLabels: true, - pointers: [{ - showBackNeedle: true, - backNeedleLength: 20, - length: 120, - width: 7 + width: 0.5 }, - { - type: "marker", - markerType: "diamond", - distanceFromScale: 5, - placement: "center", - backgroundColor: "#29A4D9", - length: 25, - width: 15 - }], + showIndicators: true, showLabels: true, + pointers: [{ + showBackNeedle: true, + backNeedleLength: 20, + length: 120, + width: 7 + }, + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], ticks: [{ - type: "major", + type: "major", distanceFromScale: 2, - height: 16, - width: 1, color: "#8c8c8c" - }, - { - type: "minor", - height: 6, - width: 1, - distanceFromScale: 2, - color: "#8c8c8c" - }], + height: 16, + width: 1, color: "#8c8c8c" + }, + { + type: "minor", + height: 6, + width: 1, + distanceFromScale: 2, + color: "#8c8c8c" + }], labels: [{ color: "#8c8c8c" - }], - ranges: [{ - distanceFromScale: -5, - backgroundColor: "#fc0606", - border: { color: "#fc0606" } - }, - { - distanceFromScale: -5 }], - customLabels: [{ - position: { x: 180, y: 290 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + ranges: [{ + distanceFromScale: -5, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } }, - { - position: { x: 180, y: 320 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + { + distanceFromScale: -5 + }], + customLabels: [{ + position: { x: 180, y: 290 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" }, - { - position: { x: 180, y: 150 }, - font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }] + { + position: { x: 180, y: 320 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }, + { + position: { x: 180, y: 150 }, + font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }] }] }); - }); + }); } @@ -1468,35 +1467,35 @@ module PivotGaugeRelational { module PivotGridOlap { $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"),{ + var sample = new ej.PivotGrid($("#PivotGrid"), { dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]", - } - ], - axis: "columns" - } - ], - filters:[] - }, - enableGroupingBar: true, - pivotTableFieldListID:"PivotSchemaDesigner" + data: "//bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]", + } + ], + axis: "columns" + } + ], + filters: [] + }, + enableGroupingBar: true, + pivotTableFieldListID: "PivotSchemaDesigner" }); $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); }); @@ -1533,41 +1532,41 @@ var pivot_dataset = [ module PivotGridRelational { $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"),{ + var sample = new ej.PivotGrid($("#PivotGrid"), { dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - fieldCaption: "Country" - }, - { - fieldName: "State", - fieldCaption: "State" - } - ], - columns: - [{ - fieldName: "Product", - fieldCaption: "Product" - } - ], - values: [ - { - fieldName: "Amount", - fieldCaption: "Amount" - }, - { - fieldName: "Quantity", - fieldCaption: "Quantity" - } - ], - filters:[] - }, - enableGroupingBar: true, - pivotTableFieldListID:"PivotSchemaDesigner" + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + } + ], + columns: + [{ + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + }, + { + fieldName: "Quantity", + fieldCaption: "Quantity" + } + ], + filters: [] + }, + enableGroupingBar: true, + pivotTableFieldListID: "PivotSchemaDesigner" }); - $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); + $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); }); } @@ -1576,33 +1575,33 @@ module PivotGridRelational { module PivotTreeMap { $(function () { - var sample = new ej.PivotTreeMap($("#PivotTreeMap"),{ + var sample = new ej.PivotTreeMap($("#PivotTreeMap"), { dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll;Locale Identifier=1033;", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - columns: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Customer Count]", - } - ], - axis: "columns" - } - ], - filters:[] - } + data: "//bi.syncfusion.com/olap/msmdpump.dll;Locale Identifier=1033;", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + columns: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Customer Count]", + } + ], + axis: "columns" + } + ], + filters: [] + } }); }); } @@ -1611,7 +1610,7 @@ module PivotTreeMap { module ProgressBarComponent { $(function () { - var sample = new ej.ProgressBar($("#progressBar"),{ + var sample = new ej.ProgressBar($("#progressBar"), { width: 200, value: 45, height: 20, @@ -1641,7 +1640,7 @@ module RadialMenuComponent { backImageClass: "backimageclass", targetElementId: "radialtarget1" }); - $("#radialtarget1").parent().css("position", "relative"); + $("#radialtarget1").parent().css("position", "relative"); } else { $("#contentDiv").html("Radial Menu is only supported from Internet Explorer Versioned 9 and above.").css({ "font-size": "20px", "color": "red" }); @@ -1708,12 +1707,12 @@ function redo(e: any) { } - + module RadialSliderComponent { $(function () { var radialsliderInstance = new ej.RadialSlider($("#radialSlider"), { - innerCircleImageUrl: "images/radialslider/chevron-right.png" + innerCircleImageUrl: "images/radialslider/chevron-right.png" }); }); } @@ -1810,8 +1809,8 @@ var data; data = GetData(); function GetData() { - var series1:any[]=[]; - var series2:any[]= []; + var series1: any[] = []; + var series2: any[] = []; var value = 100; var value1 = 120; for (var i = 1; i < 730; i++) { @@ -1838,7 +1837,7 @@ function GetData() { module RatingComponent { $(function () { - var sample1 = new ej.Rating($("#fullRating"),{ + var sample1 = new ej.Rating($("#fullRating"), { value: 4, precision: ej.Rating.Precision.Full, allowReset: true, @@ -1853,8 +1852,8 @@ module RatingComponent { shapeWidth: 25, showTooltip: true }); - - var sample2 = new ej.Rating($("#halfRating"),{ + + var sample2 = new ej.Rating($("#halfRating"), { precision: ej.Rating.Precision.Half, value: 3.5, allowReset: true, @@ -1870,7 +1869,7 @@ module RatingComponent { showTooltip: true }); - var sample3 = new ej.Rating($("#exactRating"),{ + var sample3 = new ej.Rating($("#exactRating"), { precision: ej.Rating.Precision.Exact, value: 3.7, allowReset: true, @@ -1884,7 +1883,7 @@ module RatingComponent { shapeHeight: 25, shapeWidth: 25, showTooltip: true - }); + }); }); } @@ -1892,15 +1891,15 @@ module RatingComponent { module ReportViewerComponent { - $(function () { - var report = new ej.ReportViewer($("#territoryReportViewer"), { - reportServiceUrl: (window).baseurl + 'api/ReportViewer', - reportServerUrl: 'http://104.207.134.201/reportserver', - processingMode: ej.ReportViewer.ProcessingMode.Remote, - reportPath: "/SSRSSamples2/Territory Sales new", - isResponsive: true - }); - }); + $(function () { + var report = new ej.ReportViewer($("#territoryReportViewer"), { + reportServiceUrl: (window).baseurl + 'api/ReportViewer', + reportServerUrl: 'http://104.207.134.201/reportserver', + processingMode: ej.ReportViewer.ProcessingMode.Remote, + reportPath: "/SSRSSamples2/Territory Sales new", + isResponsive: true + }); + }); } @@ -1917,7 +1916,7 @@ module RibbonComponent { toolTip: "Pin the Ribbon" }, applicationTab: { - type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } + type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } }, tabs: [{ id: "home", text: "HOME", groups: [{ @@ -1941,7 +1940,7 @@ module RibbonComponent { } }] }, - { + { text: "Clipboard", alignType: ej.Ribbon.AlignType.Columns, content: [{ groups: [{ id: "paste", @@ -1963,8 +1962,8 @@ module RibbonComponent { height: 70 } }, - { - groups: [{ + { + groups: [{ id: "cut", text: "Cut", toolTip: "Cut", @@ -1994,14 +1993,14 @@ module RibbonComponent { prefixIcon: "e-icon e-ribbon clearAll" } }], - defaults: { + defaults: { type: "button", width: 60, isBig: false } - }] - }, - { + }] + }, + { text: "Font", alignType: "rows", content: [{ groups: [{ id: "fontfamily", @@ -2300,7 +2299,7 @@ module RibbonComponent { groups: [{ id: "zoomin", text: "Zoom In", - toolTip: "Zoom In", + toolTip: "Zoom In", buttonSettings: { width: 58, click: "onClick", @@ -2312,7 +2311,7 @@ module RibbonComponent { { id: "zoomout", text: "Zoom Out", - toolTip: "Zoom Out", + toolTip: "Zoom Out", buttonSettings: { width: 70, click: "onClick", @@ -2324,7 +2323,7 @@ module RibbonComponent { { id: "fullscreen", text: "Full Screen", - toolTip: "Full Screen", + toolTip: "Full Screen", buttonSettings: { width: 73, click: "onClick", @@ -2340,7 +2339,7 @@ module RibbonComponent { } }] }] - },{ + }, { id: "insert", text: "INSERT", groups: [{ text: "Tables", alignType: ej.Ribbon.AlignType.Columns, content: [{ groups: [{ @@ -2485,7 +2484,7 @@ module RibbonComponent { } ], defaults: { - type: "button", + type: "button", width: 70, height: 70 } @@ -2567,7 +2566,7 @@ module RibbonComponent { } ] } - ], + ], create: function createControl(args) { var ribbon = $("#defaultRibbon").data("ejRibbon"); $("#fontcolor").ejColorPicker({ value: "#FFFF00", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fontcoloricon", select: colorHandler }); @@ -2579,7 +2578,7 @@ module RibbonComponent { function colorHandler(args:any) { (this._id.indexOf("fillcolor") != -1) ? $("#contenteditor").css('background-color', args.value) : document.execCommand('forecolor', false, args.value); } -function onClick(args:any) { +function onClick(args: any) { var val, prop = args.text; val = (ej.isNullOrUndefined(args.model.text)) ? args.model.activeText : args.model.text; if (action1.indexOf(val) != -1) @@ -2597,7 +2596,7 @@ function onClick(args:any) { - + module RotatorComponent { $(function () { @@ -2607,14 +2606,14 @@ module RotatorComponent { slideHeight: "auto", displayItemsCount: "1", navigateSteps: "1", - pagerPosition:"outside", + pagerPosition: "outside", orientation: "horizontal", showPager: true, enabled: true, showCaption: true, allowKeyboardNavigation: true, showPlayButton: true, - isResponsive:true, + isResponsive: true, animationType: "slide", }); }); @@ -2624,7 +2623,7 @@ module RotatorComponent { module RTEComponent { $(function () { - var sample = new ej.RTE($("#rteSample"),{ + var sample = new ej.RTE($("#rteSample"), { width: "100%", minWidth: "150px", showFooter: true, @@ -2760,7 +2759,7 @@ module ScheduleComponent { } }); }); -} +} @@ -2820,10 +2819,10 @@ module linesparkline { dataSource: [12, 14, 11, 12, 11, 15, 12, 10, 11, 12, 15, 13, 12, 11, 10, 13, 15, 12, 14, 16, 14, 12, 11], tooltip: { visible: true, - font: { size:"12px" } + font: { size: "12px" } }, type: "line", - size: { height: "40", width:"170" }, + size: { height: "40", width: "170" }, }); }); } @@ -2831,7 +2830,7 @@ module linesparkline { module columnsparkline { $(function () { var sparkcolumnsample = new ej.Sparkline($("#column"), { - dataSource: [2, 6, -1, 1, 12, 5, -2, 7, -3, 5, 8, 10,], + dataSource: [2, 6, -1, 1, 12, 5, -2, 7, -3, 5, 8, 10, ], negativePointColor: "red", highPointColor: "blue", tooltip: { @@ -2849,7 +2848,7 @@ module columnsparkline { module areasparkline { $(function () { var sparkareasample = new ej.Sparkline($("#area"), { - dataSource: [12, -10, 11, 8, 17, 6, 2, -17, 13, -6, 8, 10,], + dataSource: [12, -10, 11, 8, 17, 6, 2, -17, 13, -6, 8, 10, ], markerSettings: { visible: true }, highPointColor: "blue", lowPointColor: "orange", @@ -2869,7 +2868,7 @@ module areasparkline { module windlosssparkline { $(function () { var sparkwinlosssample = new ej.Sparkline($("#winloss"), { - dataSource: [12, 15, -11, 13, 17, 0, -12, 17, 13, -15, 8, 10,], + dataSource: [12, 15, -11, 13, 17, 0, -12, 17, 13, -15, 8, 10, ], type: "winloss", size: { height: "100", width: "150" }, }); @@ -2895,7 +2894,7 @@ module piesparkline1 { module piesparkline2 { $(function () { var sparkpiesample2 = new ej.Sparkline($("#pie2"), { - dataSource: [8, 9, 1,], + dataSource: [8, 9, 1, ], type: "pie", tooltip: { visible: true, @@ -2940,9 +2939,9 @@ module piesparkline4 { }); } - - + + module SplitterComponent { @@ -2952,10 +2951,10 @@ module SplitterComponent { width: "50%", orientation: ej.Orientation.Vertical, properties: [{}, { paneSize: 80 }], - isResponsive:true + isResponsive: true }); var splitterInstance1 = new ej.Splitter($("#innerSpliter"), { - isResponsive:true, + isResponsive: true, }); }); } @@ -2963,7 +2962,7 @@ module SplitterComponent { module SpreadsheetComponent { -$(function () { + $(function () { var sample = new ej.Spreadsheet($("#basicSpreadsheet"), { scrollSettings: { height: 550, @@ -2977,14 +2976,15 @@ $(function () { pdfUrl: (window).baseurl + "api/Spreadsheet/PdfExport" }, sheets: [{ rangeSettings: [{ dataSource: (window).defaultData, startCell: "A1" }] }], - loadComplete: () => { - var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; - if (!(spreadsheet).isImport) { - spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); - xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); - xlFormat.format({ "type": "currency" }, "E2:H11"); - spreadsheet.XLRibbon.updateRibbonIcons(); - }} + loadComplete: () => { + var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; + if (!(spreadsheet).isImport) { + spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); + xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); + xlFormat.format({ "type": "currency" }, "E2:H11"); + spreadsheet.XLRibbon.updateRibbonIcons(); + } + } }); }); } @@ -2993,58 +2993,58 @@ $(function () { var default_data: Array = [ - { Category : "Employees", Country : "USA", JobDescription : "Sales", JobGroup:"Executive", EmployeesCount : 50 }, - { Category : "Employees", Country : "USA", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, - { Category : "Employees", Country : "USA", JobDescription : "Marketing", EmployeesCount : 40 }, - { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 55 }, - { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 175}, - { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 70 }, - { Category : "Employees", Country : "USA", JobDescription : "Management", EmployeesCount : 40 }, - { Category : "Employees", Country : "USA", JobDescription : "Accounts", EmployeesCount : 60 }, - - { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 43 }, - { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 125}, - { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 60 }, - { Category : "Employees", Country : "India", JobDescription : "HR Executives", EmployeesCount : 70 }, - { Category : "Employees", Country : "India", JobDescription : "Accounts", EmployeesCount : 45 }, - - { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Executive", EmployeesCount : 30 }, - { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, - { Category : "Employees", Country : "Germany", JobDescription : "Marketing", EmployeesCount : 50 }, - { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, - { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, - { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, - { Category : "Employees", Country : "Germany", JobDescription : "Management", EmployeesCount : 33 }, - { Category : "Employees", Country : "Germany", JobDescription : "Accounts", EmployeesCount : 55 }, - - { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 45 }, - { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 96 }, - { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 55 }, - { Category : "Employees", Country : "UK", JobDescription : "HR Executives", EmployeesCount : 60 }, - { Category : "Employees", Country : "UK", JobDescription: "Accounts", EmployeesCount: 30 }, - - { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, - { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, - { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, - { Category : "Employees", Country : "France", JobDescription: "Marketing", EmployeesCount: 50 } + { Category: "Employees", Country: "USA", JobDescription: "Sales", JobGroup: "Executive", EmployeesCount: 50 }, + { Category: "Employees", Country: "USA", JobDescription: "Sales", JobGroup: "Analyst", EmployeesCount: 40 }, + { Category: "Employees", Country: "USA", JobDescription: "Marketing", EmployeesCount: 40 }, + { Category: "Employees", Country: "USA", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 55 }, + { Category: "Employees", Country: "USA", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 175 }, + { Category: "Employees", Country: "USA", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 70 }, + { Category: "Employees", Country: "USA", JobDescription: "Management", EmployeesCount: 40 }, + { Category: "Employees", Country: "USA", JobDescription: "Accounts", EmployeesCount: 60 }, + + { Category: "Employees", Country: "India", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 43 }, + { Category: "Employees", Country: "India", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 125 }, + { Category: "Employees", Country: "India", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 60 }, + { Category: "Employees", Country: "India", JobDescription: "HR Executives", EmployeesCount: 70 }, + { Category: "Employees", Country: "India", JobDescription: "Accounts", EmployeesCount: 45 }, + + { Category: "Employees", Country: "Germany", JobDescription: "Sales", JobGroup: "Executive", EmployeesCount: 30 }, + { Category: "Employees", Country: "Germany", JobDescription: "Sales", JobGroup: "Analyst", EmployeesCount: 40 }, + { Category: "Employees", Country: "Germany", JobDescription: "Marketing", EmployeesCount: 50 }, + { Category: "Employees", Country: "Germany", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 40 }, + { Category: "Employees", Country: "Germany", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 65 }, + { Category: "Employees", Country: "Germany", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 27 }, + { Category: "Employees", Country: "Germany", JobDescription: "Management", EmployeesCount: 33 }, + { Category: "Employees", Country: "Germany", JobDescription: "Accounts", EmployeesCount: 55 }, + + { Category: "Employees", Country: "UK", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 45 }, + { Category: "Employees", Country: "UK", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 96 }, + { Category: "Employees", Country: "UK", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 55 }, + { Category: "Employees", Country: "UK", JobDescription: "HR Executives", EmployeesCount: 60 }, + { Category: "Employees", Country: "UK", JobDescription: "Accounts", EmployeesCount: 30 }, + + { Category: "Employees", Country: "France", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 40 }, + { Category: "Employees", Country: "France", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 65 }, + { Category: "Employees", Country: "France", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 27 }, + { Category: "Employees", Country: "France", JobDescription: "Marketing", EmployeesCount: 50 } ]; module sunburstcomponent { $(function () { var sunburstsample = new ej.SunburstChart($("#Sunburst"), { - valueMemberPath: "EmployeesCount", + valueMemberPath: "EmployeesCount", levels: [ - {groupMemberPath: "Country"}, - {groupMemberPath: "JobDescription"}, - {groupMemberPath: "JobGroup"}, - {groupMemberPath: "JobRole"} + { groupMemberPath: "Country" }, + { groupMemberPath: "JobDescription" }, + { groupMemberPath: "JobGroup" }, + { groupMemberPath: "JobRole" } ], dataSource: default_data, - dataLabelSettings:{visible:true}, - tooltip:{visible:false}, - enableAnimation:false, - size:{height:"600"}, - innerRadius:0.2, + dataLabelSettings: { visible: true }, + tooltip: { visible: false }, + enableAnimation: false, + size: { height: "600" }, + innerRadius: 0.2, load: function () { var sender = $("#Sunburst").data("ejSunburstChart"); var SunBurstTheme = (window).themeStyle + (window).themeColor + (window).themeVarient; @@ -3055,10 +3055,10 @@ module sunburstcomponent { SunBurstTheme = "flatlight"; sender.model.theme = SunBurstTheme; }, - title:{text:"Employees Count"}, - zoomSettings:{enable:false}, - legend:{visible:true,position:'top'} - // load:"loadTheme" + title: { text: "Employees Count" }, + zoomSettings: { enable: false }, + legend: { visible: true, position: 'top' } + // load:"loadTheme" }); }); } @@ -3068,7 +3068,7 @@ module sunburstcomponent { module TabComponent { $(function () { - var sample = new ej.Tab($("#defaultTab"),{ + var sample = new ej.Tab($("#defaultTab"), { width: "500px", collapsible: true, events: "click", @@ -3082,8 +3082,8 @@ module TabComponent { module TagCloudComponent { - - + + var websiteCollection = [ { text: "Google", url: "http://www.google.com", frequency: 12 }, { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, @@ -3114,7 +3114,7 @@ module TagCloudComponent { text: "text", url: "url", frequency: "frequency" } }); - + }); } @@ -3154,82 +3154,82 @@ module EditorComponent { - + module TileViewComponent { $(function () { var tile1 = new ej.Tile($("#tile1"), { - imagePosition:"fill", - caption:{text:"People"}, - tileSize:"medium", - imageUrl:'content/images/tile/windows/people_1.png' + imagePosition: "fill", + caption: { text: "People" }, + tileSize: "medium", + imageUrl: 'content/images/tile/windows/people_1.png' }); - var tile2 = new ej.Tile($("#tile2"), { - imagePosition:"center", - tileSize:"small", - imageUrl:'content/images/tile/windows/alerts.png', - + var tile2 = new ej.Tile($("#tile2"), { + imagePosition: "center", + tileSize: "small", + imageUrl: 'content/images/tile/windows/alerts.png', + }); - var tile3 = new ej.Tile($("#tile3"), { - imagePosition:"center", - tileSize:"small", - imageUrl:'content/images/tile/windows/bing.png', + var tile3 = new ej.Tile($("#tile3"), { + imagePosition: "center", + tileSize: "small", + imageUrl: 'content/images/tile/windows/bing.png', }); - var tile4 = new ej.Tile($("#tile4"), { - tileSize:"small", - imageUrl:'content/images/tile/windows/camera.png', + var tile4 = new ej.Tile($("#tile4"), { + tileSize: "small", + imageUrl: 'content/images/tile/windows/camera.png', }); - var tile5 = new ej.Tile($("#tile5"), { - imagePosition:"center", - tileSize:"small", - imageUrl:'content/images/tile/windows/messages.png', + var tile5 = new ej.Tile($("#tile5"), { + imagePosition: "center", + tileSize: "small", + imageUrl: 'content/images/tile/windows/messages.png', }); - var tile6 = new ej.Tile($("#tile6"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/games.png', - caption:{text:"Play"} + var tile6 = new ej.Tile($("#tile6"), { + imagePosition: "center", + tileSize: "medium", + imageUrl: 'content/images/tile/windows/games.png', + caption: { text: "Play" } }); - var tile7 = new ej.Tile($("#tile7"), { - tileSize:"medium", - imageUrl:'content/images/tile/windows/map.png', - caption:{text:"Maps"} + var tile7 = new ej.Tile($("#tile7"), { + tileSize: "medium", + imageUrl: 'content/images/tile/windows/map.png', + caption: { text: "Maps" } }); - var tile8 = new ej.Tile($("#tile8"), { - imagePosition:"fill", - tileSize:"wide", - imageUrl:'content/images/tile/windows/sports.png', - caption:{text:"Sports"} + var tile8 = new ej.Tile($("#tile8"), { + imagePosition: "fill", + tileSize: "wide", + imageUrl: 'content/images/tile/windows/sports.png', + caption: { text: "Sports" } }); - var tile9 = new ej.Tile($("#tile9"), { - imagePosition:"fill", - tileSize:"medium", - imageUrl:'content/images/tile/windows/people_2.png', - caption:{text:"People"} + var tile9 = new ej.Tile($("#tile9"), { + imagePosition: "fill", + tileSize: "medium", + imageUrl: 'content/images/tile/windows/people_2.png', + caption: { text: "People" } }); - var tile10 = new ej.Tile($("#tile10"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/pictures.png', - caption:{text:"Photo"} + var tile10 = new ej.Tile($("#tile10"), { + imagePosition: "center", + tileSize: "medium", + imageUrl: 'content/images/tile/windows/pictures.png', + caption: { text: "Photo" } }); - var tile11 = new ej.Tile($("#tile11"), { - imagePosition:"center", - tileSize:"wide", - imageUrl:'content/images/tile/windows/weather.png', - caption:{text:"Weather"} + var tile11 = new ej.Tile($("#tile11"), { + imagePosition: "center", + tileSize: "wide", + imageUrl: 'content/images/tile/windows/weather.png', + caption: { text: "Weather" } }); - var tile12 = new ej.Tile($("#tile12"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/music.png', - caption:{text:"Music"} + var tile12 = new ej.Tile($("#tile12"), { + imagePosition: "center", + tileSize: "medium", + imageUrl: 'content/images/tile/windows/music.png', + caption: { text: "Music" } }); - var tile13 = new ej.Tile($("#tile13"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/favs.png', - caption:{text:"Favorites"} + var tile13 = new ej.Tile($("#tile13"), { + imagePosition: "center", + tileSize: "medium", + imageUrl: 'content/images/tile/windows/favs.png', + caption: { text: "Favorites" } }); }); } @@ -3248,13 +3248,13 @@ module TimePickerComponent { module ToolbarComponent { - + $(function () { - var sample = new ej.Toolbar($("#editingToolbar"),{ + var sample = new ej.Toolbar($("#editingToolbar"), { width: "100%", cssClass: "gradient-lime", enableSeparator: true, - + isResponsive: true, orientation: ej.Orientation.Horizontal, showRoundedCorner: true @@ -3267,10 +3267,10 @@ module ToolbarComponent { module TooltipComponent { - + $(function () { - var sample1 = new ej.Tooltip($("#link1"),{ + var sample1 = new ej.Tooltip($("#link1"), { content: "ECMAScript (or ES) is a trademarked scripting-language specification standardized by Ecma International in ECMA-262 and ISO/IEC 16262.", associate: "mousefollow", autoCloseTimeout: 5000, @@ -3280,7 +3280,7 @@ module TooltipComponent { showShadow: true }); - var sample2 = new ej.Tooltip($("#link2"),{ + var sample2 = new ej.Tooltip($("#link2"), { content: "The World Wide Web (WWW) is an information space where documents and other web resources are identified by URLs, interlinked by hypertext links, and can be accessed via the Internet.", position: { stem: { @@ -3299,7 +3299,7 @@ module TooltipComponent { showShadow: true }); - var sample3 = new ej.Tooltip($("#link3"),{ + var sample3 = new ej.Tooltip($("#link3"), { content: 'Object-oriented programming (OOP) is a programming language model organized around objects rather than "actions" and data rather than logic.', position: { stem: { @@ -3326,43 +3326,43 @@ module TooltipComponent { module TreeGridComponent { $(function () { var treegridInstance = new ej.TreeGrid($("#TreeGridContainer"), { - dataSource: (window).treeGridData, - childMapping: "subtasks", - allowSorting: true, - allowMultiSorting: true, - enableAltRow: true, - allowFiltering: true, - treeColumnIndex: 1, - allowKeyboardNavigation: true, - showColumnChooser: true, - showColumnOptions: true, - contextMenuSettings: { - showContextMenu: true, - contextMenuItems: ["add", "edit", "delete"] - }, - columnDialogFields: ["field", "headerText", "editType", "width", "visible", "allowSorting", "textAlign", "headerTextAlign"], - editSettings: { - allowAdding: true, - allowEditing: true, - allowDeleting: true, - editMode: "cellEditing", - rowPosition: "belowSelectedRow" - }, - toolbarSettings: { - showToolbar: true, - toolbarItems: ["add","edit","delete","update","cancel","expandAll","collapseAll"] - }, - columns: [ - { field: "taskID", headerText: "Task Id", allowFiltering: false, editType: "numericedit", filterEditType: "numericedit" }, - { field: "taskName", headerText: "Task Name", editType: "stringedit", filterEditType: "stringedit" }, - { field: "startDate", headerText: "Start Date", editType: "datepicker", filterEditType: "datepicker", format:"{0:MM/dd/yyyy}" }, - { field: "endDate", headerText: "End Date", editType: "datepicker", filterEditType: "datepicker", format:"{0:MM/dd/yyyy}" }, - { field: "progress", headerText: "Progress", editType: "numericedit", filterEditType: "numericedit" } - ], - isResponsive: true, + dataSource: (window).treeGridData, + childMapping: "subtasks", + allowSorting: true, + allowMultiSorting: true, + enableAltRow: true, + allowFiltering: true, + treeColumnIndex: 1, + allowKeyboardNavigation: true, + showColumnChooser: true, + showColumnOptions: true, + contextMenuSettings: { + showContextMenu: true, + contextMenuItems: ["add", "edit", "delete"] + }, + columnDialogFields: ["field", "headerText", "editType", "width", "visible", "allowSorting", "textAlign", "headerTextAlign"], + editSettings: { + allowAdding: true, + allowEditing: true, + allowDeleting: true, + editMode: "cellEditing", + rowPosition: "belowSelectedRow" + }, + toolbarSettings: { + showToolbar: true, + toolbarItems: ["add", "edit", "delete", "update", "cancel", "expandAll", "collapseAll"] + }, + columns: [ + { field: "taskID", headerText: "Task Id", allowFiltering: false, editType: "numericedit", filterEditType: "numericedit" }, + { field: "taskName", headerText: "Task Name", editType: "stringedit", filterEditType: "stringedit" }, + { field: "startDate", headerText: "Start Date", editType: "datepicker", filterEditType: "datepicker", format: "{0:MM/dd/yyyy}" }, + { field: "endDate", headerText: "End Date", editType: "datepicker", filterEditType: "datepicker", format: "{0:MM/dd/yyyy}" }, + { field: "progress", headerText: "Progress", editType: "numericedit", filterEditType: "numericedit" } + ], + isResponsive: true, + }); }); -}); -} +} @@ -3407,7 +3407,7 @@ module treemapcomponent { - + module TreeViewComponent { $(function () { @@ -3424,9 +3424,9 @@ module TreeViewComponent { module UploadboxComponent { - + $(function () { - var sample = new ej.Uploadbox($("#UploadDefault"),{ + var sample = new ej.Uploadbox($("#UploadDefault"), { saveUrl: (window).baseurl + "api/uploadbox/Save", removeUrl: (window).baseurl + "api/uploadbox/Remove", buttonText: { @@ -3449,12 +3449,12 @@ module UploadboxComponent { module WaitingPopupComponent { $(function () { - var sample = new ej.WaitingPopup($("#target"),{ + var sample = new ej.WaitingPopup($("#target"), { showOnInit: true, showImage: true, text: 'waiting…', - target: "#target", - appendTo: "#waiting" + target: "#target", + appendTo: "#waiting" }); }); From 935b20edf361cc60aa8d03e5ae311078024d1647 Mon Sep 17 00:00:00 2001 From: efokschaner Date: Mon, 2 Apr 2018 23:54:40 -0700 Subject: [PATCH 0411/2153] Make webvr-api consistent with latest lib.es6.d.ts --- types/webvr-api/index.d.ts | 67 +++++++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 9 deletions(-) diff --git a/types/webvr-api/index.d.ts b/types/webvr-api/index.d.ts index 72fea2097b..cf7e3dc8b8 100644 --- a/types/webvr-api/index.d.ts +++ b/types/webvr-api/index.d.ts @@ -3,6 +3,13 @@ // Definitions by: six a // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Typescript doesn't allow redefinition of type aliases even if they match, +// thus the _dt_alias to signal this being an alias for the use of DefinitelyTyped +type VRDisplayEventReason_dt_alias = "mounted" | "navigation" | "requested" | "unmounted"; + +// Typescript doesn't allow redefinition of type aliases even if they match, +// thus the _dt_alias to signal this being an alias for the use of DefinitelyTyped +type VREye_dt_alias = "left" | "right"; interface VRDisplay extends EventTarget { /** @@ -55,7 +62,7 @@ interface VRDisplay extends EventTarget { exitPresent(): Promise; /* Return the current VREyeParameters for the given eye. */ - getEyeParameters(whichEye: string): VREyeParameters; + getEyeParameters(whichEye: VREye_dt_alias): VREyeParameters; /** * Populates the passed VRFrameData with the information required to render @@ -69,6 +76,7 @@ interface VRDisplay extends EventTarget { getLayers(): VRLayer[]; /** + * @deprecated * Return a VRPose containing the future predicted pose of the VRDisplay * when the current frame will be presented. The value returned will not * change until JavaScript has returned control to the browser. @@ -138,6 +146,11 @@ interface VRDisplayCapabilities { readonly maxLayers: number; } +declare var VRDisplayCapabilities: { + prototype: VRDisplayCapabilities; + new(): VRDisplayCapabilities; +}; + interface VREyeParameters { /** @deprecated */ readonly fieldOfView: VRFieldOfView; @@ -146,6 +159,11 @@ interface VREyeParameters { readonly renderWidth: number; } +declare var VREyeParameters: { + prototype: VREyeParameters; + new(): VREyeParameters; +}; + interface VRFieldOfView { readonly downDegrees: number; readonly leftDegrees: number; @@ -153,6 +171,11 @@ interface VRFieldOfView { readonly upDegrees: number; } +declare var VRFieldOfView: { + prototype: VRFieldOfView; + new(): VRFieldOfView; +}; + interface VRFrameData { readonly leftProjectionMatrix: Float32Array; readonly leftViewMatrix: Float32Array; @@ -163,9 +186,9 @@ interface VRFrameData { } declare var VRFrameData: { - prototype: VRFrameData - new(): VRFrameData -} + prototype: VRFrameData; + new(): VRFrameData; +}; interface VRPose { readonly angularAcceleration: Float32Array | null; @@ -177,6 +200,11 @@ interface VRPose { readonly timestamp: number; } +declare var VRPose: { + prototype: VRPose; + new(): VRPose; +}; + interface VRStageParameters { sittingToStandingTransform?: Float32Array; sizeX?: number; @@ -188,13 +216,34 @@ interface Navigator { readonly activeVRDisplays: ReadonlyArray; } +interface VRDisplayEventInit extends EventInit { + display: VRDisplay; + reason?: VRDisplayEventReason_dt_alias; +} + +interface VRDisplayEvent extends Event { + readonly display: VRDisplay; + readonly reason: VRDisplayEventReason_dt_alias | null; +} + +declare var VRDisplayEvent: { + prototype: VRDisplayEvent; + new(type: string, eventInitDict: VRDisplayEventInit): VRDisplayEvent; +}; + interface Window { - onvrdisplayconnected: ((this: Window, ev: Event) => any) | null; - onvrdisplaydisconnected: ((this: Window, ev: Event) => any) | null; + onvrdisplayactivate: ((this: Window, ev: Event) => any) | null; + onvrdisplayblur: ((this: Window, ev: Event) => any) | null; + onvrdisplayconnect: ((this: Window, ev: Event) => any) | null; + onvrdisplaydeactivate: ((this: Window, ev: Event) => any) | null; + onvrdisplaydisconnect: ((this: Window, ev: Event) => any) | null; + onvrdisplayfocus: ((this: Window, ev: Event) => any) | null; + onvrdisplaypointerrestricted: ((this: Window, ev: Event) => any) | null; + onvrdisplaypointerunrestricted: ((this: Window, ev: Event) => any) | null; onvrdisplaypresentchange: ((this: Window, ev: Event) => any) | null; - addEventListener(type: "vrdisplayconnected", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "vrdisplaydisconnected", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "vrdisplaypresentchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "vrdisplayconnect", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "vrdisplaydisconnect", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "vrdisplaypresentchange", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; } interface Gamepad { From 247088de36674ca370919a39fee868415bb139f0 Mon Sep 17 00:00:00 2001 From: efokschaner Date: Tue, 3 Apr 2018 00:10:02 -0700 Subject: [PATCH 0412/2153] Add missing addEventListener declarations --- types/webvr-api/index.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/webvr-api/index.d.ts b/types/webvr-api/index.d.ts index cf7e3dc8b8..329f7fe6d8 100644 --- a/types/webvr-api/index.d.ts +++ b/types/webvr-api/index.d.ts @@ -241,8 +241,14 @@ interface Window { onvrdisplaypointerrestricted: ((this: Window, ev: Event) => any) | null; onvrdisplaypointerunrestricted: ((this: Window, ev: Event) => any) | null; onvrdisplaypresentchange: ((this: Window, ev: Event) => any) | null; + addEventListener(type: "vrdisplayactivate", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "vrdisplayblur", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "vrdisplayconnect", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "vrdisplaydeactivate", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "vrdisplaydisconnect", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "vrdisplayfocus", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "vrdisplaypointerrestricted", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "vrdisplaypointerunrestricted", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "vrdisplaypresentchange", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void; } From 978c90a6a15e6bf0fe2e792d007f950071743436 Mon Sep 17 00:00:00 2001 From: Stian Didriksen Date: Tue, 3 Apr 2018 10:53:22 +0200 Subject: [PATCH 0413/2153] Add `noModule` to React ScriptHTMLAttributes (#24691) React added this in https://github.com/facebook/react/pull/11900 Which is part of the 16.3 release https://github.com/facebook/react/blob/master/CHANGELOG.md#react-dom --- types/react/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 13faef3d01..3481e00760 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -3211,6 +3211,7 @@ declare namespace React { form?: string; multiple?: boolean; name?: string; + noModule?: boolean; required?: boolean; size?: number; value?: string | string[] | number; From 3c4e58a28805b603ebfeb2599ff402f204668515 Mon Sep 17 00:00:00 2001 From: Alex Dunne Date: Tue, 3 Apr 2018 13:20:18 +0100 Subject: [PATCH 0414/2153] [react-native] Added missing presentationStyle to the Modal --- types/react-native/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index b881476782..321978b684 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -4399,6 +4399,10 @@ export interface ModalProperties { * @platform ios */ onDismiss?: () => void; + /** + * The `presentationStyle` determines the style of modal to show + */ + presentationStyle?: "fullScreen" | "pageSheet" | "formSheet" | "overFullScreen"; } export interface ModalStatic extends React.ComponentClass {} From f802a441b48afdcc0a9d3f98a014b881a8f208ed Mon Sep 17 00:00:00 2001 From: Alex Dunne Date: Tue, 3 Apr 2018 13:59:40 +0100 Subject: [PATCH 0415/2153] [react-native] Added platform indicator to presentationStyle prop --- types/react-native/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 321978b684..8323779057 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -4401,6 +4401,7 @@ export interface ModalProperties { onDismiss?: () => void; /** * The `presentationStyle` determines the style of modal to show + * @platform ios */ presentationStyle?: "fullScreen" | "pageSheet" | "formSheet" | "overFullScreen"; } From 64981bc0faccc7a86b3bd354d75d9f44f67bf67a Mon Sep 17 00:00:00 2001 From: Rob Moran Date: Tue, 3 Apr 2018 15:18:48 +0100 Subject: [PATCH 0416/2153] Updated types for noble advertisement data --- types/noble/index.d.ts | 6 +++++- types/noble/noble-tests.ts | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/types/noble/index.d.ts b/types/noble/index.d.ts index 474338d383..ee4fbf1654 100644 --- a/types/noble/index.d.ts +++ b/types/noble/index.d.ts @@ -6,6 +6,7 @@ // Luke Libraro // Dan Chao // Michal Lower +// Rob Moran // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -63,7 +64,10 @@ export declare class Peripheral extends events.EventEmitter { export interface Advertisement { localName: string; - serviceData: Buffer; + serviceData: { + uuid: string, + data: Buffer + }; txPowerLevel: number; manufacturerData: Buffer; serviceUuids: string[]; diff --git a/types/noble/noble-tests.ts b/types/noble/noble-tests.ts index 65e13f4d43..5e00105433 100644 --- a/types/noble/noble-tests.ts +++ b/types/noble/noble-tests.ts @@ -39,7 +39,10 @@ var peripheral: noble.Peripheral = new noble.Peripheral(); peripheral.uuid = "12ad4e81"; peripheral.advertisement = { localName: "device", - serviceData: new Buffer(1), + serviceData: { + uuid: "180a", + data: new Buffer(1) + }, txPowerLevel: 1, manufacturerData: new Buffer(1), serviceUuids: ["0x180a", "0x180d"] From e2b46910aceabaccb64e28c493b821f021d4de99 Mon Sep 17 00:00:00 2001 From: Paul van Brenk Date: Tue, 3 Apr 2018 09:56:35 -0700 Subject: [PATCH 0417/2153] Fix typo in #24560 --- types/d3-fetch/d3-fetch-tests.ts | 4 ++-- types/d3-fetch/index.d.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/d3-fetch/d3-fetch-tests.ts b/types/d3-fetch/d3-fetch-tests.ts index 3cffde0c9e..9712a0da15 100644 --- a/types/d3-fetch/d3-fetch-tests.ts +++ b/types/d3-fetch/d3-fetch-tests.ts @@ -51,8 +51,8 @@ promise2 = d3Fetch.tsv(url, parseRow); promise2 = d3Fetch.tsv(url, init, parseRow); let docPromise: Promise; -docPromise = d3Fetch.hmtl(url); -docPromise = d3Fetch.hmtl(url, init); +docPromise = d3Fetch.html(url); +docPromise = d3Fetch.html(url, init); docPromise = d3Fetch.svg(url); docPromise = d3Fetch.svg(url, init); diff --git a/types/d3-fetch/index.d.ts b/types/d3-fetch/index.d.ts index fc0d5e0e66..6e31d70a76 100644 --- a/types/d3-fetch/index.d.ts +++ b/types/d3-fetch/index.d.ts @@ -154,7 +154,7 @@ export function dsv( * @param url A valid URL string. * @param init An optional request initialization object. */ -export function hmtl(url: string, init?: RequestInit): Promise; +export function html(url: string, init?: RequestInit): Promise; /** * Fetches the image at the specified input URL and returns a promise of an HTML image element. From f48033fba6be70841d67a676cb9c3149e64a218e Mon Sep 17 00:00:00 2001 From: Alex LaFroscia Date: Tue, 3 Apr 2018 10:27:19 -0700 Subject: [PATCH 0418/2153] Add `EmberArray` type export to '@ember/array' --- types/ember/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index 6d8adebae2..c7d344e658 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -3408,6 +3408,7 @@ declare module '@ember/application/resolver' { declare module '@ember/array' { import Ember from 'ember'; + type EmberArray = Ember.Array; const EmberArray: typeof Ember.Array; export default EmberArray; export const A: typeof Ember.A; From 9edfaf06695fa5ecefb217ace86bc7a856b53680 Mon Sep 17 00:00:00 2001 From: Fredrik Nicol Date: Tue, 3 Apr 2018 20:34:36 +0200 Subject: [PATCH 0419/2153] Constrain array length of expand properties --- types/jss/css.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/types/jss/css.d.ts b/types/jss/css.d.ts index 3e5f81c582..2da9aa04b4 100644 --- a/types/jss/css.d.ts +++ b/types/jss/css.d.ts @@ -36,11 +36,13 @@ export interface JssExpand { attachment: CSSProperties['backgroundAttachment']; color: CSSProperties['backgroundColor']; image: CSSProperties['backgroundImage']; - position: CSSProperties['backgroundPosition'] | number[]; // Can be written using array e.g. `[0 0]` + position: + | CSSProperties['backgroundPosition'] + | [csstype.Properties['backgroundPosition'], csstype.Properties['backgroundPosition']]; // Can be written using array e.g. `[0 0]` repeat: CSSProperties['backgroundRepeat']; size: | CSSProperties['backgroundSize'] - | Array; // Can be written using array e.g. `['center' 'center']` + | [csstype.Properties['backgroundSize'], csstype.Properties['backgroundSize']]; // Can be written using array e.g. `['center' 'center']` } | CSSProperties['background']; border: From 80ab453b2c5046e7a2a2e8fa492c97095f384449 Mon Sep 17 00:00:00 2001 From: Fredrik Nicol Date: Tue, 3 Apr 2018 20:36:22 +0200 Subject: [PATCH 0420/2153] Rename generic parameter --- types/jss/index.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/types/jss/index.d.ts b/types/jss/index.d.ts index b22ed4a240..080db10400 100644 --- a/types/jss/index.d.ts +++ b/types/jss/index.d.ts @@ -24,10 +24,10 @@ export interface Rule { toJSON(): string; } -export interface StyleSheet { +export interface StyleSheet { // Gives auto-completion on the rules declared in `createStyleSheet` without // causing errors for rules added dynamically after creation. - classes: Classes; + classes: Classes; options: RuleOptions; linked: boolean; attached: boolean; @@ -44,21 +44,21 @@ export interface StyleSheet { * Will insert a rule also after the stylesheet has been rendered first time. */ addRule(style: Style, options?: Partial): Rule; - addRule(name: Name, style: Style, options?: Partial): Rule; + addRule(name: RuleName, style: Style, options?: Partial): Rule; /** * Create and add rules. * Will render also after Style Sheet was rendered the first time. */ - addRules(styles: Partial>, options?: Partial): Rule[]; + addRules(styles: Partial>, options?: Partial): Rule[]; /** * Get a rule by name. */ - getRule(name: Name): Rule; + getRule(name: RuleName): Rule; /** * Delete a rule by name. * Returns `true`: if rule has been deleted from the DOM. */ - deleteRule(name: Name): boolean; + deleteRule(name: RuleName): boolean; /** * Get index of a rule. */ @@ -67,7 +67,7 @@ export interface StyleSheet { * Update the function values with a new data. */ update(data?: {}): this; - update(name: Name, data: {}): this; + update(name: RuleName, data: {}): this; /** * Convert rules to a CSS string. */ From d8ce691b5a22aad5e0a33f198e4fd340617616ed Mon Sep 17 00:00:00 2001 From: Fredrik Nicol Date: Tue, 3 Apr 2018 20:36:49 +0200 Subject: [PATCH 0421/2153] Upgrade csstype@2 --- types/jss/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/jss/package.json b/types/jss/package.json index 201f7e2d14..f3be220fbc 100644 --- a/types/jss/package.json +++ b/types/jss/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "csstype": "^1.6.0" + "csstype": "^2.0.0" } } From b4529138dd01fd9d829389b1b32a073648bb88ab Mon Sep 17 00:00:00 2001 From: Mohsen Azimi Date: Tue, 3 Apr 2018 12:04:23 -0700 Subject: [PATCH 0422/2153] Take a less invasive path --- types/passport-naver/index.d.ts | 4 ++-- .../passport-oauth2-client-password/index.d.ts | 4 ++-- types/passport-strategy/index.d.ts | 2 +- types/passport/index.d.ts | 17 +++++++++-------- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/types/passport-naver/index.d.ts b/types/passport-naver/index.d.ts index 75c21b76ed..8bd022cd21 100644 --- a/types/passport-naver/index.d.ts +++ b/types/passport-naver/index.d.ts @@ -37,10 +37,10 @@ export interface StrategyOption { export type VerifyFunction = (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void; -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: StrategyOption, verify: VerifyFunction); - authenticate: (req: express.Request, options?: any) => void; + authenticate(req: express.Request, options?: any): void; authorizationParams: (options: any) => any; userProfile: (accessToken: string, done: (error: any, user?: any) => void) => void; } diff --git a/types/passport-oauth2-client-password/index.d.ts b/types/passport-oauth2-client-password/index.d.ts index 2a93a87608..faab5d59d4 100644 --- a/types/passport-oauth2-client-password/index.d.ts +++ b/types/passport-oauth2-client-password/index.d.ts @@ -22,10 +22,10 @@ interface VerifyFunction { (clientId: string, clientSecret: string, done: (error: any, client?: any, info?: any) => void): void; } -declare class Strategy implements passport.Strategy { +declare class Strategy extends passport.Strategy { constructor(options: StrategyOptionsWithRequestInterface, verify: VerifyFunctionWithRequest); constructor(verify: VerifyFunction); name: string; - authenticate: (req: express.Request, options?: {}) => void; + authenticate(req: express.Request, options?: {}): void; } diff --git a/types/passport-strategy/index.d.ts b/types/passport-strategy/index.d.ts index 1a0b2dd4f5..f8b227bfd6 100644 --- a/types/passport-strategy/index.d.ts +++ b/types/passport-strategy/index.d.ts @@ -16,7 +16,7 @@ import passport = require('passport'); import express = require('express'); -declare class Strategy implements passport.Strategy { +declare class Strategy extends passport.Strategy { /** * Performs authentication for the request. * Note: Virtual function - re-implement in the strategy. diff --git a/types/passport/index.d.ts b/types/passport/index.d.ts index cee220e901..4a91d2b64b 100644 --- a/types/passport/index.d.ts +++ b/types/passport/index.d.ts @@ -5,7 +5,6 @@ // Igor Belagorudsky // Tomek Łaziuk // Daniel Perez Alvarez -// Mohsen Azimi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -74,17 +73,15 @@ declare namespace passport { interface PassportStatic extends Authenticator { Authenticator: { new(): Authenticator }; Passport: PassportStatic["Authenticator"]; + Strategy: { new(): Strategy & StrategyCreatedStatic }; } - /** - * @param T Strategy option config - */ - export abstract class Strategy { + interface Strategy { name?: string; + authenticate(this: StrategyCreated, req: express.Request, options?: any): any; + } - /** This method must be implemented by the subclass */ - abstract authenticate(req: express.Request, options?: T): any; - + interface StrategyCreatedStatic { /** * Authenticate `user`, with optional `info`. * @@ -128,6 +125,10 @@ declare namespace passport { error(err: any): void; } + type StrategyCreated = { + [P in keyof O]: O[P]; + }; + interface Profile { provider: string; id: string; From a85c598a91355f3331a4571de824f368d9708e52 Mon Sep 17 00:00:00 2001 From: Alex LaFroscia Date: Tue, 3 Apr 2018 12:54:07 -0700 Subject: [PATCH 0423/2153] Add type exports for additional types --- types/ember/index.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index c7d344e658..740ff1308c 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -6,6 +6,7 @@ // Chris Krycho // Theron Cross // Martin Feckie +// Alex LaFroscia // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -3418,6 +3419,7 @@ declare module '@ember/array' { declare module '@ember/array/mutable' { import Ember from 'ember'; + type MutableArray = Ember.MutableArray; const MutableArray: typeof Ember.MutableArray; export default MutableArray; } @@ -3497,6 +3499,7 @@ declare module '@ember/engine/instance' { declare module '@ember/enumerable' { import Ember from 'ember'; + type Enumerable = Ember.Enumerable; const Enumerable: typeof Ember.Enumerable; export default Enumerable; } @@ -3585,6 +3588,7 @@ declare module '@ember/object/core' { declare module '@ember/object/evented' { import Ember from 'ember'; + type Evented = Ember.Evented; const Evented: typeof Ember.Evented; export default Evented; export const on: typeof Ember.on; @@ -3611,6 +3615,7 @@ declare module '@ember/object/mixin' { declare module '@ember/object/observable' { import Ember from 'ember'; + type Observable = Ember.Observable; const Observable: typeof Ember.Observable; export default Observable; } @@ -3623,6 +3628,7 @@ declare module '@ember/object/observers' { declare module '@ember/object/promise-proxy-mixin' { import Ember from 'ember'; + type PromiseProxyMixin = Ember.PromiseProxyMixin; const PromiseProxyMixin: typeof Ember.PromiseProxyMixin; export default PromiseProxyMixin; } From 2eaf80dd729b3e5ce97d415beb359cd41aaad029 Mon Sep 17 00:00:00 2001 From: Ian Mobley Date: Tue, 3 Apr 2018 13:42:25 -0700 Subject: [PATCH 0424/2153] Add basic express-flash definition express-flash just implements connenct-flash so there is no need to define anything beside the single RequestHandler function that it exports. --- types/express-flash/express-flash-tests.ts | 12 +++++++++++ types/express-flash/index.d.ts | 11 +++++++++++ types/express-flash/tsconfig.json | 23 ++++++++++++++++++++++ types/express-flash/tslint.json | 1 + 4 files changed, 47 insertions(+) create mode 100644 types/express-flash/express-flash-tests.ts create mode 100644 types/express-flash/index.d.ts create mode 100644 types/express-flash/tsconfig.json create mode 100644 types/express-flash/tslint.json diff --git a/types/express-flash/express-flash-tests.ts b/types/express-flash/express-flash-tests.ts new file mode 100644 index 0000000000..c6212c6906 --- /dev/null +++ b/types/express-flash/express-flash-tests.ts @@ -0,0 +1,12 @@ +import express = require('express'); +import flash = require('express-flash'); + +const app = express(); + +app.use(flash()); + +app.use((req) => { + req.flash(); + req.flash('message'); + req.flash('event', 'message'); +}); diff --git a/types/express-flash/index.d.ts b/types/express-flash/index.d.ts new file mode 100644 index 0000000000..e0b00b8d80 --- /dev/null +++ b/types/express-flash/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for express-flash 0.0 +// Project: https://github.com/RGBboy/express-flash +// Definitions by: Ian Mobley +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +import express = require('express'); +declare function flash(): express.RequestHandler; +export = flash; diff --git a/types/express-flash/tsconfig.json b/types/express-flash/tsconfig.json new file mode 100644 index 0000000000..5fbfc5aefd --- /dev/null +++ b/types/express-flash/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "express-flash-tests.ts" + ] +} diff --git a/types/express-flash/tslint.json b/types/express-flash/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/express-flash/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From b9cadc9a0f6bd2e1a3e90f0bc798959fb4b44c86 Mon Sep 17 00:00:00 2001 From: Tom Crockett Date: Tue, 3 Apr 2018 14:11:25 -0700 Subject: [PATCH 0425/2153] [react] Use csstype for React.CSSProperties (#24688) * Use csstype * Fix victory test * Fix aphrodite definitions * Fix issue link in comment --- types/aphrodite/aphrodite-tests.tsx | 4 +- types/aphrodite/index.d.ts | 16 +- types/react/index.d.ts | 1641 +-------------------------- types/react/package.json | 6 + types/victory/victory-tests.tsx | 2 +- 5 files changed, 29 insertions(+), 1640 deletions(-) create mode 100644 types/react/package.json diff --git a/types/aphrodite/aphrodite-tests.tsx b/types/aphrodite/aphrodite-tests.tsx index 685a9a4283..feb35c8c7c 100644 --- a/types/aphrodite/aphrodite-tests.tsx +++ b/types/aphrodite/aphrodite-tests.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { StyleSheet, css, StyleSheetServer, StyleSheetTestUtils } from "aphrodite"; +import { StyleSheet, css, StyleSheetServer, StyleSheetTestUtils, FontFamily } from "aphrodite"; const styles = StyleSheet.create({ red: { @@ -20,7 +20,7 @@ const styles = StyleSheet.create({ } }); -const coolFont = { +const coolFont: FontFamily = { fontFamily: "CoolFont", fontStyle: "normal", fontWeight: "normal", diff --git a/types/aphrodite/index.d.ts b/types/aphrodite/index.d.ts index 00d1908d9f..9684895588 100644 --- a/types/aphrodite/index.d.ts +++ b/types/aphrodite/index.d.ts @@ -6,11 +6,25 @@ import * as React from "react"; +type FontFamily = + | React.CSSProperties['fontFamily'] + | Pick + /** * Aphrodite style declaration */ export interface StyleDeclaration { - [key: string]: React.CSSProperties; + [key: string]: Pick & { + fontFamily?: FontFamily | FontFamily[]; + }; } interface StyleSheetStatic { diff --git a/types/react/index.d.ts b/types/react/index.d.ts index c85b5a0036..49224d93cf 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -52,6 +52,8 @@ React.cloneElement(element, <{ isDisabled?: boolean } & React.Attributes>{ /// +import * as CSS from 'csstype'; + type NativeAnimationEvent = AnimationEvent; type NativeClipboardEvent = ClipboardEvent; type NativeCompositionEvent = CompositionEvent; @@ -909,1642 +911,9 @@ declare namespace React { onTransitionEndCapture?: TransitionEventHandler; } - // See CSS 3 CSS-wide keywords https://www.w3.org/TR/css3-values/#common-keywords - // See CSS 3 Explicit Defaulting https://www.w3.org/TR/css-cascade-3/#defaulting-keywords - // "all CSS properties can accept these values" - type CSSWideKeyword = "initial" | "inherit" | "unset"; - - // See CSS 3 type https://drafts.csswg.org/css-values-3/#percentages - type CSSPercentage = string; - - // See CSS 3 type https://drafts.csswg.org/css-values-3/#lengths - type CSSLength = number | string; - - // This interface is not complete. Only properties accepting - // unitless numbers are listed here (see CSSProperty.js in React) - interface CSSProperties { - /** - * Aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how justify-content aligns individual items within the main-axis. - */ - alignContent?: CSSWideKeyword | "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "stretch"; - - /** - * Sets the default alignment in the cross axis for all of the flex container's items, including anonymous flex items, similarly to how justify-content aligns items along the main axis. - */ - alignItems?: CSSWideKeyword | "flex-start" | "flex-end" | "center" | "baseline" | "stretch"; - - /** - * Allows the default alignment to be overridden for individual flex items. - */ - alignSelf?: CSSWideKeyword | "auto" | "flex-start" | "flex-end" | "center" | "baseline" | "stretch"; - - /** - * This property allows precise alignment of elements, such as graphics, - * that do not have a baseline-table or lack the desired baseline in their baseline-table. - * With the alignment-adjust property, the position of the baseline identified by the alignment-baseline - * can be explicitly determined. It also determines precisely the alignment point for each glyph within a textual element. - */ - alignmentAdjust?: CSSWideKeyword | any; - - alignmentBaseline?: CSSWideKeyword | any; - - /** - * Defines a length of time to elapse before an animation starts, allowing an animation to begin execution some time after it is applied. - */ - animationDelay?: CSSWideKeyword | any; - - /** - * Defines whether an animation should run in reverse on some or all cycles. - */ - animationDirection?: CSSWideKeyword | any; - - /** - * Specifies how many times an animation cycle should play. - */ - animationIterationCount?: CSSWideKeyword | any; - - /** - * Defines the list of animations that apply to the element. - */ - animationName?: CSSWideKeyword | any; - - /** - * Defines whether an animation is running or paused. - */ - animationPlayState?: CSSWideKeyword | any; - - /** - * Allows changing the style of any element to platform-based interface elements or vice versa. - */ - appearance?: CSSWideKeyword | any; - - /** - * Determines whether or not the “back” side of a transformed element is visible when facing the viewer. - */ - backfaceVisibility?: CSSWideKeyword | any; - - /** - * Shorthand property to set the values for one or more of: - * background-clip, background-color, background-image, - * background-origin, background-position, background-repeat, - * background-size, and background-attachment. - */ - background?: CSSWideKeyword | any; - - /** - * If a background-image is specified, this property determines - * whether that image's position is fixed within the viewport, - * or scrolls along with its containing block. - * See CSS 3 background-attachment property https://drafts.csswg.org/css-backgrounds-3/#the-background-attachment - */ - backgroundAttachment?: CSSWideKeyword | "scroll" | "fixed" | "local"; - - /** - * This property describes how the element's background images should blend with each other and the element's background color. - * The value is a list of blend modes that corresponds to each background image. Each element in the list will apply to the - * corresponding element of background-image. If a property doesn’t have enough comma-separated values to match the number of layers, - * the UA must calculate its used value by repeating the list of values until there are enough. - */ - backgroundBlendMode?: CSSWideKeyword | any; - - /** - * Sets the background color of an element. - */ - backgroundColor?: CSSWideKeyword | any; - - backgroundComposite?: CSSWideKeyword | any; - - /** - * Applies one or more background images to an element. These can be any valid CSS image, including url() paths to image files or CSS gradients. - */ - backgroundImage?: CSSWideKeyword | any; - - /** - * Specifies what the background-position property is relative to. - */ - backgroundOrigin?: CSSWideKeyword | any; - - /** - * Sets the position of a background image. - */ - backgroundPosition?: CSSWideKeyword | any; - - /** - * Background-repeat defines if and how background images will be repeated after they have been sized and positioned - */ - backgroundRepeat?: CSSWideKeyword | any; - - /** - * Defines the size of the background images - */ - backgroundSize?: CSSWideKeyword | any; - - /** - * Obsolete - spec retired, not implemented. - */ - baselineShift?: CSSWideKeyword | any; - - /** - * Non standard. Sets or retrieves the location of the Dynamic HTML (DHTML) behavior. - */ - behavior?: CSSWideKeyword | any; - - /** - * Shorthand property that defines the different properties of all four sides of an element's border in a single declaration. - * It can be used to set border-width, border-style and border-color, or a subset of these. - */ - border?: CSSWideKeyword | any; - - /** - * Shorthand that sets the values of border-bottom-color, - * border-bottom-style, and border-bottom-width. - */ - borderBottom?: CSSWideKeyword | any; - - /** - * Sets the color of the bottom border of an element. - */ - borderBottomColor?: CSSWideKeyword | any; - - /** - * Defines the shape of the border of the bottom-left corner. - */ - borderBottomLeftRadius?: CSSWideKeyword | CSSLength; - - /** - * Defines the shape of the border of the bottom-right corner. - */ - borderBottomRightRadius?: CSSWideKeyword | CSSLength; - - /** - * Sets the line style of the bottom border of a box. - */ - borderBottomStyle?: CSSWideKeyword | any; - - /** - * Sets the width of an element's bottom border. To set all four borders, - * use the border-width shorthand property which sets the values simultaneously for border-top-width, - * border-right-width, border-bottom-width, and border-left-width. - */ - borderBottomWidth?: CSSWideKeyword | any; - - /** - * Border-collapse can be used for collapsing the borders between table cells - */ - borderCollapse?: CSSWideKeyword | any; - - /** - * The CSS border-color property sets the color of an element's four borders. - * This property can have from one to four values, made up of the elementary properties: - * • border-top-color - * • border-right-color - * • border-bottom-color - * • border-left-color The default color is the currentColor of each of these values. - * If you provide one value, it sets the color for the element. Two values set the horizontal and vertical values, - * respectively. Providing three values sets the top, vertical, and bottom values, in that order. - * Four values set all for sides: top, right, bottom, and left, in that order. - */ - borderColor?: CSSWideKeyword | any; - - /** - * Specifies different corner clipping effects, such as scoop (inner curves), bevel (straight cuts) or notch (cut-off rectangles). - * Works along with border-radius to specify the size of each corner effect. - */ - borderCornerShape?: CSSWideKeyword | any; - - /** - * The property border-image-source is used to set the image to be used instead of the border style. - * If this is set to none the border-style is used instead. - */ - borderImageSource?: CSSWideKeyword | any; - - /** - * The border-image-width CSS property defines the offset to use for dividing the border image in nine parts, - * the top-left corner, central top edge, top-right-corner, central right edge, bottom-right corner, central bottom edge, - * bottom-left corner, and central right edge. They represent inward distance from the top, right, bottom, and left edges. - */ - borderImageWidth?: CSSWideKeyword | any; - - /** - * Shorthand property that defines the border-width, border-style and border-color of an element's left border in a single declaration. - * Note that you can use the corresponding longhand properties to set specific individual properties of the left border — border-left-width, - * border-left-style and border-left-color. - */ - borderLeft?: CSSWideKeyword | any; - - /** - * The CSS border-left-color property sets the color of an element's left border. This page explains the border-left-color value, - * but often you will find it more convenient to fix the border's left color as part of a shorthand set, either border-left or border-color. - * Colors can be defined several ways. For more information, see Usage. - */ - borderLeftColor?: CSSWideKeyword | any; - - /** - * Sets the style of an element's left border. To set all four borders, use the shorthand property, border-style. - * Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. - */ - borderLeftStyle?: CSSWideKeyword | any; - - /** - * Sets the width of an element's left border. To set all four borders, - * use the border-width shorthand property which sets the values simultaneously for border-top-width, - * border-right-width, border-bottom-width, and border-left-width. - */ - borderLeftWidth?: CSSWideKeyword | any; - - /** - * Shorthand property that sets the rounding of all four corners. - */ - borderRadius?: CSSWideKeyword | CSSLength; - - /** - * Shorthand property that defines the border-width, border-style and border-color of an element's right border - * in a single declaration. Note that you can use the corresponding longhand properties to set specific - * individual properties of the right border — border-right-width, border-right-style and border-right-color. - */ - borderRight?: CSSWideKeyword | any; - - /** - * Sets the color of an element's right border. This page explains the border-right-color value, - * but often you will find it more convenient to fix the border's right color as part of a shorthand set, - * either border-right or border-color. - * Colors can be defined several ways. For more information, see Usage. - */ - borderRightColor?: CSSWideKeyword | any; - - /** - * Sets the style of an element's right border. To set all four borders, use the shorthand property, - * border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, - * border-bottom-style, border-left-style. - */ - borderRightStyle?: CSSWideKeyword | any; - - /** - * Sets the width of an element's right border. To set all four borders, - * use the border-width shorthand property which sets the values simultaneously for border-top-width, - * border-right-width, border-bottom-width, and border-left-width. - */ - borderRightWidth?: CSSWideKeyword | any; - - /** - * Specifies the distance between the borders of adjacent cells. - */ - borderSpacing?: CSSWideKeyword | any; - - /** - * Sets the style of an element's four borders. This property can have from one to four values. - * With only one value, the value will be applied to all four borders; - * otherwise, this works as a shorthand property for each of border-top-style, border-right-style, - * border-bottom-style, border-left-style, where each border style may be assigned a separate value. - */ - borderStyle?: CSSWideKeyword | any; - - /** - * Shorthand property that defines the border-width, border-style and border-color of an element's top border - * in a single declaration. Note that you can use the corresponding longhand properties to set specific - * individual properties of the top border — border-top-width, border-top-style and border-top-color. - */ - borderTop?: CSSWideKeyword | any; - - /** - * Sets the color of an element's top border. This page explains the border-top-color value, - * but often you will find it more convenient to fix the border's top color as part of a shorthand set, - * either border-top or border-color. - * Colors can be defined several ways. For more information, see Usage. - */ - borderTopColor?: CSSWideKeyword | any; - - /** - * Sets the rounding of the top-left corner of the element. - */ - borderTopLeftRadius?: CSSWideKeyword | CSSLength; - - /** - * Sets the rounding of the top-right corner of the element. - */ - borderTopRightRadius?: CSSWideKeyword | CSSLength; - - /** - * Sets the style of an element's top border. To set all four borders, use the shorthand property, border-style. - * Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. - */ - borderTopStyle?: CSSWideKeyword | any; - - /** - * Sets the width of an element's top border. To set all four borders, - * use the border-width shorthand property which sets the values simultaneously for border-top-width, - * border-right-width, border-bottom-width, and border-left-width. - */ - borderTopWidth?: CSSWideKeyword | any; - - /** - * Sets the width of an element's four borders. This property can have from one to four values. - * This is a shorthand property for setting values simultaneously for border-top-width, - * border-right-width, border-bottom-width, and border-left-width. - */ - borderWidth?: CSSWideKeyword | any; - - /** - * This property specifies how far an absolutely positioned box's bottom margin edge - * is offset above the bottom edge of the box's containing block. For relatively positioned boxes, - * the offset is with respect to the bottom edges of the box itself - * (i.e., the box is given a position in the normal flow, then offset from that position according to these properties). - */ - bottom?: CSSWideKeyword | any; - - /** - * Obsolete. - */ - boxAlign?: CSSWideKeyword | any; - - /** - * Breaks a box into fragments creating new borders, - * padding and repeating backgrounds or lets it stay as a continuous box on a page break, - * column break, or, for inline elements, at a line break. - */ - boxDecorationBreak?: CSSWideKeyword | any; - - /** - * Deprecated - */ - boxDirection?: CSSWideKeyword | any; - - /** - * Do not use. This property has been replaced by the flex-wrap property. - * Gets or sets a value that specifies the direction to add successive rows or columns when the value of box-lines is set to multiple. - */ - boxLineProgression?: CSSWideKeyword | any; - - /** - * Do not use. This property has been replaced by the flex-wrap property. - * Gets or sets a value that specifies whether child elements wrap onto multiple lines or columns based on the space available in the object. - */ - boxLines?: CSSWideKeyword | any; - - /** - * Do not use. This property has been replaced by flex-order. - * Specifies the ordinal group that a child element of the object belongs to. - * This ordinal value identifies the display order (along the axis defined by the box-orient property) for the group. - */ - boxOrdinalGroup?: CSSWideKeyword | any; - - /** - * Deprecated. - */ - boxFlex?: CSSWideKeyword | number; - - /** - * Deprecated. - */ - boxFlexGroup?: CSSWideKeyword | number; - - /** - * Cast a drop shadow from the frame of almost any element. - * MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow - */ - boxShadow?: CSSWideKeyword | any; - - /** - * The CSS break-after property allows you to force a break on multi-column layouts. - * More specifically, it allows you to force a break after an element. - * It allows you to determine if a break should occur, and what type of break it should be. - * The break-after CSS property describes how the page, column or region break behaves after the generated box. - * If there is no generated box, the property is ignored. - */ - breakAfter?: CSSWideKeyword | any; - - /** - * Control page/column/region breaks that fall above a block of content - */ - breakBefore?: CSSWideKeyword | any; - - /** - * Control page/column/region breaks that fall within a block of content - */ - breakInside?: CSSWideKeyword | any; - - /** - * The clear CSS property specifies if an element can be positioned next to - * or must be positioned below the floating elements that precede it in the markup. - */ - clear?: CSSWideKeyword | any; - - /** - * Deprecated; see clip-path. - * Lets you specify the dimensions of an absolutely positioned element that should be visible, - * and the element is clipped into this shape, and displayed. - */ - clip?: CSSWideKeyword | any; - - /** - * Clipping crops an graphic, so that only a portion of the graphic is rendered, or filled. - * This clip-rule property, when used with the clip-path property, defines which clip rule, or algorithm, - * to use when filling the different parts of a graphics. - */ - clipRule?: CSSWideKeyword | any; - - /** - * The color property sets the color of an element's foreground content (usually text), - * accepting any standard CSS color from keywords and hex values to RGB(a) and HSL(a). - */ - color?: CSSWideKeyword | any; - - /** - * Describes the number of columns of the element. - * See CSS 3 column-count property https://www.w3.org/TR/css3-multicol/#cc - */ - columnCount?: CSSWideKeyword | number | "auto"; - - /** - * Specifies how to fill columns (balanced or sequential). - */ - columnFill?: CSSWideKeyword | any; - - /** - * The column-gap property controls the width of the gap between columns in multi-column elements. - */ - columnGap?: CSSWideKeyword | any; - - /** - * Sets the width, style, and color of the rule between columns. - */ - columnRule?: CSSWideKeyword | any; - - /** - * Specifies the color of the rule between columns. - */ - columnRuleColor?: CSSWideKeyword | any; - - /** - * Specifies the width of the rule between columns. - */ - columnRuleWidth?: CSSWideKeyword | any; - - /** - * The column-span CSS property makes it possible for an element to span across all columns when its value is set to all. - * An element that spans more than one column is called a spanning element. - */ - columnSpan?: CSSWideKeyword | any; - - /** - * Specifies the width of columns in multi-column elements. - */ - columnWidth?: CSSWideKeyword | any; - - /** - * This property is a shorthand property for setting column-width and/or column-count. - */ - columns?: CSSWideKeyword | any; - - /** - * The counter-increment property accepts one or more names of counters (identifiers), - * each one optionally followed by an integer which specifies the value by which the counter should be incremented - * (e.g. if the value is 2, the counter increases by 2 each time it is invoked). - */ - counterIncrement?: CSSWideKeyword | any; - - /** - * The counter-reset property contains a list of one or more names of counters, - * each one optionally followed by an integer (otherwise, the integer defaults to 0.). - * Each time the given element is invoked, the counters specified by the property are set to the given integer. - */ - counterReset?: CSSWideKeyword | any; - - /** - * The cue property specifies sound files (known as an "auditory icon") to be played by speech media agents - * before and after presenting an element's content; if only one file is specified, it is played both before and after. - * The volume at which the file(s) should be played, relative to the volume of the main element, may also be specified. - * The icon files may also be set separately with the cue-before and cue-after properties. - */ - cue?: CSSWideKeyword | any; - - /** - * The cue-after property specifies a sound file (known as an "auditory icon") to be played by speech media agents - * after presenting an element's content; the volume at which the file should be played may also be specified. - * The shorthand property cue sets cue sounds for both before and after the element is presented. - */ - cueAfter?: CSSWideKeyword | any; - - /** - * Specifies the mouse cursor displayed when the mouse pointer is over an element. - */ - cursor?: CSSWideKeyword | any; - - /** - * The direction CSS property specifies the text direction/writing direction. The rtl is used for Hebrew or Arabic text, the ltr is for other languages. - */ - direction?: CSSWideKeyword | any; - - /** - * This property specifies the type of rendering box used for an element. It is a shorthand property for many other display properties. - */ - display?: CSSWideKeyword | any; - - /** - * The ‘fill’ property paints the interior of the given graphical element. - * The area to be painted consists of any areas inside the outline of the shape. - * To determine the inside of the shape, all subpaths are considered, - * and the interior is determined according to the rules associated with the current value of the ‘fill-rule’ property. - * The zero-width geometric outline of a shape is included in the area to be painted. - */ - fill?: CSSWideKeyword | any; - - /** - * SVG: Specifies the opacity of the color or the content the current object is filled with. - * See SVG 1.1 https://www.w3.org/TR/SVG/painting.html#FillOpacityProperty - */ - fillOpacity?: CSSWideKeyword | number; - - /** - * The ‘fill-rule’ property indicates the algorithm which is to be used to determine what parts of the canvas are included inside the shape. - * For a simple, non-intersecting path, it is intuitively clear what region lies "inside"; - * however, for a more complex path, such as a path that intersects itself or where one subpath encloses another, - * the interpretation of "inside" is not so obvious. - * The ‘fill-rule’ property provides two options for how the inside of a shape is determined: - */ - fillRule?: CSSWideKeyword | any; - - /** - * Applies various image processing effects. This property is largely unsupported. See Compatibility section for more information. - */ - filter?: CSSWideKeyword | any; - - /** - * Shorthand for `flex-grow`, `flex-shrink`, and `flex-basis`. - */ - flex?: CSSWideKeyword | number | string; - - /** - * Obsolete, do not use. This property has been renamed to align-items. - * Specifies the alignment (perpendicular to the layout axis defined by the flex-direction property) of child elements of the object. - */ - flexAlign?: CSSWideKeyword | any; - - /** - * The flex-basis CSS property describes the initial main size of the flex item - * before any free space is distributed according to the flex factors described in the flex property (flex-grow and flex-shrink). - */ - flexBasis?: CSSWideKeyword | any; - - /** - * The flex-direction CSS property describes how flex items are placed in the flex container, by setting the direction of the flex container's main axis. - */ - flexDirection?: CSSWideKeyword | "row" | "row-reverse" | "column" | "column-reverse"; - - /** - * The flex-flow CSS property defines the flex container's main and cross axis. It is a shorthand property for the flex-direction and flex-wrap properties. - */ - flexFlow?: CSSWideKeyword | string; - - /** - * Specifies the flex grow factor of a flex item. - * See CSS flex-grow property https://drafts.csswg.org/css-flexbox-1/#flex-grow-property - */ - flexGrow?: CSSWideKeyword | number; - - /** - * Do not use. This property has been renamed to align-self - * Specifies the alignment (perpendicular to the layout axis defined by flex-direction) of child elements of the object. - */ - flexItemAlign?: CSSWideKeyword | any; - - /** - * Do not use. This property has been renamed to align-content. - * Specifies how a flexbox's lines align within the flexbox when there is extra space along the axis that is perpendicular to the axis defined by the flex-direction property. - */ - flexLinePack?: CSSWideKeyword | any; - - /** - * Gets or sets a value that specifies the ordinal group that a flexbox element belongs to. This ordinal value identifies the display order for the group. - */ - flexOrder?: CSSWideKeyword | any; - - /** - * Specifies the flex shrink factor of a flex item. - * See CSS flex-shrink property https://drafts.csswg.org/css-flexbox-1/#flex-shrink-property - */ - flexShrink?: CSSWideKeyword | number; - - /** - * Specifies whether flex items are forced into a single line or can be wrapped onto multiple lines. - * If wrapping is allowed, this property also enables you to control the direction in which lines are stacked. - * See CSS flex-wrap property https://drafts.csswg.org/css-flexbox-1/#flex-wrap-property - */ - flexWrap?: CSSWideKeyword | "nowrap" | "wrap" | "wrap-reverse"; - - /** - * Elements which have the style float are floated horizontally. - * These elements can move as far to the left or right of the containing element. - * All elements after the floating element will flow around it, but elements before the floating element are not impacted. - * If several floating elements are placed after each other, they will float next to each other as long as there is room. - */ - float?: CSSWideKeyword | any; - - /** - * Flows content from a named flow (specified by a corresponding flow-into) through selected elements to form a dynamic chain of layout regions. - */ - flowFrom?: CSSWideKeyword | any; - - /** - * The font property is shorthand that allows you to do one of two things: you can either set up six of the most mature font properties in one line, - * or you can set one of a choice of keywords to adopt a system font setting. - */ - font?: CSSWideKeyword | any; - - /** - * The font-family property allows one or more font family names and/or generic family names to be specified for usage on the selected element(s)' text. - * The browser then goes through the list; for each character in the selection it applies the first font family that has an available glyph for that character. - */ - fontFamily?: CSSWideKeyword | any; - - /** - * The font-kerning property allows contextual adjustment of inter-glyph spacing, i.e. the spaces between the characters in text. - * This property controls metric kerning - that utilizes adjustment data contained in the font. Optical Kerning is not supported as yet. - */ - fontKerning?: CSSWideKeyword | any; - - /** - * Specifies the size of the font. Used to compute em and ex units. - * See CSS 3 font-size property https://www.w3.org/TR/css-fonts-3/#propdef-font-size - */ - fontSize?: CSSWideKeyword | - "xx-small" | "x-small" | "small" | "medium" | "large" | "x-large" | "xx-large" | - "larger" | "smaller" | - CSSLength | CSSPercentage; - - /** - * The font-size-adjust property adjusts the font-size of the fallback fonts defined with font-family, - * so that the x-height is the same no matter what font is used. - * This preserves the readability of the text when fallback happens. - * See CSS 3 font-size-adjust property https://www.w3.org/TR/css-fonts-3/#propdef-font-size-adjust - */ - fontSizeAdjust?: CSSWideKeyword | "none" | number; - - /** - * Allows you to expand or condense the widths for a normal, condensed, or expanded font face. - * See CSS 3 font-stretch property https://drafts.csswg.org/css-fonts-3/#propdef-font-stretch - */ - fontStretch?: CSSWideKeyword | - "normal" | "ultra-condensed" | "extra-condensed" | "condensed" | "semi-condensed" | - "semi-expanded" | "expanded" | "extra-expanded" | "ultra-expanded"; - - /** - * The font-style property allows normal, italic, or oblique faces to be selected. - * Italic forms are generally cursive in nature while oblique faces are typically sloped versions of the regular face. - * Oblique faces can be simulated by artificially sloping the glyphs of the regular face. - * See CSS 3 font-style property https://www.w3.org/TR/css-fonts-3/#propdef-font-style - */ - fontStyle?: CSSWideKeyword | "normal" | "italic" | "oblique"; - - /** - * This value specifies whether the user agent is allowed to synthesize bold or oblique font faces when a font family lacks bold or italic faces. - */ - fontSynthesis?: CSSWideKeyword | any; - - /** - * The font-variant property enables you to select the small-caps font within a font family. - */ - fontVariant?: CSSWideKeyword | any; - - /** - * Fonts can provide alternate glyphs in addition to default glyph for a character. This property provides control over the selection of these alternate glyphs. - */ - fontVariantAlternates?: CSSWideKeyword | any; - - /** - * Specifies the weight or boldness of the font. - * See CSS 3 'font-weight' property https://www.w3.org/TR/css-fonts-3/#propdef-font-weight - */ - fontWeight?: CSSWideKeyword | "normal" | "bold" | "bolder" | "lighter" | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900; - - /** - * Lays out one or more grid items bound by 4 grid lines. Shorthand for setting grid-column-start, grid-column-end, grid-row-start, and grid-row-end in a single declaration. - */ - gridArea?: CSSWideKeyword | any; - - /** - * Controls a grid item's placement in a grid area, particularly grid position and a grid span. Shorthand for setting grid-column-start and grid-column-end in a single declaration. - */ - gridColumn?: CSSWideKeyword | any; - - /** - * Controls a grid item's placement in a grid area as well as grid position and a grid span. - * The grid-column-end property (with grid-row-start, grid-row-end, and grid-column-start) determines a grid item's placement by specifying the grid lines of a grid item's grid area. - */ - gridColumnEnd?: CSSWideKeyword | any; - - /** - * Determines a grid item's placement by specifying the starting grid lines of a grid item's grid area. - * A grid item's placement in a grid area consists of a grid position and a grid span. - * See also ( grid-row-start, grid-row-end, and grid-column-end) - */ - gridColumnStart?: CSSWideKeyword | any; - - /** - * Gets or sets a value that indicates which row an element within a Grid should appear in. Shorthand for setting grid-row-start and grid-row-end in a single declaration. - */ - gridRow?: CSSWideKeyword | any; - - /** - * Determines a grid item’s placement by specifying the block-end. A grid item's placement in a grid area consists of a grid position and a grid span. - * The grid-row-end property (with grid-row-start, grid-column-start, and grid-column-end) determines a grid item's placement by specifying the grid lines of a grid item's grid area. - */ - gridRowEnd?: CSSWideKeyword | any; - - /** - * Specifies a row position based upon an integer location, string value, or desired row size. - * css/properties/grid-row is used as short-hand for grid-row-position and grid-row-position - */ - gridRowPosition?: CSSWideKeyword | any; - - gridRowSpan?: CSSWideKeyword | any; - - /** - * Specifies named grid areas which are not associated with any particular grid item, but can be referenced from the grid-placement properties. - * The syntax of the grid-template-areas property also provides a visualization of the structure of the grid, making the overall layout of the grid container easier to understand. - */ - gridTemplateAreas?: CSSWideKeyword | any; - - /** - * Specifies (with grid-template-rows) the line names and track sizing functions of the grid. - * Each sizing function can be specified as a length, a percentage of the grid container’s size, - * a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. - */ - gridTemplateColumns?: CSSWideKeyword | any; - - /** - * Specifies (with grid-template-columns) the line names and track sizing functions of the grid. - * Each sizing function can be specified as a length, a percentage of the grid container’s size, - * a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. - */ - gridTemplateRows?: CSSWideKeyword | any; - - /** - * Sets the height of an element. The content area of the element height does not include the padding, border, and margin of the element. - */ - height?: CSSWideKeyword | any; - - /** - * Specifies the minimum number of characters in a hyphenated word - */ - hyphenateLimitChars?: CSSWideKeyword | any; - - /** - * Indicates the maximum number of successive hyphenated lines in an element. The ‘no-limit’ value means that there is no limit. - */ - hyphenateLimitLines?: CSSWideKeyword | any; - - /** - * Specifies the maximum amount of trailing whitespace (before justification) that may be left in a line before hyphenation is triggered - * to pull part of a word from the next line back up into the current one. - */ - hyphenateLimitZone?: CSSWideKeyword | any; - - /** - * Specifies whether or not words in a sentence can be split by the use of a manual or automatic hyphenation mechanism. - */ - hyphens?: CSSWideKeyword | any; - - imeMode?: CSSWideKeyword | any; - - /** - * Defines how the browser distributes space between and around flex items - * along the main-axis of their container. - * See CSS justify-content property https://www.w3.org/TR/css-flexbox-1/#justify-content-property - */ - justifyContent?: CSSWideKeyword | "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch"; - - layoutGrid?: CSSWideKeyword | any; - - layoutGridChar?: CSSWideKeyword | any; - - layoutGridLine?: CSSWideKeyword | any; - - layoutGridMode?: CSSWideKeyword | any; - - layoutGridType?: CSSWideKeyword | any; - - /** - * Sets the left edge of an element - */ - left?: CSSWideKeyword | any; - - /** - * The letter-spacing CSS property specifies the spacing behavior between text characters. - */ - letterSpacing?: CSSWideKeyword | any; - - /** - * Deprecated. Gets or sets line-breaking rules for text in selected languages such as Japanese, Chinese, and Korean. - */ - lineBreak?: CSSWideKeyword | any; - - lineClamp?: CSSWideKeyword | number; - - /** - * Specifies the height of an inline block level element. - * See CSS 2.1 line-height property https://www.w3.org/TR/CSS21/visudet.html#propdef-line-height - */ - lineHeight?: CSSWideKeyword | "normal" | number | CSSLength | CSSPercentage; - - /** - * Shorthand property that sets the list-style-type, list-style-position and list-style-image properties in one declaration. - */ - listStyle?: CSSWideKeyword | any; - - /** - * This property sets the image that will be used as the list item marker. When the image is available, - * it will replace the marker set with the 'list-style-type' marker. That also means that if the image is not available, - * it will show the style specified by list-style-property - */ - listStyleImage?: CSSWideKeyword | any; - - /** - * Specifies if the list-item markers should appear inside or outside the content flow. - */ - listStylePosition?: CSSWideKeyword | any; - - /** - * Specifies the type of list-item marker in a list. - */ - listStyleType?: CSSWideKeyword | any; - - /** - * The margin property is shorthand to allow you to set all four margins of an element at once. - * Its equivalent longhand properties are margin-top, margin-right, margin-bottom and margin-left. - * Negative values are also allowed. - */ - margin?: CSSWideKeyword | any; - - /** - * margin-bottom sets the bottom margin of an element. - */ - marginBottom?: CSSWideKeyword | any; - - /** - * margin-left sets the left margin of an element. - */ - marginLeft?: CSSWideKeyword | any; - - /** - * margin-right sets the right margin of an element. - */ - marginRight?: CSSWideKeyword | any; - - /** - * margin-top sets the top margin of an element. - */ - marginTop?: CSSWideKeyword | any; - - /** - * The marquee-direction determines the initial direction in which the marquee content moves. - */ - marqueeDirection?: CSSWideKeyword | any; - - /** - * The 'marquee-style' property determines a marquee's scrolling behavior. - */ - marqueeStyle?: CSSWideKeyword | any; - - /** - * This property is shorthand for setting mask-image, mask-mode, mask-repeat, mask-position, mask-clip, mask-origin, mask-composite and mask-size. - * Omitted values are set to their original properties' initial values. - */ - mask?: CSSWideKeyword | any; - - /** - * This property is shorthand for setting mask-border-source, mask-border-slice, mask-border-width, mask-border-outset, and mask-border-repeat. - * Omitted values are set to their original properties' initial values. - */ - maskBorder?: CSSWideKeyword | any; - - /** - * This property specifies how the images for the sides and the middle part of the mask image are scaled and tiled. - * The first keyword applies to the horizontal sides, the second one applies to the vertical ones. - * If the second keyword is absent, it is assumed to be the same as the first, similar to the CSS border-image-repeat property. - */ - maskBorderRepeat?: CSSWideKeyword | any; - - /** - * This property specifies inward offsets from the top, right, bottom, and left edges of the mask image, - * dividing it into nine regions: four corners, four edges, and a middle. - * The middle image part is discarded and treated as fully transparent black unless the fill keyword is present. - * The four values set the top, right, bottom and left offsets in that order, similar to the CSS border-image-slice property. - */ - maskBorderSlice?: CSSWideKeyword | any; - - /** - * Specifies an image to be used as a mask. An image that is empty, fails to download, is non-existent, or cannot be displayed is ignored and does not mask the element. - */ - maskBorderSource?: CSSWideKeyword | any; - - /** - * This property sets the width of the mask box image, similar to the CSS border-image-width property. - */ - maskBorderWidth?: CSSWideKeyword | any; - - /** - * Determines the mask painting area, which defines the area that is affected by the mask. - * The painted content of an element may be restricted to this area. - */ - maskClip?: CSSWideKeyword | any; - - /** - * For elements rendered as a single box, specifies the mask positioning area. - * For elements rendered as multiple boxes (e.g., inline boxes on several lines, boxes on several pages) - * specifies which boxes box-decoration-break operates on to determine the mask positioning area(s). - */ - maskOrigin?: CSSWideKeyword | any; - - /** - * This property must not be used. It is no longer included in any standard or standard track specification, - * nor is it implemented in any browser. It is only used when the text-align-last property is set to size. - * It controls allowed adjustments of font-size to fit line content. - */ - maxFontSize?: CSSWideKeyword | any; - - /** - * Sets the maximum height for an element. It prevents the height of the element to exceed the specified value. - * If min-height is specified and is greater than max-height, max-height is overridden. - */ - maxHeight?: CSSWideKeyword | any; - - /** - * Sets the maximum width for an element. It limits the width property to be larger than the value specified in max-width. - */ - maxWidth?: CSSWideKeyword | any; - - /** - * Sets the minimum height for an element. It prevents the height of the element to be smaller than the specified value. - * The value of min-height overrides both max-height and height. - */ - minHeight?: CSSWideKeyword | any; - - /** - * Sets the minimum width of an element. It limits the width property to be not smaller than the value specified in min-width. - */ - minWidth?: CSSWideKeyword | any; - - /** - * Specifies the transparency of an element. - * See CSS 3 opacity property https://drafts.csswg.org/css-color-3/#opacity - */ - opacity?: CSSWideKeyword | number; - - /** - * Specifies the order used to lay out flex items in their flex container. - * Elements are laid out in the ascending order of the order value. - * See CSS order property https://drafts.csswg.org/css-flexbox-1/#order-property - */ - order?: CSSWideKeyword | number; - - /** - * In paged media, this property defines the minimum number of lines in - * a block container that must be left at the bottom of the page. - * See CSS 3 orphans, widows properties https://drafts.csswg.org/css-break-3/#widows-orphans - */ - orphans?: CSSWideKeyword | number; - - /** - * The CSS outline property is a shorthand property for setting one or more of the individual outline properties outline-style, - * outline-width and outline-color in a single rule. In most cases the use of this shortcut is preferable and more convenient. - * Outlines differ from borders in the following ways: - * • Outlines do not take up space, they are drawn above the content. - * • Outlines may be non-rectangular. They are rectangular in Gecko/Firefox. - * Internet Explorer attempts to place the smallest contiguous outline around all elements or shapes that are indicated to have an outline. - * Opera draws a non-rectangular shape around a construct. - */ - outline?: CSSWideKeyword | any; - - /** - * The outline-color property sets the color of the outline of an element. An outline is a line that is drawn around elements, outside the border edge, to make the element stand out. - */ - outlineColor?: CSSWideKeyword | any; - - /** - * The outline-offset property offsets the outline and draw it beyond the border edge. - */ - outlineOffset?: CSSWideKeyword | any; - - /** - * The overflow property controls how extra content exceeding the bounding box of an element is rendered. - * It can be used in conjunction with an element that has a fixed width and height, to eliminate text-induced page distortion. - */ - overflow?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; - - /** - * Specifies the preferred scrolling methods for elements that overflow. - */ - overflowStyle?: CSSWideKeyword | any; - - /** - * Controls how extra content exceeding the x-axis of the bounding box of an element is rendered. - */ - overflowX?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; - - /** - * Controls how extra content exceeding the y-axis of the bounding box of an element is rendered. - */ - overflowY?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; - - /** - * The padding optional CSS property sets the required padding space on one to four sides of an element. - * The padding area is the space between an element and its border. Negative values are not allowed but decimal values are permitted. - * The element size is treated as fixed, and the content of the element shifts toward the center as padding is increased. - * The padding property is a shorthand to avoid setting each side separately (padding-top, padding-right, padding-bottom, padding-left). - */ - padding?: CSSWideKeyword | any; - - /** - * The padding-bottom CSS property of an element sets the padding space required on the bottom of an element. - * The padding area is the space between the content of the element and its border. - * Contrary to margin-bottom values, negative values of padding-bottom are invalid. - */ - paddingBottom?: CSSWideKeyword | any; - - /** - * The padding-left CSS property of an element sets the padding space required on the left side of an element. - * The padding area is the space between the content of the element and its border. - * Contrary to margin-left values, negative values of padding-left are invalid. - */ - paddingLeft?: CSSWideKeyword | any; - - /** - * The padding-right CSS property of an element sets the padding space required on the right side of an element. - * The padding area is the space between the content of the element and its border. - * Contrary to margin-right values, negative values of padding-right are invalid. - */ - paddingRight?: CSSWideKeyword | any; - - /** - * The padding-top CSS property of an element sets the padding space required on the top of an element. - * The padding area is the space between the content of the element and its border. - * Contrary to margin-top values, negative values of padding-top are invalid. - */ - paddingTop?: CSSWideKeyword | any; - - /** - * The page-break-after property is supported in all major browsers. With CSS3, page-break-* properties are only aliases of the break-* properties. - * The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. - */ - pageBreakAfter?: CSSWideKeyword | any; - - /** - * The page-break-before property sets the page-breaking behavior before an element. - * With CSS3, page-break-* properties are only aliases of the break-* properties. - * The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. - */ - pageBreakBefore?: CSSWideKeyword | any; - - /** - * Sets the page-breaking behavior inside an element. With CSS3, page-break-* properties are only aliases of the break-* properties. - * The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. - */ - pageBreakInside?: CSSWideKeyword | any; - - /** - * The pause property determines how long a speech media agent should pause before and after presenting an element. - * It is a shorthand for the pause-before and pause-after properties. - */ - pause?: CSSWideKeyword | any; - - /** - * The pause-after property determines how long a speech media agent should pause after presenting an element. - * It may be replaced by the shorthand property pause, which sets pause time before and after. - */ - pauseAfter?: CSSWideKeyword | any; - - /** - * The pause-before property determines how long a speech media agent should pause before presenting an element. - * It may be replaced by the shorthand property pause, which sets pause time before and after. - */ - pauseBefore?: CSSWideKeyword | any; - - /** - * The perspective property defines how far an element is placed from the view on the z-axis, from the screen to the viewer. - * Perspective defines how an object is viewed. In graphic arts, perspective is the representation on a flat surface of what the viewer's eye would see in a 3D space. - * (See Wikipedia for more information about graphical perspective and for related illustrations.) - * The illusion of perspective on a flat surface, such as a computer screen, - * is created by projecting points on the flat surface as they would appear if the flat surface were a window - * through which the viewer was looking at the object. In discussion of virtual environments, this flat surface is called a projection plane. - */ - perspective?: CSSWideKeyword | any; - - /** - * The perspective-origin property establishes the origin for the perspective property. - * It effectively sets the X and Y position at which the viewer appears to be looking at the children of the element. - * When used with perspective, perspective-origin changes the appearance of an object, - * as if a viewer were looking at it from a different origin. - * An object appears differently if a viewer is looking directly at it versus looking at it from below, above, or from the side. - * Thus, the perspective-origin is like a vanishing point. - * The default value of perspective-origin is 50% 50%. - * This displays an object as if the viewer's eye were positioned directly at the center of the screen, both top-to-bottom and left-to-right. - * A value of 0% 0% changes the object as if the viewer was looking toward the top left angle. - * A value of 100% 100% changes the appearance as if viewed toward the bottom right angle. - */ - perspectiveOrigin?: CSSWideKeyword | any; - - /** - * The pointer-events property allows you to control whether an element can be the target for the pointing device (e.g, mouse, pen) events. - */ - pointerEvents?: CSSWideKeyword | any; - - /** - * The position property controls the type of positioning used by an element within its parent elements. - * The effect of the position property depends on a lot of factors, for example the position property of parent elements. - */ - position?: CSSWideKeyword | "static" | "relative" | "absolute" | "fixed" | "sticky"; - - /** - * Obsolete: unsupported. - * This property determines whether or not a full-width punctuation mark character should be trimmed if it appears at the beginning of a line, - * so that its "ink" lines up with the first glyph in the line above and below. - */ - punctuationTrim?: CSSWideKeyword | any; - - /** - * Sets the type of quotation marks for embedded quotations. - */ - quotes?: CSSWideKeyword | any; - - /** - * Controls whether the last region in a chain displays additional 'overset' content according its default overflow property, - * or if it displays a fragment of content as if it were flowing into a subsequent region. - */ - regionFragment?: CSSWideKeyword | any; - - /** - * The rest-after property determines how long a speech media agent should pause after presenting an element's main content, - * before presenting that element's exit cue sound. It may be replaced by the shorthand property rest, which sets rest time before and after. - */ - restAfter?: CSSWideKeyword | any; - - /** - * The rest-before property determines how long a speech media agent should pause after presenting an intro cue sound for an element, - * before presenting that element's main content. It may be replaced by the shorthand property rest, which sets rest time before and after. - */ - restBefore?: CSSWideKeyword | any; - - /** - * Specifies the position an element in relation to the right side of the containing element. - */ - right?: CSSWideKeyword | any; - - rubyAlign?: CSSWideKeyword | any; - - rubyPosition?: CSSWideKeyword | any; - - /** - * Defines the alpha channel threshold used to extract a shape from an image. Can be thought of as a "minimum opacity" threshold; - * that is, a value of 0.5 means that the shape will enclose all the pixels that are more than 50% opaque. - */ - shapeImageThreshold?: CSSWideKeyword | any; - - /** - * A future level of CSS Shapes will define a shape-inside property, which will define a shape to wrap content within the element. - * See Editor's Draft and CSSWG wiki page on next-level plans - */ - shapeInside?: CSSWideKeyword | any; - - /** - * Adds a margin to a shape-outside. In effect, defines a new shape that is the smallest contour around all the points - * that are the shape-margin distance outward perpendicular to each point on the underlying shape. - * For points where a perpendicular direction is not defined (e.g., a triangle corner), - * takes all points on a circle centered at the point and with a radius of the shape-margin distance. - * This property accepts only non-negative values. - */ - shapeMargin?: CSSWideKeyword | any; - - /** - * Declares a shape around which text should be wrapped, with possible modifications from the shape-margin property. - * The shape defined by shape-outside and shape-margin changes the geometry of a float element's float area. - */ - shapeOutside?: CSSWideKeyword | any; - - /** - * The speak property determines whether or not a speech synthesizer will read aloud the contents of an element. - */ - speak?: CSSWideKeyword | any; - - /** - * The speak-as property determines how the speech synthesizer interprets the content: words as whole words or as a sequence of letters, - * numbers as a numerical value or a sequence of digits, punctuation as pauses in speech or named punctuation characters. - */ - speakAs?: CSSWideKeyword | any; - - /** - * SVG: Specifies the opacity of the outline on the current object. - * See SVG 1.1 https://www.w3.org/TR/SVG/painting.html#StrokeOpacityProperty - */ - strokeOpacity?: CSSWideKeyword | number; - - /** - * SVG: Specifies the width of the outline on the current object. - * See SVG 1.1 https://www.w3.org/TR/SVG/painting.html#StrokeWidthProperty - */ - strokeWidth?: CSSWideKeyword | CSSPercentage | CSSLength; - - /** - * The tab-size CSS property is used to customise the width of a tab (U+0009) character. - */ - tabSize?: CSSWideKeyword | any; - - /** - * The 'table-layout' property controls the algorithm used to lay out the table cells, rows, and columns. - */ - tableLayout?: CSSWideKeyword | any; - - /** - * The text-align CSS property describes how inline content like text is aligned in its parent block element. - * text-align does not control the alignment of block elements itself, only their inline content. - */ - textAlign?: CSSWideKeyword | any; - - /** - * The text-align-last CSS property describes how the last line of a block element or a line before line break is aligned in its parent block element. - */ - textAlignLast?: CSSWideKeyword | any; - - /** - * The text-decoration CSS property is used to set the text formatting to underline, overline, line-through or blink. - * underline and overline decorations are positioned under the text, line-through over it. - */ - textDecoration?: CSSWideKeyword | any; - - /** - * Sets the color of any text decoration, such as underlines, overlines, and strike throughs. - */ - textDecorationColor?: CSSWideKeyword | any; - - /** - * Sets what kind of line decorations are added to an element, such as underlines, overlines, etc. - */ - textDecorationLine?: CSSWideKeyword | any; - - textDecorationLineThrough?: CSSWideKeyword | any; - - textDecorationNone?: CSSWideKeyword | any; - - textDecorationOverline?: CSSWideKeyword | any; - - /** - * Specifies what parts of an element’s content are skipped over when applying any text decoration. - */ - textDecorationSkip?: CSSWideKeyword | any; - - /** - * This property specifies the style of the text decoration line drawn on the specified element. - * The intended meaning for the values are the same as those of the border-style-properties. - */ - textDecorationStyle?: CSSWideKeyword | any; - - textDecorationUnderline?: CSSWideKeyword | any; - - /** - * The text-emphasis property will apply special emphasis marks to the elements text. - * Slightly similar to the text-decoration property only that this property can have affect on the line-height. - * It also is noted that this is shorthand for text-emphasis-style and for text-emphasis-color. - */ - textEmphasis?: CSSWideKeyword | any; - - /** - * The text-emphasis-color property specifies the foreground color of the emphasis marks. - */ - textEmphasisColor?: CSSWideKeyword | any; - - /** - * The text-emphasis-style property applies special emphasis marks to an element's text. - */ - textEmphasisStyle?: CSSWideKeyword | any; - - /** - * This property helps determine an inline box's block-progression dimension, - * derived from the text-height and font-size properties for non-replaced elements, - * the height or the width for replaced elements, and the stacked block-progression dimension for inline-block elements. - * The block-progression dimension determines the position of the padding, border and margin for the element. - */ - textHeight?: CSSWideKeyword | any; - - /** - * Specifies the amount of space horizontally that should be left on the first line of the text of an element. - * This horizontal spacing is at the beginning of the first line and is in respect to the left edge of the containing block box. - */ - textIndent?: CSSWideKeyword | any; - - textJustifyTrim?: CSSWideKeyword | any; - - textKashidaSpace?: CSSWideKeyword | any; - - /** - * The text-line-through property is a shorthand property for text-line-through-style, text-line-through-color and text-line-through-mode. - * (Considered obsolete; use text-decoration instead.) - */ - textLineThrough?: CSSWideKeyword | any; - - /** - * Specifies the line colors for the line-through text decoration. - * (Considered obsolete; use text-decoration-color instead.) - */ - textLineThroughColor?: CSSWideKeyword | any; - - /** - * Sets the mode for the line-through text decoration, determining whether the text decoration affects the space characters or not. - * (Considered obsolete; use text-decoration-skip instead.) - */ - textLineThroughMode?: CSSWideKeyword | any; - - /** - * Specifies the line style for line-through text decoration. - * (Considered obsolete; use text-decoration-style instead.) - */ - textLineThroughStyle?: CSSWideKeyword | any; - - /** - * Specifies the line width for the line-through text decoration. - */ - textLineThroughWidth?: CSSWideKeyword | any; - - /** - * The text-overflow shorthand CSS property determines how overflowed content that is not displayed is signaled to the users. - * It can be clipped, display an ellipsis ('…', U+2026 HORIZONTAL ELLIPSIS) or a Web author-defined string. - * It covers the two long-hand properties text-overflow-mode and text-overflow-ellipsis - */ - textOverflow?: CSSWideKeyword | any; - - /** - * The text-overline property is the shorthand for the text-overline-style, text-overline-width, text-overline-color, and text-overline-mode properties. - */ - textOverline?: CSSWideKeyword | any; - - /** - * Specifies the line color for the overline text decoration. - */ - textOverlineColor?: CSSWideKeyword | any; - - /** - * Sets the mode for the overline text decoration, determining whether the text decoration affects the space characters or not. - */ - textOverlineMode?: CSSWideKeyword | any; - - /** - * Specifies the line style for overline text decoration. - */ - textOverlineStyle?: CSSWideKeyword | any; - - /** - * Specifies the line width for the overline text decoration. - */ - textOverlineWidth?: CSSWideKeyword | any; - - /** - * The text-rendering CSS property provides information to the browser about how to optimize when rendering text. - * Options are: legibility, speed or geometric precision. - */ - textRendering?: CSSWideKeyword | any; - - /** - * Obsolete: unsupported. - */ - textScript?: CSSWideKeyword | any; - - /** - * The CSS text-shadow property applies one or more drop shadows to the text and of an element. - * Each shadow is specified as an offset from the text, along with optional color and blur radius values. - */ - textShadow?: CSSWideKeyword | any; - - /** - * This property transforms text for styling purposes. (It has no effect on the underlying content.) - */ - textTransform?: CSSWideKeyword | any; - - /** - * Unsupported. - * This property will add a underline position value to the element that has an underline defined. - */ - textUnderlinePosition?: CSSWideKeyword | any; - - /** - * After review this should be replaced by text-decoration should it not? - * This property will set the underline style for text with a line value for underline, overline, and line-through. - */ - textUnderlineStyle?: CSSWideKeyword | any; - - /** - * This property specifies how far an absolutely positioned box's top margin edge is offset below the top edge of the box's containing block. - * For relatively positioned boxes, the offset is with respect to the top edges of the box itself (i.e., the box is given a position in the normal flow, - * then offset from that position according to these properties). - */ - top?: CSSWideKeyword | any; - - /** - * Determines whether touch input may trigger default behavior supplied by the user agent, such as panning or zooming. - */ - touchAction?: CSSWideKeyword | any; - - /** - * CSS transforms allow elements styled with CSS to be transformed in two-dimensional or three-dimensional space. - * Using this property, elements can be translated, rotated, scaled, and skewed. The value list may consist of 2D and/or 3D transform values. - */ - transform?: CSSWideKeyword | any; - - /** - * This property defines the origin of the transformation axes relative to the element to which the transformation is applied. - */ - transformOrigin?: CSSWideKeyword | any; - - /** - * This property allows you to define the relative position of the origin of the transformation grid along the z-axis. - */ - transformOriginZ?: CSSWideKeyword | any; - - /** - * This property specifies how nested elements are rendered in 3D space relative to their parent. - */ - transformStyle?: CSSWideKeyword | any; - - /** - * The transition CSS property is a shorthand property for transition-property, transition-duration, transition-timing-function, - * and transition-delay. It allows to define the transition between two states of an element. - */ - transition?: CSSWideKeyword | any; - - /** - * Defines when the transition will start. A value of ‘0s’ means the transition will execute as soon as the property is changed. - * Otherwise, the value specifies an offset from the moment the property is changed, and the transition will delay execution by that offset. - */ - transitionDelay?: CSSWideKeyword | any; - - /** - * The 'transition-duration' property specifies the length of time a transition animation takes to complete. - */ - transitionDuration?: CSSWideKeyword | any; - - /** - * The 'transition-property' property specifies the name of the CSS property to which the transition is applied. - */ - transitionProperty?: CSSWideKeyword | any; - - /** - * Sets the pace of action within a transition - */ - transitionTimingFunction?: CSSWideKeyword | any; - - /** - * The unicode-bidi CSS property specifies the level of embedding with respect to the bidirectional algorithm. - */ - unicodeBidi?: CSSWideKeyword | any; - - /** - * unicode-range allows you to set a specific range of characters to be downloaded from a font (embedded using @font-face) and made available for use on the current page. - */ - unicodeRange?: CSSWideKeyword | any; - - /** - * This is for all the high level UX stuff. - */ - userFocus?: CSSWideKeyword | any; - - /** - * For inputing user content - */ - userInput?: CSSWideKeyword | any; - - /** - * The vertical-align property controls how inline elements or text are vertically aligned compared to the baseline. - * If this property is used on table-cells it controls the vertical alignment of content of the table cell. - */ - verticalAlign?: CSSWideKeyword | any; - - /** - * The visibility property specifies whether the boxes generated by an element are rendered. - */ - visibility?: CSSWideKeyword | any; - - /** - * The voice-balance property sets the apparent position (in stereo sound) of the synthesized voice for spoken media. - */ - voiceBalance?: CSSWideKeyword | any; - - /** - * The voice-duration property allows the author to explicitly set the amount of time it should take a speech synthesizer to read an element's content, - * for example to allow the speech to be synchronized with other media. - * With a value of auto (the default) the length of time it takes to read the content is determined by the content itself and the voice-rate property. - */ - voiceDuration?: CSSWideKeyword | any; - - /** - * The voice-family property sets the speaker's voice used by a speech media agent to read an element. - * The speaker may be specified as a named character (to match a voice option in the speech reading software) - * or as a generic description of the age and gender of the voice. - * Similar to the font-family property for visual media, - * a comma-separated list of fallback options may be given in case the speech reader does not recognize the character name - * or cannot synthesize the requested combination of generic properties. - */ - voiceFamily?: CSSWideKeyword | any; - - /** - * The voice-pitch property sets pitch or tone (high or low) for the synthesized speech when reading an element; - * the pitch may be specified absolutely or relative to the normal pitch for the voice-family used to read the text. - */ - voicePitch?: CSSWideKeyword | any; - - /** - * The voice-range property determines how much variation in pitch or tone will be created by the speech synthesize when reading an element. - * Emphasized text, grammatical structures and punctuation may all be rendered as changes in pitch, - * this property determines how strong or obvious those changes are; - * large ranges are associated with enthusiastic or emotional speech, - * while small ranges are associated with flat or mechanical speech. - */ - voiceRange?: CSSWideKeyword | any; - - /** - * The voice-rate property sets the speed at which the voice synthesized by a speech media agent will read content. - */ - voiceRate?: CSSWideKeyword | any; - - /** - * The voice-stress property sets the level of vocal emphasis to be used for synthesized speech reading the element. - */ - voiceStress?: CSSWideKeyword | any; - - /** - * The voice-volume property sets the volume for spoken content in speech media. It replaces the deprecated volume property. - */ - voiceVolume?: CSSWideKeyword | any; - - /** - * The white-space property controls whether and how white space inside the element is collapsed, and whether lines may wrap at unforced "soft wrap" opportunities. - */ - whiteSpace?: CSSWideKeyword | any; - - /** - * Obsolete: unsupported. - */ - whiteSpaceTreatment?: CSSWideKeyword | any; - - /** - * In paged media, this property defines the mimimum number of lines - * that must be left at the top of the second page. - * See CSS 3 orphans, widows properties https://drafts.csswg.org/css-break-3/#widows-orphans - */ - widows?: CSSWideKeyword | number; - - /** - * Specifies the width of the content area of an element. The content area of the element width does not include the padding, border, and margin of the element. - */ - width?: CSSWideKeyword | any; - - /** - * The word-break property is often used when there is long generated content that is strung together without and spaces or hyphens to beak apart. - * A common case of this is when there is a long URL that does not have any hyphens. This case could potentially cause the breaking of the layout as it could extend past the parent element. - */ - wordBreak?: CSSWideKeyword | any; - - /** - * The word-spacing CSS property specifies the spacing behavior between "words". - */ - wordSpacing?: CSSWideKeyword | any; - - /** - * An alias of css/properties/overflow-wrap, word-wrap defines whether to break words when the content exceeds the boundaries of its container. - */ - wordWrap?: CSSWideKeyword | any; - - /** - * Specifies how exclusions affect inline content within block-level elements. Elements lay out their inline content in their content area but wrap around exclusion areas. - */ - wrapFlow?: CSSWideKeyword | any; - - /** - * Set the value that is used to offset the inner wrap shape from other shapes. Inline content that intersects a shape with this property will be pushed by this shape's margin. - */ - wrapMargin?: CSSWideKeyword | any; - - /** - * Obsolete and unsupported. Do not use. - * This CSS property controls the text when it reaches the end of the block in which it is enclosed. - */ - wrapOption?: CSSWideKeyword | any; - - /** - * writing-mode specifies if lines of text are laid out horizontally or vertically, and the direction which lines of text and blocks progress. - */ - writingMode?: CSSWideKeyword | any; - - /** - * The z-index property specifies the z-order of an element and its descendants. - * When elements overlap, z-order determines which one covers the other. - * See CSS 2 z-index property https://www.w3.org/TR/CSS2/visuren.html#z-index - */ - zIndex?: CSSWideKeyword | "auto" | number; - - /** - * Sets the initial zoom factor of a document defined by @viewport. - * See CSS zoom descriptor https://drafts.csswg.org/css-device-adapt/#zoom-desc - */ - zoom?: CSSWideKeyword | "auto" | number | CSSPercentage; - + export interface CSSProperties extends CSS.Properties { + // The string index signature fallback is needed at least until csstype + // provides SVG CSS properties: https://github.com/frenic/csstype/issues/4 [propertyName: string]: any; } diff --git a/types/react/package.json b/types/react/package.json new file mode 100644 index 0000000000..f3be220fbc --- /dev/null +++ b/types/react/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "csstype": "^2.0.0" + } +} diff --git a/types/victory/victory-tests.tsx b/types/victory/victory-tests.tsx index 43673d8f32..aa21609ff5 100644 --- a/types/victory/victory-tests.tsx +++ b/types/victory/victory-tests.tsx @@ -30,7 +30,7 @@ let test = {}} > {(style: AnimationStyle) => - Hello! + Hello! } From f8b253436b897755e887fe00f631ed0be8852874 Mon Sep 17 00:00:00 2001 From: efokschaner Date: Tue, 3 Apr 2018 18:03:28 -0700 Subject: [PATCH 0426/2153] Change maintainer of webvr-api --- types/webvr-api/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/webvr-api/index.d.ts b/types/webvr-api/index.d.ts index 329f7fe6d8..3d03a14d4b 100644 --- a/types/webvr-api/index.d.ts +++ b/types/webvr-api/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for WebVR API // Project: https://w3c.github.io/webvr/ -// Definitions by: six a +// Definitions by: efokschaner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Typescript doesn't allow redefinition of type aliases even if they match, From ea50f76f8ec3e0419172f5373e80f03bc2592f37 Mon Sep 17 00:00:00 2001 From: Joe Andaverde Date: Tue, 3 Apr 2018 23:33:20 -0500 Subject: [PATCH 0427/2153] Fix incorrect privacy option --- types/hapi/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index 25d44b2732..d75da47e5e 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -1143,7 +1143,7 @@ export interface RouteOptionsAccess { * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionscache) */ export type RouteOptionsCache = { - privacy?: 'default' | 'public' | 'privacy'; + privacy?: 'default' | 'public' | 'private'; statuses?: number[]; otherwise?: string; } & ( From 02ff115ce9fdf39cf1ff998c761515b9acc79d42 Mon Sep 17 00:00:00 2001 From: Diogo Franco Date: Wed, 4 Apr 2018 14:10:25 +0900 Subject: [PATCH 0428/2153] [react] Workaround for --strictFunctionTypes (#24709) * [react] Workaround for --strictFunctionTypes Under --strictFunctionTypes, when assigning a class with `getDerivedStateFromProps` to `React.ComponentClass` or `React.ComponentType`, the type of the second argument was expected to be `Readonly`, which is, actually, the same as `Readonly<{}>`. This was preventing using classes that try to refer to the previous state in `getDerivedStateFromProps` from being given to HOC factories. There are no tests as testing this change is only possible with `--strictFunctionTypes`, and the `tsconfig.json` here specifically disables it. Perhaps another PR should enable it. * Add a test anyway Though it wouldn't have failed unless `--strictFunctionTypes` were enabled. * Fix lint error on the test --- types/react/index.d.ts | 2 +- types/react/test/tsx.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 49224d93cf..2ed2fb497c 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -404,7 +404,7 @@ declare namespace React { * * Note: its presence prevents any of the deprecated lifecycle methods from being invoked */ - (nextProps: Readonly

    , prevState: Readonly) => Partial | null; + (nextProps: Readonly

    , prevState: S) => Partial | null; // This should be "infer SS" but can't use it yet interface NewLifecycle { diff --git a/types/react/test/tsx.tsx b/types/react/test/tsx.tsx index b086e35f9f..760a625cfd 100644 --- a/types/react/test/tsx.tsx +++ b/types/react/test/tsx.tsx @@ -156,6 +156,7 @@ class ComponentWithLargeState extends React.Component<{}, Record<'a'|'b'|'c', st return { a: 'a' }; } } +const AssignedComponentWithLargeState: React.ComponentClass = ComponentWithLargeState; const componentWithBadLifecycle = new (class extends React.Component<{}, {}, number> {})({}); componentWithBadLifecycle.getSnapshotBeforeUpdate = () => { // $ExpectError From de655960b603d6b47f7030674f084780c76e045f Mon Sep 17 00:00:00 2001 From: Brenton Simpson Date: Tue, 3 Apr 2018 22:55:54 -0700 Subject: [PATCH 0429/2153] [jss] Use indefinite-observable for Observable typings The ones in HEAD are copy-pasted from there. Lets link to the original source. Continuation of #24078 --- types/jss/css.d.ts | 2 +- types/jss/observable.d.ts | 17 ----------------- types/jss/package.json | 3 ++- 3 files changed, 3 insertions(+), 19 deletions(-) delete mode 100644 types/jss/observable.d.ts diff --git a/types/jss/css.d.ts b/types/jss/css.d.ts index 2da9aa04b4..2d5e89139a 100644 --- a/types/jss/css.d.ts +++ b/types/jss/css.d.ts @@ -1,6 +1,6 @@ // These CSS typings adapted from TypeStyle: https://github.com/typestyle/typestyle -import { Observable } from './observable'; +import { Observable } from 'indefinite-observable'; import * as csstype from 'csstype'; type Length = string | number; diff --git a/types/jss/observable.d.ts b/types/jss/observable.d.ts deleted file mode 100644 index ff6a5f0219..0000000000 --- a/types/jss/observable.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Copied from https://github.com/cssinjs/jss/blob/6ed7963786d5ef899075e95f81efc9530342154f/src/types.js - -export type Observable = { - subscribe(observerOrNext: ObserverOrNext): Subscription -} - -export type Observer = { - next: NextChannel -} - -export type NextChannel = (value: T) => void -export type ObserverOrNext = Observer | NextChannel - -export type Unsubscribe = () => void -export type Subscription = { - unsubscribe: Unsubscribe -} diff --git a/types/jss/package.json b/types/jss/package.json index f3be220fbc..59a8354d7d 100644 --- a/types/jss/package.json +++ b/types/jss/package.json @@ -1,6 +1,7 @@ { "private": true, "dependencies": { - "csstype": "^2.0.0" + "csstype": "^2.0.0", + "indefinite-observable": "^1.0.1" } } From b0d2611519f66628adb7c265944a9870ebf07cb4 Mon Sep 17 00:00:00 2001 From: sam Date: Wed, 4 Apr 2018 15:03:12 +0800 Subject: [PATCH 0430/2153] add Gitlab typescript lib --- types/gitlab/ApiBase.d.ts | 18 +++++++++++++ types/gitlab/ApiBaseHTTP.d.ts | 9 +++++++ types/gitlab/ApiV3.d.ts | 3 +++ types/gitlab/BaseModel.d.ts | 14 +++++++++++ types/gitlab/Models/Groups.d.ts | 15 +++++++++++ types/gitlab/Models/IssueNotes.d.ts | 4 +++ types/gitlab/Models/Issues.d.ts | 10 ++++++++ types/gitlab/Models/Labels.d.ts | 4 +++ types/gitlab/Models/Notes.d.ts | 4 +++ types/gitlab/Models/Pipelines.d.ts | 4 +++ types/gitlab/Models/ProjectBuilds.d.ts | 6 +++++ types/gitlab/Models/ProjectDeployKeys.d.ts | 6 +++++ types/gitlab/Models/ProjectHooks.d.ts | 8 ++++++ types/gitlab/Models/ProjectIssues.d.ts | 4 +++ types/gitlab/Models/ProjectLabels.d.ts | 4 +++ types/gitlab/Models/ProjectMembers.d.ts | 8 ++++++ types/gitlab/Models/ProjectMergeRequests.d.ts | 9 +++++++ types/gitlab/Models/ProjectMilestones.d.ts | 8 ++++++ types/gitlab/Models/ProjectRepository.d.ts | 21 ++++++++++++++++ types/gitlab/Models/ProjectServices.d.ts | 6 +++++ types/gitlab/Models/Projects.d.ts | 25 +++++++++++++++++++ types/gitlab/Models/Runners.d.ts | 10 ++++++++ types/gitlab/Models/UserKeys.d.ts | 5 ++++ types/gitlab/Models/Users.d.ts | 10 ++++++++ types/gitlab/gitlab-tests.ts | 0 types/gitlab/index.d.ts | 14 +++++++++++ types/gitlab/tsconfig.json | 22 ++++++++++++++++ types/gitlab/tslint.json | 1 + 28 files changed, 252 insertions(+) create mode 100644 types/gitlab/ApiBase.d.ts create mode 100644 types/gitlab/ApiBaseHTTP.d.ts create mode 100644 types/gitlab/ApiV3.d.ts create mode 100644 types/gitlab/BaseModel.d.ts create mode 100644 types/gitlab/Models/Groups.d.ts create mode 100644 types/gitlab/Models/IssueNotes.d.ts create mode 100644 types/gitlab/Models/Issues.d.ts create mode 100644 types/gitlab/Models/Labels.d.ts create mode 100644 types/gitlab/Models/Notes.d.ts create mode 100644 types/gitlab/Models/Pipelines.d.ts create mode 100644 types/gitlab/Models/ProjectBuilds.d.ts create mode 100644 types/gitlab/Models/ProjectDeployKeys.d.ts create mode 100644 types/gitlab/Models/ProjectHooks.d.ts create mode 100644 types/gitlab/Models/ProjectIssues.d.ts create mode 100644 types/gitlab/Models/ProjectLabels.d.ts create mode 100644 types/gitlab/Models/ProjectMembers.d.ts create mode 100644 types/gitlab/Models/ProjectMergeRequests.d.ts create mode 100644 types/gitlab/Models/ProjectMilestones.d.ts create mode 100644 types/gitlab/Models/ProjectRepository.d.ts create mode 100644 types/gitlab/Models/ProjectServices.d.ts create mode 100644 types/gitlab/Models/Projects.d.ts create mode 100644 types/gitlab/Models/Runners.d.ts create mode 100644 types/gitlab/Models/UserKeys.d.ts create mode 100644 types/gitlab/Models/Users.d.ts create mode 100644 types/gitlab/gitlab-tests.ts create mode 100644 types/gitlab/index.d.ts create mode 100644 types/gitlab/tsconfig.json create mode 100644 types/gitlab/tslint.json diff --git a/types/gitlab/ApiBase.d.ts b/types/gitlab/ApiBase.d.ts new file mode 100644 index 0000000000..b8566f3ccb --- /dev/null +++ b/types/gitlab/ApiBase.d.ts @@ -0,0 +1,18 @@ +import { Labels } from './Models/Labels.d'; +import { Users } from './Models/Users.d'; +import { Notes } from './Models/Notes.d'; +import { Issues } from './Models/Issues.d'; +import { Projects } from './Models/Projects.d'; +import { Groups } from './Models/Groups.d'; + +export class ApiBase { + constructor(options: object); + public groups: Groups + public projects: Projects + public issues: Issues + public notes: Notes + public users: Users + public labels: Labels + public handleOptions(): void; + public init(): object; +} diff --git a/types/gitlab/ApiBaseHTTP.d.ts b/types/gitlab/ApiBaseHTTP.d.ts new file mode 100644 index 0000000000..2de92b6c74 --- /dev/null +++ b/types/gitlab/ApiBaseHTTP.d.ts @@ -0,0 +1,9 @@ +export class ApiBaseHTTP { + public prepare_opts(opts: T): T; + public fn_wrapper(fn: Function): Function; + public get(path: string, query?: object, fn?: Function): any; + public delete(path: string, fn?: Function): any; + public post(path: string, data?: object, fn?: Function): any; + public put(path: string, data?: object, fn?: Function): any; + public patch(path: string, data?: object, fn?: Function): any; +} diff --git a/types/gitlab/ApiV3.d.ts b/types/gitlab/ApiV3.d.ts new file mode 100644 index 0000000000..762f8824d6 --- /dev/null +++ b/types/gitlab/ApiV3.d.ts @@ -0,0 +1,3 @@ +export class ApiV3 { + +} diff --git a/types/gitlab/BaseModel.d.ts b/types/gitlab/BaseModel.d.ts new file mode 100644 index 0000000000..e801ccf654 --- /dev/null +++ b/types/gitlab/BaseModel.d.ts @@ -0,0 +1,14 @@ +export class BaseModel { + public load(model: string): object; + public get(): any + public post(): any + public put(): any + public delete(): any + public debug(): any +} +export interface PageDefualtParams { + page?: number + per_page?: number + [key: string]: any +} +export type TypeNumOrStrId = number | string; diff --git a/types/gitlab/Models/Groups.d.ts b/types/gitlab/Models/Groups.d.ts new file mode 100644 index 0000000000..f8ad983f4a --- /dev/null +++ b/types/gitlab/Models/Groups.d.ts @@ -0,0 +1,15 @@ +import { BaseModel } from "../BaseModel"; + +export class Groups extends BaseModel { + public init(): object; + public all(params?: object, fn?: Function): any; + public show(groupId: number, fn?: Function): any; + public listProjects(groupId: number, fn?: Function): any; + public listMembers(groupId: number, fn?: Function): any; + public editMember(groupId: number, userId: number, accessLevel: number, fn?: Function): any; + public removeMember(groupId: number, userId: number, fn?: Function): any; + public create(params?: object, fn?: Function): any; + public addProject(groupId: number, projectId: number, fn?: Function): any; + public deleteGroup(groupId: number, fn?: Function): any; + public search(nameOrPath: string, fn?: Function): any; +} diff --git a/types/gitlab/Models/IssueNotes.d.ts b/types/gitlab/Models/IssueNotes.d.ts new file mode 100644 index 0000000000..aeb7c5944b --- /dev/null +++ b/types/gitlab/Models/IssueNotes.d.ts @@ -0,0 +1,4 @@ +import { BaseModel } from './../BaseModel.d'; +export class IssueNotes extends BaseModel{ + public all(projectId: number | string, issueId: number, params?: object, fn?: Function): any +} diff --git a/types/gitlab/Models/Issues.d.ts b/types/gitlab/Models/Issues.d.ts new file mode 100644 index 0000000000..9fcc585ea0 --- /dev/null +++ b/types/gitlab/Models/Issues.d.ts @@ -0,0 +1,10 @@ +import { BaseModel } from './../BaseModel.d'; +export class Issues extends BaseModel { + public all(params?: object, fn?: Function): any; + public show(projectId: number | string, issueId: number | string, fn?: Function): any; + public create(projectId: number | string, params?: object, fn?: Function): any; + public edit(projectId: number | string, issueId: number | string, params?: object, fn?: Function): any; + public remove(projectId: number | string, issueId: number | string, fn?: Function): any; + public subscribe(projectId: number | string, issueId: number | string, params?: object, fn?: Function): any; + public unsubscribe(projectId: number | string, issueId: number | string, fn?: Function): any; +} diff --git a/types/gitlab/Models/Labels.d.ts b/types/gitlab/Models/Labels.d.ts new file mode 100644 index 0000000000..b7529b320c --- /dev/null +++ b/types/gitlab/Models/Labels.d.ts @@ -0,0 +1,4 @@ +import { BaseModel } from './../BaseModel.d'; +export class Labels extends BaseModel { + public create(projectId: number | string, params?: object, fn?: Function): any; +} diff --git a/types/gitlab/Models/Notes.d.ts b/types/gitlab/Models/Notes.d.ts new file mode 100644 index 0000000000..8a85dcbedc --- /dev/null +++ b/types/gitlab/Models/Notes.d.ts @@ -0,0 +1,4 @@ +import { BaseModel } from './../BaseModel.d'; +export class Notes extends BaseModel { + public create(projectId: number | string, issueId: number, params?: object, fn?: Function): any; +} diff --git a/types/gitlab/Models/Pipelines.d.ts b/types/gitlab/Models/Pipelines.d.ts new file mode 100644 index 0000000000..bfddc099f9 --- /dev/null +++ b/types/gitlab/Models/Pipelines.d.ts @@ -0,0 +1,4 @@ +import { BaseModel } from './../BaseModel.d'; +export class Pipelines extends BaseModel { + public all(projectId: number | string, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectBuilds.d.ts b/types/gitlab/Models/ProjectBuilds.d.ts new file mode 100644 index 0000000000..5bc9fbaa3d --- /dev/null +++ b/types/gitlab/Models/ProjectBuilds.d.ts @@ -0,0 +1,6 @@ +import { BaseModel } from './../BaseModel.d'; +export class ProjectBuilds extends BaseModel { + public listBuilds(projectId: number | string, params?: { page?: number, per_page?: number, [key: string]: any }, fn?: Function): any; + public showBuild(projectId: number | string, buildId: string, fn?: Function): any; + public showBuild(params?: { projectId: number | string}, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectDeployKeys.d.ts b/types/gitlab/Models/ProjectDeployKeys.d.ts new file mode 100644 index 0000000000..be6af6a170 --- /dev/null +++ b/types/gitlab/Models/ProjectDeployKeys.d.ts @@ -0,0 +1,6 @@ +import { BaseModel } from './../BaseModel.d'; +export class ProjectKeys extends BaseModel { + public listKeys(projectId: number | string, fn?: Function): any; + public getKey(projectId: number | string, keyId: number, fn?: Function): any; + public addKey(projectId: number | string, params?: object, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectHooks.d.ts b/types/gitlab/Models/ProjectHooks.d.ts new file mode 100644 index 0000000000..399dc18e7f --- /dev/null +++ b/types/gitlab/Models/ProjectHooks.d.ts @@ -0,0 +1,8 @@ +import { BaseModel } from './../BaseModel.d'; +export class ProjectHooks extends BaseModel { + public list(projectId: number | string, fn?: Function): any; + public show(projectId: number | string, hookId: number, fn?: Function): any; + public add(projectId: number | string, params: object|string, fn?: Function): any; + public update(projectId: number | string, hookId: number, url: any, fn?: Function): any; + public remove(projectId: number | string, hookId: number, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectIssues.d.ts b/types/gitlab/Models/ProjectIssues.d.ts new file mode 100644 index 0000000000..ee61cfca3f --- /dev/null +++ b/types/gitlab/Models/ProjectIssues.d.ts @@ -0,0 +1,4 @@ +import { BaseModel } from './../BaseModel.d'; +export class ProjectIssues extends BaseModel { + public list(projectId: number | string, params: { page?: number, per_page?: number, [key: string]: any }, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectLabels.d.ts b/types/gitlab/Models/ProjectLabels.d.ts new file mode 100644 index 0000000000..23d12ca652 --- /dev/null +++ b/types/gitlab/Models/ProjectLabels.d.ts @@ -0,0 +1,4 @@ +import { BaseModel } from './../BaseModel.d'; +export class ProjectLabels extends BaseModel { + public all(projectId: number | string, params: { page?: number, per_page?: number, [key: string]: any }, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectMembers.d.ts b/types/gitlab/Models/ProjectMembers.d.ts new file mode 100644 index 0000000000..79b9e11b02 --- /dev/null +++ b/types/gitlab/Models/ProjectMembers.d.ts @@ -0,0 +1,8 @@ +import { BaseModel } from './../BaseModel.d'; +export class ProjectMembers extends BaseModel { + public list(projectId: number | string, fn?: Function): any; + public show(projectId: number | string, userId: number, fn?: Function): any; + public add(projectId: number | string, userId: number, accessLevel: number,fn?: Function): any; + public update(projectId: number | string, userId: number, accessLevel: number, fn?: Function): any; + public remove(projectId: number | string, userId: number, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectMergeRequests.d.ts b/types/gitlab/Models/ProjectMergeRequests.d.ts new file mode 100644 index 0000000000..f2043e79d5 --- /dev/null +++ b/types/gitlab/Models/ProjectMergeRequests.d.ts @@ -0,0 +1,9 @@ +import { BaseModel } from './../BaseModel.d'; +export class ProjectMergeRequests extends BaseModel { + public list(projectId: number | string, params: { page?: number, per_page?: number, [key: string]: any }, fn?: Function): any; + public show(projectId: number | string, mergerequestId: number, fn?: Function): any; + public add(projectId: number | string, sourceBranch: any, targetBranch: any, assigneeId: number, title: any, fn?: Function): any; + public update(projectId: number | string, mergerequestId: number, params: object, fn?: Function): any; + public comment(projectId: number | string, mergerequestId: number, note: any, fn?: Function): any; + public merge(projectId: number | string, mergerequestId: number, params: object, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectMilestones.d.ts b/types/gitlab/Models/ProjectMilestones.d.ts new file mode 100644 index 0000000000..9a9da7c025 --- /dev/null +++ b/types/gitlab/Models/ProjectMilestones.d.ts @@ -0,0 +1,8 @@ +import { BaseModel } from './../BaseModel.d'; +export class ProjectMilestones extends BaseModel { + public list(projectId: number | string, fn?: Function): any; + public all(projectId: number | string, fn?: Function): any; + public show(projectId: number | string, milestoneId: number, fn?: Function): any; + public add(projectId: number | string, title: any, description: any, due_date: any, fn?: Function): any; + public update(projectId: number | string, milestoneId: number, title: any, description: any, due_date: any, state_event: any, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectRepository.d.ts b/types/gitlab/Models/ProjectRepository.d.ts new file mode 100644 index 0000000000..e0421e5a7e --- /dev/null +++ b/types/gitlab/Models/ProjectRepository.d.ts @@ -0,0 +1,21 @@ +import { BaseModel } from './../BaseModel.d'; +export class ProjectRepository extends BaseModel { + public listBranches(projectId: number | string, fn?: Function): any; + public showBranch(projectId: number | string, branchId: string, fn?: Function): any; + public protectBranch(projectId: number | string, branchId: string, params: object, fn?: Function): any; + public unprotectBranch(projectId: number | string, branchId: string, fn?: Function): any; + public createBranch(params: object, fn?: Function): any; + public deleteBranch(projectId: number | string, branchId: string, fn?: Function): any; + public addTag(params: object, fn?: Function): any; + public deleteTag(projectId: number | string, tagName: string, fn?: Function): any; + public showTag(projectId: number | string, tagName: string, fn?: Function): any; + public listTags(projectId: number | string, fn?: Function): any; + public listCommits(projectId: number | string, fn?: Function): any; + public showCommit(projectId: number | string, sha: string, fn?: Function): any; + public diffCommit(projectId: number | string, sha: string, fn?: Function): any; + public listTree(projectId: number | string, params?: object, fn?: Function): any; + public showFile(projectId: number | string, params?: object, fn?: Function): any; + public createFile(params?: object, fn?: Function): any; + public updateFile(params?: object, fn?: Function): any; + public compare(params?: object, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectServices.d.ts b/types/gitlab/Models/ProjectServices.d.ts new file mode 100644 index 0000000000..935e173bce --- /dev/null +++ b/types/gitlab/Models/ProjectServices.d.ts @@ -0,0 +1,6 @@ +import { BaseModel } from './../BaseModel.d'; +export class ProjectServices extends BaseModel { + public show(projectId: number | string, serviceName: string, fn?: Function): any; + public update(projectId: number | string, serviceName: string, params: object, fn?: Function): any; + public remove(projectId: number | string, serviceName: string, fn?: Function): any; +} diff --git a/types/gitlab/Models/Projects.d.ts b/types/gitlab/Models/Projects.d.ts new file mode 100644 index 0000000000..dc25e5f418 --- /dev/null +++ b/types/gitlab/Models/Projects.d.ts @@ -0,0 +1,25 @@ +import { BaseModel, PageDefualtParams, TypeNumOrStrId} from './../BaseModel.d'; +export class Projects extends BaseModel { + public all(fn?: Function): any; + public all(params?: PageDefualtParams, fn?: Function): any; + public allAdmin(fn: Function): any; + public allAdmin(params?: PageDefualtParams, fn?: Function): any; + public show(projectId: TypeNumOrStrId, fn?: Function): any; + public create(params: object, fn?: Function): any; + public create_for_user(params: object, fn?: Function): any; + public edit(projectId: TypeNumOrStrId, params: object, fn?: Function): any; + public addMember(params?: object, fn?: Function): any; + public editMember(params?: object, fn?: Function): any; + public listMembers(params?: object, fn?: Function): any; + public listCommits(params?: object, fn?: Function): any; + public listTags(params?: object, fn?: Function): any; + public remove(projectId: TypeNumOrStrId, fn?: Function): any; + public fork(params?: object, fn?: Function): any; + public share(params?: object, fn?: Function): any; + public search(projectName: string, fn?: Function): any; + public search(projectName: string, params?: object, fn?: Function): any; + public listTriggers(projectId: TypeNumOrStrId, fn?: Function): any; + public showTrigger(projectId: TypeNumOrStrId, token: string, fn?: Function): any; + public createTrigger(params?: object, fn?: Function): any; + public removeTrigger(projectId: TypeNumOrStrId, token: string, fn?: Function): any; +} diff --git a/types/gitlab/Models/Runners.d.ts b/types/gitlab/Models/Runners.d.ts new file mode 100644 index 0000000000..c65a1e2759 --- /dev/null +++ b/types/gitlab/Models/Runners.d.ts @@ -0,0 +1,10 @@ +import { BaseModel, PageDefualtParams, TypeNumOrStrId} from './../BaseModel.d'; +export class Runners extends BaseModel { + public all(projectId?: TypeNumOrStrId, fn?: Function): any; + public all(projectId?: TypeNumOrStrId, params?: object, fn?: Function): any; + public show(runnerId: number, fn?: Function): any; + public update(runnerId: number, attributes: any, fn?: Function): any; + public remove(runnerId: number, projectId: any, enable: any, fn?: Function): any; + public enable(projectId: TypeNumOrStrId, runnerId: number, fn?: Function): any; + public disable(projectId: TypeNumOrStrId, runnerId: number, fn?: Function): any; +} diff --git a/types/gitlab/Models/UserKeys.d.ts b/types/gitlab/Models/UserKeys.d.ts new file mode 100644 index 0000000000..90f1918361 --- /dev/null +++ b/types/gitlab/Models/UserKeys.d.ts @@ -0,0 +1,5 @@ +import { BaseModel, PageDefualtParams, TypeNumOrStrId} from './../BaseModel.d'; +export class UserKeys extends BaseModel { + public all(userId?: TypeNumOrStrId, fn?: Function): any; + public addKey(userId: string, title: any, key: any, fn?: Function): any; +} diff --git a/types/gitlab/Models/Users.d.ts b/types/gitlab/Models/Users.d.ts new file mode 100644 index 0000000000..b14a67e63a --- /dev/null +++ b/types/gitlab/Models/Users.d.ts @@ -0,0 +1,10 @@ +import { BaseModel, PageDefualtParams, TypeNumOrStrId} from './../BaseModel.d'; +export class Users extends BaseModel { + public all(fn?: Function): any; + public all(params?: PageDefualtParams, fn?: Function): any; + public current(fn?: Function): any; + public show(userId: number, fn?: Function): any; + public create(params?: PageDefualtParams, fn?: Function): any; + public session(email: string, password: string, fn?: Function): any; + public search(emailOrUsername: string, fn?: Function): any; +} diff --git a/types/gitlab/gitlab-tests.ts b/types/gitlab/gitlab-tests.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/gitlab/index.d.ts b/types/gitlab/index.d.ts new file mode 100644 index 0000000000..8a1ea57dd6 --- /dev/null +++ b/types/gitlab/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for gitlab 1.8 +// Project: https://github.com/node-gitlab/node-gitlab#readme +// Definitions by: sam +// AryloYeung +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { ApiV3 } from "./ApiV3"; + +declare class GitlabApi extends ApiV3 { + + public static readonly ApiV3: ApiV3; +} + +export = GitlabApi; diff --git a/types/gitlab/tsconfig.json b/types/gitlab/tsconfig.json new file mode 100644 index 0000000000..83e46736e1 --- /dev/null +++ b/types/gitlab/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "gitlab-tests.ts" + ] +} diff --git a/types/gitlab/tslint.json b/types/gitlab/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/gitlab/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From efdd0914a62ed3ed5c02d4011a64062eb175bd6a Mon Sep 17 00:00:00 2001 From: Lubomir Kaplan Date: Wed, 4 Apr 2018 12:51:42 +0200 Subject: [PATCH 0431/2153] minio: fixed .listBuckets() method signature --- types/minio/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/minio/index.d.ts b/types/minio/index.d.ts index 2dda500396..31a8fd5814 100644 --- a/types/minio/index.d.ts +++ b/types/minio/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for minio 5.0 // Project: https://github.com/minio/minio-js#readme // Definitions by: Barin Britva +// Lubomir Kaplan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -82,7 +83,7 @@ export class Client { makeBucket(bucketName: string, region: Region): Promise; listBuckets(callback: ResultCallback): void; - listBuckets(): Promise; + listBuckets(): Promise; bucketExists(bucketName: string, callback: ResultCallback): void; bucketExists(bucketName: string): Promise; From 9e621da0f3062d2d657654449830205f72308e5b Mon Sep 17 00:00:00 2001 From: Lubomir Kaplan Date: Wed, 4 Apr 2018 12:59:38 +0200 Subject: [PATCH 0432/2153] updated minio package version --- types/minio/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/minio/index.d.ts b/types/minio/index.d.ts index 31a8fd5814..9413d19943 100644 --- a/types/minio/index.d.ts +++ b/types/minio/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for minio 5.0 +// Type definitions for minio 5.0.1 // Project: https://github.com/minio/minio-js#readme // Definitions by: Barin Britva // Lubomir Kaplan From ee5b34955b8f674c66f16aa2cb460ff04fa32949 Mon Sep 17 00:00:00 2001 From: Lubomir Kaplan Date: Wed, 4 Apr 2018 13:08:29 +0200 Subject: [PATCH 0433/2153] minio: fixed package version --- types/minio/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/minio/index.d.ts b/types/minio/index.d.ts index 9413d19943..fd7953dea2 100644 --- a/types/minio/index.d.ts +++ b/types/minio/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for minio 5.0.1 +// Type definitions for minio 5.1 // Project: https://github.com/minio/minio-js#readme // Definitions by: Barin Britva // Lubomir Kaplan From 8000cbffa9aa3b10e42cb98913dc554493867884 Mon Sep 17 00:00:00 2001 From: Lubomir Kaplan Date: Wed, 4 Apr 2018 13:21:46 +0200 Subject: [PATCH 0434/2153] minio: fixed signature for BucketItemStat object --- types/minio/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/minio/index.d.ts b/types/minio/index.d.ts index fd7953dea2..bdbcb8032a 100644 --- a/types/minio/index.d.ts +++ b/types/minio/index.d.ts @@ -46,7 +46,7 @@ export interface BucketItemStat { size: number; contentType: string; etag: string; - lastModified: string; + lastModified: Date; } export interface IncompleteUploadedBucketItem { From 7bd14e117fbe57fa11ab8d1ca3da464e6d8a639b Mon Sep 17 00:00:00 2001 From: Joel Hegg Date: Tue, 3 Apr 2018 12:39:08 -0400 Subject: [PATCH 0435/2153] [actions-on-google] Upgrade to 1.9 --- types/actions-on-google/assistant-app.d.ts | 204 +++++++++++++++++- types/actions-on-google/index.d.ts | 2 +- types/actions-on-google/response-builder.d.ts | 10 + 3 files changed, 210 insertions(+), 6 deletions(-) diff --git a/types/actions-on-google/assistant-app.d.ts b/types/actions-on-google/assistant-app.d.ts index d835915259..b3608b85e8 100644 --- a/types/actions-on-google/assistant-app.d.ts +++ b/types/actions-on-google/assistant-app.d.ts @@ -1,6 +1,6 @@ import * as express from 'express'; -import { BasicCard, Carousel, ImageDisplays, List, OptionItem, RichResponse } from './response-builder'; +import { BasicCard, Carousel, ImageDisplays, List, OptionItem, RichResponse, SimpleResponse } from './response-builder'; import { ActionPaymentTransactionConfig, Cart, GooglePaymentTransactionConfig, LineItem, Location, Order, OrderUpdate, TransactionDecision, TransactionValues } from './transactions'; @@ -30,6 +30,8 @@ export enum StandardIntents { DELIVERY_ADDRESS, /** App fires TRANSACTION_DECISION intent when action asks for transaction decision. */ TRANSACTION_DECISION, + /** App fires PLACE intent when action asks for place. */ + PLACE, /** App fires CONFIRMATION intent when requesting affirmation from user. */ CONFIRMATION, /** App fires DATETIME intent when requesting date/time from user. */ @@ -45,7 +47,9 @@ export enum StandardIntents { /** App fires REGISTER_UPDATE intent when requesting user to register for proactive updates. */ REGISTER_UPDATE, /** App receives CONFIGURE_UPDATES intent to indicate a REGISTER_UPDATE intent should be sent. */ - CONFIGURE_UPDATES + CONFIGURE_UPDATES, + /** App fires LINK intent to request user to open to link. */ + LINK } /** @@ -101,6 +105,10 @@ export enum BuiltInArgNames { * Transactions decision argument. */ TRANSACTION_DECISION_VALUE, + /** + * Place value argument. + */ + PLACE, /** * Confirmation argument. */ @@ -126,7 +134,9 @@ export enum BuiltInArgNames { */ NEW_SURFACE, /** Update registration value argument. */ - REGISTER_UPDATE + REGISTER_UPDATE, + /** Link request result argument. */ + LINK } /** @@ -173,6 +183,10 @@ export enum SurfaceCapabilities { * The ability to output on a screen */ SCREEN_OUTPUT, + /** + * The ability to open a web URL + */ + WEB_BROWSER } /** @@ -259,10 +273,15 @@ export interface UserName { familyName: string; } +export interface LocationCoordinates { + latitude: number; + longitude: number; +} + /** - * User's permissioned device location. + * Location information. */ -export interface DeviceLocation { +export interface Location { /** Coordinates: {latitude, longitude}. Requested with SupportedPermissions.DEVICE_PRECISE_LOCATION. */ coordinates: Coordinates; /** Full, formatted street address. Requested with SupportedPermissions.DEVICE_PRECISE_LOCATION. */ @@ -273,6 +292,22 @@ export interface DeviceLocation { city: string; } +/** + * User's permissioned device location. + */ +export type DeviceLocation = Location; + +/** + * Place information. + */ +export interface Place extends Location { + /** + * Used with Places API to fetch details of a place. + * See {@link https://developers.google.com/places/web-service/place-id} + */ + placeId: string; +} + /** * Coordinates containing latitude and longitude */ @@ -923,6 +958,80 @@ export class AssistantApp { */ askForDeliveryAddress(reason: string, dialogState?: object): express.Response | null; + /** + * Asks user to provide a geo-located place, possibly using contextual information, + * like a store near the user's location or a contact's address. + * + * Developer provides custom text prompts to tailor the request handled by Google. + * + * @example + * // For DialogflowApp: + * + * // Dialogflow Actions + * const Actions = { + * WELCOME: 'input.welcome', + * PLACE: 'get.place' // Create Dialogflow Action with actions_intent_PLACE event + * }; + * + * const app = new DialogflowApp({request, response}); + * + * function handleWelcome (app) { + * const requestPrompt = 'Where do you want to get picked up?'; + * const permissionContext = 'To find a place to pick you up'; + * app.askForPlace(requestPrompt, permissionContext); + * } + * + * function handlePlace (app) { + * const place = app.getPlace(); + * if (place) { + * app.tell(`Ah, I see. You want to get picked up at ${place.address}`); + * } else { + * app.tell(`Sorry, I couldn't find where you want to get picked up`); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(Actions.WELCOME, handleWelcome); + * actionMap.set(Actions.PLACE, handlePlace); + * app.handleRequest(actionMap); + * + * // For ActionsSdkApp: + * const app = new ActionsSdkApp({ request, response }); + * + * function handleWelcome (app) { + * const requestPrompt = 'Where do you want to get picked up?'; + * const permissionContext = 'To find a place to pick you up'; + * app.askForPlace(requestPrompt, permissionContext); + * } + * + * function handlePlace (app) { + * const place = app.getPlace(); + * if (place) { + * app.tell(`Ah, I see. You want to get picked up at ${place.address}`); + * } else { + * app.tell(`Sorry, I couldn't find where you want to get picked up`); + * } + * } + * + * const actionsMap = new Map(); + * actionsMap.set(app.StandardIntents.MAIN, handleWelcome); + * actionsMap.set(app.StandardIntents.PLACE, handlePlace); + * app.handleRequest(actionsMap); + * + * @param requestPrompt This is the initial response by location sub-dialog. + * For example: "Where do you want to get picked up?" + * @param permissionContext This is the context for seeking permissions. + * For example: "To find a place to pick you up" + * Prompt to user: "*To find a place to pick you up*, I just need to check your location. + * Can I get that from Google?". + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. + * @return HTTP response. + * @actionssdk + * @dialogflow + */ + askForPlace(requestPrompt: string, permissionContext: string, dialogState?: object): express.Response | null; + /** * Asks user for a confirmation. * @@ -1131,6 +1240,72 @@ export class AssistantApp { */ askToRegisterDailyUpdate(intent: string, intentArguments: IntentArgument[], dialogState?: object): express.Response | null; + /** + * Requests the user to transfer to a linked out Android app intent. Using this feature + * requires verifying the linked app in the (Actions console)[console.actions.google.com]. + * + * @example + * // For DialogflowApp: + * + * // Dialogflow Actions + * const WELCOME_ACTION = 'input.welcome'; + * const HANDLE_LINK = 'handle.link'; // Create Dialogflow Action with actions_intent_LINK event + * + * const app = new DialogflowApp({ request, response }); + * + * console.log('Request headers: ' + JSON.stringify(request.headers)); + * console.log('Request body: ' + JSON.stringify(request.body)); + * + * function requestLink (app) { + * app.askToDeepLink('Great! Looks like we can do that in the app.', 'Google', + * 'example://gizmos', 'com.example.gizmos', 'handle this for you'); + * } + * + * function handleLink (app) { + * const linkStatus = app.getLinkStatus(); + * app.tell('Okay maybe we can take care of that another time.'); + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_ACTION, requestLink); + * actionMap.set(HANDLE_LINK, handleLink); + * app.handleRequest(actionMap); + * + * // For ActionsSdkApp + * const app = new ActionsSdkApp({ request, response }); + * + * console.log('Request headers: ' + JSON.stringify(request.headers)); + * console.log('Request body: ' + JSON.stringify(request.body)); + * + * function requestLink (app) { + * app.askToDeepLink('Great! Looks like we can do that in the app.', 'Google', + * 'example://gizmos', 'com.example.gizmos', 'handle this for you.'); + * } + * + * function handleLink (app) { + * const linkStatus = app.getLinkStatus(); + * app.tell('Okay maybe we can take care of that another time.'); + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.MAIN, requestLink); + * actionMap.set(app.StandardIntents.LINK, handleLink); + * app.handleRequest(actionMap); + * + * @param prompt A simple response to prepend to the link request. + * @param destinationName The name of the link destination. + * @param url URL of Android deep link. + * @param packageName Android app package name to which to link. + * @param reason The reason to transfer the user. This may be appended to a + * Google-specified prompt. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. Used in {@link ActionsSdkApp}. + * @return HTTP response. + * @dialogflow + * @actionssdk + */ + askToDeepLink(prompt: string | SimpleResponse | null, destinationName: string, url: string, packageName: string, reason?: string | null, dialogState?: object): express.Response | null; + /** * Gets the {@link User} object. * The user object contains information about the user, including @@ -1273,6 +1448,15 @@ export class AssistantApp { */ getTransactionDecision(): TransactionDecision; + /** + * Gets the user provided place. Use after askForPlace. + * + * @return Place information given by the user. Null if no place given. + * @dialogflow + * @actionssdk + */ + getPlace(): Place | null; + /** * Gets confirmation decision. Use after askForConfirmation. * @@ -1464,6 +1648,16 @@ export class AssistantApp { */ isUpdateRegistered(): boolean; + /** + * Returns the status of a link request. Used with + * {@link AssistantApp#askToDeepLink} + * + * @return The status code of the request to link. + * @dialogflow + * @actionssdk + */ + getLinkStatus(): number; + // --------------------------------------------------------------------------- // Response Builders // --------------------------------------------------------------------------- diff --git a/types/actions-on-google/index.d.ts b/types/actions-on-google/index.d.ts index 937943e1f0..0260bc6cee 100644 --- a/types/actions-on-google/index.d.ts +++ b/types/actions-on-google/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for actions-on-google 1.8 +// Type definitions for actions-on-google 1.9 // Project: https://github.com/actions-on-google/actions-on-google-nodejs // Definitions by: Joel Hegg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/actions-on-google/response-builder.d.ts b/types/actions-on-google/response-builder.d.ts index 227d102958..966c881ba6 100644 --- a/types/actions-on-google/response-builder.d.ts +++ b/types/actions-on-google/response-builder.d.ts @@ -350,6 +350,16 @@ export class Carousel { * @return Returns current constructed Carousel. */ addItems(optionItems: OptionItem | OptionItem[]): Carousel; + + /** + * Sets the display options for the images in this carousel. + * Use one of the image display constants. If none is chosen, + * ImageDisplays.DEFAULT will be enforced. + * + * @param option The option for displaying the image. + * @return Returns current constructed Carousel. + */ + setImageDisplay(option: ImageDisplays): Carousel; } /** From ae57c33929ad2677fe1d0ed516e372298e60892d Mon Sep 17 00:00:00 2001 From: Joel Hegg Date: Tue, 3 Apr 2018 16:44:32 -0400 Subject: [PATCH 0436/2153] [actions-on-google] Upgrade to 1.10 --- types/actions-on-google/assistant-app.d.ts | 139 ++++++++- types/actions-on-google/index.d.ts | 2 +- types/actions-on-google/response-builder.d.ts | 288 ++++++++++++++++++ 3 files changed, 425 insertions(+), 4 deletions(-) diff --git a/types/actions-on-google/assistant-app.d.ts b/types/actions-on-google/assistant-app.d.ts index b3608b85e8..76a206122c 100644 --- a/types/actions-on-google/assistant-app.d.ts +++ b/types/actions-on-google/assistant-app.d.ts @@ -1,6 +1,7 @@ import * as express from 'express'; -import { BasicCard, Carousel, ImageDisplays, List, OptionItem, RichResponse, SimpleResponse } from './response-builder'; +import { BasicCard, BrowseCarousel, BrowseItem, Carousel, ImageDisplays, List, MediaObject, + MediaResponse, MediaValues, OptionItem, RichResponse, SimpleResponse } from './response-builder'; import { ActionPaymentTransactionConfig, Cart, GooglePaymentTransactionConfig, LineItem, Location, Order, OrderUpdate, TransactionDecision, TransactionValues } from './transactions'; @@ -49,7 +50,9 @@ export enum StandardIntents { /** App receives CONFIGURE_UPDATES intent to indicate a REGISTER_UPDATE intent should be sent. */ CONFIGURE_UPDATES, /** App fires LINK intent to request user to open to link. */ - LINK + LINK, + /** App receives MEDIA_STATUS intent when the MediaResponse status is updated from user. */ + MEDIA_STATUS } /** @@ -136,7 +139,9 @@ export enum BuiltInArgNames { /** Update registration value argument. */ REGISTER_UPDATE, /** Link request result argument. */ - LINK + LINK, + /** MediaStatus value argument. */ + MEDIA_STATUS } /** @@ -183,6 +188,10 @@ export enum SurfaceCapabilities { * The ability to output on a screen */ SCREEN_OUTPUT, + /** + * The ability to output a MediaResponse + */ + MEDIA_RESPONSE_AUDIO, /** * The ability to open a web URL */ @@ -237,6 +246,18 @@ export enum SignInStatus { ERROR } +/** + * SKU (Stock Keeping Units) types for Play Package Entitlements. + */ +export enum EntitlementSkuTypes { + /** In app purchase */ + IN_APP, + /** In app subscription */ + SUBSCRIPTION, + /** Paid app. */ + APP +} + /** * Possible update trigger time context frequencies. */ @@ -344,6 +365,33 @@ export interface User { userStorage: string; } +/** + * Google Play Android App Package Entitlements. + */ +export interface PackageEntitlement { + /** Name of the Android app package. */ + packageName: string; + /** List of entitlements for a given app. */ + entitlements: Entitlement[]; +} + +/** + * A user's digital entitlement. + */ +export interface Entitlement { + /** Product SKU. Matches getSku() in Google Play InApp Billing API. */ + sku: string; + /** The type of SKU. One of EntitlementSkuType. */ + skuType: string; + /** For in app purchases/subscriptions, relevant details. */ + inAppDetails: { + /** JSON data of the in app purchase. */ + inAppPurchaseData: object; + /** Matches IN_APP_DATA_SIGNATURE from getPurchases() method in Play InApp Billing API. */ + inAppDataSignature: object; + }; +} + /** * Actions on Google Surface. */ @@ -472,6 +520,16 @@ export class AssistantApp { */ readonly Transactions: typeof TransactionValues; + /** + * Values related to supporting {@link Media}. + */ + readonly Media: typeof MediaValues; + + /** + * SKU (Stock Keeping Units) types for Play Package Entitlements. + */ + readonly EntitlementSkuTypes: typeof EntitlementSkuTypes; + /** * Possible update trigger time context frequencies. */ @@ -1384,6 +1442,20 @@ export class AssistantApp { */ getLastSeen(): Date | null; + /** + * Get the the list of all digital goods that your user purchased from + * your published Android apps. To enable this feature, see the instructions + * in the (documentation)[https://developers.google.com/actions/identity/digital-goods]. + * + * @example + * const app = new DialogflowApp({request, response}); + * const packageEntitlements = app.getPackageEntitlements(); + * + * @return The list of digital goods purchased by the user in + * any verified Android app package. Null if no Package Entitlements present in the request. + */ + getPackageEntitlements(): PackageEntitlement[] | null; + /** * If granted permission to device's location in previous intent, returns device's * location (see {@link AssistantApp#askForPermissions|askForPermissions}). @@ -1488,6 +1560,31 @@ export class AssistantApp { */ getSignInStatus(): string; + /** + * Get status of MEDIA_STATUS intent. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * + * function mediaStatusIntent (app) { + * const status = app.getMediaStatus(); + * if (status === app.Media.Status.FINISHED) { + * app.tell('Oh, I see you are done playing the media!'); + * } else { + * app.tell(`I don't understand the current media status: ${status}`); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.MEDIA_STATUS, mediaStatusIntent); + * app.handleRequest(actionMap); + * + * @return Result of media status intent. + * @dialogflow + * @actionssdk + */ + getMediaStatus(): MediaValues.Status | null; + /** * Returns true if user device has a given surface capability. * @@ -1694,6 +1791,13 @@ export class AssistantApp { */ buildCarousel(): Carousel; + /** + * Constructs a Browse Carousel with chainable property setters. + * + * @return Constructed Browse Carousel. + */ + buildBrowseCarousel(): BrowseCarousel; + /** * Constructs OptionItem with chainable property setters. * @@ -1706,6 +1810,15 @@ export class AssistantApp { */ buildOptionItem(key?: string, synonyms?: string | string[]): OptionItem; + /** + * Constructs BrowseItem for the Browse Carousel with chainable property setters. + * + * @param title The displayed title of the Browse Carousel card. + * @param url The URL linked to by clicking the card. + * @return Constructed BrowseItem. + */ + buildBrowseItem(title?: string, url?: string): BrowseItem; + // --------------------------------------------------------------------------- // Transaction Builders // --------------------------------------------------------------------------- @@ -1746,4 +1859,24 @@ export class AssistantApp { * @return Constructed OrderUpdate. */ buildOrderUpdate(orderId: string, isGoogleOrderId: boolean): OrderUpdate; + + // --------------------------------------------------------------------------- + // Media Builders + // --------------------------------------------------------------------------- + + /** + * Constructs Media Response with chainable property setters. + * + * @return Constructed Media Response. + */ + buildMediaResponse(): MediaResponse; + + /** + * Constructs MediaObject with chainable property setters. + * + * @param name Name of media file. + * @param contentUrl Location of media file. + * @return Constructed MediaObject. + */ + buildMediaObject(name: string, contentUrl: string): MediaObject; } diff --git a/types/actions-on-google/index.d.ts b/types/actions-on-google/index.d.ts index 0260bc6cee..943554586f 100644 --- a/types/actions-on-google/index.d.ts +++ b/types/actions-on-google/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for actions-on-google 1.9 +// Type definitions for actions-on-google 1.10 // Project: https://github.com/actions-on-google/actions-on-google-nodejs // Definitions by: Joel Hegg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/actions-on-google/response-builder.d.ts b/types/actions-on-google/response-builder.d.ts index 966c881ba6..9844fe45c1 100644 --- a/types/actions-on-google/response-builder.d.ts +++ b/types/actions-on-google/response-builder.d.ts @@ -27,6 +27,53 @@ export enum ImageDisplays { CROPPED } +/** + * Values related to supporting media. + */ +export namespace MediaValues { + /** + * Type of the media within a MediaResponse. + */ + enum Type { + /** + * Unspecified. + */ + MEDIA_TYPE_UNSPECIFIED, + /** + * Audio stream. + */ + AUDIO + } + + /** + * List of media control status' returned. + */ + enum Status { + /** + * Unspecified. + */ + UNSPECIFIED, + /** + * Finished. + */ + FINISHED + } + + /** + * List of possible item types. + */ + enum ImageType { + /** + * Icon. + */ + ICON, + /** + * Large image. + */ + LARGE + } +} + /** * Simple Response type. */ @@ -155,6 +202,22 @@ export class RichResponse { */ addBasicCard(basicCard: BasicCard): RichResponse; + /** + * Adds media to this response. + * + * @param mediaResponse MediaResponse to include in response. + * @return Returns current constructed RichResponse. + */ + addMediaResponse(mediaResponse: MediaResponse): RichResponse; + + /** + * Adds a Browse Carousel to list of items. + * + * @param browseCarousel Browse Carousel to present to user + * @return Returns current constructed RichResponse. + */ + addBrowseCarousel(browseCarousel: string | BrowseCarousel): RichResponse; + /** * Adds a single suggestion or list of suggestions to list of items. * @@ -325,6 +388,43 @@ export class List { addItems(optionItems: OptionItem | OptionItem[]): List; } +/** + * Class for initializing and constructing BrowseCarousel with chainable interface. + */ +export class BrowseCarousel { + /** + * Constructor for BrowseCarousel. Accepts optional BrowseCarousel to + * clone or list of items to copy. + * + * @param carousel Either a carousel to clone + * or an array of BrowseItem to initialize a new carousel + */ + constructor(carousel?: BrowseCarousel | BrowseItem[]); + + /** + * List of 2-20 items to show in this carousel. Required. + */ + items: BrowseItem[]; + + /** + * Adds a single item or list of items to the carousel. + * + * @param browseItems BrowseItems to add. + * @return Returns current constructed BrowseCarousel. + */ + addItems(browseItems: BrowseItem | BrowseItem[]): BrowseCarousel; + + /** + * Sets the display options for the images in this carousel. + * Use one of the image display constants. If none is chosen, + * ImageDisplays.DEFAULT will be enforced. + * + * @param option The option for displaying the image. + * @return Returns current constructed BrowseCarousel. + */ + setImageDisplay(option: ImageDisplays): BrowseCarousel; +} + /** * Class for initializing and constructing Carousel with chainable interface. */ @@ -362,6 +462,110 @@ export class Carousel { setImageDisplay(option: ImageDisplays): Carousel; } +/** + * Class for initializing and constructing Option Items with chainable interface. + */ +export class BrowseItem { + /** + * Constructor for BrowseItem. Accepts a title and URL for the Browse Item + * card. + * + * @param title The title of the Browse Item card. + * @param url The URL of the link opened by clicking the Browse Item card. + */ + constructor(title?: string, url?: string); + + /** + * Title of the browse item. Required. + */ + title: string; + + /** + * Description text of the item. Optional. + */ + description?: string; + + /** + * Footer text of the item. Optional. + */ + footer?: string; + + /** + * Image to show on item. Optional. + */ + image?: Image; + + /** + * Url to that clicking the card opens. Optional. + */ + openUrlAction?: object; + + /** + * @return Returns the possible valid values for URL type hints + */ + urlTypeHints(): object; + + /** + * Sets the title for this Browse Item. + * + * @param title Title to show on item. + * @return Returns current constructed BrowseItem. + */ + setTitle(title: string): BrowseItem; + + /** + * Sets the description for this Browse Item. + * + * @param description Description to show on item. + * @return Returns current constructed BrowseItem. + */ + setDescription(description: string): BrowseItem; + + /** + * Sets the footer for this Browse Item. + * + * @param footerText text to show on item. + * @return Returns current constructed BrowseItem. + */ + setFooter(footerText: string): BrowseItem; + + /** + * Sets the image for this Browse Item. + * + * @param url Image source URL. + * @param accessibilityText Text to replace for image for accessibility. + * @param width Width of the image. + * @param height Height of the image. + * @return Returns current constructed BrowseItem. + */ + setImage(url: string, accessibilityText: string, width?: number, height?: number): BrowseItem; + + /** + * Sets the Open URL action - which includes the url and possibly the typeHint + * + * @param url Image source URL. + * @param urlTypeHint One of the typeHints enumerated by this.urlTypeHints() + * @return Returns the current constructed BrowseItem + */ + setOpenUrlAction(url: string, urlTypeHint?: string): BrowseItem; + + /** + * Sets the URL target of the BrowseItem card + * + * @param url Image source URL. + * @return Returns the current constructed BrowseItem + */ + setUrl(url: string): BrowseItem; + + /** + * Sets the URL type hint for the BrowseItem card + * + * @param urlTypeHint One of the typeHints enumerated by this.urlTypeHints() + * @return Returns the current constructed BrowseItem + */ + setUrlTypeHint(urlTypeHint: string): BrowseItem; +} + /** * Class for initializing and constructing Option Items with chainable interface. */ @@ -440,6 +644,90 @@ export class OptionItem { addSynonyms(synonyms: string | string[]): OptionItem; } +/** + * Class for initializing and constructing MediaResponse with chainable interface. + */ +export class MediaResponse { + /** + * Constructor for MediaResponse. + * @param mediaType Type of the media which defaults to MediaValues.Type.AUDIO + */ + constructor(mediaType: MediaValues.Type); + + /** + * Array of MediaObject held in the MediaResponse. + */ + mediaObjects: MediaObject[]; + + /** + * Type of the media within this MediaResponse + */ + mediaType: MediaValues.Type; + + /** + * Adds a single media file or list of media files to the cart. + * + * @param items Single or Array of MediaObject to add. + * @return Returns current constructed MediaResponse. + */ + addMediaObjects(items: MediaObject | MediaObject[]): MediaResponse; +} + +/** + * Class for initializing and constructing MediaObject with chainable interface. + */ +export class MediaObject { + /** + * Constructor for MediaObject. + * + * @param name Name of the MediaObject. + * @param contentUrl URL of the MediaObject. + */ + constructor(name: string, contentUrl: string); + + /** + * Name of the MediaObject. + */ + name: string; + + /** + * MediaObject URL. + */ + contentUrl: string; + + /** + * Description of the MediaObject. + */ + description?: string; + + /** + * Large image. + */ + largeImage?: Image; + + /** + * Icon image. + */ + icon?: Image; + + /** + * Set the description of the item. + * + * @param description Description of the item. + * @return Returns current constructed MediaObject. + */ + setDescription(description: string): MediaObject; + + /** + * Sets the image for this item. + * + * @param url Image source URL. + * @param type Type of image (LARGE or ICON). + * @return Returns current constructed MediaObject. + */ + setImage(url: string, type: MediaValues.ImageType): MediaObject; +} + /** * Check if given text contains SSML. * @param text Text to check. From f87445077bf246a5a72a64fbb9749fefe1e576c2 Mon Sep 17 00:00:00 2001 From: Yoyo Zhou Date: Wed, 4 Apr 2018 06:58:01 -0700 Subject: [PATCH 0437/2153] big.js: add aliases .add, .mul, .sub (#24708) --- types/big.js/index.d.ts | 18 ++++++++++++++++++ types/big.js/test/big.js-global-tests.ts | 3 +++ types/big.js/test/big.js-module-tests.ts | 3 +++ 3 files changed, 24 insertions(+) diff --git a/types/big.js/index.d.ts b/types/big.js/index.d.ts index 405622f7ee..8b61c73d37 100644 --- a/types/big.js/index.d.ts +++ b/types/big.js/index.d.ts @@ -102,6 +102,12 @@ export interface BigConstructor { export interface Big { /** Returns a Big number whose value is the absolute value, i.e. the magnitude, of this Big number. */ abs(): Big; + /** + * Returns a Big number whose value is the value of this Big number plus n - alias for .plus(). + * + * @throws `NaN` if n is invalid. + */ + add(n: BigSource): Big; /** * Compare the values. * @@ -162,6 +168,12 @@ export interface Big { * @throws `NaN` if n is negative or otherwise invalid. */ mod(n: BigSource): Big; + /** + * Returns a Big number whose value is the value of this Big number times n - alias for .times(). + * + * @throws `NaN` if n is invalid. + */ + mul(n: BigSource): Big; /** * Returns a Big number whose value is the value of this Big number plus n. * @@ -196,6 +208,12 @@ export interface Big { * @throws `NaN` if this Big number is negative. */ sqrt(): Big; + /** + * Returns a Big number whose value is the value of this Big number minus n - alias for .minus(). + * + * @throws `NaN` if n is invalid. + */ + sub(n: BigSource): Big; /** * Returns a Big number whose value is the value of this Big number times n. * diff --git a/types/big.js/test/big.js-global-tests.ts b/types/big.js/test/big.js-global-tests.ts index 578391de7b..a57e748fbf 100644 --- a/types/big.js/test/big.js-global-tests.ts +++ b/types/big.js/test/big.js-global-tests.ts @@ -86,6 +86,7 @@ function minusTests() { 0.3 - 0.1; // 0.19999999999999998 const x = new Big(0.3); x.minus(0.1); // '0.2' + x.sub(0.1); // '0.2' } function modTests() { @@ -99,6 +100,7 @@ function plusTests() { const x = new Big(0.1); const y = x.plus(0.2); // '0.3' Big(0.7).plus(x).plus(y); // '1' + Big(0.7).add(x).add(y); // '1' } function powTests() { @@ -138,6 +140,7 @@ function timesTests() { const x = new Big(0.6); const y = x.times(3); // '1.8' Big('7e+500').times(y); // '1.26e+501' + Big('7e+500').mul(y); // '1.26e+501' } function toExponentialTests() { diff --git a/types/big.js/test/big.js-module-tests.ts b/types/big.js/test/big.js-module-tests.ts index 056d41727b..62e5ba491e 100644 --- a/types/big.js/test/big.js-module-tests.ts +++ b/types/big.js/test/big.js-module-tests.ts @@ -88,6 +88,7 @@ function minusTests() { 0.3 - 0.1; // 0.19999999999999998 const x = new Big(0.3); x.minus(0.1); // '0.2' + x.sub(0.1); // '0.2' } function modTests() { @@ -101,6 +102,7 @@ function plusTests() { const x = new Big(0.1); const y = x.plus(0.2); // '0.3' Big(0.7).plus(x).plus(y); // '1' + Big(0.7).add(x).add(y); // '1' } function powTests() { @@ -140,6 +142,7 @@ function timesTests() { const x = new Big(0.6); const y = x.times(3); // '1.8' Big('7e+500').times(y); // '1.26e+501' + Big('7e+500').mul(y); // '1.26e+501' } function toExponentialTests() { From d6e5b0002e219eb563cf35e1fe938d3b6040625c Mon Sep 17 00:00:00 2001 From: Arylo Date: Thu, 5 Apr 2018 00:05:01 +0800 Subject: [PATCH 0438/2153] Add Test Unit and Fix some problems --- types/gitlab/ApiBase.d.ts | 8 ++- types/gitlab/ApiBaseHTTP.d.ts | 5 +- types/gitlab/ApiV3.d.ts | 4 +- types/gitlab/BaseModel.d.ts | 23 ++++---- types/gitlab/Models/Groups.d.ts | 18 +++++-- types/gitlab/Models/IssueNotes.d.ts | 6 ++- types/gitlab/Models/Issues.d.ts | 16 +++--- types/gitlab/Models/Labels.d.ts | 5 +- types/gitlab/Models/Notes.d.ts | 5 +- types/gitlab/Models/Pipelines.d.ts | 5 +- types/gitlab/Models/ProjectBuilds.d.ts | 15 ++++-- types/gitlab/Models/ProjectDeployKeys.d.ts | 9 ++-- types/gitlab/Models/ProjectHooks.d.ts | 18 ++++--- types/gitlab/Models/ProjectIssues.d.ts | 9 +++- types/gitlab/Models/ProjectLabels.d.ts | 6 ++- types/gitlab/Models/ProjectMembers.d.ts | 16 +++--- types/gitlab/Models/ProjectMergeRequests.d.ts | 16 +++--- types/gitlab/Models/ProjectMilestones.d.ts | 16 +++--- types/gitlab/Models/ProjectRepository.d.ts | 38 +++++++++----- types/gitlab/Models/ProjectServices.d.ts | 11 ++-- types/gitlab/Models/Projects.d.ts | 52 +++++++++++++++---- types/gitlab/Models/Runners.d.ts | 11 ++-- types/gitlab/Models/UserKeys.d.ts | 7 +-- types/gitlab/Models/Users.d.ts | 17 ++++-- types/gitlab/gitlab-tests.ts | 20 +++++++ types/gitlab/index.d.ts | 10 ++-- types/gitlab/tsconfig.json | 1 + 27 files changed, 253 insertions(+), 114 deletions(-) diff --git a/types/gitlab/ApiBase.d.ts b/types/gitlab/ApiBase.d.ts index b8566f3ccb..9d525be7a4 100644 --- a/types/gitlab/ApiBase.d.ts +++ b/types/gitlab/ApiBase.d.ts @@ -5,8 +5,14 @@ import { Issues } from './Models/Issues.d'; import { Projects } from './Models/Projects.d'; import { Groups } from './Models/Groups.d'; +export interface IApiBase { + url?: string; + token?: string; + [key: string]: any; +} + export class ApiBase { - constructor(options: object); + constructor(options: IApiBase); public groups: Groups public projects: Projects public issues: Issues diff --git a/types/gitlab/ApiBaseHTTP.d.ts b/types/gitlab/ApiBaseHTTP.d.ts index 2de92b6c74..41ab7a2bca 100644 --- a/types/gitlab/ApiBaseHTTP.d.ts +++ b/types/gitlab/ApiBaseHTTP.d.ts @@ -1,6 +1,9 @@ -export class ApiBaseHTTP { +import { ApiBase } from './ApiBase.d'; + +export class ApiBaseHTTP extends ApiBase { public prepare_opts(opts: T): T; public fn_wrapper(fn: Function): Function; + public get(path: string, fn?: Function): any; public get(path: string, query?: object, fn?: Function): any; public delete(path: string, fn?: Function): any; public post(path: string, data?: object, fn?: Function): any; diff --git a/types/gitlab/ApiV3.d.ts b/types/gitlab/ApiV3.d.ts index 762f8824d6..17fe81928e 100644 --- a/types/gitlab/ApiV3.d.ts +++ b/types/gitlab/ApiV3.d.ts @@ -1,3 +1,5 @@ -export class ApiV3 { +import { ApiBaseHTTP } from './ApiBaseHTTP.d'; + +export class ApiV3 extends ApiBaseHTTP { } diff --git a/types/gitlab/BaseModel.d.ts b/types/gitlab/BaseModel.d.ts index e801ccf654..8f64621ac9 100644 --- a/types/gitlab/BaseModel.d.ts +++ b/types/gitlab/BaseModel.d.ts @@ -1,14 +1,17 @@ export class BaseModel { public load(model: string): object; - public get(): any - public post(): any - public put(): any - public delete(): any - public debug(): any + public get(path: string, fn?: Function): any; + public get(path: string, query?: object, fn?: Function): any; + public delete(path: string, fn?: Function): any; + public post(path: string, data?: object, fn?: Function): any; + public put(path: string, data?: object, fn?: Function): any; + public patch(path: string, data?: object, fn?: Function): any; } -export interface PageDefualtParams { - page?: number - per_page?: number - [key: string]: any + +export interface IDefParams { + page?: number; + per_page?: number; + [key: string]: any; } -export type TypeNumOrStrId = number | string; + +export type TId = number | string; diff --git a/types/gitlab/Models/Groups.d.ts b/types/gitlab/Models/Groups.d.ts index f8ad983f4a..ed21ecac47 100644 --- a/types/gitlab/Models/Groups.d.ts +++ b/types/gitlab/Models/Groups.d.ts @@ -1,12 +1,24 @@ -import { BaseModel } from "../BaseModel"; +import { BaseModel, IDefParams } from "../BaseModel"; + +interface IAccessLevels { + GUEST: number + REPORTER: number + DEVELOPER: number + MASTER: number + OWNER: number +} export class Groups extends BaseModel { + public readonly access_levels: IAccessLevels; + public init(): object; - public all(params?: object, fn?: Function): any; + public all(fn?: Function): any; + public all(params?: IDefParams, fn?: Function): any; public show(groupId: number, fn?: Function): any; public listProjects(groupId: number, fn?: Function): any; public listMembers(groupId: number, fn?: Function): any; - public editMember(groupId: number, userId: number, accessLevel: number, fn?: Function): any; + public addMember(groupId: number, userId: number, accessLevel: IAccessLevels[keyof IAccessLevels], fn?: Function): any; + public editMember(groupId: number, userId: number, accessLevel: IAccessLevels[keyof IAccessLevels], fn?: Function): any; public removeMember(groupId: number, userId: number, fn?: Function): any; public create(params?: object, fn?: Function): any; public addProject(groupId: number, projectId: number, fn?: Function): any; diff --git a/types/gitlab/Models/IssueNotes.d.ts b/types/gitlab/Models/IssueNotes.d.ts index aeb7c5944b..a40855f293 100644 --- a/types/gitlab/Models/IssueNotes.d.ts +++ b/types/gitlab/Models/IssueNotes.d.ts @@ -1,4 +1,6 @@ -import { BaseModel } from './../BaseModel.d'; +import { BaseModel, TId, IDefParams } from '../BaseModel.d'; + export class IssueNotes extends BaseModel{ - public all(projectId: number | string, issueId: number, params?: object, fn?: Function): any + public all(projectId: TId, issueId: number, fn?: Function): any + public all(projectId: TId, issueId: number, params?: IDefParams, fn?: Function): any } diff --git a/types/gitlab/Models/Issues.d.ts b/types/gitlab/Models/Issues.d.ts index 9fcc585ea0..a0ca51c6ab 100644 --- a/types/gitlab/Models/Issues.d.ts +++ b/types/gitlab/Models/Issues.d.ts @@ -1,10 +1,12 @@ -import { BaseModel } from './../BaseModel.d'; +import { BaseModel, TId } from '../BaseModel.d'; + export class Issues extends BaseModel { + public all(fn?: Function): any; public all(params?: object, fn?: Function): any; - public show(projectId: number | string, issueId: number | string, fn?: Function): any; - public create(projectId: number | string, params?: object, fn?: Function): any; - public edit(projectId: number | string, issueId: number | string, params?: object, fn?: Function): any; - public remove(projectId: number | string, issueId: number | string, fn?: Function): any; - public subscribe(projectId: number | string, issueId: number | string, params?: object, fn?: Function): any; - public unsubscribe(projectId: number | string, issueId: number | string, fn?: Function): any; + public show(projectId: TId, issueId: TId, fn?: Function): any; + public create(projectId: TId, params?: object, fn?: Function): any; + public edit(projectId: TId, issueId: TId, params?: object, fn?: Function): any; + public remove(projectId: TId, issueId: TId, fn?: Function): any; + public subscribe(projectId: TId, issueId: TId, params?: object, fn?: Function): any; + public unsubscribe(projectId: TId, issueId: TId, fn?: Function): any; } diff --git a/types/gitlab/Models/Labels.d.ts b/types/gitlab/Models/Labels.d.ts index b7529b320c..c323b0777b 100644 --- a/types/gitlab/Models/Labels.d.ts +++ b/types/gitlab/Models/Labels.d.ts @@ -1,4 +1,5 @@ -import { BaseModel } from './../BaseModel.d'; +import { BaseModel, TId } from '../BaseModel.d'; + export class Labels extends BaseModel { - public create(projectId: number | string, params?: object, fn?: Function): any; + public create(projectId: TId, params?: object, fn?: Function): any; } diff --git a/types/gitlab/Models/Notes.d.ts b/types/gitlab/Models/Notes.d.ts index 8a85dcbedc..50fd1e4da7 100644 --- a/types/gitlab/Models/Notes.d.ts +++ b/types/gitlab/Models/Notes.d.ts @@ -1,4 +1,5 @@ -import { BaseModel } from './../BaseModel.d'; +import { BaseModel, TId } from '../BaseModel.d'; + export class Notes extends BaseModel { - public create(projectId: number | string, issueId: number, params?: object, fn?: Function): any; + public create(projectId: TId, issueId: number, params?: object, fn?: Function): any; } diff --git a/types/gitlab/Models/Pipelines.d.ts b/types/gitlab/Models/Pipelines.d.ts index bfddc099f9..8315508214 100644 --- a/types/gitlab/Models/Pipelines.d.ts +++ b/types/gitlab/Models/Pipelines.d.ts @@ -1,4 +1,5 @@ -import { BaseModel } from './../BaseModel.d'; +import { BaseModel, TId } from '../BaseModel.d'; + export class Pipelines extends BaseModel { - public all(projectId: number | string, fn?: Function): any; + public all(projectId: TId, fn?: Function): any; } diff --git a/types/gitlab/Models/ProjectBuilds.d.ts b/types/gitlab/Models/ProjectBuilds.d.ts index 5bc9fbaa3d..8714f27b1b 100644 --- a/types/gitlab/Models/ProjectBuilds.d.ts +++ b/types/gitlab/Models/ProjectBuilds.d.ts @@ -1,6 +1,13 @@ -import { BaseModel } from './../BaseModel.d'; +import { BaseModel, TId, IDefParams } from '../BaseModel.d'; + +interface IShowBuildParam { + projectId: TId; + [key: string]: any; +} + export class ProjectBuilds extends BaseModel { - public listBuilds(projectId: number | string, params?: { page?: number, per_page?: number, [key: string]: any }, fn?: Function): any; - public showBuild(projectId: number | string, buildId: string, fn?: Function): any; - public showBuild(params?: { projectId: number | string}, fn?: Function): any; + public listBuilds(projectId: TId, fn?: Function): any; + public listBuilds(projectId: TId, params?: IDefParams, fn?: Function): any; + public showBuild(projectId: TId, buildId: string, fn?: Function): any; + public triggerBuild(params?: IShowBuildParam, fn?: Function): any; } diff --git a/types/gitlab/Models/ProjectDeployKeys.d.ts b/types/gitlab/Models/ProjectDeployKeys.d.ts index be6af6a170..8cadac8507 100644 --- a/types/gitlab/Models/ProjectDeployKeys.d.ts +++ b/types/gitlab/Models/ProjectDeployKeys.d.ts @@ -1,6 +1,7 @@ -import { BaseModel } from './../BaseModel.d'; +import { BaseModel, TId } from '../BaseModel.d'; + export class ProjectKeys extends BaseModel { - public listKeys(projectId: number | string, fn?: Function): any; - public getKey(projectId: number | string, keyId: number, fn?: Function): any; - public addKey(projectId: number | string, params?: object, fn?: Function): any; + public listKeys(projectId: TId, fn?: Function): any; + public getKey(projectId: TId, keyId: number, fn?: Function): any; + public addKey(projectId: TId, params?: object, fn?: Function): any; } diff --git a/types/gitlab/Models/ProjectHooks.d.ts b/types/gitlab/Models/ProjectHooks.d.ts index 399dc18e7f..775e1348fc 100644 --- a/types/gitlab/Models/ProjectHooks.d.ts +++ b/types/gitlab/Models/ProjectHooks.d.ts @@ -1,8 +1,14 @@ -import { BaseModel } from './../BaseModel.d'; +import { BaseModel, TId } from '../BaseModel.d'; + +interface IAddParam { + url: string; + [key: string]: any; +} + export class ProjectHooks extends BaseModel { - public list(projectId: number | string, fn?: Function): any; - public show(projectId: number | string, hookId: number, fn?: Function): any; - public add(projectId: number | string, params: object|string, fn?: Function): any; - public update(projectId: number | string, hookId: number, url: any, fn?: Function): any; - public remove(projectId: number | string, hookId: number, fn?: Function): any; + public list(projectId: TId, fn?: Function): any; + public show(projectId: TId, hookId: number, fn?: Function): any; + public add(projectId: TId, params: IAddParam | string, fn?: Function): any; + public update(projectId: TId, hookId: number, url: any, fn?: Function): any; + public remove(projectId: TId, hookId: number, fn?: Function): any; } diff --git a/types/gitlab/Models/ProjectIssues.d.ts b/types/gitlab/Models/ProjectIssues.d.ts index ee61cfca3f..95bbc99bed 100644 --- a/types/gitlab/Models/ProjectIssues.d.ts +++ b/types/gitlab/Models/ProjectIssues.d.ts @@ -1,4 +1,9 @@ -import { BaseModel } from './../BaseModel.d'; +import { IssueNotes } from './IssueNotes.d'; +import { BaseModel, TId, IDefParams } from '../BaseModel.d'; + export class ProjectIssues extends BaseModel { - public list(projectId: number | string, params: { page?: number, per_page?: number, [key: string]: any }, fn?: Function): any; + public readonly notes: IssueNotes; + + public list(projectId: TId, fn?: Function): any; + public list(projectId: TId, params?: IDefParams, fn?: Function): any; } diff --git a/types/gitlab/Models/ProjectLabels.d.ts b/types/gitlab/Models/ProjectLabels.d.ts index 23d12ca652..7fa178843c 100644 --- a/types/gitlab/Models/ProjectLabels.d.ts +++ b/types/gitlab/Models/ProjectLabels.d.ts @@ -1,4 +1,6 @@ -import { BaseModel } from './../BaseModel.d'; +import { BaseModel, TId, IDefParams } from '../BaseModel.d'; + export class ProjectLabels extends BaseModel { - public all(projectId: number | string, params: { page?: number, per_page?: number, [key: string]: any }, fn?: Function): any; + public all(projectId: TId, fn?: Function): any; + public all(projectId: TId, params?: IDefParams, fn?: Function): any; } diff --git a/types/gitlab/Models/ProjectMembers.d.ts b/types/gitlab/Models/ProjectMembers.d.ts index 79b9e11b02..baf92668c9 100644 --- a/types/gitlab/Models/ProjectMembers.d.ts +++ b/types/gitlab/Models/ProjectMembers.d.ts @@ -1,8 +1,12 @@ -import { BaseModel } from './../BaseModel.d'; +import { BaseModel, TId } from '../BaseModel.d'; + +type MenberCb = (menber: any) => any; +type MenbersCb = (menbers: any[]) => any; + export class ProjectMembers extends BaseModel { - public list(projectId: number | string, fn?: Function): any; - public show(projectId: number | string, userId: number, fn?: Function): any; - public add(projectId: number | string, userId: number, accessLevel: number,fn?: Function): any; - public update(projectId: number | string, userId: number, accessLevel: number, fn?: Function): any; - public remove(projectId: number | string, userId: number, fn?: Function): any; + public list(projectId: TId, fn?: MenbersCb): any; + public show(projectId: TId, userId: number, fn?: MenberCb): any; + public add(projectId: TId, userId: number, accessLevel: number,fn?: Function): any; + public update(projectId: TId, userId: number, accessLevel: number, fn?: Function): any; + public remove(projectId: TId, userId: number, fn?: Function): any; } diff --git a/types/gitlab/Models/ProjectMergeRequests.d.ts b/types/gitlab/Models/ProjectMergeRequests.d.ts index f2043e79d5..b3898bfac4 100644 --- a/types/gitlab/Models/ProjectMergeRequests.d.ts +++ b/types/gitlab/Models/ProjectMergeRequests.d.ts @@ -1,9 +1,11 @@ -import { BaseModel } from './../BaseModel.d'; +import { BaseModel, TId, IDefParams } from '../BaseModel.d'; + export class ProjectMergeRequests extends BaseModel { - public list(projectId: number | string, params: { page?: number, per_page?: number, [key: string]: any }, fn?: Function): any; - public show(projectId: number | string, mergerequestId: number, fn?: Function): any; - public add(projectId: number | string, sourceBranch: any, targetBranch: any, assigneeId: number, title: any, fn?: Function): any; - public update(projectId: number | string, mergerequestId: number, params: object, fn?: Function): any; - public comment(projectId: number | string, mergerequestId: number, note: any, fn?: Function): any; - public merge(projectId: number | string, mergerequestId: number, params: object, fn?: Function): any; + public list(projectId: TId, fn?: Function): any; + public list(projectId: TId, params?: IDefParams, fn?: Function): any; + public show(projectId: TId, mergerequestId: number, fn?: Function): any; + public add(projectId: TId, sourceBranch: string, targetBranch: string, assigneeId: number, title: string, fn?: Function): any; + public update(projectId: TId, mergerequestId: number, params: object, fn?: Function): any; + public comment(projectId: TId, mergerequestId: number, note: any, fn?: Function): any; + public merge(projectId: TId, mergerequestId: number, params: object, fn?: Function): any; } diff --git a/types/gitlab/Models/ProjectMilestones.d.ts b/types/gitlab/Models/ProjectMilestones.d.ts index 9a9da7c025..eeccc96fbf 100644 --- a/types/gitlab/Models/ProjectMilestones.d.ts +++ b/types/gitlab/Models/ProjectMilestones.d.ts @@ -1,8 +1,12 @@ -import { BaseModel } from './../BaseModel.d'; +import { BaseModel, TId } from '../BaseModel.d'; + +type MilestonesCb = (milestones: any[]) => any; +type MilestoneCb = (milestones: any) => any; + export class ProjectMilestones extends BaseModel { - public list(projectId: number | string, fn?: Function): any; - public all(projectId: number | string, fn?: Function): any; - public show(projectId: number | string, milestoneId: number, fn?: Function): any; - public add(projectId: number | string, title: any, description: any, due_date: any, fn?: Function): any; - public update(projectId: number | string, milestoneId: number, title: any, description: any, due_date: any, state_event: any, fn?: Function): any; + public list(projectId: TId, fn?: MilestonesCb): any; + public all(projectId: TId, fn?: MilestonesCb): any; + public show(projectId: TId, milestoneId: number, fn?: MilestoneCb): any; + public add(projectId: TId, title: string, description: string, due_date: any, fn?: Function): any; + public update(projectId: TId, milestoneId: number, title: string, description: string, due_date: any, state_event: any, fn?: Function): any; } diff --git a/types/gitlab/Models/ProjectRepository.d.ts b/types/gitlab/Models/ProjectRepository.d.ts index e0421e5a7e..85df8bc026 100644 --- a/types/gitlab/Models/ProjectRepository.d.ts +++ b/types/gitlab/Models/ProjectRepository.d.ts @@ -1,20 +1,30 @@ -import { BaseModel } from './../BaseModel.d'; +import { BaseModel, TId } from '../BaseModel.d'; + +interface IShowFileParam { + file_path: string; + ref?: any; + file_id?: any; + [key: string]: any; +} + export class ProjectRepository extends BaseModel { - public listBranches(projectId: number | string, fn?: Function): any; - public showBranch(projectId: number | string, branchId: string, fn?: Function): any; - public protectBranch(projectId: number | string, branchId: string, params: object, fn?: Function): any; - public unprotectBranch(projectId: number | string, branchId: string, fn?: Function): any; + public listBranches(projectId: TId, fn?: Function): any; + public showBranch(projectId: TId, branchId: string, fn?: Function): any; + public protectBranch(projectId: TId, branchId: string, params: object, fn?: Function): any; + public unprotectBranch(projectId: TId, branchId: string, fn?: Function): any; public createBranch(params: object, fn?: Function): any; - public deleteBranch(projectId: number | string, branchId: string, fn?: Function): any; + public deleteBranch(projectId: TId, branchId: string, fn?: Function): any; public addTag(params: object, fn?: Function): any; - public deleteTag(projectId: number | string, tagName: string, fn?: Function): any; - public showTag(projectId: number | string, tagName: string, fn?: Function): any; - public listTags(projectId: number | string, fn?: Function): any; - public listCommits(projectId: number | string, fn?: Function): any; - public showCommit(projectId: number | string, sha: string, fn?: Function): any; - public diffCommit(projectId: number | string, sha: string, fn?: Function): any; - public listTree(projectId: number | string, params?: object, fn?: Function): any; - public showFile(projectId: number | string, params?: object, fn?: Function): any; + public deleteTag(projectId: TId, tagName: string, fn?: Function): any; + public showTag(projectId: TId, tagName: string, fn?: Function): any; + public listTags(projectId: TId, fn?: Function): any; + public listCommits(projectId: TId, fn?: Function): any; + public showCommit(projectId: TId, sha: string, fn?: Function): any; + public diffCommit(projectId: TId, sha: string, fn?: Function): any; + public listTree(projectId: TId, fn?: Function): any; + public listTree(projectId: TId, params?: object, fn?: Function): any; + public showFile(projectId: TId, fn?: Function): any; + public showFile(projectId: TId, params?: IShowFileParam, fn?: Function): any; public createFile(params?: object, fn?: Function): any; public updateFile(params?: object, fn?: Function): any; public compare(params?: object, fn?: Function): any; diff --git a/types/gitlab/Models/ProjectServices.d.ts b/types/gitlab/Models/ProjectServices.d.ts index 935e173bce..c3cbd0aee6 100644 --- a/types/gitlab/Models/ProjectServices.d.ts +++ b/types/gitlab/Models/ProjectServices.d.ts @@ -1,6 +1,9 @@ -import { BaseModel } from './../BaseModel.d'; +import { BaseModel, TId } from './../BaseModel.d'; + +type ServiceCb = (service: any) => any; + export class ProjectServices extends BaseModel { - public show(projectId: number | string, serviceName: string, fn?: Function): any; - public update(projectId: number | string, serviceName: string, params: object, fn?: Function): any; - public remove(projectId: number | string, serviceName: string, fn?: Function): any; + public show(projectId: TId, serviceName: string, fn?: ServiceCb): any; + public update(projectId: TId, serviceName: string, params: object, fn?: ServiceCb): any; + public remove(projectId: TId, serviceName: string, fn?: ServiceCb): any; } diff --git a/types/gitlab/Models/Projects.d.ts b/types/gitlab/Models/Projects.d.ts index dc25e5f418..9a66318a00 100644 --- a/types/gitlab/Models/Projects.d.ts +++ b/types/gitlab/Models/Projects.d.ts @@ -1,25 +1,55 @@ -import { BaseModel, PageDefualtParams, TypeNumOrStrId} from './../BaseModel.d'; +import { Runners } from './Runners.d'; +import { Pipelines } from './Pipelines.d'; +import { ProjectBuilds } from './ProjectBuilds.d'; +import { ProjectMergeRequests } from './ProjectMergeRequests.d'; +import { ProjectKeys } from './ProjectDeployKeys.d'; +import { ProjectMilestones } from './ProjectMilestones.d'; +import { ProjectRepository } from './ProjectRepository.d'; +import { ProjectLabels } from './ProjectLabels.d'; +import { ProjectIssues } from './ProjectIssues.d'; +import { ProjectHooks } from './ProjectHooks.d'; +import { ProjectMembers } from './ProjectMembers.d'; +import { BaseModel, IDefParams, TId} from '../BaseModel.d'; +import { ProjectServices } from './ProjectServices.d'; + +type ProjectsCb = (projects: any[]) => any; + export class Projects extends BaseModel { - public all(fn?: Function): any; - public all(params?: PageDefualtParams, fn?: Function): any; - public allAdmin(fn: Function): any; - public allAdmin(params?: PageDefualtParams, fn?: Function): any; - public show(projectId: TypeNumOrStrId, fn?: Function): any; + + public readonly members: ProjectMembers; + public readonly hooks : ProjectHooks; + public readonly issues : ProjectIssues; + public readonly labels : ProjectLabels; + public readonly repository: ProjectRepository; + public readonly milestones: ProjectMilestones; + public readonly deploy_keys: ProjectKeys; + public readonly merge_requests: ProjectMergeRequests; + public readonly services: ProjectServices; + public readonly builds: ProjectBuilds; + public readonly pipelines: Pipelines; + public readonly runners: Runners; + + + public all(fn?: ProjectsCb): any; + public all(params?: IDefParams, fn?: ProjectsCb): any; + public allAdmin(fn?: Function): any; + public allAdmin(params?: IDefParams, fn?: Function): any; + public show(projectId: TId, fn?: Function): any; public create(params: object, fn?: Function): any; public create_for_user(params: object, fn?: Function): any; - public edit(projectId: TypeNumOrStrId, params: object, fn?: Function): any; + public edit(projectId: TId, params: object, fn?: Function): any; public addMember(params?: object, fn?: Function): any; public editMember(params?: object, fn?: Function): any; public listMembers(params?: object, fn?: Function): any; public listCommits(params?: object, fn?: Function): any; public listTags(params?: object, fn?: Function): any; - public remove(projectId: TypeNumOrStrId, fn?: Function): any; + public remove(projectId: TId, fn?: Function): any; public fork(params?: object, fn?: Function): any; public share(params?: object, fn?: Function): any; public search(projectName: string, fn?: Function): any; public search(projectName: string, params?: object, fn?: Function): any; - public listTriggers(projectId: TypeNumOrStrId, fn?: Function): any; - public showTrigger(projectId: TypeNumOrStrId, token: string, fn?: Function): any; + public listTriggers(projectId: TId, fn?: Function): any; + public showTrigger(projectId: TId, token: string, fn?: Function): any; public createTrigger(params?: object, fn?: Function): any; - public removeTrigger(projectId: TypeNumOrStrId, token: string, fn?: Function): any; + public removeTrigger(projectId: TId, token: string, fn?: Function): any; } diff --git a/types/gitlab/Models/Runners.d.ts b/types/gitlab/Models/Runners.d.ts index c65a1e2759..c166a44ff1 100644 --- a/types/gitlab/Models/Runners.d.ts +++ b/types/gitlab/Models/Runners.d.ts @@ -1,10 +1,11 @@ -import { BaseModel, PageDefualtParams, TypeNumOrStrId} from './../BaseModel.d'; +import { BaseModel, IDefParams, TId} from '../BaseModel.d'; + export class Runners extends BaseModel { - public all(projectId?: TypeNumOrStrId, fn?: Function): any; - public all(projectId?: TypeNumOrStrId, params?: object, fn?: Function): any; + public all(projectId?: TId, fn?: Function): any; + public all(projectId?: TId, params?: object, fn?: Function): any; public show(runnerId: number, fn?: Function): any; public update(runnerId: number, attributes: any, fn?: Function): any; public remove(runnerId: number, projectId: any, enable: any, fn?: Function): any; - public enable(projectId: TypeNumOrStrId, runnerId: number, fn?: Function): any; - public disable(projectId: TypeNumOrStrId, runnerId: number, fn?: Function): any; + public enable(projectId: TId, runnerId: number, fn?: Function): any; + public disable(projectId: TId, runnerId: number, fn?: Function): any; } diff --git a/types/gitlab/Models/UserKeys.d.ts b/types/gitlab/Models/UserKeys.d.ts index 90f1918361..cf6b3d71a0 100644 --- a/types/gitlab/Models/UserKeys.d.ts +++ b/types/gitlab/Models/UserKeys.d.ts @@ -1,5 +1,6 @@ -import { BaseModel, PageDefualtParams, TypeNumOrStrId} from './../BaseModel.d'; +import { BaseModel, IDefParams, TId } from '../BaseModel.d'; + export class UserKeys extends BaseModel { - public all(userId?: TypeNumOrStrId, fn?: Function): any; - public addKey(userId: string, title: any, key: any, fn?: Function): any; + public all(userId?: TId, fn?: Function): any; + public addKey(userId: string, title: string, key: any, fn?: Function): any; } diff --git a/types/gitlab/Models/Users.d.ts b/types/gitlab/Models/Users.d.ts index b14a67e63a..fc946d8237 100644 --- a/types/gitlab/Models/Users.d.ts +++ b/types/gitlab/Models/Users.d.ts @@ -1,10 +1,17 @@ -import { BaseModel, PageDefualtParams, TypeNumOrStrId} from './../BaseModel.d'; +import { BaseModel, IDefParams, TId} from '../BaseModel.d'; +import { UserKeys } from './UserKeys.d'; + +type UsersCb = (users: any[]) => any; +type UserCb = (user: any) => any; + export class Users extends BaseModel { - public all(fn?: Function): any; - public all(params?: PageDefualtParams, fn?: Function): any; + public readonly keys: UserKeys; + + public all(fn?: UsersCb): any; + public all(params?: IDefParams, fn?: UsersCb): any; public current(fn?: Function): any; - public show(userId: number, fn?: Function): any; - public create(params?: PageDefualtParams, fn?: Function): any; + public show(userId: number, fn?: UserCb): any; + public create(params?: IDefParams, fn?: Function): any; public session(email: string, password: string, fn?: Function): any; public search(emailOrUsername: string, fn?: Function): any; } diff --git a/types/gitlab/gitlab-tests.ts b/types/gitlab/gitlab-tests.ts index e69de29bb2..00ab2c761e 100644 --- a/types/gitlab/gitlab-tests.ts +++ b/types/gitlab/gitlab-tests.ts @@ -0,0 +1,20 @@ +import * as lib from "gitlab"; + +const gitlab = lib({ + url: 'http://example.com', + token: 'abcdefghij123456' +}); + +const v3 = new lib.ApiV3({ }); + +// From README + +// Listing users +gitlab.users.all((users) => { }); + +// Listing projects +gitlab.projects.all((projects) => { }); + +// From examples/delet-service + +gitlab.projects.services.remove("pid", "name", (service) => { }); diff --git a/types/gitlab/index.d.ts b/types/gitlab/index.d.ts index 8a1ea57dd6..d0f1f5806a 100644 --- a/types/gitlab/index.d.ts +++ b/types/gitlab/index.d.ts @@ -5,10 +5,12 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import { ApiV3 } from "./ApiV3"; +import { IApiBase } from "./ApiBase"; -declare class GitlabApi extends ApiV3 { - - public static readonly ApiV3: ApiV3; +declare namespace Gitlib { + const ApiV3: new(options: IApiBase) => ApiV3; } -export = GitlabApi; +declare function Gitlib(options: IApiBase): ApiV3; + +export = Gitlib; diff --git a/types/gitlab/tsconfig.json b/types/gitlab/tsconfig.json index 83e46736e1..f1297faf67 100644 --- a/types/gitlab/tsconfig.json +++ b/types/gitlab/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" From c4e09994449f8a6e42aabc50a32ea2adda84dedc Mon Sep 17 00:00:00 2001 From: Arylo Date: Thu, 5 Apr 2018 00:22:02 +0800 Subject: [PATCH 0439/2153] Update type definition files --- types/gitlab/ApiBase.d.ts | 19 +++++++++++++------ types/gitlab/Models/ProjectHooks.d.ts | 6 ++++-- types/gitlab/Models/ProjectRepository.d.ts | 14 +++++++++++--- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/types/gitlab/ApiBase.d.ts b/types/gitlab/ApiBase.d.ts index 9d525be7a4..d57795c141 100644 --- a/types/gitlab/ApiBase.d.ts +++ b/types/gitlab/ApiBase.d.ts @@ -1,3 +1,4 @@ +import { IApiBase } from './ApiBase.d'; import { Labels } from './Models/Labels.d'; import { Users } from './Models/Users.d'; import { Notes } from './Models/Notes.d'; @@ -8,17 +9,23 @@ import { Groups } from './Models/Groups.d'; export interface IApiBase { url?: string; token?: string; + oauth_token?: string; + base_url?: string; + auth?: any; [key: string]: any; } export class ApiBase { constructor(options: IApiBase); - public groups: Groups - public projects: Projects - public issues: Issues - public notes: Notes - public users: Users - public labels: Labels + public readonly client: this; + public readonly groups: Groups + public readonly projects: Projects + public readonly issues: Issues + public readonly notes: Notes + public readonly users: Users + public readonly labels: Labels + public options: IApiBase; + public handleOptions(): void; public init(): object; } diff --git a/types/gitlab/Models/ProjectHooks.d.ts b/types/gitlab/Models/ProjectHooks.d.ts index 775e1348fc..98d1ebf10a 100644 --- a/types/gitlab/Models/ProjectHooks.d.ts +++ b/types/gitlab/Models/ProjectHooks.d.ts @@ -5,10 +5,12 @@ interface IAddParam { [key: string]: any; } +type HooksCb = (hooks: any[]) => any; + export class ProjectHooks extends BaseModel { - public list(projectId: TId, fn?: Function): any; + public list(projectId: TId, fn?: HooksCb): any; public show(projectId: TId, hookId: number, fn?: Function): any; public add(projectId: TId, params: IAddParam | string, fn?: Function): any; - public update(projectId: TId, hookId: number, url: any, fn?: Function): any; + public update(projectId: TId, hookId: number, url: string, fn?: Function): any; public remove(projectId: TId, hookId: number, fn?: Function): any; } diff --git a/types/gitlab/Models/ProjectRepository.d.ts b/types/gitlab/Models/ProjectRepository.d.ts index 85df8bc026..1691db52c0 100644 --- a/types/gitlab/Models/ProjectRepository.d.ts +++ b/types/gitlab/Models/ProjectRepository.d.ts @@ -1,12 +1,20 @@ import { BaseModel, TId } from '../BaseModel.d'; -interface IShowFileParam { +interface IShowFileParams { file_path: string; ref?: any; file_id?: any; [key: string]: any; } +interface IAddTagParams { + id: TId; + tag_name: string; + ref: string; + message?: string; + release_description?: string; +} + export class ProjectRepository extends BaseModel { public listBranches(projectId: TId, fn?: Function): any; public showBranch(projectId: TId, branchId: string, fn?: Function): any; @@ -14,7 +22,7 @@ export class ProjectRepository extends BaseModel { public unprotectBranch(projectId: TId, branchId: string, fn?: Function): any; public createBranch(params: object, fn?: Function): any; public deleteBranch(projectId: TId, branchId: string, fn?: Function): any; - public addTag(params: object, fn?: Function): any; + public addTag(params: IAddTagParams, fn?: Function): any; public deleteTag(projectId: TId, tagName: string, fn?: Function): any; public showTag(projectId: TId, tagName: string, fn?: Function): any; public listTags(projectId: TId, fn?: Function): any; @@ -24,7 +32,7 @@ export class ProjectRepository extends BaseModel { public listTree(projectId: TId, fn?: Function): any; public listTree(projectId: TId, params?: object, fn?: Function): any; public showFile(projectId: TId, fn?: Function): any; - public showFile(projectId: TId, params?: IShowFileParam, fn?: Function): any; + public showFile(projectId: TId, params?: IShowFileParams, fn?: Function): any; public createFile(params?: object, fn?: Function): any; public updateFile(params?: object, fn?: Function): any; public compare(params?: object, fn?: Function): any; From 3e4f0f814a259f232437be6b096c7d48da68b072 Mon Sep 17 00:00:00 2001 From: Arylo Date: Thu, 5 Apr 2018 00:49:04 +0800 Subject: [PATCH 0440/2153] Fix Test Fail --- types/gitlab/ApiBase.d.ts | 38 ++++---- types/gitlab/ApiBaseHTTP.d.ts | 18 ++-- types/gitlab/ApiV3.d.ts | 2 +- types/gitlab/BaseModel.d.ts | 16 ++-- types/gitlab/Models/Groups.d.ts | 30 +++--- types/gitlab/Models/IssueNotes.d.ts | 6 +- types/gitlab/Models/Issues.d.ts | 18 ++-- types/gitlab/Models/Labels.d.ts | 4 +- types/gitlab/Models/Notes.d.ts | 4 +- types/gitlab/Models/Pipelines.d.ts | 4 +- types/gitlab/Models/ProjectBuilds.d.ts | 10 +- types/gitlab/Models/ProjectDeployKeys.d.ts | 8 +- types/gitlab/Models/ProjectHooks.d.ts | 12 +-- types/gitlab/Models/ProjectIssues.d.ts | 10 +- types/gitlab/Models/ProjectLabels.d.ts | 6 +- types/gitlab/Models/ProjectMembers.d.ts | 12 +-- types/gitlab/Models/ProjectMergeRequests.d.ts | 16 ++-- types/gitlab/Models/ProjectMilestones.d.ts | 12 +-- types/gitlab/Models/ProjectRepository.d.ts | 46 ++++----- types/gitlab/Models/ProjectServices.d.ts | 8 +- types/gitlab/Models/Projects.d.ts | 94 +++++++++---------- types/gitlab/Models/Runners.d.ts | 16 ++-- types/gitlab/Models/UserKeys.d.ts | 6 +- types/gitlab/Models/Users.d.ts | 20 ++-- types/gitlab/index.d.ts | 7 +- 25 files changed, 212 insertions(+), 211 deletions(-) diff --git a/types/gitlab/ApiBase.d.ts b/types/gitlab/ApiBase.d.ts index d57795c141..7187ce4352 100644 --- a/types/gitlab/ApiBase.d.ts +++ b/types/gitlab/ApiBase.d.ts @@ -1,12 +1,12 @@ -import { IApiBase } from './ApiBase.d'; -import { Labels } from './Models/Labels.d'; -import { Users } from './Models/Users.d'; -import { Notes } from './Models/Notes.d'; -import { Issues } from './Models/Issues.d'; -import { Projects } from './Models/Projects.d'; -import { Groups } from './Models/Groups.d'; +import { ApiBaseOptions } from './ApiBase'; +import { Labels } from './Models/Labels'; +import { Users } from './Models/Users'; +import { Notes } from './Models/Notes'; +import { Issues } from './Models/Issues'; +import { Projects } from './Models/Projects'; +import { Groups } from './Models/Groups'; -export interface IApiBase { +export interface ApiBaseOptions { url?: string; token?: string; oauth_token?: string; @@ -16,16 +16,16 @@ export interface IApiBase { } export class ApiBase { - constructor(options: IApiBase); - public readonly client: this; - public readonly groups: Groups - public readonly projects: Projects - public readonly issues: Issues - public readonly notes: Notes - public readonly users: Users - public readonly labels: Labels - public options: IApiBase; + constructor(options: ApiBaseOptions); + readonly client: this; + readonly groups: Groups + readonly projects: Projects + readonly issues: Issues + readonly notes: Notes + readonly users: Users + readonly labels: Labels + options: ApiBaseOptions; - public handleOptions(): void; - public init(): object; + handleOptions(): void; + init(): object; } diff --git a/types/gitlab/ApiBaseHTTP.d.ts b/types/gitlab/ApiBaseHTTP.d.ts index 41ab7a2bca..7ed5fb0d69 100644 --- a/types/gitlab/ApiBaseHTTP.d.ts +++ b/types/gitlab/ApiBaseHTTP.d.ts @@ -1,12 +1,12 @@ -import { ApiBase } from './ApiBase.d'; +import { ApiBase } from './ApiBase'; export class ApiBaseHTTP extends ApiBase { - public prepare_opts(opts: T): T; - public fn_wrapper(fn: Function): Function; - public get(path: string, fn?: Function): any; - public get(path: string, query?: object, fn?: Function): any; - public delete(path: string, fn?: Function): any; - public post(path: string, data?: object, fn?: Function): any; - public put(path: string, data?: object, fn?: Function): any; - public patch(path: string, data?: object, fn?: Function): any; + prepare_opts(opts: T): T; + fn_wrapper(fn: T): T; + get(path: string, fn?: Function): any; + get(path: string, query?: object, fn?: Function): any; + delete(path: string, fn?: Function): any; + post(path: string, data?: object, fn?: Function): any; + put(path: string, data?: object, fn?: Function): any; + patch(path: string, data?: object, fn?: Function): any; } diff --git a/types/gitlab/ApiV3.d.ts b/types/gitlab/ApiV3.d.ts index 17fe81928e..bd3d02557b 100644 --- a/types/gitlab/ApiV3.d.ts +++ b/types/gitlab/ApiV3.d.ts @@ -1,4 +1,4 @@ -import { ApiBaseHTTP } from './ApiBaseHTTP.d'; +import { ApiBaseHTTP } from './ApiBaseHTTP'; export class ApiV3 extends ApiBaseHTTP { diff --git a/types/gitlab/BaseModel.d.ts b/types/gitlab/BaseModel.d.ts index 8f64621ac9..ca6eb4e7c6 100644 --- a/types/gitlab/BaseModel.d.ts +++ b/types/gitlab/BaseModel.d.ts @@ -1,14 +1,14 @@ export class BaseModel { - public load(model: string): object; - public get(path: string, fn?: Function): any; - public get(path: string, query?: object, fn?: Function): any; - public delete(path: string, fn?: Function): any; - public post(path: string, data?: object, fn?: Function): any; - public put(path: string, data?: object, fn?: Function): any; - public patch(path: string, data?: object, fn?: Function): any; + load(model: string): object; + get(path: string, fn?: Function): any; + get(path: string, query?: object, fn?: Function): any; + delete(path: string, fn?: Function): any; + post(path: string, data?: object, fn?: Function): any; + put(path: string, data?: object, fn?: Function): any; + patch(path: string, data?: object, fn?: Function): any; } -export interface IDefParams { +export interface DefParams { page?: number; per_page?: number; [key: string]: any; diff --git a/types/gitlab/Models/Groups.d.ts b/types/gitlab/Models/Groups.d.ts index ed21ecac47..1b528039f0 100644 --- a/types/gitlab/Models/Groups.d.ts +++ b/types/gitlab/Models/Groups.d.ts @@ -1,4 +1,4 @@ -import { BaseModel, IDefParams } from "../BaseModel"; +import { BaseModel, DefParams } from "../BaseModel"; interface IAccessLevels { GUEST: number @@ -9,19 +9,19 @@ interface IAccessLevels { } export class Groups extends BaseModel { - public readonly access_levels: IAccessLevels; + readonly access_levels: IAccessLevels; - public init(): object; - public all(fn?: Function): any; - public all(params?: IDefParams, fn?: Function): any; - public show(groupId: number, fn?: Function): any; - public listProjects(groupId: number, fn?: Function): any; - public listMembers(groupId: number, fn?: Function): any; - public addMember(groupId: number, userId: number, accessLevel: IAccessLevels[keyof IAccessLevels], fn?: Function): any; - public editMember(groupId: number, userId: number, accessLevel: IAccessLevels[keyof IAccessLevels], fn?: Function): any; - public removeMember(groupId: number, userId: number, fn?: Function): any; - public create(params?: object, fn?: Function): any; - public addProject(groupId: number, projectId: number, fn?: Function): any; - public deleteGroup(groupId: number, fn?: Function): any; - public search(nameOrPath: string, fn?: Function): any; + init(): object; + all(fn?: Function): any; + all(params?: DefParams, fn?: Function): any; + show(groupId: number, fn?: Function): any; + listProjects(groupId: number, fn?: Function): any; + listMembers(groupId: number, fn?: Function): any; + addMember(groupId: number, userId: number, accessLevel: IAccessLevels[keyof IAccessLevels], fn?: Function): any; + editMember(groupId: number, userId: number, accessLevel: IAccessLevels[keyof IAccessLevels], fn?: Function): any; + removeMember(groupId: number, userId: number, fn?: Function): any; + create(params?: object, fn?: Function): any; + addProject(groupId: number, projectId: number, fn?: Function): any; + deleteGroup(groupId: number, fn?: Function): any; + search(nameOrPath: string, fn?: Function): any; } diff --git a/types/gitlab/Models/IssueNotes.d.ts b/types/gitlab/Models/IssueNotes.d.ts index a40855f293..de1821b1df 100644 --- a/types/gitlab/Models/IssueNotes.d.ts +++ b/types/gitlab/Models/IssueNotes.d.ts @@ -1,6 +1,6 @@ -import { BaseModel, TId, IDefParams } from '../BaseModel.d'; +import { BaseModel, TId, DefParams } from '../BaseModel'; export class IssueNotes extends BaseModel{ - public all(projectId: TId, issueId: number, fn?: Function): any - public all(projectId: TId, issueId: number, params?: IDefParams, fn?: Function): any + all(projectId: TId, issueId: number, fn?: Function): any + all(projectId: TId, issueId: number, params?: DefParams, fn?: Function): any } diff --git a/types/gitlab/Models/Issues.d.ts b/types/gitlab/Models/Issues.d.ts index a0ca51c6ab..e751b6a002 100644 --- a/types/gitlab/Models/Issues.d.ts +++ b/types/gitlab/Models/Issues.d.ts @@ -1,12 +1,12 @@ -import { BaseModel, TId } from '../BaseModel.d'; +import { BaseModel, TId } from '../BaseModel'; export class Issues extends BaseModel { - public all(fn?: Function): any; - public all(params?: object, fn?: Function): any; - public show(projectId: TId, issueId: TId, fn?: Function): any; - public create(projectId: TId, params?: object, fn?: Function): any; - public edit(projectId: TId, issueId: TId, params?: object, fn?: Function): any; - public remove(projectId: TId, issueId: TId, fn?: Function): any; - public subscribe(projectId: TId, issueId: TId, params?: object, fn?: Function): any; - public unsubscribe(projectId: TId, issueId: TId, fn?: Function): any; + all(fn?: Function): any; + all(params?: object, fn?: Function): any; + show(projectId: TId, issueId: TId, fn?: Function): any; + create(projectId: TId, params?: object, fn?: Function): any; + edit(projectId: TId, issueId: TId, params?: object, fn?: Function): any; + remove(projectId: TId, issueId: TId, fn?: Function): any; + subscribe(projectId: TId, issueId: TId, params?: object, fn?: Function): any; + unsubscribe(projectId: TId, issueId: TId, fn?: Function): any; } diff --git a/types/gitlab/Models/Labels.d.ts b/types/gitlab/Models/Labels.d.ts index c323b0777b..63f1110b4d 100644 --- a/types/gitlab/Models/Labels.d.ts +++ b/types/gitlab/Models/Labels.d.ts @@ -1,5 +1,5 @@ -import { BaseModel, TId } from '../BaseModel.d'; +import { BaseModel, TId } from '../BaseModel'; export class Labels extends BaseModel { - public create(projectId: TId, params?: object, fn?: Function): any; + create(projectId: TId, params?: object, fn?: Function): any; } diff --git a/types/gitlab/Models/Notes.d.ts b/types/gitlab/Models/Notes.d.ts index 50fd1e4da7..95b9cd623e 100644 --- a/types/gitlab/Models/Notes.d.ts +++ b/types/gitlab/Models/Notes.d.ts @@ -1,5 +1,5 @@ -import { BaseModel, TId } from '../BaseModel.d'; +import { BaseModel, TId } from '../BaseModel'; export class Notes extends BaseModel { - public create(projectId: TId, issueId: number, params?: object, fn?: Function): any; + create(projectId: TId, issueId: number, params?: object, fn?: Function): any; } diff --git a/types/gitlab/Models/Pipelines.d.ts b/types/gitlab/Models/Pipelines.d.ts index 8315508214..f65a9e7d25 100644 --- a/types/gitlab/Models/Pipelines.d.ts +++ b/types/gitlab/Models/Pipelines.d.ts @@ -1,5 +1,5 @@ -import { BaseModel, TId } from '../BaseModel.d'; +import { BaseModel, TId } from '../BaseModel'; export class Pipelines extends BaseModel { - public all(projectId: TId, fn?: Function): any; + all(projectId: TId, fn?: Function): any; } diff --git a/types/gitlab/Models/ProjectBuilds.d.ts b/types/gitlab/Models/ProjectBuilds.d.ts index 8714f27b1b..df7c33c32a 100644 --- a/types/gitlab/Models/ProjectBuilds.d.ts +++ b/types/gitlab/Models/ProjectBuilds.d.ts @@ -1,4 +1,4 @@ -import { BaseModel, TId, IDefParams } from '../BaseModel.d'; +import { BaseModel, TId, DefParams } from '../BaseModel'; interface IShowBuildParam { projectId: TId; @@ -6,8 +6,8 @@ interface IShowBuildParam { } export class ProjectBuilds extends BaseModel { - public listBuilds(projectId: TId, fn?: Function): any; - public listBuilds(projectId: TId, params?: IDefParams, fn?: Function): any; - public showBuild(projectId: TId, buildId: string, fn?: Function): any; - public triggerBuild(params?: IShowBuildParam, fn?: Function): any; + listBuilds(projectId: TId, fn?: Function): any; + listBuilds(projectId: TId, params?: DefParams, fn?: Function): any; + showBuild(projectId: TId, buildId: string, fn?: Function): any; + triggerBuild(params?: IShowBuildParam, fn?: Function): any; } diff --git a/types/gitlab/Models/ProjectDeployKeys.d.ts b/types/gitlab/Models/ProjectDeployKeys.d.ts index 8cadac8507..3be9d66bc4 100644 --- a/types/gitlab/Models/ProjectDeployKeys.d.ts +++ b/types/gitlab/Models/ProjectDeployKeys.d.ts @@ -1,7 +1,7 @@ -import { BaseModel, TId } from '../BaseModel.d'; +import { BaseModel, TId } from '../BaseModel'; export class ProjectKeys extends BaseModel { - public listKeys(projectId: TId, fn?: Function): any; - public getKey(projectId: TId, keyId: number, fn?: Function): any; - public addKey(projectId: TId, params?: object, fn?: Function): any; + listKeys(projectId: TId, fn?: Function): any; + getKey(projectId: TId, keyId: number, fn?: Function): any; + addKey(projectId: TId, params?: object, fn?: Function): any; } diff --git a/types/gitlab/Models/ProjectHooks.d.ts b/types/gitlab/Models/ProjectHooks.d.ts index 98d1ebf10a..ce0878eec9 100644 --- a/types/gitlab/Models/ProjectHooks.d.ts +++ b/types/gitlab/Models/ProjectHooks.d.ts @@ -1,4 +1,4 @@ -import { BaseModel, TId } from '../BaseModel.d'; +import { BaseModel, TId } from '../BaseModel'; interface IAddParam { url: string; @@ -8,9 +8,9 @@ interface IAddParam { type HooksCb = (hooks: any[]) => any; export class ProjectHooks extends BaseModel { - public list(projectId: TId, fn?: HooksCb): any; - public show(projectId: TId, hookId: number, fn?: Function): any; - public add(projectId: TId, params: IAddParam | string, fn?: Function): any; - public update(projectId: TId, hookId: number, url: string, fn?: Function): any; - public remove(projectId: TId, hookId: number, fn?: Function): any; + list(projectId: TId, fn?: HooksCb): any; + show(projectId: TId, hookId: number, fn?: Function): any; + add(projectId: TId, params: IAddParam | string, fn?: Function): any; + update(projectId: TId, hookId: number, url: string, fn?: Function): any; + remove(projectId: TId, hookId: number, fn?: Function): any; } diff --git a/types/gitlab/Models/ProjectIssues.d.ts b/types/gitlab/Models/ProjectIssues.d.ts index 95bbc99bed..8f7fc439a6 100644 --- a/types/gitlab/Models/ProjectIssues.d.ts +++ b/types/gitlab/Models/ProjectIssues.d.ts @@ -1,9 +1,9 @@ -import { IssueNotes } from './IssueNotes.d'; -import { BaseModel, TId, IDefParams } from '../BaseModel.d'; +import { IssueNotes } from './IssueNotes'; +import { BaseModel, TId, DefParams } from '../BaseModel'; export class ProjectIssues extends BaseModel { - public readonly notes: IssueNotes; + readonly notes: IssueNotes; - public list(projectId: TId, fn?: Function): any; - public list(projectId: TId, params?: IDefParams, fn?: Function): any; + list(projectId: TId, fn?: Function): any; + list(projectId: TId, params?: DefParams, fn?: Function): any; } diff --git a/types/gitlab/Models/ProjectLabels.d.ts b/types/gitlab/Models/ProjectLabels.d.ts index 7fa178843c..2f6ca1dabc 100644 --- a/types/gitlab/Models/ProjectLabels.d.ts +++ b/types/gitlab/Models/ProjectLabels.d.ts @@ -1,6 +1,6 @@ -import { BaseModel, TId, IDefParams } from '../BaseModel.d'; +import { BaseModel, TId, DefParams } from '../BaseModel'; export class ProjectLabels extends BaseModel { - public all(projectId: TId, fn?: Function): any; - public all(projectId: TId, params?: IDefParams, fn?: Function): any; + all(projectId: TId, fn?: Function): any; + all(projectId: TId, params?: DefParams, fn?: Function): any; } diff --git a/types/gitlab/Models/ProjectMembers.d.ts b/types/gitlab/Models/ProjectMembers.d.ts index baf92668c9..25aa87332a 100644 --- a/types/gitlab/Models/ProjectMembers.d.ts +++ b/types/gitlab/Models/ProjectMembers.d.ts @@ -1,12 +1,12 @@ -import { BaseModel, TId } from '../BaseModel.d'; +import { BaseModel, TId } from '../BaseModel'; type MenberCb = (menber: any) => any; type MenbersCb = (menbers: any[]) => any; export class ProjectMembers extends BaseModel { - public list(projectId: TId, fn?: MenbersCb): any; - public show(projectId: TId, userId: number, fn?: MenberCb): any; - public add(projectId: TId, userId: number, accessLevel: number,fn?: Function): any; - public update(projectId: TId, userId: number, accessLevel: number, fn?: Function): any; - public remove(projectId: TId, userId: number, fn?: Function): any; + list(projectId: TId, fn?: MenbersCb): any; + show(projectId: TId, userId: number, fn?: MenberCb): any; + add(projectId: TId, userId: number, accessLevel: number,fn?: Function): any; + update(projectId: TId, userId: number, accessLevel: number, fn?: Function): any; + remove(projectId: TId, userId: number, fn?: Function): any; } diff --git a/types/gitlab/Models/ProjectMergeRequests.d.ts b/types/gitlab/Models/ProjectMergeRequests.d.ts index b3898bfac4..37b2ab33e6 100644 --- a/types/gitlab/Models/ProjectMergeRequests.d.ts +++ b/types/gitlab/Models/ProjectMergeRequests.d.ts @@ -1,11 +1,11 @@ -import { BaseModel, TId, IDefParams } from '../BaseModel.d'; +import { BaseModel, TId, DefParams } from '../BaseModel'; export class ProjectMergeRequests extends BaseModel { - public list(projectId: TId, fn?: Function): any; - public list(projectId: TId, params?: IDefParams, fn?: Function): any; - public show(projectId: TId, mergerequestId: number, fn?: Function): any; - public add(projectId: TId, sourceBranch: string, targetBranch: string, assigneeId: number, title: string, fn?: Function): any; - public update(projectId: TId, mergerequestId: number, params: object, fn?: Function): any; - public comment(projectId: TId, mergerequestId: number, note: any, fn?: Function): any; - public merge(projectId: TId, mergerequestId: number, params: object, fn?: Function): any; + list(projectId: TId, fn?: Function): any; + list(projectId: TId, params?: DefParams, fn?: Function): any; + show(projectId: TId, mergerequestId: number, fn?: Function): any; + add(projectId: TId, sourceBranch: string, targetBranch: string, assigneeId: number, title: string, fn?: Function): any; + update(projectId: TId, mergerequestId: number, params: object, fn?: Function): any; + comment(projectId: TId, mergerequestId: number, note: any, fn?: Function): any; + merge(projectId: TId, mergerequestId: number, params: object, fn?: Function): any; } diff --git a/types/gitlab/Models/ProjectMilestones.d.ts b/types/gitlab/Models/ProjectMilestones.d.ts index eeccc96fbf..d36d1c016a 100644 --- a/types/gitlab/Models/ProjectMilestones.d.ts +++ b/types/gitlab/Models/ProjectMilestones.d.ts @@ -1,12 +1,12 @@ -import { BaseModel, TId } from '../BaseModel.d'; +import { BaseModel, TId } from '../BaseModel'; type MilestonesCb = (milestones: any[]) => any; type MilestoneCb = (milestones: any) => any; export class ProjectMilestones extends BaseModel { - public list(projectId: TId, fn?: MilestonesCb): any; - public all(projectId: TId, fn?: MilestonesCb): any; - public show(projectId: TId, milestoneId: number, fn?: MilestoneCb): any; - public add(projectId: TId, title: string, description: string, due_date: any, fn?: Function): any; - public update(projectId: TId, milestoneId: number, title: string, description: string, due_date: any, state_event: any, fn?: Function): any; + list(projectId: TId, fn?: MilestonesCb): any; + all(projectId: TId, fn?: MilestonesCb): any; + show(projectId: TId, milestoneId: number, fn?: MilestoneCb): any; + add(projectId: TId, title: string, description: string, due_date: any, fn?: Function): any; + update(projectId: TId, milestoneId: number, title: string, description: string, due_date: any, state_event: any, fn?: Function): any; } diff --git a/types/gitlab/Models/ProjectRepository.d.ts b/types/gitlab/Models/ProjectRepository.d.ts index 1691db52c0..7bef1b6212 100644 --- a/types/gitlab/Models/ProjectRepository.d.ts +++ b/types/gitlab/Models/ProjectRepository.d.ts @@ -1,13 +1,13 @@ -import { BaseModel, TId } from '../BaseModel.d'; +import { BaseModel, TId } from '../BaseModel'; -interface IShowFileParams { +interface ShowFileParams { file_path: string; ref?: any; file_id?: any; [key: string]: any; } -interface IAddTagParams { +interface AddTagParams { id: TId; tag_name: string; ref: string; @@ -16,24 +16,24 @@ interface IAddTagParams { } export class ProjectRepository extends BaseModel { - public listBranches(projectId: TId, fn?: Function): any; - public showBranch(projectId: TId, branchId: string, fn?: Function): any; - public protectBranch(projectId: TId, branchId: string, params: object, fn?: Function): any; - public unprotectBranch(projectId: TId, branchId: string, fn?: Function): any; - public createBranch(params: object, fn?: Function): any; - public deleteBranch(projectId: TId, branchId: string, fn?: Function): any; - public addTag(params: IAddTagParams, fn?: Function): any; - public deleteTag(projectId: TId, tagName: string, fn?: Function): any; - public showTag(projectId: TId, tagName: string, fn?: Function): any; - public listTags(projectId: TId, fn?: Function): any; - public listCommits(projectId: TId, fn?: Function): any; - public showCommit(projectId: TId, sha: string, fn?: Function): any; - public diffCommit(projectId: TId, sha: string, fn?: Function): any; - public listTree(projectId: TId, fn?: Function): any; - public listTree(projectId: TId, params?: object, fn?: Function): any; - public showFile(projectId: TId, fn?: Function): any; - public showFile(projectId: TId, params?: IShowFileParams, fn?: Function): any; - public createFile(params?: object, fn?: Function): any; - public updateFile(params?: object, fn?: Function): any; - public compare(params?: object, fn?: Function): any; + listBranches(projectId: TId, fn?: Function): any; + showBranch(projectId: TId, branchId: string, fn?: Function): any; + protectBranch(projectId: TId, branchId: string, params: object, fn?: Function): any; + unprotectBranch(projectId: TId, branchId: string, fn?: Function): any; + createBranch(params: object, fn?: Function): any; + deleteBranch(projectId: TId, branchId: string, fn?: Function): any; + addTag(params: AddTagParams, fn?: Function): any; + deleteTag(projectId: TId, tagName: string, fn?: Function): any; + showTag(projectId: TId, tagName: string, fn?: Function): any; + listTags(projectId: TId, fn?: Function): any; + listCommits(projectId: TId, fn?: Function): any; + showCommit(projectId: TId, sha: string, fn?: Function): any; + diffCommit(projectId: TId, sha: string, fn?: Function): any; + listTree(projectId: TId, fn?: Function): any; + listTree(projectId: TId, params?: object, fn?: Function): any; + showFile(projectId: TId, fn?: Function): any; + showFile(projectId: TId, params?: ShowFileParams, fn?: Function): any; + createFile(params?: object, fn?: Function): any; + updateFile(params?: object, fn?: Function): any; + compare(params?: object, fn?: Function): any; } diff --git a/types/gitlab/Models/ProjectServices.d.ts b/types/gitlab/Models/ProjectServices.d.ts index c3cbd0aee6..25c59ae400 100644 --- a/types/gitlab/Models/ProjectServices.d.ts +++ b/types/gitlab/Models/ProjectServices.d.ts @@ -1,9 +1,9 @@ -import { BaseModel, TId } from './../BaseModel.d'; +import { BaseModel, TId } from './../BaseModel'; type ServiceCb = (service: any) => any; export class ProjectServices extends BaseModel { - public show(projectId: TId, serviceName: string, fn?: ServiceCb): any; - public update(projectId: TId, serviceName: string, params: object, fn?: ServiceCb): any; - public remove(projectId: TId, serviceName: string, fn?: ServiceCb): any; + show(projectId: TId, serviceName: string, fn?: ServiceCb): any; + update(projectId: TId, serviceName: string, params: object, fn?: ServiceCb): any; + remove(projectId: TId, serviceName: string, fn?: ServiceCb): any; } diff --git a/types/gitlab/Models/Projects.d.ts b/types/gitlab/Models/Projects.d.ts index 9a66318a00..9ba8faa551 100644 --- a/types/gitlab/Models/Projects.d.ts +++ b/types/gitlab/Models/Projects.d.ts @@ -1,55 +1,55 @@ -import { Runners } from './Runners.d'; -import { Pipelines } from './Pipelines.d'; -import { ProjectBuilds } from './ProjectBuilds.d'; -import { ProjectMergeRequests } from './ProjectMergeRequests.d'; -import { ProjectKeys } from './ProjectDeployKeys.d'; -import { ProjectMilestones } from './ProjectMilestones.d'; -import { ProjectRepository } from './ProjectRepository.d'; -import { ProjectLabels } from './ProjectLabels.d'; -import { ProjectIssues } from './ProjectIssues.d'; -import { ProjectHooks } from './ProjectHooks.d'; -import { ProjectMembers } from './ProjectMembers.d'; -import { BaseModel, IDefParams, TId} from '../BaseModel.d'; -import { ProjectServices } from './ProjectServices.d'; +import { Runners } from './Runners'; +import { Pipelines } from './Pipelines'; +import { ProjectBuilds } from './ProjectBuilds'; +import { ProjectMergeRequests } from './ProjectMergeRequests'; +import { ProjectKeys } from './ProjectDeployKeys'; +import { ProjectMilestones } from './ProjectMilestones'; +import { ProjectRepository } from './ProjectRepository'; +import { ProjectLabels } from './ProjectLabels'; +import { ProjectIssues } from './ProjectIssues'; +import { ProjectHooks } from './ProjectHooks'; +import { ProjectMembers } from './ProjectMembers'; +import { BaseModel, DefParams, TId } from '../BaseModel'; +import { ProjectServices } from './ProjectServices'; type ProjectsCb = (projects: any[]) => any; export class Projects extends BaseModel { - public readonly members: ProjectMembers; - public readonly hooks : ProjectHooks; - public readonly issues : ProjectIssues; - public readonly labels : ProjectLabels; - public readonly repository: ProjectRepository; - public readonly milestones: ProjectMilestones; - public readonly deploy_keys: ProjectKeys; - public readonly merge_requests: ProjectMergeRequests; - public readonly services: ProjectServices; - public readonly builds: ProjectBuilds; - public readonly pipelines: Pipelines; - public readonly runners: Runners; + readonly members: ProjectMembers; + readonly hooks: ProjectHooks; + readonly issues: ProjectIssues; + readonly labels: ProjectLabels; + readonly repository: ProjectRepository; + readonly milestones: ProjectMilestones; + readonly deploy_keys: ProjectKeys; + readonly merge_requests: ProjectMergeRequests; + readonly services: ProjectServices; + readonly builds: ProjectBuilds; + readonly pipelines: Pipelines; + readonly runners: Runners; - public all(fn?: ProjectsCb): any; - public all(params?: IDefParams, fn?: ProjectsCb): any; - public allAdmin(fn?: Function): any; - public allAdmin(params?: IDefParams, fn?: Function): any; - public show(projectId: TId, fn?: Function): any; - public create(params: object, fn?: Function): any; - public create_for_user(params: object, fn?: Function): any; - public edit(projectId: TId, params: object, fn?: Function): any; - public addMember(params?: object, fn?: Function): any; - public editMember(params?: object, fn?: Function): any; - public listMembers(params?: object, fn?: Function): any; - public listCommits(params?: object, fn?: Function): any; - public listTags(params?: object, fn?: Function): any; - public remove(projectId: TId, fn?: Function): any; - public fork(params?: object, fn?: Function): any; - public share(params?: object, fn?: Function): any; - public search(projectName: string, fn?: Function): any; - public search(projectName: string, params?: object, fn?: Function): any; - public listTriggers(projectId: TId, fn?: Function): any; - public showTrigger(projectId: TId, token: string, fn?: Function): any; - public createTrigger(params?: object, fn?: Function): any; - public removeTrigger(projectId: TId, token: string, fn?: Function): any; + all(fn?: ProjectsCb): any; + all(params?: DefParams, fn?: ProjectsCb): any; + allAdmin(fn?: Function): any; + allAdmin(params?: DefParams, fn?: Function): any; + show(projectId: TId, fn?: Function): any; + create(params: object, fn?: Function): any; + create_for_user(params: object, fn?: Function): any; + edit(projectId: TId, params: object, fn?: Function): any; + addMember(params?: object, fn?: Function): any; + editMember(params?: object, fn?: Function): any; + listMembers(params?: object, fn?: Function): any; + listCommits(params?: object, fn?: Function): any; + listTags(params?: object, fn?: Function): any; + remove(projectId: TId, fn?: Function): any; + fork(params?: object, fn?: Function): any; + share(params?: object, fn?: Function): any; + search(projectName: string, fn?: Function): any; + search(projectName: string, params?: object, fn?: Function): any; + listTriggers(projectId: TId, fn?: Function): any; + showTrigger(projectId: TId, token: string, fn?: Function): any; + createTrigger(params?: object, fn?: Function): any; + removeTrigger(projectId: TId, token: string, fn?: Function): any; } diff --git a/types/gitlab/Models/Runners.d.ts b/types/gitlab/Models/Runners.d.ts index c166a44ff1..1656fe0c5d 100644 --- a/types/gitlab/Models/Runners.d.ts +++ b/types/gitlab/Models/Runners.d.ts @@ -1,11 +1,11 @@ -import { BaseModel, IDefParams, TId} from '../BaseModel.d'; +import { BaseModel, DefParams, TId } from '../BaseModel'; export class Runners extends BaseModel { - public all(projectId?: TId, fn?: Function): any; - public all(projectId?: TId, params?: object, fn?: Function): any; - public show(runnerId: number, fn?: Function): any; - public update(runnerId: number, attributes: any, fn?: Function): any; - public remove(runnerId: number, projectId: any, enable: any, fn?: Function): any; - public enable(projectId: TId, runnerId: number, fn?: Function): any; - public disable(projectId: TId, runnerId: number, fn?: Function): any; + all(projectId?: TId, fn?: Function): any; + all(projectId?: TId, params?: object, fn?: Function): any; + show(runnerId: number, fn?: Function): any; + update(runnerId: number, attributes: any, fn?: Function): any; + remove(runnerId: number, projectId: any, enable: any, fn?: Function): any; + enable(projectId: TId, runnerId: number, fn?: Function): any; + disable(projectId: TId, runnerId: number, fn?: Function): any; } diff --git a/types/gitlab/Models/UserKeys.d.ts b/types/gitlab/Models/UserKeys.d.ts index cf6b3d71a0..5182b5a2d1 100644 --- a/types/gitlab/Models/UserKeys.d.ts +++ b/types/gitlab/Models/UserKeys.d.ts @@ -1,6 +1,6 @@ -import { BaseModel, IDefParams, TId } from '../BaseModel.d'; +import { BaseModel, DefParams, TId } from '../BaseModel'; export class UserKeys extends BaseModel { - public all(userId?: TId, fn?: Function): any; - public addKey(userId: string, title: string, key: any, fn?: Function): any; + all(userId?: TId, fn?: Function): any; + addKey(userId: string, title: string, key: any, fn?: Function): any; } diff --git a/types/gitlab/Models/Users.d.ts b/types/gitlab/Models/Users.d.ts index fc946d8237..e4572ac659 100644 --- a/types/gitlab/Models/Users.d.ts +++ b/types/gitlab/Models/Users.d.ts @@ -1,17 +1,17 @@ -import { BaseModel, IDefParams, TId} from '../BaseModel.d'; -import { UserKeys } from './UserKeys.d'; +import { BaseModel, DefParams, TId } from '../BaseModel'; +import { UserKeys } from './UserKeys'; type UsersCb = (users: any[]) => any; type UserCb = (user: any) => any; export class Users extends BaseModel { - public readonly keys: UserKeys; + readonly keys: UserKeys; - public all(fn?: UsersCb): any; - public all(params?: IDefParams, fn?: UsersCb): any; - public current(fn?: Function): any; - public show(userId: number, fn?: UserCb): any; - public create(params?: IDefParams, fn?: Function): any; - public session(email: string, password: string, fn?: Function): any; - public search(emailOrUsername: string, fn?: Function): any; + all(fn?: UsersCb): any; + all(params?: DefParams, fn?: UsersCb): any; + current(fn?: Function): any; + show(userId: number, fn?: UserCb): any; + create(params?: DefParams, fn?: Function): any; + session(email: string, password: string, fn?: Function): any; + search(emailOrUsername: string, fn?: Function): any; } diff --git a/types/gitlab/index.d.ts b/types/gitlab/index.d.ts index d0f1f5806a..1ff52505ee 100644 --- a/types/gitlab/index.d.ts +++ b/types/gitlab/index.d.ts @@ -3,14 +3,15 @@ // Definitions by: sam // AryloYeung // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 import { ApiV3 } from "./ApiV3"; -import { IApiBase } from "./ApiBase"; +import { ApiBaseOptions } from "./ApiBase"; declare namespace Gitlib { - const ApiV3: new(options: IApiBase) => ApiV3; + const ApiV3: new(options: ApiBaseOptions) => ApiV3; } -declare function Gitlib(options: IApiBase): ApiV3; +declare function Gitlib(options: ApiBaseOptions): ApiV3; export = Gitlib; From 782717d6fea6eaa3ac9567b121886f0f06959866 Mon Sep 17 00:00:00 2001 From: Kristofer Sommestad Date: Wed, 4 Apr 2018 21:51:54 +0200 Subject: [PATCH 0441/2153] chore(sinon): define `SinonFakeTimersConfig` interface Also remove redundant no-arg declaration. --- types/sinon/index.d.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/types/sinon/index.d.ts b/types/sinon/index.d.ts index 24c809a71f..08976adaec 100644 --- a/types/sinon/index.d.ts +++ b/types/sinon/index.d.ts @@ -232,10 +232,15 @@ declare namespace Sinon { setSystemTime(date: Date): void; } + interface SinonFakeTimersConfig { + now: number | Date; + toFake: string[]; + shouldAdvanceTime: boolean; + } + interface SinonFakeTimersStatic { - (): SinonFakeTimers; (now?: number | Date): SinonFakeTimers; - (config: { now?: number | Date, toFake?: string[], shouldAdvanceTime?: boolean }): SinonFakeTimers; + (config?: Partial): SinonFakeTimers; } interface SinonStatic { From 919977b30481dcda7ef008416f56978f7017fb69 Mon Sep 17 00:00:00 2001 From: Shenghan Gao Date: Mon, 2 Oct 2017 18:27:21 -0700 Subject: [PATCH 0442/2153] update Model.insertMany function signature according to doc reference: http://mongoosejs.com/docs/api.html#insertmany_insertMany --- types/mongoose/index.d.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 50496fc9da..4cd32a0126 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mongoose 5.0.1 +// Type definitions for Mongoose 5.0.12 // Project: http://mongoosejs.com/ // Definitions by: horiuchi // sindrenm @@ -2608,10 +2608,18 @@ declare module "mongoose" { * because it only sends one operation to the server, rather than one for each * document. * This function does not trigger save middleware. + * @param docs Documents to insert. + * @param options Optional settings. + * @param options.ordered if true, will fail fast on the first error encountered. + * If false, will insert all the documents it can and report errors later. + * @param options.rawResult if false, the returned promise resolves to the documents that passed mongoose document validation. + * If `false`, will return the [raw result from the MongoDB driver](http://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#~insertWriteOpCallback) + * with a `mongoose` property that contains `validationErrors` if this is an unordered `insertMany`. */ insertMany(docs: any[], callback?: (error: any, docs: T[]) => void): Promise; + insertMany(docs: any[], options?: { ordered?: boolean, rawResult?: boolean }, callback?: (error: any, docs: T[]) => void): Promise; insertMany(doc: any, callback?: (error: any, doc: T) => void): Promise; - insertMany(...docsWithCallback: any[]): Promise; + insertMany(doc: any, options?: { rdered?: boolean, rawResult?: boolean }, callback?: (error: any, doc: T) => void): Promise; /** * Executes a mapReduce command. From d252ffa70db894b5c377a611f3761cdd82945c34 Mon Sep 17 00:00:00 2001 From: Joshua Goldberg Date: Wed, 4 Apr 2018 16:23:27 -0700 Subject: [PATCH 0443/2153] Added types for jest-environment-puppeteer --- types/jest-environment-puppeteer/index.d.ts | 13 +++++++++++ .../jest-environment-puppeteer-tests.ts | 4 ++++ .../jest-environment-puppeteer/tsconfig.json | 23 +++++++++++++++++++ types/jest-environment-puppeteer/tslint.json | 1 + 4 files changed, 41 insertions(+) create mode 100644 types/jest-environment-puppeteer/index.d.ts create mode 100644 types/jest-environment-puppeteer/jest-environment-puppeteer-tests.ts create mode 100644 types/jest-environment-puppeteer/tsconfig.json create mode 100644 types/jest-environment-puppeteer/tslint.json diff --git a/types/jest-environment-puppeteer/index.d.ts b/types/jest-environment-puppeteer/index.d.ts new file mode 100644 index 0000000000..88956e1869 --- /dev/null +++ b/types/jest-environment-puppeteer/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for jest-environment-puppeteer 2.2 +// Project: https://github.com/smooth-code/jest-puppeteer +// Definitions by: Josh Goldberg +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Browser, Page } from "puppeteer"; + +declare global { + const browser: Browser; + const page: Page; +} + +export { }; diff --git a/types/jest-environment-puppeteer/jest-environment-puppeteer-tests.ts b/types/jest-environment-puppeteer/jest-environment-puppeteer-tests.ts new file mode 100644 index 0000000000..3de8c3661a --- /dev/null +++ b/types/jest-environment-puppeteer/jest-environment-puppeteer-tests.ts @@ -0,0 +1,4 @@ +import * as puppeteer from "puppeteer"; + +const myBrowser: puppeteer.Browser = browser; +const myPage: puppeteer.Page = page; diff --git a/types/jest-environment-puppeteer/tsconfig.json b/types/jest-environment-puppeteer/tsconfig.json new file mode 100644 index 0000000000..ed53d60edd --- /dev/null +++ b/types/jest-environment-puppeteer/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jest-environment-puppeteer-tests.ts" + ] +} diff --git a/types/jest-environment-puppeteer/tslint.json b/types/jest-environment-puppeteer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jest-environment-puppeteer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From fa290f099e7c33992aefcadbc5bc541ac7f4c064 Mon Sep 17 00:00:00 2001 From: Joshua Goldberg Date: Wed, 4 Apr 2018 17:48:24 -0700 Subject: [PATCH 0444/2153] Added expect-puppeteer types --- .../expect-puppeteer-tests.ts | 0 types/expect-puppeteer/index.d.ts | 54 +++++++++++++++++++ types/expect-puppeteer/tsconfig.json | 22 ++++++++ types/expect-puppeteer/tslint.json | 1 + 4 files changed, 77 insertions(+) create mode 100644 types/expect-puppeteer/expect-puppeteer-tests.ts create mode 100644 types/expect-puppeteer/index.d.ts create mode 100644 types/expect-puppeteer/tsconfig.json create mode 100644 types/expect-puppeteer/tslint.json diff --git a/types/expect-puppeteer/expect-puppeteer-tests.ts b/types/expect-puppeteer/expect-puppeteer-tests.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/expect-puppeteer/index.d.ts b/types/expect-puppeteer/index.d.ts new file mode 100644 index 0000000000..5c96c4cbdf --- /dev/null +++ b/types/expect-puppeteer/index.d.ts @@ -0,0 +1,54 @@ +// Type definitions for expect-puppeteer 2.2 +// Project: https://github.com/smooth-code/jest-puppeteer +// Definitions by: Josh Goldberg +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +import { ElementHandle, Page } from "puppeteer"; + +/** + * Interval at which pageFunctions may be executed. + */ +type ExpectPolling = number | "mutation" | "raf"; + +/** + * Configures how to poll for an element. + */ +interface ExpectTimingActions { + /** + * An interval at which the pageFunction is executed. Defaults to "raf". + */ + polling?: ExpectPolling; + + /** + * Maximum time to wait for in milliseconds. Defaults to 500. + */ + timeout?: number; +} + +interface ExpectToClickOptions extends ExpectTimingActions { + /** + * A text or a RegExp to match in element textContent. + */ + text?: string | RegExp; +} + +interface ExpectPuppeteer { + toClick(selector: string, options?: ExpectToClickOptions): Promise; + toDisplayDialog(block: () => Promise): Promise; + toFill(selector: string, value: string, options?: ExpectTimingActions): Promise; + toMatch(value: string, options?: ExpectTimingActions): Promise; + toMatchElement(selector: string, value: string, options?: ExpectTimingActions): Promise; + toSelect(selector: string, valueOrText: string, options?: ExpectTimingActions): Promise; + toUploadFile(selector: string, filePath: string, options?: ExpectTimingActions): Promise; +} + +declare global { + namespace jest { + interface Matchers extends ExpectPuppeteer { } + } +} + +export function expectPuppeteer(instance: ElementHandle | Page): ExpectPuppeteer; diff --git a/types/expect-puppeteer/tsconfig.json b/types/expect-puppeteer/tsconfig.json new file mode 100644 index 0000000000..4f88a5ccb3 --- /dev/null +++ b/types/expect-puppeteer/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "expect-puppeteer-tests.ts" + ] +} diff --git a/types/expect-puppeteer/tslint.json b/types/expect-puppeteer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/expect-puppeteer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From d7b5a4865e11f89b5119287119cf8f4e3f6a8f62 Mon Sep 17 00:00:00 2001 From: Joshua Goldberg Date: Wed, 4 Apr 2018 17:51:36 -0700 Subject: [PATCH 0445/2153] Added missing TS version --- types/jest-environment-puppeteer/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/jest-environment-puppeteer/index.d.ts b/types/jest-environment-puppeteer/index.d.ts index 88956e1869..abb0ad02d1 100644 --- a/types/jest-environment-puppeteer/index.d.ts +++ b/types/jest-environment-puppeteer/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/smooth-code/jest-puppeteer // Definitions by: Josh Goldberg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import { Browser, Page } from "puppeteer"; From ae30d384fb5308ba2c0ed4a5fb1878363a9dd8fc Mon Sep 17 00:00:00 2001 From: Joshua Goldberg Date: Wed, 4 Apr 2018 17:54:15 -0700 Subject: [PATCH 0446/2153] Added missing strictFunctionTypes --- types/expect-puppeteer/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/types/expect-puppeteer/tsconfig.json b/types/expect-puppeteer/tsconfig.json index 4f88a5ccb3..7ca516e3c2 100644 --- a/types/expect-puppeteer/tsconfig.json +++ b/types/expect-puppeteer/tsconfig.json @@ -6,6 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, + "strictFunctionTypes": true, "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ From c64839177085c7d9a46f288a53047621c0c33877 Mon Sep 17 00:00:00 2001 From: Joshua Goldberg Date: Wed, 4 Apr 2018 18:18:47 -0700 Subject: [PATCH 0447/2153] Added tests; fixed lint issues --- .../expect-puppeteer-tests.ts | 29 +++++++++++++++++++ types/expect-puppeteer/index.d.ts | 4 +-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/types/expect-puppeteer/expect-puppeteer-tests.ts b/types/expect-puppeteer/expect-puppeteer-tests.ts index e69de29bb2..979c34394d 100644 --- a/types/expect-puppeteer/expect-puppeteer-tests.ts +++ b/types/expect-puppeteer/expect-puppeteer-tests.ts @@ -0,0 +1,29 @@ +import { ElementHandle, Page } from "puppeteer"; + +const testGlobal = async (instance: ElementHandle | Page) => { + await expect(instance).toClick("selector"); + await expect(instance).toClick("selector", { polling: "mutation", text: "text" }); + await expect(instance).toClick("selector", { polling: "raf", timeout: 777 }); + + await expect(instance).toDisplayDialog(async () => {}); + + await expect(instance).toFill("selector", "value"); + await expect(instance).toFill("selector", "value", { polling: 777 }); + + await expect(instance).toMatchElement("selector", "value"); + await expect(instance).toMatchElement("selector", "value", { polling: "mutation" }); + + await expect(instance).toSelect("selector", "valueOrText"); + await expect(instance).toSelect("selector", "valueOrText", { polling: "raf" }); + + await expect(instance).toUploadFile("selector", "filePath"); + await expect(instance).toUploadFile("selector", "filePath", { timeout: 777 }); +}; + +const testImported = async (instance: ElementHandle | Page) => { + const expectPuppeteer = await import("expect-puppeteer"); + + await expectPuppeteer(instance).toClick("selector"); + await expect(instance).toClick("selector", { polling: "mutation", text: "text" }); + await expect(instance).toClick("selector", { polling: "raf", timeout: 777 }); +}; diff --git a/types/expect-puppeteer/index.d.ts b/types/expect-puppeteer/index.d.ts index 5c96c4cbdf..ed89a0f709 100644 --- a/types/expect-puppeteer/index.d.ts +++ b/types/expect-puppeteer/index.d.ts @@ -39,7 +39,6 @@ interface ExpectPuppeteer { toClick(selector: string, options?: ExpectToClickOptions): Promise; toDisplayDialog(block: () => Promise): Promise; toFill(selector: string, value: string, options?: ExpectTimingActions): Promise; - toMatch(value: string, options?: ExpectTimingActions): Promise; toMatchElement(selector: string, value: string, options?: ExpectTimingActions): Promise; toSelect(selector: string, valueOrText: string, options?: ExpectTimingActions): Promise; toUploadFile(selector: string, filePath: string, options?: ExpectTimingActions): Promise; @@ -51,4 +50,5 @@ declare global { } } -export function expectPuppeteer(instance: ElementHandle | Page): ExpectPuppeteer; +declare function expectPuppeteer(instance: ElementHandle | Page): ExpectPuppeteer; +export = expectPuppeteer; From 9616735d8e58e5f5be71b539d0602599d575a2d0 Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Wed, 4 Apr 2018 21:21:55 -0400 Subject: [PATCH 0448/2153] Overhaul typings per feedback This gets rid of the need to turn off the noImplicitAny check for the plupload typings. I've attempted to fix some remaining issues that the existing tests had after "correcting" all of this. @paulvanbrenk @patrickbussmann --- types/plupload/index.d.ts | 199 ++++++++++++++++++------------- types/plupload/plupload-tests.ts | 1 - types/plupload/tsconfig.json | 2 +- 3 files changed, 118 insertions(+), 84 deletions(-) diff --git a/types/plupload/index.d.ts b/types/plupload/index.d.ts index 00dd6c7d0b..c83fd77740 100644 --- a/types/plupload/index.d.ts +++ b/types/plupload/index.d.ts @@ -73,31 +73,31 @@ interface plupload_queue_progress { } interface plupload_event { - (uploader: plupload): any; + (uploader: plupload.Uploader): any; } interface plupload_event_file { - (uploader: plupload, file: any): any; + (uploader: plupload.Uploader, file: any): any; } interface plupload_event_files { - (uploader: plupload, files: any[]): any; + (uploader: plupload.Uploader, files: any[]): any; } interface plupload_event_OptionChanged { - (uploader: plupload, name: string, value: any, oldValue: any): any; + (uploader: plupload.Uploader, name: string, value: any, oldValue: any): any; } interface plupload_event_FileUploaded { - (uploader: plupload, file: any, response: plupload_response): any; + (uploader: plupload.Uploader, file: any, response: plupload_response): any; } interface plupload_event_ChunkUploaded { - (uploader: plupload, file: any, response: plupload_chunk_response): any; + (uploader: plupload.Uploader, file: any, response: plupload_chunk_response): any; } interface plupload_event_Error { - (uploader: plupload, error: plupload_error): any; + (uploader: plupload.Uploader, error: plupload_error): any; } interface plupload_events { @@ -137,63 +137,98 @@ interface plupload_error extends plupload_response { file: any; } -declare class plupload { - static Uploader(settings: plupload_settings): void; +declare namespace plupload { - static VERSION: string; + class Uploader { - static STOPPED: number; - static STARTED: number; - static QUEUED: number; - static UPLOADING: number; - static FAILED: number; - static DONE: number; - static GENERIC_ERROR: number; - static HTTP_ERROR: number; - static IO_ERROR: number; - static SECURITY_ERROR: number; - static INIT_ERROR: number; - static FILE_SIZE_ERROR: number; - static FILE_EXTENSION_ERROR: number; - static FILE_DUPLICATE_ERROR: number; - static IMAGE_FORMAT_ERROR: number; - static MEMORY_ERROR: number; - static IMAGE_DIMENSIONS_ERROR: number; + constructor(settings: plupload_settings); - static mimeTypes: any; - static ua: any; + /** Properties */ + id: string; + state: number; + features: string; + runtime: string; + files: any; + settings: any; + total: plupload_queue_progress; - static typeOf(o: any): string; - static extend(target: any): any; - static guid(guid: string): string; + /** Methods */ + init(): any; + setOption(option: string | any, value?: any): any; + getOption(option?: string): any; + refresh(): any; + start(): any; + stop(): any; + disableBrowse(disable: boolean): any; + getFile(id: string): any; + addFile(file: any, fileName?: string): any; + removeFile(file: any): any; + splice(start?: number, length?: number): any; + trigger(name: string, Multiple: any): any; + hasEventListener(name: string): any; + bind(name: string, func: any, scope?: any): any; + unbind(name: string, func: any): any; + unbindAll(): any; + destroy(): any; + } - /** Properties */ - id: string; - state: number; - features: string; - runtime: string; - files: any; - settings: any; - total: plupload_queue_progress; + export const VERSION: string; - /** Methods */ - init(): any; - setOption(option: string | any, value?: any): any; - getOption(option?: string): any; - refresh(): any; - start(): any; - stop(): any; - disableBrowse(disable: boolean): any; - getFile(id: string): any; - addFile(file: any, fileName?: string): any; - removeFile(file: any): any; - splice(start?: number, length?: number): any; - trigger(name: string, Multiple: any): any; - hasEventListener(name: string): any; - bind(name: string, func: any, scope: any): any; - unbind(name: string, func: any): any; - unbindAll(): any; - destroy(): any; + export const STOPPED: number; + export const STARTED: number; + export const QUEUED: number; + export const UPLOADING: number; + export const FAILED: number; + export const DONE: number; + export const GENERIC_ERROR: number; + export const HTTP_ERROR: number; + export const IO_ERROR: number; + export const SECURITY_ERROR: number; + export const INIT_ERROR: number; + export const FILE_SIZE_ERROR: number; + export const FILE_EXTENSION_ERROR: number; + export const FILE_DUPLICATE_ERROR: number; + export const IMAGE_FORMAT_ERROR: number; + export const MEMORY_ERROR: number; + export const IMAGE_DIMENSIONS_ERROR: number; + + export const mimeTypes: any; + export const ua: any; + + /** + * Gets the true type of the built-in object (better version of typeof). + * @credits Angus Croll (http://javascriptweblog.wordpress.com/) + * + * @method typeOf + * @static + * @param {Object} o Object to check. + * @return {String} Object [[Class]] + */ + function typeOf(o: any): string; + + /** + * Extends the specified object with another object. + * + * @method extend + * @static + * @param {Object} target Object to extend. + * @param {Object..} obj Multiple objects to extend with. + * @return {Object} Same as target, the extended object. + */ + function extend(target: any): any; + + /** + * Generates an unique ID. This is 99.99% unique since it takes the current time and 5 random numbers. + * The only way a user would be able to get the same ID is if the two persons at the same exact millisecond manages + * to get 5 the same random numbers between 0-65535 it also uses a counter so each call will be guaranteed to be page unique. + * It's more probable for the earth to be hit with an asteriod. You can also if you want to be 100% sure set the plupload.guidPrefix property + * to an user unique key. + * + * @method guid + * @static + * @return {String} Virtually unique id. + */ + function guid(guid: string): string; /** Utility methods **/ @@ -206,7 +241,7 @@ declare class plupload { * @param {Object} obj Object to iterate. * @param {function} callback Callback function to execute for each item. */ - static each(obj: any, callback: Function): void; + function each(obj: any, callback: Function): void; /** * Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields. @@ -217,7 +252,7 @@ declare class plupload { * @param {Element} root Optional root element to stop calculations at. * @return {object} Absolute position of the specified element object with x, y fields. */ - static getPos(node: Element, root: Element): any; + function getPos(node: Element, root: Element): any; /** * Returns the size of the specified node in pixels. @@ -227,7 +262,7 @@ declare class plupload { * @param {Node} node Node to get the size of. * @return {Object} Object with a w and h property. */ - static getSize(node: Node): any; + function getSize(node: Node): any; /** * Encodes the specified string. @@ -237,7 +272,7 @@ declare class plupload { * @param {String} s String to encode. * @return {String} Encoded string. */ - static xmlEncode(str: string): string; + function xmlEncode(str: string): string; /** * Forces anything into an array. @@ -247,7 +282,7 @@ declare class plupload { * @param {Object} obj Object with length field. * @return {Array} Array object containing all items. */ - static toArray(obj: any): Array; + function toArray(obj: any): Array; /** * Find an element in array and return its index if present, otherwise return -1. @@ -258,7 +293,7 @@ declare class plupload { * @param {Array} array * @return {Int} Index of the element, or -1 if not found */ - static inArray(needle: any, array: Array): number; + function inArray(needle: any, array: Array): number; /** Recieve an array of functions (usually async) to call in sequence, each function @@ -271,7 +306,7 @@ declare class plupload { @param {Array} queue Array of functions to call in sequence @param {Function} cb Main callback that is called in the end, or in case of error */ - static inSeries(queue: Array, callback: Function): void; + function inSeries(queue: Array, callback: Function): void; /** * Extends the language pack object with new items. @@ -281,7 +316,7 @@ declare class plupload { * @param {Object} pack Language pack items to add. * @return {Object} Extended language pack object. */ - static addI18n(pack: any): any; + function addI18n(pack: any): any; /** * Translates the specified string by checking for the english string in the language pack lookup. @@ -291,7 +326,7 @@ declare class plupload { * @param {String} str String to look for. * @return {String} Translated string or the input string if it wasn't found. */ - static translate(str: string): string; + function translate(str: string): string; /** * Pseudo sprintf implementation - simple way to replace tokens with specified values. @@ -299,7 +334,7 @@ declare class plupload { * @param {String} str String with tokens * @return {String} String with replaced tokens */ - static sprintf(str: string): string; + function sprintf(str: string): string; /** * Checks if object is empty. @@ -309,7 +344,7 @@ declare class plupload { * @param {Object} obj Object to check. * @return {Boolean} */ - static isEmptyObj(obj: any): boolean; + function isEmptyObj(obj: any): boolean; /** * Checks if specified DOM element has specified class. @@ -319,7 +354,7 @@ declare class plupload { * @param {Object} obj DOM element like object to add handler to. * @param {String} name Class name */ - static hasClass(obj: any, name: string): any; + function hasClass(obj: any, name: string): any; /** * Adds specified className to specified DOM element. @@ -329,7 +364,7 @@ declare class plupload { * @param {Object} obj DOM element like object to add handler to. * @param {String} name Class name */ - static addClass(obj: any, name: string): any; + function addClass(obj: any, name: string): any; /** * Removes specified className from specified DOM element. @@ -339,7 +374,7 @@ declare class plupload { * @param {Object} obj DOM element like object to add handler to. * @param {String} name Class name */ - static removeClass(obj: any, name: string): any; + function removeClass(obj: any, name: string): any; /** * Returns a given computed style of a DOM element. @@ -349,7 +384,7 @@ declare class plupload { * @param {Object} obj DOM element like object. * @param {String} name Style you want to get from the DOM element */ - static getStyle(obj: any, name: string): any; + function getStyle(obj: any, name: string): any; /** * Adds an event handler to the specified object and store reference to the handler @@ -362,7 +397,7 @@ declare class plupload { * @param {Function} callback Function to call when event occurs. * @param {String} (optional) key that might be used to add specifity to the event record. */ - static addEvent(obj: any, name: string, callback: Function, key?: string); + function addEvent(obj: any, name: string, callback: Function, key?: string): any; /** * Remove event handler from the specified object. If third argument (callback) @@ -374,7 +409,7 @@ declare class plupload { * @param {String} name Name of event listener to remove. * @param {Function|String} (optional) might be a callback or unique key to match. */ - static removeEvent(obj: any, name: string, optional?: Function | string); + function removeEvent(obj: any, name: string, optional?: Function | string): any; /** * Remove all kind of events from the specified object @@ -384,7 +419,7 @@ declare class plupload { * @param {Object} obj DOM element to remove event listeners from. * @param {String} (optional) unique key to match, when removing events. */ - static removeAllEvents(obj: any, key?: string); + function removeAllEvents(obj: any, key?: string): any; /** * Cleans the specified name from national characters (diacritics). The result will be a name with only a-z, 0-9 and _. @@ -394,7 +429,7 @@ declare class plupload { * @param {String} s String to clean up. * @return {String} Cleaned string. */ - static cleanName(name: string): string; + function cleanName(name: string): string; /** * Builds a full url out of a base URL and an object with items to append as query string items. @@ -405,7 +440,7 @@ declare class plupload { * @param {Object} items Name/value object to serialize as a querystring. * @return {String} String with url + serialized query string items. */ - static buildUrl(url, items): string; + function buildUrl(url: string, items: any): string; /** * Formats the specified number as a size string for example 1024 becomes 1 KB. @@ -415,7 +450,7 @@ declare class plupload { * @param {Number} size Size to format as string. * @return {String} Formatted size string. */ - static formatSize(size: number): string; + function formatSize(size: number): string; /** * Parses the specified size string into a byte value. For example 10kb becomes 10240. @@ -425,7 +460,7 @@ declare class plupload { * @param {String|Number} size String to parse or number to just pass through. * @return {Number} Size in bytes. */ - static parseSize(size: number | string): number; + function parseSize(size: number | string): number; /** @@ -438,7 +473,7 @@ declare class plupload { * @param {String} [runtimes] Comma-separated list of runtimes to check against * @return {String} Type of compatible runtime */ - static predictRuntime(config: any, runtimes: string): string; + function predictRuntime(config: any, runtimes: string): string; /** * Registers a filter that will be executed for each file added to the queue. @@ -452,5 +487,5 @@ declare class plupload { * @param {String} name Name of the filter by which it can be referenced in settings.filters * @param {String} cb Callback - the actual routine that every added file must pass */ - static addFileFilter(name: string, cb: Function): void; + function addFileFilter(name: string, cb: Function): void; } diff --git a/types/plupload/plupload-tests.ts b/types/plupload/plupload-tests.ts index b03cc458ff..2a416a0bbc 100644 --- a/types/plupload/plupload-tests.ts +++ b/types/plupload/plupload-tests.ts @@ -9,7 +9,6 @@ import 'plupload'; uploader.init(); uploader.start(); - uploader.bind('FilesAdded', function (up: any, files: any) { var html = ''; plupload.each(files, function (file: any) { diff --git a/types/plupload/tsconfig.json b/types/plupload/tsconfig.json index ae69b36956..d7dc70a3bd 100644 --- a/types/plupload/tsconfig.json +++ b/types/plupload/tsconfig.json @@ -5,7 +5,7 @@ "es6", "dom" ], - "noImplicitAny": false, + "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, "strictFunctionTypes": true, From 461c0d67dd50c8153d562abf11129648fde1d36e Mon Sep 17 00:00:00 2001 From: Joshua Goldberg Date: Wed, 4 Apr 2018 19:49:49 -0700 Subject: [PATCH 0449/2153] TS@2.4; lint disablement --- types/expect-puppeteer/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/expect-puppeteer/index.d.ts b/types/expect-puppeteer/index.d.ts index ed89a0f709..7b33ef686c 100644 --- a/types/expect-puppeteer/index.d.ts +++ b/types/expect-puppeteer/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/smooth-code/jest-puppeteer // Definitions by: Josh Goldberg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.4 /// @@ -46,6 +46,7 @@ interface ExpectPuppeteer { declare global { namespace jest { + // tslint:disable-next-line no-empty-interface interface Matchers extends ExpectPuppeteer { } } } From 1f18ca2c554075348bf7d63235506b8359f26edb Mon Sep 17 00:00:00 2001 From: jemmyphan Date: Thu, 5 Apr 2018 10:18:43 +0700 Subject: [PATCH 0450/2153] [react-navigation] update transitionConfig (transitionConfig accept 3 params) --- types/react-navigation/index.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index fcfb8d4988..9aafc994fb 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -280,7 +280,11 @@ export interface NavigationStackViewConfig { mode?: 'card' | 'modal'; headerMode?: HeaderMode; cardStyle?: StyleProp; - transitionConfig?: () => TransitionConfig; + transitionConfig?: ( + transitionProps: NavigationTransitionProps, + prevTransitionProps: NavigationTransitionProps, + isModal: boolean, + ) => TransitionConfig; onTransitionStart?: () => void; onTransitionEnd?: () => void; } From e60ab3a1729ff95d630f4c75dca20643112f2824 Mon Sep 17 00:00:00 2001 From: Princess Rosella Date: Wed, 4 Apr 2018 23:52:30 -0700 Subject: [PATCH 0451/2153] pngjs: Fixed PNG.sync.write method signature --- types/pngjs/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/pngjs/index.d.ts b/types/pngjs/index.d.ts index ece3434de1..d5476e9e1f 100644 --- a/types/pngjs/index.d.ts +++ b/types/pngjs/index.d.ts @@ -24,7 +24,7 @@ export class PNG extends Duplex { static sync: { read(buffer: Buffer, options?: ParserOptions): PNG; - write(buffer: Buffer, options?: PackerOptions): PNG; + write(png: PNG, options?: PackerOptions): Buffer; }; constructor(options?: PNGOptions); From 85d38719e6a0df163591460fcdafd3f244ab8a28 Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 5 Apr 2018 15:11:00 +0200 Subject: [PATCH 0452/2153] Fixes types for `args` and `OnChallangeHandler` Fixes https://github.com/DefinitelyTyped/DefinitelyTyped/issues/24408 The Subscribe Handler and the call may use send an `any` if args only contain one element. --- types/autobahn/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/autobahn/index.d.ts b/types/autobahn/index.d.ts index 969c703478..59bb2c404d 100644 --- a/types/autobahn/index.d.ts +++ b/types/autobahn/index.d.ts @@ -25,7 +25,7 @@ declare namespace autobahn { leave(reason: string, message: string): void; - call(procedure: string, args?: any[], kwargs?: any, options?: ICallOptions): When.Promise; + call(procedure: string, args?: any[] | any, kwargs?: any, options?: ICallOptions): When.Promise; publish(topic: string, args?: any[], kwargs?: any, options?: IPublishOptions): When.Promise; @@ -96,7 +96,7 @@ declare namespace autobahn { kwargs: any; } - type SubscribeHandler = (args?: any[], kwargs?: any, details?: IEvent) => void; + type SubscribeHandler = (args?: any[] | any, kwargs?: any, details?: IEvent) => void; interface ISubscription { topic: string; @@ -206,7 +206,7 @@ declare namespace autobahn { type DeferFactory = () => When.Promise; - type OnChallengeHandler = (session: Session, method: string, extra: any) => string; + type OnChallengeHandler = (session: Session, method: string, extra: any) => string | When.Promise; interface IConnectionOptions { use_es6_promises?: boolean; From 23361b3499e92e67f5bb9a9cec9f541fdbfbcbdc Mon Sep 17 00:00:00 2001 From: Sergei Samsonov Date: Thu, 5 Apr 2018 14:16:29 +0300 Subject: [PATCH 0453/2153] Update pre hooks type definitions --- types/mongoose/index.d.ts | 78 +++++++++++++++++++-- types/mongoose/mongoose-tests.ts | 112 +++++++++++++++++++++++++++++++ 2 files changed, 184 insertions(+), 6 deletions(-) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index e9576b5098..35763d2131 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -618,8 +618,74 @@ declare module "mongoose" { /** * Defines a pre hook for the document. */ - pre(method: string, parallel: boolean, fn: HookAsyncCallback, errorCb?: HookErrorCallback): this; - pre(method: string, fn: HookSyncCallback, errorCb?: HookErrorCallback): this; + pre( + method: "init" | "validate" | "save" | "remove", + fn: HookSyncCallback, + errorCb?: HookErrorCallback + ): this; + pre = Query>( + method: + | "count" + | "find" + | "findOne" + | "findOneAndRemove" + | "findOneAndUpdate" + | "update", + fn: HookSyncCallback, + errorCb?: HookErrorCallback + ): this; + pre = Aggregate>( + method: "aggregate", + fn: HookSyncCallback, + errorCb?: HookErrorCallback + ): this; + pre = Model>( + method: "insertMany", + fn: HookSyncCallback, + errorCb?: HookErrorCallback + ): this; + pre | Query | Aggregate>( + method: string, + fn: HookSyncCallback, + errorCb?: HookErrorCallback + ): this; + + pre( + method: "init" | "validate" | "save" | "remove", + parallel: boolean, + fn: HookAsyncCallback, + errorCb?: HookErrorCallback + ): this; + pre = Query>( + method: + | "count" + | "find" + | "findOne" + | "findOneAndRemove" + | "findOneAndUpdate" + | "update", + parallel: boolean, + fn: HookAsyncCallback, + errorCb?: HookErrorCallback + ): this; + pre = Aggregate>( + method: "aggregate", + parallel: boolean, + fn: HookAsyncCallback, + errorCb?: HookErrorCallback + ): this; + pre = Model>( + method: "insertMany", + parallel: boolean, + fn: HookAsyncCallback, + errorCb?: HookErrorCallback + ): this; + pre | Query | Aggregate>( + method: string, + parallel: boolean, + fn: HookAsyncCallback, + errorCb?: HookErrorCallback + ): this; /** * Adds a method call to the queue. @@ -679,12 +745,12 @@ declare module "mongoose" { } // Hook functions: https://github.com/vkarpov15/hooks-fixed - interface HookSyncCallback { - (next: HookNextFunction): any; + interface HookSyncCallback { + (this: T, next: HookNextFunction): Promise | void; } - interface HookAsyncCallback { - (next: HookNextFunction, done: HookDoneFunction): any; + interface HookAsyncCallback { + (this: T, next: HookNextFunction, done: HookDoneFunction): Promise | void; } interface HookErrorCallback { diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index bf2f61f4a3..963de3eb0e 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -260,6 +260,118 @@ schema.plugin(function (schema, opts) { } }).plugin(cb, {opts: true}); +/* `.pre` hook tests */ + +interface PreHookTestDocumentInterface extends mongoose.Document {} +interface PreHookTestQueryInterface extends mongoose.Query {} +interface PreHookTestAggregateInterface extends mongoose.Aggregate {} +interface PreHookTestModelInterface extends mongoose.Model {} + +// it is used to ensure that all testing cases return a value of mongoose.Schema type +const preHookTestSchemaArr: mongoose.Schema[] = []; + +// testing order: +// serial with default value and returning void +// serial with a type argument and returning a promise +// parallel with default value and returning void +// parallel with a type argument and returning a promise + +// Document +preHookTestSchemaArr.push( + schema.pre("init", function (next) { + const isDefaultType: mongoose.Document = this; + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre("init", function (next) { + const isSpecificType: PreHookTestDocumentInterface = this; + return Promise.resolve(""); + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre("init", true, function (next, done) { + const isDefaultType: mongoose.Document = this; + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre("init", true, function (next, done) { + const isSpecificType: PreHookTestDocumentInterface = this; + return Promise.resolve(""); + }, err => {}) +); + +// Query +preHookTestSchemaArr.push( + schema.pre("count", function (next) { + const isDefaultType: mongoose.Query = this; + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre>("count", function (next) { + const isSpecificType: PreHookTestQueryInterface = this; + return Promise.resolve(""); + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre("count", true, function (next, done) { + const isDefaultType: mongoose.Query = this; + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre>("count", true, function (next, done) { + const isSpecificType: PreHookTestQueryInterface = this; + return Promise.resolve(""); + }, err => {}) +); + +// Aggregate +preHookTestSchemaArr.push( + schema.pre("aggregate", function(next) { + const isDefaultType: mongoose.Aggregate = this; + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre>("aggregate", function(next) { + const isSpecificType: PreHookTestAggregateInterface = this; + return Promise.resolve("") + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre("aggregate", true, function(next, done) { + const isDefaultType: mongoose.Aggregate = this; + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre>("aggregate", true, function(next, done) { + const isSpecificType: PreHookTestAggregateInterface = this; + return Promise.resolve("") + }, err => {}) +); + +// Model +preHookTestSchemaArr.push( + schema.pre("insertMany", function(next) { + const isDefaultType: mongoose.Model = this; + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre>("insertMany", function(next) { + const isSpecificType: PreHookTestModelInterface = this; + return Promise.resolve("") + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre("insertMany", true, function(next, done) { + const isDefaultType: mongoose.Model = this; + }, err => {}) +); +preHookTestSchemaArr.push( + schema.pre>("insertMany", true, function(next, done) { + const isSpecificType: PreHookTestModelInterface = this; + return Promise.resolve("") + }, err => {}) +); + schema .post('save', function (error, doc, next) { error.stack; From 0104de233468bda68376307c5d27b3057807e1bb Mon Sep 17 00:00:00 2001 From: Shenghan Gao Date: Thu, 5 Apr 2018 10:23:58 -0700 Subject: [PATCH 0454/2153] fix a typo --- types/mongoose/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 4cd32a0126..81974b2ee0 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -2619,7 +2619,7 @@ declare module "mongoose" { insertMany(docs: any[], callback?: (error: any, docs: T[]) => void): Promise; insertMany(docs: any[], options?: { ordered?: boolean, rawResult?: boolean }, callback?: (error: any, docs: T[]) => void): Promise; insertMany(doc: any, callback?: (error: any, doc: T) => void): Promise; - insertMany(doc: any, options?: { rdered?: boolean, rawResult?: boolean }, callback?: (error: any, doc: T) => void): Promise; + insertMany(doc: any, options?: { ordered?: boolean, rawResult?: boolean }, callback?: (error: any, doc: T) => void): Promise; /** * Executes a mapReduce command. From 420e69a0c960f0dc2daf7008b4121ccaacdebff4 Mon Sep 17 00:00:00 2001 From: Joshua Goldberg Date: Thu, 5 Apr 2018 12:40:40 -0700 Subject: [PATCH 0455/2153] Used sub-monorepo link --- types/expect-puppeteer/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/expect-puppeteer/index.d.ts b/types/expect-puppeteer/index.d.ts index 7b33ef686c..12f19c785d 100644 --- a/types/expect-puppeteer/index.d.ts +++ b/types/expect-puppeteer/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for expect-puppeteer 2.2 -// Project: https://github.com/smooth-code/jest-puppeteer +// Project: https://github.com/smooth-code/jest-puppeteer/tree/master/packages/expect-puppeteer // Definitions by: Josh Goldberg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 From fd6ea7aba8c8e221c4b109d2a08fc11557a6715b Mon Sep 17 00:00:00 2001 From: Joshua Goldberg Date: Thu, 5 Apr 2018 12:41:29 -0700 Subject: [PATCH 0456/2153] Used sub-monorepo link --- types/jest-environment-puppeteer/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/jest-environment-puppeteer/index.d.ts b/types/jest-environment-puppeteer/index.d.ts index abb0ad02d1..e22bee2f7d 100644 --- a/types/jest-environment-puppeteer/index.d.ts +++ b/types/jest-environment-puppeteer/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for jest-environment-puppeteer 2.2 -// Project: https://github.com/smooth-code/jest-puppeteer +// Project: https://github.com/smooth-code/jest-puppeteer/tree/master/packages/jest-environment-puppeteer // Definitions by: Josh Goldberg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 From 51818eb371559273921bf5526896ef33d479e6ea Mon Sep 17 00:00:00 2001 From: AndersonFriaca Date: Thu, 5 Apr 2018 15:51:13 -0400 Subject: [PATCH 0457/2153] Adjustments for JQuery CountTo --- types/jquery-countto/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/jquery-countto/index.d.ts b/types/jquery-countto/index.d.ts index a215abb7d4..a815340d0b 100644 --- a/types/jquery-countto/index.d.ts +++ b/types/jquery-countto/index.d.ts @@ -35,7 +35,7 @@ export interface Options { /** * A handler that is used to format the current value before rendering to the DOM */ - formatter: (value: number, options: Options) => string; + formatter?: (value: number, options: Options) => string; /** * A callback function that is triggered for every iteration that the counter updates From 157d57188b3f27b58d6aeae6832ced68fdf18866 Mon Sep 17 00:00:00 2001 From: guilhermehubner Date: Thu, 5 Apr 2018 15:10:00 -0300 Subject: [PATCH 0458/2153] [react-places-autocomplete] Adding disabled option to --- types/react-places-autocomplete/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react-places-autocomplete/index.d.ts b/types/react-places-autocomplete/index.d.ts index 73a8e7ae55..667106d916 100644 --- a/types/react-places-autocomplete/index.d.ts +++ b/types/react-places-autocomplete/index.d.ts @@ -21,6 +21,7 @@ export interface PropTypes { name?: string; placeholder?: string; onBlur?: (event: React.FocusEvent) => void; + disabled?: boolean; }; onError?: (status: string, clearSuggestion: () => void) => void; onSelect?: (address: string, placeID: string) => void; From 914559196c8c1c0b3df87e7d29a3a10f0ec55b01 Mon Sep 17 00:00:00 2001 From: AndersonFriaca Date: Thu, 5 Apr 2018 15:54:19 -0400 Subject: [PATCH 0459/2153] Adjustments for JQuery CountTo --- types/jquery-countto/jquery-countto-tests.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/jquery-countto/jquery-countto-tests.ts b/types/jquery-countto/jquery-countto-tests.ts index 0bc7998f56..07ec15518b 100644 --- a/types/jquery-countto/jquery-countto-tests.ts +++ b/types/jquery-countto/jquery-countto-tests.ts @@ -21,6 +21,7 @@ const options: Options = { }; $('.timer').countTo(options); +$('.timer').countTo({from: 50}); // Controls $('.timer').countTo('start'); From 86765719a3588de58bac8fff2869b569cd7ed678 Mon Sep 17 00:00:00 2001 From: Julien Chaumond Date: Thu, 5 Apr 2018 17:34:14 -0400 Subject: [PATCH 0460/2153] [mongodb] since v3 of the driver, `aggregate` calls back with an AggregationCursor --- types/mongodb/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 0ebe9203bb..4fb7dc68f6 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -8,6 +8,7 @@ // Mariano Cortesi // Enrico Picci // Alexander Christie +// Julien Chaumond // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -465,8 +466,8 @@ export interface Collection { // Get current index hint for collection. hint: any; /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#aggregate */ - aggregate(pipeline: Object[], callback: MongoCallback): AggregationCursor; - aggregate(pipeline: Object[], options?: CollectionAggregationOptions, callback?: MongoCallback): AggregationCursor; + aggregate(pipeline: Object[], callback: MongoCallback>): AggregationCursor; + aggregate(pipeline: Object[], options?: CollectionAggregationOptions, callback?: MongoCallback>): AggregationCursor; /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#bulkWrite */ bulkWrite(operations: Object[], callback: MongoCallback): void; bulkWrite(operations: Object[], options?: CollectionBluckWriteOptions): Promise; From ca4d656606d7d9577f26b2814610210bbc8bf1f2 Mon Sep 17 00:00:00 2001 From: Jeremy Stucki Date: Thu, 5 Apr 2018 23:59:44 +0200 Subject: [PATCH 0461/2153] Remove catalog --- notNeededPackages.json | 6 ++ types/catalog/catalog-tests.tsx | 42 ------------ types/catalog/index.d.ts | 109 -------------------------------- types/catalog/tsconfig.json | 25 -------- types/catalog/tslint.json | 3 - 5 files changed, 6 insertions(+), 179 deletions(-) delete mode 100644 types/catalog/catalog-tests.tsx delete mode 100644 types/catalog/index.d.ts delete mode 100644 types/catalog/tsconfig.json delete mode 100644 types/catalog/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index cbfcc651a1..0f318582a8 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -210,6 +210,12 @@ "sourceRepoURL": "https://github.com/blakeembrey/camel-case", "asOfVersion": "1.2.1" }, + { + "libraryName": "catalog", + "typingsPackageName": "catalog", + "sourceRepoURL": "https://github.com/interactivethings/catalog", + "asOfVersion": "3.5.0" + }, { "libraryName": "chalk", "typingsPackageName": "chalk", diff --git a/types/catalog/catalog-tests.tsx b/types/catalog/catalog-tests.tsx deleted file mode 100644 index 37a87540d1..0000000000 --- a/types/catalog/catalog-tests.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import * as React from "react"; -import { Config, render, markdown, Catalog, ReactSpecimen, Page } from "catalog"; - -const config: Config = { - title: 'Test', - pages: [ - { - path: '/', - title: 'Introduction', - content: '/patd/to/file.md', - }, - { - path: '/materials', - title: 'Materials', - pages: [ - { - path: '/materials/typeface', - title: 'Typeface', - component: , - }, - ], - }, - ], - useBrowserHistory: true, - basePath: '/doc', - responsiveSizes: [ - { name: 'large', width: 978, height: 1100 }, - { name: 'medium', width: 640, height: 900 }, - { name: 'small', width: 471, height: 700 }, - ], -}; - -render(config, document.body); -; - -markdown` -# Test - -${ -

    -} -`; diff --git a/types/catalog/index.d.ts b/types/catalog/index.d.ts deleted file mode 100644 index 3476e86641..0000000000 --- a/types/catalog/index.d.ts +++ /dev/null @@ -1,109 +0,0 @@ -// Type definitions for catalog 3.2 -// Project: https://github.com/interactivethings/catalog/ -// Definitions by: Peter Gassner , Tomas Carnecky -// Definitions: https://github.com/interactivethings/catalog/ -// TypeScript Version: 2.6 - -import * as React from "react"; - -// Configuration - -// XXX: Can not name this 'Page' because there's already a 'Page' -// component here. -export interface ConfigPage { - path: string; - title: string; - - content?: any; - component?: any; - pages?: ConfigPage[]; -} - -export interface ConfigResponsiveSize { - name: string; - width: number; - height: number; -} - -export interface Config { - title: string; - pages: ConfigPage[]; - - useBrowserHistory?: boolean; - basePath?: string; - responsiveSizes?: ConfigResponsiveSize[]; -} - -export function render(config: Config, element: HTMLElement): void; -export function configure(config: any): any; -export function configureRoutes(config: any): any; -export function configureJSXRoutes(config: any): any; - -export function pageLoader(f: () => Promise): any; -export function markdown(...x: any[]): JSX.Element; - -// Components -export interface DefaultCatalogProps extends React.Props<{}> { - span?: number; - theme?: any; -} - -export class Card extends React.Component {} -export class Page extends React.Component {} -export interface SpanProps extends DefaultCatalogProps { - style?: any; -} -export class Span extends React.Component {} - -// Specimens -export class AudioSpecimen extends React.Component {} - -export interface CodeSpecimenProps extends DefaultCatalogProps { - rawBody: string; - collapsed: boolean; - lang: string; - raw: boolean; -} -export class CodeSpecimen extends React.Component {} - -export interface ColorSpecimenProps extends DefaultCatalogProps { - value: string; - name: string; -} -export class ColorSpecimen extends React.Component {} - -export interface ColorPaletteSpecimenProps extends DefaultCatalogProps { - colors: Array<{name?: string, value: string}>; - horizontal?: boolean; -} -export class ColorPaletteSpecimen extends React.Component {} - -export class HtmlSpecimen extends React.Component {} -export class HintSpecimen extends React.Component {} -export class ImageSpecimen extends React.Component {} - -export interface TypeSpecimenProps extends DefaultCatalogProps { - color?: string; - font: string; - headings: string[] | number[]; - style?: string; - weight: string; -} -export class TypeSpecimen extends React.Component {} -export class DownloadSpecimen extends React.Component {} - -export interface ReactSpecimenProps extends DefaultCatalogProps { - noSource?: boolean; - plain?: boolean; - light?: boolean; - dark?: boolean; - frame?: boolean; - state?: any; - responsive?: boolean | string | string[]; - sourceText?: string; -} -export class ReactSpecimen extends React.Component {} - -export class VideoSpecimen extends React.Component {} - -export class Catalog extends React.Component {} diff --git a/types/catalog/tsconfig.json b/types/catalog/tsconfig.json deleted file mode 100644 index ee00ec7af2..0000000000 --- a/types/catalog/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true, - "jsx": "react" - }, - "files": [ - "index.d.ts", - "catalog-tests.tsx" - ] -} \ No newline at end of file diff --git a/types/catalog/tslint.json b/types/catalog/tslint.json deleted file mode 100644 index b4b47a0378..0000000000 --- a/types/catalog/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "dtslint/dt.json" -} From 4d7b0c1f0a204a6816e82b7d2410bd82a7358e37 Mon Sep 17 00:00:00 2001 From: Jim Bouquet Date: Thu, 5 Apr 2018 17:10:03 -0500 Subject: [PATCH 0462/2153] Added type definitions for clearbladejs-client, clearbladejs-server, and clearbladejs-node. --- .../clearbladejs-client-tests.ts | 193 ++++++++ types/clearbladejs-client/global.d.ts | 5 + types/clearbladejs-client/index.d.ts | 441 ++++++++++++++++++ types/clearbladejs-client/tsconfig.json | 32 ++ types/clearbladejs-client/tslint.json | 79 ++++ .../clearbladejs-node-tests.ts | 128 +++++ types/clearbladejs-node/index.d.ts | 256 ++++++++++ types/clearbladejs-node/tsconfig.json | 34 ++ types/clearbladejs-node/tslint.json | 79 ++++ .../clearbladejs-server-tests.ts | 192 ++++++++ types/clearbladejs-server/global.d.ts | 5 + types/clearbladejs-server/index.d.ts | 336 +++++++++++++ types/clearbladejs-server/tsconfig.json | 32 ++ types/clearbladejs-server/tslint.json | 79 ++++ 14 files changed, 1891 insertions(+) create mode 100644 types/clearbladejs-client/clearbladejs-client-tests.ts create mode 100644 types/clearbladejs-client/global.d.ts create mode 100644 types/clearbladejs-client/index.d.ts create mode 100644 types/clearbladejs-client/tsconfig.json create mode 100644 types/clearbladejs-client/tslint.json create mode 100644 types/clearbladejs-node/clearbladejs-node-tests.ts create mode 100644 types/clearbladejs-node/index.d.ts create mode 100644 types/clearbladejs-node/tsconfig.json create mode 100644 types/clearbladejs-node/tslint.json create mode 100644 types/clearbladejs-server/clearbladejs-server-tests.ts create mode 100644 types/clearbladejs-server/global.d.ts create mode 100644 types/clearbladejs-server/index.d.ts create mode 100644 types/clearbladejs-server/tsconfig.json create mode 100644 types/clearbladejs-server/tslint.json diff --git a/types/clearbladejs-client/clearbladejs-client-tests.ts b/types/clearbladejs-client/clearbladejs-client-tests.ts new file mode 100644 index 0000000000..9aece4b19a --- /dev/null +++ b/types/clearbladejs-client/clearbladejs-client-tests.ts @@ -0,0 +1,193 @@ +// Testing type definitions for clearbladejs Client SDK v1.0.0 +// Project: https://github.com/ClearBlade/JavaScript-API +// Definitions by: Jim Bouquet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +var genericCallback = function(error: boolean, response: Resp) {}; + +/////////////////////////////////////// +//ClearBlade object API invocations +/////////////////////////////////////// +ClearBlade.init({ + systemKey: "abcdef", + systemSecret: "abcdefg", + callback: genericCallback +}); + +ClearBlade.setUser("test@test.com", "password"); +ClearBlade.registerUser("test@test.com", "password", genericCallback); +ClearBlade.isCurrentUserAuthenticated(genericCallback); +ClearBlade.logoutUser(genericCallback); +ClearBlade.loginAnon(genericCallback); +ClearBlade.loginUser("test@test.com", "password", genericCallback); +ClearBlade.loginUserMqtt("test@test.com", "password", genericCallback); +ClearBlade.sendPush(["user1", "user2"], {data: "Test"}, "appId: string", genericCallback); +ClearBlade.getAllCollections(genericCallback); + +var coll1 = ClearBlade.Collection("collectionID"); +var coll2 = ClearBlade.Collection({ collectionName: "collectionName" }); +var coll3 = ClearBlade.Collection({ collectionID: "collectionID" }); + +var query1 = ClearBlade.Query("collectionID"); +var query2 = ClearBlade.Query({ offset: 5, limit: 5, collectionID: "collectionID" }); +var query3 = ClearBlade.Query({ collectionName: "collectionName" }); + +var item1 = ClearBlade.Item({}, "collectionID"); +var item2 = ClearBlade.Item({}, { collectionID: "collectionID" }); + +var code = ClearBlade.Code(); +var user = ClearBlade.User(); + +var messaging = ClearBlade.Messaging({}, genericCallback); +var stats = ClearBlade.MessagingStats(); + +var edge = ClearBlade.Edge(); +var metrics = ClearBlade.Metrics(); +var device = ClearBlade.Device(); +var analytics = ClearBlade.Analytics(); +var portal = ClearBlade.Portal("MyPortal"); +var triggers = ClearBlade.Triggers(); + +ClearBlade.getEdges(query1.query, genericCallback); + +/////////////////////////////////////// +//Collection API invocations +/////////////////////////////////////// +coll1.fetch(query1.query, genericCallback); +coll1.create(ClearBlade.Item({}, ""), genericCallback); +coll1.update(query1.query, {}, genericCallback); +coll1.remove(query1.query, genericCallback); +coll1.columns(genericCallback); +coll1.count(query1.query, genericCallback); + +/////////////////////////////////////// +//Query API invocations +/////////////////////////////////////// +query1.addSortToQuery( + query1, + QuerySortDirections.QUERY_SORT_ASCENDING, + "column1" +); +query1.addFilterToQuery( + query1, + QueryConditions.QUERY_GREATERTHAN, + "key", + "value" +); +query1.ascending("string"); +query1.descending("string"); +query1.equalTo("string", "string"); +query1.greaterThan("string", 2); +query1.greaterThanEqualTo("string", false); +query1.lessThan("string", "string"); +query1.lessThanEqualTo("string", "string"); +query1.notEqualTo("string", "string"); +query1.matches("string", new RegExp(/.*/)); +query1.or(query2); +query1.setPage(1, 1); +query1.fetch(genericCallback); +query1.update({}, genericCallback); +query1.columns([]); +query1.remove(genericCallback); + +/////////////////////////////////////// +//Item API invocations +/////////////////////////////////////// +item1.save(genericCallback); +item1.refresh(genericCallback); +item1.destroy(genericCallback); + +/////////////////////////////////////// +//Code API invocations +/////////////////////////////////////// +code.create("codeName", "body: string", genericCallback); +code.update("codeName", "body: string", genericCallback); +code.delete("codeName", genericCallback); +code.execute("codeName", {}, genericCallback); +code.getCompletedServices(genericCallback); +code.getFailedServices(genericCallback); +code.getAllServices(genericCallback); + +/////////////////////////////////////// +//User API invocations +/////////////////////////////////////// +user.getUser(genericCallback); +user.setUser({}, genericCallback); +user.allUsers(query1.query, genericCallback); +user.setPassword("old_password", "new_password", genericCallback); +user.count(query1.query, genericCallback); + +/////////////////////////////////////// +//Messaging API invocations +/////////////////////////////////////// +messaging.getMessageHistoryWithTimeFrame("topic", 5, 10, 15, 20, genericCallback); +messaging.getMessageHistory("topic", 5, 15, genericCallback); +messaging.getAndDeleteMessageHistory("topic", 5, 10, 1, 20, genericCallback); +messaging.currentTopics(genericCallback); +messaging.publish("topic", {}); +messaging.publishREST("topic", { payload: Object }, genericCallback); +var mcb = function(message: string) {}; +messaging.subscribe("topic", {}, mcb); +messaging.unsubscribe("topic", {}); +messaging.disconnect(); + +/////////////////////////////////////// +//MessagingStats API invocations +/////////////////////////////////////// +stats.getAveragePayloadSize("topic: string", 5, 5, genericCallback); +stats.getOpenConnections(genericCallback); +stats.getCurrentSubscribers("topic: string", genericCallback); + +/////////////////////////////////////// +//Edge API invocations +/////////////////////////////////////// +edge.updateEdgeByName("edgename", {changedColumn: "New value"}, genericCallback); +edge.deleteEdgeByName("edgename", genericCallback); +edge.create({newEdge: Object}, "edgename", genericCallback); +edge.columns(genericCallback); +edge.count(query1.query, genericCallback); + +/////////////////////////////////////// +//Metrics API invocations +/////////////////////////////////////// +metrics.setQuery(query1.query); +metrics.getStatistics(genericCallback); +metrics.getStatisticsHistory(genericCallback); +metrics.getDBConnections(genericCallback); +metrics.getLogs(genericCallback); + +/////////////////////////////////////// +//Device API invocations +/////////////////////////////////////// +device.getDeviceByName("devicename", genericCallback); +device.updateDeviceByName("devicename", { object: Object }, true, genericCallback); +device.deleteDeviceByName("devicename", genericCallback); +device.fetch(query1.query, genericCallback); +device.update(query1.query, { object: Object }, false, genericCallback); +device.delete(query1.query, genericCallback); +device.create({ newDevice: Object }, genericCallback); +device.columns(genericCallback); +device.count(query1.query, genericCallback); + +/////////////////////////////////////// +//Analytics API invocations +/////////////////////////////////////// +analytics.getStorage({}, genericCallback); +analytics.getCount({}, genericCallback); +analytics.getEventList({}, genericCallback); +analytics.getEventTotals({}, genericCallback); +analytics.getUserEvents({}, genericCallback); + +/////////////////////////////////////// +//Portal API invocations +/////////////////////////////////////// +portal.fetch(genericCallback); +portal.update({data: Object}, genericCallback); + +/////////////////////////////////////// +//Triggers API invocations +/////////////////////////////////////// +triggers.fetchDefinitions(genericCallback); +triggers.create("triggername", {data: Object}, genericCallback); +triggers.update("triggername", {data: Object}, genericCallback); +triggers.delete("triggername", genericCallback); diff --git a/types/clearbladejs-client/global.d.ts b/types/clearbladejs-client/global.d.ts new file mode 100644 index 0000000000..7f70ed08f7 --- /dev/null +++ b/types/clearbladejs-client/global.d.ts @@ -0,0 +1,5 @@ +declare global { + var ClearBlade: ClearBladeGlobal; +} + +export {}; \ No newline at end of file diff --git a/types/clearbladejs-client/index.d.ts b/types/clearbladejs-client/index.d.ts new file mode 100644 index 0000000000..3c7ebd40f1 --- /dev/null +++ b/types/clearbladejs-client/index.d.ts @@ -0,0 +1,441 @@ +// Type definitions for clearbladejs Client SDK v1.0.0 +// Project: https://github.com/ClearBlade/JavaScript-API +// Definitions by: Jim Bouquet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// +// TypeScript Version: 2.1 + +/// + +interface Resp { + error(msg: any): never; // todo: figure out if we can have the compiler throw an error if someone adds code after this + success(msg: any): never; +} + +declare enum MessagingQOS { + MESSAGING_QOS_AT_MOST_ONCE = 0, + MESSAGING_QOS_AT_LEAST_ONCE = 1, + MESSAGING_QOS_EXACTLY_ONCE = 2 +} + +interface InitOptions { + systemKey: string; + systemSecret: string; + masterSecret?: string; + logging?: boolean; + callback?: CbCallback; + email?: string; + password?: string; + registerUser?: boolean; + useUser?: APIUser; + URI?: string; + messagingURI?: string; + messagingPort?: number; + defaultQoS?: MessagingQOS; + callTimeout?: number; + messagingAuthPort?: number; +} + +interface RequestOptions { + method?: string; + endpoint?: string; + body?: string; + qs?: string; + URI?: string; + useUser?: boolean; + authToken?: string; + timeout?: number; + user?: APIUser; +} + +interface APIUser { + email: string; + authToken: string; +} + +interface CbCallback { + (error: boolean, response: Resp): void; +} + +interface ClearBladeGlobal extends ClearBladeInt { + MESSAGING_QOS_AT_MOST_ONCE: MessagingQOS.MESSAGING_QOS_AT_MOST_ONCE; + MESSAGING_QOS_AT_LEAST_ONCE: MessagingQOS.MESSAGING_QOS_AT_LEAST_ONCE; + MESSAGING_QOS_EXACTLY_ONCE: MessagingQOS.MESSAGING_QOS_EXACTLY_ONCE; + + request(options: RequestOptions, callback: CbCallback): void; +} + +interface ClearBladeInt { + systemKey: string; + systemSecret: string; + masterSecret: string; + URI: string; + messagingURI: string; + messagingPort: number; + logging: boolean; + defaultQoS: MessagingQOS; + + init(options: InitOptions): void; + setUser(email: string, password: string): void; + registerUser(email: string, password: string, callback: CbCallback): void; + isCurrentUserAuthenticated(callback: CbCallback): void; + logoutUser(callback: CbCallback): void; + loginAnon(callback: CbCallback): void; + loginUser(email: string, password: string, callback: CbCallback): void; + loginUserMqtt(email: string, password: string, callback: CbCallback): void; + registerMasterCallback(callback: CbCallback): void; + Collection(options: string | CollectionOptionsWithName | CollectionOptionsWithID): Collection; + Query( + options: string | QueryOptionsWithName | QueryOptionsWithID + ): QueryObj; + Item(data: Object, collectionID: string | ItemOptions): Item; + Code(): Code; + User(): AppUser; + Messaging(options: MessagingOptions, callback: CbCallback): Messaging; + MessagingStats(): MessagingStats; + sendPush( + users: string[], + payload: Object, + appId: string, + callback: CbCallback + ): void; + getEdges(query: Query, callback: CbCallback): void; + Edge(): Edge; + Metrics(): Metrics; + Device(): Device; + Analytics(): Analytics; + Portal(name: string): Portal; + Triggers(): Triggers; + + getAllCollections(callback: CbCallback): void; +} +interface CollectionOptionsWithName { + collectionName: string; +} + +interface CollectionOptionsWithID { + collectionID: string; +} + +interface Collection { + name: string; + endpoint: string; + isUsingCollectionName: boolean; + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + + fetch(query: Query, callback: CbCallback): void; + create(newItem: Item, callback: CbCallback): void; + update(query: Query, changes: Object, callback: CbCallback): void; + remove(query: Query, callback: CbCallback): void; + columns(callback: CbCallback): void; + count(query: Query, callback: CbCallback): void; +} + +declare const enum QuerySortDirections { + QUERY_SORT_ASCENDING = "ASC", + QUERY_SORT_DESCENDING = "DESC" +} + +declare const enum QueryConditions { + QUERY_EQUAL = "EQ", + QUERY_NOTEQUAL = "NEQ", + QUERY_GREATERTHAN = "GT", + QUERY_GREATERTHAN_EQUAL = "GTE", + QUERY_LESSTHAN = "LT", + QUERY_LESSTHAN_EQUAL = "LTE", + QUERY_MATCHES = "RE" +} + +type QueryValue = string | number | boolean; + +interface QueryOptions { + offset?: number; + limit?: number; +} + +interface QueryOptionsWithName + extends CollectionOptionsWithName, + QueryOptions {} +interface QueryOptionsWithID extends CollectionOptionsWithID, QueryOptions {} + +interface Query { + SELECTCOLUMNS?: string[]; + SORT?: QuerySortDirections; + FILTERS?: QueryFilter[]; + PAGESIZE?: number; + PAGENUM?: number; +} + +interface QueryFilter { + [QueryConditions: string]: QueryFilterValue; +} + +interface QueryFilterValue { + [name: string]: QueryValue; +} + +interface QueryObj { + endpoint: string; + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + query: Query; + OR: Query[]; + offset: number; + limit: number; + + addSortToQuery( + query: QueryObj, + direction: QuerySortDirections, + column: string + ): void; + addFilterToQuery( + query: QueryObj, + condition: QueryConditions, + key: string, + value: QueryValue + ): void; + ascending(field: string): void; + descending(field: string): void; + equalTo(field: string, value: QueryValue): void; + greaterThan(field: string, value: QueryValue): void; + greaterThanEqualTo(field: string, value: QueryValue): void; + lessThan(field: string, value: QueryValue): void; + lessThanEqualTo(field: string, value: QueryValue): void; + notEqualTo(field: string, value: QueryValue): void; + matches(field: string, pattern: RegExp): void; + or(query: QueryObj): void; + setPage(pageSize: number, pageNum: number): void; + fetch(callback: CbCallback): void; + update(changes: Object, callback: CbCallback): void; + columns(columnsArray: string[]): void; + remove(callback: CbCallback): void; +} + +interface ItemOptions extends CollectionOptionsWithID {} + +interface Item { + data: Object; + + save(callback: CbCallback): void; + refresh(callback: CbCallback): void; + destroy(callback: CbCallback): void; +} + +interface Code { + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + callTimeout: number; + + create(name: string, body: string, callback: CbCallback): void; + update(name: string, body: string, callback: CbCallback): void; + delete(name: string, callback: CbCallback): void; + execute(name: string, params: Object, callback: CbCallback): void; + getCompletedServices(callback: CbCallback): void; + getFailedServices(callback: CbCallback): void; + getAllServices(callback: CbCallback): void; +} + +interface AppUser { + user: APIUser; + URI: string; + endpoint: string; + systemKey: string; + systemSecret: string; + callTimeout: number; + + getUser(callback: CbCallback): void; + setUser(data: Object, callback: CbCallback): void; + allUsers(query: Query, callback: CbCallback): void; + setPassword( + old_password: string, + new_password: string, + callback: CbCallback + ): void; + count(query: Query, callback: CbCallback): void; +} + +interface Messaging { + user: APIUser; + URI: string; + endpoint: string; + systemKey: string; + systemSecret: string; + callTimeout: number; + client: Paho.MQTT.Client; + + getMessageHistoryWithTimeFrame( + topic: string, + count: number, + last: number, + start: number, + stop: number, + callback: CbCallback + ): void; + getMessageHistory( + topic: string, + last: number, + count: number, + callback: CbCallback + ): void; + getAndDeleteMessageHistory( + topic: string, + count: number, + last: number, + start: number, + stop: number, + callback: CbCallback + ): void; + currentTopics(callback: CbCallback): void; + publish(topic: string, payload: Object): void; + publishREST(topic: string, payload: Object, callback: CbCallback): void; + subscribe( + topic: string, + options: MessagingSubscribeOptions, + messageCallback: MessageCallback + ): void; + unsubscribe(topic: string, options: MessagingSubscribeOptions): void; + disconnect(): void; +} + +interface CommonMessagingProperties { + cleanSession?: boolean; + useSSL?: boolean; + hosts?: string; + ports?: string; + onSuccess?: Function; + onFailure?: Function; +} + +interface MessagingOptions extends CommonMessagingProperties { + qos?: MessagingQOS; +} + +interface MessagingConfiguration extends CommonMessagingProperties { + userName: string; + password: string; +} + +interface MessageCallback { + (message: string): void; +} + +interface MessagingSubscribeOptions { + qos?: MessagingQOS; + invocationContext?: Object; + onSuccess?: Function; + onFailure?: Function; + timeout?: number; +} + +interface MessagingStats { + user: APIUser; + URI: string; + endpoint: string; + systemKey: string; + + getAveragePayloadSize( + topic: string, + start: number, + stop: number, + callback: CbCallback + ): void; + getOpenConnections(callback: CbCallback): void; + getCurrentSubscribers(topic: string, callback: CbCallback): void; +} + +interface Edge { + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + + updateEdgeByName(name: string, object: Object, callback: CbCallback): void; + deleteEdgeByName(name: string, callback: CbCallback): void; + create(newEdge: Object, name: string, callback: CbCallback): void; + columns(callback: CbCallback): void; + count(query: Query, callback: CbCallback): void; +} + +interface Metrics { + user: APIUser; + URI: string; + systemKey: string; + + setQuery(query: Query): void; + getStatistics(callback: CbCallback): void; + getStatisticsHistory(callback: CbCallback): void; + getDBConnections(callback: CbCallback): void; + getLogs(callback: CbCallback): void; +} + +interface Device { + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + + getDeviceByName(name: string, callback: CbCallback): void; + updateDeviceByName( + name: string, + object: Object, + trigger: boolean, + callback: CbCallback + ): void; + deleteDeviceByName(name: string, callback: CbCallback): void; + fetch(query: Query, callback: CbCallback): void; + update( + query: Query, + object: Object, + trigger: boolean, + callback: CbCallback + ): void; + delete(query: Query, callback: CbCallback): void; + create(newDevice: Object, callback: CbCallback): void; + columns(callback: CbCallback): void; + count(query: Query, callback: CbCallback): void; +} + +interface Analytics { + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + + getStorage(filter: QueryFilter, callback: CbCallback): void; + getCount(filter: QueryFilter, callback: CbCallback): void; + getEventList(filter: QueryFilter, callback: CbCallback): void; + getEventTotals(filter: QueryFilter, callback: CbCallback): void; + getUserEvents(filter: QueryFilter, callback: CbCallback): void; +} + +interface Portal { + name: string; + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + + fetch(callback: CbCallback): void; + update(data: Object, callback: CbCallback): void; +} + +interface Triggers { + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + + fetchDefinitions(callback: CbCallback): void; + create(name: string, data: Object, callback: CbCallback): void; + update(name: string, data: Object, callback: CbCallback): void; + delete(name: string, callback: CbCallback): void; +} + +declare var ClearBlade: ClearBladeGlobal; diff --git a/types/clearbladejs-client/tsconfig.json b/types/clearbladejs-client/tsconfig.json new file mode 100644 index 0000000000..b360802518 --- /dev/null +++ b/types/clearbladejs-client/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "target": "ES5", + "moduleResolution": "node", + "module": "none", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + ".", + "../", + "../../node_modules/" + ], + "types": ["node"], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "clearbladejs-client-tests.ts", + "global.d.ts" + ], + "exclude": [ + "**/clearbladejs-node/*", + "**/clearbladejs-server/*" + ] +} \ No newline at end of file diff --git a/types/clearbladejs-client/tslint.json b/types/clearbladejs-client/tslint.json new file mode 100644 index 0000000000..a4c53997aa --- /dev/null +++ b/types/clearbladejs-client/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} \ No newline at end of file diff --git a/types/clearbladejs-node/clearbladejs-node-tests.ts b/types/clearbladejs-node/clearbladejs-node-tests.ts new file mode 100644 index 0000000000..b600332ca2 --- /dev/null +++ b/types/clearbladejs-node/clearbladejs-node-tests.ts @@ -0,0 +1,128 @@ +import { ClearBlade, Resp, QuerySortDirections, QueryConditions } from "."; + +// Sample code for clearbladejs Node SDK v1.0.0 used to test typescript definitions +// Project: https://github.com/ClearBlade/Node-SDK +// Definitions by: Jim Bouquet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +const constants = require("./constants.json"); + +var genericCallback = function(error: boolean, response: Resp) {}; + +/////////////////////////////////////// +//ClearBlade object API invocations +/////////////////////////////////////// +ClearBlade.init({ + email: "a@a.com", + password: "a", + systemKey: constants.systemKey, + systemSecret: constants.systemSecret, + URI: constants.URL, + messagingURI: constants.messageURL, + callback: genericCallback +}) + +ClearBlade.setUser("test@test.com", "password"); +ClearBlade.registerUser("test@test.com", "password", genericCallback); +ClearBlade.isCurrentUserAuthenticated(genericCallback); +if (!ClearBlade.isObjectEmpty({prop: "test"})) { + ClearBlade.logger("Object is not empty"); +} + +ClearBlade.validateEmailPassword("test@test.com", "password"); + +ClearBlade.logoutUser(genericCallback); +ClearBlade.loginAnon(genericCallback); +ClearBlade.loginUser("test@test.com", "password", genericCallback); + +ClearBlade.sendPush([], {}, "appId: string", genericCallback); + +// execute(error: Object, response: Object, callback: ClearBladeCallback): void; +// makeKVPair(key: string, value: string): KeyValuePair; +// request(options: RequestOptions, callback: RequestCallback): void; + +var coll1 = ClearBlade.Collection("collectionID"); +var coll2 = ClearBlade.Collection({collectionName: "collectionName"}); +var coll3 = ClearBlade.Collection({collectionID: "collectionID"}); + +var query1 = ClearBlade.Query("collectionID"); +var query2 = ClearBlade.Query({offset: 5, limit: 5, collectionID: "collectionID"}); +var query3 = ClearBlade.Query({collectionName: "collectionName"}); +var query4 = ClearBlade.Query({collection: "collectionID"}); + +ClearBlade.addToQuery(query1, "key", "value"); +ClearBlade.addFilterToQuery(query1, QueryConditions.QUERY_GREATERTHAN, "key", "value"); +ClearBlade.addSortToQuery(query1, QuerySortDirections.QUERY_SORT_ASCENDING, "column1"); + +var opQueryStr = ClearBlade.parseOperationQuery(query1.query); +var parse1:string = ClearBlade.parseQuery(query1.query); +var parse2:string = ClearBlade.parseQuery(query1); + + +var item1 = ClearBlade.Item({}, "hello"); +var item2 = ClearBlade.Item({}, {collectionID: "hello"}); + +var code = ClearBlade.Code(); +var user = ClearBlade.User(); + +var messaging = ClearBlade.Messaging({}, genericCallback); + +/////////////////////////////////////// +//Collection API invocations +/////////////////////////////////////// +coll1.fetch(query1, genericCallback); +coll1.create(ClearBlade.Item({}, ""), genericCallback); +coll1.update(query1.query, {}, genericCallback); +coll1.remove(query1.query, genericCallback); + +/////////////////////////////////////// +//Query API invocations +/////////////////////////////////////// +query1.ascending("string"); +query1.descending("string"); +query1.equalTo("string", "string"); +query1.greaterThan("string", 2); +query1.greaterThanEqualTo("string", false); +query1.lessThan("string", "string"); +query1.lessThanEqualTo("string", "string"); +query1.notEqualTo("string", "string"); +query1.or(query2); +query1.setPage(1, 1); +query1.fetch(genericCallback); +query1.update({}, genericCallback); +query1.remove(genericCallback); + +/////////////////////////////////////// +//Item API invocations +/////////////////////////////////////// +item1.save(); +item1.refresh(); +item1.destroy(); + +/////////////////////////////////////// +//Code API invocations +/////////////////////////////////////// +code.execute("codeName", {}, genericCallback); + +/////////////////////////////////////// +//User API invocations +/////////////////////////////////////// +user.getUser(genericCallback); +user.setUser({}, genericCallback); +user.allUsers(query1.query, genericCallback); + +/////////////////////////////////////// +//Messaging API invocations +/////////////////////////////////////// +messaging.getMessageHistory("topic: string", 5, 15, genericCallback); + +messaging.publish("topic: string", {}); + +messaging.subscribe("my/topic", {}, messageReceivedCb); + +function messageReceivedCb (message: string) { + messaging.unsubscribe("my/topic"); +} + + + diff --git a/types/clearbladejs-node/index.d.ts b/types/clearbladejs-node/index.d.ts new file mode 100644 index 0000000000..a80ecc21d5 --- /dev/null +++ b/types/clearbladejs-node/index.d.ts @@ -0,0 +1,256 @@ +import { Response, RequestCallback } from "request/index"; +import { MqttClient, PacketCallback } from "mqtt"; + +// Type definitions for clearbladejs Node SDK v1.0.0 +// Project: https://github.com/ClearBlade/Node-SDK +// Definitions by: Jim Bouquet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// +// TypeScript Version: 2.1 + +/// +/// + +declare enum MessagingQOS { + MESSAGING_QOS_AT_MOST_ONCE = 0, + MESSAGING_QOS_AT_LEAST_ONCE = 1, + MESSAGING_QOS_EXACTLY_ONCE = 2 +} + +export interface Resp { + error(msg: any): never; // todo: figure out if we can have the compiler throw an error if someone adds code after this + success(msg: any): never; +} + +export interface InitOptions { + systemKey: string; + systemSecret: string; + logging?: boolean; + callback?: CbCallback; + email?: string; + password?: string; + registerUser?: boolean; + useUser?: APIUser; + URI?: string; + messagingURI?: string; + messagingPort?: number; + defaultQoS?: MessagingQOS; + callTimeout?: number; +} + +export interface RequestOptions { + systemKey: string; + systemSecret: string; + method?: string; + endpoint?: string; + body?: string; + qs?: string; + URI?: string; + useUser?: boolean; + authToken?: string; + user?: APIUser; +} + +export interface APIUser { + email: string; + authToken: string; +} + +export interface KeyValuePair { + [key: string]: any; +} + +export interface CbCallback { + (error: boolean, response: Resp): void +} + +export default interface ClearBladeGlobal extends ClearBladeInt { + isCurrentUserAuthenticated(callback: CbCallback): void; +} + +export interface ClearBladeInt { + addToQuery(queryObj: QueryObj, key: string, value: string): void; + addFilterToQuery(queryObj: QueryObj, condition: QueryConditions, key: string, value: QueryValue): void; + addSortToQuery(queryObj: QueryObj, direction: QuerySortDirections, column: string): void; + Code() :Code; + Collection(options: string | CollectionOptionsWithName | CollectionOptionsWithID) :Collection; + execute(error: Object, response: Object, callback: CbCallback): void; + init(options: InitOptions): void; + isObjectEmpty(obj: Object): boolean; + Item(data: Object, options: string | ItemOptions) :Item; + logger(message: string): void; + loginAnon(callback: CbCallback): void; + loginUser(email: string, password: string, callback: CbCallback): void; + logoutUser(callback: CbCallback): void; + makeKVPair(key: string, value: string): KeyValuePair; + parseOperationQuery(query: Query): string; + parseQuery(query: Query | QueryObj): string; + Query(options: string | QueryOptionsWithCollection | QueryOptionsWithName | QueryOptionsWithID) :QueryObj; + registerUser(email: string, password: string, callback: CbCallback): void; + request(options: RequestOptions, callback: RequestCallback): void; + setUser(email: string, password: string): void; + User() :AppUser; + Messaging(options: MessagingOptions, callback: CbCallback) :Messaging; + sendPush(users: string[], payload: Object, appId: string, callback: CbCallback): void; + validateEmailPassword(email: string, password:string): void; +} + +export interface CollectionOptionsWithName { + collectionName: string; +} + +export interface CollectionOptionsWithID { + collectionID: string; +} + +export interface Collection { + endpoint: string; + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + + fetch(query: QueryObj, callback: CbCallback): void; + create(newItem: Item, callback: CbCallback): void; + update(query: Query, changes: Object, callback: CbCallback): void; + remove(query: Query, callback: CbCallback): void; +} + +export declare const enum QuerySortDirections { + QUERY_SORT_ASCENDING = 'ASC', + QUERY_SORT_DESCENDING = 'DESC' +} + +export declare const enum QueryConditions { + QUERY_EQUAL = 'EQ', + QUERY_NOTEQUAL = 'NEQ', + QUERY_GREATERTHAN = 'GT', + QUERY_GREATERTHAN_EQUAL = 'GTE', + QUERY_LESSTHAN = 'LT', + QUERY_LESSTHAN_EQUAL = 'LTE', + QUERY_MATCHES = 'RE' +} + +export type QueryValue = string|number|boolean; + +export interface QueryOptions { + offset?: number; + limit?: number; +} + +export interface QueryOptionsWithCollection extends QueryOptions{ + collection: string; +} + +export interface QueryOptionsWithName extends CollectionOptionsWithName, QueryOptions{} +export interface QueryOptionsWithID extends CollectionOptionsWithID, QueryOptions{} + +export interface Query { + SELECTCOLUMNS?: string[]; + SORT?: QuerySortDirections; + FILTERS?: QueryFilter[]; + PAGESIZE?: number; + PAGENUM?: number; +} + +export interface QueryFilter { + [QueryConditions: string]: QueryFilterValue +} + +export interface QueryFilterValue { + [name: string]: QueryValue +} + +export interface QueryObj { + endpoint: string; + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + query: Query; + OR: Query[]; + offset: number; + limit: number; + + ascending(field: string): Query; + descending(field: string): Query; + equalTo(field: string, value: QueryValue): Query; + greaterThan(field: string, value: QueryValue): Query; + greaterThanEqualTo(field: string, value: QueryValue): Query; + lessThan(field: string, value: QueryValue): Query; + lessThanEqualTo(field: string, value: QueryValue): Query; + notEqualTo(field: string, value: QueryValue): Query; + matches(field: string, pattern: string): Query; + or(query: QueryObj): Query; + setPage(pageSize: number, pageNum: number): Query; + fetch(callback: CbCallback): void; + update(changes: Object, callback: CbCallback): void; + remove(callback: CbCallback): void; +} + +export interface ItemOptions extends CollectionOptionsWithID{} + +export interface Item { + data: Object; + + save(): void; + refresh(): void; + destroy(): void; +} + +export interface Code { + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + callTimeout: number; + URIPrefix: string; + + execute(name: string, params: Object, callback: CbCallback): void; +} + +export interface AppUser { + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + + getUser(callback: CbCallback): void; + setUser(data: Object, callback: CbCallback): void; + allUsers(query: Query, callback: CbCallback): void; +} + +export interface Messaging { + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + client: MqttClient; + + getMessageHistory(topic: string, startTime: number, count: number, callback: CbCallback): void; + publish(topic: string, payload: Object): void; + subscribe(topic: string, options: MessagingSubscribeOptions, messageCallback: MessageCallback): void; + unsubscribe(topic: string, callback?: PacketCallback): void; +} + +export interface CommonMessagingProperties { + hosts?: string; + ports?: string; +} + +export interface MessagingOptions extends CommonMessagingProperties { + qos?: MessagingQOS +} + +export interface MessagingSubscribeOptions { + qos?: MessagingQOS; + timeout?: number; +} + +export interface MessageCallback { + (message: string): void; +} + +declare var ClearBlade: ClearBladeGlobal; + +export {ClearBlade}; diff --git a/types/clearbladejs-node/tsconfig.json b/types/clearbladejs-node/tsconfig.json new file mode 100644 index 0000000000..da91170d85 --- /dev/null +++ b/types/clearbladejs-node/tsconfig.json @@ -0,0 +1,34 @@ +{ + "compileOnSave": true, + "compilerOptions": { + "target": "ES5", + "module": "es6", + "moduleResolution": "Node", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": false, + "noStrictGenericChecks": false, + "strictNullChecks": false, + "strictFunctionTypes": false, + "baseUrl": "../", + "typeRoots": [ + ".", + "../", + "../../node_modules/" + ], + "types": ["node"], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "clearbladejs-node-tests.ts", + "../../node_modules/mqtt/types/index.d.ts" + ], + "exclude": [ + "**/clearbladejs-client/*", + "**/clearbladejs-server/*" + ] +} \ No newline at end of file diff --git a/types/clearbladejs-node/tslint.json b/types/clearbladejs-node/tslint.json new file mode 100644 index 0000000000..a4c53997aa --- /dev/null +++ b/types/clearbladejs-node/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} \ No newline at end of file diff --git a/types/clearbladejs-server/clearbladejs-server-tests.ts b/types/clearbladejs-server/clearbladejs-server-tests.ts new file mode 100644 index 0000000000..ea7c179df2 --- /dev/null +++ b/types/clearbladejs-server/clearbladejs-server-tests.ts @@ -0,0 +1,192 @@ +// Testing type definitions for clearbladejs Client SDK v1.0.0 +// Project: https://github.com/ClearBlade/JavaScript-API +// Definitions by: Jim Bouquet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +var genericCallback = function(error: boolean, response: Resp) {}; + +/////////////////////////////////////// +//ClearBlade object API invocations +/////////////////////////////////////// +ClearBlade.init({ + systemKey: "abcdef", + systemSecret: "abcdefg", + callback: genericCallback +}); + +ClearBlade.init({request: { + isLogging: false, + params: { + param1: "1", + param2: 2 + }, + systemKey: "abcdef", + systemSecret: "abcdef", + userEmail: "test@test.com", + userToken: "abcdef", + userid: "abcdef", +}}); + +var about = ClearBlade.about(); +ClearBlade.setUser("test@test.com", "authtoken", "userId"); +ClearBlade.registerUser("test@test.com", "password", genericCallback); +ClearBlade.isCurrentUserAuthenticated(genericCallback); +ClearBlade.logoutUser(genericCallback); +ClearBlade.loginAnon(genericCallback); +ClearBlade.loginUser("test@test.com", "password", genericCallback); + +ClearBlade.getAllCollections(genericCallback); +var edgeID = ClearBlade.edgeId(); +var isEdge = ClearBlade.isEdge(genericCallback); +if (ClearBlade.isObjectEmpty({test: "test"})) { + ClearBlade.logger("Object is empty"); +} +var kvPair = ClearBlade.makeKVPair("key", "value"); + +var coll1 = ClearBlade.Collection("collectionID"); +var coll2 = ClearBlade.Collection({ collectionName: "collectionName" }); +var coll3 = ClearBlade.Collection({ collectionID: "collectionID" }); +var coll4 = ClearBlade.Collection({ collection: "collectionID" }); + +var query1 = ClearBlade.Query({ collectionID: "collectionID" }); +var query2 = ClearBlade.Query({ collectionName: "collectionName" }); +var query3 = ClearBlade.Query({ collection: "collectionID" }); + +var item1 = ClearBlade.Item({}, "collectionID"); +var item2 = ClearBlade.Item({}, { collectionID: "collectionID" }); + +var code = ClearBlade.Code(); +var deployment = ClearBlade.Deployment(); +var user = ClearBlade.User(); + +var messaging = ClearBlade.Messaging({}, genericCallback); + +var device = ClearBlade.Device(); + +ClearBlade.addToQuery(query1, "key", "value"); +ClearBlade.addSortToQuery( + query1, + QuerySortDirections.QUERY_SORT_ASCENDING, + "column1" +); +ClearBlade.addFilterToQuery( + query1, + QueryConditions.QUERY_GREATERTHAN, + "key", + "value" +); + +ClearBlade.newCollection("collectionName", genericCallback); + +var parseOperation = ClearBlade.parseOperationQuery(query1.query); +var parseQuery1 = ClearBlade.parseQuery(query1); +var parseQuery2 = ClearBlade.parseQuery(query1.query); + +ClearBlade.createDevice("devicename", {type: "devicetype"}, false, genericCallback); +ClearBlade.deleteDevice("devicename", true, genericCallback); +ClearBlade.updateDevice("devicename", {type: "devicetype"}, true, genericCallback); +ClearBlade.getDeviceByName("devicename", genericCallback); +ClearBlade.getAllDevicesForSystem(genericCallback); +ClearBlade.validateEmailPassword("test@test.com", "password"); + +/////////////////////////////////////// +//Collection API invocations +/////////////////////////////////////// +coll1.addColumn({name: "column1"}, genericCallback); +coll1.dropColumn("column1", genericCallback); +coll1.deleteCollection(genericCallback); +coll1.fetch(query1.query, genericCallback); +coll1.create(ClearBlade.Item({}, ""), genericCallback); +coll1.update(query1.query, {}, genericCallback); +coll1.remove(query1.query, genericCallback); +coll1.columns(genericCallback); +coll1.count(query1.query, genericCallback); + +/////////////////////////////////////// +//Query API invocations +/////////////////////////////////////// +query2.ascending("string"); +query1.descending("string"); +query1.equalTo("string", "string"); +query1.greaterThan("string", 2); +query1.greaterThanEqualTo("string", false); +query1.lessThan("string", "string"); +query1.lessThanEqualTo("string", "string"); +query1.notEqualTo("string", "string"); +query1.matches("string", ".*"); +query1.or(query2); +query1.setPage(1, 1); +query1.fetch(genericCallback); +query1.update({}, genericCallback); +query1.columns([]); +query1.remove(genericCallback); + +/////////////////////////////////////// +//Item API invocations +/////////////////////////////////////// +item1.save(); +item1.refresh(); +item1.destroy(); + +/////////////////////////////////////// +//Code API invocations +/////////////////////////////////////// +code.execute("codeName", {}, true, genericCallback); +code.getAllServices(genericCallback); + +/////////////////////////////////////// +//Deployment API invocations +/////////////////////////////////////// +deployment.create("deploymentname", "deployment description", {}, genericCallback); +deployment.update("deploymentname", {}, genericCallback); +deployment.delete("deploymentname", genericCallback); +deployment.read("deploymentname", genericCallback); +deployment.readAll(query1, genericCallback); + +/////////////////////////////////////// +//User API invocations +/////////////////////////////////////// +user.getUser(genericCallback); +user.setUser({}, genericCallback); +user.setUsers(query2, {name: "Fred"}, genericCallback); +user.allUsers(query1, genericCallback); +user.count(query1, genericCallback); + +/////////////////////////////////////// +//Messaging API invocations +/////////////////////////////////////// +messaging.getMessageHistoryWithTimeFrame("topic", 5, 10, 15, 20, genericCallback); +messaging.getMessageHistory("topic", 5, 15, genericCallback); +messaging.getAndDeleteMessageHistory("topic", 5, 10, 1, 20, genericCallback); +messaging.getCurrentTopics(genericCallback); +messaging.publish("topic", "payload"); + +/////////////////////////////////////// +//Device API invocations +/////////////////////////////////////// +device.fetch(query1.query, genericCallback); +device.update(query1.query, { object: Object }, genericCallback); +device.delete(query1.query, genericCallback); +device.create({ newDevice: Object }, genericCallback); + +/////////////////////////////////////// +//Triggers API invocations +/////////////////////////////////////// +ClearBlade.Trigger.Create( + "triggername", + { + system_key: "key", + name: "triggername", + def_module: TriggerModule.DEVICE, + def_name: "someName", + key_value_pairs: [], + service_name: "ServiceName" + }, + genericCallback); +ClearBlade.Trigger.Fetch("triggername", genericCallback); + +/////////////////////////////////////// +//Timers API invocations +/////////////////////////////////////// +ClearBlade.Timer.Create("timername", {}, genericCallback); +ClearBlade.Timer.Fetch("timername", genericCallback); diff --git a/types/clearbladejs-server/global.d.ts b/types/clearbladejs-server/global.d.ts new file mode 100644 index 0000000000..7f70ed08f7 --- /dev/null +++ b/types/clearbladejs-server/global.d.ts @@ -0,0 +1,5 @@ +declare global { + var ClearBlade: ClearBladeGlobal; +} + +export {}; \ No newline at end of file diff --git a/types/clearbladejs-server/index.d.ts b/types/clearbladejs-server/index.d.ts new file mode 100644 index 0000000000..7333b04cb9 --- /dev/null +++ b/types/clearbladejs-server/index.d.ts @@ -0,0 +1,336 @@ +// Type definitions for clearbladejs Server SDK v1.0.0 +// Project: https://docs.clearblade.com/v/3/4-developer_reference/platformsdk/ClearBlade.js/ +// Definitions by: Jim Bouquet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// +// TypeScript Version: 2.1 + +/// + +interface BasicReq { + readonly isLogging: boolean; + readonly params: { + [id: string]: any; + }; + readonly systemKey: string; + readonly systemSecret: string; + readonly userEmail: string; + readonly userToken: string; + readonly userid: string; +} +type ReqTypes = BasicReq; +declare var req: ReqTypes; +interface Resp { + error(msg: any): never; + success(msg: any): never; +} +declare var resp: Resp; + +declare enum MessagingQOS { + MESSAGING_QOS_AT_MOST_ONCE = 0, + MESSAGING_QOS_AT_LEAST_ONCE = 1, + MESSAGING_QOS_EXACTLY_ONCE = 2 +} + +interface InitOptions { + systemKey: string; + systemSecret: string; + logging?: boolean; + callback?: CbCallback; + authToken?: string; + userToken?: string; + email?: string; + password?: string; + registerUser?: boolean; + useUser?: APIUser; + URI?: string; + messagingURI?: string; + messagingPort?: number; + defaultQoS?: MessagingQOS; + callTimeout?: number; +} + +interface APIUser { + email: string; + authToken: string; + user_id?: string; +} + +interface KeyValuePair { + [key: string]: any; +} + +interface CbCallback { + (error: boolean, response: Resp): void +} + +interface ClearBladeGlobal extends ClearBladeInt { + user: APIUser; +} + +interface ClearBladeInt { + Trigger: TriggerClass; + Timer: TimerClass; + + about(): string; + addToQuery(queryObj: QueryObj, key: string, value: string): void; + addFilterToQuery(queryObj: QueryObj, condition: QueryConditions, key: string, value: QueryValue): void; + addSortToQuery(queryObj: QueryObj, direction: QuerySortDirections, column: string): void; + Code(): Code; + Collection(options: string | CollectionOptionsWithName | CollectionOptionsWithID | CollectionOptionsWithCollection) :Collection; + Deployment(): Deployment; + Device(): Device; + edgeId(): string; + execute(error: Object, response: Object, callback: CbCallback): any; + getAllCollections(callback: CbCallback): void; + http(): Object; + init(options: InitOptions | {request: BasicReq}): void; + isEdge(callback: CbCallback): boolean; + isCurrentUserAuthenticated(callback: CbCallback): void; + isObjectEmpty(obj: Object): boolean; + Item(data: Object, options: string | ItemOptions): Item; + logger(message: string): void; + loginAnon(callback: CbCallback): void; + loginUser(email: string, password: string, callback: CbCallback): void; + logoutUser(callback: CbCallback): void; + makeKVPair(key: string, value: string): KeyValuePair; + Messaging(options: MessagingOptions, callback: CbCallback): Messaging; + newCollection(name: string, callback: CbCallback): void; + Query(options: QueryOptionsWithCollection | QueryOptionsWithName | QueryOptionsWithID): QueryObj; + parseOperationQuery(query: Query): string; + parseQuery(query: Query | QueryObj): string; + registerUser(email: string, password: string, callback: CbCallback): void; + setUser(email: string, authToken: string, userId: string): void; + User(): AppUser; + + createDevice(name: string, data: object, causeTrigger: boolean, callback: CbCallback): void; + deleteDevice(name: string, causeTrigger: boolean, callback: CbCallback): void; + updateDevice(name: string, data: object, causeTrigger: boolean, callback: CbCallback): void; + getDeviceByName(name: string, callback: CbCallback): void; + getAllDevicesForSystem(callback: CbCallback): void; + validateEmailPassword(email: string, password:string): void; +} + +interface CollectionOptionsWithCollection { + collection: string; +} + +interface CollectionOptionsWithName { + collectionName: string; +} + +interface CollectionOptionsWithID { + collectionID: string; +} + +interface Collection { + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + + addColumn(options: Object, callback: CbCallback): void; + dropColumn(name: string, callback: CbCallback): void; + deleteCollection(callback: CbCallback): void; + fetch(query: Query, callback: CbCallback): void; + create(newItem: Item, callback: CbCallback): void; + update(query: Query, changes: Object, callback: CbCallback): void; + remove(query: Query, callback: CbCallback): void; + columns(callback: CbCallback): void; + count(query: Query, callback: CbCallback): void; +} + +declare const enum QuerySortDirections { + QUERY_SORT_ASCENDING = 'ASC', + QUERY_SORT_DESCENDING = 'DESC' +} + +declare const enum QueryConditions { + QUERY_EQUAL = 'EQ', + QUERY_NOTEQUAL = 'NEQ', + QUERY_GREATERTHAN = 'GT', + QUERY_GREATERTHAN_EQUAL = 'GTE', + QUERY_LESSTHAN = 'LT', + QUERY_LESSTHAN_EQUAL = 'LTE', + QUERY_MATCHES = 'RE' +} + +type QueryValue = string|number|boolean; + +interface QueryOptions { + offset?: number; + limit?: number; +} + +interface QueryOptionsWithCollection extends CollectionOptionsWithCollection, QueryOptions{} +interface QueryOptionsWithName extends CollectionOptionsWithName, QueryOptions{} +interface QueryOptionsWithID extends CollectionOptionsWithID, QueryOptions{} + +interface Query { + SELECTCOLUMNS?: string[]; + SORT?: QuerySortDirections; + FILTERS?: QueryFilter[]; + PAGESIZE?: number; + PAGENUM?: number; +} + +interface QueryFilter { + [QueryConditions: string]: QueryFilterValue +} + +interface QueryFilterValue { + [name: string]: QueryValue +} + +interface QueryObj { + id: string; + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + query: Query; + OR: Query[]; + offset: number; + limit: number; + + ascending(field: string): void; + descending(field: string): void; + equalTo(field: string, value: QueryValue): void; + greaterThan(field: string, value: QueryValue): void; + greaterThanEqualTo(field: string, value: QueryValue): void; + lessThan(field: string, value: QueryValue): void; + lessThanEqualTo(field: string, value: QueryValue): void; + notEqualTo(field: string, value: QueryValue): void; + matches(field: string, pattern: QueryValue): void; + or(query: QueryObj): void; + setPage(pageSize: number, pageNum: number): void; + fetch(callback: CbCallback): void; + update(changes: Object, callback: CbCallback): void; + columns(columnsArray: string[]): void; + remove(callback: CbCallback): void; +} + +interface ItemOptions extends CollectionOptionsWithID{} + +interface Item { + data: Object; + + save(): void; + refresh(): void; + destroy(): void; +} + +interface Code { + user: APIUser; + systemKey: string; + systemSecret: string; + + execute(name: string, params: Object, loggingEnabled: boolean, callback: CbCallback): void; + getAllServices(callback: CbCallback): void; +} + +interface DeploymentOptions{} + +interface Deployment { + user: APIUser; + systemKey: string; + systemSecret: string; + + create(name: string, description: string, options: DeploymentOptions, callback: CbCallback): void; + update(name: string, options: DeploymentOptions, callback: CbCallback): void; + delete(name: string, callback: CbCallback): void; + read(name: string, callback: CbCallback): void; + readAll(query: QueryObj, callback: CbCallback): void; +} + +interface AppUser { + user: APIUser; + URI: string; + systemKey: string; + systemSecret: string; + + getUser(callback: CbCallback): void; + setUser(data: Object, callback: CbCallback): void; + setUsers(query: QueryObj, data: Object, callback: CbCallback): void; + allUsers(query: QueryObj, callback: CbCallback): void; + count(query: QueryObj, callback: CbCallback): void; +} + +interface Messaging { + user: APIUser; + systemKey: string; + systemSecret: string; + + getMessageHistoryWithTimeFrame(topic: string, count: number, last: number, start: number, stop: number, callback: CbCallback): void; + getMessageHistory(topic: string, start: number, count: number, callback: CbCallback): void; + getAndDeleteMessageHistory(topic: string, count: number, last: number, start: number, stop: number, callback: CbCallback): void; + getCurrentTopics(callback: CbCallback): void; + publish(topic: string, payload: string | ArrayBuffer): void; +} + +interface MessagingOptions {} + +interface Device { + URI: string; + systemKey: string; + systemSecret: string; + + fetch(query: Query, callback: CbCallback): void; + update(query: Query, changes: Object, callback: CbCallback): void; + delete(query: Query, callback: CbCallback): void; + create(newDevice: Object, callback: CbCallback): void; +} + +declare const enum TriggerModule { + DEVICE = "Device", + Data = "Data", + MESSAGING = "Messaging", + USER = "User" +} + +interface TriggerCreateOptions { + system_key: string; + name: string; + def_module: TriggerModule; + def_name: string; + key_value_pairs: KeyValuePair[]; + service_name: string; +} + +interface TriggerClass { + Create(name: string, options: TriggerCreateOptions, callback: CbCallback): void; + Fetch(name: string, callback: CbCallback): void; +} + +interface TimerCreateOptions { + description?: string; + start_time?: Date; + repeats?: number; + frequency?: number; + service_name?: string; + user_id?: string; + user_token?: string; +} + +interface TimerClass { + Create(name: string, options: TimerCreateOptions, callback: CbCallback): void; + Fetch(name: string, callback: CbCallback): void; +} + +interface TriggerInstance { + name: string; + systemKey: string; + + Update(options: Object, callback: CbCallback): void; + Delete(callback: CbCallback): void; +} + +interface TimerInstance { + name: string; + systemKey: string; + + Update(options: Object, callback: CbCallback): void; + Delete(callback: CbCallback): void; +} + +declare var ClearBlade: ClearBladeGlobal; \ No newline at end of file diff --git a/types/clearbladejs-server/tsconfig.json b/types/clearbladejs-server/tsconfig.json new file mode 100644 index 0000000000..a49f8d53d9 --- /dev/null +++ b/types/clearbladejs-server/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "target": "ES5", + "moduleResolution": "node", + "module": "none", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + ".", + "../", + "../../node_modules/" + ], + "types": ["node"], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "clearbladejs-server-tests.ts", + "global.d.ts" + ], + "exclude": [ + "**/clearbladejs-client/*", + "**/clearbladejs-node/*" + ] +} \ No newline at end of file diff --git a/types/clearbladejs-server/tslint.json b/types/clearbladejs-server/tslint.json new file mode 100644 index 0000000000..a4c53997aa --- /dev/null +++ b/types/clearbladejs-server/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} \ No newline at end of file From fa2aeb93171943bb61604eb3dfa5057bdbc9bc8c Mon Sep 17 00:00:00 2001 From: Tim Niemueller Date: Fri, 6 Apr 2018 00:30:35 +0200 Subject: [PATCH 0463/2153] c3: add missing fields in LegendOptions There is configuration for tiles introduced with https://github.com/c3js/c3/issues/1033 and defined in spec/legend-spec.js which is missing from @types/c3. --- types/c3/c3-tests.ts | 20 ++++++++++++++++++++ types/c3/index.d.ts | 20 +++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/types/c3/c3-tests.ts b/types/c3/c3-tests.ts index 7ac2f0ccd8..f2e630cd09 100644 --- a/types/c3/c3-tests.ts +++ b/types/c3/c3-tests.ts @@ -1798,6 +1798,26 @@ function legend_custom() { }); } +function legend_tiles() { + const chart = c3.generate({ + data: { + columns: [ + ["sample", 30, 200, 100, 400, 150, 250] + ] + }, + legend: { + // amount of padding to put between each legend element + padding: 5, + // define custom height and width for the legend item tile + item: { + tile: { + width: 15, + height: 2 + } + } + }}); +} + ///////////////////// // Tooltip Tests ///////////////////// diff --git a/types/c3/index.d.ts b/types/c3/index.d.ts index a1dfaaf8f0..6c466458e3 100644 --- a/types/c3/index.d.ts +++ b/types/c3/index.d.ts @@ -1,9 +1,10 @@ -// Type definitions for C3js 0.5 +// Type definitions for C3js 0.6 // Project: http://c3js.org/ // Definitions by: Marc Climent // Gerin Jacob // Bernd Hacker // Dzmitry Shyndzin +// Tim Niemueller // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -700,6 +701,10 @@ export interface LegendOptions { y?: number; step?: number; }; + /** + * Padding between legend elements. + */ + padding?: number; item?: { /** @@ -714,6 +719,19 @@ export interface LegendOptions { * Set mouseout event handler to the legend item. */ onmouseout?(id: any): void; + /** + * Tile settings for legend color display. + */ + tile?: { + /** + * Tile width. + */ + width?: number; + /** + * Tile height + */ + height?: number; + } }; } From 3a1f68f9c1f2ccebb1923d34c3930f73d4e1870d Mon Sep 17 00:00:00 2001 From: repl-chris Date: Thu, 5 Apr 2018 16:02:13 -0600 Subject: [PATCH 0464/2153] Added AWSLambda.KinesisDataStream event type definitions (aws-lambda) --- types/aws-lambda/aws-lambda-tests.ts | 24 ++++++++++++++++++++++ types/aws-lambda/index.d.ts | 30 +++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index 2b7b375576..1441c6b794 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -572,6 +572,28 @@ const CloudFrontResponseEvent: AWSLambda.CloudFrontResponseEvent = { ] }; +/* Kinesis Data Stream Events */ +declare let kinesisStreamEvent: AWSLambda.KinesisStreamEvent; +declare let kinesisStreamRecord: AWSLambda.KinesisStreamRecord; +declare let kinesisStreamRecordPayload: AWSLambda.KinesisStreamRecordPayload; + +kinesisStreamRecord = kinesisStreamEvent.Records[0]; + +str = kinesisStreamRecord.awsRegion; +str = kinesisStreamRecord.eventID; +str = kinesisStreamRecord.eventName; +str = kinesisStreamRecord.eventSource; +str = kinesisStreamRecord.eventSourceARN; +str = kinesisStreamRecord.eventVersion; +str = kinesisStreamRecord.invokeIdentityArn; +kinesisStreamRecordPayload = kinesisStreamRecord.kinesis; + +num = kinesisStreamRecordPayload.approximateArrivalTimestamp; +str = kinesisStreamRecordPayload.data; +str = kinesisStreamRecordPayload.kinesisSchemaVersion; +str = kinesisStreamRecordPayload.partitionKey; +str = kinesisStreamRecordPayload.sequenceNumber; + /* Compatibility functions */ context.done(); context.done(error); @@ -661,3 +683,5 @@ let customHandler: AWSLambda.Handler = (event, contex // $ExpectError cb(null, { resultString: bool }); }; + +let kinesisStreamHandler: AWSLambda.KinesisStreamHandler = (event: AWSLambda.KinesisStreamEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index 5802913c37..8da84c6ff3 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -16,6 +16,7 @@ // Danilo Raisi // Simon Buchan // David Hayden +// Chris Redekop // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -529,6 +530,31 @@ export interface CloudFrontRequestEvent { export type CloudFrontResponseResult = undefined | null | CloudFrontResultResponse; +// Kinesis Streams +// https://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-kinesis-streams +export interface KinesisStreamRecordPayload { + approximateArrivalTimestamp: number; + data: string; + kinesisSchemaVersion: string; + partitionKey: string; + sequenceNumber: string; +} + +export interface KinesisStreamRecord { + awsRegion: string; + eventID: string; + eventName: string; + eventSource: string; + eventSourceARN: string; + eventVersion: string; + invokeIdentityArn: string; + kinesis: KinesisStreamRecordPayload; +} + +export interface KinesisStreamEvent { + Records: KinesisStreamRecord[]; +} + /** * AWS Lambda handler function. * http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html @@ -595,7 +621,9 @@ export type CloudFrontRequestCallback = Callback; export type CloudFrontResponseHandler = Handler; export type CloudFrontResponseCallback = Callback; -// TODO: Kinesis (should be very close to DynamoDB stream?) +export type KinesisStreamHandler = Handler; + +// TODO: Kinesis Firehose export type CustomAuthorizerHandler = Handler; export type CustomAuthorizerCallback = Callback; From dd43368fe0a4e6056aac0302a6097c7afc1cfab2 Mon Sep 17 00:00:00 2001 From: Jim Bouquet Date: Thu, 5 Apr 2018 17:47:17 -0500 Subject: [PATCH 0465/2153] Modified tsconfig.json files based on errors received from dtslint. Removed const in enum declarations based on errors received from tsLint --- types/clearbladejs-client/index.d.ts | 6 +++--- types/clearbladejs-client/tsconfig.json | 9 +++------ types/clearbladejs-node/index.d.ts | 12 ++++++------ types/clearbladejs-node/tsconfig.json | 18 ++++++------------ types/clearbladejs-server/index.d.ts | 12 ++++++------ types/clearbladejs-server/tsconfig.json | 11 +++-------- 6 files changed, 27 insertions(+), 41 deletions(-) diff --git a/types/clearbladejs-client/index.d.ts b/types/clearbladejs-client/index.d.ts index 3c7ebd40f1..dcc7048cb8 100644 --- a/types/clearbladejs-client/index.d.ts +++ b/types/clearbladejs-client/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Jim Bouquet // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -// TypeScript Version: 2.1 +// TypeScript Version: 2.4 /// @@ -134,12 +134,12 @@ interface Collection { count(query: Query, callback: CbCallback): void; } -declare const enum QuerySortDirections { +declare enum QuerySortDirections { QUERY_SORT_ASCENDING = "ASC", QUERY_SORT_DESCENDING = "DESC" } -declare const enum QueryConditions { +declare enum QueryConditions { QUERY_EQUAL = "EQ", QUERY_NOTEQUAL = "NEQ", QUERY_GREATERTHAN = "GT", diff --git a/types/clearbladejs-client/tsconfig.json b/types/clearbladejs-client/tsconfig.json index b360802518..7821d7db9e 100644 --- a/types/clearbladejs-client/tsconfig.json +++ b/types/clearbladejs-client/tsconfig.json @@ -1,8 +1,7 @@ { "compilerOptions": { "target": "ES5", - "moduleResolution": "node", - "module": "none", + "module": "commonjs", "lib": [ "es6" ], @@ -12,11 +11,9 @@ "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ - ".", - "../", - "../../node_modules/" + "../" ], - "types": ["node"], + "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, diff --git a/types/clearbladejs-node/index.d.ts b/types/clearbladejs-node/index.d.ts index a80ecc21d5..63b12af7e6 100644 --- a/types/clearbladejs-node/index.d.ts +++ b/types/clearbladejs-node/index.d.ts @@ -1,3 +1,6 @@ +/// +/// + import { Response, RequestCallback } from "request/index"; import { MqttClient, PacketCallback } from "mqtt"; @@ -6,10 +9,7 @@ import { MqttClient, PacketCallback } from "mqtt"; // Definitions by: Jim Bouquet // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -// TypeScript Version: 2.1 - -/// -/// +// TypeScript Version: 2.4 declare enum MessagingQOS { MESSAGING_QOS_AT_MOST_ONCE = 0, @@ -116,12 +116,12 @@ export interface Collection { remove(query: Query, callback: CbCallback): void; } -export declare const enum QuerySortDirections { +export declare enum QuerySortDirections { QUERY_SORT_ASCENDING = 'ASC', QUERY_SORT_DESCENDING = 'DESC' } -export declare const enum QueryConditions { +export declare enum QueryConditions { QUERY_EQUAL = 'EQ', QUERY_NOTEQUAL = 'NEQ', QUERY_GREATERTHAN = 'GT', diff --git a/types/clearbladejs-node/tsconfig.json b/types/clearbladejs-node/tsconfig.json index da91170d85..490278df1e 100644 --- a/types/clearbladejs-node/tsconfig.json +++ b/types/clearbladejs-node/tsconfig.json @@ -2,23 +2,17 @@ "compileOnSave": true, "compilerOptions": { "target": "ES5", - "module": "es6", - "moduleResolution": "Node", + "module": "commonjs", "lib": [ "es6" ], "noImplicitAny": true, - "noImplicitThis": false, - "noStrictGenericChecks": false, - "strictNullChecks": false, - "strictFunctionTypes": false, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": [ - ".", - "../", - "../../node_modules/" - ], - "types": ["node"], + "typeRoots": ["../"], + "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, diff --git a/types/clearbladejs-server/index.d.ts b/types/clearbladejs-server/index.d.ts index 7333b04cb9..178198ce05 100644 --- a/types/clearbladejs-server/index.d.ts +++ b/types/clearbladejs-server/index.d.ts @@ -1,11 +1,11 @@ +/// + // Type definitions for clearbladejs Server SDK v1.0.0 // Project: https://docs.clearblade.com/v/3/4-developer_reference/platformsdk/ClearBlade.js/ // Definitions by: Jim Bouquet // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -// TypeScript Version: 2.1 - -/// +// TypeScript Version: 2.4 interface BasicReq { readonly isLogging: boolean; @@ -140,12 +140,12 @@ interface Collection { count(query: Query, callback: CbCallback): void; } -declare const enum QuerySortDirections { +declare enum QuerySortDirections { QUERY_SORT_ASCENDING = 'ASC', QUERY_SORT_DESCENDING = 'DESC' } -declare const enum QueryConditions { +declare enum QueryConditions { QUERY_EQUAL = 'EQ', QUERY_NOTEQUAL = 'NEQ', QUERY_GREATERTHAN = 'GT', @@ -281,7 +281,7 @@ interface Device { create(newDevice: Object, callback: CbCallback): void; } -declare const enum TriggerModule { +declare enum TriggerModule { DEVICE = "Device", Data = "Data", MESSAGING = "Messaging", diff --git a/types/clearbladejs-server/tsconfig.json b/types/clearbladejs-server/tsconfig.json index a49f8d53d9..b549e1c685 100644 --- a/types/clearbladejs-server/tsconfig.json +++ b/types/clearbladejs-server/tsconfig.json @@ -1,8 +1,7 @@ { "compilerOptions": { "target": "ES5", - "moduleResolution": "node", - "module": "none", + "module": "commonjs", "lib": [ "es6" ], @@ -11,12 +10,8 @@ "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": [ - ".", - "../", - "../../node_modules/" - ], - "types": ["node"], + "typeRoots": ["../"], + "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, From c976361bf6f980c67a87dd32b3d4720f2ce6e15b Mon Sep 17 00:00:00 2001 From: Joshua Goldberg Date: Thu, 5 Apr 2018 16:21:15 -0700 Subject: [PATCH 0466/2153] Hackily added toMatch to expect-puppeteer --- types/expect-puppeteer/expect-puppeteer-tests.ts | 3 +++ types/expect-puppeteer/index.d.ts | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/types/expect-puppeteer/expect-puppeteer-tests.ts b/types/expect-puppeteer/expect-puppeteer-tests.ts index 979c34394d..84a7e65486 100644 --- a/types/expect-puppeteer/expect-puppeteer-tests.ts +++ b/types/expect-puppeteer/expect-puppeteer-tests.ts @@ -10,6 +10,9 @@ const testGlobal = async (instance: ElementHandle | Page) => { await expect(instance).toFill("selector", "value"); await expect(instance).toFill("selector", "value", { polling: 777 }); + await expect(instance).toMatch("selector"); + await expect(instance).toMatch("selector", { timeout: 777 }); + await expect(instance).toMatchElement("selector", "value"); await expect(instance).toMatchElement("selector", "value", { polling: "mutation" }); diff --git a/types/expect-puppeteer/index.d.ts b/types/expect-puppeteer/index.d.ts index 12f19c785d..ce20675d37 100644 --- a/types/expect-puppeteer/index.d.ts +++ b/types/expect-puppeteer/index.d.ts @@ -36,9 +36,12 @@ interface ExpectToClickOptions extends ExpectTimingActions { } interface ExpectPuppeteer { + // These must all match the ExpectPuppeteer interface above. + // We can't extend from it directly because some method names conflict in type-incompatible ways. toClick(selector: string, options?: ExpectToClickOptions): Promise; toDisplayDialog(block: () => Promise): Promise; toFill(selector: string, value: string, options?: ExpectTimingActions): Promise; + toMatch(selector: string, options?: ExpectTimingActions): Promise; toMatchElement(selector: string, value: string, options?: ExpectTimingActions): Promise; toSelect(selector: string, valueOrText: string, options?: ExpectTimingActions): Promise; toUploadFile(selector: string, filePath: string, options?: ExpectTimingActions): Promise; @@ -47,7 +50,17 @@ interface ExpectPuppeteer { declare global { namespace jest { // tslint:disable-next-line no-empty-interface - interface Matchers extends ExpectPuppeteer { } + interface Matchers { + // These must all match the ExpectPuppeteer interface above. + // We can't extend from it directly because some method names conflict in type-incompatible ways. + toClick(selector: string, options?: ExpectToClickOptions): Promise; + toDisplayDialog(block: () => Promise): Promise; + toFill(selector: string, value: string, options?: ExpectTimingActions): Promise; + toMatch(selector: string, options?: ExpectTimingActions): Promise; + toMatchElement(selector: string, value: string, options?: ExpectTimingActions): Promise; + toSelect(selector: string, valueOrText: string, options?: ExpectTimingActions): Promise; + toUploadFile(selector: string, filePath: string, options?: ExpectTimingActions): Promise; + } } } From f4788e7c6a9c875db621831030c2c5524dcee4f0 Mon Sep 17 00:00:00 2001 From: Jim Bouquet Date: Thu, 5 Apr 2018 18:34:12 -0500 Subject: [PATCH 0467/2153] Made changes to fix build issues --- types/clearbladejs-client/index.d.ts | 1 - types/clearbladejs-node/clearbladejs-node-tests.ts | 3 --- types/clearbladejs-node/index.d.ts | 13 ++++++------- types/clearbladejs-node/tsconfig.json | 3 +-- types/clearbladejs-server/index.d.ts | 5 ++--- 5 files changed, 9 insertions(+), 16 deletions(-) diff --git a/types/clearbladejs-client/index.d.ts b/types/clearbladejs-client/index.d.ts index dcc7048cb8..44dd355213 100644 --- a/types/clearbladejs-client/index.d.ts +++ b/types/clearbladejs-client/index.d.ts @@ -2,7 +2,6 @@ // Project: https://github.com/ClearBlade/JavaScript-API // Definitions by: Jim Bouquet // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// // TypeScript Version: 2.4 /// diff --git a/types/clearbladejs-node/clearbladejs-node-tests.ts b/types/clearbladejs-node/clearbladejs-node-tests.ts index b600332ca2..18cd509cc7 100644 --- a/types/clearbladejs-node/clearbladejs-node-tests.ts +++ b/types/clearbladejs-node/clearbladejs-node-tests.ts @@ -1,9 +1,6 @@ import { ClearBlade, Resp, QuerySortDirections, QueryConditions } from "."; // Sample code for clearbladejs Node SDK v1.0.0 used to test typescript definitions -// Project: https://github.com/ClearBlade/Node-SDK -// Definitions by: Jim Bouquet -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped const constants = require("./constants.json"); diff --git a/types/clearbladejs-node/index.d.ts b/types/clearbladejs-node/index.d.ts index 63b12af7e6..9efea47430 100644 --- a/types/clearbladejs-node/index.d.ts +++ b/types/clearbladejs-node/index.d.ts @@ -1,16 +1,15 @@ +// Type definitions for clearbladejs Node SDK v1.0.0 +// Project: https://github.com/ClearBlade/Node-SDK +// Definitions by: Jim Bouquet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + /// /// import { Response, RequestCallback } from "request/index"; import { MqttClient, PacketCallback } from "mqtt"; -// Type definitions for clearbladejs Node SDK v1.0.0 -// Project: https://github.com/ClearBlade/Node-SDK -// Definitions by: Jim Bouquet -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// -// TypeScript Version: 2.4 - declare enum MessagingQOS { MESSAGING_QOS_AT_MOST_ONCE = 0, MESSAGING_QOS_AT_LEAST_ONCE = 1, diff --git a/types/clearbladejs-node/tsconfig.json b/types/clearbladejs-node/tsconfig.json index 490278df1e..67aea82d3f 100644 --- a/types/clearbladejs-node/tsconfig.json +++ b/types/clearbladejs-node/tsconfig.json @@ -18,8 +18,7 @@ }, "files": [ "index.d.ts", - "clearbladejs-node-tests.ts", - "../../node_modules/mqtt/types/index.d.ts" + "clearbladejs-node-tests.ts" ], "exclude": [ "**/clearbladejs-client/*", diff --git a/types/clearbladejs-server/index.d.ts b/types/clearbladejs-server/index.d.ts index 178198ce05..2c3a0845b4 100644 --- a/types/clearbladejs-server/index.d.ts +++ b/types/clearbladejs-server/index.d.ts @@ -1,12 +1,11 @@ -/// - // Type definitions for clearbladejs Server SDK v1.0.0 // Project: https://docs.clearblade.com/v/3/4-developer_reference/platformsdk/ClearBlade.js/ // Definitions by: Jim Bouquet // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// // TypeScript Version: 2.4 +/// + interface BasicReq { readonly isLogging: boolean; readonly params: { From b5444aab1873c752298813cb4ea06f5df68e43e6 Mon Sep 17 00:00:00 2001 From: Lucas Serven Date: Fri, 6 Apr 2018 08:34:37 +0200 Subject: [PATCH 0468/2153] types: add react-webcam --- types/react-webcam/index.d.ts | 38 +++++++++++++++++++++++ types/react-webcam/react-webcam-tests.tsx | 29 +++++++++++++++++ types/react-webcam/tsconfig.json | 25 +++++++++++++++ types/react-webcam/tslint.json | 1 + 4 files changed, 93 insertions(+) create mode 100644 types/react-webcam/index.d.ts create mode 100644 types/react-webcam/react-webcam-tests.tsx create mode 100644 types/react-webcam/tsconfig.json create mode 100644 types/react-webcam/tslint.json diff --git a/types/react-webcam/index.d.ts b/types/react-webcam/index.d.ts new file mode 100644 index 0000000000..5bb6337838 --- /dev/null +++ b/types/react-webcam/index.d.ts @@ -0,0 +1,38 @@ +// Type definitions for react-webcam 0.3 +// Project: https://github.com/mozmorris/react-webcam +// Definitions by: Lucas Servén Marín +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from 'react'; + +export = Webcam; + +declare class Webcam extends React.Component { + private static mountedInstances: Webcam[]; + private static userMediaRequested: boolean; + getScreenshot(): string|null; + getCanvas(): HTMLCanvasElement|null; + requestUserMedia(): void; + handleUserMedia(error: Error, stream: MediaStream): void; +} + +declare namespace Webcam { + interface WebcamProps { + audio?: boolean; + muted?: boolean; + height?: number|string; + width?: number|string; + screenshotFormat?: 'image/jpeg' | 'image/png' | 'image/webp'; + style?: React.CSSProperties; + className?: string; + audioSource?: string; + videoSource?: string; + onUserMedia?(): void; + } + + interface WebcamState { + hasUserMedia: boolean; + src?: string; + } +} diff --git a/types/react-webcam/react-webcam-tests.tsx b/types/react-webcam/react-webcam-tests.tsx new file mode 100644 index 0000000000..6a28fb9ba7 --- /dev/null +++ b/types/react-webcam/react-webcam-tests.tsx @@ -0,0 +1,29 @@ +import * as React from "react"; +import Webcam = require("react-webcam"); + +export class ReactWebcamTest extends React.Component { + private webcam: Webcam; + + setRef = (webcam: Webcam) => { + this.webcam = webcam; + } + + capture = () => { + const imageSrc = this.webcam.getScreenshot(); + } + + render() { + return ( +
    + + +
    + ); + } +} diff --git a/types/react-webcam/tsconfig.json b/types/react-webcam/tsconfig.json new file mode 100644 index 0000000000..b48e4757e4 --- /dev/null +++ b/types/react-webcam/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-webcam-tests.tsx" + ] +} diff --git a/types/react-webcam/tslint.json b/types/react-webcam/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-webcam/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From cac060e93607116d7e6883bd8e812724262dd703 Mon Sep 17 00:00:00 2001 From: RalfNieuwenhuizen Date: Fri, 6 Apr 2018 09:06:43 +0200 Subject: [PATCH 0469/2153] ListHeaderComponent can also be a rendered element --- types/react-native/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 8323779057..a248fd3010 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -3715,7 +3715,7 @@ export interface SectionListProperties extends VirtualizedListProperties< /** * Rendered at the very beginning of the list. */ - ListHeaderComponent?: React.ComponentClass | (() => React.ReactElement) | null; + ListHeaderComponent?: React.ComponentClass | React.ReactElement | (() => React.ReactElement) | null; /** * Rendered in between each section. From 50cda51a519eeb3c7c45e0037a03c18044b5a393 Mon Sep 17 00:00:00 2001 From: euxn23 Date: Fri, 6 Apr 2018 16:25:07 +0900 Subject: [PATCH 0470/2153] Add node to browser name type --- types/detect-browser/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/detect-browser/index.d.ts b/types/detect-browser/index.d.ts index 351067ff59..4395539aa0 100644 --- a/types/detect-browser/index.d.ts +++ b/types/detect-browser/index.d.ts @@ -18,7 +18,8 @@ export type BrowserName = "phantomjs" | "safari" | "vivaldi" | - "yandexbrowser"; + "yandexbrowser" | + "node"; export function detect(): null | { name: BrowserName | "node"; From 6ab85a3e068817ea9e65a686b8ab7360b541bbba Mon Sep 17 00:00:00 2001 From: euxn23 Date: Fri, 6 Apr 2018 16:25:11 +0900 Subject: [PATCH 0471/2153] Detect-browser/add browser info type --- types/detect-browser/index.d.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/types/detect-browser/index.d.ts b/types/detect-browser/index.d.ts index 4395539aa0..22d6bf9c17 100644 --- a/types/detect-browser/index.d.ts +++ b/types/detect-browser/index.d.ts @@ -21,8 +21,10 @@ export type BrowserName = "yandexbrowser" | "node"; -export function detect(): null | { - name: BrowserName | "node"; +export interface BrowserInfo { + name: BrowserName; version: string; os: string; -}; +} + +export function detect(): null | BrowserInfo; From c5648fb940138f33a03f8c1ef67e877bb999280b Mon Sep 17 00:00:00 2001 From: Jim Bouquet Date: Fri, 6 Apr 2018 06:51:33 -0500 Subject: [PATCH 0472/2153] Removed references to mqtt library --- types/clearbladejs-node/index.d.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/types/clearbladejs-node/index.d.ts b/types/clearbladejs-node/index.d.ts index 9efea47430..bef502bb00 100644 --- a/types/clearbladejs-node/index.d.ts +++ b/types/clearbladejs-node/index.d.ts @@ -5,10 +5,9 @@ // TypeScript Version: 2.4 /// -/// import { Response, RequestCallback } from "request/index"; -import { MqttClient, PacketCallback } from "mqtt"; +//import {//PacketCallback } from "mqtt"; declare enum MessagingQOS { MESSAGING_QOS_AT_MOST_ONCE = 0, @@ -224,12 +223,12 @@ export interface Messaging { URI: string; systemKey: string; systemSecret: string; - client: MqttClient; + client: Object; getMessageHistory(topic: string, startTime: number, count: number, callback: CbCallback): void; publish(topic: string, payload: Object): void; subscribe(topic: string, options: MessagingSubscribeOptions, messageCallback: MessageCallback): void; - unsubscribe(topic: string, callback?: PacketCallback): void; + unsubscribe(topic: string, callback?: (error?: Error, packet?: Object) => any): void; } export interface CommonMessagingProperties { From 0c25a88d7693761d6b1a6afaf27815a9455d0c7a Mon Sep 17 00:00:00 2001 From: AndersonFriaca Date: Fri, 6 Apr 2018 09:12:23 -0400 Subject: [PATCH 0473/2153] Adjustments --- types/jquery-countto/index.d.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/types/jquery-countto/index.d.ts b/types/jquery-countto/index.d.ts index a815340d0b..babeb7741b 100644 --- a/types/jquery-countto/index.d.ts +++ b/types/jquery-countto/index.d.ts @@ -6,47 +6,47 @@ /// -export interface Options { +export type Options = Partial<{ /** * The number to start counting from */ - from?: number; + from: number; /** * The number to stop counting at */ - to?: number; + to: number; /** * The number of milliseconds it should take to finish counting */ - speed?: number; + speed: number; /** - * he number of milliseconds to wait between refreshing the counter + * The number of milliseconds to wait between refreshing the counter */ - refreshInterval?: number; + refreshInterval: number; /** * The number of decimal places to show when using the default formatter */ - decimals?: number; + decimals: number; /** * A handler that is used to format the current value before rendering to the DOM */ - formatter?: (value: number, options: Options) => string; + formatter: (value: number, options: Options) => string; /** * A callback function that is triggered for every iteration that the counter updates */ - onUpdate?: (value: number) => void; + onUpdate: (value: number) => void; /** * A callback function that is triggered when counting finishes */ - onComplete?: (value: number) => void; -} + onComplete: (value: number) => void; +}>; export type Method = 'start' | 'stop' | 'toggle' | 'restart'; From 391d67f6d71d8e2991cc29572098a36207cd7c7e Mon Sep 17 00:00:00 2001 From: Janeene Beeforth Date: Sat, 7 Apr 2018 00:04:54 +1000 Subject: [PATCH 0474/2153] [jest-image-snapshot]: New type definitions. --- types/jest-image-snapshot/index.d.ts | 75 +++++++++++++++++++ .../jest-image-snapshot-tests.ts | 23 ++++++ types/jest-image-snapshot/tsconfig.json | 23 ++++++ types/jest-image-snapshot/tslint.json | 1 + 4 files changed, 122 insertions(+) create mode 100644 types/jest-image-snapshot/index.d.ts create mode 100644 types/jest-image-snapshot/jest-image-snapshot-tests.ts create mode 100644 types/jest-image-snapshot/tsconfig.json create mode 100644 types/jest-image-snapshot/tslint.json diff --git a/types/jest-image-snapshot/index.d.ts b/types/jest-image-snapshot/index.d.ts new file mode 100644 index 0000000000..c15e435cc9 --- /dev/null +++ b/types/jest-image-snapshot/index.d.ts @@ -0,0 +1,75 @@ +// Type definitions for jest-image-snapshot 2.4 +// Project: https://github.com/americanexpress/jest-image-snapshot#readme +// Definitions by: Janeene Beeforth +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +/** + * Options to be passed to the 'pixelmatch' image diffing function. + */ +export interface PixelmatchOptions { + /** Matching threshold, ranges from 0 to 1. Smaller values make the comparison more sensitive. 0.1 by default. */ + readonly threshold?: number; + /** If true, disables detecting and ignoring anti-aliased pixels. false by default. */ + readonly includeAA?: boolean; +} + +export interface MatchImageSnapshotOptions { + /** + * Custom config passed to 'pixelmatch' + */ + customDiffConfig?: PixelmatchOptions; + /** + * Custom snapshots directory. + * Absolute path of a directory to keep the snapshot in. + */ + customSnapshotsDir?: string; + /** + * A custom name to give this snapshot. If not provided, one is computed automatically. + */ + customSnapshotIdentifier?: string; + /** + * Removes coloring from the console output, useful if storing the results to a file. + * Defaults to false. + */ + noColors?: boolean; + /** + * Sets the threshold that would trigger a test failure based on the failureThresholdType selected. This is different + * to the customDiffConfig.threshold above - the customDiffConfig.threshold is the per pixel failure threshold, whereas + * this is the failure threshold for the entire comparison. + * Defaults to 0. + */ + failureThreshold?: number; + /** + * Sets the type of threshold that would trigger a failure. + * Defaults to 'pixel'. + */ + failureThresholdType?: 'pixel' | 'percent'; +} + +/** + * Function to be passed to jest's expect.extend. + * Example: + * import { toMatchImageSnapshot } from 'jest-image-snapshot'; + * expect.extend({ toMatchImageSnapshot }); + */ +export function toMatchImageSnapshot(): { message(): string; pass: boolean; }; + +/** + * Configurable function that can be passed to jest's expect.extend. + * Example: + * import { configureToMatchImageSnapshot } from 'jest-image-snapshot'; + * const toMatchImageSnapshot = configureToMatchImageSnapshot({ noColors: true }); + * expect.extend({ toMatchImageSnapshot }); + */ +export function configureToMatchImageSnapshot(options: MatchImageSnapshotOptions): () => { message(): string; pass: boolean; }; + +declare global { + namespace jest { + interface Matchers { + toMatchImageSnapshot(): R; + } + } +} diff --git a/types/jest-image-snapshot/jest-image-snapshot-tests.ts b/types/jest-image-snapshot/jest-image-snapshot-tests.ts new file mode 100644 index 0000000000..a2ccb8c777 --- /dev/null +++ b/types/jest-image-snapshot/jest-image-snapshot-tests.ts @@ -0,0 +1,23 @@ +// Typescript Version: 2.3 +import { toMatchImageSnapshot, configureToMatchImageSnapshot } from 'jest-image-snapshot'; + +it('should be able to use toMatchImageSnapshot in a test', () => { + expect.extend({ toMatchImageSnapshot }); + + expect(400).toMatchImageSnapshot(); +}); + +it('should be able to use configureToMatchImageSnapshot in a test', () => { + const matchFn = configureToMatchImageSnapshot({ + noColors: true, + customDiffConfig: { + threshold: 5, + includeAA: false + }, + failureThreshold: 10, + failureThresholdType: 'percent' + }); + expect.extend({ toMatchImageSnapshot: matchFn }); + + expect('Me').toMatchImageSnapshot(); +}); diff --git a/types/jest-image-snapshot/tsconfig.json b/types/jest-image-snapshot/tsconfig.json new file mode 100644 index 0000000000..5bf932371d --- /dev/null +++ b/types/jest-image-snapshot/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jest-image-snapshot-tests.ts" + ] +} diff --git a/types/jest-image-snapshot/tslint.json b/types/jest-image-snapshot/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jest-image-snapshot/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From e204ccc77f0a0425bcc1dbca2a3977123cf022d3 Mon Sep 17 00:00:00 2001 From: Janeene Beeforth Date: Sat, 7 Apr 2018 00:16:20 +1000 Subject: [PATCH 0475/2153] [jest-specific-snapshot]: New definition. --- types/jest-specific-snapshot/index.d.ts | 27 +++++++++++++++++++ .../jest-specific-snapshot-tests.ts | 16 +++++++++++ types/jest-specific-snapshot/tsconfig.json | 23 ++++++++++++++++ types/jest-specific-snapshot/tslint.json | 1 + 4 files changed, 67 insertions(+) create mode 100644 types/jest-specific-snapshot/index.d.ts create mode 100644 types/jest-specific-snapshot/jest-specific-snapshot-tests.ts create mode 100644 types/jest-specific-snapshot/tsconfig.json create mode 100644 types/jest-specific-snapshot/tslint.json diff --git a/types/jest-specific-snapshot/index.d.ts b/types/jest-specific-snapshot/index.d.ts new file mode 100644 index 0000000000..ef0e7f4225 --- /dev/null +++ b/types/jest-specific-snapshot/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for jest-specific-snapshot 0.5 +// Project: https://github.com/igor-dv/jest-specific-snapshot#readme +// Definitions by: Janeene Beeforth +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/// + +declare global { + namespace jest { + interface Matchers { + toMatchSpecificSnapshot(snapshotFilename: string): R; + } + } +} + +/** + * Specify the serializer that should be used by toMatchSpecificSnapshot. + * Note: toMatchSpecificSnapshot ignores the existing jest snapshot serializer settings. If you want to use a custom serializer, + * you need to set it via this addSerializer function. + */ +export function addSerializer(serializer: any): void; + +/** + * This is used to create a customized version of toMatchSpecificSnapshot. + */ +export function toMatchSpecificSnapshot(data: any, snapshotFile: string, testName: string): () => { message(): string; pass: boolean; }; diff --git a/types/jest-specific-snapshot/jest-specific-snapshot-tests.ts b/types/jest-specific-snapshot/jest-specific-snapshot-tests.ts new file mode 100644 index 0000000000..046a563c9e --- /dev/null +++ b/types/jest-specific-snapshot/jest-specific-snapshot-tests.ts @@ -0,0 +1,16 @@ +import { addSerializer, toMatchSpecificSnapshot } from 'jest-specific-snapshot'; +import toJson from 'enzyme-to-json'; + +expect(100).toMatchSpecificSnapshot('mySnapshotFile.snap'); + +addSerializer(toJson); + +function doSomeThing(received: any) { + return received; +} +expect.extend({ + toMatchDecoratedSpecificSnapshot(received, snapshotFile) { + const data = doSomeThing(received); + return toMatchSpecificSnapshot.call(this, data, snapshotFile); + } +}); diff --git a/types/jest-specific-snapshot/tsconfig.json b/types/jest-specific-snapshot/tsconfig.json new file mode 100644 index 0000000000..e4156ae2ff --- /dev/null +++ b/types/jest-specific-snapshot/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jest-specific-snapshot-tests.ts" + ] +} diff --git a/types/jest-specific-snapshot/tslint.json b/types/jest-specific-snapshot/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jest-specific-snapshot/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 26b07e5960e1e592bd5222c6f20b2a852b35e2ec Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 6 Apr 2018 09:06:44 -0700 Subject: [PATCH 0476/2153] rot-js: Remove empty jsdoc comments (#24768) --- types/rot-js/index.d.ts | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/types/rot-js/index.d.ts b/types/rot-js/index.d.ts index e57d243755..44eeab7698 100644 --- a/types/rot-js/index.d.ts +++ b/types/rot-js/index.d.ts @@ -97,25 +97,15 @@ export const VK_PRINTSCREEN: number; export const VK_INSERT: number; /** Del(ete) key. */ export const VK_DELETE: number; -/***/ export const VK_0: number; -/***/ export const VK_1: number; -/***/ export const VK_2: number; -/***/ export const VK_3: number; -/***/ export const VK_4: number; -/***/ export const VK_5: number; -/***/ export const VK_6: number; -/***/ export const VK_7: number; -/***/ export const VK_8: number; -/***/ export const VK_9: number; /** Colon (:) key. Requires Gecko 15.0 */ export const VK_COLON: number; @@ -131,59 +121,32 @@ export const VK_GREATER_THAN: number; export const VK_QUESTION_MARK: number; /** Atmark (@) key. Requires Gecko 15.0 */ export const VK_AT: number; -/***/ export const VK_A: number; -/***/ export const VK_B: number; -/***/ export const VK_C: number; -/***/ export const VK_D: number; -/***/ export const VK_E: number; -/***/ export const VK_F: number; -/***/ export const VK_G: number; -/***/ export const VK_H: number; -/***/ export const VK_I: number; -/***/ export const VK_J: number; -/***/ export const VK_K: number; -/***/ export const VK_L: number; -/***/ export const VK_M: number; -/***/ export const VK_N: number; -/***/ export const VK_O: number; -/***/ export const VK_P: number; -/***/ export const VK_Q: number; -/***/ export const VK_R: number; -/***/ export const VK_S: number; -/***/ export const VK_T: number; -/***/ export const VK_U: number; -/***/ export const VK_V: number; -/***/ export const VK_W: number; -/***/ export const VK_X: number; -/***/ export const VK_Y: number; -/***/ export const VK_Z: number; -/***/ export const VK_CONTEXT_MENU: number; /** 0 on the numeric keypad. */ export const VK_NUMPAD0: number; @@ -209,7 +172,6 @@ export const VK_NUMPAD9: number; export const VK_MULTIPLY: number; /** + on the numeric keypad. */ export const VK_ADD: number; -/***/ export const VK_SEPARATOR: number; /** - on the numeric keypad. */ export const VK_SUBTRACT: number; From c974fcb070bf9f90f61ee5ff611ee8a0d8fa5749 Mon Sep 17 00:00:00 2001 From: emzeroit Date: Fri, 6 Apr 2018 14:32:25 -0300 Subject: [PATCH 0477/2153] [@types/node] Added authorization property to IncomingHttpHeaders. --- types/node/v8/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index 1697093de7..fb70650458 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -943,6 +943,7 @@ declare module "http" { 'access-control-allow-headers'?: string; 'accept-patch'?: string; 'accept-ranges'?: string; + 'authorization'?: string; 'age'?: string; 'allow'?: string; 'alt-svc'?: string; From 5f2ef68fae908eb4e24335807683d0385e5b5598 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Fri, 6 Apr 2018 13:39:02 -0400 Subject: [PATCH 0478/2153] Add whatwg-mimetype definition. --- types/whatwg-mimetype/index.d.ts | 22 +++++++++++++++++ types/whatwg-mimetype/tsconfig.json | 23 ++++++++++++++++++ types/whatwg-mimetype/tslint.json | 1 + .../whatwg-mimetype/whatwg-mimetype-tests.ts | 24 +++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 types/whatwg-mimetype/index.d.ts create mode 100644 types/whatwg-mimetype/tsconfig.json create mode 100644 types/whatwg-mimetype/tslint.json create mode 100644 types/whatwg-mimetype/whatwg-mimetype-tests.ts diff --git a/types/whatwg-mimetype/index.d.ts b/types/whatwg-mimetype/index.d.ts new file mode 100644 index 0000000000..b30fe64f67 --- /dev/null +++ b/types/whatwg-mimetype/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for whatwg-mimetype 2.1 +// Project: https://github.com/jsdom/whatwg-mimetype#readme +// Definitions by: Pete Johanson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = MIMEType; + +declare class MIMEType { + type: string; + subtype: string; + + readonly essence: string; + readonly parameters: Map; + + static parse(s: string): MIMEType | null; + + constructor(s: string); + + isHTML(): boolean; + isXML(): boolean; + isJavaScript(opts?: { allowParameters?: boolean }): boolean; +} diff --git a/types/whatwg-mimetype/tsconfig.json b/types/whatwg-mimetype/tsconfig.json new file mode 100644 index 0000000000..ca1583f063 --- /dev/null +++ b/types/whatwg-mimetype/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "whatwg-mimetype-tests.ts" + ] +} diff --git a/types/whatwg-mimetype/tslint.json b/types/whatwg-mimetype/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/whatwg-mimetype/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/whatwg-mimetype/whatwg-mimetype-tests.ts b/types/whatwg-mimetype/whatwg-mimetype-tests.ts new file mode 100644 index 0000000000..5b5ab0f8ab --- /dev/null +++ b/types/whatwg-mimetype/whatwg-mimetype-tests.ts @@ -0,0 +1,24 @@ +/// +import assert = require("assert"); +import MIMEType = require('whatwg-mimetype'); + +const mt = MIMEType.parse("text/plain"); + +assert(mt !== null); +if (mt) { + assert(mt.type === "text"); + assert(mt.subtype === "plain"); + assert(mt.essence === "text/plain"); + assert(mt.parameters.size === 0); + assert(!mt.isXML()); + assert(!mt.isHTML()); + assert(!mt.isJavaScript()); +} + +const mt2 = new MIMEType("application/javascript; charset=utf8"); + +assert(mt2.type === "text"); +assert(mt2.subtype === "plain"); +assert(mt2.essence === "text/plain"); +assert(mt2.parameters.get("charset") === "utf8"); +assert(mt2.isJavaScript({ allowParameters: true })); From bfaaf9272a60229befd27456d6ddde37ed8e80b5 Mon Sep 17 00:00:00 2001 From: Jim Bouquet Date: Fri, 6 Apr 2018 16:15:11 -0500 Subject: [PATCH 0479/2153] Modified tslint.json files to enable most rules. Cleaned up code to remove lint errors. --- .../clearbladejs-client-tests.ts | 72 +++++++-------- types/clearbladejs-client/global.d.ts | 2 +- types/clearbladejs-client/index.d.ts | 48 +++++----- types/clearbladejs-client/tslint.json | 74 +--------------- .../clearbladejs-node-tests.ts | 69 ++++++++------- types/clearbladejs-node/index.d.ts | 87 +++++++++---------- types/clearbladejs-node/tslint.json | 74 +--------------- .../clearbladejs-server-tests.ts | 72 +++++++-------- types/clearbladejs-server/global.d.ts | 2 +- types/clearbladejs-server/index.d.ts | 74 ++++++++-------- types/clearbladejs-server/tslint.json | 75 +--------------- 11 files changed, 211 insertions(+), 438 deletions(-) diff --git a/types/clearbladejs-client/clearbladejs-client-tests.ts b/types/clearbladejs-client/clearbladejs-client-tests.ts index 9aece4b19a..bce39bee2a 100644 --- a/types/clearbladejs-client/clearbladejs-client-tests.ts +++ b/types/clearbladejs-client/clearbladejs-client-tests.ts @@ -1,12 +1,12 @@ -// Testing type definitions for clearbladejs Client SDK v1.0.0 +// Testing type definitions for clearbladejs-client 1.0 // Project: https://github.com/ClearBlade/JavaScript-API -// Definitions by: Jim Bouquet +// Definitions by: Jim Bouquet // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -var genericCallback = function(error: boolean, response: Resp) {}; +let genericCallback = (error: boolean, response: Resp) => {}; /////////////////////////////////////// -//ClearBlade object API invocations +// ClearBlade object API invocations /////////////////////////////////////// ClearBlade.init({ systemKey: "abcdef", @@ -24,34 +24,34 @@ ClearBlade.loginUserMqtt("test@test.com", "password", genericCallback); ClearBlade.sendPush(["user1", "user2"], {data: "Test"}, "appId: string", genericCallback); ClearBlade.getAllCollections(genericCallback); -var coll1 = ClearBlade.Collection("collectionID"); -var coll2 = ClearBlade.Collection({ collectionName: "collectionName" }); -var coll3 = ClearBlade.Collection({ collectionID: "collectionID" }); +let coll1 = ClearBlade.Collection("collectionID"); +let coll2 = ClearBlade.Collection({ collectionName: "collectionName" }); +let coll3 = ClearBlade.Collection({ collectionID: "collectionID" }); -var query1 = ClearBlade.Query("collectionID"); -var query2 = ClearBlade.Query({ offset: 5, limit: 5, collectionID: "collectionID" }); -var query3 = ClearBlade.Query({ collectionName: "collectionName" }); +let query1 = ClearBlade.Query("collectionID"); +let query2 = ClearBlade.Query({ offset: 5, limit: 5, collectionID: "collectionID" }); +let query3 = ClearBlade.Query({ collectionName: "collectionName" }); -var item1 = ClearBlade.Item({}, "collectionID"); -var item2 = ClearBlade.Item({}, { collectionID: "collectionID" }); +let item1 = ClearBlade.Item({}, "collectionID"); +let item2 = ClearBlade.Item({}, { collectionID: "collectionID" }); -var code = ClearBlade.Code(); -var user = ClearBlade.User(); +let code = ClearBlade.Code(); +let user = ClearBlade.User(); -var messaging = ClearBlade.Messaging({}, genericCallback); -var stats = ClearBlade.MessagingStats(); +let messaging = ClearBlade.Messaging({}, genericCallback); +let stats = ClearBlade.MessagingStats(); -var edge = ClearBlade.Edge(); -var metrics = ClearBlade.Metrics(); -var device = ClearBlade.Device(); -var analytics = ClearBlade.Analytics(); -var portal = ClearBlade.Portal("MyPortal"); -var triggers = ClearBlade.Triggers(); +let edge = ClearBlade.Edge(); +let metrics = ClearBlade.Metrics(); +let device = ClearBlade.Device(); +let analytics = ClearBlade.Analytics(); +let portal = ClearBlade.Portal("MyPortal"); +let triggers = ClearBlade.Triggers(); ClearBlade.getEdges(query1.query, genericCallback); /////////////////////////////////////// -//Collection API invocations +// Collection API invocations /////////////////////////////////////// coll1.fetch(query1.query, genericCallback); coll1.create(ClearBlade.Item({}, ""), genericCallback); @@ -61,7 +61,7 @@ coll1.columns(genericCallback); coll1.count(query1.query, genericCallback); /////////////////////////////////////// -//Query API invocations +// Query API invocations /////////////////////////////////////// query1.addSortToQuery( query1, @@ -91,14 +91,14 @@ query1.columns([]); query1.remove(genericCallback); /////////////////////////////////////// -//Item API invocations +// Item API invocations /////////////////////////////////////// item1.save(genericCallback); item1.refresh(genericCallback); item1.destroy(genericCallback); /////////////////////////////////////// -//Code API invocations +// Code API invocations /////////////////////////////////////// code.create("codeName", "body: string", genericCallback); code.update("codeName", "body: string", genericCallback); @@ -109,7 +109,7 @@ code.getFailedServices(genericCallback); code.getAllServices(genericCallback); /////////////////////////////////////// -//User API invocations +// User API invocations /////////////////////////////////////// user.getUser(genericCallback); user.setUser({}, genericCallback); @@ -118,7 +118,7 @@ user.setPassword("old_password", "new_password", genericCallback); user.count(query1.query, genericCallback); /////////////////////////////////////// -//Messaging API invocations +// Messaging API invocations /////////////////////////////////////// messaging.getMessageHistoryWithTimeFrame("topic", 5, 10, 15, 20, genericCallback); messaging.getMessageHistory("topic", 5, 15, genericCallback); @@ -126,20 +126,20 @@ messaging.getAndDeleteMessageHistory("topic", 5, 10, 1, 20, genericCallback); messaging.currentTopics(genericCallback); messaging.publish("topic", {}); messaging.publishREST("topic", { payload: Object }, genericCallback); -var mcb = function(message: string) {}; +let mcb = (message: string) => {}; messaging.subscribe("topic", {}, mcb); messaging.unsubscribe("topic", {}); messaging.disconnect(); /////////////////////////////////////// -//MessagingStats API invocations +// MessagingStats API invocations /////////////////////////////////////// stats.getAveragePayloadSize("topic: string", 5, 5, genericCallback); stats.getOpenConnections(genericCallback); stats.getCurrentSubscribers("topic: string", genericCallback); /////////////////////////////////////// -//Edge API invocations +// Edge API invocations /////////////////////////////////////// edge.updateEdgeByName("edgename", {changedColumn: "New value"}, genericCallback); edge.deleteEdgeByName("edgename", genericCallback); @@ -148,7 +148,7 @@ edge.columns(genericCallback); edge.count(query1.query, genericCallback); /////////////////////////////////////// -//Metrics API invocations +// Metrics API invocations /////////////////////////////////////// metrics.setQuery(query1.query); metrics.getStatistics(genericCallback); @@ -157,7 +157,7 @@ metrics.getDBConnections(genericCallback); metrics.getLogs(genericCallback); /////////////////////////////////////// -//Device API invocations +// Device API invocations /////////////////////////////////////// device.getDeviceByName("devicename", genericCallback); device.updateDeviceByName("devicename", { object: Object }, true, genericCallback); @@ -170,7 +170,7 @@ device.columns(genericCallback); device.count(query1.query, genericCallback); /////////////////////////////////////// -//Analytics API invocations +// Analytics API invocations /////////////////////////////////////// analytics.getStorage({}, genericCallback); analytics.getCount({}, genericCallback); @@ -179,13 +179,13 @@ analytics.getEventTotals({}, genericCallback); analytics.getUserEvents({}, genericCallback); /////////////////////////////////////// -//Portal API invocations +// Portal API invocations /////////////////////////////////////// portal.fetch(genericCallback); portal.update({data: Object}, genericCallback); /////////////////////////////////////// -//Triggers API invocations +// Triggers API invocations /////////////////////////////////////// triggers.fetchDefinitions(genericCallback); triggers.create("triggername", {data: Object}, genericCallback); diff --git a/types/clearbladejs-client/global.d.ts b/types/clearbladejs-client/global.d.ts index 7f70ed08f7..d6e2e88a70 100644 --- a/types/clearbladejs-client/global.d.ts +++ b/types/clearbladejs-client/global.d.ts @@ -2,4 +2,4 @@ declare global { var ClearBlade: ClearBladeGlobal; } -export {}; \ No newline at end of file +export {}; diff --git a/types/clearbladejs-client/index.d.ts b/types/clearbladejs-client/index.d.ts index 44dd355213..4cb8c4744b 100644 --- a/types/clearbladejs-client/index.d.ts +++ b/types/clearbladejs-client/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for clearbladejs Client SDK v1.0.0 +// Type definitions for clearbladejs-client 1.0 // Project: https://github.com/ClearBlade/JavaScript-API -// Definitions by: Jim Bouquet +// Definitions by: Jim Bouquet // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -52,9 +52,7 @@ interface APIUser { authToken: string; } -interface CbCallback { - (error: boolean, response: Resp): void; -} +type CbCallback = (error: boolean, response: Resp) => void; interface ClearBladeGlobal extends ClearBladeInt { MESSAGING_QOS_AT_MOST_ONCE: MessagingQOS.MESSAGING_QOS_AT_MOST_ONCE; @@ -87,14 +85,14 @@ interface ClearBladeInt { Query( options: string | QueryOptionsWithName | QueryOptionsWithID ): QueryObj; - Item(data: Object, collectionID: string | ItemOptions): Item; + Item(data: object, collectionID: string | ItemOptions): Item; Code(): Code; User(): AppUser; Messaging(options: MessagingOptions, callback: CbCallback): Messaging; MessagingStats(): MessagingStats; sendPush( users: string[], - payload: Object, + payload: object, appId: string, callback: CbCallback ): void; @@ -127,7 +125,7 @@ interface Collection { fetch(query: Query, callback: CbCallback): void; create(newItem: Item, callback: CbCallback): void; - update(query: Query, changes: Object, callback: CbCallback): void; + update(query: Query, changes: object, callback: CbCallback): void; remove(query: Query, callback: CbCallback): void; columns(callback: CbCallback): void; count(query: Query, callback: CbCallback): void; @@ -210,7 +208,7 @@ interface QueryObj { or(query: QueryObj): void; setPage(pageSize: number, pageNum: number): void; fetch(callback: CbCallback): void; - update(changes: Object, callback: CbCallback): void; + update(changes: object, callback: CbCallback): void; columns(columnsArray: string[]): void; remove(callback: CbCallback): void; } @@ -218,7 +216,7 @@ interface QueryObj { interface ItemOptions extends CollectionOptionsWithID {} interface Item { - data: Object; + data: object; save(callback: CbCallback): void; refresh(callback: CbCallback): void; @@ -235,7 +233,7 @@ interface Code { create(name: string, body: string, callback: CbCallback): void; update(name: string, body: string, callback: CbCallback): void; delete(name: string, callback: CbCallback): void; - execute(name: string, params: Object, callback: CbCallback): void; + execute(name: string, params: object, callback: CbCallback): void; getCompletedServices(callback: CbCallback): void; getFailedServices(callback: CbCallback): void; getAllServices(callback: CbCallback): void; @@ -250,7 +248,7 @@ interface AppUser { callTimeout: number; getUser(callback: CbCallback): void; - setUser(data: Object, callback: CbCallback): void; + setUser(data: object, callback: CbCallback): void; allUsers(query: Query, callback: CbCallback): void; setPassword( old_password: string, @@ -292,8 +290,8 @@ interface Messaging { callback: CbCallback ): void; currentTopics(callback: CbCallback): void; - publish(topic: string, payload: Object): void; - publishREST(topic: string, payload: Object, callback: CbCallback): void; + publish(topic: string, payload: object): void; + publishREST(topic: string, payload: object, callback: CbCallback): void; subscribe( topic: string, options: MessagingSubscribeOptions, @@ -321,13 +319,11 @@ interface MessagingConfiguration extends CommonMessagingProperties { password: string; } -interface MessageCallback { - (message: string): void; -} +type MessageCallback = (message: string) => void; interface MessagingSubscribeOptions { qos?: MessagingQOS; - invocationContext?: Object; + invocationContext?: object; onSuccess?: Function; onFailure?: Function; timeout?: number; @@ -355,9 +351,9 @@ interface Edge { systemKey: string; systemSecret: string; - updateEdgeByName(name: string, object: Object, callback: CbCallback): void; + updateEdgeByName(name: string, object: object, callback: CbCallback): void; deleteEdgeByName(name: string, callback: CbCallback): void; - create(newEdge: Object, name: string, callback: CbCallback): void; + create(newEdge: object, name: string, callback: CbCallback): void; columns(callback: CbCallback): void; count(query: Query, callback: CbCallback): void; } @@ -383,7 +379,7 @@ interface Device { getDeviceByName(name: string, callback: CbCallback): void; updateDeviceByName( name: string, - object: Object, + object: object, trigger: boolean, callback: CbCallback ): void; @@ -391,12 +387,12 @@ interface Device { fetch(query: Query, callback: CbCallback): void; update( query: Query, - object: Object, + object: object, trigger: boolean, callback: CbCallback ): void; delete(query: Query, callback: CbCallback): void; - create(newDevice: Object, callback: CbCallback): void; + create(newDevice: object, callback: CbCallback): void; columns(callback: CbCallback): void; count(query: Query, callback: CbCallback): void; } @@ -422,7 +418,7 @@ interface Portal { systemSecret: string; fetch(callback: CbCallback): void; - update(data: Object, callback: CbCallback): void; + update(data: object, callback: CbCallback): void; } interface Triggers { @@ -432,8 +428,8 @@ interface Triggers { systemSecret: string; fetchDefinitions(callback: CbCallback): void; - create(name: string, data: Object, callback: CbCallback): void; - update(name: string, data: Object, callback: CbCallback): void; + create(name: string, data: object, callback: CbCallback): void; + update(name: string, data: object, callback: CbCallback): void; delete(name: string, callback: CbCallback): void; } diff --git a/types/clearbladejs-client/tslint.json b/types/clearbladejs-client/tslint.json index a4c53997aa..d538486d5e 100644 --- a/types/clearbladejs-client/tslint.json +++ b/types/clearbladejs-client/tslint.json @@ -1,79 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "no-empty-interface": false } } \ No newline at end of file diff --git a/types/clearbladejs-node/clearbladejs-node-tests.ts b/types/clearbladejs-node/clearbladejs-node-tests.ts index 18cd509cc7..e9cb585d50 100644 --- a/types/clearbladejs-node/clearbladejs-node-tests.ts +++ b/types/clearbladejs-node/clearbladejs-node-tests.ts @@ -1,23 +1,26 @@ +// Testing type definitions for clearbladejs-node 1.0 +// Project: https://github.com/ClearBlade/Node-SDK +// Definitions by: Jim Bouquet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + import { ClearBlade, Resp, QuerySortDirections, QueryConditions } from "."; // Sample code for clearbladejs Node SDK v1.0.0 used to test typescript definitions -const constants = require("./constants.json"); - -var genericCallback = function(error: boolean, response: Resp) {}; +const genericCallback = (error: boolean, response: Resp) => {}; /////////////////////////////////////// -//ClearBlade object API invocations +// ClearBlade object API invocations /////////////////////////////////////// ClearBlade.init({ email: "a@a.com", password: "a", - systemKey: constants.systemKey, - systemSecret: constants.systemSecret, - URI: constants.URL, - messagingURI: constants.messageURL, + systemKey: "testkey", + systemSecret: "testsecret", + URI: "https://mycbplatform.com", + messagingURI: "mycbplatform.com", callback: genericCallback -}) +}); ClearBlade.setUser("test@test.com", "password"); ClearBlade.registerUser("test@test.com", "password", genericCallback); @@ -38,34 +41,33 @@ ClearBlade.sendPush([], {}, "appId: string", genericCallback); // makeKVPair(key: string, value: string): KeyValuePair; // request(options: RequestOptions, callback: RequestCallback): void; -var coll1 = ClearBlade.Collection("collectionID"); -var coll2 = ClearBlade.Collection({collectionName: "collectionName"}); -var coll3 = ClearBlade.Collection({collectionID: "collectionID"}); +const coll1 = ClearBlade.Collection("collectionID"); +const coll2 = ClearBlade.Collection({collectionName: "collectionName"}); +const coll3 = ClearBlade.Collection({collectionID: "collectionID"}); -var query1 = ClearBlade.Query("collectionID"); -var query2 = ClearBlade.Query({offset: 5, limit: 5, collectionID: "collectionID"}); -var query3 = ClearBlade.Query({collectionName: "collectionName"}); -var query4 = ClearBlade.Query({collection: "collectionID"}); +const query1 = ClearBlade.Query("collectionID"); +const query2 = ClearBlade.Query({offset: 5, limit: 5, collectionID: "collectionID"}); +const query3 = ClearBlade.Query({collectionName: "collectionName"}); +const query4 = ClearBlade.Query({collection: "collectionID"}); ClearBlade.addToQuery(query1, "key", "value"); ClearBlade.addFilterToQuery(query1, QueryConditions.QUERY_GREATERTHAN, "key", "value"); ClearBlade.addSortToQuery(query1, QuerySortDirections.QUERY_SORT_ASCENDING, "column1"); -var opQueryStr = ClearBlade.parseOperationQuery(query1.query); -var parse1:string = ClearBlade.parseQuery(query1.query); -var parse2:string = ClearBlade.parseQuery(query1); +const opQueryStr = ClearBlade.parseOperationQuery(query1.query); +const parse1: string = ClearBlade.parseQuery(query1.query); +const parse2: string = ClearBlade.parseQuery(query1); +const item1 = ClearBlade.Item({}, "hello"); +const item2 = ClearBlade.Item({}, {collectionID: "hello"}); -var item1 = ClearBlade.Item({}, "hello"); -var item2 = ClearBlade.Item({}, {collectionID: "hello"}); +const code = ClearBlade.Code(); +const user = ClearBlade.User(); -var code = ClearBlade.Code(); -var user = ClearBlade.User(); - -var messaging = ClearBlade.Messaging({}, genericCallback); +const messaging = ClearBlade.Messaging({}, genericCallback); /////////////////////////////////////// -//Collection API invocations +// Collection API invocations /////////////////////////////////////// coll1.fetch(query1, genericCallback); coll1.create(ClearBlade.Item({}, ""), genericCallback); @@ -73,7 +75,7 @@ coll1.update(query1.query, {}, genericCallback); coll1.remove(query1.query, genericCallback); /////////////////////////////////////// -//Query API invocations +// Query API invocations /////////////////////////////////////// query1.ascending("string"); query1.descending("string"); @@ -90,26 +92,26 @@ query1.update({}, genericCallback); query1.remove(genericCallback); /////////////////////////////////////// -//Item API invocations +// Item API invocations /////////////////////////////////////// item1.save(); item1.refresh(); item1.destroy(); /////////////////////////////////////// -//Code API invocations +// Code API invocations /////////////////////////////////////// code.execute("codeName", {}, genericCallback); /////////////////////////////////////// -//User API invocations +// User API invocations /////////////////////////////////////// user.getUser(genericCallback); user.setUser({}, genericCallback); user.allUsers(query1.query, genericCallback); /////////////////////////////////////// -//Messaging API invocations +// Messaging API invocations /////////////////////////////////////// messaging.getMessageHistory("topic: string", 5, 15, genericCallback); @@ -117,9 +119,6 @@ messaging.publish("topic: string", {}); messaging.subscribe("my/topic", {}, messageReceivedCb); -function messageReceivedCb (message: string) { +function messageReceivedCb(message: string) { messaging.unsubscribe("my/topic"); } - - - diff --git a/types/clearbladejs-node/index.d.ts b/types/clearbladejs-node/index.d.ts index bef502bb00..192b1a97ee 100644 --- a/types/clearbladejs-node/index.d.ts +++ b/types/clearbladejs-node/index.d.ts @@ -1,26 +1,26 @@ -// Type definitions for clearbladejs Node SDK v1.0.0 +// Type definitions for clearbladejs-node 1.0 // Project: https://github.com/ClearBlade/Node-SDK -// Definitions by: Jim Bouquet +// Definitions by: Jim Bouquet // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 /// import { Response, RequestCallback } from "request/index"; -//import {//PacketCallback } from "mqtt"; +// import {//PacketCallback } from "mqtt"; -declare enum MessagingQOS { +export enum MessagingQOS { MESSAGING_QOS_AT_MOST_ONCE = 0, MESSAGING_QOS_AT_LEAST_ONCE = 1, MESSAGING_QOS_EXACTLY_ONCE = 2 } export interface Resp { - error(msg: any): never; // todo: figure out if we can have the compiler throw an error if someone adds code after this + error(msg: any): never; success(msg: any): never; } -export interface InitOptions { +export interface InitOptions { systemKey: string; systemSecret: string; logging?: boolean; @@ -49,7 +49,7 @@ export interface RequestOptions { user?: APIUser; } -export interface APIUser { +export interface APIUser { email: string; authToken: string; } @@ -58,9 +58,7 @@ export interface KeyValuePair { [key: string]: any; } -export interface CbCallback { - (error: boolean, response: Resp): void -} +export type CbCallback = (error: boolean, response: Resp) => void; export default interface ClearBladeGlobal extends ClearBladeInt { isCurrentUserAuthenticated(callback: CbCallback): void; @@ -70,12 +68,12 @@ export interface ClearBladeInt { addToQuery(queryObj: QueryObj, key: string, value: string): void; addFilterToQuery(queryObj: QueryObj, condition: QueryConditions, key: string, value: QueryValue): void; addSortToQuery(queryObj: QueryObj, direction: QuerySortDirections, column: string): void; - Code() :Code; - Collection(options: string | CollectionOptionsWithName | CollectionOptionsWithID) :Collection; - execute(error: Object, response: Object, callback: CbCallback): void; + Code(): Code; + Collection(options: string | CollectionOptionsWithName | CollectionOptionsWithID): Collection; + execute(error: object, response: object, callback: CbCallback): void; init(options: InitOptions): void; - isObjectEmpty(obj: Object): boolean; - Item(data: Object, options: string | ItemOptions) :Item; + isObjectEmpty(obj: object): boolean; + Item(data: object, options: string | ItemOptions): Item; logger(message: string): void; loginAnon(callback: CbCallback): void; loginUser(email: string, password: string, callback: CbCallback): void; @@ -83,21 +81,21 @@ export interface ClearBladeInt { makeKVPair(key: string, value: string): KeyValuePair; parseOperationQuery(query: Query): string; parseQuery(query: Query | QueryObj): string; - Query(options: string | QueryOptionsWithCollection | QueryOptionsWithName | QueryOptionsWithID) :QueryObj; + Query(options: string | QueryOptionsWithCollection | QueryOptionsWithName | QueryOptionsWithID): QueryObj; registerUser(email: string, password: string, callback: CbCallback): void; request(options: RequestOptions, callback: RequestCallback): void; setUser(email: string, password: string): void; - User() :AppUser; - Messaging(options: MessagingOptions, callback: CbCallback) :Messaging; - sendPush(users: string[], payload: Object, appId: string, callback: CbCallback): void; - validateEmailPassword(email: string, password:string): void; + User(): AppUser; + Messaging(options: MessagingOptions, callback: CbCallback): Messaging; + sendPush(users: string[], payload: object, appId: string, callback: CbCallback): void; + validateEmailPassword(email: string, password: string): void; } -export interface CollectionOptionsWithName { +export interface CollectionOptionsWithName { collectionName: string; } -export interface CollectionOptionsWithID { +export interface CollectionOptionsWithID { collectionID: string; } @@ -110,16 +108,16 @@ export interface Collection { fetch(query: QueryObj, callback: CbCallback): void; create(newItem: Item, callback: CbCallback): void; - update(query: Query, changes: Object, callback: CbCallback): void; + update(query: Query, changes: object, callback: CbCallback): void; remove(query: Query, callback: CbCallback): void; } -export declare enum QuerySortDirections { +export enum QuerySortDirections { QUERY_SORT_ASCENDING = 'ASC', QUERY_SORT_DESCENDING = 'DESC' } -export declare enum QueryConditions { +export enum QueryConditions { QUERY_EQUAL = 'EQ', QUERY_NOTEQUAL = 'NEQ', QUERY_GREATERTHAN = 'GT', @@ -131,17 +129,18 @@ export declare enum QueryConditions { export type QueryValue = string|number|boolean; -export interface QueryOptions { +export interface QueryOptions { offset?: number; limit?: number; } -export interface QueryOptionsWithCollection extends QueryOptions{ +export interface QueryOptionsWithCollection extends QueryOptions { collection: string; } -export interface QueryOptionsWithName extends CollectionOptionsWithName, QueryOptions{} -export interface QueryOptionsWithID extends CollectionOptionsWithID, QueryOptions{} +export interface QueryOptionsWithName extends CollectionOptionsWithName, QueryOptions {} + +export interface QueryOptionsWithID extends CollectionOptionsWithID, QueryOptions {} export interface Query { SELECTCOLUMNS?: string[]; @@ -152,11 +151,11 @@ export interface Query { } export interface QueryFilter { - [QueryConditions: string]: QueryFilterValue + [QueryConditions: string]: QueryFilterValue; } export interface QueryFilterValue { - [name: string]: QueryValue + [name: string]: QueryValue; } export interface QueryObj { @@ -182,14 +181,14 @@ export interface QueryObj { or(query: QueryObj): Query; setPage(pageSize: number, pageNum: number): Query; fetch(callback: CbCallback): void; - update(changes: Object, callback: CbCallback): void; + update(changes: object, callback: CbCallback): void; remove(callback: CbCallback): void; } -export interface ItemOptions extends CollectionOptionsWithID{} +export interface ItemOptions extends CollectionOptionsWithID {} export interface Item { - data: Object; + data: object; save(): void; refresh(): void; @@ -204,7 +203,7 @@ export interface Code { callTimeout: number; URIPrefix: string; - execute(name: string, params: Object, callback: CbCallback): void; + execute(name: string, params: object, callback: CbCallback): void; } export interface AppUser { @@ -214,7 +213,7 @@ export interface AppUser { systemSecret: string; getUser(callback: CbCallback): void; - setUser(data: Object, callback: CbCallback): void; + setUser(data: object, callback: CbCallback): void; allUsers(query: Query, callback: CbCallback): void; } @@ -223,12 +222,12 @@ export interface Messaging { URI: string; systemKey: string; systemSecret: string; - client: Object; + client: object; getMessageHistory(topic: string, startTime: number, count: number, callback: CbCallback): void; - publish(topic: string, payload: Object): void; + publish(topic: string, payload: object): void; subscribe(topic: string, options: MessagingSubscribeOptions, messageCallback: MessageCallback): void; - unsubscribe(topic: string, callback?: (error?: Error, packet?: Object) => any): void; + unsubscribe(topic: string, callback?: (error?: Error, packet?: object) => any): void; } export interface CommonMessagingProperties { @@ -237,7 +236,7 @@ export interface CommonMessagingProperties { } export interface MessagingOptions extends CommonMessagingProperties { - qos?: MessagingQOS + qos?: MessagingQOS; } export interface MessagingSubscribeOptions { @@ -245,10 +244,6 @@ export interface MessagingSubscribeOptions { timeout?: number; } -export interface MessageCallback { - (message: string): void; -} +export type MessageCallback = (message: string) => void; -declare var ClearBlade: ClearBladeGlobal; - -export {ClearBlade}; +export let ClearBlade: ClearBladeGlobal; diff --git a/types/clearbladejs-node/tslint.json b/types/clearbladejs-node/tslint.json index a4c53997aa..2e3f95d861 100644 --- a/types/clearbladejs-node/tslint.json +++ b/types/clearbladejs-node/tslint.json @@ -1,79 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "no-relative-import-in-test": false } } \ No newline at end of file diff --git a/types/clearbladejs-server/clearbladejs-server-tests.ts b/types/clearbladejs-server/clearbladejs-server-tests.ts index ea7c179df2..d240f181ea 100644 --- a/types/clearbladejs-server/clearbladejs-server-tests.ts +++ b/types/clearbladejs-server/clearbladejs-server-tests.ts @@ -1,12 +1,12 @@ -// Testing type definitions for clearbladejs Client SDK v1.0.0 +// Testing type definitions for clearbladejs-server 1.0 // Project: https://github.com/ClearBlade/JavaScript-API -// Definitions by: Jim Bouquet +// Definitions by: Jim Bouquet // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -var genericCallback = function(error: boolean, response: Resp) {}; +const genericCallback = (error: boolean, response: Resp) => {}; /////////////////////////////////////// -//ClearBlade object API invocations +// ClearBlade object API invocations /////////////////////////////////////// ClearBlade.init({ systemKey: "abcdef", @@ -27,7 +27,7 @@ ClearBlade.init({request: { userid: "abcdef", }}); -var about = ClearBlade.about(); +const about = ClearBlade.about(); ClearBlade.setUser("test@test.com", "authtoken", "userId"); ClearBlade.registerUser("test@test.com", "password", genericCallback); ClearBlade.isCurrentUserAuthenticated(genericCallback); @@ -36,32 +36,32 @@ ClearBlade.loginAnon(genericCallback); ClearBlade.loginUser("test@test.com", "password", genericCallback); ClearBlade.getAllCollections(genericCallback); -var edgeID = ClearBlade.edgeId(); -var isEdge = ClearBlade.isEdge(genericCallback); +const edgeID = ClearBlade.edgeId(); +const isEdge = ClearBlade.isEdge(genericCallback); if (ClearBlade.isObjectEmpty({test: "test"})) { ClearBlade.logger("Object is empty"); } -var kvPair = ClearBlade.makeKVPair("key", "value"); +const kvPair = ClearBlade.makeKVPair("key", "value"); -var coll1 = ClearBlade.Collection("collectionID"); -var coll2 = ClearBlade.Collection({ collectionName: "collectionName" }); -var coll3 = ClearBlade.Collection({ collectionID: "collectionID" }); -var coll4 = ClearBlade.Collection({ collection: "collectionID" }); +const coll1 = ClearBlade.Collection("collectionID"); +const coll2 = ClearBlade.Collection({ collectionName: "collectionName" }); +const coll3 = ClearBlade.Collection({ collectionID: "collectionID" }); +const coll4 = ClearBlade.Collection({ collection: "collectionID" }); -var query1 = ClearBlade.Query({ collectionID: "collectionID" }); -var query2 = ClearBlade.Query({ collectionName: "collectionName" }); -var query3 = ClearBlade.Query({ collection: "collectionID" }); +const query1 = ClearBlade.Query({ collectionID: "collectionID" }); +const query2 = ClearBlade.Query({ collectionName: "collectionName" }); +const query3 = ClearBlade.Query({ collection: "collectionID" }); -var item1 = ClearBlade.Item({}, "collectionID"); -var item2 = ClearBlade.Item({}, { collectionID: "collectionID" }); +const item1 = ClearBlade.Item({}, "collectionID"); +const item2 = ClearBlade.Item({}, { collectionID: "collectionID" }); -var code = ClearBlade.Code(); -var deployment = ClearBlade.Deployment(); -var user = ClearBlade.User(); +const code = ClearBlade.Code(); +const deployment = ClearBlade.Deployment(); +const user = ClearBlade.User(); -var messaging = ClearBlade.Messaging({}, genericCallback); +const messaging = ClearBlade.Messaging({}, genericCallback); -var device = ClearBlade.Device(); +const device = ClearBlade.Device(); ClearBlade.addToQuery(query1, "key", "value"); ClearBlade.addSortToQuery( @@ -78,9 +78,9 @@ ClearBlade.addFilterToQuery( ClearBlade.newCollection("collectionName", genericCallback); -var parseOperation = ClearBlade.parseOperationQuery(query1.query); -var parseQuery1 = ClearBlade.parseQuery(query1); -var parseQuery2 = ClearBlade.parseQuery(query1.query); +const parseOperation = ClearBlade.parseOperationQuery(query1.query); +const parseQuery1 = ClearBlade.parseQuery(query1); +const parseQuery2 = ClearBlade.parseQuery(query1.query); ClearBlade.createDevice("devicename", {type: "devicetype"}, false, genericCallback); ClearBlade.deleteDevice("devicename", true, genericCallback); @@ -90,7 +90,7 @@ ClearBlade.getAllDevicesForSystem(genericCallback); ClearBlade.validateEmailPassword("test@test.com", "password"); /////////////////////////////////////// -//Collection API invocations +// Collection API invocations /////////////////////////////////////// coll1.addColumn({name: "column1"}, genericCallback); coll1.dropColumn("column1", genericCallback); @@ -103,7 +103,7 @@ coll1.columns(genericCallback); coll1.count(query1.query, genericCallback); /////////////////////////////////////// -//Query API invocations +// Query API invocations /////////////////////////////////////// query2.ascending("string"); query1.descending("string"); @@ -122,20 +122,20 @@ query1.columns([]); query1.remove(genericCallback); /////////////////////////////////////// -//Item API invocations +// Item API invocations /////////////////////////////////////// item1.save(); item1.refresh(); item1.destroy(); /////////////////////////////////////// -//Code API invocations +// Code API invocations /////////////////////////////////////// code.execute("codeName", {}, true, genericCallback); code.getAllServices(genericCallback); /////////////////////////////////////// -//Deployment API invocations +// Deployment API invocations /////////////////////////////////////// deployment.create("deploymentname", "deployment description", {}, genericCallback); deployment.update("deploymentname", {}, genericCallback); @@ -144,7 +144,7 @@ deployment.read("deploymentname", genericCallback); deployment.readAll(query1, genericCallback); /////////////////////////////////////// -//User API invocations +// User API invocations /////////////////////////////////////// user.getUser(genericCallback); user.setUser({}, genericCallback); @@ -153,7 +153,7 @@ user.allUsers(query1, genericCallback); user.count(query1, genericCallback); /////////////////////////////////////// -//Messaging API invocations +// Messaging API invocations /////////////////////////////////////// messaging.getMessageHistoryWithTimeFrame("topic", 5, 10, 15, 20, genericCallback); messaging.getMessageHistory("topic", 5, 15, genericCallback); @@ -162,7 +162,7 @@ messaging.getCurrentTopics(genericCallback); messaging.publish("topic", "payload"); /////////////////////////////////////// -//Device API invocations +// Device API invocations /////////////////////////////////////// device.fetch(query1.query, genericCallback); device.update(query1.query, { object: Object }, genericCallback); @@ -170,10 +170,10 @@ device.delete(query1.query, genericCallback); device.create({ newDevice: Object }, genericCallback); /////////////////////////////////////// -//Triggers API invocations +// Triggers API invocations /////////////////////////////////////// ClearBlade.Trigger.Create( - "triggername", + "triggername", { system_key: "key", name: "triggername", @@ -186,7 +186,7 @@ ClearBlade.Trigger.Create( ClearBlade.Trigger.Fetch("triggername", genericCallback); /////////////////////////////////////// -//Timers API invocations +// Timers API invocations /////////////////////////////////////// ClearBlade.Timer.Create("timername", {}, genericCallback); ClearBlade.Timer.Fetch("timername", genericCallback); diff --git a/types/clearbladejs-server/global.d.ts b/types/clearbladejs-server/global.d.ts index 7f70ed08f7..d6e2e88a70 100644 --- a/types/clearbladejs-server/global.d.ts +++ b/types/clearbladejs-server/global.d.ts @@ -2,4 +2,4 @@ declare global { var ClearBlade: ClearBladeGlobal; } -export {}; \ No newline at end of file +export {}; diff --git a/types/clearbladejs-server/index.d.ts b/types/clearbladejs-server/index.d.ts index 2c3a0845b4..fb3ef065ce 100644 --- a/types/clearbladejs-server/index.d.ts +++ b/types/clearbladejs-server/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for clearbladejs Server SDK v1.0.0 +// Type definitions for clearbladejs-server 1.0 // Project: https://docs.clearblade.com/v/3/4-developer_reference/platformsdk/ClearBlade.js/ -// Definitions by: Jim Bouquet +// Definitions by: Jim Bouquet // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -24,14 +24,14 @@ interface Resp { success(msg: any): never; } declare var resp: Resp; - + declare enum MessagingQOS { MESSAGING_QOS_AT_MOST_ONCE = 0, MESSAGING_QOS_AT_LEAST_ONCE = 1, MESSAGING_QOS_EXACTLY_ONCE = 2 } -interface InitOptions { +interface InitOptions { systemKey: string; systemSecret: string; logging?: boolean; @@ -49,7 +49,7 @@ interface InitOptions { callTimeout?: number; } -interface APIUser { +interface APIUser { email: string; authToken: string; user_id?: string; @@ -59,9 +59,7 @@ interface KeyValuePair { [key: string]: any; } -interface CbCallback { - (error: boolean, response: Resp): void -} +type CbCallback = (error: boolean, response: Resp) => void; interface ClearBladeGlobal extends ClearBladeInt { user: APIUser; @@ -76,18 +74,18 @@ interface ClearBladeInt { addFilterToQuery(queryObj: QueryObj, condition: QueryConditions, key: string, value: QueryValue): void; addSortToQuery(queryObj: QueryObj, direction: QuerySortDirections, column: string): void; Code(): Code; - Collection(options: string | CollectionOptionsWithName | CollectionOptionsWithID | CollectionOptionsWithCollection) :Collection; + Collection(options: string | CollectionOptionsWithName | CollectionOptionsWithID | CollectionOptionsWithCollection): Collection; Deployment(): Deployment; Device(): Device; edgeId(): string; - execute(error: Object, response: Object, callback: CbCallback): any; + execute(error: object, response: object, callback: CbCallback): any; getAllCollections(callback: CbCallback): void; - http(): Object; + http(): object; init(options: InitOptions | {request: BasicReq}): void; isEdge(callback: CbCallback): boolean; isCurrentUserAuthenticated(callback: CbCallback): void; - isObjectEmpty(obj: Object): boolean; - Item(data: Object, options: string | ItemOptions): Item; + isObjectEmpty(obj: object): boolean; + Item(data: object, options: string | ItemOptions): Item; logger(message: string): void; loginAnon(callback: CbCallback): void; loginUser(email: string, password: string, callback: CbCallback): void; @@ -107,18 +105,18 @@ interface ClearBladeInt { updateDevice(name: string, data: object, causeTrigger: boolean, callback: CbCallback): void; getDeviceByName(name: string, callback: CbCallback): void; getAllDevicesForSystem(callback: CbCallback): void; - validateEmailPassword(email: string, password:string): void; + validateEmailPassword(email: string, password: string): void; } -interface CollectionOptionsWithCollection { +interface CollectionOptionsWithCollection { collection: string; } -interface CollectionOptionsWithName { +interface CollectionOptionsWithName { collectionName: string; } -interface CollectionOptionsWithID { +interface CollectionOptionsWithID { collectionID: string; } @@ -128,12 +126,12 @@ interface Collection { systemKey: string; systemSecret: string; - addColumn(options: Object, callback: CbCallback): void; + addColumn(options: object, callback: CbCallback): void; dropColumn(name: string, callback: CbCallback): void; deleteCollection(callback: CbCallback): void; fetch(query: Query, callback: CbCallback): void; create(newItem: Item, callback: CbCallback): void; - update(query: Query, changes: Object, callback: CbCallback): void; + update(query: Query, changes: object, callback: CbCallback): void; remove(query: Query, callback: CbCallback): void; columns(callback: CbCallback): void; count(query: Query, callback: CbCallback): void; @@ -156,14 +154,16 @@ declare enum QueryConditions { type QueryValue = string|number|boolean; -interface QueryOptions { +interface QueryOptions { offset?: number; limit?: number; } -interface QueryOptionsWithCollection extends CollectionOptionsWithCollection, QueryOptions{} -interface QueryOptionsWithName extends CollectionOptionsWithName, QueryOptions{} -interface QueryOptionsWithID extends CollectionOptionsWithID, QueryOptions{} +interface QueryOptionsWithCollection extends CollectionOptionsWithCollection, QueryOptions {} + +interface QueryOptionsWithName extends CollectionOptionsWithName, QueryOptions {} + +interface QueryOptionsWithID extends CollectionOptionsWithID, QueryOptions {} interface Query { SELECTCOLUMNS?: string[]; @@ -174,11 +174,11 @@ interface Query { } interface QueryFilter { - [QueryConditions: string]: QueryFilterValue + [QueryConditions: string]: QueryFilterValue; } interface QueryFilterValue { - [name: string]: QueryValue + [name: string]: QueryValue; } interface QueryObj { @@ -204,15 +204,15 @@ interface QueryObj { or(query: QueryObj): void; setPage(pageSize: number, pageNum: number): void; fetch(callback: CbCallback): void; - update(changes: Object, callback: CbCallback): void; + update(changes: object, callback: CbCallback): void; columns(columnsArray: string[]): void; remove(callback: CbCallback): void; } -interface ItemOptions extends CollectionOptionsWithID{} +interface ItemOptions extends CollectionOptionsWithID {} interface Item { - data: Object; + data: object; save(): void; refresh(): void; @@ -224,11 +224,11 @@ interface Code { systemKey: string; systemSecret: string; - execute(name: string, params: Object, loggingEnabled: boolean, callback: CbCallback): void; + execute(name: string, params: object, loggingEnabled: boolean, callback: CbCallback): void; getAllServices(callback: CbCallback): void; } -interface DeploymentOptions{} +interface DeploymentOptions {} interface Deployment { user: APIUser; @@ -249,8 +249,8 @@ interface AppUser { systemSecret: string; getUser(callback: CbCallback): void; - setUser(data: Object, callback: CbCallback): void; - setUsers(query: QueryObj, data: Object, callback: CbCallback): void; + setUser(data: object, callback: CbCallback): void; + setUsers(query: QueryObj, data: object, callback: CbCallback): void; allUsers(query: QueryObj, callback: CbCallback): void; count(query: QueryObj, callback: CbCallback): void; } @@ -275,9 +275,9 @@ interface Device { systemSecret: string; fetch(query: Query, callback: CbCallback): void; - update(query: Query, changes: Object, callback: CbCallback): void; + update(query: Query, changes: object, callback: CbCallback): void; delete(query: Query, callback: CbCallback): void; - create(newDevice: Object, callback: CbCallback): void; + create(newDevice: object, callback: CbCallback): void; } declare enum TriggerModule { @@ -320,7 +320,7 @@ interface TriggerInstance { name: string; systemKey: string; - Update(options: Object, callback: CbCallback): void; + Update(options: object, callback: CbCallback): void; Delete(callback: CbCallback): void; } @@ -328,8 +328,8 @@ interface TimerInstance { name: string; systemKey: string; - Update(options: Object, callback: CbCallback): void; + Update(options: object, callback: CbCallback): void; Delete(callback: CbCallback): void; } -declare var ClearBlade: ClearBladeGlobal; \ No newline at end of file +declare var ClearBlade: ClearBladeGlobal; diff --git a/types/clearbladejs-server/tslint.json b/types/clearbladejs-server/tslint.json index a4c53997aa..6a6f758e67 100644 --- a/types/clearbladejs-server/tslint.json +++ b/types/clearbladejs-server/tslint.json @@ -1,79 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "no-empty-interface": false } } \ No newline at end of file From baaab3299c503f8ece8d286fc61992603a20c891 Mon Sep 17 00:00:00 2001 From: Jacob Date: Mon, 9 Apr 2018 12:35:10 -0400 Subject: [PATCH 0480/2153] Added new type definition for npm package strong-error-handler v2.3 (#24821) * added new type definition for npm package strong-error-handler v2.3 * Updated strict null checks to true, tsconfig Per reviewers request, updated tsconfig strictnullchecks true --- types/strong-error-handler/index.d.ts | 52 +++++++++++++++++++ .../strong-error-handler-tests.ts | 10 ++++ types/strong-error-handler/tsconfig.json | 23 ++++++++ types/strong-error-handler/tslint.json | 3 ++ 4 files changed, 88 insertions(+) create mode 100644 types/strong-error-handler/index.d.ts create mode 100644 types/strong-error-handler/strong-error-handler-tests.ts create mode 100644 types/strong-error-handler/tsconfig.json create mode 100644 types/strong-error-handler/tslint.json diff --git a/types/strong-error-handler/index.d.ts b/types/strong-error-handler/index.d.ts new file mode 100644 index 0000000000..8620a36a36 --- /dev/null +++ b/types/strong-error-handler/index.d.ts @@ -0,0 +1,52 @@ +// Type definitions for strong-error-handler 2.3 +// Project: https://github.com/strongloop/strong-error-handler +// Definitions by: Jacob Copeland +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import express = require('express'); + +declare namespace StrongErrorHandler { + interface options { + /*** + * HTTP responses include all error properties, including sensitive data such as file paths, + * URLs and stack traces, defaults to false. + */ + debug?: boolean; + + /*** + *If true, all errors are printed via console.error, including an array of fields (custom error properties) + *that are safe to include in response messages (both 4xx and 5xx). + *If false, sends only the error back in the response. + * Defaults to true + */ + log?: boolean; + + /*** + * Specifies property names on errors that are allowed to be passed through in 4xx and 5xx responses. + */ + safeFields?: [string]; + + /*** + * Specify the default response content type to use when the client does not provide any Accepts header. + * Defaults to 'json'. + */ + defaultType?: string; + + /*** + * Negotiate the response content type via Accepts request header. + * When disabled, strong-error-handler will always use the default content type when producing responses. + * Disabling content type negotiation is useful if you want to see JSON-formatted + * error responses in browsers, because browsers usually prefer HTML and XML over other content types. + */ + negotiateContentType?: boolean; + } +} + +/*** + * Create a new strong error middleware funciton using the given options. + * @param options + */ +declare function createStrongErrorHandler(options?: StrongErrorHandler.options): express.RequestHandler; + +export = createStrongErrorHandler; diff --git a/types/strong-error-handler/strong-error-handler-tests.ts b/types/strong-error-handler/strong-error-handler-tests.ts new file mode 100644 index 0000000000..6e7a541b6e --- /dev/null +++ b/types/strong-error-handler/strong-error-handler-tests.ts @@ -0,0 +1,10 @@ +import express = require('express'); +import errorHandler = require('strong-error-handler'); + +errorHandler({ + debug: false, + log: false, + safeFields: ['test'], + defaultType: 'json', + negotiateContentType: true, +}); diff --git a/types/strong-error-handler/tsconfig.json b/types/strong-error-handler/tsconfig.json new file mode 100644 index 0000000000..3d49780aec --- /dev/null +++ b/types/strong-error-handler/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "strong-error-handler-tests.ts" + ] +} diff --git a/types/strong-error-handler/tslint.json b/types/strong-error-handler/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/strong-error-handler/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 0a20ea4ad994522994c814ee5d065234dc943f05 Mon Sep 17 00:00:00 2001 From: Pine Mizune Date: Tue, 10 Apr 2018 01:35:40 +0900 Subject: [PATCH 0481/2153] add jquery-drawer (#24840) --- types/jquery-drawer/index.d.ts | 29 ++++++++++++++ types/jquery-drawer/jquery-drawer-tests.ts | 46 ++++++++++++++++++++++ types/jquery-drawer/tsconfig.json | 24 +++++++++++ types/jquery-drawer/tslint.json | 1 + 4 files changed, 100 insertions(+) create mode 100644 types/jquery-drawer/index.d.ts create mode 100644 types/jquery-drawer/jquery-drawer-tests.ts create mode 100644 types/jquery-drawer/tsconfig.json create mode 100644 types/jquery-drawer/tslint.json diff --git a/types/jquery-drawer/index.d.ts b/types/jquery-drawer/index.d.ts new file mode 100644 index 0000000000..6c96e711aa --- /dev/null +++ b/types/jquery-drawer/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for jquery-drawer 3.2 +// Project: http://git.blivesta.com/drawer +// Definitions by: Pine Mizune +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// +/// + +interface JQueryDrawerClassOptions { + nav?: string; + toggle?: string; + overlay?: string; + open?: string; + close?: string; + dropdown?: string; +} + +interface JQueryDrawerOptions { + class?: JQueryDrawerClassOptions; + iscroll?: IScrollOptions; + showOverlay?: boolean; +} + +interface JQuery { + drawer(options?: JQueryDrawerOptions): JQuery; + drawer(method: 'open'|'close'|'toggle'|'destroy'): JQuery; + on(event: 'drawer.opened'|'drawer.closed', handler: () => void): JQuery; +} diff --git a/types/jquery-drawer/jquery-drawer-tests.ts b/types/jquery-drawer/jquery-drawer-tests.ts new file mode 100644 index 0000000000..b0249f8618 --- /dev/null +++ b/types/jquery-drawer/jquery-drawer-tests.ts @@ -0,0 +1,46 @@ +const elem = $('foo'); + +elem.drawer(); +elem.drawer({}); +elem.drawer({ + class: { + nav: 'drawer-nav', + toggle: 'drawer-toggle', + overlay: 'drawer-overlay', + open: 'drawer-open', + close: 'drawer-close', + dropdown: 'drawer-dropdown' + }, + iscroll: { + mouseWheel: true, + preventDefault: false, + }, + showOverlay: true, +}); +elem.drawer({ class: {} }); +elem.drawer({ + class: { + nav: 'drawer-nav', + toggle: 'drawer-toggle', + overlay: 'drawer-overlay', + open: 'drawer-open', + close: 'drawer-close', + dropdown: 'drawer-dropdown' + }, +}); +elem.drawer({ iscroll: {} }); +elem.drawer({ + iscroll: { + mouseWheel: true, + preventDefault: false, + }, +}); +elem.drawer({ showOverlay: true }); + +elem.on('drawer.opened', () => {}); +elem.on('drawer.closed', () => {}); + +elem.drawer('open'); +elem.drawer('close'); +elem.drawer('toggle'); +elem.drawer('destroy'); diff --git a/types/jquery-drawer/tsconfig.json b/types/jquery-drawer/tsconfig.json new file mode 100644 index 0000000000..a22a6dec91 --- /dev/null +++ b/types/jquery-drawer/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jquery-drawer-tests.ts" + ] +} diff --git a/types/jquery-drawer/tslint.json b/types/jquery-drawer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jquery-drawer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 6bd12e9136b94a65058db1302fdf9b58f3c8ad39 Mon Sep 17 00:00:00 2001 From: Karol Majewski Date: Mon, 9 Apr 2018 18:47:24 +0200 Subject: [PATCH 0482/2153] Create definitions for dotenv-webpack (#24828) --- types/dotenv-webpack/dotenv-webpack-tests.ts | 21 +++++++++++ types/dotenv-webpack/index.d.ts | 37 ++++++++++++++++++++ types/dotenv-webpack/tsconfig.json | 23 ++++++++++++ types/dotenv-webpack/tslint.json | 1 + 4 files changed, 82 insertions(+) create mode 100644 types/dotenv-webpack/dotenv-webpack-tests.ts create mode 100644 types/dotenv-webpack/index.d.ts create mode 100644 types/dotenv-webpack/tsconfig.json create mode 100644 types/dotenv-webpack/tslint.json diff --git a/types/dotenv-webpack/dotenv-webpack-tests.ts b/types/dotenv-webpack/dotenv-webpack-tests.ts new file mode 100644 index 0000000000..6605550529 --- /dev/null +++ b/types/dotenv-webpack/dotenv-webpack-tests.ts @@ -0,0 +1,21 @@ +import * as webpack from 'webpack'; +import DotenvWebpackPlugin = require('dotenv-webpack'); + +new DotenvWebpackPlugin(); // $ExpectType DotenvWebpackPlugin + +const options: DotenvWebpackPlugin.Options = { + path: './some.other.env', + safe: true, + systemvars: true, + silent: true +}; + +const config: webpack.Configuration = { + plugins: [ + new DotenvWebpackPlugin(), + new DotenvWebpackPlugin({ + path: './some.other.env', + }), + new DotenvWebpackPlugin(options), + ] +}; diff --git a/types/dotenv-webpack/index.d.ts b/types/dotenv-webpack/index.d.ts new file mode 100644 index 0000000000..2d330ace45 --- /dev/null +++ b/types/dotenv-webpack/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for dotenv-webpack 1.5 +// Project: https://github.com/mrsteele/dotenv-webpack +// Definitions by: Karol Majewski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +import * as webpack from 'webpack'; + +declare class DotenvWebpackPlugin extends webpack.Plugin { + constructor(options?: DotenvWebpackPlugin.Options); +} + +declare namespace DotenvWebpackPlugin { + interface Options { + /** + * The path to your environment variables. Default: `'./.env'`. + */ + path?: string; + + /** + * If `false` ignore safe-mode, if `true` load `'./.env.example'`, if a `string` load that file as the sample. Default: `false`. + */ + safe?: boolean; + + /** + * Set to `true` if you would rather load all system variables as well (useful for CI purposes). Default: `false`. + */ + systemvars?: boolean; + + /** + * If `true`, all warnings will be surpressed. Default: `false`. + */ + silent?: boolean; + } +} + +export = DotenvWebpackPlugin; diff --git a/types/dotenv-webpack/tsconfig.json b/types/dotenv-webpack/tsconfig.json new file mode 100644 index 0000000000..f87dcd737b --- /dev/null +++ b/types/dotenv-webpack/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dotenv-webpack-tests.ts" + ] +} diff --git a/types/dotenv-webpack/tslint.json b/types/dotenv-webpack/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/dotenv-webpack/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 89fba32869c01fcf814ac8dc0d7e0afdfc6c2a29 Mon Sep 17 00:00:00 2001 From: Wu Haotian Date: Tue, 10 Apr 2018 00:48:55 +0800 Subject: [PATCH 0483/2153] Added new type definition for npm package fb-watchman 2.0.0 (#24825) --- types/fb-watchman/fb-watchman-tests.ts | 14 ++++++++++ types/fb-watchman/index.d.ts | 38 ++++++++++++++++++++++++++ types/fb-watchman/tsconfig.json | 23 ++++++++++++++++ types/fb-watchman/tslint.json | 1 + 4 files changed, 76 insertions(+) create mode 100644 types/fb-watchman/fb-watchman-tests.ts create mode 100644 types/fb-watchman/index.d.ts create mode 100644 types/fb-watchman/tsconfig.json create mode 100644 types/fb-watchman/tslint.json diff --git a/types/fb-watchman/fb-watchman-tests.ts b/types/fb-watchman/fb-watchman-tests.ts new file mode 100644 index 0000000000..9b1aeb387b --- /dev/null +++ b/types/fb-watchman/fb-watchman-tests.ts @@ -0,0 +1,14 @@ +import { Client } from "fb-watchman"; + +const client = new Client(); +const clientB = new Client({}); + +client.capabilityCheck({ optional: [], required: ['relative_root'] }, e => { + if (e) { + client.end(); + return; + } +}); +client.connect(); + +client.command(['watch-project', '/tmp'], () => {}); diff --git a/types/fb-watchman/index.d.ts b/types/fb-watchman/index.d.ts new file mode 100644 index 0000000000..a009cbe247 --- /dev/null +++ b/types/fb-watchman/index.d.ts @@ -0,0 +1,38 @@ +// Type definitions for fb-watchman 2.0 +// Project: https://facebook.github.io/watchman/ +// Definitions by: Wu Haotian +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { EventEmitter } from 'events'; + +// Emit the responses to these when they get sent down to us +export type UnilateralTags = 'unilateralTags' | 'log'; + +export interface ClientOptions { + /** + * Absolute path to the watchman binary. + * If not provided, the Client locates the binary using the PATH specified + * by the node child_process's default env. + */ + watchmanBinaryPath?: string; +} + +export interface Capabilities { + optional: any[]; + required: any[]; +} + +export type doneCallback = (error?: Error | null, resp?: any) => any; + +export class Client extends EventEmitter { + constructor(options?: ClientOptions) + sendNextCommand(): void; + cancelCommands(why: string): void; + connect(): void; + command(args: any, done: doneCallback): void; + capabilityCheck( + caps: Capabilities, + done: doneCallback, + ): void; + end(): void; +} diff --git a/types/fb-watchman/tsconfig.json b/types/fb-watchman/tsconfig.json new file mode 100644 index 0000000000..83ad2335ea --- /dev/null +++ b/types/fb-watchman/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "fb-watchman-tests.ts" + ] +} diff --git a/types/fb-watchman/tslint.json b/types/fb-watchman/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fb-watchman/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 6a9edddf73922999239d93a28518cb65da55d2b0 Mon Sep 17 00:00:00 2001 From: Christian Chown Date: Mon, 9 Apr 2018 17:53:58 +0100 Subject: [PATCH 0484/2153] react-native-android-taskdescription initial commit (#24813) --- .../index.d.ts | 14 +++++++++++ ...t-native-android-taskdescription-tests.tsx | 9 +++++++ .../tsconfig.json | 24 +++++++++++++++++++ .../tslint.json | 1 + 4 files changed, 48 insertions(+) create mode 100644 types/react-native-android-taskdescription/index.d.ts create mode 100644 types/react-native-android-taskdescription/react-native-android-taskdescription-tests.tsx create mode 100644 types/react-native-android-taskdescription/tsconfig.json create mode 100644 types/react-native-android-taskdescription/tslint.json diff --git a/types/react-native-android-taskdescription/index.d.ts b/types/react-native-android-taskdescription/index.d.ts new file mode 100644 index 0000000000..0f395e91f2 --- /dev/null +++ b/types/react-native-android-taskdescription/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for react-native-android-taskdescription 1.0 +// Project: https://github.com/jwarby/react-native-android-taskdescription +// Definitions by: Christian Chown +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from 'react'; + +export interface ReactNativeAndroidTaskDescriptionProps { + backgroundColor?: string; + label?: string; +} + +export default class ReactNativeAndroidTaskDescription extends React.Component {} diff --git a/types/react-native-android-taskdescription/react-native-android-taskdescription-tests.tsx b/types/react-native-android-taskdescription/react-native-android-taskdescription-tests.tsx new file mode 100644 index 0000000000..a49036e519 --- /dev/null +++ b/types/react-native-android-taskdescription/react-native-android-taskdescription-tests.tsx @@ -0,0 +1,9 @@ +import * as React from 'react'; +import ReactNativeAndroidTaskDescription from 'react-native-android-taskdescription'; + +const test: React.SFC = () => ( + +); diff --git a/types/react-native-android-taskdescription/tsconfig.json b/types/react-native-android-taskdescription/tsconfig.json new file mode 100644 index 0000000000..e36bea114b --- /dev/null +++ b/types/react-native-android-taskdescription/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react-native", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-native-android-taskdescription-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/react-native-android-taskdescription/tslint.json b/types/react-native-android-taskdescription/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/react-native-android-taskdescription/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file From 6fda8a5f9dbe3514b08956969f9aef59462c125c Mon Sep 17 00:00:00 2001 From: Christian Chown Date: Mon, 9 Apr 2018 17:54:16 +0100 Subject: [PATCH 0485/2153] react-native-photo-view initial commit (#24812) --- types/react-native-photo-view/index.d.ts | 30 +++++++++++++++ .../react-native-photo-view-tests.tsx | 38 +++++++++++++++++++ types/react-native-photo-view/tsconfig.json | 24 ++++++++++++ types/react-native-photo-view/tslint.json | 1 + 4 files changed, 93 insertions(+) create mode 100644 types/react-native-photo-view/index.d.ts create mode 100644 types/react-native-photo-view/react-native-photo-view-tests.tsx create mode 100644 types/react-native-photo-view/tsconfig.json create mode 100644 types/react-native-photo-view/tslint.json diff --git a/types/react-native-photo-view/index.d.ts b/types/react-native-photo-view/index.d.ts new file mode 100644 index 0000000000..8979635288 --- /dev/null +++ b/types/react-native-photo-view/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for react-native-photo-view 1.5 +// Project: https://github.com/alwx/react-native-photo-view +// Definitions by: Christian Chown +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from 'react'; +import { ImagePropertiesSourceOptions, ViewProperties } from 'react-native'; + +export interface ReactNativePhotoViewProps { + source?: ImagePropertiesSourceOptions; + loadingIndicatorSource?: ImagePropertiesSourceOptions; + fadeDuration?: number; + minimumZoomScale?: number; + maximumZoomScale?: number; + showsHorizontalScrollIndicator?: boolean; + showsVerticalScrollIndicator?: boolean; + scale?: number; + androidZoomTransitionDuration?: number; + androidScaleType?: 'center' | 'centerCrop' | 'centerInside' | 'fitCenter' | 'fitStart' | 'fitEnd' | 'fitXY'; + onLoadStart?: () => void; + onLoad?: () => void; + onLoadEnd?: () => void; + onProgress?: (loaded: number, total: number) => void; + onTap?: (point: {x: number, y: number}, target?: React.ReactElement) => void; + onViewTap?: (point: {x: number, y: number}, target?: React.ReactElement) => void; + onScale?: (scale: number, target?: React.ReactElement) => void; +} + +export default class ReactNativePhotoView extends React.Component {} diff --git a/types/react-native-photo-view/react-native-photo-view-tests.tsx b/types/react-native-photo-view/react-native-photo-view-tests.tsx new file mode 100644 index 0000000000..f83168d280 --- /dev/null +++ b/types/react-native-photo-view/react-native-photo-view-tests.tsx @@ -0,0 +1,38 @@ +import * as React from 'react'; +import ReactNativePhotoView from 'react-native-photo-view'; + +const test: React.SFC = () => ( + { + console.log('onLoadStart'); + }} + onLoad={() => { + console.log('onLoad'); + }} + onLoadEnd={() => { + console.log('onLoadEnd'); + }} + onProgress={(loaded: number, total: number) => { + console.log(`onProgress ${loaded}/${total}`); + }} + onTap={(point: {x: number; y: number}, target?: React.ReactElement) => { + console.log('onTap'); + }} + onViewTap={(point: {x: number; y: number}, target?: React.ReactElement) => { + console.log(`onViewTap ${point.x},${point.y} ${!!target ? 'targetted' : ''}`); + }} + onScale={(scale: number, target?: React.ReactElement) => { + console.log(`onScale ${scale} ${!!target ? 'targetted' : ''}`); + }} + /> +); diff --git a/types/react-native-photo-view/tsconfig.json b/types/react-native-photo-view/tsconfig.json new file mode 100644 index 0000000000..f6147e7192 --- /dev/null +++ b/types/react-native-photo-view/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react-native", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-native-photo-view-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/react-native-photo-view/tslint.json b/types/react-native-photo-view/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/react-native-photo-view/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file From ad0637bfe32c42d5f5cb99bbc86d5a3abd93c8a3 Mon Sep 17 00:00:00 2001 From: Angel Merino Date: Mon, 9 Apr 2018 18:56:02 +0200 Subject: [PATCH 0486/2153] Add types for dnssd (#24760) * Added types for dnssd * Cosmetics, test passed * Removed unused rules --- types/dnssd/dnssd-tests.ts | 6 ++++ types/dnssd/index.d.ts | 58 ++++++++++++++++++++++++++++++++++++++ types/dnssd/tsconfig.json | 23 +++++++++++++++ types/dnssd/tslint.json | 1 + 4 files changed, 88 insertions(+) create mode 100644 types/dnssd/dnssd-tests.ts create mode 100644 types/dnssd/index.d.ts create mode 100644 types/dnssd/tsconfig.json create mode 100644 types/dnssd/tslint.json diff --git a/types/dnssd/dnssd-tests.ts b/types/dnssd/dnssd-tests.ts new file mode 100644 index 0000000000..14b637d384 --- /dev/null +++ b/types/dnssd/dnssd-tests.ts @@ -0,0 +1,6 @@ +import * as dnssd from 'dnssd'; + +const serviceType = new dnssd.ServiceType(dnssd.tcp('_mqtt'), dnssd.udp('_mqtt')); + +const advertisement = new dnssd.Advertisement(serviceType, 1883, { name: 'broker' }); +const browser: dnssd.Browser = new dnssd.Browser(serviceType); diff --git a/types/dnssd/index.d.ts b/types/dnssd/index.d.ts new file mode 100644 index 0000000000..3f5617afcb --- /dev/null +++ b/types/dnssd/index.d.ts @@ -0,0 +1,58 @@ +// Type definitions for dnssd 0.3 +// Project: https://github.com/DeMille/dnssd.js#readme +// Definitions by: Angel Merino +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +/** Declaration file generated by dts-gen */ + +export class Advertisement { + constructor(type: any, port: any, ...args: any[]); + + start(): any; + + stop(forceImmediate: any, callback: any): void; + + updateTXT(txtObj: any): void; +} + +export class Browser { + constructor(type: any, ...args: any[]); + + list(): any; + + start(): any; + + stop(): any; +} + +export class ServiceType { + constructor(...args: any[]); + + toString(): any; + + static all(): any; + + static tcp(...args: any[]): any; + + static udp(...args: any[]): any; +} + +export const resolveA: any; + +export const resolveAAAA: any; + +export function all(): any; + +export function resolve(name: any, type: any, ...args: any[]): any; + +export function resolveSRV(name: any, opts: any): any; + +export function resolveService(name: any, ...args: any[]): any; + +export function resolveTXT(name: any, opts: any): any; + +export function tcp(...args: any[]): any; + +export function udp(...args: any[]): any; diff --git a/types/dnssd/tsconfig.json b/types/dnssd/tsconfig.json new file mode 100644 index 0000000000..88346a63fd --- /dev/null +++ b/types/dnssd/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dnssd-tests.ts" + ] +} diff --git a/types/dnssd/tslint.json b/types/dnssd/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/dnssd/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 65f148de7d22e0e2fbdc89db5fcb2a088042bcb3 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Mon, 9 Apr 2018 18:58:52 +0200 Subject: [PATCH 0487/2153] Add type for react-native-permissions (#24793) --- types/react-native-permissions/index.d.ts | 28 +++++++++++++++++++ .../react-native-permissions-tests.ts | 9 ++++++ types/react-native-permissions/tsconfig.json | 23 +++++++++++++++ types/react-native-permissions/tslint.json | 1 + 4 files changed, 61 insertions(+) create mode 100644 types/react-native-permissions/index.d.ts create mode 100644 types/react-native-permissions/react-native-permissions-tests.ts create mode 100644 types/react-native-permissions/tsconfig.json create mode 100644 types/react-native-permissions/tslint.json diff --git a/types/react-native-permissions/index.d.ts b/types/react-native-permissions/index.d.ts new file mode 100644 index 0000000000..4b08cee5b3 --- /dev/null +++ b/types/react-native-permissions/index.d.ts @@ -0,0 +1,28 @@ +// Type definitions for react-native-permissions 1.1 +// Project: https://github.com/yonahforst/react-native-permissions +// Definitions by: Vincent Langlet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +type Status = 'authorized' | 'denied' | 'restricted' | 'undetermined'; + +interface Rationale { + title: string; + message: string; +} + +type CheckOptions = string | { type: string }; + +type RequestOptions = string | { type: string, rationale?: Rationale }; + +interface ReactNativePermissions { + canOpenSettings: () => Promise; + openSettings: () => Promise; + getTypes: () => string[]; + check: (permission: string, options?: CheckOptions) => Promise; + request: (permission: string, options?: RequestOptions) => Promise; + checkMultiple: (permissions: string[]) => Promise<{ [key: string]: string }>; +} + +declare const Permissions: ReactNativePermissions; + +export default Permissions; diff --git a/types/react-native-permissions/react-native-permissions-tests.ts b/types/react-native-permissions/react-native-permissions-tests.ts new file mode 100644 index 0000000000..f4595f558c --- /dev/null +++ b/types/react-native-permissions/react-native-permissions-tests.ts @@ -0,0 +1,9 @@ +import Permissions from 'react-native-permissions'; + +const firstType = Permissions.getTypes()[0]; + +Permissions.canOpenSettings().then(); +Permissions.openSettings().then(); +Permissions.check('geolocation').then(); +Permissions.request('geolocation').then(); +Permissions.checkMultiple(['geolocation', 'notification']).then(); diff --git a/types/react-native-permissions/tsconfig.json b/types/react-native-permissions/tsconfig.json new file mode 100644 index 0000000000..6c1dc92447 --- /dev/null +++ b/types/react-native-permissions/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-native-permissions-tests.ts" + ] +} diff --git a/types/react-native-permissions/tslint.json b/types/react-native-permissions/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-native-permissions/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From d4cb87d64d01d221d5a043f53278352cc610f967 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Mon, 9 Apr 2018 18:59:12 +0200 Subject: [PATCH 0488/2153] Add type for react-native-version-number module (#24789) --- types/react-native-version-number/index.d.ts | 14 +++++++++++ .../react-native-version-number-tests.ts | 22 ++++++++++++++++++ .../react-native-version-number/tsconfig.json | 23 +++++++++++++++++++ types/react-native-version-number/tslint.json | 1 + 4 files changed, 60 insertions(+) create mode 100644 types/react-native-version-number/index.d.ts create mode 100644 types/react-native-version-number/react-native-version-number-tests.ts create mode 100644 types/react-native-version-number/tsconfig.json create mode 100644 types/react-native-version-number/tslint.json diff --git a/types/react-native-version-number/index.d.ts b/types/react-native-version-number/index.d.ts new file mode 100644 index 0000000000..313f19fe5b --- /dev/null +++ b/types/react-native-version-number/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for react-native-version-number 0.3 +// Project: https://github.com/APSL/react-native-version-number +// Definitions by: Vincent Langlet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface VersionNumber { + appVersion?: string; + buildVersion?: string; + bundleIdentifier?: string; +} + +declare const VersionNumber: VersionNumber; + +export default VersionNumber; diff --git a/types/react-native-version-number/react-native-version-number-tests.ts b/types/react-native-version-number/react-native-version-number-tests.ts new file mode 100644 index 0000000000..e218345a8e --- /dev/null +++ b/types/react-native-version-number/react-native-version-number-tests.ts @@ -0,0 +1,22 @@ +import VersionNumber from 'react-native-version-number'; + +const FullVersionNumber: VersionNumber = { + appVersion: '1.0', + buildVersion: '42', + bundleIdentifier: 'com.foo.bar.MyApp', +}; + +const MissingAppVersionNumber: VersionNumber = { + buildVersion: '42', + bundleIdentifier: 'com.foo.bar.MyApp', +}; + +const MissingBuildVersionNumber: VersionNumber = { + appVersion: '1.0', + bundleIdentifier: 'com.foo.bar.MyApp', +}; + +const MissingBundleVersionNumber: VersionNumber = { + appVersion: '1.0', + buildVersion: '42', +}; diff --git a/types/react-native-version-number/tsconfig.json b/types/react-native-version-number/tsconfig.json new file mode 100644 index 0000000000..15e55211ff --- /dev/null +++ b/types/react-native-version-number/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-native-version-number-tests.ts" + ] +} diff --git a/types/react-native-version-number/tslint.json b/types/react-native-version-number/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-native-version-number/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 13a7c4201358ca9cc3e8d39552f8be9acfe73fe5 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Mon, 9 Apr 2018 18:59:36 +0200 Subject: [PATCH 0489/2153] [react-native-i18n] Add type for react-native-i18n module (#24790) * Add type for react-native-i18n * Fix tests with correct typescript version --- types/react-native-i18n/index.d.ts | 11 +++++++++ .../react-native-i18n-tests.ts | 10 ++++++++ types/react-native-i18n/tsconfig.json | 23 +++++++++++++++++++ types/react-native-i18n/tslint.json | 1 + 4 files changed, 45 insertions(+) create mode 100644 types/react-native-i18n/index.d.ts create mode 100644 types/react-native-i18n/react-native-i18n-tests.ts create mode 100644 types/react-native-i18n/tsconfig.json create mode 100644 types/react-native-i18n/tslint.json diff --git a/types/react-native-i18n/index.d.ts b/types/react-native-i18n/index.d.ts new file mode 100644 index 0000000000..00d50e3caf --- /dev/null +++ b/types/react-native-i18n/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for react-native-i18n 2.0 +// Project: https://github.com/AlexanderZaytsev/react-native-i18n +// Definitions by: Vincent Langlet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import I18n = require("i18n-js"); + +export function getLanguages(): Promise; + +export default I18n; diff --git a/types/react-native-i18n/react-native-i18n-tests.ts b/types/react-native-i18n/react-native-i18n-tests.ts new file mode 100644 index 0000000000..1ab2134c69 --- /dev/null +++ b/types/react-native-i18n/react-native-i18n-tests.ts @@ -0,0 +1,10 @@ +import I18n, { getLanguages } from 'react-native-i18n'; + +getLanguages().then(languages => languages[0]); + +I18n.defaultLocale = 'en'; +I18n.fallbacks = true; +I18n.translations = {}; +I18n.locale = 'fr'; + +const currentLocale: string = I18n.currentLocale(); diff --git a/types/react-native-i18n/tsconfig.json b/types/react-native-i18n/tsconfig.json new file mode 100644 index 0000000000..f6a744565f --- /dev/null +++ b/types/react-native-i18n/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-native-i18n-tests.ts" + ] +} diff --git a/types/react-native-i18n/tslint.json b/types/react-native-i18n/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-native-i18n/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 6235cb3eb1361a99aab8bb2833d3c8051f45899e Mon Sep 17 00:00:00 2001 From: Omar Diab Date: Mon, 9 Apr 2018 10:00:13 -0700 Subject: [PATCH 0490/2153] add react-mailchimp-subscribe (#24783) --- types/react-mailchimp-subscribe/index.d.ts | 51 +++++++++++++++++ .../react-mailchimp-subscribe-tests.tsx | 57 +++++++++++++++++++ types/react-mailchimp-subscribe/tsconfig.json | 24 ++++++++ types/react-mailchimp-subscribe/tslint.json | 1 + 4 files changed, 133 insertions(+) create mode 100644 types/react-mailchimp-subscribe/index.d.ts create mode 100644 types/react-mailchimp-subscribe/react-mailchimp-subscribe-tests.tsx create mode 100644 types/react-mailchimp-subscribe/tsconfig.json create mode 100644 types/react-mailchimp-subscribe/tslint.json diff --git a/types/react-mailchimp-subscribe/index.d.ts b/types/react-mailchimp-subscribe/index.d.ts new file mode 100644 index 0000000000..558c6a92cd --- /dev/null +++ b/types/react-mailchimp-subscribe/index.d.ts @@ -0,0 +1,51 @@ +// Type definitions for react-mailchimp-subscribe 2.0 +// Project: https://revolunet.github.io/react-mailchimp-subscribe/ +// Definitions by: Omar Diab +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import { Component, ReactNode } from "react"; + +// A few common set of form fields, based on defaults in Mailchimp's website +export interface EmailFormFields { + EMAIL: string; +} + +export interface NameFormFields extends EmailFormFields { + FNAME: string; + LNAME: string; +} + +export interface ClassicFormFields extends NameFormFields { + "BIRTHDAY[month]": number; + "BIRTHDAY[day]": number; +} + +// library default form just sends EMAIL +export type DefaultFormFields = EmailFormFields; + +export interface ResponseArgs { + status: "success" | "error"; + message: string; +} + +export interface PendingArgs { + status: "sending" | null; + message: null; +} + +export interface SubscribeArg { + subscribe: (data: FormFields) => void; +} + +export type FormHooks = SubscribeArg & + (ResponseArgs | PendingArgs); + +export interface Props { + render?: (hooks: FormHooks) => ReactNode; + url: string; +} + +export default class MailchimpSubscribe extends Component< + Props +> {} diff --git a/types/react-mailchimp-subscribe/react-mailchimp-subscribe-tests.tsx b/types/react-mailchimp-subscribe/react-mailchimp-subscribe-tests.tsx new file mode 100644 index 0000000000..0507d7657a --- /dev/null +++ b/types/react-mailchimp-subscribe/react-mailchimp-subscribe-tests.tsx @@ -0,0 +1,57 @@ +import * as React from "react"; +import MailchimpSubscribe, { + NameFormFields +} from "react-mailchimp-subscribe"; + +const Example: React.StatelessComponent = () => ( + <> + (<> + { hooks.status === "error" && + hooks.message + } + { hooks.status === "sending" && + Sending! + } + { hooks.status === "success" && + It's been sent! {hooks.message} + } + { + e.preventDefault(); + hooks.subscribe({ EMAIL: "8675309@aol.com" }); + }} + /> + )} + url="spam.biz/subscribe" + /> + { /* once Typescript 2.9 is out, generics in components will be allowed, at that point uncomment these. */ } + { /* https://github.com/Microsoft/TypeScript/pull/22415 */ } + {/* + render={(hooks) => ( + { + e.preventDefault(); + hooks.subscribe({ myArbitraryData: "is here!" }); + }} + /> + )} + url="spam.biz/subscribe" + /> + + render={(hooks) => ( + { + e.preventDefault(); + hooks.subscribe({ + FNAME: "大", + LNAME: "哥", + EMAIL: "da.ge@qq.com", + }); + }} + /> + )} + url="spam.biz/subscribe" + /> */} + +); diff --git a/types/react-mailchimp-subscribe/tsconfig.json b/types/react-mailchimp-subscribe/tsconfig.json new file mode 100644 index 0000000000..4f2f142ca5 --- /dev/null +++ b/types/react-mailchimp-subscribe/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-mailchimp-subscribe-tests.tsx" + ] +} diff --git a/types/react-mailchimp-subscribe/tslint.json b/types/react-mailchimp-subscribe/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-mailchimp-subscribe/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 7dd9844eae873fc2e78ff99dc29caaec5d081258 Mon Sep 17 00:00:00 2001 From: Furos86 Date: Mon, 9 Apr 2018 19:01:15 +0200 Subject: [PATCH 0491/2153] Added onProgress and onError arguments to the load function of MaterialLoader (#24834) see https://threejs.org/docs/#api/loaders/MaterialLoader.load --- types/three/three-core.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 2487b117b1..ffaa34434f 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -2251,7 +2251,7 @@ export class MaterialLoader { manager: LoadingManager; textures: { [key: string]: Texture }; - load(url: string, onLoad: (material: Material) => void): void; + load(url: string, onLoad: (material: Material) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: Error | ErrorEvent) => void): void; setTextures(textures: { [key: string]: Texture }): void; getTexture(name: string): Texture; parse(json: any): Material; From 4fec28ab9ae8c16a15c4802ba3b2dc51633aab4a Mon Sep 17 00:00:00 2001 From: Edo Rivai Date: Mon, 9 Apr 2018 19:01:37 +0200 Subject: [PATCH 0492/2153] [nock] Add Promise based Nock Back types (#24808) * [nock] Add Promise based Nock Back types Documentation: https://github.com/node-nock/nock#nock-back * [nock] Add test for promised nockBack --- types/nock/index.d.ts | 7 +++++++ types/nock/nock-tests.ts | 22 ++++++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/types/nock/index.d.ts b/types/nock/index.d.ts index 91037b8e54..90eae08189 100644 --- a/types/nock/index.d.ts +++ b/types/nock/index.d.ts @@ -158,6 +158,13 @@ declare namespace nock { (fixtureName: string, nockedFn: (nockDone: () => void) => void): void; (fixtureName: string, options: NockBackOptions, nockedFn: (nockDone: () => void) => void): void; + (fixtureName: string, options?: NockBackOptions): Promise<{ nockDone: () => void, context: NockBackContext }>; + } + + export interface NockBackContext { + scopes: Scope[]; + assertScopesFinished(): void; + isLoaded: boolean; } export interface NockBackOptions { diff --git a/types/nock/nock-tests.ts b/types/nock/nock-tests.ts index 44397db941..7ed4ecc25d 100644 --- a/types/nock/nock-tests.ts +++ b/types/nock/nock-tests.ts @@ -72,10 +72,10 @@ scope = inst.reply(num, str); scope = inst.reply(num, str, headers); scope = inst.reply(num, obj, headers); scope = inst.reply(num, (uri: string, body: string) => { - return str; + return str; }); scope = inst.reply(num, (uri: string, body: string) => { - return str; + return str; }, headers); scope = inst.replyWithFile(num, str); @@ -97,11 +97,11 @@ inst = inst.delayConnection(num); scope = scope.filteringPath(regex, str); scope = scope.filteringPath((path: string) => { - return str; + return str; }); scope = scope.filteringRequestBody(regex, str); scope = scope.filteringRequestBody((path: string) => { - return str; + return str; }); scope = scope.log(() => { }); @@ -126,8 +126,8 @@ scope.restore(); nock.recorder.rec(); nock.recorder.rec(true); nock.recorder.rec({ - dont_print: true, - output_objects: true + dont_print: true, + output_objects: true }); nock.recorder.clear(); strings = nock.recorder.play() as string[]; @@ -713,6 +713,12 @@ nockBack('zomboFixture.json', { before, after }, (nockDone: () => void) => { }); }); +// in promise mode +nockBack('promisedFixture.json') + .then(({nockDone, context}) => { + context.assertScopesFinished(); - - + // do your tests returning a promise and chain it with + Promise.resolve('foo') + .then(nockDone); + }); From 6a75839b6f143a8ff1eed890517e9e5e9fb40460 Mon Sep 17 00:00:00 2001 From: milan-mimra <38138968+milan-mimra@users.noreply.github.com> Date: Mon, 9 Apr 2018 19:02:01 +0200 Subject: [PATCH 0493/2153] [express-jwt] Fixed UnauthorizedError definiton - #22781 (#24776) --- types/express-jwt/express-jwt-tests.ts | 2 +- types/express-jwt/index.d.ts | 24 +++++++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/types/express-jwt/express-jwt-tests.ts b/types/express-jwt/express-jwt-tests.ts index 9de759adb2..a4d4d11845 100644 --- a/types/express-jwt/express-jwt-tests.ts +++ b/types/express-jwt/express-jwt-tests.ts @@ -45,6 +45,6 @@ app.use(function (err: any, req: express.Request, res: express.Response, next: e res.end(); } } else { - next(err); + next(new jwt.UnauthorizedError('invalid_token', new Error('error-message'))); } }); diff --git a/types/express-jwt/index.d.ts b/types/express-jwt/index.d.ts index 33c1206254..1187f4fbca 100644 --- a/types/express-jwt/index.d.ts +++ b/types/express-jwt/index.d.ts @@ -1,6 +1,9 @@ // Type definitions for express-jwt // Project: https://www.npmjs.org/package/express-jwt -// Definitions by: Wonshik Kim , Kacper Polak , Sl1MBoy +// Definitions by: Wonshik Kim +// Kacper Polak +// Sl1MBoy +// Milan Mimra // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -12,17 +15,22 @@ export = jwt; declare function jwt(options: jwt.Options): jwt.RequestHandler; declare namespace jwt { export type secretType = string | Buffer + export type ErrorCode = + "revoked_token" | + "invalid_token" | + "credentials_bad_scheme" | + "credentials_bad_format" | + "credentials_required" + export interface SecretCallbackLong { (req: express.Request, header: any, payload: any, done: (err: any, secret?: secretType) => void): void; } export interface SecretCallback { (req: express.Request, payload: any, done: (err: any, secret?: secretType) => void): void; } - export interface IsRevokedCallback { (req: express.Request, payload: any, done: (err: any, revoked?: boolean) => void): void; } - export interface GetTokenCallback { (req: express.Request): any; } @@ -41,11 +49,13 @@ declare namespace jwt { } export class UnauthorizedError extends Error { - name: string; - message: string; - code: string; status: number; - inner: Error + message: string; + name: 'UnauthorizedError'; + code: ErrorCode; + inner: { message: string }; + + constructor(code: ErrorCode, error: { message: string }); } } declare global { From 00ca94db93dd766471b3fb4a4bc2863583a523f5 Mon Sep 17 00:00:00 2001 From: Dylan Simon Date: Mon, 9 Apr 2018 13:02:39 -0400 Subject: [PATCH 0494/2153] chart.js: add ChartOptions.onHover alias and amend type (#24740) Present in 2.7 as per docs and code --- types/chart.js/chart.js-tests.ts | 3 +++ types/chart.js/index.d.ts | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index 6041889b66..03c347fee7 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -21,6 +21,9 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), { hover: { intersect: true }, + onHover(ev: MouseEvent, points: any[]) { + return; + }, tooltips: { filter: data => Number(data.yLabel) > 0, intersect: true, diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index c637164d30..9e1a511229 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -184,6 +184,7 @@ declare namespace Chart { aspectRatio?: number; maintainAspectRatio?: boolean; events?: string[]; + onHover?(this: Chart, event: MouseEvent, activeElements: Array<{}>): any; onClick?(event?: MouseEvent, activeElements?: Array<{}>): any; title?: ChartTitleOptions; legend?: ChartLegendOptions; @@ -291,7 +292,7 @@ declare namespace Chart { mode?: string; animationDuration?: number; intersect?: boolean; - onHover?(active: any): void; + onHover?(this: Chart, event: MouseEvent, activeElements: Array<{}>): any; } interface ChartAnimationObject { From e2efee7a56b6f80604a2a10df162cd27cb306e25 Mon Sep 17 00:00:00 2001 From: Felix Date: Tue, 10 Apr 2018 00:03:42 +0700 Subject: [PATCH 0495/2153] radium: update typings to fit with new default export in radium >= 0.22.0 (#24686) * radium: update typings to fit with new default export in radium >= 0.22.0 * radium: replace tabs with spaces * radium: updated radium version number in header comment --- types/radium/index.d.ts | 4 ++-- types/radium/radium-tests.tsx | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/types/radium/index.d.ts b/types/radium/index.d.ts index d861783e92..ce5ae3776a 100644 --- a/types/radium/index.d.ts +++ b/types/radium/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for radium 0.18.1 +// Type definitions for radium 0.24.0 // Project: https://github.com/formidablelabs/radium // Definitions by: Alex Gorbatchev , Philipp Holzer , Alexey Svetliakov , Mikael Hermansson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,7 +6,7 @@ import * as React from 'react'; -export = Radium; +export default Radium; // @Radium decorator declare function Radium(component: TElement): TElement; diff --git a/types/radium/radium-tests.tsx b/types/radium/radium-tests.tsx index 6b7aaa1a46..d7fece99c7 100644 --- a/types/radium/radium-tests.tsx +++ b/types/radium/radium-tests.tsx @@ -1,6 +1,6 @@ import * as React from "react"; -import { StyleRoot, Style } from "radium"; -import Radium = require('radium'); +import Radium from "radium"; + @Radium class TestComponent extends React.Component<{ a: number }> { @@ -29,7 +29,7 @@ class TestComponentWithConfig extends React.Component<{ a?: number }> { return (
    - - +
    ) @@ -62,7 +62,7 @@ class TestComponentWithConfigInStyleRoot userAgent: "test", matchMedia: window.matchMedia }} > - - +
    ) From 78350168c5b9a66a4699d8a7af143efc1c5c95bf Mon Sep 17 00:00:00 2001 From: Simon Buchan Date: Tue, 10 Apr 2018 05:21:48 +1200 Subject: [PATCH 0496/2153] [aws-lambda] Rutime node8.10 support. (#24823) Bump version to 8.10 to match current runtime, allow returning result promises in handlers. --- types/aws-lambda/aws-lambda-tests.ts | 23 +++++++++++++++++++++-- types/aws-lambda/index.d.ts | 9 +++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index 1441c6b794..f4f97ccfc4 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -607,8 +607,27 @@ context.fail(str); /* Handler */ let handler: AWSLambda.Handler = (event: any, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; -// async methods return Promise, test assignability -let asyncHandler: AWSLambda.Handler = async (event: any, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; +/* In node8.10 runtime, handlers may return a promise for the result value, so existing async + * handlers that return Promise before calling the callback will now have a `null` result. + * Be safe and make that badly typed with a major verson bump to 8.10 so users expect the breaking change, + * since the upgrade effort should be pretty low in most cases, and it points them at a nicer solution. + */ +// $ExpectError +let legacyAsyncHandler: AWSLambda.APIGatewayProxyHandler = async ( + event: AWSLambda.APIGatewayProxyEvent, + context: AWSLambda.Context, + cb: AWSLambda.Callback, +) => { + cb(null, { statusCode: 200, body: 'No longer valid' }); +}; + +let node8AsyncHandler: AWSLambda.APIGatewayProxyHandler = async ( + event: AWSLambda.APIGatewayProxyEvent, + context: AWSLambda.Context, + cb: AWSLambda.Callback, +) => { + return { statusCode: 200, body: 'Is now valid!' }; +}; let inferredHandler: AWSLambda.S3Handler = (event, context, cb) => { // $ExpectType S3Event diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index 8da84c6ff3..bd108fa2a5 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for AWS Lambda +// Type definitions for AWS Lambda 8.10 // Project: http://docs.aws.amazon.com/lambda // Definitions by: James Darbyshire // Michael Skarum @@ -562,8 +562,13 @@ export interface KinesisStreamEvent { * @param event – event data. * @param context – runtime information of the Lambda function that is executing. * @param callback – optional callback to return information to the caller, otherwise return value is null. + * @return In the node8.10 runtime, a promise for the lambda result. */ -export type Handler = (event: TEvent, context: Context, callback: Callback) => void; +export type Handler = ( + event: TEvent, + context: Context, + callback: Callback, +) => void | Promise; /** * Optional callback parameter. From 882c7f38297a1d7316f6a36ed09627adccd17661 Mon Sep 17 00:00:00 2001 From: Stefan Lacatus Date: Mon, 9 Apr 2018 20:22:59 +0300 Subject: [PATCH 0497/2153] [Three] Added missing methods in Transform Controls (#24819) * Update three-transformcontrols.d.ts Added missing methods * Update three-core.d.ts Added missing isMesh prop --- types/three/three-core.d.ts | 1 + types/three/three-transformcontrols.d.ts | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index ffaa34434f..6d06b2a6f6 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -5110,6 +5110,7 @@ export class Mesh extends Object3D { drawMode: TrianglesDrawModes; morphTargetInfluences?: number[]; morphTargetDictionary?: { [key: string]: number; }; + isMesh: boolean; setDrawMode(drawMode: TrianglesDrawModes): void; updateMorphTargets(): void; diff --git a/types/three/three-transformcontrols.d.ts b/types/three/three-transformcontrols.d.ts index 3f3713256d..15ac11eda0 100644 --- a/types/three/three-transformcontrols.d.ts +++ b/types/three/three-transformcontrols.d.ts @@ -2,6 +2,10 @@ import { Camera, Object3D } from "./three-core"; export class TransformControls extends Object3D { constructor(object: Camera, domElement?: HTMLElement); + + size: number; + + space: string; object: Object3D; @@ -20,5 +24,9 @@ export class TransformControls extends Object3D { setSize(size: number): void; setSpace(space: string): void; + + setTranslationSnap(size: number): void; + + setRotationSnap(size: number): void; } From c2613828079f094ae3690e604819f3587a67aa0e Mon Sep 17 00:00:00 2001 From: FishOrBear Date: Tue, 10 Apr 2018 01:23:11 +0800 Subject: [PATCH 0498/2153] Geometry: Move computeLineDistance() to Line (#24803) * add 'Texture' attribute: 'center','rotation' * add 'ShapeBufferGeometry' * Geometry: Move computeLineDistance() to Line * return this --- types/three/three-core.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 6d06b2a6f6..0a17adf51b 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -5082,6 +5082,7 @@ export class Line extends Object3D { geometry: Geometry|BufferGeometry; material: Material; // LineDashedMaterial or LineBasicMaterial or ShaderMaterial + computeLineDistances(): this; raycast(raycaster: Raycaster, intersects: any): void; } From 089d5708060999599d4a317178671736ebdf74a0 Mon Sep 17 00:00:00 2001 From: Max Rumpf Date: Mon, 9 Apr 2018 19:23:22 +0200 Subject: [PATCH 0499/2153] [types/ejs] Also return undefined in Cache.get() (#24807) As lru-cache has `V | undefined`, this `get()` function should also mark undefined as possible return type to allow assigning an LRU to `cache`. --- types/ejs/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/ejs/index.d.ts b/types/ejs/index.d.ts index e785f2c6ae..e56ad1a8ec 100644 --- a/types/ejs/index.d.ts +++ b/types/ejs/index.d.ts @@ -108,7 +108,7 @@ export function escapeRegexChars(s: string): string; export function escapeXML(markup: string): string; export interface Cache { set(key: string, val: TemplateFunction): void; - get(key: string): TemplateFunction; + get(key: string): TemplateFunction | undefined; } export let delimiter: string; From 7fa673a804847c7f101084a4c27102e28036b28d Mon Sep 17 00:00:00 2001 From: Maciej Goszczycki Date: Mon, 9 Apr 2018 18:23:36 +0100 Subject: [PATCH 0500/2153] react-virtualized: Allow null tabIndex (#24777) --- types/react-virtualized/dist/es/Grid.d.ts | 2 +- types/react-virtualized/dist/es/List.d.ts | 2 +- types/react-virtualized/dist/es/Masonry.d.ts | 2 +- types/react-virtualized/dist/es/Table.d.ts | 2 +- types/react-virtualized/index.d.ts | 1 + 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/types/react-virtualized/dist/es/Grid.d.ts b/types/react-virtualized/dist/es/Grid.d.ts index 1cc1623a04..83230ca794 100644 --- a/types/react-virtualized/dist/es/Grid.d.ts +++ b/types/react-virtualized/dist/es/Grid.d.ts @@ -282,7 +282,7 @@ export type GridCoreProps = { /** Optional inline style */ style?: React.CSSProperties; /** Tab index for focus */ - tabIndex?: number; + tabIndex?: number | null; /** * Width of Grid; this property determines the number of visible (vs virtualized) columns. */ diff --git a/types/react-virtualized/dist/es/List.d.ts b/types/react-virtualized/dist/es/List.d.ts index 94dde630fd..7f550d2dcb 100644 --- a/types/react-virtualized/dist/es/List.d.ts +++ b/types/react-virtualized/dist/es/List.d.ts @@ -60,7 +60,7 @@ export type ListProps = GridCoreProps & { /** Optional inline style */ style?: React.CSSProperties; /** Tab index for focus */ - tabIndex?: number; + tabIndex?: number | null; /** Width of list */ width: number; } diff --git a/types/react-virtualized/dist/es/Masonry.d.ts b/types/react-virtualized/dist/es/Masonry.d.ts index 4c67835722..59394bc170 100644 --- a/types/react-virtualized/dist/es/Masonry.d.ts +++ b/types/react-virtualized/dist/es/Masonry.d.ts @@ -45,7 +45,7 @@ export type MasonryProps = { scrollingResetTimeInterval?: number, scrollTop?: number, style?: React.CSSProperties, - tabIndex?: number, + tabIndex?: number | null, width: number, /** * PLEASE NOTE diff --git a/types/react-virtualized/dist/es/Table.d.ts b/types/react-virtualized/dist/es/Table.d.ts index 87f79de86d..f74c816463 100644 --- a/types/react-virtualized/dist/es/Table.d.ts +++ b/types/react-virtualized/dist/es/Table.d.ts @@ -291,7 +291,7 @@ export type TableProps = GridCoreProps & { /** Optional inline style */ style?: React.CSSProperties; /** Tab index for focus */ - tabIndex?: number; + tabIndex?: number | null; /** Width of list */ width?: number; } diff --git a/types/react-virtualized/index.d.ts b/types/react-virtualized/index.d.ts index 8159c49ff2..18710b4983 100644 --- a/types/react-virtualized/index.d.ts +++ b/types/react-virtualized/index.d.ts @@ -6,6 +6,7 @@ // Szőke Szabolcs // Kræn Hansen // Steve Zhang +// Maciej Goszczycki // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 From 2a755363046505c029ff06d39d03547473bea082 Mon Sep 17 00:00:00 2001 From: Pras Velagapudi Date: Mon, 9 Apr 2018 13:23:54 -0400 Subject: [PATCH 0501/2153] [stripe] Fix typo in `IProductCreationOptions`. (#24796) * [stripe] Fix typo in `IProductCreationOptions`. The `IProductCreationOptions` interface mistakenly lists `attribute` instead of `attributes` as a property. This does not not match [the API specification for product creation](https://stripe.com/docs/api#create_product), and attempting to actually populate this field results in: `Error: Received unknown parameter: attribute`. Changing this value to `attributes` successfully allows `stripe.products.create()` calls to succeed in populating attributes. * Added `attributes` to tests for product creation. --- types/stripe/index.d.ts | 2 +- types/stripe/stripe-tests.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index c43e3357a5..418525d38f 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -3029,7 +3029,7 @@ declare namespace Stripe { * A list of up to 5 alphanumeric attributes that each SKU can provide values for (e.g. ["color", "size"]). * Applicable to both service and good types. */ - attribute?: Array; + attributes?: Array; /** * A short one-line description of the product, meant to be displayable to the customer. May only be set if type=good. diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index 7a45ee9fca..e56a454108 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -796,13 +796,15 @@ stripe.accounts.createExternalAccount("", { external_account: "tok_15V2YhEe31JkL stripe.products.create({ name: "My amazing product", - type: "service" + type: "service", + attributes: ["color"] }, function (err, coupon) { // asynchronously called }); stripe.products.create({ name: "My amazing product", - type: "service" + type: "service", + attributes: ["color"] }).then(function (product) { // asynchronously called const prodType: "service" | "good" = product.type; From 67c33c9335f244228250bd34159fd09ba682d899 Mon Sep 17 00:00:00 2001 From: leozhao0709 Date: Mon, 9 Apr 2018 10:28:59 -0700 Subject: [PATCH 0502/2153] add proxy for StrategyOptions (#24784) This proxy property is used for some like heroku product using. --- types/passport-google-oauth2/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/passport-google-oauth2/index.d.ts b/types/passport-google-oauth2/index.d.ts index a2ba210c4b..cd40791eb7 100644 --- a/types/passport-google-oauth2/index.d.ts +++ b/types/passport-google-oauth2/index.d.ts @@ -12,6 +12,7 @@ export interface StrategyOptions { callbackURL: string; passReqToCallback?: true; scope?: string[]; + proxy?: boolean; } export interface StrategyOptionsWithRequest { From 3f8c6acca159a354188f77770efdf0b9650c778f Mon Sep 17 00:00:00 2001 From: Marks Polakovs Date: Mon, 9 Apr 2018 20:29:41 +0300 Subject: [PATCH 0503/2153] [hubot] Add type for Robot.adapter (#24735) * Type Response and ListenerCallback to avoid any type * Add tests for adapter type --- types/hubot/hubot-tests.ts | 5 +++-- types/hubot/index.d.ts | 17 +++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/types/hubot/hubot-tests.ts b/types/hubot/hubot-tests.ts index 9c5e832bc2..1c7540c950 100644 --- a/types/hubot/hubot-tests.ts +++ b/types/hubot/hubot-tests.ts @@ -4,11 +4,12 @@ const brain = new Hubot.Brain(); brain; // $ExpectType Brain brain.userForName('someone'); // $ExpectType any -const robot = new Hubot.Robot( +const robot = new Hubot.Robot<{}>( 'src/adapters', 'slack', false, 'hubot', ); -robot; // $ExpectType Robot +robot; // $ExpectType Robot<{}> +robot.adapter; // $ExpectType {} robot.hear(/hello/, () => null); // $ExpectType void diff --git a/types/hubot/index.d.ts b/types/hubot/index.d.ts index e0a809f69a..7da5501736 100644 --- a/types/hubot/index.d.ts +++ b/types/hubot/index.d.ts @@ -20,26 +20,27 @@ declare namespace Hubot { id: string; } - class Response { + class Response { match: RegExpMatchArray; message: Message; - constructor(robot: Robot, message: Message, match: RegExpMatchArray); + constructor(robot: R, message: Message, match: RegExpMatchArray); send(...strings: string[]): void; reply(...strings: string[]): void; random(items: T[]): T; } - type ListenerCallback = (response: Response) => void; + type ListenerCallback = (response: Response) => void; - class Robot { + class Robot { brain: Brain; + readonly adapter: A; constructor(adapterPath: string, adapter: string, httpd: boolean, name: string, alias?: string); - hear(regex: RegExp, callback: ListenerCallback): void; - hear(regex: RegExp, options: any, callback: ListenerCallback): void; - respond(regex: RegExp, callback: ListenerCallback): void; - respond(regex: RegExp, options: any, callback: ListenerCallback): void; + hear(regex: RegExp, callback: ListenerCallback): void; + hear(regex: RegExp, options: any, callback: ListenerCallback): void; + respond(regex: RegExp, callback: ListenerCallback): void; + respond(regex: RegExp, options: any, callback: ListenerCallback): void; } } From 3321a12dc9cf7d9758d195dbf96e76723906b7c5 Mon Sep 17 00:00:00 2001 From: Joha2n Date: Mon, 9 Apr 2018 19:29:54 +0200 Subject: [PATCH 0504/2153] feat(react-bootstrap/fade): update props interface (#24763) - add missing mountOnEnter - rename transitionAppear to appear --- types/react-bootstrap/index.d.ts | 1 + types/react-bootstrap/lib/Fade.d.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/types/react-bootstrap/index.d.ts b/types/react-bootstrap/index.d.ts index ccbc01d31a..45a645fc32 100644 --- a/types/react-bootstrap/index.d.ts +++ b/types/react-bootstrap/index.d.ts @@ -11,6 +11,7 @@ // Vito Samson , // Karol Janyst // Aaron Beall +// Johann Rakotoharisoa // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 diff --git a/types/react-bootstrap/lib/Fade.d.ts b/types/react-bootstrap/lib/Fade.d.ts index cb6e456417..4b30c04a5c 100644 --- a/types/react-bootstrap/lib/Fade.d.ts +++ b/types/react-bootstrap/lib/Fade.d.ts @@ -5,7 +5,8 @@ declare namespace Fade { export interface FadeProps extends TransitionCallbacks, React.HTMLProps { in?: boolean; timeout?: number; - transitionAppear?: boolean; + mountOnEnter?: boolean; + appear?: boolean; unmountOnExit?: boolean; } } From 0b4845442c035559e5a87b62696d9d928189efaa Mon Sep 17 00:00:00 2001 From: Martijn Verbakel Date: Mon, 9 Apr 2018 19:32:12 +0200 Subject: [PATCH 0505/2153] [luxon] Splitted min and max in a function that only returns undefined and a function that only returnes a DateTime. (#24715) --- types/luxon/index.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/types/luxon/index.d.ts b/types/luxon/index.d.ts index ed78e5d542..c3b9d2a029 100644 --- a/types/luxon/index.d.ts +++ b/types/luxon/index.d.ts @@ -135,8 +135,10 @@ declare module 'luxon' { second?: number, millisecond?: number ): DateTime; - static max(...dateTimes: DateTime[]): DateTime | undefined; - static min(...dateTimes: DateTime[]): DateTime | undefined; + static max(): undefined; + static max(...dateTimes: DateTime[]): DateTime; + static min(): undefined; + static min(...dateTimes: DateTime[]): DateTime; static utc( year?: number, month?: number, From 6e605f1695e6276ebe4e7f420bb5009a85d94351 Mon Sep 17 00:00:00 2001 From: TheBekker Date: Mon, 9 Apr 2018 19:32:23 +0200 Subject: [PATCH 0506/2153] Add io:any to boardoptions interface to allow passing in io at init of board (#24786) --- types/johnny-five/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/johnny-five/index.d.ts b/types/johnny-five/index.d.ts index 297069f0f1..5f0f6a9f37 100644 --- a/types/johnny-five/index.d.ts +++ b/types/johnny-five/index.d.ts @@ -102,6 +102,7 @@ export interface BoardOption { repl?: boolean; debug?: boolean; timeout?: number; + io?: any; } export declare class Board { From 0b59f703b50975e2b86cf2b69819553e503fb641 Mon Sep 17 00:00:00 2001 From: Justin Francos Date: Mon, 9 Apr 2018 13:32:40 -0400 Subject: [PATCH 0507/2153] Update to Auth0LockConstructorOptions (#24781) The member 'avatar' should allow 'null', to be consistent with the documentation at: https://auth0.com/docs/libraries/lock/v11/configuration#avatar-object- I discovered this when I was trying to figure out why I was seeing 404 errors to gravitar.com in my browser console when logging in. --- types/auth0-lock/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/auth0-lock/index.d.ts b/types/auth0-lock/index.d.ts index dd3e6aa7ee..93305bfd1f 100644 --- a/types/auth0-lock/index.d.ts +++ b/types/auth0-lock/index.d.ts @@ -118,7 +118,7 @@ interface Auth0LockConstructorOptions { auth?: Auth0LockAuthOptions; autoclose?: boolean; autofocus?: boolean; - avatar?: Auth0LockAvatarOptions; + avatar?: Auth0LockAvatarOptions | null; clientBaseUrl?: string; closable?: boolean; configurationBaseUrl?: string; From e101bf49718fd8facde23bdf1d68d9e8b1efe6da Mon Sep 17 00:00:00 2001 From: Alexey Date: Mon, 9 Apr 2018 20:32:54 +0300 Subject: [PATCH 0508/2153] formidable - maxFileSize prop add (#24689) * maxFileSize prop add Add maxFileSize * maxFileSize prop add Add maxFileSize property --- types/express-formidable/index.d.ts | 1 + types/formidable/index.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/types/express-formidable/index.d.ts b/types/express-formidable/index.d.ts index 75a34d0350..ee38be639e 100644 --- a/types/express-formidable/index.d.ts +++ b/types/express-formidable/index.d.ts @@ -22,6 +22,7 @@ interface ExpressFormidableOptions { uploadDir?: string; keepExtensions?: boolean; type?: "multipart" | "urlencoded"; + maxFileSize?: number; maxFieldsSize?: number; maxFields?: number; hash?: boolean | "sha1" | "md5"; diff --git a/types/formidable/index.d.ts b/types/formidable/index.d.ts index 8163fa5894..da5c730ae8 100644 --- a/types/formidable/index.d.ts +++ b/types/formidable/index.d.ts @@ -14,6 +14,7 @@ export declare class IncomingForm extends events.EventEmitter { encoding: string; uploadDir: string; keepExtensions: boolean; + maxFileSize: number; maxFieldsSize: number; maxFields: number; hash: string | boolean; From bf9ad949f17ce055913b10c523e58ff7244105ad Mon Sep 17 00:00:00 2001 From: Anne-VI Date: Mon, 9 Apr 2018 19:35:51 +0200 Subject: [PATCH 0509/2153] Update index.d.ts - made interface properties optional (#24826) --- types/jstree/index.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/types/jstree/index.d.ts b/types/jstree/index.d.ts index 6bbbb43d2a..d1ac386a49 100644 --- a/types/jstree/index.d.ts +++ b/types/jstree/index.d.ts @@ -1968,37 +1968,37 @@ interface JSTreeGetJsonOptions { /** * do not return state information */ - no_state: boolean; + no_state?: boolean; /** * do not return ID */ - no_id: boolean; + no_id?: boolean; /** * do not include children */ - no_children: boolean; + no_children?: boolean; /** * do not include node data */ - no_data: boolean; + no_data?: boolean; /** * do not include LI attributes */ - no_li_attr: boolean; + no_li_attr?: boolean; /** * do not include A attributes */ - no_a_attr: boolean; + no_a_attr?: boolean; /** * return flat JSON instead of nested */ - flat: boolean; + flat?: boolean; } interface JSTreeBindOptions { From 94634500dce75d64cfdbd6c3a8586709d727318d Mon Sep 17 00:00:00 2001 From: Brian D Date: Mon, 9 Apr 2018 10:36:12 -0700 Subject: [PATCH 0510/2153] Victory Charts: VictoryLegend - adds optional fill parameter to symbol object; Adds optional itemsPerRow (#24687) * Victory Charts: added fill parameter * Adds 'itemsPerRow' to VictoryLegend http://formidable.com/open-source/victory/docs/victory-legend/ --- types/victory/index.d.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/types/victory/index.d.ts b/types/victory/index.d.ts index 0c7f756b26..1ce04d2436 100644 --- a/types/victory/index.d.ts +++ b/types/victory/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Victory 0.9.1 +// Type definitions for Victory 0.9.2 // Project: https://github.com/FormidableLabs/victory // Definitions by: Alexey Svetliakov // snerks @@ -1242,9 +1242,17 @@ declare module "victory" { data?: Array<{ name?: string; symbol?: { + fill?: string; type?: string; }; }>; + /** + * The itemsPerRow prop determines how many items to render in each row + * of a horizontal legend, or in each column of a vertical legend. This + * prop should be given as an integer. When this prop is not given, + * legend items will be rendered in a single row or column. + */ + itemsPerRow?: number; /** * The dataComponent prop takes a component instance which will be * responsible for rendering a data element used to associate a symbol From 4f156d89a50cb7cddf3a0faaad988ef9d26d4b3b Mon Sep 17 00:00:00 2001 From: Wooseop Kim Date: Tue, 10 Apr 2018 02:36:50 +0900 Subject: [PATCH 0511/2153] Add sharp.SharpInstance#toBuffer({ resolveWithObject: boolean }) overloads (#24703) --- types/sharp/index.d.ts | 10 +++++++++- types/sharp/sharp-tests.ts | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/types/sharp/index.d.ts b/types/sharp/index.d.ts index 432be5346d..e1108575ab 100644 --- a/types/sharp/index.d.ts +++ b/types/sharp/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for sharp 0.17 // Project: https://github.com/lovell/sharp // Definitions by: François Nguyen +// Wooseop Kim // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -359,9 +360,16 @@ declare namespace sharp { toBuffer(callback: (err: Error, buffer: Buffer, info: OutputInfo) => void): SharpInstance; /** * Write output to a Buffer. JPEG, PNG, WebP, and RAW output are supported. By default, the format will match the input image, except GIF and SVG input which become PNG output. + * @param options resolve options * @returns A promise that fulfills with the resulting Buffer */ - toBuffer(): Promise; + toBuffer(options?: { resolveWithObject: false }): Promise; + /** + * Write output to a Buffer. JPEG, PNG, WebP, and RAW output are supported. By default, the format will match the input image, except GIF and SVG input which become PNG output. + * @param options resolve options + * @returns A promise that fulfills with an object containing the Buffer data and an info object containing the output image format, size (bytes), width, height and channels + */ + toBuffer(options: { resolveWithObject: true }): Promise<{ data: Buffer, info: OutputInfo }>; /** * Use these JPEG options for output image. * @param options Output options. diff --git a/types/sharp/sharp-tests.ts b/types/sharp/sharp-tests.ts index f1010c533c..2cef4e42a4 100644 --- a/types/sharp/sharp-tests.ts +++ b/types/sharp/sharp-tests.ts @@ -183,6 +183,21 @@ sharp(input) // than 200 pixels regardless of the inputBuffer image dimensions }); +sharp(input) + .resize(100, 100) + .toBuffer({ resolveWithObject: false }) + .then((outputBuffer: Buffer) => { + // Resolves with a Buffer object when resolveWithObject is false + }); + +sharp(input) + .resize(100, 100) + .toBuffer({ resolveWithObject: true }) + .then((object: { data: Buffer, info: sharp.OutputInfo }) => { + // Resolve with an object containing data Buffer and an OutputInfo object + // when resolveWithObject is true + }); + const stats = sharp.cache(); sharp.cache({ items: 200 }); From 1945bf693b1c5073c42a478756a20790217e3b90 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 10 Apr 2018 03:40:45 +1000 Subject: [PATCH 0512/2153] feat(diff): update types to support v3.5 (#24697) --- types/diff/diff-tests.ts | 27 ++++++++++++----------- types/diff/index.d.ts | 46 +++++++++++++++++++++++++++------------- 2 files changed, 46 insertions(+), 27 deletions(-) diff --git a/types/diff/diff-tests.ts b/types/diff/diff-tests.ts index e787c44f48..f859a735b4 100644 --- a/types/diff/diff-tests.ts +++ b/types/diff/diff-tests.ts @@ -3,12 +3,10 @@ const one = 'beep boop'; const other = 'beep boob blah'; let diff = jsdiff.diffChars(one, other); +printDiff(diff); -diff.forEach(part => { - const mark = part.added ? '+' : - part.removed ? '-' : ' '; - console.log(`${mark} ${part.value}`); -}); +diff = jsdiff.diffArrays(['a', 'b', 'c'], ['a', 'c', 'd']); +printDiff(diff); // -------------------------- @@ -22,13 +20,13 @@ class LineDiffWithoutWhitespace extends jsdiff.Diff { } } -const obj = new LineDiffWithoutWhitespace(true); +const obj = new LineDiffWithoutWhitespace(); diff = obj.diff(one, other); printDiff(diff); function printDiff(diff: jsdiff.IDiffResult[]) { - function addLineHeader(decorator: string, str: string) { - return str.split("\n").map((line, index, array) => { + function addLineHeader(decorator: string, str: string | string[]) { + return (typeof str === 'string' ? str.split("\n") : str).map((line, index, array) => { if (index === array.length - 1 && line === "") { return line; } else { @@ -52,7 +50,8 @@ function verifyPatchMethods(oldStr: string, newStr: string, uniDiff: jsdiff.IUni const verifyPatch = jsdiff.parsePatch( jsdiff.createTwoFilesPatch("oldFile.ts", "newFile.ts", oldStr, newStr, "old", "new", { context: 1 })); - if (JSON.stringify(verifyPatch) !== JSON.stringify(uniDiff)) { + + if (JSON.stringify(verifyPatch[0], Object.keys(verifyPatch[0]).sort()) !== JSON.stringify(uniDiff, Object.keys(uniDiff).sort())) { console.error("Patch did not match uniDiff"); } } @@ -82,7 +81,11 @@ function verifyApplyMethods(oldStr: string, newStr: string, uniDiff: jsdiff.IUni }); } -const uniDiff = jsdiff.structuredPatch("oldFile.ts", "newFile.ts", one, other, +const uniDiffPatch = jsdiff.structuredPatch("oldFile.ts", "newFile.ts", one, other, "old", "new", { context: 1 }); -verifyPatchMethods(one, other, uniDiff); -verifyApplyMethods(one, other, uniDiff); +verifyPatchMethods(one, other, uniDiffPatch); + +const uniDiffStr = jsdiff.createPatch("file.ts", one, other, "old", "new", + { context: 1 }); +const uniDiffApply = jsdiff.parsePatch(uniDiffStr)[0]; +verifyApplyMethods(one, other, uniDiffApply); diff --git a/types/diff/index.d.ts b/types/diff/index.d.ts index 720a8d3270..2017b43e0e 100644 --- a/types/diff/index.d.ts +++ b/types/diff/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for diff 3.2 +// Type definitions for diff 3.5 // Project: https://github.com/kpdecker/jsdiff // Definitions by: vvakame +// szdc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -8,15 +9,19 @@ export = JsDiff; export as namespace JsDiff; declare namespace JsDiff { - interface ICaseOptions { + interface IOptions { ignoreCase: boolean; } - interface ILinesOptions { + interface ILinesOptions extends IOptions { ignoreWhitespace?: boolean; newlineIsToken?: boolean; } + interface IArrayOptions extends IOptions { + comparator?: (left: any, right: any) => number; + } + interface IDiffResult { value: string; count?: number; @@ -42,38 +47,45 @@ declare namespace JsDiff { newFileName: string; oldHeader: string; newHeader: string; + index: string; hunks: IHunk[]; } class Diff { - ignoreWhitespace: boolean; + diff(oldString: string, newString: string, options?: IOptions): IDiffResult[]; - constructor(ignoreWhitespace?: boolean); - - diff(oldString: string, newString: string): IDiffResult[]; - - pushComponent(components: IDiffResult[], value: string, added: boolean, removed: boolean): void; + pushComponent(components: IDiffResult[], added: boolean, removed: boolean): void; extractCommon(basePath: IBestPath, newString: string, oldString: string, diagonalPath: number): number; equals(left: string, right: string): boolean; - join(left: string, right: string): string; + removeEmpty(array: any[]): any[]; + + castInput(value: any): any; + + join(chars: string[]): string; tokenize(value: string): any; // return types are string or string[] } - function diffChars(oldStr: string, newStr: string, options?: ICaseOptions): IDiffResult[]; + function diffChars(oldStr: string, newStr: string, options?: IOptions): IDiffResult[]; - function diffWords(oldStr: string, newStr: string, options?: ICaseOptions): IDiffResult[]; + function diffWords(oldStr: string, newStr: string, options?: IOptions): IDiffResult[]; - function diffWordsWithSpace(oldStr: string, newStr: string): IDiffResult[]; + function diffWordsWithSpace(oldStr: string, newStr: string, options?: IOptions): IDiffResult[]; - function diffJson(oldObj: object, newObj: object): IDiffResult[]; + function diffJson(oldObj: object, newObj: object, options?: IOptions): IDiffResult[]; function diffLines(oldStr: string, newStr: string, options?: ILinesOptions): IDiffResult[]; - function diffCss(oldStr: string, newStr: string): IDiffResult[]; + function diffCss(oldStr: string, newStr: string, options?: IOptions): IDiffResult[]; + + function diffTrimmedLines(oldStr: string, newStr: string, options?: ILinesOptions): IDiffResult[]; + + function diffSentences(oldStr: string, newStr: string, options?: IOptions): IDiffResult[]; + + function diffArrays(oldArr: any[], newArr: any[], options?: IArrayOptions): IDiffResult[]; function createPatch(fileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): string; @@ -94,4 +106,8 @@ declare namespace JsDiff { function convertChangesToXML(changes: IDiffResult[]): string; function convertChangesToDMP(changes: IDiffResult[]): Array<{0: number; 1: string; }>; + + function merge(mine: string, theirs: string, base: string): IUniDiff; + + function canonicalize(obj: any, stack: any[], replacementStack: any[]): any; } From 710de9e6945f6d042d17db9683366035f8b0d3b6 Mon Sep 17 00:00:00 2001 From: Stian Didriksen Date: Mon, 9 Apr 2018 19:41:45 +0200 Subject: [PATCH 0513/2153] Fix blunder in #24691 (#24693) noModule got added to the wrong element (doh) --- types/react/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 2ed2fb497c..4b22054b77 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -1568,6 +1568,7 @@ declare namespace React { crossOrigin?: string; defer?: boolean; integrity?: string; + noModule?: boolean; nonce?: string; src?: string; type?: string; @@ -1579,7 +1580,6 @@ declare namespace React { form?: string; multiple?: boolean; name?: string; - noModule?: boolean; required?: boolean; size?: number; value?: string | string[] | number; From ea718d99b4b677fe4e2bb0961263f80b811f4e1b Mon Sep 17 00:00:00 2001 From: Omar Diab Date: Mon, 9 Apr 2018 10:42:41 -0700 Subject: [PATCH 0514/2153] [react-intl] FormattedMessage children prop (#24670) --- types/react-intl/index.d.ts | 1 + types/react-intl/react-intl-tests.tsx | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/types/react-intl/index.d.ts b/types/react-intl/index.d.ts index 72d5d69f51..7da9dbd487 100644 --- a/types/react-intl/index.d.ts +++ b/types/react-intl/index.d.ts @@ -142,6 +142,7 @@ declare namespace ReactIntl { interface Props extends MessageDescriptor { values?: {[key: string]: MessageValue | JSX.Element}; tagName?: string; + children?: (formattedMessage: string[]) => React.ReactNode; } } class FormattedMessage extends React.Component { } diff --git a/types/react-intl/react-intl-tests.tsx b/types/react-intl/react-intl-tests.tsx index 726802a8bb..75490a5ca1 100644 --- a/types/react-intl/react-intl-tests.tsx +++ b/types/react-intl/react-intl-tests.tsx @@ -143,6 +143,13 @@ class SomeComponent extends React.Component + + {(text) =>
    {text}
    } +
    + Date: Mon, 9 Apr 2018 13:44:33 -0400 Subject: [PATCH 0515/2153] [react-transition-group] Add const for Transition (#24778) This fixes the following TS errors: import Transition, { ENTERED, ENTERING } from 'react-transition-group/Transition' // => Module '"./node_modules/@types/react-transition-group/Transition"' has no exported member 'ENTERED'. // => Module '"./node_modules/@types/react-transition-group/Transition"' has no exported member 'ENTERING'. --- types/react-transition-group/Transition.d.ts | 6 ++++++ .../react-transition-group/react-transition-group-tests.tsx | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/types/react-transition-group/Transition.d.ts b/types/react-transition-group/Transition.d.ts index 24f0265ee2..66ab782d1e 100644 --- a/types/react-transition-group/Transition.d.ts +++ b/types/react-transition-group/Transition.d.ts @@ -4,6 +4,12 @@ export type EndHandler = (node: HTMLElement, done: () => void) => void; export type EnterHandler = (node: HTMLElement, isAppearing: boolean) => void; export type ExitHandler = (node: HTMLElement) => void; +export const UNMOUNTED = 'unmounted'; +export const EXITED = 'exited'; +export const ENTERING = 'entering'; +export const ENTERED = 'entered'; +export const EXITING = 'exiting'; + export interface TransitionActions { appear?: boolean; enter?: boolean; diff --git a/types/react-transition-group/react-transition-group-tests.tsx b/types/react-transition-group/react-transition-group-tests.tsx index dd6555df68..f45630e4a4 100644 --- a/types/react-transition-group/react-transition-group-tests.tsx +++ b/types/react-transition-group/react-transition-group-tests.tsx @@ -1,6 +1,6 @@ import * as React from "react"; import CSSTransition = require("react-transition-group/CSSTransition"); -import Transition from "react-transition-group/Transition"; +import Transition, { UNMOUNTED, EXITED, ENTERING, ENTERED, EXITING } from "react-transition-group/Transition"; import TransitionGroup = require("react-transition-group/TransitionGroup"); import Components = require("react-transition-group"); From 92801a99e350e3abc0032750f76b8905b5238e4c Mon Sep 17 00:00:00 2001 From: Shude Li Date: Tue, 10 Apr 2018 01:45:10 +0800 Subject: [PATCH 0516/2153] node@8: fix return type of Cipher. setAAD() and Cipher. setAutoPadding() (#24801) * fix: fix return type of Cipher. setAAD() and Cipher. setAutoPadding() * node@8: fix return types of Decipher.setAAD() and Decipher.setAutoPadding() * fix: fix return types of Decipher.setAuthTag() --- types/node/v8/index.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index a17800dfb7..164df0a960 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -5156,9 +5156,9 @@ declare module "crypto" { update(data: string, input_encoding: Utf8AsciiBinaryEncoding, output_encoding: HexBase64BinaryEncoding): string; final(): Buffer; final(output_encoding: string): string; - setAutoPadding(auto_padding?: boolean): void; + setAutoPadding(auto_padding?: boolean): this; getAuthTag(): Buffer; - setAAD(buffer: Buffer): void; + setAAD(buffer: Buffer): this; } export function createDecipher(algorithm: string, password: any): Decipher; export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher; @@ -5169,9 +5169,9 @@ declare module "crypto" { update(data: string, input_encoding: HexBase64BinaryEncoding, output_encoding: Utf8AsciiBinaryEncoding): string; final(): Buffer; final(output_encoding: string): string; - setAutoPadding(auto_padding?: boolean): void; - setAuthTag(tag: Buffer): void; - setAAD(buffer: Buffer): void; + setAutoPadding(auto_padding?: boolean): this; + setAuthTag(tag: Buffer): this; + setAAD(buffer: Buffer): this; } export function createSign(algorithm: string): Signer; export interface Signer extends NodeJS.WritableStream { From bf68326d76f5a36c1829366015a6b507025a058c Mon Sep 17 00:00:00 2001 From: Michele Bombardi Date: Mon, 9 Apr 2018 19:45:37 +0200 Subject: [PATCH 0517/2153] Added react-native AppRegistry registerHeadlessTask typing (#24806) * react-native: AppRegistry registerHeadlessTask * Definitions by header * Task, TaskProvider and registerHeadlessTask task param type --- types/react-native/index.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index a248fd3010..6dc9608668 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -7,6 +7,7 @@ // Kamal Mahyuddin // Naoufal El Yousfi // Alex Dunne +// Michele Bombardi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -339,6 +340,9 @@ export function createElement

    ( export type Runnable = (appParameters: any) => void; +type Task = (taskData: any) => Promise; +type TaskProvider = () => Task; + type NodeHandle = number; // Similar to React.SyntheticEvent except for nativeEvent @@ -466,6 +470,8 @@ export namespace AppRegistry { function unmountApplicationComponentAtRootTag(rootTag: number): void; function runApplication(appKey: string, appParameters: any): void; + + function registerHeadlessTask(appKey: string, task: TaskProvider): void; } export interface LayoutAnimationTypes { From 76db75e673978e77a004a18dd983c9a153ba2599 Mon Sep 17 00:00:00 2001 From: Jesse Lentz Date: Mon, 9 Apr 2018 13:45:56 -0400 Subject: [PATCH 0518/2153] [mongodb] Update SSLOptions.sslValidate to be a boolean (#24810) Per http://mongodb.github.io/node-mongodb-native/3.0/api/MongoClient.html, this MongoClient option should be a boolean instead of an Object. --- types/mongodb/index.d.ts | 2 +- types/mongodb/mongodb-tests.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 4fb7dc68f6..335d7e0187 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -105,7 +105,7 @@ export interface SSLOptions { // Use ssl connection (needs to have a mongod server with ssl support) ssl?: boolean; // Default: true; Validate mongod server certificate against ca (mongod server >=2.4 with ssl support required) - sslValidate?: Object; + sslValidate?: boolean; // Default: true; Server identity checking during SSL checkServerIdentity?: boolean | Function; // Array of valid certificates either as Buffers or Strings diff --git a/types/mongodb/mongodb-tests.ts b/types/mongodb/mongodb-tests.ts index af307ce6d8..434f71dc91 100644 --- a/types/mongodb/mongodb-tests.ts +++ b/types/mongodb/mongodb-tests.ts @@ -20,7 +20,7 @@ let options: mongodb.MongoClientOptions = { reconnectInterval: 123456, ssl: true, - sslValidate: {}, + sslValidate: false, checkServerIdentity: function () { }, sslCA: ['str'], sslCert: new Buffer(999), From d472efccd0e040d1ebb23273361d029c9b61dd05 Mon Sep 17 00:00:00 2001 From: Xiaohan Zhang Date: Mon, 9 Apr 2018 10:52:14 -0700 Subject: [PATCH 0519/2153] threejs - use correct skinWeights and skinIndices types (#24800) --- types/three/test/docs/scenes/bones_browser.ts | 124 ++++++++++++++++++ types/three/three-core.d.ts | 12 +- types/three/tsconfig.json | 3 +- 3 files changed, 131 insertions(+), 8 deletions(-) create mode 100644 types/three/test/docs/scenes/bones_browser.ts diff --git a/types/three/test/docs/scenes/bones_browser.ts b/types/three/test/docs/scenes/bones_browser.ts new file mode 100644 index 0000000000..c04a788cde --- /dev/null +++ b/types/three/test/docs/scenes/bones_browser.ts @@ -0,0 +1,124 @@ +// https://github.com/mrdoob/three.js/blob/master/docs/scenes/bones-browser.html + +() => { + var scene: THREE.Scene; + var camera: THREE.PerspectiveCamera; + var renderer: THREE.WebGLRenderer; + var orbit: THREE.OrbitControls; + var lights: THREE.Light[]; + var mesh: THREE.SkinnedMesh; + var bones: THREE.Bone[]; + var skeletonHelper: THREE.SkeletonHelper; + var state = { + animateBones: false + }; + function initScene() { + scene = new THREE.Scene(); + camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 200); + camera.position.z = 30; + camera.position.y = 30; + renderer = new THREE.WebGLRenderer({ antialias: true }); + renderer.setPixelRatio(window.devicePixelRatio); + renderer.setSize(window.innerWidth, window.innerHeight); + renderer.setClearColor(0x000000, 1); + document.body.appendChild(renderer.domElement); + orbit = new THREE.OrbitControls(camera, renderer.domElement); + orbit.enableZoom = false; + lights = []; + lights[0] = new THREE.PointLight(0xffffff, 1, 0); + lights[1] = new THREE.PointLight(0xffffff, 1, 0); + lights[2] = new THREE.PointLight(0xffffff, 1, 0); + lights[0].position.set(0, 200, 0); + lights[1].position.set(100, 200, 100); + lights[2].position.set(- 100, - 200, - 100); + scene.add(lights[0]); + scene.add(lights[1]); + scene.add(lights[2]); + window.addEventListener('resize', function () { + camera.aspect = window.innerWidth / window.innerHeight; + camera.updateProjectionMatrix(); + renderer.setSize(window.innerWidth, window.innerHeight); + }, false); + initBones(); + } + function createGeometry(sizing: any) { + var geometry = new THREE.CylinderGeometry( + 5, // radiusTop + 5, // radiusBottom + sizing.height, // height + 8, // radiusSegments + sizing.segmentCount * 3, // heightSegments + true // openEnded + ); + for (var i = 0; i < geometry.vertices.length; i++) { + var vertex = geometry.vertices[i]; + var y = (vertex.y + sizing.halfHeight); + var skinIndex = Math.floor(y / sizing.segmentHeight); + var skinWeight = (y % sizing.segmentHeight) / sizing.segmentHeight; + geometry.skinIndices.push(new THREE.Vector4(skinIndex, skinIndex + 1, 0, 0)); + geometry.skinWeights.push(new THREE.Vector4(1 - skinWeight, skinWeight, 0, 0)); + } + return geometry; + } + function createBones(sizing: any) { + bones = []; + var prevBone = new THREE.Bone(); + bones.push(prevBone); + prevBone.position.y = - sizing.halfHeight; + for (var i = 0; i < sizing.segmentCount; i++) { + var bone = new THREE.Bone(); + bone.position.y = sizing.segmentHeight; + bones.push(bone); + prevBone.add(bone); + prevBone = bone; + } + return bones; + } + function createMesh(geometry: THREE.Geometry, bones: THREE.Bone[]) { + var material = new THREE.MeshPhongMaterial({ + skinning: true, + color: 0x156289, + emissive: 0x072534, + side: THREE.DoubleSide, + flatShading: true + }); + var mesh = new THREE.SkinnedMesh(geometry, material); + var skeleton = new THREE.Skeleton(bones); + mesh.add(bones[0]); + mesh.bind(skeleton); + skeletonHelper = new THREE.SkeletonHelper(mesh); + (skeletonHelper.material as THREE.LineBasicMaterial).linewidth = 2; + scene.add(skeletonHelper); + return mesh; + } + function initBones() { + var segmentHeight = 8; + var segmentCount = 4; + var height = segmentHeight * segmentCount; + var halfHeight = height * 0.5; + var sizing = { + segmentHeight: segmentHeight, + segmentCount: segmentCount, + height: height, + halfHeight: halfHeight + }; + var geometry = createGeometry(sizing); + var bones = createBones(sizing); + mesh = createMesh(geometry, bones); + mesh.scale.multiplyScalar(1); + scene.add(mesh); + } + function render() { + requestAnimationFrame(render); + var time = Date.now() * 0.001; + //Wiggle the bones + if (state.animateBones) { + for (var i = 0; i < mesh.skeleton.bones.length; i++) { + mesh.skeleton.bones[i].rotation.z = Math.sin(time) * 2 / mesh.skeleton.bones.length; + } + } + renderer.render(scene, camera); + } + initScene(); + render(); +} diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 0a17adf51b..2d8d40f1d6 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -1015,8 +1015,8 @@ export class DirectGeometry extends EventDispatcher { uvs2: Vector2[]; groups: {start: number, materialIndex: number}[]; morphTargets: MorphTarget[]; - skinWeights: number[]; - skinIndices: number[]; + skinWeights: Vector4[]; + skinIndices: Vector4[]; boundingBox: Box3; boundingSphere: Sphere; verticesNeedUpdate: boolean; @@ -1270,12 +1270,12 @@ export class Geometry extends EventDispatcher { /** * Array of skinning weights, matching number and order of vertices. */ - skinWeights: number[]; + skinWeights: Vector4[]; /** * Array of skinning indices, matching number and order of vertices. */ - skinIndices: number[]; + skinIndices: Vector4[]; /** * @@ -5020,9 +5020,7 @@ export class QuaternionLinearInterpolant extends Interpolant { // Objects ////////////////////////////////////////////////////////////////////////////////// export class Bone extends Object3D { - constructor(skin: SkinnedMesh); - - skin: SkinnedMesh; + constructor(); } export class Group extends Object3D { diff --git a/types/three/tsconfig.json b/types/three/tsconfig.json index 2c62dbad6b..ff443f85f7 100644 --- a/types/three/tsconfig.json +++ b/types/three/tsconfig.json @@ -21,6 +21,7 @@ "index.d.ts", "detector.d.ts", "test/references.ts", + "test/docs/scenes/bones_browser.ts", "test/math/test_unit_math.ts", "test/webgl/webgl_animation_cloth.ts", "test/webgl/webgl_animation_skinning_morph.ts", @@ -57,4 +58,4 @@ "test/examples/loaders/webgl_loader_obj_mtl.ts", "test/webvr/webvr.ts" ] -} \ No newline at end of file +} From 0df701c2d61f78660a2714ef27e1cb4ade93de1a Mon Sep 17 00:00:00 2001 From: Manuel Alabor Date: Mon, 9 Apr 2018 19:53:42 +0200 Subject: [PATCH 0520/2153] Add InputAccessoryView to react-native Typing (#24837) Adds typing for react-natives InputAccessoryView component. --- types/react-native/index.d.ts | 34 ++++++++++++++++++++++++++++++- types/react-native/test/index.tsx | 13 ++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 6dc9608668..3503c69f6b 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-native 0.52 +// Type definitions for react-native 0.55 // Project: https://github.com/facebook/react-native // Definitions by: Eloy Durán // HuHuanming @@ -7,6 +7,7 @@ // Kamal Mahyuddin // Naoufal El Yousfi // Alex Dunne +// Manuel Alabor // Michele Bombardi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -1226,6 +1227,13 @@ export interface TextInputProperties */ testID?: string; + /** + * Used to connect to an InputAccessoryView. Not part of react-natives documentation, but present in examples and + * code. + * See https://facebook.github.io/react-native/docs/inputaccessoryview.html for more information. + */ + inputAccessoryViewID?: string; + /** * The value to show for the text input. TextInput is a controlled component, * which means the native value will be forced to match this value prop if provided. @@ -2257,6 +2265,27 @@ export interface SegmentedControlIOSProperties extends ViewProperties { */ export interface SafeAreaViewStatic extends NativeMethodsMixin, React.ClassicComponentClass {} + +/** + * A component which enables customization of the keyboard input accessory view on iOS. The input accessory view is + * displayed above the keyboard whenever a TextInput has focus. This component can be used to create custom toolbars. + * + * To use this component wrap your custom toolbar with the InputAccessoryView component, and set a nativeID. Then, pass + * that nativeID as the inputAccessoryViewID of whatever TextInput you desire. + */ +export interface InputAccessoryViewStatic extends React.ClassicComponentClass {} + +export interface InputAccessoryViewProperties { + backgroundColor?: string; + + /** + * An ID which is used to associate this InputAccessoryView to specified TextInput(s). + */ + nativeID?: string; + + style?: StyleProp; +} + /** * Use `SegmentedControlIOS` to render a UISegmentedControl iOS. * @@ -8376,6 +8405,9 @@ export type ImageBackground = ImageBackgroundStatic; export var ImagePickerIOS: ImagePickerIOSStatic; export type ImagePickerIOS = ImagePickerIOSStatic; +export var InputAccessoryView: InputAccessoryViewStatic; +export type InputAccessoryView = InputAccessoryViewStatic; + export var FlatList: FlatListStatic; export type FlatList = FlatListStatic; diff --git a/types/react-native/test/index.tsx b/types/react-native/test/index.tsx index 65db445695..557df0869d 100644 --- a/types/react-native/test/index.tsx +++ b/types/react-native/test/index.tsx @@ -45,6 +45,8 @@ import { TabBarIOS, NativeModules, MaskedViewIOS, + TextInput, + InputAccessoryView, } from "react-native"; declare module "react-native" { @@ -369,6 +371,17 @@ class MaskedViewTest extends React.Component { } } +class InputAccessoryViewTest extends React.Component { + render() { + const uniqueID = "foobar"; + return ( + + + + ) + } +} + // DataSourceAssetCallback const dataSourceAssetCallback1: DataSourceAssetCallback = { rowHasChanged: (r1, r2) => true, From 419a725bff66ca535fb0fd4f81b6386aacfc258b Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 9 Apr 2018 11:11:05 -0700 Subject: [PATCH 0521/2153] victory: Fix test (#24769) --- types/victory/victory-tests.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/types/victory/victory-tests.tsx b/types/victory/victory-tests.tsx index aa21609ff5..56f9d34b54 100644 --- a/types/victory/victory-tests.tsx +++ b/types/victory/victory-tests.tsx @@ -243,8 +243,7 @@ test = ( padding={75} style={{ data: { - fill: (data: any) => data.y > 2 ? - "red" : "blue" + fill: "red", } }} data={[ @@ -374,8 +373,7 @@ test = ( style={{ data: { width: 15, - fill: (data: any) => data.y > 3 ? - "gold" : "orange" + fill: "gold", } }} data={[ From d05ed194dfa8d67550e7c27d301fcd72c8808bf0 Mon Sep 17 00:00:00 2001 From: Rob Moran Date: Mon, 9 Apr 2018 19:39:11 +0100 Subject: [PATCH 0522/2153] Updated node-hid types to v0.7 (#24831) * Updated node-hid types to v0.7.2 * Only use MAJOR.MINOR version --- types/node-hid/index.d.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/types/node-hid/index.d.ts b/types/node-hid/index.d.ts index 92ffd4a60a..00a2f5eaee 100644 --- a/types/node-hid/index.d.ts +++ b/types/node-hid/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for node-hid 0.5 +// Type definitions for node-hid 0.7 // Project: https://github.com/node-hid/node-hid#readme // Definitions by: Mohamed Hegazy // Robert Kiss +// Rob Moran // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export interface Device { @@ -22,13 +23,14 @@ export class HID { constructor(vid: number, pid: number); close(): void; pause(): void; - read(callback: (value: any, err: any) => void): any; + read(callback: (err: any, data: number[]) => void): void; readSync(): number[]; readTimeout(time_out: number): number[]; - sendFeatureReport(data: number[]): void; + sendFeatureReport(data: number[]): number; getFeatureReport(report_id: number, report_length: number): number[]; resume(): void; on(event: string, handler: (value: any) => void): void; - write(values: number[]): void; + write(values: number[]): number; + setDriverType(type: string): void; } export function devices(): Device[]; From 857ee0bd10006c0a5278519eebd7a2a687f77a87 Mon Sep 17 00:00:00 2001 From: Mathis Wiehl Date: Mon, 9 Apr 2018 20:43:08 +0200 Subject: [PATCH 0523/2153] fix(async): fix applyEach rest args (#24674) Add missing rest argument notation to `applyEach` and `applyEachSeries` since the previous notation enforced a notation that simply didn't work. --- types/async/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/async/index.d.ts b/types/async/index.d.ts index e2ecb522bc..961dd73ebb 100644 --- a/types/async/index.d.ts +++ b/types/async/index.d.ts @@ -168,8 +168,8 @@ export function forever(next: (next : ErrorCallback) => void, errBack: Err export function waterfall(tasks: Function[], callback?: AsyncResultCallback): void; export function compose(...fns: Function[]): Function; export function seq(...fns: Function[]): Function; -export function applyEach(fns: Function[], argsAndCallback: any[]): void; // applyEach(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional. -export function applyEachSeries(fns: Function[], argsAndCallback: any[]): void; // applyEachSeries(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional. +export function applyEach(fns: Function[], ...argsAndCallback: any[]): void; // applyEach(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional. +export function applyEachSeries(fns: Function[], ...argsAndCallback: any[]): void; // applyEachSeries(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional. export function queue(worker: AsyncWorker, concurrency?: number): AsyncQueue; export function queue(worker: AsyncResultIterator, concurrency?: number): AsyncQueue; export function priorityQueue(worker: AsyncWorker, concurrency: number): AsyncPriorityQueue; From 03aba67bf9b9051223f1373b34c58d546d9c4e81 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 9 Apr 2018 11:45:56 -0700 Subject: [PATCH 0524/2153] Update CODEOWNERS (#24847) --- .github/CODEOWNERS | 297 ++++++++++++++++++++++++++++++--------------- 1 file changed, 199 insertions(+), 98 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a769c20dfc..7182a5462f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1,7 @@ +# This file is generated. +# Add yourself to the "Definitions by:" list instead. +# See https://github.com/DefinitelyTyped/DefinitelyTyped#edit-an-existing-package + /types/abbrev/ @BendingBender /types/abs/ @AyaMorisawa /types/absolute/ @AyaMorisawa @@ -47,13 +51,15 @@ /types/alt/ @Shearerbeard /types/amazon-product-api/ @MattiLehtinen @alien35 /types/amcharts/ @ldrick +/types/amphtml-validator/ @kevincharm /types/amplify/ @joeriks /types/amplify-deferred/ @joeriks @laurentiustamate94 /types/amplitude-js/ @Asido /types/amqp/ @seikho @jonnysparkplugs /types/amqp-rpc/ @wokim -/types/amqplib/ @mnahkies @abreits @nfantone +/types/amqplib/ @mnahkies @abreits @nfantone @zelein /types/analytics-node/ @fongandrew @thomasthiebaud +/types/anchor-js/ @xt0rted /types/angular/ @diegovilar @thorn0 @calebstdenis @leonard-thieu /types/angular-agility/ @rolandzwaga /types/angular-animate/ @michelsalib @adidahiya @rasch @codyschaaf @@ -65,6 +71,7 @@ /types/angular-cookie/ @borislavjivkov /types/angular-cookies/ @diegovilar @aciccarello /types/angular-deferred-bootstrap/ @Ritzlgrmft +/types/angular-desktop-notification/ @Dona278 /types/angular-dialog-service/ @wcomartin /types/angular-dynamic-locale/ @stephenlautier /types/angular-environment/ @terrawheat @@ -110,7 +117,6 @@ /types/angular-toastr/ @nkovacic @trodi /types/angular-toasty/ @muenchdo /types/angular-tooltips/ @leonard-thieu -/types/angular-touchspin/ @nkovacic /types/angular-translate/ @michelsalib /types/angular-ui-bootstrap/ @xt0rted @ry8806 /types/angular-ui-router/ @michelsalib @matiishyn @mikehaas763 @@ -164,6 +170,7 @@ /types/array-find-index/ @samverschueren /types/array-foreach/ @skysteve /types/array-uniq/ @DanielRosenwasser +/types/array-unique/ @CSLTech /types/arrify/ @wanganjun /types/artillery/ @kmccoan-allocadia /types/asana/ @tkqubo @@ -183,7 +190,7 @@ /types/async.nexttick/ @pyrho /types/asynciterator/ @rubensworks /types/atlaskit__button/ @dijimsta -/types/atmosphere.js/ @toedter @Mory1879 +/types/atmosphere.js/ @toedter @Mory1879 @Scipion /types/atom/ @GlenCFL @smhxx @lierdakil /types/atom-keymap/ @GlenCFL /types/atom-mocha-test-runner/ @GlenCFL @@ -221,6 +228,7 @@ /types/babel-traverse/ @yortus @marvinhagemeister /types/babel-types/ @yortus @baxtersa @marvinhagemeister @bcherny /types/babel-webpack-plugin/ @j-f1 +/types/babel__code-frame/ @mohsen1 @ForbesLindesay /types/babelify/ @TeamworkGuy2 @marvinhagemeister /types/babylon/ @yortus @marvinhagemeister /types/babylon-walk/ @czbuchi @@ -231,7 +239,7 @@ /types/backbone-relational/ @eirikhm /types/backbone.layoutmanager/ @hejiang2000 /types/backbone.localstorage/ @lgrignon -/types/backbone.marionette/ @zhamid @nvivo @sventschui +/types/backbone.marionette/ @zhamid @nvivo @sventschui @razorness /types/backbone.paginator/ @Nyamazing /types/backbone.radio/ @alphaleonis /types/backgrid/ @jlujan @@ -245,6 +253,7 @@ /types/base-x/ @chrootsu /types/base16/ @alechill /types/base64-js/ @pe8ter +/types/base64-url/ @urish /types/base64topdf/ @lucasriondel /types/bases/ @harikv /types/bash-glob/ @mrmlnc @@ -255,6 +264,7 @@ /types/bcryptjs/ @RafaelKr /types/beats/ @urish /types/bech32/ @micksatana +/types/bell/ @SimonSchick /types/bem-cn/ @selkinvitaly /types/better-curry/ @pocesar /types/better-sqlite3/ @Morfent @matrumz @@ -269,7 +279,6 @@ /types/binary-parser/ @riggs @dolanmiu /types/bind-ponyfill/ @skysteve /types/bindings/ @unindented -/types/bingmaps/ @rbrundritt /types/bintrees/ @CjS77 /types/bip21/ @stefanhuber /types/bip38/ @micksatana @@ -300,11 +309,12 @@ /types/bonjour/ @quentin-ol @octo-sniffle /types/bookshelf/ @arcticwaters @vesse /types/boom/v3/ @rogatty -/types/boom/v4/ @rogatty @AJamesPhillips @jineshshah36 -/types/boom/ @rogatty @AJamesPhillips @jineshshah36 @TimonVS +/types/boom/v4/ @rogatty @AJamesPhillips @jineshshah36 @danielmachado +/types/boom/ @rogatty @AJamesPhillips @jineshshah36 @TimonVS @danielmachado /types/bootbox/ @vbortone @konpikwastaken @kanup @icereed @trodi @stannynuytkens @renjfk /types/bootpag/ @rdeneau -/types/bootstrap/ @borisyankov +/types/bootstrap/v3/ @borisyankov +/types/bootstrap/ @denisname /types/bootstrap-3-typeahead/ @AndersonFriaca /types/bootstrap-datepicker/ @borisyankov /types/bootstrap-fileinput/ @CheCoxshall @@ -322,6 +332,7 @@ /types/bootstrap.timepicker/ @derikwhittaker @heatherbooker /types/bootstrap.v3.datetimepicker/v3/ @bayitajesi /types/bootstrap.v3.datetimepicker/ @katonap +/types/bootstrap3-dialog/ @nakupanda @cnboland /types/bounce.js/ @cherrry /types/box2d/ @jbaldwin /types/brace-expansion/ @BendingBender @@ -348,7 +359,7 @@ /types/bufferstream/ @Bartvds /types/builtin-modules/ @ajafff /types/bull/v2/ @bgrieder @JProgrammer -/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold +/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga /types/bump-regex/ @silkentrance /types/bunnymq/ @cyrilschumacher /types/bunyan/ @amikhalev @@ -363,7 +374,7 @@ /types/bwip-js/ @MugeSo /types/byline/ @reppners /types/bytebuffer/ @cappellin -/types/bytes/ @danny8002 +/types/bytes/ @danny8002 @believer /types/c3/ @mcliment @gerinjacob @denyo @dmitryshindin /types/cache-manager/ @GausSim /types/cal-heatmap/ @RetroChrisB @@ -409,7 +420,7 @@ /types/chai-subset/ @delta62 @AGBrown /types/chai-webdriverio/ @sherlock1982 /types/chai-xml/ @jedigo -/types/chance/ @cbowdon @brikou +/types/chance/ @cbowdon @brikou @cafesanu /types/change-emitter/ @iskandersierra /types/charm/ @Xananax /types/charset/ @cspotcode @@ -429,6 +440,7 @@ /types/chroma-js/v0/ @invliD /types/chroma-js/ @invliD @mpacholec /types/chrome/ @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 +/types/circuit-breaker-js/ @DeTeam /types/circular-json/ @jpevarnek /types/ckeditor/ @wittwert /types/clamp-js/ @Hikariii @@ -475,7 +487,6 @@ /types/color-namer/ @in19farkt /types/color-string/ @BendingBender @danmarshall /types/colorbrewer/ @mtraynham -/types/colors/ @Bartvds @staeke /types/com.darktalker.cordova.screenshot/ @akarienta /types/combine-source-map/ @TeamworkGuy2 /types/combined-stream/ @felixge @tlaziuk @@ -492,7 +503,7 @@ /types/component-emitter/ @psnider /types/compose-function/ @denis-sokolov /types/compressible/ @BendingBender -/types/compression/ @santialbo +/types/compression/ @santialbo @rburgt /types/compression-webpack-plugin/ @dublicator /types/compute-stdev/ @mrmlnc /types/concat-stream/ @jmarianer @@ -502,6 +513,7 @@ /types/confidence/ @jppellerin /types/config/ @RWander @forrestbice @jndonald3 @albertovasquez /types/configstore/ @ArcticLight +/types/configurable/ @jewbre /types/confit/ @ethanresnick /types/connect/ @SomaticIT /types/connect-busboy/ @pinguet62 @@ -559,6 +571,7 @@ /types/cordova_app_version_plugin/ @larrybahr /types/cordovarduino/ @hendrikmaus /types/core-js/ @rbuckton @mfdeveloper +/types/cosmiconfig/ @ozum /types/cote/ @makepost /types/couchbase/ @maouida /types/countdown/ @gjuchault @@ -598,6 +611,7 @@ /types/csurf/ @horiuchi /types/csv-parse/ @davidm77 @obi-jan-kenobi /types/csv-stringify/ @rogierschouten @arjenvanderende +/types/csv2json/ @dex4er /types/csvrow/ @codeanimal /types/csvtojson/ @EricByers @wcarson /types/cucumber/v1/ @abraaoalves @jan-molak @isoung @BendingBender @@ -665,6 +679,7 @@ /types/dat.gui/ @gyohk @sonic3d @rroylance /types/data-driven/ @mrhen /types/datadog-metrics/ @pushplay +/types/datadog-tracer/ @dineshsaravanan /types/datatables.net/ @Silver-Connection @omidkrad @pragmatrix @CNBoland /types/datatables.net-buttons/ @Silver-Connection @SammyG4Free @jimhartford /types/datatables.net-fixedheader/ @szechyjs @Silver-Connection @@ -697,14 +712,14 @@ /types/deep-freeze/ @Bartvds @aluanhaddad /types/deep-freeze-es6/ @mattbishop /types/deep-freeze-strict/ @mhegazy -/types/deepmerge/ @marvinscharle @syy1125 +/types/deepmerge/ @marvinscharle @syy1125 @AppLover69 /types/defaults/ @IbtihelCHNAB /types/defer-promise/ @niklasf /types/define-lazy-prop/ @BendingBender /types/defined/ @BendingBender /types/deku/ @pocka /types/del/v2/ @AyaMorisawa -/types/del/ @AyaMorisawa @BendingBender +/types/del/ @AyaMorisawa @BendingBender @bitjson /types/delaunator/ @DenisCarriere /types/delay/ @BendingBender /types/denodeify/ @joaomoreno @@ -733,6 +748,7 @@ /types/diff2html/ @rtfpessoa /types/dir-resolve/ @andy-ms /types/discontinuous-range/ @OiCMudkips +/types/dispatchr/ @Ragg- /types/disposable-email-domains/ @geoffreak /types/doccookies/ @jonegerton /types/dockerode/ @seikho @nlaplante @isac322 @lazarusx @meisenzahl @thegecko @@ -762,10 +778,10 @@ /types/dottie/ @domarmstrong /types/double-ended-queue/ @dsagal /types/doublearray/ @mzsm -/types/doubleclick-gpt/ @johngeorgewright +/types/doubleclick-gpt/ @johngeorgewright @steven-joyce /types/download/ @nicojs /types/downloadjs/ @cwmoo740 -/types/draft-js/ @dmitryrogozhny @eelco @ghotiphud @schwers @michael-yx-wu @willisplummer @smvilar +/types/draft-js/ @dmitryrogozhny @eelco @ghotiphud @schwers @michael-yx-wu @willisplummer @smvilar @sulf /types/drag-timetable/ @chinkan /types/draggabilly/ @jaydubu /types/dragster/ @zskovacs @@ -784,11 +800,11 @@ /types/dvtng-jss/ @Ptival /types/dw-bxslider-4/ @namerci /types/dwt/v12/ @yushulx -/types/dwt/ @yushulx @jbh +/types/dwt/ @yushulx @jbh @lincoln2018 @Tom-Dynamsoft /types/dygraphs/ @danvk /types/dymo-label-framework/ @thijskuipers /types/dynatable/ @francoismassart -/types/dynogels/ @SpartanLabs +/types/dynogels/ @SpartanLabs @ramondeklein @stephentuso /types/each/ @misak113 /types/earcut/ @NaridaL /types/easeljs/ @evilangelist @@ -811,7 +827,7 @@ /types/ejs/ @benliddicott /types/ejs-locals/ @jt000 /types/ejson/ @shantanubhadoria -/types/elasticsearch/ @CasperSkydt @bfsmith @ddunkin @pushplay @mlamp @ahmadferdous @SimonSchick +/types/elasticsearch/ @CasperSkydt @bfsmith @ddunkin @pushplay @mlamp @ahmadferdous @SimonSchick @brabster @deerawan /types/electron-config/ @mrfunkycold @unindented /types/electron-debug/ @unindented /types/electron-devtools-installer/ @gamesmaxed @@ -852,6 +868,7 @@ /types/engine.io-client/ @KentarouTakeda /types/enhanced-resolve/ @e-cloud @onigoetz /types/enigma.js/ @konne +/types/enquire.js/ @screendriver /types/ent/ @rogierschouten /types/entities/ @aliceklipper /types/env-to-object/ @MugeSo @@ -888,18 +905,23 @@ /types/estraverse/ @sanex3339 /types/estree/ @RReverser /types/etag/ @BendingBender +/types/ethereumjs-util/ @cortopy /types/ethjs-signer/ @doppio /types/eureka-js-client/ @Schnillz /types/evaporate/ @kookster @chrisrhoden /types/event-emitter/ @LKay +/types/event-emitter-es6/ @ahstro /types/event-kit/ @GlenCFL /types/event-loop-lag/ @rogierschouten /types/event-stream/ @flcdrg /types/event-to-promise/ @flying-sheep /types/events/ @yasupeke +/types/eventsource/ @scottleedavis /types/evernote/ @corps +/types/excel-style-dataformatter/ @SanderDeWaal1992 /types/exceljs/ @rogierschouten @alitaheri /types/execa/ @douglasduteil @BendingBender @borekb @mickdekkers +/types/exenv/ @christianchown /types/exit/ @Bartvds /types/exit-hook/ @BendingBender /types/exorcist/ @TeamworkGuy2 @@ -908,13 +930,14 @@ /types/expectations/ @vvakame /types/expo/v23/ @KonstantinKai /types/expo/v24/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger -/types/expo/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger +/types/expo/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov /types/expo__vector-icons/ @incleaf /types/express/ @borisyankov /types/express-brute/ @cyrilschumacher /types/express-brute-memcached/ @cyrilschumacher /types/express-brute-mongo/ @cyrilschumacher /types/express-brute-redis/ @scottharwell +/types/express-bunyan-logger/ @shreyjain1994 /types/express-busboy/ @pinguet62 /types/express-cluster/ @nenadalm /types/express-debug/ @federicobond @@ -925,7 +948,7 @@ /types/express-flash-2/ @mathsalmi /types/express-flash-notification/ @Mister4Eyes /types/express-formidable/ @tdolsen @evanshortiss -/types/express-graphql/ @isman-usoh @nitintutlani @hubel @zya +/types/express-graphql/ @isman-usoh @nitintutlani @hubel @zya @mlamp @firede /types/express-handlebars/ @stpettersens @yhaskell /types/express-jwt/ @wokim @kacepe @Sl1MBoy /types/express-less/ @xieyubo @@ -952,8 +975,10 @@ /types/extract-text-webpack-plugin/ @flying-sheep @katyo /types/extract-zip/ @mizunashi-mana /types/eyes/ @brynbellomy +/types/ez-plus/ @AndersonFriaca /types/f1/ @neolwc /types/fabric/ @oklemencic @joewashear007 @mrand01 @NotWoods +/types/facebook-instant-games/ @menushka /types/facebook-js-sdk/ @amritk /types/facebook-pixel/ @noctishsu /types/faker/v3/ @Kuniwak @@ -984,7 +1009,7 @@ /types/feathersjs__authentication-oauth2/ @j2L4e /types/feathersjs__configuration/ @j2L4e /types/feathersjs__errors/ @j2L4e -/types/feathersjs__express/ @j2L4e +/types/feathersjs__express/ @j2L4e @DadUndead /types/feathersjs__feathers/ @j2L4e @AbraaoAlves /types/feathersjs__primus/ @j2L4e /types/feathersjs__primus-client/ @j2L4e @@ -995,7 +1020,7 @@ /types/feedme/ @codeanimal /types/feedparser/ @cortopy /types/fetch-jsonp/ @tkrotoff -/types/fetch-mock/ @asvetliakov @tamird @merrywhether @chrissinclair +/types/fetch-mock/ @asvetliakov @tamird @merrywhether @chrissinclair @matttennison @quentinbouygues /types/fetch.io/ @newraina /types/ffi/ @loyd /types/ffmpeg-static/ @iamstevetran @@ -1038,10 +1063,11 @@ /types/flux/ @stkb @GiedriusGrabauskas /types/fluxxor/ @mrk21 /types/fm-websync/ @markusmauch +/types/fnv-lite/ @marcind /types/fontfaceobserver/ @RandScullard /types/fontoxml/ @rolandzwaga /types/forever-agent/ @yavanosta -/types/forever-monitor/ @shuntksh +/types/forever-monitor/ @shuntksh @wrboyce /types/forge-di/ @adamcarr /types/form-data/ @soywiz @leonyu @BendingBender /types/form-serializer/ @flqw @@ -1060,7 +1086,8 @@ /types/freeport/ @atd-schubert /types/fresh/ @BendingBender /types/friendly-errors-webpack-plugin/ @bahlo -/types/frisby/ @johnny4753 +/types/frisby/v0/ @johnny4753 +/types/frisby/ @cwoodland @johnny4753 /types/from/ @Bartvds /types/from2/ @BendingBender /types/fromjs/ @glenndierckx @@ -1233,8 +1260,9 @@ /types/gaussian/ @scttcper /types/geetest/ @plantain-00 /types/gen-readlines/ @CodeAnimal +/types/generate-changelog/ @ffflorian /types/generic-functions/ @stpettersens -/types/generic-pool/ @jerray +/types/generic-pool/ @jerray @wrboyce /types/gently/ @bonnici /types/geodesy/ @DenisCarriere @HandyG52 @excelulous /types/geojson/ @cobster @atd-schubert @JeffJacobson @@ -1270,6 +1298,7 @@ /types/globalize-compiler/ @iclanton /types/globby/ @douglasduteil @ikatyang /types/globule/ @durad +/types/glue/ @garfty /types/gm/ @ChaosinaCan @maartenvanvliet /types/go/ @NorthwoodsSoftware /types/google-adwords-scripts/ @jafaircl @@ -1297,9 +1326,10 @@ /types/graceful-fs/ @Bartvds @BendingBender /types/graham_scan/ @hberntsen /types/graphite-udp/ @EricByers -/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio +/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio @divyenduz /types/graphql-date/ @enaeseth /types/graphql-iso-date/ @jwaldrip +/types/graphql-list-fields/ @filipows /types/graphql-relay/ @arvitaly @nitintutlani @Grelinfo /types/graphql-resolve-batch/ @nayni /types/graphql-type-json/ @schfkt @@ -1396,7 +1426,8 @@ /types/hapi/v16/ @jasonswearingen @AJamesPhillips /types/hapi/ @BorntraegerMarc @rafaelsouzaf @jhsimms /types/hapi-auth-basic/ @AJamesPhillips @saboya -/types/hapi-auth-jwt2/ @warrenseymour +/types/hapi-auth-jwt2/v7/ @warrenseymour +/types/hapi-auth-jwt2/ @warrenseymour @SimonSchick /types/hapi-decorators/ @kenhowardpdx /types/har-format/ @micmro /types/hard-rejection/ @BendingBender @@ -1448,6 +1479,7 @@ /types/html-minifier/ @tkrotoff @rikuayanokozy /types/html-pdf/ @westy92 /types/html-to-text/ @erykwarren +/types/html-void-elements/ @rhysd /types/html-webpack-plugin/ @deevus @bumbleblym @tlaziuk /types/html-webpack-template/ @bumbleblym /types/html2canvas/ @rwhepburn @tan9 @@ -1521,7 +1553,7 @@ /types/iniparser/ @chrootsu /types/inline-css/ @philipisapain /types/inline-style-prefixer/ @ahz @dpetrezselyova -/types/inquirer/ @tkQubo @ppathan @jouderianjr +/types/inquirer/ @tkQubo @ppathan @jouderianjr @bang88 @bitjson @synarque @jrockwood /types/insert-module-globals/ @leonard-thieu /types/insight/ @vvakame /types/integer/ @Morfent @@ -1551,7 +1583,9 @@ /types/is-archive/ @mhegazy /types/is-array/ @pine /types/is-binary-path/ @DanielRosenwasser +/types/is-color/ @VitorLuizC /types/is-compressed/ @mhegazy +/types/is-empty/ @termosa /types/is-finite/ @mhegazy /types/is-glob/ @mrmlnc /types/is-hotkey/ @petester42 @@ -1579,7 +1613,7 @@ /types/iso-3166-2/ @sicilica /types/iso8601-localizer/ @avielfedida /types/isomorphic-fetch/ @toddlucas -/types/isotope-layout/ @avidenic +/types/isotope-layout/ @avidenic @malinushj /types/istanbul/ @tkrotoff /types/istanbul-lib-coverage/ @jason0x43 /types/istanbul-lib-hook/ @jason0x43 @@ -1617,7 +1651,7 @@ /types/jdataview/ @RReverser /types/jdenticon/ @mtr /types/jest/v16/ @NoHomey @jwbay -/types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @AhnpGit +/types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @AhnpGit @joshuakgoldberg @bradleyayers /types/jest-diff/ @myabc /types/jest-docblock/ @ikatyang /types/jest-get-type/ @myabc @@ -1633,7 +1667,7 @@ /types/johnny-five/ @nakakura @ujvzolee @workshop2 /types/joi/v6/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW /types/joi/v10/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku -/types/joi/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @dankraus @wanganjun +/types/joi/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @dankraus @wanganjun @rafaelkallis /types/joigoose/ @boothwhack /types/josa/ @vichyssoise /types/jpeg-js/ @DanielRosenwasser @@ -1676,10 +1710,12 @@ /types/jquery-urlparam/ @stpettersens /types/jquery-validation-unobtrusive/ @EnableSoftware /types/jquery.address/ @martinduparc @mardaneus86 +/types/jquery.appear/ @AndersonFriaca /types/jquery.are-you-sure/ @jonegerton /types/jquery.autosize/ @kingdango /types/jquery.bbq/ @sunetos /types/jquery.bootstrap.wizard/ @niemyjski @dennisahlin +/types/jquery.browser/ @AndersonFriaca /types/jquery.cleditor/ @pushplay /types/jquery.clientsidelogging/ @diullei /types/jquery.color/ @derekcicerone @@ -1709,6 +1745,7 @@ /types/jquery.notifybar/ @zaneli /types/jquery.noty/ @kingdango @thelfensdrfer /types/jquery.payment/ @ejsmith @johnrutherford +/types/jquery.pin/ @AndersonFriaca /types/jquery.pjax/ @lijunle /types/jquery.placeholder/ @majorsilence @EnableSoftware /types/jquery.pnotify/ @DavidSichau @FUNExtreme @@ -1752,10 +1789,12 @@ /types/js-fixtures/ @kazimanzurrashid /types/js-git/ @Bartvds /types/js-md5/ @mwmccarthy +/types/js-money/ @kanatkubash /types/js-quantities/ @wrummler /types/js-schema/ @marcinporebski @roblabat /types/js-search/ @guoyunhe /types/js-sha512/ @nicojs +/types/js-string-escape/ @viralpickaxe /types/js-to-java/ @skyitachi /types/js-url/ @pine613 /types/js-yaml/ @Bartvds @sclausen @@ -1780,10 +1819,11 @@ /types/json-pointer/ @Bartvds /types/json-query/ @mtraynham /types/json-rpc-ws/ @npenin @mlamp -/types/json-schema/ @bcherny @cyrilletuzi +/types/json-schema/ @bcherny @cyrilletuzi @lucianbuzzo /types/json-socket/ @svi3c /types/json-stable-stringify/ @mhfrantz /types/json-stringify-safe/ @BendingBender +/types/json2csv/ @juanjoDiaz /types/json2md/ @MartynasZilinskas /types/jsonata/ @nick121212 /types/jsoneditor/ @alejo90 @@ -1801,13 +1841,17 @@ /types/jsqrcode/ @lordazzi /types/jsrender/ @zakki /types/jsreport-core/ @taoqf +/types/jsreport-html-to-xlsx/ @me +/types/jsreport-jsrender/ @taoqf +/types/jsreport-phantom-pdf/ @taoqf +/types/jsreport-xlsx/ @taoqf /types/jsrp/ @harryshipton /types/jss/ @appsforartists @kof /types/jssha/ @randombk @SrTobi /types/jstimezonedetect/ @olamothe /types/jstorage/ @dflor003 /types/jstree/ @adaskothebeast -/types/jsts/ @StephaneAlie +/types/jsts/ @StephaneAlie @jrocha /types/jsuite/ @darrenhillconsulting /types/jsuri/ @coldacid @flqw /types/jsurl/ @agorshkov23 @@ -1818,11 +1862,12 @@ /types/jui-core/ @easylogic /types/jui-grid/ @easylogic /types/jweixin/ @taoqf @gomydodo -/types/jwplayer/ @martinduparc @kutomer @philippguertler +/types/jwplayer/ @martinduparc @kutomer @philippguertler @danielmcgraw /types/jws/ @JustinBeckwith /types/jwt-client/ @timoteoponce /types/jwt-decode/v1/ @QuatroDevOfficial /types/jwt-decode/ @GiedriusGrabauskas @madsmadsen +/types/jwt-express/ @nickp10 /types/jwt-simple/ @kenfdev @GaelMagnan /types/kafka-node/ @dansitu @bkim54 @sfrooster @amiram /types/karma/ @tkrotoff @43081j @@ -1831,6 +1876,7 @@ /types/karma-coverage/ @tkrotoff /types/karma-fixture/ @evictor /types/karma-jasmine/ @michelsalib +/types/karma-viewport/ @karak /types/karma-webpack/ @mtraynham /types/katex/ @mrand01 /types/kcors/ @Xstoudi @izayoiko @@ -1844,12 +1890,13 @@ /types/keypress.js/ @rcchen /types/keysym/ @harryshipton /types/keytar/ @miniak @shiftkey @juturu +/types/keyv/ @Arylo /types/kik-browser/ @joelday /types/klaw/v1/ @mceachen /types/klaw/ @mceachen /types/klaw-sync/ @shiftkey /types/kms-json/ @sunnyone -/types/knex/ @tkQubo @baronfel @MeLlamoPablo @mastermatt @micksatana +/types/knex/ @tkQubo @baronfel @MeLlamoPablo @mastermatt @micksatana @shreyjain1994 /types/knex-postgis/ @vesse /types/knockback/ @borisyankov /types/knockout/ @borisyankov @Igorbek @moonpyk @EnableSoftware @BenjaminEckardt @ffMathy @@ -1914,7 +1961,7 @@ /types/kramed/ @tonicblue /types/kss/ @giladgray /types/kue/ @drudge @amiram @pc-jedi -/types/kurento-utils/ @nenadalm +/types/kurento-utils/ @nenadalm @riggs /types/kuromoji/ @mzsm @kgtkr /types/lab/ @prashaantt /types/ladda/ @dflor003 @leemicw @@ -1973,6 +2020,7 @@ /types/line-by-line/ @etomsen /types/line-reader/ @stpettersens /types/linkify-it/ @praxxis +/types/listr/ @durad /types/lls/ @borislavjivkov /types/load-json-file/ @SamVerschueren /types/loader-runner/ @e-cloud @@ -2323,7 +2371,7 @@ /types/mapnik/ @ipv4sec /types/mapsjs/ @davismj /types/mariasql/ @bennett000 -/types/mark.js/ @renjfk +/types/mark.js/ @renjfk @RomanGotsiy /types/markdown-it/ @rapropos /types/markdown-it-anchor/ @seryl /types/markdown-it-container/ @hronex @@ -2375,12 +2423,13 @@ /types/media-typer/ @BendingBender /types/medium-editor/ @keika299 /types/mem/ @SamVerschueren +/types/mem-fs/ @MyFoodBag /types/memcached/ @KentarouTakeda /types/memoizee/ @juanpicado /types/memory-cache/ @jedigo @thieman /types/memory-fs/ @e-cloud /types/memwatch-next/ @cyrilschumacher -/types/meow/ @KnisterPeter @praxxis +/types/meow/ @KnisterPeter @praxxis @bitjson /types/merge-descriptors/ @danny8002 /types/merge-stream/ @k-kagurazaka @daniel-zazula /types/merge2/ @tkrotoff @smac89 @@ -2396,7 +2445,7 @@ /types/meteor-persistent-session/ @vangorra /types/meteor-prime8consulting-oauth2/ @vangorra /types/meteor-publish-composite/ @vangorra -/types/meteor-roles/ @vangorra +/types/meteor-roles/ @vangorra @mattmm3d /types/method-override/ @santialbo /types/methods/ @cprecioso /types/metric-suffix/ @davidm77 @@ -2416,6 +2465,7 @@ /types/mime-types/ @Perlmint /types/mimos/ @AJamesPhillips /types/mina/ @lhk @mattanja @kant2002 +/types/mini-css-extract-plugin/ @JounQin /types/minimatch/ @vvakame @shantmarouti /types/minimist/ @Bartvds @Necroskillz @kamranayub /types/minimist-options/ @ikatyang @@ -2430,7 +2480,7 @@ /types/mkdirp/ @Bartvds @mrmlnc /types/mkpath/ @optical /types/mobx-apollo/ @pselden -/types/mocha/ @kazimanzurrashid @otiai10 @jt000 @enlight +/types/mocha/ @kazimanzurrashid @otiai10 @jt000 @enlight @cspotcode /types/mocha-each/ @magnostherobot /types/mocha-phantomjs/ @ErikSchierboom /types/mocha-steps/ @Arylo @@ -2456,9 +2506,9 @@ /types/moment-timezone/ @michelsalib @alanblins /types/mongo-sanitize/ @CedricCazin /types/mongodb/v2/ @CaselIT @alanmarcell @kikar @bitjson @dante-101 @mcortesi -/types/mongodb/ @CaselIT @alanmarcell @kikar @bitjson @dante-101 @mcortesi +/types/mongodb/ @CaselIT @alanmarcell @kikar @bitjson @dante-101 @mcortesi @EnricoPicci @AJCStriker /types/mongoose/v4/ @simonxca @horiuchi @sindrenm @lukasz-zak -/types/mongoose/ @simonxca @horiuchi @sindrenm @lukasz-zak @Alorel @jendrikw @ethanresnick +/types/mongoose/ @horiuchi @sindrenm @lukasz-zak @Alorel @jendrikw @ethanresnick @vologab /types/mongoose-auto-increment/ @AyaMorisawa /types/mongoose-deep-populate/ @AyaMorisawa /types/mongoose-geojson-schema/ @bondz @@ -2469,6 +2519,7 @@ /types/mongoose-sequence/ @linusbrolin /types/mongoose-simple-random/ @rsxdalv /types/mongoose-unique-validator/ @stevehipwell +/types/mongorito/ @pinguet62 /types/moo/ @deltaidea @MofX /types/moonjs/ @DanielRosenwasser /types/morgan/ @staticfunction @pscanf @@ -2487,6 +2538,7 @@ /types/msportalfx-test/ @julioct /types/mssql/ @jaminfarr @buzinas @mrrichar @elhaard @pkeuter /types/mu2/ @jedigo +/types/muicss/ @samuelneff /types/multer/ @jt000 @DavidBR-SW @mxl @hyunseob /types/multer-gridfs-storage/v1/ @devconcept /types/multer-gridfs-storage/ @devconcept @@ -2502,7 +2554,7 @@ /types/musicmetadata/ @Xstoudi /types/mustache/ @markashleybell /types/mv/ @nenadalm -/types/mysql/ @wjohnsto @kacepe @kpping +/types/mysql/ @wjohnsto @kacepe @kpping @jdmunro /types/mz/ @ThomasHickman /types/n3/ @phreed /types/nano/ @timjacobi @vincekovacs @@ -2515,9 +2567,10 @@ /types/natsort/ @mgroenhoff /types/natural/ @dmoonfire /types/natural-sort/ @a-morales +/types/navermaps/ @ckboyjiy /types/navigation/ @grahammendick /types/navigation-react/ @grahammendick -/types/navigo/ @aersamkull @dancespiele +/types/navigo/ @aersamkull @dancespiele @deini /types/nblas/ @erikgerrits /types/nconf/ @jedigo @jmthibault /types/ncp/ @bartvds @@ -2559,16 +2612,17 @@ /types/ngstorage/ @kubiq /types/ngtoaster/ @btesser /types/ngwysiwyg/ @patrick-mackay -/types/nightmare/ @horiuchi @samyang-au +/types/nightmare/ @horiuchi @samyang-au @Bleser92 /types/nightwatch/ @rkavalap @schlesiger +/types/nivo-slider/ @AndersonFriaca /types/noble/ @swook @wind-rider @shantanubhadoria @lukel99 @bioball @keton /types/nock/ @bonnici @horiuchi @afharo @mastermatt @damour /types/nodal/ @charrondev /types/node/v4/ @eps1lon /types/node/v6/ @WilcoBakker @inlined @eps1lon @Alorel /types/node/v7/ @parambirs @tellnes @WilcoBakker @eps1lon -/types/node/v8/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @OliverJAsh @eps1lon @Hannes-Magnusson-CK @jkomyno @hoo29 -/types/node/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @OliverJAsh @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 +/types/node/v8/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @OliverJAsh @eps1lon @Hannes-Magnusson-CK @jkomyno @hoo29 @n-e +/types/node/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @OliverJAsh @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e /types/node-7z/ @erkie /types/node-array-ext/ @Beng89 /types/node-cache/ @chrootsu @dthunell @useltmann @@ -2596,9 +2650,10 @@ /types/node-notifier/ @tkQubo /types/node-polyglot/ @timjk /types/node-powershell/ @rodrigoff +/types/node-pushnotifications/ @menushka /types/node-ral/ @ssddi456 /types/node-red/ @andersea -/types/node-rsa/ @alitaheri +/types/node-rsa/ @alitaheri @xm /types/node-schedule/ @cyrilschumacher @flowpl /types/node-slack/ @tkQubo /types/node-snap7/ @heilingbrunner @@ -2614,6 +2669,7 @@ /types/node-xmpp-core/ @PJakcson /types/node-zookeeper-client/ @plantain-00 @jessezhang91 /types/node_redis/ @borisyankov +/types/nodecredstash/ @migstopheles /types/nodegit/ @dolanmiu /types/nodemailer/v3/ @rogierschouten /types/nodemailer/ @rogierschouten @dex4er @@ -2758,11 +2814,12 @@ /types/papaparse/ @torpedro @rainshen49 @jfloff @johnnyreilly /types/paper/ @clark-stevenson @Xakaloz /types/paralleljs/ @jbaldwin +/types/parcel-env/ @fathyb /types/parent-package-json/ @sgmccli /types/parity-pmd/ @leovujanic @jewbre /types/parity-pmr/ @leovujanic /types/parity-poe/ @leovujanic -/types/parse/ @dpoetzsch @jaeggerr @flavionegrao @wesleygrimes +/types/parse/ @dpoetzsch @jaeggerr @flavionegrao @wesleygrimes @owsas /types/parse-git-config/ @leonard-thieu /types/parse-glob/ @glen-84 /types/parse-json/ @mrmlnc @@ -2864,8 +2921,9 @@ /types/platform/ @JakeH /types/playcanvas/ @Neoflash1979 /types/playerframework/ @ricardosabino +/types/playmusic/ @nickp10 /types/pleasejs/ @nakakura -/types/plotly.js/ @chrisgervang @martinduparc @frederikaalund @taoqf @Dadstart +/types/plotly.js/ @chrisgervang @martinduparc @frederikaalund @taoqf @Dadstart @szechyjs /types/plugapi/ @BNedry /types/plugin-error/ @rogierschouten /types/plupload/ @patrickbussmann @@ -2882,6 +2940,7 @@ /types/popcorn/ @grapswiz /types/portscanner/ @douglasduteil /types/postal/ @lokeshpeta @myitcv +/types/postman-collection/ @kbuzby /types/postmark/ @benbayard /types/pouch-redux-middleware/ @charrondev /types/pouchdb/ @AGBrown @geppy @fredgalvao @@ -2913,6 +2972,7 @@ /types/pretty-ms/ @BendingBender /types/printf/ @AluisioASG /types/priorityqueuejs/ @geoffreak +/types/prismic-dom/ @nickw444 /types/prismjs/ @eriklieben @andrewiggins @mmiszy /types/private-ip/ @coderslagoon /types/procfs-stats/ @cyrilschumacher @@ -2970,7 +3030,7 @@ /types/puppeteer/ @marvinhagemeister @cdeutsch @jwbay /types/pure-render-decorator/ @seansfkelley /types/purl/ @danfma -/types/pusher-js/ @tkqubo +/types/pusher-js/ @tkqubo @cainlevy /types/pvutils/ @microshine /types/python-shell/ @dolanmiu @WORMSS /types/q/v0/ @bnemetchek @johnnyreilly @@ -2997,7 +3057,7 @@ /types/rabbit.js/ @wokim /types/radium/ @alexgorbatchev @nupplaphil @asvetliakov @mihe /types/radius/ @codeanimal -/types/ramda/ @donnut @mdekrey @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @charlespwd @samsonkeung @angeloocana @raynerd @googol @moshensky @ethanresnick +/types/ramda/ @donnut @mdekrey @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @charlespwd @samsonkeung @angeloocana @raynerd @googol @moshensky @ethanresnick @leighman /types/random-js/ @pistacchio /types/random-number/ @OpenByteDev /types/random-seed/ @endel @@ -3019,7 +3079,7 @@ /types/raspi-soft-pwm/ @nebrius /types/ratelimiter/ @AyaMorisawa /types/raty/ @terrawheat -/types/raven/ @scttcper @1999 +/types/raven/ @scttcper @1999 @shreyjain1994 /types/raven-for-redux/ @chiubaka /types/raygun4js/ @xt0rted @BenjaminHarding /types/rbac-a/ @tlaziuk @@ -3031,13 +3091,14 @@ /types/rdf-data-model/ @rubensworks /types/rdf-js/ @rubensworks /types/react/v15/ @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz -/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz @richseviora @theruther4d +/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz @richseviora @theruther4d @guilhermehubner @joshuakgoldberg /types/react-alert/ @ssyrell /types/react-alice-carousel/ @endigo /types/react-app/ @prakarshpandey /types/react-aria-menubutton/ @forabi @crohlfs /types/react-autosuggest/ @nicolas-schmitt @pjo256 @robessog @tbayne @cdeutsch @rosskevin -/types/react-beautiful-dnd/ @varHarrie @bradleyayers +/types/react-avatar-editor/ @diogocorrea @gabsprates +/types/react-beautiful-dnd/ @varHarrie @bradleyayers @paustint /types/react-big-calendar/ @piotrwitek @paustint @pikpok /types/react-body-classname/ @mhegazy /types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @mretolaza @katbusch @vitosamson @LKay @aaronbeall @@ -3098,7 +3159,7 @@ /types/react-flexr/ @pushplay /types/react-fontawesome/ @timurrustamov @dublicator @vincaslt @gavingregory /types/react-form/v1/ @cameron-mcateer -/types/react-form/ @cameron-mcateer +/types/react-form/ @cameron-mcateer @TiuSh /types/react-foundation/ @danielearwicker /types/react-geosuggest/ @brmenchl /types/react-google-recaptcha/ @KoalaHuman @@ -3121,6 +3182,7 @@ /types/react-image-gallery/ @adamwpc /types/react-imageloader/ @stephenjelfs /types/react-infinite/ @rhysd +/types/react-infinite-calendar/ @christianchown /types/react-infinite-scroller/ @Lapanti @psrebniak /types/react-input-calendar/ @stepancar /types/react-input-mask/ @apare @@ -3138,6 +3200,7 @@ /types/react-list/ @buptyyf @tomshen /types/react-loadable/ @Kovensky @odensc @ianks @tlaziuk /types/react-loader/ @artfuldev +/types/react-map-gl/ @rimig /types/react-maskedinput/ @LKay @lavoaster @CarlosBonetti /types/react-mce/ @morphologue /types/react-mdl/ @bradzacher @@ -3147,14 +3210,16 @@ /types/react-monaco-editor/ @jnetterf /types/react-motion/ @stepancar @asvetliakov @dimitarnestorov /types/react-motion-slider/ @asvetliakov -/types/react-native/ @alloy @huhuanming @iRoachie @timwangdev @kamal @nelyousfi -/types/react-native-collapsible/ @iRoachie +/types/react-native/ @alloy @huhuanming @iRoachie @timwangdev @kamal @nelyousfi @alexdunne +/types/react-native-auth0/ @ascariandrea +/types/react-native-collapsible/ @iRoachie @umidbekkarimov /types/react-native-communications/ @huhuanming @PaitoAnderson /types/react-native-datepicker/ @jacobbaskin /types/react-native-doc-viewer/ @iRoachie /types/react-native-document-picker/ @plantain-00 /types/react-native-drawer/ @jnbt /types/react-native-drawer-layout/ @jmfirth +/types/react-native-elevated-view/ @fhelwanger /types/react-native-fabric/ @josephroque /types/react-native-fbsdk/ @ifiokjr /types/react-native-fetch-blob/ @MNBuyskih @@ -3176,17 +3241,20 @@ /types/react-native-safari-view/ @mrand01 /types/react-native-scrollable-tab-view/ @CaiHuan @egorshulga /types/react-native-sensor-manager/ @SahinVardar -/types/react-native-snap-carousel/ @jnbt @j-fro +/types/react-native-snap-carousel/ @jnbt @j-fro @gazaret /types/react-native-sortable-grid/ @j-fro /types/react-native-sortable-list/ @sivolobov +/types/react-native-sqlite-storage/ @dryganets +/types/react-native-star-rating/ @iRoachie /types/react-native-svg-uri/ @iRoachie /types/react-native-swiper/ @CaiHuan @huhuanming @mhcgrq /types/react-native-tab-navigator/ @iRoachie /types/react-native-tab-view/ @kaoDev -/types/react-native-touch-id/ @huhuanming +/types/react-native-text-input-mask/ @RodrigoAWeber +/types/react-native-touch-id/ @huhuanming @gazaret /types/react-native-vector-icons/ @iRoachie @timwangdev -/types/react-native-video/ @huhuanming @abrahambotros -/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @abrahambotros @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @robertohuertasm @YourGamesBeOver +/types/react-native-video/ @huhuanming +/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @robertohuertasm @YourGamesBeOver @ArmandoAssuncao @cliedeman /types/react-notification-system/ @GiedriusGrabauskas @DeividasBakanas @LKay @sztobar /types/react-notification-system-redux/ @LKay /types/react-numeric-input/ @heatherbooker @@ -3195,6 +3263,7 @@ /types/react-onsenui/ @salim7 @jemmyw /types/react-overlays/ @aaronbeall @vitosamson /types/react-paginate/ @deevus @wouterhardeman @pegel03 @archy-bold +/types/react-places-autocomplete/ @guilhermehubner /types/react-pointable/ @istefo @mdibyo /types/react-portal/ @shuntksh /types/react-props-decorators/ @tkqubo @@ -3204,25 +3273,27 @@ /types/react-redux-i18n/ @clementdevos /types/react-redux-toastr/ @Smiche @artyomsv @kulmajaba /types/react-relay/ @graphcool @voxmatt @alloy @npirotte +/types/react-resize-detector/ @matthew-matvei /types/react-resolver/ @forabi /types/react-responsive/v1/ @asvetliakov /types/react-responsive/ @asvetliakov @alechill @xaviergonz +/types/react-rnd/ @Ragg- /types/react-router/v2/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov /types/react-router/v3/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @ssorallen -/types/react-router/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @tkrotoff @huy-nguyen @grmiade @DaIgeb @egorshulga @neuoy +/types/react-router/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @tkrotoff @huy-nguyen @grmiade @DaIgeb @egorshulga @neuoy @rraina /types/react-router-bootstrap/ @vlesierse @LKay @olmobrutall /types/react-router-config/ @lith-light-g -/types/react-router-dom/ @tkrotoff @huy-nguyen -/types/react-router-native/ @ezintz +/types/react-router-dom/ @tkrotoff @huy-nguyen @p-jackson +/types/react-router-native/ @ezintz @fhelwanger /types/react-router-navigation/ @kaoDev /types/react-router-navigation-core/ @kaoDev /types/react-router-redux/v3/ @isman-usoh @noah79 @rosendi /types/react-router-redux/v4/ @isman-usoh @noah79 @rosendi @LKay @DovydasNavickas -/types/react-router-redux/ @huy-nguyen @8398a7 +/types/react-router-redux/ @huy-nguyen @8398a7 @mykolas /types/react-s-alert/ @mitsuruog /types/react-scroll/ @sudoplz @GiedriusGrabauskas /types/react-scrollbar/ @stephenjelfs -/types/react-select/ @Hesquibet @giladgray @iebaker @skirsdeda @vujevits @devrelm @MartynasZilinskas @onatm @ninjaferret @tehbi4 @misantronic +/types/react-select/ @Hesquibet @giladgray @iebaker @skirsdeda @vujevits @devrelm @MartynasZilinskas @onatm @ninjaferret @tehbi4 @misantronic @darkartur /types/react-side-effect/ @remojansen /types/react-sidebar/ @jeroenvervaeke /types/react-sketchapp/ @ricokahler @DomiR @@ -3234,7 +3305,8 @@ /types/react-spinkit/v1/ @tkqubo @mleko @pelotom /types/react-spinkit/ @tkqubo @mleko @pelotom @zzanol /types/react-sticky/ @curtisw0 -/types/react-stripe-elements/ @dan-j @santiagodoldan @sonnysangha +/types/react-stripe-elements/ @dan-j @santiagodoldan @sonnysangha @9y5 @thchia +/types/react-svg/ @viccrubs /types/react-svg-pan-zoom/ @huy-nguyen /types/react-swf/ @stepancar /types/react-swipe/ @DeividasBakanas @@ -3265,7 +3337,7 @@ /types/react-twitter-auth/ @paulfasola /types/react-user-tour/ @ccancellieri /types/react-virtual-keyboard/ @bsurai -/types/react-virtualized/ @kaoDev @guntherjh @wasd171 @szabolcsx @kraenhansen +/types/react-virtualized/ @kaoDev @guntherjh @wasd171 @szabolcsx @kraenhansen @Stevearzh /types/react-virtualized-select/ @seansfkelley /types/react-weui/ @tairan /types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 @r3nya @@ -3274,7 +3346,7 @@ /types/reactable/ @spielc /types/reactcss/ @chrisgervang @LKay /types/reactstrap/v4/ @alihammad @mfal @danilobjr @fabiopaiva -/types/reactstrap/ @alihammad @mfal @danilobjr @fabiopaiva @FaithForHumans @KurtPreston @kraenhansen @timc13 +/types/reactstrap/ @alihammad @mfal @danilobjr @fabiopaiva @FaithForHumans @KurtPreston @timc13 /types/read/ @timjk /types/read-chunk/ @crispybee /types/read-package-tree/ @mgroenhoff @@ -3286,12 +3358,13 @@ /types/readline-transform/ @dex4er /types/reapop/ @Barrokgl /types/recase/ @18steps -/types/recharts/ @mthmulders @rapmue @royxue @ZheyangSong @richbai90 -/types/recompose/ @iskandersierra @mrapogee @clayne11 +/types/recharts/ @mthmulders @rapmue @royxue @ZheyangSong @richbai90 @caspeco-dan +/types/recluster/ @dex4er +/types/recompose/ @iskandersierra @mrapogee @clayne11 @Pajn /types/reconnectingwebsocket/ @nguarracino /types/recursive-readdir/v1/ @elisee /types/recursive-readdir/ @elisee @MicahZoltu -/types/redis/ @soywiz @CodeAnimal @MugeSo @UppaJung @Rokt33r @43081j +/types/redis/ @soywiz @CodeAnimal @MugeSo @UppaJung @Rokt33r @43081j @barnski /types/redis-errors/ @43081j /types/redis-mock/ @BendingBender /types/redis-rate-limiter/ @westy92 @@ -3315,7 +3388,7 @@ /types/redux-first-router-link/ @janb87 /types/redux-form/v4/ @aikoven /types/redux-form/v6/ @carsonf @aikoven @LKay @bancek -/types/redux-form/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 +/types/redux-form/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 @huwmartin /types/redux-immutable/ @oizie @sebald @gavingregory /types/redux-immutable-state-invariant/ @remojansen @highflying /types/redux-infinite-scroll/ @silkyfray @@ -3338,6 +3411,7 @@ /types/redux-storage/ @asvetliakov /types/redux-storage-engine-jsurl/ @screendriver /types/redux-storage-engine-localstorage/ @screendriver +/types/redux-test-utils/ @huwmartin /types/redux-ui/ @andyshuxin /types/ref/ @loyd /types/ref-array/ @loyd @@ -3380,7 +3454,7 @@ /types/restler/ @cyrilschumacher /types/restling/ @loghorn /types/resumablejs/ @DanielMcAssey -/types/rethinkdb/ @alexgorbatchev +/types/rethinkdb/ @alexgorbatchev @AdrianFarmadin /types/retry/ @krenor /types/retry-as-promised/ @Raigen /types/rev-hash/ @ikatyang @@ -3396,14 +3470,16 @@ /types/riot/ @Stubb0rn /types/riot-api-nodejs/ @zafixlrp /types/riot-games-api/ @xstoudi +/types/riot-route/ @karak /types/riotcontrol/ @chrootsu /types/riotjs/ @vvakame /types/rison/ @impworks /types/rivets/ @TrevorDev @matjanos /types/roads/ @dancespiele +/types/roads-server/ @dancespiele /types/rollup-plugin-json/ @asmockler /types/ronomon__crypto-async/ @BendingBender -/types/rosie/ @abner @subvertallchris +/types/rosie/ @abner @subvertallchris @abukurov /types/roslib/ @Pro @skycoop @dgorobopec /types/rot-js/ @atiaxi /types/route-parser/ @ianks @bobbuehler @@ -3448,7 +3524,7 @@ /types/saml20/ @HackerUndKoch /types/samlp/ @horiuchi /types/sammy/ @borisyankov @oising -/types/sanctuary/ @davidchambers @cortopy +/types/sanctuary/ @davidchambers @cortopy @piq9117 /types/sandboxed-module/ @svi3c /types/sane/ @BendingBender /types/sanitize-filename/ @Nemo157 @@ -3472,8 +3548,10 @@ /types/scryptsy/ @micksatana /types/seamless/ @danmana /types/seamless-immutable/ @alex3165 @xsburg @geirsagberg +/types/seededshuffle/ @urish /types/seedrandom/ @kernhanda /types/segment-analytics/ @fongandrew +/types/select2/v3/ @borisyankov /types/select2/ @borisyankov /types/selectables/ @renjfk /types/selectize/ @adidahiya @naBausch @@ -3506,9 +3584,9 @@ /types/semver-diff/ @chrismbarr /types/sencha_touch/ @brian428 /types/send/ @MikeJerred -/types/seneca/ @psnider +/types/seneca/ @psnider @kevynb /types/sequelize/v3/ @samuelneff @codeanimal @drinchev @morpheusxaut @torhal -/types/sequelize/ @samuelneff @codeanimal @drinchev @babolivier @kukoo1 @oktapodia @morpheusxaut @TitaneBoy @zjy01 @nidzov @Raigen @todd +/types/sequelize/ @samuelneff @codeanimal @drinchev @babolivier @kukoo1 @oktapodia @morpheusxaut @TitaneBoy @zjy01 @nidzov @Raigen @todd @nrschultz /types/sequelize-fixtures/ @cschwarz /types/sequencify/ @npenin /types/sequester/ @Strate @@ -3522,6 +3600,7 @@ /types/session-file-store/ @blendsdk @rokt33r /types/set-cookie-parser/ @nickp10 /types/set-value/ @DanielRosenwasser +/types/settings/ @shreyjain1994 /types/sha1/ @arcdev1 /types/shallowequal/ @seansfkelley /types/shapefile/ @DenisCarriere @@ -3539,7 +3618,7 @@ /types/shortid/ @stpettersens @despairblue /types/shot/ @AJamesPhillips /types/should-sinon/ @Arylo -/types/showdown/ @cbowdon @tan9 +/types/showdown/ @cbowdon @tan9 @arielsaldana /types/shrink-ray/ @forabi /types/siema/ @Irmiz @0x6368656174 @samnau /types/siesta/ @bquarmby @@ -3556,6 +3635,7 @@ /types/simple-oauth2/ @mad-mike /types/simple-peer/ @tlaziuk /types/simple-url-cache/ @a-lucas +/types/simple-websocket/ @dex4er /types/simple-xml/ @notVitaliy /types/simplebar/v1/ @gregonnet @leonard-thieu /types/simplebar/ @gregonnet @leonard-thieu @@ -3566,7 +3646,7 @@ /types/sinon/ @mrbigdog2u @rationull @lumaxis @nicojs @43081j /types/sinon-as-promised/ @igrayson /types/sinon-chai/ @kazimanzurrashid @jedmao -/types/sinon-chrome/ @pimterry @crimx +/types/sinon-chrome/ @pimterry @crimx @kobanyan /types/sinon-express-mock/ @jpchip @tlaziuk /types/sinon-mongoose/ @stevehipwell /types/sinon-stub-promise/ @vintem @tstackhouse @@ -3614,6 +3694,7 @@ /types/sort-array/ @mrmlnc /types/sortablejs/ @Maw-Fox /types/soundmanager2/ @elton2048 +/types/soupbintcp/ @jewbre /types/source-list-map/ @e-cloud /types/source-map-support/ @Bartvds @jason0x43 /types/space-pen/ @vvakame @@ -3638,7 +3719,7 @@ /types/sprintf/ @soywiz @BendingBender /types/sprintf-js/ @jasonswearingen @BendingBender /types/sql.js/ @Hozuki -/types/sqlite3/ @nmalaguti @dpyro +/types/sqlite3/ @nmalaguti @dpyro @BehindTheMath /types/sqlstring/ @marvinhagemeister /types/squirejs/ @bradleyayers /types/srp/ @Patman64 @@ -3660,7 +3741,11 @@ /types/statuses/ @tkrotoff @BendingBender /types/std-mocks/ @jdxcode /types/steam/ @kant2002 +/types/steam-client/ @Slessi +/types/steam-totp/ @phenomax +/types/steamid/ @Slessi /types/steed/ @Paul-Isache +/types/stellar-sdk/ @carl-foster @tristonj /types/stemmer/ @will-ockmore /types/sticky-cluster/ @paustint /types/stompjs/ @jimic @Dr4k4n @@ -3681,9 +3766,11 @@ /types/stream-series/ @k-kagurazaka /types/stream-to-array/v0/ @Bartvds /types/stream-to-array/ @Bartvds @BendingBender +/types/stream-to-promise/ @Alorel /types/streaming-json-stringify/ @BendingBender /types/streamjs/ @erosb /types/strftime/ @cyrilschumacher +/types/strict-uri-encode/ @hoishin /types/string/ @basp /types/string-hash/ @ethanrubio /types/string-similarity/ @ragtime @@ -3693,7 +3780,7 @@ /types/strip-ansi/ @mhegazy /types/strip-bom/ @mhegazy /types/strip-json-comments/ @dmoonfire -/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi +/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi @bruun /types/stripe-checkout/ @cgwrench /types/stripe-v2/ @ejsmith @amritk @adamcmiel @jleider @galuszkak /types/stripe-v3/ @ejsmith @amritk @adamcmiel @jleider @galuszkak @@ -3709,7 +3796,7 @@ /types/succinct/ @EnableSoftware /types/sudo-block/ @BendingBender /types/suitescript/ @darrenhillconsulting -/types/sumo-logger/ @forabi +/types/sumo-logger/ @forabi @clementallen /types/superagent/v2/ @varju @NicoZelaya @mxl /types/superagent/ @NicoZelaya @mxl @paplorinc @shreyjain1994 /types/superagent-no-cache/ @mxl @@ -3729,6 +3816,7 @@ /types/swag/ @shiwano /types/swagger-express-middleware/ @alexandreroba /types/swagger-express-mw/ @micmro +/types/swagger-express-validator/ @pinguet62 /types/swagger-hapi/ @micmro /types/swagger-jsdoc/ @drGrove /types/swagger-node-runner/ @micmro @@ -3755,6 +3843,7 @@ /types/tabris-plugin-firebase/ @eclipsesource /types/tabtab/ @vojtechhabarta /types/tabulator/ @euginio +/types/tapable/v0/ @e-cloud /types/tapable/ @e-cloud /types/tape/ @Bartvds @sodatea @DennisSchwartz @mikehenrty /types/tar/ @SomaticIT @connor4312 @@ -3775,6 +3864,7 @@ /types/text-buffer/ @GlenCFL /types/text-encoding/ @pine613 /types/text-encoding-utf-8/ @trxcllnt +/types/textarea-caret/ @shiftkey /types/three/ @gyohk @florentpoujol @SereznoKot @omni360 @ivoisbelongtous @piranha771 @qszhusightp @nakakura @s093294 @Pro @efokschaner @PsychoSTS @dhritzkiv @apurvaojas /types/thrift/ @kamek-pf @kevin-greene-ck @jessezhang91 /types/throng/ @cyrilschumacher @tatethurston @@ -3792,6 +3882,7 @@ /types/timer-machine/ @dolanmiu /types/timezone-js/ @bonnici /types/tinder/ @pingec +/types/tiny-slider-react/ @screendriver /types/tinycolor2/ @M-Zuber @geertjansen @nvh /types/tinycopy/ @vvatanabe /types/tinymce/ @martinduparc @ipoul @nicohartto @@ -3806,7 +3897,7 @@ /types/toastr/ @borisyankov /types/tocktimer/ @evanshortiss /types/tooltipster/ @stephenlautier @pjmagee @VorobeY1326 @leonard-thieu @janhi @joeskeen -/types/topojson/ @ricardo-mello @chenzhutian +/types/topojson/ @ricardo-mello @chenzhutian @denisname /types/torrent-stream/ @xstoudi /types/touch/ @mizunashi-mana @BendingBender /types/touch-events/ @kevinb7 @@ -3815,13 +3906,14 @@ /types/tracking/ @pimterry /types/transducers-js/ @colinkahn @dphilipson @NaridaL /types/transducers.js/ @dphilipson -/types/trash/ @matthew-matvei +/types/trash/ @matthew-matvei @hoishin /types/traverse/ @newclear /types/traverson/ @marcinporebski /types/trayballoon/ @korve /types/tress/ @sindilevich /types/trim/ @skysteve /types/trunk8/ @niemyjski +/types/tryer/ @bengry /types/tspromise/ @soywiz /types/tunnel/ @BendingBender /types/tus-js-client/ @kevhiggins @@ -3847,9 +3939,11 @@ /types/typescript-deferred/ @DirtyHairy /types/tz-format/ @samverschueren /types/ua-parser-js/ @superduper @legendecas @MeLlamoPablo -/types/uglify-js/ @tkrotoff +/types/uglify-js/v2/ @tkrotoff +/types/uglify-js/ @alan-agius4 @tkrotoff /types/uglifycss/ @blendsdk -/types/ui-grid/ @btesser @joeskeen +/types/uglifyjs-webpack-plugin/ @vajkayrene +/types/ui-grid/ @btesser @joeskeen @pbojanczyk /types/ui-router-extras/ @mputters @marcel-k @LaserUnicorns /types/ui-select/ @nkovacic /types/uid-safe/ @geoffreak @@ -3858,7 +3952,7 @@ /types/ultra-strftime/ @dex4er /types/umbraco/ @DeCareSystemsIreland /types/umd/ @TeamworkGuy2 -/types/umzug/ @drinchev @mlamp +/types/umzug/ @drinchev @mlamp @trodi /types/underscore/ @borisyankov @jbaldwin @ccurrens @clottman /types/underscore-ko/ @MagicMau /types/underscore.string/ @rygine @@ -3878,7 +3972,7 @@ /types/unzip/ @coding2012 /types/unzipper/ @s73obrien /types/update-notifier/v1/ @vvakame @nchen63 -/types/update-notifier/ @vvakame @nchen63 +/types/update-notifier/ @vvakame @nchen63 @bitjson /types/upng-js/ @plantain-00 /types/uppercamelcase/ @plantain-00 /types/urbanairship-cordova/ @Justin-Credible @@ -3909,13 +4003,13 @@ /types/uuid-1345/ @mugeso /types/uuid-js/ @mhegazy /types/uuid-validate/ @HiromiShikata -/types/uws/ @plantain-00 +/types/uws/ @plantain-00 @orblazer /types/valdr/ @ilbertz /types/valdr-message/ @ilbertz /types/valerie/ @conficient /types/vali-date/ @SamVerschueren /types/valid-url/ @stevehipwell -/types/validator/ @tgfjt @chrootsu @IOAyman @louy @kacepe @deptno +/types/validator/ @tgfjt @chrootsu @IOAyman @louy @kacepe @deptno @builtinnya /types/validatorjs/ @LKay @danmana /types/vanilla-modal/ @samnau /types/vanilla-tilt/ @BrunnerLivio @@ -3963,6 +4057,7 @@ /types/w2ui/ @Ptival /types/w3c-generic-sensor/ @kenchris /types/w3c-image-capture/ @cosium +/types/w3c-permissions/ @jberube /types/w3c-screen-orientation/ @kenchris /types/w3c-web-usb/ @larsgk /types/waitme/ @totpero @@ -3987,12 +4082,14 @@ /types/webcl/ @NCARalph /types/webcomponents.js/ @adidahiya /types/webcrypto/ @iislucas -/types/webdriverio/ @nmalaguti @timbru31 @fsmedberg-tc @tanvirislam06 +/types/webdriverio/ @nmalaguti @timbru31 @fsmedberg-tc @tanvirislam06 @phil-lgr /types/webfontloader/ @doskallemaskin /types/webgl-ext/ @zenmumbler /types/webgl2/ @nkemnitz +/types/webidl2/ @saschanaz /types/webmidi/ @lostfictions -/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @ahmed-taj @alan-agius4 @elliottsj @jason0x43 +/types/webpack/v3/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @ahmed-taj @alan-agius4 @elliottsj @jason0x43 +/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @ahmed-taj @alan-agius4 @elliottsj @jason0x43 @dennispg /types/webpack-bundle-analyzer/ @kryops /types/webpack-chain/ @eirikurn @psachs21 /types/webpack-chunk-hash/ @mtraynham @@ -4020,7 +4117,7 @@ /types/webvr-api/ @lostfictions /types/week/ @sindrenm /types/weighted/ @ccitro -/types/weixin-app/ @taoqf +/types/weixin-app/ @taoqf @AlexStacker /types/wellknown/ @yairtawil /types/whatwg-streams/ @saschanaz /types/wheel/ @BTOdell @@ -4039,19 +4136,22 @@ /types/winrt-uwp/ @saschanaz @taylor224 /types/winston/ @bonnici @codeanimal @DABH /types/winston-dynamodb/ @nickiannone +/types/winston-syslog/ @cjbarth /types/wiring-pi/ @NoHomey /types/wnumb/ @acoreyj /types/wonder.js/ @yyc-git /types/word-list-json/ @dovidm /types/wordcloud/ @joeskeen /types/words-to-numbers/ @James-Frowen +/types/wpapi/ @guoyunhe +/types/wrap-ansi/v2/ @kayahr /types/wrap-ansi/ @kayahr /types/wreck/ @marcinporebski /types/wrench/ @soywiz /types/write-file-atomic/ @BendingBender /types/write-json-file/ @DenisCarriere /types/write-pkg/ @azasypkin -/types/ws/ @loyd @elithrar @mlamp @TitaneBoy +/types/ws/ @loyd @elithrar @mlamp @TitaneBoy @orblazer /types/wtfnode/ @dex4er /types/wu/ @phiresky /types/wx-js-sdk-dt/ @agasbzj @@ -4086,6 +4186,7 @@ /types/yargs/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC /types/yauzl/ @ffflorian /types/yayson/ @Codesleuth +/types/yazl/ @taoqf /types/ydn-db/ @yathit @gabrielmaldi /types/yeoman-generator/ @armorik83 @janslow @ikatyang /types/yeoman-test/ @ikatyang From fee7a9e1164a689ed514f716260b8e8c78e41b63 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 9 Apr 2018 11:57:57 -0700 Subject: [PATCH 0525/2153] Update CODEOWNERS (#24849) --- .github/CODEOWNERS | 89 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 62 insertions(+), 27 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7182a5462f..f3343415f0 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -41,7 +41,7 @@ /types/adm-zip/ @jvilk @abner /types/adone/ @s0m3on3 @maxveres /types/aframe/ @devpaul @bertoritger -/types/agenda/ @meirgottlieb +/types/agenda/ @meirgottlieb @princjef /types/aggregate-error/ @BendingBender /types/alertify/ @jjeffery /types/alexa-sdk/ @petebeegle @hoo29 @pascalwhoop @blforce @rk-7 @alexmalcoci @@ -51,6 +51,8 @@ /types/alt/ @Shearerbeard /types/amazon-product-api/ @MattiLehtinen @alien35 /types/amcharts/ @ldrick +/types/amp/ @jewbre +/types/amp-message/ @jewbre /types/amphtml-validator/ @kevincharm /types/amplify/ @joeriks /types/amplify-deferred/ @joeriks @laurentiustamate94 @@ -186,7 +188,7 @@ /types/async-cache/ @BendingBender /types/async-lock/ @elisee @afharo @rhymmor /types/async-polling/ @Goldsmith42 -/types/async-retry/ @albertywu +/types/async-retry/ @albertywu @MeLlamoPablo /types/async.nexttick/ @pyrho /types/asynciterator/ @rubensworks /types/atlaskit__button/ @dijimsta @@ -211,7 +213,7 @@ /types/autosuggest-highlight/ @senukartur /types/awesomplete/ @webbiesdk @bmdixon @tbekolay /types/aws-iot-device-sdk/ @niik @mlamp -/types/aws-lambda/ @skarum @tobyhede @buggy @y13i @wwwy3y3 @OrthoDex @MichaelMarner @daniel-cottone @kostya-misura @coderbyheart @palmithor @daniloraisi @simonbuchan @Haydabase +/types/aws-lambda/ @skarum @tobyhede @buggy @y13i @wwwy3y3 @OrthoDex @MichaelMarner @daniel-cottone @kostya-misura @coderbyheart @palmithor @daniloraisi @simonbuchan @Haydabase @repl-chris /types/aws-serverless-express/ @threesquared @jcaffey @mattmeye @albertovasquez /types/aws4/ @ajcrites /types/axel/ @ruslan-molodyko @@ -375,7 +377,7 @@ /types/byline/ @reppners /types/bytebuffer/ @cappellin /types/bytes/ @danny8002 @believer -/types/c3/ @mcliment @gerinjacob @denyo @dmitryshindin +/types/c3/ @mcliment @gerinjacob @denyo @dmitryshindin @timn /types/cache-manager/ @GausSim /types/cal-heatmap/ @RetroChrisB /types/callsite/ @newclear @@ -396,8 +398,7 @@ /types/caseless/ @downace @mastermatt /types/cash/ @akvlko /types/casperjs/ @jedmao @urielch -/types/cassandra-driver/ @Svjard -/types/catalog/ @grossbart @wereHamster +/types/cassandra-driver/ @Svjard @pc-jedi /types/catbox/v7/ @jasonswearingen @AJamesPhillips /types/catbox/ @jasonswearingen @AJamesPhillips @saboya /types/cbor/ @pushplay @@ -451,6 +452,9 @@ /types/clean-stack/ @BendingBender /types/clean-webpack-plugin/ @j-f1 /types/clear-require/ @dan-j +/types/clearbladejs-client/ @ClearBlade +/types/clearbladejs-node/ @ClearBlade +/types/clearbladejs-server/ @ClearBlade /types/cleave.js/ @clentfort @jasongi-at-sportsbet @sashashakun /types/cli/ @kayahr /types/cli-color/ @ChaosinaCan @@ -494,6 +498,7 @@ /types/cometd/ @derekcicerone /types/command-line-args/ @CzBuCHi /types/command-line-commands/ @CzBuCHi +/types/command-line-usage/ @Dvorsky /types/commangular/ @hiraash /types/comment-json/ @Jason3S /types/common-tags/ @zuzusik @tzupengwang @@ -592,7 +597,7 @@ /types/createjs-lib/ @evilangelist @gyohk /types/credential/ @phuvo /types/credit-card-type/ @LKay -/types/cron/ @horiuchi +/types/cron/ @horiuchi @winup /types/cropperjs/ @stepancar /types/croppie/ @connor4312 @dklmuc @sarunint /types/cross-spawn/ @Alorel @@ -681,7 +686,9 @@ /types/datadog-metrics/ @pushplay /types/datadog-tracer/ @dineshsaravanan /types/datatables.net/ @Silver-Connection @omidkrad @pragmatrix @CNBoland +/types/datatables.net-autofill/ @andy-maca /types/datatables.net-buttons/ @Silver-Connection @SammyG4Free @jimhartford +/types/datatables.net-colreorder/ @andy-maca /types/datatables.net-fixedheader/ @szechyjs @Silver-Connection /types/datatables.net-rowgroup/ @maixiu /types/datatables.net-rowreorder/ @baywet @@ -744,12 +751,13 @@ /types/dhtmlxscheduler/ @mkozhukh /types/di-lite/ @dcrusader /types/diacritics/ @otociulis -/types/diff/ @vvakame +/types/diff/ @vvakame @szdc /types/diff2html/ @rtfpessoa /types/dir-resolve/ @andy-ms /types/discontinuous-range/ @OiCMudkips /types/dispatchr/ @Ragg- /types/disposable-email-domains/ @geoffreak +/types/dnssd/ @angelmerino /types/doccookies/ @jonegerton /types/dockerode/ @seikho @nlaplante @isac322 @lazarusx @meisenzahl @thegecko /types/docopt/ @giggio @@ -774,6 +782,7 @@ /types/dotenv/v2/ @jussikinnula @borekb @enaeseth /types/dotenv/ @jussikinnula @borekb @enaeseth /types/dotenv-safe/ @krenor +/types/dotenv-webpack/ @karol-majewski /types/dotfile-regex/ @mrmlnc /types/dottie/ @domarmstrong /types/double-ended-queue/ @dsagal @@ -849,7 +858,7 @@ /types/elm/ @thSoft /types/email-templates/ @cyrilschumacher @gurisko @blankstar85 /types/ember/v1/ @jedmao -/types/ember/ @jedmao @bttf @dwickern @chriskrycho @theroncross @mfeckie +/types/ember/ @jedmao @bttf @dwickern @chriskrycho @theroncross @mfeckie @alexlafroscia /types/ember-data/ @dwickern @mike-north @chriskrycho /types/ember-feature-flags/ @tansongyang /types/ember-mocha/ @dwickern @@ -890,6 +899,7 @@ /types/es6-weak-map/ @pine /types/escape-html/ @elisee /types/escape-latex/ @olsio +/types/escape-regexp/ @jewbre /types/escape-string-regexp/ @kruncher @faergeek /types/escodegen/ @simondel /types/eslint/ @pmdartus @j-f1 @@ -926,6 +936,7 @@ /types/exit-hook/ @BendingBender /types/exorcist/ @TeamworkGuy2 /types/expect/ @jmreidy @merrywhether +/types/expect-puppeteer/ @JoshuaKGoldberg /types/expect.js/ @teppeis /types/expectations/ @vvakame /types/expo/v23/ @KonstantinKai @@ -945,12 +956,13 @@ /types/express-ejs-layouts/ @erikma /types/express-enforces-ssl/ @kevinstubbs /types/express-fileupload/ @Naktibalda +/types/express-flash/ @iMobs /types/express-flash-2/ @mathsalmi /types/express-flash-notification/ @Mister4Eyes /types/express-formidable/ @tdolsen @evanshortiss /types/express-graphql/ @isman-usoh @nitintutlani @hubel @zya @mlamp @firede /types/express-handlebars/ @stpettersens @yhaskell -/types/express-jwt/ @wokim @kacepe @Sl1MBoy +/types/express-jwt/ @wokim @kacepe @Sl1MBoy @milan-mimra /types/express-less/ @xieyubo /types/express-minify/ @borislavjivkov /types/express-mongo-sanitize/ @ericbyers @@ -977,7 +989,7 @@ /types/eyes/ @brynbellomy /types/ez-plus/ @AndersonFriaca /types/f1/ @neolwc -/types/fabric/ @oklemencic @joewashear007 @mrand01 @NotWoods +/types/fabric/ @oklemencic @joewashear007 @mrand01 @NotWoods @bmartinson /types/facebook-instant-games/ @menushka /types/facebook-js-sdk/ @amritk /types/facebook-pixel/ @noctishsu @@ -999,6 +1011,7 @@ /types/fastclick/ @shinnn /types/favico.js/ @drowse314-dev-ymat /types/fb/ @JoshStrobl +/types/fb-watchman/ @whtsky /types/fbemitter/ @kmxz /types/featherlight/ @xStrom /types/feathersjs__authentication/ @AbraaoAlves @j2L4e @@ -1285,6 +1298,7 @@ /types/git-config/ @stpettersens /types/git-remote-origin-url/ @janslow /types/github-username-regex/ @BehindTheMath +/types/gitlab/ @yanqing6628780 @Arylo /types/gl-matrix/ @mattijskneppers @tatchx @nbabanov @auzmartist @surtr-isaz /types/gldatepicker/ @qcz /types/glidejs/ @milanjaros @@ -1624,6 +1638,7 @@ /types/istanbul-reports/ @jason0x43 /types/ityped/ @DanielRosenwasser /types/ix.js/ @Igorbek +/types/jackrabbit/ @elvisvoer /types/jade/ @panuhorsmalahti /types/jalaali-js/ @alitaheri /types/japanese-holidays/ @syamatoo @@ -1654,11 +1669,14 @@ /types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @AhnpGit @joshuakgoldberg @bradleyayers /types/jest-diff/ @myabc /types/jest-docblock/ @ikatyang +/types/jest-environment-puppeteer/ @joshuakgoldberg /types/jest-get-type/ @myabc +/types/jest-image-snapshot/ @dawnmist /types/jest-in-case/ @geovanisouza92 /types/jest-json-schema/ @deadNightTiger /types/jest-matcher-utils/ @myabc /types/jest-matchers/ @joscha +/types/jest-specific-snapshot/ @dawnmist /types/jest-validate/ @ikatyang /types/jfs/ @tlaziuk /types/jjv/ @Nemo157 @@ -1682,8 +1700,10 @@ /types/jquery-awesome-cursor/ @zskovacs /types/jquery-backstretch/ @dkulyk /types/jquery-countdown/ @AndersonFriaca +/types/jquery-countto/ @AndersonFriaca /types/jquery-cropbox/ @PerKastman /types/jquery-deparam/ @patsissons +/types/jquery-drawer/ @pine /types/jquery-easy-loading/ @delphinus35 /types/jquery-editable-select/ @baywet /types/jquery-fullscreen/ @bgrieder @@ -1827,6 +1847,7 @@ /types/json2md/ @MartynasZilinskas /types/jsonata/ @nick121212 /types/jsoneditor/ @alejo90 +/types/jsoneditor-for-react/ @joshuakgoldberg /types/jsoneditoronline/ @vbortone /types/jsonfile/ @dbowring /types/jsonminify/ @no23reason @@ -1846,7 +1867,7 @@ /types/jsreport-phantom-pdf/ @taoqf /types/jsreport-xlsx/ @taoqf /types/jsrp/ @harryshipton -/types/jss/ @appsforartists @kof +/types/jss/ @appsforartists @kof @pelotom /types/jssha/ @randombk @SrTobi /types/jstimezonedetect/ @olamothe /types/jstorage/ @dflor003 @@ -2359,6 +2380,7 @@ /types/mailcheck/ @pocesar /types/maildev/ @cyrilschumacher @zbarbuto /types/mailgen/ @vothanhkiet @jordanfarrer +/types/mailgun-js/ @sampsonjoliver /types/mailparser/ @psnider /types/main-bower-files/ @k-kagurazaka /types/make-dir/ @ikatyang @BendingBender @@ -2469,7 +2491,7 @@ /types/minimatch/ @vvakame @shantmarouti /types/minimist/ @Bartvds @Necroskillz @kamranayub /types/minimist-options/ @ikatyang -/types/minio/ @barinbritva +/types/minio/ @barinbritva @castorw /types/minipass/ @BendingBender /types/mirrorx/ @aaronphy /types/mithril/ @spacejack @andraaspar @isiahmeadows @@ -2506,7 +2528,7 @@ /types/moment-timezone/ @michelsalib @alanblins /types/mongo-sanitize/ @CedricCazin /types/mongodb/v2/ @CaselIT @alanmarcell @kikar @bitjson @dante-101 @mcortesi -/types/mongodb/ @CaselIT @alanmarcell @kikar @bitjson @dante-101 @mcortesi @EnricoPicci @AJCStriker +/types/mongodb/ @CaselIT @alanmarcell @kikar @bitjson @dante-101 @mcortesi @EnricoPicci @AJCStriker @julien-c /types/mongoose/v4/ @simonxca @horiuchi @sindrenm @lukasz-zak /types/mongoose/ @horiuchi @sindrenm @lukasz-zak @Alorel @jendrikw @ethanresnick @vologab /types/mongoose-auto-increment/ @AyaMorisawa @@ -2557,6 +2579,7 @@ /types/mysql/ @wjohnsto @kacepe @kpping @jdmunro /types/mz/ @ThomasHickman /types/n3/ @phreed +/types/named-regexp-groups/ @jewbre /types/nano/ @timjacobi @vincekovacs /types/nanoajax/ @nathancahill /types/nanoid/ @bash @@ -2615,7 +2638,7 @@ /types/nightmare/ @horiuchi @samyang-au @Bleser92 /types/nightwatch/ @rkavalap @schlesiger /types/nivo-slider/ @AndersonFriaca -/types/noble/ @swook @wind-rider @shantanubhadoria @lukel99 @bioball @keton +/types/noble/ @swook @wind-rider @shantanubhadoria @lukel99 @bioball @keton @thegecko /types/nock/ @bonnici @horiuchi @afharo @mastermatt @damour /types/nodal/ @charrondev /types/node/v4/ @eps1lon @@ -2639,7 +2662,7 @@ /types/node-gcm/ @horiuchi /types/node-geocoder/ @rosek86 /types/node-getopt/ @kcauchy -/types/node-hid/ @mhegazy @ert78gb +/types/node-hid/ @mhegazy @ert78gb @thegecko /types/node-horseman/ @apratheek /types/node-hue-api/ @fjmorel /types/node-int64/ @x3cion @kevin-greene-ck @@ -2743,7 +2766,8 @@ /types/onoff/ @marcel-ernst /types/open/ @Bartvds /types/opener/ @tikurahul -/types/openfin/ @chrisbarker +/types/openfin/v17/ @chrisbarker +/types/openfin/ @chrisbarker @rdepena /types/openjscad/ @danmarshall /types/openlayers/v2/ @bolhovsky /types/openlayers/v3/ @osechet @matthiasdailey-ccri @@ -2860,6 +2884,7 @@ /types/path-exists/v1/ @shiwano /types/path-exists/ @shiwano @BendingBender /types/path-is-absolute/ @mhegazy +/types/path-is-inside/ @aomarks /types/pathfinding/ @BNedry /types/pathjs/ @lokeshpeta /types/pathwatcher/ @GlenCFL @@ -3034,7 +3059,7 @@ /types/pvutils/ @microshine /types/python-shell/ @dolanmiu @WORMSS /types/q/v0/ @bnemetchek @johnnyreilly -/types/q/ @bnemetchek @AndrewGaspar @johnnyreilly @mboudreau +/types/q/ @bnemetchek @AndrewGaspar @johnnyreilly @mboudreau @TeamworkGuy2 /types/q-io/ @Bartvds /types/q-retry/ @vilic /types/qhistory/ @Kovensky @@ -3091,7 +3116,7 @@ /types/rdf-data-model/ @rubensworks /types/rdf-js/ @rubensworks /types/react/v15/ @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz -/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz @richseviora @theruther4d @guilhermehubner @joshuakgoldberg +/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @joshuakgoldberg @jrakotoharisoa /types/react-alert/ @ssyrell /types/react-alice-carousel/ @endigo /types/react-app/ @prakarshpandey @@ -3101,7 +3126,7 @@ /types/react-beautiful-dnd/ @varHarrie @bradleyayers @paustint /types/react-big-calendar/ @piotrwitek @paustint @pikpok /types/react-body-classname/ @mhegazy -/types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @mretolaza @katbusch @vitosamson @LKay @aaronbeall +/types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @mretolaza @katbusch @vitosamson @LKay @aaronbeall @jrakotoharisoa /types/react-bootstrap-date-picker/ @LKay @ssi-hu-antal-bodnar /types/react-bootstrap-daterangepicker/ @ianks /types/react-bootstrap-table/v2/ @flaub @alelode @UJosue10 @@ -3198,8 +3223,9 @@ /types/react-lazyload/ @m0a /types/react-leaflet/ @danzel @davschne @yuit /types/react-list/ @buptyyf @tomshen -/types/react-loadable/ @Kovensky @odensc @ianks @tlaziuk +/types/react-loadable/ @Kovensky @odensc @ianks @tlaziuk @iMobs /types/react-loader/ @artfuldev +/types/react-mailchimp-subscribe/ @osdiab /types/react-map-gl/ @rimig /types/react-maskedinput/ @LKay @lavoaster @CarlosBonetti /types/react-mce/ @morphologue @@ -3210,7 +3236,8 @@ /types/react-monaco-editor/ @jnetterf /types/react-motion/ @stepancar @asvetliakov @dimitarnestorov /types/react-motion-slider/ @asvetliakov -/types/react-native/ @alloy @huhuanming @iRoachie @timwangdev @kamal @nelyousfi @alexdunne +/types/react-native/ @alloy @huhuanming @iRoachie @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software +/types/react-native-android-taskdescription/ @christianchown /types/react-native-auth0/ @ascariandrea /types/react-native-collapsible/ @iRoachie @umidbekkarimov /types/react-native-communications/ @huhuanming @PaitoAnderson @@ -3225,6 +3252,7 @@ /types/react-native-fetch-blob/ @MNBuyskih /types/react-native-fs/ @pocesar @josephroque /types/react-native-google-signin/ @j-fro +/types/react-native-i18n/ @VincentLanglet /types/react-native-keep-awake/ @huhuanming /types/react-native-linear-gradient/ @j-fro /types/react-native-loading-spinner-overlay/ @fhelwanger @@ -3235,6 +3263,8 @@ /types/react-native-modalbox/ @iRoachie /types/react-native-navigation/ @egorshulga /types/react-native-orientation/ @MoLow +/types/react-native-permissions/ @vincentlanglet +/types/react-native-photo-view/ @christianchown /types/react-native-popup-dialog/ @PaitoAnderson @connectdotz /types/react-native-push-notification/ @PaitoAnderson @tomSawkins /types/react-native-qrcode/ @plantain-00 @@ -3253,6 +3283,7 @@ /types/react-native-text-input-mask/ @RodrigoAWeber /types/react-native-touch-id/ @huhuanming @gazaret /types/react-native-vector-icons/ @iRoachie @timwangdev +/types/react-native-version-number/ @VincentLanglet /types/react-native-video/ @huhuanming /types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @robertohuertasm @YourGamesBeOver @ArmandoAssuncao @cliedeman /types/react-notification-system/ @GiedriusGrabauskas @DeividasBakanas @LKay @sztobar @@ -3337,8 +3368,9 @@ /types/react-twitter-auth/ @paulfasola /types/react-user-tour/ @ccancellieri /types/react-virtual-keyboard/ @bsurai -/types/react-virtualized/ @kaoDev @guntherjh @wasd171 @szabolcsx @kraenhansen @Stevearzh +/types/react-virtualized/ @kaoDev @guntherjh @wasd171 @szabolcsx @kraenhansen @Stevearzh @mgoszcz2 /types/react-virtualized-select/ @seansfkelley +/types/react-webcam/ @squat /types/react-weui/ @tairan /types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 @r3nya /types/react-widgets-moment/ @dawnmist @@ -3487,7 +3519,6 @@ /types/royalslider/ @csrakowski /types/rpio/ @DominikPalo @Pencl /types/rrc/ @DeividasBakanas -/types/rrule/ @waratuman /types/rsmq/ @MugeSo /types/rsmq-worker/ @MugeSo /types/rss/ @secondwtq @@ -3606,7 +3637,7 @@ /types/shapefile/ @DenisCarriere /types/sharedworker/ @nakakura /types/sharepoint/ @gandjustas @andrei-markeev @baywet @teroarvola @dennispg -/types/sharp/ @lith-light-g +/types/sharp/ @lith-light-g @wooseopkim /types/sheetify/ @toddself /types/shell-escape/ @nenadalm /types/shell-quote/ @jason0x43 @@ -3718,6 +3749,7 @@ /types/spotify-web-playback-sdk/ @Festify @mraerino @NeoLegends /types/sprintf/ @soywiz @BendingBender /types/sprintf-js/ @jasonswearingen @BendingBender +/types/sql-bricks/ @adn05 @paleo /types/sql.js/ @Hozuki /types/sqlite3/ @nmalaguti @dpyro @BehindTheMath /types/sqlstring/ @marvinhagemeister @@ -3785,6 +3817,7 @@ /types/stripe-v2/ @ejsmith @amritk @adamcmiel @jleider @galuszkak /types/stripe-v3/ @ejsmith @amritk @adamcmiel @jleider @galuszkak /types/strong-cluster-control/ @shuntksh +/types/strong-error-handler/ @blankstar85 /types/strong-log-transformer/ @azasypkin /types/strophe/ @DavidKDeutsch /types/structured-source/ @azu @@ -3886,7 +3919,7 @@ /types/tinycolor2/ @M-Zuber @geertjansen @nvh /types/tinycopy/ @vvatanabe /types/tinymce/ @martinduparc @ipoul @nicohartto -/types/titanium/ @cyounkins +/types/titanium/ @appcelerator @janvennemann /types/title/ @fa7ad /types/tldjs/ @geoffreak /types/tmp/ @optical @Perlmint @@ -4114,12 +4147,14 @@ /types/webspeechapi/ @saschanaz /types/websql/ @TeamworkGuy2 /types/webtorrent/ @niieani @tlaziuk -/types/webvr-api/ @lostfictions +/types/webvr-api/ @efokschaner /types/week/ @sindrenm /types/weighted/ @ccitro /types/weixin-app/ @taoqf @AlexStacker /types/wellknown/ @yairtawil +/types/whatwg-mimetype/ @petejohanson /types/whatwg-streams/ @saschanaz +/types/whatwg-url/ @aomarks /types/wheel/ @BTOdell /types/when/ @derekcicerone @Nemo157 /types/which/ @vvakame @cspotcode From 17c171a73deca79b11995970ed7ab2200efc2cab Mon Sep 17 00:00:00 2001 From: eugeniy-balaban Date: Mon, 9 Apr 2018 22:06:59 +0300 Subject: [PATCH 0526/2153] update to 172.6 version (#24131) --- types/devexpress-web/index.d.ts | 4341 +- .../v171/devexpress-web-tests.ts | 418 + types/devexpress-web/v171/index.d.ts | 33698 ++++++++++++++++ types/devexpress-web/v171/tsconfig.json | 32 + types/devexpress-web/v171/tslint.json | 79 + 5 files changed, 38020 insertions(+), 548 deletions(-) create mode 100644 types/devexpress-web/v171/devexpress-web-tests.ts create mode 100644 types/devexpress-web/v171/index.d.ts create mode 100644 types/devexpress-web/v171/tsconfig.json create mode 100644 types/devexpress-web/v171/tslint.json diff --git a/types/devexpress-web/index.d.ts b/types/devexpress-web/index.d.ts index 50aac382b1..9b29d9e0db 100644 --- a/types/devexpress-web/index.d.ts +++ b/types/devexpress-web/index.d.ts @@ -1,7 +1,11 @@ -// Type definitions for DevExpress ASP.NET v171.4 +// Type definitions for DevExpress ASP.NET v172.6 // Project: http://devexpress.com/ // Definitions by: DevExpress Inc. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// +/// /** * A client-side counterpart of the DashboardViewer extension. @@ -115,7 +119,7 @@ interface ASPxClientDashboardItemClickEventArgs extends ASPxClientEventArgs { /** * Requests underlying data corresponding to the clicked visual element. * @param onCompleted A ASPxClientDashboardItemRequestUnderlyingDataCompleted object that references a method executed after the request is completed. - * @param dataMembers An array of string values that specify data members used to obtain underlying data. + * @param dataMembers (Optional) An array of string values that specify data members used to obtain underlying data. If this parameter is not specified, underlying data for all available data members will be requested. */ RequestUnderlyingData(onCompleted: ASPxClientDashboardItemRequestUnderlyingDataCompleted, dataMembers: string[]): void; } @@ -550,6 +554,53 @@ interface ASPxClientDashboardItemDataDeltaValue { */ GetIndicatorType(): ASPxClientDashboardItemDataMeasureValue; } +/** + * References a method that will handle the ItemCaptionToolbarUpdated event. + */ +interface ASPxClientDashboardItemCaptionToolbarUpdatedEventHandler { + /** + * References a method that will handle the ItemCaptionToolbarUpdated event. + * @param source The event source. + * @param e The ASPxClientDashboardItemCaptionToolbarUpdatedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemCaptionToolbarUpdatedEventArgs): void; +} +/** + * Provides data for the ItemCaptionToolbarUpdated event. + */ +interface ASPxClientDashboardItemCaptionToolbarUpdatedEventArgs extends ASPxClientEventArgs { + /** + * Gets a component name of the dashboard item. + * Value: A string value that is a component name of the dashboard item. + */ + ItemName: string; + /** + * Provides access to caption options of the dashboard item. + * Value: A DashboardItemCaptionToolbarOptions object containing caption options of the dashboard item. + */ + Options: Object; +} +/** + * References a method that will handle the DashboardTitleToolbarUpdated event. + */ +interface ASPxClientDashboardTitleToolbarUpdatedEventHandler { + /** + * References a method that will handle the DashboardTitleToolbarUpdated event. + * @param source The event source. + * @param e A ASPxClientDashboardTitleToolbarUpdatedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardTitleToolbarUpdatedEventArgs): void; +} +/** + * Provides data for the DashboardTitleToolbarUpdated event. + */ +interface ASPxClientDashboardTitleToolbarUpdatedEventArgs extends ASPxClientEventArgs { + /** + * Provides access to dashboard title options. + * Value: A DashboardTitleToolbarOptions object containing dashboard title options. + */ + Options: Object; +} /** * A point on the data axis. */ @@ -945,6 +996,16 @@ interface DashboardPdfExportOptions { * Value: A DashboardExportScaleMode value that specifies the mode for scaling a dashboard/dashboard item in the exported document. */ ScaleMode: string; + /** + * Gets or sets the mode for scaling a dashboard/dashboard item in the exported document. + * Value: A DashboardExportDocumentScaleMode value that specifies the mode for scaling a dashboard/dashboard item in the exported document. + */ + DocumentScaleMode: string; + /** + * Gets or sets whether the page orientation used to export a dashboard is selected automatically. + * Value: true, to automatically select the page orientation used to export a dashboard; otherwise, false. + */ + DashboardAutomaticPageLayout: boolean; /** * Gets or sets the scale factor (in fractions of 1), by which a dashboard/dashboard item is scaled in the exported document. * Value: A Single value that specifies the scale factor by which a dashboard/dashboard item is scaled in the exported document. @@ -1232,6 +1293,30 @@ interface ASPxClientDashboard extends ASPxClientControl { * Occurs after the dashboard update is performed. */ DashboardEndUpdate: ASPxClientEvent>; + /** + * Allows you to customize a dashboard item's caption (for instance, add custom buttons, menus, etc.). + */ + ItemCaptionToolbarUpdated: ASPxClientEvent>; + /** + * Allows you to customize a dashboard title (for instance, add custom buttons, menus, etc.). + */ + DashboardTitleToolbarUpdated: ASPxClientEvent>; + /** + * Returns names of the predefined ranges available for the specified Range Filter. + * @param itemName A string value that specifies the component name of the Range Filter dashboard item. + */ + GetAvailablePredefinedRanges(itemName: string): string[]; + /** + * Returns the name of the currently selected predefined range. + * @param itemName A string value that specifies the component name of the Range Filter dashboard item. + */ + GetCurrentPredefinedRange(itemName: string): string; + /** + * + * @param itemName + */ + UpdateItemCaptionToolbar(itemName: string): void; + UpdateDashboardTitleToolbar(): void; /** * Sends a callback to the server and generates the server-side CustomDataCallback event, passing it the specified argument. * @param parameter A string value that represents any information that needs to be sent to the server-side CustomDataCallback event. @@ -1239,7 +1324,7 @@ interface ASPxClientDashboard extends ASPxClientControl { */ PerformDataCallback(parameter: string, onCallback: ASPxClientDataCallback): void; /** - * Gets an inner part of the ASPxClientDashboard control. + * Gets the DashboardControl object that is the client-side part of the Web Dashboard. */ GetDashboardControl(): DashboardControl; /** @@ -1299,7 +1384,7 @@ interface ASPxClientDashboard extends ASPxClientControl { GetParameters(): ASPxClientDashboardParameters; /** * Invokes the dialog that allows end-users to export the entire dashboard to the specified format. - * @param format A string value that specifies the format. For instance, you can use 'PDF' or 'Image'. + * @param format A string value that specifies the format. For instance, you can use 'PDF', 'Image', or 'Excel'. */ ShowExportDashboardDialog(format: string): void; /** @@ -1635,16 +1720,6 @@ interface ASPxClientDashboard extends ASPxClientControl { * @param dateTimePeriodName A String value that specifies the predefined range name. */ SetPredefinedRange(itemName: string, dateTimePeriodName: string): void; - /** - * Returns names of the predefined ranges available for the specified Range Filter. - * @param itemName A string value that specifies the component name of the Range Filter dashboard item. - */ - GetAvailablePredefinedRanges(itemName: string): string[]; - /** - * Returns the name of the currently selected predefined range. - * @param itemName A string value that specifies the component name of the Range Filter dashboard item. - */ - GetCurrentPredefinedRange(itemName: string): string; } /** * References a method that will handle the DashboardStateChanged event. @@ -1986,6 +2061,14 @@ interface ASPxClientDashboardViewer extends ASPxClientControl { * Allows you to color the required dashboard item elements using the specified colors. */ ItemElementCustomColor: ASPxClientEvent>; + /** + * Allows you to customize a dashboard item's caption (for instance, add custom buttons, menus, etc.). + */ + ItemCaptionToolbarUpdated: ASPxClientEvent>; + /** + * Allows you to customize a dashboard title (for instance, add custom buttons, menus, etc.). + */ + TitleToolbarUpdated: ASPxClientEvent>; /** * Reloads data in the data sources. */ @@ -2064,6 +2147,12 @@ interface ASPxClientDashboardViewer extends ASPxClientControl { * @param itemName A String that specifies a component name of the master filter item. */ GetCurrentSelection(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * + * @param itemName + */ + UpdateItemCaptionToolbar(itemName: string): void; + UpdateDashboardTitleToolbar(): void; /** * Requests underlying data for the specified dashboard item. * @param itemName A string that specifies the component name of the dashboard item. @@ -2079,6 +2168,21 @@ interface ASPxClientDashboardViewer extends ASPxClientControl { * Closes the Dashboard Parameters dialog. */ HideParametersDialog(): void; + /** + * Shows the dialog that allows end-users to export the dashboard. + * @param format A string value that specifies the format. For instance, you can use 'PDF, 'Image' or 'Excel'. + */ + ShowExportDialog(format: string): void; + /** + * Shows the dialog that allows end-users to export the dashboard item. + * @param itemComponentName A component name of the dashboard item. + * @param format A string value that specifies the format. For instance, you can use 'PDF, 'Image' or 'Excel'. + */ + ShowExportDashboardItemDialog(itemComponentName: string, format: string): void; + /** + * Hides the dialog that allows end-users to export the dashboard/dashboard item. + */ + HideExportDialog(): void; /** * Returns settings that specify parameters affecting how the dashboard is exported. */ @@ -2554,8 +2658,17 @@ interface ASPxClientDashboardDrillUpPerformedEventArgs extends ASPxClientEventAr */ ItemName: string; } +/** + * Provides data for the onCustomizeText handler. + */ interface CardWidgetCustomizeTextEventArgs { + /** + * Gets a dimension/measure value to be displayed within the card. + */ getValue(): Object; + /** + * Gets a formatted value displayed within the card. + */ getDefaultText(): string; } /** @@ -2567,7 +2680,15 @@ interface CardWidget { * Value: A string that specifies the HTML color used to paint a card's background. */ cardBackColor: string; + /** + * Allows you to customize texts displayed within individual cards. + * Value: A handler used customize texts displayed within individual cards. + */ onCustomizeText: Object; + /** + * Gets the root element of the widget. + */ + element(): Object; } /** * When implemented, represents the Web Dashboard extension. @@ -2588,14 +2709,14 @@ interface IExtension { stop(): void; } /** - * An inner part of the ASPxClientDashboard control. + * A client-side part of the Web Dashboard. */ interface DashboardControl { /** * Gets or sets knockout templates that you can use in the Web Dashboard. * Value: A object that is a knockout template collection. */ - customTemplates: KnockoutObservableArray; + customTemplates: KnockoutObservableArray; /** * Provides an access to the collection of registered dashboard extensions. * Value: An array of IExtension objects that are dashboard extensions. @@ -2630,11 +2751,60 @@ interface DashboardControl { */ unregisterExtension(extensionName: string): void; } +interface UrlStateExtension extends IExtension { +} +interface Element { +} +/** + * The content of the Dashboard Parameters dialog. + */ +interface ParameterDialogContent { + /** + * Gets the Dashboard Parameters dialog's grid that displays parameter values. + * Value: The Dashboards Parameters dialog's grid that displays parameter values. + */ + grid: Object; + /** + * Applies changes made in the Dashboard Parameters dialog. + */ + submitParameterValues(): void; + /** + * Resets changes in the Dashboard Parameters dialog to the default values. + */ + resetParameterValues(): void; + valueChanged(): void; +} +/** + * A Web Dashboard extension that is the Dashboard Parameters dialog. + */ interface DashboardParameterDialogExtension extends IExtension { + /** + * Gets or sets whether to show the Dashboard Parameters button in the dashboard title. + * Value: true, to show the Dashboard Parameters button; otherwise, false. + */ + showDialogButton: KnockoutObservableBoolean; + /** + * Invokes the Dashboard Parameters dialog. + */ + show(): void; + /** + * Closes the Dashboard Parameters dialog. + */ + hide(): void; + /** + * Allows you to be notified about the dashboard parameter settings changes. + * @param callback A custom function. + */ + subscribeToContentChanges(callback: Function): Object; + /** + * Renders the content of the Dashboard Parameters dialog inside the specified JQuery element. + * @param element A JQuery element where the Dashboard Parameters dialog content is rendered. + */ + renderContent(element: Element): ParameterDialogContent; } interface DashboardExportExtension extends IExtension { } -interface DashboardClientApiExtension extends IExtension { +interface ViewerApiExtension extends IExtension { } interface DashboardCurrencyEditorExtension extends IExtension { } @@ -2642,7 +2812,12 @@ interface DataSourceBrowserExtension extends IExtension { } interface DataSourceWizardExtension extends IExtension { } -interface DashboadItemMenuExtension extends IExtension { +interface DashboardItemMenuExtension extends IExtension { +} +/** + * A Web Dashboard extension that allows you to configure color schemes. + */ +interface DashboardColorSchemeEditorExtension extends IExtension { } /** * A Web Dashboard extension that allows you to keep track of all user actions, and cancel or repeat them. @@ -2654,17 +2829,12 @@ interface UndoRedoExtension extends IExtension { isChanged(): boolean; } /** - * An extension that is the dashboard item's Binding menu allowing you to create and modify data binding. + * A Web Dashboard extension that is the dashboard item's Binding menu allowing you to create and modify data binding. */ interface BindingPanelExtension extends IExtension { } /** - * A Web Dashboard extension that allows you to configure color schemes. - */ -interface DashboardColorSchemeEditorExtension extends IExtension { -} -/** - * An extension that is the dashboard item's Convert To menu allowing you to convert or duplicate the current item. + * A Web Dashboard extension that is the dashboard item's Convert To menu allowing you to convert or duplicate the current item. */ interface ConversionPanelExtension extends IExtension { } @@ -2710,22 +2880,22 @@ interface OpenDashboardExtension extends IExtension { loadDashboard(id: string): void; } /** - * An extension that is the dashboard item's Interactivity menu containing settings that affect on interaction between various dashboard items. + * A Web Dashboard extension that is the dashboard item's Interactivity menu containing settings that affect on interaction between various dashboard items. */ interface InteractivityPanelExtension extends IExtension { } /** - * An extension that is the dashboard item's Options menu containing specific options and settings related to the current dashboard item. + * A Web Dashboard extension that is the dashboard item's Options menu containing specific options and settings related to the current dashboard item. */ interface OptionsPanelExtension extends IExtension { } /** - * An extension that is the Web Dashboard title editor. + * A Web Dashboard extension that is the dashboard title editor. */ interface DashboardTitleEditorExtension extends IExtension { } /** - * The Dashboard Panel extension that displays a list of available dashboards and lets you switch between the designer and viewer modes. + * The Dashboard Panel extension that allows users to switch between dashboards and enable the Designer mode. */ interface DashboardPanelExtension extends IExtension { /** @@ -2894,10 +3064,10 @@ interface DashboardToolboxGroup { */ index: number; /** - * Provide an access to the collection of toolbox items obtained from the specified toolbox group. - * Value: A object that is an array of items obtained from the specified toolbox group. + * Provides access to a collection of toolbox group items. + * Value: A DashboardToolboxItem). */ - items: KnockoutObservableArray; + items: KnockoutObservableArray; } /** * A toolbar group that contains dashboard toolbar items. @@ -2919,35 +3089,34 @@ interface DashboardToolbarGroup { */ index: number; /** - * Provide an access to the collection of toolbox items obtained from the specified toolbar group. - * Value: A object that is an array of items obtained from the specified toolbar group. + * Provides access to a collection of toolbar group items. + * Value: A DashboardToolbarItem). */ - items: KnockoutObservableArray; + items: KnockoutObservableArray; } /** * The Web Dashboard Toolbox extension that provides access to the dashboard menu and allows you to add dashboard items, as well as undo or repeat user actions. */ interface ToolboxExtension extends IExtension { /** - * Gets or sets the visibility of the dashboard menu. - * Value: true, to display the dashboard menu; otherwise, false. + * Provides access to a collection of the dashboard menu items. + * Value: A DashboardMenuItem). + */ + menuItems: KnockoutObservableArray; + /** + * Provides access to a collection of the Toolbox groups. + * Value: A DashboardToolboxGroup). + */ + toolboxGroups: KnockoutObservableArray; + /** + * Provides access to a collection of toolbar groups from the Toolbox. + * Value: A DashboardToolbarGroup). + */ + toolbarGroups: KnockoutObservableArray; + /** + * For internal use. */ menuVisible: KnockoutObservableBoolean; - /** - * Provide an access to the collection of menu items obtained from the dashboard menu. - * Value: A object that is a collection the dashboard menu items . - */ - menuItems: KnockoutObservableArray; - /** - * Provide an access to the collection of toolbox groups obtained from the Toolbox. - * Value: A object that is a collection the toolbox groups. - */ - toolboxGroups: KnockoutObservableArray; - /** - * Provide an access to the collection of toolbar groups obtained from the Toolbox. - * Value: A object that is a collection the toolbar groups. - */ - toolbarGroups: KnockoutObservableArray; /** * Allows you to add a specified menu item to the dashboard menu. * @param menuItem A DashboardMenuItem object that is a dashboard menu item. @@ -2970,9 +3139,9 @@ interface ToolboxExtension extends IExtension { */ addToolboxItem(groupName: string, toolboxItem: DashboardToolboxItem): void; /** - * Removes the specified toolbox item from the specified toolbox group. - * @param groupName A string value that is a unique toolbox group name. - * @param toolboxItemName A string value that is a unique toolbox item name. + * Removes the specified item from the specified toolbox group. + * @param groupName A string value that is a unique toolbox group name (name). + * @param toolboxItemName A string value that is a unique toolbox item name (name). */ removeToolboxItem(groupName: string, toolboxItemName: string): void; /** @@ -3438,6 +3607,10 @@ interface ASPxClientTextEdit extends ASPxClientEdit { * Fires on the client side when the editor's text is changed and focus moves out of the editor by end-user interactions. */ TextChanged: ASPxClientEvent>; + /** + * Fires on the client side when the editor's input value is changed before the focus moves out of the editor by end-user interactions. + */ + UserInput: ASPxClientEvent>; /** * Returns the text displayed within the editor. */ @@ -4249,7 +4422,7 @@ interface ASPxClientListBox extends ASPxClientListEdit { */ PerformCallback(parameter: string): void; /** - * Adds a new item to the end of the editor's items collection, specifying the item's display text, and returns the index of the added item. + * Adds a new item to the editor, specifying the item's display text, and returns the added item's index. * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. */ AddItem(texts: string[]): number; @@ -5021,6 +5194,11 @@ interface ASPxClientGridBase extends ASPxClientControl { */ interface ASPxClientGridColumnBase { } +/** + * Lists values that specify the document formats available for export from the grid. + */ +interface ASPxClientGridExportFormat { +} /** * A method that will handle the ToolbarItemClick event. */ @@ -5047,8 +5225,8 @@ interface ASPxClientGridToolbarItemClickEventArgs extends ASPxClientProcessingMo */ toolbarName: string; /** - * Gets the clicked toolbar item. - * Value: A ASPxClientMenuItem object that is the toolbar item. + * Gets the clicked menu item + * Value: An ASPxClientMenu value that is the menu item. */ item: ASPxClientMenuItem; /** @@ -5158,7 +5336,11 @@ interface ASPxClientCardView extends ASPxClientGridBase { /** * Fires in response to changing card focus. */ - FocusedCardChanged: ASPxClientEvent>; + FocusedCardChanged: ASPxClientEvent>; + /** + * Fires before a card has been focused. + */ + CardFocusing: ASPxClientEvent>; /** * Occurs when a callback for server-side processing is initiated. */ @@ -5175,6 +5357,21 @@ interface ASPxClientCardView extends ASPxClientGridBase { * Fires after the customization window has been closed. */ CustomizationWindowCloseUp: ASPxClientEvent>; + /** + * Returns the editor used to edit the specified column's values. + * @param column An ASPxClientCardViewColumn object that specifies the required column within the client grid. + */ + GetEditor(column: ASPxClientCardViewColumn): ASPxClientEdit; + /** + * Returns the editor used to edit the specified column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + GetEditor(columnIndex: number): ASPxClientEdit; + /** + * Returns the editor used to edit the specified column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + GetEditor(columnFieldNameOrId: string): ASPxClientEdit; /** * Returns the value of the specified edit cell. * @param column An ASPxClientCardViewColumn object that represents the data column within the client grid. @@ -5255,6 +5452,11 @@ interface ASPxClientCardView extends ASPxClientGridBase { * @param columnIndex A zero-based index that identifies the column in the column collection (the column's Index property value). */ SetFocusedCell(cardVisibleIndex: number, columnIndex: number): void; + /** + * Specifies a custom editor for the search panel on the client side. + * @param editor An ASPxClientEdit object representing a custom editor. + */ + SetSearchPanelCustomEditor(editor: ASPxClientEdit): void; /** * Sorts data by the specified data column's values. * @param column An ASPxClientCardViewColumn object that represents the data column. @@ -5407,7 +5609,7 @@ interface ASPxClientCardView extends ASPxClientGridBase { */ IsNewCardEditing(): boolean; /** - * Adds a new record. + * Adds a new card. */ AddNewCard(): void; /** @@ -5543,6 +5745,11 @@ interface ASPxClientCardView extends ASPxClientGridBase { * @param visibleIndex An integer value that identifies the card by its visible index. */ IsCardSelectedOnPage(visibleIndex: number): boolean; + /** + * Exports a grid data to a file in the specified format. + * @param format An ASPxClientCardViewExportFormat object specifying the export format. + */ + ExportTo(format: ASPxClientCardViewExportFormat): void; /** * Applies the specified search panel filter criterion to grid data. * @param value A string value that specifies the filter criterion. @@ -5682,25 +5889,10 @@ interface ASPxClientCardView extends ASPxClientGridBase { */ GetColumnById(columnId: string): ASPxClientCardViewColumn; /** - * Returns the client column which is bound to the specified data source field. + * Returns the client column to which the specified data source field is bound. * @param columnFieldName A string value that specifies the name of the data source field to which the column is bound (the column's FieldName property value). */ GetColumnByField(columnFieldName: string): ASPxClientCardViewColumn; - /** - * Returns the editor used to edit the specified column's values. - * @param column An ASPxClientCardViewColumn object that specifies the required column within the client grid. - */ - GetEditor(column: ASPxClientCardViewColumn): ASPxClientEdit; - /** - * Returns the editor used to edit the specified column's values. - * @param columnIndex An integer value that specifies the column's position within the column collection. - */ - GetEditor(columnIndex: number): ASPxClientEdit; - /** - * Returns the editor used to edit the specified column's values. - * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). - */ - GetEditor(columnFieldNameOrId: string): ASPxClientEdit; } /** * Represents a client column. @@ -5758,6 +5950,32 @@ interface ASPxClientCardViewColumnCancelEventArgs extends ASPxClientCancelEventA */ column: ASPxClientCardViewColumn; } +/** + * A method that will handle the client CardFocusing event. + */ +interface ASPxClientCardViewCardFocusingEventHandler { + /** + * Represents a method that will handle the CardFocusing event. + * @param source The event source. + * @param e An ASPxClientCardViewCardFocusingEventArgs object which contains event data. + */ + (source: S, e: ASPxClientCardViewCardFocusingEventArgs): void; +} +/** + * Provides data for the CardFocusing event. + */ +interface ASPxClientCardViewCardFocusingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the card visible index. + * Value: An integer value specifying the visible index. + */ + visibleIndex: number; + /** + * Provides access to the parameters associated with the CardFocusing event. + * Value: An object that contains parameters associated with the event. + */ + htmlEvent: Object; +} /** * A method that will handle the CardClick event. */ @@ -5846,6 +6064,27 @@ interface ASPxClientCardViewSelectionEventArgs extends ASPxClientProcessingModeE */ isChangedOnServer: boolean; } +/** + * A method that will handle the client FocusedCardChanged event. + */ +interface ASPxClientCardViewFocusEventHandler { + /** + * Represents a method that will handle the FocusedCardChanged event. + * @param source The event source. + * @param e An ASPxClientCardViewFocusEventArgs object which contains event data. + */ + (source: S, e: ASPxClientCardViewFocusEventArgs): void; +} +/** + * Provides data for the corresponding event. + */ +interface ASPxClientCardViewFocusEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets whether card focusing has been changed on the server. + * Value: true , if the card focusing has been changed on the server; otherwise, false. + */ + isChangedOnServer: boolean; +} /** * A method that will handle the client BatchEditStartEditing event. */ @@ -6143,6 +6382,30 @@ interface ASPxClientCardViewBatchEditApi { * @param visibleIndex An integer value that identifies the card by its visible index. */ IsNewCard(visibleIndex: number): boolean; + /** + * Adds a new card when ASPxCardView is in Batch Edit mode. + */ + AddNewCard(): void; + /** + * Deletes the specified card when ASPxCardView is in Batch Edit mode. + * @param visibleIndex An integer value that identifies the card index. + */ + DeleteCard(visibleIndex: number): void; + /** + * Deletes a card with a specified key value when ASPxCardView is in Batch Edit mode. + * @param key An object that uniquely identifies the card. + */ + DeleteCardByKey(key: Object): void; + /** + * Recovers the specified card when ASPxCardView is in Batch Edit mode. + * @param visibleIndex An integer value that identifies the card index. + */ + RecoverCard(visibleIndex: number): void; + /** + * Recovers a card with a specified key value when ASPxCardView is in Batch Edit mode. + * @param key An object that uniquely identifies the card. + */ + RecoverCardByKey(key: Object): void; /** * Programmatically moves the focus to the previous cell in the card */ @@ -6220,6 +6483,12 @@ interface ASPxClientCardViewBatchEditApi { * Ends cell or card editing. */ EndEdit(): void; + /** + * Provides the text displayed within the cell according to the specified display format rule. + * @param columnFieldNameOrId A string value representing the column's unique identifier or field name. + * @param value An object representing a value. + */ + GetColumnDisplayText(columnFieldNameOrId: string, value: Object): string; } /** * Contains information on a grid cell. @@ -6236,6 +6505,11 @@ interface ASPxClientCardViewCellInfo { */ column: ASPxClientCardViewColumn; } +/** + * Lists values that specify the document formats available for export from the grid. + */ +interface ASPxClientCardViewExportFormat extends ASPxClientGridExportFormat { +} /** * A client-side equivalent of the ASPxGridView object. */ @@ -6260,7 +6534,11 @@ interface ASPxClientGridView extends ASPxClientGridBase { /** * Fires in response to changing row focus. */ - FocusedRowChanged: ASPxClientEvent>; + FocusedRowChanged: ASPxClientEvent>; + /** + * Fires before a row has been focused. + */ + RowFocusing: ASPxClientEvent>; /** * Enables you to cancel data grouping. */ @@ -6369,6 +6647,29 @@ interface ASPxClientGridView extends ASPxClientGridBase { * Fires after the Customization Window has been closed. */ CustomizationWindowCloseUp: ASPxClientEvent>; + /** + * Selects the specified rows within the grid. + * @param visibleIndices An array of zero-based indices that identify data rows within the grid. + */ + SelectRows(visibleIndices: number[]): void; + /** + * Selects or deselects the specified rows within the grid. + * @param visibleIndices An array of zero-based indices that identify data rows within the grid. + * @param selected true to select the specified rows; false to deselect the rows. + */ + SelectRows(visibleIndices: number[], selected: boolean): void; + /** + * Selects or deselects the specified row within the grid. + * @param visibleIndex An integer zero-based index that identifies the data row within the grid. + * @param selected true to select the specified row; false to deselect the row. + */ + SelectRows(visibleIndex: number, selected?: boolean): void; + /** + * Selects or deselects the specified rows displayed within the grid. + * @param keys An array of objects that uniquely identify the rows. + * @param selected true to select the specified rows; false to deselect the rows. + */ + SelectRowsByKey(keys: Object[], selected?: boolean): void; /** * Selects or deselects the specified row displayed within the grid. * @param key An object that uniquely identifies the row. @@ -6498,6 +6799,16 @@ interface ASPxClientGridView extends ASPxClientGridBase { * @param scrollableRowSettings An object specifying which types of grid rows should or should not be scrollable. */ SetFixedColumnScrollableRows(scrollableRowSettings: Object): void; + /** + * Exports a grid data to a file in the specified format. + * @param format An ASPxClientGridViewExportFormat object specifying the export format. + */ + ExportTo(format: ASPxClientGridViewExportFormat): void; + /** + * Returns a value specifying the indices of the rows visible in the browser's view port. + * @param includePartiallyVisible true, to include partially visible rows, otherwise, false. + */ + GetRowIndicesVisibleInViewPort(includePartiallyVisible: boolean): number[]; /** * Applies a filter specified in the filter row to the GridView. */ @@ -6777,6 +7088,11 @@ interface ASPxClientGridView extends ASPxClientGridBase { * @param columnIndex A zero-based index that identifies the column in the column collection (the column's Index property value). */ SetFocusedCell(rowVisibleIndex: number, columnIndex: number): void; + /** + * Specifies a custom editor for the search panel on the client side. + * @param editor An ASPxClientEdit object representing a custom editor. + */ + SetSearchPanelCustomEditor(editor: ASPxClientEdit): void; /** * Invokes the Customization Dialog and displays it over the grid. */ @@ -6996,6 +7312,15 @@ interface ASPxClientGridView extends ASPxClientGridBase { * @param moveFromGroup true, to ungroup the grid's data by the column; otherwise, false. */ MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number, targetPosition: ASPxClientGridColumnMovingTargetPosition, moveToGroup: boolean, moveFromGroup: boolean): void; + /** + * Returns an object specifying the grid column's layout. + */ + GetColumnLayout(): Object; + /** + * Specifies the grid column's layout. + * @param columnLayout An object specifying the grid column's layout. + */ + SetColumnLayout(columnLayout: Object): void; /** * Groups data by the values of the specified column. * @param column An ASPxClientGridViewColumn object that represents the data column by whose values data is grouped. @@ -7184,29 +7509,6 @@ interface ASPxClientGridView extends ASPxClientGridBase { * @param visibleIndex A zero-based integer value that specifies the row's visible index. */ SelectRows(visibleIndex: number): void; - /** - * Selects the specified rows within the grid. - * @param visibleIndices An array of zero-based indices that identify data rows within the grid. - */ - SelectRows(visibleIndices: number[]): void; - /** - * Selects or deselects the specified rows within the grid. - * @param visibleIndices An array of zero-based indices that identify data rows within the grid. - * @param selected true to select the specified rows; false to deselect the rows. - */ - SelectRows(visibleIndices: number[], selected: boolean): void; - /** - * Selects or deselects the specified row within the grid. - * @param visibleIndex An integer zero-based index that identifies the data row within the grid. - * @param selected true to select the specified row; false to deselect the row. - */ - SelectRows(visibleIndex: number, selected?: boolean): void; - /** - * Selects or deselects the specified rows displayed within the grid. - * @param keys An array of objects that uniquely identify the rows. - * @param selected true to select the specified rows; false to deselect the rows. - */ - SelectRowsByKey(keys: Object[], selected?: boolean): void; } /** * A client grid column. @@ -7347,6 +7649,48 @@ interface ASPxClientGridViewSelectionEventArgs extends ASPxClientProcessingModeE */ isChangedOnServer: boolean; } +/** + * A method that will handle the client FocusedRowChanged event. + */ +interface ASPxClientGridViewFocusEventHandler { + /** + * Represents a method that will handle the FocusedRowChanged event. + * @param source The event source. + * @param e An ASPxClientGridViewFocusEventArgs object which contains event data. + */ + (source: S, e: ASPxClientGridViewFocusEventArgs): void; +} +/** + * Provides data for the corresponding event. + */ +interface ASPxClientGridViewFocusEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets whether the row focusing has been changed on the server. + * Value: true , if the row focusing has been changed on the server; otherwise, false. + */ + isChangedOnServer: boolean; +} +/** + * A method that will handle the client RowFocusing event. + */ +interface ASPxClientGridViewRowFocusingEventHandler { + /** + * Represents a method that will handle the RowFocusing event. + * @param source The event source. + * @param e An ASPxClientGridViewRowFocusingEventArgs object which contains event data. + */ + (source: S, e: ASPxClientGridViewRowFocusingEventArgs): void; +} +/** + * Provides data for the RowFocusing event. + */ +interface ASPxClientGridViewRowFocusingEventArgs extends ASPxClientGridViewRowCancelEventArgs { + /** + * Provides access to the parameters associated with the RowFocusing event. + * Value: An object that contains parameters associated with the event. + */ + htmlEvent: Object; +} /** * A method that will handle the RowClick events. */ @@ -7829,6 +8173,30 @@ interface ASPxClientGridViewBatchEditApi { * @param visibleIndex An integer value that identifies the row by its visible index. */ IsNewRow(visibleIndex: number): boolean; + /** + * Adds a new row when ASPxGridView is in Batch Edit mode. + */ + AddNewRow(): void; + /** + * Deletes the specified row when ASPxGridView is in Batch Edit. + * @param visibleIndex An integer value that identifies the row index. + */ + DeleteRow(visibleIndex: number): void; + /** + * Deletes a row with a specified key value when ASPxGridView is in Batch Edit mode. + * @param key An object that uniquely identifies the row. + */ + DeleteRowByKey(key: Object): void; + /** + * Recovers the specified row when ASPxGridView is in Batch Edit mode. + * @param visibleIndex An integer value that identifies the row index. + */ + RecoverRow(visibleIndex: number): void; + /** + * Recovers a row with a specified key value when ASPxGridView is in Batch Edit mode. + * @param key An object that uniquely identifies the row. + */ + RecoverRowByKey(key: Object): void; /** * Programmatically moves the focus to the previous cell in the row. */ @@ -7906,6 +8274,17 @@ interface ASPxClientGridViewBatchEditApi { * Ends cell or row editing. */ EndEdit(): void; + /** + * Provides the text displayed within the cell according to the specified display format rule. + * @param columnFieldNameOrId A string value representing the column's unique identifier or field name. + * @param value An object representing a value. + */ + GetColumnDisplayText(columnFieldNameOrId: string, value: Object): string; +} +/** + * Lists values that specify the document formats available for export from the grid. + */ +interface ASPxClientGridViewExportFormat extends ASPxClientGridExportFormat { } /** * A client-side equivalent of the ASPxVerticalGrid object. @@ -8207,6 +8586,11 @@ interface ASPxClientVerticalGrid extends ASPxClientGridBase { * @param visibleIndex An integer value that identifies the record by its visible index. */ IsRecordSelectedOnPage(visibleIndex: number): boolean; + /** + * Exports a grid data to a file in the specified format. + * @param format An ASPxClientVerticalGridExportFormat object specifying the export format. + */ + ExportTo(format: ASPxClientVerticalGridExportFormat): void; /** * Returns the values of the specified data source fields within the specified record. * @param visibleIndex An integer value that identifies the record. @@ -8221,7 +8605,7 @@ interface ASPxClientVerticalGrid extends ASPxClientGridBase { */ GetPageRecordValues(fieldNames: string, onCallback: ASPxClientVerticalGridValuesCallback): void; /** - * Returns the number of records actually displayed within the active page. + * Returns the number of records actually displayed on the active page. */ GetVisibleRecordsOnPage(): number; /** @@ -8338,6 +8722,11 @@ interface ASPxClientVerticalGrid extends ASPxClientGridBase { * @param isFilterEnabled true to enable the current filter; otherwise, false. */ SetFilterEnabled(isFilterEnabled: boolean): void; + /** + * Specifies a custom editor for the search panel on the client side. + * @param editor An ASPxClientEdit object representing a custom editor. + */ + SetSearchPanelCustomEditor(editor: ASPxClientEdit): void; /** * Returns the client row that resides at the specified position within the row collection. * @param rowIndex A zero-based index that identifies the row within the row collection (the row's Index property value). @@ -8903,6 +9292,30 @@ interface ASPxClientVerticalGridBatchEditApi { * @param visibleIndex An integer value that identifies the record by its visible index. */ IsNewRecord(visibleIndex: number): boolean; + /** + * Adds a new record when ASPxVerticalGrid is in Batch Edit mode. + */ + AddNewRecord(): void; + /** + * Deletes the specified record when ASPxVerticalGrid is in Batch Edit mode. + * @param visibleIndex An integer value that identifies the record index. + */ + DeleteRecord(visibleIndex: number): void; + /** + * Deletes a record with a specified key value when ASPxVerticalGrid is in Batch Edit mode. + * @param key An object that uniquely identifies the record. + */ + DeleteRecordByKey(key: Object): void; + /** + * Recovers the specified record when ASPxVerticalGrid is in Batch Edit mode. + * @param visibleIndex An integer value that identifies the record index. + */ + RecoverRecord(visibleIndex: number): void; + /** + * Recovers a record with a specified key value when ASPxVerticalGrid is in Batch Edit mode. + * @param key An object that uniquely identifies the record. + */ + RecoverRecordByKey(key: Object): void; /** * Programmatically moves the focus to the previous cell in the record. */ @@ -8980,6 +9393,17 @@ interface ASPxClientVerticalGridBatchEditApi { * Ends the cell(s) editing. */ EndEdit(): void; + /** + * Provides the text displayed within the cell according to the specified display format rule. + * @param columnFieldNameOrId A string value representing the row's unique identifier or field name. + * @param value An object representing a value. + */ + GetColumnDisplayText(columnFieldNameOrId: string, value: Object): string; +} +/** + * Lists values that specify the document formats available for export from the grid. + */ +interface ASPxClientVerticalGridExportFormat extends ASPxClientGridExportFormat { } /** * Contains style settings related to media elements in ASPxHtmlEditor. @@ -9886,6 +10310,11 @@ interface ASPxClientHtmlEditor extends ASPxClientControl { * Performs validation of the editor's content. */ Validate(): void; + /** + * Returns a toolbar specified by its name. + * @param name A string value specifying the toolbar name. + */ + GetToolbarByName(name: string): ASPxClientMenu; /** * Set an active tab specified by its name. * @param name A string value that is the name of the tab. @@ -10730,22 +11159,246 @@ interface ASPxClientRichEditHyperlinkClickEventArgs extends ASPxClientEventArgs */ targetUri: string; } +/** + * A method that will handle the KeyDown event. + */ +interface ASPxClientRichEditKeyDownEventHandler { + /** + * A method that will handle the KeyDown event. + * @param source The event source. + * @param e An ASPxClientRichEditKeyDownEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditKeyDownEventArgs): void; +} +/** + * Provides data for the KeyDown event. + */ +interface ASPxClientRichEditKeyDownEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets whether the event is handled manually, so no default processing is required. + * Value: true if the event is handled and no default processing is required; otherwise false. + */ + handled: boolean; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * A method that will handle the KeyUp event. + */ +interface ASPxClientRichEditKeyUpEventHandler { + /** + * A method that will handle the KeyUp event. + * @param source The event source. + * @param e An ASPxClientRichEditKeyUpEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditKeyUpEventArgs): void; +} +/** + * Provides data for the KeyUp event. + */ +interface ASPxClientRichEditKeyUpEventArgs extends ASPxClientEventArgs { + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * A method that will handle the PointerDown event. + */ +interface ASPxClientRichEditPointerDownEventHandler { + /** + * A method that will handle the PointerDown event. + * @param source The event source. + * @param e An ASPxClientRichEditPointerDownEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditPointerDownEventArgs): void; +} +/** + * Provides data for the PointerDown event. + */ +interface ASPxClientRichEditPointerDownEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets whether the event is handled manually, so no default processing is required. + * Value: true if the event is handled and no default processing is required; otherwise false. + */ + handled: boolean; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * A method that will handle the PointerUp event. + */ +interface ASPxClientRichEditPointerUpEventHandler { + /** + * A method that will handle the PointerUp event. + * @param source The event source. + * @param e An ASPxClientRichEditPointerUpEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditPointerUpEventArgs): void; +} +/** + * Provides data for the PointerUp event. + */ +interface ASPxClientRichEditPointerUpEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets whether the event is handled manually, so no default processing is required. + * Value: true if the event is handled and no default processing is required; otherwise false. + */ + handled: boolean; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * A method that will handle the ContentInserted event. + */ +interface ASPxClientRichEditContentInsertedEventHandler { + /** + * A method that will handle the ContentInserted event. + * @param source The event source + * @param e An ASPxClientRichEditContentInsertedEventArgs that contains event data. + */ + (source: S, e: ASPxClientRichEditContentInsertedEventArgs): void; +} +/** + * Provides data for the ContentInserted event. + */ +interface ASPxClientRichEditContentInsertedEventArgs extends ASPxClientEventArgs { + /** + * Gets the active sub-document's identifier. + * Value: An integer value specifying the sub-document's identifier. + */ + subDocumentId: number; + /** + * Gets the text buffer interval related to the inserted content. + * Value: An object that stores the inserted content's length and position. + */ + interval: Interval; +} +/** + * A method that will handle the ContentRemoved event. + */ +interface ASPxClientRichEditContentRemovedEventHandler { + /** + * A method that will handle the ContentRemoved event. + * @param source The event source + * @param e An ASPxClientRichEditContentRemovedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditContentRemovedEventArgs): void; +} +/** + * Provides data for the ContentRemoved event. + */ +interface ASPxClientRichEditContentRemovedEventArgs extends ASPxClientEventArgs { + /** + * Gets the active sub-document's identifier. + * Value: An integer value specifying the sub-document's identifier + */ + subDocumentId: number; + /** + * Gets the text buffer interval related to the removed content. + * Value: An object that stores the removed content's length and position. + */ + interval: Interval; +} +/** + * A method that will handle the CharacterPropertiesChanged event. + */ +interface ASPxClientRichEditCharacterPropertiesChangedEventHandler { + /** + * A method that will handle the CharacterPropertiesChanged event. + * @param source The event source + * @param e An ASPxClientRichEditCharacterPropertiesChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditCharacterPropertiesChangedEventArgs): void; +} +/** + * Provides data for the CharacterPropertiesChanged event. + */ +interface ASPxClientRichEditCharacterPropertiesChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the active sub-document's identifier. + * Value: An integer value specifying the sub-document's identifier. + */ + subDocumentId: number; + /** + * Gets the text buffer interval related to the changed characters. + * Value: An object that stores the changed character length and position. + */ + interval: Interval; +} +/** + * A method that will handle the ParagraphPropertiesChanged event. + */ +interface ASPxClientRichEditParagraphPropertiesChangedEventHandler { + /** + * A method that will handle the ParagraphPropertiesChanged event. + * @param source The event source. + * @param e An ASPxClientRichEditParagraphPropertiesChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditParagraphPropertiesChangedEventArgs): void; +} +/** + * Provides data for the ParagraphPropertiesChanged event. + */ +interface ASPxClientRichEditParagraphPropertiesChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the active sub-document's identifier. + * Value: An integer value specifying the sub-document's identifier + */ + subDocumentId: number; + /** + * Gets the changed paragraph's index. + * Value: An integer value specifying the changed paragraph's identifier. + */ + paragraphIndex: number; +} +/** + * A method that will handle the PopupMenuShowing event. + */ +interface ASPxClientRichEditPopupMenuShowingEventHandler { + /** + * A method that will handle the PopupMenuShowing event. + * @param source The event source. + * @param e An ASPxClientRichEditPopupMenuShowingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditPopupMenuShowingEventArgs): void; +} +/** + * Provides data for the PopupMenuShowing event. + */ +interface ASPxClientRichEditPopupMenuShowingEventArgs extends ASPxClientCancelEventArgs { + /** + * Provides access to a collection of menu items in the context menu being invoked. + * Value: A object representing the context menu's item collection. + */ + menuItems: ASPxClientRichEditPopupMenuItemCollection; +} /** * A client-side equivalent of the ASPxRichEdit object. */ interface ASPxClientRichEdit extends ASPxClientControl { /** * Provides access to document structural elements. - * Value: A object that lists RichEdit's document structural elements. + * Value: A object that lists a RichEdit document's structural elements. */ document: RichEditDocument; /** - * Provides access to RichEdit's client-side commands. - * Value: A object that lists RichEdit's client-side commands. + * Provides access to the RichEdit's client-side commands. + * Value: A object that lists the RichEdit's client-side commands. */ commands: RichEditCommands; /** - * Provides access to the client methods that changes the selection. + * Provides access to the client methods that change the selection. * Value: A object that lists methods to work with the selection. */ selection: RichEditSelection; @@ -10778,18 +11431,70 @@ interface ASPxClientRichEdit extends ASPxClientControl { * Fires on the client if any server error occurs during server-side processing of a callback sent by the RichEdit. */ CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side when a document model is loaded into the control. + */ + DocumentLoaded: ASPxClientEvent>; /** * Fires if any change is made to the RichEdit's document on the client. */ DocumentChanged: ASPxClientEvent>; /** - * Occurs when a hyperlink is clicked within the document. + * Occurs when the active sub-document is substituted with another sub-document. + */ + ActiveSubDocumentChanged: ASPxClientEvent>; + /** + * Occurs when the control receives focus. + */ + GotFocus: ASPxClientEvent>; + /** + * Occurs when the control loses focus. + */ + LostFocus: ASPxClientEvent>; + /** + * Occurs when the mouse pointer is over the RichEdit's document and a mouse button is pressed. + */ + PointerDown: ASPxClientEvent>; + /** + * Occurs when the mouse button is released if it was pressed within the RichEdit's document. + */ + PointerUp: ASPxClientEvent>; + /** + * Occurs when a key is pressed while the ASPxRichEdit's document has focus. + */ + KeyDown: ASPxClientEvent>; + /** + * Occurs when a key is released while the ASPxRichEdit's document has focus. + */ + KeyUp: ASPxClientEvent>; + /** + * Occurs when a pop-up menu is about to be shown. + */ + PopupMenuShowing: ASPxClientEvent>; + /** + * Occurs when a hyperlink is activated within the document. */ HyperlinkClick: ASPxClientEvent>; /** * Occurs when the selection is changed within the document. */ SelectionChanged: ASPxClientEvent>; + /** + * Occurs when content is inserted into the document. + */ + ContentInserted: ASPxClientEvent>; + /** + * Occurs when content is removed from the document + */ + ContentRemoved: ASPxClientEvent>; + /** + * Occurs when the characters' formatting is changed. + */ + CharacterPropertiesChanged: ASPxClientEvent>; + /** + * Occurs when a paragraph's formatting is changed. + */ + ParagraphPropertiesChanged: ASPxClientEvent>; /** * Enables you to switch the full-screen mode of the Rich Text Editor. * @param fullscreen true to activate full-screen mode; false to deactivate full-screen mode. @@ -10823,6 +11528,123 @@ interface ASPxClientRichEdit extends ASPxClientControl { */ ReconnectToExternalRibbon(): void; } +/** + * Represents an individual item of the Rich Edit's context menu. + */ +interface ASPxClientRichEditPopupMenuItem { + /** + * Gets the immediate parent menu item to which the current menu item belongs. + * Value: A ASPxClientRichEditPopupMenuItem object representing the menu item's immediate parent. + */ + parent: ASPxClientRichEditPopupMenuItem; + /** + * Gets or sets the unique identifier name for the current menu item. + * Value: A string value that specifies the item's unique identifier name. + */ + name: string; + /** + * Gets or sets the text content of the current menu item. + * Value: A string value that specifies the text content of the menu item. + */ + text: string; + /** + * Gets or sets a value that indicates whether the menu item is enabled, allowing the item to respond to end-user interactions. + * Value: true if the item is enabled; otherwise, false. + */ + enabled: boolean; + /** + * Gets or sets the CSS class name defining the menu item's image. + * Value: A string value specifying the class name. + */ + imageClassName: string; + /** + * Gets or sets a URL which defines the navigation location. + * Value: A string value which represents a URL where the client web browser will navigate. + */ + navigateUrl: string; + /** + * Gets or sets the URL of the menu item's image. + * Value: A string value that specifies the location of an image. + */ + imageUrl: string; + /** + * Gets or sets a value that specifies whether the current menu item starts a group. + * Value: true if the current menu item starts a group; otherwise, false. + */ + beginGroup: boolean; + /** + * Gets or sets the current menu item's tooltip text. + * Value: A string which specifies the text content of the current menu item's tooltip. + */ + tooltip: string; + /** + * Gets or sets the window or frame at which to target the contents of the URL associated with the current menu item. + * Value: A string which identifies the window or frame at which to target the URL content. + */ + target: string; + /** + * Gets a collection that contains the submenu items of the current menu item. + */ + GetSubItems(): ASPxClientRichEditPopupMenuItemCollection; + /** + * Returns the menu item's sub-item with the specified index. + * @param index An integer value specifying the index of the sub-item within a collection of the current menu item's submenu items. + */ + GetItem(index: number): ASPxClientRichEditPopupMenuItem; + /** + * Returns the menu item's sub-item with the specified name property value. + * @param name A string value specifying the name property value of the sub-item to find. + */ + GetItemByName(name: string): ASPxClientRichEditPopupMenuItem; + /** + * Returns the total number of the menu item's child items (submenu items). + */ + GetItemCount(): number; +} +/** + * Represents a collection of items in the Rich Edit's context menu. + */ +interface ASPxClientRichEditPopupMenuItemCollection { + /** + * Adds the specified menu item to the end of the collection. + * @param item An ASPxClientRichEditPopupMenuItem object specifying the item to be added to the collection. + */ + Add(item: ASPxClientRichEditPopupMenuItem): void; + /** + * Removes a menu item specified by its index within the collection. + * @param index An integer value specifying the index of the menu item to remove. + */ + Remove(index: number): void; + /** + * Removes a menu item specified by its name. + * @param name A string value specifying the name property value of a menu item to remove from the collection. + */ + RemoveByName(name: string): void; + /** + * Adds the specified item to the specified position within the collection. + * @param index An integer value that specifies the zero-based index at which the specified item should be inserted. + * @param item An ASPxClientRichEditPopupMenuItem object to insert. + */ + Insert(index: number, item: ASPxClientRichEditPopupMenuItem): void; + /** + * Returns the total number of menu items in the collection. + */ + GetCount(): number; + /** + * Returns an item object with the specified name property value. + * @param name A string value representing the name property value of the required item. + */ + GetByName(name: string): ASPxClientRichEditPopupMenuItem; + /** + * Returns a menu item specified by its index in the collection. + * @param index An integer value that is the zero-based index of the to retrieve from the ASPxClientRichEditPopupMenuItemCollection. + */ + Get(index: number): ASPxClientRichEditPopupMenuItem; + /** + * Removes all menu items from the collection. + */ + Clear(): void; +} /** * Contains a set of the available client commands. */ @@ -10833,7 +11655,7 @@ interface RichEditCommands { */ fileNew: FileNewCommand; /** - * Gets a command to open the file, specifying its path. + * Gets a command to open a document stored in the specified file. * Value: A object that provides methods for executing the command and checking its state. */ fileOpen: FileOpenCommand; @@ -10843,22 +11665,22 @@ interface RichEditCommands { */ fileOpenDialog: FileOpenDialogCommand; /** - * Gets a command to save the document to a file. + * Gets a command to save the document at its original location on the server. * Value: A object that provides methods for executing the command and checking its state. */ fileSave: FileSaveCommand; /** - * Gets a command to download the document file, specifying its extension. + * Gets a command to download the document specifying the file's extension. * Value: A object that provides methods for executing the command and checking its state. */ fileDownload: FileDownloadCommand; /** - * Gets a command to invoke the Save As dialog that prompts for a file name and saves the current document in a file with the specified path. + * Gets a command to save a document in a file with the specified path. * Value: A object that provides methods for executing the command and checking its state. */ fileSaveAs: FileSaveAsCommand; /** - * Gets a command to open the file's Save As dialog. + * Gets a command to invoke the Save As dialog that prompts for a file name and saves the current document in a file with the specified path. * Value: A object that provides methods for executing the command and checking its state. */ fileSaveAsDialog: FileSaveAsDialogCommand; @@ -10898,17 +11720,17 @@ interface RichEditCommands { */ changeFontName: ChangeFontNameCommand; /** - * Gets a command to change the font size of characters in a selected range. + * Gets a command to change the font size (in points) of characters in a selected range. * Value: A object that provides methods for executing the command and checking its state. */ changeFontSize: ChangeFontSizeCommand; /** - * Gets a command to increase the font size of characters in a selected range to the closest larger predefined value. + * Gets a command to increase the font size of characters in a selected range to the closest larger predefined value (in points). * Value: A object that provides methods for executing the command and checking its state. */ increaseFontSize: IncreaseFontSizeCommand; /** - * Gets a command to decrease the selected range's font size to the closest smaller predefined value. + * Gets a command to decrease the selected range's font size to the closest smaller predefined value (in points). * Value: A object that provides methods for executing the command and checking its state. */ decreaseFontSize: DecreaseFontSizeCommand; @@ -10958,7 +11780,7 @@ interface RichEditCommands { */ changeFontSuperscript: ChangeFontSuperscriptCommand; /** - * Gets a command to change the subscript formatting of characters in the selected range. + * Gets a command to change the subscript formatting of characters in a selected range. * Value: A object that provides methods for executing the command and checking its state. */ changeFontSubscript: ChangeFontSubscriptCommand; @@ -10973,12 +11795,12 @@ interface RichEditCommands { */ changeFontBackColor: ChangeFontBackColorCommand; /** - * Gets a command to reset text and paragraph formatting in the selected range to default. + * Gets a command to reset textual and paragraph formatting in the selected range to default values. * Value: A object that provides methods for executing the command and checking its state. */ clearFormatting: ClearFormattingCommand; /** - * Gets a command to change the selected range's style. + * Gets a command to apply a character or paragraph style settings to text in a selected range. * Value: A object that provides methods for executing the command and checking its state. */ changeStyle: ChangeStyleCommand; @@ -11088,7 +11910,7 @@ interface RichEditCommands { */ openParagraphFormattingDialog: OpenParagraphFormattingDialogCommand; /** - * Gets a command to change the formatting of paragraphs in a selected range. + * Gets a command to apply formatting settings to paragraphs within a selected range. * Value: A object that provides methods for executing the command and checking its state. */ changeParagraphFormatting: ChangeParagraphFormattingCommand; @@ -11103,7 +11925,7 @@ interface RichEditCommands { */ openInsertTableDialog: OpenInsertTableDialogCommand; /** - * Gets a command to insert a rectangle table of a specified size. + * Gets a command to insert a rectangular table of the specified size. * Value: A object that provides methods for executing the command and checking its state. */ insertTable: InsertTableCommand; @@ -11113,7 +11935,7 @@ interface RichEditCommands { */ openInsertPictureDialog: OpenInsertPictureDialogCommand; /** - * Gets a command to insert an inline picture stored by specifed web address. + * Gets a command to insert an inline picture stored by the specified web address. * Value: A object that provides methods for executing the command and checking its state. */ insertPicture: InsertPictureCommand; @@ -11143,7 +11965,7 @@ interface RichEditCommands { */ openInsertHyperlinkDialog: OpenInsertHyperlinkDialogCommand; /** - * Gets a command to insert a hyperlink at the current position in the document. + * Gets a command to insert and update a hyperlink field in place of a selected range. * Value: A object that provides methods for executing the command and checking its state. */ insertHyperlink: InsertHyperlinkCommand; @@ -11158,7 +11980,7 @@ interface RichEditCommands { */ deleteHyperlinks: DeleteHyperlinksCommand; /** - * Gets a command to navigate to the document bookmark or URI (uniform resource identifier) specified for the hyperlink. + * Gets a command to go to a bookmark or URI contained within the selected hyperlink. * Value: A object that provides methods for executing the command and checking its state. */ openHyperlink: OpenHyperlinkCommand; @@ -11168,12 +11990,12 @@ interface RichEditCommands { */ openInsertSymbolDialog: OpenInsertSymbolDialogCommand; /** - * Gets a command to insert a character into a document. + * Gets a command to insert characters into a document instead of a selected range. * Value: A object that provides methods for executing the command and checking its state. */ insertSymbol: InsertSymbolCommand; /** - * Gets a command to change page margin settings. + * Gets a command to apply page margins settings to sections located within a selected range. * Value: A object that provides methods for executing the command and checking its state. */ changePageMargins: ChangePageMarginsCommand; @@ -11183,12 +12005,12 @@ interface RichEditCommands { */ openPageMarginsDialog: OpenPageMarginsDialogCommand; /** - * Gets a command to change the page orientation. + * Gets a command to apply page orientation settings to sections located within a selected range. * Value: A object that provides methods for executing the command and checking its state. */ changePageOrientation: ChangePageOrientationCommand; /** - * Gets a command to define the page size dialog's settings. + * Gets a command to invoke the Page Setup dialog. * Value: A object that provides methods for executing the command and checking its state. */ setPageSizeDialog: SetPageSizeDialogCommand; @@ -11198,12 +12020,12 @@ interface RichEditCommands { */ openPagePaperSizeDialog: OpenPagePaperSizeDialogCommand; /** - * Gets a command to change the page size. + * Gets a command to apply page size settings to sections located within a selected range. * Value: A object that provides methods for executing the command and checking its state. */ changePageSize: ChangePageSizeCommand; /** - * Gets a command to change the number of section columns having the same width. + * Gets a command to change the number of columns having the same width in a section. * Value: A object that provides methods for executing the command and checking its state. */ changeSectionEqualColumnCount: ChangeSectionEqualColumnCountCommand; @@ -11213,7 +12035,7 @@ interface RichEditCommands { */ openSectionColumnsDialog: OpenSectionColumnsDialogCommand; /** - * Gets a command to change the settings of individual section columns. + * Gets a command to apply column layout settings to a section. * Value: A object that provides methods for executing the command and checking its state. */ changeSectionColumns: ChangeSectionColumnsCommand; @@ -11238,7 +12060,7 @@ interface RichEditCommands { */ insertSectionBreakOddPage: InsertSectionBreakOddPageCommand; /** - * Gets a command to set the background color of the page. + * Gets a command to set the background color of all pages contained in the document. * Value: A object that provides methods for executing the command and checking its state. */ changePageColor: ChangePageColorCommand; @@ -11263,12 +12085,12 @@ interface RichEditCommands { */ insertParagraph: InsertParagraphCommand; /** - * Gets a command to insert text at the current position in a document. + * Gets a command to insert text in place of a selected range. * Value: A object that provides methods for executing the command and checking its state. */ insertText: InsertTextCommand; /** - * Gets a command to delete the text in a selected range. + * Gets a command to delete text and in-line objects in a selected range. * Value: A object that provides methods for executing the command and checking its state. */ delete: DeleteCommand; @@ -11283,7 +12105,7 @@ interface RichEditCommands { */ removeNextWord: RemoveNextWordCommand; /** - * Gets a command to move the cursor backwards and erase the character in that space. + * Gets a command to move the cursor backwards and erase characters in a selected range. * Value: A object that provides methods for executing the command and checking its state. */ backspace: BackspaceCommand; @@ -11293,12 +12115,12 @@ interface RichEditCommands { */ insertLineBreak: InsertLineBreakCommand; /** - * Gets a command to scale pictures in a selected range. + * Gets a command to scale a selected in-line picture. * Value: A object that provides methods for executing the command and checking its state. */ changePictureScale: ChangePictureScaleCommand; /** - * Gets a command to increment the left indentation of paragraphs in a selected range. + * Gets a command to increment the left indent of paragraphs in a selected range. * Value: A object that provides methods for executing the command and checking its state. */ incrementParagraphLeftIndent: IncrementParagraphLeftIndentCommand; @@ -11322,13 +12144,18 @@ interface RichEditCommands { * Value: A object that provides methods for executing the command and checking its state. */ insertTab: InsertTabCommand; + /** + * Gets a command to add a non-breaking space in place of a selected range + * Value: A object that provides methods for executing the command and checking its state. + */ + insertNonBreakingSpace: InsertNonBreakingSpaceCommand; /** * Gets a command to invoke the Tabs dialog window. * Value: A object that provides methods for executing the command and checking its state. */ openTabsDialog: OpenTabsDialogCommand; /** - * Gets a command to change the tab stop value of a document or selected paragraphs + * Gets a command to change the default tab stop value of a document and apply custom tab settings to the selected paragraphs. * Value: A object that provides methods for executing the command and checking its state. */ changeTabs: ChangeTabsCommand; @@ -11358,12 +12185,12 @@ interface RichEditCommands { */ decrementNumberingIndent: DecrementNumberingIndentCommand; /** - * Gets a command to create a field with an empty code and populate it with the selection (if it is not collapsed). + * Gets a command to create a field with an empty code and populate it with the characters in the selected range (if it is not collapsed). * Value: A object that provides methods for executing the command and checking its state. */ createField: CreateFieldCommand; /** - * Gets a command to update the field's result. + * Gets a command to update each field's result in the selection. * Value: A object that provides methods for executing the command and checking its state. */ updateField: UpdateFieldCommand; @@ -11388,12 +12215,12 @@ interface RichEditCommands { */ insertNumeration: InsertNumerationCommand; /** - * Gets a command to remove the selected numeration. + * Gets a command to exclude the selected paragraphs from the numbered list. * Value: A object that provides methods for executing the command and checking its state. */ removeNumeration: RemoveNumerationCommand; /** - * Gets a command to update all fields in the selected range. + * Gets a command to update all fields in the document. * Value: A object that provides methods for executing the command and checking its state. */ updateAllFields: UpdateAllFieldsCommand; @@ -11413,12 +12240,12 @@ interface RichEditCommands { */ createPageField: CreatePageFieldCommand; /** - * Gets a command to convert the text of all selected sentences to sentence case. + * Gets a command changing all selected text to the sentence case capitalization. * Value: A object that provides methods for executing the command and checking its state. */ makeTextSentenceCase: MakeTextSentenceCaseCommand; /** - * Gets a command to switch the text case at the current position in the document. + * Gets a command to switch the text capitalization in the selection. * Value: A object that provides methods for executing the command and checking its state. */ switchTextCase: SwitchTextCaseCommand; @@ -11438,7 +12265,7 @@ interface RichEditCommands { */ goToNextDataRecord: GoToNextDataRecordCommand; /** - * Gets a command to navigate to the next data record. + * Gets a command to open the specified data record. * Value: A object that provides methods for executing the command and checking its state. */ goToDataRecord: GoToDataRecordCommand; @@ -11478,12 +12305,12 @@ interface RichEditCommands { */ mailMergeAndSaveAs: MailMergeAndSaveAsCommand; /** - * Gets a command to activate the page header and begin editing. + * Gets a command to create a header sub-document (if it is not yet created) and set it as an active sub-document instead of the main sub-document. * Value: A object that provides methods for executing the command and checking its state. */ insertHeader: InsertHeaderCommand; /** - * Gets a command to activate the page footer and begin editing. + * Gets a command to create a footer sub-document (if it is not yet created) and set it as an active sub-document instead of the main sub-document. * Value: A object that provides methods for executing the command and checking its state. */ insertFooter: InsertFooterCommand; @@ -11493,37 +12320,37 @@ interface RichEditCommands { */ linkHeaderFooterToPrevious: LinkHeaderFooterToPreviousCommand; /** - * Gets a command to navigate to the page footer from the page header in the header/footer editing mode. + * Gets a command to substitute a header sub-document with a footer sub-document of the same page as an active sub-document. * Value: A object that provides methods for executing the command and checking its state. */ goToFooter: GoToFooterCommand; /** - * Gets a command to navigate to the page header from the page footer in the header/footer editing mode. + * Gets a command to substitute a footer sub-document with a header sub-document of the same page as an active sub-document. * Value: A object that provides methods for executing the command and checking its state. */ goToHeader: GoToHeaderCommand; /** - * Gets a command to navigate to the next page header or footer in the header/footer editing mode. + * Gets a command to substitute a current header/footer with a header/footer of the next section as an active sub-document. * Value: A object that provides methods for executing the command and checking its state. */ goToNextHeaderFooter: GoToNextHeaderFooterCommand; /** - * Gets a command to navigate to the previous page header or footer in the header/footer editing mode. + * Gets a command to substitute a current header/footer with a header/footer of the previous section as an active sub-document. * Value: A object that provides methods for executing the command and checking its state. */ goToPreviousHeaderFooter: GoToPreviousHeaderFooterCommand; /** - * Gets a command to change the header/footer edit mode, so it allows creation of a different header or footer for the first page of a document or section. + * Gets a command to enable (or disable if it is enabled) a different page header and footer for the first page of the current section. * Value: A object that provides methods for executing the command and checking its state. */ setDifferentFirstPageHeaderFooter: SetDifferentFirstPageHeaderFooterCommand; /** - * Gets a command to change the header/footer edit mode so it allows creation of a different header or footer for odd and even pages of a document or section. + * Gets a command to enable (or disable if it is enabled) a different page header and footer for odd and even pages of the current section. * Value: A object that provides methods for executing the command and checking its state. */ setDifferentOddAndEvenPagesHeaderFooter: SetDifferentOddAndEvenPagesHeaderFooterCommand; /** - * Gets a command to finish header/footer editing. + * Gets a command to substitute a header/footer sub-document with the main sub-document as an active sub-document. * Value: A object that provides methods for executing the command and checking its state. */ closeHeaderFooter: CloseHeaderFooterCommand; @@ -11553,7 +12380,7 @@ interface RichEditCommands { */ changeTableCellPreferredWidth: ChangeTableCellPreferredWidthCommand; /** - * Gets a command to toggle inside borders for selected cells on/off. + * Gets a command to apply (or cancel) border settings of the inside borders for the selected cells. * Value: A object that provides methods for executing the command and checking its state. */ toggleTableCellInsideBorders: ToggleTableCellInsideBordersCommand; @@ -11708,22 +12535,22 @@ interface RichEditCommands { */ changeTableStyle: ChangeTableStyleCommand; /** - * Gets a command to toggle top borders for selected cells on/off. + * Gets a command to apply (or cancel) border settings of the top border for the selected cells. * Value: A object that provides methods for executing the command and checking its state. */ toggleTableCellTopBorder: ToggleTableCellTopBorderCommand; /** - * Gets a command to toggle right borders for selected cells on/off. + * Gets a command to apply (or cancel) border settings of the right border for the selected cells. * Value: A object that provides methods for executing the command and checking its state. */ toggleTableCellRightBorder: ToggleTableCellRightBorderCommand; /** - * Gets a command to toggle bottom borders for selected cells on/off. + * Gets a command to apply (or cancel) border settings of the bottom border for the selected cells. * Value: A object that provides methods for executing the command and checking its state. */ toggleTableCellBottomBorder: ToggleTableCellBottomBorderCommand; /** - * Gets a command to toggle left borders for selected cells on/off. + * Gets a command to apply (or cancel) border settings of the left border for the selected cells. * Value: A object that provides methods for executing the command and checking its state. */ toggleTableCellLeftBorder: ToggleTableCellLeftBorderCommand; @@ -11733,22 +12560,22 @@ interface RichEditCommands { */ removeTableCellBorders: RemoveTableCellBordersCommand; /** - * Gets a command to toggle all borders for selected cells on/off. + * Gets a command to apply (or cancel) border settings to all borders of the selected cells. * Value: A object that provides methods for executing the command and checking its state. */ toggleTableCellAllBorders: ToggleTableCellAllBordersCommand; /** - * Gets a command to toggle inner horizontal borders for selected cells on/off. + * Gets a command to apply (or cancel) border settings of the inside horizontal borders for the selected cells. * Value: A object that provides methods for executing the command and checking its state. */ toggleTableCellInsideHorizontalBorders: ToggleTableCellInsideHorizontalBordersCommand; /** - * Gets a command to toggle inner vertical borders for selected cells on/off. + * Gets a command to apply (or cancel) border settings of the inside vertical borders for the selected cells. * Value: A object that provides methods for executing the command and checking its state. */ toggleTableCellInsideVerticalBorders: ToggleTableCellInsideVerticalBordersCommand; /** - * Gets a command to toggle outer borders for selected cells on/off. + * Gets a command to apply (or cancel) border settings of the outside borders for the selected cells. * Value: A object that provides methods for executing the command and checking its state. */ toggleTableCellOutsideBorders: ToggleTableCellOutsideBordersCommand; @@ -11758,12 +12585,12 @@ interface RichEditCommands { */ changeTableLook: ChangeTableLookCommand; /** - * Gets a command to change the repository item's table border style. + * Gets a command to apply borders' drawing settings. * Value: A object that provides methods for executing the command and checking its state. */ changeTableBorderRepositoryItem: ChangeTableBorderRepositoryItemCommand; /** - * Gets a command to change cell shading in the selected table elements. + * Gets a command to change cell shading in selected table cells. * Value: A object that provides methods for executing the command and checking its state. */ changeTableCellShading: ChangeTableCellShadingCommand; @@ -11788,17 +12615,17 @@ interface RichEditCommands { */ findAll: FindAllCommand; /** - * Gets a command to hide the results of the search. + * Gets a command to hide the search results. * Value: A object that provides methods for executing the command and checking its state. */ hideFindResults: HideFindResultsCommand; /** - * Gets a command to search for a specific text and replace all matches in the document with the specified string. + * Gets a command to replace all matches of the specified text with new characters. * Value: A object that provides methods for executing the command and checking its state. */ replaceAll: ReplaceAllCommand; /** - * Gets a command to search for a specific text and replace the next match in the document with the specified string. + * Gets a command to find and replace a next match of the specified text after the cursor position with new characters. * Value: A object that provides methods for executing the command and checking its state. */ replaceNext: ReplaceNextCommand; @@ -11853,7 +12680,7 @@ interface RichEditCommands { */ changeFloatingObjectAbsoluteSize: ChangeFloatingObjectAbsoluteSizeCommand; /** - * Gets a command to modify a text box' relative size settings. + * Gets a command to modify a text box's relative size settings. * Value: A object that provides methods for executing the command and checking its state. */ changeTextBoxRelativeSize: ChangeTextBoxRelativeSizeCommand; @@ -11883,11 +12710,20 @@ interface RichEditCommands { */ changeFloatingObjectOutlineWidth: ChangeFloatingObjectOutlineWidthCommand; /** - * Gets a command to modify a text box' content margins. + * Gets a command to modify a text box's content margins. * Value: A object that provides methods for executing the command and checking its state. */ changeTextBoxContentMargins: ChangeTextBoxContentMarginsCommand; + /** + * Gets a command to resize the shape to fit the text in the text box. + * Value: A object that provides methods for executing the command and checking its state. + */ changeTextBoxResizeShapeToFitText: ChangeTextBoxResizeShapeToFitTextCommand; + /** + * Gets a command to add an HTML formatted content in place of a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertHtml: InsertHtmlCommand; } /** * Serves as a base for objects that implement different client command functionalities. @@ -11981,6 +12817,10 @@ interface RichEditDocument { * An abstract numbering list definition that defines the appearance and behavior of numbered paragraphs in a document. */ interface AbstractNumberingList { + /** + * Gets or sets a value indicating whether an abstract numbering list is deleted. + * Value: true, if the abstract numbering list is deleted; otherwise, false. + */ deleted: boolean; } /** @@ -12067,6 +12907,11 @@ interface Field { * Value: true, if the field code is displayed; false, if the field result is displayed. */ showCode: boolean; + /** + * Gets the index of the field + * Value: An integer value specifying the field's index + */ + index: number; } /** * Defines a bookmark in the document. @@ -12468,7 +13313,7 @@ interface SpellingInfo { spellCheckerState: any; /** * Provides access to an array containing misspelled intervals. - * Value: An array of objects. + * Value: An array of MisspelledInterval objects. */ misspelledIntervals: MisspelledInterval[]; } @@ -12635,6 +13480,26 @@ interface SubDocument { * Value: An integer that is the number of character positions in the document. */ length: number; + /** + * Returns a field if its interval includes the specified position. + * @param position An integer value specifying the target field's position. + */ + findFields(position: number): Field[]; + /** + * Returns all fields contained in the specified interval. + * @param interval A text buffer interval that contains the target fields. + */ + findFields(interval: Interval): Field[]; + /** + * Returns a table if its interval includes the specified position. + * @param position An integer value specifying the target table's position. + */ + findTables(position: number): Field[]; + /** + * Returns all tables contained in the specified interval. + * @param interval A text buffer interval that contains the target tables. + */ + findTables(interval: Interval): Field[]; } declare enum SubDocumentType { Main=0, @@ -12656,6 +13521,11 @@ interface Table { * Value: A integer value specifying the character length of the table. */ length: number; + /** + * Gets an index of the table. + * Value: An integer value specifying the table's index. + */ + index: number; /** * Gets the text buffer interval occupied by the current table element. * Value: An object specifying the interval settings. @@ -12809,7 +13679,7 @@ interface DeleteBookmarkCommand extends CommandWithSimpleStateBase { interface GoToBookmarkCommand extends CommandWithSimpleStateBase { /** * Executes the GoToBookmarkCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param name + * @param name A string value specifying the bookmark's name */ execute(name: string): boolean; } @@ -12857,6 +13727,11 @@ interface UpdateFieldCommand extends CommandWithSimpleStateBase { * Executes the UpdateFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. */ execute(): boolean; + /** + * Executes the UpdateFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param callback A callback function that is performed when updating of all fields in the selection is completed. + */ + execute(callback: Function): boolean; } /** * A command to display the selected field's field codes. @@ -12894,6 +13769,11 @@ interface UpdateAllFieldsCommand extends CommandWithSimpleStateBase { * Executes the UpdateAllFieldsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. */ execute(): boolean; + /** + * Executes the UpdateAllFieldsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param callback A callback function that is performed when updating of all fields in the document is completed. + */ + execute(callback: Function): boolean; } /** * A command to insert a DATE field displaying the current date. @@ -12945,6 +13825,10 @@ interface DataRecordOptions { * Value: An integer value specifying the data record index. */ activeRecordIndex: number; + /** + * Gets or sets the count of data source records. + * Value: An integer value specifying the count of data source records. + */ recordCount: number; } /** @@ -13163,7 +14047,7 @@ interface FileSaveCommand extends CommandWithSimpleStateBase { interface FileSaveAsCommand extends CommandWithSimpleStateBase { /** * Executes the FileSaveAsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param path A string value specifying path to the saving file. + * @param path A string value specifying path to the saving file. Note that the path should be relative to the work directory. */ execute(path: string): boolean; /** @@ -13231,15 +14115,15 @@ interface FindAllCommand extends CommandWithSimpleStateBase { * Executes the FindAllCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. * @param text A string value specifying finding text. * @param matchCase true, to perform a case-sensitive search; otherwise, false. - * @param highlightResults true, to highlight result of search; otherwise, false. + * @param highlightResults true, to highlight the search results; otherwise, false. */ execute(text: string, matchCase: boolean, highlightResults: boolean): boolean; /** * Executes the FindAllCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. * @param text A string value specifying text to find. * @param matchCase true, to perform a case-sensitive search; otherwise, false. - * @param highlightResults true, to highlight result of search; otherwise, false. - * @param results An array of Interval objects containing the results of search. + * @param highlightResults true, to highlight the search results; otherwise, false. + * @param results An array of Interval objects containing the search results. */ execute(text: string, matchCase: boolean, highlightResults: boolean, results: Interval[]): boolean; } @@ -13259,7 +14143,7 @@ interface ReplaceAllCommand extends CommandWithSimpleStateBase { /** * Executes the ReplaceAllCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. * @param text A string value specifying a text to replace. - * @param replaceText A string value specifying the replacing text. + * @param replaceText A string value specifying the inserted text. * @param matchCase true, to perform a case-sensitive search; otherwise, false. */ execute(text: string, replaceText: string, matchCase: boolean): boolean; @@ -13270,8 +14154,8 @@ interface ReplaceAllCommand extends CommandWithSimpleStateBase { interface ReplaceNextCommand extends CommandWithSimpleStateBase { /** * Executes the ReplaceNextCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param text A string value specifying text to replace. - * @param replaceText A string value specifying replacing text. + * @param text A string value specifying a text to replace. + * @param replaceText A string value specifying the inserted text. * @param matchCase true, to perform a case-sensitive search; otherwise, false. */ execute(text: string, replaceText: string, matchCase: boolean): boolean; @@ -13325,7 +14209,7 @@ interface ChangeFloatingObjectAlignmentPositionCommand extends CommandBase { interface ChangeFloatingObjectAbsolutePositionCommand extends CommandBase { /** * Executes the ChangeFloatingObjectAbsolutePositionCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param settings A FloatingObjectAbsolutePositionSettings object specifying page margin settings. + * @param settings A FloatingObjectAbsolutePositionSettings object specifying object position settings. */ execute(settings: FloatingObjectAbsolutePositionSettings): boolean; /** @@ -13473,8 +14357,18 @@ interface ChangeTextBoxContentMarginsCommand extends CommandBase { */ getState(): any; } +/** + * A command to resize the shape to fit the text in the text box. + */ interface ChangeTextBoxResizeShapeToFitTextCommand extends CommandBase { + /** + * Executes the ChangeTextBoxResizeShapeToFitTextCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param resizeShapeToFitText true, to resize the shape to fit the text; otherwise, false. + */ execute(resizeShapeToFitText: boolean): boolean; + /** + * Gets information about the command state. + */ getState(): any; } /** @@ -13508,7 +14402,7 @@ interface FloatingObjectAlignmentPositionSettings { interface FloatingObjectAbsolutePositionSettings { /** * Gets or sets a floating object's horizontal position relative to an element specified by the horizontalPositionType property. - * Value: An integer value specifying the position. + * Value: An integer value specifying the position in twips. */ horizontalAbsolutePosition: number; /** @@ -13518,7 +14412,7 @@ interface FloatingObjectAbsolutePositionSettings { horizontalPositionType: any; /** * Gets or sets a floating object's vertical position relative to an element specified by the verticalPositionType property. - * Value: An integer value specifying the position. + * Value: An integer value specifying the position in twips. */ verticalAbsolutePosition: number; /** @@ -13533,7 +14427,7 @@ interface FloatingObjectAbsolutePositionSettings { interface FloatingObjectRelativePositionSettings { /** * Gets or sets the horizontal distance between the edge of a floating object and the element specified by the horizontalRelativePosition property - * Value: An integer value specifying the horizontal position. + * Value: An integer value specifying the horizontal position in twips. */ horizontalRelativePosition: number; /** @@ -13543,7 +14437,7 @@ interface FloatingObjectRelativePositionSettings { horizontalPositionType: any; /** * Gets or sets the horizontal distance between the edge of a floating object and the element specified by the verticalRelativePosition property - * Value: An integer value specifying the vertical position. + * Value: An integer value specifying the vertical position in twips. */ verticalRelativePosition: number; /** @@ -13568,22 +14462,22 @@ interface FloatingObjectTextWrappingSettings { floatingObjectTextWrapSide: any; /** * Gets or sets the left offset of text wrapping. - * Value: An integer value specifying the left offset. + * Value: An integer value specifying the left offset in twips. */ leftDistance: number; /** * Gets or sets the right offset of text wrapping. - * Value: An integer value specifying the right offset. + * Value: An integer value specifying the right offset in twips. */ rightDistance: number; /** * Gets or sets the top offset of text wrapping. - * Value: An integer value specifying the top offset. + * Value: An integer value specifying the top offset in twips. */ topDistance: number; /** * Gets or sets the bottom offset of text wrapping. - * Value: An integer value specifying the bottom offset. + * Value: An integer value specifying the bottom offset in twips. */ bottomDistance: number; } @@ -13593,12 +14487,12 @@ interface FloatingObjectTextWrappingSettings { interface FloatingObjectAbsoluteSizeSettings { /** * Gets or sets a floating object's absolute width. - * Value: An integer value specifying the width. + * Value: An integer value specifying the width in twips. */ absoluteWidth: number; /** * Gets or sets a floating object's absolute height. - * Value: An integer value specifying the height. + * Value: An integer value specifying the height in twips. */ absoluteHeight: number; } @@ -13710,6 +14604,16 @@ interface RedoCommand extends CommandWithSimpleStateBase { */ execute(): boolean; } +/** + * A command to add an HTML formatted content in place of a selected range. + */ +interface InsertHtmlCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertHtmlCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param html A string that specifies the inserted HTML code. + */ + execute(html: string): boolean; +} /** * A command to invoke the Hyperlink dialog. */ @@ -13725,7 +14629,7 @@ interface OpenInsertHyperlinkDialogCommand extends CommandWithSimpleStateBase { interface InsertHyperlinkCommand extends CommandBase { /** * Executes the InsertHyperlinkCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param settings A HyperLinkSettings object specifying hyperlink settings. + * @param settings A HyperlinkSettings object specifying hyperlink settings. */ execute(settings: HyperlinkSettings): boolean; /** @@ -14204,8 +15108,8 @@ interface ChangePictureScaleCommand extends CommandBase { execute(scale: Scale): boolean; /** * Executes the ChangePictureScaleCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param x An interger number specifying width of the picture - * @param y An interger number specifying height of the picture + * @param x An integer number specifying the scaling value for the width of the picture as a percentage. + * @param y An integer number specifying the scaling value for the height of the picture as a percentage. */ execute(x: number, y: number): boolean; /** @@ -14229,7 +15133,7 @@ interface MoveContentCommand extends CommandWithSimpleStateBase { interface CopyContentCommand extends CommandWithSimpleStateBase { /** * Executes the CopyContentCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param position An integer number value specifying position for pasting selected text. + * @param position An integer value specifying a position of the inserted text. */ execute(position: number): boolean; } @@ -14242,6 +15146,15 @@ interface InsertTabCommand extends CommandWithSimpleStateBase { */ execute(): boolean; } +/** + * A command to add a non-breaking space in place of a selected range. + */ +interface InsertNonBreakingSpaceCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertNonBreakingSpaceCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} /** * Defines the scaling settings. */ @@ -14263,10 +15176,10 @@ interface Scale { interface ChangePageMarginsCommand extends CommandBase { /** * Executes the ChangePageMarginsCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param left An integer number specifying left margin of the page. - * @param top An integer number specifying top margin of the page. - * @param right An integer number specifying right margin of the page. - * @param bottom An integer number specifying bottom margin of the page. + * @param left An integer number specifying left margin of the page in twips. + * @param top An integer number specifying top margin of the page in twips. + * @param right An integer number specifying right margin of the page in twips. + * @param bottom An integer number specifying bottom margin of the page in twips. */ execute(left: number, top: number, right: number, bottom: number): boolean; /** @@ -14326,8 +15239,8 @@ interface SetPageSizeDialogCommand extends CommandWithSimpleStateBase { interface ChangePageSizeCommand extends CommandBase { /** * Executes the ChangePageSizeCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param width An integer number specifying width of the page. - * @param height An integer number specifying height of the page. + * @param width An integer number specifying width of the page in twips. + * @param height An integer number specifying height of the page in twips. */ execute(width: number, height: number): boolean; /** @@ -14383,7 +15296,7 @@ interface ChangeSectionColumnsCommand extends CommandBase { interface ChangePageColorCommand extends CommandBase { /** * Executes the ChangePageColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param color A string specifying a background color the page. May be specified as a color name or a hex color value. + * @param color A string specifying a background color of all pages contained in the document. May be specified as a color name or a hex color value. */ execute(color: string): boolean; /** @@ -14497,12 +15410,12 @@ interface CloseHeaderFooterCommand extends CommandWithSimpleStateBase { interface SectionColumn { /** * Gets or sets the width of the section column. - * Value: An integer value specifying the section column width. + * Value: An integer value specifying the section column width in twips. */ width: number; /** * Gets or sets the amount of space between adjacent section columns. - * Value: An integer value specifying the spacing between section columns. + * Value: An integer value specifying the spacing after a column in twips. */ spacing: number; } @@ -14511,12 +15424,12 @@ interface SectionColumn { */ interface Size { /** - * Gets or sets the width value. + * Gets or sets the width value in twips. * Value: An integer value specifying the width. */ width: number; /** - * Gets or sets the height value. + * Gets or sets the height value in twips. * Value: An integer value specifying the height. */ height: number; @@ -14527,22 +15440,22 @@ interface Size { interface Margins { /** * Gets or sets the left margin. - * Value: An integer value specifying the left margin. + * Value: An integer value specifying the left margin in twips. */ left: number; /** * Gets or sets the top margin. - * Value: An integer value specifying the top margin. + * Value: An integer value specifying the top margin in twips. */ top: number; /** * Gets or sets the right margin. - * Value: An integer value specifying the right margin. + * Value: An integer value specifying the right margin in twips. */ right: number; /** * Gets or sets the bottom margin. - * Value: An integer value specifying the bottom margin. + * Value: An integer value specifying the bottom margin in twips. */ bottom: number; } @@ -14829,17 +15742,17 @@ interface ParagraphFormattingSettings { */ outlineLevel: number; /** - * Gets or sets the right indent value for the specified paragraph. + * Gets or sets the right indent value for the specified paragraph (in twips). * Value: An integer value specifying the right indent. */ rightIndent: number; /** - * Gets or sets the spacing before the current paragraph. + * Gets or sets the spacing before each selected paragraph (in twips). * Value: An integer value specifying the spacing before the paragraph. */ spacingBefore: number; /** - * Gets or sets the spacing after the current paragraph. + * Gets or sets the spacing after each selected paragraph (in twips). * Value: An integer value specifying the spacing after the paragraph. */ spacingAfter: number; @@ -14854,7 +15767,7 @@ interface ParagraphFormattingSettings { */ firstLineIndentType: any; /** - * Gets or sets a value specifying the indent of the first line of a paragraph. + * Gets or sets a value specifying the indent of the first line of a paragraph (in twips). * Value: An integer value specifying the indent of the first line. */ firstLineIndent: number; @@ -14874,12 +15787,12 @@ interface ParagraphFormattingSettings { */ pageBreakBefore: boolean; /** - * Gets or sets the left indent for text within a paragraph. + * Gets or sets the left indent for text within a paragraph (in twips). * Value: An integer value specifying the left indent. */ leftIndent: number; /** - * Gets or sets a line spacing value. + * Gets or sets a line spacing value (in twips). * Value: An integer value specifying the line spacing. */ lineSpacing: number; @@ -14914,10 +15827,10 @@ declare enum ParagraphFirstLineIndent { interface AssignShortcutCommand extends CommandWithSimpleStateBase { /** * Executes the AssignShortcutCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param keyCode An integer value specifying the code uniquely identifying the key combination. - * @param callback A callback function to execute on pressing the shortcut. + * @param keyCode A specifically generated code that uniquely identifies the combination of keys specified for a shortcut. This code is specified using the GetShortcutCode method. + * @param callback A callback function to execute when a shortcut is activated. */ - execute(keyCode: number, callback: (arg1: string) => void): boolean; + execute(keyCode: number, callback: Function): boolean; } /** * A command to invoke the Spelling dialog window. @@ -15529,7 +16442,7 @@ interface TableBorderSettings { */ color: string; /** - * Gets or sets the border line width. + * Gets or sets the border line width in twips. * Value: An integer value defining the border line width. */ width: number; @@ -15752,22 +16665,22 @@ interface TableCellFormattingSettings { */ noWrap: boolean; /** - * Gets or sets a table cell's left margin. + * Gets or sets a table cell's left margin in twips. * Value: An integer value specifying the left margin. */ marginLeft: number; /** - * Gets or sets a table cell's right margin. + * Gets or sets a table cell's right margin in twips. * Value: An integer value specifying the right margin. */ marginRight: number; /** - * Gets or sets a table cell's top margin. + * Gets or sets a table cell's top margin in twips. * Value: An integer value specifying the top margin. */ marginTop: number; /** - * Gets or sets a table cell's bottom margin. + * Gets or sets a table cell's bottom margin in twips. * Value: An integer value specifying the bottom margin. */ marginBottom: number; @@ -15798,12 +16711,12 @@ interface TableFormattingSettings { */ alignment: any; /** - * Gets or sets the table's left indent. + * Gets or sets the table's left indent in twips. * Value: An integer value specifying the indent. */ indent: number; /** - * Gets or sets the spacing between table cells. + * Gets or sets the spacing between table cells in twips. * Value: An integer value specifying the spacing. */ spacingBetweenCells: number; @@ -15818,22 +16731,22 @@ interface TableFormattingSettings { */ resizeToFitContent: boolean; /** - * Gets or sets the default left margin for cells in the table. + * Gets or sets the default left margin for cells in the table in twips. * Value: An integer value specifying the margin value. */ defaultCellMarginLeft: number; /** - * Gets or sets the default right margin for cells in the table. + * Gets or sets the default right margin for cells in the table in twips. * Value: An integer value specifying the margin value. */ defaultCellMarginRight: number; /** - * Gets or sets the default top margin for cells in the table. + * Gets or sets the default top margin for cells in the table in twips. * Value: An integer value specifying the margin value. */ defaultCellMarginTop: number; /** - * Gets or sets the default bottom margin for cells in the table. + * Gets or sets the default bottom margin for cells in the table in twips. * Value: An integer value specifying the margin value. */ defaultCellMarginBottom: number; @@ -15843,7 +16756,7 @@ interface TableFormattingSettings { */ interface TableWidthUnit { /** - * Gets or sets the table width value. + * Gets or sets the table width value in twips. * Value: An integer value specifying the table width. */ value: number; @@ -15858,7 +16771,7 @@ interface TableWidthUnit { */ interface TableHeightUnit { /** - * Gets or sets the table height value. + * Gets or sets the table height value in twips. * Value: An integer value specifying the table height. */ value: number; @@ -15907,7 +16820,7 @@ interface ChangeFontNameCommand extends CommandBase { interface ChangeFontSizeCommand extends CommandBase { /** * Executes the ChangeFontSizeCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. - * @param fontSize An integer number specifying the font size. + * @param fontSize An integer number specifying the font size in points. */ execute(fontSize: number): boolean; /** @@ -16161,7 +17074,7 @@ interface FontFormattingSettings { */ fontName: string; /** - * Gets or sets the character(s) font size. + * Gets or sets the character(s) font size (in points). * Value: An integer value specifying the font size. */ size: number; @@ -16197,7 +17110,7 @@ interface FontFormattingSettings { italic: boolean; /** * Gets or sets a value specifying whether the strikeout formatting is applied to a character(s). - * Value: true if the strikeout formatting is applied; otherwise, false. + * Value: true, if the strikeout formatting is applied; otherwise, false. */ strikeout: boolean; /** @@ -16972,7 +17885,7 @@ interface YearlyRecurrenceValuesAccessor extends DefaultRecurrenceRuleValuesAcce GetWeekOfMonth(): ASPxClientWeekOfMonth; } /** - * Provides base functionality for ASPxClientScheduler's forms. + * Provides base functionality for the ASPxClientScheduler's forms. */ interface ASPxClientFormBase { /** @@ -17201,6 +18114,10 @@ interface ASPxClientScheduler extends ASPxClientControl { * Client-side event that fires before an appointment is deleted. */ AppointmentDeleting: ASPxClientEvent>; + /** + * Fires on the client side before the appointment tooltip is shown. + */ + AppointmentToolTipShowing: ASPxClientEvent>; /** * Client-side scripting method that gets the active View. */ @@ -17265,6 +18182,24 @@ interface ASPxClientScheduler extends ASPxClientControl { * Client-side function that returns the time interval, selected in the scheduler. */ GetSelectedInterval(): ASPxClientTimeInterval; + /** + * Selects time cells which encompass the specified time interval on the client side. + * @param interval An ASPxClientTimeInterval object that specifies the time interval to select. + */ + SetSelection(interval: ASPxClientTimeInterval): void; + /** + * Selects time cells which encompass the specified time interval on the client side. + * @param interval An ASPxClientTimeInterval object that specifies the time interval to select. + * @param resourceId An integer value specifying the ID of the resource to which the specified time interval belongs. + */ + SetSelection(interval: ASPxClientTimeInterval, resourceId: string): void; + /** + * Selects time cells which encompass the specified time interval on the client side. + * @param interval An ASPxClientTimeInterval object that specifies the time interval to select. + * @param resourceId An integer value specifying the ID of the resource to which the specified time interval belongs. + * @param scrollToSelection true, to scroll the scheduler's contents to make the selection visible; otherwise, false. + */ + SetSelection(interval: ASPxClientTimeInterval, resourceId: string, scrollToSelection: boolean): void; /** * Client-side function that returns the ResourceId of selected time cell's resource. */ @@ -17292,6 +18227,12 @@ interface ASPxClientScheduler extends ASPxClientControl { * @param aptId An appointment's identifier. */ SelectAppointmentById(aptId: Object): void; + /** + * Selects the appointment with the specified ID. + * @param aptId An integer value specifying the appointment ID. + * @param scrollToSelection true, to scroll to the selected appointment; otherwise, false. + */ + SelectAppointmentById(aptId: Object, scrollToSelection: boolean): void; /** * Enables obtaining appointment property values in a client-side script. Executes the callback command with the AppointmentData identifier. * @param aptId An integer, representing the appointment ID. @@ -17439,6 +18380,42 @@ interface ASPxClientScheduler extends ASPxClientControl { * Client-side scripting method that changes the alert time for the selected reminder to the specified interval. */ ReminderFormSnooze(): void; + /** + * Specifies whether the toolbar is visible. + * @param visible true, to make the toolbar visible; otherwise, false. + */ + SetToolbarVisible(visible: boolean): void; + /** + * Returns a value specifying whether a toolbar is displayed. + */ + GetToolbarVisible(): boolean; + /** + * Specifies whether the Resource Navigator is visible. + * @param visible true, to make the Resource Navigator visible; otherwise, false. + */ + SetResourceNavigatorVisible(visible: boolean): void; + /** + * Returns a value specifying whether the Resource Navigator is displayed. + */ + GetResourceNavigatorVisible(): boolean; + /** + * Returns the value specifying the Scheduler's scrollable area height. + */ + GetScrollAreaHeight(): number; + /** + * Specifies the All-Day Area area height. + * @param height An integer value specifying the all-day area height. + */ + SetAllDayAreaHeight(height: number): void; + /** + * Gets the All-Day Area area height. + */ + GetAllDayAreaHeight(): number; + /** + * Sets the Scheduler's height. + * @param height An integer value specifying the scheduler's height. + */ + SetHeight(height: number): void; } /** * Represents a client-side equivalent of the SchedulerViewType object. @@ -17923,6 +18900,27 @@ interface CellClickEventArgs extends ASPxClientEventArgs { */ resource: string; } +/** + * A method that will handle the client AppointmentToolTipShowing event. + */ +interface ASPxClientAppointmentToolTipShowingEventHandler { + /** + * A method that will handle the corresponding client event. + * @param source The event source. + * @param e An ASPxClientAppointmentToolTipShowingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientAppointmentToolTipShowingEventArgs): void; +} +/** + * Provides data for the AppointmentToolTipShowing event. + */ +interface ASPxClientAppointmentToolTipShowingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the appointment. + * Value: An ASPxClientAppointment object representing the appointment. + */ + appointment: ASPxClientAppointment; +} /** * Contains information about a client tooltip. */ @@ -17968,13 +18966,13 @@ interface ASPxClientToolTipBase { */ CalculatePosition(bounds: Object): ASPxClientPoint; /** - * Displays the Appointment Menu in the position of the tooltip. - * @param eventObject An object containing information about the event on which the menu is displayed. + * Displays the Appointment Menu at the position of the tooltip. + * @param eventObject An object containing information about the event in which the menu is displayed. */ ShowAppointmentMenu(eventObject: Object): void; /** - * Displays the View Menu in the position of the tooltip. - * @param eventObject An object containing information about the event on which the menu is displayed. + * Displays the View Menu at the position of the tooltip. + * @param eventObject An object containing information about the event in which the menu is displayed. */ ShowViewMenu(eventObject: Object): void; /** @@ -18579,6 +19577,20 @@ interface ASPxClientTreeList extends ASPxClientControl { * Occurs after a column's width has been changed by an end-user. */ ColumnResized: ASPxClientEvent>; + /** + * Hides the Filter Control. + */ + CloseFilterControl(): void; + /** + * Enables or disables the current filter. + * @param isFilterEnabled true to enable the current filter; otherwise, false. + */ + SetFilterEnabled(isFilterEnabled: boolean): void; + /** + * Specifies a custom editor for the search panel on the client side. + * @param editor An ASPxClientEdit object representing a custom editor. + */ + SetSearchPanelCustomEditor(editor: ASPxClientEdit): void; /** * Sets input focus to the ASPxTreeList. */ @@ -18973,6 +19985,66 @@ interface ASPxClientTreeList extends ASPxClientControl { * @param position An integer value specifying the horizontal scroll position. */ SetHorizontalScrollPosition(position: number): void; + /** + * Exports tree list data to a file in the specified format. + * @param format An ASPxClientTreeListExportFormat object specifying the export format. + */ + ExportTo(format: ASPxClientTreeListExportFormat): void; + /** + * Applies the specified filter expression to the tree list. + * @param filterExpression A string value that specifies the filter expression. + */ + ApplyFilter(filterExpression: string): void; + /** + * Clears the filter expression applied to a client Tree List. + */ + ClearFilter(): void; + /** + * Applies a filter specified in the filter row to the ASPxTreeList. + */ + ApplyOnClickRowFilter(): void; + /** + * Applies the specified search panel filter criterion to tree list data. + * @param value A string value that specifies the filter criterion. + */ + ApplySearchPanelFilter(value: string): void; + /** + * Returns the editor used to edit the value in the auto filter row for the specified data column. + * @param column An ASPxClientTreeListColumn object that represents the data column within the ASPxTreeList. + */ + GetAutoFilterEditor(column: ASPxClientTreeListColumn): Object; + /** + * Returns the editor used to edit the value in the auto filter row for the specified data column. + * @param columnIndex An integer value that identifies the data column by its index. + */ + GetAutoFilterEditor(columnIndex: number): Object; + /** + * Returns the editor used to edit the value in the auto filter row for the specified data column. + * @param columnFieldNameOrId A string value that specifies the column's name or its data base field name. + */ + GetAutoFilterEditor(columnFieldNameOrId: string): Object; + /** + * Applies a filter to the specified data column. + * @param column An ASPxClientTreeListColumn object that represents the data column within the client Tree List. + * @param val A string value that specifies the filter expression. + */ + AutoFilterByColumn(column: ASPxClientTreeListColumn, val: string): void; + /** + * Applies a filter to the specified data column. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param val A string value that specifies the filter expression. + */ + AutoFilterByColumn(columnIndex: number, val: string): void; + /** + * Applies a filter to the specified data column. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param val A string value that specifies the filter expression. + */ + AutoFilterByColumn(columnFieldNameOrId: string, val: string): void; + /** + * Displays the Filter Control. + */ + ShowFilterControl(): void; } /** * Represents a client column. @@ -18994,6 +20066,11 @@ interface ASPxClientTreeListColumn { */ fieldName: string; } +/** + * Lists values that specify the document formats available for export from the tree list. + */ +interface ASPxClientTreeListExportFormat { +} /** * Provides data for the CustomDataCallback event. */ @@ -19227,8 +20304,8 @@ interface ASPxClientTreeListToolbarItemClickEventArgs extends ASPxClientProcessi */ toolbarName: string; /** - * Gets the toolbar item related to the event. - * Value: An ASPxClientMenuItem object that is the toolbar item. + * Gets the clicked menu item + * Value: An ASPxClientMenu value that is the menu item. */ item: ASPxClientMenuItem; /** @@ -19252,7 +20329,241 @@ interface ASPxClientTreeListToolbarItemClickEventHandler { * Represents a client-side equivalent of the BootstrapAccordion control. */ interface BootstrapClientAccordion extends ASPxClientNavBar { + /** + * Returns a group specified by its index. + * @param index An integer value specifying the zero-based index of the group object to retrieve. + */ + GetGroup(index: number): BootstrapClientAccordionGroup; + /** + * Returns a group specified by its name. + * @param name A string value specifying the name of the group. + */ + GetGroupByName(name: string): BootstrapClientAccordionGroup; + /** + * Returns the Accordion control's active group. + */ + GetActiveGroup(): BootstrapClientAccordionGroup; + /** + * Makes the specified group active. + * @param group A BootstrapClientAccordionGroup object that specifies the active group. + */ + SetActiveGroup(group: BootstrapClientAccordionGroup): void; + /** + * Returns an item specified by its name. + * @param name A string value specifying the name of the item. + */ + GetItemByName(name: string): BootstrapClientAccordionItem; + /** + * Returns the selected item within the Accordion control. + */ + GetSelectedItem(): BootstrapClientAccordionItem; + /** + * Selects the specified item within the Accordion control on the client side. + * @param item A BootstrapClientAccordionItem object specifying the item to select. + */ + SetSelectedItem(item: BootstrapClientAccordionItem): void; + /** + * Makes the specified group active. + * @param group A ASPxClientNavBarGroup object that specifies the active group. + */ + SetActiveGroup(group: ASPxClientNavBarGroup): void; + /** + * Selects the specified item within the navbar control on the client side. + * @param item An ASPxClientNavBarItem object specifying the item to select. + */ + SetSelectedItem(item: ASPxClientNavBarItem): void; } +/** + * Represents a client-side equivalent of the Accordion's BootstrapAccordionGroup object. + */ +interface BootstrapClientAccordionGroup extends ASPxClientNavBarGroup { + /** + * Gets the BootstrapClientAccordion object to which the current group belongs. + * Value: A object that is the group's owner. + */ + navBar: BootstrapClientAccordion; + /** + * Returns the group's item specified by its index. + * @param index An integer value specifying the zero-based index of the item to be retrieved. + */ + GetItem(index: number): BootstrapClientAccordionItem; + /** + * Returns a group item specified by its name. + * @param name A string value specifying the name of the item. + */ + GetItemByName(name: string): BootstrapClientAccordionItem; + /** + * Gets the text displayed within an accordion group header badge. + */ + GetHeaderBadgeText(): string; + /** + * Sets the text displayed within an accordion group header badge. + * @param text A String specifying the badge text. + */ + SetHeaderBadgeText(text: string): void; + /** + * Gets the CSS class of the icon displayed within an accordion group header badge. + */ + GetHeaderBadgeIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed within an accordion group header badge. + * @param cssClass A String containing the name of a CSS class. + */ + SetHeaderBadgeIconCssClass(cssClass: string): void; +} +/** + * Represents a client-side equivalent of the Accordion's BootstrapAccordionItem object. + */ +interface BootstrapClientAccordionItem extends ASPxClientNavBarItem { + /** + * Gets the BootstrapClientAccordion object to which the current item belongs. + * Value: A object that is the item's owner. + */ + navBar: BootstrapClientAccordion; + /** + * Gets the group to which the current item belongs. + * Value: A object representing the group to which the item belongs. + */ + group: BootstrapClientAccordionGroup; + /** + * Gets the text displayed within the accordion item badge. + */ + GetBadgeText(): string; + /** + * Sets the text displayed within the accordion item badge. + * @param text A String specifying the badge text. + */ + SetBadgeText(text: string): void; + /** + * Gets the CSS class of the icon displayed within the accordion item badge. + */ + GetBadgeIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed within the accordion item badge. + * @param cssClass A string containing the name of a CSS class. + */ + SetBadgeIconCssClass(cssClass: string): void; + /** + * Specifies the URL which points to the image displayed within the item. + */ + GetImageUrl(): string; + /** + * Specifies the URL which points to the image displayed within the item. + * @param value + */ + SetImageUrl(value: string): void; + /** + * Gets the CSS class of the icon displayed by the Accordion item. + */ + GetIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed by the Accordion item. + * @param cssClass A string containing the name of a CSS class. + */ + SetIconCssClass(cssClass: string): void; +} +/** + * A method that will handle the Accordion control's client events concerning manipulations with an item. + */ +interface BootstrapClientAccordionItemEventHandler { + /** + * A method that will handle the Accordion control's client events concerning manipulations with an item. + * @param source An object representing the event source. Identifies the BootstrapClientAccordion control that raised the event. + * @param e An BootstrapClientAccordionItemEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientAccordionItemEventArgs): void; +} +/** + * Provides data for events related to manipulations on items. + */ +interface BootstrapClientAccordionItemEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the item object related to the event. + * Value: A BootstrapClientAccordionItem object, manipulations on which forced the event to be raised. + */ + item: BootstrapClientAccordionItem; + /** + * Gets an HTML object that contains the processed Accordion item. + * Value: An HTML object. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: A DHTML event object. + */ + htmlEvent: Object; +} +/** + * A method that will handle the Accordion control's client events concerning manipulations with a group. + */ +interface BootstrapClientAccordionGroupEventHandler { + /** + * A method that will handle the Accordion control's client events concerning manipulations with a group. + * @param source An object representing the event source. Identifies the BootstrapClientAccordion control that raised the event. + * @param e An BootstrapClientAccordionGroupEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientAccordionGroupEventArgs): void; +} +/** + * Provides data for events related to manipulations on groups. + */ +interface BootstrapClientAccordionGroupEventArgs extends ASPxClientEventArgs { + /** + * Gets the group object related to the event. + * Value: A BootstrapClientAccordionGroup object, manipulations on which forced the event to be raised. + */ + group: BootstrapClientAccordionGroup; +} +/** + * A method that will handle the Accordion control's cancelable client events concerning manipulations with a group. + */ +interface BootstrapClientAccordionGroupCancelEventHandler { + /** + * A method that will handle the Accordion control's cancelable client events concerning manipulations with a group. + * @param source An object representing the event source. Identifies the BootstrapClientAccordion control that raised the event. + * @param e An BootstrapClientAccordionGroupCancelEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientAccordionGroupCancelEventArgs): void; +} +/** + * Provides data for events related to manipulations on accordion groups. + */ +interface BootstrapClientAccordionGroupCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets the group object related to the event. + * Value: A BootstrapClientAccordionGroup object, manipulations on which forced the event to be raised. + */ + group: BootstrapClientAccordionGroup; +} +/** + * A method that will handle the Accordion control's client events concerning clicks on groups. + */ +interface BootstrapClientAccordionGroupClickEventHandler { + /** + * A method that will handle the Accordion control's client events concerning clicks on groups. + * @param source An object representing the event source. Identifies the BootstrapClientAccordion control that raised the event. + * @param e An BootstrapClientAccordionGroupClickEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientAccordionGroupClickEventArgs): void; +} +/** + * Provides data for events related to clicking on the control's group headers. + */ +interface BootstrapClientAccordionGroupClickEventArgs extends BootstrapClientAccordionGroupCancelEventArgs { + /** + * Gets an HTML object that contains the processed Accordion group. + * Value: An HTML object. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: A DHTML event object. + */ + htmlEvent: Object; +} +/** + * Represents the client-side equivalent of the BootstrapBinaryImage control. + */ interface BootstrapClientBinaryImage extends ASPxClientHyperLink { } /** @@ -19268,6 +20579,24 @@ interface BootstrapClientButton extends ASPxClientButton { * @param value A string value specifying the text to be displayed within the button. */ SetText(value: string): void; + /** + * Gets the text displayed within the button badge. + */ + GetBadgeText(): string; + /** + * Sets the text displayed within the button badge. + * @param text A String specifying the badge text. + */ + SetBadgeText(text: string): void; + /** + * Gets the CSS class of the icon displayed within the button badge. + */ + GetBadgeIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed within the button badge. + * @param cssClass A string containing the name of a CSS class. + */ + SetBadgeIconCssClass(cssClass: string): void; } /** * Represents a client-side equivalent of the BootstrapCalendar control. @@ -19320,92 +20649,12 @@ interface BootstrapClientCallbackPanel extends ASPxClientControl { */ GetEnabled(): boolean; } -/** - * Serves as the base type for the BootstrapClientPieChart objects. - */ -interface BootstrapClientChartBase extends ASPxClientControl { - Done: ASPxClientEvent>; - LegendClick: ASPxClientEvent>; - PointClick: ASPxClientEvent>; - PointHoverChanged: ASPxClientEvent>; - PointSelectionChanged: ASPxClientEvent>; - TooltipHidden: ASPxClientEvent>; - TooltipShown: ASPxClientEvent>; - ArgumentAxisClick: ASPxClientEvent>; - SeriesClick: ASPxClientEvent>; - SeriesHoverChanged: ASPxClientEvent>; - SeriesSelectionChanged: ASPxClientEvent>; -} -/** - * Represents a client-side equivalent of the BootstrapChart control. - */ -interface BootstrapClientChart extends BootstrapClientChartBase { - ZoomStart: ASPxClientEvent>; - ZoomEnd: ASPxClientEvent>; -} -/** - * Represents a client-side equivalent of the BootstrapPolarChart control. - */ -interface BootstrapClientPolarChart extends BootstrapClientChartBase { -} -/** - * Represents a client-side equivalent of the BootstrapPieChart control. - */ -interface BootstrapClientPieChart extends BootstrapClientChartBase { -} -interface BootstrapClientChartBaseDoneEventHandler { - (source: S, e: BootstrapUIWidgetEventArgsBase): void; -} -interface BootstrapClientChartBaseLegendClickEventHandler { - (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; -} -interface BootstrapClientCoordinateSystemChartArgumentAxisClickEventHandler { - (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; -} -interface BootstrapClientChartBasePointClickEventHandler { - (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; -} -interface BootstrapClientChartBasePointHoverChangedEventHandler { - (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; -} -interface BootstrapClientChartBasePointSelectionChangedEventHandler { - (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; -} -interface BootstrapClientChartBaseTooltipHiddenEventHandler { - (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; -} -interface BootstrapClientChartBaseTooltipShownEventHandler { - (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; -} -interface BootstrapClientCoordinateSystemChartSeriesClickEventHandler { - (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; -} -interface BootstrapClientCoordinateSystemChartSeriesHoverChangedEventHandler { - (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; -} -interface BootstrapClientCoordinateSystemChartSeriesSelectionChangedEventHandler { - (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; -} -interface BootstrapClientChartZoomStartEventHandler { - (source: S, e: BootstrapUIWidgetEventArgsBase): void; -} -interface BootstrapClientChartZoomEndEventHandler { - (source: S, e: BootstrapClientChartZoomEndEventArgs): void; -} -interface BootstrapUIWidgetEventArgsBase extends ASPxClientEventArgs { - component: Object; - element: Object; -} -interface BootstrapClientChartZoomEndEventArgs extends BootstrapUIWidgetEventArgsBase { - rangeStart: Object; - rangeEnd: Object; -} /** * Represents a client-side equivalent of the BootstrapCheckBox control. */ interface BootstrapClientCheckBox extends ASPxClientEdit { /** - * Occurs on the client side when the editor's checked state is changed. + * Occurs on the client side when the editor's checked state has been changed. */ CheckedChanged: ASPxClientEvent>; /** @@ -19414,7 +20663,7 @@ interface BootstrapClientCheckBox extends ASPxClientEdit { GetChecked(): boolean; /** * Sets a value which specifies the checked status of the check box editor. - * @param isChecked + * @param isChecked true if the check box editor is checked; otherwise, false. */ SetChecked(isChecked: boolean): void; /** @@ -19427,12 +20676,12 @@ interface BootstrapClientCheckBox extends ASPxClientEdit { GetCheckState(): string; /** * Sets a value specifying the state of a check box. - * @param checkState + * @param checkState A string value matches one of the CheckState enumeration values. */ SetCheckState(checkState: string): void; /** * Sets the text to be displayed within the editor. - * @param text + * @param text A string value specifying the text to be displayed within the editor. */ SetText(text: string): void; } @@ -19450,103 +20699,125 @@ interface BootstrapClientComboBox extends ASPxClientComboBox { */ GetSelectedItem(): BootstrapClientListBoxItem; /** - * Sets the combo box editor's selected item. - * @param item + * Sets the list editor's selected item. + * @param item A BootstrapClientListBoxItem object that specifies the item to select. */ SetSelectedItem(item: BootstrapClientListBoxItem): void; /** * Returns an item specified by its index within the combo box editor's item collection. - * @param index + * @param index An integer value specifying the zero-based index of the item to search for. */ GetItem(index: number): BootstrapClientListBoxItem; /** * Returns a combo box item by its text. - * @param text + * @param text A string that specifies the item's text. */ FindItemByText(text: string): BootstrapClientListBoxItem; /** * Returns a combo box item by its value. - * @param value + * @param value An object that specifies the item's value. */ FindItemByValue(value: Object): BootstrapClientListBoxItem; /** - * Adds a new item to the editor, specifying the item's display text, and returns the index of the added item. + * Adds a new item to the end of the editor's items collection, specifying the item's display text, and returns the index of the added item. * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. */ AddItem(texts: string[]): number; /** * Adds a new item to the end of the control's items collection. - * @param texts - * @param value + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. + * @param value An object that represents the item's associated value. */ AddItem(texts: string[], value: Object): number; /** * Adds a new item to the end of the control's items collection. - * @param texts - * @param value - * @param iconCssClass + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. + * @param value An object that represents the item's associated value. + * @param iconCssClass A String value specifying the CSS class of the image displayed by the list item. */ AddItem(texts: string[], value: Object, iconCssClass: string): number; /** - * Adds a new item to the editor specifying the item's display text and returns the index of the added item. - * @param text + * Adds a new item to the editor, specifying the item's display text, and returns the index of the added item. + * @param text A string value specifying the item's display text. */ AddItem(text: string): number; /** - * Adds a new item to the editor specifying the item's display text and associated value, and returns the index of the added item. - * @param text - * @param value + * Adds a new item to the editor, specifying the item's display text and associated value, and returns the index of the added item. + * @param text A string value specifying the item's display text. + * @param value An object that represents the item's associated value. */ AddItem(text: string, value: Object): number; /** - * Adds a new item to the editor specifying the item's display text, associated value and displayed image, and returns the index of the added item. - * @param text - * @param value - * @param iconCssClass + * Adds a new item to the editor, specifying the item's display text, associated value and displayed image, and returns the index of the added item. + * @param text A string value specifying the item's display text. + * @param value An object that represents the item's associated value. + * @param iconCssClass A String value specifying the CSS class of the image displayed by the list item. */ AddItem(text: string, value: Object, iconCssClass: string): number; /** - * Adds a new item to the control's items collection at the specified index. - * @param index - * @param texts - * @param value - * @param iconCssClass + * Inserts a new item into the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding field within the editor's Fields collection. + * @param value An object that represents the item's associated value. + * @param iconCssClass A String value specifying the CSS class of the image displayed by the list item. */ InsertItem(index: number, texts: string[], value: Object, iconCssClass: string): void; /** - * Adds a new item to the control's items collection at the specified index. - * @param index - * @param texts - * @param value + * Inserts a new item into the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. + * @param value An object that represents the item's associated value. */ InsertItem(index: number, texts: string[], value: Object): void; /** - * Adds a new item to the control's items collection at the specified index. - * @param index - * @param texts + * Inserts a new item into the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. */ InsertItem(index: number, texts: string[]): void; /** - * Adds a new item to the control's items collection at the specified index. - * @param index - * @param text - * @param value - * @param iconCssClass + * Inserts a new item specified by its display text, associated value and displayed image into the editor's item collection, at the position specified. + * @param index An integer value that represents the index position. + * @param text A string value specifying the item's display text. + * @param value An object that represents the item's associated value. + * @param iconCssClass A String value specifying the CSS class of the image displayed by the list item. */ InsertItem(index: number, text: string, value: Object, iconCssClass: string): void; /** - * Inserts a new item specified by its display text and associated value into the editor's item collection, at the position specified. - * @param index - * @param text - * @param value + * Inserts a new item specified by its display text, associated value and displayed image into the editor's item collection, at the position specified. + * @param index An integer value that represents the index position. + * @param text A string value specifying the item's display text. + * @param value An object that represents the item's associated value. */ InsertItem(index: number, text: string, value: Object): void; /** - * Inserts a new item specified by its display text into the editor's item collection, at the position specified. - * @param index - * @param text + * Inserts a new item into the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param text A string value specifying the item's display text. */ InsertItem(index: number, text: string): void; + /** + * Gets the text displayed within a Combo Box item badge. + * @param index The index of a Combo Box item. + */ + GetItemBadgeText(index: number): string; + /** + * Sets the text displayed within a Combo Box item badge. + * @param index The index of a Combo Box item. + * @param text A String specifying the badge text. + */ + SetItemBadgeText(index: number, text: string): void; + /** + * Gets the CSS class of the icon displayed within a Combo Box item badge. + * @param index The index of a Combo Box item. + */ + GetItemBadgeIconCssClass(index: number): string; + /** + * Sets the CSS class of the icon displayed within a Combo Box item badge. + * @param index The index of a Combo Box item. + * @param cssClass A String containing the name of a CSS class. + */ + SetItemBadgeIconCssClass(index: number, cssClass: string): void; /** * Sets the list editor's selected item. * @param item An ASPxClientListEditItem object that specifies the item to select. @@ -19572,7 +20843,28 @@ interface BootstrapClientFormLayout extends ASPxClientFormLayout { * Represents a client-side equivalent of the BootstrapHyperLink control. */ interface BootstrapClientHyperLink extends ASPxClientHyperLink { + /** + * Gets the text displayed within the hyperlink badge. + */ + GetBadgeText(): string; + /** + * Sets the text displayed within the hyperlink badge. + * @param text A String specifying the badge text. + */ + SetBadgeText(text: string): void; + /** + * Gets the CSS class of the icon displayed within the hyperlink badge. + */ + GetBadgeIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed within the hyperlink badge. + * @param cssClass A string containing the name of a CSS class. + */ + SetBadgeIconCssClass(cssClass: string): void; } +/** + * Represents the client-side equivalent of the BootstrapImage control. + */ interface BootstrapClientImage extends ASPxClientImage { } /** @@ -19583,6 +20875,10 @@ interface BootstrapClientListBoxItem extends ASPxClientListEditItem { * This member is not in effect for this class. It is overridden only for the purpose of preventing it from appearing in Microsoft Visual Studio designer tools. */ imageUrl: string; + /** + * Gets the CSS class of the icon displayed by the list box item. + * Value: A string containing the name of a CSS class. + */ iconCssClass: string; /** * @@ -19595,13 +20891,13 @@ interface BootstrapClientListBoxItem extends ASPxClientListEditItem { */ GetColumnText(columnName: string): string; /** - * - * @param fieldIndex + * Returns the list item's text value that corresponds to a data field specified by its index. + * @param fieldIndex An integer value that specifies the field's index within the editor's Fields collection. */ GetFieldText(fieldIndex: number): string; /** - * - * @param fieldName + * Returns the list item's text value that corresponds to a data field specified by its name. + * @param fieldName A string value that specifies the data field's name defined via a FieldName property. */ GetFieldText(fieldName: string): string; } @@ -19610,17 +20906,17 @@ interface BootstrapClientListBoxItem extends ASPxClientListEditItem { */ interface BootstrapClientListBox extends ASPxClientListBox { /** - * Returns the list box editor's selected item. + * Returns the list editor's selected item. */ GetSelectedItem(): BootstrapClientListBoxItem; /** - * Sets the list box editor's selected item. - * @param item + * Sets the list editor's selected item. + * @param item A BootstrapClientListBoxItem object that specifies the item to select. */ SetSelectedItem(item: BootstrapClientListBoxItem): void; /** * Returns an item specified by its index within the list box editor's item collection. - * @param index + * @param index An integer value specifying the zero-based index of the item to search for. */ GetItem(index: number): BootstrapClientListBoxItem; /** @@ -19629,102 +20925,124 @@ interface BootstrapClientListBox extends ASPxClientListBox { GetSelectedItems(): BootstrapClientListBoxItem[]; /** * Selects the specified items within a list box. - * @param items + * @param items An array of BootstrapClientListBoxItem objects that represent the items. */ SelectItems(items: BootstrapClientListBoxItem[]): void; /** * Unselects an array of the specified list box items. - * @param items + * @param items An array of BootstrapClientListBoxItem objects that represent the items. */ UnselectItems(items: BootstrapClientListBoxItem[]): void; /** * Returns a list box item by its text. - * @param text + * @param text A string that specifies the item's text. */ FindItemByText(text: string): BootstrapClientListBoxItem; /** * Returns a list box item by its value. - * @param value + * @param value An object that specifies the item's value. */ FindItemByValue(value: Object): BootstrapClientListBoxItem; /** * Adds a new item to the end of the editor's items collection, specifying the item's display text, and returns the index of the added item. - * @param texts + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. */ AddItem(texts: string[]): number; /** * Adds a new item to the end of the control's items collection. - * @param texts - * @param value + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. + * @param value An object that represents the item's associated value. */ AddItem(texts: string[], value: Object): number; /** * Adds a new item to the end of the control's items collection. - * @param texts - * @param value - * @param iconCssClass + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. + * @param value An object that represents the item's associated value. + * @param iconCssClass A String value specifying the CSS class of the image displayed by the list item. */ AddItem(texts: string[], value: Object, iconCssClass: string): number; /** * Adds a new item to the editor, specifying the item's display text, and returns the index of the added item. - * @param text + * @param text A string value specifying the item's display text. */ AddItem(text: string): number; /** * Adds a new item to the editor, specifying the item's display text and associated value, and returns the index of the added item. - * @param text - * @param value + * @param text A string value specifying the item's display text. + * @param value An object that represents the item's associated value. */ AddItem(text: string, value: Object): number; /** * Adds a new item to the editor, specifying the item's display text, associated value and displayed image, and returns the index of the added item. - * @param text - * @param value - * @param iconCssClass + * @param text A string value specifying the item's display text. + * @param value An object that represents the item's associated value. + * @param iconCssClass A String value specifying the CSS class of the image displayed by the list item. */ AddItem(text: string, value: Object, iconCssClass: string): number; /** - * Adds a new item to the control's items collection at the specified index. - * @param index - * @param texts - * @param value - * @param iconCssClass + * Inserts a new item into the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding field within the editor's Fields collection. + * @param value An object that represents the item's associated value. + * @param iconCssClass A String value specifying the CSS class of the image displayed by the list item. */ InsertItem(index: number, texts: string[], value: Object, iconCssClass: string): void; /** - * Adds a new item to the control's items collection at the specified index. - * @param index - * @param texts - * @param value + * Inserts a new item into the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. + * @param value An object that represents the item's associated value. */ InsertItem(index: number, texts: string[], value: Object): void; /** - * Adds a new item to the control's items collection at the specified index. - * @param index - * @param texts + * Inserts a new item into the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. */ InsertItem(index: number, texts: string[]): void; /** * Inserts a new item specified by its display text, associated value and displayed image into the editor's item collection, at the position specified. - * @param index - * @param text - * @param value - * @param iconCssClass + * @param index An integer value that represents the index position. + * @param text A string value specifying the item's display text. + * @param value An object that represents the item's associated value. + * @param iconCssClass A String value specifying the CSS class of the image displayed by the list item. */ InsertItem(index: number, text: string, value: Object, iconCssClass: string): void; /** * Inserts a new item specified by its display text and associated value into the editor's item collection, at the position specified. - * @param index - * @param text - * @param value + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. */ InsertItem(index: number, text: string, value: Object): void; /** * Inserts a new item specified by its display text into the editor's item collection, at the position specified. - * @param index - * @param text + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. */ InsertItem(index: number, text: string): void; + /** + * Gets the text displayed within a List Box item badge. + * @param index The index of a List Box item. + */ + GetItemBadgeText(index: number): string; + /** + * Sets the text displayed within a List Box item badge. + * @param index The index of a List Box item. + * @param text A String specifying the badge text. + */ + SetItemBadgeText(index: number, text: string): void; + /** + * Gets the CSS class of the icon displayed within a List Box item badge. + * @param index The index of a List Box item. + */ + GetItemBadgeIconCssClass(index: number): string; + /** + * Sets the CSS class of the icon displayed within a List Box item badge. + * @param index The index of a List Box item. + * @param cssClass A String containing the name of a CSS class. + */ + SetItemBadgeIconCssClass(index: number, cssClass: string): void; /** * Selects the specified items within a list box. * @param items An array of ASPxClientListEditItem objects that represent the items. @@ -19751,10 +21069,162 @@ interface BootstrapClientCheckBoxList extends ASPxClientCheckBoxList { */ interface BootstrapClientRadioButtonList extends ASPxClientRadioButtonList { } +/** + * Represents a client-side equivalent of the menu's BootstrapMenuItem object. + */ +interface BootstrapClientMenuItem extends ASPxClientMenuItem { + /** + * Gets the immediate parent item to which the current item belongs. + * Value: A BootstrapClientMenuItem object representing the item's immediate parent. + */ + parent: BootstrapClientMenuItem; + /** + * Returns the current menu item's immediate subitem specified by its index. + * @param index An integer value specifying the zero-based index of the submenu item to be retrieved. + */ + GetItem(index: number): BootstrapClientMenuItem; + /** + * Returns the current menu item's subitem specified by its name. + * @param name A string value specifying the name of the menu item. + */ + GetItemByName(name: string): BootstrapClientMenuItem; + /** + * Gets the text displayed within the menu item badge. + */ + GetBadgeText(): string; + /** + * Sets the text displayed within the menu item badge. + * @param text A String specifying the badge text. + */ + SetBadgeText(text: string): void; + /** + * Gets the CSS class of the icon displayed within the menu item badge. + */ + GetBadgeIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed within the menu item badge. + * @param cssClass A string containing the name of a CSS class. + */ + SetBadgeIconCssClass(cssClass: string): void; + /** + * Returns the URL pointing to the image displayed within the menu item. + */ + GetImageUrl(): string; + /** + * Sets the URL which points to the image displayed within the menu item. + * @param value + */ + SetImageUrl(value: string): void; + /** + * Gets the CSS class of the icon displayed by the menu item. + */ + GetIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed by the menu item. + * @param cssClass A string containing the name of a CSS class. + */ + SetIconCssClass(cssClass: string): void; +} /** * Represents a client-side equivalent of the BootstrapMenu control. */ interface BootstrapClientMenu extends ASPxClientMenu { + /** + * Returns the menu's root menu item specified by its index. + * @param index An integer value specifying the zero-based index of the root menu item to be retrieved. + */ + GetItem(index: number): BootstrapClientMenuItem; + /** + * Returns a menu item specified by its name. + * @param name A string value specifying the name of the menu item. + */ + GetItemByName(name: string): BootstrapClientMenuItem; + /** + * Returns the selected item within the menu control. + */ + GetSelectedItem(): BootstrapClientMenuItem; + /** + * Selects the specified menu item within the Menu control on the client side. + * @param item A BootstrapClientMenuItem object specifying the menu item to select. + */ + SetSelectedItem(item: BootstrapClientMenuItem): void; + /** + * Returns a root menu item. + */ + GetRootItem(): BootstrapClientMenuItem; + /** + * Selects the specified menu item within a menu control on the client side. + * @param item An ASPxClientMenuItem object specifying the menu item to select. + */ + SetSelectedItem(item: ASPxClientMenuItem): void; +} +/** + * A method that will handle the menu's client events concerning manipulations with an item. + */ +interface BootstrapClientMenuItemEventHandler { + /** + * A method that will handle the menu's client events concerning manipulations with an item. + * @param source An object representing the event source. Identifies the BootstrapMenu control that raised the event. + * @param e An BootstrapClientMenuItemEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientMenuItemEventArgs): void; +} +/** + * Provides data for events related to manipulations on menu items. + */ +interface BootstrapClientMenuItemEventArgs extends ASPxClientEventArgs { + /** + * Gets the menu item object related to the event. + * Value: A BootstrapClientMenuItem object, manipulations on which forced the event to be raised. + */ + item: BootstrapClientMenuItem; +} +/** + * A method that will handle the ItemMouseOver events. + */ +interface BootstrapClientMenuItemMouseEventHandler { + /** + * A method that will handle the ItemMouseOver events. + * @param source An object representing the event source. Identifies the BootstrapMenu control that raised the event. + * @param e An BootstrapClientMenuItemMouseEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientMenuItemMouseEventArgs): void; +} +/** + * Provides data for client events related to mouse hovering over menu items. + */ +interface BootstrapClientMenuItemMouseEventArgs extends BootstrapClientMenuItemEventArgs { +} +/** + * A method that will handle client ItemClick events. + */ +interface BootstrapClientMenuItemClickEventHandler { + /** + * A method that will handle client ItemClick events. + * @param source An object representing the event source. Identifies the BootstrapMenu control that raised the event. + * @param e An BootstrapClientMenuItemClickEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientMenuItemClickEventArgs): void; +} +/** + * Provides data for events related to clicking on the control's items. + */ +interface BootstrapClientMenuItemClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the menu item object related to the event. + * Value: A BootstrapClientMenuItem object, manipulations on which forced the event to be raised. + */ + item: BootstrapClientMenuItem; + /** + * Gets an HTML object that contains the processed Menu item. + * Value: An HTML object. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: A DHTML event object. + */ + htmlEvent: Object; } /** * Represents a client-side equivalent of the BootstrapPager control. @@ -19766,8 +21236,8 @@ interface BootstrapClientPager extends ASPxClientPager { */ interface BootstrapClientPopupControl extends ASPxClientPopupControl { /** - * - * @param selector + * Sets the CSS selector of a web control or HTML element with which the current popup window is associated. + * @param selector A string value specifying the CSS selector of the web control or HTML element with which the popup window is associated. */ SetPopupElementCssSelector(selector: string): void; } @@ -19776,10 +21246,38 @@ interface BootstrapClientPopupControl extends ASPxClientPopupControl { */ interface BootstrapClientPopupMenu extends ASPxClientPopupMenu { /** - * - * @param selector + * Returns the popup menu's root menu item specified by its index. + * @param index An integer value specifying the zero-based index of the root menu item to be retrieved. + */ + GetItem(index: number): BootstrapClientMenuItem; + /** + * Returns a menu item specified by its name. + * @param name A string value specifying the name of the menu item. + */ + GetItemByName(name: string): BootstrapClientMenuItem; + /** + * Returns the selected item within the menu control. + */ + GetSelectedItem(): BootstrapClientMenuItem; + /** + * Selects the specified menu item within a the Popup Menu control on the client side. + * @param item A BootstrapClientMenuItem object specifying the menu item to select. + */ + SetSelectedItem(item: BootstrapClientMenuItem): void; + /** + * Returns a root menu item. + */ + GetRootItem(): BootstrapClientMenuItem; + /** + * Sets the CSS selector of a web control or HTML element with which the current popup menu is associated. + * @param selector A string value specifying the CSS selector of the web control or HTML element with which the popup menu is associated. */ SetPopupElementCssSelector(selector: string): void; + /** + * Selects the specified menu item within a menu control on the client side. + * @param item An ASPxClientMenuItem object specifying the menu item to select. + */ + SetSelectedItem(item: ASPxClientMenuItem): void; } /** * Represents a client-side equivalent of the BootstrapProgressBar control. @@ -19791,15 +21289,472 @@ interface BootstrapClientProgressBar extends ASPxClientProgressBar { */ interface BootstrapClientSpinEdit extends ASPxClientSpinEdit { } +/** + * Represents the client-side equivalent of the BootstrapClientTimeEdit control. + */ +interface BootstrapClientTimeEdit extends ASPxClientTimeEdit { +} /** * Represents a client-side equivalent of the BootstrapTabControl control. */ interface BootstrapClientTabControl extends ASPxClientTabControl { + /** + * Returns the active tab within the Tab Control. + */ + GetActiveTab(): BootstrapClientTab; + /** + * Makes the specified tab active within the Tab Control on the client side. + * @param tab A BootstrapClientTab object specifying the tab to select. + */ + SetActiveTab(tab: BootstrapClientTab): void; + /** + * Returns a tab specified by its index. + * @param index An integer value specifying the zero-based index of the tab object to retrieve. + */ + GetTab(index: number): BootstrapClientTab; + /** + * Returns a tab specified by its name. + * @param name A string value specifying the name of the tab. + */ + GetTabByName(name: string): BootstrapClientTab; + /** + * Makes the specified tab active within the tab control on the client side. + * @param tab An ASPxClientTab object specifying the tab to select. + */ + SetActiveTab(tab: ASPxClientTab): void; } /** * Represents a client-side equivalent of the BootstrapPageControl control. */ interface BootstrapClientPageControl extends ASPxClientPageControl { + /** + * Returns the active tab within the Page Control. + */ + GetActiveTab(): BootstrapClientTab; + /** + * Makes the specified tab active within the Page Control on the client side. + * @param tab A BootstrapClientTab object specifying the tab to select. + */ + SetActiveTab(tab: BootstrapClientTab): void; + /** + * Returns a tab specified by its index. + * @param index An integer value specifying the zero-based index of the tab object to retrieve. + */ + GetTab(index: number): BootstrapClientTab; + /** + * Returns a tab specified by its name. + * @param name A string value specifying the name of the tab. + */ + GetTabByName(name: string): BootstrapClientTab; + /** + * Returns the HTML code that represents the contents of the specified page within the page control. + * @param tab An BootstrapClientTab object that specifies the required page. + */ + GetTabContentHTML(tab: BootstrapClientTab): string; + /** + * Defines the HTML content for a specific tab page within the page control. + * @param tab A BootstrapClientTab object that specifies the required tab page. + * @param html A string value that represents the HTML code defining the content of the specified page. + */ + SetTabContentHTML(tab: BootstrapClientTab, html: string): void; + /** + * Returns the HTML code that represents the contents of the specified page within the page control. + * @param tab An ASPxClientTab object that specifies the required page. + */ + GetTabContentHTML(tab: ASPxClientTab): string; + /** + * Defines the HTML content for a specific tab page within the page control. + * @param tab An ASPxClientTab object that specifies the required tab page. + * @param html A string value that represents the HTML code defining the content of the specified page. + */ + SetTabContentHTML(tab: ASPxClientTab, html: string): void; + /** + * Makes the specified tab active within the tab control on the client side. + * @param tab An ASPxClientTab object specifying the tab to select. + */ + SetActiveTab(tab: ASPxClientTab): void; +} +/** + * Represents a client-side equivalent of a tab control's BootstrapTabPage object. + */ +interface BootstrapClientTab extends ASPxClientTab { + /** + * Gets the text displayed within the tab badge. + */ + GetBadgeText(): string; + /** + * Sets the text displayed within the tab badge. + * @param text A String specifying the badge text. + */ + SetBadgeText(text: string): void; + /** + * Gets the CSS class of the icon displayed within the tab badge. + */ + GetBadgeIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed within the tab badge. + * @param cssClass A string containing the name of a CSS class. + */ + SetBadgeIconCssClass(cssClass: string): void; + /** + * Returns the URL pointing to the image displayed within the tab. + */ + GetImageUrl(): string; + /** + * Specifies the URL which points to the image displayed within the tab. + * @param value + */ + SetImageUrl(value: string): void; + /** + * Returns the URL pointing to the image displayed within the active tab. + */ + GetActiveImageUrl(): string; + /** + * Specifies the URL which points to the image displayed within the active tab. + * @param value + */ + SetActiveImageUrl(value: string): void; + /** + * Gets the CSS class of the icon displayed by the tab. + */ + GetIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed by the tab. + * @param cssClass A string containing the name of a CSS class. + */ + SetIconCssClass(cssClass: string): void; + /** + * Gets the CSS class of an icon displayed by the tab when it is active. + */ + GetActiveIconCssClass(): string; + /** + * Sets the CSS class of an icon displayed by the tab when it is active. + * @param cssClass A String containing the name of a CSS class. + */ + SetActiveIconCssClass(cssClass: string): void; +} +/** + * A method that will handle a tab control's client events concerning manipulations with a tab. + */ +interface BootstrapClientTabControlTabEventHandler { + /** + * A method that will handle a tab control's client events concerning manipulations with a tab. + * @param source An object representing the event source. Identifies the BootstrapClientTabControl that raised the event. + * @param e An BootstrapClientTabControlTabEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientTabControlTabEventArgs): void; +} +/** + * Provides data for events related to manipulations on tabs. + */ +interface BootstrapClientTabControlTabEventArgs extends ASPxClientEventArgs { + /** + * Gets the tab object related to the event. + * Value: A BootstrapClientTab object, manipulations on which forced the event to be raised. + */ + tab: BootstrapClientTab; +} +/** + * A method that will handle a tab control's cancelable client events concerning manipulations with a tab. + */ +interface BootstrapClientTabControlTabCancelEventHandler { + /** + * A method that will handle a tab control's cancelable client events concerning manipulations with a tab. + * @param source An object representing the event source. Identifies the BootstrapTabControl that raised the event. + * @param e An BootstrapClientTabControlTabCancelEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientTabControlTabCancelEventArgs): void; +} +/** + * Provides data for cancellable events related to manipulations on tabs. + */ +interface BootstrapClientTabControlTabCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets the tab object related to the event. + * Value: A BootstrapClientTab object representing the tab manipulations on which forced the tab control to raise the event. + */ + tab: BootstrapClientTab; + /** + * Gets or sets a value specifying whether a callback should be sent to the server to reload the content of the page being activated. + * Value: true, to reload the page's content; otherwise, false. + */ + reloadContentOnCallback: boolean; +} +/** + * A method that will handle client events concerning clicks on tabs. + */ +interface BootstrapClientTabControlTabClickEventHandler { + /** + * A method that will handle client events concerning clicks on tabs. + * @param source An object representing the event source. Identifies the BootstrapTabControl that raised the event. + * @param e An BootstrapClientTabControlTabClickEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientTabControlTabClickEventArgs): void; +} +/** + * Provides data for events related to clicking on the control's tabs. + */ +interface BootstrapClientTabControlTabClickEventArgs extends BootstrapClientTabControlTabCancelEventArgs { + /** + * Gets an HTML object that contains the processed tab. + * Value: An HTML object. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: A DHTML event object. + */ + htmlEvent: Object; +} +/** + * A client-side equivalent of the BootstrapTagBox object. + */ +interface BootstrapClientTagBox extends ASPxClientTokenBox { + /** + * Use the TagsChanged event instead. + */ + TokensChanged: ASPxClientEvent>; + /** + * Fires on the client side after the tag collection has been changed. + */ + TagsChanged: ASPxClientEvent>; + /** + * Adds a new token with the specified text to the end of the control's token collection. + * @param text + */ + AddToken(text: string): void; + /** + * Adds a new tag with the specified text to the end of the control's tag collection. + * @param text A string value specifying the tag's text. + */ + AddTag(text: string): void; + /** + * Use the RemoveTagByText method instead. + * @param text + */ + RemoveTokenByText(text: string): void; + /** + * Removes a tag specified by its text from the tag box on the client. + * @param text A string value that is the text of the tag to be removed. + */ + RemoveTagByText(text: string): void; + /** + * Use the RemoveTag method instead. + * @param index + */ + RemoveToken(index: number): void; + /** + * Removes a tag specified by its index from the tag box on the client. + * @param index An integer value that is the index of the tag to be removed. + */ + RemoveTag(index: number): void; + /** + * Returns an HTML span element that corresponds to the specified token. + * @param index + */ + GetTokenHtmlElement(index: number): Object; + /** + * Returns an HTML span element that corresponds to the specified tag. + * @param index An integer value that is the tag index. + */ + GetTagHtmlElement(index: number): Object; + /** + * Returns an HTML span element that corresponds to the specified token's text. + * @param index + */ + GetTokenTextHtmlElement(index: number): Object; + /** + * Returns an HTML span element that corresponds to the specified tag's text. + * @param index An integer value that is the tag index. + */ + GetTagTextHtmlElement(index: number): Object; + /** + * Returns an HTML span element that corresponds to the specified token's remove button. + * @param index + */ + GetTokenRemoveButtonHtmlElement(index: number): Object; + /** + * Returns an HTML span element that corresponds to the specified tag's remove button. + * @param index An integer value that is the tag index. + */ + GetTagRemoveButtonHtmlElement(index: number): Object; + /** + * Returns a collection of tokens. + */ + GetTokenCollection(): string[]; + /** + * Returns a collection of tags. + */ + GetTagCollection(): string[]; + /** + * Returns a collection of tokens. + * @param collection + */ + SetTokenCollection(collection: string[]): void; + /** + * Sets a collection of tags. + * @param collection An object that is the collection of tags. + */ + SetTagCollection(collection: string[]): void; + /** + * Use the ClearTagCollection method instead. + */ + ClearTokenCollection(): void; + /** + * Removes all tags contained in the tag box. + */ + ClearTagCollection(): void; + /** + * Returns the index of a token specified by its text. + * @param text + */ + GetTokenIndexByText(text: string): number; + /** + * Returns the index of a tag specified by its text. + * @param text A string value that specifies the text of the tag. + */ + GetTagIndexByText(text: string): number; + /** + * Use the IsCustomTag method instead. + * @param text + * @param caseSensitive + */ + IsCustomToken(text: string, caseSensitive: boolean): boolean; + /** + * Returns a value that indicates if the specified tag (string) is a custom tag. + * @param text A string value that is a tag. + * @param caseSensitive true, if tags are case sensitive; otherwise, false. + */ + IsCustomTag(text: string, caseSensitive: boolean): boolean; + /** + * Returns the editor's selected item. + */ + GetSelectedItem(): BootstrapClientListBoxItem; + /** + * Sets the list editor's selected item. + * @param item A BootstrapClientListBoxItem object that specifies the item to select. + */ + SetSelectedItem(item: BootstrapClientListBoxItem): void; + /** + * Returns an item specified by its index within the tag box editor's item collection. + * @param index An integer value specifying the zero-based index of the item to search for. + */ + GetItem(index: number): BootstrapClientListBoxItem; + /** + * Returns an item by its text. + * @param text A string that specifies the item's text. + */ + FindItemByText(text: string): BootstrapClientListBoxItem; + /** + * Returns a list item by its value. + * @param value An object that specifies the item's value. + */ + FindItemByValue(value: Object): BootstrapClientListBoxItem; + /** + * This method is not in effect for the BootstrapClientTagBox class. + * @param texts + */ + AddItem(texts: string[]): number; + /** + * This method is not in effect for the BootstrapClientTagBox class. + * @param texts + * @param value + */ + AddItem(texts: string[], value: Object): number; + /** + * This method is not in effect for the BootstrapClientTagBox class. + * @param texts + * @param value + * @param iconCssClass + */ + AddItem(texts: string[], value: Object, iconCssClass: string): number; + /** + * Adds a new item to the editor, specifying the item's display text, and returns the index of the added item. + * @param text A string value specifying the item's display text. + */ + AddItem(text: string): number; + /** + * Adds a new item to the editor, specifying the item's display text and associated value, and returns the index of the added item. + * @param text A string value specifying the item's display text. + * @param value An object that represents the item's associated value. + */ + AddItem(text: string, value: Object): number; + /** + * Adds a new item to the editor, specifying the item's display text, associated value and displayed image, and returns the index of the added item. + * @param text A string value specifying the item's display text. + * @param value An object that represents the item's associated value. + * @param iconCssClass A String value specifying the CSS class of the image displayed by the list item. + */ + AddItem(text: string, value: Object, iconCssClass: string): number; + /** + * This method is not in effect for the BootstrapClientTagBox class. + * @param index + * @param texts + * @param value + * @param iconCssClass + */ + InsertItem(index: number, texts: string[], value: Object, iconCssClass: string): void; + /** + * This method is not in effect for the BootstrapClientTagBox class. + * @param index + * @param texts + * @param value + */ + InsertItem(index: number, texts: string[], value: Object): void; + /** + * This method is not in effect for the BootstrapClientTagBox class. + * @param index + * @param texts + */ + InsertItem(index: number, texts: string[]): void; + /** + * Inserts a new item specified by its display text, associated value and displayed image into the editor's item collection, at the position specified. + * @param index An integer value that represents the index position. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + * @param iconCssClass A String value specifying the CSS class of the image displayed by the list item. + */ + InsertItem(index: number, text: string, value: Object, iconCssClass: string): void; + /** + * Inserts a new item specified by its display text, associated value and displayed image into the editor's item collection, at the position specified. + * @param index An integer value that represents the index position. + * @param text A string value specifying the item's display text. + * @param value An object that represents the item's associated value. + */ + InsertItem(index: number, text: string, value: Object): void; + /** + * Inserts a new item into the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param text A string value specifying the item's display text. + */ + InsertItem(index: number, text: string): void; + /** + * Gets the text displayed within a Tag Box item badge. + * @param index The index of a Tag Box item. + */ + GetItemBadgeText(index: number): string; + /** + * Sets the text displayed within a Tag Box item badge. + * @param index The index of a Tag Box item. + * @param text A String specifying the badge text. + */ + SetItemBadgeText(index: number, text: string): void; + /** + * Gets the CSS class of the icon displayed within a Tag Box item badge. + * @param index The index of a Tag Box item. + */ + GetItemBadgeIconCssClass(index: number): string; + /** + * Sets the CSS class of the icon displayed within a Tag Box item badge. + * @param index The index of a Tag Box item. + * @param cssClass A String containing the name of a CSS class. + */ + SetItemBadgeIconCssClass(index: number, cssClass: string): void; + /** + * Sets the list editor's selected item. + * @param item An ASPxClientListEditItem object that specifies the item to select. + */ + SetSelectedItem(item: ASPxClientListEditItem): void; } /** * Represents a client-side equivalent of the BootstrapTextBox control. @@ -19816,79 +21771,741 @@ interface BootstrapClientMemo extends ASPxClientMemo { */ interface BootstrapClientButtonEdit extends ASPxClientButtonEdit { } +/** + * Represents the client-side equivalent of the BootstrapToolbar control. + */ +interface BootstrapClientToolbar extends BootstrapClientMenu { +} /** * Represents a client-side equivalent of the BootstrapTreeView control. */ interface BootstrapClientTreeView extends ASPxClientTreeView { + /** + * Returns a node specified by its index within the Tree View's node collection. + * @param index An integer value specifying the zero-based index of the node to be retrieved. + */ + GetNode(index: number): BootstrapClientTreeViewNode; + /** + * Returns a node specified by its name. + * @param name A string value specifying the name of the node. + */ + GetNodeByName(name: string): BootstrapClientTreeViewNode; + /** + * Returns a node specified by its text. + * @param text A string value specifying the text content of the node. + */ + GetNodeByText(text: string): BootstrapClientTreeViewNode; + /** + * Returns the selected node within the Tree View control on the client side. + */ + GetSelectedNode(): BootstrapClientTreeViewNode; + /** + * Selects the specified node within the Tree View control on the client side. + * @param node A BootstrapClientTreeViewNode object specifying the node to select. + */ + SetSelectedNode(node: BootstrapClientTreeViewNode): void; + /** + * Gets the root node of the Tree View control. + */ + GetRootNode(): BootstrapClientTreeViewNode; + /** + * Selects the specified node within the ASPxTreeView control on the client side. + * @param node An ASPxClientTreeViewNode object specifying the node to select. + */ + SetSelectedNode(node: ASPxClientTreeViewNode): void; } -interface BootstrapUIWidgetBase extends ASPxClientControl { - Init: ASPxClientEvent>; - Drawn: ASPxClientEvent>; - Disposing: ASPxClientEvent>; - OptionChanged: ASPxClientEvent>; - Exporting: ASPxClientEvent>; - Exported: ASPxClientEvent>; - FileSaving: ASPxClientEvent>; - IncidentOccurred: ASPxClientEvent>; - GetInstance(): Object; - SetOptions(options: Object): void; - SetDataSource(dataSource: Object): void; - GetDataSource(): Object; - ExportTo(format: string, fileName: string): void; - Print(): void; +/** + * Represents a client-side equivalent of the TreeView's BootstrapTreeViewNode object. + */ +interface BootstrapClientTreeViewNode extends ASPxClientTreeViewNode { + /** + * Gets the BootstrapClientTreeView object to which the current node belongs. + * Value: A object that is the node's owner. + */ + treeView: BootstrapClientTreeView; + /** + * Gets the current node's parent node. + * Value: A BootstrapClientTreeViewNode object representing the node's immediate parent. + */ + parent: BootstrapClientTreeViewNode; + /** + * Returns the current node's immediate child node specified by its index. + * @param index An integer value specifying the zero-based index of the node to be retrieved. + */ + GetNode(index: number): BootstrapClientTreeViewNode; + /** + * Returns the current node's child node specified by its name. + * @param name A string value specifying the name of the node. + */ + GetNodeByName(name: string): BootstrapClientTreeViewNode; + /** + * Returns the current node's child node specified by its text. + * @param text A string value specifying the text content of the node. + */ + GetNodeByText(text: string): BootstrapClientTreeViewNode; + /** + * Gets the text displayed within the node badge. + */ + GetBadgeText(): string; + /** + * Sets the text displayed within the node badge. + * @param text A String specifying the badge text. + */ + SetBadgeText(text: string): void; + /** + * Gets the CSS class of the icon displayed within the node badge. + */ + GetBadgeIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed within the node badge. + * @param cssClass A string containing the name of a CSS class. + */ + SetBadgeIconCssClass(cssClass: string): void; + /** + * Returns the URL pointing to the image displayed within the node. + */ + GetImageUrl(): string; + /** + * Sets the URL which points to the image displayed within the node. + * @param value + */ + SetImageUrl(value: string): void; + /** + * Gets the CSS class of the icon displayed by the node. + */ + GetIconCssClass(): string; + /** + * Sets the CSS class of the icon displayed by the node. + * @param cssClass A string containing the name of a CSS class. + */ + SetIconCssClass(cssClass: string): void; } -interface BootstrapUIWidgetInitializedEventHandler { - (source: S, e: BootstrapUIWidgetEventArgsBase): void; +/** + * A method that will handle the client events concerned with node processing. + */ +interface BootstrapClientTreeViewNodeProcessingModeEventHandler { + /** + * A method that will handle the client events concerned with node processing. + * @param source An object representing the event source. Identifies the BootstrapClientTreeView control that raised the event. + * @param e An BootstrapClientTreeViewNodeProcessingModeEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientTreeViewNodeProcessingModeEventArgs): void; } -interface BootstrapUIWidgetDrawnEventHandler { - (source: S, e: BootstrapUIWidgetEventArgsBase): void; +/** + * Provides data for the client events related to node processing, and allowing the event's processing to be passed to the server side. + */ +interface BootstrapClientTreeViewNodeProcessingModeEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets a node object related to the event. + * Value: A BootstrapClientTreeViewNode object, manipulations on which forced the event to be raised. + */ + node: BootstrapClientTreeViewNode; } -interface BootstrapUIWidgetDisposingEventHandler { - (source: S, e: BootstrapUIWidgetEventArgsBase): void; +/** + * A method that will handle the NodeClick event. + */ +interface BootstrapClientTreeViewNodeClickEventHandler { + /** + * A method that will handle the NodeClick event. + * @param source An object representing the event source. Identifies the BootstrapClientTreeView control that raised the event. + * @param e An BootstrapClientTreeViewNodeClickEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientTreeViewNodeClickEventArgs): void; } -interface BootstrapUIWidgetExportedEventHandler { - (source: S, e: BootstrapUIWidgetEventArgsBase): void; +/** + * Provides data for the NodeClick event. + */ +interface BootstrapClientTreeViewNodeClickEventArgs extends BootstrapClientTreeViewNodeProcessingModeEventArgs { + /** + * Gets an HTML object that contains the processed Tree View node. + * Value: An HTML object. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: A DHTML event object. + */ + htmlEvent: Object; } -interface BootstrapUIWidgetOptionChangedEventHandler { - (source: S, e: BootstrapUIWidgetOptionChangedEventArgs): void; +/** + * A method that will handle the Tree View control's client events, concerning manipulations with a node. + */ +interface BootstrapClientTreeViewNodeEventHandler { + /** + * A method that will handle the Tree View control's client events, concerning manipulations with a node. + * @param source An object representing the event source. Identifies the BootstrapClientTreeView control that raised the event. + * @param e An BootstrapClientTreeViewNodeEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientTreeViewNodeEventArgs): void; } -interface BootstrapUIWidgetOptionChangedEventArgs extends BootstrapUIWidgetEventArgsBase { - fullName: string; - name: string; - previousValue: Object; - value: Object; +/** + * Provides data for the ExpandedChanged events. + */ +interface BootstrapClientTreeViewNodeEventArgs extends ASPxClientEventArgs { + /** + * Gets a node object related to the event. + * Value: A BootstrapClientTreeViewNode object, manipulations on which forced the event to be raised. + */ + node: BootstrapClientTreeViewNode; } -interface BootstrapUIWidgetExportingEventHandler { - (source: S, e: BootstrapUIWidgetExportEventArgs): void; +/** + * A method that will handle the Tree View's cancelable client events, concerning manipulations with nodes. + */ +interface BootstrapClientTreeViewNodeCancelEventHandler { + /** + * A method that will handle the Tree View's cancelable client events, concerning manipulations with nodes. + * @param source An object representing the event source. Identifies the BootstrapClientTreeView control that raised the event. + * @param e An BootstrapClientTreeViewNodeCancelEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientTreeViewNodeCancelEventArgs): void; } -interface BootstrapUIWidgetFileSavingEventHandler { - (source: S, e: BootstrapUIWidgetExportEventArgs): void; -} -interface BootstrapUIWidgetExportEventArgs extends BootstrapUIWidgetEventArgsBase { - cancel: boolean; - data: Object; - fileName: string; - format: string; -} -interface BootstrapUIWidgetErrorEventHandler { - (source: S, e: BootstrapUIWidgetErrorEventArgs): void; -} -interface BootstrapUIWidgetErrorEventArgs extends BootstrapUIWidgetEventArgsBase { - target: Object; -} -interface BootstrapUIWidgetElementActionEventArgs extends BootstrapUIWidgetEventArgsBase { - target: Object; -} -interface BootstrapUIWidgetElementClickEventArgs extends BootstrapUIWidgetElementActionEventArgs { - jQueryEvent: Object; +/** + * Provides data for the ExpandedChanging event. + */ +interface BootstrapClientTreeViewNodeCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets a node object related to the event. + * Value: A BootstrapClientTreeViewNode object, manipulations on which forced the event to be raised. + */ + node: BootstrapClientTreeViewNode; } /** * Represents a client-side equivalent of the BootstrapUploadControl. */ interface BootstrapClientUploadControl extends ASPxClientUploadControl { } +/** + * Represents the client BootstrapGridView. + */ interface BootstrapClientGridView extends ASPxClientGridView { } +/** + * Represents the client BootstrapCardView. + */ +interface BootstrapClientCardView extends ASPxClientGridView { +} +/** + * Represents a client-side equivalent of the BootstrapWebClientUIWidget class. + */ +interface BootstrapUIWidgetBase extends ASPxClientControl { + /** + * Fires once, after the widget is initialized. + */ + Init: ASPxClientEvent>; + /** + * Fires when the widget has finished drawing itself. + */ + Drawn: ASPxClientEvent>; + /** + * Fires when the widget is removed from the DOM using the remove(), empty(), or html() jQuery methods only. + */ + Disposing: ASPxClientEvent>; + /** + * Fires after an option of the widget has been changed. + */ + OptionChanged: ASPxClientEvent>; + /** + * Fires before data from the widget is exported. + */ + Exporting: ASPxClientEvent>; + /** + * Fires after data from the widget is exported. + */ + Exported: ASPxClientEvent>; + /** + * Raised before a file with exported data is saved on the user's local storage. + */ + FileSaving: ASPxClientEvent>; + /** + * Fires when an error or warning appears in the widget. + */ + IncidentOccurred: ASPxClientEvent>; + /** + * Gets an instance of the widget. + */ + GetInstance(): Object; + /** + * Sets the widget's options to values specified in the passed object. + * @param options An object containing key-value pairs specifying new option values. + */ + SetOptions(options: Object): void; + /** + * Gets the client data source instance. + * @param dataSource A DevExtreme DataSource object. + */ + SetDataSource(dataSource: Object): void; + /** + * Gets the client data source instance. + */ + GetDataSource(): Object; + /** + * Exports the widget. + * @param format A string specifying the target file format. + * @param fileName A string specifying the file name. + */ + ExportTo(format: string, fileName: string): void; + /** + * Invokes the browser's Print window to print the widget's contents. + */ + Print(): void; +} +/** + * Represents a client-side equivalent of the BootstrapChartBase class. + */ +interface BootstrapClientChartBase extends BootstrapUIWidgetBase { + /** + * Fires when the Series and Points chart elements are ready to be accessed. + */ + Done: ASPxClientEvent>; + /** + * Fires when an item on the chart legend is clicked. + */ + LegendClick: ASPxClientEvent>; + /** + * Fires when a user clicks a series point. + */ + PointClick: ASPxClientEvent>; + /** + * Fires when the hover state of a series point has been changed. + */ + PointHoverChanged: ASPxClientEvent>; + /** + * Fires when the selection state of a series point has been changed. + */ + PointSelectionChanged: ASPxClientEvent>; + /** + * Fires when a point's tooltip becomes hidden. + */ + TooltipHidden: ASPxClientEvent>; + /** + * Fires when a point's tooltip appears. + */ + TooltipShown: ASPxClientEvent>; + /** + * Fires when a user clicks a label on the argument axis. + */ + ArgumentAxisClick: ASPxClientEvent>; + /** + * Fires when a user clicks a series. + */ + SeriesClick: ASPxClientEvent>; + /** + * Fires when the hover state of a series has been changed. + */ + SeriesHoverChanged: ASPxClientEvent>; + /** + * Fires when the selection state of a series has been changed. + */ + SeriesSelectionChanged: ASPxClientEvent>; +} +/** + * Represents a client-side equivalent of the Chart control. + */ +interface BootstrapClientChart extends BootstrapClientChartBase { + /** + * Fires when a chart zooming or scrolling begins. + */ + ZoomStart: ASPxClientEvent>; + /** + * Fires when a chart zooming or scrolling ends. + */ + ZoomEnd: ASPxClientEvent>; +} +/** + * Represents a client-side equivalent of the BootstrapPolarChart control. + */ +interface BootstrapClientPolarChart extends BootstrapClientChartBase { +} +/** + * Represents a client-side equivalent of the BootstrapPieChart control. + */ +interface BootstrapClientPieChart extends BootstrapClientChartBase { +} +/** + * A method that will handle the Done event. + */ +interface BootstrapClientChartBaseDoneEventHandler { + /** + * A method that will handle the Done event. + * @param source The event source. + * @param e A BootstrapUIWidgetEventArgsBase object that contains event data. + */ + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +/** + * A method that will handle the LegendClick event. + */ +interface BootstrapClientChartBaseLegendClickEventHandler { + /** + * A method that will handle the LegendClick event. + * @param source The event source. + * @param e A BootstrapUIWidgetElementClickEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; +} +/** + * A method that will handle the Invoke event. + */ +interface BootstrapClientCoordinateSystemChartArgumentAxisClickEventHandler { + /** + * A method that will handle the Invoke event. + * @param source The event source. + * @param e A BootstrapUIWidgetElementClickEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; +} +/** + * A method that will handle the PointClick event. + */ +interface BootstrapClientChartBasePointClickEventHandler { + /** + * A method that will handle the PointClick event. + * @param source The event source. + * @param e A BootstrapUIWidgetElementClickEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; +} +/** + * A method that will handle the PointHoverChanged event. + */ +interface BootstrapClientChartBasePointHoverChangedEventHandler { + /** + * A method that will handle the PointHoverChanged event. + * @param source The event source. + * @param e A BootstrapUIWidgetElementActionEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +/** + * A method that will handle the PointSelectionChanged event. + */ +interface BootstrapClientChartBasePointSelectionChangedEventHandler { + /** + * A method that will handle the PointSelectionChanged event. + * @param source The event source. + * @param e A BootstrapUIWidgetElementActionEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +/** + * A method that will handle the TooltipHidden event. + */ +interface BootstrapClientChartBaseTooltipHiddenEventHandler { + /** + * A method that will handle the TooltipHidden event. + * @param source The event source. + * @param e A BootstrapUIWidgetElementActionEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +/** + * A method that will handle the TooltipShown event. + */ +interface BootstrapClientChartBaseTooltipShownEventHandler { + /** + * A method that will handle the TooltipShown event. + * @param source The event source. + * @param e A BootstrapUIWidgetElementActionEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +/** + * A method that will handle the SeriesClick event. + */ +interface BootstrapClientCoordinateSystemChartSeriesClickEventHandler { + /** + * A method that will handle the SeriesClick event. + * @param source The event source. + * @param e A BootstrapUIWidgetElementClickEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; +} +/** + * A method that will handle the SeriesHoverChanged event. + */ +interface BootstrapClientCoordinateSystemChartSeriesHoverChangedEventHandler { + /** + * A method that will handle the SeriesHoverChanged event. + * @param source The event source. + * @param e A BootstrapUIWidgetElementActionEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +/** + * A method that will handle the SeriesSelectionChanged event. + */ +interface BootstrapClientCoordinateSystemChartSeriesSelectionChangedEventHandler { + /** + * A method that will handle the SeriesSelectionChanged event. + * @param source The event source. + * @param e A BootstrapUIWidgetElementActionEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +/** + * A method that will handle the ZoomStart event. + */ +interface BootstrapClientChartZoomStartEventHandler { + /** + * A method that will handle the ZoomStart event. + * @param source The event source. + * @param e A BootstrapUIWidgetEventArgsBase object that contains event data. + */ + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +/** + * A method that will handle the ZoomEnd event. + */ +interface BootstrapClientChartZoomEndEventHandler { + /** + * A method that will handle the ZoomEnd event. + * @param source The event source. + * @param e A BootstrapClientChartZoomEndEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientChartZoomEndEventArgs): void; +} +/** + * Provides base data for the client-side events. + */ +interface BootstrapUIWidgetEventArgsBase extends ASPxClientEventArgs { + /** + * The widget instance. + * Value: An object specifying the widget instance. + */ + component: Object; + /** + * The widget's container. + * Value: An object specifying the widget's container. + */ + element: Object; +} +/** + * Provides data for the ZoomEnd event. + */ +interface BootstrapClientChartZoomEndEventArgs extends BootstrapUIWidgetEventArgsBase { + /** + * The value that became the start of the argument axis after zooming or scrolling ended. + * Value: An object specifying the start of the argument axis. + */ + rangeStart: Object; + /** + * The value that became the end of the argument axis after zooming or scrolling ended. + * Value: An object specifying the end of the argument axis. + */ + rangeEnd: Object; +} +/** + * Represents a client-side equivalent of the Range Selector control. + */ +interface BootstrapClientRangeSelector extends BootstrapUIWidgetBase { + /** + * Fires after the selected range has been changed by moving one of the sliders. + */ + ValueChanged: ASPxClientEvent>; + /** + * Gets the Range Selector's selected value range. + */ + GetValue(): Object[]; + /** + * Gets the Range Selector's selected value range. + * @param value An array containing the value range. + */ + SetValue(value: Object[]): void; +} +/** + * Provides data for events which concern manipulations on the selected range. + */ +interface BootstrapClientRangeSelectorValueChangedEventArgs extends BootstrapUIWidgetEventArgsBase { + /** + * The value currently specified for the RangeSelector control. + * Value: A System.Object instance defining the current value specified for a RangeSelector control. + */ + value: Object; + /** + * The previous value of a RangeSelector control. + * Value: A System.Object type defining the previous value specified for a RangeSelector control. + */ + previousValue: Object; +} +/** + * A method that will handle the ValueChanged event. + */ +interface BootstrapClientRangeSelectorValueChangedEventHandler { + /** + * A method that will handle the ValueChanged event. + * @param source The event source. + * @param e A BootstrapClientRangeSelectorValueChangedEventArgs object that contains event data. + */ + (source: S, e: BootstrapClientRangeSelectorValueChangedEventArgs): void; +} +/** + * A method that will handle the Init event. + */ +interface BootstrapUIWidgetInitializedEventHandler { + /** + * A method that will handle the Init event. + * @param source The event source. + * @param e A BootstrapUIWidgetEventArgsBase object that contains event data. + */ + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +/** + * A method that will handle the Drawn event. + */ +interface BootstrapUIWidgetDrawnEventHandler { + /** + * A method that will handle the Drawn event. + * @param source The event source. + * @param e A BootstrapUIWidgetEventArgsBase object that contains event data. + */ + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +/** + * A method that will handle the Disposing event. + */ +interface BootstrapUIWidgetDisposingEventHandler { + /** + * A method that will handle the Disposing event. + * @param source The event source. + * @param e A BootstrapUIWidgetEventArgsBase object that contains event data. + */ + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +/** + * A method that will handle the Exported event. + */ +interface BootstrapUIWidgetExportedEventHandler { + /** + * A method that will handle the Exported event. + * @param source The event source. + * @param e A BootstrapUIWidgetEventArgsBase object that contains event data. + */ + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +/** + * A method that will handle the OptionChanged event. + */ +interface BootstrapUIWidgetOptionChangedEventHandler { + /** + * A method that will handle the OptionChanged event. + * @param source The event source. + * @param e A BootstrapUIWidgetOptionChangedEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetOptionChangedEventArgs): void; +} +/** + * Provides data for client events raised in response to changing the widget's options. + */ +interface BootstrapUIWidgetOptionChangedEventArgs extends BootstrapUIWidgetEventArgsBase { + /** + * The option's full name. + * Value: A string value specifying the option's full name. + */ + fullName: string; + /** + * The option's short name. + * Value: A string value specifying the option's short name. + */ + name: string; + /** + * The option's old value. + * Value: An object that is the option's old value. + */ + previousValue: Object; + /** + * The option's new value. + * Value: An object that is the option's new value. + */ + value: Object; +} +/** + * A method that will handle the Exporting event. + */ +interface BootstrapUIWidgetExportingEventHandler { + /** + * A method that will handle the Exporting event. + * @param source The event source. + * @param e A BootstrapUIWidgetExportEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetExportEventArgs): void; +} +/** + * A method that will handle the FileSaving event. + */ +interface BootstrapUIWidgetFileSavingEventHandler { + /** + * A method that will handle the FileSaving event. + * @param source The event source. + * @param e A BootstrapUIWidgetExportEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetExportEventArgs): void; +} +/** + * Provides data for events related to saving files in the built-in dialogs. + */ +interface BootstrapUIWidgetExportEventArgs extends BootstrapUIWidgetEventArgsBase { + /** + * Allows you to cancel file saving. + * Value: true, to cancel the file saving; otherwise, false. + */ + cancel: boolean; + /** + * Gets the saved data as a BLOB object. + * Value: A BLOB object containing saved data. + */ + data: Object; + /** + * Gets a name of a saved file. + * Value: A string value specifying the saved file's name. + */ + fileName: string; + /** + * Gets the saved file's format. + * Value: A string value specifying the saved file's format. + */ + format: string; +} +/** + * A method that will handle the IncidentOccurred event. + */ +interface BootstrapUIWidgetErrorEventHandler { + /** + * A method that will handle the IncidentOccurred event. + * @param source The event source. + * @param e A BootstrapUIWidgetErrorEventArgs object that contains event data. + */ + (source: S, e: BootstrapUIWidgetErrorEventArgs): void; +} +/** + * Provides data for client events raised in response to widget errors. + */ +interface BootstrapUIWidgetErrorEventArgs extends BootstrapUIWidgetEventArgsBase { + /** + * Contains information on the error that occurred. + * Value: An object containing information on the error that occurred. + */ + target: Object; +} +/** + * Provides data for client events related to actions performed on the widget's visual elements. + */ +interface BootstrapUIWidgetElementActionEventArgs extends BootstrapUIWidgetEventArgsBase { + /** + * The DOM element that initiated the event. + * Value: An object that initiated the event. + */ + target: Object; +} +/** + * Provides data for the client-side clicking events. + */ +interface BootstrapUIWidgetElementClickEventArgs extends BootstrapUIWidgetElementActionEventArgs { + /** + * The jQuery event that caused the handler execution. + * Value: An object of the jQuery.Event type. + */ + jQueryEvent: Object; +} /** * A client-side counterpart of the Calendar and CalendarFor extensions. */ @@ -20343,7 +22960,7 @@ interface MVCxClientPopupControl extends ASPxClientPopupControl { */ PerformWindowCallback(window: ASPxClientPopupWindow, data: Object): void; /** - * + * Sends a callback with parameters to update the popup window by processing the related popup window. * @param window * @param parameter */ @@ -20849,6 +23466,27 @@ interface MVCxClientVerticalGrid extends ASPxClientVerticalGrid { */ interface MVCxClientWebDocumentViewer extends ASPxClientWebDocumentViewer { } +interface ANCxClientBeginCallbackEventHandler { + (source: S, e: ANCxClientBeginCallbackEventArgs): void; +} +/** + * Serves as the base class for arguments of the web controls' client-side events. + */ +interface ASPxClientEventArgs { +} +/** + * Provides data for client events related to the beginning of a callback processing round trip. + */ +interface ASPxClientBeginCallbackEventArgs extends ASPxClientEventArgs { + /** + * Gets a command name that identifies which client action forced a callback to be occurred. + * Value: A string value that represents the name of the command which initiated a callback. + */ + command: string; +} +interface ANCxClientBeginCallbackEventArgs extends ASPxClientBeginCallbackEventArgs { + customArgs: Object; +} /** * Serves as the base type for all the objects included in the client-side object model. */ @@ -20871,6 +23509,10 @@ interface ASPxClientControlBase { * @param message A String value that specifies a text. */ SendMessageToAssistiveTechnology(message: string): void; + /** + * Returns a client instance of the control that is the parent for a specified control. + */ + GetParentControl(): Object; /** * Returns a value specifying whether a control is displayed. */ @@ -20969,11 +23611,6 @@ interface ASPxClientCallbackCompleteEventHandler { */ (source: S, e: ASPxClientCallbackCompleteEventArgs): void; } -/** - * Serves as the base class for arguments of the web controls' client-side events. - */ -interface ASPxClientEventArgs { -} /** * Provides data for events concerning the final processing of a callback. */ @@ -21195,11 +23832,6 @@ interface ASPxClientProcessingModeCancelEventArgs extends ASPxClientProcessingMo */ interface KnockoutObservableBoolean { } -/** - * Provides access to observable arrays that allow you to detect and respond to changes in a collection of things. - */ -interface KnockoutObservableArray { -} /** * Represents a JavaScript function which receives callback data obtained via a call to a specific client method (such as the PerformDataCallback). */ @@ -21262,16 +23894,6 @@ interface ASPxClientBeginCallbackEventHandler { */ (source: S, e: ASPxClientBeginCallbackEventArgs): void; } -/** - * Provides data for client events related to the beginning of a callback processing round trip. - */ -interface ASPxClientBeginCallbackEventArgs extends ASPxClientEventArgs { - /** - * Gets a command name that identifies which client action forced a callback to be occurred. - * Value: A string value that represents the name of the command which initiated a callback. - */ - command: string; -} /** * A method that will handle the BeginCallback event. */ @@ -22478,6 +25100,10 @@ interface ASPxClientFileManagerItem { * @param skipRootFolder true, to skip the root folder; otherwise, false. */ GetFullName(separator: string, skipRootFolder: boolean): string; + /** + * Gets the current item's metadata. + */ + GetMetadata(): Object; } /** * Represents the client-side equivalent of the FileManagerFile object. @@ -23523,6 +26149,11 @@ interface ASPxClientHintOptions { * Value: true, to display a hint in a callout box; otherwise, false. */ showCallout: boolean; + /** + * Gets or sets a value that specifies whether a hint's title is displayed. + * Value: true, to display the hint's title; otherwise, false. + */ + showTitle: boolean; /** * Gets or sets where a hint should be positioned. * Value: A string value that specifies a hint position. @@ -24596,7 +27227,7 @@ interface ASPxClientPopupControl extends ASPxClientPopupControlBase { */ GetWindowPopUpReasonMouseEvent(window: ASPxClientPopupWindow): Object; /** - * + * Sends a callback with parameters to update the popup window by processing the related popup window. * @param window * @param parameter */ @@ -24749,6 +27380,103 @@ interface ASPxClientPopupControl extends ASPxClientPopupControlBase { * @param html A string value that represents the HTML code defining the content of the specified popup window. */ SetWindowContentHtml(window: ASPxClientPopupWindow, html: string): void; + /** + * Stretches the popup window in adaptive mode vertically to the full height of the browser window. + */ + StretchVertically(): void; + /** + * Stretches the specified popup window in adaptive mode vertically to the full height of the browser window. + * @param window A ASPxClientPopupWindow object representing the required popup window. + */ + WindowStretchVertically(window: ASPxClientPopupWindow): void; + /** + * Sets the minimum width of the popup window in adaptive mode. + * @param minWidth An integer value specifying the minimum width of the popup window in adaptive mode. + */ + SetAdaptiveMinWidth(minWidth: number): void; + /** + * Sets the minimum width of the popup window in adaptive mode. + * @param minWidth A string value specifying the minimum width of the popup window in adaptive mode as a percentage of the browser window inner width value. + */ + SetAdaptiveMinWidth(minWidth: string): void; + /** + * Sets the minimum width of the specified popup window in adaptive mode. + * @param window A ASPxClientPopupWindow object representing the required popup window. + * @param minWidth An integer value specifying the minimum width of the popup window in adaptive mode. + */ + SetWindowAdaptiveMinWidth(window: ASPxClientPopupWindow, minWidth: number): void; + /** + * Sets the minimum width of the specified popup window in adaptive mode. + * @param window A ASPxClientPopupWindow object representing the required popup window. + * @param minWidth An integer value specifying the minimum width of the popup window in adaptive mode as a percentage of the browser window inner width value. + */ + SetWindowAdaptiveMinWidth(window: ASPxClientPopupWindow, minWidth: string): void; + /** + * Sets the maximum width of the popup window in adaptive mode. + * @param maxWidth An integer value specifying the maximum width of the popup window in adaptive mode. + */ + SetAdaptiveMaxWidth(maxWidth: number): void; + /** + * Sets the maximum width of the popup window in adaptive mode. + * @param maxWidth A string value specifying the maximum width of the popup window in adaptive mode as a percentage of the browser window inner width value. + */ + SetAdaptiveMaxWidth(maxWidth: string): void; + /** + * Sets the maximum width of the specified popup window in adaptive mode. + * @param window A ASPxClientPopupWindow object representing the required popup window. + * @param maxWidth An integer value specifying the maximum width of the popup window in adaptive mode. + */ + SetWindowAdaptiveMaxWidth(window: ASPxClientPopupWindow, maxWidth: number): void; + /** + * Sets the maximum width of the specified popup window in adaptive mode. + * @param window A ASPxClientPopupWindow object representing the required popup window. + * @param maxWidth An integer value specifying the maximum width of the popup window in adaptive mode as a percentage of the browser window inner width value. + */ + SetWindowAdaptiveMaxWidth(window: ASPxClientPopupWindow, maxWidth: string): void; + /** + * Sets the minimum height of the popup window in adaptive mode. + * @param minHeight An integer value specifying the minimum height of the popup window in adaptive mode. + */ + SetAdaptiveMinHeight(minHeight: number): void; + /** + * Sets the minimum height of the popup window in adaptive mode. + * @param minHeight A string value specifying the minimum height of the popup window in adaptive mode as a percentage of the browser window inner height value. + */ + SetAdaptiveMinHeight(minHeight: string): void; + /** + * Sets the minimum height of the specified popup window in adaptive mode. + * @param window A ASPxClientPopupWindow object representing the required popup window. + * @param minHeight An integer value specifying the minimum height of the popup window in adaptive mode. + */ + SetWindowAdaptiveMinHeight(window: ASPxClientPopupWindow, minHeight: number): void; + /** + * Sets the minimum height of the specified popup window in adaptive mode. + * @param window A ASPxClientPopupWindow object representing the required popup window. + * @param minHeight An integer value specifying the minimum height of the popup window in adaptive mode as a percentage of the browser window inner height value. + */ + SetWindowAdaptiveMinHeight(window: ASPxClientPopupWindow, minHeight: string): void; + /** + * Sets the maximum height of the popup window in adaptive mode. + * @param maxHeight An integer value specifying the maximum height of the popup window in adaptive mode. + */ + SetAdaptiveMaxHeight(maxHeight: number): void; + /** + * Sets the maximum height of the popup window in adaptive mode. + * @param maxHeight A string value specifying the maximum height of the popup window in adaptive mode as a percentage of the browser window inner height value. + */ + SetAdaptiveMaxHeight(maxHeight: string): void; + /** + * Sets the maximum height of the specified popup window in adaptive mode. + * @param window A ASPxClientPopupWindow object representing the required popup window. + * @param maxHeight An integer value specifying the maximum height of the popup window in adaptive mode. + */ + SetWindowAdaptiveMaxHeight(window: ASPxClientPopupWindow, maxHeight: number): void; + /** + * Sets the maximum height of the specified popup window in adaptive mode. + * @param window A ASPxClientPopupWindow object representing the required popup window. + * @param maxHeight An integer value specifying the maximum height of the popup window in adaptive mode as a percentage of the browser window inner height value. + */ + SetWindowAdaptiveMaxHeight(window: ASPxClientPopupWindow, maxHeight: string): void; /** * Returns an iframe object containing a web page specified via the specified popup window's SetWindowContentUrl client method). * @param window A ASPxClientPopupWindow object representing the required popup window. @@ -28890,7 +31618,7 @@ interface ASPxClientDocumentViewer extends ASPxClientControl { */ EndCallback: ASPxClientEvent>; /** - * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientDocumentViewer. + * Fires on the client if any server error occurs during server-side processing of a callback sent by ASPxClientDocumentViewer. */ CallbackError: ASPxClientEvent>; /** @@ -29011,13 +31739,17 @@ interface ASPxClientQueryBuilder extends ASPxClientControl { */ EndCallback: ASPxClientEvent>; /** - * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientQueryBuilder. + * Fires on the client if any server error occurs during server-side processing of a callback sent by ASPxClientQueryBuilder. */ CallbackError: ASPxClientEvent>; /** * Enables you to customize the menu actions of a Query Builder. */ CustomizeToolbarActions: ASPxClientEvent>; + /** + * Enables you to customize the Query Builder's localization strings. + */ + CustomizeLocalization: ASPxClientEvent>; /** * Occurs when executing the Save command on the client. */ @@ -29034,7 +31766,7 @@ interface ASPxClientQueryBuilder extends ASPxClientControl { */ PerformCallback(arg: string, onSuccess: (arg1: string) => void): void; /** - * Updates the localization settings of the ASPxClientQueryBuilder properties. + * Updates the ASPxClientQueryBuilder properties' localization settings. * @param localization A dictionary containing the property names, along with their localized equivalents. */ UpdateLocalization(localization: { [key: string]: string; }): void; @@ -29091,6 +31823,16 @@ interface ASPxClientQueryBuilderCustomizeToolbarActionsEventHandler { */ (source: S, e: ASPxClientCustomizeMenuActionsEventArgs): void; } +/** + * A method that will handle the CustomizeLocalization event. + */ +interface ASPxClientQueryBuilderCustomizeLocalizationEventHandler { + /** + * A method that will handle the CustomizeLocalization event. + * @param source The event sender. + */ + (source: S): void; +} /** * The client-side equivalent of the Web Report Designer control. */ @@ -29104,7 +31846,7 @@ interface ASPxClientReportDesigner extends ASPxClientControl { */ EndCallback: ASPxClientEvent>; /** - * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientReportDesigner. + * Fires on the client if any server error occurs during server-side processing of a callback sent by ASPxClientReportDesigner. */ CallbackError: ASPxClientEvent>; /** @@ -29112,7 +31854,7 @@ interface ASPxClientReportDesigner extends ASPxClientControl { */ SaveCommandExecute: ASPxClientEvent>; /** - * Enables you to customize the menu actions of the Web Report Designer. + * Enables you to customize the Web Report Designer's menu actions. */ CustomizeMenuActions: ASPxClientEvent>; /** @@ -29143,6 +31885,14 @@ interface ASPxClientReportDesigner extends ASPxClientControl { * Occurs when a report has been opened in the Web Report Designer. */ ReportOpened: ASPxClientEvent>; + /** + * Occurs when a report tab is about to be closed in the Web Report Designer. + */ + ReportTabClosing: ASPxClientEvent>; + /** + * Occurs when a report tab was closed in the Web Report Designer. + */ + ReportTabClosed: ASPxClientEvent>; /** * Occurs on the client each time a server-side error raises. */ @@ -29152,7 +31902,7 @@ interface ASPxClientReportDesigner extends ASPxClientControl { */ ComponentAdded: ASPxClientEvent>; /** - * Enables you to customize UI elements of the Web Report Designer. + * Enables you to customize the Web Report Designer's UI elements. */ CustomizeElements: ASPxClientEvent>; /** @@ -29176,7 +31926,7 @@ interface ASPxClientReportDesigner extends ASPxClientControl { */ PreviewDocumentReady: ASPxClientEvent>; /** - * Occurs each time a value of an editing field changes in Print Preview. + * Occurs each time an editing field's value changes in Print Preview. */ PreviewEditingFieldChanged: ASPxClientEvent>; /** @@ -29188,17 +31938,25 @@ interface ASPxClientReportDesigner extends ASPxClientControl { */ PreviewCustomizeMenuActions: ASPxClientEvent>; /** - * Occurs when the left mouse button has been clicked over a report document in Print Preview. + * Occurs when the left mouse button is clicked on a report document in Print Preview. */ PreviewClick: ASPxClientEvent>; /** - * Occurs after report parameter values have been reset to their default values in Print Preview. + * Occurs after report parameter values are reset to their default values in Print Preview. */ PreviewParametersReset: ASPxClientEvent>; /** - * Occurs after report parameter values have been submitted in Print Preview. + * Occurs after report parameter values are submitted in Print Preview. */ PreviewParametersSubmitted: ASPxClientEvent>; + /** + * Enables you to customize the Web Report Designer's localization strings. + */ + CustomizeLocalization: ASPxClientEvent>; + /** + * Occurs before the Web Report Designer UI is initialized. + */ + BeforeRender: ASPxClientEvent>; /** * Sends a callback to the server with the specified argument. * @param arg A String value, specifying the callback argument. @@ -29211,18 +31969,18 @@ interface ASPxClientReportDesigner extends ASPxClientControl { */ PerformCallback(arg: string, onSuccess: (arg1: string) => void): void; /** - * Updates the localization settings of the ASPxClientReportDesigner properties. + * Updates the Report Designer properties' localization settings. * @param localization A dictionary containing the property names, along with their localized equivalents. */ UpdateLocalization(localization: { [key: string]: string; }): void; /** - * Returns the object model of a Web Report Designer. + * Provides access to a client-side model of a Web Report Designer. */ GetDesignerModel(): Object; /** - * Provides access to the preview model of the ASPxClientReportDesigner. + * Provides access to the Document Viewer's client-side model. */ - GetPreviewModel(): Object; + GetPreviewModel(): ASPxClientSidePreviewModel; /** * Returns information about the specified property of the specified control. * @param controlType A string that specifies the control type. @@ -29313,7 +32071,7 @@ interface ASPxClientReportDesigner extends ASPxClientControl { */ ReportStorageGetUrls(): any; /** - * Opens the specified report on the client side of the Web Report Designer. + * Opens the specified report on the Web Report Designer's client side. * @param url A string that specifies the URL of a report to be opened. */ OpenReport(url: string): void; @@ -29362,12 +32120,42 @@ interface ASPxClientReportDesignerDialogEventArgs extends ASPxClientEventArgs { * Value: An object that specifies the report currently being processed. */ Report: Object; +} +/** + * Provides data for the events related to opening and saving reports in the Web Report Designer. + */ +interface ASPxClientReportDesignerDialogCancelEventArgs extends ASPxClientReportDesignerDialogEventArgs { /** * Specifies whether or not the operation performed with a report should be canceled. * Value: true, if the operation should be canceled; otherwise, false. */ Cancel: boolean; } +/** + * Provides data for the ReportTabClosed event. + */ +interface ASPxClientReportDesignerTabEventArgs extends ASPxClientEventArgs { + /** + * Specifies the report tab currently being processed. + * Value: An object that specifies the report tab currently being processed. + */ + Tab: ASPxDesignerNavigateTab; +} +/** + * Provides data for the ReportTabClosing event. + */ +interface ASPxClientReportDesignerTabClosingEventArgs extends ASPxClientReportDesignerTabEventArgs { + /** + * Specifies whether or not the event was handled. + * Value: true, if the event was handled and no other processing should occur; otherwise, false. + */ + Handled: boolean; + /** + * Specifies the JQueryDeferred object, which when resolved, forces the report tab to be closed. + * Value: A JQueryDeferred object. + */ + ReadyToClose: JQueryDeferred; +} /** * Provides data for the OnServerError event. */ @@ -29513,9 +32301,9 @@ interface ASPxClientReportDesignerReportSavingEventHandler { /** * A method that will handle the ReportSaving event. * @param source The event sender. - * @param e An ASPxClientReportDesignerDialogEventArgs object that contains data related to the event. + * @param e An ASPxClientReportDesignerDialogCancelEventArgs object that contains data related to the event. */ - (source: S, e: ASPxClientReportDesignerDialogEventArgs): void; + (source: S, e: ASPxClientReportDesignerDialogCancelEventArgs): void; } /** * A method that will handle the ReportSaved event. @@ -29535,9 +32323,9 @@ interface ASPxClientReportDesignerReportOpeningEventHandler { /** * A method that will handle the ReportOpening event. * @param source The event sender. - * @param e An ASPxClientReportDesignerDialogEventArgs object that contains data related to the event. + * @param e An ASPxClientReportDesignerDialogCancelEventArgs object that contains data related to the event. */ - (source: S, e: ASPxClientReportDesignerDialogEventArgs): void; + (source: S, e: ASPxClientReportDesignerDialogCancelEventArgs): void; } /** * A method that will handle the ReportOpened event. @@ -29550,6 +32338,28 @@ interface ASPxClientReportDesignerReportOpenedEventHandler { */ (source: S, e: ASPxClientReportDesignerDialogEventArgs): void; } +/** + * A method that will handle the ReportTabClosing event. + */ +interface ASPxClientReportDesignerReportTabClosingEventHandler { + /** + * A method that will handle the ReportTabClosing event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerTabClosingEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerTabClosingEventArgs): void; +} +/** + * A method that will handle the ReportTabClosed event. + */ +interface ASPxClientReportDesignerReportTabClosedEventHandler { + /** + * A method that will handle the ReportTabClosed event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerTabEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerTabEventArgs): void; +} /** * A method that will handle the OnServerError event. */ @@ -29616,6 +32426,27 @@ interface ASPxClientReportDesignerCustomizeToolboxEventHandler { */ (source: S, e: ASPxClientReportDesignerCustomizeToolboxEventArgs): void; } +/** + * A method that will handle the CustomizeLocalization event. + */ +interface ASPxClientReportDesignerCustomizeLocalizationEventHandler { + /** + * A method that will handle the CustomizeLocalization event. + * @param source The event sender. + */ + (source: S): void; +} +/** + * A method that will handle the BeforeRender event. + */ +interface ASPxClientReportDesignerBeforeRenderEventHandler { + /** + * A method that will handle the BeforeRender event. + * @param source The event sender. + * @param designerModel A client-side Report Designer model. + */ + (source: S, designerModel: Object): void; +} /** * Provides information about a value editor used in the Property Grid. */ @@ -29994,7 +32825,7 @@ interface ASPxClientReportViewer extends ASPxClientControl { */ EndCallback: ASPxClientEvent>; /** - * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientReportViewer. + * Fires on the client if any server error occurs during server-side processing of a callback sent by ASPxClientReportViewer. */ CallbackError: ASPxClientEvent>; /** @@ -30147,10 +32978,10 @@ interface ASPxClientMenuAction { */ hotKey: ASPxClientMenuActionHotKey; /** - * Provides access to the value that specifies whether or not the command has a visual separator. + * Specifies whether or not the command has a visual separator. * Value: true, if the command has a visual separator; otherwise, false. */ - hasSeparator: string; + hasSeparator: boolean; /** * Provides access to a value that specifies the command location. * Value: A string that specifies the command location. @@ -30505,6 +33336,11 @@ interface ASPxClientPreviewClickEventArgs extends ASPxClientEventArgs { * Returns a string providing additional information on the Brick. */ GetBrickValue(): string; + /** + * Returns a string providing additional information about the current Brick by the specified key. + * @param key A string that specifies a unique key. + */ + GetBrickValue(key: string): string; } /** * Provides information about a visual brick used to render a report control to construct a document in the Web Document Viewer. @@ -30571,19 +33407,19 @@ interface ASPxClientWebDocumentViewerBrickNavigation { */ interface ASPxClientWebDocumentViewer extends ASPxClientControl { /** - * Occurs after a report document has been loaded to the Web Document Viewer. + * Occurs after the Web Document Viewer loads a report document. */ DocumentReady: ASPxClientEvent>; /** - * Occurs each time a value of an editing field changes. + * Occurs each time an editing field's value changes. */ EditingFieldChanged: ASPxClientEvent>; /** - * Enables you to customize UI elements of the Web Document Viewer. + * Allows you to customize the Web Document Viewer's UI elements. */ CustomizeElements: ASPxClientEvent>; /** - * Enables you to customize the menu actions of a Web Document Viewer. + * Enables you to customize the Web Document Viewer's menu actions. */ CustomizeMenuActions: ASPxClientEvent>; /** @@ -30595,27 +33431,44 @@ interface ASPxClientWebDocumentViewer extends ASPxClientControl { */ CustomizeParameterLookUpSource: ASPxClientEvent>; /** - * Occurs when the left mouse button has been clicked over a report document. + * Occurs when the left mouse button is clicked on a report document. */ PreviewClick: ASPxClientEvent>; /** - * Occurs after report parameter values have been reset to their default values. + * Occurs after report parameter values are reset to their default values. */ ParametersReset: ASPxClientEvent>; /** - * Occurs after report parameter values have been submitted. + * Occurs after report parameter values are submitted. */ ParametersSubmitted: ASPxClientEvent>; /** - * Provides access to the preview model of the ASPxClientWebDocumentViewer. + * Enables you to customize the Web Document Viewer's localization strings. */ - GetPreviewModel(): Object; + CustomizeLocalization: ASPxClientEvent>; /** - * Returns a model for a report parameter. + * Occurs before the Web Document Viewer UI is initialized. */ - GetParametersModel(): Object; + BeforeRender: ASPxClientEvent>; /** - * Opens the specified report on the client side of the Web Document Viewer. + * Provides access to the Document Viewer's client-side model. + */ + GetPreviewModel(): ASPxClientSidePreviewModel; + /** + * Provides access to the report preview. + */ + GetReportPreview(): ASPxClientReportPreview; + /** + * Provide access to the report parameters' client-side model. + */ + GetParametersModel(): ASPxClientSideParametersModel; + /** + * Enables navigation between drill-through reports on the client-side. + * @param customData Provides access to custom client data associated with a currently previewed report. + */ + DrillThrough(customData: string): any; + /** + * Opens the specified report on the Web Document Viewer's client side. * @param url A string that specifies the URL of a report to be opened. */ OpenReport(url: string): any; @@ -30644,7 +33497,7 @@ interface ASPxClientWebDocumentViewer extends ASPxClientControl { */ ExportTo(format: string, inlineResult: boolean): void; /** - * Returns the zero-based index of the currently displayed page. + * Returns the current page's zero-based index. */ GetCurrentPageIndex(): number; /** @@ -30653,11 +33506,11 @@ interface ASPxClientWebDocumentViewer extends ASPxClientControl { */ GoToPage(pageIndex: number): void; /** - * Closes the document currently being opened in the Web Document Viewer. + * Closes the document which is currently opened in the Web Document Viewer. */ Close(): void; /** - * Resets the values of report parameters to their default values. + * Resets the report parameter values to the default values. */ ResetParameters(): void; /** @@ -30665,7 +33518,22 @@ interface ASPxClientWebDocumentViewer extends ASPxClientControl { */ StartBuild(): void; /** - * Updates the localization settings of the ASPxClientWebDocumentViewer properties. + * Performs a custom operation with a currently opened document on the client side. + */ + PerformCustomDocumentOperation(): any; + /** + * Performs a custom operation with a currently opened document on the client-side. + * @param customData Provides access to custom client data associated with a target document operation. + */ + PerformCustomDocumentOperation(customData: string): any; + /** + * Performs a custom operation with a currently opened document on the client-side. + * @param customData Provides access to custom client data associated with a target document operation. + * @param hideMessageFromUser true, to hide a message with the operation result from a user; otherwise, false. + */ + PerformCustomDocumentOperation(customData: string, hideMessageFromUser: boolean): any; + /** + * Updates the Web Document Viewer properties' localization settings. * @param localization A dictionary containing the property names, along with their localized equivalents. */ UpdateLocalization(localization: { [key: string]: string; }): void; @@ -30769,6 +33637,219 @@ interface ASPxClientWebDocumentViewerParametersSubmittedEventHandler { */ (source: S, e: ASPxClientParametersSubmittedEventArgs): void; } +/** + * A method that will handle the CustomizeLocalization event. + */ +interface ASPxClientWebDocumentViewerCustomizeLocalizationEventHandler { + /** + * A method that will handle the CustomizeLocalization event. + * @param source The event sender. + */ + (source: S): void; +} +/** + * A method that will handle the BeforeRender event. + */ +interface ASPxClientWebDocumentViewerBeforeRenderEventHandler { + /** + * A method that will handle the BeforeRender event. + * @param source The event sender. + * @param previewModel A client-side Document Viewer model. + */ + (source: S, previewModel: Object): void; +} +/** + * Provides information about the result of preforming a custom document operation on the client side. + */ +interface ASPxClientWebDocumentViewerDocumentOperationResponse { + /** + * Specifies whether a document operation has been successfully performed. + * Value: true, if the document operation has been successfully performed; otherwise, false. + */ + succeeded: boolean; + /** + * Specifies the error message to display if performing a document operation fails. + * Value: A string specifying the text of the error message. + */ + message: string; + /** + * Specifies custom data associated with the performed document operation. + * Value: A string containing information associated with the document operation. + */ + customData: string; + /** + * Specifies the document ID. + * Value: A string that specifies the document ID. + */ + documentId: string; +} +/** + * Provides information a client-side Document Preview model. + */ +interface ASPxClientSidePreviewModel { + /** + * Provides access to the report preview. + * Value: An object that specifies the report preview. + */ + reportPreview: ASPxClientReportPreview; + /** + * Provides access to a panel at the right of the Document Viewer. + * Value: An object that specifies the panel at the right of the Document Viewer. + */ + tabPanel: ASPxClientDocumentPreviewTabPanel; + /** + * Opens the specified report on the Web Document Viewer's client side. + * @param url A string that specifies the URL of a report to be opened. + */ + OpenReport(url: string): any; + /** + * Prints the current document. + */ + Print(): void; + /** + * Prints the document's page with the specified index. + * @param pageIndex An index of the page to be printed. + */ + Print(pageIndex: number): void; + /** + * Exports the document to a PDF file. + */ + ExportTo(): void; + /** + * Exports the document to a specified file format. + * @param format A String value, specifying the export format. The following formats are currently supported: 'csv', 'html', 'image', 'mht', 'pdf', 'rtf', 'docx', 'txt', 'xls', and 'xlsx'. + */ + ExportTo(format: string): void; + /** + * Exports the document to a specified file format. + * @param format A String value that specifies the export format. The following formats are currently supported: 'csv', 'html', 'image', 'mht', 'pdf', 'rtf', 'docx', 'txt', 'xls', and 'xlsx'. + * @param inlineResult true, to try opening the result file in a new browser tab without a download; otherwise, false. + */ + ExportTo(format: string, inlineResult: boolean): void; + /** + * Returns the current page's zero-based index. + */ + GetCurrentPageIndex(): number; + /** + * Displays the report page with the specified page index. + * @param pageIndex A zero-based integer value that specifies the index of a page to be displayed. + */ + GoToPage(pageIndex: number): void; + /** + * Closes the document which is currently opened in the Web Document Viewer. + */ + Close(): void; + /** + * Resets the report parameter values to the default values. + */ + ResetParameters(): void; + /** + * Starts building a report document. + */ + StartBuild(): void; + /** + * Provide access to the report parameters' client-side model. + */ + GetParametersModel(): ASPxClientSideParametersModel; +} +/** + * Provides information about the Document Viewer's tab panel. + */ +interface ASPxClientDocumentPreviewTabPanel { + /** + * Specifies the width of the panel at the right of the Document Viewer. + * Value: A knockout observable object that specifies the tab panel width. + */ + width: any; + /** + * Specifies whether the panel at the right of the Document Viewer is collapsed. + * Value: A knockout observable object that specifies whether the tab panel is collapsed. + */ + collapsed: any; + /** + * Provides access to the tabs of the panel at the right of the Document Viewer. + * Value: A collection of ASPxClientDocumentPreviewTab objects. + */ + tabs: ASPxClientDocumentPreviewTab[]; +} +/** + * Provides information about a tab available in the Document Viewer. + */ +interface ASPxClientDocumentPreviewTab { + /** + * Provides access to the name of an HTML template used by a tab. + * Value: A knockout observable string that specifies the name of the HTML template used by the tab. + */ + template: string; + /** + * Provides access to the tab text. + * Value: A string that specifies the tab text. + */ + text: string; + /** + * Provides access to a tab model. + * Value: An object that specifies the tab model. + */ + model: Object; + /** + * Provides access to the value that specifies whether a tab is active. + * Value: A knockout observable object that specifies whether the tab is active. + */ + active: any; + /** + * Provides access to the value that specifies whether a tab is visible. + * Value: A knockout observable object that specifies whether the tab is visible. + */ + visible: any; +} +/** + * Provides information about the report parameters' client-side model. + */ +interface ASPxClientSideParametersModel { + /** + * Provides information about the tab for specifying parameter values. + * Value: An object that provides information about the Parameters tab. + */ + tabInfo: ASPxClientDocumentPreviewTab; + /** + * Initiates passing parameter values and generating the report document. + */ + submit(): void; + /** + * Serializes report parameters before passing them to the server. + */ + serializeParameters(): void; +} +/** + * Provides information about a report preview. + */ +interface ASPxClientReportPreview { + /** + * Zooms the Document Viewer's current document. + * Value: A knockout observable object that specifies the zoom factor. + */ + zoom: any; + /** + * Enables the Document Viewer's multi-page mode. + * Value: A knockout observable object that specifies whether the multi-page mode is enabled. + */ + showMultipagePreview: any; + /** + * Provides access to the current document page's index. + * Value: A knockout observable object that specifies the zero-based index of the current page. + */ + pageIndex: any; + /** + * Provides access to document pages. + * Value: An array of objects that specify document pages. + */ + pages: any; + /** + * Provides access to a value that specifies whether the document is currently building. + * Value: A knockout observable object that specifies whether the document is building. + */ + documentBuilding: any; +} interface MVCxClientDashboardViewerStatic extends ASPxClientDashboardViewerStatic { } @@ -30812,7 +33893,7 @@ interface DashboardSpecialValuesStatic { */ OthersValue: string; /** - * Represents an error value for calculated fields. + * Represents an error value (for instance, this can be a calculated field value that cannot be evaluated). */ ErrorValue: string; /** @@ -30890,6 +33971,20 @@ interface DashboardExportScaleModeStatic { */ AutoFitWithinOnePage: string; } +interface DashboardExportDocumentScaleModeStatic { + /** + * The dashboard / dashboard item on the exported page retains its original size. + */ + None: string; + /** + * The size of the dashboard / dashboard item on the exported page is changed according to the scale factor value (ScaleFactor). + */ + UseScaleFactor: string; + /** + * The size of the dashboard / dashboard item is changed according to the width of the exported pages. + */ + AutoFitToPagesWidth: string; +} interface DashboardExportFilterStateStatic { /** * The filter state is not included in the exported document. @@ -31156,6 +34251,18 @@ interface ASPxClientEditStatic extends ASPxClientEditBaseStatic { * Verifies whether visible editors on a page are valid. */ AreEditorsValid(): boolean; + /** + * Attaches a handler to the ASPxClientEdit's event indicating whether the editor has been changed since the previous state. + * @param handler An object representing a handler. + * @param predicate An ASPxClientControlPredicate object representing the predicate criteria. + */ + AttachEditorModificationListener(handler: Object, predicate: ASPxClientControlPredicate): void; + /** + * Detaches a handler from the editor's event if the editor meets the predicate criteria. + * @param handler An object representing a handler. + * @param predicate An ASPxClientControlPredicate object representing a predicate criteria. + */ + DetachEditorModificationListener(handler: Object, predicate: ASPxClientControlPredicate): void; } interface ASPxClientBinaryImageStatic extends ASPxClientEditStatic { /** @@ -31538,11 +34645,41 @@ interface ASPxClientGridViewCallbackCommandStatic { * Default value: "TOOLBAR" */ Toolbar: string; + /** + * Default value: "EXPORT" + */ + Export: string; /** * Default value: "CUSTOMVALUES" */ CustomValues: string; } +interface ASPxClientGridExportFormatStatic { + /** + * Identifies Portable Document Format (.pdf). + */ + Pdf: string; + /** + * Identifies DOCX format (.docx). + */ + Docx: string; + /** + * Identifies Rich Text Format (.rtf). + */ + Rtf: string; + /** + * Identifies Comma Separated Values format (.csv). + */ + Csv: string; + /** + * Identifies Excel Binary File format (.xls). + */ + Xls: string; + /** + * Identifies XML spreadsheet file format (.xlsx). + */ + Xlsx: string; +} interface ASPxClientGridLookupStatic extends ASPxClientDropDownEditBaseStatic { /** * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. @@ -31557,6 +34694,8 @@ interface ASPxClientCardViewStatic extends ASPxClientGridBaseStatic { */ Cast(obj: Object): ASPxClientCardView; } +interface ASPxClientCardViewExportFormatStatic extends ASPxClientGridExportFormatStatic { +} interface ASPxClientGridViewStatic extends ASPxClientGridBaseStatic { /** * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. @@ -31564,6 +34703,8 @@ interface ASPxClientGridViewStatic extends ASPxClientGridBaseStatic { */ Cast(obj: Object): ASPxClientGridView; } +interface ASPxClientGridViewExportFormatStatic extends ASPxClientGridExportFormatStatic { +} interface ASPxClientVerticalGridStatic extends ASPxClientGridBaseStatic { /** * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. @@ -31577,6 +34718,8 @@ interface ASPxClientVerticalGridCallbackCommandStatic { */ ExpandRow: string; } +interface ASPxClientVerticalGridExportFormatStatic extends ASPxClientGridExportFormatStatic { +} interface ASPxClientCommandConstsStatic { /** * Identifies a command that shows a search panel. @@ -32106,6 +35249,27 @@ interface ASPxClientHtmlEditorStatic extends ASPxClientControlStatic { * @param data An object representing custom data associated with a custom dialog. */ CustomDialogComplete(status: Object, data: Object): void; + /** + * Highlights the text. + * @param text A string value specifying the text to be highlighted. + * @param searchContainer An object specifying the container where the specified text should be searched. + */ + HighlightText(text: string, searchContainer: Object): void; + /** + * Highlights the text with the specified settings. + * @param text A string value specifying the text to be highlighted. + * @param searchContainer An object specifying the container where the specified text should be searched. + * @param className A string value specifying the text color. + */ + HighlightText(text: string, searchContainer: Object, className: string): void; + /** + * Highlights the text with the specified text color and background color. + * @param text A string value specifying the text to be highlighted. + * @param searchContainer An object specifying the container where the specified text should be searched. + * @param color A string value specifying the text color. + * @param backgroundColor A string value specifying the background color. + */ + HighlightText(text: string, searchContainer: Object, color: string, backgroundColor: string): void; } interface ASPxClientHtmlEditorMediaPreloadModeStatic { /** @@ -32229,6 +35393,28 @@ interface ASPxClientTreeListStatic extends ASPxClientControlStatic { */ Cast(obj: Object): ASPxClientTreeList; } +interface ASPxClientTreeListExportFormatStatic { + /** + * Identifies Portable Document Format (.pdf). + */ + Pdf: string; + /** + * Identifies DOCX format (.docx). + */ + Docx: string; + /** + * Identifies Rich Text Format (.rtf). + */ + Rtf: string; + /** + * Identifies Excel Binary File format (.xls). + */ + Xls: string; + /** + * Identifies XML spreadsheet file format (.xlsx). + */ + Xlsx: string; +} interface BootstrapClientAccordionStatic extends ASPxClientNavBarStatic { } interface BootstrapClientBinaryImageStatic extends ASPxClientHyperLinkStatic { @@ -32239,14 +35425,6 @@ interface BootstrapClientCalendarStatic extends ASPxClientCalendarStatic { } interface BootstrapClientCallbackPanelStatic extends ASPxClientControlStatic { } -interface BootstrapClientChartBaseStatic extends ASPxClientControlStatic { -} -interface BootstrapClientChartStatic extends BootstrapClientChartBaseStatic { -} -interface BootstrapClientPolarChartStatic extends BootstrapClientChartBaseStatic { -} -interface BootstrapClientPieChartStatic extends BootstrapClientChartBaseStatic { -} interface BootstrapClientCheckBoxStatic extends ASPxClientEditStatic { } interface BootstrapClientRadioButtonStatic extends BootstrapClientCheckBoxStatic { @@ -32281,24 +35459,45 @@ interface BootstrapClientProgressBarStatic extends ASPxClientProgressBarStatic { } interface BootstrapClientSpinEditStatic extends ASPxClientSpinEditStatic { } +interface BootstrapClientTimeEditStatic extends ASPxClientTimeEditStatic { +} interface BootstrapClientTabControlStatic extends ASPxClientTabControlStatic { } interface BootstrapClientPageControlStatic extends ASPxClientPageControlStatic { } +interface BootstrapClientTagBoxStatic extends ASPxClientTokenBoxStatic { +} interface BootstrapClientTextBoxStatic extends ASPxClientTextBoxStatic { } interface BootstrapClientMemoStatic extends ASPxClientMemoStatic { } interface BootstrapClientButtonEditStatic extends ASPxClientButtonEditStatic { } -interface BootstrapClientTreeViewStatic extends ASPxClientTreeViewStatic { +interface BootstrapClientToolbarStatic extends BootstrapClientMenuStatic { } -interface BootstrapUIWidgetBaseStatic extends ASPxClientControlStatic { +interface BootstrapClientTreeViewStatic extends ASPxClientTreeViewStatic { } interface BootstrapClientUploadControlStatic extends ASPxClientUploadControlStatic { } +interface BootstrapClientUtilsStatic { + UpdateDefaultStyles(): void; +} interface BootstrapClientGridViewStatic extends ASPxClientGridViewStatic { } +interface BootstrapClientCardViewStatic extends ASPxClientGridViewStatic { +} +interface BootstrapUIWidgetBaseStatic extends ASPxClientControlStatic { +} +interface BootstrapClientChartBaseStatic extends BootstrapUIWidgetBaseStatic { +} +interface BootstrapClientChartStatic extends BootstrapClientChartBaseStatic { +} +interface BootstrapClientPolarChartStatic extends BootstrapClientChartBaseStatic { +} +interface BootstrapClientPieChartStatic extends BootstrapClientChartBaseStatic { +} +interface BootstrapClientRangeSelectorStatic extends BootstrapUIWidgetBaseStatic { +} interface MVCxClientCalendarStatic extends ASPxClientCalendarStatic { /** * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. @@ -32728,6 +35927,28 @@ interface ASPxClientFileManagerErrorConstsStatic { */ AlreadyExists: number; } +interface ASPxClientFileManagerCallbackCommandStatic { + GetAllItems: string; + GetFileList: string; + Refresh: string; + DeleteItems: string; + MoveItems: string; + CopyItems: string; + RenameItem: string; + Download: string; + ShowFolderBrowserDialog: string; + ShowCreateFolderEditorInTreeView: string; + CreateFolder: string; + SelectedFileOpened: string; + FoldersTreeView: string; + FolderBrowserTreeView: string; + GridView: string; + ChangeFolder: string; + ChangeFolderInTreeView: string; + CustomCallback: string; + VirtualScrolling: string; + GridViewVirtualScrolling: string; +} interface ASPxClientFormLayoutStatic extends ASPxClientControlStatic { /** * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. @@ -33384,10 +36605,10 @@ interface ASPxClientUtilsStatic { DeleteCookie(name: string): void; /** * Returns a specifically generated code that uniquely identifies the combination of keys specified via the parameters. - * @param keyCode An integer value that specifies the code of the key. - * @param isCtrlKey true if the CTRL key should be included into the key combination; otherwise, false. - * @param isShiftKey true if the SHIFT key should be included into the key combination; otherwise, false. - * @param isAltKey true if the ALT key should be included into the key combination; otherwise, false. + * @param keyCode An integer value that specifies the code of the key. Codes are available via the ASPx.KeyCode client object's members. + * @param isCtrlKey true, if the CTRL key should be included into the key combination; otherwise, false. + * @param isShiftKey true, if the SHIFT key should be included into the key combination; otherwise, false. + * @param isAltKey true, if the ALT key should be included into the key combination; otherwise, false. */ GetShortcutCode(keyCode: number, isCtrlKey: boolean, isShiftKey: boolean, isAltKey: boolean): number; /** @@ -33415,6 +36636,17 @@ interface ASPxClientUtilsStatic { * @param str A string value representing the string for trimming. */ TrimEnd(str: string): string; + /** + * Returns values of editors located in the specified container. + * @param containerOrId A container of editors, or its ID. + */ + GetEditorValuesInContainer(containerOrId: Object): Object; + /** + * Returns values of editors located in the specified container. + * @param containerOrId A container of editors, or its ID. + * @param processInvisibleEditors true to process both visible and invisible editors that belong to the specified container; false to process only visible editors. + */ + GetEditorValuesInContainer(containerOrId: Object, processInvisibleEditors: boolean): Object; /** * Specifies the text that Assistive Technologies (screen readers or braille display, for example) will provide to a user. * @param message A String value that specifies a text. @@ -33488,6 +36720,7 @@ declare var DashboardSpecialValues: DashboardSpecialValuesStatic; declare var DashboardExportPageLayout: DashboardExportPageLayoutStatic; declare var DashboardExportPaperKind: DashboardExportPaperKindStatic; declare var DashboardExportScaleMode: DashboardExportScaleModeStatic; +declare var DashboardExportDocumentScaleMode: DashboardExportDocumentScaleModeStatic; declare var DashboardExportFilterState: DashboardExportFilterStateStatic; declare var DashboardStateExportPosition: DashboardStateExportPositionStatic; declare var DashboardStateExcelExportPosition: DashboardStateExcelExportPositionStatic; @@ -33541,11 +36774,15 @@ declare var ASPxClientValidationSummary: ASPxClientValidationSummaryStatic; declare var ASPxClientGaugeControl: ASPxClientGaugeControlStatic; declare var ASPxClientGridBase: ASPxClientGridBaseStatic; declare var ASPxClientGridViewCallbackCommand: ASPxClientGridViewCallbackCommandStatic; +declare var ASPxClientGridExportFormat: ASPxClientGridExportFormatStatic; declare var ASPxClientGridLookup: ASPxClientGridLookupStatic; declare var ASPxClientCardView: ASPxClientCardViewStatic; +declare var ASPxClientCardViewExportFormat: ASPxClientCardViewExportFormatStatic; declare var ASPxClientGridView: ASPxClientGridViewStatic; +declare var ASPxClientGridViewExportFormat: ASPxClientGridViewExportFormatStatic; declare var ASPxClientVerticalGrid: ASPxClientVerticalGridStatic; declare var ASPxClientVerticalGridCallbackCommand: ASPxClientVerticalGridCallbackCommandStatic; +declare var ASPxClientVerticalGridExportFormat: ASPxClientVerticalGridExportFormatStatic; declare var ASPxClientCommandConsts: ASPxClientCommandConstsStatic; declare var ASPxClientHtmlEditor: ASPxClientHtmlEditorStatic; declare var ASPxClientHtmlEditorMediaPreloadMode: ASPxClientHtmlEditorMediaPreloadModeStatic; @@ -33567,15 +36804,12 @@ declare var ASPxClientSpellChecker: ASPxClientSpellCheckerStatic; declare var ASPxClientSpellCheckerStopCheckingReason: ASPxClientSpellCheckerStopCheckingReasonStatic; declare var ASPxClientSpreadsheet: ASPxClientSpreadsheetStatic; declare var ASPxClientTreeList: ASPxClientTreeListStatic; +declare var ASPxClientTreeListExportFormat: ASPxClientTreeListExportFormatStatic; declare var BootstrapClientAccordion: BootstrapClientAccordionStatic; declare var BootstrapClientBinaryImage: BootstrapClientBinaryImageStatic; declare var BootstrapClientButton: BootstrapClientButtonStatic; declare var BootstrapClientCalendar: BootstrapClientCalendarStatic; declare var BootstrapClientCallbackPanel: BootstrapClientCallbackPanelStatic; -declare var BootstrapClientChartBase: BootstrapClientChartBaseStatic; -declare var BootstrapClientChart: BootstrapClientChartStatic; -declare var BootstrapClientPolarChart: BootstrapClientPolarChartStatic; -declare var BootstrapClientPieChart: BootstrapClientPieChartStatic; declare var BootstrapClientCheckBox: BootstrapClientCheckBoxStatic; declare var BootstrapClientRadioButton: BootstrapClientRadioButtonStatic; declare var BootstrapClientComboBox: BootstrapClientComboBoxStatic; @@ -33593,15 +36827,25 @@ declare var BootstrapClientPopupControl: BootstrapClientPopupControlStatic; declare var BootstrapClientPopupMenu: BootstrapClientPopupMenuStatic; declare var BootstrapClientProgressBar: BootstrapClientProgressBarStatic; declare var BootstrapClientSpinEdit: BootstrapClientSpinEditStatic; +declare var BootstrapClientTimeEdit: BootstrapClientTimeEditStatic; declare var BootstrapClientTabControl: BootstrapClientTabControlStatic; declare var BootstrapClientPageControl: BootstrapClientPageControlStatic; +declare var BootstrapClientTagBox: BootstrapClientTagBoxStatic; declare var BootstrapClientTextBox: BootstrapClientTextBoxStatic; declare var BootstrapClientMemo: BootstrapClientMemoStatic; declare var BootstrapClientButtonEdit: BootstrapClientButtonEditStatic; +declare var BootstrapClientToolbar: BootstrapClientToolbarStatic; declare var BootstrapClientTreeView: BootstrapClientTreeViewStatic; -declare var BootstrapUIWidgetBase: BootstrapUIWidgetBaseStatic; declare var BootstrapClientUploadControl: BootstrapClientUploadControlStatic; +declare var BootstrapClientUtils: BootstrapClientUtilsStatic; declare var BootstrapClientGridView: BootstrapClientGridViewStatic; +declare var BootstrapClientCardView: BootstrapClientCardViewStatic; +declare var BootstrapUIWidgetBase: BootstrapUIWidgetBaseStatic; +declare var BootstrapClientChartBase: BootstrapClientChartBaseStatic; +declare var BootstrapClientChart: BootstrapClientChartStatic; +declare var BootstrapClientPolarChart: BootstrapClientPolarChartStatic; +declare var BootstrapClientPieChart: BootstrapClientPieChartStatic; +declare var BootstrapClientRangeSelector: BootstrapClientRangeSelectorStatic; declare var MVCxClientCalendar: MVCxClientCalendarStatic; declare var MVCxClientCallbackPanel: MVCxClientCallbackPanelStatic; declare var MVCxClientCardView: MVCxClientCardViewStatic; @@ -33651,6 +36895,7 @@ declare var ASPxClientDockZone: ASPxClientDockZoneStatic; declare var ASPxClientFileManager: ASPxClientFileManagerStatic; declare var ASPxClientFileManagerCommandConsts: ASPxClientFileManagerCommandConstsStatic; declare var ASPxClientFileManagerErrorConsts: ASPxClientFileManagerErrorConstsStatic; +declare var ASPxClientFileManagerCallbackCommand: ASPxClientFileManagerCallbackCommandStatic; declare var ASPxClientFormLayout: ASPxClientFormLayoutStatic; declare var ASPxClientHiddenField: ASPxClientHiddenFieldStatic; declare var ASPxClientHint: ASPxClientHintStatic; diff --git a/types/devexpress-web/v171/devexpress-web-tests.ts b/types/devexpress-web/v171/devexpress-web-tests.ts new file mode 100644 index 0000000000..ef7eb8de37 --- /dev/null +++ b/types/devexpress-web/v171/devexpress-web-tests.ts @@ -0,0 +1,418 @@ +declare var hiddenField: ASPxClientHiddenField; +declare var mainCallbackPanel: ASPxClientCallbackPanel; +declare var loginPopup: ASPxClientPopupControl; +declare var searchButton: ASPxClientButton; +declare var searchComboBox: ASPxClientComboBox; +declare var roomsNumberSpinEdit: ASPxClientSpinEdit; +declare var adultsNumberSpinEdit: ASPxClientSpinEdit; +declare var childrenNumberSpinEdit: ASPxClientSpinEdit; +declare var checkInDateEdit: ASPxClientDateEdit; +declare var checkOutDateEdit: ASPxClientDateEdit; +declare var backSlider: ASPxClientImageSlider; +declare var locationComboBox: ASPxClientComboBox; +declare var nightyRateTrackBar: ASPxClientTrackBar; +declare var customerRatingTrackBar: ASPxClientTrackBar; +declare var ourRatingCheckBoxList: ASPxClientCheckBoxList; +declare var startFilterPopupControl: ASPxClientPopupControl; +declare var imagePopupControl: ASPxClientPopupControl; +declare var emailTextBox: ASPxClientTextBox; +declare var creditCardEmailTextBox: ASPxClientTextBox; +declare var accountEmailTextBox: ASPxClientTextBox; +declare var bookingPageControl: ASPxClientPageControl; +declare var paymentTypePageControl: ASPxClientPageControl; +declare var offerFormPopup: ASPxClientPopupControl; +declare var roomsSpinEdit: ASPxClientSpinEdit; +declare var adultsSpinEdit: ASPxClientSpinEdit; +declare var childrenSpinEdit: ASPxClientSpinEdit; +declare var hotelDetailsCallbackPanel: ASPxClientCallbackPanel; +declare var leftPanel: ASPxClientPanel; +declare var menuButton: ASPxClientButton; +declare var aboutWindow: ASPxClientPopupControl; +declare var offersZone: ASPxClientDockZone; + +module DXDemo { + function showPage(page: string, params: { [key: string]: any }, skipHistory?: boolean): void { + var queryString = getQueryString(params || {}); + hiddenField.Set("page", page); + hiddenField.Set("parameters", queryString); + hideMenu(); + var uri = queryString.length ? (page + "?" + queryString) : page; + try { + if (!skipHistory && window.history && window.history.pushState) + window.history.pushState(uri, "", uri || "Default.aspx"); + } catch (e) { } + mainCallbackPanel.PerformCallback(uri); + }; + + export function onMainMenuItemClick(s: ASPxClientMenu, e: ASPxClientMenuItemClickEventArgs): void { + switch (e.item.name) { + case "login": + hideMenu(); + setTimeout(function () { loginPopup.ShowAtElementByID("MainCallbackPanel_ContentPane"); }, 300); + break; + case "offers": + showPage("SpecialOffers", {}); + break; + default: + hideMenu(); + setTimeout(function () { showAboutWindow(); }, 300); + break; + } + }; + + export function onLoginButtonClick(s: ASPxClientButton, e: ASPxClientButtonClickEventArgs): void { + loginPopup.Hide(); + showAboutWindow(); + }; + + export function onSearchButtonClick(): void { + if (ASPxClientEdit.ValidateGroup("DateEditors")) { + showPage("ShowHotels", { + location: searchComboBox.GetValue(), + checkin: getFormattedDate(checkInDateEdit.GetValue()), + checkout: getFormattedDate(checkOutDateEdit.GetValue()), + rooms: roomsNumberSpinEdit.GetValue() || 1, + adults: adultsNumberSpinEdit.GetValue() || 1, + children: childrenNumberSpinEdit.GetValue() || 0 + }); + } + }; + + export function onSearchComboBoxIndexChanged(s: ASPxClientComboBox, e: ASPxClientProcessingModeEventArgs): void { + hideMenu(); + searchButton.AdjustControl(); + }; + + export function onIndexOfferCloseClick(index: number): void { + var panel = ASPxClientControl.GetControlCollection().GetByName("OfferDockPanel" + index); + var sibPanel = ASPxClientControl.GetControlCollection().GetByName("OfferDockPanel" + (index == 1 ? 2 : 1)); + panel.Hide(); + sibPanel.MakeFloat(); + sibPanel.SetWidth(offersZone.GetWidth()); + sibPanel.Dock(offersZone); + }; + + export function onLogoClick(): void { + showPage("", null, false); + }; + + export function onMenuNavButtonCheckedChanged(s: ASPxClientCheckBox, e: ASPxClientProcessingModeEventArgs): void { + var mainContainer = mainCallbackPanel.GetMainElement(); + if (s.GetChecked()) { + backSlider.Pause(); + showMenu(); + } + else { + hideMenu(); + backSlider.Play(); + } + }; + + export function onBackNavButtonClick(s: ASPxClientButton, e: ASPxClientButtonClickEventArgs): void { + var params = getCurrentQueryParams(); + switch (getCurrentPage()) { + case "PrintInvoice": + showPage("Booking", params, false); + break; + case "Booking": + if (bookingPageControl.GetActiveTabIndex() > 0) + bookingPageControl.SetActiveTabIndex(bookingPageControl.GetActiveTabIndex() - 1); + else + showPage("ShowRooms", params, false); + break; + case "ShowRooms": + showPage("ShowHotels", params, false); + break; + case "ShowDetails": + showPage("ShowHotels", params, false); + break; + case "ShowHotels": + case "SpecialOffers": + showPage("", null, false); + break; + } + }; + + export function updateSearchResults(): void { + var params = getCurrentQueryParams(); + params["location"] = locationComboBox.GetValue(); + params["minprice"] = nightyRateTrackBar.GetPositionStart(); + params["maxprice"] = nightyRateTrackBar.GetPositionEnd(); + params["custrating"] = customerRatingTrackBar.GetPosition(); + params["ourrating"] = ourRatingCheckBoxList.GetSelectedValues().join(","); + showPage("ShowHotels", params); + }; + + export function onBookHotelButtonClick(hotelID: string): void { + var queryParams = getCurrentQueryParams(); + queryParams["hotelID"] = hotelID; + showPage("ShowRooms", queryParams); + }; + + export function onDetailsHotelButtonClick(hotelID: string): void { + var queryParams = getCurrentQueryParams(); + queryParams["hotelID"] = hotelID; + showPage("ShowDetails", queryParams); + }; + + export function onShowStartFilterButtonClick(s: ASPxClientButton, e: ASPxClientButtonClickEventArgs): void { + startFilterPopupControl.ShowAtElementByID("MainCallbackPanel_ContentPane"); + }; + + export function onChangeStartFilterButtonClick(s: ASPxClientButton, e: ASPxClientButtonClickEventArgs): void { + if (ASPxClientEdit.ValidateGroup("DateEditors")) { + var params = getCurrentQueryParams(); + params["checkin"] = getFormattedDate(checkInDateEdit.GetValue()); + params["checkout"] = getFormattedDate(checkOutDateEdit.GetValue()); + params["rooms"] = roomsNumberSpinEdit.GetValue() || 1; + params["adults"] = adultsNumberSpinEdit.GetValue() || 1; + params["children"] = childrenNumberSpinEdit.GetValue() || 0; + startFilterPopupControl.Hide(); + showPage(hiddenField.Get("page").toString(), params); + } + }; + + export function onBookRoomButtonClick(roomID: string): void { + var params = getCurrentQueryParams(); + params["roomID"] = roomID; + showPage("Booking", params); + }; + + export function onShowRoomsButtonClick(): void { + var queryParams = getCurrentQueryParams(); + showPage("ShowRooms", queryParams); + }; + + export function onShowDetailsButtonClick(): void { + var queryParams = getCurrentQueryParams(); + showPage("ShowDetails", queryParams); + }; + + export function onRoomImageNavItemClick(roomID: string, pictureName: string): void { + setTimeout(function () { + imagePopupControl.PerformCallback(roomID + "|" + pictureName); + imagePopupControl.ShowAtElementByID("MainCallbackPanel_ContentPane"); + }, 500); + }; + + export function onRoomsNavBarExpandedChanged(s: ASPxClientNavBar, e: ASPxClientNavBarGroupEventArgs): void { + ASPxClientControl.AdjustControls(s.GetMainElement()); + }; + + export function onNextBookingStepButtonClick(step: number): void { + var valid = true; + var validationGroup = ""; + if (step == 1) + validationGroup = "Account"; + if (step == 2) + validationGroup = "RoomDetails"; + if (step == 3) + validationGroup = "PaymentDetails"; + + switch (step) { + case 1: + valid = ASPxClientEdit.ValidateEditorsInContainer(bookingPageControl.GetMainElement(), "Account"); + if (valid) { + emailTextBox.SetValue(accountEmailTextBox.GetValue()); + creditCardEmailTextBox.SetValue(accountEmailTextBox.GetValue()); + showPage("Booking", getCurrentQueryParams()); + return; + } + break; + case 2: + valid = ASPxClientEdit.ValidateEditorsInContainer(bookingPageControl.GetMainElement(), "RoomDetails"); + emailTextBox.SetValue(accountEmailTextBox.GetValue()); + break; + case 3: + var paymentType = paymentTypePageControl.GetActiveTabIndex(); + if (paymentType == 0) + valid = ASPxClientEdit.ValidateEditorsInContainer(bookingPageControl.GetMainElement(), "CreditCard"); + else if (paymentType == 1) + valid = ASPxClientEdit.ValidateEditorsInContainer(bookingPageControl.GetMainElement(), "Cash"); + else if (paymentType == 2) + valid = ASPxClientEdit.ValidateEditorsInContainer(bookingPageControl.GetMainElement(), "PayPal"); + break; + } + if (valid) { + bookingPageControl.GetTab(step).SetEnabled(true); + bookingPageControl.SetActiveTabIndex(step); + } + }; + + export function onAccountCaptchaHiddenFieldInit(s: ASPxClientHiddenField, e: ASPxClientEventArgs): void { + if (s.Get("IsCaptchaValid")) { + bookingPageControl.GetTab(1).SetEnabled(true); + bookingPageControl.SetActiveTabIndex(1); + } + }; + + export function onFinishBookingStepButtonClick(): void { + showAboutWindow(); + }; + + export function OnPrintInvoiceButtonClick(): void { + showPage("PrintInvoice", getCurrentQueryParams()); + }; + + export function onOfferClick(offerID: string): void { + offerFormPopup.SetContentHtml(""); + offerFormPopup.PerformCallback(offerID); + var panel = ASPxClientControl.GetControlCollection().GetByName("DockPanel" + offerID); + var panelElement = panel.GetMainElement(); + if (panelElement.offsetWidth < 330 || panelElement.offsetHeight < 250) { + offerFormPopup.SetWidth(400); + offerFormPopup.SetHeight(280); + offerFormPopup.ShowAtElementByID("SpecialOffersContainer"); + } + else { + offerFormPopup.SetWidth(panelElement.offsetWidth); + offerFormPopup.SetHeight(panelElement.offsetHeight); + offerFormPopup.ShowAtElement(panelElement); + } + }; + + export function onSpecialOfferCheckButtonClick(hotelID: string, locationID: string): void { + if (ASPxClientEdit.ValidateGroup("DateEditors")) { + var queryParams: { [key: string]: any } = { + location: locationID, + hotelID: hotelID, + checkin: getFormattedDate(checkInDateEdit.GetValue()), + checkout: getFormattedDate(checkOutDateEdit.GetValue()), + rooms: roomsSpinEdit.GetValue() || 1, + adults: adultsSpinEdit.GetValue() || 1, + children: childrenSpinEdit.GetValue() || 0 + }; + showPage("ShowRooms", queryParams); + } + }; + + export function onIndexOfferClick(): void { + showPage("SpecialOffers", {}); + }; + + export function onControlsInit(): void { + ASPxClientUtils.AttachEventToElement(window, 'popstate', onHistoryPopState); + var pathParts = document.location.href.split("/"); + var url = pathParts[pathParts.length - 1]; + try { + if (window.history) + window.history.replaceState(url, ""); + } catch (e) { } + ASPxClientUtils.AttachEventToElement(window, "resize", onWindowResize); + if (ASPxClientUtils.iOSPlatform) { + // animate + } + }; + + export function updateRatingLabels(ratingControl: ASPxClientTrackBar) { + var start = ratingControl.GetPositionStart().toString(); + var end = ratingControl.GetPositionEnd().toString(); + document.getElementById("cpLeftLabelID").innerHTML = start + " " + end; + }; + + export function onRatingControlItemClick(s: ASPxClientRatingControl, e: ASPxClientRatingControlItemClickEventArgs): void { + hotelDetailsCallbackPanel.PerformCallback(s.GetValue().toString()); + }; + + export function onInputKeyDown(s: ASPxClientTextBox, e: ASPxClientEditKeyEventArgs): void { + var keyCode = ASPxClientUtils.GetKeyCode(e.htmlEvent); + if (keyCode == 13) + (s.GetInputElement()).blur(); + }; + + function getCurrentPage(): string { + var hfPage = hiddenField.Get("page"); + if (hfPage) + return hfPage; + var pathParts = document.location.pathname.split("/"); + return pathParts[pathParts.length - 1]; + }; + + function showAboutWindow(): void { + aboutWindow.ShowAtElementByID("MainCallbackPanel_ContentPane"); + }; + + function hideMenu(): void { + leftPanel.Collapse(); + if (menuButton.GetMainElement() && menuButton.GetChecked()) + menuButton.SetChecked(false); + }; + + function showMenu(): void { + leftPanel.Expand(); + }; + + var _resizeSpecialOffersTimeoutID = -1; + function onWindowResize(): void { + switch (hiddenField.Get("page")) { + case "SpecialOffers": + if (_resizeSpecialOffersTimeoutID == -1) + _resizeSpecialOffersTimeoutID = setTimeout(resizeSpecialOffers, 200); + break; + } + hidePopups("AboutWindow", "StartFilterPopupControl", "LoginPopup", "OfferFormPopup", "ImagePopupControl"); + }; + + function hidePopups(...names: string[]): void { + for (var i = 0; i < names.length; i++) { + var popupControl = ASPxClientControl.GetControlCollection().GetByName(names[i]); + popupControl.Hide(); + } + }; + + function resizeSpecialOffers(): void { + for (var i = 1; i <= 4; i++) { + var panel = ASPxClientControl.GetControlCollection().GetByName("DockPanel" + i); + if (panel && panel.IsVisible()) { + var zone = panel.GetOwnerZone(); + zone.SetWidth(((zone.GetMainElement()).parentNode).offsetWidth) + } + } + _resizeSpecialOffersTimeoutID = -1; + }; + + function getFormattedDate(date: Date): string { + return (date.getMonth() + 1) + "-" + date.getDate() + "-" + date.getFullYear(); + }; + + function getCurrentQueryParams(): { [key:string]: any } { + var hfParams = hiddenField.Get("parameters"); + if (hfParams) + return getParamsByQueryString(hfParams); + var query = document.location.search; + if (query[0] === "?") + query = query.substr(1); + return getParamsByQueryString(query); + }; + + function getQueryString(params: { [key:string]: any }): string { + var queryItems: any[] = []; + for (var key in params) { + if (!params.hasOwnProperty(key)) continue; + queryItems.push(key + "=" + params[key]); + } + if (queryItems.length > 0) + return queryItems.join("&"); + return ""; + }; + + function getParamsByQueryString(queryString: string): { [key: string]: string } { + var result: { [key: string]: any } = {}; + if (queryString) { + var queryStringArray = queryString.split("&"); + for (var i = 0; i < queryStringArray.length; i++) { + var part = queryStringArray[i].split('='); + if (part.length != 2) continue; + result[part[0]] = decodeURIComponent(part[1].replace(/\+/g, " ")); + } + } + return result; + }; + + function onHistoryPopState(evt: any): void { + if (evt.state !== null && evt.state !== undefined) { + var uriParts = evt.state.split("?"); + showPage(uriParts[0], getParamsByQueryString(uriParts[1]), true); + } + }; +} \ No newline at end of file diff --git a/types/devexpress-web/v171/index.d.ts b/types/devexpress-web/v171/index.d.ts new file mode 100644 index 0000000000..50aac382b1 --- /dev/null +++ b/types/devexpress-web/v171/index.d.ts @@ -0,0 +1,33698 @@ +// Type definitions for DevExpress ASP.NET v171.4 +// Project: http://devexpress.com/ +// Definitions by: DevExpress Inc. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * A client-side counterpart of the DashboardViewer extension. + */ +interface MVCxClientDashboardViewer extends ASPxClientDashboardViewer { +} +/** + * Represents a list of records from the dashboard data source. + */ +interface ASPxClientDashboardItemUnderlyingData { + /** + * Gets the number of rows in the underlying data set. + */ + GetRowCount(): number; + /** + * Returns the value of the specified cell within the underlying data set. + * @param rowIndex An integer value that specifies the zero-based index of the required row. + * @param dataMember A String that specifies the required data member. + */ + GetRowValue(rowIndex: number, dataMember: string): Object; + /** + * Returns an array of data members available in a data source. + */ + GetDataMembers(): string[]; + /** + * Returns whether or not a request for underlying data was successful. + */ + IsDataReceived(): boolean; + /** + * Returns a callstack containing the error caused by an unsuccessful request for underlying data. + */ + GetRequestDataError(): string; +} +/** + * Contains parameters used to obtain the underlying data for the dashboard item. + */ +interface ASPxClientDashboardItemRequestUnderlyingDataParameters { + /** + * Gets or sets an array of data member identifiers used to obtain underlying data. + * Value: An array of string values that specify data member identifiers. + */ + DataMembers: string[]; + /** + * Gets or sets axis points used to obtain the underlying data. + * Value: An array of ASPxClientDashboardItemDataAxisPoint objects that represent axis points. + */ + AxisPoints: ASPxClientDashboardItemDataAxisPoint[]; + /** + * Gets or sets the dimension value used to obtain the underlying data. + * Value: The dimension value. + */ + ValuesByAxisName: Object; + /** + * Gets or sets the unique dimension value used to obtain the underlying data. + * Value: The unique dimension value. + */ + UniqueValuesByAxisName: Object; +} +/** + * References a method executed after an asynchronous request is complete. + */ +interface ASPxClientDashboardItemRequestUnderlyingDataCompleted { + /** + * References a method executed after an asynchronous request is completed. + * @param data An ASPxClientDashboardItemUnderlyingData object that represents a list of records from the dashboard data source. + */ + (data: ASPxClientDashboardItemUnderlyingData): void; +} +/** + * References a method that will handle the ItemClick events. + */ +interface ASPxClientDashboardItemClickEventHandler { + /** + * References a method that will handle the ItemClick events. + * @param source The event source. + * @param e A ASPxClientDashboardItemClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemClickEventArgs): void; +} +/** + * Provides data for the ItemClick events. + */ +interface ASPxClientDashboardItemClickEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the dashboard item for which the event has been raised. + * Value: A string value that is the dashboard item name. + */ + ItemName: string; + /** + * Gets the dashboard item's client data. + */ + GetData(): ASPxClientDashboardItemData; + /** + * Returns the axis point corresponding to the clicked visual element. + * @param axisName A string value returned by the DashboardDataAxisNames class that specifies the name of the data axis. + */ + GetAxisPoint(axisName: string): ASPxClientDashboardItemDataAxisPoint; + /** + * Gets measures corresponding to the clicked visual element. + */ + GetMeasures(): ASPxClientDashboardItemDataMeasure[]; + /** + * Gets deltas corresponding to the clicked visual element. + */ + GetDeltas(): ASPxClientDashboardItemDataDelta[]; + /** + * Gets the dimensions used to create a hierarchy of axis points for the specified axis. + * @param axisName A string value returned by the DashboardDataAxisNames class that specifies the name of the data axis. + */ + GetDimensions(axisName: string): ASPxClientDashboardItemDataDimension[]; + /** + * Requests underlying data corresponding to the clicked visual element. + * @param onCompleted A ASPxClientDashboardItemRequestUnderlyingDataCompleted object that references a method executed after the request is completed. + * @param dataMembers An array of string values that specify data members used to obtain underlying data. + */ + RequestUnderlyingData(onCompleted: ASPxClientDashboardItemRequestUnderlyingDataCompleted, dataMembers: string[]): void; +} +/** + * References a method that will handle the ItemVisualInteractivity events. + */ +interface ASPxClientDashboardItemVisualInteractivityEventHandler { + /** + * References a method that will handle the ItemVisualInteractivity events. + * @param source The event source. + * @param e A ASPxClientDashboardItemVisualInteractivityEventArgs object containing event data. + */ + (source: S, e: ASPxClientDashboardItemVisualInteractivityEventArgs): void; +} +/** + * Provides data for the ItemVisualInteractivity events. + */ +interface ASPxClientDashboardItemVisualInteractivityEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item for which the event was raised. + * Value: A string value that is the component name of the dashboard item. + */ + ItemName: string; + /** + * Gets the selection mode for dashboard item elements. + */ + GetSelectionMode(): string; + /** + * Sets the selection mode for dashboard item elements. + * @param selectionMode A String that specifies the selection mode. + */ + SetSelectionMode(selectionMode: string): void; + /** + * Returns whether or not highlighting is enabled for the current dashboard item. + */ + IsHighlightingEnabled(): boolean; + /** + * Enables highlighting for the current dashboard item. + * @param enableHighlighting true, to enable highlighting; otherwise, false. + */ + EnableHighlighting(enableHighlighting: boolean): void; + /** + * Gets data axes used to perform custom interactivity actions. + */ + GetTargetAxes(): string[]; + /** + * Sets data axes used to perform custom interactivity actions. + * @param targetAxes An array of String objects that specify names of data axes. + */ + SetTargetAxes(targetAxes: string[]): void; + /** + * Gets the default selection for the current dashboard item. + */ + GetDefaultSelection(): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Sets the default selection for the current dashboard item. + * @param values An array of ASPxClientDashboardItemDataAxisPointTuple objects specifying axis point tuples used to select default elements. + */ + SetDefaultSelection(values: ASPxClientDashboardItemDataAxisPointTuple[]): void; +} +/** + * References a method that will handle the ItemSelectionChanged events. + */ +interface ASPxClientDashboardItemSelectionChangedEventHandler { + /** + * References a method that will handle the ItemSelectionChanged events. + * @param source The event source. + * @param e A ASPxClientDashboardItemSelectionChangedEventArgs object containing event data. + */ + (source: S, e: ASPxClientDashboardItemSelectionChangedEventArgs): void; +} +/** + * Provides data for the ItemSelectionChanged events. + */ +interface ASPxClientDashboardItemSelectionChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item for which the event was raised. + * Value: A string that is the component name of the dashboard item. + */ + ItemName: string; + /** + * Gets currently selected elements. + */ + GetCurrentSelection(): ASPxClientDashboardItemDataAxisPointTuple[]; +} +/** + * References a method that will handle the ItemElementCustomColor event. + */ +interface ASPxClientDashboardItemElementCustomColorEventHandler { + /** + * References a method that will handle the ItemElementCustomColor events. + * @param source The event source. + * @param e An ASPxClientDashboardItemElementCustomColorEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemElementCustomColorEventArgs): void; +} +/** + * Provides data for the ItemElementCustomColor events. + */ +interface ASPxClientDashboardItemElementCustomColorEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item for which the event was raised. + * Value: A string value that is the component name of the dashboard item for which the event was raised. + */ + ItemName: string; + /** + * Gets the axis point tuple that corresponds to the current dashboard item element. + */ + GetTargetElement(): ASPxClientDashboardItemDataAxisPointTuple; + /** + * Gets the color of the current dashboard item element. + */ + GetColor(): string; + /** + * Sets the color of the current dashboard item element. + * @param color A String that specifies the color of the current dashboard item element. + */ + SetColor(color: string): void; + /** + * Gets measures corresponding to the current dashboard item element. + */ + GetMeasures(): ASPxClientDashboardItemDataMeasure[]; +} +/** + * References a method that will handle the ItemWidgetCreated events. + */ +interface ASPxClientDashboardItemWidgetCreatedEventHandler { + /** + * References a method that will handle the ItemWidgetCreated events. + * @param source The event source. + * @param e A ASPxClientDashboardItemWidgetEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemWidgetEventArgs): void; +} +/** + * References a method that will handle the ItemWidgetUpdating event. + */ +interface ASPxClientDashboardItemWidgetUpdatingEventHandler { + /** + * References a method that will handle the ItemWidgetUpdating event. + * @param source The event source. + * @param e A ASPxClientDashboardItemWidgetEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemWidgetEventArgs): void; +} +/** + * References a method that will handle the ItemWidgetUpdated event. + */ +interface ASPxClientDashboardItemWidgetUpdatedEventHandler { + /** + * References a method that will handle the ItemWidgetUpdated event. + * @param source The event source. + * @param e A ASPxClientDashboardItemWidgetEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemWidgetEventArgs): void; +} +/** + * References a method that will handle the ItemBeforeWidgetDisposed events. + */ +interface ASPxClientDashboardItemBeforeWidgetDisposedEventHandler { + /** + * References a method that will handle the ItemBeforeWidgetDisposed events. + * @param source The event source. + * @param e A ASPxClientDashboardItemWidgetEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemWidgetEventArgs): void; +} +/** + * Provides data for events related to client widgets used to visualize data in dashboard items. + */ +interface ASPxClientDashboardItemWidgetEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item for which the event was raised. + * Value: A string value that is the component name of the dashboard item. + */ + ItemName: string; + /** + * Returns an underlying widget corresponding to the current dashboard item. + */ + GetWidget(): Object; +} +/** + * Represents multidimensional data visualized in the dashboard item. + */ +interface ASPxClientDashboardItemData { + /** + * Gets the names of the axes that constitute the current ASPxClientDashboardItemData. + */ + GetAxisNames(): string[]; + /** + * Returns the specified data axis. + * @param axisName A string value returned by the DashboardDataAxisNames class that specifies the name of the data axis. + */ + GetAxis(axisName: string): ASPxClientDashboardItemDataAxis; + /** + * Gets the dimensions used to create a hierarchy of axis points for the specified axis. + * @param axisName A string value returned by the DashboardDataAxisNames class that specifies the name of the data axis. + */ + GetDimensions(axisName: string): ASPxClientDashboardItemDataDimension[]; + /** + * Gets the measures for the current ASPxClientDashboardItemData object. + */ + GetMeasures(): ASPxClientDashboardItemDataMeasure[]; + /** + * Gets the deltas for the current ASPxClientDashboardItemData object. + */ + GetDeltas(): ASPxClientDashboardItemDataDelta[]; + /** + * Gets the slice of the current ASPxClientDashboardItemData object by the specified axis point tuple. + * @param tuple A ASPxClientDashboardItemDataAxisPointTuple object that is a tuple of axis points. + */ + GetSlice(tuple: ASPxClientDashboardItemDataAxisPointTuple): ASPxClientDashboardItemData; + /** + * Gets the slice of the current ASPxClientDashboardItemData object by the specified axis point. + * @param axisPoint An ASPxClientDashboardItemDataAxisPoint object that is the data point in a multidimensional space. + */ + GetSlice(axisPoint: ASPxClientDashboardItemDataAxisPoint): ASPxClientDashboardItemData; + /** + * Returns a total summary value for the specified measure. + * @param measureId A String that is the measure identifier. + */ + GetMeasureValue(measureId: string): ASPxClientDashboardItemDataMeasureValue; + /** + * Gets the summary value for the specified delta. + * @param deltaId A String that is the data item identifier. + */ + GetDeltaValue(deltaId: string): ASPxClientDashboardItemDataDeltaValue; + /** + * Returns an array of data members available in a data source. + */ + GetDataMembers(): string[]; + /** + * Creates a tuple based on the specified axes names and corresponding values. + * @param values An array of name-value pairs containing the axis name and corresponding values. + */ + CreateTuple(values: Object[]): ASPxClientDashboardItemDataAxisPointTuple; + /** + * Creates a tuple based on the specified axis points. + * @param axisPoints An array of ASPxClientDashboardItemDataAxisPoint objects that specify axis points belonging to different data axes. + */ + CreateTuple(axisPoints: ASPxClientDashboardItemDataAxisPoint[]): ASPxClientDashboardItemDataAxisPointTuple; +} +/** + * An axis that contains data points corresponding to the specified value hierarchy. + */ +interface ASPxClientDashboardItemDataAxis { + /** + * Gets the dimensions used to create a hierarchy of axis points belonging to the current axis. + */ + GetDimensions(): ASPxClientDashboardItemDataDimension[]; + /** + * Gets the root axis point belonging to the current ASPxClientDashboardItemDataAxis. + */ + GetRootPoint(): ASPxClientDashboardItemDataAxisPoint; + /** + * Returns axis points corresponding to values of the last-level dimension. + */ + GetPoints(): ASPxClientDashboardItemDataAxisPoint[]; + /** + * Returns axis points corresponding to the specified dimension. + * @param dimensionId A String that is the dimension identifier. + */ + GetPointsByDimension(dimensionId: string): ASPxClientDashboardItemDataAxisPoint[]; + /** + * Returns the data point for the specified axis by unique values. + * @param uniqueValues A hierarchy of unique values identifying the required data point. + */ + GetPointByUniqueValues(uniqueValues: Object[]): ASPxClientDashboardItemDataAxisPoint; +} +/** + * Contains the dimension metadata. + */ +interface ASPxClientDashboardItemDataDimension { + /** + * Gets the dimension identifier. + * Value: A string value that is the dimension identifier. + */ + Id: string; + /** + * Gets or sets the name of the dimension. + * Value: A string value that is the name of the dimension. + */ + Name: string; + /** + * Gets the data member identifier for the current dimension. + * Value: A string value that identifies a data member. + */ + DataMember: string; + /** + * Gets the group interval for date-time values for the current dimension. + * Value: A string value that represents how date-time values are grouped. + */ + DateTimeGroupInterval: string; + /** + * Gets the group interval for string values. + * Value: A string value that specifies the group interval for string values. + */ + TextGroupInterval: string; + /** + * Formats the specified value using format settings of the current dimension. + * @param value A value to be formatted. + */ + Format(value: Object): string; +} +/** + * Contains the measure metadata. + */ +interface ASPxClientDashboardItemDataMeasure { + /** + * Gets the measure identifier. + * Value: A string value that is the measure identifier. + */ + Id: string; + /** + * Gets the name of the measure. + * Value: A string value that is the name of the measure. + */ + Name: string; + /** + * Gets the data member that identifies the data source list used to provide data for the current measure. + * Value: A string value that identifies the data source list used to provide data for the current measure. + */ + DataMember: string; + /** + * Gets the type of summary function calculated against the current measure. + * Value: A string value that identifies the type of summary function calculated against the current measure. + */ + SummaryType: string; + /** + * Formats the specified value using format settings of the current measure. + * @param value A value to be formatted. + */ + Format(value: Object): string; +} +/** + * Contains the delta metadata. + */ +interface ASPxClientDashboardItemDataDelta { + /** + * Gets the data item identifier. + * Value: A string that is the data item identifier. + */ + Id: string; + /** + * Gets the name of the data item container. + * Value: A string value that is the name of the data item container. + */ + Name: string; + /** + * Gets the identifier for the measure that provides actual values. + * Value: A string value that is the measure identifier. + */ + ActualMeasureId: string; + /** + * Gets the identifier for the measure that provides target values. + * Value: A string value that is the measure identifier. + */ + TargetMeasureId: string; +} +/** + * Provides dimension values at the specified axis point. + */ +interface ASPxClientDashboardItemDataDimensionValue { + /** + * Gets the current dimension value. + */ + GetValue(): Object; + /** + * Gets the unique value for the current dimension value. + */ + GetUniqueValue(): Object; + /** + * Gets the display text for the current dimension value. + */ + GetDisplayText(): string; +} +/** + * Provides the measure value and display text. + */ +interface ASPxClientDashboardItemDataMeasureValue { + /** + * Gets the measure value. + */ + GetValue(): Object; + /** + * Gets the measure display text. + */ + GetDisplayText(): string; +} +/** + * Provides delta element values. + */ +interface ASPxClientDashboardItemDataDeltaValue { + /** + * Provides access to the actual value displayed within the delta element. + */ + GetActualValue(): ASPxClientDashboardItemDataMeasureValue; + /** + * Provides access to the target value. + */ + GetTargetValue(): ASPxClientDashboardItemDataMeasureValue; + /** + * Provides access to the absolute difference between the actual and target values. + */ + GetAbsoluteVariation(): ASPxClientDashboardItemDataMeasureValue; + /** + * Provides access to the percent of variation between the actual and target values. + */ + GetPercentVariation(): ASPxClientDashboardItemDataMeasureValue; + /** + * Provides access to the percentage of the actual value in the target value. + */ + GetPercentOfTarget(): ASPxClientDashboardItemDataMeasureValue; + /** + * Provides access to the main delta value. + */ + GetDisplayValue(): ASPxClientDashboardItemDataMeasureValue; + /** + * Provides access to the first additional delta value. + */ + GetDisplaySubValue1(): ASPxClientDashboardItemDataMeasureValue; + /** + * Provides access to the second additional delta value. + */ + GetDisplaySubValue2(): ASPxClientDashboardItemDataMeasureValue; + /** + * Gets the value specifying the condition for displaying the delta indication. + */ + GetIsGood(): ASPxClientDashboardItemDataMeasureValue; + /** + * Gets the type of delta indicator. + */ + GetIndicatorType(): ASPxClientDashboardItemDataMeasureValue; +} +/** + * A point on the data axis. + */ +interface ASPxClientDashboardItemDataAxisPoint { + /** + * Gets the name of the axis to which the current axis point belongs. + */ + GetAxisName(): string; + /** + * Gets the last level dimension corresponding to the current axis point. + */ + GetDimension(): ASPxClientDashboardItemDataDimension; + /** + * Gets the collection of dimensions used to create a hierarchy of axis points from the root point to the current axis point. + */ + GetDimensions(): ASPxClientDashboardItemDataDimension[]; + /** + * Gets the value corresponding to the current axis point. + */ + GetValue(): Object; + /** + * Gets the display text corresponding to the current axis point. + */ + GetDisplayText(): string; + /** + * Gets the unique value corresponding to the current axis point. + */ + GetUniqueValue(): Object; + /** + * Gets the dimension values at the specified axis point. + */ + GetDimensionValue(): ASPxClientDashboardItemDataDimensionValue; + /** + * Gets the dimension value at the current axis point. + * @param dimensionId A String value that specifies the dimension identifier. + */ + GetDimensionValue(dimensionId: string): ASPxClientDashboardItemDataDimensionValue; + /** + * Gets the child axis points for the current axis point. + */ + GetChildren(): ASPxClientDashboardItemDataAxisPoint[]; + /** + * Gets the parent axis point for the current axis point. + */ + GetParent(): ASPxClientDashboardItemDataAxisPoint; +} +/** + * Represents a tuple of axis points. + */ +interface ASPxClientDashboardItemDataAxisPointTuple { + /** + * Returns the axis point belonging to the default data axis. + */ + GetAxisPoint(): ASPxClientDashboardItemDataAxisPoint; + /** + * Returns the axis point belonging to the specified data axis. + * @param axisName A string value returned by the DashboardDataAxisNames class that specifies the name of the data axis. + */ + GetAxisPoint(axisName: string): ASPxClientDashboardItemDataAxisPoint; +} +/** + * A range in the Range Filter dashboard item. + */ +interface ASPxClientDashboardRangeFilterSelection { + /** + * Gets or sets a maximum value in the range of the Range Filter dashboard item. + * Value: A maximum value in the range of the Range Filter dashboard item. + */ + Maximum: Object; + /** + * Gets or sets a minimum value in the range of the Range Filter dashboard item. + * Value: A minimum value in the range of the Range Filter dashboard item. + */ + Minimum: Object; +} +/** + * A collection of ASPxClientDashboardParameter objects. + */ +interface ASPxClientDashboardParameters { + /** + * Returns an array of dashboard parameters from the ASPxClientDashboardParameters collection. + */ + GetParameterList(): ASPxClientDashboardParameter[]; + /** + * Returns a dashboard parameter by its name. + * @param name A String object that specifies the parameter name. + */ + GetParameterByName(name: string): ASPxClientDashboardParameter; + /** + * Returns a dashboard parameter by its index in the ASPxClientDashboardParameters collection. + * @param index An integer value that specifies the parameter index. + */ + GetParameterByIndex(index: number): ASPxClientDashboardParameter; +} +/** + * A client-side dashboard parameter. + */ +interface ASPxClientDashboardParameter { + /** + * Gets the dashboard parameter name on the client side. + * Value: A string value that is the dashboard parameter name on the client side. + */ + Name: string; + /** + * Gets the dashboard parameter value on the client side. + * Value: A string value that specifies the dashboard parameter value on the client side. + */ + Value: Object; + /** + * Returns a parameter name. + */ + GetName(): string; + /** + * Returns a current parameter value(s). + */ + GetValue(): Object; + /** + * Specifies the current parameter value(s). + * @param value The current parameter value(s). + */ + SetValue(value: Object): void; + /** + * Returns a default parameter value. + */ + GetDefaultValue(): Object; + /** + * Returns the parameter's description displayed to an end-user. + */ + GetDescription(): string; + /** + * Returns a parameter type. + */ + GetType(): string; + /** + * Returns possible parameter values. + */ + GetValues(): ASPxClientDashboardParameterValue[]; +} +/** + * Provides access to the parameter value and display text. + */ +interface ASPxClientDashboardParameterValue { + /** + * Returns the parameter display text. + */ + GetDisplayText(): string; + /** + * Returns a parameter value. + */ + GetValue(): Object; +} +/** + * Contains settings that specify parameters affecting how the dashboard or dashboard item is exported in Image format. + */ +interface ImageFormatOptions { + /** + * Gets or sets an image format in which the dashboard (dashboard item) is exported. + * Value: A value returned by the DashboardExportImageFormat class that specifies an image format in which the dashboard (dashboard item) is exported. + */ + Format: string; + /** + * Gets or sets the resolution (in dpi) used to export a dashboard (dashboard item) in Image format. + * Value: An integer value that specifies the resolution (in dpi) used to export a dashboard (dashboard item) in Image format. + */ + Resolution: number; +} +/** + * Contains options which define how the dashboard item is exported to Excel format. + */ +interface ExcelFormatOptions { + /** + * Gets or sets the Excel format in which the dashboard item is exported. + * Value: A value returned by the DashboardExportExcelFormat class that specifies the Excel format in which the dashboard item is exported. + */ + Format: string; + /** + * Gets or sets a character used to separate values in a CSV document. + * Value: A string value that specifies the character used to separate values in a CSV document. + */ + CsvValueSeparator: string; +} +/** + * Contains settings that specify parameters affecting how the Grid dashboard item is exported. + */ +interface GridExportOptions { + /** + * Gets or sets whether the size of the Grid dashboard item is changed according to the width of the exported page. + * Value: true, to change the size of the Grid dashboard item according to the width of the exported page; otherwise, false. + */ + FitToPageWidth: boolean; + /** + * Gets or sets whether to print column headers of the Grid dashboard item on every page. + * Value: true, to print column headers on every page; otherwise, false. + */ + PrintHeadersOnEveryPage: boolean; +} +/** + * Contains settings that specify parameters affecting how the Pivot dashboard item is exported. + */ +interface PivotExportOptions { + /** + * Gets or sets whether to print the column headers of the Pivot dashboard item on every page. + * Value: true, to print column headers on every page; otherwise, false. + */ + PrintHeadersOnEveryPage: boolean; +} +/** + * Contains settings that specify parameters affecting how the Pie dashboard item is exported. + */ +interface PieExportOptions { + /** + * Gets or sets whether dashboard item elements are arranged automatically on the exported page. + * Value: true, to arrange dashboard item elements automatically on the exported page; otherwise, false. + */ + AutoArrangeContent: boolean; +} +/** + * Contains settings that specify parameters affecting how the Gauge dashboard item is exported. + */ +interface GaugeExportOptions { + /** + * Gets or sets whether dashboard item elements are arranged automatically on the exported page. + * Value: true, to arrange dashboard item elements automatically on the exported page; otherwise, false. + */ + AutoArrangeContent: boolean; +} +/** + * Contains settings that specify parameters affecting how the Card dashboard item is exported. + */ +interface CardExportOptions { + /** + * Gets or sets whether dashboard item elements are arranged automatically on the exported page. + * Value: true, to arrange dashboard item elements automatically on the exported page; otherwise, false. + */ + AutoArrangeContent: boolean; +} +/** + * Contains settings that specify parameters affecting how the Range Filter dashboard item is exported. + */ +interface RangeFilterExportOptions { + /** + * Gets or sets whether the page orientation used to export a Range Filter dashboard item is selected automatically. + * Value: true, to automatically select the page orientation used to export a Range Filter dashboard item; otherwise, false. + */ + AutomaticPageLayout: boolean; + /** + * Gets or sets the export size mode for the Range Filter dashboard item. + * Value: A value returned by the RangeFilterExportSizeMode class that specifies the export size mode for the Range Filter dashboard item. + */ + SizeMode: string; +} +/** + * Contains settings that specify parameters affecting how Chart dashboard items are exported. + */ +interface ChartExportOptions { + /** + * Gets or sets whether the page orientation used to export a Chart dashboard item is selected automatically. + * Value: true, to automatically select the page orientation used to export a Chart dashboard item; otherwise, false. + */ + AutomaticPageLayout: boolean; + /** + * Gets or sets the export size mode for the Chart dashboard item. + * Value: A value returned by the ChartExportSizeMode class that specifies the export size mode for the Chart dashboard item. + */ + SizeMode: string; +} +/** + * Contains settings that specify parameters affecting how Map dashboard items are exported. + */ +interface MapExportOptions { + /** + * Gets or sets whether the page orientation used to export a map dashboard item is selected automatically. + * Value: true, to automatically select the page orientation used to export a map dashboard item; otherwise, false. + */ + AutomaticPageLayout: boolean; + /** + * Gets or sets the export size mode for the map dashboard item. + * Value: A value returned by the MapExportSizeMode class that specifies specifies the export size mode for the map dashboard item. + */ + SizeMode: string; +} +/** + * Contains settings that specify parameters affecting how the dashboard (dashboard item) is exported. + */ +interface ASPxClientDashboardExportOptions { + /** + * Gets or sets the standard paper size. + * Value: A string value returned by the DashboardExportPaperKind class that specifies the standard paper size. + */ + PaperKind: string; + /** + * Gets or sets the page orientation used to export a dashboard (dashboard item). + * Value: A string value returned by the DashboardExportPageLayout class that specifies the page orientation used to export a dashboard (dashboard item). + */ + PageLayout: string; + /** + * Gets or sets the mode for scaling when exporting a dashboard (dashboard item). + * Value: A string value returned by the DashboardExportScaleMode class that specifies the mode for scaling when exporting a dashboard (dashboard item). + */ + ScaleMode: string; + /** + * Gets or sets the scale factor (in fractions of 1) by which a dashboard (dashboard item) is scaled. + * Value: A Single value that specifies the scale factor by which a dashboard (dashboard item) is scaled. + */ + ScaleFactor: number; + /** + * Gets or sets the number of horizontal/vertical pages spanning the total width/height of a dashboard (dashboard item). + * Value: An integer value that specifies the number of horizontal/vertical pages spanning the total width/height of a dashboard (dashboard item). + */ + AutoFitPageCount: number; + /** + * Gets or sets the title of the exported document. + * Value: A string value that specifies the title of the exported document. + */ + Title: string; + /** + * Gets or sets whether a dashboard title (or dashboard item's caption) is included as the exported document title. + * Value: A boolean value that specifies whether a dashboard title (or dashboard item's caption) is included as the exported document title. + */ + ShowTitle: boolean; + /** + * Gets or sets the filter state's location on the exported document. + * Value: A string value returned by the DashboardExportFilterState class that specifies the filter state's location on the exported document. + */ + FilterState: string; + /** + * Provides access to options for exporting a dashboard or individual items in Image format. + * Value: An ImageFormatOptions object containing settings that specify parameters affecting how the dashboard or dashboard item is exported in Image format. + */ + ImageOptions: ImageFormatOptions; + /** + * Provides access to options for exporting individual dashboard items in Excel format. + * Value: An ExcelFormatOptions object containing settings that specify parameters affecting how the dashboard item is exported in Excel format. + */ + ExcelOptions: ExcelFormatOptions; + /** + * Provides access to options for exporting a Grid dashboard item. + * Value: A GridExportOptions object containing settings that specify parameters that affect how Grid dashboard items are exported. + */ + GridOptions: GridExportOptions; + /** + * Provides access to options for exporting a Pivot dashboard item. + * Value: A PivotExportOptions object containing settings that specify parameters that affect how Pivot dashboard items are exported. + */ + PivotOptions: PivotExportOptions; + /** + * Provides access to options for exporting a Pie dashboard item. + * Value: A PieExportOptions object containing settings that specify parameters that affect how Pie dashboard items are exported. + */ + PieOptions: PieExportOptions; + /** + * Provides access to options for exporting a Gauge dashboard item. + * Value: A GaugeExportOptions object containing settings that specify parameters that affect how Gauge dashboard items are exported. + */ + GaugeOptions: GaugeExportOptions; + /** + * Provides access to options for exporting a Card dashboard item. + * Value: A CardExportOptions object containing settings that specify parameters that affect how Card dashboard items are exported. + */ + CardOptions: CardExportOptions; + /** + * Provides access to options for exporting a Range Filter dashboard item. + * Value: A RangeFilterExportOptions object containing settings that specify parameters affecting how the Range Filter dashboard item is exported. + */ + RangeFilterOptions: RangeFilterExportOptions; + /** + * Provides access to options for exporting a Chart dashboard item. + * Value: A ChartExportOptions object containing settings that specify parameters that affect how Chart dashboard items are exported. + */ + ChartOptions: ChartExportOptions; + /** + * Provides access to options for exporting map dashboard items. + * Value: A MapExportOptions object containing settings that specify parameters that affect how map dashboard items are exported. + */ + MapOptions: MapExportOptions; +} +/** + * Contains options related to exporting a dashboard/dashboard item to the PDF format. + */ +interface DashboardPdfExportOptions { + /** + * Gets or sets the type of paper for the exported document. + * Value: A DashboardExportPaperKind value that specifies the type of paper for the exported document. + */ + PaperKind: string; + /** + * Gets or sets the page orientation used to export a dashboard/dashboard item. + * Value: A DashboardExportPageLayout value that specifies the page orientation used to export a dashboard/dashboard item. + */ + PageLayout: string; + /** + * Gets or sets the mode for scaling a dashboard/dashboard item in the exported document. + * Value: A DashboardExportScaleMode value that specifies the mode for scaling a dashboard/dashboard item in the exported document. + */ + ScaleMode: string; + /** + * Gets or sets the scale factor (in fractions of 1), by which a dashboard/dashboard item is scaled in the exported document. + * Value: A Single value that specifies the scale factor by which a dashboard/dashboard item is scaled in the exported document. + */ + ScaleFactor: number; + /** + * Gets or sets the number of horizontal/vertical pages spanning the total width/height of a dashboard/dashboard item. + * Value: An integer value that specifies the number of horizontal/vertical pages spanning the total width/height of a dashboard/dashboard item. + */ + AutoFitPageCount: number; + /** + * Gets or sets the title of the exported document. + * Value: A string value that specifies the title of the exported document. + */ + Title: string; + /** + * Gets or sets whether a dashboard title (or dashboard item's caption) is included as the exported document title. + * Value: A boolean value that specifies whether a dashboard title (or dashboard item's caption) is included as the exported document title. + */ + ShowTitle: boolean; + /** + * Gets or sets whether to add the state of master filter items to the exported document. + * Value: true, to add the state of master filter items to the exported document; otherwise, false. + */ + ExportFilters: boolean; + /** + * Gets or sets whether to add current parameter values to the exported document. + * Value: true, to add current parameter values to the exported document; otherwise, false. + */ + ExportParameters: boolean; + /** + * Gets or sets whether to add current values of a hidden parameter to the exported document. + * Value: true, to add current values of a hidden parameter to the exported document; otherwise, false. + */ + IncludeHiddenParameters: boolean; + /** + * Gets or sets a position of the dashboard state (such as master filter or current parameter values) in the exported document. + * Value: A DashboardStateExportPosition object that specifies the position of the dashboard state in the exported document. + */ + DashboardStatePosition: string; + /** + * Gets or sets whether cards within the Card dashboard item are arranged automatically on the exported page. + * Value: true, to arrange cards automatically on the exported page; otherwise, false. + */ + CardAutoArrangeContent: boolean; + /** + * Gets or sets whether the page orientation used to export the Chart dashboard item is selected automatically. + * Value: true, to automatically select the page orientation used to export the Chart dashboard item; otherwise, false. + */ + ChartAutomaticPageLayout: boolean; + /** + * Gets or sets the export size mode for the Chart dashboard item. + * Value: A ChartExportSizeMode value that specifies the export size mode for the Chart dashboard item. + */ + ChartSizeMode: string; + /** + * Gets or sets whether gauges within the Gauge dashboard item are arranged automatically on the exported page. + * Value: true, to arrange gauges automatically on the exported page; otherwise, false. + */ + GaugeAutoArrangeContent: boolean; + /** + * Gets or sets whether the size of the Grid dashboard item is changed according to the width of the exported page. + * Value: true, to change the size of the Grid dashboard item according to the width of the exported page; otherwise, false. + */ + GridFitToPageWidth: boolean; + /** + * Gets or sets whether to add column headers of the Grid dashboard item to every page. + * Value: true, to add column headers to every page; otherwise, false. + */ + GridPrintHeadersOnEveryPage: boolean; + /** + * Gets or sets whether the page orientation used to export the Map dashboard item is selected automatically. + * Value: true, to automatically select the page orientation used to export the Map dashboard item; otherwise, false. + */ + MapAutomaticPageLayout: boolean; + /** + * Gets or sets the export size mode for the Map dashboard item. + * Value: A MapExportSizeMode value that specifies the export size mode for the Map dashboard item. + */ + MapSizeMode: string; + /** + * Gets or sets whether pies within the Pie dashboard item are arranged automatically on the exported page. + * Value: true, to arrange pies automatically on the exported page; otherwise, false. + */ + PieAutoArrangeContent: boolean; + /** + * Gets or sets whether to add column headers of the Pivot dashboard item to every page. + * Value: true, to add column headers to every page; otherwise, false. + */ + PivotPrintHeadersOnEveryPage: boolean; + /** + * Gets or sets whether the page orientation used to export the Range Filter dashboard item is selected automatically. + * Value: true, to automatically select the page orientation used to export the Range Filter dashboard item; otherwise, false. + */ + RangeFilterAutomaticPageLayout: boolean; + /** + * Gets or sets the export size mode for the Range Filter dashboard item. + * Value: A RangeFilterExportSizeMode value that specifies the export size mode for the Range Filter dashboard item. + */ + RangeFilterSizeMode: string; + /** + * Gets or sets whether the page orientation used to export the Treemap dashboard item is selected automatically. + * Value: true, to automatically select the page orientation used to export the Treemap dashboard item; otherwise, false. + */ + TreemapAutomaticPageLayout: boolean; + /** + * Gets or sets the export size mode for the Treemap dashboard item. + * Value: A TreemapExportSizeMode value that specifies the export size mode for the Treemap dashboard item. + */ + TreemapSizeMode: string; +} +/** + * Contains options related to exporting a dashboard/dashboard item to an image. + */ +interface DashboardImageExportOptions { + /** + * Gets or sets a title of the exported document. + * Value: A string value that specifies the title of the exported document. + */ + Title: string; + /** + * Gets or sets whether a dashboard title (or dashboard item's caption) is included as the exported document title. + * Value: true, to include a dashboard title (or dashboard item's caption) as the exported document title; otherwise, false. + */ + ShowTitle: boolean; + /** + * Gets or sets whether to add the state of master filter items to the exported document. + * Value: true, to add the state of master filter items to the exported document; otherwise, false. + */ + ExportFilters: boolean; + /** + * Gets or sets whether to add current parameter values to the exported document. + * Value: true, to add current parameter values to the exported document; otherwise, false. + */ + ExportParameters: boolean; + /** + * Gets or sets whether to add current values of a hidden parameter to the exported document. + * Value: true, to add current values of a hidden parameter to the exported document; otherwise, false. + */ + IncludeHiddenParameters: boolean; + /** + * Gets or sets an image format in which the dashboard/dashboard item is exported. + * Value: A DashboardExportImageFormat value that specifies an image format in which the dashboard/dashboard item is exported. + */ + Format: string; + /** + * Gets or sets the resolution (in dpi) used to export a dashboard/dashboard item to an image. + * Value: An integer value that specifies the resolution (in dpi) used to export a dashboard/dashboard item to an image. + */ + Resolution: number; + /** + * Gets or sets the scale factor (in fractions of 1), by which a dashboard/dashboard item is scaled in the exported document. + * Value: A string value that specifies the scale factor by which a dashboard/dashboard item is scaled in the exported document. + */ + ScaleFactor: number; +} +/** + * Contains options related to exporting a dashboard/dashboard item to the Excel format. + */ +interface DashboardExcelExportOptions { + /** + * Gets or sets the Excel format in which the dashboard item is exported. + * Value: A DashboardExportExcelFormat value that specifies the Excel format in which the dashboard item is exported. + */ + Format: string; + /** + * Gets or sets a character used to separate values in a CSV document. + * Value: A string value that specifies the character used to separate values in a CSV document. + */ + CsvValueSeparator: string; + /** + * Gets or sets whether to add the state of master filter items to the exported document. + * Value: true, to add the state of master filter items to the exported document; otherwise, false. + */ + ExportFilters: boolean; + /** + * Gets or sets whether to add current parameter values to the exported document. + * Value: true, to add current parameter values to the exported document; otherwise, false. + */ + ExportParameters: boolean; + /** + * Gets or sets whether to add current values of a hidden parameter to the exported document. + * Value: true, to add current values of a hidden parameter to the exported document; otherwise, false. + */ + IncludeHiddenParameters: boolean; + /** + * Gets or sets the position of the dashboard state (such as master filter or current parameter values) in the exported document. + * Value: A DashboardStateExcelExportPosition object that specifies the position of the dashboard state in the exported document. + */ + DashboardStatePosition: string; +} +/** + * A client-side equivalent of the ASPxDashboard control. + */ +interface ASPxClientDashboard extends ASPxClientControl { + /** + * Fires when a round trip to the server has been initiated by a call to the client PerformDataCallback method. + */ + CustomDataCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs after the state of the dashboard displayed in the ASPxClientDashboard is changed. + */ + DashboardStateChanged: ASPxClientEvent>; + /** + * Occurs after a new dashboard is displayed in the ASPxClientDashboard. + */ + DashboardChanged: ASPxClientEvent>; + /** + * For internal use. + */ + CustomizeMenuItems: ASPxClientEvent>; + /** + * Occurs before any element in the Web Dashboard control has been rendered. + */ + BeforeRender: ASPxClientEvent>; + /** + * Occurs when an end-user clicks a dashboard item. + */ + ItemClick: ASPxClientEvent>; + /** + * Allows you to provide custom visual interactivity for data-bound dashboard items that support element selection and highlighting. + */ + ItemVisualInteractivity: ASPxClientEvent>; + /** + * Allows you to access underlying UI/Data Visualization widgets. + */ + ItemWidgetCreated: ASPxClientEvent>; + /** + * Allows you to access underlying UI/Data Visualization widgets. + */ + ItemWidgetUpdating: ASPxClientEvent>; + /** + * Allows you to access underlying UI/Data Visualization widgets. + */ + ItemWidgetUpdated: ASPxClientEvent>; + /** + * Allows you to access underlying UI/Data Visualization widgets. + */ + ItemBeforeWidgetDisposed: ASPxClientEvent>; + /** + * Occurs after the selection within the dashboard item is changed. + */ + ItemSelectionChanged: ASPxClientEvent>; + /** + * Allows you to color the required dashboard item elements using the specified colors. + */ + ItemElementCustomColor: ASPxClientEvent>; + /** + * Occurs when a master filter state is changed. + */ + ItemMasterFilterStateChanged: ASPxClientEvent>; + /** + * Occurs when a drill-down/drill-up is performed. + */ + ItemDrillDownStateChanged: ASPxClientEvent>; + /** + * Occurs after the available interactivity actions have changed for the specific dashboard item. + */ + ActionAvailabilityChanged: ASPxClientEvent>; + /** + * Occurs after parameter values provided using a Dynamic List are loaded. + */ + DynamicLookUpValuesLoaded: ASPxClientEvent>; + /** + * Occurs when a dashboard item update is initiated. + */ + ItemBeginUpdate: ASPxClientEvent>; + /** + * Occurs after the dashboard item update is performed. + */ + ItemEndUpdate: ASPxClientEvent>; + /** + * Occurs when a dashboard update is initiated. + */ + DashboardBeginUpdate: ASPxClientEvent>; + /** + * Occurs after the dashboard update is performed. + */ + DashboardEndUpdate: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback A ASPxClientDataCallback object that represents the JavaScript function which receives the callback data as a parameter. + */ + PerformDataCallback(parameter: string, onCallback: ASPxClientDataCallback): void; + /** + * Gets an inner part of the ASPxClientDashboard control. + */ + GetDashboardControl(): DashboardControl; + /** + * Switches the ASPxClientDashboard to the viewer mode. + */ + SwitchToViewer(): void; + /** + * Switches the ASPxClientDashboard to the designer mode. + */ + SwitchToDesigner(): void; + /** + * Gets the current working mode of the Web Dashboard. + */ + GetWorkingMode(): string; + /** + * Gets the identifier of the dashboard that is displayed in the ASPxClientDashboard. + */ + GetDashboardId(): string; + /** + * Gets the name of the dashboard that is displayed in the ASPxClientDashboard. + */ + GetDashboardName(): string; + /** + * Gets the state of the dashboard displayed in the ASPxClientDashboard. + */ + GetDashboardState(): string; + /** + * Sets the state of the dashboard displayed in the ASPxClientDashboard. + * @param dashboardState A JSON object that specifies the dashboard state. + */ + SetDashboardState(dashboardState: Object): void; + /** + * Sets the state of the dashboard displayed in the ASPxClientDashboard. + * @param dashboardStateString A string value that specifies the state of the dashboard displayed in the ASPxClientDashboard. + */ + SetDashboardState(dashboardStateString: string): void; + /** + * Loads a dashboard with the specified identifier from the dashboard storage. + * @param dashboardId A string value that specifies the dashboard identifier. + */ + LoadDashboard(dashboardId: string): void; + /** + * Saves a current dashboard to the dashboard storage. + */ + SaveDashboard(): void; + /** + * Invokes the Dashboard Parameters dialog. + */ + ShowParametersDialog(): void; + /** + * Closes the Dashboard Parameters dialog. + */ + HideParametersDialog(): void; + /** + * Returns dashboard parameter settings and metadata. + */ + GetParameters(): ASPxClientDashboardParameters; + /** + * Invokes the dialog that allows end-users to export the entire dashboard to the specified format. + * @param format A string value that specifies the format. For instance, you can use 'PDF' or 'Image'. + */ + ShowExportDashboardDialog(format: string): void; + /** + * Invokes the dialog that allows end-users to export the dashboard item to the specified format. + * @param itemComponentName A string value that specifies the component name of the dashboard item to export. + * @param format A string value that specifies the format. For instance, you can use 'PDF, 'Image' or 'Excel'. Note that some items (i.e., ImageDashboardItem) do not support exporting to the 'Excel' format. + */ + ShowExportDashboardItemDialog(itemComponentName: string, format: string): void; + /** + * Hides the dialog that allows end-users to export the dashboard/dashboard item. + */ + HideExportDialog(): void; + /** + * Returns settings that specify parameters affecting how the dashboard is exported. + */ + GetExportOptions(): ASPxClientDashboardExportOptions; + /** + * Allows you to obtain options related to exporting a dashboard/dashboard item to the PDF format. + */ + GetPdfExportOptions(): DashboardPdfExportOptions; + /** + * Allows you to obtain options related to exporting a dashboard/dashboard item to an image. + */ + GetImageExportOptions(): DashboardImageExportOptions; + /** + * Allows you to obtain options related to exporting a dashboard/dashboard item to the Excel format. + */ + GetExcelExportOptions(): DashboardExcelExportOptions; + /** + * Specifies settings that specify parameters affecting how the dashboard is exported. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + */ + SetExportOptions(options: ASPxClientDashboardExportOptions): void; + /** + * Allows you to specify options related to exporting a dashboard/dashboard item to the PDF format. + * @param options A DashboardPdfExportOptions object containing options related to exporting a dashboard/dashboard item to the PDF format. + */ + SetPdfExportOptions(options: DashboardPdfExportOptions): void; + /** + * Allows you to specify options related to exporting a dashboard/dashboard item to an image. + * @param options A DashboardImageExportOptions object containing options related to exporting a dashboard/dashboard item to an image. + */ + SetImageExportOptions(options: DashboardImageExportOptions): void; + /** + * Allows you to specify options related to exporting a dashboard/dashboard item to the Excel format. + * @param options A DashboardExcelExportOptions object containing options related to exporting a dashboard item to the Excel format. + */ + SetExcelExportOptions(options: DashboardExcelExportOptions): void; + /** + * Exports a dashboard to a PDF file and writes it to the Response. + */ + ExportToPdf(): void; + /** + * Exports a dashboard to a PDF file with the specified export options and writes it to the Response. + * @param options A DashboardPdfExportOptions object containing PDF-specific export options. + */ + ExportToPdf(options: DashboardPdfExportOptions): void; + /** + * Exports a dashboard to a PDF file with the specified export options and writes it to the Response. + * @param options A DashboardPdfExportOptions object containing PDF-specific export options. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToPdf(options: DashboardPdfExportOptions, fileName: string): void; + /** + * Exports a dashboard to a PDF file with the specified export options and writes it to the Response. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + */ + ExportToPdf(options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard to a PDF file with the specified export options and writes it to the Response. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToPdf(options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Exports a dashboard to an Image file and writes it to the Response. + */ + ExportToImage(): void; + /** + * Exports a dashboard to an Image file with the specified export options and writes it to the Response. + * @param options A DashboardImageExportOptions object containing image-specific export options. + */ + ExportToImage(options: DashboardImageExportOptions): void; + /** + * Exports a dashboard to an Image file with the specified export options and writes it to the Response. + * @param options A DashboardImageExportOptions object containing image-specific export options. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToImage(options: DashboardImageExportOptions, fileName: string): void; + /** + * Exports a dashboard to an Image file with the specified export options and writes it to the Response. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + */ + ExportToImage(options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard to an Image file with the specified export options and writes it to the Response. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToImage(options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Exports dashboard data to the specified file in Excel format. + */ + ExportToExcel(): void; + /** + * Exports dashboard data to the specified file in Excel format. + * @param options A DashboardExcelExportOptions object containing Excel-specific options. + */ + ExportToExcel(options: DashboardExcelExportOptions): void; + /** + * Exports dashboard data to the specified file in Excel format. + * @param options A DashboardExcelExportOptions object containing Excel-specific options. + * @param fileName A string value that specifies the name of the exported file. + */ + ExportToExcel(options: DashboardExcelExportOptions, fileName: string): void; + /** + * Exports a dashboard item to a PDF file and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + */ + ExportDashboardItemToPdf(itemName: string): void; + /** + * Exports a dashboard item to a PDF file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardPdfExportOptions object containing PDF-specific export options. + */ + ExportDashboardItemToPdf(itemName: string, options: DashboardPdfExportOptions): void; + /** + * Exports a dashboard item to a PDF file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardPdfExportOptions object containing PDF-specific export options. + * @param fileName A string that specifies the name of the exported file. + */ + ExportDashboardItemToPdf(itemName: string, options: DashboardPdfExportOptions, fileName: string): void; + /** + * Exports a dashboard item to a PDF file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + */ + ExportDashboardItemToPdf(itemName: string, options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard item to a PDF file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + * @param fileName A string that specifies the name of the exported file. + */ + ExportDashboardItemToPdf(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Exports a dashboard item to an Image file and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + */ + ExportDashboardItemToImage(itemName: string): void; + /** + * Exports a dashboard item to an Image file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardImageExportOptions object containing image-specific export options. + */ + ExportDashboardItemToImage(itemName: string, options: DashboardImageExportOptions): void; + /** + * Exports a dashboard item to an Image file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardImageExportOptions object containing image-specific export options. + * @param fileName A string value that specifies the name of the exported file. + */ + ExportDashboardItemToImage(itemName: string, options: DashboardImageExportOptions, fileName: string): void; + /** + * Exports a dashboard item to an Image file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + */ + ExportDashboardItemToImage(itemName: string, options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard item to an Image file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + * @param fileName A string value that specifies the name of the exported file. + */ + ExportDashboardItemToImage(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Exports a dashboard item to an Excel file and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + */ + ExportDashboardItemToExcel(itemName: string): void; + /** + * Exports a dashboard item to an Excel file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardExcelExportOptions object containing Excel export options. + */ + ExportDashboardItemToExcel(itemName: string, options: DashboardExcelExportOptions): void; + /** + * Exports a dashboard item to an Excel file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardExcelExportOptions object containing Excel export options. + * @param fileName A string that specifies the name of the exported Excel file. + */ + ExportDashboardItemToExcel(itemName: string, options: DashboardExcelExportOptions, fileName: string): void; + /** + * Exports a dashboard item to an Excel file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + */ + ExportDashboardItemToExcel(itemName: string, options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard item to an Excel file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + * @param fileName A string that specifies the name of the exported Excel file. + */ + ExportDashboardItemToExcel(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Returns whether or not master filtering can be applied in the current state of the specified master filter item. + * @param itemName A string that specifies the component name of the master filter item. + */ + CanSetMasterFilter(itemName: string): boolean; + /** + * Returns whether or not the specified master filter can be cleared in the current state. + * @param itemName A string that specifies the component name of the master filter item. + */ + CanClearMasterFilter(itemName: string): boolean; + /** + * Returns whether or not drill down is possible in the current state of the specified dashboard item. + * @param itemName A string that specifies the component name of the dashboard item. + */ + CanPerformDrillDown(itemName: string): boolean; + /** + * Returns whether or not drill up is possible in the current state of the specified dashboard item. + * @param itemName A string that specifies the component name of the dashboard item. + */ + CanPerformDrillUp(itemName: string): boolean; + /** + * Selects required elements by their values in the specified master filter item. + * @param itemName A String that specifies the component name of the master filter item. + * @param values Values that will be used to select elements in the master filter item. + */ + SetMasterFilter(itemName: string, values: Object[][]): void; + /** + * Selects the required elements in the specified master filter item. + * @param itemName A String that species the component name of the master filter item. + * @param axisPointTuples An array of ASPxClientDashboardItemDataAxisPointTuple objects used to identify master filter elements. + */ + SetMasterFilter(itemName: string, axisPointTuples: ASPxClientDashboardItemDataAxisPointTuple[]): void; + /** + * Performs a drill-down into the required element by its value. + * @param itemName A String that species the component name of the dashboard item. + * @param value A value that will be used to perform a drill-down for the required element. + */ + PerformDrillDown(itemName: string, value: Object): void; + /** + * Performs a drill-down into the required element. + * @param itemName A String that specifies the component name of the dashboard item. + * @param axisPointTuple A ASPxClientDashboardItemDataAxisPointTuple object representing a set of axis points. + */ + PerformDrillDown(itemName: string, axisPointTuple: ASPxClientDashboardItemDataAxisPointTuple): void; + /** + * Clears the specified master filter item. + * @param itemName A string that specifies the component name of the master filter item. + */ + ClearMasterFilter(itemName: string): void; + /** + * Performs a drill-up for the specified dashboard item. + * @param itemName A String that specifies the component name of the dashboard item. + */ + PerformDrillUp(itemName: string): void; + /** + * Returns axis point tuples identifying elements that can be used to perform drill-down in the specified dashboard item. + * @param itemName A String that is the component name of the dashboard item. + */ + GetAvailableDrillDownValues(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Returns the axis point tuple identifying the current drill-down state. + * @param itemName A String that is the component name of the dashboard item. + */ + GetCurrentDrillDownValues(itemName: string): ASPxClientDashboardItemDataAxisPointTuple; + /** + * Returns axis point tuples identifying elements that can be selected in the current state of the master filter item. + * @param itemName A String that is the component name of the master filter item. + */ + GetAvailableFilterValues(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Returns axis point tuples identifying currently selected elements in the master filter item. + * @param itemName A String that is the component name of the master filter item. + */ + GetCurrentFilterValues(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Returns currently selected elements in the master filter item. + * @param itemName A String that specifies a component name of the master filter item. + */ + GetCurrentSelection(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Returns the client data for the specified dashboard item. + * @param itemName A string that specifies the component name of the dashboard item. + */ + GetItemData(itemName: string): ASPxClientDashboardItemData; + /** + * Refreshes an entire dashboard displayed in the Web Dashboard control. + */ + Refresh(): void; + /** + * Refreshes the specific item from the dashboard displayed in the Web Dashboard control. + * @param itemName A string value that specifies the component name of the dashboard item to be refreshed. + */ + Refresh(itemName: string): void; + /** + * Refreshes specific items from the dashboard displayed in the Web Dashboard control. + * @param itemName An array of string values that specify the component names of the dashboard items to be refreshed. + */ + Refresh(itemName: string[]): void; + /** + * Requests underlying data for the specified dashboard item. + * @param itemName A string that specifies the component name of the dashboard item. + * @param args A ASPxClientDashboardItemRequestUnderlyingDataParameters object containing parameters used to obtain the underlying data. + * @param onCompleted A ASPxClientDashboardItemRequestUnderlyingDataCompleted object that references a method executed after the request is completed. + */ + RequestUnderlyingData(itemName: string, args: ASPxClientDashboardItemRequestUnderlyingDataParameters, onCompleted: ASPxClientDashboardItemRequestUnderlyingDataCompleted): void; + /** + * Returns the currently selected range in the specified Range Filter dashboard item. + * @param itemName A String value that specifies the component name of the Range Filter dashboard item. + */ + GetCurrentRange(itemName: string): ASPxClientDashboardRangeFilterSelection; + /** + * Returns the visible range for the specified Range Filter dashboard item. + * @param itemName A String value that specifies the component name of the Range Filter dashboard item. + */ + GetEntireRange(itemName: string): ASPxClientDashboardRangeFilterSelection; + /** + * Selects the required range in the specified Range Filter dashboard item. + * @param itemName A String that specifies the component name of the Range Filter dashboard item. + * @param range A ASPxClientDashboardRangeFilterSelection object that specifies a range to be selected. + */ + SetRange(itemName: string, range: ASPxClientDashboardRangeFilterSelection): void; + /** + * Selects a predefined range in the Range Filter dashboard item. + * @param itemName A String value that specifies the component name of the Range Filter. + * @param dateTimePeriodName A String value that specifies the predefined range name. + */ + SetPredefinedRange(itemName: string, dateTimePeriodName: string): void; + /** + * Returns names of the predefined ranges available for the specified Range Filter. + * @param itemName A string value that specifies the component name of the Range Filter dashboard item. + */ + GetAvailablePredefinedRanges(itemName: string): string[]; + /** + * Returns the name of the currently selected predefined range. + * @param itemName A string value that specifies the component name of the Range Filter dashboard item. + */ + GetCurrentPredefinedRange(itemName: string): string; +} +/** + * References a method that will handle the DashboardStateChanged event. + */ +interface ASPxClientDashboardStateChangedEventHandler { + /** + * References a method that will handle the DashboardStateChanged event. + * @param source The event source. + * @param e A ASPxClientDashboardStateChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardStateChangedEventArgs): void; +} +/** + * Provides data for the DashboardStateChanged event. + */ +interface ASPxClientDashboardStateChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the current state of the dashboard. + * Value: A string value that is the current state of the dashboard. + */ + DashboardState: string; +} +/** + * References a method that will handle the DashboardChanged event. + */ +interface ASPxClientDashboardChangedEventHandler { + /** + * References a method that will handle the DashboardChanged event. + * @param source The event source. + * @param e A ASPxClientDashboardChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardChangedEventArgs): void; +} +/** + * Provides data for the DashboardChanged event. + */ +interface ASPxClientDashboardChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the identifier of a newly opened dashboard. + * Value: A string value that is an identifier of newly opened dashboard. + */ + DashboardId: string; + /** + * Gets the name of a newly opened dashboard. + * Value: A string value that is the name of newly opened dashboard. + */ + DashboardName: string; +} +interface ASPxClientDashboardCustomizeMenuItemsEventHandler { + (source: S, e: ASPxClientDashboardCustomizeMenuItemsEventArgs): void; +} +interface ASPxClientDashboardMenuItem { + id: string; + title: string; + template: string; + selected: boolean; + disabled: boolean; + hasSeparator: boolean; + click: Function; + hotKey: number; +} +interface ASPxClientDashboardCustomizeMenuItemsEventArgs extends ASPxClientEventArgs { + Items: ASPxClientDashboardMenuItem[]; + FindById(itemId: string): ASPxClientDashboardMenuItem; +} +/** + * References a method that will handle the BeforeRender event. + */ +interface ASPxClientDashboardBeforeRenderEventHandler { + /** + * References a method that will handle the BeforeRender event. + * @param source The event source. + * @param e An ASPxClientEventArgs object that contains event data. + */ + (source: S, e: ASPxClientEventArgs): void; +} +/** + * Serves as the base class for classes that provide data for client-side events related to dashboard items. + */ +interface ASPxClientDashboardItemEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item. + * Value: A string value that is the component name of the dashboard item. + */ + ItemName: string; + /** + * Returns whether or not the specified value is null. + * @param value The specified value. + */ + IsNullValue(value: Object): boolean; + /** + * Returns whether or not the specified value is 'others'. + * @param value The specified value. + */ + IsOthersValue(value: Object): boolean; +} +/** + * References a method that will handle the ItemMasterFilterStateChanged event. + */ +interface ASPxClientDashboardItemMasterFilterStateChangedEventHandler { + /** + * References a method that will handle the ItemMasterFilterStateChanged event. + * @param source The event source. + * @param e An ASPxClientDashboardItemMasterFilterStateChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemMasterFilterStateChangedEventArgs): void; +} +/** + * Provides data for the ItemMasterFilterStateChanged event. + */ +interface ASPxClientDashboardItemMasterFilterStateChangedEventArgs extends ASPxClientDashboardItemEventArgs { + /** + * Gets the currently selected values. + * Value: An array of objects that are the currently selected values. + */ + Values: Object[][]; +} +/** + * References a method that will handle the ItemDrillDownStateChanged event. + */ +interface ASPxClientDashboardItemDrillDownStateChangedEventHandler { + /** + * References a method that will handle the ItemDrillDownStateChanged event. + * @param source The event source. + * @param e An ASPxClientDashboardItemDrillDownStateChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardItemDrillDownStateChangedEventArgs): void; +} +/** + * Provides data for the ItemDrillDownStateChanged event. + */ +interface ASPxClientDashboardItemDrillDownStateChangedEventArgs extends ASPxClientDashboardItemEventArgs { + /** + * Gets the drill-down action performed in the dashboard item. + * Value: A string value that is the drill-down action performed in the dashboard item. + */ + Action: string; + /** + * Gets values from the current drill-down hierarchy. + * Value: An array of values from the current drill-down hierarchy. + */ + Values: Object[]; +} +/** + * References a method that will handle the ActionAvailabilityChanged event. + */ +interface ASPxClientActionAvailabilityChangedEventHandler { + /** + * References a method that will handle the ActionAvailabilityChanged event. + * @param source The event source. + * @param e A ASPxClientActionAvailabilityChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientActionAvailabilityChangedEventArgs): void; +} +/** + * Provides data for the ActionAvailabilityChanged event. + */ +interface ASPxClientActionAvailabilityChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item. + * Value: A string value that is the component name of the dashboard item. + */ + ItemName: string; +} +/** + * References a method that will handle the DynamicLookUpValuesLoaded event. + */ +interface ASPxClientDynamicLookUpValuesLoadedEventHandler { + /** + * References a method that will handle the DynamicLookUpValuesLoaded event. + * @param source The event source. + * @param e A ASPxClientDynamicLookUpValuesLoadedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDynamicLookUpValuesLoadedEventArgs): void; +} +/** + * Provides data for the DynamicLookUpValuesLoaded event. + */ +interface ASPxClientDynamicLookUpValuesLoadedEventArgs extends ASPxClientEventArgs { + /** + * Gets the dashboard parameter name whose values have been loaded. + * Value: A string value that is the dashboard parameter name whose values have been loaded. + */ + ParameterName: string; +} +/** + * References a method that will handle the ItemBeginUpdate event. + */ +interface ASPxClientItemBeginUpdateEventHandler { + /** + * References a method that will handle the ItemBeginUpdate event. + * @param source The event source. + * @param e A ASPxClientItemBeginUpdateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientItemBeginUpdateEventArgs): void; +} +/** + * Provides data for the ItemBeginUpdate event. + */ +interface ASPxClientItemBeginUpdateEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item. + * Value: A string value that is the component name of the dashboard item. + */ + ItemName: string; +} +/** + * References a method that will handle the ItemEndUpdate event. + */ +interface ASPxClientItemEndUpdateEventHandler { + /** + * References a method that will handle the ItemEndUpdate event. + * @param source The event source. + * @param e A ASPxClientItemEndUpdateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientItemEndUpdateEventArgs): void; +} +/** + * Provides data for the ItemEndUpdate event. + */ +interface ASPxClientItemEndUpdateEventArgs extends ASPxClientEventArgs { + /** + * Gets the component name of the dashboard item. + * Value: A string value that is the component name of the dashboard item. + */ + ItemName: string; +} +/** + * References a method that will handle the DashboardBeginUpdate event. + */ +interface ASPxClientDashboardBeginUpdateEventHandler { + /** + * References a method that will handle the DashboardBeginUpdate event. + * @param source The event source. + * @param e A ASPxClientDashboardBeginUpdateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardBeginUpdateEventArgs): void; +} +/** + * Provides data for the DashboardBeginUpdate event. + */ +interface ASPxClientDashboardBeginUpdateEventArgs extends ASPxClientEventArgs { + /** + * Gets the identifier of the dashboard for which the event was raised. + * Value: A string value that is the dashboard identifier. + */ + DashboardId: string; +} +/** + * References a method that will handle the DashboardEndUpdate event. + */ +interface ASPxClientDashboardEndUpdateEventHandler { + /** + * References a method that will handle the DashboardEndUpdate event. + * @param source The event source. + * @param e An ASPxClientDashboardEndUpdateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardEndUpdateEventArgs): void; +} +/** + * Provides data for the DashboardEndUpdate event. + */ +interface ASPxClientDashboardEndUpdateEventArgs extends ASPxClientEventArgs { + /** + * Gets the identifier of the dashboard for which the event was raised. + * Value: A string value that is the dashboard identifier. + */ + DashboardId: string; +} +/** + * A client-side equivalent of the ASPxDashboardViewer control. + */ +interface ASPxClientDashboardViewer extends ASPxClientControl { + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs after the available interactivity actions have changed. + */ + ActionAvailabilityChanged: ASPxClientEvent>; + /** + * Occurs when an end-user changes the state of the master filter. + */ + MasterFilterSet: ASPxClientEvent>; + /** + * Occurs when an end-user clears the selection in the master filter item. + */ + MasterFilterCleared: ASPxClientEvent>; + /** + * Provides the capability to handle data loading errors in the ASPxClientDashboardViewer. + */ + DataLoadingError: ASPxClientEvent>; + /** + * Occurs after a drill-down is performed. + */ + DrillDownPerformed: ASPxClientEvent>; + /** + * Occurs after a drill-up is performed. + */ + DrillUpPerformed: ASPxClientEvent>; + /** + * Occurs after the ASPxClientDashboardViewer is loaded. + */ + Loaded: ASPxClientEvent>; + /** + * Occurs when an end-user clicks a dashboard item. + */ + ItemClick: ASPxClientEvent>; + /** + * Allows you to provide custom visual interactivity for data-bound dashboard items that support element selection and highlighting. + */ + ItemVisualInteractivity: ASPxClientEvent>; + /** + * Allows you to access underlying UI/Data Visualization widgets. + */ + ItemWidgetCreated: ASPxClientEvent>; + /** + * Allows you to access underlying UI/Data Visualization widgets. + */ + ItemWidgetUpdating: ASPxClientEvent>; + /** + * Allows you to access underlying UI/Data Visualization widgets. + */ + ItemWidgetUpdated: ASPxClientEvent>; + /** + * Allows you to access underlying UI/Data Visualization widgets. + */ + ItemBeforeWidgetDisposed: ASPxClientEvent>; + /** + * Occurs after the selection within the dashboard item is changed. + */ + ItemSelectionChanged: ASPxClientEvent>; + /** + * Allows you to color the required dashboard item elements using the specified colors. + */ + ItemElementCustomColor: ASPxClientEvent>; + /** + * Reloads data in the data sources. + */ + ReloadData(): void; + /** + * Reloads data in the data sources. + * @param parameters An array of ASPxClientDashboardParameter objects that specify dashboard parameters on the client side. + */ + ReloadData(parameters: ASPxClientDashboardParameter[]): void; + /** + * Returns dashboard parameter settings and metadata. + */ + GetParameters(): ASPxClientDashboardParameters; + /** + * Locks the EndUpdateParameters method call. + */ + BeginUpdateParameters(): void; + /** + * Unlocks the BeginUpdateParameters method and applies changes made to the parameter settings. + */ + EndUpdateParameters(): void; + /** + * Returns the currently selected range in the specified Range Filter dashboard item. + * @param itemName A String value that specifies the component name of the Range Filter dashboard item. + */ + GetCurrentRange(itemName: string): ASPxClientDashboardRangeFilterSelection; + /** + * Returns the visible range for the specified Range Filter dashboard item. + * @param itemName A String value that specifies the component name of the Range Filter dashboard item. + */ + GetEntireRange(itemName: string): ASPxClientDashboardRangeFilterSelection; + /** + * Selects the required range in the specified Range Filter dashboard item. + * @param itemName A String that specifies the component name of the Range Filter dashboard item. + * @param range A ASPxClientDashboardRangeFilterSelection object that specifies a range to be selected. + */ + SetRange(itemName: string, range: ASPxClientDashboardRangeFilterSelection): void; + /** + * Selects a predefined range in the Range Filter dashboard item. + * @param itemName A String value that specifies the component name of the Range Filter. + * @param dateTimePeriodName A String value that specifies the predefined range name. + */ + SetPredefinedRange(itemName: string, dateTimePeriodName: string): void; + /** + * Returns names of the predefined ranges available for the specified Range Filter. + * @param itemName A string value that specifies the component name of the Range Filter dashboard item. + */ + GetAvailablePredefinedRanges(itemName: string): string[]; + /** + * Returns the name of the currently selected predefined range. + * @param itemName A string value that specifies the component name of the Range Filter dashboard item. + */ + GetCurrentPredefinedRange(itemName: string): string; + /** + * Returns axis point tuples identifying elements that can be used to perform drill-down in the specified dashboard item. + * @param itemName A String that is the component name of the dashboard item. + */ + GetAvailableDrillDownValues(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Returns the axis point tuple identifying the current drill-down state. + * @param itemName A String that is the component name of the dashboard item. + */ + GetCurrentDrillDownValues(itemName: string): ASPxClientDashboardItemDataAxisPointTuple; + /** + * Returns axis point tuples identifying elements that can be selected in the current state of the master filter item. + * @param itemName A String that is the component name of the master filter item. + */ + GetAvailableFilterValues(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Returns axis point tuples identifying currently selected elements in the master filter item. + * @param itemName A String that is the component name of the master filter item. + */ + GetCurrentFilterValues(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Returns currently selected elements in the master filter item. + * @param itemName A String that specifies a component name of the master filter item. + */ + GetCurrentSelection(itemName: string): ASPxClientDashboardItemDataAxisPointTuple[]; + /** + * Requests underlying data for the specified dashboard item. + * @param itemName A string that specifies the component name of the dashboard item. + * @param args A ASPxClientDashboardItemRequestUnderlyingDataParameters object containing parameters used to obtain the underlying data. + * @param onCompleted A ASPxClientDashboardItemRequestUnderlyingDataCompleted object that references a method executed after the request is completed. + */ + RequestUnderlyingData(itemName: string, args: ASPxClientDashboardItemRequestUnderlyingDataParameters, onCompleted: ASPxClientDashboardItemRequestUnderlyingDataCompleted): void; + /** + * Invokes the Dashboard Parameters dialog. + */ + ShowParametersDialog(): void; + /** + * Closes the Dashboard Parameters dialog. + */ + HideParametersDialog(): void; + /** + * Returns settings that specify parameters affecting how the dashboard is exported. + */ + GetExportOptions(): ASPxClientDashboardExportOptions; + /** + * Allows you to obtain options related to exporting a dashboard/dashboard item to the PDF format. + */ + GetPdfExportOptions(): DashboardPdfExportOptions; + /** + * Allows you to obtain options related to exporting a dashboard/dashboard item to an image. + */ + GetImageExportOptions(): DashboardImageExportOptions; + /** + * Allows you to obtain options related to exporting a dashboard/dashboard item to the Excel format. + */ + GetExcelExportOptions(): DashboardExcelExportOptions; + /** + * Specifies settings that specify parameters affecting how the dashboard is exported. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + */ + SetExportOptions(options: ASPxClientDashboardExportOptions): void; + /** + * Allows you to specify options related to exporting a dashboard/dashboard item to the PDF format. + * @param options A DashboardPdfExportOptions object containing options related to exporting a dashboard/dashboard item to the PDF format. + */ + SetPdfExportOptions(options: DashboardPdfExportOptions): void; + /** + * Allows you to specify options related to exporting a dashboard/dashboard item to an image. + * @param options A DashboardImageExportOptions object containing options related to exporting a dashboard/dashboard item to an image. + */ + SetImageExportOptions(options: DashboardImageExportOptions): void; + /** + * Allows you to specify options related to exporting a dashboard/dashboard item to the Excel format. + * @param options A DashboardExcelExportOptions object containing options related to exporting a dashboard item to the Excel format. + */ + SetExcelExportOptions(options: DashboardExcelExportOptions): void; + /** + * Exports a dashboard to a PDF file and writes it to the Response. + */ + ExportToPdf(): void; + /** + * Exports a dashboard to a PDF file with the specified export options and writes it to the Response. + * @param options A DashboardPdfExportOptions object containing PDF-specific export options. + */ + ExportToPdf(options: DashboardPdfExportOptions): void; + /** + * Exports a dashboard to a PDF file with the specified export options and writes it to the Response. + * @param options A DashboardPdfExportOptions object containing PDF-specific export options. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToPdf(options: DashboardPdfExportOptions, fileName: string): void; + /** + * Exports a dashboard to a PDF file with the specified export options and writes it to the Response. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + */ + ExportToPdf(options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard to a PDF file with the specified export options and writes it to the Response. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToPdf(options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Exports a dashboard to an Image file and writes it to the Response. + */ + ExportToImage(): void; + /** + * Exports a dashboard to an Image file with the specified export options and writes it to the Response. + * @param options A DashboardImageExportOptions object containing image-specific export options. + */ + ExportToImage(options: DashboardImageExportOptions): void; + /** + * Exports a dashboard to an Image file with the specified export options and writes it to the Response. + * @param options A DashboardImageExportOptions object containing image-specific export options. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToImage(options: DashboardImageExportOptions, fileName: string): void; + /** + * Exports a dashboard to an Image file with the specified export options and writes it to the Response. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + */ + ExportToImage(options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard to an Image file with the specified export options and writes it to the Response. + * @param options A ASPxClientDashboardExportOptions object containing settings that specify parameters affecting how the dashboard is exported. + * @param fileName A string that specifies the name of the exported file. + */ + ExportToImage(options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Exports dashboard data to the specified file in Excel format. + */ + ExportToExcel(): void; + /** + * Exports dashboard data to the specified file in Excel format. + * @param options A DashboardExcelExportOptions object containing Excel-specific options. + */ + ExportToExcel(options: DashboardImageExportOptions): void; + /** + * Exports dashboard data to the specified file in Excel format. + * @param options A DashboardExcelExportOptions object containing Excel-specific options. + * @param fileName A string value that specifies the name of the exported file. + */ + ExportToExcel(options: DashboardImageExportOptions, fileName: string): void; + /** + * Exports a dashboard item to a PDF file and writes it to the Response. + * @param itemName A String that is the component name of the dashboard item to be exported. + */ + ExportDashboardItemToPdf(itemName: string): void; + /** + * Exports a dashboard item to a PDF file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardPdfExportOptions object containing PDF-specific export options. + */ + ExportDashboardItemToPdf(itemName: string, options: DashboardPdfExportOptions): void; + /** + * Exports a dashboard item to a PDF file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardPdfExportOptions object containing PDF-specific export options. + * @param fileName A string that specifies the name of the exported file. + */ + ExportDashboardItemToPdf(itemName: string, options: DashboardPdfExportOptions, fileName: string): void; + /** + * Exports a dashboard item to a PDF file with the specified export options and writes it to the Response. + * @param itemName A String that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + */ + ExportDashboardItemToPdf(itemName: string, options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard item to a PDF file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + * @param fileName A string that specifies the name of the exported file. + */ + ExportDashboardItemToPdf(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Exports a dashboard item to an Image file and writes it to the Response. + * @param itemName A String that is the component name of the dashboard item to be exported. + */ + ExportDashboardItemToImage(itemName: string): void; + /** + * Exports a dashboard item to an Image file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardImageExportOptions object containing image-specific export options. + */ + ExportDashboardItemToImage(itemName: string, options: DashboardImageExportOptions): void; + /** + * Exports a dashboard item to an Image file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardImageExportOptions object containing image-specific export options. + * @param fileName A string value that specifies the name of the exported file. + */ + ExportDashboardItemToImage(itemName: string, options: DashboardImageExportOptions, fileName: string): void; + /** + * Exports a dashboard item to an Image file with the specified export options and writes it to the Response. + * @param itemName A String that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + */ + ExportDashboardItemToImage(itemName: string, options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard item to an Image file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + * @param fileName A string value that specifies the name of the exported file. + */ + ExportDashboardItemToImage(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Exports a dashboard item to an Excel file and writes it to the Response. + * @param itemName A String that is the component name of the dashboard item to be exported. + */ + ExportDashboardItemToExcel(itemName: string): void; + /** + * Exports a dashboard item to an Excel file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardExcelExportOptions object containing Excel export options. + */ + ExportDashboardItemToExcel(itemName: string, options: DashboardExcelExportOptions): void; + /** + * Exports a dashboard item to an Excel file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options A DashboardExcelExportOptions object containing Excel export options. + * @param fileName A string that specifies the name of the exported Excel file. + */ + ExportDashboardItemToExcel(itemName: string, options: DashboardExcelExportOptions, fileName: string): void; + /** + * Exports a dashboard item to an Excel file with the specified export options and writes it to the Response. + * @param itemName A String that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options to be applied to the exported dashboard item. + */ + ExportDashboardItemToExcel(itemName: string, options: ASPxClientDashboardExportOptions): void; + /** + * Exports a dashboard item to an Excel file with the specified export options and writes it to the Response. + * @param itemName A string that is the component name of the dashboard item to be exported. + * @param options An ASPxClientDashboardExportOptions object containing export options. + * @param fileName A string that specifies the name of the exported Excel file. + */ + ExportDashboardItemToExcel(itemName: string, options: ASPxClientDashboardExportOptions, fileName: string): void; + /** + * Returns the dashboard width. + */ + GetWidth(): number; + /** + * Returns the dashboard height. + */ + GetHeight(): number; + /** + * Specifies the dashboard width. + * @param width An integer value that specifies the dashboard width. + */ + SetWidth(width: number): void; + /** + * Specifies the dashboard height. + * @param height An integer value that specifies the dashboard height. + */ + SetHeight(height: number): void; + /** + * Specifies the dashboard size. + * @param width An integer value that specifies the dashboard width. + * @param height An integer value that specifies the dashboard height. + */ + SetSize(width: number, height: number): void; + /** + * Selects required elements by their values in the specified master filter item. + * @param itemName A String that species the component name of the master filter item. + * @param values Values that will be used to select elements in the master filter item. + */ + SetMasterFilter(itemName: string, values: Object[][]): void; + /** + * Selects the required elements in the specified master filter item. + * @param itemName A String that specifies the component name of the master filter item. + * @param axisPointTuples An array of ASPxClientDashboardItemDataAxisPointTuple objects used to identify master filter elements. + */ + SetMasterFilter(itemName: string, axisPointTuples: ASPxClientDashboardItemDataAxisPointTuple[]): void; + /** + * Performs a drill-down for the required element by its value. + * @param itemName A String that species the component name of the dashboard item. + * @param value A value that will be used to perform a drill-down for the required element. + */ + PerformDrillDown(itemName: string, value: Object): void; + /** + * Performs a drill-down for the required element. + * @param itemName A String that specifies the component name of the dashboard item. + * @param axisPointTuple A ASPxClientDashboardItemDataAxisPointTuple object representing a set of axis points. + */ + PerformDrillDown(itemName: string, axisPointTuple: ASPxClientDashboardItemDataAxisPointTuple): void; + /** + * Clears the specified master filter item. + * @param itemName A String that specifies the component name of the master filter item. + */ + ClearMasterFilter(itemName: string): void; + /** + * Performs a drill-up for the specified dashboard item. + * @param itemName A String that specifies the component name of the dashboard item. + */ + PerformDrillUp(itemName: string): void; + /** + * Returns whether or not the specified master filter item allows selecting one or more elements. + * @param itemName A String that specifies the component name of the master filter item. + */ + CanSetMasterFilter(itemName: string): boolean; + /** + * Returns whether or not the specified master filter can be cleared in the current state. + * @param itemName A String that specifies the component name of the master filter item. + */ + CanClearMasterFilter(itemName: string): boolean; + /** + * Returns whether or not drill down is possible in the current state of the specified dashboard item. + * @param itemName A String that specifies the component name of the dashboard item. + */ + CanPerformDrillDown(itemName: string): boolean; + /** + * Returns whether or not drill up is possible in the current state of the specified dashboard item. + * @param itemName A String that specifies the component name of the dashboard item. + */ + CanPerformDrillUp(itemName: string): boolean; + /** + * Returns the client data for the specified dashboard item. + * @param itemName A string that specifies the component name of the dashboard item. + */ + GetItemData(itemName: string): ASPxClientDashboardItemData; +} +/** + * References a method that will handle the ActionAvailabilityChanged event. + */ +interface ASPxClientDashboardActionAvailabilityChangedEventHandler { + /** + * References a method that will handle the ActionAvailabilityChanged event. + * @param source The event source. + * @param e A ASPxClientDashboardActionAvailabilityChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardActionAvailabilityChangedEventArgs): void; +} +/** + * Provides data for the ActionAvailabilityChanged event. + */ +interface ASPxClientDashboardActionAvailabilityChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets whether or not data reloading is available in the current state of dashboard item. + * Value: true, if data reloading is available in the current state of dashboard item; otherwise, false. + */ + IsReloadDataAvailable: boolean; + /** + * Gets interactivity actions currently available for the dashboard item. + * Value: An array of ASPxClientDashboardItemAction objects that represent interactivity actions currently available for the dashboard item. + */ + ItemActions: ASPxClientDashboardItemAction[]; +} +/** + * References a method that will handle the DataLoadingError event. + */ +interface ASPxClientDashboardDataLoadingErrorEventHandler { + /** + * References a method that will handle the DataLoadingError event. + * @param source The event source. + * @param e A ASPxClientDashboardDataLoadingErrorEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardDataLoadingErrorEventArgs): void; +} +/** + * Provides data for the DataLoadingError event. + */ +interface ASPxClientDashboardDataLoadingErrorEventArgs extends ASPxClientEventArgs { + /** + * Allows you to determine whether or not the error message will be shown. + */ + IsErrorMessageShown(): boolean; + /** + * Allows you to specify whether to show the error message. + * @param value true, to show the error message; otherwise, false. + */ + ShowErrorMessage(value: boolean): void; + /** + * Allows you to obtain the displayed error message. + */ + GetError(): string; + /** + * Allows you to specify the displayed error message. + * @param value A string value that specifies the displayed error message. + */ + SetError(value: string): void; +} +/** + * Represents an interactivity action in the dashboard item. + */ +interface ASPxClientDashboardItemAction { + /** + * Gets the name of the dashboard item. + * Value: A string that specifies the name of the dashboard item. + */ + ItemName: string; + /** + * Gets interactivity actions performed on a dashboard item. + * Value: An array of ASPxClientDashboardAction values that specify interactivity actions performed on a dashboard item. + */ + Actions: any[]; +} +declare enum ASPxClientDashboardAction { + SetMasterFilter=0, + ClearMasterFilter=1, + DrillDown=2, + DrillUp=3 +} +/** + * References a method that will handle the MasterFilterSet event. + */ +interface ASPxClientDashboardMasterFilterSetEventHandler { + /** + * References a method that will handle the MasterFilterSet event. + * @param source The event source. + * @param e A ASPxClientDashboardMasterFilterSetEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardMasterFilterSetEventArgs): void; +} +/** + * Provides data for the MasterFilterSet event. + */ +interface ASPxClientDashboardMasterFilterSetEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the dashboard item. + * Value: A string value that specifies the component name of the dashboard item. + */ + ItemName: string; + /** + * Gets values of currently selected elements in the master filter item. + * Value: Values of currently selected elements in the master filter item. + */ + Values: Object[][]; + /** + * Returns whether or not the specified value is NullValue. + * @param value The specified value. + */ + IsNullValue(value: Object): boolean; + /** + * Returns whether or not the specified value is OthersValue. + * @param value The specified value. + */ + IsOthersValue(value: Object): boolean; +} +/** + * References a method that will handle the MasterFilterCleared event. + */ +interface ASPxClientDashboardMasterFilterClearedEventHandler { + /** + * References a method that will handle the MasterFilterCleared event. + * @param source The event source. + * @param e A ASPxClientDashboardMasterFilterClearedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardMasterFilterClearedEventArgs): void; +} +/** + * Provides data for the MasterFilterCleared event. + */ +interface ASPxClientDashboardMasterFilterClearedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the dashboard item. + * Value: A string value that is the component name of the dashboard item. + */ + ItemName: string; +} +/** + * References a method that will handle the DrillDownPerformed event. + */ +interface ASPxClientDashboardDrillDownPerformedEventHandler { + /** + * References a method that will handle the DrillDownPerformed event. + * @param source The event source. + * @param e A ASPxClientDashboardDrillDownPerformedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardDrillDownPerformedEventArgs): void; +} +/** + * Provides data for the DrillDownPerformed event. + */ +interface ASPxClientDashboardDrillDownPerformedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the dashboard item. + * Value: A string that specifies the name of the dashboard item. + */ + ItemName: string; + /** + * Gets values from the current drill-down hierarchy. + * Value: An array of values from the current drill-down hierarchy. + */ + Values: Object[]; + /** + * Returns whether or not the specified value is NullValue. + * @param value The specified value. + */ + IsNullValue(value: Object): boolean; + /** + * Returns whether or not the specified value is OthersValue. + * @param value The specified value. + */ + IsOthersValue(value: Object): boolean; +} +/** + * References a method that will handle the DrillUpPerformed event. + */ +interface ASPxClientDashboardDrillUpPerformedEventHandler { + /** + * References a method that will handle the DrillUpPerformed event. + * @param source The event source. + * @param e A ASPxClientDashboardDrillUpPerformedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDashboardDrillUpPerformedEventArgs): void; +} +/** + * Provides data for the DrillUpPerformed event. + */ +interface ASPxClientDashboardDrillUpPerformedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the dashboard item. + * Value: A string that is the name of the dashboard item. + */ + ItemName: string; +} +interface CardWidgetCustomizeTextEventArgs { + getValue(): Object; + getDefaultText(): string; +} +/** + * A Card widget that visualizes a Card dashboard item's data. + */ +interface CardWidget { + /** + * Gets or sets the background color for a card. + * Value: A string that specifies the HTML color used to paint a card's background. + */ + cardBackColor: string; + onCustomizeText: Object; +} +/** + * When implemented, represents the Web Dashboard extension. + */ +interface IExtension { + /** + * Gets a unique name of a Web Dashboard extension. + * Value: A string value that is a unique name of a Web Dashboard extension. + */ + name: string; + /** + * Contains code that will be invoked when you register the dashboard extension. + */ + start(): void; + /** + * Contains code that will be invoked when you unregister the dashboard extension. + */ + stop(): void; +} +/** + * An inner part of the ASPxClientDashboard control. + */ +interface DashboardControl { + /** + * Gets or sets knockout templates that you can use in the Web Dashboard. + * Value: A object that is a knockout template collection. + */ + customTemplates: KnockoutObservableArray; + /** + * Provides an access to the collection of registered dashboard extensions. + * Value: An array of IExtension objects that are dashboard extensions. + */ + extensions: IExtension[]; + /** + * Initializes a new dashboard with the specified name and JSON model. + * @param id A string value that is a unique name of the created dashboard. + * @param dashboardJson A dashboard model encoded in the specified JSON string. + */ + initializeDashboard(id: string, dashboardJson: string): void; + /** + * Initializes a new dashboard with the specified name, JSON model and initial state. + * @param id A string value that is a unique name of the created dashboard. + * @param dashboardJson A dashboard model encoded in the specified JSON string. + * @param initialState A JSON object that specifies the dashboard state. + */ + initializeDashboard(id: string, dashboardJson: string, initialState: Object): void; + /** + * Allows you to register a dashboard extension to add its functionality to the Web Dashboard. + * @param extension An IExtension object that is a dashboard extension. + */ + registerExtension(extension: IExtension): void; + /** + * Allows you to get access to the extension. + * @param extensionName A string value that is the dashboard extension name. + */ + findExtension(extensionName: string): IExtension; + /** + * Allows you to unregister a dashboard extension to disable its functionality in the Web Dashboard. + * @param extensionName A string value that is a dashboard extension name. + */ + unregisterExtension(extensionName: string): void; +} +interface DashboardParameterDialogExtension extends IExtension { +} +interface DashboardExportExtension extends IExtension { +} +interface DashboardClientApiExtension extends IExtension { +} +interface DashboardCurrencyEditorExtension extends IExtension { +} +interface DataSourceBrowserExtension extends IExtension { +} +interface DataSourceWizardExtension extends IExtension { +} +interface DashboadItemMenuExtension extends IExtension { +} +/** + * A Web Dashboard extension that allows you to keep track of all user actions, and cancel or repeat them. + */ +interface UndoRedoExtension extends IExtension { + /** + * Allows you to track whether the Web Dashboard has unsaved changes. + */ + isChanged(): boolean; +} +/** + * An extension that is the dashboard item's Binding menu allowing you to create and modify data binding. + */ +interface BindingPanelExtension extends IExtension { +} +/** + * A Web Dashboard extension that allows you to configure color schemes. + */ +interface DashboardColorSchemeEditorExtension extends IExtension { +} +/** + * An extension that is the dashboard item's Convert To menu allowing you to convert or duplicate the current item. + */ +interface ConversionPanelExtension extends IExtension { +} +/** + * A Web Dashboard extension that allows you to save the current dashboard. + */ +interface SaveDashboardExtension extends IExtension { + /** + * Allows you to save the current dashboard with a specified unique name and JSON model. + * @param dashboardId A string value that is a unique name of the created dashboard. + * @param dashboardJson A dashboard model encoded in the specified JSON string. + */ + performSaveDashboard(dashboardId: string, dashboardJson: string): void; + /** + * Allows you to invoke a custom function while you save a dashboard. + * @param action A custom function that is invoked when the dashboard is about to be saved. + */ + ensureDashboardSaved(action: Function): void; + /** + * Saves the opened dashboard. + */ + saveDashboard(): void; +} +/** + * A Web Dashboard extension that allows you to create a new dashboard. + */ +interface CreateDashboardExtension extends IExtension { + /** + * Creates a new dashboard with a specified name and JSON model. + * @param dashboardName A string value that is the name of the created dashboard. + * @param dashboardJson A dashboard model encoded in the specified JSON string. + */ + performCreateDashboard(dashboardName: string, dashboardJson: string): void; +} +/** + * A Web Dashboard extension that allows you to open the created dashboards. + */ +interface OpenDashboardExtension extends IExtension { + /** + * Loads a dashboard with the specified identifier from the dashboard storage. + * @param id A String value that specifies the unique dashboard name. + */ + loadDashboard(id: string): void; +} +/** + * An extension that is the dashboard item's Interactivity menu containing settings that affect on interaction between various dashboard items. + */ +interface InteractivityPanelExtension extends IExtension { +} +/** + * An extension that is the dashboard item's Options menu containing specific options and settings related to the current dashboard item. + */ +interface OptionsPanelExtension extends IExtension { +} +/** + * An extension that is the Web Dashboard title editor. + */ +interface DashboardTitleEditorExtension extends IExtension { +} +/** + * The Dashboard Panel extension that displays a list of available dashboards and lets you switch between the designer and viewer modes. + */ +interface DashboardPanelExtension extends IExtension { + /** + * Gets or sets the width of the Dashboard Panel extension. + * Value: An integer value that specifies the Dashboard Panel's width. + */ + panelWidth: number; + /** + * Gets or sets whether the Dashboard Panel is visible. + * Value: true, to display the Dashboard Panel; otherwise, false. + */ + visible: KnockoutObservableBoolean; + /** + * Gets or sets whether you can switch into the designer mode. + * Value: true, to display the Edit in Designer button on the dashboard panel; otherwise, false. + */ + allowSwitchToDesigner: KnockoutObservableBoolean; +} +/** + * An extension that is a list of available data sources used to provide data to the Web Dashboard. + */ +interface AvailableDataSourcesExtension extends IExtension { +} +/** + * A dashboard menu item. + */ +interface DashboardMenuItem { + /** + * Gets or sets a unique identifier of a dashboard menu item. + * Value: A string value that is a menu item's unique identifier. + */ + id: string; + /** + * Gets or sets a dashboard menu item title. + * Value: A string value that is a dashboard menu item title. + */ + title: string; + /** + * Gets or sets a position of the dashboard menu item within the dashboard menu. + * Value: A zero-based integer specifying the position of the current dashboard menu item. + */ + index: number; + /** + * Gets or sets a code of the key used in the keyboard shortcut. This shortcut allows you to invoke the current menu item. + * Value: An integer value that specifies a key code. + */ + hotKey: number; + /** + * Gets or sets a custom function that is invoked when a click occurs. + * Value: A custom function that is invoked when a click occurs. + */ + click: Function; + /** + * Gets or sets a knockout template for the extension. + * Value: A string value that is an id of the knockout template. + */ + template: string; + /** + * Gets or sets whether the dashboard menu item is selected. + * Value: true, if the dashboard menu item is selected; otherwise, false; + */ + selected: KnockoutObservableBoolean; + /** + * Gets whether a dashboard menu item is disabled. + * Value: true, if a dashboard menu item should be disabled; otherwise, false. + */ + disabled: KnockoutObservableBoolean; + /** + * Gets or sets whether a dashboard menu item has a separator. + * Value: true, if a dashboard menu item has a separator; otherwise, false. + */ + hasSeparator: boolean; + /** + * Gets or sets data that is used by a menu item. + * Value: An object that contains data used by a menu item. + */ + data: Object; +} +/** + * A toolbox item of the specified dashboard toolbox group. + */ +interface DashboardToolboxItem { + /** + * Gets or sets a dashboard item type. + * Value: A string value that is a dashboard item type. + */ + type: string; + /** + * Gets or sets an icon of the dashboard toolbox item. + * Value: A string value that is the icon id from the SVG definition. + */ + icon: string; + /** + * Gets or sets a unique name of the dashboard toolbox item. + * Value: A string value that is a toolbox item's unique name. + */ + name: string; + /** + * Gets or sets a dashboard toolbox item title. + * Value: A string value that is a dashboard toolbox item title. + */ + title: string; + /** + * Gets or sets whether a toolbox item should be disabled. + * Value: true, if a toolbox item should be disabled; otherwise, false. + */ + disabled: KnockoutObservableBoolean; + /** + * Gets or sets a custom function that is invoked when a click occurs. + * Value: A custom function that is invoked when a click occurs. + */ + click: Function; +} +/** + * A toolbar item of the specified dashboard toolbar group. + */ +interface DashboardToolbarItem { + /** + * Gets or sets an icon of the dashboard toolbar item. + * Value: A string value that is the icon id from the SVG definition. + */ + icon: string; + /** + * Gets or sets a unique name of the dashboard toolbar item. + * Value: A string value that is a unique toolbar item name. + */ + name: string; + /** + * Gets or sets a dashboard toolbar item title. + * Value: A string value that is a dashboard toolbar item title. + */ + title: string; + /** + * Gets or sets whether a toolbar item should be disabled. + * Value: true, if a toolbar item is disabled; otherwise, false. + */ + disabled: KnockoutObservableBoolean; + /** + * Gets or sets a knockout extension template. + * Value: A string value that is an id of the knockout template. + */ + template: string; + /** + * Gets or sets a custom function that is invoked when a click occurs. + * Value: A custom function that is invoked when a click occurs. + */ + click: Function; +} +/** + * A toolbox group that contains dashboard toolbox items. + */ +interface DashboardToolboxGroup { + /** + * Gets or sets a unique name of the dashboard toolbox group. + * Value: A string value that is a unique toolbox group name. + */ + name: string; + /** + * Gets or sets a dashboard toolbox group title. + * Value: A string value that is a dashboard toolbox group title. + */ + title: string; + /** + * Gets or sets a position of the toolbox group within the Toolbox. + * Value: A zero-based integer specifying the position of the current toolbox group. + */ + index: number; + /** + * Provide an access to the collection of toolbox items obtained from the specified toolbox group. + * Value: A object that is an array of items obtained from the specified toolbox group. + */ + items: KnockoutObservableArray; +} +/** + * A toolbar group that contains dashboard toolbar items. + */ +interface DashboardToolbarGroup { + /** + * Gets or sets a unique name of the dashboard toolbar group. + * Value: A string value that is a unique toolbar group name. + */ + name: string; + /** + * Gets or sets a dashboard toolbar group title. + * Value: A string value that is a dashboard toolbar group title. + */ + title: string; + /** + * Gets or sets a position of the toolbar group within the Toolbox. + * Value: A zero-based integer specifying the position of the current toolbar group. + */ + index: number; + /** + * Provide an access to the collection of toolbox items obtained from the specified toolbar group. + * Value: A object that is an array of items obtained from the specified toolbar group. + */ + items: KnockoutObservableArray; +} +/** + * The Web Dashboard Toolbox extension that provides access to the dashboard menu and allows you to add dashboard items, as well as undo or repeat user actions. + */ +interface ToolboxExtension extends IExtension { + /** + * Gets or sets the visibility of the dashboard menu. + * Value: true, to display the dashboard menu; otherwise, false. + */ + menuVisible: KnockoutObservableBoolean; + /** + * Provide an access to the collection of menu items obtained from the dashboard menu. + * Value: A object that is a collection the dashboard menu items . + */ + menuItems: KnockoutObservableArray; + /** + * Provide an access to the collection of toolbox groups obtained from the Toolbox. + * Value: A object that is a collection the toolbox groups. + */ + toolboxGroups: KnockoutObservableArray; + /** + * Provide an access to the collection of toolbar groups obtained from the Toolbox. + * Value: A object that is a collection the toolbar groups. + */ + toolbarGroups: KnockoutObservableArray; + /** + * Allows you to add a specified menu item to the dashboard menu. + * @param menuItem A DashboardMenuItem object that is a dashboard menu item. + */ + addMenuItem(menuItem: DashboardMenuItem): void; + /** + * Removes the specified dashboard item from the dashboard menu. + * @param menuItemId A string value that is a unique dashboard item name. + */ + removeMenuItem(menuItemId: string): void; + /** + * Simulates a dashboard menu item selection. + * @param menuItem A DashboardMenuItem object that is a dashboard menu item. + */ + selectMenuItem(menuItem: DashboardMenuItem): void; + /** + * Allows you to add a specified toolbox item into a specified toolbox group. + * @param groupName A string value that is a toolbox group name. To get a toolbox group name, use the name property. + * @param toolboxItem A DashboardToolboxItem object that is a dashboard toolbox item. + */ + addToolboxItem(groupName: string, toolboxItem: DashboardToolboxItem): void; + /** + * Removes the specified toolbox item from the specified toolbox group. + * @param groupName A string value that is a unique toolbox group name. + * @param toolboxItemName A string value that is a unique toolbox item name. + */ + removeToolboxItem(groupName: string, toolboxItemName: string): void; + /** + * Allows you to add a specified toolbar item into a specified toolbar group. + * @param groupName A string value that is a toolbar group name. To get a toolbar group name, use the name property. + * @param toolbarItem A DashboardToolbarItem object that is a dashboard toolbar item. + */ + addToolbarItem(groupName: string, toolbarItem: DashboardToolbarItem): void; + /** + * Removes the specified toolbar item from the specified toolbar group. + * @param groupName A string value that is a unique toolbar group name. + * @param toolbarItemName A string value that is a unique toolbar item name. + */ + removeToolbarItem(groupName: string, toolbarItemName: string): void; +} +/** + * A Web Dashboard extension that allows you to create and edit dashboard parameters. + */ +interface DashboardParameterEditorExtension extends IExtension { +} +/** + * Serves as the base object for all the editors included in the client-side object model. + */ +interface ASPxClientEditBase extends ASPxClientControl { + /** + * Returns the editor's value. + */ + GetValue(): Object; + /** + * Changes the editor's value. + * @param value An object representing the data to be assigned to the editor's edit value. + */ + SetValue(value: Object): void; + /** + * Returns a value indicating whether an editor is enabled. + */ + GetEnabled(): boolean; + /** + * Specifies whether an editor is enabled. + * @param value true to enable the editor; otherwise, false. + */ + SetEnabled(value: boolean): void; + /** + * Returns the text displayed in the editor caption. + */ + GetCaption(): string; + /** + * Specifies the text displayed in the editor caption. + * @param caption A string value specifying the editor caption. + */ + SetCaption(caption: string): void; +} +/** + * Serves as the base object for all the editors that support validation. + */ +interface ASPxClientEdit extends ASPxClientEditBase { + /** + * Fires on the client side when the editor receives input focus. + */ + GotFocus: ASPxClientEvent>; + /** + * Fires on the client side when the editor loses input focus. + */ + LostFocus: ASPxClientEvent>; + /** + * Allows you to specify whether the value entered into the editor is valid, and whether the editor is allowed to lose focus. + */ + Validation: ASPxClientEvent>; + /** + * Fires after the editor's value has been changed by end-user interactions. + */ + ValueChanged: ASPxClientEvent>; + /** + * Returns an HTML element that represents the control's input element. + */ + GetInputElement(): Object; + /** + * Sets input focus to the editor. + */ + Focus(): void; + /** + * Gets a value that indicates whether the editor's value passes validation. + */ + GetIsValid(): boolean; + /** + * Gets the error text to be displayed within the editor's error frame if the editor's validation fails. + */ + GetErrorText(): string; + /** + * Sets a value that specifies whether the editor's value is valid. + * @param isValid True if the editor's value is valid; otherwise, False. + */ + SetIsValid(isValid: boolean): void; + /** + * Sets the error text to be displayed within the editor's error frame if the editor's validation fails. + * @param errorText A string value representing the error text. + */ + SetErrorText(errorText: string): void; + /** + * Performs the editor's validation. + */ + Validate(): void; +} +/** + * Represents the client-side equivalent of the ASPxBinaryImage control. + */ +interface ASPxClientBinaryImage extends ASPxClientEdit { + /** + * Occurs on the client side after an image is clicked. + */ + Click: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client side if any server error occurs during server-side processing of a callback sent by the ASPxClientBinaryImage. + */ + CallbackError: ASPxClientEvent>; + /** + * Sets the size of the image editor. + * @param width An integer value that specifies the control's width. + * @param height An integer value that specifies the control's height. + */ + SetSize(width: number, height: number): void; + /** + * For internal use only. + */ + GetValue(): Object; + /** + * For internal use only. + * @param value + */ + SetValue(value: Object): void; + /** + * Removes an image from the editor content. + */ + Clear(): void; + /** + * Returns a name of the last uploaded file. + */ + GetUploadedFileName(): string; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that contains any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that contains any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * Represents the client-side equivalent of the ASPxButton control. + */ +interface ASPxClientButton extends ASPxClientControl { + /** + * Occurs on the client side when the button's checked state is changed. + */ + CheckedChanged: ASPxClientEvent>; + /** + * Fires on the client side when the button receives input focus. + */ + GotFocus: ASPxClientEvent>; + /** + * Fires on the client side when the button loses input focus. + */ + LostFocus: ASPxClientEvent>; + /** + * Occurs on the client side after a button is clicked. + */ + Click: ASPxClientEvent>; + /** + * Simulates a mouse click action on the button control. + */ + DoClick(): void; + /** + * Returns a value indicating whether the button is checked. + */ + GetChecked(): boolean; + /** + * Sets a value that specifies the button's checked status. + * @param value true if the button is checked; otherwise, false. + */ + SetChecked(value: boolean): void; + /** + * Returns the text displayed within the button. + */ + GetText(): string; + /** + * Sets the text to be displayed within the button. + * @param value A string value specifying the text to be displayed within the button. + */ + SetText(value: string): void; + /** + * Returns the URL pointing to the image displayed within the button. + */ + GetImageUrl(): string; + /** + * Sets the URL pointing to the image displayed within the button. + * @param value A string value that is the URL to the image displayed within the button. + */ + SetImageUrl(value: string): void; + /** + * Sets a value specifying whether the button is enabled. + * @param value true to enable the button; false to disable it. + */ + SetEnabled(value: boolean): void; + /** + * Returns a value indicating whether the button is enabled. + */ + GetEnabled(): boolean; + /** + * Sets input focus to the button. + */ + Focus(): void; +} +/** + * A method that will handle the client Click event. + */ +interface ASPxClientButtonClickEventHandler { + /** + * A method that will handle the client Click event. + * @param source An object that is the event's source. + * @param e An ASPxClientButtonClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientButtonClickEventArgs): void; +} +/** + * Provides data for the Click event. + */ +interface ASPxClientButtonClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Specifies whether both the event's default action and the event's bubbling upon the hierarchy of event handlers should be canceled. + * Value: true to cancel the event's default action and the event's bubbling upon the hierarchy of event handlers; otherwise, false. + */ + cancelEventAndBubble: boolean; +} +/** + * Represents the client-side equivalent of the ASPxCalendar control. + */ +interface ASPxClientCalendar extends ASPxClientEdit { + /** + * Fires on the client side after the selected date has been changed within the calendar. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Occurs on the client side when the month displayed within the calendar is changed. + */ + VisibleMonthChanged: ASPxClientEvent>; + /** + * Allows you to disable the calendar's days. + */ + CustomDisabledDate: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user presses a key while the editor has focus. + */ + KeyDown: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user presses and releases a key while the editor has focus. + */ + KeyPress: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user releases a pressed key while the editor has focus. + */ + KeyUp: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after the callback server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientCalendar. + */ + CallbackError: ASPxClientEvent>; + /** + * Tests whether the specified date is selected. + * @param date A date-time value that specifies the date to test. + */ + IsDateSelected(date: Date): boolean; + /** + * Sets the date that specifies the month and year to be displayed in the calendar. + * @param date The date that specifies calendar's visible month and year. + */ + SetVisibleDate(date: Date): void; + /** + * Sets the calendar's selected date. + * @param date A date object that specifies the calendar's selected date. + */ + SetSelectedDate(date: Date): void; + /** + * Returns the calendar's selected date. + */ + GetSelectedDate(): Date; + /** + * Gets the date that determines the month and year that are currently displayed in the calendar. + */ + GetVisibleDate(): Date; + /** + * Selects the specified date within the calendar. + * @param date A date-time value that specifies the selected date. + */ + SelectDate(date: Date): void; + /** + * Selects the specified range of dates within the calendar. + * @param start A date-time value that specifies the range's first date. + * @param end A date-time value that specifies the range's last date. + */ + SelectRange(start: Date, end: Date): void; + /** + * Deselects the specified date within the calendar. + * @param date A date-time value that specifies the date to deselect. + */ + DeselectDate(date: Date): void; + /** + * Deselects the specified range of dates within the calendar. + * @param start A date-time value that specifies the range's first date. + * @param end A date-time value that specifies the range's last date. + */ + DeselectRange(start: Date, end: Date): void; + /** + * Deselects all the selected dates within the calendar. + */ + ClearSelection(): void; + /** + * Returns a list of dates which are selected within the calendar. + */ + GetSelectedDates(): Date[]; + /** + * Gets the minimum date on the calendar. + */ + GetMinDate(): Date; + /** + * Sets the minimum date of the calendar. + * @param date A DateTime object representing the minimum date. + */ + SetMinDate(date: Date): void; + /** + * Gets the maximum date on the calendar. + */ + GetMaxDate(): Date; + /** + * Sets the maximum date of the calendar. + * @param date A DateTime object representing the maximum date. + */ + SetMaxDate(date: Date): void; +} +/** + * Provides data for the CustomDisabledDate event. + */ +interface ASPxClientCalendarCustomDisabledDateEventArgs extends ASPxClientEventArgs { + /** + * Gets the date processed in the calendar. + * Value: A DateTime value containing processed data. + */ + date: Date; + /** + * Gets or sets a value specifying whether selection of the processed calendar date is disabled. + * Value: true, if the date is disabled; otherwise, false. + */ + isDisabled: boolean; +} +/** + * A method that will handle the client CustomDisabledDate event. + */ +interface ASPxClientCalendarCustomDisabledDateEventHandler { + /** + * A method that will handle the client CustomDisabledDate event. + * @param source The event source. + * @param e An ASPxClientCalendarCustomDisabledDateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCalendarCustomDisabledDateEventArgs): void; +} +/** + * Represents the client-side equivalent of the ASPxCaptcha control. + */ +interface ASPxClientCaptcha extends ASPxClientControl { + /** + * Sets input focus to the control's text box. + */ + Focus(): void; + /** + * Refreshes the code displayed within the editor's challenge image. + */ + Refresh(): void; +} +/** + * Represents the client-side equivalent of the ASPxCheckBox control. + */ +interface ASPxClientCheckBox extends ASPxClientEdit { + /** + * Occurs on the client side when the editor's checked state is changed. + */ + CheckedChanged: ASPxClientEvent>; + /** + * Returns a value indicating whether the check box editor is checked. + */ + GetChecked(): boolean; + /** + * Sets a value which specifies the checked status of the check box editor. + * @param isChecked true if the check box editor is checked; otherwise, false. + */ + SetChecked(isChecked: boolean): void; + /** + * Returns the text displayed within the editor. + */ + GetText(): string; + /** + * Returns a value which specifies a check box checked state. + */ + GetCheckState(): string; + /** + * Sets a value specifying the state of a check box. + * @param checkState A string value matches one of the CheckState enumeration values. + */ + SetCheckState(checkState: string): void; + /** + * Sets the text to be displayed within the editor. + * @param text A string value specifying the text to be displayed within the editor. + */ + SetText(text: string): void; +} +/** + * Represents the client-side equivalent of the ASPxRadioButton control. + */ +interface ASPxClientRadioButton extends ASPxClientCheckBox { + /** + * Returns a value indicating whether the radio button is checked. + */ + GetChecked(): boolean; + /** + * Sets a value which specifies the radio button's checked status. + * @param isChecked true if the radio button is checked; otherwise, false. + */ + SetChecked(isChecked: boolean): void; +} +/** + * Represents a base for client-side objects which allow single-line text input. + */ +interface ASPxClientTextEdit extends ASPxClientEdit { + /** + * Occurs on the client-side when an end-user presses a key while the editor has focus. + */ + KeyDown: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user presses and releases a key while the editor has focus. + */ + KeyPress: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user releases a pressed key while the editor has focus. + */ + KeyUp: ASPxClientEvent>; + /** + * Fires on the client side when the editor's text is changed and focus moves out of the editor by end-user interactions. + */ + TextChanged: ASPxClientEvent>; + /** + * Returns the text displayed within the editor. + */ + GetText(): string; + /** + * Sets the text to be displayed within the editor. + * @param text A string value specifying the text to be displayed within the editor. + */ + SetText(text: string): void; + /** + * Selects all text in the text editor. + */ + SelectAll(): void; + /** + * Sets the caret position within the edited text. + * @param position An integer value that specifies the zero-based index of a text character that shall precede the caret. + */ + SetCaretPosition(position: number): void; + /** + * Obtains the caret position within the edited text. + */ + GetCaretPosition(): number; + /** + * Selects the specified portion of the editor's text. + * @param startPos A zero-based integer value specifying the selection's starting position. + * @param endPos A zero-based integer value specifying the selection's ending position. + * @param scrollToSelection true to scroll the editor's contents to make the selection visible; otherwise, false. + */ + SetSelection(startPos: number, endPos: number, scrollToSelection: boolean): void; +} +/** + * Represents a base for client-side editors which are capable of displaying and editing text data in their edit regions. + */ +interface ASPxClientTextBoxBase extends ASPxClientTextEdit { +} +/** + * Represents a base for client button editor objects. + */ +interface ASPxClientButtonEditBase extends ASPxClientTextBoxBase { + /** + * Occurs on the client side after an editor button is clicked. + */ + ButtonClick: ASPxClientEvent>; + /** + * Specifies whether the button is visible. + * @param number An integer value specifying the button's index within the Buttons collection. + * @param value true, to make the button visible; otherwise, false. + */ + SetButtonVisible(number: number, value: boolean): void; + /** + * Returns a value specifying whether a button is displayed. + * @param number An integer value specifying the button's index within the Buttons collection. + */ + GetButtonVisible(number: number): boolean; +} +/** + * Represents a base class for the editors that contain a drop down window. + */ +interface ASPxClientDropDownEditBase extends ASPxClientButtonEditBase { + /** + * Occurs on the client-side when the drop down window is opened. + */ + DropDown: ASPxClientEvent>; + /** + * Occurs on the client side when the drop down window is closed. + */ + CloseUp: ASPxClientEvent>; + /** + * Occurs on the client side before the drop down window is closed and allows you to cancel the operation. + */ + QueryCloseUp: ASPxClientEvent>; + /** + * Modifies the size of the drop down window in accordance with its content. + */ + AdjustDropDownWindow(): void; + /** + * Invokes the editor's drop down window. + */ + ShowDropDown(): void; + /** + * Closes the opened drop down window of the editor. + */ + HideDropDown(): void; +} +/** + * Represents the client-side equivalent of the ASPxColorEdit control. + */ +interface ASPxClientColorEdit extends ASPxClientDropDownEditBase { + /** + * Fires after the selected color has been changed within the color editor via end-user interaction. + */ + ColorChanged: ASPxClientEvent>; + /** + * This event is not in effect for the ASPxClientColorEdit. Use the ColorChanged event instead. + */ + TextChanged: ASPxClientEvent>; + /** + * Returns the color editor's value. + */ + GetColor(): string; + /** + * Specifies the color value for the color editor. + * @param value A string value specifying the editor color. + */ + SetColor(value: string): void; + /** + * Indicates whether the automatic color item is selected. + */ + IsAutomaticColorSelected(): boolean; +} +/** + * Represent the client-side equivalent of the ASPxComboBox control. + */ +interface ASPxClientComboBox extends ASPxClientDropDownEditBase { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientComboBox. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side after a different item in the list has been selected (focus has been moved from one item to another). + */ + SelectedIndexChanged: ASPxClientEvent>; + /** + * Specifies the text displayed within the editor's edit box. + * @param text A string value specifying the editor's text. + */ + SetText(text: string): void; + /** + * Adds a new item to the editor specifying the item's display text and returns the index of the added item. + * @param text A string value specifying the item's display text. + */ + AddItem(text: string): number; + /** + * Adds a new item to the editor specifying the item's display text and associated value, and returns the index of the added item. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + */ + AddItem(text: string, value: Object): number; + /** + * Adds a new item to the editor specifying the item's display text, associated value and displayed image, and returns the index of the added item. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + * @param imageUrl A string value specifying the path to the image displayed by the item. + */ + AddItem(text: string, value: Object, imageUrl: string): number; + /** + * Inserts a new item specified by its display text, associated value and displayed image into the editor's item collection, at the position specified. + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + * @param imageUrl A string value specifying the path to the image displayed by the item. + */ + InsertItem(index: number, text: string, value: Object, imageUrl: string): void; + /** + * Inserts a new item specified by its display text and associated value into the editor's item collection, at the position specified. + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + */ + InsertItem(index: number, text: string, value: Object): void; + /** + * Inserts a new item specified by its display text into the editor's item collection, at the position specified. + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. + */ + InsertItem(index: number, text: string): void; + /** + * Removes an item specified by its index from the client list editor. + * @param index An integer value representing the index of the list item to be removed. + */ + RemoveItem(index: number): void; + /** + * Removes all items from the client combo box editor. + */ + ClearItems(): void; + /** + * Prevents the client combobox editor from being rendered until the EndUpdate method is called. + */ + BeginUpdate(): void; + /** + * Re-enables editor render operations after a call to the BeginUpdate method and forces an immediate re-rendering. + */ + EndUpdate(): void; + /** + * Scrolls the editor's item list, so that the specified item becomes visible. + * @param index An integer value that specifies the item's index within the editor's client item list. + */ + MakeItemVisible(index: number): void; + /** + * Returns an item specified by its index within the combo box editor's item collection. + * @param index An integer value specifying the zero-based index of the item to search for. + */ + GetItem(index: number): ASPxClientListEditItem; + /** + * Returns a combo box item by its text. + * @param text A string that specifies the item's text. + */ + FindItemByText(text: string): ASPxClientListEditItem; + /** + * Returns a combo box item by its value. + * @param value An object that specifies the item's value. + */ + FindItemByValue(value: Object): ASPxClientListEditItem; + /** + * Gets the number of items contained in the editor's item collection. + */ + GetItemCount(): number; + /** + * Returns the index of the selected item within the combo box editor. + */ + GetSelectedIndex(): number; + /** + * Sets the combobox editor's selected item specified by its index. + * @param index An integer value specifying the zero-based index of the item to select. + */ + SetSelectedIndex(index: number): void; + /** + * Returns the combo box editor's selected item. + */ + GetSelectedItem(): ASPxClientListEditItem; + /** + * Sets the list editor's selected item. + * @param item An ASPxClientListEditItem object that specifies the item to select. + */ + SetSelectedItem(item: ASPxClientListEditItem): void; + /** + * Gets the text displayed in the editor's edit box. + */ + GetText(): string; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Adds a new item to the editor, specifying the item's display text, and returns the index of the added item. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + */ + AddItem(texts: string[]): number; + /** + * Adds a new item to the end of the control's items collection. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + */ + AddItem(texts: string[], value: Object): number; + /** + * Adds a new item to the end of the control's items collection. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + * @param imageUrl A string value specifying the path to the image displayed by the item. + */ + AddItem(texts: string[], value: Object, imageUrl: string): number; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + * @param imageUrl A String value specifying the path to the image displayed by the item. + */ + InsertItem(index: number, texts: string[], value: Object, imageUrl: string): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + */ + InsertItem(index: number, texts: string[], value: Object): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + */ + InsertItem(index: number, texts: string[]): void; + /** + * Determines whether the drop-down content is loaded; if not - loads the content. + * @param callbackFunction An object that is the JavaScript function that receives the callback data as a parameter. The function is performed after the combo box content is loaded. + */ + EnsureDropDownLoaded(callbackFunction: Object): void; + /** + * Defines the HTML content for the specified combo box item. + * @param index An integer value specifying the zero-based index of the item. + * @param html A string value that is the HTML code defining the content of the combo box item. + */ + SetItemHtml(index: number, html: string): void; + /** + * Sets the tooltip text for the combo box editor's item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param tooltip A string value specifying the tooltip text. + */ + SetItemTooltip(index: number, tooltip: string): void; + /** + * Sets the CSS class for a combo box item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param className A string value specifying the CSS class name. + */ + AddItemCssClass(index: number, className: string): void; + /** + * Removes the CSS class from a combo box item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param className A string value specifying the CSS class name. + */ + RemoveItemCssClass(index: number, className: string): void; + /** + * Defines the HTML content for the specified combo box item's text cell. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param html A string value that is the HTML code defining the content of the combo box item. + */ + SetItemTextCellHtml(itemIndex: number, textCellIndex: number, html: string): void; + /** + * Sets the tooltip text for the text cell of the editor's item specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param tooltip A string value specifying the tooltip text. + */ + SetItemTextCellTooltip(itemIndex: number, textCellIndex: number, tooltip: string): void; + /** + * Sets the CSS class for a combo box item's text cell specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param className A string value specifying the CSS class name. + */ + AddItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: string): void; + /** + * Removes the CSS class from a combo box item's text cell specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param className A string value specifying the CSS class name. + */ + RemoveItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: string): void; +} +/** + * Represents the client-side equivalent of the ASPxDateEdit control. + */ +interface ASPxClientDateEdit extends ASPxClientDropDownEditBase { + /** + * Fires after the selected date has been changed within the date editor. + */ + DateChanged: ASPxClientEvent>; + /** + * Enables you to convert the value entered by an end user into the value that will be stored by the date editor. + */ + ParseDate: ASPxClientEvent>; + /** + * Allows you to disable the calendar's days. + */ + CalendarCustomDisabledDate: ASPxClientEvent>; + /** + * This event is not in effect for the ASPxClientDateEdit. Use the DateChanged event instead. + */ + TextChanged: ASPxClientEvent>; + /** + * Returns the calendar of the date editor. + */ + GetCalendar(): ASPxClientCalendar; + /** + * Returns the built-in time edit control. + */ + GetTimeEdit(): ASPxClientTimeEdit; + /** + * Specifies the date for the editor. + * @param date A DateTime object that is the date. + */ + SetDate(date: Date): void; + /** + * Gets the date that is the editor's value. + */ + GetDate(): Date; + /** + * Returns the number of days in a range selected within a date edit. + */ + GetRangeDayCount(): number; + /** + * Gets the minimum date of the editor. + */ + GetMinDate(): Date; + /** + * Sets the minimum date of the editor. + * @param date A DateTime object representing the minimum date. + */ + SetMinDate(date: Date): void; + /** + * Gets the maximum date of the editor. + */ + GetMaxDate(): Date; + /** + * Sets the maximum date of the editor. + * @param date A DateTime object representing the maximum date. + */ + SetMaxDate(date: Date): void; +} +/** + * Provides data for the ParseDate client-side event that parses a string entered into a date editor. + */ +interface ASPxClientParseDateEventArgs extends ASPxClientEventArgs { + /** + * Gets the value entered into the date editor by an end user. + * Value: The string value entered into the date editor by an end user. + */ + value: string; + /** + * Gets or sets the edit value of the date editor. + * Value: A date/time value representing the edit value of the date editor. + */ + date: Date; + /** + * Gets or sets a value specifying whether the event was handled. + * Value: true if the event was handled and default processing should not occur; false if the event should be handled using default processing. + */ + handled: boolean; +} +/** + * A method that will handle the client ParseDate event, that parses a date editor's value when entered. + */ +interface ASPxClientParseDateEventHandler { + /** + * A method that will handle the ParseDate event. + * @param source An object representing the event source. Identifies the button editor that raised the event. + * @param e An ASPxClientParseDateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientParseDateEventArgs): void; +} +/** + * Represents a base for client editor objects realizing the dropdown editor functionality. + */ +interface ASPxClientDropDownEdit extends ASPxClientDropDownEditBase { + /** + * Obtains the key value associated with the text displayed within the editor's edit box. + */ + GetKeyValue(): string; + /** + * Specifies the key value associated with the text displayed within the editor's edit box. + * @param keyValue A string specifying the key value associated with the editor's value (displayed text). + */ + SetKeyValue(keyValue: string): void; +} +/** + * A method that will handle the client events involving a keyboard key being pressed or released. + */ +interface ASPxClientEditKeyEventHandler { + /** + * A method that will handle the client events concerning a keyboard key being pressed. + * @param source The event source. This parameter identifies the editor which raised the event. + * @param e An ASPxClientEditKeyEventArgs object that contains event data. + */ + (source: S, e: ASPxClientEditKeyEventArgs): void; +} +/** + * Provides data for the client events involved with a key being pressed or released. + */ +interface ASPxClientEditKeyEventArgs extends ASPxClientEventArgs { + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * A method that will handle client validation events. + */ +interface ASPxClientEditValidationEventHandler { + /** + * A method that will handle client validation events. + * @param source An object representing the event source. Identifies the button editor that raised the event. + * @param e An ASPxClientEditValidationEventArgs object that contains event data. + */ + (source: S, e: ASPxClientEditValidationEventArgs): void; +} +/** + * Provides data for the client events that are related to data validation (see Validate). + */ +interface ASPxClientEditValidationEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets the error description. + * Value: A string representing the error description. + */ + errorText: string; + /** + * Gets or sets a value specifying whether the validated value is valid. + * Value: true if the value is valid; otherwise, false. + */ + isValid: boolean; + /** + * Gets or sets the editor's value being validated. + * Value: An object that represents the validated value. + */ + value: string; +} +/** + * Represents the client ASPxFilterControl. + */ +interface ASPxClientFilterControl extends ASPxClientControl { + /** + * Occurs after a new filter expression has been applied. + */ + Applied: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientFilterControl. + */ + CallbackError: ASPxClientEvent>; + /** + * Returns the filter expression. + */ + GetFilterExpression(): string; + /** + * Returns the applied filter expression. + */ + GetAppliedFilterExpression(): string; + /** + * Returns the editor used to edit operand values for the specified filter column. + * @param editorIndex An integer value that identifies the filter column by its index within the collection. + */ + GetEditor(editorIndex: number): ASPxClientEditBase; + /** + * Returns a value indicating whether the filter expression being currently composed on the client side is valid - all expression conditions are filled. + */ + IsFilterExpressionValid(): boolean; + /** + * Applies a filter constructed by an end-user. + */ + Apply(): void; + /** + * Resets the current filter expression to a previously applied filter expression. + */ + Reset(): void; +} +/** + * A method that will handle the Applied event. + */ +interface ASPxClientFilterAppliedEventHandler { + /** + * A method that will handle the Applied event. + * @param source The event source. + * @param e An ASPxClientFilterAppliedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFilterAppliedEventArgs): void; +} +/** + * Provides data for the Applied event. + */ +interface ASPxClientFilterAppliedEventArgs extends ASPxClientEventArgs { + /** + * Gets the filter expression currently being applied. + * Value: A string value that specifies the filter expression currently being applied. + */ + filterExpression: string; +} +/** + * Represents a base for client editor objects that display a list of items. + */ +interface ASPxClientListEdit extends ASPxClientEdit { + /** + * Occurs on the client side after a different item in the list has been selected (focus has been moved from one item to another). + */ + SelectedIndexChanged: ASPxClientEvent>; + /** + * Returns the list editor's selected item. + */ + GetSelectedItem(): ASPxClientListEditItem; + /** + * Returns the index of the selected item within the list editor. + */ + GetSelectedIndex(): number; + /** + * Sets the list editor's selected item. + * @param item An ASPxClientListEditItem object that specifies the item to select. + */ + SetSelectedItem(item: ASPxClientListEditItem): void; + /** + * Sets the list editor's selected item specified by its index. + * @param index An integer value specifying the zero-based index of the item to select. + */ + SetSelectedIndex(index: number): void; +} +/** + * Represents the client-side equivalent of the ListEditItem object. + */ +interface ASPxClientListEditItem { + /** + * Gets a value that indicates whether a list edit item is selected. + * Value: true if a list edit item is selected; otherwise, false. + */ + selected: boolean; + /** + * Gets an editor to which the current item belongs. + * Value: An ASPxClientListEdit object that represents the item's owner editor. + */ + listEditBase: ASPxClientListEdit; + /** + * Gets the item's index. + * Value: An integer value that represents the item's index within the corresponding editor's item collection. + */ + index: number; + /** + * Gets the item's associated image. + * Value: A string value that represents the path to the image displayed by the item. + */ + imageUrl: string; + /** + * Gets the item's display text. + * Value: A string value that represents the item's display text. + */ + text: string; + /** + * Gets the item's associated value. + * Value: An object that represents the value associated with the item. + */ + value: Object; + /** + * Returns the list item's value that corresponds to a column specified by its index. + * @param columnIndex An integer value that specifies the column's index within the editor's Columns collection. + */ + GetColumnText(columnIndex: number): string; + /** + * Returns the list item's value that corresponds to a column specified by its field name. + * @param columnName A string value that specifies the column's field name defined via the FieldName property. + */ + GetColumnText(columnName: string): string; +} +/** + * Represents the client-side equivalent of the ASPxListBox control. + */ +interface ASPxClientListBox extends ASPxClientListEdit { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientListBox. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side when an end-user presses a key while the editor has focus. + */ + KeyDown: ASPxClientEvent>; + /** + * Occurs on the client side when an end-user presses and releases a key while the editor has focus. + */ + KeyPress: ASPxClientEvent>; + /** + * Occurs on the client side when an end-user releases a pressed key while the editor has focus. + */ + KeyUp: ASPxClientEvent>; + /** + * Occurs on the client side after a different item in the list box has been selected (focus has been moved from one item to another). + */ + SelectedIndexChanged: ASPxClientEvent>; + /** + * Occurs on the client when the editor's item is double clicked. + */ + ItemDoubleClick: ASPxClientEvent>; + /** + * Gets the number of items contained in the editor's item collection. + */ + GetItemCount(): number; + /** + * Returns an item specified by its index within the list box editor's item collection. + * @param index An integer value specifying the zero-based index of the item to search for. + */ + GetItem(index: number): ASPxClientListEditItem; + /** + * Returns an array of the list editor's selected items indices. + */ + GetSelectedIndices(): number[]; + /** + * Returns an array of the list editor's selected items values. + */ + GetSelectedValues(): Object[]; + /** + * Returns an array of the list editor's selected items. + */ + GetSelectedItems(): ASPxClientListEditItem[]; + /** + * Selects all list box items. + */ + SelectAll(): void; + /** + * Unselects all list box items. + */ + UnselectAll(): void; + /** + * Selects the items with the specified indices within a list box. + * @param indices An array of integer values that represent the items indices. + */ + SelectIndices(indices: number[]): void; + /** + * Unselects an array of the list box items with the specified indices. + * @param indices An array of integer values that represent the indices. + */ + UnselectIndices(indices: number[]): void; + /** + * Selects the specified items within a list box. + * @param items An array of ASPxClientListEditItem objects that represent the items. + */ + SelectItems(items: ASPxClientListEditItem[]): void; + /** + * Unselects an array of the specified list box items. + * @param items An array of ASPxClientListEditItem objects that represent the items. + */ + UnselectItems(items: ASPxClientListEditItem[]): void; + /** + * Select the items with the specified values within a list box. + * @param values An array of Object[] objects that represent the item's values. + */ + SelectValues(values: Object[]): void; + /** + * Unselects an array of the list box items with the specified values. + * @param values An array of Object[] objects that represent the values. + */ + UnselectValues(values: Object[]): void; + /** + * Scrolls the editor's item list, so that the specified item becomes visible. + * @param index An integer value that specifies the item's index within the editor's client item list. + */ + MakeItemVisible(index: number): void; + /** + * Initializes the ASPxClientListBox client object when its parent container becomes visible dynamically, on the client side. + */ + InitOnContainerMadeVisible(): void; + /** + * Adds a new item to the editor, specifying the item's display text, and returns the index of the added item. + * @param text A string value specifying the item's display text. + */ + AddItem(text: string): number; + /** + * Adds a new item to the editor, specifying the item's display text and associated value, and returns the index of the added item. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + */ + AddItem(text: string, value: Object): number; + /** + * Adds a new item to the editor, specifying the item's display text, associated value and displayed image, and returns the index of the added item. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + * @param imageUrl A string value specifying the path to the image displayed by the item. + */ + AddItem(text: string, value: Object, imageUrl: string): number; + /** + * Inserts a new item specified by its display text, associated value and displayed image into the editor's item collection, at the position specified. + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + * @param imageUrl A string value specifying the path to the image displayed by the item. + */ + InsertItem(index: number, text: string, value: Object, imageUrl: string): void; + /** + * Inserts a new item specified by its display text and associated value into the editor's item collection, at the position specified. + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. + * @param value An object specifying the value associated with the item. + */ + InsertItem(index: number, text: string, value: Object): void; + /** + * Inserts a new item specified by its display text into the editor's item collection, at the position specified. + * @param index An integer value representing the zero-based index of the position where the item should be inserted. + * @param text A string value specifying the item's display text. + */ + InsertItem(index: number, text: string): void; + /** + * Prevents the client list box editor from being rendered until the EndUpdate method is called. + */ + BeginUpdate(): void; + /** + * Re-enables editor render operations after a call to the BeginUpdate method, and forces an immediate re-rendering. + */ + EndUpdate(): void; + /** + * Removes all items from the client list box editor. + */ + ClearItems(): void; + /** + * Removes an item specified by its index from the client list editor. + * @param index An integer value representing the index of the list item to be removed. + */ + RemoveItem(index: number): void; + /** + * Returns a list box item by its text. + * @param text A string that specifies the item's text. + */ + FindItemByText(text: string): ASPxClientListEditItem; + /** + * Returns a list box item by its value. + * @param value An object that specifies the item's value. + */ + FindItemByValue(value: Object): ASPxClientListEditItem; + /** + * Sends a callback to the server, and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Adds a new item to the end of the editor's items collection, specifying the item's display text, and returns the index of the added item. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + */ + AddItem(texts: string[]): number; + /** + * Adds a new item to the end of the control's items collection. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + */ + AddItem(texts: string[], value: Object): number; + /** + * Adds a new item to the end of the editor's items collection, specifying the item's display text, associated value and displayed image, and returns the index of the added item. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + * @param imageUrl A String value specifying the path to the image displayed by the item. + */ + AddItem(texts: string[], value: Object, imageUrl: string): number; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + * @param imageUrl A String value specifying the path to the image displayed by the item. + */ + InsertItem(index: number, texts: string[], value: Object, imageUrl: string): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + * @param value An object that represents the item's associated value. + */ + InsertItem(index: number, texts: string[], value: Object): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index An integer value that represents the index position. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding columns within the editor's Columns collection. + */ + InsertItem(index: number, texts: string[]): void; + /** + * Defines the HTML content for the specified list box item. + * @param index An integer value specifying the zero-based index of the item. + * @param html A string value that is the HTML code defining the content of the list box item. + */ + SetItemHtml(index: number, html: string): void; + /** + * Sets the tooltip text for the list box editor's item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param tooltip A string value specifying the tooltip text. + */ + SetItemTooltip(index: number, tooltip: string): void; + /** + * Sets the CSS class for a list box item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param className A string value specifying the CSS class name. + */ + AddItemCssClass(index: number, className: string): void; + /** + * Removes the CSS class from a list box item specified by its index. + * @param index An integer value specifying the zero-based index of the item. + * @param className A string value specifying the CSS class name. + */ + RemoveItemCssClass(index: number, className: string): void; + /** + * Defines the HTML content for the specified list box item's text cell. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param html A string value that is the HTML code defining the content of the list box item. + */ + SetItemTextCellHtml(itemIndex: number, textCellIndex: number, html: string): void; + /** + * Sets the tooltip text for the text cell of the editor's item specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param tooltip A string value specifying the tooltip text. + */ + SetItemTextCellTooltip(itemIndex: number, textCellIndex: number, tooltip: string): void; + /** + * Sets the CSS class for a list box item's text cell specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param className A string value specifying the CSS class name. + */ + AddItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: string): void; + /** + * Removes the CSS class from a list box item's text cell specified by its index. + * @param itemIndex An integer value specifying the zero-based index of the item. + * @param textCellIndex An integer value specifying the zero-based index of the item's text cell. + * @param className A string value specifying the CSS class name. + */ + RemoveItemTextCellCssClass(itemIndex: number, textCellIndex: number, className: string): void; +} +/** + * Serves as the base type for the ASPxClientRadioButtonList objects. + */ +interface ASPxClientCheckListBase extends ASPxClientListEdit { + /** + * Gets the number of items contained in the editor's item collection. + */ + GetItemCount(): number; + /** + * Returns the editor's item specified by its index. + * @param index An integer value specifying the zero-based index of the item to be retrieved. + */ + GetItem(index: number): ASPxClientListEditItem; +} +/** + * Represents the client-side equivalent of the ASPxRadioButtonList control. + */ +interface ASPxClientRadioButtonList extends ASPxClientCheckListBase { +} +/** + * A client-side equivalent of the ASPxCheckBoxList object. + */ +interface ASPxClientCheckBoxList extends ASPxClientCheckListBase { + /** + * Occurs on the client side after a different item in the check box list has been selected (focus has been moved from one item to another). + */ + SelectedIndexChanged: ASPxClientEvent>; + /** + * Returns an array of the check box list editor's selected items indices. + */ + GetSelectedIndices(): number[]; + /** + * Returns an array of the check box list editor's selected items values. + */ + GetSelectedValues(): Object[]; + /** + * Returns an array of the check box list editor's selected items. + */ + GetSelectedItems(): ASPxClientListEditItem[]; + /** + * Selects all check box list items. + */ + SelectAll(): void; + /** + * Unselects all check box list items. + */ + UnselectAll(): void; + /** + * Selects items with the specified indices within a check box list. + * @param indices An array of integer values that are the item indices. + */ + SelectIndices(indices: number[]): void; + /** + * Selects the specified items within a check box list. + * @param items An array of ASPxClientListEditItem objects that are the items. + */ + SelectItems(items: ASPxClientListEditItem[]): void; + /** + * Selects items with the specified values within a check box list. + * @param values An array of Object[] objects that are the item values. + */ + SelectValues(values: Object[]): void; + /** + * Unselects items with the specified indices within a check box list. + * @param indices An array of integer values that are the item indices. + */ + UnselectIndices(indices: number[]): void; + /** + * Unselects the specified items within a check box list. + * @param items An array of ASPxClientListEditItem objects that are the items. + */ + UnselectItems(items: ASPxClientListEditItem[]): void; + /** + * Unselects items with the specified values within a check box list. + * @param values An array of Object[] objects that are the item values. + */ + UnselectValues(values: Object[]): void; +} +/** + * A method that will handle the SelectedIndexChanged event. + */ +interface ASPxClientListEditItemSelectedChangedEventHandler { + /** + * A method that will handle the SelectedIndexChanged event. + * @param source The event source. + * @param e An ASPxClientListEditItemSelectedChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientListEditItemSelectedChangedEventArgs): void; +} +/** + * Provides data for the SelectedIndexChanged event. + */ +interface ASPxClientListEditItemSelectedChangedEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the index of the item related to the event. + * Value: An integer value that represents the item's index within the corresponding editor's item collection. + */ + index: number; + /** + * Gets whether the item has been selected. + * Value: true if the item is selected; otherwise, false. + */ + isSelected: boolean; +} +/** + * Represents a client-side equivalent of the ASPxProgressBar control. + */ +interface ASPxClientProgressBar extends ASPxClientEditBase { + /** + * Sets the position of the operation's progress. + * @param position An integer value specifying the progress position. + */ + SetPosition(position: number): void; + /** + * Gets the position of the operation's progress. + */ + GetPosition(): number; + /** + * Sets the pattern used to format the displayed text for the progress bar. + * @param text A value that is the format pattern. + */ + SetCustomDisplayFormat(text: string): void; + /** + * Returns the text displayed within the progress bar. + */ + GetDisplayText(): string; + /** + * Sets the percentage representation of the progress position. + */ + GetPercent(): number; + /** + * Sets the minimum range value of the progress bar. + * @param min An integer value specifying the minimum value of the progress bar range. + */ + SetMinimum(min: number): void; + /** + * Sets the maximum range value of the progress bar. + * @param max An integer value specifying the maximum value of the progress bar range. + */ + SetMaximum(max: number): void; + /** + * Gets the minimum range value of the progress bar. + */ + GetMinimum(): number; + /** + * Gets the maximum range value of the progress bar. + */ + GetMaximum(): number; + /** + * Sets the minimum and maximum range values of the progress bar. + * @param minValue An integer value specifying the minimum value of the progress bar range. + * @param maxValue An integer value specifying the maximum value of the progress bar range. + */ + SetMinMaxValues(minValue: number, maxValue: number): void; +} +/** + * Represents a base class for the ASPxClientSpinEdit object. + */ +interface ASPxClientSpinEditBase extends ASPxClientButtonEditBase { + /** + * This event is not in effect for the ASPxClientSpinEditBase. Use the ASPxClientTimeEdit. + */ + TextChanged: ASPxClientEvent>; +} +/** + * Represents the client-side equivalent of the ASPxSpinEdit control. + */ +interface ASPxClientSpinEdit extends ASPxClientSpinEditBase { + /** + * Occurs on the client side when the editor's value is altered in any way. + */ + NumberChanged: ASPxClientEvent>; + /** + * Specifies the value of the spin edit control on the client side. + * @param number A Decimal value specifying the control value. + */ + SetValue(number: number): void; + /** + * Sets the spin editor's value. + * @param number A decimal number specifying the value to assign to the spin editor. + */ + SetNumber(number: number): void; + /** + * Gets a number which represents the spin editor's value. + */ + GetNumber(): number; + /** + * Returns the text displayed within the editor. + */ + GetText(): string; + /** + * Sets the minimum value of the editor. + * @param value A decimal value specifying the minimum value of the editor. + */ + SetMinValue(value: number): void; + /** + * Gets the minimum value of the editor. + */ + GetMinValue(): number; + /** + * Sets the maximum value of the editor. + * @param value A decimal value specifying the maximum value of the editor. + */ + SetMaxValue(value: number): void; + /** + * Gets the maximum value of the editor. + */ + GetMaxValue(): number; + /** + * Changes the editor's value. + * @param value An object representing the data to be assigned to the editor's edit value. + */ + SetValue(value: Object): void; +} +/** + * Represents the client-side equivalent of the ASPxTimeEdit control. + */ +interface ASPxClientTimeEdit extends ASPxClientSpinEditBase { + /** + * Fires after the selected date has been changed within the time editor. + */ + DateChanged: ASPxClientEvent>; + /** + * Specifies the date for the editor. + * @param date A DateTime object that is the date. + */ + SetDate(date: Date): void; + /** + * Gets the date that is the editor's value. + */ + GetDate(): Date; +} +/** + * Represents a base for client-side static editors whose values cannot be visually changed by end users. + */ +interface ASPxClientStaticEdit extends ASPxClientEditBase { + /** + * Occurs on the client side after an end-user clicks within a static editor. + */ + Click: ASPxClientEvent>; +} +/** + * A method that will handle client-side events which concern clicking within editors. + */ +interface ASPxClientEditEventHandler { + /** + * A method that will handle client-side events which concern clicking within editors. + * @param source An object representing the event source. Identifies the editor that raised the event. + * @param e An ASPxClientEditClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientEditClickEventArgs): void; +} +/** + * Provides data for the client-side events which concern clicking within editors. + */ +interface ASPxClientEditClickEventArgs extends ASPxClientEventArgs { + /** + * Gets the HTML element related to the event. + * Value: An object that represents the clicked HTML element. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * Represents the client-side equivalent of the ASPxHyperLink control. + */ +interface ASPxClientHyperLink extends ASPxClientStaticEdit { + /** + * Gets an URL which defines the navigation location for the editor's hyperlink. + */ + GetNavigateUrl(): string; + /** + * Specifies an URL which defines the navigation location for the editor's hyperlink. + * @param url A string value which specifies an URL to where the client web browser will navigate when a hyperlink in the editor is clicked. + */ + SetNavigateUrl(url: string): void; + /** + * Gets the text caption displayed for the hyperlink in the hyperlink editor. + */ + GetText(): string; + /** + * Specifies the text caption displayed for the hyperlink in the hyperlink editor. + * @param text A string value specifying the text caption for the hyperlink in the editor. + */ + SetText(text: string): void; +} +/** + * Represents a base for client-side editors which are capable of displaying images. + */ +interface ASPxClientImageBase extends ASPxClientStaticEdit { + /** + * Sets the size of the image displayed within the image editor. + * @param width An integer value that specifies the image's width. + * @param height An integer value that specifies the image's height. + */ + SetSize(width: number, height: number): void; +} +/** + * Represents the client-side equivalent of the ASPxImage control. + */ +interface ASPxClientImage extends ASPxClientImageBase { + /** + * Returns the URL pointing to the image displayed within the image editor. + */ + GetImageUrl(): string; + /** + * Sets the URL which points to the image displayed within the image editor. + * @param url A string value specifying the URL to the image displayed within the editor. + */ + SetImageUrl(url: string): void; +} +/** + * Represents the client-side equivalent of the ASPxLabel control. + */ +interface ASPxClientLabel extends ASPxClientStaticEdit { + /** + * Returns the text displayed within the editor. + */ + GetText(): string; + /** + * Sets the text to be displayed within the editor. + * @param text A string value specifying the text to be displayed within the editor. + */ + SetText(text: string): void; +} +/** + * Represents the client-side equivalent of the ASPxTextBox control. + */ +interface ASPxClientTextBox extends ASPxClientTextBoxBase { +} +/** + * Represents the client-side equivalent of the ASPxMemo control. + */ +interface ASPxClientMemo extends ASPxClientTextEdit { +} +/** + * Represents the client-side equivalent of the ASPxButtonEdit control. + */ +interface ASPxClientButtonEdit extends ASPxClientButtonEditBase { +} +/** + * A method that will handle the ButtonClick event. + */ +interface ASPxClientButtonEditClickEventHandler { + /** + * A method that will handle the ButtonClick event. + * @param source An object representing the event source. Identifies the button editor that raised the event. + * @param e An ASPxClientButtonEditClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientButtonEditClickEventArgs): void; +} +/** + * Provides data for the ButtonClick event. + */ +interface ASPxClientButtonEditClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the index of the clicked button. + * Value: An integer value representing the index of the clicked button within the editor's Buttons collection. + */ + buttonIndex: number; +} +/** + * A client-side equivalent of the ASPxTokenBox object. + */ +interface ASPxClientTokenBox extends ASPxClientComboBox { + /** + * Fires on the client side after the token collection has been changed. + */ + TokensChanged: ASPxClientEvent>; + /** + * Adds a new token with the specified text to the end of the control's token collection. + * @param text A string value specifying the token's text. + */ + AddToken(text: string): void; + /** + * Removes a token specified by its text from the client token box. + * @param text A string value that is the text of the token to be removed. + */ + RemoveTokenByText(text: string): void; + /** + * Removes a token specified by its index from the client token box. + * @param index An integer value that is the index of the token to be removed. + */ + RemoveToken(index: number): void; + /** + * Returns an HTML span element that corresponds to the specified token. + * @param index An integer value that is the token index. + */ + GetTokenHtmlElement(index: number): Object; + /** + * Returns an HTML span element that corresponds to the specified token's text. + * @param index An integer value that is the token index. + */ + GetTokenTextHtmlElement(index: number): Object; + /** + * Returns an HTML span element that corresponds to the specified token's remove button. + * @param index An integer value that is the token index. + */ + GetTokenRemoveButtonHtmlElement(index: number): Object; + /** + * Returns a collection of tokens. + */ + GetTokenCollection(): string[]; + /** + * Sets a collection of tokens. + * @param collection A object that is the collection of tokens. + */ + SetTokenCollection(collection: string[]): void; + /** + * Removes all tokens contained in the token box. + */ + ClearTokenCollection(): void; + /** + * Returns the index of a token specified by its text. + * @param text A string value that specifies the text of the token. + */ + GetTokenIndexByText(text: string): number; + /** + * Gets the token texts, separated with a sign, specified by the TextSeparator property. + */ + GetText(): string; + /** + * Sets the token texts, separated with a sign, specified by the TextSeparator property. + * @param text A string value that is the token texts separated with a text separator. + */ + SetText(text: string): void; + /** + * Gets the editor value. + */ + GetValue(): string; + /** + * Sets the editor value. + * @param value A string that is the editor value. + */ + SetValue(value: string): void; + /** + * Returns a value that indicates if the specified token (string) is a custom token. + * @param text A string value that is a token. + * @param caseSensitive true, if tokens are case sensitive; otherwise, false. + */ + IsCustomToken(text: string, caseSensitive: boolean): boolean; + /** + * Changes the editor's value. + * @param value An object representing the data to be assigned to the editor's edit value. + */ + SetValue(value: Object): void; +} +/** + * The client-side equivalent of the ASPxTrackBar control. + */ +interface ASPxClientTrackBar extends ASPxClientEdit { + /** + * Fires on the client side before a track bar position is changed and allows you to cancel the action. + */ + PositionChanging: ASPxClientEvent>; + /** + * Fires after the editor's position has been changed. + */ + PositionChanged: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user moves a cursor while the drag handle is held down. + */ + Track: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user presses a drag handle and moves it. + */ + TrackStart: ASPxClientEvent>; + /** + * Occurs on the client-side when an end-user releases a drag handle after moving it. + */ + TrackEnd: ASPxClientEvent>; + /** + * Returns a track bar item index by the item's value. + * @param value An object that specifies the item's value. + */ + GetItemIndexByValue(value: Object): number; + /** + * Returns a track bar item's associated value. + * @param index An integer value that specifies the required item's index. + */ + GetItemValue(index: number): Object; + /** + * Returns a track bar item text. + * @param index An integer value that specifies the required item's index. + */ + GetItemText(index: number): string; + /** + * Returns a track bar item's tooltip text. + * @param index An integer value that specifies the required item's index. + */ + GetItemToolTip(index: number): string; + /** + * Returns the number of the track bar items that are maintained by the item collection. + */ + GetItemCount(): number; + /** + * Specifies the secondary drag handle position. + * @param position A value that specifies the position. + */ + SetPositionEnd(position: number): void; + /** + * Specifies the main drag handle position. + * @param position A value that specifies the position. + */ + SetPositionStart(position: number): void; + /** + * Returns the secondary drag handle position. + */ + GetPositionEnd(): number; + /** + * Returns the main drag handle position. + */ + GetPositionStart(): number; + /** + * Gets a drag handle position. + */ + GetPosition(): number; + /** + * Specifies a drag handle position. + * @param position A value that specifies the position. + */ + SetPosition(position: number): void; +} +/** + * A method that will handle the client PositionChanging event. + */ +interface ASPxClientTrackBarPositionChangingEventHandler { + /** + * A method that will handle the PositionChanging event. + * @param source The event source. Identifies the ASPxTrackBar control that raised the event. + * @param e A ASPxClientTrackBarPositionChangingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTrackBarPositionChangingEventArgs): void; +} +/** + * Provides data for the PositionChanging event. + */ +interface ASPxClientTrackBarPositionChangingEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; + /** + * Gets the current drag handle position. + * Value: A value that is the drag handle position. + */ + currentPosition: number; + /** + * Gets the current secondary drag handle position. + * Value: A value that is the drag handle position. + */ + currentPositionEnd: number; + /** + * Gets the current main drag handle position. + * Value: A value that is the drag handle position. + */ + currentPositionStart: number; + /** + * Gets a position where the drag handle is being moved. + * Value: A value that is the drag handle position. + */ + newPosition: number; + /** + * Gets a position where the secondary drag handle is being moved. + * Value: A value that is the drag handle position. + */ + newPositionEnd: number; + /** + * Gets a position where the main drag handle is being moved. + * Value: A value that is the drag handle position. + */ + newPositionStart: number; +} +/** + * Represents the client-side equivalent of the ASPxValidationSummary control. + */ +interface ASPxClientValidationSummary extends ASPxClientControl { + /** + * Occurs on the client side when the validation summary's visibility is changed. + */ + VisibilityChanged: ASPxClientEvent>; +} +/** + * A method that will handle the VisibilityChanged event. + */ +interface ASPxClientValidationSummaryVisibilityChangedEventHandler { + /** + * A method that will handle the VisibilityChanged client event. + * @param source An object representing the event source. + * @param e A ASPxClientValidationSummaryVisibilityChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientValidationSummaryVisibilityChangedEventArgs): void; +} +/** + * Provides data for the VisibilityChanged event. + */ +interface ASPxClientValidationSummaryVisibilityChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets whether the editor is visible on the client. + * Value: true if the editor is visible; otherwise, false. + */ + visible: boolean; +} +/** + * Represents the client ASPxGaugeControl. + */ +interface ASPxClientGaugeControl extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires when errors have occurred during callback processing. + */ + CallbackError: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * Lists values that specify the position relative to the target column in which a moved column should be placed. + */ +interface ASPxClientGridColumnMovingTargetPosition { + /** + * A moved column should be placed to the right of the target column. + */ + Right: number; + /** + * A moved column should be placed to the left of the target column. + */ + Left: number; + /** + * A moved column should be placed at the top of the target column. + */ + Top: number; + /** + * A moved column should be placed at the bottom of the target column. + */ + Bottom: number; +} +/** + * Represents the client ASPxGridView. + */ +interface ASPxClientGridBase extends ASPxClientControl { + /** + * Fires after a toolbar item has been clicked. + */ + ToolbarItemClick: ASPxClientEvent>; + /** + * Returns a toolbar specified by its name. + * @param name A string value specifying the toolbar name. + */ + GetToolbarByName(name: string): ASPxClientMenu; + /** + * Returns a grid's toolbar specified by its index. + * @param index An integer value specifying the zero-based index of the toolbar object to retrieve. + */ + GetToolbar(index: number): ASPxClientMenu; +} +/** + * Serves as a base object implementing the client column functionality. + */ +interface ASPxClientGridColumnBase { +} +/** + * A method that will handle the ToolbarItemClick event. + */ +interface ASPxClientGridToolbarItemClickEventHandler { + /** + * A method that will handle the ToolbarItemClick event. + * @param source The event source. + * @param e An ASPxClientGridToolbarItemClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridToolbarItemClickEventArgs): void; +} +/** + * Provides data for the ToolbarItemClick event. + */ +interface ASPxClientGridToolbarItemClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the toolbar index. + * Value: An integer value that is the toolbar index. + */ + toolbarIndex: number; + /** + * Gets the toolbar name. + * Value: A string value that is the toolbar name. + */ + toolbarName: string; + /** + * Gets the clicked toolbar item. + * Value: A ASPxClientMenuItem object that is the toolbar item. + */ + item: ASPxClientMenuItem; + /** + * Specifies whether a postback or a callback is used to finally process the event on the server side. + * Value: true to perform the round trip to the server side via postback; false to perform the round trip to the server side via callback. + */ + usePostBack: boolean; +} +/** + * The client-side equivalent of the ASPxGridLookup control. + */ +interface ASPxClientGridLookup extends ASPxClientDropDownEditBase { + /** + * Fires on the client when a data row is clicked within the built-in dropdown grid. + */ + RowClick: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Returns a client object representing the built-in dropdown grid. + */ + GetGridView(): ASPxClientGridView; + /** + * Confirms the current selection made by an end-user within the editor's dropdown grid. + */ + ConfirmCurrentSelection(): void; + /** + * Cancels the current selection made by an end-user within the editor's dropdown grid and rolls back to the last confirmed selection. The selection can be confirmed by either pressing the Enter key or calling the ConfirmCurrentSelection method. + */ + RollbackToLastConfirmedSelection(): void; +} +/** + * Represents the client ASPxCardView. + */ +interface ASPxClientCardView extends ASPxClientGridBase { + /** + * Provides access to the batch editing client API. + * Value: A object that exposes the batch editing client API methods. + */ + batchEditApi: ASPxClientCardViewBatchEditApi; + /** + * Occurs when a custom command button has been clicked. + */ + CustomButtonClick: ASPxClientEvent>; + /** + * Fires after the selection has been changed. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Enables you to prevent columns from being sorted. + */ + ColumnSorting: ASPxClientEvent>; + /** + * Occurs when a grid switches to batch edit mode. + */ + BatchEditStartEditing: ASPxClientEvent>; + /** + * Occurs when a grid leaves batch edit mode. + */ + BatchEditEndEditing: ASPxClientEvent>; + /** + * Enables you to prevent a batch edit confirmation message from being displayed. + */ + BatchEditConfirmShowing: ASPxClientEvent>; + /** + * Enables you to provide navigation for editors contained in a templated cell in Batch Edit mode. + */ + BatchEditTemplateCellFocused: ASPxClientEvent>; + /** + * Enables you to specify whether card data is valid and provide an error text. + */ + BatchEditCardValidating: ASPxClientEvent>; + /** + * Occurs on the client side before data changes are saved in batch edit mode. + */ + BatchEditChangesSaving: ASPxClientEvent>; + /** + * Occurs on the client side before data changes are canceled in batch edit mode. + */ + BatchEditChangesCanceling: ASPxClientEvent>; + /** + * Occurs on the client side before a card is inserted in batch edit mode. + */ + BatchEditCardInserting: ASPxClientEvent>; + /** + * Occurs on the client side before a card is deleted in batch edit mode. + */ + BatchEditCardDeleting: ASPxClientEvent>; + /** + * Occurs on the client side when the focused cell is about to be changed. + */ + FocusedCellChanging: ASPxClientEvent>; + /** + * Fires on the client when a card is clicked. + */ + CardClick: ASPxClientEvent>; + /** + * Fires on the client when a card is double clicked. + */ + CardDblClick: ASPxClientEvent>; + /** + * Fires in response to changing card focus. + */ + FocusedCardChanged: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any unhandled server error occurs during server-side processing of a callback sent by the ASPxClientCardView. + */ + CallbackError: ASPxClientEvent>; + /** + * Fires after the customization window has been closed. + */ + CustomizationWindowCloseUp: ASPxClientEvent>; + /** + * Returns the value of the specified edit cell. + * @param column An ASPxClientCardViewColumn object that represents the data column within the client grid. + */ + GetEditValue(column: ASPxClientCardViewColumn): string; + /** + * Returns the value of the specified edit cell. + * @param columnIndex An integer value that identifies the data column within the grid's column collection. + */ + GetEditValue(columnIndex: number): string; + /** + * Returns the value of the specified edit cell. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + GetEditValue(columnFieldNameOrId: string): string; + /** + * Moves focus to the specified edit cell within the edited card. + * @param column An ASPxClientCardViewColumn object that represents the data column within the client grid. + */ + FocusEditor(column: ASPxClientCardViewColumn): void; + /** + * Moves focus to the specified edit cell within the edited card. + * @param columnIndex An integer value that specifies the column's position within the columns collection. + */ + FocusEditor(columnIndex: number): void; + /** + * Moves focus to the specified edit cell within the edited card. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + FocusEditor(columnFieldNameOrId: string): void; + /** + * Sets the value of the specified edit cell. + * @param column An ASPxClientCardViewColumn object that represents the data column within the client grid. + * @param value A string value that specifies the edit cell's new value. + */ + SetEditValue(column: ASPxClientCardViewColumn, value: string): void; + /** + * Sets the value of the specified edit cell. + * @param columnIndex An integer value that identifies the data column within the grid's column collection. + * @param value A string value that specifies the edit cell's new value. + */ + SetEditValue(columnIndex: number, value: string): void; + /** + * Sets the value of the specified edit cell. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param value A string value that specifies the edit cell's new value. + */ + SetEditValue(columnFieldNameOrId: string, value: string): void; + /** + * Displays the Filter Control. + */ + ShowFilterControl(): void; + /** + * Hides the Filter Control. + */ + CloseFilterControl(): void; + /** + * Enables or disables the current filter. + * @param isFilterEnabled true to enable the current filter; otherwise, false. + */ + SetFilterEnabled(isFilterEnabled: boolean): void; + /** + * Returns the current vertical scroll position of the grid's content. + */ + GetVerticalScrollPosition(): number; + /** + * Specifies the vertical scroll position for the grid's content. + * @param position An integer value specifying the vertical scroll position. + */ + SetVerticalScrollPosition(position: number): void; + /** + * Gets information about a focused cell. + */ + GetFocusedCell(): ASPxClientCardViewCellInfo; + /** + * Focuses the specified cell. + * @param cardVisibleIndex An value that specifies the visible index of the card. + * @param columnIndex A zero-based index that identifies the column in the column collection (the column's Index property value). + */ + SetFocusedCell(cardVisibleIndex: number, columnIndex: number): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientCardViewColumn object that represents the data column. + */ + SortBy(column: ASPxClientCardViewColumn): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + SortBy(columnIndex: number): void; + /** + * Sorts data by the specified data column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + SortBy(columnFieldNameOrId: string): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientCardViewColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(column: ASPxClientCardViewColumn, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(columnIndex: number, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(columnFieldNameOrId: string, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientCardViewColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(column: ASPxClientCardViewColumn, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(columnIndex: number, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(columnFieldNameOrId: string, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values, and places the column to the specified position among the sorted columns. + * @param column An ASPxClientCardViewColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex + */ + SortBy(column: ASPxClientCardViewColumn, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Sorts data by the specified data column's values, and places the column to the specified position among the sorted columns. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex An integer value that specifies the zero-based column's index among the sorted columns. -1 if data is not sorted by this column. + */ + SortBy(columnIndex: number, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Sorts data by the specified data column's values, and places the column to the specified position among the sorted columns. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex An integer value that specifies the zero-based column's index among the sorted columns. -1 if data is not sorted by this column. + */ + SortBy(columnFieldNameOrId: string, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Hides the specified column. + * @param column An ASPxClientCardViewColumn object that represents the column to hide. + */ + MoveColumn(column: ASPxClientCardViewColumn): void; + /** + * Hides the specified column. + * @param columnIndex An integer value that specifies the absolute index of the column to hide. + */ + MoveColumn(columnIndex: number): void; + /** + * Hides the specified column. + * @param columnFieldNameOrId A string value that identifies the column to be hidden by the name of the data source field to which the column is bound, or by the column's name. + */ + MoveColumn(columnFieldNameOrId: string): void; + /** + * Moves the specified column to the specified visual position within the ASPxCardView. + * @param column An ASPxClientCardViewColumn object that represents the column to move. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the ASPxCardView. + */ + MoveColumn(column: ASPxClientCardViewColumn, moveToColumnVisibleIndex: number): void; + /** + * Moves the specified column to the specified visual position within the ASPxCardView. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the grid. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number): void; + /** + * Moves the specified column to the specified visual position within the ASPxCardView. + * @param columnFieldNameOrId A string value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the ASPxCardView. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number): void; + /** + * Moves the specified column to the specified visual position within the ASPxCardView. + * @param column An ASPxClientCardViewColumn object that represents the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the CardView. + * @param moveBefore true, to move the column before the target column; otherwise, false. + */ + MoveColumn(column: ASPxClientCardViewColumn, moveToColumnVisibleIndex: number, moveBefore: boolean): void; + /** + * Moves the specified column to the specified visual position within the ASPxCardView. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number, moveBefore: boolean): void; + /** + * Moves the specified column to the specified visual position within the ASPxCardView. + * @param columnFieldNameOrId A string value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number, moveBefore: boolean): void; + /** + * Returns the key value of the specified card. + * @param visibleIndex An integer value that specifies the card's visible index. + */ + GetCardKey(visibleIndex: number): string; + /** + * Switches the CardView to edit mode. + * @param visibleIndex A zero-based integer that identifies a card to be edited. + */ + StartEditCard(visibleIndex: number): void; + /** + * Switches the ASPxCardView to edit mode. + * @param key An object that uniquely identifies a card to be edited. + */ + StartEditCardByKey(key: Object): void; + /** + * Indicates whether or not a new card is being edited. + */ + IsNewCardEditing(): boolean; + /** + * Adds a new record. + */ + AddNewCard(): void; + /** + * Deletes the specified card. + * @param visibleIndex An integer value that identifies the card. + */ + DeleteCard(visibleIndex: number): void; + /** + * Deletes a card with the specified key value. + * @param key An object that uniquely identifies the card. + */ + DeleteCardByKey(key: Object): void; + /** + * Returns the focused card's index. + */ + GetFocusedCardIndex(): number; + /** + * Moves focus to the specified card. + * @param visibleIndex An integer value that specifies the focused card's index. + */ + SetFocusedCardIndex(visibleIndex: number): void; + /** + * Selects all the unselected cards within the CardView. + */ + SelectCards(): void; + /** + * Selects the specified card displayed within the CardView. + * @param visibleIndex A zero-based integer value that specifies the card's visible index. + */ + SelectCards(visibleIndex: number): void; + /** + * Selects the specified cards within the CardView. + * @param visibleIndices An array of zero-based indices that identify data cards within the grid. + */ + SelectCards(visibleIndices: number[]): void; + /** + * Selects or deselects the specified cards within the CardView. + * @param visibleIndices An array of zero-based indices that identify data cards within the grid. + * @param selected true to select the specified cards; false to deselect the cards. + */ + SelectCards(visibleIndices: number[], selected: boolean): void; + /** + * Selects or deselects the specified card within the GridView. + * @param visibleIndex An integer zero-based index that identifies the data card within the grid. + * @param selected true to select the specified card; false to deselect the card. + */ + SelectCards(visibleIndex: number, selected?: boolean): void; + /** + * Selects or deselects the specified cards displayed within the CardView. + * @param keys An array of objects that uniquely identify the cards. + * @param selected true to select the specified cards; false to deselect the cards. + */ + SelectCardsByKey(keys: Object[], selected?: boolean): void; + /** + * Selects or deselects the specified card displayed within the CardView. + * @param key An object that uniquely identifies the card. + * @param selected true to select the specified card; false to deselect the card. + */ + SelectCardsByKey(key: Object, selected?: boolean): void; + /** + * Selects the specified cards displayed within the CardView. + * @param keys An array of objects that uniquely identify the cards. + */ + SelectCardsByKey(keys: Object[]): void; + /** + * Selects a card displayed within the CardView by its key. + * @param key An object that uniquely identifies the card. + */ + SelectCardsByKey(key: Object): void; + /** + * Deselects the specified cards displayed within the ASPxCardView. + * @param keys An array of objects that uniquely identify the cards. + */ + UnselectCardsByKey(keys: Object[]): void; + /** + * Deselects the specified card displayed within the ASPxCardView. + * @param key An object that uniquely identifies the card. + */ + UnselectCardsByKey(key: Object): void; + /** + * Deselects all the selected cards within the ASPxCardView. + */ + UnselectCards(): void; + /** + * Deselects the specified cards (if selected) within the ASPxCardView. + * @param visibleIndices An array of zero-based indices that identify data cards within the grid. + */ + UnselectCards(visibleIndices: number[]): void; + /** + * Deselects the specified cards (if selected) within the ASPxCardView. + * @param visibleIndex A zero-based integer value that specifies the card's visible index. + */ + UnselectCards(visibleIndex: number): void; + /** + * Deselects all grid cards that match the filter criteria currently applied to the CardView. + */ + UnselectFilteredCards(): void; + /** + * Selects the specified card displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the card's visible index. + */ + SelectCardOnPage(visibleIndex: number): void; + /** + * Selects or deselects the specified card displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the card's visible index. + * @param selected true to select the specified card; false to deselect the card. + */ + SelectCardOnPage(visibleIndex: number, selected?: boolean): void; + /** + * Deselects the specified cards (if selected) displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the card's visible index. + */ + UnselectCardOnPage(visibleIndex: number): void; + /** + * Selects all unselected cards displayed on the current page. + */ + SelectAllCardsOnPage(): void; + /** + * Allows you to select or deselect all cards displayed on the current page based on the parameter passed. + * @param selected true to select all unselected cards displayed on the current page; false to deselect all selected cards on the page. + */ + SelectAllCardsOnPage(selected: boolean): void; + /** + * Deselects all selected cards displayed on the current page. + */ + UnselectAllCardsOnPage(): void; + /** + * Returns the number of selected cards. + */ + GetSelectedCardCount(): number; + /** + * Indicates whether or not the specified card is selected within the current page. + * @param visibleIndex An integer value that identifies the card by its visible index. + */ + IsCardSelectedOnPage(visibleIndex: number): boolean; + /** + * Applies the specified search panel filter criterion to grid data. + * @param value A string value that specifies the filter criterion. + */ + ApplySearchPanelFilter(value: string): void; + /** + * Applies the specified filter expression to the grid. + * @param filterExpression A string value that specifies the filter expression. + */ + ApplyFilter(filterExpression: string): void; + /** + * Clears the filter expression applied to a client CardView. + */ + ClearFilter(): void; + /** + * Gets the Popup Edit Form. + */ + GetPopupEditForm(): ASPxClientPopupControl; + /** + * Sets input focus to the grid. + */ + Focus(): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing the specified argument to it. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; + /** + * Selects the specified page. + * @param pageIndex An integer value that specifies the active page's index. + */ + GotoPage(pageIndex: number): void; + /** + * Gets the index of the page currently being selected. + */ + GetPageIndex(): number; + /** + * Gets the number of pages to which the grid's data is divided. + */ + GetPageCount(): number; + /** + * Activates the next page. + */ + NextPage(): void; + /** + * Activates the previous page. + */ + PrevPage(): void; + /** + * Returns the index of the first card displayed within the grid's active page. + */ + GetTopVisibleIndex(): number; + /** + * Indicates whether the grid is in edit mode. + */ + IsEditing(): boolean; + /** + * Saves all the changes made and switches the grid to browse mode. + */ + UpdateEdit(): void; + /** + * Cancels all the changes made and switches the CardView to browse mode. + */ + CancelEdit(): void; + /** + * Updates data displayed within the grid. + */ + Refresh(): void; + /** + * Indicates whether the customization window is displayed. + */ + IsCustomizationWindowVisible(): boolean; + /** + * Invokes the customization window. + */ + ShowCustomizationWindow(): void; + /** + * Invokes the customization window and displays it over the specified HTML element. + * @param showAtElement An object that specifies the HTML element relative to whose position the customization window is invoked. + */ + ShowCustomizationWindow(showAtElement?: Object): void; + /** + * Closes the customization window. + */ + HideCustomizationWindow(): void; + /** + * Returns the number of columns within the client grid. + */ + GetColumnCount(): number; + /** + * Returns the card values displayed within all selected cards. + * @param fieldNames The names of data source fields separated via a semicolon, whose values within the selected cards are returned. + * @param onCallback An ASPxClientCardViewValuesCallback object that represents the JavaScript function which receives the list of card values as a parameter. + */ + GetSelectedFieldValues(fieldNames: string, onCallback: ASPxClientCardViewValuesCallback): void; + /** + * Returns key values of selected cards displayed within the current page. + */ + GetSelectedKeysOnPage(): Object[]; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event. + * @param args A string value that is any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback An ASPxClientCardViewValuesCallback object that is the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(args: string, onCallback: ASPxClientCardViewValuesCallback): void; + /** + * Returns the values of the specified data source fields within the specified card. + * @param visibleIndex An integer value that identifies the data card. + * @param fieldNames The names of data source fields separated via a semicolon, whose values within the specified card are returned. + * @param onCallback An ASPxClientCardViewValuesCallback object that represents the JavaScript function which receives the list of card values as a parameter. + */ + GetCardValues(visibleIndex: number, fieldNames: string, onCallback: ASPxClientCardViewValuesCallback): void; + /** + * Returns the card values displayed within the current page. + * @param fieldNames The names of data source fields whose values are returned. + * @param onCallback An ASPxClientCardViewValuesCallback object that represents the JavaScript function which receives the list of card values as a parameter. + */ + GetPageCardValues(fieldNames: string, onCallback: ASPxClientCardViewValuesCallback): void; + /** + * Returns the number of cards actually displayed within the active page. + */ + GetVisibleCardsOnPage(): number; + /** + * Returns the client column that resides at the specified position within the column collection. + * @param columnIndex A zero-based index that identifies the column within the column collection (the column's Index property value). + */ + GetColumn(columnIndex: number): ASPxClientCardViewColumn; + /** + * Returns the column with the specified unique identifier. + * @param columnId A string value that specifies the column's unique identifier (the column's Name property value). + */ + GetColumnById(columnId: string): ASPxClientCardViewColumn; + /** + * Returns the client column which is bound to the specified data source field. + * @param columnFieldName A string value that specifies the name of the data source field to which the column is bound (the column's FieldName property value). + */ + GetColumnByField(columnFieldName: string): ASPxClientCardViewColumn; + /** + * Returns the editor used to edit the specified column's values. + * @param column An ASPxClientCardViewColumn object that specifies the required column within the client grid. + */ + GetEditor(column: ASPxClientCardViewColumn): ASPxClientEdit; + /** + * Returns the editor used to edit the specified column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + GetEditor(columnIndex: number): ASPxClientEdit; + /** + * Returns the editor used to edit the specified column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + GetEditor(columnFieldNameOrId: string): ASPxClientEdit; +} +/** + * Represents a client column. + */ +interface ASPxClientCardViewColumn extends ASPxClientGridColumnBase { + /** + * Gets the name that uniquely identifies the column. + * Value: A string value assigned to the column's Name property. + */ + name: string; + /** + * Gets the column's position within the collection. + * Value: An integer zero-bazed index that specifies the column's position within the collection. + */ + index: number; + /** + * Gets the name of the database field assigned to the current column. + * Value: A string value that specifies the name of a data field. + */ + fieldName: string; + /** + * Gets whether the column is visible. + * Value: true to display the column; otherwise, false. + */ + visible: boolean; +} +/** + * Represents a JavaScript function which receives the list of card values when the client GetSelectedFieldValues method is called. + */ +interface ASPxClientCardViewValuesCallback { + /** + * Represents a JavaScript function which receives the list of card values when the client GetSelectedFieldValues method is called. + * @param result An object that represents the list of card values received from the server. + */ + (result: Object): void; +} +/** + * A method that will handle the cancelable events of a client ASPxCardView column. + */ +interface ASPxClientCardViewColumnCancelEventHandler { + /** + * A method that will handle the cancelable events of a client ASPxCardView column. + * @param source The event source. This parameter identifies the ASPxClientCardView object that raised the event. + * @param e An ASPxClientCardViewColumnCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewColumnCancelEventArgs): void; +} +/** + * Provides data for the cancelable events of a client ASPxCardView column. + */ +interface ASPxClientCardViewColumnCancelEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed client column. + * Value: An ASPxClientCardViewColumn object that represents the processed column. + */ + column: ASPxClientCardViewColumn; +} +/** + * A method that will handle the CardClick event. + */ +interface ASPxClientCardViewCardClickEventHandler { + /** + * A method that will handle the CardClick event. + * @param source The event source. This parameter identifies the ASPxClientCardView object that raised the event. + * @param e An ASPxClientCardViewCardClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewCardClickEventArgs): void; +} +/** + * Provides data for the CardClick event. + */ +interface ASPxClientCardViewCardClickEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed card's visible index. + * Value: An integer zero-based index that identifies the processed record. + */ + visibleIndex: number; + /** + * Provides access to the parameters associated with the CardClick event. + * Value: An object that contains parameters associated with the event. + */ + htmlEvent: Object; +} +/** + * A method that will handle the CustomButtonClick event. + */ +interface ASPxClientCardViewCustomButtonEventHandler { + /** + * A method that will handle the CustomButtonClick event. + * @param source The event source. This parameter identifies the ASPxClientCardView object that raised the event. + * @param e An ASPxClientCardViewCustomButtonEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewCustomButtonEventArgs): void; +} +/** + * Provides data for the CustomButtonClick event. + */ +interface ASPxClientCardViewCustomButtonEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the value which identifies the card whose custom button has been clicked. + * Value: An integer value that identifies the card whose custom button has been clicked. + */ + visibleIndex: number; + /** + * Gets the value which identifies the custom button. + * Value: A string value that identifies the clicked custom button. + */ + buttonID: string; +} +/** + * A method that will handle the SelectionChanged event. + */ +interface ASPxClientCardViewSelectionEventHandler { + /** + * A method that will handle the SelectionChanged event. + * @param source The event source. + * @param e An ASPxClientCardViewSelectionEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewSelectionEventArgs): void; +} +/** + * Provides data for the SelectionChanged event. + */ +interface ASPxClientCardViewSelectionEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the visible index of the card whose selected state has been changed. + * Value: An value that specifies the visible index of the card. + */ + visibleIndex: number; + /** + * Gets whether the card has been selected. + * Value: true if the card has been selected; otherwise, false. + */ + isSelected: boolean; + /** + * Gets whether all cards displayed within a page have been selected or unselected. + * Value: true if all cards displayed within a page have been selected or unselected; otherwise, false. + */ + isAllRecordsOnPage: boolean; + /** + * Gets whether a selection has been changed on the server. + * Value: true if a selection has been changed on the server; otherwise, false. + */ + isChangedOnServer: boolean; +} +/** + * A method that will handle the client BatchEditStartEditing event. + */ +interface ASPxClientCardViewBatchEditStartEditingEventHandler { + /** + * A method that will handle the BatchEditStartEditing event. + * @param source The event source. + * @param e An ASPxClientCardViewBatchEditStartEditingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditStartEditingEventArgs): void; +} +/** + * Provides data for the BatchEditStartEditing event. + */ +interface ASPxClientCardViewBatchEditStartEditingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the visible index of the card whose cells are about to be edited. + * Value: An value that specifies the visible index of the card. + */ + visibleIndex: number; + /** + * Gets the CardView column that owns a cell that is about to be edited. + * Value: An object that is the focused CardView column. + */ + focusedColumn: ASPxClientCardViewColumn; + /** + * Gets a hashtable that maintains information about editable cells. + * Value: A hashtable that stores information about editable cells. + */ + cardValues: Object; +} +/** + * A method that will handle the client BatchEditEndEditing event. + */ +interface ASPxClientCardViewBatchEditEndEditingEventHandler { + /** + * A method that will handle the BatchEditEndEditing event. + * @param source The event source. + * @param e An ASPxClientCardViewBatchEditEndEditingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditEndEditingEventArgs): void; +} +/** + * Provides data for the BatchEditEndEditing event. + */ +interface ASPxClientCardViewBatchEditEndEditingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the visible index of the card whose cells have been edited. + * Value: An value that specifies the visible index of the card. + */ + visibleIndex: number; + /** + * Gets a hashtable that maintains information about editable cells. + * Value: A hashtable that stores information about editable cells. + */ + cardValues: Object; +} +/** + * A method that will handle the client BatchEditCardValidating event. + */ +interface ASPxClientCardViewBatchEditCardValidatingEventHandler { + /** + * A method that will handle the BatchEditCardValidating event. + * @param source The event source. + * @param e An ASPxClientCardViewBatchEditCardValidatingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditCardValidatingEventArgs): void; +} +/** + * Provides data for the BatchEditCardValidating event. + */ +interface ASPxClientCardViewBatchEditCardValidatingEventArgs extends ASPxClientEventArgs { + /** + * Gets the processed card's visible index. + * Value: An integer value that specifies the processed card's visible index. + */ + visibleIndex: number; + /** + * Provides validation information of a card currently being validated. + * Value: An object that is a hashtable containing validation information. + */ + validationInfo: Object; +} +/** + * Represents an object that will handle the client-side BatchEditConfirmShowing event. + */ +interface ASPxClientCardViewBatchEditConfirmShowingEventHandler { + /** + * A method that will handle the BatchEditConfirmShowing client event. + * @param source The event source. + * @param e An ASPxClientCardViewBatchEditConfirmShowingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditConfirmShowingEventArgs): void; +} +/** + * Provides data for the BatchEditConfirmShowing event. + */ +interface ASPxClientCardViewBatchEditConfirmShowingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the client identifier of an object that initiates a send request. + * Value: A string value that specifies the object client identifier. + */ + requestTriggerID: string; +} +/** + * A method that will handle the client BatchEditTemplateCellFocused event. + */ +interface ASPxClientCardViewBatchEditTemplateCellFocusedEventHandler { + /** + * A method that will handle the BatchEditTemplateCellFocused event. + * @param source An object representing the event source. Identifies the button editor that raised the event. + * @param e An ASPxClientCardViewBatchEditTemplateCellFocusedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditTemplateCellFocusedEventArgs): void; +} +/** + * Provides data for the BatchEditTemplateCellFocused event. + */ +interface ASPxClientCardViewBatchEditTemplateCellFocusedEventArgs extends ASPxClientEventArgs { + /** + * Gets the currently processed column. + * Value: An object that is the client-side column object. + */ + column: ASPxClientCardViewColumn; + /** + * Gets or sets a value specifying whether the event was handled. + * Value: true if the event was handled and default processing should not occur; false if the event should be handled using default processing. + */ + handled: boolean; +} +/** + * A method that will handle the BatchEditChangesSaving event. + */ +interface ASPxClientCardViewBatchEditChangesSavingEventHandler { + /** + * A method that will handle the BatchEditChangesSaving event. + * @param source The event source. This parameter identifies the card view object which raised the event. + * @param e An ASPxClientCardViewBatchEditChangesSavingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditChangesSavingEventArgs): void; +} +/** + * Provides data for the BatchEditChangesSaving event. + */ +interface ASPxClientCardViewBatchEditChangesSavingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets a hashtable that maintains information about inserted cells. + * Value: A hashtable that stores information about inserted cells. + */ + insertedValues: Object; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + deletedValues: Object; + /** + * Gets a hashtable that maintains information about updated cells. + * Value: A hashtable that stores information about updated cells. + */ + updatedValues: Object; +} +/** + * A method that will handle the BatchEditChangesCanceling event. + */ +interface ASPxClientCardViewBatchEditChangesCancelingEventHandler { + /** + * A method that will handle the BatchEditChangesCanceling event. + * @param source The event source. This parameter identifies the card view object which raised the event. + * @param e An ASPxClientCardViewBatchEditChangesCancelingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditChangesCancelingEventArgs): void; +} +/** + * Provides data for the BatchEditChangesCanceling event. + */ +interface ASPxClientCardViewBatchEditChangesCancelingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets a hashtable that maintains information about inserted cells. + * Value: A hashtable that stores information about inserted cells. + */ + insertedValues: Object; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + deletedValues: Object; + /** + * Gets a hashtable that maintains information about updated cells. + * Value: A hashtable that stores information about updated cells. + */ + updatedValues: Object; +} +/** + * A method that will handle the BatchEditCardInserting event. + */ +interface ASPxClientCardViewBatchEditCardInsertingEventHandler { + /** + * A method that will handle the BatchEditCardInserting event. + * @param source The event source. This parameter identifies the card view object which raised the event. + * @param e An ASPxClientCardViewBatchEditCardInsertingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditCardInsertingEventArgs): void; +} +/** + * Provides data for the BatchEditCardInserting event. + */ +interface ASPxClientCardViewBatchEditCardInsertingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed card visible index. + * Value: An integer value that specifies the processed card visible index. + */ + visibleIndex: number; +} +/** + * A method that will handle the BatchEditCardDeleting event. + */ +interface ASPxClientCardViewBatchEditCardDeletingEventHandler { + /** + * A method that will handle the BatchEditCardDeleting event. + * @param source The event source. This parameter identifies the card view object which raised the event. + * @param e An ASPxClientCardViewBatchEditCardDeletingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewBatchEditCardDeletingEventArgs): void; +} +/** + * Provides data for the BatchEditCardDeleting event. + */ +interface ASPxClientCardViewBatchEditCardDeletingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed card visible index. + * Value: An integer value that specifies the processed card visible index. + */ + visibleIndex: number; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + cardValues: Object; +} +/** + * A method that will handle the FocusedCellChanging event. + */ +interface ASPxClientCardViewFocusedCellChangingEventHandler { + /** + * A method that will handle the FocusedCellChanging event. + * @param source The event source. + * @param e An ASPxClientCardViewFocusedCellChangingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCardViewFocusedCellChangingEventArgs): void; +} +/** + * Provides data for the FocusedCellChanging event. + */ +interface ASPxClientCardViewFocusedCellChangingEventArgs extends ASPxClientCancelEventArgs { + /** + * Provides information of a card's cell currently being focused. + * Value: A ASPxClientCardViewCellInfo object that provides information about the card's cell. + */ + cellInfo: ASPxClientCardViewCellInfo; +} +/** + * Provides members related to Batch Edit Mode + */ +interface ASPxClientCardViewBatchEditApi { + /** + * Performs validation of CardView data contained in the cards when the CardView operates in Batch Edit mode. + * @param validateOnlyModified true, if only modified cards should be validated; otherwise, false. + */ + ValidateCards(validateOnlyModified?: boolean): boolean; + /** + * Performs validation of CardView data contained in the specified card when the CardView operates in Batch Edit mode. + * @param visibleIndex An integer value specifying the visible index of the validated card. + */ + ValidateCard(visibleIndex: number): boolean; + /** + * Returns an array of card visible indices. + * @param includeDeleted true, to include visible indices of deleted cards to the returned array; otherwise, false. + */ + GetCardVisibleIndices(includeDeleted: boolean): number[]; + /** + * Returns an array of the deleted card visible indices. + */ + GetDeletedCardIndices(): number[]; + /** + * Returns an array of the inserted card visible indices. + */ + GetInsertedCardIndices(): number[]; + /** + * Indicates if the card with the specified visible index is deleted. + * @param visibleIndex An integer value that identifies the card by its visible index. + */ + IsDeletedCard(visibleIndex: number): boolean; + /** + * Indicates if the card with the specified visible index is newly created. + * @param visibleIndex An integer value that identifies the card by its visible index. + */ + IsNewCard(visibleIndex: number): boolean; + /** + * Programmatically moves the focus to the previous cell in the card + */ + MoveFocusBackward(): boolean; + /** + * Programmatically moves the focus to the next cell in the card. + */ + MoveFocusForward(): boolean; + /** + * Sets the value of the specified cell. + * @param visibleIndex An integer zero-based index that identifies the card containing the processed cell. + * @param columnFieldNameOrId A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + * @param value An object that contains the new cell value. + */ + SetCellValue(visibleIndex: number, columnFieldNameOrId: string, value: Object): void; + /** + * Sets the value of the specified cell. + * @param visibleIndex An integer zero-based index that identifies the card containing the processed cell. + * @param columnFieldNameOrId A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + * @param value An object that contains the new cell value. + * @param displayText A string value that specifies the cell display text. + * @param cancelCellHighlighting true to cancel highlighting of the modified cell, false to highlight the modified cell. + */ + SetCellValue(visibleIndex: number, columnFieldNameOrId: string, value: Object, displayText: string, cancelCellHighlighting?: boolean): void; + /** + * Gets the value of the specified cell. + * @param visibleIndex A zero-based integer value that specifies the visible index of a card containing the processed cell. + * @param columnFieldNameOrId A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + * @param initial true, to return the initial (server) value; false, to return a value currently contained on the client side (modified value). + */ + GetCellValue(visibleIndex: number, columnFieldNameOrId: string, initial?: boolean): Object; + /** + * Gets a container holding a data cell content. + * @param visibleIndex An integer value that is the visible index. + * @param columnFieldNameOrId A string value that is the column's Field Name or ID. + */ + GetCellTextContainer(visibleIndex: number, columnFieldNameOrId: string): Object; + /** + * Gets information about the cell currently being edited. + */ + GetEditCellInfo(): ASPxClientCardViewCellInfo; + /** + * Returns a value that indicates whether the card view has changed data. + */ + HasChanges(): boolean; + /** + * Returns a value that indicates whether the specified card has changed data. + * @param visibleIndex An integer value that specifies the visible index of a card. + */ + HasChanges(visibleIndex: number): boolean; + /** + * Returns a value that indicates whether the specified cell's data has been changed. + * @param visibleIndex An integer value that specifies the visible index of a card. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + HasChanges(visibleIndex: number, columnFieldNameOrId: string): boolean; + /** + * Resets changes in the specified card. + * @param visibleIndex An integer value that specifies the visible index of a card. + */ + ResetChanges(visibleIndex: number): void; + /** + * Resets changes in the specified cell. + * @param visibleIndex An integer value that specifies the visible index of a card containing the processed cell. + * @param columnIndex A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + */ + ResetChanges(visibleIndex: number, columnIndex: number): void; + /** + * Switches the specified cell to edit mode. + * @param visibleIndex A zero-based integer value that specifies the visible index of a card containing the processed cell. + * @param columnIndex A zero-based integer value that identifies the column which contains the processed cell in the column collection. + */ + StartEdit(visibleIndex: number, columnIndex: number): void; + /** + * Ends cell or card editing. + */ + EndEdit(): void; +} +/** + * Contains information on a grid cell. + */ +interface ASPxClientCardViewCellInfo { + /** + * Gets the visible index of the card that contains the cell currently being processed. + * Value: An value that specifies the visible index of the card. + */ + cardVisibleIndex: number; + /** + * Gets the data column that contains the cell currently being processed. + * Value: An object that is the data column which contains the processed cell. + */ + column: ASPxClientCardViewColumn; +} +/** + * A client-side equivalent of the ASPxGridView object. + */ +interface ASPxClientGridView extends ASPxClientGridBase { + /** + * Provides access to the batch editing client API. + * Value: A object that exposes the batch editing client API methods. + */ + batchEditApi: ASPxClientGridViewBatchEditApi; + /** + * Occurs when a custom command button has been clicked. + */ + CustomButtonClick: ASPxClientEvent>; + /** + * Fires after the selection has been changed. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Enables you to prevent columns from being sorted. + */ + ColumnSorting: ASPxClientEvent>; + /** + * Fires in response to changing row focus. + */ + FocusedRowChanged: ASPxClientEvent>; + /** + * Enables you to cancel data grouping. + */ + ColumnGrouping: ASPxClientEvent>; + /** + * Fires when an end-user starts dragging the column's header and enables you to cancel this operation. + */ + ColumnStartDragging: ASPxClientEvent>; + /** + * Enables you to prevent columns from being resized. + */ + ColumnResizing: ASPxClientEvent>; + /** + * Occurs after a column's width has been changed by an end-user. + */ + ColumnResized: ASPxClientEvent>; + /** + * Enables you to control column movement. + */ + ColumnMoving: ASPxClientEvent>; + /** + * Fires before a group row is expanded. + */ + RowExpanding: ASPxClientEvent>; + /** + * Fires before a group row is collapsed. + */ + RowCollapsing: ASPxClientEvent>; + /** + * Fires before a detail row is expanded. + */ + DetailRowExpanding: ASPxClientEvent>; + /** + * Fires before a detail row is collapsed. + */ + DetailRowCollapsing: ASPxClientEvent>; + /** + * Fires on the client when a data row is clicked. + */ + RowClick: ASPxClientEvent>; + /** + * Fires on the client when a data row is double clicked. + */ + RowDblClick: ASPxClientEvent>; + /** + * Occurs after an end-user right clicks in the GridView, and enables you to provide a custom context menu. + */ + ContextMenu: ASPxClientEvent>; + /** + * Fires on the client side when a context menu item has been clicked. + */ + ContextMenuItemClick: ASPxClientEvent>; + /** + * Enables you to specify whether row data is valid and provide an error text. + */ + BatchEditRowValidating: ASPxClientEvent>; + /** + * Enables you to prevent a batch edit confirmation message from being displayed. + */ + BatchEditConfirmShowing: ASPxClientEvent>; + /** + * Occurs when a grid switches to batch edit mode. + */ + BatchEditStartEditing: ASPxClientEvent>; + /** + * Occurs when a grid leaves the batch edit mode. + */ + BatchEditEndEditing: ASPxClientEvent>; + /** + * Enables you to provide navigation for editors contained in a templated cell in Batch Edit mode. + */ + BatchEditTemplateCellFocused: ASPxClientEvent>; + /** + * Occurs on the client side before data changes are saved in batch edit mode. + */ + BatchEditChangesSaving: ASPxClientEvent>; + /** + * Occurs on the client side before data changes are canceled in batch edit mode. + */ + BatchEditChangesCanceling: ASPxClientEvent>; + /** + * Occurs on the client side before a data row is inserted in batch edit mode. + */ + BatchEditRowInserting: ASPxClientEvent>; + /** + * Occurs on the client side before a data row is deleted in batch edit mode. + */ + BatchEditRowDeleting: ASPxClientEvent>; + /** + * Occurs on the client side when the focused cell is about to be changed. + */ + FocusedCellChanging: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any unhandled server error occurs during server-side processing of a callback sent by the ASPxClientGridView. + */ + CallbackError: ASPxClientEvent>; + /** + * Fires after the Customization Window has been closed. + */ + CustomizationWindowCloseUp: ASPxClientEvent>; + /** + * Selects or deselects the specified row displayed within the grid. + * @param key An object that uniquely identifies the row. + * @param selected true to select the specified row; false to deselect the row. + */ + SelectRowsByKey(key: Object, selected?: boolean): void; + /** + * Selects the specified rows displayed within the grid. + * @param keys An array of objects that uniquely identify the rows. + */ + SelectRowsByKey(keys: Object[]): void; + /** + * Selects a grid row by its key. + * @param key An object that uniquely identifies the row. + */ + SelectRowsByKey(key: Object): void; + /** + * Deselects the specified rows displayed within the grid. + * @param keys An array of objects that uniquely identify the rows. + */ + UnselectRowsByKey(keys: Object[]): void; + /** + * Deselects the specified row displayed within the grid. + * @param key An object that uniquely identifies the row. + */ + UnselectRowsByKey(key: Object): void; + /** + * Deselects all the selected rows within the grid. + */ + UnselectRows(): void; + /** + * Deselects the specified rows (if selected) within the grid. + * @param visibleIndices An array of zero-based indices that identify data rows within the grid. + */ + UnselectRows(visibleIndices: number[]): void; + /** + * Deselects the specified row (if selected) within the grid. + * @param visibleIndex A zero-based integer value that specifies the row's visible index. + */ + UnselectRows(visibleIndex: number): void; + /** + * Deselects all grid rows that match the filter criteria currently applied to the grid. + */ + UnselectFilteredRows(): void; + /** + * Selects the specified row displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the row's visible index. + */ + SelectRowOnPage(visibleIndex: number): void; + /** + * Selects or deselects the specified row displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the row's visible index. + * @param selected true to select the specified row; false to deselect the row. + */ + SelectRowOnPage(visibleIndex: number, selected?: boolean): void; + /** + * Deselects the specified row (if selected) displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the row's visible index. + */ + UnselectRowOnPage(visibleIndex: number): void; + /** + * Selects all unselected rows displayed on the current page. + */ + SelectAllRowsOnPage(): void; + /** + * Allows you to select or deselect all rows displayed on the current page based on the parameter passed. + * @param selected true to select all unselected rows displayed on the current page; false to deselect all selected rows on the page. + */ + SelectAllRowsOnPage(selected: boolean): void; + /** + * Deselects all selected rows displayed on the current page. + */ + UnselectAllRowsOnPage(): void; + /** + * Returns the number of selected rows. + */ + GetSelectedRowCount(): number; + /** + * Indicates whether or not the specified row is selected within the current page. + * @param visibleIndex An integer value that identifies the row by its visible index. + */ + IsRowSelectedOnPage(visibleIndex: number): boolean; + /** + * Indicates whether the specified row is a group row. + * @param visibleIndex An integer value that identifies the row by its visible index. + */ + IsGroupRow(visibleIndex: number): boolean; + /** + * Indicates whether the specified row is a data row. + * @param visibleIndex An integer value that identifies the row by its visible index. + */ + IsDataRow(visibleIndex: number): boolean; + /** + * Indicates whether the specified group row is expanded. + * @param visibleIndex An integer value that identifies the group row by its visible index. + */ + IsGroupRowExpanded(visibleIndex: number): boolean; + /** + * Returns the current vertical scroll position of the grid's content. + */ + GetVertScrollPos(): number; + /** + * Returns the current horizontal scroll position of the grid's content. + */ + GetHorzScrollPos(): number; + /** + * Returns the current horizontal scroll position of the grid's content. + */ + GetHorizontalScrollPosition(): number; + /** + * Specifies the vertical scroll position for the grid's content. + * @param position An integer value specifying the vertical scroll position. + */ + SetVertScrollPos(position: number): void; + /** + * Specifies the horizontal scroll position for the grid's content. + * @param position An integer value specifying the horizontal scroll position. + */ + SetHorzScrollPos(position: number): void; + /** + * Specifies the horizontal scroll position for the grid's content. + * @param position An integer value specifying the horizontal scroll position. + */ + SetHorizontalScrollPosition(position: number): void; + /** + * Sets the scrollability of various types of grid rows when the grid displays fixed columns. + * @param scrollableRowSettings An object specifying which types of grid rows should or should not be scrollable. + */ + SetFixedColumnScrollableRows(scrollableRowSettings: Object): void; + /** + * Applies a filter specified in the filter row to the GridView. + */ + ApplyOnClickRowFilter(): void; + /** + * Returns the editor used to edit the value in the auto filter row for the specified data column. + * @param column An ASPxClientGridViewColumn object that represents the data colum within the ASPxGridView. + */ + GetAutoFilterEditor(column: ASPxClientGridViewColumn): Object; + /** + * Returns the editor used to edit the value in the auto filter row for the specified data column. + * @param columnIndex An integer value that identifies the data column by its index. + */ + GetAutoFilterEditor(columnIndex: number): Object; + /** + * Returns the editor used to edit the value in the auto filter row for the specified data column. + * @param columnFieldNameOrId A string value that specifies the column's name or its data base field name. + */ + GetAutoFilterEditor(columnFieldNameOrId: string): Object; + /** + * Applies a filter to the specified data column. + * @param column An ASPxClientGridViewColumn object that represents the data column within the client GridView. + * @param val A string value that specifies the filter expression. + */ + AutoFilterByColumn(column: ASPxClientGridViewColumn, val: string): void; + /** + * Applies a filter to the specified data column. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param val A string value that specifies the filter expression. + */ + AutoFilterByColumn(columnIndex: number, val: string): void; + /** + * Applies a filter to the specified data column. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param val A string value that specifies the filter expression. + */ + AutoFilterByColumn(columnFieldNameOrId: string, val: string): void; + /** + * Applies the specified search panel filter criterion to grid data. + * @param value A string value that specifies the filter criterion. + */ + ApplySearchPanelFilter(value: string): void; + /** + * Applies the specified filter expression to the GridView. + * @param filterExpression A string value that specifies the filter expression. + */ + ApplyFilter(filterExpression: string): void; + /** + * Clears the filter expression applied to a client GridView. + */ + ClearFilter(): void; + /** + * Gets the Popup Edit Form. + */ + GetPopupEditForm(): ASPxClientPopupControl; + /** + * Sets input focus to the grid. + */ + Focus(): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing the specified argument to it. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; + /** + * Selects the specified page. + * @param pageIndex An integer value that specifies the active page's index. + */ + GotoPage(pageIndex: number): void; + /** + * Gets the index of the page currently being selected. + */ + GetPageIndex(): number; + /** + * Gets the number of pages to which the grid's data is divided. + */ + GetPageCount(): number; + /** + * Activates the next page. + */ + NextPage(): void; + /** + * Activates the previous page. + */ + PrevPage(): void; + /** + * Returns the index of the first data row displayed within the GridView's active page. + */ + GetTopVisibleIndex(): number; + /** + * Indicates whether the grid is in edit mode. + */ + IsEditing(): boolean; + /** + * Saves all the changes made and switches the grid to browse mode. + */ + UpdateEdit(): void; + /** + * Cancels all the changes made and switches the GridView to browse mode. + */ + CancelEdit(): void; + /** + * Updates data displayed within the grid. + */ + Refresh(): void; + /** + * Indicates whether the Customization Window is displayed. + */ + IsCustomizationWindowVisible(): boolean; + /** + * Invokes the Customization Window. + */ + ShowCustomizationWindow(): void; + /** + * Invokes the Customization Window and displays it over the specified HTML element. + * @param showAtElement An object that specifies the HTML element relative to whose position the customization window is invoked. + */ + ShowCustomizationWindow(showAtElement?: Object): void; + /** + * Closes the Customization Window. + */ + HideCustomizationWindow(): void; + /** + * Returns the number of columns within the client GridView. + */ + GetColumnsCount(): number; + /** + * Returns the number of columns within the client GridView. + */ + GetColumnCount(): number; + /** + * Returns the row values displayed within all selected rows. + * @param fieldNames The names of data source fields separated via a semicolon, whose values within the selected rows are returned. + * @param onCallback A ASPxClientGridViewValuesCallback object that represents the JavaScript function which receives the list of row values as a parameter. + */ + GetSelectedFieldValues(fieldNames: string, onCallback: ASPxClientGridViewValuesCallback): void; + /** + * Returns key values of selected rows displayed within the current page. + */ + GetSelectedKeysOnPage(): Object[]; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event. + * @param args A string value that is any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback A ASPxClientGridViewValuesCallback object that is the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(args: string, onCallback: ASPxClientGridViewValuesCallback): void; + /** + * Returns the values of the specified data source fields within the specified row. + * @param visibleIndex An integer value that identifies the data row. + * @param fieldNames The names of data source fields separated via a semicolon, whose values within the specified row are returned. + * @param onCallback An ASPxClientGridViewValuesCallback object that represents the JavaScript function which receives the list of row values as a parameter. + */ + GetRowValues(visibleIndex: number, fieldNames: string, onCallback: ASPxClientGridViewValuesCallback): void; + /** + * Returns the row values displayed within the current page. + * @param fieldNames The names of data source fields whose values are returned. + * @param onCallback A ASPxClientGridViewValuesCallback object that represents the JavaScript function which receives the list of row values as a parameter. + */ + GetPageRowValues(fieldNames: string, onCallback: ASPxClientGridViewValuesCallback): void; + /** + * Returns the number of rows actually displayed within the active page. + */ + GetVisibleRowsOnPage(): number; + /** + * Returns the client column that resides at the specified position within the column collection. + * @param columnIndex A zero-based index that identifies the column within the column collection (the column's Index property value). + */ + GetColumn(columnIndex: number): ASPxClientGridViewColumn; + /** + * Returns the column with the specified unique identifier. + * @param columnId A string value that specifies the column's unique identifier (the column's Name property value). + */ + GetColumnById(columnId: string): ASPxClientGridViewColumn; + /** + * Returns the client column which is bound to the specified data source field. + * @param columnFieldName A string value that specifies the name of the data source field to which the column is bound (the column's FieldName property value). + */ + GetColumnByField(columnFieldName: string): ASPxClientGridViewColumn; + /** + * Returns the editor used to edit the specified column's values. + * @param column An ASPxClientGridViewColumn object that specifies the required column within the client grid. + */ + GetEditor(column: ASPxClientGridViewColumn): ASPxClientEdit; + /** + * Returns the editor used to edit the specified column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + GetEditor(columnIndex: number): ASPxClientEdit; + /** + * Returns the editor used to edit the specified column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + GetEditor(columnFieldNameOrId: string): ASPxClientEdit; + /** + * Returns the value of the specified edit cell. + * @param column An ASPxClientGridViewColumn object that represents the data column within the client grid. + */ + GetEditValue(column: ASPxClientGridViewColumn): string; + /** + * Returns the value of the specified edit cell. + * @param columnIndex An integer value that identifies the data column within the grid's column collection. + */ + GetEditValue(columnIndex: number): string; + /** + * Returns the value of the specified edit cell. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + GetEditValue(columnFieldNameOrId: string): string; + /** + * Moves focus to the specified edit cell within the edited row. + * @param column An ASPxClientGridViewColumn object that represents the data column within the client grid. + */ + FocusEditor(column: ASPxClientGridViewColumn): void; + /** + * Moves focus to the specified edit cell within the edited row. + * @param columnIndex An integer value that specifies the column's position within the columns collection. + */ + FocusEditor(columnIndex: number): void; + /** + * Moves focus to the specified edit cell within the edited row. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + FocusEditor(columnFieldNameOrId: string): void; + /** + * Sets the value of the specified edit cell. + * @param column An ASPxClientGridViewColumn object that represents the data column within the client grid. + * @param value A string value that specifies the edit cell's new value. + */ + SetEditValue(column: ASPxClientGridViewColumn, value: string): void; + /** + * Sets the value of the specified edit cell. + * @param columnIndex An integer value that identifies the data column within the grid's column collection. + * @param value A string value that specifies the edit cell's new value. + */ + SetEditValue(columnIndex: number, value: string): void; + /** + * Sets the value of the specified edit cell. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param value A string value that specifies the edit cell's new value. + */ + SetEditValue(columnFieldNameOrId: string, value: string): void; + /** + * Displays the Filter Control. + */ + ShowFilterControl(): void; + /** + * Hides the Filter Control. + */ + CloseFilterControl(): void; + /** + * Enables or disables the current filter. + * @param isFilterEnabled true to enable the current filter; otherwise, false. + */ + SetFilterEnabled(isFilterEnabled: boolean): void; + /** + * Returns the current vertical scroll position of the grid's content. + */ + GetVerticalScrollPosition(): number; + /** + * Specifies the vertical scroll position for the grid's content. + * @param position An integer value specifying the vertical scroll position. + */ + SetVerticalScrollPosition(position: number): void; + /** + * Gets information about a focused cell. + */ + GetFocusedCell(): ASPxClientGridViewCellInfo; + /** + * Focuses the specified cell. + * @param rowVisibleIndex An integer value that specifies the visible index of the row. + * @param columnIndex A zero-based index that identifies the column in the column collection (the column's Index property value). + */ + SetFocusedCell(rowVisibleIndex: number, columnIndex: number): void; + /** + * Invokes the Customization Dialog and displays it over the grid. + */ + ShowCustomizationDialog(): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientGridViewColumn object that represents the data column. + */ + SortBy(column: ASPxClientGridViewColumn): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + SortBy(columnIndex: number): void; + /** + * Sorts data by the specified data column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + SortBy(columnFieldNameOrId: string): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientGridViewColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(column: ASPxClientGridViewColumn, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(columnIndex: number, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(columnFieldNameOrId: string, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientGridViewColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(column: ASPxClientGridViewColumn, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(columnIndex: number, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(columnFieldNameOrId: string, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values, and places the column to the specified position among the sorted columns. + * @param column An ASPxClientGridViewColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex An integer value that specifies the zero-based column's index among the sorted columns. -1 if data is not sorted by this column. + */ + SortBy(column: ASPxClientGridViewColumn, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Sorts data by the specified data column's values, and places the column to the specified position among the sorted columns. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex An integer value that specifies the zero-based column's index among the sorted columns. -1 if data is not sorted by this column. + */ + SortBy(columnIndex: number, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Sorts data by the specified data column's values, and places the column to the specified position among the sorted columns. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex An integer value that specifies the zero-based column's index among the sorted columns. -1 if data is not sorted by this column. + */ + SortBy(columnFieldNameOrId: string, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Hides the specified column. + * @param column An ASPxClientGridViewColumn object that represents the column to hide. + */ + MoveColumn(column: ASPxClientGridViewColumn): void; + /** + * Hides the specified column. + * @param columnIndex An integer value that specifies the absolute index of the column to hide. + */ + MoveColumn(columnIndex: number): void; + /** + * Hides the specified column. + * @param columnFieldNameOrId A String value that identifies the column to be hidden by the name of the data source field to which the column is bound, or by the column's name. + */ + MoveColumn(columnFieldNameOrId: string): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param column An ASPxClientGridViewColumn object that represents the column to move. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the grid. + */ + MoveColumn(column: ASPxClientGridViewColumn, moveToColumnVisibleIndex: number): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the grid. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param columnFieldNameOrId A String value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the grid. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param column An ASPxClientGridViewColumn object that represents the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + */ + MoveColumn(column: ASPxClientGridViewColumn, moveToColumnVisibleIndex: number, moveBefore: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number, moveBefore: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param columnFieldNameOrId A string value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number, moveBefore: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups the grid's data by this column. + * @param column An ASPxClientGridViewColumn object that represents the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + * @param moveToGroup true to group the grid's data by the column; otherwise, false. + */ + MoveColumn(column: ASPxClientGridViewColumn, moveToColumnVisibleIndex: number, moveBefore: boolean, moveToGroup: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups the grid's data by this column. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + * @param moveToGroup true to group the ASPxGridView's data by the column; otherwise, false. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number, moveBefore: boolean, moveToGroup: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups the grid's data by this column. + * @param columnFieldNameOrId A string value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + * @param moveToGroup true to group the grid's data by the column; otherwise, false. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number, moveBefore: boolean, moveToGroup: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups or ungroups the grid's data by this column. + * @param column An ASPxClientGridViewColumn object that represents the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + * @param moveToGroup true to group the grid's data by the column; otherwise, false. + * @param moveFromGroup true to ungroup the grid's data by the column; otherwise, false. + */ + MoveColumn(column: ASPxClientGridViewColumn, moveToColumnVisibleIndex: number, moveBefore: boolean, moveToGroup: boolean, moveFromGroup: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups or ungroups the grid's data by this column. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + * @param moveToGroup true to group the grid's data by the column; otherwise, false. + * @param moveFromGroup true to ungroup the grid's data by the column; otherwise, false. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number, moveBefore: boolean, moveToGroup: boolean, moveFromGroup: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups or ungroups the grid's data by this column. + * @param columnFieldNameOrId A string value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param moveBefore true to move the column before the target column; otherwise, false. + * @param moveToGroup true to group the grid's data by the column; otherwise, false. + * @param moveFromGroup true to ungroup the grid's data by the column; otherwise, false. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number, moveBefore: boolean, moveToGroup: boolean, moveFromGroup: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the grid. + * @param targetPosition An ASPxClientGridColumnMovingTargetPosition enumeration value specifying the position relative to the target column in which to place the moved column. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number, targetPosition: ASPxClientGridColumnMovingTargetPosition): void; + /** + * Moves the specified column to the specified visual position within the grid. + * @param columnFieldNameOrId A String value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that specifies the column's position among the visible columns within the grid. + * @param targetPosition An ASPxClientGridColumnMovingTargetPosition enumeration value specifying the position relative to the target column in which to place the moved column. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number, targetPosition: ASPxClientGridColumnMovingTargetPosition): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups or ungroups the grid's data by this column. + * @param columnIndex An integer value that specifies the absolute index of the column to move. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param targetPosition An ASPxClientGridColumnMovingTargetPosition enumeration value specifying the position relative to the target column in which to place the moved column. + * @param moveToGroup true, to group the ASPxGridView's data by the column; otherwise, false. + * @param moveFromGroup true, to ungroup the grid's data by the column; otherwise, false. + */ + MoveColumn(columnIndex: number, moveToColumnVisibleIndex: number, targetPosition: ASPxClientGridColumnMovingTargetPosition, moveToGroup: boolean, moveFromGroup: boolean): void; + /** + * Moves the specified column to the specified visual position within the grid and optionally groups or ungroups the grid's data by this column. + * @param columnFieldNameOrId A string value that identifies the column to be moved by the name of the data source field to which the column is bound or by the column's name. + * @param moveToColumnVisibleIndex An integer value that identifies the target column displayed within the grid. + * @param targetPosition An ASPxClientGridColumnMovingTargetPosition enumeration value specifying the position relative to the target column in which to place the moved column. + * @param moveToGroup true, to group the grid's data by the column; otherwise, false. + * @param moveFromGroup true, to ungroup the grid's data by the column; otherwise, false. + */ + MoveColumn(columnFieldNameOrId: string, moveToColumnVisibleIndex: number, targetPosition: ASPxClientGridColumnMovingTargetPosition, moveToGroup: boolean, moveFromGroup: boolean): void; + /** + * Groups data by the values of the specified column. + * @param column An ASPxClientGridViewColumn object that represents the data column by whose values data is grouped. + */ + GroupBy(column: ASPxClientGridViewColumn): void; + /** + * Groups data by the values of the specified column. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + GroupBy(columnIndex: number): void; + /** + * Groups data by the values of the specified column. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + GroupBy(columnFieldNameOrId: string): void; + /** + * Groups data by the values of the specified data column. If several columns are involved in grouping, the specified column will reside at the specified grouping level. + * @param column An ASPxClientGridViewColumn object that represents the data column by whose values data is grouped. + * @param groupIndex An integer value that specifies the grouping level. -1 to cancel grouping by the column's values. + */ + GroupBy(column: ASPxClientGridViewColumn, groupIndex: number): void; + /** + * Groups data by the values of the specified data column. If several columns are involved in grouping, the specified column will reside at the specified grouping level. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param groupIndex An integer value that specifies the grouping level. -1 to cancel grouping by the column's values. + */ + GroupBy(columnIndex: number, groupIndex: number): void; + /** + * Groups data by the values of the specified data column. If several columns are involved in grouping, the specified column will reside at the specified grouping level. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param groupIndex An integer value that specifies the grouping level. -1 to cancel grouping by the column's values. + */ + GroupBy(columnFieldNameOrId: string, groupIndex: number): void; + /** + * Groups data by the values of the specified data column with the specified sort order. If several columns are involved in grouping, the specified column will reside at the specified grouping level. + * @param column An ASPxClientGridViewColumn object that represents the data column by whose values data is grouped. + * @param groupIndex An integer value that specifies the grouping level. -1 to cancel grouping by the column's values. + * @param sortOrder A string value that specifies the column's sort order. + */ + GroupBy(column: ASPxClientGridViewColumn, groupIndex: number, sortOrder: string): void; + /** + * Groups data by the values of the specified data column with the specified sort order. If several columns are involved in grouping, the specified column will reside at the specified grouping level. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param groupIndex An integer value that specifies the grouping level. -1 to cancel grouping by the column's values. + * @param sortOrder A string value that specifies the column's sort order. + */ + GroupBy(columnIndex: number, groupIndex: number, sortOrder: string): void; + /** + * Groups data by the values of the specified data column with the specified sort order. If several columns are involved in grouping, the specified column will reside at the specified grouping level. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param groupIndex An integer value that specifies the grouping level. -1 to cancel grouping by the column's values. + * @param sortOrder A string value that specifies the column's sort order. + */ + GroupBy(columnFieldNameOrId: string, groupIndex: number, sortOrder: string): void; + /** + * Ungroups data by the values of the specified column. + * @param column An ASPxClientGridViewColumn object that represents the data column within the ASPxGridView. + */ + UnGroup(column: ASPxClientGridViewColumn): void; + /** + * Ungroups data by the values of the specified column. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + UnGroup(columnIndex: number): void; + /** + * Ungroups data by the values of the specified column. + * @param columnFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + */ + UnGroup(columnFieldNameOrId: string): void; + /** + * Ungroups data by the values of a specified column. + * @param column A ASPxClientGridViewColumn object that is the grid column. + */ + Ungroup(column: ASPxClientGridViewColumn): void; + /** + * Ungroups data by the values of a specified column. + * @param columnIndex An integer value that is the column index. + */ + Ungroup(columnIndex: number): void; + /** + * Ungroups data by the values of a specified column. + * @param columnFieldNameOrId A string value that is the column's FieldName or ID. + */ + Ungroup(columnFieldNameOrId: string): void; + /** + * Expands all group rows. + */ + ExpandAll(): void; + /** + * Collapses all group rows. + */ + CollapseAll(): void; + /** + * Expands all detail rows. + */ + ExpandAllDetailRows(): void; + /** + * Collapses all detail rows. + */ + CollapseAllDetailRows(): void; + /** + * Expands the specified group row preserving the collapsed state of any child group row. + * @param visibleIndex An integer value that identifies the group row. + */ + ExpandRow(visibleIndex: number): void; + /** + * Expands the specified group row and optionally child group rows at all nesting levels. + * @param visibleIndex An integer value that identifies the group row. + * @param recursive true to expand any child group rows at all nesting levels; false to preserve the collapsed state of any child group rows. + */ + ExpandRow(visibleIndex: number, recursive?: boolean): void; + /** + * Collapses the specified group row preserving the expanded state of child group rows. + * @param visibleIndex An integer value that identifies the group row by its visible index. + */ + CollapseRow(visibleIndex: number): void; + /** + * Collapses the specified group row and optionally child group rows at all nesting levels. + * @param visibleIndex An integer value that identifies the group row by its visible index. + * @param recursive true to collapse child group rows at all nesting levels; false to preserve the expanded state of any child group row. + */ + CollapseRow(visibleIndex: number, recursive?: boolean): void; + /** + * Scrolls the view to the specified row. + * @param visibleIndex An integer value that identifies a row by its visible index. + */ + MakeRowVisible(visibleIndex: number): void; + /** + * Expands the specified detail row. + * @param visibleIndex A zero-based integer index that identifies the detail row. + */ + ExpandDetailRow(visibleIndex: number): void; + /** + * Collapses the specified detail row. + * @param visibleIndex A zero-based integer index that identifies the detail row. + */ + CollapseDetailRow(visibleIndex: number): void; + /** + * Returns the key value of the specified data row. + * @param visibleIndex An integer value that specifies the row's visible index. + */ + GetRowKey(visibleIndex: number): string; + /** + * Switches the grid to edit mode. + * @param visibleIndex A zero-based integer that identifies a data row to be edited. + */ + StartEditRow(visibleIndex: number): void; + /** + * Switches the grid to edit mode. + * @param key An object that uniquely identifies a data row to be edited. + */ + StartEditRowByKey(key: Object): void; + /** + * Indicates whether or not a new row is being edited. + */ + IsNewRowEditing(): boolean; + /** + * Adds a new record. + */ + AddNewRow(): void; + /** + * Deletes the specified row. + * @param visibleIndex An integer value that identifies the row. + */ + DeleteRow(visibleIndex: number): void; + /** + * Deletes a row with the specified key value. + * @param key An object that uniquely identifies the row. + */ + DeleteRowByKey(key: Object): void; + /** + * Returns the focused row's index. + */ + GetFocusedRowIndex(): number; + /** + * Moves focus to the specified row. + * @param visibleIndex An integer value that specifies the focused row's index. + */ + SetFocusedRowIndex(visibleIndex: number): void; + /** + * Selects all the unselected rows within the grid. + */ + SelectRows(): void; + /** + * Selects the specified row displayed within the grid. + * @param visibleIndex A zero-based integer value that specifies the row's visible index. + */ + SelectRows(visibleIndex: number): void; + /** + * Selects the specified rows within the grid. + * @param visibleIndices An array of zero-based indices that identify data rows within the grid. + */ + SelectRows(visibleIndices: number[]): void; + /** + * Selects or deselects the specified rows within the grid. + * @param visibleIndices An array of zero-based indices that identify data rows within the grid. + * @param selected true to select the specified rows; false to deselect the rows. + */ + SelectRows(visibleIndices: number[], selected: boolean): void; + /** + * Selects or deselects the specified row within the grid. + * @param visibleIndex An integer zero-based index that identifies the data row within the grid. + * @param selected true to select the specified row; false to deselect the row. + */ + SelectRows(visibleIndex: number, selected?: boolean): void; + /** + * Selects or deselects the specified rows displayed within the grid. + * @param keys An array of objects that uniquely identify the rows. + * @param selected true to select the specified rows; false to deselect the rows. + */ + SelectRowsByKey(keys: Object[], selected?: boolean): void; +} +/** + * A client grid column. + */ +interface ASPxClientGridViewColumn extends ASPxClientGridColumnBase { + /** + * Gets the column's unique identifier. + * Value: A string value that specifies the column's unique identifier. + */ + id: string; + /** + * Gets the name that uniquely identifies the column. + * Value: A string value assigned to the column's Name property. + */ + name: string; + /** + * Gets the column's position within the collection. + * Value: An integer zero-bazed index that specifies the column's position within the collection. + */ + index: number; + /** + * Gets the name of the database field assigned to the current column. + * Value: A string value that specifies the name of a data field. + */ + fieldName: string; + /** + * Gets whether the column is visible. + * Value: true to display the column; otherwise, false. + */ + visible: boolean; +} +/** + * Represents a JavaScript function which receives the list of row values when the client GetSelectedFieldValues method is called. + */ +interface ASPxClientGridViewValuesCallback { + /** + * Represents a JavaScript function which receives the list of row values when the client GetSelectedFieldValues method is called. + * @param result An object that represents the list of row values received from the server. + */ + (result: Object): void; +} +/** + * A method that will handle the cancelable events of a client ASPxGridView column. + */ +interface ASPxClientGridViewColumnCancelEventHandler { + /** + * A method that will handle the cancelable events of a client ASPxGridView column. + * @param source The event source. + * @param e An ASPxClientGridViewColumnCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewColumnCancelEventArgs): void; +} +/** + * Provides data for the cancelable events of a client ASPxGridView column. + */ +interface ASPxClientGridViewColumnCancelEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed client column. + * Value: An ASPxClientGridViewColumn object that represents the processed column. + */ + column: ASPxClientGridViewColumn; +} +/** + * A method that will handle the client events concerned with column processing. + */ +interface ASPxClientGridViewColumnProcessingModeEventHandler { + /** + * A method that will handle the client events concerned with column processing. + * @param source The event source. + * @param e A ASPxClientGridViewColumnProcessingModeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewColumnProcessingModeEventArgs): void; +} +/** + * Provides data for the client events concerned with column processing, and that allow the event's processing to be passed to the server side. + */ +interface ASPxClientGridViewColumnProcessingModeEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets a grid column related to the event. + * Value: An ASPxClientGridViewColumn object representing the column related to the event. + */ + column: ASPxClientGridViewColumn; +} +/** + * A method that will handle the RowExpanding events. + */ +interface ASPxClientGridViewRowCancelEventHandler { + /** + * A method that will handle the RowExpanding events. + * @param source The event source. + * @param e An ASPxClientGridViewRowCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewRowCancelEventArgs): void; +} +/** + * Provides data for the RowExpanding events. + */ +interface ASPxClientGridViewRowCancelEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed row's visible index. + * Value: An integer zero-based index that identifies the processed row. + */ + visibleIndex: number; +} +/** + * A method that will handle the SelectionChanged event. + */ +interface ASPxClientGridViewSelectionEventHandler { + /** + * A method that will handle the SelectionChanged event. + * @param source The event source. + * @param e An ASPxClientGridViewSelectionEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewSelectionEventArgs): void; +} +/** + * Provides data for the SelectionChanged event. + */ +interface ASPxClientGridViewSelectionEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the visible index of the row whose selected state has been changed. + * Value: An value that specifies the visible index of the row. + */ + visibleIndex: number; + /** + * Gets whether the row has been selected. + * Value: true if the row has been selected; otherwise, false. + */ + isSelected: boolean; + /** + * Gets whether all rows displayed within a page have been selected or unselected. + * Value: true if all rows displayed within a page have been selected or unselected; otherwise, false. + */ + isAllRecordsOnPage: boolean; + /** + * Gets whether a selection has been changed on the server. + * Value: true if a selection has been changed on the server; otherwise, false. + */ + isChangedOnServer: boolean; +} +/** + * A method that will handle the RowClick events. + */ +interface ASPxClientGridViewRowClickEventHandler { + /** + * A method that will handle the RowClick event. + * @param source The event source. This parameter identifies the ASPxClientGridView object that raised the event. + * @param e An ASPxClientGridViewRowClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewRowClickEventArgs): void; +} +/** + * Provides data for the RowClick event. + */ +interface ASPxClientGridViewRowClickEventArgs extends ASPxClientGridViewRowCancelEventArgs { + /** + * Provides access to the parameters associated with the RowClick event. + * Value: An object that contains parameters associated with the event. + */ + htmlEvent: Object; +} +/** + * A method that will handle the ContextMenu event. + */ +interface ASPxClientGridViewContextMenuEventHandler { + /** + * A method that will handle the ContextMenu event. + * @param source The event source. + * @param e An ASPxClientGridViewContextMenuEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewContextMenuEventArgs): void; +} +/** + * Provides data for the ContextMenu event. + */ +interface ASPxClientGridViewContextMenuEventArgs extends ASPxClientEventArgs { + /** + * Gets which grid element has been right clicked by the user. + * Value: A String value that specifies grid element. + */ + objectType: string; + /** + * Identifies the grid element being right clicked by the user. + * Value: A zero-based integer index that identifies the grid element being clicked by the user. + */ + index: number; + /** + * Provides access to the parameters associated with the ContextMenu event. + * Value: An object that contains parameters associated with the event. + */ + htmlEvent: Object; + /** + * Gets the currently processed menu object. + * Value: An object that is the currently processed menu. + */ + menu: Object; + /** + * Specifies whether a browser context menu should be displayed. + * Value: true, to display a browser context menu; otherwise, false. The default is false. + */ + showBrowserMenu: boolean; +} +/** + * A method that will handle the client ContextMenuItemClick event. + */ +interface ASPxClientGridViewContextMenuItemClickEventHandler { + /** + * A method that will handle the ContextMenuItemClick event. + * @param source The event source. + * @param e An ASPxClientGridViewContextMenuItemClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewContextMenuItemClickEventArgs): void; +} +/** + * Provides data for the ContextMenuItemClick event. + */ +interface ASPxClientGridViewContextMenuItemClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the clicked context menu item. + * Value: An object, manipulations on which forced the event to be raised. + */ + item: ASPxClientMenuItem; + /** + * Gets which grid element has been right clicked by the user. + * Value: A String value that specifies the grid element. + */ + objectType: string; + /** + * Returns the processed element index. + * Value: An integer value that specifies the processed element index. + */ + elementIndex: number; + /** + * Specifies whether a postback or a callback is used to finally process the event on the server side. + * Value: true to perform the round trip to the server side via postback; false to perform the round trip to the server side via callback. + */ + usePostBack: boolean; + /** + * Specifies whether default context menu item click is handled manually, so no default processing is required. + * Value: true if no default processing is required; otherwise false. + */ + handled: boolean; +} +/** + * A method that will handle the CustomButtonClick event. + */ +interface ASPxClientGridViewCustomButtonEventHandler { + /** + * A method that will handle the CustomButtonClick event. + * @param source The event source. This parameter identifies the ASPxClientGridView object that raised the event. + * @param e An ASPxClientGridViewCustomButtonEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewCustomButtonEventArgs): void; +} +/** + * Provides data for the CustomButtonClick event. + */ +interface ASPxClientGridViewCustomButtonEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the value which identifies the row whose custom button has been clicked. + * Value: An integer value that identifies the row whose custom button has been clicked. + */ + visibleIndex: number; + /** + * Gets the value which identifies the custom button. + * Value: A string value that identifies the clicked custom button. + */ + buttonID: string; +} +/** + * A method that will handle the ColumnMoving event. + */ +interface ASPxClientGridViewColumnMovingEventHandler { + /** + * A method that will handle the ColumnMoving event. + * @param source The event source. + * @param e An ASPxClientGridViewColumnMovingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewColumnMovingEventArgs): void; +} +/** + * Provides data for the ColumnMoving event. + */ +interface ASPxClientGridViewColumnMovingEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets whether a column is allowed to be moved. + * Value: true to allow column moving; otherwise, false. + */ + allow: boolean; + /** + * Gets the column currently being dragged by an end-user. + * Value: An ASPxClientGridViewColumn object that represents the column currently being dragged by an end-user. + */ + sourceColumn: ASPxClientGridViewColumn; + /** + * Gets the target column, before or after which the source column will be inserted (if dropped). + * Value: An ASPxClientGridViewColumn object that represents the target column. null (Nothing in Visual Basic) if the source column isn't over the column header panel. + */ + destinationColumn: ASPxClientGridViewColumn; + /** + * Gets whether the source column will be inserted before the target column (if dropped). + * Value: true if the source column will be inserted before the target column (if dropped); otherwise, false. + */ + isDropBefore: boolean; + /** + * Gets whether the source column is currently over the Group Panel. + * Value: true if the source column is currently over the Group Panel; otherwise, false. + */ + isGroupPanel: boolean; +} +/** + * Represents an object that will handle the client-side BatchEditConfirmShowing event. + */ +interface ASPxClientGridViewBatchEditConfirmShowingEventHandler { + /** + * A method that will handle the BatchEditConfirmShowing client event. + * @param source The event source. + * @param e An ASPxClientGridViewBatchEditConfirmShowingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditConfirmShowingEventArgs): void; +} +/** + * Provides data for the BatchEditConfirmShowing event. + */ +interface ASPxClientGridViewBatchEditConfirmShowingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the client identifier of an object that initiates a send request. + * Value: A string value that specifies the object client identifier. + */ + requestTriggerID: string; +} +/** + * A method that will handle the client BatchEditStartEditing event. + */ +interface ASPxClientGridViewBatchEditStartEditingEventHandler { + /** + * A method that will handle the BatchEditStartEditing event. + * @param source The event source. + * @param e An ASPxClientGridViewBatchEditStartEditingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditStartEditingEventArgs): void; +} +/** + * Provides data for the BatchEditStartEditing event. + */ +interface ASPxClientGridViewBatchEditStartEditingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the visible index of the row whose cells are about to be edited. + * Value: An value that specifies the visible index of the row. + */ + visibleIndex: number; + /** + * Gets the grid column that owns a cell that is about to be edited. + * Value: An object that is the focused grid column. + */ + focusedColumn: ASPxClientGridViewColumn; + /** + * Gets a hashtable that maintains information about editable cells. + * Value: A hashtable that stores information about editable cells. + */ + rowValues: Object; +} +/** + * A method that will handle the client BatchEditEndEditing event. + */ +interface ASPxClientGridViewBatchEditEndEditingEventHandler { + /** + * A method that will handle the BatchEditEndEditing event. + * @param source The event source. + * @param e An ASPxClientGridViewBatchEditEndEditingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditEndEditingEventArgs): void; +} +/** + * Provides data for the BatchEditEndEditing event. + */ +interface ASPxClientGridViewBatchEditEndEditingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the visible index of the row whose cells has been edited. + * Value: An value that specifies the visible index of the row. + */ + visibleIndex: number; + /** + * Gets a hashtable that maintains information about editable cells. + * Value: A hashtable that stores information about editable cells. + */ + rowValues: Object; +} +/** + * A method that will handle the client BatchEditRowValidating event. + */ +interface ASPxClientGridViewBatchEditRowValidatingEventHandler { + /** + * A method that will handle the BatchEditRowValidating event. + * @param source The event source. + * @param e An ASPxClientGridViewBatchEditRowValidatingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditRowValidatingEventArgs): void; +} +/** + * Provides data for the BatchEditRowValidating event. + */ +interface ASPxClientGridViewBatchEditRowValidatingEventArgs extends ASPxClientEventArgs { + /** + * Gets the processed row's visible index. + * Value: An integer value that specifies the processed row's visible index. + */ + visibleIndex: number; + /** + * Provides validation information of a row currently being validated. + * Value: An object that is a hashtable containing validation information. + */ + validationInfo: Object; +} +/** + * A method that will handle the client BatchEditTemplateCellFocused event. + */ +interface ASPxClientGridViewBatchEditTemplateCellFocusedEventHandler { + /** + * A method that will handle the BatchEditTemplateCellFocused event. + * @param source An object representing the event source. Identifies the button editor that raised the event. + * @param e An ASPxClientGridViewBatchEditTemplateCellFocusedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditTemplateCellFocusedEventArgs): void; +} +/** + * Provides data for the BatchEditTemplateCellFocused event. + */ +interface ASPxClientGridViewBatchEditTemplateCellFocusedEventArgs extends ASPxClientEventArgs { + /** + * Gets the currently processed column. + * Value: A object that is the client-side column object. + */ + column: ASPxClientGridViewColumn; + /** + * Gets or sets a value specifying whether the event was handled. + * Value: true if the event was handled and default processing should not occur; false if the event should be handled using default processing. + */ + handled: boolean; +} +/** + * A method that will handle the BatchEditChangesSaving event. + */ +interface ASPxClientGridViewBatchEditChangesSavingEventHandler { + /** + * A method that will handle the BatchEditChangesSaving event. + * @param source The event source. This parameter identifies the grid view object which raised the event. + * @param e An ASPxClientGridViewBatchEditChangesSavingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditChangesSavingEventArgs): void; +} +/** + * Provides data for the BatchEditChangesSaving event. + */ +interface ASPxClientGridViewBatchEditChangesSavingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets a hashtable that maintains information about inserted cells. + * Value: A hashtable that stores information about inserted cells. + */ + insertedValues: Object; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + deletedValues: Object; + /** + * Gets a hashtable that maintains information about updated cells. + * Value: A hashtable that stores information about updated cells. + */ + updatedValues: Object; +} +/** + * A method that will handle the BatchEditChangesCanceling event. + */ +interface ASPxClientGridViewBatchEditChangesCancelingEventHandler { + /** + * A method that will handle the BatchEditChangesCanceling event. + * @param source The event source. This parameter identifies the grid view object which raised the event. + * @param e An ASPxClientGridViewBatchEditChangesCancelingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditChangesCancelingEventArgs): void; +} +/** + * Provides data for the BatchEditChangesCanceling event. + */ +interface ASPxClientGridViewBatchEditChangesCancelingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets a hashtable that maintains information about inserted cells. + * Value: A hashtable that stores information about inserted cells. + */ + insertedValues: Object; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + deletedValues: Object; + /** + * Gets a hashtable that maintains information about updated cells. + * Value: A hashtable that stores information about updated cells. + */ + updatedValues: Object; +} +/** + * A method that will handle the BatchEditRowInserting event. + */ +interface ASPxClientGridViewBatchEditRowInsertingEventHandler { + /** + * A method that will handle the BatchEditRowInserting event. + * @param source The event source. This parameter identifies the card view object which raised the event. + * @param e An ASPxClientGridViewBatchEditRowInsertingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditRowInsertingEventArgs): void; +} +/** + * Provides data for the BatchEditRowInserting event. + */ +interface ASPxClientGridViewBatchEditRowInsertingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed row's visible index. + * Value: An integer value that specifies the processed row's visible index. + */ + visibleIndex: number; +} +/** + * A method that will handle the BatchEditRowDeleting event. + */ +interface ASPxClientGridViewBatchEditRowDeletingEventHandler { + /** + * A method that will handle the BatchEditRowDeleting event. + * @param source The event source. This parameter identifies the grid view object which raised the event. + * @param e An ASPxClientGridViewBatchEditRowDeletingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewBatchEditRowDeletingEventArgs): void; +} +/** + * Provides data for the BatchEditRowDeleting event. + */ +interface ASPxClientGridViewBatchEditRowDeletingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed row's visible index. + * Value: An integer value that specifies the processed row's visible index. + */ + visibleIndex: number; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + rowValues: Object; +} +/** + * A method that will handle the FocusedCellChanging event. + */ +interface ASPxClientGridViewFocusedCellChangingEventHandler { + /** + * A method that will handle the FocusedCellChanging event. + * @param source The event source. + * @param e An ASPxClientGridViewFocusedCellChangingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGridViewFocusedCellChangingEventArgs): void; +} +/** + * Provides data for the FocusedCellChanging event. + */ +interface ASPxClientGridViewFocusedCellChangingEventArgs extends ASPxClientCancelEventArgs { + /** + * Provides information on a cell currently being focused. + * Value: A ASPxClientGridViewCellInfo object that is the cell information. + */ + cellInfo: ASPxClientGridViewCellInfo; +} +/** + * Contains information on a grid cell. + */ +interface ASPxClientGridViewCellInfo { + /** + * Gets the visible index of the row that contains the cell currently being processed. + * Value: An value that specifies the visible index of the row. + */ + rowVisibleIndex: number; + /** + * Gets the data column that contains the cell currently being processed. + * Value: An object that is the data column which contains the processed cell. + */ + column: ASPxClientGridViewColumn; +} +/** + * Provides members related to Batch Edit Mode + */ +interface ASPxClientGridViewBatchEditApi { + /** + * Performs validation of grid data contained in all rows when the grid operates in Batch Edit mode. + * @param validateOnlyModified true, if only modified rows should be validated; otherwise, false. + */ + ValidateRows(validateOnlyModified?: boolean): boolean; + /** + * Performs validation of grid data contained in the specified row when the grid operates in Batch Edit mode. + * @param visibleIndex An integer value specifying the visible index of the validated row. + */ + ValidateRow(visibleIndex: number): boolean; + /** + * Returns an array of row visible indices. + * @param includeDeleted true, to include visible indices of deleted rows to the returned array; otherwise, false. + */ + GetRowVisibleIndices(includeDeleted: boolean): number[]; + /** + * Returns an array of the deleted row visible indices. + */ + GetDeletedRowIndices(): number[]; + /** + * Returns an array of the inserted row visible indices. + */ + GetInsertedRowIndices(): number[]; + /** + * Indicates if the row with specified visible index is deleted. + * @param visibleIndex An integer value that identifies the row by its visible index. + */ + IsDeletedRow(visibleIndex: number): boolean; + /** + * Indicates if the row with specified visible index is newly created. + * @param visibleIndex An integer value that identifies the row by its visible index. + */ + IsNewRow(visibleIndex: number): boolean; + /** + * Programmatically moves the focus to the previous cell in the row. + */ + MoveFocusBackward(): boolean; + /** + * Programmatically moves the focus to the next cell in the row. + */ + MoveFocusForward(): boolean; + /** + * Sets a value of the specified cell. + * @param visibleIndex An integer zero-based index that identifies the row containing the processed cell. + * @param columnFieldNameOrId A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + * @param value An object that contains the new cell value. + */ + SetCellValue(visibleIndex: number, columnFieldNameOrId: string, value: Object): void; + /** + * Sets the value of the specified cell. + * @param visibleIndex An integer zero-based index that identifies the row containing the processed cell. + * @param columnFieldNameOrId A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + * @param value An object that contains the new cell value. + * @param displayText A string value that specifies the cell display text. + * @param cancelCellHighlighting true to cancel highlighting of the modified cell, false to highlight the modified cell. + */ + SetCellValue(visibleIndex: number, columnFieldNameOrId: string, value: Object, displayText: string, cancelCellHighlighting?: boolean): void; + /** + * Gets the value of the specified cell. + * @param visibleIndex A zero-based integer value that specifies a visible index of a row containing the processed cell. + * @param columnFieldNameOrId A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + * @param initial true, to return the initial (server) value; false, to return a value currently contained on the client side (modified value). + */ + GetCellValue(visibleIndex: number, columnFieldNameOrId: string, initial?: boolean): Object; + /** + * Gets a container holding a data cell content. + * @param visibleIndex An integer value that is the visible index. + * @param columnFieldNameOrId A string value that is the column's Field Name or ID. + */ + GetCellTextContainer(visibleIndex: number, columnFieldNameOrId: string): Object; + /** + * Gets information about the cell currently being edited. + */ + GetEditCellInfo(): ASPxClientGridViewCellInfo; + /** + * Returns a value that indicates whether the grid has changed data. + */ + HasChanges(): boolean; + /** + * Returns a value that indicates whether the specified row has changed data. + * @param visibleIndex An integer value that specifies the visible index of a row. + */ + HasChanges(visibleIndex: number): boolean; + /** + * Returns a value that indicates whether the specified data cell's data has been changed. + * @param visibleIndex An integer value that specifies the visible index of a row. + * @param columnFieldNameOrId A string value that identifies the column by the name of the data source field to which the column is bound, or by the column's name. + */ + HasChanges(visibleIndex: number, columnFieldNameOrId: string): boolean; + /** + * Resets changes in the specified row. + * @param visibleIndex An integer value that specifies the visible index of a row. + */ + ResetChanges(visibleIndex: number): void; + /** + * Resets changes in the specified cell. + * @param visibleIndex An integer value that specifies the visible index of a row containing the processed cell. + * @param columnIndex A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + */ + ResetChanges(visibleIndex: number, columnIndex: number): void; + /** + * Switches the specified cell to edit mode. + * @param visibleIndex A zero-based integer value that specifies the visible index of a row containing the processed cell. + * @param columnIndex A zero-based integer value that identifies the column which contains the processed cell in the column collection. + */ + StartEdit(visibleIndex: number, columnIndex: number): void; + /** + * Ends cell or row editing. + */ + EndEdit(): void; +} +/** + * A client-side equivalent of the ASPxVerticalGrid object. + */ +interface ASPxClientVerticalGrid extends ASPxClientGridBase { + /** + * Provides access to the batch editing client API. + * Value: A object that exposes the batch editing client API methods. + */ + batchEditApi: ASPxClientVerticalGridBatchEditApi; + /** + * Occurs when a custom command button has been clicked. + */ + CustomButtonClick: ASPxClientEvent>; + /** + * Fires after the selection has been changed. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Occurs when a grid switches to batch edit mode. + */ + BatchEditStartEditing: ASPxClientEvent>; + /** + * Occurs when a grid leaves the batch edit mode. + */ + BatchEditEndEditing: ASPxClientEvent>; + /** + * Enables you to prevent a batch edit confirmation message from being displayed. + */ + BatchEditConfirmShowing: ASPxClientEvent>; + /** + * Enables you to provide navigation for editors contained in a templated cell in Batch Edit mode. + */ + BatchEditTemplateCellFocused: ASPxClientEvent>; + /** + * Occurs on the client side before data changes are saved in batch edit mode. + */ + BatchEditChangesSaving: ASPxClientEvent>; + /** + * Occurs on the client side before data changes are canceled in batch edit mode. + */ + BatchEditChangesCanceling: ASPxClientEvent>; + /** + * Occurs on the client side before a record is inserted in batch edit mode. + */ + BatchEditRecordInserting: ASPxClientEvent>; + /** + * Occurs on the client side before a record is deleted in batch edit mode. + */ + BatchEditRecordDeleting: ASPxClientEvent>; + /** + * Enables you to specify whether record data is valid and provide an error text. + */ + BatchEditRecordValidating: ASPxClientEvent>; + /** + * Occurs on the client side when the focused cell is about to be changed. + */ + FocusedCellChanging: ASPxClientEvent>; + /** + * Enables you to prevent rows from being sorted. + */ + RowSorting: ASPxClientEvent>; + /** + * Fires on the client side before the expansion state of a row is changed by end-user interaction. + */ + RowExpandedChanging: ASPxClientEvent>; + /** + * Fires on the client side after a row's expansion state has been changed by end-user interaction. + */ + RowExpandedChanged: ASPxClientEvent>; + /** + * Fires on the client when a record is clicked. + */ + RecordClick: ASPxClientEvent>; + /** + * Fires on the client when a record is double clicked. + */ + RecordDblClick: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any unhandled server error occurs during server-side processing of a callback sent by the ASPxClientVerticalGrid. + */ + CallbackError: ASPxClientEvent>; + /** + * Sorts data by the specified data row's values. + * @param row An ASPxClientVerticalGridRow object that represents the data row. + */ + SortBy(row: ASPxClientVerticalGridRow): void; + /** + * Sorts data by the specified data row's values. + * @param rowIndex An integer value that specifies the row's position within the row collection. + */ + SortBy(rowIndex: number): void; + /** + * Sorts data by the specified data row's values. + * @param rowFieldNameOrId A string value that specifies the row's field name or unique identifier (the row's Name property value). + */ + SortBy(rowFieldNameOrId: string): void; + /** + * Sorts data by the specified data row's values. + * @param row An ASPxClientVerticalGridRow object that represents the data row. + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(row: ASPxClientVerticalGridRow, sortOrder: string): void; + /** + * Sorts data by the specified data row's values. + * @param rowIndex An integer value that specifies the row's position within the row collection. + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(rowIndex: number, sortOrder: string): void; + /** + * Sorts data by the specified data row's values. + * @param rowFieldNameOrId A string value that specifies the row's field name or unique identifier (the row's Name property value). + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + */ + SortBy(rowFieldNameOrId: string, sortOrder: string): void; + /** + * Sorts data by the specified data row's values. + * @param row An ASPxClientVerticalGridRow object that represents the data row. + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(row: ASPxClientVerticalGridRow, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data row's values. + * @param rowIndex An integer value that specifies the row's position within the row collection. + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true, to clear any previous sorting; otherwise, false. + */ + SortBy(rowIndex: number, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data row's values. + * @param rowFieldNameOrId A string value that specifies the row's field name or unique identifier (the row's Name property value). + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(rowFieldNameOrId: string, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data row's values, and places the row to the specified position among the sorted rows. + * @param row An ASPxClientGridViewColumn object that represents the data column. + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex An integer value that specifies the zero-based row's index among the sorted rows. -1 if data is not sorted by this row. + */ + SortBy(row: ASPxClientVerticalGridRow, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Sorts data by the specified data row's values, and places the row to the specified position among the sorted rows. + * @param rowIndex An integer value that specifies the row's position within the row collection. + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex + */ + SortBy(rowIndex: number, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Sorts data by the specified data row's values, and places the row to the specified position among the sorted rows. + * @param rowFieldNameOrId A string value that specifies the column's field name or unique identifier (the column's Name property value). + * @param sortOrder A string value that specifies the row's sort order ('ASC', 'DSC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + * @param sortIndex An integer value that specifies the zero-based row's index among the sorted rows. -1 if data is not sorted by this row. + */ + SortBy(rowFieldNameOrId: string, sortOrder: string, reset: boolean, sortIndex: number): void; + /** + * Returns the key value of the specified data row (record in the vertical grid). + * @param visibleIndex An integer value that specifies the record's visible index. + */ + GetRecordKey(visibleIndex: number): string; + /** + * Adds a new record. + */ + AddNewRecord(): void; + /** + * Deletes the specified record. + * @param visibleIndex An integer value that identifies the record. + */ + DeleteRecord(visibleIndex: number): void; + /** + * Deletes a record with the specified key value. + * @param key An object that uniquely identifies the record. + */ + DeleteRecordByKey(key: Object): void; + /** + * Selects all the unselected records within the grid. + */ + SelectRecords(): void; + /** + * Selects the specified record displayed within the grid. + * @param visibleIndex A zero-based integer value that specifies the record's visible index. + */ + SelectRecords(visibleIndex: number): void; + /** + * Selects the specified rercords within the grid. + * @param visibleIndices An array of zero-based indices that identify records within the grid. + */ + SelectRecords(visibleIndices: number[]): void; + /** + * Selects or deselects the specified records within the grid. + * @param visibleIndices An array of zero-based indices that identify records within the grid. + * @param selected true to select the specified records; false to deselect the records. + */ + SelectRecords(visibleIndices: number[], selected: boolean): void; + /** + * Selects or deselects the specified record within the grid. + * @param visibleIndex An integer zero-based index that identifies the record within the grid. + * @param selected true to select the specified record; false to deselect the record. + */ + SelectRecords(visibleIndex: number, selected?: boolean): void; + /** + * Selects or deselects the specified records displayed within the grid. + * @param keys An array of objects that uniquely identify the records. + * @param selected true to select the specified records; false to deselect the records. + */ + SelectRecordsByKey(keys: Object[], selected?: boolean): void; + /** + * Selects or deselects the specified record displayed within the grid. + * @param key An object that uniquely identifies the record. + * @param selected true to select the specified record; false to deselect the record. + */ + SelectRecordsByKey(key: Object, selected?: boolean): void; + /** + * Selects the specified records displayed within the grid. + * @param keys An array of objects that uniquely identify the records. + */ + SelectRecordsByKey(keys: Object[]): void; + /** + * Selects a grid record by its key. + * @param key An object that uniquely identifies the record. + */ + SelectRecordsByKey(key: Object): void; + /** + * Deselects all the selected records within the grid. + */ + UnselectRecords(): void; + /** + * Deselects the specified records (if selected) within the grid. + * @param visibleIndices An array of zero-based indices that identify records within the grid. + */ + UnselectRecords(visibleIndices: number[]): void; + /** + * Deselects the specified record (if selected) within the grid. + * @param visibleIndex A zero-based integer value that specifies the record's visible index. + */ + UnselectRecords(visibleIndex: number): void; + /** + * Deselects the specified records displayed within the grid. + * @param keys An array of objects that uniquely identify the records. + */ + UnselectRecordsByKey(keys: Object[]): void; + /** + * Deselects the specified record displayed within the grid. + * @param key An object that uniquely identifies the record. + */ + UnselectRecordsByKey(key: Object): void; + /** + * Deselects all grid records that match the filter criteria currently applied to the grid. + */ + UnselectFilteredRecords(): void; + /** + * Selects the specified record displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the record's visible index. + */ + SelectRecordOnPage(visibleIndex: number): void; + /** + * Selects or deselects the specified record displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the record's visible index. + * @param selected true to select the specified record; false to deselect the record. + */ + SelectRecordOnPage(visibleIndex: number, selected?: boolean): void; + /** + * Deselects the specified record (if selected) displayed on the current page. + * @param visibleIndex A zero-based integer value that specifies the record's visible index. + */ + UnselectRecordOnPage(visibleIndex: number): void; + /** + * Selects all unselected records displayed on the current page. + */ + SelectAllRecordsOnPage(): void; + /** + * Allows you to select or deselect all records displayed on the current page based on the parameter passed. + * @param selected true to select all unselected records displayed on the current page; false to deselect all selected records on the page. + */ + SelectAllRecordsOnPage(selected: boolean): void; + /** + * Deselects all selected records displayed on the current page. + */ + UnselectAllRecordsOnPage(): void; + /** + * Returns the number of selected records. + */ + GetSelectedRecordCount(): number; + /** + * Indicates whether or not the specified record is selected within the current page. + * @param visibleIndex An integer value that identifies the record by its visible index. + */ + IsRecordSelectedOnPage(visibleIndex: number): boolean; + /** + * Returns the values of the specified data source fields within the specified record. + * @param visibleIndex An integer value that identifies the record. + * @param fieldNames The names of data source fields separated using a semicolon, whose values within the specified record are returned. + * @param onCallback An ASPxClientVerticalGridValuesCallback object that represents the JavaScript function which receives the list of record values as a parameter. + */ + GetRecordValues(visibleIndex: number, fieldNames: string, onCallback: ASPxClientVerticalGridValuesCallback): void; + /** + * Returns the record values displayed within the current page. + * @param fieldNames The names of data source fields whose values are returned. + * @param onCallback A ASPxClientVerticalGridValuesCallback object that represents the JavaScript function which receives the list of record values as a parameter. + */ + GetPageRecordValues(fieldNames: string, onCallback: ASPxClientVerticalGridValuesCallback): void; + /** + * Returns the number of records actually displayed within the active page. + */ + GetVisibleRecordsOnPage(): number; + /** + * Returns the number of rows within the client vertical grid. + */ + GetRowCount(): number; + /** + * Applies the specified search panel filter criterion to grid data. + * @param value A string value that specifies the filter criterion. + */ + ApplySearchPanelFilter(value: string): void; + /** + * Applies the specified filter expression to the ASPxVerticalGrid. + * @param filterExpression A string value that specifies the filter expression. + */ + ApplyFilter(filterExpression: string): void; + /** + * Clears the filter expression applied to a client vertical grid. + */ + ClearFilter(): void; + /** + * Sets input focus to the grid. + */ + Focus(): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing the specified argument to it. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; + /** + * Selects the specified page. + * @param pageIndex An integer value that specifies the active page's index. + */ + GotoPage(pageIndex: number): void; + /** + * Gets the index of the page currently being selected. + */ + GetPageIndex(): number; + /** + * Gets the number of pages to which the grid's data is divided. + */ + GetPageCount(): number; + /** + * Activates the next page. + */ + NextPage(): void; + /** + * Activates the previous page. + */ + PrevPage(): void; + /** + * Returns the index of the first record displayed within the vertical grid's active page. + */ + GetTopVisibleIndex(): number; + /** + * Saves all the changes made and switches the grid to browse mode. + */ + UpdateEdit(): void; + /** + * Cancels all the changes made and switches the ASPxVerticalGrid to browse mode. + */ + CancelEdit(): void; + /** + * Updates data displayed within the grid. + */ + Refresh(): void; + /** + * Returns the record values displayed within all selected records. + * @param fieldNames The names of data source fields separated by a semicolon, whose values within the selected records are returned. + * @param onCallback A ASPxClientVerticalGridValuesCallback object that represents the JavaScript function which receives the list of record values as a parameter. + */ + GetSelectedFieldValues(fieldNames: string, onCallback: ASPxClientVerticalGridValuesCallback): void; + /** + * Returns key values of selected records displayed within the current page. + */ + GetSelectedKeysOnPage(): Object[]; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event. + * @param args A string value that is any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback A ASPxClientVerticalGridValuesCallback object that is the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(args: string, onCallback: ASPxClientVerticalGridValuesCallback): void; + /** + * Returns the editor used to edit the specified row's values. + * @param row An ASPxClientVerticalGridRowobject that specifies the required row within the client grid. + */ + GetEditor(row: ASPxClientVerticalGridRow): ASPxClientEdit; + /** + * Returns the editor used to edit the specified row's values. + * @param rowIndex An integer value that specifies the row's position within the rows collection. + */ + GetEditor(rowIndex: number): ASPxClientEdit; + /** + * Returns the editor used to edit the specified row's values. + * @param rowFieldNameOrId A string value that specifies the row's field name or unique identifier (the row's Name property value). + */ + GetEditor(rowFieldNameOrId: string): ASPxClientEdit; + /** + * Displays the Filter Control. + */ + ShowFilterControl(): void; + /** + * Hides the Filter Control. + */ + CloseFilterControl(): void; + /** + * Enables or disables the current filter. + * @param isFilterEnabled true to enable the current filter; otherwise, false. + */ + SetFilterEnabled(isFilterEnabled: boolean): void; + /** + * Returns the client row that resides at the specified position within the row collection. + * @param rowIndex A zero-based index that identifies the row within the row collection (the row's Index property value). + */ + GetRow(rowIndex: number): ASPxClientVerticalGridRow; + /** + * Returns the row with the specified unique identifier. + * @param rowId A string value that specifies the row's unique identifier (the row's Name property value). + */ + GetRowById(rowId: string): ASPxClientVerticalGridRow; + /** + * Returns the client row which is bound to the specified data source field. + * @param rowFieldName A string value that specifies the name of the data source field to which the row is bound (the row's fieldName property value). + */ + GetRowByField(rowFieldName: string): ASPxClientVerticalGridRow; + /** + * Returns the current vertical scroll position of the grid's content. + */ + GetVerticalScrollPosition(): number; + /** + * Returns the current horizontal scroll position of the grid's content. + */ + GetHorizontalScrollPosition(): number; + /** + * Specifies the vertical scroll position for the grid's content. + * @param position An integer value specifying the vertical scroll position. + */ + SetVerticalScrollPosition(position: number): void; + /** + * Specifies the horizontal scroll position for the grid's content. + * @param position An integer value specifying the horizontal scroll position. + */ + SetHorizontalScrollPosition(position: number): void; + /** + * Gets the value that specifies whether the required row is expanded. + * @param row An ASPxClientVerticalGridRowobject that specifies the row. + */ + GetRowExpanded(row: ASPxClientVerticalGridRow): boolean; + /** + * Gets the value that specifies whether the row with the specified index is expanded. + * @param rowIndex An integer value specifying the row's index. + */ + GetRowExpanded(rowIndex: number): boolean; + /** + * Gets the value that specifies whether the row with the specified field name or ID is expanded. + * @param rowFieldNameOrId A string value specifying the row's field name or ID. + */ + GetRowExpanded(rowFieldNameOrId: string): boolean; + /** + * Sets a value indicating whether the row is expanded. + * @param row An ASPxClientVerticalGridRowobject that specifies the required row within the client grid. + * @param value true, to expand the row; otherwise, false. + */ + SetRowExpanded(row: ASPxClientVerticalGridRow, value: boolean): void; + /** + * Sets a value indicating whether the row is expanded. + * @param rowIndex An integer value specifying the index of the row. + * @param value true, to expand the row; otherwise, false. + */ + SetRowExpanded(rowIndex: number, value: boolean): void; + /** + * Sets a value indicating whether the row is expanded. + * @param rowFieldNameOrId A string value that specifies the row's field name or unique identifier (the row's Name property value). + * @param value true, to expand the row; otherwise, false. + */ + SetRowExpanded(rowFieldNameOrId: string, value: boolean): void; +} +/** + * A client grid row. + */ +interface ASPxClientVerticalGridRow extends ASPxClientGridColumnBase { + /** + * Gets the name that uniquely identifies the row. + * Value: A string value assigned to the row's Name property. + */ + name: string; + /** + * Gets the row's position within the collection. + * Value: An integer zero-bazed index that specifies the row's position within the collection. + */ + index: number; + /** + * Gets the name of the database field assigned to the current row. + * Value: A string value that specifies the name of a data field. + */ + fieldName: string; + /** + * Gets whether the row is visible. + * Value: true, to display the row; otherwise, false. + */ + visible: boolean; +} +/** + * Represents a JavaScript function which receives the list of record values when the client GetSelectedFieldValues method is called. + */ +interface ASPxClientVerticalGridValuesCallback { + /** + * Represents a JavaScript function which receives the list of record values when the client GetSelectedFieldValues method is called. + * @param result An object that represents the list of record values received from the server. + */ + (result: Object): void; +} +/** + * A method that will handle the CustomButtonClick event. + */ +interface ASPxClientVerticalGridRowCancelEventHandler { + /** + * A method that will handle the cancelable events of a client ASPxVerticalGrid row. + * @param source The event source. + * @param e An ASPxClientVerticalGridRowCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridRowCancelEventArgs): void; +} +/** + * Provides data for the cancelable events of a client ASPxVerticalGrid row. + */ +interface ASPxClientVerticalGridRowCancelEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed client row. + * Value: An ASPxClientVerticalGridRow object that represents the processed row. + */ + row: ASPxClientVerticalGridRow; +} +/** + * A method that will handle the RecordClick event. + */ +interface ASPxClientVerticalGridRecordClickEventHandler { + /** + * A method that will handle the RecordClick event. + * @param source The event source. This parameter identifies the ASPxClientVerticalGrid object that raised the event. + * @param e An ASPxClientVerticalGridRecordClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridRecordClickEventArgs): void; +} +/** + * Provides data for the RecordClick event. + */ +interface ASPxClientVerticalGridRecordClickEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed record's visible index. + * Value: An integer zero-based index that identifies the processed record. + */ + visibleIndex: number; + /** + * Provides access to the parameters associated with the RecordClick event. + * Value: An object that contains parameters associated with the event. + */ + htmlEvent: Object; +} +/** + * A method that will handle the CustomButtonClick event. + */ +interface ASPxClientVerticalGridCustomButtonEventHandler { + /** + * A method that will handle the CustomButtonClick event. + * @param source The event source. This parameter identifies the ASPxClientVerticalGrid object that raised the event. + * @param e An ASPxClientVerticalGridCustomButtonEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridCustomButtonEventArgs): void; +} +/** + * Provides data for the CustomButtonClick event. + */ +interface ASPxClientVerticalGridCustomButtonEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the value which identifies the record whose custom button has been clicked. + * Value: An integer value that identifies the record whose custom button has been clicked. + */ + visibleIndex: number; + /** + * Gets the value which identifies the custom button. + * Value: A string value that identifies the clicked custom button. + */ + buttonID: string; +} +/** + * A method that will handle the SelectionChanged event. + */ +interface ASPxClientVerticalGridSelectionEventHandler { + /** + * A method that will handle the SelectionChanged event. + * @param source The event source. + * @param e An ASPxClientVerticalGridSelectionEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridSelectionEventArgs): void; +} +/** + * Provides data for the SelectionChanged event. + */ +interface ASPxClientVerticalGridSelectionEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the visible index of the record whose selected state has been changed. + * Value: An value that specifies the visible index of the record. + */ + visibleIndex: number; + /** + * Gets whether the record has been selected. + * Value: true, if the record has been selected; otherwise, false. + */ + isSelected: boolean; + /** + * Gets whether all records displayed within a page have been selected or unselected. + * Value: true if all records displayed within a page have been selected or unselected; otherwise, false. + */ + isAllRecordsOnPage: boolean; + /** + * Gets whether a selection has been changed on the server. + * Value: true if a selection has been changed on the server; otherwise, false. + */ + isChangedOnServer: boolean; +} +/** + * A method that will handle the RowExpandedChanged event. + */ +interface ASPxClientVerticalGridRowExpandedEventHandler { + /** + * A method that will handle the RowExpandedChanged event. + * @param source The event source. + * @param e An ASPxClientVerticalGridRowExpandedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridRowExpandedEventArgs): void; +} +/** + * Provides data for the RowExpandedChanged event. + */ +interface ASPxClientVerticalGridRowExpandedEventArgs extends ASPxClientEventArgs { + /** + * Gets the expanded row. + * Value: An ASPxClientVerticalGridRow object that represents the expanded row. + */ + row: ASPxClientVerticalGridRow; +} +/** + * A method that will handle the RowExpandedChanging event. + */ +interface ASPxClientVerticalGridRowExpandingEventHandler { + /** + * A method that will handle the RowExpandedChanging event. + * @param source The event source. + * @param e An ASPxClientVerticalGridRowExpandedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridRowExpandingEventArgs): void; +} +/** + * Provides data for the RowExpandedChanging event. + */ +interface ASPxClientVerticalGridRowExpandingEventArgs extends ASPxClientVerticalGridRowExpandedEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true, if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * Represents an object that will handle the client-side BatchEditStartEditing event. + */ +interface ASPxClientVerticalGridBatchEditStartEditingEventHandler { + /** + * A method that will handle the BatchEditStartEditing event. + * @param source The event source. + * @param e An ASPxClientVerticalGridBatchEditStartEditingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditStartEditingEventArgs): void; +} +/** + * Provides data for the BatchEditStartEditing event. + */ +interface ASPxClientVerticalGridBatchEditStartEditingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the visible index of the record whose cells are about to be edited. + * Value: An value that specifies the visible index of the record. + */ + visibleIndex: number; + /** + * Gets the grid row that owns a cell that is about to be edited. + * Value: An object that is the focused grid row. + */ + focusedRow: ASPxClientVerticalGridRow; + /** + * Gets a hashtable that maintains information about editable cells. + * Value: A hashtable that stores information about editable cells. + */ + recordValues: Object; +} +/** + * Represents an object that will handle the client-side BatchEditEndEditing event. + */ +interface ASPxClientVerticalGridBatchEditEndEditingEventHandler { + /** + * A method that will handle the BatchEditEndEditing event. + * @param source The event source. + * @param e An ASPxClientVerticalGridBatchEditEndEditingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditEndEditingEventArgs): void; +} +/** + * Provides data for the BatchEditEndEditing event. + */ +interface ASPxClientVerticalGridBatchEditEndEditingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the visible index of the record whose cells have been edited. + * Value: An value that specifies the visible index of the record. + */ + visibleIndex: number; + /** + * Gets a hashtable that maintains information about editable cells. + * Value: Gets a hashtable that maintains information about editable cells. + */ + recordValues: Object; +} +/** + * Represents an object that will handle the client-side BatchEditRecordValidating event. + */ +interface ASPxClientVerticalGridBatchEditRecordValidatingEventHandler { + /** + * A method that will handle the BatchEditRecordValidating event. + * @param source The event source. + * @param e An ASPxClientVerticalGridBatchEditRecordValidatingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditRecordValidatingEventArgs): void; +} +/** + * Provides data for the BatchEditRecordValidating event. + */ +interface ASPxClientVerticalGridBatchEditRecordValidatingEventArgs extends ASPxClientEventArgs { + /** + * Gets the processed record's visible index. + * Value: An integer value that specifies the processed record's visible index. + */ + visibleIndex: number; + /** + * Provides validation information on the record currently being validated. + * Value: An object that is a hashtable containing validation information. + */ + validationInfo: Object; +} +/** + * Represents an object that will handle the client-side BatchEditConfirmShowing event. + */ +interface ASPxClientVerticalGridBatchEditConfirmShowingEventHandler { + /** + * A method that will handle the BatchEditConfirmShowing client event. + * @param source The event source. + * @param e An ASPxClientVerticalGridBatchEditConfirmShowingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditConfirmShowingEventArgs): void; +} +/** + * Provides data for the BatchEditConfirmShowing event. + */ +interface ASPxClientVerticalGridBatchEditConfirmShowingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the client identifier of an object that initiates a send request. + * Value: A string value that specifies the object client identifier. + */ + requestTriggerID: string; +} +/** + * Represents an object that will handle the client-side BatchEditTemplateCellFocused event. + */ +interface ASPxClientVerticalGridBatchEditTemplateCellFocusedEventHandler { + /** + * A method that will handle the BatchEditTemplateCellFocused event. + * @param source An object representing the event source. Identifies the button editor that raised the event. + * @param e An ASPxClientVerticalGridBatchEditTemplateCellFocusedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditTemplateCellFocusedEventArgs): void; +} +/** + * Provides data for the BatchEditTemplateCellFocused event. + */ +interface ASPxClientVerticalGridBatchEditTemplateCellFocusedEventArgs extends ASPxClientEventArgs { + /** + * Gets the currently processed row. + * Value: A object that is the client-side row object. + */ + row: ASPxClientVerticalGridRow; + /** + * Gets or sets a value specifying whether the event was handled. + * Value: true if the event was handled and default processing should not occur; false if the event should be handled using default processing. + */ + handled: boolean; +} +/** + * Represents an object that will handle the client-side BatchEditChangesSaving event. + */ +interface ASPxClientVerticalGridBatchEditChangesSavingEventHandler { + /** + * A method that will handle the BatchEditChangesSaving event. + * @param source The event source. This parameter identifies the vertical grid object which raised the event. + * @param e An ASPxClientVerticalGridBatchEditChangesSavingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditChangesSavingEventArgs): void; +} +/** + * Provides data for the BatchEditChangesSaving event. + */ +interface ASPxClientVerticalGridBatchEditChangesSavingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets a hashtable that maintains information about inserted cells. + * Value: A hashtable that stores information about inserted cells. + */ + insertedValues: Object; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + deletedValues: Object; + /** + * Gets a hashtable that maintains information about updated cells. + * Value: A hashtable that stores information about updated cells. + */ + updatedValues: Object; +} +/** + * Represents an object that will handle the client-side BatchEditChangesCanceling event. + */ +interface ASPxClientVerticalGridBatchEditChangesCancelingEventHandler { + /** + * A method that will handle the BatchEditChangesCanceling event. + * @param source The event source. This parameter identifies the vertical grid object which raised the event. + * @param e An ASPxClientVerticalGridBatchEditChangesCancelingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditChangesCancelingEventArgs): void; +} +/** + * Provides data for the BatchEditChangesCanceling event. + */ +interface ASPxClientVerticalGridBatchEditChangesCancelingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets a hashtable that maintains information about inserted cells. + * Value: A hashtable that stores information about inserted cells. + */ + insertedValues: Object; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + deletedValues: Object; + /** + * Gets a hashtable that maintains information about updated cells. + * Value: A hashtable that stores information about updated cells. + */ + updatedValues: Object; +} +/** + * Represents an object that will handle the client-side BatchEditRecordInserting event. + */ +interface ASPxClientVerticalGridBatchEditRecordInsertingEventHandler { + /** + * A method that will handle the BatchEditRecordInserting event. + * @param source The event source. This parameter identifies the vertical grid object which raised the event. + * @param e An ASPxClientVerticalGridBatchEditRecordInsertingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditRecordInsertingEventArgs): void; +} +/** + * Provides data for the BatchEditRecordInserting event. + */ +interface ASPxClientVerticalGridBatchEditRecordInsertingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed record's visible index. + * Value: An integer value that specifies the processed record's visible index. + */ + visibleIndex: number; +} +/** + * Represents an object that will handle the client-side BatchEditRecordDeleting event. + */ +interface ASPxClientVerticalGridBatchEditRecordDeletingEventHandler { + /** + * A method that will handle the BatchEditRecordDeleting event. + * @param source The event source. This parameter identifies the vertical grid object which raised the event. + * @param e An ASPxClientVerticalGridBatchEditRecordDeletingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridBatchEditRecordDeletingEventArgs): void; +} +/** + * Provides data for the BatchEditRecordDeleting event. + */ +interface ASPxClientVerticalGridBatchEditRecordDeletingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed record's visible index. + * Value: An integer value that specifies the processed record's visible index. + */ + visibleIndex: number; + /** + * Gets a hashtable that maintains information about deleted cells. + * Value: A hashtable that stores information about deleted cells. + */ + recordValues: Object; +} +/** + * A method that will handle the FocusedCellChanging event. + */ +interface ASPxClientVerticalGridFocusedCellChangingEventHandler { + /** + * A method that will handle the FocusedCellChanging event. + * @param source The event source. + * @param e An ASPxClientVerticalGridFocusedCellChangingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientVerticalGridFocusedCellChangingEventArgs): void; +} +/** + * Provides data for the FocusedCellChanging event. + */ +interface ASPxClientVerticalGridFocusedCellChangingEventArgs extends ASPxClientCancelEventArgs { + /** + * Provides information on a cell currently being focused. + * Value: A ASPxClientVerticalGridCellInfo object that is the cell information. + */ + cellInfo: ASPxClientVerticalGridCellInfo; +} +/** + * Contains information on a cell that is being edited. + */ +interface ASPxClientVerticalGridCellInfo { + /** + * Gets the row that contains the cell currently being processed. + * Value: An object that is the row which contains the processed cell. + */ + row: ASPxClientVerticalGridRow; + /** + * Gets the visible index of the record that contains the cell currently being processed. + * Value: An value that specifies the visible index of the record. + */ + recordVisibleIndex: number; +} +/** + * Provides members related to Batch Edit Mode + */ +interface ASPxClientVerticalGridBatchEditApi { + /** + * Performs validation of grid data contained in all records when the grid operates in batch edit mode. + * @param validateOnlyModified true, if only modified records should be validated; otherwise, false. + */ + ValidateRecords(validateOnlyModified?: boolean): boolean; + /** + * Performs validation of grid data contained in the specified record when the grid operates in batch edit mode. + * @param visibleIndex An integer value specifying the visible index of the validated record. + */ + ValidateRecord(visibleIndex: number): boolean; + /** + * Returns an array of record visible indices. + * @param includeDeleted true, to include visible indices of deleted records to the returned array; otherwise, false. + */ + GetRecordVisibleIndices(includeDeleted: boolean): number[]; + /** + * Returns an array of the deleted record visible indices. + */ + GetDeletedRecordIndices(): number[]; + /** + * Returns an array of the inserted record visible indices. + */ + GetInsertedRecordIndices(): number[]; + /** + * Indicates if the record with the specified visible index is deleted. + * @param visibleIndex An integer value that identifies the record by its visible index. + */ + IsDeletedRecord(visibleIndex: number): boolean; + /** + * Indicates if the record with specified visible index is newly created. + * @param visibleIndex An integer value that identifies the record by its visible index. + */ + IsNewRecord(visibleIndex: number): boolean; + /** + * Programmatically moves the focus to the previous cell in the record. + */ + MoveFocusBackward(): boolean; + /** + * Programmatically moves the focus to the next cell in the record. + */ + MoveFocusForward(): boolean; + /** + * Sets a value of the specified cell. + * @param visibleIndex An integer zero-based index that identifies the record containing the processed cell. + * @param rowFieldNameOrId A string value that specifies the field name or unique identifier (the row's Name property value) of a row containing the processed cell. + * @param value An object that contains the new cell value. + */ + SetCellValue(visibleIndex: number, rowFieldNameOrId: string, value: Object): void; + /** + * Sets the value of the specified cell. + * @param visibleIndex An integer zero-based index that identifies the row containing the processed cell. + * @param rowFieldNameOrId A string value that specifies the field name or unique identifier (the column's Name property value) of a column containing the processed cell. + * @param value An object that contains the new cell value. + * @param displayText A string value that specifies the cell display text. + * @param cancelCellHighlighting true to cancel highlighting of the modified cell, false to highlight the modified cell. + */ + SetCellValue(visibleIndex: number, rowFieldNameOrId: string, value: Object, displayText: string, cancelCellHighlighting?: boolean): void; + /** + * Gets the value of the specified cell. + * @param visibleIndex A zero-based integer value that specifies a visible index of a record containing the processed cell. + * @param rowFieldNameOrId A string value that specifies the field name or unique identifier (the row's Name property value) of a row containing the processed cell. + * @param initial true, to return the initial (server) value; false, to return a value currently contained on the client side (modified value). + */ + GetCellValue(visibleIndex: number, rowFieldNameOrId: string, initial?: boolean): Object; + /** + * Gets a container holding the data cell content. + * @param visibleIndex An integer value that is the visible index. + * @param columnFieldNameOrId A string value that is the column's Field Name or ID. + */ + GetCellTextContainer(visibleIndex: number, columnFieldNameOrId: string): Object; + /** + * Gets information about the cell currently being edited. + */ + GetEditCellInfo(): ASPxClientVerticalGridCellInfo; + /** + * Returns a value that indicates whether the vertical grid has changed data. + */ + HasChanges(): boolean; + /** + * Returns a value that indicates whether the specified record has changed data. + * @param visibleIndex An integer value that specifies the visible index of a record. + */ + HasChanges(visibleIndex: number): boolean; + /** + * Returns a value that indicates whether the specified data cell's data has been changed. + * @param visibleIndex An integer value that specifies the visible index of a record. + * @param rowFieldNameOrId A string value that identifies the row by the name of the data source field to which the row is bound, or by the row's name. + */ + HasChanges(visibleIndex: number, rowFieldNameOrId: string): boolean; + /** + * Resets changes in the specified record. + * @param visibleIndex An integer value that specifies the visible index of a record. + */ + ResetChanges(visibleIndex: number): void; + /** + * Resets changes in the specified cell. + * @param visibleIndex An integer value that specifies the visible index of a record containing the processed cell. + * @param rowIndex A string value that specifies the field name or unique identifier (the row's Name property value) of a row containing the processed cell. + */ + ResetChanges(visibleIndex: number, rowIndex: number): void; + /** + * Switches the specified cell to batch edit mode. + * @param visibleIndex A zero-based integer value that specifies the visible index of a record containing the processed cell. + * @param rowIndex A zero-based integer value that identifies the row which contains the processed cell in the rows collection. + */ + StartEdit(visibleIndex: number, rowIndex: number): void; + /** + * Ends the cell(s) editing. + */ + EndEdit(): void; +} +/** + * Contains style settings related to media elements in ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorCommandStyleSettings { + /** + * Gets or sets a media element's CSS class name. + * Value: A string that specifies a class name. + */ + className: string; + /** + * Gets or sets an element's width. + * Value: A string that specifies an element's width in any correct format. + */ + width: string; + /** + * Gets or sets an element's height. + * Value: A string that specifies an element's height in any correct format. + */ + height: string; + /** + * Gets or sets a media element's border width. + * Value: A string that specifies a border width in any correct format. + */ + borderWidth: string; + /** + * Gets or sets a media element's border color. + * Value: A string that specifies a border color in any correct format. + */ + borderColor: string; + /** + * Gets or sets a media element's border style. + * Value: A string that specifies a border style in any correct format. + */ + borderStyle: string; + /** + * Gets or sets an element's top margin. + * Value: A string that specifies an element's top margin in any correct format. + */ + marginTop: string; + /** + * Gets or sets an element's right margin. + * Value: A string that specifies an element's right margin in any correct format. + */ + marginRight: string; + /** + * Gets or sets an element's bottom margin. + * Value: A string that specifies an element's bottom margin in any correct format. + */ + marginBottom: string; + /** + * Gets or sets an element's left margin. + * Value: A string that specifies an element's left margin in any correct format. + */ + marginLeft: string; + /** + * Gets or sets a media element's background color. + * Value: A string that specifies a background color in any correct format. + */ + backgroundColor: string; + /** + * Gets or sets the element's text alignment. + * Value: A string value that specifies the element's text alignment in any correct format. + */ + textAlign: string; + /** + * Gets or sets the element's vertical alignment. + * Value: A string value that specifies the element's vertical alignment in any correct format. + */ + verticalAlign: string; +} +/** + * The base class for parameters used in the ASPxHtmlEditor's client-side commands. + */ +interface ASPxClientHtmlEditorCommandArguments { + /** + * Gets the currently selected element in the ASPxHtmlEditor. + * Value: An HTML object which is the currently selected element. + */ + selectedElement: Object; +} +/** + * Contains settings related to the INSERTIMAGE_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorInsertImageCommandArguments extends ASPxClientHtmlEditorCommandArguments { + /** + * Specifies the source of the target image. + * Value: A string specifying the source of the target image. + */ + src: string; + /** + * Creates an alternate text for the target image. + * Value: A string that specifies an alternate text for the target image. + */ + alt: string; + /** + * Determines if the target image is wrapped with text. + * Value: true, if the target image is wrapped with text; otherwise, false. + */ + useFloat: boolean; + /** + * Determines the position of the target image. + * Value: A string value defining the position of the target image. + */ + align: string; + /** + * Contains the style settings specifying the appearance of the target image. + * Value: An object that contains the style settings specifying the appearance of the target image. + */ + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; +} +/** + * Contains settings related to the CHANGEIMAGE_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorChangeImageCommandArguments extends ASPxClientHtmlEditorInsertImageCommandArguments { +} +/** + * Contains settings related to the INSERTLINK_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorInsertLinkCommandArguments extends ASPxClientHtmlEditorCommandArguments { + /** + * Specifies the url of the page the target link goes to. + * Value: A string value specifying the target link url. + */ + url: string; + /** + * Specifiies the text of the target link. + * Value: A string value specifying the text of the target link. + */ + text: string; + /** + * Determines where to open the target link. + * Value: A string that specifies where to open the target link in any correct format. + */ + target: string; + /** + * Defines the title of the target link. + * Value: A string value defining the title of the target link. + */ + title: string; + /** + * Contains the style settings defining the appearance of the target link element. + * Value: An object that contains the style settings defining the appearance of the target link element. + */ + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; +} +/** + * The base class for parameters related to inserting or changing media elements in the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorChangeMediaElementCommandArguments extends ASPxClientHtmlEditorCommandArguments { + /** + * Defines the HTML "id" attribute of the target media element. + * Value: A string value which is a unique identifier for the element. + */ + id: string; + /** + * Defines the source of the target media element. + * Value: A string defining the source of the target media element. + */ + src: string; + /** + * Determines the position of the target media element. + * Value: A string value indicating the position of the target media element. + */ + align: string; + /** + * Contains the style settings defining the appearance of the target media element. + * Value: An object that contains the style settings defining the appearance of the target media element. + */ + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; + /** + * Returns the name of the client-side command corresponding to the parameter. + */ + GetCommandName(): string; +} +/** + * The base class for parameters related to inserting or changing HTML5 media elements (Audio and Video) in the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorChangeHtml5MediaElementCommandArguments extends ASPxClientHtmlEditorChangeMediaElementCommandArguments { + /** + * Determines if a media file will start playing automatically. + * Value: true, if autoplay is enabled; otherwise, false. + */ + autoPlay: boolean; + /** + * Determines if a media file repeats indefinitely, or stops when it reaches the last frame. + * Value: true, to loop playback; otherwise, false. + */ + loop: boolean; + /** + * Determines if the media player controls should be displayed. + * Value: true, if media player controls are displayed; otherwise, false. + */ + showPlayerControls: boolean; + /** + * Determines how a media file should be loaded when the page loads. + * Value: One of the ASPxClientHtmlEditorMediaPreloadMode enumeration values. + */ + preloadMode: string; +} +/** + * Contains settings related to the INSERTAUDIO_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorInsertAudioCommandArguments extends ASPxClientHtmlEditorChangeHtml5MediaElementCommandArguments { +} +/** + * Contains settings related to the CHANGEAUDIO_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorChangeAudioCommandArguments extends ASPxClientHtmlEditorInsertAudioCommandArguments { +} +/** + * Contains settings related to the INSERTVIDEO_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorInsertVideoCommandArguments extends ASPxClientHtmlEditorChangeHtml5MediaElementCommandArguments { + /** + * Defines the URL of an image that is shown while the video file is downloading, or until an end-user clicks the play button. + * Value: A string value that specifies the poster image URL. + */ + posterUrl: string; +} +/** + * Contains settings related to the CHANGEVIDEO_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorChangeVideoCommandArguments extends ASPxClientHtmlEditorInsertVideoCommandArguments { +} +/** + * Contains settings related to the INSERTFLASH_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorInsertFlashCommandArguments extends ASPxClientHtmlEditorChangeMediaElementCommandArguments { + /** + * Determines if the target flash element will start playing automatically. + * Value: true, if autoplay is enabled; otherwise, false. + */ + autoPlay: boolean; + /** + * Defines if the target flash element repeats indefinitely, or stops when it reaches the last frame. + * Value: true, to loop playback; otherwise, false. + */ + loop: boolean; + /** + * Determines if the flash related items are displayed in the context menu of the target flash element. + * Value: true, if the specific context menu items are displayed; otherwise, false + */ + enableFlashMenu: boolean; + /** + * Determines if the target flash element can be displayed in the fullscreen mode. + * Value: true, if the fullscreen mode is allowed; otherwise, false. + */ + allowFullscreen: boolean; + /** + * Defines the rendering quality level used for the target flash element. + * Value: A string value that specifies the target flash element rendering quality. + */ + quality: string; +} +/** + * Contains settings related to the CHANGEFLASH_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorChangeFlashCommandArguments extends ASPxClientHtmlEditorInsertFlashCommandArguments { +} +/** + * Contains settings related to the INSERTYOUTUBEVIDEO_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorInsertYouTubeVideoCommandArguments extends ASPxClientHtmlEditorChangeMediaElementCommandArguments { + /** + * Determines if suggested videos are shown after the target YouTube video finishes. + * Value: true, to show suggested videos; otherwise, false + */ + showRelatedVideos: boolean; + /** + * Determines if the target YouTube video title and player actions (Watch later, Share) are shown. + * Value: true, to display the title and player actions; otherwise, false. + */ + showVideoInfo: boolean; + /** + * Determines if the privacy-enhanced mode is enabled for the target YouTube video. + * Value: true, if the privace-enhanced mode is enabled; otherwise, false + */ + enablePrivacyEnhancedMode: boolean; + /** + * Determines if the player controls are displayed for the target YouTube video. + * Value: true, if the player controls are displayed; otherwise, false. + */ + showPlayerControls: boolean; +} +/** + * Contains settings related to the CHANGEYOUTUBEVIDEO_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorChangeYouTubeVideoCommandArguments extends ASPxClientHtmlEditorInsertYouTubeVideoCommandArguments { +} +/** + * Contains settings related to the TABLEPROPERTIES_DIALOG_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorTablePropertiesCommandArguments extends ASPxClientHtmlEditorCommandArguments { + /** + * Contains the style settings defining the appearance of the target table element. + * Value: An object that contains the style settings defining the appearance of the target table element. + */ + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; + /** + * Determines the position of the target table element. + * Value: A string value indicating the position of the target table element. + */ + align: string; + /** + * Gets or sets a table cell padding. + * Value: An integer value that is the cell padding. + */ + cellPadding: number; + /** + * Gets or sets the table cell spacing. + * Value: An integer value that is the table cell spacing. + */ + cellSpacing: number; + /** + * Gets or sets a value that is the table caption. + * Value: A string value that is the caption. + */ + caption: string; + /** + * Gets or sets a value indicating whether the first row/column serves as the table's header. + * Value: A string value that specifies whether the first row/column serves as the table's header. + */ + headers: string; + /** + * Gets or sets the table's summary. + * Value: A string value that is the table's summary. + */ + summary: string; +} +/** + * Contains settings related to the INSERTTABLE_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorInsertTableCommandArguments extends ASPxClientHtmlEditorTablePropertiesCommandArguments { + /** + * Gets or sets the count of columns in the table. + * Value: An integer value that is the count of columns. + */ + columns: number; + /** + * Gets or sets the count of rows in the table. + * Value: An integer value that is the count of rows. + */ + rows: number; + /** + * Gets or sets a value indicating whether all table columns should have equal width. + * Value: true, to create equal widths for all columns; otherwise, false. + */ + isEqualColumnWidth: boolean; +} +/** + * Contains settings related to the TABLECELLPROPERTIES_DIALOG_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorTableCellPropertiesCommandArguments extends ASPxClientHtmlEditorCommandArguments { + /** + * Contains the style settings defining the appearance of the target cell element. + * Value: An object that contains the style settings defining the appearance of the target cell element. + */ + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; + /** + * Gets or sets a value that indicates whether the cell settings should be applied to all cells in the table. + * Value: true, if the cell settings should be applied to all cells in the table; otherwise, false. + */ + applyForAll: boolean; +} +/** + * Contains settings related to the TABLEROWPROPERTIES_DIALOG_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorTableRowPropertiesCommandArguments extends ASPxClientHtmlEditorCommandArguments { + /** + * Contains the style settings specifying the appearance of the specified table row. + * Value: An object that contains the style settings specifying the appearance of the specified table row. + */ + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; +} +/** + * Contains settings related to the TABLECOLUMNPROPERTIES_DIALOG_COMMAND command parameter. + */ +interface ASPxClientHtmlEditorTableColumnPropertiesCommandArguments extends ASPxClientHtmlEditorCommandArguments { + /** + * Contains the style settings defining the appearance of the target column element. + * Value: An object that contains the style settings defining the appearance of the target column element. + */ + styleSettings: ASPxClientHtmlEditorCommandStyleSettings; +} +/** + * A method that will handle the DialogInitialized client event. + */ +interface ASPxClientHtmlEditorDialogInitializedEventHandler { + /** + * A method that will handle the client DialogInitialized event. + * @param source An object representing the event's source. + * @param e An ASPxClientHtmlEditorDialogInitializedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorDialogInitializedEventArgs): void; +} +/** + * Provides data for the DialogInitialized client event. + */ +interface ASPxClientHtmlEditorDialogInitializedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the dialog that has been initialized. + * Value: A string value that is the name of the initialized dialog. + */ + dialogName: string; + /** + * Gets a dialog object related to the event. + * Value: A ASPxClientHtmlEditorDialogBase object that is the dialog. + */ + dialog: ASPxClientHtmlEditorDialogBase; +} +/** + * Provides data for the event that fires when the HTML Editor dialogs are closed or are going to be closed. + */ +interface ASPxClientHtmlEditorDialogCloseEventArgs extends ASPxClientEventArgs { + /** + * Gets the dialog name related to the event. + * Value: A string value that is the dialog name. + */ + dialogName: string; + /** + * Gets the dialog object related to the event. + * Value: An ASPxClientHtmlEditorDialogBase object that is the dialog. + */ + dialog: ASPxClientHtmlEditorDialogBase; + /** + * Gets a string that contains specific information (if any) passed from the client side for server-side processing. + * Value: A string value representing specific information passed from the client to the server side. + */ + parameter: Object; +} +/** + * A method that will handle the DialogClosing event. + */ +interface ASPxClientHtmlEditorDialogClosingEventHandler { + /** + * A method that will handle the DialogClosing event. + * @param source The event source. + * @param e An ASPxClientHtmlEditorDialogClosingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorDialogClosingEventArgs): void; +} +/** + * Provides data for the DialogClosing event. + */ +interface ASPxClientHtmlEditorDialogClosingEventArgs extends ASPxClientHtmlEditorDialogCloseEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true, if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the DialogClosed event. + */ +interface ASPxClientHtmlEditorDialogClosedEventHandler { + /** + * A method that will handle the DialogClosed event. + * @param source The event source. + * @param e An ASPxClientHtmlEditorDialogClosedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorDialogClosedEventArgs): void; +} +/** + * Provides data for the DialogClosed event. + */ +interface ASPxClientHtmlEditorDialogClosedEventArgs extends ASPxClientHtmlEditorDialogCloseEventArgs { +} +/** + * A method that will handle the CommandExecuting event. + */ +interface ASPxClientHtmlEditorCommandExecutingEventHandler { + /** + * A method that will handle the client CommandExecuted event. + * @param source The event's source. + * @param e An ASPxClientHtmlEditorCommandExecutingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorCommandExecutingEventArgs): void; +} +/** + * Provides data for the CommandExecuting event. + */ +interface ASPxClientHtmlEditorCommandExecutingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value specifying the processed command's name. + */ + commandName: string; + /** + * Gets an optional parameter that complements the processed command. + * Value: An object containing additional information about the processed command. + */ + parameter: Object; +} +/** + * A method that will handle the client events related to command processing. + */ +interface ASPxClientHtmlEditorCommandEventHandler { + /** + * A method that will handle the corresponding client event. + * @param source The event source. This parameter identifies the editor which raised the event. + * @param e An ASPxClientHtmlEditorCommandEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorCommandEventArgs): void; +} +/** + * Provides data for client events that relate to command processing (CustomCommand). + */ +interface ASPxClientHtmlEditorCommandEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value representing the processed command's name. + */ + commandName: string; + /** + * Gets an optional parameter that complements the processed command. + * Value: A string value containing additional information about the processed command. + */ + parameter: Object; +} +/** + * A method that will handle the client events that relate to custom dialog operations. + */ +interface ASPxClientHtmlEditorCustomDialogEventHandler { + /** + * A method that will handle the client CustomDialogOpened event. + * @param source An object representing the event's source. + * @param e An ASPxClientHtmlEditorCustomDialogEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorCustomDialogEventArgs): void; +} +/** + * Provides data for client events that relate to custom dialog operations. + */ +interface ASPxClientHtmlEditorCustomDialogEventArgs extends ASPxClientEventArgs { + /** + * Gets the name that uniquely identifies the processed custom dialog. + * Value: A string value that represents the value assigned to the processed custom dialog's Name property. + */ + name: string; +} +/** + * Provides data for client events that relate to closing a custom dialog. + */ +interface ASPxClientHtmlEditorCustomDialogCloseEventArgsBase extends ASPxClientHtmlEditorCustomDialogEventArgs { + /** + * Gets the status of the closed custom dialog. + * Value: An object representing a custom dialog's closing status. By default, it's the "cancel" string if the dialog operation is canceled, or the "ok" string if a dialog is closed by submitting a file. You can also provide your custom status, if your dialog contains additional buttons. + */ + status: Object; +} +/** + * A method that will handle the CustomDialogClosing client event. + */ +interface ASPxClientHtmlEditorCustomDialogClosingEventHandler { + /** + * A method that will handle the client CustomDialogClosing event. + * @param source An object representing the event's source. + * @param e An ASPxClientHtmlEditorCustomDialogClosingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorCustomDialogClosingEventArgs): void; +} +/** + * Provides data for the CustomDialogClosing client event. + */ +interface ASPxClientHtmlEditorCustomDialogClosingEventArgs extends ASPxClientHtmlEditorCustomDialogCloseEventArgsBase { + /** + * Gets or sets a value specifying whether the event was handled. + * Value: true if the event was handled and default processing should not occur; false if the event should be handled using default processing. + */ + handled: boolean; +} +/** + * A method that will handle the CustomDialogClosed client event. + */ +interface ASPxClientHtmlEditorCustomDialogClosedEventHandler { + /** + * A method that will handle the client CustomDialogClosed event. + * @param source An object representing the event's source. + * @param e An ASPxClientHtmlEditorCustomDialogClosedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorCustomDialogClosedEventArgs): void; +} +/** + * Provides data for the CustomDialogClosed client event. + */ +interface ASPxClientHtmlEditorCustomDialogClosedEventArgs extends ASPxClientHtmlEditorCustomDialogCloseEventArgsBase { + /** + * Gets an object associated with the closed dialog. + * Value: An object containing custom data associated with dialog closing. + */ + data: Object; +} +/** + * A method that will handle the Validation client event. + */ +interface ASPxClientHtmlEditorValidationEventHandler { + /** + * A method that will handle the client Validation event. + * @param source An object representing the event's source. + * @param e An ASPxClientHtmlEditorValidationEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorValidationEventArgs): void; +} +/** + * Provides data for the Validation client event. + */ +interface ASPxClientHtmlEditorValidationEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets the HTML markup that is the ASPxHtmlEditor's content. + * Value: A string value that specifies the HTML content to validate. + */ + html: string; + /** + * Gets or sets a value specifying whether the validated value is valid. + * Value: true if the validation has been completed successfully; otherwise, false. + */ + isValid: boolean; + /** + * Gets or sets the error text to be displayed within the editor's error frame if the editor's validation fails. + * Value: A string value specifying the error description. + */ + errorText: string; +} +/** + * A method that will handle the ActiveTabChanged event. + */ +interface ASPxClientHtmlEditorTabEventHandler { + /** + * A method that will handle the client ActiveTabChanged event. + * @param source The event's source. + * @param e An ASPxClientHtmlEditorTabEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorTabEventArgs): void; +} +/** + * Provides data for the ActiveTabChanged event that concerns manipulations on tabs. + */ +interface ASPxClientHtmlEditorTabEventArgs extends ASPxClientEventArgs { + /** + * Gets the name that uniquely identifies an editor tab. + * Value: A string value that is the tab name. + */ + name: string; +} +/** + * A method that will handle the ActiveTabChanging event. + */ +interface ASPxClientHtmlEditorTabCancelEventHandler { + /** + * A method that will handle the client ActiveTabChanging event. + * @param source The event's source. + * @param e An ASPxClientHtmlEditorTabCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorTabCancelEventArgs): void; +} +/** + * Provides data for the cancellable ActiveTabChanging event that concerns manipulations on tabs. + */ +interface ASPxClientHtmlEditorTabCancelEventArgs extends ASPxClientHtmlEditorTabEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event, should be canceled. + * Value: true, if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the BeforePaste event. + */ +interface ASPxClientHtmlEditorBeforePasteEventHandler { + /** + * A method that will handle the BeforePaste event. + * @param source The event source. This parameter identifies the HTML editor object that raised the event. + * @param e An ASPxClientHtmlEditorBeforePasteEventArgs object that contains event data. + */ + (source: S, e: ASPxClientHtmlEditorBeforePasteEventArgs): void; +} +/** + * Provides data for the BeforePaste event. + */ +interface ASPxClientHtmlEditorBeforePasteEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value identifying the command's name. + */ + commandName: string; + /** + * Gets or sets the HTML markup that is about to be pasted to the ASPxHtmlEditor's content. + * Value: A string value that specifies the HTML content to paste. + */ + html: string; +} +/** + * Represents a client-side equivalent of the ASPxHtmlEditor control. + */ +interface ASPxClientHtmlEditor extends ASPxClientControl { + /** + * Occurs on the client side after a dialog has been initialized. + */ + DialogInitialized: ASPxClientEvent>; + /** + * Fires on the client side before a dialog is going to be closed. + */ + DialogClosing: ASPxClientEvent>; + /** + * Occurs on the client side after a dialog is closed. + */ + DialogClosed: ASPxClientEvent>; + /** + * Occurs before a default or custom command has been executed and allows you to cancel the action. + */ + CommandExecuting: ASPxClientEvent>; + /** + * Enables you to implement a custom command's logic. + */ + CustomCommand: ASPxClientEvent>; + /** + * Occurs after a default or custom command has been executed on the client side. + */ + CommandExecuted: ASPxClientEvent>; + /** + * Fires on the client side when the editor's Design View Area receives input focus. + */ + GotFocus: ASPxClientEvent>; + /** + * Fires on the client side when the editor's Design View Area loses input focus. + */ + LostFocus: ASPxClientEvent>; + /** + * Occurs on the client when a selection is changed within the ASPxHtmlEditor. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Occurs on the client side when the content of the editor changes. + */ + HtmlChanged: ASPxClientEvent>; + /** + * Occurs on the client side after a custom dialog is opened. + */ + CustomDialogOpened: ASPxClientEvent>; + /** + * Fires on the client side before a custom dialog is closed. + */ + CustomDialogClosing: ASPxClientEvent>; + /** + * Occurs on the client side after a custom dialog is closed. + */ + CustomDialogClosed: ASPxClientEvent>; + /** + * Allows you to specify whether the value entered into the ASPxHtmlEditor is valid. + */ + Validation: ASPxClientEvent>; + /** + * Occurs on the client side before a context menu is shown. + */ + ContextMenuShowing: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientHtmlEditor. + */ + CallbackError: ASPxClientEvent>; + /** + * Fires after a callback, sent by the CustomDataCallback event handler. + */ + CustomDataCallback: ASPxClientEvent>; + /** + * Occurs on the client side after the editor content is spell checked. + */ + SpellingChecked: ASPxClientEvent>; + /** + * Fires on the client side after the active tab has been changed within a control. + */ + ActiveTabChanged: ASPxClientEvent>; + /** + * Fires on the client side before the active tab is changed within a control. + */ + ActiveTabChanging: ASPxClientEvent>; + /** + * Occurs before an HTML code is pasted to editor content, and allows you to modify it. + */ + BeforePaste: ASPxClientEvent>; + /** + * Returns the document object generated by an iframe element within a design view area. + */ + GetDesignViewDocument(): Object; + /** + * Provides access to the client ASPxPopupControl object that is a Html Editor's dialog. + */ + GetDialogPopupControl(): ASPxClientPopupControl; + /** + * Returns the document object generated by an iframe element within a preview area. + */ + GetPreviewDocument(): Object; + /** + * Returns a collection of client context menu objects. + */ + GetContextMenu(): ASPxClientPopupMenu; + /** + * Returns a value indicating whether an editor is enabled. + */ + GetEnabled(): boolean; + /** + * Specifies whether an editor is enabled. + * @param value true to enable the editor; false to disable it. + */ + SetEnabled(value: boolean): void; + /** + * Sets input focus to the ASPxHtmlEditor's edit region. + */ + Focus(): void; + /** + * Gets the HTML markup that represents the editor's content. + */ + GetHtml(): string; + /** + * Specifies the HTML markup that represents the editor's content. + * @param html A string value that specifies the HTML markup. + */ + SetHtml(html: string): void; + /** + * Sets the HTML markup that represents the editor's content. + * @param html A string value that specifies the HTML markup. + * @param clearUndoHistory true to clear the undo stack; otherwise, false. + */ + SetHtml(html: string, clearUndoHistory: boolean): void; + /** + * Replaces placeholders with the specified values. + * @param html A string value that specifies the HTML code to process. + * @param placeholders An array of objects that specify the placeholders and values to replace them. + */ + ReplacePlaceholders(html: string, placeholders: Object[]): string; + /** + * Creates a parameter for ASPxHtmlEditor's client-side commands related to changing media elements. + * @param element An element that is being changed. + */ + CreateChangeMediaElementCommandArguments(element: Object): ASPxClientHtmlEditorChangeMediaElementCommandArguments; + /** + * Executes the specified command. + * @param commandName A string value that specifies the command to perform. + * @param parameter A string value specifying additional information about the command to perform. + * @param addToUndoHistory true, to add the specified command to the undo stack; otherwise, false. + */ + ExecuteCommand(commandName: string, parameter: Object, addToUndoHistory: boolean): boolean; + /** + * Adds the current editor state to the undo/redo history. + */ + SaveToUndoHistory(): void; + /** + * Returns the selection in the ASPxHtmlEditor. + */ + GetSelection(): ASPxClientHtmlEditorSelection; + /** + * Restores the selection within the ASPxHtmlEditor. + */ + RestoreSelection(): boolean; + /** + * Sets the value of the combo box within the HtmlEditor on the client side. + * @param commandName A string value that identifies the combo box's command name within the HtmlEditor's control collection. + * @param value A string value that specifies the combo box's new value. + */ + SetToolbarComboBoxValue(commandName: string, value: string): void; + /** + * Sets the value of the dropdown item picker in the HtmlEditor on the client side. + * @param commandName A string value that identifies the dropdown item picker by its command name. This value is contained in the CommandName property. + * @param value A string value that specifies the dropdown item picker's new value, i.e., the ToolbarItemPickerItem object. + */ + SetToolbarDropDownItemPickerValue(commandName: string, value: string): void; + /** + * Specifies the visibility of a ribbon context tab category specified by its name. + * @param categoryName A Name property value of the required category. + * @param active true to make a category visible; false to make it hidden. + */ + SetRibbonContextTabCategoryVisible(categoryName: string, active: string): void; + /** + * Provides access to an object implementing the HtmlEditor's ribbon UI. + */ + GetRibbon(): ASPxClientRibbon; + /** + * Gets a value that indicates whether the editor's value passes validation. + */ + GetIsValid(): boolean; + /** + * Gets the error text to be displayed within the editor's error frame if the editor's validation fails. + */ + GetErrorText(): string; + /** + * Sets a value that specifies whether the editor's value passes validation. + * @param isValid true if the editor's value passes validation; otherwise, false. + */ + SetIsValid(isValid: boolean): void; + /** + * Sets the error text to be displayed within the editor's error frame if the editor's validation fails. + * @param errorText A string value representing the error text. + */ + SetErrorText(errorText: string): void; + /** + * Performs validation of the editor's content. + */ + Validate(): void; + /** + * Set an active tab specified by its name. + * @param name A string value that is the name of the tab. + */ + SetActiveTabByName(name: string): void; + /** + * Returns the name of the active HTML editor tab. + */ + GetActiveTabName(): string; + /** + * Reconnect the control to an external ribbon. + */ + ReconnectToExternalRibbon(): void; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback A ASPxClientDataCallback object that represents the JavaScript function which receives the callback data as a parameter. + */ + PerformDataCallback(parameter: string, onCallback: ASPxClientDataCallback): void; +} +/** + * Provides client functionality for dialogs within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorDialogBase { + /** + * Provides access to the client ASPxFormLayout object that arranges all editors in the Html Editor's dialogs. + */ + GetFormLayout(): ASPxClientFormLayout; + /** + * Provides access to the client object of the "OK" button in the Html Editor's dialogs. + */ + GetOkButton(): ASPxClientButton; + /** + * Provides access to the client object of the "Cancel" button in the Html Editor's dialogs. + */ + GetCancelButton(): ASPxClientButton; +} +/** + * Provides client functionality for Html Editor dialogs operated with its elements. + */ +interface ASPxClientHtmlEditorEditElementDialog extends ASPxClientHtmlEditorDialogBase { + /** + * Provides access to the client object of the "Border style" combo box in the Html Editor's dialogs (Style Settings). + */ + GetBorderStyleComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Border width" spin editor in the Html Editor's dialogs (Style Settings). + */ + GetBorderWidthSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Border color" color editor in the Html Editor's dialogs (Style Settings). + */ + GetBorderColorColorEdit(): ASPxClientColorEdit; + /** + * Provides access to the client object of the "Top margin" text box in the Html Editor's dialogs (Style Settings). + */ + GetTopMarginTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Bottom margin" text box in the Html Editor's dialogs (Style Settings). + */ + GetBottomMarginTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Left margin" text box in the Html Editor's dialogs (Style Settings). + */ + GetLeftMarginTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Right margin" text box in the Html Editor's dialogs (Style Settings). + */ + GetRightMarginTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "CSS class" combo box in the Html Editor's dialogs (Style Settings). + */ + GetCssClassNameComboBox(): ASPxClientComboBox; +} +/** + * Provides client functionality for the Change Element Properties dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorChangeElementPropertiesDialog extends ASPxClientHtmlEditorEditElementDialog { + /** + * Provides access to the client object of the "ID" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetIdTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Title" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetTitleTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Direction" combo box in the Html Editor's "Change Element Properties" dialog. + */ + GetDirectionComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Value" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetValueTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Tab index" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetTabIndexTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Disabled" check box in the Html Editor's "Change Element Properties" dialog. + */ + GetDisabledCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Input type" combo box in the Html Editor's "Change Element Properties" dialog. + */ + GetInputTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "For" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetForTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Name" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetNameTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Method" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetMethodTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Action" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetActionTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Checked" check box in the Html Editor's "Change Element Properties" dialog. + */ + GetCheckedCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Max length" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetMaxLengthTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Size" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetSizeTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Readonly" check box in the Html Editor's "Change Element Properties" dialog. + */ + GetReadonlyCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Src" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetSrcTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Accept" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetAcceptTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Alt" text box in the Html Editor's "Change Element Properties" dialog. + */ + GetAltTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Start" spin editor in the Html Editor's "Change Element Properties" dialog. + */ + GetStartSpinEdit(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Width" spin editor in the Html Editor's "Change Element Properties" dialog. + */ + GetWidthValueSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client ASPxComboBox object that allows you to specify the element width measurement unit in the Html Editor's "Change Element Properties" dialog. + */ + GetWidthValueTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Height" spin editor in the Html Editor's "Change Element Properties" dialog. + */ + GetHeightValueSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client ASPxComboBox object that allows to specify the element height measurement unit in the Html Editor's "Change Element Properties" dialog. + */ + GetHeightValueTypeComboBox(): ASPxClientComboBox; +} +/** + * Provides client functionality for the Link dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorLinkDialog extends ASPxClientHtmlEditorDialogBase { + /** + * Provides access to the client object of the "E-mail to" text box in the Html Editor's Link dialog. + */ + GetEmailTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Text" text box in the Html Editor's Link dialog. + */ + GetTextTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "ToolTip" text box in the Html Editor's Link dialog. + */ + GetTooltipTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Subject" text box in the Html Editor's Link dialog. + */ + GetSubjectTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "URL" text box in the Html Editor's Link dialog. + */ + GetUrlTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the file manager used in the Link dialog's "Select Document" popup window. + */ + GetFileManager(): ASPxClientFileManager; + /** + * Provides access to the client object of the "Cancel" button in the Link dialog's "Select Document" popup window. + */ + GetSelectDocumentPopupCancelButton(): ASPxClientButton; + /** + * Provides access to the client object of the "Select" button in the Link dialog's "Select Document" popup window. + */ + GetSelectDocumentPopupSelectButton(): ASPxClientButton; + /** + * Provides access to the client popup control object that is the "Select Document" popup window in the Html Editor's Link dialog. + */ + GetSelectDocumentPopupControl(): ASPxClientPopupControl; + /** + * Provides access to the client object of the "Open in new window" check box in the Html Editor's Link dialog. + */ + GetOpenInNewWindowCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client radio button list object used to specify the link type in the Html Editor's Link dialog. + */ + GetLinkTypeRadioButtonList(): ASPxClientRadioButtonList; +} +/** + * Provides client functionality for the Placeholder dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorPlaceholderDialog extends ASPxClientHtmlEditorDialogBase { + /** + * Provides access to the ASPxListBox client object that lists placeholder names in the Html Editor's Placeholder dialog. + */ + GetPlaceholderNameListBox(): ASPxClientListBox; +} +/** + * Provides client functionality for the Paste From Word dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorPasteFromWordDialog extends ASPxClientHtmlEditorDialogBase { + /** + * Provides access to the client object of the "Remove font family" check box in the Html Editor's Flash dialog. + */ + GetRemoveFontFamilyCheckBox(): ASPxClientCheckBox; +} +/** + * Provides client functionality for the media dialogs within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorMediaDialogBase extends ASPxClientHtmlEditorEditElementDialog { + /** + * Provides access to the client object of the media file selector that allows you to insert/change media files in the Html Editor's Audio/Video/Flash dialogs. + */ + GetMediaFileSelector(): ASPxClientMediaFileSelector; + /** + * Provides access to the client object of the "More options" check box in the Html Editor's Audio/Video/Flash/Image dialogs. + */ + GetMoreOptionsCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Width" spin editor in the Html Editor's Audio/Video/Flash dialogs. + */ + GetWidthSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Height" spin editor in the Html Editor's Audio/Video/Flash dialogs. + */ + GetHeightSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Position" combo box in the Html Editor's Audio/Video/Flash/Image dialogs. + */ + GetPositionComboBox(): ASPxClientComboBox; +} +/** + * Provides client functionality for the Image dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorImageDialog extends ASPxClientHtmlEditorMediaDialogBase { + /** + * Provides access to the client object of the "Size" combo box in the Html Editor's Image dialog. + */ + GetSizeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Create thumbnail" check box in the Html Editor's Image dialog. + */ + GetCreateThumbnailCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "New image name" text box in the Html Editor's Image dialog. + */ + GetThumbnailNameTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Wrap text around image" check box in the Html Editor's Image dialog. + */ + GetWrapTextCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Description" text box in the Html Editor's Image dialog. + */ + GetDescriptionTextBox(): ASPxClientTextBox; +} +/** + * Provides client functionality for the Flash dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorFlashDialog extends ASPxClientHtmlEditorMediaDialogBase { + /** + * Provides access to the client object of the "Quality" combo box in the Html Editor's Flash dialog. + */ + GetQualityComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Auto play" check box in the Html Editor's Flash dialog. + */ + GetAutoPlayCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Enable flash menu" check box in the Html Editor's Flash dialog. + */ + GetEnableFlashMenuCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Loop" check box in the Html Editor's Flash dialog. + */ + GetLoopCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Allow fullscreen" check box in the Html Editor's Flash dialog. + */ + GetAllowFullscreenCheckBox(): ASPxClientCheckBox; +} +/** + * Provides client functionality for the Audio dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorAudioDialog extends ASPxClientHtmlEditorMediaDialogBase { + /** + * Provides access to the client object of the "Auto play" check box in the Html Editor's Audio dialogs. + */ + GetAutoPlayCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Preload mode" combo box in the Html Editor's Audio dialogs. + */ + GetPreloadModeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Loop" check box in the Html Editor's Audio dialogs. + */ + GetLoopCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Show player controls" check box in the Html Editor's Audio dialogs. + */ + GetShowPlayerControlsCheckBox(): ASPxClientCheckBox; +} +/** + * Provides client functionality for the Video dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorVideoDialog extends ASPxClientHtmlEditorMediaDialogBase { + /** + * Provides access to the client object of the "Auto play" check box in the Html Editor's Video dialog. + */ + GetAutoPlayCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Preload mode" combo box in the Html Editor's Video dialog. + */ + GetPreloadModeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Loop" check box in the Html Editor's Video dialog. + */ + GetLoopCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Show player controls" check box in the Html Editor's Video dialog. + */ + GetShowPlayerControlsCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Poster URL" text box in the Html Editor's Video dialog. + */ + GetPosterTextBox(): ASPxClientTextBox; +} +/** + * Provides client functionality for the YouTube Video dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorYouTubeDialog extends ASPxClientHtmlEditorEditElementDialog { + /** + * Provides access to the client object of the "Enable privacy-enhanced mode" check box in the Html Editor's YouTube Video dialog. + */ + GetConfidentModeCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Show suggested videos when the video finishes" check box in the Html Editor's YouTube Video dialog. + */ + GetShowSameVideosCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Show video title and player actions" check box in the Html Editor's YouTube Video dialog. + */ + GetShowVideoNameCheckBox(): ASPxClientCheckBox; + /** + * Provides access to the client object of the "Show player controls" check box in the Html Editor's YouTube Video dialog. + */ + GetShowPlayerControlsCheckBox(): ASPxClientCheckBox; +} +/** + * Provides base client functionality for the Table dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorTableDialogBase extends ASPxClientHtmlEditorDialogBase { + /** + * Provides access to the client object of the "Background color" color editor in the Html Editor's Table dialogs. + */ + GetBackgroundColorColorEdit(): ASPxClientColorEdit; +} +/** + * Provides client functionality for the Table dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorTableDialog extends ASPxClientHtmlEditorTableDialogBase { + /** + * Provides access to the client object of the "Width" combo box in the Html Editor's Table dialogs. + */ + GetWidthTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the spin editor in the Html Editor's Table dialogs that allows you to specify the table width value. + */ + GetWidthValueSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the combo box in the Html Editor's Table dialogs that allows you to specify the table width measurement unit. + */ + GetWidthValueTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Height" combo box in the Html Editor's Table dialogs. + */ + GetHeightTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the spin editor in the Html Editor's Table dialogs that allows you specify the table height value. + */ + GetHeightValueSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the combo box in the Html Editor's Table dialogs that allows you to specify the table height measurement unit. + */ + GetHeightValueTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Cell padding" spin editor in the Html Editor's Table dialogs. + */ + GetCellPaddingSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Cell spacing" spin editor in the Html Editor's Table dialogs. + */ + GetCellSpacingSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Alignment" combo box in the Html Editor's Table dialogs. + */ + GetAlignmentComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Border Color" color editor in the Html Editor's Table dialogs. + */ + GetBorderColorColorEdit(): ASPxClientColorEdit; + /** + * Provides access to the client object of the "Border size" spin editor in the Html Editor's Table dialogs. + */ + GetBorderWidthSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Headers" combo box in the Html Editor's Table dialogs. + */ + GetHeadersComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Caption" text box in the Html Editor's Table dialogs. + */ + GetCaptionTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Summary" text box in the Html Editor's Table dialogs. + */ + GetSummaryTextBox(): ASPxClientTextBox; + /** + * Provides access to the client object of the "Accessibility" check box related to the Html Editor's Table dialogs. + */ + GetAccessibilityCheckBox(): ASPxClientCheckBox; +} +/** + * Provides client functionality for the Insert Table dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorInsertTableDialog extends ASPxClientHtmlEditorTableDialog { + /** + * Provides access to the client object of the "Columns" spin editor in the Html Editor's Table dialogs. + */ + GetColumnCountSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Rows" spin editor in the Html Editor's Table dialogs. + */ + GetRowCountSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the "Equal column widths" check box in the Html Editor's Table dialogs. + */ + GetEqualWidthCheckBox(): ASPxClientCheckBox; +} +/** + * Provides client functionality for Table dialogs within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorTableElementPropertiesDialog extends ASPxClientHtmlEditorTableDialogBase { + /** + * Provides access to the client object of the "Horizontal" combo box in the Html Editor's Row/Column/Cell Properties dialog's Alignment group. + */ + GetHorizontalAlignmentComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the "Vertical" combo box in the Html Editor's Row/Column/Cell Properties dialog's Alignment group. + */ + GetVerticalAlignmentComboBox(): ASPxClientComboBox; +} +/** + * Provides client functionality for the Cell Properties dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorTableCellPropertiesDialog extends ASPxClientHtmlEditorTableElementPropertiesDialog { + /** + * Provides access to the client object of the "Apply to all cells in the table" check box in the Html Editor's Cell Properties dialog. + */ + GetApplyToAllCellsCheckBox(): ASPxClientCheckBox; +} +/** + * Provides client functionality for the Row Properties dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorTableRowPropertiesDialog extends ASPxClientHtmlEditorTableElementPropertiesDialog { + /** + * Provides access to the client object of the "Height" combo box in the Html Editor's "Row Properties" dialog. + */ + GetHeightTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client ASPxSpinEdit object that allows you to specify the row height in the Html Editor's "Row Properties" dialog. + */ + GetHeightValueSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client ASPxComboBox object that allows you to specify the row height measurement unit in the Html Editor's "Row Properties" dialog. + */ + GetHeightValueTypeComboBox(): ASPxClientComboBox; +} +/** + * Provides client functionality for the Column Properties dialog within the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorTableColumnPropertiesDialog extends ASPxClientHtmlEditorTableElementPropertiesDialog { + /** + * Provides access to the client object of the "Width" combo box in the Html Editor's "Column Properties" dialog. + */ + GetWidthTypeComboBox(): ASPxClientComboBox; + /** + * Provides access to the client object of the spin editor that allows you to set the column width value in the Html Editor's "Column Properties" dialog. + */ + GetWidthValueSpinEdit(): ASPxClientSpinEdit; + /** + * Provides access to the client object of the combo box that allows you to specify the column width measurement unit in the Html Editor's "Column Properties" dialog. + */ + GetWidthValueTypeComboBox(): ASPxClientComboBox; +} +/** + * A selection in the ASPxHtmlEditor. + */ +interface ASPxClientHtmlEditorSelection { + /** + * Returns a DOM element that relates to the current selection. + */ + GetSelectedElement(): Object; + /** + * Returns the HTML markup specifying the currently selected ASPxHtmlEditor content. + */ + GetHtml(): string; + /** + * Returns the text within the currently selected ASPxHtmlEditor content. + */ + GetText(): string; + /** + * Returns an array of the currently selected elements. + */ + GetElements(): Object[]; + /** + * Sets the new HTML markup in place of the currently selected within ASPxHtmlEditor content. + * @param html A string value specifying the new HTML markup. + * @param addToHistory true to add this operation to the history; otherwise, false. + */ + SetHtml(html: string, addToHistory: boolean): void; +} +/** + * The client-side equivalent of the ASPxPivotGrid control. + */ +interface ASPxClientPivotGrid extends ASPxClientControl { + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientPivotGrid. + */ + CallbackError: ASPxClientEvent>; + /** + * Fires after a callback that has been processed on the server returns back to the client. + */ + AfterCallback: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Fires before a callback is sent to the server for server-side processing. + */ + BeforeCallback: ASPxClientEvent>; + /** + * Fires on the client side after the customization form's visible state has been changed. + */ + CustomizationFieldsVisibleChanged: ASPxClientEvent>; + /** + * Occurs when a cell is clicked. + */ + CellClick: ASPxClientEvent>; + /** + * Occurs when a cell is double clicked. + */ + CellDblClick: ASPxClientEvent>; + /** + * Occurs when a custom menu item has been clicked. + */ + PopupMenuItemClick: ASPxClientEvent>; + /** + * Indicates whether the Defer Layout Update check box is enabled. + */ + IsDeferUpdatesChecked(): boolean; + /** + * Indicates whether the Filter Editor (Prefilter) is visible. + */ + IsPrefilterVisible(): boolean; + /** + * Shows the Filter Editor. + */ + ShowPrefilter(): void; + /** + * Hides the Filter Editor. + */ + HidePrefilter(): void; + /** + * Clears the filter expression applied using the Prefilter (Filter Editor). + */ + ClearPrefilter(): void; + /** + * Enables or disables the current filter applied by the Filter Editor (Prefilter). + */ + ChangePrefilterEnabled(): void; + /** + * Returns a value that specifies whether the customization form is visible. + */ + GetCustomizationFieldsVisibility(): boolean; + /** + * Specifies the visibility of the customization form. + * @param value true to display the customization form; false to hide the customization form. + */ + SetCustomizationFieldsVisibility(value: boolean): void; + /** + * Switches the customization form's visible state. + */ + ChangeCustomizationFieldsVisibility(): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; +} +/** + * A method that will handle the CellDblClick event. + */ +interface ASPxClientClickEventHandler { + /** + * A method that will handle the CellDblClick event. + * @param source The event source. + * @param e An ASPxClientClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientClickEventArgs): void; +} +/** + * Provides data for the CellDblClick client events. + */ +interface ASPxClientClickEventArgs extends ASPxClientEventArgs { + /** + * Provides access to the parameters associated with the CellDblClick events. + * Value: An object that contains parameters associated with the CellDblClick events. + */ + HtmlEvent: Object; + /** + * Gets the processed cell's value. + * Value: An object that represents the processed cell's value. + */ + Value: Object; + /** + * Gets the index of a column that owns the processed cell. + * Value: An integer value that identifies a column. + */ + ColumnIndex: number; + /** + * Gets the index of a row that owns the processed cell. + * Value: An integer value that identifies a row. + */ + RowIndex: number; + /** + * Gets a column field value. + * Value: An object that represents a column field value. + */ + ColumnValue: Object; + /** + * Gets a row field value. + * Value: An object that represents a row field value. + */ + RowValue: Object; + /** + * Gets a column field name. + * Value: A String value that represents a column field name. + */ + ColumnFieldName: string; + /** + * Gets a row field name. + * Value: A String value that represents a row field name. + */ + RowFieldName: string; + /** + * Gets a column value type. + * Value: A String value that represents a column value type. + */ + ColumnValueType: string; + /** + * Gets a row value type. + * Value: A String value that represents a row value type. + */ + RowValueType: string; + /** + * Gets the index of the data field which corresponds to the clicked summary value. + * Value: An integer value that identifies the data field. + */ + DataIndex: number; +} +/** + * A method that will handle the PopupMenuItemClick event. + */ +interface ASPxClientPivotMenuItemClickEventHandler { + /** + * A method that will handle the PopupMenuItemClick event. + * @param source The event source. + * @param e An ASPxClientPivotMenuItemClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientPivotMenuItemClickEventArgs): void; +} +/** + * Provides data for the PopupMenuItemClick event. + */ +interface ASPxClientPivotMenuItemClickEventArgs extends ASPxClientEventArgs { + /** + * Gets the context menu's type. + * Value: A PivotGridPopupMenuType enumeration value that identifies the context menu. + */ + MenuType: string; + /** + * Gets the name of the menu item currently being clicked. + * Value: A String value that identifies the clicked item by its name. + */ + MenuItemName: string; + /** + * Gets the field's unique indentifier. + * Value: A string which specifies the field's unique indentifier. + */ + FieldID: string; + /** + * Gets the index of the field value for which the popup menu has been invoked. + * Value: An integer value that identifies the field value. + */ + FieldValueIndex: number; +} +/** + * A client-side equivalent of the ASPxPivotCustomizationControl control. + */ +interface ASPxClientPivotCustomization extends ASPxClientControl { + /** + * Returns an HTML element that represents the root of the control's hierarchy. + */ + GetMainContainer(): Object; + /** + * Returns a client-side equivalent of the owner Pivot Grid Control. + */ + GetPivotGrid(): ASPxClientPivotGrid; + /** + * Specifies the Customization Control's height. + * @param value An integer value that specifies the Customization Control's height. + */ + SetHeight(value: number): void; + /** + * Specifies the Customization Control's width. + * @param value An integer value that specifies the Customization Control's width. + */ + SetWidth(value: number): void; + /** + * Recalculates the Customization Control height. + */ + UpdateHeight(): void; + /** + * Specifies the Customization Control's layout. + * @param layout A string that specifies the Customization Control's layout. + */ + SetLayout(layout: string): void; +} +/** + * A method that will handle the CustomCommandExecuted event. + */ +interface ASPxClientRichEditCustomCommandExecutedEventHandler { + /** + * A method that will handle the CustomCommandExecuted event. + * @param source An object representing the event source. Identifies the RichEdit that raised the event. + * @param e A ASPxClientRichEditCustomCommandExecutedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditCustomCommandExecutedEventArgs): void; +} +/** + * Provides data for the CustomCommandExecuted event. + */ +interface ASPxClientRichEditCustomCommandExecutedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value representing the processed command's name. + */ + commandName: string; + /** + * Gets an optional parameter that complements the processed command. + * Value: A string value containing additional information about the processed command. + */ + parameter: Object; +} +/** + * A method that will handle the HyperlinkClick event. + */ +interface ASPxClientRichEditHyperlinkClickEventHandler { + /** + * A method that will handle the HyperlinkClick event. + * @param source The event source. + * @param e An ASPxClientRichEditHyperlinkClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRichEditHyperlinkClickEventArgs): void; +} +/** + * Provides data for the HyperlinkClick event. + */ +interface ASPxClientRichEditHyperlinkClickEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets whether the event is handled manually, so no default processing is required. + * Value: true if the event is handled and no default processing is required; otherwise false. + */ + handled: boolean; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; + /** + * Gets a value identifying the clicked hyperlink type. + * Value: One of the values. + */ + hyperlinkType: ASPxClientOfficeDocumentLinkType; + /** + * Gets the clicked link's URI. + * Value: A sting value specifying the link's URI. + */ + targetUri: string; +} +/** + * A client-side equivalent of the ASPxRichEdit object. + */ +interface ASPxClientRichEdit extends ASPxClientControl { + /** + * Provides access to document structural elements. + * Value: A object that lists RichEdit's document structural elements. + */ + document: RichEditDocument; + /** + * Provides access to RichEdit's client-side commands. + * Value: A object that lists RichEdit's client-side commands. + */ + commands: RichEditCommands; + /** + * Provides access to the client methods that changes the selection. + * Value: A object that lists methods to work with the selection. + */ + selection: RichEditSelection; + /** + * Gets a unit converter. + * Value: A object representing a unit converter. + */ + unitConverter: RichEditUnitConverter; + /** + * Occurs after a custom command has been executed on the client side. + */ + CustomCommandExecuted: ASPxClientEvent>; + /** + * Fires after a client change has been made to the document and the client-server synchronization starts to apply the change on the server. + */ + BeginSynchronization: ASPxClientEvent>; + /** + * Fires after a document change has been applied to the server and server and client document models have been synchronized. + */ + EndSynchronization: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the RichEdit. + */ + CallbackError: ASPxClientEvent>; + /** + * Fires if any change is made to the RichEdit's document on the client. + */ + DocumentChanged: ASPxClientEvent>; + /** + * Occurs when a hyperlink is clicked within the document. + */ + HyperlinkClick: ASPxClientEvent>; + /** + * Occurs when the selection is changed within the document. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Enables you to switch the full-screen mode of the Rich Text Editor. + * @param fullscreen true to activate full-screen mode; false to deactivate full-screen mode. + */ + SetFullscreenMode(fullscreen: boolean): void; + /** + * Provides access to an object implementing the RichEdit's ribbon UI. + */ + GetRibbon(): ASPxClientRibbon; + /** + * Sets input focus to the RichEdit. + */ + Focus(): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Indicates whether any unsaved changes are contained in the current document. + */ + HasUnsavedChanges(): boolean; + /** + * Reconnects the RichEdit to an external ribbon. + */ + ReconnectToExternalRibbon(): void; +} +/** + * Contains a set of the available client commands. + */ +interface RichEditCommands { + /** + * Gets a command to create a new empty document. + * Value: A object that provides methods for executing the command and checking its state. + */ + fileNew: FileNewCommand; + /** + * Gets a command to open the file, specifying its path. + * Value: A object that provides methods for executing the command and checking its state. + */ + fileOpen: FileOpenCommand; + /** + * Gets a command to invoke the File Open dialog allowing one to select and load a document file into RichEdit. + * Value: A object that provides methods for executing the command and checking its state. + */ + fileOpenDialog: FileOpenDialogCommand; + /** + * Gets a command to save the document to a file. + * Value: A object that provides methods for executing the command and checking its state. + */ + fileSave: FileSaveCommand; + /** + * Gets a command to download the document file, specifying its extension. + * Value: A object that provides methods for executing the command and checking its state. + */ + fileDownload: FileDownloadCommand; + /** + * Gets a command to invoke the Save As dialog that prompts for a file name and saves the current document in a file with the specified path. + * Value: A object that provides methods for executing the command and checking its state. + */ + fileSaveAs: FileSaveAsCommand; + /** + * Gets a command to open the file's Save As dialog. + * Value: A object that provides methods for executing the command and checking its state. + */ + fileSaveAsDialog: FileSaveAsDialogCommand; + /** + * Gets a command to invoke a browser-specific Print dialog allowing one to print the current document. + * Value: A object that provides methods for executing the command and checking its state. + */ + filePrint: FilePrintCommand; + /** + * Gets a command to cancel changes caused by the previous command. + * Value: A object that provides methods for executing the command and checking its state. + */ + undo: UndoCommand; + /** + * Gets a command to reverse actions of the previous undo command. + * Value: A object that provides methods for executing the command and checking its state. + */ + redo: RedoCommand; + /** + * Gets a command to copy the selected text and place it to the clipboard. + * Value: A object that provides methods for executing the command and checking its state. + */ + copy: CopyCommand; + /** + * Gets a command to paste the text from the clipboard over the selection. + * Value: A object that provides methods for executing the command and checking its state. + */ + paste: PasteCommand; + /** + * Gets a command to cut the selected text and place it to the clipboard. + * Value: A object that provides methods for executing the command and checking its state. + */ + cut: CutCommand; + /** + * Gets a command to change the font name of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontName: ChangeFontNameCommand; + /** + * Gets a command to change the font size of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontSize: ChangeFontSizeCommand; + /** + * Gets a command to increase the font size of characters in a selected range to the closest larger predefined value. + * Value: A object that provides methods for executing the command and checking its state. + */ + increaseFontSize: IncreaseFontSizeCommand; + /** + * Gets a command to decrease the selected range's font size to the closest smaller predefined value. + * Value: A object that provides methods for executing the command and checking its state. + */ + decreaseFontSize: DecreaseFontSizeCommand; + /** + * Gets a command to convert selected text to upper case. + * Value: A object that provides methods for executing the command and checking its state. + */ + makeTextUpperCase: MakeTextUpperCaseCommand; + /** + * Gets a command to convert selected text to lower case. + * Value: A object that provides methods for executing the command and checking its state. + */ + makeTextLowerCase: MakeTextLowerCaseCommand; + /** + * Gets a command to capitalize each word in the selected sentence. + * Value: A object that provides methods for executing the command and checking its state. + */ + capitalizeEachWordTextCase: CapitalizeEachWordTextCaseCommand; + /** + * Gets a command to toggle case for each character - upper case becomes lower, lower case becomes upper. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTextCase: ToggleTextCaseCommand; + /** + * Gets a command to change the bold formatting of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontBold: ChangeFontBoldCommand; + /** + * Gets a command to change the italic formatting of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontItalic: ChangeFontItalicCommand; + /** + * Gets a command to change the underline formatting of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontUnderline: ChangeFontUnderlineCommand; + /** + * Gets a command to change the strikeout formatting of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontStrikeout: ChangeFontStrikeoutCommand; + /** + * Gets a command to change the superscript formatting of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontSuperscript: ChangeFontSuperscriptCommand; + /** + * Gets a command to change the subscript formatting of characters in the selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontSubscript: ChangeFontSubscriptCommand; + /** + * Gets a command to change the font color of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontForeColor: ChangeFontForeColorCommand; + /** + * Gets a command to change the background color of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontBackColor: ChangeFontBackColorCommand; + /** + * Gets a command to reset text and paragraph formatting in the selected range to default. + * Value: A object that provides methods for executing the command and checking its state. + */ + clearFormatting: ClearFormattingCommand; + /** + * Gets a command to change the selected range's style. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeStyle: ChangeStyleCommand; + /** + * Gets a command to toggle between the bulleted paragraph and normal text. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleBulletedList: ToggleBulletedListCommand; + /** + * Gets a command to toggle between the numbered paragraph and normal text. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleNumberingList: ToggleNumberingListCommand; + /** + * Gets a command to toggle between the multilevel list style and normal text. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleMultilevelList: ToggleMultilevelListCommand; + /** + * Gets a command to increment the indent level of paragraphs in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + increaseIndent: IncreaseIndentCommand; + /** + * Gets a command to decrease the indent level of paragraphs in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + decreaseIndent: DecreaseIndentCommand; + /** + * Gets a command to toggle hidden symbol visibility. + * Value: A object that provides methods for executing the command and checking its state. + */ + showHiddenSymbols: ShowHiddenSymbolsCommand; + /** + * Gets a command to toggle left paragraph alignment on and off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleParagraphAlignmentLeft: ToggleParagraphAlignmentLeftCommand; + /** + * Gets a command to toggle centered paragraph alignment on and off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleParagraphAlignmentCenter: ToggleParagraphAlignmentCenterCommand; + /** + * Gets a command to toggle right paragraph alignment on and off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleParagraphAlignmentRight: ToggleParagraphAlignmentRightCommand; + /** + * Gets a command to toggle justified paragraph alignment on and off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleParagraphAlignmentJustify: ToggleParagraphAlignmentJustifyCommand; + /** + * Gets a command to format a current paragraph with single line spacing. + * Value: A object that provides methods for executing the command and checking its state. + */ + setSingleParagraphSpacing: SetSingleParagraphSpacingCommand; + /** + * Gets a command to format a current paragraph with one and a half line spacing. + * Value: A object that provides methods for executing the command and checking its state. + */ + setSesquialteralParagraphSpacing: SetSesquialteralParagraphSpacingCommand; + /** + * Gets a command to format a selected paragraph with double line spacing. + * Value: A object that provides methods for executing the command and checking its state. + */ + setDoubleParagraphSpacing: SetDoubleParagraphSpacingCommand; + /** + * Gets a command to add spacing before a paragraph. + * Value: A object that provides methods for executing the command and checking its state. + */ + addSpacingBeforeParagraph: AddSpacingBeforeParagraphCommand; + /** + * Gets a command to add spacing after a paragraph. + * Value: A object that provides methods for executing the command and checking its state. + */ + addSpacingAfterParagraph: AddSpacingAfterParagraphCommand; + /** + * Gets a command to remove spacing before the selected paragraph. + * Value: A object that provides methods for executing the command and checking its state. + */ + removeSpacingBeforeParagraph: RemoveSpacingBeforeParagraphCommand; + /** + * Gets a command to remove spacing after the selected paragraph. + * Value: A object that provides methods for executing the command and checking its state. + */ + removeSpacingAfterParagraph: RemoveSpacingAfterParagraphCommand; + /** + * Gets a command to change the background color of paragraphs in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeParagraphBackColor: ChangeParagraphBackColorCommand; + /** + * Gets a command to invoke the Font dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openFontFormattingDialog: OpenFontFormattingDialogCommand; + /** + * Gets a command to change the font formatting of characters in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFontFormatting: ChangeFontFormattingCommand; + /** + * Gets a command to invoke the Indents And Spacing tab of the Paragraph dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openParagraphFormattingDialog: OpenParagraphFormattingDialogCommand; + /** + * Gets a command to change the formatting of paragraphs in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeParagraphFormatting: ChangeParagraphFormattingCommand; + /** + * Gets a command to insert a page break at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertPageBreak: InsertPageBreakCommand; + /** + * Gets a command to invoke the Insert Table dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openInsertTableDialog: OpenInsertTableDialogCommand; + /** + * Gets a command to insert a rectangle table of a specified size. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTable: InsertTableCommand; + /** + * Gets a command to invoke the Insert Image dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openInsertPictureDialog: OpenInsertPictureDialogCommand; + /** + * Gets a command to insert an inline picture stored by specifed web address. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertPicture: InsertPictureCommand; + /** + * Gets a command to invoke the Bookmark dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openInsertBookmarkDialog: OpenInsertBookmarkDialogCommand; + /** + * Gets a command to insert a new bookmark that references the current selection. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertBookmark: InsertBookmarkCommand; + /** + * A command to delete a specific bookmark. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteBookmark: DeleteBookmarkCommand; + /** + * Gets a command to navigate to the specified bookmark. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToBookmark: GoToBookmarkCommand; + /** + * Gets a command to invoke the Hyperlink dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openInsertHyperlinkDialog: OpenInsertHyperlinkDialogCommand; + /** + * Gets a command to insert a hyperlink at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertHyperlink: InsertHyperlinkCommand; + /** + * Gets a command to delete the selected hyperlink. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteHyperlink: DeleteHyperlinkCommand; + /** + * Gets a command to delete all hyperlinks in the selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteHyperlinks: DeleteHyperlinksCommand; + /** + * Gets a command to navigate to the document bookmark or URI (uniform resource identifier) specified for the hyperlink. + * Value: A object that provides methods for executing the command and checking its state. + */ + openHyperlink: OpenHyperlinkCommand; + /** + * Gets a command to invoke the Symbols dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openInsertSymbolDialog: OpenInsertSymbolDialogCommand; + /** + * Gets a command to insert a character into a document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertSymbol: InsertSymbolCommand; + /** + * Gets a command to change page margin settings. + * Value: A object that provides methods for executing the command and checking its state. + */ + changePageMargins: ChangePageMarginsCommand; + /** + * Gets a command to invoke the Margins tab of the Page Setup dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openPageMarginsDialog: OpenPageMarginsDialogCommand; + /** + * Gets a command to change the page orientation. + * Value: A object that provides methods for executing the command and checking its state. + */ + changePageOrientation: ChangePageOrientationCommand; + /** + * Gets a command to define the page size dialog's settings. + * Value: A object that provides methods for executing the command and checking its state. + */ + setPageSizeDialog: SetPageSizeDialogCommand; + /** + * Gets a command to invoke the Paper tab of the Page Setup dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openPagePaperSizeDialog: OpenPagePaperSizeDialogCommand; + /** + * Gets a command to change the page size. + * Value: A object that provides methods for executing the command and checking its state. + */ + changePageSize: ChangePageSizeCommand; + /** + * Gets a command to change the number of section columns having the same width. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeSectionEqualColumnCount: ChangeSectionEqualColumnCountCommand; + /** + * Gets a command to invoke the Columns dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openSectionColumnsDialog: OpenSectionColumnsDialogCommand; + /** + * Gets a command to change the settings of individual section columns. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeSectionColumns: ChangeSectionColumnsCommand; + /** + * Gets a command to insert a column break at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertColumnBreak: InsertColumnBreakCommand; + /** + * Gets a command to insert a section break and starts a new section on the next page. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertSectionBreakNextPage: InsertSectionBreakNextPageCommand; + /** + * Gets a command to insert a section break and starts a new section on the next even-numbered page. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertSectionBreakEvenPage: InsertSectionBreakEvenPageCommand; + /** + * Gets a command to insert a section break and starts a new section on the next odd-numbered page. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertSectionBreakOddPage: InsertSectionBreakOddPageCommand; + /** + * Gets a command to set the background color of the page. + * Value: A object that provides methods for executing the command and checking its state. + */ + changePageColor: ChangePageColorCommand; + /** + * Gets a command to toggle the horizontal ruler's visibility. + * Value: A object that provides methods for executing the command and checking its state. + */ + showHorizontalRuler: ShowHorizontalRulerCommand; + /** + * Gets a command to toggle the fullscreen mode. + * Value: A object that provides methods for executing the command and checking its state. + */ + setFullscreen: SetFullscreenCommand; + /** + * Gets a command to invoke the Bulleted and Numbering dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openNumberingListDialog: OpenNumberingListDialogCommand; + /** + * Gets a command to insert a paragraph break at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertParagraph: InsertParagraphCommand; + /** + * Gets a command to insert text at the current position in a document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertText: InsertTextCommand; + /** + * Gets a command to delete the text in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + delete: DeleteCommand; + /** + * Gets a command to remove the previous word. + * Value: A object that provides methods for executing the command and checking its state. + */ + removePrevWord: RemovePrevWordCommand; + /** + * Gets a command to remove the next word. + * Value: A object that provides methods for executing the command and checking its state. + */ + removeNextWord: RemoveNextWordCommand; + /** + * Gets a command to move the cursor backwards and erase the character in that space. + * Value: A object that provides methods for executing the command and checking its state. + */ + backspace: BackspaceCommand; + /** + * Gets a command to insert the line break at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertLineBreak: InsertLineBreakCommand; + /** + * Gets a command to scale pictures in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + changePictureScale: ChangePictureScaleCommand; + /** + * Gets a command to increment the left indentation of paragraphs in a selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + incrementParagraphLeftIndent: IncrementParagraphLeftIndentCommand; + /** + * Gets a command to decrement the paragraph's left indent position. + * Value: A object that provides methods for executing the command and checking its state. + */ + decrementParagraphLeftIndent: DecrementParagraphLeftIndentCommand; + /** + * Gets a command to move the selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + moveContent: MoveContentCommand; + /** + * Gets a command to copy the selected text and place it to the specified position. + * Value: A object that provides methods for executing the command and checking its state. + */ + copyContent: CopyContentCommand; + /** + * Gets a command to insert a tab character at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTab: InsertTabCommand; + /** + * Gets a command to invoke the Tabs dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openTabsDialog: OpenTabsDialogCommand; + /** + * Gets a command to change the tab stop value of a document or selected paragraphs + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTabs: ChangeTabsCommand; + /** + * Gets a command to invoke the Customize Numbered List dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openCustomNumberingListDialog: OpenCustomNumberingListDialogCommand; + /** + * Gets a command to customize the numbered list parameters. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeCustomNumberingList: ChangeCustomNumberingListCommand; + /** + * Gets a command to restart the numbering list. + * Value: A object that provides methods for executing the command and checking its state. + */ + restartNumberingList: RestartNumberingListCommand; + /** + * Gets a command to increment the indent level of paragraphs in a selected numbered list. + * Value: A object that provides methods for executing the command and checking its state. + */ + incrementNumberingIndent: IncrementNumberingIndentCommand; + /** + * Gets a command to decrement the indent level of paragraphs in a selected numbered list. + * Value: A object that provides methods for executing the command and checking its state. + */ + decrementNumberingIndent: DecrementNumberingIndentCommand; + /** + * Gets a command to create a field with an empty code and populate it with the selection (if it is not collapsed). + * Value: A object that provides methods for executing the command and checking its state. + */ + createField: CreateFieldCommand; + /** + * Gets a command to update the field's result. + * Value: A object that provides methods for executing the command and checking its state. + */ + updateField: UpdateFieldCommand; + /** + * Gets a command to display the selected field's codes. + * Value: A object that provides methods for executing the command and checking its state. + */ + showFieldCodes: ShowFieldCodesCommand; + /** + * Get a command to display all field codes in place of the fields in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + showAllFieldCodes: ShowAllFieldCodesCommand; + /** + * Gets a command to continue the list's numbering. + * Value: A object that provides methods for executing the command and checking its state. + */ + continueNumberingList: ContinueNumberingListCommand; + /** + * Gets a command to insert numeration to a paragraph making it a numbering list item. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertNumeration: InsertNumerationCommand; + /** + * Gets a command to remove the selected numeration. + * Value: A object that provides methods for executing the command and checking its state. + */ + removeNumeration: RemoveNumerationCommand; + /** + * Gets a command to update all fields in the selected range. + * Value: A object that provides methods for executing the command and checking its state. + */ + updateAllFields: UpdateAllFieldsCommand; + /** + * Gets a command to insert and update a field with a DATE code. + * Value: A object that provides methods for executing the command and checking its state. + */ + createDateField: CreateDateFieldCommand; + /** + * Gets a command to replace the selection with a TIME field displaying the current time. + * Value: A object that provides methods for executing the command and checking its state. + */ + createTimeField: CreateTimeFieldCommand; + /** + * A command to replace the selection with a PAGE field displaying the current page number. + * Value: A object that provides methods for executing the command and checking its state. + */ + createPageField: CreatePageFieldCommand; + /** + * Gets a command to convert the text of all selected sentences to sentence case. + * Value: A object that provides methods for executing the command and checking its state. + */ + makeTextSentenceCase: MakeTextSentenceCaseCommand; + /** + * Gets a command to switch the text case at the current position in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + switchTextCase: SwitchTextCaseCommand; + /** + * Gets a command to navigate to the first data record. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToFirstDataRecord: GoToFirstDataRecordCommand; + /** + * Gets a command to navigate to the previous data record of the bound data source. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToPreviousDataRecord: GoToPreviousDataRecordCommand; + /** + * Gets a command to navigate to the next data record of the bound data source. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToNextDataRecord: GoToNextDataRecordCommand; + /** + * Gets a command to navigate to the next data record. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToDataRecord: GoToDataRecordCommand; + /** + * Gets a command to navigate to the last data record of the bound data source. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToLastDataRecord: GoToLastDataRecordCommand; + /** + * Gets a command to display or hide actual data in MERGEFIELD fields. + * Value: A object that provides methods for executing the command and checking its state. + */ + showMergedData: ShowMergedDataCommand; + /** + * Gets a command to invoke the Insert Merge Field dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + mergeFieldDialog: MergeFieldDialogCommand; + /** + * Gets a command to replace the selection with a MERGEFIELD (a data source column name is passed with a parameter). + * Value: A object that provides methods for executing the command and checking its state. + */ + createMergeField: CreateMergeFieldCommand; + /** + * Gets a command to invoke the Export Range dialog window to start a mail merge. + * Value: A object that provides methods for executing the command and checking its state. + */ + mailMergeDialog: MailMergeDialogCommand; + /** + * Gets a command to perform a mail merge and download the merged document. + * Value: A object that provides methods for executing the command and checking its state. + */ + mailMergeAndDownload: MailMergeAndDownloadCommand; + /** + * Gets a command to perform a mail merge and save the merged document to the server. + * Value: A object that provides methods for executing the command and checking its state. + */ + mailMergeAndSaveAs: MailMergeAndSaveAsCommand; + /** + * Gets a command to activate the page header and begin editing. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertHeader: InsertHeaderCommand; + /** + * Gets a command to activate the page footer and begin editing. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertFooter: InsertFooterCommand; + /** + * Gets a command to link a header/footer to the previous section, so it has the same content. + * Value: A object that provides methods for executing the command and checking its state. + */ + linkHeaderFooterToPrevious: LinkHeaderFooterToPreviousCommand; + /** + * Gets a command to navigate to the page footer from the page header in the header/footer editing mode. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToFooter: GoToFooterCommand; + /** + * Gets a command to navigate to the page header from the page footer in the header/footer editing mode. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToHeader: GoToHeaderCommand; + /** + * Gets a command to navigate to the next page header or footer in the header/footer editing mode. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToNextHeaderFooter: GoToNextHeaderFooterCommand; + /** + * Gets a command to navigate to the previous page header or footer in the header/footer editing mode. + * Value: A object that provides methods for executing the command and checking its state. + */ + goToPreviousHeaderFooter: GoToPreviousHeaderFooterCommand; + /** + * Gets a command to change the header/footer edit mode, so it allows creation of a different header or footer for the first page of a document or section. + * Value: A object that provides methods for executing the command and checking its state. + */ + setDifferentFirstPageHeaderFooter: SetDifferentFirstPageHeaderFooterCommand; + /** + * Gets a command to change the header/footer edit mode so it allows creation of a different header or footer for odd and even pages of a document or section. + * Value: A object that provides methods for executing the command and checking its state. + */ + setDifferentOddAndEvenPagesHeaderFooter: SetDifferentOddAndEvenPagesHeaderFooterCommand; + /** + * Gets a command to finish header/footer editing. + * Value: A object that provides methods for executing the command and checking its state. + */ + closeHeaderFooter: CloseHeaderFooterCommand; + /** + * Gets a command to replace the selection with a NUMPAGES field displaying the total number of pages. + * Value: A object that provides methods for executing the command and checking its state. + */ + createPageCountField: CreatePageCountFieldCommand; + /** + * Gets a command to invoke the Table tab of the Table Properties dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openTableFormattingDialog: OpenTableFormattingDialogCommand; + /** + * Gets a command to change the selected table's formatting. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableFormatting: ChangeTableFormattingCommand; + /** + * Gets a command to change the selected table rows' preferred height. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableRowPreferredHeight: ChangeTableRowPreferredHeightCommand; + /** + * Gets a command to change the preferred cell width of the selected table rows. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableCellPreferredWidth: ChangeTableCellPreferredWidthCommand; + /** + * Gets a command to toggle inside borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellInsideBorders: ToggleTableCellInsideBordersCommand; + /** + * Gets a command to change the selected table columns' preferred width. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableColumnPreferredWidth: ChangeTableColumnPreferredWidthCommand; + /** + * Gets a command to change the cell formatting of the selected table elements. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableCellFormatting: ChangeTableCellFormattingCommand; + /** + * Gets a command to insert a table column to the left of the current position in the table. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTableColumnToTheLeft: InsertTableColumnToTheLeftCommand; + /** + * Gets a command to insert a table column to the right of the current position in the table. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTableColumnToTheRight: InsertTableColumnToTheRightCommand; + /** + * Gets a command to insert a row in the table below the selected row. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTableRowBelow: InsertTableRowBelowCommand; + /** + * Gets a command to insert a row in the table above the selected row. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTableRowAbove: InsertTableRowAboveCommand; + /** + * Gets a command to delete the selected rows in the table. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteTableRows: DeleteTableRowsCommand; + /** + * Gets a command to delete the selected columns in the table. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteTableColumns: DeleteTableColumnsCommand; + /** + * Gets a command to insert table cells with a horizontal shift into the selected table. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTableCellWithShiftToTheLeft: InsertTableCellWithShiftToTheLeftCommand; + /** + * Gets a command to delete the selected table cells with a horizontal shift. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteTableCellsWithShiftHorizontally: DeleteTableCellsWithShiftHorizontallyCommand; + /** + * Gets a command to delete the selected table cells with a vertical shift. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteTableCellsWithShiftVertically: DeleteTableCellsWithShiftVerticallyCommand; + /** + * Gets a command to delete the selected table. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteTable: DeleteTableCommand; + /** + * Gets a command to invoke the Insert Cells dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTableCellsDialog: InsertTableCellsDialogCommand; + /** + * Gets a command to invoke the Delete Cells dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + deleteTableCellsDialog: DeleteTableCellsDialogCommand; + /** + * Gets a command to merge the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + mergeTableCells: MergeTableCellsCommand; + /** + * Gets a command to invoke the Split Cells dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + splitTableCellsDialog: SplitTableCellsDialogCommand; + /** + * Gets a command to split the selected table cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + splitTableCells: SplitTableCellsCommand; + /** + * Gets a command to insert table cells with a vertical shift into the selected table. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertTableCellsWithShiftToTheVertically: InsertTableCellsWithShiftToTheVerticallyCommand; + /** + * Gets a command to invoke the Borders tab of the Borders and Shading dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openTableBordersAndShadingDialog: OpenTableBordersAndShadingDialogCommand; + /** + * Gets a command to change the selected table's borders and shading. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableBordersAndShading: ChangeTableBordersAndShadingCommand; + /** + * Gets a command to apply top-left alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignTopLeft: ToggleTableCellAlignTopLeftCommand; + /** + * Gets a command to apply top-center alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignTopCenter: ToggleTableCellAlignTopCenterCommand; + /** + * Gets a command to apply top-right alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignTopRight: ToggleTableCellAlignTopRightCommand; + /** + * Gets a command to apply middle-left alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignMiddleLeft: ToggleTableCellAlignMiddleLeftCommand; + /** + * Gets a command to apply middle-center alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignMiddleCenter: ToggleTableCellAlignMiddleCenterCommand; + /** + * Gets a command to apply middle-right alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignMiddleRight: ToggleTableCellAlignMiddleRightCommand; + /** + * Gets a command to apply bottom-left alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignBottomLeft: ToggleTableCellAlignBottomLeftCommand; + /** + * Gets a command to apply bottom-center alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignBottomCenter: ToggleTableCellAlignBottomCenterCommand; + /** + * Gets a command to apply bottom-right alignment for the selected cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAlignBottomRight: ToggleTableCellAlignBottomRightCommand; + /** + * Gets a command to change the selected table's style. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableStyle: ChangeTableStyleCommand; + /** + * Gets a command to toggle top borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellTopBorder: ToggleTableCellTopBorderCommand; + /** + * Gets a command to toggle right borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellRightBorder: ToggleTableCellRightBorderCommand; + /** + * Gets a command to toggle bottom borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellBottomBorder: ToggleTableCellBottomBorderCommand; + /** + * Gets a command to toggle left borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellLeftBorder: ToggleTableCellLeftBorderCommand; + /** + * Gets a command to remove the borders of the selected table cells. + * Value: A object that provides methods for executing the command and checking its state. + */ + removeTableCellBorders: RemoveTableCellBordersCommand; + /** + * Gets a command to toggle all borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellAllBorders: ToggleTableCellAllBordersCommand; + /** + * Gets a command to toggle inner horizontal borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellInsideHorizontalBorders: ToggleTableCellInsideHorizontalBordersCommand; + /** + * Gets a command to toggle inner vertical borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellInsideVerticalBorders: ToggleTableCellInsideVerticalBordersCommand; + /** + * Gets a command to toggle outer borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + toggleTableCellOutsideBorders: ToggleTableCellOutsideBordersCommand; + /** + * Gets a command to change the selected table's style options. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableLook: ChangeTableLookCommand; + /** + * Gets a command to change the repository item's table border style. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableBorderRepositoryItem: ChangeTableBorderRepositoryItemCommand; + /** + * Gets a command to change cell shading in the selected table elements. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTableCellShading: ChangeTableCellShadingCommand; + /** + * Gets a command to toggle the display of grid lines for a table with no borders applied - on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ + showTableGridLines: ShowTableGridLinesCommand; + /** + * Gets a command to invoke the Search Panel allowing end-users to search text and navigate through search results. + * Value: A object that provides methods for executing the command and checking its state. + */ + openFindPanel: OpenFindPanelCommand; + /** + * Gets a command to invoke the Find and Replace dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openFindAndReplaceDialog: OpenFindAndReplaceDialogCommand; + /** + * Gets a command to find all matches of the specified text in the document. + * Value: A object that provides methods for executing the command and checking its state. + */ + findAll: FindAllCommand; + /** + * Gets a command to hide the results of the search. + * Value: A object that provides methods for executing the command and checking its state. + */ + hideFindResults: HideFindResultsCommand; + /** + * Gets a command to search for a specific text and replace all matches in the document with the specified string. + * Value: A object that provides methods for executing the command and checking its state. + */ + replaceAll: ReplaceAllCommand; + /** + * Gets a command to search for a specific text and replace the next match in the document with the specified string. + * Value: A object that provides methods for executing the command and checking its state. + */ + replaceNext: ReplaceNextCommand; + /** + * Gets a command to invoke the Spelling dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ + openSpellingDialog: OpenSpellingDialogCommand; + /** + * Gets a command to assign a shortcut to the specified client command. + * Value: A object that provides methods for executing the command and checking its state. + */ + assignShortcut: AssignShortcutCommand; + /** + * Gets a command to invoke the Layout dialog window to customize the settings of a floating object. + * Value: A object that provides methods for executing the command and checking its state. + */ + openLayoutOptionsDialog: OpenLayoutOptionsDialogCommand; + /** + * Gets a command to insert a floating text box. + * Value: A object that provides methods for executing the command and checking its state. + */ + insertFloatingTextBox: InsertFloatingTextBoxCommand; + /** + * Gets a command to modify a floating object's alignment position. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectAlignmentPosition: ChangeFloatingObjectAlignmentPositionCommand; + /** + * Gets a command to change a floating object's absolute position. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectAbsolutePosition: ChangeFloatingObjectAbsolutePositionCommand; + /** + * Gets a command to modify a floating object's relative position. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectRelativePosition: ChangeFloatingObjectRelativePositionCommand; + /** + * Gets a command to lock a floating object's anchor. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectLockAnchor: ChangeFloatingObjectLockAnchorCommand; + /** + * Gets a command to modify a floating object's text wrapping settings. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectTextWrapping: ChangeFloatingObjectTextWrappingCommand; + /** + * Gets a command to change a floating object's absolute size. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectAbsoluteSize: ChangeFloatingObjectAbsoluteSizeCommand; + /** + * Gets a command to modify a text box' relative size settings. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTextBoxRelativeSize: ChangeTextBoxRelativeSizeCommand; + /** + * Gets a command to rotate a floating object. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectRotation: ChangeFloatingObjectRotationCommand; + /** + * Gets a command to lock a floating object's aspect ratio. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectLockAspectRatio: ChangeFloatingObjectLockAspectRatioCommand; + /** + * Gets a command to modify a floating object's background fill color. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectFillColor: ChangeFloatingObjectFillColorCommand; + /** + * Gets a command to modify a floating object's outline color. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectOutlineColor: ChangeFloatingObjectOutlineColorCommand; + /** + * Gets a command to modify a floating object's outline width. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeFloatingObjectOutlineWidth: ChangeFloatingObjectOutlineWidthCommand; + /** + * Gets a command to modify a text box' content margins. + * Value: A object that provides methods for executing the command and checking its state. + */ + changeTextBoxContentMargins: ChangeTextBoxContentMarginsCommand; + changeTextBoxResizeShapeToFitText: ChangeTextBoxResizeShapeToFitTextCommand; +} +/** + * Serves as a base for objects that implement different client command functionalities. + */ +interface CommandBase { +} +/** + * Serves as a base for commands with a simple common command state. + */ +interface CommandWithSimpleStateBase extends CommandBase { + /** + * Gets information about the command state. + */ + getState(): SimpleCommandState; +} +/** + * Serves as a base for commands with the Boolean state. + */ +interface CommandWithBooleanStateBase extends CommandBase { + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * Defines a simple state common to most of the client commands. + */ +interface SimpleCommandState { + /** + * Gets a value indicating whether the command's UI element is enabled (within the ribbon and context menu). + * Value: true, if the command's related UI element is enabled; otherwise, false. + */ + enabled: boolean; + /** + * Gets a value indicating whether the command's UI element is visible. + * Value: true, if the command's related UI element is visible; otherwise, false. + */ + visible: boolean; +} +/** + * Defines the state of a command. + */ +interface CommandState extends SimpleCommandState { + /** + * Gets the command state value. + * Value: A T object specifying the command state value. + */ + value: T; +} +/** + * Contains a set properties providing the current information about certain document structural elements. + */ +interface RichEditDocument { + /** + * Provides the information about the active sub-document. + * Value: A object storing information about the essential document functionality. + */ + activeSubDocument: SubDocument; + /** + * Provides information about sections in the current document. + * Value: An array of Section objects storing information about sections. + */ + sectionsInfo: Section[]; + /** + * Provides information about paragraph styles in the current document. + * Value: An array of ParagraphStyle objects storing information about paragraph styles. + */ + paragraphStylesInfo: ParagraphStyle[]; + /** + * Provides information about character styles in the current document. + * Value: An array of CharacterStyle objects storing information about character styles. + */ + characterStylesInfo: CharacterStyle[]; + /** + * Provides information about numbered paragraphs in the document. + * Value: An array of AbstractNumberingList objects storing the information about numbered paragraphs. + */ + abstractNumberingListsInfo: AbstractNumberingList[]; + /** + * Provides information about table styles in the current document. + * Value: An array of TableStyle objects storing information about table styles. + */ + tableStylesInfo: TableStyle[]; + /** + * Provides information about spell checking in the current document. + * Value: A object. + */ + spellingInfo: SpellingInfo; +} +/** + * An abstract numbering list definition that defines the appearance and behavior of numbered paragraphs in a document. + */ +interface AbstractNumberingList { + deleted: boolean; +} +/** + * Defines a paragraph in the document. + */ +interface Paragraph { + /** + * Gets the paragraph's character length. + * Value: An integer value specifying the element length in characters. + */ + length: number; + /** + * Gets the paragraph's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the text buffer interval occupied by the current paragraph element. + * Value: An object specifying the interval settings. + */ + interval: Interval; + /** + * Gets the name of the paragraph style applied to the current paragraph (see name). + * Value: A string value specifying the style name. + */ + styleName: string; + /** + * Gets the index of a list applied to the paragraph. + * Value: An integer that is the index of a list to which the paragraph belongs. + */ + listIndex: number; + /** + * Gets the index of the list level applied to the current paragraph in the numbering list. + * Value: An integer that is the index of the list level of the current paragraph. + */ + listLevelIndex: number; +} +/** + * Defines a field in the document. + */ +interface Field { + /** + * Gets the field's start position in a document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the field length in a document. + * Value: An integer value specifying the field length. + */ + length: number; + /** + * Gets the text buffer interval occupied by the field code element. + * Value: An object specifying the interval settings. + */ + codeInterval: Interval; + /** + * Gets the text buffer interval occupied by the field result element. + * Value: An object specifying the interval settings. + */ + resultInterval: Interval; + /** + * Gets the text buffer interval occupied by the current field element. + * Value: An object specifying the interval settings. + */ + interval: Interval; + /** + * Gets or sets a URI to navigate to when the hyperlink (represented by the current field) is activated. + * Value: A string representing an URI. + */ + hyperlinkUri: string; + /** + * Gets or sets the text for the tooltip displayed when the mouse hovers over a hyperlink field. + * Value: A string containing the tooltip text. + */ + hyperlinkTip: string; + /** + * Gets or sets the name of a bookmark (or a hyperlink) in the current document which shall be the target of the hyperlink field. + * Value: A string representing the bookmark's name. + */ + hyperlinkAnchor: string; + /** + * Gets a value specifying whether a field's code or result is dispalyed. + * Value: true, if the field code is displayed; false, if the field result is displayed. + */ + showCode: boolean; +} +/** + * Defines a bookmark in the document. + */ +interface Bookmark { + /** + * Gets the bookmark's start position in a document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the bookmark's length. + * Value: An integer value specifying the length of the bookmark. + */ + length: number; + /** + * Gets the text buffer interval occupied by the current bookmark element. + * Value: An object specifying the interval settings. + */ + interval: Interval; + /** + * Gets the name of a bookmark in the document. + * Value: A string that is the unique bookmark's name. + */ + name: string; +} +/** + * Defines a section in the document. + */ +interface Section { + /** + * Gets the section's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the section's character length. + * Value: An integer value specifying the element length in characters. + */ + length: number; + /** + * Gets the text buffer interval occupied by the current section element. + * Value: An object specifying the interval settings. + */ + interval: Interval; + /** + * Provides access to the section's headers. + * Value: An array of HeaderFooter objects storing information about the section's headers. + */ + headers: HeaderFooter[]; + /** + * Provides access to the section's footers. + * Value: An array of HeaderFooter objects storing information about the section's footers. + */ + footers: HeaderFooter[]; +} +/** + * Contains settings defining a header or footer in a document. + */ +interface HeaderFooter { + /** + * Gets the type of the header (footer). + * Value: One of the values. + */ + type: any; + /** + * Provides access to an object implementing the basic document functionality that is common to the header, footer and the main document body. + * Value: A object exposing the basic document functionality. + */ + subDocument: SubDocument; +} +/** + * Contains in-line picture settings. + */ +interface InlinePictureInfo { + /** + * Gets the image identifier. + * Value: An integer value specifying the image identifier. + */ + id: number; + /** + * Gets the image position. + * Value: An integer value specifying the image position. + */ + position: number; + /** + * Gets the initial image width. + * Value: An integer value specifying the image width. + */ + initialWidth: number; + /** + * Gets the initial image height. + * Value: An integer value specifying the image height. + */ + initialHeight: number; + /** + * Gets the X-scaling factor of the inline image. + * Value: An integer value specifying the scaling factor for the X-axis. + */ + scaleX: number; + /** + * Gets the Y-scaling factor of the inline image. + * Value: An integer value specifying the scaling factor for the Y-axis. + */ + scaleY: number; + /** + * Gets the actual image width. + * Value: An integer value specifying the image width. + */ + actualWidth: number; + /** + * Gets the actual image height. + * Value: An integer value specifying the image height. + */ + actualHeight: number; +} +declare enum HeaderFooterType { + First=0, + Odd=1, + Primary=1, + Even=2 +} +/** + * Contains the settings defining a file to save to. + */ +interface RichEditFileInfo { + /** + * Gets or sets the file's folder name. + * Value: A string value specifying the folder name. + */ + folderPath: string; + /** + * Gets or sets the file name. + * Value: A string value specifying the file name. + */ + fileName: string; + /** + * Gets or sets the file's document format. + * Value: A DocumentFormat enumeration value. + */ + documentFormat: any; +} +declare enum DocumentFormat { + Undefined=0, + PlainText=1, + Rtf=2, + Html=3, + OpenXml=4, + Mht=5, + WordML=6, + OpenDocument=7, + ePub=9, + Doc=10 +} +/** + * Contains a set of methods and properties to work with the document selection. + */ +interface RichEditSelection { + /** + * Gets or sets an array of document intervals in the selection. + * Value: An array of Interval objects. + */ + intervals: Interval[]; + /** + * Gets or sets a value specifying whether the current selection is collapsed (and represents the cursor position). + * Value: true, if the selection is collapsed; otherwise, false. + */ + collapsed: boolean; + /** + * Gets the maximum position of a document interval in the selection. + */ + getIntervalMaxPosition(): number; + /** + * Moves the cursor to the next line. + */ + goToNextLine(): void; + /** + * Moves the cursor to the next line and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToNextLine(extendSelection: boolean): void; + /** + * Moves the cursor to the end of the line in which the cursor is located. + */ + goToLineEnd(): void; + /** + * Moves the cursor to the end of the line in which the cursor is located and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToLineEnd(extendSelection: boolean): void; + /** + * Moves the cursor to the start of the line in which the cursor is located. + */ + goToLineStart(): void; + /** + * Moves the cursor to the start of the line in which the cursor is located and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToLineStart(extendSelection: boolean): void; + /** + * Moves the cursor to the previous line. + */ + goToPreviousLine(): void; + /** + * Moves the cursor to the previous line and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToPreviousLine(extendSelection: boolean): void; + /** + * Moves the cursor to the next character. + */ + goToNextCharacter(): void; + /** + * Moves the cursor to the next character and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToNextCharacter(extendSelection: boolean): void; + /** + * Moves the cursor to the previous character. + */ + goToPreviousCharacter(): void; + /** + * Moves the cursor to the previous character and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToPreviousCharacter(extendSelection: boolean): void; + /** + * Selects the line in which the cursor is located. + */ + selectLine(): void; + /** + * Selects the line in which the cursor is located and allows you to extend the entire selection with the currently existing selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + selectLine(extendSelection: boolean): void; + /** + * Moves the cursor to the beginning of the next page. + */ + goToNextPage(): void; + /** + * Moves the cursor to the beginning of the next page and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToNextPage(extendSelection: boolean): void; + /** + * Moves the cursor to the beginning of the previous page. + */ + goToPreviousPage(): void; + /** + * Moves the cursor to the beginning of the previous page and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToPreviousPage(extendSelection: boolean): void; + /** + * Moves the cursor to the start of the document. + */ + goToDocumentStart(): void; + /** + * Moves the cursor to the start of the document and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToDocumentStart(extendSelection: boolean): void; + /** + * Moves the cursor to the end of the document. + */ + goToDocumentEnd(): void; + /** + * Moves the cursor to the end of the document and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToDocumentEnd(extendSelection: boolean): void; + /** + * Moves the cursor to the next word. + */ + goToNextWord(): void; + /** + * Moves the cursor to the next word and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToNextWord(extendSelection: boolean): void; + /** + * Moves the cursor to the previous word. + */ + goToPrevWord(): void; + /** + * Moves the cursor to the previous word and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToPrevWord(extendSelection: boolean): void; + /** + * Moves the cursor to the start of the paragraph in which the cursor is located. + */ + goToParagraphStart(): void; + /** + * Moves the cursor to the start of the paragraph in which the cursor is located and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToParagraphStart(extendSelection: boolean): void; + /** + * Moves the cursor to the end of the paragraph in which the cursor is located. + */ + goToParagraphEnd(): void; + /** + * Moves the cursor to the end of the paragraph in which the cursor is located and allows you to extend the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToParagraphEnd(extendSelection: boolean): void; + /** + * Selects the paragraph in which the cursor is located. + */ + selectParagraph(): void; + /** + * Moves the cursor to the next page break mark. + */ + goToStartNextPageCommand(): void; + /** + * Moves the cursor to the next page break mark and extends the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToStartNextPageCommand(extendSelection: boolean): void; + /** + * Moves the cursor to the previous page break mark. + */ + goToStartPrevPageCommand(): void; + /** + * Moves the cursor to the previous page break mark and extends the selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + goToStartPrevPageCommand(extendSelection: boolean): void; + /** + * Selects the table cell in which the cursor is located. + */ + selectTableCell(): void; + /** + * Selects the table cell in which the cursor is located and allows you to extend the entire selection with the currently existing selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + selectTableCell(extendSelection: boolean): void; + /** + * Selects the table row in which the cursor is located. + */ + selectTableRow(): void; + /** + * Selects the table row in which the cursor is located and allows you to extend the entire selection with the currently existing selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + selectTableRow(extendSelection: boolean): void; + /** + * Selects the entire table in which the cursor is located. + */ + selectTable(): void; + /** + * Selects the entire table in which the cursor is located and allows you to extend the entire selection with the currently existing selection. + * @param extendSelection true to extend the selection; otherwise, false. + */ + selectTable(extendSelection: boolean): void; + /** + * Selects the editor's entire content. + */ + selectAll(): void; + /** + * Makes the main sub-document active and moves the cursor to its beginning. + */ + setMainSubDocumentAsActive(): void; + /** + * Creates a footer sub-document (if it was not created before) and sets the footer as the active sub-document. Moves the cursor to the footer's start position. + * @param pageIndex An integer value specifying the active page's index. + */ + setFooterSubDocumentAsActiveByPageIndex(pageIndex: number): void; + /** + * Creates a header sub-document (if it was not created before) and sets the header as the active sub-document. Moves the cursor to the header's start position. + * @param pageIndex An integer value specifying the active page's index. + */ + setHeaderSubDocumentAsActiveByPageIndex(pageIndex: number): void; +} +/** + * Defines a document's interval. + */ +interface Interval { + /** + * Gets the interval's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the interval's character length. + * Value: An integer value specifying the element length in characters. + */ + length: number; +} +/** + * Contains spell checking related settings. + */ +interface SpellingInfo { + /** + * Gets a value specifying the spell checking state. + * Value: One of the enumeration values. + */ + spellCheckerState: any; + /** + * Provides access to an array containing misspelled intervals. + * Value: An array of objects. + */ + misspelledIntervals: MisspelledInterval[]; +} +declare enum SpellCheckerState { + Disabled=0, + InProgress=1, + Done=2 +} +/** + * Contains the settings defining a misspelled interval. + */ +interface MisspelledInterval { + /** + * Gets the start position of the misspelled word in the interval. + * Value: An integer value specifying the misspelled word's start position. + */ + start: number; + /** + * Gets the length of the misspelled interval. + * Value: An integer value specifying the misspelled interval's length. + */ + length: number; + /** + * Gets the text buffer interval occupied by the current element. + * Value: An object specifying the interval settings. + */ + interval: Interval; + /** + * Gets the spelling error type. + * Value: One of the enumeration values. + */ + errorType: any; + /** + * Gets an erroneous word found during spell check. + * Value: A string that is the erroneous or misspelled word. + */ + word: string; + /** + * Gets a list of suggested words to replace the misspelled word. + * Value: A string array containing suggested words. + */ + suggestions: string[]; +} +declare enum SpellingErrorType { + Misspelling=0, + Repeating=1 +} +/** + * Serves as a base for objects implementing different element styles. + */ +interface StyleBase { + /** + * Gets or sets the name of the style. + * Value: A string specifying the style name. + */ + name: string; + /** + * Gets whether the specified style is marked as deleted. + * Value: true, if the style is deleted; otherwise, false. + */ + isDeleted: boolean; +} +/** + * Defines the paragraph style settings. + */ +interface ParagraphStyle extends StyleBase { + /** + * Gets or sets the linked style for the current style. + * Value: A object representing a character style linked to a current style. + */ + linkedStyle: CharacterStyle; + /** + * Gets or sets the default style for a paragraph that immediately follows the current paragraph. + * Value: A object specifying the style for the next paragraph. + */ + nextStyle: ParagraphStyle; + /** + * Gets the index of the list item associated with the paragraph formatted with the current style. + * Value: An integer value specifying the list item index. + */ + listIndex: number; + /** + * Gets the index of the list level applied to the paragraph formatted with the current style. + * Value: An integer that is the list level index. + */ + listLevelIndex: number; + /** + * Gets or sets the style from which the current style inherits. + * Value: A object representing the parent style. + */ + parent: ParagraphStyle; +} +/** + * Contains characteristics of a character style in a document. + */ +interface CharacterStyle extends StyleBase { + /** + * Gets or sets the linked style for the current style. + * Value: A object representing a paragraph style linked to a current style. + */ + linkedStyle: ParagraphStyle; + /** + * Gets the style form which the current style inherits. + * Value: A object representing the parent style. + */ + parent: CharacterStyle; +} +/** + * Defines the table style settings. + */ +interface TableStyle extends StyleBase { + /** + * Gets or sets the style from which the current style inherits. + * Value: A object that is the parent style. + */ + parent: TableStyle; +} +/** + * Exposes the settings providing the information about the essential document functionality. + */ +interface SubDocument { + /** + * Gets the sub-document identifier. + * Value: An integer value specifying the sub-document identifier. + */ + id: number; + /** + * Gets a value specifying the sub-document type. + * Value: One of the enumeration values. + */ + type: any; + /** + * Provides information about paragraphs contained in the document. + * Value: An array of Paragraph objects storing information about document paragraphs. + */ + paragraphsInfo: Paragraph[]; + /** + * Provides information about fields in the current document. + * Value: An array of Field objects storing information about document fields. + */ + fieldsInfo: Field[]; + /** + * Provides information about tables contained in the document. + * Value: An array of Table objects storing information about document tables. + */ + tablesInfo: Table[]; + /** + * Provides information about document bookmarks. + * Value: An array of Bookmark objects storing information about document bookmarks. + */ + bookmarksInfo: Bookmark[]; + /** + * Provides access to an array of objects containing in-line picture settings. + * Value: An array of objects. + */ + inlinePicturesInfo: InlinePictureInfo[]; + /** + * Gets the document's textual representation. + * Value: A string value specifying the document's text. + */ + text: string; + /** + * Gets the character length of the document. + * Value: An integer that is the number of character positions in the document. + */ + length: number; +} +declare enum SubDocumentType { + Main=0, + Header=1, + Footer=2, + TextBox=3 +} +/** + * Defines a table in the document. + */ +interface Table { + /** + * Gets the table's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the table length in characters. + * Value: A integer value specifying the character length of the table. + */ + length: number; + /** + * Gets the text buffer interval occupied by the current table element. + * Value: An object specifying the interval settings. + */ + interval: Interval; + /** + * Provides access to a collection of table rows. + * Value: An array of TableRow objects storing information about individual table rows. + */ + rows: TableRow[]; + /** + * Gets the name of the style applied to the table (see name). + * Value: A string value specifying the style name. + */ + styleName: string; +} +/** + * Defines a table row in the document. + */ +interface TableRow { + /** + * Gets the table row's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the table row's character length. + * Value: An integer value specifying the element length in characters. + */ + length: number; + /** + * Gets the text buffer interval occupied by the current table row element. + * Value: An object specifying the interval settings. + */ + interval: Interval; + /** + * Provides information about the table row's cells. + * Value: An array of TableCell objects storing information about cells. + */ + cells: TableCell[]; +} +/** + * Defines a table cell in the document. + */ +interface TableCell { + /** + * Gets the table cell's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the table cell's character length. + * Value: An integer value specifying the element length in characters. + */ + length: number; + /** + * Gets the text buffer interval occupied by the current table cell element. + * Value: An object specifying the interval settings. + */ + interval: Interval; +} +/** + * Contains the method to convert different units of measurement. + */ +interface RichEditUnitConverter { + /** + * Converts a measurement from pixels to twips. + * @param value The pixels value to be converted. + */ + pixelsToTwips(value: number): number; + /** + * Converts a measurement from inches to twips. + * @param value The inches value (floating) to be converted. + */ + inchesToTwips(value: number): number; + /** + * Converts a measurement from points to twips. + * @param value The points value to be converted. + */ + pointsToTwips(value: number): number; + /** + * Converts a value in centimeters to twips. + * @param value A floating value specifying the value in centimeters to convert. + */ + centimetersToTwips(value: number): number; + /** + * Converts a measurement from twips to centimeters. + * @param value The twips value to be converted. + */ + twipsToCentimeters(value: number): number; + /** + * Converts a measurement from pixels to centimeters. + * @param value The pixels value to be converted. + */ + pixelsToCentimeters(value: number): number; + /** + * Converts a measurement from twips to inches. + * @param value The twips value to be converted. + */ + twipsToInches(value: number): number; + /** + * Converts a measurement from pixels to inches. + * @param value The pixels value to be converted. + */ + pixelsToInches(value: number): number; + /** + * Converts a measurement from pixels to points. + * @param value The pixels value to be converted. + */ + pixelsToPoints(value: number): number; + /** + * Converts a measurement from twips to points. + * @param value The twips value to be converted. + */ + twipsToPoints(value: number): number; +} +/** + * A command to invoke the Bookmark dialog. + */ +interface OpenInsertBookmarkDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenInsertBookmarkDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a new bookmark that references the current selection. + */ +interface InsertBookmarkCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertBookmarkCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param name A string value specifying a name of the created bookmark. + * @param start An integer value specifying the start position of the bookmark's range. + * @param length An integer value specifying the length of the bookmark's range. + */ + execute(name: string, start: number, length: number): boolean; +} +/** + * A command to delete a specific bookmark. + */ +interface DeleteBookmarkCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteBookmarkCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param name A string value specifying a name of the deleted bookmark. + */ + execute(name: string): boolean; +} +/** + * Gets a command to navigate to the specified bookmark in the document. + */ +interface GoToBookmarkCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToBookmarkCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param name + */ + execute(name: string): boolean; +} +/** + * A command to paste the text from the clipboard over the selection. + */ +interface PasteCommand extends CommandWithSimpleStateBase { + /** + * Executes the PasteCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to copy the selected text and place it to the clipboard. + */ +interface CopyCommand extends CommandWithSimpleStateBase { + /** + * Executes the CopyCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to cut the selected text and place it to the clipboard. + */ +interface CutCommand extends CommandWithSimpleStateBase { + /** + * Executes the CutCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert an empty document field at the current position in the document. + */ +interface CreateFieldCommand extends CommandWithSimpleStateBase { + /** + * Executes the CreateFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to update the field's result. + */ +interface UpdateFieldCommand extends CommandWithSimpleStateBase { + /** + * Executes the UpdateFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to display the selected field's field codes. + */ +interface ShowFieldCodesCommand extends CommandWithSimpleStateBase { + /** + * Executes the ShowFieldCodesCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param showFieldCodes true to display field codes, false to hide field codes. + */ + execute(showFieldCodes: boolean): boolean; + /** + * Executes the ShowFieldCodesCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to display all field codes in place of the fields in the document. + */ +interface ShowAllFieldCodesCommand extends CommandWithSimpleStateBase { + /** + * Executes the ShowAllFieldCodesCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param showFieldCodes true to display field codes, false to hide field codes. + */ + execute(showFieldCodes: boolean): boolean; + /** + * Executes the ShowAllFieldCodesCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to update all fields in the selected range. + */ +interface UpdateAllFieldsCommand extends CommandWithSimpleStateBase { + /** + * Executes the UpdateAllFieldsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a DATE field displaying the current date. + */ +interface CreateDateFieldCommand extends CommandWithSimpleStateBase { + /** + * Executes the CreateDateFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a TIME field displaying the current time. + */ +interface CreateTimeFieldCommand extends CommandWithSimpleStateBase { + /** + * Executes the CreateTimeFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a PAGE field displaying the current page number. + */ +interface CreatePageFieldCommand extends CommandWithSimpleStateBase { + /** + * Executes the CreatePageFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the next data record of the bound data source. + */ +interface GoToDataRecordCommand extends CommandBase { + /** + * Executes the GoToDataRecordCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param activeRecordIndex An integer value specifying index of the next data record. + */ + execute(activeRecordIndex: number): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * Contains the settings defining a data record. + */ +interface DataRecordOptions { + /** + * Gets or sets the index of the active data record. + * Value: An integer value specifying the data record index. + */ + activeRecordIndex: number; + recordCount: number; +} +/** + * A command to navigate to the first data record of the bound data source. + */ +interface GoToFirstDataRecordCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToFirstDataRecordCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the previous data record of the bound data source. + */ +interface GoToPreviousDataRecordCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToPreviousDataRecordCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the next data record of the bound data source. + */ +interface GoToNextDataRecordCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToNextDataRecordCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the last data record of the bound data source. + */ +interface GoToLastDataRecordCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToLastDataRecordCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to display or hide actual data in MERGEFIELD fields. + */ +interface ShowMergedDataCommand extends CommandWithBooleanStateBase { + /** + * Executes the ShowMergedDataCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ShowMergedDataCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param showMergedData true to display merged data, false to hide merged data. + */ + execute(showMergedData: boolean): boolean; +} +/** + * A command to invoke the Insert Merge Field dialog. + */ +interface MergeFieldDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the MergeFieldDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a MERGEFIELD field (with a data source column name) at the current position in the document. + */ +interface CreateMergeFieldCommand extends CommandWithSimpleStateBase { + /** + * Executes the CreateMergeFieldCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fieldName A string value specifying the name of the merge field. + */ + execute(fieldName: string): boolean; +} +/** + * Gets a command to invoke the Export Range dialog to start a mail merge. + */ +interface MailMergeDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the MailMergeDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to start the mail merge process and download the resulting document containing the merged information. + */ +interface MailMergeAndDownloadCommand extends CommandBase { + /** + * Executes the MailMergeAndDownloadCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fileExtension A string value specifying the file extension of the resulting document. + */ + execute(fileExtension: string): boolean; + /** + * Executes the MailMergeAndDownloadCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param documentFormat One of the DocumentFormat enumeration values. + */ + execute(documentFormat: any): boolean; + /** + * Executes the MailMergeAndDownloadCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fileExtension A string value specifying the file extension of the resulting document. + * @param settings A MailMergeSettings object containing settings to set up mail merge operations. + */ + execute(fileExtension: string, settings: MailMergeSettings): boolean; + /** + * Executes the MailMergeAndDownloadCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param documentFormat One of the DocumentFormat enumeration values. + * @param settings A MailMergeSettings object specifying the mail merge settings. + */ + execute(documentFormat: any, settings: MailMergeSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to start the mail merge process and save the resulting merged document to the server. + */ +interface MailMergeAndSaveAsCommand extends CommandBase { + /** + * Executes the MailMergeAndSaveAsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param filePath A string value specifying path to the saving file on the server. + */ + execute(filePath: string): boolean; + /** + * Executes the MailMergeAndSaveAsCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fileInfo A RichEditFileInfo object specifying a file to save to. + * @param settings A MailMergeSettings object specifying the mail merge settings. + */ + execute(fileInfo: RichEditFileInfo, settings: MailMergeSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to insert a NUMPAGES field displaying the total number of pages. + */ +interface CreatePageCountFieldCommand extends CommandWithSimpleStateBase { + /** + * Executes the CreatePageCountFieldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * Contains settings to set up mail merge operations. + */ +interface MailMergeSettings { + /** + * Gets or sets a value specifying which data rows should be exported into a merged document. + * Value: One of the values. + */ + range: any; + /** + * Gets or sets the index of the row from which the exported range starts. + * Value: An integer value specifying the row index. + */ + exportFrom: number; + /** + * Gets or sets the number of data rows in the exported mail-merge range. + * Value: An integer value specifying the row count. + */ + exportRecordsCount: number; + /** + * Gets or sets the merge mode. + * Value: One of the values. + */ + mergeMode: any; +} +declare enum MergeMode { + NewParagraph=0, + NewSection=1, + JoinTables=2 +} +declare enum MailMergeExportRange { + AllRecords=0, + CurrentRecord=1, + Range=2 +} +/** + * A command to create a new empty document. + */ +interface FileNewCommand extends CommandWithSimpleStateBase { + /** + * Executes the FileNewCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to open the file, specifying its path. + */ +interface FileOpenCommand extends CommandWithSimpleStateBase { + /** + * Executes the FileOpenCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param path A string value specifying path to the opening file. + */ + execute(path: string): boolean; +} +/** + * A command to invoke the File Open dialog allowing one to select and load a document file into RichEdit. + */ +interface FileOpenDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the FileOpenDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to save the document to a file. + */ +interface FileSaveCommand extends CommandWithSimpleStateBase { + /** + * Executes the FileSaveCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Save As dialog that prompts for a file name and saves the current document in a file with the specified path. + */ +interface FileSaveAsCommand extends CommandWithSimpleStateBase { + /** + * Executes the FileSaveAsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param path A string value specifying path to the saving file. + */ + execute(path: string): boolean; + /** + * Executes the FileSaveAsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fileInfo A object specifying a file to save to. + */ + execute(fileInfo: RichEditFileInfo): boolean; +} +/** + * A command to download the document file, specifying its extension. + */ +interface FileDownloadCommand extends CommandWithSimpleStateBase { + /** + * Executes the FileDownloadCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fileExtension A string value specifying the extension of the downloading file. + */ + execute(fileExtension: string): boolean; + /** + * Executes the FileDownloadCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param documentFormat A DocumentFormat enumeration value. + */ + execute(documentFormat: any): boolean; +} +/** + * A command to open the file's Save As dialog. + */ +interface FileSaveAsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the FileSaveAsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke a browser-specific Print dialog allowing one to print the current document. + */ +interface FilePrintCommand extends CommandWithSimpleStateBase { + /** + * Executes the FilePrintCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Search Panel allowing end-users to search text and navigate through search results. + */ +interface OpenFindPanelCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenFindPanelCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Find and Replace dialog. + */ +interface OpenFindAndReplaceDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenFindAndReplaceDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to find all matches of the specified text in the document. + */ +interface FindAllCommand extends CommandWithSimpleStateBase { + /** + * Executes the FindAllCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param text A string value specifying finding text. + * @param matchCase true, to perform a case-sensitive search; otherwise, false. + * @param highlightResults true, to highlight result of search; otherwise, false. + */ + execute(text: string, matchCase: boolean, highlightResults: boolean): boolean; + /** + * Executes the FindAllCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param text A string value specifying text to find. + * @param matchCase true, to perform a case-sensitive search; otherwise, false. + * @param highlightResults true, to highlight result of search; otherwise, false. + * @param results An array of Interval objects containing the results of search. + */ + execute(text: string, matchCase: boolean, highlightResults: boolean, results: Interval[]): boolean; +} +/** + * A command to hide the search results. + */ +interface HideFindResultsCommand extends CommandWithSimpleStateBase { + /** + * Executes the HideFindResultsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to search for a specific text and replace all matches in the document with the specified string. + */ +interface ReplaceAllCommand extends CommandWithSimpleStateBase { + /** + * Executes the ReplaceAllCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param text A string value specifying a text to replace. + * @param replaceText A string value specifying the replacing text. + * @param matchCase true, to perform a case-sensitive search; otherwise, false. + */ + execute(text: string, replaceText: string, matchCase: boolean): boolean; +} +/** + * A command to search for a specific text and replace the next match in the document with the specified string. + */ +interface ReplaceNextCommand extends CommandWithSimpleStateBase { + /** + * Executes the ReplaceNextCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param text A string value specifying text to replace. + * @param replaceText A string value specifying replacing text. + * @param matchCase true, to perform a case-sensitive search; otherwise, false. + */ + execute(text: string, replaceText: string, matchCase: boolean): boolean; +} +interface OpenLayoutOptionsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenLayoutOptionsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a floating text box. + */ +interface InsertFloatingTextBoxCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertFloatingTextBoxCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to lock a floating object's anchor. + */ +interface ChangeFloatingObjectLockAnchorCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectLockAnchorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param lockAnchor true to lock the anchor; false, otherwise. + */ + execute(lockAnchor: boolean): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a floating object's alignment position. + */ +interface ChangeFloatingObjectAlignmentPositionCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectAlignmentPositionCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A FloatingObjectAlignmentPositionSettings object specifying alignment position settings. + */ + execute(settings: FloatingObjectAlignmentPositionSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change a floating object's absolute position. + */ +interface ChangeFloatingObjectAbsolutePositionCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectAbsolutePositionCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A FloatingObjectAbsolutePositionSettings object specifying page margin settings. + */ + execute(settings: FloatingObjectAbsolutePositionSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a floating object's relative position. + */ +interface ChangeFloatingObjectRelativePositionCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectRelativePositionCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A FloatingObjectRelativePositionSettings object specifying relative positioin settings. + */ + execute(settings: FloatingObjectRelativePositionSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a floating object's text wrapping settings. + */ +interface ChangeFloatingObjectTextWrappingCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectTextWrappingCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A FloatingObjectTextWrappingSettings object specifying text wrapping settings. + */ + execute(settings: FloatingObjectTextWrappingSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change a floating object's absolute size. + */ +interface ChangeFloatingObjectAbsoluteSizeCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectAbsoluteSizeCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A FloatingObjectAbsoluteSizeSettings object specifying absolute size settings. + */ + execute(settings: FloatingObjectAbsoluteSizeSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a text box' relative size settings. + */ +interface ChangeTextBoxRelativeSizeCommand extends CommandBase { + /** + * Executes the ChangeTextBoxRelativeSizeCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A TextBoxRelativeSizeSettings object specifying relative size settings. + */ + execute(settings: TextBoxRelativeSizeSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to rotate a floating object. + */ +interface ChangeFloatingObjectRotationCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectRotationCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param rotation An integer value specifying the angle of rotation. + */ + execute(rotation: number): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to lock a floating object's aspect ratio. + */ +interface ChangeFloatingObjectLockAspectRatioCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectLockAspectRatioCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param lockAspectRatio true to lock the aspect ratio and maintain the proportions; otherwise, false. + */ + execute(lockAspectRatio: boolean): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a floating object's background fill color. + */ +interface ChangeFloatingObjectFillColorCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectFillColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param color A string value specifying the color. + */ + execute(color: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a floating object's outline color. + */ +interface ChangeFloatingObjectOutlineColorCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectOutlineColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param color A string value specifying the color. + */ + execute(color: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a floating object's outline width. + */ +interface ChangeFloatingObjectOutlineWidthCommand extends CommandBase { + /** + * Executes the ChangeFloatingObjectOutlineWidthCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param width An integer value specifying the outline width. + */ + execute(width: number): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to modify a text box' content margins. + */ +interface ChangeTextBoxContentMarginsCommand extends CommandBase { + /** + * Executes the ChangeTextBoxContentMarginsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A Margins object specifying margin settings. + */ + execute(settings: Margins): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +interface ChangeTextBoxResizeShapeToFitTextCommand extends CommandBase { + execute(resizeShapeToFitText: boolean): boolean; + getState(): any; +} +/** + * Contains alignment position settings for floating objects. + */ +interface FloatingObjectAlignmentPositionSettings { + /** + * Gets or sets a value specifying how a floating object is horizontally aligned relative to an element specified by the horizontalPositionAlignment property. + * Value: One of the enumeration values. + */ + horizontalPositionAlignment: any; + /** + * Gets or sets a value specifying to what element the horizontal alignment of a floating object is relative. + * Value: One of the enumeration values. + */ + horizontalPositionType: any; + /** + * Gets or sets a value specifying how a floating object is vertically aligned relative to an element specified by the verticalPositionAlignment property. + * Value: One of the enumeration values. + */ + verticalPositionAlignment: any; + /** + * Gets or sets a value specifying to what element the vertical alignment of a floating object is relative. + * Value: One of the enumeration values. + */ + verticalPositionType: any; +} +/** + * Contains page margin settings. + */ +interface FloatingObjectAbsolutePositionSettings { + /** + * Gets or sets a floating object's horizontal position relative to an element specified by the horizontalPositionType property. + * Value: An integer value specifying the position. + */ + horizontalAbsolutePosition: number; + /** + * Gets or sets a value specifying to what element the horizontal position of a floating object is relative. + * Value: One of the enumeration values. + */ + horizontalPositionType: any; + /** + * Gets or sets a floating object's vertical position relative to an element specified by the verticalPositionType property. + * Value: An integer value specifying the position. + */ + verticalAbsolutePosition: number; + /** + * Gets or sets a value specifying to what element the vertical position of a floating object is relative. + * Value: One of the enumeration values. + */ + verticalPositionType: any; +} +/** + * Contains relative position settings for floating objects. + */ +interface FloatingObjectRelativePositionSettings { + /** + * Gets or sets the horizontal distance between the edge of a floating object and the element specified by the horizontalRelativePosition property + * Value: An integer value specifying the horizontal position. + */ + horizontalRelativePosition: number; + /** + * Gets or sets a value specifying to what element the horizontal position of a floating object is relative. + * Value: One of the enumeration values. + */ + horizontalPositionType: any; + /** + * Gets or sets the horizontal distance between the edge of a floating object and the element specified by the verticalRelativePosition property + * Value: An integer value specifying the vertical position. + */ + verticalRelativePosition: number; + /** + * Gets or sets a value specifying to what element the vertical position of a floating object is relative. + * Value: One of the enumeration values. + */ + verticalPositionType: any; +} +/** + * Contains text wrapping settings for floating objects. + */ +interface FloatingObjectTextWrappingSettings { + /** + * Gets or sets a value specifying how text is wrapped around a floating object. + * Value: One of the enumeration values. + */ + floatingObjectTextWrapType: any; + /** + * Gets or sets a value specifying how text can wrap around a floating object's left and right sides. + * Value: One of the enumeration values. + */ + floatingObjectTextWrapSide: any; + /** + * Gets or sets the left offset of text wrapping. + * Value: An integer value specifying the left offset. + */ + leftDistance: number; + /** + * Gets or sets the right offset of text wrapping. + * Value: An integer value specifying the right offset. + */ + rightDistance: number; + /** + * Gets or sets the top offset of text wrapping. + * Value: An integer value specifying the top offset. + */ + topDistance: number; + /** + * Gets or sets the bottom offset of text wrapping. + * Value: An integer value specifying the bottom offset. + */ + bottomDistance: number; +} +/** + * Contains absolute size settings for floating objects. + */ +interface FloatingObjectAbsoluteSizeSettings { + /** + * Gets or sets a floating object's absolute width. + * Value: An integer value specifying the width. + */ + absoluteWidth: number; + /** + * Gets or sets a floating object's absolute height. + * Value: An integer value specifying the height. + */ + absoluteHeight: number; +} +/** + * Contains relative size settings for floating objects. + */ +interface TextBoxRelativeSizeSettings { + /** + * Gets or sets the percentage specifying a floating object's width relative to the element defined by the relativeWidthType property. + * Value: An integer value specifying the relative width, as a percentage. + */ + relativeWidth: number; + /** + * Gets or sets a value specifying to what element the floating object width is relative. + * Value: One of the enumeration values. + */ + relativeWidthType: any; + /** + * Gets or sets the percentage specifying a floating object's height relative to the element defined by the relativeHeightType property. + * Value: An integer value specifying the relative height, as a percentage. + */ + relativeHeight: number; + /** + * Gets or sets a value specifying to what element the floating object height is relative. + * Value: One of the enumeration values. + */ + relativeHeightType: any; +} +declare enum FloatingObjectRelativeWidthType { + Margin=0, + Page=1, + LeftMargin=2, + RightMargin=3, + InsideMargin=4, + OutsideMargin=5 +} +declare enum FloatingObjectRelativeHeightType { + Margin=0, + Page=1, + TopMargin=2, + BottomMargin=3, + InsideMargin=4, + OutsideMargin=5 +} +declare enum FloatingObjectTextWrapType { + None=0, + TopAndBottom=1, + Tight=2, + Through=3, + Square=4 +} +declare enum FloatingObjectTextWrapSide { + Both=0, + Left=1, + Right=2, + Largest=3 +} +declare enum FloatingObjectHorizontalPositionType { + Page=0, + Character=1, + Column=2, + Margin=3, + LeftMargin=4, + RightMargin=5, + InsideMargin=6, + OutsideMargin=7 +} +declare enum FloatingObjectHorizontalPositionAlignment { + None=0, + Left=1, + Center=2, + Right=3, + Inside=4, + Outside=5 +} +declare enum FloatingObjectVerticalPositionType { + Page=0, + Line=1, + Paragraph=2, + Margin=3, + TopMargin=4, + BottomMargin=5, + InsideMargin=6, + OutsideMargin=7 +} +declare enum FloatingObjectVerticalPositionAlignment { + None=0, + Top=1, + Center=2, + Bottom=3, + Inside=4, + Outside=5 +} +/** + * A command to cancel changes caused by the previous command. + */ +interface UndoCommand extends CommandWithSimpleStateBase { + /** + * Executes the UndoCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to reverse actions of the previous undo command. + */ +interface RedoCommand extends CommandWithSimpleStateBase { + /** + * Executes the RedoCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Hyperlink dialog. + */ +interface OpenInsertHyperlinkDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenInsertHyperlinkDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a hyperlink at the current position in the document. + */ +interface InsertHyperlinkCommand extends CommandBase { + /** + * Executes the InsertHyperlinkCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A HyperLinkSettings object specifying hyperlink settings. + */ + execute(settings: HyperlinkSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to delete the selected hyperlink. + */ +interface DeleteHyperlinkCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteHyperlinkCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to delete all hyperlinks in a selected range. + */ +interface DeleteHyperlinksCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteHyperlinksCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the document bookmark or URI (uniform resource identifier) specified for the hyperlink. + */ +interface OpenHyperlinkCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenHyperlinkCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * Contains settings to define hyperlinks. + */ +interface HyperlinkSettings { + /** + * Gets or sets a text displayed for a hyperlink. + * Value: A string value specifying the hyperlink display text. + */ + text: string; + /** + * Gets or sets a text for the tooltip displayed when the mouse hovers over a hyperlink. + * Value: A string containing the tooltip text. + */ + tooltip: string; + /** + * Gets or sets the hyperlink destination. + * Value: A string value that specifies the destination to which a hyperlink refers. + */ + url: string; + /** + * Gets or sets the associated bookmak. + * Value: A string value specifying the bookmark name. + */ + bookmark: string; +} +/** + * A command to insert a page break at the current position in the document. + */ +interface InsertPageBreakCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertPageBreakCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a column break at the current position in the document. + */ +interface InsertColumnBreakCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertColumnBreakCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a section break and start a new section on the next page. + */ +interface InsertSectionBreakNextPageCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertSectionBreakNextPageCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a section break and start a new section on the next even-numbered page. + */ +interface InsertSectionBreakEvenPageCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertSectionBreakEvenPageCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a section break and start a new section on the next odd-numbered page. + */ +interface InsertSectionBreakOddPageCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertSectionBreakOddPageCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert the line break at the current position in the document. + */ +interface InsertLineBreakCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertLineBreakCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle between the bulleted paragraph and normal text. + */ +interface ToggleBulletedListCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleBulletedListCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle between the numbered paragraph and normal text. + */ +interface ToggleNumberingListCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleNumberingListCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle between the multilevel list style and normal text. + */ +interface ToggleMultilevelListCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleMultilevelListCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Bulleted and Numbering dialog. + */ +interface OpenNumberingListDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenNumberingListDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Customize Numbered List dialog. + */ +interface OpenCustomNumberingListDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenCustomNumberingListDialogCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param abstractNumberingListIndex An integer value specifying index of abstract numbering list. + */ + execute(abstractNumberingListIndex: number): boolean; +} +/** + * A command to customize the numbered list parameters. + */ +interface ChangeCustomNumberingListCommand extends CommandBase { + /** + * Executes the ChangeCustomNumberingListCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param abstractNumberingListIndex An integer value specifying the numbering list index. + * @param listLevelSettings An array of ListLevelSettings objects defining settings for list levels. + */ + execute(abstractNumberingListIndex: number, listLevelSettings: ListLevelSettings[]): boolean; + /** + * Gets information about the command state. + * @param abstractNumberingListIndex An integer value specifying the index of the abstract numbering list item whose state to return. + */ + getState(abstractNumberingListIndex: number): any; +} +/** + * A command to restart the numbering list. + */ +interface RestartNumberingListCommand extends CommandWithSimpleStateBase { + /** + * Executes the RestartNumberingListCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to increment the indent level of paragraphs in a selected numbered list. + */ +interface IncrementNumberingIndentCommand extends CommandWithSimpleStateBase { + /** + * Executes the IncrementNumberingIndentCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to decrement the indent level of paragraphs in a selected numbered list. + */ +interface DecrementNumberingIndentCommand extends CommandWithSimpleStateBase { + /** + * Executes the DecrementNumberingIndentCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to continue the list's numbering. + */ +interface ContinueNumberingListCommand extends CommandWithSimpleStateBase { + /** + * Executes the ContinueNumberingListCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert numeration to a paragraph making it a numbering list item. + */ +interface InsertNumerationCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertNumerationCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param abstractNumberingListIndex An integer value specifying index of abstract numbering list. + */ + execute(abstractNumberingListIndex: number): boolean; + /** + * Executes the InsertNumerationCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param numberingListIndex An integer value specifying an index of the numbering list. + * @param isAbstractNumberingList true, to insert an abstract numbering list; otherwise, false. + */ + execute(numberingListIndex: number, isAbstractNumberingList: boolean): boolean; +} +/** + * A command to remove the selected numeration. + */ +interface RemoveNumerationCommand extends CommandWithSimpleStateBase { + /** + * Executes the RemoveNumerationCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * Contains settings to define individual bulleted or numbered list levels. + */ +interface ListLevelSettings { + /** + * Gets or sets the pattern used to format the list level for display purposes. + * Value: A string value specifying the format pattern. + */ + displayFormatString: string; + /** + * Gets or sets the numbering format used for the current list level's paragraph. + * Value: One of the values. + */ + format: any; + /** + * Gets the list level item's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets or sets the paragraph text alignment within numbered list levels. + * Value: One of the values. + */ + alignment: any; + /** + * Gets or sets the character inserted after the number for a numbered list item. + * Value: A string value that is the trailing character for the list level. + */ + separator: string; + /** + * Gets or sets the left indent for text within the current list level's paragraph. + * Value: An integer value specifying the left indent. + */ + leftIndent: number; + /** + * Gets or sets a value specifying the indent of the first line of the current list level's paragraph. + * Value: An integer value specifying the indent. + */ + firstLineIndent: number; + /** + * Gets or sets a value specifying whether and how the first line of the current list level's paragraph is indented. + * Value: One of the values. + */ + firstLineIndentType: any; + /** + * Gets or sets the font name of the current list level's paragraph. + * Value: A string value specifying the font name. + */ + fontName: string; + /** + * Gets or sets the font color of the current list level's paragraph. + * Value: A string value specifying the font color. + */ + fontColor: string; + /** + * Gets or sets the font size of the current list level's paragraph. + * Value: An integer value specifying the font size. + */ + fontSize: number; + /** + * Gets or sets whether the font formatting of the current list level's paragraph is bold. + * Value: true, if the font formatting is bold; otherwise, false. + */ + fontBold: boolean; + /** + * Gets or sets whether the font formatting of the current list level's paragraph is italic. + * Value: true, if the font formatting is italic; otherwise, false. + */ + fontItalic: boolean; +} +declare enum ListLevelFormat { + Decimal=0, + AIUEOHiragana=1, + AIUEOFullWidthHiragana=2, + ArabicAbjad=3, + ArabicAlpha=4, + Bullet=5, + CardinalText=6, + Chicago=7, + ChineseCounting=8, + ChineseCountingThousand=9, + ChineseLegalSimplified=10, + Chosung=11, + DecimalEnclosedCircle=12, + DecimalEnclosedCircleChinese=13, + DecimalEnclosedFullstop=14, + DecimalEnclosedParentheses=15, + DecimalFullWidth=16, + DecimalFullWidth2=17, + DecimalHalfWidth=18, + DecimalZero=19, + Ganada=20, + Hebrew1=21, + Hebrew2=22, + Hex=23, + HindiConsonants=24, + HindiDescriptive=25, + HindiNumbers=26, + HindiVowels=27, + IdeographDigital=28, + IdeographEnclosedCircle=29, + IdeographLegalTraditional=30, + IdeographTraditional=31, + IdeographZodiac=32, + IdeographZodiacTraditional=33, + Iroha=34, + IrohaFullWidth=35, + JapaneseCounting=36, + JapaneseDigitalTenThousand=37, + JapaneseLegal=38, + KoreanCounting=39, + KoreanDigital=40, + KoreanDigital2=41, + KoreanLegal=42, + LowerLetter=43, + LowerRoman=44, + None=45, + NumberInDash=46, + Ordinal=47, + OrdinalText=48, + RussianLower=49, + RussianUpper=50, + TaiwaneseCounting=51, + TaiwaneseCountingThousand=52, + TaiwaneseDigital=53, + ThaiDescriptive=54, + ThaiLetters=55, + ThaiNumbers=56, + UpperLetter=57, + UpperRoman=58, + VietnameseDescriptive=59 +} +declare enum ListLevelNumberAlignment { + Left=0, + Center=1, + Right=2 +} +/** + * A command to invoke the Insert Image dialog. + */ +interface OpenInsertPictureDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenInsertPictureDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a picture from a file. + */ +interface InsertPictureCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertPictureCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param imageUrl A string value specifying picture's Url. + */ + execute(imageUrl: string): boolean; +} +/** + * A command to invoke the Symbols dialog. + */ +interface OpenInsertSymbolDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenInsertSymbolDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a character into the document. + */ +interface InsertSymbolCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertSymbolCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param symbol A string value specifying symbols to insert. + * @param fontName A string value specifying the font of symbols to insert. + */ + execute(symbol: string, fontName: string): boolean; +} +/** + * A command to insert a paragraph break at the current position in the document. + */ +interface InsertParagraphCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertParagraphCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert text at the current position in the document. + */ +interface InsertTextCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTextCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param text A string value specifying a text to insert. + */ + execute(text: string): boolean; +} +/** + * A command to delete the text in a selected range. + */ +interface DeleteCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to remove the previous word. + */ +interface RemovePrevWordCommand extends CommandWithSimpleStateBase { + /** + * Executes the RemovePrevWordCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to remove the next word. + */ +interface RemoveNextWordCommand extends CommandWithSimpleStateBase { + /** + * Executes the RemoveNextWordCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to move the cursor backwards and erase the character in that space. + */ +interface BackspaceCommand extends CommandWithSimpleStateBase { + /** + * Executes the BackspaceCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to scale pictures in a selected range. + */ +interface ChangePictureScaleCommand extends CommandBase { + /** + * Executes the ChangePictureScaleCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param scale A Scale object specifying scaling of the picture. + */ + execute(scale: Scale): boolean; + /** + * Executes the ChangePictureScaleCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param x An interger number specifying width of the picture + * @param y An interger number specifying height of the picture + */ + execute(x: number, y: number): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to move the selected range to a specific position in the document. + */ +interface MoveContentCommand extends CommandWithSimpleStateBase { + /** + * Executes the MoveContentCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param position An integer value specifying position to insert selected text. + */ + execute(position: number): boolean; +} +/** + * A command to copy the selected text and place it to the specified position. + */ +interface CopyContentCommand extends CommandWithSimpleStateBase { + /** + * Executes the CopyContentCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param position An integer number value specifying position for pasting selected text. + */ + execute(position: number): boolean; +} +/** + * A command to insert a tab character at the current position in the document. + */ +interface InsertTabCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTabCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * Defines the scaling settings. + */ +interface Scale { + /** + * Gets or sets the image's y-scale factor as a percent. + * Value: An integer value that is the y-scale factor as a percent. + */ + x: number; + /** + * Gets or sets the image's x-scale factor as a percent. + * Value: An integer value that is the x-scale factor as a percent. + */ + y: number; +} +/** + * A command to change page margin settings. + */ +interface ChangePageMarginsCommand extends CommandBase { + /** + * Executes the ChangePageMarginsCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param left An integer number specifying left margin of the page. + * @param top An integer number specifying top margin of the page. + * @param right An integer number specifying right margin of the page. + * @param bottom An integer number specifying bottom margin of the page. + */ + execute(left: number, top: number, right: number, bottom: number): boolean; + /** + * Executes the ChangePageMarginsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param margins A Margins object specifying page margin settings. + */ + execute(margins: Margins): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to invoke the Margins tab of the Page Setup dialog. + */ +interface OpenPageMarginsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenPageMarginsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the page orientation. + */ +interface ChangePageOrientationCommand extends CommandBase { + /** + * Executes the ChangePageOrientationCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param isPortrait One of the Orientation enumeration values. + */ + execute(isPortrait: any): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to invoke the Paper tab of the Page Setup dialog. + */ +interface OpenPagePaperSizeDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenPagePaperSizeDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to set the page size. + */ +interface SetPageSizeDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the SetPageSizeDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the page size. + */ +interface ChangePageSizeCommand extends CommandBase { + /** + * Executes the ChangePageSizeCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param width An integer number specifying width of the page. + * @param height An integer number specifying height of the page. + */ + execute(width: number, height: number): boolean; + /** + * Executes the ChangePageSizeCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param size A Size object specifying the page size settings. + */ + execute(size: Size): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the number of section columns having the same width. + */ +interface ChangeSectionEqualColumnCountCommand extends CommandBase { + /** + * Executes the ChangeSectionEqualColumnCountCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param columnCount An interger number specifying the number of section columns having the same width. + */ + execute(columnCount: number): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to invoke the Columns dialog. + */ +interface OpenSectionColumnsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenSectionColumnsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the settings of individual section columns. + */ +interface ChangeSectionColumnsCommand extends CommandBase { + /** + * Executes the ChangeSectionColumnsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param columns An array of SectionColumn objects. + */ + execute(columns: SectionColumn[]): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the background color of the page. + */ +interface ChangePageColorCommand extends CommandBase { + /** + * Executes the ChangePageColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param color A string specifying a background color the page. May be specified as a color name or a hex color value. + */ + execute(color: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to activate the page header and begin editing. + */ +interface InsertHeaderCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertHeaderCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to activate the page footer and begin editing. + */ +interface InsertFooterCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertFooterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to link a header/footer to the previous section, so it has the same content. + */ +interface LinkHeaderFooterToPreviousCommand extends CommandWithSimpleStateBase { + /** + * Executes the LinkHeaderFooterToPreviousCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the page footer from the page header in the header/footer editing mode. + */ +interface GoToFooterCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToFooterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the page header from the page footer in the header/footer editing mode. + */ +interface GoToHeaderCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToHeaderCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the next page header or footer in the header/footer editing mode. + */ +interface GoToNextHeaderFooterCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToNextHeaderFooterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to navigate to the previous page header or footer in the header/footer editing mode. + */ +interface GoToPreviousHeaderFooterCommand extends CommandWithSimpleStateBase { + /** + * Executes the GoToPreviousHeaderFooterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the header/footer edit mode, so it allows creation of a different header or footer for the first page of a document or section. + */ +interface SetDifferentFirstPageHeaderFooterCommand extends CommandWithBooleanStateBase { + /** + * Executes the SetDifferentFirstPageHeaderFooterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the SetDifferentFirstPageHeaderFooterCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param differentFirstPage true to apply a different text for the first page's header and footer, false to remove the difference. + */ + execute(differentFirstPage: boolean): boolean; +} +/** + * A command to change the header/footer edit mode so it allows creation of a different header or footer for odd and even pages of a document or section. + */ +interface SetDifferentOddAndEvenPagesHeaderFooterCommand extends CommandWithBooleanStateBase { + /** + * Executes the SetDifferentOddAndEvenPagesHeaderFooterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the SetDifferentOddAndEvenPagesHeaderFooterCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param differentOddAndEvenPages true to apply a different text for the header and footer of the odd and even pages , false to remove the difference. + */ + execute(differentOddAndEvenPages: boolean): boolean; +} +/** + * A command to finish header/footer editing. + */ +interface CloseHeaderFooterCommand extends CommandWithSimpleStateBase { + /** + * Executes the CloseHeaderFooterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * Defines a section column in the document. + */ +interface SectionColumn { + /** + * Gets or sets the width of the section column. + * Value: An integer value specifying the section column width. + */ + width: number; + /** + * Gets or sets the amount of space between adjacent section columns. + * Value: An integer value specifying the spacing between section columns. + */ + spacing: number; +} +/** + * Defines the size settings. + */ +interface Size { + /** + * Gets or sets the width value. + * Value: An integer value specifying the width. + */ + width: number; + /** + * Gets or sets the height value. + * Value: An integer value specifying the height. + */ + height: number; +} +/** + * Defines the margin settings. + */ +interface Margins { + /** + * Gets or sets the left margin. + * Value: An integer value specifying the left margin. + */ + left: number; + /** + * Gets or sets the top margin. + * Value: An integer value specifying the top margin. + */ + top: number; + /** + * Gets or sets the right margin. + * Value: An integer value specifying the right margin. + */ + right: number; + /** + * Gets or sets the bottom margin. + * Value: An integer value specifying the bottom margin. + */ + bottom: number; +} +declare enum Orientation { + Landscape=0, + Portrait=1 +} +/** + * A command to increment the indent level of paragraphs in a selected range. + */ +interface IncreaseIndentCommand extends CommandWithSimpleStateBase { + /** + * Executes the IncreaseIndentCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to decrement the indent level of paragraphs in a selected range. + */ +interface DecreaseIndentCommand extends CommandWithSimpleStateBase { + /** + * Executes the DecreaseIndentCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle the visibility of hidden symbols. + */ +interface ShowHiddenSymbolsCommand extends CommandWithBooleanStateBase { + /** + * Executes the ShowHiddenSymbolsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ShowHiddenSymbolsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param show true to display hidden symbols; otherwise, false. + */ + execute(show: boolean): boolean; +} +/** + * A command to toggle left paragraph alignment on and off. + */ +interface ToggleParagraphAlignmentLeftCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleParagraphAlignmentLeftCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle centered paragraph alignment on and off. + */ +interface ToggleParagraphAlignmentCenterCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleParagraphAlignmentCenterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle right paragraph alignment on and off. + */ +interface ToggleParagraphAlignmentRightCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleParagraphAlignmentRightCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle justified paragraph alignment on and off. + */ +interface ToggleParagraphAlignmentJustifyCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleParagraphAlignmentJustifyCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to format a current paragraph with single line spacing. + */ +interface SetSingleParagraphSpacingCommand extends CommandWithBooleanStateBase { + /** + * Executes the SetSingleParagraphSpacingCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to format a current paragraph with one and a half line spacing. + */ +interface SetSesquialteralParagraphSpacingCommand extends CommandWithBooleanStateBase { + /** + * Executes the SetSesquialteralParagraphSpacingCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to format a current paragraph with double line spacing. + */ +interface SetDoubleParagraphSpacingCommand extends CommandWithBooleanStateBase { + /** + * Executes the SetDoubleParagraphSpacingCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to add spacing before a paragraph. + */ +interface AddSpacingBeforeParagraphCommand extends CommandWithSimpleStateBase { + /** + * Executes the AddSpacingBeforeParagraphCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to add spacing after a paragraph. + */ +interface AddSpacingAfterParagraphCommand extends CommandWithSimpleStateBase { + /** + * Executes the AddSpacingAfterParagraphCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to remove spacing before the selected paragraph. + */ +interface RemoveSpacingBeforeParagraphCommand extends CommandWithSimpleStateBase { + /** + * Executes the RemoveSpacingBeforeParagraphCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to remove spacing after the selected paragraph. + */ +interface RemoveSpacingAfterParagraphCommand extends CommandWithSimpleStateBase { + /** + * Executes the RemoveSpacingAfterParagraphCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the background color of paragraphs in a selected range. + */ +interface ChangeParagraphBackColorCommand extends CommandBase { + /** + * Executes the ChangeParagraphBackColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param color A string specifying a background color of the paragraphs in a selected range. May be specified as a color name or a hex color value. + */ + execute(color: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to invoke the Paragraph dialog allowing end-users to set paragraph formatting. + */ +interface OpenParagraphFormattingDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenParagraphFormattingDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the formatting of paragraphs in a selected range. + */ +interface ChangeParagraphFormattingCommand extends CommandBase { + /** + * Executes the ChangeParagraphFormattingCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A ParagraphFormattingSettings object specifying paragraph formatting settings. + */ + execute(settings: ParagraphFormattingSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to increment the left indentation of paragraphs in a selected range. + */ +interface IncrementParagraphLeftIndentCommand extends CommandWithSimpleStateBase { + /** + * Executes the IncrementParagraphLeftIndentCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to decrement the left indentation of paragraphs in a selected range. + */ +interface DecrementParagraphLeftIndentCommand extends CommandWithSimpleStateBase { + /** + * Executes the DecrementParagraphLeftIndentCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Tabs paragraph dialog. + */ +interface OpenTabsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenTabsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change paragraph tab stops. + */ +interface ChangeTabsCommand extends CommandBase { + /** + * Executes the ChangeTabsCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A TabsSettings object maintaining the information about tab stops. + */ + execute(settings: TabsSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * Contains the information about tab stops. + */ +interface TabsSettings { + /** + * Gets or sets the default tab stop value. + * Value: An integer value specifying the default tab stop. + */ + defaultTabStop: number; + /** + * Gets or sets a list of tab stops. + * Value: An array of TabSettings objects containing individual tab stop settings. + */ + tabs: TabSettings[]; +} +/** + * Contains settings of a tab stop. + */ +interface TabSettings { + /** + * Gets or sets the alignment type, specifying how any text after the tab will be lined up. + * Value: One of the values. + */ + alignment: any; + /** + * Gets or sets the tab leader style, i.e., the symbol used as a tab leader. + * Value: One of the values. + */ + leader: any; + /** + * Gets or sets the position of the tab stop. + * Value: A number representing the distance from the left edge of the text area. + */ + position: number; + /** + * Gets or sets whether the individual tab stop is in effect. + * Value: true to switch off this tab stop; otherwise, false. + */ + deleted: boolean; +} +declare enum TabAlign { + Left=0, + Center=1, + Right=2, + Decimal=3 +} +declare enum TabLeaderType { + None=0, + Dots=1, + MiddleDots=2, + Hyphens=3, + Underline=4, + ThickLine=5, + EqualSign=6 +} +/** + * Contains settings to define the paragraph formatting. + */ +interface ParagraphFormattingSettings { + /** + * Gets or sets the paragraph alignment. + * Value: One of the values. + */ + alignment: any; + /** + * Gets or sets the outline level of a paragraph. + * Value: An integer specifying the level number. + */ + outlineLevel: number; + /** + * Gets or sets the right indent value for the specified paragraph. + * Value: An integer value specifying the right indent. + */ + rightIndent: number; + /** + * Gets or sets the spacing before the current paragraph. + * Value: An integer value specifying the spacing before the paragraph. + */ + spacingBefore: number; + /** + * Gets or sets the spacing after the current paragraph. + * Value: An integer value specifying the spacing after the paragraph. + */ + spacingAfter: number; + /** + * Gets or sets a value which determines the spacing between lines in a paragraph. + * Value: One of the values. + */ + lineSpacingType: any; + /** + * Gets or sets a value specifying whether and how the first line of a paragraph is indented. + * Value: One of the values. + */ + firstLineIndentType: any; + /** + * Gets or sets a value specifying the indent of the first line of a paragraph. + * Value: An integer value specifying the indent of the first line. + */ + firstLineIndent: number; + /** + * Gets or sets whether to suppress addition of additional space (contextual spacing) between paragraphs of the same style. + * Value: true to remove extra spacing between paragraphs, false to add extra space. + */ + contextualSpacing: boolean; + /** + * Gets or sets whether to prevent all page breaks that interrupt a paragraph. + * Value: true, to keep paragraph lines together; otherwise, false. + */ + keepLinesTogether: boolean; + /** + * Gets or sets whether a page break is inserted automatically before a specified paragraph(s). + * Value: true, if a page break is inserted automatically before a paragraph(s); otherwise, false. + */ + pageBreakBefore: boolean; + /** + * Gets or sets the left indent for text within a paragraph. + * Value: An integer value specifying the left indent. + */ + leftIndent: number; + /** + * Gets or sets a line spacing value. + * Value: An integer value specifying the line spacing. + */ + lineSpacing: number; + /** + * Gets or sets the paragraph background color. + * Value: A string value specifying the background color. + */ + backColor: string; +} +declare enum ParagraphAlignment { + Left=0, + Right=1, + Center=2, + Justify=3 +} +declare enum ParagraphLineSpacingType { + Single=0, + Sesquialteral=1, + Double=2, + Multiple=3, + Exactly=4, + AtLeast=5 +} +declare enum ParagraphFirstLineIndent { + None=0, + Indented=1, + Hanging=2 +} +/** + * A command to assign a shortcut to the specified client command. + */ +interface AssignShortcutCommand extends CommandWithSimpleStateBase { + /** + * Executes the AssignShortcutCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param keyCode An integer value specifying the code uniquely identifying the key combination. + * @param callback A callback function to execute on pressing the shortcut. + */ + execute(keyCode: number, callback: (arg1: string) => void): boolean; +} +/** + * A command to invoke the Spelling dialog window. + */ +interface OpenSpellingDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenSpellingDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Insert Table dialog. + */ +interface OpenInsertTableDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenInsertTableDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Insert Table dialog. + */ +interface InsertTableCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param columnCount An integer value specifying a number of columns in a generated table. + * @param rowCount An integer value specifying a number of rows in a generated table. + */ + execute(columnCount: number, rowCount: number): boolean; +} +/** + * A command to invoke the Table Properties dialog. + */ +interface OpenTableFormattingDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenTableFormattingDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the selected table's formatting. + */ +interface ChangeTableFormattingCommand extends CommandBase { + /** + * Executes the ChangeTableFormattingCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A TableFormattingSettings object containing the settings to format a table. + */ + execute(settings: TableFormattingSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the selected table's preferred row height. + */ +interface ChangeTableRowPreferredHeightCommand extends CommandBase { + /** + * Executes the ChangeTableRowPreferredHeightCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param preferredHeight A TableHeightUnit object specifying preferred height of the selected table rows. + */ + execute(preferredHeight: TableHeightUnit): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the preferred cell width of the selected table rows. + */ +interface ChangeTableCellPreferredWidthCommand extends CommandBase { + /** + * Executes the ChangeTableCellPreferredWidthCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param preferredWidth A TableWidthUnit object specifying preferred width of the selected table rows. + */ + execute(preferredWidth: TableWidthUnit): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the selected table's preferred column width. + */ +interface ChangeTableColumnPreferredWidthCommand extends CommandBase { + /** + * Executes the ChangeTableColumnPreferredWidthCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param preferredWidth A TableWidthUnit object specifying preferred width of the selected table columns. + */ + execute(preferredWidth: TableWidthUnit): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the cell formatting of the selected table elements. + */ +interface ChangeTableCellFormattingCommand extends CommandBase { + /** + * Executes the ChangeTableCellFormattingCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A TableFormattingSettings object specifying cell formatting of the selected table elements. + */ + execute(settings: TableCellFormattingSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to insert a table column to the left of the current position in the table. + */ +interface InsertTableColumnToTheLeftCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableColumnToTheLeftCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a table column to the right of the current position in the table. + */ +interface InsertTableColumnToTheRightCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableColumnToTheRightCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a row in a table below the selected row. + */ +interface InsertTableRowBelowCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableRowBelowCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert a row in a table above the selected row. + */ +interface InsertTableRowAboveCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableRowAboveCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to delete the selected table rows. + */ +interface DeleteTableRowsCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteTableRowsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to delete the selected table columns. + */ +interface DeleteTableColumnsCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteTableColumnsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to insert table cells with a horizontal shift into the selected table. + */ +interface InsertTableCellWithShiftToTheLeftCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableCellWithShiftToTheLeftCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to delete the selected table cells with a horizontal shift. + */ +interface DeleteTableCellsWithShiftHorizontallyCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteTableCellsWithShiftHorizontallyCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to delete the selected table cells with a vertical shift. + */ +interface DeleteTableCellsWithShiftVerticallyCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteTableCellsWithShiftVerticallyCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to delete the selected table. + */ +interface DeleteTableCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteTableCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Insert Cells dialog. + */ +interface InsertTableCellsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableCellsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Delete Cells dialog. + */ +interface DeleteTableCellsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the DeleteTableCellsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to merge the selected table cells. + */ +interface MergeTableCellsCommand extends CommandWithSimpleStateBase { + /** + * Executes the MergeTableCellsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Split Cells dialog. + */ +interface SplitTableCellsDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the SplitTableCellsDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to split the selected table cells based on the specified options. + */ +interface SplitTableCellsCommand extends CommandWithSimpleStateBase { + /** + * Executes the SplitTableCellsCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param rowCount An integer value specifying a number of rows in the split table cells. + * @param columnCount An integer value specifying a number of columns in the split table cells. + * @param mergeBeforeSplit true to merge the selected cells before the splitting; otherwise, false. + */ + execute(rowCount: number, columnCount: number, mergeBeforeSplit: boolean): boolean; +} +/** + * A command to insert table cells with a vertical shift into the selected table. + */ +interface InsertTableCellsWithShiftToTheVerticallyCommand extends CommandWithSimpleStateBase { + /** + * Executes the InsertTableCellsWithShiftToTheVerticallyCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to invoke the Borders and Shading table dialog. + */ +interface OpenTableBordersAndShadingDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenTableBordersAndShadingDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change borders and shading of the selected table elements. + */ +interface ChangeTableBordersAndShadingCommand extends CommandBase { + /** + * Executes the ChangeTableBordersAndShadingCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A TableBorderSettings object with settings specifying table borders. + * @param applyToWholeTable true to apply the border settings to the whole table, false to apply the border settings to the selected cells. + */ + execute(settings: TableBordersSettings, applyToWholeTable: boolean): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to apply top-left alignment for the selected table cells. + */ +interface ToggleTableCellAlignTopLeftCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignTopLeftCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply top-center alignment for the selected table cells. + */ +interface ToggleTableCellAlignTopCenterCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignTopCenterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply top-right alignment for the selected table cells. + */ +interface ToggleTableCellAlignTopRightCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignTopRightCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply middle-left alignment for the selected table cells. + */ +interface ToggleTableCellAlignMiddleLeftCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignMiddleLeftCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply middle-center alignment for the selected table cells. + */ +interface ToggleTableCellAlignMiddleCenterCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignMiddleCenterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply middle-right alignment for the selected table cells. + */ +interface ToggleTableCellAlignMiddleRightCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignMiddleRightCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply bottom-left alignment for the selected table cells. + */ +interface ToggleTableCellAlignBottomLeftCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignBottomLeftCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply bottom-center alignment for the selected table cells. + */ +interface ToggleTableCellAlignBottomCenterCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignBottomCenterCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to apply bottom-right alignment for the selected table cells. + */ +interface ToggleTableCellAlignBottomRightCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAlignBottomRightCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the selected table's style. + */ +interface ChangeTableStyleCommand extends CommandBase { + /** + * Executes the ChangeTableStyleCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param style A TableStyle object specifying the style applying to the table. + */ + execute(style: TableStyle): boolean; + /** + * Executes the ChangeTableStyleCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param styleName A string specifying the name of style applying to the table. + */ + execute(styleName: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to toggle top borders for selected cells on/off. + */ +interface ToggleTableCellTopBorderCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellTopBorderCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle right borders for selected cells on/off. + */ +interface ToggleTableCellRightBorderCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellRightBorderCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle bottom borders for selected cells on/off. + */ +interface ToggleTableCellBottomBorderCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellBottomBorderCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle left borders for selected cells on/off. + */ +interface ToggleTableCellLeftBorderCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellLeftBorderCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to remove the borders of the selected table cells. + */ +interface RemoveTableCellBordersCommand extends CommandWithSimpleStateBase { + /** + * Executes the RemoveTableCellBordersCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle all borders for selected cells on/off. + */ +interface ToggleTableCellAllBordersCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellAllBordersCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle inner borders for selected cells on/off. + */ +interface ToggleTableCellInsideBordersCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellInsideBordersCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle inner horizontal borders for selected cells on/off. + */ +interface ToggleTableCellInsideHorizontalBordersCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellInsideHorizontalBordersCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle inner vertical borders for selected cells on/off. + */ +interface ToggleTableCellInsideVerticalBordersCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellInsideVerticalBordersCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle outer borders for selected cells on/off. + */ +interface ToggleTableCellOutsideBordersCommand extends CommandWithBooleanStateBase { + /** + * Executes the ToggleTableCellOutsideBordersCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the selected table's style options. + */ +interface ChangeTableLookCommand extends CommandBase { + /** + * Executes the ChangeTableLookCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A TableLookSettings object containing the settings that modify the table appearance. + */ + execute(settings: TableLookSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the repository item's table border style. + */ +interface ChangeTableBorderRepositoryItemCommand extends CommandBase { + /** + * Executes the ChangeTableBorderRepositoryItemCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A TableBorderSettings object specifying the repository item's table border style. + */ + execute(settings: TableBorderSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change cell shading in the selected table elements. + */ +interface ChangeTableCellShadingCommand extends CommandBase { + /** + * Executes the ChangeTableCellShadingCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param color A string specifying the color of the selected cells' shading. May be specified as a color name or a hex color value. + */ + execute(color: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to toggle the display of grid lines for a table with no borders applied - on/off. + */ +interface ShowTableGridLinesCommand extends CommandWithBooleanStateBase { + /** + * Executes the ShowTableGridLinesCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ShowTableGridLinesCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param showTableGridLines true to display grid lines of the table, false to hide grid lines of the table. + */ + execute(showTableGridLines: boolean): boolean; +} +/** + * Contains the table style settings that modify the table appearance. + */ +interface TableLookSettings { + /** + * Gets or sets a value specifying whether special formatting is applied to the first row of the table. + * Value: true, to apply the formatting; otherwise, false. + */ + applyFirstRow: boolean; + /** + * Gets or sets a value specifying whether special formatting is applied to the last row of the table. + * Value: true, to apply the formatting; otherwise, false. + */ + applyLastRow: boolean; + /** + * Gets or sets a value specifying whether special formatting is applied to the first column of the table. + * Value: true, to apply the formatting; otherwise, false. + */ + applyFirstColumn: boolean; + /** + * Gets or sets a value specifying whether special formatting is applied to the last column of the table. + * Value: true, to apply the formatting; otherwise, false. + */ + applyLastColumn: boolean; + /** + * Gets or sets a value specifying whether row banding formatting is not applied to the table. + * Value: true, to apply the formatting; otherwise, false. + */ + doNotApplyRowBanding: boolean; + /** + * Gets or sets a value specifying whether column banding formatting is not applied to the table. + * Value: true, to apply the formatting; otherwise, false. + */ + doNotApplyColumnBanding: boolean; +} +/** + * Contains settings to define table borders. + */ +interface TableBordersSettings { + /** + * Gets or sets the top border's settings. + * Value: A TableBorderSettings object containing the table border settings. + */ + top: TableBorderSettings; + /** + * Gets or sets the right border's settings. + * Value: A TableBorderSettings object containing the table border settings. + */ + right: TableBorderSettings; + /** + * Gets or sets the bottom border's settings. + * Value: A TableBorderSettings object containing the table border settings. + */ + bottom: TableBorderSettings; + /** + * Gets or sets the left border's settings. + * Value: A TableBorderSettings object containing the table border settings. + */ + left: TableBorderSettings; + /** + * Gets or sets the inside horizontal border's settings. + * Value: A TableBorderSettings object containing the table border settings. + */ + insideHorizontal: TableBorderSettings; + /** + * Gets or sets the inside vertical border's settings. + * Value: A TableBorderSettings object containing the table border settings. + */ + insideVertical: TableBorderSettings; + /** + * Gets or sets the background color of table borders. + * Value: A string value specifying the background color. + */ + backgroundColor: string; +} +/** + * Contains settings to define a table border. + */ +interface TableBorderSettings { + /** + * Gets or sets the border color. + * Value: A string value specifying the border color. + */ + color: string; + /** + * Gets or sets the border line width. + * Value: An integer value defining the border line width. + */ + width: number; + /** + * Gets or sets the border line style. + * Value: A object defining the border line style. + */ + style: any; +} +declare enum BorderLineStyle { + None=0, + Single=1, + Thick=2, + Double=3, + Dotted=4, + Dashed=5, + DotDash=6, + DotDotDash=7, + Triple=8, + ThinThickSmallGap=9, + ThickThinSmallGap=10, + ThinThickThinSmallGap=11, + ThinThickMediumGap=12, + ThickThinMediumGap=13, + ThinThickThinMediumGap=14, + ThinThickLargeGap=15, + ThickThinLargeGap=16, + ThinThickThinLargeGap=17, + Wave=18, + DoubleWave=19, + DashSmallGap=20, + DashDotStroked=21, + ThreeDEmboss=22, + ThreeDEngrave=23, + Outset=24, + Inset=25, + Apples=26, + ArchedScallops=27, + BabyPacifier=28, + BabyRattle=29, + Balloons3Colors=30, + BalloonsHotAir=31, + BasicBlackDashes=32, + BasicBlackDots=33, + BasicBlackSquares=34, + BasicThinLines=35, + BasicWhiteDashes=36, + BasicWhiteDots=37, + BasicWhiteSquares=38, + BasicWideInline=39, + BasicWideMidline=40, + BasicWideOutline=41, + Bats=42, + Birds=43, + BirdsFlight=44, + Cabins=45, + CakeSlice=46, + CandyCorn=47, + CelticKnotwork=48, + CertificateBanner=49, + ChainLink=50, + ChampagneBottle=51, + CheckedBarBlack=52, + CheckedBarColor=53, + Checkered=54, + ChristmasTree=55, + CirclesLines=56, + CirclesRectangles=57, + ClassicalWave=58, + Clocks=59, + Compass=60, + Confetti=61, + ConfettiGrays=62, + ConfettiOutline=63, + ConfettiStreamers=64, + ConfettiWhite=65, + CornerTriangles=66, + CouponCutoutDashes=67, + CouponCutoutDots=68, + CrazyMaze=69, + CreaturesButterfly=70, + CreaturesFish=71, + CreaturesInsects=72, + CreaturesLadyBug=73, + CrossStitch=74, + Cup=75, + DecoArch=76, + DecoArchColor=77, + DecoBlocks=78, + DiamondsGray=79, + DoubleD=80, + DoubleDiamonds=81, + Earth1=82, + Earth2=83, + EclipsingSquares1=84, + EclipsingSquares2=85, + EggsBlack=86, + Fans=87, + Film=88, + Firecrackers=89, + FlowersBlockPrint=90, + FlowersDaisies=91, + FlowersModern1=92, + FlowersModern2=93, + FlowersPansy=94, + FlowersRedRose=95, + FlowersRoses=96, + FlowersTeacup=97, + FlowersTiny=98, + Gems=99, + GingerbreadMan=100, + Gradient=101, + Handmade1=102, + Handmade2=103, + HeartBalloon=104, + HeartGray=105, + Hearts=106, + HeebieJeebies=107, + Holly=108, + HouseFunky=109, + Hypnotic=110, + IceCreamCones=111, + LightBulb=112, + Lightning1=113, + Lightning2=114, + MapleLeaf=115, + MapleMuffins=116, + MapPins=117, + Marquee=118, + MarqueeToothed=119, + Moons=120, + Mosaic=121, + MusicNotes=122, + Northwest=123, + Ovals=124, + Packages=125, + PalmsBlack=126, + PalmsColor=127, + PaperClips=128, + Papyrus=129, + PartyFavor=130, + PartyGlass=131, + Pencils=132, + People=133, + PeopleHats=134, + PeopleWaving=135, + Poinsettias=136, + PostageStamp=137, + Pumpkin1=138, + PushPinNote1=139, + PushPinNote2=140, + Pyramids=141, + PyramidsAbove=142, + Quadrants=143, + Rings=144, + Safari=145, + Sawtooth=146, + SawtoothGray=147, + ScaredCat=148, + Seattle=149, + ShadowedSquares=150, + SharksTeeth=151, + ShorebirdTracks=152, + Skyrocket=153, + SnowflakeFancy=154, + Snowflakes=155, + Sombrero=156, + Southwest=157, + Stars=158, + Stars3d=159, + StarsBlack=160, + StarsShadowed=161, + StarsTop=162, + Sun=163, + Swirligig=164, + TornPaper=165, + TornPaperBlack=166, + Trees=167, + TriangleParty=168, + Triangles=169, + Tribal1=170, + Tribal2=171, + Tribal3=172, + Tribal4=173, + Tribal5=174, + Tribal6=175, + TwistedLines1=176, + TwistedLines2=177, + Vine=178, + Waveline=179, + WeavingAngles=180, + WeavingBraid=181, + WeavingRibbon=182, + WeavingStrips=183, + WhiteFlowers=184, + Woodwork=185, + XIllusions=186, + ZanyTriangles=187, + ZigZag=188, + ZigZagStitch=189, + Nil=-1 +} +/** + * Contains the settings to define the table cell formatting. + */ +interface TableCellFormattingSettings { + /** + * Gets or sets a table cell's preferred width. + * Value: A object specifying the preferred cell width. + */ + preferredWidth: TableWidthUnit; + /** + * Gets or sets the vertical alignment of a table cell's content. + * Value: One the values. + */ + verticalAlignment: any; + /** + * Gets or sets a value specifying whether text is wrapped in a table cell. + * Value: true if text is wrapped; false if text is not wrapped. + */ + noWrap: boolean; + /** + * Gets or sets a table cell's left margin. + * Value: An integer value specifying the left margin. + */ + marginLeft: number; + /** + * Gets or sets a table cell's right margin. + * Value: An integer value specifying the right margin. + */ + marginRight: number; + /** + * Gets or sets a table cell's top margin. + * Value: An integer value specifying the top margin. + */ + marginTop: number; + /** + * Gets or sets a table cell's bottom margin. + * Value: An integer value specifying the bottom margin. + */ + marginBottom: number; + /** + * Gets or sets a value specifying whether a table cell's margins are inherited from the table level settings. + * Value: true to inherit table level margins; false to use a table cell's own margin settings. + */ + marginsSameAsTable: boolean; +} +declare enum TableCellVerticalAlignment { + Top=0, + Both=1, + Center=2, + Bottom=3 +} +/** + * Contains the settings to format a table. + */ +interface TableFormattingSettings { + /** + * Gets or sets the preferred width of cells in the table. + * Value: A object specifying the width. + */ + preferredWidth: TableWidthUnit; + /** + * Gets or sets the alignment of table rows. + * Value: One of the values. + */ + alignment: any; + /** + * Gets or sets the table's left indent. + * Value: An integer value specifying the indent. + */ + indent: number; + /** + * Gets or sets the spacing between table cells. + * Value: An integer value specifying the spacing. + */ + spacingBetweenCells: number; + /** + * Gets or sets a value specifying whether spacing is allowed between table cells. + * Value: true, to allow spacing; otherwise, false. + */ + allowSpacingBetweenCells: boolean; + /** + * Gets or sets a value that specifying whether to allow automatic resizing of table cells to fit their contents. + * Value: true, to allow automatic resizing; otherwise, false. + */ + resizeToFitContent: boolean; + /** + * Gets or sets the default left margin for cells in the table. + * Value: An integer value specifying the margin value. + */ + defaultCellMarginLeft: number; + /** + * Gets or sets the default right margin for cells in the table. + * Value: An integer value specifying the margin value. + */ + defaultCellMarginRight: number; + /** + * Gets or sets the default top margin for cells in the table. + * Value: An integer value specifying the margin value. + */ + defaultCellMarginTop: number; + /** + * Gets or sets the default bottom margin for cells in the table. + * Value: An integer value specifying the margin value. + */ + defaultCellMarginBottom: number; +} +/** + * Contains settings defining the table width's measurement units and value. + */ +interface TableWidthUnit { + /** + * Gets or sets the table width value. + * Value: An integer value specifying the table width. + */ + value: number; + /** + * Gets or sets the unit type for the table width. + * Value: One of the values. + */ + type: any; +} +/** + * Contains settings defining the table height's measurement units and value. + */ +interface TableHeightUnit { + /** + * Gets or sets the table height value. + * Value: An integer value specifying the table height. + */ + value: number; + /** + * Gets or sets the unit type for the table height. + * Value: One of the enumeration values. + */ + type: any; +} +declare enum TableHeightUnitType { + Minimum=0, + Auto=1, + Exact=2 +} +declare enum TableRowAlignment { + Both=0, + Center=1, + Distribute=2, + Left=3, + NumTab=4, + Right=5 +} +declare enum TableWidthUnitType { + Nil=0, + Auto=1, + FiftiethsOfPercent=2, + ModelUnits=3 +} +/** + * A command to change the font name of characters in a selected range. + */ +interface ChangeFontNameCommand extends CommandBase { + /** + * Executes the ChangeFontNameCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontName A string specifying the font name. + */ + execute(fontName: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the font size of characters in a selected range. + */ +interface ChangeFontSizeCommand extends CommandBase { + /** + * Executes the ChangeFontSizeCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontSize An integer number specifying the font size. + */ + execute(fontSize: number): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to increase the font size of characters in a selected range to the closest larger predefined value. + */ +interface IncreaseFontSizeCommand extends CommandWithSimpleStateBase { + /** + * Executes the IncreaseFontSizeCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to decrease the font size of characters in a selected range to the closest smaller predefined value. + */ +interface DecreaseFontSizeCommand extends CommandWithSimpleStateBase { + /** + * Executes the DecreaseFontSizeCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to convert the selected text to upper case. + */ +interface MakeTextUpperCaseCommand extends CommandWithSimpleStateBase { + /** + * Executes the MakeTextUpperCaseCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to convert the selected text to lower case. + */ +interface MakeTextLowerCaseCommand extends CommandWithSimpleStateBase { + /** + * Executes the MakeTextLowerCaseCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to capitalize each word in the selected sentence. + */ +interface CapitalizeEachWordTextCaseCommand extends CommandWithSimpleStateBase { + /** + * Executes the CapitalizeEachWordTextCaseCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to toggle the case for each character - upper case becomes lower, lower case becomes upper. + */ +interface ToggleTextCaseCommand extends CommandWithSimpleStateBase { + /** + * Executes the ToggleTextCaseCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the bold formatting of characters in a selected range. + */ +interface ChangeFontBoldCommand extends CommandWithBooleanStateBase { + /** + * Executes the ChangeFontBoldCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ChangeFontBoldCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontBold true to apply bold formatting to the text, false to remove bold formatting. + */ + execute(fontBold: boolean): boolean; +} +/** + * A command to change the italic formatting of characters in a selected range. + */ +interface ChangeFontItalicCommand extends CommandWithBooleanStateBase { + /** + * Executes the ChangeFontItalicCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ChangeFontItalicCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontItalic true to apply italic formatting to the text, false to remove italic formatting. + */ + execute(fontItalic: boolean): boolean; +} +/** + * A command to change the underline formatting of characters in a selected range. + */ +interface ChangeFontUnderlineCommand extends CommandWithBooleanStateBase { + /** + * Executes the ChangeFontUnderlineCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ChangeFontUnderlineCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontUnderline true to apply underline formatting to the text, false to remove underline formatting. + */ + execute(fontUnderline: boolean): boolean; +} +/** + * A command to change the strikeout formatting of characters in a selected range. + */ +interface ChangeFontStrikeoutCommand extends CommandWithBooleanStateBase { + /** + * Executes the ChangeFontStrikeoutCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ChangeFontStrikeoutCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontStrikeout true to apply strikeout formatting to the text, false to remove strikeout formatting. + */ + execute(fontStrikeout: boolean): boolean; +} +/** + * A command to change the superscript formatting of characters in a selected range. + */ +interface ChangeFontSuperscriptCommand extends CommandWithBooleanStateBase { + /** + * Executes the ChangeFontSuperscriptCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ChangeFontSuperscriptCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontSuperscript true to apply superscript formatting to the text, false to remove superscript formatting. + */ + execute(fontSuperscript: boolean): boolean; +} +/** + * A command to change the subscript formatting of characters in the selected range. + */ +interface ChangeFontSubscriptCommand extends CommandWithBooleanStateBase { + /** + * Executes the ChangeFontSubscriptCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ChangeFontSubscriptCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fontSubscript true to apply subscript formatting to the text, false to remove subscript formatting. + */ + execute(fontSubscript: boolean): boolean; +} +/** + * A command to change the font color of characters in a selected range. + */ +interface ChangeFontForeColorCommand extends CommandBase { + /** + * Executes the ChangeFontForeColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param color A string specifying the font color. May be specified as a color name or a hex color value. + */ + execute(color: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to change the background color of characters in a selected range. + */ +interface ChangeFontBackColorCommand extends CommandBase { + /** + * Executes the ChangeFontBackColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param color A string specifying the background font color. May be specified as a color name or a hex color value. + */ + execute(color: string): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to reset the selected text's formatting to default. + */ +interface ClearFormattingCommand extends CommandWithSimpleStateBase { + /** + * Executes the ClearFormattingCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the selected range's style. + */ +interface ChangeStyleCommand extends CommandBase { + /** + * Executes the ChangeStyleCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param style A StyleBase object specifying the selected range's style. + */ + execute(style: StyleBase): boolean; + /** + * Executes the ChangeStyleCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param styleName A string specifying the applying style's name. + * @param isParagraphStyle true to apply the style to a paragraph, false to apply the style to a character. + */ + execute(styleName: string, isParagraphStyle: boolean): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * A command to invoke the Font dialog allowing end-users to change the font, size and style of the selected text. + */ +interface OpenFontFormattingDialogCommand extends CommandWithSimpleStateBase { + /** + * Executes the OpenFontFormattingDialogCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to convert the text of all selected sentences to sentence case. + */ +interface MakeTextSentenceCaseCommand extends CommandWithSimpleStateBase { + /** + * Executes the MakeTextSentenceCaseCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to switch the text case at the current position in the document. + */ +interface SwitchTextCaseCommand extends CommandWithSimpleStateBase { + /** + * Executes the SwitchTextCaseCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; +} +/** + * A command to change the font formatting of characters in a selected range. + */ +interface ChangeFontFormattingCommand extends CommandBase { + /** + * Executes the ChangeFontFormattingCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param settings A FontFormattingSettings object specifying font formatting settings. + */ + execute(settings: FontFormattingSettings): boolean; + /** + * Gets information about the command state. + */ + getState(): any; +} +/** + * Contains settings to define the font formatting. + */ +interface FontFormattingSettings { + /** + * Gets or sets the character(s) font name. + * Value: A string value specifying the font name. + */ + fontName: string; + /** + * Gets or sets the character(s) font size. + * Value: An integer value specifying the font size. + */ + size: number; + /** + * Gets or sets the foreground color of characters. + * Value: A string value specifying the foreground color. + */ + foreColor: string; + /** + * Gets or sets the character background color. + * Value: A string value specifying the background color. + */ + backColor: string; + /** + * Gets or sets the type of underline applied to the character(s). + * Value: true, if characters are underlined; otherwise, false. + */ + underline: boolean; + /** + * Gets or sets the color of the underline for the specified characters. + * Value: A string value specifying the underline color. + */ + underlineColor: string; + /** + * Gets or sets whether the character formatting is bold. + * Value: true, if characters are bold; otherwise, false. + */ + bold: boolean; + /** + * Gets or sets a value indicating whether a character(s) is italicized. + * Value: true, if characters are italicized; otherwise, false. + */ + italic: boolean; + /** + * Gets or sets a value specifying whether the strikeout formatting is applied to a character(s). + * Value: true if the strikeout formatting is applied; otherwise, false. + */ + strikeout: boolean; + /** + * Gets or sets whether only word characters are underlined. + * Value: true to underline only characters in words; false to underline all characters. + */ + underlineWordsOnly: boolean; + /** + * Gets or sets a value specifying character script formatting. + * Value: One of the values. + */ + script: any; + /** + * Gets or sets a value indicating whether all characters are capital letters. + * Value: true, if all characters are capitalized; otherwise, false. + */ + allCaps: boolean; + /** + * Gets or sets a value indicating whether a character(s) is hidden. + * Value: true, if characters are hidden; otherwise, false. + */ + hidden: boolean; +} +declare enum CharacterFormattingScript { + Normal=0, + Subscript=1, + Superscript=2 +} +/** + * A command to toggle the horizontal ruler's visibility. + */ +interface ShowHorizontalRulerCommand extends CommandWithBooleanStateBase { + /** + * Executes the ShowHorizontalRulerCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the ShowHorizontalRulerCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param show true to display the horizontal ruler, false to hide the horizontal ruler. + */ + execute(show: boolean): boolean; +} +/** + * A command to toggle the fullscreen mode. + */ +interface SetFullscreenCommand extends CommandWithBooleanStateBase { + /** + * Executes the SetFullscreenCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + */ + execute(): boolean; + /** + * Executes the SetFullscreenCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * @param fullscreen true to apply the fullscreen mode, false to disable the fullscreen mode. + */ + execute(fullscreen: boolean): boolean; +} +/** + * Holds the information that determines what action types can be performed for appointments. + */ +interface ASPxClientAppointmentFlags { + /** + * Gets a value that specifies whether an end-user is allowed to delete appointments. + * Value: true if an end-user can delete appointments; otherwise, false. Default is true. + */ + allowDelete: boolean; + /** + * Gets a value that specifies whether an end-user is allowed to edit appointments. + * Value: true if the end-user can edit appointments; otherwise, false. + */ + allowEdit: boolean; + /** + * Gets a value that specifies whether an end-user is allowed to change the time boundaries of appointments. + * Value: true if appointment resizing is allowed; otherwise, false. Default is true. + */ + allowResize: boolean; + /** + * Gets a value that specifies whether an end-user is allowed to copy appointments. + * Value: true if a user can copy appointments; otherwise, false. Default is true. + */ + allowCopy: boolean; + /** + * Gets a value that specifies whether an end-user is allowed to drag and drop appointments to another time slot or date. + * Value: true if the user can drag and drop appointments; otherwise, false. + */ + allowDrag: boolean; + /** + * Gets a value that specifies whether an end-user is allowed to drag and drop appointments between resources. + * Value: true if the end-user can drag appointment from one resource to another; otherwise, false. + */ + allowDragBetweenResources: boolean; + /** + * Gets a value that specifies whether an inplace editor can be activated for an appointment. + * Value: true if an inplace editor is activated; otherwise, false. Default is true. + */ + allowInplaceEditor: boolean; + /** + * Gets a value that specifies whether an end-user is allowed to share the schedule time between two or more appointments. + * Value: true if appointments with the same schedule time are allowed; otherwise, false. Default is true. + */ + allowConflicts: boolean; +} +/** + * Represents a client-side equivalent of the Appointment class. + */ +interface ASPxClientAppointment { + /** + * Gets the time interval of the appointment for client-side scripting. + * Value: An ASPxClientTimeInterval object, representing the interval assigned to an appointment. + */ + interval: ASPxClientTimeInterval; + /** + * Gets the identifiers of resources associated with the appointment for client-side scripting. + * Value: An array of string representations for resource identifiers. + */ + resources: string[]; + /** + * Gets the ID of an appointment for use in client-side scripts. + * Value: A string representation of the appointment ID. + */ + appointmentId: string; + /** + * Gets the type of appointment for use in client-side scripts. + * Value: An ASPxAppointmentType enumeration member, representing the appointment's type. + */ + appointmentType: ASPxAppointmentType; + /** + * Gets the index of the availability status object associated with the appointment. + * Value: An integer value that specifies the index of the corresponding Statuses collection. + */ + statusIndex: number; + /** + * Gets the index of the label object associated with the appointment for client-side scripting. + * Value: An integer value that specifies the index of the corresponding Labels collection. + */ + labelIndex: number; + /** + * Gets the client appointment value that is equivalent in meaning to the Subject property. + * Value: A string representing the appointment subject. + */ + subject: string; + /** + * Gets the client appointment value that is equivalent in meaning to the Description property. + * Value: A string, representing the description for an appointment. + */ + description: string; + /** + * Gets the client appointment value that is equivalent in meaning to the Location property. + * Value: A string representing the appointment location. + */ + location: string; + /** + * Gets the client appointment value that is equivalent in meaning to the AllDay property. + * Value: true indicates the all-day appointment; otherwise, false. + */ + allDay: boolean; + /** + * Adds a resource to the collection of resources associated with the client appointment. + * @param resourceId An object, representing the resource id. + */ + AddResource(resourceId: Object): void; + /** + * Gets the resource associated with the client-side appointment by its index. + * @param index An integer, representing an index of a resource in a resource collection associated with the current appointment. + */ + GetResource(index: number): Object; + /** + * Sets the property value of the client appointment, corresponding to the Start appointment property. + * @param start A JavaScript Date object representing the appointment start. + */ + SetStart(start: Date): void; + /** + * Gets the property value of the client appointment corresponding to the Start appointment property. + */ + GetStart(): Date; + /** + * Sets the property value of the client appointment, corresponding to the End appointment property. + * @param end A JavaScript Date object representing the end of the appointment. + */ + SetEnd(end: Date): void; + /** + * Gets the property value of the client appointment corresponding to the End appointment property. + */ + GetEnd(): Date; + /** + * Sets the property value of the client appointment, corresponding to the Duration appointment property. + * @param duration A TimeSpan object representing the appointment duration. + */ + SetDuration(duration: any): void; + /** + * Gets the property value of the client appointment corresponding to the Duration appointment property. + */ + GetDuration(): number; + /** + * Sets the ID of the client appointment. + * @param id An object representing the appointment identifier. + */ + SetId(id: Object): void; + /** + * Gets the ID of the client appointment. + */ + GetId(): Object; + /** + * Specifies the type of the current client appointment. + * @param type An ASPxAppointmentType enumeration value indicating the appointment type. + */ + SetAppointmentType(type: ASPxAppointmentType): void; + /** + * Gets the type of the client appointment. + */ + GetAppointmentType(): ASPxAppointmentType; + /** + * Sets the property value of the client appointment, corresponding to the StatusId appointment property. + * @param statusId An integer representing the index in the AppointmentStatusCollection. + */ + SetStatusId(statusId: number): void; + /** + * Gets the property value of the client appointment corresponding to the StatusId appointment property. + */ + GetStatusId(): number; + /** + * Sets the property value of the client appointment, corresponding to the LabelId appointment property. + * @param statusId An integer representing the index of the label in the Labels label collection. + */ + SetLabelId(statusId: number): void; + /** + * Gets the property value of the client appointment corresponding to the LabelId appointment property. + */ + GetLabelId(): number; + /** + * Sets the property value of the client appointment, corresponding to the Subject appointment property. + * @param subject A string containing the appointment subject. + */ + SetSubject(subject: string): void; + /** + * Gets the property value of the client appointment corresponding to the Subject appointment property. + */ + GetSubject(): string; + /** + * Sets the property value of the client appointment, corresponding to the Description appointment property. + * @param description A string representing the appointment description. + */ + SetDescription(description: string): void; + /** + * Gets the property value of the client appointment corresponding to the Description appointment property. + */ + GetDescription(): string; + /** + * Sets the property value of the client appointment, corresponding to the Location appointment property. + * @param location A string representing the appointment location. + */ + SetLocation(location: string): void; + /** + * Gets the property value of the client appointment corresponding to the Location appointment property. + */ + GetLocation(): string; + /** + * Specifies the property value of the client appointment corresponding to the AllDay appointment property. + * @param allDay true to indicate the all-day appointment; otherwise, false. + */ + SetAllDay(allDay: boolean): void; + /** + * Gets the property value of the client appointment corresponding to the AllDay appointment property. + */ + GetAllDay(): boolean; + /** + * Gets the appointment that is the RecurrencePattern for the current appointment. + */ + GetRecurrencePattern(): ASPxClientAppointment; + /** + * Sets the property value of the client appointment, corresponding to the RecurrenceInfo appointment property. + * @param recurrenceInfo An ASPxClientRecurrenceInfo object representing the recurrence information. + */ + SetRecurrenceInfo(recurrenceInfo: ASPxClientRecurrenceInfo): void; + /** + * Gets the property value of the client appointment corresponding to the RecurrenceInfo appointment property. + */ + GetRecurrenceInfo(): ASPxClientRecurrenceInfo; +} +/** + * A client point object. + */ +interface ASPxClientPoint { + /** + * Gets the point's X-coordinate. + */ + GetX(): number; + /** + * Gets the point's Y-coordinate. + */ + GetY(): number; +} +/** + * A client rectangle object. + */ +interface ASPxClientRect { + /** + * Gets the X-coordinate of the rectangle's left edge. + */ + GetLeft(): number; + /** + * Gets the X-coordinate of the rectangle's right edge. + */ + GetRight(): number; + /** + * Gets the Y-coordinate of the rectangle's top edge. + */ + GetTop(): number; + /** + * Gets the Y-coordinate of the rectangle's bottom edge. + */ + GetBottom(): number; + /** + * Gets the rectangle's width. + */ + GetWidth(): number; + /** + * Gets the rectangle's height. + */ + GetHeight(): number; +} +/** + * Contains information defining the occurrences of a recurring client appointment. + */ +interface ASPxClientRecurrenceInfo { + /** + * Sets the recurrence start date. + * @param start A JavaScript date object value that specifies the start date for the recurrence. + */ + SetStart(start: Date): void; + /** + * Gets the recurrence start date. + */ + GetStart(): Date; + /** + * Sets the recurrence end date. + * @param end A JavaScript Date object that specifies the end date for the recurrence. + */ + SetEnd(end: Date): void; + /** + * Gets the recurrence end date. + */ + GetEnd(): Date; + /** + * Sets the duration of the recurrence. + * @param duration A TimeSpan object representing the duration. + */ + SetDuration(duration: any): void; + /** + * Gets the duration of the recurrence. + */ + GetDuration(): number; + /** + * Sets the time base for the frequency of the corresponding appointment occurrences. + * @param type An ASPxClientRecurrenceType enumeration value that specifies the recurrence's frequency type. + */ + SetRecurrenceType(type: ASPxClientRecurrenceType): void; + /** + * Gets the time base for the frequency of the corresponding appointment reoccurrence. + */ + GetRecurrenceType(): ASPxClientRecurrenceType; + /** + * Sets the day/days in a week that the corresponding appointment recurs on. + * @param weekDays The ASPxClientWeekDays enumeration value specifying the day/days in a week. + */ + SetWeekDays(weekDays: ASPxClientWeekDays): void; + /** + * Gets the day/days in a week on which the corresponding appointment occurs. + */ + GetWeekDays(): ASPxClientWeekDays; + /** + * Sets how many times the appointment occurs. + * @param occurrenceCount An integer value that specifies how many times the appointment occurs. + */ + SetOccurrenceCount(occurrenceCount: number): void; + /** + * Gets how many times the appointment occurs. + */ + GetOccurrenceCount(): number; + /** + * Sets the frequency with which the corresponding appointment occurs (dependent on the recurrence Type). + * @param periodicity An integer value that specifies the frequency with which the corresponding appointment occurs. + */ + SetPeriodicity(periodicity: number): void; + /** + * Gets the frequency with which the corresponding appointment reoccurs (dependent on the recurrence Type). + */ + GetPeriodicity(): number; + /** + * Sets the ordinal number of a day within a defined month. + * @param dayNumber A positive integer value that specifies the day number within a month. + */ + SetDayNumber(dayNumber: number): void; + /** + * Gets the ordinal number of a day within a defined month. + */ + GetDayNumber(): number; + /** + * Sets the occurrence number of the week in a month for the recurrence pattern. + * @param weekOfMonth A ASPxClientWeekOfMonth enumeration value that specifies a particular week in every month. + */ + SetWeekOfMonth(weekOfMonth: ASPxClientWeekOfMonth): void; + /** + * Gets the occurrence number of the week in a month for the recurrence pattern. + */ + GetWeekOfMonth(): ASPxClientWeekOfMonth; + /** + * Sets the month (as a number) on which the corresponding appointment occurs. + * @param month A positive integer value that specifies the month's number. + */ + SetMonth(month: number): void; + /** + * Gets the month (as a number) on which the corresponding appointment recurs. + */ + GetMonth(): number; + /** + * Gets the type of the recurrence range. + */ + GetRange(): ASPxClientRecurrenceRange; + /** + * Sets the type of the recurrence range. + * @param range An ASPxClientRecurrenceRangeenumeration value that specifies the recurrence range type. + */ + SetRange(range: ASPxClientRecurrenceRange): void; +} +/** + * Contains types of the recurrence range. + */ +interface ASPxClientRecurrenceRange { + /** + * A recurring appointment will not have an end date, i.e. infinite recurrence + * Value: The "NoEndDate" string. + */ + NoEndDate: string; + /** + * A recurring appointment will end after its recurrence count exceeds the value specified by the SetOccurrenceCount method. + * Value: The "OccurrenceCount" string. + */ + OccurrenceCount: string; + /** + * A recurring appointment will end after the date specified by the SetEnd method. + * Value: The "EndByDate" string. + */ + EndByDate: string; +} +/** + * Contains recurrence types. + */ +interface ASPxClientRecurrenceType { + /** + * The recurring appointment occurs on a daily basis. + * Value: The "Daily" string. + */ + Daily: string; + /** + * The recurring appointment reoccurs on a weekly basis. + * Value: The "Weekly" string. + */ + Weekly: string; + /** + * The recurring appointment reoccurs on a monthly basis. + * Value: The "Monthly" string. + */ + Monthly: string; + /** + * The recurring appointment reoccurs on an yearly basis. + * Value: The "Yearly" string. + */ + Yearly: string; + /** + * The recurring appointment occurs on an hourly base. + * Value: The "Hourly" string. + */ + Hourly: string; +} +/** + * Contains days and groups of days for use in recurrence patterns. + */ +interface ASPxClientWeekDays { + /** + * Specifies Sunday. + * Value: The integer 1 value. + */ + Sunday: number; + /** + * Specifies Monday. + * Value: The integer 2 value. + */ + Monday: number; + /** + * Specifies Tuesday. + * Value: The integer 4 value. + */ + Tuesday: number; + /** + * Specifies Wednesday. + * Value: The integer 8 value. + */ + Wednesday: number; + /** + * Specifies Thursday. + * Value: The integer 16 value. + */ + Thursday: number; + /** + * Specifies Friday. + * Value: The integer 32 value. + */ + Friday: number; + /** + * Specifies Saturday. + * Value: The integer 64 value. + */ + Saturday: number; + /** + * Specifies Saturday and Sunday. + * Value: The integer 65 value. + */ + WeekendDays: number; + /** + * Specifies work days (Monday, Tuesday, Wednesday, Thursday and Friday). + * Value: The integer 62 value. + */ + WorkDays: number; + /** + * Specifies every day of the week. + * Value: The integer 127 value. + */ + EveryDay: number; +} +/** + * Contains number of weeks in a month in which the event occurs. + */ +interface ASPxClientWeekOfMonth { + /** + * There isn't any recurrence rule based on the weeks in a month. + * Value: The integer 0 value. + */ + None: number; + /** + * The recurring event will occur once a month, on the specified day or days of the first week in the month. + * Value: The integer 1 value. + */ + First: number; + /** + * The recurring event will occur once a month, on the specified day or days of the second week in the month. + * Value: The integer 2 value. + */ + Second: number; + /** + * The recurring event will occur once a month, on the specified day or days of the third week in the month. + * Value: The integer 3 value. + */ + Third: number; + /** + * The recurring event will occur once a month, on the specified day or days of the fourth week in the month. + * Value: The integer 4 value; + */ + Fourth: number; + /** + * The recurring event will occur once a month, on the specified day or days of the last week in the month. + * Value: The integer 5 value; + */ + Last: number; +} +/** + * Represents a client-side equivalent of the WeekDaysCheckEdit control. + */ +interface ASPxClientWeekDaysCheckEdit extends ASPxClientControl { + /** + * Gets the selection state of the week day check boxes. + */ + GetValue(): ASPxClientWeekDays; + /** + * Gets the selection state of the week day check boxes. + * @param value An ASPxClientWeekDays object specifying the selection state of the week day check boxes. + */ + SetValue(value: ASPxClientWeekDays): void; +} +/** + * Represents a client-side equivalent of the RecurrenceRangeControl. + */ +interface ASPxClientRecurrenceRangeControl extends ASPxClientControl { + /** + * Gets the type of the recurrence range. + */ + GetRange(): ASPxClientRecurrenceRange; + /** + * Gets how many times the appointment occurs. + */ + GetOccurrenceCount(): number; + /** + * Gets the recurrence end date. + */ + GetEndDate(): Date; + /** + * Sets the type of the recurrence range. + * @param range An ASPxClientRecurrenceRangeenumeration value that specifies the recurrence range type. + */ + SetRange(range: ASPxClientRecurrenceRange): void; + /** + * Sets how many times the appointment occurs. + * @param occurrenceCount An integer value that specifies how many times the appointment occurs. + */ + SetOccurrenceCount(occurrenceCount: number): void; + /** + * Sets the recurrence end date. + * @param date A JavaScript Date object that specifies the end date for the recurrence. + */ + SetEndDate(date: Date): void; +} +/** + * A base for client equivalents of recurrence controls available in the XtraScheduler library. + */ +interface ASPxClientRecurrenceControlBase extends ASPxClientControl { + /** + * Returns an object providing access to the ASPxClientRecurrenceControlBase control's editor values. + */ + CreateValueAccessor(): DefaultRecurrenceRuleValuesAccessor; + /** + * Updates values of editors displayed by the ASPxClientRecurrenceControlBase control. + * @param recurrenceInfo An ASPxClientRecurrenceInfo object containing new editor values. + */ + Update(recurrenceInfo: ASPxClientRecurrenceInfo): void; +} +/** + * Represents a client-side equivalent of the DailyRecurrenceControl - a control for specifying the daily recurrence. + */ +interface ASPxClientDailyRecurrenceControl extends ASPxClientRecurrenceControlBase { + /** + * Returns an object providing access to the ASPxClientDailyRecurrenceControl's editor values. + */ + CreateValueAccessor(): DefaultRecurrenceRuleValuesAccessor; + /** + * Updates values of editors displayed by the ASPxClientDailyRecurrenceControl. + * @param recurrenceInfo An ASPxClientRecurrenceInfo object containing new editor values. + */ + Update(recurrenceInfo: ASPxClientRecurrenceInfo): void; +} +/** + * Represents a client-side equivalent of the WeeklyRecurrenceControl. + */ +interface ASPxClientWeeklyRecurrenceControl extends ASPxClientRecurrenceControlBase { + /** + * Returns an object providing access to the ASPxClientWeeklyRecurrenceControl's editor values. + */ + CreateValueAccessor(): DefaultRecurrenceRuleValuesAccessor; + /** + * Updates values of editors displayed by the ASPxClientWeeklyRecurrenceControl. + * @param recurrenceInfo An ASPxClientRecurrenceInfo object containing new editor values. + */ + Update(recurrenceInfo: ASPxClientRecurrenceInfo): void; +} +/** + * Represents a client-side equivalent of the MonthlyRecurrenceControl. + */ +interface ASPxClientMonthlyRecurrenceControl extends ASPxClientRecurrenceControlBase { + /** + * Returns an object providing access to the ASPxClientMonthlyRecurrenceControl's editor values. + */ + CreateValueAccessor(): DefaultRecurrenceRuleValuesAccessor; + /** + * Updates values of editors displayed by the ASPxClientMonthlyRecurrenceControll. + * @param recurrenceInfo An ASPxClientRecurrenceInfo object containing new editor values. + */ + Update(recurrenceInfo: ASPxClientRecurrenceInfo): void; +} +/** + * Represents a client-side equivalent of the YearlyRecurrenceControl. + */ +interface ASPxClientYearlyRecurrenceControl extends ASPxClientRecurrenceControlBase { + /** + * Returns an object providing access to the ASPxClientYearlyRecurrenceControl's editor values. + */ + CreateValueAccessor(): DefaultRecurrenceRuleValuesAccessor; + /** + * Updates values of editors displayed by the ASPxClientYearlyRecurrenceControl. + * @param recurrenceInfo An ASPxClientRecurrenceInfo object containing new editor values. + */ + Update(recurrenceInfo: ASPxClientRecurrenceInfo): void; +} +/** + * An object providing access to an ASPxClientRecurrenceControlBase control's editor values. + */ +interface DefaultRecurrenceRuleValuesAccessor { + /** + * Get the frequency with which the appointment occurs with respect to the appointment's recurrence type. + */ + GetPeriodicity(): number; + /** + * Gets the number of the month's day in which the appointment is scheduled. + */ + GetDayNumber(): number; + /** + * Gets or sets the month's number. + */ + GetMonth(): number; + /** + * Gets the days of the week on which a weekly recurrent appointment is scheduled. + */ + GetWeekDays(): ASPxClientWeekDays; + /** + * Gets the number of the week in a month when an appointment is scheduled. + */ + GetWeekOfMonth(): ASPxClientWeekOfMonth; +} +/** + * An object providing access to an ASPxClientDailyRecurrenceControl's editor values. + */ +interface DailyRecurrenceValuesAccessor extends DefaultRecurrenceRuleValuesAccessor { + /** + * Gets the number of days between appointment occurrences. + */ + GetPeriodicity(): number; + /** + * Gets the days of the week to which a daily recurrent appointment is scheduled. + */ + GetWeekDays(): ASPxClientWeekDays; +} +/** + * An object providing access to an ASPxClientWeeklyRecurrenceControl's editor values. + */ +interface WeeklyRecurrenceValuesAccessor extends DefaultRecurrenceRuleValuesAccessor { + /** + * Gets the number of weeks between appointment occurrences. + */ + GetPeriodicity(): number; + /** + * Gets the days of the week on which a weekly recurrent appointment is scheduled. + */ + GetWeekDays(): ASPxClientWeekDays; +} +/** + * An object providing access to an ASPxClientMonthlyRecurrenceControl's editor values. + */ +interface MonthlyRecurrenceValuesAccessor extends DefaultRecurrenceRuleValuesAccessor { + /** + * Gets the day of the month on which the appointment is scheduled. + */ + GetDayNumber(): number; + /** + * Gets the number of months between appointment occurrences. + */ + GetPeriodicity(): number; + /** + * Gets the days of the week on which a monthly recurrent appointment is scheduled. + */ + GetWeekDays(): ASPxClientWeekDays; + /** + * Gets the number of the week in a month when an appointment is scheduled. + */ + GetWeekOfMonth(): ASPxClientWeekOfMonth; +} +/** + * An object providing access to an ASPxClientYearlyRecurrenceControl's editor values. + */ +interface YearlyRecurrenceValuesAccessor extends DefaultRecurrenceRuleValuesAccessor { + /** + * Gets the day of the month on which the appointment is scheduled. + */ + GetDayNumber(): number; + /** + * Gets or sets the month's number. + */ + GetMonth(): number; + /** + * Gets the days of the week on which a yearly recurrent appointment is scheduled. + */ + GetWeekDays(): ASPxClientWeekDays; + /** + * Gets or sets the number of a week in a month when an appointment is scheduled. + */ + GetWeekOfMonth(): ASPxClientWeekOfMonth; +} +/** + * Provides base functionality for ASPxClientScheduler's forms. + */ +interface ASPxClientFormBase { + /** + * Occurs when the form has been closed. + */ + FormClosed: ASPxClientEvent>; + /** + * Closes the form. + */ + Close(): void; + /** + * Sets the visibility state of the specified form element. + * @param element An object specifying the element whose visibility state should be changed. + * @param isVisible true to display the element; false to hide the element. + */ + SetVisibleCore(element: Object, isVisible: boolean): void; +} +/** + * Represents a client-side equivalent of the RecurrenceTypeEdit. + */ +interface ASPxClientRecurrenceTypeEdit extends ASPxClientRadioButtonList { + /** + * Gets the selected recurrence type. + */ + GetRecurrenceType(): ASPxClientRecurrenceType; + /** + * Sets the selected recurrence type. + * @param recurrenceType An ASPxClientRecurrenceType enumeration value. + */ + SetRecurrenceType(recurrenceType: ASPxClientRecurrenceType): void; +} +/** + * Contains lists of property names for different appointment types. + */ +interface AppointmentPropertyNames { + /** + * Gets the list of properties characteristic for appointments of the Normal type. + * Value: A string array which is composed of the appointment property names. + */ + Normal: string; + /** + * Gets the list of properties characteristic for appointments of the Pattern type. + * Value: A string array which is composed of the appointment property names. + */ + Pattern: string; +} +/** + * Represents the client-side equivalent of the TimeInterval class. + */ +interface ASPxClientTimeInterval { + /** + * Gets a value indicating if the time interval is All-Day. + */ + GetAllDay(): boolean; + /** + * Sets a value specifying if the time interval is All-Day. + * @param allDayValue true, if this is an all-day time interval; otherwise, false. + */ + SetAllDay(allDayValue: boolean): void; + /** + * Client-side function that returns the start time of the interval. + */ + GetStart(): Date; + /** + * Client-side function that returns the duration of the specified time interval. + */ + GetDuration(): number; + /** + * Client-side function that returns the end time of the interval. + */ + GetEnd(): Date; + /** + * Client-side function that sets the start time of the interval. + * @param value A DateTime value, representing the beginning of the interval. + */ + SetStart(value: Date): void; + /** + * Client-side function that returns the duration of the specified time interval. + * @param value A TimeSpan object, representing the duration of the time period. + */ + SetDuration(value: any): void; + /** + * Client-side function that sets the end time of the interval. + * @param value A DateTime value, representing the end of the interval. + */ + SetEnd(value: Date): void; + /** + * Determines whether the specified object is equal to the current ASPxClientTimeInterval instance. + * @param interval The object to compare with the current object. + */ + Equals(interval: ASPxClientTimeInterval): boolean; + /** + * Checks if the current time interval intersects with the specified time interval. + * @param interval A ASPxClientTimeInterval object which represents the time interval to be checked. + */ + IntersectsWith(interval: ASPxClientTimeInterval): boolean; + /** + * Checks if the current time interval intersects with the specified time interval. The boundaries of the time intervals are excluded from the check. + * @param interval A ASPxClientTimeInterval object which represents the time interval to be checked. + */ + IntersectsWithExcludingBounds(interval: ASPxClientTimeInterval): boolean; + /** + * Client-side function that determines whether the specified interval is contained within the current one. + * @param interval An ASPxClientTimeInterval object, representing the time interval to check. + */ + Contains(interval: ASPxClientTimeInterval): boolean; +} +/** + * Holds action types for the client-side Refresh method. + */ +interface ASPxClientSchedulerRefreshAction { + /** + * Gets the value of the action parameter which initiates a simple reload of the control. + * Value: An integer representing the action parameter value. + */ + None: number; + /** + * Gets the value of the action parameter which initiates reloading of the main ASPxScheduler control and its data-dependent satellites. + * Value: An integer representing the action parameter value. + */ + VisibleIntervalChanged: number; + /** + * Gets the value of the action parameter which initiates reloading of the main ASPxScheduler control and its satellite View controls. + * Value: An integer representing the action parameter value. + */ + ActiveViewTypeChanged: number; +} +/** + * Contains methods allowing you to perform or cancel an operation. + */ +interface ASPxClientAppointmentOperation { + /** + * Passes parameters to the corresponding callback function to accomplish the operation. + */ + Apply(): void; + /** + * Cancels the operation. + */ + Cancel(): void; +} +/** + * Represents the client-side equivalent of the ASPxScheduler control. + */ +interface ASPxClientScheduler extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientScheduler. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side when the Scheduler control is about to change its active view. + */ + ActiveViewChanging: ASPxClientEvent>; + /** + * Client-side event. Occurs after the active view of the ASPxScheduler has been changed. + */ + ActiveViewChanged: ASPxClientEvent>; + /** + * Occurs when an end-user presses a keyboard shortcut. + */ + Shortcut: ASPxClientEvent>; + /** + * Occurs when the end-user clicks an appointment. + */ + AppointmentClick: ASPxClientEvent>; + /** + * Occurs when the end-user double clicks on an appointment. + */ + AppointmentDoubleClick: ASPxClientEvent>; + /** + * Occurs when an end-user clicks a time cell. + */ + CellClick: ASPxClientEvent>; + /** + * Occurs when and end-user double-clicks a time cell. + */ + CellDoubleClick: ASPxClientEvent>; + /** + * Occurs on the client side when the user selects an appointment. + */ + AppointmentsSelectionChanged: ASPxClientEvent>; + /** + * Fires on the client side when the time cell selection is changed. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Occurs on the client side when the time cell selection is about to change. + */ + SelectionChanging: ASPxClientEvent>; + /** + * Fires on the client side when the time interval of the scheduling area is changed. + */ + VisibleIntervalChanged: ASPxClientEvent>; + /** + * Occurs when one of More Buttons is clicked. + */ + MoreButtonClicked: ASPxClientEvent>; + /** + * Client-side event that occurs when a popup menu item is clicked. + */ + MenuItemClicked: ASPxClientEvent>; + /** + * Client-side event that occurs after an appointment has been dragged and dropped. + */ + AppointmentDrop: ASPxClientEvent>; + /** + * A client-side event that occurs when an appointment is being dragged. + */ + AppointmentDrag: ASPxClientEvent>; + /** + * A client-side event that occurs when an appointment is being resized. + */ + AppointmentResizing: ASPxClientEvent>; + /** + * Client-side event that occurs when an appointment is resized. + */ + AppointmentResize: ASPxClientEvent>; + /** + * Client-side event that fires before an appointment is deleted. + */ + AppointmentDeleting: ASPxClientEvent>; + /** + * Client-side scripting method that gets the active View. + */ + GetActiveViewType(): ASPxSchedulerViewType; + /** + * Client-side scripting method to change the ASPxScheduler's active View. + * @param value A ASPxSchedulerViewType enumeration value, representing a view type to set. + */ + SetActiveViewType(value: ASPxSchedulerViewType): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Client-side scripting method which initiates a round trip to the server so that the current page will be reloaded. + */ + Refresh(): void; + /** + * Client-side scripting method which initiates a round trip to the server, so that the control will be reloaded using the specified refresh action. + * @param refreshAction An ASPxClientSchedulerRefreshAction enumeration value, specifying the refresh action. + */ + Refresh(refreshAction: ASPxClientSchedulerRefreshAction): void; + /** + * Client-side function that returns the type of grouping applied to the appointments displayed in the scheduler. + */ + GetGroupType(): ASPxSchedulerGroupType; + /** + * Client-side scripting method which raises the callback command to set the GroupType. + * @param value An ASPxSchedulerGroupType enumeration value, which specifies how appointments are grouped. + */ + SetGroupType(value: ASPxSchedulerGroupType): void; + /** + * Client-side method that navigates the scheduler to the current system date. + */ + GotoToday(): void; + /** + * Client-side scripting method which raises the GotoDate callback command. + * @param date A DateTime value specifying the destination time. + */ + GotoDate(date: Date): void; + /** + * Client-side function which slides the visible interval one time span back. + */ + NavigateBackward(): void; + /** + * Client-side function which slides the visible interval one time span forward. + */ + NavigateForward(): void; + /** + * Client-side method which raises the callback command to change the ClientTimeZoneId of the scheduler. + * @param timeZoneId A string, a time zone identifier which is valid for the System.TimeZoneInfo.Id property. + */ + ChangeTimeZoneId(timeZoneId: string): void; + /** + * Displays a Selection ToolTip on a position given by the specified coordinates. + * @param x An integer representing the X-coordinate. + * @param y An integer representing the Y-coordinate. + */ + ShowSelectionToolTip(x: number, y: number): void; + /** + * Client-side function that returns the time interval, selected in the scheduler. + */ + GetSelectedInterval(): ASPxClientTimeInterval; + /** + * Client-side function that returns the ResourceId of selected time cell's resource. + */ + GetSelectedResource(): string; + /** + * Gets a collection of visible appointments. + */ + GetVisibleAppointments(): ASPxClientAppointment[]; + /** + * Client-side function that returns an appointment with the specified ID. + * @param id An appointment's identifier. + */ + GetAppointmentById(id: Object): ASPxClientAppointment; + /** + * Client-side function that returns the id's of selected appointments. + */ + GetSelectedAppointmentIds(): string[]; + /** + * Client-side function that removes the appointment specified by its client ID from a collection of selected appointments. + * @param aptId An appointment's identifier. + */ + DeselectAppointmentById(aptId: Object): void; + /** + * Client-side function that selects an appointment with the specified ID. + * @param aptId An appointment's identifier. + */ + SelectAppointmentById(aptId: Object): void; + /** + * Enables obtaining appointment property values in a client-side script. Executes the callback command with the AppointmentData identifier. + * @param aptId An integer, representing the appointment ID. + * @param propertyNames An array of strings, representing the appointment properties to query. + * @param onCallBack A handler of a function which will receive and process the properties' values. + */ + GetAppointmentProperties(aptId: number, propertyNames: string[], onCallBack: Object): string[]; + /** + * Initiates a callback to retrieve and apply the values for the specified list of properties to the specified appointment, and transfer control to the specified function. + * @param clientAppointment An ASPxClientAppointment object that is the client appointment for which the data is retrieved. + * @param propertyNames An array of strings, that are the names of appointment properties to query. + * @param onCallBack A handler of a function executed after a callback. + */ + RefreshClientAppointmentProperties(clientAppointment: ASPxClientAppointment, propertyNames: string[], onCallBack: Object): void; + /** + * Client-side function that invokes the editing form for the appointment specified by its client ID. + * @param aptClientId A string, representing the appointment client identifier. + */ + ShowAppointmentFormByClientId(aptClientId: string): void; + /** + * Client-side function that invokes the editing form for the appointment specified by its storage identifier. + * @param aptServerId A string, representing the appointment identifier. + */ + ShowAppointmentFormByServerId(aptServerId: string): void; + /** + * Sets the time of the day corresponding to the start of the topmost displayed time cell row. + * @param duration An integer, representing the number of milliseconds passed since the start of the day. + * @param viewType An ASPxSchedulerViewType enumeration member, representing the scheduler's View. It can be either 'Day' or 'WorkWeek'. + */ + SetTopRowTime(duration: number, viewType: ASPxSchedulerViewType): void; + /** + * Sets the time of the day corresponding to the start of the topmost displayed time cell row. + * @param duration An integer, representing the number of milliseconds passed since the start of the day. + */ + SetTopRowTime(duration: number): void; + /** + * Gets the time of the day corresponding to the start of the topmost displayed time cell row. + * @param viewType An ASPxSchedulerViewType enumeration member, representing the scheduler's View. It can be either "Day" or "WorkWeek", otherwise the result is undefined. + */ + GetTopRowTime(viewType: ASPxSchedulerViewType): number; + /** + * Gets the time of day corresponding to the start of the topmost displayed time cell row. + */ + GetTopRowTime(): number; + /** + * Client-side scripting method which displays the Loading Panel. + */ + ShowLoadingPanel(): void; + /** + * Client-side scripting method which hides the Loading Panel from view. + */ + HideLoadingPanel(): void; + /** + * Client-side method that invokes the inplace editor form to create a new appointment. + * @param start A date object, representing the start of the new appointment. + * @param end A date object, representing the end of the new appointment. + */ + ShowInplaceEditor(start: Date, end: Date): void; + /** + * Client-side method that invokes the inplace editor form to create a new appointment. + * @param start A date object, representing the start of the new appointment. + * @param end A date object, representing the end of the new appointment. + * @param resourceId An object representing the identifier of a resource associated with the new appointment. + */ + ShowInplaceEditor(start: Date, end: Date, resourceId: string): void; + /** + * Client-side scripting method to insert the specified appointment. + * @param apt An ASPxClientAppointment object representing the client-side appointment. + */ + InsertAppointment(apt: ASPxClientAppointment): void; + /** + * Client-side scripting method to update the specified appointment. + * @param apt An ASPxClientAppointment object representing the client-side appointment. + */ + UpdateAppointment(apt: ASPxClientAppointment): void; + /** + * Client-side scripting method to delete the specified appointment. + * @param apt An ASPxClientAppointment object representing the client-side appointment. + */ + DeleteAppointment(apt: ASPxClientAppointment): void; + /** + * Client-side method that allows retrieving a collection of time intervals displayed by the ASPxScheduler. + */ + GetVisibleIntervals(): ASPxClientTimeInterval[]; + /** + * Changes the container that the ASPxScheduler tooltip belongs to. + * @param container An object that serves as the new container for the pop-up menu. + */ + ChangeToolTipContainer(container: Object): void; + /** + * Changes the container that the ASPxScheduler pop-up menu belongs to. + * @param container An object that serves as the new container for the pop-up menu. + */ + ChangePopupMenuContainer(container: Object): void; + /** + * Returns focus to the form if the ASPxScheduler control is not visible when the reminder fires. + * @param container A DIV object that is located in such a way that it is visible on the page in situations when the ASPxScheduler control is hidden. + */ + ChangeFormContainer(container: Object): void; + /** + * Client-side scripting method that saves appointment modifications and closes the form. + */ + AppointmentFormSave(): void; + /** + * Client-side scripting method that deletes the appointment being edited. + */ + AppointmentFormDelete(): void; + /** + * Client-side scripting method that cancels changes and closes the appointment editing form. + */ + AppointmentFormCancel(): void; + /** + * Client-side scripting method that navigates the scheduler to the date selected in the GotoDate form and closes the form. + */ + GoToDateFormApply(): void; + /** + * Client-side scripting method that cancels changes and closes the GotoDate form. + */ + GoToDateFormCancel(): void; + /** + * Client-side scripting method that cancels changes and closes the form. + */ + InplaceEditFormSave(): void; + /** + * Client-side scripting method that cancels changes and closes the form. + */ + InplaceEditFormCancel(): void; + /** + * Client-side scripting method that invokes the appointment editing form for the appointment being edited in the inplace editor. + */ + InplaceEditFormShowMore(): void; + /** + * Client-side scripting method that closes the Reminder form. + */ + ReminderFormCancel(): void; + /** + * Client-side scripting method that calls the Dismiss method for the selected reminder. + */ + ReminderFormDismiss(): void; + /** + * Client-side scripting method that dismisses all reminders shown in the Reminder form. + */ + ReminderFormDismissAll(): void; + /** + * Client-side scripting method that changes the alert time for the selected reminder to the specified interval. + */ + ReminderFormSnooze(): void; +} +/** + * Represents a client-side equivalent of the SchedulerViewType object. + */ +interface ASPxSchedulerViewType { + /** + * Gets a string representation equivalent of Day enumeration for use in client scripts. + * Value: A string "Day", indicating the DayView. + */ + Day: string; + /** + * Gets a string representation equivalent of WorkWeek enumeration for use in client scripts. + * Value: A string "WorkWeek", indicating the WorkWeekView. + */ + WorkWeek: string; + /** + * Gets a string representation equivalent of Week enumeration for use in client scripts. + * Value: A string "Week", indicating the WeekView. + */ + Week: string; + /** + * Gets a string representation equivalent of Month enumeration for use in client scripts. + * Value: A string "Month", indicating the MonthView. + */ + Month: string; + /** + * Gets a string representation equivalent of Timeline enumeration for use in client scripts. + * Value: A string "Timeline", indicating the TimelineView. + */ + Timeline: string; + /** + * Gets a string representation equivalent of FullWeek enumeration for use in client scripts. + * Value: A string "FullWeek", indicating the FullWeekView. + */ + FullWeek: string; + /** + * Gets a string representation equivalent to the Agenda enumeration for use in client scripts. + * Value: A string "Agenda", indicating the AgendaView. + */ + Agenda: string; +} +/** + * Represents a client-side equivalent of the SchedulerGroupType enumeration. + */ +interface ASPxSchedulerGroupType { + /** + * Gets a string representation equivalent of None enumeration for use in client scripts. + * Value: A "None" string value. + */ + None: string; + /** + * Gets a string representation equivalent of Date enumeration for use in client scripts. + * Value: A "Date" string value. + */ + Date: string; + /** + * Gets a string representation equivalent of Resource enumeration for use in client scripts. + * Value: A "Resource" string value. + */ + Resource: string; +} +/** + * Represents a client-side equivalent of the AppointmentType enumeration. + */ +interface ASPxAppointmentType { + /** + * Gets a string representation equivalent of Normal enumeration for use in client scripts. + * Value: A "Normal" string value. + */ + Normal: string; + /** + * Gets a string representation equivalent of Pattern enumeration for use in client scripts. + * Value: A "Pattern" string value. + */ + Pattern: string; + /** + * Gets a string representation equivalent of Occurrence enumeration for use in client scripts. + * Value: An "Occurrence" string value. + */ + Occurrence: string; + /** + * Gets a string representation equivalent of ChangedOccurrence enumeration for use in client scripts. + * Value: A "ChangedOccurrence" string value. + */ + ChangedOccurrence: string; + /** + * Gets a string representation equivalent of DeletedOccurrence enumeration for use in client scripts. + * Value: A "DeletedOccurrence" string value. + */ + DeletedOccurrence: string; +} +interface ASPxClientAppointmentDeletingEventHandler { + /** + * A method that will handle the AppointmentDeleting event. + * @param source The event sender (typically an ASPxClientScheduler control). + * @param e A ASPxClientAppointmentDeletingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientAppointmentDeletingEventArgs): void; +} +/** + * Provides data for the AppointmentDeleting event. + */ +interface ASPxClientAppointmentDeletingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets client IDs of the appointments that are intended to be removed. + * Value: An array of client appointment identifiers, representing appointments passed for deletion. + */ + appointmentIds: Object[]; +} +interface AppointmentClickEventHandler { + /** + * A method that will handle the AppointmentClick event. + * @param source The event sender (typically an ASPxClientScheduler control). + * @param e A AppointmentClickEventArgs object that contains event data. + */ + (source: S, e: AppointmentClickEventArgs): void; +} +/** + * Provides data for the AppointmentDoubleClick events. + */ +interface AppointmentClickEventArgs extends ASPxClientEventArgs { + /** + * Gets the client appointment ID for the appointment being clicked. + * Value: A string, representing the client ID of the appointment. + */ + appointmentId: string; + /** + * Gets the HTML element that the event was triggered on. + * Value: An object containing event data. + */ + htmlElement: Object; + /** + * Gets or sets whether an event is handled, and that default actions are not required. + * Value: true if no default processing is required; otherwise, false. + */ + handled: boolean; +} +/** + * A method that will handle the AppointmentsSelectionChanged event. + */ +interface AppointmentsSelectionEventHandler { + /** + * A method that will handle the AppointmentsSelectionChanged event. + * @param source The ASPxScheduler control which fires the event. + * @param e A AppointmentsSelectionEventArgs object that contains event data. + */ + (source: S, e: AppointmentsSelectionEventArgs): void; +} +/** + * Provides data for the AppointmentsSelectionChanged event. + */ +interface AppointmentsSelectionEventArgs extends ASPxClientEventArgs { + /** + * Gets identifiers of the selected appointments. + * Value: A comma separated list of string values, representing appointment IDs. + */ + appointmentIds: string[]; +} +/** + * A method that will handle the Shortcut event. + */ +interface ShortcutEventHandler { + /** + * A method that will handle the Shortcut event. + * @param source The event sender (typically an ASPxClientScheduler control). + * @param e A ShortcutEventArgs object that contains event data. + */ + (source: S, e: ShortcutEventArgs): void; +} +/** + * Provides data for the client-side Shortcut event. + */ +interface ShortcutEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of a command associated with the keyboard shortcut. + * Value: A string containing a command name. + */ + commandName: string; + /** + * Gets an object containing information about a keyboard shortcut event. + * Value: An object containing event data. + */ + htmlEvent: Object; + /** + * Gets or sets whether an event is handled, and that default actions are not required. + * Value: true, if no default processing is required; otherwise, false. + */ + handled: boolean; +} +/** + * A method that will handle the ActiveViewChanging event. + */ +interface ActiveViewChangingEventHandler { + /** + * A method that will handle the ActiveViewChanging event. + * @param source The ASPxClientScheduler control which fires the event. + * @param e An ActiveViewChangingEventArgs object that contains event data + */ + (source: S, e: ActiveViewChangingEventArgs): void; +} +/** + * Provides data for the client-side ActiveViewChanging event. + */ +interface ActiveViewChangingEventArgs extends ASPxClientEventArgs { + /** + * Gets the value of the ActiveView property before modification. + * Value: A SchedulerViewType enumeration. + */ + oldView: ASPxSchedulerViewType; + /** + * Gets the new value of the ActiveView property. + * Value: A string, which is the SchedulerViewType enumeration value. + */ + newView: ASPxSchedulerViewType; + /** + * Gets or sets whether the change of active view should be canceled. + * Value: true to cancel the operation; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the MoreButtonClicked event. + */ +interface MoreButtonClickedEventHandler { + /** + * A method that will handle MoreButtonClicked event. + * @param source The ASPxClientScheduler control which fires the event. + * @param e A MoreButtonClickedEventArgs object that contains event data. + */ + (source: S, e: MoreButtonClickedEventArgs): void; +} +/** + * Provides data for the MoreButtonClicked client-side event. + */ +interface MoreButtonClickedEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the Start or End values of the target appointment. + * Value: A DateTime value representing the target appointment's boundary. + */ + targetDateTime: Date; + /** + * Gets the time interval of the cell where the button is located. + * Value: An ASPxClientTimeInterval object representing the time interval of the cell which holds the button. + */ + interval: ASPxClientTimeInterval; + /** + * Gets the resource identifier associated with the cell where the button is located. + * Value: A string, corresponding to ResourceId. + */ + resource: string; + /** + * Gets or sets whether an event is handled. If it is handled, default actions are not required. + * Value: true if no default processing is required; otherwise, false. + */ + handled: boolean; +} +/** + * A method that will handle the MenuItemClicked event. + */ +interface MenuItemClickedEventHandler { + /** + * A method that will handle the MenuItemClicked event. + * @param source The ASPxClientScheduler control which fires the event. + * @param e A MenuItemClickedEventArgs object that contains event data. + */ + (source: S, e: MenuItemClickedEventArgs): void; +} +/** + * Provides data for the MenuItemClicked event. + */ +interface MenuItemClickedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the menu item which is clicked. + * Value: A string, containing the menu item name. + */ + itemName: string; + /** + * Gets or sets whether an event is handled, and that default actions are not required. + * Value: true if no default processing is required; otherwise, false. + */ + handled: boolean; +} +/** + * A method that will handle the AppointmentDrag event. + */ +interface AppointmentDragEventHandler { + /** + * A method that will handle the AppointmentDrag event. + * @param source The event sender (typically an ASPxClientScheduler object). + * @param e A ASPxClientAppointmentDragEventArgs object that contains event data. + */ + (source: S, e: ASPxClientAppointmentDragEventArgs): void; +} +/** + * Provides data for the AppointmentDrag event. + */ +interface ASPxClientAppointmentDragEventArgs extends ASPxClientEventArgs { + /** + * Specifies whether or not appointments can be dropped into the intervals over which they are currently dragged. + * Value: true to allow dropping appointments; otherwise, false. + */ + allow: boolean; + /** + * Gets a mouse event object related to the current drag operation. + * Value: An object providing event properties specific to mouse events. + */ + mouseEvent: Object; + /** + * Provides information about dragged appointments. + * Value: An array of ASPxClientAppointmentDragInfo objects storing information about dragged appointments. + */ + dragInformation: ASPxClientAppointmentDragInfo[]; +} +/** + * A method that will handle the AppointmentDrop event. + */ +interface AppointmentDropEventHandler { + /** + * A method that will handle the AppointmentDrop event. + * @param source The event sender (typically an ASPxClientScheduler object). + * @param e A ASPxClientAppointmentDropEventArgs object that contains event data. + */ + (source: S, e: ASPxClientAppointmentDropEventArgs): void; +} +/** + * Provides data for the AppointmentDrop event. + */ +interface ASPxClientAppointmentDropEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets a value that specifies whether the event is handled, and the default processing is not required. + * Value: true, if if the event is completely handled by custom code and no default processing is required; otherwise, false. + */ + handled: boolean; + /** + * Provides access to an object that enables you to choose an operation to perform. + * Value: An ASPxClientAppointmentOperation object providing methods to perform the required operation. + */ + operation: ASPxClientAppointmentOperation; + /** + * Provides information about dropped appointments. + * Value: An array of ASPxClientAppointmentDragInfo objects storing information about dropped appointments. + */ + dragInformation: ASPxClientAppointmentDragInfo[]; +} +interface AppointmentResizeEventHandler { + /** + * A method that will handle the AppointmentResize event. + * @param source The event sender (typically an ASPxClientScheduler control). + * @param e A ASPxClientAppointmentResizeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientAppointmentResizeEventArgs): void; +} +/** + * Provides data for the AppointmentResize event. + */ +interface ASPxClientAppointmentResizeEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets whether default event processing is required. + * Value: true to process an event using only custom code; otherwise, false. + */ + handled: boolean; + /** + * Provides access to an object that enables you to choose an operation to perform. + * Value: An ASPxClientAppointmentOperation object providing methods to perform the required operation. + */ + operation: ASPxClientAppointmentOperation; + /** + * Gets the resized appointment's identifier. + * Value: A string containing an appointment identifier. + */ + appointmentId: string; + /** + * Gets the appointment's interval before resizing. + * Value: An object representing the interval assigned to the appointment. + */ + oldInterval: ASPxClientTimeInterval; + /** + * Gets the appointment's interval after resizing. + * Value: An object representing the interval assigned to the appointment. + */ + newInterval: ASPxClientTimeInterval; +} +/** + * A method that will handle the AppointmentResizing event. + */ +interface AppointmentResizingEventHandler { + /** + * A method that will handle the AppointmentResizing event. + * @param source The event sender (typically an ASPxClientScheduler object). + * @param e A ASPxClientAppointmentResizingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientAppointmentResizingEventArgs): void; +} +/** + * Provides data for the AppointmentResizing event. + */ +interface ASPxClientAppointmentResizingEventArgs extends ASPxClientEventArgs { + /** + * Specifies whether or not an appointment can be resized to the new time interval. + * Value: true to allow resizing the appointment; otherwise, false. + */ + allow: boolean; + /** + * Gets a mouse event object related to the current appointment resizing operation. + * Value: An object providing event properties specific to mouse events. + */ + mouseEvent: Object; + /** + * Gets the resized appointment's identifier. + * Value: A string containing an appointment identifier. + */ + appointmentId: string; + /** + * Gets the appointment's interval before resizing. + * Value: An object representing the interval assigned to the appointment. + */ + oldInterval: ASPxClientTimeInterval; + /** + * Gets the appointment's interval after resizing. + * Value: An object representing the interval assigned to the appointment. + */ + newInterval: ASPxClientTimeInterval; +} +/** + * Stores information about an appointment drag operation. + */ +interface ASPxClientAppointmentDragInfo { + /** + * Gets the dragged appointment's identifier. + * Value: A string containing an appointment identifier. + */ + appointmentId: string; + /** + * Gets the appointment's interval before the drag operation. + * Value: An object representing the interval assigned to the appointment. + */ + oldInterval: ASPxClientTimeInterval; + /** + * Gets resources that were associated with the appointment before the drag operation. + * Value: A array of strings containing resource identifiers. + */ + oldResources: string[]; + /** + * Gets the appointment's interval after the drag operation. + * Value: An object representing the interval assigned to the appointment. + */ + newInterval: ASPxClientTimeInterval; + /** + * Gets resources associated with the appointment after the drag operation. + * Value: An array of strings containing resource identifiers. + */ + newResources: string[]; +} +/** + * A method that will handle the CellDoubleClick events. + */ +interface CellClickEventHandler { + /** + * A method that will handle the CellClick event. + * @param source The event sender (typically an ASPxClientScheduler control). + * @param e A CellClickEventArgs object that contains event data. + */ + (source: S, e: CellClickEventArgs): void; +} +/** + * Provides data for the CellDoubleClick events. + */ +interface CellClickEventArgs extends ASPxClientEventArgs { + /** + * Provides access to an object containing information about an HTML element representing the clicked time cell. + * Value: An object containing information about an HTML element. + */ + htmlElement: Object; + /** + * Provides access to a time interval occupied by the clicked time cell. + * Value: An object. + */ + interval: ASPxClientTimeInterval; + /** + * Gets the name of a resource to which the clicked time cell belongs. + * Value: A string containing the name of a resource. + */ + resource: string; +} +/** + * Contains information about a client tooltip. + */ +interface ASPxClientSchedulerToolTipData { + /** + * Returns the client appointment for which the tooltip is displayed. + */ + GetAppointment(): ASPxClientAppointment; + /** + * Returns the client time interval for which the tooltip is displayed. + */ + GetInterval(): ASPxClientTimeInterval; + /** + * Returns the resources associated with the appointment for which the tooltip is displayed. + */ + GetResources(): Object[]; +} +/** + * A client-side equivalent of the ASPxSchedulerToolTipBase control. + */ +interface ASPxClientToolTipBase { + /** + * Returns the value that indicates whether or not the tooltip can be displayed. + */ + CanShowToolTip(): boolean; + /** + * Ends updating the tooltip content. + * @param toolTipData An ASPxClientSchedulerToolTipData object providing data required to update the tooltip content. + */ + FinalizeUpdate(toolTipData: ASPxClientSchedulerToolTipData): void; + /** + * Updates the tooltip content. + * @param toolTipData An ASPxClientSchedulerToolTipData object providing data required to update the tooltip content. + */ + Update(toolTipData: ASPxClientSchedulerToolTipData): void; + /** + * Closes the tooltip. + */ + Close(): void; + /** + * Gets the tooltip position. + * @param bounds An object that represents the tooltip bounds. + */ + CalculatePosition(bounds: Object): ASPxClientPoint; + /** + * Displays the Appointment Menu in the position of the tooltip. + * @param eventObject An object containing information about the event on which the menu is displayed. + */ + ShowAppointmentMenu(eventObject: Object): void; + /** + * Displays the View Menu in the position of the tooltip. + * @param eventObject An object containing information about the event on which the menu is displayed. + */ + ShowViewMenu(eventObject: Object): void; + /** + * Returns the string representation of the specified interval. + * @param interval An ASPxClientTimeInterval object to convert. + */ + ConvertIntervalToString(interval: ASPxClientTimeInterval): string; +} +/** + * Represents the client-side equivalent of the ASPxSpellChecker class. + */ +interface ASPxClientSpellChecker extends ASPxClientControl { + /** + * Client-side event that occurs before the spell check starts. + */ + BeforeCheck: ASPxClientEvent>; + /** + * Client-side event that occurs before a message box informing about process completion is shown. + */ + CheckCompleteFormShowing: ASPxClientEvent>; + /** + * Client-side event that occurs when a spell check is finished. + */ + AfterCheck: ASPxClientEvent>; + /** + * Occurs after a word is changed in a checked text. + */ + WordChanged: ASPxClientEvent>; + /** + * Starts the spelling check of the text contained within the element specified by the CheckedElementID value. + */ + Check(): void; + /** + * Starts checking contents of the specified element. + * @param element An object representing the element being checked. + */ + CheckElement(element: Object): void; + /** + * Starts checking contents of the specified element. + * @param id A string representing the identifier of the element being checked. + */ + CheckElementById(id: string): void; + /** + * Starts checking the contents of controls in the specified container. + * @param containerElement An object representing a control which contains elements being checked. + */ + CheckElementsInContainer(containerElement: Object): void; + /** + * Starts checking the contents of controls in the specified container. + * @param containerId A string, specifying the control's identifier. + */ + CheckElementsInContainerById(containerId: string): void; +} +/** + * Represents an object that will handle the client-side BeforeCheck event. + */ +interface ASPxClientBeforeCheckEventHandler { + /** + * A method that will handle the BeforeCheck event. + * @param source The ASPxClientSpellChecker control which fires the event. + * @param e A ASPxClientSpellCheckerBeforeCheckEventArgs object that contains event data + */ + (source: S, e: ASPxClientSpellCheckerBeforeCheckEventArgs): void; +} +/** + * Provides data for an event that occurs before a spelling check is started. Represents the client-side equivalent of the BeforeCheckEventArgs class. + */ +interface ASPxClientSpellCheckerBeforeCheckEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the programmatic identifier assigned to the control which is going to be checked. + * Value: A string, containing the control's identifier. + */ + controlId: string; +} +/** + * Represents an object that will handle the client-side AfterCheck event. + */ +interface ASPxClientAfterCheckEventHandler { + /** + * A method that will handle the AfterCheck event. + * @param source The ASPxClientSpellChecker control which fires the event. + * @param e A ASPxClientSpellCheckerAfterCheckEventArgs object that contains event data + */ + (source: S, e: ASPxClientSpellCheckerAfterCheckEventArgs): void; +} +/** + * Provides data for the client event that occurs after a spelling check is complete. + */ +interface ASPxClientSpellCheckerAfterCheckEventArgs extends ASPxClientEventArgs { + /** + * Gets the programmatic identifier assigned to the control which has been checked. + * Value: A string, containing the control's identifier. + */ + controlId: string; + /** + * Gets the text that has been checked. + * Value: A string, containing checked text. + */ + checkedText: string; + /** + * Gets a value specifying whether spell checking is finished or stopped by the user. + * Value: A string value identifying the reason ("Default" or "User"). + */ + reason: string; +} +/** + * Represents an object that will handle the client-side WordChanged event. + */ +interface ASPxClientWordChangedEventHandler { + /** + * A method that will handle the AfterCheck event. + * @param source The event source. + * @param e An ASPxClientSpellCheckerAfterCheckEventArgs object which contains event data. + */ + (source: S, e: ASPxClientSpellCheckerAfterCheckEventArgs): void; +} +declare enum ASPxClientSpreadsheetPopupMenuType { + ColumnHeading=0, + RowHeading=1, + SheetTab=3, + Picture=4, + Chart=5, + Cell=7, + AutoFilter=8 +} +/** + * A method that will handle the CustomCommandExecuted event. + */ +interface ASPxClientSpreadsheetCustomCommandExecutedEventHandler { + /** + * A method that will handle the CustomCommandExecuted event. + * @param source An object representing the event source. Identifies the Spreadsheet that raised the event. + * @param e A ASPxClientSpreadsheetCustomCommandExecutedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSpreadsheetCustomCommandExecutedEventArgs): void; +} +/** + * Provides data for the CustomCommandExecuted event. + */ +interface ASPxClientSpreadsheetCustomCommandExecutedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value representing the processed command's name. + */ + commandName: string; + /** + * Gets an optional parameter that complements the processed command. + * Value: A string value containing additional information about the processed command. + */ + parameter: string; + /** + * This property is now obsolete. Use the commandName property instead. + */ + item: ASPxClientRibbonItem; +} +/** + * A method that will handle the DocumentChanged event. + */ +interface ASPxClientSpreadsheetDocumentChangedEventHandler { + /** + * A method that will handle the DocumentChanged event. + * @param source An object representing the event source. Identifies the Spreadsheet that raised the event. + * @param e A ASPxClientSpreadsheetDocumentChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSpreadsheetDocumentChangedEventArgs): void; +} +/** + * Provides data for the DocumentChanged event. + */ +interface ASPxClientSpreadsheetDocumentChangedEventArgs extends ASPxClientEventArgs { +} +/** + * A method that will handle the EndSynchronization events. + */ +interface ASPxClientSpreadsheetSynchronizationEventHandler { + /** + * A method that will handle the EndSynchronization events. + * @param source An object representing the event source. Identifies the Spreadsheet that raised the event. + * @param e A ASPxClientSpreadsheetSynchronizationEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSpreadsheetSynchronizationEventArgs): void; +} +/** + * Provides data for the EndSynchronization events. + */ +interface ASPxClientSpreadsheetSynchronizationEventArgs extends ASPxClientEventArgs { +} +/** + * A method that will handle the HyperlinkClick event. + */ +interface ASPxClientSpreadsheetHyperlinkClickEventHandler { + /** + * A method that will handle the HyperlinkClick event. + * @param source An object representing the event source. Identifies the Spreadsheet that raised the event. + * @param e An ASPxClientSpreadsheetHyperlinkClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSpreadsheetHyperlinkClickEventArgs): void; +} +/** + * Provides data for the HyperlinkClick event. + */ +interface ASPxClientSpreadsheetHyperlinkClickEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets a value that specifies whether the event is handled, and the default processing is not required. + * Value: true, if if the event is completely handled by custom code and no default processing is required; otherwise, false. + */ + handled: boolean; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; + /** + * Gets a value identifying the clicked hyperlink type. + * Value: One of the values. + */ + hyperlinkType: ASPxClientOfficeDocumentLinkType; + /** + * Gets the clicked link's URI. + * Value: A sting value specifying the link's URI. + */ + targetUri: string; +} +/** + * A method that will handle the PopupMenuShowing event. + */ +interface ASPxClientSpreadsheetPopupMenuShowingEventHandler { + /** + * A method that will handle the PopupMenuShowing event. + * @param source The event sender (typically an ASPxClientSpreadsheet object). + * @param e A ASPxClientSpreadsheetPopupMenuShowingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSpreadsheetPopupMenuShowingEventArgs): void; +} +/** + * Provides data for the PopupMenuShowing event. + */ +interface ASPxClientSpreadsheetPopupMenuShowingEventArgs extends ASPxClientCancelEventArgs { + /** + * Provides access to a collection of menu items in the context menu being invoked. + * Value: A object representing the context menu's item collection. + */ + menuItems: ASPxClientSpreadsheetPopupMenuItemCollection; + /** + * Gets the currently displayed context menu's type. + * Value: One of the enumeration values. + */ + menuType: any; +} +/** + * A client-side equivalent of the ASPxSpreadsheet object. + */ +interface ASPxClientSpreadsheet extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientSpreadsheet. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client when a selection is changed in the ASPxSpreadsheet. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Occurs after a custom command has been executed on the client side. + */ + CustomCommandExecuted: ASPxClientEvent>; + /** + * Fires if any change is made to the Spreadsheet's document on the client. + */ + DocumentChanged: ASPxClientEvent>; + /** + * Fires after a client change has been made to the document and the client-server synchronization starts to apply the change on the server. + */ + BeginSynchronization: ASPxClientEvent>; + /** + * Fires after a document change has been applied to the server and server and client document models have been synchronized. + */ + EndSynchronization: ASPxClientEvent>; + /** + * Occurs on the client side after a hyperlink is clicked within the Spreadsheet's document. + */ + HyperlinkClick: ASPxClientEvent>; + /** + * Occurs before the context menu is displayed and allows menu customization. + */ + PopupMenuShowing: ASPxClientEvent>; + /** + * Sets input focus to the Spreadsheet. + */ + Focus(): void; + /** + * Gets access to the client ribbon object. + */ + GetRibbon(): ASPxClientRibbon; + /** + * Enables you to switch the full-screen mode of the Spreadsheet. + * @param fullscreen true to activate full-screen mode; false to deactivate full-screen mode. + */ + SetFullscreenMode(fullscreen: boolean): void; + /** + * Returns the current selection made in a Spreadsheet. + */ + GetSelection(): ASPxClientSpreadsheetSelection; + /** + * Indicates whether any unsaved changes are contained in the current document. + */ + HasUnsavedChanges(): boolean; + /** + * Gets the value of the specified cell. + * @param colModelIndex An integer value specifying the cell's column index. + * @param rowModelIndex An integer value specifying the cell's row index. + */ + GetCellValue(colModelIndex: number, rowModelIndex: number): Object; + /** + * Returns the comment associated with the specified data cell. + * @param colModelIndex An integer value specifying the data cell's column index. + * @param rowModelIndex An integer value specifying the data cell's row index. + */ + GetCellComment(colModelIndex: number, rowModelIndex: number): Object; + /** + * Gets the value of the currently active cell. + */ + GetActiveCellValue(): Object; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side DocumentCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side DocumentCallback event. + */ + PerformDocumentCallback(parameter: string): void; + /** + * Reconnects the Spreadsheet to an external ribbon. + */ + ReconnectToExternalRibbon(): void; +} +/** + * A method that will handle the client SelectionChanged event. + */ +interface ASPxClientSpreadsheetSelectionChangedEventHandler { + /** + * A method that will handle the SelectionChanged event. + * @param source An object representing the event source. Identifies the button editor that raised the event. + * @param e An ASPxClientSpreadsheetSelectionChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSpreadsheetSelectionChangedEventArgs): void; +} +/** + * Provides data for the SelectionChanged event. + */ +interface ASPxClientSpreadsheetSelectionChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets an object that determines the currently selected region within the Spreadsheet. + * Value: A object defining the current selection. + */ + selection: ASPxClientSpreadsheetSelection; +} +/** + * Represents the selection in the Spreadsheet. + */ +interface ASPxClientSpreadsheetSelection { + /** + * Gets the column index of the active cell. + * Value: An integer value specifying the active cell column index. + */ + activeCellColumnIndex: number; + /** + * Gets the row index of the active cell. + * Value: An integer value specifying the active cell row index. + */ + activeCellRowIndex: number; + /** + * Gets the index of the selection's left column. + * Value: An integer value specifying the index of the left column within the selection. + */ + leftColumnIndex: number; + /** + * Gets the index of the selection's top row. + * Value: An integer value specifying the index of the top row within the selection. + */ + topRowIndex: number; + /** + * Gets the index of the selection's right column. + * Value: An integer value specifying the index of the right column within the selection. + */ + rightColumnIndex: number; + /** + * Gets the index of the selection's bottom row. + * Value: An integer value specifying the index of the bottom row within the selection. + */ + bottomRowIndex: number; +} +/** + * Represents an individual item of the Spreadsheet's context menu. + */ +interface ASPxClientSpreadsheetPopupMenuItem { + /** + * Gets the immediate parent menu item to which the current menu item belongs. + * Value: A ASPxClientSpreadsheetPopupMenuItem object representing the menu item's immediate parent. + */ + parent: ASPxClientSpreadsheetPopupMenuItem; + /** + * Gets or sets the unique identifier name for the current menu item. + * Value: A string value that specifies the item's unique identifier name. + */ + name: string; + /** + * Gets or sets the text content of the current menu item. + * Value: A string value that specifies the text content of the menu item. + */ + text: string; + /** + * Gets or sets a value that indicates whether the menu item is enabled, allowing the item to respond to end-user interactions. + * Value: true if the item is enabled; otherwise, false. + */ + enabled: boolean; + /** + * Gets or sets the CSS class name defining the menu item's image. + * Value: A string value specifying the class name. + */ + imageClassName: string; + /** + * Gets or sets an URL which defines the navigation location. + * Value: A string value which represents an URL where the client web browser will navigate. + */ + navigateUrl: string; + /** + * Gets or sets the URL of the menu item's image. + * Value: A string value that specifies the location of an image. + */ + imageUrl: string; + /** + * Gets or sets a value that specifies whether the current menu item starts a group. + * Value: true if the current menu item starts a group; otherwise, false. + */ + beginGroup: boolean; + /** + * Gets or sets the current menu item's tooltip text. + * Value: A string which specifies the text content of the current menu item's tooltip. + */ + tooltip: string; + /** + * Gets or sets the window or frame at which to target the contents of the URL associated with the current menu item. + * Value: A string which identifies the window or frame at which to target the URL content. + */ + target: string; + /** + * Gets a collection that contains the submenu items of the current menu item. + */ + GetSubItems(): ASPxClientSpreadsheetPopupMenuItemCollection; + /** + * Returns the menu item's sub-item with the specified index. + * @param index An integer value specifying the index of the sub-item within a collection of the current menu item's submenu items. + */ + GetItem(index: number): ASPxClientSpreadsheetPopupMenuItem; + /** + * Returns the menu item's sub-item with the specified name property value. + * @param name A string value specifying the name property value of the sub-item to find. + */ + GetItemByName(name: string): ASPxClientSpreadsheetPopupMenuItem; + /** + * Returns the total number of the menu item's child items (submenu items). + */ + GetItemCount(): number; +} +/** + * Represents a collection of items in the Spreadhseet's context menu. + */ +interface ASPxClientSpreadsheetPopupMenuItemCollection { + /** + * Adds the specified menu item to the end of the collection. + * @param item An ASPxClientSpreadsheetPopupMenuItem object specifying the item to be added to the collection. + */ + Add(item: ASPxClientSpreadsheetPopupMenuItem): void; + /** + * Removes a menu item specified by its index within the collection. + * @param index An integer value specifying the index of the menu item to remove. + */ + Remove(index: number): void; + /** + * Removes a menu item specified by its name. + * @param name A string value specifying the name property value of a menu item to remove from the collection. + */ + RemoveByName(name: string): void; + /** + * Adds the specified item to the specified position within the collection. + * @param index An integer value that specifies the zero-based index at which the specified item should be inserted. + * @param item An ASPxClientSpreadsheetPopupMenuItem object to insert. + */ + Insert(index: number, item: ASPxClientSpreadsheetPopupMenuItem): void; + /** + * Returns the total number of menu items in the collection. + */ + GetCount(): number; + /** + * Returns an item object with the specified name property value. + * @param name A string value representing the name property value of the required item. + */ + GetByName(name: string): ASPxClientSpreadsheetPopupMenuItem; + /** + * Returns a menu item specified by its index in the collection. + * @param index An integer value that is the zero-based index of the to retrieve from the ASPxClientSpreadsheetPopupMenuItemCollection. + */ + Get(index: number): ASPxClientSpreadsheetPopupMenuItem; + /** + * Removes all menu items from the collection. + */ + Clear(): void; +} +/** + * Represents the client ASPxTreeList. + */ +interface ASPxClientTreeList extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any unhandled server error occurs during server-side processing of a callback sent by the ASPxClientTreeList. + */ + CallbackError: ASPxClientEvent>; + /** + * Enables you to display a context menu. + */ + ContextMenu: ASPxClientEvent>; + /** + * Occurs when a custom command button has been clicked. + */ + CustomButtonClick: ASPxClientEvent>; + /** + * Fires after a toolbar item has been clicked. + */ + ToolbarItemClick: ASPxClientEvent>; + /** + * Fires before the focused node has been changed. + */ + NodeFocusing: ASPxClientEvent>; + /** + * Fires in response to changing node focus. + */ + FocusedNodeChanged: ASPxClientEvent>; + /** + * Fires after the selection has been changed via end-user interaction. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Fires after the Customization Window has been closed. + */ + CustomizationWindowCloseUp: ASPxClientEvent>; + /** + * Fires after the callback has been processed in the CustomDataCallback event handler. + */ + CustomDataCallback: ASPxClientEvent>; + /** + * Fires on the client when a node is clicked. + */ + NodeClick: ASPxClientEvent>; + /** + * Fires on the client when a node is double clicked. + */ + NodeDblClick: ASPxClientEvent>; + /** + * Fires before a node is expanded. + */ + NodeExpanding: ASPxClientEvent>; + /** + * Fires before a node is collapsed. + */ + NodeCollapsing: ASPxClientEvent>; + /** + * Occurs before a node is dragged by an end-user. + */ + StartDragNode: ASPxClientEvent>; + /** + * Occurs after a node drag and drop operation is completed. + */ + EndDragNode: ASPxClientEvent>; + /** + * Enables you to prevent columns from being resized. + */ + ColumnResizing: ASPxClientEvent>; + /** + * Occurs after a column's width has been changed by an end-user. + */ + ColumnResized: ASPxClientEvent>; + /** + * Sets input focus to the ASPxTreeList. + */ + Focus(): void; + /** + * Gets the Popup Edit Form. + */ + GetPopupEditForm(): ASPxClientPopupControl; + /** + * Returns a toolbar specified by its name. + * @param name A string value specifying the toolbar name. + */ + GetToolbarByName(name: string): ASPxClientMenu; + /** + * Returns a toolbar specified by its index. + * @param index An integer value specifying the zero-based index of the toolbar object to retrieve. + */ + GetToolbar(index: number): ASPxClientMenu; + /** + * Returns the focused node's key value. + */ + GetFocusedNodeKey(): string; + /** + * Moves focus to the specified node. + * @param key A String value that uniquely identifies the node. + */ + SetFocusedNodeKey(key: string): void; + /** + * Indicates whether the specified node is selected. + * @param nodeKey A String value that identifies the node by its key value. + */ + IsNodeSelected(nodeKey: string): any; + /** + * Selects the specified node. + * @param nodeKey A string value that identifies the node. + */ + SelectNode(nodeKey: string): void; + /** + * Selects or deselects the specified node. + * @param nodeKey A string value that identifies the node. + * @param state true to select the node; otherwise, false. + */ + SelectNode(nodeKey: string, state: boolean): void; + /** + * Obtains key values of selected nodes that are displayed within the current page. + */ + GetVisibleSelectedNodeKeys(): string[]; + /** + * Indicates whether the Customization Window is displayed. + */ + IsCustomizationWindowVisible(): boolean; + /** + * Invokes the Customization Window. + */ + ShowCustomizationWindow(): void; + /** + * Invokes the Customization Window and displays it over the specified HTML element. + * @param htmlElement An object that specifies the HTML element relative to whose position the customization window is invoked. + */ + ShowCustomizationWindow(htmlElement: Object): void; + /** + * Closes the Customization Window. + */ + HideCustomizationWindow(): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCustomCallback(arg: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side CustomDataCallback event. + */ + PerformCustomDataCallback(arg: string): void; + /** + * Obtains specified data source field values within a specified node, and submits them to the specified JavaScript function. + * @param nodeKey A string value that identifies the node. + * @param fieldNames A string value that contains the names of data source fields whose values within the specified node are returned. The field names should be separated by ';'. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + */ + GetNodeValues(nodeKey: string, fieldNames: string, onCallback: ASPxClientTreeListValuesCallback): void; + /** + * Obtains specified data source field values within a specified node, and submits them to the specified JavaScript function. + * @param nodeKey A string value that identifies the node. + * @param fieldNames The names of data source fields whose values within the specified node are returned. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + */ + GetNodeValues(nodeKey: string, fieldNames: string[], onCallback: ASPxClientTreeListValuesCallback): void; + /** + * Obtains specified data source field values within nodes that are displayed within the current page, and submits them to the specified JavaScript function. + * @param fieldNames A string value that contains the names of data source fields whose values within visible nodes are returned. The field names should be separated by ';'. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + */ + GetVisibleNodeValues(fieldNames: string, onCallback: ASPxClientTreeListValuesCallback): void; + /** + * Obtains specified data source field values within nodes that are displayed within the current page, and submits them to the specified JavaScript function. + * @param fieldNames The names of data source fields whose values within visible nodes are returned. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + */ + GetVisibleNodeValues(fieldNames: string[], onCallback: ASPxClientTreeListValuesCallback): void; + /** + * Obtains specified data source field values within selected nodes, and submits them to the specified JavaScript function. + * @param fieldNames A string value that contains the names of data source fields whose values within selected nodes are returned. The field names should be separated by ';'. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + */ + GetSelectedNodeValues(fieldNames: string, onCallback: ASPxClientTreeListValuesCallback): void; + /** + * Obtains specified data source field values within selected nodes, and submits them to the specified JavaScript function. + * @param fieldNames The names of data source fields whose values within selected nodes are returned. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + */ + GetSelectedNodeValues(fieldNames: string[], onCallback: ASPxClientTreeListValuesCallback): void; + /** + * Obtains specified data source field values within selected nodes, and submits them to the specified JavaScript function. + * @param fieldNames A string value that contains the names of data source fields whose values within selected nodes are returned. The field names should be separated by ';'. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + * @param visibleOnly true to return values within selected nodes that are displayed within the current page; false to return values within all selected nodes. + */ + GetSelectedNodeValues(fieldNames: string, onCallback: ASPxClientTreeListValuesCallback, visibleOnly: boolean): void; + /** + * Obtains specified data source field values within selected nodes, and submits them to the specified JavaScript function. + * @param fieldNames The names of data source fields whose values within selected nodes are returned. + * @param onCallback A ASPxClientTreeListValuesCallback object that represents the JavaScript function which receives the list of values as a parameter. + * @param visibleOnly true to return values within selected nodes that are displayed within the current page; false to return values within all selected nodes. + */ + GetSelectedNodeValues(fieldNames: string[], onCallback: ASPxClientTreeListValuesCallback, visibleOnly: boolean): void; + /** + * Selects the specified page. + * @param index An integer value that specifies the active page's index. + */ + GoToPage(index: number): void; + /** + * Activates the previous page. + */ + PrevPage(): void; + /** + * Activates the next page. + */ + NextPage(): void; + /** + * Gets the index of the page currently being selected. + */ + GetPageIndex(): number; + /** + * Gets the number of pages to which the ASPxTreeList's data is divided. + */ + GetPageCount(): number; + /** + * Returns the specified node's state. + * @param nodeKey A String value that identifies the node. + */ + GetNodeState(nodeKey: string): string; + /** + * Expands all nodes. + */ + ExpandAll(): void; + /** + * Collapses all Node. + */ + CollapseAll(): void; + /** + * Expands the specified node preserving the collapsed state of child nodes. + * @param key A String value that uniquely identifies the node. + */ + ExpandNode(key: string): void; + /** + * Collapses the specified node preserving the expanded state of child nodes. + * @param key A String value that uniquely identifies the node. + */ + CollapseNode(key: string): void; + /** + * Obtains key values of nodes that are displayed within the current page. + */ + GetVisibleNodeKeys(): string[]; + /** + * Returns an HTML table row that represents the specified node. + * @param nodeKey A string value that identifies the node. + */ + GetNodeHtmlElement(nodeKey: string): Object; + /** + * Returns the number of visible columns within the client ASPxTreeList. + */ + GetVisibleColumnCount(): number; + /** + * Returns the number of columns within the client ASPxTreeList. + */ + GetColumnCount(): number; + /** + * Returns the column located at the specified position within the Columns collection. + * @param index An integer value that identifies the column within the collection (the column's Index property value). + */ + GetColumnByIndex(index: number): ASPxClientTreeListColumn; + /** + * Returns the column with the specified name. + * @param name A string value that specifies the column's name (the column's Name property value). + */ + GetColumnByName(name: string): ASPxClientTreeListColumn; + /** + * Returns the client column which is bound to the specified data source field. + * @param fieldName A string value that specifies the name of the data source field to which the column is bound (the column's FieldName property value). + */ + GetColumnByFieldName(fieldName: string): ASPxClientTreeListColumn; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + */ + SortBy(columnIndex: number): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DESC' or 'NONE'). + */ + SortBy(columnIndex: number, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param columnIndex An integer value that specifies the column's position within the column collection. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DESC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(columnIndex: number, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values. + * @param nameOrFieldName A String value that specifies the column's name or field name. + */ + SortBy(nameOrFieldName: string): void; + /** + * Sorts data by the specified data column's values. + * @param nameOrFieldName A String value that specifies the column's name or field name. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DESC' or 'NONE'). + */ + SortBy(nameOrFieldName: string, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param nameOrFieldName A String value that specifies the column's name or field name. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DESC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(nameOrFieldName: string, sortOrder: string, reset: boolean): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientTreeListColumn object that represents the data column. + */ + SortBy(column: ASPxClientTreeListColumn): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientTreeListColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DESC' or 'NONE'). + */ + SortBy(column: ASPxClientTreeListColumn, sortOrder: string): void; + /** + * Sorts data by the specified data column's values. + * @param column An ASPxClientTreeListColumn object that represents the data column. + * @param sortOrder A string value that specifies the column's sort order ('ASC', 'DESC' or 'NONE'). + * @param reset true to clear any previous sorting; otherwise, false. + */ + SortBy(column: ASPxClientTreeListColumn, sortOrder: string, reset: boolean): void; + /** + * Switches the ASPxTreeList to edit mode. + * @param nodeKey A string value that identifies the node by its key value. + */ + StartEdit(nodeKey: string): void; + /** + * Saves all the changes made and switches the ASPxTreeList to browse mode. + */ + UpdateEdit(): void; + /** + * Cancels all the changes made and switches the ASPxTreeList to browse mode. + */ + CancelEdit(): void; + /** + * Indicates whether the ASPxTreeList is in edit mode. + */ + IsEditing(): boolean; + /** + * Gets the key value of the node currently being edited. + */ + GetEditingNodeKey(): string; + /** + * Moves the specified node to a new position. + * @param nodeKey A string value that identifies the target node by its key value. + * @param parentNodeKey A string value that identifies the node to whose child collection the target node is moved. An empty string to display the target node within the root. + */ + MoveNode(nodeKey: string, parentNodeKey: string): void; + /** + * Deletes the specified node. + * @param nodeKey A string value that identifies the node. + */ + DeleteNode(nodeKey: string): void; + /** + * Switches the ASPxTreeList to edit mode and allows new root node values to be edited. + */ + StartEditNewNode(): void; + /** + * Switches the ASPxTreeList to edit mode and allows new node values to be edited. + * @param parentNodeKey A String value that identifies the parent node, which owns a new node. + */ + StartEditNewNode(parentNodeKey: string): void; + /** + * Returns the editor used to edit the specified column's values. + * @param column An ASPxClientTreeListColumn object that represents the data column within the client ASPxTreeList. + */ + GetEditor(column: ASPxClientTreeListColumn): Object; + /** + * Returns the editor used to edit the specified column's values. + * @param columnIndex An integer value that identifies the column by its position within the column collection. + */ + GetEditor(columnIndex: number): Object; + /** + * Returns the editor used to edit the specified column's values. + * @param columnNameOrFieldName A String value that identifies the column by its name or field name. + */ + GetEditor(columnNameOrFieldName: string): Object; + /** + * Returns the value of the specified edit cell. + * @param column An ASPxClientTreeListColumn object that represents the data column within the client ASPxTreeList. + */ + GetEditValue(column: ASPxClientTreeListColumn): Object; + /** + * Returns the value of the specified edit cell. + * @param columnIndex An integer value that identifies the data column by its index within the ASPxTreeList's column collection. + */ + GetEditValue(columnIndex: number): Object; + /** + * Returns the value of the specified edit cell. + * @param columnNameOrFieldName A String value that identifies the column by its name or field name. + */ + GetEditValue(columnNameOrFieldName: string): Object; + /** + * Sets the value of the specified edit cell. + * @param column An ASPxClientTreeListColumn object that represents the data column within the client ASPxTreeList. + * @param value An object that specifies the edit cell's new value. + */ + SetEditValue(column: ASPxClientTreeListColumn, value: Object): void; + /** + * Sets the value of the specified edit cell. + * @param columnIndex An integer value that identifies the data column by its index within the ASPxTreeList's column collection. + * @param value An object that specifies the edit cell's new value. + */ + SetEditValue(columnIndex: number, value: Object): void; + /** + * Sets the value of the specified edit cell. + * @param columnNameOrFieldName A String value that identifies the column by its name or field name. + * @param value An object that specifies the edit cell's new value. + */ + SetEditValue(columnNameOrFieldName: string, value: Object): void; + /** + * Moves focus to the specified editor within the edited node. + * @param column A ASPxClientTreeListColumn object that represents the data column within the client ASPxTreeList. + */ + FocusEditor(column: ASPxClientTreeListColumn): void; + /** + * Moves focus to the specified editor within the edited node. + * @param columnIndex An integer value that identifies the data column. + */ + FocusEditor(columnIndex: number): void; + /** + * Moves focus to the specified editor within the edited node. + * @param columnNameOrFieldName A String value that specifies the column's name or field name. + */ + FocusEditor(columnNameOrFieldName: string): void; + /** + * Scrolls the tree list so that the specified node becomes visible. + * @param nodeKey An integer value that specifies the node index within the tree list's client item list. + */ + MakeNodeVisible(nodeKey: string): void; + /** + * Returns the current vertical scroll position of the tree list's content. + */ + GetVerticalScrollPosition(): number; + /** + * Returns the current horizontal scroll position of the tree list's content. + */ + GetHorizontalScrollPosition(): number; + /** + * Specifies the vertical scroll position for the tree list's content. + * @param position An integer value specifying the vertical scroll position. + */ + SetVerticalScrollPosition(position: number): void; + /** + * Specifies the horizontal scroll position for the tree list's content. + * @param position An integer value specifying the horizontal scroll position. + */ + SetHorizontalScrollPosition(position: number): void; +} +/** + * Represents a client column. + */ +interface ASPxClientTreeListColumn { + /** + * Gets the column's position within the collection. + * Value: An integer zero-bazed index that specifies the column's position within the collection. + */ + index: number; + /** + * Gets the name that uniquely identifies the column. + * Value: A string value assigned to the column's Name property. + */ + name: string; + /** + * Gets the name of the database field assigned to the current column. + * Value: A String value that specifies the name of a data field. + */ + fieldName: string; +} +/** + * Provides data for the CustomDataCallback event. + */ +interface ASPxClientTreeListCustomDataCallbackEventArgs extends ASPxClientEventArgs { + /** + * Gets the information that has been collected on the client-side and sent to the server-side CustomDataCallback event. + * Value: A string value that represents the information that has been collected on the client-side and sent to the server-side CustomDataCallback event. + */ + arg: string; + /** + * Gets the information passed from the server-side CustomDataCallback event. + * Value: An object that represents the information passed from the server-side CustomDataCallback event. + */ + result: Object; +} +/** + * A method that will handle the CustomDataCallback event. + */ +interface ASPxClientTreeListCustomDataCallbackEventHandler { + /** + * A method that will handle the CustomDataCallback event. + * @param source The event source. + * @param e An ASPxClientTreeListCustomDataCallbackEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListCustomDataCallbackEventArgs): void; +} +/** + * Provides data for the NodeDblClick events. + */ +interface ASPxClientTreeListNodeEventArgs extends ASPxClientEventArgs { + /** + * Gets the processed node's key value. + * Value: A String value that identifies the processed node. + */ + nodeKey: string; + /** + * Provides access to the parameters associated with the NodeDblClick events. + * Value: An object that contains parameters associated with the event. + */ + htmlEvent: Object; + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the NodeDblClick event. + */ +interface ASPxClientTreeListNodeEventHandler { + /** + * A method that will handle the NodeDblClick event. + * @param source The event source. + * @param e An ASPxClientTreeListNodeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListNodeEventArgs): void; +} +/** + * Provides data for the ContextMenu event. + */ +interface ASPxClientTreeListContextMenuEventArgs extends ASPxClientEventArgs { + /** + * Identifies which tree list element has been right-clicked. + * Value: A string value that identifies which tree list element ('Header' or 'Node') has been right-clicked. + */ + objectType: string; + /** + * Gets a value that identifies the right-clicked object. + * Value: The right-clicked object's identifier. + */ + objectKey: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that relates to the processed event. + */ + htmlEvent: Object; + /** + * Gets or sets whether to invoke the browser's context menu. + * Value: true to hide the browser's context menu; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the ContextMenu event. + */ +interface ASPxClientTreeListContextMenuEventHandler { + /** + * A method that will handle the ContextMenu event. + * @param source The event sender. + * @param e An ASPxClientTreeListContextMenuEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListContextMenuEventArgs): void; +} +/** + * Provides data for the StartDragNode event. + */ +interface ASPxClientTreeListStartDragNodeEventArgs extends ASPxClientTreeListNodeEventArgs { + /** + * Gets an array of targets where a node can be dragged. + * Value: An array of objects that represent targets for the dragged node. + */ + targets: Object[]; +} +/** + * A method that will handle the StartDragNode event. + */ +interface ASPxClientTreeListStartDragNodeEventHandler { + /** + * A method that will handle the StartDragNode event. + * @param source The event source. + * @param e An ASPxClientTreeListStartDragNodeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListStartDragNodeEventArgs): void; +} +/** + * Provides data for the EndDragNode event. + */ +interface ASPxClientTreeListEndDragNodeEventArgs extends ASPxClientTreeListNodeEventArgs { + /** + * Gets the target element. + * Value: An object that represents the target element to which the dragged node has been dropped. + */ + targetElement: Object; +} +/** + * A method that will handle the EndDragNode event. + */ +interface ASPxClientTreeListEndDragNodeEventHandler { + /** + * A method that will handle the EndDragNode event. + * @param source The event source. + * @param e An ASPxClientTreeListEndDragNodeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListEndDragNodeEventArgs): void; +} +/** + * Provides data for the CustomButtonClick event. + */ +interface ASPxClientTreeListCustomButtonEventArgs extends ASPxClientEventArgs { + /** + * Gets the key value of the node whose custom button has been clicked. + * Value: A string value that uniquely identifies the node whose custom button has been clicked. + */ + nodeKey: string; + /** + * Gets the button's index. + * Value: An integer value that specifies the button's position within the CustomButtons collection. + */ + buttonIndex: number; + /** + * Gets the value which identifies the custom button. + * Value: A String value that identifies the clicked custom button. + */ + buttonID: string; +} +/** + * A method that will handle the CustomButtonClick event. + */ +interface ASPxClientTreeListCustomButtonEventHandler { + /** + * A method that will handle the CustomButtonClick event. + * @param source The event source. + * @param e An ASPxClientTreeListCustomButtonEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListCustomButtonEventArgs): void; +} +/** + * Represents a JavaScript function which receives the list of row values when a specific client method (such as the GetSelectedNodeValues) is called. + */ +interface ASPxClientTreeListValuesCallback { + /** + * A JavaScript function which receives the list of row values when a specific client method (such as the GetSelectedNodeValues) is called. + * @param result An object that represents the list of row values received from the server. + */ + (result: Object): void; +} +/** + * Provides data for the ColumnResizing event. + */ +interface ASPxClientTreeListColumnResizingEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the processed client column. + * Value: An object that is the processed column. + */ + column: ASPxClientTreeListColumn; +} +/** + * A method that will handle the client ColumnResizing event. + */ +interface ASPxClientTreeListColumnResizingEventHandler { + /** + * A method that will handle the ColumnResizing event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientTreeListColumnResizingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListColumnResizingEventArgs): void; +} +/** + * Provides data for the ColumnResized event. + */ +interface ASPxClientTreeListColumnResizedEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the processed client column. + * Value: An object that is the processed column. + */ + column: ASPxClientTreeListColumn; +} +/** + * A method that will handle the client ColumnResized event. + */ +interface ASPxClientTreeListColumnResizedEventHandler { + /** + * A method that will handle the ColumnResized event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientTreeListColumnResizedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListColumnResizedEventArgs): void; +} +/** + * Provides data for the ToolbarItemClick event. + */ +interface ASPxClientTreeListToolbarItemClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the toolbar index related to the event. + * Value: An integer value that is the toolbar index. + */ + toolbarIndex: number; + /** + * Gets the toolbar name. + * Value: A string object that is the toolbar name. + */ + toolbarName: string; + /** + * Gets the toolbar item related to the event. + * Value: An ASPxClientMenuItem object that is the toolbar item. + */ + item: ASPxClientMenuItem; + /** + * Specifies whether a postback or a callback is used to finally process the event on the server side. + * Value: true to perform the round trip to the server side via postback; false to perform the round trip to the server side via callback. + */ + usePostBack: boolean; +} +/** + * A method that will handle the ToolbarItemClick event. + */ +interface ASPxClientTreeListToolbarItemClickEventHandler { + /** + * A method that will handle the ToolbarItemClick event. + * @param source The event source. + * @param e An ASPxClientTreeListToolbarItemClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeListToolbarItemClickEventArgs): void; +} +/** + * Represents a client-side equivalent of the BootstrapAccordion control. + */ +interface BootstrapClientAccordion extends ASPxClientNavBar { +} +interface BootstrapClientBinaryImage extends ASPxClientHyperLink { +} +/** + * Represents a client-side equivalent of the BootstrapButton control. + */ +interface BootstrapClientButton extends ASPxClientButton { + /** + * Returns the text displayed within the button. + */ + GetText(): string; + /** + * Sets the text to be displayed within the button. + * @param value A string value specifying the text to be displayed within the button. + */ + SetText(value: string): void; +} +/** + * Represents a client-side equivalent of the BootstrapCalendar control. + */ +interface BootstrapClientCalendar extends ASPxClientCalendar { +} +/** + * Represents a client-side equivalent of the BootstrapCallbackPanel control. + */ +interface BootstrapClientCallbackPanel extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the BootstrapClientCallbackPanel. + */ + CallbackError: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Returns the HTML code that specifies the contents of the control's window. + */ + GetContentHtml(): string; + /** + * Sets the HTML markup specifying the contents of the control's window. + * @param html A string value that specifies the HTML markup. + */ + SetContentHtml(html: string): void; + /** + * Sets a value specifying whether the callback panel is enabled. + * @param enabled true, to enable the callback panel; false to disable it. + */ + SetEnabled(enabled: boolean): void; + /** + * Returns a value specifying whether a callback panel is enabled. + */ + GetEnabled(): boolean; +} +/** + * Serves as the base type for the BootstrapClientPieChart objects. + */ +interface BootstrapClientChartBase extends ASPxClientControl { + Done: ASPxClientEvent>; + LegendClick: ASPxClientEvent>; + PointClick: ASPxClientEvent>; + PointHoverChanged: ASPxClientEvent>; + PointSelectionChanged: ASPxClientEvent>; + TooltipHidden: ASPxClientEvent>; + TooltipShown: ASPxClientEvent>; + ArgumentAxisClick: ASPxClientEvent>; + SeriesClick: ASPxClientEvent>; + SeriesHoverChanged: ASPxClientEvent>; + SeriesSelectionChanged: ASPxClientEvent>; +} +/** + * Represents a client-side equivalent of the BootstrapChart control. + */ +interface BootstrapClientChart extends BootstrapClientChartBase { + ZoomStart: ASPxClientEvent>; + ZoomEnd: ASPxClientEvent>; +} +/** + * Represents a client-side equivalent of the BootstrapPolarChart control. + */ +interface BootstrapClientPolarChart extends BootstrapClientChartBase { +} +/** + * Represents a client-side equivalent of the BootstrapPieChart control. + */ +interface BootstrapClientPieChart extends BootstrapClientChartBase { +} +interface BootstrapClientChartBaseDoneEventHandler { + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +interface BootstrapClientChartBaseLegendClickEventHandler { + (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; +} +interface BootstrapClientCoordinateSystemChartArgumentAxisClickEventHandler { + (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; +} +interface BootstrapClientChartBasePointClickEventHandler { + (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; +} +interface BootstrapClientChartBasePointHoverChangedEventHandler { + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +interface BootstrapClientChartBasePointSelectionChangedEventHandler { + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +interface BootstrapClientChartBaseTooltipHiddenEventHandler { + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +interface BootstrapClientChartBaseTooltipShownEventHandler { + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +interface BootstrapClientCoordinateSystemChartSeriesClickEventHandler { + (source: S, e: BootstrapUIWidgetElementClickEventArgs): void; +} +interface BootstrapClientCoordinateSystemChartSeriesHoverChangedEventHandler { + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +interface BootstrapClientCoordinateSystemChartSeriesSelectionChangedEventHandler { + (source: S, e: BootstrapUIWidgetElementActionEventArgs): void; +} +interface BootstrapClientChartZoomStartEventHandler { + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +interface BootstrapClientChartZoomEndEventHandler { + (source: S, e: BootstrapClientChartZoomEndEventArgs): void; +} +interface BootstrapUIWidgetEventArgsBase extends ASPxClientEventArgs { + component: Object; + element: Object; +} +interface BootstrapClientChartZoomEndEventArgs extends BootstrapUIWidgetEventArgsBase { + rangeStart: Object; + rangeEnd: Object; +} +/** + * Represents a client-side equivalent of the BootstrapCheckBox control. + */ +interface BootstrapClientCheckBox extends ASPxClientEdit { + /** + * Occurs on the client side when the editor's checked state is changed. + */ + CheckedChanged: ASPxClientEvent>; + /** + * Returns a value indicating whether the check box editor is checked. + */ + GetChecked(): boolean; + /** + * Sets a value which specifies the checked status of the check box editor. + * @param isChecked + */ + SetChecked(isChecked: boolean): void; + /** + * Returns the text displayed within the editor. + */ + GetText(): string; + /** + * Returns a value which specifies a check box checked state. + */ + GetCheckState(): string; + /** + * Sets a value specifying the state of a check box. + * @param checkState + */ + SetCheckState(checkState: string): void; + /** + * Sets the text to be displayed within the editor. + * @param text + */ + SetText(text: string): void; +} +/** + * Represents a client-side equivalent of the BootstrapRadioButton control. + */ +interface BootstrapClientRadioButton extends BootstrapClientCheckBox { +} +/** + * Represents a client-side equivalent of the BootstrapComboBox control. + */ +interface BootstrapClientComboBox extends ASPxClientComboBox { + /** + * Returns the combo box editor's selected item. + */ + GetSelectedItem(): BootstrapClientListBoxItem; + /** + * Sets the combo box editor's selected item. + * @param item + */ + SetSelectedItem(item: BootstrapClientListBoxItem): void; + /** + * Returns an item specified by its index within the combo box editor's item collection. + * @param index + */ + GetItem(index: number): BootstrapClientListBoxItem; + /** + * Returns a combo box item by its text. + * @param text + */ + FindItemByText(text: string): BootstrapClientListBoxItem; + /** + * Returns a combo box item by its value. + * @param value + */ + FindItemByValue(value: Object): BootstrapClientListBoxItem; + /** + * Adds a new item to the editor, specifying the item's display text, and returns the index of the added item. + * @param texts An array of strings that specifies the item's display text. Array element positions relate to the positions of the corresponding fields within the editor's Fields collection. + */ + AddItem(texts: string[]): number; + /** + * Adds a new item to the end of the control's items collection. + * @param texts + * @param value + */ + AddItem(texts: string[], value: Object): number; + /** + * Adds a new item to the end of the control's items collection. + * @param texts + * @param value + * @param iconCssClass + */ + AddItem(texts: string[], value: Object, iconCssClass: string): number; + /** + * Adds a new item to the editor specifying the item's display text and returns the index of the added item. + * @param text + */ + AddItem(text: string): number; + /** + * Adds a new item to the editor specifying the item's display text and associated value, and returns the index of the added item. + * @param text + * @param value + */ + AddItem(text: string, value: Object): number; + /** + * Adds a new item to the editor specifying the item's display text, associated value and displayed image, and returns the index of the added item. + * @param text + * @param value + * @param iconCssClass + */ + AddItem(text: string, value: Object, iconCssClass: string): number; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index + * @param texts + * @param value + * @param iconCssClass + */ + InsertItem(index: number, texts: string[], value: Object, iconCssClass: string): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index + * @param texts + * @param value + */ + InsertItem(index: number, texts: string[], value: Object): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index + * @param texts + */ + InsertItem(index: number, texts: string[]): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index + * @param text + * @param value + * @param iconCssClass + */ + InsertItem(index: number, text: string, value: Object, iconCssClass: string): void; + /** + * Inserts a new item specified by its display text and associated value into the editor's item collection, at the position specified. + * @param index + * @param text + * @param value + */ + InsertItem(index: number, text: string, value: Object): void; + /** + * Inserts a new item specified by its display text into the editor's item collection, at the position specified. + * @param index + * @param text + */ + InsertItem(index: number, text: string): void; + /** + * Sets the list editor's selected item. + * @param item An ASPxClientListEditItem object that specifies the item to select. + */ + SetSelectedItem(item: ASPxClientListEditItem): void; +} +/** + * Represents a client-side equivalent of the BootstrapDateEdit control. + */ +interface BootstrapClientDateEdit extends ASPxClientDateEdit { +} +/** + * Represents a client-side equivalent of the BootstrapDropDownEdit control. + */ +interface BootstrapClientDropDownEdit extends ASPxClientDropDownEdit { +} +/** + * Represents a client-side equivalent of the BootstrapFormLayout control. + */ +interface BootstrapClientFormLayout extends ASPxClientFormLayout { +} +/** + * Represents a client-side equivalent of the BootstrapHyperLink control. + */ +interface BootstrapClientHyperLink extends ASPxClientHyperLink { +} +interface BootstrapClientImage extends ASPxClientImage { +} +/** + * Represents the client-side equivalent of the BootstrapListEditItem object. + */ +interface BootstrapClientListBoxItem extends ASPxClientListEditItem { + /** + * This member is not in effect for this class. It is overridden only for the purpose of preventing it from appearing in Microsoft Visual Studio designer tools. + */ + imageUrl: string; + iconCssClass: string; + /** + * + * @param columnIndex + */ + GetColumnText(columnIndex: number): string; + /** + * + * @param columnName + */ + GetColumnText(columnName: string): string; + /** + * + * @param fieldIndex + */ + GetFieldText(fieldIndex: number): string; + /** + * + * @param fieldName + */ + GetFieldText(fieldName: string): string; +} +/** + * Represents a client-side equivalent of the BootstrapListBox control. + */ +interface BootstrapClientListBox extends ASPxClientListBox { + /** + * Returns the list box editor's selected item. + */ + GetSelectedItem(): BootstrapClientListBoxItem; + /** + * Sets the list box editor's selected item. + * @param item + */ + SetSelectedItem(item: BootstrapClientListBoxItem): void; + /** + * Returns an item specified by its index within the list box editor's item collection. + * @param index + */ + GetItem(index: number): BootstrapClientListBoxItem; + /** + * Returns an array of the list editor's selected items. + */ + GetSelectedItems(): BootstrapClientListBoxItem[]; + /** + * Selects the specified items within a list box. + * @param items + */ + SelectItems(items: BootstrapClientListBoxItem[]): void; + /** + * Unselects an array of the specified list box items. + * @param items + */ + UnselectItems(items: BootstrapClientListBoxItem[]): void; + /** + * Returns a list box item by its text. + * @param text + */ + FindItemByText(text: string): BootstrapClientListBoxItem; + /** + * Returns a list box item by its value. + * @param value + */ + FindItemByValue(value: Object): BootstrapClientListBoxItem; + /** + * Adds a new item to the end of the editor's items collection, specifying the item's display text, and returns the index of the added item. + * @param texts + */ + AddItem(texts: string[]): number; + /** + * Adds a new item to the end of the control's items collection. + * @param texts + * @param value + */ + AddItem(texts: string[], value: Object): number; + /** + * Adds a new item to the end of the control's items collection. + * @param texts + * @param value + * @param iconCssClass + */ + AddItem(texts: string[], value: Object, iconCssClass: string): number; + /** + * Adds a new item to the editor, specifying the item's display text, and returns the index of the added item. + * @param text + */ + AddItem(text: string): number; + /** + * Adds a new item to the editor, specifying the item's display text and associated value, and returns the index of the added item. + * @param text + * @param value + */ + AddItem(text: string, value: Object): number; + /** + * Adds a new item to the editor, specifying the item's display text, associated value and displayed image, and returns the index of the added item. + * @param text + * @param value + * @param iconCssClass + */ + AddItem(text: string, value: Object, iconCssClass: string): number; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index + * @param texts + * @param value + * @param iconCssClass + */ + InsertItem(index: number, texts: string[], value: Object, iconCssClass: string): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index + * @param texts + * @param value + */ + InsertItem(index: number, texts: string[], value: Object): void; + /** + * Adds a new item to the control's items collection at the specified index. + * @param index + * @param texts + */ + InsertItem(index: number, texts: string[]): void; + /** + * Inserts a new item specified by its display text, associated value and displayed image into the editor's item collection, at the position specified. + * @param index + * @param text + * @param value + * @param iconCssClass + */ + InsertItem(index: number, text: string, value: Object, iconCssClass: string): void; + /** + * Inserts a new item specified by its display text and associated value into the editor's item collection, at the position specified. + * @param index + * @param text + * @param value + */ + InsertItem(index: number, text: string, value: Object): void; + /** + * Inserts a new item specified by its display text into the editor's item collection, at the position specified. + * @param index + * @param text + */ + InsertItem(index: number, text: string): void; + /** + * Selects the specified items within a list box. + * @param items An array of ASPxClientListEditItem objects that represent the items. + */ + SelectItems(items: ASPxClientListEditItem[]): void; + /** + * Unselects an array of the specified list box items. + * @param items An array of ASPxClientListEditItem objects that represent the items. + */ + UnselectItems(items: ASPxClientListEditItem[]): void; + /** + * Sets the list editor's selected item. + * @param item An ASPxClientListEditItem object that specifies the item to select. + */ + SetSelectedItem(item: ASPxClientListEditItem): void; +} +/** + * Represents a client-side equivalent of the BootstrapCheckBoxList control. + */ +interface BootstrapClientCheckBoxList extends ASPxClientCheckBoxList { +} +/** + * Represents a client-side equivalent of the BootstrapRadioButtonList control. + */ +interface BootstrapClientRadioButtonList extends ASPxClientRadioButtonList { +} +/** + * Represents a client-side equivalent of the BootstrapMenu control. + */ +interface BootstrapClientMenu extends ASPxClientMenu { +} +/** + * Represents a client-side equivalent of the BootstrapPager control. + */ +interface BootstrapClientPager extends ASPxClientPager { +} +/** + * Represents a client-side equivalent of the BootstrapPopupControl control. + */ +interface BootstrapClientPopupControl extends ASPxClientPopupControl { + /** + * + * @param selector + */ + SetPopupElementCssSelector(selector: string): void; +} +/** + * Represents a client-side equivalent of the BootstrapPopupMenu control. + */ +interface BootstrapClientPopupMenu extends ASPxClientPopupMenu { + /** + * + * @param selector + */ + SetPopupElementCssSelector(selector: string): void; +} +/** + * Represents a client-side equivalent of the BootstrapProgressBar control. + */ +interface BootstrapClientProgressBar extends ASPxClientProgressBar { +} +/** + * Represents a client-side equivalent of the BootstrapSpinEdit control. + */ +interface BootstrapClientSpinEdit extends ASPxClientSpinEdit { +} +/** + * Represents a client-side equivalent of the BootstrapTabControl control. + */ +interface BootstrapClientTabControl extends ASPxClientTabControl { +} +/** + * Represents a client-side equivalent of the BootstrapPageControl control. + */ +interface BootstrapClientPageControl extends ASPxClientPageControl { +} +/** + * Represents a client-side equivalent of the BootstrapTextBox control. + */ +interface BootstrapClientTextBox extends ASPxClientTextBox { +} +/** + * Represents a client-side equivalent of the BootstrapMemo control. + */ +interface BootstrapClientMemo extends ASPxClientMemo { +} +/** + * Represents a client-side equivalent of the BootstrapButtonEdit control. + */ +interface BootstrapClientButtonEdit extends ASPxClientButtonEdit { +} +/** + * Represents a client-side equivalent of the BootstrapTreeView control. + */ +interface BootstrapClientTreeView extends ASPxClientTreeView { +} +interface BootstrapUIWidgetBase extends ASPxClientControl { + Init: ASPxClientEvent>; + Drawn: ASPxClientEvent>; + Disposing: ASPxClientEvent>; + OptionChanged: ASPxClientEvent>; + Exporting: ASPxClientEvent>; + Exported: ASPxClientEvent>; + FileSaving: ASPxClientEvent>; + IncidentOccurred: ASPxClientEvent>; + GetInstance(): Object; + SetOptions(options: Object): void; + SetDataSource(dataSource: Object): void; + GetDataSource(): Object; + ExportTo(format: string, fileName: string): void; + Print(): void; +} +interface BootstrapUIWidgetInitializedEventHandler { + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +interface BootstrapUIWidgetDrawnEventHandler { + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +interface BootstrapUIWidgetDisposingEventHandler { + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +interface BootstrapUIWidgetExportedEventHandler { + (source: S, e: BootstrapUIWidgetEventArgsBase): void; +} +interface BootstrapUIWidgetOptionChangedEventHandler { + (source: S, e: BootstrapUIWidgetOptionChangedEventArgs): void; +} +interface BootstrapUIWidgetOptionChangedEventArgs extends BootstrapUIWidgetEventArgsBase { + fullName: string; + name: string; + previousValue: Object; + value: Object; +} +interface BootstrapUIWidgetExportingEventHandler { + (source: S, e: BootstrapUIWidgetExportEventArgs): void; +} +interface BootstrapUIWidgetFileSavingEventHandler { + (source: S, e: BootstrapUIWidgetExportEventArgs): void; +} +interface BootstrapUIWidgetExportEventArgs extends BootstrapUIWidgetEventArgsBase { + cancel: boolean; + data: Object; + fileName: string; + format: string; +} +interface BootstrapUIWidgetErrorEventHandler { + (source: S, e: BootstrapUIWidgetErrorEventArgs): void; +} +interface BootstrapUIWidgetErrorEventArgs extends BootstrapUIWidgetEventArgsBase { + target: Object; +} +interface BootstrapUIWidgetElementActionEventArgs extends BootstrapUIWidgetEventArgsBase { + target: Object; +} +interface BootstrapUIWidgetElementClickEventArgs extends BootstrapUIWidgetElementActionEventArgs { + jQueryEvent: Object; +} +/** + * Represents a client-side equivalent of the BootstrapUploadControl. + */ +interface BootstrapClientUploadControl extends ASPxClientUploadControl { +} +interface BootstrapClientGridView extends ASPxClientGridView { +} +/** + * A client-side counterpart of the Calendar and CalendarFor extensions. + */ +interface MVCxClientCalendar extends ASPxClientCalendar { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; +} +/** + * A client-side counterpart of the CallbackPanel extension. + */ +interface MVCxClientCallbackPanel extends ASPxClientCallbackPanel { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the Callback Panel by processing the passed information on the server, in an Action specified by the Callback Panel's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the Callback Panel by processing the passed information on the server, in an Action specified by the Callback Panel's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the CardView extension. + */ +interface MVCxClientCardView extends ASPxClientCardView { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the CardView by processing the passed information on the server, in an Action specified via the CardView's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CardView's CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the CardView by processing the passed information on the server, in an Action specified via the CardView's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CardView's CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback with a parameter to process the passed information on the server, in an Action specified via the CardView's CustomDataActionRouteValues property, and then process the returned result in the specified client function. This method does not update the CardView. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomDataActionRouteValues property. + * @param onCallback A ASPxClientCardViewValuesCallback object that represents the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(data: Object, onCallback: ASPxClientCardViewValuesCallback): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing the specified argument to it. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event. + * @param args A string value that is any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback An ASPxClientCardViewValuesCallback object that is the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(args: string, onCallback: ASPxClientCardViewValuesCallback): void; +} +/** + * A client-side counterpart of the Chart extension. + */ +interface MVCxClientChart extends ASPxClientWebChartControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update a Chart by processing the passed information on the server, in an Action specified via the Chart's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update a Chart by processing the passed information on the server, in an Action specified via the Chart's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the ComboBox and ComboBoxFor extensions. + */ +interface MVCxClientComboBox extends ASPxClientComboBox { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the ComboBox by processing the passed information on the server, in an Action specified by the ComboBox's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the ComboBox by processing the passed information on the server, in an Action specified by the ComboBox's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; +} +/** + * A client-side counterpart of the DataView extension. + */ +interface MVCxClientDataView extends ASPxClientDataView { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the DataView by processing the passed information on the server, in an Action specified via the DataView's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the DataView by processing the passed information on the server, in an Action specified via the DataView's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the DateEdit extension. + */ +interface MVCxClientDateEdit extends ASPxClientDateEdit { +} +/** + * A client-side counterpart of the DockManager extension. + */ +interface MVCxClientDockManager extends ASPxClientDockManager { + /** + * Sends a callback with a parameter to update the DockManager by processing the passed information on the server, in an Action specified by the DockManager's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the DockManager by processing the passed information on the server, in an Action specified by the DockManager's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that contains any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that contains any information that needs to be sent to the server-side Callback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the DockPanel extension. + */ +interface MVCxClientDockPanel extends ASPxClientDockPanel { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the DockPanel by processing the passed information on the server, in an Action specified by the DockPanel's DockPanelSettings.CallbackRouteValues) property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the DockPanel by processing the passed information on the server, in an Action specified by the DockPanel's DockPanelSettings.CallbackRouteValues) property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side WindowCallback event, passing the specified argument to it. + * @param parameter A string value that is any information that needs to be sent to the server-side WindowCallback event. + */ + PerformCallback(parameter: string): void; +} +/** + * A client-side counterpart of the FileManager extension. + */ +interface MVCxClientFileManager extends ASPxClientFileManager { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the FileManager by processing the passed information on the server, in an Action specified via the extension's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the file manager's CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param data A string value that specifies any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that specifies any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that specifies any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the GridView extension. + */ +interface MVCxClientGridView extends ASPxClientGridView { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the GridView by processing the passed information on the server, in an Action specified via the grid's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the grid's CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the GridView by processing the passed information on the server, in an Action specified via the grid's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the grid's CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback with a parameter to process the passed information on the server, in an Action specified via the GridView's CustomDataActionRouteValues property, and then process the returned result in the specified client function. This method does not update the GridView. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomDataActionRouteValues property. + * @param onCallback A ASPxClientGridViewValuesCallback object that represents the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(data: Object, onCallback: ASPxClientGridViewValuesCallback): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing the specified argument to it. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event. + * @param args A string value that is any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback A ASPxClientGridViewValuesCallback object that is the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(args: string, onCallback: ASPxClientGridViewValuesCallback): void; +} +/** + * A client-side counterpart of the HtmlEditor extension. + */ +interface MVCxClientHtmlEditor extends ASPxClientHtmlEditor { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to process the passed information on the server, in an Action specified via the HtmlEditor's CustomDataCallback event on the client. This method does not update the HtmlEditor. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomDataActionRouteValues property. + */ + PerformDataCallback(data: Object): void; + /** + * Sends a callback with a parameter to process the passed information on the server, in an Action specified via the HtmlEditor's CustomDataCallback event on the client. This method does not update the HtmlEditor. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomDataActionRouteValues property. + * @param onCallback An ASPxClientDataCallback object that is the JavaScript function which receives the callback data as a parameter. + */ + PerformDataCallback(data: Object, onCallback: ASPxClientDataCallback): void; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback A ASPxClientDataCallback object that represents the JavaScript function which receives the callback data as a parameter. + */ + PerformDataCallback(parameter: string, onCallback: ASPxClientDataCallback): void; +} +/** + * A client-side counterpart of the ImageGallery extension. + */ +interface MVCxClientImageGallery extends ASPxClientImageGallery { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the ImageGallery by processing the passed information on the server, in an Action specified via the ImageGallery's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the ImageGallery by processing the passed information on the server, in an Action specified via the ImageGallery's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the ListBox and ListBoxFor extensions. + */ +interface MVCxClientListBox extends ASPxClientListBox { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the ListBox by processing the passed information on the server, in an Action specified by the ListBox's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the ListBox by processing the passed information on the server, in an Action specified by the ListBox's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server, and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; +} +/** + * A client-side counterpart of the NavBar extension. + */ +interface MVCxClientNavBar extends ASPxClientNavBar { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; +} +/** + * A client-side counterpart of the PivotGrid extension. + */ +interface MVCxClientPivotGrid extends ASPxClientPivotGrid { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the PivotGrid by processing the passed information on the server, in an Action specified via the grid's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the grid's CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the PivotGrid by processing the passed information on the server, in an Action specified via the grid's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the grid's CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Passes PivotGrid callback parameters to the specified object. + * @param obj An object that receives PivotGrid callback parameters. + */ + FillStateObject(obj: Object): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the PopupControl extension. + */ +interface MVCxClientPopupControl extends ASPxClientPopupControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the PopupControl by processing the passed information on the server, in an Action specified via the PopupControl's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the PopupControl by processing the passed information on the server, in an Action specified via the PopupControl's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CallbackRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback with a parameters to update the popup window by processing the related popup window and the passed information on the server, in an Action specified by the PopupControl's CallbackRouteValues property. + * @param window A ASPxClientPopupWindow object identifying the processed popup window. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformWindowCallback(window: ASPxClientPopupWindow, data: Object): void; + /** + * + * @param window + * @param parameter + */ + PerformWindowCallback(window: ASPxClientPopupWindow, parameter: string): void; + /** + * Sends a callback with parameters to update the popup window by processing the related popup window and the passed information on the server. + * @param window A ASPxClientPopupWindow object identifying the processed popup window. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformWindowCallback(window: ASPxClientPopupWindow, parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side WindowCallback event, passing the specified argument to it. + * @param parameter A string value that is any information that needs to be sent to the server-side WindowCallback event. + */ + PerformCallback(parameter: string): void; +} +/** + * A client-side equivalent of the MVCxDocumentViewer class. + */ +interface MVCxClientDocumentViewer extends ASPxClientDocumentViewer { + /** + * Occurs before performing a document export request. + */ + BeforeExportRequest: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; +} +/** + * Obsolete. Use the MVCxClientDocumentViewer class instead. + */ +interface MVCxClientReportViewer extends ASPxClientReportViewer { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs before performing a document export request. + */ + BeforeExportRequest: ASPxClientEvent>; +} +/** + * A method that will handle the BeforeExportRequest event. + */ +interface MVCxClientBeforeExportRequestEventHandler { + /** + * A method that will handle the BeforeExportRequest event. + * @param source An object which is the event source. Identifies the client object that raised the event. + * @param e A MVCxClientBeforeExportRequestEventArgs object that contains event data. + */ + (source: S, e: MVCxClientBeforeExportRequestEventArgs): void; +} +/** + * Provides data for client BeforeExportRequest events. + */ +interface MVCxClientBeforeExportRequestEventArgs extends ASPxClientEventArgs { + /** + * Gets an object containing specific information (if any, as name/value pairs) that should be passed as a request parameter from the client to the server side for further processing. + * Value: A hash table object containing named values to be passed from the client to the server side via request parameters. + */ + customArgs: Object; +} +/** + * A client-side equivalent of the MVCxReportDesigner class. + */ +interface MVCxClientReportDesigner extends ASPxClientReportDesigner { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs after executing the Save command on the client. + */ + SaveCommandExecuted: ASPxClientEvent>; + /** + * Sends a callback to the server with the specified argument. + * @param arg A Object value, specifying the callback argument. + */ + PerformCallback(arg: Object): void; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(arg: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server with the specified argument. + * @param arg A String value, specifying the callback argument. + */ + PerformCallback(arg: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(arg: string, onSuccess: (arg1: string) => void): void; +} +/** + * A method that will handle the SaveCommandExecuted event. + */ +interface MVCxClientReportDesignerSaveCommandExecutedEventHandler { + /** + * A method that will handle the SaveCommandExecuted event. + * @param source An object which is the event source. Identifies the client object that raised the event. + * @param e A MVCxClientBeforeExportRequestEventArgs object that contains event data. + */ + (source: S, e: MVCxClientReportDesignerSaveCommandExecutedEventArgs): void; +} +/** + * Provides data for the SaveCommandExecuted event. + */ +interface MVCxClientReportDesignerSaveCommandExecutedEventArgs extends ASPxClientEventArgs { + /** + * Returns the operation result. + * Value: A String value, specifying the operation result. + */ + Result: string; +} +/** + * A client-side counterpart of the RichEdit extension. + */ +interface MVCxClientRichEdit extends ASPxClientRichEdit { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the RichEdit by processing the passed information on the server, in an Action specified via the CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the RichEdit by processing the passed information on the server, in an Action specified via the CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the RoundPanel extension. + */ +interface MVCxClientRoundPanel extends ASPxClientRoundPanel { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the Round Panel by processing the passed information on the server, in an Action specified by the Round Panel's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the Round Panel by processing the passed information on the server, in an Action specified by the Round Panel's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side ContentCallback event, passing it the specified argument. + * @param parameter A string value that is any information that needs to be sent to the server-side ContentCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side ContentCallback event, passing it the specified argument. + * @param parameter A string value that is any information that needs to be sent to the server-side ContentCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the Scheduler extension. + */ +interface MVCxClientScheduler extends ASPxClientScheduler { + /** + * Occurs on the client side when the tooltip is about to be displayed. + */ + ToolTipDisplaying: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the Scheduler by processing the passed information on the server, in an Action specified via the Scheduler's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the Scheduler by processing the passed information on the server, in an Action specified via the Scheduler's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; +} +/** + * A template that is rendered to display a tooltip. + */ +interface MVCxClientSchedulerTemplateToolTip extends ASPxClientToolTipBase { + /** + * Gets the tooltip type. + * Value: A MVCxSchedulerToolTipType object that specifies the tooltip type. + */ + type: MVCxSchedulerToolTipType; +} +/** + * A delegate method that enables you to adjust the tooltip content before displaying. + */ +interface MVCxClientSchedulerToolTipDisplayingEventHandler { + /** + * A method that will handle the ToolTipDisplaying event. + * @param source An object which is the event source. Identifies the client object that raised the event. + * @param e A MVCxClientSchedulerToolTipDisplayingEventArgs object that contains the related arguments. + */ + (source: S, e: MVCxClientSchedulerToolTipDisplayingEventArgs): void; +} +/** + * Provides data for the ToolTipDisplaying event. + */ +interface MVCxClientSchedulerToolTipDisplayingEventArgs extends ASPxClientEventArgs { + /** + * Gets the tooltip related to the event. + * Value: A MVCxClientSchedulerTemplateToolTip object that specifies the tooltip. + */ + toolTip: MVCxClientSchedulerTemplateToolTip; + /** + * Gets information about the tooltip related to the event. + * Value: A ASPxClientSchedulerToolTipData object that specifies information about the tooltip. + */ + data: ASPxClientSchedulerToolTipData; +} +/** + * Lists available tooltip types. + */ +interface MVCxSchedulerToolTipType { +} +/** + * A client-side counterpart of the Spreadsheet extension. + */ +interface MVCxClientSpreadsheet extends ASPxClientSpreadsheet { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the Spreadsheet by processing the passed information on the server, in an Action specified via the CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the Spreadsheet by processing the passed information on the server, in an Action specified via the CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the PageControl extension. + */ +interface MVCxClientPageControl extends ASPxClientPageControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the PageControl by processing the passed information on the server, in an Action specified by the PageControl's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the PageControl by processing the passed information on the server, in an Action specified by the PageControl's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A client-side counterpart of the TokenBox and TokenBoxFor extensions. + */ +interface MVCxClientTokenBox extends ASPxClientTokenBox { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the TokenBox by processing the passed information on the server, in an Action specified by the TokenBox's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the TokenBox by processing the passed information on the server, in an Action specified by the TokenBox's CallbackRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified by the CallbackRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; +} +/** + * A client-side counterpart of the TreeList extension. + */ +interface MVCxClientTreeList extends ASPxClientTreeList { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the TreeList by processing the passed information on the server, in an Action specified via the TreeList's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the TreeList by processing the passed information on the server, in an Action specified via the TreeList's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback with a parameter to process the passed information on the server, in an Action specified via the TreeList's CustomDataCallback event. This method does not update the TreeList. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomDataActionRouteValues property. + */ + PerformCustomDataCallback(data: Object): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side CustomDataCallback event. + */ + PerformCustomDataCallback(arg: string): void; +} +/** + * A client-side counterpart of the TreeView extension. + */ +interface MVCxClientTreeView extends ASPxClientTreeView { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; +} +/** + * A client-side counterpart of the UploadControl extension. + */ +interface MVCxClientUploadControl extends ASPxClientUploadControl { +} +/** + * A method that will handle client BeginCallback events. + */ +interface MVCxClientBeginCallbackEventHandler { + /** + * A method that will handle client BeginCallback events. + * @param source An object which is the event source. Identifies the client object that raised the event. + * @param e A MVCxClientBeginCallbackEventArgs object that contains event data. + */ + (source: S, e: MVCxClientBeginCallbackEventArgs): void; +} +/** + * Provides data for client BeginCallback events. + */ +interface MVCxClientBeginCallbackEventArgs extends ASPxClientBeginCallbackEventArgs { + /** + * Gets an object containing specific information (if any, as name/value pairs) that should be passed as a request parameter from the client to the server side for further processing. + * Value: A hash table object containing named values to be passed from the client to the server side via request parameters. + */ + customArgs: Object; +} +/** + * A method that will handle the BeginCallback event. + */ +interface MVCxClientGlobalBeginCallbackEventHandler { + /** + * A method that will handle the BeginCallback event. + * @param source An object which is the event source. Identifies the client object that raised the event. + * @param e A MVCxClientGlobalBeginCallbackEventArgs object that contains event data. + */ + (source: S, e: MVCxClientGlobalBeginCallbackEventArgs): void; +} +/** + * Provides data for the BeginCallback event. + */ +interface MVCxClientGlobalBeginCallbackEventArgs extends ASPxClientGlobalBeginCallbackEventArgs { + /** + * Gets an object containing specific information (if any, as name/value pairs) that should be passed as a request parameter from the client to the server side for further processing. + * Value: A hash table object containing named values to be passed from the client to the server side via request parameters. + */ + customArgs: Object; +} +/** + * An ASP.NET MVC equivalent of the client ASPxClientGlobalEvents component. + */ +interface MVCxClientGlobalEvents { + /** + * Occurs on the client side after client object models of all DevExpress MVC extensions contained within the page have been initialized. + */ + ControlsInitialized: ASPxClientEvent>; + /** + * Occurs on the client when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by a DevExpress MVC extension. + */ + CallbackError: ASPxClientEvent>; +} +/** + * A client-side counterpart of the VerticalGrid extension. + */ +interface MVCxClientVerticalGrid extends ASPxClientVerticalGrid { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Sends a callback with a parameter to update the VerticalGrid by processing the passed information on the server in an Action specified via the grid's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the grid's CustomActionRouteValues property. + */ + PerformCallback(data: Object): void; + /** + * Sends a callback with a parameter to update the VerticalGrid by processing the passed information on the server in an Action specified via the grid's CustomActionRouteValues property. + * @param data An object containing any information that needs to be passed to a handling Action specified via the grid's CustomActionRouteValues property. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(data: Object, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback with a parameter to process the passed information on the server, in an Action specified via the VerticalGrid's CustomDataActionRouteValues property, and then process the returned result in the specified client function. This method does not update the VerticalGrid. + * @param data An object containing any information that needs to be passed to a handling Action specified via the CustomDataActionRouteValues property. + * @param onCallback A ASPxClientGridViewValuesCallback object that represents the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(data: Object, onCallback: ASPxClientGridViewValuesCallback): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing the specified argument to it. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; + /** + * Sends a callback to the server and generates the server-side CustomDataCallback event. + * @param args A string value that is any information that needs to be sent to the server-side CustomDataCallback event. + * @param onCallback A ASPxClientVerticalGridValuesCallback object that is the JavaScript function which receives the information on the client side. + */ + GetValuesOnCustomCallback(args: string, onCallback: ASPxClientVerticalGridValuesCallback): void; +} +/** + * A client-side equivalent of the MVCxWebDocumentViewer class. + */ +interface MVCxClientWebDocumentViewer extends ASPxClientWebDocumentViewer { +} +/** + * Serves as the base type for all the objects included in the client-side object model. + */ +interface ASPxClientControlBase { + /** + * Gets the unique, hierarchically-qualified identifier for the control. + * Value: The fully-qualified identifier for the control. + */ + name: string; + /** + * Occurs on the client side after the control has been initialized. + */ + Init: ASPxClientEvent>; + /** + * Returns an HTML element that is the root of the control's hierarchy. + */ + GetMainElement(): Object; + /** + * Specifies the text that Assistive Technologies (screen readers or braille display, for example) will provide to a user. + * @param message A String value that specifies a text. + */ + SendMessageToAssistiveTechnology(message: string): void; + /** + * Returns a value specifying whether a control is displayed. + */ + GetClientVisible(): boolean; + /** + * Specifies whether a control is displayed. + * @param visible + */ + SetClientVisible(visible: boolean): void; + /** + * Returns a value specifying whether a control is displayed. + */ + GetVisible(): boolean; + /** + * Specifies whether a control is displayed. + * @param visible true to make a control visible; false to make it hidden. + */ + SetVisible(visible: boolean): void; + /** + * Returns a value that determines whether a callback request sent by a web control is being currently processed on the server side. + */ + InCallback(): boolean; +} +/** + * Serves as the base type for all the objects included in the client-side object model. + */ +interface ASPxClientControl extends ASPxClientControlBase { + /** + * Returns the control's width. + */ + GetWidth(): number; + /** + * Returns the control's height. + */ + GetHeight(): number; + /** + * Specifies the control's width. + * @param width An integer value that specifies the control's width. + */ + SetWidth(width: number): void; + /** + * Specifies the control's height. Note that this method is not in effect for some controls. + * @param height An integer value that specifies the control's height. + */ + SetHeight(height: number): void; + /** + * Modifies the control's size against the control's container. + */ + AdjustControl(): void; +} +/** + * Represents a client-side equivalent of the ASPxCallback control. + */ +interface ASPxClientCallback extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientCallback. + */ + CallbackError: ASPxClientEvent>; + /** + * Fires on the client side when a callback initiated by the client Callback event's handler returns back to the client. + */ + CallbackComplete: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side Callback event passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + SendCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A method that will handle the client events related to completion of callback server-side processing. + */ +interface ASPxClientCallbackCompleteEventHandler { + /** + * A method that will handle the client events related to completion of callback server-side processing. + * @param source An object representing the event source. Identifies the web control that raised the event. + * @param e An ASPxClientCallbackCompleteEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCallbackCompleteEventArgs): void; +} +/** + * Serves as the base class for arguments of the web controls' client-side events. + */ +interface ASPxClientEventArgs { +} +/** + * Provides data for events concerning the final processing of a callback. + */ +interface ASPxClientCallbackCompleteEventArgs extends ASPxClientEventArgs { + /** + * Gets a string that contains specific information (if any) passed from the client side for server-side processing. + * Value: A string value representing specific information passed from the client to the server side. + */ + parameter: string; + /** + * Gets a string that contains specific information (if any) that has been passed from the server to the client side for further processing. + * Value: A string value representing specific information passed from the server back to the client side. + */ + result: string; +} +/** + * Serves as the base class for controls that implement panel functionality. + */ +interface ASPxClientPanelBase extends ASPxClientControl { + /** + * Returns the HTML code that is the content of the panel. + */ + GetContentHtml(): string; + /** + * Sets the HTML content for the panel. + * @param html A string value that is the HTML code defining the content of the panel. + */ + SetContentHtml(html: string): void; + /** + * Sets a value specifying whether the panel is enabled. + * @param enabled true to enable the panel; false to disable it. + */ + SetEnabled(enabled: boolean): void; + /** + * Returns a value specifying whether a panel is enabled. + */ + GetEnabled(): boolean; +} +/** + * Represents a client-side equivalent of the ASPxPanel control. + */ +interface ASPxClientPanel extends ASPxClientPanelBase { + /** + * Occurs when the expanded panel is closed. + */ + Collapsed: ASPxClientEvent>; + /** + * Occurs when an end-user opens the expand panel. + */ + Expanded: ASPxClientEvent>; + /** + * Expands or collapses the client panel. + */ + Toggle(): void; + /** + * Returns a value specifying whether the panel can be expanded. + */ + IsExpandable(): boolean; + /** + * Returns a value specifying whether the panel is expanded. + */ + IsExpanded(): boolean; + /** + * Expands the collapsed panel. + */ + Expand(): void; + /** + * Collapses the expanded panel. + */ + Collapse(): void; +} +/** + * Represents a client-side equivalent of the ASPxCallbackPanel control. + */ +interface ASPxClientCallbackPanel extends ASPxClientPanel { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientCallbackPanel. + */ + CallbackError: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Returns the text displayed within the control's loading panel. + */ + GetLoadingPanelText(): string; + /** + * Sets the text to be displayed within the control's loading panel. + * @param loadingPanelText A string value specifying the text to be displayed within the loading panel. + */ + SetLoadingPanelText(loadingPanelText: string): void; + /** + * Sets a value specifying whether the callback panel is enabled. + * @param enabled true, to enable the callback panel; false to disable it. + */ + SetEnabled(enabled: boolean): void; + /** + * Returns a value specifying whether a callback panel is enabled. + */ + GetEnabled(): boolean; +} +/** + * Represents the event object used for client-side events. + */ +interface ASPxClientEvent { + /** + * Dynamically connects the event with an appropriate event handler function. + * @param handler An object representing the event handling function's content. + */ + AddHandler(handler: T): void; + /** + * Dynamically disconnects the event from the associated event handler function. + * @param handler An object representing the event handling function's content. + */ + RemoveHandler(handler: T): void; + /** + * Dynamically disconnects the event from all the associated event handler functions. + */ + ClearHandlers(): void; + /** + * For internal use only. + * @param source + * @param e + */ + FireEvent(source: Object, e: ASPxClientEventArgs): void; +} +/** + * A method that will handle the client-side events of a web control's client-side equivalent. + */ +interface ASPxClientEventHandler { + /** + * A method that will handle the client-side events of a web control's client-side equivalent. + * @param source An object representing the event source. Identifies the control that raised the event. + * @param e An ASPxClientEventArgs object that contains event data. + */ + (source: S, e: ASPxClientEventArgs): void; +} +/** + * A method that will handle the cancelable events of a web control's client-side equivalent. + */ +interface ASPxClientCancelEventHandler { + /** + * A method that will handle the cancelable events of a web control's client-side equivalent. + * @param source An object representing the event source. Identifies the web control that raised the event. + * @param e An ASPxClientCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCancelEventArgs): void; +} +/** + * Provides data for cancelable client events. + */ +interface ASPxClientCancelEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the client events which can't be cancelled and allow the event's processing to be passed to the server side. + */ +interface ASPxClientProcessingModeEventHandler { + /** + * A method that will handle the client events which can't be cancelled and allow the event's processing to be passed to the server side. + * @param source An object representing the event source. Identifies the web control that raised the event. + * @param e An ASPxClientProcessingModeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientProcessingModeEventArgs): void; +} +/** + * Provides data for the client events which can't be cancelled and allow the event's processing to be passed to the server side. + */ +interface ASPxClientProcessingModeEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets a value that specifies whether the event should be finally processed on the server side. + * Value: true to process the event on the server side; false to completely handle it on the client side. + */ + processOnServer: boolean; +} +/** + * A method that will handle the cancelable client-side events which allow the event's processing to be passed to the server side. + */ +interface ASPxClientProcessingModeCancelEventHandler { + /** + * A method that will handle the cancelable client-side events which allow the event's processing to be passed to the server side. + * @param source An object representing the event source. Identifies the web control that raised the event. + * @param e An ASPxClientProcessingModeCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientProcessingModeCancelEventArgs): void; +} +/** + * Provides data for the cancelable client-side events which allow the event's processing to be passed to the server side. + */ +interface ASPxClientProcessingModeCancelEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * Provides access to an observable boolean, that allows you to detect and respond to changes. + */ +interface KnockoutObservableBoolean { +} +/** + * Provides access to observable arrays that allow you to detect and respond to changes in a collection of things. + */ +interface KnockoutObservableArray { +} +/** + * Represents a JavaScript function which receives callback data obtained via a call to a specific client method (such as the PerformDataCallback). + */ +interface ASPxClientDataCallback { + /** + * A JavaScript function which receives a callback data obtained via a call to a specific client method (such as the PerformDataCallback). + * @param sender An object whose client method generated a callback. + * @param result A string value that represents the result of server-side callback processing. + */ + (sender: Object, result: string): void; +} +/** + * Represents a client-side equivalent of the ASPxCloudControl control. + */ +interface ASPxClientCloudControl extends ASPxClientControl { + /** + * Fires after an item has been clicked. + */ + ItemClick: ASPxClientEvent>; +} +/** + * A method that will handle client events involving manipulations with the control's items. + */ +interface ASPxClientCloudControlItemEventHandler { + /** + * A method that will handle client events concerning manipulations with items. + * @param source The event source. This parameter identifies the cloud control object which raised the event. + * @param e An ASPxClientCloudControlItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCloudControlItemEventArgs): void; +} +/** + * Provides data for events which involve clicking on the control's items. + */ +interface ASPxClientCloudControlItemEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the name that uniquely identifies the processed item. + * Value: A string value that represents the value assigned to the item's Name property. + */ + name: Object; + /** + * Gets the HTML object that contains the processed item. + * Value: An object representing a container for the item related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * A method that will handle the client events related to the begining of a callback processing round trip. + */ +interface ASPxClientBeginCallbackEventHandler { + /** + * A method that will handle client BeginCallback events. + * @param source An object representing the event source. Identifies the web control that raised the event. + * @param e An ASPxClientBeginCallbackEventArgs object that contains event data. + */ + (source: S, e: ASPxClientBeginCallbackEventArgs): void; +} +/** + * Provides data for client events related to the beginning of a callback processing round trip. + */ +interface ASPxClientBeginCallbackEventArgs extends ASPxClientEventArgs { + /** + * Gets a command name that identifies which client action forced a callback to be occurred. + * Value: A string value that represents the name of the command which initiated a callback. + */ + command: string; +} +/** + * A method that will handle the BeginCallback event. + */ +interface ASPxClientGlobalBeginCallbackEventHandler { + /** + * A method that will handle the BeginCallback event. + * @param source The event source. + * @param e An ASPxDataValidationEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGlobalBeginCallbackEventArgs): void; +} +/** + * Provides data for the BeginCallback event. + */ +interface ASPxClientGlobalBeginCallbackEventArgs extends ASPxClientBeginCallbackEventArgs { + /** + * Gets an object that initiated a callback. + * Value: An class descendant object that is the control that initiated a callback. + */ + control: ASPxClientControl; +} +/** + * A method that will handle the client events related to the completion of a callback processing round trip. + */ +interface ASPxClientEndCallbackEventHandler { + /** + * A method that will handle client EndCallback events. + * @param source An object representing the event source. + * @param e A MenuItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientEndCallbackEventArgs): void; +} +/** + * Provides data for client events related to the completion of a callback processing round trip. + */ +interface ASPxClientEndCallbackEventArgs extends ASPxClientEventArgs { +} +/** + * A method that will handle the EndCallback event. + */ +interface ASPxClientGlobalEndCallbackEventHandler { + /** + * A method that will handle the EndCallback event. + * @param source The event source. + * @param e An ASPxDataValidationEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGlobalEndCallbackEventArgs): void; +} +/** + * Provides data for the EndCallback event. + */ +interface ASPxClientGlobalEndCallbackEventArgs extends ASPxClientEndCallbackEventArgs { + /** + * Gets an object that initiated a callback. + * Value: An class descendant object that is the control that initiated a callback. + */ + control: ASPxClientControl; +} +/** + * A method that will handle a CustomCallback client event exposed by some DevExpress web controls. + */ +interface ASPxClientCustomDataCallbackEventHandler { + /** + * A method that will handle the client CustomCallback event of some controls. + * @param source An object representing the event source. + * @param e An ASPxClientCustomDataCallbackEventHandler object that contains event data. + */ + (source: S, e: ASPxClientCustomDataCallbackEventArgs): void; +} +/** + * Provides data for the CustomCallback event. + */ +interface ASPxClientCustomDataCallbackEventArgs extends ASPxClientEventArgs { + /** + * Gets a string that contains specific information (if any) that has been passed from the server to the client side for further processing, related to the CustomCallback event. + * Value: A string value representing specific information passed from the server back to the client side. + */ + result: string; +} +/** + * A method that will handle client events related to server-side errors that occured during callback processing. + */ +interface ASPxClientCallbackErrorEventHandler { + /** + * A method that will handle client CallbackError events. + * @param source An object representing the event source. + * @param e A ASPxClientCallbackErrorEventArgs object that contains event data. + */ + (source: S, e: ASPxClientCallbackErrorEventArgs): void; +} +/** + * Provides data for client events related to server-side errors that occured during callback processing. + */ +interface ASPxClientCallbackErrorEventArgs extends ASPxClientEventArgs { + /** + * Gets the error message that describes the server error that occurred. + * Value: A string value that represents the error message. + */ + message: string; + /** + * Gets or sets whether the event is handled and the default error handling actions are not required. + * Value: true if the error is handled and no default processing is required; otherwise false. + */ + handled: boolean; +} +/** + * A method that will handle the CallbackError event. + */ +interface ASPxClientGlobalCallbackErrorEventHandler { + /** + * A method that will handle the CallbackError event. + * @param source The event source. + * @param e An ASPxDataValidationEventArgs object that contains event data. + */ + (source: S, e: ASPxClientGlobalCallbackErrorEventArgs): void; +} +/** + * Provides data for the CallbackError event. + */ +interface ASPxClientGlobalCallbackErrorEventArgs extends ASPxClientCallbackErrorEventArgs { + /** + * Gets an object that initiated a callback. + * Value: An class descendant object that is the control that initiated a callback. + */ + control: ASPxClientControl; +} +/** + * A method that will handle the ValidationCompleted client event. + */ +interface ASPxClientValidationCompletedEventHandler { + /** + * A method that will handle the ValidationCompleted event. + * @param source An object representing the event source. Identifies the ASPxClientGlobalEvents object that raised the event. + * @param e An ASPxClientValidationCompletedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientValidationCompletedEventArgs): void; +} +/** + * Provides data for the ValidationCompleted client event that allows you to centrally validate user input within all DevExpress web controls to which validation is applied. + */ +interface ASPxClientValidationCompletedEventArgs extends ASPxClientEventArgs { + /** + * Gets a container object that holds the validated control(s). + * Value: An object that represents a container of the validated control(s). + */ + container: Object; + /** + * Gets the name of the validation group name to which validation has been applied. + * Value: A string value that represents the name of the validation group that has been validated. + */ + validationGroup: string; + /** + * Gets a value that indicates whether validation has been applied to both visible and invisible controls. + * Value: true if validation has been applied to both visible and invisible controls; false if only visible controls have been validated. + */ + invisibleControlsValidated: boolean; + /** + * Gets a value specifying whether the validation has been completed successfully. + * Value: true if the validation has been completed successfully; otherwise, false. + */ + isValid: boolean; + /** + * Gets the first control (either visible or invisible) that hasn't passed the validation applied. + * Value: An ASPxClientControl object that represents the first invalid control. + */ + firstInvalidControl: ASPxClientControl; + /** + * Gets the first visible control that hasn't passed the validation applied. + * Value: An ASPxClientControl object that represents the first visible invalid control. + */ + firstVisibleInvalidControl: ASPxClientControl; +} +/** + * A method that will handle the client ControlsInitialized event. + */ +interface ASPxClientControlsInitializedEventHandler { + /** + * A method that will handle the client ControlsInitialized event. + * @param source An object representing the event source. + * @param e An ASPxClientControlsInitializedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientControlsInitializedEventArgs): void; +} +/** + * Provides data for the client ControlsInitialized event. + */ +interface ASPxClientControlsInitializedEventArgs extends ASPxClientEventArgs { + /** + * Gets a value that specifies whether a callback is sent during a controls initialization. + * Value: true if a callback is sent; otherwise, false. + */ + isCallback: boolean; +} +/** + * A JavaScript function which returns a value specifying whether an object meets the criteria defined within the method specified by this delegate. + */ +interface ASPxClientControlPredicate { + /** + * A JavaScript function which returns a value specifying whether an object meets the criteria defined within the method specified by this delegate. + * @param control An object to compare against the criteria defined within the method. + */ + (control: Object): boolean; +} +/** + * Represents a JavaScript function which receives the action to perform for a control when the client ForEachControl method is called. + */ +interface ASPxClientControlAction { + /** + * Represents a JavaScript function which receives the action to perform for a control when the client ForEachControl method is called. + * @param control An object that specifies a control. + */ + (control: Object): void; +} +/** + * A collection object used on the client side to maintain particular client control objects + */ +interface ASPxClientControlCollection { + /** + * Occurs on the client side after client object models of all DevExpress web controls contained within the page have been initialized. + */ + ControlsInitialized: ASPxClientEvent>; + /** + * Occurs when the browser window is being resized. + */ + BrowserWindowResized: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated by any DevExpress control. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side, after server-side processing of a callback initiated by any DevExpress web control, has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by any DevExpress web control. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs after the validation initiated for a DevExpress web control (or a group of DevExpress web controls) has been completed. + */ + ValidationCompleted: ASPxClientEvent>; + /** + * Returns a collection item identified by its unique hierarchically-qualified identifier. + * @param name A string value representing the hierarchically-qualified identifier of the required control. + */ + Get(name: Object): Object; + /** + * Returns a DevExpress client control object identified by its unique hierarchically-qualified identifier (either ClientInstanceName or ClientID property value). + * @param name A string value that is the hierarchically-qualified identifier of the required DevExpress control. + */ + GetByName(name: string): Object; + /** + * Returns all controls in the collection that satisfy the specified predicate. + * @param predicate An ASPxClientControlPredicate object that is a predicate used to search for controls in the collection. + */ + GetControlsByPredicate(predicate: ASPxClientControlPredicate): Object[]; + /** + * Returns all controls of the specified type. + * @param type The object specifying the client control type. + */ + GetControlsByType(type: Object): Object[]; + /** + * Performs the specified action for each control in the collection. + * @param action An ASPxClientControlAction object specifying an action to perform. + */ + ForEachControl(action: ASPxClientControlAction): void; +} +/** + * Represents a client-side equivalent of the ASPxDataView object. + */ +interface ASPxClientDataView extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientDataView. + */ + CallbackError: ASPxClientEvent>; + /** + * Activates the specified page. + * @param pageIndex An integer value that specifies the active page's index. + */ + GotoPage(pageIndex: number): void; + /** + * Gets the index of the page that is currently active. + */ + GetPageIndex(): number; + /** + * Gets the size of a single ASPxDataView's page. + */ + GetPageSize(): number; + /** + * Sets the size of a single ASPxDataView's page. + * @param pageSize An integer value that specifies the page size. + */ + SetPageSize(pageSize: number): void; + /** + * Gets the number of pages into which the ASPxDataView's data is divided. + */ + GetPageCount(): number; + /** + * Activates the next page. + */ + NextPage(): void; + /** + * Activates the previous page. + */ + PrevPage(): void; + /** + * Activates the first page. + */ + FirstPage(): void; + /** + * Activates the last page. + */ + LastPage(): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * A JavaScript function which returns a value specifying whether an object meets the criteria defined within the method specified by this delegate. + */ +interface ASPxClientDockingFilterPredicate { + /** + * A JavaScript function which returns a value specifying whether an object meets the criteria defined within the method specified by this delegate. + * @param item An object to compare against the criteria defined within the method. + */ + (item: Object): boolean; +} +/** + * A client-side equivalent of the ASPxDockManager object. + */ +interface ASPxClientDockManager extends ASPxClientControl { + /** + * Fires on the client side before a panel is docked in a zone and allows you to cancel the action. + */ + BeforeDock: ASPxClientEvent>; + /** + * Fires on the client side after a panel is docked in a zone. + */ + AfterDock: ASPxClientEvent>; + /** + * Fires on the client side before a panel is made floating (undocked from a zone) and allows you to cancel the action. + */ + BeforeFloat: ASPxClientEvent>; + /** + * Fires on the client side after a panel is undocked from a zone. + */ + AfterFloat: ASPxClientEvent>; + /** + * Occurs when a panel dragging operation is started. + */ + StartPanelDragging: ASPxClientEvent>; + /** + * Occurs after a panel dragging operation is complete. + */ + EndPanelDragging: ASPxClientEvent>; + /** + * Occurs on the client side before a panel is closed, and allows you to cancel the action. + */ + PanelClosing: ASPxClientEvent>; + /** + * Occurs on the client side when a panel is closed. + */ + PanelCloseUp: ASPxClientEvent>; + /** + * Occurs on the client side when a panel pops up. + */ + PanelPopUp: ASPxClientEvent>; + /** + * Occurs on the client side after a panel has been invoked. + */ + PanelShown: ASPxClientEvent>; + /** + * Occurs on the client side after a panel has been resized. + */ + PanelResize: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that contains any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that contains any information that needs to be sent to the server-side Callback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Returns a zone specified by its unique identifier (zoneUID). + * @param zoneUID A string value specifying the unique identifier of the zone. + */ + GetZoneByUID(zoneUID: string): ASPxClientDockZone; + /** + * Returns a panel specified by its unique identifier (panelUID). + * @param panelUID A string value specifying the unique identifier of the panel. + */ + GetPanelByUID(panelUID: string): ASPxClientDockPanel; + /** + * Returns an array of panels contained in a page. + */ + GetPanels(): ASPxClientDockPanel[]; + /** + * Returns an array of panels that are contained in a page and meet a specified criteria. + * @param filterPredicate An ASPxClientDockingFilterPredicate delegate that defines a set of criteria and determines whether a panel meets those criteria. + */ + GetPanels(filterPredicate: ASPxClientDockingFilterPredicate): ASPxClientDockPanel[]; + /** + * Returns an array of zones contained in a page. + */ + GetZones(): ASPxClientDockZone[]; + /** + * Returns an array of zones that are contained in a page and meet a specified criteria. + * @param filterPredicate An ASPxClientDockingFilterPredicate delegate that defines a set of criteria and determines whether a zone meets those criteria. + */ + GetZones(filterPredicate: ASPxClientDockingFilterPredicate): ASPxClientDockZone[]; +} +/** + * A method that will handle the client BeforeDock event. + */ +interface ASPxClientDockManagerProcessingModeCancelEventHandler { + /** + * A method that will handle the BeforeDock event. + * @param source The event source. This parameter identifies the dock manager object which raised the event. + * @param e An ASPxClientDockManagerProcessingModeCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockManagerProcessingModeCancelEventArgs): void; +} +/** + * Provides data for the BeforeDock event. + */ +interface ASPxClientDockManagerProcessingModeCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets the panel currently being processed. + * Value: An ASPxClientDockPanel object that is the processed panel. + */ + panel: ASPxClientDockPanel; + /** + * Gets the zone currently being processed. + * Value: An ASPxClientDockZone object that is the processed zone. + */ + zone: ASPxClientDockZone; +} +/** + * A method that will handle the client AfterDock event. + */ +interface ASPxClientDockManagerProcessingModeEventHandler { + /** + * A method that will handle the AfterDock event. + * @param source The event source. This parameter identifies the dock manager object which raised the event. + * @param e An ASPxClientDockManagerProcessingModeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockManagerProcessingModeEventArgs): void; +} +/** + * Provides data for the AfterDock event. + */ +interface ASPxClientDockManagerProcessingModeEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the panel currently being processed. + * Value: An ASPxClientDockPanel object that is the processed panel. + */ + panel: ASPxClientDockPanel; + /** + * Gets the zone currently being processed. + * Value: An ASPxClientDockZone object that is the processed zone. + */ + zone: ASPxClientDockZone; +} +/** + * A method that will handle client-side events concerning manipulations with panels. + */ +interface ASPxClientDockManagerEventHandler { + /** + * A method that will handle client-side events concerning manipulations with panels. + * @param source The event source. This parameter identifies the dock manager object which raised the event. + * @param e An ASPxClientDockManagerEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockManagerEventArgs): void; +} +/** + * Provides data for events which concern manipulations on panels. + */ +interface ASPxClientDockManagerEventArgs extends ASPxClientEventArgs { + /** + * Gets the panel currently being processed. + * Value: An ASPxClientDockPanel object that is the processed panel. + */ + panel: ASPxClientDockPanel; +} +/** + * A method that will handle the client BeforeDock event. + */ +interface ASPxClientDockManagerCancelEventHandler { + /** + * A method that will handle the PanelClosing event. + * @param source The event source. This parameter identifies the dock manager object which raised the event. + * @param e An ASPxClientDockManagerCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockManagerCancelEventArgs): void; +} +/** + * Provides data for the BeforeDock event. + */ +interface ASPxClientDockManagerCancelEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the panel currently being processed. + * Value: An ASPxClientDockPanel object that is the processed panel. + */ + panel: ASPxClientDockPanel; +} +/** + * Serves as a base class for the ASPxClientPopupControl classes. + */ +interface ASPxClientPopupControlBase extends ASPxClientControl { + /** + * Occurs on the client side when window resizing initiates. + */ + BeforeResizing: ASPxClientEvent>; + /** + * Occurs on the client side when window resizing completes. + */ + AfterResizing: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the control. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side when a control's window closes or hides. + */ + CloseUp: ASPxClientEvent>; + /** + * Enables you to cancel window closing on the client side. + */ + Closing: ASPxClientEvent>; + /** + * Occurs on the client side when a control's window is invoked. + */ + PopUp: ASPxClientEvent>; + /** + * Occurs on the client side after a window has been resized. + */ + Resize: ASPxClientEvent>; + /** + * Occurs on the client side after a control's window has been invoked. + */ + Shown: ASPxClientEvent>; + /** + * Occurs on the client side when the window pin state is changed. + */ + PinnedChanged: ASPxClientEvent>; + /** + * Modifies a control's window size in accordance with the content. + */ + AdjustSize(): void; + /** + * Brings the window to the front of the z-order. + */ + BringToFront(): void; + /** + * Returns a value indicating whether the window is collapsed. + */ + GetCollapsed(): boolean; + /** + * Returns the HTML code that specifies the contents of the control's window. + */ + GetContentHtml(): string; + /** + * Returns an iframe object containing a web page specified via the control's SetContentUrl client method). + */ + GetContentIFrame(): Object; + /** + * Returns an iframe object containing a web page specified via the control's SetContentUrl client method). + */ + GetContentIFrameWindow(): Object; + /** + * Returns the URL pointing to the web page displayed within the control's window. + */ + GetContentUrl(): string; + /** + * Returns the URL pointing to the image displayed within the window footer by default. + */ + GetFooterImageUrl(): string; + /** + * Returns the URL where the web browser will navigate when the text or image is clicked within a window's footer. + */ + GetFooterNavigateUrl(): string; + /** + * Returns the text displayed within a window's footer. + */ + GetFooterText(): string; + /** + * Returns the URL pointing to the image displayed within the window header. + */ + GetHeaderImageUrl(): string; + /** + * Returns the URL where the web browser will navigate when the text or image is clicked within a window's header. + */ + GetHeaderNavigateUrl(): string; + /** + * Returns the text displayed within a window's header. + */ + GetHeaderText(): string; + /** + * Gets the width of the default window's (for ASPxPopupControl) or panel's (for ASPxDockPanel) content region. + */ + GetContentWidth(): number; + /** + * Gets the height of the default window's (for ASPxPopupControl) or panel's (for ASPxDockPanel) content region. + */ + GetContentHeight(): number; + /** + * Returns a value indicating whether the window is maximized. + */ + GetMaximized(): boolean; + /** + * Returns a value indicating whether the window is pinned. + */ + GetPinned(): boolean; + /** + * Sends a callback to the server and generates the server-side WindowCallback event, passing the specified argument to it. + * @param parameter A string value that is any information that needs to be sent to the server-side WindowCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Refreshes the content of the web page displayed within the control's window. + */ + RefreshContentUrl(): void; + /** + * Sets a value indicating whether the window is collapsed. + * @param value true, to collapse the window; otherwise, false. + */ + SetCollapsed(value: boolean): void; + /** + * Sets the HTML markup specifying the contents of the control's window. + * @param html A string value that specifies the HTML markup. + */ + SetContentHtml(html: string): void; + /** + * Sets the URL to point to the web page that should be loaded into, and displayed within the control's window. + * @param url A string value specifying the URL to the web page displayed within the control's window. + */ + SetContentUrl(url: string): void; + /** + * Specifies the URL which points to the image displayed within the window footer by default. + * @param value A string value that is the URL for the image displayed within the window footer. + */ + SetFooterImageUrl(value: string): void; + /** + * Specifies the URL where the web browser will navigate when the text or image is clicked within a window's footer. + * @param value A string value which specifies the required navigation location. + */ + SetFooterNavigateUrl(value: string): void; + /** + * Specifies the text displayed within a window's footer. + * @param value A string value that specifies a window's footer text. + */ + SetFooterText(value: string): void; + /** + * Specifies the URL which points to the image displayed within the window header. + * @param value A string value that is the URL to the image displayed within the header. + */ + SetHeaderImageUrl(value: string): void; + /** + * Specifies the URL where the web browser will navigate when the text or image is clicked within a window's header. + * @param value A string value which specifies the required navigation location. + */ + SetHeaderNavigateUrl(value: string): void; + /** + * Specifies the text displayed within a window's header. + * @param value A string value that specifies a window's header text. + */ + SetHeaderText(value: string): void; + /** + * Sets a value indicating whether the window is maximized. + * @param value true. to maximize the window; otherwise, false. + */ + SetMaximized(value: boolean): void; + /** + * Sets a value indicating whether the window is pinned. + * @param value true, to pin the window; otherwise, false. + */ + SetPinned(value: boolean): void; + /** + * Invokes the control's window. + */ + Show(): void; + /** + * Invokes the control's window at the popup element with the specified index. + * @param popupElementIndex An integer value specifying the zero-based index of the popup element. + */ + Show(popupElementIndex: number): void; + /** + * Invokes the control's window and displays it over the specified HTML element. + * @param htmlElement An object specifying the HTML element relative to whose position the window is invoked. + */ + ShowAtElement(htmlElement: Object): void; + /** + * Invokes the control's window and displays it over an HTML element specified by its unique identifier. + * @param id A string value that specifies the hierarchically qualified identifier of an HTML element relative to whose position the window is invoked. + */ + ShowAtElementByID(id: string): void; + /** + * Invokes the control's window at the specified position. + * @param x A integer value specifying the x-coordinate of the window's display position. + * @param y A integer value specifying the y-coordinate of the window's display position. + */ + ShowAtPos(x: number, y: number): void; + /** + * Closes the control's window. + */ + Hide(): void; + /** + * Returns a value that specifies whether the control's window is displayed. + */ + IsVisible(): boolean; +} +/** + * A client-side equivalent of the ASPxDockPanel object. + */ +interface ASPxClientDockPanel extends ASPxClientPopupControlBase { + /** + * Gets or sets the unique identifier of a panel on a page. + * Value: A string that is the unique identifier of a panel. + */ + panelUID: string; + /** + * Fires on the client side before a panel is docked in a zone and allows you to cancel the action. + */ + BeforeDock: ASPxClientEvent>; + /** + * Fires on the client side after a panel is docked in a zone. + */ + AfterDock: ASPxClientEvent>; + /** + * Fires on the client side before a panel is made floating (undocked from a zone) and allows you to cancel the action. + */ + BeforeFloat: ASPxClientEvent>; + /** + * Fires on the client side after a panel is undocked from a zone. + */ + AfterFloat: ASPxClientEvent>; + /** + * Occurs when a panel dragging operation is started. + */ + StartDragging: ASPxClientEvent>; + /** + * Occurs after a panel dragging operation is complete. + */ + EndDragging: ASPxClientEvent>; + /** + * Retrieves a zone that owns the current panel. + */ + GetOwnerZone(): ASPxClientDockZone; + /** + * Docks the current panel in the specified zone. + * @param zone An ASPxClientDockZone object specifying the zone. + */ + Dock(zone: ASPxClientDockZone): void; + /** + * Docks the current panel in a zone at the specified position. + * @param zone An ASPxClientDockZone object specifying the zone, where the panel is docked + * @param visibleIndex An integer value specifying the visible index position. + */ + Dock(zone: ASPxClientDockZone, visibleIndex: number): void; + /** + * Undocks the current panel. + */ + MakeFloat(): void; + /** + * Undocks the current panel and place it at the specified position. + * @param x An integer value that specifies the X-coordinate of the panel's display position. + * @param y An integer value that specifies the Y-coordinate of the panel's display position. + */ + MakeFloat(x: number, y: number): void; + /** + * Gets a value specifying the position of the current panel, amongst the visible panels within a zone. + */ + GetVisibleIndex(): number; + /** + * Sets a value specifying the position of the current panel, amongst the visible panels in a zone. + * @param visibleIndex An integer value specifying the zero-based index of the panel amongst visible panels in the zone. + */ + SetVisibleIndex(visibleIndex: number): void; + /** + * Returns a value indicating whether the panel is docked. + */ + IsDocked(): boolean; +} +/** + * A method that will handle the client BeforeDock event. + */ +interface ASPxClientDockPanelProcessingModeCancelEventHandler { + /** + * A method that will handle the BeforeDock event. + * @param source A ASPxClientDockPanel object that raised the event. + * @param e A ASPxClientDockPanelProcessingModeCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockPanelProcessingModeCancelEventArgs): void; +} +/** + * Provides data for the BeforeDock event. + */ +interface ASPxClientDockPanelProcessingModeCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets the zone currently being processed. + * Value: An ASPxClientDockZone object that is the processed zone. + */ + zone: ASPxClientDockZone; +} +/** + * A method that will handle the client BeforeDock event. + */ +interface ASPxClientDockPanelProcessingModeEventHandler { + /** + * A method that will handle the AfterFloat event. + * @param source A ASPxClientDockPanel object that raised the event. + * @param e A ASPxClientDockPanelProcessingModeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockPanelProcessingModeEventArgs): void; +} +/** + * Provides data for the AfterFloat event. + */ +interface ASPxClientDockPanelProcessingModeEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the zone currently being processed. + * Value: An ASPxClientDockZone object that is the processed zone. + */ + zone: ASPxClientDockZone; +} +/** + * A client-side equivalent of the ASPxDockZone object. + */ +interface ASPxClientDockZone extends ASPxClientControl { + /** + * Gets or sets the unique identifier of a zone on a page. + * Value: A string that is the unique identifier of a zone. + */ + zoneUID: string; + /** + * Fires on the client side before a panel is docked in a zone and allows you to cancel the action. + */ + BeforeDock: ASPxClientEvent>; + /** + * Fires on the client side after a panel is docked in a zone. + */ + AfterDock: ASPxClientEvent>; + /** + * Returns a value that indicates the orientation in which panels are stacked in the current zone. + */ + IsVertical(): boolean; + /** + * Gets a value that indicates whether the zone can enlarge its size. + */ + GetAllowGrowing(): boolean; + /** + * Gets the number of panels contained in the zone. + */ + GetPanelCount(): number; + /** + * Returns a panel specified by its unique identifier (panelUID). + * @param panelUID A string value specifying the unique identifier of the panel. + */ + GetPanelByUID(panelUID: string): ASPxClientDockPanel; + /** + * Returns a panel specified by its visible index. + * @param visibleIndex An integer value specifying the panel's position among the visible panels within the current zone. + */ + GetPanelByVisibleIndex(visibleIndex: number): ASPxClientDockPanel; + /** + * Returns an array of panels docked in the current zone. + */ + GetPanels(): ASPxClientDockPanel[]; + /** + * Returns an array of panels that are docked in the current zone and meet a specified criteria. + * @param filterPredicate An ASPxClientDockingFilterPredicate delegate that defines a set of criteria and determines whether a panel meets those criteria. + */ + GetPanels(filterPredicate: ASPxClientDockingFilterPredicate): ASPxClientDockPanel[]; +} +/** + * A method that will handle the client BeforeDock event. + */ +interface ASPxClientDockZoneCancelEventHandler { + /** + * A method that will handle the BeforeDock event. + * @param source The event source. This parameter identifies the zone object which raised the event. + * @param e A ASPxClientDockZoneCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockZoneCancelEventArgs): void; +} +/** + * Provides data for the BeforeDock event. + */ +interface ASPxClientDockZoneCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets the panel currently being processed. + * Value: An ASPxClientDockPanel object that is the processed panel. + */ + panel: ASPxClientDockPanel; +} +/** + * A method that will handle the client AfterDock event. + */ +interface ASPxClientDockZoneProcessingModeEventHandler { + /** + * A method that will handle the AfterDock event. + * @param source The event source. This parameter identifies the zone object which raised the event. + * @param e An ASPxClientDockZoneProcessingModeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientDockZoneProcessingModeEventArgs): void; +} +/** + * Provides data for the AfterDock event. + */ +interface ASPxClientDockZoneProcessingModeEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the panel currently being processed. + * Value: An ASPxClientDockPanel object that is the processed panel. + */ + panel: ASPxClientDockPanel; +} +/** + * Represents the client-side equivalent of the ASPxFileManager control. + */ +interface ASPxClientFileManager extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientFileManager. + */ + CallbackError: ASPxClientEvent>; + /** + * Fires on the client side after the selected file has been changed. + */ + SelectedFileChanged: ASPxClientEvent>; + /** + * Fires on the client side when an end-user opens a file by double-clicking it or pressing the Enter key. + */ + SelectedFileOpened: ASPxClientEvent>; + /** + * Fires after the focused item has been changed. + */ + FocusedItemChanged: ASPxClientEvent>; + /** + * Fires after the selection has been changed. + */ + SelectionChanged: ASPxClientEvent>; + /** + * Fires on the client side after the current folder has been changed within a file manager. + */ + CurrentFolderChanged: ASPxClientEvent>; + /** + * Fires on the client side before the folder is created, and allows you to cancel the action. + */ + FolderCreating: ASPxClientEvent>; + /** + * Occurs on the client side after a folder has been created. + */ + FolderCreated: ASPxClientEvent>; + /** + * Fires on the client side before an item is renamed and allows you to cancel the action. + */ + ItemRenaming: ASPxClientEvent>; + /** + * Occurs on the client side after a file manager's item has been renamed. + */ + ItemRenamed: ASPxClientEvent>; + /** + * Fires on the client side before an item is deleted and allows you to cancel the action. + */ + ItemDeleting: ASPxClientEvent>; + /** + * Occurs on the client side after a file manager's item has been deleted. + */ + ItemDeleted: ASPxClientEvent>; + /** + * Occurs on the client side after all the selected items have been deleted. + */ + ItemsDeleted: ASPxClientEvent>; + /** + * Fires on the client side before an item is moved and allows you to cancel the action. + */ + ItemMoving: ASPxClientEvent>; + /** + * Occurs on the client side after a file manager's item has been moved. + */ + ItemMoved: ASPxClientEvent>; + /** + * Occurs on the client side after all the selected items have been moved . + */ + ItemsMoved: ASPxClientEvent>; + /** + * Fires on the client side before an item is copied and allows you to cancel the action. + */ + ItemCopying: ASPxClientEvent>; + /** + * Occurs on the client side after a file manager item has been copied. + */ + ItemCopied: ASPxClientEvent>; + /** + * Occurs on the client side after all the selected items have been copied. + */ + ItemsCopied: ASPxClientEvent>; + /** + * Fires on the client if any error occurs while editing an item. + */ + ErrorOccurred: ASPxClientEvent>; + /** + * Enables you to display the alert with the result error description. + */ + ErrorAlertDisplaying: ASPxClientEvent>; + /** + * Fires when a custom item is clicked, allowing you to perform custom actions. + */ + CustomCommand: ASPxClientEvent>; + /** + * Fires on the client side when the file manager updates the state of toolbar or context menu items. + */ + ToolbarUpdating: ASPxClientEvent>; + /** + * Enables you to highlight the search text, which is specified using the filter box, in templates. + */ + HighlightItemTemplate: ASPxClientEvent>; + /** + * Fires on the client side before a file upload starts, and allows you to cancel the action. + */ + FileUploading: ASPxClientEvent>; + /** + * Fires on the client side before the selected items are uploaded and allows you to cancel the action. + */ + FilesUploading: ASPxClientEvent>; + /** + * Occurs on the client side after a file has been uploaded. + */ + FileUploaded: ASPxClientEvent>; + /** + * Occurs on the client side after upload of all selected files has been completed. + */ + FilesUploaded: ASPxClientEvent>; + /** + * Enables you to specify whether the selected file(s) are valid and provide an error text. + */ + FileUploadValidationErrorOccurred: ASPxClientEvent>; + /** + * Fires on the client side before a file download starts, and allows you to cancel the action. + */ + FileDownloading: ASPxClientEvent>; + /** + * Gets the name of the currently active file manager area. + */ + GetActiveAreaName(): string; + /** + * Client-side scripting method which initiates a round trip to the server, so that the current page will be reloaded. + */ + Refresh(): void; + /** + * Executes the specified command. + * @param commandName A string value that specifies the command to perform. + */ + ExecuteCommand(commandName: string): boolean; + /** + * Returns the selected file within the ASPxFileManager control's file container. + */ + GetSelectedFile(): ASPxClientFileManagerFile; + /** + * Returns an array of the file manager's selected items. + */ + GetSelectedItems(): ASPxClientFileManagerFile[]; + /** + * Returns a list of files that are loaded on the current page. + */ + GetItems(): ASPxClientFileManagerFile[]; + /** + * Sends a callback to the server and returns a list of files that are contained within the current folder. + * @param onCallback A object that represents the JavaScript function which receives the list of row values as a parameter. + */ + GetAllItems(onCallback: ASPxClientFileManagerAllItemsCallback): void; + /** + * Returns a toolbar item specified by its command name. + * @param commandName A string value specifying the command name of the item. + */ + GetToolbarItemByCommandName(commandName: string): ASPxClientFileManagerToolbarItem; + /** + * Returns a context menu item specified by its command name. + * @param commandName A string value specifying the command name of the item. + */ + GetContextMenuItemByCommandName(commandName: string): ASPxClientFileManagerToolbarItem; + /** + * Gets the current folder's path. + */ + GetCurrentFolderPath(): string; + /** + * Gets the current folder's path with the specified separator. + * @param separator A string value that specifies the separator between the folder's name within a path. + */ + GetCurrentFolderPath(separator: string): string; + /** + * Gets the current folder's path with the specified settings. + * @param separator A string value that specifies the separator between the folder's name within the path. + * @param skipRootFolder true to skip the root folder; otherwise, false. + */ + GetCurrentFolderPath(separator: string, skipRootFolder: boolean): string; + /** + * Sets the current folder's path. + * @param path A String value that is the relative path to the folder (without the root folder). + * @param onCallback A ASPxClientFileManagerCallback object that is the JavaScript function that receives the callback data as a parameter. + */ + SetCurrentFolderPath(path: string, onCallback: ASPxClientFileManagerCallback): void; + /** + * Gets the current folder's ID. + */ + GetCurrentFolderId(): string; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that specifies any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param args A string value that specifies any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; +} +/** + * A JavaScript function which receives callback data obtained via a call to the client SetCurrentFolderPath method. + */ +interface ASPxClientFileManagerCallback { + /** + * A JavaScript function that receives callback data obtained via a call to the SetCurrentFolderPath method. + * @param result An object that contains a callback data. + */ + (result: Object): void; +} +/** + * A client-side equivalent of the file manager's FileManagerItem object and serves as a base class for client file and folder objects. + */ +interface ASPxClientFileManagerItem { + /** + * Gets the name of the current item. + * Value: A string value that is the item's name. + */ + name: string; + /** + * Gets the item's unique identifier. + * Value: A String value that specifies the item's unique identifier. + */ + id: string; + /** + * Gets a value that indicates if the current file manager item is a folder. + * Value: true if the current item is a folder or parent folder; false if the current item is a file. + */ + isFolder: boolean; + /** + * Specifies whether the file manager item is selected. + * @param selected true, to select the item; otherwise, false. + */ + SetSelected(selected: boolean): void; + /** + * Gets a value indicating whether the item is selected in the file manager. + */ + IsSelected(): boolean; + /** + * Gets the current item's full name. + */ + GetFullName(): string; + /** + * Gets the current item's full name with the specified separator. + * @param separator A string value that specifies the separator between the folder name inside the item's full name. + */ + GetFullName(separator: string): string; + /** + * Gets the current item's full name with the specified settings. + * @param separator A string value that specifies the separator between the folder name inside the item's full name. + * @param skipRootFolder true, to skip the root folder; otherwise, false. + */ + GetFullName(separator: string, skipRootFolder: boolean): string; +} +/** + * Represents the client-side equivalent of the FileManagerFile object. + */ +interface ASPxClientFileManagerFile extends ASPxClientFileManagerItem { + /** + * Downloads a file from a file manager. + */ + Download(): void; +} +/** + * A client-side equivalent of the FileManagerFolder object. + */ +interface ASPxClientFileManagerFolder extends ASPxClientFileManagerItem { + /** + * Gets a value specifying whether an item is a parent folder. + * Value: true if an item is a parent folder; false if an item is a file or folder. + */ + isParentFolder: boolean; +} +/** + * A JavaScript function which receives callback data obtained by a call to the client GetAllItems method. + */ +interface ASPxClientFileManagerAllItemsCallback { + /** + * A JavaScript function which receives callback data obtained by a call to the client GetAllItems method. + * @param items An array of ASPxClientFileManagerItem objects that are items contained in the current folder. + */ + (items: ASPxClientFileManagerItem[]): void; +} +/** + * A method that will handle the client SelectedFileOpened events. + */ +interface ASPxClientFileManagerFileEventHandler { + /** + * A method that will handle the SelectedFileOpened events. + * @param source An object representing the event's source. + * @param e An ASPxClientFileManagerFileEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFileEventArgs): void; +} +/** + * Provides data for the SelectedFileOpened events. + */ +interface ASPxClientFileManagerFileEventArgs extends ASPxClientEventArgs { + /** + * Gets a file related to the event. + * Value: An ASPxClientFileManagerFile object that represents a file currently being processed. + */ + file: ASPxClientFileManagerFile; +} +/** + * A method that will handle the client SelectedFileOpened event. + */ +interface ASPxClientFileManagerFileOpenedEventHandler { + /** + * A method that will handle the SelectedFileOpened event. + * @param source The event source. This parameter identifies the file manager object which raised the event. + * @param e An ASPxClientFileManagerFileOpenedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFileOpenedEventArgs): void; +} +/** + * Provides data for the SelectedFileOpened event. + */ +interface ASPxClientFileManagerFileOpenedEventArgs extends ASPxClientFileManagerFileEventArgs { + /** + * Gets or sets a value that specifies whether the event should be finally processed on the server side. + * Value: true to process the event on the server side; false to completely handle it on the client side. + */ + processOnServer: boolean; +} +/** + * Serves as a base for classes that are used as arguments for events generated on the client side. + */ +interface ASPxClientFileManagerActionEventArgsBase extends ASPxClientEventArgs { + /** + * Gets the full name of the item currently being processed. + * Value: A string value that is the item's full name. + */ + fullName: string; + /** + * Gets the name of the currently processed item. + * Value: A string value that specifies the item's name. + */ + name: string; + /** + * Gets a value specifying whether the current processed item is a folder. + * Value: true if the processed item is a folder; false if the processed item is a file. + */ + isFolder: boolean; +} +/** + * A method that will handle the client ItemRenaming events. + */ +interface ASPxClientFileManagerItemEditingEventHandler { + /** + * A method that will handle the ItemRenaming events. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemEditingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemEditingEventArgs): void; +} +/** + * Provides data for the item editing event. + */ +interface ASPxClientFileManagerItemEditingEventArgs extends ASPxClientFileManagerActionEventArgsBase { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the client ItemRenamed event. + */ +interface ASPxClientFileManagerItemRenamedEventHandler { + /** + * A method that will handle the ItemRenamed event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemRenamedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemRenamedEventArgs): void; +} +/** + * Provides data for the ItemRenamed event. + */ +interface ASPxClientFileManagerItemRenamedEventArgs extends ASPxClientFileManagerActionEventArgsBase { + /** + * Gets the previous name of the renamed item. + * Value: A string value that specifies the item name. + */ + oldName: string; +} +/** + * A method that will handle the client ItemDeleted event. + */ +interface ASPxClientFileManagerItemDeletedEventHandler { + /** + * A method that will handle the ItemDeleted event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemDeletedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemDeletedEventArgs): void; +} +/** + * Provides data for the ItemDeleted event. + */ +interface ASPxClientFileManagerItemDeletedEventArgs extends ASPxClientFileManagerActionEventArgsBase { +} +/** + * A method that will handle the client ItemsDeleted event. + */ +interface ASPxClientFileManagerItemsDeletedEventHandler { + /** + * A method that will handle the ItemsDeleted event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemsDeletedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemsDeletedEventArgs): void; +} +/** + * Provides data for the ItemsDeleted event. + */ +interface ASPxClientFileManagerItemsDeletedEventArgs extends ASPxClientEventArgs { + /** + * Gets an array of the currently processed items. + * Value: An array of ASPxClientFileManagerItem objects that are items currently being processed. + */ + items: ASPxClientFileManagerItem[]; +} +/** + * A method that will handle the client ItemMoved event. + */ +interface ASPxClientFileManagerItemMovedEventHandler { + /** + * A method that will handle the ItemMoved event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemMovedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemMovedEventArgs): void; +} +/** + * Provides data for the ItemMoved event. + */ +interface ASPxClientFileManagerItemMovedEventArgs extends ASPxClientFileManagerActionEventArgsBase { + /** + * Gets the full name of the folder from which an item is moved. + * Value: A string value that specifies the folder's full name. + */ + oldFolderFullName: string; +} +/** + * A method that will handle the client ItemsMoved event. + */ +interface ASPxClientFileManagerItemsMovedEventHandler { + /** + * A method that will handle the ItemsMoved event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemsMovedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemsMovedEventArgs): void; +} +/** + * Provides data for the ItemsMoved event. + */ +interface ASPxClientFileManagerItemsMovedEventArgs extends ASPxClientEventArgs { + /** + * Gets an array of the currently processed items. + * Value: An array of ASPxClientFileManagerItem objects that are items currently being processed. + */ + items: ASPxClientFileManagerItem[]; + /** + * Gets the full name of the folder from which items are moved. + * Value: A string value that specifies the folder's full name. + */ + oldFolderFullName: string; +} +/** + * A method that will handle the client ItemCopied event. + */ +interface ASPxClientFileManagerItemCopiedEventHandler { + /** + * A method that will handle the ItemCopied event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemCopiedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemCopiedEventArgs): void; +} +/** + * Provides data for the ItemCopied event. + */ +interface ASPxClientFileManagerItemCopiedEventArgs extends ASPxClientFileManagerActionEventArgsBase { + /** + * Gets the full name of the folder from which an item is copied. + * Value: A string value that specifies the folder's full name. + */ + oldFolderFullName: string; +} +/** + * A method that will handle the client ItemsCopied event. + */ +interface ASPxClientFileManagerItemsCopiedEventHandler { + /** + * A method that will handle the ItemsCopied event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemsCopiedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemsCopiedEventArgs): void; +} +/** + * Provides data for the ItemsCopied event. + */ +interface ASPxClientFileManagerItemsCopiedEventArgs extends ASPxClientEventArgs { + /** + * Gets an array of the currently processed items. + * Value: An array of ASPxClientFileManagerItem objects that are items currently being processed. + */ + items: ASPxClientFileManagerItem[]; + /** + * Gets the full name of the folder from which items are copied. + * Value: A string value that specifies the folder's full name. + */ + oldFolderFullName: string; +} +/** + * A method that will handle the client FolderCreated event. + */ +interface ASPxClientFileManagerItemCreatedEventHandler { + /** + * A method that will handle the FolderCreated event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerItemCreatedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerItemCreatedEventArgs): void; +} +/** + * Provides data for the FolderCreated event. + */ +interface ASPxClientFileManagerItemCreatedEventArgs extends ASPxClientFileManagerActionEventArgsBase { +} +/** + * A method that will handle the client ErrorOccurred event. + */ +interface ASPxClientFileManagerErrorEventHandler { + /** + * A method that will handle the client ErrorOccurred event. + * @param source An object representing the event's source. + * @param e An ASPxClientFileManagerErrorEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerErrorEventArgs): void; +} +/** + * Provides data for the ErrorOccurred event. + */ +interface ASPxClientFileManagerErrorEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value representing the processed command's name. + */ + commandName: string; + /** + * Gets or sets the error description. + * Value: A string value specifying the error description. + */ + errorText: string; + /** + * Gets or sets a value specifying whether an event error message is sent to the ErrorAlertDisplaying event. + * Value: true to sent an error message; otherwise, false. + */ + showAlert: boolean; + /** + * Gets a specifically generated code that uniquely identifies an error, which occurs while editing an item. + * Value: An integer value that specifies the code uniquely identifying an error. + */ + errorCode: number; +} +/** + * A method that will handle the client ErrorAlertDisplaying event. + */ +interface ASPxClientFileManagerErrorAlertDisplayingEventHandler { + /** + * A method that will handle the ErrorAlertDisplaying event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerErrorAlertDisplayingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerErrorAlertDisplayingEventArgs): void; +} +/** + * Provides data for the ErrorAlertDisplaying event. + */ +interface ASPxClientFileManagerErrorAlertDisplayingEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value that is the processed command's name. + */ + commandName: string; + /** + * Gets or sets the errors description. + * Value: A string that is the errors description. + */ + errorText: string; + /** + * Gets or sets a value specifying whether an alert message is displayed when the event fires. + * Value: true to display an alert message; otherwise, false. + */ + showAlert: boolean; +} +/** + * A method that will handle the client FileUploading event. + */ +interface ASPxClientFileManagerFileUploadingEventHandler { + /** + * A method that will handle the FileUploading event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerFileUploadingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFileUploadingEventArgs): void; +} +/** + * Provides data for the FileUploading event. + */ +interface ASPxClientFileManagerFileUploadingEventArgs extends ASPxClientEventArgs { + /** + * Gets the path to the folder where a file is being uploaded. + * Value: A string value specifying the path where a file is being uploaded. + */ + folder: string; + /** + * Gets the name of a file selected for upload. + * Value: A string value that specifies the file name. + */ + fileName: string; + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the client FilesUploading event. + */ +interface ASPxClientFileManagerFilesUploadingEventHandler { + /** + * A method that will handle the FilesUploading event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerFilesUploadingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFilesUploadingEventArgs): void; +} +/** + * Provides data for the FilesUploading event. + */ +interface ASPxClientFileManagerFilesUploadingEventArgs extends ASPxClientEventArgs { + /** + * Gets the path to the folder where files are being uploaded. + * Value: A string value specifying the folder path. + */ + folder: string; + /** + * Gets the names of files selected for upload. + * Value: An array of string values that are the file names. + */ + fileNames: string[]; + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the client FileUploaded event. + */ +interface ASPxClientFileManagerFileUploadedEventHandler { + /** + * A method that will handle the FileUploaded event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerFileUploadedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFileUploadedEventArgs): void; +} +/** + * Provides data for the FileUploaded event. + */ +interface ASPxClientFileManagerFileUploadedEventArgs extends ASPxClientEventArgs { + /** + * Gets the path to the folder where a file is uploaded. + * Value: A string value specifying the uploaded file path. + */ + folder: string; + /** + * Gets the name of the uploaded file. + * Value: A string value that specifies the file name. + */ + fileName: string; +} +/** + * A method that will handle the client FilesUploaded event. + */ +interface ASPxClientFileManagerFilesUploadedEventHandler { + /** + * A method that will handle the FilesUploaded event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerFilesUploadedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFilesUploadedEventArgs): void; +} +/** + * Provides data for the FilesUploaded event. + */ +interface ASPxClientFileManagerFilesUploadedEventArgs extends ASPxClientEventArgs { + /** + * Gets the path to the folder where files are uploaded. + * Value: A string value specifying the uploaded files path. + */ + folder: string; + /** + * Gets an array of uploaded file names. + * Value: An array of string values that are the file names. + */ + fileNames: string[]; +} +/** + * A method that will handle the client FileDownloading event. + */ +interface ASPxClientFileManagerFileDownloadingEventHandler { + /** + * A method that will handle the FileDownloading event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerFileDownloadingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFileDownloadingEventArgs): void; +} +/** + * Provides data for the FileDownloading event. + */ +interface ASPxClientFileManagerFileDownloadingEventArgs extends ASPxClientFileManagerFileEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event, should be canceled. + * Value: true, if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the client FocusedItemChanged event. + */ +interface ASPxClientFileManagerFocusedItemChangedEventHandler { + /** + * A method that will handle the FocusedItemChanged event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerFocusedItemChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerFocusedItemChangedEventArgs): void; +} +/** + * Provides data for the FocusedItemChanged event. + */ +interface ASPxClientFileManagerFocusedItemChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the file manager item object related to the event. + * Value: An object, manipulations on which forced the event to be raised. + */ + item: ASPxClientFileManagerItem; + /** + * Gets the name of the focused item. + * Value: A string value that specifies the item's name. + */ + name: string; + /** + * Gets the full name of the item currently being processed. + * Value: A string value that is the item's full name. + */ + fullName: string; +} +/** + * A method that will handle the client CurrentFolderChanged event. + */ +interface ASPxClientFileManagerCurrentFolderChangedEventHandler { + /** + * A method that will handle the CurrentFolderChanged event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerCurrentFolderChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerCurrentFolderChangedEventArgs): void; +} +/** + * Provides data for the CurrentFolderChanged event. + */ +interface ASPxClientFileManagerCurrentFolderChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the currently processed folder. + * Value: A string value that specifies the folder's name. + */ + name: string; + /** + * Gets the full name of the folder currently being processed. + * Value: A string value that is the folder's full name. + */ + fullName: string; +} +/** + * A method that will handle the client SelectionChanged event. + */ +interface ASPxClientFileManagerSelectionChangedEventHandler { + /** + * A method that will handle the SelectionChanged event. + * @param source The event source. Identifies the ASPxFileManager control that raised the event. + * @param e A ASPxClientFileManagerSelectionChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerSelectionChangedEventArgs): void; +} +/** + * Provides data for the SelectionChanged event. + */ +interface ASPxClientFileManagerSelectionChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the file manager item object related to the event. + * Value: An object, manipulations on which forced the event to be raised. + */ + item: ASPxClientFileManagerItem; + /** + * Gets the name of the currently processed file. + * Value: A string value that specifies the file's name. + */ + name: string; + /** + * Gets the full name of the file currently being processed. + * Value: A string value that is the file's full name. + */ + fullName: string; + /** + * Gets whether the item has been selected. + * Value: true if the file has been selected; otherwise, false. + */ + isSelected: boolean; +} +/** + * A method that will handle the CustomCommand event. + */ +interface ASPxClientFileManagerCustomCommandEventHandler { + /** + * A method that will handle the CustomCommand event. + * @param source The event source. + * @param e An ASPxClientFileManagerCustomCommandEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerCustomCommandEventArgs): void; +} +/** + * Provides data for the CustomCommand event. + */ +interface ASPxClientFileManagerCustomCommandEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the processed command. + * Value: A string value that is the processed command's name. + */ + commandName: string; +} +/** + * A method that will handle the ToolbarUpdating event. + */ +interface ASPxClientFileManagerToolbarUpdatingEventHandler { + /** + * A method that will handle the ToolbarUpdating event. + * @param source The event source. + * @param e An ASPxClientFileManagerToolbarUpdatingEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerToolbarUpdatingEventArgs): void; +} +/** + * Provides data for the ToolbarUpdating event. + */ +interface ASPxClientFileManagerToolbarUpdatingEventArgs extends ASPxClientEventArgs { + /** + * Gets the name of the currently active file manager area. + * Value: A string value that identifies the active area. + */ + activeAreaName: string; +} +/** + * A method that will handle the client HighlightItemTemplate event. + */ +interface ASPxClientFileManagerHighlightItemTemplateEventHandler { + /** + * A method that will handle the HighlightItemTemplate event. + * @param source The event source. This parameter identifies the file manager object that raised the event. + * @param e An ASPxClientFileManagerHighlightItemTemplateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFileManagerHighlightItemTemplateEventArgs): void; +} +/** + * Provides data for the HighlightItemTemplate event. + */ +interface ASPxClientFileManagerHighlightItemTemplateEventArgs extends ASPxClientEventArgs { + /** + * Gets a string that is a filter value specified by the filter box. + * Value: A string that is a filter value. + */ + filterValue: string; + /** + * Gets the name of the item currently being processed. + * Value: A string that is the item name. + */ + itemName: string; + /** + * Gets an element containing the item template. + * Value: An object that is an element containing the item template. + */ + templateElement: string; + /** + * Get the name of the cascading style sheet (CSS) class associated with an item in the highlighted state. + * Value: A string that is the name of a CSS class. + */ + highlightCssClassName: string; +} +/** + * Represents a client-side equivalent of the menu's MenuItem object. + */ +interface ASPxClientMenuItem { + /** + * Gets the menu object to which the current item belongs. + * Value: An ASPxClientMenuBase object representing the menu to which the item belongs. + */ + menu: ASPxClientMenuBase; + /** + * Gets the immediate parent item to which the current item belongs. + * Value: An ASPxClientMenuItem object representing the item's immediate parent. + */ + parent: ASPxClientMenuItem; + /** + * Gets the item's index within the parent's collection of items. + * Value: An integer value representing the item's zero-based index within the Items collection of the parent object (a menu or item) to which the item belongs. + */ + index: number; + /** + * Gets the name that uniquely identifies the menu item. + * Value: A string value that represents the value assigned to the item's Name property. + */ + name: string; + /** + * For internal use only. + */ + indexPath: string; + /** + * Returns the number of the current menu item's immediate child items. + */ + GetItemCount(): number; + /** + * Returns the current menu item's immediate subitem specified by its index. + * @param index An integer value specifying the zero-based index of the submenu item to be retrieved. + */ + GetItem(index: number): ASPxClientMenuItem; + /** + * Returns the current menu item's subitem specified by its name. + * @param name A string value specifying the name of the menu item. + */ + GetItemByName(name: string): ASPxClientMenuItem; + /** + * Indicates whether the menu item is checked. + */ + GetChecked(): boolean; + /** + * Specifies whether the menu item is checked. + * @param value true if the menu item is checked; otherwise, false. + */ + SetChecked(value: boolean): void; + /** + * Returns a value specifying whether a menu item is enabled. + */ + GetEnabled(): boolean; + /** + * Specifies whether the menu item is enabled. + * @param value true to enable the menu item; otherwise, false. + */ + SetEnabled(value: boolean): void; + /** + * Returns the URL pointing to the image displayed within the menu item. + */ + GetImageUrl(): string; + /** + * Sets the URL which points to the image displayed within the menu item. + * @param value A string value specifying the URL to the image displayed within the menu item. + */ + SetImageUrl(value: string): void; + /** + * Gets a URL which defines the navigation location for the menu item. + */ + GetNavigateUrl(): string; + /** + * Specifies a URL which defines the navigation location for the menu item. + * @param value A string value which specifies a URL to where the client web browser will navigate when the menu item is clicked. + */ + SetNavigateUrl(value: string): void; + /** + * Returns text displayed within the menu item. + */ + GetText(): string; + /** + * Sets the text to be displayed within the menu item. + * @param value A string value specifying the text to be displayed within the menu item. + */ + SetText(value: string): void; + /** + * Returns a value specifying whether a menu item is displayed. + */ + GetVisible(): boolean; + /** + * Specifies the menu item's visibility. + * @param value true if the menu item is visible; otherwise, false. + */ + SetVisible(value: boolean): void; +} +/** + * A client-side equivalent of the file manager's FileManagerToolbarItemBase object. + */ +interface ASPxClientFileManagerToolbarItem extends ASPxClientMenuItem { + /** + * This property is not in effect for the ASPxClientFileManagerToolbarItem class. + */ + menu: ASPxClientMenuBase; + /** + * This property is not in effect for the ASPxClientFileManagerToolbarItem class. + */ + parent: ASPxClientMenuItem; + /** + * This property is not in effect for the ASPxClientFileManagerToolbarItem class. + */ + index: number; +} +/** + * A client-side equivalent of the ASPxFormLayout's LayoutItem object. + */ +interface ASPxClientLayoutItem { + /** + * Gets the form layout object to which the current item belongs. + * Value: An object representing the form layout to which the item belongs. + */ + formLayout: ASPxClientFormLayout; + /** + * Gets the name that uniquely identifies the layout item. + * Value: A string value that represents the value assigned to the layout item's Name property. + */ + name: string; + /** + * Gets the immediate parent layout item to which the current layout item belongs. + * Value: An object representing the item's immediate parent. + */ + parent: ASPxClientLayoutItem; + /** + * Returns the current layout item's subitem specified by its name. + * @param name A string value specifying the name of the layout item. + */ + GetItemByName(name: string): ASPxClientLayoutItem; + /** + * Returns a value specifying whether a layout item is displayed. + */ + GetVisible(): boolean; + /** + * Specifies the layout item's visibility. + * @param value true, if the layout item is visible; otherwise, false. + */ + SetVisible(value: boolean): void; + /** + * Specifies the text displayed in the layout item caption. + * @param caption A string value specifying the item caption. + */ + SetCaption(caption: string): void; + /** + * Returns the text displayed in the layout item caption. + */ + GetCaption(): string; +} +/** + * Represents a client-side equivalent of the ASPxFormLayout object. + */ +interface ASPxClientFormLayout extends ASPxClientControl { + /** + * Returns an item specified by its name. + * @param name A string value specifying the name of the item. + */ + GetItemByName(name: string): ASPxClientLayoutItem; +} +/** + * Represents a client-side equivalent of the ASPxGlobalEvents component. + */ +interface ASPxClientGlobalEvents { + /** + * Occurs on the client side after client object models of all DevExpress web controls contained within the page have been initialized. + */ + ControlsInitialized: ASPxClientEvent>; + /** + * Occurs when the browser window is being resized. + */ + BrowserWindowResized: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated by any DevExpress control. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side, after server-side processing of a callback initiated by any DevExpress web control, has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by any of DevExpress web controls. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side after the validation initiated for a DevExpress web control (or a group of DevExpress web controls) has been completed. + */ + ValidationCompleted: ASPxClientEvent>; +} +/** + * Represents a client-side equivalent of the ASPxHiddenField control. + */ +interface ASPxClientHiddenField extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientHiddenField. + */ + CallbackError: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side CustomCallback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Adds a new value to the control's collection of property name/value pairs, on the client side. + * @param propertyName A string value that specifies the property name. It can contain letters, digits, underline characters, and dollar signs. It cannot begin with a digit character. + * @param propertyValue An object that represents the value of the specified property. + */ + Add(propertyName: string, propertyValue: Object): void; + /** + * Returns the value with the specified property name. + * @param propertyName A string value that specifies the property name. + */ + Get(propertyName: string): Object; + /** + * Adds a new value to the control's collection of property name/value pairs, on the client side. + * @param propertyName A string value that specifies the property name. It can contain letters, digits, underline characters, and dollar signs. It cannot begin with a digit character. + * @param propertyValue An object that represents the property value. + */ + Set(propertyName: string, propertyValue: Object): void; + /** + * Removes the specified value from the ASPxHiddenField collection. + * @param propertyName A string value representing the property name. + */ + Remove(propertyName: string): void; + /** + * Clears the ASPxHiddenField's value collection. + */ + Clear(): void; + /** + * Returns a value indicating whether the value with the specified property name is contained within the ASPxHiddenField control's value collection. + * @param propertyName A string value that specifies the property name. + */ + Contains(propertyName: string): boolean; +} +/** + * Represents the client-side equivalent of the ASPxHint control. + */ +interface ASPxClientHint extends ASPxClientControl { + /** + * Occurs on the client side when a hint is about to be shown. + */ + Showing: ASPxClientEvent; + /** + * Occurs on the client side when a hint is about to be hidden. + */ + Hiding: ASPxClientEvent; + /** + * This method is not in effect for a ASPxClientHint object. + */ + GetMainElement(): Object; + /** + * Invokes a hint. + * @param targetElement A HTML DOM element near to which the hint is displayed in response to user interaction. + */ + Show(targetElement: Object): ASPxClientHintWindow; + /** + * Invokes a hint. + * @param targetSelector A string value that is the CSS selector used to specify for which UI elements on a web page a hint is displayed. + */ + Show(targetSelector: string): ASPxClientHintWindow; +} +/** + * Represents the client-side equivalent of the ASPxHint's window. + */ +interface ASPxClientHintWindow { + /** + * Forces the ASPxClientHint's window to recalculate its position. + */ + UpdatePosition(): void; +} +/** + * A method that will handle the Showing event. + */ +interface ASPxClientHintShowingEventHandler { + /** + * A method that will handle the Showing event. + * @param sender The event source. + * @param e A ASPxClientHintShowingEventArgs object that contains the required data. + */ + (sender: ASPxClientHintWindow, e: ASPxClientHintShowingEventArgs): void; +} +/** + * Provides data for the Showing event. + */ +interface ASPxClientHintShowingEventArgs extends ASPxClientEventArgs { + /** + * Gets the object that is the hint's target element. + * Value: An object representing the hint's target element related to the event. + */ + targetElement: Object; + /** + * Gets the object that is the hint. + * Value: An object representing the hint related to the event. + */ + hintElement: Object; + /** + * Gets the object that is the hint's content. + * Value: An object representing the hint's content element related to the event. + */ + contentElement: Object; + /** + * Gets the object that is the hint's title. + * Value: An object representing the hint's title element related to the event. + */ + titleElement: Object; + /** + * Gets or sets a value indicating whether the event should be canceled. + * Value: true, if the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that will handle the Hiding event. + */ +interface ASPxClientHintHidingEventHandler { + /** + * A method that will handle the Hiding event. + * @param sender The event source. + * @param e A ASPxClientHintHidingEventArgs object that contains the required data. + */ + (sender: ASPxClientHintWindow, e: ASPxClientHintHidingEventArgs): void; +} +/** + * Provides data for the Hiding event. + */ +interface ASPxClientHintHidingEventArgs extends ASPxClientEventArgs { + /** + * Gets the object that is the hint's target element. + * Value: An object representing the hint's target element. + */ + targetElement: Object; + /** + * Gets the object that is the hint element. + * Value: An object representing the hint related to the event. + */ + hintElement: Object; + /** + * Gets the object that is the hint's content. + * Value: An object representing the hint's content element related to the event. + */ + contentElement: Object; + /** + * Gets the object that is the hint's title. + * Value: An object representing the hint's title element related to the event. + */ + titleElement: Object; + /** + * Gets or sets a value indicating whether the event should be canceled. + * Value: true, if the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * The hint control's options. + */ +interface ASPxClientHintOptions { + /** + * Gets or sets which user action triggers a hint. + * Value: A string value that is a user action. + */ + triggerAction: string; + /** + * Gets or sets the delay in displaying the hint. + * Value: An integer value that specifies the time interval, in milliseconds, after which a hint is displayed. + */ + appearAfter: number; + /** + * Gets or sets the duration after which a hint disappears when the mouse pointer is no longer positioned over the target element. + * Value: The length of time (in milliseconds) a hint is displayed after the mouse pointer is no longer positioned over the target element. + */ + disappearAfter: number; + /** + * Gets or sets a value that specifies whether a hint is displayed in a callout box. + * Value: true, to display a hint in a callout box; otherwise, false. + */ + showCallout: boolean; + /** + * Gets or sets where a hint should be positioned. + * Value: A string value that specifies a hint position. + */ + position: string; + /** + * Gets or sets a custom CSS class name that will be assigned to the root ASPxHint element. + * Value: A string value that is the CSS class name. + */ + className: string; + /** + * Gets or sets the attribute name. + * Value: A string value that is the attribute name. + */ + contentAttribute: string; + /** + * Gets or sets the attribute name. + * Value: A string value that is the attribute name. + */ + titleAttribute: string; + /** + * Gets or sets the hint's content. + * Value: A string value that is the hint's content. + */ + content: string; + /** + * Gets or sets a value that is the hint's title. + * Value: A string value that is the title text. + */ + title: string; + /** + * Gets or sets a value that is the HTML DOM-element. + * Value: A string that is the DOM-element. + */ + container: string; + /** + * A handler for the Showing event. + * Value: An delegate method allowing you to implement custom processing. + */ + onShowing: ASPxClientHintShowingEventHandler; + /** + * A handler for the Hiding event. + * Value: An delegate method allowing you to implement custom processing. + */ + onHiding: ASPxClientHintHidingEventHandler; + /** + * Gets or sets a value that is the hint's width. + * Value: A string value that is the hint's width. + */ + width: string; + /** + * Gets or sets a value that is the hint's height. + * Value: A string value that is the hint's height. + */ + height: string; + /** + * Gets or sets the X coordinate. + * Value: An integer value that is the X coordinate. + */ + x: number; + /** + * Gets or sets the Y coordinate. + * Value: An integer value that is the Y coordinate. + */ + y: number; + /** + * Gets or sets a value that specifies whether to flip the hint to the opposite position relative to the target element. + * Value: true, to flip the hint; otherwise, false. + */ + allowFlip: boolean; + /** + * Gets or sets a value that specifies whether to shift a hint if its content and title are hidden outside of the client area. + * Value: true, to shift the hint; otherwise, false. + */ + allowShift: boolean; + /** + * Gets or sets whether it should use animation effects when a hint appears. + * Value: true if animation is enabled; otherwise false. + */ + animation: any; + /** + * Gets the offset of a hint. + * Value: An integer value. + */ + offset: number; +} +/** + * The client-side equivalent of the ASPxImageGallery control. + */ +interface ASPxClientImageGallery extends ASPxClientDataView { + /** + * Fires on the client side before the fullscreen viewer is shown and allows you to cancel the action. + */ + FullscreenViewerShowing: ASPxClientEvent>; + /** + * Occurs on the client side after an active item has been changed within the fullscreen viewer. + */ + FullscreenViewerActiveItemIndexChanged: ASPxClientEvent>; + /** + * Shows the fullscreen viewer with the specified active item. + * @param index An Int32 value that is an index of the active item. + */ + ShowFullscreenViewer(index: number): void; + /** + * Hides the fullscreen viewer. + */ + HideFullscreenViewer(): void; + /** + * Makes the specified item active within the fullscreen viewer on the client side. + * @param index An integer value specifying the index of the item to select. + * @param preventAnimation true to prevent the animation effect; false to change images using animation. + */ + SetFullscreenViewerActiveItemIndex(index: number, preventAnimation: boolean): void; + /** + * Gets the number of items contained in the control's item collection. + */ + GetFullscreenViewerItemCount(): number; + /** + * Returns the index of the active item within the fullscreen viewer. + */ + GetFullscreenViewerActiveItemIndex(): number; + /** + * Plays a slide show within a fullscreen viewer. + */ + PlaySlideShow(): void; + /** + * Pauses a slide show within a fullscreen viewer. + */ + PauseSlideShow(): void; +} +/** + * A method that will handle the client FullscreenViewerShowing event. + */ +interface ASPxClientImageGalleryCancelEventHandler { + /** + * A method that will handle the FullscreenViewerShowing event. + * @param source The event source. Identifies the ASPxImageGallery control that raised the event. + * @param e An ASPxClientImageGalleryCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientImageGalleryCancelEventArgs): void; +} +/** + * Provides data for the FullscreenViewerShowing event. + */ +interface ASPxClientImageGalleryCancelEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the index of the item related to the event. + * Value: An value that is the related item's index. + */ + index: number; + /** + * Gets the unique identifier name of the item related to the event. + * Value: A string value that specifies the item's unique identifier name. + */ + name: string; +} +/** + * A method that will handle the client FullscreenViewerActiveItemIndexChanged event. + */ +interface ASPxClientImageGalleryFullscreenViewerEventHandler { + /** + * A method that will handle the FullscreenViewerActiveItemIndexChanged event. + * @param source The event source. Identifies the ASPxImageGallery control that raised the event. + * @param e An ASPxClientImageGalleryFullscreenViewerEventArgs object that contains event data. + */ + (source: S, e: ASPxClientImageGalleryFullscreenViewerEventArgs): void; +} +/** + * Provides data for the FullscreenViewerActiveItemIndexChanged event. + */ +interface ASPxClientImageGalleryFullscreenViewerEventArgs extends ASPxClientEventArgs { + /** + * Gets the index of the item related to the event. + * Value: An value that is the related item's index. + */ + index: number; + /** + * Gets the unique identifier name of the item related to the event. + * Value: A string value that specifies the item's unique identifier name. + */ + name: string; +} +/** + * A client-side equivalent of the ASPxImageSlider object. + */ +interface ASPxClientImageSlider extends ASPxClientControl { + /** + * Occurs after the active image, displayed within the image area, is changed. + */ + ActiveItemChanged: ASPxClientEvent>; + /** + * Fires after an image item has been clicked within the image area. + */ + ItemClick: ASPxClientEvent>; + /** + * Occurs on the client side when a thumbnail is clicked. + */ + ThumbnailItemClick: ASPxClientEvent>; + /** + * Returns an item specified by its index within the image slider's item collection. + * @param index An integer value specifying the zero-based index of the item to be retrieved. + */ + GetItem(index: number): ASPxClientImageSliderItem; + /** + * Returns an item specified by its name. + * @param name A string value specifying the name of the item. + */ + GetItemByName(name: string): ASPxClientImageSliderItem; + /** + * Returns the index of the active item within the image slider control. + */ + GetActiveItemIndex(): number; + /** + * Makes the specified item active within the image slider control on the client side. + * @param index An integer value specifying the index of the item to select. + * @param preventAnimation true to prevent the animation effect; false to change images using animation. + */ + SetActiveItemIndex(index: number, preventAnimation: boolean): void; + /** + * Returns the active item within the ASPxImageSlider control. + */ + GetActiveItem(): ASPxClientImageSliderItem; + /** + * Makes the specified item active within the image slider control on the client side. + * @param item An ASPxClientImageSliderItem object specifying the item to select. + * @param preventAnimation true to prevent animation effect; false to enable animation. + */ + SetActiveItem(item: ASPxClientImageSliderItem, preventAnimation: boolean): void; + /** + * Gets the number of items contained in the control's item collection. + */ + GetItemCount(): number; + /** + * Sets input focus to the ASPxImageSlider control. + */ + Focus(): void; + /** + * Plays a slide show within an image slider. + */ + Play(): void; + /** + * Pauses a slide show within image slider. + */ + Pause(): void; + /** + * Gets a value indicating whether the slide show is playing. + */ + IsSlideShowPlaying(): boolean; +} +/** + * A method that will handle the ItemClick events. + */ +interface ASPxClientImageSliderItemEventHandler { + /** + * A method that will handle the ItemClick events. + * @param source The event source. Identifies the ASPxImageSlider control that raised the event. + * @param e An ASPxClientImageSliderItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientImageSliderItemEventArgs): void; +} +/** + * Provides data for the ItemClick events. + */ +interface ASPxClientImageSliderItemEventArgs extends ASPxClientEventArgs { + /** + * Gets an item object related to the event. + * Value: An object, manipulations on which forced the event to be raised. + */ + item: ASPxClientImageSliderItem; +} +/** + * A client-side equivalent of the image slider's ImageSliderItem object. + */ +interface ASPxClientImageSliderItem { + /** + * Gets an image slider to which the current item belongs. + * Value: An object that is the item's owner. + */ + imageSlider: ASPxClientImageSlider; + /** + * Gets the item's index within an items collection. + * Value: An integer value is the item's zero-based index within the Items collection. + */ + index: number; + /** + * Gets the name that uniquely identifies the image slider item. + * Value: A string value that is the value assigned to the item's Name property. + */ + name: string; + /** + * Gets or sets the path to the image displayed within the ASPxClientImageSliderItem. + * Value: A value specifying the path to the image. + */ + imageUrl: string; + /** + * Gets the item's display text. + * Value: A string value that is the item's display text. + */ + text: string; +} +/** + * The client-side equivalent of the ASPxImageZoomNavigator object. + */ +interface ASPxClientImageZoomNavigator extends ASPxClientImageSlider { +} +/** + * A client-side equivalent of the ASPxImageZoom object. + */ +interface ASPxClientImageZoom extends ASPxClientControl { + /** + * Sets the properties on an image displayed in the image zoom control. + * @param imageUrl A string value specifying the path to the preview image displayed in the preview image. + * @param largeImageUrl A string value specifying the path to the preview image displayed in the zoom window and the expand window. + * @param zoomWindowText A string value specifying the text displayed in the zoom window. + * @param expandWindowText A string value specifying the text displayed in the expand window. + * @param alternateText A string value that specifies the alternate text displayed instead of the image. + */ + SetImageProperties(imageUrl: string, largeImageUrl: string, zoomWindowText: string, expandWindowText: string, alternateText: string): void; +} +/** + * Represents a client-side equivalent of the ASPxLoadingPanel control. + */ +interface ASPxClientLoadingPanel extends ASPxClientControl { + /** + * Invokes the loading panel. + */ + Show(): void; + /** + * Invokes the loading panel, displaying it over the specified HTML element. + * @param htmlElement An object that specifies the required HTML element. + */ + ShowInElement(htmlElement: Object): void; + /** + * Invokes the loading panel, displaying it over the specified element. + * @param id A string that specifies the required element's identifier. + */ + ShowInElementByID(id: string): void; + /** + * Invokes the loading panel at the specified position. + * @param x An integer value specifying the x-coordinate of the loading panel's display position. + * @param y An integer value specifying the y-coordinate of the loaidng panel's display position. + */ + ShowAtPos(x: number, y: number): void; + /** + * Sets the text to be displayed within the ASPxLoadingPanel. + * @param text A string value specifying the text to be displayed within the ASPxLoadingPanel. + */ + SetText(text: string): void; + /** + * Gets the text displayed within the ASPxLoadingPanel. + */ + GetText(): string; + /** + * Hides the loading panel. + */ + Hide(): void; +} +/** + * Represents the client-side equivalent of the area that is used within the Html Editor's media dialogs. + */ +interface ASPxClientMediaFileSelector extends ASPxClientControl { + /** + * Returns a URL text from the URL text box in Html Editor's media dialogs. + */ + GetUrl(): string; + /** + * Sets a URL text in the Html Editor's media dialogs. + * @param url A string value that is the Url text. + */ + SetUrl(url: string): void; +} +/** + * Serves as the base type for the ASPxClientPopupMenu objects. + */ +interface ASPxClientMenuBase extends ASPxClientControl { + /** + * Fires after a menu item has been clicked. + */ + ItemClick: ASPxClientEvent>; + /** + * Occurs on the client side when the mouse cursor is moved into a menu item. + */ + ItemMouseOver: ASPxClientEvent>; + /** + * Occurs on the client side when the mouse cursor moves outside a menu item. + */ + ItemMouseOut: ASPxClientEvent>; + /** + * Occurs on the client side when a submenu pops up. + */ + PopUp: ASPxClientEvent>; + /** + * Occurs on the client side when a submenu closes. + */ + CloseUp: ASPxClientEvent>; + /** + * Returns the number of menu items at the root menu level. + */ + GetItemCount(): number; + /** + * Returns the menu's root menu item specified by its index. + * @param index An integer value specifying the zero-based index of the root menu item to be retrieved. + */ + GetItem(index: number): ASPxClientMenuItem; + /** + * Returns a menu item specified by its name. + * @param name A string value specifying the name of the menu item. + */ + GetItemByName(name: string): ASPxClientMenuItem; + /** + * Returns the selected item within the menu control. + */ + GetSelectedItem(): ASPxClientMenuItem; + /** + * Selects the specified menu item within a menu control on the client side. + * @param item An ASPxClientMenuItem object specifying the menu item to select. + */ + SetSelectedItem(item: ASPxClientMenuItem): void; + /** + * Returns a root menu item. + */ + GetRootItem(): ASPxClientMenuItem; +} +/** + * Represents a client collection that maintains client menu objects. + */ +interface ASPxClientMenuCollection extends ASPxClientControlCollection { + /** + * Recalculates the position of visible sub menus. + */ + RecalculateAll(): void; + /** + * Hides all menus maitained by the collection. + */ + HideAll(): void; +} +/** + * Represents a client-side equivalent of the ASPxMenu object. + */ +interface ASPxClientMenu extends ASPxClientMenuBase { + /** + * Gets a value specifying the menu orientation. + */ + GetOrientation(): string; + /** + * Sets the menu orientation. + * @param orientation 'Vertical' to orient the menu vertically; 'Horizontal' to orient the menu horizontally. + */ + SetOrientation(orientation: string): void; +} +/** + * A method that will handle the menu's client events concerning manipulations with an item. + */ +interface ASPxClientMenuItemEventHandler { + /** + * A method that will handle the menu's client events concerning manipulations with an item. + * @param source The event source. This parameter identifies the menu object which raised the event. + * @param e An ASPxClientMenuItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientMenuItemEventArgs): void; +} +/** + * Provides data for events which concern manipulations on menu items. + */ +interface ASPxClientMenuItemEventArgs extends ASPxClientEventArgs { + /** + * Gets the menu item object related to the event. + * Value: An ASPxClientMenuItem object, manipulations on which forced the event to be raised. + */ + item: ASPxClientMenuItem; +} +/** + * A method that will handle client events which relate to mouse hovering (such as entering or leaving) over menu items. + */ +interface ASPxClientMenuItemMouseEventHandler { + /** + * A method that will handle the ItemMouseOver events. + * @param source An object representing the event source. + * @param e A MenuItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientMenuItemMouseEventArgs): void; +} +/** + * Provides data for client events which relate to mouse hovering (such as entering or leaving) over menu items. + */ +interface ASPxClientMenuItemMouseEventArgs extends ASPxClientMenuItemEventArgs { + /** + * Gets the HTML object that contains the processed item. + * Value: An HTML object representing a container for the item related to the event. + */ + htmlElement: Object; +} +/** + * A method that will handle client events concerning clicks on the control's items. + */ +interface ASPxClientMenuItemClickEventHandler { + /** + * A method that will handle client ItemClick events. + * @param source An object representing the event source. + * @param e A MenuItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientMenuItemClickEventArgs): void; +} +/** + * Provides data for events which concern clicking on the control's items. + */ +interface ASPxClientMenuItemClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the menu item object related to the event. + * Value: An ASPxClientMenuItem object, manipulations on which forced the event to be raised. + */ + item: ASPxClientMenuItem; + /** + * Gets the HTML object that contains the processed item. + * Value: An object representing a container for the item related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * Contains options affecting the touch scrolling functionality. + */ +interface ASPxClientTouchUIOptions { + /** + * Gets or sets a value that specifies whether or not the horizontal scroll bar should be displayed. + * Value: true to display the horizontal scroll bar; otherwise, false. The default value is true. + */ + showHorizontalScrollbar: boolean; + /** + * Gets or sets a value that specifies whether or not the vertical scroll bar should be displayed. + * Value: true to display the vertical scroll bar; otherwise, false. The default value is true. + */ + showVerticalScrollbar: boolean; + /** + * Gets or sets the name of the CSS class defining the vertical scroll bar's appearance. + * Value: A string value specifying the class name. + */ + vScrollClassName: string; + /** + * Gets or sets the name of the CSS class defining the horizontal scroll bar's appearance. + * Value: A string value specifying the class name. + */ + hScrollClassName: string; +} +/** + * Contains a method allowing you to apply the current scroll extender to a specific element. + */ +interface ScrollExtender { + /** + * Applies the current scroll extender to the element specified by the ID. + * @param id A string value specifying the element's ID. + */ + ChangeElement(id: string): void; + /** + * Applies the current scroll extender to the specified DOM element. + * @param element An object specifying the required DOM element. + */ + ChangeElement(element: Object): void; +} +/** + * Represents a client-side equivalent of the ASPxNavBar control. + */ +interface ASPxClientNavBar extends ASPxClientControl { + /** + * Fires after an item has been clicked. + */ + ItemClick: ASPxClientEvent>; + /** + * Fires on the client side after a group's expansion state has been changed. + */ + ExpandedChanged: ASPxClientEvent>; + /** + * Fires on the client side before the expansion state of a group is changed. + */ + ExpandedChanging: ASPxClientEvent>; + /** + * Fires when a group header is clicked. + */ + HeaderClick: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientNavBar. + */ + CallbackError: ASPxClientEvent>; + /** + * Returns the number of groups in the navbar. + */ + GetGroupCount(): number; + /** + * Returns a group specified by its index. + * @param index An integer value specifying the zero-based index of the group object to retrieve. + */ + GetGroup(index: number): ASPxClientNavBarGroup; + /** + * Returns a group specified by its name. + * @param name A string value specifying the name of the group. + */ + GetGroupByName(name: string): ASPxClientNavBarGroup; + /** + * Returns the navbar's active group. + */ + GetActiveGroup(): ASPxClientNavBarGroup; + /** + * Makes the specified group active. + * @param group A ASPxClientNavBarGroup object that specifies the active group. + */ + SetActiveGroup(group: ASPxClientNavBarGroup): void; + /** + * Returns an item specified by its name. + * @param name A string value specifying the name of the item. + */ + GetItemByName(name: string): ASPxClientNavBarItem; + /** + * Returns the selected item within the navbar control. + */ + GetSelectedItem(): ASPxClientNavBarItem; + /** + * Selects the specified item within the navbar control on the client side. + * @param item An ASPxClientNavBarItem object specifying the item to select. + */ + SetSelectedItem(item: ASPxClientNavBarItem): void; + /** + * Collapses all groups of the navbar. + */ + CollapseAll(): void; + /** + * Expands all groups of the navbar. + */ + ExpandAll(): void; +} +/** + * Represents a client-side equivalent of the navbar's NavBarGroup object. + */ +interface ASPxClientNavBarGroup { + /** + * Gets the navbar to which the current group belongs. + * Value: An ASPxClientNavBar object representing the navbar to which the group belongs. + */ + navBar: ASPxClientNavBar; + /** + * Gets the group's index within a collection of a navbar's groups. + * Value: An integer value representing the group's zero-based index within the Groups collection of the navbar to which the group belongs. + */ + index: number; + /** + * Gets the name that uniquely identifies the group. + * Value: A string value that represents the value assigned to the group's Name property. + */ + name: string; + /** + * Returns a value specifying whether a group is enabled. + */ + GetEnabled(): boolean; + /** + * Returns a value specifying whether the group is expanded. + */ + GetExpanded(): boolean; + /** + * Sets the group's expansion state. + * @param value true to expand the group; false to collapse the group. + */ + SetExpanded(value: boolean): void; + /** + * Returns a value specifying whether a group is displayed. + */ + GetVisible(): boolean; + /** + * Returns text displayed within a group. + */ + GetText(): string; + /** + * Specifies the text displayed within a group. + * @param text A string value that is the text displayed within the navbar group. + */ + SetText(text: string): void; + /** + * Specifies whether the group is visible. + * @param value true if the group is visible; otherwise, false. + */ + SetVisible(value: boolean): void; + /** + * Returns the number of items in the group. + */ + GetItemCount(): number; + /** + * Returns the group's item specified by its index. + * @param index An integer value specifying the zero-based index of the item to be retrieved. + */ + GetItem(index: number): ASPxClientNavBarItem; + /** + * Returns a group item specified by its name. + * @param name A string value specifying the name of the item. + */ + GetItemByName(name: string): ASPxClientNavBarItem; +} +/** + * Represents a client-side equivalent of the navbar's NavBarItem object. + */ +interface ASPxClientNavBarItem { + /** + * Gets the navbar to which the current item belongs. + * Value: An ASPxClientNavBar object representing the navbar to which the item belongs. + */ + navBar: ASPxClientNavBar; + /** + * Gets the group to which the current item belongs. + * Value: An ASPxClientNavBarGroup object representing the group to which the item belongs. + */ + group: ASPxClientNavBarGroup; + /** + * Gets the item's index within a collection of a group's items. + * Value: An integer value representing the item's zero-based index within the Items collection of the group to which the item belongs. + */ + index: number; + /** + * Gets the name that uniquely identifies the item. + * Value: A string value that represents the value assigned to the item's Name property. + */ + name: string; + /** + * Returns a value indicating whether an item is enabled. + */ + GetEnabled(): boolean; + /** + * Specifies whether the item is enabled. + * @param value true if the item is enabled; otherwise, false. + */ + SetEnabled(value: boolean): void; + /** + * Returns the URL which points to the image displayed within the item. + */ + GetImageUrl(): string; + /** + * Specifies the URL which points to the image displayed within the item. + * @param value A string value that specifies the URL to the image displayed within the item. + */ + SetImageUrl(value: string): void; + /** + * Gets an URL which defines the item's navigation location. + */ + GetNavigateUrl(): string; + /** + * Specifies a URL which defines the item's navigation location. + * @param value A string value which represents the URL to where the client web browser will navigate when the item is clicked. + */ + SetNavigateUrl(value: string): void; + /** + * Returns text displayed within the item. + */ + GetText(): string; + /** + * Specifies the text displayed within the item. + * @param value A string value that represents the text displayed within the item. + */ + SetText(value: string): void; + /** + * Returns a value specifying whether an item is displayed. + */ + GetVisible(): boolean; + /** + * Specifies whether the item is visible. + * @param value true is the item is visible; otherwise, false. + */ + SetVisible(value: boolean): void; +} +/** + * A method that will handle the navbar's client events concerning manipulations with an item. + */ +interface ASPxClientNavBarItemEventHandler { + /** + * A method that will handle the navbar's client events concerning manipulations with an item. + * @param source An object representing the event's source. Identifies the navbar object that raised the event. + * @param e An ASPxClientNavBarItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientNavBarItemEventArgs): void; +} +/** + * Provides data for events which concern manipulations on items. + */ +interface ASPxClientNavBarItemEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the item object related to the event. + * Value: An ASPxClientNavBarItem object, manipulations on which forced the event to be raised. + */ + item: ASPxClientNavBarItem; + /** + * Gets the HTML object that contains the processed navbar item. + * Value: An object representing a container for the navbar item related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * A method that will handle the navbar's client events concerning manipulations with a group. + */ +interface ASPxClientNavBarGroupEventHandler { + /** + * A method that will handle the navbar's client events concerning manipulations with a group. + * @param source An object representing the event's source. Identifies the navbar object that raised the event. + * @param e An ASPxClientNavBarGroupEventArgs object that contains event data. + */ + (source: S, e: ASPxClientNavBarGroupEventArgs): void; +} +/** + * Provides data for events which concern manipulations on groups. + */ +interface ASPxClientNavBarGroupEventArgs extends ASPxClientEventArgs { + /** + * Gets the group object related to the event. + * Value: An ASPxClientNavBarGroup object, manipulations on which forced the event to be raised. + */ + group: ASPxClientNavBarGroup; +} +/** + * A method that will handle the navbar's cancelable client events concerning manipulations with a group. + */ +interface ASPxClientNavBarGroupCancelEventHandler { + /** + * A method that will handle the navbar's cancelable client events concerning manipulations with a group. + * @param source An object representing the event's source. Identifies the navbar object that raised the event. + * @param e An ASPxClientNavBarGroupCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientNavBarGroupCancelEventArgs): void; +} +/** + * Provides data for cancellable events which concern manipulations on groups. + */ +interface ASPxClientNavBarGroupCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets the group object related to the event. + * Value: An ASPxClientNavBarGroup object representing the group manipulations on which forced the navbar to raise the event. + */ + group: ASPxClientNavBarGroup; +} +/** + * A method that will handle client events concerning clicks on the control's group headers. + */ +interface ASPxClientNavBarGroupClickEventHandler { + /** + * A method that will handle the navbar's client events concerning clicks on groups. + * @param source The event source. This parameter identifies the navbar object which raised the event. + * @param e An ASPxClientNavBarGroupClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientNavBarGroupClickEventArgs): void; +} +/** + * Provides data for events which concern clicking on the control's group headers. + */ +interface ASPxClientNavBarGroupClickEventArgs extends ASPxClientNavBarGroupCancelEventArgs { + /** + * Gets the HTML object that contains the processed group. + * Value: An object representing a container for the group related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * Represents a client-side equivalent of the ASPxNewsControl object. + */ +interface ASPxClientNewsControl extends ASPxClientDataView { + /** + * Fires after an item's tail has been clicked. + */ + TailClick: ASPxClientEvent>; +} +/** + * A method that will handle client events concerning manipulations with an item. + */ +interface ASPxClientNewsControlItemEventHandler { + /** + * A method that will handle the news control's client events concerning manipulations with an item. + * @param source An object representing the event's source. Identifies the news control object that raised the event. + * @param e An ASPxClientNewsControlItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientNewsControlItemEventArgs): void; +} +/** + * Provides data for events which concern tail clicking within the control's items. + */ +interface ASPxClientNewsControlItemEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the name that uniquely identifies the processed item. + * Value: A string value that represents the value assigned to the processed item's Name property. + */ + name: Object; + /** + * Gets the HTML object that contains the processed item. + * Value: An object representing a container for the item related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * Represents a client-side equivalent of the ASPxObjectContainer control. + */ +interface ASPxClientObjectContainer extends ASPxClientControl { + /** + * Occurs on the client side when the FSCommand action is called within the associated flash object's action script. + */ + FlashScriptCommand: ASPxClientEvent>; + /** + * Play the Flash movie backwards. + */ + Back(): void; + /** + * Returns the value of the Flash variable specified. + * @param name A string value that specifies the Flash variable. + */ + GetVariable(name: string): string; + /** + * Play the Flash movie forwards. + */ + Forward(): void; + /** + * Activates the specified frame in the Flash movie. + * @param frameNumber An integer value that specifies the requested frame. + */ + GotoFrame(frameNumber: number): void; + /** + * Indicates whether the Flash movie is currently playing. + */ + IsPlaying(): boolean; + /** + * Loads the Flash movie to the specified layer. + * @param layerNumber An integer value that identifies a layer in which to load the movie. + * @param url A string value that specifies the movie's URL. + */ + LoadMovie(layerNumber: number, url: string): void; + /** + * Pans a zoomed-in Flash movie to the specified coordinates. + * @param x An integer value that specifies the X-coordinate. + * @param y An integer value that specifies the Y-coordinate. + * @param mode 0 the coordinates are pixels; 1 the coordinates are a percentage of the window. + */ + Pan(x: number, y: number, mode: number): void; + /** + * Returns the percent of the Flash Player movie that has streamed into the browser so far. + */ + PercentLoaded(): string; + /** + * Starts playing the Flash movie. + */ + Play(): void; + /** + * Rewinds the Flash movie to the first frame. + */ + Rewind(): void; + /** + * Sets the value of the specified Flash variable. + * @param name A string value that specifies the Flash variable. + * @param value A string value that represents a new value. + */ + SetVariable(name: string, value: string): void; + /** + * Zooms in on the specified rectangular area of the Flash movie. + * @param left An integer value that specifies the x-coordinate of the rectangle's left side, in twips. + * @param top An integer value that specifies the y-coordinate of the rectangle's top side, in twips. + * @param right An integer value that specifies the x-coordinate of the rectangle's right side, in twips. + * @param bottom An integer value that specifies the y-coordinate of the rectangle's bottom side, in twips. + */ + SetZoomRect(left: number, top: number, right: number, bottom: number): void; + /** + * Stops playing the Flash movie. + */ + StopPlay(): void; + /** + * Returns the total number of frames in the Flash movie. + */ + TotalFrames(): number; + /** + * Zooms the Flash view by a relative scale factor. + * @param percent An integer value that specifies the relative scale factor, as a percentage. + */ + Zoom(percent: number): void; + /** + * Starts playing a Quick Time movie. + */ + QTPlay(): void; + /** + * Stops playing a Quick Time movie. + */ + QTStopPlay(): void; + /** + * Rewinds a Quick Time movie to the first frame. + */ + QTRewind(): void; + /** + * Steps through a Quick Time video stream by a specified number of frames. + * @param count An integer value that specifies the number of frames to step. + */ + QTStep(count: number): void; +} +/** + * A method that will handle the FlashScriptCommand event. + */ +interface ASPxClientFlashScriptCommandEventHandler { + /** + * A method that will handle the FlashScriptCommand event. + * @param source The event source. + * @param e A ASPxClientFlashScriptCommandEventArgs object that contains event data. + */ + (source: S, e: ASPxClientFlashScriptCommandEventArgs): void; +} +/** + * Provides data for the FlashScriptCommand client event. + */ +interface ASPxClientFlashScriptCommandEventArgs extends ASPxClientEventArgs { + /** + * Gets a command passed via the FSCommand action of the flash object. + * Value: A string that represents the value of the FSCommand action's command parameter. + */ + command: string; + /** + * Gets arguments passed via the FSCommand action of the flash object. + * Value: A string that represents the value of the FSCommand action's args parameter. + */ + args: string; +} +/** + * Lists the available link types within office documents. + */ +interface ASPxClientOfficeDocumentLinkType { +} +/** + * Represents the client-side equivalent of the ASPxPager control. + */ +interface ASPxClientPager extends ASPxClientControl { +} +/** + * Represents a client-side equivalent of the ASPxPopupControl control. + */ +interface ASPxClientPopupControl extends ASPxClientPopupControlBase { + /** + * Occurs when a popup window's close button is clicked. + */ + CloseButtonClick: ASPxClientEvent>; + /** + * This method is not in effect for a ASPxClientPopupControl object. + */ + GetMainElement(): Object; + /** + * Returns an object containing the information about a mouse event that invoked a default popup window. + */ + GetPopUpReasonMouseEvent(): Object; + /** + * Returns an object containing the information about a mouse event that invoked the specified popup window. + * @param window A ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowPopUpReasonMouseEvent(window: ASPxClientPopupWindow): Object; + /** + * + * @param window + * @param parameter + */ + PerformWindowCallback(window: ASPxClientPopupWindow, parameter: string): void; + /** + * Sends a callback with parameters to update the popup window by processing the related popup window and the passed information on the server. + * @param window A ASPxClientPopupWindow object identifying the processed popup window. + * @param parameter A string value that represents any information that needs to be sent to the server-side CustomCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformWindowCallback(window: ASPxClientPopupWindow, parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Specifies the default popup window's size. + * @param width An integer value that specifies the default popup window's width. + * @param height An integer value that specifies the default popup window's height. + */ + SetSize(width: number, height: number): void; + /** + * Gets the width of the specified popup window's content region. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowContentWidth(window: ASPxClientPopupWindow): number; + /** + * Gets the height of the specified popup window's content region. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowContentHeight(window: ASPxClientPopupWindow): number; + /** + * Returns the height of a specific popup window. + * @param window A ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowHeight(window: ASPxClientPopupWindow): number; + /** + * Returns the width of a specific popup window. + * @param window A ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowWidth(window: ASPxClientPopupWindow): number; + /** + * Specifies the size of a specific popup window. + * @param window A ASPxClientPopupWindow object that specifies the required popup window. + * @param width An integer value that specifies the required popup window's width. + * @param height An integer value that specifies the required popup window's height. + */ + SetWindowSize(window: ASPxClientPopupWindow, width: number, height: number): void; + /** + * Returns the HTML code that is the content of the popup control's default popup window. + */ + GetContentHTML(): string; + /** + * Defines the HTML content for the popup control's default popup window. + * @param html A string value that is the HTML code defining the content of the popup window. + */ + SetContentHTML(html: string): void; + /** + * Sets the ID of a web control or HTML element (or a list of IDs) with which the current popup control's window is associated. + * @param window An ASPxClientPopupWindow object representing a popup control's window. + * @param popupElementId A string value specifying the ID (or a list of IDs) of the web control or HTML element with which the popup control's window is associated. + */ + SetWindowPopupElementID(window: ASPxClientPopupWindow, popupElementId: string): void; + /** + * Sets the ID of a web control or HTML element (or a list of IDs) with which the current popup control is associated. + * @param popupElementId A string value specifying the ID (or a list of IDs) of the web control or HTML element to which the popup control is associated. + */ + SetPopupElementID(popupElementId: string): void; + /** + * Returns an index of the object that invoked the default window within the PopupElementID list. + */ + GetCurrentPopupElementIndex(): number; + /** + * Returns an index of the object that invoked the specified popup window, within the window's PopupElementID list. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowCurrentPopupElementIndex(window: ASPxClientPopupWindow): number; + /** + * Returns an object that invoked the default window. + */ + GetCurrentPopupElement(): Object; + /** + * Returns an object that invoked the specified popup window. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowCurrentPopupElement(window: ASPxClientPopupWindow): Object; + /** + * Returns a value that specifies whether the popup control's specific window is displayed. + * @param window A ASPxClientPopupWindow object representing the popup window whose visibility is checked. + */ + IsWindowVisible(window: ASPxClientPopupWindow): boolean; + /** + * Returns a popup window specified by its index. + * @param index An integer value specifying the zero-based index of the popup window object to be retrieved. + */ + GetWindow(index: number): ASPxClientPopupWindow; + /** + * Returns a popup window specified by its name. + * @param name A string value specifying the name of the popup window. + */ + GetWindowByName(name: string): ASPxClientPopupWindow; + /** + * Returns the number of popup windows in the popup control. + */ + GetWindowCount(): number; + /** + * Invokes the popup control's specific window. + * @param window A ASPxClientPopupWindow object representing the popup window to display. + */ + ShowWindow(window: ASPxClientPopupWindow): void; + /** + * Invokes the specified popup window at the popup element with the specified index. + * @param window A ASPxClientPopupWindow object that specifies the required popup window. + * @param popupElementIndex An integer value specifying the zero-based index of the popup element within the window's PopupElementID list. + */ + ShowWindow(window: ASPxClientPopupWindow, popupElementIndex: number): void; + /** + * Invokes the popup control's specific window and displays it over the specified HTML element. + * @param window A ASPxClientPopupWindow object representing the popup window to display. + * @param htmlElement An object specifying the HTML element relative to whose position the default popup window is invoked. + */ + ShowWindowAtElement(window: ASPxClientPopupWindow, htmlElement: Object): void; + /** + * Invokes the popup control's specific window and displays it over an HTML element specified by its unique identifier. + * @param window A ASPxClientPopupWindow object representing the popup window to display. + * @param id A string value that specifies the hierarchically qualified identifier of an HTML element relative to whose position the default popup window is invoked. + */ + ShowWindowAtElementByID(window: ASPxClientPopupWindow, id: string): void; + /** + * Invokes the popup control's specific popup window at the specified position. + * @param window A ASPxClientPopupWindow object representing the popup window to display. + * @param x A integer value specifying the x-coordinate of the popup window's display position. + * @param y A integer value specifying the y-coordinate of the popup window's display position. + */ + ShowWindowAtPos(window: ASPxClientPopupWindow, x: number, y: number): void; + /** + * Brings the specified popup window to the front of the z-order. + * @param window A ASPxClientPopupWindow object representing the popup window. + */ + BringWindowToFront(window: ASPxClientPopupWindow): void; + /** + * Closes the popup control's specified window. + * @param window A ASPxClientPopupWindow object representing the popup window to close. + */ + HideWindow(window: ASPxClientPopupWindow): void; + /** + * Returns the HTML code that represents the contents of the specified popup window. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + */ + GetWindowContentHtml(window: ASPxClientPopupWindow): string; + /** + * Defines the HTML content for a specific popup window within the popup control. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + * @param html A string value that represents the HTML code defining the content of the specified popup window. + */ + SetWindowContentHtml(window: ASPxClientPopupWindow, html: string): void; + /** + * Returns an iframe object containing a web page specified via the specified popup window's SetWindowContentUrl client method). + * @param window A ASPxClientPopupWindow object representing the required popup window. + */ + GetWindowContentIFrame(window: ASPxClientPopupWindow): Object; + /** + * Returns the URL pointing to the web page displayed within the control's specific popup window. + * @param window A ASPxClientPopupWindow object representing the required popup window. + */ + GetWindowContentUrl(window: ASPxClientPopupWindow): string; + /** + * Sets the URL pointing to the web page that should be loaded into and displayed within the control's specific popup window. + * @param window A ASPxClientPopupWindow object representing the required popup window. + * @param url A string value specifying the URL to the web page to be displayed within the specified popup window. + */ + SetWindowContentUrl(window: ASPxClientPopupWindow, url: string): void; + /** + * Returns a value indicating whether the specified window is pinned. + * @param window An ASPxClientPopupWindow object specifying the popup window. + */ + GetWindowPinned(window: ASPxClientPopupWindow): boolean; + /** + * Sets a value indicating whether the specified window is pinned. + * @param window An ASPxClientPopupWindow object specifying the popup window. + * @param value true to pin the window; otherwise, false. + */ + SetWindowPinned(window: ASPxClientPopupWindow, value: boolean): void; + /** + * Returns a value indicating whether the specified window is maximized. + * @param window An ASPxClientPopupWindow object specifying the popup window. + */ + GetWindowMaximized(window: ASPxClientPopupWindow): boolean; + /** + * Sets a value indicating whether the specified window is maximized. + * @param window An ASPxClientPopupWindow object specifying the popup window. + * @param value true to maximize the window; otherwise, false. + */ + SetWindowMaximized(window: ASPxClientPopupWindow, value: boolean): void; + /** + * Returns a value indicating whether the specified window is collapsed. + * @param window An ASPxClientPopupWindow object specifying the popup window. + */ + GetWindowCollapsed(window: ASPxClientPopupWindow): boolean; + /** + * Sets a value indicating whether the specified window is collapsed. + * @param window An ASPxClientPopupWindow object specifying the popup window. + * @param value true to collapse the window; otherwise, false. + */ + SetWindowCollapsed(window: ASPxClientPopupWindow, value: boolean): void; + /** + * Refreshes the content of the web page displayed within the control's specific popup window. + * @param window A ASPxClientPopupWindow object representing the required popup window. + */ + RefreshWindowContentUrl(window: ASPxClientPopupWindow): void; + /** + * Updates the default popup window's position, to correctly align it at either the specified element, or the center of the browser's window. + */ + UpdatePosition(): void; + /** + * Updates the default popup window's position, to correctly align it at the specified HTML element. + * @param htmlElement An object specifying the HTML element to which the default popup window is aligned using the PopupVerticalAlign properties. + */ + UpdatePositionAtElement(htmlElement: Object): void; + /** + * Updates the specified popup window's position, to correctly align it at either the specified element, or the center of the browser's window. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + */ + UpdateWindowPosition(window: ASPxClientPopupWindow): void; + /** + * Updates the specified popup window's position, to correctly align it at the specified HTML element. + * @param window An ASPxClientPopupWindow object that specifies the required popup window. + * @param htmlElement An object specifying the HTML element to which the specified popup window is aligned using the PopupVerticalAlign properties. + */ + UpdateWindowPositionAtElement(window: ASPxClientPopupWindow, htmlElement: Object): void; + /** + * Refreshes the connection between the ASPxPopupControl and the popup element. + */ + RefreshPopupElementConnection(): void; +} +/** + * Represents a client-side equivalent of a popup control's PopupWindow object. + */ +interface ASPxClientPopupWindow { + /** + * Gets the popup control to which the current popup window belongs. + * Value: An ASPxClientPopupControl object representing the popup control to which the window belongs. + */ + popupControl: ASPxClientPopupControl; + /** + * Gets the index of the current popup window within the popup control's Windows collection. + * Value: An integer value representing the zero-based index of the current popup window within the Windows collection of the popup control to which the window belongs. + */ + index: number; + /** + * Gets the name that uniquely identifies the current popup window. + * Value: A string value that represents a value assigned to the popup window's Name property. + */ + name: string; + /** + * Returns the URL pointing to the image displayed within the window header. + */ + GetHeaderImageUrl(): string; + /** + * Specifies the URL which points to the image displayed within the window header. + * @param value A string value that is the URL to the image displayed within the header. + */ + SetHeaderImageUrl(value: string): void; + /** + * Returns the URL pointing to the image displayed within the window footer. + */ + GetFooterImageUrl(): string; + /** + * Specifies the URL which points to the image displayed within the window footer. + * @param value A string value that is the URL to the image displayed within the window footer. + */ + SetFooterImageUrl(value: string): void; + /** + * Returns the URL where the web browser will navigate when the text or image is clicked within the popup window's header. + */ + GetHeaderNavigateUrl(): string; + /** + * Returns the URL where the web browser will navigate when the text or image is clicked within the popup window's header. + * @param value A string value which specifies the required navigation location. + */ + SetHeaderNavigateUrl(value: string): void; + /** + * Returns the URL where the web browser will navigate when the text or image is clicked within the popup window's footer. + */ + GetFooterNavigateUrl(): string; + /** + * Specifies the URL where the web browser will navigate when the text or image is clicked within the popup window's footer. + * @param value A string value which specifies the required navigation location. + */ + SetFooterNavigateUrl(value: string): void; + /** + * Returns the text displayed within the window's header. + */ + GetHeaderText(): string; + /** + * Specifies the text displayed within the window's header. + * @param value A string value that specifies the window's header text. + */ + SetHeaderText(value: string): void; + /** + * Returns the text displayed within the popup window's footer. + */ + GetFooterText(): string; + /** + * Specifies the text displayed within the window's footer. + * @param value A string value that specifies the window's footer text. + */ + SetFooterText(value: string): void; +} +/** + * A method that will handle the popup control's client events invoked in response to manipulating a popup window. + */ +interface ASPxClientPopupWindowEventHandler { + /** + * A method that will handle the popup control's client events when a popup window is manipulated. + * @param source An object representing the event's source. Identifies the popup control object (ASPxClientPopupControl) that raised the event. + * @param e An ASPxClientPopupWindowEventArgs object that contains event data. + */ + (source: S, e: ASPxClientPopupWindowEventArgs): void; +} +/** + * Provides data for events concerning client manipulations on popup windows. + */ +interface ASPxClientPopupWindowEventArgs extends ASPxClientEventArgs { + /** + * Gets the popup window object related to the event. + * Value: An ASPxClientPopupWindow object representing the popup window that was manipulated, causing the popup control to raise the event. + */ + window: ASPxClientPopupWindow; +} +/** + * A method that will handle the popup window's cancellable client events, such as the Closing. + */ +interface ASPxClientPopupWindowCancelEventHandler { + /** + * A method that will handle the popup window's cancelable client events. + * @param source An object representing the event's source. Identifies the popup window object that raised the event. + * @param e An ASPxClientPopupWindowCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientPopupWindowCancelEventArgs): void; +} +/** + * Provides data for the popup control's cancellable client events, such as the Closing. + */ +interface ASPxClientPopupWindowCancelEventArgs extends ASPxClientCancelEventArgs { + /** + * Gets the popup window object related to the event. + * Value: An ASPxClientPopupWindow object representing the popup window that was manipulated, causing the popup control to raise the event. + */ + window: ASPxClientPopupWindow; + /** + * Gets the value that identifies the reason the popup window is about to close. + * Value: One of the ASPxClientPopupControlCloseReason enumeration values. + */ + closeReason: ASPxClientPopupControlCloseReason; +} +/** + * A method that will handle the CloseUp event. + */ +interface ASPxClientPopupWindowCloseUpEventHandler { + /** + * A method that will handle the CloseUp event. + * @param source The event source. + * @param e An ASPxClientPopupWindowCloseUpEventArgs object that contains event data. + */ + (source: S, e: ASPxClientPopupWindowCloseUpEventArgs): void; +} +/** + * Provides data for the CloseUp event. + */ +interface ASPxClientPopupWindowCloseUpEventArgs extends ASPxClientPopupWindowEventArgs { + /** + * Gets the value that identifies the reason the popup window closes. + * Value: One of the ASPxClientPopupControlCloseReason enumeration values. + */ + closeReason: ASPxClientPopupControlCloseReason; +} +/** + * A method that will handle the Resize event. + */ +interface ASPxClientPopupWindowResizeEventHandler { + /** + * A method that will handle the Resize event. + * @param source The event source. + * @param e A ASPxClientPopupWindowResizeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientPopupWindowResizeEventArgs): void; +} +/** + * Provides data for the Resize event. + */ +interface ASPxClientPopupWindowResizeEventArgs extends ASPxClientPopupWindowEventArgs { + /** + * Returns the value indicating the window state after resizing. + * Value: The integer value indicating the window resize state. + */ + resizeState: number; +} +/** + * A method that will handle the PinnedChanged event. + */ +interface ASPxClientPopupWindowPinnedChangedEventHandler { + /** + * A method that will handle the PinnedChanged event. + * @param source The event source. + * @param e A ASPxClientPopupWindowPinnedChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientPopupWindowPinnedChangedEventArgs): void; +} +/** + * Provides data for the PinnedChanged event. + */ +interface ASPxClientPopupWindowPinnedChangedEventArgs extends ASPxClientPopupWindowEventArgs { + /** + * Gets a value indicating whether the processed popup window has been pinned. + * Value: true, if the window has been pinned; otherwise, false. + */ + pinned: boolean; +} +/** + * Represents a client collection that maintains client popup control objects. + */ +interface ASPxClientPopupControlCollection extends ASPxClientControlCollection { + /** + * Hides all popup windows maintained by the collection. + */ + HideAllWindows(): void; +} +/** + * Declares client constants that identify the reason the popup window closes. + */ +interface ASPxClientPopupControlCloseReason { +} +/** + * Represents a client-side equivalent of the ASPxPopupMenu object. + */ +interface ASPxClientPopupMenu extends ASPxClientMenuBase { + /** + * Sets the ID of a web control or HTML element (or a list of IDs) with which the current popup menu is associated. + * @param popupElementId A string value specifying the ID (or a list of IDs) of the web control or HTML element with which the popup menu is associated. + */ + SetPopupElementID(popupElementId: string): void; + /** + * Returns an index of the object that invoked the popup menu within the PopupElementID list. + */ + GetCurrentPopupElementIndex(): number; + /** + * Returns an object that invoked the popup menu. + */ + GetCurrentPopupElement(): Object; + /** + * Refreshes the connection between the ASPxPopupMenu and the popup element. + */ + RefreshPopupElementConnection(): void; + /** + * Hides the popup menu. + */ + Hide(): void; + /** + * Invokes the popup menu. + */ + Show(): void; + /** + * Invokes the popup menu at the popup element with the specified index. + * @param popupElementIndex An integer value specifying the zero-based index of the popup element. + */ + Show(popupElementIndex: number): void; + /** + * Invokes the popup menu and displays it over the specified HTML element. + * @param htmlElement An object specifying the HTML element relative to which position the popup menu is invoked. + */ + ShowAtElement(htmlElement: Object): void; + /** + * Invokes the popup menu and displays it over an HTML element specified by its unique identifier. + * @param id A string value that specifies the hierarchically qualified identifier of an HTML element relative to which position the popup menu is invoked. + */ + ShowAtElementByID(id: string): void; + /** + * Invokes the popup menu at the specified position. + * @param x An integer value specifying the x-coordinate of the popup menu's display position. + * @param y An integer value specifying the y-coordinate of the popup menu's display position. + */ + ShowAtPos(x: number, y: number): void; +} +/** + * Represents the client-side equivalent of the ASPxRatingControl control. + */ +interface ASPxClientRatingControl extends ASPxClientControl { + /** + * Fires on the server after an item has been clicked. + */ + ItemClick: ASPxClientEvent>; + /** + * Occurs on the client side when the mouse cursor is moved into a rating control item. + */ + ItemMouseOver: ASPxClientEvent>; + /** + * Occurs on the client side when the mouse cursor moves outside a rating control item. + */ + ItemMouseOut: ASPxClientEvent>; + /** + * Gets the item tooltip title specified by the item index. + * @param index An integer value specifying the item index. + */ + GetTitle(index: number): string; + /** + * Returns a value indicating whether the control's status is read-only. + */ + GetReadOnly(): boolean; + /** + * Specifies whether the control's status is read-only. + * @param value true to make the control read-only; otherwise, false. + */ + SetReadOnly(value: boolean): void; + /** + * Returns the value of the ASPxRatingControl. + */ + GetValue(): number; + /** + * Modifies the value of the ASPxRatingControl on the client side. + * @param value A decimal value representing the value of the control. + */ + SetValue(value: number): void; +} +/** + * A method that will handle the client ItemClick event. + */ +interface ASPxClientRatingControlItemClickEventHandler { + /** + * A method that will handle the client ItemClick event. + * @param source An object representing the event source. + * @param e A ASPxClientRatingControlItemClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRatingControlItemClickEventArgs): void; +} +/** + * Provides data for the ItemClick event. + */ +interface ASPxClientRatingControlItemClickEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the index of the item related to the event. + * Value: An integer value that represents the clicked item's index. + */ + index: number; +} +/** + * A method that will handle the rating control's ItemMouseOver and ItemMouseOut client events (such as ItemMouseOut). + */ +interface ASPxClientRatingControlItemMouseEventHandler { + /** + * A method that will handle the ItemMouseOver events. + * @param source The event source. + * @param e An ASPxClientRatingControlItemMouseEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRatingControlItemMouseEventArgs): void; +} +/** + * Provides data for the rating control's ItemMouseOver and ItemMouseOut client events (such as ItemMouseOut). + */ +interface ASPxClientRatingControlItemMouseEventArgs extends ASPxClientEventArgs { + /** + * Gets the index of the item related to the event. + * Value: An integer value that represents the related item's index. + */ + index: number; +} +/** + * Represents the client-side equivalent of the ASPxRibbon control. + */ +interface ASPxClientRibbon extends ASPxClientControl { + /** + * Occurs after an end-user executes an action on a ribbon item. + */ + CommandExecuted: ASPxClientEvent>; + /** + * Fires on the client side after the active tab has been changed within a ribbon control. + */ + ActiveTabChanged: ASPxClientEvent>; + /** + * Occurs on the client side when the ribbon minimization state is changed by end-user actions. + */ + MinimizationStateChanged: ASPxClientEvent>; + /** + * Occurs when the file tab is clicked. + */ + FileTabClicked: ASPxClientEvent>; + /** + * Fires on the client side after a dialog box launcher has been clicked. + */ + DialogBoxLauncherClicked: ASPxClientEvent>; + /** + * Fires after key tips are closed by pressing Esc. + */ + KeyTipsClosedOnEscape: ASPxClientEvent>; + /** + * Specifies whether the ribbon control is enabled. + * @param enabled true to enable the ribbon; false to disable it. + */ + SetEnabled(enabled: boolean): void; + /** + * Returns a value indicating whether the ribbon is enabled. + */ + GetEnabled(): boolean; + /** + * Returns a tab specified by its index. + * @param index An integer value specifying the zero-based index of the tab object to retrieve. + */ + GetTab(index: number): ASPxClientRibbonTab; + /** + * Returns a tab specified by its name. + * @param name A string value specifying the name of the tab. + */ + GetTabByName(name: string): ASPxClientRibbonTab; + /** + * Returns the number of tabs in the ribbon Tabs collection. + */ + GetTabCount(): number; + /** + * Returns the active tab within the ribbon control. + */ + GetActiveTab(): ASPxClientRibbonTab; + /** + * Makes the specified tab active in the ribbon control on the client side. + * @param tab A ASPxClientRibbonTab object specifying the tab selection. + */ + SetActiveTab(tab: ASPxClientRibbonTab): void; + /** + * Makes a tab active within the ribbon control, specifying the tab's index. + * @param index An integer value specifying the index of the tab to select. + */ + SetActiveTabIndex(index: number): void; + /** + * Returns a ribbon item specified by its name. + * @param name A string value specifying the name of the item. + */ + GetItemByName(name: string): ASPxClientRibbonItem; + /** + * Returns a value of item with the specified name. + * @param name A string value specifying the name of the item. + */ + GetItemValueByName(name: string): Object; + /** + * Sets the value of the item with the specified name. + * @param name A string value specifying the name of the item. + * @param value An object that is the new item value. + */ + SetItemValueByName(name: string, value: Object): void; + /** + * Specifies whether the ribbon is minimized. + * @param minimized true to set the ribbon state to minimized; false to set the ribbon state to normal. + */ + SetMinimized(minimized: boolean): void; + /** + * Gets a value specifying whether the ribbon is minimized. + */ + GetMinimized(): boolean; + /** + * Specifies the visibility of a context tab category specified by its name. + * @param categoryName A Name property value of the required category. + * @param visible true to make a category visible; false to make it hidden. + */ + SetContextTabCategoryVisible(categoryName: string, visible: boolean): void; + /** + * Shows ribbon key tips. + */ + ShowKeyTips(): void; +} +/** + * A client-side equivalent of the ribbon's RibbonTab object. + */ +interface ASPxClientRibbonTab { + /** + * Gets the client ribbon object to which the current tab belongs. + * Value: An object to which the tab belongs. + */ + ribbon: ASPxClientRibbon; + /** + * Gets or sets the tab's index within the collection. + * Value: An integer value that is the zero-based index of the tab within the collection. + */ + index: number; + /** + * Gets the name of the current ribbon tab. + * Value: A string value that is the tab's name. + */ + name: string; + /** + * Returns the text displayed in the tab. + */ + GetText(): string; + /** + * Sets a value specifying whether the tab is enabled. + * @param enabled true to enable the tab; false to disable it. + */ + SetEnabled(enabled: boolean): void; + /** + * Returns a value indicating whether a ribbon tab is enabled. + */ + GetEnabled(): boolean; + /** + * Returns a value specifying whether a ribbon tab is displayed. + */ + GetVisible(): boolean; +} +/** + * A client-side equivalent of the ribbon's RibbonGroup object. + */ +interface ASPxClientRibbonGroup { + /** + * Gets the client ribbon object to which the current group belongs. + * Value: An object to which the group belongs. + */ + ribbon: ASPxClientRibbon; + /** + * Gets the client tab object to which the current group belongs. + * Value: An object to which the group belongs. + */ + tab: ASPxClientRibbonTab; + /** + * Gets or sets the group's index within the collection. + * Value: An integer value that is the zero-based index of the group within the collection. + */ + index: number; + /** + * Gets the name of the current ribbon group. + * Value: A string value that is the group's name. + */ + name: string; + /** + * Returns a value specifying whether a ribbon group is displayed. + */ + GetVisible(): boolean; +} +/** + * A client-side equivalent of the ribbon's RibbonItemBase object. + */ +interface ASPxClientRibbonItem { + /** + * Gets the client group object to which the current item belongs. + * Value: An object to which the item belongs. + */ + group: ASPxClientRibbonGroup; + /** + * Gets or sets the item's index within the collection. + * Value: An integer value that is the zero-based index of the item within the collection. + */ + index: number; + /** + * Gets the name of the current ribbon item. + * Value: A string value that is the item's name. + */ + name: string; + /** + * Gets the client ribbon object to which the current item belongs. + * Value: An object to which the item belongs. + */ + ribbon: ASPxClientRibbon; + /** + * Returns a value indicating whether a ribbon item is enabled. + */ + GetEnabled(): boolean; + /** + * Sets a value specifying whether the item is enabled. + * @param enabled true to enable the item; false to disable it. + */ + SetEnabled(enabled: boolean): void; + /** + * Returns the item value. + */ + GetValue(): Object; + /** + * Sets the item value. + * @param value An that specifies the item value. + */ + SetValue(value: Object): void; + /** + * Returns a value specifying whether a ribbon item is displayed. + */ + GetVisible(): boolean; +} +/** + * A method that will handle the CommandExecuted event. + */ +interface ASPxClientRibbonCommandExecutedEventHandler { + /** + * A method that will handle the CommandExecuted event. + * @param source The event source. Identifies the ASPxRibbon control that raised the event. + * @param e An ASPxClientRibbonCommandExecutedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRibbonCommandExecutedEventArgs): void; +} +/** + * Provides data for the CommandExecuted event. + */ +interface ASPxClientRibbonCommandExecutedEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets an item object related to the event. + * Value: An object, manipulations on which forced the event to be raised. + */ + item: ASPxClientRibbonItem; + /** + * Gets an optional parameter that complements the processed command. + * Value: A string value containing additional information about the processed command. + */ + parameter: string; +} +/** + * A method that will handle the ActiveTabChanged event. + */ +interface ASPxClientRibbonTabEventHandler { + /** + * A method that will handle the ActiveTabChanged event. + * @param source The event source. Identifies the ASPxRibbon control that raised the event. + * @param e A ASPxClientRibbonTabEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRibbonTabEventArgs): void; +} +/** + * Provides data for the ActiveTabChanged event. + */ +interface ASPxClientRibbonTabEventArgs extends ASPxClientEventArgs { + /** + * Gets the tab object related to the event. + * Value: An object that is the tab, manipulations on which forced the ribbon control to raise the event. + */ + tab: ASPxClientRibbonTab; +} +/** + * A method that will handle the MinimizationStateChanged event. + */ +interface ASPxClientRibbonMinimizationStateEventHandler { + /** + * A method that will handle the MinimizationStateChanged event. + * @param source The event source. Identifies the ASPxRibbon control that raised the event. + * @param e An ASPxClientRibbonMinimizationStateEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRibbonMinimizationStateEventArgs): void; +} +/** + * Provides data for the MinimizationStateChanged event. + */ +interface ASPxClientRibbonMinimizationStateEventArgs extends ASPxClientEventArgs { + /** + * Returns the value indicating the new ribbon state. + * Value: The integer value indicating the ribbon minimization state. + */ + ribbonState: number; +} +/** + * A method that will handle the DialogBoxLauncherClicked event. + */ +interface ASPxClientRibbonDialogBoxLauncherClickedEventHandler { + /** + * A method that will handle the DialogBoxLauncherClicked event. + * @param source The event source. This parameter identifies the ribbon object which raised the event. + * @param e An ASPxClientRibbonDialogBoxLauncherClickedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientRibbonDialogBoxLauncherClickedEventArgs): void; +} +/** + * Provides data for the DialogBoxLauncherClicked event. + */ +interface ASPxClientRibbonDialogBoxLauncherClickedEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the client group object to which the clicked dialog box launcher belongs. + * Value: An object to which the dialog box launcher belongs. + */ + group: ASPxClientRibbonGroup; +} +/** + * Represents a client-side equivalent of the ASPxRoundPanel control. + */ +interface ASPxClientRoundPanel extends ASPxClientPanelBase { + /** + * Fires on the client side after a panel has been expanded or collapsed via end-user interactions, i.e., by clicking a panel header or collapse button. + */ + CollapsedChanged: ASPxClientEvent>; + /** + * Fires on the client side before a panel is expanded or collapsed by end-user interactions, i.e., by clicking a panel header or collapse button. + */ + CollapsedChanging: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientRoundPanel. + */ + CallbackError: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side ContentCallback event, passing it the specified argument. + * @param parameter A string value that is any information that needs to be sent to the server-side ContentCallback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side ContentCallback event, passing it the specified argument. + * @param parameter A string value that is any information that needs to be sent to the server-side ContentCallback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; + /** + * Returns the text displayed within the panel's header. + */ + GetHeaderText(): string; + /** + * Specifies the text displayed in the panel's header. + * @param text A string value that specifies the panel header's text. + */ + SetHeaderText(text: string): void; + /** + * Returns a value indicating whether the panel is collapsed. + */ + GetCollapsed(): boolean; + /** + * Sets a value indicating whether the panel is collapsed. + * @param collapsed true, to collapse the panel; otherwise, false. + */ + SetCollapsed(collapsed: boolean): void; +} +/** + * Represents a client-side equivalent of the ASPxSplitter object. + */ +interface ASPxClientSplitter extends ASPxClientControl { + /** + * Fires before a pane is resized. + */ + PaneResizing: ASPxClientEvent>; + /** + * Fires after a pane has been resized. + */ + PaneResized: ASPxClientEvent>; + /** + * Fires before a pane is collapsed. + */ + PaneCollapsing: ASPxClientEvent>; + /** + * Fires after a pane has been collapsed. + */ + PaneCollapsed: ASPxClientEvent>; + /** + * Fires before a pane is expanded. + */ + PaneExpanding: ASPxClientEvent>; + /** + * Fires after a pane has been expanded. + */ + PaneExpanded: ASPxClientEvent>; + /** + * Occurs when a pane resize operation has been completed. + */ + PaneResizeCompleted: ASPxClientEvent>; + /** + * Fires after a specific web page has been loaded into a pane. + */ + PaneContentUrlLoaded: ASPxClientEvent>; + /** + * Returns the number of panes at the root level of a splitter. + */ + GetPaneCount(): number; + /** + * Returns the splitter's root pane specified by its index within the Panes collection. + * @param index An integer value specifying the zero-based index of the root pane to be retrieved. + */ + GetPane(index: number): ASPxClientSplitterPane; + /** + * Returns a pane specified by its name. + * @param name A string value specifying the name of the pane. + */ + GetPaneByName(name: string): ASPxClientSplitterPane; + /** + * Specifies whether the control's panes can be resized by end-users on the client side. + * @param allowResize true if pane resizing is allowed; otherwise, false. + */ + SetAllowResize(allowResize: boolean): void; + /** + * Returns a string value that represents the client state of splitter panes. + */ + GetLayoutData(): string; +} +/** + * Represents a client-side equivalent of the splitter's SplitterPane object. + */ +interface ASPxClientSplitterPane { + /** + * Gets the index of the current pane within the pane collection to which it belongs. + * Value: An integer value representing the zero-based index of the current pane within the SplitterPaneCollection collection. + */ + index: number; + /** + * Gets the name that uniquely identifies the current splitter pane. + * Value: A string value that represents the value assigned to the pane's Name property. + */ + name: string; + /** + * Returns a client splitter object that contains the current pane. + */ + GetSplitter(): ASPxClientSplitter; + /** + * Returns the immediate parent of the current pane. + */ + GetParentPane(): ASPxClientSplitterPane; + /** + * Returns the previous sibling pane of the current pane. + */ + GetPrevPane(): ASPxClientSplitterPane; + /** + * Returns the next sibling pane of the current pane. + */ + GetNextPane(): ASPxClientSplitterPane; + /** + * Determines whether the current pane is the first pane within the SplitterPaneCollection. + */ + IsFirstPane(): boolean; + /** + * Determines whether the current pane is the last pane within the SplitterPaneCollection. + */ + IsLastPane(): boolean; + /** + * Returns a value that indicates the orientation in which the current pane and its sibling panes are stacked. + */ + IsVertical(): boolean; + /** + * Returns the number of the current pane's immediate child panes. + */ + GetPaneCount(): number; + /** + * Returns the current pane's immediate child pane specified by its index. + * @param index An integer value specifying the zero-based index of the child pane to be retrieved. + */ + GetPane(index: number): ASPxClientSplitterPane; + /** + * Returns the current pane's child pane specified by its name. + * @param name A string value specifying the name of the pane. + */ + GetPaneByName(name: string): ASPxClientSplitterPane; + /** + * Gets the width of the pane's content area. + */ + GetClientWidth(): number; + /** + * Gets the height of the pane's content area. + */ + GetClientHeight(): number; + /** + * Collapses the current pane and occupies its space by maximizing the specified pane. + * @param maximizedPane A ASPxClientSplitterPane object specifying the pane to be maximized to occupy the freed space. + */ + Collapse(maximizedPane: ASPxClientSplitterPane): boolean; + /** + * Collapses the current pane in a forward direction and occupies its space by maximizing the previous adjacent pane. + */ + CollapseForward(): boolean; + /** + * Collapses the current pane in a backward direction, and occupies its space by maximizing the next adjacent pane. + */ + CollapseBackward(): boolean; + /** + * Expands the current pane object on the client side. + */ + Expand(): boolean; + /** + * Returns whether the pane is collapsed. + */ + IsCollapsed(): boolean; + /** + * Returns whether the pane's content is loaded from an external web page. + */ + IsContentUrlPane(): boolean; + /** + * Gets the URL of a web page displayed as a pane's content. + */ + GetContentUrl(): string; + /** + * Sets the URL to point to a web page that should be loaded into, and displayed within the current pane. + * @param url A string value specifying the URL to a web page displayed within the pane. + */ + SetContentUrl(url: string): void; + /** + * Sets the URL to point to a web page that should be loaded into, and displayed within the current pane, but should not be cached by a client browser. + * @param url A string value specifying the URL to a web page displayed within the pane. + * @param preventBrowserCaching true to prevent the browser to cache the loaded content; false to allow browser caching. + */ + SetContentUrl(url: string, preventBrowserCaching: boolean): void; + /** + * Refreshes the content of the web page displayed within the current pane. + */ + RefreshContentUrl(): void; + /** + * Returns an iframe object containing a web page specified via the pane's SetContentUrl client method). + */ + GetContentIFrame(): Object; + /** + * Specifies whether the current pane can be resized by end-users on the client side. + * @param allowResize true if pane resizing is allowed; otherwise, false. + */ + SetAllowResize(allowResize: boolean): void; + /** + * Forces the client PaneResized event to be generated. + */ + RaiseResizedEvent(): void; + /** + * Returns an HTML element representing a splitter pane object. + */ + GetElement(): Object; + /** + * Specifies the splitter pane's size in pixels. + * @param size An integer value that specifies the splitter pane's size. + */ + SetSize(size: number): void; + /** + * Specifies the splitter pane's size, in pixels or percents. + * @param size A string value that specifies the splitter pane's size, in pixels or percents. + */ + SetSize(size: string): void; + /** + * Returns the splitter pane's size, in pixels or percents. + */ + GetSize(): string; + /** + * Returns the distance between the top edge of the pane content and the topmost portion of the content currently visible in the pane. + */ + GetScrollTop(): number; + /** + * Specifies the distance between the top edge of the pane content and the topmost portion of the content currently visible in the pane. + * @param value An integer value that is the distance (in pixels). + */ + SetScrollTop(value: number): void; + /** + * Returns the distance between the left edge of the pane content and the leftmost portion of the content currently visible in the pane. + */ + GetScrollLeft(): number; + /** + * Specifies the distance between the left edge of the pane content and the leftmost portion of the content currently visible in the pane. + * @param value An integer value that is the distance (in pixels). + */ + SetScrollLeft(value: number): void; +} +/** + * A method that will handle the splitter's client events concerning manipulations with a pane. + */ +interface ASPxClientSplitterPaneEventHandler { + /** + * A method that will handle the splitter's client events concerning pane manipulations. + * @param source An object representing the event's source. Identifies the splitter object that raised the event. + * @param e An ASPxClientSplitterPaneEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSplitterPaneEventArgs): void; +} +/** + * A method that will handle the splitter's client events concerning manipulations with a pane. + */ +interface ASPxClientSplitterPaneEventArgs extends ASPxClientEventArgs { + /** + * Gets the pane object related to the event. + * Value: An ASPxClientSplitterPane object, manipulations on which forced the event to be raised. + */ + pane: ASPxClientSplitterPane; +} +/** + * A method that will handle a splitter control's cancelable client events concerning manipulations with a pane. + */ +interface ASPxClientSplitterPaneCancelEventHandler { + /** + * A method that will handle a splitter control's cancelable client events concerning pane manipulations. + * @param source An object representing the event's source. Identifies the splitter control object that raised the event. + * @param e An ASPxClientSplitterPaneCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientSplitterPaneCancelEventArgs): void; +} +/** + * Provides data for a splitter control's cancelable client events concerning manipulations with a pane. + */ +interface ASPxClientSplitterPaneCancelEventArgs extends ASPxClientSplitterPaneEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * Represents a base for the ASPxClientPageControl objects. + */ +interface ASPxClientTabControlBase extends ASPxClientControl { + /** + * Fires when a tab is clicked. + */ + TabClick: ASPxClientEvent>; + /** + * Fires on the client side after the active tab has been changed within a tab control. + */ + ActiveTabChanged: ASPxClientEvent>; + /** + * Fires on the client side before the active tab is changed within a tab control. + */ + ActiveTabChanging: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by a client tab control. + */ + CallbackError: ASPxClientEvent>; + /** + * Modifies a tab page's size in accordance with the content. + */ + AdjustSize(): void; + /** + * Returns the active tab within the tab control. + */ + GetActiveTab(): ASPxClientTab; + /** + * Makes the specified tab active within the tab control on the client side. + * @param tab An ASPxClientTab object specifying the tab to select. + */ + SetActiveTab(tab: ASPxClientTab): void; + /** + * Returns the index of the active tab within the tab control. + */ + GetActiveTabIndex(): number; + /** + * Makes a tab active within the tab control, specifying the tab's index. + * @param index An integer value specifying the index of the tab to select. + */ + SetActiveTabIndex(index: number): void; + /** + * Returns the number of tabs in the ASPxTabControl. + */ + GetTabCount(): number; + /** + * Returns a tab specified by its index. + * @param index An integer value specifying the zero-based index of the tab object to retrieve. + */ + GetTab(index: number): ASPxClientTab; + /** + * Returns a tab specified by its name. + * @param name A string value specifying the name of the tab. + */ + GetTabByName(name: string): ASPxClientTab; +} +/** + * Represents a client-side equivalent of the ASPxTabControl object. + */ +interface ASPxClientTabControl extends ASPxClientTabControlBase { +} +/** + * Represents a client-side equivalent of the ASPxPageControl object. + */ +interface ASPxClientPageControl extends ASPxClientTabControlBase { + /** + * Returns the HTML code that represents the contents of the specified page within the page control. + * @param tab An ASPxClientTab object that specifies the required page. + */ + GetTabContentHTML(tab: ASPxClientTab): string; + /** + * Defines the HTML content for a specific tab page within the page control. + * @param tab An ASPxClientTab object that specifies the required tab page. + * @param html A string value that represents the HTML code defining the content of the specified page. + */ + SetTabContentHTML(tab: ASPxClientTab, html: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + */ + PerformCallback(parameter: string): void; + /** + * Sends a callback to the server and generates the server-side Callback event, passing it the specified argument. + * @param parameter A string value that represents any information that needs to be sent to the server-side Callback event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(parameter: string, onSuccess: (arg1: string) => void): void; +} +/** + * Represents a client-side equivalent of a tab control's TabPage object. + */ +interface ASPxClientTab { + /** + * Gets the tab control to which the current tab belongs. + * Value: An ASPxClientTabControlBase object representing the control to which the tab belongs. + */ + tabControl: ASPxClientTabControlBase; + /** + * Gets the index of the current tab (tabbed page) within the control's collection of tabs (tabbed pages). + * Value: An integer value representing the zero-based index of the current tab (tabbed page) within the TabPages) collection of the control to which the tab belongs. + */ + index: number; + /** + * Gets the name that uniquely identifies the current tab. + * Value: A string value that represents the value assigned to the tab's Name property. + */ + name: string; + /** + * Returns a value specifying whether a tab is enabled. + */ + GetEnabled(): boolean; + /** + * Specifies whether the tab is enabled. + * @param value true to enable the tab; otherwise, false. + */ + SetEnabled(value: boolean): void; + /** + * Returns the URL pointing to the image displayed within the tab. + */ + GetImageUrl(): string; + /** + * Specifies the URL which points to the image displayed within the tab. + * @param value A string value that is the URL to the image displayed within the tab. + */ + SetImageUrl(value: string): void; + /** + * Returns the URL pointing to the image displayed within the active tab. + */ + GetActiveImageUrl(): string; + /** + * Specifies the URL which points to the image displayed within the active tab. + * @param value A string value that is the URL to the image displayed within the active tab. + */ + SetActiveImageUrl(value: string): void; + /** + * Gets an URL which defines the navigation location for the tab. + */ + GetNavigateUrl(): string; + /** + * Specifies a URL which defines the navigation location for the tab. + * @param value A string value which is a URL to where the client web browser will navigate when the tab is clicked. + */ + SetNavigateUrl(value: string): void; + /** + * Returns text displayed within the tab. + */ + GetText(): string; + /** + * Specifies the text displayed within the tab. + * @param value A string value that is the text displayed within the tab. + */ + SetText(value: string): void; + /** + * Returns a value specifying whether a tab is displayed. + */ + GetVisible(): boolean; + /** + * Specifies whether the tab is visible. + * @param value true is the tab is visible; otherwise, false. + */ + SetVisible(value: boolean): void; +} +/** + * A method that will handle a tab control's client events concerning manipulations with a tab. + */ +interface ASPxClientTabControlTabEventHandler { + /** + * A method that will handle a tab control's client events concerning manipulations with a tab. + * @param source An object representing the event's source. Identifies the tab control object that raised the event. + * @param e An ASPxClientTabControlTabEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTabControlTabEventArgs): void; +} +/** + * Provides data for events which concern manipulations on tabs. + */ +interface ASPxClientTabControlTabEventArgs extends ASPxClientEventArgs { + /** + * Gets the tab object related to the event. + * Value: An ASPxClientTab object, manipulations on which forced the event to be raised. + */ + tab: ASPxClientTab; +} +/** + * A method that will handle a tab control's cancelable client events concerning manipulations with a tab. + */ +interface ASPxClientTabControlTabCancelEventHandler { + /** + * A method that will handle a tab control's cancelable client events concerning manipulations with a tab. + * @param source An object representing the event's source. Identifies the tab control object that raised the event. + * @param e An ASPxClientTabControlTabCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTabControlTabCancelEventArgs): void; +} +/** + * Provides data for cancellable events which concern manipulations on tabs. + */ +interface ASPxClientTabControlTabCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets the tab object related to the event. + * Value: An ASPxClientTab object representing the tab manipulations on which forced the tab control to raise the event. + */ + tab: ASPxClientTab; + /** + * Gets or sets a value specifying whether a callback should be sent to the server to reload the content of the page being activated. + * Value: true to reload the page's content; otherwise, false. + */ + reloadContentOnCallback: boolean; +} +/** + * A method that will handle client events concerning clicks on the control's tabs. + */ +interface ASPxClientTabControlTabClickEventHandler { + /** + * A method that will handle client events concerning clicks on tabs. + * @param source The event source. This parameter identifies the tab control object which raised the event. + * @param e An ASPxClientTabControlTabClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTabControlTabClickEventArgs): void; +} +/** + * Provides data for events which concern clicking on the control's tabs. + */ +interface ASPxClientTabControlTabClickEventArgs extends ASPxClientTabControlTabCancelEventArgs { + /** + * Gets the HTML object that contains the processed tab. + * Value: An object representing a container for the tab related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * Represents a client-side equivalent of the ASPxTimer object. + */ +interface ASPxClientTimer extends ASPxClientControl { + /** + * Fires on the client side when the specified timer interval has elapsed, and the timer is enabled. + */ + Tick: ASPxClientEvent>; + /** + * Returns a value indicating whether the timer is enabled. + */ + GetEnabled(): boolean; + /** + * Enables the timer. + * @param enabled true to turn the timer on; false, to turn the timer off. + */ + SetEnabled(enabled: boolean): void; + /** + * Gets the time before the Tick event. + */ + GetInterval(): number; + /** + * Specifies the time before the Tick event. + * @param interval An integer value that specifies the number of milliseconds before the Tick event is raised relative to the last occurrence of the Tick event. The value cannot be less than one. + */ + SetInterval(interval: number): void; +} +/** + * Represents a client-side equivalent of the ASPxTitleIndex object. + */ +interface ASPxClientTitleIndex extends ASPxClientControl { + /** + * Fires after an item has been clicked. + */ + ItemClick: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientTitleIndex. + */ + CallbackError: ASPxClientEvent>; +} +/** + * A method that will handle client events concerning manipulations with an item. + */ +interface ASPxClientTitleIndexItemEventHandler { + /** + * A method that will handle the title index control's client events concerning manipulations with an item. + * @param source An object representing the event's source. Identifies the title index control object that raised the event. + * @param e An ASPxClientTitleIndexItemEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTitleIndexItemEventArgs): void; +} +/** + * Provides data for events which concern manipulations on the control's items. + */ +interface ASPxClientTitleIndexItemEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the name that uniquely identifies the processed item. + * Value: A string value that represents the value assigned to the processed item's Name property. + */ + name: Object; + /** + * Gets the HTML object that contains the processed item. + * Value: An object representing a container for the item related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * Represents a client-side equivalent of the ASPxTreeView object. + */ +interface ASPxClientTreeView extends ASPxClientControl { + /** + * Fires on the client side after a node has been clicked. + */ + NodeClick: ASPxClientEvent>; + /** + * Fires on the client side after a node's expansion state has been changed by end-user interaction. + */ + ExpandedChanged: ASPxClientEvent>; + /** + * Fires on the client side before the expansion state of a node is changed via end-user interaction. + */ + ExpandedChanging: ASPxClientEvent>; + /** + * Occurs on the client side when the node's checked state is changed by clicking on a check box. + */ + CheckedChanged: ASPxClientEvent>; + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientTreeView. + */ + CallbackError: ASPxClientEvent>; + /** + * Returns a node specified by its index within the ASPxTreeView's node collection. + * @param index An integer value specifying the zero-based index of the node to be retrieved. + */ + GetNode(index: number): ASPxClientTreeViewNode; + /** + * Returns a node specified by its name. + * @param name A string value specifying the name of the node. + */ + GetNodeByName(name: string): ASPxClientTreeViewNode; + /** + * Returns a node specified by its text. + * @param text A string value specifying the text content of the node. + */ + GetNodeByText(text: string): ASPxClientTreeViewNode; + /** + * Returns the number of nodes at the ASPxTreeView's zero level. + */ + GetNodeCount(): number; + /** + * Returns the selected node within the ASPxTreeView control on the client side. + */ + GetSelectedNode(): ASPxClientTreeViewNode; + /** + * Selects the specified node within the ASPxTreeView control on the client side. + * @param node An ASPxClientTreeViewNode object specifying the node to select. + */ + SetSelectedNode(node: ASPxClientTreeViewNode): void; + /** + * Gets the root node of the ASPxTreeView object. + */ + GetRootNode(): ASPxClientTreeViewNode; + /** + * Collapses all nodes in the ASPxTreeView on the client side. + */ + CollapseAll(): void; + /** + * Expands all nodes in the ASPxTreeView on the client side. + */ + ExpandAll(): void; +} +/** + * Represents a client-side equivalent of the ASPxTreeView's TreeViewNode object. + */ +interface ASPxClientTreeViewNode { + /** + * Gets the client representation of the ASPxTreeView control to which the current node belongs. + * Value: An ASPxClientTreeView object representing the control to which the node belongs. + */ + treeView: ASPxClientTreeView; + /** + * Gets the current node's parent node. + * Value: An ASPxClientTreeViewNode object representing the node's immediate parent. + */ + parent: ASPxClientTreeViewNode; + /** + * Gets the node's index within the parent's collection of nodes. + * Value: An integer value representing the node's zero-based index within the Nodes collection of the node to which the node belongs. + */ + index: number; + /** + * Gets the name that uniquely identifies the node. + * Value: A string value that represents the value assigned to the node's Name property. + */ + name: string; + /** + * Returns the number of the current node's immediate child nodes. + */ + GetNodeCount(): number; + /** + * Returns the current node's immediate child node specified by its index. + * @param index An integer value specifying the zero-based index of the node to be retrieved. + */ + GetNode(index: number): ASPxClientTreeViewNode; + /** + * Returns the current node's child node specified by its name. + * @param name A string value specifying the name of the node. + */ + GetNodeByName(name: string): ASPxClientTreeViewNode; + /** + * Returns the current node's child node specified by its text. + * @param text A string value specifying the text content of the node. + */ + GetNodeByText(text: string): ASPxClientTreeViewNode; + /** + * Returns a value indicating whether the node is expanded. + */ + GetExpanded(): boolean; + /** + * Sets a value which specifies the node's expansion state. + * @param value true if the node is expanded; otherwise, false. + */ + SetExpanded(value: boolean): void; + /** + * Returns a value indicating whether the node is checked. + */ + GetChecked(): boolean; + /** + * Sets a value indicating whether the node is checked. + * @param value true if the node is checked; otherwise, false. + */ + SetChecked(value: boolean): void; + /** + * Returns a value which specifies the node's check state. + */ + GetCheckState(): string; + /** + * Returns a value specifying whether the node is enabled. + */ + GetEnabled(): boolean; + /** + * Sets a value specifying whether the node is enabled. + * @param value true to make the node enabled; false to disable it. + */ + SetEnabled(value: boolean): void; + /** + * Returns the URL pointing to the image displayed within the node. + */ + GetImageUrl(): string; + /** + * Sets the URL which points to the image displayed within the node. + * @param value A string value specifying the URL to the image displayed within the node. + */ + SetImageUrl(value: string): void; + /** + * Gets an URL which defines the navigation location for the node's hyperlink. + */ + GetNavigateUrl(): string; + /** + * Specifies a URL which defines the node's navigate URL. + * @param value A string value which specifies a URL to where the client web browser will navigate when the node is clicked. + */ + SetNavigateUrl(value: string): void; + /** + * Gets the text, displayed within the node. + */ + GetText(): string; + /** + * Specifies the text, displayed within the node. + * @param value A string value that represents the text displayed within the node. + */ + SetText(value: string): void; + /** + * Returns a value specifying whether a node is displayed. + */ + GetVisible(): boolean; + /** + * Specifies whether the node is visible. + * @param value true if the node is visible; otherwise, false. + */ + SetVisible(value: boolean): void; + /** + * Gets the HTML object that contains the current node. + */ + GetHtmlElement(): Object; +} +/** + * A method that will handle the client events concerned with node processing. + */ +interface ASPxClientTreeViewNodeProcessingModeEventHandler { + /** + * A method that will handle the client events concerned with node processing. + * @param source An object representing the event source. Identifies the ASPxClientTreeView control that raised the event. + * @param e An ASPxClientTreeViewNodeProcessingModeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeViewNodeProcessingModeEventArgs): void; +} +/** + * Provides data for the client events concerned with node processing, and that allow the event's processing to be passed to the server side. + */ +interface ASPxClientTreeViewNodeProcessingModeEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets a node object related to the event. + * Value: An ASPxClientTreeViewNode object, manipulations on which forced the event to be raised. + */ + node: ASPxClientTreeViewNode; +} +/** + * A method that will handle the ASPxClientTreeView.ItemClick event. + */ +interface ASPxClientTreeViewNodeClickEventHandler { + /** + * A method that will handle the NodeClick event. + * @param source The ASPxClientTreeView control which fires the event. + * @param e An ASPxClientTreeViewNodeClickEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeViewNodeClickEventArgs): void; +} +/** + * Provides data for the NodeClick event. + */ +interface ASPxClientTreeViewNodeClickEventArgs extends ASPxClientTreeViewNodeProcessingModeEventArgs { + /** + * Gets the HTML object that contains the processed node. + * Value: An object representing a container for the node related to the event. + */ + htmlElement: Object; + /** + * Gets a DHTML event object that relates to the processed event. + * Value: An object that maintains DHTML event-specific information. + */ + htmlEvent: Object; +} +/** + * A method that will handle the ASPxTreeView control's client events concerning manipulations with a node. + */ +interface ASPxClientTreeViewNodeEventHandler { + /** + * A method that will handle the ASPxTreeView control's client events, concerning manipulations with a node. + * @param source An object representing the event's source. Identifies the ASPxClientTreeView control object that raised the event. + * @param e An ASPxClientTreeViewNodeEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeViewNodeEventArgs): void; +} +/** + * Provides data for the ExpandedChanged events. + */ +interface ASPxClientTreeViewNodeEventArgs extends ASPxClientEventArgs { + /** + * Gets a node object related to the event. + * Value: An ASPxClientTreeViewNode object, manipulations on which forced the event to be raised. + */ + node: ASPxClientTreeViewNode; +} +/** + * A method that will handle the ASPxTreeView's cancelable client events, concerning manipulations with nodes. + */ +interface ASPxClientTreeViewNodeCancelEventHandler { + /** + * A method that will handle the ASPxTreeView's cancelable client events, concerning manipulations with nodes. + * @param source An object representing the event's source. Identifies the ASPxClientTreeView object that raised the event. + * @param e An ASPxClientTreeViewNodeCancelEventArgs object that contains event data. + */ + (source: S, e: ASPxClientTreeViewNodeCancelEventArgs): void; +} +/** + * Provides data for the ExpandedChanging event. + */ +interface ASPxClientTreeViewNodeCancelEventArgs extends ASPxClientProcessingModeCancelEventArgs { + /** + * Gets a node object related to the event. + * Value: An ASPxClientTreeViewNode object, manipulations on which forced the event to be raised. + */ + node: ASPxClientTreeViewNode; +} +/** + * Represents a client-side equivalent of the ASPxUploadControl control. + */ +interface ASPxClientUploadControl extends ASPxClientControl { + /** + * Occurs on the client after a file has been uploaded. + */ + FileUploadComplete: ASPxClientEvent>; + /** + * Occurs on the client after upload of all selected files has been completed. + */ + FilesUploadComplete: ASPxClientEvent>; + /** + * Occurs on the client side before upload of the specified files starts. + */ + FileUploadStart: ASPxClientEvent>; + /** + * Occurs on the client side before file upload is started. + */ + FilesUploadStart: ASPxClientEvent>; + /** + * Fires on the client side when the text within the control's edit box is changed while the control has focus. + */ + TextChanged: ASPxClientEvent>; + /** + * Occurs on the client side when the progress bar indicator position is changed. + */ + UploadingProgressChanged: ASPxClientEvent>; + /** + * Occurs on the client side when the file input elements count is changed. + */ + FileInputCountChanged: ASPxClientEvent>; + /** + * Enables you to specify whether the selected file(s) are valid and provide an error text. + */ + ValidationErrorOccurred: ASPxClientEvent>; + /** + * Fires when the mouse enters a drop zone or an external drop zone element while dragging a file. + */ + DropZoneEnter: ASPxClientEvent>; + /** + * Fires when the mouse leaves a drop zone or an external drop zone element while dragging a file. + */ + DropZoneLeave: ASPxClientEvent>; + /** + * Specifies whether the upload control's Advanced mode is enabled. + */ + IsAdvancedModeEnabled(): boolean; + /** + * Initiates uploading of the specified file to the web server's memory. + */ + UploadFile(): void; + /** + * Adds a new file input element to the ASPxUploadControl. + */ + AddFileInput(): void; + /** + * Removes a file input element from the ASPxUploadControl. + * @param index An integer value that represents a file input element's index. + */ + RemoveFileInput(index: number): void; + /** + * Removes a file with the specified index from the selected file list. + * @param fileIndex An integer value that is the zero-based index of an item in the file list. + */ + RemoveFileFromSelection(fileIndex: number): void; + /** + * Removes the specified file from the list of files selected for uploading in the upload control. + * @param file An ASPxClientUploadControl object that is the file to be removed from the list of files. + */ + RemoveFileFromSelection(file: ASPxClientUploadControlFile): void; + /** + * Returns files selected for uploading within the specified file input. + * @param inputIndex An integer value that specifies the index of a file input. Default value is "0". + */ + GetSelectedFiles(inputIndex: number): ASPxClientUploadControlFile[]; + /** + * Gets the text displayed within the edit box of the specified file input element. + * @param index An integer value that specifies the required file input element's index. + */ + GetText(index: number): string; + /** + * Gets the number of file input elements contained within the ASPxUploadControl. + */ + GetFileInputCount(): number; + /** + * Specifies the count of the file input elements within the upload control. + * @param count An integer value that specifies the file input elements count. + */ + SetFileInputCount(count: number): void; + /** + * Specifies whether the upload control is enabled. + * @param enabled true, to enable the upload control; otherwise, false. + */ + SetEnabled(enabled: boolean): void; + /** + * Returns a value indicating whether the upload control is enabled. + */ + GetEnabled(): boolean; + /** + * Initiates uploading of the specified file(s) to the web server's memory. + */ + Upload(): void; + /** + * Cancels the initiated file uploading process. + */ + Cancel(): void; + /** + * Clears the file selection in the upload control. + */ + ClearText(): void; + /** + * Sets the text to be displayed within the add button. + * @param text A string value specifying the text to be displayed within the button. + */ + SetAddButtonText(text: string): void; + /** + * Sets the text to be displayed within the upload button. + * @param text A string value specifying the text to be displayed within the button. + */ + SetUploadButtonText(text: string): void; + /** + * Returns the text displayed within the add button. + */ + GetAddButtonText(): string; + /** + * Returns the text displayed within the upload button. + */ + GetUploadButtonText(): string; + /** + * Sets the ID of a web control or HTML element (or a list of IDs), a click on which invokes file upload dialog. + * @param ids A string value specifying the ID or a list of IDs separated by the semicolon (;). + */ + SetDialogTriggerID(ids: string): void; +} +/** + * A method that will handle the client FilesUploadStart event. + */ +interface ASPxClientUploadControlFilesUploadStartEventHandler { + /** + * A method that will handle the FilesUploadStart event. + * @param source The event source. Identifies the ASPxUploadControl control that raised the event. + * @param e A ASPxClientUploadControlFilesUploadStartEventArgs object that contains event data. + */ + (source: S, e: ASPxClientUploadControlFilesUploadStartEventArgs): void; +} +/** + * Provides data for the FilesUploadStart event. + */ +interface ASPxClientUploadControlFilesUploadStartEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets a value indicating whether the action which raised the event should be canceled. + * Value: true if the action that raised the event should be canceled; otherwise, false. + */ + cancel: boolean; +} +/** + * A method that handles the FileUploadComplete client event. + */ +interface ASPxClientUploadControlFileUploadCompleteEventHandler { + /** + * A method that will handle the corresponding client event. + * @param source The event source. This parameter identifies the upload control which raised the event. + * @param e An ASPxClientUploadControlFileUploadCompleteEventArgs object that contains event data. + */ + (source: S, e: ASPxClientUploadControlFileUploadCompleteEventArgs): void; +} +/** + * Provides data for the FileUploadComplete event. + */ +interface ASPxClientUploadControlFileUploadCompleteEventArgs extends ASPxClientEventArgs { + /** + * Gets the index of a file input element within the ASPxUploadControl. + * Value: An integer value that specifies the file input element's index. + */ + inputIndex: number; + /** + * Gets or sets a value indicating whether the uploaded file passes validation. + * Value: true if the file is valid; otherwise, false. + */ + isValid: boolean; + /** + * Gets the error text to be displayed within the ASPxUploadControl's error frame. + * Value: A string value that represents the error text. + */ + errorText: string; + /** + * Gets a string that contains specific information (if any) passed from the server side for further client processing. + * Value: A string value representing callback data passed from the server. + */ + callbackData: string; +} +/** + * A method that will handle the FilesUploadComplete client event. + */ +interface ASPxClientUploadControlFilesUploadCompleteEventHandler { + /** + * A method that will handle the client FilesUploadComplete event. + * @param source The event source. This parameter identifies the upload control which raised the event. + * @param e A object that contains event data. + */ + (source: S, e: ASPxClientUploadControlFilesUploadCompleteEventArgs): void; +} +/** + * Provides data for the FilesUploadComplete client event, which enables you to perform specific actions after all selected files have been uploaded. + */ +interface ASPxClientUploadControlFilesUploadCompleteEventArgs extends ASPxClientEventArgs { + /** + * Gets the error text to be displayed within the upload control's error frame. + * Value: A string value that is the error text. + */ + errorText: string; + /** + * Gets a string that contains specific information (if any) passed from the server side for further client processing. + * Value: A string value that is the callback data passed from the server. + */ + callbackData: string; +} +/** + * A method that will handle the TextChanged client event. + */ +interface ASPxClientUploadControlTextChangedEventHandler { + /** + * A method that will handle the TextChanged client event. + * @param source The event source. This parameter identifies the upload control which raised the event. + * @param e An ASPxClientUploadControlTextChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientUploadControlTextChangedEventArgs): void; +} +/** + * Provides data for the TextChanged client event that allows you to respond to an end-user changing an edit box's text. + */ +interface ASPxClientUploadControlTextChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the index of a file input element within the ASPxUploadControl. + * Value: An integer value that specifies the file input element's index. + */ + inputIndex: number; +} +/** + * A method that will handle the ASPxUploadControl's client event, concerned with changes in upload progress. + */ +interface ASPxClientUploadControlUploadingProgressChangedEventHandler { + /** + * A method that will handle the ASPxUploadControl's client event concerning the uploading process being changed. + * @param source An object representing the event's source. Identifies the ASPxUploadControl object that raised the event. + * @param e An ASPxClientUploadControlUploadingProgressChangedEventArgs object that contains event data. + */ + (source: S, e: ASPxClientUploadControlUploadingProgressChangedEventArgs): void; +} +/** + * Provides data for the UploadingProgressChanged event. + */ +interface ASPxClientUploadControlUploadingProgressChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets the number of the files selected for upload. + * Value: An integer value that represents the total number of selected files. + */ + fileCount: number; + /** + * Gets the name of the file being currently uploaded. + * Value: A string value that represents the file name. + */ + currentFileName: string; + /** + * Gets the content length of the currently uploaded file. + * Value: An integer value specifying the content length. + */ + currentFileContentLength: number; + /** + * Gets the content length of the current file already uploaded to the server. + * Value: An integer value that is the content length. + */ + currentFileUploadedContentLength: number; + /** + * Gets the position of the current file upload progress. + * Value: An value specifying the upload progress position. + */ + currentFileProgress: number; + /** + * Gets the content length of the files selected for upload. + * Value: An integer value specifying the total content length of the selected files. + */ + totalContentLength: number; + /** + * Gets the content length of the files already uploaded to the server. + * Value: An integer value that represents the content length. + */ + uploadedContentLength: number; + /** + * Gets the current position of total upload progress. + * Value: An value specifying the total upload progress position. + */ + progress: number; +} +/** + * A method that will handle the ValidationErrorOccurred client event. + */ +interface ASPxClientUploadControlValidationErrorOccurredEventHandler { + /** + * A method that will handle the ValidationErrorOccurred event. + * @param source The event source. + * @param e An ASPxClientUploadControlValidationErrorOccurredEventArgs object that contains event data. + */ + (source: S, e: ASPxClientUploadControlValidationErrorOccurredEventArgs): void; +} +/** + * Provides data for the ValidationErrorOccurred event. + */ +interface ASPxClientUploadControlValidationErrorOccurredEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets the error text. + * Value: A string value that represents the error text. + */ + errorText: string; + /** + * Gets or sets a value specifying whether an alert message is displayed when the ValidationErrorOccurred event fires. + * Value: true, to display an alert message; otherwise, false. + */ + showAlert: boolean; + /** + * Gets the validation settings for the selected files. + * Value: An ASPxClientUploadControlValidationSettings object that provides validation settings. + */ + validationSettings: ASPxClientUploadControlValidationSettings; + /** + * Returns an array of invalid files. + * Value: An array of the ASPxClientUploadControlInvalidFileInfo objects. + */ + invalidFiles: ASPxClientUploadControlInvalidFileInfo[]; +} +/** + * Contains settings that relate to the ValidationErrorOccurred client event. + */ +interface ASPxClientUploadControlValidationSettings { + /** + * Gets the maximum file size. + * Value: An value that specifies the maximum file size, in bytes. + */ + maxFileSize: any; + /** + * Gets the maximum count of files that can be selected for uploading at once. + * Value: An integer value that specifies the maximum count of files. + */ + maxFileCount: number; + /** + * Gets the allowed file extensions. + * Value: An array of string values that contains file extensions that are allowed. + */ + allowedFileExtensions: string[]; + /** + * Gets which characters in a file name are not allowed. + * Value: An array of string values that contains characters that are not allowed. + */ + invalidFileNameCharacters: string[]; +} +/** + * Contains settings of the file that hasn't passed validation. + */ +interface ASPxClientUploadControlInvalidFileInfo { + /** + * Gets the name of the invalid file. + * Value: A string value that specifies the file name. + */ + fileName: string; + /** + * Gets the size of the invalid file. + * Value: An integer value that specifies the file size. + */ + fileSize: number; + /** + * Gets the error type. + * Value: An ASPxClientUploadControlValidationErrorTypeConsts object that provides possible types of errors. + */ + errorType: ASPxClientUploadControlValidationErrorTypeConsts; +} +/** + * Declares client constants containing codes of validation errors that can occur while selecting files for uploading. + */ +interface ASPxClientUploadControlValidationErrorTypeConsts { +} +/** + * Represents a client file that corresponds to a particular file selected for uploading in the upload control. + */ +interface ASPxClientUploadControlFile { + /** + * Gets the name of the file selected for uploading. + * Value: A string value that specifies the file's name. + */ + name: string; + /** + * Gets the size of the file selected for uploading. + * Value: An Int64 value specifying the file's size, in bytes. + */ + size: any; + /** + * Provides access to the file as a native Javascript object. + * Value: A JavaScript object that is the file selected for uploading. + */ + sourceFileObject: any; +} +/** + * A method that will handle the DropZoneEnter event. + */ +interface ASPxClientUploadControlDropZoneEnterEventHandler { + /** + * A method that will handle the DropZoneEnter event. + * @param source The event source. This parameter identifies the upload control object which raised the event. + * @param e An ASPxClientUploadControlDropZoneEnterEventArgs object that contains event data. + */ + (source: S, e: ASPxClientUploadControlDropZoneEnterEventArgs): void; +} +/** + * Provides data for the DropZoneEnter event. + */ +interface ASPxClientUploadControlDropZoneEnterEventArgs extends ASPxClientEventArgs { + /** + * Gets a drop zone object related to the processed event. + * Value: An object that is a drop zone related to the processed event. + */ + dropZone: Object; +} +/** + * A method that will handle the DropZoneLeave event. + */ +interface ASPxClientUploadControlDropZoneLeaveEventHandler { + /** + * A method that will handle the DropZoneLeave event. + * @param source The event source. Identifies the upload control object that raised the event. + * @param e A ASPxClientUploadControlDropZoneLeaveEventArgs object that contains event data. + */ + (source: S, e: ASPxClientUploadControlDropZoneLeaveEventArgs): void; +} +/** + * Provides data for the DropZoneLeave event. + */ +interface ASPxClientUploadControlDropZoneLeaveEventArgs extends ASPxClientEventArgs { + /** + * Gets a drop zone object related to the processed event. + * Value: An object that is a drop zone related to the processed event. + */ + dropZone: Object; +} +/** + * The JavaScript equivalent of the ASPxChartDesigner class. + */ +interface ASPxClientChartDesigner extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientChartDesigner. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs when executing the Save command on the client. + */ + SaveCommandExecute: ASPxClientEvent>; + /** + * Enables you to customize the menu actions of a Client Chart Designer. + */ + CustomizeMenuActions: ASPxClientEvent>; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side event. + */ + PerformCallback(arg: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(arg: string, onSuccess: (arg1: string) => void): void; + /** + * Updates the localization settings of the ASPxClientChartDesigner properties. + * @param localization A dictionary containing the property names, along with their localized equivalents. + */ + UpdateLocalization(localization: { [key: string]: string; }): void; + /** + * Returns the model of the Client Chart Designer. + */ + GetDesignerModel(): Object; + /** + * For internal use. + */ + GetJsonChartModel(): string; +} +/** + * A method that will handle the SaveCommandExecute event. + */ +interface ASPxClientChartDesignerSaveCommandExecuteEventHandler { + /** + * Represents a method that will handle the SaveCommandExecute event. + * @param source The event source. This parameter identifies the ASPxChartDesigner which raised the event. + * @param e A ASPxClientChartDesignerSaveCommandExecuteEventArgs object which contains event data. + */ + (source: S, e: ASPxClientChartDesignerSaveCommandExecuteEventArgs): void; +} +/** + * Provides data for a chart control's SaveCommandExecute event. + */ +interface ASPxClientChartDesignerSaveCommandExecuteEventArgs extends ASPxClientEventArgs { + /** + * Gets or sets a value specifying whether an event has been handled. + * Value: true, if the event hasn't been handled by a control; otherwise, false. + */ + handled: boolean; +} +/** + * Represents a method that will handle the CustomizeMenuActions events. + */ +interface ASPxClientChartDesignerCustomizeMenuActionsEventHandler { + /** + * Represents a method that will handle the CustomizeMenuActions event. + * @param source The event source. This parameter identifies the ASPxChartDesigner which raised the event. + * @param e An ASPxClientChartDesignerCustomizeMenuActionsEventArgs object which contains event data. + */ + (source: S, e: ASPxClientChartDesignerCustomizeMenuActionsEventArgs): void; +} +/** + * An action of the Client Chart Designer's menu. + */ +interface ASPxClientChartDesignerMenuAction { + /** + * Provides access to the text for the command. + * Value: A String value. + */ + text: string; + /** + * Provides access to the CSS class of the command's glyph. + * Value: A String value. + */ + imageClassName: string; + /** + * Provides access to the action performed when the Client Chart Designer's button is clicked. + * Value: The specific action implementation. + */ + clickAction: Function; + /** + * Provides access to the value that specifies whether or not the command is disabled by default. + * Value: true, if the command is disabled by default; otherwise, false. + */ + disabled: boolean; + /** + * Provides access to the value that specifies whether or not the command is visible in the designer user interface. + * Value: true if the command is visible; otherwise false. + */ + visible: boolean; + /** + * Provides access to the keyboard shortcut used to invoke the command. + * Value: A String value. + */ + hotKey: string; + /** + * Provides access to the value that specifies whether or not the command has a visual separator. + * Value: true, if the command has a visual separator; otherwise, false. + */ + hasSeparator: string; + /** + * Provides access to the location of the displayed command. + * Value: A String value. + */ + container: string; +} +/** + * Provides data for a chart control's CustomizeMenuActions event on the client side. + */ +interface ASPxClientChartDesignerCustomizeMenuActionsEventArgs extends ASPxClientEventArgs { + /** + * Returns an array of the Client Chart Designer's menu actions. + * Value: An array of the ASPxClientChartDesignerMenuAction objects. + */ + actions: ASPxClientChartDesignerMenuAction[]; +} +/** + * A class which provides access to the entire hierarchy of chart elements on the client side. + */ +interface ASPxClientWebChartControl extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client side after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientWebChartControl. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side when any chart element is hot-tracked. + */ + ObjectHotTracked: ASPxClientEvent>; + /** + * Occurs before crosshair items are drawn when the chart's contents are being drawn. + */ + CustomDrawCrosshair: ASPxClientEvent>; + /** + * Occurs on the client side when any chart element is selected. + */ + ObjectSelected: ASPxClientEvent>; + /** + * Returns an ASPxClientWebChart object, which contains information about the hierarchy of a chart control, and provides access to the main properties of chart elements on the client side. + */ + GetChart(): ASPxClientWebChart; + /** + * Returns the printing options of the chart control. + */ + GetPrintOptions(): ASPxClientChartPrintOptions; + /** + * Changes the mouse pointer, which is shown when the mouse is over the chart control, to the pointer with the specified name. + * @param cursor A string value representing the name of the desired cursor. + */ + SetCursor(cursor: string): void; + /** + * Returns the specific chart element which is located under the test point. + * @param x An integer value that specifies the x coordinate of the test point. + * @param y An integer value that specifies the y coordinate of the test point. + */ + HitTest(x: number, y: number): ASPxClientHitObject[]; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side event. + */ + PerformCallback(args: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param args A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(args: string, onSuccess: (arg1: string) => void): void; + /** + * Prints the current chart on the client side. + */ + Print(): void; + /** + * Loads a chart which should be customized from its object model. + * @param serializedChartObjectModel A String object representing the chart model. + */ + LoadFromObjectModel(serializedChartObjectModel: string): void; + /** + * Exports a chart to the file of the specified format, and saves it to the disk. + * @param format A string value specifying the format, to which a chart should be exported. + */ + SaveToDisk(format: string): void; + /** + * Exports a chart to a file in the specified format, and saves it to disk, using the specified file name. + * @param format A string value specifying the format, to which a chart should be exported. + * @param filename A string value specifying the file name, to which a chart should be exported. If this parameter is missing or set to an empty string, then the created file will be named using the client-side name of a chart. + */ + SaveToDisk(format: string, filename: string): void; + /** + * Exports a report to the file of the specified format, and shows it in a new Web Browser window. + * @param format A string value specifying a format in which a report should be exported. + */ + SaveToWindow(format: string): void; + /** + * Gets the main DOM (Document Object Model) element on a Web Page representing this ASPxClientWebChartControl object. + */ + GetMainDOMElement(): Object; +} +/** + * A method that will handle the CustomDrawCrosshair event. + */ +interface ASPxClientWebChartControlCustomDrawCrosshairEventHandler { + /** + * A method that will handle the CustomDrawCrosshair event. + * @param source The event source. This parameter identifies the chartControl which raised the event. + * @param e An ASPxClientWebChartControlCustomDrawCrosshairEventArgs object which contains event data. + */ + (source: S, e: ASPxClientWebChartControlCustomDrawCrosshairEventArgs): void; +} +/** + * Provides data for a chart control's CustomDrawCrosshair event. + */ +interface ASPxClientWebChartControlCustomDrawCrosshairEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets crosshair elements settings to custom draw a crosshair cursor. + * Value: An ASPxClientCrosshairElement object. + */ + crosshairElements: ASPxClientCrosshairElement; + /** + * Gets the settings of crosshair axis label elements to customize their appearance. + * Value: An ASPxClientCrosshairAxisLabelElement object. + */ + cursorCrosshairAxisLabelElements: ASPxClientCrosshairAxisLabelElement; + /** + * Gets crosshair line element settings that are used to custom draw a crosshair cursor. + * Value: An ASPxClientCrosshairLineElement object that contains crosshair line element settings. + */ + cursorCrosshairLineElement: ASPxClientCrosshairLineElement; + /** + * Gets the settings of crosshair group header elements to customize their appearance. + * Value: An ASPxClientCrosshairGroupHeaderElement object. + */ + crosshairGroupHeaderElements: ASPxClientCrosshairGroupHeaderElement; + /** + * Provides access to the settings of crosshair elements and crosshair group header elements to customize their appearance. + * Value: An ASPxClientCrosshairElementGroup object. + */ + crosshairElementGroups: ASPxClientCrosshairElementGroup; +} +/** + * Represents the client-side equivalent of the CrosshairElement class. + */ +interface ASPxClientCrosshairElement { + /** + * Gets a series that a crosshair element hovers over when implementing a custom draw. + * Value: An ASPxClientSeries object which represents the series currently being painted. + */ + Series: ASPxClientSeries; + /** + * Gets the series point that a crosshair element hovers over when implementing a custom draw. + * Value: An ASPxClientSeriesPoint object, representing the series point that a crosshair element hovers over. + */ + Point: ASPxClientSeriesPoint; + /** + * Gets or sets the crosshair line element to custom draw a crosshair cursor. + * Value: An ASPxClientCrosshairLineElement object, representing the crosshair line element. + */ + LineElement: ASPxClientCrosshairLineElement; + /** + * Provides access to the crosshair axis label element. + * Value: An ASPxClientCrosshairAxisLabelElement object, representing the crosshair axis label element. + */ + AxisLabelElement: ASPxClientCrosshairAxisLabelElement; + /** + * Gets the crosshair label element. + * Value: An ASPxClientCrosshairSeriesLabelElement object, representing the crosshair label element. + */ + LabelElement: ASPxClientCrosshairSeriesLabelElement; + /** + * Specifies whether the crosshair element is visible when implementing custom drawing in the crosshair cursor. + * Value: true, if the crosshair element is visible; otherwise, false. + */ + visible: boolean; +} +/** + * Represents the client-side equivalent of the CrosshairLineElement class. + */ +interface ASPxClientCrosshairLineElement { +} +/** + * Represents the client-side equivalent of the CrosshairAxisLabelElement class. + */ +interface ASPxClientCrosshairAxisLabelElement { +} +/** + * The client-side equivalent of the CrosshairGroupHeaderElement class. + */ +interface ASPxClientCrosshairGroupHeaderElement { +} +/** + * The client-side equivalent of the CrosshairLabelElement class. + */ +interface ASPxClientCrosshairSeriesLabelElement { +} +/** + * Represents the client-side equivalent of the CrosshairElementGroup class. + */ +interface ASPxClientCrosshairElementGroup { +} +/** + * Represents a method that will handle the ObjectSelected events. + */ +interface ASPxClientWebChartControlHotTrackEventHandler { + /** + * Represents a method that will handle the ObjectSelected events. + * @param source The event source. This parameter identifies the ASPxClientWebChartControl which raised the event. + * @param e An ASPxClientWebChartControlHotTrackEventArgs object which contains event data. + */ + (source: S, e: ASPxClientWebChartControlHotTrackEventArgs): void; +} +/** + * Provides data for a chart control's ObjectSelected events on the client side. + */ +interface ASPxClientWebChartControlHotTrackEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Provides access on the client side to the chart element, for which the event was raised. + * Value: An ASPxClientWebChartElement object, which represents the chart element for which the event was raised. + */ + hitObject: ASPxClientWebChartElement; + /** + * Provides access on the client side to the object, which is in some way related to the object being hit. The returned value depends on the hitObject type and hit point location. + * Value: An ASPxClientWebChartElement object representing an additional object that relates to the one being hit. + */ + additionalHitObject: ASPxClientWebChartElement; + /** + * Gets details on the chart elements located at the point where an end-user has clicked when hot-tracking or selecting a chart element on the client side. + * Value: An ASPxClientWebChartHitInfo object, which contains information about the chart elements located at the point where an end-user has clicked. + */ + hitInfo: ASPxClientWebChartHitInfo; + /** + * Provides access on the client side to the chart and all its elements. + * Value: An ASPxClientWebChart object, which provides access to chart properties. + */ + chart: ASPxClientWebChart; + /** + * Gets the HTML object that contains the processed item. + * Value: An object representing a container for the item related to the event. + */ + htmlElement: Object; + /** + * Gets the X-coordinate of the hit test point, relative to the top left corner of the chart. + * Value: An integer value specifying X-coordinate of the hit test point (in pixels). + */ + x: number; + /** + * Gets the Y-coordinate of the hit test point, relative to the top left corner of the chart. + * Value: An integer value specifying Y-coordinate of the hit test point (in pixels). + */ + y: number; + /** + * Gets the X-coordinate of the hit test point, relative to the top left corner of the Web Page containing this chart. + * Value: An integer value specifying X-coordinate of the hit test point (in pixels). + */ + absoluteX: number; + /** + * Gets the Y-coordinate of the hit test point, relative to the top left corner of the Web Page containing this chart. + * Value: An integer value specifying Y-coordinate of the hit test point (in pixels). + */ + absoluteY: number; + /** + * Gets a value indicating whether the hot-tracking or object selection should be canceled. + * Value: true to cancel the hot-tracking or selection of an object; otherwise, false. + */ + cancel: boolean; +} +/** + * Represents an object under the hit test point within a chart control, on the client side. + */ +interface ASPxClientHitObject { + /** + * Gets the chart element for which the event was raised. + * Value: An ASPxClientWebChartElement object, representing the chart element for which the event was raised. + */ + Object: ASPxClientWebChartElement; + /** + * Provides access to an object, which is in some way related to the object being hit. The returned value depends on the Object type and hit point location. + * Value: An ASPxClientWebChartElement object that represents an additional object related to the one being hit. + */ + AdditionalObject: ASPxClientWebChartElement; +} +/** + * Contains information about a specific test point within a chart control, on the client side. + */ +interface ASPxClientWebChartHitInfo { + /** + * Gets a value indicating whether the test point is within the chart. + * Value: true if the test point is within a chart; otherwise, false. + */ + inChart: boolean; + /** + * Gets a value indicating whether the test point is within the chart title. + * Value: true if the test point is within a chart title; otherwise, false. + */ + inChartTitle: boolean; + /** + * Gets a value indicating whether the test point is within the axis. + * Value: true if the test point is within an axis; otherwise, false. + */ + inAxis: boolean; + /** + * Gets a value indicating whether the test point is within the axis label item. + * Value: true if the test point is within an axis label item; otherwise, false. + */ + inAxisLabelItem: boolean; + /** + * Gets a value indicating whether the test point is within the axis title. + * Value: true if the test point is within an axis title; otherwise, false. + */ + inAxisTitle: boolean; + /** + * Gets a value indicating whether the test point is within the constant line. + * Value: true if the test point is within a constant line; otherwise, false. + */ + inConstantLine: boolean; + /** + * Gets a value indicating whether the test point is within the diagram. + * Value: true if the test point is within a diagram; otherwise, false. + */ + inDiagram: boolean; + /** + * Gets a value indicating whether the test point is within the non-default pane. + * Value: true if the test point is within a non-default pane; otherwise, false. + */ + inNonDefaultPane: boolean; + /** + * Gets a value indicating whether the test point is within the legend. + * Value: true if the test point is within a legend; otherwise, false. + */ + inLegend: boolean; + /** + * Gets the value indicating whether or not the test point is within a custom legend item. + * Value: true if the test point is within a custom legend item; otherwise, false. + */ + inCustomLegendItem: boolean; + /** + * Gets a value indicating whether the test point is within the series. + * Value: true if the test point is within a series; otherwise, false. + */ + inSeries: boolean; + /** + * Gets a value indicating whether the test point is within the series label. + * Value: true if the test point is within a series label; otherwise, false. + */ + inSeriesLabel: boolean; + /** + * Gets a value indicating whether the test point is within the series point. + * Value: true if the test point is within a series point; otherwise, false. + */ + inSeriesPoint: boolean; + /** + * Gets a value indicating whether the test point is within the series title. + * Value: true if the test point is within a series title; otherwise, false. + */ + inSeriesTitle: boolean; + /** + * Gets a value indicating whether the test point is within the trendline. + * Value: true if the test point is within a trendline; otherwise, false. + */ + inTrendLine: boolean; + /** + * Gets a value indicating whether the test point is within the Fibonacci Indicator. + * Value: true if the test point is within a Fibonacci Indicator; otherwise, false. + */ + inFibonacciIndicator: boolean; + /** + * Gets a value indicating whether the test point is within the regression line. + * Value: true if the test point is within a regression line; otherwise, false. + */ + inRegressionLine: boolean; + /** + * Gets a value specifying whether the test point is within an indicator. + * Value: true if the test point is within an indicator; otherwise, false. + */ + inIndicator: boolean; + /** + * Gets a value indicating whether the test point is within an annotation. + * Value: true if the test point is within an annotation; otherwise, false. + */ + inAnnotation: boolean; + /** + * Gets a value indicating whether the test point is within a hyperlink. + * Value: true, if the test point is within a hyperlink; otherwise, false. + */ + inHyperlink: boolean; + /** + * Gets the client-side chart instance from under the test point. + * Value: An ASPxClientWebChart object. + */ + chart: ASPxClientWebChart; + /** + * Gets the client-side chart title instance from under the test point. + * Value: An ASPxClientChartTitle object. + */ + chartTitle: ASPxClientChartTitle; + /** + * Gets the client-side axis instance from under the test point. + * Value: An ASPxClientAxisBase descendant. + */ + axis: ASPxClientAxisBase; + /** + * Gets the client-side constant line instance from under the test point. + * Value: An ASPxClientConstantLine object. + */ + constantLine: ASPxClientConstantLine; + /** + * Gets the client-side diagram instance from under the test point. + * Value: An ASPxClientXYDiagramBase descendant. + */ + diagram: ASPxClientXYDiagramBase; + /** + * Gets the client-side non-default pane instance from under the test point. + * Value: An ASPxClientXYDiagramPane object. + */ + nonDefaultPane: ASPxClientXYDiagramPane; + /** + * Gets the client-side legend instance from under the test point. + * Value: An ASPxClientLegend object. + */ + legend: ASPxClientLegend; + /** + * Gets a custom legend item which is located under the test point. + * Value: An ASPxClientCustomLegendItem object which represents the item located under the test point. + */ + customLegendItem: ASPxClientCustomLegendItem; + /** + * Gets the client-side series instance from under the test point. + * Value: An ASPxClientSeries object. + */ + series: ASPxClientSeries; + /** + * Gets the client-side series label instance from under the test point. + * Value: An ASPxClientSeriesLabel object. + */ + seriesLabel: ASPxClientSeriesLabel; + /** + * Gets the client-side series title instance from under the test point. + * Value: An ASPxClientSeriesTitle object. + */ + seriesTitle: ASPxClientSeriesTitle; + /** + * Gets the client-side trendline instance from under the test point. + * Value: An ASPxClientTrendLine object. + */ + trendLine: ASPxClientTrendLine; + /** + * Gets the client-side Fibonacci indicator instance from under the test point. + * Value: An ASPxClientFibonacciIndicator object. + */ + fibonacciIndicator: ASPxClientFibonacciIndicator; + /** + * Gets the client-side regression line instance from under the test point. + * Value: An ASPxClientRegressionLine object. + */ + regressionLine: ASPxClientRegressionLine; + /** + * Gets the client-side indicator instance from under the test point. + * Value: An ASPxClientIndicator descendant. + */ + indicator: ASPxClientIndicator; + /** + * Gets the client-side annotation instance from under the test point. + * Value: An ASPxClientAnnotation object. + */ + annotation: ASPxClientAnnotation; + /** + * Gets the client-side series point instance from under the test point. + * Value: An ASPxClientSeriesPoint object. + */ + seriesPoint: ASPxClientSeriesPoint; + /** + * Gets the client-side axis label item instance from under the test point. + * Value: An ASPxClientAxisLabelItem object. + */ + axisLabelItem: ASPxClientAxisLabelItem; + /** + * Gets the client-side axis title instance from under the test point. + * Value: An ASPxClientAxisTitle object. + */ + axisTitle: ASPxClientAxisTitle; + /** + * Returns a hyperlink which is located under the test point. + * Value: A String object representing a hyperlink. + */ + hyperlink: string; +} +/** + * Represents the client-side equivalent of the DiagramCoordinates class. + */ +interface ASPxClientDiagramCoordinates { + /** + * Gets the type of the argument scale. + * Value: A string object which contains the current scale type. + */ + argumentScaleType: string; + /** + * Gets the type of the value scale. + * Value: A string object which contains the current scale type. + */ + valueScaleType: string; + /** + * Gets the argument of the data point as a text string. + * Value: A string object, representing a data point's argument. + */ + qualitativeArgument: string; + /** + * Gets the numerical representation of the data point's argument. + * Value: A Double value, representing the data point's argument. + */ + numericalArgument: number; + /** + * Gets the date-time representation of the data point's argument. + * Value: A date object, representing the point's argument. + */ + dateTimeArgument: Date; + /** + * Gets the numerical representation of the data point's value. + * Value: A Double value, representing the data point's value. + */ + numericalValue: number; + /** + * Gets the date-time representation of the data point's value. + * Value: A date object, representing the point's value. + */ + dateTimeValue: Date; + /** + * Gets the X-axis of the diagram point. + * Value: An ASPxClientAxisBase descendant, representing the axis of arguments (X-axis). + */ + axisX: ASPxClientAxisBase; + /** + * Gets the Y-axis of the diagram point. + * Value: An ASPxClientAxisBase descendant, representing the axis of values (Y-axis). + */ + axisY: ASPxClientAxisBase; + /** + * Gets the pane of the diagram point. + * Value: An ASPxClientXYDiagramPane descendant, representing the pane. + */ + pane: ASPxClientXYDiagramPane; + /** + * Checks whether the current object represents a point outside the diagram area. + */ + IsEmpty(): boolean; + /** + * Gets the value of the client-side axis instance. + * @param axis An ASPxClientAxisBase class descendant, representing the axis that contains the requested value. + */ + GetAxisValue(axis: ASPxClientAxisBase): ASPxClientAxisValue; +} +/** + * Contains the information about an axis value. + */ +interface ASPxClientAxisValue { + /** + * Gets the axis scale type. + * Value: A String value, specifying the axis scale type. + */ + scaleType: string; + /** + * Gets the axis value, if the axis scale type is qualitative. + * Value: A String value, specifying the axis value. + */ + qualitativeValue: string; + /** + * Gets the axis value, if the axis scale type is numerical. + * Value: A Double value, specifying the axis value. + */ + numericalValue: number; + /** + * Gets the axis value, if the axis scale type is date-time. + * Value: A DateTime value, specifying the axis value. + */ + dateTimeValue: Date; +} +/** + * Represents the client-side equivalent of the ControlCoordinates class. + */ +interface ASPxClientControlCoordinates { + /** + * Gets the point's pane. + * Value: An ASPxClientXYDiagramPane object. + */ + pane: ASPxClientXYDiagramPane; + /** + * Gets the point's X-coordinate, in pixels. + * Value: An integer value, specifying the X-coordinate (in pixels). + */ + x: number; + /** + * Gets the point's Y-coordinate, in pixels. + * Value: An integer value, specifying the Y-coordinate (in pixels). + */ + y: number; + /** + * Gets the point's visibility state. + * Value: "Visible", "Hidden", or "Undefined". + */ + visibility: string; +} +/** + * Represents the client-side equivalent of the ChartElement class. + */ +interface ASPxClientWebChartElement { + /** + * Gets the chart that owns the current chart element. + * Value: An ASPxClientWebChart object, to which the chart element belongs. + */ + chart: ASPxClientWebChart; +} +/** + * Represents a base class for chart elements, which are not necessarily required to be present on the client side. + */ +interface ASPxClientWebChartEmptyElement extends ASPxClientWebChartElement { +} +/** + * Represents a base class for chart elements, which are required to be present on the client side. + */ +interface ASPxClientWebChartRequiredElement extends ASPxClientWebChartElement { +} +/** + * Represents the client-side equivalent of the ChartElementNamed class. + */ +interface ASPxClientWebChartElementNamed extends ASPxClientWebChartRequiredElement { + /** + * Gets the name of the chart element. + * Value: A string object representing the name of the chart element. + */ + name: string; +} +/** + * Represents the client-side equivalent of the WebChartControl control. + */ +interface ASPxClientWebChart extends ASPxClientWebChartRequiredElement { + /** + * Gets the client-side Chart Control that owns the current chart. + * Value: An ASPxClientWebChartControl object, to which the chart belongs. + */ + chartControl: ASPxClientWebChartControl; + /** + * Gets the chart's diagram and provides access to its settings. + * Value: An ASPxClientRadarDiagram), that represents the chart's diagram. + */ + diagram: ASPxClientWebChartElement; + /** + * Provides access to the chart's collection of series. + * Value: An array of ASPxClientSeries objects that represent the collection of series. + */ + series: ASPxClientSeries[]; + /** + * Provides access to the collection of chart titles. + * Value: An array of ASPxClientChartTitle objects, that represent the collection of chart titles. + */ + titles: ASPxClientChartTitle[]; + /** + * Provides access to the chart's collection of annotations. + * Value: An array of ASPxClientAnnotation objects, representing the collection of annotations. + */ + annotations: ASPxClientAnnotation[]; + /** + * Gets the chart's legend and provides access to its settings. + * Value: An ASPxClientLegend object that represents the chart's legend. + */ + legend: ASPxClientLegend; + /** + * Returns the collection of legends. + * Value: An array of ASPxClientLegend objects. + */ + legends: ASPxClientLegend[]; + /** + * Gets the name of the appearance, which is currently used to draw the chart's elements. + * Value: A string value that represents the appearance name. + */ + appearanceName: string; + /** + * Gets the name of the palette currently used to draw the chart's series. + * Value: A string value that represents the palette name. + */ + paletteName: string; + /** + * Gets a value indicating whether series tooltips should be shown. + * Value: true to show tooltips for series; otherwise, false. + */ + showSeriesToolTip: boolean; + /** + * Gets a value indicating whether point tooltips should be shown. + * Value: true to show tooltips for series points; otherwise, false. + */ + showPointToolTip: boolean; + /** + * Gets a value indicating whether a crosshair cursor should be shown. + * Value: true to show a crosshair cursor; otherwise, false. + */ + showCrosshair: boolean; + /** + * Gets a value that contains information on how the tooltip position is defined, for example, relative to a mouse pointer or chart element. + * Value: An ASPxClientToolTipPosition class descendant that defines the tooltip position type. + */ + toolTipPosition: ASPxClientToolTipPosition; + /** + * Returns the tooltip controller that shows tooltips for chart elements. + * Value: An ASPxClientToolTipController object. + */ + toolTipController: ASPxClientToolTipController; + /** + * Gets the settings for a crosshair cursor concerning its position and appearance on a diagram. + * Value: An ASPxClientCrosshairOptions object descendant which provides access to crosshair cursor options on a diagram. + */ + crosshairOptions: ASPxClientCrosshairOptions; + /** + * Gets a css postfix for a chart. + * Value: A string value. + */ + cssPostfix: string; + /** + * Gets or sets a value which specifies how the chart elements are selected. + * Value: A String object representing the name of the selection mode. + */ + selectionMode: string; +} +/** + * Represents the client-side equivalent of the SimpleDiagram class. + */ +interface ASPxClientSimpleDiagram extends ASPxClientWebChartEmptyElement { +} +/** + * Represents the base class for all diagram classes, which have X and Y axes. + */ +interface ASPxClientXYDiagramBase extends ASPxClientWebChartRequiredElement { + /** + * Gets the X-axis. + * Value: An ASPxClientAxisBase object which represents the X-axis. + */ + axisX: ASPxClientAxisBase; + /** + * Gets the Y-axis. + * Value: An ASPxClientAxisBase object which represents the Y-axis. + */ + axisY: ASPxClientAxisBase; +} +/** + * Represents the client-side equivalent of the XYDiagram2D class. + */ +interface ASPxClientXYDiagram2D extends ASPxClientXYDiagramBase { + /** + * Provides access to a collection of secondary X-axes for a given 2D XY-diagram. + * Value: An array of ASPxClientAxis objects, that is a collection of secondary X-axes. + */ + secondaryAxesX: ASPxClientAxis[]; + /** + * Provides access to a collection of secondary Y-axes for a given 2D XY-diagram. + * Value: An array of ASPxClientAxis objects, that is a collection of secondary X-axes. + */ + secondaryAxesY: ASPxClientAxis[]; + /** + * Provides access to a default pane object. + * Value: An ASPxClientXYDiagramPane object which represents the default pane of a chart. + */ + defaultPane: ASPxClientXYDiagramPane; + /** + * Provides access to an array of a diagram's panes. + * Value: An array of ASPxClientXYDiagramPane objects. + */ + panes: ASPxClientXYDiagramPane[]; + /** + * Converts the display coordinates into a diagram coordinates object. + * @param x An integer value, representing the X-coordinate of a point (measured in pixels relative to the top left corner of a chart). + * @param y An integer value, representing the Y-coordinate of a point (measured in pixels relative to the top left corner of a chart). + */ + PointToDiagram(x: number, y: number): ASPxClientDiagramCoordinates; + /** + * Converts the diagram coordinates of a point into screen coordinates. + * @param argument An object, representing the point's argument. + * @param value An object, representing the point's value. + * @param axisX An ASPxClientAxis2D descendant, representing the X-axis. + * @param axisY An ASPxClientAxis2D descendant, representing the Y-axis. + * @param pane An ASPxClientXYDiagramPane object, representing the pane. + */ + DiagramToPoint(argument: Object, value: Object, axisX: ASPxClientAxis2D, axisY: ASPxClientAxis2D, pane: ASPxClientXYDiagramPane): ASPxClientControlCoordinates; + /** + * Shows the Crosshair Cursor at the point with the specified coordinates. + * @param screenX The horizontal coordinate that is related to the top-left angle of the chart. + * @param screenY The vertical coordinate that is related to the top-left angle of the chart. + */ + ShowCrosshair(screenX: number, screenY: number): void; +} +/** + * Represents the client-side equivalent of the XYDiagram class. + */ +interface ASPxClientXYDiagram extends ASPxClientXYDiagram2D { + /** + * Gets a value indicating whether the diagram is rotated. + * Value: true if the diagram is rotated; otherwise, false. + */ + rotated: boolean; +} +/** + * Represents the client-side equivalent of the SwiftPlotDiagram class. + */ +interface ASPxClientSwiftPlotDiagram extends ASPxClientXYDiagram2D { +} +/** + * Represents the client-side equivalent of the XYDiagramPane class. + */ +interface ASPxClientXYDiagramPane extends ASPxClientWebChartElementNamed { + /** + * Gets the diagram that owns the current pane object. + * Value: An ASPxClientXYDiagram object, to which the pane belongs. + */ + diagram: ASPxClientXYDiagram; +} +/** + * Represents the client-side equivalent of the XYDiagram3D class. + */ +interface ASPxClientXYDiagram3D extends ASPxClientXYDiagramBase { +} +/** + * Represents the client-side equivalent of the RadarDiagram class. + */ +interface ASPxClientRadarDiagram extends ASPxClientXYDiagramBase { + /** + * Converts the display coordinates into a diagram coordinates object. + * @param x An integer value, representing the X-coordinate of a point (measured in pixels relative to the top left corner of a chart). + * @param y An integer value, representing the Y-coordinate of a point (measured in pixels relative to the top left corner of a chart). + */ + PointToDiagram(x: number, y: number): ASPxClientDiagramCoordinates; + /** + * Converts the diagram coordinates of a point into screen coordinates. + * @param argument An object, representing the point's argument. + * @param value An object, representing the point's value. + */ + DiagramToPoint(argument: Object, value: Object): ASPxClientControlCoordinates; +} +/** + * Represents the client-side equivalent of the AxisBase class. + */ +interface ASPxClientAxisBase extends ASPxClientWebChartElementNamed { + /** + * Provides access to the XY-diagram which contains the current axis. + * Value: An ASPxClientXYDiagramBase class descendant. + */ + diagram: ASPxClientXYDiagramBase; + /** + * Provides acess to the range of the axis coordinates. + * Value: An ASPxClientAxisRange object, which contains the common range settings of the axis coordinates. + */ + range: ASPxClientAxisRange; +} +/** + * Represents the client-side equivalent of the Axis2D class. + */ +interface ASPxClientAxis2D extends ASPxClientAxisBase { + /** + * Provides access to an axis title object. + * Value: An ASPxClientAxisTitle object which represents the axis title. + */ + axisTitle: ASPxClientAxisTitle; + /** + * Provides access to the axis strips collection. + * Value: An array of ASPxClientStrip objects. + */ + strips: ASPxClientStrip[]; + /** + * Provides access to the collection of the axis constant lines. + * Value: An array of ASPxClientConstantLine objects which represent constant lines that belong to this axis. + */ + constantLines: ASPxClientConstantLine[]; +} +/** + * Represents the client-side equivalent of the Axis class. + */ +interface ASPxClientAxis extends ASPxClientAxis2D { + /** + * Gets a value indicating whether the axis is reversed. + * Value: true if the axis is reversed; otherwise, false. + */ + reverse: boolean; +} +/** + * Represents the client-side equivalent of the SwiftPlotDiagramAxis class. + */ +interface ASPxClientSwiftPlotDiagramAxis extends ASPxClientAxis2D { +} +/** + * Represents the client-side equivalent of the Axis3D class. + */ +interface ASPxClientAxis3D extends ASPxClientAxisBase { +} +/** + * Represents the client-side equivalent of the RadarAxis class. + */ +interface ASPxClientRadarAxis extends ASPxClientAxisBase { +} +/** + * Represents the client-side equivalent of the AxisTitle class. + */ +interface ASPxClientAxisTitle extends ASPxClientWebChartRequiredElement { + /** + * Gets the axis to which the axis title belongs. + * Value: An ASPxClientAxisBase descendant, which identifies the axis. + */ + axis: ASPxClientAxisBase; + /** + * Gets the text of the axis title. + * Value: A string object which contains the axis title's text. + */ + text: string; +} +/** + * Represents the client-side equivalent of the AxisLabelItem class. + */ +interface ASPxClientAxisLabelItem extends ASPxClientWebChartRequiredElement { + /** + * Gets the axis to which an axis label item belongs. + * Value: An ASPxClientAxisBase descendant, which identifies the axis. + */ + axis: ASPxClientAxisBase; + /** + * Gets the text of an axis label item. + * Value: A string object which contains the axis label item's text. + */ + text: string; + /** + * Gets the axis value to which an axis label item corresponds. + * Value: An object that specifies the axis value. + */ + axisValue: Object; + /** + * Gets the internal representation of the axis value to which an axis label item corresponds. + * Value: A Double value which specifies the internal representation of the axis value. + */ + axisValueInternal: number; +} +/** + * Represents the client-side equivalent of the AxisRange class. + */ +interface ASPxClientAxisRange extends ASPxClientWebChartRequiredElement { + /** + * Gets the axis that owns the current axis range object. + * Value: An ASPxClientAxisBase object, to which the axis range belongs. + */ + axis: ASPxClientAxisBase; + /** + * Gets the minimum value to display on an axis. + * Value: An object representing the minimum value of the axis range. + */ + minValue: Object; + /** + * Gets the maximum value to display on an axis. + * Value: An object representing the maximum value of the axis range. + */ + maxValue: Object; + /** + * Gets the internal float representation of the range minimum value. + * Value: A Double value which specifies the internal representation of the range minimum value. + */ + minValueInternal: number; + /** + * Gets the internal float representation of the range maximum value. + * Value: A Double value which specifies the internal representation of the range maximum value. + */ + maxValueInternal: number; +} +/** + * Represents the client-side equivalent of the Strip class. + */ +interface ASPxClientStrip extends ASPxClientWebChartElementNamed { + /** + * Gets the axis that owns the current strip object. + * Value: An ASPxClientAxis object, to which the strip belongs. + */ + axis: ASPxClientAxis; + /** + * Gets the minimum value of the strip's range. + * Value: An object that represents the minimum value of the strip's range. + */ + minValue: Object; + /** + * Gets the maximum value of the strip's range. + * Value: An object that represents the maximum value of the strip's range. + */ + maxValue: Object; +} +/** + * Represents the client-side equivalent of the ConstantLine class. + */ +interface ASPxClientConstantLine extends ASPxClientWebChartElementNamed { + /** + * Gets the axis that owns the current constant line object. + * Value: An ASPxClientAxis object, to which the constant line belongs. + */ + axis: ASPxClientAxis; + /** + * Gets the constant line's position along the axis. + * Value: An object that specifies the constant line's position. + */ + value: Object; + /** + * Gets the constant line title. + * Value: A string object, representing the title's text. + */ + title: string; +} +/** + * Represents the client-side equivalent of the Series class. + */ +interface ASPxClientSeries extends ASPxClientWebChartElementNamed { + /** + * Gets a value that specifies the view type of the series. + * Value: A string object which contains the current view type. + */ + viewType: string; + /** + * Gets a value that specifies the scale type for the argument data of the series' data points. + * Value: A string object which contains the current scale type. + */ + argumentScaleType: string; + /** + * Gets a value that specifies the scale type for the value data of the series' data points. + * Value: A string object which contains the current scale type. + */ + valueScaleType: string; + /** + * Gets the X-Axis that is used to plot the current series on the XY-diagram. + * Value: A string object, which represents the X-axis name. + */ + axisX: string; + /** + * Gets the Y-Axis that is used to plot the current series on the XY-diagram. + * Value: A string object, which represents the Y-axis name. + */ + axisY: string; + /** + * Gets the pane that is used to plot the current series on the XY-diagram. + * Value: A string object, which represents the pane's name. + */ + pane: string; + /** + * Gets a value indicating whether the series is visible. + * Value: true if the series is visible; otherwise, false. + */ + visible: boolean; + /** + * Gets a value that specifies whether or not a tooltip is enabled for a chart. + * Value: true - a tooltip is enabled for a chart; false - a tooltip is disabled. + */ + toolTipEnabled: boolean; + /** + * Gets the text to be displayed within series tooltips. + * Value: A string value. + */ + toolTipText: string; + /** + * Gets an image to be displayed within series tooltips. + * Value: A string value. + */ + toolTipImage: string; + /** + * Gets the settings of series labels. + * Value: An ASPxClientSeriesLabel object, which provides the series label settings. + */ + label: ASPxClientSeriesLabel; + /** + * Gets the series' collection of data points. + * Value: An array of ASPxClientSeriesPoint objects, that represent the series' data points. + */ + points: ASPxClientSeriesPoint[]; + /** + * Provides access to the collection of series titles. + * Value: An array of ASPxClientSeriesTitle objects, that represent the collection of series titles. + */ + titles: ASPxClientSeriesTitle[]; + /** + * Gets the series' collection of indicators. + * Value: An array of ASPxClientIndicator objects, that belong to the series. + */ + indicators: ASPxClientIndicator[]; + /** + * Provides access to the collection of regression lines. + * Value: An array of ASPxClientRegressionLine objects which represent regression lines available for the series. + */ + regressionLines: ASPxClientRegressionLine[]; + /** + * Provides access to the collection of trendlines. + * Value: An array of ASPxClientTrendLine objects, that represent the collection of trendlines. + */ + trendLines: ASPxClientTrendLine[]; + /** + * Provides access to the collection of Fibonacci Indicators. + * Value: An array of ASPxClientFibonacciIndicator objects, that represent the collection of Fibonacci Indicators. + */ + fibonacciIndicators: ASPxClientFibonacciIndicator[]; + /** + * Gets the color of a series. + * Value: A string value. + */ + color: string; + /** + * Gets a value that defines a group for stacked series. + * Value: A string value. + */ + stackedGroup: string; + /** + * Gets a string which represents the pattern specifying the text to be displayed within a crosshair label for the current Series type. + * Value: A Empty. + */ + crosshairLabelPattern: string; + /** + * This property is intended for internal use only. + * Value: A String value. + */ + groupedElementsPattern: string; + /** + * Returns a collection of crosshair value items. + * Value: An array of ASPxClientCrosshairValueItem objects. + */ + crosshairValueItems: ASPxClientCrosshairValueItem[]; + /** + * Gets a value indicating whether a crosshair cursor is enabled. + * Value: true if a crosshair cursor is enabled; otherwise, false. + */ + actualCrosshairEnabled: boolean; + /** + * Gets a value indicating whether a crosshair label should be shown for this series. + * Value: true if crosshair labels are visible; otherwise, false. + */ + actualCrosshairLabelVisibility: boolean; +} +/** + * Represents the client-side equivalent of the SeriesLabelBase class. + */ +interface ASPxClientSeriesLabel extends ASPxClientWebChartElement { + /** + * Gets the series that owns the current series label object. + * Value: An ASPxClientSeries object, to which the series label belongs. + */ + series: ASPxClientSeries; + /** + * Gets the common text for all series point labels. + * Value: Returns an empty string object. + */ + text: string; +} +/** + * Represents the client-side equivalent of the SeriesPoint class. + */ +interface ASPxClientSeriesPoint extends ASPxClientWebChartRequiredElement { + /** + * Gets the series that owns the current series point object. + * Value: An ASPxClientSeries object, to which the series point belongs. + */ + series: ASPxClientSeries; + /** + * Gets the data point's argument. + * Value: An object that specifies the data point's argument. + */ + argument: Object; + /** + * Gets the point's data value(s). + * Value: An array of objects that represent the data value(s) of the series data point. + */ + values: Object[]; + /** + * Gets the text to be displayed within series points tooltips. + * Value: A string value. + */ + toolTipText: string; + /** + * Gets the color of a series point. + * Value: A string value. + */ + color: string; + /** + * Gets the percent value of a series point. + * Value: A float value. + */ + percentValue: number; + /** + * Gets a hint that is shown in series points tooltips. + * Value: A string value. + */ + toolTipHint: string; +} +/** + * Represents the client-side equivalent of the Legend class. + */ +interface ASPxClientLegend extends ASPxClientWebChartEmptyElement { + /** + * Returns a value which determines whether to use checkboxes instead of markers on a chart legend for all legend items. + * Value: true, if legend checkboxes are shown instead of markers for all legend items; otherwise, false. + */ + useCheckBoxes: boolean; + /** + * Returns a collection of custom legend items of the legend. + * Value: A collection of ASPxClientCustomLegendItem objects. + */ + customItems: ASPxClientCustomLegendItem[]; + /** + * Returns the name of the legend. + * Value: The string value representing the name of the legend. + */ + name: string; +} +/** + * Represents the base for ASPxClientSeriesTitle classes. + */ +interface ASPxClientTitleBase extends ASPxClientWebChartRequiredElement { + /** + * Gets the lines of text within a title. + * Value: An array of string values containing the text of a title. + */ + lines: string[]; + /** + * Gets the alignment of the title. + * Value: A string value containing the text, which specifies the alignment of a title. + */ + alignment: string; + /** + * Gets a value that specifies to which edges of a parent element the title should be docked. + * Value: A string value. + */ + dock: string; +} +/** + * Represents the client-side equivalent of the ChartTitle class. + */ +interface ASPxClientChartTitle extends ASPxClientTitleBase { +} +/** + * Represents the client-side equivalent of the SeriesTitle class. + */ +interface ASPxClientSeriesTitle extends ASPxClientTitleBase { + /** + * Gets the series that owns the current title object. + * Value: An ASPxClientSeries object, to which the series title belongs. + */ + series: ASPxClientSeries; +} +/** + * Represents the client-side equivalent of the Indicator class. + */ +interface ASPxClientIndicator extends ASPxClientWebChartElementNamed { + /** + * Gets the indicator's associated series. + * Value: An ASPxClientSeries object. + */ + series: ASPxClientSeries; +} +/** + * Represents the client-side equivalent of the FinancialIndicator class. + */ +interface ASPxClientFinancialIndicator extends ASPxClientIndicator { + /** + * Gets the first point of the financial indicator. + * Value: An ASPxClientFinancialIndicatorPoint object, which represents a financial indicator's first point. + */ + point1: ASPxClientFinancialIndicatorPoint; + /** + * Gets the second point of the financial indicator. + * Value: An ASPxClientFinancialIndicatorPoint object, which represents a financial indicator's second point. + */ + point2: ASPxClientFinancialIndicatorPoint; +} +/** + * Represents the client-side equivalent of the TrendLine class. + */ +interface ASPxClientTrendLine extends ASPxClientFinancialIndicator { +} +/** + * Represents the client-side equivalent of the FibonacciIndicator class. + */ +interface ASPxClientFibonacciIndicator extends ASPxClientFinancialIndicator { +} +/** + * Represents the client-side equivalent of the FinancialIndicatorPoint class. + */ +interface ASPxClientFinancialIndicatorPoint extends ASPxClientWebChartRequiredElement { + /** + * Gets the financial indicator that owns the current financial indicator point. + * Value: An ASPxClientFinancialIndicator object, to which the point belongs. + */ + financialIndicator: ASPxClientFinancialIndicator; + /** + * Gets the argument of the financial indicator's point. + * Value: An object that specifies the point argument. + */ + argument: Object; + /** + * Gets a value, indicating how the value of a financial indicator's point is obtained. + * Value: A string value, which indicates how to obtain a financial indicator point's value. + */ + valueLevel: string; +} +/** + * The client-side equivalent of the SingleLevelIndicator class. + */ +interface ASPxClientSingleLevelIndicator extends ASPxClientIndicator { + /** + * Gets a value specifying the value level to which the single-level indicator corresponds. + * Value: A string value. + */ + valueLevel: string; +} +/** + * Represents the client-side equivalent of the RegressionLine class. + */ +interface ASPxClientRegressionLine extends ASPxClientSingleLevelIndicator { +} +/** + * The client-side equivalent of the MovingAverage class. + */ +interface ASPxClientMovingAverage extends ASPxClientSingleLevelIndicator { + /** + * Gets the number of data points used to calculate the moving average. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; + /** + * Gets a value specifying whether to display a Moving Average, Envelope, or both. + * Value: A string value. + */ + kind: string; + /** + * Gets a value specifying the Envelope percent. + * Value: A double value which specifies the Envelope percent. + */ + envelopePercent: number; +} +/** + * The client-side equivalent of the SimpleMovingAverage class. + */ +interface ASPxClientSimpleMovingAverage extends ASPxClientMovingAverage { +} +/** + * The client-side equivalent of the ExponentialMovingAverage class. + */ +interface ASPxClientExponentialMovingAverage extends ASPxClientMovingAverage { +} +/** + * The client-side equivalent of the WeightedMovingAverage class. + */ +interface ASPxClientWeightedMovingAverage extends ASPxClientMovingAverage { +} +/** + * The client-side equivalent of the TriangularMovingAverage class. + */ +interface ASPxClientTriangularMovingAverage extends ASPxClientMovingAverage { +} +/** + * Represents the client-side equivalent of the TripleExponentialMovingAverageTema class. + */ +interface ASPxClientTripleExponentialMovingAverageTema extends ASPxClientMovingAverage { +} +/** + * Represents the client-side equivalent of the BollingerBands class. + */ +interface ASPxClientBollingerBands extends ASPxClientIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; + /** + * Gets a value, indicating whose series point values are used to calculate the indicator's values. + * Value: A string value, which indicates which series point value should be used to calculate indicator values. + */ + valueLevel: string; +} +/** + * Represents the client-side equivalent of the MedianPrice class. + */ +interface ASPxClientMedianPrice extends ASPxClientIndicator { +} +/** + * Represents the client-side equivalent of the TypicalPrice class. + */ +interface ASPxClientTypicalPrice extends ASPxClientIndicator { +} +/** + * Represents the client-side equivalent of the WeightedClose class. + */ +interface ASPxClientWeightedClose extends ASPxClientIndicator { +} +/** + * Represents the client-side equivalent of the SeparatePaneIndicator class. + */ +interface ASPxSeparatePaneIndicator extends ASPxClientIndicator { + /** + * Returns the name of the Y-axis that is used to plot the current indicator on a ASPxClientXYDiagram. + * Value: A string value specifying the Y-axis name. + */ + axisY: string; + /** + * Returns the name of a pane, used to plot the separate pane indicator on an XYDiagram. + * Value: A string that is the name of a pane. + */ + pane: string; +} +/** + * Represents the client-side equivalent of the AverageTrueRange class. + */ +interface ASPxClientAverageTrueRange extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; +} +/** + * Represents the client-side equivalent of the ChaikinsVolatility class. + */ +interface ASPxClientChaikinsVolatility extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; +} +/** + * Represents the client-side equivalent of the CommodityChannelIndex class. + */ +interface ASPxClientCommodityChannelIndex extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; +} +/** + * Represents the client-side equivalent of the DetrendedPriceOscillator class. + */ +interface ASPxClientDetrendedPriceOscillator extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; + /** + * Gets a value, indicating whose series point values are used to calculate the indicator's values. + * Value: A string value, which indicates which series point value should be used to calculate indicator values. + */ + valueLevel: string; +} +/** + * Represents the client-side equivalent of the MassIndex class. + */ +interface ASPxClientMassIndex extends ASPxSeparatePaneIndicator { + /** + * Returns the count of points used to calculate the exponential moving average (EMA). + * Value: An integer value, specifying the count of points used to calculate EMA. + */ + movingAveragePointsCount: number; + /** + * Returns the count of summable values. + * Value: An integer value specifying the count of summable ratios. + */ + sumPointsCount: number; +} +/** + * Represents the client-side equivalent of the MovingAverageConvergenceDivergence class. + */ +interface ASPxClientMovingAverageConvergenceDivergence extends ASPxSeparatePaneIndicator { + /** + * Returns the short period value required to calculate the indicator. + * Value: An integer value specifying the short period value. + */ + shortPeriod: number; + /** + * Returns the long period value required to calculate the indicator. + * Value: An integer value specifying the long period. + */ + longPeriod: number; + /** + * Returns the smoothing period value required to calculate the indicator. + * Value: An integer value specifying the smoothing period value. + */ + signalSmoothingPeriod: number; +} +/** + * Represents the client-side equivalent of the RateOfChange class. + */ +interface ASPxClientRateOfChange extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; + /** + * Gets a value, indicating whose series point values are used to calculate the indicator's values. + * Value: A string value, which indicates which series point value should be used to calculate indicator values. + */ + valueLevel: string; +} +/** + * Represents the client-side equivalent of the RelativeStrengthIndex class. + */ +interface ASPxClientRelativeStrengthIndex extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; + /** + * Gets a value, indicating whose series point values are used to calculate the indicator's values. + * Value: A string value, which indicates which series point value should be used to calculate indicator values. + */ + valueLevel: string; +} +/** + * Represents the client-side equivalent of the StandardDeviation class. + */ +interface ASPxClientStandardDeviation extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; + /** + * Gets a value, indicating whose series point values are used to calculate the indicator's values. + * Value: A string value, which indicates which series point value should be used to calculate indicator values. + */ + valueLevel: string; +} +/** + * Represents the client-side equivalent of the TripleExponentialMovingAverageTrix class. + */ +interface ASPxClientTripleExponentialMovingAverageTrix extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; + /** + * Gets a value, indicating whose series point values are used to calculate the indicator's values. + * Value: A string value, which indicates which series point value should be used to calculate indicator values. + */ + valueLevel: string; +} +/** + * Represents the client-side equivalent of the WilliamsR class. + */ +interface ASPxClientWilliamsR extends ASPxSeparatePaneIndicator { + /** + * Gets the number of data points used to calculate the indicator values. + * Value: An integer value, specifying the number of points. + */ + pointsCount: number; +} +/** + * Represents the client-side equivalent of the FixedValueErrorBars class. + */ +interface ASPxClientFixedValueErrorBars extends ASPxClientIndicator { + /** + * Gets or sets the fixed positive error value. + * Value: A double value specifying the positive error value. + */ + positiveError: number; + /** + * Returns the fixed negative error value. + * Value: A double value specifying the negative error value. + */ + negativeError: number; +} +/** + * Represents the client-side equivalent of the PercentageErrorBars class. + */ +interface ASPxClientPercentageErrorBars extends ASPxClientIndicator { + /** + * Returns the value specifying the percentage of error values of series point values. + * Value: A double value specifying the percentage. Values less than or equal to 0 are not allowed. + */ + percent: number; +} +/** + * Represents the client-side equivalent of the StandardDeviationErrorBars class. + */ +interface ASPxClientStandardDeviationErrorBars extends ASPxClientIndicator { + /** + * Returns the multiplier on which the standard deviation value is multiplied before display. + * Value: A double value specifying the multiplier. Values less than 0 are not allowed. + */ + multiplier: number; +} +/** + * Represents the client-side equivalent of the StandardErrorBars class. + */ +interface ASPxClientStandardErrorBars extends ASPxClientIndicator { +} +/** + * Represents the client-side equivalent of the DataSourceBasedErrorBars class. + */ +interface ASPxClientDataSourceBasedErrorBars extends ASPxClientIndicator { +} +/** + * Represents the client-side equivalent of the Annotation class. + */ +interface ASPxClientAnnotation extends ASPxClientWebChartElementNamed { +} +/** + * Represents the client-side equivalent of the TextAnnotation class. + */ +interface ASPxClientTextAnnotation extends ASPxClientAnnotation { + /** + * Gets the lines of text within an annotation. + * Value: An array of string values containing the text of a title. + */ + lines: string[]; +} +/** + * Represents the client-side equivalent of the ImageAnnotation class. + */ +interface ASPxClientImageAnnotation extends ASPxClientAnnotation { +} +/** + * The client-side equivalent of the CrosshairValueItem class. + */ +interface ASPxClientCrosshairValueItem { + /** + * Gets the value that is displayed in a crosshair label. + * Value: A float value. + */ + value: number; + /** + * Gets an index of a point for which this crosshair value item is displayed. + * Value: An integer value. + */ + pointIndex: number; +} +/** + * The client-side equivalent of the ChartToolTipController class. + */ +interface ASPxClientToolTipController extends ASPxClientWebChartEmptyElement { + /** + * Gets a value indicating whether an image should be shown in tooltips. + * Value: true to show an image in tooltips; otherwise, false. + */ + showImage: boolean; + /** + * Gets a value indicating whether it is necessary to show text in tooltips. + * Value: true to show text in tooltips; otherwise, false. + */ + showText: boolean; + /** + * Gets a value that defines the position of an image within a tooltip. + * Value: A string value. + */ + imagePosition: string; + /** + * Gets a value that defines when tooltips should be invoked. + * Value: A string value. + */ + openMode: string; +} +/** + * The client-side equivalent of the ToolTipPosition class. + */ +interface ASPxClientToolTipPosition { +} +/** + * The client-side equivalent of the ToolTipRelativePosition class. + */ +interface ASPxClientToolTipRelativePosition extends ASPxClientToolTipPosition { + /** + * Gets the horizontal offset of a tooltip. + * Value: An integer value. + */ + offsetX: number; + /** + * Gets the vertical offset of a tooltip. + * Value: An integer value. + */ + offsetY: number; +} +/** + * The client-side equivalent of the ToolTipFreePosition class. + */ +interface ASPxClientToolTipFreePosition extends ASPxClientToolTipPosition { + /** + * Gets the horizontal offset of a tooltip. + * Value: An integer value. + */ + offsetX: number; + /** + * Gets the vertical offset of a tooltip. + * Value: An integer value. + */ + offsetY: number; + /** + * Gets the ID of a pane. + * Value: An integer value. + */ + paneID: number; + /** + * Gets an object containing settings that define how a tooltip should be docked. + * Value: A string value. + */ + dockPosition: string; +} +/** + * The client-side equivalent of the CrosshairLabelPosition class. + */ +interface ASPxClientCrosshairPosition { + /** + * Gets the horizontal offset of a crosshair cursor. + * Value: An integer value that is the X-offset. + */ + offsetX: number; + /** + * Gets the vertical offset of a crosshair cursor. + * Value: An integer value that is the Y-offset. + */ + offsetY: number; +} +/** + * The client-side equivalent of the CrosshairMousePosition class. + */ +interface ASPxClientCrosshairMousePosition extends ASPxClientCrosshairPosition { +} +/** + * The client-side equivalent of the CrosshairFreePosition class. + */ +interface ASPxClientCrosshairFreePosition extends ASPxClientCrosshairPosition { + /** + * Gets a Pane's ID when the crosshair cursor is in the free position mode. + * Value: An integer value that is the pane's ID. + */ + paneID: number; + /** + * Gets a string containing information on a crosshair label's dock position when the crosshair cursor is in the free position mode. + * Value: A string value containing information on a crosshair label's dock position. + */ + dockPosition: string; +} +/** + * Defines line style settings. + */ +interface ASPxClientLineStyle extends ASPxClientWebChartElement { + /** + * Gets the dash style used to paint the line. + * Value: A string value that contains information about the style used to paint the line. + */ + dashStyle: string; + /** + * Gets the thickness that corresponds to the value of the current ASPxClientLineStyle object. + * Value: An integer value which specifies the thickness, in pixels. + */ + thickness: number; + /** + * Returns the join style for the ends of consecutive lines. + * Value: A string representing the name of the line join type. + */ + lineJoin: string; +} +/** + * The client-side equivalent of the CrosshairOptions class. + */ +interface ASPxClientCrosshairOptions extends ASPxClientWebChartEmptyElement { + /** + * Gets a value indicating whether it is necessary to show a crosshair label for the X-axis. + * Value: true to show a crosshair label for the X-axis; otherwise, false. + */ + showAxisXLabels: boolean; + /** + * Gets a value indicating whether it is necessary to show a crosshair label for the Y-axis. + * Value: true to show the crosshair label for the Y-axis; otherwise, false. + */ + showAxisYLabels: boolean; + /** + * Gets a value that defines whether a crosshair label of a series point indicated by a crosshair cursor is shown on a diagram. + * Value: true if a crosshair label indicated by a crosshair cursor is shown on a diagram; otherwise, false. + */ + showCrosshairLabels: boolean; + /** + * Gets a value that indicates whether a crosshair cursor argument line is shown for a series point on a diagram. + * Value: true if a crosshair cursor argument line is displayed on a diagram; otherwise, false. + */ + showArgumentLine: boolean; + /** + * Specifies whether to show a value line of a series point indicated by a crosshair cursor on a diagram. + * Value: true to display a value line indicated by a crosshair cursor on a diagram; otherwise, false. + */ + showValueLine: boolean; + /** + * Gets a value that specifies whether to show a crosshair cursor in a focused pane only. + * Value: true to display a crosshair cursor in a focused pane; otherwise, false. + */ + showOnlyInFocusedPane: boolean; + /** + * Specifies the current snap mode of a crosshair cursor. + * Value: A string value. + */ + snapMode: string; + /** + * Specifies the way in which the crosshair label is shown for a series on a diagram. + * Value: A string value that specifies how the crosshair label is shown for a series. + */ + crosshairLabelMode: string; + /** + * Gets a value that indicates whether to show a header for each series group in crosshair cursor labels. + * Value: true, to show a group header in crosshair cursor labels; otherwise, false. + */ + showGroupHeaders: boolean; + /** + * Gets a string which represents the pattern specifying the group header text to be displayed within the crosshair label. + * Value: A String, which represents the group header's pattern. + */ + groupHeaderPattern: string; + /** + * Gets a value that specifies whether the Crosshair cursor should show points that are out of visual range. + * Value: true if the out of visual range points should be shown in the Crosshair label; otherwise false. + */ + showOutOfRangePoints: boolean; + /** + * Gets the identifier specifying the behavior of the selection of points shown in the crosshair label. + * Value: The selection behavior identifier. + */ + valueSelectionMode: string; + /** + * Gets the color of a crosshair argument line. + * Value: A String value, specifying the color of a crosshair argument line. + */ + argumentLineColor: string; + /** + * Gets the color of a crosshair value line. + * Value: A String value, specifying the color of a crosshair value line. + */ + valueLineColor: string; +} +/** + * The chart print options storage. + */ +interface ASPxClientChartPrintOptions { + /** + * Gets the size mode used to print a chart. + */ + GetSizeMode(): string; + /** + * Sets the size mode used to print a chart. + * @param sizeMode A System.String object, specifying the name of the size mode. + */ + SetSizeMode(sizeMode: string): void; + /** + * Gets a value indicating that the landscape orientation will be used to print a chart. + */ + GetLandscape(): boolean; + /** + * Sets a value indicating that the landscape orientation will be used to print a chart. + * @param landscape A Boolean value, specifying that the landscape orientation will be used to print a chart. + */ + SetLandscape(landscape: boolean): void; + /** + * Gets the left margin which will be used to print a chart. + */ + GetMarginLeft(): number; + /** + * Sets the left margin which will be used to print a chart. + * @param marginLeft A System.Int32 value, specifying the margin in hundredths of an inch. + */ + SetMarginLeft(marginLeft: number): void; + /** + * Gets the top margin which will be used to print a chart. + */ + GetMarginTop(): number; + /** + * Sets the top margin which will be used to print a chart. + * @param marginTop A System.Int32 value, specifying the margin in hundredths of an inch. + */ + SetMarginTop(marginTop: number): void; + /** + * Gets the right margin which will be used to print a chart. + */ + GetMarginRight(): number; + /** + * Sets the right margin which will be used to print a chart. + * @param marginRight A System.Int32 value, specifying the margin in hundredths of an inch. + */ + SetMarginRight(marginRight: number): void; + /** + * Gets the bottom margin which will be used to print a chart. + */ + GetMarginBottom(): number; + /** + * Sets the bottom margin which will be used to print a chart. + * @param marginBottom A System.Int32 value, specifying the margin in hundredths of an inch. + */ + SetMarginBottom(marginBottom: number): void; + /** + * Gets the predefined size ratio of the paper which will be used to print a chart. + */ + GetPaperKind(): string; + /** + * Sets the predefined size ratio of the paper which will be used to print a chart. + * @param paperKind A System.String object, specifying the name of a size ratio. + */ + SetPaperKind(paperKind: string): void; + /** + * Gets the custom paper width which will be used to print a chart. + */ + GetCustomPaperWidth(): number; + /** + * Sets the custom paper width which will be used to print a chart. + * @param customPaperWidth A System.Int32 object, specifying the width in hundredths of an inch. + */ + SetCustomPaperWidth(customPaperWidth: number): void; + /** + * Gets the custom paper height which will be used to print a chart. + */ + GetCustomPaperHeight(): number; + /** + * Sets the custom paper height which will be used to print a chart. + * @param customPaperHeight A System.Int32 object, specifying the height in hundredths of an inch. + */ + SetCustomPaperHeight(customPaperHeight: number): void; + /** + * Gets the name of the custom paper width-height ratio used to print the chart. + */ + GetCustomPaperName(): string; + /** + * Sets the name of the custom paper width-height ratio used to print a chart. + * @param customPaperName A String object, specifying the name of the custom paper width-height ratio. + */ + SetCustomPaperName(customPaperName: string): void; +} +/** + * Represents the client-side equivalent of the CustomLegendItem class. + */ +interface ASPxClientCustomLegendItem extends ASPxClientWebChartElementNamed { + /** + * Returns the text displayed by the custom legend item. + * Value: A string value that specifies legend item text. + */ + text: string; +} +/** + * The client-side equivalent of the ASPxDocumentViewer control. + */ +interface ASPxClientDocumentViewer extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientDocumentViewer. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs when the value of an item within the Document Viewer's report toolbar is changed. + */ + ToolbarItemValueChanged: ASPxClientEvent>; + /** + * Occurs when an item within the Document Viewer's report toolbar is clicked. + */ + ToolbarItemClick: ASPxClientEvent>; + /** + * Occurs on the client side when a report page is loaded into this ASPxClientDocumentViewer instance. + */ + PageLoad: ASPxClientEvent>; + /** + * Provides access to the Splitter of the ASPxClientDocumentViewer. + */ + GetSplitter(): ASPxClientSplitter; + /** + * Provides access to the ASPxClientDocumentViewer's preview that exposes methods to print and export the document. + */ + GetViewer(): ASPxClientReportViewer; + /** + * Provides access to the Document Viewer toolbar on the client. + */ + GetToolbar(): ASPxClientReportToolbar; + /** + * Provides access to the Ribbon of the ASPxClientDocumentViewer. + */ + GetRibbonToolbar(): ASPxClientRibbon; + /** + * Provides access to the parameters panel of the ASPxClientDocumentViewer. + */ + GetParametersPanel(): ASPxClientReportParametersPanel; + /** + * Provides access to the document of the ASPxClientDocumentViewer. + */ + GetDocumentMap(): ASPxClientReportDocumentMap; + /** + * Sets focus on the report control specified by its bookmark. + * @param pageIndex An integer value, specifying the page index. + * @param bookmarkPath A String value, specifying the path to the bookmark. + */ + GotoBookmark(pageIndex: number, bookmarkPath: string): void; + /** + * Initiates a round trip to the server so that the current page will be reloaded. + */ + Refresh(): void; + /** + * Prints the current document. + */ + Print(): void; + /** + * Prints the document's page with the specified page index. + * @param pageIndex A Int32 representing the index of the page to be printed. + */ + Print(pageIndex: number): void; + /** + * Displays the specified report page. + * @param pageIndex An integer value, identifying the report page. + */ + GotoPage(pageIndex: number): void; + /** + * Invokes the Search dialog, which allows end-users to search for specific text in a report. + */ + Search(): void; + /** + * Gets a value indicating whether or not searching text across a report is permitted in the web browser. + */ + IsSearchAllowed(): boolean; + /** + * Exports a report to a file of the specified format, and shows it in a new Web Browser window. + * @param format A string specifying the format to which a report should be exported. + */ + SaveToWindow(format: string): void; + /** + * Exports a report to a file of the specified format, and saves it to the disk. + * @param format A string specifying the format to which a report should be exported. + */ + SaveToDisk(format: string): void; +} +/** + * A method that will handle the ItemValueChanged event. + */ +interface ASPxClientToolbarItemValueChangedEventHandler { + /** + * A method that will handle the ToolbarItemValueChanged event. + * @param source A Object that is the event source. + * @param e An ASPxClientToolbarItemValueChangedEventArgs object, containing the event arguments. + */ + (source: S, e: ASPxClientToolbarItemValueChangedEventArgs): void; +} +/** + * Provides data for the ItemValueChanged event. + */ +interface ASPxClientToolbarItemValueChangedEventArgs extends ASPxClientProcessingModeEventArgs { + /** + * Gets the menu item object related to the event. + * Value: An ASPxClientMenuItem object, manipulations on which forced the event to be raised. + */ + item: ASPxClientMenuItem; + /** + * Provides access to the toolbar's value editor on the client. + * Value: An ASPxClientControl descendant. + */ + editor: ASPxClientControl; +} +/** + * The client-side equivalent of the ASPxQueryBuilder control. + */ +interface ASPxClientQueryBuilder extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientQueryBuilder. + */ + CallbackError: ASPxClientEvent>; + /** + * Enables you to customize the menu actions of a Query Builder. + */ + CustomizeToolbarActions: ASPxClientEvent>; + /** + * Occurs when executing the Save command on the client. + */ + SaveCommandExecute: ASPxClientEvent>; + /** + * Sends a callback to the server with the specified argument. + * @param arg A String value, specifying the callback argument. + */ + PerformCallback(arg: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(arg: string, onSuccess: (arg1: string) => void): void; + /** + * Updates the localization settings of the ASPxClientQueryBuilder properties. + * @param localization A dictionary containing the property names, along with their localized equivalents. + */ + UpdateLocalization(localization: { [key: string]: string; }): void; + /** + * Returns the object model of a Query Builder. + */ + GetDesignerModel(): Object; + /** + * Gets a client-side model of the currently opened query serialized to Json. + */ + GetJsonQueryModel(): string; + /** + * Saves the current query. + */ + Save(): void; + /** + * Invokes a Data Preview for the current query. + */ + ShowPreview(): void; + /** + * Specifies whether or not the current query is a valid SQL string. + */ + IsQueryValid(): boolean; +} +/** + * A method that will handle the SaveCommandExecute event. + */ +interface ASPxClientQueryBuilderSaveCommandExecuteEventHandler { + /** + * A method that will handle the SaveCommandExecute event. + * @param source The event sender. + * @param e An ASPxClientQueryBuilderSaveCommandExecuteEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientQueryBuilderSaveCommandExecuteEventArgs): void; +} +/** + * Provides data for the SaveCommandExecute event. + */ +interface ASPxClientQueryBuilderSaveCommandExecuteEventArgs extends ASPxClientEventArgs { + /** + * Specifies whether or not the event was handled. + * Value: true if the event was handled and default processing should not occur; false if the event should be handled using default processing. + */ + handled: boolean; +} +/** + * A method that will handle the CustomizeToolbarActions event. + */ +interface ASPxClientQueryBuilderCustomizeToolbarActionsEventHandler { + /** + * A method that will handle the CustomizeToolbarActions event. + * @param source The event sender. + * @param e An ASPxClientCustomizeMenuActionsEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeMenuActionsEventArgs): void; +} +/** + * The client-side equivalent of the Web Report Designer control. + */ +interface ASPxClientReportDesigner extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientReportDesigner. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs when executing the Save command on the client. + */ + SaveCommandExecute: ASPxClientEvent>; + /** + * Enables you to customize the menu actions of the Web Report Designer. + */ + CustomizeMenuActions: ASPxClientEvent>; + /** + * Occurs each time a standard editor is created for a report parameter based on a parameter type. + */ + CustomizeParameterEditors: ASPxClientEvent>; + /** + * Occurs each time a look-up editor is created for a report parameter. + */ + CustomizeParameterLookUpSource: ASPxClientEvent>; + /** + * Occurs on the client side when the Report Designer is being closed. + */ + ExitDesigner: ASPxClientEvent>; + /** + * Occurs when a report is about to be saved in the Web Report Designer. + */ + ReportSaving: ASPxClientEvent>; + /** + * Occurs when a report has been saved in the Web Report Designer. + */ + ReportSaved: ASPxClientEvent>; + /** + * Occurs when a report is about to be opened in the Web Report Designer. + */ + ReportOpening: ASPxClientEvent>; + /** + * Occurs when a report has been opened in the Web Report Designer. + */ + ReportOpened: ASPxClientEvent>; + /** + * Occurs on the client each time a server-side error raises. + */ + OnServerError: ASPxClientEvent>; + /** + * Occurs after a component has been added to the report currently being edited in the Web Report Designer. + */ + ComponentAdded: ASPxClientEvent>; + /** + * Enables you to customize UI elements of the Web Report Designer. + */ + CustomizeElements: ASPxClientEvent>; + /** + * Enables you to customize the Save dialog of the Web Report Designer. + */ + CustomizeSaveDialog: ASPxClientEvent>; + /** + * Enables you to customize the Save Report dialog of the Web Report Designer. + */ + CustomizeSaveAsDialog: ASPxClientEvent>; + /** + * Enables you to customize the Open Report dialog of the Web Report Designer. + */ + CustomizeOpenDialog: ASPxClientEvent>; + /** + * Enables you to customize the Toolbox of the Web Report Designer. + */ + CustomizeToolbox: ASPxClientEvent>; + /** + * Occurs after a report has been switched to Print Preview. + */ + PreviewDocumentReady: ASPxClientEvent>; + /** + * Occurs each time a value of an editing field changes in Print Preview. + */ + PreviewEditingFieldChanged: ASPxClientEvent>; + /** + * Enables you to customize UI elements of a Document Viewer built into a Web Report Designer. + */ + PreviewCustomizeElements: ASPxClientEvent>; + /** + * Enables you to customize the actions of a Document Viewer built into a Web Report Designer. + */ + PreviewCustomizeMenuActions: ASPxClientEvent>; + /** + * Occurs when the left mouse button has been clicked over a report document in Print Preview. + */ + PreviewClick: ASPxClientEvent>; + /** + * Occurs after report parameter values have been reset to their default values in Print Preview. + */ + PreviewParametersReset: ASPxClientEvent>; + /** + * Occurs after report parameter values have been submitted in Print Preview. + */ + PreviewParametersSubmitted: ASPxClientEvent>; + /** + * Sends a callback to the server with the specified argument. + * @param arg A String value, specifying the callback argument. + */ + PerformCallback(arg: string): void; + /** + * Sends a callback to the server and generates the server-side event, passing it the specified argument. + * @param arg A string value that represents any information that needs to be sent to the server-side event. + * @param onSuccess A client action to perform if the server round-trip completed successfully. + */ + PerformCallback(arg: string, onSuccess: (arg1: string) => void): void; + /** + * Updates the localization settings of the ASPxClientReportDesigner properties. + * @param localization A dictionary containing the property names, along with their localized equivalents. + */ + UpdateLocalization(localization: { [key: string]: string; }): void; + /** + * Returns the object model of a Web Report Designer. + */ + GetDesignerModel(): Object; + /** + * Provides access to the preview model of the ASPxClientReportDesigner. + */ + GetPreviewModel(): Object; + /** + * Returns information about the specified property of the specified control. + * @param controlType A string that specifies the control type. + * @param path A string that specifies the path to the property. + */ + GetPropertyInfo(controlType: string, path: string): ASPxDesignerElementSerializationInfo; + /** + * Returns information about the specified properties of the specified control. + * @param controlType A string that specifies the control type. + * @param path An array of strings that specify paths to properties. + */ + GetPropertyInfo(controlType: string, path: string[]): ASPxDesignerElementSerializationInfo; + /** + * Returns actions performed by buttons available in the menu and toolbar of the Web Report Designer. + */ + GetButtonStorage(): Object; + /** + * Gets a client-side model of the currently opened report serialized to Json. + */ + GetJsonReportModel(): string; + /** + * Indicates whether or not the current ASPxClientReportDesigner instance has been modified. + */ + IsModified(): boolean; + /** + * Resets the value returned by the IsModified method. + */ + ResetIsModified(): void; + /** + * Adds a custom property to the Properties Panel. + * @param groupName A string that specifies the name of group to which a property should be added. + * @param property An object that provides information required to serialize a property. + */ + AddToPropertyGrid(groupName: string, property: ASPxDesignerElementSerializationInfo): void; + /** + * Adds a custom parameter type to the Web End-User Report Designer. + * @param parameterInfo An object that provides information about a parameter type to be added. + * @param editorOptions An object that provides information about an editor used to specify parameter values in design mode. + */ + AddParameterType(parameterInfo: ASPxDesignerParameterType, editorOptions: ASPxDesignerEditorOptions): void; + /** + * Removes the specified parameter type from the Web End-User Report Designer. + * @param parameterType A string that specifies a parameter type to be deleted. + */ + RemoveParameterType(parameterType: string): void; + /** + * Returns an object that contains information on the specified parameter type. + * @param parameterType A string that specifies a parameter type. + */ + GetParameterInfo(parameterType: string): ASPxDesignerParameterType; + /** + * Returns a value editor associated with the specified parameter type. + * @param parameterType A string that specifies a parameter type. + */ + GetParameterEditor(parameterType: string): ASPxDesignerEditorOptions; + /** + * Returns the report layout stored in a report storage under the specified URL. + * @param url A string that specifies the report URL. + */ + ReportStorageGetData(url: string): any; + /** + * Stores the specified report to a report storage using the specified URL. + * @param reportLayout A string that specifies the report layout to be saved. + * @param url A string that specifies the URL used to save a report. + */ + ReportStorageSetData(reportLayout: string, url: string): any; + /** + * Stores the specified report to a report storage using a new URL. + * @param reportLayout A string that specifies the report layout to be saved. + * @param url A string that specifies the default report URL. + */ + ReportStorageSetNewData(reportLayout: string, url: string): any; + /** + * Saves the current report. + */ + SaveReport(): any; + /** + * Closes the report tab currently being opened in the Web Report Designer. + */ + CloseCurrentTab(): void; + /** + * Saves the current report under a new name. + * @param reportName A string that specifies the report name. + */ + SaveNewReport(reportName: string): any; + /** + * Returns the report URLs and display names existing in a report storage. + */ + ReportStorageGetUrls(): any; + /** + * Opens the specified report on the client side of the Web Report Designer. + * @param url A string that specifies the URL of a report to be opened. + */ + OpenReport(url: string): void; + /** + * Switches the Web Report Designer to the preview mode. + */ + ShowPreview(): void; +} +/** + * A method that will handle the SaveCommandExecute event. + */ +interface ASPxClientReportDesignerSaveCommandExecuteEventHandler { + /** + * A method that will handle the SaveCommandExecute event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerSaveCommandExecuteEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerSaveCommandExecuteEventArgs): void; +} +/** + * Provides data for the SaveCommandExecute event. + */ +interface ASPxClientReportDesignerSaveCommandExecuteEventArgs extends ASPxClientEventArgs { + /** + * Specifies whether or not the event was handled. + * Value: true if the event was handled and default processing should not occur; false if the event should be handled using default processing. + */ + handled: boolean; +} +/** + * Provides data for the ExitDesigner event. + */ +interface ASPxClientReportDesignerExitDesignerEventArgs extends ASPxClientEventArgs { +} +/** + * Provides data for the events related to opening and saving reports in the Web Report Designer. + */ +interface ASPxClientReportDesignerDialogEventArgs extends ASPxClientEventArgs { + /** + * Specifies the URL of the report currently being processed. + * Value: A string that specifies the URL of the report currently being processed. + */ + Url: string; + /** + * Specifies the report currently being processed. + * Value: An object that specifies the report currently being processed. + */ + Report: Object; + /** + * Specifies whether or not the operation performed with a report should be canceled. + * Value: true, if the operation should be canceled; otherwise, false. + */ + Cancel: boolean; +} +/** + * Provides data for the OnServerError event. + */ +interface ASPxClientReportDesignerErrorEventArgs extends ASPxClientEventArgs { + /** + * Provides access to information about a server-side error. + * Value: An object that provides information about an error. + */ + Error: Object; +} +/** + * Provides data for the ComponentAdded event. + */ +interface ASPxClientReportDesignerComponentAddedEventArgs extends ASPxClientEventArgs { + /** + * Gets the model of a component that has been added to a report. + * Value: An object that specifies the component model. + */ + Model: Object; + /** + * Gets the parent of a component that has been added to a report. + * Value: An object that specifies the component parent. + */ + Parent: Object; +} +/** + * Provides data for the CustomizeSaveDialog event. + */ +interface ASPxClientReportDesignerCustomizeSaveDialogEventArgs extends ASPxClientEventArgs { + /** + * Provides access to the Save dialog. + * Value: An object that specifies the Save dialog. + */ + Popup: ASPxDesignerSaveDialog; + /** + * Customizes the Save dialog based on the specified template and model. + * @param template A string that specifies the name of an HTML template for the dialog. + * @param model A model of the Save dialog. + */ + Customize(template: string, model: ASPxDesignerDialogModel): void; +} +/** + * Provides data for the CustomizeSaveAsDialog event. + */ +interface ASPxClientReportDesignerCustomizeSaveAsDialogEventArgs extends ASPxClientEventArgs { + /** + * Provides access to the Save Report dialog. + * Value: An object that specifies the Save Report dialog. + */ + Popup: ASPxDesignerSaveAsDialog; + /** + * Customizes the Save Report dialog based on the specified template and model. + * @param template A string that specifies the name of an HTML template for the dialog. + * @param model A model of the Save Report dialog. + */ + Customize(template: string, model: ASPxDesignerDialogModel): void; +} +/** + * Provides data for the CustomizeOpenDialog event. + */ +interface ASPxClientReportDesignerCustomizeOpenDialogEventArgs extends ASPxClientEventArgs { + /** + * Provides access to the Open Report dialog. + * Value: An object that specifies the Open Report dialog. + */ + Popup: ASPxDesignerOpenDialog; + /** + * Customizes the Open Report dialog based on the specified template and model. + * @param template A string that specifies the name of an HTML template for the dialog. + * @param model A model of the Open Report dialog. + */ + Customize(template: string, model: ASPxDesignerDialogModel): void; +} +/** + * Provides data for the CustomizeToolbox event. + */ +interface ASPxClientReportDesignerCustomizeToolboxEventArgs extends ASPxClientEventArgs { + /** + * Provides information about all controls available in the Toolbox. + * Value: An ASPxDesignerControlsFactory object that provides information about toolbox controls. + */ + ControlsFactory: ASPxDesignerControlsFactory; +} +/** + * A method that will handle the CustomizeMenuActions event. + */ +interface ASPxClientReportDesignerCustomizeMenuActionsEventHandler { + /** + * A method that will handle the CustomizeMenuActions event. + * @param source The event sender. + * @param e An ASPxClientCustomizeMenuActionsEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeMenuActionsEventArgs): void; +} +/** + * A method that will handle the CustomizeParameterLookUpSource event. + */ +interface ASPxClientReportDesignerCustomizeParameterLookUpSourceEventHandler { + /** + * A method that will handle the CustomizeParameterLookUpSource event. + * @param source The event sender. + * @param e An ASPxClientCustomizeParameterLookUpSourceEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeParameterLookUpSourceEventArgs): void; +} +/** + * A method that will handle the CustomizeParameterEditors event. + */ +interface ASPxClientReportDesignerCustomizeParameterEditorsEventHandler { + /** + * A method that will handle the CustomizeParameterEditors event. + * @param source The event sender. + * @param e An ASPxClientCustomizeParameterEditorsEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeParameterEditorsEventArgs): void; +} +/** + * A method that will handle the CustomizeElements event. + */ +interface ASPxClientReportDesignerCustomizeElementsEventHandler { + /** + * A method that will handle the CustomizeElements event. + * @param source The event sender. + * @param e An ASPxClientCustomizeElementsEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeElementsEventArgs): void; +} +/** + * A method that will handle the ExitDesigner event. + */ +interface ASPxClientReportDesignerExitDesignerEventHandler { + /** + * A method that will handle the ExitDesigner event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerExitDesignerEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerExitDesignerEventArgs): void; +} +/** + * A method that will handle the ReportSaving event. + */ +interface ASPxClientReportDesignerReportSavingEventHandler { + /** + * A method that will handle the ReportSaving event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerDialogEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerDialogEventArgs): void; +} +/** + * A method that will handle the ReportSaved event. + */ +interface ASPxClientReportDesignerReportSavedEventHandler { + /** + * A method that will handle the ReportSaved event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerDialogEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerDialogEventArgs): void; +} +/** + * A method that will handle the ReportOpening event. + */ +interface ASPxClientReportDesignerReportOpeningEventHandler { + /** + * A method that will handle the ReportOpening event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerDialogEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerDialogEventArgs): void; +} +/** + * A method that will handle the ReportOpened event. + */ +interface ASPxClientReportDesignerReportOpenedEventHandler { + /** + * A method that will handle the ReportOpened event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerDialogEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerDialogEventArgs): void; +} +/** + * A method that will handle the OnServerError event. + */ +interface ASPxClientReportDesignerErrorEventHandler { + /** + * A method that will handle the OnServerError event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerErrorEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerErrorEventArgs): void; +} +/** + * A method that will handle the ComponentAdded event. + */ +interface ASPxClientReportDesignerComponentAddedEventHandler { + /** + * A method that will handle the ComponentAdded event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerComponentAddedEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerComponentAddedEventArgs): void; +} +/** + * A method that will handle the CustomizeSaveDialog event. + */ +interface ASPxClientReportDesignerCustomizeSaveDialogEventHandler { + /** + * A method that will handle the CustomizeSaveDialog event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerCustomizeSaveDialogEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerCustomizeSaveDialogEventArgs): void; +} +/** + * A method that will handle the CustomizeSaveAsDialog event. + */ +interface ASPxClientReportDesignerCustomizeSaveAsDialogEventHandler { + /** + * A method that will handle the CustomizeSaveAsDialog event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerCustomizeSaveAsDialogEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerCustomizeSaveAsDialogEventArgs): void; +} +/** + * A method that will handle the CustomizeOpenDialog event. + */ +interface ASPxClientReportDesignerCustomizeOpenDialogEventHandler { + /** + * A method that will handle the CustomizeOpenDialog event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerCustomizeOpenDialogEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerCustomizeOpenDialogEventArgs): void; +} +/** + * A method that will handle the CustomizeToolbox event. + */ +interface ASPxClientReportDesignerCustomizeToolboxEventHandler { + /** + * A method that will handle the CustomizeToolbox event. + * @param source The event sender. + * @param e An ASPxClientReportDesignerCustomizeToolboxEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportDesignerCustomizeToolboxEventArgs): void; +} +/** + * Provides information about a value editor used in the Property Grid. + */ +interface ASPxDesignerEditorOptions { + /** + * Provides access to the name of an HTML template specifying the editor and header of a complex object. + * Value: A string that specifies the HTML template. + */ + header: string; + /** + * Provides access to the name of an HTML template used by a complex object's editor. + * Value: A string that specifies the name of an HTML template. + */ + content: string; + /** + * Provides access to the type of the editor model. + * Value: An object that specifies the editor type. + */ + editorType: Object; +} +/** + * Provides functionality to an undo/redo engine in the Web Report Designer. + */ +interface ASPxDesignerUndoEngine { + /** + * Provides access to a value that specifies whether or not the redo action can currently be performed. + * Value: A knockout observable boolean object, whose value is true if the redo action can be performed, and false otherwise. + */ + redoEnabled: any; + /** + * Provides access to a value that specifies whether or not the undo action can currently be performed. + * Value: A knockout observable boolean object, whose value is true if the undo action can be performed, and false otherwise. + */ + undoEnabled: any; + /** + * Provides access to a value that specifies whether or not a report has been changed. + * Value: A knockout observable boolean object, whose value is true if the report has been modified, and false otherwise. + */ + isDirty: any; + /** + * Undoes all changes made to a report. + */ + undoAll(): void; + /** + * Clears information about edit operations made to a report, so they cannot not be undone. + */ + clearHistory(): void; + /** + * Undoes the last edit action in a report. + */ + undo(): void; + /** + * Reverses the results of the last undo action. + */ + redo(): void; +} +/** + * Provides functionality for a tab displayed a report in the Web Report Designer. + */ +interface ASPxDesignerNavigateTab { + /** + * Provides access to a value that specifies the display name of the current tab. + * Value: A knockout computed string that specifies the tab's display name. + */ + displayName: any; + /** + * Provides access to a value that specifies whether or not the report in the current tab has been changed. + * Value: A knockout computed boolean object, whose value is true if the report has been modified, and false otherwise. + */ + isDirty: any; + /** + * Provides access to a report opened in the current tab. + * Value: A knockout observable object that specifies a report opened in the current tab. + */ + report: any; + /** + * Provides access to an engine that manages undo and redo operations in the Web Report Designer. + * Value: An object that specifies an undo/redo engine. + */ + undoEngine: ASPxDesignerUndoEngine; + /** + * Provides access to the URL of a report opened in the current tab. + * Value: A knockout observable string that specifies the report URL. + */ + url: any; +} +/** + * A model of dialogs used to save and open reports in the Web Report Designer. + */ +interface ASPxDesignerDialogModel { + /** + * Provides access to the collection of buttons displayed in a dialog. + * Value: An array of objects that specify buttons displayed in a dialog. + */ + popupButtons: Object[]; + /** + * Specifies a function that gets the report URL. + */ + getUrl(): string; + /** + * Specifies a function that sets the report URL. + * @param url A string that specifies the report URL. + */ + setUrl(url: string): void; + /** + * Specifies a function to be executed when showing a dialog. + * @param tab An object that specifies the report tab for which a dialog is invoked. + */ + onShow(tab: ASPxDesignerNavigateTab): void; +} +/** + * Provides the base functionality for dialogs used to open and save reports on the client side of the Web Report Designer. + */ +interface ASPxDesignerReportDialogBase { + /** + * Provides access to a dialog's width. + * Value: A knockout observable object that specifies a dialog's width. + */ + width: any; + /** + * Provides access to a dialog's height. + * Value: A knockout observable object that specifies a dialog's height. + */ + height: any; + /** + * Provides access to the name of an HTML template used by a dialog. + * Value: A knockout observable string that specifies the name of the HTML template used by a dialog. + */ + template: any; + /** + * Provides access to buttons displayed in a dialog. + * Value: An array of objects that specify buttons displayed in the dialog. + */ + buttons: Object[]; + /** + * Provides access to a dialog's model. + * Value: A knockout observable object of the ASPxDesignerDialogModel type. + */ + model: any; + /** + * Provides access to a report tab for which a dialog appears. + * Value: A knockout observable object of the ASPxDesignerNavigateTab type. + */ + tab: any; + /** + * Provides access to a value that specifies a dialog's visibility state. + * Value: true, if the dialog is visible; otherwise, false; + */ + visible: any; + /** + * Provides access to a dialog's title. + * Value: A string that specifies a dialog's title. + */ + title: string; + /** + * Shows the dialog for the specified report tab. + * @param tab A report tab for which the dialog should be shown. + */ + show(tab: ASPxDesignerNavigateTab): void; + /** + * Customizes the dialog based on the specified template and model. + * @param template A string that specifies the name of an HTML template for the dialog. + * @param model An object that specifies the dialog model. + */ + customize(template: string, model: ASPxDesignerDialogModel): void; + /** + * Cancels the dialog. + */ + cancel(): void; +} +/** + * Provides functionality for the Save dialog on the client side of the Web Report Designer. + */ +interface ASPxDesignerSaveDialog extends ASPxDesignerReportDialogBase { + /** + * Provides access to the Save Report dialog that appears if a user selected to save changes in the Save dialog. + * Value: An object that specifies the Save As dialog. + */ + saveReportDialog: ASPxDesignerSaveAsDialog; + /** + * Saves the report with the specified URL. + * @param url A string that specifies an URL of the report to be saved. + */ + save(url: string): void; + /** + * Closes the dialog without saving the current report. + */ + notSave(): void; +} +/** + * Provides functionality for the Save Report dialog on the client side of the Web Report Designer. + */ +interface ASPxDesignerSaveAsDialog extends ASPxDesignerReportDialogBase { + /** + * Saves the report with the specified URL. + * @param url A string that specifies a URL of the report to be saved. + */ + save(url: string): void; +} +/** + * Provides functionality for the Open Report dialog on the client side of the Web Report Designer. + */ +interface ASPxDesignerOpenDialog extends ASPxDesignerReportDialogBase { + /** + * Opens the report with the specified URL. + * @param url A string that specifies an URL of the report to be opened. + */ + open(url: string): void; +} +/** + * Provides information about a toolbox control item. + */ +interface ASPxDesignerToolboxItem { + /** + * Provides access to information required to serialize a toolbox control. + * Value: An array of ASPxDesignerElementSerializationInfo objects that provide information required to serialize an element. + */ + info: ASPxDesignerElementSerializationInfo[]; + /** + * Provides access to a surface type of toolbox control. + * Value: A surface type of toolbox control. + */ + surfaceType: any; + /** + * Provides access to a toolbox control type. + * Value: A toolbox control type. + */ + type: any; + /** + * Provides access to a zero-based index of a control in the toolbox. + * Value: An integer value that specifies a control index in the toolbox. + */ + toolboxIndex: number; + /** + * Provides access to the default property values used for a toolbox control. + * Value: An object that specifies default propery values. + */ + defaultVal: Object; + /** + * Provides access to popular properties of a toolbox control. + * Value: An array of strings that specify names of popular properties. + */ + popularProperties: string[]; + /** + * Gets whether a control item is displayed in a toolbox. + * Value: true, if the control is available in the toolbox; otherwise, false. + */ + isToolboxItem: boolean; +} +/** + * Enables you to customize controls available in the Toolbox of the Web Report Designer. + */ +interface ASPxDesignerControlsFactory { + /** + * Returns information about the specified toolbox control. + * @param controlType A string that specifies the control type. + */ + getControlInfo(controlType: string): ASPxDesignerToolboxItem; + /** + * Returns a control type by the specified model. + * @param model An object that specifies the control model. + */ + getControlType(model: Object): string; + /** + * Registers the specified control in the Toolbox of the Web Report Designer. + * @param typeName A string that specifies the name of a custom control. + * @param metadata An ASPxDesignerToolboxItem object that provides information about a toolbox item. + */ + registerControl(typeName: string, metadata: ASPxDesignerToolboxItem): void; + /** + * Returns information about the specified property of the specified control. + * @param controlType A string that specifies the control type. + * @param propertyDisplayName A string that specifies the property display name. + */ + getPropertyInfo(controlType: string, propertyDisplayName: string): ASPxDesignerElementSerializationInfo; +} +/** + * Provides information about a report parameter type. + */ +interface ASPxDesignerParameterType { + /** + * Provides access to an actual parameter type. + * Value: A string that specifies the parameter type. + */ + value: string; + /** + * Provides access to a text displayed to end-users when creating parameters of the current type. + * Value: A string displayed to end-users. + */ + displayValue: string; + /** + * Provides access to the default value for parameters of the current type. + * Value: An object that specifies the default value. + */ + defaultVal: Object; + /** + * Provides access to the specifics of a current parameter type. + * Value: Parameter type specifics. + */ + specifics: string; + /** + * Converts the specified parameter value to the current parameter type. + * @param val An object that specifies the parameter value to be converted. + */ + valueConverter(val: Object): Object; +} +/** + * The client-side equivalent of the ASPxClientDocumentViewer control's Document Map. + */ +interface ASPxClientReportDocumentMap extends ASPxClientControl { + /** + * Occurs after the content of the Document Viewer's document map is updated. + */ + ContentChanged: ASPxClientEvent>; +} +/** + * The client-side equivalent of the ASPxClientDocumentViewer control's Parameters Panel. + */ +interface ASPxClientReportParametersPanel extends ASPxClientControl { + /** + * Assigns a value to a parameter of the report displayed in the document viewer. + * @param parametersInfo An array of ASPxClientReportParameterInfo values specifying parameters and values to assign. + */ + AssignParameters(parametersInfo: ASPxClientReportParameterInfo[]): void; + /** + * Assigns a value to a parameter of the report displayed in the document viewer. + * @param path A System.String specifying the parameter's path. + * @param value An object specifying the parameter value. + */ + AssignParameter(path: string, value: Object): void; + /** + * Returns an array storing the names of parameters available in a report. + */ + GetParameterNames(): string[]; + /** + * Returns a value editor that is associated with a parameter with the specified name. + * @param parameterName A String value, specifying the parameter name. + */ + GetEditorByParameterName(parameterName: string): ASPxClientControl; +} +/** + * Provides information about a report parameter on the client side. + */ +interface ASPxClientReportParameterInfo { + /** + * Specifies the parameter path, relative to its parent container (e.g., "subreport1.subreportParameter1" for a subreport's parameter, or "parameter1" for a report's parameter). + * Value: A String value, specifying the parameter path (e.g., "subreport1.subreportParameter1"). + */ + Path: string; + /** + * Provides access to a parameter value on the client. + * Value: A Object value. + */ + Value: Object; +} +/** + * The client-side equivalent of the ASPxClientDocumentViewer control's toolbar. + */ +interface ASPxClientReportToolbar extends ASPxClientControl { + /** + * Provides access to the control template assigned for the specified menu item. + * @param name A String value, specifying the menu item name. + */ + GetItemTemplateControl(name: string): ASPxClientControl; +} +/** + * The client-side equivalent of the ReportViewer. + */ +interface ASPxClientReportViewer extends ASPxClientControl { + /** + * Occurs when a callback for server-side processing is initiated. + */ + BeginCallback: ASPxClientEvent>; + /** + * Occurs on the client after a callback's server-side processing has been completed. + */ + EndCallback: ASPxClientEvent>; + /** + * Fires on the client if any server error occurs during server-side processing of a callback sent by the ASPxClientReportViewer. + */ + CallbackError: ASPxClientEvent>; + /** + * Occurs on the client side when another report page is loaded into this ASPxClientReportViewer instance. + */ + PageLoad: ASPxClientEvent>; + /** + * Submits the values of the specified parameters. + * @param parameters A dictionary containing the parameter names, along with their Object values. + */ + SubmitParameters(parameters: { [key: string]: Object; }): void; + /** + * Prints a report shown in the ReportViewer. + */ + Print(): void; + /** + * Prints a report page with the specified page index. + * @param pageIndex An integer value which specifies an index of the page to be printed. + */ + Print(pageIndex: number): void; + /** + * Displays a report page with the specified page index in the ReportViewer. + * @param pageIndex An integer value which specifies the index of a page to be displayed. + */ + GotoPage(pageIndex: number): void; + /** + * Initiates a round trip to the server so that the current page will be reloaded. + */ + Refresh(): void; + /** + * Invokes the Search dialog, which allows end-users to search for specific text in a report. + */ + Search(): void; + /** + * Exports a report to a file of the specified format, and shows it in a new Web Browser window. + * @param format A string specifying the format, to which a report should be exported. + */ + SaveToWindow(format: string): void; + /** + * Exports a report to a file of the specified format, and saves it to the disk. + * @param format A string specifying the format, to which a report should be exported. + */ + SaveToDisk(format: string): void; + /** + * Gets a value indicating whether or not searching text across a report is permitted in the web browser. + */ + IsSearchAllowed(): boolean; +} +/** + * A method that will handle the PageLoad events. + */ +interface ASPxClientReportViewerPageLoadEventHandler { + /** + * A method that will handle the PageLoad event. + * @param source The event sender. + * @param e An ASPxClientReportViewerPageLoadEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientReportViewerPageLoadEventArgs): void; +} +/** + * Provides data for the PageLoad events on the client side. + */ +interface ASPxClientReportViewerPageLoadEventArgs extends ASPxClientEventArgs { + /** + * Gets a value specifying a zero-based index of a page to be displayed in a report viewer. + * Returns: $ + */ + PageIndex: number; + /** + * Gets a value specifying the total number of pages displayed in a report viewer. + * Returns: $ + */ + PageCount: number; + /** + * Gets a value indicating whether a report page, which is currently loaded into the ASPxClientReportViewer, is the first page of a report. + */ + IsFirstPage(): boolean; + /** + * Gets a value indicating whether a report page, which is currently loaded into the ASPxClientReportViewer, is the last page of a report. + */ + IsLastPage(): boolean; +} +/** + * Provides data for the CustomizeParameterEditors events. + */ +interface ASPxClientCustomizeParameterEditorsEventArgs extends ASPxClientEventArgs { + /** + * Provides access to an object that stores information about a parameter. + * Value: An ASPxDesignerElementParameterDescriptor object. + */ + parameter: ASPxDesignerElementParameterDescriptor; + /** + * Provides access to an object that stores information required to serialize a parameter editor. + * Value: An ASPxDesignerElementSerializationInfo object. + */ + info: ASPxDesignerElementSerializationInfo; +} +/** + * Provides data for the CustomizeParameterLookUpSource events. + */ +interface ASPxClientCustomizeParameterLookUpSourceEventArgs extends ASPxClientEventArgs { + /** + * Provides access to an object that stores information about a parameter. + * Value: An ASPxDesignerElementParameterDescriptor object that stores information about the parameter. + */ + parameter: ASPxDesignerElementParameterDescriptor; + /** + * Provides access to the collection of look-up parameter values. + * Value: An array of ASPxDesignerElementEditorItem objects that store information about look-up parameter values. + */ + items: ASPxDesignerElementEditorItem[]; + /** + * Specifies the data source that provides look-up values for the parameter editor. + * Value: An Object specifying the data source that provides look-up values to the parameter editor. + */ + dataSource: Object; +} +/** + * Provides information about a command available in the toolbar or menu. + */ +interface ASPxClientMenuAction { + /** + * Provides access to the text for the command. + * Value: A string that is the command text. + */ + text: string; + /** + * Provides access to the CSS class of the command's glyph. + * Value: A string that specifies the name of the CSS class. + */ + imageClassName: string; + /** + * Provides access to the action performed when a button is clicked. + * Value: The specific action implementation. + */ + clickAction: Function; + /** + * Provides access to the value that specifies whether or not the command is disabled by default. + * Value: true, if the command is disabled by default; otherwise, false. + */ + disabled: boolean; + /** + * Provides access to the value that specifies whether or not the command is visible in the user interface. + * Value: true if the command is visible; otherwise false. + */ + visible: boolean; + /** + * Provides access to the keyboard shortcut used to invoke the command. + * Value: An ASPxClientMenuActionHotKey object that specifies the keyboard shortcut. + */ + hotKey: ASPxClientMenuActionHotKey; + /** + * Provides access to the value that specifies whether or not the command has a visual separator. + * Value: true, if the command has a visual separator; otherwise, false. + */ + hasSeparator: string; + /** + * Provides access to a value that specifies the command location. + * Value: A string that specifies the command location. + */ + container: string; +} +/** + * Provides information about a hot key used to perform an action assigned to a menu item. + */ +interface ASPxClientMenuActionHotKey { + /** + * Provides access to a hot key code. + * Value: An integer value that specifies the hot key code. + */ + keyCode: number; + /** + * Provides access to a value that specifies whether the CTRL key is used in combination with a hot key. + * Value: true, if the CTRL key is included into the key combination; otherwise, false. + */ + ctrlKey: boolean; +} +/** + * Provides data for the CustomizeMenuActions. + */ +interface ASPxClientCustomizeMenuActionsEventArgs extends ASPxClientEventArgs { + /** + * Provides access to the collection of actions available in the toolbar and menu. + * Value: An array of ASPxClientMenuAction objects. + */ + Actions: ASPxClientMenuAction[]; + /** + * Returns a menu action with the specified ID. + * @param actionId A String value that specifies the action ID. + */ + GetById(actionId: string): ASPxClientMenuAction; +} +/** + * Provides data for the CustomizeElements events. + */ +interface ASPxClientCustomizeElementsEventArgs extends ASPxClientEventArgs { + /** + * Provides access to the collection of UI elements. + * Value: An array of the ASPxReportUIElement objects. + */ + Elements: ASPxReportUIElement[]; + /** + * Returns UI elements with the specified ID. + * @param templateId A string that specifies the element ID. + */ + GetById(templateId: string): ASPxReportUIElement[]; +} +/** + * Provides general information about a report parameter. + */ +interface ASPxDesignerElementParameterDescriptor { + /** + * Provides access to the parameter description. + * Value: A String value, specifying the parameter description. + */ + description: string; + /** + * Provides access to the parameter name. + * Value: A String value, specifying the parameter name. + */ + name: string; + /** + * Provides access to the parameter type. + * Value: A String value, specifying the parameter type. + */ + type: string; + /** + * Provides access to the parameter value. + * Value: A Object, specifying the parameter value. + */ + value: Object; + /** + * Provides access to the parameter visibility state. + * Value: true if the parameter is visible; otherwise false. + */ + visible: boolean; +} +/** + * Provides information required to serialize an element. + */ +interface ASPxDesignerElementSerializationInfo { + /** + * Gets the property name that will be used in the model to store the property value. + * Value: A String value. + */ + propertyName: string; + /** + * Gets the property name in the model that is displayed in the Property grid. + * Value: A String value. + */ + displayName: string; + /** + * Gets the property name that will be used during serialization to store the property value. + * Value: A String value. + */ + modelName: string; + /** + * Gets the default property value used for serialization. + * Value: A Object value. + */ + defaultVal: Object; + /** + * Gets the information about a complex object's content. + * Value: An array of ASPxDesignerElementSerializationInfo objects. + */ + info: ASPxDesignerElementSerializationInfo[]; + /** + * Gets a value indicating whether or not the property returns an array. + * Value: true if the property returns an array; otherwise false. + */ + array: boolean; + /** + * Gets a value indicating whether an object should be serialized to the ComponentStorage property. + * Value: true to serialize an object to the ObjectStorage; otherwise false. + */ + link: boolean; + /** + * Gets a value specifying the type of value editor for the Property Grid. + * Value: An ASPxDesignerElementEditor object. + */ + editor: ASPxDesignerElementEditor; + /** + * Gets the collection of values displayed in the Property grid. + * Value: An array of ASPxDesignerElementEditorItem objects. + */ + valuesArray: ASPxDesignerElementEditorItem[]; + /** + * Gets the rules for validating the property value entered into its editor. + * Value: An array of Object values. + */ + validationRules: Object[]; + /** + * Gets the visibility state of the value editor in the Property Grid. + * Value: A Object value. + */ + visible: Object; + /** + * Gets a value, indicating whether or not the property value can be edited. + * Value: true to disable the property editing; otherwise false. + */ + disabled: Object; +} +/** + * Provides information about a serialized property's value editor used in the Property Grid. + */ +interface ASPxDesignerElementEditor { + /** + * Gets the name of an HTML template specifying the editor and header of a complex object (i.e., an object having its content properties specified). + * Value: A String value. + */ + header: string; + /** + * Gets a nullable value, specifying the name of an HTML template used by a complex object's editor. + * Value: A String value. + */ + content: string; + /** + * Gets additional options for DevExtreme UI widgets. + * Value: An object that provides editor options. + */ + extendedOptions: Object; + /** + * Gets a nullable value, specifying the type of the editor's model. + * Value: A Object value. + */ + editorType: Object; +} +/** + * Provides information about property values. + */ +interface ASPxDesignerElementEditorItem { + /** + * Gets an actual property value. + * Value: A Object value. + */ + value: Object; + /** + * Gets a value displayed by a property editor. + * Value: A String value. + */ + displayValue: string; +} +/** + * Provides information about a UI element of the Web Report Designer or Web Document Viewer. + */ +interface ASPxReportUIElement { + /** + * Provides access to an element model. + * Value: An object that specifies the element model. + */ + model: Object; + /** + * Provides access to the name of an HTML template used by an element. + * Value: A string that specifies the name of the HTML template. + */ + templateName: string; +} +/** + * Provides data for the PreviewDocumentReady events. + */ +interface ASPxClientWebDocumentViewerDocumentReadyEventArgs extends ASPxClientEventArgs { + /** + * Specifies the report ID. + */ + ReportId: string; + /** + * Specifies the report document ID. + */ + DocumentId: string; + /** + * Specifies the total number of pages in a report document. + */ + PageCount: number; +} +/** + * Provides data for the PreviewEditingFieldChanged events. + */ +interface ASPxClientWebDocumentViewerEditingFieldChangedEventArgs extends ASPxClientEventArgs { + /** + * Gets an editing field whose value has been changed. + * Value: An object that specifies an editing field whose content has been changed. + */ + Field: ASPxClientWebDocumentViewerEditingField; + /** + * Provides access to a previous value of an editing field. + * Value: An object that specifies an editing field's previous value. + */ + OldValue: Object; + /** + * Provides access to a new value of an editing field. + * Value: An object that specifies an editing field's new value. + */ + NewValue: Object; +} +/** + * Provides functionality for a field whose content can be edited in the Web Document Viewer. + */ +interface ASPxClientWebDocumentViewerEditingField { + /** + * Provides access to a value that specifies whether or not an editing field's content can be customized in Print Preview. + * Returns: true, if a field cannot be edited in Print Preview; otherwise, false. + */ + readOnly: any; + /** + * Provides access to the current value of an editing field. + * Returns: An object that specifies the current field value. + */ + editValue: any; + /** + * Returns the unique identifier of an editing field. + */ + id(): string; + /** + * Returns the ID of a logical group to which an editing field for a check box belongs. + */ + groupID(): string; + /** + * Returns the name of an editor used to change a field value in Print Preview. + */ + editorName(): string; + /** + * Returns the index of the page on which an editing field is located. + */ + pageIndex(): number; +} +/** + * Provides data for the PreviewParametersSubmitted events. + */ +interface ASPxClientParametersSubmittedEventArgs extends ASPxClientEventArgs { + /** + * Provides access to a View Model for report parameters. + * Value: A View Model object. + */ + ParametersViewModel: Object; + /** + * Provides access to report parameters and their submitted values. + * Value: A dictionary containing the parameter names along with their values. + */ + Parameters: { [key: string]: Object; }; +} +/** + * Provides data for the PreviewParametersReset events. + */ +interface ASPxClientParametersResetEventArgs extends ASPxClientEventArgs { + /** + * Provides access to a View Model for report parameters. + * Value: A View Model object. + */ + ParametersViewModel: Object; + /** + * Provides access to report parameters whose values have been reset. + * Value: An ASPxClientWebDocumentViewerParameter array. + */ + Parameters: ASPxClientWebDocumentViewerParameter[]; +} +/** + * Provides general information about a report parameter on the client-side of the Web Document Viewer. + */ +interface ASPxClientWebDocumentViewerParameter { + /** + * Provides access to the current value of a report parameter. + * Value: An object that specifies the report parameter's current value. + */ + value: Object; + /** + * Provides access to a report parameter's value type. + * Value: An object that specifies the report parameter type. + */ + type: Object; + /** + * Provides access to a value that specifies whether or not a parameter can have multiple values. + * Value: true, if a parameter can have multiple values; otherwise, false. + */ + isMultiValue: boolean; + /** + * Returns an object that provides general information about a report parameter. + */ + getParameterDescriptor(): ASPxDesignerElementParameterDescriptor; +} +/** + * Provides data for the PreviewClick events. + */ +interface ASPxClientPreviewClickEventArgs extends ASPxClientEventArgs { + /** + * Gets a value specifying the zero-based index of the page that has been clicked. + * Value: An integer value that specifies a page index. + */ + PageIndex: number; + /** + * Provides information on a visual brick representing content of a report control that has been clicked. + * Value: An object that provides information on a visual brick. + */ + Brick: ASPxClientWebDocumentViewerBrick; + /** + * Specifies whether or not the event was handled and no default processing is required. + * Value: true, if the event is completely handled by custom code and no default processing is required; otherwise, false. + */ + Handled: boolean; + /** + * Specifies the default function used to handle the PreviewClick event. + */ + DefaultHandler(): void; + /** + * Returns the text displayed by the Brick. + */ + GetBrickText(): string; + /** + * Returns a string providing additional information on the Brick. + */ + GetBrickValue(): string; +} +/** + * Provides information about a visual brick used to render a report control to construct a document in the Web Document Viewer. + */ +interface ASPxClientWebDocumentViewerBrick { + /** + * Provides access to a brick's content. + * Value: A dictionary that stores content keys along with the corresponding contents. + */ + content: { [key: string]: string; }; + /** + * Provides access to navigation settings of the current brick. + * Value: An object that provides a brick's navigation settings. + */ + navigation: ASPxClientWebDocumentViewerBrickNavigation; + /** + * Provides access to a brick's top vertical coordinate. + * Value: An integer value that specifies the brick's top coordinate. + */ + top: number; + /** + * Provides access to a brick's left horizontal coordinate. + * Value: An integer value that specifies the brick's left coordinate. + */ + left: number; + /** + * Provides access to a brick's width. + * Value: An integer value that specifies the brick width. + */ + width: number; + /** + * Provides access to a brick's height. + * Value: An integer value that specifies the brick height. + */ + height: number; + /** + * Provides access to a value that specifies whether or not the right-to-left feature is enabled for a brick. + * Value: true, if the right-to-left feature is enabled; otherwise, false. + */ + rtl: boolean; +} +/** + * Provides navigation settings for a brick used to construct a document in the Web Document Viewer. + */ +interface ASPxClientWebDocumentViewerBrickNavigation { + /** + * Provides access to the URL to navigate to when a brick is a clicked. + * Value: A string that specifies the URL. + */ + url: string; + /** + * Provides access to a value that specifies the target window or frame in which to display the linked Web page's content when the brick is clicked. + * Value: A string that specifies the window or frame to which to target the URL's content. + */ + target: string; + /** + * Provides access to a drill-down key. + * Value: A string that specifies a drill-down key. + */ + drillDownKey: string; +} +/** + * A client-side equivalent of the ASPxWebDocumentViewer class. + */ +interface ASPxClientWebDocumentViewer extends ASPxClientControl { + /** + * Occurs after a report document has been loaded to the Web Document Viewer. + */ + DocumentReady: ASPxClientEvent>; + /** + * Occurs each time a value of an editing field changes. + */ + EditingFieldChanged: ASPxClientEvent>; + /** + * Enables you to customize UI elements of the Web Document Viewer. + */ + CustomizeElements: ASPxClientEvent>; + /** + * Enables you to customize the menu actions of a Web Document Viewer. + */ + CustomizeMenuActions: ASPxClientEvent>; + /** + * Occurs each time a standard editor is created for a report parameter based on a parameter type. + */ + CustomizeParameterEditors: ASPxClientEvent>; + /** + * Occurs each time a look-up editor is created for a report parameter. + */ + CustomizeParameterLookUpSource: ASPxClientEvent>; + /** + * Occurs when the left mouse button has been clicked over a report document. + */ + PreviewClick: ASPxClientEvent>; + /** + * Occurs after report parameter values have been reset to their default values. + */ + ParametersReset: ASPxClientEvent>; + /** + * Occurs after report parameter values have been submitted. + */ + ParametersSubmitted: ASPxClientEvent>; + /** + * Provides access to the preview model of the ASPxClientWebDocumentViewer. + */ + GetPreviewModel(): Object; + /** + * Returns a model for a report parameter. + */ + GetParametersModel(): Object; + /** + * Opens the specified report on the client side of the Web Document Viewer. + * @param url A string that specifies the URL of a report to be opened. + */ + OpenReport(url: string): any; + /** + * Prints the current document. + */ + Print(): void; + /** + * Prints the document's page with the specified index. + * @param pageIndex An index of the page to be printed. + */ + Print(pageIndex: number): void; + /** + * Exports the document to a PDF file. + */ + ExportTo(): void; + /** + * Exports the document to a specified file format. + * @param format A String value, specifying the export format. The following formats are currently supported: 'csv', 'html', 'image', 'mht', 'pdf', 'rtf', 'docx', 'txt', 'xls', and 'xlsx'. + */ + ExportTo(format: string): void; + /** + * Exports the document to a specified file format. + * @param format A String value that specifies the export format. The following formats are currently supported: 'csv', 'html', 'image', 'mht', 'pdf', 'rtf', 'docx', 'txt', 'xls', and 'xlsx'. + * @param inlineResult true, to try opening the result file in a new browser tab without a download; otherwise, false. + */ + ExportTo(format: string, inlineResult: boolean): void; + /** + * Returns the zero-based index of the currently displayed page. + */ + GetCurrentPageIndex(): number; + /** + * Displays the report page with the specified page index. + * @param pageIndex A zero-based integer value that specifies the index of a page to be displayed. + */ + GoToPage(pageIndex: number): void; + /** + * Closes the document currently being opened in the Web Document Viewer. + */ + Close(): void; + /** + * Resets the values of report parameters to their default values. + */ + ResetParameters(): void; + /** + * Starts building a report document. + */ + StartBuild(): void; + /** + * Updates the localization settings of the ASPxClientWebDocumentViewer properties. + * @param localization A dictionary containing the property names, along with their localized equivalents. + */ + UpdateLocalization(localization: { [key: string]: string; }): void; +} +/** + * A method that will handle the EditingFieldChanged event. + */ +interface ASPxClientWebDocumentViewerEditingFieldChangedEventHandler { + /** + * A method that will handle the PreviewEditingFieldChanged event. + * @param source The event sender. + * @param e An ASPxClientWebDocumentViewerEditingFieldChangedEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientWebDocumentViewerEditingFieldChangedEventArgs): void; +} +/** + * A method that will handle the DocumentReady event. + */ +interface ASPxClientWebDocumentViewerDocumentReadyEventHandler { + /** + * A method that will handle the PreviewDocumentReady event. + * @param source The event sender. + * @param e An ASPxClientWebDocumentViewerDocumentReadyEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientWebDocumentViewerDocumentReadyEventArgs): void; +} +/** + * A method that will handle the CustomizeElements event. + */ +interface ASPxClientWebDocumentViewerCustomizeElementsEventHandler { + /** + * A method that will handle the PreviewCustomizeElements event. + * @param source The event sender. + * @param e An ASPxClientCustomizeElementsEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeElementsEventArgs): void; +} +/** + * A method that will handle the CustomizeMenuActions event. + */ +interface ASPxClientWebDocumentViewerCustomizeMenuActionsEventHandler { + /** + * A method that will handle the CustomizeMenuActions event. + * @param source The event sender. + * @param e An ASPxClientCustomizeMenuActionsEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeMenuActionsEventArgs): void; +} +/** + * A method that will handle the CustomizeParameterEditors event. + */ +interface ASPxClientWebDocumentViewerCustomizeParameterEditorsEventHandler { + /** + * A method that will handle the CustomizeParameterEditors event. + * @param source The event sender. + * @param e An ASPxClientCustomizeParameterEditorsEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeParameterEditorsEventArgs): void; +} +/** + * A method that will handle the CustomizeParameterLookUpSource event. + */ +interface ASPxClientWebDocumentViewerCustomizeParameterLookUpSourceEventHandler { + /** + * A method that will handle the CustomizeParameterLookUpSource event. + * @param source The event sender. + * @param e An ASPxClientCustomizeParameterLookUpSourceEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientCustomizeParameterLookUpSourceEventArgs): void; +} +/** + * A method that will handle the PreviewClick event. + */ +interface ASPxClientWebDocumentViewerPreviewClickEventHandler { + /** + * A method that will handle the PreviewClick event. + * @param source The event sender. + * @param e An ASPxClientPreviewClickEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientPreviewClickEventArgs): void; +} +/** + * A method that will handle the ParametersReset event. + */ +interface ASPxClientWebDocumentViewerParametersResetEventHandler { + /** + * A method that will handle the PreviewParametersReset event. + * @param source The event sender. + * @param e An ASPxClientParametersResetEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientParametersResetEventArgs): void; +} +/** + * A method that will handle the ParametersSubmitted event. + */ +interface ASPxClientWebDocumentViewerParametersSubmittedEventHandler { + /** + * A method that will handle the PreviewParametersSubmitted event. + * @param source The event sender. + * @param e An ASPxClientParametersSubmittedEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientParametersSubmittedEventArgs): void; +} + +interface MVCxClientDashboardViewerStatic extends ASPxClientDashboardViewerStatic { +} +interface DashboardDataAxisNamesStatic { + /** + * Identifies a default axis in all data-bound dashboard items. + */ + DefaultAxis: string; + /** + * Identifies a series axis in a chart and pie. + */ + ChartSeriesAxis: string; + /** + * Identifies an argument axis in a chart, scatter chart and pie. + */ + ChartArgumentAxis: string; + /** + * Identifies a sparkline axis in a grid and cards. + */ + SparklineAxis: string; + /** + * Identifies a pivot column axis. + */ + PivotColumnAxis: string; + /** + * Identifies a pivot row axis. + */ + PivotRowAxis: string; +} +interface DashboardSpecialValuesStatic { + /** + * Represents a null value. + */ + NullValue: string; + /** + * Represents a null value in OLAP mode. + */ + OlapNullValue: string; + /** + * Represents an Others value. + */ + OthersValue: string; + /** + * Represents an error value for calculated fields. + */ + ErrorValue: string; + /** + * Returns whether or not the specified value is an NullValue. + * @param value The specified value. + */ + IsNullValue(value: Object): boolean; + /** + * Returns whether or not the specified value is an OlapNullValue. + * @param value The specified value. + */ + IsOlapNullValue(value: Object): boolean; + /** + * Returns whether or not the specified value is an OthersValue. + * @param value The specified value. + */ + IsOthersValue(value: Object): boolean; + /** + * Returns whether or not the specified value is an ErrorValue. + * @param value The specified value. + */ + IsErrorValue(value: Object): boolean; +} +interface DashboardExportPageLayoutStatic { + /** + * The page orientation used to export a dashboard (dashboard item) is portrait. + */ + Portrait: string; + /** + * The page orientation used to export a dashboard (dashboard item) is landscape. + */ + Landscape: string; +} +interface DashboardExportPaperKindStatic { + /** + * Letter paper (8.5 in. by 11 in.). + */ + Letter: string; + /** + * Legal paper (8.5 in. by 14 in.). + */ + Legal: string; + /** + * Executive paper (7.25 in. by 10.5 in.). + */ + Executive: string; + /** + * A5 paper (148 mm by 210 mm). + */ + A5: string; + /** + * A4 paper (210 mm by 297 mm). + */ + A4: string; + /** + * A3 paper (297 mm by 420 mm). + */ + A3: string; +} +interface DashboardExportScaleModeStatic { + /** + * The dashboard (dashboard item) on the exported page retains its original size. + */ + None: string; + /** + * The size of the dashboard (dashboard item) on the exported page is changed according to the scale factor value. + */ + UseScaleFactor: string; + /** + * The size of the dashboard (dashboard item) is changed according to the width of the exported page. + */ + AutoFitToPageWidth: string; + /** + * The size of the dashboard (dashboard item) is changed to fit its content on a single page. + */ + AutoFitWithinOnePage: string; +} +interface DashboardExportFilterStateStatic { + /** + * The filter state is not included in the exported document. + */ + None: string; + /** + * The filter state is placed below the dashboard (dashboard item) in the exported document. + */ + Below: string; + /** + * The filter state is placed on a separate page in the exported document. + */ + SeparatePage: string; +} +interface DashboardStateExportPositionStatic { + /** + * The dashboard state is placed below the exported dashboard/dashboard item. + */ + Below: string; + /** + * The dashboard state is placed on a separate page. + */ + SeparatePage: string; +} +interface DashboardStateExcelExportPositionStatic { + /** + * The dashboard state is placed below the exported data. + */ + Below: string; + /** + * The dashboard state is placed on a separate sheet. + */ + SeparateSheet: string; +} +interface DashboardExportImageFormatStatic { + /** + * The PNG image format. + */ + Png: string; + /** + * The GIF image format. + */ + Gif: string; + /** + * The JPG image format. + */ + Jpg: string; +} +interface ExcelExportFilterStateStatic { + none: string; + below: string; + separatePage: string; +} +interface DashboardExportExcelFormatStatic { + /** + * The Excel 97 - Excel 2003 (XLS) file format. + */ + Xls: string; + /** + * The Office Excel 2007 XML-based (XLSX) file format. + */ + Xlsx: string; + /** + * A comma-separated values (CSV) file format. + */ + Csv: string; +} +interface ChartExportSizeModeStatic { + /** + * A chart dashboard item is exported in a size identical to that shown on the dashboard. + */ + None: string; + /** + * A chart dashboard item is stretched or shrunk to fit the page to which it is exported. + */ + Stretch: string; + /** + * A chart dashboard item is resized proportionally to best fit the exported page. + */ + Zoom: string; +} +interface MapExportSizeModeStatic { + /** + * A map dashboard item is exported in a size identical to that shown on the dashboard + */ + None: string; + /** + * A map dashboard item is resized proportionally to best fit the exported page. + */ + Zoom: string; +} +interface TreemapExportSizeModeStatic { + /** + * For internal use. + */ + none: string; + /** + * For internal use. + */ + zoom: string; +} +interface RangeFilterExportSizeModeStatic { + /** + * A Range Filter dashboard item is exported in a size identical to that shown on the dashboard. + */ + None: string; + /** + * A Range Filter dashboard item is stretched or shrunk to fit the page to which it is exported. + */ + Stretch: string; + /** + * A Range Filter dashboard item is resized proportionally to best fit the printed page. + */ + Zoom: string; +} +interface DashboardSelectionModeStatic { + None: string; + Single: string; + Multiple: string; +} +interface ASPxClientDashboardStatic extends ASPxClientControlStatic { +} +interface ASPxClientDashboardViewerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDashboardViewer; +} +interface ASPxClientEditBaseStatic extends ASPxClientControlStatic { +} +interface ASPxClientEditStatic extends ASPxClientEditBaseStatic { + /** + * Assigns a null value to all editors in a specified visibility state, which are located within a specified container and belong to a specific validation group. + * @param container An HTML element specifying the container of editors to be validated. + * @param validationGroup A string value specifying the validation group's name. + * @param clearInvisibleEditors true to clear both visible and invisible editors that belong to the specified container and group; false to clear only visible editors. + */ + ClearEditorsInContainer(container: Object, validationGroup: string, clearInvisibleEditors: boolean): void; + /** + * Assigns a null value to all visible editors located within a specified container, and belonging to a specific validation group. + * @param container An HTML element specifying the container of editors to be validated. + * @param validationGroup A string value specifying the validation group's name. + */ + ClearEditorsInContainer(container: Object, validationGroup: string): void; + /** + * Assigns a null value to all visible editors located within a specified container. + * @param container An HTML element specifying the container of editors to be validated. + */ + ClearEditorsInContainer(container: Object): void; + /** + * Assigns a null value to all editors which are located within the specified container object, and belonging to a specific validation group, dependent on the visibility state specified. + * @param containerId A string value specifying the editor container's identifier. + * @param validationGroup A string value specifying the validatiion group's name. + * @param clearInvisibleEditors true to clear both visible and invisible editors that belong to the specified container and group; false to clear only visible editors. + */ + ClearEditorsInContainerById(containerId: string, validationGroup: string, clearInvisibleEditors: boolean): void; + /** + * Assigns a null value to all visible editors that are located within the specified container object, and belonging to a specific validation group. + * @param containerId A string value specifying the editor container's identifier. + * @param validationGroup A string value specifying the validatiion group's name. + */ + ClearEditorsInContainerById(containerId: string, validationGroup: string): void; + /** + * Assigns a null value to all visible editors that are located within the specified container object. + * @param containerId A string value specifying the editor container's identifier. + */ + ClearEditorsInContainerById(containerId: string): void; + /** + * Assigns a null value to all editors which belong to a specific validation group, dependent on the visibility state specified. + * @param validationGroup A string value specifying the validation group's name. + * @param clearInvisibleEditors true to clear both visible and invisible editors that belong to the specified validation group; false to clear only visible editors. + */ + ClearGroup(validationGroup: string, clearInvisibleEditors: boolean): void; + /** + * Assigns a null value to all visible editors which belong to a specific validation group. + * @param validationGroup A string value specifying the validation group's name. + */ + ClearGroup(validationGroup: string): void; + /** + * Performs validation of all editors in a specified visibility state, which are located within a specified container and belong to a specific validation group. + * @param container An HTML element specifying the container of editors to be validated. + * @param validationGroup A string value that specifies the validation group's name. + * @param validateInvisibleEditors true to validate both visible and invisible editors that belong to the specified container and group; false to validate only visible editors. + */ + ValidateEditorsInContainer(container: Object, validationGroup: string, validateInvisibleEditors: boolean): boolean; + /** + * Performs validation of visible editors that are located within the specified container and belong to a specific validation group. + * @param container An HTML element specifying the container of editors to be validated. + * @param validationGroup A string value that specifies the validation group's name. + */ + ValidateEditorsInContainer(container: Object, validationGroup: string): boolean; + /** + * Performs validation of visible editors that are located within the specified container. + * @param container An HTML element specifying the container of editors to be validated. + */ + ValidateEditorsInContainer(container: Object): boolean; + /** + * Performs validation of the editors which are located within the specified container and belong to a specific validation group, dependent on the visibility state specified. + * @param containerId A string value specifying the editor container's identifier. + * @param validationGroup A string value that specifies the validation group's name. + * @param validateInvisibleEditors true to validate both visible and invisible editors that belong to the specified container and group; false to validate only visible editors. + */ + ValidateEditorsInContainerById(containerId: string, validationGroup: string, validateInvisibleEditors: boolean): boolean; + /** + * Performs validation of visible editors that are located within the specified container and belong to a specific validation group. + * @param containerId A string value that specifies the container's unique identifier. + * @param validationGroup A string value that specifies the validation group's name. + */ + ValidateEditorsInContainerById(containerId: string, validationGroup: string): boolean; + /** + * Performs validation of visible editors which are located within the specified container. + * @param containerId A string value that specifies the container's unique identifier. + */ + ValidateEditorsInContainerById(containerId: string): boolean; + /** + * Performs validation of editors contained within the specified validation group, dependent on the editor visibility state specified. + * @param validationGroup A string value specifying the validation group's name. + * @param validateInvisibleEditors true to validate both visible and invisible editors that belong to the specified validation group; false to validate only visible editors. + */ + ValidateGroup(validationGroup: string, validateInvisibleEditors: boolean): boolean; + /** + * Performs validation of visible editors contained within the specified validation group. + * @param validationGroup A string value specifying the validation group's name. + */ + ValidateGroup(validationGroup: string): boolean; + /** + * Verifies whether the editors in a specified visibility state, which are located within a specified container and belong to a specific validation group, are valid. + * @param container An HTML element specifying the container of editors to be validated. + * @param validationGroup A string value that specifies the validation group's name. + * @param checkInvisibleEditors true to check both visible and invisible editors that belong to the specified container; false to check only visible editors. + */ + AreEditorsValid(container: Object, validationGroup: string, checkInvisibleEditors: boolean): boolean; + /** + * Verifies whether visible editors, which are located within a specified container and belong to a specific validation group, are valid. + * @param container An HTML element specifying the container of editors to be validated. + * @param validationGroup A string value that specifies the validation group's name. + */ + AreEditorsValid(container: Object, validationGroup: string): boolean; + /** + * Verifies whether visible editors located in a specified container are valid. + * @param container An HTML element specifying the container of editors to be validated. + */ + AreEditorsValid(container: Object): boolean; + /** + * Verifies whether the editors with the specified settings are valid. + * @param containerId A string value that specifies the container's unique identifier. + * @param validationGroup A string value that specifies the validation group's name. + * @param checkInvisibleEditors true to check both visible and invisible editors that belong to the specified container; false to check only visible editors. + */ + AreEditorsValid(containerId: string, validationGroup: string, checkInvisibleEditors: boolean): boolean; + /** + * Verifies whether visible editors with the specified settings are valid. + * @param containerId A string value that specifies the container's unique identifier. + * @param validationGroup A string value that specifies the validation group's name. + */ + AreEditorsValid(containerId: string, validationGroup: string): boolean; + /** + * Verifies whether visible editors with the specified settings are valid. + * @param containerId A string value that specifies the container's unique identifier. + */ + AreEditorsValid(containerId: string): boolean; + /** + * Verifies whether visible editors on a page are valid. + */ + AreEditorsValid(): boolean; +} +interface ASPxClientBinaryImageStatic extends ASPxClientEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientBinaryImage; +} +interface ASPxClientButtonStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientButton; +} +interface ASPxClientCalendarStatic extends ASPxClientEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCalendar; +} +interface ASPxClientCaptchaStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCaptcha; +} +interface ASPxClientCheckBoxStatic extends ASPxClientEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCheckBox; +} +interface ASPxClientRadioButtonStatic extends ASPxClientCheckBoxStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientRadioButton; +} +interface ASPxClientTextEditStatic extends ASPxClientEditStatic { +} +interface ASPxClientTextBoxBaseStatic extends ASPxClientTextEditStatic { +} +interface ASPxClientButtonEditBaseStatic extends ASPxClientTextBoxBaseStatic { +} +interface ASPxClientDropDownEditBaseStatic extends ASPxClientButtonEditBaseStatic { +} +interface ASPxClientColorEditStatic extends ASPxClientDropDownEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientColorEdit; +} +interface ASPxClientComboBoxStatic extends ASPxClientDropDownEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientComboBox; +} +interface ASPxClientDateEditStatic extends ASPxClientDropDownEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDateEdit; +} +interface ASPxClientDropDownEditStatic extends ASPxClientDropDownEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDropDownEdit; +} +interface ASPxClientFilterControlStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientFilterControl; +} +interface ASPxClientListEditStatic extends ASPxClientEditStatic { +} +interface ASPxClientListBoxStatic extends ASPxClientListEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientListBox; +} +interface ASPxClientCheckListBaseStatic extends ASPxClientListEditStatic { +} +interface ASPxClientRadioButtonListStatic extends ASPxClientCheckListBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientRadioButtonList; +} +interface ASPxClientCheckBoxListStatic extends ASPxClientCheckListBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCheckBoxList; +} +interface ASPxClientProgressBarStatic extends ASPxClientEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientProgressBar; +} +interface ASPxClientSpinEditBaseStatic extends ASPxClientButtonEditBaseStatic { +} +interface ASPxClientSpinEditStatic extends ASPxClientSpinEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientSpinEdit; +} +interface ASPxClientTimeEditStatic extends ASPxClientSpinEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTimeEdit; +} +interface ASPxClientStaticEditStatic extends ASPxClientEditBaseStatic { +} +interface ASPxClientHyperLinkStatic extends ASPxClientStaticEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientHyperLink; +} +interface ASPxClientImageBaseStatic extends ASPxClientStaticEditStatic { +} +interface ASPxClientImageStatic extends ASPxClientImageBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientImage; +} +interface ASPxClientLabelStatic extends ASPxClientStaticEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientLabel; +} +interface ASPxClientTextBoxStatic extends ASPxClientTextBoxBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTextBox; +} +interface ASPxClientMemoStatic extends ASPxClientTextEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientMemo; +} +interface ASPxClientButtonEditStatic extends ASPxClientButtonEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientButtonEdit; +} +interface ASPxClientTokenBoxStatic extends ASPxClientComboBoxStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTokenBox; +} +interface ASPxClientTrackBarStatic extends ASPxClientEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTrackBar; +} +interface ASPxClientValidationSummaryStatic extends ASPxClientControlStatic { +} +interface ASPxClientGaugeControlStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientGaugeControl; +} +interface ASPxClientGridBaseStatic extends ASPxClientControlStatic { +} +interface ASPxClientGridViewCallbackCommandStatic { + /** + * Default value: "NEXTPAGE" + */ + NextPage: string; + /** + * Default value: "PREVPAGE" + */ + PreviousPage: string; + /** + * Default value: "GOTOPAGE" + */ + GotoPage: string; + /** + * Default value: "SELECTROWS" + */ + SelectRows: string; + /** + * Default value: "SELECTROWSKEY" + */ + SelectRowsKey: string; + /** + * Default value: "SELECTION" + */ + Selection: string; + /** + * Default value: "FOCUSEDROW" + */ + FocusedRow: string; + /** + * Default value: "GROUP" + */ + Group: string; + /** + * Default value: "UNGROUP" + */ + UnGroup: string; + /** + * Default value: "SORT" + */ + Sort: string; + /** + * Default value: "COLUMNMOVE" + */ + ColumnMove: string; + /** + * Default value: "COLLAPSEALL" + */ + CollapseAll: string; + /** + * Default value: "EXPANDALL" + */ + ExpandAll: string; + /** + * Default value: "EXPANDROW" + */ + ExpandRow: string; + /** + * Default value: "COLLAPSEROW" + */ + CollapseRow: string; + /** + * Default value: "HIDEALLDETAIL" + */ + HideAllDetail: string; + /** + * Default value: "SHOWALLDETAIL" + */ + ShowAllDetail: string; + /** + * Default value: "SHOWDETAILROW" + */ + ShowDetailRow: string; + /** + * Default value: "HIDEDETAILROW" + */ + HideDetailRow: string; + /** + * Default value: "PAGERONCLICK" + */ + PagerOnClick: string; + /** + * Default value: "APPLYFILTER" + */ + ApplyFilter: string; + /** + * Default value: "APPLYCOLUMNFILTER" + */ + ApplyColumnFilter: string; + /** + * Default value: "APPLYMULTICOLUMNFILTER" + */ + ApplyMultiColumnFilter: string; + /** + * Default value: "APPLYHEADERCOLUMNFILTER" + */ + ApplyHeaderColumnFilter: string; + /** + * Default value: "APPLYSEARCHPANELFILTER" + */ + ApplySearchPanelFilter: string; + /** + * Default value: "APPLYCUSTOMIZATIONDIALOGCHANGES" + */ + ApplyCustomizationDialogChanges: string; + /** + * Default value: "FILTERROWMENU" + */ + FilterRowMenu: string; + /** + * Default value: "STARTEDIT" + */ + StartEdit: string; + /** + * Default value: "CANCELEDIT" + */ + CancelEdit: string; + /** + * Default value: "UPDATEEDIT" + */ + UpdateEdit: string; + /** + * Default value: "ADDNEWROW" + */ + AddNewRow: string; + /** + * Default value: "DELETEROW" + */ + DeleteRow: string; + /** + * Default value: "CUSTOMBUTTON" + */ + CustomButton: string; + /** + * Default value: "CUSTOMCALLBACK" + */ + CustomCallback: string; + /** + * Default value: "SHOWFILTERCONTROL" + */ + ShowFilterControl: string; + /** + * Default value: "CLOSEFILTERCONTROL" + */ + CloseFilterControl: string; + /** + * Default value: "SETFILTERENABLED" + */ + SetFilterEnabled: string; + /** + * Default value: "REFRESH" + */ + Refresh: string; + /** + * Default value: "SELFIELDVALUES" + */ + SelFieldValues: string; + /** + * Default value: "ROWVALUES" + */ + RowValues: string; + /** + * Default value: "PAGEROWVALUES" + */ + PageRowValues: string; + /** + * Default value: "FILTERPOPUP" + */ + FilterPopup: string; + /** + * Default value: "CONTEXTMENU" + */ + ContextMenu: string; + /** + * Default value: "TOOLBAR" + */ + Toolbar: string; + /** + * Default value: "CUSTOMVALUES" + */ + CustomValues: string; +} +interface ASPxClientGridLookupStatic extends ASPxClientDropDownEditBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientGridLookup; +} +interface ASPxClientCardViewStatic extends ASPxClientGridBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCardView; +} +interface ASPxClientGridViewStatic extends ASPxClientGridBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientGridView; +} +interface ASPxClientVerticalGridStatic extends ASPxClientGridBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientVerticalGrid; +} +interface ASPxClientVerticalGridCallbackCommandStatic { + /** + * Default value: "EXPANDROW" + */ + ExpandRow: string; +} +interface ASPxClientCommandConstsStatic { + /** + * Identifies a command that shows a search panel. + * Value: "showsearchpanel" + */ + SHOWSEARCHPANEL_COMMAND: string; + /** + * Identifies a command that invokes the Find and Replace dialog. + * Value: "findandreplacedialog" + */ + FINDANDREPLACE_DIALOG_COMMAND: string; + /** + * Identifies a command that applies the bold text formatting to the selected text. If it's already applied, cancels it. + * Value: "bold" + */ + BOLD_COMMAND: string; + /** + * Identifies a command that makes the selected text italic or regular type depending on the current state. + * Value: "italic" + */ + ITALIC_COMMAND: string; + /** + * Identifies a command that applies the underline text formatting to the selected text. If it's already applied, cancels it. + * Value: "underline" + */ + UNDERLINE_COMMAND: string; + /** + * Identifies a command that applies the strike through text formatting to the selected text. If it's already applied, cancels it. + * Value: "strikethrough" + */ + STRIKETHROUGH_COMMAND: string; + /** + * Identifies a command that applies the superscript text formatting to the selected text. If it's already applied, cancels it. + * Value: "superscript" + */ + SUPERSCRIPT_COMMAND: string; + /** + * Identifies a command that applies the subscript text formatting to the selected text. If it's already applied, cancels it. + * Value: "subscript" + */ + SUBSCRIPT_COMMAND: string; + /** + * Identifies a command that centers the content of the currently focused paragraph. + * Value: "justifycenter" + */ + JUSTIFYCENTER_COMMAND: string; + /** + * Identifies a command that left justifies the content of the currently focused paragraph. + * Value: "justifyleft" + */ + JUSTIFYLEFT_COMMAND: string; + /** + * Identifies a command that creates an indent for the selected paragarph. + * Value: "indent" + */ + INDENT_COMMAND: string; + /** + * Identifies a command that creates an outdent for the focused paragarph. + * Value: "outdent" + */ + OUTDENT_COMMAND: string; + /** + * Identifies a command that right justifies the content of the currently focused paragraph. + * Value: "justifyright" + */ + JUSTIFYRIGHT_COMMAND: string; + /** + * Identifies a command that fully justifies the content of the currently focused paragraph (aligned with both the left and right margines). + * Value: "justifyfull" + */ + JUSTIFYFULL_COMMAND: string; + /** + * Identifies a command that changes the size of the selected text. + * Value: "fontsize" + */ + FONTSIZE_COMMAND: string; + /** + * Identifies a command that changes the font of the selected text. + * Value: "fontname" + */ + FONTNAME_COMMAND: string; + /** + * Identifies a command that changes the color of a fore color pickers and sets the selected text fore color. + * Value: "forecolor" + */ + FONTCOLOR_COMMAND: string; + /** + * Identifies a command that changes the color of a back color pickers and sets the selected text back color. + * Value: "backcolor" + */ + BACKCOLOR_COMMAND: string; + /** + * Identifies a command that wraps the selected paragraph in the specified html tag. + * Value: "formatblock" + */ + FORMATBLOCK_COMMAND: string; + /** + * Identifies a command that wraps the currently selected text content in a specific html tag with a css class assigned to it. + * Value: "applycss" + */ + APPLYCSS_COMMAND: string; + /** + * Identifies a command that removes all formatting from the selected content. + * Value: "removeformat" + */ + REMOVEFORMAT_COMMAND: string; + /** + * Identifies a command that cancels the last action. + * Value: "undo" + */ + UNDO_COMMAND: string; + /** + * Identifies a command that returns a previously canceled action. + * Value: "redo" + */ + REDO_COMMAND: string; + /** + * Identifies a command that copies the selected content. + * Value: "copy" + */ + COPY_COMMAND: string; + /** + * Identifies a command that pastes the content of the clipboard at the current cursor position. + * Value: "paste" + */ + PASTE_COMMAND: string; + /** + * Identifies a command that pastes a specified content taking into account that it was copied from Word. + * Value: "pastefromword" + */ + PASTEFROMWORD_COMMAND: string; + /** + * Identifies a command that invokes the Paste from Word dialog. + * Value: "pastefromworddialog" + */ + PASTEFROMWORDDIALOG_COMMAND: string; + /** + * Identifies a command that cuts the selected content. + * Value: "cut" + */ + CUT_COMMAND: string; + /** + * Identifies a command that selects all content inside the html editor. + * Value: "selectall" + */ + SELECT_ALL: string; + /** + * Identifies a command that deletes the selected content. + * Value: "delete" + */ + DELETE_COMMAND: string; + /** + * Identifies a command that can be used to correctly insert HTML code into the editor. + * Value: "pastehtml" + */ + PASTEHTML_COMMAND: string; + /** + * Identifies a command that inserts a new ordered list. + * Value: "insertorderedlist" + */ + INSERTORDEREDLIST_COMMAND: string; + /** + * Identifies a command that inserts a new unordered list. + * Value: "insertunorderedlist" + */ + INSERTUNORDEREDLIST_COMMAND: string; + /** + * Identifies a command that restarts the current ordered list. + * Value: "restartorderedlist" + */ + RESTARTORDEREDLIST_COMMAND: string; + /** + * Identifies a command that continues a disrupted ordered list. + * Value: "continueorderedlist" + */ + CONTINUEORDEREDLIST_COMMAND: string; + /** + * Identifies a command that removes a hyperlink from the selected text or image. + * Value: "unlink" + */ + UNLINK_COMMAND: string; + /** + * Identifies a command that inserts a new hyperlink. + * Value: "insertlink" + */ + INSERTLINK_COMMAND: string; + /** + * Identifies a command that inserts a new image. + * Value: "insertimage" + */ + INSERTIMAGE_COMMAND: string; + /** + * Identifies a command that changes the selected image. + * Value: "changeimage" + */ + CHANGEIMAGE_COMMAND: string; + /** + * Identifies a command that initiates spell checking. + * Value: "checkspelling" + */ + CHECKSPELLING_COMMAND: string; + /** + * Identifies a command that invokes the Insert Image dialog. + * Value: "insertimagedialog" + */ + INSERTIMAGE_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Change Image dialog. + * Value: "changeimagedialog" + */ + CHANGEIMAGE_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Insert Link dialog. + * Value: "insertlinkdialog" + */ + INSERTLINK_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Change Link dialog. + * Value: "changelinkdialog" + */ + CHANGELINK_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Insert Table dialog. + * Value: "inserttabledialog" + */ + INSERTTABLE_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Table Properties dialog. + * Value: "tablepropertiesdialog" + */ + TABLEPROPERTIES_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Cell Properties dialog. + * Value: "tablecellpropertiesdialog" + */ + TABLECELLPROPERTIES_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Column Properties dialog. + * Value: "tablecolumnpropertiesdialog" + */ + TABLECOLUMNPROPERTIES_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Row Properties dialog. + * Value: "tablerowpropertiesdialog" + */ + TABLEROWPROPERTIES_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes a default browser Print dialog, allowing an end-user to print the content of the html editor. + * Value: "print" + */ + PRINT_COMMAND: string; + /** + * Identifies a command that toggles the full-screen mode. + * Value: "fullscreen" + */ + FULLSCREEN_COMMAND: string; + /** + * Identifies a command that inserts a new table. + * Value: "inserttable" + */ + INSERTTABLE_COMMAND: string; + /** + * Identifies a command that changes the selected table. + * Value: "changetable" + */ + CHANGETABLE_COMMAND: string; + /** + * Identifies a command that changes the selected table cell. + * Value: "changetablecell" + */ + CHANGETABLECELL_COMMAND: string; + /** + * Identifies a command that changes the selected table row. + * Value: "changetablerow" + */ + CHANGETABLEROW_COMMAND: string; + /** + * Identifies a command that changes the selected table column. + * Value: "changetablecolumn" + */ + CHANGETABLECOLUMN_COMMAND: string; + /** + * Identifies a command that deletes the currently selected table. + * Value: "deletetable" + */ + DELETETABLE_COMMAND: string; + /** + * Identifies a command that deletes the currently selected table row. + * Value: "deletetablerow" + */ + DELETETABLEROW_COMMAND: string; + /** + * Identifies a command that deletes the currently selected table column. + * Value: "deletetablecolumn" + */ + DELETETABLECOLUMN_COMMAND: string; + /** + * Identifies a command that inserts a new column to the left from the currently focused one. + * Value: "inserttablecolumntoleft" + */ + INSERTTABLECOLUMNTOLEFT_COMMAND: string; + /** + * Identifies a command that inserts a new column to the right from the currently focused one. + * Value: "inserttablecolumntoright" + */ + INSERTTABLECOLUMNTORIGHT_COMMAND: string; + /** + * Identifies a command that inserts a new row below the currently focused one. + * Value: "inserttablerowbelow" + */ + INSERTTABLEROWBELOW_COMMAND: string; + /** + * Identifies a command that inserts a new row above the currently focused one. + * Value: "inserttablerowabove" + */ + INSERTTABLEROWABOVE_COMMAND: string; + /** + * Identifies a command that splits the current table cell horizontally. + * Value: "splittablecellhorizontally" + */ + SPLITTABLECELLHORIZONTALLY_COMMAND: string; + /** + * Identifies a command that splits the current table cell vertically. + * Value: "splittablecellvertically" + */ + SPLITTABLECELLVERTICALLY_COMMAND: string; + /** + * Identifies a command that merges the focused table cell with the one to the right. + * Value: "mergetablecellright" + */ + MERGETABLECELLRIGHT_COMMAND: string; + /** + * Identifies a command that merges the focused table cell with the one below. + * Value: "mergetablecelldown" + */ + MERGETABLECELLDOWN_COMMAND: string; + /** + * Identifies a command that invokes a custom dialog. + * Value: "customdialog" + */ + CUSTOMDIALOG_COMMAND: string; + /** + * Identifies a command that exports the html editor content. + * Value: "export" + */ + EXPORT_COMMAND: string; + /** + * Identifies a command that inserts a new audio element. + * Value: "insertaudio" + */ + INSERTAUDIO_COMMAND: string; + /** + * Identifies a command that inserts a new video. + * Value: "insertvideo" + */ + INSERTVIDEO_COMMAND: string; + /** + * Identifies a command that inserts a new flash element. + * Value: "insertflash" + */ + INSERTFLASH_COMMAND: string; + /** + * Identifies a command that inserts a new YouTube video. + * Value: "insertyoutubevideo" + */ + INSERTYOUTUBEVIDEO_COMMAND: string; + /** + * Identifies a command that changes the selected audio element. + * Value: "changeaudio" + */ + CHANGEAUDIO_COMMAND: string; + /** + * Identifies a command that changes the selected video element. + * Value: "changevideo" + */ + CHANGEVIDEO_COMMAND: string; + /** + * Identifies a command that changes the selected flash element. + * Value: "changeflash" + */ + CHANGEFLASH_COMMAND: string; + /** + * Identifies a command that changes the selected YouTube video element. + * Value: "changeyoutubevideo" + */ + CHANGEYOUTUBEVIDEO_COMMAND: string; + /** + * Identifies a command that invokes the Insert Audio dialog. + * Value: "insertaudiodialog" + */ + INSERTAUDIO_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Insert Video dialog. + * Value: "insertvideodialog" + */ + INSERTVIDEO_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Insert Flash dialog. + * Value: "insertflashdialog" + */ + INSERTFLASH_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Insert YouTube Video dialog. + * Value: "insertyoutubevideodialog" + */ + INSERTYOUTUBEVIDEO_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Change Audio dialog. + * Value: "changeaudiodialog" + */ + CHANGEAUDIO_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Change Video dialog. + * Value: "changevideodialog" + */ + CHANGEVIDEO_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Change Flash dialog. + * Value: "changeflash" + */ + CHANGEFLASH_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Change YouTube Video dialog. + * Value: "changeyoutubevideodialog" + */ + CHANGEYOUTUBEVIDEO_DIALOG_COMMAND: string; + /** + * Identifies a command that pastes the content of the clipboard to the current cursor position, taking into account that the PasteMode property is set to SourceFormatting. + * Value: "pastehtmlsourceformatting" + */ + PASTEHTMLSOURCEFORMATTING_COMMAND: string; + /** + * Identifies a command that pastes the content of the clipboard to the current cursor position, taking into account that the PasteMode property is set to PlainText. + * Value: "pastehtmlplaintext" + */ + PASTEHTMLPLAINTEXT_COMMAND: string; + /** + * Identifies a command that pastes the content of the clipboard to the current cursor position, taking into account that the PasteMode property is set to MergeFormatting. + * Value: "pastehtmlmergeformatting" + */ + PASTEHTMLMERGEFORMATTING_COMMAND: string; + /** + * Identifies a command that inserts a new placeholder. + * Value: "insertplaceholder" + */ + INSERTPLACEHOLDER_COMMAND: string; + /** + * Identifies a command that changes the selected placeholder. + * Value: "changeplaceholder" + */ + CHANGEPLACEHOLDER_COMMAND: string; + /** + * Identifies a command that invokes the Insert Placeholder dialog. + * Value: "insertplaceholderdialog" + */ + INSERTPLACEHOLDER_DIALOG_COMMAND: string; + /** + * Identifies a command that invokes the Change Placeholder dialog. + * Value: "changeplaceholderdialog" + */ + CHANGEPLACEHOLDER_DIALOG_COMMAND: string; + /** + * Identifies a command that updates the editor content. + * Value: "updatedocument" + */ + UPDATEDOCUMENT_COMMAND: string; + /** + * Identifies a command that changes properties of the element selected in the tag inspector. + * Value: "changeelementproperties" + */ + CHANGEELEMENTPROPERTIES_COMMAND: string; + /** + * Identifies a command that invokes the Change Element Properties dialog. + * Value: "changeelementpropertiesdialog" + */ + CHANGEELEMENTPROPERTIES_DIALOG_COMMAND: string; + /** + * Identifies a command that comments the selected HTML code. If no code is selected, it comments the focused tag. + * Value: "comment" + */ + COMMENT_COMMAND: string; + /** + * Identifies a command that uncomments the selected HTML code. If no code is selected, the command uncomments the currently focused tag. + * Value: "uncomment" + */ + UNCOMMENTHTML_COMMAND: string; + /** + * Identifies a command that formats the current HTML document. + * Value: "formatdocument" + */ + FORMATDOCUMENT_COMMAND: string; + /** + * Identifies a command that applies the indent formatting to the selected content. + * Value: "indent" + */ + INDENTLINE_COMMAND: string; + /** + * Identifies a command that applies the outdent formatting to the focused content. + * Value: "outdent" + */ + OUTDENTLINE_COMMAND: string; + /** + * Identifies a command that collapses the selected HTML tag. + * Value: "collapsetag" + */ + COLLAPSETAG_COMMAND: string; + /** + * Identifies a command that expands the selected HTML tag. + * Value: "expandtag" + */ + EXPANDTAG_COMMAND: string; + /** + * Identifies a command that shows intellisense for the HTML code editor. + * Value: "showintellisense" + */ + SHOWINTELLISENSE_COMMAND: string; +} +interface ASPxClientHtmlEditorStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientHtmlEditor; + /** + * Programmatically closes a custom dialog, supplying it with specific parameters. + * @param status An object representing a custom dialog's closing status. + * @param data An object representing custom data associated with a custom dialog. + */ + CustomDialogComplete(status: Object, data: Object): void; +} +interface ASPxClientHtmlEditorMediaPreloadModeStatic { + /** + * The browser does not load a media file when the page loads. + */ + None: string; + /** + * The browser loads the entire video when the page loads. + */ + Auto: string; + /** + * The browser loads only metadata when the page loads. + */ + Metadata: string; +} +interface ASPxClientPivotGridStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientPivotGrid; +} +interface ASPxClientPivotCustomizationStatic extends ASPxClientControlStatic { +} +interface ASPxClientRichEditStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientRichEdit; +} +interface ASPxSchedulerDateTimeHelperStatic { + /** + * Returns the date part of the specified DateTime value. + * @param date A DateTime object from which to extract the date. + */ + TruncToDate(date: Date): Date; + /** + * Returns the day time part of the specified DateTime value. + * @param date A DateTime object from which to extract the day time. + */ + ToDayTime(date: Date): any; + /** + * Adds the specified number of days to a DateTime object and returns the result. + * @param date A DateTime object to which to add days. + * @param dayCount The number of days to add. + */ + AddDays(date: Date, dayCount: number): Date; + /** + * Adds the specified timespan to a DateTime object and returns the result. + * @param date A DateTime object to which to add a timespan. + * @param timeSpan A TimeSpan object specifying the timespan to add. + */ + AddTimeSpan(date: Date, timeSpan: any): Date; + /** + * Rounds a DateTime value up to the nearest interval. + * @param date A DateTime object containing a value to round. + * @param spanInMs A TimeSpan object specifying an interval to which to round. + */ + CeilDateTime(date: Date, spanInMs: any): Date; +} +interface ASPxClientWeekDaysCheckEditStatic extends ASPxClientControlStatic { +} +interface ASPxClientRecurrenceRangeControlStatic extends ASPxClientControlStatic { +} +interface ASPxClientRecurrenceControlBaseStatic extends ASPxClientControlStatic { +} +interface ASPxClientDailyRecurrenceControlStatic extends ASPxClientRecurrenceControlBaseStatic { +} +interface ASPxClientWeeklyRecurrenceControlStatic extends ASPxClientRecurrenceControlBaseStatic { +} +interface ASPxClientMonthlyRecurrenceControlStatic extends ASPxClientRecurrenceControlBaseStatic { +} +interface ASPxClientYearlyRecurrenceControlStatic extends ASPxClientRecurrenceControlBaseStatic { +} +interface ASPxClientRecurrenceTypeEditStatic extends ASPxClientRadioButtonListStatic { +} +interface ASPxClientTimeIntervalStatic { + /** + * Gets the duration of a time interval between two points in time. + * @param start A DateTime object specifying the starting point of the time interval. + * @param end A DateTime object specifying the ending point of the time interval. + */ + CalculateDuration(start: Date, end: Date): number; +} +interface ASPxClientSchedulerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientScheduler; +} +interface ASPxClientSpellCheckerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientSpellChecker; +} +interface ASPxClientSpellCheckerStopCheckingReasonStatic { + /** + * Spell checking is finished normally. + */ + Default: string; + /** + * The user stopped spell checking. + */ + User: string; +} +interface ASPxClientSpreadsheetStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientSpreadsheet; +} +interface ASPxClientTreeListStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTreeList; +} +interface BootstrapClientAccordionStatic extends ASPxClientNavBarStatic { +} +interface BootstrapClientBinaryImageStatic extends ASPxClientHyperLinkStatic { +} +interface BootstrapClientButtonStatic extends ASPxClientButtonStatic { +} +interface BootstrapClientCalendarStatic extends ASPxClientCalendarStatic { +} +interface BootstrapClientCallbackPanelStatic extends ASPxClientControlStatic { +} +interface BootstrapClientChartBaseStatic extends ASPxClientControlStatic { +} +interface BootstrapClientChartStatic extends BootstrapClientChartBaseStatic { +} +interface BootstrapClientPolarChartStatic extends BootstrapClientChartBaseStatic { +} +interface BootstrapClientPieChartStatic extends BootstrapClientChartBaseStatic { +} +interface BootstrapClientCheckBoxStatic extends ASPxClientEditStatic { +} +interface BootstrapClientRadioButtonStatic extends BootstrapClientCheckBoxStatic { +} +interface BootstrapClientComboBoxStatic extends ASPxClientComboBoxStatic { +} +interface BootstrapClientDateEditStatic extends ASPxClientDateEditStatic { +} +interface BootstrapClientDropDownEditStatic extends ASPxClientDropDownEditStatic { +} +interface BootstrapClientFormLayoutStatic extends ASPxClientFormLayoutStatic { +} +interface BootstrapClientHyperLinkStatic extends ASPxClientHyperLinkStatic { +} +interface BootstrapClientImageStatic extends ASPxClientImageStatic { +} +interface BootstrapClientListBoxStatic extends ASPxClientListBoxStatic { +} +interface BootstrapClientCheckBoxListStatic extends ASPxClientCheckBoxListStatic { +} +interface BootstrapClientRadioButtonListStatic extends ASPxClientRadioButtonListStatic { +} +interface BootstrapClientMenuStatic extends ASPxClientMenuStatic { +} +interface BootstrapClientPagerStatic extends ASPxClientPagerStatic { +} +interface BootstrapClientPopupControlStatic extends ASPxClientPopupControlStatic { +} +interface BootstrapClientPopupMenuStatic extends ASPxClientPopupMenuStatic { +} +interface BootstrapClientProgressBarStatic extends ASPxClientProgressBarStatic { +} +interface BootstrapClientSpinEditStatic extends ASPxClientSpinEditStatic { +} +interface BootstrapClientTabControlStatic extends ASPxClientTabControlStatic { +} +interface BootstrapClientPageControlStatic extends ASPxClientPageControlStatic { +} +interface BootstrapClientTextBoxStatic extends ASPxClientTextBoxStatic { +} +interface BootstrapClientMemoStatic extends ASPxClientMemoStatic { +} +interface BootstrapClientButtonEditStatic extends ASPxClientButtonEditStatic { +} +interface BootstrapClientTreeViewStatic extends ASPxClientTreeViewStatic { +} +interface BootstrapUIWidgetBaseStatic extends ASPxClientControlStatic { +} +interface BootstrapClientUploadControlStatic extends ASPxClientUploadControlStatic { +} +interface BootstrapClientGridViewStatic extends ASPxClientGridViewStatic { +} +interface MVCxClientCalendarStatic extends ASPxClientCalendarStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientCalendar; +} +interface MVCxClientCallbackPanelStatic extends ASPxClientCallbackPanelStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientCallbackPanel; +} +interface MVCxClientCardViewStatic extends ASPxClientCardViewStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientCardView; +} +interface MVCxClientChartStatic extends ASPxClientWebChartControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientChart; +} +interface MVCxClientComboBoxStatic extends ASPxClientComboBoxStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientComboBox; +} +interface MVCxClientDataViewStatic extends ASPxClientDataViewStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientDataView; +} +interface MVCxClientDateEditStatic extends ASPxClientDateEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientDateEdit; +} +interface MVCxClientDockManagerStatic extends ASPxClientDockManagerStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientDockManager; +} +interface MVCxClientDockPanelStatic extends ASPxClientDockPanelStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientDockPanel; +} +interface MVCxClientFileManagerStatic extends ASPxClientFileManagerStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientFileManager; +} +interface MVCxClientGridViewStatic extends ASPxClientGridViewStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientGridView; +} +interface MVCxClientHtmlEditorStatic extends ASPxClientHtmlEditorStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientHtmlEditor; +} +interface MVCxClientImageGalleryStatic extends ASPxClientImageGalleryStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientImageGallery; +} +interface MVCxClientListBoxStatic extends ASPxClientListBoxStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientListBox; +} +interface MVCxClientNavBarStatic extends ASPxClientNavBarStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientNavBar; +} +interface MVCxClientPivotGridStatic extends ASPxClientPivotGridStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientPivotGrid; +} +interface MVCxClientPopupControlStatic extends ASPxClientPopupControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientPopupControl; +} +interface MVCxClientDocumentViewerStatic extends ASPxClientDocumentViewerStatic { +} +interface MVCxClientReportViewerStatic extends ASPxClientReportViewerStatic { +} +interface MVCxClientReportDesignerStatic extends ASPxClientReportDesignerStatic { +} +interface MVCxClientRichEditStatic extends ASPxClientRichEditStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientRichEdit; +} +interface MVCxClientRoundPanelStatic extends ASPxClientRoundPanelStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientRoundPanel; +} +interface MVCxClientSchedulerStatic extends ASPxClientSchedulerStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientScheduler; +} +interface MVCxSchedulerToolTipTypeStatic { + /** + * The tooltip is displayed for a selected appointment. + */ + Appointment: number; + /** + * The tooltip is displayed for a dragged appointment. + */ + AppointmentDrag: number; + /** + * The tooltip is displayed for a selected time interval. + */ + Selection: number; +} +interface MVCxClientSpreadsheetStatic extends ASPxClientSpreadsheetStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientSpreadsheet; +} +interface MVCxClientPageControlStatic extends ASPxClientPageControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientPageControl; +} +interface MVCxClientTokenBoxStatic extends ASPxClientTokenBoxStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientTokenBox; +} +interface MVCxClientTreeListStatic extends ASPxClientTreeListStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientTreeList; +} +interface MVCxClientTreeViewStatic extends ASPxClientTreeViewStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientTreeView; +} +interface MVCxClientUploadControlStatic extends ASPxClientUploadControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientUploadControl; +} +interface MVCxClientUtilsStatic { + /** + * Loads service resources (such as scripts, CSS files, etc.) required for DevExpress functionality to work properly after a non DevExpress callback has been processed on the server and returned back to the client. + */ + FinalizeCallback(): void; + /** + * Returns values of editors placed in the specified container. + * @param containerOrId A container of editors, or its ID. + */ + GetSerializedEditorValuesInContainer(containerOrId: Object): Object; + /** + * Returns values of editors placed in the specified container. + * @param containerOrId A container of editors, or its ID. + * @param processInvisibleEditors true to process both visible and invisible editors that belong to the specified container; false to process only visible editors. + */ + GetSerializedEditorValuesInContainer(containerOrId: Object, processInvisibleEditors: boolean): Object; +} +interface MVCxClientGlobalEventsStatic { + /** + * Dynamically connects the ControlsInitialized client event with an appropriate event handler function. + * @param handler A object representing the event handling function's content. + */ + AddControlsInitializedEventHandler(handler: ASPxClientControlsInitializedEventHandler): void; + /** + * Dynamically connects the BeginCallback client event with an appropriate event handler function. + * @param handler A object containing the event handling function's content. + */ + AddBeginCallbackEventHandler(handler: MVCxClientBeginCallbackEventHandler): void; + /** + * Dynamically connects the EndCallback client event with an appropriate event handler function. + * @param handler A object containing the event handling function's content. + */ + AddEndCallbackEventHandler(handler: ASPxClientEndCallbackEventHandler): void; + /** + * Dynamically connects the CallbackError client event with an appropriate event handler function. + * @param handler A object containing the event handling function's content. + */ + AddCallbackErrorHandler(handler: ASPxClientCallbackErrorEventHandler): void; +} +interface MVCxClientVerticalGridStatic extends ASPxClientVerticalGridStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): MVCxClientVerticalGrid; +} +interface MVCxClientWebDocumentViewerStatic extends ASPxClientWebDocumentViewerStatic { +} +interface ASPxClientControlBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientControlBase; +} +interface ASPxClientControlStatic extends ASPxClientControlBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientControl; + /** + * Modifies the controls size on the page. + */ + AdjustControls(): void; + /** + * Modifies the controls size within the specified container. + * @param container An HTML element that is the container of the controls. + */ + AdjustControls(container: Object): void; + /** + * Returns a collection of client web control objects. + */ + GetControlCollection(): ASPxClientControlCollection; +} +interface ASPxClientCallbackStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCallback; +} +interface ASPxClientPanelBaseStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientPanelBase; +} +interface ASPxClientPanelStatic extends ASPxClientPanelBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientPanel; +} +interface ASPxClientCallbackPanelStatic extends ASPxClientPanelStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCallbackPanel; +} +interface ASPxClientCloudControlStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientCloudControl; +} +interface ASPxClientDataViewStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDataView; +} +interface ASPxClientDockManagerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDockManager; +} +interface ASPxClientPopupControlBaseStatic extends ASPxClientControlStatic { +} +interface ASPxClientDockPanelStatic extends ASPxClientPopupControlBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDockPanel; +} +interface ASPxClientDockZoneStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDockZone; +} +interface ASPxClientFileManagerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientFileManager; +} +interface ASPxClientFileManagerCommandConstsStatic { + /** + * The name of a command that is executed when an end-user renames an item. + */ + Rename: string; + /** + * The name of a command that is executed when an end-user moves an item. + */ + Move: string; + /** + * The name of a command that is executed when an end-user deletes an item. + */ + Delete: string; + /** + * The name of a command that is executed when an end-user creates a folder. + */ + Create: string; + /** + * The name of a command that is executed when an end-user uploads a file. + */ + Upload: string; + /** + * The name of a command that is executed when an end-user downloads an item. + */ + Download: string; + /** + * The name of a command that is executed when an end-user copies an item. + */ + Copy: string; + /** + * The name of a command that is executed when an end-user opens an item. + */ + Open: string; +} +interface ASPxClientFileManagerErrorConstsStatic { + /** + * The specified file is not found. Return Value: 0 + */ + FileNotFound: number; + /** + * The specified folder is not found. Return Value: 1 + */ + FolderNotFound: number; + /** + * Access is denied. Return Value: 2 + */ + AccessDenied: number; + /** + * Unspecified IO error occurs. Return Value: 3 + */ + UnspecifiedIO: number; + /** + * Unspecified error occurs. Return Value: 4 + */ + Unspecified: number; + /** + * The file/folder name is empty. Return Value: 5 + */ + EmptyName: number; + /** + * The operation was canceled. Return Value: 6 + */ + CanceledOperation: number; + /** + * The specified name contains invalid characters. Return Value: 7 + */ + InvalidSymbols: number; + /** + * The specified file extension is not allowed. Return Value: 8 + */ + WrongExtension: number; + /** + * The file/folder is being used by another process. Return Value: 9 + */ + UsedByAnotherProcess: number; + /** + * The specified file/folder already exists. Return Value: 10 + */ + AlreadyExists: number; +} +interface ASPxClientFormLayoutStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientFormLayout; +} +interface ASPxClientHiddenFieldStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientHiddenField; +} +interface ASPxClientHintStatic extends ASPxClientControlStatic { + /** + * Forces the hint to reselect target UI elements according to the specified CSS selector. + */ + Update(): void; + /** + * Forces the hint to recalculate its position. + */ + UpdatePosition(): void; + /** + * Forces the hint to recalculate its position. + * @param hintElementOrTargetElement An object that is the hint element or the target element. + */ + UpdatePosition(hintElementOrTargetElement: Object): void; + /** + * Registers a hint's functionality with the specified settings. + * @param targetSelector A string value that is the CSS selector. Specifies to which UI elements the hint is displayed. + * @param options An ASPxClientHintOptions object that is the hint's options. + */ + Register(targetSelector: string, options: ASPxClientHintOptions): ASPxClientHint; + /** + * Registers a hint's functionality with the specified settings. + * @param targetSelector A string value that is the CSS selector. Specifies to which UI elements the hint is displayed. + * @param contentAttribute A string value that is the attribute name. Specifies from which target element's attribute a hint obtains its content. + */ + Register(targetSelector: string, contentAttribute: string): ASPxClientHint; + /** + * Registers a hint's functionality with the specified settings. + * @param targetSelector A string value that is the CSS selector. Specifies for which UI elements the hint is displayed. + * @param onShowing An ASPxClientHintShowingEventHandler object that is a handler for the displayed event. + */ + Register(targetSelector: string, onShowing: ASPxClientHintShowingEventHandler): ASPxClientHint; + /** + * Invokes a hint. + * @param targetSelector A string value that is the CSS selector. + * @param options An ASPxClientHintOptions object that is the hint's options. + */ + Show(targetSelector: string, options: ASPxClientHintOptions): void; + /** + * Invokes a hint. + * @param targetSelector A string value that is the CSS selector used to specify for which UI elements on a web page a hint is displayed. + * @param content A string value that is the hint's content. + */ + Show(targetSelector: string, content: string): void; + /** + * Invokes a hint. + * @param targetElement An object that is the target element. + * @param options An ASPxClientHintOptions object that is the hint's options. + */ + Show(targetElement: Object, options: ASPxClientHintOptions): void; + /** + * Invokes a hint. + * @param targetElement A HTML DOM element near to which the hint is displayed in response to user interaction. + * @param content A string value that is the hint's content. + */ + Show(targetElement: Object, content: string): void; + /** + * Invokes a hint. + * @param options An ASPxClientHintOptions object that is the hint's options. + */ + Show(options: ASPxClientHintOptions): void; + /** + * Hides a hint window. + * @param targetSelector A string value that is the CSS selector. + */ + Hide(targetSelector: string): void; + /** + * Hides a hint window. + * @param targetElementOrHintElement An object that is the target element or hint element. + */ + Hide(targetElementOrHintElement: Object): void; + /** + * Hides all hints. + */ + HideAll(): void; +} +interface ASPxClientImageGalleryStatic extends ASPxClientDataViewStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientImageGallery; +} +interface ASPxClientImageSliderStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientImageSlider; +} +interface ASPxClientImageZoomNavigatorStatic extends ASPxClientImageSliderStatic { +} +interface ASPxClientImageZoomStatic extends ASPxClientControlStatic { +} +interface ASPxClientLoadingPanelStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientLoadingPanel; +} +interface ASPxClientMediaFileSelectorStatic extends ASPxClientControlStatic { +} +interface ASPxClientMenuBaseStatic extends ASPxClientControlStatic { + /** + * Returns a collection of client menu objects. + */ + GetMenuCollection(): ASPxClientMenuCollection; +} +interface ASPxClientMenuStatic extends ASPxClientMenuBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientMenu; +} +interface ASPxClientTouchUIStatic { + /** + * Extends the specified element's functionality with scrolling via touch behavior (one finger) and the ability to display vertical and horizontal scroll bars. + * @param id A string value specifying the element's ID. + */ + MakeScrollable(id: string): ScrollExtender; + /** + * Extends the specified element's functionality with scrolling via touch behavior (one finger) and the ability to display vertical and horizontal scroll bars. + * @param element An object that specifies the required DOM element. + */ + MakeScrollable(element: Object): ScrollExtender; + /** + * Extends the specified element's functionality with scrolling via touch behavior (one finger) and customized scrollbar-related options. + * @param id A string value specifying the name of a DOM element that should be extended with the touch scrolling functionality. + * @param options An ASPxClientTouchUIOptions object that provides options affecting the touch scrolling functionality. + */ + MakeScrollable(id: string, options: ASPxClientTouchUIOptions): ScrollExtender; + /** + * Extends the specified element's functionality with scrolling via touch behavior (one finger) and customized scrollbar-related options. + * @param element An object specifying the DOM element to extend with the touch scrolling functionality. + * @param options An ASPxClientTouchUIOptions object that provides options affecting the touch scrolling functionality. + */ + MakeScrollable(element: Object, options: ASPxClientTouchUIOptions): ScrollExtender; +} +interface ASPxClientNavBarStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientNavBar; +} +interface ASPxClientNewsControlStatic extends ASPxClientDataViewStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientNewsControl; +} +interface ASPxClientObjectContainerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientObjectContainer; +} +interface ASPxClientPagerStatic extends ASPxClientControlStatic { +} +interface ASPxClientPopupControlStatic extends ASPxClientPopupControlBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientPopupControl; + /** + * Returns a collection of client popup control objects. + */ + GetPopupControlCollection(): ASPxClientPopupControlCollection; +} +interface ASPxClientPopupControlResizeStateStatic { + /** + * A window has been resized. Returns 0. + */ + Resized: number; + /** + * A window has been collapsed. Returns 1. + */ + Collapsed: number; + /** + * A window has been expanded. Returns 2. + */ + Expanded: number; + /** + * A window has been maximized. Returns 3. + */ + Maximized: number; + /** + * A window has been restored after maximizing. Returns 4. + */ + RestoredAfterMaximized: number; +} +interface ASPxClientPopupControlCloseReasonStatic { + /** + * The window has been closed by an API. + */ + API: string; + /** + * An end-user clicks the close header button. + */ + CloseButton: string; + /** + * An end-user clicks outside the window's region + */ + OuterMouseClick: string; + /** + * An end-user moves the mouse pointer out of the window region. + */ + MouseOut: string; + /** + * An end-user presses the ESC key. + */ + Escape: string; +} +interface ASPxClientPopupMenuStatic extends ASPxClientMenuBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientPopupMenu; +} +interface ASPxClientRatingControlStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientRatingControl; +} +interface ASPxClientRibbonStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientRibbon; +} +interface ASPxClientRibbonStateStatic { + /** + * A ribbon is in the normal state. Returns 0 + */ + Normal: number; + /** + * A ribbon is minimized. Returns 1 + */ + Minimized: number; + /** + * A ribbon is temporarily shown. Returns 2 + */ + TemporaryShown: number; +} +interface ASPxClientRoundPanelStatic extends ASPxClientPanelBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientRoundPanel; +} +interface ASPxClientSplitterStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientSplitter; +} +interface ASPxClientTabControlBaseStatic extends ASPxClientControlStatic { +} +interface ASPxClientTabControlStatic extends ASPxClientTabControlBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTabControl; +} +interface ASPxClientPageControlStatic extends ASPxClientTabControlBaseStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientPageControl; +} +interface ASPxClientTimerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTimer; +} +interface ASPxClientTitleIndexStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTitleIndex; +} +interface ASPxClientTreeViewStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientTreeView; +} +interface ASPxClientUploadControlStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientUploadControl; +} +interface ASPxClientUploadControlValidationErrorTypeConstsStatic { + /** + * The allowed maximum file size is exceeded. Return Value: 1 + */ + MaxFileSizeExceeded: number; + /** + * The file's extension is not allowed. Return Value: 2 + */ + NotAllowedFileExtension: number; + /** + * The allowed maximum count of the files is exceeded. Return Value: 3 + */ + MaxFileCountExceeded: number; + /** + * A file name contains invalid character.Return Value: 4 + */ + FileNameContainsInvalidCharacter: number; +} +interface ASPxClientUtilsStatic { + /** + * Gets the user-agent string, which identifies the client browser and provides certain system details of the client computer. + * Value: A string value representing the browser's user-agent string. + */ + agent: string; + /** + * Gets a value that specifies whether the client browser is Opera. + * Value: true if the client browser is Opera; otherwise, false. + */ + opera: boolean; + /** + * Gets a value that specifies whether the client browser is Opera version 9. + * Value: true if the client browser is Opera version 9; otherwise, false. + */ + opera9: boolean; + /** + * Gets a value that specifies whether the client browser is Safari. + * Value: true if the client browser is Safari; otherwise, false. + */ + safari: boolean; + /** + * Gets a value that specifies whether the client browser is Safari version 3. + * Value: true if the client browser is Safari version 3; otherwise, false. + */ + safari3: boolean; + /** + * Gets a value that specifies whether the client browser is Safari, running under a MacOS operating system. + * Value: true if the client browser is Safari, running under a MacOS operating system; otherwise, false. + */ + safariMacOS: boolean; + /** + * Gets a value that specifies whether the client browser is Google Chrome. + * Value: true if the client browser is Google Chrome; otherwise, false. + */ + chrome: boolean; + /** + * Gets a value that specifies whether the client browser is Internet Explorer. + * Value: true if the client browser is Intenet Explorer; otherwise, false. + */ + ie: boolean; + /** + * Gets a value that specifies whether the client browser is Internet Explorer version 7. + * Value: true if the client browser is Intenet Explorer version 7; otherwise, false. + */ + ie7: boolean; + /** + * Gets a value that specifies whether the client browser is Firefox. + * Value: true if the client browser is Firefox; otherwise, false. + */ + firefox: boolean; + /** + * Gets a value that specifies whether the client browser is Firefox version 3. + * Value: true if the client browser is Firefox version 3; otherwise, false. + */ + firefox3: boolean; + /** + * Gets a value that specifies whether the client browser is Mozilla. + * Value: true if the client browser is Mozilla; otherwise, false. + */ + mozilla: boolean; + /** + * Gets a value that specifies whether the client browser is Netscape. + * Value: true if the client browser is Netscape; otherwise, false. + */ + netscape: boolean; + /** + * Gets a value that specifies a client browser's full version. + * Value: A double precision floating-point value that specifies a client browser's version. + */ + browserVersion: number; + /** + * Gets a value that specifies a client browser's major version. + * Value: An integer value that specifies a client browser's major version. + */ + browserMajorVersion: number; + /** + * Gets a value that specifies whether the application is run under a MacOS platform. + * Value: true if the application is run under the MacOS platform; otherwise, false. + */ + macOSPlatform: boolean; + /** + * Gets a value that specifies whether the application is run under the Windows platform. + * Value: true if the application is run under the Windows platform; otherwise, false. + */ + windowsPlatform: boolean; + /** + * Gets a value that specifies whether a client browser is based on WebKit. + * Value: true if the client browser is based on WebKit; otherwise, false. + */ + webKitFamily: boolean; + /** + * Gets a value that specifies whether a client browser is based on Netscape. + * Value: true if client browser is based on Netscape; otherwise, false. + */ + netscapeFamily: boolean; + /** + * Gets a value that specifies whether the client browser supports touch. + * Value: true if the client browser supports touch; otherwise, false. + */ + touchUI: boolean; + /** + * Gets a value that specifies whether the client browser supports the WebKit touch user interface. + * Value: true if the client browser supports the WebKit touch user interface; otherwise, false. + */ + webKitTouchUI: boolean; + /** + * Gets a value that specifies whether the client browser supports the Microsoft touch user interface. + * Value: true if the client browser supports the Microsoft touch user interface; otherwise, false. + */ + msTouchUI: boolean; + /** + * Gets a value that specifies whether the application is run under an iOS platform. + * Value: true if the application is run under the iOS platform; otherwise, false. + */ + iOSPlatform: boolean; + /** + * Gets a value that specifies whether the application is run under the Android platform. + * Value: true if the application is run under the Android platform; otherwise, false. + */ + androidPlatform: boolean; + /** + * Inserts the specified item into the specified array object. + * @param array An object that specifies the array to manipulate. + * @param element An object that specifies the array item to insert. + */ + ArrayInsert(array: Object[], element: Object): void; + /** + * Removes the specified item from the specified array object. + * @param array An object that specifies the array to manipulate. + * @param element An object that specifies the array item to remove. + */ + ArrayRemove(array: Object[], element: Object): void; + /** + * Removes an item at the specified index location from the specified array object. + * @param array An object that specifies the array to manipulate. + * @param index The zero-based index location of the array item to remove. + */ + ArrayRemoveAt(array: Object[], index: number): void; + /** + * Removes all items from the specified array object. + * @param array An object that specifies the array to manipulate. + */ + ArrayClear(array: Object[]): void; + /** + * Searches for the specified array item and returns the zero-based index of its first occurrence within the specified array object. + * @param array An object that specifies the array to manipulate. + * @param element An object that specifies the array item to locate. + */ + ArrayIndexOf(array: Object[], element: Object): number; + /** + * Binds the specified function to a specific element's event, so that the function gets called whenever the event fires on the element. + * @param element An object specifying the required element. + * @param eventName A string value that specifies the required event name without the "on" prefix. + * @param method An object that specifies the event's handling function. + */ + AttachEventToElement(element: Object, eventName: string, method: Object): void; + /** + * Unbinds the specified function from a specific element's event, so that the function stops receiving notifications when the event fires. + * @param element An object specifying the required element. + * @param eventName A string value that specifies the required event name. + * @param method An object that specifies the event's handling function. + */ + DetachEventFromElement(element: Object, eventName: string, method: Object): void; + /** + * Returns the object that fired the event. + * @param htmlEvent An object that represents the current event. + */ + GetEventSource(htmlEvent: Object): Object; + /** + * Gets the x-coordinate of the event-related mouse pointer position relative to an end-user's screen. + * @param htmlEvent An object specifying the required HTML event. + */ + GetEventX(htmlEvent: Object): number; + /** + * Gets the y-coordinate of the event-related mouse pointer position relative to an end-user's screen. + * @param htmlEvent An object specifying the required HTML event. + */ + GetEventY(htmlEvent: Object): number; + /** + * Gets the keyboard code for the specified event. + * @param htmlEvent An object specifying the required HTML event. + */ + GetKeyCode(htmlEvent: Object): number; + /** + * Cancels the default action of the specified event. + * @param htmlEvent An object that specifies the required HTML event. + */ + PreventEvent(htmlEvent: Object): boolean; + /** + * Cancels both the specified event's default action and the event's bubbling upon the hierarchy of event handlers. + * @param htmlEvent An object that specifies the required HTML event. + */ + PreventEventAndBubble(htmlEvent: Object): boolean; + /** + * Removes mouse capture from the specified event's source object. + * @param htmlEvent An object that specifies the required HTML event. + */ + PreventDragStart(htmlEvent: Object): boolean; + /** + * Clears any text selection made within the window's client region. + */ + ClearSelection(): void; + /** + * Gets a value that indicates whether the specified object exists on the client side. + * @param obj The object to test. + */ + IsExists(obj: Object): boolean; + /** + * Gets a value that indicates whether the specified object is a function. + * @param obj The object to test. + */ + IsFunction(obj: Object): boolean; + /** + * Gets the x-coordinate of the specified element's top left corner relative to the client area of the window, excluding scroll bars. + * @param element An object identifying the HTML element whose position should be obtained. + */ + GetAbsoluteX(element: Object): number; + /** + * Gets the y-coordinate of the specified element's top left corner relative to the client area of the window, excluding scroll bars. + * @param element An object identifying the HTML element whose position should be obtained. + */ + GetAbsoluteY(element: Object): number; + /** + * Sets the x-coordinate of the specified element's top left corner relative to the client area of the window, excluding scroll bars. + * @param element An object identifying the HTML element whose position should be defined. + * @param x An integer value specifying the required element's x-coordinate, in pixels. + */ + SetAbsoluteX(element: Object, x: number): void; + /** + * Sets the y-coordinate of the specified element's top left corner relative to the client area of the window, excluding scroll bars. + * @param element An object identifying the HTML element whose position should be defined. + * @param y An integer value specifying the required element's y-coordinate, in pixels. + */ + SetAbsoluteY(element: Object, y: number): void; + /** + * Returns the distance between the top edge of the document and the topmost portion of the content currently visible in the window. + */ + GetDocumentScrollTop(): number; + /** + * Returns the distance between the left edge of the document and the leftmost portion of the content currently visible in the window. + */ + GetDocumentScrollLeft(): number; + /** + * Gets the width of the window's client region. + */ + GetDocumentClientWidth(): number; + /** + * Gets the height of the window's client region. + */ + GetDocumentClientHeight(): number; + /** + * Gets a value indicating whether the object passed via the parentElement parameter is a parent of the object passed via the element parameter. + * @param parentElement An object specifying the parent HTML element. + * @param element An object specifying the child HTML element. + */ + GetIsParent(parentElement: Object, element: Object): boolean; + /** + * Returns a reference to the specified HTML element's first parent object which has an ID that matches the specified value. + * @param element An object specifying the child HTML element whose parent elements are searched. + * @param id A string specifying the required parent's ID. + */ + GetParentById(element: Object, id: string): Object; + /** + * Returns a reference to the specified HTML element's first parent object whose element name matches the specified value. + * @param element An object specifying the child HTML element whose parent elements are searched. + * @param tagName A string value specifying the element name (tag name) of the desired HTML element. + */ + GetParentByTagName(element: Object, tagName: string): Object; + /** + * Returns a reference to the specified HTML element's first parent object whose class name matches the specified value. + * @param element An object specifying the child HTML element whose parent elements are searched. + * @param className A string value specifying the class name of the desired HTML element. + */ + GetParentByClassName(element: Object, className: string): Object; + /** + * Returns a reference to the first element that has the specified ID in the parent HTML element specified. + * @param element An object identifying the parent HTML element to search. + * @param id A string specifying the ID attribute value of the desired child element. + */ + GetChildById(element: Object, id: string): Object; + /** + * Returns a reference to the particular element that has the specified element name and is contained within the specified parent HTML element. + * @param element An object specifying the parent HTML element to search. + * @param tagName A string value specifying the element name (tag name) of the desired HTML element. + * @param index An integer value specifying the zero-based index of the desired element amongst all the matching elements found. + */ + GetChildByTagName(element: Object, tagName: string, index: number): Object; + /** + * Creates or updates the HTTP cookie for the response. + * @param name A string value that represents the name of a cookie. + * @param value A string representing the cookie value. + */ + SetCookie(name: string, value: string): void; + /** + * Creates or updates the HTTP cookie for the response. + * @param name A string value that represents the name of a cookie. + * @param value A string representing the cookie value. + * @param expirationDate A date-time object that represents the expiration date and time for the cookie. + */ + SetCookie(name: string, value: string, expirationDate: Date): void; + /** + * Retrieves a cookie with the specified name. + * @param name A string value that represents the name of a cookie. + */ + GetCookie(name: string): string; + /** + * Deletes a cookie with the specified name. + * @param name A string value that represents the name of a cookie. + */ + DeleteCookie(name: string): void; + /** + * Returns a specifically generated code that uniquely identifies the combination of keys specified via the parameters. + * @param keyCode An integer value that specifies the code of the key. + * @param isCtrlKey true if the CTRL key should be included into the key combination; otherwise, false. + * @param isShiftKey true if the SHIFT key should be included into the key combination; otherwise, false. + * @param isAltKey true if the ALT key should be included into the key combination; otherwise, false. + */ + GetShortcutCode(keyCode: number, isCtrlKey: boolean, isShiftKey: boolean, isAltKey: boolean): number; + /** + * Returns a specifically generated code that uniquely identifies the pressed key combination, which is specified by the related HTML event. + * @param htmlEvent A DHTML event object that relates to a key combination being pressed. + */ + GetShortcutCodeByEvent(htmlEvent: Object): number; + /** + * Returns a specifically generated code that uniquely identifies the combination of keys specified via the parameter. + * @param shortcutString A string value that specifies the key combination. + */ + StringToShortcutCode(shortcutString: string): number; + /** + * Trims all leading and trailing whitespaces from the string. + * @param str A string value representing the string for trimming. + */ + Trim(str: string): string; + /** + * Trims all leading whitespaces from the string. + * @param str A string value representing the string for trimming. + */ + TrimStart(str: string): string; + /** + * Trims all trailing whitespaces from the string. + * @param str A string value representing the string for trimming. + */ + TrimEnd(str: string): string; + /** + * Specifies the text that Assistive Technologies (screen readers or braille display, for example) will provide to a user. + * @param message A String value that specifies a text. + */ + SendMessageToAssistiveTechnology(message: string): void; +} +interface ASPxClientChartDesignerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientChartDesigner; +} +interface ASPxClientWebChartControlStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientWebChartControl; +} +interface ASPxClientDocumentViewerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientDocumentViewer; +} +interface ASPxClientQueryBuilderStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientQueryBuilder; +} +interface ASPxClientReportDesignerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientReportDesigner; +} +interface ASPxClientReportDocumentMapStatic extends ASPxClientControlStatic { +} +interface ASPxClientReportParametersPanelStatic extends ASPxClientControlStatic { +} +interface ASPxClientReportToolbarStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientReportToolbar; +} +interface ASPxClientReportViewerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientReportViewer; +} +interface ASPxClientWebDocumentViewerStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ + Cast(obj: Object): ASPxClientWebDocumentViewer; +} + +declare var MVCxClientDashboardViewer: MVCxClientDashboardViewerStatic; +declare var DashboardDataAxisNames: DashboardDataAxisNamesStatic; +declare var DashboardSpecialValues: DashboardSpecialValuesStatic; +declare var DashboardExportPageLayout: DashboardExportPageLayoutStatic; +declare var DashboardExportPaperKind: DashboardExportPaperKindStatic; +declare var DashboardExportScaleMode: DashboardExportScaleModeStatic; +declare var DashboardExportFilterState: DashboardExportFilterStateStatic; +declare var DashboardStateExportPosition: DashboardStateExportPositionStatic; +declare var DashboardStateExcelExportPosition: DashboardStateExcelExportPositionStatic; +declare var DashboardExportImageFormat: DashboardExportImageFormatStatic; +declare var ExcelExportFilterState: ExcelExportFilterStateStatic; +declare var DashboardExportExcelFormat: DashboardExportExcelFormatStatic; +declare var ChartExportSizeMode: ChartExportSizeModeStatic; +declare var MapExportSizeMode: MapExportSizeModeStatic; +declare var TreemapExportSizeMode: TreemapExportSizeModeStatic; +declare var RangeFilterExportSizeMode: RangeFilterExportSizeModeStatic; +declare var DashboardSelectionMode: DashboardSelectionModeStatic; +declare var ASPxClientDashboard: ASPxClientDashboardStatic; +declare var ASPxClientDashboardViewer: ASPxClientDashboardViewerStatic; +declare var ASPxClientEditBase: ASPxClientEditBaseStatic; +declare var ASPxClientEdit: ASPxClientEditStatic; +declare var ASPxClientBinaryImage: ASPxClientBinaryImageStatic; +declare var ASPxClientButton: ASPxClientButtonStatic; +declare var ASPxClientCalendar: ASPxClientCalendarStatic; +declare var ASPxClientCaptcha: ASPxClientCaptchaStatic; +declare var ASPxClientCheckBox: ASPxClientCheckBoxStatic; +declare var ASPxClientRadioButton: ASPxClientRadioButtonStatic; +declare var ASPxClientTextEdit: ASPxClientTextEditStatic; +declare var ASPxClientTextBoxBase: ASPxClientTextBoxBaseStatic; +declare var ASPxClientButtonEditBase: ASPxClientButtonEditBaseStatic; +declare var ASPxClientDropDownEditBase: ASPxClientDropDownEditBaseStatic; +declare var ASPxClientColorEdit: ASPxClientColorEditStatic; +declare var ASPxClientComboBox: ASPxClientComboBoxStatic; +declare var ASPxClientDateEdit: ASPxClientDateEditStatic; +declare var ASPxClientDropDownEdit: ASPxClientDropDownEditStatic; +declare var ASPxClientFilterControl: ASPxClientFilterControlStatic; +declare var ASPxClientListEdit: ASPxClientListEditStatic; +declare var ASPxClientListBox: ASPxClientListBoxStatic; +declare var ASPxClientCheckListBase: ASPxClientCheckListBaseStatic; +declare var ASPxClientRadioButtonList: ASPxClientRadioButtonListStatic; +declare var ASPxClientCheckBoxList: ASPxClientCheckBoxListStatic; +declare var ASPxClientProgressBar: ASPxClientProgressBarStatic; +declare var ASPxClientSpinEditBase: ASPxClientSpinEditBaseStatic; +declare var ASPxClientSpinEdit: ASPxClientSpinEditStatic; +declare var ASPxClientTimeEdit: ASPxClientTimeEditStatic; +declare var ASPxClientStaticEdit: ASPxClientStaticEditStatic; +declare var ASPxClientHyperLink: ASPxClientHyperLinkStatic; +declare var ASPxClientImageBase: ASPxClientImageBaseStatic; +declare var ASPxClientImage: ASPxClientImageStatic; +declare var ASPxClientLabel: ASPxClientLabelStatic; +declare var ASPxClientTextBox: ASPxClientTextBoxStatic; +declare var ASPxClientMemo: ASPxClientMemoStatic; +declare var ASPxClientButtonEdit: ASPxClientButtonEditStatic; +declare var ASPxClientTokenBox: ASPxClientTokenBoxStatic; +declare var ASPxClientTrackBar: ASPxClientTrackBarStatic; +declare var ASPxClientValidationSummary: ASPxClientValidationSummaryStatic; +declare var ASPxClientGaugeControl: ASPxClientGaugeControlStatic; +declare var ASPxClientGridBase: ASPxClientGridBaseStatic; +declare var ASPxClientGridViewCallbackCommand: ASPxClientGridViewCallbackCommandStatic; +declare var ASPxClientGridLookup: ASPxClientGridLookupStatic; +declare var ASPxClientCardView: ASPxClientCardViewStatic; +declare var ASPxClientGridView: ASPxClientGridViewStatic; +declare var ASPxClientVerticalGrid: ASPxClientVerticalGridStatic; +declare var ASPxClientVerticalGridCallbackCommand: ASPxClientVerticalGridCallbackCommandStatic; +declare var ASPxClientCommandConsts: ASPxClientCommandConstsStatic; +declare var ASPxClientHtmlEditor: ASPxClientHtmlEditorStatic; +declare var ASPxClientHtmlEditorMediaPreloadMode: ASPxClientHtmlEditorMediaPreloadModeStatic; +declare var ASPxClientPivotGrid: ASPxClientPivotGridStatic; +declare var ASPxClientPivotCustomization: ASPxClientPivotCustomizationStatic; +declare var ASPxClientRichEdit: ASPxClientRichEditStatic; +declare var ASPxSchedulerDateTimeHelper: ASPxSchedulerDateTimeHelperStatic; +declare var ASPxClientWeekDaysCheckEdit: ASPxClientWeekDaysCheckEditStatic; +declare var ASPxClientRecurrenceRangeControl: ASPxClientRecurrenceRangeControlStatic; +declare var ASPxClientRecurrenceControlBase: ASPxClientRecurrenceControlBaseStatic; +declare var ASPxClientDailyRecurrenceControl: ASPxClientDailyRecurrenceControlStatic; +declare var ASPxClientWeeklyRecurrenceControl: ASPxClientWeeklyRecurrenceControlStatic; +declare var ASPxClientMonthlyRecurrenceControl: ASPxClientMonthlyRecurrenceControlStatic; +declare var ASPxClientYearlyRecurrenceControl: ASPxClientYearlyRecurrenceControlStatic; +declare var ASPxClientRecurrenceTypeEdit: ASPxClientRecurrenceTypeEditStatic; +declare var ASPxClientTimeInterval: ASPxClientTimeIntervalStatic; +declare var ASPxClientScheduler: ASPxClientSchedulerStatic; +declare var ASPxClientSpellChecker: ASPxClientSpellCheckerStatic; +declare var ASPxClientSpellCheckerStopCheckingReason: ASPxClientSpellCheckerStopCheckingReasonStatic; +declare var ASPxClientSpreadsheet: ASPxClientSpreadsheetStatic; +declare var ASPxClientTreeList: ASPxClientTreeListStatic; +declare var BootstrapClientAccordion: BootstrapClientAccordionStatic; +declare var BootstrapClientBinaryImage: BootstrapClientBinaryImageStatic; +declare var BootstrapClientButton: BootstrapClientButtonStatic; +declare var BootstrapClientCalendar: BootstrapClientCalendarStatic; +declare var BootstrapClientCallbackPanel: BootstrapClientCallbackPanelStatic; +declare var BootstrapClientChartBase: BootstrapClientChartBaseStatic; +declare var BootstrapClientChart: BootstrapClientChartStatic; +declare var BootstrapClientPolarChart: BootstrapClientPolarChartStatic; +declare var BootstrapClientPieChart: BootstrapClientPieChartStatic; +declare var BootstrapClientCheckBox: BootstrapClientCheckBoxStatic; +declare var BootstrapClientRadioButton: BootstrapClientRadioButtonStatic; +declare var BootstrapClientComboBox: BootstrapClientComboBoxStatic; +declare var BootstrapClientDateEdit: BootstrapClientDateEditStatic; +declare var BootstrapClientDropDownEdit: BootstrapClientDropDownEditStatic; +declare var BootstrapClientFormLayout: BootstrapClientFormLayoutStatic; +declare var BootstrapClientHyperLink: BootstrapClientHyperLinkStatic; +declare var BootstrapClientImage: BootstrapClientImageStatic; +declare var BootstrapClientListBox: BootstrapClientListBoxStatic; +declare var BootstrapClientCheckBoxList: BootstrapClientCheckBoxListStatic; +declare var BootstrapClientRadioButtonList: BootstrapClientRadioButtonListStatic; +declare var BootstrapClientMenu: BootstrapClientMenuStatic; +declare var BootstrapClientPager: BootstrapClientPagerStatic; +declare var BootstrapClientPopupControl: BootstrapClientPopupControlStatic; +declare var BootstrapClientPopupMenu: BootstrapClientPopupMenuStatic; +declare var BootstrapClientProgressBar: BootstrapClientProgressBarStatic; +declare var BootstrapClientSpinEdit: BootstrapClientSpinEditStatic; +declare var BootstrapClientTabControl: BootstrapClientTabControlStatic; +declare var BootstrapClientPageControl: BootstrapClientPageControlStatic; +declare var BootstrapClientTextBox: BootstrapClientTextBoxStatic; +declare var BootstrapClientMemo: BootstrapClientMemoStatic; +declare var BootstrapClientButtonEdit: BootstrapClientButtonEditStatic; +declare var BootstrapClientTreeView: BootstrapClientTreeViewStatic; +declare var BootstrapUIWidgetBase: BootstrapUIWidgetBaseStatic; +declare var BootstrapClientUploadControl: BootstrapClientUploadControlStatic; +declare var BootstrapClientGridView: BootstrapClientGridViewStatic; +declare var MVCxClientCalendar: MVCxClientCalendarStatic; +declare var MVCxClientCallbackPanel: MVCxClientCallbackPanelStatic; +declare var MVCxClientCardView: MVCxClientCardViewStatic; +declare var MVCxClientChart: MVCxClientChartStatic; +declare var MVCxClientComboBox: MVCxClientComboBoxStatic; +declare var MVCxClientDataView: MVCxClientDataViewStatic; +declare var MVCxClientDateEdit: MVCxClientDateEditStatic; +declare var MVCxClientDockManager: MVCxClientDockManagerStatic; +declare var MVCxClientDockPanel: MVCxClientDockPanelStatic; +declare var MVCxClientFileManager: MVCxClientFileManagerStatic; +declare var MVCxClientGridView: MVCxClientGridViewStatic; +declare var MVCxClientHtmlEditor: MVCxClientHtmlEditorStatic; +declare var MVCxClientImageGallery: MVCxClientImageGalleryStatic; +declare var MVCxClientListBox: MVCxClientListBoxStatic; +declare var MVCxClientNavBar: MVCxClientNavBarStatic; +declare var MVCxClientPivotGrid: MVCxClientPivotGridStatic; +declare var MVCxClientPopupControl: MVCxClientPopupControlStatic; +declare var MVCxClientDocumentViewer: MVCxClientDocumentViewerStatic; +declare var MVCxClientReportViewer: MVCxClientReportViewerStatic; +declare var MVCxClientReportDesigner: MVCxClientReportDesignerStatic; +declare var MVCxClientRichEdit: MVCxClientRichEditStatic; +declare var MVCxClientRoundPanel: MVCxClientRoundPanelStatic; +declare var MVCxClientScheduler: MVCxClientSchedulerStatic; +declare var MVCxSchedulerToolTipType: MVCxSchedulerToolTipTypeStatic; +declare var MVCxClientSpreadsheet: MVCxClientSpreadsheetStatic; +declare var MVCxClientPageControl: MVCxClientPageControlStatic; +declare var MVCxClientTokenBox: MVCxClientTokenBoxStatic; +declare var MVCxClientTreeList: MVCxClientTreeListStatic; +declare var MVCxClientTreeView: MVCxClientTreeViewStatic; +declare var MVCxClientUploadControl: MVCxClientUploadControlStatic; +declare var MVCxClientUtils: MVCxClientUtilsStatic; +declare var MVCxClientGlobalEvents: MVCxClientGlobalEventsStatic; +declare var MVCxClientVerticalGrid: MVCxClientVerticalGridStatic; +declare var MVCxClientWebDocumentViewer: MVCxClientWebDocumentViewerStatic; +declare var ASPxClientControlBase: ASPxClientControlBaseStatic; +declare var ASPxClientControl: ASPxClientControlStatic; +declare var ASPxClientCallback: ASPxClientCallbackStatic; +declare var ASPxClientPanelBase: ASPxClientPanelBaseStatic; +declare var ASPxClientPanel: ASPxClientPanelStatic; +declare var ASPxClientCallbackPanel: ASPxClientCallbackPanelStatic; +declare var ASPxClientCloudControl: ASPxClientCloudControlStatic; +declare var ASPxClientDataView: ASPxClientDataViewStatic; +declare var ASPxClientDockManager: ASPxClientDockManagerStatic; +declare var ASPxClientPopupControlBase: ASPxClientPopupControlBaseStatic; +declare var ASPxClientDockPanel: ASPxClientDockPanelStatic; +declare var ASPxClientDockZone: ASPxClientDockZoneStatic; +declare var ASPxClientFileManager: ASPxClientFileManagerStatic; +declare var ASPxClientFileManagerCommandConsts: ASPxClientFileManagerCommandConstsStatic; +declare var ASPxClientFileManagerErrorConsts: ASPxClientFileManagerErrorConstsStatic; +declare var ASPxClientFormLayout: ASPxClientFormLayoutStatic; +declare var ASPxClientHiddenField: ASPxClientHiddenFieldStatic; +declare var ASPxClientHint: ASPxClientHintStatic; +declare var ASPxClientImageGallery: ASPxClientImageGalleryStatic; +declare var ASPxClientImageSlider: ASPxClientImageSliderStatic; +declare var ASPxClientImageZoomNavigator: ASPxClientImageZoomNavigatorStatic; +declare var ASPxClientImageZoom: ASPxClientImageZoomStatic; +declare var ASPxClientLoadingPanel: ASPxClientLoadingPanelStatic; +declare var ASPxClientMediaFileSelector: ASPxClientMediaFileSelectorStatic; +declare var ASPxClientMenuBase: ASPxClientMenuBaseStatic; +declare var ASPxClientMenu: ASPxClientMenuStatic; +declare var ASPxClientTouchUI: ASPxClientTouchUIStatic; +declare var ASPxClientNavBar: ASPxClientNavBarStatic; +declare var ASPxClientNewsControl: ASPxClientNewsControlStatic; +declare var ASPxClientObjectContainer: ASPxClientObjectContainerStatic; +declare var ASPxClientPager: ASPxClientPagerStatic; +declare var ASPxClientPopupControl: ASPxClientPopupControlStatic; +declare var ASPxClientPopupControlResizeState: ASPxClientPopupControlResizeStateStatic; +declare var ASPxClientPopupControlCloseReason: ASPxClientPopupControlCloseReasonStatic; +declare var ASPxClientPopupMenu: ASPxClientPopupMenuStatic; +declare var ASPxClientRatingControl: ASPxClientRatingControlStatic; +declare var ASPxClientRibbon: ASPxClientRibbonStatic; +declare var ASPxClientRibbonState: ASPxClientRibbonStateStatic; +declare var ASPxClientRoundPanel: ASPxClientRoundPanelStatic; +declare var ASPxClientSplitter: ASPxClientSplitterStatic; +declare var ASPxClientTabControlBase: ASPxClientTabControlBaseStatic; +declare var ASPxClientTabControl: ASPxClientTabControlStatic; +declare var ASPxClientPageControl: ASPxClientPageControlStatic; +declare var ASPxClientTimer: ASPxClientTimerStatic; +declare var ASPxClientTitleIndex: ASPxClientTitleIndexStatic; +declare var ASPxClientTreeView: ASPxClientTreeViewStatic; +declare var ASPxClientUploadControl: ASPxClientUploadControlStatic; +declare var ASPxClientUploadControlValidationErrorTypeConsts: ASPxClientUploadControlValidationErrorTypeConstsStatic; +declare var ASPxClientUtils: ASPxClientUtilsStatic; +declare var ASPxClientChartDesigner: ASPxClientChartDesignerStatic; +declare var ASPxClientWebChartControl: ASPxClientWebChartControlStatic; +declare var ASPxClientDocumentViewer: ASPxClientDocumentViewerStatic; +declare var ASPxClientQueryBuilder: ASPxClientQueryBuilderStatic; +declare var ASPxClientReportDesigner: ASPxClientReportDesignerStatic; +declare var ASPxClientReportDocumentMap: ASPxClientReportDocumentMapStatic; +declare var ASPxClientReportParametersPanel: ASPxClientReportParametersPanelStatic; +declare var ASPxClientReportToolbar: ASPxClientReportToolbarStatic; +declare var ASPxClientReportViewer: ASPxClientReportViewerStatic; +declare var ASPxClientWebDocumentViewer: ASPxClientWebDocumentViewerStatic; + diff --git a/types/devexpress-web/v171/tsconfig.json b/types/devexpress-web/v171/tsconfig.json new file mode 100644 index 0000000000..af3cbffe0a --- /dev/null +++ b/types/devexpress-web/v171/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "devexpress-web": [ + "devexpress-web/v171" + ], + "devexpress-web/*": [ + "devexpress-web/v171/*" + ] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "devexpress-web-tests.ts" + ] +} \ No newline at end of file diff --git a/types/devexpress-web/v171/tslint.json b/types/devexpress-web/v171/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/devexpress-web/v171/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} From eb6898062172020fb106893f64632d7b9056c8ed Mon Sep 17 00:00:00 2001 From: Tiger Oakes Date: Mon, 9 Apr 2018 12:10:25 -0700 Subject: [PATCH 0527/2153] Added type definitions for svg-path-bounding-box (#23987) --- types/svg-path-bounding-box/index.d.ts | 85 +++++++++++++++++++ .../svg-path-bounding-box-tests.ts | 22 +++++ types/svg-path-bounding-box/tsconfig.json | 23 +++++ types/svg-path-bounding-box/tslint.json | 1 + 4 files changed, 131 insertions(+) create mode 100644 types/svg-path-bounding-box/index.d.ts create mode 100644 types/svg-path-bounding-box/svg-path-bounding-box-tests.ts create mode 100644 types/svg-path-bounding-box/tsconfig.json create mode 100644 types/svg-path-bounding-box/tslint.json diff --git a/types/svg-path-bounding-box/index.d.ts b/types/svg-path-bounding-box/index.d.ts new file mode 100644 index 0000000000..cf3754036b --- /dev/null +++ b/types/svg-path-bounding-box/index.d.ts @@ -0,0 +1,85 @@ +// Type definitions for svg-path-bounding-box 1.0 +// Project: https://github.com/icons8/svg-path-bounding-box +// Definitions by: Tiger Oakes +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = svgPathBoundingBox; + +declare function svgPathBoundingBox( + path: string, +): svgPathBoundingBox.BoundingBoxView; + +declare namespace svgPathBoundingBox { + /** + * pass in initial points if you want + * @see https://github.com/gabelerner/canvg/blob/860e418aca67b9a41e858a223d74d375793ec364/canvg.js#L449 + */ + class BoundingBox { + x1: number; + y1: number; + x2: number; + y2: number; + + constructor(x1: number, y1: number, x2: number, y2: number); + + width(): number; + + height(): number; + + addPoint(x: number, y: number): void; + + addX(x: number): void; + + addY(y: number): void; + + addQuadraticCurve( + p0x: number, + p0y: number, + p1x: number, + p1y: number, + p2x: number, + p2y: number, + ): void; + + /** @see http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html */ + addBezierCurve( + p0x: number, + p0y: number, + p1x: number, + p1y: number, + p2x: number, + p2y: number, + p3x: number, + p3y: number, + ): void; + } + + class BoundingBoxView { + x1: number; + y1: number; + x2: number; + y2: number; + minX: number; + minY: number; + maxX: number; + maxY: number; + width: number; + height: number; + + constructor(boundingBox: BoundingBox); + + round(precision?: number): this; + + scale(scale?: number): this; + + toString(): string; + } + + class Path { + d: string; + + constructor(d: string); + + getBoundingBox(): BoundingBoxView; + } +} diff --git a/types/svg-path-bounding-box/svg-path-bounding-box-tests.ts b/types/svg-path-bounding-box/svg-path-bounding-box-tests.ts new file mode 100644 index 0000000000..c381541c17 --- /dev/null +++ b/types/svg-path-bounding-box/svg-path-bounding-box-tests.ts @@ -0,0 +1,22 @@ +import * as svgPathBoundingBox from 'svg-path-bounding-box'; + +const bbox = svgPathBoundingBox('M300,200 h-150 a150,150 0 1,0 150,-150 z'); + +const x1: number = bbox.x1; +const y1: number = bbox.y1; +const x2: number = bbox.x2; +const y2: number = bbox.y2; +const minX: number = bbox.minX; +const minY: number = bbox.minY; +const maxX: number = bbox.maxX; +const maxY: number = bbox.maxY; +const width: number = bbox.width; +const height: number = bbox.height; + +const rounded: svgPathBoundingBox.BoundingBoxView = bbox.round(2); +const scaled: svgPathBoundingBox.BoundingBoxView = bbox.scale(2); +const roundedString: string = rounded.toString(); + +const path = new svgPathBoundingBox.Path('M300,200 h-150 a150,150 0 1,0 150,-150 z'); +const d: string = path.d; +const bbox2: svgPathBoundingBox.BoundingBoxView = path.getBoundingBox(); diff --git a/types/svg-path-bounding-box/tsconfig.json b/types/svg-path-bounding-box/tsconfig.json new file mode 100644 index 0000000000..6ff287f9b7 --- /dev/null +++ b/types/svg-path-bounding-box/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "svg-path-bounding-box-tests.ts" + ] +} \ No newline at end of file diff --git a/types/svg-path-bounding-box/tslint.json b/types/svg-path-bounding-box/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/svg-path-bounding-box/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From b6afede767da957838c488059daab048641c8902 Mon Sep 17 00:00:00 2001 From: Xiaohan Zhang Date: Mon, 9 Apr 2018 12:11:10 -0700 Subject: [PATCH 0528/2153] add clmtrackr types (#23837) --- types/clmtrackr/clmtrackr-tests.ts | 26 ++++++++++++++ types/clmtrackr/index.d.ts | 55 ++++++++++++++++++++++++++++++ types/clmtrackr/tsconfig.json | 24 +++++++++++++ types/clmtrackr/tslint.json | 1 + 4 files changed, 106 insertions(+) create mode 100644 types/clmtrackr/clmtrackr-tests.ts create mode 100644 types/clmtrackr/index.d.ts create mode 100644 types/clmtrackr/tsconfig.json create mode 100644 types/clmtrackr/tslint.json diff --git a/types/clmtrackr/clmtrackr-tests.ts b/types/clmtrackr/clmtrackr-tests.ts new file mode 100644 index 0000000000..8a38e4361c --- /dev/null +++ b/types/clmtrackr/clmtrackr-tests.ts @@ -0,0 +1,26 @@ +import clm from "clmtrackr"; + +const ctracker = new clm.tracker(); + +console.log(clm.version); + +ctracker.init({ + constantVelocity: true, + searchWindow: 11, + useWebGL: true, + scoreThreshold: 0.50, + stopOnConvergence: false, + /** object with parameters for facedetection : */ + faceDetection: { useWebWorkers: true} +}); + +const video = document.getElementsByTagName("video")[0]; +ctracker.start(video); +const positions = ctracker.getCurrentPosition(); +if (positions) { + const canvas = document.getElementsByTagName("canvas")[0]; + ctracker.draw(canvas); + positions.forEach(([x, y]) => { + const sum: number = x + y; + }); +} diff --git a/types/clmtrackr/index.d.ts b/types/clmtrackr/index.d.ts new file mode 100644 index 0000000000..a0c778ed00 --- /dev/null +++ b/types/clmtrackr/index.d.ts @@ -0,0 +1,55 @@ +// Type definitions for clmtrackr 1.1 +// Project: https://github.com/auduno/clmtrackr +// Definitions by: hellochar +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface TrackerParams { + /** whether to use constant velocity model when fitting (default is true) */ + constantVelocity?: boolean; + /** the size of the searchwindow around each point (default is 11) */ + searchWindow?: number; + /** whether to use webGL if it is available (default is true) */ + useWebGL?: boolean; + /** threshold for when to assume we've lost tracking (default is 0.50) */ + scoreThreshold?: number; + /** whether to stop tracking when the fitting has converged (default is false) */ + stopOnConvergence?: boolean; + /** object with parameters for facedetection : */ + faceDetection?: { + /** whether to use web workers for face detection (default is true) */ + useWebWorkers?: boolean; + }; +} + +type IPosition = [number, number]; + +type Model = any; + +declare namespace _default { + class tracker { + constructor(params?: TrackerParams); + + init(model?: Model): void; + + start(element: HTMLVideoElement | HTMLCanvasElement): void; + + track(element: HTMLVideoElement | HTMLCanvasElement): IPosition[] | false; + + reset(): void; + + getConvergence(): number; + + getCurrentParameters(): number[]; + + getCurrentPosition(): IPosition[] | false; + + getScore(): number; + + draw(canvas: HTMLCanvasElement): void; + + setResponseMode(type: "single" | "cycle" | "blend", list: Array<"raw" | "sobel" | "lbp">): void; + } + const version: string; +} + +export default _default; diff --git a/types/clmtrackr/tsconfig.json b/types/clmtrackr/tsconfig.json new file mode 100644 index 0000000000..54d471be5c --- /dev/null +++ b/types/clmtrackr/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "clmtrackr-tests.ts" + ] +} diff --git a/types/clmtrackr/tslint.json b/types/clmtrackr/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/clmtrackr/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 2a84417fe04a1eef9b1521a297352c992db93b28 Mon Sep 17 00:00:00 2001 From: Robert Hjalmers Date: Mon, 9 Apr 2018 21:12:38 +0200 Subject: [PATCH 0529/2153] added typings for swe-validation (#23778) * Create index.d.ts * Create tslint.json * Create tsconfig.json * Update index.d.ts * used template * fixed swe-validation typings and test --- types/swe-validation/index.d.ts | 27 ++++++++++++++++++++ types/swe-validation/swe-validation-tests.ts | 4 +++ types/swe-validation/tsconfig.json | 23 +++++++++++++++++ types/swe-validation/tslint.json | 1 + 4 files changed, 55 insertions(+) create mode 100644 types/swe-validation/index.d.ts create mode 100644 types/swe-validation/swe-validation-tests.ts create mode 100644 types/swe-validation/tsconfig.json create mode 100644 types/swe-validation/tslint.json diff --git a/types/swe-validation/index.d.ts b/types/swe-validation/index.d.ts new file mode 100644 index 0000000000..34dad38f44 --- /dev/null +++ b/types/swe-validation/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for swe-validation 1.0 +// Project: https://github.com/keype/swe-validation +// Definitions by: Robert Hjalmers +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface cin { + isValid: boolean; + corporation: { + type: string; + id: string; + }; +} + +interface ssn { + isValid: boolean; + person?: { + type: string; + sex: string; + ssn: string; + }; +} + +declare let validate: { + ssn(number: number): ssn; + cin(number: number): cin; +}; +export = validate; diff --git a/types/swe-validation/swe-validation-tests.ts b/types/swe-validation/swe-validation-tests.ts new file mode 100644 index 0000000000..0615fd9f83 --- /dev/null +++ b/types/swe-validation/swe-validation-tests.ts @@ -0,0 +1,4 @@ +import validate = require("swe-validation"); + +const corporateId = validate.cin(5500123456); +const personalId = validate.ssn(192301120123); diff --git a/types/swe-validation/tsconfig.json b/types/swe-validation/tsconfig.json new file mode 100644 index 0000000000..b4943f9dd7 --- /dev/null +++ b/types/swe-validation/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "swe-validation-tests.ts" + ] +} diff --git a/types/swe-validation/tslint.json b/types/swe-validation/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/swe-validation/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From dfc686e26664b77dda1130c85573ae2fbf53e078 Mon Sep 17 00:00:00 2001 From: Rajab Shakirov Date: Mon, 9 Apr 2018 22:14:07 +0300 Subject: [PATCH 0530/2153] [pdfmake] add definitions for pdfmake (#23555) --- types/pdfmake/index.d.ts | 70 ++++++++++++++++++++++++++++++++++ types/pdfmake/pdfmake-tests.ts | 10 +++++ types/pdfmake/tsconfig.json | 24 ++++++++++++ types/pdfmake/tslint.json | 6 +++ 4 files changed, 110 insertions(+) create mode 100644 types/pdfmake/index.d.ts create mode 100644 types/pdfmake/pdfmake-tests.ts create mode 100644 types/pdfmake/tsconfig.json create mode 100644 types/pdfmake/tslint.json diff --git a/types/pdfmake/index.d.ts b/types/pdfmake/index.d.ts new file mode 100644 index 0000000000..9d5f8023c3 --- /dev/null +++ b/types/pdfmake/index.d.ts @@ -0,0 +1,70 @@ +// Type definitions for pdfmake 0.1 +// Project: http://pdfmake.org +// Definitions by: Milen Stefanov +// Rajab Shakirov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'pdfmake/build/vfs_fonts' { + let pdfMake: { + vfs: any; + [name: string]: any; + }; +} + +declare module 'pdfmake/build/pdfmake' { + let vfs: TFontFamily; + let fonts: { [name: string]: TFontFamilyTypes }; + function createPdf(documentDefinitions: TDocumentDefinitions): TCreatedPdf; + + type pageSizeType = + '4A0' | '2A0' | 'A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6' | 'A7' | 'A8' | 'A9' | 'A10' | + 'B0' | 'B1' | 'B2' | 'B3' | 'B4' | 'B5' | 'B6' | 'B7' | 'B8' | 'B9' | 'B10' | + 'C0' | 'C1' | 'C2' | 'C3' | 'C4' | 'C5' | 'C6' | 'C7' | 'C8' | 'C9' | 'C10' | + 'RA0' | 'RA1' | 'RA2' | 'RA3' | 'RA4' | + 'SRA0' | 'SRA1' | 'SRA2' | 'SRA3' | 'SRA4' | + 'EXECUTIVE' | 'FOLIO' | 'LEGAL' | 'LETTER' | 'TABLOID'; + + type pageOrientationType = "portrait" | "landscape"; + + let pdfMake: pdfMakeStatic; + + interface TFontFamily { + [fontName: string]: string; + } + + interface TFontFamilyTypes { + normal?: string; + bold?: string; + italics?: string; + bolditalics?: string; + } + + interface TDocumentDefinitions { + content: any; + styles?: any; + pageSize?: pageSizeType; + pageOrientation?: pageOrientationType; + pageMargins?: [number, number, number, number]; + defaultStyle?: { + font?: string; + }; + } + + type CreatedPdfParams = ( + defaultFileName?: string, + cb?: string, + options?: string + ) => void; + + interface TCreatedPdf { + download: CreatedPdfParams; + open: CreatedPdfParams; + print: CreatedPdfParams; + } + + interface pdfMakeStatic { + vfs: TFontFamily; + fonts: { [name: string]: TFontFamilyTypes }; + createPdf(documentDefinitions: TDocumentDefinitions): TCreatedPdf; + } +} diff --git a/types/pdfmake/pdfmake-tests.ts b/types/pdfmake/pdfmake-tests.ts new file mode 100644 index 0000000000..0f23e5c5d5 --- /dev/null +++ b/types/pdfmake/pdfmake-tests.ts @@ -0,0 +1,10 @@ +import * as pdfMake from 'pdfmake/build/pdfmake'; +import * as pdfFonts from 'pdfmake/build/vfs_fonts'; + +const docDefinition = { content: 'This is an sample PDF printed with pdfMake' }; + +const createPdf = () => { + const pdf = pdfMake; + pdf.vfs = pdfFonts.pdfMake.vfs; + pdfMake.createPdf(docDefinition).download(); +}; diff --git a/types/pdfmake/tsconfig.json b/types/pdfmake/tsconfig.json new file mode 100644 index 0000000000..2e8b5b10af --- /dev/null +++ b/types/pdfmake/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "esModuleInterop": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "pdfmake-tests.ts" + ] +} diff --git a/types/pdfmake/tslint.json b/types/pdfmake/tslint.json new file mode 100644 index 0000000000..aa858f144a --- /dev/null +++ b/types/pdfmake/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-declare-current-package": false + } +} \ No newline at end of file From 236276b2e6beb22555c0cea87753e5fd82e0b068 Mon Sep 17 00:00:00 2001 From: Tiger Oakes Date: Mon, 9 Apr 2018 12:26:39 -0700 Subject: [PATCH 0531/2153] Added document-promises types (#24851) --- .../document-promises-tests.ts | 16 +++++++++++++ types/document-promises/index.d.ts | 23 +++++++++++++++++++ types/document-promises/tsconfig.json | 23 +++++++++++++++++++ types/document-promises/tslint.json | 1 + 4 files changed, 63 insertions(+) create mode 100644 types/document-promises/document-promises-tests.ts create mode 100644 types/document-promises/index.d.ts create mode 100644 types/document-promises/tsconfig.json create mode 100644 types/document-promises/tslint.json diff --git a/types/document-promises/document-promises-tests.ts b/types/document-promises/document-promises-tests.ts new file mode 100644 index 0000000000..5e45dffd5f --- /dev/null +++ b/types/document-promises/document-promises-tests.ts @@ -0,0 +1,16 @@ +import { parsed, contentLoaded, loaded } from 'document-promises'; + +let promise: Promise; +promise = parsed; +promise = contentLoaded; +promise = loaded; + +parsed.then(() => { + // Document parsed +}); +contentLoaded.then(() => { + // Document is ready +}); +loaded.then(() => { + // Document loaded +}); diff --git a/types/document-promises/index.d.ts b/types/document-promises/index.d.ts new file mode 100644 index 0000000000..2202c0d7ab --- /dev/null +++ b/types/document-promises/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for document-promises 3.1 +// Project: https://github.com/jonathantneal/document-promises#readme +// Definitions by: Tiger Oakes +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * document.parsed is a promise that fulfills when the document is parsed + * and `readyState` is `interactive`, before deferred and async scripts have run. + */ +export const parsed: Promise; + +/** + * document.contentLoaded is a promise that fulfills when the document is + * parsed, blocking scripts have completed, and `DOMContentLoaded` fires. + */ +export const contentLoaded: Promise; + +/** + * document.loaded is a promise that fulfills when the document is parsed, + * blocking scripts have completed, images, scripts, links and sub-frames + * have finished loading, and `readyState` is `complete`. + */ +export const loaded: Promise; diff --git a/types/document-promises/tsconfig.json b/types/document-promises/tsconfig.json new file mode 100644 index 0000000000..6b1ddaaa6b --- /dev/null +++ b/types/document-promises/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "document-promises-tests.ts" + ] +} diff --git a/types/document-promises/tslint.json b/types/document-promises/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/document-promises/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 206bedb68579320c5f0a8c84d0292734784ad06b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20Fern=C3=A1ndez?= Date: Mon, 9 Apr 2018 21:50:01 +0200 Subject: [PATCH 0532/2153] Ngsijs npm package types file (#23023) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add types for ngsijs package * add types for ngsijs package * clean d.ts * clean d.ts * strictFunctionTypes true * fix errors with paddings * another fix updating tsconfig after removing test file * eofline * trailing whitespaces ¬¬ * Remove additional dependence --- types/ngsijs/index.d.ts | 58 ++++++++++++++++++++++++++++++++++++++ types/ngsijs/tsconfig.json | 22 +++++++++++++++ types/ngsijs/tslint.json | 1 + 3 files changed, 81 insertions(+) create mode 100644 types/ngsijs/index.d.ts create mode 100644 types/ngsijs/tsconfig.json create mode 100644 types/ngsijs/tslint.json diff --git a/types/ngsijs/index.d.ts b/types/ngsijs/index.d.ts new file mode 100644 index 0000000000..b39cbb5469 --- /dev/null +++ b/types/ngsijs/index.d.ts @@ -0,0 +1,58 @@ +// Type definitions for ngsijs 1.0 +// Project: https://github.com/conwetlab/ngsijs +// Definitions by: Guillermofr +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export class Connection { + constructor(url: any); + v2: Connection.V2; + v1: Connection.V1; +} + +export namespace Connection { + class V1 { + constructor(connection: any); + addAttributes(toAdd: any, callbacks: any): void; + cancelAvailabilitySubscription(subId: any, callbacks: any): void; + cancelRegistration(regId: any, callbacks: any): void; + cancelSubscription(subId: any, options: any): void; + createAvailabilitySubscription(entities: any, attributeNames: any, duration: any, restriction: any, options: any, ...args: any[]): void; + createRegistration(entities: any, attributes: any, duration: any, providingApplication: any, callbacks: any): void; + createSubscription(entities: any, attributeNames: any, duration: any, throttling: any, cond: any, options: any, ...args: any[]): void; + deleteAttributes(toDelete: any, callbacks: any): void; + discoverAvailability(entities: any, attributeNames: any, callbacks: any): void; + getAvailableTypes(options: any): void; + getTypeInfo(type: any, options: any): void; + query(entities: any, attributesName: any, options: any): void; + updateAttributes(update: any, callbacks: any): void; + updateAvailabilitySubscription(subId: any, entities: any, attributeNames: any, duration: any, restriction: any, callbacks: any): void; + updateRegistration(regId: any, entities: any, attributes: any, duration: any, providingApplication: any, callbacks: any): any; + updateSubscription(subId: any, duration: any, throttling: any, cond: any, options: any): void; + } + + class V2 { + constructor(connection: any); + appendEntityAttributes(changes: any, options: any): any; + batchQuery(query: any, options: any): any; + batchUpdate(changes: any, options: any): any; + createEntity(entity: any, options: any): any; + createSubscription(subscription: any, options: any): any; + deleteEntity(options: any): any; + deleteEntityAttribute(options: any): any; + deleteSubscription(options: any): any; + getEntity(options: any): any; + getEntityAttribute(options: any): any; + getEntityAttributeValue(options: any): any; + getEntityAttributes(options: any): any; + getSubscription(options: any): any; + getType(options: any): any; + listEntities(options: any): any; + listSubscriptions(options: any): any; + listTypes(options: any): any; + replaceEntityAttribute(changes: any, options: any): any; + replaceEntityAttributeValue(options: any): any; + replaceEntityAttributes(entity: any, options: any): any; + updateEntityAttributes(changes: any, options: any): any; + updateSubscription(changes: any, options: any): any; + } +} diff --git a/types/ngsijs/tsconfig.json b/types/ngsijs/tsconfig.json new file mode 100644 index 0000000000..ecc22c8314 --- /dev/null +++ b/types/ngsijs/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} diff --git a/types/ngsijs/tslint.json b/types/ngsijs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ngsijs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 5601488fff70c82ab84c0f0974e54aefe4928f56 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Mon, 9 Apr 2018 21:50:56 +0200 Subject: [PATCH 0533/2153] Export all defined type (#24853) --- types/react-native-permissions/index.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/types/react-native-permissions/index.d.ts b/types/react-native-permissions/index.d.ts index 4b08cee5b3..274bdf2134 100644 --- a/types/react-native-permissions/index.d.ts +++ b/types/react-native-permissions/index.d.ts @@ -3,18 +3,18 @@ // Definitions by: Vincent Langlet // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -type Status = 'authorized' | 'denied' | 'restricted' | 'undetermined'; +export type Status = 'authorized' | 'denied' | 'restricted' | 'undetermined'; -interface Rationale { +export interface Rationale { title: string; message: string; } -type CheckOptions = string | { type: string }; +export type CheckOptions = string | { type: string }; -type RequestOptions = string | { type: string, rationale?: Rationale }; +export type RequestOptions = string | { type: string, rationale?: Rationale }; -interface ReactNativePermissions { +export interface ReactNativePermissions { canOpenSettings: () => Promise; openSettings: () => Promise; getTypes: () => string[]; From 25a78f261aed39304adcea4e985faabf4d00e04e Mon Sep 17 00:00:00 2001 From: Jacob Date: Mon, 9 Apr 2018 15:52:41 -0400 Subject: [PATCH 0534/2153] Updated email-templates typings to email-templates v3.5 (#24822) * updated emailTemplate typings to email-templates 3.5 * Update index.d.ts removed duplicate note --- types/email-templates/email-templates-tests.ts | 13 ++++++++++--- types/email-templates/index.d.ts | 13 +++++++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/types/email-templates/email-templates-tests.ts b/types/email-templates/email-templates-tests.ts index a3311d6e81..3d828281af 100644 --- a/types/email-templates/email-templates-tests.ts +++ b/types/email-templates/email-templates-tests.ts @@ -2,13 +2,20 @@ import EmailTemplates = require('email-templates'); const email = new EmailTemplates({ message: { - from: 'Test@tesitng.com' + from: 'Test@testing.com' }, transport: { jsonTransport: true - }} -); + } +}); + +const emailNoTransporter = new EmailTemplates({ + message: { + from: 'test@testing.com' + }, +}); email.juiceResources('

    bob

    '); email.render('mars/html.pug', {name: 'elon'}); email.send({template: 'mars', message: {to: 'elon@spacex.com'}, locals: {name: 'Elon'}}); +emailNoTransporter.render('mars/html.pug', {name: 'elon'}); diff --git a/types/email-templates/index.d.ts b/types/email-templates/index.d.ts index 12dceb181d..1cdd43c36e 100644 --- a/types/email-templates/index.d.ts +++ b/types/email-templates/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for node-email-templates 3.1 +// Type definitions for node-email-templates 3.5 // Project: https://github.com/niftylettuce/node-email-templates // Definitions by: Cyril Schumacher // Matus Gura @@ -13,7 +13,7 @@ interface EmailConfig { /** * The nodemailer Transport created via nodemailer.createTransport */ - transport: any; + transport?: any; /** * The email template directory and engine information */ @@ -34,10 +34,19 @@ interface EmailConfig { * Pass a custom render function if necessary */ render?: { view: string, locals: any }; + /** + * force text-only rendering of template (disregards template folder) + */ + textOnly?: boolean; /** * */ htmlToText?: any; + /** + * You can pass an option to prefix subject lines with a string + * env === 'production' ? false : `[${env.toUpperCase()}] `; // <--- HERE + */ + subjectPrefix?: any; /** * */ From 35097ce41be2bbc96252906ba6c16b1867c694c0 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Mon, 9 Apr 2018 21:52:51 +0200 Subject: [PATCH 0535/2153] fix(uglify-js): add missing `includeSources` to `SourceMapOptions` (#24804) --- types/uglify-js/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/uglify-js/index.d.ts b/types/uglify-js/index.d.ts index eca756bd53..8778975020 100644 --- a/types/uglify-js/index.d.ts +++ b/types/uglify-js/index.d.ts @@ -204,6 +204,7 @@ export interface MinifyOutput { } export interface SourceMapOptions { + includeSources?: boolean; filename?: string; url?: string | 'inline'; root?: string; From 9075daa8979c435d7a12b8531a4ac02eeb39765c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anderson=20Fria=C3=A7a?= Date: Mon, 9 Apr 2018 15:53:04 -0400 Subject: [PATCH 0536/2153] JQuery Lazy Load - Adjustment in type appear (#24799) * Adjustment in type appear * Allow type null in appear * Adjustments --- types/jquery-lazyload/index.d.ts | 2 +- types/jquery-lazyload/jquery-lazyload-tests.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/types/jquery-lazyload/index.d.ts b/types/jquery-lazyload/index.d.ts index 5505c247f5..28563a774d 100644 --- a/types/jquery-lazyload/index.d.ts +++ b/types/jquery-lazyload/index.d.ts @@ -15,7 +15,7 @@ declare namespace JQueryLazyLoad { container?: JQuery; data_attribute?: string; skip_invisible?: boolean; - appear?: null; + appear?: ((elementsLeft: number, options: Options) => void) | null; load?: (elementsLeft?: number, options?: Options) => void; placeholder?: string; } diff --git a/types/jquery-lazyload/jquery-lazyload-tests.ts b/types/jquery-lazyload/jquery-lazyload-tests.ts index 086069d11d..105bbe094a 100644 --- a/types/jquery-lazyload/jquery-lazyload-tests.ts +++ b/types/jquery-lazyload/jquery-lazyload-tests.ts @@ -9,7 +9,10 @@ $(document).ready(() => { effect: 'fadeIn', container: $('#container'), failure_limit: 10, - skip_invisible: true + skip_invisible: true, + appear: (elementsLeft: number, settings: JQueryLazyLoad.Options) => { + console.log(elementsLeft); + } }; $('.lazyload').lazyload(options); From 06d09706a65b4bfc47c33d7c2b854c49a536b6c7 Mon Sep 17 00:00:00 2001 From: Dona278 Date: Mon, 9 Apr 2018 21:54:49 +0200 Subject: [PATCH 0537/2153] [angular-material] - Added $mdDialogProvider definition (#24733) * [angular-material] - Added $mdDialogProvider definition Docs: https://material.angularjs.org/latest/api/service/$mdDialog#custom-presets * [angular-material] - Added "methods" property to "addPreset()" options parameter --- .../angular-material-tests.ts | 25 ++++++++++++++++++- types/angular-material/index.d.ts | 11 +++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/types/angular-material/angular-material-tests.ts b/types/angular-material/angular-material-tests.ts index ad79cff2db..f29de44222 100644 --- a/types/angular-material/angular-material-tests.ts +++ b/types/angular-material/angular-material-tests.ts @@ -8,7 +8,8 @@ myApp.config(( $mdAriaProvider: ng.material.IAriaProvider, $mdThemingProvider: ng.material.IThemingProvider, $mdIconProvider: ng.material.IIconProvider, - $mdProgressCircularProvider: ng.material.IProgressCircularProvider) => { + $mdProgressCircularProvider: ng.material.IProgressCircularProvider, + $mdDialogProvider: ng.material.IDialogProvider) => { $mdThemingProvider.alwaysWatchTheme(true); const neonRedMap: ng.material.IPalette = $mdThemingProvider.extendPalette('red', { 500: 'ff0000' @@ -56,6 +57,23 @@ myApp.config(( // Globally disables all ARIA warnings. $mdAriaProvider.disableWarnings(); + + // Add custom dialog preset + $mdDialogProvider.addPreset('testPreset', { + methods: ['entityName'], + options: () => { + return { + template: + '' + + 'This is a custom preset' + + '', + controllerAs: 'dialog', + bindToController: true, + clickOutsideToClose: true, + escapeToClose: true + }; + } + }); }); myApp.controller('BottomSheetController', ($scope: TestScope, $mdBottomSheet: ng.material.IBottomSheetService, $q: ng.IQService) => { @@ -192,6 +210,11 @@ myApp.controller('DialogController', ($scope: TestScope, $mdDialog: ng.material. onComplete: (scope, element) => { }, onRemoving: (element, removePromise) => { }, }); + + // Show custom dialog preset + $mdDialog.show( + $mdDialog['testPreset']().entityName('Product #6') + ); }); class IconDirective implements ng.IDirective { diff --git a/types/angular-material/index.d.ts b/types/angular-material/index.d.ts index d77f5ae7ce..6885916e8a 100644 --- a/types/angular-material/index.d.ts +++ b/types/angular-material/index.d.ts @@ -125,6 +125,11 @@ declare module 'angular' { } interface IDialogService { + // indexer used to call preset dialog created with $mdDialogProvider + // see: https://material.angularjs.org/latest/api/service/$mdDialog#custom-presets + // tslint:disable-next-line:ban-types + [presetName: string]: Function; + show(dialog: IDialogOptions | IAlertDialog | IConfirmDialog | IPromptDialog): IPromise; confirm(): IConfirmDialog; alert(): IAlertDialog; @@ -133,6 +138,10 @@ declare module 'angular' { cancel(response?: any): void; } + interface IDialogProvider { + addPreset(presetName: string, presetOptions: { methods?: ReadonlyArray, options: () => IDialogOptions }): IDialogProvider; + } + type IIcon = (id: string) => IPromise; // id is a unique ID or URL interface IIconProvider { @@ -223,7 +232,7 @@ declare module 'angular' { contrastDefaultColor?: string; contrastDarkColors?: string | string[]; contrastLightColors?: string | string[]; - contrastStrongLightColors?: string|string[]; + contrastStrongLightColors?: string | string[]; } interface IThemeHues { From e50e94b2a0a5f36208526ce8b15f77b446d93ce6 Mon Sep 17 00:00:00 2001 From: Brian Caruso Date: Mon, 9 Apr 2018 12:55:05 -0700 Subject: [PATCH 0538/2153] Add '_enableIdPInitiatedLogin' to auth0-lock constructor's type definition (#24721) --- types/auth0-lock/auth0-lock-tests.ts | 4 +++- types/auth0-lock/index.d.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/types/auth0-lock/auth0-lock-tests.ts b/types/auth0-lock/auth0-lock-tests.ts index 3ef12e327b..b3b2c81339 100644 --- a/types/auth0-lock/auth0-lock-tests.ts +++ b/types/auth0-lock/auth0-lock-tests.ts @@ -124,7 +124,9 @@ const otherOptions : Auth0LockConstructorOptions = { configurationBaseUrl: "https://cdn.auth0.com", languageBaseUrl: "http://www.example.com", hashCleanup: false, - leeway: 30 + leeway: 30, + _enableImpersonation: true, + _enableIdPInitiatedLogin: false }; new Auth0Lock(CLIENT_ID, DOMAIN, otherOptions); diff --git a/types/auth0-lock/index.d.ts b/types/auth0-lock/index.d.ts index 93305bfd1f..fec943ce02 100644 --- a/types/auth0-lock/index.d.ts +++ b/types/auth0-lock/index.d.ts @@ -144,6 +144,7 @@ interface Auth0LockConstructorOptions { theme?: Auth0LockThemeOptions; usernameStyle?: string; _enableImpersonation?: boolean; + _enableIdPInitiatedLogin?: boolean; } interface Auth0LockFlashMessageOptions { From 273c90ffb96f9b43b5f5c8a1b33bc453b50fb622 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 9 Apr 2018 13:00:51 -0700 Subject: [PATCH 0539/2153] graceful-fs: Fix test (#24855) --- types/graceful-fs/graceful-fs-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/graceful-fs/graceful-fs-tests.ts b/types/graceful-fs/graceful-fs-tests.ts index 233eb7124a..17f20c786a 100644 --- a/types/graceful-fs/graceful-fs-tests.ts +++ b/types/graceful-fs/graceful-fs-tests.ts @@ -14,7 +14,7 @@ gfs.renameSync(str, str); gfs2.chmodSync(buf, 1); const gracefulified = gfs.gracefulify(fs); -gracefulified; // $ExpectType typeof "fs" & Lutimes +const _fs: typeof fs = gracefulified; gracefulified.lutimes; // $ExpectType typeof lutimes promisify(gracefulified.lutimes); // $ExpectType (path: PathLike, atime: string | number | Date, mtime: string | number | Date) => Promise From 4e9ecb03e459a0ead4aac7b9b2f397e6dd808824 Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Tue, 10 Apr 2018 06:02:16 +1000 Subject: [PATCH 0540/2153] @storybook/addon-knobs: add framework-specific entry points (#22939) * @storybook/addon-knobs: add framework-specific entry points * Update vue.d.ts * PR feedback * bue -> vue --- types/storybook__addon-knobs/angular.d.ts | 1 + types/storybook__addon-knobs/index.d.ts | 2 +- types/storybook__addon-knobs/react.d.ts | 1 + types/storybook__addon-knobs/tsconfig.json | 7 +++++-- types/storybook__addon-knobs/vue.d.ts | 1 + 5 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 types/storybook__addon-knobs/angular.d.ts create mode 100644 types/storybook__addon-knobs/react.d.ts create mode 100644 types/storybook__addon-knobs/vue.d.ts diff --git a/types/storybook__addon-knobs/angular.d.ts b/types/storybook__addon-knobs/angular.d.ts new file mode 100644 index 0000000000..ea465c2a34 --- /dev/null +++ b/types/storybook__addon-knobs/angular.d.ts @@ -0,0 +1 @@ +export * from './index'; diff --git a/types/storybook__addon-knobs/index.d.ts b/types/storybook__addon-knobs/index.d.ts index 4125f10b84..c129c5f574 100644 --- a/types/storybook__addon-knobs/index.d.ts +++ b/types/storybook__addon-knobs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for @storybook/addon-knobs 3.2 +// Type definitions for @storybook/addon-knobs 3.3 // Project: https://github.com/storybooks/storybook // Definitions by: Joscha Feth // Martynas Kadisa diff --git a/types/storybook__addon-knobs/react.d.ts b/types/storybook__addon-knobs/react.d.ts new file mode 100644 index 0000000000..ea465c2a34 --- /dev/null +++ b/types/storybook__addon-knobs/react.d.ts @@ -0,0 +1 @@ +export * from './index'; diff --git a/types/storybook__addon-knobs/tsconfig.json b/types/storybook__addon-knobs/tsconfig.json index fb2307556f..1e011639d0 100644 --- a/types/storybook__addon-knobs/tsconfig.json +++ b/types/storybook__addon-knobs/tsconfig.json @@ -27,7 +27,10 @@ "forceConsistentCasingInFileNames": true }, "files": [ + "angular.d.ts", "index.d.ts", - "storybook__addon-knobs-tests.tsx" + "react.d.ts", + "storybook__addon-knobs-tests.tsx", + "vue.d.ts" ] -} \ No newline at end of file +} diff --git a/types/storybook__addon-knobs/vue.d.ts b/types/storybook__addon-knobs/vue.d.ts new file mode 100644 index 0000000000..ea465c2a34 --- /dev/null +++ b/types/storybook__addon-knobs/vue.d.ts @@ -0,0 +1 @@ +export * from './index'; From 93135b0ac2f1ea9d445f897f8d8a350f78a757c1 Mon Sep 17 00:00:00 2001 From: peszek90 <36853408+peszek90@users.noreply.github.com> Date: Mon, 9 Apr 2018 22:08:36 +0200 Subject: [PATCH 0541/2153] Make renderOrder nullable in VectorTileOptions (#23942) --- types/openlayers/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/openlayers/index.d.ts b/types/openlayers/index.d.ts index 9dc5461f5e..2a7d1b0949 100644 --- a/types/openlayers/index.d.ts +++ b/types/openlayers/index.d.ts @@ -11952,7 +11952,7 @@ export namespace olx { interface VectorTileOptions { renderBuffer?: number; renderMode?: (ol.layer.VectorTileRenderType | string); - renderOrder: (feature1: ol.Feature, feature2: ol.Feature) => number; + renderOrder?: (feature1: ol.Feature, feature2: ol.Feature) => number; map?: ol.Map; extent?: ol.Extent; minResolution?: number; From d95790803294745106f8f5adb9e2bd5daa4a829c Mon Sep 17 00:00:00 2001 From: Walter Rumsby Date: Tue, 10 Apr 2018 08:18:04 +1200 Subject: [PATCH 0542/2153] Export Store from mem-fs (#24522) --- types/mem-fs/index.d.ts | 15 ++++++++------- types/mem-fs/mem-fs-tests.ts | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/types/mem-fs/index.d.ts b/types/mem-fs/index.d.ts index 0cece1da38..4b1d8c4d14 100644 --- a/types/mem-fs/index.d.ts +++ b/types/mem-fs/index.d.ts @@ -9,13 +9,14 @@ import { EventEmitter } from 'events'; import { Transform } from 'stream'; import * as File from 'vinyl'; -export function create(...args: any[]): memFs.Store; +export interface Store extends EventEmitter { + add: (file: File, content: string) => void; + each: (callback: (file: File, index: number) => void) => void; + get: (filepath: string) => File; + stream: () => Transform; +} + +export function create(...args: any[]): Store; export namespace memFs { - interface Store extends EventEmitter { - add: (file: File, content: string) => void; - each: (callback: (file: File, index: number) => void) => void; - get: (filepath: string) => File; - stream: () => Transform; - } } diff --git a/types/mem-fs/mem-fs-tests.ts b/types/mem-fs/mem-fs-tests.ts index ada05c22c7..9605c65ef7 100644 --- a/types/mem-fs/mem-fs-tests.ts +++ b/types/mem-fs/mem-fs-tests.ts @@ -1,6 +1,6 @@ import * as fs from 'mem-fs'; -const store = fs.create(); +const store: fs.Store = fs.create(); const file = store.get('hello'); store.add(file, 'hahahahah'); From 4e707e3844b5271cfba311bbfb3261844109c1e4 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen Date: Mon, 9 Apr 2018 22:22:03 +0200 Subject: [PATCH 0543/2153] Revert "[react-native] Replacing ScrollViewProperties with VirtualizedListProperties for SectionList" (#24033) --- types/react-native/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 3503c69f6b..5e5316c6b4 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -3731,7 +3731,7 @@ export interface SectionListData extends SectionBase { [key: string]: any; } -export interface SectionListProperties extends VirtualizedListProperties { +export interface SectionListProperties extends ScrollViewProperties { /** * Rendered in between adjacent Items within each section. */ @@ -3805,7 +3805,7 @@ export interface SectionListProperties extends VirtualizedListProperties< /** * Default renderer for every item in every section. Can be over-ridden on a per-section basis. */ - renderItem: ListRenderItem; + renderItem?: ListRenderItem; /** * Rendered at the top of each section. Sticky headers are not yet supported. From 8070848da5f0259daf40bbd57b971fc7daa22486 Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Mon, 9 Apr 2018 22:25:43 +0200 Subject: [PATCH 0544/2153] Fixed generic type bug in Collection.find (#24857) --- types/mongodb/index.d.ts | 4 ++-- types/mongodb/mongodb-tests.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 335d7e0187..8b5a637ebd 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -509,9 +509,9 @@ export interface Collection { dropIndexes(callback?: MongoCallback): void; dropIndexes(options: {session?: ClientSession, maxTimeMS?: number}, callback: MongoCallback): void; /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#find */ - find(query?: FilterQuery): Cursor; + find(query?: FilterQuery): Cursor; /** @deprecated */ - find(query: FilterQuery, options?: FindOneOptions): Cursor; + find(query: FilterQuery, options?: FindOneOptions): Cursor; /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#findOne */ findOne(filter: FilterQuery, callback: MongoCallback): void; findOne(filter: FilterQuery, options?: FindOneOptions): Promise; diff --git a/types/mongodb/mongodb-tests.ts b/types/mongodb/mongodb-tests.ts index 434f71dc91..270379989a 100644 --- a/types/mongodb/mongodb-tests.ts +++ b/types/mongodb/mongodb-tests.ts @@ -113,5 +113,7 @@ MongoClient.connect('mongodb://127.0.0.1:27017/test', options, function (err: mo $and: [{ $gt: 0, $lt: 100 }] } }); + + const res: mongodb.Cursor = testCollection.find({ _id: 123 }); } }) From 6c5c0a88983b7243ae13f08fd515cad2922bb2d2 Mon Sep 17 00:00:00 2001 From: Tiger Oakes Date: Mon, 9 Apr 2018 13:26:18 -0700 Subject: [PATCH 0545/2153] [three] CubeTextureLoader: Fixed crossOrigin typo and made types more precise (#24848) * Updated CubeTextureLoader types * Feedback: keep `urls` as plain array --- types/three/index.d.ts | 2 +- types/three/three-core.d.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/types/three/index.d.ts b/types/three/index.d.ts index 50450fd793..4afce12ebb 100644 --- a/types/three/index.d.ts +++ b/types/three/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for three.js 0.91 // Project: https://threejs.org -// Definitions by: Kon , Satoru Kimura , Florent Poujol , SereznoKot , HouChunlei , Ivo , David Asmuth , Brandon Roberge, Qinsi ZHU , Toshiya Nakakura , Poul Kjeldager Sørensen , Stefan Profanter , Edmund Fokschaner , Roelof Jooste , Daniel Hritzkiv , Apurva Ojas +// Definitions by: Kon , Satoru Kimura , Florent Poujol , SereznoKot , HouChunlei , Ivo , David Asmuth , Brandon Roberge, Qinsi ZHU , Toshiya Nakakura , Poul Kjeldager Sørensen , Stefan Profanter , Edmund Fokschaner , Roelof Jooste , Daniel Hritzkiv , Apurva Ojas , Tiger Oakes // Definitions: https://github.com//DefinitelyTyped export * from "./three-core"; diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 2d8d40f1d6..2ec61c82cd 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -2303,12 +2303,12 @@ export class CubeTextureLoader { constructor(manager?: LoadingManager); manager: LoadingManager; - corssOrigin: string; - path: string; + crossOrigin: string; + path?: string; load(urls: Array, onLoad?: (texture: CubeTexture) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): CubeTexture; - setCrossOrigin(crossOrigin: string): CubeTextureLoader; - setPath(path: string): CubeTextureLoader; + setCrossOrigin(crossOrigin: string): this; + setPath(path: string): this; } export class DataTextureLoader { From 1f6b5b9e809feace6c95f99f6e0d244d08881346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20Assun=C3=A7=C3=A3o?= Date: Mon, 9 Apr 2018 17:26:29 -0300 Subject: [PATCH 0546/2153] Reactstrap: updated props to Modal component (#24814) --- types/reactstrap/lib/Modal.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/reactstrap/lib/Modal.d.ts b/types/reactstrap/lib/Modal.d.ts index bfab2f56fd..cead67c943 100644 --- a/types/reactstrap/lib/Modal.d.ts +++ b/types/reactstrap/lib/Modal.d.ts @@ -22,6 +22,10 @@ export interface ModalProps extends React.HTMLAttributes { fade?: boolean; backdropTransition?: FadeProps; modalTransition?: FadeProps; + centered?: boolean; + external?: React.ReactNode; + labelledBy?: string; + role?: string; } declare const Modal: React.StatelessComponent; From 89a3abfbff841cfd8dbe0ccd7bfecf425397ef2c Mon Sep 17 00:00:00 2001 From: Daniel K Date: Mon, 9 Apr 2018 22:27:22 +0200 Subject: [PATCH 0547/2153] Change RRN.Link.component to ComponentType (#24758) --- types/react-router-native/index.d.ts | 2 +- .../react-router-native-tests.tsx | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/types/react-router-native/index.d.ts b/types/react-router-native/index.d.ts index 17601361bd..ea2a5f766c 100644 --- a/types/react-router-native/index.d.ts +++ b/types/react-router-native/index.d.ts @@ -33,7 +33,7 @@ export class AndroidBackButton extends React.Component {} export class DeepLinking extends React.Component {} export interface LinkProps { - component?: React.Component | React.ComponentClass; + component?: React.ComponentType; replace?: boolean; style?: any; to: H.LocationDescriptor; diff --git a/types/react-router-native/react-router-native-tests.tsx b/types/react-router-native/react-router-native-tests.tsx index 2cbdfac1b2..5b7dcfa4e7 100644 --- a/types/react-router-native/react-router-native-tests.tsx +++ b/types/react-router-native/react-router-native-tests.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import { StyleSheet, Text, View } from 'react-native'; -import { NativeRouter as Router, Route, Link, AndroidBackButton, BackButton } from 'react-router-native'; +import { StyleSheet, Text, TouchableOpacity, TouchableOpacityProperties, View } from 'react-native'; +import { AndroidBackButton, BackButton, Link, NativeRouter as Router, Route } from 'react-router-native'; const Home: React.SFC = () => { return ( @@ -24,6 +24,14 @@ const About: React.SFC = () => { ); }; +interface ButtonTextProps extends TouchableOpacityProperties { + text: string; +} + +const ButtonText: React.SFC = ({ text, ...props }) => ( + {text} +); + export default class App extends React.Component { render() { return ( @@ -35,9 +43,7 @@ export default class App extends React.Component { Home - - About - + From 192d6dc1254fbe108bf3d5c2aeae825c4c9ca180 Mon Sep 17 00:00:00 2001 From: Dona278 Date: Mon, 9 Apr 2018 22:48:34 +0200 Subject: [PATCH 0548/2153] [typed.js] - Added definition (#24858) --- types/typed.js/index.d.ts | 185 +++++++++++++++++++++++++++++++ types/typed.js/tsconfig.json | 24 ++++ types/typed.js/tslint.json | 3 + types/typed.js/typed.js-tests.ts | 29 +++++ 4 files changed, 241 insertions(+) create mode 100644 types/typed.js/index.d.ts create mode 100644 types/typed.js/tsconfig.json create mode 100644 types/typed.js/tslint.json create mode 100644 types/typed.js/typed.js-tests.ts diff --git a/types/typed.js/index.d.ts b/types/typed.js/index.d.ts new file mode 100644 index 0000000000..45064e9c03 --- /dev/null +++ b/types/typed.js/index.d.ts @@ -0,0 +1,185 @@ +// Type definitions for typed.js 2.0 +// Project: https://github.com/mattboldt/typed.js +// Definitions by: Davide Donadello +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export default Typed; + +export class Typed { + constructor(elementId: string, options: TypedJsOptions); + + /** + * Toggle start() and stop() of the Typed instance + */ + toggle(): void; + + /** + * Stop typing / backspacing and enable cursor blinking + */ + stop(): void; + + /** + * Start typing / backspacing after being stopped + */ + start(): void; + + /** + * Destroy this instance of Typed + */ + destroy(): void; + + /** + * Reset Typed and optionally restarts + */ + reset(restart: boolean): void; +} + +export type TypedJsContentType = "html" | "null"; + +export interface TypedJsOptions { + /** + * Strings to be typed + */ + strings?: string[]; + + /** + * ID of element containing string children + */ + stringsElement?: string; + + /** + * Type speed in milliseconds + */ + typeSpeed?: number; + + /** + * Time before typing starts in milliseconds + */ + startDelay?: number; + + /** + * Backspacing speed in milliseconds + */ + backSpeed?: number; + + /** + * Only backspace what doesn't match the previous string + */ + smartBackspace?: boolean; + + /** + * Shuffle the strings + */ + shuffle?: boolean; + + /** + * Time before backspacing in milliseconds + */ + backDelay?: number; + + /** + * Fade out instead of backspace + */ + fadeOut?: boolean; + + /** + * Css class for fade animation + */ + fadeOutClass?: string; + + /** + * Fade out delay in milliseconds + */ + fadeOutDelay?: number; + + /** + * Loop strings + */ + loop?: boolean; + + /** + * Amount of loops + */ + loopCount?: number; + + /** + * Show cursor + */ + showCursor?: boolean; + + /** + * Character for cursor + */ + cursorChar?: string; + + /** + * Insert CSS for cursor and fadeOut into HTML + */ + autoInsertCss?: boolean; + + /** + * Attribute for typing + * Ex: input placeholder, value, or just HTML text + */ + attr?: string; + + /** + * Bind to focus and blur if el is text input + */ + bindInputFocusEvents?: boolean; + + /** + * 'html' or 'null' for plaintext + */ + contentType?: TypedJsContentType; + + /** + * All typing is complete + */ + onComplete?: (self: Typed) => void; + + /** + * Before each string is typed + */ + preStringTyped?: (arrayPos: number, self: Typed) => void; + + /** + * After each string is typed + */ + onStringTyped?: (arrayPos: number, self: Typed) => void; + + /** + * During looping, after last string is typed + */ + onLastStringBackspaced?: (self: Typed) => void; + + /** + * Typing has been stopped + */ + onTypingPaused?: (arrayPos: number, self: Typed) => void; + + /** + * Typing has been started after being stopped + */ + onTypingResumed?: (arrayPos: number, self: Typed) => void; + + /** + * After reset + */ + onReset?: (self: Typed) => void; + + /** + * After stop + */ + onStop?: (arrayPos: number, self: Typed) => void; + + /** + * After start + */ + onStart?: (arrayPos: number, self: Typed) => void; + + /** + * After destroy + */ + onDestroy?: (self: Typed) => void; +} diff --git a/types/typed.js/tsconfig.json b/types/typed.js/tsconfig.json new file mode 100644 index 0000000000..b018ca64fe --- /dev/null +++ b/types/typed.js/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "typed.js-tests.ts" + ] +} diff --git a/types/typed.js/tslint.json b/types/typed.js/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/typed.js/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/typed.js/typed.js-tests.ts b/types/typed.js/typed.js-tests.ts new file mode 100644 index 0000000000..3e4bd0a137 --- /dev/null +++ b/types/typed.js/typed.js-tests.ts @@ -0,0 +1,29 @@ +import { Typed, TypedJsOptions } from 'typed.js'; + +// Create instance +const typed = new Typed(".element", { + strings: ["First sentence.", "& a second sentence."], + typeSpeed: 100, + startDelay: 0, + backSpeed: 50, + smartBackspace: true, + shuffle: true, + backDelay: 150, + loop: true, + showCursor: true, + autoInsertCss: true, + contentType: "html", + onComplete: (self: Typed) => { + // Complete!! + }, + onDestroy: (self: Typed) => { + // End!! + }, +}); + +// Methods +typed.reset(false); +typed.destroy(); +typed.start(); +typed.stop(); +typed.toggle(); From c701072a0ecbe47091d34020b9f323e3e19a7969 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 9 Apr 2018 21:49:40 +0100 Subject: [PATCH 0549/2153] Cytoscape: Allow overlay style to be set (#23667) * Cytoscape: Allow overlay style to be set * Update TS version --- types/cytoscape/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/cytoscape/index.d.ts b/types/cytoscape/index.d.ts index b04ac2276e..4da9cd9ca0 100644 --- a/types/cytoscape/index.d.ts +++ b/types/cytoscape/index.d.ts @@ -8,7 +8,7 @@ // // Translation from Objects in help to Typescript interface. // http://js.cytoscape.org/#notation/functions -// +// TypeScript Version: 2.2 /** * cy --> Cy.Core @@ -3145,7 +3145,7 @@ declare namespace cytoscape { /** * http://js.cytoscape.org/#style/node-body */ - interface Node extends PaddingNode { + interface Node extends Partial, PaddingNode { "label"?: string; /** * The width of the node’s body. @@ -3320,7 +3320,7 @@ declare namespace cytoscape { "pie-i-background-opacity": number; } - interface Edge extends EdgeLine, EdgeArror { } + interface Edge extends EdgeLine, EdgeArror, Partial { } /** * These properties affect the styling of an edge’s line: From 52670470e34ab31afd946cc34939661574792ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kh=E1=BA=A3i?= Date: Tue, 10 Apr 2018 03:52:55 +0700 Subject: [PATCH 0550/2153] Change type of path.sep and path.delimiter in @types/node (#24833) * Update type of path.sep and path.delimiter * Change `path.sep` to `'\\' | '/'` * Change `path.delimiter` to `';' | ':'` * Update index.d.ts * Change types of path.sep and path.delimiter in types/node/{v8,v6} * Change types of path.sep and path.delimiter in types/node/v7 --- types/node/index.d.ts | 5 +++-- types/node/v6/index.d.ts | 5 +++-- types/node/v7/index.d.ts | 5 +++-- types/node/v8/index.d.ts | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 3404e37d46..2522d51f54 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -20,6 +20,7 @@ // Klaus Meinhardt // Huw // Nicolas Even +// Hoàng Văn Khải // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** inspector module types */ @@ -4683,11 +4684,11 @@ declare module "path" { /** * The platform-specific file separator. '\\' or '/'. */ - export var sep: string; + export var sep: '\\' | '/'; /** * The platform-specific file delimiter. ';' or ':'. */ - export var delimiter: string; + export var delimiter: ';' | ':'; /** * Returns an object from a path string - the opposite of format(). * diff --git a/types/node/v6/index.d.ts b/types/node/v6/index.d.ts index f38cdf01dd..ed9949a9ac 100644 --- a/types/node/v6/index.d.ts +++ b/types/node/v6/index.d.ts @@ -6,6 +6,7 @@ // Thomas Bouldin // Sebastian Silbermann // Alorel +// Hoàng Văn Khải // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /************************************************ @@ -3003,11 +3004,11 @@ declare module "path" { /** * The platform-specific file separator. '\\' or '/'. */ - export var sep: string; + export var sep: '\\' | '/'; /** * The platform-specific file delimiter. ';' or ':'. */ - export var delimiter: string; + export var delimiter: ';' | ':'; /** * Returns an object from a path string - the opposite of format(). * diff --git a/types/node/v7/index.d.ts b/types/node/v7/index.d.ts index 896b5a887f..950e143536 100644 --- a/types/node/v7/index.d.ts +++ b/types/node/v7/index.d.ts @@ -6,6 +6,7 @@ // Christian Vaagland Tellnes // Wilco Bakker // Sebastian Silbermann +// Hoàng Văn Khải // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /************************************************ @@ -3092,11 +3093,11 @@ declare module "path" { /** * The platform-specific file separator. '\\' or '/'. */ - export var sep: string; + export var sep: '\\' | '/'; /** * The platform-specific file delimiter. ';' or ':'. */ - export var delimiter: string; + export var delimiter: ';' | ':'; /** * Returns an object from a path string - the opposite of format(). * diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index 164df0a960..28bc5dc779 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -19,6 +19,7 @@ // Alberto Schiabel // Huw // Nicolas Even +// Hoàng Văn Khải // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -4662,11 +4663,11 @@ declare module "path" { /** * The platform-specific file separator. '\\' or '/'. */ - export var sep: string; + export var sep: '\\' | '/'; /** * The platform-specific file delimiter. ';' or ':'. */ - export var delimiter: string; + export var delimiter: ';' | ':'; /** * Returns an object from a path string - the opposite of format(). * From d39c95d43fa49a8130d15f102f1d47b6943845b3 Mon Sep 17 00:00:00 2001 From: Pusztai Tibor Date: Mon, 9 Apr 2018 23:00:14 +0200 Subject: [PATCH 0551/2153] Add few methods and indexCreate overload to rethinkdb types (#24692) * Add few methods and indexCreate overload to rethinkdb types Inspired by https://github.com/types/rethinkdb * Add server method to Connection in rethinkdb types --- types/rethinkdb/index.d.ts | 45 ++++++++++++++++++++++++++++-- types/rethinkdb/rethinkdb-tests.ts | 16 +++++++++++ 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/types/rethinkdb/index.d.ts b/types/rethinkdb/index.d.ts index 038a9d48e6..aedd37950d 100644 --- a/types/rethinkdb/index.d.ts +++ b/types/rethinkdb/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for RethinkDB 2.3 // Project: http://rethinkdb.com/ -// Definitions by: Alex Gorbatchev , Adrian Farmadin +// Definitions by: Alex Gorbatchev +// Adrian Farmadin +// Pusztai Tibor // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -42,6 +44,7 @@ declare module "rethinkdb" { export function point(lng: number, lat: number): Point; export function polygon(...point: Point[]): Polygon; + export function circle(point: Point, radius: number, options?: CircleOptions): Geometry; export var count: Aggregator; export function sum(prop: string): Aggregator; @@ -136,6 +139,12 @@ declare module "rethinkdb" { noreplyWait: boolean; } + interface ServerResult { + id: string; + proxy: boolean; + name?: string; + } + interface Connection { open: boolean; @@ -148,6 +157,9 @@ declare module "rethinkdb" { reconnect(opts: NoReplyWait, cb: (err: Error, conn: Connection) => void): void; reconnect(opts?: NoReplyWait): Promise; + server(cb: (err: Error, conn: ServerResult) => void): void; + server(): Promise; + use(dbName: string): void; addListener(event: string, cb: Function): void; on(event: string, cb: Function): void; @@ -236,7 +248,7 @@ declare module "rethinkdb" { * See: https://rethinkdb.com/api/javascript/has_fields/ */ hasFields(...fields: string[]): T; - } + } interface Geometry { } @@ -245,7 +257,7 @@ declare module "rethinkdb" { interface Polygon extends Geometry { } interface Table extends Sequence, HasFields { - indexCreate(name: string, index?: ExpressionFunction): Operation; + indexCreate(name: string, index?: IndexFunction): Operation; indexDrop(name: string): Operation; indexList(): Operation; indexWait(name?: string): Operation>; @@ -301,6 +313,7 @@ declare module "rethinkdb" { isEmpty(): Expression; union(sequence: Sequence): Sequence; sample(n: number): Sequence; + getField(prop: string): Sequence; // Aggregate reduce(r: ReduceFunction, base?: any): Expression; @@ -315,6 +328,8 @@ declare module "rethinkdb" { without(...props: string[]): Sequence; } + type IndexFunction = Expression | Expression[] | ((doc: Expression) => Expression | Expression[]); + interface ExpressionFunction { (doc: Expression): Expression; } @@ -339,6 +354,28 @@ declare module "rethinkdb" { returnChanges?: boolean; } + export interface DistanceOptions { + /** + * Unit for the distance. Possible values are `m` (meter, the default), `km` (kilometer), `mi` (international mile), `nm` (nautical mile), `ft` (international foot). + */ + unit?: 'm' | 'km' | 'mi' | 'nm' | 'ft'; + /** + * The reference ellipsoid to use for geographic coordinates. Possible values are `WGS84` (the default), a common standard for Earth’s geometry, or `unit_sphere`, a perfect sphere of 1 meter radius. + */ + geoSystem?: 'WGS84' | 'unit_sphere'; + } + + export interface CircleOptions extends DistanceOptions { + /** + * The number of vertices in the polygon or line. Defaults to 32. + */ + numVertices?: number; + /** + * If `true` (the default) the circle is filled, creating a polygon; if `false` the circle is unfilled (creating a line). + */ + fill?: boolean; + } + interface WriteResult { inserted: number; replaced: number; @@ -418,6 +455,8 @@ declare module "rethinkdb" { div(n: number): Expression; mod(n: number): Expression; + distance(geometry: Geometry, options?: DistanceOptions): Expression; + default(value: T): Expression; } diff --git a/types/rethinkdb/rethinkdb-tests.ts b/types/rethinkdb/rethinkdb-tests.ts index 411a306d7c..fb129b94a5 100644 --- a/types/rethinkdb/rethinkdb-tests.ts +++ b/types/rethinkdb/rethinkdb-tests.ts @@ -6,6 +6,8 @@ function cursorCallback(cursor: r.Cursor): void {} r.connect({ host: "localhost", port: 28015 }, function(err: Error, conn: r.Connection) { console.log("HI", err, conn); + conn.server((err, server) => {}); + const testDb = r.db("test"); r.table("players").hasFields("games_won").run(conn, errorAndCursorCallback); @@ -20,6 +22,14 @@ r.connect({ host: "localhost", port: 28015 }, function(err: Error, conn: r.Conne ) .run(conn, errorAndCursorCallback); + const center = r.point(123, 456); + r.table("geo") + .getIntersecting(r.circle(center, 1000, { unit: "m" }), { index: "location" }) + .orderBy(r.row("location").distance(center, { unit: "m" })) + .eqJoin("external", testDb.table("other"), { index: "external" }) + .getField("right") + .run(conn, errorAndCursorCallback); + testDb.tableCreate("users").run(conn, function(err, stuff) { const users = testDb.table("users"); users.wait({waitFor: 'ready_for_reads'}); @@ -41,6 +51,8 @@ r.connect({ host: "localhost", port: 28015 }, function(err: Error, conn: r.Conne }); }); + testDb.table("users").indexCreate("name_index", [r.row("name")]); + r.js("'str1' + 'str2'").run(conn, function (err, value) {}); r.uuid().run(conn, function (err, uuid) {}); r.uuid("input value").run(conn, function (err, uuid) {}); @@ -54,6 +66,10 @@ r.connect({ host: "localhost", port: 28015 }, function(err: Error, conn: r.Conne r.connect({ host: "localhost", port: 28015 }).then(function(conn: r.Connection) { console.log("HI", conn); + conn.server().then(server => { + console.log(server.id, server.proxy); + }); + const testDb = r.db("test"); testDb.wait({timeout: 1}); From 15db8183d988a2caf174fd08507a1935002b5b37 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Mon, 9 Apr 2018 23:01:27 +0200 Subject: [PATCH 0552/2153] [React-native] Fix type for Stylesheet.flatten (#24772) * Use generic type for Stylesheet.flatten * Keep using overload, but fix it by changing order of definition * Adding tests --- types/react-native/index.d.ts | 2 +- types/react-native/test/index.tsx | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 5e5316c6b4..53514cfdd3 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -4840,9 +4840,9 @@ export namespace StyleSheet { * the alternative use. */ export function flatten(style?: RegisteredStyle): T; - export function flatten(style?: StyleProp): ViewStyle; export function flatten(style?: StyleProp): TextStyle; export function flatten(style?: StyleProp): ImageStyle; + export function flatten(style?: StyleProp): ViewStyle; /** * This is defined as the width of a thin line on the platform. It can be diff --git a/types/react-native/test/index.tsx b/types/react-native/test/index.tsx index 557df0869d..8d3925d4bd 100644 --- a/types/react-native/test/index.tsx +++ b/types/react-native/test/index.tsx @@ -22,10 +22,12 @@ import { DataSourceAssetCallback, DeviceEventEmitterStatic, Dimensions, + ImageStyle, InteractionManager, ListView, ListViewDataSource, StyleSheet, + StyleProp, Systrace, Text, TextStyle, @@ -127,6 +129,20 @@ const stylesAlt = StyleSheet.create({ const welcomeFontSize = StyleSheet.flatten(styles.welcome).fontSize; +const viewStyle: StyleProp = { + backgroundColor: "#F5FCFF", +} +const textStyle: StyleProp = { + fontSize: 20, +} +const imageStyle: StyleProp = { + resizeMode: 'contain', +} + +const viewProperty = StyleSheet.flatten(viewStyle).backgroundColor; +const textProperty = StyleSheet.flatten(textStyle).fontSize; +const imageProperty = StyleSheet.flatten(imageStyle).resizeMode; + class CustomView extends React.Component { render() { return Custom View; From 7a5a3751ab8ceb5c04a07bdc1f5734e30a58709a Mon Sep 17 00:00:00 2001 From: "M. Fatih MAR" Date: Mon, 9 Apr 2018 22:03:50 +0100 Subject: [PATCH 0553/2153] Add Missing Constants (#24809) --- .../electron-devtools-installer-tests.ts | 5 +++++ types/electron-devtools-installer/index.d.ts | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/types/electron-devtools-installer/electron-devtools-installer-tests.ts b/types/electron-devtools-installer/electron-devtools-installer-tests.ts index a453221698..798e6ad223 100644 --- a/types/electron-devtools-installer/electron-devtools-installer-tests.ts +++ b/types/electron-devtools-installer/electron-devtools-installer-tests.ts @@ -3,6 +3,8 @@ import installExtension, { BACKBONE_DEBUGGER, JQUERY_DEBUGGER, ANGULARJS_BATARANG, VUEJS_DEVTOOLS, REDUX_DEVTOOLS, REACT_PERF, + CYCLEJS_DEVTOOL, APOLLO_DEVELOPER_TOOLS, + MOBX_DEVTOOLS } from 'electron-devtools-installer'; @@ -14,4 +16,7 @@ installExtension(ANGULARJS_BATARANG); installExtension(VUEJS_DEVTOOLS); installExtension(REDUX_DEVTOOLS); installExtension(REACT_PERF); +installExtension(CYCLEJS_DEVTOOL); +installExtension(APOLLO_DEVELOPER_TOOLS); +installExtension(MOBX_DEVTOOLS); installExtension('abcdefghijkl'); \ No newline at end of file diff --git a/types/electron-devtools-installer/index.d.ts b/types/electron-devtools-installer/index.d.ts index 8a108c1d2f..88649cd0a8 100644 --- a/types/electron-devtools-installer/index.d.ts +++ b/types/electron-devtools-installer/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for electron-devtools-installer v2.0.1 // Project: https://github.com/MarshallOfSound/electron-devtools-installer // Definitions by: Robin Van den Broeck +// M. Fatih Mar // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module "electron-devtools-installer" { @@ -21,4 +22,7 @@ declare module "electron-devtools-installer" { export const VUEJS_DEVTOOLS: ExtensionReference; export const REDUX_DEVTOOLS: ExtensionReference; export const REACT_PERF: ExtensionReference; + export const CYCLEJS_DEVTOOL: ExtensionReference; + export const APOLLO_DEVELOPER_TOOLS: ExtensionReference; + export const MOBX_DEVTOOLS: ExtensionReference; } \ No newline at end of file From c63b81da94f147233634defc907c496e4185da4b Mon Sep 17 00:00:00 2001 From: Adam Epling Date: Mon, 9 Apr 2018 23:04:30 +0200 Subject: [PATCH 0554/2153] Add `placeholder`, for use in contentEditable elements (#24539) * Added `placeholder` to the list of standard attributes, to allow its use on contentEditable
    elements. * Added placeholder for use in contentEditable elements in React. --- types/react/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 4b22054b77..968063559a 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -934,6 +934,7 @@ declare namespace React { hidden?: boolean; id?: string; lang?: string; + placeholder?: string; slot?: string; spellCheck?: boolean; style?: CSSProperties; From 467b78e8b15be4f0d2b9e0ee7be3861147c5f66c Mon Sep 17 00:00:00 2001 From: Zbyszek Wieczorek Date: Mon, 9 Apr 2018 23:08:31 +0200 Subject: [PATCH 0555/2153] Mssing datepticker orientation options: (#24827) https://bootstrap-datepicker.readthedocs.io/en/stable/options.html#orientation taken from author's online demo: https://uxsolutions.github.io/bootstrap-datepicker/ --- types/bootstrap-datepicker/index.d.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/types/bootstrap-datepicker/index.d.ts b/types/bootstrap-datepicker/index.d.ts index dfe358854e..b841fe07ab 100644 --- a/types/bootstrap-datepicker/index.d.ts +++ b/types/bootstrap-datepicker/index.d.ts @@ -10,7 +10,20 @@ type DatepickerEvents = "show"|"hide"|"clearDate"|"changeDate"|"changeMonth"|"ch type DatepickerViewModes = 0|"days"|1|"months"|2|"years"|3|"decades"|4|"centuries"|"millenium"; -type DatepickerOrientations = "auto"|"left top"|"left bottom"|"right top"|"right bottom"; +type DatepickerOrientations = + "auto" + | "left top" + | "left bottom" + | "right top" + | "right bottom" + | "top auto" + | "bottom auto" + | "auto left" + | "top left" + | "bottom left" + | "auto right" + | "top right" + | "bottom right" /** * All options that take a “Date” can handle a Date object; a String From c2724adc96c7d9be8162860bc2223a0853120516 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 9 Apr 2018 14:10:29 -0700 Subject: [PATCH 0556/2153] wordcloud: Lint and expose as a module (#24845) --- types/wordcloud/index.d.ts | 16 ++-- types/wordcloud/tslint.json | 76 +----------------- types/wordcloud/wordcloud-tests.ts | 125 +++++++++++++---------------- 3 files changed, 69 insertions(+), 148 deletions(-) diff --git a/types/wordcloud/index.d.ts b/types/wordcloud/index.d.ts index 76d1939799..79ed06d252 100644 --- a/types/wordcloud/index.d.ts +++ b/types/wordcloud/index.d.ts @@ -1,20 +1,23 @@ -// Type definitions for wordcloud +// Type definitions for wordcloud 1.1 // Project: https://github.com/timdream/wordcloud2.js // Definitions by: Joe Skeen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export = WordCloud; +export as namespace WordCloud; + declare function WordCloud(elements: HTMLElement | HTMLElement[], options: WordCloud.Options): void; declare namespace WordCloud { - var isSupported: boolean; - var miniumFontSize: number; + const isSupported: boolean; + let miniumFontSize: number; interface Options { /** * List of words/text to paint on the canvas in a 2-d array, in the form of [word, size], * e.g. [['foo', 12] , ['bar', 6]]. */ - list?: Array | any[]; + list?: ListEntry[] | any[]; /** font to use. */ fontFamily?: string; /** font weight to use, e.g. normal, bold or 600 */ @@ -28,8 +31,9 @@ declare namespace WordCloud { /** * for DOM clouds, allows the user to define the class of the span elements.Can be a normal class * string, applying the same class to every span or a callback(word, weight, fontSize, distance, theta) - * for per-span class definition. In canvas clouds or if equals null, this option has no effect. */ - classes?: string | ((word: string, weight: string | number, fontSize: number, distance: number, theta: number) => string); + * for per-span class definition. In canvas clouds or if equals null, this option has no effect. + */ + classes?: string | ((word: string, weight: string | number, fontSize: number, distance: number, theta: number) => string); /** minimum font size to draw on the canvas. */ minSize?: number; /** function to call or number to multiply for size of each word in the list. */ diff --git a/types/wordcloud/tslint.json b/types/wordcloud/tslint.json index a41bf5d19a..3d04da382b 100644 --- a/types/wordcloud/tslint.json +++ b/types/wordcloud/tslint.json @@ -1,79 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + // TODO + "ban-types": false } } diff --git a/types/wordcloud/wordcloud-tests.ts b/types/wordcloud/wordcloud-tests.ts index 1486d03307..8f21798c33 100644 --- a/types/wordcloud/wordcloud-tests.ts +++ b/types/wordcloud/wordcloud-tests.ts @@ -1,24 +1,15 @@ -/// +import WordCloud = require("wordcloud"); -'use strict'; -//declare function test(name: string, test: Function); -var element: HTMLElement | HTMLElement[]; +declare function test(name: string, cb: () => void): void; + +declare const element: HTMLElement | HTMLElement[]; if (!WordCloud.isSupported) console.log('WordCloud is not supported.'); - + WordCloud.miniumFontSize = 20; -var list = (function () { - var string = 'Grumpy wizards make toxic brew for the evil Queen and Jack'; - - var list: WordCloud.ListEntry[] = []; - string.split(' ').forEach(function(word) { - list.push([word, word.length * 5]); - }); - - return list; -})(); +const list = 'Grumpy wizards make toxic brew for the evil Queen and Jack'.split(' ').map(word => [word, word.length * 5]); function getTestOptions(): WordCloud.Options { return { @@ -26,107 +17,107 @@ function getTestOptions(): WordCloud.Options { rotateRatio: 0, color: '#000', fontFamily: 'sans-serif', - list: list + list, }; -}; +} -QUnit.test('Test runs without any extra parameters.', function() { - var options = getTestOptions(); +test('Test runs without any extra parameters.', () => { + const options = getTestOptions(); WordCloud(element, options); }); -QUnit.test('Empty list results no output.', function() { - var options = getTestOptions(); +test('Empty list results no output.', () => { + const options = getTestOptions(); options.list = []; WordCloud(element, options); }); -QUnit.test('gridSize can be set', function() { - var options = getTestOptions(); +test('gridSize can be set', () => { + const options = getTestOptions(); options.gridSize = 15; WordCloud(element, options); }); -QUnit.test('ellipticity can be set', function() { - var options = getTestOptions(); +test('ellipticity can be set', () => { + const options = getTestOptions(); options.ellipticity = 1.5; WordCloud(element, options); }); -QUnit.test('origin can be set', function() { - var options = getTestOptions(); +test('origin can be set', () => { + const options = getTestOptions(); options.origin = [300, 0]; WordCloud(element, options); }); -QUnit.test('minSize can be set', function() { - var options = getTestOptions(); +test('minSize can be set', () => { + const options = getTestOptions(); options.minSize = 10; WordCloud(element, options); }); -QUnit.test('rotation can be set and locked', function() { - var options = getTestOptions(); +test('rotation can be set and locked', () => { + const options = getTestOptions(); options.rotateRatio = 1; options.minRotation = options.maxRotation = Math.PI / 6; WordCloud(element, options); }); -QUnit.test('drawMask can be set', function() { - var options = getTestOptions(); +test('drawMask can be set', () => { + const options = getTestOptions(); options.drawMask = true; WordCloud(element, options); }); -QUnit.test('maskColor can be set', function() { - var options = getTestOptions(); +test('maskColor can be set', () => { + const options = getTestOptions(); options.drawMask = true; options.maskColor = 'rgba(0, 0, 255, 0.8)'; WordCloud(element, options); }); -QUnit.test('backgroundColor can be set', function() { - var options = getTestOptions(); +test('backgroundColor can be set', () => { + const options = getTestOptions(); options.backgroundColor = 'rgb(0, 0, 255)'; WordCloud(element, options); }); -QUnit.test('semi-transparent backgroundColor can be set', function() { - var options = getTestOptions(); +test('semi-transparent backgroundColor can be set', () => { + const options = getTestOptions(); options.backgroundColor = 'rgba(0, 0, 255, 0.3)'; WordCloud(element, options); }); -QUnit.test('weightFactor can be set', function() { - var options = getTestOptions(); +test('weightFactor can be set', () => { + const options = getTestOptions(); options.weightFactor = 2; WordCloud(element, options); }); -QUnit.test('weightFactor can be set as a function', function() { - var options = getTestOptions(); - options.weightFactor = function (w) { return Math.sqrt(w); }; +test('weightFactor can be set as a function', () => { + const options = getTestOptions(); + options.weightFactor = w => Math.sqrt(w); WordCloud(element, options); }); -QUnit.test('color can be set as a function', function() { - var options = getTestOptions(); - options.color = function (word, weight, fontSize, radius, theta) { - if (theta < 2*Math.PI/3) { +test('color can be set as a function', () => { + const options = getTestOptions(); + options.color = (word, weight, fontSize, radius, theta) => { + if (theta < 2 * Math.PI / 3) { return '#600'; - } else if (theta < 2*Math.PI*2/3) { + } else if (theta < 2 * Math.PI * 2 / 3) { return '#060'; } else { return '#006'; @@ -136,60 +127,58 @@ QUnit.test('color can be set as a function', function() { WordCloud(element, options); }); -QUnit.test('shape can be set to circle', function() { - var options = getTestOptions(); +test('shape can be set to circle', () => { + const options = getTestOptions(); options.shape = 'circle'; WordCloud(element, options); }); -QUnit.test('shape can be set to cardioid', function() { - var options = getTestOptions(); +test('shape can be set to cardioid', () => { + const options = getTestOptions(); options.shape = 'cardioid'; WordCloud(element, options); }); -QUnit.test('shape can be set to diamond', function() { - var options = getTestOptions(); +test('shape can be set to diamond', () => { + const options = getTestOptions(); options.shape = 'diamond'; WordCloud(element, options); }); -QUnit.test('shape can be set to triangle', function() { - var options = getTestOptions(); +test('shape can be set to triangle', () => { + const options = getTestOptions(); options.shape = 'triangle'; WordCloud(element, options); }); -QUnit.test('shape can be set to triangle-forward', function() { - var options = getTestOptions(); +test('shape can be set to triangle-forward', () => { + const options = getTestOptions(); options.shape = 'triangle-forward'; WordCloud(element, options); }); -QUnit.test('shape can be set to pentagon', function() { - var options = getTestOptions(); +test('shape can be set to pentagon', () => { + const options = getTestOptions(); options.shape = 'pentagon'; WordCloud(element, options); }); -QUnit.test('shape can be set to star', function() { - var options = getTestOptions(); +test('shape can be set to star', () => { + const options = getTestOptions(); options.shape = 'star'; WordCloud(element, options); }); -QUnit.test('shape can be set to a given polar equation', function() { - var options = getTestOptions(); - options.shape = function (theta) { - return theta / (2 * Math.PI); - }; +test('shape can be set to a given polar equation', () => { + const options = getTestOptions(); + options.shape = theta => theta / (2 * Math.PI); WordCloud(element, options); }); From fd5d770d39c0918fc420c9b29e9ff647cb86aa24 Mon Sep 17 00:00:00 2001 From: Eric Kirkham Date: Mon, 9 Apr 2018 16:14:33 -0700 Subject: [PATCH 0557/2153] add caretHidden to TextInputProperties --- types/react-native/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 53514cfdd3..84b7032562 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -1092,6 +1092,11 @@ export interface TextInputProperties */ blurOnSubmit?: boolean; + /** + * If true, the caret is hidden + */ + caretHidden?: boolean + /** * Provides an initial value that will change when the user starts typing. * Useful for simple use-cases where you don't want to deal with listening to events From c0d45f681033af09d4e7ceeb380d5ef35218e2e7 Mon Sep 17 00:00:00 2001 From: Rob Date: Tue, 10 Apr 2018 01:20:53 +0200 Subject: [PATCH 0558/2153] Added typings for next/config. (#24815) --- types/next/config.d.ts | 1 + types/next/tsconfig.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 types/next/config.d.ts diff --git a/types/next/config.d.ts b/types/next/config.d.ts new file mode 100644 index 0000000000..1b2e330bb0 --- /dev/null +++ b/types/next/config.d.ts @@ -0,0 +1 @@ +export default function(): {serverRuntimeConfig: any, publicRuntimeConfig: any}; diff --git a/types/next/tsconfig.json b/types/next/tsconfig.json index 05e0b4e7ad..48d3f0c8be 100644 --- a/types/next/tsconfig.json +++ b/types/next/tsconfig.json @@ -26,6 +26,7 @@ "head.d.ts", "link.d.ts", "router.d.ts", + "config.d.ts", "test/next-tests.ts", "test/next-error-tests.tsx", "test/next-head-tests.tsx", @@ -34,4 +35,4 @@ "test/next-dynamic-tests.tsx", "test/next-router-tests.tsx" ] -} \ No newline at end of file +} From d1d68e7452babdc7a57212b3d184e4e2ec6fab04 Mon Sep 17 00:00:00 2001 From: Fluccioni Date: Tue, 10 Apr 2018 01:22:03 +0200 Subject: [PATCH 0559/2153] Add google pay web api definitions (#24860) --- types/googlepay/googlepay-tests.ts | 68 ++++++++++++ types/googlepay/index.d.ts | 160 +++++++++++++++++++++++++++++ types/googlepay/tsconfig.json | 24 +++++ types/googlepay/tslint.json | 3 + 4 files changed, 255 insertions(+) create mode 100644 types/googlepay/googlepay-tests.ts create mode 100644 types/googlepay/index.d.ts create mode 100644 types/googlepay/tsconfig.json create mode 100644 types/googlepay/tslint.json diff --git a/types/googlepay/googlepay-tests.ts b/types/googlepay/googlepay-tests.ts new file mode 100644 index 0000000000..ea97c2a586 --- /dev/null +++ b/types/googlepay/googlepay-tests.ts @@ -0,0 +1,68 @@ +const allowedPaymentMethods = new Array('CARD', 'TOKENIZED_CARD'); + +const allowedCardNetworks = new Array('AMEX', 'DISCOVER', 'JCB', 'MASTERCARD', 'VISA'); + +const tokenizationParameters: google.payments.api.PaymentMethodTokenizationParameters = { + tokenizationType: 'PAYMENT_GATEWAY', + parameters: { + gateway: 'example', + gatewayMerchantId: 'abc123' + } +}; + +const getGooglePaymentsClient = (env?: google.payments.api.EnvironmentType) => new google.payments.api.PaymentsClient({environment: env}); + +function onGooglePayLoaded() { + const client = getGooglePaymentsClient(); + + client.isReadyToPay({allowedPaymentMethods}).then(response => { + if (response.result) { + addGooglePayButton(); + prefetchGooglePaymentData(); + } + }).catch(err => { + console.error(err); + }); +} + +function addGooglePayButton() { + const button = document.createElement('button'); + button.className = 'google-pay'; + button.appendChild(document.createTextNode('Google Pay')); + button.addEventListener('click', onGooglePaymentButtonClick); + document.appendChild(document.createElement('div').appendChild(button)); +} + +function getGooglePaymentDataConfiguration(): google.payments.api.PaymentDataRequest { + return { + merchantId: '01234567890123456789', + transactionInfo: { + totalPriceStatus: 'FINAL', + totalPrice: '123.45', + currencyCode: 'USD' + }, + paymentMethodTokenizationParameters: tokenizationParameters, + allowedPaymentMethods, + cardRequirements: { + allowedCardNetworks, + billingAddressRequired: true, + billingAddressFormat: 'FULL' + }, + phoneNumberRequired: false, + shippingAddressRequired: true + }; +} + +function prefetchGooglePaymentData() { + const client = getGooglePaymentsClient(); + client.prefetchPaymentData(getGooglePaymentDataConfiguration()); +} + +function onGooglePaymentButtonClick() { + const request = getGooglePaymentDataConfiguration(); + const client = getGooglePaymentsClient(); + + client.loadPaymentData(request) + .then(data => console.log(data)) + .catch(err => console.error(err)); +} diff --git a/types/googlepay/index.d.ts b/types/googlepay/index.d.ts new file mode 100644 index 0000000000..524c277691 --- /dev/null +++ b/types/googlepay/index.d.ts @@ -0,0 +1,160 @@ +// Type definitions for Google Pay API 0.0 +// Project: https://developers.google.com/pay/api/web/setup/ +// Definitions by: Florian Luccioni +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace google.payments.api { + type AddressFormat = 'FULL' | 'MIN'; + type AllowedCardNetwork = 'AMEX' | 'DISCOVER' | 'JCB' | 'MASTERCARD' | 'VISA'; + type AllowedPaymentMethod = 'CARD' | 'TOKENIZED_CARD'; + type CardClass = 'CREDIT' | 'DEBIT'; + type CardInfo = CardInfoMin | CardInfoFull; + type CardRequirements = CardRequirementsMin | CardRequirementsFull; + type EnvironmentType = 'PRODUCTION' | 'TEST'; + type ErrorStatusCode = 'BUYER_ACCOUNT_ERROR' | 'CANCELED' | 'DEVELOPER_ERROR' | 'INTERNAL_ERROR'; + type PaymentMethodTokenizationParameters = PaymentMethodDirectTokenizationParameters | PaymentMethodGatewayTokenizationParameters; + type TokenizationType = 'DIRECT' | 'PAYMENT_GATEWAY'; + type TotalPriceStatus = 'ESTIMATED' | 'FINAL' | 'NOT_CURRENTLY_KNOWN'; + type UserAddress = UserAddressFull | UserAddressMin; + type PaymentDataRequest = PaymentDataRequestMin | PaymentDataRequestFull; + type PaymentData = PaymentDataMin | PaymentDataFull; + + interface PaymentOptions { + environment?: EnvironmentType; + } + + interface IsReadyToPayRequest { + allowedPaymentMethods: AllowedPaymentMethod[]; + } + + interface BasePaymentDataRequest { + merchantId: string; + transactionInfo: TransactionInfo; + cardRequirements: CardRequirements; + paymentMethodTokenizationParameters: PaymentMethodTokenizationParameters; + allowedPaymentMethods: AllowedPaymentMethod[]; + phoneNumberRequired?: boolean; + emailRequired?: boolean; + shippingAddressRequired?: boolean; + shippingAddressRequirements?: ShippingAddressRequirements; + } + + interface PaymentDataRequestMin extends BasePaymentDataRequest { + cardRequirements: CardRequirementsMin; + } + + interface PaymentDataRequestFull extends BasePaymentDataRequest { + cardRequirements: CardRequirementsFull; + } + + interface BasePaymentMethodTokenizationParameters { + tokenizationType: TokenizationType; + } + + interface PaymentMethodGatewayTokenizationParameters extends BasePaymentMethodTokenizationParameters { + tokenizationType: 'PAYMENT_GATEWAY'; + parameters: { + [parameter: string]: string; + }; + } + + interface PaymentMethodDirectTokenizationParameters extends BasePaymentMethodTokenizationParameters { + tokenizationType: 'DIRECT'; + parameters: { + publicKey: string; + }; + } + + interface BaseCardRequirements { + allowedCardNetworks: AllowedCardNetwork[]; + billingAddressRequired?: boolean; + billingAddressFormat?: AddressFormat; + } + + interface CardRequirementsMin extends BaseCardRequirements { + billingAddressFormat?: 'MIN'; + } + + interface CardRequirementsFull extends BaseCardRequirements { + billingAddressFormat?: 'FULL'; + } + + interface ShippingAddressRequirements { + allowedCountryCodes?: string[]; + } + + interface TransactionInfo { + totalPriceStatus: TotalPriceStatus; + totalPrice?: string; + currencyCode?: string; + } + + interface BasePaymentData { + cardInfo: CardInfo; + paymentMethodToken: PaymentMethodToken; + shippingAddress?: UserAddressFull; + email?: string; + } + + interface PaymentDataMin extends BasePaymentData { + cardInfo: CardInfoMin; + } + + interface PaymentDataFull extends BasePaymentData { + cardInfo: CardInfoFull; + } + + interface BaseCardInfo { + cardDescription: string; + cardClass: CardClass; + cardDetails: string; + cardNetwork: AllowedCardNetwork; + billingAddress?: UserAddress; + } + + interface CardInfoMin extends BaseCardInfo { + billingAddress?: UserAddressMin; + } + + interface CardInfoFull extends BaseCardInfo { + billingAddress?: UserAddressFull; + } + + interface UserAddressMin { + name: string; + postalCode: string; + countryCode: string; + phoneNumber?: string; + } + + interface UserAddressFull extends UserAddressMin { + companyName: string; + address1: string; + address2: string; + address3: string; + address4: string; + address5: string; + locality: string; + administrativeArea: string; + sortingCode: string; + } + + interface PaymentMethodToken { + tokenizationType: TokenizationType; + token: string; + } + + interface PaymentsError { + statusCode: ErrorStatusCode; + statusMessage: string; + } + + class PaymentsClient { + constructor(paymentOptions: PaymentOptions); + isReadyToPay(request: IsReadyToPayRequest): Promise<{result: boolean}>; + loadPaymentData(request: PaymentDataRequestMin): Promise; + loadPaymentData(request: PaymentDataRequestFull): Promise; + loadPaymentData(request: PaymentDataRequest): Promise; + prefetchPaymentData(request: PaymentDataRequest): void; + } +} diff --git a/types/googlepay/tsconfig.json b/types/googlepay/tsconfig.json new file mode 100644 index 0000000000..38fba1d6c8 --- /dev/null +++ b/types/googlepay/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "googlepay-tests.ts" + ] +} diff --git a/types/googlepay/tslint.json b/types/googlepay/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/googlepay/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From bf0dd39818917e1a6e06f45111525004b7655fc0 Mon Sep 17 00:00:00 2001 From: Rasmus Eneman Date: Tue, 10 Apr 2018 01:23:25 +0200 Subject: [PATCH 0560/2153] Improve type inference of react-redux (#24764) --- types/react-redux/index.d.ts | 12 ++++++------ types/react-redux/react-redux-tests.tsx | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index 1528d58af5..52cc28b9a5 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -10,14 +10,14 @@ // Prashant Deva // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 - + // Known Issue: -// There is a known issue in TypeScript, which doesn't allow decorators to change the signature of the classes +// There is a known issue in TypeScript, which doesn't allow decorators to change the signature of the classes // they are decorating. Due to this, if you are using @connect() decorator in your code, // you will see a bunch of errors from TypeScript. The current workaround is to use connect() as a function call on // a separate line instead of as a decorator. Discussed in this github issue: // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/20796 - + import * as React from 'react'; import * as Redux from 'redux'; @@ -80,17 +80,17 @@ export interface Connect { ( mapStateToProps: MapStateToPropsParam - ): InferableComponentEnhancerWithProps, TOwnProps>; + ): InferableComponentEnhancerWithProps & TOwnProps, TOwnProps>; ( mapStateToProps: null | undefined, mapDispatchToProps: MapDispatchToPropsParam - ): InferableComponentEnhancerWithProps; + ): InferableComponentEnhancerWithProps; ( mapStateToProps: MapStateToPropsParam, mapDispatchToProps: MapDispatchToPropsParam - ): InferableComponentEnhancerWithProps; + ): InferableComponentEnhancerWithProps; ( mapStateToProps: MapStateToPropsParam, diff --git a/types/react-redux/react-redux-tests.tsx b/types/react-redux/react-redux-tests.tsx index 393c4d09da..07b81ff082 100644 --- a/types/react-redux/react-redux-tests.tsx +++ b/types/react-redux/react-redux-tests.tsx @@ -899,3 +899,25 @@ namespace TestCreateProvider { //

    A is 2

    ReactDOM.render(, document.body); } + +namespace TestTypeInference { + interface State { a: number }; + + const OnlyState = connect( + (state: {a: number}, props: {b: number}) => ({a: state.a, c: state.a + props.b}) + )(props => {props.a} + {props.b} = {props.c}) + interface State { a: number }; + ReactDOM.render(, document.body); + + const OnlyDispatch = connect( + undefined, + (dispatch, props: {b: number}) => ({action: () => dispatch({type: 'action', b: props.b})}) + )(props => {props.b}) + ReactDOM.render(, document.body); + + const StateAndDispatch = connect( + (state: {a: number}, props: {b: number}) => ({a: state.a, c: state.a + props.b}), + (dispatch, props: {b: number}) => ({action: () => dispatch({type: 'action', b: props.b})}) + )(props => {props.a} + {props.b} = {props.c}) + ReactDOM.render(, document.body); +} From 951c4f05dc8d1ab6db29896a8500f12be1f54a9e Mon Sep 17 00:00:00 2001 From: Matt Traynham Date: Mon, 9 Apr 2018 19:24:54 -0400 Subject: [PATCH 0561/2153] Update supports color to 5.3 (#24745) * Update supports color to 5.3 * Correct lint issue with supports-color v3 * Remove extra `export` --- types/supports-color/index.d.ts | 23 +++--- types/supports-color/supports-color-tests.ts | 34 +++++--- types/supports-color/tslint.json | 78 +------------------ types/supports-color/v3/index.d.ts | 15 ++++ .../supports-color/v3/supports-color-tests.ts | 17 ++++ types/supports-color/v3/tsconfig.json | 26 +++++++ types/supports-color/v3/tslint.json | 3 + 7 files changed, 100 insertions(+), 96 deletions(-) create mode 100644 types/supports-color/v3/index.d.ts create mode 100644 types/supports-color/v3/supports-color-tests.ts create mode 100644 types/supports-color/v3/tsconfig.json create mode 100644 types/supports-color/v3/tslint.json diff --git a/types/supports-color/index.d.ts b/types/supports-color/index.d.ts index 34df865d4b..11fbde86ae 100644 --- a/types/supports-color/index.d.ts +++ b/types/supports-color/index.d.ts @@ -1,15 +1,18 @@ -// Type definitions for supports-color 3.1.2 +// Type definitions for supports-color 5.3 // Project: https://github.com/chalk/supports-color -// Definitions by: Melvin Groenhoff +// Definitions by: Melvin Groenhoff , Matt Traynham // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare interface SupportsColor { - level: number; - hasBasic: boolean; - has256: boolean; - has16m: boolean; +export namespace supportsColor { + interface Level { + level: number; + hasBasic: boolean; + has256: boolean; + has16m: boolean; + } + + type SupportsColor = boolean & Level; } -declare const supportsColor: boolean & SupportsColor; - -export = supportsColor; +export const stdout: supportsColor.SupportsColor; +export const stderr: supportsColor.SupportsColor; diff --git a/types/supports-color/supports-color-tests.ts b/types/supports-color/supports-color-tests.ts index 2e8d887c58..8d226ff78b 100644 --- a/types/supports-color/supports-color-tests.ts +++ b/types/supports-color/supports-color-tests.ts @@ -1,17 +1,33 @@ -import supportsColor = require("supports-color"); +import { stdout, stderr } from "supports-color"; -if (supportsColor) { - // Terminal supports color +if (stdout) { + // Terminal standard output supports color } -if (supportsColor.hasBasic) { - // Terminal supports color +if (stdout.hasBasic) { + // Terminal standard output supports color } -if (supportsColor.has256) { - // Terminal supports 256 colors +if (stdout.has256) { + // Terminal standard output supports 256 colors } -if (supportsColor.has16m) { - // Terminal supports 16 million colors (truecolor) +if (stdout.has16m) { + // Terminal standard output supports 16 million colors (truecolor) +} + +if (stderr) { + // Terminal standard error supports color +} + +if (stderr.hasBasic) { + // Terminal standard error supports color +} + +if (stderr.has256) { + // Terminal standard error supports 256 colors +} + +if (stderr.has16m) { + // Terminal standard error supports 16 million colors (truecolor) } diff --git a/types/supports-color/tslint.json b/types/supports-color/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/supports-color/tslint.json +++ b/types/supports-color/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/supports-color/v3/index.d.ts b/types/supports-color/v3/index.d.ts new file mode 100644 index 0000000000..ead9dee193 --- /dev/null +++ b/types/supports-color/v3/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for supports-color 3.1 +// Project: https://github.com/chalk/supports-color +// Definitions by: Melvin Groenhoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface SupportsColor { + level: number; + hasBasic: boolean; + has256: boolean; + has16m: boolean; +} + +declare const supportsColor: boolean & SupportsColor; + +export = supportsColor; diff --git a/types/supports-color/v3/supports-color-tests.ts b/types/supports-color/v3/supports-color-tests.ts new file mode 100644 index 0000000000..2e8d887c58 --- /dev/null +++ b/types/supports-color/v3/supports-color-tests.ts @@ -0,0 +1,17 @@ +import supportsColor = require("supports-color"); + +if (supportsColor) { + // Terminal supports color +} + +if (supportsColor.hasBasic) { + // Terminal supports color +} + +if (supportsColor.has256) { + // Terminal supports 256 colors +} + +if (supportsColor.has16m) { + // Terminal supports 16 million colors (truecolor) +} diff --git a/types/supports-color/v3/tsconfig.json b/types/supports-color/v3/tsconfig.json new file mode 100644 index 0000000000..c1dd8f8f2a --- /dev/null +++ b/types/supports-color/v3/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "supports-color": ["supports-color/v3"] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "supports-color-tests.ts" + ] +} \ No newline at end of file diff --git a/types/supports-color/v3/tslint.json b/types/supports-color/v3/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/supports-color/v3/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 21e5370ae94da375550f414d386d16387cdbcfc1 Mon Sep 17 00:00:00 2001 From: Andy Patterson Date: Mon, 9 Apr 2018 19:31:31 -0400 Subject: [PATCH 0562/2153] [@types/mathjs] enable linting (#24725) * [@types/mathjs] enable linting * [@types/mathjs] add username to definitions * [@types/mathjs] remove redundant jsdoc annotations and export statements --- types/mathjs/index.d.ts | 1000 ++++++++++++++++------------------ types/mathjs/mathjs-tests.ts | 311 +++++------ types/mathjs/tslint.json | 75 +-- 3 files changed, 594 insertions(+), 792 deletions(-) diff --git a/types/mathjs/index.d.ts b/types/mathjs/index.d.ts index 0341d80c6b..a02729b635 100644 --- a/types/mathjs/index.d.ts +++ b/types/mathjs/index.d.ts @@ -1,22 +1,22 @@ -// Type definitions for mathjs +// Type definitions for mathjs 3.20 // Project: http://mathjs.org/ -// Definitions by: Ilya Shestakov +// Definitions by: Ilya Shestakov , +// Andy Patterson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { Decimal } from 'decimal.js'; -declare var math: mathjs.IMathJsStatic; -export as namespace math; -export = math; - -declare namespace mathjs { +declare const math: math.MathJsStatic; // tslint:disable-line strict-export-declare-modifiers +export as namespace math; // tslint:disable-line strict-export-declare-modifiers +export = math; // tslint:disable-line strict-export-declare-modifiers +declare namespace math { // tslint:disable-line strict-export-declare-modifiers type MathArray = number[]|number[][]; type MathType = number|BigNumber|Fraction|Complex|Unit|MathArray|Matrix; type MathExpression = string|string[]|MathArray|Matrix; - export interface IMathJsStatic { - + interface MathJsStatic { e: number; pi: number; i: number; @@ -35,9 +35,9 @@ declare namespace mathjs { uninitialized: any; version: string; - config(options: any): void; + expression: MathNode; - expression: MathNode; + config: (options: any) => void; /** * Solves the linear equation system by forwards substitution. Matrix must be a lower triangular matrix. @@ -48,7 +48,7 @@ declare namespace mathjs { lsolve(L: Matrix|MathArray, b: Matrix|MathArray): Matrix|MathArray; /** - * Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in two matrices (L, U) + * Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in two matrices (L, U) * and a row permutation vector p where A[p,:] = L * U * @param A A two dimensional matrix or array for which to get the LUP decomposition. * @returns The lower triangular matrix, the upper triangular matrix and the permutation matrix. @@ -61,22 +61,22 @@ declare namespace mathjs { * @param b Column Vector * @returns Column vector with the solution to the linear system A * x = b */ - lusolve(A: Matrix|MathArray|Number, b: Matrix|MathArray): Matrix|MathArray; + lusolve(A: Matrix|MathArray|number, b: Matrix|MathArray): Matrix|MathArray; /** - * Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix A is decomposed in + * Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix A is decomposed in * two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U * @param A A two dimensional sparse matrix for which to get the LU decomposition. - * @param order The Symbolic Ordering and Analysis order: 0 - Natural ordering, no permutation vector q is - * returned 1 - Matrix must be square, symbolic ordering and analisis is performed on M = A + A' 2 - Symbolic - * ordering and analisis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'. - * This is appropriatefor LU factorization of unsymmetric matrices. 3 - Symbolic ordering and analisis is performed - * on M = A' * A. This is best used for LU factorization is matrix M has no dense rows. A dense row is a row with + * @param order The Symbolic Ordering and Analysis order: 0 - Natural ordering, no permutation vector q is + * returned 1 - Matrix must be square, symbolic ordering and analisis is performed on M = A + A' 2 - Symbolic + * ordering and analysis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'. + * This is appropriate for LU factorization of non-symmetric matrices. 3 - Symbolic ordering and analysis is performed + * on M = A' * A. This is best used for LU factorization is matrix M has no dense rows. A dense row is a row with * more than 10*sqr(columns) entries. * @param threshold Partial pivoting threshold (1 for partial pivoting) * @returns The lower triangular matrix, the upper triangular matrix and the permutation vectors. */ - slu(A: Matrix, order: Number, threshold: Number): any; + slu(A: Matrix, order: number, threshold: number): any; /** * Solves the linear equation system by backward substitution. Matrix must be an upper triangular matrix. U * x = b @@ -84,7 +84,7 @@ declare namespace mathjs { * @param b A column vector with the b values * @returns A column vector with the linear system solution (x) */ - usolve(U: Matrix|MathArray, b:Matrix|MathArray): Matrix|MathArray; + usolve(U: Matrix|MathArray, b: Matrix|MathArray): Matrix|MathArray; /** * Calculate the absolute value of a number. For matrices, the function is evaluated element wise. @@ -134,7 +134,7 @@ declare namespace mathjs { ceil(x: Matrix): Matrix; ceil(x: Unit): Unit; - /** + /** * Compute the cube of a value, x * x * x. For matrices, the function is evaluated element wise. * @param x Number for which to calculate the cube * @returns Cube of x @@ -155,7 +155,7 @@ declare namespace mathjs { */ divide(x: Unit, y: Unit): Unit; divide(x: number, y: number): number; - divide(x:MathType, y:MathType): MathType; + divide(x: MathType, y: MathType): MathType; /** * Divide two matrices element wise. The function accepts both matrices and scalar values. @@ -173,7 +173,7 @@ declare namespace mathjs { */ dotMultiply(x: MathType, y: MathType): MathType; - /** + /** * Calculates the power of x to y element wise. * @param x The base * @param y The exponent @@ -187,21 +187,21 @@ declare namespace mathjs { * #returns Exponent of x */ exp(x: number): number; - exp(x: BigNumber ): BigNumber ; - exp(x: Complex ): Complex ; - exp(x: MathArray ): MathArray ; + exp(x: BigNumber): BigNumber ; + exp(x: Complex): Complex ; + exp(x: MathArray): MathArray ; exp(x: Matrix): Matrix; - /** + /** * Round a value towards zero. For matrices, the function is evaluated element wise. * @param x Number to be rounded * @returns Rounded value */ fix(x: number): number; - fix(x: BigNumber ): BigNumber ; - fix(x: Fraction ): Fraction ; - fix(x: Complex ): Complex ; - fix(x: MathArray ): MathArray ; + fix(x: BigNumber): BigNumber ; + fix(x: Fraction): Fraction ; + fix(x: Complex): Complex ; + fix(x: MathArray): MathArray ; fix(x: Matrix): Matrix; /** @@ -210,10 +210,10 @@ declare namespace mathjs { * @returns Rounded value */ floor(x: number): number; - floor(x: BigNumber ): BigNumber ; - floor(x: Fraction ): Fraction ; - floor(x: Complex ): Complex ; - floor(x: MathArray ): MathArray ; + floor(x: BigNumber): BigNumber ; + floor(x: Fraction): Fraction ; + floor(x: Complex): Complex ; + floor(x: MathArray): MathArray ; floor(x: Matrix): Matrix; /** @@ -246,7 +246,7 @@ declare namespace mathjs { * For matrices, the function is evaluated element wise. */ lcm(a: number, b: number): number; - lcm(a: BigNumber , b: BigNumber ): BigNumber ; + lcm(a: BigNumber , b: BigNumber): BigNumber ; lcm(a: MathArray, b: MathArray): MathArray; lcm(a: Matrix, b: Matrix): Matrix; @@ -271,7 +271,7 @@ declare namespace mathjs { * Calculates the modulus, the remainder of an integer division. For matrices, the function is evaluated element wise. * The modulus is defined as: * x - y * floor(x / y) - * See http://en.wikipedia.org/wiki/Modulo_operation. + * @see http://en.wikipedia.org/wiki/Modulo_operation. * @param x Dividend * @param y Divisor */ @@ -280,7 +280,6 @@ declare namespace mathjs { /** * Multiply two values, x * y. The result is squeezed. For matrices, the matrix product is calculated. */ - multiply(x: MathArray|Matrix, y: MathArray|Matrix): Matrix; multiply(x: MathArray|Matrix, y: MathType): Matrix; multiply(x: Unit, y: Unit): Unit; multiply(x: number, y: number): number; @@ -325,9 +324,9 @@ declare namespace mathjs { * For matrices, the function is evaluated element wise. */ sign(x: number): number; - sign(x: BigNumber ): BigNumber; - sign(x: Fraction ): Fraction ; - sign(x: Complex ): Complex ; + sign(x: BigNumber): BigNumber; + sign(x: Fraction): Fraction ; + sign(x: Complex): Complex ; sign(x: MathArray): MathArray; sign(x: Matrix): Matrix; sign(x: Unit): Unit; @@ -336,8 +335,8 @@ declare namespace mathjs { * Calculate the square root of a value. For matrices, the function is evaluated element wise. */ sqrt(x: number): number; - sqrt(x: BigNumber ): BigNumber; - sqrt(x: Complex ): Complex ; + sqrt(x: BigNumber): BigNumber; + sqrt(x: Complex): Complex ; sqrt(x: MathArray): MathArray; sqrt(x: Matrix): Matrix; sqrt(x: Unit): Unit; @@ -346,9 +345,9 @@ declare namespace mathjs { * Compute the square of a value, x * x. For matrices, the function is evaluated element wise. */ square(x: number): number; - square(x: BigNumber ): BigNumber; - square(x: Fraction ): Fraction ; - square(x: Complex ): Complex ; + square(x: BigNumber): BigNumber; + square(x: Fraction): Fraction ; + square(x: Complex): Complex ; square(x: MathArray): MathArray; square(x: Matrix): Matrix; square(x: Unit): Unit; @@ -363,9 +362,9 @@ declare namespace mathjs { * For matrices, the function is evaluated element wise. Boolean values and strings will be converted to a number. For complex numbers, both real and complex value are inverted. */ unaryMinus(x: number): number; - unaryMinus(x: BigNumber ): BigNumber; - unaryMinus(x: Fraction ): Fraction ; - unaryMinus(x: Complex ): Complex ; + unaryMinus(x: BigNumber): BigNumber; + unaryMinus(x: Fraction): Fraction ; + unaryMinus(x: Complex): Complex ; unaryMinus(x: MathArray): MathArray; unaryMinus(x: Matrix): Matrix; unaryMinus(x: Unit): Unit; @@ -375,10 +374,10 @@ declare namespace mathjs { * For matrices, the function is evaluated element wise. */ unaryPlus(x: number): number; - unaryPlus(x: BigNumber ): BigNumber; - unaryPlus(x: Fraction ): Fraction ; + unaryPlus(x: BigNumber): BigNumber; + unaryPlus(x: Fraction): Fraction ; unaryPlus(x: string): string; - unaryPlus(x: Complex ): Complex ; + unaryPlus(x: Complex): Complex ; unaryPlus(x: MathArray): MathArray; unaryPlus(x: Matrix): Matrix; unaryPlus(x: Unit): Unit; @@ -397,7 +396,7 @@ declare namespace mathjs { * Bitwise NOT value, ~x. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. */ bitNot(x: number): number; - bitNot(x: BigNumber ): BigNumber ; + bitNot(x: BigNumber): BigNumber ; bitNot(x: MathArray): MathArray; bitNot(x: Matrix): Matrix; @@ -405,7 +404,7 @@ declare namespace mathjs { * Bitwise OR two values, x | y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the lowest print base. */ bitOr(x: number): number; - bitOr(x: BigNumber ): BigNumber ; + bitOr(x: BigNumber): BigNumber ; bitOr(x: MathArray): MathArray; bitOr(x: Matrix): Matrix; @@ -436,17 +435,19 @@ declare namespace mathjs { rightLogShift(x: number|MathArray|Matrix, y: number): number|MathArray|Matrix; /** - * The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. bellNumbers only takes integer arguments. The following condition must be enforced: n >= 0 + * The Bell Numbers count the number of partitions of a set. + * A partition is a pairwise disjoint subset of S whose union is S. bellNumbers only takes integer arguments. + * The following condition must be enforced: n >= 0 * @param n Total number of objects in the set */ - bellNumbers(n: Number): Number; + bellNumbers(n: number): number; bellNumbers(n: BigNumber): BigNumber; /** * The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0 - * @pararm n nth Catalan number + * @param n nth Catalan number */ - catalan(n: Number): Number; + catalan(n: number): number; catalan(n: BigNumber): BigNumber; /** @@ -455,22 +456,22 @@ declare namespace mathjs { * @param k Number of objects in the subset * @returns Returns the composition counts of n into k parts. */ - composition(n: Number|BigNumber, k: Number|BigNumber): Number|BigNumber + composition(n: number|BigNumber, k: number|BigNumber): number|BigNumber; /** - * The Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. stirlingS2 only takes integer arguments. The following condition must be enforced: k <= n. + * The Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. + * stirlingS2 only takes integer arguments. The following condition must be enforced: k <= n. * If n = k or k = 1, then s(n,k) = 1 * @param n Total number of objects in the set * @param k Number of objects in the subset */ - stirlingS2(n: Number|BigNumber, k: Number|BigNumber): Number|BigNumber; + stirlingS2(n: number|BigNumber, k: number|BigNumber): number|BigNumber; /** * Compute the argument of a complex value. For a complex number a + bi, the argument is computed as atan2(b, a). For matrices, the function is evaluated element wise. * @param x A complex number or array with complex numbers */ - arg(x: number): number; - arg(x: Complex): number; + arg(x: number|Complex): number; arg(x: MathArray): MathArray; arg(x: Matrix): Matrix; @@ -480,8 +481,8 @@ declare namespace mathjs { */ conj(x: number|BigNumber|Complex|MathArray|Matrix): number|BigNumber|Complex|MathArray|Matrix; - /** - * Get the imaginary part of a complex number. For a complex number a + bi, the function returns b. + /** + * Get the imaginary part of a complex number. For a complex number a + bi, the function returns b. * For matrices, the function is evaluated element wise. */ im(x: number|BigNumber|Complex|MathArray|Matrix): number|BigNumber|MathArray|Matrix; @@ -498,29 +499,28 @@ declare namespace mathjs { bignumber(x?: number|string|MathArray|Matrix|boolean): BigNumber; /** - * Create a boolean or convert a string or number to a boolean. In case of a number, true is returned for non-zero numbers, and false in case of zero. Strings can be 'true' or 'false', or can contain a number. When value is a matrix, all elements will be converted to boolean. + * Create a boolean or convert a string or number to a boolean. + * In case of a number, true is returned for non-zero numbers, and false in case of zero. + * Strings can be 'true' or 'false', or can contain a number. When value is a matrix, all elements will be converted to boolean. */ - boolean(x: string|number|boolean|MathArray|Matrix ): boolean|MathArray|Matrix; + boolean(x: string|number|boolean|MathArray|Matrix): boolean|MathArray|Matrix; /** * Wrap any value in a chain, allowing to perform chained operations on the value. - * All methods available in the math.js library can be called upon the chain, and then will be evaluated with the value itself as first argument. The chain can be closed by executing chain.done(), which returns the final value. + * All methods available in the math.js library can be called upon the chain, and then will be evaluated with the value itself as first argument. + * The chain can be closed by executing chain.done(), which returns the final value. * The chain has a number of special functions: * done() Finalize the chain and return the chain's value. * valueOf() The same as done() * toString() Executes math.format() onto the chain's value, returning a string representation of the value. */ - chain(value?: any): IMathJsChain; + chain(value?: any): MathJsChain; /** * Create a complex value or convert a value to a complex value. */ - complex(): Complex; + complex(arg?: Complex|string|MathArray| PolarCoordinates): Complex; complex(re: number, im: number): Complex; - complex(complex: Complex): Complex; - complex(arg: string): Complex; - complex(array: MathArray): Complex; - complex(obj: IPolarCoordinates): Complex; /** * Create a fraction convert a value to a fraction. @@ -533,8 +533,8 @@ declare namespace mathjs { index(...ranges: any[]): Index; /** - * Create a Matrix. The function creates a new math.type.Matrix object from an Array. A Matrix has utility functions - * to manipulate the data in the matrix, like getting the size and getting or setting values in the matrix. Supported + * Create a Matrix. The function creates a new math.type.Matrix object from an Array. A Matrix has utility functions + * to manipulate the data in the matrix, like getting the size and getting or setting values in the matrix. Supported * storage formats are 'dense' and 'sparse'. */ matrix(format?: 'sparse'|'dense'): Matrix; @@ -547,11 +547,11 @@ declare namespace mathjs { number(unit: Unit, valuelessUnit: Unit|string): number|MathArray|Matrix; /** - * Create a Sparse Matrix. The function creates a new math.type.Matrix object from an Array. A Matrix has utility + * Create a Sparse Matrix. The function creates a new math.type.Matrix object from an Array. A Matrix has utility * functions to manipulate the data in the matrix, like getting the size and getting or setting values in the matrix. * @param data A two dimensional array */ - sparse(data?: MathArray|Matrix, dataType?:string): Matrix; + sparse(data?: MathArray|Matrix, dataType?: string): Matrix; /** * Create a string or convert any object into a string. Elements of Arrays and Matrices are processed element wise. @@ -560,18 +560,17 @@ declare namespace mathjs { string(value: any): string|MathArray|Matrix; /** - * Create a unit. Depending on the passed arguments, the function will create and return a new math.type.Unit object. + * Create a unit. Depending on the passed arguments, the function will create and return a new math.type.Unit object. * When a matrix is provided, all elements will be converted to units. */ unit(unit: string): Unit; unit(value: number, unit: string): Unit; /** - * Create a user-defined unit and register it with the Unit type. + * Create a user-defined unit and register it with the Unit type. */ - createUnit(name: string): Unit; - createUnit(name: string, definition: string|UnitDefinition, options?: CreateUnitOptions): Unit; - createUnit(units: {[name: string]: string|UnitDefinition}, options?: CreateUnitOptions): Unit; + createUnit(name: string, definition?: string|UnitDefinition, options?: CreateUnitOptions): Unit; + createUnit(units: Record, options?: CreateUnitOptions): Unit; /** * Parse and compile an expression. Returns a an object with a function eval([scope]) to evaluate the compiled expression. @@ -582,8 +581,7 @@ declare namespace mathjs { /** * Evaluate an expression. */ - eval(expr: MathExpression, scope?: any): any; - eval(exprs: MathExpression[], scope?: any): any; + eval(expr: MathExpression|MathExpression[], scope?: any): any; /** * Retrieve help on a function or data type. Help files are retrieved from the documentation in math.expression.docs. @@ -602,21 +600,21 @@ declare namespace mathjs { parser(): Parser; /** - * Calculates: The eucledian distance between two points in 2 and 3 dimensional spaces. Distance between point - * and a line in 2 and 3 dimensional spaces. Pairwise distance between a set of 2D or 3D points NOTE: When - * substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c For parametric + * Calculates: The eucledian distance between two points in 2 and 3 dimensional spaces. Distance between point + * and a line in 2 and 3 dimensional spaces. Pairwise distance between a set of 2D or 3D points NOTE: When + * substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c For parametric * equation of a 3D line, x0, y0, z0, a, b, c are from: (x−x0, y−y0, z−z0) = t(a, b, c) */ - distance(x: MathArray|Matrix|any, y: MathArray|Matrix|any): Number | BigNumber; + distance(x: MathType, y: MathType): number | BigNumber; /** - * Calculates the point of intersection of two lines in two or three dimensions and of a line and a plane in - * three dimensions. The inputs are in the form of arrays or 1 dimensional matrices. The line intersection functions + * Calculates the point of intersection of two lines in two or three dimensions and of a line and a plane in + * three dimensions. The inputs are in the form of arrays or 1 dimensional matrices. The line intersection functions * return null if the lines do not meet. * Note: Fill the plane coefficients as x + y + z = c and not as x + y + z + c = 0. * @param w Co-ordinates of first end-point of first line * @param x Co-ordinates of second end-point of first line - * @param y Co-ordinates of first end-point of second line OR Co-efficients of the plane's equation + * @param y Co-ordinates of first end-point of second line OR Coefficients of the plane's equation * @param z Co-ordinates of second end-point of second line OR null if the calculation is for line and plane * @returns Returns the point of intersection of lines/lines-planes */ @@ -646,10 +644,10 @@ declare namespace mathjs { * Concatenate two or more matrices. * dim: number is a zero-based dimension over which to concatenate the matrices. By default the last dimension of the matrices. */ - concat(...args: (MathArray|Matrix|number)[]): MathArray|Matrix; + concat(...args: Array): MathArray|Matrix; /** - * Calculate the cross product for two vectors in three dimensional space. The cross product of A = [a1, a2, a3] + * Calculate the cross product for two vectors in three dimensional space. The cross product of A = [a1, a2, a3] * and B =[b1, b2, b3] is defined as: * cross(A, B) = [ a2 * b3 - a3 * b2, a3 * b1 - a1 * b3, a1 * b2 - a2 * b1 ] */ @@ -662,9 +660,9 @@ declare namespace mathjs { /** * Create a diagonal matrix or retrieve the diagonal of a matrix. - * When x is a vector, a matrix with vector x on the diagonal will be returned. When x is a two dimensional matrix, + * When x is a vector, a matrix with vector x on the diagonal will be returned. When x is a two dimensional matrix, * the matrixes kth diagonal will be returned - * as vector. When k is positive, the values are placed on the super diagonal. When k is negative, the values are + * as vector. When k is positive, the values are placed on the super diagonal. When k is negative, the values are * placed on the sub diagonal. * @param X A two dimensional matrix or a vector * @param k The diagonal where the vector will be filled in or retrieved. Default value: 0. @@ -674,7 +672,8 @@ declare namespace mathjs { diag(X: MathArray|Matrix, k: number|BigNumber, format?: string): Matrix; /** - * Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] + * Calculate the dot product of two vectors. + * The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] * is defined as: * dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn */ @@ -683,14 +682,13 @@ declare namespace mathjs { /** * Create a 2-dimensional identity matrix with size m x n or n x n. The matrix has ones on the diagonal and zeros elsewhere. */ - eye(n: number, format?: string): Matrix; + eye(n: number|number[], format?: string): Matrix; eye(m: number, n: number, format?: string): Matrix; - eye(size: number[], format?: string): Matrix; /** * Flatten a multi dimensional matrix into a single dimensional matrix. */ - flatten(x: MathArray|Matrix): MathArray|Matrix; + flatten(x: MathArray|Matrix): MathArray|Matrix; /** * Calculate the inverse of a square matrix. @@ -700,9 +698,8 @@ declare namespace mathjs { /** * Create a matrix filled with ones. The created matrix can have one or multiple dimensions. */ - ones(n: number, format?: string): MathArray|Matrix; + ones(n: number|number[], format?: string): MathArray|Matrix; ones(m: number, n: number, format?: string): MathArray|Matrix; - ones(size: number[], format?: string): MathArray|Matrix; /** * Create an array from a range. By default, the range end is excluded. This can be customized by providing an extra parameter includeEnd. @@ -713,8 +710,8 @@ declare namespace mathjs { * @returns Parameters describing the ranges start, end, and optional step. */ range(str: string, includeEnd?: boolean): Matrix; - range(start: number|BigNumber, end:number|BigNumber, includeEnd?:boolean): Matrix; - range(start: number|BigNumber, end: number|BigNumber, step: number|BigNumber, includeEnd?:boolean): Matrix; + range(start: number|BigNumber, end: number|BigNumber, includeEnd?: boolean): Matrix; + range(start: number|BigNumber, end: number|BigNumber, step: number|BigNumber, includeEnd?: boolean): Matrix; /** * Resize a matrix @@ -756,12 +753,11 @@ declare namespace mathjs { /** * Create a matrix filled with zeros. The created matrix can have one or multiple dimensions. */ - zeros(n: number, format?: string): MathArray|Matrix; + zeros(n: number|number[], format?: string): MathArray|Matrix; zeros(m: number, n: number, format?: string): MathArray|Matrix; - zeros(size: number[], format?: string): MathArray|Matrix; /** - * Compute the number of ways of picking k unordered outcomes from n possibilities. + * Compute the number of ways of picking k unordered outcomes from n possibilities. * Combinations only takes integer arguments. The following condition must be enforced: k <= n. */ combinations(n: number|BigNumber, k: number|BigNumber): number|BigNumber; @@ -779,7 +775,7 @@ declare namespace mathjs { factorial(n: number|BigNumber|MathArray|Matrix): number|BigNumber|MathArray|Matrix; /** - * Compute the gamma function of a value using Lanczos approximation for small values, and an extended + * Compute the gamma function of a value using Lanczos approximation for small values, and an extended * Stirling approximation for large values. * For matrices, the function is evaluated element wise. */ @@ -802,7 +798,7 @@ declare namespace mathjs { * @param n The number of objects in total * @param k The number of objects in the subset */ - permutations(n: number|BigNumber, k?:number|BigNumber): number|BigNumber; + permutations(n: number|BigNumber, k?: number|BigNumber): number|BigNumber; /** * Random pick a value from a one dimensional array. Array element is picked using a random function with uniform distribution. @@ -812,23 +808,18 @@ declare namespace mathjs { /** * Return a random number larger or equal to min and smaller than max using a uniform distribution. */ - random(): number; - random(max: number): number; - random(min: number, max: number): number; - random(size: MathArray|Matrix, max?: number): MathArray|Matrix; - random(size: MathArray|Matrix, min:number, max: number): MathArray|Matrix; + random(min?: number, max?: number): number; + random(size: MathArray|Matrix, min?: number, max?: number): MathArray|Matrix; /** * Return a random integer number larger or equal to min and smaller than max using a uniform distribution. */ - randomInt(max: number): number; - randomInt(min: number, max: number): number; - randomInt(size: MathArray|Matrix, max?: number): MathArray|Matrix; - randomInt(size: MathArray|Matrix, min:number, max: number): MathArray|Matrix; + randomInt(min: number, max?: number): number; + randomInt(size: MathArray|Matrix, min?: number, max?: number): MathArray|Matrix; /** * Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y. - * x and y are considered equal when the relative difference between x and y is smaller than the configured epsilon. + * x and y are considered equal when the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. * For matrices, the function is evaluated element wise. */ @@ -841,91 +832,78 @@ declare namespace mathjs { /** * Test whether two values are equal. - * - * The function tests whether the relative difference between x and y is smaller than the configured epsilon. + * + * The function tests whether the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * * For matrices, the function is evaluated element wise. In case of complex numbers, x.re must equal y.re, and x.im must equal y.im. - * * Values null and undefined are compared strictly, thus null is only equal to null and nothing else, and undefined is only equal to undefined and nothing else. */ equal(x: MathType, y: MathType): boolean|MathArray|Matrix; /** * Test whether value x is larger than y. - * - * The function returns true when x is larger than y and the relative difference between x and y is larger than the configured epsilon. + * The function returns true when x is larger than y and the relative difference between x and y is larger than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * * For matrices, the function is evaluated element wise. */ larger(x: MathType, y: MathType): boolean|MathArray|Matrix; /** * Test whether value x is larger or equal to y. - * - * The function returns true when x is larger than y or the relative difference between x and y is smaller than the configured epsilon. + * The function returns true when x is larger than y or the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * * For matrices, the function is evaluated element wise. */ largerEq(x: MathType, y: MathType): boolean|MathArray|Matrix; /** * Test whether value x is smaller than y. - * - * The function returns true when x is smaller than y and the relative difference between x and y is smaller than the configured epsilon. + * The function returns true when x is smaller than y and the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * * For matrices, the function is evaluated element wise. */ smaller(x: MathType, y: MathType): boolean|MathArray|Matrix; /** * Test whether value x is smaller or equal to y. - * - * The function returns true when x is smaller than y or the relative difference between x and y is smaller than the configured epsilon. + * The function returns true when x is smaller than y or the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. For matrices, the function is evaluated element wise. */ smallerEq(x: MathType, y: MathType): boolean|MathArray|Matrix; /** * Test whether two values are unequal. - * - * The function tests whether the relative difference between x and y is larger than the configured epsilon. The function cannot + * The function tests whether the relative difference between x and y is larger than the configured epsilon. The function cannot * be used to compare values smaller than approximately 2.22e-16. - * * For matrices, the function is evaluated element wise. In case of complex numbers, x.re must unequal y.re, or x.im must unequal y.im. - * - * Values null and undefined are compared strictly, thus null is unequal with everything except null, and undefined is unequal with - * everying except. undefined. + * Values null and undefined are compared strictly, thus null is unequal with everything except null, and undefined is unequal with + * everything except undefined. */ unequal(x: MathType, y: MathType): boolean|MathArray|Matrix; /** - * Compute the maximum value of a matrix or a list with values. In case of a multi dimensional array, the maximum of the flattened + * Compute the maximum value of a matrix or a list with values. In case of a multi dimensional array, the maximum of the flattened * array will be calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. */ max(...args: MathType[]): any; max(A: MathArray|Matrix, dim?: number): any; /** - * Compute the mean value of matrix or a list with values. In case of a multi dimensional array, the mean of the flattened array will be + * Compute the mean value of matrix or a list with values. In case of a multi dimensional array, the mean of the flattened array will be * calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. */ mean(...args: MathType[]): any; mean(A: MathArray|Matrix, dim?: number): any; /** - * Compute the median of a matrix or a list with values. The values are sorted and the middle value is returned. In case of an + * Compute the median of a matrix or a list with values. The values are sorted and the middle value is returned. In case of an * even number of values, the average of the two middle values is returned. Supported types of values are: Number, BigNumber, Unit - * * In case of a (multi dimensional) array or matrix, the median of all elements will be calculated. */ median(...args: MathType[]): any; /** - * Compute the maximum value of a matrix or a list of values. In case of a multi dimensional array, the maximum of the flattened + * Compute the maximum value of a matrix or a list of values. In case of a multi dimensional array, the maximum of the flattened * array will be calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. */ min(...args: MathType[]): any; @@ -942,21 +920,18 @@ declare namespace mathjs { prod(...args: MathType[]): any; /** - * Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. + * Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. * Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber - * * In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated. */ - quantileSeq(A: MathArray|Matrix, prob: Number|BigNumber|MathArray, sorted?: boolean): Number|BigNumber|Unit|MathArray; + quantileSeq(A: MathArray|Matrix, prob: number|BigNumber|MathArray, sorted?: boolean): number|BigNumber|Unit|MathArray; /** - * Compute the standard deviation of a matrix or a list with values. The standard deviations is defined as the square root of the - * variance: std(A) = sqrt(var(A)). In case of a (multi dimensional) array or matrix, the standard deviation over all elements will + * Compute the standard deviation of a matrix or a list with values. The standard deviations is defined as the square root of the + * variance: std(A) = sqrt(var(A)). In case of a (multi dimensional) array or matrix, the standard deviation over all elements will * be calculated. - * - * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the following + * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the following * values: - * * 'unbiased' (default) The sum of squared errors is divided by (n - 1) * 'uncorrected' The sum of squared errors is divided by n * 'biased' The sum of squared errors is divided by (n + 1) @@ -966,23 +941,21 @@ declare namespace mathjs { /** * Compute the sum of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the sum of all elements will be calculated. */ - sum(...args: (Number|BigNumber|Fraction)[]): any; + sum(...args: Array): any; sum(array: MathArray|Matrix): any; /** - * Compute the variance of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the variance over all + * Compute the variance of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the variance over all * elements will be calculated. - * - * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the + * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the * following values: - * * 'unbiased' (default) The sum of squared errors is divided by (n - 1) * 'uncorrected' The sum of squared errors is divided by n * 'biased' The sum of squared errors is divided by (n + 1) - * Note that older browser may not like the variable name var. In that case, the function can be called as math['var'](...) + * Note that older browser may not like the variable name var. In that case, the function can be called as math['var'](...) * instead of math.var(...). */ - var(...args: (Number|BigNumber|Fraction)[]): any; + var(...args: Array): any; var(array: MathArray|Matrix, normalization?: string): any; /** @@ -1080,9 +1053,8 @@ declare namespace mathjs { atan(x: Matrix): Matrix; /** - * Calculate the inverse tangent function with two arguments, y/x. By providing two arguments, the right quadrant of the + * Calculate the inverse tangent function with two arguments, y/x. By providing two arguments, the right quadrant of the * computed angle can be determined. - * * For matrices, the function is evaluated element wise. */ atan2(y: number, x: number): number; @@ -1097,127 +1069,105 @@ declare namespace mathjs { atanh(x: MathArray): MathArray; atanh(x: Matrix): Matrix; - /** - * Calculate the cosine of a value. For matrices, the function is evaluated element wise. - */ - asin(x: number): number; - asin(x: BigNumber): BigNumber; - asin(x: Complex): Complex; - asin(x: Unit): number; - asin(x: MathArray): MathArray; - asin(x: Matrix): Matrix; - /** * Calculate the hyperbolic cosine of a value, defined as cosh(x) = 1/2 * (exp(x) + exp(-x)). For matrices, the function is evaluated element wise. */ - cosh(x: number): number; + cosh(x: number|Unit): number; cosh(x: BigNumber): BigNumber; cosh(x: Complex): Complex; - cosh(x: Unit): number; cosh(x: MathArray): MathArray; cosh(x: Matrix): Matrix; /** * Calculate the cotangent of a value. cot(x) is defined as 1 / tan(x). For matrices, the function is evaluated element wise. */ - cot(x: number): number; + cot(x: number|Unit): number; cot(x: Complex): Complex; - cot(x: Unit): number; cot(x: MathArray): MathArray; cot(x: Matrix): Matrix; /** * Calculate the hyperbolic cotangent of a value, defined as coth(x) = 1 / tanh(x). For matrices, the function is evaluated element wise. */ - coth(x: number): number; + coth(x: number|Unit): number; coth(x: Complex): Complex; - coth(x: Unit): number; coth(x: MathArray): MathArray; coth(x: Matrix): Matrix; /** * Calculate the cosecant of a value, defined as csc(x) = 1/sin(x). For matrices, the function is evaluated element wise. */ - csc(x: number): number; + csc(x: number|Unit): number; csc(x: Complex): Complex; - csc(x: Unit): number; csc(x: MathArray): MathArray; csc(x: Matrix): Matrix; /** * Calculate the hyperbolic cosecant of a value, defined as csch(x) = 1 / sinh(x). For matrices, the function is evaluated element wise. */ - csch(x: number): number; + csch(x: number|Unit): number; csch(x: Complex): Complex; - csch(x: Unit): number; csch(x: MathArray): MathArray; csch(x: Matrix): Matrix; /** * Calculate the secant of a value, defined as sec(x) = 1/cos(x). For matrices, the function is evaluated element wise. */ - sec(x: number): number; + sec(x: number|Unit): number; sec(x: Complex): Complex; - sec(x: Unit): number; sec(x: MathArray): MathArray; sec(x: Matrix): Matrix; /** * Calculate the hyperbolic secant of a value, defined as sech(x) = 1 / cosh(x). For matrices, the function is evaluated element wise. */ - sech(x: number): number; + sech(x: number|Unit): number; sech(x: Complex): Complex; - sech(x: Unit): number; sech(x: MathArray): MathArray; sech(x: Matrix): Matrix; /** * Calculate the sine of a value. For matrices, the function is evaluated element wise. */ - sin(x: number): number; + sin(x: number|Unit): number; sin(x: BigNumber): BigNumber; sin(x: Complex): Complex; - sin(x: Unit): number; sin(x: MathArray): MathArray; sin(x: Matrix): Matrix; /** * Calculate the cosine of a value. For matrices, the function is evaluated element wise. */ - cos(x: number): number; + cos(x: number|Unit): number; cos(x: BigNumber): BigNumber; cos(x: Complex): Complex; - cos(x: Unit): number; cos(x: MathArray): MathArray; cos(x: Matrix): Matrix; /** * Calculate the hyperbolic sine of a value, defined as sinh(x) = 1/2 * (exp(x) - exp(-x)). For matrices, the function is evaluated element wise. */ - sinh(x: number): number; + sinh(x: number|Unit): number; sinh(x: BigNumber): BigNumber; sinh(x: Complex): Complex; - sinh(x: Unit): number; sinh(x: MathArray): MathArray; sinh(x: Matrix): Matrix; /** * Calculate the tangent of a value. tan(x) is equal to sin(x) / cos(x). For matrices, the function is evaluated element wise. */ - tan(x: number): number; + tan(x: number|Unit): number; tan(x: BigNumber): BigNumber; tan(x: Complex): Complex; - tan(x: Unit): number; tan(x: MathArray): MathArray; tan(x: Matrix): Matrix; /** * Calculate the hyperbolic tangent of a value, defined as tanh(x) = (exp(2 * x) - 1) / (exp(2 * x) + 1). For matrices, the function is evaluated element wise. */ - tanh(x: number): number; + tanh(x: number|Unit): number; tanh(x: BigNumber): BigNumber; tanh(x: Complex): Complex; - tanh(x: Unit): number; tanh(x: MathArray): MathArray; tanh(x: Matrix): Matrix; @@ -1226,7 +1176,7 @@ declare namespace mathjs { * @param x The unit to be converted. * @param unit New unit. Can be a string like "cm" or a unit without value. */ - to(x: Unit|MathArray|Matrix, unit: Unit|string): Unit|MathArray|Matrix + to(x: Unit|MathArray|Matrix, unit: Unit|string): Unit|MathArray|Matrix; /** * Clone an object. @@ -1236,25 +1186,25 @@ declare namespace mathjs { /** * Filter the items in an array or one dimensional matrix. * @param x A one dimensional matrix or array to filter - * @param test + * @param test */ - filter(x: MathArray|Matrix, test: RegExp|((item: any)=>boolean)): MathArray|Matrix; + filter(x: MathArray|Matrix, test: RegExp|((item: any) => boolean)): MathArray|Matrix; /** * Iterate over all elements of a matrix/array, and executes the given callback function. * @param x The matrix to iterate on. * @param callback The callback function is invoked with three parameters: the value of the element, the index of the element, and the Matrix/array being traversed. */ - forEach(x: MathArray|Matrix, callback: (item: any)=>any): void; + forEach: (x: MathArray|Matrix, callback: (item: any) => any) => void; /** * Format a value of any type into a string. * @param value The value to be formatted */ - format(value: any, options?: IFormatOptions|number|((item: any)=>string)): string; + format(value: any, options?: FormatOptions|number|((item: any) => string)): string; /** - * Test whether a value is an integer number. The function supports number, BigNumber, and Fraction. + * Test whether a value is an integer number. The function supports number, BigNumber, and Fraction. * The function is evaluated element-wise in case of Array or Matrix input. */ isInteger(x: any): boolean; @@ -1287,7 +1237,7 @@ declare namespace mathjs { * @param x The matrix to iterate on. * @param callback The callback method is invoked with three parameters: the value of the element, the index of the element, and the matrix being traversed. */ - map(x: MathArray|Matrix, callback: (item: any)=>any): MathArray|Matrix; + map(x: MathArray|Matrix, callback: (item: any) => any): MathArray|Matrix; /** * Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect. @@ -1296,7 +1246,7 @@ declare namespace mathjs { * @param compare An optional comparator function. The function is called as compare(a, b), and must return 1 when a > b, -1 when a < b, and 0 when a == b. Default value: 'asc'. * @returns Returns the kth lowest value. */ - partitionSelect(x: MathArray|Matrix, k: number, compare?: string|((a: any, b: any)=>number)): any; + partitionSelect(x: MathArray|Matrix, k: number, compare?: string|((a: any, b: any) => number)): any; /** * Interpolate values into a string template. @@ -1304,14 +1254,14 @@ declare namespace mathjs { * @param values An object containing variables which will be filled in in the template. * @param precision Number of digits to format numbers. If not provided, the value will not be rounded. */ - print(template:string, values: any, precision?: number): void; + print: (template: string, values: any, precision?: number) => void; /** * Sort the items in a matrix. * @param x A one dimensional matrix or array to sort * @param compare An optional comparator function. The function is called as compare(a, b), and must return 1 when a > b, -1 when a < b, and 0 when a == b. Default value: 'asc'. */ - sort(x: MathArray|Matrix, compare?: string|((a: any, b: any)=>number)): MathArray|Matrix; + sort(x: MathArray|Matrix, compare?: string|((a: any, b: any) => number)): MathArray|Matrix; /** * Determine the type of a variable. @@ -1319,7 +1269,7 @@ declare namespace mathjs { typeof(x: any): string; } - export interface Matrix { + interface Matrix { type: string; storage(): string; datatype(): string; @@ -1331,391 +1281,380 @@ declare namespace mathjs { clone(): Matrix; size(): number[]; map(callback: (a: any, b: number, c: Matrix) => any, skipZeros?: boolean): Matrix; - forEach(callback: (a: any, b: number, c: Matrix) => void, skipZeros?: boolean): void; + forEach: (callback: (a: any, b: number, c: Matrix) => void, skipZeros?: boolean) => void; toJSON(): any; diagonal(k?: number|BigNumber): any[]; swapRows(i: number, j: number): Matrix; } - export interface BigNumber extends Decimal { + interface BigNumber extends Decimal {} // tslint:disable-line no-empty-interface - } - - export interface Fraction { + interface Fraction { s: number; n: number; d: number; } - export interface Complex { + interface Complex { re: number; im: number; - toPolar(): IPolarCoordinates; + toPolar(): PolarCoordinates; clone(): Complex; } - export interface IPolarCoordinates { + interface PolarCoordinates { r: number; phi: number; } - export interface Unit { + interface Unit { to(unit: string): Unit; toNumber(unit: string): number; } - export interface CreateUnitOptions { + interface CreateUnitOptions { override?: boolean; } - export interface UnitDefinition { + interface UnitDefinition { definition?: string|Unit; prefixes?: string; offset?: number; aliases?: string[]; } - export interface Index { + interface Index {} // tslint:disable-line no-empty-interface - } - - export interface EvalFunction { + interface EvalFunction { eval(scope?: any): any; } - export interface MathNode { - isNode: boolean; - isSymbolNode?: boolean; - isConstantNode?: boolean; - isOperatorNode?: boolean; - op?: string; - fn?: string; - args?: MathNode[]; - type: string; - name?: string; - value?: any; + interface MathNode { + isNode: boolean; + isSymbolNode?: boolean; + isConstantNode?: boolean; + isOperatorNode?: boolean; + op?: string; + fn?: string; + args?: MathNode[]; + type: string; + name?: string; + value?: any; - compile(): EvalFunction; - eval(): any; - eval(expr: string): any; - /** - * - * Filter nodes in an expression tree. The callback function is called as callback(node: Node, path: string, parent: Node) : boolean for every node in the tree, - * and must return a boolean. The function filter returns an array with nodes for which the test returned true. - * Parameter path is a string containing a relative JSON Path. - * - * Example: - * - * ``` - * var node = math.parse('x^2 + x/4 + 3*y'); - * var filtered = node.filter(function (node) { - * return node.isSymbolNode && node.name == 'x'; - * }); - * // returns an array with two entries: two SymbolNodes 'x' - * ``` - * - * @param The callback function is called as callback(node: Node, path: string, parent: Node) : boolean for every node in the tree, and must return a boolean. The function filter returns an array with nodes for which the test returned true. Parameter path is a string containing a relative JSON Path. - * @param {Function} callback(node [description] - * @return {[Mathnode]} Returns an array with nodes for which test returned true - */ - filter(callback: (node: MathNode, path: string, parent: MathNode)=>any ): MathNode[]; + compile(): EvalFunction; + eval(expr?: string): any; + /** + * + * Filter nodes in an expression tree. The callback function is called as callback(node: Node, path: string, parent: Node) : boolean for every node in the tree, + * and must return a boolean. The function filter returns an array with nodes for which the test returned true. + * Parameter path is a string containing a relative JSON Path. + * + * Example: + * + * ``` + * var node = math.parse('x^2 + x/4 + 3*y'); + * var filtered = node.filter(function (node) { + * return node.isSymbolNode && node.name == 'x'; + * }); + * // returns an array with two entries: two SymbolNodes 'x' + * ``` + * + * The callback function is called as callback(node: Node, path: string, parent: Node) : boolean for every node in the tree, and must return a boolean. + * The function filter returns an array with nodes for which the test returned true. Parameter path is a string containing a relative JSON Path. + * @return Returns an array with nodes for which test returned true + */ + filter(callback: (node: MathNode, path: string, parent: MathNode) => any): MathNode[]; + /** + * [forEach description] + */ + forEach(callback: (node: MathNode, path: string, parent: MathNode) => any): MathNode[]; - /** - * [forEach description] - * @param {MathNode} callback(node [description] - * @return {[type]} [description] - */ - forEach(callback: (node: MathNode, path: string, parent: MathNode)=>any): MathNode[]; + /** + * `traverse(callback)` + * + * Recursively traverse all nodes in a node tree. + * Executes given callback for this node and each of its child nodes. + * Similar to Array.forEach, except recursive. + * The callback function is a mapping function accepting a node, and returning a replacement for the node or the original node. + * Function callback is called as callback(node: Node, path: string, parent: Node) for every node in the tree. + * Parameter path is a string containing a relative JSON Path. Example: + * + * ``` + * var node = math.parse('3 * x + 2'); + * node.traverse(function (node, path, parent) { + * switch (node.type) { + * case 'OperatorNode': console.log(node.type, node.op); break; + * case 'ConstantNode': console.log(node.type, node.value); break; + * case 'SymbolNode': console.log(node.type, node.name); break; + * default: console.log(node.type); + * } + * }); + * // outputs: + * // OperatorNode + + * // OperatorNode * + * // ConstantNode 3 + * // SymbolNode x + * // ConstantNode 2 + * ``` + */ + traverse(callback: (node: MathNode, path: string, parent: MathNode) => void): any; + /** + * Recursively transform an expression tree via a transform function. Similar to Array.map, + * but recursively executed on all nodes in the expression tree. The callback function is a + * mapping function accepting a node, and returning a replacement for the node or the original node. + * Function callback is called as callback(node: Node, path: string, parent: Node) for every node in + * the tree, and must return a Node. Parameter path is a string containing a relative JSON Path. + * + * For example, to replace all nodes of type SymbolNode having name ‘x’ with a ConstantNode with value 3: + * ```js + * var node = math.parse('x^2 + 5*x'); + * var transformed = node.transform(function (node, path, parent) { + * if (node.SymbolNode && node.name == 'x') { + * return new math.expression.node.ConstantNode(3); + * } + * else { + * return node; + * } + * }); + * transformed.toString(); // returns '(3 ^ 2) + (5 * 3)' + * ``` + */ + transform(callback: (node: MathNode, path: string, parent: MathNode) => MathNode): MathNode; - - /** - * `traverse(callback)` - * - * Recursively traverse all nodes in a node tree. Executes given callback for this node and each of its child nodes. Similar to Array.forEach, except recursive. The callback function is a mapping function accepting a node, and returning a replacement for the node or the original node. Function callback is called as callback(node: Node, path: string, parent: Node) for every node in the tree. Parameter path is a string containing a relative JSON Path. Example: - * - * ``` - * var node = math.parse('3 * x + 2'); - * node.traverse(function (node, path, parent) { - * switch (node.type) { - * case 'OperatorNode': console.log(node.type, node.op); break; - * case 'ConstantNode': console.log(node.type, node.value); break; - * case 'SymbolNode': console.log(node.type, node.name); break; - * default: console.log(node.type); - * } - * }); - * // outputs: - * // OperatorNode + - * // OperatorNode * - * // ConstantNode 3 - * // SymbolNode x - * // ConstantNode 2 - * ``` - * - * @param {MathNode} callback=(node [description] - * @return {[type]} [description] - */ - traverse(callback: (node: MathNode, path: string, parent: MathNode)=> void): any; -//addEventListener(ev: 'change', callback: (ev: EditorChangeEvent) => any); - /** - * Recursively transform an expression tree via a transform function. Similar to Array.map, - * but recursively executed on all nodes in the expression tree. The callback function is a - * mapping function accepting a node, and returning a replacement for the node or the original node. - * Function callback is called as callback(node: Node, path: string, parent: Node) for every node in - * the tree, and must return a Node. Parameter path is a string containing a relative JSON Path. - * - * For example, to replace all nodes of type SymbolNode having name ‘x’ with a ConstantNode with value 3: - * ```js - * var node = math.parse('x^2 + 5*x'); - * var transformed = node.transform(function (node, path, parent) { - * if (node.SymbolNode && node.name == 'x') { - * return new math.expression.node.ConstantNode(3); - * } - * else { - * return node; - * } - * }); - * transformed.toString(); // returns '(3 ^ 2) + (5 * 3)' - * ``` - */ - transform(callback: (node: MathNode, path: string, parent: MathNode)=>MathNode): MathNode; - /** - * Transform a node. Creates a new Node having it’s childs be the results of calling the provided - * callback function for each of the childs of the original node. The callback function is called - * as `callback(child: Node, path: string, parent: Node)` and must return a Node. - * Parameter path is a string containing a relative JSON Path. - * - * - * See also transform, which is a recursive version of map. - */ - map(callback: (node: MathNode, path: string, parent: MathNode)=>MathNode): MathNode; + /** + * Transform a node. Creates a new Node having it’s child's be the results of calling the provided + * callback function for each of the child's of the original node. The callback function is called + * as `callback(child: Node, path: string, parent: Node)` and must return a Node. + * Parameter path is a string containing a relative JSON Path. + * + * + * See also transform, which is a recursive version of map. + */ + map(callback: (node: MathNode, path: string, parent: MathNode) => MathNode): MathNode; } - - export interface Parser { + interface Parser { eval(expr: string): any; get(variable: string): any; - set(variable: string, value: any): void; - clear(): void; + set: (variable: string, value: any) => void; + clear: () => void; } - export interface Distribution { + interface Distribution { random(size: any, min?: any, max?: any): any; randomInt(min: any, max?: any): any; pickRandom(array: any): any; } - export interface IFormatOptions { + interface FormatOptions { /** * Number notation. Choose from: * 'fixed' Always use regular number notation. For example '123.40' and '14000000' * 'exponential' Always use exponential notation. For example '1.234e+2' and '1.4e+7' - * 'auto' (default) Regular number notation for numbers having an absolute value between lower and upper bounds, and + * 'auto' (default) Regular number notation for numbers having an absolute value between lower and upper bounds, and * uses exponential notation elsewhere. Lower bound is included, upper bound is excluded. For example '123.4' and '1.4e7'. */ notation?: string; /** - * A number between 0 and 16 to round the digits of the number. In case of notations 'exponential' and 'auto', - * precision defines the total number of significant digits returned and is undefined by default. In case of notation 'fixed', + * A number between 0 and 16 to round the digits of the number. In case of notations 'exponential' and 'auto', + * precision defines the total number of significant digits returned and is undefined by default. In case of notation 'fixed', * precision defines the number of significant digits after the decimal point, and is 0 by default. */ precision?: number; /** - * An object containing two parameters, {number} lower and {number} upper, used by notation 'auto' to determine + * An object containing two parameters, {number} lower and {number} upper, used by notation 'auto' to determine * when to return exponential notation. Default values are lower=1e-3 and upper=1e5. Only applicable for notation auto. */ exponential?: {lower: number; upper: number}; /** - * Available values: 'ratio' (default) or 'decimal'. For example format(fraction(1, 3)) will output '1/3' when 'ratio' + * Available values: 'ratio' (default) or 'decimal'. For example format(fraction(1, 3)) will output '1/3' when 'ratio' * is configured, and will output 0.(3) when 'decimal' is configured. */ fraction?: string; - /** - * A custom formatting function. Can be used to override the built-in notations. Function fn is called with - * value as parameter and must return a string. Is useful for example to format all values inside a matrix in a particular way. - * */ - fn?: (item: any)=>string; + /** + * A custom formatting function. Can be used to override the built-in notations. Function fn is called with + * value as parameter and must return a string. Is useful for example to format all values inside a matrix in a particular way. + */ + fn?: (item: any) => string; } - export interface Help { + interface Help { toString(): string; toJSON(): string; - } + } - export interface IMathJsChain { + interface MathJsChain { /** * Solves the linear equation system by forwards substitution. Matrix must be a lower triangular matrix. * @param b A column vector with the b values */ - lsolve(b: Matrix|MathArray): IMathJsChain; + lsolve(b: Matrix|MathArray): MathJsChain; /** - * Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in two matrices (L, U) + * Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in two matrices (L, U) * and a row permutation vector p where A[p,:] = L * U */ - lup(): IMathJsChain; + lup(): MathJsChain; /** * Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector. * @param b Column Vector */ - lusolve(b: Matrix|MathArray): IMathJsChain; + lusolve(b: Matrix|MathArray): MathJsChain; /** - * Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix A is decomposed in + * Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix A is decomposed in * two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U - * @param order The Symbolic Ordering and Analysis order: 0 - Natural ordering, no permutation vector q is - * returned 1 - Matrix must be square, symbolic ordering and analisis is performed on M = A + A' 2 - Symbolic - * ordering and analisis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'. - * This is appropriatefor LU factorization of unsymmetric matrices. 3 - Symbolic ordering and analisis is performed - * on M = A' * A. This is best used for LU factorization is matrix M has no dense rows. A dense row is a row with + * @param order The Symbolic Ordering and Analysis order: 0 - Natural ordering, no permutation vector q is + * returned 1 - Matrix must be square, symbolic ordering and analysis is performed on M = A + A' 2 - Symbolic + * ordering and analysis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'. + * This is appropriate for LU factorization of non-symmetric matrices. 3 - Symbolic ordering and analysis is performed + * on M = A' * A. This is best used for LU factorization is matrix M has no dense rows. A dense row is a row with * more than 10*sqr(columns) entries. * @param threshold Partial pivoting threshold (1 for partial pivoting) * @returns The lower triangular matrix, the upper triangular matrix and the permutation vectors. */ - slu(order: Number, threshold: Number): IMathJsChain; + slu(order: number, threshold: number): MathJsChain; /** * Solves the linear equation system by backward substitution. Matrix must be an upper triangular matrix. U * x = b * @param b A column vector with the b values * @returns A column vector with the linear system solution (x) */ - usolve(b:Matrix|MathArray): IMathJsChain; + usolve(b: Matrix|MathArray): MathJsChain; /** * Calculate the absolute value of a number. For matrices, the function is evaluated element wise. */ - abs(): IMathJsChain; + abs(): MathJsChain; /** * Add two values, x + y. For matrices, the function is evaluated element wise. * @param y Second value to add */ - add(y: MathType): IMathJsChain; + add(y: MathType): MathJsChain; /** * Calculate the cubic root of a value. For matrices, the function is evaluated element wise. * @param allRoots Optional, false by default. Only applicable when x is a number or complex number. If true, all complex roots are returned, if false (default) the principal root is returned. */ - cbrt(allRoots?: boolean): IMathJsChain; + cbrt(allRoots?: boolean): MathJsChain; /** * Round a value towards plus infinity If x is complex, both real and imaginary part are rounded towards plus infinity. For matrices, the function is evaluated element wise. */ - ceil(): IMathJsChain; + ceil(): MathJsChain; - /** + /** * Compute the cube of a value, x * x * x. For matrices, the function is evaluated element wise. */ - cube(): IMathJsChain; + cube(): MathJsChain; /** * Divide two values, x / y. To divide matrices, x is multiplied with the inverse of y: x * inv(y). * @param y Denominator */ - divide(y:MathType): IMathJsChain; + divide(y: MathType): MathJsChain; /** * Divide two matrices element wise. The function accepts both matrices and scalar values. * @param y Denominator */ - dotDivide(y: MathType): IMathJsChain; + dotDivide(y: MathType): MathJsChain; /** * Multiply two matrices element wise. The function accepts both matrices and scalar values. * @param y Right hand value */ - dotMultiply(y: MathType): IMathJsChain; + dotMultiply(y: MathType): MathJsChain; - /** + /** * Calculates the power of x to y element wise. * @param y The exponent */ - dotPow(y: MathType): IMathJsChain; + dotPow(y: MathType): MathJsChain; /** * Calculate the exponent of a value. For matrices, the function is evaluated element wise. */ - exp(): IMathJsChain; + exp(): MathJsChain; - /** + /** * Round a value towards zero. For matrices, the function is evaluated element wise. */ - fix(): IMathJsChain; + fix(): MathJsChain; /** * Round a value towards minus infinity. For matrices, the function is evaluated element wise. */ - floor(): IMathJsChain; + floor(): MathJsChain; /** * Calculate the greatest common divisor for two or more values or arrays. For matrices, the function is evaluated element wise. */ - gcd(...args: number[]): IMathJsChain; - gcd(...args: BigNumber[]): IMathJsChain ; - gcd(...args: Fraction[]): IMathJsChain ; - gcd(...args: MathArray[]): IMathJsChain ; - gcd(...args: Matrix[]): IMathJsChain; + gcd(...args: number[]): MathJsChain; + gcd(...args: BigNumber[]): MathJsChain ; + gcd(...args: Fraction[]): MathJsChain ; + gcd(...args: MathArray[]): MathJsChain ; + gcd(...args: Matrix[]): MathJsChain; /** - * Calculate the hypotenusa of a list with values. The hypotenusa is defined as: + * Calculate the hypotenuse of a list with values. The hypotenuse is defined as: * hypot(a, b, c, ...) = sqrt(a^2 + b^2 + c^2 + ...) - * For matrix input, the hypotenusa is calculated for all values in the matrix. + * For matrix input, the hypotenuse is calculated for all values in the matrix. */ - hypot(...args: number[]): IMathJsChain; - hypot(...args: BigNumber[]): IMathJsChain; + hypot(...args: number[]): MathJsChain; + hypot(...args: BigNumber[]): MathJsChain; /** * Calculate the kronecker product of two matrices or vectors * @param x First Matrix * @param y Second Matrix */ - kron(x: Matrix|MathArray, y: Matrix|MathArray): IMathJsChain; + kron(x: Matrix|MathArray, y: Matrix|MathArray): MathJsChain; /** * Calculate the least common multiple for two or more values or arrays. lcm is defined as: * lcm(a, b) = abs(a * b) / gcd(a, b) * For matrices, the function is evaluated element wise. */ - lcm(b: number): IMathJsChain; - lcm(b: BigNumber ): IMathJsChain ; - lcm(b: MathArray): IMathJsChain; - lcm(b: Matrix): IMathJsChain; + lcm(b: number|BigNumber|MathArray|Matrix): MathJsChain; /** * Calculate the logarithm of a value. For matrices, the function is evaluated element wise. * @param base Optional base for the logarithm. If not provided, the natural logarithm of x is calculated. Default value: e. */ - log(base?: number|BigNumber|Complex): IMathJsChain; + log(base?: number|BigNumber|Complex): MathJsChain; /** * Calculate the 10-base of a value. This is the same as calculating log(x, 10). For matrices, the function is evaluated element wise. */ - log10(): IMathJsChain; + log10(): MathJsChain; /** * Calculates the modulus, the remainder of an integer division. For matrices, the function is evaluated element wise. * The modulus is defined as: * x - y * floor(x / y) - * See http://en.wikipedia.org/wiki/Modulo_operation. + * @see http://en.wikipedia.org/wiki/Modulo_operation. * @param y Divisor */ - mod(y: number|BigNumber|Fraction|MathArray|Matrix): IMathJsChain; + mod(y: number|BigNumber|Fraction|MathArray|Matrix): MathJsChain; /** * Multiply two values, x * y. The result is squeezed. For matrices, the matrix product is calculated. */ - multiply(y: MathType): IMathJsChain; + multiply(y: MathType): MathJsChain; /** * Calculate the norm of a number, vector or matrix. The second parameter p is optional. If not provided, it defaults to 2. * @param p Vector space. Supported numbers include Infinity and -Infinity. Supported strings are: 'inf', '-inf', and 'fro' (The Frobenius norm) Default value: 2. */ - norm(p?: number|BigNumber|string): IMathJsChain; + norm(p?: number|BigNumber|string): MathJsChain; /** * Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation @@ -1723,19 +1662,19 @@ declare namespace mathjs { * For matrices, the function is evaluated element wise. * @param root The root. Default value: 2. */ - nthRoot(root?: number|BigNumber): IMathJsChain; + nthRoot(root?: number|BigNumber): MathJsChain; /** * Calculates the power of x to y, x ^ y. Matrix exponentiation is supported for square matrices x, and positive integer exponents y. * @param y The exponent */ - pow(y: number|BigNumber|Complex): IMathJsChain; + pow(y: number|BigNumber|Complex): MathJsChain; /** * Round a value towards the nearest integer. For matrices, the function is evaluated element wise. * @param n Number of decimals Default value: 0. */ - round(n?: number|BigNumber|MathArray): IMathJsChain; + round(n?: number|BigNumber|MathArray): MathJsChain; /** * Compute the sign of a value. The sign of a value x is: @@ -1744,92 +1683,94 @@ declare namespace mathjs { * 0 when x == 0 * For matrices, the function is evaluated element wise. */ - sign(): IMathJsChain; + sign(): MathJsChain; /** * Calculate the square root of a value. For matrices, the function is evaluated element wise. */ - sqrt(): IMathJsChain; + sqrt(): MathJsChain; /** * Compute the square of a value, x * x. For matrices, the function is evaluated element wise. */ - square(): IMathJsChain; + square(): MathJsChain; /** * Subtract two values, x - y. For matrices, the function is evaluated element wise. */ - subtract(y: MathType): IMathJsChain; + subtract(y: MathType): MathJsChain; /** * Inverse the sign of a value, apply a unary minus operation. * For matrices, the function is evaluated element wise. Boolean values and strings will be converted to a number. For complex numbers, both real and complex value are inverted. */ - unaryMinus(): IMathJsChain; + unaryMinus(): MathJsChain; /** * Unary plus operation. Boolean values and strings will be converted to a number, numeric values will be returned as is. * For matrices, the function is evaluated element wise. */ - unaryPlus(): IMathJsChain; + unaryPlus(): MathJsChain; /** * Calculate the extended greatest common divisor for two values. See http://en.wikipedia.org/wiki/Extended_Euclidean_algorithm. */ - xgcd(b: number|BigNumber): IMathJsChain; + xgcd(b: number|BigNumber): MathJsChain; /** * Bitwise AND two values, x & y. For matrices, the function is evaluated element wise. */ - bitAnd(y: number|BigNumber|MathArray|Matrix): IMathJsChain; + bitAnd(y: number|BigNumber|MathArray|Matrix): MathJsChain; /** * Bitwise NOT value, ~x. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. */ - bitNot(): IMathJsChain; + bitNot(): MathJsChain; /** * Bitwise OR two values, x | y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the lowest print base. */ - bitOr(): IMathJsChain; + bitOr(): MathJsChain; /** * Bitwise XOR two values, x ^ y. For matrices, the function is evaluated element wise. */ - bitXor(y: number|BigNumber|MathArray|Matrix): IMathJsChain; + bitXor(y: number|BigNumber|MathArray|Matrix): MathJsChain; /** * Bitwise left logical shift of a value x by y number of bits, x << y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. * @param x Value to be shifted * @param y Amount of shifts */ - leftShift(y: number|BigNumber): IMathJsChain; + leftShift(y: number|BigNumber): MathJsChain; /** * Bitwise right arithmetic shift of a value x by y number of bits, x >> y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. * @param x Value to be shifted * @param y Amount of shifts */ - rightArithShift(y: number|BigNumber): IMathJsChain; + rightArithShift(y: number|BigNumber): MathJsChain; /** * Bitwise right logical shift of value x by y number of bits, x >>> y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. * @param x Value to be shifted * @param y Amount of shifts */ - rightLogShift(y: number): IMathJsChain; + rightLogShift(y: number): MathJsChain; /** - * The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. bellNumbers only takes integer arguments. The following condition must be enforced: n >= 0 + * The Bell Numbers count the number of partitions of a set. + * A partition is a pairwise disjoint subset of S whose union is S. + * bellNumbers only takes integer arguments. The following condition must be enforced: n >= 0 * @param n Total number of objects in the set */ - bellNumbers(): IMathJsChain; + bellNumbers(): MathJsChain; /** * The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0 - * @pararm n nth Catalan number + * @param n nth Catalan number */ - catalan(): IMathJsChain; + catalan(): MathJsChain; /** * The composition counts of n into k parts. Composition only takes integer arguments. The following condition must be enforced: k <= n. @@ -1837,51 +1778,52 @@ declare namespace mathjs { * @param k Number of objects in the subset * @returns Returns the composition counts of n into k parts. */ - composition(k: Number|BigNumber): IMathJsChain; + composition(k: number|BigNumber): MathJsChain; /** - * The Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. stirlingS2 only takes integer arguments. The following condition must be enforced: k <= n. + * The Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. + * stirlingS2 only takes integer arguments. The following condition must be enforced: k <= n. * If n = k or k = 1, then s(n,k) = 1 * @param n Total number of objects in the set * @param k Number of objects in the subset */ - stirlingS2(k: Number|BigNumber): IMathJsChain; + stirlingS2(k: number|BigNumber): MathJsChain; /** * Compute the argument of a complex value. For a complex number a + bi, the argument is computed as atan2(b, a). For matrices, the function is evaluated element wise. * @param x A complex number or array with complex numbers */ - arg(): IMathJsChain; + arg(): MathJsChain; /** * Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate of x is a - bi. For matrices, the function is evaluated element wise. * @param x A complex number or array with complex numbers */ - conj(): IMathJsChain; + conj(): MathJsChain; - /** - * Get the imaginary part of a complex number. For a complex number a + bi, the function returns b. + /** + * Get the imaginary part of a complex number. For a complex number a + bi, the function returns b. * For matrices, the function is evaluated element wise. */ - im(): IMathJsChain; + im(): MathJsChain; /** * Get the real part of a complex number. For a complex number a + bi, the function returns a. * For matrices, the function is evaluated element wise. */ - re(): IMathJsChain; + re(): MathJsChain; /** - * Calculates: The eucledian distance between two points in 2 and 3 dimensional spaces. Distance between point - * and a line in 2 and 3 dimensional spaces. Pairwise distance between a set of 2D or 3D points NOTE: When - * substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c For parametric + * Calculates: The eucledian distance between two points in 2 and 3 dimensional spaces. Distance between point + * and a line in 2 and 3 dimensional spaces. Pairwise distance between a set of 2D or 3D points NOTE: When + * substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c For parametric * equation of a 3D line, x0, y0, z0, a, b, c are from: (x−x0, y−y0, z−z0) = t(a, b, c) */ - distance(y: MathArray|Matrix|any): IMathJsChain; + distance(y: MathType): MathJsChain; /** - * Calculates the point of intersection of two lines in two or three dimensions and of a line and a plane in - * three dimensions. The inputs are in the form of arrays or 1 dimensional matrices. The line intersection functions + * Calculates the point of intersection of two lines in two or three dimensions and of a line and a plane in + * three dimensions. The inputs are in the form of arrays or 1 dimensional matrices. The line intersection functions * return null if the lines do not meet. * Note: Fill the plane coefficients as x + y + z = c and not as x + y + z + c = 0. * @param w Co-ordinates of first end-point of first line @@ -1890,39 +1832,39 @@ declare namespace mathjs { * @param z Co-ordinates of second end-point of second line OR null if the calculation is for line and plane * @returns Returns the point of intersection of lines/lines-planes */ - intersect(x: MathArray|Matrix, y: MathArray|Matrix, z: MathArray|Matrix): IMathJsChain; + intersect(x: MathArray|Matrix, y: MathArray|Matrix, z: MathArray|Matrix): MathJsChain; /** * Logical and. Test whether two values are both defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise. */ - and(y: number|BigNumber|Complex|Unit|MathArray|Matrix): IMathJsChain; + and(y: number|BigNumber|Complex|Unit|MathArray|Matrix): MathJsChain; /** * Logical not. Flips boolean value of a given parameter. For matrices, the function is evaluated element wise. */ - not(): IMathJsChain; + not(): MathJsChain; /** * Logical or. Test if at least one value is defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise. */ - or(y: number|BigNumber|Complex|Unit|MathArray|Matrix): IMathJsChain; + or(y: number|BigNumber|Complex|Unit|MathArray|Matrix): MathJsChain; /** * Logical xor. Test whether one and only one value is defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise. */ - xor(y: number|BigNumber|Complex|Unit|MathArray|Matrix): IMathJsChain; + xor(y: number|BigNumber|Complex|Unit|MathArray|Matrix): MathJsChain; /** - * Calculate the cross product for two vectors in three dimensional space. The cross product of A = [a1, a2, a3] + * Calculate the cross product for two vectors in three dimensional space. The cross product of A = [a1, a2, a3] * and B =[b1, b2, b3] is defined as: * cross(A, B) = [ a2 * b3 - a3 * b2, a3 * b1 - a1 * b3, a1 * b2 - a2 * b1 ] */ - cross(y: MathArray|Matrix): IMathJsChain; + cross(y: MathArray|Matrix): MathJsChain; /** * Calculate the determinant of a matrix. */ - det(): IMathJsChain; + det(): MathJsChain; /** * Resize a matrix @@ -1930,17 +1872,17 @@ declare namespace mathjs { * @param size One dimensional array with numbers * @param defaultValue Zero by default, except in case of a string, in that case defaultValue = ' ' Default value: 0. */ - resize(size: MathArray|Matrix, defaultValue?: number|string): IMathJsChain; + resize(size: MathArray|Matrix, defaultValue?: number|string): MathJsChain; /** * Calculate the size of a matrix or scalar. */ - size(): IMathJsChain; + size(): MathJsChain; /** * Squeeze a matrix, remove inner and outer singleton dimensions from a matrix. */ - squeeze(): IMathJsChain; + squeeze(): MathJsChain; /** * Get or set a subset of a matrix or string. @@ -1949,352 +1891,328 @@ declare namespace mathjs { * @param replacement An array, matrix, or scalar. If provided, the subset is replaced with replacement. If not provided, the subset is returned * @param defaultValue Default value, filled in on new entries when the matrix is resized. If not provided, math.matrix elements will be left undefined. Default value: undefined. */ - subset(index: Index, replacement?: any, defaultValue?: any): IMathJsChain; + subset(index: Index, replacement?: any, defaultValue?: any): MathJsChain; /** * Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix. */ - trace(): IMathJsChain; + trace(): MathJsChain; /** * Transpose a matrix. All values of the matrix are reflected over its main diagonal. Only two dimensional matrices are supported. */ - transpose(): IMathJsChain; + transpose(): MathJsChain; /** * Random pick a value from a one dimensional array. Array element is picked using a random function with uniform distribution. */ - pickRandom(): IMathJsChain; + pickRandom(): MathJsChain; /** * Return a random number larger or equal to min and smaller than max using a uniform distribution. */ - random(): IMathJsChain; - random(max?: number): IMathJsChain; - random(min:number, max: number): IMathJsChain; + random(min?: number, max?: number): MathJsChain; /** * Return a random integer number larger or equal to min and smaller than max using a uniform distribution. */ - randomInt(max?: number): IMathJsChain; - randomInt(min:number, max: number): IMathJsChain; + randomInt(min?: number, max?: number): MathJsChain; /** * Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y. - * x and y are considered equal when the relative difference between x and y is smaller than the configured epsilon. + * x and y are considered equal when the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. * For matrices, the function is evaluated element wise. */ - compare(y: MathType): IMathJsChain; + compare(y: MathType): MathJsChain; /** * Test element wise whether two matrices are equal. The function accepts both matrices and scalar values. */ - deepEqual(y: MathType): IMathJsChain; + deepEqual(y: MathType): MathJsChain; /** * Test whether two values are equal. - * - * The function tests whether the relative difference between x and y is smaller than the configured epsilon. + * The function tests whether the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * * For matrices, the function is evaluated element wise. In case of complex numbers, x.re must equal y.re, and x.im must equal y.im. - * * Values null and undefined are compared strictly, thus null is only equal to null and nothing else, and undefined is only equal to undefined and nothing else. */ - equal(y: MathType): IMathJsChain; + equal(y: MathType): MathJsChain; /** * Test whether value x is larger than y. - * - * The function returns true when x is larger than y and the relative difference between x and y is larger than the configured epsilon. + * The function returns true when x is larger than y and the relative difference between x and y is larger than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * * For matrices, the function is evaluated element wise. */ - larger(y: MathType): IMathJsChain; + larger(y: MathType): MathJsChain; /** * Test whether value x is larger or equal to y. - * - * The function returns true when x is larger than y or the relative difference between x and y is smaller than the configured epsilon. + * The function returns true when x is larger than y or the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * * For matrices, the function is evaluated element wise. */ - largerEq(y: MathType): IMathJsChain; + largerEq(y: MathType): MathJsChain; /** * Test whether value x is smaller than y. - * - * The function returns true when x is smaller than y and the relative difference between x and y is smaller than the configured epsilon. + * The function returns true when x is smaller than y and the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * * For matrices, the function is evaluated element wise. */ - smaller(IMathJsChainy: MathType): IMathJsChain; + smaller(MathJsChainy: MathType): MathJsChain; /** * Test whether value x is smaller or equal to y. - * - * The function returns true when x is smaller than y or the relative difference between x and y is smaller than the configured epsilon. + * The function returns true when x is smaller than y or the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. For matrices, the function is evaluated element wise. */ - smallerEq(IMathJsChainy: MathType): IMathJsChain; + smallerEq(MathJsChainy: MathType): MathJsChain; /** * Test whether two values are unequal. - * - * The function tests whether the relative difference between x and y is larger than the configured epsilon. The function cannot + * The function tests whether the relative difference between x and y is larger than the configured epsilon. The function cannot * be used to compare values smaller than approximately 2.22e-16. - * * For matrices, the function is evaluated element wise. In case of complex numbers, x.re must unequal y.re, or x.im must unequal y.im. - * - * Values null and undefined are compared strictly, thus null is unequal with everything except null, and undefined is unequal with - * everying except. undefined. + * Values null and undefined are compared strictly, thus null is unequal with everything except null, and undefined is unequal with + * everything except undefined. */ - unequal(IMathJsChainy: MathType): IMathJsChain; + unequal(MathJsChainy: MathType): MathJsChain; /** - * Compute the maximum value of a matrix or a list with values. In case of a multi dimensional array, the maximum of the flattened + * Compute the maximum value of a matrix or a list with values. In case of a multi dimensional array, the maximum of the flattened * array will be calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. */ - max(dim?: number): IMathJsChain; + max(dim?: number): MathJsChain; /** - * Compute the mean value of matrix or a list with values. In case of a multi dimensional array, the mean of the flattened array will be + * Compute the mean value of matrix or a list with values. In case of a multi dimensional array, the mean of the flattened array will be * calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. */ - mean(dim?: number): IMathJsChain; + mean(dim?: number): MathJsChain; /** - * Compute the median of a matrix or a list with values. The values are sorted and the middle value is returned. In case of an + * Compute the median of a matrix or a list with values. The values are sorted and the middle value is returned. In case of an * even number of values, the average of the two middle values is returned. Supported types of values are: Number, BigNumber, Unit - * * In case of a (multi dimensional) array or matrix, the median of all elements will be calculated. */ - median(): IMathJsChain; + median(): MathJsChain; /** - * Compute the maximum value of a matrix or a list of values. In case of a multi dimensional array, the maximum of the flattened + * Compute the maximum value of a matrix or a list of values. In case of a multi dimensional array, the maximum of the flattened * array will be calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. */ - min(dim?: number): IMathJsChain; + min(dim?: number): MathJsChain; /** * Computes the mode of a set of numbers or a list with values(numbers or characters). If there are more than one modes, it returns a list of those values. */ - mode(): IMathJsChain; + mode(): MathJsChain; /** * Compute the product of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the sum of all elements will be calculated. */ - prod(): IMathJsChain; + prod(): MathJsChain; /** - * Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. + * Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. * Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber - * * In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated. */ - quantileSeq(prob: Number|BigNumber|MathArray, sorted?: boolean): IMathJsChain; + quantileSeq(prob: number|BigNumber|MathArray, sorted?: boolean): MathJsChain; /** - * Compute the standard deviation of a matrix or a list with values. The standard deviations is defined as the square root of the - * variance: std(A) = sqrt(var(A)). In case of a (multi dimensional) array or matrix, the standard deviation over all elements will + * Compute the standard deviation of a matrix or a list with values. The standard deviations is defined as the square root of the + * variance: std(A) = sqrt(var(A)). In case of a (multi dimensional) array or matrix, the standard deviation over all elements will * be calculated. - * - * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the following + * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the following * values: - * * 'unbiased' (default) The sum of squared errors is divided by (n - 1) * 'uncorrected' The sum of squared errors is divided by n * 'biased' The sum of squared errors is divided by (n + 1) */ - std(normalization?: string): IMathJsChain; + std(normalization?: string): MathJsChain; /** * Compute the sum of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the sum of all elements will be calculated. */ - sum(): IMathJsChain; + sum(): MathJsChain; /** - * Compute the variance of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the variance over all + * Compute the variance of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the variance over all * elements will be calculated. - * - * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the + * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the * following values: - * * 'unbiased' (default) The sum of squared errors is divided by (n - 1) * 'uncorrected' The sum of squared errors is divided by n * 'biased' The sum of squared errors is divided by (n + 1) - * Note that older browser may not like the variable name var. In that case, the function can be called as math['var'](...) + * Note that older browser may not like the variable name var. In that case, the function can be called as math['var'](...) * instead of math.var(...). */ - var(normalization?: string): IMathJsChain; + var(normalization?: string): MathJsChain; /** * Calculate the inverse cosine of a value. For matrices, the function is evaluated element wise. */ - acos(): IMathJsChain; + acos(): MathJsChain; /** * Calculate the hyperbolic arccos of a value, defined as acosh(x) = ln(sqrt(x^2 - 1) + x). * For matrices, the function is evaluated element wise. */ - acosh(): IMathJsChain; + acosh(): MathJsChain; /** * Calculate the inverse cotangent of a value. For matrices, the function is evaluated element wise. */ - acot(): IMathJsChain; + acot(): MathJsChain; /** * Calculate the hyperbolic arccotangent of a value, defined as acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2. * For matrices, the function is evaluated element wise. */ - acoth(): IMathJsChain; + acoth(): MathJsChain; /** * Calculate the inverse cosecant of a value. For matrices, the function is evaluated element wise. */ - acsc(): IMathJsChain; + acsc(): MathJsChain; /** * Calculate the hyperbolic arccosecant of a value, defined as acsch(x) = ln(1/x + sqrt(1/x^2 + 1)). * For matrices, the function is evaluated element wise. */ - acsch(): IMathJsChain; + acsch(): MathJsChain; /** * Calculate the inverse secant of a value. For matrices, the function is evaluated element wise. */ - asec(): IMathJsChain; + asec(): MathJsChain; /** * Calculate the hyperbolic arcsecant of a value, defined as asech(x) = ln(sqrt(1/x^2 - 1) + 1/x). For matrices, the function is evaluated element wise. */ - asech(): IMathJsChain; + asech(): MathJsChain; - /** + /** * Calculate the inverse sine of a value. For matrices, the function is evaluated element wise. */ - asin(): IMathJsChain; + asin(): MathJsChain; /** * Calculate the hyperbolic arcsine of a value, defined as asinh(x) = ln(x + sqrt(x^2 + 1)). For matrices, the function is evaluated element wise. */ - asinh(): IMathJsChain; + asinh(): MathJsChain; /** * Calculate the inverse tangent of a value. For matrices, the function is evaluated element wise. */ - atan(): IMathJsChain; + atan(): MathJsChain; /** - * Calculate the inverse tangent function with two arguments, y/x. By providing two arguments, the right quadrant of the + * Calculate the inverse tangent function with two arguments, y/x. By providing two arguments, the right quadrant of the * computed angle can be determined. - * * For matrices, the function is evaluated element wise. */ - atan2(x: number): IMathJsChain; - atan2(x: MathArray|Matrix): IMathJsChain; + atan2(x: number|MathArray|Matrix): MathJsChain; /** * Calculate the hyperbolic arctangent of a value, defined as atanh(x) = ln((1 + x)/(1 - x)) / 2. * For matrices, the function is evaluated element wise. */ - atanh(): IMathJsChain; + atanh(): MathJsChain; /** * Calculate the cosine of a value. For matrices, the function is evaluated element wise. */ - asin(): IMathJsChain; + asin(): MathJsChain; // tslint:disable-line adjacent-overload-signatures /** * Calculate the hyperbolic cosine of a value, defined as cosh(x) = 1/2 * (exp(x) + exp(-x)). For matrices, the function is evaluated element wise. */ - cosh(): IMathJsChain; + cosh(): MathJsChain; /** * Calculate the cotangent of a value. cot(x) is defined as 1 / tan(x). For matrices, the function is evaluated element wise. */ - cot(): IMathJsChain; + cot(): MathJsChain; /** * Calculate the hyperbolic cotangent of a value, defined as coth(x) = 1 / tanh(x). For matrices, the function is evaluated element wise. */ - coth(): IMathJsChain; + coth(): MathJsChain; /** * Calculate the cosecant of a value, defined as csc(x) = 1/sin(x). For matrices, the function is evaluated element wise. */ - csc(): IMathJsChain; + csc(): MathJsChain; /** * Calculate the hyperbolic cosecant of a value, defined as csch(x) = 1 / sinh(x). For matrices, the function is evaluated element wise. */ - csch(): IMathJsChain; + csch(): MathJsChain; /** * Calculate the secant of a value, defined as sec(x) = 1/cos(x). For matrices, the function is evaluated element wise. */ - sec(): IMathJsChain; + sec(): MathJsChain; /** * Calculate the hyperbolic secant of a value, defined as sech(x) = 1 / cosh(x). For matrices, the function is evaluated element wise. */ - sech(): IMathJsChain; + sech(): MathJsChain; /** * Calculate the sine of a value. For matrices, the function is evaluated element wise. */ - sin(): IMathJsChain; + sin(): MathJsChain; /** * Calculate the hyperbolic sine of a value, defined as sinh(x) = 1/2 * (exp(x) - exp(-x)). For matrices, the function is evaluated element wise. */ - sinh(): IMathJsChain; + sinh(): MathJsChain; /** * Calculate the tangent of a value. tan(x) is equal to sin(x) / cos(x). For matrices, the function is evaluated element wise. */ - tan(): IMathJsChain; + tan(): MathJsChain; /** * Calculate the hyperbolic tangent of a value, defined as tanh(x) = (exp(2 * x) - 1) / (exp(2 * x) + 1). For matrices, the function is evaluated element wise. */ - tanh(): IMathJsChain; + tanh(): MathJsChain; /** * Change the unit of a value. For matrices, the function is evaluated element wise. * @param x The unit to be converted. * @param unit New unit. Can be a string like "cm" or a unit without value. */ - to(unit: Unit|string): IMathJsChain; + to(unit: Unit|string): MathJsChain; /** * Clone an object. */ - clone(): IMathJsChain; + clone(): MathJsChain; /** * Filter the items in an array or one dimensional matrix. * @param x A one dimensional matrix or array to filter - * @param test + * @param test */ - filter(test: RegExp|((item: any)=>boolean)): IMathJsChain; + filter(test: RegExp|((item: any) => boolean)): MathJsChain; /** * Format a value of any type into a string. */ - format(options?: IFormatOptions|number|((item: any)=>string)): IMathJsChain; + format(options?: FormatOptions|number|((item: any) => string)): MathJsChain; /** * Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array. * @param callback The callback method is invoked with three parameters: the value of the element, the index of the element, and the matrix being traversed. */ - map(callback: (item: any)=>any): IMathJsChain; + map(callback: (item: any) => any): MathJsChain; /** * Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect. @@ -2302,13 +2220,13 @@ declare namespace mathjs { * @param compare An optional comparator function. The function is called as compare(a, b), and must return 1 when a > b, -1 when a < b, and 0 when a == b. Default value: 'asc'. * @returns Returns the kth lowest value. */ - partitionSelect(k: number, compare?: string|((a: any, b: any)=>number)): IMathJsChain; + partitionSelect(k: number, compare?: string|((a: any, b: any) => number)): MathJsChain; /** * Sort the items in a matrix. * @param compare An optional comparator function. The function is called as compare(a, b), and must return 1 when a > b, -1 when a < b, and 0 when a == b. Default value: 'asc'. */ - sort(compare?: string|((a: any, b: any)=>number)): IMathJsChain; + sort(compare?: string|((a: any, b: any) => number)): MathJsChain; done(): any; valueOf(): any; diff --git a/types/mathjs/mathjs-tests.ts b/types/mathjs/mathjs-tests.ts index 64e5e0673b..306ab44ccd 100644 --- a/types/mathjs/mathjs-tests.ts +++ b/types/mathjs/mathjs-tests.ts @@ -1,17 +1,14 @@ - - - /* Basic usage examples */ -(function(){ +{ // functions and constants math.round(math.e, 3); // 2.718 math.atan2(3, -3) / math.pi; // 0.75 math.log(10000, 10); // 4 math.sqrt(-4); // 2i math.pow([[-1, 2], [3, 1]], 2); // [[7, 0], [0, 7]] - var angle = 0.2; + const angle = 0.2; math.add(math.pow(math.sin(angle), 2), math.pow(math.cos(angle), 2)); // returns number ~1 // expressions @@ -22,7 +19,7 @@ Basic usage examples math.eval('det([-1, 2; 3, 1])'); // -7 // chained operations - var a = math.chain(3) + const a = math.chain(3) .add(4) .multiply(2) .done(); // 14 @@ -33,18 +30,17 @@ Basic usage examples math.multiply(math.unit('5 mm'), 3); // Unit * number, 15 mm math.subtract([2, 3, 4], 5); // Array - number, [-3, -2, -1] math.add(math.matrix([2, 3]), [4, 5]); // Matrix + Array, [6, 8] -}()); - +} /* Bignumbers examples */ -(function() { +{ // configure the default type of numbers as BigNumbers math.config({ - number: 'bignumber', // Default type of number: - // 'number' (default), 'bignumber', or 'fraction' - precision: 20 // Number of significant digits for BigNumbers + number: 'bignumber', // Default type of number: + // 'number' (default), 'bignumber', or 'fraction' + precision: 20 // Number of significant digits for BigNumbers }); console.log('round-off errors with numbers'); @@ -68,23 +64,21 @@ Bignumbers examples math.eval('0.1 + 0.2'); // BigNumber, 0.3 math.eval('0.3 / 0.2'); // BigNumber, 1.5 console.log(); -}()); - - +} /* Chaining examples */ -(function() { +{ // create a chained operation using the function `chain(value)` // end a chain using done(). Let's calculate (3 + 4) * 2 - var a = math.chain(3) + const a = math.chain(3) .add(4) .multiply(2) .done(); // 14 // Another example, calculate square(sin(pi / 4)) - var b = math.chain(math.pi) + const b = math.chain(math.pi) .divide(4) .sin() .square() @@ -94,46 +88,44 @@ Chaining examples // these are demonstrated in the following examples // toString will return a string representation of the chain's value - var chain = math.chain(2).divide(3); - var str = chain.toString(); // "0.6666666666666666" + const chain = math.chain(2).divide(3); + const str = chain.toString(); // "0.6666666666666666" // a chain has a function .valueOf(), which returns the value hold by the chain. // This allows using it in regular operations. The function valueOf() acts the // same as function done(). chain.valueOf(); // 0.66666666666667 - // the function subset can be used to get or replace sub matrices - var array = [[1, 2], [3, 4]]; - var v = math.chain(array) + const array = [[1, 2], [3, 4]]; + const v = math.chain(array) .subset(math.index(1, 0)) .done(); // 3 - var m = math.chain(array) + const m = math.chain(array) .subset(math.index(0, 0), 8) .multiply(3) .done(); // [[24, 6], [9, 12]] -}()); - +} /* Complex numbers examples */ -(function(){ - var a = math.complex(2, 3); // 2 + 3i +{ + const a = math.complex(2, 3); // 2 + 3i // read the real and complex parts of the complex number a.re; // 2 a.im; // 3 // clone a complex value - var clone = a.clone(); // 2 + 3i + const clone = a.clone(); // 2 + 3i // adjust the complex value a.re = 5; // 5 + 3i // create a complex number by providing a string with real and complex parts - var b = math.complex('3 - 7i'); // 3 - 7i + const b = math.complex('3 - 7i'); // 3 - 7i console.log(); // perform operations with complex numbers @@ -148,18 +140,17 @@ Complex numbers examples // create a complex number from polar coordinates console.log('create complex numbers with polar coordinates'); - var c = math.complex({r: math.sqrt(2), phi: math.pi / 4}); // 1 + i + const c = math.complex({r: math.sqrt(2), phi: math.pi / 4}); // 1 + i // get polar coordinates of a complex number - var d = math.complex(3, 4); + const d = math.complex(3, 4); d.toPolar(); // { r: 5, phi: 0.9272952180016122 } -}()); - +} /* Expressions examples */ -(function() { +{ // 1. using the function math.eval // // Function `eval` accepts a single expression or an array with @@ -179,16 +170,16 @@ Expressions examples // evaluate multiple expressions at once console.log('\nevaluate multiple expressions at once'); math.eval([ - 'f = 3', - 'g = 4', - 'f * g' - ]); // [3, 4, 12] + 'f = 3', + 'g = 4', + 'f * g' + ]); // [3, 4, 12] // provide a scope (just a regular JavaScript Object) console.log('\nevaluate expressions providing a scope with variables and functions'); - var scope: any = { - a: 3, - b: 4 + let scope: any = { + a: 3, + b: 4, }; // variables can be read from the scope @@ -199,18 +190,16 @@ Expressions examples scope.c; // 6.8 // scope can contain both variables and functions - scope["hello"] = function (name: string) { - return 'hello, ' + name + '!'; + scope["hello"] = function(name: string) { + return `hello, ${name}!`; }; math.eval('hello("hero")', scope); // "hello, hero!" // define a function as an expression - var f = math.eval('f(x) = x ^ a', scope); + let f = math.eval('f(x) = x ^ a', scope); f(2); // 8 scope.f(2); // 8 - - // 2. using function math.parse // // Function `math.parse` parses expressions into a node tree. The syntax is @@ -224,7 +213,7 @@ Expressions examples // parse an expression console.log('\nparse an expression into a node tree'); - var node1 = math.parse('sqrt(3^2 + 4^2)'); + const node1 = math.parse('sqrt(3^2 + 4^2)'); node1.toString(); // "sqrt((3 ^ 2) + (4 ^ 2))" // compile and evaluate the compiled code @@ -233,12 +222,12 @@ Expressions examples // provide a scope console.log('\nprovide a scope'); - var node2 = math.parse('x^a'); - var code2 = node2.compile(); + const node2 = math.parse('x^a'); + let code2 = node2.compile(); node2.toString(); // "x ^ a" - var scope: any = { - x: 3, - a: 2 + scope = { + x: 3, + a: 2, }; code2.eval(scope); // 9 @@ -246,7 +235,6 @@ Expressions examples scope.a = 3; code2.eval(scope); // 27 - // 3. using function math.compile // // Function `math.compile` compiles expressions into a node tree. The syntax is @@ -260,21 +248,18 @@ Expressions examples // parse an expression console.log('\ncompile an expression'); - var code3 = math.compile('sqrt(3^2 + 4^2)'); + const code3 = math.compile('sqrt(3^2 + 4^2)'); // evaluate the compiled code code3.eval(); // 5 // provide a scope for the variable assignment console.log('\nprovide a scope'); - var code2 = math.compile('a = a + 3'); - var scope: any = { - a: 7 - }; + code2 = math.compile('a = a + 3'); + scope = { a: 7 }; code2.eval(scope); scope.a; // 10 - // 4. using a parser // // In addition to the static functions `math.eval` and `math.parse`, math.js @@ -282,7 +267,7 @@ Expressions examples // keeps a scope with assigned variables in memory. The parser also contains // some convenience methods to get, set, and remove variables from memory. console.log('\n4. USING A PARSER'); - var parser = math.parser(); + const parser = math.parser(); // evaluate with parser console.log('\nevaluate expressions'); @@ -313,29 +298,28 @@ Expressions examples // get and set variables and functions console.log('\nget and set variables and function in the scope of the parser'); - var x = parser.get('x'); + const x = parser.get('x'); console.log('x =', x); // x = 7 - var f = parser.get('f'); + f = parser.get('f'); console.log('f =', math.format(f)); // f = f(x, y) - var g = f(3, 3); + const g = f(3, 3); console.log('g =', g); // g = 27 parser.set('h', 500); parser.eval('h / 2'); // 250 - parser.set('hello', function (name: string) { - return 'hello, ' + name + '!'; + parser.set('hello', function(name: string) { + return `hello, ${name}!`; }); parser.eval('hello("hero")'); // "hello, hero!" // clear defined functions and variables parser.clear(); -}()); - +} /* Fractions examples */ -(function(){ +{ // configure the default type of numbers as Fractions math.config({ number: 'fraction' // Default type of number: @@ -377,65 +361,64 @@ Fractions examples // output formatting console.log('output formatting of fractions'); - var a = math.fraction('2/3'); + const a = math.fraction('2/3'); console.log(math.format(a)); // Fraction, 2/3 console.log(math.format(a, {fraction: 'ratio'})); // Fraction, 2/3 console.log(math.format(a, {fraction: 'decimal'})); // Fraction, 0.(6) console.log(a.toString()); // Fraction, 0.(6) console.log(); -}()); +} /* Matrices examples */ -(function() { +{ // create matrices and arrays. a matrix is just a wrapper around an Array, // providing some handy utilities. console.log('create a matrix'); - var a = math.matrix([1, 4, 9, 16, 25]); // [1, 4, 9, 16, 25] - var b = math.matrix(math.ones([2, 3])); // [[1, 1, 1], [1, 1, 1]] + const a = math.matrix([1, 4, 9, 16, 25]); // [1, 4, 9, 16, 25] + const b = math.matrix(math.ones([2, 3])); // [[1, 1, 1], [1, 1, 1]] b.size(); // [2, 3] // the Array data of a Matrix can be retrieved using valueOf() - var array = a.valueOf(); // [1, 4, 9, 16, 25] + const array = a.valueOf(); // [1, 4, 9, 16, 25] // Matrices can be cloned - var clone = a.clone(); // [1, 4, 9, 16, 25] + const clone = a.clone(); // [1, 4, 9, 16, 25] console.log(); // perform operations with matrices console.log('perform operations'); math.sqrt(a); // [1, 2, 3, 4, 5] - var c = [1, 2, 3, 4, 5]; + const c = [1, 2, 3, 4, 5]; math.factorial(c); // [1, 2, 6, 24, 120] console.log(); // create and manipulate matrices. Arrays and Matrices can be used mixed. console.log('manipulate matrices'); - var d = [[1, 2], [3, 4]]; // [[1, 2], [3, 4]] - var e = math.matrix([[5, 6], [1, 1]]); // [[5, 6], [1, 1]] + const d = [[1, 2], [3, 4]]; // [[1, 2], [3, 4]] + const e = math.matrix([[5, 6], [1, 1]]); // [[5, 6], [1, 1]] // set a submatrix. // Matrix indexes are zero-based. e.subset(math.index(1, [0, 1]), [[7, 8]]); // [[5, 6], [7, 8]] - var f = math.multiply(d, e); // [[19, 22], [43, 50]] - var g = f.subset(math.index(1, 0)); // 43 + const f = math.multiply(d, e); // [[19, 22], [43, 50]] + const g = f.subset(math.index(1, 0)); // 43 console.log(); // get a sub matrix // Matrix indexes are zero-based. console.log('get a sub matrix'); - var h = math.diag(math.range(1,4)); // [[1, 0, 0], [0, 2, 0], [0, 0, 3]] - h.subset( math.index([1, 2], [1, 2])); // [[2, 0], [0, 3]] - var i = math.range(1,6); // [1, 2, 3, 4, 5] - i.subset(math.index(math.range(1,4))); // [2, 3, 4] + const h = math.diag(math.range(1, 4)); // [[1, 0, 0], [0, 2, 0], [0, 0, 3]] + h.subset(math.index([1, 2], [1, 2])); // [[2, 0], [0, 3]] + const i = math.range(1, 6); // [1, 2, 3, 4, 5] + i.subset(math.index(math.range(1, 4))); // [2, 3, 4] console.log(); - // resize a multi dimensional matrix console.log('resizing a matrix'); - var j = math.matrix(); - var defaultValue = 0; + const j = math.matrix(); + let defaultValue = 0; j.resize([2, 2, 2], defaultValue); // [[[0, 0], [0, 0]], [[0, 0], [0, 0]]] j.size(); // [2, 2, 2] j.resize([2, 2]); // [[0, 0], [0, 0]] @@ -445,12 +428,12 @@ Matrices examples // setting a value outside the matrices range will resize the matrix. // new elements will be initialized with zero. console.log('set a value outside a matrices range'); - var k = math.matrix(); + const k = math.matrix(); k.subset(math.index(2), 6); // [0, 0, 6] console.log(); console.log('set a value outside a matrices range, leaving new entries uninitialized'); - var m = math.matrix(); + const m = math.matrix(); defaultValue = math.uninitialized; m.subset(math.index(2), 6, defaultValue); // [undefined, undefined, 6] console.log(); @@ -462,38 +445,38 @@ Matrices examples math.range('2:-1:-3'); // [2, 1, 0, -1, -2] math.factorial(math.range('1:6')); // [1, 2, 6, 24, 120] console.log(); -}()); +} /* Sparse matrices examples */ -(function() { +{ // create a sparse matrix console.log('creating a 1000x1000 sparse matrix...'); - var a = math.eye(1000, 1000, 'sparse'); + const a = math.eye(1000, 1000, 'sparse'); // do operations with a sparse matrix console.log('doing some operations on the sparse matrix...'); - var b = math.multiply(a, a); - var c = math.multiply(b, math.complex(2, 2)); - var d = math.transpose(c); - var e = math.multiply(d, a); + const b = math.multiply(a, a); + const c = math.multiply(b, math.complex(2, 2)); + const d = math.transpose(c); + const e = math.multiply(d, a); // we will not print the output, but doing the same operations // with a dense matrix are very slow, try it for yourself. console.log('already done'); console.log('now try this with a dense matrix :)'); -}()); +} /* Units examples */ -(function() { +{ // units can be created by providing a value and unit name, or by providing // a string with a valued unit. console.log('create units'); - var a = math.unit(45, 'cm'); // 450 mm - var b = math.unit('0.1m'); // 100 mm + const a = math.unit(45, 'cm'); // 450 mm + const b = math.unit('0.1m'); // 100 mm console.log(); // creating units @@ -509,7 +492,7 @@ Units examples aliases: ['knots', 'kt', 'kts'], prefixes: 'long' }, {override: true}); - math.createUnit( { + math.createUnit({ foo: { prefixes: 'long' }, @@ -561,10 +544,10 @@ Units examples // example engineering calculations console.log('compute molar volume of ideal gas at 65 Fahrenheit, 14.7 psi in L/mol'); - var Rg = math.unit('8.314 N m / (mol K)'); - var T = math.unit('65 degF'); - var P = math.unit('14.7 psi'); - var v = math.divide(math.multiply(Rg, T), P); + const Rg = math.unit('8.314 N m / (mol K)'); + const T = math.unit('65 degF'); + const P = math.unit('14.7 psi'); + const v = math.divide(math.multiply(Rg, T), P); console.log('gas constant (Rg) = ', format(Rg)); console.log('P = ' + format(P)); console.log('T = ' + format(T)); @@ -572,100 +555,74 @@ Units examples console.log(); console.log('compute speed of fluid flowing out of hole in a container'); - var g = math.unit('9.81 m / s^2'); - var h = math.unit('1 m'); - var v2 = math.pow(math.multiply(2, math.multiply(g, h)), 0.5); // Can also use math.sqrt + const g = math.unit('9.81 m / s^2'); + const h = math.unit('1 m'); + const v2 = math.pow(math.multiply(2, math.multiply(g, h)), 0.5); // Can also use math.sqrt console.log('g = ' + format(g)); console.log('h = ' + format(h)); console.log('v = (2 g h) ^ 0.5 = ' + format(v2)); // 4.429... m / s console.log(); console.log('electrical power consumption:'); - var expr = '460 V * 20 A * 30 days to kWh'; - console.log(expr + ' = ' + math.eval(expr)); // 6624 kWh + let expr = '460 V * 20 A * 30 days to kWh'; + console.log(`${expr} = ${math.eval(expr)}`); // 6624 kWh console.log(); console.log('circuit design:'); - var expr = '24 V / (6 mA)'; - console.log(expr + ' = ' + math.eval(expr)); // 4 kohm + expr = '24 V / (6 mA)'; + console.log(`${expr} = ${math.eval(expr)}`); // 4 kohm console.log(); console.log('operations on arrays:'); - var B = math.eval('[1, 0, 0] T'); - var v3 = math.eval('[0, 1, 0] m/s'); - var q = math.eval('1 C'); - var F = math.multiply(q, math.cross(v3, B)); + const B = math.eval('[1, 0, 0] T'); + const v3 = math.eval('[0, 1, 0] m/s'); + const q = math.eval('1 C'); + const F = math.multiply(q, math.cross(v3, B)); console.log('B (magnetic field strength) = ' + format(B)); // [1 T, 0 T, 0 T] console.log('v (particle velocity) = ' + format(v3)); // [0 m / s, 1 m / s, 0 m / s] console.log('q (particle charge) = ' + format(q)); // 1 C console.log('F (force) = q (v cross B) = ' + format(F)); // [0 N, 0 N, -1 N] /** - * Helper function to format an output a value. - * @param {*} value - * @return {string} Returns the formatted value - */ - function format (value: any): string { - var precision = 14; + * Helper function to format an output a value. + * @return Returns the formatted value + */ + function format(value: any): string { + const precision = 14; return math.format(value, precision); } -}()); - +} /* Expression tree examples */ -(function(){ +{ + // Filter an expression tree + console.log('Filter all symbol nodes "x" in the expression "x^2 + x/4 + 3*y"'); + const node = math.parse('x^2 + x/4 + 3*y'); + const filtered = node.filter(function(node) { + return node.isSymbolNode && node.name === 'x'; + }); + // returns an array with two entries: two SymbolNodes 'x' - // Filter an expression tree -console.log('Filter all symbol nodes "x" in the expression "x^2 + x/4 + 3*y"'); -var node = math.parse('x^2 + x/4 + 3*y'); -var filtered = node.filter(function (node) { - return node.isSymbolNode && node.name == 'x'; -}); -// returns an array with two entries: two SymbolNodes 'x' + filtered.forEach(function(node) { + console.log(node.type, node.toString()); + }); + // outputs: + // SymbolNode x + // SymbolNode x -filtered.forEach(function (node) { - console.log(node.type, node.toString()) -}); -// outputs: -// SymbolNode x -// SymbolNode x - - -// Traverse an expression tree -console.log(); -console.log('Traverse the expression tree of expression "3 * x + 2"'); -var node1 = math.parse('3 * x + 2'); -node1.traverse(function (node, path, parent) { - switch (node.type) { - // case 'OperatorNode': console.log(node.type, node.op); break; - case 'OperatorNode': console.log(node.type); break;//for now removing .op - case 'ConstantNode': console.log(node.type, node.value); break; - case 'SymbolNode': console.log(node.type, node.name); break; - default: console.log(node.type); - } -}); -// outputs: -// OperatorNode + -// OperatorNode * -// ConstantNode 3 -// SymbolNode x -// ConstantNode 2 - - -// transform an expression tree -// console.log(); -// console.log('Replace all symbol nodes "x" in expression "x^2 + 5*x" with a constant 3'); -// var node2 = math.parse('x^2 + 5*x'); -// var transformed = node2.transform(function (node, path, parent) { -// if (node.isSymbolNode && node.name == 'x') { -// return new math.expression.node.ConstantNode(3); -// } -// else { -// return node; -// } -// }); -// console.log(transformed.toString()); -// outputs: '(3 ^ 2) + (5 * 3)' -}()); + // Traverse an expression tree + console.log(); + console.log('Traverse the expression tree of expression "3 * x + 2"'); + const node1 = math.parse('3 * x + 2'); + node1.traverse(function(node, path, parent) { + switch (node.type) { + // case 'OperatorNode': console.log(node.type, node.op); break; + case 'OperatorNode': console.log(node.type); break; // for now removing .op + case 'ConstantNode': console.log(node.type, node.value); break; + case 'SymbolNode': console.log(node.type, node.name); break; + default: console.log(node.type); + } + }); +} diff --git a/types/mathjs/tslint.json b/types/mathjs/tslint.json index a41bf5d19a..c2e987daf6 100644 --- a/types/mathjs/tslint.json +++ b/types/mathjs/tslint.json @@ -1,79 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "only-arrow-functions": false } } From 57238f66d8325ca3051ae5b0bead4cfac8fab596 Mon Sep 17 00:00:00 2001 From: Eric Kirkham Date: Mon, 9 Apr 2018 16:40:08 -0700 Subject: [PATCH 0563/2153] add default value --- types/react-native/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 84b7032562..c3ba83c70c 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -1093,7 +1093,7 @@ export interface TextInputProperties blurOnSubmit?: boolean; /** - * If true, the caret is hidden + * If true, caret is hidden. The default value is false. */ caretHidden?: boolean From dc5668557c0566a74e3a6116bd71d0f623001343 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Tue, 10 Apr 2018 12:09:24 +0200 Subject: [PATCH 0564/2153] Avoid error with XMLHttpRequest = originalXMLHttpRequest || XMLHttpRequest --- types/react-native/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index c3ba83c70c..96526fcd9b 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -8792,7 +8792,7 @@ declare global { * * @see https://github.com/facebook/react-native/issues/934 */ - var originalXMLHttpRequest: Object; + var originalXMLHttpRequest: any; var __BUNDLE_START_TIME__: number; var ErrorUtils: ErrorUtils; From 7780641c37711014764a599dc4f6a08cd0ec6824 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vilim=20Stubi=C4=8Dan?= Date: Tue, 10 Apr 2018 19:13:33 +0200 Subject: [PATCH 0565/2153] type definitions for axon (#24877) --- types/axon/axon-tests.ts | 173 +++++++++++++++++++++++++++++++++++++++ types/axon/index.d.ts | 134 ++++++++++++++++++++++++++++++ types/axon/tsconfig.json | 23 ++++++ types/axon/tslint.json | 1 + 4 files changed, 331 insertions(+) create mode 100644 types/axon/axon-tests.ts create mode 100644 types/axon/index.d.ts create mode 100644 types/axon/tsconfig.json create mode 100644 types/axon/tslint.json diff --git a/types/axon/axon-tests.ts b/types/axon/axon-tests.ts new file mode 100644 index 0000000000..a7f2a95a87 --- /dev/null +++ b/types/axon/axon-tests.ts @@ -0,0 +1,173 @@ +import * as axon from 'axon'; +import { Socket as NetSocket } from 'net'; + +const PubEmitterSocket = axon.PubEmitterSocket; +const PubSocket = axon.PubSocket; +const RepSocket = axon.RepSocket; +const ReqSocket = axon.ReqSocket; +const Socket = axon.Socket; +const SubSocket = axon.SubSocket; + +const pubSocket = new PubSocket(); +const pubEmitterSocket = new PubEmitterSocket(); +const repSocket = new RepSocket(); +const reqSocket = new ReqSocket(); +const netSocket = new NetSocket(); +const socket = new Socket(); +const subSocket = new SubSocket(); + +// $ExpectType PubSocket +pubSocket.send('anything'); + +// $ExpectType PubSocket +pubSocket.send('anything', {w: 100, h: 200}); + +// $ExpectType PubSocket +pubEmitterSocket.send('anything'); + +// $ExpectType PubSocket +pubEmitterSocket.send('anything', {w: 100, h: 200}); + +// $ExpectType Socket +pubEmitterSocket.bind(3000); + +// $ExpectError +pubEmitterSocket.bind({a, b, c}); + +// $ExpectError +pubEmitterSocket.bind(); + +// $ExpectType Socket +pubEmitterSocket.connect(3000); + +// $ExpectError +pubEmitterSocket.connect({a, b, c}); + +// $ExpectError +pubEmitterSocket.connect(); + +// $ExpectType (args: Buffer | Buffer[]) => void +repSocket.onmessage(netSocket); + +// $ExpectError +repSocket.onmessage(); + +// $ExpectError +repSocket.onmessage(''); + +// $ExpectError +repSocket.onmessage(1); + +// $ExpectError +repSocket.onmessage({}); + +// $ExpectType string +reqSocket.id(); + +// $ExpectType (args: Buffer | Buffer[]) => void +reqSocket.onmessage(); + +// $ExpectType void +reqSocket.send('anything'); + +// $ExpectType void +reqSocket.send('anything', {w: 100, h: 200}); + +// $ExpectType Socket +socket.set('name', 'aaa'); + +// $ExpectError +socket.set(1, 'aaa'); + +// $ExpectError +socket.set({}, 'aaa'); + +// $ExpectError +socket.set('name'); + +// $ExpectType any +socket.get('name'); + +// $ExpectError +socket.get(1); + +// $ExpectError +socket.get({}); + +// $ExpectType Socket +socket.enable('name'); + +// $ExpectError +socket.enable(1); + +// $ExpectError +socket.enable({}); + +// $ExpectType Socket +socket.disable('name'); + +// $ExpectError +socket.disable(1); + +// $ExpectError +socket.disable({}); + +// $ExpectType boolean +socket.enabled('name'); + +// $ExpectError +socket.enabled(1); + +// $ExpectError +socket.enabled({}); + +// $ExpectType boolean +socket.disabled('name'); + +// $ExpectError +socket.disabled(1); + +// $ExpectError +socket.disabled({}); + +// $ExpectType boolean +subSocket.hasSubscriptions(); + +// $ExpectType boolean +subSocket.matches('name'); + +// $ExpectError +subSocket.matches(1); + +// $ExpectError +subSocket.matches({}); + +// $ExpectType RegExp +subSocket.subscribe(/some regex/); + +// $ExpectType RegExp +subSocket.subscribe('some string'); + +// $ExpectError +subSocket.subscribe(1); + +// $ExpectError +subSocket.subscribe({}); + +// $ExpectError +subSocket.subscribe(); + +// $ExpectType void +subSocket.unsubscribe(/some regex/); + +// $ExpectType void +subSocket.unsubscribe('some string'); + +// $ExpectError +subSocket.unsubscribe(1); + +// $ExpectError +subSocket.unsubscribe({}); + +// $ExpectError +subSocket.unsubscribe(); diff --git a/types/axon/index.d.ts b/types/axon/index.d.ts new file mode 100644 index 0000000000..2449b83eb4 --- /dev/null +++ b/types/axon/index.d.ts @@ -0,0 +1,134 @@ +// Type definitions for axon 2.0 +// Project: https://github.com/visionmedia/axon#readme +// Definitions by: Vilim Stubičan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +import { EventEmitter } from "events"; +import { Socket as NetSocket } from "net"; + +export class Socket extends EventEmitter { + set(name: string, val: any): Socket; + + get(name: string): any; + + enable(name: string): Socket; + + disable(name: string): Socket; + + enabled(name: string): boolean; + + disabled(name: string): boolean; + + use(plugin: (socket: Socket) => any): Socket; + + pack(args: Buffer | Buffer[]): Buffer; + + closeSockets(): void; + + close(): void; + + closeServer(fn: () => any): void; + + address(): { port: number; family: string; address: string; string: string } | undefined; + + removeSocket(sock: Socket): void; + + addSocket(sock: Socket): void; + + handleErrors(sock: Socket): void; + + onmessage(sock: NetSocket): (args: Buffer | Buffer[]) => void; + + connect(port: ConnectionPort, host?: string | (() => void), fn?: () => void): Socket; + + onconnect(sock: Socket): void; + + bind(port: ConnectionPort, host?: string | (() => void), fn?: () => void): Socket; +} + +export class SubSocket extends Socket { + hasSubscriptions(): boolean; + + matches(topic: string): boolean; + + onmessage(sock: NetSocket): (args: Buffer | Buffer[]) => void; + + subscribe(re: RegExp | string): RegExp; + + unsubscribe(re: RegExp | string): void; + + clearSubscriptions(): void; + + /** + * @throws {Error} + */ + send(): void; +} + +export class SubEmitterSocket { + onmessage(): (args: Buffer | Buffer[]) => void; + + on(event: string, fn: (...args: any[]) => void): SubEmitterSocket; + + off(event: string): SubEmitterSocket; + + bind(port: ConnectionPort, host?: string | (() => void), fn?: () => void): Socket; + + connect(port: ConnectionPort, host?: string | (() => void), fn?: () => void): Socket; + + close(): void; +} + +export class PubSocket extends Socket { + send(...args: any[]): PubSocket; +} + +export class PubEmitterSocket { + sock: PubSocket; + + send(...args: any[]): PubSocket; + + bind(port: ConnectionPort, host?: string | (() => void), fn?: () => void): Socket; + + connect(port: ConnectionPort, host?: string | (() => void), fn?: () => void): Socket; + + close(): void; +} + +export class PushSocket extends Socket { + send(...args: any[]): void; + enqueue(msg: any): void; +} + +export class ReqSocket extends Socket { + id(): string; + + onmessage(): (args: Buffer | Buffer[]) => void; + + send(...args: any[]): void; +} + +export class RepSocket extends Socket { + onmessage(sock: NetSocket): (args: Buffer | Buffer[]) => void; +} + +export class PullSocket extends Socket { + /** + * @throws {Error} + */ + send(): void; +} + +export type ConnectionPort = + number + | string + | { protocol?: string, hostname?: string, pathname: string, port: string | number }; + +export function socket(type: string, options?: any): Socket; + +export const types: { + [propName: string]: { new(): PubEmitterSocket | SubEmitterSocket | PushSocket | PullSocket | PubSocket | SubSocket | ReqSocket | RepSocket | Socket }; +}; diff --git a/types/axon/tsconfig.json b/types/axon/tsconfig.json new file mode 100644 index 0000000000..2025639930 --- /dev/null +++ b/types/axon/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "axon-tests.ts" + ] +} diff --git a/types/axon/tslint.json b/types/axon/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/axon/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 52ff77428ab551a95601f96f376d01953a84f87b Mon Sep 17 00:00:00 2001 From: noticeMaker <37525090+noticeMaker@users.noreply.github.com> Date: Wed, 11 Apr 2018 01:14:16 +0800 Subject: [PATCH 0566/2153] added new type definition for npm package express-xml-bodyparser v0.3 (#24870) --- .../express-xml-bodyparser-tests.ts | 10 ++++++++ types/express-xml-bodyparser/index.d.ts | 23 +++++++++++++++++++ types/express-xml-bodyparser/tsconfig.json | 23 +++++++++++++++++++ types/express-xml-bodyparser/tslint.json | 1 + 4 files changed, 57 insertions(+) create mode 100644 types/express-xml-bodyparser/express-xml-bodyparser-tests.ts create mode 100644 types/express-xml-bodyparser/index.d.ts create mode 100644 types/express-xml-bodyparser/tsconfig.json create mode 100644 types/express-xml-bodyparser/tslint.json diff --git a/types/express-xml-bodyparser/express-xml-bodyparser-tests.ts b/types/express-xml-bodyparser/express-xml-bodyparser-tests.ts new file mode 100644 index 0000000000..e8deca25e3 --- /dev/null +++ b/types/express-xml-bodyparser/express-xml-bodyparser-tests.ts @@ -0,0 +1,10 @@ +import express = require('express'); +import xmlparser = require('express-xml-bodyparser'); + +const app: express.Express = express(); + +app.use(xmlparser()); + +app.post("/auth", xmlparser({explicitArray: false}), (req, res, next) => { + res.send("Success!"); +}); diff --git a/types/express-xml-bodyparser/index.d.ts b/types/express-xml-bodyparser/index.d.ts new file mode 100644 index 0000000000..1c674d71fb --- /dev/null +++ b/types/express-xml-bodyparser/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for express-xml-bodyparser 0.3 +// Project: https://github.com/macedigital/express-xml-bodyparser +// Definitions by: Notice Maker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Request, Response, NextFunction } from 'express'; + +declare function xmlparser(options?: xmlparser.XmlparserOptions): (req: Request, res: Response, next: NextFunction) => void; + +declare namespace xmlparser { + let regexp: RegExp; + + interface XmlparserOptions { + async?: boolean; + explicitArray?: boolean; + normalize?: boolean; + normalizeTags?: boolean; + trim?: boolean; + } +} + +export = xmlparser; diff --git a/types/express-xml-bodyparser/tsconfig.json b/types/express-xml-bodyparser/tsconfig.json new file mode 100644 index 0000000000..49f0ac53bc --- /dev/null +++ b/types/express-xml-bodyparser/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "express-xml-bodyparser-tests.ts" + ] +} \ No newline at end of file diff --git a/types/express-xml-bodyparser/tslint.json b/types/express-xml-bodyparser/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/express-xml-bodyparser/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file From 74782d2c5087c8801347b5aada6d5b0409ba38b3 Mon Sep 17 00:00:00 2001 From: Janeene Beeforth Date: Wed, 11 Apr 2018 03:14:28 +1000 Subject: [PATCH 0567/2153] [react-bootstrap]: Add missing mountOnEnter prop for TabPane. (#24874) --- types/react-bootstrap/lib/TabPane.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react-bootstrap/lib/TabPane.d.ts b/types/react-bootstrap/lib/TabPane.d.ts index c1ea0cf501..fefe101923 100644 --- a/types/react-bootstrap/lib/TabPane.d.ts +++ b/types/react-bootstrap/lib/TabPane.d.ts @@ -7,6 +7,7 @@ declare namespace TabPane { 'aria-labelledby'?: string; bsClass?: string; eventKey?: any; + mountOnEnter?: boolean; unmountOnExit?: boolean; } } From 8f457e08d0b84143a5c6886eb2ec8738ae78e44c Mon Sep 17 00:00:00 2001 From: RalfNieuwenhuizen Date: Tue, 10 Apr 2018 19:15:04 +0200 Subject: [PATCH 0568/2153] Callback function typings for PushNotificationIOS (#24867) * Callback function typings for PushNotificationIOS Allow the different kind of callback functions for different events in the `PushNotificationIOS` class, according to the specification in https://facebook.github.io/react-native/docs/pushnotificationios.html#addeventlistener * Remove trailing spaces * Fix line length --- types/react-native/index.d.ts | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 96526fcd9b..f7a70b79ac 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -7336,13 +7336,36 @@ export interface PushNotificationIOSStatic { * * The type MUST be 'notification' */ - addEventListener(type: PushNotificationEventName, handler: (notification: PushNotification) => void): void; + addEventListener(type: "notification" | "localNotification", handler: (notification: PushNotification) => void): void; + + /** + * Fired when the user registers for remote notifications. + * + * The handler will be invoked with a hex string representing the deviceToken. + * + * The type MUST be 'register' + */ + addEventListener(type: "register", handler: (deviceToken: string) => void): void; + + /** + * Fired when the user fails to register for remote notifications. + * Typically occurs when APNS is having issues, or the device is a simulator. + * + * The handler will be invoked with {message: string, code: number, details: any}. + * + * The type MUST be 'registrationError' + */ + addEventListener(type: "registrationError", handler: (error: { message: string, code: number, details: any }) => void): void; /** * Removes the event listener. Do this in `componentWillUnmount` to prevent * memory leaks */ - removeEventListener(type: PushNotificationEventName, handler: (notification: PushNotification) => void): void; + removeEventListener(type: PushNotificationEventName, + handler: ((notification: PushNotification) => void) + | ((deviceToken: string) => void) + | ((error: { message: string, code: number, details: any }) => void) + ): void; /** * Requests all notification permissions from iOS, prompting the user's From 5193c7c6eddbba03fe885e61f3d21214c467f79e Mon Sep 17 00:00:00 2001 From: Mohsen Azimi Date: Tue, 10 Apr 2018 10:15:37 -0700 Subject: [PATCH 0569/2153] Add string option for vm.runIn*Context methods in Node.js typing (#24798) * Add string option for vm.runIn*Context methods * Add test * lint --- types/node/index.d.ts | 8 +++++--- types/node/v8/index.d.ts | 6 +++--- types/node/v8/node-tests.ts | 4 ++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 2522d51f54..86080907da 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -20,6 +20,7 @@ // Klaus Meinhardt // Huw // Nicolas Even +// Mohsen Azimi // Hoàng Văn Khải // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -2002,10 +2003,11 @@ declare module "vm" { } export function createContext(sandbox?: Context): Context; export function isContext(sandbox: Context): boolean; - export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions): any; + export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions | string): any; + /** @deprecated */ export function runInDebugContext(code: string): any; - export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions): any; - export function runInThisContext(code: string, options?: RunningScriptOptions): any; + export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any; + export function runInThisContext(code: string, options?: RunningScriptOptions | string): any; } declare module "child_process" { diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index 28bc5dc779..fe36bccd1f 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -1992,10 +1992,10 @@ declare module "vm" { } export function createContext(sandbox?: Context): Context; export function isContext(sandbox: Context): boolean; - export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions): any; + export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions | string): any; export function runInDebugContext(code: string): any; - export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions): any; - export function runInThisContext(code: string, options?: RunningScriptOptions): any; + export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any; + export function runInThisContext(code: string, options?: RunningScriptOptions | string): any; } declare module "child_process" { diff --git a/types/node/v8/node-tests.ts b/types/node/v8/node-tests.ts index 58c1319261..845837230a 100644 --- a/types/node/v8/node-tests.ts +++ b/types/node/v8/node-tests.ts @@ -2526,6 +2526,10 @@ namespace vm_tests { const Debug = vm.runInDebugContext('Debug'); Debug.scripts().forEach((script: any) => { console.log(script.name); }); } + + { + vm.runInThisContext('console.log("hello world"', './my-file.js'); + } } ///////////////////////////////////////////////////// From b24419795db48447632332332ccebbd085ba4fcb Mon Sep 17 00:00:00 2001 From: falsandtru Date: Wed, 11 Apr 2018 02:16:16 +0900 Subject: [PATCH 0570/2153] power-assert: Update APIs (#24578) * Update APIs * Update header --- types/power-assert/index.d.ts | 4 +++- types/power-assert/power-assert-tests.ts | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/types/power-assert/index.d.ts b/types/power-assert/index.d.ts index fa23620b8e..ab066b28bc 100644 --- a/types/power-assert/index.d.ts +++ b/types/power-assert/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for power-assert 1.4.1 +// Type definitions for power-assert 1.5.0 // Project: https://github.com/twada/power-assert // Definitions by: vvakame // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -62,6 +62,8 @@ declare namespace assert { export function ifError(value:any):void; + export const strict: typeof assert; + export interface Options { assertion?: empower.Options; output?: powerAssertFormatter.Options; diff --git a/types/power-assert/power-assert-tests.ts b/types/power-assert/power-assert-tests.ts index 0ec099b32c..a60f99964d 100644 --- a/types/power-assert/power-assert-tests.ts +++ b/types/power-assert/power-assert-tests.ts @@ -1,5 +1,3 @@ - - import assert = require("power-assert"); assert(1 + 1 - 2 === 0, "The universe isn't how it should."); @@ -16,13 +14,13 @@ assert.notDeepStrictEqual([{a:1}], [{a:1}], "uses === comparator"); assert.throws(() => { throw "a hammer at your face"; -}, undefined, "DODGED IT"); +}, "DODGED IT"); assert.doesNotThrow(() => { if (!!false) { throw "a hammer at your face"; } -}, undefined, "What the...*crunch*"); +}, "What the...*crunch*"); var customizedAssert1 = assert.customize({ @@ -41,13 +39,13 @@ customizedAssert1.notStrictEqual(2, "2", "uses === comparator"); customizedAssert1.throws(() => { throw "a hammer at your face"; -}, undefined, "DODGED IT"); +}, "DODGED IT"); customizedAssert1.doesNotThrow(() => { if (!!false) { throw "a hammer at your face"; } -}, undefined, "What the...*crunch*"); +}, "What the...*crunch*"); var customizedAssert2 = assert.customize({ @@ -85,3 +83,5 @@ var customizedAssert2 = assert.customize({ ] } }); + +(): typeof assert => assert.strict; From 7f2ac5d513366c00738d1f30339da95410aab0b3 Mon Sep 17 00:00:00 2001 From: Sergei Dorogin Date: Tue, 10 Apr 2018 20:19:30 +0300 Subject: [PATCH 0571/2153] Handlebars: improved typings (#23215) * Handlebars: Added HelperDelegate and HelperOptions interfaces, data field to RuntimeOptions WIP * Handlebars: Added HelperDelegate and HelperOptions interfaces, TemplateDelegate, Template RuntimeOptions: added data and blockParams fields registerHelper and registerPartial methods: typed signatures for callbacks (HelperDelegate) * Handlebars: SafeString and Utils were moved into Handlebars namespace fix: added tests into tsconfig.json::files fix: handlebars-tests.ts: made tslint happy * Handlebars: updated authors, bumped up version (to the latest 4.0.11) * small fixes of typos (missing semicolons) --- types/handlebars/handlebars-tests.ts | 64 +++++++------- types/handlebars/index.d.ts | 127 ++++++++++++++++----------- types/handlebars/tsconfig.json | 6 +- 3 files changed, 113 insertions(+), 84 deletions(-) diff --git a/types/handlebars/handlebars-tests.ts b/types/handlebars/handlebars-tests.ts index 95342c2e63..1ec2528db3 100644 --- a/types/handlebars/handlebars-tests.ts +++ b/types/handlebars/handlebars-tests.ts @@ -1,8 +1,8 @@ -import Handlebars = require('handlebars'); +//import Handlebars = require('handlebars'); +import * as Handlerbars from 'handlebars'; - -var context = { +const context = { author: { firstName: 'Alan', lastName: 'Johnson' }, body: 'I Love Handlebars', comments: [{ @@ -20,65 +20,61 @@ Handlebars.registerHelper('agree_button', function() { ); }); -var source = '

    Hello, my name is {{name}}. I am from {{hometown}}. I have ' + +const source1 = '

    Hello, my name is {{name}}. I am from {{hometown}}. I have ' + '{{kids.length}} kids:

    ' + '
      {{#kids}}
    • {{name}} is {{age}}
    • {{/kids}}
    '; -var template = Handlebars.compile(source); -var data = { 'name': 'Alan', 'hometown': 'Somewhere, TX', - 'kids': [{'name': 'Jimmy', 'age': '12'}, {'name': 'Sally', 'age': '4'}]}; -var result = template(data); +const template1 = Handlebars.compile(source1); +template1({ name: "Alan", hometown: "Somewhere, TX", kids: [{name: "Jimmy", age: 12}, {name: "Sally", age: 4}]}); Handlebars.registerHelper('link_to', (context: typeof post) => { return '' + context.body + ''; }); - -var post = { url: '/hello-world', body: 'Hello World!' }; -var context2 = { posts: [post] }; -var source2 = '
      {{#posts}}
    • {{{link_to this}}}
    • {{/posts}}
    '; - -var template2: HandlebarsTemplateDelegate<{ posts: { url: string, body: string }[] }> = Handlebars.compile(source2); +const post = { url: "/hello-world", body: "Hello World!" }; +const context2 = { posts: [post] }; +const source2 = '
      {{#posts}}
    • {{{link_to this}}}
    • {{/posts}}
    '; +const template2: HandlebarsTemplateDelegate<{ posts: { url: string, body: string }[] }> = Handlebars.compile(source2); template2(context2); Handlebars.registerHelper('link_to', (title: string, context: typeof post) => { return '' + title + '!'; }); - -var context3 = { posts: [{url: '/hello-world', body: 'Hello World!'}] }; -var source3 = '
      {{#posts}}
    • {{{link_to "Post" this}}}
    • {{/posts}}
    '; -var template3 = Handlebars.compile(source3); +const context3 = { posts: [{url: '/hello-world', body: 'Hello World!'}] }; +const source3 = '
      {{#posts}}
    • {{{link_to "Post" this}}}
    • {{/posts}}
    '; +const template3 = Handlebars.compile(source3); template3(context3); -var source4 = '
      {{#people}}
    • {{#link}}{{name}}{{/link}}
    • {{/people}}
    '; +const source4 = '
      {{#people}}
    • {{#link}}{{name}}{{/link}}
    • {{/people}}
    '; Handlebars.registerHelper('link', function(context: any) { return '' + context.fn(this) + ''; }); -var template4 = Handlebars.compile<{ people: { name: string, id: number }[] }>(source4); -var data2 = { 'people': [ +const template4 = Handlebars.compile<{ people: { name: string, id: number }[] }>(source4); +const data2 = { 'people': [ { 'name': 'Alan', 'id': 1 }, { 'name': 'Yehuda', 'id': 2 } ]}; template4(data2); -var source5 = '
      {{#people}}
    • {{> link}}
    • {{/people}}
    '; +const source5 = '
      {{#people}}
    • {{> link}}
    • {{/people}}
    '; Handlebars.registerPartial('link', '{{name}}'); -var template5 = Handlebars.compile(source5); -var data3 = { 'people': [ +const template5 = Handlebars.compile(source5); +const data3 = { 'people': [ { 'name': 'Alan', 'id': 1 }, { 'name': 'Yehuda', 'id': 2 } ]}; template5(data3); -Handlebars.registerHelper('list', (items: any, fn: (item: any) => string) => { - var out = '
      '; - for(var i=0, l=items.length; i' + fn(items[i]) + ''; - } - return out + '
    '; -}); -Handlebars.registerHelper('fullName', (person: typeof context.author) => { - return person.firstName + ' ' + person.lastName; +const source6 = '{{#list nav}}{{title}}{{/list}}'; +const template6 = Handlebars.compile(source6); +Handlebars.registerHelper('list', (context, options: Handlebars.HelperOptions) => { + let ret = "
      "; + for(let i=0, j=context.length; i" + options.fn(context[i]) + ""; + } + return ret + "
    "; }); +template6([{url:"", title:""}]) -var escapedExpression = Handlebars.Utils.escapeExpression(''); + +const escapedExpression = Handlebars.Utils.escapeExpression(''); Handlebars.helpers !== undefined; diff --git a/types/handlebars/index.d.ts b/types/handlebars/index.d.ts index eb5958f6db..351d98fb10 100644 --- a/types/handlebars/index.d.ts +++ b/types/handlebars/index.d.ts @@ -1,15 +1,48 @@ -// Type definitions for Handlebars v4.0.5 +// Type definitions for Handlebars v4.0.11 // Project: http://handlebarsjs.com/ -// Definitions by: Boris Yankov +// Definitions by: Boris Yankov , Sergei Dorogin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 declare namespace Handlebars { - export function registerHelper(name: string, fn: Function, inverse?: boolean): void; - export function registerHelper(name: Object): void; - export function registerPartial(name: string, str: any): void; + export interface TemplateDelegate { + (context: T, options?: RuntimeOptions): string; + } + + export type Template = TemplateDelegate|string; + + export interface RuntimeOptions { + partial?: boolean; + depths?: any[]; + helpers?: { [name: string]: Function }; + partials?: { [name: string]: HandlebarsTemplateDelegate }; + decorators?: { [name: string]: Function }; + data?: any; + blockParams?: any[]; + } + + export interface HelperOptions { + fn: TemplateDelegate; + inverse: TemplateDelegate; + hash: any; + data?: any; + } + + export interface HelperDelegate { + (context?: any, arg1?: any, arg2?: any, arg3?: any, arg4?: any, arg5?: any, options?: HelperOptions): any; + } + export interface HelperDeclareSpec { + [key: string]: HelperDelegate; + } + + export function registerHelper(name: string, fn: HelperDelegate): void; + export function registerHelper(name: HelperDeclareSpec): void; export function unregisterHelper(name: string): void; + + export function registerPartial(name: string, fn: Template): void; export function unregisterPartial(name: string): void; + + // TODO: replace Function with actual signature export function registerDecorator(name: string, fn: Function): void; export function unregisterDecorator(name: string): void; @@ -25,23 +58,36 @@ declare namespace Handlebars { export function create(): typeof Handlebars; - export var SafeString: typeof hbs.SafeString; - export var escapeExpression: typeof hbs.Utils.escapeExpression; - export var Utils: typeof hbs.Utils; - export var logger: Logger; - export var templates: HandlebarsTemplates; - export var helpers: { [name: string]: Function }; - export var partials: { [name: string]: any }; - export var decorators: { [name: string]: Function }; - - export function registerDecorator(name: string, fn: Function): void; - export function registerDecorator(obj: {[name: string] : Function}): void; - export function unregisterDecorator(name: string): void; + export const escapeExpression: typeof Utils.escapeExpression; + //export const Utils: typeof hbs.Utils; + export const logger: Logger; + export const templates: HandlebarsTemplates; + export const helpers: { [name: string]: HelperDelegate }; + export const partials: { [name: string]: any }; + // TODO: replace Function with actual signature + export const decorators: { [name: string]: Function }; export function noConflict(): typeof Handlebars; - export module AST { - export var helpers: hbs.AST.helpers; + export class SafeString { + constructor(str: string); + toString(): string; + toHTML(): string; + } + + export namespace Utils { + export function escapeExpression(str: string): string; + export function createFrame(object: any): any; + export function blockParams(obj: any[], ids: any[]): any[]; + export function isEmpty(obj: any) : boolean; + export function extend(obj: any, ...source: any[]): any; + export function toString(obj: any): string; + export function isArray(obj: any): boolean; + export function isFunction(obj: any): boolean; + } + + export namespace AST { + export const helpers: hbs.AST.helpers; } interface ICompiler { @@ -96,9 +142,8 @@ interface HandlebarsTemplatable { template: HandlebarsTemplateDelegate; } -interface HandlebarsTemplateDelegate { - (context: T, options?: RuntimeOptions): string; -} +// NOTE: for backward compatibility of this typing +type HandlebarsTemplateDelegate = Handlebars.TemplateDelegate; interface HandlebarsTemplates { [index: string]: HandlebarsTemplateDelegate; @@ -108,13 +153,8 @@ interface TemplateSpecification { } -interface RuntimeOptions { - partial?: boolean; - depths?: any[]; - helpers?: { [name: string]: Function } - partials?: { [name: string]: HandlebarsTemplateDelegate } - decorators?: { [name: string]: Function } -} +// for backward compatibility of this typing +type RuntimeOptions = Handlebars.RuntimeOptions; interface CompileOptions { data?: boolean; @@ -128,7 +168,7 @@ interface CompileOptions { with?: boolean; log?: boolean; lookup?: boolean; - } + }; knownHelpersOnly?: boolean; noEscape?: boolean; strict?: boolean; @@ -144,21 +184,10 @@ interface PrecompileOptions extends CompileOptions { } declare namespace hbs { - class SafeString { - constructor(str: string); - static toString(): string; - } + // for backward compatibility of this typing + type SafeString = Handlebars.SafeString; - namespace Utils { - function escapeExpression(str: string): string; - function createFrame(object: any): any; - function blockParams(obj: any[], ids: any[]): any[]; - function isEmpty(obj: any) : boolean; - function extend(obj: any, ...source: any[]): any; - function toString(obj: any): string; - function isArray(obj: any): boolean; - function isFunction(obj: any): boolean; - } + type Utils = typeof Handlebars.Utils; } interface Logger { @@ -231,11 +260,11 @@ declare namespace hbs { interface PartialBlockStatement extends Statement { name: PathExpression | SubExpression; - params: Expression[], - hash: Hash, - program: Program, - openStrip: StripFlags, - closeStrip: StripFlags + params: Expression[]; + hash: Hash; + program: Program; + openStrip: StripFlags; + closeStrip: StripFlags; } interface ContentStatement extends Statement { diff --git a/types/handlebars/tsconfig.json b/types/handlebars/tsconfig.json index 5f874f3996..5c7bf000d0 100644 --- a/types/handlebars/tsconfig.json +++ b/types/handlebars/tsconfig.json @@ -19,5 +19,9 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true - } + }, + "files": [ + "index.d.ts", + "handlebars-tests.ts" + ] } \ No newline at end of file From 5515e867df0b46385d446aa41f36918dcb414efb Mon Sep 17 00:00:00 2001 From: Rasmus Eneman Date: Tue, 10 Apr 2018 19:21:14 +0200 Subject: [PATCH 0572/2153] [react-dom] fix signature of findDOMNode (#24211) fixes #24167 --- types/react-dom/index.d.ts | 2 +- types/react-tooltip/react-tooltip-tests.tsx | 4 ++-- types/react/test/index.ts | 4 ++-- types/react/v15/test/index.ts | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/types/react-dom/index.d.ts b/types/react-dom/index.d.ts index da494182d6..bd9541217d 100644 --- a/types/react-dom/index.d.ts +++ b/types/react-dom/index.d.ts @@ -16,7 +16,7 @@ import { DOMAttributes, DOMElement, ReactNode, ReactPortal } from 'react'; -export function findDOMNode(instance: ReactInstance): Element; +export function findDOMNode(instance: ReactInstance): Element | null | Text; export function unmountComponentAtNode(container: Element): boolean; export function createPortal(children: ReactNode, container: Element): ReactPortal; diff --git a/types/react-tooltip/react-tooltip-tests.tsx b/types/react-tooltip/react-tooltip-tests.tsx index 3fee5dba3e..97b7a085ea 100644 --- a/types/react-tooltip/react-tooltip-tests.tsx +++ b/types/react-tooltip/react-tooltip-tests.tsx @@ -91,7 +91,7 @@ export class ReactTooltipTest extends React.PureComponent {

    ); }); + +// groups +const groupId = 'GROUP-ID1'; + +text('label', 'default', groupId); +boolean('label', true, groupId); +number('label', 1, {}, groupId); +color('label', '#ffffff', groupId); +object('label', {}, groupId); +array('label', [], ',', groupId); +select('label', { option: 'Option' }, null, groupId); +files('label', 'image/*', []); +date('label', new Date(), groupId); +button('label', () => undefined, groupId); From 47ba52eb87852c82cd6275dfd90ba8e4664bd444 Mon Sep 17 00:00:00 2001 From: DonatienCorrea Date: Wed, 11 Apr 2018 20:58:19 +0200 Subject: [PATCH 0595/2153] [google.picker] Add setMaxItems method to the PickerBuilder (#24896) --- types/google.picker/index.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/google.picker/index.d.ts b/types/google.picker/index.d.ts index 851697cb32..b5fc91404d 100644 --- a/types/google.picker/index.d.ts +++ b/types/google.picker/index.d.ts @@ -47,6 +47,9 @@ declare namespace google { // ISO 639 language code. If the language is not supported, en-US is used. This method provides an alternative to setting the locale at google.load() time. See the Developer's Guide for a list of supported locales. setLocale(locale:string):PickerBuilder; + // Sets the maximum number of items a user can pick. + setMaxItems(max: number):PickerBuilder; + // Sets an OAuth token to use for authenticating the current user. Depending on the scope of the token, only certain views will display data. Valid scopes are Google Docs, Drive, Photos, YouTube. setOAuthToken(token:string):PickerBuilder; From 8ad05d59bce4a57668398f0b385af054f2bb06d8 Mon Sep 17 00:00:00 2001 From: ThierryLehoux Date: Wed, 11 Apr 2018 20:58:38 +0200 Subject: [PATCH 0596/2153] express-winston: add the boolean meta option of the logger in the d.ts (#24842) --- .../express-winston/express-winston-tests.ts | 19 ++++++++++--------- types/express-winston/index.d.ts | 11 ++++++----- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/types/express-winston/express-winston-tests.ts b/types/express-winston/express-winston-tests.ts index 297b7afc49..b64bce0b3e 100644 --- a/types/express-winston/express-winston-tests.ts +++ b/types/express-winston/express-winston-tests.ts @@ -7,18 +7,19 @@ const app = express(); // Logger with all options app.use(expressWinston.logger({ baseMeta: { foo: 'foo' }, - bodyBlacklist: [ 'foo' ], - bodyWhitelist: [ 'bar' ], + bodyBlacklist: ['foo'], + bodyWhitelist: ['bar'], colorize: true, dynamicMeta: (req, res, err) => ({ foo: 'bar' }), expressFormat: true, ignoreRoute: (req, res) => true, - ignoredRoutes: [ 'foo' ], + ignoredRoutes: ['foo'], level: 'level', + meta: true, metaField: 'metaField', msg: 'msg', requestFilter: (req, prop) => true, - requestWhitelist: [ 'foo', 'bar' ], + requestWhitelist: ['foo', 'bar'], skip: (req, res) => false, statusLevels: ({ error: 'error', success: 'success', warn: 'warn' }), transports: [ @@ -52,7 +53,7 @@ app.use(expressWinston.errorLogger({ metaField: 'metaField', msg: 'msg', requestFilter: (req, prop) => true, - requestWhitelist: [ 'foo', 'bar' ], + requestWhitelist: ['foo', 'bar'], transports: [ new winston.transports.Console({ json: true, @@ -87,8 +88,8 @@ expressWinston.responseWhitelist.push('body'); const router = express.Router(); router.post('/user/register', (req, res, next) => { - const expressWinstonReq = req as expressWinston.ExpressWinstonRequest; - expressWinstonReq._routeWhitelists.body = [ 'username', 'email', 'age' ]; - expressWinstonReq._routeWhitelists.req = [ 'userId' ]; - expressWinstonReq._routeWhitelists.res = [ '_headers' ]; + const expressWinstonReq = req as expressWinston.ExpressWinstonRequest; + expressWinstonReq._routeWhitelists.body = ['username', 'email', 'age']; + expressWinstonReq._routeWhitelists.req = ['userId']; + expressWinstonReq._routeWhitelists.res = ['_headers']; }); diff --git a/types/express-winston/index.d.ts b/types/express-winston/index.d.ts index 21e7ead653..920939abd6 100644 --- a/types/express-winston/index.d.ts +++ b/types/express-winston/index.d.ts @@ -26,6 +26,7 @@ export interface BaseLoggerOptions { ignoreRoute?: RouteFilter; ignoredRoutes?: string[]; level?: string; + meta?: boolean; metaField?: string; msg?: string; requestFilter?: RequestFilter; @@ -91,9 +92,9 @@ export let defaultResponseFilter: ResponseFilter; export function defaultSkip(): boolean; export interface ExpressWinstonRequest extends Request { - _routeWhitelists: { - body: string[]; - req: string[]; - res: string[]; - }; + _routeWhitelists: { + body: string[]; + req: string[]; + res: string[]; + }; } From 66b655cb716a907480f257762608c29996caba7a Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Wed, 11 Apr 2018 20:59:03 +0200 Subject: [PATCH 0597/2153] fix: make `spyOn` typesafe with `keyof` (#24912) --- types/jest/index.d.ts | 2 +- types/jest/jest-tests.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/jest/index.d.ts b/types/jest/index.d.ts index 3dc26955e6..4520247216 100644 --- a/types/jest/index.d.ts +++ b/types/jest/index.d.ts @@ -560,7 +560,7 @@ declare namespace jest { // Relevant parts of Jasmine's API are below so they can be changed and removed over time. // This file can't reference jasmine.d.ts since the globals aren't compatible. -declare function spyOn(object: any, method: string): jasmine.Spy; +declare function spyOn(object: T, method: keyof T): jasmine.Spy; /** * If you call the function pending anywhere in the spec body, * no matter the expectations, the spec will be marked pending. diff --git a/types/jest/jest-tests.ts b/types/jest/jest-tests.ts index 786dccb641..a90a7a9e5a 100644 --- a/types/jest/jest-tests.ts +++ b/types/jest/jest-tests.ts @@ -367,6 +367,11 @@ describe('missing tests', () => { expect(mock.getMockName()).toBe('Carrot'); }); + it('tests mock name functionality', () => { + const mock = spyOn(console, 'warn'); + expect(mock).toHaveBeenCalled(); + }); + it('creates snapshoter', () => { jest.disableAutomock().mock('./render', () => jest.fn((): string => "{Link to: \"facebook\"}"), { virtual: true }); const render: () => string = require('./render'); From d22c02790141aebaf78d53da4b6815aabde152d1 Mon Sep 17 00:00:00 2001 From: Justin Rockwood Date: Wed, 11 Apr 2018 11:59:19 -0700 Subject: [PATCH 0598/2153] fix(fs-extra): copy can take an async filter function (#24888) --- types/fs-extra/fs-extra-tests.ts | 2 +- types/fs-extra/index.d.ts | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/types/fs-extra/fs-extra-tests.ts b/types/fs-extra/fs-extra-tests.ts index 50d594e1a4..dbe48cf971 100644 --- a/types/fs-extra/fs-extra-tests.ts +++ b/types/fs-extra/fs-extra-tests.ts @@ -48,7 +48,7 @@ fs.copy(src, dest, { overwrite: true, preserveTimestamps: true, - filter: (src: string, dest: string) => false + filter: (src: string, dest: string) => Promise.resolve(false) }, errorCallback ); diff --git a/types/fs-extra/index.d.ts b/types/fs-extra/index.d.ts index 6183dce393..adf236955b 100644 --- a/types/fs-extra/index.d.ts +++ b/types/fs-extra/index.d.ts @@ -3,7 +3,8 @@ // Definitions by: Alan Agius , // midknight41 , // Brendan Forster , -// Mees van Dijk +// Mees van Dijk , +// Justin Rockwood // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -16,7 +17,7 @@ export * from "fs"; export function copy(src: string, dest: string, options?: CopyOptions): Promise; export function copy(src: string, dest: string, callback: (err: Error) => void): void; export function copy(src: string, dest: string, options: CopyOptions, callback: (err: Error) => void): void; -export function copySync(src: string, dest: string, options?: CopyOptions): void; +export function copySync(src: string, dest: string, options?: CopyOptionsSync): void; export function move(src: string, dest: string, options?: MoveOptions): Promise; export function move(src: string, dest: string, callback: (err: Error) => void): void; @@ -254,7 +255,8 @@ export interface PathEntryStream { read(): PathEntry | null; } -export type CopyFilter = (src: string, dest: string) => boolean; +export type CopyFilterSync = (src: string, dest: string) => boolean; +export type CopyFilterAsync = (src: string, dest: string) => Promise; export type SymlinkType = "dir" | "file"; @@ -263,10 +265,14 @@ export interface CopyOptions { overwrite?: boolean; preserveTimestamps?: boolean; errorOnExist?: boolean; - filter?: CopyFilter; + filter?: CopyFilterSync | CopyFilterAsync; recursive?: boolean; } +export interface CopyOptionsSync extends CopyOptions { + filter?: CopyFilterSync; +} + export interface MoveOptions { overwrite?: boolean; limit?: number; From 21d3f1d7f99209af58dbdca79f3d23b2faa39f80 Mon Sep 17 00:00:00 2001 From: Michael Auer Date: Wed, 11 Apr 2018 20:59:47 +0200 Subject: [PATCH 0599/2153] @types/leaflet enhance return types of L.Polyline.getLatLngs() to support nested arrays of LatLng (#24030) * Update index.d.ts enhanced possible types of the return value for nested arrays of Polyline or Polygon * Update index.d.ts changed "Definitions by" in header section --- types/leaflet/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/leaflet/index.d.ts b/types/leaflet/index.d.ts index 41b4fbd84c..89f9625114 100644 --- a/types/leaflet/index.d.ts +++ b/types/leaflet/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/Leaflet/Leaflet // Definitions by: Alejandro Sánchez // Arne Schubert +// Michael Auer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -611,7 +612,7 @@ export interface PolylineOptions extends PathOptions { export class Polyline extends Path { constructor(latlngs: LatLngExpression[], options?: PolylineOptions); toGeoJSON(): geojson.Feature; - getLatLngs(): LatLng[]; + getLatLngs(): LatLng[] | LatLng[][] | LatLng[][][]; setLatLngs(latlngs: LatLngExpression[]): this; isEmpty(): boolean; getCenter(): LatLng; From c95f6e951b97e9a6fed7d9cd1555f167e12aa6c1 Mon Sep 17 00:00:00 2001 From: xcq1 Date: Wed, 11 Apr 2018 21:06:26 +0200 Subject: [PATCH 0600/2153] Nightwatch: Fix signature of frame (#24897) --- types/nightwatch/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/nightwatch/index.d.ts b/types/nightwatch/index.d.ts index 6d3cc8f4a0..8559f73b10 100644 --- a/types/nightwatch/index.d.ts +++ b/types/nightwatch/index.d.ts @@ -1822,7 +1822,7 @@ export interface NightwatchAPI { * @param frameId: Identifier for the frame to change focus to. * @param callback: Optional callback function to be called when the command finishes. */ - frame(frameId?: string, callback?: () => void): this; + frame(frameId: string | undefined | null, callback?: () => void): this; /** * Change focus to the parent context. If the current context is the top level browsing context, the context remains unchanged. From aca7b39f779f9b319622dc8ffd3922a0fc343bea Mon Sep 17 00:00:00 2001 From: Kalle Ott Date: Wed, 11 Apr 2018 21:07:45 +0200 Subject: [PATCH 0601/2153] typings update to catch up with current version of react-virtualized (#24900) * typings update to catch up with current version of react-virtualized * fixed lint errors * fixed ts version * fixed void return type of defaultProps functions * changed interface to type for better consistency --- .../dist/es/ArrowKeyStepper.d.ts | 73 ++-- .../react-virtualized/dist/es/AutoSizer.d.ts | 58 ++- .../dist/es/CellMeasurer.d.ts | 93 ++--- .../react-virtualized/dist/es/Collection.d.ts | 91 +++-- .../dist/es/ColumnSizer.d.ts | 32 +- types/react-virtualized/dist/es/Grid.d.ts | 305 +++++++-------- .../dist/es/InfiniteLoader.d.ts | 36 +- types/react-virtualized/dist/es/List.d.ts | 97 ++--- types/react-virtualized/dist/es/Masonry.d.ts | 156 ++++---- .../react-virtualized/dist/es/MultiGrid.d.ts | 90 ++--- .../react-virtualized/dist/es/ScrollSync.d.ts | 57 ++- types/react-virtualized/dist/es/Table.d.ts | 360 ++++++++++-------- .../dist/es/WindowScroller.d.ts | 104 ++--- types/react-virtualized/index.d.ts | 83 ++-- types/react-virtualized/tsconfig.json | 14 +- 15 files changed, 841 insertions(+), 808 deletions(-) diff --git a/types/react-virtualized/dist/es/ArrowKeyStepper.d.ts b/types/react-virtualized/dist/es/ArrowKeyStepper.d.ts index 17844914af..2c4f36d7d2 100644 --- a/types/react-virtualized/dist/es/ArrowKeyStepper.d.ts +++ b/types/react-virtualized/dist/es/ArrowKeyStepper.d.ts @@ -1,27 +1,28 @@ -import { PureComponent, Validator, Requireable } from 'react' -import * as PropTypes from 'prop-types' +import { PureComponent, Validator, Requireable } from "react"; +import * as PropTypes from "prop-types"; +import { RenderedSection } from "./Grid"; -export type OnSectionRenderedParams = { - columnStartIndex: number, - columnStopIndex: number, - rowStartIndex: number, - rowStopIndex: number -} +export type OnSectionRenderedParams = RenderedSection; export type ChildProps = { - onSectionRendered: (params: OnSectionRenderedParams) => void, - scrollToColumn: number, - scrollToRow: number + onSectionRendered: (params: RenderedSection) => void; + scrollToColumn: number; + scrollToRow: number; }; /** * This HOC decorates a virtualized component and responds to arrow-key events by scrolling one row or column at a time. */ export type ArrowKeyStepperProps = { - children?: (props: ChildProps) => React.ReactNode; + children: (props: ChildProps) => React.ReactNode; className?: string; columnCount: number; rowCount: number; - mode?: 'edges' | 'cells'; + mode?: "edges" | "cells"; + disabled?: boolean; + isControlled?: boolean; + onScrollToChange?: (params: ScrollIndices) => void; + scrollToColumn?: number; + scrollToRow?: number; /** * PLEASE NOTE * The [key: string]: any; line is here on purpose @@ -30,35 +31,23 @@ export type ArrowKeyStepperProps = { * https://github.com/bvaughn/react-virtualized#pass-thru-props */ [key: string]: any; -} -export type ScrollIndexes = { - scrollToRow: number, - scrollToColumn: number -} -export class ArrowKeyStepper extends PureComponent { +}; +export type ScrollIndices = { + scrollToRow: number; + scrollToColumn: number; +}; + +export type ScrollIndexes = ScrollIndices; + +export class ArrowKeyStepper extends PureComponent< + ArrowKeyStepperProps, + ScrollIndices +> { static defaultProps: { - disabled: false, - mode: 'edges', - scrollToColumn: 0, - scrollToRow: 0 + disabled: false; + isControlled: false; + mode: "edges"; + scrollToColumn: 0; + scrollToRow: 0; }; - - static propTypes: { - children: Validator<(props: ChildProps) => React.ReactNode>, - className: Requireable, - columnCount: Validator, - disabled: Validator, - mode: Validator<'cells' | 'edges'>, - rowCount: Validator, - scrollToColumn: Validator, - scrollToRow: Validator - }; - - constructor(props: ArrowKeyStepperProps, context: any); - - componentWillReceiveProps(nextProps: ArrowKeyStepperProps): void; - - setScrollIndexes(params: ScrollIndexes): void; - - render(): JSX.Element; } diff --git a/types/react-virtualized/dist/es/AutoSizer.d.ts b/types/react-virtualized/dist/es/AutoSizer.d.ts index b54fce89e1..d3981f3a16 100644 --- a/types/react-virtualized/dist/es/AutoSizer.d.ts +++ b/types/react-virtualized/dist/es/AutoSizer.d.ts @@ -1,12 +1,34 @@ -import { PureComponent, Validator, Requireable } from 'react' -import * as PropTypes from 'prop-types' +import { PureComponent, Validator, Requireable } from "react"; +import * as PropTypes from "prop-types"; -export type Dimensions = { - height: number, - width: number -} +export type Size = { + height: number; + width: number; +}; +export type Dimensions = Size; export type AutoSizerProps = { + /** + * Function responsible for rendering children. + * This function should implement the following signature: + * ({ height, width }) => PropTypes.element + */ + children: (props: Size) => React.ReactNode; + /** + * Optional custom CSS class name to attach to root AutoSizer element. + * This is an advanced property and is not typically necessary. + */ + className?: string; + /** + * Height passed to child for initial render; useful for server-side rendering. + * This value will be overridden with an accurate height after mounting. + */ + defaultHeight?: number; + /** + * Width passed to child for initial render; useful for server-side rendering. + * This value will be overridden with an accurate width after mounting. + */ + defaultWidth?: number; /** Disable dynamic :height property */ disableHeight?: boolean; /** Disable dynamic :width property */ @@ -14,13 +36,12 @@ export type AutoSizerProps = { /** Nonce of the inlined stylesheet for Content Security Policy */ nonce?: string; /** Callback to be invoked on-resize: ({ height, width }) */ - onResize?: (info: { height: number, width: number }) => any; + onResize?: (info: Size) => any; /** - * Function responsible for rendering children. - * This function should implement the following signature: - * ({ height, width }) => PropTypes.element + * Optional custom inline style to attach to root AutoSizer element. + * This is an advanced property and is not typically necessary. */ - children?: (props: Dimensions) => React.ReactNode + style?: React.CSSProperties; /** * PLEASE NOTE * The [key: string]: any; line is here on purpose @@ -35,17 +56,12 @@ export type AutoSizerProps = { * Child component should not be declared as a child but should rather be specified by a `ChildComponent` property. * All other properties will be passed through to the child component. */ -export class AutoSizer extends PureComponent { - static propTypes: { - children: Validator<(props: Dimensions) => React.ReactNode>, - disableHeight: Requireable, - disableWidth: Requireable, - nonce: Validator, - onResize: Validator<(props: Dimensions) => any> - }; - +export class AutoSizer extends PureComponent { static defaultProps: { - onResize: () => {} + onResize: () => void; + disableHeight: false; + disableWidth: false; + style: {}; }; constructor(props: AutoSizerProps); diff --git a/types/react-virtualized/dist/es/CellMeasurer.d.ts b/types/react-virtualized/dist/es/CellMeasurer.d.ts index 46c033ba49..5c56332964 100644 --- a/types/react-virtualized/dist/es/CellMeasurer.d.ts +++ b/types/react-virtualized/dist/es/CellMeasurer.d.ts @@ -1,41 +1,42 @@ -import { PureComponent } from 'react' +import { PureComponent } from "react"; -export type KeyMapper = ( - rowIndex: number, - columnIndex: number -) => any; +export type CellMeasurerCacheInterface = { + hasFixedWidth(): boolean; + hasFixedHeight(): boolean; + has(rowIndex: number, columnIndex: number): boolean; + set( + rowIndex: number, + columnIndex: number, + width: number, + height: number + ): void; + getHeight(rowIndex: number, columnIndex?: number): number; + getWidth(rowIndex: number, columnIndex?: number): number; +}; + +export type KeyMapper = (rowIndex: number, columnIndex: number) => any; export type CellMeasurerCacheParams = { - defaultHeight?: number, - defaultWidth?: number, - fixedHeight?: boolean, - fixedWidth?: boolean, - minHeight?: number, - minWidth?: number, - keyMapper?: KeyMapper -} -export class CellMeasurerCache { - constructor(params: CellMeasurerCacheParams); - clear( - rowIndex: number, - columnIndex: number - ): void; + defaultHeight?: number; + defaultWidth?: number; + fixedHeight?: boolean; + fixedWidth?: boolean; + minHeight?: number; + minWidth?: number; + keyMapper?: KeyMapper; +}; +export class CellMeasurerCache implements CellMeasurerCacheInterface { + constructor(params?: CellMeasurerCacheParams); + clear(rowIndex: number, columnIndex: number): void; clearAll(): void; columnWidth: (params: { index: number }) => number | undefined; + readonly defaultHeight: number; + readonly defaultWidth: number; hasFixedHeight(): boolean; hasFixedWidth(): boolean; - getHeight( - rowIndex: number, - columnIndex: number - ): number | undefined; - getWidth( - rowIndex: number, - columnIndex: number - ): number | undefined; - has( - rowIndex: number, - columnIndex: number - ): boolean; + getHeight(rowIndex: number, columnIndex: number): number | undefined; + getWidth(rowIndex: number, columnIndex: number): number | undefined; + has(rowIndex: number, columnIndex: number): boolean; rowHeight: (params: { index: number }) => number | undefined; set( rowIndex: number, @@ -45,12 +46,24 @@ export class CellMeasurerCache { ): void; } +export type CellPosition = { + columnIndex: number; + rowIndex: number; +}; + +export type MeasuredCellParent = { + invalidateCellSizeAfterRender?: (cell: CellPosition) => void; + recomputeGridSize?: (cell: CellPosition) => void; +}; + export type CellMeasurerProps = { - cache?: CellMeasurerCache; - children?: ((props: {measure: () => void}) => React.ReactNode) | JSX.Element; + cache: CellMeasurerCacheInterface; + children: + | ((props: { measure: () => void }) => React.ReactNode) + | React.ReactNode; columnIndex?: number; index?: number; - parent?: React.ReactType; + parent: MeasuredCellParent; rowIndex?: number; style?: React.CSSProperties; /** @@ -61,18 +74,10 @@ export type CellMeasurerProps = { * https://github.com/bvaughn/react-virtualized#pass-thru-props */ [key: string]: any; -} +}; /** * Wraps a cell and measures its rendered content. * Measurements are stored in a per-cell cache. * Cached-content is not be re-measured. */ -export class CellMeasurer extends PureComponent { - constructor(props: CellMeasurerProps, context: any); - - componentDidMount(): void; - - componentDidUpdate(prevProps: CellMeasurerProps, prevState: any): void; - - render(): JSX.Element; -} +export class CellMeasurer extends PureComponent {} diff --git a/types/react-virtualized/dist/es/Collection.d.ts b/types/react-virtualized/dist/es/Collection.d.ts index e3b378eacb..d813e397f9 100644 --- a/types/react-virtualized/dist/es/Collection.d.ts +++ b/types/react-virtualized/dist/es/Collection.d.ts @@ -1,4 +1,4 @@ -import { PureComponent, Validator, Requireable } from 'react' +import { PureComponent, Validator, Requireable } from "react"; import { Alignment, Index, @@ -7,25 +7,36 @@ import { SectionRenderedParams, SizeInfo, SizeAndPositionInfo -} from '../../index'; +} from "../../index"; -export type CollectionCellSizeAndPosition = { height: number, width: number, x: number, y: number }; -export type CollectionCellSizeAndPositionGetter = (params: Index) => CollectionCellSizeAndPosition; +export type CollectionCellSizeAndPosition = { + height: number; + width: number; + x: number; + y: number; +}; +export type CollectionCellSizeAndPositionGetter = ( + params: Index +) => CollectionCellSizeAndPosition; export type CollectionCellGroupRendererParams = { - cellSizeAndPositionGetter: CollectionCellSizeAndPositionGetter, - indices: number[], - cellRenderer: CollectionCellRenderer -} -export type CollectionCellGroupRenderer = (params: CollectionCellGroupRendererParams) => React.ReactNode[]; + cellSizeAndPositionGetter: CollectionCellSizeAndPositionGetter; + indices: number[]; + cellRenderer: CollectionCellRenderer; +}; +export type CollectionCellGroupRenderer = ( + params: CollectionCellGroupRendererParams +) => React.ReactNode[]; export type CollectionCellRendererParams = { - index: number, - key: string, - style?: React.CSSProperties -} -export type CollectionCellRenderer = (params: CollectionCellRendererParams) => React.ReactNode; + index: number; + key: string; + style?: React.CSSProperties; +}; +export type CollectionCellRenderer = ( + params: CollectionCellRendererParams +) => React.ReactNode; export type CollectionProps = { - 'aria-label'?: string; + "aria-label"?: string; /** * Outer height of Collection is set to "auto". This property should only be * used in conjunction with the WindowScroller HOC. @@ -43,17 +54,17 @@ export type CollectionProps = { * cellRenderer: Function * }): Array */ - cellGroupRenderer?: CollectionCellGroupRenderer, + cellGroupRenderer?: CollectionCellGroupRenderer; /** * Responsible for rendering a cell given an row and column index. * Should implement the following interface: ({ index: number, key: string, style: object }): PropTypes.element */ - cellRenderer: CollectionCellRenderer, + cellRenderer: CollectionCellRenderer; /** * Callback responsible for returning size and offset/position information for a given cell (index). * ({ index: number }): { height: number, width: number, x: number, y: number } */ - cellSizeAndPositionGetter: CollectionCellSizeAndPositionGetter, + cellSizeAndPositionGetter: CollectionCellSizeAndPositionGetter; /** * Optional custom CSS class name to attach to root Collection element. */ @@ -122,30 +133,26 @@ export type CollectionProps = { */ export class Collection extends PureComponent { static propTypes: { - 'aria-label': Requireable, - cellCount: Validator, - cellGroupRenderer: Validator, - cellRenderer: Validator, - cellSizeAndPositionGetter: Validator, - sectionSize: Requireable + "aria-label": Requireable; + cellCount: Validator; + cellGroupRenderer: Validator; + cellRenderer: Validator; + cellSizeAndPositionGetter: Validator< + CollectionCellSizeAndPositionGetter + >; + sectionSize: Requireable; }; static defaultProps: { - 'aria-label': 'grid', - cellGroupRenderer: CollectionCellGroupRenderer + "aria-label": "grid"; + cellGroupRenderer: CollectionCellGroupRenderer; }; - constructor(props: CollectionProps, context: any); - forceUpdate(): void; /** See Collection#recomputeCellSizesAndPositions */ recomputeCellSizesAndPositions(): void; - /** React lifecycle methods */ - - render(): JSX.Element; - /** CellLayoutManager interface */ calculateSizeAndPositionData(): void; @@ -159,17 +166,19 @@ export class Collection extends PureComponent { * Calculates the minimum amount of change from the current scroll position to ensure the specified cell is (fully) visible. */ getScrollPositionForCell(params: { - align: 'auto' | 'start' | 'end' | 'center', - cellIndex: number, - height: number, - scrollLeft: number, - scrollTop: number, - width: number + align: "auto" | "start" | "end" | "center"; + cellIndex: number; + height: number; + scrollLeft: number; + scrollTop: number; + width: number; }): ScrollPosition; getTotalSize(): SizeInfo; - cellRenderers(params: { - isScrolling: boolean, - } & SizeInfo): React.ReactNode[]; + cellRenderers( + params: { + isScrolling: boolean; + } & SizeInfo + ): React.ReactNode[]; } diff --git a/types/react-virtualized/dist/es/ColumnSizer.d.ts b/types/react-virtualized/dist/es/ColumnSizer.d.ts index c3779c493c..fd42ad5cf5 100644 --- a/types/react-virtualized/dist/es/ColumnSizer.d.ts +++ b/types/react-virtualized/dist/es/ColumnSizer.d.ts @@ -1,11 +1,11 @@ -import { PureComponent, Validator, Requireable } from 'react' +import { PureComponent, Validator, Requireable } from "react"; export type SizedColumnProps = { - adjustedWidth: number, - columnWidth: number, - getColumnWidth: () => number, - registerChild: any -} + adjustedWidth: number; + columnWidth: number; + getColumnWidth: () => number; + registerChild: any; +}; export type ColumnSizerProps = { /** @@ -17,7 +17,7 @@ export type ColumnSizerProps = { * The :registerChild should be passed to the Grid's :ref property. * The :adjustedWidth property is optional; it reflects the lesser of the overall width or the width of all columns. */ - children?: (props: SizedColumnProps) => React.ReactNode; + children: (props: SizedColumnProps) => React.ReactNode; /** Optional maximum allowed column width */ columnMaxWidth?: number; /** Optional minimum allowed column width */ @@ -34,22 +34,16 @@ export type ColumnSizerProps = { * https://github.com/bvaughn/react-virtualized#pass-thru-props */ [key: string]: any; -} +}; /** * High-order component that auto-calculates column-widths for `Grid` cells. */ export class ColumnSizer extends PureComponent { static propTypes: { - children: Validator<(props: SizedColumnProps) => React.ReactNode>, - columnMaxWidth: Requireable, - columnMinWidth: Requireable, - columnCount: Validator, - width: Validator + children: Validator<(props: SizedColumnProps) => React.ReactNode>; + columnMaxWidth: Requireable; + columnMinWidth: Requireable; + columnCount: Validator; + width: Validator; }; - - constructor(props: ColumnSizerProps, context: any); - - componentDidUpdate(prevProps: ColumnSizerProps, prevState: any): void; - - render(): JSX.Element; } diff --git a/types/react-virtualized/dist/es/Grid.d.ts b/types/react-virtualized/dist/es/Grid.d.ts index 83230ca794..a543521b7a 100644 --- a/types/react-virtualized/dist/es/Grid.d.ts +++ b/types/react-virtualized/dist/es/Grid.d.ts @@ -1,56 +1,67 @@ -import { Validator, Requireable, PureComponent } from 'react' -import { List } from './List'; -import { Table } from './Table'; -import { CellMeasurerCache } from './CellMeasurer'; -import { Index, Map, Alignment } from '../../index'; +import { Validator, Requireable, PureComponent } from "react"; +import { List } from "./List"; +import { Table } from "./Table"; +import { CellMeasurerCache, MeasuredCellParent } from "./CellMeasurer"; +import { Index, Map, Alignment } from "../../index"; + +export type RenderedSection = { + columnOverscanStartIndex: number; + columnOverscanStopIndex: number; + columnStartIndex: number; + columnStopIndex: number; + rowOverscanStartIndex: number; + rowOverscanStopIndex: number; + rowStartIndex: number; + rowStopIndex: number; +}; export type GridCellProps = { columnIndex: number; isScrolling: boolean; isVisible: boolean; key: string; - parent: typeof Grid | typeof List | typeof Table; + parent: MeasuredCellParent; rowIndex: number; style: React.CSSProperties; }; export type GridCellRenderer = (props: GridCellProps) => React.ReactNode; export type ConfigureParams = { - cellCount: number, - estimatedCellSize: number + cellCount: number; + estimatedCellSize: number; }; export type ContainerSizeAndOffset = { - containerSize: number, - offset: number + containerSize: number; + offset: number; }; export type SizeAndPositionData = { - offset: number, - size: number + offset: number; + size: number; }; export type GetVisibleCellRangeParams = { - containerSize: number, - offset: number + containerSize: number; + offset: number; }; export type VisibleCellRange = { start: number; stop: number; }; export type ScrollParams = { - clientHeight: number, - clientWidth: number, - scrollHeight: number, - scrollLeft: number, - scrollTop: number, - scrollWidth: number + clientHeight: number; + clientWidth: number; + scrollHeight: number; + scrollLeft: number; + scrollTop: number; + scrollWidth: number; }; export type SectionRenderedParams = { - columnStartIndex: number, - columnStopIndex: number, - rowStartIndex: number, - rowStopIndex: number + columnStartIndex: number; + columnStopIndex: number; + rowStartIndex: number; + rowStopIndex: number; }; -export type SCROLL_DIRECTION_HORIZONTAL = 'horizontal'; -export type SCROLL_DIRECTION_VERTICAL = 'vertical'; +export type SCROLL_DIRECTION_HORIZONTAL = "horizontal"; +export type SCROLL_DIRECTION_VERTICAL = "vertical"; export type OverscanIndicesGetterParams = { direction?: SCROLL_DIRECTION_HORIZONTAL | SCROLL_DIRECTION_VERTICAL; cellCount: number; @@ -60,15 +71,17 @@ export type OverscanIndicesGetterParams = { stopIndex: number; }; export type OverscanIndices = { - overscanStartIndex: number, - overscanStopIndex: number + overscanStartIndex: number; + overscanStopIndex: number; }; -export type OverscanIndicesGetter = (params: OverscanIndicesGetterParams) => OverscanIndices; +export type OverscanIndicesGetter = ( + params: OverscanIndicesGetterParams +) => OverscanIndices; export type ScrollOffset = { - scrollLeft: number, - scrollTop: number -} + scrollLeft: number; + scrollTop: number; +}; export type CellSizeAndPositionManager = { areOffsetsAdjusted(): boolean; @@ -76,7 +89,10 @@ export type CellSizeAndPositionManager = { getCellCount(): number; getEstimatedCellSize(): number; getLastMeasuredIndex(): number; - getOffsetAdjustment({ containerSize, offset/*safe*/ }: ContainerSizeAndOffset): number; + getOffsetAdjustment({ + containerSize, + offset /*safe*/ + }: ContainerSizeAndOffset): number; /** * This method returns the size and position for the cell at the specified index. * It just-in-time calculates (or used cached values) for cells leading up to the index. @@ -101,10 +117,10 @@ export type CellSizeAndPositionManager = { * @return Offset to use to ensure the specified cell is visible */ getUpdatedOffsetForIndex(params: { - align: string, - containerSize: number, - currentOffset: number, - targetIndex: number + align: string; + containerSize: number; + currentOffset: number; + targetIndex: number; }): number; getVisibleCellRange(params: GetVisibleCellRangeParams): VisibleCellRange; /** @@ -112,33 +128,36 @@ export type CellSizeAndPositionManager = { * This method should be called for any cell that has changed its size. * It will not immediately perform any calculations; they'll be performed the next time getSizeAndPositionOfCell() is called. */ - resetCell(index: number): void -} + resetCell(index: number): void; +}; export type GridCellRangeProps = { - cellCache: Map, - cellRenderer: GridCellRenderer, - columnSizeAndPositionManager: CellSizeAndPositionManager, - columnStartIndex: number, - columnStopIndex: number, - isScrolling: boolean, - rowSizeAndPositionManager: CellSizeAndPositionManager, - rowStartIndex: number, - rowStopIndex: number, - scrollLeft: number, - scrollTop: number, - deferredMeasurementCache: CellMeasurerCache, - horizontalOffsetAdjustment: number, - parent: typeof Grid | typeof List | typeof Table, - styleCache: Map, - verticalOffsetAdjustment: number, - visibleColumnIndices: VisibleCellRange, - visibleRowIndices: VisibleCellRange -} -export type GridCellRangeRenderer = (params: GridCellRangeProps) => React.ReactNode[]; + cellCache: Map; + cellRenderer: GridCellRenderer; + columnSizeAndPositionManager: CellSizeAndPositionManager; + columnStartIndex: number; + columnStopIndex: number; + isScrolling: boolean; + rowSizeAndPositionManager: CellSizeAndPositionManager; + rowStartIndex: number; + rowStopIndex: number; + scrollLeft: number; + scrollTop: number; + deferredMeasurementCache: CellMeasurerCache; + horizontalOffsetAdjustment: number; + parent: MeasuredCellParent; + styleCache: Map; + verticalOffsetAdjustment: number; + visibleColumnIndices: VisibleCellRange; + visibleRowIndices: VisibleCellRange; +}; +export type GridCellRangeRenderer = ( + params: GridCellRangeProps +) => React.ReactNode[]; export type GridCoreProps = { - 'aria-label'?: string; + "aria-label"?: string; + "aria-readonly"?: boolean; /** * Set the width of the inner scrollable container to 'auto'. * This is useful for single-column Grids to ensure that the column doesn't extend below a vertical scrollbar. @@ -175,6 +194,10 @@ export type GridCoreProps = { * Optional custom CSS class name to attach to root Grid element. */ className?: string; + /** Unfiltered props for the Grid container. */ + containerProps?: object; + /** ARIA role for the cell-container. */ + containerRole?: string; /** Optional inline style applied to inner cell-container */ containerStyle?: React.CSSProperties; /** @@ -208,7 +231,7 @@ export type GridCoreProps = { * Override internal is-scrolling state tracking. * This property is primarily intended for use with the WindowScroller component. */ - isScrolling?: boolean, + isScrolling?: boolean; /** * Optional renderer to be used in place of rows when either :rowCount or :columnCount is 0. */ @@ -295,7 +318,7 @@ export type GridCoreProps = { * https://github.com/bvaughn/react-virtualized#pass-thru-props */ [key: string]: any; -} +}; export type GridProps = GridCoreProps & { /** @@ -314,95 +337,69 @@ export type GridProps = GridCoreProps & { columnWidth: number | ((params: Index) => number); }; -export type ScrollDirection = 'horizontal' | 'vertical'; +export type ScrollDirection = "horizontal" | "vertical"; export type GridState = { - isScrolling: boolean, - scrollDirectionHorizontal: ScrollDirection, - scrollDirectionVertical: ScrollDirection, - scrollLeft: number, - scrollTop: number + isScrolling: boolean; + scrollDirectionHorizontal: ScrollDirection; + scrollDirectionVertical: ScrollDirection; + scrollLeft: number; + scrollTop: number; }; /** * Specifies the number of miliseconds during which to disable pointer events while a scroll is in progress. * This improves performance and makes scrolling smoother. */ -export const DEFAULT_SCROLLING_RESET_TIME_INTERVAL = 150 +export const DEFAULT_SCROLLING_RESET_TIME_INTERVAL = 150; /** * Renders tabular data with virtualization along the vertical and horizontal axes. * Row heights and column widths must be known ahead of time and specified as properties. */ export class Grid extends PureComponent { - static propTypes: { - 'aria-label': Requireable, - autoContainerWidth: Requireable, - autoHeight: Requireable, - cellRenderer: Validator<(props: GridCellProps) => React.ReactNode>, - cellRangeRenderer: Validator<(params: GridCellRangeProps) => React.ReactNode[]>, - className: Requireable, - columnCount: Validator, - columnWidth: Validator number)>, - containerStyle: Requireable, - deferredMeasurementCache: Requireable, - estimatedColumnSize: Validator, - estimatedRowSize: Validator, - getScrollbarSize: Validator<() => number>, - height: Validator, - id: Requireable, - isScrolling: Requireable, - noContentRenderer: Requireable<() => JSX.Element>, - onScroll: Validator<(params: ScrollParams) => void>, - onSectionRendered: Validator<(params: SectionRenderedParams) => void>, - overscanColumnCount: Validator, - overscanIndicesGetter: Validator, - overscanRowCount: Validator, - role: Requireable, - rowHeight: Validator number)>, - rowCount: Validator, - scrollingResetTimeInterval: Requireable, - scrollLeft: Requireable, - scrollToAlignment: Validator, - scrollToColumn: Validator, - scrollTop: Requireable, - scrollToRow: Validator, - style: Requireable, - tabIndex: Requireable, - width: Validator - }; - static defaultProps: { - 'aria-label': 'grid', - cellRangeRenderer: GridCellRangeRenderer, - estimatedColumnSize: 100, - estimatedRowSize: 30, - getScrollbarSize: () => number, - noContentRenderer: () => null, - onScroll: () => null, - onSectionRendered: () => null, - overscanColumnCount: 0, - overscanIndicesGetter: OverscanIndicesGetter, - overscanRowCount: 10, - role: 'grid', - scrollingResetTimeInterval: typeof DEFAULT_SCROLLING_RESET_TIME_INTERVAL, - scrollToAlignment: 'auto', - scrollToColumn: -1, - scrollToRow: -1, - style: {}, - tabIndex: 0 + "aria-label": "grid"; + "aria-readonly": true; + autoContainerWidth: false; + autoHeight: false; + autoWidth: false; + cellRangeRenderer: GridCellRangeRenderer; + containerRole: "rowgroup"; + containerStyle: {}; + estimatedColumnSize: 100; + estimatedRowSize: 30; + getScrollbarSize: () => number; + noContentRenderer: () => React.ReactNode; + onScroll: () => void; + onScrollbarPresenceChange: () => void; + onSectionRendered: () => void; + overscanColumnCount: 0; + overscanIndicesGetter: OverscanIndicesGetter; + overscanRowCount: 10; + role: "grid"; + scrollingResetTimeInterval: typeof DEFAULT_SCROLLING_RESET_TIME_INTERVAL; + scrollToAlignment: "auto"; + scrollToColumn: -1; + scrollToRow: -1; + style: {}; + tabIndex: 0; }; - constructor(props: GridProps, context: any); - /** * Gets offsets for a given cell and alignment. */ getOffsetForCell(params?: { - alignment?: Alignment, - columnIndex?: number, - rowIndex?: number - }): ScrollOffset + alignment?: Alignment; + columnIndex?: number; + rowIndex?: number; + }): ScrollOffset; + + /** + * This method handles a scroll event originating from an external scroll control. + * It's an advanced method and should probably not be used unless you're implementing a custom scroll-bar solution. + */ + handleScrollEvent(params: Partial): void; /** * Invalidate Grid size and recompute visible cells. @@ -412,9 +409,9 @@ export class Grid extends PureComponent { */ // @TODO (bvaughn) Add automated test coverage for this. invalidateCellSizeAfterRender(params: { - columnIndex: number, - rowIndex: number - }): void + columnIndex: number; + rowIndex: number; + }): void; /** * Pre-measure all columns and rows in a Grid. @@ -429,56 +426,24 @@ export class Grid extends PureComponent { * Since Grid only receives :columnCount and :rowCount it has no way of detecting when the underlying data changes. */ recomputeGridSize(params?: { - columnIndex?: number, - rowIndex?: number + columnIndex?: number; + rowIndex?: number; }): void; /** * Ensure column and row are visible. */ - scrollToCell(params: { - columnIndex: number, - rowIndex: number - }): void; + scrollToCell(params: { columnIndex: number; rowIndex: number }): void; /** * Scroll to the specified offset(s). * Useful for animating position changes. */ - scrollToPosition(params?: { - scrollLeft: number, - scrollTop: number - }): void; - - componentDidMount(): void; - - /** - * @private - * This method updates scrollLeft/scrollTop in state for the following conditions: - * 1) New scroll-to-cell props have been set - */ - componentDidUpdate(prevProps: GridProps, prevState: GridState): void; - - componentWillMount(): void; - - componentWillUnmount(): void; - - /** - * @private - * This method updates scrollLeft/scrollTop in state for the following conditions: - * 1) Empty content (0 rows or columns) - * 2) New scroll props overriding the current state - * 3) Cells-count or cells-size has changed, making previous scroll offsets invalid - */ - componentWillReceiveProps(nextProps: GridProps): void; - - componentWillUpdate(nextProps: GridProps, nextState: GridState): void; - - render(): JSX.Element; + scrollToPosition(params?: { scrollLeft: number; scrollTop: number }): void; } export const defaultCellRangeRenderer: GridCellRangeRenderer; -export const accessibilityOverscanIndicesGetter: OverscanIndicesGetter +export const accessibilityOverscanIndicesGetter: OverscanIndicesGetter; export const defaultOverscanIndicesGetter: OverscanIndicesGetter; diff --git a/types/react-virtualized/dist/es/InfiniteLoader.d.ts b/types/react-virtualized/dist/es/InfiniteLoader.d.ts index c247ad3c0e..78b3d0a39b 100644 --- a/types/react-virtualized/dist/es/InfiniteLoader.d.ts +++ b/types/react-virtualized/dist/es/InfiniteLoader.d.ts @@ -1,10 +1,10 @@ -import { PureComponent, Validator, Requireable } from 'react' -import { Index, IndexRange } from '../../index'; +import { PureComponent, Validator, Requireable } from "react"; +import { Index, IndexRange } from "../../index"; export type InfiniteLoaderChildProps = { - onRowsRendered: (params: { startIndex: number, stopIndex: number }) => void, - registerChild: (registeredChild: any) => void -} + onRowsRendered: (params: { startIndex: number; stopIndex: number }) => void; + registerChild: (registeredChild: any) => void; +}; export type InfiniteLoaderProps = { /** @@ -15,7 +15,7 @@ export type InfiniteLoaderProps = { * The specified :onRowsRendered function should be passed through to the child's :onRowsRendered property. * The :registerChild callback should be set as the virtualized component's :ref. */ - children?: (props: InfiniteLoaderChildProps) => React.ReactNode; + children: (props: InfiniteLoaderChildProps) => React.ReactNode; /** * Function responsible for tracking the loaded state of each row. * It should implement the following signature: ({ index: number }): boolean @@ -61,23 +61,21 @@ export type InfiniteLoaderProps = { */ export class InfiniteLoader extends PureComponent { static propTypes: { - children: Validator<(props: InfiniteLoaderChildProps) => React.ReactNode>, - isRowLoaded: Validator<(params: Index) => boolean>, - loadMoreRows: Validator<(params: IndexRange) => Promise>, - minimumBatchSize: Validator, - rowCount: Validator, - threshold: Validator + children: Validator< + (props: InfiniteLoaderChildProps) => React.ReactNode + >; + isRowLoaded: Validator<(params: Index) => boolean>; + loadMoreRows: Validator<(params: IndexRange) => Promise>; + minimumBatchSize: Validator; + rowCount: Validator; + threshold: Validator; }; static defaultProps: { - minimumBatchSize: 10, - rowCount: 0, - threshold: 15 + minimumBatchSize: 10; + rowCount: 0; + threshold: 15; }; - constructor(props: InfiniteLoaderProps, context: any); - resetLoadMoreRowsCache(autoReload?: boolean): void; - - render(): JSX.Element; } diff --git a/types/react-virtualized/dist/es/List.d.ts b/types/react-virtualized/dist/es/List.d.ts index 7f550d2dcb..23d76e19ab 100644 --- a/types/react-virtualized/dist/es/List.d.ts +++ b/types/react-virtualized/dist/es/List.d.ts @@ -1,9 +1,17 @@ -import { PureComponent, Validator, Requireable } from 'react' -import { Grid, GridCoreProps, GridCellProps, OverscanIndicesGetter } from './Grid' -import { Index, IndexRange, Alignment } from '../../index' -import { CellMeasurerCache } from './CellMeasurer' +import { PureComponent, Validator, Requireable } from "react"; +import { + Grid, + GridCoreProps, + GridCellProps, + OverscanIndicesGetter +} from "./Grid"; +import { Index, IndexRange, Alignment } from "../../index"; +import { CellMeasurerCache, CellPosition } from "./CellMeasurer"; -export type ListRowProps = GridCellProps & { index: number, style: React.CSSProperties }; +export type ListRowProps = GridCellProps & { + index: number; + style: React.CSSProperties; +}; export type ListRowRenderer = (props: ListRowProps) => React.ReactNode; export type ListProps = GridCoreProps & { @@ -28,7 +36,14 @@ export type ListProps = GridCoreProps & { * Callback invoked with information about the slice of rows that were just rendered. * ({ startIndex, stopIndex }): void */ - onRowsRendered?: (info: { overscanStartIndex: number, overscanStopIndex: number, startIndex: number, stopIndex: number }) => void; + onRowsRendered?: ( + info: { + overscanStartIndex: number; + overscanStopIndex: number; + startIndex: number; + stopIndex: number; + } + ) => void; /** * Number of rows to render above/below the visible bounds of the list. * These rows can help for smoother scrolling on touch devices. @@ -39,9 +54,11 @@ export type ListProps = GridCoreProps & { * This callback can be used to sync scrolling between lists, tables, or grids. * ({ clientHeight, scrollHeight, scrollTop }): void */ - onScroll?: (info: { clientHeight: number, scrollHeight: number, scrollTop: number }) => void; + onScroll?: ( + info: { clientHeight: number; scrollHeight: number; scrollTop: number } + ) => void; /** See Grid#overscanIndicesGetter */ - overscanIndicesGetter?: OverscanIndicesGetter, + overscanIndicesGetter?: OverscanIndicesGetter; /** * Either a fixed row height (number) or a function that returns the height of a row given its index. * ({ index: number }): number @@ -63,7 +80,7 @@ export type ListProps = GridCoreProps & { tabIndex?: number | null; /** Width of list */ width: number; -} +}; /** * It is inefficient to create and manage a large list of DOM elements within a scrolling container * if only a few of those elements are visible. The primary purpose of this component is to improve @@ -73,60 +90,44 @@ export type ListProps = GridCoreProps & { * This component renders a virtualized list of elements with either fixed or dynamic heights. */ export class List extends PureComponent { - static propTypes: { - 'aria-label': Requireable, - autoHeight: Requireable, - className: Requireable, - estimatedRowSize: Validator, - height: Validator, - noRowsRenderer: Validator<() => JSX.Element>, - onRowsRendered: Validator<(params: IndexRange) => void>, - overscanRowCount: Validator, - onScroll: Validator<(params: { clientHeight: number, scrollHeight: number, scrollTop: number }) => void>, - overscanIndicesGetter: Validator, - rowHeight: Validator number)>, - rowRenderer: Validator, - rowCount: Validator, - scrollToAlignment: Validator, - scrollToIndex: Validator, - scrollTop: Requireable, - style: Validator, - tabIndex: Requireable, - width: Validator - }; - static defaultProps: { - estimatedRowSize: 30, - noRowsRenderer: () => null, - onRowsRendered: () => null, - onScroll: () => null, - overscanRowCount: 10, - scrollToAlignment: 'auto', - scrollToIndex: -1, - style: {} + autoHeight: false; + estimatedRowSize: 30; + onScroll: () => void; + noRowsRenderer: () => null; + onRowsRendered: () => void; + overscanIndicesGetter: OverscanIndicesGetter; + overscanRowCount: 10; + scrollToAlignment: "auto"; + scrollToIndex: -1; + style: {}; }; - constructor(props: ListProps, context: any); + Grid?: Grid; forceUpdateGrid(): void; + /** See Grid#getOffsetForCell */ + getOffsetForRow(params: { alignment?: Alignment; index?: number }): number; + + /** CellMeasurer compatibility */ + invalidateCellSizeAfterRender({ + columnIndex, + rowIndex + }: CellPosition): void; + /** See Grid#measureAllCells */ measureAllRows(): void; + /** CellMeasurer compatibility */ + recomputeGridSize(params?: Partial): void; + /** See Grid#recomputeGridSize */ recomputeRowHeights(index?: number): void; - /** See Grid#getOffsetForCell */ - getOffsetForRow(params: { - alignment?: Alignment, - index?: number - }): number; - /** See Grid#scrollToPosition */ scrollToPosition(scrollTop?: number): void; /** See Grid#scrollToCell */ scrollToRow(index?: number): void; - - render(): JSX.Element; } diff --git a/types/react-virtualized/dist/es/Masonry.d.ts b/types/react-virtualized/dist/es/Masonry.d.ts index 59394bc170..f29cf86749 100644 --- a/types/react-virtualized/dist/es/Masonry.d.ts +++ b/types/react-virtualized/dist/es/Masonry.d.ts @@ -1,52 +1,59 @@ -import { PureComponent, Validator, Requireable } from 'react' -import { CellMeasurerCache, KeyMapper } from './CellMeasurer'; -import { GridCellRenderer } from './Grid'; +import { PureComponent, Validator, Requireable } from "react"; +import { + CellMeasurerCacheInterface, + KeyMapper, + MeasuredCellParent +} from "./CellMeasurer"; +import { GridCellRenderer } from "./Grid"; /** * Specifies the number of miliseconds during which to disable pointer events while a scroll is in progress. * This improves performance and makes scrolling smoother. */ -export const DEFAULT_SCROLLING_RESET_TIME_INTERVAL = 150 +export const DEFAULT_SCROLLING_RESET_TIME_INTERVAL = 150; -export type OnCellsRenderedCallback = (params: { - startIndex: number, - stopIndex: number -}) => void; +export type OnCellsRenderedCallback = ( + params: { + startIndex: number; + stopIndex: number; + } +) => void; -export type OnScrollCallback = (params: { - clientHeight: number, - scrollHeight: number, - scrollTop: number -}) => void; +export type OnScrollCallback = ( + params: { + clientHeight: number; + scrollHeight: number; + scrollTop: number; + } +) => void; export type MasonryCellProps = { - index: number, - isScrolling: boolean, - key: React.Key, - parent: React.ReactType, - style?: React.CSSProperties -} + index: number; + isScrolling: boolean; + key: React.Key; + parent: MeasuredCellParent; + style?: React.CSSProperties; +}; -export type CellRenderer = (props: MasonryCellProps) => React.ReactNode +export type CellRenderer = (props: MasonryCellProps) => React.ReactNode; export type MasonryProps = { - autoHeight: boolean, - cellCount: number, - cellMeasurerCache: CellMeasurerCache, - cellPositioner: Positioner, - cellRenderer: CellRenderer, - className?: string, - height: number, - id?: string, - keyMapper?: KeyMapper, - onCellsRendered?: OnCellsRenderedCallback, - onScroll?: OnScrollCallback, - overscanByPixels?: number, - role?: string, - scrollingResetTimeInterval?: number, - scrollTop?: number, - style?: React.CSSProperties, - tabIndex?: number | null, - width: number, + autoHeight: boolean; + cellCount: number; + cellMeasurerCache: CellMeasurerCacheInterface; + cellPositioner: Positioner; + cellRenderer: CellRenderer; + className?: string; + height: number; + id?: string; + keyMapper?: KeyMapper; + onCellsRendered?: OnCellsRenderedCallback; + onScroll?: OnScrollCallback; + overscanByPixels?: number; + role?: string; + scrollingResetTimeInterval?: number; + style?: React.CSSProperties; + tabIndex?: number | null; + width: number; /** * PLEASE NOTE * The [key: string]: any; line is here on purpose @@ -55,12 +62,12 @@ export type MasonryProps = { * https://github.com/bvaughn/react-virtualized#pass-thru-props */ [key: string]: any; -} +}; export type MasonryState = { - isScrolling: boolean, - scrollTop: number -} + isScrolling: boolean; + scrollTop: number; +}; /** * This component efficiently displays arbitrarily positioned cells using windowing techniques. @@ -92,61 +99,58 @@ export type MasonryState = { */ export class Masonry extends PureComponent { static defaultProps: { - autoHeight: false, - keyMapper: identity, - onCellsRendered: noop, - onScroll: noop, - overscanByPixels: 20, - role: 'grid', - scrollingResetTimeInterval: typeof DEFAULT_SCROLLING_RESET_TIME_INTERVAL, - style: emptyObject, - tabIndex: 0 - } - - constructor(props: MasonryProps, context: any); + autoHeight: false; + keyMapper: identity; + onCellsRendered: noop; + onScroll: noop; + overscanByPixels: 20; + role: "grid"; + scrollingResetTimeInterval: typeof DEFAULT_SCROLLING_RESET_TIME_INTERVAL; + style: emptyObject; + tabIndex: 0; + }; clearCellPositions(): void; // HACK This method signature was intended for Grid - invalidateCellSizeAfterRender(params: { rowIndex: number }): void + invalidateCellSizeAfterRender(params: { rowIndex: number }): void; recomputeCellPositions(): void; - componentDidMount(): void; - - componentDidUpdate(prevProps: MasonryProps, prevState: MasonryState): void; - - componentWillUnmount(): void; - - componentWillReceiveProps(nextProps: MasonryProps): void; - - render(): JSX.Element; + static getDerivedStateFromProps( + nextProps: MasonryProps, + prevState: MasonryState + ): MasonryState | null; } -export type emptyObject = {} +export type emptyObject = {}; export type identity = (value: T) => T; export type noop = () => void; export type Position = { - left: number, - top: number + left: number; + top: number; }; export type createCellPositionerParams = { - cellMeasurerCache: CellMeasurerCache, - columnCount: number, - columnWidth: number, - spacer?: number + cellMeasurerCache: CellMeasurerCacheInterface; + columnCount: number; + columnWidth: number; + spacer?: number; }; export type resetParams = { - columnCount: number, - columnWidth: number, - spacer?: number + columnCount: number; + columnWidth: number; + spacer?: number; }; -export type Positioner = ((index: number) => Position) & { reset: (params: resetParams) => void }; +export type Positioner = ((index: number) => Position) & { + reset: (params: resetParams) => void; +}; -export const createCellPositioner: (params: createCellPositionerParams) => Positioner; +export const createCellPositioner: ( + params: createCellPositionerParams +) => Positioner; diff --git a/types/react-virtualized/dist/es/MultiGrid.d.ts b/types/react-virtualized/dist/es/MultiGrid.d.ts index 96c33e3bed..7796b1c281 100644 --- a/types/react-virtualized/dist/es/MultiGrid.d.ts +++ b/types/react-virtualized/dist/es/MultiGrid.d.ts @@ -1,5 +1,6 @@ -import { PureComponent, Validator, Requireable } from 'react' -import { GridProps } from './Grid' +import { PureComponent, Validator, Requireable } from "react"; +import { GridProps } from "./Grid"; +import { CellPosition } from "./CellMeasurer"; export type MultiGridProps = { classNameBottomLeftGrid?: string; @@ -18,9 +19,9 @@ export type MultiGridProps = { } & GridProps; export type MultiGridState = { - scrollLeft: number, - scrollTop: number -} + scrollLeft: number; + scrollTop: number; +}; /** * Renders 1, 2, or 4 Grids depending on configuration. @@ -31,63 +32,54 @@ export type MultiGridState = { */ export class MultiGrid extends PureComponent { static propTypes: { - classNameBottomLeftGrid: Validator, - classNameBottomRightGrid: Validator, - classNameTopLeftGrid: Validator, - classNameTopRightGrid: Validator, - enableFixedColumnScroll: Validator, - enableFixedRowScroll: Validator, - fixedColumnCount: Validator, - fixedRowCount: Validator, - style: Validator, - styleBottomLeftGrid: Validator, - styleBottomRightGrid: Validator, - styleTopLeftGrid: Validator, - styleTopRightGrid: Validator + classNameBottomLeftGrid: Validator; + classNameBottomRightGrid: Validator; + classNameTopLeftGrid: Validator; + classNameTopRightGrid: Validator; + enableFixedColumnScroll: Validator; + enableFixedRowScroll: Validator; + fixedColumnCount: Validator; + fixedRowCount: Validator; + style: Validator; + styleBottomLeftGrid: Validator; + styleBottomRightGrid: Validator; + styleTopLeftGrid: Validator; + styleTopRightGrid: Validator; }; static defaultProps: { - classNameBottomLeftGrid: '', - classNameBottomRightGrid: '', - classNameTopLeftGrid: '', - classNameTopRightGrid: '', - enableFixedColumnScroll: false, - enableFixedRowScroll: false, - fixedColumnCount: 0, - fixedRowCount: 0, - style: {}, - styleBottomLeftGrid: {}, - styleBottomRightGrid: {}, - styleTopLeftGrid: {}, - styleTopRightGrid: {} + classNameBottomLeftGrid: ""; + classNameBottomRightGrid: ""; + classNameTopLeftGrid: ""; + classNameTopRightGrid: ""; + enableFixedColumnScroll: false; + enableFixedRowScroll: false; + fixedColumnCount: 0; + fixedRowCount: 0; + scrollToColumn: -1; + scrollToRow: -1; + style: {}; + styleBottomLeftGrid: {}; + styleBottomRightGrid: {}; + styleTopLeftGrid: {}; + styleTopRightGrid: {}; }; - constructor(props: MultiGridProps, context: any); - forceUpdateGrids(): void; /** See Grid#invalidateCellSizeAfterRender */ - invalidateCellSizeAfterRender(params?: { - columnIndex?: number, - rowIndex?: number - }): void; + invalidateCellSizeAfterRender(params?: Partial): void; /** See Grid#measureAllCells */ measureAllCells(): void; /** See Grid#recomputeGridSize */ recomputeGridSize(params?: { - columnIndex?: number, - rowIndex?: number + columnIndex?: number; + rowIndex?: number; }): void; - - componentDidMount(): void; - - componentDidUpdate(prevProps: MultiGridProps, prevState: MultiGridState): void; - - componentWillMount(): void; - - componentWillReceiveProps(nextProps: MultiGridProps, nextState: MultiGridState): void; - - render(): JSX.Element; + static getDerivedStateFromProps( + nextProps: MultiGridProps, + prevState: MultiGridState + ): MultiGridState | null; } diff --git a/types/react-virtualized/dist/es/ScrollSync.d.ts b/types/react-virtualized/dist/es/ScrollSync.d.ts index 00137bf635..3a6cad6a6d 100644 --- a/types/react-virtualized/dist/es/ScrollSync.d.ts +++ b/types/react-virtualized/dist/es/ScrollSync.d.ts @@ -1,23 +1,23 @@ -import { PureComponent, Validator, Requireable } from 'react' +import { PureComponent, Validator, Requireable } from "react"; export type OnScrollParams = { - clientHeight: number, - clientWidth: number, - scrollHeight: number, - scrollLeft: number, - scrollTop: number, - scrollWidth: number -} + clientHeight: number; + clientWidth: number; + scrollHeight: number; + scrollLeft: number; + scrollTop: number; + scrollWidth: number; +}; export type ScrollSyncChildProps = { - clientHeight: number, - clientWidth: number, - onScroll: (params: OnScrollParams) => void, - scrollHeight: number, - scrollLeft: number, - scrollTop: number, - scrollWidth: number -} + clientHeight: number; + clientWidth: number; + onScroll: (params: OnScrollParams) => void; + scrollHeight: number; + scrollLeft: number; + scrollTop: number; + scrollWidth: number; +}; export type ScrollSyncProps = { /** @@ -25,7 +25,7 @@ export type ScrollSyncProps = { * This function should implement the following signature: * ({ onScroll, scrollLeft, scrollTop }) => PropTypes.element */ - children?: (props: ScrollSyncChildProps) => React.ReactNode + children: (props: ScrollSyncChildProps) => React.ReactNode; /** * PLEASE NOTE * The [key: string]: any; line is here on purpose @@ -37,23 +37,22 @@ export type ScrollSyncProps = { }; export type ScrollSyncState = { - clientHeight: number, - clientWidth: number, - scrollHeight: number, - scrollLeft: number, - scrollTop: number, - scrollWidth: number + clientHeight: number; + clientWidth: number; + scrollHeight: number; + scrollLeft: number; + scrollTop: number; + scrollWidth: number; }; /** * HOC that simplifies the process of synchronizing scrolling between two or more virtualized components. */ -export class ScrollSync extends PureComponent { +export class ScrollSync extends PureComponent< + ScrollSyncProps, + ScrollSyncState +> { static propTypes: { - children: Validator<(props: ScrollSyncChildProps) => React.ReactNode> + children: Validator<(props: ScrollSyncChildProps) => React.ReactNode>; }; - - constructor(props: ScrollSyncProps, context: any); - - render(): JSX.Element; } diff --git a/types/react-virtualized/dist/es/Table.d.ts b/types/react-virtualized/dist/es/Table.d.ts index f74c816463..571f67a371 100644 --- a/types/react-virtualized/dist/es/Table.d.ts +++ b/types/react-virtualized/dist/es/Table.d.ts @@ -1,63 +1,110 @@ -import { Validator, Requireable, PureComponent, Component } from 'react'; -import { CellMeasurerCache } from './CellMeasurer'; -import { Index, Alignment, ScrollEventData, IndexRange, OverscanIndexRange } from '../../index'; -import { Grid, GridCoreProps } from './Grid'; +import { Validator, Requireable, PureComponent, Component } from "react"; +import { CellMeasurerCache } from "./CellMeasurer"; +import { + Index, + Alignment, + ScrollEventData, + IndexRange, + OverscanIndexRange +} from "../../index"; +import { Grid, GridCoreProps } from "./Grid"; + +export type SortParams = { + defaultSortDirection: SortDirectionType; + event: MouseEvent; + sortBy: string; +}; + +export type SortDirectionMap = { [key: string]: SortDirectionType }; + +export type MultiSortOptions = { + defaultSortBy?: string[]; + defaultSortDirection?: SortDirectionMap; +}; + +export type MultiSortReturn = { + /** + * Sort property to be passed to the `Table` component. + * This function updates `sortBy` and `sortDirection` values. + */ + sort: (params: SortParams) => void; + + /** + * Specifies the fields currently responsible for sorting data, + * In order of importance. + */ + sortBy: string[]; + + /** + * Specifies the direction a specific field is being sorted in. + */ + sortDirection: SortDirectionMap; +}; + +export function createMultiSort( + sortCallback: ( + params: { sortBy: string; sortDirection: SortDirectionType } + ) => void, + options?: MultiSortOptions +): MultiSortReturn; export type TableCellDataGetterParams = { - columnData?: any, - dataKey: string, - rowData: any + columnData?: any; + dataKey: string; + rowData: any; }; export type TableCellProps = { - cellData?: any, - columnData?: any, - columnIndex: number, - dataKey: string, - isScrolling: boolean, - parent?: any, - rowData: any, - rowIndex: number + cellData?: any; + columnData?: any; + columnIndex: number; + dataKey: string; + isScrolling: boolean; + parent?: any; + rowData: any; + rowIndex: number; }; export type TableHeaderProps = { - columnData?: any, - dataKey: string, - disableSort?: boolean, - label?: string, - sortBy?: string, - sortDirection?: SortDirectionType + columnData?: any; + dataKey: string; + disableSort?: boolean; + label?: string; + sortBy?: string; + sortDirection?: SortDirectionType; }; export type TableHeaderRowProps = { - className: string, - columns: React.ReactNode[], - style: React.CSSProperties, - scrollbarWidth: number, - height: number, - width: number + className: string; + columns: React.ReactNode[]; + style: React.CSSProperties; + scrollbarWidth: number; + height: number; + width: number; }; export type TableRowProps = { - className: string, - columns: any[], - index: number, - isScrolling: boolean, - onRowClick?: (params: RowMouseEventHandlerParams) => void, - onRowDoubleClick?: (params: RowMouseEventHandlerParams) => void, - onRowMouseOver?: (params: RowMouseEventHandlerParams) => void, - onRowMouseOut?: (params: RowMouseEventHandlerParams) => void, - onRowRightClick?: (params: RowMouseEventHandlerParams) => void, - rowData: any, - style: any + className: string; + columns: any[]; + index: number; + isScrolling: boolean; + onRowClick?: (params: RowMouseEventHandlerParams) => void; + onRowDoubleClick?: (params: RowMouseEventHandlerParams) => void; + onRowMouseOver?: (params: RowMouseEventHandlerParams) => void; + onRowMouseOut?: (params: RowMouseEventHandlerParams) => void; + onRowRightClick?: (params: RowMouseEventHandlerParams) => void; + rowData: any; + style: any; }; export type TableCellDataGetter = (params: TableCellDataGetterParams) => any; export type TableCellRenderer = (props: TableCellProps) => React.ReactNode; export type TableHeaderRenderer = (props: TableHeaderProps) => React.ReactNode; -export type TableHeaderRowRenderer = (props: TableHeaderRowProps) => React.ReactNode; +export type TableHeaderRowRenderer = ( + props: TableHeaderRowProps +) => React.ReactNode; export type TableRowRenderer = (props: TableRowProps) => React.ReactNode; // https://github.com/bvaughn/react-virtualized/blob/master/docs/Column.md export type ColumnProps = { /** Optional aria-label value to set on the column header */ - 'aria-label'?: string, + "aria-label"?: string; /** * Callback responsible for returning a cell's data, given its :dataKey * ({ columnData: any, dataKey: string, rowData: any }): any @@ -103,57 +150,57 @@ export type ColumnProps = { style?: React.CSSProperties; /** Flex basis (width) for this column; This value can grow or shrink based on :flexGrow and :flexShrink properties. */ width: number; -} +}; export class Column extends Component { static propTypes: { - 'aria-label': Requireable, - cellDataGetter: Requireable, - cellRenderer: Requireable, - className: Requireable, - columnData: Requireable, - dataKey: Validator, - disableSort: Requireable, - flexGrow: Requireable, - flexShrink: Requireable, - headerClassName: Requireable, - headerRenderer: Validator, - label: Requireable, - maxWidth: Requireable, - minWidth: Requireable, - style: Requireable, - width: Validator, - id: Requireable + "aria-label": Requireable; + cellDataGetter: Requireable; + cellRenderer: Requireable; + className: Requireable; + columnData: Requireable; + dataKey: Validator; + disableSort: Requireable; + flexGrow: Requireable; + flexShrink: Requireable; + headerClassName: Requireable; + headerRenderer: Validator; + label: Requireable; + maxWidth: Requireable; + minWidth: Requireable; + style: Requireable; + width: Validator; + id: Requireable; }; static defaultProps: { - cellDataGetter: TableCellDataGetter, - cellRenderer: TableCellRenderer, - flexGrow: 0, - flexShrink: 1, - headerRenderer: TableHeaderRenderer, - style: {} + cellDataGetter: TableCellDataGetter; + cellRenderer: TableCellRenderer; + flexGrow: 0; + flexShrink: 1; + headerRenderer: TableHeaderRenderer; + style: {}; }; } export type RowMouseEventHandlerParams = { rowData: { - columnData: object, - id: string, - index: number - }, - index: number, - event: React.SyntheticEvent> -} + columnData: object; + id: string; + index: number; + }; + index: number; + event: React.SyntheticEvent>; +}; export type HeaderMouseEventHandlerParams = { - dataKey: string, - columnData: any, - event: React.SyntheticEvent> -} + dataKey: string; + columnData: any; + event: React.SyntheticEvent>; +}; // ref: https://github.com/bvaughn/react-virtualized/blob/master/docs/Table.md export type TableProps = GridCoreProps & { - 'aria-label'?: string, + "aria-label"?: string; deferredMeasurementCache?: CellMeasurerCache; /** * Removes fixed height from the scrollingContainer so that the total height @@ -161,7 +208,9 @@ export type TableProps = GridCoreProps & { */ autoHeight?: boolean; /** One or more Columns describing the data displayed in this row */ - children?: React.ReactElement[] | React.ReactElement; + children?: + | React.ReactElement[] + | React.ReactElement; /** Optional CSS class name */ className?: string; /** Disable rendering the header at all */ @@ -283,7 +332,7 @@ export type TableProps = GridCoreProps & { * Sort function to be called if a sortable header is clicked. * ({ sortBy: string, sortDirection: SortDirection }): void */ - sort?: (info: { sortBy: string, sortDirection: SortDirectionType }) => void; + sort?: (info: { sortBy: string; sortDirection: SortDirectionType }) => void; /** Table data is currently sorted by this :dataKey (if it is sorted at all) */ sortBy?: string; /** Table data is currently sorted in this direction (if it is sorted at all) */ @@ -294,11 +343,13 @@ export type TableProps = GridCoreProps & { tabIndex?: number | null; /** Width of list */ width?: number; -} +}; export const defaultCellDataGetter: TableCellDataGetter; export const defaultCellRenderer: TableCellRenderer; -export const defaultHeaderRenderer: () => React.ReactElement[]; +export const defaultHeaderRenderer: () => React.ReactElement< + TableHeaderProps +>[]; export const defaultHeaderRowRenderer: TableHeaderRowRenderer; export const defaultRowRenderer: TableRowRenderer; @@ -307,20 +358,22 @@ export type SortDirectionStatic = { * Sort items in ascending order. * This means arranging from the lowest value to the highest (e.g. a-z, 0-9). */ - ASC: 'ASC', + ASC: "ASC"; /** * Sort items in descending order. * This means arranging from the highest value to the lowest (e.g. z-a, 9-0). */ - DESC: 'DESC' -} + DESC: "DESC"; +}; -export const SortDirection: SortDirectionStatic +export const SortDirection: SortDirectionStatic; -export type SortDirectionType = 'ASC' | 'DESC' +export type SortDirectionType = "ASC" | "DESC"; -export const SortIndicator: React.StatelessComponent<{ sortDirection: SortDirectionType }> +export const SortIndicator: React.StatelessComponent<{ + sortDirection: SortDirectionType; +}>; /** * Table component with fixed headers and virtualized rows for improved performance with large data sets. @@ -328,74 +381,85 @@ export const SortIndicator: React.StatelessComponent<{ sortDirection: SortDirect */ export class Table extends PureComponent { static propTypes: { - 'aria-label': Requireable, - autoHeight: Requireable, - children: Validator, - className: Requireable, - disableHeader: Requireable, - estimatedRowSize: Validator, - gridClassName: Requireable, - gridStyle: Requireable, - headerClassName: Requireable, - headerHeight: Validator, - headerRowRenderer: Requireable, - headerStyle: Requireable, - height: Validator, - id: Requireable, - noRowsRenderer: Requireable<() => JSX.Element>, - onHeaderClick: Requireable<(params: HeaderMouseEventHandlerParams) => void>, - onRowClick: Requireable<(params: RowMouseEventHandlerParams) => void>, - onRowDoubleClick: Requireable<(params: RowMouseEventHandlerParams) => void>, - onRowMouseOut: Requireable<(params: RowMouseEventHandlerParams) => void>, - onRowMouseOver: Requireable<(params: RowMouseEventHandlerParams) => void>, - onRowsRendered: Requireable<(params: RowMouseEventHandlerParams) => void>, - onScroll: Requireable<(params: ScrollEventData) => void>, - overscanRowCount: Validator, - rowClassName: Requireable string)>, - rowGetter: Validator<(params: Index) => any>, - rowHeight: Validator number)>, - rowCount: Validator, - rowRenderer: Requireable<(props: TableRowProps) => React.ReactNode>, - rowStyle: Validator React.CSSProperties)>, - scrollToAlignment: Validator, - scrollToIndex: Validator, - scrollTop: Requireable, - sort: Requireable<(params: { sortBy: string, sortDirection: SortDirectionType }) => void>, - sortBy: Requireable, - sortDirection: Validator, - style: Requireable, - tabIndex: Requireable, - width: Validator + "aria-label": Requireable; + autoHeight: Requireable; + children: Validator; + className: Requireable; + disableHeader: Requireable; + estimatedRowSize: Validator; + gridClassName: Requireable; + gridStyle: Requireable; + headerClassName: Requireable; + headerHeight: Validator; + headerRowRenderer: Requireable; + headerStyle: Requireable; + height: Validator; + id: Requireable; + noRowsRenderer: Requireable<() => JSX.Element>; + onHeaderClick: Requireable< + (params: HeaderMouseEventHandlerParams) => void + >; + onRowClick: Requireable<(params: RowMouseEventHandlerParams) => void>; + onRowDoubleClick: Requireable< + (params: RowMouseEventHandlerParams) => void + >; + onRowMouseOut: Requireable< + (params: RowMouseEventHandlerParams) => void + >; + onRowMouseOver: Requireable< + (params: RowMouseEventHandlerParams) => void + >; + onRowsRendered: Requireable< + (params: RowMouseEventHandlerParams) => void + >; + onScroll: Requireable<(params: ScrollEventData) => void>; + overscanRowCount: Validator; + rowClassName: Requireable string)>; + rowGetter: Validator<(params: Index) => any>; + rowHeight: Validator number)>; + rowCount: Validator; + rowRenderer: Requireable<(props: TableRowProps) => React.ReactNode>; + rowStyle: Validator< + React.CSSProperties | ((params: Index) => React.CSSProperties) + >; + scrollToAlignment: Validator; + scrollToIndex: Validator; + scrollTop: Requireable; + sort: Requireable< + ( + params: { sortBy: string; sortDirection: SortDirectionType } + ) => void + >; + sortBy: Requireable; + sortDirection: Validator; + style: Requireable; + tabIndex: Requireable; + width: Validator; }; static defaultProps: { - disableHeader: false, - estimatedRowSize: 30, - headerHeight: 0, - headerStyle: {}, - noRowsRenderer: () => null, - onRowsRendered: () => null, - onScroll: () => null, - overscanRowCount: 10, - rowRenderer: TableRowRenderer, - headerRowRenderer: TableHeaderRenderer, - rowStyle: {}, - scrollToAlignment: 'auto', - scrollToIndex: -1, - style: {} + disableHeader: false; + estimatedRowSize: 30; + headerHeight: 0; + headerStyle: {}; + noRowsRenderer: () => null; + onRowsRendered: () => null; + onScroll: () => null; + overscanRowCount: 10; + rowRenderer: TableRowRenderer; + headerRowRenderer: TableHeaderRenderer; + rowStyle: {}; + scrollToAlignment: "auto"; + scrollToIndex: -1; + style: {}; }; Grid: Grid; - constructor(props: TableProps); - forceUpdateGrid(): void; /** See Grid#getOffsetForCell */ - getOffsetForRow(params: { - alignment?: Alignment, - index?: number - }): number; + getOffsetForRow(params: { alignment?: Alignment; index?: number }): number; /** See Grid#scrollToPosition */ scrollToPosition(scrollTop?: number): void; @@ -407,11 +471,5 @@ export class Table extends PureComponent { recomputeRowHeights(index?: number): void; /** See Grid#scrollToCell */ - scrollToRow(index?: number): void - - componentDidMount(): void; - - componentDidUpdate(): void; - - render(): JSX.Element; + scrollToRow(index?: number): void; } diff --git a/types/react-virtualized/dist/es/WindowScroller.d.ts b/types/react-virtualized/dist/es/WindowScroller.d.ts index d19e83c06d..723862485f 100644 --- a/types/react-virtualized/dist/es/WindowScroller.d.ts +++ b/types/react-virtualized/dist/es/WindowScroller.d.ts @@ -1,28 +1,55 @@ -import { Validator, Requireable, PureComponent } from 'react' +import { Validator, Requireable, PureComponent } from "react"; + +/** + * Specifies the number of miliseconds during which to disable pointer events while a scroll is in progress. + * This improves performance and makes scrolling smoother. + */ +export const IS_SCROLLING_TIMEOUT = 150; export type WindowScrollerChildProps = { - height: number, - width: number, - isScrolling: boolean, - scrollTop: number, - onChildScroll: () => void + height: number; + width: number; + isScrolling: boolean; + scrollTop: number; + onChildScroll: () => void; }; export type WindowScrollerProps = { /** * Function responsible for rendering children. * This function should implement the following signature: - * ({ height: number, width: number, isScrolling: boolean, scrollTop: number, onChildScroll: function }) => PropTypes.element + * ({ height, isScrolling, scrollLeft, scrollTop, width }) => PropTypes.element */ - children?: (props: WindowScrollerChildProps) => React.ReactNode; - /** Callback to be invoked on-resize: ({ height }) */ - onResize?: (params: { height: number, width: number }) => void; - /** Callback to be invoked on-scroll: ({ scrollTop }) */ - onScroll?: (params: { scrollTop: number }) => void; + children: ( + params: { + onChildScroll: ({ scrollTop: number }) => void; + registerChild: (params?: Element) => void; + height: number; + isScrolling: boolean; + scrollLeft: number; + scrollTop: number; + width: number; + } + ) => React.ReactNode; + + /** Callback to be invoked on-resize: ({ height, width }) */ + onResize?: (params: { height: number; width: number }) => void; + + /** Callback to be invoked on-scroll: ({ scrollLeft, scrollTop }) */ + onScroll?: (params: { scrollLeft: number; scrollTop: number }) => void; + /** Element to attach scroll event listeners. Defaults to window. */ - scrollElement?: HTMLElement; - /** Wait this amount of time after the last scroll event before resetting WindowScroller pointer-events; defaults to 150ms */ + scrollElement?: typeof window | Element; + /** + * Wait this amount of time after the last scroll event before resetting child `pointer-events`. + */ scrollingResetTimeInterval?: number; + + /** Height used for server-side rendering */ + serverHeight?: number; + + /** Width used for server-side rendering */ + serverWidth?: number; /** * PLEASE NOTE * The [key: string]: any; line is here on purpose @@ -31,43 +58,28 @@ export type WindowScrollerProps = { * https://github.com/bvaughn/react-virtualized#pass-thru-props */ [key: string]: any; -} +}; export type WindowScrollerState = { - height: number, - width: number, - isScrolling: boolean, - scrollLeft: number - scrollTop: number -} - -export class WindowScroller extends PureComponent { - static propTypes: { - children: Requireable<(props: WindowScrollerChildProps) => React.ReactNode>, - onResize: Validator<(params: { height: number, width: number }) => void>, - onScroll: Validator<(params: { scrollTop: number }) => void>, - scrollElement: Validator, - scrollingResetTimeInterval: Validator - }; + height: number; + width: number; + isScrolling: boolean; + scrollLeft: number; + scrollTop: number; +}; +export class WindowScroller extends PureComponent< + WindowScrollerProps, + WindowScrollerState +> { static defaultProps: { - onResize: () => {}, - onScroll: () => {}, - scrollingResetTimeInterval: 150 + onResize: () => void; + onScroll: () => void; + scrollingResetTimeInterval: typeof IS_SCROLLING_TIMEOUT; + scrollElement: Window | undefined; + serverHeight: 0; + serverWidth: 0; }; - constructor(props: WindowScrollerProps); - - // Can’t use defaultProps for scrollElement without breaking server-side rendering - readonly scrollElement: HTMLElement | Window; - updatePosition(scrollElement?: HTMLElement): void; - - componentDidMount(): void; - - componentWillReceiveProps(nextProps: WindowScrollerProps): void; - - componentWillUnmount(): void; - - render(): JSX.Element; } diff --git a/types/react-virtualized/index.d.ts b/types/react-virtualized/index.d.ts index 18710b4983..7c6b5d11fb 100644 --- a/types/react-virtualized/index.d.ts +++ b/types/react-virtualized/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-virtualized 9.7 +// Type definitions for react-virtualized 9.18 // Project: https://github.com/bvaughn/react-virtualized // Definitions by: Kalle Ott // John Gunther @@ -13,20 +13,22 @@ export { ArrowKeyStepper, ArrowKeyStepperProps, - ChildProps as ArrowKeyStepperChildProps -} from './dist/es/ArrowKeyStepper' + ChildProps as ArrowKeyStepperChildProps, + ScrollIndices +} from "./dist/es/ArrowKeyStepper"; export { AutoSizer, AutoSizerProps, - Dimensions -} from './dist/es/AutoSizer' + Dimensions, + Size +} from "./dist/es/AutoSizer"; export { CellMeasurer, CellMeasurerCache, CellMeasurerCacheParams, CellMeasurerProps, KeyMapper -} from './dist/es/CellMeasurer' +} from "./dist/es/CellMeasurer"; export { Collection, CollectionCellGroupRenderer, @@ -36,12 +38,12 @@ export { CollectionCellSizeAndPosition, CollectionCellSizeAndPositionGetter, CollectionProps -} from './dist/es/Collection' +} from "./dist/es/Collection"; export { ColumnSizer, ColumnSizerProps, SizedColumnProps -} from './dist/es/ColumnSizer' +} from "./dist/es/ColumnSizer"; export { accessibilityOverscanIndicesGetter, defaultOverscanIndicesGetter, @@ -64,18 +66,13 @@ export { SectionRenderedParams, SizeAndPositionData, VisibleCellRange -} from './dist/es/Grid' +} from "./dist/es/Grid"; export { InfiniteLoader, InfiniteLoaderChildProps, InfiniteLoaderProps -} from './dist/es/InfiniteLoader' -export { - List, - ListProps, - ListRowProps, - ListRowRenderer -} from './dist/es/List' +} from "./dist/es/InfiniteLoader"; +export { List, ListProps, ListRowProps, ListRowRenderer } from "./dist/es/List"; export { createCellPositioner as createMasonryCellPositioner, Masonry, @@ -87,20 +84,17 @@ export { OnScrollCallback, Position, Positioner -} from './dist/es/Masonry' -export { - MultiGrid, - MultiGridProps, - MultiGridState -} from './dist/es/MultiGrid' +} from "./dist/es/Masonry"; +export { MultiGrid, MultiGridProps, MultiGridState } from "./dist/es/MultiGrid"; export { ScrollSync, OnScrollParams, ScrollSyncChildProps, ScrollSyncProps, ScrollSyncState -} from './dist/es/ScrollSync' +} from "./dist/es/ScrollSync"; export { + createMultiSort as createTableMultiSort, defaultCellDataGetter as defaultTableCellDataGetter, defaultCellRenderer as defaultTableCellRenderer, defaultHeaderRenderer as defaultTableHeaderRenderer, @@ -125,51 +119,52 @@ export { TableProps, TableRowProps, TableRowRenderer -} from './dist/es/Table' +} from "./dist/es/Table"; export { WindowScroller, WindowScrollerChildProps, WindowScrollerProps, - WindowScrollerState -} from './dist/es/WindowScroller' + WindowScrollerState, + IS_SCROLLING_TIMEOUT +} from "./dist/es/WindowScroller"; export type Index = { - index: number + index: number; }; export type PositionInfo = { - x: number, - y: number + x: number; + y: number; }; export type ScrollPosition = { - scrollLeft: number, - scrollTop: number + scrollLeft: number; + scrollTop: number; }; export type SizeInfo = { - height: number, - width: number + height: number; + width: number; }; export type SizeAndPositionInfo = SizeInfo & PositionInfo; export type Map = { [key: string]: T }; -export type Alignment = 'auto' | 'end' | 'start' | 'center'; +export type Alignment = "auto" | "end" | "start" | "center"; export type IndexRange = { - startIndex: number, - stopIndex: number -} + startIndex: number; + stopIndex: number; +}; export type OverscanIndexRange = { - overscanStartIndex: number, - overscanStopIndex: number, -} + overscanStartIndex: number; + overscanStopIndex: number; +}; export type ScrollEventData = { - clientHeight: number, - scrollHeight: number, - scrollTop: number -} + clientHeight: number; + scrollHeight: number; + scrollTop: number; +}; diff --git a/types/react-virtualized/tsconfig.json b/types/react-virtualized/tsconfig.json index 4457f73e3d..9a6a1ce9de 100644 --- a/types/react-virtualized/tsconfig.json +++ b/types/react-virtualized/tsconfig.json @@ -1,22 +1,18 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6", - "dom" - ], + "lib": ["es6", "dom"], "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, "strictFunctionTypes": false, "jsx": "react", "baseUrl": "../", - "typeRoots": [ - "../" - ], + "typeRoots": ["../"], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "target": "es5" }, "files": [ "index.d.ts", @@ -48,4 +44,4 @@ "dist/commonjs/WindowScroller.d.ts", "react-virtualized-tests.tsx" ] -} \ No newline at end of file +} From 775ade8fa63b5d5baa2cd5ae8a64d0c01fc28242 Mon Sep 17 00:00:00 2001 From: ramlez Date: Wed, 11 Apr 2018 21:08:06 +0200 Subject: [PATCH 0602/2153] [BSON] add types for missing `calculateObjectSize` method (#24901) --- types/bson/bson-tests.ts | 9 ++++++++- types/bson/index.d.ts | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/types/bson/bson-tests.ts b/types/bson/bson-tests.ts index ebdd8a19c3..b3173053c8 100644 --- a/types/bson/bson-tests.ts +++ b/types/bson/bson-tests.ts @@ -6,7 +6,7 @@ bson.ObjectID.cacheHexString = true let BSON = new bson.BSON(); let Long = bson.Long; -let doc = {long: Long.fromNumber(100)} +let doc = { long: Long.fromNumber(100) } // Serialize a document let data = BSON.serialize(doc, false, true, false); @@ -19,3 +19,10 @@ console.log("doc_2:", doc_2); BSON = new bson.BSON(); data = BSON.serialize(doc); doc_2 = BSON.deserialize(data); + + +// Calculate Object Size +BSON = new bson.BSON(); +console.log("Calculated Object size - no options object:", BSON.calculateObjectSize(doc)); +console.log("Calculated Object size - empty options object:", BSON.calculateObjectSize(doc, {})); +console.log("Calculated Object size - custom options object:", BSON.calculateObjectSize(doc, { ignoreUndefined: false, serializeFunctions: true })); diff --git a/types/bson/index.d.ts b/types/bson/index.d.ts index 24372ff0f5..3b0feb0113 100644 --- a/types/bson/index.d.ts +++ b/types/bson/index.d.ts @@ -16,6 +16,14 @@ export interface DeserializeOptions { /** {Boolean, default:false}, deserialize Binary data directly into node.js Buffer object. */ promoteBuffers?: boolean; } + +export interface CalculateObjectSizeOptions { + /** {Boolean, default:false}, serialize the javascript functions */ + serializeFunctions?: boolean; + /** {Boolean, default:true}, ignore undefined fields. */ + ignoreUndefined?: boolean; +} + export class BSON { /** * @param {Object} object the Javascript object to serialize. @@ -26,6 +34,14 @@ export class BSON { */ serialize(object: any, checkKeys?: boolean, asBuffer?: boolean, serializeFunctions?: boolean): Buffer; deserialize(buffer: Buffer, options?: DeserializeOptions, isArray?: boolean): any; + /** + * Calculate the bson size for a passed in Javascript object. + * + * @param {Object} object the Javascript object to calculate the BSON byte size for. + * @param {CalculateObjectSizeOptions} Options + * @return {Number} returns the number of bytes the BSON object will take up. + */ + calculateObjectSize(object: any, options?: CalculateObjectSizeOptions): number; } export class Binary { From a0ca17240ae77638c933461a44acbf23739ce662 Mon Sep 17 00:00:00 2001 From: Gintautas Date: Wed, 11 Apr 2018 22:09:01 +0300 Subject: [PATCH 0603/2153] Added superagent retry callback (#24903) https://visionmedia.github.io/superagent/ --- types/superagent/index.d.ts | 2 +- types/superagent/superagent-tests.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/types/superagent/index.d.ts b/types/superagent/index.d.ts index 200046d439..6520b4eb66 100644 --- a/types/superagent/index.d.ts +++ b/types/superagent/index.d.ts @@ -136,7 +136,7 @@ declare namespace request { query(val: object | string): this; redirects(n: number): this; responseType(type: string): this; - retry(count?: number): this; + retry(count?: number, callback?: CallbackHandler): this; send(data?: string | object): this; serialize(serializer: Serializer): this; set(field: object): this; diff --git a/types/superagent/superagent-tests.ts b/types/superagent/superagent-tests.ts index bbea2d617c..351e78b156 100644 --- a/types/superagent/superagent-tests.ts +++ b/types/superagent/superagent-tests.ts @@ -252,6 +252,10 @@ request .get('http://example.com/search') .retry(2) .end(callback); +request + .get('http://example.com/search') + .retry(2, callback) + .end(callback); (() => { const stream = fs.createWriteStream('path/to/my.json'); From 3ca6e33abfd9831f169e27285c47e4d052b81f5c Mon Sep 17 00:00:00 2001 From: Arda TANRIKULU Date: Wed, 11 Apr 2018 22:12:10 +0300 Subject: [PATCH 0604/2153] fix meteor server-render package typings (#24915) * ServiceConfiguration types added * New usage of publishComposite added to meteor-publish-composite * meteor/underscore added * [meteor/server-render] Sink methods are optional * fix onPageLoad * refactor --- types/meteor/server-render.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/meteor/server-render.d.ts b/types/meteor/server-render.d.ts index 1695142ee4..0f78cac1c0 100644 --- a/types/meteor/server-render.d.ts +++ b/types/meteor/server-render.d.ts @@ -12,5 +12,7 @@ declare module "meteor/server-render" { appendToElementById?(id: string, html: string): void; renderIntoElementById?(id: string, html: string): void; } - function onPageLoad(sink: Sink): Promise | any; + + type Callback = (sink: Sink) => Promise | any; + export function onPageLoad(callback: T): T; } From 40c7baae326a38c745493a9aec53c3d17e07661b Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 11 Apr 2018 12:13:03 -0700 Subject: [PATCH 0605/2153] Removed myself from React types authors list (#24921) So many notifications! --- types/react/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index b4c350e7d7..c1be48ddce 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -14,7 +14,6 @@ // Stéphane Goetz // Josh Rutherford // Guilherme Hübner -// Josh Goldberg // Ferdy Budhidharma // Johann Rakotoharisoa // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From fe3fcd77c952fdc23670f0a1c66431384c10862c Mon Sep 17 00:00:00 2001 From: Tom Crockett Date: Wed, 11 Apr 2018 14:34:31 -0700 Subject: [PATCH 0606/2153] [React] Remove string index fallback for CSS properties (#24911) * [React] Remove string index fallback for CSS properties (resolves #24568) * Require a minimum version of 2.2 for csstype * Fix aphrodite types * Fix react-confirm test * Use Omit * Fix react-geosuggest types * Fix victory test * Make customStyle and customStyleOnEditCell into functions --- types/aphrodite/index.d.ts | 37 +++++++++++++-------- types/aphrodite/package.json | 6 ++++ types/react-bootstrap-table/index.d.ts | 4 +-- types/react-confirm/react-confirm-tests.tsx | 6 ++-- types/react-geosuggest/index.d.ts | 10 +++++- types/react/index.d.ts | 6 +--- types/react/package.json | 2 +- types/victory/victory-tests.tsx | 2 +- 8 files changed, 46 insertions(+), 27 deletions(-) create mode 100644 types/aphrodite/package.json diff --git a/types/aphrodite/index.d.ts b/types/aphrodite/index.d.ts index 9684895588..583e84e996 100644 --- a/types/aphrodite/index.d.ts +++ b/types/aphrodite/index.d.ts @@ -4,27 +4,36 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 -import * as React from "react"; +import * as CSS from "csstype"; + +type BaseCSSProperties = CSS.Properties; type FontFamily = - | React.CSSProperties['fontFamily'] - | Pick + | BaseCSSProperties['fontFamily'] + | CSS.FontFace; + +// Replace with Exclude once on 2.8+ +type Diff = ( + & { [P in T]: P } + & { [P in U]: never } + & { [x: string]: never } +)[T]; +type Omit = Pick>; + +type CSSProperties = Omit & { + fontFamily?: FontFamily | FontFamily[]; +}; + +// For pseudo selectors and media queries +interface OpenCSSProperties extends CSSProperties { + [k: string]: CSSProperties[keyof CSSProperties] | CSSProperties; +} /** * Aphrodite style declaration */ export interface StyleDeclaration { - [key: string]: Pick & { - fontFamily?: FontFamily | FontFamily[]; - }; + [key: string]: OpenCSSProperties; } interface StyleSheetStatic { diff --git a/types/aphrodite/package.json b/types/aphrodite/package.json new file mode 100644 index 0000000000..e6696d08e7 --- /dev/null +++ b/types/aphrodite/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "csstype": "^2.2.0" + } +} diff --git a/types/react-bootstrap-table/index.d.ts b/types/react-bootstrap-table/index.d.ts index 1ad6b3be73..6e9fd1dea8 100644 --- a/types/react-bootstrap-table/index.d.ts +++ b/types/react-bootstrap-table/index.d.ts @@ -1857,7 +1857,7 @@ export interface KeyboardNavigation { /** * Return a style object which will be applied on the navigating cell. */ - customStyle?: CSSProperties; + customStyle?(cell: any, row: any): CSSProperties; /** * Set to false to disable click to navigate, usually user wants to click to select row instead of navigation. */ @@ -1865,7 +1865,7 @@ export interface KeyboardNavigation { /** * Return a style object which will be applied on the both of navigating and editing cell. */ - customStyleOnEditCell?: CSSProperties; + customStyleOnEditCell?(cell: any, row: any): CSSProperties; /** * When set to true, pressing ENTER will begin to edit the cell if cellEdit is also enabled. */ diff --git a/types/react-confirm/react-confirm-tests.tsx b/types/react-confirm/react-confirm-tests.tsx index a062b1e2a2..cfa3499ffc 100644 --- a/types/react-confirm/react-confirm-tests.tsx +++ b/types/react-confirm/react-confirm-tests.tsx @@ -6,13 +6,13 @@ interface CustomModalProps { } class CustomModal extends React.Component { - modalStyle(): string { - return this.props.show ? "display: none;" : ""; + modalStyle() { + return this.props.show ? { display: 'none' } : undefined; } render() { return ( -
    +

    {this.props.title}

    diff --git a/types/react-geosuggest/index.d.ts b/types/react-geosuggest/index.d.ts index 2537754b02..344e768b08 100644 --- a/types/react-geosuggest/index.d.ts +++ b/types/react-geosuggest/index.d.ts @@ -16,7 +16,15 @@ export default class Geosuggest extends Component { selectSuggest(value?: Suggest): void; } -export interface GeosuggestProps extends InputHTMLAttributes { +// Replace with Exclude once on 2.8+ +export type Diff = ( + & { [P in T]: P } + & { [P in U]: never } + & { [x: string]: never } +)[T]; +export type Omit = Pick>; + +export interface GeosuggestProps extends Omit, 'style'> { placeholder?: string; initialValue?: string; className?: string; diff --git a/types/react/index.d.ts b/types/react/index.d.ts index c1be48ddce..50dca5578b 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -897,11 +897,7 @@ declare namespace React { onTransitionEndCapture?: TransitionEventHandler; } - export interface CSSProperties extends CSS.Properties { - // The string index signature fallback is needed at least until csstype - // provides SVG CSS properties: https://github.com/frenic/csstype/issues/4 - [propertyName: string]: any; - } + export interface CSSProperties extends CSS.Properties {} interface HTMLAttributes extends DOMAttributes { // React-specific Attributes diff --git a/types/react/package.json b/types/react/package.json index f3be220fbc..e6696d08e7 100644 --- a/types/react/package.json +++ b/types/react/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "csstype": "^2.0.0" + "csstype": "^2.2.0" } } diff --git a/types/victory/victory-tests.tsx b/types/victory/victory-tests.tsx index 56f9d34b54..3b882c7583 100644 --- a/types/victory/victory-tests.tsx +++ b/types/victory/victory-tests.tsx @@ -158,7 +158,7 @@ test = ( grid: {strokeWidth: 2}, ticks: {stroke: "red"}, tickLabels: {fontSize: 12}, - axisLabel: {fontsize: 16} + axisLabel: {fontSize: 16} }} label="Planets" tickValues={[ From c61cfb100370f8d3762ba1ef93dccd3a5e4a6eeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Zugmeyer?= Date: Thu, 12 Apr 2018 01:14:16 +0200 Subject: [PATCH 0607/2153] [chart.js] the `text` property of title options can be `string[]` (#24923) See the [chart.js documentation](http://www.chartjs.org/docs/latest/configuration/title.html): "if specified as an array, text is rendered on multiple lines." --- types/chart.js/chart.js-tests.ts | 3 +++ types/chart.js/index.d.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index 03c347fee7..9e6117c5e5 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -24,6 +24,9 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), { onHover(ev: MouseEvent, points: any[]) { return; }, + title: { + text: ["foo", "bar"] + }, tooltips: { filter: data => Number(data.yLabel) > 0, intersect: true, diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 9e1a511229..a2ea423cb8 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -219,7 +219,7 @@ declare namespace Chart { fontColor?: ChartColor; fontStyle?: string; padding?: number; - text?: string; + text?: string | string[]; } interface ChartLegendOptions { From 70d32cd228c442786ae44ddf3acb821693df629f Mon Sep 17 00:00:00 2001 From: denisname Date: Thu, 12 Apr 2018 01:14:42 +0200 Subject: [PATCH 0608/2153] Update to bootstrap 4.1 (#24928) --- types/bootstrap/bootstrap-tests.ts | 11 +++++++++++ types/bootstrap/index.d.ts | 29 +++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/types/bootstrap/bootstrap-tests.ts b/types/bootstrap/bootstrap-tests.ts index 21286ad5f4..f0a353889c 100755 --- a/types/bootstrap/bootstrap-tests.ts +++ b/types/bootstrap/bootstrap-tests.ts @@ -43,10 +43,15 @@ $("#carousel").on("slide.bs.carousel", function(ev) { $("#carousel").carousel({ interval: 5000, keyboard: true, + slide: false, pause: "hover", wrap: true, }); +$("#carousel").carousel({ + slide: "prev", +}); + $("#carousel").carousel({ pause: false, }); @@ -96,6 +101,8 @@ $("#dropdown").dropdown({ offset: 10, flip: false, boundary: "window", + reference: "toggle", + display: "dynamic", }); $("#dropdown").dropdown({ @@ -114,6 +121,10 @@ $("#dropdown").dropdown({ boundary: document.body, }); +$("#dropdown").dropdown({ + reference: document.body, +}); + // -------------------------------------------------------------------------------------- // Modal // -------------------------------------------------------------------------------------- diff --git a/types/bootstrap/index.d.ts b/types/bootstrap/index.d.ts index 88bcc66af8..2f43555a73 100755 --- a/types/bootstrap/index.d.ts +++ b/types/bootstrap/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Bootstrap 4.0 +// Type definitions for Bootstrap 4.1 // Project: https://github.com/twbs/bootstrap/ // Definitions by: denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -55,6 +55,14 @@ export interface CarouselOption { */ keyboard?: boolean; + /** + * Use to easily control the position of the carousel. It accepts the keywords prev or next, which alters the slide position + * relative to its current position. Alternatively, use `data-slide-to` to pass a raw slide index to the carousel. + * + * @default false + */ + slide?: "next" | "prev" | false; + /** * If set to "hover", pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on mouseleave. * If set to false, hovering over the carousel won't pause it. @@ -116,6 +124,21 @@ export interface DropdownOption { * @default "scrollParent" */ boundary?: Popper.Boundary | HTMLElement; + + /** + * Reference element of the dropdown menu. Accepts the values of 'toggle', 'parent', or an HTMLElement reference. + * For more information refer to Popper.js's referenceObject docs. + * + * @default "toggle" + */ + reference?: "toggle" | "parent" | HTMLElement; + + /** + * By default, we use Popper.js for dynamic positioning. Disable this with 'static'. + * + * @default "dynamic" + */ + display?: "dynamic" | "static"; } export interface ModalOption { @@ -154,6 +177,8 @@ export interface PopoverOption extends TooltipOption { * Default content value if data-content attribute isn't present. * If a function is given, it will be called with its this reference * set to the element that the popover is attached to. + * + * @default "" */ content?: string | Element | ((this: Element) => string | Element); } @@ -226,7 +251,7 @@ export interface TooltipOption { * the tooltip or popover DOM node as its first argument and the triggering element DOM node as its second. * The this context is set to the tooltip or popover instance. * - * @default "top" + * @default tooltip: "top", popover: "right" */ placement?: Placement | ((this: TooltipInstance, node: HTMLElement, trigger: Element) => Placement); From 72d8a9e5e67928596e44c9cb92620520d52f1e06 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 11 Apr 2018 16:15:03 -0700 Subject: [PATCH 0609/2153] phonegap-nfc: Fix test (#24930) --- types/phonegap-nfc/phonegap-nfc-tests.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/phonegap-nfc/phonegap-nfc-tests.ts b/types/phonegap-nfc/phonegap-nfc-tests.ts index 50eb34f293..b61009a7da 100644 --- a/types/phonegap-nfc/phonegap-nfc-tests.ts +++ b/types/phonegap-nfc/phonegap-nfc-tests.ts @@ -117,6 +117,7 @@ let ndefTagEvent = { AT_TARGET: 0, BUBBLING_PHASE: 0, CAPTURING_PHASE: 0, + NONE: 0, scoped: false, deepPath(): any { }, tag: ndefTag From 9db24f13b5e100032f8d84893c846ccaad6304f6 Mon Sep 17 00:00:00 2001 From: jphhoeks Date: Thu, 12 Apr 2018 01:15:40 +0200 Subject: [PATCH 0610/2153] react-onsenui: added missing definition for Select component (#24909) * Fix: added missing definition for Select component in react-onsenui typings * react-onsenui: updated version number --- types/react-onsenui/index.d.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/types/react-onsenui/index.d.ts b/types/react-onsenui/index.d.ts index 27a664d27a..00437e099b 100644 --- a/types/react-onsenui/index.d.ts +++ b/types/react-onsenui/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for React Onsen UI (react-onsenui) 2.8 +// Type definitions for React Onsen UI (react-onsenui) 2.9 // Project: https://onsen.io/v2/docs/guide/react/ // Definitions by: Ozytis , Salim , Jemmyw // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -336,6 +336,18 @@ export class Range extends Component<{ disabled?: boolean, }, any> {} +export class Select extends Component<{ + modifier?: string, + disabled?: boolean, + onChange?: (e: React.ChangeEvent) => void, + value?: string, + multiple?: boolean, + autofocus?: boolean, + required?: boolean, + form?: string, + size?: string +}, any> {} + export class Switch extends Component<{ onChange?(e: SwitchChangeEvent): void, checked?: boolean, From d113bbc18a95346a55749bab15f554f19e4d75be Mon Sep 17 00:00:00 2001 From: Kerwyn Date: Wed, 11 Apr 2018 17:15:58 -0600 Subject: [PATCH 0611/2153] Added type definitions for react-timeout (#24916) * Added type definitions for react-timeout * Fixed export * Removed rules from tslint.json * Added types * Indented * Fixed types --- types/react-timeout/index.d.ts | 32 +++++++++++++++++++++++++++++++ types/react-timeout/tsconfig.json | 23 ++++++++++++++++++++++ types/react-timeout/tslint.json | 3 +++ 3 files changed, 58 insertions(+) create mode 100644 types/react-timeout/index.d.ts create mode 100644 types/react-timeout/tsconfig.json create mode 100644 types/react-timeout/tslint.json diff --git a/types/react-timeout/index.d.ts b/types/react-timeout/index.d.ts new file mode 100644 index 0000000000..b214318a23 --- /dev/null +++ b/types/react-timeout/index.d.ts @@ -0,0 +1,32 @@ +// Type definitions for react-timeout 1.1 +// Project: https://github.com/plougsgaard/react-timeout +// Definitions by: Kerwyn Rojas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/// + +import * as React from 'react'; + +export = ReactTimeout; + +declare function ReactTimeout( + SourceComponent: React.ComponentClass | React.StatelessComponent +): React.ComponentClass; + +declare namespace ReactTimeout { + type Timer = NodeJS.Timer | number; + + type Id = number; + + interface ReactTimeoutProps { + setTimeout?: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timer; + clearTimeout?: (timer: Timer) => void; + setInterval?: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Id; + clearInterval?: (id: Id) => void; + setImmediate?: (callback: (...args: any[]) => void, ...args: any[]) => Id; + clearImmediate?: (id: Id) => void; + requestAnimationFrame?: (callback: (...args: any[]) => void) => Id; + cancelAnimationFrame?: (id: Id) => void; + } +} diff --git a/types/react-timeout/tsconfig.json b/types/react-timeout/tsconfig.json new file mode 100644 index 0000000000..71e6b79545 --- /dev/null +++ b/types/react-timeout/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} diff --git a/types/react-timeout/tslint.json b/types/react-timeout/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/react-timeout/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 326cb88142fcba69136595d632143f84f291fc4f Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 11 Apr 2018 16:18:24 -0700 Subject: [PATCH 0612/2153] algoliasearch: Remove unnecessary destructuring (#24929) --- types/algoliasearch/index.d.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index 5c7026d70e..3304ad579d 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -805,11 +805,7 @@ declare namespace algoliasearch { * @param err() error callback * https://www.algolia.com/doc/api-reference/api-methods/search-for-facet-values/ */ - searchForFacetValues({ - facetName, - facetQuery, - ...qp, - }: { + searchForFacetValues(options: { facetName: string; facetQuery: string; } & AlgoliaQueryParameters): Promise; @@ -820,12 +816,7 @@ declare namespace algoliasearch { * @param err() error callback * https://www.algolia.com/doc/api-reference/api-methods/search-for-facet-values/ */ - searchForFacetValues( - { - facetName, - facetQuery, - ...qp, - }: { + searchForFacetValues(options: { facetName: string; facetQuery: string; } & AlgoliaQueryParameters, From d8df907997c1e911c27f71bfe5cb45b0ebcf8ba3 Mon Sep 17 00:00:00 2001 From: Peter Weinberg Date: Wed, 11 Apr 2018 19:31:22 -0400 Subject: [PATCH 0613/2153] [redux-pack]: add key signature to ActionMeta interface (#24785) * [redux-pack]: add key signature to ActionMeta interface * [redux-pack]: improve type definitions for handler actions, allow passing custom metadata and all FSA compliant keys * [redux-pack]: fix no-unnecessary-generics error --- types/redux-pack/index.d.ts | 76 ++++++++++++++++++--------- types/redux-pack/redux-pack-tests.ts | 77 ++++++++++++++++++++++------ 2 files changed, 111 insertions(+), 42 deletions(-) diff --git a/types/redux-pack/index.d.ts b/types/redux-pack/index.d.ts index 2bffdf8117..01e6ff4c0d 100644 --- a/types/redux-pack/index.d.ts +++ b/types/redux-pack/index.d.ts @@ -1,52 +1,78 @@ // Type definitions for redux-pack 0.1 // Project: https://github.com/lelandrichardson/redux-pack // Definitions by: tansongyang +// dschuman +// pweinberg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 + import { Action as ReduxAction, Middleware, - Reducer, + Reducer } from 'redux'; export const KEY: { - readonly LIFECYCLE: 'redux-pack/LIFECYCLE' - readonly TRANSACTION: 'redux-pack/TRANSACTION' + readonly LIFECYCLE: 'redux-pack/LIFECYCLE'; + readonly TRANSACTION: 'redux-pack/TRANSACTION'; }; export const LIFECYCLE: { - readonly START: 'start' - readonly SUCCESS: 'success' - readonly FAILURE: 'failure' + readonly START: 'start'; + readonly SUCCESS: 'success'; + readonly FAILURE: 'failure'; }; -export type LIFECYCLEValues = 'start'| 'succes'| 'failure'; + +export type LIFECYCLEValues = 'start' | 'succes' | 'failure'; export const middleware: Middleware; -export interface Handlers { - start?: Reducer; - finish?: Reducer; - failure?: Reducer; - success?: Reducer; - always?: Reducer; +// MetaPayload differs from ActionMeta in that it is the object that the reducers +// receive, instead of what is dispatched +export type MetaPayload = M & { + ['redux-pack/LIFECYCLE']?: LIFECYCLEValues; + ['redux-pack/TRANSACTION']?: string; +}; + +// Incomplete typing +export type PackActionPayload = ReduxAction & { + payload: Payload; + meta: MetaPayload; +}; + +export type handlerReducer = (state: S, action: A) => S; +export interface Handlers { + start?: handlerReducer>; + finish?: handlerReducer; + failure?: handlerReducer>; + success?: handlerReducer>; + always?: handlerReducer; } + export type GetState = () => S; -export interface ActionMeta { +export interface ActionMeta { startPayload?: TStartPayload; - onStart?(payload: TStartPayload, getState: GetState): void; - onFinish?(resolved: boolean, getState: GetState): void; - onSuccess?(response: TSuccessPayload, getState: GetState): void; - onFailure?(error: TErrorPayload, getState: GetState): void; - ['redux-pack/LIFECYCLE']?: keyof LIFECYCLEValues; + onStart?(payload: TStartPayload, getState: GetState): void; + onFinish?(resolved: boolean, getState: GetState): void; + onSuccess?(response: TSuccessPayload, getState: GetState): void; + onFailure?(error: TErrorPayload, getState: GetState): void; + ['redux-pack/LIFECYCLE']?: LIFECYCLEValues; ['redux-pack/TRANSACTION']?: string; } -export interface Action extends ReduxAction { + +export interface PackError { error: boolean; payload: any; } +export interface Action extends ReduxAction { promise?: Promise; payload?: TSuccessPayload | TErrorPayload | TStartPayload; - meta?: ActionMeta; + meta?: ActionMeta & TMetaPayload; + // add optional error key to conform to FSA design: https://github.com/redux-utilities/flux-standard-action + // note that users of this middleware (using our types) must conform to FSA shaped actions or code will not compile + error?: boolean | null; } -export function handle( + +export interface TFullState { [key: string]: any; } +export function handle( state: TState, - action: Action, - handlers: Handlers) - : TState; + action: Action, + handlers: Handlers, +): TState; diff --git a/types/redux-pack/redux-pack-tests.ts b/types/redux-pack/redux-pack-tests.ts index ff1746bdbf..0dbe1bf433 100644 --- a/types/redux-pack/redux-pack-tests.ts +++ b/types/redux-pack/redux-pack-tests.ts @@ -1,44 +1,87 @@ -import { handle, Action } from 'redux-pack'; +import { handle, Action, GetState } from 'redux-pack'; interface Foo { - id: string; + id: string; } interface FooState { - foo: Foo | null; - error: string | null; - isLoading: boolean; - currentUser: { - id: string; - }; + foo: Foo | null; + bar: string; + error: boolean; + errorMsg: string; + isLoading: boolean; + metaPropOne: string; + metaPropTwo: string; + currentUser: { + id: string; + }; } // https://github.com/lelandrichardson/redux-pack/tree/v0.1.5#logging-beforeafter declare const Api: { - getFoo(id: string): Promise; + getFoo(id: string): Promise; }; + declare function logSuccess(foo: Foo): void; -function loadFoo(id: string): Action { + +interface MetaOne { propOne: string; } +function loadFoo(id: string): Action { return { type: LOAD_FOO, promise: Api.getFoo(id), meta: { - onSuccess: logSuccess + onSuccess: logSuccess, + // pass custom metadata through to reducer + // allowed by library, and a common redux pattern + // https://github.com/lelandrichardson/redux-pack/blob/7818ffd4304d5f0e2c94056f3626a399fc9a5a10/src/middleware.js#L44 + propOne: 'some meta' }, }; } +interface MetaTwo { propTwo: string; } +function barError(): Action { + return { + type: BAR_ERROR, + error: true, + payload: new Error('this is an error action'), + meta: { + propTwo: 'other meta' + } + }; +} + +// bad (non-FSA action): +function baz(baz: string): Action { + return { + type: 'BAZ', + // boo: baz // <-- will not compile, shape of action is not FSA + // see line 62 & 63 of index.d.ts + }; +} + // https://github.com/lelandrichardson/redux-pack/tree/v0.1.5#using-the-handle-helper const LOAD_FOO = 'LOAD_FOO'; +const BAR_ERROR = 'BAR_ERROR'; declare const initialState: FooState; -function fooReducer(state = initialState, action: Action) { +function fooReducer(state = initialState, action: Action) { const { type, payload } = action; switch (type) { + // example of non-redux-pack action + // works as long as action is FSA compliant + case BAR_ERROR: + return { + ...state, + error: action.error, + errorMsg: action.payload, + metaPropTwo: action.meta && action.meta.propTwo + }; case LOAD_FOO: return handle(state, action, { - start: prevState => ({ ...prevState, isLoading: true, error: null, foo: null }), + start: prevState => ({ ...prevState, isLoading: true, error: false, foo: null }), finish: prevState => ({ ...prevState, isLoading: false }), - failure: prevState => ({ ...prevState, error: payload as string }), - success: prevState => ({ ...prevState, foo: payload as Foo }), + failure: prevState => ({ ...prevState, error: true, errorMsg: payload as string }), + // must define both state and action params to correctly scope action (to access custom meta) + success: (prevState, action) => ({ ...prevState, foo: payload as Foo, metaPropOne: action.meta.propOne }), always: prevState => prevState, // unnecessary, for the sake of example }); default: @@ -50,8 +93,8 @@ function fooReducer(state = initialState, action: Action; declare function sendAnalytics(action: string, data: { - userId: string, - fooId: string, + userId: string, + fooId: string, }): void; function userDoesFoo(): Action { return { From 2ca53b72e4b4799e159ba2a6c641345d4cc99126 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 11 Apr 2018 16:35:18 -0700 Subject: [PATCH 0614/2153] Avoid language that encourages users to send `.d.ts` PRs to libraries --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 79793c16c1..b1a1039f82 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -10,7 +10,7 @@ Please fill in this template. Select one of these and delete the others: If adding a new definition: -- [ ] The package does not provide its own types, and you can not add them. +- [ ] The package does not already provide its own types, or cannot have its `.d.ts` files generated via `--declaration` - [ ] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package. - [ ] Create it with `dts-gen --dt`, not by basing it on an existing project. - [ ] `tslint.json` should be present, and `tsconfig.json` should have `noImplicitAny`, `noImplicitThis`, `strictNullChecks`, and `strictFunctionTypes` set to `true`. From 8dc5b41e17513993f5544a98c98a74030af16863 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 11 Apr 2018 16:41:46 -0700 Subject: [PATCH 0615/2153] Update readme (#24932) * Add note about `esModuleInterop` * Update guidance on publishing to DT Refrenced in https://github.com/Microsoft/TypeScript-Handbook/commit/884e4e80f0868a2057234796f6a2076e27582d8d#commitcomment-28080081 * Edits * writen -> written --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cc59284394..7c58fe8901 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ If it doesn't, you can do so yourself in the comment associated with the PR. #### Create a new package -If you are the library author, or can make a pull request to the library, [bundle types](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) instead of publishing to DefinitelyTyped. +If you are the library author and your package is written in TypeScript, [bundle the autogenerated declaration files](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) in your package instead of publishing to DefinitelyTyped. If you are adding typings for an NPM package, create a directory with the same name. If the package you are adding typings for is not on NPM, make sure the name you choose for it does not conflict with the name of a package on NPM. @@ -239,7 +239,8 @@ If types are part of a web standard, they should be contributed to [TSJS-lib-gen #### A package uses `export =`, but I prefer to use default imports. Can I change `export =` to `export default`? -If default imports work in your environment, consider turning on the [`--allowSyntheticDefaultImports`](http://www.typescriptlang.org/docs/handbook/compiler-options.html) compiler option. +If you are using TypeScript 2.7 or later, use `--esModuleInterop` in your project. +Otherwise, if default imports work in your environment (e.g. Webpack, SystemJS, esm), consider turning on the [`--allowSyntheticDefaultImports`](http://www.typescriptlang.org/docs/handbook/compiler-options.html) compiler option. Do not change the type definition if it is accurate. For an NPM package, `export =` is accurate if `node -p 'require("foo")'` is the export, and `export default` is accurate if `node -p 'require("foo").default'` is the export. From 5517a66c04f6828641595768140a855160fa16f2 Mon Sep 17 00:00:00 2001 From: Greg Zapp Date: Wed, 11 Apr 2018 18:53:04 -0500 Subject: [PATCH 0616/2153] Add tableau API types. (#24931) * Add tableau API types. * Add tslint config. * Fix lint errors. --- types/tableau/index.d.ts | 697 ++++++++++++++++++++++++++++++++++++ types/tableau/tsconfig.json | 24 ++ types/tableau/tslint.json | 1 + 3 files changed, 722 insertions(+) create mode 100644 types/tableau/index.d.ts create mode 100644 types/tableau/tsconfig.json create mode 100644 types/tableau/tslint.json diff --git a/types/tableau/index.d.ts b/types/tableau/index.d.ts new file mode 100644 index 0000000000..c8ade03046 --- /dev/null +++ b/types/tableau/index.d.ts @@ -0,0 +1,697 @@ +// Type definitions for tableau 2.2 +// Project: https://onlinehelp.tableau.com/current/api/js_api/en-us/JavaScriptAPI/js_api.htm +// Definitions by: Greg Zapp +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +declare namespace tableau { + interface VizCreateOptions { + /** Undoes action on sheet, defaults to a single undo unless optional parameters is specified. */ + hideTabs?: boolean; + /** Indicates whether the toolbar is hidden or shown. */ + hideToolbar?: boolean; + /** + * Specifies the ID of an existing instance to make a copy (clone) of. + * This is useful if the user wants to continue analysis of an existing visualization without losing the state of the original. + * If the ID does not refer to an existing visualization, the cloned version is derived from the original visualization. + */ + instanceIdToClone?: string; + /** Can be any valid CSS size specifier. If not specified, defaults to the published height of the view. */ + height?: string; + /** Can be any valid CSS size specifier. If not specified, defaults to the published height of the view. */ + width?: string; + /** + * Specifies a device layout for a dashboard, if it exists. + * Values can be desktop, tablet, or phone. + * If not specified, defaults to loading a layout based on the smallest dimension of the hosting iframe element. + */ + device?: string; + /** + * Callback function that is invoked when the Viz object first becomes interactive. + * This is only called once, but it’s guaranteed to be called. + * If the Viz object is already interactive, it will be called immediately, but on a separate "thread." + */ + onFirstInteractive?: (e: TableauEvent) => void; + /** + * Callback function that's invoked when the size of the Viz object is known. + * You can use this callback to perform tasks such as resizing the elements surrounding the Viz object once the object's size has been established. + */ + onFirstVizSizeKnown?: (e: VizResizeEvent) => void; + /** + * Apply a filter that you specify to the view when it is first rendered. + * For example, if you have an Academic Year filter and only want to display data for 2017, + * you might enter "Academic Year": "2016". For more information, see Filtering. + */ + [filter: string]: any; + } + + class TableauEvent { + /** Gets the Viz object associated with the event. */ + getViz(): Viz; + + /** Gets the name of the event, which is a string, but is also one of the items in the TableauEventName enum. */ + getEventName(): TableauEventName; + } + + class CustomViewEvent extends TableauEvent { + getCustomViewAsync(): Promise; + } + + class FilterEvent extends TableauEvent { + /** Gets the Worksheet object associated with the event. */ + getWorksheet(): Worksheet; + + /** Gets the name of the field. */ + getFieldName(): string; + + /** Gets the Filter object associated with the event. */ + getFilterAsync(): Promise; + } + + class VizResizeEvent extends TableauEvent { + /** Gets the Viz object associated with the event. */ + getViz(): Viz; + /** Gets the name of the event, which is a string, but is also one of the items in the TableauEventName enum. */ + getEventName(): TableauEventName; + /** Gets the sheetSize record for the current sheet. For more information, see SheetSizeOptions Record. */ + getVizSize(): Size; + } + + enum TableauEventName { + CUSTOM_VIEW_LOAD = 'customviewload', + CUSTOM_VIEW_REMOVE = 'customviewremove', + CUSTOM_VIEW_SAVE = 'customviewsave', + CUSTOM_VIEW_SET_DEFAULT = 'customviewsetdefault', + FILTER_CHANGE = 'filterchange', + MARKS_SELECTION = 'marksselection', + PARAMETER_VALUE_CHANGE = 'parametervaluechange', + STORY_POINT_SWITCH = 'storypointswitch', + TAB_SWITCH = 'tabswitch', + TOOLBAR_STATE_CHANGE = 'toolbarstatechange', + VIZ_RESIZE = 'vizresize', + } + + enum DashboardObjectType { + BLANK = 'blank', + WORKSHEET = 'worksheet', + QUICK_FILTER = 'quickFilter', + PARAMETER_CONTROL = 'parameterControl', + PAGE_FILTER = 'pageFilter', + LEGEND = 'legend', + TITLE = 'title', + TEXT = 'text', + IMAGE = 'image', + WEB_PAGE = 'webPage', + ADDIN = 'addIn' + } + + enum FieldAggregationType { + SUM, + AVG, + MIN, + MAX, + STDEV, + STDEVP, + VAR, + VARP, + COUNT, + COUNTD, + MEDIAN, + ATTR, + NONE, + YEAR, + QTR, + MONTH, + DAY, + HOUR, + MINUTE, + SECOND, + WEEK, + WEEKDAY, + MONTHYEAR, + MDY, + END, + TRUNC_YEAR, + TRUNC_QTR, + TRUNC_MONTH, + TRUNC_WEEK, + TRUNC_DAY, + TRUNC_HOUR, + TRUNC_MINUTE, + TRUNC_SECOND, + QUART1, + QUART3, + SKEWNESS, + KURTOSIS, + INOUT, + USER + } + + enum FieldRoleType { + DIMENSION, MEASURE, UKNOWN + } + + enum FilterType { + CATEGORICAL = 'categorical', + QUANTITATIVE = 'quantitative', + HIERARCHICAL = 'hierarchical', + RELATIVE_DATE = 'relativedate', + } + + enum SheetType { + WORKSHEET = 'worksheet', + DASHBOARD = 'dashboard', + STORY = 'story', + } + + enum DateRangeType { + LAST = 'last', /** Refers to the last day, week, month, etc. of the date period. */ + LASTN = 'lastn', /** Refers to the last N days, weeks, months, etc. of the date period. */ + NEXT = 'next', /** Refers to the next day, week, month, etc. of the date period. */ + NEXTN = 'nextn', /** Refers to the next N days, weeks, months, etc. of the date period. */ + CURRENT = 'current', /** Refers to the current day, week, month, etc. of the date period. */ + TODATE = 'todate', /** Refers to everything up to and including the current day, week, month, etc. of the date period. */ + } + + enum ParameterAllowableValuesType { + ALL = 'all', + LIST = 'list', + RANGE = 'range', + } + + enum ParameterDataType { + FLOAT = 'float', + INTEGER = 'integer', + STRING = 'string', + BOOLEAN = 'boolean', + DATE = 'date', + DATETIME = 'datetime' + } + + enum PeriodType { + YEARS = 'years', + QUARTERS = 'quarters', + MONTHS = 'months', + WEEKS = 'weeks', + DAYS = 'days', + HOURS = 'hours', + MINUTES = 'minutes', + SECONDS = 'seconds', + } + + //#region + class VizManager { + getVizs(): Viz[]; + } + + type ListenerFunction = (event: TableauEvent) => void; + + class Viz { + /** + * Creates a new Tableau Viz inside of the given HTML container, which is typically a
    element. + * Each option as well as the options parameter is optional. + * If there is already a Viz associated with the parentElement, an exception is thrown. + * Before reusing the parentElement you must first call dispose(). + */ + constructor(node: HTMLElement, url: string, options?: VizCreateOptions); + + /** Indicates whether the tabs are displayed in the UI. It does not actually hide individual tabs. */ + getAreTabsHidden(): boolean; + /** Indicates whether the toolbar is displayed. */ + getToolbarHidden(): boolean; + /** Indicates whether the visualization is displayed on the hosting page. */ + getIsHidden(): boolean; + /** Returns the node that was specified in the constructor. */ + getParentElement(): HTMLElement; + /** The URL of the visualization, as specified in the constructor */ + getUrl(): string; + /** One Workbook is supported per visualization. */ + getWorkbook(): Workbook; + /** Indicates whether automatic updates are currently paused. */ + getAreAutomaticUpdatesPaused(): boolean; + + addEventListener(event: TableauEventName.FILTER_CHANGE, f: (event: FilterEvent) => void): void; + addEventListener(event: TableauEventName.CUSTOM_VIEW_LOAD, f: (event: CustomViewEvent) => void): void; + + /** Removes an event listener from the specified event. */ + removeEventListener(type: TableauEventName, f: ListenerFunction): void; + /** Shows or hides the iframe element hosting the visualization. */ + show(): void; + /** Shows or hides the iframe element hosting the visualization. */ + hide(): void; + /** + * Cleans up any resources associated with the visualization, + * removes the visualization from the VizManager instance, + * and removes any DOM elements from the parentElement object. + * In effect, this method restores the page to what it was before a Viz object was instantiated. + */ + dispose(): void; + /** Pauses or resumes layout updates. This is useful if you are resizing the visualization or performing multiple calls that could affect the layout. */ + pauseAutomaticUpdatesAsync(): void; + resumeAutomaticUpdatesAsync(): void; + toggleAutomaticUpdatesAsync(): void; + /** Equivalent to clicking on the Revert All toolbar button, which restores the workbook to its starting state. */ + revertAllAsync(): Promise; + /** Equivalent to clicking on the Refresh Data toolbar button. */ + refreshDataAsync(): Promise; + /** Equivalent to clicking on the Download toolbar button, which downloads a copy of the original workbook. */ + showDownloadWorkbookDialog(): void; + /** Equivalent to clicking on the Export Image toolbar button, which creates a PNG file of the current visualization. */ + showExportImageDialog(): void; + /** Equivalent to clicking on the Export PDF toolbar button, which shows a dialog allowing the user to select options for the export. */ + showExportPDFDialog(): void; + /** + * Shows the Export Data dialog, which is currently a popup window. The worksheetInDashboard parameter is optional. + * If not specified, the currently active Worksheet is used. + */ + showExportDataDialog(worksheetInDashboard: Sheet | SheetInfo | string): void; + /** Shows the Export CrossTab dialog. The worksheetInDashboard parameter is optional. If not specified, the currently active Worksheet is used. */ + showExportCrossTabDialog(worksheetInDashboard: Sheet | SheetInfo | string): void; + /** + * Equivalent to clicking on the Share toolbar button, + * which displays a dialog allowing the user to share the visualization by email or by embedding its HTML in a web page. + */ + showShareDialog(): void; + /** + * Sets the size of the iframe element, which causes the visualization to expand or + * collapse to fit the iframe element if the visualization size (current sheet's size) is set to AUTOMATIC. + */ + setFrameSize(width: number, height: number): void; + /** Gets the URL of the visualization asynchronously. */ + getCurrentUrlAsync(): Promise; + /** Redoes last action on a sheet, defaults to a single redo unless optional parameters is specified. */ + redoAsync(): Promise; + /** Undoes action on sheet, defaults to a single undo unless optional parameters is specified. */ + undoAsync(): Promise; + } + //#endregion + + //#region Sheet Classes + class SheetInfo { + /** Gets the name of the sheet. */ + getName(): string; + /** Gets the index of the sheet within the published tabs. Note that hidden tabs are still counted in the ordering, as long as they are published. */ + getIndex(): number; + /** + * Gets a value indicating whether the sheet is the currently active sheet.Due to a technical limitation, + * this will always return false if the object is a Worksheet instance that is part of a Dashboard. + */ + getIsActive(): boolean; + /** + * Gets a value indicating whether the sheet is hidden in the UI. Note that if the entire tab control is hidden, + * it does not affect the state of this flag. This sheet may still report that it is visible even when the tabs control is hidden. + */ + getIsHidden(): boolean; + /** Gets the type of the sheet. SheetType is an enum with the following values: WORKSHEET, DASHBOARD and STORY. */ + getSheetType(): SheetType; + /** Gets the size information that the author specified when publishing the workbook. */ + getSize(): SheetSizeOptions; + /** Gets the URL for this sheet. */ + getUrl(): string; + /** Gets the Workbook to which this Sheet belongs. */ + getWorkbook(): Workbook; + } + + class Sheet { + /** Gets the name of the sheet. */ + getName(): string; + /** Gets the index of the sheet within the published tabs. Note that hidden tabs are still counted in the ordering, as long as they are published. */ + getIndex(): number; + /** Gets a value indicating whether the sheet is the currently active sheet. */ + getIsActive(): boolean; + /** + * Gets a value indicating whether the sheet is hidden in the UI. + * Note that if the entire tab control is hidden, it does not affect the state of this flag. + * This sheet may still report that it is visible even when the tabs control is hidden. + */ + getIsHidden(): boolean; + /** Gets the type of the sheet. SheetType is an enum with the following values: WORKSHEET , DASHBOARD and STORY. */ + getSheetType(): SheetType; + /** Gets the size information that the author specified when publishing the workbook. */ + getSize(): SheetSizeOptions; + /** Gets the URL for this sheet. */ + getUrl(): string; + /** Gets the Workbook to which this Sheet belongs. */ + getWorkbook(): Workbook; + /** + * Sets the size information on a sheet. Note that if the sheet is a Worksheet, + * only SheetSizeBehavior.AUTOMATIC is allowed since you can’t actually set a Worksheet to a fixed size. + */ + changeSizeAsync(options: SheetSizeOptions): Promise; + } + + enum SheetSizeBehaviour { + AUTOMATIC = 'automatic', + EXACTLY = 'exactly', + RANGE = 'range', + ATLEAST = 'atleast', + ATMOST = 'atmost', + } + + interface SheetSizeOptions { + /** Contains an enumeration value of one of the following: AUTOMATIC, EXACTLY, RANGE, ATLEAST, and ATMOST. */ + behavior: SheetSizeBehaviour; + /** This is only defined when behavior is EXACTLY, RANGE or ATMOST. */ + maxSize: number; + /** This is only defined when behavior is EXACTLY, RANGE, or ATLEAST. */ + minSize: number; + } + + class DataTable { + /** Either "Underlying Data Table" or "Summary Data Table". */ + getName(): string; + /** + * A two-dimensional array of data without the sheet or column metadata. + * The first array index is the row index and the second array index is the column index. + */ + getData(): any[]; + /** The column information, including the name, data type, and index. */ + getColumns(): Column[]; + /** The number of rows in the returned data. */ + getTotalRowCount(): number; + /** Whether the data is summary data or underlying data. Returns true for summary data. */ + getIsSummaryData(): boolean; + } + + class Column { + /** The name of the column. */ + getFieldName(): string; + /** The data type of the column. Possible values are float, integer, string, boolean, date, and datetime. */ + getDataType(): string; + /** Whether the column data is referenced in the visualization. */ + getIsReferenced(): boolean; + /** The number of rows in the returned data. */ + getIndex(): number; + } + + class Worksheet { + /** Returns the Dashboard object to which this Worksheet belongs (if it’s on a dashboard). Otherwise, it returns null. */ + getParentDashboard(): Dashboard; + /** + * Returns the StoryPoint object to which this Worksheet belongs (if it’s on a story sheet). + * Otherwise, it returns null. If the Worksheet instance does not come from a call to StoryPoint.getContainedSheet(), it also returns null. + */ + getParentStoryPoint(): StoryPoint; + /** + * Gets the primary and all of the secondary data sources for this worksheet. + * Note that by convention the primary data source should always be the first element. + */ + getDataSourcesAsync(): Promise; + /** + * Gets aggregated data for the fields used in the currently active sheet and returns it as an object. + * You can specify options with an optional parameter. This can only be called on sheets of the WORKSHEET type. + */ + getSummaryDataAsync(options: getSummaryDataOptions): Promise; + /** + * Gets data for all fields in the data source used by the currently active sheet and returns it as an object. + * You can specify options with an optional parameter. This can only be called on sheets of the WORKSHEET type. + */ + getUnderlyingDataAsync(options: getUnderlyingDataOptions): Promise; + } + + interface getSummaryDataOptions { + /** Do not use aliases specified in the data source in Tableau. Default is false. */ + ignoreAliases?: boolean; + /** Only return data for the currently selected marks. Default is false. */ + ignoreSelection?: boolean; + /** The number of rows of data that you want to return. Enter 0 to return all rows. */ + maxRows: number; + } + + interface getUnderlyingDataOptions { + /** Do not use aliases specified in the data source in Tableau. Default is false. */ + ignoreAliases?: boolean; + /** Only return data for the currently selected marks. Default is false. */ + ignoreSelection?: boolean; + /** Return all the columns for the data source. Default is false. */ + ignoreAllColumns?: boolean; + /** The number of rows of data that you want to return. Enter 0 to return all rows. */ + maxRows: number; + } + + class Dashboard { + /** Gets the collection of objects. */ + getObjects(): DashboardObject[]; + /** + * Gets the collection of worksheets contained in the dashboard. + * Note that this is a helper method and is equivalent to looping through getObjects() and collecting all of + * the DashboardObject.Worksheet pointers when DashboardObject.getType() === tableau.DashboardObjectType.WORKSHEET. + */ + getWorksheets(): Worksheet[]; + /** + * Returns the StoryPoint object to which this Dashboard belongs (if it’s on a story sheet). + * Otherwise, it returns null. + * If the Dashboard instance does not come from a call to StoryPoint.getContainedSheet(), it also returns null. + */ + getParentStoryPoint(): StoryPoint; + } + + class DashboardObject { + /** + * Gets what the object represents, which is an enum with the following values: + * BLANK, WORKSHEET, QUICK_FILTER, PARAMETER_CONTROL, PAGE_FILTER, LEGEND, TITLE, TEXT, IMAGE, WEB_PAGE. + */ + getObjectType(): DashboardObjectType; + /** Gets the Dashboard object that contains this object. */ + getDashboard(): Dashboard; + /** If getType() returns WORKSHEET, this contains a pointer to the Worksheet object. */ + getWorksheet(): Worksheet; + /** Gets the coordinates relative to the top-left corner of the dashboard of the object. */ + getPosition(): Point; + /** Gets the size of the object. */ + getSize(): Size; + } + + class Story extends Sheet { + /** + * Gets an array (not a collection) of StoryPointInfo objects. + * Note that this is not a collection, since we don’t have a unique string key for a story point. + * We only need ordinal access to the story points (by index). + */ + getStoryPointsInfo(): StoryPointInfo[]; + /** Gets the currently active story point. */ + getActiveStoryPoint(): StoryPoint; + /** + * Activates the story point at the specified index and returns a promise of the activated StoryPoint. + * Throws a tableau.ErrorCode.INDEX_OUT_OF_RANGE error if the index is less than zero or greater than or equal to the number of story points in the array. + */ + activateStoryPointAsync(index: number): Promise; + /** Activates the next story point if there is one. If the current story point is the last one, then is stays active. */ + activateNextStoryPointAsync(): Promise; + /** Activates the previous story point if there is one. If the current story point is the first one, then it stays active. */ + activatePreviousStoryPointAsync(): Promise; + /** + * Reverts the story point at the specified index and returns a promise of the reverted StoryPoint. + * Throws a tableau.ErrorCode.INDEX_OUT_OF_RANGE error if the index is less than zero or greater than or equal to the number of story points in the array. + */ + revertStoryPointAsync(index: number): Promise; + } + + class StoryPointInfo { + /** Gets the zero-based index of this story point within the parent Story sheet. */ + getIndex(): number; + /** Gets the content of the textual description for this story point. */ + getCaption(): string; + /** Gets a value indicating whether the story point is the currently active point in the story. */ + getIsActive(): boolean; + /** Gets a value indicating whether the story point is updated, meaning that there are no changes from the last time the story point was “captured”. */ + getIsUpdated(): boolean; + /** Gets the Story object that contains the story point. */ + getParentStory(): Story; + } + + class StoryPoint { + /** Gets the zero-based index of this story point within the parent Story sheet. */ + getIndex(): number; + /** Gets the content of the textual description for this story point. */ + getCaption(): string; + /** Gets a value indicating whether the story point is the currently active point in the story. */ + getIsActive(): boolean; + /** Gets a value indicating whether the story point is updated, meaning that there are no changes from the last time the story point was “captured”. */ + getIsUpdated(): boolean; + /** Gets the sheet that this story point contains. This will be null if the story point does not have a contained sheet. */ + getContainedSheet(): Sheet; + /** Gets the Story object that contains the story point. */ + getParentStory(): Story; + } + //#endregion + + //#region Workbook Classes + class Workbook { + /** Gets the Viz object that contains the workbook. */ + getViz(): Viz; + /** Gets the currently active sheet (the active tab) */ + getActiveSheet(): Sheet; + /** Gets the currently active custom view, or null if no custom view is active. */ + getActiveCustomView(): CustomView; + /** Note that this is synchronous, meaning that all of the sheets are expected when loaded. */ + getPublishedSheetsInfo(): SheetInfo[]; + /** Gets the name of the workbook saved to the server. Note that this is not necessarily the file name. */ + getName(): string; + /** Activates the sheet, either by name or index, and returns a promise of the sheet that was activated. */ + activateSheetAsync(sheetNameOrIndex: string | number): Promise; + /** Reverts the workbook to its last saved state. */ + revertAllAsync(): Promise; + /** Fetches the parameters for this workbook. */ + getParametersAsync(): Promise; + /** + * Changes the value of the parameter with the given name and returns the new Parameter. + * The value should be the same data type as the parameter and within the allowable range of values. + * It also needs to be the aliased value and not the raw value. + * For more information and examples, see changeParameterValueAsync() Additional Information + */ + changeParameterValueAsync(name: string, value: any): Promise; + /** Gets the collection of CustomView objects associated with the workbook. */ + getCustomViewsAsync(): Promise; + /** Changes the visualization to show the named saved state. */ + showCustomViewAsync(customViewName: string): Promise; + /** Removes the named custom view. */ + removeCustomViewAsync(customViewName: string): Promise; + /** Remembers the current state of the workbook by assigning a custom view name. */ + rememberCustomViewAsync(customViewName: string): Promise; + /** Sets the active custom view as the default. */ + setActiveCustomViewAsDefaultAsync(): void; + } + + class DataSource { + /** The name of the DataSource as seen in the UI. */ + getName(): string; + /** Indicates whether this DataSource is a primary or a secondary data source. */ + getIsPrimary(): boolean; + /** Gets an array of Fields associated with the DataSource. */ + getFields(): Field[]; + } + + class Field { + /** Gets the field name (i.e. caption). */ + getName(): string; + getAggregation(): FieldAggregationType; + /** Gets the data source to which this field belongs. */ + getDataSource(): DataSource; + /** One of the following values: DIMENSION, MEASURE, UKNOWN */ + getRole(): FieldRoleType; + } + + class CustomView { + /** User-friendly name for the custom view */ + getName(): string; + /** User-friendly name for the custom view */ + setName(name: string): string; + + /** Indicates whether the custom view is public or private. */ + getAdvertised(): boolean; + /** Indicates whether the custom view is public or private. */ + setAdvertised(bool: boolean): boolean; + + /** Gets or sets whether this is the default custom view. */ + getDefault(): boolean; + + /** Gets the user that created the custom view. */ + getOwnerName(): string; + + /** Unique URL to load this view again. */ + getUrl(): string; + + /** Gets the Workbook to which this CustomView belongs. */ + getWorkbook(): Workbook; + + /** After saveAsync() is called, the result of the getUrl method is no longer blank. */ + saveAsync(): Promise; + } + //#endregion + + //#region Parameter Classes + class Parameter { + /** A unique identifier for the parameter, as specified by the user. */ + getName(): string; + /** The current value of the parameter. */ + getCurrentValue(): DataValue; + /** The data type of the parameter can be one of the following: FLOAT, INTEGER, STRING, BOOLEAN, DATE, DATETIME. */ + getDataType(): ParameterDataType; + /** The type of allowable values that the parameter can accept. It can be one of the following enumeration items: ALL, LIST, RANGE. */ + getAllowableValuesType(): ParameterAllowableValuesType; + /** + * If the parameter is restricted to a list of allowable values, this property contains the array of those values. + * Note that this is not a standard collection, but a JavaScript array. + */ + getAllowableValues(): DataValue[]; + /** If getAllowableValuesType is RANGE, this defines the minimum allowable value, inclusive. Otherwise it’s undefined/null. */ + getMinValue(): DataValue; + /** If getAllowableValuesType is RANGE, this defines the maximum allowable value, inclusive. Otherwise it’s undefined/null. */ + getMaxValue(): DataValue; + /** If getAllowableValuesType is RANGE, this defines the step size used in the parameter UI control slider. Otherwise it’s undefined/null. */ + getStepSize(): number; + /** + * If getAllowableValuesType is RANGE and getDataType is DATE or DATETIME, + * this defines the step date period used in the Parameter UI control slider. + * Otherwise it’s undefined/null. + */ + getDateStepPeriod(): PeriodType; + } + //#endregion + + //#region Filtering + class Filter { + /** Gets the parent worksheet */ + getWorksheet(): Worksheet; + /** Gets the type of the filter. See FilterType Enum for the values in the enum. */ + getFilterType(): FilterType; + /** Gets the name of the field being filtered. Note that this is the caption as shown in the UI and not the actual database field name. */ + getFieldName(): string; + /** Gets the field that is currently being filtered. */ + getFieldAsync(): Promise; + } + + class CategoricalFilter extends Filter { + /** Gets a value indicating whether the filter is exclude or include (default). */ + getIsExcludeMode(): boolean; + /** + * Gets the collection of values that are currently set on the filter. + * This is a native JavaScript array and not a keyed collection. + * Note that only the first 200 values are returned. + */ + getAppliedValues(): DataValue[]; + } + + class QuantitativeFilter extends Filter { + /** Gets the minimum value as specified in the domain. */ + getDomainMin(): DataValue; + /** Gets the maximum value as specified in the domain. */ + getDomainMax(): DataValue; + /** Gets the minimum value, inclusive, applied to the filter. */ + getMin(): DataValue; + /** Gets the maximum value, inclusive, applied to the filter. */ + getMax(): DataValue; + /** Indicates whether null values are included in the filter. */ + getIncludeNullValues(): boolean; + } + + class RelativeDateFilter extends Filter { + /** The date period of the filter. See PeriodType Enum for the values in the enum. */ + getPeriod(): PeriodType; + /** The range of the date filter (years, months, etc.). See DateRangeType Enum for the values in the enum. */ + getRange(): DateRangeType; + /** When getRange returns LASTN or NEXTN, this is the N value (how many years, months, etc.). */ + getRangeN(): number; + } + + type ConcreteFilter = CategoricalFilter | QuantitativeFilter | RelativeDateFilter; + + class DataValue { + /** Contains the raw native value as a JavaScript type, which is one of String, Number, Boolean, or Date */ + value: any; + /** The value formatted according to the locale and the formatting applied to the field or parameter. */ + formattedValue: string; + } + //#endregion + + interface Size { + width: number; + height: number; + } + + interface Point { + x: number; + y: number; + } +} diff --git a/types/tableau/tsconfig.json b/types/tableau/tsconfig.json new file mode 100644 index 0000000000..adad086fdc --- /dev/null +++ b/types/tableau/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} \ No newline at end of file diff --git a/types/tableau/tslint.json b/types/tableau/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/tableau/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file From 45ff24159ba3127e69dfea78cefb34b4e42081b8 Mon Sep 17 00:00:00 2001 From: Nico Montanari Date: Thu, 12 Apr 2018 17:34:21 +0200 Subject: [PATCH 0617/2153] Added listKey prop to VirtualizedListProperties --- types/react-native/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index f7a70b79ac..b8b13fa69a 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -3938,6 +3938,8 @@ export interface VirtualizedListProperties extends ScrollViewProperties { inverted?: boolean; keyExtractor?: (item: ItemT, index: number) => string; + + listKey?: string; /** * The maximum number of items to render in each incremental render batch. The more rendered at From e77f5638ae92d6001e528331811217f21ed3772f Mon Sep 17 00:00:00 2001 From: tnoonan-salesforce Date: Thu, 12 Apr 2018 10:59:13 -0600 Subject: [PATCH 0618/2153] New Types for JSForce (#24925) Additional Types added for jsforce analytics metadata chatter --- types/jsforce/api/analytics.d.ts | 82 +++++++++++++ types/jsforce/api/chatter.d.ts | 71 +++++++++++ types/jsforce/api/metadata.d.ts | 178 +++++++++++++++++++++++++++ types/jsforce/connection.d.ts | 69 ++++++++++- types/jsforce/describe-result.d.ts | 28 ++++- types/jsforce/index.d.ts | 14 ++- types/jsforce/jsforce-tests.ts | 190 ++++++++++++++++++++++++++++- types/jsforce/oauth2.d.ts | 35 ++++++ types/jsforce/promise.d.ts | 3 + types/jsforce/query.d.ts | 39 ++++-- 10 files changed, 693 insertions(+), 16 deletions(-) create mode 100644 types/jsforce/api/analytics.d.ts create mode 100644 types/jsforce/api/chatter.d.ts create mode 100644 types/jsforce/api/metadata.d.ts create mode 100644 types/jsforce/oauth2.d.ts create mode 100644 types/jsforce/promise.d.ts diff --git a/types/jsforce/api/analytics.d.ts b/types/jsforce/api/analytics.d.ts new file mode 100644 index 0000000000..02f04fac41 --- /dev/null +++ b/types/jsforce/api/analytics.d.ts @@ -0,0 +1,82 @@ +import { callback } from '../connection'; + +interface ReportInfo { +} + +export class Dashboard { + describe(callback?: callback): Promise; + + del(callback?: callback): Promise; + + destory(callback?: callback): Promise; + + delete(callback?: callback): Promise; + + components(componentIds: () => any | string[] | string, callback?: callback): Promise; + + status(callback?: callback): Promise; + + refresh(callback?: callback): Promise; + + clone(name: string | object, folderid: string, callback?: callback): Promise; +} + +export class ReportInstance { + constructor(report: Report, id: string); + + retrieve(callback: callback): Promise +} + +export class Report { + describe(callback?: callback): Promise; + + del(callback?: callback): Promise; + + destory(callback?: callback): Promise; + + delete(callback?: callback): Promise; + + clone(name: string, callback?: callback): Promise; + + explain(callback?: callback): Promise; + + run(options: () => any | object, callback?: callback): Promise; + + exec(options: () => any | object, callback?: callback): Promise; + + execute(options: () => any | object, callback?: callback): Promise; + + executeAsync(options: () => any | object, callback?: callback): Promise; + + instance(id: string): ReportInstance; + + instances(callback?: callback): Promise; +} + +export interface ReportInstanceAttrs { +} + +export interface ExplainInfo { +} + +export interface ReportMetadata { +} + +export interface ReportResult { +} + +export interface ReportInfo { +} + +export interface DashboardInfo { +} + +export class Analytics { + report(id: string): Promise; + + reports(callback?: callback): Promise; + + dashboard(id: string): Promise; + + dashboards(callback?: callback): Promise; +} diff --git a/types/jsforce/api/chatter.d.ts b/types/jsforce/api/chatter.d.ts new file mode 100644 index 0000000000..05fc4551e0 --- /dev/null +++ b/types/jsforce/api/chatter.d.ts @@ -0,0 +1,71 @@ +import { Connection, callback } from '../connection'; +import { Query } from '../query'; +import { Stream } from 'stream'; + +interface BatchRequestParams extends RequestParams { + method: string; + url: string; + richInput?: string; +} + +interface BatchRequestResult { + statusCode: string; + result: RequestResult; +} + +interface BatchRequestResults { + hasError: boolean; + results: BatchRequestResult[]; +} + +interface RequestParams { + method: string; + url: string; + body?: string; +} + +export class RequestResult { +} + +export class Request implements Promise { + constructor(chatter: Chatter, params: RequestParams); + + batchParams(): BatchRequestParams; + + promise(): Promise; + + stream(): Stream; + + catch(onrejected?: ((reason: any) => (PromiseLike | TResult)) | null | undefined): Promise; + + then(onfulfilled?: ((value: T) => (PromiseLike | TResult1)) | null | undefined, + onrejected?: ((reason: any) => (PromiseLike | TResult2)) | null | undefined): Promise; + + thenCall(callback?: (err: Error, records: T) => void): Query; + + readonly [Symbol.toStringTag]: 'Promise'; +} + +export class Resource extends Request { + constructor(chatter: Chatter, url: string, queryParams?: object); + + create(data: object | string, callback?: callback): Request; + + del(callback?: callback): Request; + + delete(callback?: callback): Request; + + retrieve(callback?: callback): Request; + + update(data: object, callback?: callback): Request; +} + +export class Chatter { + constructor(conn: Connection); + + batch(callback?: callback): Promise; + + request(params: RequestParams, callback?: callback>): Request; + + resource(url: string, queryParams?: object): Resource +} diff --git a/types/jsforce/api/metadata.d.ts b/types/jsforce/api/metadata.d.ts new file mode 100644 index 0000000000..c867ece15b --- /dev/null +++ b/types/jsforce/api/metadata.d.ts @@ -0,0 +1,178 @@ +import { callback, Connection } from '../connection'; +import { EventEmitter } from 'events'; +import { Stream } from 'stream'; + +interface DeployResult { + id: string; + checkOnly: boolean; + completedDate: string; + createdDate: string; + details?: object[]; + done: boolean; + errorMessage?: string; + errorStatusCode?: string; + ignoreWarnings?: boolean; + lastModifiedDate: string; + numberComponentErrors: number; + numberComponentsDeployed: number; + numberComponentsTotal: number; + numberTestErrors: number; + numberTestsCompleted: number; + numberTestsTotal: number; + rollbackOnError?: boolean; + startDate: string; + status: string; + success: boolean; +} + +interface MetadataObject { + childXmlNames: string[]; + directoryName: string; + inFolder: boolean; + metaFile: boolean; + suffix: string; + xmlName: string; +} + +interface DescribeMetadataResult { + metadataObjects: MetadataObject[]; + organizationNamespace: string; + partialSaveAllowed: boolean; + testRequired: boolean; +} + +interface FileProperties { + type: string; + createdById: string; + createdByName: string; + createdDate: string; + fileName: string; + fullName: string; + id: string; + lastModifiedById: string; + lastModifiedByName: string; + lastModifiedDate: string; + manageableState?: string; + namespacePrefix?: string; +} + +interface ListMetadataQuery { + type: string; + folder?: string; +} + +interface MetadataInfo { + fullName: string; +} + +interface RetrieveRequest { +} + +interface RetrieveResult { + fileProperties: FileProperties[]; + id: string; + messages: object[]; + zipFile: string +} + +interface SaveResult { + success: boolean; + fullName: string; +} + +interface UpdateMetadataInfo { + currentName: string; + metadata: MetadataInfo; +} + +interface UpsertResult { + success: boolean; + fullName: string; + created: boolean; +} + +interface AsyncResult { + done: boolean; + id: string; + state: string; + statusCode?: string; + message?: string; +} + +interface DeployOptions { + allowMissingFiles?: boolean; + autoUpdatePackage?: boolean; + checkOnly?: boolean; + ignoreWarnings?: boolean; + performRetrieve?: boolean; + purgeOnDelete?: boolean; + rollbackOnError?: boolean; + runAllTests?: boolean; + runTests?: string[]; + singlePackage?: boolean; +} + +export class AsyncResultLocator extends EventEmitter implements Promise { + check(callback?: callback): Promise + + complete(callback?: callback): Promise + + poll(interval: number, timeout: number): void; + + catch(onrejected?: ((reason: any) => (PromiseLike | TResult)) | null | undefined): Promise; + + then(onfulfilled?: ((value: T) => (PromiseLike | TResult1)) | null | undefined, + onrejected?: ((reason: any) => (PromiseLike | TResult2)) | null | undefined): Promise; + + readonly [Symbol.toStringTag]: "Promise"; +} + +export class DeployResultLocator extends AsyncResultLocator {} +export class RetrieveResultLocator extends AsyncResultLocator {} + +export class Metadata { + pollInterval: number; + pollTimeout: number; + + constructor(conn: Connection); + + checkDeployStatus(id: string, includeDetails?: boolean, callback?: callback): Promise + + checkRetrieveStatus(id: string, callback?: callback): Promise + + checkStatus(ids: string | string[], callback?: callback>): AsyncResultLocator> + + create(type: string, metadata: MetadataInfo | Array, callback?: callback>): Promise> + + createAsync(type: string, metadata: MetadataInfo | Array, callback?: callback>): Promise> + + createSync(type: string, metadata: MetadataInfo | Array, callback?: callback>): Promise>; + + delete(type: string, fullNames: string | string[], callback?: callback>): Promise>; + + deleteAsync(type: string, metadata: string | string[] | MetadataInfo | Array, callback?: callback>): AsyncResultLocator> + + deleteSync(type: string, fullNames: string | string[], callback?: callback>): Promise>; + + deploy(zipInput: Stream | Buffer | string, options: DeployOptions, callback?:callback): DeployResultLocator; + + describe(version?: string, callback?: callback): Promise; + + list(queries: ListMetadataQuery | Array, version?: string, callback?: callback>): Promise>; + + read(type: string, fullNames: string | string[], callback?: callback>): Promise>; + + readSync(type: string, fullNames: string | string[], callback?: callback>): Promise>; + + rename(type: string, oldFullName: string, newFullName: string, callback?: callback): Promise + + retrieve(request: RetrieveRequest, callback: callback): RetrieveResultLocator + + update(type: string, updateMetadata: MetadataInfo | Array, callback?: callback>): Promise> + + updateAsync(type: string, updateMetadata: MetadataInfo, callback?: callback>): AsyncResultLocator> + + updateSync(type: string, updateMetadata: MetadataInfo | Array, callback?: callback>): Promise> + + upsert(type: string, metadata: MetadataInfo | Array, callback?: callback>): Promise> +} diff --git a/types/jsforce/connection.d.ts b/types/jsforce/connection.d.ts index 4c3e1eb5fb..06cda5e29f 100644 --- a/types/jsforce/connection.d.ts +++ b/types/jsforce/connection.d.ts @@ -1,8 +1,14 @@ -import { SObjectCreateOptions } from './create-options'; -import { DescribeSObjectResult } from './describe-result'; +import { EventEmitter } from 'events'; +import { DescribeSObjectResult, DescribeGlobalResult } from './describe-result'; import { Query, QueryResult } from './query'; +import { Record } from './record'; import { RecordResult } from './record-result'; import { SObject } from './salesforce-object'; +import { Analytics } from './api/analytics'; +import { Chatter } from './api/chatter'; +import { Metadata } from './api/metadata'; + +export type callback = (err: Error, result: T) => void; // These are pulled out because according to http://jsforce.github.io/jsforce/doc/connection.js.html#line49 // the oauth options can either be in the `oauth2` proeprty OR spread across the main connection @@ -13,6 +19,12 @@ export interface OAuth2Options { redirectUri?: string; } +export interface RequestInfo { + method?: string; + url?: string; + headers?: object; +} + export interface ConnectionOptions extends OAuth2Options { accessToken?: string; callOptions?: Object; @@ -36,6 +48,14 @@ export interface UserInfo { url: string; } +export abstract class RestApi { + get(path: string, options: object, callback: () => object): Promise; + post(path: string, body: object, options: object, callback: () => object): Promise; + put(path: string, body: object, options: object, callback: () => object): Promise; + patch(path: string, body: object, options: object, callback: () => object): Promise; + del(path: string, options: object, callback: () => object): Promise; +} + export type ConnectionEvent = "refresh"; /** @@ -57,19 +77,58 @@ export type ConnectionEvent = "refresh"; * * to ensure that you have the correct data types for the various collection names. */ -export interface Connection { +export abstract class BaseConnection extends EventEmitter { + _baseUrl(): string; + request(info: RequestInfo | string, options?: Object, callback?: (err: Error, Object: object) => void): Promise; query(soql: string, callback?: (err: Error, result: QueryResult) => void): Query>; + queryMore(locator: string, options?: object, callback?: (err: Error, result: QueryResult) => void): Promise>; + create(type: string, records: Record|Array>, options?: Object, + callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; + insert(type: string, records: Record|Array>, options?: Object, + callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; + retrieve(type: string, ids: string|string[], options?: Object, + callback?: (err: Error, result: Record | Array>) => void): Promise<(Record | Array>)>; + update(type: string, records: Record|Array>, options?: Object, + callback?: (err: Error, result: RecordResult | Array>) => void): Promise<(RecordResult | RecordResult[])>; + upsert(type: string, records: Record|Array>, extIdField: string, options?: Object, + callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; + del(type: string, ids: string|string[], options?: Object, + callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; + delete(type: string, ids: string|string[], options?: Object, + callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; + destroy(type: string, ids: string|string[], options?: Object, + callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; + describe(type: string, callback?: (err: Error, result: DescribeSObjectResult) => void): Promise; + describeGlobal(callback?: (err: Error, result: DescribeGlobalResult) => void): Promise; sobject(resource: string): SObject; } -export class Connection implements Connection { +export class Connection extends BaseConnection { constructor(params: ConnectionOptions) + + tooling: Tooling; + analytics: Analytics; + chatter: Chatter; + metadata: Metadata; + + // Specific to Connection + instanceUrl: string; + version: string; accessToken: string; + initialize(options?: ConnectionOptions): void; + queryAll(soql: string, options?: object, callback?: (err: Error, result: QueryResult) => void): Query>; + authorize(code: string, callback?: (err: Error, res: UserInfo) => void): Promise; login(user: string, password: string, callback?: (err: Error, res: UserInfo) => void): Promise; loginByOAuth2(user: string, password: string, callback?: (err: Error, res: UserInfo) => void): Promise; loginBySoap(user: string, password: string, callback?: (err: Error, res: UserInfo) => void): Promise; logout(callback?: (err: Error, res: undefined) => void): Promise; logoutByOAuth2(callback?: (err: Error, res: undefined) => void): Promise; logoutBySoap(callback?: (err: Error, res: undefined) => void): Promise; - on(eventName: ConnectionEvent, callback: Function): void; +} + +export class Tooling extends BaseConnection { + _logger: any; + + // Specific to tooling + executeAnonymous(body: string, callback?: (err: Error, res: any) => void): Promise; } diff --git a/types/jsforce/describe-result.d.ts b/types/jsforce/describe-result.d.ts index 584a62d3bf..352c4223a6 100644 --- a/types/jsforce/describe-result.d.ts +++ b/types/jsforce/describe-result.d.ts @@ -1,4 +1,30 @@ export interface DescribeSObjectResult { label: string; - fields: string[]; + fields: object[]; +} + +export interface DescribeGlobalResult { + activateable: boolean; + createable: boolean; + custom: boolean; + customSetting: boolean; + deletable: boolean; + deprecatedAndHidden: boolean; + feedEnabled: boolean; + hasSubtypes: boolean; + isSubtype: boolean; + keyPrefix: string; + label: string; + labelPlural: string; + layoutable: boolean; + mergeable: boolean; + mruEnabled: boolean; + name: string; + queryable: boolean; + replicateable: boolean; + retrieveable: boolean; + searchable: boolean; + triggerable: boolean; + undeletable: boolean; + updateable: boolean; } diff --git a/types/jsforce/index.d.ts b/types/jsforce/index.d.ts index 73a848b79f..edb2830f52 100644 --- a/types/jsforce/index.d.ts +++ b/types/jsforce/index.d.ts @@ -2,6 +2,8 @@ // Project: https://github.com/jsforce/jsforce // Definitions by: Dolan Miu // Kamil Ejsymont +// Thomas Dvornik +// Tim Noonan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -13,6 +15,16 @@ import * as glob from 'glob'; export { Date } from './date-enum'; export { Record } from './record'; export { RecordResult } from './record-result'; -export { Connection } from './connection'; +export { Connection, ConnectionOptions, RequestInfo, Tooling, callback } from './connection'; export { SObject } from './salesforce-object'; export { SalesforceId } from './salesforce-id'; +export { OAuth2, OAuth2Options } from './oauth2'; +export { Query, QueryResult } from './query'; +export { Promise } from './promise'; +export { Report, Dashboard, Analytics, ReportInstance, DashboardInfo, ReportInfo, ExplainInfo, ReportInstanceAttrs, + ReportMetadata, ReportResult } from './api/analytics'; +export { Chatter, Request, RequestResult, BatchRequestResults, BatchRequestParams, + Resource, BatchRequestResult, RequestParams } from './api/chatter'; +export { Metadata, SaveResult, MetadataInfo, AsyncResult, RetrieveResultLocator, RetrieveRequest, FileProperties, + ListMetadataQuery, DescribeMetadataResult, DeployOptions, AsyncResultLocator, RetrieveResult, MetadataObject, + DeployResult, DeployResultLocator, UpdateMetadataInfo, UpsertResult } from './api/metadata'; diff --git a/types/jsforce/jsforce-tests.ts b/types/jsforce/jsforce-tests.ts index 2c1b5b1f9c..9205d59096 100644 --- a/types/jsforce/jsforce-tests.ts +++ b/types/jsforce/jsforce-tests.ts @@ -79,7 +79,7 @@ salesforceConnection.query('SELECT Id FROM Account') .on('end', (query: any) => { console.log(records); }) - .on('error', (error) => { + .on('error', (error: Error) => { console.log('Error returned from query:', error); }) .run({ autoFetch: true, maxFetch: 25 }); @@ -89,3 +89,191 @@ salesforceConnection.sobject('Coverage__c') salesforceConnection.sobject('Coverage__c') .select(['Id', 'Name']).del("test", () => { }); + +async function testAnalytics(conn: sf.Connection): Promise { + const analytics: sf.Analytics = conn.analytics; + + const dashboards: sf.DashboardInfo[] = await analytics.dashboards(); + const dashboard = dashboards[0] as any; + Object.keys(dashboards[0]) + .forEach((key: string) => console.log(`key: ${key} : ${dashboard[key]}`)); + console.log('dashboard keys from await'); + + analytics.dashboards((err, dashboards: sf.DashboardInfo[]) => { + const _dashboard: any = dashboards[0] as any; + Object.keys(_dashboard) + .forEach((key: string) => console.log(`key: ${key} : ${_dashboard[key]}`)); + console.log('dashboard keys from callback'); + }); + + const reports: sf.ReportInfo[] = await analytics.reports(); + const report: any = reports[0] as any; + Object.keys(reports[0]).forEach((key: string) => console.log(`key: ${key} : ${report[key]}`)); + + analytics.reports((err, reports: sf.ReportInfo[]) => { + const _report: any = reports[0] as any; + Object.keys(reports[0]) + .forEach((key: string) => console.log(`key: ${key} : ${_report[key]}`)); + console.log('report keys from callback'); + }); +} + +async function testMetadata(conn: sf.Connection): Promise { + const md: sf.Metadata = conn.metadata; + const m: sf.DescribeMetadataResult = await md.describe('34.0'); + const pages: sf.MetadataObject[] = + m.metadataObjects.filter((value: sf.MetadataObject) => value.directoryName === 'pages'); + console.log(`ApexPage?: ${pages[0].xmlName === 'ApexPage'}`); + + const types: sf.ListMetadataQuery[] = [{type: 'CustomObject', folder: null}]; + md.list(types, '39.0', (err, properties: sf.FileProperties[]) => { + if (err) { + console.error('err', err); + return; + } + const meta: sf.FileProperties = properties[0]; + console.log('metadata count: ' + properties.length); + console.log('createdById: ' + meta.createdById); + console.log('createdByName: ' + meta.createdByName); + console.log('createdDate: ' + meta.createdDate); + console.log('fileName: ' + meta.fileName); + console.log('fullName: ' + meta.fullName); + console.log('id: ' + meta.id); + console.log('lastModifiedById: ' + meta.lastModifiedById); + console.log('lastModifiedByName: ' + meta.lastModifiedByName); + console.log('lastModifiedDate: ' + meta.lastModifiedDate); + console.log('manageableState: ' + meta.manageableState); + console.log('namespacePrefix: ' + meta.namespacePrefix); + console.log('type: ' + meta.type); + }); + + const fullNames: string[] = [ 'Account', 'Contact' ]; + const info: sf.MetadataInfo | sf.MetadataInfo[] = await md.read('CustomObject', fullNames); + console.log((info as sf.MetadataInfo[])[0].fullName); + console.log((info as sf.MetadataInfo[])[1].fullName); + + const now: number = Date.now(); + const now2: number = now + 1; + const metadata = [{ + fullName: `TestObject${now}__c`, + label: `Test Object ${now}`, + pluralLabel: `Test Object ${now}`, + nameField: { + type: 'Text', + label: `Test Object Name ${now}` + }, + deploymentStatus: 'Deployed', + sharingModel: 'ReadWrite' + }, { + fullName: `TestObject${now2}__c`, + label: `Test Object ${now2}`, + pluralLabel: `Test Object ${now2}`, + nameField: { + type: 'AutoNumber', + label: 'Test Object #' + }, + deploymentStatus: 'InDevelopment', + sharingModel: 'Private' + }]; + + const result: sf.SaveResult | sf.SaveResult[] = await md.create('CustomObject', metadata); + console.log(`created ${(result as sf.SaveResult[])[0].fullName} - ${(result as sf.SaveResult[])[0].success}`); + console.log(`created ${(result as sf.SaveResult[])[1].fullName} - ${(result as sf.SaveResult[])[1].success}`); + + const fullNames2: string[] = [`TestObject${now}__c`, `TestObject${now2}__c`]; + const result2: sf.SaveResult | sf.SaveResult[] = + await (md.delete('CustomObject', fullNames2) as Promise); + console.log(`deleted ${result2[0].fullName} - ${result2[0].success}`); + console.log(`deleted ${result2[1].fullName} - ${result2[1].success}`); +} + +async function testChatter(conn: sf.Connection): Promise { + const chatter: sf.Chatter = conn.chatter; + chatter.resource('/feed-elements').create({ + body: { + messageSegments: [{ + type: 'Text', + text: 'This is new post' + }] + }, + feedElementType : 'FeedItem', + subjectId: 'me' + }, (err: Error, result: any) => { + if (err) { + throw err; + } + const feedMessageUrl = `/feed-elements/${result.id}/capabilities/comments/items`; + chatter.resource(feedMessageUrl).create({ + body: { + messageSegments: [{ + type: 'Text', + text: 'This is new comment on the post' + }] + } + }, (err: Error, result: any) => { + if (err) { + throw err; + } + console.log("Id: " + result.id); + console.log("URL: " + result.url); + console.log("Body: " + result.body.messageSegments[0].text); + }); + }); + + const resourceMe: sf.Resource = chatter.resource('/users/me'); + resourceMe.retrieve((err, res: any) => { + if (err) { + console.error(err); + return; + } + console.log("username: " + res.username); + console.log("email: " + res.email); + console.log("small photo url: " + res.photo.smallPhotoUrl); + }); + + chatter.resource('/users', { q: 'Suzuki' }).retrieve((err, result: any) => { + if (err) { + console.error(err); + return; + } + console.log("current page URL: " + result['currentPageUrl']); + console.log("next page URL: " + result['nextPageUrl']); + console.log("users count: " + result['users'].length); + for (const user of result['users']) { + console.log('User ID: ' + user.id); + console.log('User URL: ' + user.url); + console.log('Username: ' + user.username); + } + }); + + const feedResource: sf.Resource = chatter.resource('/feed-elements'); + + const feedCreateRequest: any = await (feedResource.create({ + body: { + messageSegments: [{ + type: 'Text', + text: 'This is new comment on the post' + }] + }, + feedElementType : 'FeedItem', + subjectId: 'me' + }) as Promise); + + console.log(`feedCreateRequest.id: ${feedCreateRequest.id}`); + const itemLikesUrl = `/feed-elements/${feedCreateRequest.id}/capabilities/chatter-likes/items`; + const itemsLikeResource: sf.Resource = chatter.resource(itemLikesUrl); + + const itemsLikeCreateResult: sf.RequestResult = await (itemsLikeResource.create('') as Promise); + console.log(`itemsLikeCreateResult['likedItem']: ${itemsLikeCreateResult as any ['likedItem']}`); +} + +(async () => { + const query2: sf.QueryResult = + await (salesforceConnection.query("SELECT Id, Name FROM User") as Promise>); + console.log("Query Promise: total in database: " + query2.totalSize); + console.log("Query Promise: total fetched : " + query2.records[0]); + + await testAnalytics(salesforceConnection); + await testChatter(salesforceConnection); + await testMetadata(salesforceConnection); +})(); diff --git a/types/jsforce/oauth2.d.ts b/types/jsforce/oauth2.d.ts new file mode 100644 index 0000000000..833a9d45fd --- /dev/null +++ b/types/jsforce/oauth2.d.ts @@ -0,0 +1,35 @@ +export interface OAuth2Options { + authzServiceUrl?: string; + tokenServiceUrl?: string; + clientId?: string; + clientSecret?: string; + httpProxy?: string; + loginUrl?: string; + proxyUrl?: string; + redirectUri?: string; + refreshToken?: string; + revokeServiceUrl?: string; + authCode?: string; + privateKeyFile?: string; + privateKey?: string; // Used for sfdx auth files for legacy support reasons +} + +export class OAuth2 { + constructor (options? : OAuth2Options); + + protected _postParams(options: any, callback: () => any): void + + loginUrl: string; + authzServiceUrl: string; + tokenServiceUrl: string; + revokeServiceUrl: string; + clientId: string; + clientSecret: string; + redirectUri: string; + + getAuthorizationUrl(params: any): string; + refreshToken(code: string, callback?: () => any): Promise; + requestToken(code: string, callback?: () => any): Promise; + authenticate(username: string, password: string, callback?: () => any): Promise; + revokeToken(accessToken: string, callback?: () => any): Promise; +} diff --git a/types/jsforce/promise.d.ts b/types/jsforce/promise.d.ts new file mode 100644 index 0000000000..f4f6e0660b --- /dev/null +++ b/types/jsforce/promise.d.ts @@ -0,0 +1,3 @@ +export class Promise { + thenCall: (cb: () => void) => void; +} diff --git a/types/jsforce/query.d.ts b/types/jsforce/query.d.ts index 0e7d413cf8..b33af41ede 100644 --- a/types/jsforce/query.d.ts +++ b/types/jsforce/query.d.ts @@ -1,7 +1,5 @@ // http://jsforce.github.io/jsforce/doc/Query.html import { Readable } from 'stream'; - -import { SalesforceId } from './salesforce-id'; import { RecordResult } from './record-result'; export interface ExecuteOptions { @@ -19,38 +17,63 @@ export interface QueryResult { export class Query extends Readable implements Promise { end(): Query; + filter(filter: Object): Query; + include(include: string): Query; + hint(hint: Object): Query; + limit(value: number): Query; + maxFetch(value: number): Query; + offset(value: number): Query; + skip(value: number): Query; - sort(keyOrList: string | Object[] | Object, direction?: "ASC" | "DESC" | number): Query; + + sort(keyOrList: string | Object[] | Object, direction?: 'ASC' | 'DESC' | number): Query; + run(options?: ExecuteOptions, callback?: (err: Error, records: T[]) => void): Query; + execute(options?: ExecuteOptions, callback?: (err: Error, records: T[]) => void): Query; + exec(options?: ExecuteOptions, callback?: (err: Error, records: T[]) => void): Query; + del(type?: string, callback?: (err: Error, ret: RecordResult) => void): any; del(callback?: (err: Error, ret: RecordResult) => void): any; + delete(type?: string, callback?: (err: Error, ret: RecordResult) => void): any; delete(callback?: (err: Error, ret: RecordResult) => void): any; + destroy(type?: string, callback?: (err: Error, ret: RecordResult) => void): Promise; destroy(callback?: (err: Error, ret: RecordResult) => void): Promise; destroy(error?: Error): void; + explain(callback?: (err: Error, info: ExplainInfo) => void): Promise; + map(callback: (currentValue: Object) => void): Promise; + scanAll(value: boolean): Query; + select(fields: Object | string[] | string): Query; + thenCall(callback?: (err: Error, records: T) => void): Query; + toSOQL(callback: (err: Error, soql: string) => void): Promise; + update(mapping: any, type: string, callback: (err: Error, records: RecordResult[]) => void): Promise; + where(conditions: Object | string): Query; - // Implementing promise methods - then(onfulfilled?: any): Promise; - catch(onrejected?: any): Promise; finally(): Promise; - [Symbol.toStringTag]: "Promise"; + + [Symbol.toStringTag]: 'Promise'; + + catch(onrejected?: ((reason: any) => (PromiseLike | TResult))): Promise; + + then(onfulfilled?: ((value: T) => (PromiseLike | TResult1)), + onrejected?: ((reason: any) => (PromiseLike | TResult2))): Promise; } -export class ExplainInfo { } +export class ExplainInfo {} From e372b989c73776d9e573ad034bc9519941db61c8 Mon Sep 17 00:00:00 2001 From: Nattapong-sir <33569075+Nattapong-sir@users.noreply.github.com> Date: Thu, 12 Apr 2018 23:59:27 +0700 Subject: [PATCH 0619/2153] Add auth options into MongoClientOptions (#24934) Reference: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/24906#issuecomment-380486889 --- types/mongodb/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 8b5a637ebd..00356214c6 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -97,6 +97,10 @@ export interface MongoClientOptions extends validateOptions?: Object; // The name of the application that created this MongoClient instance. appname?: string; + auth?: { + user: string; + password: string; + } } export interface SSLOptions { From cdb3807edbfce9a848035bf997bfad95756f83ba Mon Sep 17 00:00:00 2001 From: Sean Kelley Date: Thu, 12 Apr 2018 09:59:44 -0700 Subject: [PATCH 0620/2153] reactstrap: Input from StatelessComponent to React.Component subclass (#24846) * reactstrap: Input from StatelessComponent to ComponentClass `Input` is a full React component (`ComponentClass`), not a stateless component. In particular, this change allows consumers to pass `ref` to it (not legal with `StatelessComponent`), which useful for e.g. calling `HTMLInputElement#focus()`. * ComponentClasss -> extends React.Component --- types/reactstrap/lib/Input.d.ts | 3 ++- types/reactstrap/reactstrap-tests.tsx | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/types/reactstrap/lib/Input.d.ts b/types/reactstrap/lib/Input.d.ts index 3da3691ea8..eddd8089be 100644 --- a/types/reactstrap/lib/Input.d.ts +++ b/types/reactstrap/lib/Input.d.ts @@ -1,3 +1,4 @@ +import * as React from 'react'; import { CSSModule } from '../index'; export type InputType = @@ -41,5 +42,5 @@ export interface InputProps extends React.InputHTMLAttributes cssModule?: CSSModule; } -declare const Input: React.StatelessComponent; +declare class Input extends React.Component {} export default Input; diff --git a/types/reactstrap/reactstrap-tests.tsx b/types/reactstrap/reactstrap-tests.tsx index 8b58c9f886..1b777d173c 100644 --- a/types/reactstrap/reactstrap-tests.tsx +++ b/types/reactstrap/reactstrap-tests.tsx @@ -3676,3 +3676,9 @@ const Example116 = (props: any) => { ); }; + +class Example117 extends React.Component { + render() { + return { console.log(e); }}/>; + } +} From fbd66a68aaf21085ef6bd9ad62229559f891d7ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Zugmeyer?= Date: Thu, 12 Apr 2018 18:59:57 +0200 Subject: [PATCH 0621/2153] [chart.js] add the Chart option `devicePixelRatio` (#24926) See [chart.js documentation](http://www.chartjs.org/docs/latest/general/device-pixel-ratio.html) --- types/chart.js/chart.js-tests.ts | 1 + types/chart.js/index.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index 9e6117c5e5..d0f6ebc684 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -58,6 +58,7 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), { padding: 40 } }, + devicePixelRatio: 2, } }); chart.update(); diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index a2ea423cb8..a085fd0381 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -199,6 +199,7 @@ declare namespace Chart { cutoutPercentage?: number; circumference?: number; rotation?: number; + devicePixelRatio?: number; // Plugins can require any options plugins?: { [plugin: string]: any }; } From 509c1b2d90de11c08c55554b7cb51213493de6a0 Mon Sep 17 00:00:00 2001 From: Simon Archer Date: Thu, 12 Apr 2018 18:00:20 +0100 Subject: [PATCH 0622/2153] chart.js - Add datasetIndex property to ChartLegendItem (#24712) * Add datasetIndex property to ChartLegendItem. * New sub-type interface for ChartLegendLabelItem. --- types/chart.js/index.d.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index a085fd0381..0ea854c7ba 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -9,6 +9,7 @@ // Dan Manastireanu // Guillaume Rodriguez // Sergey Rubanov +// Simon Archer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -126,6 +127,10 @@ declare namespace Chart { pointStyle?: PointStyle; } + interface ChartLegendLabelItem extends ChartLegendItem { + datasetIndex: number; + } + interface ChartTooltipItem { xLabel?: string; yLabel?: string; @@ -227,8 +232,8 @@ declare namespace Chart { display?: boolean; position?: PositionType; fullWidth?: boolean; - onClick?(event: MouseEvent, legendItem: ChartLegendItem): void; - onHover?(event: MouseEvent, legendItem: ChartLegendItem): void; + onClick?(event: MouseEvent, legendItem: ChartLegendLabelItem): void; + onHover?(event: MouseEvent, legendItem: ChartLegendLabelItem): void; labels?: ChartLegendLabelOptions; reverse?: boolean; } @@ -241,7 +246,7 @@ declare namespace Chart { fontFamily?: string; padding?: number; generateLabels?(chart: any): any; - filter?(item: ChartLegendItem, data: ChartData): any; + filter?(legendItem: ChartLegendLabelItem, data: ChartData): any; usePointStyle?: boolean; } From 22bea9740b0a057ba2778df325f12b4cf5900ce5 Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Thu, 12 Apr 2018 13:00:40 -0400 Subject: [PATCH 0623/2153] [plupload] Additional Documentation and .features type fix (#24919) * Add test for features map I can't find a good description on the site for all of the values in this map, so for now it's just "any". I would like to specify this though. * Add documentation for a couple plupload constants * Expand features scope out to the "any" map These are technically fixed, but there's no good documentation on what "features" are all supported that I can find. * Update more documentation * WHITESPAZE --- types/plupload/index.d.ts | 301 +++++++++++++++++++++++++++++-- types/plupload/plupload-tests.ts | 3 + 2 files changed, 293 insertions(+), 11 deletions(-) diff --git a/types/plupload/index.d.ts b/types/plupload/index.d.ts index c83fd77740..df313bcc54 100644 --- a/types/plupload/index.d.ts +++ b/types/plupload/index.d.ts @@ -143,28 +143,172 @@ declare namespace plupload { constructor(settings: plupload_settings); - /** Properties */ + /** + * Unique id for the Uploader instance. + * + * @property id + * @type String + */ id: string; + + /** + * Current state of the total uploading progress. This one can either be plupload.STARTED or plupload.STOPPED. + * These states are controlled by the stop/start methods. The default value is STOPPED. + * + * @property state + * @type Number + */ state: number; - features: string; + + /** + * Map of features that are available for the uploader runtime. Features will be filled + * before the init event is called, these features can then be used to alter the UI for the end user. + * Some of the current features that might be in this map is: dragdrop, chunks, jpgresize, pngresize. + * + * @property features + * @type Object + */ + features: any; + + /** + * Current runtime name. + * + * @property runtime + * @type String + */ runtime: string; - files: any; + + /** + * Current upload queue, an array of File instances. + * + * @property files + * @type Array + * @see plupload.File + */ + files: Array; + + /** + * Object with name/value settings. + * + * @property settings + * @type Object + */ settings: any; + + /** + * Total progess information. How many files has been uploaded, total percent etc. + * + * @property total + * @type plupload.QueueProgress + */ total: plupload_queue_progress; - /** Methods */ - init(): any; - setOption(option: string | any, value?: any): any; + /** + * Initializes the Uploader instance and adds internal event listeners. + * + * @method init + */ + init(): void; + + /** + * Set the value for the specified option(s). + * + * @method setOption + * @since 2.1 + * @param {String|Object} option Name of the option to change or the set of key/value pairs + * @param {Mixed} [value] Value for the option (is ignored, if first argument is object) + */ + setOption(option: string | any, value?: any): void; + + /** + * Get the value for the specified option or the whole configuration, if not specified. + * + * @method getOption + * @since 2.1 + * @param {String} [option] Name of the option to get + * @return {Mixed} Value for the option or the whole set + */ getOption(option?: string): any; - refresh(): any; - start(): any; - stop(): any; - disableBrowse(disable: boolean): any; + + /** + * Refreshes the upload instance by dispatching out a refresh event to all runtimes. + * This would for example reposition flash/silverlight shims on the page. + * + * @method refresh + */ + refresh(): void; + + /** + * Starts uploading the queued files. + * + * @method start + */ + start(): void; + + /** + * Stops the upload of the queued files. + * + * @method stop + */ + stop(): void; + + /** + * Disables/enables browse button on request. + * + * @method disableBrowse + * @param {Boolean} disable Whether to disable or enable (default: true) + */ + disableBrowse(disable: boolean): void; + + // TODO: Make plupload.File typing + /** + * Returns the specified file object by id. + * + * @method getFile + * @param {String} id File id to look for. + * @return {plupload.File} File object or undefined if it wasn't found; + */ getFile(id: string): any; - addFile(file: any, fileName?: string): any; + + /** + * Adds file to the queue programmatically. Can be native file, instance of Plupload.File, + * instance of mOxie.File, input[type="file"] element, or array of these. Fires FilesAdded, + * if any files were added to the queue. Otherwise nothing happens. + * + * @method addFile + * @since 2.0 + * @param {plupload.File|mOxie.File|File|Node|Array} file File or files to add to the queue. + * @param {String} [fileName] If specified, will be used as a name for the file + */ + addFile(file: any, fileName?: string): void; + + /** + * Removes a specific file. + * + * @method removeFile + * @param {plupload.File|String} file File to remove from queue. + */ removeFile(file: any): any; + + /** + * Removes part of the queue and returns the files removed. This will also trigger the + * FilesRemoved and QueueChanged events. + * + * @method splice + * @param {Number} [start=0] Start index to remove from. + * @param {Number} [length] Number of files to remove (defaults to number of files in the queue). + * @return {Array} Array of files that was removed. + */ splice(start?: number, length?: number): any; + + /** + * Dispatches the specified event name and its arguments to all listeners. + * @method trigger + * @param {String} name Event name to fire. + * @param {Object..} Multiple arguments to pass along to the listener functions. + */ trigger(name: string, Multiple: any): any; + hasEventListener(name: string): any; bind(name: string, func: any, scope?: any): any; unbind(name: string, func: any): any; @@ -174,22 +318,157 @@ declare namespace plupload { export const VERSION: string; + /** + * The state of the queue before it has started and after it has finished + * + * @property STOPPED + * @static + * @final + */ export const STOPPED: number; + + /** + * Upload process is running + * + * @property STARTED + * @static + * @final + */ export const STARTED: number; + + /** + * File is queued for upload + * + * @property QUEUED + * @static + * @final + */ export const QUEUED: number; + + /** + * File is being uploaded + * + * @property UPLOADING + * @static + * @final + */ export const UPLOADING: number; + + /** + * File has failed to be uploaded + * + * @property FAILED + * @static + * @final + */ export const FAILED: number; + + /** + * File has been uploaded successfully + * + * @property DONE + * @static + * @final + */ export const DONE: number; + + /** + * Generic error for example if an exception is thrown inside Silverlight. + * + * @property GENERIC_ERROR + * @static + * @final + */ export const GENERIC_ERROR: number; + + /** + * HTTP transport error. For example if the server produces a HTTP status other than 200. + * + * @property HTTP_ERROR + * @static + * @final + */ export const HTTP_ERROR: number; + + /** + * Generic I/O error. For example if it wasn't possible to open the file stream on local machine. + * + * @property IO_ERROR + * @static + * @final + */ export const IO_ERROR: number; + + /** + * @property SECURITY_ERROR + * @static + * @final + */ export const SECURITY_ERROR: number; + + /** + * Initialization error. Will be triggered if no runtime was initialized. + * + * @property INIT_ERROR + * @static + * @final + */ export const INIT_ERROR: number; + + /** + * File size error. If the user selects a file that is too large or is empty it will be blocked and + * an error of this type will be triggered. + * + * @property FILE_SIZE_ERROR + * @static + * @final + */ export const FILE_SIZE_ERROR: number; + + /** + * File extension error. If the user selects a file that isn't valid according to the filters setting. + * + * @property FILE_EXTENSION_ERROR + * @static + * @final + */ export const FILE_EXTENSION_ERROR: number; + + /** + * Duplicate file error. If prevent_duplicates is set to true and user selects the same file again. + * + * @property FILE_DUPLICATE_ERROR + * @static + * @final + */ export const FILE_DUPLICATE_ERROR: number; + + /** + * Runtime will try to detect if image is proper one. Otherwise will throw this error. + * + * @property IMAGE_FORMAT_ERROR + * @static + * @final + */ export const IMAGE_FORMAT_ERROR: number; + + /** + * While working on files runtime may run out of memory and will throw this error. + * + * @since 2.1.2 + * @property MEMORY_ERROR + * @static + * @final + */ export const MEMORY_ERROR: number; + + /** + * Each runtime has an upper limit on a dimension of the image it can handle. If bigger, will throw this error. + * + * @property IMAGE_DIMENSIONS_ERROR + * @static + * @final + */ export const IMAGE_DIMENSIONS_ERROR: number; export const mimeTypes: any; diff --git a/types/plupload/plupload-tests.ts b/types/plupload/plupload-tests.ts index 2a416a0bbc..2e57c45c27 100644 --- a/types/plupload/plupload-tests.ts +++ b/types/plupload/plupload-tests.ts @@ -21,6 +21,9 @@ import 'plupload'; document.getElementById('console').innerHTML += "\nError #" + err.code + ": " + err.message; }); + if (!uploader.features.chunks || !uploader.features.multipart) { + window.alert('Your browser does not support a feature required for uploads. Try installing Flash or Silverlight.'); + } } { From 8cf4294b848c8cbfe3721818ff835dd1dd291b08 Mon Sep 17 00:00:00 2001 From: Dennis Axelsson Date: Thu, 12 Apr 2018 19:02:44 +0200 Subject: [PATCH 0624/2153] Add typings for enzyme-redux (#24948) --- types/enzyme-redux/enzyme-redux-tests.tsx | 9 ++++++++ types/enzyme-redux/index.d.ts | 25 +++++++++++++++++++++++ types/enzyme-redux/tsconfig.json | 24 ++++++++++++++++++++++ types/enzyme-redux/tslint.json | 1 + 4 files changed, 59 insertions(+) create mode 100644 types/enzyme-redux/enzyme-redux-tests.tsx create mode 100644 types/enzyme-redux/index.d.ts create mode 100644 types/enzyme-redux/tsconfig.json create mode 100644 types/enzyme-redux/tslint.json diff --git a/types/enzyme-redux/enzyme-redux-tests.tsx b/types/enzyme-redux/enzyme-redux-tests.tsx new file mode 100644 index 0000000000..ecd196dfd8 --- /dev/null +++ b/types/enzyme-redux/enzyme-redux-tests.tsx @@ -0,0 +1,9 @@ +import { mountWithState, mountWithStore, shallowWithState, shallowWithStore } from 'enzyme-redux'; +import * as React from 'react'; + +const Component = () =>
    component
    ; +const shallowWithStateWrapper = shallowWithState(, {}); +const shallowWithStoreWrapper = shallowWithStore(, {}); + +const mountWithStateWrapper = mountWithState(, {}); +const mountWithStoreWrapper = mountWithStore(, {}); diff --git a/types/enzyme-redux/index.d.ts b/types/enzyme-redux/index.d.ts new file mode 100644 index 0000000000..ad312d6d1f --- /dev/null +++ b/types/enzyme-redux/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for enzyme-redux 0.2 +// Project: https://github.com/Knegusen/enzyme-redux#readme +// Definitions by: Dennis Axelsson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import { ReactWrapper, ShallowWrapper } from 'enzyme'; +import { ReactElement } from 'react'; + +export function shallowWithStore

    ( + Component: ReactElement

    , + store: any +): ShallowWrapper

    ; +export function mountWithStore

    ( + Component: ReactElement

    , + store: any +): ReactWrapper

    ; +export function shallowWithState

    ( + Component: ReactElement

    , + state: any +): ShallowWrapper

    ; +export function mountWithState

    ( + Component: ReactElement

    , + state: any +): ReactWrapper

    ; diff --git a/types/enzyme-redux/tsconfig.json b/types/enzyme-redux/tsconfig.json new file mode 100644 index 0000000000..7cc21814b3 --- /dev/null +++ b/types/enzyme-redux/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "enzyme-redux-tests.tsx" + ] +} diff --git a/types/enzyme-redux/tslint.json b/types/enzyme-redux/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/enzyme-redux/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 81cb59546fde86fb8dfe1b556bea782699cf51ed Mon Sep 17 00:00:00 2001 From: Damien Erambert Date: Thu, 12 Apr 2018 10:03:10 -0700 Subject: [PATCH 0625/2153] Add typings for `focus-within` (#24935) * add typings for focus-within * fix test filenames * fix typings and tests according to review comments --- types/focus-within/index.d.ts | 16 ++++++++++++ .../test/focus-within-global-tests.ts | 10 ++++++++ .../test/focus-within-import-default-tests.ts | 11 ++++++++ types/focus-within/tsconfig.json | 25 +++++++++++++++++++ types/focus-within/tslint.json | 3 +++ 5 files changed, 65 insertions(+) create mode 100644 types/focus-within/index.d.ts create mode 100644 types/focus-within/test/focus-within-global-tests.ts create mode 100644 types/focus-within/test/focus-within-import-default-tests.ts create mode 100644 types/focus-within/tsconfig.json create mode 100644 types/focus-within/tslint.json diff --git a/types/focus-within/index.d.ts b/types/focus-within/index.d.ts new file mode 100644 index 0000000000..4a8778fe05 --- /dev/null +++ b/types/focus-within/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for focus-within 1.0 +// Project: https://github.com/jonathantneal/focus-within#readme +// Definitions by: Damien Erambert +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace focusWithin { + interface FocusWithinOpts { + attr?: boolean; + className?: string; + } +} + +declare function focusWithin(document: HTMLDocument, opts?: focusWithin.FocusWithinOpts): void; + +export as namespace focusWithin; +export = focusWithin; diff --git a/types/focus-within/test/focus-within-global-tests.ts b/types/focus-within/test/focus-within-global-tests.ts new file mode 100644 index 0000000000..51ddc6aad5 --- /dev/null +++ b/types/focus-within/test/focus-within-global-tests.ts @@ -0,0 +1,10 @@ +/* + * This file tests the typings of the global export of `focus-within` + */ + +focusWithin(document); + +focusWithin(document, { + attr: false, + className: 'foo' +}); diff --git a/types/focus-within/test/focus-within-import-default-tests.ts b/types/focus-within/test/focus-within-import-default-tests.ts new file mode 100644 index 0000000000..627dce9660 --- /dev/null +++ b/types/focus-within/test/focus-within-import-default-tests.ts @@ -0,0 +1,11 @@ +/* + * This file tests the typings of the default export of `focus-within` + */ +import focusWithin = require("focus-within"); + +focusWithin(document); + +focusWithin(document, { + attr: false, + className: 'foo' +}); diff --git a/types/focus-within/tsconfig.json b/types/focus-within/tsconfig.json new file mode 100644 index 0000000000..976335025f --- /dev/null +++ b/types/focus-within/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "test/focus-within-global-tests.ts", + "test/focus-within-import-default-tests.ts" + ] +} diff --git a/types/focus-within/tslint.json b/types/focus-within/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/focus-within/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file From 1bedb8fe2b8149c76d244656ad25e01e1be35590 Mon Sep 17 00:00:00 2001 From: Margarita Yanochkina Date: Thu, 12 Apr 2018 20:04:04 +0300 Subject: [PATCH 0626/2153] [google-map-react] bounds fix (#24794) --- types/google-map-react/index.d.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/types/google-map-react/index.d.ts b/types/google-map-react/index.d.ts index d0606f76fd..7f34a68cc4 100644 --- a/types/google-map-react/index.d.ts +++ b/types/google-map-react/index.d.ts @@ -47,10 +47,10 @@ export interface Maps { } export interface Bounds { - nw: number; - ne: number; - sw: number; - se: number; + nw: Coords; + ne: Coords; + sw: Coords; + se: Coords; } export interface Point { @@ -63,6 +63,11 @@ export interface Coords { lng: number; } +export interface Size { + width: number; + height: number; +} + export interface ClickEventValue extends Point, Coords { event: any; } @@ -72,6 +77,7 @@ export interface ChangeEventValue { zoom: number; bounds: Bounds; marginBounds: Bounds; + size: Size; } export interface Props { From ab4cfd3de4cc173c175f937f1574302fdbc63aeb Mon Sep 17 00:00:00 2001 From: Aankhen Date: Thu, 12 Apr 2018 22:34:19 +0530 Subject: [PATCH 0627/2153] rename: Remove minimum version and comment out failing tests. (#24938) --- types/rename/index.d.ts | 1 - types/rename/rename-tests.ts | 14 ++++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/types/rename/index.d.ts b/types/rename/index.d.ts index 9b61f316ef..733db48069 100644 --- a/types/rename/index.d.ts +++ b/types/rename/index.d.ts @@ -2,7 +2,6 @@ // Project: https://github.com/popomore/rename // Definitions by: Aankhen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.5 /// diff --git a/types/rename/rename-tests.ts b/types/rename/rename-tests.ts index 96c283d0f2..20318254ca 100644 --- a/types/rename/rename-tests.ts +++ b/types/rename/rename-tests.ts @@ -3,9 +3,12 @@ import rename = require('rename'); rename(); // $ExpectError rename('a.js'); // $ExpectError rename(undefined, undefined); // $ExpectError -rename(1, 2); // $ExpectError -rename('a.js', () => { }); // $ExpectError -rename('a.js', (obj) => { }); // $ExpectError + +// These fail to produce errors on 2.4 +// rename(1, 2); // $ExpectError +// rename('a.js', () => { }); // $ExpectError +// rename('a.js', (obj) => { }); // $ExpectError + rename({ non: "existent" }, 'b.js'); // $ExpectError rename('a.js', 'b.js'); // $ExpectType FilePath @@ -40,7 +43,10 @@ rename.parse({}); // $ExpectError rename.parse("p.js"); rename.stringify(); // $ExpectError -rename.stringify("abcd.js"); // $ExpectError + +// This fails to produce an error on 2.4 +// rename.stringify("abcd.js"); // $ExpectError + rename.stringify({}); rename.stringify({ suffix: ".js" }); // $ExpectError rename.stringify({ extname: ".js" }); From 01a9dfd2f56c584942b8833733bb14fc62ae4379 Mon Sep 17 00:00:00 2001 From: m4m4m4 Date: Thu, 12 Apr 2018 19:07:10 +0200 Subject: [PATCH 0628/2153] [UI-Grid] Add missing definitions (#24835) * Add missing definitions Add missing optional parameters for addRowHeaderColumn Add id and fastWatch to IGridInstance Renamed 'viewport' to correct case 'viewPort' Change ColumnDef for Edit events to use IColumnDefOf instead (what the api returns). Should probably be done for other methods as well. * Missing parameters in description --- types/ui-grid/index.d.ts | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/types/ui-grid/index.d.ts b/types/ui-grid/index.d.ts index 683c906087..19fdb13752 100644 --- a/types/ui-grid/index.d.ts +++ b/types/ui-grid/index.d.ts @@ -135,8 +135,10 @@ declare namespace uiGrid { /** * adds a row header column to the grid * @param {IColumnDef} colDef The column definition + * @param {number} order Number that indicates where the column should be placed in the grid. + * @param {boolean} stopColumnBuild Prevents the buildColumn callback from being triggered. This is useful to improve performance of the grid during initial load. */ - addRowHeaderColumn(colDef: IColumnDefOf): void; + addRowHeaderColumn(colDef: IColumnDefOf, order?: number, stopColumnBuild?: boolean): void; /** * uses the first row of data to assign colDef.type for any types not defined. */ @@ -522,6 +524,8 @@ declare namespace uiGrid { * which tells us which direction we are scrolling. Set to NONE via debounced method */ scrollDirection?: number; + + id: number; } export interface IBuildColumnsOptions { orderByColumnDefs?: boolean; @@ -877,14 +881,18 @@ declare namespace uiGrid { * to generate one */ rowIdentity?(row: IGridRowOf): any; + + fastWatch?: boolean; } export interface IGridCoreApi { // Methods /** * adds a row header column to the grid * @param {IColumnDef} column Column Definition + * @param {number} order Number that indicates where the column should be placed in the grid. + * @param {boolean} stopColumnBuild Prevents the buildColumn callback from being triggered. This is useful to improve performance of the grid during initial load. */ - addRowHeaderColumn(column: IColumnDefOf): void; + addRowHeaderColumn(column: IColumnDefOf, order?: number, stopColumnBuild?: boolean): void; /** * add items to the grid menu. Used by features * to add their menu items if they are enabled, can also be used by @@ -1217,21 +1225,21 @@ declare namespace uiGrid { */ navigate: (scope: ng.IScope, handler: navigateHandler) => void; /** - * viewportKeyDown is raised when the viewPort receives a keyDown event. + * viewPortKeyDown is raised when the viewPort receives a keyDown event. * Cells never get focus in uiGrid due to the difficulties of setting focus on a cell that is * not visible in the viewport. Use this event whenever you need a keydown event on a cell. * @param {ng.IScope} scope The grid scope * @param {viewportKeyDownHandler} handler Callback */ - viewportKeyDown: (scope: ng.IScope, handler: viewportKeyDownHandler) => void; + viewPortKeyDown: (scope: ng.IScope, handler: viewportKeyDownHandler) => void; /** - * viewportKeyPress is raised when the viewPort receives a keyPress event. + * viewPortKeyPress is raised when the viewPort receives a keyPress event. * Cells never get focus in uiGrid due to the difficulties of setting focus on a cell that is * not visible in the viewport. Use this event whenever you need a keypress event on a cell. * @param {ng.IScope} scope The grid scope * @param {viewportKeyPressHandler} handler Callback */ - viewportKeyPress: (scope: ng.IScope, handler: viewportKeyPressHandler) => void; + viewPortKeyPress: (scope: ng.IScope, handler: viewportKeyPressHandler) => void; }; } @@ -1465,31 +1473,31 @@ declare namespace uiGrid { /** * raised when cell editing is complete * @param {TEntity} rowEntity the options.data element that was edited - * @param {IColumnDef} colDef The column that was edited + * @param {IColumnDefOf} colDef The column that was edited * @param {any} newValue New Value * @param {any} oldValue Old Value */ - (rowEntity: TEntity, colDef: IColumnDef, newValue: any, oldValue: any): void; + (rowEntity: TEntity, colDef: IColumnDefOf, newValue: any, oldValue: any): void; } /** * raised when cell editing starts on a cell * @param {TEntity} rowEntity the options.data element that was edited - * @param {IColumnDef} colDef The column that was edited + * @param {IColumnDefOf} colDef The column that was edited * @param {JQueryEventObject} triggerEvent the event that triggered the edit. Useful to prevent losing * keystrokes on some complex editors */ export interface beginCellEditHandler { - (rowEntity: TEntity, colDef: IColumnDef, triggerEvent: JQueryEventObject): void; + (rowEntity: TEntity, colDef: IColumnDefOf, triggerEvent: JQueryEventObject): void; } /** * raised when cell editing is cancelled on a cell * @param {TEntity} rowEntity the options.data element that was edited - * @param {IColumnDef} colDef The column that was edited + * @param {IColumnDefOf} colDef The column that was edited */ export interface cancelCellEditHandler { - (rowEntity: TEntity, colDef: IColumnDef): void; + (rowEntity: TEntity, colDef: IColumnDefOf): void; } /** From a5db46d19220e320b0b2bb64d74233670b9c4669 Mon Sep 17 00:00:00 2001 From: Aneil Mallavarapu Date: Thu, 12 Apr 2018 12:11:30 -0700 Subject: [PATCH 0629/2153] Add missing elements to Policy Statement (#24792) * Add: NotAction, NotResource, Principal, NotPrincipal * Implement some of the conditional logic - e.g., Action or NotAction is required - however, mutual exclusivity is not implemented (hard to do in Typescript) * Allow >1 statement per PolicyDocument --- types/aws-lambda/aws-lambda-tests.ts | 25 ++++++++++++++++++- types/aws-lambda/index.d.ts | 37 +++++++++++++++++++++++----- 2 files changed, 55 insertions(+), 7 deletions(-) diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index f4f97ccfc4..dc16eca58f 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -260,9 +260,27 @@ statement = { }; statement = { + Sid: str, Action: [str, str], Effect: str, - Resource: [str, str] + Resource: [str, str], + Condition: { + condition1: { key: "value" }, + condition2: [{ + key1: "value", + key2: "value" + }, { + key3: "value" + }] + }, + Principal: [str, str], + NotPrincipal: [str, str] +}; + +statement = { + Effect: str, + NotAction: str, + NotResource: str }; policyDocument = { @@ -270,6 +288,11 @@ policyDocument = { Statement: [statement] }; +policyDocument = { + Version: str, + Statement: [statement, statement] +}; + authResponse = { principalId: str, policyDocument, diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index bd108fa2a5..c060bc10ee 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -17,6 +17,7 @@ // Simon Buchan // David Hayden // Chris Redekop +// Aneil Mallavarapu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -438,28 +439,52 @@ export interface CustomAuthorizerResult { principalId: string; policyDocument: PolicyDocument; context?: AuthResponseContext; + usageIdentifierKey?: string; } export type AuthResponse = CustomAuthorizerResult; /** * API Gateway CustomAuthorizer AuthResponse.PolicyDocument. - * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output + * https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-output.html + * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html#Condition */ export interface PolicyDocument { Version: string; - Statement: [Statement]; + Id?: string; + Statement: Statement[]; +} + +/** + * API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Condition. + * https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-control-access-policy-language-overview.html + * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html + */ +export interface ConditionBlock { + [condition: string]: Condition | Condition[]; +} + +export interface Condition { + [key: string]: string | string[]; } /** * API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Statement. - * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output + * https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-control-access-policy-language-overview.html + * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html */ -export interface Statement { - Action: string | string[]; +export type Statement = BaseStatement & StatementAction & StatementResource; + +export interface BaseStatement { Effect: string; - Resource: string | string[]; + Sid?: string; + Condition?: ConditionBlock; + Principal?: string | string[]; + NotPrincipal?: string | string[]; } +export type StatementAction = { Action: string | string[] } | { NotAction: string | string[] }; +export type StatementResource = { Resource: string | string[] } | { NotResource: string | string[] }; + /** * API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Statement. * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output From c98aed3330f1597f587d1ec60cd2c31dcefc2032 Mon Sep 17 00:00:00 2001 From: Nathan Sankbeil Date: Thu, 12 Apr 2018 15:12:07 -0400 Subject: [PATCH 0630/2153] react-native-navigation: fix invalid orientation value (#24958) --- types/react-native-navigation/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native-navigation/index.d.ts b/types/react-native-navigation/index.d.ts index 96b21b01e2..5541f207c7 100644 --- a/types/react-native-navigation/index.d.ts +++ b/types/react-native-navigation/index.d.ts @@ -187,7 +187,7 @@ export interface NavigatorStyle { navBarSubtitleFontFamily?: string; navBarSubtitleFontSize?: number; screenBackgroundColor?: string; - orientation?: 'auto ' | 'landscape' | 'portrait'; + orientation?: 'auto' | 'landscape' | 'portrait'; disabledButtonColor?: string; // iOS only statusBarTextColorSchemeSingleScreen?: string; From a0ab3e1a8a8485f351e84146333966376366a93e Mon Sep 17 00:00:00 2001 From: alexander-wu Date: Thu, 12 Apr 2018 21:13:29 +0200 Subject: [PATCH 0631/2153] webpack-env require.ensure typing update (#24951) * webpack-env require.ensure typing update * webpack-env require.ensure typing fix --- types/webpack-env/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/webpack-env/index.d.ts b/types/webpack-env/index.d.ts index 1f03a25647..d9047f965e 100644 --- a/types/webpack-env/index.d.ts +++ b/types/webpack-env/index.d.ts @@ -31,7 +31,7 @@ declare namespace __WebpackModuleApi { * * This creates a chunk. The chunk can be named. If a chunk with this name already exists, the dependencies are merged into that chunk and that chunk is used. */ - ensure(paths: string[], callback: (require: NodeRequire) => void, chunkName?: string): void; + ensure(paths: string[], callback: (require: NodeRequire) => void, errorCallback?: (error: any) => void, chunkName?: string): void; context(path: string, deep?: boolean, filter?: RegExp): RequireContext; /** * Returns the module id of a dependency. The call is sync. No request to the server is fired. The compiler ensures that the dependency is available. From c93bda4d661c045cfa52ecb60825f3b97b2f4e24 Mon Sep 17 00:00:00 2001 From: Greg Zapp Date: Thu, 12 Apr 2018 15:25:59 -0500 Subject: [PATCH 0632/2153] Add remaining types and documentation. (#24960) --- types/tableau/index.d.ts | 543 ++++++++++++++++++++++++++++++--------- 1 file changed, 427 insertions(+), 116 deletions(-) diff --git a/types/tableau/index.d.ts b/types/tableau/index.d.ts index c8ade03046..f68790135e 100644 --- a/types/tableau/index.d.ts +++ b/types/tableau/index.d.ts @@ -5,92 +5,6 @@ // TypeScript Version: 2.4 declare namespace tableau { - interface VizCreateOptions { - /** Undoes action on sheet, defaults to a single undo unless optional parameters is specified. */ - hideTabs?: boolean; - /** Indicates whether the toolbar is hidden or shown. */ - hideToolbar?: boolean; - /** - * Specifies the ID of an existing instance to make a copy (clone) of. - * This is useful if the user wants to continue analysis of an existing visualization without losing the state of the original. - * If the ID does not refer to an existing visualization, the cloned version is derived from the original visualization. - */ - instanceIdToClone?: string; - /** Can be any valid CSS size specifier. If not specified, defaults to the published height of the view. */ - height?: string; - /** Can be any valid CSS size specifier. If not specified, defaults to the published height of the view. */ - width?: string; - /** - * Specifies a device layout for a dashboard, if it exists. - * Values can be desktop, tablet, or phone. - * If not specified, defaults to loading a layout based on the smallest dimension of the hosting iframe element. - */ - device?: string; - /** - * Callback function that is invoked when the Viz object first becomes interactive. - * This is only called once, but it’s guaranteed to be called. - * If the Viz object is already interactive, it will be called immediately, but on a separate "thread." - */ - onFirstInteractive?: (e: TableauEvent) => void; - /** - * Callback function that's invoked when the size of the Viz object is known. - * You can use this callback to perform tasks such as resizing the elements surrounding the Viz object once the object's size has been established. - */ - onFirstVizSizeKnown?: (e: VizResizeEvent) => void; - /** - * Apply a filter that you specify to the view when it is first rendered. - * For example, if you have an Academic Year filter and only want to display data for 2017, - * you might enter "Academic Year": "2016". For more information, see Filtering. - */ - [filter: string]: any; - } - - class TableauEvent { - /** Gets the Viz object associated with the event. */ - getViz(): Viz; - - /** Gets the name of the event, which is a string, but is also one of the items in the TableauEventName enum. */ - getEventName(): TableauEventName; - } - - class CustomViewEvent extends TableauEvent { - getCustomViewAsync(): Promise; - } - - class FilterEvent extends TableauEvent { - /** Gets the Worksheet object associated with the event. */ - getWorksheet(): Worksheet; - - /** Gets the name of the field. */ - getFieldName(): string; - - /** Gets the Filter object associated with the event. */ - getFilterAsync(): Promise; - } - - class VizResizeEvent extends TableauEvent { - /** Gets the Viz object associated with the event. */ - getViz(): Viz; - /** Gets the name of the event, which is a string, but is also one of the items in the TableauEventName enum. */ - getEventName(): TableauEventName; - /** Gets the sheetSize record for the current sheet. For more information, see SheetSizeOptions Record. */ - getVizSize(): Size; - } - - enum TableauEventName { - CUSTOM_VIEW_LOAD = 'customviewload', - CUSTOM_VIEW_REMOVE = 'customviewremove', - CUSTOM_VIEW_SAVE = 'customviewsave', - CUSTOM_VIEW_SET_DEFAULT = 'customviewsetdefault', - FILTER_CHANGE = 'filterchange', - MARKS_SELECTION = 'marksselection', - PARAMETER_VALUE_CHANGE = 'parametervaluechange', - STORY_POINT_SWITCH = 'storypointswitch', - TAB_SWITCH = 'tabswitch', - TOOLBAR_STATE_CHANGE = 'toolbarstatechange', - VIZ_RESIZE = 'vizresize', - } - enum DashboardObjectType { BLANK = 'blank', WORKSHEET = 'worksheet', @@ -151,28 +65,12 @@ declare namespace tableau { DIMENSION, MEASURE, UKNOWN } - enum FilterType { - CATEGORICAL = 'categorical', - QUANTITATIVE = 'quantitative', - HIERARCHICAL = 'hierarchical', - RELATIVE_DATE = 'relativedate', - } - enum SheetType { WORKSHEET = 'worksheet', DASHBOARD = 'dashboard', STORY = 'story', } - enum DateRangeType { - LAST = 'last', /** Refers to the last day, week, month, etc. of the date period. */ - LASTN = 'lastn', /** Refers to the last N days, weeks, months, etc. of the date period. */ - NEXT = 'next', /** Refers to the next day, week, month, etc. of the date period. */ - NEXTN = 'nextn', /** Refers to the next N days, weeks, months, etc. of the date period. */ - CURRENT = 'current', /** Refers to the current day, week, month, etc. of the date period. */ - TODATE = 'todate', /** Refers to everything up to and including the current day, week, month, etc. of the date period. */ - } - enum ParameterAllowableValuesType { ALL = 'all', LIST = 'list', @@ -188,23 +86,94 @@ declare namespace tableau { DATETIME = 'datetime' } - enum PeriodType { - YEARS = 'years', - QUARTERS = 'quarters', - MONTHS = 'months', - WEEKS = 'weeks', - DAYS = 'days', - HOURS = 'hours', - MINUTES = 'minutes', - SECONDS = 'seconds', + //#region Error Classes + class TableauException extends Error { + tableauSoftwareErrorCode: ErrorCode; } - //#region + enum ErrorCode { + /** The browser is not capable of supporting the Tableau JavaScript API. */ + BROWSER_NOT_CAPABLE = 'browserNotCapable', + /** The permissions on a workbook or a view do not allow downloading the workbook. */ + DOWNLOAD_WORKBOOK_NOT_ALLOWED = 'downloadWorkbookNotAllowed', + /** An error occurred while attempting to perform a filter operation. */ + FILTER_CANNOT_BE_PERFORMED = 'filterCannotBePerformed', + /** Attempted to switch to a sheet by index that does not exist in the workbook. */ + INDEX_OUT_OF_RANGE = 'indexOutOfRange', + /** An error occurred within the Tableau JavaScript API. Contact Tableau Support. */ + INTERNAL_ERROR = 'internalError', + /** An invalid aggregation was specified for the filter, such as setting a range filter to "SUM(Sales)" instead of "Sales". */ + INVALID_AGGREGATION_FIELD_NAME = 'invalidAggregationFieldName', + /** An operation was attempted on a custom view that does not exist. */ + INVALID_CUSTOM_VIEW_NAME = 'invalidCustomViewName', + /** An invalid date was specified in a method that required a date parameter. */ + INVALID_DATE_PARAMETER = 'invalidDateParameter', + /** A filter operation was attempted on a field that does not exist in the data source. */ + INVALID_FILTER_FIELDNAME = 'invalidFilterFieldName', + /** + * Either a filter operation was attempted on a field that does not exist in the data source, + * or the value supplied in the filter operation is the wrong data type or format. + */ + INVALID_FILTER_FIELDNAME_OR_VALUE = 'invalidFilterFieldNameOrValue', + /** A filter operation was attempted using a value that is the wrong data type or format. */ + INVALID_FILTER_FIELDVALUE = 'invalidFilterFieldValue', + /** A parameter is not the correct data type or format. The name of the parameter is specified in the Error.message field. */ + INVALID_PARAMETER = 'invalidParameter', + /** An invalid date value was specified in a Sheet.selectMarksAsync() call for a date field. */ + INVALID_SELECTION_DATE = 'invalidSelectionDate', + /** A field was specified in a Sheet.selectMarksAsync() call that does not exist in the data source. */ + INVALID_SELECTION_FIELDNAME = 'invalidSelectionFieldName', + /** An invalid value was specified in a Sheet.selectMarksAsync() call. */ + INVALID_SELECTION_VALUE = 'invalidSelectionValue', + /** A negative size was specified or the maxSize value is less than minSize in Sheet.changeSizeAsync(). */ + INVALID_SIZE = 'invalidSize', + /** + * A behavior other than SheetSizeBehavior.AUTOMATIC was specified in + * Sheet.changeSizeAsync() when the sheet is a Worksheet instance. + */ + INVALID_SIZE_BEHAVIOR_ON_WORKSHEET = 'invalidSizeBehaviorOnWorksheet', + /** The URL specified in the Viz class constructor is not valid. */ + INVALID_URL = 'invalidUrl', + /** The maxSize field is missing in Sheet.changeSizeAsync() when specifying SheetSizeBehavior.ATMOST. */ + MISSING_MAX_SIZE = 'missingMaxSize', + /** The minSize field is missing in Sheet.changeSizeAsync() when specifying SheetSizeBehavior.ATLEAST. */ + MISSING_MIN_SIZE = 'missingMinSize', + /** + * Either or both of the minSize or maxSize fields is missing in + * Sheet.changeSizeAsync() when specifying SheetSizeBehavior.RANGE. + */ + MISSING_MINMAX_SIZE = 'missingMinMaxSize', + /** The rangeN field is missing for a relative date filter of type LASTN or NEXTN. */ + MISSING_RANGEN_FOR_RELATIVE_DATE_FILTERS = 'missingRangeNForRelativeDateFilters', + /** An attempt was made to access Sheet.getUrl() on a hidden sheet. Hidden sheets do not have URLs. */ + NO_URL_FOR_HIDDEN_WORKSHEET = 'noUrlForHiddenWorksheet', + /** One or both of the parentElement or the URL parameters is not specified in the Viz constructor. */ + NO_URL_OR_PARENT_ELEMENT_NOT_FOUND = 'noUrlOrParentElementNotFound', + /** An operation was attempted on a sheet that is not active or embedded within the active dashboard. */ + NOT_ACTIVE_SHEET = 'notActiveSheet', + /** A required parameter was not specified, null, or an empty string/array. */ + NULL_OR_EMPTY_PARAMETER = 'nullOrEmptyParameter', + /** A general-purpose server error occurred. Details are contained in the Error object. */ + SERVER_ERROR = 'serverError', + /** An operation was attempted on a sheet that does not exist in the workbook. */ + SHEET_NOT_IN_WORKBOOK = 'sheetNotInWorkbook', + /** An operation is performed on a CustomView object that is no longer valid (it has been removed). */ + STALE_DATA_REFERENCE = 'staleDataReference', + /** An unknown event name was specified in the call to Viz.addEventListener or Viz.removeEventListener. */ + UNSUPPORTED_EVENT_NAME = 'unsupportedEventName', + /** A Viz object has already been created as a child of the parentElement specified in the Viz constructor. */ + VIZ_ALREADY_IN_MANAGER = 'vizAlreadyInManager', + INVALID_TOOLBAR_BUTTON_NAME = 'invalidToolbarButtonName', + MAX_VIZ_RESIZE_ATTEMPTS = 'maxVizResizeAttempts', + } + //#endregion + + //#region Viz Classes class VizManager { getVizs(): Viz[]; } - type ListenerFunction = (event: TableauEvent) => void; + type ListenerFunction = (event: T) => void; class Viz { /** @@ -230,11 +199,19 @@ declare namespace tableau { /** Indicates whether automatic updates are currently paused. */ getAreAutomaticUpdatesPaused(): boolean; - addEventListener(event: TableauEventName.FILTER_CHANGE, f: (event: FilterEvent) => void): void; - addEventListener(event: TableauEventName.CUSTOM_VIEW_LOAD, f: (event: CustomViewEvent) => void): void; + addEventListener(event: TableauEventName.FILTER_CHANGE, f: ListenerFunction): void; + addEventListener( + event: TableauEventName.CUSTOM_VIEW_LOAD | TableauEventName.CUSTOM_VIEW_REMOVE | TableauEventName.CUSTOM_VIEW_SAVE | TableauEventName.CUSTOM_VIEW_SET_DEFAULT, + f: ListenerFunction): void; + addEventListener(event: TableauEventName.MARKS_SELECTION, f: ListenerFunction): void; + addEventListener(event: TableauEventName.PARAMETER_VALUE_CHANGE, f: ListenerFunction): void; + addEventListener(event: TableauEventName.STORY_POINT_SWITCH, f: ListenerFunction): void; + addEventListener(event: TableauEventName.TAB_SWITCH, f: ListenerFunction): void; + addEventListener(event: TableauEventName.TOOLBAR_STATE_CHANGE, f: ListenerFunction): void; + addEventListener(event: TableauEventName.VIZ_RESIZE, f: ListenerFunction): void; /** Removes an event listener from the specified event. */ - removeEventListener(type: TableauEventName, f: ListenerFunction): void; + removeEventListener(type: TableauEventName, f: ListenerFunction): void; /** Shows or hides the iframe element hosting the visualization. */ show(): void; /** Shows or hides the iframe element hosting the visualization. */ @@ -284,6 +261,179 @@ declare namespace tableau { /** Undoes action on sheet, defaults to a single undo unless optional parameters is specified. */ undoAsync(): Promise; } + + interface VizCreateOptions { + /** Undoes action on sheet, defaults to a single undo unless optional parameters is specified. */ + hideTabs?: boolean; + /** Indicates whether the toolbar is hidden or shown. */ + hideToolbar?: boolean; + /** + * Specifies the ID of an existing instance to make a copy (clone) of. + * This is useful if the user wants to continue analysis of an existing visualization without losing the state of the original. + * If the ID does not refer to an existing visualization, the cloned version is derived from the original visualization. + */ + instanceIdToClone?: string; + /** Can be any valid CSS size specifier. If not specified, defaults to the published height of the view. */ + height?: string; + /** Can be any valid CSS size specifier. If not specified, defaults to the published height of the view. */ + width?: string; + /** + * Specifies a device layout for a dashboard, if it exists. + * Values can be desktop, tablet, or phone. + * If not specified, defaults to loading a layout based on the smallest dimension of the hosting iframe element. + */ + device?: string; + /** + * Callback function that is invoked when the Viz object first becomes interactive. + * This is only called once, but it’s guaranteed to be called. + * If the Viz object is already interactive, it will be called immediately, but on a separate "thread." + */ + onFirstInteractive?: (e: TableauEvent) => void; + /** + * Callback function that's invoked when the size of the Viz object is known. + * You can use this callback to perform tasks such as resizing the elements surrounding the Viz object once the object's size has been established. + */ + onFirstVizSizeKnown?: (e: VizResizeEvent) => void; + /** + * Apply a filter that you specify to the view when it is first rendered. + * For example, if you have an Academic Year filter and only want to display data for 2017, + * you might enter "Academic Year": "2016". For more information, see Filtering. + */ + [filter: string]: any; + } + + enum ToolbarPosition { + /** Positions the toolbar along the top of the visualization. */ + TOP = 'top', + /** Positions the toolbar along the bottom of the visualization. */ + BOTTOM = 'bottom', + } + + class ToolbarState { + /** Gets the Viz object associated with the toolbar. */ + getViz(): Viz; + /** + * Gets a value indicating whether the specified toolbar button is enabled. + * The supported buttons are defined in the ToobarButtonName enum. + * Currently, only Undo and Redo are supported. + * Checking this property with a toolbar button that is not supported causes an InvalidToolbarButtonName error. + */ + isButtonEnabled(toolbarButtonName: ToolbarButtonName): boolean; + } + + enum ToolbarButtonName { + /** Specifies the Undo button in the toolbar. */ + UNDO = 'undo', + /** Specifies the Redo button in the toolbar. */ + REDO = 'redo', + } + //#endregion + + //#region Viz Event Classes + /** + * Defines strings passed to the Viz.addEventListener and Viz.removeEventListener methods. + * The values of the enums are all lowercase strings with no underscores. + * For example, CUSTOM_VIEW_LOAD is customviewload. + * Either the fully-qualified enum (tableau.TableauEventName.FILTER_CHANGE) or the raw string (filterchange) is acceptable. + */ + enum TableauEventName { + /** + * Raised when a custom view has finished loading. + * This event is raised after the callback function for onFirstInteractive (if any) has been called. + */ + CUSTOM_VIEW_LOAD = 'customviewload', + /** Raised when the user removes a custom view. */ + CUSTOM_VIEW_REMOVE = 'customviewremove', + /** Raised when the user saves a new or existing custom view. */ + CUSTOM_VIEW_SAVE = 'customviewsave', + /** Raised when a custom view has been made the default view for this visualization. */ + CUSTOM_VIEW_SET_DEFAULT = 'customviewsetdefault', + /** Raised when any filter has changed state. The Viz object may not be interactive yet. */ + FILTER_CHANGE = 'filterchange', + /** Raised when marks are selected or deselected. */ + MARKS_SELECTION = 'marksselection', + /** Raised when any parameter has changed state. */ + PARAMETER_VALUE_CHANGE = 'parametervaluechange', + /** Raised after a story point becomes active. */ + STORY_POINT_SWITCH = 'storypointswitch', + /** Raised after the tab switched, but the Viz object may not yet be interactive. */ + TAB_SWITCH = 'tabswitch', + /** Raised when the state of the specified toolbar button changes. See API Reference. */ + TOOLBAR_STATE_CHANGE = 'toolbarstatechange', + /** Raised every time the frame size is calculated from the available size and the Viz object's published size. */ + VIZ_RESIZE = 'vizresize', + } + + class TableauEvent { + /** Gets the Viz object associated with the event. */ + getViz(): Viz; + + /** Gets the name of the event, which is a string, but is also one of the items in the TableauEventName enum. */ + getEventName(): TableauEventName; + } + + class CustomViewEvent extends TableauEvent { + /** Gets the CustomView object associated with the event. */ + getCustomViewAsync(): Promise; + } + + class FilterEvent extends TableauEvent { + /** Gets the Worksheet object associated with the event. */ + getWorksheet(): Worksheet; + + /** Gets the name of the field. */ + getFieldName(): string; + + /** Gets the Filter object associated with the event. */ + getFilterAsync(): Promise; + } + + class MarksEvent extends TableauEvent { + /** Gets the Worksheet object associated with the event. */ + getWorksheet(): Worksheet; + + /** Gets the selected marks on the Worksheet that triggered the event. */ + getMarksAsync(): Promise; + } + + class ParameterEvent extends TableauEvent { + /** Gets the name of the parameter that changed. */ + getParameterName(): string; + /** Gets the Parameter object that triggered the event. */ + getParameterAsync(): Promise; + } + + class StoryPointSwitchEvent extends TableauEvent { + /** + * Gets the StoryPointInfo that was active before the story point switch event occurred. + * The returned object reflects the state of the story point before the switch occurred. + * The returned object reflects the state of the story point after the switch occured. + */ + getOldStoryPointInfo(): StoryPointInfo; + /** Gets the StoryPoint that is currently active. */ + getNewStoryPoint(): StoryPoint; + } + + class TabSwitchEvent extends TableauEvent { + /** Gets the name of the sheet that was active before the tab switch event occurred. */ + getOldSheetName(): string; + /** Gets the name of the sheet that is currently active. */ + getNewSheetName(): string; + } + + class ToolbarStateEvent extends TableauEvent { + /** Returns the new ToolbarState. */ + getToolbarState(): ToolbarState; + } + + class VizResizeEvent extends TableauEvent { + /** Gets the Viz object associated with the event. */ + getViz(): Viz; + /** Gets the name of the event, which is a string, but is also one of the items in the TableauEventName enum. */ + getEventName(): TableauEventName; + /** Gets the sheetSize record for the current sheet. For more information, see SheetSizeOptions Record. */ + getVizSize(): Size; + } //#endregion //#region Sheet Classes @@ -407,6 +557,51 @@ declare namespace tableau { * You can specify options with an optional parameter. This can only be called on sheets of the WORKSHEET type. */ getUnderlyingDataAsync(options: getUnderlyingDataOptions): Promise; + /** Fetches the collection of filters used on the sheet. */ + getFiltersAsync(): Promise; + /** + * Applies a simple categorical filter (non-date). + * See the filtering examples for more details on these functions. + * Returns the fieldName that was filtered. + */ + applyFilterAsync(fieldName: string, values: object[] | object, updateType: FilterUpdateType, options?: FilterOptions): Promise; + /** + * Applies a quantitative filter to a field or to a date. + * If a range is specified that is outside of the domain min/max values, no error is raised and the command is allowed. + * Subsequent calls to getFiltersAsync[] will return these values even if they are outside of the bounds of the domain. + * This is equivalent to the behavior in Tableau Desktop. + */ + applyRangeFilterAsync(fieldName: string, range: RangeFilterOptions): Promise; + /** Applies a relative date filter. */ + applyRelativeDateFilterAsync(fieldName: string, options: RelativeDateFilterOptions): Promise; + /** + * Applies a hierarchical filter. + * The values parameter is either a single value, an array of values, or an object { levels: ["1", "2"] }. + */ + applyHierarchicalFilterAsync(fieldName: string, values: object, options: any): Promise; + /** + * Clears the filter, no matter what kind of filter it is. + * Note that the filter is removed as long as no associated quick filter is showing for the field. + * If there is a quick filter showing, then the filter is kept, but it’s reset to the “All” state (effectually canceling the filter). + * For relative date filters, however, an error is returned since there is no “All” state for a relative date filter. + * To clear a relative date filter with a quick filter showing, you can call applyRelativeDateFilter() + * instead using a range that makes sense for the specific field. + */ + clearFilterAsync(fieldName: string): Promise; + /** Clears the selection for this worksheet. */ + clearSelectedMarksAsync(): Promise; + /** Gets the collection of marks that are currently selected. */ + getSelectedMarksAsync(): Promise; + /** Selects the marks and returns them. */ + selectMarksAsync(fieldName: string, value: object | object[], updateType: SelectionUpdateType): Promise; + /** + * Allows selection based on this syntax for the first parameter: + * { + * "Field1": value, + * "Field2": [1, 2, 3] + * } + */ + selectMarksAsync(fieldValuesMap: object | Mark[], updateType: SelectionUpdateType): Promise; } interface getSummaryDataOptions { @@ -631,6 +826,35 @@ declare namespace tableau { //#endregion //#region Filtering + interface FilterOptions { + /** + * Determines whether the filter will apply in exclude mode or include mode. + * The default is include, which means that you use the fields as part of a filter. + * Exclude mode means that you include everything else except the specified fields. + */ + isExcludeMode: boolean; + } + + interface RangeFilterOptions { + /** Minimum value for the range (inclusive). Optional. Leave blank if you want a <= filter. */ + min: number | Date; + /** Maximum value for the range (inclusive). Optional. Leave blank if you want a >= filter. */ + max: number | Date; + /** The null values to include */ + nullOption: NullOption; + } + + interface RelativeDateFilterOptions { + /** The UTC date from which to filter. */ + anchorDate: Date; + /** Year, quarter, month, etc. */ + periodType: PeriodType; + /** LAST, LASTN, NEXT, etc. */ + rangeType: DateRangeType; + /** The number used when the rangeType is LASTN or NEXTN. */ + rangeN: number; + } + class Filter { /** Gets the parent worksheet */ getWorksheet(): Worksheet; @@ -642,6 +866,16 @@ declare namespace tableau { getFieldAsync(): Promise; } + /** An enumeration that indicates what to do with null values for a given filter or mark selection call. */ + enum NullOption { + /** Only include null values in the filter. */ + NULL_VALUES = 'nullValues', + /** Only include non-null values in the filter. */ + NON_NULL_VALUES = 'nonNullValues', + /** Include null and non-null values in the filter. */ + ALL_VALUES = 'allValues', + } + class CategoricalFilter extends Filter { /** Gets a value indicating whether the filter is exclude or include (default). */ getIsExcludeMode(): boolean; @@ -683,8 +917,84 @@ declare namespace tableau { /** The value formatted according to the locale and the formatting applied to the field or parameter. */ formattedValue: string; } + + enum FilterType { + /** Categorical filters are used to filter to a set of values within the domain. */ + CATEGORICAL = 'categorical', + /** Quantitative filters are used to filter to a range of values from a continuous domain. */ + QUANTITATIVE = 'quantitative', + /** Hierarchical filters are used to filter to a set of values organized into a hierarchy within the domain. */ + HIERARCHICAL = 'hierarchical', + /** Relative date filters are used to filter a date/time domain to a range of values relative to a fixed point in time. */ + RELATIVE_DATE = 'relativedate', + } + + enum FilterUpdateType { + /** Adds all values to the filter. Equivalent to checking the (All) value in a quick filter. */ + ALL = 'all', + /** Replaces the current filter values with new ones specified in the call */ + REPLACE = 'replace', + /** Adds the filter values as specified in the call to the current filter values. Equivalent to checking a value in a quick filter. */ + ADD = 'add', + /** Removes the filter values as specified in the call from the current filter values. Equivalent to unchecking a value in a quick filter. */ + REMOVE = 'remove', + } + + enum PeriodType { + YEARS = 'years', + QUARTERS = 'quarters', + MONTHS = 'months', + WEEKS = 'weeks', + DAYS = 'days', + HOURS = 'hours', + MINUTES = 'minutes', + SECONDS = 'seconds', + } + + enum DateRangeType { + LAST = 'last', /** Refers to the last day, week, month, etc. of the date period. */ + LASTN = 'lastn', /** Refers to the last N days, weeks, months, etc. of the date period. */ + NEXT = 'next', /** Refers to the next day, week, month, etc. of the date period. */ + NEXTN = 'nextn', /** Refers to the next N days, weeks, months, etc. of the date period. */ + CURRENT = 'current', /** Refers to the current day, week, month, etc. of the date period. */ + TODATE = 'todate', /** Refers to everything up to and including the current day, week, month, etc. of the date period. */ + } //#endregion + //#region Marks Selection + /** + * A mark represents a single data point on the visualization. + * It is independent of the type of visualization (bar, line, pie, etc.). + */ + class Mark { + /** Creates a new Mark with the specified pairs. */ + constructor(pairs: Pair[]); + /** Gets a collection of field name/value pairs associated with the mark. */ + getPairs(): Pair[]; + } + + class Pair { + /** The value formatted according to the locale and the formatting applied to the field. */ + formattedValue: string; + /** The field name to which the value is applied. */ + fieldName: string; + /** Contains the raw native value for the field as a JavaScript type, which is one of String, Number, Boolean, or Date. */ + value: string | number | boolean | Date; + /** Creates a new Pair with the specified field name/value pairing */ + constructor(fieldName: string, value: string | number | boolean | Date); + } + + enum SelectionUpdateType { + /** Replaces the current marks values with new ones specified in the call. */ + REPLACE = 'replace', + /** Adds the values as specified in the call to the current selection. Equivalent to control-clicking in desktop. */ + ADD = 'add', + /** Removes the values as specified in the call from the current selection. Equivalent to control-clicking an already selected mark in desktop. */ + REMOVE = 'remove', + } + //#endregion + + //#region Other interface Size { width: number; height: number; @@ -694,4 +1004,5 @@ declare namespace tableau { x: number; y: number; } + //#endregion } From 1fc00061a829e44e58e19a4001c754ef2b0ba1bc Mon Sep 17 00:00:00 2001 From: Scott Lively Date: Thu, 12 Apr 2018 16:23:21 -0700 Subject: [PATCH 0633/2153] [decompress] fix return value to be array instead of single instance (#24957) --- types/decompress/decompress-tests.ts | 6 +++--- types/decompress/index.d.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/decompress/decompress-tests.ts b/types/decompress/decompress-tests.ts index 3df7df0219..9cb8949d99 100644 --- a/types/decompress/decompress-tests.ts +++ b/types/decompress/decompress-tests.ts @@ -1,13 +1,13 @@ import decompress = require('decompress'); import * as path from "path"; -decompress('unicorn.zip', 'dist').then(files => { +decompress('unicorn.zip', 'dist').then((files: decompress.File[]) => { console.log('done!'); }); decompress('unicorn.zip', 'dist', { filter: file => path.extname(file.path) !== '.exe' -}).then(files => { +}).then((files: decompress.File[]) => { console.log('done!'); }); @@ -16,6 +16,6 @@ decompress('unicorn.zip', 'dist', { file.path = `unicorn-${file.path}`; return file; } -}).then(files => { +}).then((files: decompress.File[]) => { console.log('done!'); }); diff --git a/types/decompress/index.d.ts b/types/decompress/index.d.ts index a493f81a0d..745bebcd2e 100644 --- a/types/decompress/index.d.ts +++ b/types/decompress/index.d.ts @@ -7,7 +7,7 @@ export = decompress; -declare function decompress(input: string | Buffer, output: string, opts?: decompress.DecompressOptions): Promise; +declare function decompress(input: string | Buffer, output: string, opts?: decompress.DecompressOptions): Promise; declare namespace decompress { interface File { From 3b4991e3fa6e137833fd9b722abd6369842b236b Mon Sep 17 00:00:00 2001 From: Fredrik Nicol Date: Fri, 13 Apr 2018 08:44:22 +0200 Subject: [PATCH 0634/2153] [react] Add comment about removed index signature (#24939) --- types/react/index.d.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 50dca5578b..1083f4afe2 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -897,7 +897,16 @@ declare namespace React { onTransitionEndCapture?: TransitionEventHandler; } - export interface CSSProperties extends CSS.Properties {} + export interface CSSProperties extends CSS.Properties { + /** + * The index signature was removed to enable closed typing for style + * using CSSType. You're able to use type assertion or module augmentation + * to add properties or an index signature of your own. + * + * For examples and more information, visit: + * https://github.com/frenic/csstype#what-should-i-do-when-i-get-type-errors + */ + } interface HTMLAttributes extends DOMAttributes { // React-specific Attributes From 9968b18f5be1dca4711ffdab5b4872eb0fc0b890 Mon Sep 17 00:00:00 2001 From: Nico Montanari Date: Fri, 13 Apr 2018 11:02:52 +0200 Subject: [PATCH 0635/2153] Remove trailing spaces --- types/react-native/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index b8b13fa69a..288dfada20 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -3938,7 +3938,7 @@ export interface VirtualizedListProperties extends ScrollViewProperties { inverted?: boolean; keyExtractor?: (item: ItemT, index: number) => string; - + listKey?: string; /** From 54968ba726fc344b36d107d537be7b4c96e471bf Mon Sep 17 00:00:00 2001 From: Nikolay Yakimov Date: Fri, 13 Apr 2018 18:49:39 +0300 Subject: [PATCH 0636/2153] [atom] Updates to AC+ types (#24967) --- types/atom/autocomplete-plus/index.d.ts | 33 ++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/types/atom/autocomplete-plus/index.d.ts b/types/atom/autocomplete-plus/index.d.ts index 2e91a81262..8f23911540 100644 --- a/types/atom/autocomplete-plus/index.d.ts +++ b/types/atom/autocomplete-plus/index.d.ts @@ -30,11 +30,20 @@ export interface SuggestionInsertedEvent { suggestion: TextSuggestion|SnippetSuggestion; } +/** + * COMPATIBILITY STUB. WILL BE REMOVED + */ +// tslint:disable-next-line:no-empty-interface +export interface Suggestion< + T extends { text: string }|{ snippet: string } + > extends SuggestionBase {} +// TODO: Remove on next minor version + /** * An autocompletion suggestion for the user. * Primary data type for the Atom Autocomplete+ service. */ -export interface Suggestion { +export interface SuggestionBase { /** * A string that will show in the UI for this suggestion. * When not set, snippet || text is displayed. @@ -91,14 +100,20 @@ export interface Suggestion { * When specified, a More.. link will be displayed in the description area. */ descriptionMoreURL?: string; + + /** + * (experimental) Description with Markdown formatting. + * Takes precedence over plaintext description. + */ + descriptionMarkdown?: string; } -export interface TextSuggestion extends Suggestion { +export interface TextSuggestion extends SuggestionBase { /** The text which will be inserted into the editor, in place of the prefix. */ text: string; } -export interface SnippetSuggestion extends Suggestion { +export interface SnippetSuggestion extends SuggestionBase { /** * A snippet string. This will allow users to tab through function arguments * or other options. @@ -106,7 +121,8 @@ export interface SnippetSuggestion extends Suggestion { snippet: string; } -export type Suggestions = Array; +export type AnySuggestion = TextSuggestion|SnippetSuggestion; +export type Suggestions = AnySuggestion[]; /** The interface that all Autocomplete+ providers must implement. */ export interface AutocompleteProvider { @@ -154,4 +170,13 @@ export interface AutocompleteProvider { /** Will be called if your provider is being destroyed by autocomplete+ */ dispose?(): void; + + /** + * (experimental) Is called when a suggestion is selected by the user for + * the purpose of loading more information about the suggestion. Return a + * Promise of the new suggestion to replace it with or return null if + * no change is needed. + */ + getSuggestionDetailsOnSelect?: + (suggestion: AnySuggestion) => Promise | AnySuggestion | null; } From 3b587e9ce3f894e465bbf26c9f558686538841b6 Mon Sep 17 00:00:00 2001 From: Nikolay Yakimov Date: Fri, 13 Apr 2018 18:49:55 +0300 Subject: [PATCH 0637/2153] [atom] Clean up FilesystemChangeEvent (#24968) Add a type for a single FilesystemChange, have `oldPath` on rename events only. --- types/atom/atom-tests.ts | 2 +- types/atom/index.d.ts | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/types/atom/atom-tests.ts b/types/atom/atom-tests.ts index f21fab1114..5396338e9c 100644 --- a/types/atom/atom-tests.ts +++ b/types/atom/atom-tests.ts @@ -3310,7 +3310,7 @@ const pathWatcherPromise = Atom.watchPath("/var/test", {}, (events) => { for (const event of events) { str = event.path; str = event.action; - if (event.oldPath) str = event.oldPath; + if (event.action === "renamed") str = event.oldPath; } }); diff --git a/types/atom/index.d.ts b/types/atom/index.d.ts index e673ada530..e46ee9d0cf 100644 --- a/types/atom/index.d.ts +++ b/types/atom/index.d.ts @@ -5647,19 +5647,28 @@ export interface FileSavedEvent { path: string; } -export type FilesystemChangeEvent = Array<{ +export interface FilesystemChangeBasic< + Action extends "created"|"modified"|"deleted"|"renamed" + = "created"|"modified"|"deleted" +> { /** A string describing the filesystem action that occurred. */ - action: "created"|"modified"|"deleted"|"renamed"; + action: Action; /** The absolute path to the filesystem entry that was acted upon. */ path: string; +} +export interface FilesystemChangeRename extends FilesystemChangeBasic<"renamed"> { /** * For rename events, a string containing the filesystem entry's former * absolute path. */ - oldPath?: string; -}>; + oldPath: string; +} + +export type FilesystemChange = FilesystemChangeBasic|FilesystemChangeRename; + +export type FilesystemChangeEvent = FilesystemChange[]; export interface FullKeybindingMatchEvent { /** The string of keystrokes that matched the binding. */ From dcf3384ac2714c299a676cdc6dacabf1a47657c2 Mon Sep 17 00:00:00 2001 From: Alexander T Date: Fri, 13 Apr 2018 18:50:15 +0300 Subject: [PATCH 0638/2153] Microsoft/TypeScript#23155 - Type error in Buffer.from() (#24966) --- types/node/index.d.ts | 10 ++++------ types/node/node-tests.ts | 23 +++++++++++++---------- types/node/v4/index.d.ts | 9 +++------ types/node/v4/node-tests.ts | 23 +++++++++++++---------- types/node/v6/index.d.ts | 9 +++------ types/node/v6/node-tests.ts | 23 +++++++++++++---------- types/node/v7/index.d.ts | 9 +++------ types/node/v7/node-tests.ts | 33 ++++++++++++++++++--------------- types/node/v8/index.d.ts | 9 +++------ types/node/v8/node-tests.ts | 23 +++++++++++++---------- 10 files changed, 86 insertions(+), 85 deletions(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index ad70b302f9..d27e680aed 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -22,6 +22,7 @@ // Nicolas Even // Mohsen Azimi // Hoàng Văn Khải +// Alexander T. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** inspector module types */ @@ -218,10 +219,6 @@ declare var Buffer: { */ new(buffer: Buffer): Buffer; prototype: Buffer; - /** - * Allocates a new Buffer using an {array} of octets. - */ - from(array: any[]): Buffer; /** * When passed a reference to the .buffer property of a TypedArray instance, * the newly created Buffer will share the same allocated memory as the TypedArray. @@ -232,9 +229,10 @@ declare var Buffer: { */ from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; /** - * Copies the passed {buffer} data onto a new Buffer instance. + * Creates a new Buffer using the passed {data} + * @param data data to create a new Buffer */ - from(buffer: Buffer): Buffer; + from(data: any[] | string | Buffer | ArrayBuffer /*| TypedArray*/): Buffer; /** * Creates a new Buffer containing the given JavaScript string {str}. * If provided, the {encoding} parameter identifies the character encoding. diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index 72d0e6e0eb..776364a740 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -423,9 +423,19 @@ function bufferTests() { buf.swap64(); } - // Class Method: Buffer.from(array) + // Class Method: Buffer.from(data) { - const buf: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Array + const buf1: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Buffer + const buf2: Buffer = Buffer.from(buf1); + // String + const buf3: Buffer = Buffer.from('this is a tést'); + // ArrayBuffer + const arr: Uint16Array = new Uint16Array(2); + arr[0] = 5000; + arr[1] = 4000; + const buf4: Buffer = Buffer.from(arr.buffer); } // Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) @@ -435,22 +445,15 @@ function bufferTests() { arr[1] = 4000; let buf: Buffer; - buf = Buffer.from(arr.buffer); buf = Buffer.from(arr.buffer, 1); buf = Buffer.from(arr.buffer, 0, 1); } - // Class Method: Buffer.from(buffer) - { - const buf1: Buffer = Buffer.from('buffer'); - const buf2: Buffer = Buffer.from(buf1); - } - // Class Method: Buffer.from(str[, encoding]) { - const buf1: Buffer = Buffer.from('this is a tést'); const buf2: Buffer = Buffer.from('7468697320697320612074c3a97374', 'hex'); } + // Class Method: Buffer.alloc(size[, fill[, encoding]]) { const buf1: Buffer = Buffer.alloc(5); diff --git a/types/node/v4/index.d.ts b/types/node/v4/index.d.ts index ada62b683e..4793b4e9f7 100644 --- a/types/node/v4/index.d.ts +++ b/types/node/v4/index.d.ts @@ -164,10 +164,6 @@ declare var Buffer: { */ new (buffer: Buffer): Buffer; prototype: Buffer; - /** - * Allocates a new Buffer using an {array} of octets. - */ - from(array: any[]): Buffer; /** * When passed a reference to the .buffer property of a TypedArray instance, * the newly created Buffer will share the same allocated memory as the TypedArray. @@ -178,9 +174,10 @@ declare var Buffer: { */ from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?:number): Buffer; /** - * Copies the passed {buffer} data onto a new Buffer instance. + * Creates a new Buffer using the passed {data} + * @param data data to create a new Buffer */ - from(buffer: Buffer): Buffer; + from(data: any[] | string | Buffer | ArrayBuffer /*| TypedArray*/): Buffer; /** * Creates a new Buffer containing the given JavaScript string {str}. * If provided, the {encoding} parameter identifies the character encoding. diff --git a/types/node/v4/node-tests.ts b/types/node/v4/node-tests.ts index 2b3be03f8d..6409e83e18 100644 --- a/types/node/v4/node-tests.ts +++ b/types/node/v4/node-tests.ts @@ -240,9 +240,19 @@ function bufferTests() { var result1 = Buffer.concat([utf8Buffer, base64Buffer]); var result2 = Buffer.concat([utf8Buffer, base64Buffer], 9999999); - // Class Method: Buffer.from(array) + // Class Method: Buffer.from(data) { - const buf: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Array + const buf1: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Buffer + const buf2: Buffer = Buffer.from(buf1); + // String + const buf3: Buffer = Buffer.from('this is a tést'); + // ArrayBuffer + const arr: Uint16Array = new Uint16Array(2); + arr[0] = 5000; + arr[1] = 4000; + const buf4: Buffer = Buffer.from(arr.buffer); } // Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) @@ -252,22 +262,15 @@ function bufferTests() { arr[1] = 4000; let buf: Buffer; - buf = Buffer.from(arr.buffer); buf = Buffer.from(arr.buffer, 1); buf = Buffer.from(arr.buffer, 0, 1); } - // Class Method: Buffer.from(buffer) - { - const buf1: Buffer = Buffer.from('buffer'); - const buf2: Buffer = Buffer.from(buf1); - } - // Class Method: Buffer.from(str[, encoding]) { - const buf1: Buffer = Buffer.from('this is a tést'); const buf2: Buffer = Buffer.from('7468697320697320612074c3a97374', 'hex'); } + // Class Method: Buffer.alloc(size[, fill[, encoding]]) { const buf1: Buffer = Buffer.alloc(5); diff --git a/types/node/v6/index.d.ts b/types/node/v6/index.d.ts index ed9949a9ac..8cde8ee611 100644 --- a/types/node/v6/index.d.ts +++ b/types/node/v6/index.d.ts @@ -164,10 +164,6 @@ declare var Buffer: { */ new (buffer: Buffer): Buffer; prototype: Buffer; - /** - * Allocates a new Buffer using an {array} of octets. - */ - from(array: any[]): Buffer; /** * When passed a reference to the .buffer property of a TypedArray instance, * the newly created Buffer will share the same allocated memory as the TypedArray. @@ -178,9 +174,10 @@ declare var Buffer: { */ from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; /** - * Copies the passed {buffer} data onto a new Buffer instance. + * Creates a new Buffer using the passed {data} + * @param data data to create a new Buffer */ - from(buffer: Buffer): Buffer; + from(data: any[] | string | Buffer | ArrayBuffer /*| TypedArray*/): Buffer; /** * Creates a new Buffer containing the given JavaScript string {str}. * If provided, the {encoding} parameter identifies the character encoding. diff --git a/types/node/v6/node-tests.ts b/types/node/v6/node-tests.ts index 6cfb45692b..f9d5a9cd62 100644 --- a/types/node/v6/node-tests.ts +++ b/types/node/v6/node-tests.ts @@ -321,9 +321,19 @@ function bufferTests() { buf.swap64(); } - // Class Method: Buffer.from(array) + // Class Method: Buffer.from(data) { - const buf: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Array + const buf1: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Buffer + const buf2: Buffer = Buffer.from(buf1); + // String + const buf3: Buffer = Buffer.from('this is a tést'); + // ArrayBuffer + const arr: Uint16Array = new Uint16Array(2); + arr[0] = 5000; + arr[1] = 4000; + const buf4: Buffer = Buffer.from(arr.buffer); } // Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) @@ -333,22 +343,15 @@ function bufferTests() { arr[1] = 4000; let buf: Buffer; - buf = Buffer.from(arr.buffer); buf = Buffer.from(arr.buffer, 1); buf = Buffer.from(arr.buffer, 0, 1); } - // Class Method: Buffer.from(buffer) - { - const buf1: Buffer = Buffer.from('buffer'); - const buf2: Buffer = Buffer.from(buf1); - } - // Class Method: Buffer.from(str[, encoding]) { - const buf1: Buffer = Buffer.from('this is a tést'); const buf2: Buffer = Buffer.from('7468697320697320612074c3a97374', 'hex'); } + // Class Method: Buffer.alloc(size[, fill[, encoding]]) { const buf1: Buffer = Buffer.alloc(5); diff --git a/types/node/v7/index.d.ts b/types/node/v7/index.d.ts index 950e143536..e8290f204c 100644 --- a/types/node/v7/index.d.ts +++ b/types/node/v7/index.d.ts @@ -175,10 +175,6 @@ declare var Buffer: { */ new (buffer: Buffer): Buffer; prototype: Buffer; - /** - * Allocates a new Buffer using an {array} of octets. - */ - from(array: any[]): Buffer; /** * When passed a reference to the .buffer property of a TypedArray instance, * the newly created Buffer will share the same allocated memory as the TypedArray. @@ -189,9 +185,10 @@ declare var Buffer: { */ from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; /** - * Copies the passed {buffer} data onto a new Buffer instance. + * Creates a new Buffer using the passed {data} + * @param data data to create a new Buffer */ - from(buffer: Buffer): Buffer; + from(data: any[] | string | Buffer | ArrayBuffer /*| TypedArray*/): Buffer; /** * Creates a new Buffer containing the given JavaScript string {str}. * If provided, the {encoding} parameter identifies the character encoding. diff --git a/types/node/v7/node-tests.ts b/types/node/v7/node-tests.ts index cc46b1f8e4..0ea05066b4 100644 --- a/types/node/v7/node-tests.ts +++ b/types/node/v7/node-tests.ts @@ -303,9 +303,19 @@ function bufferTests() { buf.swap64(); } - // Class Method: Buffer.from(array) + // Class Method: Buffer.from(data) { - const buf: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Array + const buf1: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Buffer + const buf2: Buffer = Buffer.from(buf1); + // String + const buf3: Buffer = Buffer.from('this is a tést'); + // ArrayBuffer + const arr: Uint16Array = new Uint16Array(2); + arr[0] = 5000; + arr[1] = 4000; + const buf4: Buffer = Buffer.from(arr.buffer); } // Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) @@ -315,10 +325,15 @@ function bufferTests() { arr[1] = 4000; let buf: Buffer; - buf = Buffer.from(arr.buffer); buf = Buffer.from(arr.buffer, 1); buf = Buffer.from(arr.buffer, 0, 1); } + + // Class Method: Buffer.from(str[, encoding]) + { + const buf2: Buffer = Buffer.from('7468697320697320612074c3a97374', 'hex'); + } + // Class Method: Buffer.alloc(size[, fill[, encoding]]) { const buf1: Buffer = Buffer.alloc(5); @@ -334,18 +349,6 @@ function bufferTests() { const buf: Buffer = Buffer.allocUnsafeSlow(10); } - // Class Method: Buffer.from(buffer) - { - const buf1: Buffer = Buffer.from('buffer'); - const buf2: Buffer = Buffer.from(buf1); - } - - // Class Method: Buffer.from(str[, encoding]) - { - const buf1: Buffer = Buffer.from('this is a tést'); - const buf2: Buffer = Buffer.from('7468697320697320612074c3a97374', 'hex'); - } - // Test that TS 1.6 works with the 'as Buffer' annotation // on isBuffer. var a: Buffer | number; diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index b11601895e..642a957eca 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -217,10 +217,6 @@ declare var Buffer: { */ new(buffer: Buffer): Buffer; prototype: Buffer; - /** - * Allocates a new Buffer using an {array} of octets. - */ - from(array: any[]): Buffer; /** * When passed a reference to the .buffer property of a TypedArray instance, * the newly created Buffer will share the same allocated memory as the TypedArray. @@ -231,9 +227,10 @@ declare var Buffer: { */ from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; /** - * Copies the passed {buffer} data onto a new Buffer instance. + * Creates a new Buffer using the passed {data} + * @param data data to create a new Buffer */ - from(buffer: Buffer): Buffer; + from(data: any[] | string | Buffer | ArrayBuffer /*| TypedArray*/): Buffer; /** * Creates a new Buffer containing the given JavaScript string {str}. * If provided, the {encoding} parameter identifies the character encoding. diff --git a/types/node/v8/node-tests.ts b/types/node/v8/node-tests.ts index 0013486263..2546184d0a 100644 --- a/types/node/v8/node-tests.ts +++ b/types/node/v8/node-tests.ts @@ -397,9 +397,19 @@ function bufferTests() { buf.swap64(); } - // Class Method: Buffer.from(array) + // Class Method: Buffer.from(data) { - const buf: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Array + const buf1: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Buffer + const buf2: Buffer = Buffer.from(buf1); + // String + const buf3: Buffer = Buffer.from('this is a tést'); + // ArrayBuffer + const arr: Uint16Array = new Uint16Array(2); + arr[0] = 5000; + arr[1] = 4000; + const buf4: Buffer = Buffer.from(arr.buffer); } // Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) @@ -409,22 +419,15 @@ function bufferTests() { arr[1] = 4000; let buf: Buffer; - buf = Buffer.from(arr.buffer); buf = Buffer.from(arr.buffer, 1); buf = Buffer.from(arr.buffer, 0, 1); } - // Class Method: Buffer.from(buffer) - { - const buf1: Buffer = Buffer.from('buffer'); - const buf2: Buffer = Buffer.from(buf1); - } - // Class Method: Buffer.from(str[, encoding]) { - const buf1: Buffer = Buffer.from('this is a tést'); const buf2: Buffer = Buffer.from('7468697320697320612074c3a97374', 'hex'); } + // Class Method: Buffer.alloc(size[, fill[, encoding]]) { const buf1: Buffer = Buffer.alloc(5); From ed66591fa0f71bdbdd14ffe6b255516419e32a3c Mon Sep 17 00:00:00 2001 From: Janeene Beeforth Date: Sat, 14 Apr 2018 01:50:29 +1000 Subject: [PATCH 0639/2153] [expo]: Add missing SvgCommonProps (#24965) * fillRule * rotation (both 'rotate' and 'rotation' are currently supported, but documentation specifies 'rotation' as the current version to use. --- types/expo/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 2cde351dbe..8e35cb8631 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -1873,6 +1873,7 @@ export namespace SQLite { export interface SvgCommonProps { fill?: string; fillOpacity?: number | string; + fillRule?: 'nonzero' | 'evenodd'; stroke?: string; strokeWidth?: number | string; strokeOpacity?: number | string; @@ -1883,6 +1884,7 @@ export interface SvgCommonProps { x?: number | string; y?: number | string; rotate?: number | string; + rotation?: number | string; scale?: number | string; origin?: number | string; originX?: number | string; From 55032550650462420c98401e182fa75d17095a77 Mon Sep 17 00:00:00 2001 From: sunnyone Date: Sat, 14 Apr 2018 00:53:57 +0900 Subject: [PATCH 0640/2153] Add onHide to IDialogDefinition (#24964) --- types/ckeditor/ckeditor-tests.ts | 6 +++++- types/ckeditor/index.d.ts | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/ckeditor/ckeditor-tests.ts b/types/ckeditor/ckeditor-tests.ts index 515996e90a..03f8a1ab3e 100644 --- a/types/ckeditor/ckeditor-tests.ts +++ b/types/ckeditor/ckeditor-tests.ts @@ -323,7 +323,11 @@ function test_adding_dialog_by_definition() { title: 'Abbreviation Properties', minWidth: 400, minHeight: 200, - + onLoad: () => {}, + onOk: () => {}, + onCancel: () => {}, + onShow: () => {}, + onHide: () => {}, contents: [ { id: 'tab-basic', diff --git a/types/ckeditor/index.d.ts b/types/ckeditor/index.d.ts index 49ffce2fd9..e26abd16b4 100644 --- a/types/ckeditor/index.d.ts +++ b/types/ckeditor/index.d.ts @@ -1735,6 +1735,7 @@ declare namespace CKEDITOR { onLoad?: Function; onOk?: Function; onShow?: Function; + onHide?: Function; resizable?: number; title?: string; width?: number; From 5302148a4506d5e324dd9c3822a33f54372cadbc Mon Sep 17 00:00:00 2001 From: Sander de Waal Date: Fri, 13 Apr 2018 18:23:13 +0200 Subject: [PATCH 0641/2153] Add HavingIn method to Knex typings (#24974) --- types/knex/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/knex/index.d.ts b/types/knex/index.d.ts index 1d405f54b0..9c07f69f9b 100644 --- a/types/knex/index.d.ts +++ b/types/knex/index.d.ts @@ -125,6 +125,7 @@ declare namespace Knex { havingRaw: RawQueryBuilder; orHaving: Having; orHavingRaw: RawQueryBuilder; + havingIn: HavingIn; // Clear clearSelect(): QueryBuilder; @@ -324,6 +325,10 @@ declare namespace Knex { (tableName: string, column1: string, operator: string, column2: string): QueryBuilder; } + interface HavingIn { + (columnName: string, values: Value[]): QueryBuilder; + } + // commons interface ColumnNameQueryBuilder { From 40a24d875a15e1684fc80ca9c5b7942931ee2854 Mon Sep 17 00:00:00 2001 From: drschulz Date: Fri, 13 Apr 2018 10:20:40 -0700 Subject: [PATCH 0642/2153] Fixed Overlay class definition (#24978) The Overlay class definition is currently broken for Typescript 2.8.1 because OverlayProps has recently been moved into the Overlay namespace. This updates the class definition to reflect that. --- types/react-overlays/lib/Overlay.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-overlays/lib/Overlay.d.ts b/types/react-overlays/lib/Overlay.d.ts index 473f391a74..3b6cd22be9 100644 --- a/types/react-overlays/lib/Overlay.d.ts +++ b/types/react-overlays/lib/Overlay.d.ts @@ -4,7 +4,7 @@ import { TransitionProps } from 'react-transition-group/Transition'; import { PortalProps } from './Portal'; import { PositionProps } from './Position'; -declare class Overlay extends React.Component { } +declare class Overlay extends React.Component { } export = Overlay; declare namespace Overlay { From 1a8b08d6d9f2546279bf079f2cf9a3f9605f4799 Mon Sep 17 00:00:00 2001 From: Cheng Wang Date: Sat, 14 Apr 2018 01:21:31 +0800 Subject: [PATCH 0643/2153] add subscribe-ui-event (#24976) --- types/subscribe-ui-event/index.d.ts | 99 +++++++++++++++++++ .../subscribe-ui-event-tests.ts | 24 +++++ types/subscribe-ui-event/tsconfig.json | 16 +++ types/subscribe-ui-event/tslint.json | 1 + 4 files changed, 140 insertions(+) create mode 100644 types/subscribe-ui-event/index.d.ts create mode 100644 types/subscribe-ui-event/subscribe-ui-event-tests.ts create mode 100644 types/subscribe-ui-event/tsconfig.json create mode 100644 types/subscribe-ui-event/tslint.json diff --git a/types/subscribe-ui-event/index.d.ts b/types/subscribe-ui-event/index.d.ts new file mode 100644 index 0000000000..12fca5af91 --- /dev/null +++ b/types/subscribe-ui-event/index.d.ts @@ -0,0 +1,99 @@ +// Type definitions for subscribe-ui-event 1.1 +// Project: https://github.com/yahoo/subscribe-ui-event#readme +// Definitions by: Cheng Wang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/subscribe-ui-event +// TypeScript Version: 2.3 + +export type UIEventType = + | 'resize' + | 'resizeEnd' + | 'resizeStart' + | 'scroll' + | 'scrollEnd' + | 'scrollStart' + | 'visibilitychange'; + +export type TouchEventType = + | 'touchend' + | 'touchmove' + | 'touchmoveEnd' + | 'touchmoveStart' + | 'touchstart'; + +export type EventType = UIEventType | TouchEventType; + +export interface SubscribeOptions { + context?: any; + enableResizeInfo?: boolean; + enableScrollInfo?: boolean; + enableTouchInfo?: boolean; + eventOptions?: AddEventListenerOptions; + throttleRate?: number; + useRAF?: boolean; +} + +export interface ArgmentedEvent { + mainType: string; + resize: { + height: number; + width: number; + }; + scroll: { + delta: number; + top: number; + }; + subType: string; + type: T; + touch: { + axisIntention: 'x' | 'y' | ''; + deltaX: number; + deltaY: number; + startX: number; + startY: number; + }; +} + +export type UIEventCallback = ( + event: UIEvent, + payload: ArgmentedEvent +) => any; + +export type TouchEventCallback = ( + event: TouchEvent, + payload: ArgmentedEvent +) => any; + +export interface Subscrption { + unsubscribe: () => void; +} + +export function subscribe( + eventType: T, + callback: UIEventCallback, + options?: SubscribeOptions +): Subscrption; + +export function subscribe( + eventType: T, + callback: TouchEventCallback, + options?: SubscribeOptions +): Subscrption; + +export function unsubscribe( + eventType: T, + callback: UIEventCallback +): void; + +export function unsubscribe( + eventType: T, + callback: TouchEventCallback +): void; + +export function listen( + target: EventTarget, + eventType: string, + handler: EventListenerOrEventListenerObject, + options?: AddEventListenerOptions +): { + remove: () => void; +}; diff --git a/types/subscribe-ui-event/subscribe-ui-event-tests.ts b/types/subscribe-ui-event/subscribe-ui-event-tests.ts new file mode 100644 index 0000000000..f199d00335 --- /dev/null +++ b/types/subscribe-ui-event/subscribe-ui-event-tests.ts @@ -0,0 +1,24 @@ +import { + subscribe, + unsubscribe, + listen, + UIEventCallback, +} from 'subscribe-ui-event'; + +const callback: UIEventCallback = (event, paylaod) => { + const target = event.target; + console.log(paylaod); +}; + +const subscription = subscribe('resize', callback); + +unsubscribe('touchend', (event, paylaod) => { + const target = event.currentTarget; + console.log(paylaod.type); +}); + +subscription.unsubscribe(); + +const {remove} = listen(document, 'onclick', console.log); + +remove(); diff --git a/types/subscribe-ui-event/tsconfig.json b/types/subscribe-ui-event/tsconfig.json new file mode 100644 index 0000000000..a931986600 --- /dev/null +++ b/types/subscribe-ui-event/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "subscribe-ui-event-tests.ts"] +} diff --git a/types/subscribe-ui-event/tslint.json b/types/subscribe-ui-event/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/subscribe-ui-event/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 5e03bfd6b09877639e58e70704bb6b96a32ea2bb Mon Sep 17 00:00:00 2001 From: Kajan Nallathamby Date: Fri, 13 Apr 2018 13:22:22 -0400 Subject: [PATCH 0644/2153] fixes chai-things import issues (#24975) --- types/chai-things/chai-things-tests.ts | 5 ++--- types/chai-things/index.d.ts | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/chai-things/chai-things-tests.ts b/types/chai-things/chai-things-tests.ts index ecb7294dd2..b3549ab192 100644 --- a/types/chai-things/chai-things-tests.ts +++ b/types/chai-things/chai-things-tests.ts @@ -1,8 +1,7 @@ -import chai = require('chai'); -import chaiThings = require('chai-things'); - +import * as chai from 'chai'; +import * as chaiThings from 'chai-things'; chai.use(chaiThings); function test_somethingSyntax() { diff --git a/types/chai-things/index.d.ts b/types/chai-things/index.d.ts index 11ad20ede3..e0b3d0f0ec 100644 --- a/types/chai-things/index.d.ts +++ b/types/chai-things/index.d.ts @@ -60,5 +60,6 @@ interface Array { declare module "chai-things" { function chaiThings(chai: any, utils: any): void; + namespace chaiThings { } export = chaiThings; } From 20a3d80183769d978caef94f55599392843ef72c Mon Sep 17 00:00:00 2001 From: Ika Date: Sat, 14 Apr 2018 01:23:00 +0800 Subject: [PATCH 0645/2153] feat(prettier): update to v1.12 (#24973) --- types/prettier/index.d.ts | 225 ++++++++++++++++++++++++++++++++------ 1 file changed, 191 insertions(+), 34 deletions(-) diff --git a/types/prettier/index.d.ts b/types/prettier/index.d.ts index b323a0979b..e2fc00be38 100644 --- a/types/prettier/index.d.ts +++ b/types/prettier/index.d.ts @@ -1,12 +1,22 @@ -// Type definitions for prettier 1.10 +// Type definitions for prettier 1.12 // Project: https://github.com/prettier/prettier // Definitions by: Ika // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 export type AST = any; -export type Doc = any; // https://github.com/prettier/prettier/blob/master/commands.md -export type FastPath = any; // https://github.com/prettier/prettier/blob/master/src/common/fast-path.js +export type Doc = doc.builders.Doc; + +// https://github.com/prettier/prettier/blob/master/src/common/fast-path.js +export interface FastPath { + getName(): string | null; + getValue(): any; + getNode(count?: number): any; + getParentNode(count?: number): any; + call(callback: (path: this) => T, ...names: string[]): T; + each(callback: (path: this) => void, ...names: string[]): void; + map(callback: (path: this, index: number) => T, ...names: string[]): T[]; +} export type BuiltInParser = (text: string, options?: any) => AST; export type BuiltInParserName = @@ -24,72 +34,61 @@ export type BuiltInParserName = export type CustomParser = (text: string, parsers: Record, options: Options) => AST; -export interface Options { - /** - * Specify the line length that the printer will wrap on. - */ - printWidth?: number; - /** - * Specify the number of spaces per indentation-level. - */ - tabWidth?: number; - /** - * Indent lines with tabs instead of spaces - */ - useTabs?: boolean; +export interface Options extends Partial {} +export interface RequiredOptions extends doc.printer.Options { /** * Print semicolons at the ends of statements. */ - semi?: boolean; + semi: boolean; /** * Use single quotes instead of double quotes. */ - singleQuote?: boolean; + singleQuote: boolean; /** * Print trailing commas wherever possible. */ - trailingComma?: 'none' | 'es5' | 'all'; + trailingComma: 'none' | 'es5' | 'all'; /** * Print spaces between brackets in object literals. */ - bracketSpacing?: boolean; + bracketSpacing: boolean; /** * Put the `>` of a multi-line JSX element at the end of the last line instead of being alone on the next line. */ - jsxBracketSameLine?: boolean; + jsxBracketSameLine: boolean; /** * Format only a segment of a file. */ - rangeStart?: number; + rangeStart: number; /** * Format only a segment of a file. */ - rangeEnd?: number; + rangeEnd: number; /** * Specify which parser to use. */ - parser?: BuiltInParserName | CustomParser; + parser: BuiltInParserName | CustomParser; /** * Specify the input filepath. This will be used to do parser inference. */ - filepath?: string; + filepath: string; /** * Prettier can restrict itself to only format files that contain a special comment, called a pragma, at the top of the file. * This is very useful when gradually transitioning large, unformatted codebases to prettier. */ - requirePragma?: boolean; + requirePragma: boolean; /** * Prettier can insert a special @format marker at the top of files specifying that * the file has been formatted with prettier. This works well when used in tandem with * the --require-pragma option. If there is already a docblock at the top of * the file then this option will add a newline to it with the @format marker. */ - insertPragma?: boolean; + insertPragma: boolean; /** * By default, Prettier will wrap markdown text as-is since some services use a linebreak-sensitive renderer. * In some cases you may want to rely on editor/viewer soft wrapping instead, so this option allows you to opt out. */ - proseWrap?: + proseWrap: | boolean // deprecated | 'always' | 'never' @@ -97,11 +96,16 @@ export interface Options { /** * Include parentheses around a sole arrow function parameter. */ - arrowParens?: 'avoid' | 'always'; + arrowParens: 'avoid' | 'always'; /** * The plugin API is in a beta state. */ - plugins?: Array; + plugins: Array; +} + +export interface ParserOptions extends RequiredOptions { + locStart: (node: any) => number; + locEnd: (node: any) => number; } export interface Plugin { @@ -111,22 +115,41 @@ export interface Plugin { } export interface Parser { - parse: (text: string, parsers: { [parserName: string]: Parser }, options: object) => AST; + parse: (text: string, parsers: { [parserName: string]: Parser }, options: ParserOptions) => AST; astFormat: string; + hasPragma?: (text: string) => boolean; + locStart: (node: any) => number; + locEnd: (node: any) => number; } export interface Printer { print( path: FastPath, - options: object, + options: ParserOptions, print: (path: FastPath) => Doc, ): Doc; embed( path: FastPath, print: (path: FastPath) => Doc, - textToDoc: (text: string, options: object) => Doc, - options: object, + textToDoc: (text: string, options: Options) => Doc, + options: ParserOptions, ): Doc | null; + insertPragma?: (text: string) => string; + /** + * @returns `null` if you want to remove this node + * @returns `void` if you want to use modified newNode + * @returns anything if you want to replace the node with it + */ + massageAstNode?: (node: any, newNode: any, parent: any) => any; + hasPrettierIgnore?: (path: FastPath) => boolean; + canAttachComment?: (node: any) => boolean; + willPrintOwnComments?: (path: FastPath) => boolean; + printComments?: (path: FastPath, print: (path: FastPath) => Doc, options: ParserOptions, needsSemi: boolean) => Doc; + handleComments?: { + ownLine?: (commentNode: any, text: string, options: ParserOptions, ast: any, isLastComment: boolean) => boolean; + endOfLine?: (commentNode: any, text: string, options: ParserOptions, ast: any, isLastComment: boolean) => boolean; + remaining?: (commentNode: any, text: string, options: ParserOptions, ast: any, isLastComment: boolean) => boolean; + }; } export interface CursorOptions extends Options { @@ -226,6 +249,7 @@ export interface SupportLanguage { export interface SupportOption { since: string; type: 'int' | 'boolean' | 'choice' | 'path'; + array?: boolean; deprecated?: string; redirect?: SupportOptionRedirect; description: string; @@ -272,3 +296,136 @@ export function getSupportInfo(version?: string): SupportInfo; * `version` field in `package.json` */ export const version: string; + +// https://github.com/prettier/prettier/blob/master/src/common/util-shared.js +export namespace util { + function isNextLineEmpty(text: string, node: any, options: ParserOptions): boolean; + function isNextLineEmptyAfterIndex(text: string, index: number): boolean; + function getNextNonSpaceNonCommentCharacterIndex(text: string, node: any, options: ParserOptions): number; + function makeString(rawContent: string, enclosingQuote: "'" | '"', unescapeUnnecessaryEscapes: boolean): string; + function addLeadingComment(node: any, commentNode: any): void; + function addDanglingComment(node: any, commentNode: any): void; + function addTrailingComment(node: any, commentNode: any): void; +} + +// https://github.com/prettier/prettier/blob/master/src/doc/index.js +export namespace doc { + namespace builders { + type Doc = + | string + | Align + | BreakParent + | Concat + | Fill + | Group + | IfBreak + | Indent + | Line + | LineSuffix + | LineSuffixBoundary; + + interface Align { + type: 'align'; + contents: Doc; + n: number | string | { type: 'root' }; + } + + interface BreakParent { + type: 'break-parent'; + } + + interface Concat { + type: 'concat'; + parts: Doc[]; + } + + interface Fill { + type: 'fill'; + parts: Doc[]; + } + + interface Group { + type: 'group'; + contents: Doc; + break: boolean; + expandedStates: Doc[]; + } + + interface IfBreak { + type: 'if-break'; + breakContents: Doc; + flatContents: Doc; + } + + interface Indent { + type: 'indent'; + contents: Doc; + } + + interface Line { + type: 'line'; + soft?: boolean; + hard?: boolean; + literal?: boolean; + } + + interface LineSuffix { + type: 'line-suffix'; + contents: Doc; + } + + interface LineSuffixBoundary { + type: 'line-suffix-boundary'; + } + + function addAlignmentToDoc(doc: Doc, size: number, tabWidth: number): Doc; + function align(n: Align['n'], contents: Doc): Align; + const breakParent: BreakParent; + function concat(contents: Doc[]): Concat; + function conditionalGroup(states: Doc[], opts?: { shouldBreak: boolean }): Group; + function dedent(contents: Doc): Align; + function dedentToRoot(contents: Doc): Align; + function fill(parts: Doc[]): Fill; + function group(contents: Doc, opts?: { shouldBreak: boolean }): Group; + const hardline: Concat; + function ifBreak(breakContents: Doc, flatContents: Doc): IfBreak; + function indent(contents: Doc): Indent; + function join(separator: Doc, parts: Doc[]): Concat; + const line: Line; + function lineSuffix(contents: Doc): LineSuffix; + const lineSuffixBoundary: LineSuffixBoundary; + const literalline: Concat; + function markAsRoot(contents: Doc): Align; + const softline: Line; + } + namespace debug { + function printDocToDebug(doc: Doc): string; + } + namespace printer { + function printDocToString(doc: Doc, options: Options): string; + interface Options { + /** + * Specify the line length that the printer will wrap on. + */ + printWidth: number; + /** + * Specify the number of spaces per indentation-level. + */ + tabWidth: number; + /** + * Indent lines with tabs instead of spaces + */ + useTabs: boolean; + } + } + namespace utils { + function isEmpty(doc: Doc): boolean; + function isLineNext(doc: Doc): boolean; + function willBreak(doc: Doc): boolean; + function traverseDoc(doc: Doc, onEnter?: (doc: Doc) => void | boolean, onExit?: (doc: Doc) => void, shouldTraverseConditionalGroups?: boolean): void; + function mapDoc(doc: Doc, callback: (doc: Doc) => T): T; + function propagateBreaks(doc: Doc): void; + function removeLines(doc: Doc): Doc; + function stripTrailingHardline(doc: Doc): Doc; + } +} From c252ab8bc908710388075ff4fc3067551ff7f0d1 Mon Sep 17 00:00:00 2001 From: Simon Schick Date: Fri, 13 Apr 2018 20:57:40 +0200 Subject: [PATCH 0646/2153] fix(hapi): allow passing object to toolkit `state`, fix `tags` index signature, fix route `ext` (#24956) * fix(hapi): allow passing object to toolkit `state`, fix `tags` index signature, fix route `ext` * fixup! fix(hapi): allow passing object to toolkit `state`, fix `tags` index signature, fix route `ext` --- types/hapi/index.d.ts | 35 +++++++++++--------------- types/hapi/test/route/ext.ts | 11 ++++++-- types/hapi/test/server/server-state.ts | 5 ++-- 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index d75da47e5e..d4072b0cd7 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Marc Bornträger // Rafael Souza Fijalkowski // Justin Simms +// Simon Schick // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -1008,7 +1009,7 @@ export interface ResponseToolkit { * @return Return value: none. * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-hstatename-value-options) */ - state(name: string, value: string, options?: ServerStateCookieOptions): void; + state(name: string, value: string | object, options?: ServerStateCookieOptions): void; /** * Used by the [authentication] method to indicate authentication failed and pass back the credentials received where: @@ -1724,12 +1725,7 @@ export interface RouteOptions { * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#request-lifecycle) */ ext?: { - onPreAuth?: Lifecycle.Method; - onCredentials?: Lifecycle.Method; - onPostAuth?: Lifecycle.Method; - onPreHandler?: Lifecycle.Method; - onPostHandler?: Lifecycle.Method; - onPreResponse?: Lifecycle.Method; + [key in RouteRequestExtType]?: RouteExtObject | RouteExtObject[]; }; /** @@ -2229,8 +2225,8 @@ export interface RequestEvent { error: object; } -export type LogEventHandler = (event: LogEvent, tags: object) => void; -export type RequestEventHandler = (request: Request, event: RequestEvent, tags: object) => void; +export type LogEventHandler = (event: LogEvent, tags: { [key: string]: true }) => void; +export type RequestEventHandler = (request: Request, event: RequestEvent, tags: { [key: string]: true }) => void; export type ResponseEventHandler = (request: Request) => void; export type RouteEventHandler = (route: ServerRoute) => void; export type StartEventHandler = () => void; @@ -2354,15 +2350,17 @@ export interface ServerEvents extends Podium { * For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#request-lifecycle) */ export type ServerExtType = 'onPreStart' | 'onPostStart' | 'onPreStop' | 'onPostStop'; -export type ServerRequestExtType = - 'onRequest' - | 'onPreAuth' +export type RouteRequestExtType = 'onPreAuth' | 'onCredentials' | 'onPostAuth' | 'onPreHandler' | 'onPostHandler' | 'onPreResponse'; +export type ServerRequestExtType = + RouteRequestExtType + | 'onRequest'; + /** * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverextevents) * Registers an extension function in one of the request lifecycle extension points where: @@ -2401,14 +2399,11 @@ export interface ServerExtEventsObject { * * request extension points: a lifecycle method. */ method: ServerExtPointFunction | ServerExtPointFunction[]; - /** - * options - (optional) an object with the following: - * * before - a string or array of strings of plugin names this method must execute before (on the same event). Otherwise, extension methods are executed in the order added. - * * after - a string or array of strings of plugin names this method must execute after (on the same event). Otherwise, extension methods are executed in the order added. - * * bind - a context object passed back to the provided method (via this) when called. Ignored if the method is an arrow function. - * * sandbox - if set to 'plugin' when adding a request extension points the extension is only added to routes defined by the current plugin. Not allowed when configuring route-level extensions, - * or when adding server extensions. Defaults to 'server' which applies to any route added to the server the extension is added to. - */ + options?: ServerExtOptions; +} + +export interface RouteExtObject { + method: Lifecycle.Method; options?: ServerExtOptions; } diff --git a/types/hapi/test/route/ext.ts b/types/hapi/test/route/ext.ts index 0a2ac25a4b..b8dff44699 100644 --- a/types/hapi/test/route/ext.ts +++ b/types/hapi/test/route/ext.ts @@ -7,9 +7,16 @@ server.route({ path: "/test", options: { ext: { - onPreResponse(request, h) { - return h.continue; + onPreResponse: { + method(_request, h) { + return h.continue; + }, }, + onPostHandler: [{ + method(_request, h) { + return h.continue; + }, + }], } } }); diff --git a/types/hapi/test/server/server-state.ts b/types/hapi/test/server/server-state.ts index 97cf5997f0..ba4ffe344c 100644 --- a/types/hapi/test/server/server-state.ts +++ b/types/hapi/test/server/server-state.ts @@ -1,5 +1,5 @@ // from https://hapijs.com/tutorials/cookies?lang=en_US -import { Request, ResponseToolkit, Server, ServerOptions, ServerRoute, ServerStateCookieOptions } from "hapi"; +import { Server, ServerOptions, ServerRoute, ServerStateCookieOptions } from "hapi"; const options: ServerOptions = { port: 8000, @@ -8,7 +8,8 @@ const options: ServerOptions = { const serverRoute: ServerRoute = { path: '/say-hello', method: 'GET', - handler(request, h) { + handler(_request, h) { + h.state('test', { test: true }); return h.response('Hello').state('data', { firstVisit: false }); } }; From 56e1ac7f793b80d3722daa730c2704ea2bac7208 Mon Sep 17 00:00:00 2001 From: Jose Santacruz Date: Fri, 13 Apr 2018 13:58:05 -0500 Subject: [PATCH 0647/2153] add namespace declaration to allow import from syntax (#24979) --- types/chai-string/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/chai-string/index.d.ts b/types/chai-string/index.d.ts index bc990104be..fcf0fb9c23 100644 --- a/types/chai-string/index.d.ts +++ b/types/chai-string/index.d.ts @@ -49,4 +49,5 @@ declare global { } declare function chaiString(chai: any, utils: any): void; +declare namespace chaiString { } export = chaiString; From c914299740d594c75a400e9ab25eafec189c1bfe Mon Sep 17 00:00:00 2001 From: Westin Christensen Date: Fri, 13 Apr 2018 12:12:02 -0700 Subject: [PATCH 0648/2153] Chart.js :: Added a missing type for beginAtZero for TickOptions. (#24920) * Added a missing type for beginAtZero. * Consolidated tick options into single interface, addressed PR comments. * Added tslint disable for a depricated interface. --- types/chart.js/index.d.ts | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 0ea854c7ba..2c5de28962 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -402,6 +402,10 @@ declare namespace Chart { interface TickOptions { autoSkip?: boolean; autoSkipPadding?: number; + backdropColor?: ChartColor; + backdropPaddingX?: number; + backdropPaddingY?: number; + beginAtZero?: boolean; callback?(value: any, index: any, values: any): string|number; display?: boolean; fontColor?: ChartColor; @@ -409,14 +413,17 @@ declare namespace Chart { fontSize?: number; fontStyle?: string; labelOffset?: number; + max?: any; maxRotation?: number; + maxTicksLimit?: number; + min?: any; minRotation?: number; mirror?: boolean; padding?: number; reverse?: boolean; - min?: any; - max?: any; + showLabelBackdrop?: boolean; } + interface AngleLineOptions { display?: boolean; color?: ChartColor; @@ -431,26 +438,15 @@ declare namespace Chart { fontStyle?: string; } - interface TickOptions { - backdropColor?: ChartColor; - backdropPaddingX?: number; - backdropPaddingY?: number; - maxTicksLimit?: number; - showLabelBackdrop?: boolean; - } interface LinearTickOptions extends TickOptions { - beginAtZero?: boolean; - min?: number; - max?: number; maxTicksLimit?: number; stepSize?: number; suggestedMin?: number; suggestedMax?: number; } + // tslint:disable-next-line no-empty-interface interface LogarithmicTickOptions extends TickOptions { - min?: number; - max?: number; } type ChartColor = string | CanvasGradient | CanvasPattern | string[]; From 2ea7986e94a72cb12eb76345146ca4cf424ffa5e Mon Sep 17 00:00:00 2001 From: Dylan Scott Date: Sat, 14 Apr 2018 12:08:48 -0700 Subject: [PATCH 0649/2153] express-winston: add types for dynamic level function (#24977) --- types/express-winston/express-winston-tests.ts | 4 ++-- types/express-winston/index.d.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/types/express-winston/express-winston-tests.ts b/types/express-winston/express-winston-tests.ts index b64bce0b3e..7fd41cfd5c 100644 --- a/types/express-winston/express-winston-tests.ts +++ b/types/express-winston/express-winston-tests.ts @@ -14,7 +14,7 @@ app.use(expressWinston.logger({ expressFormat: true, ignoreRoute: (req, res) => true, ignoredRoutes: ['foo'], - level: 'level', + level: (req, res) => 'level', meta: true, metaField: 'metaField', msg: 'msg', @@ -49,7 +49,7 @@ app.use(expressWinston.logger({ app.use(expressWinston.errorLogger({ baseMeta: { foo: 'foo' }, dynamicMeta: (req, res, err) => ({ foo: 'bar' }), - level: 'level', + level: (req, res) => 'level', metaField: 'metaField', msg: 'msg', requestFilter: (req, prop) => true, diff --git a/types/express-winston/index.d.ts b/types/express-winston/index.d.ts index 920939abd6..6dac70c1b6 100644 --- a/types/express-winston/index.d.ts +++ b/types/express-winston/index.d.ts @@ -12,6 +12,7 @@ export interface MetaObject { } export type DynamicMetaFunction = (req: Request, res: Response, err: Error) => MetaObject | undefined; +export type DynamicLevelFunction = (req: Request, res: Response, err: Error) => string; export type RequestFilter = (req: Request, propName: string) => boolean; export type ResponseFilter = (res: Response, propName: string) => boolean; export type RouteFilter = (req: Request, res: Response) => boolean; @@ -25,7 +26,7 @@ export interface BaseLoggerOptions { expressFormat?: boolean; ignoreRoute?: RouteFilter; ignoredRoutes?: string[]; - level?: string; + level?: string | DynamicLevelFunction; meta?: boolean; metaField?: string; msg?: string; @@ -56,7 +57,7 @@ export function logger(options: LoggerOptions): Handler; export interface BaseErrorLoggerOptions { baseMeta?: MetaObject; dynamicMeta?: DynamicMetaFunction; - level?: string; + level?: string | DynamicLevelFunction; metaField?: string; msg?: string; requestFilter?: RequestFilter; From ca3bf7f06d894d2bdc3e89a4eccaf463dfe68815 Mon Sep 17 00:00:00 2001 From: Frank Tan Date: Sat, 14 Apr 2018 12:09:19 -0700 Subject: [PATCH 0650/2153] Re-type `helper` from `@ember/component/helper` (#24986) * Re-type `helper` from @ember/component/helper Previous typing caused an error about using private name `Ember.Helper` when generating declaration files. Fortunately, the previous typings were incorrect anyway, so we can remove the reference to `Ember.Helper` and thus fix the issue. Relevant links: * https://github.com/Microsoft/TypeScript/issues/5711 * https://github.com/Microsoft/TypeScript/issues/6307 * https://www.emberjs.com/api/ember/2.18/functions/@ember%2Fcomponent%2Fhelper/helper * https://github.com/emberjs/ember.js/blob/v2.18.2/packages/ember-glimmer/lib/helper.ts#L120 * Add test for `helper` from @ember/component/helper --- types/ember/index.d.ts | 15 ++++++++++++++- types/ember/test/helper.ts | 8 ++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index 740ff1308c..c825647e49 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -3442,7 +3442,20 @@ declare module '@ember/component/checkbox' { declare module '@ember/component/helper' { import Ember from 'ember'; export default class Helper extends Ember.Helper { } - export const helper: typeof Ember.Helper.helper; + /** + * In many cases, the ceremony of a full `Helper` class is not required. + * The `helper` method create pure-function helpers without instances. For + * example: + * ```app/helpers/format-currency.js + * import { helper } from '@ember/component/helper'; + * export default helper(function(params, hash) { + * let cents = params[0]; + * let currency = hash.currency; + * return `${currency}${cents * 0.01}`; + * }); + * ``` + */ + export function helper(helperFn: (params: any[], hash?: any) => string): any; } declare module '@ember/component/text-area' { diff --git a/types/ember/test/helper.ts b/types/ember/test/helper.ts index efe3ce33d7..cba5709b10 100755 --- a/types/ember/test/helper.ts +++ b/types/ember/test/helper.ts @@ -25,3 +25,11 @@ const CurrentUserEmailHelper = Ember.Helper.extend({ .get('email'); }, }); + +import { helper } from '@ember/component/helper'; + +function typedHelp(/*params, hash*/) { + return 'my type of help'; +} + +export default helper(typedHelp); From 6a7bc3a968812b8e7ad8bbe494abb8fc1d6c3bc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Am=C3=A9lie=20Turgeon?= Date: Sat, 14 Apr 2018 12:09:32 -0700 Subject: [PATCH 0651/2153] Add 2 missing functions in office-js (#24924) * Add 2 missing functions in office-js * More details about API set of added functions --- types/office-js/index.d.ts | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 3e8fa0d012..e08e0f1ee0 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -183,15 +183,15 @@ declare namespace Office { messageParent(messageObject: any): void; /** * Closes the UI container where the JavaScript is executing. - * + * * Supported hosts: Outlook - Minimum requirement set: Mailbox 1.5 - * + * * The behavior of this method is specified by the following: - * + * * Called from a UI-less command button: No effect. Any dialog opened by displayDialogAsync will remain open. - * + * * Called from a taskpane: The taskpane will close. Any dialog opened by displayDialogAsync will also close. If the taskpane supports pinning and was pinned by the user, it will be un-pinned. - * + * * Called from a module extension: No effect. */ closeContainer(): void; @@ -2102,6 +2102,19 @@ declare namespace Office { * Returns string values that match the named regular expression defined in the manifest XML file */ getRegExMatchesByName(name: string): Array; + /** + * Gets the entities found in the selected item that are currently selected + * + * [Api set: Mailbox 1.6] + */ + getSelectedEntities(): Entities; + /** + * Returns string values in the currently selected message object that match the regular expressions defined in the manifest XML file and + * are selected in the current item + * + * [Api set: Mailbox 1.6] + */ + getSelectedRegExMatches(): any; } export interface LocalClientTime { month: number; @@ -2608,12 +2621,12 @@ declare namespace OfficeExtension { } export interface EmbeddedOptions { - sessionKey?: string, - container?: HTMLElement, - id?: string; - timeoutInMilliseconds?: number; - height?: string; - width?: string; + sessionKey?: string, + container?: HTMLElement, + id?: string; + timeoutInMilliseconds?: number; + height?: string; + width?: string; } class EmbeddedSession { From cc77534189249acb499416429293c2db42d58b40 Mon Sep 17 00:00:00 2001 From: Claudia Hardman Date: Sat, 14 Apr 2018 15:11:41 -0400 Subject: [PATCH 0652/2153] Fix tags property definition in Pickle interface (#24843) --- types/cucumber/index.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/types/cucumber/index.d.ts b/types/cucumber/index.d.ts index d0fc9085fd..d93ad4c7b2 100644 --- a/types/cucumber/index.d.ts +++ b/types/cucumber/index.d.ts @@ -95,7 +95,7 @@ export namespace pickle { locations: Location[]; name: string; steps: Step[]; - tags: string[]; + tags: Tag[]; } interface Location { @@ -117,6 +117,11 @@ export namespace pickle { location: Location; value: string; } + + interface Tag { + name: string; + location: Location; + } } export type HookCode = (this: World, scenario: HookScenarioResult, callback?: CallbackStepDefinition) => void; From 7132597ca2612a9f36acc344337bf7e3cd270246 Mon Sep 17 00:00:00 2001 From: Sehrope Sarkuni Date: Sat, 14 Apr 2018 15:11:54 -0400 Subject: [PATCH 0653/2153] Expand BufferList.append(...) to include BufferList and array params (#24844) --- types/bl/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/bl/index.d.ts b/types/bl/index.d.ts index 5d34052b80..8ad01671fd 100644 --- a/types/bl/index.d.ts +++ b/types/bl/index.d.ts @@ -11,7 +11,7 @@ import stream = require('stream'); declare class BufferList extends stream.Duplex { constructor(callback?: (err: Error, buffer: Buffer) => void); - append(buffer: Buffer): void; + append(buffer: Buffer | Buffer[] | BufferList | BufferList[] | string): void; get(index: number): number; slice(start?: number, end?: number): Buffer; copy(dest: Buffer, destStart?: number, srcStart?: number, srcEnd?: number): void; From 6df4ebfc1af4f96c91f3f2147c9a2071d573a194 Mon Sep 17 00:00:00 2001 From: "howtimeflies.io developers" Date: Sun, 15 Apr 2018 03:12:17 +0800 Subject: [PATCH 0654/2153] [highcharts] Add support for word cloud chart and adding/firing events dynamically (#24824) * Add the missing typings required by @howtimeflies/ngx-highcharts * Add tests for the new added typings. --- types/highcharts/index.d.ts | 121 +++++++++++++++++++++++++++++++++ types/highcharts/test/index.ts | 27 ++++++++ 2 files changed, 148 insertions(+) diff --git a/types/highcharts/index.d.ts b/types/highcharts/index.d.ts index cf73a08e68..1434999411 100644 --- a/types/highcharts/index.d.ts +++ b/types/highcharts/index.d.ts @@ -5242,6 +5242,96 @@ declare namespace Highcharts { upColor?: Color; } + interface WordCloudChart extends BarChart { + /** + * For some series, there is a limit that shuts down initial animation by default when the total number of points + * in the chart is too high. For example, for a column chart and its derivatives, animation doesn't run if there + * is more than 250 points totally. To disable this cap, set animationLimit to Infinity. + * @default undefined + * @since 6.0.0 + */ + animationLimit?: number; + /** + * By default, series are exposed to screen readers as regions. By enabling this option, the series element itself + * will be exposed in the same way as the data points. This is useful if the series is not used as a grouping entity + * in the chart, but you still want to attach a description to the series. + * Requires the Accessibility module. + * @default undefined + * @since 5.0.12 + */ + exposeElementToA11y?: boolean; + /** + * This option decides which algorithm is used for placement, and rotation of a word. The choice of algorith is + * therefore a crucial part of the resulting layout of the wordcloud. It is possible for users to add their own + * custom placement strategies for use in word cloud. Read more about it in our documentation + * @default center + * @since 6.0.0 + */ + placementStrategy?: string; + /** + * Same as accessibility.pointDescriptionFormatter, but for an individual series. Overrides the chart wide + * configuration. + * @default undefined + * @since 5.0.12 + */ + pointDescriptionFormatter?: () => string; + /** + * Rotation options for the words in the wordcloud. + * @since 6.0.0 + */ + rotation?: { + /** + * The smallest degree of rotation for a + * @default 0 + * @since 6.0.0 + */ + from?: number; + /** + * The largest degree of rotation for a word. + * @default 90 + * @since 6.0.0 + */ + to?: number; + /** + * The number of possible orientations for a word, within the range of rotation.from and rotation.to. + * @default 2 + * @since 6.0.0 + */ + orientations?: number; + }; + + /** + * If set to True, the accessibility module will skip past the points in this series for keyboard navigation. + * @default undefined + * @since 5.0.12 + */ + skipKeyboardNavigation?: boolean; + /** + * Spiral used for placing a word after the inital position experienced a collision with either another word or the + * borders. It is possible for users to add their own custom spiralling algorithms for use in word cloud. Read more + * about it in our documentation + * @default rectangular + * @since 6.0.0 + */ + spiral?: string; + /** + * CSS styles for the words. + * @since 6.0.0 + */ + style?: { + /** + * @default sans-serif + * @since 6.0.0 + */ + fontFamily?: string; + /** + * @default 900 + * @since 6.0.0 + */ + fontWeight?: number | string; + }; + } + /** * The plotOptions is a wrapper object for config objects for each series type. The config objects for each series can * also be overridden for each series item as given in the series array. @@ -5423,6 +5513,7 @@ declare namespace Highcharts { interface SplineChartSeriesOptions extends IndividualSeriesOptions, SplineChart { } interface TreeMapChartSeriesOptions extends IndividualSeriesOptions, TreeMapChart { } interface WaterFallChartSeriesOptions extends IndividualSeriesOptions, WaterFallChart { } + interface WordCloudChartSeriesOptions extends IndividualSeriesOptions, WordCloudChart { } interface DataPoint { /** @@ -6711,6 +6802,36 @@ declare namespace Highcharts { map(array: any[], fn: Function): any[]; wrap(prototype: any, type: string, cb: (proceed: Function, ...args: any[]) => void): void; + + /** + * Add an event listener. + * + * @see {@link https://api.highcharts.com/class-reference/Highcharts#addEvent} + * @see {@link https://www.highcharts.com/docs/extending-highcharts/extending-highcharts} + * + * @param element The element or object to add a listener to. It can be a HTMLDOMElement, an Highcharts.SVGElement or any other object. + * @param type The event type. + * @param cb The function callback to execute when the event is fired. + * @returns A callback function to remove the added event. + */ + addEvent(element: HTMLElement | ElementObject | object, + type: string, + cb: (evt: Event) => void): () => void; + + /** + * Fire an event that was registered with + * + * @see {@link https://api.highcharts.com/class-reference/Highcharts#fireEvent} + * + * @param element The element or object to add a listener to. It can be a HTMLDOMElement, an Highcharts.SVGElement or any other object. + * @param type The event type. + * @param eventArguments Custom event arguments that are passed on as an argument to the event handler. + * @param defaultFunction The default function to execute if the other listeners haven't returned false. + */ + fireEvent(element: HTMLElement | ElementObject | object, + type: string, + eventArguments?: any, + defaultFunction?: () => void): void; } /** diff --git a/types/highcharts/test/index.ts b/types/highcharts/test/index.ts index c4ea1bd7a8..310886b585 100644 --- a/types/highcharts/test/index.ts +++ b/types/highcharts/test/index.ts @@ -2789,3 +2789,30 @@ function test_TitleUpdate() { } }); } + +function test_AddAndFireEvent() { + const chart = $('#container').highcharts(); + const type = 'drilldown'; + const evt = Highcharts.addEvent(chart, type, it => {}); + Highcharts.fireEvent(chart, type); +} + +function test_WordCloud() { + const allDefaults: Highcharts.WordCloudChartSeriesOptions = {}; + + // partial wordcloud demo + const series: Highcharts.WordCloudChartSeriesOptions = { + type: 'wordcloud', + data: [], + name: 'Occurrences', + rotation: { + to: 0 + }, + tooltip: { + headerFormat: null, + pointFormatter() { + return `${this.name}: Occurrence ${this.weight}`; + } + } + }; +} From dda14dffe3654e8d75be54c5d1cc3dc24d8da569 Mon Sep 17 00:00:00 2001 From: Rockson Date: Sat, 14 Apr 2018 21:12:50 +0200 Subject: [PATCH 0655/2153] Removed Partial from onSubmit values (#24816) see iss: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/24376 --- types/redux-form/lib/reduxForm.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/redux-form/lib/reduxForm.d.ts b/types/redux-form/lib/reduxForm.d.ts index 2c6dd40c5d..5cfcdb842c 100644 --- a/types/redux-form/lib/reduxForm.d.ts +++ b/types/redux-form/lib/reduxForm.d.ts @@ -18,7 +18,7 @@ import { } from "../index"; export type FormSubmitHandler = - (values: Partial, dispatch: Dispatch, props: P) => void | FormErrors | Promise; + (values: FormData, dispatch: Dispatch, props: P) => void | FormErrors | Promise; export interface SubmitHandler { ( From b4ef220eace86a8aabb2837a7351fc8ea5ef8611 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Sat, 14 Apr 2018 21:13:47 +0200 Subject: [PATCH 0656/2153] Add react-native-keyboard-spacer types (#24993) --- types/react-native-keyboard-spacer/index.d.ts | 16 +++++++++++++ .../react-native-keyboard-spacer-tests.tsx | 6 +++++ .../tsconfig.json | 24 +++++++++++++++++++ .../react-native-keyboard-spacer/tslint.json | 1 + 4 files changed, 47 insertions(+) create mode 100644 types/react-native-keyboard-spacer/index.d.ts create mode 100644 types/react-native-keyboard-spacer/react-native-keyboard-spacer-tests.tsx create mode 100644 types/react-native-keyboard-spacer/tsconfig.json create mode 100644 types/react-native-keyboard-spacer/tslint.json diff --git a/types/react-native-keyboard-spacer/index.d.ts b/types/react-native-keyboard-spacer/index.d.ts new file mode 100644 index 0000000000..0c7ec24262 --- /dev/null +++ b/types/react-native-keyboard-spacer/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for react-native-keyboard-spacer 0.4 +// Project: https://github.com/Andr3wHur5t/react-native-keyboard-spacer#readme +// Definitions by: Vincent Langlet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from 'react'; +import * as ReactNative from 'react-native'; + +export interface KeyboardSpacerProps { + topSpacing?: number; + onToggle?: (keyboardIsOpen: boolean, keyboardSpace: number) => void; + style?: ReactNative.StyleProp; +} + +export default class KeyboardSpacer extends React.Component { } diff --git a/types/react-native-keyboard-spacer/react-native-keyboard-spacer-tests.tsx b/types/react-native-keyboard-spacer/react-native-keyboard-spacer-tests.tsx new file mode 100644 index 0000000000..7deb9798ef --- /dev/null +++ b/types/react-native-keyboard-spacer/react-native-keyboard-spacer-tests.tsx @@ -0,0 +1,6 @@ +import * as React from 'react'; +import KeyboardSpacer from 'react-native-keyboard-spacer'; + +() => { + ; +}; diff --git a/types/react-native-keyboard-spacer/tsconfig.json b/types/react-native-keyboard-spacer/tsconfig.json new file mode 100644 index 0000000000..04110630ce --- /dev/null +++ b/types/react-native-keyboard-spacer/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-native-keyboard-spacer-tests.tsx" + ] +} diff --git a/types/react-native-keyboard-spacer/tslint.json b/types/react-native-keyboard-spacer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-native-keyboard-spacer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From ee7e9794e0b59a9c1d54052b1603a12f94ccd166 Mon Sep 17 00:00:00 2001 From: denisname Date: Sat, 14 Apr 2018 21:16:51 +0200 Subject: [PATCH 0657/2153] Extract from topojson (#24992) --- types/topojson-client/index.d.ts | 43 ++++ .../topojson-client-tests.ts} | 23 ++- types/topojson-client/tsconfig.json | 23 +++ types/topojson-client/tslint.json | 1 + types/topojson-simplify/index.d.ts | 37 ++++ .../topojson-simplify-tests.ts} | 52 ++--- types/topojson-simplify/tsconfig.json | 24 +++ types/topojson-simplify/tslint.json | 1 + types/topojson-specification/index.d.ts | 118 +++++++++++ .../topojson-specification-tests.ts} | 22 +-- types/topojson-specification/tsconfig.json | 23 +++ types/topojson-specification/tslint.json | 1 + types/topojson/index.d.ts | 186 ++---------------- types/topojson/test/server-tests.ts | 2 +- types/topojson/topojson-tests.ts | 7 +- types/topojson/tsconfig.json | 5 +- 16 files changed, 345 insertions(+), 223 deletions(-) create mode 100644 types/topojson-client/index.d.ts rename types/{topojson/test/client-tests.ts => topojson-client/topojson-client-tests.ts} (80%) create mode 100644 types/topojson-client/tsconfig.json create mode 100644 types/topojson-client/tslint.json create mode 100644 types/topojson-simplify/index.d.ts rename types/{topojson/test/simplify-tests.ts => topojson-simplify/topojson-simplify-tests.ts} (65%) create mode 100644 types/topojson-simplify/tsconfig.json create mode 100644 types/topojson-simplify/tslint.json create mode 100644 types/topojson-specification/index.d.ts rename types/{topojson/test/specification-tests.ts => topojson-specification/topojson-specification-tests.ts} (87%) create mode 100644 types/topojson-specification/tsconfig.json create mode 100644 types/topojson-specification/tslint.json diff --git a/types/topojson-client/index.d.ts b/types/topojson-client/index.d.ts new file mode 100644 index 0000000000..62b65a96f4 --- /dev/null +++ b/types/topojson-client/index.d.ts @@ -0,0 +1,43 @@ +// Type definitions for topojson-client 3.0 +// Project: https://github.com/topojson/topojson-client +// Definitions by: denisname +// Ricardo Mello +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.5 + +import * as GeoJSON from "geojson"; +import { + GeometryCollection, GeometryObject, LineString, + MultiLineString, MultiPoint, MultiPolygon, + Objects, Point, Polygon, Topology, Transform +} from "topojson-specification"; + +export type Transformer = (point: number[], index?: boolean) => number[]; + +export function feature

    (topology: Topology, object: Point

    ): GeoJSON.Feature; +export function feature

    (topology: Topology, object: MultiPoint

    ): GeoJSON.Feature; +export function feature

    (topology: Topology, object: LineString

    ): GeoJSON.Feature; +export function feature

    (topology: Topology, object: MultiLineString

    ): GeoJSON.Feature; +export function feature

    (topology: Topology, object: Polygon

    ): GeoJSON.Feature; +export function feature

    (topology: Topology, object: MultiPolygon

    ): GeoJSON.Feature; +export function feature

    (topology: Topology, object: GeometryCollection

    ): GeoJSON.FeatureCollection; +export function feature

    (topology: Topology, object: GeometryObject

    ) + : GeoJSON.Feature | GeoJSON.FeatureCollection; + +export function merge(topology: Topology, objects: Array): GeoJSON.MultiPolygon; + +export function mergeArcs(topology: Topology, objects: Array): MultiPolygon; + +export function mesh(topology: Topology, obj?: GeometryObject, filter?: (a: GeometryObject, b: GeometryObject) => boolean): GeoJSON.MultiLineString; + +export function meshArcs(topology: Topology, obj?: GeometryObject, filter?: (a: GeometryObject, b: GeometryObject) => boolean): MultiLineString; + +export function neighbors(objects: GeometryObject[]): number[][]; + +export function bbox(topology: Topology): GeoJSON.BBox; + +export function quantize(topology: Topology, transform: Transform | number): Topology; + +export function transform(transform: Transform | null): Transformer; + +export function untransform(transform: Transform | null): Transformer; diff --git a/types/topojson/test/client-tests.ts b/types/topojson-client/topojson-client-tests.ts similarity index 80% rename from types/topojson/test/client-tests.ts rename to types/topojson-client/topojson-client-tests.ts index 2e21e2b665..0d27c34cc1 100644 --- a/types/topojson/test/client-tests.ts +++ b/types/topojson-client/topojson-client-tests.ts @@ -1,9 +1,20 @@ -// Tests for: https://github.com/topojson/topojson-client +import * as topojson from "topojson-client"; +import { UsAtlas, WorldAtlas } from "topojson"; + +declare let us: UsAtlas; +declare let world: WorldAtlas; + +interface UsAtlasObjects extends TopoJSON.Objects { + counties: {type: "GeometryCollection", geometries: Array}; + states: {type: "GeometryCollection", geometries: Array}; + nation: TopoJSON.GeometryCollection; +} let geoMP: GeoJSON.MultiPolygon; let geoMLS: GeoJSON.MultiLineString; -let topoMP: topojson.MultiPolygon; -let topoMLS: topojson.MultiLineString; +let topoMP: TopoJSON.MultiPolygon; +let topoMLS: TopoJSON.MultiLineString; +let newUs: TopoJSON.Topology; let bbox: GeoJSON.BBox; let transformer: topojson.Transformer; let color: string; @@ -14,7 +25,7 @@ interface TestProp { size: number; } -const selectedGeometries: Array = +const selectedGeometries: Array = us.objects.states.geometries.filter((g) => ["be", 2, undefined].indexOf(g.id) >= 0); const topoWithProp = { @@ -49,7 +60,7 @@ const featureCollection: GeoJSON.FeatureCollection = topojson.feature(us, us.objects.counties); const featureObject: GeoJSON.Feature | GeoJSON.FeatureCollection = - topojson.feature(topoWithProp, topoWithProp.objects.foo as topojson.GeometryObject); + topojson.feature(topoWithProp, topoWithProp.objects.foo as TopoJSON.GeometryObject); const propColor = topojson.feature(topoWithProp, topoWithProp.objects.foo).properties; color = propColor.color; @@ -79,7 +90,7 @@ topoMLS = topojson.meshArcs(us, us.objects.states, (a, b) => a !== b); const n: number[][] = topojson.neighbors(world.objects.countries.geometries); // Transforms -const usTransform: topojson.Transform = us.transform; +const usTransform: TopoJSON.Transform = us.transform; bbox = topojson.bbox(us); bbox = topojson.bbox({type: "Topology", objects: {}, arcs: []}); diff --git a/types/topojson-client/tsconfig.json b/types/topojson-client/tsconfig.json new file mode 100644 index 0000000000..61837d76ec --- /dev/null +++ b/types/topojson-client/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "topojson-client-tests.ts" + ] +} diff --git a/types/topojson-client/tslint.json b/types/topojson-client/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/topojson-client/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/topojson-simplify/index.d.ts b/types/topojson-simplify/index.d.ts new file mode 100644 index 0000000000..0927e5d7e2 --- /dev/null +++ b/types/topojson-simplify/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for topojson-simplify 3.0 +// Project: https://github.com/topojson/topojson-simplify +// Definitions by: denisname +// Ricardo Mello +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.5 + +import * as GeoJSON from "geojson"; +import { Objects, OrNull, Topology } from "topojson-specification"; + +export type Triangle = [[number, number], [number, number], [number, number]]; +export type TriangleWeighter = (triangle: Triangle) => number; +export type Ring = Array<[number, number]>; +export type RingWeighter = (triangle: Ring) => number; +export type Filter = (ring: Ring, interior: boolean) => boolean; + +export function presimplify(topology: Topology, weight?: TriangleWeighter): Topology; + +export function simplify(topology: Topology, minWeight?: number): Topology; + +export function quantile(topology: Topology, p: number): number; + +export function filter(topology: Topology, filter: Filter): Topology>; + +export function filterAttached(topology: Topology): Filter; + +export function filterAttachedWeight(topology: Topology, minWeight?: number, weight?: RingWeighter): Filter; + +export function filterWeight(topology: Topology, minWeight?: number, weight?: RingWeighter): Filter; + +export function planarRingArea(ring: Ring): number; + +export function planarTriangleArea(triangle: Triangle): number; + +export function sphericalRingArea(ring: Ring, interior: boolean): number; + +export function sphericalTriangleArea(triangle: Triangle): number; diff --git a/types/topojson/test/simplify-tests.ts b/types/topojson-simplify/topojson-simplify-tests.ts similarity index 65% rename from types/topojson/test/simplify-tests.ts rename to types/topojson-simplify/topojson-simplify-tests.ts index 6347466236..ce0ae8e816 100644 --- a/types/topojson/test/simplify-tests.ts +++ b/types/topojson-simplify/topojson-simplify-tests.ts @@ -1,24 +1,28 @@ -// Tests for: https://github.com/topojson/topojson-simplify +import * as topojson from "topojson-simplify"; +import { UsAtlas, WorldAtlas } from "topojson"; -interface UsAtlasObjects extends topojson.Objects { - counties: {type: "GeometryCollection", geometries: Array}; - states: {type: "GeometryCollection", geometries: Array}; - nation: topojson.GeometryCollection; +declare let us: UsAtlas; +declare let world: WorldAtlas; + +interface UsAtlasObjects extends TopoJSON.Objects { + counties: {type: "GeometryCollection", geometries: Array}; + states: {type: "GeometryCollection", geometries: Array}; + nation: TopoJSON.GeometryCollection; } -interface UsEmpty extends topojson.Objects { - counties: topojson.NullObject; - states: topojson.NullObject; - nation: topojson.NullObject; +interface UsEmpty extends TopoJSON.Objects { + counties: TopoJSON.NullObject; + states: TopoJSON.NullObject; + nation: TopoJSON.NullObject; } -let aTopology: topojson.Topology; -let presimplifiedUs: topojson.Topology; -let newUs: topojson.Topology; -let emptyUs: topojson.Topology; -let geomCollection: topojson.GeometryCollection; -let geomCollectionOrNull: topojson.GeometryCollection | topojson.NullObject; -let aNullObject: topojson.NullObject; +let aTopology: TopoJSON.Topology; +let presimplifiedUs: TopoJSON.Topology; +let newUs: TopoJSON.Topology; +let emptyUs: TopoJSON.Topology; +let geomCollection: TopoJSON.GeometryCollection; +let geomCollectionOrNull: TopoJSON.GeometryCollection | TopoJSON.NullObject; +let aNullObject: TopoJSON.NullObject; let filter: topojson.Filter; presimplifiedUs = topojson.presimplify(us); @@ -30,7 +34,7 @@ geomCollection = topojson.presimplify(us).objects.counties; geomCollection = topojson.presimplify(us).objects.nation; geomCollection = topojson.presimplify(us).objects.states; -let minWeight = topojson.quantile(presimplifiedUs, 0.5); +const minWeight = topojson.quantile(presimplifiedUs, 0.5); newUs = topojson.simplify(presimplifiedUs); newUs = topojson.simplify(presimplifiedUs, 1.23); @@ -55,12 +59,12 @@ filter = topojson.filterWeight(us, 0.5, topojson.planarRingArea); filter = topojson.filterWeight(us, 0.5, (points: Array<[number, number]>) => 1.5); aTopology = topojson.filter(us, filter); -newUs = topojson.filter(us, (ring: topojson.Ring, interior: boolean) => true) as topojson.UsAtlas; -emptyUs = topojson.filter(us, () => false) as topojson.Topology; +newUs = topojson.filter(us, (ring: topojson.Ring, interior: boolean) => true) as UsAtlas; +emptyUs = topojson.filter(us, () => false) as TopoJSON.Topology; geomCollectionOrNull = topojson.filter(us, () => Math.random() > 0.9).objects.nation; -aNullObject = topojson.filter(us, () => false).objects.nation as topojson.NullObject; -geomCollection = topojson.filter(us, () => true).objects.nation as topojson.GeometryCollection; +aNullObject = topojson.filter(us, () => false).objects.nation as TopoJSON.NullObject; +geomCollection = topojson.filter(us, () => true).objects.nation as TopoJSON.GeometryCollection; // Geometry @@ -72,14 +76,14 @@ area = topojson.sphericalTriangleArea([[0, 0], [0, 90], [90, 180]]); // Fails -interface MyAtlas extends topojson.Topology { +interface MyAtlas extends TopoJSON.Topology { objects: { - obj: topojson.GeometryCollection; + obj: TopoJSON.GeometryCollection; }; more: "hello"; } -let myAtlas: MyAtlas = null as any; // shortcut... +declare let myAtlas: MyAtlas; console.log(myAtlas.more); let s: string; diff --git a/types/topojson-simplify/tsconfig.json b/types/topojson-simplify/tsconfig.json new file mode 100644 index 0000000000..43534c0207 --- /dev/null +++ b/types/topojson-simplify/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "topojson-simplify-tests.ts" + ] +} diff --git a/types/topojson-simplify/tslint.json b/types/topojson-simplify/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/topojson-simplify/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/topojson-specification/index.d.ts b/types/topojson-specification/index.d.ts new file mode 100644 index 0000000000..764fbd6bae --- /dev/null +++ b/types/topojson-specification/index.d.ts @@ -0,0 +1,118 @@ +// Type definitions for topojson-specification 1.0 +// Project: https://github.com/topojson/topojson-specification +// Definitions by: denisname +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// Last revision validated against: commit 90ed973 (2017-08-02) + +import * as GeoJSON from "geojson"; + +export as namespace TopoJSON; + +// --------------------------------------------------------------- +// TopoJSON Format Specification +// --------------------------------------------------------------- + +// See: https://github.com/topojson/topojson-specification/ + +// 2. TopoJSON Objects +export interface TopoJSON { + type: "Topology" | GeoJSON.GeoJsonGeometryTypes | null; + bbox?: GeoJSON.BBox; +} + +// 2.1. Topology Objects +export interface Topology = Objects> extends TopoJSON { + type: "Topology"; + objects: T; + arcs: Arc[]; + transform?: Transform; +} + +// 2.1.1. Positions +export type Positions = number[]; // at least two elements + +// 2.1.2. Transforms +export interface Transform { + scale: [number, number]; + translate: [number, number]; +} + +// 2.1.3. Arcs +export type Arc = Positions[]; // at least two elements + +// 2.1.4. Arc Indexes +export type ArcIndexes = number[]; + +// 2.1.5. Objects +export type Properties = GeoJSON.GeoJsonProperties; + +export interface Objects

    { + [key: string]: GeometryObject

    ; +} + +// 2.2. Geometry Objects +export interface GeometryObjectA

    extends TopoJSON { + type: GeoJSON.GeoJsonGeometryTypes | null; + id?: number | string; + properties?: P; +} + +export type GeometryObject

    = + Point

    | MultiPoint

    | + LineString

    | MultiLineString

    | + Polygon

    | MultiPolygon

    | + GeometryCollection

    | + NullObject; + +// 2.2.1. Point +export interface Point

    extends GeometryObjectA

    { + type: "Point"; + coordinates: Positions; +} + +// 2.2.2. MultiPoint +export interface MultiPoint

    extends GeometryObjectA

    { + type: "MultiPoint"; + coordinates: Positions[]; +} + +// 2.2.3. LineString +export interface LineString

    extends GeometryObjectA

    { + type: "LineString"; + arcs: ArcIndexes; +} + +// 2.2.4. MultiLineString +export interface MultiLineString

    extends GeometryObjectA

    { + type: "MultiLineString"; + arcs: ArcIndexes[]; +} + +// 2.2.5. Polygon +export interface Polygon

    extends GeometryObjectA

    { + type: "Polygon"; + arcs: ArcIndexes[]; +} + +// 2.2.6. MultiPolygon +export interface MultiPolygon

    extends GeometryObjectA

    { + type: "MultiPolygon"; + arcs: ArcIndexes[][]; +} + +// 2.2.7. Geometry Collection +export interface GeometryCollection

    extends GeometryObjectA

    { + type: "GeometryCollection"; + geometries: Array>; +} + +// More +export interface NullObject extends GeometryObjectA { + type: null; +} + +export type OrNull = { + [P in keyof T]: T[P] | NullObject; +}; diff --git a/types/topojson/test/specification-tests.ts b/types/topojson-specification/topojson-specification-tests.ts similarity index 87% rename from types/topojson/test/specification-tests.ts rename to types/topojson-specification/topojson-specification-tests.ts index ccb4275468..c86ed57b3f 100644 --- a/types/topojson/test/specification-tests.ts +++ b/types/topojson-specification/topojson-specification-tests.ts @@ -1,38 +1,36 @@ -// Tests for: https://github.com/topojson/topojson-specification - // Geometry Objects -const point: topojson.Point = { +const point: TopoJSON.Point = { type: "Point", coordinates: [0, 0], }; -const multiPoint: topojson.MultiPoint = { +const multiPoint: TopoJSON.MultiPoint = { type: "MultiPoint", coordinates: [[0, 0]], }; -const lineString: topojson.LineString = { +const lineString: TopoJSON.LineString = { type: "LineString", arcs: [0], }; -const multiLineString: topojson.MultiLineString = { +const multiLineString: TopoJSON.MultiLineString = { type: "MultiLineString", arcs: [[3], [4]], }; -const polygon: topojson.Polygon = { +const polygon: TopoJSON.Polygon = { type: "Polygon", arcs: [[0]], }; -const multiPolygon: topojson.MultiPolygon = { +const multiPolygon: TopoJSON.MultiPolygon = { type: "MultiPolygon", arcs: [[[0]]], }; -const geometryCollection: topojson.GeometryCollection = { +const geometryCollection: TopoJSON.GeometryCollection = { type: "GeometryCollection", geometries: [ {type: "Polygon", arcs: [[0]]}, @@ -43,7 +41,7 @@ const geometryCollection: topojson.GeometryCollection = { ], }; -const nullObject: topojson.NullObject = { +const nullObject: TopoJSON.NullObject = { type: null, }; @@ -54,7 +52,7 @@ interface TestProp { size: number; } -const pointWithProp: topojson.Point = { +const pointWithProp: TopoJSON.Point = { type: "Point", coordinates: [0, 0], properties: {color: "orange", size: 42}, @@ -65,7 +63,7 @@ const nbr: number = pointWithProp.properties!.size; // Topology -let topology: topojson.Topology; +let topology: TopoJSON.Topology; topology = { type: "Topology", diff --git a/types/topojson-specification/tsconfig.json b/types/topojson-specification/tsconfig.json new file mode 100644 index 0000000000..240c420906 --- /dev/null +++ b/types/topojson-specification/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "topojson-specification-tests.ts" + ] +} diff --git a/types/topojson-specification/tslint.json b/types/topojson-specification/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/topojson-specification/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/topojson/index.d.ts b/types/topojson/index.d.ts index 6330f23b1c..75f1853f39 100644 --- a/types/topojson/index.d.ts +++ b/types/topojson/index.d.ts @@ -7,211 +7,51 @@ // TypeScript Version: 2.5 import * as GeoJSON from "geojson"; +import * as TopoJSON from "topojson-specification"; export as namespace topojson; -// --------------------------------------------------------------- -// TopoJSON Format Specification -// --------------------------------------------------------------- - -// See: https://github.com/topojson/topojson-specification/ - -// 2. TopoJSON Objects -export interface TopoJSON { - type: "Topology" | GeoJSON.GeoJsonGeometryTypes | null; - bbox?: GeoJSON.BBox; -} - -// 2.1. Topology Objects -export interface Topology = Objects> extends TopoJSON { - type: "Topology"; - objects: T; - arcs: Arc[]; - transform?: Transform; -} - -// 2.1.1. Positions -export type Positions = number[]; // at least two elements - -// 2.1.2. Transforms -export interface Transform { - scale: [number, number]; - translate: [number, number]; -} - -// 2.1.3. Arcs -export type Arc = Positions[]; // at least two elements - -// 2.1.4. Arc Indexes -export type ArcIndexes = number[]; - -// 2.1.5. Objects -export type Properties = GeoJSON.GeoJsonProperties; - -export interface Objects

    { - [key: string]: GeometryObject

    ; -} - -// 2.2. Geometry Objects -export interface GeometryObjectA

    extends TopoJSON { - type: GeoJSON.GeoJsonGeometryTypes | null; - id?: number | string; - properties?: P; -} - -export type GeometryObject

    = - Point

    | MultiPoint

    | - LineString

    | MultiLineString

    | - Polygon

    | MultiPolygon

    | - GeometryCollection

    | - NullObject; - -// 2.2.1. Point -export interface Point

    extends GeometryObjectA

    { - type: "Point"; - coordinates: Positions; -} - -// 2.2.2. MultiPoint -export interface MultiPoint

    extends GeometryObjectA

    { - type: "MultiPoint"; - coordinates: Positions[]; -} - -// 2.2.3. LineString -export interface LineString

    extends GeometryObjectA

    { - type: "LineString"; - arcs: ArcIndexes; -} - -// 2.2.4. MultiLineString -export interface MultiLineString

    extends GeometryObjectA

    { - type: "MultiLineString"; - arcs: ArcIndexes[]; -} - -// 2.2.5. Polygon -export interface Polygon

    extends GeometryObjectA

    { - type: "Polygon"; - arcs: ArcIndexes[]; -} - -// 2.2.6. MultiPolygon -export interface MultiPolygon

    extends GeometryObjectA

    { - type: "MultiPolygon"; - arcs: ArcIndexes[][]; -} - -// 2.2.7. Geometry Collection -export interface GeometryCollection

    extends GeometryObjectA

    { - type: "GeometryCollection"; - geometries: Array>; -} - -// More -export interface NullObject extends GeometryObjectA { - type: null; -} - -export type OrNull = { - [P in keyof T]: T[P] | NullObject; -}; - // --------------------------------------------------------------- // TopoJSON Server // --------------------------------------------------------------- -export function topology(objects: {[k: string]: GeoJSON.GeoJsonObject}, quantization?: number): Topology; +export function topology(objects: {[k: string]: GeoJSON.GeoJsonObject}, quantization?: number): TopoJSON.Topology; // --------------------------------------------------------------- // TopoJSON Simplify // --------------------------------------------------------------- -export type Triangle = [[number, number], [number, number], [number, number]]; -export type TriangleWeighter = (triangle: Triangle) => number; -export type Ring = Array<[number, number]>; -export type RingWeighter = (triangle: Ring) => number; -export type Filter = (ring: Ring, interior: boolean) => boolean; - -export function presimplify(topology: Topology, weight?: TriangleWeighter): Topology; - -export function simplify(topology: Topology, minWeight?: number): Topology; - -export function quantile(topology: Topology, p: number): number; - -export function filter(topology: Topology, filter: Filter): Topology>; - -export function filterAttached(topology: Topology): Filter; - -export function filterAttachedWeight(topology: Topology, minWeight?: number, weight?: RingWeighter): Filter; - -export function filterWeight(topology: Topology, minWeight?: number, weight?: RingWeighter): Filter; - -export function planarRingArea(ring: Ring): number; - -export function planarTriangleArea(triangle: Triangle): number; - -export function sphericalRingArea(ring: Ring, interior: true): number; - -export function sphericalTriangleArea(triangle: Triangle): number; +export * from 'topojson-simplify'; // --------------------------------------------------------------- // TopoJSON Client // --------------------------------------------------------------- -export type Transformer = (point: number[], index?: boolean) => number[]; - -export function feature

    (topology: Topology, object: Point

    ): GeoJSON.Feature; -export function feature

    (topology: Topology, object: MultiPoint

    ): GeoJSON.Feature; -export function feature

    (topology: Topology, object: LineString

    ): GeoJSON.Feature; -export function feature

    (topology: Topology, object: MultiLineString

    ): GeoJSON.Feature; -export function feature

    (topology: Topology, object: Polygon

    ): GeoJSON.Feature; -export function feature

    (topology: Topology, object: MultiPolygon

    ): GeoJSON.Feature; -export function feature

    (topology: Topology, object: GeometryCollection

    ): GeoJSON.FeatureCollection; -export function feature

    (topology: Topology, object: GeometryObject

    ) - : GeoJSON.Feature | GeoJSON.FeatureCollection; - -export function merge(topology: Topology, objects: Array): GeoJSON.MultiPolygon; - -export function mergeArcs(topology: Topology, objects: Array): MultiPolygon; - -export function mesh(topology: Topology, obj?: GeometryObject, filter?: (a: GeometryObject, b: GeometryObject) => boolean): GeoJSON.MultiLineString; - -export function meshArcs(topology: Topology, obj?: GeometryObject, filter?: (a: GeometryObject, b: GeometryObject) => boolean): MultiLineString; - -export function neighbors(objects: GeometryObject[]): number[][]; - -export function bbox(topology: Topology): GeoJSON.BBox; - -export function quantize(topology: Topology, transform: Transform | number): Topology; - -export function transform(transform: Transform | null): Transformer; - -export function untransform(transform: Transform | null): Transformer; +export * from 'topojson-client'; // --------------------------------------------------------------- // U.S. Atlas TopoJSON // --------------------------------------------------------------- -export interface UsAtlas extends topojson.Topology { +export interface UsAtlas extends TopoJSON.Topology { objects: { - counties: {type: "GeometryCollection", geometries: Array}; - states: {type: "GeometryCollection", geometries: Array}; - nation: topojson.GeometryCollection; + counties: {type: "GeometryCollection", geometries: Array}; + states: {type: "GeometryCollection", geometries: Array}; + nation: TopoJSON.GeometryCollection; }; bbox: [number, number, number, number]; - transform: topojson.Transform; + transform: TopoJSON.Transform; } // --------------------------------------------------------------- // World Atlas TopoJSON // --------------------------------------------------------------- -export interface WorldAtlas extends topojson.Topology { +export interface WorldAtlas extends TopoJSON.Topology { objects: { - countries: {type: "GeometryCollection", geometries: Array}; - land: topojson.GeometryCollection; + countries: {type: "GeometryCollection", geometries: Array}; + land: TopoJSON.GeometryCollection; }; bbox: [number, number, number, number]; - transform: topojson.Transform; + transform: TopoJSON.Transform; } diff --git a/types/topojson/test/server-tests.ts b/types/topojson/test/server-tests.ts index 262fa8e6f5..9ee794593e 100644 --- a/types/topojson/test/server-tests.ts +++ b/types/topojson/test/server-tests.ts @@ -1,6 +1,6 @@ // Tests for: https://github.com/topojson/topojson-server -let topo: topojson.Topology; +let topo: TopoJSON.Topology; const aPoint: GeoJSON.Point = {type: "Point", coordinates: [30, 10]}; const aPolygon: GeoJSON.Polygon = {type: "Polygon", coordinates: [[[30, 10], [40, 40], [20, 40], [30, 10]]]}; diff --git a/types/topojson/topojson-tests.ts b/types/topojson/topojson-tests.ts index 953fda4743..7a5f6231ed 100644 --- a/types/topojson/topojson-tests.ts +++ b/types/topojson/topojson-tests.ts @@ -1,4 +1,5 @@ -const hello = "world"; +// Export topojson-simplify functions +topojson.planarRingArea([]); -// NOTE: The standard bundle definition has no particular function. -// See ./test/ for per bundle tests. +// Export topojson-client functions +topojson.transform(null); diff --git a/types/topojson/tsconfig.json b/types/topojson/tsconfig.json index 65b6cd1f07..75f46ff807 100644 --- a/types/topojson/tsconfig.json +++ b/types/topojson/tsconfig.json @@ -21,9 +21,6 @@ "index.d.ts", "topojson-tests.ts", "test/atlas-tests.ts", - "test/client-tests.ts", - "test/server-tests.ts", - "test/simplify-tests.ts", - "test/specification-tests.ts" + "test/server-tests.ts" ] } \ No newline at end of file From a8637a544d40a1272532b531fa60ba4bd5f4187a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anderson=20Fria=C3=A7a?= Date: Sat, 14 Apr 2018 15:17:15 -0400 Subject: [PATCH 0658/2153] Types for JQuery Focusable (#24988) --- types/jquery-focusable/index.d.ts | 25 +++++++++++++++++++ .../jquery-focusable-tests.ts | 12 +++++++++ types/jquery-focusable/tsconfig.json | 25 +++++++++++++++++++ types/jquery-focusable/tslint.json | 1 + 4 files changed, 63 insertions(+) create mode 100644 types/jquery-focusable/index.d.ts create mode 100644 types/jquery-focusable/jquery-focusable-tests.ts create mode 100644 types/jquery-focusable/tsconfig.json create mode 100644 types/jquery-focusable/tslint.json diff --git a/types/jquery-focusable/index.d.ts b/types/jquery-focusable/index.d.ts new file mode 100644 index 0000000000..b65fd23d38 --- /dev/null +++ b/types/jquery-focusable/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for JQuery Focusable 1.0 +// Project: https://github.com/makeup-jquery/jquery-focusable +// Definitions by: Anderson Friaça +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +export type Options = Partial<{ + /** + * Find elements with tabindex equal to -1 + */ + findNegativeTabindex: boolean; + + /** + * Find elements with tabindex greater than 0 + */ + findPositiveTabindex: true; +}>; + +declare global { + interface JQuery { + focusable(options?: Options): JQuery; + } +} diff --git a/types/jquery-focusable/jquery-focusable-tests.ts b/types/jquery-focusable/jquery-focusable-tests.ts new file mode 100644 index 0000000000..2935d5f38f --- /dev/null +++ b/types/jquery-focusable/jquery-focusable-tests.ts @@ -0,0 +1,12 @@ +import { Options } from "jquery-focusable"; + +// Basic usage +$('body').focusable(); + +// With options +const options: Options = { + findNegativeTabindex: true, + findPositiveTabindex: true + }; + +$('body').focusable(options); diff --git a/types/jquery-focusable/tsconfig.json b/types/jquery-focusable/tsconfig.json new file mode 100644 index 0000000000..d216e5326b --- /dev/null +++ b/types/jquery-focusable/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "jquery-focusable-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jquery-focusable/tslint.json b/types/jquery-focusable/tslint.json new file mode 100644 index 0000000000..d04fe2e1fa --- /dev/null +++ b/types/jquery-focusable/tslint.json @@ -0,0 +1 @@ +{"extends": "dtslint/dt.json"} \ No newline at end of file From ffbf344eb06f93ebf4af722639f897d584807a8b Mon Sep 17 00:00:00 2001 From: AJ Livingston Date: Sat, 14 Apr 2018 15:18:11 -0400 Subject: [PATCH 0659/2153] Add typings for express-ws (#24984) * Add types for express-ws * strictFunctionTypes=true * dtslint compliant * union types for application and router * allow https server * applyTo accepts object * fix lint error * applyTo accepts router-like obj * websocket method returns this --- types/express-ws/express-ws-tests.ts | 72 ++++++++++++++++++++++++++++ types/express-ws/index.d.ts | 47 ++++++++++++++++++ types/express-ws/tsconfig.json | 23 +++++++++ types/express-ws/tslint.json | 1 + 4 files changed, 143 insertions(+) create mode 100644 types/express-ws/express-ws-tests.ts create mode 100644 types/express-ws/index.d.ts create mode 100644 types/express-ws/tsconfig.json create mode 100644 types/express-ws/tslint.json diff --git a/types/express-ws/express-ws-tests.ts b/types/express-ws/express-ws-tests.ts new file mode 100644 index 0000000000..a37f315dfb --- /dev/null +++ b/types/express-ws/express-ws-tests.ts @@ -0,0 +1,72 @@ +import http = require('http'); +import https = require('https'); +import express = require('express'); +import expressWs = require('express-ws'); + +const dummyApp = express(); +const httpServer = http.createServer(dummyApp); +const httpsServer = https.createServer({}, dummyApp); + +expressWs(dummyApp); // optional server argument +expressWs(dummyApp, httpsServer); // https server allowed +expressWs(dummyApp, httpServer, { + leaveRouterUntouched: false, + // ws server options + wsOptions: { + clientTracking: true + } +}); + +const { app, getWss, applyTo } = expressWs(express()); + +/** + * applyTo accepts router object + */ +applyTo(express.Router()); + +/** + * applyTo accepts router-like objects + */ +applyTo({ + get() { return this; } +}); + +/** + * getWss function returns ws server + */ +getWss().clients.forEach(ws => { + if (ws.readyState !== ws.OPEN) { + ws.terminate(); + return; + } + ws.ping(); +}); + +/** + * ws method is added to express app instance + */ +app.ws('/', (ws, req) => { + ws.on('message', msg => { + console.log(msg); + }); +}); + +/** + * ws method is added to express.Router prototype + */ +const router = express.Router(); + +router.ws( + '/:id', + (ws, req, next) => { next(); }, + (ws, req, next) => { + ws.send(req.params.id); + + ws.on('close', (code, reason) => { + console.log('code:', code); + console.log('reason:', reason); + }); + } +); + +app.use(router); diff --git a/types/express-ws/index.d.ts b/types/express-ws/index.d.ts new file mode 100644 index 0000000000..81cf85c6d3 --- /dev/null +++ b/types/express-ws/index.d.ts @@ -0,0 +1,47 @@ +// Type definitions for express-ws 3.0 +// Project: https://github.com/HenningM/express-ws +// Definitions by: AJ Livingston +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as core from 'express-serve-static-core'; +import * as express from 'express'; +import * as http from 'http'; +import * as https from 'https'; +import * as ws from 'ws'; + +declare module 'express' { + function Router(options?: RouterOptions): expressWs.Router; +} + +declare function expressWs(app: express.Application, server?: http.Server | https.Server, options?: expressWs.Options): expressWs.Instance; +declare namespace expressWs { + type Application = express.Application & WithWebsocketMethod; + type Router = express.Router & WithWebsocketMethod; + + interface Options { + leaveRouterUntouched?: boolean; + wsOptions?: ws.ServerOptions; + } + + interface RouterLike { + get: express.IRouterMatcher; + [key: string]: any; + [key: number]: any; + } + + interface Instance { + app: Application; + applyTo(target: RouterLike): void; + getWss(): ws.Server; + } + + type WebsocketRequestHandler = (ws: ws, req: express.Request, next: express.NextFunction) => void; + type WebsocketMethod = (route: core.PathParams, ...middlewares: WebsocketRequestHandler[]) => T; + + interface WithWebsocketMethod { + ws: WebsocketMethod; + } +} + +export = expressWs; diff --git a/types/express-ws/tsconfig.json b/types/express-ws/tsconfig.json new file mode 100644 index 0000000000..e2d5677145 --- /dev/null +++ b/types/express-ws/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "express-ws-tests.ts" + ] +} diff --git a/types/express-ws/tslint.json b/types/express-ws/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/express-ws/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 3a647d4f0e999265f0059206ddd845b87d54e21d Mon Sep 17 00:00:00 2001 From: Lukas Senionis Date: Sat, 14 Apr 2018 22:24:56 +0300 Subject: [PATCH 0660/2153] [component-emitter] Provide easy access to interface (#24994) * provide easy access to interface * declare is not needed --- types/component-emitter/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/component-emitter/index.d.ts b/types/component-emitter/index.d.ts index 95682f6ca4..b55a1673ab 100644 --- a/types/component-emitter/index.d.ts +++ b/types/component-emitter/index.d.ts @@ -13,9 +13,9 @@ interface Emitter { hasListeners(event: string): boolean; } -declare const constructor: { +declare const Emitter: { (obj?: any): Emitter; new (obj?: any): Emitter; }; -export = constructor; +export = Emitter; From 4ac43f606127fe8487ebc9e9ef08fbdf2ee5b77f Mon Sep 17 00:00:00 2001 From: Kalle Ott Date: Sat, 14 Apr 2018 21:29:21 +0200 Subject: [PATCH 0661/2153] fix for wrong method signature in params of WindowScroller render-prop (#24953) * typings update to catch up with current version of react-virtualized * fixed lint errors * fixed ts version * fixed void return type of defaultProps functions * changed interface to type for better consistency * fixed signature of onChildScroll params in WindowScroller * Auto stash before merge of "enable-strict-mode" and "master" * removed unimportant line from test file * replaced strict with explicit options * updated TS version * ts version set to 2.7 * back to ts 2.6 * changed autogenerated relative import to global import --- .../dist/es/CellMeasurer.d.ts | 8 +- .../react-virtualized/dist/es/Collection.d.ts | 5 +- types/react-virtualized/dist/es/Grid.d.ts | 7 +- types/react-virtualized/dist/es/Table.d.ts | 6 +- .../dist/es/WindowScroller.d.ts | 2 +- types/react-virtualized/index.d.ts | 3 +- .../react-virtualized-tests.tsx | 1644 +++++++---------- types/react-virtualized/tsconfig.json | 8 +- 8 files changed, 701 insertions(+), 982 deletions(-) diff --git a/types/react-virtualized/dist/es/CellMeasurer.d.ts b/types/react-virtualized/dist/es/CellMeasurer.d.ts index 5c56332964..51f0b4b07d 100644 --- a/types/react-virtualized/dist/es/CellMeasurer.d.ts +++ b/types/react-virtualized/dist/es/CellMeasurer.d.ts @@ -29,15 +29,15 @@ export class CellMeasurerCache implements CellMeasurerCacheInterface { constructor(params?: CellMeasurerCacheParams); clear(rowIndex: number, columnIndex: number): void; clearAll(): void; - columnWidth: (params: { index: number }) => number | undefined; + columnWidth: (params: { index: number }) => number; readonly defaultHeight: number; readonly defaultWidth: number; hasFixedHeight(): boolean; hasFixedWidth(): boolean; - getHeight(rowIndex: number, columnIndex: number): number | undefined; - getWidth(rowIndex: number, columnIndex: number): number | undefined; + getHeight(rowIndex: number, columnIndex: number): number; + getWidth(rowIndex: number, columnIndex: number): number; has(rowIndex: number, columnIndex: number): boolean; - rowHeight: (params: { index: number }) => number | undefined; + rowHeight: (params: { index: number }) => number; set( rowIndex: number, columnIndex: number, diff --git a/types/react-virtualized/dist/es/Collection.d.ts b/types/react-virtualized/dist/es/Collection.d.ts index d813e397f9..4f353d20fc 100644 --- a/types/react-virtualized/dist/es/Collection.d.ts +++ b/types/react-virtualized/dist/es/Collection.d.ts @@ -29,8 +29,9 @@ export type CollectionCellGroupRenderer = ( ) => React.ReactNode[]; export type CollectionCellRendererParams = { index: number; - key: string; - style?: React.CSSProperties; + isScrolling: boolean; + key: number; + style: React.CSSProperties; }; export type CollectionCellRenderer = ( params: CollectionCellRendererParams diff --git a/types/react-virtualized/dist/es/Grid.d.ts b/types/react-virtualized/dist/es/Grid.d.ts index a543521b7a..86055132aa 100644 --- a/types/react-virtualized/dist/es/Grid.d.ts +++ b/types/react-virtualized/dist/es/Grid.d.ts @@ -54,12 +54,7 @@ export type ScrollParams = { scrollTop: number; scrollWidth: number; }; -export type SectionRenderedParams = { - columnStartIndex: number; - columnStopIndex: number; - rowStartIndex: number; - rowStopIndex: number; -}; +export type SectionRenderedParams = RenderedSection; export type SCROLL_DIRECTION_HORIZONTAL = "horizontal"; export type SCROLL_DIRECTION_VERTICAL = "vertical"; export type OverscanIndicesGetterParams = { diff --git a/types/react-virtualized/dist/es/Table.d.ts b/types/react-virtualized/dist/es/Table.d.ts index 571f67a371..c3e5c1478d 100644 --- a/types/react-virtualized/dist/es/Table.d.ts +++ b/types/react-virtualized/dist/es/Table.d.ts @@ -208,9 +208,7 @@ export type TableProps = GridCoreProps & { */ autoHeight?: boolean; /** One or more Columns describing the data displayed in this row */ - children?: - | React.ReactElement[] - | React.ReactElement; + children?: React.ReactNode; /** Optional CSS class name */ className?: string; /** Disable rendering the header at all */ @@ -372,7 +370,7 @@ export const SortDirection: SortDirectionStatic; export type SortDirectionType = "ASC" | "DESC"; export const SortIndicator: React.StatelessComponent<{ - sortDirection: SortDirectionType; + sortDirection?: SortDirectionType; }>; /** diff --git a/types/react-virtualized/dist/es/WindowScroller.d.ts b/types/react-virtualized/dist/es/WindowScroller.d.ts index 723862485f..628d58744d 100644 --- a/types/react-virtualized/dist/es/WindowScroller.d.ts +++ b/types/react-virtualized/dist/es/WindowScroller.d.ts @@ -22,7 +22,7 @@ export type WindowScrollerProps = { */ children: ( params: { - onChildScroll: ({ scrollTop: number }) => void; + onChildScroll: (params: { scrollTop: number }) => void; registerChild: (params?: Element) => void; height: number; isScrolling: boolean; diff --git a/types/react-virtualized/index.d.ts b/types/react-virtualized/index.d.ts index 7c6b5d11fb..c5a1a60aaa 100644 --- a/types/react-virtualized/index.d.ts +++ b/types/react-virtualized/index.d.ts @@ -118,7 +118,8 @@ export { TableHeaderRowRenderer, TableProps, TableRowProps, - TableRowRenderer + TableRowRenderer, + SortParams } from "./dist/es/Table"; export { WindowScroller, diff --git a/types/react-virtualized/react-virtualized-tests.tsx b/types/react-virtualized/react-virtualized-tests.tsx index f11fa644f5..e4bfd5228a 100644 --- a/types/react-virtualized/react-virtualized-tests.tsx +++ b/types/react-virtualized/react-virtualized-tests.tsx @@ -1,38 +1,52 @@ -import * as React from 'react'; -import { PureComponent } from 'react' -import { ArrowKeyStepper, AutoSizer, Grid } from 'react-virtualized' +import * as React from "react"; +import { PureComponent } from "react"; +import { + ArrowKeyStepper, + AutoSizer, + Grid, + Index, + CollectionCellRendererParams, + IndexRange, + CellMeasurerProps, + Size, + TableHeaderProps +} from "react-virtualized"; export class ArrowKeyStepperExample extends PureComponent { - constructor(props) { - super(props) - - this._getColumnWidth = this._getColumnWidth.bind(this) - this._getRowHeight = this._getRowHeight.bind(this) - this._cellRenderer = this._cellRenderer.bind(this) - } - render() { - const { mode } = this.state + const { mode } = this.state; return ( - {({ onSectionRendered, scrollToColumn, scrollToRow }) => (

    - {({ width }) => ( this._cellRenderer({ columnIndex, key, rowIndex, scrollToColumn, scrollToRow, style })} + cellRenderer={({ + columnIndex, + key, + rowIndex, + style + }) => + this._cellRenderer({ + columnIndex, + key, + rowIndex, + scrollToColumn, + scrollToRow, + style + }) + } rowHeight={this._getRowHeight} rowCount={100} scrollToColumn={scrollToColumn} @@ -44,49 +58,45 @@ export class ArrowKeyStepperExample extends PureComponent {
    )} - ) + ); } - _getColumnWidth({ index }) { - return (1 + (index % 3)) * 60 + _getColumnWidth({ index }: Index) { + return (1 + index % 3) * 60; } - _getRowHeight({ index }) { - return (1 + (index % 3)) * 30 + _getRowHeight({ index }: Index) { + return (1 + index % 3) * 30; } - _cellRenderer({ columnIndex, key, rowIndex, scrollToColumn, scrollToRow, style }) { - + _cellRenderer({ + columnIndex, + key, + rowIndex, + scrollToColumn, + scrollToRow, + style + }: any) { return ( -
    +
    {`r:${rowIndex}, c:${columnIndex}`}
    - ) + ); } } -import { List } from 'react-virtualized' +import { List } from "react-virtualized"; export class AutoSizerExample extends PureComponent { - constructor(props) { - super(props) - - this._rowRenderer = this._rowRenderer.bind(this) - } - render() { - const { list } = this.context - const { hideDescription } = this.state + const { list } = this.context; + const { hideDescription } = this.state; return ( {({ width, height }) => ( { /> )} - ) + ); } - _rowRenderer({ index, key, style }) { - const { list } = this.context - const row = list.get(index) + _rowRenderer({ index, key, style }: any) { + const { list } = this.context; + const row = list.get(index); return ( -
    +
    {row.name}
    - ) + ); } } -import { } from 'react' -import { CellMeasurer, CellMeasurerCache, ListRowProps } from 'react-virtualized' +import {} from "react"; +import { + CellMeasurer, + CellMeasurerCache, + ListRowProps +} from "react-virtualized"; export class DynamicHeightList extends PureComponent { + _cache: CellMeasurerCache; - _cache: CellMeasurerCache - - constructor(props, context) { - super(props, context) + constructor(props: any, context: any) { + super(props, context); this._cache = new CellMeasurerCache({ fixedWidth: true, minHeight: 50 - }) - - this._rowRenderer = this._rowRenderer.bind(this) + }); } render() { - const { width } = this.props + const { width } = this.props; return ( { rowRenderer={this._rowRenderer} width={width} /> - ) + ); } _rowRenderer({ index, isScrolling, key, parent, style }: ListRowProps) { - const { getClassName, list } = this.props + const { getClassName, list } = this.props; - const datum = list.get(index % list.size) - const classNames = getClassName({ columnIndex: 0, rowIndex: index }) + const datum = list.get(index % list.size); + const classNames = getClassName({ columnIndex: 0, rowIndex: index }); - const imageWidth = 300 - const imageHeight = datum.size * 2 + const imageWidth = 300; + const imageHeight = datum.size * 2; - const source = `http://fillmurray.com/${imageWidth}/${imageHeight}` + const source = `http://fillmurray.com/${imageWidth}/${imageHeight}`; return ( { parent={parent} > {({ measure }) => ( -
    +
    {
    )} - ) + ); } } -import { Collection } from 'react-virtualized' +import { Collection } from "react-virtualized"; // Defines a pattern of sizes and positions for a range of 10 rotating cells // These cells cover an area of 600 (wide) x 400 (tall) -const GUTTER_SIZE = 3 -const CELL_WIDTH = 75 +const GUTTER_SIZE = 3; +const CELL_WIDTH = 75; export class CollectionExample extends PureComponent { _columnYMap: any; - constructor(props, context) { - super(props, context) + constructor(props: any, context: any) { + super(props, context); this.context = context; @@ -209,22 +213,20 @@ export class CollectionExample extends PureComponent { scrollToCell: undefined, showScrollingPlaceholder: false, verticalOverscanSize: 0 - } + }; - this._columnYMap = [] - - this._cellRenderer = this._cellRenderer.bind(this) - this._cellSizeAndPositionGetter = this._cellSizeAndPositionGetter.bind(this) - this._noContentRenderer = this._noContentRenderer.bind(this) - this._onCellCountChange = this._onCellCountChange.bind(this) - this._onHeightChange = this._onHeightChange.bind(this) - this._onHorizontalOverscanSizeChange = this._onHorizontalOverscanSizeChange.bind(this) - this._onScrollToCellChange = this._onScrollToCellChange.bind(this) - this._onVerticalOverscanSizeChange = this._onVerticalOverscanSizeChange.bind(this) + this._columnYMap = []; } render() { - const { cellCount, height, horizontalOverscanSize, scrollToCell, showScrollingPlaceholder, verticalOverscanSize } = this.state + const { + cellCount, + height, + horizontalOverscanSize, + scrollToCell, + showScrollingPlaceholder, + verticalOverscanSize + } = this.state; return ( @@ -232,8 +234,10 @@ export class CollectionExample extends PureComponent { { /> )} - ) + ); } - _cellRenderer({ index, isScrolling, key, style }) { - const { list } = this.context - const { showScrollingPlaceholder } = this.state + _cellRenderer({ + index, + isScrolling, + key, + style + }: CollectionCellRendererParams) { + const { list } = this.context; + const { showScrollingPlaceholder } = this.state; - const datum = list.get(index % list.size) - - // Customize style - style.backgroundColor = datum.color + const datum = list.get(index % list.size); return ( -
    - {showScrollingPlaceholder && isScrolling ? '...' : index} +
    + {showScrollingPlaceholder && isScrolling ? "..." : index}
    - ) + ); } - _cellSizeAndPositionGetter({ index }) { - const { list } = this.context - const { columnCount } = this.state + _cellSizeAndPositionGetter({ index }: Index) { + const { list } = this.context; + const { columnCount } = this.state; - const columnPosition = index % (columnCount || 1) - const datum = list.get(index % list.size) + const columnPosition = index % (columnCount || 1); + const datum = list.get(index % list.size); // Poor man's Masonry layout; columns won't all line up equally with the bottom. - const height = datum.size - const width = CELL_WIDTH - const x = columnPosition * (GUTTER_SIZE + width) - const y = this._columnYMap[columnPosition] || 0 + const height = datum.size; + const width = CELL_WIDTH; + const x = columnPosition * (GUTTER_SIZE + width); + const y = this._columnYMap[columnPosition] || 0; - this._columnYMap[columnPosition] = y + height + GUTTER_SIZE + this._columnYMap[columnPosition] = y + height + GUTTER_SIZE; return { height, width, x, y - } + }; } - _getColumnCount(cellCount) { - return Math.round(Math.sqrt(cellCount)) - } - - _onHorizontalOverscanSizeChange(event) { - const horizontalOverscanSize = parseInt(event.target.value, 10) || 0 - - this.setState({ horizontalOverscanSize }) + _getColumnCount(cellCount: number) { + return Math.round(Math.sqrt(cellCount)); } _noContentRenderer() { - return ( -
    - No cells -
    - ) - } - - _onCellCountChange(event) { - const cellCount = parseInt(event.target.value, 10) || 0 - - this._columnYMap = [] - - this.setState({ - cellCount, - columnCount: this._getColumnCount(cellCount) - }) - } - - _onHeightChange(event) { - const height = parseInt(event.target.value, 10) || 0 - - this.setState({ height }) - } - - _onScrollToCellChange(event) { - const { cellCount } = this.state - - let scrollToCell = Math.min(cellCount - 1, parseInt(event.target.value, 10)) - - if (isNaN(scrollToCell)) { - scrollToCell = undefined - } - - this.setState({ scrollToCell }) - } - - _onVerticalOverscanSizeChange(event) { - const verticalOverscanSize = parseInt(event.target.value, 10) || 0 - - this.setState({ verticalOverscanSize }) + return
    No cells
    ; } } -import { ColumnSizer } from 'react-virtualized' +import { ColumnSizer } from "react-virtualized"; export class ColumnSizerExample extends PureComponent { - constructor(props) { - super(props) - - this._noColumnMaxWidthChange = this._noColumnMaxWidthChange.bind(this) - this._noColumnMinWidthChange = this._noColumnMinWidthChange.bind(this) - this._onColumnCountChange = this._onColumnCountChange.bind(this) - this._noContentRenderer = this._noContentRenderer.bind(this) - this._cellRenderer = this._cellRenderer.bind(this) - } - render() { - const { - columnMaxWidth, - columnMinWidth, - columnCount - } = this.state + const { columnMaxWidth, columnMinWidth, columnCount } = this.state; return (
    @@ -371,12 +314,16 @@ export class ColumnSizerExample extends PureComponent { columnMaxWidth={columnMaxWidth} columnMinWidth={columnMinWidth} columnCount={columnCount} - key='GridColumnSizer' + key="GridColumnSizer" width={width} > - {({ adjustedWidth, getColumnWidth, registerChild }) => ( + {({ + adjustedWidth, + getColumnWidth, + registerChild + }) => (
    { columnWidth={getColumnWidth} columnCount={columnCount} height={50} - noContentRenderer={this._noContentRenderer} + noContentRenderer={ + this._noContentRenderer + } cellRenderer={this._cellRenderer} rowHeight={50} rowCount={1} @@ -399,82 +348,37 @@ export class ColumnSizerExample extends PureComponent { )}
    - ) - } - - _noColumnMaxWidthChange(event) { - let columnMaxWidth = parseInt(event.target.value, 10) - - columnMaxWidth = isNaN(columnMaxWidth) ? undefined : Math.min(1000, columnMaxWidth) - - this.setState({ columnMaxWidth }) - } - - _noColumnMinWidthChange(event) { - let columnMinWidth = parseInt(event.target.value, 10) - - columnMinWidth = isNaN(columnMinWidth) ? undefined : Math.max(1, columnMinWidth) - - this.setState({ columnMinWidth }) - } - - _onColumnCountChange(event) { - this.setState({ columnCount: parseInt(event.target.value, 10) || 0 }) + ); } _noContentRenderer() { - return ( -
    - No cells -
    - ) + return
    No cells
    ; } - _cellRenderer({ columnIndex, key, rowIndex, style }) { - const className = columnIndex === 0 - ? 'styles.firstCell' - : 'styles.cell' + _cellRenderer({ columnIndex, key, rowIndex, style }: GridCellProps) { + const className = + columnIndex === 0 ? "styles.firstCell" : "styles.cell"; return ( -
    +
    {`R:${rowIndex}, C:${columnIndex}`}
    - ) + ); } } export class GridExample extends PureComponent { - constructor(props, context) { - super(props, context) - - this.state = { - columnCount: 1000, - height: 300, - overscanColumnCount: 0, - overscanRowCount: 10, - rowHeight: 40, - rowCount: 1000, - scrollToColumn: undefined, - scrollToRow: undefined, - useDynamicRowHeight: false - } - - this._cellRenderer = this._cellRenderer.bind(this) - this._getColumnWidth = this._getColumnWidth.bind(this) - this._getRowClassName = this._getRowClassName.bind(this) - this._getRowHeight = this._getRowHeight.bind(this) - this._noContentRenderer = this._noContentRenderer.bind(this) - this._onColumnCountChange = this._onColumnCountChange.bind(this) - this._onRowCountChange = this._onRowCountChange.bind(this) - this._onScrollToColumnChange = this._onScrollToColumnChange.bind(this) - this._onScrollToRowChange = this._onScrollToRowChange.bind(this) - this._renderBodyCell = this._renderBodyCell.bind(this) - this._renderLeftSideCell = this._renderLeftSideCell.bind(this) - } + state = { + columnCount: 1000, + height: 300, + overscanColumnCount: 0, + overscanRowCount: 10, + rowHeight: 40, + rowCount: 1000, + scrollToColumn: undefined, + scrollToRow: undefined, + useDynamicRowHeight: false + }; render() { const { @@ -487,22 +391,23 @@ export class GridExample extends PureComponent { scrollToColumn, scrollToRow, useDynamicRowHeight - } = this.state + } = this.state; return ( - {({ width }) => ( { /> )} - ) + ); } - _cellRenderer({ columnIndex, key, rowIndex, style }) { - if (columnIndex === 0) { - return this._renderLeftSideCell({ key, rowIndex, style }) + _cellRenderer(params: GridCellProps) { + if (params.columnIndex === 0) { + return this._renderLeftSideCell(params); } else { - return this._renderBodyCell({ columnIndex, key, rowIndex, style }) + return this._renderBodyCell(params); } } - _getColumnWidth({ index }) { + _getColumnWidth({ index }: Index) { switch (index) { case 0: - return 50 + return 50; case 1: - return 100 + return 100; case 2: - return 300 + return 300; default: - return 80 + return 80; } } - _getDatum(index) { - const { list } = this.context + _getDatum(index: number) { + const { list } = this.context; - return list.get(index % list.size) + return list.get(index % list.size); } - _getRowClassName(row) { - return row % 2 === 0 ? 'styles.evenRow' : 'styles.oddRow' + _getRowClassName(row: number) { + return row % 2 === 0 ? "styles.evenRow" : "styles.oddRow"; } - _getRowHeight({ index }) { - return this._getDatum(index).size + _getRowHeight({ index }: Index) { + return this._getDatum(index).size; } _noContentRenderer() { - return ( -
    - No cells -
    - ) + return
    No cells
    ; } - _renderBodyCell({ columnIndex, key, rowIndex, style }) { - const rowClass = this._getRowClassName(rowIndex) - const datum = this._getDatum(rowIndex) + _renderBodyCell({ columnIndex, key, rowIndex, style }: GridCellProps) { + const rowClass = this._getRowClassName(rowIndex); + const datum = this._getDatum(rowIndex); - let content + let content; switch (columnIndex) { case 1: - content = datum.name - break + content = datum.name; + break; case 2: - content = datum.random - break + content = datum.random; + break; default: - content = `r:${rowIndex}, c:${columnIndex}` - break + content = `r:${rowIndex}, c:${columnIndex}`; + break; } return ( -
    +
    {content}
    - ) + ); } - _renderLeftSideCell({ key, rowIndex, style }) { - const datum = this._getDatum(rowIndex) + _renderLeftSideCell({ key, rowIndex, style }: GridCellProps) { + const datum = this._getDatum(rowIndex); // Don't modify styles. // These are frozen by React now (as of 16.0.0). @@ -594,84 +491,31 @@ export class GridExample extends PureComponent { style = { ...style, backgroundColor: datum.color - } + }; return ( -
    +
    {datum.name.charAt(0)}
    - ) - } - - _updateUseDynamicRowHeights(value) { - this.setState({ - useDynamicRowHeight: value - }) - } - - _onColumnCountChange(event) { - const columnCount = parseInt(event.target.value, 10) || 0 - - this.setState({ columnCount }) - } - - _onRowCountChange(event) { - const rowCount = parseInt(event.target.value, 10) || 0 - - this.setState({ rowCount }) - } - - _onScrollToColumnChange(event) { - const { columnCount } = this.state - let scrollToColumn = Math.min(columnCount - 1, parseInt(event.target.value, 10)) - - if (isNaN(scrollToColumn)) { - scrollToColumn = undefined - } - - this.setState({ scrollToColumn }) - } - - _onScrollToRowChange(event) { - const { rowCount } = this.state - let scrollToRow = Math.min(rowCount - 1, parseInt(event.target.value, 10)) - - if (isNaN(scrollToRow)) { - scrollToRow = undefined - } - - this.setState({ scrollToRow }) + ); } } -import { InfiniteLoader } from 'react-virtualized' +import { InfiniteLoader } from "react-virtualized"; -const STATUS_LOADING = 1 -const STATUS_LOADED = 2 +const STATUS_LOADING = 1; +const STATUS_LOADED = 2; export class InfiniteLoaderExample extends PureComponent { _timeoutIds = new Set(); - constructor(props) { - super(props) - - this._clearData = this._clearData.bind(this) - this._isRowLoaded = this._isRowLoaded.bind(this) - this._loadMoreRows = this._loadMoreRows.bind(this) - this._rowRenderer = this._rowRenderer.bind(this) - } - componentWillUnmount() { this._timeoutIds.forEach(clearTimeout); } render() { - const { list } = this.context - const { loadedRowCount, loadingRowCount } = this.state + const { list } = this.context; + const { loadedRowCount, loadingRowCount } = this.state; return ( { {({ width }) => ( { )} - ) + ); } - _clearData() { - this.setState({ - loadedRowCount: 0, - loadedRowsMap: {}, - loadingRowCount: 0 - }) + _isRowLoaded({ index }: Index) { + const { loadedRowsMap } = this.state; + return !!loadedRowsMap[index]; // STATUS_LOADING or STATUS_LOADED } - _isRowLoaded({ index }) { - const { loadedRowsMap } = this.state - return !!loadedRowsMap[index] // STATUS_LOADING or STATUS_LOADED - } - - _loadMoreRows({ startIndex, stopIndex }) { - const { loadedRowsMap, loadingRowCount } = this.state - const increment = stopIndex - startIndex + 1 + _loadMoreRows({ startIndex, stopIndex }: IndexRange) { + const { loadedRowsMap, loadingRowCount } = this.state; + const increment = stopIndex - startIndex + 1; for (let i = startIndex; i <= stopIndex; i++) { - loadedRowsMap[i] = STATUS_LOADING + loadedRowsMap[i] = STATUS_LOADING; } this.setState({ loadingRowCount: loadingRowCount + increment - }) + }); const timeoutId = setTimeout(() => { - const { loadedRowCount, loadingRowCount } = this.state + const { loadedRowCount, loadingRowCount } = this.state; this._timeoutIds.delete(timeoutId); for (let i = startIndex; i <= stopIndex; i++) { - loadedRowsMap[i] = STATUS_LOADED + loadedRowsMap[i] = STATUS_LOADED; } this.setState({ loadingRowCount: loadingRowCount - increment, loadedRowCount: loadedRowCount + increment - }) + }); - promiseResolver() - }, 1000 + Math.round(Math.random() * 2000)) + promiseResolver(); + }, 1000 + Math.round(Math.random() * 2000)); this._timeoutIds.add(timeoutId); - let promiseResolver + let promiseResolver: () => void; return new Promise(resolve => { - promiseResolver = resolve - }) + promiseResolver = resolve; + }); } - _rowRenderer({ index, key, style }) { - const { list } = this.context - const { loadedRowsMap } = this.state + _rowRenderer({ index, key, style }: ListRowProps) { + const { list } = this.context; + const { loadedRowsMap } = this.state; - const row = list.get(index) - let content + const row = list.get(index); + let content; if (loadedRowsMap[index] === STATUS_LOADED) { - content = row.name + content = row.name; } else { content = (
    - ) + ); } return ( -
    +
    {content}
    - ) + ); } } export class ListExample extends PureComponent { - - constructor(props, context) { - super(props, context) + constructor(props: any, context: any) { + super(props, context); this.state = { listHeight: 300, @@ -793,13 +624,7 @@ export class ListExample extends PureComponent { scrollToIndex: undefined, showScrollingPlaceholder: false, useDynamicRowHeight: false - } - - this._getRowHeight = this._getRowHeight.bind(this) - this._noRowsRenderer = this._noRowsRenderer.bind(this) - this._onRowCountChange = this._onRowCountChange.bind(this) - this._onScrollToRowChange = this._onScrollToRowChange.bind(this) - this._rowRenderer = this._rowRenderer.bind(this) + }; } render() { @@ -811,107 +636,84 @@ export class ListExample extends PureComponent { scrollToIndex, showScrollingPlaceholder, useDynamicRowHeight - } = this.state + } = this.state; return ( {({ width }) => ( )} - ) + ); } - _getDatum(index) { - const { list } = this.context + _getDatum(index: number) { + const { list } = this.context; - return list.get(index % list.size) + return list.get(index % list.size); } - _getRowHeight({ index }) { - return this._getDatum(index).size + _getRowHeight({ index }: Index) { + return this._getDatum(index).size; } _noRowsRenderer() { - return ( -
    - No rows -
    - ) + return
    No rows
    ; } - _onRowCountChange(event) { - const rowCount = parseInt(event.target.value, 10) || 0 + _rowRenderer({ index, isScrolling, key, style }: ListRowProps) { + const { showScrollingPlaceholder, useDynamicRowHeight } = this.state; - this.setState({ rowCount }) - } - - _onScrollToRowChange(event) { - const { rowCount } = this.state - let scrollToIndex = Math.min(rowCount - 1, parseInt(event.target.value, 10)) - - if (isNaN(scrollToIndex)) { - scrollToIndex = undefined - } - - this.setState({ scrollToIndex }) - } - - _rowRenderer({ index, isScrolling, key, style }) { - const { - showScrollingPlaceholder, - useDynamicRowHeight - } = this.state - - if ( - showScrollingPlaceholder && - isScrolling - ) { + if (showScrollingPlaceholder && isScrolling) { return (
    Scrolling... -
    - ) +
    + ); } - const datum = this._getDatum(index) + const datum = this._getDatum(index); - let additionalContent + let additionalContent; if (useDynamicRowHeight) { switch (datum.size) { case 75: - additionalContent =
    It is medium-sized.
    - break + additionalContent =
    It is medium-sized.
    ; + break; case 100: - additionalContent =
    It is large-sized.
    It has a 3rd row.
    - break + additionalContent = ( +
    + It is large-sized.
    It has a 3rd row. +
    + ); + break; } } return ( -
    +
    { {datum.name.charAt(0)}
    -
    - {datum.name} -
    -
    - This is row {index} -
    +
    {datum.name}
    +
    This is row {index}
    {additionalContent}
    - {useDynamicRowHeight && - - {datum.size}px - - } + {useDynamicRowHeight && ( + {datum.size}px + )}
    - ) + ); } } @@ -943,43 +739,43 @@ import { Positioner, Masonry, MasonryCellProps -} from 'react-virtualized' +} from "react-virtualized"; export class GridExample2 extends PureComponent { _columnCount: number; _cache: CellMeasurerCache; _columnHeights: any; - _width: number; - _height: number; - _scrollTop: number; - _cellPositioner?: Positioner; + _width = 0; + _height = 0; + _scrollTop?: number; + _cellPositioner: Positioner; _masonry: Masonry; - constructor(props, context) { - super(props, context) + constructor(props: any, context: any) { + super(props, context); - this._columnCount = 0 + this._columnCount = 0; this._cache = new CellMeasurerCache({ defaultHeight: 250, defaultWidth: 200, fixedWidth: true - }) + }); - this._columnHeights = {} + this._columnHeights = {}; this.state = { columnWidth: 200, height: 300, gutterSize: 10, windowScrollerEnabled: false - } + }; - this._cellRenderer = this._cellRenderer.bind(this) - this._onResize = this._onResize.bind(this) - this._renderAutoSizer = this._renderAutoSizer.bind(this) - this._renderMasonry = this._renderMasonry.bind(this) - this._setMasonryRef = this._setMasonryRef.bind(this) + this._cellRenderer = this._cellRenderer.bind(this); + this._onResize = this._onResize.bind(this); + this._renderAutoSizer = this._renderAutoSizer.bind(this); + this._renderMasonry = this._renderMasonry.bind(this); + this._setMasonryRef = this._setMasonryRef.bind(this); } render() { @@ -988,41 +784,30 @@ export class GridExample2 extends PureComponent { height, gutterSize, windowScrollerEnabled - } = this.state + } = this.state; - let child + const child = windowScrollerEnabled ? ( + {this._renderAutoSizer} + ) : ( + this._renderAutoSizer({ height }) + ); - if (windowScrollerEnabled) { - child = ( - - {this._renderAutoSizer} - - ) - } else { - child = this._renderAutoSizer({ height }) - } - - return ( -
    - {child} -
    - ) + return
    {child}
    ; } _calculateColumnCount() { - const { - columnWidth, - gutterSize - } = this.state + const { columnWidth, gutterSize } = this.state; - this._columnCount = Math.floor(this._width / (columnWidth + gutterSize)) + this._columnCount = Math.floor( + this._width / (columnWidth + gutterSize) + ); } _cellRenderer({ index, key, parent, style }: MasonryCellProps) { - const { list } = this.context - const { columnWidth } = this.state + const { list } = this.context; + const { columnWidth } = this.state; - const datum = list.get(index % list.size) + const datum = list.get(index % list.size); return ( { parent={parent} >
    {
    {datum.random}
    - ) + ); } _initCellPositioner() { - if (typeof this._cellPositioner === 'undefined') { - const { - columnWidth, - gutterSize - } = this.state + if (typeof this._cellPositioner === "undefined") { + const { columnWidth, gutterSize } = this.state; this._cellPositioner = createCellPositioner({ cellMeasurerCache: this._cache, columnCount: this._columnCount, columnWidth, spacer: gutterSize - }) + }); } } - _onResize({ height, width }) { - this._width = width + _onResize({ height, width }: Size) { + this._width = width; - this._columnHeights = {} - this._calculateColumnCount() - this._resetCellPositioner() - this._masonry.recomputeCellPositions() + this._columnHeights = {}; + this._calculateColumnCount(); + this._resetCellPositioner(); + this._masonry.recomputeCellPositions(); } - _renderAutoSizer({ height, scrollTop }: { height: number, scrollTop?: number }) { - this._height = height - this._scrollTop = scrollTop + _renderAutoSizer({ + height, + scrollTop + }: { + height: number; + scrollTop?: number; + }) { + this._height = height; + this._scrollTop = scrollTop; return ( - + {this._renderMasonry} - ) + ); } - _renderMasonry({ width }) { - this._width = width + _renderMasonry({ width }: Size) { + this._width = width; - this._calculateColumnCount() - this._initCellPositioner() + this._calculateColumnCount(); + this._initCellPositioner(); - const { height, windowScrollerEnabled } = this.state + const { height, windowScrollerEnabled } = this.state; return ( { scrollTop={this._scrollTop} width={width} /> - ) + ); } _resetCellPositioner() { - const { - columnWidth, - gutterSize - } = this.state + const { columnWidth, gutterSize } = this.state; this._cellPositioner.reset({ columnCount: this._columnCount, columnWidth, spacer: gutterSize - }) + }); } - _setMasonryRef(ref) { - this._masonry = ref + _setMasonryRef(ref: any) { + this._masonry = ref; } } -import { MultiGrid } from 'react-virtualized' +import { MultiGrid } from "react-virtualized"; const STYLE: React.CSSProperties = { - border: '1px solid #ddd', - overflow: 'hidden' -} + border: "1px solid #ddd", + overflow: "hidden" +}; const STYLE_BOTTOM_LEFT_GRID: React.CSSProperties = { - borderRight: '2px solid #aaa', - backgroundColor: '#f7f7f7' -} + borderRight: "2px solid #aaa", + backgroundColor: "#f7f7f7" +}; const STYLE_TOP_LEFT_GRID: React.CSSProperties = { - borderBottom: '2px solid #aaa', - borderRight: '2px solid #aaa', - fontWeight: 'bold' -} + borderBottom: "2px solid #aaa", + borderRight: "2px solid #aaa", + fontWeight: "bold" +}; const STYLE_TOP_RIGHT_GRID: React.CSSProperties = { - borderBottom: '2px solid #aaa', - fontWeight: 'bold' -} + borderBottom: "2px solid #aaa", + fontWeight: "bold" +}; export class MultiGridExample extends PureComponent<{}, any> { - state - _onFixedColumnCountChange - _onFixedRowCountChange - _onScrollToColumnChange - _onScrollToRowChange - - constructor(props, context) { - super(props, context) - - this.state = { - fixedColumnCount: 2, - fixedRowCount: 1, - scrollToColumn: 0, - scrollToRow: 0 - } - - this._cellRenderer = this._cellRenderer.bind(this) - this._onFixedColumnCountChange = this._createEventHandler('fixedColumnCount') - this._onFixedRowCountChange = this._createEventHandler('fixedRowCount') - this._onScrollToColumnChange = this._createEventHandler('scrollToColumn') - this._onScrollToRowChange = this._createEventHandler('scrollToRow') - } + state = { + fixedColumnCount: 2, + fixedRowCount: 1, + scrollToColumn: 0, + scrollToRow: 0 + }; render() { return ( @@ -1197,72 +963,38 @@ export class MultiGridExample extends PureComponent<{}, any> { /> )} - ) + ); } - _cellRenderer({ columnIndex, key, rowIndex, style }) { + _cellRenderer({ columnIndex, key, rowIndex, style }: GridCellProps) { return ( -
    +
    {columnIndex}, {rowIndex}
    - ) - } - - _createEventHandler(property) { - return (event) => { - const value = parseInt(event.target.value, 10) || 0 - - this.setState({ - [property]: value - }) - } - } - - _createLabeledInput(property, eventHandler) { - const value = this.state[property] - - return ( - `` - ) + ); } } -import { ScrollSync } from 'react-virtualized' +import { ScrollSync } from "react-virtualized"; -const LEFT_COLOR_FROM = hexToRgb('#471061') -const LEFT_COLOR_TO = hexToRgb('#BC3959') -const TOP_COLOR_FROM = hexToRgb('#000000') -const TOP_COLOR_TO = hexToRgb('#333333') +const LEFT_COLOR_FROM = hexToRgb("#471061"); +const LEFT_COLOR_TO = hexToRgb("#BC3959"); +const TOP_COLOR_FROM = hexToRgb("#000000"); +const TOP_COLOR_TO = hexToRgb("#333333"); -function scrollbarSize() { return 42; } +function scrollbarSize() { + return 42; +} export class GridExample3 extends PureComponent<{}, any> { - state - constructor(props, context) { - super(props, context) - - this.state = { - columnWidth: 75, - columnCount: 50, - height: 300, - overscanColumnCount: 0, - overscanRowCount: 5, - rowHeight: 40, - rowCount: 100 - } - - this._renderBodyCell = this._renderBodyCell.bind(this) - this._renderHeaderCell = this._renderHeaderCell.bind(this) - this._renderLeftSideCell = this._renderLeftSideCell.bind(this) - } + state = { + columnWidth: 75, + columnCount: 50, + height: 300, + overscanColumnCount: 0, + overscanRowCount: 5, + rowHeight: 40, + rowCount: 100 + }; render() { const { @@ -1273,37 +1005,60 @@ export class GridExample3 extends PureComponent<{}, any> { overscanRowCount, rowHeight, rowCount - } = this.state + } = this.state; return ( - - {({ clientHeight, clientWidth, onScroll, scrollHeight, scrollLeft, scrollTop, scrollWidth }) => { - const x = scrollLeft / (scrollWidth - clientWidth) - const y = scrollTop / (scrollHeight - clientHeight) + {({ + clientHeight, + clientWidth, + onScroll, + scrollHeight, + scrollLeft, + scrollTop, + scrollWidth + }) => { + const x = scrollLeft / (scrollWidth - clientWidth); + const y = scrollTop / (scrollHeight - clientHeight); - const leftBackgroundColor = mixColors(LEFT_COLOR_FROM, LEFT_COLOR_TO, y) - const leftColor = '#ffffff' - const topBackgroundColor = mixColors(TOP_COLOR_FROM, TOP_COLOR_TO, x) - const topColor = '#ffffff' - const middleBackgroundColor = mixColors(leftBackgroundColor, topBackgroundColor, 0.5) - const middleColor = '#ffffff' + const leftBackgroundColor = mixColors( + LEFT_COLOR_FROM, + LEFT_COLOR_TO, + y + ); + const leftColor = "#ffffff"; + const topBackgroundColor = mixColors( + TOP_COLOR_FROM, + TOP_COLOR_TO, + x + ); + const topColor = "#ffffff"; + const middleBackgroundColor = mixColors( + leftBackgroundColor, + topBackgroundColor, + 0.5 + ); + const middleColor = "#ffffff"; return ( -
    +
    { />
    { cellRenderer={this._renderLeftSideCell} columnWidth={columnWidth} columnCount={1} - className={'styles.LeftSideGrid'} + className={"styles.LeftSideGrid"} height={height - scrollbarSize()} rowHeight={rowHeight} rowCount={rowCount} @@ -1336,46 +1095,75 @@ export class GridExample3 extends PureComponent<{}, any> { width={columnWidth} />
    -
    +
    {({ width }) => (
    -
    +
    {
    - ) + ); }} - ) + ); } - _renderBodyCell({ columnIndex, key, rowIndex, style }) { - if (columnIndex < 1) { - return + _renderBodyCell(params: GridCellProps) { + if (params.columnIndex < 1) { + return; } - return this._renderLeftSideCell({ columnIndex, key, rowIndex, style }) + return this._renderLeftSideCell(params); } - _renderHeaderCell({ columnIndex, key, rowIndex, style }) { - if (columnIndex < 1) { - return + _renderHeaderCell(params: GridCellProps) { + if (params.columnIndex < 1) { + return; } - return this._renderLeftHeaderCell({ columnIndex, key, rowIndex, style }) + return this._renderLeftHeaderCell(params); } - _renderLeftHeaderCell({ columnIndex, key, rowIndex, style }) { + _renderLeftHeaderCell({ + columnIndex, + key, + rowIndex, + style + }: GridCellProps) { return ( -
    +
    {`C${columnIndex}`}
    - ) + ); } - _renderLeftSideCell({ columnIndex, key, rowIndex, style }) { + _renderLeftSideCell({ columnIndex, key, rowIndex, style }: GridCellProps) { return ( -
    +
    {`R${rowIndex}, C${columnIndex}`}
    - ) + ); } } -function hexToRgb(hex) { - const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex) - return result ? { - r: parseInt(result[1], 16), - g: parseInt(result[2], 16), - b: parseInt(result[3], 16) - } : null +function hexToRgb(hex: string) { + const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); + return result + ? { + r: parseInt(result[1], 16), + g: parseInt(result[2], 16), + b: parseInt(result[3], 16) + } + : null; } /** * Ported from sass implementation in C * https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 */ -function mixColors(color1, color2, amount) { - const weight1 = amount - const weight2 = 1 - amount +function mixColors(color1: any, color2: any, amount: any) { + const weight1 = amount; + const weight2 = 1 - amount; - const r = Math.round(weight1 * color1.r + weight2 * color2.r) - const g = Math.round(weight1 * color1.g + weight2 * color2.g) - const b = Math.round(weight1 * color1.b + weight2 * color2.b) + const r = Math.round(weight1 * color1.r + weight2 * color2.r); + const g = Math.round(weight1 * color1.g + weight2 * color2.g); + const b = Math.round(weight1 * color1.b + weight2 * color2.b); - return { r, g, b } + return { r, g, b }; } -import { Column, Table, SortDirection, SortIndicator } from 'react-virtualized' +import { Column, Table, SortDirection, SortIndicator } from "react-virtualized"; export class TableExample extends PureComponent<{}, any> { - state; - context; - constructor(props, context) { - super(props, context) - - this.state = { - disableHeader: false, - headerHeight: 30, - height: 270, - hideIndexRow: false, - overscanRowCount: 10, - rowHeight: 40, - rowCount: 1000, - scrollToIndex: undefined, - sortBy: 'index', - sortDirection: SortDirection.ASC, - useDynamicRowHeight: false - } - - this._getRowHeight = this._getRowHeight.bind(this) - this._headerRenderer = this._headerRenderer.bind(this) - this._noRowsRenderer = this._noRowsRenderer.bind(this) - this._onRowCountChange = this._onRowCountChange.bind(this) - this._onScrollToRowChange = this._onScrollToRowChange.bind(this) - this._rowClassName = this._rowClassName.bind(this) - this._sort = this._sort.bind(this) - } + state = { + disableHeader: false, + headerHeight: 30, + height: 270, + hideIndexRow: false, + overscanRowCount: 10, + rowHeight: 40, + rowCount: 1000, + scrollToIndex: undefined, + sortBy: "index", + sortDirection: SortDirection.ASC, + useDynamicRowHeight: false + }; render() { const { @@ -1501,35 +1274,32 @@ export class TableExample extends PureComponent<{}, any> { sortBy, sortDirection, useDynamicRowHeight - } = this.state + } = this.state; - const { list } = this.context - const sortedList = this._isSortEnabled() - ? list - .sortBy(item => item[sortBy]) - .update(list => - sortDirection === SortDirection.DESC - ? list.reverse() - : list - ) - : list + const { list } = this.context; + const sortedList = list; - const rowGetter = ({ index }) => this._getDatum(sortedList, index) + const rowGetter = ({ index }: Index) => + this._getDatum(sortedList, index); return (
    {({ width }) => (

    { sortDirection={sortDirection} width={width} > - {!hideIndexRow && + {!hideIndexRow && ( rowData.index - } - dataKey='index' + label="Index" + cellDataGetter={({ + columnData, + dataKey, + rowData + }) => rowData.index} + dataKey="index" disableSort={!this._isSortEnabled()} defaultSortDirection={SortDirection.DESC} width={60} /> - } + )} { cellData - } + label="The description label is really long so that it will be truncated" + dataKey="random" + className={"styles.exampleColumn"} + cellRenderer={({ + cellData, + columnData, + dataKey, + rowData, + rowIndex + }) => cellData} flexGrow={1} />
    )} - ) + ); } - _getDatum(list, index) { - return list.get(index % list.size) + _getDatum(list: any, index: number) { + return list.get(index % list.size); } - _getRowHeight({ index }) { - const { list } = this.context + _getRowHeight({ index }: Index) { + const { list } = this.context; - return this._getDatum(list, index).size + return this._getDatum(list, index).size; } _headerRenderer({ @@ -1592,94 +1368,57 @@ export class TableExample extends PureComponent<{}, any> { label, sortBy, sortDirection - }) { + }: TableHeaderProps) { return (
    Full Name - {sortBy === dataKey && + {sortBy === dataKey && ( - } + )}
    - ) + ); } _isSortEnabled() { - const { list } = this.context - const { rowCount } = this.state + const { list } = this.context; + const { rowCount } = this.state; - return rowCount <= list.size + return rowCount <= list.size; } _noRowsRenderer() { - return ( -
    - No rows -
    - ) + return
    No rows
    ; } - _onRowCountChange(event) { - const rowCount = parseInt(event.target.value, 10) || 0 - - this.setState({ rowCount }) - } - - _onScrollToRowChange(event) { - const { rowCount } = this.state - let scrollToIndex = Math.min(rowCount - 1, parseInt(event.target.value, 10)) - - if (isNaN(scrollToIndex)) { - scrollToIndex = undefined - } - - this.setState({ scrollToIndex }) - } - - _rowClassName({ index }) { + _rowClassName({ index }: Index) { if (index < 0) { - return 'styles.headerRow' + return "styles.headerRow"; } else { - return index % 2 === 0 ? 'styles.evenRow' : 'styles.oddRow' + return index % 2 === 0 ? "styles.evenRow" : "styles.oddRow"; } } - _sort({ sortBy, sortDirection }) { - this.setState({ sortBy, sortDirection }) - } - - _updateUseDynamicRowHeight(value) { - this.setState({ - useDynamicRowHeight: value - }) + _sort({ + sortBy, + sortDirection + }: { + sortBy: string; + sortDirection: SortDirectionType; + }) { + this.setState({ sortBy, sortDirection }); } } -import { TableCellProps } from "react-virtualized" +import { TableCellProps } from "react-virtualized"; export class DynamicHeightTableColumnExample extends PureComponent { - state; - context; - _cache: CellMeasurerCache; - constructor(props, context) { - super(props, context) - - this._cache = new CellMeasurerCache({ - fixedWidth: true, - minHeight: 25 - }) - - this._columnCellRenderer = this._columnCellRenderer.bind(this) - this._rowGetter = this._rowGetter.bind(this) - } - - componentWillReceiveProps(nextProps) { - if (nextProps.width !== this.props.width) { - this._cache.clearAll() - } - } + _cache = new CellMeasurerCache({ + fixedWidth: true, + minHeight: 25 + }); render() { - const { width } = this.props + const { width } = this.props; return ( { headerHeight={20} height={400} overscanRowCount={2} - rowClassName={'styles.tableRow'} + rowClassName={"styles.tableRow"} rowHeight={this._cache.rowHeight} rowGetter={this._rowGetter} rowCount={1000} width={width} >
    - ) + ); } _columnCellRenderer(args: TableCellProps) { - const { list } = this.props + const { list } = this.props; - const datum = list.get(args.rowIndex % list.size) - const content = args.rowIndex % 5 === 0 - ? '' - : datum.randomLong + const datum = list.get(args.rowIndex % list.size); + const content = args.rowIndex % 5 === 0 ? "" : datum.randomLong; return ( { rowIndex={args.rowIndex} >
    {content}
    - ) + ); } - _rowGetter({ index }) { - const { list } = this.props + _rowGetter({ index }: Index) { + const { list } = this.props; - return list.get(index % list.size) + return list.get(index % list.size); } } export class WindowScrollerExample extends PureComponent<{}, any> { - state; - context; _windowScroller: WindowScroller; - - constructor(props) { - super(props) - - this.state = { - showHeaderText: true - } - - this._hideHeader = this._hideHeader.bind(this) - this._rowRenderer = this._rowRenderer.bind(this) - this._onCheckboxChange = this._onCheckboxChange.bind(this) - this._setRef = this._setRef.bind(this) - } + state = { + showHeaderText: true + }; render() { - const { list, isScrollingCustomElement, customElement } = this.context - const { showHeaderText } = this.state + const { list, isScrollingCustomElement, customElement } = this.context; + const { showHeaderText } = this.state; return ( - -
    +
    - {({ height, isScrolling, scrollTop }) => ( + {({ height, isScrolling, scrollTop, onChildScroll }) => ( {({ width }) => ( this._rowRenderer({ index, isScrolling, isVisible, key, style })} + rowRenderer={params => + this._rowRenderer({ + ...params, + isScrolling + }) + } scrollTop={scrollTop} width={width} /> @@ -1799,60 +1531,40 @@ export class WindowScrollerExample extends PureComponent<{}, any> { )}
    - ) + ); } - _hideHeader() { - const { showHeaderText } = this.state - - this.setState({ - showHeaderText: !showHeaderText - }, () => { - this._windowScroller.updatePosition() - }) - } - - _rowRenderer({ index, isScrolling, isVisible, key, style }) { - const { list } = this.context - const row = list.get(index) + _rowRenderer({ index, isScrolling, isVisible, key, style }: ListRowProps) { + const { list } = this.context; + const row = list.get(index); return ( -
    +
    {row.name}
    - ) + ); } - _setRef(windowScroller) { - this._windowScroller = windowScroller - } - - _onCheckboxChange(event) { - this.context.setScrollingCustomElement(event.target.checked) + _setRef(windowScroller: any) { + this._windowScroller = windowScroller; } } -import { GridCellProps, GridCellRangeProps } from 'react-virtualized' +import { + GridCellProps, + GridCellRangeProps, + SortParams, + SortDirectionType +} from "react-virtualized"; export class GridCellRangeRendererExample extends PureComponent<{}, any> { - - constructor(props) { - super(props) - - this.state = { - columnWidth: 75, - columnCount: 50, - height: 300, - rowHeight: 40, - rowCount: 100 - } - - this._cellRangeRenderer = this._cellRangeRenderer.bind(this) - } + state = { + columnWidth: 75, + columnCount: 50, + height: 300, + rowHeight: 40, + rowCount: 100 + }; render() { const { @@ -1861,7 +1573,7 @@ export class GridCellRangeRendererExample extends PureComponent<{}, any> { height, rowHeight, rowCount - } = this.state + } = this.state; return ( { rowHeight={rowHeight} width={columnWidth} /> - ) + ); } _cellRangeRenderer({ - cellCache, // Temporary cell cache used while scrolling - cellRenderer, // Cell renderer prop supplied to Grid + cellCache, // Temporary cell cache used while scrolling + cellRenderer, // Cell renderer prop supplied to Grid columnSizeAndPositionManager, // @see CellSizeAndPositionManager, - columnStartIndex, // Index of first column (inclusive) to render - columnStopIndex, // Index of last column (inclusive) to render - horizontalOffsetAdjustment, // Horizontal pixel offset (required for scaling) - isScrolling, // The Grid is currently being scrolled - rowSizeAndPositionManager, // @see CellSizeAndPositionManager, - rowStartIndex, // Index of first column (inclusive) to render - rowStopIndex, // Index of last column (inclusive) to render - scrollLeft, // Current horizontal scroll offset of Grid - scrollTop, // Current vertical scroll offset of Grid - styleCache, // Temporary style (size & position) cache used while scrolling - verticalOffsetAdjustment, // Vertical pixel offset (required for scaling) + columnStartIndex, // Index of first column (inclusive) to render + columnStopIndex, // Index of last column (inclusive) to render + horizontalOffsetAdjustment, // Horizontal pixel offset (required for scaling) + isScrolling, // The Grid is currently being scrolled + rowSizeAndPositionManager, // @see CellSizeAndPositionManager, + rowStartIndex, // Index of first column (inclusive) to render + rowStopIndex, // Index of last column (inclusive) to render + scrollLeft, // Current horizontal scroll offset of Grid + scrollTop, // Current vertical scroll offset of Grid + styleCache, // Temporary style (size & position) cache used while scrolling + verticalOffsetAdjustment, // Vertical pixel offset (required for scaling) parent, visibleColumnIndices, - visibleRowIndices, - }: GridCellRangeProps): React.ReactNode[] { - const renderedCells: React.ReactNode[] = [] - const style: React.CSSProperties = {} + visibleRowIndices + }: GridCellRangeProps): React.ReactNode[] { + const renderedCells: React.ReactNode[] = []; + const style: React.CSSProperties = {}; - for (let rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) { + for ( + let rowIndex = rowStartIndex; + rowIndex <= rowStopIndex; + rowIndex++ + ) { // This contains :offset (top) and :size (height) information for the cell - const rowDatum = rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex) + const rowDatum = rowSizeAndPositionManager.getSizeAndPositionOfCell( + rowIndex + ); - for (let columnIndex = columnStartIndex; columnIndex <= columnStopIndex; columnIndex++) { + for ( + let columnIndex = columnStartIndex; + columnIndex <= columnStopIndex; + columnIndex++ + ) { // This contains :offset (left) and :size (width) information for the cell - const columnDatum = columnSizeAndPositionManager.getSizeAndPositionOfCell(columnIndex) + const columnDatum = columnSizeAndPositionManager.getSizeAndPositionOfCell( + columnIndex + ); // Be sure to adjust cell position in case the total set of cells is too large to be supported by the browser natively. // In this case, Grid will shift cells as a user scrolls to increase cell density. - const left = columnDatum.offset + horizontalOffsetAdjustment - const top = rowDatum.offset + verticalOffsetAdjustment + const left = columnDatum.offset + horizontalOffsetAdjustment; + const top = rowDatum.offset + verticalOffsetAdjustment; // The rest of the information you need to render the cell are contained in the data. // Be sure to provide unique :key attributes. - const key = `${rowIndex}-${columnIndex}` - const height = rowDatum.size - const width = columnDatum.size + const key = `${rowIndex}-${columnIndex}`; + const height = rowDatum.size; + const width = columnDatum.size; const isVisible = columnIndex >= visibleColumnIndices.start && columnIndex <= visibleColumnIndices.stop && rowIndex >= visibleRowIndices.start && - rowIndex <= visibleRowIndices.stop + rowIndex <= visibleRowIndices.stop; // Now render your cell and additional UI as you see fit. // Add all rendered children to the :renderedCells Array. @@ -1936,13 +1660,13 @@ export class GridCellRangeRendererExample extends PureComponent<{}, any> { key, parent, rowIndex, - style, - } + style + }; - renderedCells.push(cellRenderer(gridCellProps)) + renderedCells.push(cellRenderer(gridCellProps)); } } - return renderedCells - } + return renderedCells; + } } diff --git a/types/react-virtualized/tsconfig.json b/types/react-virtualized/tsconfig.json index 9a6a1ce9de..b3f5a6510f 100644 --- a/types/react-virtualized/tsconfig.json +++ b/types/react-virtualized/tsconfig.json @@ -2,13 +2,13 @@ "compilerOptions": { "module": "commonjs", "lib": ["es6", "dom"], - "noImplicitAny": false, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": false, "jsx": "react", "baseUrl": "../", "typeRoots": ["../"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, From 65622d3c46c36be7d5fbb32633026fce6b391384 Mon Sep 17 00:00:00 2001 From: Hugues Stefanski Date: Sat, 14 Apr 2018 21:37:38 +0200 Subject: [PATCH 0662/2153] D3 geo strict null check (#23794) * d3-geo strictNullChecks mode: Allow GeoGeometryObjects type to be null Check existence of optional mehtods before calling them Added null to union type or some results of call * Missing space * Min TS 2.4 for d3-geo * Back to TS 2.3 * Added null as acceptable type * d3-geo : Use of default generic types * d3-geo : Removed generic type when using default * d3-geo : fix generic types * d3-geo : tests with nullable features --- types/d3-geo/d3-geo-tests.ts | 126 +++++++++++++++++++++++++++++++---- types/d3-geo/index.d.ts | 106 ++++++++++++++++------------- types/d3-geo/tsconfig.json | 4 +- 3 files changed, 175 insertions(+), 61 deletions(-) diff --git a/types/d3-geo/d3-geo-tests.ts b/types/d3-geo/d3-geo-tests.ts index 5124694378..51ddb93d89 100644 --- a/types/d3-geo/d3-geo-tests.ts +++ b/types/d3-geo/d3-geo-tests.ts @@ -89,7 +89,33 @@ const sampleExtendedFeatureCollection: d3Geo.ExtendedFeatureCollection = { + type: 'Feature', + geometry: null, + properties: null +}; +const sampleExtendedNullableFeature: d3Geo.ExtendedFeature = { + type: 'Feature', + geometry: null, + properties: null +}; + +const sampleNullableFeatureCollection: GeoJSON.FeatureCollection = { + type: 'FeatureCollection', + features: [ + sampleNullableFeature, + sampleNullableFeature + ] +}; + +const sampleExtendedNullableFeatureCollection: d3Geo.ExtendedFeatureCollection = { + type: 'FeatureCollection', + features: [ + sampleExtendedNullableFeature, + sampleExtendedNullableFeature + ] +}; // ---------------------------------------------------------------------- // Spherical Math // ---------------------------------------------------------------------- @@ -101,10 +127,14 @@ area = d3Geo.geoArea(sampleSphere); area = d3Geo.geoArea(sampleGeometryCollection); area = d3Geo.geoArea(sampleExtendedGeometryCollection); area = d3Geo.geoArea(sampleFeature); +area = d3Geo.geoArea(sampleNullableFeature); area = d3Geo.geoArea(sampleExtendedFeature1); area = d3Geo.geoArea(sampleExtendedFeature2); +area = d3Geo.geoArea(sampleExtendedNullableFeature); area = d3Geo.geoArea(sampleFeatureCollection); +area = d3Geo.geoArea(sampleNullableFeatureCollection); area = d3Geo.geoArea(sampleExtendedFeatureCollection); +area = d3Geo.geoArea(sampleExtendedNullableFeatureCollection); // geoBounds(...) ========================================================= @@ -113,10 +143,14 @@ bounds = d3Geo.geoBounds(sampleSphere); bounds = d3Geo.geoBounds(sampleGeometryCollection); bounds = d3Geo.geoBounds(sampleExtendedGeometryCollection); bounds = d3Geo.geoBounds(sampleFeature); +bounds = d3Geo.geoBounds(sampleNullableFeature); bounds = d3Geo.geoBounds(sampleExtendedFeature1); bounds = d3Geo.geoBounds(sampleExtendedFeature2); +bounds = d3Geo.geoBounds(sampleExtendedNullableFeature); bounds = d3Geo.geoBounds(sampleFeatureCollection); +bounds = d3Geo.geoBounds(sampleNullableFeatureCollection); bounds = d3Geo.geoBounds(sampleExtendedFeatureCollection); +bounds = d3Geo.geoBounds(sampleExtendedNullableFeatureCollection); // geoCentroid(...) ======================================================= @@ -125,10 +159,14 @@ centroid = d3Geo.geoCentroid(sampleSphere); centroid = d3Geo.geoCentroid(sampleGeometryCollection); centroid = d3Geo.geoCentroid(sampleExtendedGeometryCollection); centroid = d3Geo.geoCentroid(sampleFeature); +centroid = d3Geo.geoCentroid(sampleNullableFeature); centroid = d3Geo.geoCentroid(sampleExtendedFeature1); centroid = d3Geo.geoCentroid(sampleExtendedFeature2); +centroid = d3Geo.geoCentroid(sampleExtendedNullableFeature); centroid = d3Geo.geoCentroid(sampleFeatureCollection); +centroid = d3Geo.geoCentroid(sampleNullableFeatureCollection); centroid = d3Geo.geoCentroid(sampleExtendedFeatureCollection); +centroid = d3Geo.geoCentroid(sampleExtendedNullableFeatureCollection); // geoContains(...) ======================================================= @@ -137,10 +175,14 @@ contained = d3Geo.geoContains(sampleSphere, [0, 0]); contained = d3Geo.geoContains(sampleGeometryCollection, [0, 0]); contained = d3Geo.geoContains(sampleExtendedGeometryCollection, [0, 0]); contained = d3Geo.geoContains(sampleFeature, [0, 0]); +contained = d3Geo.geoContains(sampleNullableFeature, [0, 0]); contained = d3Geo.geoContains(sampleExtendedFeature1, [0, 0]); contained = d3Geo.geoContains(sampleExtendedFeature2, [0, 0]); +contained = d3Geo.geoContains(sampleExtendedNullableFeature, [0, 0]); contained = d3Geo.geoContains(sampleFeatureCollection, [0, 0]); +contained = d3Geo.geoContains(sampleNullableFeatureCollection, [0, 0]); contained = d3Geo.geoContains(sampleExtendedFeatureCollection, [0, 0]); +contained = d3Geo.geoContains(sampleExtendedNullableFeatureCollection, [0, 0]); // geoDistance(...) ======================================================= @@ -153,10 +195,14 @@ length = d3Geo.geoLength(sampleSphere); length = d3Geo.geoLength(sampleGeometryCollection); length = d3Geo.geoLength(sampleExtendedGeometryCollection); length = d3Geo.geoLength(sampleFeature); +length = d3Geo.geoLength(sampleNullableFeature); length = d3Geo.geoLength(sampleExtendedFeature1); length = d3Geo.geoLength(sampleExtendedFeature2); +length = d3Geo.geoLength(sampleExtendedNullableFeature); length = d3Geo.geoLength(sampleFeatureCollection); +length = d3Geo.geoLength(sampleNullableFeatureCollection); length = d3Geo.geoLength(sampleExtendedFeatureCollection); +length = d3Geo.geoLength(sampleExtendedNullableFeatureCollection); // geoInterpolate(...) ==================================================== @@ -181,7 +227,7 @@ const inverted: [number, number] = rotation.invert([54, 2]); // Create GeoCircleGenerator ============================================ // simple use case -let circleGeneratorSimple: d3Geo.GeoCircleGenerator = d3Geo.geoCircle(); +let circleGeneratorSimple: d3Geo.GeoCircleGenerator = d3Geo.geoCircle(); // complex use as part of object class Circulator { @@ -331,8 +377,9 @@ const naturalEart1Raw: d3Geo.GeoRawProjection = d3Geo.geoNaturalEarth1Raw(); // Use Raw Projection ===================================================== const rawProjectionPoint: [number, number] = azimuthalEqualAreaRaw(54, 2); -const rawProjectionInvertedPoint: [number, number] = azimuthalEqualAreaRaw.invert(180, 6); - +if (azimuthalEqualAreaRaw.invert) { + const rawProjectionInvertedPoint: [number, number] = azimuthalEqualAreaRaw.invert(180, 6); +} // ---------------------------------------------------------------------- // Pre-Defined Projections // ---------------------------------------------------------------------- @@ -365,8 +412,10 @@ let constructedProjection: d3Geo.GeoProjection = mutate(); // Use Projection ========================================================== -const projected: [number, number] = constructedProjection([54, 2]); -const inverted2: [number, number] = constructedProjection.invert([54, 2]); +const projected: [number, number] | null = constructedProjection([54, 2]); +if (constructedProjection.invert) { + const inverted2: [number, number] | null = constructedProjection.invert([54, 2]); +} // TODO ????? // let stream: d3Geo.Stream = constructedProjection.stream([54, 2]); @@ -378,7 +427,7 @@ constructedProjection = constructedProjection.preclip(d3Geo.geoClipCircle(45)); const postClip: (stream: d3Geo.GeoStream) => d3Geo.GeoStream = constructedProjection.postclip(); constructedProjection = constructedProjection.postclip(d3Geo.geoClipRectangle(0, 0, 1, 1)); -const clipAngle: number = constructedProjection.clipAngle(); +const clipAngle: number | null = constructedProjection.clipAngle(); constructedProjection = constructedProjection.clipAngle(null); constructedProjection = constructedProjection.clipAngle(45); @@ -410,40 +459,56 @@ constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sa constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleGeometryCollection); constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleExtendedGeometryCollection); constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleFeature); +constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleNullableFeature); constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleExtendedFeature1); constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleExtendedFeature2); +constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleExtendedNullableFeature); constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleFeatureCollection); +constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleNullableFeatureCollection); constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleExtendedFeatureCollection); +constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleExtendedNullableFeatureCollection); constructedProjection = constructedProjection.fitSize([960, 500], samplePolygon); constructedProjection = constructedProjection.fitSize([960, 500], sampleSphere); constructedProjection = constructedProjection.fitSize([960, 500], sampleGeometryCollection); constructedProjection = constructedProjection.fitSize([960, 500], sampleExtendedGeometryCollection); constructedProjection = constructedProjection.fitSize([960, 500], sampleFeature); +constructedProjection = constructedProjection.fitSize([960, 500], sampleNullableFeature); constructedProjection = constructedProjection.fitSize([960, 500], sampleExtendedFeature1); constructedProjection = constructedProjection.fitSize([960, 500], sampleExtendedFeature2); +constructedProjection = constructedProjection.fitSize([960, 500], sampleExtendedNullableFeature); constructedProjection = constructedProjection.fitSize([960, 500], sampleFeatureCollection); +constructedProjection = constructedProjection.fitSize([960, 500], sampleNullableFeatureCollection); constructedProjection = constructedProjection.fitSize([960, 500], sampleExtendedFeatureCollection); +constructedProjection = constructedProjection.fitSize([960, 500], sampleExtendedNullableFeatureCollection); constructedProjection = constructedProjection.fitWidth(960, samplePolygon); constructedProjection = constructedProjection.fitWidth(960, sampleSphere); constructedProjection = constructedProjection.fitWidth(960, sampleGeometryCollection); constructedProjection = constructedProjection.fitWidth(960, sampleExtendedGeometryCollection); constructedProjection = constructedProjection.fitWidth(960, sampleFeature); +constructedProjection = constructedProjection.fitWidth(960, sampleNullableFeature); constructedProjection = constructedProjection.fitWidth(960, sampleExtendedFeature1); constructedProjection = constructedProjection.fitWidth(960, sampleExtendedFeature2); +constructedProjection = constructedProjection.fitWidth(960, sampleExtendedNullableFeature); constructedProjection = constructedProjection.fitWidth(960, sampleFeatureCollection); +constructedProjection = constructedProjection.fitWidth(960, sampleNullableFeatureCollection); constructedProjection = constructedProjection.fitWidth(960, sampleExtendedFeatureCollection); +constructedProjection = constructedProjection.fitWidth(960, sampleExtendedNullableFeatureCollection); constructedProjection = constructedProjection.fitHeight(500, samplePolygon); constructedProjection = constructedProjection.fitHeight(500, sampleSphere); constructedProjection = constructedProjection.fitHeight(500, sampleGeometryCollection); constructedProjection = constructedProjection.fitHeight(500, sampleExtendedGeometryCollection); constructedProjection = constructedProjection.fitHeight(500, sampleFeature); +constructedProjection = constructedProjection.fitHeight(500, sampleNullableFeature); constructedProjection = constructedProjection.fitHeight(500, sampleExtendedFeature1); constructedProjection = constructedProjection.fitHeight(500, sampleExtendedFeature2); +constructedProjection = constructedProjection.fitHeight(500, sampleExtendedNullableFeature); constructedProjection = constructedProjection.fitHeight(500, sampleFeatureCollection); +constructedProjection = constructedProjection.fitHeight(500, sampleNullableFeatureCollection); constructedProjection = constructedProjection.fitHeight(500, sampleExtendedFeatureCollection); +constructedProjection = constructedProjection.fitHeight(500, sampleExtendedNullableFeatureCollection); // ---------------------------------------------------------------------- // GeoConicProjection interface @@ -471,7 +536,7 @@ const minimalRenderingContextMockUp: d3Geo.GeoContext = { // Create geoPath Generator ============================================= -let geoPathCanvas: d3Geo.GeoPath; +let geoPathCanvas: d3Geo.GeoPath; geoPathCanvas = d3Geo.geoPath(); geoPathCanvas = d3Geo.geoPath(null); geoPathCanvas = d3Geo.geoPath(null, null); @@ -487,8 +552,8 @@ geoPathSVG = d3Geo.geoPath(); geoPathSVG = geoPathSVG.projection(conicConformal); @@ -501,13 +566,13 @@ const geoPathConicProjection: d3Geo.GeoConicProjection = geoPathSVG.projection { +export interface ExtendedGeometryCollection { type: string; bbox?: number[]; crs?: { @@ -45,9 +47,18 @@ export interface ExtendedGeometryCollection extends GeoJSON.GeoJsonObject { +export interface ExtendedFeature< + GeometryType extends GeoGeometryObjects | null = GeoGeometryObjects | null, + Properties extends GeoJSON.GeoJsonProperties = GeoJSON.GeoJsonProperties + > extends GeoJSON.GeoJsonObject { geometry: GeometryType; properties: Properties; id?: string | number; @@ -56,8 +67,10 @@ export interface ExtendedFeature> extends GeoJSON.GeoJsonObject { +export interface ExtendedFeatureCollection extends GeoJSON.GeoJsonObject { features: FeatureType[]; } @@ -65,8 +78,7 @@ export interface ExtendedFeatureCollection - | ExtendedFeature | ExtendedFeatureCollection>; +export type GeoPermissibleObjects = GeoGeometryObjects | ExtendedGeometryCollection | ExtendedFeature | ExtendedFeatureCollection; // ---------------------------------------------------------------------- // Spherical Math @@ -78,14 +90,14 @@ export type GeoPermissibleObjects = GeoGeometryObjects | ExtendedGeometryCollect * * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ -export function geoArea(object: ExtendedFeature): number; +export function geoArea(object: ExtendedFeature): number; /** * Returns the spherical area of the specified feature collection in steradians. * This is the spherical equivalent of path.area. * * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). */ -export function geoArea(object: ExtendedFeatureCollection>): number; +export function geoArea(object: ExtendedFeatureCollection): number; /** * Returns the spherical area of the specified GeoJson Geometry Object or GeoSphere object in steradians. * This is the spherical equivalent of path.area. @@ -99,7 +111,7 @@ export function geoArea(object: GeoGeometryObjects): number; * * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ -export function geoArea(object: ExtendedGeometryCollection): number; +export function geoArea(object: ExtendedGeometryCollection): number; /** * Returns the spherical bounding box for the specified feature. The bounding box is represented by a two-dimensional array: [[left, bottom], [right, top]], @@ -109,7 +121,7 @@ export function geoArea(object: ExtendedGeometryCollection): * * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ -export function geoBounds(object: ExtendedFeature): [[number, number], [number, number]]; +export function geoBounds(object: ExtendedFeature): [[number, number], [number, number]]; /** * Returns the spherical bounding box for the specified feature collection. The bounding box is represented by a two-dimensional array: [[left, bottom], [right, top]], * where left is the minimum longitude, bottom is the minimum latitude, right is maximum longitude, and top is the maximum latitude. All coordinates are given in degrees. @@ -118,7 +130,7 @@ export function geoBounds(object: ExtendedFeature): [[n * * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). */ -export function geoBounds(object: ExtendedFeatureCollection>): [[number, number], [number, number]]; +export function geoBounds(object: ExtendedFeatureCollection): [[number, number], [number, number]]; /** * Returns the spherical bounding box for the specified GeoJson Geometry Object or GeoSphere object. The bounding box is represented by a two-dimensional array: [[left, bottom], [right, top]], * where left is the minimum longitude, bottom is the minimum latitude, right is maximum longitude, and top is the maximum latitude. All coordinates are given in degrees. @@ -136,7 +148,7 @@ export function geoBounds(object: GeoGeometryObjects): [[number, number], [numbe * * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ -export function geoBounds(object: ExtendedGeometryCollection): [[number, number], [number, number]]; +export function geoBounds(object: ExtendedGeometryCollection): [[number, number], [number, number]]; /** * Returns the spherical centroid of the specified feature in steradians. @@ -144,14 +156,14 @@ export function geoBounds(object: ExtendedGeometryCollection * * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ -export function geoCentroid(object: ExtendedFeature): [number, number]; +export function geoCentroid(object: ExtendedFeature): [number, number]; /** * Returns the spherical centroid of the specified feature collection in steradians. * This is the spherical equivalent of path.centroid. * * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). */ -export function geoCentroid(object: ExtendedFeatureCollection>): [number, number]; +export function geoCentroid(object: ExtendedFeatureCollection): [number, number]; /** * Returns the spherical centroid of the specified GeoJson Geometry Object or GeoSphere object in steradians. * This is the spherical equivalent of path.centroid. @@ -165,7 +177,7 @@ export function geoCentroid(object: GeoGeometryObjects): [number, number]; * * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ -export function geoCentroid(object: ExtendedGeometryCollection): [number, number]; +export function geoCentroid(object: ExtendedGeometryCollection): [number, number]; /** * Returns true if and only if the specified GeoJSON object contains the specified point, or false if the object does not contain the point. @@ -175,7 +187,7 @@ export function geoCentroid(object: ExtendedGeometryCollection, point: [number, number]): boolean; +export function geoContains(object: ExtendedFeature, point: [number, number]): boolean; /** * Returns true if and only if the specified GeoJSON object contains the specified point, or false if the object does not contain the point. * The point must be specified as a two-element array [longitude, latitude] in degrees. For Point and MultiPoint geometries, an exact test is used; @@ -184,7 +196,7 @@ export function geoContains(object: ExtendedFeature, po * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). * @param point Point specified as a two-element array [longitude, latitude] in degrees. */ -export function geoContains(object: ExtendedFeatureCollection>, point: [number, number]): boolean; +export function geoContains(object: ExtendedFeatureCollection, point: [number, number]): boolean; /** * Returns true if and only if the specified GeoJSON object contains the specified point, or false if the object does not contain the point. * The point must be specified as a two-element array [longitude, latitude] in degrees. For Point and MultiPoint geometries, an exact test is used; @@ -202,7 +214,7 @@ export function geoContains(object: GeoGeometryObjects, point: [number, number]) * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). * @param point Point specified as a two-element array [longitude, latitude] in degrees. */ -export function geoContains(object: ExtendedGeometryCollection, point: [number, number]): boolean; +export function geoContains(object: ExtendedGeometryCollection, point: [number, number]): boolean; /** * Returns the great-arc distance in radians between the two points a and b. @@ -219,14 +231,14 @@ export function geoDistance(a: [number, number], b: [number, number]): number; * * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ -export function geoLength(object: ExtendedFeature): number; +export function geoLength(object: ExtendedFeature): number; /** * Returns the great-arc length of the specified feature collection in radians. For polygons, returns the perimeter of the exterior ring plus that of any interior rings. * This is the spherical equivalent of path.measure. * * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). */ -export function geoLength(object: ExtendedFeatureCollection>): number; +export function geoLength(object: ExtendedFeatureCollection): number; /** * Returns the great-arc length of the specified GeoJson Geometry Object or GeoSphere object in radians. For polygons, returns the perimeter of the exterior ring plus that of any interior rings. * This is the spherical equivalent of path.measure. @@ -240,7 +252,7 @@ export function geoLength(object: GeoGeometryObjects): number; * * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ -export function geoLength(object: ExtendedGeometryCollection): number; +export function geoLength(object: ExtendedGeometryCollection): number; /** * Returns an interpolator function given two points a and b. @@ -291,7 +303,7 @@ export function geoRotation(angles: [number, number] | [number, number, number]) * * The second generic corresponds to the type of the Datum which will be passed into the geo circle generator. */ -export interface GeoCircleGenerator { +export interface GeoCircleGenerator { /** * Returns a new GeoJSON geometry object of type “Polygon” approximating a circle on the surface of a sphere, * with the current center, radius and precision. Any arguments are passed to the accessors. @@ -362,7 +374,7 @@ export interface GeoCircleGenerator { /** * Returns a new geo circle generator */ -export function geoCircle(): GeoCircleGenerator; +export function geoCircle(): GeoCircleGenerator; /** * Returns a new geo circle generator * @@ -547,7 +559,7 @@ export interface GeoStream { * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). * @param stream A projection stream. */ -export function geoStream(object: ExtendedFeature, stream: GeoStream): void; +export function geoStream(object: ExtendedFeature, stream: GeoStream): void; /** * Streams the specified GeoJSON object to the specified projection stream. While both features and geometry objects are supported as input, @@ -556,7 +568,7 @@ export function geoStream(object: ExtendedFeature, stre * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). * @param stream A projection stream. */ -export function geoStream(object: ExtendedFeatureCollection>, stream: GeoStream): void; +export function geoStream(object: ExtendedFeatureCollection, stream: GeoStream): void; /** * Streams the specified GeoJSON object to the specified projection stream. While both features and geometry objects are supported as input, @@ -574,7 +586,7 @@ export function geoStream(object: GeoGeometryObjects, stream: GeoStream): void; * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). * @param stream A projection stream. */ -export function geoStream(object: ExtendedGeometryCollection, stream: GeoStream): void; +export function geoStream(object: ExtendedGeometryCollection, stream: GeoStream): void; // ---------------------------------------------------------------------- // Projections @@ -736,7 +748,7 @@ export interface GeoProjection extends GeoStreamWrapper { * @param extent The extent, specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left side of the bounding box, y₀ is the top, x₁ is the right and y₁ is the bottom. * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ - fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeature): this; + fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeature): this; /** * Sets the projection’s scale and translate to fit the specified geographic feature collection in the center of the given extent. * Returns the projection. @@ -746,7 +758,7 @@ export interface GeoProjection extends GeoStreamWrapper { * @param extent The extent, specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left side of the bounding box, y₀ is the top, x₁ is the right and y₁ is the bottom. * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature collection). */ - fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeatureCollection>): this; + fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeatureCollection): this; /** * Sets the projection’s scale and translate to fit the specified geographic geometry object in the center of the given extent. * Returns the projection. @@ -766,7 +778,7 @@ export interface GeoProjection extends GeoStreamWrapper { * @param extent The extent, specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left side of the bounding box, y₀ is the top, x₁ is the right and y₁ is the bottom. * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ - fitExtent(extent: [[number, number], [number, number]], object: ExtendedGeometryCollection): this; + fitExtent(extent: [[number, number], [number, number]], object: ExtendedGeometryCollection): this; /** * Sets the projection’s scale and translate to fit the specified geographic feature in the center of an extent with the given size and top-left corner of [0, 0]. @@ -777,7 +789,7 @@ export interface GeoProjection extends GeoStreamWrapper { * @param size The size of the extent, specified as an array [width, height]. * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ - fitSize(size: [number, number], object: ExtendedFeature): this; + fitSize(size: [number, number], object: ExtendedFeature): this; /** * Sets the projection’s scale and translate to fit the specified geographic feature collection in the center of an extent with the given size and top-left corner of [0, 0]. * Returns the projection. @@ -787,7 +799,7 @@ export interface GeoProjection extends GeoStreamWrapper { * @param size The size of the extent, specified as an array [width, height]. * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature collection). */ - fitSize(size: [number, number], object: ExtendedFeatureCollection>): this; + fitSize(size: [number, number], object: ExtendedFeatureCollection): this; /** * Sets the projection’s scale and translate to fit the specified geographic geometry object in the center of an extent with the given size and top-left corner of [0, 0]. * Returns the projection. @@ -807,7 +819,7 @@ export interface GeoProjection extends GeoStreamWrapper { * @param size The size of the extent, specified as an array [width, height]. * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ - fitSize(size: [number, number], object: ExtendedGeometryCollection): this; + fitSize(size: [number, number], object: ExtendedGeometryCollection): this; /** * A convenience method for projection.fitSize where the height is automatically chosen from the aspect ratio of object and the given constraint on width. @@ -815,14 +827,14 @@ export interface GeoProjection extends GeoStreamWrapper { * @param width The width of the extent. * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ - fitWidth(width: number, object: ExtendedFeature): this; + fitWidth(width: number, object: ExtendedFeature): this; /** * A convenience method for projection.fitSize where the height is automatically chosen from the aspect ratio of object and the given constraint on width. * * @param width The width of the extent. * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). */ - fitWidth(width: number, object: ExtendedFeatureCollection>): this; + fitWidth(width: number, object: ExtendedFeatureCollection): this; /** * A convenience method for projection.fitSize where the height is automatically chosen from the aspect ratio of object and the given constraint on width. * @@ -836,7 +848,7 @@ export interface GeoProjection extends GeoStreamWrapper { * @param width The width of the extent. * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ - fitWidth(width: number, object: ExtendedGeometryCollection): this; + fitWidth(width: number, object: ExtendedGeometryCollection): this; /** * A convenience method for projection.fitSize where the width is automatically chosen from the aspect ratio of object and the given constraint on height. @@ -844,14 +856,14 @@ export interface GeoProjection extends GeoStreamWrapper { * @param height The height of the extent. * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ - fitHeight(height: number, object: ExtendedFeature): this; + fitHeight(height: number, object: ExtendedFeature): this; /** * A convenience method for projection.fitSize where the width is automatically chosen from the aspect ratio of object and the given constraint on height. * * @param height The height of the extent. * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). */ - fitHeight(height: number, object: ExtendedFeatureCollection>): this; + fitHeight(height: number, object: ExtendedFeatureCollection): this; /** * A convenience method for projection.fitSize where the width is automatically chosen from the aspect ratio of object and the given constraint on height. * @@ -865,7 +877,7 @@ export interface GeoProjection extends GeoStreamWrapper { * @param height The height of the extent. * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ - fitHeight(height: number, object: ExtendedGeometryCollection): this; + fitHeight(height: number, object: ExtendedGeometryCollection): this; /** * Returns a new array [longitude, latitude] in degrees representing the unprojected point of the given projected point. @@ -1012,7 +1024,7 @@ export interface GeoContext { * * The second generic corresponds to the type of the DatumObject which will be passed into the geo path generator for rendering. */ -export interface GeoPath { +export interface GeoPath { /** * Renders the given object, which may be any GeoJSON feature or geometry object: * @@ -1222,7 +1234,7 @@ export interface GeoPath { * @param context An (optional) rendering context to be used. If a context is provided, it must at least implement the interface described by GeoContext, a subset of the CanvasRenderingContext2D API. * Setting the context to "null" means that the path generator will return an SVG path string representing the to be rendered object. The default is "null". */ -export function geoPath(projection?: GeoProjection | GeoStreamWrapper | null, context?: GeoContext | null): GeoPath; +export function geoPath(projection?: GeoProjection | GeoStreamWrapper | null, context?: GeoContext | null): GeoPath; /** * Creates a new geographic path generator with the default settings. * @@ -1525,7 +1537,7 @@ export interface GeoIdentityTranform extends GeoStreamWrapper { * @param extent The extent, specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left side of the bounding box, y₀ is the top, x₁ is the right and y₁ is the bottom. * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ - fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeature): this; + fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeature): this; /** * Sets the projection’s scale and translate to fit the specified geographic feature collection in the center of the given extent. * Returns the projection. @@ -1535,7 +1547,7 @@ export interface GeoIdentityTranform extends GeoStreamWrapper { * @param extent The extent, specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left side of the bounding box, y₀ is the top, x₁ is the right and y₁ is the bottom. * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature collection). */ - fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeatureCollection>): this; + fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeatureCollection): this; /** * Sets the projection’s scale and translate to fit the specified geographic geometry object in the center of the given extent. * Returns the projection. @@ -1555,7 +1567,7 @@ export interface GeoIdentityTranform extends GeoStreamWrapper { * @param extent The extent, specified as an array [[x₀, y₀], [x₁, y₁]], where x₀ is the left side of the bounding box, y₀ is the top, x₁ is the right and y₁ is the bottom. * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ - fitExtent(extent: [[number, number], [number, number]], object: ExtendedGeometryCollection): this; + fitExtent(extent: [[number, number], [number, number]], object: ExtendedGeometryCollection): this; /** * Sets the projection’s scale and translate to fit the specified geographic feature in the center of an extent with the given size and top-left corner of [0, 0]. @@ -1566,7 +1578,7 @@ export interface GeoIdentityTranform extends GeoStreamWrapper { * @param size The size of the extent, specified as an array [width, height]. * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ - fitSize(size: [number, number], object: ExtendedFeature): this; + fitSize(size: [number, number], object: ExtendedFeature): this; /** * Sets the projection’s scale and translate to fit the specified geographic feature collection in the center of an extent with the given size and top-left corner of [0, 0]. * Returns the projection. @@ -1576,7 +1588,7 @@ export interface GeoIdentityTranform extends GeoStreamWrapper { * @param size The size of the extent, specified as an array [width, height]. * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature collection). */ - fitSize(size: [number, number], object: ExtendedFeatureCollection>): this; + fitSize(size: [number, number], object: ExtendedFeatureCollection): this; /** * Sets the projection’s scale and translate to fit the specified geographic geometry object in the center of an extent with the given size and top-left corner of [0, 0]. * Returns the projection. @@ -1596,7 +1608,7 @@ export interface GeoIdentityTranform extends GeoStreamWrapper { * @param size The size of the extent, specified as an array [width, height]. * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ - fitSize(size: [number, number], object: ExtendedGeometryCollection): this; + fitSize(size: [number, number], object: ExtendedGeometryCollection): this; /** * Returns true if x-reflection is enabled, which defaults to false. diff --git a/types/d3-geo/tsconfig.json b/types/d3-geo/tsconfig.json index f3661c3ad2..128bdf7ee8 100644 --- a/types/d3-geo/tsconfig.json +++ b/types/d3-geo/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -21,4 +21,4 @@ "index.d.ts", "d3-geo-tests.ts" ] -} \ No newline at end of file +} From a1ff7a2a7d29b33e02acd83d32ae24aee7d25c7c Mon Sep 17 00:00:00 2001 From: AJ Richardson Date: Sat, 14 Apr 2018 15:40:40 -0400 Subject: [PATCH 0663/2153] [lodash] Placeholder support (#24728) * lodash: _.get should with numeric keys, too. Also added some better tests. * lodash: add one more NumericDictionary overload for _.get * lodash: more reasonable index for _.get tests * lodash: support placeholders for curry * lodash: add logic for generating overloads with placeholders * lodash: fix placeholder generation bugs * lodash: use the original parameter name for placeholder parameters * lodash: stop generating unnecessary generics * lodash: move all FP functions into a single file. Trying to fix memory error in tests. * lodash: omit comments and useless overloads to make the build work * lodash: update fp function files * Fix placeholder definition files * lodash: add placeholder constants to fp definitions * lodash: looks like we missed some jsdoc comments. Let's omit them for consistency. * lodash: fix build errors --- types/lodash/common/array.d.ts | 4 +- types/lodash/common/function.d.ts | 332 +- types/lodash/common/object.d.ts | 2 +- types/lodash/common/util.d.ts | 4 +- types/lodash/fp.d.ts | 5279 +++++++++++++++--- types/lodash/fp/F.d.ts | 14 +- types/lodash/fp/T.d.ts | 14 +- types/lodash/fp/__.d.ts | 3 + types/lodash/fp/add.d.ts | 51 +- types/lodash/fp/after.d.ts | 51 +- types/lodash/fp/all.d.ts | 67 +- types/lodash/fp/allPass.d.ts | 18 +- types/lodash/fp/always.d.ts | 15 +- types/lodash/fp/any.d.ts | 67 +- types/lodash/fp/anyPass.d.ts | 18 +- types/lodash/fp/apply.d.ts | 18 +- types/lodash/fp/ary.d.ts | 51 +- types/lodash/fp/assign.d.ts | 156 +- types/lodash/fp/assignAll.d.ts | 37 +- types/lodash/fp/assignAllWith.d.ts | 138 +- types/lodash/fp/assignIn.d.ts | 151 +- types/lodash/fp/assignInAll.d.ts | 36 +- types/lodash/fp/assignInAllWith.d.ts | 143 +- types/lodash/fp/assignInWith.d.ts | 249 +- types/lodash/fp/assignWith.d.ts | 240 +- types/lodash/fp/assoc.d.ts | 147 +- types/lodash/fp/assocPath.d.ts | 147 +- types/lodash/fp/at.d.ts | 96 +- types/lodash/fp/attempt.d.ts | 16 +- types/lodash/fp/before.d.ts | 61 +- types/lodash/fp/bind.d.ts | 86 +- types/lodash/fp/bindAll.d.ts | 78 +- types/lodash/fp/bindKey.d.ts | 91 +- types/lodash/fp/camelCase.d.ts | 15 +- types/lodash/fp/capitalize.d.ts | 15 +- types/lodash/fp/castArray.d.ts | 17 +- types/lodash/fp/ceil.d.ts | 16 +- types/lodash/fp/chunk.d.ts | 58 +- types/lodash/fp/clamp.d.ts | 166 +- types/lodash/fp/clone.d.ts | 20 +- types/lodash/fp/cloneDeep.d.ts | 15 +- types/lodash/fp/cloneDeepWith.d.ts | 53 +- types/lodash/fp/cloneWith.d.ts | 96 +- types/lodash/fp/compact.d.ts | 18 +- types/lodash/fp/complement.d.ts | 16 +- types/lodash/fp/compose.d.ts | 315 +- types/lodash/fp/concat.d.ts | 113 +- types/lodash/fp/cond.d.ts | 38 +- types/lodash/fp/conforms.d.ts | 48 +- types/lodash/fp/conformsTo.d.ts | 48 +- types/lodash/fp/constant.d.ts | 15 +- types/lodash/fp/contains.d.ts | 63 +- types/lodash/fp/countBy.d.ts | 225 +- types/lodash/fp/create.d.ts | 17 +- types/lodash/fp/curry.d.ts | 65 +- types/lodash/fp/curryN.d.ts | 148 +- types/lodash/fp/curryRight.d.ts | 59 +- types/lodash/fp/curryRightN.d.ts | 133 +- types/lodash/fp/debounce.d.ts | 118 +- types/lodash/fp/deburr.d.ts | 16 +- types/lodash/fp/defaultTo.d.ts | 103 +- types/lodash/fp/defaults.d.ts | 71 +- types/lodash/fp/defaultsAll.d.ts | 20 +- types/lodash/fp/defaultsDeep.d.ts | 46 +- types/lodash/fp/defaultsDeepAll.d.ts | 15 +- types/lodash/fp/defer.d.ts | 17 +- types/lodash/fp/delay.d.ts | 56 +- types/lodash/fp/difference.d.ts | 58 +- types/lodash/fp/differenceBy.d.ts | 114 +- types/lodash/fp/differenceWith.d.ts | 168 +- types/lodash/fp/dissoc.d.ts | 63 +- types/lodash/fp/dissocPath.d.ts | 63 +- types/lodash/fp/divide.d.ts | 51 +- types/lodash/fp/drop.d.ts | 53 +- types/lodash/fp/dropLast.d.ts | 53 +- types/lodash/fp/dropLastWhile.d.ts | 108 +- types/lodash/fp/dropRight.d.ts | 53 +- types/lodash/fp/dropRightWhile.d.ts | 108 +- types/lodash/fp/dropWhile.d.ts | 108 +- types/lodash/fp/each.d.ts | 330 +- types/lodash/fp/eachRight.d.ts | 225 +- types/lodash/fp/endsWith.d.ts | 56 +- types/lodash/fp/entries.d.ts | 25 +- types/lodash/fp/entriesIn.d.ts | 25 +- types/lodash/fp/eq.d.ts | 156 +- types/lodash/fp/equals.d.ts | 141 +- types/lodash/fp/escape.d.ts | 26 +- types/lodash/fp/escapeRegExp.d.ts | 16 +- types/lodash/fp/every.d.ts | 67 +- types/lodash/fp/extend.d.ts | 151 +- types/lodash/fp/extendAll.d.ts | 36 +- types/lodash/fp/extendAllWith.d.ts | 143 +- types/lodash/fp/extendWith.d.ts | 249 +- types/lodash/fp/fill.d.ts | 233 +- types/lodash/fp/filter.d.ts | 361 +- types/lodash/fp/find.d.ts | 283 +- types/lodash/fp/findFrom.d.ts | 517 +- types/lodash/fp/findIndex.d.ts | 108 +- types/lodash/fp/findIndexFrom.d.ts | 186 +- types/lodash/fp/findKey.d.ts | 108 +- types/lodash/fp/findLast.d.ts | 143 +- types/lodash/fp/findLastFrom.d.ts | 257 +- types/lodash/fp/findLastIndex.d.ts | 103 +- types/lodash/fp/findLastIndexFrom.d.ts | 177 +- types/lodash/fp/findLastKey.d.ts | 103 +- types/lodash/fp/first.d.ts | 19 +- types/lodash/fp/flatMap.d.ts | 189 +- types/lodash/fp/flatMapDeep.d.ts | 342 +- types/lodash/fp/flatMapDepth.d.ts | 687 +-- types/lodash/fp/flatten.d.ts | 17 +- types/lodash/fp/flattenDeep.d.ts | 17 +- types/lodash/fp/flattenDepth.d.ts | 53 +- types/lodash/fp/flip.d.ts | 24 +- types/lodash/fp/floor.d.ts | 16 +- types/lodash/fp/flow.d.ts | 355 +- types/lodash/fp/flowRight.d.ts | 315 +- types/lodash/fp/forEach.d.ts | 330 +- types/lodash/fp/forEachRight.d.ts | 225 +- types/lodash/fp/forIn.d.ts | 88 +- types/lodash/fp/forInRight.d.ts | 74 +- types/lodash/fp/forOwn.d.ts | 88 +- types/lodash/fp/forOwnRight.d.ts | 74 +- types/lodash/fp/fromPairs.d.ts | 37 +- types/lodash/fp/functions.d.ts | 28 +- types/lodash/fp/functionsIn.d.ts | 28 +- types/lodash/fp/get.d.ts | 207 +- types/lodash/fp/getOr.d.ts | 313 +- types/lodash/fp/groupBy.d.ts | 225 +- types/lodash/fp/gt.d.ts | 51 +- types/lodash/fp/gte.d.ts | 51 +- types/lodash/fp/has.d.ts | 138 +- types/lodash/fp/hasIn.d.ts | 133 +- types/lodash/fp/head.d.ts | 19 +- types/lodash/fp/identical.d.ts | 156 +- types/lodash/fp/identity.d.ts | 23 +- types/lodash/fp/inRange.d.ts | 103 +- types/lodash/fp/includes.d.ts | 63 +- types/lodash/fp/includesFrom.d.ts | 105 +- types/lodash/fp/indexBy.d.ts | 225 +- types/lodash/fp/indexOf.d.ts | 118 +- types/lodash/fp/indexOfFrom.d.ts | 204 +- types/lodash/fp/init.d.ts | 17 +- types/lodash/fp/initial.d.ts | 17 +- types/lodash/fp/intersection.d.ts | 53 +- types/lodash/fp/intersectionBy.d.ts | 186 +- types/lodash/fp/intersectionWith.d.ts | 177 +- types/lodash/fp/invert.d.ts | 19 +- types/lodash/fp/invertBy.d.ts | 73 +- types/lodash/fp/invertObj.d.ts | 19 +- types/lodash/fp/invoke.d.ts | 48 +- types/lodash/fp/invokeArgs.d.ts | 78 +- types/lodash/fp/invokeArgsMap.d.ts | 187 +- types/lodash/fp/invokeMap.d.ts | 103 +- types/lodash/fp/isArguments.d.ts | 15 +- types/lodash/fp/isArray.d.ts | 15 +- types/lodash/fp/isArrayBuffer.d.ts | 15 +- types/lodash/fp/isArrayLike.d.ts | 78 +- types/lodash/fp/isArrayLikeObject.d.ts | 77 +- types/lodash/fp/isBoolean.d.ts | 15 +- types/lodash/fp/isBuffer.d.ts | 15 +- types/lodash/fp/isDate.d.ts | 15 +- types/lodash/fp/isElement.d.ts | 15 +- types/lodash/fp/isEmpty.d.ts | 16 +- types/lodash/fp/isEqual.d.ts | 141 +- types/lodash/fp/isEqualWith.d.ts | 285 +- types/lodash/fp/isError.d.ts | 16 +- types/lodash/fp/isFinite.d.ts | 17 +- types/lodash/fp/isFunction.d.ts | 15 +- types/lodash/fp/isInteger.d.ts | 31 +- types/lodash/fp/isLength.d.ts | 31 +- types/lodash/fp/isMap.d.ts | 15 +- types/lodash/fp/isMatch.d.ts | 116 +- types/lodash/fp/isMatchWith.d.ts | 285 +- types/lodash/fp/isNaN.d.ts | 17 +- types/lodash/fp/isNative.d.ts | 15 +- types/lodash/fp/isNil.d.ts | 26 +- types/lodash/fp/isNull.d.ts | 15 +- types/lodash/fp/isNumber.d.ts | 17 +- types/lodash/fp/isObject.d.ts | 16 +- types/lodash/fp/isObjectLike.d.ts | 30 +- types/lodash/fp/isPlainObject.d.ts | 18 +- types/lodash/fp/isRegExp.d.ts | 15 +- types/lodash/fp/isSafeInteger.d.ts | 32 +- types/lodash/fp/isSet.d.ts | 15 +- types/lodash/fp/isString.d.ts | 15 +- types/lodash/fp/isSymbol.d.ts | 23 +- types/lodash/fp/isTypedArray.d.ts | 15 +- types/lodash/fp/isUndefined.d.ts | 15 +- types/lodash/fp/isWeakMap.d.ts | 15 +- types/lodash/fp/isWeakSet.d.ts | 15 +- types/lodash/fp/iteratee.d.ts | 65 +- types/lodash/fp/join.d.ts | 53 +- types/lodash/fp/juxt.d.ts | 18 +- types/lodash/fp/kebabCase.d.ts | 15 +- types/lodash/fp/keyBy.d.ts | 225 +- types/lodash/fp/keys.d.ts | 17 +- types/lodash/fp/keysIn.d.ts | 17 +- types/lodash/fp/last.d.ts | 17 +- types/lodash/fp/lastIndexOf.d.ts | 58 +- types/lodash/fp/lastIndexOfFrom.d.ts | 96 +- types/lodash/fp/lowerCase.d.ts | 15 +- types/lodash/fp/lowerFirst.d.ts | 15 +- types/lodash/fp/lt.d.ts | 51 +- types/lodash/fp/lte.d.ts | 51 +- types/lodash/fp/map.d.ts | 588 +- types/lodash/fp/mapKeys.d.ts | 105 +- types/lodash/fp/mapValues.d.ts | 603 +- types/lodash/fp/matches.d.ts | 116 +- types/lodash/fp/matchesProperty.d.ts | 90 +- types/lodash/fp/max.d.ts | 19 +- types/lodash/fp/maxBy.d.ts | 118 +- types/lodash/fp/mean.d.ts | 22 +- types/lodash/fp/meanBy.d.ts | 78 +- types/lodash/fp/memoize.d.ts | 21 +- types/lodash/fp/merge.d.ts | 151 +- types/lodash/fp/mergeAll.d.ts | 36 +- types/lodash/fp/mergeAllWith.d.ts | 183 +- types/lodash/fp/mergeWith.d.ts | 321 +- types/lodash/fp/method.d.ts | 19 +- types/lodash/fp/methodOf.d.ts | 19 +- types/lodash/fp/min.d.ts | 19 +- types/lodash/fp/minBy.d.ts | 118 +- types/lodash/fp/multiply.d.ts | 46 +- types/lodash/fp/nAry.d.ts | 51 +- types/lodash/fp/negate.d.ts | 16 +- types/lodash/fp/noConflict.d.ts | 16 +- types/lodash/fp/noop.d.ts | 14 +- types/lodash/fp/now.d.ts | 14 +- types/lodash/fp/nth.d.ts | 53 +- types/lodash/fp/nthArg.d.ts | 15 +- types/lodash/fp/omit.d.ts | 132 +- types/lodash/fp/omitAll.d.ts | 132 +- types/lodash/fp/omitBy.d.ts | 98 +- types/lodash/fp/once.d.ts | 16 +- types/lodash/fp/orderBy.d.ts | 461 +- types/lodash/fp/over.d.ts | 18 +- types/lodash/fp/overArgs.d.ts | 58 +- types/lodash/fp/overEvery.d.ts | 18 +- types/lodash/fp/overSome.d.ts | 18 +- types/lodash/fp/pad.d.ts | 61 +- types/lodash/fp/padChars.d.ts | 103 +- types/lodash/fp/padCharsEnd.d.ts | 103 +- types/lodash/fp/padCharsStart.d.ts | 103 +- types/lodash/fp/padEnd.d.ts | 61 +- types/lodash/fp/padStart.d.ts | 61 +- types/lodash/fp/parseInt.d.ts | 66 +- types/lodash/fp/partial.d.ts | 56 +- types/lodash/fp/partialRight.d.ts | 51 +- types/lodash/fp/partition.d.ts | 133 +- types/lodash/fp/path.d.ts | 207 +- types/lodash/fp/pathEq.d.ts | 90 +- types/lodash/fp/pathOr.d.ts | 313 +- types/lodash/fp/paths.d.ts | 96 +- types/lodash/fp/pick.d.ts | 159 +- types/lodash/fp/pickAll.d.ts | 159 +- types/lodash/fp/pickBy.d.ts | 93 +- types/lodash/fp/pipe.d.ts | 355 +- types/lodash/fp/placeholder.d.ts | 3 + types/lodash/fp/pluck.d.ts | 588 +- types/lodash/fp/prop.d.ts | 207 +- types/lodash/fp/propEq.d.ts | 90 +- types/lodash/fp/propOr.d.ts | 313 +- types/lodash/fp/property.d.ts | 207 +- types/lodash/fp/propertyOf.d.ts | 207 +- types/lodash/fp/props.d.ts | 96 +- types/lodash/fp/pull.d.ts | 83 +- types/lodash/fp/pullAll.d.ts | 139 +- types/lodash/fp/pullAllBy.d.ts | 502 +- types/lodash/fp/pullAllWith.d.ts | 502 +- types/lodash/fp/pullAt.d.ts | 90 +- types/lodash/fp/random.d.ts | 66 +- types/lodash/fp/range.d.ts | 66 +- types/lodash/fp/rangeRight.d.ts | 176 +- types/lodash/fp/rangeStep.d.ts | 112 +- types/lodash/fp/rangeStepRight.d.ts | 310 +- types/lodash/fp/rearg.d.ts | 58 +- types/lodash/fp/reduce.d.ts | 223 +- types/lodash/fp/reduceRight.d.ts | 172 +- types/lodash/fp/reject.d.ts | 115 +- types/lodash/fp/remove.d.ts | 118 +- types/lodash/fp/repeat.d.ts | 51 +- types/lodash/fp/replace.d.ts | 87 +- types/lodash/fp/rest.d.ts | 19 +- types/lodash/fp/restFrom.d.ts | 66 +- types/lodash/fp/result.d.ts | 63 +- types/lodash/fp/reverse.d.ts | 30 +- types/lodash/fp/round.d.ts | 16 +- types/lodash/fp/runInContext.d.ts | 17 +- types/lodash/fp/sample.d.ts | 25 +- types/lodash/fp/sampleSize.d.ts | 69 +- types/lodash/fp/set.d.ts | 147 +- types/lodash/fp/setWith.d.ts | 233 +- types/lodash/fp/shuffle.d.ts | 25 +- types/lodash/fp/size.d.ts | 16 +- types/lodash/fp/slice.d.ts | 96 +- types/lodash/fp/snakeCase.d.ts | 15 +- types/lodash/fp/some.d.ts | 67 +- types/lodash/fp/sortBy.d.ts | 205 +- types/lodash/fp/sortedIndex.d.ts | 98 +- types/lodash/fp/sortedIndexBy.d.ts | 213 +- types/lodash/fp/sortedIndexOf.d.ts | 83 +- types/lodash/fp/sortedLastIndex.d.ts | 88 +- types/lodash/fp/sortedLastIndexBy.d.ts | 168 +- types/lodash/fp/sortedLastIndexOf.d.ts | 83 +- types/lodash/fp/sortedUniq.d.ts | 23 +- types/lodash/fp/sortedUniqBy.d.ts | 141 +- types/lodash/fp/split.d.ts | 66 +- types/lodash/fp/spread.d.ts | 18 +- types/lodash/fp/spreadFrom.d.ts | 61 +- types/lodash/fp/startCase.d.ts | 15 +- types/lodash/fp/startsWith.d.ts | 56 +- types/lodash/fp/stubArray.d.ts | 14 +- types/lodash/fp/stubFalse.d.ts | 14 +- types/lodash/fp/stubObject.d.ts | 14 +- types/lodash/fp/stubString.d.ts | 14 +- types/lodash/fp/stubTrue.d.ts | 14 +- types/lodash/fp/subtract.d.ts | 76 +- types/lodash/fp/sum.d.ts | 22 +- types/lodash/fp/sumBy.d.ts | 118 +- types/lodash/fp/symmetricDifference.d.ts | 48 +- types/lodash/fp/symmetricDifferenceBy.d.ts | 186 +- types/lodash/fp/symmetricDifferenceWith.d.ts | 177 +- types/lodash/fp/tail.d.ts | 17 +- types/lodash/fp/take.d.ts | 53 +- types/lodash/fp/takeLast.d.ts | 53 +- types/lodash/fp/takeLastWhile.d.ts | 108 +- types/lodash/fp/takeRight.d.ts | 53 +- types/lodash/fp/takeRightWhile.d.ts | 108 +- types/lodash/fp/takeWhile.d.ts | 108 +- types/lodash/fp/tap.d.ts | 66 +- types/lodash/fp/template.d.ts | 37 +- types/lodash/fp/throttle.d.ts | 98 +- types/lodash/fp/thru.d.ts | 56 +- types/lodash/fp/times.d.ts | 56 +- types/lodash/fp/toArray.d.ts | 32 +- types/lodash/fp/toFinite.d.ts | 30 +- types/lodash/fp/toInteger.d.ts | 31 +- types/lodash/fp/toLength.d.ts | 32 +- types/lodash/fp/toLower.d.ts | 15 +- types/lodash/fp/toNumber.d.ts | 29 +- types/lodash/fp/toPairs.d.ts | 25 +- types/lodash/fp/toPairsIn.d.ts | 25 +- types/lodash/fp/toPath.d.ts | 32 +- types/lodash/fp/toPlainObject.d.ts | 16 +- types/lodash/fp/toSafeInteger.d.ts | 30 +- types/lodash/fp/toString.d.ts | 27 +- types/lodash/fp/toUpper.d.ts | 15 +- types/lodash/fp/transform.d.ts | 240 +- types/lodash/fp/trim.d.ts | 16 +- types/lodash/fp/trimChars.d.ts | 51 +- types/lodash/fp/trimCharsEnd.d.ts | 51 +- types/lodash/fp/trimCharsStart.d.ts | 51 +- types/lodash/fp/trimEnd.d.ts | 16 +- types/lodash/fp/trimStart.d.ts | 16 +- types/lodash/fp/truncate.d.ts | 58 +- types/lodash/fp/unapply.d.ts | 19 +- types/lodash/fp/unary.d.ts | 21 +- types/lodash/fp/unescape.d.ts | 19 +- types/lodash/fp/union.d.ts | 53 +- types/lodash/fp/unionBy.d.ts | 105 +- types/lodash/fp/unionWith.d.ts | 177 +- types/lodash/fp/uniq.d.ts | 25 +- types/lodash/fp/uniqBy.d.ts | 186 +- types/lodash/fp/uniqWith.d.ts | 98 +- types/lodash/fp/uniqueId.d.ts | 15 +- types/lodash/fp/unnest.d.ts | 17 +- types/lodash/fp/unset.d.ts | 63 +- types/lodash/fp/unzip.d.ts | 18 +- types/lodash/fp/unzipWith.d.ts | 68 +- types/lodash/fp/update.d.ts | 105 +- types/lodash/fp/updateWith.d.ts | 431 +- types/lodash/fp/upperCase.d.ts | 15 +- types/lodash/fp/upperFirst.d.ts | 15 +- types/lodash/fp/useWith.d.ts | 58 +- types/lodash/fp/values.d.ts | 32 +- types/lodash/fp/valuesIn.d.ts | 25 +- types/lodash/fp/where.d.ts | 48 +- types/lodash/fp/whereEq.d.ts | 116 +- types/lodash/fp/without.d.ts | 53 +- types/lodash/fp/words.d.ts | 16 +- types/lodash/fp/wrap.d.ts | 103 +- types/lodash/fp/xor.d.ts | 48 +- types/lodash/fp/xorBy.d.ts | 186 +- types/lodash/fp/xorWith.d.ts | 177 +- types/lodash/fp/zip.d.ts | 53 +- types/lodash/fp/zipAll.d.ts | 18 +- types/lodash/fp/zipObj.d.ts | 58 +- types/lodash/fp/zipObject.d.ts | 58 +- types/lodash/fp/zipObjectDeep.d.ts | 53 +- types/lodash/fp/zipWith.d.ts | 105 +- types/lodash/lodash-tests.ts | 27 +- types/lodash/scripts/generate-fp.ts | 322 +- types/lodash/tsconfig.json | 5 +- 393 files changed, 5343 insertions(+), 36622 deletions(-) create mode 100644 types/lodash/fp/__.d.ts create mode 100644 types/lodash/fp/placeholder.d.ts diff --git a/types/lodash/common/array.d.ts b/types/lodash/common/array.d.ts index 49f93aa313..34b9548221 100644 --- a/types/lodash/common/array.d.ts +++ b/types/lodash/common/array.d.ts @@ -1405,7 +1405,7 @@ declare module "../index" { this: LoDashImplicitWrapper | null | undefined>, values1: List, values2: List, - ...values: Array | Comparator2>, + ...values: Array | Comparator2> ): LoDashImplicitWrapper; /** @@ -1444,7 +1444,7 @@ declare module "../index" { this: LoDashExplicitWrapper | null | undefined>, values1: List, values2: List, - ...values: Array | Comparator2>, + ...values: Array | Comparator2> ): LoDashExplicitWrapper; /** diff --git a/types/lodash/common/function.d.ts b/types/lodash/common/function.d.ts index 31055a2781..71ec3bb884 100644 --- a/types/lodash/common/function.d.ts +++ b/types/lodash/common/function.d.ts @@ -95,7 +95,7 @@ declare module "../index" { // bind interface FunctionBind { - placeholder: any; + placeholder: __; ( func: (...args: any[]) => any, @@ -145,7 +145,7 @@ declare module "../index" { // bindKey interface FunctionBindKey { - placeholder: any; + placeholder: __; ( object: object, @@ -195,7 +195,7 @@ declare module "../index" { // curry - interface LoDashStatic { + interface Curry { /** * Creates a function that accepts one or more arguments of func that when called either invokes func returning * its result, if all func arguments have been provided, or returns a function that accepts one or more of the @@ -204,7 +204,7 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curry(func: (t1: T1) => R, arity?: number): + (func: (t1: T1) => R, arity?: number): CurriedFunction1; /** * Creates a function that accepts one or more arguments of func that when called either invokes func returning @@ -214,7 +214,7 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curry(func: (t1: T1, t2: T2) => R, arity?: number): + (func: (t1: T1, t2: T2) => R, arity?: number): CurriedFunction2; /** * Creates a function that accepts one or more arguments of func that when called either invokes func returning @@ -224,7 +224,7 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curry(func: (t1: T1, t2: T2, t3: T3) => R, arity?: number): + (func: (t1: T1, t2: T2, t3: T3) => R, arity?: number): CurriedFunction3; /** * Creates a function that accepts one or more arguments of func that when called either invokes func returning @@ -234,7 +234,7 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curry(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R, arity?: number): + (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R, arity?: number): CurriedFunction4; /** * Creates a function that accepts one or more arguments of func that when called either invokes func returning @@ -244,7 +244,7 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curry(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R, arity?: number): + (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R, arity?: number): CurriedFunction5; /** * Creates a function that accepts one or more arguments of func that when called either invokes func returning @@ -254,7 +254,13 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curry(func: (...args: any[]) => any, arity?: number): (...args: any[]) => any; + (func: (...args: any[]) => any, arity?: number): (...args: any[]) => any; + + placeholder: __; + } + + interface LoDashStatic { + curry: Curry; } interface CurriedFunction1 { @@ -265,60 +271,149 @@ declare module "../index" { interface CurriedFunction2 { (): CurriedFunction2; (t1: T1): CurriedFunction1; + (t1: __, t2: T2): CurriedFunction1; (t1: T1, t2: T2): R; } interface CurriedFunction3 { (): CurriedFunction3; (t1: T1): CurriedFunction2; + (t1: __, t2: T2): CurriedFunction2; (t1: T1, t2: T2): CurriedFunction1; + (t1: __, t2: __, t3: T3): CurriedFunction2; + (t1: T1, t2: __, t3: T3): CurriedFunction1; + (t1: __, t2: T2, t3: T3): CurriedFunction1; (t1: T1, t2: T2, t3: T3): R; } interface CurriedFunction4 { (): CurriedFunction4; (t1: T1): CurriedFunction3; + (t1: __, t2: T2): CurriedFunction3; (t1: T1, t2: T2): CurriedFunction2; + (t1: __, t2: __, t3: T3): CurriedFunction3; + (t1: __, t2: __, t3: T3): CurriedFunction2; + (t1: __, t2: T2, t3: T3): CurriedFunction2; (t1: T1, t2: T2, t3: T3): CurriedFunction1; + (t1: __, t2: __, t3: __, t4: T4): CurriedFunction3; + (t1: T1, t2: __, t3: __, t4: T4): CurriedFunction2; + (t1: __, t2: T2, t3: __, t4: T4): CurriedFunction2; + (t1: __, t2: __, t3: T3, t4: T4): CurriedFunction2; + (t1: T1, t2: T2, t3: __, t4: T4): CurriedFunction1; + (t1: T1, t2: __, t3: T3, t4: T4): CurriedFunction1; + (t1: __, t2: T2, t3: T3, t4: T4): CurriedFunction1; (t1: T1, t2: T2, t3: T3, t4: T4): R; } interface CurriedFunction5 { (): CurriedFunction5; (t1: T1): CurriedFunction4; + (t1: __, t2: T2): CurriedFunction4; (t1: T1, t2: T2): CurriedFunction3; + (t1: __, t2: __, t3: T3): CurriedFunction4; + (t1: T1, t2: __, t3: T3): CurriedFunction3; + (t1: __, t2: T2, t3: T3): CurriedFunction3; (t1: T1, t2: T2, t3: T3): CurriedFunction2; + (t1: __, t2: __, t3: __, t4: T4): CurriedFunction4; + (t1: T1, t2: __, t3: __, t4: T4): CurriedFunction3; + (t1: __, t2: T2, t3: __, t4: T4): CurriedFunction3; + (t1: __, t2: __, t3: T3, t4: T4): CurriedFunction3; + (t1: T1, t2: T2, t3: __, t4: T4): CurriedFunction2; + (t1: T1, t2: __, t3: T3, t4: T4): CurriedFunction2; + (t1: __, t2: T2, t3: T3, t4: T4): CurriedFunction2; (t1: T1, t2: T2, t3: T3, t4: T4): CurriedFunction1; + (t1: __, t2: __, t3: __, t4: __, t5: T5): CurriedFunction4; + (t1: T1, t2: __, t3: __, t4: __, t5: T5): CurriedFunction3; + (t1: __, t2: T2, t3: __, t4: __, t5: T5): CurriedFunction3; + (t1: __, t2: __, t3: T3, t4: __, t5: T5): CurriedFunction3; + (t1: __, t2: __, t3: __, t4: T4, t5: T5): CurriedFunction3; + (t1: T1, t2: T2, t3: __, t4: __, t5: T5): CurriedFunction2; + (t1: T1, t2: __, t3: T3, t4: __, t5: T5): CurriedFunction2; + (t1: T1, t2: __, t3: __, t4: T4, t5: T5): CurriedFunction2; + (t1: __, t2: T2, t3: T3, t4: __, t5: T5): CurriedFunction2; + (t1: __, t2: T2, t3: __, t4: T4, t5: T5): CurriedFunction2; + (t1: __, t2: __, t3: T3, t4: T4, t5: T5): CurriedFunction2; + (t1: T1, t2: T2, t3: T3, t4: __, t5: T5): CurriedFunction1; + (t1: T1, t2: T2, t3: __, t4: T4, t5: T5): CurriedFunction1; + (t1: T1, t2: __, t3: T3, t4: T4, t5: T5): CurriedFunction1; + (t1: __, t2: T2, t3: T3, t4: T4, t5: T5): CurriedFunction1; (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R; } + interface RightCurriedFunction1 { (): RightCurriedFunction1; (t1: T1): R; } + interface RightCurriedFunction2 { (): RightCurriedFunction2; (t2: T2): RightCurriedFunction1; + (t1: T1, t2: __): RightCurriedFunction1; (t1: T1, t2: T2): R; } + interface RightCurriedFunction3 { (): RightCurriedFunction3; (t3: T3): RightCurriedFunction2; + (t2: T2, t3: __): RightCurriedFunction2; (t2: T2, t3: T3): RightCurriedFunction1; + (t1: T1, t2: __, t3: __): RightCurriedFunction2; + (t1: T1, t2: T2, t3: __): RightCurriedFunction1; + (t1: T1, t2: __, t3: T3): RightCurriedFunction1; (t1: T1, t2: T2, t3: T3): R; } + interface RightCurriedFunction4 { (): RightCurriedFunction4; (t4: T4): RightCurriedFunction3; + (t3: T3, t4: __): RightCurriedFunction3; (t3: T3, t4: T4): RightCurriedFunction2; + (t2: T2, t3: __, t4: __): RightCurriedFunction3; + (t2: T2, t3: T3, t4: __): RightCurriedFunction2; + (t2: T2, t3: __, t4: T4): RightCurriedFunction2; (t2: T2, t3: T3, t4: T4): RightCurriedFunction1; + (t1: T1, t2: __, t3: __, t4: __): RightCurriedFunction3; + (t1: T1, t2: T2, t3: __, t4: __): RightCurriedFunction2; + (t1: T1, t2: __, t3: T3, t4: __): RightCurriedFunction2; + (t1: T1, t2: __, t3: __, t4: T4): RightCurriedFunction2; + (t1: T1, t2: T2, t3: T3, t4: __): RightCurriedFunction1; + (t1: T1, t2: T2, t3: __, t4: T4): RightCurriedFunction1; + (t1: T1, t2: __, t3: T3, t4: T4): RightCurriedFunction1; (t1: T1, t2: T2, t3: T3, t4: T4): R; } + interface RightCurriedFunction5 { (): RightCurriedFunction5; (t5: T5): RightCurriedFunction4; + (t4: T4, t5: __): RightCurriedFunction4; (t4: T4, t5: T5): RightCurriedFunction3; + (t3: T3, t4: __, t5: __): RightCurriedFunction4; + (t3: T3, t4: T4, t5: __): RightCurriedFunction3; + (t3: T3, t4: __, t5: T5): RightCurriedFunction3; (t3: T3, t4: T4, t5: T5): RightCurriedFunction2; + (t2: T2, t3: __, t4: __, t5: __): RightCurriedFunction4; + (t2: T2, t3: T3, t4: __, t5: __): RightCurriedFunction3; + (t2: T2, t3: __, t4: T4, t5: __): RightCurriedFunction3; + (t2: T2, t3: __, t4: __, t5: T5): RightCurriedFunction3; + (t2: T2, t3: T3, t4: T4, t5: __): RightCurriedFunction2; + (t2: T2, t3: T3, t4: __, t5: T5): RightCurriedFunction2; + (t2: T2, t3: __, t4: T4, t5: T5): RightCurriedFunction2; (t2: T2, t3: T3, t4: T4, t5: T5): RightCurriedFunction1; + (t1: T1, t2: __, t3: __, t4: __, t5: __): RightCurriedFunction4; + (t1: T1, t2: T2, t3: __, t4: __, t5: __): RightCurriedFunction3; + (t1: T1, t2: __, t3: T3, t4: __, t5: __): RightCurriedFunction3; + (t1: T1, t2: __, t3: __, t4: T4, t5: __): RightCurriedFunction3; + (t1: T1, t2: __, t3: __, t4: __, t5: T5): RightCurriedFunction3; + (t1: T1, t2: T2, t3: T3, t4: __, t5: __): RightCurriedFunction2; + (t1: T1, t2: T2, t3: __, t4: T4, t5: __): RightCurriedFunction2; + (t1: T1, t2: T2, t3: __, t4: __, t5: T5): RightCurriedFunction2; + (t1: T1, t2: __, t3: T3, t4: T4, t5: __): RightCurriedFunction2; + (t1: T1, t2: __, t3: T3, t4: __, t5: T5): RightCurriedFunction2; + (t1: T1, t2: __, t3: __, t4: T4, t5: T5): RightCurriedFunction2; + (t1: T1, t2: T2, t3: T3, t4: T4, t5: __): RightCurriedFunction1; + (t1: T1, t2: T2, t3: T3, t4: __, t5: T5): RightCurriedFunction1; + (t1: T1, t2: T2, t3: __, t4: T4, t5: T5): RightCurriedFunction1; + (t1: T1, t2: __, t3: T3, t4: T4, t5: T5): RightCurriedFunction1; (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R; } @@ -398,7 +493,7 @@ declare module "../index" { // curryRight - interface LoDashStatic { + interface CurryRight { /** * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight * instead of _.partial. @@ -406,7 +501,7 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curryRight(func: (t1: T1) => R, arity?: number): + (func: (t1: T1) => R, arity?: number): RightCurriedFunction1; /** * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight @@ -415,7 +510,7 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curryRight(func: (t1: T1, t2: T2) => R, arity?: number): + (func: (t1: T1, t2: T2) => R, arity?: number): RightCurriedFunction2; /** * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight @@ -424,7 +519,7 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curryRight(func: (t1: T1, t2: T2, t3: T3) => R, arity?: number): + (func: (t1: T1, t2: T2, t3: T3) => R, arity?: number): RightCurriedFunction3; /** * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight @@ -433,7 +528,7 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curryRight(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R, arity?: number): + (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R, arity?: number): RightCurriedFunction4; /** * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight @@ -442,7 +537,7 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curryRight(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R, arity?: number): + (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R, arity?: number): RightCurriedFunction5; /** * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight @@ -451,7 +546,13 @@ declare module "../index" { * @param arity The arity of func. * @return Returns the new curried function. */ - curryRight(func: (...args: any[]) => any, arity?: number): (...args: any[]) => any; + (func: (...args: any[]) => any, arity?: number): (...args: any[]) => any; + + placeholder: __; + } + + interface LoDashStatic { + curryRight: CurryRight; } interface LoDashImplicitWrapper { @@ -828,7 +929,8 @@ declare module "../index" { partial: ExplicitPartial; } - type PH = LoDashStatic; + /** The placeholder, to be used in curried functions */ + type __ = LoDashStatic; type Function0 = () => R; type Function1 = (t1: T1) => R; @@ -845,36 +947,38 @@ declare module "../index" { // arity 2 (func: Function2): Function2; (func: Function2, arg1: T1): Function1< T2, R>; - (func: Function2, plc1: PH, arg2: T2): Function1; + (func: Function2, plc1: __, arg2: T2): Function1; (func: Function2, arg1: T1, arg2: T2): Function0< R>; // arity 3 (func: Function3): Function3; (func: Function3, arg1: T1): Function2< T2, T3, R>; - (func: Function3, plc1: PH, arg2: T2): Function2; + (func: Function3, plc1: __, arg2: T2): Function2; (func: Function3, arg1: T1, arg2: T2): Function1< T3, R>; - (func: Function3, plc1: PH, plc2: PH, arg3: T3): Function2; - (func: Function3, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>; - (func: Function3, plc1: PH, arg2: T2, arg3: T3): Function1; + (func: Function3, plc1: __, plc2: __, arg3: T3): Function2; + (func: Function3, arg1: T1, plc2: __, arg3: T3): Function1< T2, R>; + (func: Function3, plc1: __, arg2: T2, arg3: T3): Function1; (func: Function3, arg1: T1, arg2: T2, arg3: T3): Function0< R>; // arity 4 (func: Function4): Function4; (func: Function4, arg1: T1): Function3< T2, T3, T4, R>; - (func: Function4, plc1: PH, arg2: T2): Function3; + (func: Function4, plc1: __, arg2: T2): Function3; (func: Function4, arg1: T1, arg2: T2): Function2< T3, T4, R>; - (func: Function4, plc1: PH, plc2: PH, arg3: T3): Function3; - (func: Function4, arg1: T1, plc2: PH, arg3: T3): Function2< T2, T4, R>; - (func: Function4, plc1: PH, arg2: T2, arg3: T3): Function2; + (func: Function4, plc1: __, plc2: __, arg3: T3): Function3; + (func: Function4, arg1: T1, plc2: __, arg3: T3): Function2< T2, T4, R>; + (func: Function4, plc1: __, arg2: T2, arg3: T3): Function2; (func: Function4, arg1: T1, arg2: T2, arg3: T3): Function1< T4, R>; - (func: Function4, plc1: PH, plc2: PH, plc3: PH, arg4: T4): Function3; - (func: Function4, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>; - (func: Function4, plc1: PH, arg2: T2, plc3: PH, arg4: T4): Function2; - (func: Function4, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>; - (func: Function4, plc1: PH, plc2: PH, arg3: T3, arg4: T4): Function2; - (func: Function4, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>; - (func: Function4, plc1: PH, arg2: T2, arg3: T3, arg4: T4): Function1; + (func: Function4, plc1: __, plc2: __, plc3: __, arg4: T4): Function3; + (func: Function4, arg1: T1, plc2: __, plc3: __, arg4: T4): Function2< T2, T3, R>; + (func: Function4, plc1: __, arg2: T2, plc3: __, arg4: T4): Function2; + (func: Function4, arg1: T1, arg2: T2, plc3: __, arg4: T4): Function1< T3, R>; + (func: Function4, plc1: __, plc2: __, arg3: T3, arg4: T4): Function2; + (func: Function4, arg1: T1, plc2: __, arg3: T3, arg4: T4): Function1< T2, R>; + (func: Function4, plc1: __, arg2: T2, arg3: T3, arg4: T4): Function1; (func: Function4, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>; // catch-all (func: (...args: any[]) => any, ...args: any[]): (...args: any[]) => any; + + placeholder: __; } interface ImplicitPartial { @@ -886,33 +990,33 @@ declare module "../index" { // arity 2 (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, arg2: T2): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; // arity 3 (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, arg2: T2): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, plc2: __, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, arg2: T2, arg3: T3): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashImplicitWrapper>; // arity 4 (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, arg2: T2): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, plc2: __, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, arg2: T2, arg3: T3): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, plc2: __, plc3: __, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __, plc3: __, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, arg2: T2, plc3: __, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: __, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, plc2: __, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: __, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; // catch-all (...args: any[]): LoDashImplicitWrapper<(...args: any[]) => any>; @@ -927,33 +1031,33 @@ declare module "../index" { // arity 2 (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, arg2: T2): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; // arity 3 (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, arg2: T2): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, plc2: __, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, arg2: T2, arg3: T3): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashExplicitWrapper>; // arity 4 (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, arg2: T2): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, plc2: __, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, arg2: T2, arg3: T3): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, plc2: __, plc3: __, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __, plc3: __, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, arg2: T2, plc3: __, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: __, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, plc2: __, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: __, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; // catch-all (...args: any[]): LoDashExplicitWrapper<(...args: any[]) => any>; @@ -994,37 +1098,39 @@ declare module "../index" { (func: Function1, arg1: T1): Function0; // arity 2 (func: Function2): Function2; - (func: Function2, arg1: T1, plc2: PH): Function1< T2, R>; + (func: Function2, arg1: T1, plc2: __): Function1< T2, R>; (func: Function2, arg2: T2): Function1; (func: Function2, arg1: T1, arg2: T2): Function0< R>; // arity 3 (func: Function3): Function3; - (func: Function3, arg1: T1, plc2: PH, plc3: PH): Function2< T2, T3, R>; - (func: Function3, arg2: T2, plc3: PH): Function2; - (func: Function3, arg1: T1, arg2: T2, plc3: PH): Function1< T3, R>; + (func: Function3, arg1: T1, plc2: __, plc3: __): Function2< T2, T3, R>; + (func: Function3, arg2: T2, plc3: __): Function2; + (func: Function3, arg1: T1, arg2: T2, plc3: __): Function1< T3, R>; (func: Function3, arg3: T3): Function2; - (func: Function3, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>; + (func: Function3, arg1: T1, plc2: __, arg3: T3): Function1< T2, R>; (func: Function3, arg2: T2, arg3: T3): Function1; (func: Function3, arg1: T1, arg2: T2, arg3: T3): Function0< R>; // arity 4 (func: Function4): Function4; - (func: Function4, arg1: T1, plc2: PH, plc3: PH, plc4: PH): Function3< T2, T3, T4, R>; - (func: Function4, arg2: T2, plc3: PH, plc4: PH): Function3; - (func: Function4, arg1: T1, arg2: T2, plc3: PH, plc4: PH): Function2< T3, T4, R>; - (func: Function4, arg3: T3, plc4: PH): Function3; - (func: Function4, arg1: T1, plc2: PH, arg3: T3, plc4: PH): Function2< T2, T4, R>; - (func: Function4, arg2: T2, arg3: T3, plc4: PH): Function2; - (func: Function4, arg1: T1, arg2: T2, arg3: T3, plc4: PH): Function1< T4, R>; + (func: Function4, arg1: T1, plc2: __, plc3: __, plc4: __): Function3< T2, T3, T4, R>; + (func: Function4, arg2: T2, plc3: __, plc4: __): Function3; + (func: Function4, arg1: T1, arg2: T2, plc3: __, plc4: __): Function2< T3, T4, R>; + (func: Function4, arg3: T3, plc4: __): Function3; + (func: Function4, arg1: T1, plc2: __, arg3: T3, plc4: __): Function2< T2, T4, R>; + (func: Function4, arg2: T2, arg3: T3, plc4: __): Function2; + (func: Function4, arg1: T1, arg2: T2, arg3: T3, plc4: __): Function1< T4, R>; (func: Function4, arg4: T4): Function3; - (func: Function4, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>; - (func: Function4, arg2: T2, plc3: PH, arg4: T4): Function2; - (func: Function4, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>; + (func: Function4, arg1: T1, plc2: __, plc3: __, arg4: T4): Function2< T2, T3, R>; + (func: Function4, arg2: T2, plc3: __, arg4: T4): Function2; + (func: Function4, arg1: T1, arg2: T2, plc3: __, arg4: T4): Function1< T3, R>; (func: Function4, arg3: T3, arg4: T4): Function2; - (func: Function4, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>; + (func: Function4, arg1: T1, plc2: __, arg3: T3, arg4: T4): Function1< T2, R>; (func: Function4, arg2: T2, arg3: T3, arg4: T4): Function1; (func: Function4, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>; // catch-all (func: (...args: any[]) => any, ...args: any[]): (...args: any[]) => any; + + placeholder: __; } interface ImplicitPartialRight { @@ -1035,33 +1141,33 @@ declare module "../index" { (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; // arity 2 (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg2: T2): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; // arity 3 (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2, plc3: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __, plc3: __): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2, plc3: __): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: __): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __, arg3: T3): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg2: T2, arg3: T3): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashImplicitWrapper>; // arity 4 (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2, plc3: PH, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg3: T3, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2, arg3: T3, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, plc4: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __, plc3: __, plc4: __): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2, plc3: __, plc4: __): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: __, plc4: __): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg3: T3, plc4: __): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __, arg3: T3, plc4: __): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2, arg3: T3, plc4: __): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, plc4: __): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __, plc3: __, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2, plc3: __, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: __, arg4: T4): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: __, arg3: T3, arg4: T4): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; // catch-all @@ -1076,33 +1182,33 @@ declare module "../index" { (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; // arity 2 (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg2: T2): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; // arity 3 (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2, plc3: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __, plc3: __): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2, plc3: __): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: __): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __, arg3: T3): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg2: T2, arg3: T3): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashExplicitWrapper>; // arity 4 (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2, plc3: PH, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg3: T3, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2, arg3: T3, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, plc4: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __, plc3: __, plc4: __): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2, plc3: __, plc4: __): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: __, plc4: __): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg3: T3, plc4: __): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __, arg3: T3, plc4: __): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2, arg3: T3, plc4: __): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, plc4: __): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __, plc3: __, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2, plc3: __, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: __, arg4: T4): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: __, arg3: T3, arg4: T4): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; // catch-all diff --git a/types/lodash/common/object.d.ts b/types/lodash/common/object.d.ts index 4bedba42ae..4845e7f31b 100644 --- a/types/lodash/common/object.d.ts +++ b/types/lodash/common/object.d.ts @@ -3217,7 +3217,7 @@ declare module "../index" { * @param object The object to modify. * @param path The path of the property to set. * @param value The value to set. - * @parem customizer The function to customize assigned values. + * @param customizer The function to customize assigned values. * @return Returns object. */ setWith( diff --git a/types/lodash/common/util.d.ts b/types/lodash/common/util.d.ts index 69fbc42cc0..8aad451ca1 100644 --- a/types/lodash/common/util.d.ts +++ b/types/lodash/common/util.d.ts @@ -1207,14 +1207,14 @@ declare module "../index" { * @param context The context object. * @return Returns a new lodash function. */ - runInContext(context?: object): typeof _; + runInContext(context?: object): LoDashStatic; } interface LoDashImplicitWrapper { /** * @see _.runInContext */ - runInContext(): typeof _; + runInContext(): LoDashStatic; } // stubArray diff --git a/types/lodash/fp.d.ts b/types/lodash/fp.d.ts index 783a56a98f..725ee237aa 100644 --- a/types/lodash/fp.d.ts +++ b/types/lodash/fp.d.ts @@ -2,789 +2,4512 @@ // If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: // npm run fp -import add = require("./fp/add"); -import after = require("./fp/after"); -import all = require("./fp/all"); -import allPass = require("./fp/allPass"); -import always = require("./fp/always"); -import any = require("./fp/any"); -import anyPass = require("./fp/anyPass"); -import apply = require("./fp/apply"); -import ary = require("./fp/ary"); -import assign = require("./fp/assign"); -import assignAll = require("./fp/assignAll"); -import assignAllWith = require("./fp/assignAllWith"); -import assignIn = require("./fp/assignIn"); -import assignInAll = require("./fp/assignInAll"); -import assignInAllWith = require("./fp/assignInAllWith"); -import assignInWith = require("./fp/assignInWith"); -import assignWith = require("./fp/assignWith"); -import assoc = require("./fp/assoc"); -import assocPath = require("./fp/assocPath"); -import at = require("./fp/at"); -import attempt = require("./fp/attempt"); -import before = require("./fp/before"); -import bind = require("./fp/bind"); -import bindAll = require("./fp/bindAll"); -import bindKey = require("./fp/bindKey"); -import camelCase = require("./fp/camelCase"); -import capitalize = require("./fp/capitalize"); -import castArray = require("./fp/castArray"); -import ceil = require("./fp/ceil"); -import chunk = require("./fp/chunk"); -import clamp = require("./fp/clamp"); -import clone = require("./fp/clone"); -import cloneDeep = require("./fp/cloneDeep"); -import cloneDeepWith = require("./fp/cloneDeepWith"); -import cloneWith = require("./fp/cloneWith"); -import compact = require("./fp/compact"); -import complement = require("./fp/complement"); -import compose = require("./fp/compose"); -import concat = require("./fp/concat"); -import cond = require("./fp/cond"); -import conforms = require("./fp/conforms"); -import conformsTo = require("./fp/conformsTo"); -import constant = require("./fp/constant"); -import contains = require("./fp/contains"); -import countBy = require("./fp/countBy"); -import create = require("./fp/create"); -import curry = require("./fp/curry"); -import curryN = require("./fp/curryN"); -import curryRight = require("./fp/curryRight"); -import curryRightN = require("./fp/curryRightN"); -import debounce = require("./fp/debounce"); -import deburr = require("./fp/deburr"); -import defaults = require("./fp/defaults"); -import defaultsAll = require("./fp/defaultsAll"); -import defaultsDeep = require("./fp/defaultsDeep"); -import defaultsDeepAll = require("./fp/defaultsDeepAll"); -import defaultTo = require("./fp/defaultTo"); -import defer = require("./fp/defer"); -import delay = require("./fp/delay"); -import difference = require("./fp/difference"); -import differenceBy = require("./fp/differenceBy"); -import differenceWith = require("./fp/differenceWith"); -import dissoc = require("./fp/dissoc"); -import dissocPath = require("./fp/dissocPath"); -import divide = require("./fp/divide"); -import drop = require("./fp/drop"); -import dropLast = require("./fp/dropLast"); -import dropLastWhile = require("./fp/dropLastWhile"); -import dropRight = require("./fp/dropRight"); -import dropRightWhile = require("./fp/dropRightWhile"); -import dropWhile = require("./fp/dropWhile"); -import each = require("./fp/each"); -import eachRight = require("./fp/eachRight"); -import endsWith = require("./fp/endsWith"); -import entries = require("./fp/entries"); -import entriesIn = require("./fp/entriesIn"); -import eq = require("./fp/eq"); -import equals = require("./fp/equals"); -import escape = require("./fp/escape"); -import escapeRegExp = require("./fp/escapeRegExp"); -import every = require("./fp/every"); -import extend = require("./fp/extend"); -import extendAll = require("./fp/extendAll"); -import extendAllWith = require("./fp/extendAllWith"); -import extendWith = require("./fp/extendWith"); -import F = require("./fp/F"); -import fill = require("./fp/fill"); -import filter = require("./fp/filter"); -import find = require("./fp/find"); -import findFrom = require("./fp/findFrom"); -import findIndex = require("./fp/findIndex"); -import findIndexFrom = require("./fp/findIndexFrom"); -import findKey = require("./fp/findKey"); -import findLast = require("./fp/findLast"); -import findLastFrom = require("./fp/findLastFrom"); -import findLastIndex = require("./fp/findLastIndex"); -import findLastIndexFrom = require("./fp/findLastIndexFrom"); -import findLastKey = require("./fp/findLastKey"); -import first = require("./fp/first"); -import flatMap = require("./fp/flatMap"); -import flatMapDeep = require("./fp/flatMapDeep"); -import flatMapDepth = require("./fp/flatMapDepth"); -import flatten = require("./fp/flatten"); -import flattenDeep = require("./fp/flattenDeep"); -import flattenDepth = require("./fp/flattenDepth"); -import flip = require("./fp/flip"); -import floor = require("./fp/floor"); -import flow = require("./fp/flow"); -import flowRight = require("./fp/flowRight"); -import forEach = require("./fp/forEach"); -import forEachRight = require("./fp/forEachRight"); -import forIn = require("./fp/forIn"); -import forInRight = require("./fp/forInRight"); -import forOwn = require("./fp/forOwn"); -import forOwnRight = require("./fp/forOwnRight"); -import fromPairs = require("./fp/fromPairs"); -import functions = require("./fp/functions"); -import functionsIn = require("./fp/functionsIn"); -import get = require("./fp/get"); -import getOr = require("./fp/getOr"); -import groupBy = require("./fp/groupBy"); -import gt = require("./fp/gt"); -import gte = require("./fp/gte"); -import has = require("./fp/has"); -import hasIn = require("./fp/hasIn"); -import head = require("./fp/head"); -import identical = require("./fp/identical"); -import identity = require("./fp/identity"); -import includes = require("./fp/includes"); -import includesFrom = require("./fp/includesFrom"); -import indexBy = require("./fp/indexBy"); -import indexOf = require("./fp/indexOf"); -import indexOfFrom = require("./fp/indexOfFrom"); -import init = require("./fp/init"); -import initial = require("./fp/initial"); -import inRange = require("./fp/inRange"); -import intersection = require("./fp/intersection"); -import intersectionBy = require("./fp/intersectionBy"); -import intersectionWith = require("./fp/intersectionWith"); -import invert = require("./fp/invert"); -import invertBy = require("./fp/invertBy"); -import invertObj = require("./fp/invertObj"); -import invoke = require("./fp/invoke"); -import invokeArgs = require("./fp/invokeArgs"); -import invokeArgsMap = require("./fp/invokeArgsMap"); -import invokeMap = require("./fp/invokeMap"); -import isArguments = require("./fp/isArguments"); -import isArray = require("./fp/isArray"); -import isArrayBuffer = require("./fp/isArrayBuffer"); -import isArrayLike = require("./fp/isArrayLike"); -import isArrayLikeObject = require("./fp/isArrayLikeObject"); -import isBoolean = require("./fp/isBoolean"); -import isBuffer = require("./fp/isBuffer"); -import isDate = require("./fp/isDate"); -import isElement = require("./fp/isElement"); -import isEmpty = require("./fp/isEmpty"); -import isEqual = require("./fp/isEqual"); -import isEqualWith = require("./fp/isEqualWith"); -import isError = require("./fp/isError"); -import isFinite = require("./fp/isFinite"); -import isFunction = require("./fp/isFunction"); -import isInteger = require("./fp/isInteger"); -import isLength = require("./fp/isLength"); -import isMap = require("./fp/isMap"); -import isMatch = require("./fp/isMatch"); -import isMatchWith = require("./fp/isMatchWith"); -import isNaN = require("./fp/isNaN"); -import isNative = require("./fp/isNative"); -import isNil = require("./fp/isNil"); -import isNull = require("./fp/isNull"); -import isNumber = require("./fp/isNumber"); -import isObject = require("./fp/isObject"); -import isObjectLike = require("./fp/isObjectLike"); -import isPlainObject = require("./fp/isPlainObject"); -import isRegExp = require("./fp/isRegExp"); -import isSafeInteger = require("./fp/isSafeInteger"); -import isSet = require("./fp/isSet"); -import isString = require("./fp/isString"); -import isSymbol = require("./fp/isSymbol"); -import isTypedArray = require("./fp/isTypedArray"); -import isUndefined = require("./fp/isUndefined"); -import isWeakMap = require("./fp/isWeakMap"); -import isWeakSet = require("./fp/isWeakSet"); -import iteratee = require("./fp/iteratee"); -import join = require("./fp/join"); -import juxt = require("./fp/juxt"); -import kebabCase = require("./fp/kebabCase"); -import keyBy = require("./fp/keyBy"); -import keys = require("./fp/keys"); -import keysIn = require("./fp/keysIn"); -import last = require("./fp/last"); -import lastIndexOf = require("./fp/lastIndexOf"); -import lastIndexOfFrom = require("./fp/lastIndexOfFrom"); -import lowerCase = require("./fp/lowerCase"); -import lowerFirst = require("./fp/lowerFirst"); -import lt = require("./fp/lt"); -import lte = require("./fp/lte"); -import map = require("./fp/map"); -import mapKeys = require("./fp/mapKeys"); -import mapValues = require("./fp/mapValues"); -import matches = require("./fp/matches"); -import matchesProperty = require("./fp/matchesProperty"); -import max = require("./fp/max"); -import maxBy = require("./fp/maxBy"); -import mean = require("./fp/mean"); -import meanBy = require("./fp/meanBy"); -import memoize = require("./fp/memoize"); -import merge = require("./fp/merge"); -import mergeAll = require("./fp/mergeAll"); -import mergeAllWith = require("./fp/mergeAllWith"); -import mergeWith = require("./fp/mergeWith"); -import method = require("./fp/method"); -import methodOf = require("./fp/methodOf"); -import min = require("./fp/min"); -import minBy = require("./fp/minBy"); -import multiply = require("./fp/multiply"); -import nAry = require("./fp/nAry"); -import negate = require("./fp/negate"); -import noConflict = require("./fp/noConflict"); -import noop = require("./fp/noop"); -import now = require("./fp/now"); -import nth = require("./fp/nth"); -import nthArg = require("./fp/nthArg"); -import omit = require("./fp/omit"); -import omitAll = require("./fp/omitAll"); -import omitBy = require("./fp/omitBy"); -import once = require("./fp/once"); -import orderBy = require("./fp/orderBy"); -import over = require("./fp/over"); -import overArgs = require("./fp/overArgs"); -import overEvery = require("./fp/overEvery"); -import overSome = require("./fp/overSome"); -import pad = require("./fp/pad"); -import padChars = require("./fp/padChars"); -import padCharsEnd = require("./fp/padCharsEnd"); -import padCharsStart = require("./fp/padCharsStart"); -import padEnd = require("./fp/padEnd"); -import padStart = require("./fp/padStart"); -import parseInt = require("./fp/parseInt"); -import partial = require("./fp/partial"); -import partialRight = require("./fp/partialRight"); -import partition = require("./fp/partition"); -import path = require("./fp/path"); -import pathEq = require("./fp/pathEq"); -import pathOr = require("./fp/pathOr"); -import paths = require("./fp/paths"); -import pick = require("./fp/pick"); -import pickAll = require("./fp/pickAll"); -import pickBy = require("./fp/pickBy"); -import pipe = require("./fp/pipe"); -import pluck = require("./fp/pluck"); -import prop = require("./fp/prop"); -import propEq = require("./fp/propEq"); -import property = require("./fp/property"); -import propertyOf = require("./fp/propertyOf"); -import propOr = require("./fp/propOr"); -import props = require("./fp/props"); -import pull = require("./fp/pull"); -import pullAll = require("./fp/pullAll"); -import pullAllBy = require("./fp/pullAllBy"); -import pullAllWith = require("./fp/pullAllWith"); -import pullAt = require("./fp/pullAt"); -import random = require("./fp/random"); -import range = require("./fp/range"); -import rangeRight = require("./fp/rangeRight"); -import rangeStep = require("./fp/rangeStep"); -import rangeStepRight = require("./fp/rangeStepRight"); -import rearg = require("./fp/rearg"); -import reduce = require("./fp/reduce"); -import reduceRight = require("./fp/reduceRight"); -import reject = require("./fp/reject"); -import remove = require("./fp/remove"); -import repeat = require("./fp/repeat"); -import replace = require("./fp/replace"); -import rest = require("./fp/rest"); -import restFrom = require("./fp/restFrom"); -import result = require("./fp/result"); -import reverse = require("./fp/reverse"); -import round = require("./fp/round"); -import runInContext = require("./fp/runInContext"); -import sample = require("./fp/sample"); -import sampleSize = require("./fp/sampleSize"); -import set = require("./fp/set"); -import setWith = require("./fp/setWith"); -import shuffle = require("./fp/shuffle"); -import size = require("./fp/size"); -import slice = require("./fp/slice"); -import snakeCase = require("./fp/snakeCase"); -import some = require("./fp/some"); -import sortBy = require("./fp/sortBy"); -import sortedIndex = require("./fp/sortedIndex"); -import sortedIndexBy = require("./fp/sortedIndexBy"); -import sortedIndexOf = require("./fp/sortedIndexOf"); -import sortedLastIndex = require("./fp/sortedLastIndex"); -import sortedLastIndexBy = require("./fp/sortedLastIndexBy"); -import sortedLastIndexOf = require("./fp/sortedLastIndexOf"); -import sortedUniq = require("./fp/sortedUniq"); -import sortedUniqBy = require("./fp/sortedUniqBy"); -import split = require("./fp/split"); -import spread = require("./fp/spread"); -import spreadFrom = require("./fp/spreadFrom"); -import startCase = require("./fp/startCase"); -import startsWith = require("./fp/startsWith"); -import stubArray = require("./fp/stubArray"); -import stubFalse = require("./fp/stubFalse"); -import stubObject = require("./fp/stubObject"); -import stubString = require("./fp/stubString"); -import stubTrue = require("./fp/stubTrue"); -import subtract = require("./fp/subtract"); -import sum = require("./fp/sum"); -import sumBy = require("./fp/sumBy"); -import symmetricDifference = require("./fp/symmetricDifference"); -import symmetricDifferenceBy = require("./fp/symmetricDifferenceBy"); -import symmetricDifferenceWith = require("./fp/symmetricDifferenceWith"); -import T = require("./fp/T"); -import tail = require("./fp/tail"); -import take = require("./fp/take"); -import takeLast = require("./fp/takeLast"); -import takeLastWhile = require("./fp/takeLastWhile"); -import takeRight = require("./fp/takeRight"); -import takeRightWhile = require("./fp/takeRightWhile"); -import takeWhile = require("./fp/takeWhile"); -import tap = require("./fp/tap"); -import template = require("./fp/template"); -import throttle = require("./fp/throttle"); -import thru = require("./fp/thru"); -import times = require("./fp/times"); -import toArray = require("./fp/toArray"); -import toFinite = require("./fp/toFinite"); -import toInteger = require("./fp/toInteger"); -import toLength = require("./fp/toLength"); -import toLower = require("./fp/toLower"); -import toNumber = require("./fp/toNumber"); -import toPairs = require("./fp/toPairs"); -import toPairsIn = require("./fp/toPairsIn"); -import toPath = require("./fp/toPath"); -import toPlainObject = require("./fp/toPlainObject"); -import toSafeInteger = require("./fp/toSafeInteger"); -import toString = require("./fp/toString"); -import toUpper = require("./fp/toUpper"); -import transform = require("./fp/transform"); -import trim = require("./fp/trim"); -import trimChars = require("./fp/trimChars"); -import trimCharsEnd = require("./fp/trimCharsEnd"); -import trimCharsStart = require("./fp/trimCharsStart"); -import trimEnd = require("./fp/trimEnd"); -import trimStart = require("./fp/trimStart"); -import truncate = require("./fp/truncate"); -import unapply = require("./fp/unapply"); -import unary = require("./fp/unary"); -import unescape = require("./fp/unescape"); -import union = require("./fp/union"); -import unionBy = require("./fp/unionBy"); -import unionWith = require("./fp/unionWith"); -import uniq = require("./fp/uniq"); -import uniqBy = require("./fp/uniqBy"); -import uniqueId = require("./fp/uniqueId"); -import uniqWith = require("./fp/uniqWith"); -import unnest = require("./fp/unnest"); -import unset = require("./fp/unset"); -import unzip = require("./fp/unzip"); -import unzipWith = require("./fp/unzipWith"); -import update = require("./fp/update"); -import updateWith = require("./fp/updateWith"); -import upperCase = require("./fp/upperCase"); -import upperFirst = require("./fp/upperFirst"); -import useWith = require("./fp/useWith"); -import values = require("./fp/values"); -import valuesIn = require("./fp/valuesIn"); -import where = require("./fp/where"); -import whereEq = require("./fp/whereEq"); -import without = require("./fp/without"); -import words = require("./fp/words"); -import wrap = require("./fp/wrap"); -import xor = require("./fp/xor"); -import xorBy = require("./fp/xorBy"); -import xorWith = require("./fp/xorWith"); -import zip = require("./fp/zip"); -import zipAll = require("./fp/zipAll"); -import zipObj = require("./fp/zipObj"); -import zipObject = require("./fp/zipObject"); -import zipObjectDeep = require("./fp/zipObjectDeep"); -import zipWith = require("./fp/zipWith"); +import lodash = require("./index"); export = _; declare const _: _.LoDashFp; declare namespace _ { + interface LodashAdd { + (augend: number): LodashAdd1x1; + (augend: lodash.__, addend: number): LodashAdd1x2; + (augend: number, addend: number): number; + } + type LodashAdd1x1 = (addend: number) => number; + type LodashAdd1x2 = (augend: number) => number; + interface LodashAfter { + any>(func: TFunc): LodashAfter1x1; + (func: lodash.__, n: number): LodashAfter1x2; + any>(func: TFunc, n: number): TFunc; + } + type LodashAfter1x1 = (n: number) => TFunc; + type LodashAfter1x2 = any>(func: TFunc) => TFunc; + interface LodashEvery { + (predicate: lodash.ValueIterateeCustom): LodashEvery1x1; + (predicate: lodash.__, collection: lodash.List | null | undefined): LodashEvery1x2; + (predicate: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): boolean; + (predicate: lodash.__, collection: T | null | undefined): LodashEvery2x2; + (predicate: lodash.ValueIterateeCustom, collection: T | null | undefined): boolean; + } + type LodashEvery1x1 = (collection: lodash.List | object | null | undefined) => boolean; + type LodashEvery1x2 = (predicate: lodash.ValueIterateeCustom) => boolean; + type LodashEvery2x2 = (predicate: lodash.ValueIterateeCustom) => boolean; + type LodashOverEvery = (predicates: lodash.Many<(...args: T[]) => boolean>) => (...args: T[]) => boolean; + type LodashConstant = (value: T) => () => T; + interface LodashSome { + (predicate: lodash.ValueIterateeCustom): LodashSome1x1; + (predicate: lodash.__, collection: lodash.List | null | undefined): LodashSome1x2; + (predicate: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): boolean; + (predicate: lodash.__, collection: T | null | undefined): LodashSome2x2; + (predicate: lodash.ValueIterateeCustom, collection: T | null | undefined): boolean; + } + type LodashSome1x1 = (collection: lodash.List | object | null | undefined) => boolean; + type LodashSome1x2 = (predicate: lodash.ValueIterateeCustom) => boolean; + type LodashSome2x2 = (predicate: lodash.ValueIterateeCustom) => boolean; + type LodashOverSome = (predicates: lodash.Many<(...args: T[]) => boolean>) => (...args: T[]) => boolean; + type LodashApply = (func: (...args: any[]) => TResult) => (...args: any[]) => TResult; + interface LodashAry { + (n: number): LodashAry1x1; + (n: lodash.__, func: (...args: any[]) => any): LodashAry1x2; + (n: number, func: (...args: any[]) => any): (...args: any[]) => any; + } + type LodashAry1x1 = (func: (...args: any[]) => any) => (...args: any[]) => any; + type LodashAry1x2 = (n: number) => (...args: any[]) => any; + interface LodashAssign { + (object: TObject): LodashAssign1x1; + (object: lodash.__, source: TSource): LodashAssign1x2; + (object: TObject, source: TSource): TObject & TSource; + } + type LodashAssign1x1 = (source: TSource) => TObject & TSource; + type LodashAssign1x2 = (object: TObject) => TObject & TSource; + type LodashAssignAll = (object: ReadonlyArray) => any; + interface LodashAssignAllWith { + (customizer: lodash.AssignCustomizer): LodashAssignAllWith1x1; + (customizer: lodash.__, args: ReadonlyArray): LodashAssignAllWith1x2; + (customizer: lodash.AssignCustomizer, args: ReadonlyArray): any; + } + type LodashAssignAllWith1x1 = (args: ReadonlyArray) => any; + type LodashAssignAllWith1x2 = (customizer: lodash.AssignCustomizer) => any; + interface LodashAssignIn { + (object: TObject): LodashAssignIn1x1; + (object: lodash.__, source: TSource): LodashAssignIn1x2; + (object: TObject, source: TSource): TObject & TSource; + } + type LodashAssignIn1x1 = (source: TSource) => TObject & TSource; + type LodashAssignIn1x2 = (object: TObject) => TObject & TSource; + type LodashAssignInAll = (object: ReadonlyArray) => TResult; + interface LodashAssignInAllWith { + (customizer: lodash.AssignCustomizer): LodashAssignInAllWith1x1; + (customizer: lodash.__, args: ReadonlyArray): LodashAssignInAllWith1x2; + (customizer: lodash.AssignCustomizer, args: ReadonlyArray): any; + } + type LodashAssignInAllWith1x1 = (args: ReadonlyArray) => any; + type LodashAssignInAllWith1x2 = (customizer: lodash.AssignCustomizer) => any; + interface LodashAssignInWith { + (customizer: lodash.AssignCustomizer): LodashAssignInWith1x1; + (customizer: lodash.__, object: TObject): LodashAssignInWith1x2; + (customizer: lodash.AssignCustomizer, object: TObject): LodashAssignInWith1x3; + (customizer: lodash.__, object: lodash.__, source: TSource): LodashAssignInWith1x4; + (customizer: lodash.AssignCustomizer, object: lodash.__, source: TSource): LodashAssignInWith1x5; + (customizer: lodash.__, object: TObject, source: TSource): LodashAssignInWith1x6; + (customizer: lodash.AssignCustomizer, object: TObject, source: TSource): TObject & TSource; + } + interface LodashAssignInWith1x1 { + (object: TObject): LodashAssignInWith1x3; + (object: lodash.__, source: TSource): LodashAssignInWith1x5; + (object: TObject, source: TSource): TObject & TSource; + } + interface LodashAssignInWith1x2 { + (customizer: lodash.AssignCustomizer): LodashAssignInWith1x3; + (customizer: lodash.__, source: TSource): LodashAssignInWith1x6; + (customizer: lodash.AssignCustomizer, source: TSource): TObject & TSource; + } + type LodashAssignInWith1x3 = (source: TSource) => TObject & TSource; + interface LodashAssignInWith1x4 { + (customizer: lodash.AssignCustomizer): LodashAssignInWith1x5; + (customizer: lodash.__, object: TObject): LodashAssignInWith1x6; + (customizer: lodash.AssignCustomizer, object: TObject): TObject & TSource; + } + type LodashAssignInWith1x5 = (object: TObject) => TObject & TSource; + type LodashAssignInWith1x6 = (customizer: lodash.AssignCustomizer) => TObject & TSource; + interface LodashAssignWith { + (customizer: lodash.AssignCustomizer): LodashAssignWith1x1; + (customizer: lodash.__, object: TObject): LodashAssignWith1x2; + (customizer: lodash.AssignCustomizer, object: TObject): LodashAssignWith1x3; + (customizer: lodash.__, object: lodash.__, source: TSource): LodashAssignWith1x4; + (customizer: lodash.AssignCustomizer, object: lodash.__, source: TSource): LodashAssignWith1x5; + (customizer: lodash.__, object: TObject, source: TSource): LodashAssignWith1x6; + (customizer: lodash.AssignCustomizer, object: TObject, source: TSource): TObject & TSource; + } + interface LodashAssignWith1x1 { + (object: TObject): LodashAssignWith1x3; + (object: lodash.__, source: TSource): LodashAssignWith1x5; + (object: TObject, source: TSource): TObject & TSource; + } + interface LodashAssignWith1x2 { + (customizer: lodash.AssignCustomizer): LodashAssignWith1x3; + (customizer: lodash.__, source: TSource): LodashAssignWith1x6; + (customizer: lodash.AssignCustomizer, source: TSource): TObject & TSource; + } + type LodashAssignWith1x3 = (source: TSource) => TObject & TSource; + interface LodashAssignWith1x4 { + (customizer: lodash.AssignCustomizer): LodashAssignWith1x5; + (customizer: lodash.__, object: TObject): LodashAssignWith1x6; + (customizer: lodash.AssignCustomizer, object: TObject): TObject & TSource; + } + type LodashAssignWith1x5 = (object: TObject) => TObject & TSource; + type LodashAssignWith1x6 = (customizer: lodash.AssignCustomizer) => TObject & TSource; + interface LodashSet { + (path: lodash.PropertyPath): LodashSet1x1; + (path: lodash.__, value: any): LodashSet1x2; + (path: lodash.PropertyPath, value: any): LodashSet1x3; + (path: lodash.__, value: lodash.__, object: T): LodashSet1x4; + (path: lodash.PropertyPath, value: lodash.__, object: T): LodashSet1x5; + (path: lodash.__, value: any, object: T): LodashSet1x6; + (path: lodash.PropertyPath, value: any, object: T): T; + (path: lodash.__, value: lodash.__, object: object): LodashSet2x4; + (path: lodash.PropertyPath, value: lodash.__, object: object): LodashSet2x5; + (path: lodash.__, value: any, object: object): LodashSet2x6; + (path: lodash.PropertyPath, value: any, object: object): TResult; + } + interface LodashSet1x1 { + (value: any): LodashSet1x3; + (value: lodash.__, object: T): LodashSet1x5; + (value: any, object: T): T; + (value: lodash.__, object: object): LodashSet2x5; + (value: any, object: object): TResult; + } + interface LodashSet1x2 { + (path: lodash.PropertyPath): LodashSet1x3; + (path: lodash.__, object: T): LodashSet1x6; + (path: lodash.PropertyPath, object: T): T; + (path: lodash.__, object: object): LodashSet2x6; + (path: lodash.PropertyPath, object: object): TResult; + } + interface LodashSet1x3 { + (object: T): T; + (object: object): TResult; + } + interface LodashSet1x4 { + (path: lodash.PropertyPath): LodashSet1x5; + (path: lodash.__, value: any): LodashSet1x6; + (path: lodash.PropertyPath, value: any): T; + } + type LodashSet1x5 = (value: any) => T; + type LodashSet1x6 = (path: lodash.PropertyPath) => T; + interface LodashSet2x4 { + (path: lodash.PropertyPath): LodashSet2x5; + (path: lodash.__, value: any): LodashSet2x6; + (path: lodash.PropertyPath, value: any): TResult; + } + type LodashSet2x5 = (value: any) => TResult; + type LodashSet2x6 = (path: lodash.PropertyPath) => TResult; + interface LodashAt { + (props: lodash.PropertyPath): LodashAt1x1; + (props: lodash.__, object: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashAt1x2; + (props: lodash.PropertyPath, object: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): T[]; + (props: lodash.Many): LodashAt2x1; + (props: lodash.__, object: T | null | undefined): LodashAt2x2; + (props: lodash.Many, object: T | null | undefined): Array; + } + type LodashAt1x1 = (object: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined) => T[]; + type LodashAt1x2 = (props: lodash.PropertyPath) => T[]; + type LodashAt2x1 = (object: T | null | undefined) => Array; + type LodashAt2x2 = (props: lodash.Many) => Array; + type LodashAttempt = (func: (...args: any[]) => TResult) => TResult|Error; + interface LodashBefore { + any>(func: TFunc): LodashBefore1x1; + (func: lodash.__, n: number): LodashBefore1x2; + any>(func: TFunc, n: number): TFunc; + } + type LodashBefore1x1 = (n: number) => TFunc; + type LodashBefore1x2 = any>(func: TFunc) => TFunc; + interface LodashBind { + (func: (...args: any[]) => any): LodashBind1x1; + (func: lodash.__, thisArg: any): LodashBind1x2; + (func: (...args: any[]) => any, thisArg: any): (...args: any[]) => any; + placeholder: lodash.__; + } + type LodashBind1x1 = (thisArg: any) => (...args: any[]) => any; + type LodashBind1x2 = (func: (...args: any[]) => any) => (...args: any[]) => any; + interface LodashBindAll { + (methodNames: lodash.Many): LodashBindAll1x1; + (methodNames: lodash.__, object: T): LodashBindAll1x2; + (methodNames: lodash.Many, object: T): T; + } + type LodashBindAll1x1 = (object: T) => T; + type LodashBindAll1x2 = (methodNames: lodash.Many) => T; + interface LodashBindKey { + (object: object): LodashBindKey1x1; + (object: lodash.__, key: string): LodashBindKey1x2; + (object: object, key: string): (...args: any[]) => any; + placeholder: lodash.__; + } + type LodashBindKey1x1 = (key: string) => (...args: any[]) => any; + type LodashBindKey1x2 = (object: object) => (...args: any[]) => any; + type LodashCamelCase = (string: string) => string; + type LodashCapitalize = (string: string) => string; + type LodashCastArray = (value: lodash.Many) => T[]; + type LodashCeil = (n: number) => number; + interface LodashChunk { + (size: number): LodashChunk1x1; + (size: lodash.__, array: lodash.List | null | undefined): LodashChunk1x2; + (size: number, array: lodash.List | null | undefined): T[][]; + } + type LodashChunk1x1 = (array: lodash.List | null | undefined) => T[][]; + type LodashChunk1x2 = (size: number) => T[][]; + interface LodashClamp { + (lower: number): LodashClamp1x1; + (lower: lodash.__, upper: number): LodashClamp1x2; + (lower: number, upper: number): LodashClamp1x3; + (lower: lodash.__, upper: lodash.__, number: number): LodashClamp1x4; + (lower: number, upper: lodash.__, number: number): LodashClamp1x5; + (lower: lodash.__, upper: number, number: number): LodashClamp1x6; + (lower: number, upper: number, number: number): number; + } + interface LodashClamp1x1 { + (upper: number): LodashClamp1x3; + (upper: lodash.__, number: number): LodashClamp1x5; + (upper: number, number: number): number; + } + interface LodashClamp1x2 { + (lower: number): LodashClamp1x3; + (lower: lodash.__, number: number): LodashClamp1x6; + (lower: number, number: number): number; + } + type LodashClamp1x3 = (number: number) => number; + interface LodashClamp1x4 { + (lower: number): LodashClamp1x5; + (lower: lodash.__, upper: number): LodashClamp1x6; + (lower: number, upper: number): number; + } + type LodashClamp1x5 = (upper: number) => number; + type LodashClamp1x6 = (lower: number) => number; + type LodashClone = (value: T) => T; + type LodashCloneDeep = (value: T) => T; + interface LodashCloneDeepWith { + (customizer: lodash.CloneDeepWithCustomizer): LodashCloneDeepWith1x1; + (customizer: lodash.__, value: T): LodashCloneDeepWith1x2; + (customizer: lodash.CloneDeepWithCustomizer, value: T): any; + } + type LodashCloneDeepWith1x1 = (value: T) => any; + type LodashCloneDeepWith1x2 = (customizer: lodash.CloneDeepWithCustomizer) => any; + interface LodashCloneWith { + (customizer: lodash.CloneWithCustomizer): LodashCloneWith1x1; + (customizer: lodash.__, value: T): LodashCloneWith1x2; + (customizer: lodash.CloneWithCustomizer, value: T): TResult; + (customizer: lodash.CloneWithCustomizer): LodashCloneWith2x1; + (customizer: lodash.CloneWithCustomizer, value: T): TResult | T; + } + type LodashCloneWith1x1 = (value: T) => TResult; + interface LodashCloneWith1x2 { + (customizer: lodash.CloneWithCustomizer): TResult; + (customizer: lodash.CloneWithCustomizer): TResult | T; + } + type LodashCloneWith2x1 = (value: T) => TResult | T; + type LodashCompact = (array: lodash.List | null | undefined) => T[]; + type LodashNegate = any>(predicate: T) => T; + interface LodashFlowRight { + (f2: (a: R1) => R2, f1: () => R1): () => R2; + (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R3; + (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R4; + (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R5; + (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R6; + (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R7; + (f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R2; + (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R3; + (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R4; + (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R5; + (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R6; + (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R7; + (f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R2; + (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R3; + (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R4; + (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R5; + (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R6; + (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R7; + (f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R2; + (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R3; + (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R4; + (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R5; + (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R6; + (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R7; + (f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; + (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; + (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; + (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; + (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; + (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; + (f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R2; + (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R3; + (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R4; + (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R5; + (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R6; + (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R7; + (f7: (a: any) => any, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array any>>): (...args: any[]) => any; + (funcs: Array any>>): (...args: any[]) => any; + } + interface LodashConcat { + (array: lodash.Many): LodashConcat1x1; + (array: lodash.__, values: lodash.Many): LodashConcat1x2; + (array: lodash.Many, values: lodash.Many): T[]; + } + type LodashConcat1x1 = (values: lodash.Many) => T[]; + type LodashConcat1x2 = (array: lodash.Many) => T[]; + type LodashCond = (pairs: Array>) => (Target: T) => R; + interface LodashConformsTo { + (source: lodash.ConformsPredicateObject): LodashConformsTo1x1; + (source: lodash.__, object: T): LodashConformsTo1x2; + (source: lodash.ConformsPredicateObject, object: T): boolean; + } + type LodashConformsTo1x1 = (object: T) => boolean; + type LodashConformsTo1x2 = (source: lodash.ConformsPredicateObject) => boolean; + interface LodashContains { + (target: T): LodashContains1x1; + (target: lodash.__, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashContains1x2; + (target: T, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): boolean; + } + type LodashContains1x1 = (collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined) => boolean; + type LodashContains1x2 = (target: T) => boolean; + interface LodashCountBy { + (iteratee: (value: string) => T): LodashCountBy1x1; + (iteratee: lodash.__, collection: string | null | undefined): LodashCountBy1x2; + (iteratee: (value: string) => T, collection: string | null | undefined): lodash.Dictionary; + (iteratee: lodash.ValueIteratee): LodashCountBy2x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashCountBy2x2; + (iteratee: lodash.ValueIteratee, collection: lodash.List | null | undefined): lodash.Dictionary; + (iteratee: lodash.__, collection: T | null | undefined): LodashCountBy3x2; + (iteratee: lodash.ValueIteratee, collection: T | null | undefined): lodash.Dictionary; + } + type LodashCountBy1x1 = (collection: string | null | undefined) => lodash.Dictionary; + type LodashCountBy1x2 = (iteratee: (value: string) => T) => lodash.Dictionary; + type LodashCountBy2x1 = (collection: lodash.List | object | null | undefined) => lodash.Dictionary; + type LodashCountBy2x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; + type LodashCountBy3x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; + type LodashCreate = (prototype: T) => T & U; + interface LodashCurry { + (func: (t1: T1) => R): lodash.CurriedFunction1; + (func: (t1: T1, t2: T2) => R): lodash.CurriedFunction2; + (func: (t1: T1, t2: T2, t3: T3) => R): lodash.CurriedFunction3; + (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): lodash.CurriedFunction4; + (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): lodash.CurriedFunction5; + (func: (...args: any[]) => any): (...args: any[]) => any; + placeholder: lodash.__; + } + interface LodashCurryN { + (arity: number): LodashCurryN1x1; + (arity: lodash.__, func: (t1: T1) => R): LodashCurryN1x2; + (arity: number, func: (t1: T1) => R): lodash.CurriedFunction1; + (arity: lodash.__, func: (t1: T1, t2: T2) => R): LodashCurryN2x2; + (arity: number, func: (t1: T1, t2: T2) => R): lodash.CurriedFunction2; + (arity: lodash.__, func: (t1: T1, t2: T2, t3: T3) => R): LodashCurryN3x2; + (arity: number, func: (t1: T1, t2: T2, t3: T3) => R): lodash.CurriedFunction3; + (arity: lodash.__, func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): LodashCurryN4x2; + (arity: number, func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): lodash.CurriedFunction4; + (arity: lodash.__, func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): LodashCurryN5x2; + (arity: number, func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): lodash.CurriedFunction5; + (arity: lodash.__, func: (...args: any[]) => any): LodashCurryN6x2; + (arity: number, func: (...args: any[]) => any): (...args: any[]) => any; + placeholder: lodash.__; + } + interface LodashCurryN1x1 { + (func: (t1: T1) => R): lodash.CurriedFunction1; + (func: (t1: T1, t2: T2) => R): lodash.CurriedFunction2; + (func: (t1: T1, t2: T2, t3: T3) => R): lodash.CurriedFunction3; + (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): lodash.CurriedFunction4; + (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): lodash.CurriedFunction5; + (func: (...args: any[]) => any): (...args: any[]) => any; + } + type LodashCurryN1x2 = (arity: number) => lodash.CurriedFunction1; + type LodashCurryN2x2 = (arity: number) => lodash.CurriedFunction2; + type LodashCurryN3x2 = (arity: number) => lodash.CurriedFunction3; + type LodashCurryN4x2 = (arity: number) => lodash.CurriedFunction4; + type LodashCurryN5x2 = (arity: number) => lodash.CurriedFunction5; + type LodashCurryN6x2 = (arity: number) => (...args: any[]) => any; + interface LodashCurryRight { + (func: (t1: T1) => R): lodash.RightCurriedFunction1; + (func: (t1: T1, t2: T2) => R): lodash.RightCurriedFunction2; + (func: (t1: T1, t2: T2, t3: T3) => R): lodash.RightCurriedFunction3; + (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): lodash.RightCurriedFunction4; + (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): lodash.RightCurriedFunction5; + (func: (...args: any[]) => any): (...args: any[]) => any; + placeholder: lodash.__; + } + interface LodashCurryRightN { + (arity: number): LodashCurryRightN1x1; + (arity: lodash.__, func: (t1: T1) => R): LodashCurryRightN1x2; + (arity: number, func: (t1: T1) => R): lodash.RightCurriedFunction1; + (arity: lodash.__, func: (t1: T1, t2: T2) => R): LodashCurryRightN2x2; + (arity: number, func: (t1: T1, t2: T2) => R): lodash.RightCurriedFunction2; + (arity: lodash.__, func: (t1: T1, t2: T2, t3: T3) => R): LodashCurryRightN3x2; + (arity: number, func: (t1: T1, t2: T2, t3: T3) => R): lodash.RightCurriedFunction3; + (arity: lodash.__, func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): LodashCurryRightN4x2; + (arity: number, func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): lodash.RightCurriedFunction4; + (arity: lodash.__, func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): LodashCurryRightN5x2; + (arity: number, func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): lodash.RightCurriedFunction5; + (arity: lodash.__, func: (...args: any[]) => any): LodashCurryRightN6x2; + (arity: number, func: (...args: any[]) => any): (...args: any[]) => any; + placeholder: lodash.__; + } + interface LodashCurryRightN1x1 { + (func: (t1: T1) => R): lodash.RightCurriedFunction1; + (func: (t1: T1, t2: T2) => R): lodash.RightCurriedFunction2; + (func: (t1: T1, t2: T2, t3: T3) => R): lodash.RightCurriedFunction3; + (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): lodash.RightCurriedFunction4; + (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): lodash.RightCurriedFunction5; + (func: (...args: any[]) => any): (...args: any[]) => any; + } + type LodashCurryRightN1x2 = (arity: number) => lodash.RightCurriedFunction1; + type LodashCurryRightN2x2 = (arity: number) => lodash.RightCurriedFunction2; + type LodashCurryRightN3x2 = (arity: number) => lodash.RightCurriedFunction3; + type LodashCurryRightN4x2 = (arity: number) => lodash.RightCurriedFunction4; + type LodashCurryRightN5x2 = (arity: number) => lodash.RightCurriedFunction5; + type LodashCurryRightN6x2 = (arity: number) => (...args: any[]) => any; + interface LodashDebounce { + (wait: number): LodashDebounce1x1; + any>(wait: lodash.__, func: T): LodashDebounce1x2; + any>(wait: number, func: T): T & lodash.Cancelable; + } + type LodashDebounce1x1 = any>(func: T) => T & lodash.Cancelable; + type LodashDebounce1x2 = (wait: number) => T & lodash.Cancelable; + type LodashDeburr = (string: string) => string; + interface LodashDefaults { + (source: TSource): LodashDefaults1x1; + (source: lodash.__, object: TObject): LodashDefaults1x2; + (source: TSource, object: TObject): TSource & TObject; + } + type LodashDefaults1x1 = (object: TObject) => TSource & TObject; + type LodashDefaults1x2 = (source: TSource) => TSource & TObject; + type LodashDefaultsAll = (object: ReadonlyArray) => any; + interface LodashDefaultsDeep { + (sources: any): LodashDefaultsDeep1x1; + (sources: lodash.__, object: any): LodashDefaultsDeep1x2; + (sources: any, object: any): any; + } + type LodashDefaultsDeep1x1 = (object: any) => any; + type LodashDefaultsDeep1x2 = (sources: any) => any; + type LodashDefaultsDeepAll = (object: ReadonlyArray) => any; + interface LodashDefaultTo { + (defaultValue: T): LodashDefaultTo1x1; + (defaultValue: lodash.__, value: T | null | undefined): LodashDefaultTo1x2; + (defaultValue: T, value: T | null | undefined): T; + (defaultValue: TDefault): LodashDefaultTo2x1; + (defaultValue: TDefault, value: T | null | undefined): T | TDefault; + } + type LodashDefaultTo1x1 = (value: T | null | undefined) => T; + interface LodashDefaultTo1x2 { + (defaultValue: T): T; + (defaultValue: TDefault): T | TDefault; + } + type LodashDefaultTo2x1 = (value: T | null | undefined) => T | TDefault; + type LodashDefer = (func: (...args: any[]) => any, ...args: any[]) => number; + interface LodashDelay { + (wait: number): LodashDelay1x1; + (wait: lodash.__, func: (...args: any[]) => any): LodashDelay1x2; + (wait: number, func: (...args: any[]) => any): number; + } + type LodashDelay1x1 = (func: (...args: any[]) => any) => number; + type LodashDelay1x2 = (wait: number) => number; + interface LodashDifference { + (array: lodash.List | null | undefined): LodashDifference1x1; + (array: lodash.__, values: lodash.List): LodashDifference1x2; + (array: lodash.List | null | undefined, values: lodash.List): T[]; + } + type LodashDifference1x1 = (values: lodash.List) => T[]; + type LodashDifference1x2 = (array: lodash.List | null | undefined) => T[]; + interface LodashDifferenceBy { + (iteratee: lodash.ValueIteratee): LodashDifferenceBy1x1; + (iteratee: lodash.__, array: lodash.List | null | undefined): LodashDifferenceBy1x2; + (iteratee: lodash.ValueIteratee, array: lodash.List | null | undefined): LodashDifferenceBy1x3; + (iteratee: lodash.__, array: lodash.__, values: lodash.List): LodashDifferenceBy1x4; + (iteratee: lodash.ValueIteratee, array: lodash.__, values: lodash.List): LodashDifferenceBy1x5; + (iteratee: lodash.__, array: lodash.List | null | undefined, values: lodash.List): LodashDifferenceBy1x6; + (iteratee: lodash.ValueIteratee, array: lodash.List | null | undefined, values: lodash.List): T1[]; + } + interface LodashDifferenceBy1x1 { + (array: lodash.List | null | undefined): LodashDifferenceBy1x3; + (array: lodash.__, values: lodash.List): LodashDifferenceBy1x5; + (array: lodash.List | null | undefined, values: lodash.List): T1[]; + } + interface LodashDifferenceBy1x2 { + (iteratee: lodash.ValueIteratee): LodashDifferenceBy1x3; + (iteratee: lodash.__, values: lodash.List): LodashDifferenceBy1x6; + (iteratee: lodash.ValueIteratee, values: lodash.List): T1[]; + } + type LodashDifferenceBy1x3 = (values: lodash.List) => T1[]; + interface LodashDifferenceBy1x4 { + (iteratee: lodash.ValueIteratee): LodashDifferenceBy1x5; + (iteratee: lodash.__, array: lodash.List | null | undefined): LodashDifferenceBy1x6; + (iteratee: lodash.ValueIteratee, array: lodash.List | null | undefined): T1[]; + } + type LodashDifferenceBy1x5 = (array: lodash.List | null | undefined) => T1[]; + type LodashDifferenceBy1x6 = (iteratee: lodash.ValueIteratee) => T1[]; + interface LodashDifferenceWith { + (comparator: lodash.Comparator2): LodashDifferenceWith1x1; + (comparator: lodash.__, array: lodash.List | null | undefined): LodashDifferenceWith1x2; + (comparator: lodash.Comparator2, array: lodash.List | null | undefined): LodashDifferenceWith1x3; + (comparator: lodash.__, array: lodash.__, values: lodash.List): LodashDifferenceWith1x4; + (comparator: lodash.Comparator2, array: lodash.__, values: lodash.List): LodashDifferenceWith1x5; + (comparator: lodash.__, array: lodash.List | null | undefined, values: lodash.List): LodashDifferenceWith1x6; + (comparator: lodash.Comparator2, array: lodash.List | null | undefined, values: lodash.List): T1[]; + } + interface LodashDifferenceWith1x1 { + (array: lodash.List | null | undefined): LodashDifferenceWith1x3; + (array: lodash.__, values: lodash.List): LodashDifferenceWith1x5; + (array: lodash.List | null | undefined, values: lodash.List): T1[]; + } + interface LodashDifferenceWith1x2 { + (comparator: lodash.Comparator2): LodashDifferenceWith1x3; + (comparator: lodash.__, values: lodash.List): LodashDifferenceWith1x6; + (comparator: lodash.Comparator2, values: lodash.List): T1[]; + } + type LodashDifferenceWith1x3 = (values: lodash.List) => T1[]; + interface LodashDifferenceWith1x4 { + (comparator: lodash.Comparator2): LodashDifferenceWith1x5; + (comparator: lodash.__, array: lodash.List | null | undefined): LodashDifferenceWith1x6; + (comparator: lodash.Comparator2, array: lodash.List | null | undefined): T1[]; + } + type LodashDifferenceWith1x5 = (array: lodash.List | null | undefined) => T1[]; + type LodashDifferenceWith1x6 = (comparator: lodash.Comparator2) => T1[]; + interface LodashUnset { + (path: lodash.PropertyPath): LodashUnset1x1; + (path: lodash.__, object: any): LodashUnset1x2; + (path: lodash.PropertyPath, object: any): boolean; + } + type LodashUnset1x1 = (object: any) => boolean; + type LodashUnset1x2 = (path: lodash.PropertyPath) => boolean; + interface LodashDivide { + (dividend: number): LodashDivide1x1; + (dividend: lodash.__, divisor: number): LodashDivide1x2; + (dividend: number, divisor: number): number; + } + type LodashDivide1x1 = (divisor: number) => number; + type LodashDivide1x2 = (dividend: number) => number; + interface LodashDrop { + (n: number): LodashDrop1x1; + (n: lodash.__, array: lodash.List | null | undefined): LodashDrop1x2; + (n: number, array: lodash.List | null | undefined): T[]; + } + type LodashDrop1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashDrop1x2 = (n: number) => T[]; + interface LodashDropRight { + (n: number): LodashDropRight1x1; + (n: lodash.__, array: lodash.List | null | undefined): LodashDropRight1x2; + (n: number, array: lodash.List | null | undefined): T[]; + } + type LodashDropRight1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashDropRight1x2 = (n: number) => T[]; + interface LodashDropRightWhile { + (predicate: lodash.ValueIteratee): LodashDropRightWhile1x1; + (predicate: lodash.__, array: lodash.List | null | undefined): LodashDropRightWhile1x2; + (predicate: lodash.ValueIteratee, array: lodash.List | null | undefined): T[]; + } + type LodashDropRightWhile1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashDropRightWhile1x2 = (predicate: lodash.ValueIteratee) => T[]; + interface LodashDropWhile { + (predicate: lodash.ValueIteratee): LodashDropWhile1x1; + (predicate: lodash.__, array: lodash.List | null | undefined): LodashDropWhile1x2; + (predicate: lodash.ValueIteratee, array: lodash.List | null | undefined): T[]; + } + type LodashDropWhile1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashDropWhile1x2 = (predicate: lodash.ValueIteratee) => T[]; + interface LodashForEach { + (iteratee: (value: T) => any): LodashForEach1x1; + (iteratee: lodash.__, collection: ReadonlyArray): LodashForEach1x2; + (iteratee: (value: T) => any, collection: ReadonlyArray): T[]; + (iteratee: (value: string) => any): LodashForEach2x1; + (iteratee: lodash.__, collection: string): LodashForEach2x2; + (iteratee: (value: string) => any, collection: string): string; + (iteratee: lodash.__, collection: lodash.List): LodashForEach3x2; + (iteratee: (value: T) => any, collection: lodash.List): lodash.List; + (iteratee: lodash.__, collection: T): LodashForEach4x2; + (iteratee: (value: T[keyof T]) => any, collection: T): T; + (iteratee: lodash.__, collection: TArray & (T[] | null | undefined)): LodashForEach5x2; + (iteratee: (value: T) => any, collection: TArray & (T[] | null | undefined)): TArray; + (iteratee: lodash.__, collection: TString): LodashForEach6x2; + (iteratee: (value: string) => any, collection: TString): TString; + | null | undefined>(iteratee: lodash.__, collection: TList & (lodash.List | null | undefined)): LodashForEach7x2; + | null | undefined>(iteratee: (value: T) => any, collection: TList & (lodash.List | null | undefined)): TList; + (iteratee: lodash.__, collection: T | null | undefined): LodashForEach8x2; + (iteratee: (value: T[keyof T]) => any, collection: T | null | undefined): T | null | undefined; + } + interface LodashForEach1x1 { + (collection: ReadonlyArray): T[]; + (collection: lodash.List): lodash.List; + (collection: T1): T1; + (collection: TArray & (T[] | null | undefined)): TArray; + | null | undefined>(collection: TList & (lodash.List | null | undefined)): TList; + (collection: T1 | null | undefined): T1 | null | undefined; + } + type LodashForEach1x2 = (iteratee: (value: T) => any) => T[]; + interface LodashForEach2x1 { + (collection: string): string; + (collection: TString): TString; + } + type LodashForEach2x2 = (iteratee: (value: string) => any) => string; + type LodashForEach3x2 = (iteratee: (value: T) => any) => lodash.List; + type LodashForEach4x2 = (iteratee: (value: T[keyof T]) => any) => T; + type LodashForEach5x2 = (iteratee: (value: T) => any) => TArray; + type LodashForEach6x2 = (iteratee: (value: string) => any) => TString; + type LodashForEach7x2 = (iteratee: (value: T) => any) => TList; + type LodashForEach8x2 = (iteratee: (value: T[keyof T]) => any) => T | null | undefined; + interface LodashForEachRight { + (iteratee: (value: T) => any): LodashForEachRight1x1; + (iteratee: lodash.__, collection: ReadonlyArray): LodashForEachRight1x2; + (iteratee: (value: T) => any, collection: ReadonlyArray): T[]; + (iteratee: (value: string) => any): LodashForEachRight2x1; + (iteratee: lodash.__, collection: string): LodashForEachRight2x2; + (iteratee: (value: string) => any, collection: string): string; + (iteratee: lodash.__, collection: lodash.List): LodashForEachRight3x2; + (iteratee: (value: T) => any, collection: lodash.List): lodash.List; + (iteratee: lodash.__, collection: T): LodashForEachRight4x2; + (iteratee: (value: T[keyof T]) => any, collection: T): T; + (iteratee: lodash.__, collection: TArray & (T[] | null | undefined)): LodashForEachRight5x2; + (iteratee: (value: T) => any, collection: TArray & (T[] | null | undefined)): TArray; + (iteratee: lodash.__, collection: TString): LodashForEachRight6x2; + (iteratee: (value: string) => any, collection: TString): TString; + | null | undefined>(iteratee: lodash.__, collection: TList & (lodash.List | null | undefined)): LodashForEachRight7x2; + | null | undefined>(iteratee: (value: T) => any, collection: TList & (lodash.List | null | undefined)): TList; + (iteratee: lodash.__, collection: T | null | undefined): LodashForEachRight8x2; + (iteratee: (value: T[keyof T]) => any, collection: T | null | undefined): T | null | undefined; + } + interface LodashForEachRight1x1 { + (collection: ReadonlyArray): T[]; + (collection: lodash.List): lodash.List; + (collection: T1): T1; + (collection: TArray & (T[] | null | undefined)): TArray; + | null | undefined>(collection: TList & (lodash.List | null | undefined)): TList; + (collection: T1 | null | undefined): T1 | null | undefined; + } + type LodashForEachRight1x2 = (iteratee: (value: T) => any) => T[]; + interface LodashForEachRight2x1 { + (collection: string): string; + (collection: TString): TString; + } + type LodashForEachRight2x2 = (iteratee: (value: string) => any) => string; + type LodashForEachRight3x2 = (iteratee: (value: T) => any) => lodash.List; + type LodashForEachRight4x2 = (iteratee: (value: T[keyof T]) => any) => T; + type LodashForEachRight5x2 = (iteratee: (value: T) => any) => TArray; + type LodashForEachRight6x2 = (iteratee: (value: string) => any) => TString; + type LodashForEachRight7x2 = (iteratee: (value: T) => any) => TList; + type LodashForEachRight8x2 = (iteratee: (value: T[keyof T]) => any) => T | null | undefined; + interface LodashEndsWith { + (target: string): LodashEndsWith1x1; + (target: lodash.__, string: string): LodashEndsWith1x2; + (target: string, string: string): boolean; + } + type LodashEndsWith1x1 = (string: string) => boolean; + type LodashEndsWith1x2 = (target: string) => boolean; + interface LodashToPairs { + (object: lodash.Dictionary | lodash.NumericDictionary): Array<[string, T]>; + (object: object): Array<[string, any]>; + } + interface LodashToPairsIn { + (object: lodash.Dictionary | lodash.NumericDictionary): Array<[string, T]>; + (object: object): Array<[string, any]>; + } + interface LodashEq { + (value: any): LodashEq1x1; + (value: lodash.__, other: any): LodashEq1x2; + (value: any, other: any): boolean; + } + type LodashEq1x1 = (other: any) => boolean; + type LodashEq1x2 = (value: any) => boolean; + interface LodashIsEqual { + (value: any): LodashIsEqual1x1; + (value: lodash.__, other: any): LodashIsEqual1x2; + (value: any, other: any): boolean; + } + type LodashIsEqual1x1 = (other: any) => boolean; + type LodashIsEqual1x2 = (value: any) => boolean; + type LodashEscape = (string: string) => string; + type LodashEscapeRegExp = (string: string) => string; + interface LodashExtend { + (object: TObject): LodashExtend1x1; + (object: lodash.__, source: TSource): LodashExtend1x2; + (object: TObject, source: TSource): TObject & TSource; + } + type LodashExtend1x1 = (source: TSource) => TObject & TSource; + type LodashExtend1x2 = (object: TObject) => TObject & TSource; + type LodashExtendAll = (object: ReadonlyArray) => TResult; + interface LodashExtendAllWith { + (customizer: lodash.AssignCustomizer): LodashExtendAllWith1x1; + (customizer: lodash.__, args: ReadonlyArray): LodashExtendAllWith1x2; + (customizer: lodash.AssignCustomizer, args: ReadonlyArray): any; + } + type LodashExtendAllWith1x1 = (args: ReadonlyArray) => any; + type LodashExtendAllWith1x2 = (customizer: lodash.AssignCustomizer) => any; + interface LodashExtendWith { + (customizer: lodash.AssignCustomizer): LodashExtendWith1x1; + (customizer: lodash.__, object: TObject): LodashExtendWith1x2; + (customizer: lodash.AssignCustomizer, object: TObject): LodashExtendWith1x3; + (customizer: lodash.__, object: lodash.__, source: TSource): LodashExtendWith1x4; + (customizer: lodash.AssignCustomizer, object: lodash.__, source: TSource): LodashExtendWith1x5; + (customizer: lodash.__, object: TObject, source: TSource): LodashExtendWith1x6; + (customizer: lodash.AssignCustomizer, object: TObject, source: TSource): TObject & TSource; + } + interface LodashExtendWith1x1 { + (object: TObject): LodashExtendWith1x3; + (object: lodash.__, source: TSource): LodashExtendWith1x5; + (object: TObject, source: TSource): TObject & TSource; + } + interface LodashExtendWith1x2 { + (customizer: lodash.AssignCustomizer): LodashExtendWith1x3; + (customizer: lodash.__, source: TSource): LodashExtendWith1x6; + (customizer: lodash.AssignCustomizer, source: TSource): TObject & TSource; + } + type LodashExtendWith1x3 = (source: TSource) => TObject & TSource; + interface LodashExtendWith1x4 { + (customizer: lodash.AssignCustomizer): LodashExtendWith1x5; + (customizer: lodash.__, object: TObject): LodashExtendWith1x6; + (customizer: lodash.AssignCustomizer, object: TObject): TObject & TSource; + } + type LodashExtendWith1x5 = (object: TObject) => TObject & TSource; + type LodashExtendWith1x6 = (customizer: lodash.AssignCustomizer) => TObject & TSource; + type LodashStubFalse = () => boolean; + interface LodashFill { + (start: number): LodashFill1x1; + (start: lodash.__, end: number): LodashFill1x2; + (start: number, end: number): LodashFill1x3; + (start: lodash.__, end: lodash.__, value: T): LodashFill1x4; + (start: number, end: lodash.__, value: T): LodashFill1x5; + (start: lodash.__, end: number, value: T): LodashFill1x6; + (start: number, end: number, value: T): LodashFill1x7; + (start: lodash.__, end: lodash.__, value: lodash.__, array: U[] | null | undefined): LodashFill1x8; + (start: number, end: lodash.__, value: lodash.__, array: U[] | null | undefined): LodashFill1x9; + (start: lodash.__, end: number, value: lodash.__, array: U[] | null | undefined): LodashFill1x10; + (start: number, end: number, value: lodash.__, array: U[] | null | undefined): LodashFill1x11; + (start: lodash.__, end: lodash.__, value: T, array: U[] | null | undefined): LodashFill1x12; + (start: number, end: lodash.__, value: T, array: U[] | null | undefined): LodashFill1x13; + (start: lodash.__, end: number, value: T, array: U[] | null | undefined): LodashFill1x14; + (start: number, end: number, value: T, array: U[] | null | undefined): Array; + (start: lodash.__, end: lodash.__, value: lodash.__, array: lodash.List | null | undefined): LodashFill2x8; + (start: number, end: lodash.__, value: lodash.__, array: lodash.List | null | undefined): LodashFill2x9; + (start: lodash.__, end: number, value: lodash.__, array: lodash.List | null | undefined): LodashFill2x10; + (start: number, end: number, value: lodash.__, array: lodash.List | null | undefined): LodashFill2x11; + (start: lodash.__, end: lodash.__, value: T, array: lodash.List | null | undefined): LodashFill2x12; + (start: number, end: lodash.__, value: T, array: lodash.List | null | undefined): LodashFill2x13; + (start: lodash.__, end: number, value: T, array: lodash.List | null | undefined): LodashFill2x14; + (start: number, end: number, value: T, array: lodash.List | null | undefined): lodash.List; + } + interface LodashFill1x1 { + (end: number): LodashFill1x3; + (end: lodash.__, value: T): LodashFill1x5; + (end: number, value: T): LodashFill1x7; + (end: lodash.__, value: lodash.__, array: U[] | null | undefined): LodashFill1x9; + (end: number, value: lodash.__, array: U[] | null | undefined): LodashFill1x11; + (end: lodash.__, value: T, array: U[] | null | undefined): LodashFill1x13; + (end: number, value: T, array: U[] | null | undefined): Array; + (end: lodash.__, value: lodash.__, array: lodash.List | null | undefined): LodashFill2x9; + (end: number, value: lodash.__, array: lodash.List | null | undefined): LodashFill2x11; + (end: lodash.__, value: T, array: lodash.List | null | undefined): LodashFill2x13; + (end: number, value: T, array: lodash.List | null | undefined): lodash.List; + } + interface LodashFill1x2 { + (start: number): LodashFill1x3; + (start: lodash.__, value: T): LodashFill1x6; + (start: number, value: T): LodashFill1x7; + (start: lodash.__, value: lodash.__, array: U[] | null | undefined): LodashFill1x10; + (start: number, value: lodash.__, array: U[] | null | undefined): LodashFill1x11; + (start: lodash.__, value: T, array: U[] | null | undefined): LodashFill1x14; + (start: number, value: T, array: U[] | null | undefined): Array; + (start: lodash.__, value: lodash.__, array: lodash.List | null | undefined): LodashFill2x10; + (start: number, value: lodash.__, array: lodash.List | null | undefined): LodashFill2x11; + (start: lodash.__, value: T, array: lodash.List | null | undefined): LodashFill2x14; + (start: number, value: T, array: lodash.List | null | undefined): lodash.List; + } + interface LodashFill1x3 { + (value: T): LodashFill1x7; + (value: lodash.__, array: U[] | null | undefined): LodashFill1x11; + (value: T, array: U[] | null | undefined): Array; + (value: lodash.__, array: lodash.List | null | undefined): LodashFill2x11; + (value: T, array: lodash.List | null | undefined): lodash.List; + } + interface LodashFill1x4 { + (start: number): LodashFill1x5; + (start: lodash.__, end: number): LodashFill1x6; + (start: number, end: number): LodashFill1x7; + (start: lodash.__, end: lodash.__, array: U[] | null | undefined): LodashFill1x12; + (start: number, end: lodash.__, array: U[] | null | undefined): LodashFill1x13; + (start: lodash.__, end: number, array: U[] | null | undefined): LodashFill1x14; + (start: number, end: number, array: U[] | null | undefined): Array; + (start: lodash.__, end: lodash.__, array: lodash.List | null | undefined): LodashFill2x12; + (start: number, end: lodash.__, array: lodash.List | null | undefined): LodashFill2x13; + (start: lodash.__, end: number, array: lodash.List | null | undefined): LodashFill2x14; + (start: number, end: number, array: lodash.List | null | undefined): lodash.List; + } + interface LodashFill1x5 { + (end: number): LodashFill1x7; + (end: lodash.__, array: U[] | null | undefined): LodashFill1x13; + (end: number, array: U[] | null | undefined): Array; + (end: lodash.__, array: lodash.List | null | undefined): LodashFill2x13; + (end: number, array: lodash.List | null | undefined): lodash.List; + } + interface LodashFill1x6 { + (start: number): LodashFill1x7; + (start: lodash.__, array: U[] | null | undefined): LodashFill1x14; + (start: number, array: U[] | null | undefined): Array; + (start: lodash.__, array: lodash.List | null | undefined): LodashFill2x14; + (start: number, array: lodash.List | null | undefined): lodash.List; + } + interface LodashFill1x7 { + (array: U[] | null | undefined): Array; + (array: lodash.List | null | undefined): lodash.List; + } + interface LodashFill1x8 { + (start: number): LodashFill1x9; + (start: lodash.__, end: number): LodashFill1x10; + (start: number, end: number): LodashFill1x11; + (start: lodash.__, end: lodash.__, value: T): LodashFill1x12; + (start: number, end: lodash.__, value: T): LodashFill1x13; + (start: lodash.__, end: number, value: T): LodashFill1x14; + (start: number, end: number, value: T): Array; + } + interface LodashFill1x9 { + (end: number): LodashFill1x11; + (end: lodash.__, value: T): LodashFill1x13; + (end: number, value: T): Array; + } + interface LodashFill1x10 { + (start: number): LodashFill1x11; + (start: lodash.__, value: T): LodashFill1x14; + (start: number, value: T): Array; + } + type LodashFill1x11 = (value: T) => Array; + interface LodashFill1x12 { + (start: number): LodashFill1x13; + (start: lodash.__, end: number): LodashFill1x14; + (start: number, end: number): Array; + } + type LodashFill1x13 = (end: number) => Array; + type LodashFill1x14 = (start: number) => Array; + interface LodashFill2x8 { + (start: number): LodashFill2x9; + (start: lodash.__, end: number): LodashFill2x10; + (start: number, end: number): LodashFill2x11; + (start: lodash.__, end: lodash.__, value: T): LodashFill2x12; + (start: number, end: lodash.__, value: T): LodashFill2x13; + (start: lodash.__, end: number, value: T): LodashFill2x14; + (start: number, end: number, value: T): lodash.List; + } + interface LodashFill2x9 { + (end: number): LodashFill2x11; + (end: lodash.__, value: T): LodashFill2x13; + (end: number, value: T): lodash.List; + } + interface LodashFill2x10 { + (start: number): LodashFill2x11; + (start: lodash.__, value: T): LodashFill2x14; + (start: number, value: T): lodash.List; + } + type LodashFill2x11 = (value: T) => lodash.List; + interface LodashFill2x12 { + (start: number): LodashFill2x13; + (start: lodash.__, end: number): LodashFill2x14; + (start: number, end: number): lodash.List; + } + type LodashFill2x13 = (end: number) => lodash.List; + type LodashFill2x14 = (start: number) => lodash.List; + interface LodashFilter { + (predicate: (value: string) => boolean): LodashFilter1x1; + (predicate: lodash.__, collection: string | null | undefined): LodashFilter1x2; + (predicate: (value: string) => boolean, collection: string | null | undefined): string[]; + (predicate: lodash.ValueIteratorTypeGuard): LodashFilter2x1; + (predicate: lodash.__, collection: lodash.List | null | undefined): LodashFilter2x2; + (predicate: lodash.ValueIteratorTypeGuard, collection: lodash.List | null | undefined): S[]; + (predicate: lodash.ValueIterateeCustom): LodashFilter3x1; + (predicate: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): T[]; + (predicate: lodash.ValueIteratorTypeGuard): LodashFilter4x1; + (predicate: lodash.__, collection: T | null | undefined): LodashFilter4x2; + (predicate: lodash.ValueIteratorTypeGuard, collection: T | null | undefined): S[]; + (predicate: lodash.ValueIterateeCustom, collection: T | null | undefined): Array; + } + type LodashFilter1x1 = (collection: string | null | undefined) => string[]; + type LodashFilter1x2 = (predicate: (value: string) => boolean) => string[]; + type LodashFilter2x1 = (collection: lodash.List | null | undefined) => S[]; + interface LodashFilter2x2 { + (predicate: lodash.ValueIteratorTypeGuard): S[]; + (predicate: lodash.ValueIterateeCustom): T[]; + } + type LodashFilter3x1 = (collection: lodash.List | object | null | undefined) => T[]; + type LodashFilter4x1 = (collection: T | null | undefined) => S[]; + interface LodashFilter4x2 { + (predicate: lodash.ValueIteratorTypeGuard): S[]; + (predicate: lodash.ValueIterateeCustom): Array; + } + interface LodashFind { + (predicate: lodash.ValueIteratorTypeGuard): LodashFind1x1; + (predicate: lodash.__, collection: lodash.List | null | undefined): LodashFind1x2; + (predicate: lodash.ValueIteratorTypeGuard, collection: lodash.List | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom): LodashFind2x1; + (predicate: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): T|undefined; + (predicate: lodash.ValueIteratorTypeGuard): LodashFind3x1; + (predicate: lodash.__, collection: T | null | undefined): LodashFind3x2; + (predicate: lodash.ValueIteratorTypeGuard, collection: T | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom, collection: T | null | undefined): T[keyof T]|undefined; + } + type LodashFind1x1 = (collection: lodash.List | null | undefined) => S|undefined; + interface LodashFind1x2 { + (predicate: lodash.ValueIteratorTypeGuard): S|undefined; + (predicate: lodash.ValueIterateeCustom): T|undefined; + } + type LodashFind2x1 = (collection: lodash.List | object | null | undefined) => T|undefined; + type LodashFind3x1 = (collection: T | null | undefined) => S|undefined; + interface LodashFind3x2 { + (predicate: lodash.ValueIteratorTypeGuard): S|undefined; + (predicate: lodash.ValueIterateeCustom): T[keyof T]|undefined; + } + interface LodashFindFrom { + (predicate: lodash.ValueIteratorTypeGuard): LodashFindFrom1x1; + (predicate: lodash.__, fromIndex: number): LodashFindFrom1x2; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number): LodashFindFrom1x3; + (predicate: lodash.__, fromIndex: lodash.__, collection: lodash.List | null | undefined): LodashFindFrom1x4; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: lodash.__, collection: lodash.List | null | undefined): LodashFindFrom1x5; + (predicate: lodash.__, fromIndex: number, collection: lodash.List | null | undefined): LodashFindFrom1x6; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number, collection: lodash.List | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom): LodashFindFrom2x1; + (predicate: lodash.ValueIterateeCustom, fromIndex: number): LodashFindFrom2x3; + (predicate: lodash.ValueIterateeCustom, fromIndex: lodash.__, collection: lodash.List | null | undefined): LodashFindFrom2x5; + (predicate: lodash.ValueIterateeCustom, fromIndex: number, collection: lodash.List | null | undefined): T|undefined; + (predicate: lodash.ValueIteratorTypeGuard): LodashFindFrom3x1; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number): LodashFindFrom3x3; + (predicate: lodash.__, fromIndex: lodash.__, collection: T | null | undefined): LodashFindFrom3x4; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: lodash.__, collection: T | null | undefined): LodashFindFrom3x5; + (predicate: lodash.__, fromIndex: number, collection: T | null | undefined): LodashFindFrom3x6; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number, collection: T | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom, fromIndex: lodash.__, collection: T | null | undefined): LodashFindFrom4x5; + (predicate: lodash.ValueIterateeCustom, fromIndex: number, collection: T | null | undefined): T[keyof T]|undefined; + } + interface LodashFindFrom1x1 { + (fromIndex: number): LodashFindFrom1x3; + (fromIndex: lodash.__, collection: lodash.List | null | undefined): LodashFindFrom1x5; + (fromIndex: number, collection: lodash.List | null | undefined): S|undefined; + } + interface LodashFindFrom1x2 { + (predicate: lodash.ValueIteratorTypeGuard): LodashFindFrom1x3; + (predicate: lodash.__, collection: lodash.List | null | undefined): LodashFindFrom1x6; + (predicate: lodash.ValueIteratorTypeGuard, collection: lodash.List | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom): LodashFindFrom2x3; + (predicate: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): T|undefined; + (predicate: lodash.ValueIteratorTypeGuard): LodashFindFrom3x3; + (predicate: lodash.__, collection: T | null | undefined): LodashFindFrom3x6; + (predicate: lodash.ValueIteratorTypeGuard, collection: T | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom, collection: T | null | undefined): T[keyof T]|undefined; + } + type LodashFindFrom1x3 = (collection: lodash.List | null | undefined) => S|undefined; + interface LodashFindFrom1x4 { + (predicate: lodash.ValueIteratorTypeGuard): LodashFindFrom1x5; + (predicate: lodash.__, fromIndex: number): LodashFindFrom1x6; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number): S|undefined; + (predicate: lodash.ValueIterateeCustom): LodashFindFrom2x5; + (predicate: lodash.ValueIterateeCustom, fromIndex: number): T|undefined; + } + type LodashFindFrom1x5 = (fromIndex: number) => S|undefined; + interface LodashFindFrom1x6 { + (predicate: lodash.ValueIteratorTypeGuard): S|undefined; + (predicate: lodash.ValueIterateeCustom): T|undefined; + } + interface LodashFindFrom2x1 { + (fromIndex: number): LodashFindFrom2x3; + (fromIndex: lodash.__, collection: lodash.List | null | undefined): LodashFindFrom2x5; + (fromIndex: number, collection: lodash.List | object | null | undefined): T|undefined; + (fromIndex: lodash.__, collection: T1 | null | undefined): LodashFindFrom4x5; + } + interface LodashFindFrom2x3 { + (collection: lodash.List | null | undefined): T|undefined; + (collection: object | null | undefined): object|undefined; + } + type LodashFindFrom2x5 = (fromIndex: number) => T|undefined; + interface LodashFindFrom3x1 { + (fromIndex: number): LodashFindFrom3x3; + (fromIndex: lodash.__, collection: T | null | undefined): LodashFindFrom3x5; + (fromIndex: number, collection: T | null | undefined): S|undefined; + } + type LodashFindFrom3x3 = (collection: T | null | undefined) => S|undefined; + interface LodashFindFrom3x4 { + (predicate: lodash.ValueIteratorTypeGuard): LodashFindFrom3x5; + (predicate: lodash.__, fromIndex: number): LodashFindFrom3x6; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number): S|undefined; + (predicate: lodash.ValueIterateeCustom): LodashFindFrom4x5; + (predicate: lodash.ValueIterateeCustom, fromIndex: number): T[keyof T]|undefined; + } + type LodashFindFrom3x5 = (fromIndex: number) => S|undefined; + interface LodashFindFrom3x6 { + (predicate: lodash.ValueIteratorTypeGuard): S|undefined; + (predicate: lodash.ValueIterateeCustom): T[keyof T]|undefined; + } + type LodashFindFrom4x5 = (fromIndex: number) => T[keyof T]|undefined; + interface LodashFindIndex { + (predicate: lodash.ValueIterateeCustom): LodashFindIndex1x1; + (predicate: lodash.__, array: lodash.List | null | undefined): LodashFindIndex1x2; + (predicate: lodash.ValueIterateeCustom, array: lodash.List | null | undefined): number; + } + type LodashFindIndex1x1 = (array: lodash.List | null | undefined) => number; + type LodashFindIndex1x2 = (predicate: lodash.ValueIterateeCustom) => number; + interface LodashFindIndexFrom { + (predicate: lodash.ValueIterateeCustom): LodashFindIndexFrom1x1; + (predicate: lodash.__, fromIndex: number): LodashFindIndexFrom1x2; + (predicate: lodash.ValueIterateeCustom, fromIndex: number): LodashFindIndexFrom1x3; + (predicate: lodash.__, fromIndex: lodash.__, array: lodash.List | null | undefined): LodashFindIndexFrom1x4; + (predicate: lodash.ValueIterateeCustom, fromIndex: lodash.__, array: lodash.List | null | undefined): LodashFindIndexFrom1x5; + (predicate: lodash.__, fromIndex: number, array: lodash.List | null | undefined): LodashFindIndexFrom1x6; + (predicate: lodash.ValueIterateeCustom, fromIndex: number, array: lodash.List | null | undefined): number; + } + interface LodashFindIndexFrom1x1 { + (fromIndex: number): LodashFindIndexFrom1x3; + (fromIndex: lodash.__, array: lodash.List | null | undefined): LodashFindIndexFrom1x5; + (fromIndex: number, array: lodash.List | null | undefined): number; + } + interface LodashFindIndexFrom1x2 { + (predicate: lodash.ValueIterateeCustom): LodashFindIndexFrom1x3; + (predicate: lodash.__, array: lodash.List | null | undefined): LodashFindIndexFrom1x6; + (predicate: lodash.ValueIterateeCustom, array: lodash.List | null | undefined): number; + } + type LodashFindIndexFrom1x3 = (array: lodash.List | null | undefined) => number; + interface LodashFindIndexFrom1x4 { + (predicate: lodash.ValueIterateeCustom): LodashFindIndexFrom1x5; + (predicate: lodash.__, fromIndex: number): LodashFindIndexFrom1x6; + (predicate: lodash.ValueIterateeCustom, fromIndex: number): number; + } + type LodashFindIndexFrom1x5 = (fromIndex: number) => number; + type LodashFindIndexFrom1x6 = (predicate: lodash.ValueIterateeCustom) => number; + interface LodashFindKey { + (predicate: lodash.ValueIteratee): LodashFindKey1x1; + (predicate: lodash.__, object: T | null | undefined): LodashFindKey1x2; + (predicate: lodash.ValueIteratee, object: T | null | undefined): string | undefined; + } + type LodashFindKey1x1 = (object: object | null | undefined) => string | undefined; + type LodashFindKey1x2 = (predicate: lodash.ValueIteratee) => string | undefined; + interface LodashFindLast { + (predicate: lodash.ValueIteratorTypeGuard): LodashFindLast1x1; + (predicate: lodash.__, collection: lodash.List | null | undefined): LodashFindLast1x2; + (predicate: lodash.ValueIteratorTypeGuard, collection: lodash.List | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom): LodashFindLast2x1; + (predicate: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): T|undefined; + (predicate: lodash.ValueIteratorTypeGuard): LodashFindLast3x1; + (predicate: lodash.__, collection: T | null | undefined): LodashFindLast3x2; + (predicate: lodash.ValueIteratorTypeGuard, collection: T | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom, collection: T | null | undefined): T[keyof T]|undefined; + } + type LodashFindLast1x1 = (collection: lodash.List | null | undefined) => S|undefined; + interface LodashFindLast1x2 { + (predicate: lodash.ValueIteratorTypeGuard): S|undefined; + (predicate: lodash.ValueIterateeCustom): T|undefined; + } + type LodashFindLast2x1 = (collection: lodash.List | object | null | undefined) => T|undefined; + type LodashFindLast3x1 = (collection: T | null | undefined) => S|undefined; + interface LodashFindLast3x2 { + (predicate: lodash.ValueIteratorTypeGuard): S|undefined; + (predicate: lodash.ValueIterateeCustom): T[keyof T]|undefined; + } + interface LodashFindLastFrom { + (predicate: lodash.ValueIteratorTypeGuard): LodashFindLastFrom1x1; + (predicate: lodash.__, fromIndex: number): LodashFindLastFrom1x2; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number): LodashFindLastFrom1x3; + (predicate: lodash.__, fromIndex: lodash.__, collection: lodash.List | null | undefined): LodashFindLastFrom1x4; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: lodash.__, collection: lodash.List | null | undefined): LodashFindLastFrom1x5; + (predicate: lodash.__, fromIndex: number, collection: lodash.List | null | undefined): LodashFindLastFrom1x6; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number, collection: lodash.List | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom): LodashFindLastFrom2x1; + (predicate: lodash.ValueIterateeCustom, fromIndex: number): LodashFindLastFrom2x3; + (predicate: lodash.ValueIterateeCustom, fromIndex: lodash.__, collection: lodash.List | null | undefined): LodashFindLastFrom2x5; + (predicate: lodash.ValueIterateeCustom, fromIndex: number, collection: lodash.List | null | undefined): T|undefined; + (predicate: lodash.ValueIteratorTypeGuard): LodashFindLastFrom3x1; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number): LodashFindLastFrom3x3; + (predicate: lodash.__, fromIndex: lodash.__, collection: T | null | undefined): LodashFindLastFrom3x4; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: lodash.__, collection: T | null | undefined): LodashFindLastFrom3x5; + (predicate: lodash.__, fromIndex: number, collection: T | null | undefined): LodashFindLastFrom3x6; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number, collection: T | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom, fromIndex: lodash.__, collection: T | null | undefined): LodashFindLastFrom4x5; + (predicate: lodash.ValueIterateeCustom, fromIndex: number, collection: T | null | undefined): T[keyof T]|undefined; + } + interface LodashFindLastFrom1x1 { + (fromIndex: number): LodashFindLastFrom1x3; + (fromIndex: lodash.__, collection: lodash.List | null | undefined): LodashFindLastFrom1x5; + (fromIndex: number, collection: lodash.List | null | undefined): S|undefined; + } + interface LodashFindLastFrom1x2 { + (predicate: lodash.ValueIteratorTypeGuard): LodashFindLastFrom1x3; + (predicate: lodash.__, collection: lodash.List | null | undefined): LodashFindLastFrom1x6; + (predicate: lodash.ValueIteratorTypeGuard, collection: lodash.List | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom): LodashFindLastFrom2x3; + (predicate: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): T|undefined; + (predicate: lodash.ValueIteratorTypeGuard): LodashFindLastFrom3x3; + (predicate: lodash.__, collection: T | null | undefined): LodashFindLastFrom3x6; + (predicate: lodash.ValueIteratorTypeGuard, collection: T | null | undefined): S|undefined; + (predicate: lodash.ValueIterateeCustom, collection: T | null | undefined): T[keyof T]|undefined; + } + type LodashFindLastFrom1x3 = (collection: lodash.List | null | undefined) => S|undefined; + interface LodashFindLastFrom1x4 { + (predicate: lodash.ValueIteratorTypeGuard): LodashFindLastFrom1x5; + (predicate: lodash.__, fromIndex: number): LodashFindLastFrom1x6; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number): S|undefined; + (predicate: lodash.ValueIterateeCustom): LodashFindLastFrom2x5; + (predicate: lodash.ValueIterateeCustom, fromIndex: number): T|undefined; + } + type LodashFindLastFrom1x5 = (fromIndex: number) => S|undefined; + interface LodashFindLastFrom1x6 { + (predicate: lodash.ValueIteratorTypeGuard): S|undefined; + (predicate: lodash.ValueIterateeCustom): T|undefined; + } + interface LodashFindLastFrom2x1 { + (fromIndex: number): LodashFindLastFrom2x3; + (fromIndex: lodash.__, collection: lodash.List | null | undefined): LodashFindLastFrom2x5; + (fromIndex: number, collection: lodash.List | object | null | undefined): T|undefined; + (fromIndex: lodash.__, collection: T1 | null | undefined): LodashFindLastFrom4x5; + } + interface LodashFindLastFrom2x3 { + (collection: lodash.List | null | undefined): T|undefined; + (collection: object | null | undefined): object|undefined; + } + type LodashFindLastFrom2x5 = (fromIndex: number) => T|undefined; + interface LodashFindLastFrom3x1 { + (fromIndex: number): LodashFindLastFrom3x3; + (fromIndex: lodash.__, collection: T | null | undefined): LodashFindLastFrom3x5; + (fromIndex: number, collection: T | null | undefined): S|undefined; + } + type LodashFindLastFrom3x3 = (collection: T | null | undefined) => S|undefined; + interface LodashFindLastFrom3x4 { + (predicate: lodash.ValueIteratorTypeGuard): LodashFindLastFrom3x5; + (predicate: lodash.__, fromIndex: number): LodashFindLastFrom3x6; + (predicate: lodash.ValueIteratorTypeGuard, fromIndex: number): S|undefined; + (predicate: lodash.ValueIterateeCustom): LodashFindLastFrom4x5; + (predicate: lodash.ValueIterateeCustom, fromIndex: number): T[keyof T]|undefined; + } + type LodashFindLastFrom3x5 = (fromIndex: number) => S|undefined; + interface LodashFindLastFrom3x6 { + (predicate: lodash.ValueIteratorTypeGuard): S|undefined; + (predicate: lodash.ValueIterateeCustom): T[keyof T]|undefined; + } + type LodashFindLastFrom4x5 = (fromIndex: number) => T[keyof T]|undefined; + interface LodashFindLastIndex { + (predicate: lodash.ValueIterateeCustom): LodashFindLastIndex1x1; + (predicate: lodash.__, array: lodash.List | null | undefined): LodashFindLastIndex1x2; + (predicate: lodash.ValueIterateeCustom, array: lodash.List | null | undefined): number; + } + type LodashFindLastIndex1x1 = (array: lodash.List | null | undefined) => number; + type LodashFindLastIndex1x2 = (predicate: lodash.ValueIterateeCustom) => number; + interface LodashFindLastIndexFrom { + (predicate: lodash.ValueIterateeCustom): LodashFindLastIndexFrom1x1; + (predicate: lodash.__, fromIndex: number): LodashFindLastIndexFrom1x2; + (predicate: lodash.ValueIterateeCustom, fromIndex: number): LodashFindLastIndexFrom1x3; + (predicate: lodash.__, fromIndex: lodash.__, array: lodash.List | null | undefined): LodashFindLastIndexFrom1x4; + (predicate: lodash.ValueIterateeCustom, fromIndex: lodash.__, array: lodash.List | null | undefined): LodashFindLastIndexFrom1x5; + (predicate: lodash.__, fromIndex: number, array: lodash.List | null | undefined): LodashFindLastIndexFrom1x6; + (predicate: lodash.ValueIterateeCustom, fromIndex: number, array: lodash.List | null | undefined): number; + } + interface LodashFindLastIndexFrom1x1 { + (fromIndex: number): LodashFindLastIndexFrom1x3; + (fromIndex: lodash.__, array: lodash.List | null | undefined): LodashFindLastIndexFrom1x5; + (fromIndex: number, array: lodash.List | null | undefined): number; + } + interface LodashFindLastIndexFrom1x2 { + (predicate: lodash.ValueIterateeCustom): LodashFindLastIndexFrom1x3; + (predicate: lodash.__, array: lodash.List | null | undefined): LodashFindLastIndexFrom1x6; + (predicate: lodash.ValueIterateeCustom, array: lodash.List | null | undefined): number; + } + type LodashFindLastIndexFrom1x3 = (array: lodash.List | null | undefined) => number; + interface LodashFindLastIndexFrom1x4 { + (predicate: lodash.ValueIterateeCustom): LodashFindLastIndexFrom1x5; + (predicate: lodash.__, fromIndex: number): LodashFindLastIndexFrom1x6; + (predicate: lodash.ValueIterateeCustom, fromIndex: number): number; + } + type LodashFindLastIndexFrom1x5 = (fromIndex: number) => number; + type LodashFindLastIndexFrom1x6 = (predicate: lodash.ValueIterateeCustom) => number; + interface LodashFindLastKey { + (predicate: lodash.ValueIteratee): LodashFindLastKey1x1; + (predicate: lodash.__, object: T | null | undefined): LodashFindLastKey1x2; + (predicate: lodash.ValueIteratee, object: T | null | undefined): string | undefined; + } + type LodashFindLastKey1x1 = (object: object | null | undefined) => string | undefined; + type LodashFindLastKey1x2 = (predicate: lodash.ValueIteratee) => string | undefined; + type LodashHead = (array: lodash.List | null | undefined) => T | undefined; + interface LodashFlatMap { + (iteratee: (value: T) => lodash.Many): LodashFlatMap1x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashFlatMap1x2; + (iteratee: (value: T) => lodash.Many, collection: lodash.List | null | undefined): TResult[]; + (iteratee: (value: T[keyof T]) => lodash.Many): LodashFlatMap2x1; + (iteratee: lodash.__, collection: T | null | undefined): LodashFlatMap2x2; + (iteratee: (value: T[keyof T]) => lodash.Many, collection: T | null | undefined): TResult[]; + (iteratee: string): LodashFlatMap3x1; + (iteratee: lodash.__, collection: object | null | undefined): LodashFlatMap3x2; + (iteratee: string, collection: object | null | undefined): any[]; + (iteratee: object): LodashFlatMap4x1; + (iteratee: object, collection: object | null | undefined): boolean[]; + } + type LodashFlatMap1x1 = (collection: lodash.List | null | undefined) => TResult[]; + type LodashFlatMap1x2 = (iteratee: (value: T) => lodash.Many) => TResult[]; + type LodashFlatMap2x1 = (collection: T | null | undefined) => TResult[]; + type LodashFlatMap2x2 = (iteratee: (value: T[keyof T]) => lodash.Many) => TResult[]; + type LodashFlatMap3x1 = (collection: object | null | undefined) => any[]; + interface LodashFlatMap3x2 { + (iteratee: string): any[]; + (iteratee: object): boolean[]; + } + type LodashFlatMap4x1 = (collection: object | null | undefined) => boolean[]; + interface LodashFlatMapDeep { + (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult): LodashFlatMapDeep1x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashFlatMapDeep1x2; + (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult, collection: lodash.List | null | undefined): TResult[]; + (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult): LodashFlatMapDeep2x1; + (iteratee: lodash.__, collection: T | null | undefined): LodashFlatMapDeep2x2; + (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult, collection: T | null | undefined): TResult[]; + (iteratee: string): LodashFlatMapDeep3x1; + (iteratee: lodash.__, collection: object | null | undefined): LodashFlatMapDeep3x2; + (iteratee: string, collection: object | null | undefined): any[]; + (iteratee: object): LodashFlatMapDeep4x1; + (iteratee: object, collection: object | null | undefined): boolean[]; + } + type LodashFlatMapDeep1x1 = (collection: lodash.List | null | undefined) => TResult[]; + type LodashFlatMapDeep1x2 = (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult) => TResult[]; + type LodashFlatMapDeep2x1 = (collection: T | null | undefined) => TResult[]; + type LodashFlatMapDeep2x2 = (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult) => TResult[]; + type LodashFlatMapDeep3x1 = (collection: object | null | undefined) => any[]; + interface LodashFlatMapDeep3x2 { + (iteratee: string): any[]; + (iteratee: object): boolean[]; + } + type LodashFlatMapDeep4x1 = (collection: object | null | undefined) => boolean[]; + interface LodashFlatMapDepth { + (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult): LodashFlatMapDepth1x1; + (iteratee: lodash.__, depth: number): LodashFlatMapDepth1x2; + (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult, depth: number): LodashFlatMapDepth1x3; + (iteratee: lodash.__, depth: lodash.__, collection: lodash.List | null | undefined): LodashFlatMapDepth1x4; + (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult, depth: lodash.__, collection: lodash.List | null | undefined): LodashFlatMapDepth1x5; + (iteratee: lodash.__, depth: number, collection: lodash.List | null | undefined): LodashFlatMapDepth1x6; + (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult, depth: number, collection: lodash.List | null | undefined): TResult[]; + (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult): LodashFlatMapDepth2x1; + (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult, depth: number): LodashFlatMapDepth2x3; + (iteratee: lodash.__, depth: lodash.__, collection: T | null | undefined): LodashFlatMapDepth2x4; + (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult, depth: lodash.__, collection: T | null | undefined): LodashFlatMapDepth2x5; + (iteratee: lodash.__, depth: number, collection: T | null | undefined): LodashFlatMapDepth2x6; + (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult, depth: number, collection: T | null | undefined): TResult[]; + (iteratee: string): LodashFlatMapDepth3x1; + (iteratee: string, depth: number): LodashFlatMapDepth3x3; + (iteratee: lodash.__, depth: lodash.__, collection: object | null | undefined): LodashFlatMapDepth3x4; + (iteratee: string, depth: lodash.__, collection: object | null | undefined): LodashFlatMapDepth3x5; + (iteratee: lodash.__, depth: number, collection: object | null | undefined): LodashFlatMapDepth3x6; + (iteratee: string, depth: number, collection: object | null | undefined): any[]; + (iteratee: object): LodashFlatMapDepth4x1; + (iteratee: object, depth: number): LodashFlatMapDepth4x3; + (iteratee: object, depth: lodash.__, collection: object | null | undefined): LodashFlatMapDepth4x5; + (iteratee: object, depth: number, collection: object | null | undefined): boolean[]; + } + interface LodashFlatMapDepth1x1 { + (depth: number): LodashFlatMapDepth1x3; + (depth: lodash.__, collection: lodash.List | null | undefined): LodashFlatMapDepth1x5; + (depth: number, collection: lodash.List | null | undefined): TResult[]; + } + interface LodashFlatMapDepth1x2 { + (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult): LodashFlatMapDepth1x3; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashFlatMapDepth1x6; + (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult, collection: lodash.List | null | undefined): TResult[]; + (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult): LodashFlatMapDepth2x3; + (iteratee: lodash.__, collection: T | null | undefined): LodashFlatMapDepth2x6; + (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult, collection: T | null | undefined): TResult[]; + (iteratee: string): LodashFlatMapDepth3x3; + (iteratee: lodash.__, collection: object | null | undefined): LodashFlatMapDepth3x6; + (iteratee: string, collection: object | null | undefined): any[]; + (iteratee: object): LodashFlatMapDepth4x3; + (iteratee: object, collection: object | null | undefined): boolean[]; + } + type LodashFlatMapDepth1x3 = (collection: lodash.List | null | undefined) => TResult[]; + interface LodashFlatMapDepth1x4 { + (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult): LodashFlatMapDepth1x5; + (iteratee: lodash.__, depth: number): LodashFlatMapDepth1x6; + (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult, depth: number): TResult[]; + } + type LodashFlatMapDepth1x5 = (depth: number) => TResult[]; + type LodashFlatMapDepth1x6 = (iteratee: (value: T) => lodash.ListOfRecursiveArraysOrValues | TResult) => TResult[]; + interface LodashFlatMapDepth2x1 { + (depth: number): LodashFlatMapDepth2x3; + (depth: lodash.__, collection: T | null | undefined): LodashFlatMapDepth2x5; + (depth: number, collection: T | null | undefined): TResult[]; + } + type LodashFlatMapDepth2x3 = (collection: T | null | undefined) => TResult[]; + interface LodashFlatMapDepth2x4 { + (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult): LodashFlatMapDepth2x5; + (iteratee: lodash.__, depth: number): LodashFlatMapDepth2x6; + (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult, depth: number): TResult[]; + } + type LodashFlatMapDepth2x5 = (depth: number) => TResult[]; + type LodashFlatMapDepth2x6 = (iteratee: (value: T[keyof T]) => lodash.ListOfRecursiveArraysOrValues | TResult) => TResult[]; + interface LodashFlatMapDepth3x1 { + (depth: number): LodashFlatMapDepth3x3; + (depth: lodash.__, collection: object | null | undefined): LodashFlatMapDepth3x5; + (depth: number, collection: object | null | undefined): any[]; + } + type LodashFlatMapDepth3x3 = (collection: object | null | undefined) => any[]; + interface LodashFlatMapDepth3x4 { + (iteratee: string): LodashFlatMapDepth3x5; + (iteratee: lodash.__, depth: number): LodashFlatMapDepth3x6; + (iteratee: string, depth: number): any[]; + (iteratee: object): LodashFlatMapDepth4x5; + (iteratee: object, depth: number): boolean[]; + } + type LodashFlatMapDepth3x5 = (depth: number) => any[]; + interface LodashFlatMapDepth3x6 { + (iteratee: string): any[]; + (iteratee: object): boolean[]; + } + interface LodashFlatMapDepth4x1 { + (depth: number): LodashFlatMapDepth4x3; + (depth: lodash.__, collection: object | null | undefined): LodashFlatMapDepth4x5; + (depth: number, collection: object | null | undefined): boolean[]; + } + type LodashFlatMapDepth4x3 = (collection: object | null | undefined) => boolean[]; + type LodashFlatMapDepth4x5 = (depth: number) => boolean[]; + type LodashFlatten = (array: lodash.List> | null | undefined) => T[]; + type LodashFlattenDeep = (array: lodash.ListOfRecursiveArraysOrValues | null | undefined) => T[]; + interface LodashFlattenDepth { + (depth: number): LodashFlattenDepth1x1; + (depth: lodash.__, array: lodash.ListOfRecursiveArraysOrValues | null | undefined): LodashFlattenDepth1x2; + (depth: number, array: lodash.ListOfRecursiveArraysOrValues | null | undefined): T[]; + } + type LodashFlattenDepth1x1 = (array: lodash.ListOfRecursiveArraysOrValues | null | undefined) => T[]; + type LodashFlattenDepth1x2 = (depth: number) => T[]; + type LodashFlip = any>(func: T) => T; + type LodashFloor = (n: number) => number; + interface LodashFlow { + (f1: () => R1, f2: (a: R1) => R2): () => R2; + (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): () => R3; + (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): () => R4; + (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): () => R5; + (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): () => R6; + (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): () => R7; + (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): () => any; + (f1: (a1: A1) => R1, f2: (a: R1) => R2): (a1: A1) => R2; + (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1) => R3; + (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1) => R4; + (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1) => R5; + (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1) => R6; + (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1) => R7; + (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1) => any; + (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2) => R2; + (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2) => R3; + (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2) => R4; + (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2) => R5; + (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2) => R6; + (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2) => R7; + (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2) => any; + (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3) => R2; + (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3) => R3; + (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3) => R4; + (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3) => R5; + (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3) => R6; + (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3) => R7; + (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2, a3: A3) => any; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2, a3: A3, a4: A4) => any; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7; + (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any; + (funcs: Array any>>): (...args: any[]) => any; + } + interface LodashForIn { + (iteratee: (value: T) => any): LodashForIn1x1; + (iteratee: lodash.__, object: T): LodashForIn1x2; + (iteratee: (value: T[keyof T]) => any, object: T): T; + (iteratee: lodash.__, object: T | null | undefined): LodashForIn2x2; + (iteratee: (value: T[keyof T]) => any, object: T | null | undefined): T | null | undefined; + } + interface LodashForIn1x1 { + (object: T1): T1; + (object: T1 | null | undefined): T1 | null | undefined; + } + type LodashForIn1x2 = (iteratee: (value: T[keyof T]) => any) => T; + type LodashForIn2x2 = (iteratee: (value: T[keyof T]) => any) => T | null | undefined; + interface LodashForInRight { + (iteratee: (value: T) => any): LodashForInRight1x1; + (iteratee: lodash.__, object: T): LodashForInRight1x2; + (iteratee: (value: T[keyof T]) => any, object: T): T; + (iteratee: lodash.__, object: T | null | undefined): LodashForInRight2x2; + (iteratee: (value: T[keyof T]) => any, object: T | null | undefined): T | null | undefined; + } + interface LodashForInRight1x1 { + (object: T1): T1; + (object: T1 | null | undefined): T1 | null | undefined; + } + type LodashForInRight1x2 = (iteratee: (value: T[keyof T]) => any) => T; + type LodashForInRight2x2 = (iteratee: (value: T[keyof T]) => any) => T | null | undefined; + interface LodashForOwn { + (iteratee: (value: T) => any): LodashForOwn1x1; + (iteratee: lodash.__, object: T): LodashForOwn1x2; + (iteratee: (value: T[keyof T]) => any, object: T): T; + (iteratee: lodash.__, object: T | null | undefined): LodashForOwn2x2; + (iteratee: (value: T[keyof T]) => any, object: T | null | undefined): T | null | undefined; + } + interface LodashForOwn1x1 { + (object: T1): T1; + (object: T1 | null | undefined): T1 | null | undefined; + } + type LodashForOwn1x2 = (iteratee: (value: T[keyof T]) => any) => T; + type LodashForOwn2x2 = (iteratee: (value: T[keyof T]) => any) => T | null | undefined; + interface LodashForOwnRight { + (iteratee: (value: T) => any): LodashForOwnRight1x1; + (iteratee: lodash.__, object: T): LodashForOwnRight1x2; + (iteratee: (value: T[keyof T]) => any, object: T): T; + (iteratee: lodash.__, object: T | null | undefined): LodashForOwnRight2x2; + (iteratee: (value: T[keyof T]) => any, object: T | null | undefined): T | null | undefined; + } + interface LodashForOwnRight1x1 { + (object: T1): T1; + (object: T1 | null | undefined): T1 | null | undefined; + } + type LodashForOwnRight1x2 = (iteratee: (value: T[keyof T]) => any) => T; + type LodashForOwnRight2x2 = (iteratee: (value: T[keyof T]) => any) => T | null | undefined; + interface LodashFromPairs { + (pairs: lodash.List<[lodash.PropertyName, T]> | null | undefined): lodash.Dictionary; + (pairs: lodash.List | null | undefined): lodash.Dictionary; + } + type LodashFunctions = (object: any) => string[]; + type LodashFunctionsIn = (object: any) => string[]; + interface LodashGet { + (path: TKey | [TKey]): LodashGet1x1; + (path: lodash.__, object: TObject): LodashGet1x2; + (path: TKey | [TKey], object: TObject): TObject[TKey]; + (path: lodash.__, object: TObject | null | undefined): LodashGet2x2; + (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | undefined; + (path: number): LodashGet3x1; + (path: lodash.__, object: lodash.NumericDictionary): LodashGet3x2; + (path: number, object: lodash.NumericDictionary): T; + (path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashGet4x2; + (path: number, object: lodash.NumericDictionary | null | undefined): T | undefined; + (path: lodash.PropertyPath): LodashGet5x1; + (path: lodash.__, object: null | undefined): LodashGet5x2; + (path: lodash.PropertyPath, object: null | undefined): undefined; + (path: lodash.__, object: any): LodashGet6x2; + (path: lodash.PropertyPath, object: any): any; + } + interface LodashGet1x1 { + (object: TObject): TObject[TKey]; + (object: TObject | null | undefined): TObject[TKey] | undefined; + } + type LodashGet1x2 = (path: TKey | [TKey]) => TObject[TKey]; + type LodashGet2x2 = (path: TKey | [TKey]) => TObject[TKey] | undefined; + interface LodashGet3x1 { + (object: lodash.NumericDictionary): T; + (object: lodash.NumericDictionary | null | undefined): T | undefined; + } + type LodashGet3x2 = (path: number) => T; + type LodashGet4x2 = (path: number) => T | undefined; + interface LodashGet5x1 { + (object: null | undefined): undefined; + (object: any): any; + } + type LodashGet5x2 = (path: lodash.PropertyPath) => undefined; + type LodashGet6x2 = (path: lodash.PropertyPath) => any; + interface LodashGetOr { + (defaultValue: TDefault): LodashGetOr1x1; + (defaultValue: lodash.__, path: TKey | [TKey]): LodashGetOr1x2; + (defaultValue: TDefault, path: TKey | [TKey]): LodashGetOr1x3; + (defaultValue: lodash.__, path: lodash.__, object: TObject | null | undefined): LodashGetOr1x4; + (defaultValue: TDefault, path: lodash.__, object: TObject | null | undefined): LodashGetOr1x5; + (defaultValue: lodash.__, path: TKey | [TKey], object: TObject | null | undefined): LodashGetOr1x6; + (defaultValue: TDefault, path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; + (defaultValue: lodash.__, path: number): LodashGetOr2x2; + (defaultValue: TDefault, path: number): LodashGetOr2x3; + (defaultValue: lodash.__, path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashGetOr2x4; + (defaultValue: TDefault, path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashGetOr2x5; + (defaultValue: lodash.__, path: number, object: lodash.NumericDictionary | null | undefined): LodashGetOr2x6; + (defaultValue: TDefault, path: number, object: lodash.NumericDictionary | null | undefined): T | TDefault; + (defaultValue: lodash.__, path: lodash.PropertyPath): LodashGetOr3x2; + (defaultValue: TDefault, path: lodash.PropertyPath): LodashGetOr3x3; + (defaultValue: lodash.__, path: lodash.__, object: null | undefined): LodashGetOr3x4; + (defaultValue: TDefault, path: lodash.__, object: null | undefined): LodashGetOr3x5; + (defaultValue: lodash.__, path: lodash.PropertyPath, object: null | undefined): LodashGetOr3x6; + (defaultValue: TDefault, path: lodash.PropertyPath, object: null | undefined): TDefault; + (defaultValue: any): LodashGetOr4x1; + (defaultValue: any, path: lodash.PropertyPath): LodashGetOr4x3; + (defaultValue: lodash.__, path: lodash.__, object: any): LodashGetOr4x4; + (defaultValue: any, path: lodash.__, object: any): LodashGetOr4x5; + (defaultValue: lodash.__, path: lodash.PropertyPath, object: any): LodashGetOr4x6; + (defaultValue: any, path: lodash.PropertyPath, object: any): any; + } + interface LodashGetOr1x1 { + (path: TKey | [TKey]): LodashGetOr1x3; + (path: lodash.__, object: TObject | null | undefined): LodashGetOr1x5; + (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; + (path: number): LodashGetOr2x3; + (path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashGetOr2x5; + (path: number, object: lodash.NumericDictionary | null | undefined): T | TDefault; + (path: lodash.PropertyPath): LodashGetOr3x3; + (path: lodash.__, object: null | undefined): LodashGetOr3x5; + (path: lodash.PropertyPath, object: null | undefined): TDefault; + } + interface LodashGetOr1x2 { + (defaultValue: TDefault): LodashGetOr1x3; + (defaultValue: lodash.__, object: TObject | null | undefined): LodashGetOr1x6; + (defaultValue: TDefault, object: TObject | null | undefined): TObject[TKey] | TDefault; + } + type LodashGetOr1x3 = (object: TObject | null | undefined) => TObject[TKey] | TDefault; + interface LodashGetOr1x4 { + (defaultValue: TDefault): LodashGetOr1x5; + (defaultValue: lodash.__, path: TKey | [TKey]): LodashGetOr1x6; + (defaultValue: TDefault, path: TKey | [TKey]): TObject[TKey] | TDefault; + } + type LodashGetOr1x5 = (path: TKey | [TKey]) => TObject[TKey] | TDefault; + type LodashGetOr1x6 = (defaultValue: TDefault) => TObject[TKey] | TDefault; + interface LodashGetOr2x2 { + (defaultValue: TDefault): LodashGetOr2x3; + (defaultValue: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashGetOr2x6; + (defaultValue: TDefault, object: lodash.NumericDictionary | null | undefined): T | TDefault; + } + type LodashGetOr2x3 = (object: lodash.NumericDictionary | null | undefined) => T | TDefault; + interface LodashGetOr2x4 { + (defaultValue: TDefault): LodashGetOr2x5; + (defaultValue: lodash.__, path: number): LodashGetOr2x6; + (defaultValue: TDefault, path: number): T | TDefault; + } + type LodashGetOr2x5 = (path: number) => T | TDefault; + type LodashGetOr2x6 = (defaultValue: TDefault) => T | TDefault; + interface LodashGetOr3x2 { + (defaultValue: TDefault): LodashGetOr3x3; + (defaultValue: lodash.__, object: null | undefined): LodashGetOr3x6; + (defaultValue: TDefault, object: null | undefined): TDefault; + (defaultValue: any): LodashGetOr4x3; + (defaultValue: lodash.__, object: any): LodashGetOr4x6; + (defaultValue: any, object: any): any; + } + type LodashGetOr3x3 = (object: null | undefined) => TDefault; + interface LodashGetOr3x4 { + (defaultValue: TDefault): LodashGetOr3x5; + (defaultValue: lodash.__, path: lodash.PropertyPath): LodashGetOr3x6; + (defaultValue: TDefault, path: lodash.PropertyPath): TDefault; + } + type LodashGetOr3x5 = (path: lodash.PropertyPath) => TDefault; + type LodashGetOr3x6 = (defaultValue: TDefault) => TDefault; + interface LodashGetOr4x1 { + (path: lodash.PropertyPath): LodashGetOr4x3; + (path: lodash.__, object: any): LodashGetOr4x5; + (path: lodash.PropertyPath, object: any): any; + } + type LodashGetOr4x3 = (object: any) => any; + interface LodashGetOr4x4 { + (defaultValue: any): LodashGetOr4x5; + (defaultValue: lodash.__, path: lodash.PropertyPath): LodashGetOr4x6; + (defaultValue: any, path: lodash.PropertyPath): any; + } + type LodashGetOr4x5 = (path: lodash.PropertyPath) => any; + type LodashGetOr4x6 = (defaultValue: any) => any; + interface LodashGroupBy { + (iteratee: (value: string) => lodash.NotVoid): LodashGroupBy1x1; + (iteratee: lodash.__, collection: string | null | undefined): LodashGroupBy1x2; + (iteratee: (value: string) => lodash.NotVoid, collection: string | null | undefined): lodash.Dictionary; + (iteratee: lodash.ValueIteratee): LodashGroupBy2x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashGroupBy2x2; + (iteratee: lodash.ValueIteratee, collection: lodash.List | null | undefined): lodash.Dictionary; + (iteratee: lodash.__, collection: T | null | undefined): LodashGroupBy3x2; + (iteratee: lodash.ValueIteratee, collection: T | null | undefined): lodash.Dictionary>; + } + type LodashGroupBy1x1 = (collection: string | null | undefined) => lodash.Dictionary; + type LodashGroupBy1x2 = (iteratee: (value: string) => lodash.NotVoid) => lodash.Dictionary; + type LodashGroupBy2x1 = (collection: lodash.List | object | null | undefined) => lodash.Dictionary; + type LodashGroupBy2x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; + type LodashGroupBy3x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary>; + interface LodashGt { + (value: any): LodashGt1x1; + (value: lodash.__, other: any): LodashGt1x2; + (value: any, other: any): boolean; + } + type LodashGt1x1 = (other: any) => boolean; + type LodashGt1x2 = (value: any) => boolean; + interface LodashGte { + (value: any): LodashGte1x1; + (value: lodash.__, other: any): LodashGte1x2; + (value: any, other: any): boolean; + } + type LodashGte1x1 = (other: any) => boolean; + type LodashGte1x2 = (value: any) => boolean; + interface LodashHas { + (path: lodash.PropertyPath): LodashHas1x1; + (path: lodash.__, object: T): LodashHas1x2; + (path: lodash.PropertyPath, object: T): boolean; + } + type LodashHas1x1 = (object: T) => boolean; + type LodashHas1x2 = (path: lodash.PropertyPath) => boolean; + interface LodashHasIn { + (path: lodash.PropertyPath): LodashHasIn1x1; + (path: lodash.__, object: T): LodashHasIn1x2; + (path: lodash.PropertyPath, object: T): boolean; + } + type LodashHasIn1x1 = (object: T) => boolean; + type LodashHasIn1x2 = (path: lodash.PropertyPath) => boolean; + interface LodashIdentity { + (value: T): T; + (): undefined; + } + interface LodashIncludes { + (target: T): LodashIncludes1x1; + (target: lodash.__, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashIncludes1x2; + (target: T, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): boolean; + } + type LodashIncludes1x1 = (collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined) => boolean; + type LodashIncludes1x2 = (target: T) => boolean; + interface LodashIncludesFrom { + (target: T): LodashIncludesFrom1x1; + (target: lodash.__, fromIndex: number): LodashIncludesFrom1x2; + (target: T, fromIndex: number): LodashIncludesFrom1x3; + (target: lodash.__, fromIndex: lodash.__, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashIncludesFrom1x4; + (target: T, fromIndex: lodash.__, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashIncludesFrom1x5; + (target: lodash.__, fromIndex: number, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashIncludesFrom1x6; + (target: T, fromIndex: number, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): boolean; + } + interface LodashIncludesFrom1x1 { + (fromIndex: number): LodashIncludesFrom1x3; + (fromIndex: lodash.__, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashIncludesFrom1x5; + (fromIndex: number, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): boolean; + } + interface LodashIncludesFrom1x2 { + (target: T): LodashIncludesFrom1x3; + (target: lodash.__, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashIncludesFrom1x6; + (target: T, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): boolean; + } + type LodashIncludesFrom1x3 = (collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined) => boolean; + interface LodashIncludesFrom1x4 { + (target: T): LodashIncludesFrom1x5; + (target: lodash.__, fromIndex: number): LodashIncludesFrom1x6; + (target: T, fromIndex: number): boolean; + } + type LodashIncludesFrom1x5 = (fromIndex: number) => boolean; + type LodashIncludesFrom1x6 = (target: T) => boolean; + interface LodashKeyBy { + (iteratee: (value: string) => lodash.PropertyName): LodashKeyBy1x1; + (iteratee: lodash.__, collection: string | null | undefined): LodashKeyBy1x2; + (iteratee: (value: string) => lodash.PropertyName, collection: string | null | undefined): lodash.Dictionary; + (iteratee: lodash.ValueIterateeCustom): LodashKeyBy2x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashKeyBy2x2; + (iteratee: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): lodash.Dictionary; + (iteratee: lodash.__, collection: T | null | undefined): LodashKeyBy3x2; + (iteratee: lodash.ValueIterateeCustom, collection: T | null | undefined): lodash.Dictionary; + } + type LodashKeyBy1x1 = (collection: string | null | undefined) => lodash.Dictionary; + type LodashKeyBy1x2 = (iteratee: (value: string) => lodash.PropertyName) => lodash.Dictionary; + type LodashKeyBy2x1 = (collection: lodash.List | object | null | undefined) => lodash.Dictionary; + type LodashKeyBy2x2 = (iteratee: lodash.ValueIterateeCustom) => lodash.Dictionary; + type LodashKeyBy3x2 = (iteratee: lodash.ValueIterateeCustom) => lodash.Dictionary; + interface LodashIndexOf { + (value: T): LodashIndexOf1x1; + (value: lodash.__, array: lodash.List | null | undefined): LodashIndexOf1x2; + (value: T, array: lodash.List | null | undefined): number; + } + type LodashIndexOf1x1 = (array: lodash.List | null | undefined) => number; + type LodashIndexOf1x2 = (value: T) => number; + interface LodashIndexOfFrom { + (value: T): LodashIndexOfFrom1x1; + (value: lodash.__, fromIndex: number): LodashIndexOfFrom1x2; + (value: T, fromIndex: number): LodashIndexOfFrom1x3; + (value: lodash.__, fromIndex: lodash.__, array: lodash.List | null | undefined): LodashIndexOfFrom1x4; + (value: T, fromIndex: lodash.__, array: lodash.List | null | undefined): LodashIndexOfFrom1x5; + (value: lodash.__, fromIndex: number, array: lodash.List | null | undefined): LodashIndexOfFrom1x6; + (value: T, fromIndex: number, array: lodash.List | null | undefined): number; + } + interface LodashIndexOfFrom1x1 { + (fromIndex: number): LodashIndexOfFrom1x3; + (fromIndex: lodash.__, array: lodash.List | null | undefined): LodashIndexOfFrom1x5; + (fromIndex: number, array: lodash.List | null | undefined): number; + } + interface LodashIndexOfFrom1x2 { + (value: T): LodashIndexOfFrom1x3; + (value: lodash.__, array: lodash.List | null | undefined): LodashIndexOfFrom1x6; + (value: T, array: lodash.List | null | undefined): number; + } + type LodashIndexOfFrom1x3 = (array: lodash.List | null | undefined) => number; + interface LodashIndexOfFrom1x4 { + (value: T): LodashIndexOfFrom1x5; + (value: lodash.__, fromIndex: number): LodashIndexOfFrom1x6; + (value: T, fromIndex: number): number; + } + type LodashIndexOfFrom1x5 = (fromIndex: number) => number; + type LodashIndexOfFrom1x6 = (value: T) => number; + type LodashInitial = (array: lodash.List | null | undefined) => T[]; + interface LodashInRange { + (start: number): LodashInRange1x1; + (start: lodash.__, end: number): LodashInRange1x2; + (start: number, end: number): LodashInRange1x3; + (start: lodash.__, end: lodash.__, n: number): LodashInRange1x4; + (start: number, end: lodash.__, n: number): LodashInRange1x5; + (start: lodash.__, end: number, n: number): LodashInRange1x6; + (start: number, end: number, n: number): boolean; + } + interface LodashInRange1x1 { + (end: number): LodashInRange1x3; + (end: lodash.__, n: number): LodashInRange1x5; + (end: number, n: number): boolean; + } + interface LodashInRange1x2 { + (start: number): LodashInRange1x3; + (start: lodash.__, n: number): LodashInRange1x6; + (start: number, n: number): boolean; + } + type LodashInRange1x3 = (n: number) => boolean; + interface LodashInRange1x4 { + (start: number): LodashInRange1x5; + (start: lodash.__, end: number): LodashInRange1x6; + (start: number, end: number): boolean; + } + type LodashInRange1x5 = (end: number) => boolean; + type LodashInRange1x6 = (start: number) => boolean; + interface LodashIntersection { + (arrays2: lodash.List): LodashIntersection1x1; + (arrays2: lodash.__, arrays: lodash.List): LodashIntersection1x2; + (arrays2: lodash.List, arrays: lodash.List): T[]; + } + type LodashIntersection1x1 = (arrays: lodash.List) => T[]; + type LodashIntersection1x2 = (arrays2: lodash.List) => T[]; + interface LodashIntersectionBy { + (iteratee: lodash.ValueIteratee): LodashIntersectionBy1x1; + (iteratee: lodash.__, array: lodash.List | null): LodashIntersectionBy1x2; + (iteratee: lodash.ValueIteratee, array: lodash.List | null): LodashIntersectionBy1x3; + (iteratee: lodash.__, array: lodash.__, values: lodash.List): LodashIntersectionBy1x4; + (iteratee: lodash.ValueIteratee, array: lodash.__, values: lodash.List): LodashIntersectionBy1x5; + (iteratee: lodash.__, array: lodash.List | null, values: lodash.List): LodashIntersectionBy1x6; + (iteratee: lodash.ValueIteratee, array: lodash.List | null, values: lodash.List): T1[]; + } + interface LodashIntersectionBy1x1 { + (array: lodash.List | null): LodashIntersectionBy1x3; + (array: lodash.__, values: lodash.List): LodashIntersectionBy1x5; + (array: lodash.List | null, values: lodash.List): T1[]; + } + interface LodashIntersectionBy1x2 { + (iteratee: lodash.ValueIteratee): LodashIntersectionBy1x3; + (iteratee: lodash.__, values: lodash.List): LodashIntersectionBy1x6; + (iteratee: lodash.ValueIteratee, values: lodash.List): T1[]; + } + type LodashIntersectionBy1x3 = (values: lodash.List) => T1[]; + interface LodashIntersectionBy1x4 { + (iteratee: lodash.ValueIteratee): LodashIntersectionBy1x5; + (iteratee: lodash.__, array: lodash.List | null): LodashIntersectionBy1x6; + (iteratee: lodash.ValueIteratee, array: lodash.List | null): T1[]; + } + type LodashIntersectionBy1x5 = (array: lodash.List | null) => T1[]; + type LodashIntersectionBy1x6 = (iteratee: lodash.ValueIteratee) => T1[]; + interface LodashIntersectionWith { + (comparator: lodash.Comparator2): LodashIntersectionWith1x1; + (comparator: lodash.__, array: lodash.List | null | undefined): LodashIntersectionWith1x2; + (comparator: lodash.Comparator2, array: lodash.List | null | undefined): LodashIntersectionWith1x3; + (comparator: lodash.__, array: lodash.__, values: lodash.List): LodashIntersectionWith1x4; + (comparator: lodash.Comparator2, array: lodash.__, values: lodash.List): LodashIntersectionWith1x5; + (comparator: lodash.__, array: lodash.List | null | undefined, values: lodash.List): LodashIntersectionWith1x6; + (comparator: lodash.Comparator2, array: lodash.List | null | undefined, values: lodash.List): T1[]; + } + interface LodashIntersectionWith1x1 { + (array: lodash.List | null | undefined): LodashIntersectionWith1x3; + (array: lodash.__, values: lodash.List): LodashIntersectionWith1x5; + (array: lodash.List | null | undefined, values: lodash.List): T1[]; + } + interface LodashIntersectionWith1x2 { + (comparator: lodash.Comparator2): LodashIntersectionWith1x3; + (comparator: lodash.__, values: lodash.List): LodashIntersectionWith1x6; + (comparator: lodash.Comparator2, values: lodash.List): T1[]; + } + type LodashIntersectionWith1x3 = (values: lodash.List) => T1[]; + interface LodashIntersectionWith1x4 { + (comparator: lodash.Comparator2): LodashIntersectionWith1x5; + (comparator: lodash.__, array: lodash.List | null | undefined): LodashIntersectionWith1x6; + (comparator: lodash.Comparator2, array: lodash.List | null | undefined): T1[]; + } + type LodashIntersectionWith1x5 = (array: lodash.List | null | undefined) => T1[]; + type LodashIntersectionWith1x6 = (comparator: lodash.Comparator2) => T1[]; + type LodashInvert = (object: object) => lodash.Dictionary; + interface LodashInvertBy { + (interatee: lodash.ValueIteratee): LodashInvertBy1x1; + (interatee: lodash.__, object: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashInvertBy1x2; + (interatee: lodash.ValueIteratee, object: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): lodash.Dictionary; + (interatee: lodash.__, object: T | null | undefined): LodashInvertBy2x2; + (interatee: lodash.ValueIteratee, object: T | null | undefined): lodash.Dictionary; + } + type LodashInvertBy1x1 = (object: lodash.List | lodash.Dictionary | lodash.NumericDictionary | object | null | undefined) => lodash.Dictionary; + type LodashInvertBy1x2 = (interatee: lodash.ValueIteratee) => lodash.Dictionary; + type LodashInvertBy2x2 = (interatee: lodash.ValueIteratee) => lodash.Dictionary; + interface LodashInvoke { + (path: lodash.PropertyPath): LodashInvoke1x1; + (path: lodash.__, object: any): LodashInvoke1x2; + (path: lodash.PropertyPath, object: any): any; + } + type LodashInvoke1x1 = (object: any) => any; + type LodashInvoke1x2 = (path: lodash.PropertyPath) => any; + interface LodashInvokeArgs { + (path: lodash.PropertyPath): LodashInvokeArgs1x1; + (path: lodash.__, args: ReadonlyArray): LodashInvokeArgs1x2; + (path: lodash.PropertyPath, args: ReadonlyArray): LodashInvokeArgs1x3; + (path: lodash.__, args: lodash.__, object: any): LodashInvokeArgs1x4; + (path: lodash.PropertyPath, args: lodash.__, object: any): LodashInvokeArgs1x5; + (path: lodash.__, args: ReadonlyArray, object: any): LodashInvokeArgs1x6; + (path: lodash.PropertyPath, args: ReadonlyArray, object: any): any; + } + interface LodashInvokeArgs1x1 { + (args: ReadonlyArray): LodashInvokeArgs1x3; + (args: lodash.__, object: any): LodashInvokeArgs1x5; + (args: ReadonlyArray, object: any): any; + } + interface LodashInvokeArgs1x2 { + (path: lodash.PropertyPath): LodashInvokeArgs1x3; + (path: lodash.__, object: any): LodashInvokeArgs1x6; + (path: lodash.PropertyPath, object: any): any; + } + type LodashInvokeArgs1x3 = (object: any) => any; + interface LodashInvokeArgs1x4 { + (path: lodash.PropertyPath): LodashInvokeArgs1x5; + (path: lodash.__, args: ReadonlyArray): LodashInvokeArgs1x6; + (path: lodash.PropertyPath, args: ReadonlyArray): any; + } + type LodashInvokeArgs1x5 = (args: ReadonlyArray) => any; + type LodashInvokeArgs1x6 = (path: lodash.PropertyPath) => any; + interface LodashInvokeArgsMap { + (methodName: string): LodashInvokeArgsMap1x1; + (methodNameOrMethod: lodash.__, args: ReadonlyArray): LodashInvokeArgsMap1x2; + (methodName: string, args: ReadonlyArray): LodashInvokeArgsMap1x3; + (methodNameOrMethod: lodash.__, args: lodash.__, collection: object | null | undefined): LodashInvokeArgsMap1x4; + (methodName: string, args: lodash.__, collection: object | null | undefined): LodashInvokeArgsMap1x5; + (methodNameOrMethod: lodash.__, args: ReadonlyArray, collection: object | null | undefined): LodashInvokeArgsMap1x6; + (methodName: string, args: ReadonlyArray, collection: object | null | undefined): any[]; + (method: (...args: any[]) => TResult): LodashInvokeArgsMap2x1; + (method: (...args: any[]) => TResult, args: ReadonlyArray): LodashInvokeArgsMap2x3; + (method: (...args: any[]) => TResult, args: lodash.__, collection: object | null | undefined): LodashInvokeArgsMap2x5; + (method: (...args: any[]) => TResult, args: ReadonlyArray, collection: object | null | undefined): TResult[]; + } + interface LodashInvokeArgsMap1x1 { + (args: ReadonlyArray): LodashInvokeArgsMap1x3; + (args: lodash.__, collection: object | null | undefined): LodashInvokeArgsMap1x5; + (args: ReadonlyArray, collection: object | null | undefined): any[]; + } + interface LodashInvokeArgsMap1x2 { + (methodName: string): LodashInvokeArgsMap1x3; + (methodNameOrMethod: lodash.__, collection: object | null | undefined): LodashInvokeArgsMap1x6; + (methodName: string, collection: object | null | undefined): any[]; + (method: (...args: any[]) => TResult): LodashInvokeArgsMap2x3; + (method: (...args: any[]) => TResult, collection: object | null | undefined): TResult[]; + } + type LodashInvokeArgsMap1x3 = (collection: object | null | undefined) => any[]; + interface LodashInvokeArgsMap1x4 { + (methodName: string): LodashInvokeArgsMap1x5; + (methodNameOrMethod: lodash.__, args: ReadonlyArray): LodashInvokeArgsMap1x6; + (methodName: string, args: ReadonlyArray): any[]; + (method: (...args: any[]) => TResult): LodashInvokeArgsMap2x5; + (method: (...args: any[]) => TResult, args: ReadonlyArray): TResult[]; + } + type LodashInvokeArgsMap1x5 = (args: ReadonlyArray) => any[]; + interface LodashInvokeArgsMap1x6 { + (methodName: string): any[]; + (method: (...args: any[]) => TResult): TResult[]; + } + interface LodashInvokeArgsMap2x1 { + (args: ReadonlyArray): LodashInvokeArgsMap2x3; + (args: lodash.__, collection: object | null | undefined): LodashInvokeArgsMap2x5; + (args: ReadonlyArray, collection: object | null | undefined): TResult[]; + } + type LodashInvokeArgsMap2x3 = (collection: object | null | undefined) => TResult[]; + type LodashInvokeArgsMap2x5 = (args: ReadonlyArray) => TResult[]; + interface LodashInvokeMap { + (methodName: string): LodashInvokeMap1x1; + (methodNameOrMethod: lodash.__, collection: object | null | undefined): LodashInvokeMap1x2; + (methodName: string, collection: object | null | undefined): any[]; + (method: (...args: any[]) => TResult): LodashInvokeMap2x1; + (method: (...args: any[]) => TResult, collection: object | null | undefined): TResult[]; + } + type LodashInvokeMap1x1 = (collection: object | null | undefined) => any[]; + interface LodashInvokeMap1x2 { + (methodName: string): any[]; + (method: (...args: any[]) => TResult): TResult[]; + } + type LodashInvokeMap2x1 = (collection: object | null | undefined) => TResult[]; + type LodashIsArguments = (value: any) => value is IArguments; + type LodashIsArray = (value: any) => value is any[]; + type LodashIsArrayBuffer = (value: any) => value is ArrayBuffer; + interface LodashIsArrayLike { + (value: T & string & number): boolean; + (value: ((...args: any[]) => any) | null | undefined): value is never; + (value: any): value is { length: number }; + } + interface LodashIsArrayLikeObject { + (value: T & string & number): boolean; + // tslint:disable-next-line:ban-types (type guard doesn't seem to work correctly without the Function type) + (value: ((...args: any[]) => any) | Function | string | boolean | number | null | undefined): value is never; + // tslint:disable-next-line:ban-types (type guard doesn't seem to work correctly without the Function type) + (value: T | ((...args: any[]) => any) | Function | string | boolean | number | null | undefined): value is T & { length: number }; + } + type LodashIsBoolean = (value: any) => value is boolean; + type LodashIsBuffer = (value: any) => boolean; + type LodashIsDate = (value: any) => value is Date; + type LodashIsElement = (value: any) => boolean; + type LodashIsEmpty = (value: any) => boolean; + interface LodashIsEqualWith { + (customizer: lodash.IsEqualCustomizer): LodashIsEqualWith1x1; + (customizer: lodash.__, value: any): LodashIsEqualWith1x2; + (customizer: lodash.IsEqualCustomizer, value: any): LodashIsEqualWith1x3; + (customizer: lodash.__, value: lodash.__, other: any): LodashIsEqualWith1x4; + (customizer: lodash.IsEqualCustomizer, value: lodash.__, other: any): LodashIsEqualWith1x5; + (customizer: lodash.__, value: any, other: any): LodashIsEqualWith1x6; + (customizer: lodash.IsEqualCustomizer, value: any, other: any): boolean; + } + interface LodashIsEqualWith1x1 { + (value: any): LodashIsEqualWith1x3; + (value: lodash.__, other: any): LodashIsEqualWith1x5; + (value: any, other: any): boolean; + } + interface LodashIsEqualWith1x2 { + (customizer: lodash.IsEqualCustomizer): LodashIsEqualWith1x3; + (customizer: lodash.__, other: any): LodashIsEqualWith1x6; + (customizer: lodash.IsEqualCustomizer, other: any): boolean; + } + type LodashIsEqualWith1x3 = (other: any) => boolean; + interface LodashIsEqualWith1x4 { + (customizer: lodash.IsEqualCustomizer): LodashIsEqualWith1x5; + (customizer: lodash.__, value: any): LodashIsEqualWith1x6; + (customizer: lodash.IsEqualCustomizer, value: any): boolean; + } + type LodashIsEqualWith1x5 = (value: any) => boolean; + type LodashIsEqualWith1x6 = (customizer: lodash.IsEqualCustomizer) => boolean; + type LodashIsError = (value: any) => value is Error; + type LodashIsFinite = (value: any) => boolean; + type LodashIsFunction = (value: any) => value is (...args: any[]) => any; + type LodashIsInteger = (value: any) => boolean; + type LodashIsLength = (value: any) => boolean; + type LodashIsMap = (value: any) => value is Map; + interface LodashIsMatch { + (source: object): LodashIsMatch1x1; + (source: lodash.__, object: object): LodashIsMatch1x2; + (source: object, object: object): boolean; + } + type LodashIsMatch1x1 = (object: object) => boolean; + type LodashIsMatch1x2 = (source: object) => boolean; + interface LodashIsMatchWith { + (customizer: lodash.isMatchWithCustomizer): LodashIsMatchWith1x1; + (customizer: lodash.__, source: object): LodashIsMatchWith1x2; + (customizer: lodash.isMatchWithCustomizer, source: object): LodashIsMatchWith1x3; + (customizer: lodash.__, source: lodash.__, object: object): LodashIsMatchWith1x4; + (customizer: lodash.isMatchWithCustomizer, source: lodash.__, object: object): LodashIsMatchWith1x5; + (customizer: lodash.__, source: object, object: object): LodashIsMatchWith1x6; + (customizer: lodash.isMatchWithCustomizer, source: object, object: object): boolean; + } + interface LodashIsMatchWith1x1 { + (source: object): LodashIsMatchWith1x3; + (source: lodash.__, object: object): LodashIsMatchWith1x5; + (source: object, object: object): boolean; + } + interface LodashIsMatchWith1x2 { + (customizer: lodash.isMatchWithCustomizer): LodashIsMatchWith1x3; + (customizer: lodash.__, object: object): LodashIsMatchWith1x6; + (customizer: lodash.isMatchWithCustomizer, object: object): boolean; + } + type LodashIsMatchWith1x3 = (object: object) => boolean; + interface LodashIsMatchWith1x4 { + (customizer: lodash.isMatchWithCustomizer): LodashIsMatchWith1x5; + (customizer: lodash.__, source: object): LodashIsMatchWith1x6; + (customizer: lodash.isMatchWithCustomizer, source: object): boolean; + } + type LodashIsMatchWith1x5 = (source: object) => boolean; + type LodashIsMatchWith1x6 = (customizer: lodash.isMatchWithCustomizer) => boolean; + type LodashIsNaN = (value: any) => boolean; + type LodashIsNative = (value: any) => value is (...args: any[]) => any; + type LodashIsNil = (value: any) => value is null | undefined; + type LodashIsNull = (value: any) => value is null; + type LodashIsNumber = (value: any) => value is number; + type LodashIsObject = (value: any) => boolean; + type LodashIsObjectLike = (value: any) => boolean; + type LodashIsPlainObject = (value: any) => boolean; + type LodashIsRegExp = (value: any) => value is RegExp; + type LodashIsSafeInteger = (value: any) => boolean; + type LodashIsSet = (value: any) => value is Set; + type LodashIsString = (value: any) => value is string; + type LodashIsSymbol = (value: any) => boolean; + type LodashIsTypedArray = (value: any) => boolean; + type LodashIsUndefined = (value: any) => value is undefined; + type LodashIsWeakMap = (value: any) => value is WeakMap; + type LodashIsWeakSet = (value: any) => value is WeakSet; + interface LodashIteratee { + any>(func: TFunction): TFunction; + (func: string | object): (...args: any[]) => any; + } + interface LodashJoin { + (separator: string): LodashJoin1x1; + (separator: lodash.__, array: lodash.List | null | undefined): LodashJoin1x2; + (separator: string, array: lodash.List | null | undefined): string; + } + type LodashJoin1x1 = (array: lodash.List | null | undefined) => string; + type LodashJoin1x2 = (separator: string) => string; + type LodashOver = (iteratees: lodash.Many<(...args: any[]) => TResult>) => (...args: any[]) => TResult[]; + type LodashKebabCase = (string: string) => string; + type LodashKeys = (object: any) => string[]; + type LodashKeysIn = (object: any) => string[]; + type LodashLast = (array: lodash.List | null | undefined) => T | undefined; + interface LodashLastIndexOf { + (value: T): LodashLastIndexOf1x1; + (value: lodash.__, array: lodash.List | null | undefined): LodashLastIndexOf1x2; + (value: T, array: lodash.List | null | undefined): number; + } + type LodashLastIndexOf1x1 = (array: lodash.List | null | undefined) => number; + type LodashLastIndexOf1x2 = (value: T) => number; + interface LodashLastIndexOfFrom { + (value: T): LodashLastIndexOfFrom1x1; + (value: lodash.__, fromIndex: true|number): LodashLastIndexOfFrom1x2; + (value: T, fromIndex: true|number): LodashLastIndexOfFrom1x3; + (value: lodash.__, fromIndex: lodash.__, array: lodash.List | null | undefined): LodashLastIndexOfFrom1x4; + (value: T, fromIndex: lodash.__, array: lodash.List | null | undefined): LodashLastIndexOfFrom1x5; + (value: lodash.__, fromIndex: true|number, array: lodash.List | null | undefined): LodashLastIndexOfFrom1x6; + (value: T, fromIndex: true|number, array: lodash.List | null | undefined): number; + } + interface LodashLastIndexOfFrom1x1 { + (fromIndex: true|number): LodashLastIndexOfFrom1x3; + (fromIndex: lodash.__, array: lodash.List | null | undefined): LodashLastIndexOfFrom1x5; + (fromIndex: true|number, array: lodash.List | null | undefined): number; + } + interface LodashLastIndexOfFrom1x2 { + (value: T): LodashLastIndexOfFrom1x3; + (value: lodash.__, array: lodash.List | null | undefined): LodashLastIndexOfFrom1x6; + (value: T, array: lodash.List | null | undefined): number; + } + type LodashLastIndexOfFrom1x3 = (array: lodash.List | null | undefined) => number; + interface LodashLastIndexOfFrom1x4 { + (value: T): LodashLastIndexOfFrom1x5; + (value: lodash.__, fromIndex: true|number): LodashLastIndexOfFrom1x6; + (value: T, fromIndex: true|number): number; + } + type LodashLastIndexOfFrom1x5 = (fromIndex: true|number) => number; + type LodashLastIndexOfFrom1x6 = (value: T) => number; + type LodashLowerCase = (string: string) => string; + type LodashLowerFirst = (string: string) => string; + interface LodashLt { + (value: any): LodashLt1x1; + (value: lodash.__, other: any): LodashLt1x2; + (value: any, other: any): boolean; + } + type LodashLt1x1 = (other: any) => boolean; + type LodashLt1x2 = (value: any) => boolean; + interface LodashLte { + (value: any): LodashLte1x1; + (value: lodash.__, other: any): LodashLte1x2; + (value: any, other: any): boolean; + } + type LodashLte1x1 = (other: any) => boolean; + type LodashLte1x2 = (value: any) => boolean; + interface LodashMap { + (iteratee: (value: T) => TResult): LodashMap1x1; + (iteratee: lodash.__, collection: T[] | null | undefined): LodashMap1x2; + (iteratee: (value: T) => TResult, collection: T[] | lodash.List | null | undefined): TResult[]; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashMap2x2; + (iteratee: (value: T[keyof T]) => TResult): LodashMap3x1; + (iteratee: lodash.__, collection: T | null | undefined): LodashMap3x2; + (iteratee: (value: T[keyof T]) => TResult, collection: T | null | undefined): TResult[]; + (iteratee: K): LodashMap4x1; + (iteratee: lodash.__, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashMap4x2; + (iteratee: K, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): Array; + (iteratee: string): LodashMap5x1; + (iteratee: string, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): any[]; + (iteratee: object): LodashMap6x1; + (iteratee: object, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): boolean[]; + } + type LodashMap1x1 = (collection: T[] | lodash.List | null | undefined) => TResult[]; + type LodashMap1x2 = (iteratee: (value: T) => TResult) => TResult[]; + type LodashMap2x2 = (iteratee: (value: T) => TResult) => TResult[]; + type LodashMap3x1 = (collection: T | null | undefined) => TResult[]; + type LodashMap3x2 = (iteratee: (value: T[keyof T]) => TResult) => TResult[]; + type LodashMap4x1 = (collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined) => Array; + interface LodashMap4x2 { + (iteratee: K): Array; + (iteratee: string): any[]; + (iteratee: object): boolean[]; + } + type LodashMap5x1 = (collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined) => any[]; + type LodashMap6x1 = (collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined) => boolean[]; + interface LodashMapKeys { + (iteratee: lodash.ValueIteratee): LodashMapKeys1x1; + (iteratee: lodash.__, object: lodash.List | null | undefined): LodashMapKeys1x2; + (iteratee: lodash.ValueIteratee, object: lodash.List | null | undefined): lodash.Dictionary; + (iteratee: lodash.ValueIteratee): LodashMapKeys2x1; + (iteratee: lodash.__, object: T | null | undefined): LodashMapKeys2x2; + (iteratee: lodash.ValueIteratee, object: T | null | undefined): lodash.Dictionary; + } + type LodashMapKeys1x1 = (object: lodash.List | null | undefined) => lodash.Dictionary; + type LodashMapKeys1x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; + type LodashMapKeys2x1 = (object: T | null | undefined) => lodash.Dictionary; + type LodashMapKeys2x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; + interface LodashMapValues { + (callback: (value: string) => TResult): LodashMapValues1x1; + (callback: lodash.__, obj: string | null | undefined): LodashMapValues1x2; + (callback: (value: string) => TResult, obj: string | null | undefined): lodash.NumericDictionary; + (callback: (value: T) => TResult): LodashMapValues2x1; + (callbackOrIterateeOrIterateeOrIteratee: lodash.__, obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashMapValues2x2; + (callback: (value: T) => TResult, obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): lodash.Dictionary; + (callback: (value: T[keyof T]) => TResult): LodashMapValues3x1; + (callbackOrIterateeOrIteratee: lodash.__, obj: T | null | undefined): LodashMapValues3x2; + (callback: (value: T[keyof T]) => TResult, obj: T | null | undefined): { [P in keyof T]: TResult }; + (iteratee: object): LodashMapValues4x1; + (iteratee: object, obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): lodash.Dictionary; + (iteratee: object, obj: T | null | undefined): { [P in keyof T]: boolean }; + (iteratee: TKey): LodashMapValues6x1; + (iteratee: TKey, obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): lodash.Dictionary; + (iteratee: string): LodashMapValues7x1; + (iteratee: string, obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): lodash.Dictionary; + (iteratee: string, obj: T | null | undefined): { [P in keyof T]: any }; + } + type LodashMapValues1x1 = (obj: string | null | undefined) => lodash.NumericDictionary; + type LodashMapValues1x2 = (callback: (value: string) => TResult) => lodash.NumericDictionary; + type LodashMapValues2x1 = (obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined) => lodash.Dictionary; + interface LodashMapValues2x2 { + (callback: (value: T) => TResult): lodash.Dictionary; + (iteratee: object): lodash.Dictionary; + (iteratee: TKey): lodash.Dictionary; + (iteratee: string): lodash.Dictionary; + } + type LodashMapValues3x1 = (obj: T | null | undefined) => { [P in keyof T]: TResult }; + interface LodashMapValues3x2 { + (callback: (value: T[keyof T]) => TResult): { [P in keyof T]: TResult }; + (iteratee: object): { [P in keyof T]: boolean }; + (iteratee: string): { [P in keyof T]: any }; + } + interface LodashMapValues4x1 { + (obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): lodash.Dictionary; + (obj: T | null | undefined): { [P in keyof T]: boolean }; + } + type LodashMapValues6x1 = (obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined) => lodash.Dictionary; + interface LodashMapValues7x1 { + (obj: lodash.Dictionary | lodash.NumericDictionary | null | undefined): lodash.Dictionary; + (obj: T | null | undefined): { [P in keyof T]: any }; + } + interface LodashMatchesProperty { + (path: lodash.PropertyPath): LodashMatchesProperty1x1; + (path: lodash.__, srcValue: T): LodashMatchesProperty1x2; + (path: lodash.PropertyPath, srcValue: T): (value: any) => boolean; + } + type LodashMatchesProperty1x1 = (srcValue: T) => (value: any) => boolean; + type LodashMatchesProperty1x2 = (path: lodash.PropertyPath) => (value: any) => boolean; + type LodashMax = (collection: lodash.List | null | undefined) => T | undefined; + interface LodashMaxBy { + (iteratee: lodash.ValueIteratee): LodashMaxBy1x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashMaxBy1x2; + (iteratee: lodash.ValueIteratee, collection: lodash.List | null | undefined): T | undefined; + } + type LodashMaxBy1x1 = (collection: lodash.List | null | undefined) => T | undefined; + type LodashMaxBy1x2 = (iteratee: lodash.ValueIteratee) => T | undefined; + type LodashMean = (collection: lodash.List | null | undefined) => number; + interface LodashMeanBy { + (iteratee: lodash.ValueIteratee): LodashMeanBy1x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashMeanBy1x2; + (iteratee: lodash.ValueIteratee, collection: lodash.List | null | undefined): number; + } + type LodashMeanBy1x1 = (collection: lodash.List | null | undefined) => number; + type LodashMeanBy1x2 = (iteratee: lodash.ValueIteratee) => number; + type LodashMemoize = any>(func: T) => T & lodash.MemoizedFunction; + interface LodashMerge { + (object: TObject): LodashMerge1x1; + (object: lodash.__, source: TSource): LodashMerge1x2; + (object: TObject, source: TSource): TObject & TSource; + } + type LodashMerge1x1 = (source: TSource) => TObject & TSource; + type LodashMerge1x2 = (object: TObject) => TObject & TSource; + type LodashMergeAll = (object: ReadonlyArray) => any; + interface LodashMergeAllWith { + (customizer: lodash.MergeWithCustomizer): LodashMergeAllWith1x1; + (customizer: lodash.__, args: ReadonlyArray): LodashMergeAllWith1x2; + (customizer: lodash.MergeWithCustomizer, args: ReadonlyArray): any; + } + type LodashMergeAllWith1x1 = (args: ReadonlyArray) => any; + type LodashMergeAllWith1x2 = (customizer: lodash.MergeWithCustomizer) => any; + interface LodashMergeWith { + (customizer: lodash.MergeWithCustomizer): LodashMergeWith1x1; + (customizer: lodash.__, object: TObject): LodashMergeWith1x2; + (customizer: lodash.MergeWithCustomizer, object: TObject): LodashMergeWith1x3; + (customizer: lodash.__, object: lodash.__, source: TSource): LodashMergeWith1x4; + (customizer: lodash.MergeWithCustomizer, object: lodash.__, source: TSource): LodashMergeWith1x5; + (customizer: lodash.__, object: TObject, source: TSource): LodashMergeWith1x6; + (customizer: lodash.MergeWithCustomizer, object: TObject, source: TSource): TObject & TSource; + } + interface LodashMergeWith1x1 { + (object: TObject): LodashMergeWith1x3; + (object: lodash.__, source: TSource): LodashMergeWith1x5; + (object: TObject, source: TSource): TObject & TSource; + } + interface LodashMergeWith1x2 { + (customizer: lodash.MergeWithCustomizer): LodashMergeWith1x3; + (customizer: lodash.__, source: TSource): LodashMergeWith1x6; + (customizer: lodash.MergeWithCustomizer, source: TSource): TObject & TSource; + } + type LodashMergeWith1x3 = (source: TSource) => TObject & TSource; + interface LodashMergeWith1x4 { + (customizer: lodash.MergeWithCustomizer): LodashMergeWith1x5; + (customizer: lodash.__, object: TObject): LodashMergeWith1x6; + (customizer: lodash.MergeWithCustomizer, object: TObject): TObject & TSource; + } + type LodashMergeWith1x5 = (object: TObject) => TObject & TSource; + type LodashMergeWith1x6 = (customizer: lodash.MergeWithCustomizer) => TObject & TSource; + type LodashMethod = (path: lodash.PropertyPath) => (object: any) => any; + type LodashMethodOf = (object: object) => (path: lodash.PropertyPath) => any; + type LodashMin = (collection: lodash.List | null | undefined) => T | undefined; + interface LodashMinBy { + (iteratee: lodash.ValueIteratee): LodashMinBy1x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashMinBy1x2; + (iteratee: lodash.ValueIteratee, collection: lodash.List | null | undefined): T | undefined; + } + type LodashMinBy1x1 = (collection: lodash.List | null | undefined) => T | undefined; + type LodashMinBy1x2 = (iteratee: lodash.ValueIteratee) => T | undefined; + interface LodashMultiply { + (multiplier: number): LodashMultiply1x1; + (multiplier: lodash.__, multiplicand: number): LodashMultiply1x2; + (multiplier: number, multiplicand: number): number; + } + type LodashMultiply1x1 = (multiplicand: number) => number; + type LodashMultiply1x2 = (multiplier: number) => number; + type LodashNoConflict = () => typeof _; + type LodashNoop = (...args: any[]) => void; + type LodashNow = () => number; + interface LodashNth { + (n: number): LodashNth1x1; + (n: lodash.__, array: lodash.List | null | undefined): LodashNth1x2; + (n: number, array: lodash.List | null | undefined): T | undefined; + } + type LodashNth1x1 = (array: lodash.List | null | undefined) => T | undefined; + type LodashNth1x2 = (n: number) => T | undefined; + type LodashNthArg = (n: number) => (...args: any[]) => any; + interface LodashOmit { + (paths: lodash.PropertyPath): LodashOmit1x1; + (paths: lodash.__, object: T | null | undefined): LodashOmit1x2; + (paths: lodash.PropertyPath, object: T | null | undefined): T; + (paths: lodash.__, object: T | null | undefined): LodashOmit2x2; + (paths: lodash.PropertyPath, object: T | null | undefined): lodash.PartialObject; + } + interface LodashOmit1x1 { + (object: T | null | undefined): T; + (object: T | null | undefined): lodash.PartialObject; + } + type LodashOmit1x2 = (paths: lodash.PropertyPath) => T; + type LodashOmit2x2 = (paths: lodash.PropertyPath) => lodash.PartialObject; + interface LodashOmitBy { + (predicate: lodash.ValueKeyIteratee): LodashOmitBy1x1; + (predicate: lodash.__, object: T | null | undefined): LodashOmitBy1x2; + (predicate: lodash.ValueKeyIteratee, object: T | null | undefined): lodash.PartialObject; + } + type LodashOmitBy1x1 = (object: T1 | null | undefined) => lodash.PartialObject; + type LodashOmitBy1x2 = (predicate: lodash.ValueKeyIteratee) => lodash.PartialObject; + type LodashOnce = any>(func: T) => T; + interface LodashOrderBy { + (iteratees: lodash.Many<(value: T) => lodash.NotVoid>): LodashOrderBy1x1; + (iteratees: lodash.__, orders: lodash.Many): LodashOrderBy1x2; + (iteratees: lodash.Many<(value: T) => lodash.NotVoid>, orders: lodash.Many): LodashOrderBy1x3; + (iteratees: lodash.__, orders: lodash.__, collection: lodash.List | null | undefined): LodashOrderBy1x4; + (iteratees: lodash.Many<(value: T) => lodash.NotVoid>, orders: lodash.__, collection: lodash.List | null | undefined): LodashOrderBy1x5; + (iteratees: lodash.__, orders: lodash.Many, collection: lodash.List | null | undefined): LodashOrderBy1x6; + (iteratees: lodash.Many<(value: T) => lodash.NotVoid> | lodash.Many>, orders: lodash.Many, collection: lodash.List | null | undefined): T[]; + (iteratees: lodash.Many>): LodashOrderBy2x1; + (iteratees: lodash.Many>, orders: lodash.Many): LodashOrderBy2x3; + (iteratees: lodash.Many>, orders: lodash.__, collection: lodash.List | null | undefined): LodashOrderBy2x5; + (iteratees: lodash.__, orders: lodash.__, collection: T | null | undefined): LodashOrderBy3x4; + (iteratees: lodash.Many<(value: T[keyof T]) => lodash.NotVoid>, orders: lodash.__, collection: T | null | undefined): LodashOrderBy3x5; + (iteratees: lodash.__, orders: lodash.Many, collection: T | null | undefined): LodashOrderBy3x6; + (iteratees: lodash.Many<(value: T[keyof T]) => lodash.NotVoid> | lodash.Many>, orders: lodash.Many, collection: T | null | undefined): Array; + (iteratees: lodash.Many>, orders: lodash.__, collection: T | null | undefined): LodashOrderBy4x5; + } + interface LodashOrderBy1x1 { + (orders: lodash.Many): LodashOrderBy1x3; + (orders: lodash.__, collection: lodash.List | null | undefined): LodashOrderBy1x5; + (orders: lodash.Many, collection: lodash.List | object | null | undefined): T[]; + (orders: lodash.__, collection: T1 | null | undefined): LodashOrderBy3x5; + } + interface LodashOrderBy1x2 { + (iteratees: lodash.Many<(value: T) => lodash.NotVoid>): LodashOrderBy1x3; + (iteratees: lodash.__, collection: lodash.List | null | undefined): LodashOrderBy1x6; + (iteratees: lodash.Many<(value: T) => lodash.NotVoid> | lodash.Many>, collection: lodash.List | null | undefined): T[]; + (iteratees: lodash.Many>): LodashOrderBy2x3; + (iteratees: lodash.__, collection: T | null | undefined): LodashOrderBy3x6; + (iteratees: lodash.Many<(value: T[keyof T]) => lodash.NotVoid> | lodash.Many>, collection: T | null | undefined): Array; + } + interface LodashOrderBy1x3 { + (collection: lodash.List | null | undefined): T[]; + (collection: object | null | undefined): object[]; + } + interface LodashOrderBy1x4 { + (iteratees: lodash.Many<(value: T) => lodash.NotVoid>): LodashOrderBy1x5; + (iteratees: lodash.__, orders: lodash.Many): LodashOrderBy1x6; + (iteratees: lodash.Many<(value: T) => lodash.NotVoid> | lodash.Many>, orders: lodash.Many): T[]; + (iteratees: lodash.Many>): LodashOrderBy2x5; + } + type LodashOrderBy1x5 = (orders: lodash.Many) => T[]; + type LodashOrderBy1x6 = (iteratees: lodash.Many<(value: T) => lodash.NotVoid> | lodash.Many>) => T[]; + interface LodashOrderBy2x1 { + (orders: lodash.Many): LodashOrderBy2x3; + (orders: lodash.__, collection: lodash.List | null | undefined): LodashOrderBy2x5; + (orders: lodash.Many, collection: lodash.List | object | null | undefined): T[]; + (orders: lodash.__, collection: T1 | null | undefined): LodashOrderBy4x5; + } + interface LodashOrderBy2x3 { + (collection: lodash.List | null | undefined): T[]; + (collection: object | null | undefined): object[]; + } + type LodashOrderBy2x5 = (orders: lodash.Many) => T[]; + interface LodashOrderBy3x4 { + (iteratees: lodash.Many<(value: T[keyof T]) => lodash.NotVoid>): LodashOrderBy3x5; + (iteratees: lodash.__, orders: lodash.Many): LodashOrderBy3x6; + (iteratees: lodash.Many<(value: T[keyof T]) => lodash.NotVoid> | lodash.Many>, orders: lodash.Many): Array; + (iteratees: lodash.Many>): LodashOrderBy4x5; + } + type LodashOrderBy3x5 = (orders: lodash.Many) => Array; + type LodashOrderBy3x6 = (iteratees: lodash.Many<(value: T[keyof T]) => lodash.NotVoid> | lodash.Many>) => Array; + type LodashOrderBy4x5 = (orders: lodash.Many) => Array; + interface LodashOverArgs { + (func: (...args: any[]) => any): LodashOverArgs1x1; + (func: lodash.__, transforms: lodash.Many<(...args: any[]) => any>): LodashOverArgs1x2; + (func: (...args: any[]) => any, transforms: lodash.Many<(...args: any[]) => any>): (...args: any[]) => any; + } + type LodashOverArgs1x1 = (transforms: lodash.Many<(...args: any[]) => any>) => (...args: any[]) => any; + type LodashOverArgs1x2 = (func: (...args: any[]) => any) => (...args: any[]) => any; + interface LodashPad { + (length: number): LodashPad1x1; + (length: lodash.__, string: string): LodashPad1x2; + (length: number, string: string): string; + } + type LodashPad1x1 = (string: string) => string; + type LodashPad1x2 = (length: number) => string; + interface LodashPadChars { + (chars: string): LodashPadChars1x1; + (chars: lodash.__, length: number): LodashPadChars1x2; + (chars: string, length: number): LodashPadChars1x3; + (chars: lodash.__, length: lodash.__, string: string): LodashPadChars1x4; + (chars: string, length: lodash.__, string: string): LodashPadChars1x5; + (chars: lodash.__, length: number, string: string): LodashPadChars1x6; + (chars: string, length: number, string: string): string; + } + interface LodashPadChars1x1 { + (length: number): LodashPadChars1x3; + (length: lodash.__, string: string): LodashPadChars1x5; + (length: number, string: string): string; + } + interface LodashPadChars1x2 { + (chars: string): LodashPadChars1x3; + (chars: lodash.__, string: string): LodashPadChars1x6; + (chars: string, string: string): string; + } + type LodashPadChars1x3 = (string: string) => string; + interface LodashPadChars1x4 { + (chars: string): LodashPadChars1x5; + (chars: lodash.__, length: number): LodashPadChars1x6; + (chars: string, length: number): string; + } + type LodashPadChars1x5 = (length: number) => string; + type LodashPadChars1x6 = (chars: string) => string; + interface LodashPadCharsEnd { + (chars: string): LodashPadCharsEnd1x1; + (chars: lodash.__, length: number): LodashPadCharsEnd1x2; + (chars: string, length: number): LodashPadCharsEnd1x3; + (chars: lodash.__, length: lodash.__, string: string): LodashPadCharsEnd1x4; + (chars: string, length: lodash.__, string: string): LodashPadCharsEnd1x5; + (chars: lodash.__, length: number, string: string): LodashPadCharsEnd1x6; + (chars: string, length: number, string: string): string; + } + interface LodashPadCharsEnd1x1 { + (length: number): LodashPadCharsEnd1x3; + (length: lodash.__, string: string): LodashPadCharsEnd1x5; + (length: number, string: string): string; + } + interface LodashPadCharsEnd1x2 { + (chars: string): LodashPadCharsEnd1x3; + (chars: lodash.__, string: string): LodashPadCharsEnd1x6; + (chars: string, string: string): string; + } + type LodashPadCharsEnd1x3 = (string: string) => string; + interface LodashPadCharsEnd1x4 { + (chars: string): LodashPadCharsEnd1x5; + (chars: lodash.__, length: number): LodashPadCharsEnd1x6; + (chars: string, length: number): string; + } + type LodashPadCharsEnd1x5 = (length: number) => string; + type LodashPadCharsEnd1x6 = (chars: string) => string; + interface LodashPadCharsStart { + (chars: string): LodashPadCharsStart1x1; + (chars: lodash.__, length: number): LodashPadCharsStart1x2; + (chars: string, length: number): LodashPadCharsStart1x3; + (chars: lodash.__, length: lodash.__, string: string): LodashPadCharsStart1x4; + (chars: string, length: lodash.__, string: string): LodashPadCharsStart1x5; + (chars: lodash.__, length: number, string: string): LodashPadCharsStart1x6; + (chars: string, length: number, string: string): string; + } + interface LodashPadCharsStart1x1 { + (length: number): LodashPadCharsStart1x3; + (length: lodash.__, string: string): LodashPadCharsStart1x5; + (length: number, string: string): string; + } + interface LodashPadCharsStart1x2 { + (chars: string): LodashPadCharsStart1x3; + (chars: lodash.__, string: string): LodashPadCharsStart1x6; + (chars: string, string: string): string; + } + type LodashPadCharsStart1x3 = (string: string) => string; + interface LodashPadCharsStart1x4 { + (chars: string): LodashPadCharsStart1x5; + (chars: lodash.__, length: number): LodashPadCharsStart1x6; + (chars: string, length: number): string; + } + type LodashPadCharsStart1x5 = (length: number) => string; + type LodashPadCharsStart1x6 = (chars: string) => string; + interface LodashPadEnd { + (length: number): LodashPadEnd1x1; + (length: lodash.__, string: string): LodashPadEnd1x2; + (length: number, string: string): string; + } + type LodashPadEnd1x1 = (string: string) => string; + type LodashPadEnd1x2 = (length: number) => string; + interface LodashPadStart { + (length: number): LodashPadStart1x1; + (length: lodash.__, string: string): LodashPadStart1x2; + (length: number, string: string): string; + } + type LodashPadStart1x1 = (string: string) => string; + type LodashPadStart1x2 = (length: number) => string; + interface LodashParseInt { + (radix: number): LodashParseInt1x1; + (radix: lodash.__, string: string): LodashParseInt1x2; + (radix: number, string: string): number; + } + type LodashParseInt1x1 = (string: string) => number; + type LodashParseInt1x2 = (radix: number) => number; + interface LodashPartial { + (args: ReadonlyArray): LodashPartial1x1; + (args: lodash.__, func: (...args: any[]) => any): LodashPartial1x2; + (args: ReadonlyArray, func: (...args: any[]) => any): (...args: any[]) => any; + placeholder: lodash.__; + } + type LodashPartial1x1 = (func: (...args: any[]) => any) => (...args: any[]) => any; + type LodashPartial1x2 = (args: ReadonlyArray) => (...args: any[]) => any; + interface LodashPartialRight { + (args: ReadonlyArray): LodashPartialRight1x1; + (args: lodash.__, func: (...args: any[]) => any): LodashPartialRight1x2; + (args: ReadonlyArray, func: (...args: any[]) => any): (...args: any[]) => any; + placeholder: lodash.__; + } + type LodashPartialRight1x1 = (func: (...args: any[]) => any) => (...args: any[]) => any; + type LodashPartialRight1x2 = (args: ReadonlyArray) => (...args: any[]) => any; + interface LodashPartition { + (callback: lodash.ValueIteratee): LodashPartition1x1; + (callback: lodash.__, collection: lodash.List | null | undefined): LodashPartition1x2; + (callback: lodash.ValueIteratee, collection: lodash.List | null | undefined): [T[], T[]]; + (callback: lodash.__, collection: T | null | undefined): LodashPartition2x2; + (callback: lodash.ValueIteratee, collection: T | null | undefined): [Array, Array]; + } + type LodashPartition1x1 = (collection: lodash.List | object | null | undefined) => [T[], T[]]; + type LodashPartition1x2 = (callback: lodash.ValueIteratee) => [T[], T[]]; + type LodashPartition2x2 = (callback: lodash.ValueIteratee) => [Array, Array]; + interface LodashPath { + (path: TKey | [TKey]): LodashPath1x1; + (path: lodash.__, object: TObject): LodashPath1x2; + (path: TKey | [TKey], object: TObject): TObject[TKey]; + (path: lodash.__, object: TObject | null | undefined): LodashPath2x2; + (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | undefined; + (path: number): LodashPath3x1; + (path: lodash.__, object: lodash.NumericDictionary): LodashPath3x2; + (path: number, object: lodash.NumericDictionary): T; + (path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPath4x2; + (path: number, object: lodash.NumericDictionary | null | undefined): T | undefined; + (path: lodash.PropertyPath): LodashPath5x1; + (path: lodash.__, object: null | undefined): LodashPath5x2; + (path: lodash.PropertyPath, object: null | undefined): undefined; + (path: lodash.__, object: any): LodashPath6x2; + (path: lodash.PropertyPath, object: any): any; + } + interface LodashPath1x1 { + (object: TObject): TObject[TKey]; + (object: TObject | null | undefined): TObject[TKey] | undefined; + } + type LodashPath1x2 = (path: TKey | [TKey]) => TObject[TKey]; + type LodashPath2x2 = (path: TKey | [TKey]) => TObject[TKey] | undefined; + interface LodashPath3x1 { + (object: lodash.NumericDictionary): T; + (object: lodash.NumericDictionary | null | undefined): T | undefined; + } + type LodashPath3x2 = (path: number) => T; + type LodashPath4x2 = (path: number) => T | undefined; + interface LodashPath5x1 { + (object: null | undefined): undefined; + (object: any): any; + } + type LodashPath5x2 = (path: lodash.PropertyPath) => undefined; + type LodashPath6x2 = (path: lodash.PropertyPath) => any; + interface LodashPathOr { + (defaultValue: TDefault): LodashPathOr1x1; + (defaultValue: lodash.__, path: TKey | [TKey]): LodashPathOr1x2; + (defaultValue: TDefault, path: TKey | [TKey]): LodashPathOr1x3; + (defaultValue: lodash.__, path: lodash.__, object: TObject | null | undefined): LodashPathOr1x4; + (defaultValue: TDefault, path: lodash.__, object: TObject | null | undefined): LodashPathOr1x5; + (defaultValue: lodash.__, path: TKey | [TKey], object: TObject | null | undefined): LodashPathOr1x6; + (defaultValue: TDefault, path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; + (defaultValue: lodash.__, path: number): LodashPathOr2x2; + (defaultValue: TDefault, path: number): LodashPathOr2x3; + (defaultValue: lodash.__, path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPathOr2x4; + (defaultValue: TDefault, path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPathOr2x5; + (defaultValue: lodash.__, path: number, object: lodash.NumericDictionary | null | undefined): LodashPathOr2x6; + (defaultValue: TDefault, path: number, object: lodash.NumericDictionary | null | undefined): T | TDefault; + (defaultValue: lodash.__, path: lodash.PropertyPath): LodashPathOr3x2; + (defaultValue: TDefault, path: lodash.PropertyPath): LodashPathOr3x3; + (defaultValue: lodash.__, path: lodash.__, object: null | undefined): LodashPathOr3x4; + (defaultValue: TDefault, path: lodash.__, object: null | undefined): LodashPathOr3x5; + (defaultValue: lodash.__, path: lodash.PropertyPath, object: null | undefined): LodashPathOr3x6; + (defaultValue: TDefault, path: lodash.PropertyPath, object: null | undefined): TDefault; + (defaultValue: any): LodashPathOr4x1; + (defaultValue: any, path: lodash.PropertyPath): LodashPathOr4x3; + (defaultValue: lodash.__, path: lodash.__, object: any): LodashPathOr4x4; + (defaultValue: any, path: lodash.__, object: any): LodashPathOr4x5; + (defaultValue: lodash.__, path: lodash.PropertyPath, object: any): LodashPathOr4x6; + (defaultValue: any, path: lodash.PropertyPath, object: any): any; + } + interface LodashPathOr1x1 { + (path: TKey | [TKey]): LodashPathOr1x3; + (path: lodash.__, object: TObject | null | undefined): LodashPathOr1x5; + (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; + (path: number): LodashPathOr2x3; + (path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPathOr2x5; + (path: number, object: lodash.NumericDictionary | null | undefined): T | TDefault; + (path: lodash.PropertyPath): LodashPathOr3x3; + (path: lodash.__, object: null | undefined): LodashPathOr3x5; + (path: lodash.PropertyPath, object: null | undefined): TDefault; + } + interface LodashPathOr1x2 { + (defaultValue: TDefault): LodashPathOr1x3; + (defaultValue: lodash.__, object: TObject | null | undefined): LodashPathOr1x6; + (defaultValue: TDefault, object: TObject | null | undefined): TObject[TKey] | TDefault; + } + type LodashPathOr1x3 = (object: TObject | null | undefined) => TObject[TKey] | TDefault; + interface LodashPathOr1x4 { + (defaultValue: TDefault): LodashPathOr1x5; + (defaultValue: lodash.__, path: TKey | [TKey]): LodashPathOr1x6; + (defaultValue: TDefault, path: TKey | [TKey]): TObject[TKey] | TDefault; + } + type LodashPathOr1x5 = (path: TKey | [TKey]) => TObject[TKey] | TDefault; + type LodashPathOr1x6 = (defaultValue: TDefault) => TObject[TKey] | TDefault; + interface LodashPathOr2x2 { + (defaultValue: TDefault): LodashPathOr2x3; + (defaultValue: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPathOr2x6; + (defaultValue: TDefault, object: lodash.NumericDictionary | null | undefined): T | TDefault; + } + type LodashPathOr2x3 = (object: lodash.NumericDictionary | null | undefined) => T | TDefault; + interface LodashPathOr2x4 { + (defaultValue: TDefault): LodashPathOr2x5; + (defaultValue: lodash.__, path: number): LodashPathOr2x6; + (defaultValue: TDefault, path: number): T | TDefault; + } + type LodashPathOr2x5 = (path: number) => T | TDefault; + type LodashPathOr2x6 = (defaultValue: TDefault) => T | TDefault; + interface LodashPathOr3x2 { + (defaultValue: TDefault): LodashPathOr3x3; + (defaultValue: lodash.__, object: null | undefined): LodashPathOr3x6; + (defaultValue: TDefault, object: null | undefined): TDefault; + (defaultValue: any): LodashPathOr4x3; + (defaultValue: lodash.__, object: any): LodashPathOr4x6; + (defaultValue: any, object: any): any; + } + type LodashPathOr3x3 = (object: null | undefined) => TDefault; + interface LodashPathOr3x4 { + (defaultValue: TDefault): LodashPathOr3x5; + (defaultValue: lodash.__, path: lodash.PropertyPath): LodashPathOr3x6; + (defaultValue: TDefault, path: lodash.PropertyPath): TDefault; + } + type LodashPathOr3x5 = (path: lodash.PropertyPath) => TDefault; + type LodashPathOr3x6 = (defaultValue: TDefault) => TDefault; + interface LodashPathOr4x1 { + (path: lodash.PropertyPath): LodashPathOr4x3; + (path: lodash.__, object: any): LodashPathOr4x5; + (path: lodash.PropertyPath, object: any): any; + } + type LodashPathOr4x3 = (object: any) => any; + interface LodashPathOr4x4 { + (defaultValue: any): LodashPathOr4x5; + (defaultValue: lodash.__, path: lodash.PropertyPath): LodashPathOr4x6; + (defaultValue: any, path: lodash.PropertyPath): any; + } + type LodashPathOr4x5 = (path: lodash.PropertyPath) => any; + type LodashPathOr4x6 = (defaultValue: any) => any; + interface LodashPick { + (props: lodash.Many): LodashPick1x1; + (props: lodash.__, object: T): LodashPick1x2; + (props: lodash.Many, object: T): Pick; + (props: lodash.PropertyPath): LodashPick2x1; + (props: lodash.__, object: T | null | undefined): LodashPick2x2; + (props: lodash.PropertyPath, object: T | null | undefined): lodash.PartialDeep; + } + type LodashPick1x1 = (object: T) => Pick; + type LodashPick1x2 = (props: lodash.Many) => Pick; + type LodashPick2x1 = (object: T | null | undefined) => lodash.PartialDeep; + type LodashPick2x2 = (props: lodash.PropertyPath) => lodash.PartialDeep; + interface LodashPickBy { + (predicate: lodash.ValueKeyIteratee): LodashPickBy1x1; + (predicate: lodash.__, object: T | null | undefined): LodashPickBy1x2; + (predicate: lodash.ValueKeyIteratee, object: T | null | undefined): lodash.PartialObject; + } + type LodashPickBy1x1 = (object: T1 | null | undefined) => lodash.PartialObject; + type LodashPickBy1x2 = (predicate: lodash.ValueKeyIteratee) => lodash.PartialObject; + interface LodashProp { + (path: TKey | [TKey]): LodashProp1x1; + (path: lodash.__, object: TObject): LodashProp1x2; + (path: TKey | [TKey], object: TObject): TObject[TKey]; + (path: lodash.__, object: TObject | null | undefined): LodashProp2x2; + (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | undefined; + (path: number): LodashProp3x1; + (path: lodash.__, object: lodash.NumericDictionary): LodashProp3x2; + (path: number, object: lodash.NumericDictionary): T; + (path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashProp4x2; + (path: number, object: lodash.NumericDictionary | null | undefined): T | undefined; + (path: lodash.PropertyPath): LodashProp5x1; + (path: lodash.__, object: null | undefined): LodashProp5x2; + (path: lodash.PropertyPath, object: null | undefined): undefined; + (path: lodash.__, object: any): LodashProp6x2; + (path: lodash.PropertyPath, object: any): any; + } + interface LodashProp1x1 { + (object: TObject): TObject[TKey]; + (object: TObject | null | undefined): TObject[TKey] | undefined; + } + type LodashProp1x2 = (path: TKey | [TKey]) => TObject[TKey]; + type LodashProp2x2 = (path: TKey | [TKey]) => TObject[TKey] | undefined; + interface LodashProp3x1 { + (object: lodash.NumericDictionary): T; + (object: lodash.NumericDictionary | null | undefined): T | undefined; + } + type LodashProp3x2 = (path: number) => T; + type LodashProp4x2 = (path: number) => T | undefined; + interface LodashProp5x1 { + (object: null | undefined): undefined; + (object: any): any; + } + type LodashProp5x2 = (path: lodash.PropertyPath) => undefined; + type LodashProp6x2 = (path: lodash.PropertyPath) => any; + interface LodashProperty { + (path: TKey | [TKey]): LodashProperty1x1; + (path: lodash.__, object: TObject): LodashProperty1x2; + (path: TKey | [TKey], object: TObject): TObject[TKey]; + (path: lodash.__, object: TObject | null | undefined): LodashProperty2x2; + (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | undefined; + (path: number): LodashProperty3x1; + (path: lodash.__, object: lodash.NumericDictionary): LodashProperty3x2; + (path: number, object: lodash.NumericDictionary): T; + (path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashProperty4x2; + (path: number, object: lodash.NumericDictionary | null | undefined): T | undefined; + (path: lodash.PropertyPath): LodashProperty5x1; + (path: lodash.__, object: null | undefined): LodashProperty5x2; + (path: lodash.PropertyPath, object: null | undefined): undefined; + (path: lodash.__, object: any): LodashProperty6x2; + (path: lodash.PropertyPath, object: any): any; + } + interface LodashProperty1x1 { + (object: TObject): TObject[TKey]; + (object: TObject | null | undefined): TObject[TKey] | undefined; + } + type LodashProperty1x2 = (path: TKey | [TKey]) => TObject[TKey]; + type LodashProperty2x2 = (path: TKey | [TKey]) => TObject[TKey] | undefined; + interface LodashProperty3x1 { + (object: lodash.NumericDictionary): T; + (object: lodash.NumericDictionary | null | undefined): T | undefined; + } + type LodashProperty3x2 = (path: number) => T; + type LodashProperty4x2 = (path: number) => T | undefined; + interface LodashProperty5x1 { + (object: null | undefined): undefined; + (object: any): any; + } + type LodashProperty5x2 = (path: lodash.PropertyPath) => undefined; + type LodashProperty6x2 = (path: lodash.PropertyPath) => any; + interface LodashPropertyOf { + (path: TKey | [TKey]): LodashPropertyOf1x1; + (path: lodash.__, object: TObject): LodashPropertyOf1x2; + (path: TKey | [TKey], object: TObject): TObject[TKey]; + (path: lodash.__, object: TObject | null | undefined): LodashPropertyOf2x2; + (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | undefined; + (path: number): LodashPropertyOf3x1; + (path: lodash.__, object: lodash.NumericDictionary): LodashPropertyOf3x2; + (path: number, object: lodash.NumericDictionary): T; + (path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPropertyOf4x2; + (path: number, object: lodash.NumericDictionary | null | undefined): T | undefined; + (path: lodash.PropertyPath): LodashPropertyOf5x1; + (path: lodash.__, object: null | undefined): LodashPropertyOf5x2; + (path: lodash.PropertyPath, object: null | undefined): undefined; + (path: lodash.__, object: any): LodashPropertyOf6x2; + (path: lodash.PropertyPath, object: any): any; + } + interface LodashPropertyOf1x1 { + (object: TObject): TObject[TKey]; + (object: TObject | null | undefined): TObject[TKey] | undefined; + } + type LodashPropertyOf1x2 = (path: TKey | [TKey]) => TObject[TKey]; + type LodashPropertyOf2x2 = (path: TKey | [TKey]) => TObject[TKey] | undefined; + interface LodashPropertyOf3x1 { + (object: lodash.NumericDictionary): T; + (object: lodash.NumericDictionary | null | undefined): T | undefined; + } + type LodashPropertyOf3x2 = (path: number) => T; + type LodashPropertyOf4x2 = (path: number) => T | undefined; + interface LodashPropertyOf5x1 { + (object: null | undefined): undefined; + (object: any): any; + } + type LodashPropertyOf5x2 = (path: lodash.PropertyPath) => undefined; + type LodashPropertyOf6x2 = (path: lodash.PropertyPath) => any; + interface LodashPropOr { + (defaultValue: TDefault): LodashPropOr1x1; + (defaultValue: lodash.__, path: TKey | [TKey]): LodashPropOr1x2; + (defaultValue: TDefault, path: TKey | [TKey]): LodashPropOr1x3; + (defaultValue: lodash.__, path: lodash.__, object: TObject | null | undefined): LodashPropOr1x4; + (defaultValue: TDefault, path: lodash.__, object: TObject | null | undefined): LodashPropOr1x5; + (defaultValue: lodash.__, path: TKey | [TKey], object: TObject | null | undefined): LodashPropOr1x6; + (defaultValue: TDefault, path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; + (defaultValue: lodash.__, path: number): LodashPropOr2x2; + (defaultValue: TDefault, path: number): LodashPropOr2x3; + (defaultValue: lodash.__, path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPropOr2x4; + (defaultValue: TDefault, path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPropOr2x5; + (defaultValue: lodash.__, path: number, object: lodash.NumericDictionary | null | undefined): LodashPropOr2x6; + (defaultValue: TDefault, path: number, object: lodash.NumericDictionary | null | undefined): T | TDefault; + (defaultValue: lodash.__, path: lodash.PropertyPath): LodashPropOr3x2; + (defaultValue: TDefault, path: lodash.PropertyPath): LodashPropOr3x3; + (defaultValue: lodash.__, path: lodash.__, object: null | undefined): LodashPropOr3x4; + (defaultValue: TDefault, path: lodash.__, object: null | undefined): LodashPropOr3x5; + (defaultValue: lodash.__, path: lodash.PropertyPath, object: null | undefined): LodashPropOr3x6; + (defaultValue: TDefault, path: lodash.PropertyPath, object: null | undefined): TDefault; + (defaultValue: any): LodashPropOr4x1; + (defaultValue: any, path: lodash.PropertyPath): LodashPropOr4x3; + (defaultValue: lodash.__, path: lodash.__, object: any): LodashPropOr4x4; + (defaultValue: any, path: lodash.__, object: any): LodashPropOr4x5; + (defaultValue: lodash.__, path: lodash.PropertyPath, object: any): LodashPropOr4x6; + (defaultValue: any, path: lodash.PropertyPath, object: any): any; + } + interface LodashPropOr1x1 { + (path: TKey | [TKey]): LodashPropOr1x3; + (path: lodash.__, object: TObject | null | undefined): LodashPropOr1x5; + (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; + (path: number): LodashPropOr2x3; + (path: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPropOr2x5; + (path: number, object: lodash.NumericDictionary | null | undefined): T | TDefault; + (path: lodash.PropertyPath): LodashPropOr3x3; + (path: lodash.__, object: null | undefined): LodashPropOr3x5; + (path: lodash.PropertyPath, object: null | undefined): TDefault; + } + interface LodashPropOr1x2 { + (defaultValue: TDefault): LodashPropOr1x3; + (defaultValue: lodash.__, object: TObject | null | undefined): LodashPropOr1x6; + (defaultValue: TDefault, object: TObject | null | undefined): TObject[TKey] | TDefault; + } + type LodashPropOr1x3 = (object: TObject | null | undefined) => TObject[TKey] | TDefault; + interface LodashPropOr1x4 { + (defaultValue: TDefault): LodashPropOr1x5; + (defaultValue: lodash.__, path: TKey | [TKey]): LodashPropOr1x6; + (defaultValue: TDefault, path: TKey | [TKey]): TObject[TKey] | TDefault; + } + type LodashPropOr1x5 = (path: TKey | [TKey]) => TObject[TKey] | TDefault; + type LodashPropOr1x6 = (defaultValue: TDefault) => TObject[TKey] | TDefault; + interface LodashPropOr2x2 { + (defaultValue: TDefault): LodashPropOr2x3; + (defaultValue: lodash.__, object: lodash.NumericDictionary | null | undefined): LodashPropOr2x6; + (defaultValue: TDefault, object: lodash.NumericDictionary | null | undefined): T | TDefault; + } + type LodashPropOr2x3 = (object: lodash.NumericDictionary | null | undefined) => T | TDefault; + interface LodashPropOr2x4 { + (defaultValue: TDefault): LodashPropOr2x5; + (defaultValue: lodash.__, path: number): LodashPropOr2x6; + (defaultValue: TDefault, path: number): T | TDefault; + } + type LodashPropOr2x5 = (path: number) => T | TDefault; + type LodashPropOr2x6 = (defaultValue: TDefault) => T | TDefault; + interface LodashPropOr3x2 { + (defaultValue: TDefault): LodashPropOr3x3; + (defaultValue: lodash.__, object: null | undefined): LodashPropOr3x6; + (defaultValue: TDefault, object: null | undefined): TDefault; + (defaultValue: any): LodashPropOr4x3; + (defaultValue: lodash.__, object: any): LodashPropOr4x6; + (defaultValue: any, object: any): any; + } + type LodashPropOr3x3 = (object: null | undefined) => TDefault; + interface LodashPropOr3x4 { + (defaultValue: TDefault): LodashPropOr3x5; + (defaultValue: lodash.__, path: lodash.PropertyPath): LodashPropOr3x6; + (defaultValue: TDefault, path: lodash.PropertyPath): TDefault; + } + type LodashPropOr3x5 = (path: lodash.PropertyPath) => TDefault; + type LodashPropOr3x6 = (defaultValue: TDefault) => TDefault; + interface LodashPropOr4x1 { + (path: lodash.PropertyPath): LodashPropOr4x3; + (path: lodash.__, object: any): LodashPropOr4x5; + (path: lodash.PropertyPath, object: any): any; + } + type LodashPropOr4x3 = (object: any) => any; + interface LodashPropOr4x4 { + (defaultValue: any): LodashPropOr4x5; + (defaultValue: lodash.__, path: lodash.PropertyPath): LodashPropOr4x6; + (defaultValue: any, path: lodash.PropertyPath): any; + } + type LodashPropOr4x5 = (path: lodash.PropertyPath) => any; + type LodashPropOr4x6 = (defaultValue: any) => any; + interface LodashPull { + (values: T): LodashPull1x1; + (values: lodash.__, array: ReadonlyArray): LodashPull1x2; + (values: T, array: ReadonlyArray): T[]; + (values: lodash.__, array: lodash.List): LodashPull2x2; + (values: T, array: lodash.List): lodash.List; + } + interface LodashPull1x1 { + (array: ReadonlyArray): T[]; + (array: lodash.List): lodash.List; + } + type LodashPull1x2 = (values: T) => T[]; + type LodashPull2x2 = (values: T) => lodash.List; + interface LodashPullAll { + (values: lodash.List): LodashPullAll1x1; + (values: lodash.__, array: ReadonlyArray): LodashPullAll1x2; + (values: lodash.List, array: ReadonlyArray): T[]; + (values: lodash.__, array: lodash.List): LodashPullAll2x2; + (values: lodash.List, array: lodash.List): lodash.List; + } + interface LodashPullAll1x1 { + (array: ReadonlyArray): T[]; + (array: lodash.List): lodash.List; + } + type LodashPullAll1x2 = (values: lodash.List) => T[]; + type LodashPullAll2x2 = (values: lodash.List) => lodash.List; + interface LodashPullAllBy { + (iteratee: lodash.ValueIteratee): LodashPullAllBy1x1; + (iteratee: lodash.__, values: lodash.List): LodashPullAllBy1x2; + (iteratee: lodash.ValueIteratee, values: lodash.List): LodashPullAllBy1x3; + (iteratee: lodash.__, values: lodash.__, array: ReadonlyArray): LodashPullAllBy1x4; + (iteratee: lodash.ValueIteratee, values: lodash.__, array: ReadonlyArray): LodashPullAllBy1x5; + (iteratee: lodash.__, values: lodash.List, array: ReadonlyArray): LodashPullAllBy1x6; + (iteratee: lodash.ValueIteratee, values: lodash.List, array: ReadonlyArray): T[]; + (iteratee: lodash.__, values: lodash.__, array: lodash.List): LodashPullAllBy2x4; + (iteratee: lodash.ValueIteratee, values: lodash.__, array: lodash.List): LodashPullAllBy2x5; + (iteratee: lodash.__, values: lodash.List, array: lodash.List): LodashPullAllBy2x6; + (iteratee: lodash.ValueIteratee, values: lodash.List, array: lodash.List): lodash.List; + (iteratee: lodash.ValueIteratee): LodashPullAllBy3x1; + (iteratee: lodash.__, values: lodash.List): LodashPullAllBy3x2; + (iteratee: lodash.ValueIteratee, values: lodash.List): LodashPullAllBy3x3; + (iteratee: lodash.__, values: lodash.__, array: ReadonlyArray): LodashPullAllBy3x4; + (iteratee: lodash.ValueIteratee, values: lodash.__, array: ReadonlyArray): LodashPullAllBy3x5; + (iteratee: lodash.__, values: lodash.List, array: ReadonlyArray): LodashPullAllBy3x6; + (iteratee: lodash.ValueIteratee, values: lodash.List, array: ReadonlyArray): T1[]; + (iteratee: lodash.__, values: lodash.__, array: lodash.List): LodashPullAllBy4x4; + (iteratee: lodash.ValueIteratee, values: lodash.__, array: lodash.List): LodashPullAllBy4x5; + (iteratee: lodash.__, values: lodash.List, array: lodash.List): LodashPullAllBy4x6; + (iteratee: lodash.ValueIteratee, values: lodash.List, array: lodash.List): lodash.List; + } + interface LodashPullAllBy1x1 { + (values: lodash.List): LodashPullAllBy1x3; + (values: lodash.__, array: ReadonlyArray): LodashPullAllBy1x5; + (values: lodash.List, array: ReadonlyArray): T[]; + (values: lodash.__, array: lodash.List): LodashPullAllBy2x5; + (values: lodash.List, array: lodash.List): lodash.List; + } + interface LodashPullAllBy1x2 { + (iteratee: lodash.ValueIteratee): LodashPullAllBy1x3; + (iteratee: lodash.__, array: ReadonlyArray): LodashPullAllBy1x6; + (iteratee: lodash.ValueIteratee, array: ReadonlyArray): T[]; + (iteratee: lodash.__, array: lodash.List): LodashPullAllBy2x6; + (iteratee: lodash.ValueIteratee, array: lodash.List): lodash.List; + } + interface LodashPullAllBy1x3 { + (array: ReadonlyArray): T[]; + (array: lodash.List): lodash.List; + } + interface LodashPullAllBy1x4 { + (iteratee: lodash.ValueIteratee): LodashPullAllBy1x5; + (iteratee: lodash.__, values: lodash.List): LodashPullAllBy1x6; + (iteratee: lodash.ValueIteratee, values: lodash.List): T[]; + } + type LodashPullAllBy1x5 = (values: lodash.List) => T[]; + type LodashPullAllBy1x6 = (iteratee: lodash.ValueIteratee) => T[]; + interface LodashPullAllBy2x4 { + (iteratee: lodash.ValueIteratee): LodashPullAllBy2x5; + (iteratee: lodash.__, values: lodash.List): LodashPullAllBy2x6; + (iteratee: lodash.ValueIteratee, values: lodash.List): lodash.List; + } + type LodashPullAllBy2x5 = (values: lodash.List) => lodash.List; + type LodashPullAllBy2x6 = (iteratee: lodash.ValueIteratee) => lodash.List; + interface LodashPullAllBy3x1 { + (values: lodash.List): LodashPullAllBy3x3; + (values: lodash.__, array: ReadonlyArray): LodashPullAllBy3x5; + (values: lodash.List, array: ReadonlyArray): T1[]; + (values: lodash.__, array: lodash.List): LodashPullAllBy4x5; + (values: lodash.List, array: lodash.List): lodash.List; + } + interface LodashPullAllBy3x2 { + (iteratee: lodash.ValueIteratee): LodashPullAllBy3x3; + (iteratee: lodash.__, array: ReadonlyArray): LodashPullAllBy3x6; + (iteratee: lodash.ValueIteratee, array: ReadonlyArray): T1[]; + (iteratee: lodash.__, array: lodash.List): LodashPullAllBy4x6; + (iteratee: lodash.ValueIteratee, array: lodash.List): lodash.List; + } + interface LodashPullAllBy3x3 { + (array: ReadonlyArray): T1[]; + (array: lodash.List): lodash.List; + } + interface LodashPullAllBy3x4 { + (iteratee: lodash.ValueIteratee): LodashPullAllBy3x5; + (iteratee: lodash.__, values: lodash.List): LodashPullAllBy3x6; + (iteratee: lodash.ValueIteratee, values: lodash.List): T1[]; + } + type LodashPullAllBy3x5 = (values: lodash.List) => T1[]; + type LodashPullAllBy3x6 = (iteratee: lodash.ValueIteratee) => T1[]; + interface LodashPullAllBy4x4 { + (iteratee: lodash.ValueIteratee): LodashPullAllBy4x5; + (iteratee: lodash.__, values: lodash.List): LodashPullAllBy4x6; + (iteratee: lodash.ValueIteratee, values: lodash.List): lodash.List; + } + type LodashPullAllBy4x5 = (values: lodash.List) => lodash.List; + type LodashPullAllBy4x6 = (iteratee: lodash.ValueIteratee) => lodash.List; + interface LodashPullAllWith { + (comparator: lodash.Comparator): LodashPullAllWith1x1; + (comparator: lodash.__, values: lodash.List): LodashPullAllWith1x2; + (comparator: lodash.Comparator, values: lodash.List): LodashPullAllWith1x3; + (comparator: lodash.__, values: lodash.__, array: ReadonlyArray): LodashPullAllWith1x4; + (comparator: lodash.Comparator, values: lodash.__, array: ReadonlyArray): LodashPullAllWith1x5; + (comparator: lodash.__, values: lodash.List, array: ReadonlyArray): LodashPullAllWith1x6; + (comparator: lodash.Comparator, values: lodash.List, array: ReadonlyArray): T[]; + (comparator: lodash.__, values: lodash.__, array: lodash.List): LodashPullAllWith2x4; + (comparator: lodash.Comparator, values: lodash.__, array: lodash.List): LodashPullAllWith2x5; + (comparator: lodash.__, values: lodash.List, array: lodash.List): LodashPullAllWith2x6; + (comparator: lodash.Comparator, values: lodash.List, array: lodash.List): lodash.List; + (comparator: lodash.Comparator2): LodashPullAllWith3x1; + (comparator: lodash.__, values: lodash.List): LodashPullAllWith3x2; + (comparator: lodash.Comparator2, values: lodash.List): LodashPullAllWith3x3; + (comparator: lodash.__, values: lodash.__, array: ReadonlyArray): LodashPullAllWith3x4; + (comparator: lodash.Comparator2, values: lodash.__, array: ReadonlyArray): LodashPullAllWith3x5; + (comparator: lodash.__, values: lodash.List, array: ReadonlyArray): LodashPullAllWith3x6; + (comparator: lodash.Comparator2, values: lodash.List, array: ReadonlyArray): T1[]; + (comparator: lodash.__, values: lodash.__, array: lodash.List): LodashPullAllWith4x4; + (comparator: lodash.Comparator2, values: lodash.__, array: lodash.List): LodashPullAllWith4x5; + (comparator: lodash.__, values: lodash.List, array: lodash.List): LodashPullAllWith4x6; + (comparator: lodash.Comparator2, values: lodash.List, array: lodash.List): lodash.List; + } + interface LodashPullAllWith1x1 { + (values: lodash.List): LodashPullAllWith1x3; + (values: lodash.__, array: ReadonlyArray): LodashPullAllWith1x5; + (values: lodash.List, array: ReadonlyArray): T[]; + (values: lodash.__, array: lodash.List): LodashPullAllWith2x5; + (values: lodash.List, array: lodash.List): lodash.List; + } + interface LodashPullAllWith1x2 { + (comparator: lodash.Comparator): LodashPullAllWith1x3; + (comparator: lodash.__, array: ReadonlyArray): LodashPullAllWith1x6; + (comparator: lodash.Comparator, array: ReadonlyArray): T[]; + (comparator: lodash.__, array: lodash.List): LodashPullAllWith2x6; + (comparator: lodash.Comparator, array: lodash.List): lodash.List; + } + interface LodashPullAllWith1x3 { + (array: ReadonlyArray): T[]; + (array: lodash.List): lodash.List; + } + interface LodashPullAllWith1x4 { + (comparator: lodash.Comparator): LodashPullAllWith1x5; + (comparator: lodash.__, values: lodash.List): LodashPullAllWith1x6; + (comparator: lodash.Comparator, values: lodash.List): T[]; + } + type LodashPullAllWith1x5 = (values: lodash.List) => T[]; + type LodashPullAllWith1x6 = (comparator: lodash.Comparator) => T[]; + interface LodashPullAllWith2x4 { + (comparator: lodash.Comparator): LodashPullAllWith2x5; + (comparator: lodash.__, values: lodash.List): LodashPullAllWith2x6; + (comparator: lodash.Comparator, values: lodash.List): lodash.List; + } + type LodashPullAllWith2x5 = (values: lodash.List) => lodash.List; + type LodashPullAllWith2x6 = (comparator: lodash.Comparator) => lodash.List; + interface LodashPullAllWith3x1 { + (values: lodash.List): LodashPullAllWith3x3; + (values: lodash.__, array: ReadonlyArray): LodashPullAllWith3x5; + (values: lodash.List, array: ReadonlyArray): T1[]; + (values: lodash.__, array: lodash.List): LodashPullAllWith4x5; + (values: lodash.List, array: lodash.List): lodash.List; + } + interface LodashPullAllWith3x2 { + (comparator: lodash.Comparator2): LodashPullAllWith3x3; + (comparator: lodash.__, array: ReadonlyArray): LodashPullAllWith3x6; + (comparator: lodash.Comparator2, array: ReadonlyArray): T1[]; + (comparator: lodash.__, array: lodash.List): LodashPullAllWith4x6; + (comparator: lodash.Comparator2, array: lodash.List): lodash.List; + } + interface LodashPullAllWith3x3 { + (array: ReadonlyArray): T1[]; + (array: lodash.List): lodash.List; + } + interface LodashPullAllWith3x4 { + (comparator: lodash.Comparator2): LodashPullAllWith3x5; + (comparator: lodash.__, values: lodash.List): LodashPullAllWith3x6; + (comparator: lodash.Comparator2, values: lodash.List): T1[]; + } + type LodashPullAllWith3x5 = (values: lodash.List) => T1[]; + type LodashPullAllWith3x6 = (comparator: lodash.Comparator2) => T1[]; + interface LodashPullAllWith4x4 { + (comparator: lodash.Comparator2): LodashPullAllWith4x5; + (comparator: lodash.__, values: lodash.List): LodashPullAllWith4x6; + (comparator: lodash.Comparator2, values: lodash.List): lodash.List; + } + type LodashPullAllWith4x5 = (values: lodash.List) => lodash.List; + type LodashPullAllWith4x6 = (comparator: lodash.Comparator2) => lodash.List; + interface LodashPullAt { + (indexes: lodash.Many): LodashPullAt1x1; + (indexes: lodash.__, array: ReadonlyArray): LodashPullAt1x2; + (indexes: lodash.Many, array: ReadonlyArray): T[]; + (indexes: lodash.__, array: lodash.List): LodashPullAt2x2; + (indexes: lodash.Many, array: lodash.List): lodash.List; + } + interface LodashPullAt1x1 { + (array: ReadonlyArray): T[]; + (array: lodash.List): lodash.List; + } + type LodashPullAt1x2 = (indexes: lodash.Many) => T[]; + type LodashPullAt2x2 = (indexes: lodash.Many) => lodash.List; + interface LodashRandom { + (maxOrMin: number): LodashRandom1x1; + (max: lodash.__, floating: boolean): LodashRandom1x2; + (maxOrMin: number, floatingOrMax: boolean | number): number; + (min: lodash.__, max: number): LodashRandom2x2; + } + type LodashRandom1x1 = (floatingOrMax: boolean | number) => number; + type LodashRandom1x2 = (max: number) => number; + type LodashRandom2x2 = (min: number) => number; + interface LodashRange { + (start: number): LodashRange1x1; + (start: lodash.__, end: number): LodashRange1x2; + (start: number, end: number): number[]; + } + type LodashRange1x1 = (end: number) => number[]; + type LodashRange1x2 = (start: number) => number[]; + interface LodashRangeRight { + (start: number): LodashRangeRight1x1; + (start: lodash.__, end: number): LodashRangeRight1x2; + (start: number, end: number): number[]; + } + type LodashRangeRight1x1 = (end: number) => number[]; + type LodashRangeRight1x2 = (start: number) => number[]; + interface LodashRangeStep { + (start: number): LodashRangeStep1x1; + (start: lodash.__, end: number): LodashRangeStep1x2; + (start: number, end: number): LodashRangeStep1x3; + (start: lodash.__, end: lodash.__, step: number): LodashRangeStep1x4; + (start: number, end: lodash.__, step: number): LodashRangeStep1x5; + (start: lodash.__, end: number, step: number): LodashRangeStep1x6; + (start: number, end: number, step: number): number[]; + } + interface LodashRangeStep1x1 { + (end: number): LodashRangeStep1x3; + (end: lodash.__, step: number): LodashRangeStep1x5; + (end: number, step: number): number[]; + } + interface LodashRangeStep1x2 { + (start: number): LodashRangeStep1x3; + (start: lodash.__, step: number): LodashRangeStep1x6; + (start: number, step: number): number[]; + } + type LodashRangeStep1x3 = (step: number) => number[]; + interface LodashRangeStep1x4 { + (start: number): LodashRangeStep1x5; + (start: lodash.__, end: number): LodashRangeStep1x6; + (start: number, end: number): number[]; + } + type LodashRangeStep1x5 = (end: number) => number[]; + type LodashRangeStep1x6 = (start: number) => number[]; + interface LodashRangeStepRight { + (start: number): LodashRangeStepRight1x1; + (start: lodash.__, end: number): LodashRangeStepRight1x2; + (start: number, end: number): LodashRangeStepRight1x3; + (start: lodash.__, end: lodash.__, step: number): LodashRangeStepRight1x4; + (start: number, end: lodash.__, step: number): LodashRangeStepRight1x5; + (start: lodash.__, end: number, step: number): LodashRangeStepRight1x6; + (start: number, end: number, step: number): number[]; + } + interface LodashRangeStepRight1x1 { + (end: number): LodashRangeStepRight1x3; + (end: lodash.__, step: number): LodashRangeStepRight1x5; + (end: number, step: number): number[]; + } + interface LodashRangeStepRight1x2 { + (start: number): LodashRangeStepRight1x3; + (start: lodash.__, step: number): LodashRangeStepRight1x6; + (start: number, step: number): number[]; + } + type LodashRangeStepRight1x3 = (step: number) => number[]; + interface LodashRangeStepRight1x4 { + (start: number): LodashRangeStepRight1x5; + (start: lodash.__, end: number): LodashRangeStepRight1x6; + (start: number, end: number): number[]; + } + type LodashRangeStepRight1x5 = (end: number) => number[]; + type LodashRangeStepRight1x6 = (start: number) => number[]; + interface LodashRearg { + (indexes: lodash.Many): LodashRearg1x1; + (indexes: lodash.__, func: (...args: any[]) => any): LodashRearg1x2; + (indexes: lodash.Many, func: (...args: any[]) => any): (...args: any[]) => any; + } + type LodashRearg1x1 = (func: (...args: any[]) => any) => (...args: any[]) => any; + type LodashRearg1x2 = (indexes: lodash.Many) => (...args: any[]) => any; + interface LodashReduce { + (callback: lodash.MemoIteratorCapped): LodashReduce1x1; + (callback: lodash.__, accumulator: TResult): LodashReduce1x2; + (callback: lodash.MemoIteratorCapped, accumulator: TResult): LodashReduce1x3; + (callback: lodash.__, accumulator: lodash.__, collection: T[] | null | undefined): LodashReduce1x4; + (callback: lodash.MemoIteratorCapped, accumulator: lodash.__, collection: T[] | null | undefined): LodashReduce1x5; + (callback: lodash.__, accumulator: TResult, collection: T[] | null | undefined): LodashReduce1x6; + (callback: lodash.MemoIteratorCapped, accumulator: TResult, collection: T[] | lodash.List | null | undefined): TResult; + (callback: lodash.__, accumulator: lodash.__, collection: lodash.List | null | undefined): LodashReduce2x4; + (callback: lodash.MemoIteratorCapped, accumulator: lodash.__, collection: lodash.List | null | undefined): LodashReduce2x5; + (callback: lodash.__, accumulator: TResult, collection: lodash.List | null | undefined): LodashReduce2x6; + (callback: lodash.MemoIteratorCapped): LodashReduce3x1; + (callback: lodash.MemoIteratorCapped, accumulator: TResult): LodashReduce3x3; + (callback: lodash.__, accumulator: lodash.__, collection: T | null | undefined): LodashReduce3x4; + (callback: lodash.MemoIteratorCapped, accumulator: lodash.__, collection: T | null | undefined): LodashReduce3x5; + (callback: lodash.__, accumulator: TResult, collection: T | null | undefined): LodashReduce3x6; + (callback: lodash.MemoIteratorCapped, accumulator: TResult, collection: T | null | undefined): TResult; + } + interface LodashReduce1x1 { + (accumulator: TResult): LodashReduce1x3; + (accumulator: lodash.__, collection: T[] | null | undefined): LodashReduce1x5; + (accumulator: TResult, collection: T[] | lodash.List | null | undefined): TResult; + (accumulator: lodash.__, collection: lodash.List | null | undefined): LodashReduce2x5; + } + interface LodashReduce1x2 { + (callback: lodash.MemoIteratorCapped): LodashReduce1x3; + (callback: lodash.__, collection: T[] | null | undefined): LodashReduce1x6; + (callback: lodash.MemoIteratorCapped, collection: T[] | lodash.List | null | undefined): TResult; + (callback: lodash.__, collection: lodash.List | null | undefined): LodashReduce2x6; + (callback: lodash.MemoIteratorCapped): LodashReduce3x3; + (callback: lodash.__, collection: T | null | undefined): LodashReduce3x6; + (callback: lodash.MemoIteratorCapped, collection: T | null | undefined): TResult; + } + type LodashReduce1x3 = (collection: T[] | lodash.List | null | undefined) => TResult; + interface LodashReduce1x4 { + (callback: lodash.MemoIteratorCapped): LodashReduce1x5; + (callback: lodash.__, accumulator: TResult): LodashReduce1x6; + (callback: lodash.MemoIteratorCapped, accumulator: TResult): TResult; + } + type LodashReduce1x5 = (accumulator: TResult) => TResult; + type LodashReduce1x6 = (callback: lodash.MemoIteratorCapped) => TResult; + interface LodashReduce2x4 { + (callback: lodash.MemoIteratorCapped): LodashReduce2x5; + (callback: lodash.__, accumulator: TResult): LodashReduce2x6; + (callback: lodash.MemoIteratorCapped, accumulator: TResult): TResult; + } + type LodashReduce2x5 = (accumulator: TResult) => TResult; + type LodashReduce2x6 = (callback: lodash.MemoIteratorCapped) => TResult; + interface LodashReduce3x1 { + (accumulator: TResult): LodashReduce3x3; + (accumulator: lodash.__, collection: T | null | undefined): LodashReduce3x5; + (accumulator: TResult, collection: T | null | undefined): TResult; + } + type LodashReduce3x3 = (collection: T | null | undefined) => TResult; + interface LodashReduce3x4 { + (callback: lodash.MemoIteratorCapped): LodashReduce3x5; + (callback: lodash.__, accumulator: TResult): LodashReduce3x6; + (callback: lodash.MemoIteratorCapped, accumulator: TResult): TResult; + } + type LodashReduce3x5 = (accumulator: TResult) => TResult; + type LodashReduce3x6 = (callback: lodash.MemoIteratorCapped) => TResult; + interface LodashReduceRight { + (callback: lodash.MemoIteratorCappedRight): LodashReduceRight1x1; + (callback: lodash.__, accumulator: TResult): LodashReduceRight1x2; + (callback: lodash.MemoIteratorCappedRight, accumulator: TResult): LodashReduceRight1x3; + (callback: lodash.__, accumulator: lodash.__, collection: T[] | null | undefined): LodashReduceRight1x4; + (callback: lodash.MemoIteratorCappedRight, accumulator: lodash.__, collection: T[] | null | undefined): LodashReduceRight1x5; + (callback: lodash.__, accumulator: TResult, collection: T[] | null | undefined): LodashReduceRight1x6; + (callback: lodash.MemoIteratorCappedRight, accumulator: TResult, collection: T[] | lodash.List | null | undefined): TResult; + (callback: lodash.__, accumulator: lodash.__, collection: lodash.List | null | undefined): LodashReduceRight2x4; + (callback: lodash.MemoIteratorCappedRight, accumulator: lodash.__, collection: lodash.List | null | undefined): LodashReduceRight2x5; + (callback: lodash.__, accumulator: TResult, collection: lodash.List | null | undefined): LodashReduceRight2x6; + (callback: lodash.MemoIteratorCappedRight): LodashReduceRight3x1; + (callback: lodash.MemoIteratorCappedRight, accumulator: TResult): LodashReduceRight3x3; + (callback: lodash.__, accumulator: lodash.__, collection: T | null | undefined): LodashReduceRight3x4; + (callback: lodash.MemoIteratorCappedRight, accumulator: lodash.__, collection: T | null | undefined): LodashReduceRight3x5; + (callback: lodash.__, accumulator: TResult, collection: T | null | undefined): LodashReduceRight3x6; + (callback: lodash.MemoIteratorCappedRight, accumulator: TResult, collection: T | null | undefined): TResult; + } + interface LodashReduceRight1x1 { + (accumulator: TResult): LodashReduceRight1x3; + (accumulator: lodash.__, collection: T[] | null | undefined): LodashReduceRight1x5; + (accumulator: TResult, collection: T[] | lodash.List | null | undefined): TResult; + (accumulator: lodash.__, collection: lodash.List | null | undefined): LodashReduceRight2x5; + } + interface LodashReduceRight1x2 { + (callback: lodash.MemoIteratorCappedRight): LodashReduceRight1x3; + (callback: lodash.__, collection: T[] | null | undefined): LodashReduceRight1x6; + (callback: lodash.MemoIteratorCappedRight, collection: T[] | lodash.List | null | undefined): TResult; + (callback: lodash.__, collection: lodash.List | null | undefined): LodashReduceRight2x6; + (callback: lodash.MemoIteratorCappedRight): LodashReduceRight3x3; + (callback: lodash.__, collection: T | null | undefined): LodashReduceRight3x6; + (callback: lodash.MemoIteratorCappedRight, collection: T | null | undefined): TResult; + } + type LodashReduceRight1x3 = (collection: T[] | lodash.List | null | undefined) => TResult; + interface LodashReduceRight1x4 { + (callback: lodash.MemoIteratorCappedRight): LodashReduceRight1x5; + (callback: lodash.__, accumulator: TResult): LodashReduceRight1x6; + (callback: lodash.MemoIteratorCappedRight, accumulator: TResult): TResult; + } + type LodashReduceRight1x5 = (accumulator: TResult) => TResult; + type LodashReduceRight1x6 = (callback: lodash.MemoIteratorCappedRight) => TResult; + interface LodashReduceRight2x4 { + (callback: lodash.MemoIteratorCappedRight): LodashReduceRight2x5; + (callback: lodash.__, accumulator: TResult): LodashReduceRight2x6; + (callback: lodash.MemoIteratorCappedRight, accumulator: TResult): TResult; + } + type LodashReduceRight2x5 = (accumulator: TResult) => TResult; + type LodashReduceRight2x6 = (callback: lodash.MemoIteratorCappedRight) => TResult; + interface LodashReduceRight3x1 { + (accumulator: TResult): LodashReduceRight3x3; + (accumulator: lodash.__, collection: T | null | undefined): LodashReduceRight3x5; + (accumulator: TResult, collection: T | null | undefined): TResult; + } + type LodashReduceRight3x3 = (collection: T | null | undefined) => TResult; + interface LodashReduceRight3x4 { + (callback: lodash.MemoIteratorCappedRight): LodashReduceRight3x5; + (callback: lodash.__, accumulator: TResult): LodashReduceRight3x6; + (callback: lodash.MemoIteratorCappedRight, accumulator: TResult): TResult; + } + type LodashReduceRight3x5 = (accumulator: TResult) => TResult; + type LodashReduceRight3x6 = (callback: lodash.MemoIteratorCappedRight) => TResult; + interface LodashReject { + (predicate: (value: string) => boolean): LodashReject1x1; + (predicate: lodash.__, collection: string | null | undefined): LodashReject1x2; + (predicate: (value: string) => boolean, collection: string | null | undefined): string[]; + (predicate: lodash.ValueIterateeCustom): LodashReject2x1; + (predicate: lodash.__, collection: lodash.List | null | undefined): LodashReject2x2; + (predicate: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): T[]; + (predicate: lodash.__, collection: T | null | undefined): LodashReject3x2; + (predicate: lodash.ValueIterateeCustom, collection: T | null | undefined): Array; + } + type LodashReject1x1 = (collection: string | null | undefined) => string[]; + type LodashReject1x2 = (predicate: (value: string) => boolean) => string[]; + type LodashReject2x1 = (collection: lodash.List | object | null | undefined) => T[]; + type LodashReject2x2 = (predicate: lodash.ValueIterateeCustom) => T[]; + type LodashReject3x2 = (predicate: lodash.ValueIterateeCustom) => Array; + interface LodashRemove { + (predicate: lodash.ValueIteratee): LodashRemove1x1; + (predicate: lodash.__, array: lodash.List): LodashRemove1x2; + (predicate: lodash.ValueIteratee, array: lodash.List): T[]; + } + type LodashRemove1x1 = (array: lodash.List) => T[]; + type LodashRemove1x2 = (predicate: lodash.ValueIteratee) => T[]; + interface LodashRepeat { + (n: number): LodashRepeat1x1; + (n: lodash.__, string: string): LodashRepeat1x2; + (n: number, string: string): string; + } + type LodashRepeat1x1 = (string: string) => string; + type LodashRepeat1x2 = (n: number) => string; + interface LodashReplace { + (pattern: RegExp | string): LodashReplace1x1; + (pattern: lodash.__, replacement: lodash.ReplaceFunction | string): LodashReplace1x2; + (pattern: RegExp | string, replacement: lodash.ReplaceFunction | string): LodashReplace1x3; + (pattern: lodash.__, replacement: lodash.__, string: string): LodashReplace1x4; + (pattern: RegExp | string, replacement: lodash.__, string: string): LodashReplace1x5; + (pattern: lodash.__, replacement: lodash.ReplaceFunction | string, string: string): LodashReplace1x6; + (pattern: RegExp | string, replacement: lodash.ReplaceFunction | string, string: string): string; + } + interface LodashReplace1x1 { + (replacement: lodash.ReplaceFunction | string): LodashReplace1x3; + (replacement: lodash.__, string: string): LodashReplace1x5; + (replacement: lodash.ReplaceFunction | string, string: string): string; + } + interface LodashReplace1x2 { + (pattern: RegExp | string): LodashReplace1x3; + (pattern: lodash.__, string: string): LodashReplace1x6; + (pattern: RegExp | string, string: string): string; + } + type LodashReplace1x3 = (string: string) => string; + interface LodashReplace1x4 { + (pattern: RegExp | string): LodashReplace1x5; + (pattern: lodash.__, replacement: lodash.ReplaceFunction | string): LodashReplace1x6; + (pattern: RegExp | string, replacement: lodash.ReplaceFunction | string): string; + } + type LodashReplace1x5 = (replacement: lodash.ReplaceFunction | string) => string; + type LodashReplace1x6 = (pattern: RegExp | string) => string; + type LodashRest = (func: (...args: any[]) => any) => (...args: any[]) => any; + interface LodashRestFrom { + (start: number): LodashRestFrom1x1; + (start: lodash.__, func: (...args: any[]) => any): LodashRestFrom1x2; + (start: number, func: (...args: any[]) => any): (...args: any[]) => any; + } + type LodashRestFrom1x1 = (func: (...args: any[]) => any) => (...args: any[]) => any; + type LodashRestFrom1x2 = (start: number) => (...args: any[]) => any; + interface LodashResult { + (path: lodash.PropertyPath): LodashResult1x1; + (path: lodash.__, object: any): LodashResult1x2; + (path: lodash.PropertyPath, object: any): TResult; + } + type LodashResult1x1 = (object: any) => TResult; + type LodashResult1x2 = (path: lodash.PropertyPath) => TResult; + type LodashReverse = >(array: TList) => TList; + type LodashRound = (n: number) => number; + type LodashRunInContext = (context: object) => lodash.LoDashStatic; + interface LodashSample { + (collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): T | undefined; + (collection: T | null | undefined): T[keyof T] | undefined; + } + interface LodashSampleSize { + (n: number): LodashSampleSize1x1; + (n: lodash.__, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): LodashSampleSize1x2; + (n: number, collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): T[]; + (n: lodash.__, collection: T | null | undefined): LodashSampleSize2x2; + (n: number, collection: T | null | undefined): Array; + } + interface LodashSampleSize1x1 { + (collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): T[]; + (collection: T | null | undefined): Array; + } + type LodashSampleSize1x2 = (n: number) => T[]; + type LodashSampleSize2x2 = (n: number) => Array; + interface LodashSetWith { + (customizer: lodash.SetWithCustomizer): LodashSetWith1x1; + (customizer: lodash.__, path: lodash.PropertyPath): LodashSetWith1x2; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath): LodashSetWith1x3; + (customizer: lodash.__, path: lodash.__, value: any): LodashSetWith1x4; + (customizer: lodash.SetWithCustomizer, path: lodash.__, value: any): LodashSetWith1x5; + (customizer: lodash.__, path: lodash.PropertyPath, value: any): LodashSetWith1x6; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath, value: any): LodashSetWith1x7; + (customizer: lodash.__, path: lodash.__, value: lodash.__, object: T): LodashSetWith1x8; + (customizer: lodash.SetWithCustomizer, path: lodash.__, value: lodash.__, object: T): LodashSetWith1x9; + (customizer: lodash.__, path: lodash.PropertyPath, value: lodash.__, object: T): LodashSetWith1x10; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath, value: lodash.__, object: T): LodashSetWith1x11; + (customizer: lodash.__, path: lodash.__, value: any, object: T): LodashSetWith1x12; + (customizer: lodash.SetWithCustomizer, path: lodash.__, value: any, object: T): LodashSetWith1x13; + (customizer: lodash.__, path: lodash.PropertyPath, value: any, object: T): LodashSetWith1x14; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath, value: any, object: T): T; + } + interface LodashSetWith1x1 { + (path: lodash.PropertyPath): LodashSetWith1x3; + (path: lodash.__, value: any): LodashSetWith1x5; + (path: lodash.PropertyPath, value: any): LodashSetWith1x7; + (path: lodash.__, value: lodash.__, object: T): LodashSetWith1x9; + (path: lodash.PropertyPath, value: lodash.__, object: T): LodashSetWith1x11; + (path: lodash.__, value: any, object: T): LodashSetWith1x13; + (path: lodash.PropertyPath, value: any, object: T): T; + } + interface LodashSetWith1x2 { + (customizer: lodash.SetWithCustomizer): LodashSetWith1x3; + (customizer: lodash.__, value: any): LodashSetWith1x6; + (customizer: lodash.SetWithCustomizer, value: any): LodashSetWith1x7; + (customizer: lodash.__, value: lodash.__, object: T): LodashSetWith1x10; + (customizer: lodash.SetWithCustomizer, value: lodash.__, object: T): LodashSetWith1x11; + (customizer: lodash.__, value: any, object: T): LodashSetWith1x14; + (customizer: lodash.SetWithCustomizer, value: any, object: T): T; + } + interface LodashSetWith1x3 { + (value: any): LodashSetWith1x7; + (value: lodash.__, object: T): LodashSetWith1x11; + (value: any, object: T): T; + } + interface LodashSetWith1x4 { + (customizer: lodash.SetWithCustomizer): LodashSetWith1x5; + (customizer: lodash.__, path: lodash.PropertyPath): LodashSetWith1x6; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath): LodashSetWith1x7; + (customizer: lodash.__, path: lodash.__, object: T): LodashSetWith1x12; + (customizer: lodash.SetWithCustomizer, path: lodash.__, object: T): LodashSetWith1x13; + (customizer: lodash.__, path: lodash.PropertyPath, object: T): LodashSetWith1x14; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath, object: T): T; + } + interface LodashSetWith1x5 { + (path: lodash.PropertyPath): LodashSetWith1x7; + (path: lodash.__, object: T): LodashSetWith1x13; + (path: lodash.PropertyPath, object: T): T; + } + interface LodashSetWith1x6 { + (customizer: lodash.SetWithCustomizer): LodashSetWith1x7; + (customizer: lodash.__, object: T): LodashSetWith1x14; + (customizer: lodash.SetWithCustomizer, object: T): T; + } + type LodashSetWith1x7 = (object: T) => T; + interface LodashSetWith1x8 { + (customizer: lodash.SetWithCustomizer): LodashSetWith1x9; + (customizer: lodash.__, path: lodash.PropertyPath): LodashSetWith1x10; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath): LodashSetWith1x11; + (customizer: lodash.__, path: lodash.__, value: any): LodashSetWith1x12; + (customizer: lodash.SetWithCustomizer, path: lodash.__, value: any): LodashSetWith1x13; + (customizer: lodash.__, path: lodash.PropertyPath, value: any): LodashSetWith1x14; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath, value: any): T; + } + interface LodashSetWith1x9 { + (path: lodash.PropertyPath): LodashSetWith1x11; + (path: lodash.__, value: any): LodashSetWith1x13; + (path: lodash.PropertyPath, value: any): T; + } + interface LodashSetWith1x10 { + (customizer: lodash.SetWithCustomizer): LodashSetWith1x11; + (customizer: lodash.__, value: any): LodashSetWith1x14; + (customizer: lodash.SetWithCustomizer, value: any): T; + } + type LodashSetWith1x11 = (value: any) => T; + interface LodashSetWith1x12 { + (customizer: lodash.SetWithCustomizer): LodashSetWith1x13; + (customizer: lodash.__, path: lodash.PropertyPath): LodashSetWith1x14; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath): T; + } + type LodashSetWith1x13 = (path: lodash.PropertyPath) => T; + type LodashSetWith1x14 = (customizer: lodash.SetWithCustomizer) => T; + interface LodashShuffle { + (collection: lodash.List | null | undefined): T[]; + (collection: T | null | undefined): Array; + } + type LodashSize = (collection: object | string | null | undefined) => number; + interface LodashSlice { + (start: number): LodashSlice1x1; + (start: lodash.__, end: number): LodashSlice1x2; + (start: number, end: number): LodashSlice1x3; + (start: lodash.__, end: lodash.__, array: lodash.List | null | undefined): LodashSlice1x4; + (start: number, end: lodash.__, array: lodash.List | null | undefined): LodashSlice1x5; + (start: lodash.__, end: number, array: lodash.List | null | undefined): LodashSlice1x6; + (start: number, end: number, array: lodash.List | null | undefined): T[]; + } + interface LodashSlice1x1 { + (end: number): LodashSlice1x3; + (end: lodash.__, array: lodash.List | null | undefined): LodashSlice1x5; + (end: number, array: lodash.List | null | undefined): T[]; + } + interface LodashSlice1x2 { + (start: number): LodashSlice1x3; + (start: lodash.__, array: lodash.List | null | undefined): LodashSlice1x6; + (start: number, array: lodash.List | null | undefined): T[]; + } + type LodashSlice1x3 = (array: lodash.List | null | undefined) => T[]; + interface LodashSlice1x4 { + (start: number): LodashSlice1x5; + (start: lodash.__, end: number): LodashSlice1x6; + (start: number, end: number): T[]; + } + type LodashSlice1x5 = (end: number) => T[]; + type LodashSlice1x6 = (start: number) => T[]; + type LodashSnakeCase = (string: string) => string; + interface LodashSortBy { + (iteratees: lodash.Many>): LodashSortBy1x1; + (iteratees: lodash.__, collection: lodash.List | null | undefined): LodashSortBy1x2; + (iteratees: lodash.Many>, collection: lodash.List | null | undefined): T[]; + (iteratees: lodash.__, collection: T | null | undefined): LodashSortBy2x2; + (iteratees: lodash.Many>, collection: T | null | undefined): Array; + } + type LodashSortBy1x1 = (collection: lodash.List | object | null | undefined) => T[]; + type LodashSortBy1x2 = (iteratees: lodash.Many>) => T[]; + type LodashSortBy2x2 = (iteratees: lodash.Many>) => Array; + interface LodashSortedIndex { + (value: T): LodashSortedIndex1x1; + (value: lodash.__, array: lodash.List | null | undefined): LodashSortedIndex1x2; + (value: T, array: lodash.List | null | undefined): number; + } + type LodashSortedIndex1x1 = (array: lodash.List | null | undefined) => number; + type LodashSortedIndex1x2 = (value: T) => number; + interface LodashSortedIndexBy { + (iteratee: lodash.ValueIteratee): LodashSortedIndexBy1x1; + (iteratee: lodash.__, value: T): LodashSortedIndexBy1x2; + (iteratee: lodash.ValueIteratee, value: T): LodashSortedIndexBy1x3; + (iteratee: lodash.__, value: lodash.__, array: lodash.List | null | undefined): LodashSortedIndexBy1x4; + (iteratee: lodash.ValueIteratee, value: lodash.__, array: lodash.List | null | undefined): LodashSortedIndexBy1x5; + (iteratee: lodash.__, value: T, array: lodash.List | null | undefined): LodashSortedIndexBy1x6; + (iteratee: lodash.ValueIteratee, value: T, array: lodash.List | null | undefined): number; + } + interface LodashSortedIndexBy1x1 { + (value: T): LodashSortedIndexBy1x3; + (value: lodash.__, array: lodash.List | null | undefined): LodashSortedIndexBy1x5; + (value: T, array: lodash.List | null | undefined): number; + } + interface LodashSortedIndexBy1x2 { + (iteratee: lodash.ValueIteratee): LodashSortedIndexBy1x3; + (iteratee: lodash.__, array: lodash.List | null | undefined): LodashSortedIndexBy1x6; + (iteratee: lodash.ValueIteratee, array: lodash.List | null | undefined): number; + } + type LodashSortedIndexBy1x3 = (array: lodash.List | null | undefined) => number; + interface LodashSortedIndexBy1x4 { + (iteratee: lodash.ValueIteratee): LodashSortedIndexBy1x5; + (iteratee: lodash.__, value: T): LodashSortedIndexBy1x6; + (iteratee: lodash.ValueIteratee, value: T): number; + } + type LodashSortedIndexBy1x5 = (value: T) => number; + type LodashSortedIndexBy1x6 = (iteratee: lodash.ValueIteratee) => number; + interface LodashSortedIndexOf { + (value: T): LodashSortedIndexOf1x1; + (value: lodash.__, array: lodash.List | null | undefined): LodashSortedIndexOf1x2; + (value: T, array: lodash.List | null | undefined): number; + } + type LodashSortedIndexOf1x1 = (array: lodash.List | null | undefined) => number; + type LodashSortedIndexOf1x2 = (value: T) => number; + interface LodashSortedLastIndex { + (value: T): LodashSortedLastIndex1x1; + (value: lodash.__, array: lodash.List | null | undefined): LodashSortedLastIndex1x2; + (value: T, array: lodash.List | null | undefined): number; + } + type LodashSortedLastIndex1x1 = (array: lodash.List | null | undefined) => number; + type LodashSortedLastIndex1x2 = (value: T) => number; + interface LodashSortedLastIndexBy { + (iteratee: lodash.ValueIteratee): LodashSortedLastIndexBy1x1; + (iteratee: lodash.__, value: T): LodashSortedLastIndexBy1x2; + (iteratee: lodash.ValueIteratee, value: T): LodashSortedLastIndexBy1x3; + (iteratee: lodash.__, value: lodash.__, array: lodash.List | null | undefined): LodashSortedLastIndexBy1x4; + (iteratee: lodash.ValueIteratee, value: lodash.__, array: lodash.List | null | undefined): LodashSortedLastIndexBy1x5; + (iteratee: lodash.__, value: T, array: lodash.List | null | undefined): LodashSortedLastIndexBy1x6; + (iteratee: lodash.ValueIteratee, value: T, array: lodash.List | null | undefined): number; + } + interface LodashSortedLastIndexBy1x1 { + (value: T): LodashSortedLastIndexBy1x3; + (value: lodash.__, array: lodash.List | null | undefined): LodashSortedLastIndexBy1x5; + (value: T, array: lodash.List | null | undefined): number; + } + interface LodashSortedLastIndexBy1x2 { + (iteratee: lodash.ValueIteratee): LodashSortedLastIndexBy1x3; + (iteratee: lodash.__, array: lodash.List | null | undefined): LodashSortedLastIndexBy1x6; + (iteratee: lodash.ValueIteratee, array: lodash.List | null | undefined): number; + } + type LodashSortedLastIndexBy1x3 = (array: lodash.List | null | undefined) => number; + interface LodashSortedLastIndexBy1x4 { + (iteratee: lodash.ValueIteratee): LodashSortedLastIndexBy1x5; + (iteratee: lodash.__, value: T): LodashSortedLastIndexBy1x6; + (iteratee: lodash.ValueIteratee, value: T): number; + } + type LodashSortedLastIndexBy1x5 = (value: T) => number; + type LodashSortedLastIndexBy1x6 = (iteratee: lodash.ValueIteratee) => number; + interface LodashSortedLastIndexOf { + (value: T): LodashSortedLastIndexOf1x1; + (value: lodash.__, array: lodash.List | null | undefined): LodashSortedLastIndexOf1x2; + (value: T, array: lodash.List | null | undefined): number; + } + type LodashSortedLastIndexOf1x1 = (array: lodash.List | null | undefined) => number; + type LodashSortedLastIndexOf1x2 = (value: T) => number; + type LodashSortedUniq = (array: lodash.List | null | undefined) => T[]; + interface LodashSortedUniqBy { + (iteratee: (value: string) => lodash.NotVoid): LodashSortedUniqBy1x1; + (iteratee: lodash.__, array: string | null | undefined): LodashSortedUniqBy1x2; + (iteratee: (value: string) => lodash.NotVoid, array: string | null | undefined): string[]; + (iteratee: lodash.ValueIteratee): LodashSortedUniqBy2x1; + (iteratee: lodash.__, array: lodash.List | null | undefined): LodashSortedUniqBy2x2; + (iteratee: lodash.ValueIteratee, array: lodash.List | null | undefined): T[]; + } + type LodashSortedUniqBy1x1 = (array: string | null | undefined) => string[]; + type LodashSortedUniqBy1x2 = (iteratee: (value: string) => lodash.NotVoid) => string[]; + type LodashSortedUniqBy2x1 = (array: lodash.List | null | undefined) => T[]; + type LodashSortedUniqBy2x2 = (iteratee: lodash.ValueIteratee) => T[]; + interface LodashSplit { + (separator: RegExp|string): LodashSplit1x1; + (separator: lodash.__, string: string): LodashSplit1x2; + (separator: RegExp|string, string: string): string[]; + } + type LodashSplit1x1 = (string: string) => string[]; + type LodashSplit1x2 = (separator: RegExp|string) => string[]; + type LodashSpread = (func: (...args: any[]) => TResult) => (...args: any[]) => TResult; + interface LodashSpreadFrom { + (start: number): LodashSpreadFrom1x1; + (start: lodash.__, func: (...args: any[]) => TResult): LodashSpreadFrom1x2; + (start: number, func: (...args: any[]) => TResult): (...args: any[]) => TResult; + } + type LodashSpreadFrom1x1 = (func: (...args: any[]) => TResult) => (...args: any[]) => TResult; + type LodashSpreadFrom1x2 = (start: number) => (...args: any[]) => TResult; + type LodashStartCase = (string: string) => string; + interface LodashStartsWith { + (target: string): LodashStartsWith1x1; + (target: lodash.__, string: string): LodashStartsWith1x2; + (target: string, string: string): boolean; + } + type LodashStartsWith1x1 = (string: string) => boolean; + type LodashStartsWith1x2 = (target: string) => boolean; + type LodashStubArray = () => any[]; + type LodashStubObject = () => any; + type LodashStubString = () => string; + type LodashStubTrue = () => boolean; + interface LodashSubtract { + (minuend: number): LodashSubtract1x1; + (minuend: lodash.__, subtrahend: number): LodashSubtract1x2; + (minuend: number, subtrahend: number): number; + } + type LodashSubtract1x1 = (subtrahend: number) => number; + type LodashSubtract1x2 = (minuend: number) => number; + type LodashSum = (collection: lodash.List | null | undefined) => number; + interface LodashSumBy { + (iteratee: ((value: T) => number) | string): LodashSumBy1x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashSumBy1x2; + (iteratee: ((value: T) => number) | string, collection: lodash.List | null | undefined): number; + } + type LodashSumBy1x1 = (collection: lodash.List | null | undefined) => number; + type LodashSumBy1x2 = (iteratee: ((value: T) => number) | string) => number; + interface LodashXor { + (arrays2: lodash.List | null | undefined): LodashXor1x1; + (arrays2: lodash.__, arrays: lodash.List | null | undefined): LodashXor1x2; + (arrays2: lodash.List | null | undefined, arrays: lodash.List | null | undefined): T[]; + } + type LodashXor1x1 = (arrays: lodash.List | null | undefined) => T[]; + type LodashXor1x2 = (arrays2: lodash.List | null | undefined) => T[]; + interface LodashXorBy { + (iteratee: lodash.ValueIteratee): LodashXorBy1x1; + (iteratee: lodash.__, arrays: lodash.List | null | undefined): LodashXorBy1x2; + (iteratee: lodash.ValueIteratee, arrays: lodash.List | null | undefined): LodashXorBy1x3; + (iteratee: lodash.__, arrays: lodash.__, arrays2: lodash.List | null | undefined): LodashXorBy1x4; + (iteratee: lodash.ValueIteratee, arrays: lodash.__, arrays2: lodash.List | null | undefined): LodashXorBy1x5; + (iteratee: lodash.__, arrays: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): LodashXorBy1x6; + (iteratee: lodash.ValueIteratee, arrays: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): T[]; + } + interface LodashXorBy1x1 { + (arrays: lodash.List | null | undefined): LodashXorBy1x3; + (arrays: lodash.__, arrays2: lodash.List | null | undefined): LodashXorBy1x5; + (arrays: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): T[]; + } + interface LodashXorBy1x2 { + (iteratee: lodash.ValueIteratee): LodashXorBy1x3; + (iteratee: lodash.__, arrays2: lodash.List | null | undefined): LodashXorBy1x6; + (iteratee: lodash.ValueIteratee, arrays2: lodash.List | null | undefined): T[]; + } + type LodashXorBy1x3 = (arrays2: lodash.List | null | undefined) => T[]; + interface LodashXorBy1x4 { + (iteratee: lodash.ValueIteratee): LodashXorBy1x5; + (iteratee: lodash.__, arrays: lodash.List | null | undefined): LodashXorBy1x6; + (iteratee: lodash.ValueIteratee, arrays: lodash.List | null | undefined): T[]; + } + type LodashXorBy1x5 = (arrays: lodash.List | null | undefined) => T[]; + type LodashXorBy1x6 = (iteratee: lodash.ValueIteratee) => T[]; + interface LodashXorWith { + (comparator: lodash.Comparator): LodashXorWith1x1; + (comparator: lodash.__, arrays: lodash.List | null | undefined): LodashXorWith1x2; + (comparator: lodash.Comparator, arrays: lodash.List | null | undefined): LodashXorWith1x3; + (comparator: lodash.__, arrays: lodash.__, arrays2: lodash.List | null | undefined): LodashXorWith1x4; + (comparator: lodash.Comparator, arrays: lodash.__, arrays2: lodash.List | null | undefined): LodashXorWith1x5; + (comparator: lodash.__, arrays: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): LodashXorWith1x6; + (comparator: lodash.Comparator, arrays: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): T[]; + } + interface LodashXorWith1x1 { + (arrays: lodash.List | null | undefined): LodashXorWith1x3; + (arrays: lodash.__, arrays2: lodash.List | null | undefined): LodashXorWith1x5; + (arrays: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): T[]; + } + interface LodashXorWith1x2 { + (comparator: lodash.Comparator): LodashXorWith1x3; + (comparator: lodash.__, arrays2: lodash.List | null | undefined): LodashXorWith1x6; + (comparator: lodash.Comparator, arrays2: lodash.List | null | undefined): T[]; + } + type LodashXorWith1x3 = (arrays2: lodash.List | null | undefined) => T[]; + interface LodashXorWith1x4 { + (comparator: lodash.Comparator): LodashXorWith1x5; + (comparator: lodash.__, arrays: lodash.List | null | undefined): LodashXorWith1x6; + (comparator: lodash.Comparator, arrays: lodash.List | null | undefined): T[]; + } + type LodashXorWith1x5 = (arrays: lodash.List | null | undefined) => T[]; + type LodashXorWith1x6 = (comparator: lodash.Comparator) => T[]; + type LodashTail = (array: lodash.List | null | undefined) => T[]; + interface LodashTake { + (n: number): LodashTake1x1; + (n: lodash.__, array: lodash.List | null | undefined): LodashTake1x2; + (n: number, array: lodash.List | null | undefined): T[]; + } + type LodashTake1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashTake1x2 = (n: number) => T[]; + interface LodashTakeRight { + (n: number): LodashTakeRight1x1; + (n: lodash.__, array: lodash.List | null | undefined): LodashTakeRight1x2; + (n: number, array: lodash.List | null | undefined): T[]; + } + type LodashTakeRight1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashTakeRight1x2 = (n: number) => T[]; + interface LodashTakeRightWhile { + (predicate: lodash.ValueIteratee): LodashTakeRightWhile1x1; + (predicate: lodash.__, array: lodash.List | null | undefined): LodashTakeRightWhile1x2; + (predicate: lodash.ValueIteratee, array: lodash.List | null | undefined): T[]; + } + type LodashTakeRightWhile1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashTakeRightWhile1x2 = (predicate: lodash.ValueIteratee) => T[]; + interface LodashTakeWhile { + (predicate: lodash.ValueIteratee): LodashTakeWhile1x1; + (predicate: lodash.__, array: lodash.List | null | undefined): LodashTakeWhile1x2; + (predicate: lodash.ValueIteratee, array: lodash.List | null | undefined): T[]; + } + type LodashTakeWhile1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashTakeWhile1x2 = (predicate: lodash.ValueIteratee) => T[]; + interface LodashTap { + (interceptor: (value: T) => void): LodashTap1x1; + (interceptor: lodash.__, value: T): LodashTap1x2; + (interceptor: (value: T) => void, value: T): T; + } + type LodashTap1x1 = (value: T) => T; + type LodashTap1x2 = (interceptor: (value: T) => void) => T; + type LodashTemplate = (string: string) => lodash.TemplateExecutor; + interface LodashThrottle { + (wait: number): LodashThrottle1x1; + any>(wait: lodash.__, func: T): LodashThrottle1x2; + any>(wait: number, func: T): T & lodash.Cancelable; + } + type LodashThrottle1x1 = any>(func: T) => T & lodash.Cancelable; + type LodashThrottle1x2 = (wait: number) => T & lodash.Cancelable; + interface LodashThru { + (interceptor: (value: T) => TResult): LodashThru1x1; + (interceptor: lodash.__, value: T): LodashThru1x2; + (interceptor: (value: T) => TResult, value: T): TResult; + } + type LodashThru1x1 = (value: T) => TResult; + type LodashThru1x2 = (interceptor: (value: T) => TResult) => TResult; + interface LodashTimes { + (iteratee: (num: number) => TResult): LodashTimes1x1; + (iteratee: lodash.__, n: number): LodashTimes1x2; + (iteratee: (num: number) => TResult, n: number): TResult[]; + } + type LodashTimes1x1 = (n: number) => TResult[]; + type LodashTimes1x2 = (iteratee: (num: number) => TResult) => TResult[]; + interface LodashToArray { + (value: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined): T[]; + (value: T): Array; + (): any[]; + } + type LodashToFinite = (value: any) => number; + type LodashToInteger = (value: any) => number; + type LodashToLength = (value: any) => number; + type LodashToLower = (string: string) => string; + type LodashToNumber = (value: any) => number; + type LodashToPath = (value: any) => string[]; + type LodashToPlainObject = (value: any) => any; + type LodashToSafeInteger = (value: any) => number; + type LodashToString = (value: any) => string; + type LodashToUpper = (string: string) => string; + interface LodashTransform { + (iteratee: lodash.MemoVoidIteratorCapped): LodashTransform1x1; + (iteratee: lodash.__, accumulator: ReadonlyArray): LodashTransform1x2; + (iteratee: lodash.MemoVoidIteratorCapped, accumulator: ReadonlyArray): LodashTransform1x3; + (iteratee: lodash.__, accumulator: lodash.__, object: ReadonlyArray): LodashTransform1x4; + (iteratee: lodash.MemoVoidIteratorCapped, accumulator: lodash.__, object: ReadonlyArray): LodashTransform1x5; + (iteratee: lodash.__, accumulator: ReadonlyArray, object: ReadonlyArray): LodashTransform1x6; + (iteratee: lodash.MemoVoidIteratorCapped, accumulator: ReadonlyArray, object: ReadonlyArray | lodash.Dictionary): TResult[]; + (iteratee: lodash.MemoVoidIteratorCapped>): LodashTransform2x1; + (iteratee: lodash.__, accumulator: lodash.Dictionary): LodashTransform2x2; + (iteratee: lodash.MemoVoidIteratorCapped>, accumulator: lodash.Dictionary): LodashTransform2x3; + (iteratee: lodash.MemoVoidIteratorCapped>, accumulator: lodash.__, object: ReadonlyArray): LodashTransform2x5; + (iteratee: lodash.__, accumulator: lodash.Dictionary, object: ReadonlyArray): LodashTransform2x6; + (iteratee: lodash.MemoVoidIteratorCapped>, accumulator: lodash.Dictionary, object: ReadonlyArray | lodash.Dictionary): lodash.Dictionary; + (iteratee: lodash.__, accumulator: lodash.__, object: lodash.Dictionary): LodashTransform3x4; + (iteratee: lodash.MemoVoidIteratorCapped>, accumulator: lodash.__, object: lodash.Dictionary): LodashTransform3x5; + (iteratee: lodash.__, accumulator: lodash.Dictionary, object: lodash.Dictionary): LodashTransform3x6; + (iteratee: lodash.MemoVoidIteratorCapped, accumulator: lodash.__, object: lodash.Dictionary): LodashTransform4x5; + (iteratee: lodash.__, accumulator: ReadonlyArray, object: lodash.Dictionary): LodashTransform4x6; + } + interface LodashTransform1x1 { + (accumulator: ReadonlyArray): LodashTransform1x3; + (accumulator: lodash.__, object: ReadonlyArray): LodashTransform1x5; + (accumulator: ReadonlyArray, object: ReadonlyArray | lodash.Dictionary): TResult[]; + (accumulator: lodash.__, object: lodash.Dictionary): LodashTransform4x5; + } + interface LodashTransform1x2 { + (iteratee: lodash.MemoVoidIteratorCapped): LodashTransform1x3; + (iteratee: lodash.__, object: ReadonlyArray): LodashTransform1x6; + (iteratee: lodash.MemoVoidIteratorCapped, object: ReadonlyArray | lodash.Dictionary): TResult[]; + (iteratee: lodash.__, object: lodash.Dictionary): LodashTransform4x6; + } + type LodashTransform1x3 = (object: ReadonlyArray | lodash.Dictionary) => TResult[]; + interface LodashTransform1x4 { + (iteratee: lodash.MemoVoidIteratorCapped): LodashTransform1x5; + (iteratee: lodash.__, accumulator: ReadonlyArray): LodashTransform1x6; + (iteratee: lodash.MemoVoidIteratorCapped, accumulator: ReadonlyArray): TResult[]; + (iteratee: lodash.MemoVoidIteratorCapped>): LodashTransform2x5; + (iteratee: lodash.__, accumulator: lodash.Dictionary): LodashTransform2x6; + (iteratee: lodash.MemoVoidIteratorCapped>, accumulator: lodash.Dictionary): lodash.Dictionary; + } + type LodashTransform1x5 = (accumulator: ReadonlyArray) => TResult[]; + type LodashTransform1x6 = (iteratee: lodash.MemoVoidIteratorCapped) => TResult[]; + interface LodashTransform2x1 { + (accumulator: lodash.Dictionary): LodashTransform2x3; + (accumulator: lodash.__, object: ReadonlyArray): LodashTransform2x5; + (accumulator: lodash.Dictionary, object: ReadonlyArray | lodash.Dictionary): lodash.Dictionary; + (accumulator: lodash.__, object: lodash.Dictionary): LodashTransform3x5; + } + interface LodashTransform2x2 { + (iteratee: lodash.MemoVoidIteratorCapped>): LodashTransform2x3; + (iteratee: lodash.__, object: ReadonlyArray): LodashTransform2x6; + (iteratee: lodash.MemoVoidIteratorCapped>, object: ReadonlyArray | lodash.Dictionary): lodash.Dictionary; + (iteratee: lodash.__, object: lodash.Dictionary): LodashTransform3x6; + } + type LodashTransform2x3 = (object: ReadonlyArray | lodash.Dictionary) => lodash.Dictionary; + type LodashTransform2x5 = (accumulator: lodash.Dictionary) => lodash.Dictionary; + type LodashTransform2x6 = (iteratee: lodash.MemoVoidIteratorCapped>) => lodash.Dictionary; + interface LodashTransform3x4 { + (iteratee: lodash.MemoVoidIteratorCapped>): LodashTransform3x5; + (iteratee: lodash.__, accumulator: lodash.Dictionary): LodashTransform3x6; + (iteratee: lodash.MemoVoidIteratorCapped>, accumulator: lodash.Dictionary): lodash.Dictionary; + (iteratee: lodash.MemoVoidIteratorCapped): LodashTransform4x5; + (iteratee: lodash.__, accumulator: ReadonlyArray): LodashTransform4x6; + (iteratee: lodash.MemoVoidIteratorCapped, accumulator: ReadonlyArray): TResult[]; + } + type LodashTransform3x5 = (accumulator: lodash.Dictionary) => lodash.Dictionary; + type LodashTransform3x6 = (iteratee: lodash.MemoVoidIteratorCapped>) => lodash.Dictionary; + type LodashTransform4x5 = (accumulator: ReadonlyArray) => TResult[]; + type LodashTransform4x6 = (iteratee: lodash.MemoVoidIteratorCapped) => TResult[]; + type LodashTrim = (string: string) => string; + interface LodashTrimChars { + (chars: string): LodashTrimChars1x1; + (chars: lodash.__, string: string): LodashTrimChars1x2; + (chars: string, string: string): string; + } + type LodashTrimChars1x1 = (string: string) => string; + type LodashTrimChars1x2 = (chars: string) => string; + interface LodashTrimCharsEnd { + (chars: string): LodashTrimCharsEnd1x1; + (chars: lodash.__, string: string): LodashTrimCharsEnd1x2; + (chars: string, string: string): string; + } + type LodashTrimCharsEnd1x1 = (string: string) => string; + type LodashTrimCharsEnd1x2 = (chars: string) => string; + interface LodashTrimCharsStart { + (chars: string): LodashTrimCharsStart1x1; + (chars: lodash.__, string: string): LodashTrimCharsStart1x2; + (chars: string, string: string): string; + } + type LodashTrimCharsStart1x1 = (string: string) => string; + type LodashTrimCharsStart1x2 = (chars: string) => string; + type LodashTrimEnd = (string: string) => string; + type LodashTrimStart = (string: string) => string; + interface LodashTruncate { + (options: lodash.TruncateOptions): LodashTruncate1x1; + (options: lodash.__, string: string): LodashTruncate1x2; + (options: lodash.TruncateOptions, string: string): string; + } + type LodashTruncate1x1 = (string: string) => string; + type LodashTruncate1x2 = (options: lodash.TruncateOptions) => string; + type LodashUnapply = (func: (...args: any[]) => any) => (...args: any[]) => any; + type LodashUnary = (func: (arg1: T, ...args: any[]) => TResult) => (arg1: T) => TResult; + type LodashUnescape = (string: string) => string; + interface LodashUnion { + (arrays2: lodash.List | null | undefined): LodashUnion1x1; + (arrays2: lodash.__, arrays: lodash.List | null | undefined): LodashUnion1x2; + (arrays2: lodash.List | null | undefined, arrays: lodash.List | null | undefined): T[]; + } + type LodashUnion1x1 = (arrays: lodash.List | null | undefined) => T[]; + type LodashUnion1x2 = (arrays2: lodash.List | null | undefined) => T[]; + interface LodashUnionBy { + (iteratee: lodash.ValueIteratee): LodashUnionBy1x1; + (iteratee: lodash.__, arrays1: lodash.List | null | undefined): LodashUnionBy1x2; + (iteratee: lodash.ValueIteratee, arrays1: lodash.List | null | undefined): LodashUnionBy1x3; + (iteratee: lodash.__, arrays1: lodash.__, arrays2: lodash.List | null | undefined): LodashUnionBy1x4; + (iteratee: lodash.ValueIteratee, arrays1: lodash.__, arrays2: lodash.List | null | undefined): LodashUnionBy1x5; + (iteratee: lodash.__, arrays1: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): LodashUnionBy1x6; + (iteratee: lodash.ValueIteratee, arrays1: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): T[]; + } + interface LodashUnionBy1x1 { + (arrays1: lodash.List | null | undefined): LodashUnionBy1x3; + (arrays1: lodash.__, arrays2: lodash.List | null | undefined): LodashUnionBy1x5; + (arrays1: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): T[]; + } + interface LodashUnionBy1x2 { + (iteratee: lodash.ValueIteratee): LodashUnionBy1x3; + (iteratee: lodash.__, arrays2: lodash.List | null | undefined): LodashUnionBy1x6; + (iteratee: lodash.ValueIteratee, arrays2: lodash.List | null | undefined): T[]; + } + type LodashUnionBy1x3 = (arrays2: lodash.List | null | undefined) => T[]; + interface LodashUnionBy1x4 { + (iteratee: lodash.ValueIteratee): LodashUnionBy1x5; + (iteratee: lodash.__, arrays1: lodash.List | null | undefined): LodashUnionBy1x6; + (iteratee: lodash.ValueIteratee, arrays1: lodash.List | null | undefined): T[]; + } + type LodashUnionBy1x5 = (arrays1: lodash.List | null | undefined) => T[]; + type LodashUnionBy1x6 = (iteratee: lodash.ValueIteratee) => T[]; + interface LodashUnionWith { + (comparator: lodash.Comparator): LodashUnionWith1x1; + (comparator: lodash.__, arrays: lodash.List | null | undefined): LodashUnionWith1x2; + (comparator: lodash.Comparator, arrays: lodash.List | null | undefined): LodashUnionWith1x3; + (comparator: lodash.__, arrays: lodash.__, arrays2: lodash.List | null | undefined): LodashUnionWith1x4; + (comparator: lodash.Comparator, arrays: lodash.__, arrays2: lodash.List | null | undefined): LodashUnionWith1x5; + (comparator: lodash.__, arrays: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): LodashUnionWith1x6; + (comparator: lodash.Comparator, arrays: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): T[]; + } + interface LodashUnionWith1x1 { + (arrays: lodash.List | null | undefined): LodashUnionWith1x3; + (arrays: lodash.__, arrays2: lodash.List | null | undefined): LodashUnionWith1x5; + (arrays: lodash.List | null | undefined, arrays2: lodash.List | null | undefined): T[]; + } + interface LodashUnionWith1x2 { + (comparator: lodash.Comparator): LodashUnionWith1x3; + (comparator: lodash.__, arrays2: lodash.List | null | undefined): LodashUnionWith1x6; + (comparator: lodash.Comparator, arrays2: lodash.List | null | undefined): T[]; + } + type LodashUnionWith1x3 = (arrays2: lodash.List | null | undefined) => T[]; + interface LodashUnionWith1x4 { + (comparator: lodash.Comparator): LodashUnionWith1x5; + (comparator: lodash.__, arrays: lodash.List | null | undefined): LodashUnionWith1x6; + (comparator: lodash.Comparator, arrays: lodash.List | null | undefined): T[]; + } + type LodashUnionWith1x5 = (arrays: lodash.List | null | undefined) => T[]; + type LodashUnionWith1x6 = (comparator: lodash.Comparator) => T[]; + type LodashUniq = (array: lodash.List | null | undefined) => T[]; + interface LodashUniqBy { + (iteratee: (value: string) => lodash.NotVoid): LodashUniqBy1x1; + (iteratee: lodash.__, array: string | null | undefined): LodashUniqBy1x2; + (iteratee: (value: string) => lodash.NotVoid, array: string | null | undefined): string[]; + (iteratee: lodash.ValueIteratee): LodashUniqBy2x1; + (iteratee: lodash.__, array: lodash.List | null | undefined): LodashUniqBy2x2; + (iteratee: lodash.ValueIteratee, array: lodash.List | null | undefined): T[]; + } + type LodashUniqBy1x1 = (array: string | null | undefined) => string[]; + type LodashUniqBy1x2 = (iteratee: (value: string) => lodash.NotVoid) => string[]; + type LodashUniqBy2x1 = (array: lodash.List | null | undefined) => T[]; + type LodashUniqBy2x2 = (iteratee: lodash.ValueIteratee) => T[]; + type LodashUniqueId = (prefix: string) => string; + interface LodashUniqWith { + (comparator: lodash.Comparator): LodashUniqWith1x1; + (comparator: lodash.__, array: lodash.List | null | undefined): LodashUniqWith1x2; + (comparator: lodash.Comparator, array: lodash.List | null | undefined): T[]; + } + type LodashUniqWith1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashUniqWith1x2 = (comparator: lodash.Comparator) => T[]; + type LodashUnzip = (array: T[][] | lodash.List> | null | undefined) => T[][]; + interface LodashUnzipWith { + (iteratee: (...values: T[]) => TResult): LodashUnzipWith1x1; + (iteratee: lodash.__, array: lodash.List> | null | undefined): LodashUnzipWith1x2; + (iteratee: (...values: T[]) => TResult, array: lodash.List> | null | undefined): TResult[]; + } + type LodashUnzipWith1x1 = (array: lodash.List> | null | undefined) => TResult[]; + type LodashUnzipWith1x2 = (iteratee: (...values: T[]) => TResult) => TResult[]; + interface LodashUpdate { + (path: lodash.PropertyPath): LodashUpdate1x1; + (path: lodash.__, updater: (value: any) => any): LodashUpdate1x2; + (path: lodash.PropertyPath, updater: (value: any) => any): LodashUpdate1x3; + (path: lodash.__, updater: lodash.__, object: object): LodashUpdate1x4; + (path: lodash.PropertyPath, updater: lodash.__, object: object): LodashUpdate1x5; + (path: lodash.__, updater: (value: any) => any, object: object): LodashUpdate1x6; + (path: lodash.PropertyPath, updater: (value: any) => any, object: object): any; + } + interface LodashUpdate1x1 { + (updater: (value: any) => any): LodashUpdate1x3; + (updater: lodash.__, object: object): LodashUpdate1x5; + (updater: (value: any) => any, object: object): any; + } + interface LodashUpdate1x2 { + (path: lodash.PropertyPath): LodashUpdate1x3; + (path: lodash.__, object: object): LodashUpdate1x6; + (path: lodash.PropertyPath, object: object): any; + } + type LodashUpdate1x3 = (object: object) => any; + interface LodashUpdate1x4 { + (path: lodash.PropertyPath): LodashUpdate1x5; + (path: lodash.__, updater: (value: any) => any): LodashUpdate1x6; + (path: lodash.PropertyPath, updater: (value: any) => any): any; + } + type LodashUpdate1x5 = (updater: (value: any) => any) => any; + type LodashUpdate1x6 = (path: lodash.PropertyPath) => any; + interface LodashUpdateWith { + (customizer: lodash.SetWithCustomizer): LodashUpdateWith1x1; + (customizer: lodash.__, path: lodash.PropertyPath): LodashUpdateWith1x2; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath): LodashUpdateWith1x3; + (customizer: lodash.__, path: lodash.__, updater: (oldValue: any) => any): LodashUpdateWith1x4; + (customizer: lodash.SetWithCustomizer, path: lodash.__, updater: (oldValue: any) => any): LodashUpdateWith1x5; + (customizer: lodash.__, path: lodash.PropertyPath, updater: (oldValue: any) => any): LodashUpdateWith1x6; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath, updater: (oldValue: any) => any): LodashUpdateWith1x7; + (customizer: lodash.__, path: lodash.__, updater: lodash.__, object: T): LodashUpdateWith1x8; + (customizer: lodash.SetWithCustomizer, path: lodash.__, updater: lodash.__, object: T): LodashUpdateWith1x9; + (customizer: lodash.__, path: lodash.PropertyPath, updater: lodash.__, object: T): LodashUpdateWith1x10; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath, updater: lodash.__, object: T): LodashUpdateWith1x11; + (customizer: lodash.__, path: lodash.__, updater: (oldValue: any) => any, object: T): LodashUpdateWith1x12; + (customizer: lodash.SetWithCustomizer, path: lodash.__, updater: (oldValue: any) => any, object: T): LodashUpdateWith1x13; + (customizer: lodash.__, path: lodash.PropertyPath, updater: (oldValue: any) => any, object: T): LodashUpdateWith1x14; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath, updater: (oldValue: any) => any, object: T): T; + } + interface LodashUpdateWith1x1 { + (path: lodash.PropertyPath): LodashUpdateWith1x3; + (path: lodash.__, updater: (oldValue: any) => any): LodashUpdateWith1x5; + (path: lodash.PropertyPath, updater: (oldValue: any) => any): LodashUpdateWith1x7; + (path: lodash.__, updater: lodash.__, object: T): LodashUpdateWith1x9; + (path: lodash.PropertyPath, updater: lodash.__, object: T): LodashUpdateWith1x11; + (path: lodash.__, updater: (oldValue: any) => any, object: T): LodashUpdateWith1x13; + (path: lodash.PropertyPath, updater: (oldValue: any) => any, object: T): T; + } + interface LodashUpdateWith1x2 { + (customizer: lodash.SetWithCustomizer): LodashUpdateWith1x3; + (customizer: lodash.__, updater: (oldValue: any) => any): LodashUpdateWith1x6; + (customizer: lodash.SetWithCustomizer, updater: (oldValue: any) => any): LodashUpdateWith1x7; + (customizer: lodash.__, updater: lodash.__, object: T): LodashUpdateWith1x10; + (customizer: lodash.SetWithCustomizer, updater: lodash.__, object: T): LodashUpdateWith1x11; + (customizer: lodash.__, updater: (oldValue: any) => any, object: T): LodashUpdateWith1x14; + (customizer: lodash.SetWithCustomizer, updater: (oldValue: any) => any, object: T): T; + } + interface LodashUpdateWith1x3 { + (updater: (oldValue: any) => any): LodashUpdateWith1x7; + (updater: lodash.__, object: T): LodashUpdateWith1x11; + (updater: (oldValue: any) => any, object: T): T; + } + interface LodashUpdateWith1x4 { + (customizer: lodash.SetWithCustomizer): LodashUpdateWith1x5; + (customizer: lodash.__, path: lodash.PropertyPath): LodashUpdateWith1x6; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath): LodashUpdateWith1x7; + (customizer: lodash.__, path: lodash.__, object: T): LodashUpdateWith1x12; + (customizer: lodash.SetWithCustomizer, path: lodash.__, object: T): LodashUpdateWith1x13; + (customizer: lodash.__, path: lodash.PropertyPath, object: T): LodashUpdateWith1x14; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath, object: T): T; + } + interface LodashUpdateWith1x5 { + (path: lodash.PropertyPath): LodashUpdateWith1x7; + (path: lodash.__, object: T): LodashUpdateWith1x13; + (path: lodash.PropertyPath, object: T): T; + } + interface LodashUpdateWith1x6 { + (customizer: lodash.SetWithCustomizer): LodashUpdateWith1x7; + (customizer: lodash.__, object: T): LodashUpdateWith1x14; + (customizer: lodash.SetWithCustomizer, object: T): T; + } + type LodashUpdateWith1x7 = (object: T) => T; + interface LodashUpdateWith1x8 { + (customizer: lodash.SetWithCustomizer): LodashUpdateWith1x9; + (customizer: lodash.__, path: lodash.PropertyPath): LodashUpdateWith1x10; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath): LodashUpdateWith1x11; + (customizer: lodash.__, path: lodash.__, updater: (oldValue: any) => any): LodashUpdateWith1x12; + (customizer: lodash.SetWithCustomizer, path: lodash.__, updater: (oldValue: any) => any): LodashUpdateWith1x13; + (customizer: lodash.__, path: lodash.PropertyPath, updater: (oldValue: any) => any): LodashUpdateWith1x14; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath, updater: (oldValue: any) => any): T; + } + interface LodashUpdateWith1x9 { + (path: lodash.PropertyPath): LodashUpdateWith1x11; + (path: lodash.__, updater: (oldValue: any) => any): LodashUpdateWith1x13; + (path: lodash.PropertyPath, updater: (oldValue: any) => any): T; + } + interface LodashUpdateWith1x10 { + (customizer: lodash.SetWithCustomizer): LodashUpdateWith1x11; + (customizer: lodash.__, updater: (oldValue: any) => any): LodashUpdateWith1x14; + (customizer: lodash.SetWithCustomizer, updater: (oldValue: any) => any): T; + } + type LodashUpdateWith1x11 = (updater: (oldValue: any) => any) => T; + interface LodashUpdateWith1x12 { + (customizer: lodash.SetWithCustomizer): LodashUpdateWith1x13; + (customizer: lodash.__, path: lodash.PropertyPath): LodashUpdateWith1x14; + (customizer: lodash.SetWithCustomizer, path: lodash.PropertyPath): T; + } + type LodashUpdateWith1x13 = (path: lodash.PropertyPath) => T; + type LodashUpdateWith1x14 = (customizer: lodash.SetWithCustomizer) => T; + type LodashUpperCase = (string: string) => string; + type LodashUpperFirst = (string: string) => string; + interface LodashValues { + (object: lodash.Dictionary | lodash.NumericDictionary | lodash.List | null | undefined): T[]; + (object: T | null | undefined): Array; + (object: any): any[]; + } + interface LodashValuesIn { + (object: lodash.Dictionary|lodash.NumericDictionary|lodash.List | null | undefined): T[]; + (object: T | null | undefined): Array; + } + interface LodashWithout { + (values: ReadonlyArray): LodashWithout1x1; + (values: lodash.__, array: lodash.List | null | undefined): LodashWithout1x2; + (values: ReadonlyArray, array: lodash.List | null | undefined): T[]; + } + type LodashWithout1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashWithout1x2 = (values: ReadonlyArray) => T[]; + type LodashWords = (string: string) => string[]; + interface LodashWrap { + (wrapper: (value: T, ...args: TArgs[]) => TResult): LodashWrap1x1; + (wrapper: lodash.__, value: T): LodashWrap1x2; + (wrapper: (value: T, ...args: TArgs[]) => TResult, value: T): (...args: TArgs[]) => TResult; + (wrapper: (value: T, ...args: any[]) => TResult): LodashWrap2x1; + (wrapper: (value: T, ...args: any[]) => TResult, value: T): (...args: any[]) => TResult; + } + type LodashWrap1x1 = (value: T) => (...args: TArgs[]) => TResult; + interface LodashWrap1x2 { + (wrapper: (value: T, ...args: TArgs[]) => TResult): (...args: TArgs[]) => TResult; + (wrapper: (value: T, ...args: any[]) => TResult): (...args: any[]) => TResult; + } + type LodashWrap2x1 = (value: T) => (...args: any[]) => TResult; + interface LodashZip { + (arrays1: lodash.List): LodashZip1x1; + (arrays1: lodash.__, arrays2: lodash.List): LodashZip1x2; + (arrays1: lodash.List, arrays2: lodash.List): Array<[T1 | undefined, T2 | undefined]>; + } + type LodashZip1x1 = (arrays2: lodash.List) => Array<[T1 | undefined, T2 | undefined]>; + type LodashZip1x2 = (arrays1: lodash.List) => Array<[T1 | undefined, T2 | undefined]>; + type LodashZipAll = (arrays: ReadonlyArray | null | undefined>) => Array>; + interface LodashZipObject { + (props: lodash.List): LodashZipObject1x1; + (props: lodash.__, values: lodash.List): LodashZipObject1x2; + (props: lodash.List, values: lodash.List): lodash.Dictionary; + } + type LodashZipObject1x1 = (values: lodash.List) => lodash.Dictionary; + type LodashZipObject1x2 = (props: lodash.List) => lodash.Dictionary; + interface LodashZipObjectDeep { + (paths: lodash.List): LodashZipObjectDeep1x1; + (paths: lodash.__, values: lodash.List): LodashZipObjectDeep1x2; + (paths: lodash.List, values: lodash.List): object; + } + type LodashZipObjectDeep1x1 = (values: lodash.List) => object; + type LodashZipObjectDeep1x2 = (paths: lodash.List) => object; + interface LodashZipWith { + (iteratee: (value1: T1, value2: T2) => TResult): LodashZipWith1x1; + (iteratee: lodash.__, arrays1: lodash.List): LodashZipWith1x2; + (iteratee: (value1: T1, value2: T2) => TResult, arrays1: lodash.List): LodashZipWith1x3; + (iteratee: lodash.__, arrays1: lodash.__, arrays2: lodash.List): LodashZipWith1x4; + (iteratee: (value1: T1, value2: T2) => TResult, arrays1: lodash.__, arrays2: lodash.List): LodashZipWith1x5; + (iteratee: lodash.__, arrays1: lodash.List, arrays2: lodash.List): LodashZipWith1x6; + (iteratee: (value1: T1, value2: T2) => TResult, arrays1: lodash.List, arrays2: lodash.List): TResult[]; + } + interface LodashZipWith1x1 { + (arrays1: lodash.List): LodashZipWith1x3; + (arrays1: lodash.__, arrays2: lodash.List): LodashZipWith1x5; + (arrays1: lodash.List, arrays2: lodash.List): TResult[]; + } + interface LodashZipWith1x2 { + (iteratee: (value1: T1, value2: T2) => TResult): LodashZipWith1x3; + (iteratee: lodash.__, arrays2: lodash.List): LodashZipWith1x6; + (iteratee: (value1: T1, value2: T2) => TResult, arrays2: lodash.List): TResult[]; + } + type LodashZipWith1x3 = (arrays2: lodash.List) => TResult[]; + interface LodashZipWith1x4 { + (iteratee: (value1: T1, value2: T2) => TResult): LodashZipWith1x5; + (iteratee: lodash.__, arrays1: lodash.List): LodashZipWith1x6; + (iteratee: (value1: T1, value2: T2) => TResult, arrays1: lodash.List): TResult[]; + } + type LodashZipWith1x5 = (arrays1: lodash.List) => TResult[]; + type LodashZipWith1x6 = (iteratee: (value1: T1, value2: T2) => TResult) => TResult[]; + interface LoDashFp { - add: typeof add; - after: typeof after; - all: typeof all; - allPass: typeof allPass; - always: typeof always; - any: typeof any; - anyPass: typeof anyPass; - apply: typeof apply; - ary: typeof ary; - assign: typeof assign; - assignAll: typeof assignAll; - assignAllWith: typeof assignAllWith; - assignIn: typeof assignIn; - assignInAll: typeof assignInAll; - assignInAllWith: typeof assignInAllWith; - assignInWith: typeof assignInWith; - assignWith: typeof assignWith; - assoc: typeof assoc; - assocPath: typeof assocPath; - at: typeof at; - attempt: typeof attempt; - before: typeof before; - bind: typeof bind; - bindAll: typeof bindAll; - bindKey: typeof bindKey; - camelCase: typeof camelCase; - capitalize: typeof capitalize; - castArray: typeof castArray; - ceil: typeof ceil; - chunk: typeof chunk; - clamp: typeof clamp; - clone: typeof clone; - cloneDeep: typeof cloneDeep; - cloneDeepWith: typeof cloneDeepWith; - cloneWith: typeof cloneWith; - compact: typeof compact; - complement: typeof complement; - compose: typeof compose; - concat: typeof concat; - cond: typeof cond; - conforms: typeof conforms; - conformsTo: typeof conformsTo; - constant: typeof constant; - contains: typeof contains; - countBy: typeof countBy; - create: typeof create; - curry: typeof curry; - curryN: typeof curryN; - curryRight: typeof curryRight; - curryRightN: typeof curryRightN; - debounce: typeof debounce; - deburr: typeof deburr; - defaults: typeof defaults; - defaultsAll: typeof defaultsAll; - defaultsDeep: typeof defaultsDeep; - defaultsDeepAll: typeof defaultsDeepAll; - defaultTo: typeof defaultTo; - defer: typeof defer; - delay: typeof delay; - difference: typeof difference; - differenceBy: typeof differenceBy; - differenceWith: typeof differenceWith; - dissoc: typeof dissoc; - dissocPath: typeof dissocPath; - divide: typeof divide; - drop: typeof drop; - dropLast: typeof dropLast; - dropLastWhile: typeof dropLastWhile; - dropRight: typeof dropRight; - dropRightWhile: typeof dropRightWhile; - dropWhile: typeof dropWhile; - each: typeof each; - eachRight: typeof eachRight; - endsWith: typeof endsWith; - entries: typeof entries; - entriesIn: typeof entriesIn; - eq: typeof eq; - equals: typeof equals; - escape: typeof escape; - escapeRegExp: typeof escapeRegExp; - every: typeof every; - extend: typeof extend; - extendAll: typeof extendAll; - extendAllWith: typeof extendAllWith; - extendWith: typeof extendWith; - F: typeof F; - fill: typeof fill; - filter: typeof filter; - find: typeof find; - findFrom: typeof findFrom; - findIndex: typeof findIndex; - findIndexFrom: typeof findIndexFrom; - findKey: typeof findKey; - findLast: typeof findLast; - findLastFrom: typeof findLastFrom; - findLastIndex: typeof findLastIndex; - findLastIndexFrom: typeof findLastIndexFrom; - findLastKey: typeof findLastKey; - first: typeof first; - flatMap: typeof flatMap; - flatMapDeep: typeof flatMapDeep; - flatMapDepth: typeof flatMapDepth; - flatten: typeof flatten; - flattenDeep: typeof flattenDeep; - flattenDepth: typeof flattenDepth; - flip: typeof flip; - floor: typeof floor; - flow: typeof flow; - flowRight: typeof flowRight; - forEach: typeof forEach; - forEachRight: typeof forEachRight; - forIn: typeof forIn; - forInRight: typeof forInRight; - forOwn: typeof forOwn; - forOwnRight: typeof forOwnRight; - fromPairs: typeof fromPairs; - functions: typeof functions; - functionsIn: typeof functionsIn; - get: typeof get; - getOr: typeof getOr; - groupBy: typeof groupBy; - gt: typeof gt; - gte: typeof gte; - has: typeof has; - hasIn: typeof hasIn; - head: typeof head; - identical: typeof identical; - identity: typeof identity; - includes: typeof includes; - includesFrom: typeof includesFrom; - indexBy: typeof indexBy; - indexOf: typeof indexOf; - indexOfFrom: typeof indexOfFrom; - init: typeof init; - initial: typeof initial; - inRange: typeof inRange; - intersection: typeof intersection; - intersectionBy: typeof intersectionBy; - intersectionWith: typeof intersectionWith; - invert: typeof invert; - invertBy: typeof invertBy; - invertObj: typeof invertObj; - invoke: typeof invoke; - invokeArgs: typeof invokeArgs; - invokeArgsMap: typeof invokeArgsMap; - invokeMap: typeof invokeMap; - isArguments: typeof isArguments; - isArray: typeof isArray; - isArrayBuffer: typeof isArrayBuffer; - isArrayLike: typeof isArrayLike; - isArrayLikeObject: typeof isArrayLikeObject; - isBoolean: typeof isBoolean; - isBuffer: typeof isBuffer; - isDate: typeof isDate; - isElement: typeof isElement; - isEmpty: typeof isEmpty; - isEqual: typeof isEqual; - isEqualWith: typeof isEqualWith; - isError: typeof isError; - isFinite: typeof isFinite; - isFunction: typeof isFunction; - isInteger: typeof isInteger; - isLength: typeof isLength; - isMap: typeof isMap; - isMatch: typeof isMatch; - isMatchWith: typeof isMatchWith; - isNaN: typeof isNaN; - isNative: typeof isNative; - isNil: typeof isNil; - isNull: typeof isNull; - isNumber: typeof isNumber; - isObject: typeof isObject; - isObjectLike: typeof isObjectLike; - isPlainObject: typeof isPlainObject; - isRegExp: typeof isRegExp; - isSafeInteger: typeof isSafeInteger; - isSet: typeof isSet; - isString: typeof isString; - isSymbol: typeof isSymbol; - isTypedArray: typeof isTypedArray; - isUndefined: typeof isUndefined; - isWeakMap: typeof isWeakMap; - isWeakSet: typeof isWeakSet; - iteratee: typeof iteratee; - join: typeof join; - juxt: typeof juxt; - kebabCase: typeof kebabCase; - keyBy: typeof keyBy; - keys: typeof keys; - keysIn: typeof keysIn; - last: typeof last; - lastIndexOf: typeof lastIndexOf; - lastIndexOfFrom: typeof lastIndexOfFrom; - lowerCase: typeof lowerCase; - lowerFirst: typeof lowerFirst; - lt: typeof lt; - lte: typeof lte; - map: typeof map; - mapKeys: typeof mapKeys; - mapValues: typeof mapValues; - matches: typeof matches; - matchesProperty: typeof matchesProperty; - max: typeof max; - maxBy: typeof maxBy; - mean: typeof mean; - meanBy: typeof meanBy; - memoize: typeof memoize; - merge: typeof merge; - mergeAll: typeof mergeAll; - mergeAllWith: typeof mergeAllWith; - mergeWith: typeof mergeWith; - method: typeof method; - methodOf: typeof methodOf; - min: typeof min; - minBy: typeof minBy; - multiply: typeof multiply; - nAry: typeof nAry; - negate: typeof negate; - noConflict: typeof noConflict; - noop: typeof noop; - now: typeof now; - nth: typeof nth; - nthArg: typeof nthArg; - omit: typeof omit; - omitAll: typeof omitAll; - omitBy: typeof omitBy; - once: typeof once; - orderBy: typeof orderBy; - over: typeof over; - overArgs: typeof overArgs; - overEvery: typeof overEvery; - overSome: typeof overSome; - pad: typeof pad; - padChars: typeof padChars; - padCharsEnd: typeof padCharsEnd; - padCharsStart: typeof padCharsStart; - padEnd: typeof padEnd; - padStart: typeof padStart; - parseInt: typeof parseInt; - partial: typeof partial; - partialRight: typeof partialRight; - partition: typeof partition; - path: typeof path; - pathEq: typeof pathEq; - pathOr: typeof pathOr; - paths: typeof paths; - pick: typeof pick; - pickAll: typeof pickAll; - pickBy: typeof pickBy; - pipe: typeof pipe; - pluck: typeof pluck; - prop: typeof prop; - propEq: typeof propEq; - property: typeof property; - propertyOf: typeof propertyOf; - propOr: typeof propOr; - props: typeof props; - pull: typeof pull; - pullAll: typeof pullAll; - pullAllBy: typeof pullAllBy; - pullAllWith: typeof pullAllWith; - pullAt: typeof pullAt; - random: typeof random; - range: typeof range; - rangeRight: typeof rangeRight; - rangeStep: typeof rangeStep; - rangeStepRight: typeof rangeStepRight; - rearg: typeof rearg; - reduce: typeof reduce; - reduceRight: typeof reduceRight; - reject: typeof reject; - remove: typeof remove; - repeat: typeof repeat; - replace: typeof replace; - rest: typeof rest; - restFrom: typeof restFrom; - result: typeof result; - reverse: typeof reverse; - round: typeof round; - runInContext: typeof runInContext; - sample: typeof sample; - sampleSize: typeof sampleSize; - set: typeof set; - setWith: typeof setWith; - shuffle: typeof shuffle; - size: typeof size; - slice: typeof slice; - snakeCase: typeof snakeCase; - some: typeof some; - sortBy: typeof sortBy; - sortedIndex: typeof sortedIndex; - sortedIndexBy: typeof sortedIndexBy; - sortedIndexOf: typeof sortedIndexOf; - sortedLastIndex: typeof sortedLastIndex; - sortedLastIndexBy: typeof sortedLastIndexBy; - sortedLastIndexOf: typeof sortedLastIndexOf; - sortedUniq: typeof sortedUniq; - sortedUniqBy: typeof sortedUniqBy; - split: typeof split; - spread: typeof spread; - spreadFrom: typeof spreadFrom; - startCase: typeof startCase; - startsWith: typeof startsWith; - stubArray: typeof stubArray; - stubFalse: typeof stubFalse; - stubObject: typeof stubObject; - stubString: typeof stubString; - stubTrue: typeof stubTrue; - subtract: typeof subtract; - sum: typeof sum; - sumBy: typeof sumBy; - symmetricDifference: typeof symmetricDifference; - symmetricDifferenceBy: typeof symmetricDifferenceBy; - symmetricDifferenceWith: typeof symmetricDifferenceWith; - T: typeof T; - tail: typeof tail; - take: typeof take; - takeLast: typeof takeLast; - takeLastWhile: typeof takeLastWhile; - takeRight: typeof takeRight; - takeRightWhile: typeof takeRightWhile; - takeWhile: typeof takeWhile; - tap: typeof tap; - template: typeof template; - throttle: typeof throttle; - thru: typeof thru; - times: typeof times; - toArray: typeof toArray; - toFinite: typeof toFinite; - toInteger: typeof toInteger; - toLength: typeof toLength; - toLower: typeof toLower; - toNumber: typeof toNumber; - toPairs: typeof toPairs; - toPairsIn: typeof toPairsIn; - toPath: typeof toPath; - toPlainObject: typeof toPlainObject; - toSafeInteger: typeof toSafeInteger; - toString: typeof toString; - toUpper: typeof toUpper; - transform: typeof transform; - trim: typeof trim; - trimChars: typeof trimChars; - trimCharsEnd: typeof trimCharsEnd; - trimCharsStart: typeof trimCharsStart; - trimEnd: typeof trimEnd; - trimStart: typeof trimStart; - truncate: typeof truncate; - unapply: typeof unapply; - unary: typeof unary; - unescape: typeof unescape; - union: typeof union; - unionBy: typeof unionBy; - unionWith: typeof unionWith; - uniq: typeof uniq; - uniqBy: typeof uniqBy; - uniqueId: typeof uniqueId; - uniqWith: typeof uniqWith; - unnest: typeof unnest; - unset: typeof unset; - unzip: typeof unzip; - unzipWith: typeof unzipWith; - update: typeof update; - updateWith: typeof updateWith; - upperCase: typeof upperCase; - upperFirst: typeof upperFirst; - useWith: typeof useWith; - values: typeof values; - valuesIn: typeof valuesIn; - where: typeof where; - whereEq: typeof whereEq; - without: typeof without; - words: typeof words; - wrap: typeof wrap; - xor: typeof xor; - xorBy: typeof xorBy; - xorWith: typeof xorWith; - zip: typeof zip; - zipAll: typeof zipAll; - zipObj: typeof zipObj; - zipObject: typeof zipObject; - zipObjectDeep: typeof zipObjectDeep; - zipWith: typeof zipWith; + add: LodashAdd; + after: LodashAfter; + all: LodashEvery; + allPass: LodashOverEvery; + always: LodashConstant; + any: LodashSome; + anyPass: LodashOverSome; + apply: LodashApply; + ary: LodashAry; + assign: LodashAssign; + assignAll: LodashAssignAll; + assignAllWith: LodashAssignAllWith; + assignIn: LodashAssignIn; + assignInAll: LodashAssignInAll; + assignInAllWith: LodashAssignInAllWith; + assignInWith: LodashAssignInWith; + assignWith: LodashAssignWith; + assoc: LodashSet; + assocPath: LodashSet; + at: LodashAt; + attempt: LodashAttempt; + before: LodashBefore; + bind: LodashBind; + bindAll: LodashBindAll; + bindKey: LodashBindKey; + camelCase: LodashCamelCase; + capitalize: LodashCapitalize; + castArray: LodashCastArray; + ceil: LodashCeil; + chunk: LodashChunk; + clamp: LodashClamp; + clone: LodashClone; + cloneDeep: LodashCloneDeep; + cloneDeepWith: LodashCloneDeepWith; + cloneWith: LodashCloneWith; + compact: LodashCompact; + complement: LodashNegate; + compose: LodashFlowRight; + concat: LodashConcat; + cond: LodashCond; + conforms: LodashConformsTo; + conformsTo: LodashConformsTo; + constant: LodashConstant; + contains: LodashContains; + countBy: LodashCountBy; + create: LodashCreate; + curry: LodashCurry; + curryN: LodashCurryN; + curryRight: LodashCurryRight; + curryRightN: LodashCurryRightN; + debounce: LodashDebounce; + deburr: LodashDeburr; + defaults: LodashDefaults; + defaultsAll: LodashDefaultsAll; + defaultsDeep: LodashDefaultsDeep; + defaultsDeepAll: LodashDefaultsDeepAll; + defaultTo: LodashDefaultTo; + defer: LodashDefer; + delay: LodashDelay; + difference: LodashDifference; + differenceBy: LodashDifferenceBy; + differenceWith: LodashDifferenceWith; + dissoc: LodashUnset; + dissocPath: LodashUnset; + divide: LodashDivide; + drop: LodashDrop; + dropLast: LodashDropRight; + dropLastWhile: LodashDropRightWhile; + dropRight: LodashDropRight; + dropRightWhile: LodashDropRightWhile; + dropWhile: LodashDropWhile; + each: LodashForEach; + eachRight: LodashForEachRight; + endsWith: LodashEndsWith; + entries: LodashToPairs; + entriesIn: LodashToPairsIn; + eq: LodashEq; + equals: LodashIsEqual; + escape: LodashEscape; + escapeRegExp: LodashEscapeRegExp; + every: LodashEvery; + extend: LodashExtend; + extendAll: LodashExtendAll; + extendAllWith: LodashExtendAllWith; + extendWith: LodashExtendWith; + F: LodashStubFalse; + fill: LodashFill; + filter: LodashFilter; + find: LodashFind; + findFrom: LodashFindFrom; + findIndex: LodashFindIndex; + findIndexFrom: LodashFindIndexFrom; + findKey: LodashFindKey; + findLast: LodashFindLast; + findLastFrom: LodashFindLastFrom; + findLastIndex: LodashFindLastIndex; + findLastIndexFrom: LodashFindLastIndexFrom; + findLastKey: LodashFindLastKey; + first: LodashHead; + flatMap: LodashFlatMap; + flatMapDeep: LodashFlatMapDeep; + flatMapDepth: LodashFlatMapDepth; + flatten: LodashFlatten; + flattenDeep: LodashFlattenDeep; + flattenDepth: LodashFlattenDepth; + flip: LodashFlip; + floor: LodashFloor; + flow: LodashFlow; + flowRight: LodashFlowRight; + forEach: LodashForEach; + forEachRight: LodashForEachRight; + forIn: LodashForIn; + forInRight: LodashForInRight; + forOwn: LodashForOwn; + forOwnRight: LodashForOwnRight; + fromPairs: LodashFromPairs; + functions: LodashFunctions; + functionsIn: LodashFunctionsIn; + get: LodashGet; + getOr: LodashGetOr; + groupBy: LodashGroupBy; + gt: LodashGt; + gte: LodashGte; + has: LodashHas; + hasIn: LodashHasIn; + head: LodashHead; + identical: LodashEq; + identity: LodashIdentity; + includes: LodashIncludes; + includesFrom: LodashIncludesFrom; + indexBy: LodashKeyBy; + indexOf: LodashIndexOf; + indexOfFrom: LodashIndexOfFrom; + init: LodashInitial; + initial: LodashInitial; + inRange: LodashInRange; + intersection: LodashIntersection; + intersectionBy: LodashIntersectionBy; + intersectionWith: LodashIntersectionWith; + invert: LodashInvert; + invertBy: LodashInvertBy; + invertObj: LodashInvert; + invoke: LodashInvoke; + invokeArgs: LodashInvokeArgs; + invokeArgsMap: LodashInvokeArgsMap; + invokeMap: LodashInvokeMap; + isArguments: LodashIsArguments; + isArray: LodashIsArray; + isArrayBuffer: LodashIsArrayBuffer; + isArrayLike: LodashIsArrayLike; + isArrayLikeObject: LodashIsArrayLikeObject; + isBoolean: LodashIsBoolean; + isBuffer: LodashIsBuffer; + isDate: LodashIsDate; + isElement: LodashIsElement; + isEmpty: LodashIsEmpty; + isEqual: LodashIsEqual; + isEqualWith: LodashIsEqualWith; + isError: LodashIsError; + isFinite: LodashIsFinite; + isFunction: LodashIsFunction; + isInteger: LodashIsInteger; + isLength: LodashIsLength; + isMap: LodashIsMap; + isMatch: LodashIsMatch; + isMatchWith: LodashIsMatchWith; + isNaN: LodashIsNaN; + isNative: LodashIsNative; + isNil: LodashIsNil; + isNull: LodashIsNull; + isNumber: LodashIsNumber; + isObject: LodashIsObject; + isObjectLike: LodashIsObjectLike; + isPlainObject: LodashIsPlainObject; + isRegExp: LodashIsRegExp; + isSafeInteger: LodashIsSafeInteger; + isSet: LodashIsSet; + isString: LodashIsString; + isSymbol: LodashIsSymbol; + isTypedArray: LodashIsTypedArray; + isUndefined: LodashIsUndefined; + isWeakMap: LodashIsWeakMap; + isWeakSet: LodashIsWeakSet; + iteratee: LodashIteratee; + join: LodashJoin; + juxt: LodashOver; + kebabCase: LodashKebabCase; + keyBy: LodashKeyBy; + keys: LodashKeys; + keysIn: LodashKeysIn; + last: LodashLast; + lastIndexOf: LodashLastIndexOf; + lastIndexOfFrom: LodashLastIndexOfFrom; + lowerCase: LodashLowerCase; + lowerFirst: LodashLowerFirst; + lt: LodashLt; + lte: LodashLte; + map: LodashMap; + mapKeys: LodashMapKeys; + mapValues: LodashMapValues; + matches: LodashIsMatch; + matchesProperty: LodashMatchesProperty; + max: LodashMax; + maxBy: LodashMaxBy; + mean: LodashMean; + meanBy: LodashMeanBy; + memoize: LodashMemoize; + merge: LodashMerge; + mergeAll: LodashMergeAll; + mergeAllWith: LodashMergeAllWith; + mergeWith: LodashMergeWith; + method: LodashMethod; + methodOf: LodashMethodOf; + min: LodashMin; + minBy: LodashMinBy; + multiply: LodashMultiply; + nAry: LodashAry; + negate: LodashNegate; + noConflict: LodashNoConflict; + noop: LodashNoop; + now: LodashNow; + nth: LodashNth; + nthArg: LodashNthArg; + omit: LodashOmit; + omitAll: LodashOmit; + omitBy: LodashOmitBy; + once: LodashOnce; + orderBy: LodashOrderBy; + over: LodashOver; + overArgs: LodashOverArgs; + overEvery: LodashOverEvery; + overSome: LodashOverSome; + pad: LodashPad; + padChars: LodashPadChars; + padCharsEnd: LodashPadCharsEnd; + padCharsStart: LodashPadCharsStart; + padEnd: LodashPadEnd; + padStart: LodashPadStart; + parseInt: LodashParseInt; + partial: LodashPartial; + partialRight: LodashPartialRight; + partition: LodashPartition; + path: LodashPath; + pathEq: LodashMatchesProperty; + pathOr: LodashPathOr; + paths: LodashAt; + pick: LodashPick; + pickAll: LodashPick; + pickBy: LodashPickBy; + pipe: LodashFlow; + pluck: LodashMap; + prop: LodashProp; + propEq: LodashMatchesProperty; + property: LodashProperty; + propertyOf: LodashPropertyOf; + propOr: LodashPropOr; + props: LodashAt; + pull: LodashPull; + pullAll: LodashPullAll; + pullAllBy: LodashPullAllBy; + pullAllWith: LodashPullAllWith; + pullAt: LodashPullAt; + random: LodashRandom; + range: LodashRange; + rangeRight: LodashRangeRight; + rangeStep: LodashRangeStep; + rangeStepRight: LodashRangeStepRight; + rearg: LodashRearg; + reduce: LodashReduce; + reduceRight: LodashReduceRight; + reject: LodashReject; + remove: LodashRemove; + repeat: LodashRepeat; + replace: LodashReplace; + rest: LodashRest; + restFrom: LodashRestFrom; + result: LodashResult; + reverse: LodashReverse; + round: LodashRound; + runInContext: LodashRunInContext; + sample: LodashSample; + sampleSize: LodashSampleSize; + set: LodashSet; + setWith: LodashSetWith; + shuffle: LodashShuffle; + size: LodashSize; + slice: LodashSlice; + snakeCase: LodashSnakeCase; + some: LodashSome; + sortBy: LodashSortBy; + sortedIndex: LodashSortedIndex; + sortedIndexBy: LodashSortedIndexBy; + sortedIndexOf: LodashSortedIndexOf; + sortedLastIndex: LodashSortedLastIndex; + sortedLastIndexBy: LodashSortedLastIndexBy; + sortedLastIndexOf: LodashSortedLastIndexOf; + sortedUniq: LodashSortedUniq; + sortedUniqBy: LodashSortedUniqBy; + split: LodashSplit; + spread: LodashSpread; + spreadFrom: LodashSpreadFrom; + startCase: LodashStartCase; + startsWith: LodashStartsWith; + stubArray: LodashStubArray; + stubFalse: LodashStubFalse; + stubObject: LodashStubObject; + stubString: LodashStubString; + stubTrue: LodashStubTrue; + subtract: LodashSubtract; + sum: LodashSum; + sumBy: LodashSumBy; + symmetricDifference: LodashXor; + symmetricDifferenceBy: LodashXorBy; + symmetricDifferenceWith: LodashXorWith; + T: LodashStubTrue; + tail: LodashTail; + take: LodashTake; + takeLast: LodashTakeRight; + takeLastWhile: LodashTakeRightWhile; + takeRight: LodashTakeRight; + takeRightWhile: LodashTakeRightWhile; + takeWhile: LodashTakeWhile; + tap: LodashTap; + template: LodashTemplate; + throttle: LodashThrottle; + thru: LodashThru; + times: LodashTimes; + toArray: LodashToArray; + toFinite: LodashToFinite; + toInteger: LodashToInteger; + toLength: LodashToLength; + toLower: LodashToLower; + toNumber: LodashToNumber; + toPairs: LodashToPairs; + toPairsIn: LodashToPairsIn; + toPath: LodashToPath; + toPlainObject: LodashToPlainObject; + toSafeInteger: LodashToSafeInteger; + toString: LodashToString; + toUpper: LodashToUpper; + transform: LodashTransform; + trim: LodashTrim; + trimChars: LodashTrimChars; + trimCharsEnd: LodashTrimCharsEnd; + trimCharsStart: LodashTrimCharsStart; + trimEnd: LodashTrimEnd; + trimStart: LodashTrimStart; + truncate: LodashTruncate; + unapply: LodashUnapply; + unary: LodashUnary; + unescape: LodashUnescape; + union: LodashUnion; + unionBy: LodashUnionBy; + unionWith: LodashUnionWith; + uniq: LodashUniq; + uniqBy: LodashUniqBy; + uniqueId: LodashUniqueId; + uniqWith: LodashUniqWith; + unnest: LodashFlatten; + unset: LodashUnset; + unzip: LodashUnzip; + unzipWith: LodashUnzipWith; + update: LodashUpdate; + updateWith: LodashUpdateWith; + upperCase: LodashUpperCase; + upperFirst: LodashUpperFirst; + useWith: LodashOverArgs; + values: LodashValues; + valuesIn: LodashValuesIn; + where: LodashConformsTo; + whereEq: LodashIsMatch; + without: LodashWithout; + words: LodashWords; + wrap: LodashWrap; + xor: LodashXor; + xorBy: LodashXorBy; + xorWith: LodashXorWith; + zip: LodashZip; + zipAll: LodashZipAll; + zipObj: LodashZipObject; + zipObject: LodashZipObject; + zipObjectDeep: LodashZipObjectDeep; + zipWith: LodashZipWith; + __: lodash.__; + placehodler: lodash.__; } } - -// Backward compatibility with --target es5 -declare global { - // tslint:disable-next-line:no-empty-interface - interface Set { } - // tslint:disable-next-line:no-empty-interface - interface Map { } - // tslint:disable-next-line:no-empty-interface - interface WeakSet { } - // tslint:disable-next-line:no-empty-interface - interface WeakMap { } -} diff --git a/types/lodash/fp/F.d.ts b/types/lodash/fp/F.d.ts index 8d7802efd8..33fc57930d 100644 --- a/types/lodash/fp/F.d.ts +++ b/types/lodash/fp/F.d.ts @@ -1,14 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type StubFalse = - /** - * This method returns `false`. - * - * @returns Returns `false`. - */ - () => boolean; - -declare const F: StubFalse; +import { F } from "../fp"; export = F; diff --git a/types/lodash/fp/T.d.ts b/types/lodash/fp/T.d.ts index ea1dc32ee8..886606ef6f 100644 --- a/types/lodash/fp/T.d.ts +++ b/types/lodash/fp/T.d.ts @@ -1,14 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type StubTrue = - /** - * This method returns `true`. - * - * @returns Returns `true`. - */ - () => boolean; - -declare const T: StubTrue; +import { T } from "../fp"; export = T; diff --git a/types/lodash/fp/__.d.ts b/types/lodash/fp/__.d.ts new file mode 100644 index 0000000000..aec0a51422 --- /dev/null +++ b/types/lodash/fp/__.d.ts @@ -0,0 +1,3 @@ +import _ = require("../index"); +declare const __: _.__; +export = __; diff --git a/types/lodash/fp/add.d.ts b/types/lodash/fp/add.d.ts index 2977814de9..47c9c6a1a4 100644 --- a/types/lodash/fp/add.d.ts +++ b/types/lodash/fp/add.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Add { - /** - * Adds two numbers. - * - * @param augend The first number to add. - * @param addend The second number to add. - * @return Returns the sum. - */ - (): Add; - /** - * Adds two numbers. - * - * @param augend The first number to add. - * @param addend The second number to add. - * @return Returns the sum. - */ - (augend: number): Add1x1; - /** - * Adds two numbers. - * - * @param augend The first number to add. - * @param addend The second number to add. - * @return Returns the sum. - */ - (augend: number, addend: number): number; -} -interface Add1x1 { - /** - * Adds two numbers. - * - * @param augend The first number to add. - * @param addend The second number to add. - * @return Returns the sum. - */ - (): Add1x1; - /** - * Adds two numbers. - * - * @param augend The first number to add. - * @param addend The second number to add. - * @return Returns the sum. - */ - (addend: number): number; -} - -declare const add: Add; +import { add } from "../fp"; export = add; diff --git a/types/lodash/fp/after.d.ts b/types/lodash/fp/after.d.ts index c6b21973d0..93863a5613 100644 --- a/types/lodash/fp/after.d.ts +++ b/types/lodash/fp/after.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface After { - /** - * The opposite of _.before; this method creates a function that invokes func once it’s called n or more times. - * - * @param n The number of calls before func is invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - (): After; - /** - * The opposite of _.before; this method creates a function that invokes func once it’s called n or more times. - * - * @param n The number of calls before func is invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - any>(func: TFunc): After1x1; - /** - * The opposite of _.before; this method creates a function that invokes func once it’s called n or more times. - * - * @param n The number of calls before func is invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - any>(func: TFunc, n: number): TFunc; -} -interface After1x1 any> { - /** - * The opposite of _.before; this method creates a function that invokes func once it’s called n or more times. - * - * @param n The number of calls before func is invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - (): After1x1; - /** - * The opposite of _.before; this method creates a function that invokes func once it’s called n or more times. - * - * @param n The number of calls before func is invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - (n: number): TFunc; -} - -declare const after: After; +import { after } from "../fp"; export = after; diff --git a/types/lodash/fp/all.d.ts b/types/lodash/fp/all.d.ts index 15f37bae09..5ca0f70736 100644 --- a/types/lodash/fp/all.d.ts +++ b/types/lodash/fp/all.d.ts @@ -1,67 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Every { - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (): Every; - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom): Every1x1; - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom, collection: _.List | null | undefined): boolean; - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom, collection: T | null | undefined): boolean; -} -interface Every1x1 { - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (): Every1x1; - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (collection: _.List | object | null | undefined): boolean; -} - -declare const all: Every; +import { all } from "../fp"; export = all; diff --git a/types/lodash/fp/allPass.d.ts b/types/lodash/fp/allPass.d.ts index 564484494e..5013913efc 100644 --- a/types/lodash/fp/allPass.d.ts +++ b/types/lodash/fp/allPass.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type OverEvery = - /** - * Creates a function that checks if all of the predicates return truthy when invoked with the arguments - * provided to the created function. - * - * @param predicates The predicates to check. - * @return Returns the new function. - */ - (predicates: _.Many<(...args: T[]) => boolean>) => (...args: T[]) => boolean; - -declare const allPass: OverEvery; +import { allPass } from "../fp"; export = allPass; diff --git a/types/lodash/fp/always.d.ts b/types/lodash/fp/always.d.ts index bd22aed21f..07bd82d47c 100644 --- a/types/lodash/fp/always.d.ts +++ b/types/lodash/fp/always.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Constant = - /** - * Creates a function that returns value. - * - * @param value The value to return from the new function. - * @return Returns the new function. - */ - (value: T) => () => T; - -declare const always: Constant; +import { always } from "../fp"; export = always; diff --git a/types/lodash/fp/any.d.ts b/types/lodash/fp/any.d.ts index 32cf83d382..5d8c38f27c 100644 --- a/types/lodash/fp/any.d.ts +++ b/types/lodash/fp/any.d.ts @@ -1,67 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Some { - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (): Some; - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom): Some1x1; - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom, collection: _.List | null | undefined): boolean; - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom, collection: T | null | undefined): boolean; -} -interface Some1x1 { - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (): Some1x1; - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (collection: _.List | object | null | undefined): boolean; -} - -declare const any: Some; +import { any } from "../fp"; export = any; diff --git a/types/lodash/fp/anyPass.d.ts b/types/lodash/fp/anyPass.d.ts index 0666de68ba..b69becfaf3 100644 --- a/types/lodash/fp/anyPass.d.ts +++ b/types/lodash/fp/anyPass.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type OverSome = - /** - * Creates a function that checks if any of the predicates return truthy when invoked with the arguments - * provided to the created function. - * - * @param predicates The predicates to check. - * @return Returns the new function. - */ - (predicates: _.Many<(...args: T[]) => boolean>) => (...args: T[]) => boolean; - -declare const anyPass: OverSome; +import { anyPass } from "../fp"; export = anyPass; diff --git a/types/lodash/fp/apply.d.ts b/types/lodash/fp/apply.d.ts index 6a052218aa..e13c42c5de 100644 --- a/types/lodash/fp/apply.d.ts +++ b/types/lodash/fp/apply.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Spread = - /** - * Creates a function that invokes func with the this binding of the created function and an array of arguments - * much like Function#apply. - * - * Note: This method is based on the spread operator. - * - * @param func The function to spread arguments over. - * @return Returns the new function. - */ - (func: (...args: any[]) => TResult) => (...args: any[]) => TResult; - -declare const apply: Spread; +import { apply } from "../fp"; export = apply; diff --git a/types/lodash/fp/ary.d.ts b/types/lodash/fp/ary.d.ts index c241921795..932d7f45f3 100644 --- a/types/lodash/fp/ary.d.ts +++ b/types/lodash/fp/ary.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Ary { - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - (): Ary; - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - (n: number): Ary1x1; - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - (n: number, func: (...args: any[]) => any): (...args: any[]) => any; -} -interface Ary1x1 { - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - (): Ary1x1; - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - (func: (...args: any[]) => any): (...args: any[]) => any; -} - -declare const ary: Ary; +import { ary } from "../fp"; export = ary; diff --git a/types/lodash/fp/assign.d.ts b/types/lodash/fp/assign.d.ts index df05fbe118..cf173104ab 100644 --- a/types/lodash/fp/assign.d.ts +++ b/types/lodash/fp/assign.d.ts @@ -1,156 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Assign { - /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.c = 3; - * } - * - * function Bar() { - * this.e = 5; - * } - * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; - * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } - */ - (): Assign; - /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.c = 3; - * } - * - * function Bar() { - * this.e = 5; - * } - * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; - * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } - */ - (object: TObject): Assign1x1; - /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.c = 3; - * } - * - * function Bar() { - * this.e = 5; - * } - * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; - * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } - */ - (object: TObject, source: TSource): TObject & TSource; -} -interface Assign1x1 { - /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.c = 3; - * } - * - * function Bar() { - * this.e = 5; - * } - * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; - * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } - */ - (): Assign1x1; - /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.c = 3; - * } - * - * function Bar() { - * this.e = 5; - * } - * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; - * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } - */ - (source: TSource): TObject & TSource; -} - -declare const assign: Assign; +import { assign } from "../fp"; export = assign; diff --git a/types/lodash/fp/assignAll.d.ts b/types/lodash/fp/assignAll.d.ts index b6ba1dfba9..f95b06b475 100644 --- a/types/lodash/fp/assignAll.d.ts +++ b/types/lodash/fp/assignAll.d.ts @@ -1,37 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Assign = - /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.c = 3; - * } - * - * function Bar() { - * this.e = 5; - * } - * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; - * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } - */ - (object: ReadonlyArray) => any; - -declare const assignAll: Assign; +import { assignAll } from "../fp"; export = assignAll; diff --git a/types/lodash/fp/assignAllWith.d.ts b/types/lodash/fp/assignAllWith.d.ts index 0f8d2d07ed..c2695a07a6 100644 --- a/types/lodash/fp/assignAllWith.d.ts +++ b/types/lodash/fp/assignAllWith.d.ts @@ -1,138 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface AssignWith { - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignWith; - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer): AssignWith1x1; - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer, args: ReadonlyArray): any; -} -interface AssignWith1x1 { - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignWith1x1; - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (args: ReadonlyArray): any; -} - -declare const assignAllWith: AssignWith; +import { assignAllWith } from "../fp"; export = assignAllWith; diff --git a/types/lodash/fp/assignIn.d.ts b/types/lodash/fp/assignIn.d.ts index fcd201f901..f6cdee768b 100644 --- a/types/lodash/fp/assignIn.d.ts +++ b/types/lodash/fp/assignIn.d.ts @@ -1,151 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface AssignIn { - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (): AssignIn; - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (object: TObject): AssignIn1x1; - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (object: TObject, source: TSource): TObject & TSource; -} -interface AssignIn1x1 { - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (): AssignIn1x1; - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (source: TSource): TObject & TSource; -} - -declare const assignIn: AssignIn; +import { assignIn } from "../fp"; export = assignIn; diff --git a/types/lodash/fp/assignInAll.d.ts b/types/lodash/fp/assignInAll.d.ts index 32290cc6cd..539344b67b 100644 --- a/types/lodash/fp/assignInAll.d.ts +++ b/types/lodash/fp/assignInAll.d.ts @@ -1,36 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type AssignIn = - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (object: ReadonlyArray) => TResult; - -declare const assignInAll: AssignIn; +import { assignInAll } from "../fp"; export = assignInAll; diff --git a/types/lodash/fp/assignInAllWith.d.ts b/types/lodash/fp/assignInAllWith.d.ts index 631b28218a..3b421fb332 100644 --- a/types/lodash/fp/assignInAllWith.d.ts +++ b/types/lodash/fp/assignInAllWith.d.ts @@ -1,143 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface AssignInWith { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignInWith; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer): AssignInWith1x1; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer, args: ReadonlyArray): any; -} -interface AssignInWith1x1 { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignInWith1x1; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (args: ReadonlyArray): any; -} - -declare const assignInAllWith: AssignInWith; +import { assignInAllWith } from "../fp"; export = assignInAllWith; diff --git a/types/lodash/fp/assignInWith.d.ts b/types/lodash/fp/assignInWith.d.ts index d2f9dbba6f..c410091c62 100644 --- a/types/lodash/fp/assignInWith.d.ts +++ b/types/lodash/fp/assignInWith.d.ts @@ -1,249 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface AssignInWith { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignInWith; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer): AssignInWith1x1; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer, object: TObject): AssignInWith1x2; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer, object: TObject, source: TSource): TObject & TSource; -} -interface AssignInWith1x1 { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignInWith1x1; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (object: TObject): AssignInWith1x2; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (object: TObject, source: TSource): TObject & TSource; -} -interface AssignInWith1x2 { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignInWith1x2; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (source: TSource): TObject & TSource; -} - -declare const assignInWith: AssignInWith; +import { assignInWith } from "../fp"; export = assignInWith; diff --git a/types/lodash/fp/assignWith.d.ts b/types/lodash/fp/assignWith.d.ts index 2313bd2614..2205db0119 100644 --- a/types/lodash/fp/assignWith.d.ts +++ b/types/lodash/fp/assignWith.d.ts @@ -1,240 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface AssignWith { - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignWith; - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer): AssignWith1x1; - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer, object: TObject): AssignWith1x2; - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer, object: TObject, source: TSource): TObject & TSource; -} -interface AssignWith1x1 { - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignWith1x1; - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (object: TObject): AssignWith1x2; - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (object: TObject, source: TSource): TObject & TSource; -} -interface AssignWith1x2 { - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignWith1x2; - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (source: TSource): TObject & TSource; -} - -declare const assignWith: AssignWith; +import { assignWith } from "../fp"; export = assignWith; diff --git a/types/lodash/fp/assoc.d.ts b/types/lodash/fp/assoc.d.ts index 41f176aaa9..2a2e29c6f0 100644 --- a/types/lodash/fp/assoc.d.ts +++ b/types/lodash/fp/assoc.d.ts @@ -1,147 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Set { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (): Set; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath): Set1x1; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath, value: any): Set1x2; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath, value: any, object: T): T; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath, value: any, object: object): TResult; -} -interface Set1x1 { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (): Set1x1; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (value: any): Set1x2; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (value: any, object: T): T; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (value: any, object: object): TResult; -} -interface Set1x2 { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (): Set1x2; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (object: T): T; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (object: object): TResult; -} - -declare const assoc: Set; +import { assoc } from "../fp"; export = assoc; diff --git a/types/lodash/fp/assocPath.d.ts b/types/lodash/fp/assocPath.d.ts index ebd0a30a6e..e2dd5179e3 100644 --- a/types/lodash/fp/assocPath.d.ts +++ b/types/lodash/fp/assocPath.d.ts @@ -1,147 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Set { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (): Set; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath): Set1x1; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath, value: any): Set1x2; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath, value: any, object: T): T; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath, value: any, object: object): TResult; -} -interface Set1x1 { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (): Set1x1; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (value: any): Set1x2; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (value: any, object: T): T; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (value: any, object: object): TResult; -} -interface Set1x2 { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (): Set1x2; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (object: T): T; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (object: object): TResult; -} - -declare const assocPath: Set; +import { assocPath } from "../fp"; export = assocPath; diff --git a/types/lodash/fp/at.d.ts b/types/lodash/fp/at.d.ts index c8777af286..beefa3343b 100644 --- a/types/lodash/fp/at.d.ts +++ b/types/lodash/fp/at.d.ts @@ -1,96 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface At { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (): At; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.PropertyPath): At1x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.PropertyPath, object: _.List | _.Dictionary | _.NumericDictionary | null | undefined): T[]; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.Many): At2x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.Many, object: T | null | undefined): Array; -} -interface At1x1 { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (): At1x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (object: _.List | _.Dictionary | _.NumericDictionary | null | undefined): T[]; -} -interface At2x1 { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (): At2x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (object: T | null | undefined): Array; -} - -declare const at: At; +import { at } from "../fp"; export = at; diff --git a/types/lodash/fp/attempt.d.ts b/types/lodash/fp/attempt.d.ts index b2626b6112..72d60af08f 100644 --- a/types/lodash/fp/attempt.d.ts +++ b/types/lodash/fp/attempt.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Attempt = - /** - * Attempts to invoke func, returning either the result or the caught error object. Any additional arguments - * are provided to func when it’s invoked. - * - * @param func The function to attempt. - * @return Returns the func result or error object. - */ - (func: (...args: any[]) => TResult) => TResult|Error; - -declare const attempt: Attempt; +import { attempt } from "../fp"; export = attempt; diff --git a/types/lodash/fp/before.d.ts b/types/lodash/fp/before.d.ts index f3e4591275..ead2869093 100644 --- a/types/lodash/fp/before.d.ts +++ b/types/lodash/fp/before.d.ts @@ -1,61 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Before { - /** - * Creates a function that invokes func, with the this binding and arguments of the created function, while - * 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; - /** - * Creates a function that invokes func, with the this binding and arguments of the created function, while - * 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. - */ - any>(func: TFunc): Before1x1; - /** - * Creates a function that invokes func, with the this binding and arguments of the created function, while - * 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. - */ - any>(func: TFunc, n: number): TFunc; -} -interface Before1x1 any> { - /** - * Creates a function that invokes func, with the this binding and arguments of the created function, while - * 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. - */ - (): Before1x1; - /** - * Creates a function that invokes func, with the this binding and arguments of the created function, while - * 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. - */ - (n: number): TFunc; -} - -declare const before: Before; +import { before } from "../fp"; export = before; diff --git a/types/lodash/fp/bind.d.ts b/types/lodash/fp/bind.d.ts index b62fb3de1f..a312192a31 100644 --- a/types/lodash/fp/bind.d.ts +++ b/types/lodash/fp/bind.d.ts @@ -1,86 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Bind { - /** - * Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind - * arguments to those provided to the bound function. - * - * The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for - * partially applied arguments. - * - * Note: Unlike native Function#bind this method does not set the "length" property of bound functions. - * - * @param func The function to bind. - * @param thisArg The this binding of func. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - (): Bind; - /** - * Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind - * arguments to those provided to the bound function. - * - * The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for - * partially applied arguments. - * - * Note: Unlike native Function#bind this method does not set the "length" property of bound functions. - * - * @param func The function to bind. - * @param thisArg The this binding of func. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - (func: (...args: any[]) => any): Bind1x1; - /** - * Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind - * arguments to those provided to the bound function. - * - * The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for - * partially applied arguments. - * - * Note: Unlike native Function#bind this method does not set the "length" property of bound functions. - * - * @param func The function to bind. - * @param thisArg The this binding of func. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - (func: (...args: any[]) => any, thisArg: any): (...args: any[]) => any; -} -interface Bind1x1 { - /** - * Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind - * arguments to those provided to the bound function. - * - * The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for - * partially applied arguments. - * - * Note: Unlike native Function#bind this method does not set the "length" property of bound functions. - * - * @param func The function to bind. - * @param thisArg The this binding of func. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - (): Bind1x1; - /** - * Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind - * arguments to those provided to the bound function. - * - * The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for - * partially applied arguments. - * - * Note: Unlike native Function#bind this method does not set the "length" property of bound functions. - * - * @param func The function to bind. - * @param thisArg The this binding of func. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - (thisArg: any): (...args: any[]) => any; -} - -declare const bind: Bind; +import { bind } from "../fp"; export = bind; diff --git a/types/lodash/fp/bindAll.d.ts b/types/lodash/fp/bindAll.d.ts index 98275d8d79..4f7c7dbffc 100644 --- a/types/lodash/fp/bindAll.d.ts +++ b/types/lodash/fp/bindAll.d.ts @@ -1,78 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface BindAll { - /** - * Binds methods of an object to the object itself, overwriting the existing method. Method names may be - * specified as individual arguments or as arrays of method names. If no method names are provided all - * enumerable function properties, own and inherited, of object are bound. - * - * Note: This method does not set the "length" property of bound functions. - * - * @param object The object to bind and assign the bound methods to. - * @param methodNames The object method names to bind, specified as individual method names or arrays of - * method names. - * @return Returns object. - */ - (): BindAll; - /** - * Binds methods of an object to the object itself, overwriting the existing method. Method names may be - * specified as individual arguments or as arrays of method names. If no method names are provided all - * enumerable function properties, own and inherited, of object are bound. - * - * Note: This method does not set the "length" property of bound functions. - * - * @param object The object to bind and assign the bound methods to. - * @param methodNames The object method names to bind, specified as individual method names or arrays of - * method names. - * @return Returns object. - */ - (methodNames: _.Many): BindAll1x1; - /** - * Binds methods of an object to the object itself, overwriting the existing method. Method names may be - * specified as individual arguments or as arrays of method names. If no method names are provided all - * enumerable function properties, own and inherited, of object are bound. - * - * Note: This method does not set the "length" property of bound functions. - * - * @param object The object to bind and assign the bound methods to. - * @param methodNames The object method names to bind, specified as individual method names or arrays of - * method names. - * @return Returns object. - */ - (methodNames: _.Many, object: T): T; -} -interface BindAll1x1 { - /** - * Binds methods of an object to the object itself, overwriting the existing method. Method names may be - * specified as individual arguments or as arrays of method names. If no method names are provided all - * enumerable function properties, own and inherited, of object are bound. - * - * Note: This method does not set the "length" property of bound functions. - * - * @param object The object to bind and assign the bound methods to. - * @param methodNames The object method names to bind, specified as individual method names or arrays of - * method names. - * @return Returns object. - */ - (): BindAll1x1; - /** - * Binds methods of an object to the object itself, overwriting the existing method. Method names may be - * specified as individual arguments or as arrays of method names. If no method names are provided all - * enumerable function properties, own and inherited, of object are bound. - * - * Note: This method does not set the "length" property of bound functions. - * - * @param object The object to bind and assign the bound methods to. - * @param methodNames The object method names to bind, specified as individual method names or arrays of - * method names. - * @return Returns object. - */ - (object: T): T; -} - -declare const bindAll: BindAll; +import { bindAll } from "../fp"; export = bindAll; diff --git a/types/lodash/fp/bindKey.d.ts b/types/lodash/fp/bindKey.d.ts index c20c5b1901..8986b2f3a5 100644 --- a/types/lodash/fp/bindKey.d.ts +++ b/types/lodash/fp/bindKey.d.ts @@ -1,91 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface BindKey { - /** - * Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments - * to those provided to the bound function. - * - * This method differs from _.bind by allowing bound functions to reference methods that may be redefined - * or don’t yet exist. See Peter Michaux’s article for more details. - * - * The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder - * for partially applied arguments. - * - * @param object The object the method belongs to. - * @param key The key of the method. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - (): BindKey; - /** - * Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments - * to those provided to the bound function. - * - * This method differs from _.bind by allowing bound functions to reference methods that may be redefined - * or don’t yet exist. See Peter Michaux’s article for more details. - * - * The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder - * for partially applied arguments. - * - * @param object The object the method belongs to. - * @param key The key of the method. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - (object: object): BindKey1x1; - /** - * Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments - * to those provided to the bound function. - * - * This method differs from _.bind by allowing bound functions to reference methods that may be redefined - * or don’t yet exist. See Peter Michaux’s article for more details. - * - * The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder - * for partially applied arguments. - * - * @param object The object the method belongs to. - * @param key The key of the method. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - (object: object, key: string): (...args: any[]) => any; -} -interface BindKey1x1 { - /** - * Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments - * to those provided to the bound function. - * - * This method differs from _.bind by allowing bound functions to reference methods that may be redefined - * or don’t yet exist. See Peter Michaux’s article for more details. - * - * The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder - * for partially applied arguments. - * - * @param object The object the method belongs to. - * @param key The key of the method. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - (): BindKey1x1; - /** - * Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments - * to those provided to the bound function. - * - * This method differs from _.bind by allowing bound functions to reference methods that may be redefined - * or don’t yet exist. See Peter Michaux’s article for more details. - * - * The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder - * for partially applied arguments. - * - * @param object The object the method belongs to. - * @param key The key of the method. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - (key: string): (...args: any[]) => any; -} - -declare const bindKey: BindKey; +import { bindKey } from "../fp"; export = bindKey; diff --git a/types/lodash/fp/camelCase.d.ts b/types/lodash/fp/camelCase.d.ts index 81d33d61c7..be6628dd27 100644 --- a/types/lodash/fp/camelCase.d.ts +++ b/types/lodash/fp/camelCase.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type CamelCase = - /** - * Converts string to camel case. - * - * @param string The string to convert. - * @return Returns the camel cased string. - */ - (string: string) => string; - -declare const camelCase: CamelCase; +import { camelCase } from "../fp"; export = camelCase; diff --git a/types/lodash/fp/capitalize.d.ts b/types/lodash/fp/capitalize.d.ts index 988421b101..7dc552f9e4 100644 --- a/types/lodash/fp/capitalize.d.ts +++ b/types/lodash/fp/capitalize.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Capitalize = - /** - * Converts the first character of string to upper case and the remaining to lower case. - * - * @param string The string to capitalize. - * @return Returns the capitalized string. - */ - (string: string) => string; - -declare const capitalize: Capitalize; +import { capitalize } from "../fp"; export = capitalize; diff --git a/types/lodash/fp/castArray.d.ts b/types/lodash/fp/castArray.d.ts index 9d5b5fc11b..a431805adf 100644 --- a/types/lodash/fp/castArray.d.ts +++ b/types/lodash/fp/castArray.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type CastArray = - /** - * Casts value as an array if it’s not one. - * - * @param value The value to inspect. - * @return Returns the cast array. - */ - (value: _.Many) => T[]; - -declare const castArray: CastArray; +import { castArray } from "../fp"; export = castArray; diff --git a/types/lodash/fp/ceil.d.ts b/types/lodash/fp/ceil.d.ts index e360c5bc08..13cd7317b1 100644 --- a/types/lodash/fp/ceil.d.ts +++ b/types/lodash/fp/ceil.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Ceil = - /** - * Calculates n rounded up to precision. - * - * @param n The number to round up. - * @param precision The precision to round up to. - * @return Returns the rounded up number. - */ - (n: number) => number; - -declare const ceil: Ceil; +import { ceil } from "../fp"; export = ceil; diff --git a/types/lodash/fp/chunk.d.ts b/types/lodash/fp/chunk.d.ts index 8506a60c56..2e4066660b 100644 --- a/types/lodash/fp/chunk.d.ts +++ b/types/lodash/fp/chunk.d.ts @@ -1,58 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Chunk { - /** - * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the - * final chunk will be the remaining elements. - * - * @param array The array to process. - * @param size The length of each chunk. - * @return Returns the new array containing chunks. - */ - (): Chunk; - /** - * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the - * final chunk will be the remaining elements. - * - * @param array The array to process. - * @param size The length of each chunk. - * @return Returns the new array containing chunks. - */ - (size: number): Chunk1x1; - /** - * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the - * final chunk will be the remaining elements. - * - * @param array The array to process. - * @param size The length of each chunk. - * @return Returns the new array containing chunks. - */ - (size: number, array: _.List | null | undefined): T[][]; -} -interface Chunk1x1 { - /** - * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the - * final chunk will be the remaining elements. - * - * @param array The array to process. - * @param size The length of each chunk. - * @return Returns the new array containing chunks. - */ - (): Chunk1x1; - /** - * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the - * final chunk will be the remaining elements. - * - * @param array The array to process. - * @param size The length of each chunk. - * @return Returns the new array containing chunks. - */ - (array: _.List | null | undefined): T[][]; -} - -declare const chunk: Chunk; +import { chunk } from "../fp"; export = chunk; diff --git a/types/lodash/fp/clamp.d.ts b/types/lodash/fp/clamp.d.ts index 7683abc761..121c6f9b9c 100644 --- a/types/lodash/fp/clamp.d.ts +++ b/types/lodash/fp/clamp.d.ts @@ -1,166 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Clamp { - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @category Number - * @param number The number to clamp. - * @param [lower] The lower bound. - * @param upper The upper bound. - * @returns Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - (): Clamp; - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @category Number - * @param number The number to clamp. - * @param [lower] The lower bound. - * @param upper The upper bound. - * @returns Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - (lower: number): Clamp1x1; - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @category Number - * @param number The number to clamp. - * @param [lower] The lower bound. - * @param upper The upper bound. - * @returns Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - (lower: number, upper: number): Clamp1x2; - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @category Number - * @param number The number to clamp. - * @param [lower] The lower bound. - * @param upper The upper bound. - * @returns Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - (lower: number, upper: number, number: number): number; -} -interface Clamp1x1 { - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @category Number - * @param number The number to clamp. - * @param [lower] The lower bound. - * @param upper The upper bound. - * @returns Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - (): Clamp1x1; - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @category Number - * @param number The number to clamp. - * @param [lower] The lower bound. - * @param upper The upper bound. - * @returns Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - (upper: number): Clamp1x2; - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @category Number - * @param number The number to clamp. - * @param [lower] The lower bound. - * @param upper The upper bound. - * @returns Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - (upper: number, number: number): number; -} -interface Clamp1x2 { - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @category Number - * @param number The number to clamp. - * @param [lower] The lower bound. - * @param upper The upper bound. - * @returns Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - (): Clamp1x2; - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @category Number - * @param number The number to clamp. - * @param [lower] The lower bound. - * @param upper The upper bound. - * @returns Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - (number: number): number; -} - -declare const clamp: Clamp; +import { clamp } from "../fp"; export = clamp; diff --git a/types/lodash/fp/clone.d.ts b/types/lodash/fp/clone.d.ts index b6b00ae301..9edf0c8d13 100644 --- a/types/lodash/fp/clone.d.ts +++ b/types/lodash/fp/clone.d.ts @@ -1,20 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Clone = - /** - * Creates a shallow clone of value. - * - * Note: This method is loosely based on the structured clone algorithm and supports cloning arrays, - * array buffers, booleans, date objects, maps, numbers, Object objects, regexes, sets, strings, symbols, - * and typed arrays. The own enumerable properties of arguments objects are cloned as plain objects. An empty - * object is returned for uncloneable values such as error objects, functions, DOM nodes, and WeakMaps. - * - * @param value The value to clone. - * @return Returns the cloned value. - */ - (value: T) => T; - -declare const clone: Clone; +import { clone } from "../fp"; export = clone; diff --git a/types/lodash/fp/cloneDeep.d.ts b/types/lodash/fp/cloneDeep.d.ts index 85d7137e57..3bdab159ac 100644 --- a/types/lodash/fp/cloneDeep.d.ts +++ b/types/lodash/fp/cloneDeep.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type CloneDeep = - /** - * This method is like _.clone except that it recursively clones value. - * - * @param value The value to recursively clone. - * @return Returns the deep cloned value. - */ - (value: T) => T; - -declare const cloneDeep: CloneDeep; +import { cloneDeep } from "../fp"; export = cloneDeep; diff --git a/types/lodash/fp/cloneDeepWith.d.ts b/types/lodash/fp/cloneDeepWith.d.ts index caaeb278a7..57cf5af8bd 100644 --- a/types/lodash/fp/cloneDeepWith.d.ts +++ b/types/lodash/fp/cloneDeepWith.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface CloneDeepWith { - /** - * This method is like _.cloneWith except that it recursively clones value. - * - * @param value The value to recursively clone. - * @param customizer The function to customize cloning. - * @return Returns the deep cloned value. - */ - (): CloneDeepWith; - /** - * This method is like _.cloneWith except that it recursively clones value. - * - * @param value The value to recursively clone. - * @param customizer The function to customize cloning. - * @return Returns the deep cloned value. - */ - (customizer: _.CloneDeepWithCustomizer): CloneDeepWith1x1; - /** - * This method is like _.cloneWith except that it recursively clones value. - * - * @param value The value to recursively clone. - * @param customizer The function to customize cloning. - * @return Returns the deep cloned value. - */ - (customizer: _.CloneDeepWithCustomizer, value: T): any; -} -interface CloneDeepWith1x1 { - /** - * This method is like _.cloneWith except that it recursively clones value. - * - * @param value The value to recursively clone. - * @param customizer The function to customize cloning. - * @return Returns the deep cloned value. - */ - (): CloneDeepWith1x1; - /** - * This method is like _.cloneWith except that it recursively clones value. - * - * @param value The value to recursively clone. - * @param customizer The function to customize cloning. - * @return Returns the deep cloned value. - */ - (value: T): any; -} - -declare const cloneDeepWith: CloneDeepWith; +import { cloneDeepWith } from "../fp"; export = cloneDeepWith; diff --git a/types/lodash/fp/cloneWith.d.ts b/types/lodash/fp/cloneWith.d.ts index de29399631..9c63e13693 100644 --- a/types/lodash/fp/cloneWith.d.ts +++ b/types/lodash/fp/cloneWith.d.ts @@ -1,96 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface CloneWith { - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - (): CloneWith; - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - (customizer: _.CloneWithCustomizer): CloneWith1x1; - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - (customizer: _.CloneWithCustomizer, value: T): TResult; - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - (customizer: _.CloneWithCustomizer): CloneWith2x1; - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - (customizer: _.CloneWithCustomizer, value: T): TResult | T; -} -interface CloneWith1x1 { - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - (): CloneWith1x1; - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - (value: T): TResult; -} -interface CloneWith2x1 { - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - (): CloneWith2x1; - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - (value: T): TResult | T; -} - -declare const cloneWith: CloneWith; +import { cloneWith } from "../fp"; export = cloneWith; diff --git a/types/lodash/fp/compact.d.ts b/types/lodash/fp/compact.d.ts index 4b1c509117..6ca1547040 100644 --- a/types/lodash/fp/compact.d.ts +++ b/types/lodash/fp/compact.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Compact = - /** - * Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are - * falsey. - * - * @param array The array to compact. - * @return Returns the new array of filtered values. - */ - (array: _.List | null | undefined) => T[]; - -declare const compact: Compact; +import { compact } from "../fp"; export = compact; diff --git a/types/lodash/fp/complement.d.ts b/types/lodash/fp/complement.d.ts index 397bab4997..e4c3112534 100644 --- a/types/lodash/fp/complement.d.ts +++ b/types/lodash/fp/complement.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Negate = - /** - * 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. - */ - any>(predicate: T) => T; - -declare const complement: Negate; +import { complement } from "../fp"; export = complement; diff --git a/types/lodash/fp/compose.d.ts b/types/lodash/fp/compose.d.ts index 6d626496ae..7950c7c585 100644 --- a/types/lodash/fp/compose.d.ts +++ b/types/lodash/fp/compose.d.ts @@ -1,315 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FlowRight { - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: () => R1): () => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: any) => any, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array<_.Many<(...args: any[]) => any>>): (...args: any[]) => any; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (funcs: Array<_.Many<(...args: any[]) => any>>): (...args: any[]) => any; -} - -declare const compose: FlowRight; +import { compose } from "../fp"; export = compose; diff --git a/types/lodash/fp/concat.d.ts b/types/lodash/fp/concat.d.ts index a68dce878a..5e109d1daa 100644 --- a/types/lodash/fp/concat.d.ts +++ b/types/lodash/fp/concat.d.ts @@ -1,113 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Concat { - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @category Array - * @param array The array to concatenate. - * @param [values] The values to concatenate. - * @returns Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - (): Concat; - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @category Array - * @param array The array to concatenate. - * @param [values] The values to concatenate. - * @returns Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - (array: _.Many): Concat1x1; - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @category Array - * @param array The array to concatenate. - * @param [values] The values to concatenate. - * @returns Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - (array: _.Many, values: _.Many): T[]; -} -interface Concat1x1 { - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @category Array - * @param array The array to concatenate. - * @param [values] The values to concatenate. - * @returns Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - (): Concat1x1; - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @category Array - * @param array The array to concatenate. - * @param [values] The values to concatenate. - * @returns Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - (values: _.Many): T[]; -} - -declare const concat: Concat; +import { concat } from "../fp"; export = concat; diff --git a/types/lodash/fp/cond.d.ts b/types/lodash/fp/cond.d.ts index c5a18575a6..b9216e308f 100644 --- a/types/lodash/fp/cond.d.ts +++ b/types/lodash/fp/cond.d.ts @@ -1,38 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Cond = - /** - * Creates a function that iterates over `pairs` and invokes the corresponding - * function of the first predicate to return truthy. The predicate-function - * pairs are invoked with the `this` binding and arguments of the created - * function. - * - * @since 4.0.0 - * @category Util - * @param pairs The predicate-function pairs. - * @returns Returns the new composite function. - * @example - * - * var func = _.cond([ - * [_.matches({ 'a': 1 }), _.constant('matches A')], - * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], - * [_.stubTrue, _.constant('no match')] - * ]); - * - * func({ 'a': 1, 'b': 2 }); - * // => 'matches A' - * - * func({ 'a': 0, 'b': 1 }); - * // => 'matches B' - * - * func({ 'a': '1', 'b': '2' }); - * // => 'no match' - */ - (pairs: Array<_.CondPair>) => (Target: T) => R; - -declare const cond: Cond; +import { cond } from "../fp"; export = cond; diff --git a/types/lodash/fp/conforms.d.ts b/types/lodash/fp/conforms.d.ts index 6499cccf55..9bd3353f44 100644 --- a/types/lodash/fp/conforms.d.ts +++ b/types/lodash/fp/conforms.d.ts @@ -1,48 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ConformsTo { - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (): ConformsTo; - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (source: _.ConformsPredicateObject): ConformsTo1x1; - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (source: _.ConformsPredicateObject, object: T): boolean; -} -interface ConformsTo1x1 { - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (): ConformsTo1x1; - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (object: T): boolean; -} - -declare const conforms: ConformsTo; +import { conforms } from "../fp"; export = conforms; diff --git a/types/lodash/fp/conformsTo.d.ts b/types/lodash/fp/conformsTo.d.ts index 9512e4adf6..ad1728006d 100644 --- a/types/lodash/fp/conformsTo.d.ts +++ b/types/lodash/fp/conformsTo.d.ts @@ -1,48 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ConformsTo { - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (): ConformsTo; - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (source: _.ConformsPredicateObject): ConformsTo1x1; - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (source: _.ConformsPredicateObject, object: T): boolean; -} -interface ConformsTo1x1 { - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (): ConformsTo1x1; - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (object: T): boolean; -} - -declare const conformsTo: ConformsTo; +import { conformsTo } from "../fp"; export = conformsTo; diff --git a/types/lodash/fp/constant.d.ts b/types/lodash/fp/constant.d.ts index 718805e17f..ef80ff57c3 100644 --- a/types/lodash/fp/constant.d.ts +++ b/types/lodash/fp/constant.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Constant = - /** - * Creates a function that returns value. - * - * @param value The value to return from the new function. - * @return Returns the new function. - */ - (value: T) => () => T; - -declare const constant: Constant; +import { constant } from "../fp"; export = constant; diff --git a/types/lodash/fp/contains.d.ts b/types/lodash/fp/contains.d.ts index b80ca7f1fa..6c29e95f1a 100644 --- a/types/lodash/fp/contains.d.ts +++ b/types/lodash/fp/contains.d.ts @@ -1,63 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Includes { - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (): Includes; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (target: T): Includes1x1; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (target: T, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean; -} -interface Includes1x1 { - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (): Includes1x1; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean; -} - -declare const contains: Includes; +import { contains } from "../fp"; export = contains; diff --git a/types/lodash/fp/countBy.d.ts b/types/lodash/fp/countBy.d.ts index cca0ac3b02..e3725c3521 100644 --- a/types/lodash/fp/countBy.d.ts +++ b/types/lodash/fp/countBy.d.ts @@ -1,225 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface CountBy { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): CountBy; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: (value: string) => T): CountBy1x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: (value: string) => T, collection: string | null | undefined): _.Dictionary; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIteratee): CountBy2x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIteratee, collection: _.List | null | undefined): _.Dictionary; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIteratee, collection: T | null | undefined): _.Dictionary; -} -interface CountBy1x1 { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): CountBy1x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (collection: string | null | undefined): _.Dictionary; -} -interface CountBy2x1 { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): CountBy2x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (collection: _.List | object | null | undefined): _.Dictionary; -} - -declare const countBy: CountBy; +import { countBy } from "../fp"; export = countBy; diff --git a/types/lodash/fp/create.d.ts b/types/lodash/fp/create.d.ts index 6025931062..2818e10e8d 100644 --- a/types/lodash/fp/create.d.ts +++ b/types/lodash/fp/create.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Create = - /** - * Creates an object that inherits from the given prototype object. If a properties object is provided its own - * enumerable properties are assigned to the created object. - * - * @param prototype The object to inherit from. - * @param properties The properties to assign to the object. - * @return Returns the new object. - */ - (prototype: T) => T & U; - -declare const create: Create; +import { create } from "../fp"; export = create; diff --git a/types/lodash/fp/curry.d.ts b/types/lodash/fp/curry.d.ts index 6c946bbf67..e8fcf1ded7 100644 --- a/types/lodash/fp/curry.d.ts +++ b/types/lodash/fp/curry.d.ts @@ -1,65 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Curry { - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1) => R): _.CurriedFunction1; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2) => R): _.CurriedFunction2; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3) => R): _.CurriedFunction3; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): _.CurriedFunction4; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): _.CurriedFunction5; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (...args: any[]) => any): (...args: any[]) => any; -} - -declare const curry: Curry; +import { curry } from "../fp"; export = curry; diff --git a/types/lodash/fp/curryN.d.ts b/types/lodash/fp/curryN.d.ts index 4acbd81811..55b579b716 100644 --- a/types/lodash/fp/curryN.d.ts +++ b/types/lodash/fp/curryN.d.ts @@ -1,148 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Curry { - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (): Curry; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number): Curry1x1; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (t1: T1) => R): _.CurriedFunction1; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (t1: T1, t2: T2) => R): _.CurriedFunction2; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (t1: T1, t2: T2, t3: T3) => R): _.CurriedFunction3; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): _.CurriedFunction4; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): _.CurriedFunction5; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (...args: any[]) => any): (...args: any[]) => any; -} -interface Curry1x1 { - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (): Curry1x1; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1) => R): _.CurriedFunction1; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2) => R): _.CurriedFunction2; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3) => R): _.CurriedFunction3; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): _.CurriedFunction4; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): _.CurriedFunction5; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (...args: any[]) => any): (...args: any[]) => any; -} - -declare const curryN: Curry; +import { curryN } from "../fp"; export = curryN; diff --git a/types/lodash/fp/curryRight.d.ts b/types/lodash/fp/curryRight.d.ts index 5ff81e2004..d431f3c673 100644 --- a/types/lodash/fp/curryRight.d.ts +++ b/types/lodash/fp/curryRight.d.ts @@ -1,59 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface CurryRight { - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1) => R): _.RightCurriedFunction1; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2) => R): _.RightCurriedFunction2; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3) => R): _.RightCurriedFunction3; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): _.RightCurriedFunction4; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): _.RightCurriedFunction5; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (...args: any[]) => any): (...args: any[]) => any; -} - -declare const curryRight: CurryRight; +import { curryRight } from "../fp"; export = curryRight; diff --git a/types/lodash/fp/curryRightN.d.ts b/types/lodash/fp/curryRightN.d.ts index 98694df731..89866d16ae 100644 --- a/types/lodash/fp/curryRightN.d.ts +++ b/types/lodash/fp/curryRightN.d.ts @@ -1,133 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface CurryRight { - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (): CurryRight; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number): CurryRight1x1; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (t1: T1) => R): _.RightCurriedFunction1; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (t1: T1, t2: T2) => R): _.RightCurriedFunction2; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (t1: T1, t2: T2, t3: T3) => R): _.RightCurriedFunction3; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): _.RightCurriedFunction4; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): _.RightCurriedFunction5; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (arity: number, func: (...args: any[]) => any): (...args: any[]) => any; -} -interface CurryRight1x1 { - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (): CurryRight1x1; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1) => R): _.RightCurriedFunction1; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2) => R): _.RightCurriedFunction2; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3) => R): _.RightCurriedFunction3; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): _.RightCurriedFunction4; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): _.RightCurriedFunction5; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - (func: (...args: any[]) => any): (...args: any[]) => any; -} - -declare const curryRightN: CurryRight; +import { curryRightN } from "../fp"; export = curryRightN; diff --git a/types/lodash/fp/debounce.d.ts b/types/lodash/fp/debounce.d.ts index 6aa4ca891b..88b003cbb0 100644 --- a/types/lodash/fp/debounce.d.ts +++ b/types/lodash/fp/debounce.d.ts @@ -1,118 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Debounce { - /** - * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since - * the last time the debounced function was invoked. The debounced function comes with a cancel method to - * cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to - * indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent - * calls to the debounced function return the result of the last func invocation. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only - * if the the debounced function is invoked more than once during the wait timeout. - * - * See David Corbacho’s article for details over the differences between _.debounce and _.throttle. - * - * @param func The function to debounce. - * @param wait The number of milliseconds to delay. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.maxWait The maximum time func is allowed to be delayed before it’s invoked. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new debounced function. - */ - (): Debounce; - /** - * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since - * the last time the debounced function was invoked. The debounced function comes with a cancel method to - * cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to - * indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent - * calls to the debounced function return the result of the last func invocation. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only - * if the the debounced function is invoked more than once during the wait timeout. - * - * See David Corbacho’s article for details over the differences between _.debounce and _.throttle. - * - * @param func The function to debounce. - * @param wait The number of milliseconds to delay. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.maxWait The maximum time func is allowed to be delayed before it’s invoked. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new debounced function. - */ - (wait: number): Debounce1x1; - /** - * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since - * the last time the debounced function was invoked. The debounced function comes with a cancel method to - * cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to - * indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent - * calls to the debounced function return the result of the last func invocation. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only - * if the the debounced function is invoked more than once during the wait timeout. - * - * See David Corbacho’s article for details over the differences between _.debounce and _.throttle. - * - * @param func The function to debounce. - * @param wait The number of milliseconds to delay. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.maxWait The maximum time func is allowed to be delayed before it’s invoked. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new debounced function. - */ - any>(wait: number, func: T): T & _.Cancelable; -} -interface Debounce1x1 { - /** - * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since - * the last time the debounced function was invoked. The debounced function comes with a cancel method to - * cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to - * indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent - * calls to the debounced function return the result of the last func invocation. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only - * if the the debounced function is invoked more than once during the wait timeout. - * - * See David Corbacho’s article for details over the differences between _.debounce and _.throttle. - * - * @param func The function to debounce. - * @param wait The number of milliseconds to delay. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.maxWait The maximum time func is allowed to be delayed before it’s invoked. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new debounced function. - */ - (): Debounce1x1; - /** - * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since - * the last time the debounced function was invoked. The debounced function comes with a cancel method to - * cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to - * indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent - * calls to the debounced function return the result of the last func invocation. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only - * if the the debounced function is invoked more than once during the wait timeout. - * - * See David Corbacho’s article for details over the differences between _.debounce and _.throttle. - * - * @param func The function to debounce. - * @param wait The number of milliseconds to delay. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.maxWait The maximum time func is allowed to be delayed before it’s invoked. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new debounced function. - */ - any>(func: T): T & _.Cancelable; -} - -declare const debounce: Debounce; +import { debounce } from "../fp"; export = debounce; diff --git a/types/lodash/fp/deburr.d.ts b/types/lodash/fp/deburr.d.ts index 582ef58205..769abfb504 100644 --- a/types/lodash/fp/deburr.d.ts +++ b/types/lodash/fp/deburr.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Deburr = - /** - * Deburrs string by converting latin-1 supplementary letters to basic latin letters and removing combining - * diacritical marks. - * - * @param string The string to deburr. - * @return Returns the deburred string. - */ - (string: string) => string; - -declare const deburr: Deburr; +import { deburr } from "../fp"; export = deburr; diff --git a/types/lodash/fp/defaultTo.d.ts b/types/lodash/fp/defaultTo.d.ts index 2137ee3307..e02cc46fed 100644 --- a/types/lodash/fp/defaultTo.d.ts +++ b/types/lodash/fp/defaultTo.d.ts @@ -1,103 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface DefaultTo { - /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @param value The value to check. - * @param defaultValue The default value. - * @returns Returns the resolved value. - */ - (): DefaultTo; - /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @param value The value to check. - * @param defaultValue The default value. - * @returns Returns the resolved value. - */ - (defaultValue: T): DefaultTo1x1; - /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @param value The value to check. - * @param defaultValue The default value. - * @returns Returns the resolved value. - */ - (defaultValue: T, value: T | null | undefined): T; - /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @param value The value to check. - * @param defaultValue The default value. - * @returns Returns the resolved value. - */ - (defaultValue: TDefault): DefaultTo2x1; - /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @param value The value to check. - * @param defaultValue The default value. - * @returns Returns the resolved value. - */ - (defaultValue: TDefault, value: T | null | undefined): T | TDefault; -} -interface DefaultTo1x1 { - /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @param value The value to check. - * @param defaultValue The default value. - * @returns Returns the resolved value. - */ - (): DefaultTo1x1; - /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @param value The value to check. - * @param defaultValue The default value. - * @returns Returns the resolved value. - */ - (value: T | null | undefined): T; -} -interface DefaultTo2x1 { - /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @param value The value to check. - * @param defaultValue The default value. - * @returns Returns the resolved value. - */ - (): DefaultTo2x1; - /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @param value The value to check. - * @param defaultValue The default value. - * @returns Returns the resolved value. - */ - (value: T | null | undefined): T | TDefault; -} - -declare const defaultTo: DefaultTo; +import { defaultTo } from "../fp"; export = defaultTo; diff --git a/types/lodash/fp/defaults.d.ts b/types/lodash/fp/defaults.d.ts index 306534d374..132e47ba2e 100644 --- a/types/lodash/fp/defaults.d.ts +++ b/types/lodash/fp/defaults.d.ts @@ -1,71 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Defaults { - /** - * Assigns own enumerable properties of source object(s) to the destination object for all destination - * properties that resolve to undefined. Once a property is set, additional values of the same property are - * ignored. - * - * Note: This method mutates object. - * - * @param object The destination object. - * @param sources The source objects. - * @return The destination object. - */ - (): Defaults; - /** - * Assigns own enumerable properties of source object(s) to the destination object for all destination - * properties that resolve to undefined. Once a property is set, additional values of the same property are - * ignored. - * - * Note: This method mutates object. - * - * @param object The destination object. - * @param sources The source objects. - * @return The destination object. - */ - (source: TSource): Defaults1x1; - /** - * Assigns own enumerable properties of source object(s) to the destination object for all destination - * properties that resolve to undefined. Once a property is set, additional values of the same property are - * ignored. - * - * Note: This method mutates object. - * - * @param object The destination object. - * @param sources The source objects. - * @return The destination object. - */ - (source: TSource, object: TObject): TSource & TObject; -} -interface Defaults1x1 { - /** - * Assigns own enumerable properties of source object(s) to the destination object for all destination - * properties that resolve to undefined. Once a property is set, additional values of the same property are - * ignored. - * - * Note: This method mutates object. - * - * @param object The destination object. - * @param sources The source objects. - * @return The destination object. - */ - (): Defaults1x1; - /** - * Assigns own enumerable properties of source object(s) to the destination object for all destination - * properties that resolve to undefined. Once a property is set, additional values of the same property are - * ignored. - * - * Note: This method mutates object. - * - * @param object The destination object. - * @param sources The source objects. - * @return The destination object. - */ - (object: TObject): TSource & TObject; -} - -declare const defaults: Defaults; +import { defaults } from "../fp"; export = defaults; diff --git a/types/lodash/fp/defaultsAll.d.ts b/types/lodash/fp/defaultsAll.d.ts index 371f6db282..1f2a3309e7 100644 --- a/types/lodash/fp/defaultsAll.d.ts +++ b/types/lodash/fp/defaultsAll.d.ts @@ -1,20 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Defaults = - /** - * Assigns own enumerable properties of source object(s) to the destination object for all destination - * properties that resolve to undefined. Once a property is set, additional values of the same property are - * ignored. - * - * Note: This method mutates object. - * - * @param object The destination object. - * @param sources The source objects. - * @return The destination object. - */ - (object: ReadonlyArray) => any; - -declare const defaultsAll: Defaults; +import { defaultsAll } from "../fp"; export = defaultsAll; diff --git a/types/lodash/fp/defaultsDeep.d.ts b/types/lodash/fp/defaultsDeep.d.ts index 86eace1bb9..6268a02594 100644 --- a/types/lodash/fp/defaultsDeep.d.ts +++ b/types/lodash/fp/defaultsDeep.d.ts @@ -1,46 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface DefaultsDeep { - /** - * This method is like _.defaults except that it recursively assigns default properties. - * @param object The destination object. - * @param sources The source objects. - * @return Returns object. - **/ - (): DefaultsDeep; - /** - * This method is like _.defaults except that it recursively assigns default properties. - * @param object The destination object. - * @param sources The source objects. - * @return Returns object. - **/ - (sources: any): DefaultsDeep1x1; - /** - * This method is like _.defaults except that it recursively assigns default properties. - * @param object The destination object. - * @param sources The source objects. - * @return Returns object. - **/ - (sources: any, object: any): any; -} -interface DefaultsDeep1x1 { - /** - * This method is like _.defaults except that it recursively assigns default properties. - * @param object The destination object. - * @param sources The source objects. - * @return Returns object. - **/ - (): DefaultsDeep1x1; - /** - * This method is like _.defaults except that it recursively assigns default properties. - * @param object The destination object. - * @param sources The source objects. - * @return Returns object. - **/ - (object: any): any; -} - -declare const defaultsDeep: DefaultsDeep; +import { defaultsDeep } from "../fp"; export = defaultsDeep; diff --git a/types/lodash/fp/defaultsDeepAll.d.ts b/types/lodash/fp/defaultsDeepAll.d.ts index cb6157662d..7791666232 100644 --- a/types/lodash/fp/defaultsDeepAll.d.ts +++ b/types/lodash/fp/defaultsDeepAll.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type DefaultsDeep = - /** - * This method is like _.defaults except that it recursively assigns default properties. - * @param object The destination object. - * @param sources The source objects. - * @return Returns object. - **/ - (object: ReadonlyArray) => any; - -declare const defaultsDeepAll: DefaultsDeep; +import { defaultsDeepAll } from "../fp"; export = defaultsDeepAll; diff --git a/types/lodash/fp/defer.d.ts b/types/lodash/fp/defer.d.ts index a9bab80092..f8be4ae8e2 100644 --- a/types/lodash/fp/defer.d.ts +++ b/types/lodash/fp/defer.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Defer = - /** - * Defers invoking the func until the current call stack has cleared. Any additional arguments are provided to - * func when it’s invoked. - * - * @param func The function to defer. - * @param args The arguments to invoke the function with. - * @return Returns the timer id. - */ - (func: (...args: any[]) => any, ...args: any[]) => number; - -declare const defer: Defer; +import { defer } from "../fp"; export = defer; diff --git a/types/lodash/fp/delay.d.ts b/types/lodash/fp/delay.d.ts index 8709a9c0e2..2f0c39909f 100644 --- a/types/lodash/fp/delay.d.ts +++ b/types/lodash/fp/delay.d.ts @@ -1,56 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Delay { - /** - * Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked. - * - * @param func The function to delay. - * @param wait The number of milliseconds to delay invocation. - * @param args The arguments to invoke the function with. - * @return Returns the timer id. - */ - (): Delay; - /** - * Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked. - * - * @param func The function to delay. - * @param wait The number of milliseconds to delay invocation. - * @param args The arguments to invoke the function with. - * @return Returns the timer id. - */ - (wait: number): Delay1x1; - /** - * Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked. - * - * @param func The function to delay. - * @param wait The number of milliseconds to delay invocation. - * @param args The arguments to invoke the function with. - * @return Returns the timer id. - */ - (wait: number, func: (...args: any[]) => any): number; -} -interface Delay1x1 { - /** - * Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked. - * - * @param func The function to delay. - * @param wait The number of milliseconds to delay invocation. - * @param args The arguments to invoke the function with. - * @return Returns the timer id. - */ - (): Delay1x1; - /** - * Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked. - * - * @param func The function to delay. - * @param wait The number of milliseconds to delay invocation. - * @param args The arguments to invoke the function with. - * @return Returns the timer id. - */ - (func: (...args: any[]) => any): number; -} - -declare const delay: Delay; +import { delay } from "../fp"; export = delay; diff --git a/types/lodash/fp/difference.d.ts b/types/lodash/fp/difference.d.ts index 774539bba7..9448085041 100644 --- a/types/lodash/fp/difference.d.ts +++ b/types/lodash/fp/difference.d.ts @@ -1,58 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Difference { - /** - * Creates an array of unique array values not included in the other provided arrays using SameValueZero for - * equality comparisons. - * - * @param array The array to inspect. - * @param values The arrays of values to exclude. - * @return Returns the new array of filtered values. - */ - (): Difference; - /** - * Creates an array of unique array values not included in the other provided arrays using SameValueZero for - * equality comparisons. - * - * @param array The array to inspect. - * @param values The arrays of values to exclude. - * @return Returns the new array of filtered values. - */ - (array: _.List | null | undefined): Difference1x1; - /** - * Creates an array of unique array values not included in the other provided arrays using SameValueZero for - * equality comparisons. - * - * @param array The array to inspect. - * @param values The arrays of values to exclude. - * @return Returns the new array of filtered values. - */ - (array: _.List | null | undefined, values: _.List): T[]; -} -interface Difference1x1 { - /** - * Creates an array of unique array values not included in the other provided arrays using SameValueZero for - * equality comparisons. - * - * @param array The array to inspect. - * @param values The arrays of values to exclude. - * @return Returns the new array of filtered values. - */ - (): Difference1x1; - /** - * Creates an array of unique array values not included in the other provided arrays using SameValueZero for - * equality comparisons. - * - * @param array The array to inspect. - * @param values The arrays of values to exclude. - * @return Returns the new array of filtered values. - */ - (values: _.List): T[]; -} - -declare const difference: Difference; +import { difference } from "../fp"; export = difference; diff --git a/types/lodash/fp/differenceBy.d.ts b/types/lodash/fp/differenceBy.d.ts index 64975c1b17..52ba5b80ac 100644 --- a/types/lodash/fp/differenceBy.d.ts +++ b/types/lodash/fp/differenceBy.d.ts @@ -1,114 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface DifferenceBy { - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - (): DifferenceBy; - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - (iteratee: _.ValueIteratee): DifferenceBy1x1; - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - (iteratee: _.ValueIteratee, array: _.List | null | undefined): DifferenceBy1x2; - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - (iteratee: _.ValueIteratee, array: _.List | null | undefined, values: _.List): T1[]; -} -interface DifferenceBy1x1 { - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - (): DifferenceBy1x1; - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - (array: _.List | null | undefined): DifferenceBy1x2; - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - (array: _.List | null | undefined, values: _.List): T1[]; -} -interface DifferenceBy1x2 { - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - (): DifferenceBy1x2; - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - (values: _.List): T1[]; -} - -declare const differenceBy: DifferenceBy; +import { differenceBy } from "../fp"; export = differenceBy; diff --git a/types/lodash/fp/differenceWith.d.ts b/types/lodash/fp/differenceWith.d.ts index 2ef1961ff7..fd3c9a2cd4 100644 --- a/types/lodash/fp/differenceWith.d.ts +++ b/types/lodash/fp/differenceWith.d.ts @@ -1,168 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface DifferenceWith { - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - (): DifferenceWith; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - (comparator: _.Comparator2): DifferenceWith1x1; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - (comparator: _.Comparator2, array: _.List | null | undefined): DifferenceWith1x2; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - (comparator: _.Comparator2, array: _.List | null | undefined, values: _.List): T1[]; -} -interface DifferenceWith1x1 { - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - (): DifferenceWith1x1; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - (array: _.List | null | undefined): DifferenceWith1x2; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - (array: _.List | null | undefined, values: _.List): T1[]; -} -interface DifferenceWith1x2 { - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - (): DifferenceWith1x2; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - (values: _.List): T1[]; -} - -declare const differenceWith: DifferenceWith; +import { differenceWith } from "../fp"; export = differenceWith; diff --git a/types/lodash/fp/dissoc.d.ts b/types/lodash/fp/dissoc.d.ts index ad931b90da..9b0fd6bb90 100644 --- a/types/lodash/fp/dissoc.d.ts +++ b/types/lodash/fp/dissoc.d.ts @@ -1,63 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Unset { - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (): Unset; - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (path: _.PropertyPath): Unset1x1; - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (path: _.PropertyPath, object: any): boolean; -} -interface Unset1x1 { - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (): Unset1x1; - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (object: any): boolean; -} - -declare const dissoc: Unset; +import { dissoc } from "../fp"; export = dissoc; diff --git a/types/lodash/fp/dissocPath.d.ts b/types/lodash/fp/dissocPath.d.ts index 8d98858a6c..a201aa4b88 100644 --- a/types/lodash/fp/dissocPath.d.ts +++ b/types/lodash/fp/dissocPath.d.ts @@ -1,63 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Unset { - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (): Unset; - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (path: _.PropertyPath): Unset1x1; - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (path: _.PropertyPath, object: any): boolean; -} -interface Unset1x1 { - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (): Unset1x1; - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (object: any): boolean; -} - -declare const dissocPath: Unset; +import { dissocPath } from "../fp"; export = dissocPath; diff --git a/types/lodash/fp/divide.d.ts b/types/lodash/fp/divide.d.ts index 293acebb68..5cd02e49dc 100644 --- a/types/lodash/fp/divide.d.ts +++ b/types/lodash/fp/divide.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Divide { - /** - * Divide two numbers. - * - * @param dividend The first number in a division. - * @param divisor The second number in a division. - * @returns Returns the quotient. - */ - (): Divide; - /** - * Divide two numbers. - * - * @param dividend The first number in a division. - * @param divisor The second number in a division. - * @returns Returns the quotient. - */ - (dividend: number): Divide1x1; - /** - * Divide two numbers. - * - * @param dividend The first number in a division. - * @param divisor The second number in a division. - * @returns Returns the quotient. - */ - (dividend: number, divisor: number): number; -} -interface Divide1x1 { - /** - * Divide two numbers. - * - * @param dividend The first number in a division. - * @param divisor The second number in a division. - * @returns Returns the quotient. - */ - (): Divide1x1; - /** - * Divide two numbers. - * - * @param dividend The first number in a division. - * @param divisor The second number in a division. - * @returns Returns the quotient. - */ - (divisor: number): number; -} - -declare const divide: Divide; +import { divide } from "../fp"; export = divide; diff --git a/types/lodash/fp/drop.d.ts b/types/lodash/fp/drop.d.ts index 3c524f1321..bc3b9b2049 100644 --- a/types/lodash/fp/drop.d.ts +++ b/types/lodash/fp/drop.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Drop { - /** - * Creates a slice of array with n elements dropped from the beginning. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (): Drop; - /** - * Creates a slice of array with n elements dropped from the beginning. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (n: number): Drop1x1; - /** - * Creates a slice of array with n elements dropped from the beginning. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (n: number, array: _.List | null | undefined): T[]; -} -interface Drop1x1 { - /** - * Creates a slice of array with n elements dropped from the beginning. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (): Drop1x1; - /** - * Creates a slice of array with n elements dropped from the beginning. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const drop: Drop; +import { drop } from "../fp"; export = drop; diff --git a/types/lodash/fp/dropLast.d.ts b/types/lodash/fp/dropLast.d.ts index e0fb5db69e..1dd388ae15 100644 --- a/types/lodash/fp/dropLast.d.ts +++ b/types/lodash/fp/dropLast.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface DropRight { - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (): DropRight; - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (n: number): DropRight1x1; - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (n: number, array: _.List | null | undefined): T[]; -} -interface DropRight1x1 { - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (): DropRight1x1; - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const dropLast: DropRight; +import { dropLast } from "../fp"; export = dropLast; diff --git a/types/lodash/fp/dropLastWhile.d.ts b/types/lodash/fp/dropLastWhile.d.ts index 3d0d5634ef..97529a6a49 100644 --- a/types/lodash/fp/dropLastWhile.d.ts +++ b/types/lodash/fp/dropLastWhile.d.ts @@ -1,108 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface DropRightWhile { - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): DropRightWhile; - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee): DropRightWhile1x1; - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee, array: _.List | null | undefined): T[]; -} -interface DropRightWhile1x1 { - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): DropRightWhile1x1; - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const dropLastWhile: DropRightWhile; +import { dropLastWhile } from "../fp"; export = dropLastWhile; diff --git a/types/lodash/fp/dropRight.d.ts b/types/lodash/fp/dropRight.d.ts index 4c07c3c8a5..a2740ff029 100644 --- a/types/lodash/fp/dropRight.d.ts +++ b/types/lodash/fp/dropRight.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface DropRight { - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (): DropRight; - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (n: number): DropRight1x1; - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (n: number, array: _.List | null | undefined): T[]; -} -interface DropRight1x1 { - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (): DropRight1x1; - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const dropRight: DropRight; +import { dropRight } from "../fp"; export = dropRight; diff --git a/types/lodash/fp/dropRightWhile.d.ts b/types/lodash/fp/dropRightWhile.d.ts index e346a77e97..1a5aa5fe3e 100644 --- a/types/lodash/fp/dropRightWhile.d.ts +++ b/types/lodash/fp/dropRightWhile.d.ts @@ -1,108 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface DropRightWhile { - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): DropRightWhile; - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee): DropRightWhile1x1; - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee, array: _.List | null | undefined): T[]; -} -interface DropRightWhile1x1 { - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): DropRightWhile1x1; - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const dropRightWhile: DropRightWhile; +import { dropRightWhile } from "../fp"; export = dropRightWhile; diff --git a/types/lodash/fp/dropWhile.d.ts b/types/lodash/fp/dropWhile.d.ts index 056a06bc3e..2cab8d8698 100644 --- a/types/lodash/fp/dropWhile.d.ts +++ b/types/lodash/fp/dropWhile.d.ts @@ -1,108 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface DropWhile { - /** - * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): DropWhile; - /** - * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee): DropWhile1x1; - /** - * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee, array: _.List | null | undefined): T[]; -} -interface DropWhile1x1 { - /** - * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): DropWhile1x1; - /** - * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const dropWhile: DropWhile; +import { dropWhile } from "../fp"; export = dropWhile; diff --git a/types/lodash/fp/each.d.ts b/types/lodash/fp/each.d.ts index df0afae30f..af1d3b20a6 100644 --- a/types/lodash/fp/each.d.ts +++ b/types/lodash/fp/each.d.ts @@ -1,330 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ForEach { - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (): ForEach; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T) => any): ForEach1x1; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T) => any, collection: ReadonlyArray): T[]; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: string) => any): ForEach2x1; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: string) => any, collection: string): string; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T) => any, collection: _.List): _.List; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T[keyof T]) => any, collection: T): T; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T) => any, collection: TArray & (T[] | null | undefined)): TArray; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: string) => any, collection: TString): TString; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - | null | undefined>(iteratee: (value: T) => any, collection: TList & (_.List | null | undefined)): TList; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T[keyof T]) => any, collection: T | null | undefined): T | null | undefined; -} -interface ForEach1x1 { - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (): ForEach1x1; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: ReadonlyArray): T[]; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: _.List): _.List; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: T1): T1; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: TArray & (T[] | null | undefined)): TArray; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - | null | undefined>(collection: TList & (_.List | null | undefined)): TList; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: T1 | null | undefined): T1 | null | undefined; -} -interface ForEach2x1 { - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (): ForEach2x1; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: string): string; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: TString): TString; -} - -declare const each: ForEach; +import { each } from "../fp"; export = each; diff --git a/types/lodash/fp/eachRight.d.ts b/types/lodash/fp/eachRight.d.ts index 06af73ca68..5ca2934abd 100644 --- a/types/lodash/fp/eachRight.d.ts +++ b/types/lodash/fp/eachRight.d.ts @@ -1,225 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ForEachRight { - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (): ForEachRight; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T) => any): ForEachRight1x1; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T) => any, collection: ReadonlyArray): T[]; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: string) => any): ForEachRight2x1; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: string) => any, collection: string): string; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T) => any, collection: _.List): _.List; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T[keyof T]) => any, collection: T): T; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T) => any, collection: TArray & (T[] | null | undefined)): TArray; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: string) => any, collection: TString): TString; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - | null | undefined>(iteratee: (value: T) => any, collection: TList & (_.List | null | undefined)): TList; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T[keyof T]) => any, collection: T | null | undefined): T | null | undefined; -} -interface ForEachRight1x1 { - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (): ForEachRight1x1; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: ReadonlyArray): T[]; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: _.List): _.List; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: T1): T1; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: TArray & (T[] | null | undefined)): TArray; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - | null | undefined>(collection: TList & (_.List | null | undefined)): TList; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: T1 | null | undefined): T1 | null | undefined; -} -interface ForEachRight2x1 { - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (): ForEachRight2x1; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: string): string; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: TString): TString; -} - -declare const eachRight: ForEachRight; +import { eachRight } from "../fp"; export = eachRight; diff --git a/types/lodash/fp/endsWith.d.ts b/types/lodash/fp/endsWith.d.ts index 5808870c50..7e1b243d6f 100644 --- a/types/lodash/fp/endsWith.d.ts +++ b/types/lodash/fp/endsWith.d.ts @@ -1,56 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface EndsWith { - /** - * Checks if string ends with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string ends with target, else false. - */ - (): EndsWith; - /** - * Checks if string ends with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string ends with target, else false. - */ - (target: string): EndsWith1x1; - /** - * Checks if string ends with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string ends with target, else false. - */ - (target: string, string: string): boolean; -} -interface EndsWith1x1 { - /** - * Checks if string ends with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string ends with target, else false. - */ - (): EndsWith1x1; - /** - * Checks if string ends with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string ends with target, else false. - */ - (string: string): boolean; -} - -declare const endsWith: EndsWith; +import { endsWith } from "../fp"; export = endsWith; diff --git a/types/lodash/fp/entries.d.ts b/types/lodash/fp/entries.d.ts index 99b04076c7..534c7bda3d 100644 --- a/types/lodash/fp/entries.d.ts +++ b/types/lodash/fp/entries.d.ts @@ -1,25 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ToPairs { - /** - * Creates an array of own enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - (object: _.Dictionary | _.NumericDictionary): Array<[string, T]>; - /** - * Creates an array of own enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - (object: object): Array<[string, any]>; -} - -declare const entries: ToPairs; +import { entries } from "../fp"; export = entries; diff --git a/types/lodash/fp/entriesIn.d.ts b/types/lodash/fp/entriesIn.d.ts index 3579959f84..932b17f625 100644 --- a/types/lodash/fp/entriesIn.d.ts +++ b/types/lodash/fp/entriesIn.d.ts @@ -1,25 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ToPairsIn { - /** - * Creates an array of own and inherited enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - (object: _.Dictionary | _.NumericDictionary): Array<[string, T]>; - /** - * Creates an array of own and inherited enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - (object: object): Array<[string, any]>; -} - -declare const entriesIn: ToPairsIn; +import { entriesIn } from "../fp"; export = entriesIn; diff --git a/types/lodash/fp/eq.d.ts b/types/lodash/fp/eq.d.ts index 4c3278ae3d..4778846a30 100644 --- a/types/lodash/fp/eq.d.ts +++ b/types/lodash/fp/eq.d.ts @@ -1,156 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Eq { - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - (): Eq; - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - (value: any): Eq1x1; - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - (value: any, other: any): boolean; -} -interface Eq1x1 { - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - (): Eq1x1; - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - (other: any): boolean; -} - -declare const eq: Eq; +import { eq } from "../fp"; export = eq; diff --git a/types/lodash/fp/equals.d.ts b/types/lodash/fp/equals.d.ts index 3e3f9b1853..18ec108d66 100644 --- a/types/lodash/fp/equals.d.ts +++ b/types/lodash/fp/equals.d.ts @@ -1,141 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface IsEqual { - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - (): IsEqual; - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - (value: any): IsEqual1x1; - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - (value: any, other: any): boolean; -} -interface IsEqual1x1 { - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - (): IsEqual1x1; - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - (other: any): boolean; -} - -declare const equals: IsEqual; +import { equals } from "../fp"; export = equals; diff --git a/types/lodash/fp/escape.d.ts b/types/lodash/fp/escape.d.ts index 18f704928d..36e7e87556 100644 --- a/types/lodash/fp/escape.d.ts +++ b/types/lodash/fp/escape.d.ts @@ -1,26 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Escape = - /** - * Converts the characters "&", "<", ">", '"', "'", and "`" in string to their corresponding HTML entities. - * - * Note: No other characters are escaped. To escape additional characters use a third-party library like he. - * - * hough the ">" character is escaped for symmetry, characters like ">" and "/" don’t need escaping in HTML - * and have no special meaning unless they're part of a tag or unquoted attribute value. See Mathias Bynens’s - * article (under "semi-related fun fact") for more details. - * - * Backticks are escaped because in IE < 9, they can break out of attribute values or HTML comments. See #59, - * #102, #108, and #133 of the HTML5 Security Cheatsheet for more details. - * - * When working with HTML you should always quote attribute values to reduce XSS vectors. - * - * @param string The string to escape. - * @return Returns the escaped string. - */ - (string: string) => string; - -declare const escape: Escape; +import { escape } from "../fp"; export = escape; diff --git a/types/lodash/fp/escapeRegExp.d.ts b/types/lodash/fp/escapeRegExp.d.ts index f66fa150c8..6adc20e806 100644 --- a/types/lodash/fp/escapeRegExp.d.ts +++ b/types/lodash/fp/escapeRegExp.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type EscapeRegExp = - /** - * Escapes the RegExp special characters "^", "$", "\", ".", "*", "+", "?", "(", ")", "[", "]", - * "{", "}", and "|" in string. - * - * @param string The string to escape. - * @return Returns the escaped string. - */ - (string: string) => string; - -declare const escapeRegExp: EscapeRegExp; +import { escapeRegExp } from "../fp"; export = escapeRegExp; diff --git a/types/lodash/fp/every.d.ts b/types/lodash/fp/every.d.ts index fc60615c96..7fbeaf7b15 100644 --- a/types/lodash/fp/every.d.ts +++ b/types/lodash/fp/every.d.ts @@ -1,67 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Every { - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (): Every; - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom): Every1x1; - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom, collection: _.List | null | undefined): boolean; - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom, collection: T | null | undefined): boolean; -} -interface Every1x1 { - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (): Every1x1; - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - (collection: _.List | object | null | undefined): boolean; -} - -declare const every: Every; +import { every } from "../fp"; export = every; diff --git a/types/lodash/fp/extend.d.ts b/types/lodash/fp/extend.d.ts index ee0889f8ae..cbe294ee0b 100644 --- a/types/lodash/fp/extend.d.ts +++ b/types/lodash/fp/extend.d.ts @@ -1,151 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface AssignIn { - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (): AssignIn; - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (object: TObject): AssignIn1x1; - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (object: TObject, source: TSource): TObject & TSource; -} -interface AssignIn1x1 { - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (): AssignIn1x1; - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (source: TSource): TObject & TSource; -} - -declare const extend: AssignIn; +import { extend } from "../fp"; export = extend; diff --git a/types/lodash/fp/extendAll.d.ts b/types/lodash/fp/extendAll.d.ts index a8168d774d..92cb3d6e0c 100644 --- a/types/lodash/fp/extendAll.d.ts +++ b/types/lodash/fp/extendAll.d.ts @@ -1,36 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type AssignIn = - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - (object: ReadonlyArray) => TResult; - -declare const extendAll: AssignIn; +import { extendAll } from "../fp"; export = extendAll; diff --git a/types/lodash/fp/extendAllWith.d.ts b/types/lodash/fp/extendAllWith.d.ts index 6e2d7602d3..712d1d8eea 100644 --- a/types/lodash/fp/extendAllWith.d.ts +++ b/types/lodash/fp/extendAllWith.d.ts @@ -1,143 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface AssignInWith { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignInWith; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer): AssignInWith1x1; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer, args: ReadonlyArray): any; -} -interface AssignInWith1x1 { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignInWith1x1; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (args: ReadonlyArray): any; -} - -declare const extendAllWith: AssignInWith; +import { extendAllWith } from "../fp"; export = extendAllWith; diff --git a/types/lodash/fp/extendWith.d.ts b/types/lodash/fp/extendWith.d.ts index 39b50e9ebf..9681360bbf 100644 --- a/types/lodash/fp/extendWith.d.ts +++ b/types/lodash/fp/extendWith.d.ts @@ -1,249 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface AssignInWith { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignInWith; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer): AssignInWith1x1; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer, object: TObject): AssignInWith1x2; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (customizer: _.AssignCustomizer, object: TObject, source: TSource): TObject & TSource; -} -interface AssignInWith1x1 { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignInWith1x1; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (object: TObject): AssignInWith1x2; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (object: TObject, source: TSource): TObject & TSource; -} -interface AssignInWith1x2 { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (): AssignInWith1x2; - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - (source: TSource): TObject & TSource; -} - -declare const extendWith: AssignInWith; +import { extendWith } from "../fp"; export = extendWith; diff --git a/types/lodash/fp/fill.d.ts b/types/lodash/fp/fill.d.ts index 5349e8e067..577801504d 100644 --- a/types/lodash/fp/fill.d.ts +++ b/types/lodash/fp/fill.d.ts @@ -1,233 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Fill { - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (): Fill; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (start: number): Fill1x1; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (start: number, end: number): Fill1x2; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (start: number, end: number, value: T): Fill1x3; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (start: number, end: number, value: T, array: U[] | null | undefined): Array; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (start: number, end: number, value: T, array: _.List | null | undefined): _.List; -} -interface Fill1x1 { - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (): Fill1x1; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (end: number): Fill1x2; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (end: number, value: T): Fill1x3; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (end: number, value: T, array: U[] | null | undefined): Array; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (end: number, value: T, array: _.List | null | undefined): _.List; -} -interface Fill1x2 { - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (): Fill1x2; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (value: T): Fill1x3; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (value: T, array: U[] | null | undefined): Array; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (value: T, array: _.List | null | undefined): _.List; -} -interface Fill1x3 { - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (): Fill1x3; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (array: U[] | null | undefined): Array; - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - (array: _.List | null | undefined): _.List; -} - -declare const fill: Fill; +import { fill } from "../fp"; export = fill; diff --git a/types/lodash/fp/filter.d.ts b/types/lodash/fp/filter.d.ts index 289c0edcd5..8619741343 100644 --- a/types/lodash/fp/filter.d.ts +++ b/types/lodash/fp/filter.d.ts @@ -1,361 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Filter { - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (): Filter; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: (value: string) => boolean): Filter1x1; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: (value: string) => boolean, collection: string | null | undefined): string[]; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: _.ValueIteratorTypeGuard): Filter2x1; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: _.ValueIteratorTypeGuard, collection: _.List | null | undefined): S[]; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: _.ValueIterateeCustom): Filter3x1; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: _.ValueIterateeCustom, collection: _.List | null | undefined): T[]; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: _.ValueIteratorTypeGuard): Filter4x1; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: _.ValueIteratorTypeGuard, collection: T | null | undefined): S[]; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: _.ValueIterateeCustom, collection: T | null | undefined): Array; -} -interface Filter1x1 { - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (): Filter1x1; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (collection: string | null | undefined): string[]; -} -interface Filter2x1 { - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (): Filter2x1; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (collection: _.List | null | undefined): S[]; -} -interface Filter3x1 { - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (): Filter3x1; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (collection: _.List | object | null | undefined): T[]; -} -interface Filter4x1 { - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (): Filter4x1; - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (collection: T | null | undefined): S[]; -} - -declare const filter: Filter; +import { filter } from "../fp"; export = filter; diff --git a/types/lodash/fp/find.d.ts b/types/lodash/fp/find.d.ts index d562ef3894..06418fb456 100644 --- a/types/lodash/fp/find.d.ts +++ b/types/lodash/fp/find.d.ts @@ -1,283 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Find { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard): Find1x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, collection: _.List | null | undefined): S|undefined; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIterateeCustom): Find2x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIterateeCustom, collection: _.List | null | undefined): T|undefined; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard): Find3x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, collection: T | null | undefined): S|undefined; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIterateeCustom, collection: T | null | undefined): T[keyof T]|undefined; -} -interface Find1x1 { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find1x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (collection: _.List | null | undefined): S|undefined; -} -interface Find2x1 { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find2x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (collection: _.List | object | null | undefined): T|undefined; -} -interface Find3x1 { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find3x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (collection: T | null | undefined): S|undefined; -} - -declare const find: Find; +import { find } from "../fp"; export = find; diff --git a/types/lodash/fp/findFrom.d.ts b/types/lodash/fp/findFrom.d.ts index c2c83b5644..64275d0c83 100644 --- a/types/lodash/fp/findFrom.d.ts +++ b/types/lodash/fp/findFrom.d.ts @@ -1,517 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Find { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard): Find1x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, fromIndex: number): Find1x2; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, fromIndex: number, collection: _.List | null | undefined): S|undefined; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIterateeCustom): Find2x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIterateeCustom, fromIndex: number): Find2x2; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIterateeCustom, fromIndex: number, collection: _.List | null | undefined): T|undefined; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard): Find3x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, fromIndex: number): Find3x2; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, fromIndex: number, collection: T | null | undefined): S|undefined; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (predicate: _.ValueIterateeCustom, fromIndex: number, collection: T | null | undefined): T[keyof T]|undefined; -} -interface Find1x1 { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find1x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (fromIndex: number): Find1x2; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (fromIndex: number, collection: _.List | null | undefined): S|undefined; -} -interface Find1x2 { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find1x2; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (collection: _.List | null | undefined): S|undefined; -} -interface Find2x1 { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find2x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (fromIndex: number): Find2x2; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (fromIndex: number, collection: _.List | object | null | undefined): T|undefined; -} -interface Find2x2 { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find2x2; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (collection: _.List | object | null | undefined): T|undefined; -} -interface Find3x1 { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find3x1; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (fromIndex: number): Find3x2; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (fromIndex: number, collection: T | null | undefined): S|undefined; -} -interface Find3x2 { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (): Find3x2; - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - (collection: T | null | undefined): S|undefined; -} - -declare const findFrom: Find; +import { findFrom } from "../fp"; export = findFrom; diff --git a/types/lodash/fp/findIndex.d.ts b/types/lodash/fp/findIndex.d.ts index 18842b2513..77d1f7b6be 100644 --- a/types/lodash/fp/findIndex.d.ts +++ b/types/lodash/fp/findIndex.d.ts @@ -1,108 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FindIndex { - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (): FindIndex; - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (predicate: _.ValueIterateeCustom): FindIndex1x1; - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (predicate: _.ValueIterateeCustom, array: _.List | null | undefined): number; -} -interface FindIndex1x1 { - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (): FindIndex1x1; - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (array: _.List | null | undefined): number; -} - -declare const findIndex: FindIndex; +import { findIndex } from "../fp"; export = findIndex; diff --git a/types/lodash/fp/findIndexFrom.d.ts b/types/lodash/fp/findIndexFrom.d.ts index fbc5f7bac1..22330adc53 100644 --- a/types/lodash/fp/findIndexFrom.d.ts +++ b/types/lodash/fp/findIndexFrom.d.ts @@ -1,186 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FindIndex { - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (): FindIndex; - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (predicate: _.ValueIterateeCustom): FindIndex1x1; - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (predicate: _.ValueIterateeCustom, fromIndex: number): FindIndex1x2; - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (predicate: _.ValueIterateeCustom, fromIndex: number, array: _.List | null | undefined): number; -} -interface FindIndex1x1 { - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (): FindIndex1x1; - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (fromIndex: number): FindIndex1x2; - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (fromIndex: number, array: _.List | null | undefined): number; -} -interface FindIndex1x2 { - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (): FindIndex1x2; - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (array: _.List | null | undefined): number; -} - -declare const findIndexFrom: FindIndex; +import { findIndexFrom } from "../fp"; export = findIndexFrom; diff --git a/types/lodash/fp/findKey.d.ts b/types/lodash/fp/findKey.d.ts index a776272bc0..c5a225a776 100644 --- a/types/lodash/fp/findKey.d.ts +++ b/types/lodash/fp/findKey.d.ts @@ -1,108 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FindKey { - /** - * This method is like _.find except that it returns the key of the first element predicate returns truthy for - * instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - (): FindKey; - /** - * This method is like _.find except that it returns the key of the first element predicate returns truthy for - * instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - (predicate: _.ValueIteratee): FindKey1x1; - /** - * This method is like _.find except that it returns the key of the first element predicate returns truthy for - * instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - (predicate: _.ValueIteratee, object: T | null | undefined): string | undefined; -} -interface FindKey1x1 { - /** - * This method is like _.find except that it returns the key of the first element predicate returns truthy for - * instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - (): FindKey1x1; - /** - * This method is like _.find except that it returns the key of the first element predicate returns truthy for - * instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - (object: object | null | undefined): string | undefined; -} - -declare const findKey: FindKey; +import { findKey } from "../fp"; export = findKey; diff --git a/types/lodash/fp/findLast.d.ts b/types/lodash/fp/findLast.d.ts index fb8c822bdf..b400c946b0 100644 --- a/types/lodash/fp/findLast.d.ts +++ b/types/lodash/fp/findLast.d.ts @@ -1,143 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FindLast { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard): FindLast1x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, collection: _.List | null | undefined): S|undefined; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIterateeCustom): FindLast2x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIterateeCustom, collection: _.List | null | undefined): T|undefined; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard): FindLast3x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, collection: T | null | undefined): S|undefined; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIterateeCustom, collection: T | null | undefined): T[keyof T]|undefined; -} -interface FindLast1x1 { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast1x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (collection: _.List | null | undefined): S|undefined; -} -interface FindLast2x1 { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast2x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (collection: _.List | object | null | undefined): T|undefined; -} -interface FindLast3x1 { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast3x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (collection: T | null | undefined): S|undefined; -} - -declare const findLast: FindLast; +import { findLast } from "../fp"; export = findLast; diff --git a/types/lodash/fp/findLastFrom.d.ts b/types/lodash/fp/findLastFrom.d.ts index bd6bed3043..1f034dfa88 100644 --- a/types/lodash/fp/findLastFrom.d.ts +++ b/types/lodash/fp/findLastFrom.d.ts @@ -1,257 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FindLast { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard): FindLast1x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, fromIndex: number): FindLast1x2; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, fromIndex: number, collection: _.List | null | undefined): S|undefined; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIterateeCustom): FindLast2x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIterateeCustom, fromIndex: number): FindLast2x2; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIterateeCustom, fromIndex: number, collection: _.List | null | undefined): T|undefined; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard): FindLast3x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, fromIndex: number): FindLast3x2; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIteratorTypeGuard, fromIndex: number, collection: T | null | undefined): S|undefined; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (predicate: _.ValueIterateeCustom, fromIndex: number, collection: T | null | undefined): T[keyof T]|undefined; -} -interface FindLast1x1 { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast1x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (fromIndex: number): FindLast1x2; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (fromIndex: number, collection: _.List | null | undefined): S|undefined; -} -interface FindLast1x2 { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast1x2; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (collection: _.List | null | undefined): S|undefined; -} -interface FindLast2x1 { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast2x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (fromIndex: number): FindLast2x2; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (fromIndex: number, collection: _.List | object | null | undefined): T|undefined; -} -interface FindLast2x2 { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast2x2; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (collection: _.List | object | null | undefined): T|undefined; -} -interface FindLast3x1 { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast3x1; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (fromIndex: number): FindLast3x2; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (fromIndex: number, collection: T | null | undefined): S|undefined; -} -interface FindLast3x2 { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (): FindLast3x2; - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - */ - (collection: T | null | undefined): S|undefined; -} - -declare const findLastFrom: FindLast; +import { findLastFrom } from "../fp"; export = findLastFrom; diff --git a/types/lodash/fp/findLastIndex.d.ts b/types/lodash/fp/findLastIndex.d.ts index 230736f814..51ee410fb1 100644 --- a/types/lodash/fp/findLastIndex.d.ts +++ b/types/lodash/fp/findLastIndex.d.ts @@ -1,103 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FindLastIndex { - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (): FindLastIndex; - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (predicate: _.ValueIterateeCustom): FindLastIndex1x1; - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (predicate: _.ValueIterateeCustom, array: _.List | null | undefined): number; -} -interface FindLastIndex1x1 { - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (): FindLastIndex1x1; - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (array: _.List | null | undefined): number; -} - -declare const findLastIndex: FindLastIndex; +import { findLastIndex } from "../fp"; export = findLastIndex; diff --git a/types/lodash/fp/findLastIndexFrom.d.ts b/types/lodash/fp/findLastIndexFrom.d.ts index df28dc685e..08bd53a087 100644 --- a/types/lodash/fp/findLastIndexFrom.d.ts +++ b/types/lodash/fp/findLastIndexFrom.d.ts @@ -1,177 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FindLastIndex { - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (): FindLastIndex; - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (predicate: _.ValueIterateeCustom): FindLastIndex1x1; - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (predicate: _.ValueIterateeCustom, fromIndex: number): FindLastIndex1x2; - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (predicate: _.ValueIterateeCustom, fromIndex: number, array: _.List | null | undefined): number; -} -interface FindLastIndex1x1 { - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (): FindLastIndex1x1; - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (fromIndex: number): FindLastIndex1x2; - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (fromIndex: number, array: _.List | null | undefined): number; -} -interface FindLastIndex1x2 { - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (): FindLastIndex1x2; - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - (array: _.List | null | undefined): number; -} - -declare const findLastIndexFrom: FindLastIndex; +import { findLastIndexFrom } from "../fp"; export = findLastIndexFrom; diff --git a/types/lodash/fp/findLastKey.d.ts b/types/lodash/fp/findLastKey.d.ts index 51e8d52ce1..7437a9ddda 100644 --- a/types/lodash/fp/findLastKey.d.ts +++ b/types/lodash/fp/findLastKey.d.ts @@ -1,103 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FindLastKey { - /** - * This method is like _.findKey except that it iterates over elements of a collection in the opposite order. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - (): FindLastKey; - /** - * This method is like _.findKey except that it iterates over elements of a collection in the opposite order. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - (predicate: _.ValueIteratee): FindLastKey1x1; - /** - * This method is like _.findKey except that it iterates over elements of a collection in the opposite order. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - (predicate: _.ValueIteratee, object: T | null | undefined): string | undefined; -} -interface FindLastKey1x1 { - /** - * This method is like _.findKey except that it iterates over elements of a collection in the opposite order. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - (): FindLastKey1x1; - /** - * This method is like _.findKey except that it iterates over elements of a collection in the opposite order. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - (object: object | null | undefined): string | undefined; -} - -declare const findLastKey: FindLastKey; +import { findLastKey } from "../fp"; export = findLastKey; diff --git a/types/lodash/fp/first.d.ts b/types/lodash/fp/first.d.ts index e93bdf4e4e..4554ad0e92 100644 --- a/types/lodash/fp/first.d.ts +++ b/types/lodash/fp/first.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Head = - /** - * Gets the first element of array. - * - * @alias _.first - * - * @param array The array to query. - * @return Returns the first element of array. - */ - (array: _.List | null | undefined) => T | undefined; - -declare const first: Head; +import { first } from "../fp"; export = first; diff --git a/types/lodash/fp/flatMap.d.ts b/types/lodash/fp/flatMap.d.ts index a6713fe34d..eb6d80434f 100644 --- a/types/lodash/fp/flatMap.d.ts +++ b/types/lodash/fp/flatMap.d.ts @@ -1,189 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FlatMap { - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (): FlatMap; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (iteratee: (value: T) => _.Many): FlatMap1x1; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (iteratee: (value: T) => _.Many, collection: _.List | null | undefined): TResult[]; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (iteratee: (value: T[keyof T]) => _.Many): FlatMap2x1; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (iteratee: (value: T[keyof T]) => _.Many, collection: T | null | undefined): TResult[]; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (iteratee: string): FlatMap3x1; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (iteratee: string, collection: object | null | undefined): any[]; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (iteratee: object): FlatMap4x1; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (iteratee: object, collection: object | null | undefined): boolean[]; -} -interface FlatMap1x1 { - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (): FlatMap1x1; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (collection: _.List | null | undefined): TResult[]; -} -interface FlatMap2x1 { - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (): FlatMap2x1; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (collection: T | null | undefined): TResult[]; -} -interface FlatMap3x1 { - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (): FlatMap3x1; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (collection: object | null | undefined): any[]; -} -interface FlatMap4x1 { - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (): FlatMap4x1; - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - (collection: object | null | undefined): boolean[]; -} - -declare const flatMap: FlatMap; +import { flatMap } from "../fp"; export = flatMap; diff --git a/types/lodash/fp/flatMapDeep.d.ts b/types/lodash/fp/flatMapDeep.d.ts index 9dad165793..0ce4db4801 100644 --- a/types/lodash/fp/flatMapDeep.d.ts +++ b/types/lodash/fp/flatMapDeep.d.ts @@ -1,342 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FlatMapDeep { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (): FlatMapDeep; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (iteratee: (value: T) => _.ListOfRecursiveArraysOrValues | TResult): FlatMapDeep1x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (iteratee: (value: T) => _.ListOfRecursiveArraysOrValues | TResult, collection: _.List | null | undefined): TResult[]; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (iteratee: (value: T[keyof T]) => _.ListOfRecursiveArraysOrValues | TResult): FlatMapDeep2x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (iteratee: (value: T[keyof T]) => _.ListOfRecursiveArraysOrValues | TResult, collection: T | null | undefined): TResult[]; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (iteratee: string): FlatMapDeep3x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (iteratee: string, collection: object | null | undefined): any[]; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (iteratee: object): FlatMapDeep4x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (iteratee: object, collection: object | null | undefined): boolean[]; -} -interface FlatMapDeep1x1 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (): FlatMapDeep1x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (collection: _.List | null | undefined): TResult[]; -} -interface FlatMapDeep2x1 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (): FlatMapDeep2x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (collection: T | null | undefined): TResult[]; -} -interface FlatMapDeep3x1 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (): FlatMapDeep3x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (collection: object | null | undefined): any[]; -} -interface FlatMapDeep4x1 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (): FlatMapDeep4x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - (collection: object | null | undefined): boolean[]; -} - -declare const flatMapDeep: FlatMapDeep; +import { flatMapDeep } from "../fp"; export = flatMapDeep; diff --git a/types/lodash/fp/flatMapDepth.d.ts b/types/lodash/fp/flatMapDepth.d.ts index d576c2a322..b60af92cc4 100644 --- a/types/lodash/fp/flatMapDepth.d.ts +++ b/types/lodash/fp/flatMapDepth.d.ts @@ -1,687 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FlatMapDepth { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (): FlatMapDepth; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: (value: T) => _.ListOfRecursiveArraysOrValues | TResult): FlatMapDepth1x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: (value: T) => _.ListOfRecursiveArraysOrValues | TResult, depth: number): FlatMapDepth1x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: (value: T) => _.ListOfRecursiveArraysOrValues | TResult, depth: number, collection: _.List | null | undefined): TResult[]; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: (value: T[keyof T]) => _.ListOfRecursiveArraysOrValues | TResult): FlatMapDepth2x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: (value: T[keyof T]) => _.ListOfRecursiveArraysOrValues | TResult, depth: number): FlatMapDepth2x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: (value: T[keyof T]) => _.ListOfRecursiveArraysOrValues | TResult, depth: number, collection: T | null | undefined): TResult[]; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: string): FlatMapDepth3x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: string, depth: number): FlatMapDepth3x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: string, depth: number, collection: object | null | undefined): any[]; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: object): FlatMapDepth4x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: object, depth: number): FlatMapDepth4x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (iteratee: object, depth: number, collection: object | null | undefined): boolean[]; -} -interface FlatMapDepth1x1 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (): FlatMapDepth1x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (depth: number): FlatMapDepth1x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (depth: number, collection: _.List | null | undefined): TResult[]; -} -interface FlatMapDepth1x2 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (): FlatMapDepth1x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (collection: _.List | null | undefined): TResult[]; -} -interface FlatMapDepth2x1 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (): FlatMapDepth2x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (depth: number): FlatMapDepth2x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (depth: number, collection: T | null | undefined): TResult[]; -} -interface FlatMapDepth2x2 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (): FlatMapDepth2x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (collection: T | null | undefined): TResult[]; -} -interface FlatMapDepth3x1 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (): FlatMapDepth3x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (depth: number): FlatMapDepth3x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (depth: number, collection: object | null | undefined): any[]; -} -interface FlatMapDepth3x2 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (): FlatMapDepth3x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (collection: object | null | undefined): any[]; -} -interface FlatMapDepth4x1 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (): FlatMapDepth4x1; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (depth: number): FlatMapDepth4x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (depth: number, collection: object | null | undefined): boolean[]; -} -interface FlatMapDepth4x2 { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (): FlatMapDepth4x2; - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - (collection: object | null | undefined): boolean[]; -} - -declare const flatMapDepth: FlatMapDepth; +import { flatMapDepth } from "../fp"; export = flatMapDepth; diff --git a/types/lodash/fp/flatten.d.ts b/types/lodash/fp/flatten.d.ts index 88c928c7b0..02c051ff0b 100644 --- a/types/lodash/fp/flatten.d.ts +++ b/types/lodash/fp/flatten.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Flatten = - /** - * Flattens `array` a single level deep. - * - * @param array The array to flatten. - * @return Returns the new flattened array. - */ - (array: _.List<_.Many> | null | undefined) => T[]; - -declare const flatten: Flatten; +import { flatten } from "../fp"; export = flatten; diff --git a/types/lodash/fp/flattenDeep.d.ts b/types/lodash/fp/flattenDeep.d.ts index 4cfb955e6b..44b40e3a1f 100644 --- a/types/lodash/fp/flattenDeep.d.ts +++ b/types/lodash/fp/flattenDeep.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type FlattenDeep = - /** - * Recursively flattens a nested array. - * - * @param array The array to recursively flatten. - * @return Returns the new flattened array. - */ - (array: _.ListOfRecursiveArraysOrValues | null | undefined) => T[]; - -declare const flattenDeep: FlattenDeep; +import { flattenDeep } from "../fp"; export = flattenDeep; diff --git a/types/lodash/fp/flattenDepth.d.ts b/types/lodash/fp/flattenDepth.d.ts index f5516cf82e..f046f2086a 100644 --- a/types/lodash/fp/flattenDepth.d.ts +++ b/types/lodash/fp/flattenDepth.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FlattenDepth { - /** - * Recursively flatten array up to depth times. - * - * @param array The array to recursively flatten. - * @param number The maximum recursion depth. - * @return Returns the new flattened array. - */ - (): FlattenDepth; - /** - * Recursively flatten array up to depth times. - * - * @param array The array to recursively flatten. - * @param number The maximum recursion depth. - * @return Returns the new flattened array. - */ - (depth: number): FlattenDepth1x1; - /** - * Recursively flatten array up to depth times. - * - * @param array The array to recursively flatten. - * @param number The maximum recursion depth. - * @return Returns the new flattened array. - */ - (depth: number, array: _.ListOfRecursiveArraysOrValues | null | undefined): T[]; -} -interface FlattenDepth1x1 { - /** - * Recursively flatten array up to depth times. - * - * @param array The array to recursively flatten. - * @param number The maximum recursion depth. - * @return Returns the new flattened array. - */ - (): FlattenDepth1x1; - /** - * Recursively flatten array up to depth times. - * - * @param array The array to recursively flatten. - * @param number The maximum recursion depth. - * @return Returns the new flattened array. - */ - (array: _.ListOfRecursiveArraysOrValues | null | undefined): T[]; -} - -declare const flattenDepth: FlattenDepth; +import { flattenDepth } from "../fp"; export = flattenDepth; diff --git a/types/lodash/fp/flip.d.ts b/types/lodash/fp/flip.d.ts index db73a17b1a..e5b3b7d4f9 100644 --- a/types/lodash/fp/flip.d.ts +++ b/types/lodash/fp/flip.d.ts @@ -1,24 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Flip = - /** - * Creates a function that invokes `func` with arguments reversed. - * - * @category Function - * @param func The function to flip arguments for. - * @returns Returns the new function. - * @example - * - * var flipped = _.flip(function() { - * return _.toArray(arguments); - * }); - * - * flipped('a', 'b', 'c', 'd'); - * // => ['d', 'c', 'b', 'a'] - */ - any>(func: T) => T; - -declare const flip: Flip; +import { flip } from "../fp"; export = flip; diff --git a/types/lodash/fp/floor.d.ts b/types/lodash/fp/floor.d.ts index 3275466204..167ab95438 100644 --- a/types/lodash/fp/floor.d.ts +++ b/types/lodash/fp/floor.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Floor = - /** - * Calculates n rounded down to precision. - * - * @param n The number to round down. - * @param precision The precision to round down to. - * @return Returns the rounded down number. - */ - (n: number) => number; - -declare const floor: Floor; +import { floor } from "../fp"; export = floor; diff --git a/types/lodash/fp/flow.d.ts b/types/lodash/fp/flow.d.ts index 843b0180f8..97f0fb82b2 100644 --- a/types/lodash/fp/flow.d.ts +++ b/types/lodash/fp/flow.d.ts @@ -1,355 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Flow { - /** - * 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. - */ - (f1: () => R1, f2: (a: R1) => R2): () => R2; - /** - * 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. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): () => R3; - /** - * 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. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): () => R4; - /** - * 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. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): () => R5; - /** - * 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. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): () => R6; - /** - * 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. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): () => R7; - /** - * 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. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): () => any; - /** - * 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. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2): (a1: A1) => R2; - /** - * 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. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1) => R3; - /** - * 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. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1) => R4; - /** - * 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. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1) => R5; - /** - * 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. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1) => R6; - /** - * 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. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1) => R7; - /** - * 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. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): (a1: A1) => any; - /** - * 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. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2) => R2; - /** - * 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. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2) => R3; - /** - * 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. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2) => R4; - /** - * 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. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2) => R5; - /** - * 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. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2) => R6; - /** - * 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. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2) => R7; - /** - * 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. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): (a1: A1, a2: A2) => any; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3) => R2; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3) => R3; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3) => R4; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3) => R5; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3) => R6; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3) => R7; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): (a1: A1, a2: A2, a3: A3) => any; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): (a1: A1, a2: A2, a3: A3, a4: A4) => any; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any; - /** - * 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. - */ - (funcs: Array<_.Many<(...args: any[]) => any>>): (...args: any[]) => any; -} - -declare const flow: Flow; +import { flow } from "../fp"; export = flow; diff --git a/types/lodash/fp/flowRight.d.ts b/types/lodash/fp/flowRight.d.ts index 16f5f2f031..f148feaad9 100644 --- a/types/lodash/fp/flowRight.d.ts +++ b/types/lodash/fp/flowRight.d.ts @@ -1,315 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FlowRight { - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: () => R1): () => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R2; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R3; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R4; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R5; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R6; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R7; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (f7: (a: any) => any, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array<_.Many<(...args: any[]) => any>>): (...args: any[]) => any; - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - (funcs: Array<_.Many<(...args: any[]) => any>>): (...args: any[]) => any; -} - -declare const flowRight: FlowRight; +import { flowRight } from "../fp"; export = flowRight; diff --git a/types/lodash/fp/forEach.d.ts b/types/lodash/fp/forEach.d.ts index 50b4a45bf4..f8aa7a4a1a 100644 --- a/types/lodash/fp/forEach.d.ts +++ b/types/lodash/fp/forEach.d.ts @@ -1,330 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ForEach { - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (): ForEach; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T) => any): ForEach1x1; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T) => any, collection: ReadonlyArray): T[]; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: string) => any): ForEach2x1; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: string) => any, collection: string): string; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T) => any, collection: _.List): _.List; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T[keyof T]) => any, collection: T): T; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T) => any, collection: TArray & (T[] | null | undefined)): TArray; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: string) => any, collection: TString): TString; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - | null | undefined>(iteratee: (value: T) => any, collection: TList & (_.List | null | undefined)): TList; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (iteratee: (value: T[keyof T]) => any, collection: T | null | undefined): T | null | undefined; -} -interface ForEach1x1 { - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (): ForEach1x1; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: ReadonlyArray): T[]; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: _.List): _.List; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: T1): T1; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: TArray & (T[] | null | undefined)): TArray; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - | null | undefined>(collection: TList & (_.List | null | undefined)): TList; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: T1 | null | undefined): T1 | null | undefined; -} -interface ForEach2x1 { - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (): ForEach2x1; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: string): string; - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - (collection: TString): TString; -} - -declare const forEach: ForEach; +import { forEach } from "../fp"; export = forEach; diff --git a/types/lodash/fp/forEachRight.d.ts b/types/lodash/fp/forEachRight.d.ts index 75ed3e7fab..135a4243a9 100644 --- a/types/lodash/fp/forEachRight.d.ts +++ b/types/lodash/fp/forEachRight.d.ts @@ -1,225 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ForEachRight { - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (): ForEachRight; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T) => any): ForEachRight1x1; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T) => any, collection: ReadonlyArray): T[]; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: string) => any): ForEachRight2x1; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: string) => any, collection: string): string; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T) => any, collection: _.List): _.List; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T[keyof T]) => any, collection: T): T; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T) => any, collection: TArray & (T[] | null | undefined)): TArray; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: string) => any, collection: TString): TString; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - | null | undefined>(iteratee: (value: T) => any, collection: TList & (_.List | null | undefined)): TList; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (iteratee: (value: T[keyof T]) => any, collection: T | null | undefined): T | null | undefined; -} -interface ForEachRight1x1 { - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (): ForEachRight1x1; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: ReadonlyArray): T[]; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: _.List): _.List; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: T1): T1; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: TArray & (T[] | null | undefined)): TArray; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - | null | undefined>(collection: TList & (_.List | null | undefined)): TList; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: T1 | null | undefined): T1 | null | undefined; -} -interface ForEachRight2x1 { - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (): ForEachRight2x1; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: string): string; - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - (collection: TString): TString; -} - -declare const forEachRight: ForEachRight; +import { forEachRight } from "../fp"; export = forEachRight; diff --git a/types/lodash/fp/forIn.d.ts b/types/lodash/fp/forIn.d.ts index added8f66b..dab37b1075 100644 --- a/types/lodash/fp/forIn.d.ts +++ b/types/lodash/fp/forIn.d.ts @@ -1,88 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface ForIn { - /** - * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The - * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may - * exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (): ForIn; - /** - * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The - * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may - * exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T) => any): ForIn1x1; - /** - * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The - * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may - * exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T[keyof T]) => any, object: T): T; - /** - * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The - * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may - * exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T[keyof T]) => any, object: T | null | undefined): T | null | undefined; -} -interface ForIn1x1 { - /** - * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The - * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may - * exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (): ForIn1x1; - /** - * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The - * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may - * exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (object: T1): T1; - /** - * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The - * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may - * exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (object: T1 | null | undefined): T1 | null | undefined; -} - -declare const forIn: ForIn; +import { forIn } from "../fp"; export = forIn; diff --git a/types/lodash/fp/forInRight.d.ts b/types/lodash/fp/forInRight.d.ts index 0525b46d07..c560df0cef 100644 --- a/types/lodash/fp/forInRight.d.ts +++ b/types/lodash/fp/forInRight.d.ts @@ -1,74 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface ForInRight { - /** - * This method is like _.forIn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (): ForInRight; - /** - * This method is like _.forIn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T) => any): ForInRight1x1; - /** - * This method is like _.forIn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T[keyof T]) => any, object: T): T; - /** - * This method is like _.forIn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T[keyof T]) => any, object: T | null | undefined): T | null | undefined; -} -interface ForInRight1x1 { - /** - * This method is like _.forIn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (): ForInRight1x1; - /** - * This method is like _.forIn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (object: T1): T1; - /** - * This method is like _.forIn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (object: T1 | null | undefined): T1 | null | undefined; -} - -declare const forInRight: ForInRight; +import { forInRight } from "../fp"; export = forInRight; diff --git a/types/lodash/fp/forOwn.d.ts b/types/lodash/fp/forOwn.d.ts index 222463960f..7099c48a9d 100644 --- a/types/lodash/fp/forOwn.d.ts +++ b/types/lodash/fp/forOwn.d.ts @@ -1,88 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface ForOwn { - /** - * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is - * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (): ForOwn; - /** - * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is - * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T) => any): ForOwn1x1; - /** - * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is - * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T[keyof T]) => any, object: T): T; - /** - * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is - * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T[keyof T]) => any, object: T | null | undefined): T | null | undefined; -} -interface ForOwn1x1 { - /** - * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is - * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (): ForOwn1x1; - /** - * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is - * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (object: T1): T1; - /** - * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is - * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (object: T1 | null | undefined): T1 | null | undefined; -} - -declare const forOwn: ForOwn; +import { forOwn } from "../fp"; export = forOwn; diff --git a/types/lodash/fp/forOwnRight.d.ts b/types/lodash/fp/forOwnRight.d.ts index 310b720ace..f1e3928866 100644 --- a/types/lodash/fp/forOwnRight.d.ts +++ b/types/lodash/fp/forOwnRight.d.ts @@ -1,74 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface ForOwnRight { - /** - * This method is like _.forOwn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (): ForOwnRight; - /** - * This method is like _.forOwn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T) => any): ForOwnRight1x1; - /** - * This method is like _.forOwn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T[keyof T]) => any, object: T): T; - /** - * This method is like _.forOwn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (iteratee: (value: T[keyof T]) => any, object: T | null | undefined): T | null | undefined; -} -interface ForOwnRight1x1 { - /** - * This method is like _.forOwn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (): ForOwnRight1x1; - /** - * This method is like _.forOwn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (object: T1): T1; - /** - * This method is like _.forOwn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - (object: T1 | null | undefined): T1 | null | undefined; -} - -declare const forOwnRight: ForOwnRight; +import { forOwnRight } from "../fp"; export = forOwnRight; diff --git a/types/lodash/fp/fromPairs.d.ts b/types/lodash/fp/fromPairs.d.ts index 5412865d75..b0d0082a59 100644 --- a/types/lodash/fp/fromPairs.d.ts +++ b/types/lodash/fp/fromPairs.d.ts @@ -1,37 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface FromPairs { - /** - * The inverse of `_.toPairs`; this method returns an object composed - * from key-value `pairs`. - * - * @category Array - * @param pairs The key-value pairs. - * @returns Returns the new object. - * @example - * - * _.fromPairs([['fred', 30], ['barney', 40]]); - * // => { 'fred': 30, 'barney': 40 } - */ - (pairs: _.List<[_.PropertyName, T]> | null | undefined): _.Dictionary; - /** - * The inverse of `_.toPairs`; this method returns an object composed - * from key-value `pairs`. - * - * @category Array - * @param pairs The key-value pairs. - * @returns Returns the new object. - * @example - * - * _.fromPairs([['fred', 30], ['barney', 40]]); - * // => { 'fred': 30, 'barney': 40 } - */ - (pairs: _.List | null | undefined): _.Dictionary; -} - -declare const fromPairs: FromPairs; +import { fromPairs } from "../fp"; export = fromPairs; diff --git a/types/lodash/fp/functions.d.ts b/types/lodash/fp/functions.d.ts index bc5cb94ab1..727d68e138 100644 --- a/types/lodash/fp/functions.d.ts +++ b/types/lodash/fp/functions.d.ts @@ -1,28 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Functions = - /** - * Creates an array of function property names from own enumerable properties - * of `object`. - * - * @category Object - * @param object The object to inspect. - * @returns Returns the new array of property names. - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functions(new Foo); - * // => ['a', 'b'] - */ - (object: any) => string[]; - -declare const functions: Functions; +import { functions } from "../fp"; export = functions; diff --git a/types/lodash/fp/functionsIn.d.ts b/types/lodash/fp/functionsIn.d.ts index 0189c213d6..448746e619 100644 --- a/types/lodash/fp/functionsIn.d.ts +++ b/types/lodash/fp/functionsIn.d.ts @@ -1,28 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type FunctionsIn = - /** - * Creates an array of function property names from own and inherited - * enumerable properties of `object`. - * - * @category Object - * @param object The object to inspect. - * @returns Returns the new array of property names. - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functionsIn(new Foo); - * // => ['a', 'b', 'c'] - */ - (object: any) => string[]; - -declare const functionsIn: FunctionsIn; +import { functionsIn } from "../fp"; export = functionsIn; diff --git a/types/lodash/fp/get.d.ts b/types/lodash/fp/get.d.ts index 085f3d935f..ff3ab8b09d 100644 --- a/types/lodash/fp/get.d.ts +++ b/types/lodash/fp/get.d.ts @@ -1,207 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Get { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey]): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject): TObject[TKey]; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number): Get3x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary): T; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary | null | undefined): T | undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get5x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: null | undefined): undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: any): any; -} -interface Get1x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject): TObject[TKey]; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject | null | undefined): TObject[TKey] | undefined; -} -interface Get3x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get3x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary): T; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary | null | undefined): T | undefined; -} -interface Get5x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get5x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: null | undefined): undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: any): any; -} - -declare const get: Get; +import { get } from "../fp"; export = get; diff --git a/types/lodash/fp/getOr.d.ts b/types/lodash/fp/getOr.d.ts index db63bd4b1a..ce3d5bba31 100644 --- a/types/lodash/fp/getOr.d.ts +++ b/types/lodash/fp/getOr.d.ts @@ -1,313 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Get { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: TKey | [TKey]): Get1x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: number): Get2x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: number, object: _.NumericDictionary | null | undefined): T | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: _.PropertyPath): Get3x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: _.PropertyPath, object: null | undefined): TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: any): Get4x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: any, path: _.PropertyPath): Get4x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: any, path: _.PropertyPath, object: any): any; -} -interface Get1x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey]): Get1x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number): Get2x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary | null | undefined): T | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get3x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: null | undefined): TDefault; -} -interface Get1x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject | null | undefined): TObject[TKey] | TDefault; -} -interface Get2x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get2x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary | null | undefined): T | TDefault; -} -interface Get3x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get3x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: null | undefined): TDefault; -} -interface Get4x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get4x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get4x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: any): any; -} -interface Get4x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get4x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: any): any; -} - -declare const getOr: Get; +import { getOr } from "../fp"; export = getOr; diff --git a/types/lodash/fp/groupBy.d.ts b/types/lodash/fp/groupBy.d.ts index 49f6946225..813830aa0e 100644 --- a/types/lodash/fp/groupBy.d.ts +++ b/types/lodash/fp/groupBy.d.ts @@ -1,225 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface GroupBy { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): GroupBy; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: (value: string) => _.NotVoid): GroupBy1x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: (value: string) => _.NotVoid, collection: string | null | undefined): _.Dictionary; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIteratee): GroupBy2x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIteratee, collection: _.List | null | undefined): _.Dictionary; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIteratee, collection: T | null | undefined): _.Dictionary>; -} -interface GroupBy1x1 { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): GroupBy1x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (collection: string | null | undefined): _.Dictionary; -} -interface GroupBy2x1 { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): GroupBy2x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (collection: _.List | object | null | undefined): _.Dictionary; -} - -declare const groupBy: GroupBy; +import { groupBy } from "../fp"; export = groupBy; diff --git a/types/lodash/fp/gt.d.ts b/types/lodash/fp/gt.d.ts index 8102922aee..517071f511 100644 --- a/types/lodash/fp/gt.d.ts +++ b/types/lodash/fp/gt.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Gt { - /** - * Checks if value is greater than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than other, else false. - */ - (): Gt; - /** - * Checks if value is greater than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than other, else false. - */ - (value: any): Gt1x1; - /** - * Checks if value is greater than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than other, else false. - */ - (value: any, other: any): boolean; -} -interface Gt1x1 { - /** - * Checks if value is greater than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than other, else false. - */ - (): Gt1x1; - /** - * Checks if value is greater than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than other, else false. - */ - (other: any): boolean; -} - -declare const gt: Gt; +import { gt } from "../fp"; export = gt; diff --git a/types/lodash/fp/gte.d.ts b/types/lodash/fp/gte.d.ts index df663c4438..5f6d85c7f0 100644 --- a/types/lodash/fp/gte.d.ts +++ b/types/lodash/fp/gte.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Gte { - /** - * Checks if value is greater than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than or equal to other, else false. - */ - (): Gte; - /** - * Checks if value is greater than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than or equal to other, else false. - */ - (value: any): Gte1x1; - /** - * Checks if value is greater than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than or equal to other, else false. - */ - (value: any, other: any): boolean; -} -interface Gte1x1 { - /** - * Checks if value is greater than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than or equal to other, else false. - */ - (): Gte1x1; - /** - * Checks if value is greater than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than or equal to other, else false. - */ - (other: any): boolean; -} - -declare const gte: Gte; +import { gte } from "../fp"; export = gte; diff --git a/types/lodash/fp/has.d.ts b/types/lodash/fp/has.d.ts index 950a57a43b..8cbda7fb8c 100644 --- a/types/lodash/fp/has.d.ts +++ b/types/lodash/fp/has.d.ts @@ -1,138 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Has { - /** - * Checks if `path` is a direct property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b.c'); - * // => true - * - * _.has(object, ['a', 'b', 'c']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - (): Has; - /** - * Checks if `path` is a direct property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b.c'); - * // => true - * - * _.has(object, ['a', 'b', 'c']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - (path: _.PropertyPath): Has1x1; - /** - * Checks if `path` is a direct property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b.c'); - * // => true - * - * _.has(object, ['a', 'b', 'c']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - (path: _.PropertyPath, object: T): boolean; -} -interface Has1x1 { - /** - * Checks if `path` is a direct property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b.c'); - * // => true - * - * _.has(object, ['a', 'b', 'c']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - (): Has1x1; - /** - * Checks if `path` is a direct property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b.c'); - * // => true - * - * _.has(object, ['a', 'b', 'c']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - (object: T): boolean; -} - -declare const has: Has; +import { has } from "../fp"; export = has; diff --git a/types/lodash/fp/hasIn.d.ts b/types/lodash/fp/hasIn.d.ts index a5ffb7ae4e..7e06a87ae3 100644 --- a/types/lodash/fp/hasIn.d.ts +++ b/types/lodash/fp/hasIn.d.ts @@ -1,133 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface HasIn { - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b.c'); - * // => true - * - * _.hasIn(object, ['a', 'b', 'c']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - (): HasIn; - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b.c'); - * // => true - * - * _.hasIn(object, ['a', 'b', 'c']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - (path: _.PropertyPath): HasIn1x1; - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b.c'); - * // => true - * - * _.hasIn(object, ['a', 'b', 'c']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - (path: _.PropertyPath, object: T): boolean; -} -interface HasIn1x1 { - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b.c'); - * // => true - * - * _.hasIn(object, ['a', 'b', 'c']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - (): HasIn1x1; - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b.c'); - * // => true - * - * _.hasIn(object, ['a', 'b', 'c']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - (object: T): boolean; -} - -declare const hasIn: HasIn; +import { hasIn } from "../fp"; export = hasIn; diff --git a/types/lodash/fp/head.d.ts b/types/lodash/fp/head.d.ts index 618e7ca561..4a7d5e59cd 100644 --- a/types/lodash/fp/head.d.ts +++ b/types/lodash/fp/head.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Head = - /** - * Gets the first element of array. - * - * @alias _.first - * - * @param array The array to query. - * @return Returns the first element of array. - */ - (array: _.List | null | undefined) => T | undefined; - -declare const head: Head; +import { head } from "../fp"; export = head; diff --git a/types/lodash/fp/identical.d.ts b/types/lodash/fp/identical.d.ts index 689227ac95..954dff5569 100644 --- a/types/lodash/fp/identical.d.ts +++ b/types/lodash/fp/identical.d.ts @@ -1,156 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Eq { - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - (): Eq; - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - (value: any): Eq1x1; - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - (value: any, other: any): boolean; -} -interface Eq1x1 { - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - (): Eq1x1; - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - (other: any): boolean; -} - -declare const identical: Eq; +import { identical } from "../fp"; export = identical; diff --git a/types/lodash/fp/identity.d.ts b/types/lodash/fp/identity.d.ts index 46411f1db1..97e613c6c8 100644 --- a/types/lodash/fp/identity.d.ts +++ b/types/lodash/fp/identity.d.ts @@ -1,23 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Identity { - /** - * This method returns the first argument provided to it. - * - * @param value Any value. - * @return Returns value. - */ - (value: T): T; - /** - * This method returns the first argument provided to it. - * - * @param value Any value. - * @return Returns value. - */ - (): undefined; -} - -declare const identity: Identity; +import { identity } from "../fp"; export = identity; diff --git a/types/lodash/fp/inRange.d.ts b/types/lodash/fp/inRange.d.ts index 564ed81a4e..06ed312687 100644 --- a/types/lodash/fp/inRange.d.ts +++ b/types/lodash/fp/inRange.d.ts @@ -1,103 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface InRange { - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - (): InRange; - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - (start: number): InRange1x1; - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - (start: number, end: number): InRange1x2; - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - (start: number, end: number, n: number): boolean; -} -interface InRange1x1 { - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - (): InRange1x1; - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - (end: number): InRange1x2; - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - (end: number, n: number): boolean; -} -interface InRange1x2 { - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - (): InRange1x2; - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - (n: number): boolean; -} - -declare const inRange: InRange; +import { inRange } from "../fp"; export = inRange; diff --git a/types/lodash/fp/includes.d.ts b/types/lodash/fp/includes.d.ts index b498f0e8aa..afc9984286 100644 --- a/types/lodash/fp/includes.d.ts +++ b/types/lodash/fp/includes.d.ts @@ -1,63 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Includes { - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (): Includes; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (target: T): Includes1x1; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (target: T, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean; -} -interface Includes1x1 { - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (): Includes1x1; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean; -} - -declare const includes: Includes; +import { includes } from "../fp"; export = includes; diff --git a/types/lodash/fp/includesFrom.d.ts b/types/lodash/fp/includesFrom.d.ts index 45d2f6bab8..13042d029a 100644 --- a/types/lodash/fp/includesFrom.d.ts +++ b/types/lodash/fp/includesFrom.d.ts @@ -1,105 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Includes { - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (): Includes; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (target: T): Includes1x1; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (target: T, fromIndex: number): Includes1x2; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (target: T, fromIndex: number, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean; -} -interface Includes1x1 { - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (): Includes1x1; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (fromIndex: number): Includes1x2; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (fromIndex: number, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean; -} -interface Includes1x2 { - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (): Includes1x2; - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean; -} - -declare const includesFrom: Includes; +import { includesFrom } from "../fp"; export = includesFrom; diff --git a/types/lodash/fp/indexBy.d.ts b/types/lodash/fp/indexBy.d.ts index 22a9e62a3b..f3f75a41fa 100644 --- a/types/lodash/fp/indexBy.d.ts +++ b/types/lodash/fp/indexBy.d.ts @@ -1,225 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface KeyBy { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): KeyBy; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: (value: string) => _.PropertyName): KeyBy1x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: (value: string) => _.PropertyName, collection: string | null | undefined): _.Dictionary; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIterateeCustom): KeyBy2x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIterateeCustom, collection: _.List | null | undefined): _.Dictionary; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIterateeCustom, collection: T | null | undefined): _.Dictionary; -} -interface KeyBy1x1 { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): KeyBy1x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (collection: string | null | undefined): _.Dictionary; -} -interface KeyBy2x1 { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): KeyBy2x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (collection: _.List | object | null | undefined): _.Dictionary; -} - -declare const indexBy: KeyBy; +import { indexBy } from "../fp"; export = indexBy; diff --git a/types/lodash/fp/indexOf.d.ts b/types/lodash/fp/indexOf.d.ts index 71c684508f..8078c468fd 100644 --- a/types/lodash/fp/indexOf.d.ts +++ b/types/lodash/fp/indexOf.d.ts @@ -1,118 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface IndexOf { - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (): IndexOf; - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (value: T): IndexOf1x1; - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (value: T, array: _.List | null | undefined): number; -} -interface IndexOf1x1 { - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (): IndexOf1x1; - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (array: _.List | null | undefined): number; -} - -declare const indexOf: IndexOf; +import { indexOf } from "../fp"; export = indexOf; diff --git a/types/lodash/fp/indexOfFrom.d.ts b/types/lodash/fp/indexOfFrom.d.ts index 22c8315ae5..fe66609f7a 100644 --- a/types/lodash/fp/indexOfFrom.d.ts +++ b/types/lodash/fp/indexOfFrom.d.ts @@ -1,204 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface IndexOf { - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (): IndexOf; - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (value: T): IndexOf1x1; - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (value: T, fromIndex: number): IndexOf1x2; - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (value: T, fromIndex: number, array: _.List | null | undefined): number; -} -interface IndexOf1x1 { - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (): IndexOf1x1; - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (fromIndex: number): IndexOf1x2; - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (fromIndex: number, array: _.List | null | undefined): number; -} -interface IndexOf1x2 { - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (): IndexOf1x2; - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - (array: _.List | null | undefined): number; -} - -declare const indexOfFrom: IndexOf; +import { indexOfFrom } from "../fp"; export = indexOfFrom; diff --git a/types/lodash/fp/init.d.ts b/types/lodash/fp/init.d.ts index 3c22717976..2f37ecd284 100644 --- a/types/lodash/fp/init.d.ts +++ b/types/lodash/fp/init.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Initial = - /** - * Gets all but the last element of array. - * - * @param array The array to query. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined) => T[]; - -declare const init: Initial; +import { init } from "../fp"; export = init; diff --git a/types/lodash/fp/initial.d.ts b/types/lodash/fp/initial.d.ts index e4d10ae946..446da0678b 100644 --- a/types/lodash/fp/initial.d.ts +++ b/types/lodash/fp/initial.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Initial = - /** - * Gets all but the last element of array. - * - * @param array The array to query. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined) => T[]; - -declare const initial: Initial; +import { initial } from "../fp"; export = initial; diff --git a/types/lodash/fp/intersection.d.ts b/types/lodash/fp/intersection.d.ts index ad290ebd3e..41d7915841 100644 --- a/types/lodash/fp/intersection.d.ts +++ b/types/lodash/fp/intersection.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Intersection { - /** - * Creates an array of unique values that are included in all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of shared values. - */ - (): Intersection; - /** - * Creates an array of unique values that are included in all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of shared values. - */ - (arrays2: _.List): Intersection1x1; - /** - * Creates an array of unique values that are included in all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of shared values. - */ - (arrays2: _.List, arrays: _.List): T[]; -} -interface Intersection1x1 { - /** - * Creates an array of unique values that are included in all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of shared values. - */ - (): Intersection1x1; - /** - * Creates an array of unique values that are included in all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of shared values. - */ - (arrays: _.List): T[]; -} - -declare const intersection: Intersection; +import { intersection } from "../fp"; export = intersection; diff --git a/types/lodash/fp/intersectionBy.d.ts b/types/lodash/fp/intersectionBy.d.ts index 6b94ad98f7..a123ddda0d 100644 --- a/types/lodash/fp/intersectionBy.d.ts +++ b/types/lodash/fp/intersectionBy.d.ts @@ -1,186 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface IntersectionBy { - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - (): IntersectionBy; - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - (iteratee: _.ValueIteratee): IntersectionBy1x1; - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - (iteratee: _.ValueIteratee, array: _.List | null): IntersectionBy1x2; - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - (iteratee: _.ValueIteratee, array: _.List | null, values: _.List): T1[]; -} -interface IntersectionBy1x1 { - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - (): IntersectionBy1x1; - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - (array: _.List | null): IntersectionBy1x2; - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - (array: _.List | null, values: _.List): T1[]; -} -interface IntersectionBy1x2 { - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - (): IntersectionBy1x2; - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - (values: _.List): T1[]; -} - -declare const intersectionBy: IntersectionBy; +import { intersectionBy } from "../fp"; export = intersectionBy; diff --git a/types/lodash/fp/intersectionWith.d.ts b/types/lodash/fp/intersectionWith.d.ts index 275d2fb3a9..9ad9941570 100644 --- a/types/lodash/fp/intersectionWith.d.ts +++ b/types/lodash/fp/intersectionWith.d.ts @@ -1,177 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface IntersectionWith { - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - (): IntersectionWith; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - (comparator: _.Comparator2): IntersectionWith1x1; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - (comparator: _.Comparator2, array: _.List | null | undefined): IntersectionWith1x2; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - (comparator: _.Comparator2, array: _.List | null | undefined, values: _.List): T1[]; -} -interface IntersectionWith1x1 { - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - (): IntersectionWith1x1; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - (array: _.List | null | undefined): IntersectionWith1x2; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - (array: _.List | null | undefined, values: _.List): T1[]; -} -interface IntersectionWith1x2 { - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - (): IntersectionWith1x2; - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - (values: _.List): T1[]; -} - -declare const intersectionWith: IntersectionWith; +import { intersectionWith } from "../fp"; export = intersectionWith; diff --git a/types/lodash/fp/invert.d.ts b/types/lodash/fp/invert.d.ts index fa6e62340e..a41c2bc244 100644 --- a/types/lodash/fp/invert.d.ts +++ b/types/lodash/fp/invert.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Invert = - /** - * Creates an object composed of the inverted keys and values of object. If object contains duplicate values, - * subsequent values overwrite property assignments of previous values unless multiValue is true. - * - * @param object The object to invert. - * @param multiValue Allow multiple values per key. - * @return Returns the new inverted object. - */ - (object: object) => _.Dictionary; - -declare const invert: Invert; +import { invert } from "../fp"; export = invert; diff --git a/types/lodash/fp/invertBy.d.ts b/types/lodash/fp/invertBy.d.ts index 5a386385ae..e28f7135f4 100644 --- a/types/lodash/fp/invertBy.d.ts +++ b/types/lodash/fp/invertBy.d.ts @@ -1,73 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface InvertBy { - /** - * This method is like _.invert except that the inverted object is generated from the results of running each - * element of object through iteratee. The corresponding inverted value of each inverted key is an array of - * keys responsible for generating the inverted value. The iteratee is invoked with one argument: (value). - * - * @param object The object to invert. - * @param interatee The iteratee invoked per element. - * @return Returns the new inverted object. - */ - (): InvertBy; - /** - * This method is like _.invert except that the inverted object is generated from the results of running each - * element of object through iteratee. The corresponding inverted value of each inverted key is an array of - * keys responsible for generating the inverted value. The iteratee is invoked with one argument: (value). - * - * @param object The object to invert. - * @param interatee The iteratee invoked per element. - * @return Returns the new inverted object. - */ - (interatee: _.ValueIteratee): InvertBy1x1; - /** - * This method is like _.invert except that the inverted object is generated from the results of running each - * element of object through iteratee. The corresponding inverted value of each inverted key is an array of - * keys responsible for generating the inverted value. The iteratee is invoked with one argument: (value). - * - * @param object The object to invert. - * @param interatee The iteratee invoked per element. - * @return Returns the new inverted object. - */ - (interatee: _.ValueIteratee, object: _.List | _.Dictionary | _.NumericDictionary | null | undefined): _.Dictionary; - /** - * This method is like _.invert except that the inverted object is generated from the results of running each - * element of object through iteratee. The corresponding inverted value of each inverted key is an array of - * keys responsible for generating the inverted value. The iteratee is invoked with one argument: (value). - * - * @param object The object to invert. - * @param interatee The iteratee invoked per element. - * @return Returns the new inverted object. - */ - (interatee: _.ValueIteratee, object: T | null | undefined): _.Dictionary; -} -interface InvertBy1x1 { - /** - * This method is like _.invert except that the inverted object is generated from the results of running each - * element of object through iteratee. The corresponding inverted value of each inverted key is an array of - * keys responsible for generating the inverted value. The iteratee is invoked with one argument: (value). - * - * @param object The object to invert. - * @param interatee The iteratee invoked per element. - * @return Returns the new inverted object. - */ - (): InvertBy1x1; - /** - * This method is like _.invert except that the inverted object is generated from the results of running each - * element of object through iteratee. The corresponding inverted value of each inverted key is an array of - * keys responsible for generating the inverted value. The iteratee is invoked with one argument: (value). - * - * @param object The object to invert. - * @param interatee The iteratee invoked per element. - * @return Returns the new inverted object. - */ - (object: _.List | _.Dictionary | _.NumericDictionary | object | null | undefined): _.Dictionary; -} - -declare const invertBy: InvertBy; +import { invertBy } from "../fp"; export = invertBy; diff --git a/types/lodash/fp/invertObj.d.ts b/types/lodash/fp/invertObj.d.ts index aeeb28ca48..2e16c4f8fb 100644 --- a/types/lodash/fp/invertObj.d.ts +++ b/types/lodash/fp/invertObj.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Invert = - /** - * Creates an object composed of the inverted keys and values of object. If object contains duplicate values, - * subsequent values overwrite property assignments of previous values unless multiValue is true. - * - * @param object The object to invert. - * @param multiValue Allow multiple values per key. - * @return Returns the new inverted object. - */ - (object: object) => _.Dictionary; - -declare const invertObj: Invert; +import { invertObj } from "../fp"; export = invertObj; diff --git a/types/lodash/fp/invoke.d.ts b/types/lodash/fp/invoke.d.ts index 9a72390f8e..1a9ce3b355 100644 --- a/types/lodash/fp/invoke.d.ts +++ b/types/lodash/fp/invoke.d.ts @@ -1,48 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Invoke { - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (): Invoke; - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (path: _.PropertyPath): Invoke1x1; - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (path: _.PropertyPath, object: any): any; -} -interface Invoke1x1 { - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (): Invoke1x1; - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (object: any): any; -} - -declare const invoke: Invoke; +import { invoke } from "../fp"; export = invoke; diff --git a/types/lodash/fp/invokeArgs.d.ts b/types/lodash/fp/invokeArgs.d.ts index 5c385579fd..8b498e0ec1 100644 --- a/types/lodash/fp/invokeArgs.d.ts +++ b/types/lodash/fp/invokeArgs.d.ts @@ -1,78 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Invoke { - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (): Invoke; - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (path: _.PropertyPath): Invoke1x1; - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (path: _.PropertyPath, args: ReadonlyArray): Invoke1x2; - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (path: _.PropertyPath, args: ReadonlyArray, object: any): any; -} -interface Invoke1x1 { - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (): Invoke1x1; - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (args: ReadonlyArray): Invoke1x2; - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (args: ReadonlyArray, object: any): any; -} -interface Invoke1x2 { - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (): Invoke1x2; - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - (object: any): any; -} - -declare const invokeArgs: Invoke; +import { invokeArgs } from "../fp"; export = invokeArgs; diff --git a/types/lodash/fp/invokeArgsMap.d.ts b/types/lodash/fp/invokeArgsMap.d.ts index 59e6170594..f5ba3e7ec5 100644 --- a/types/lodash/fp/invokeArgsMap.d.ts +++ b/types/lodash/fp/invokeArgsMap.d.ts @@ -1,187 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface InvokeMap { - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (): InvokeMap; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (methodName: string): InvokeMap1x1; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (methodName: string, args: ReadonlyArray): InvokeMap1x2; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (methodName: string, args: ReadonlyArray, collection: object | null | undefined): any[]; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (method: (...args: any[]) => TResult): InvokeMap2x1; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (method: (...args: any[]) => TResult, args: ReadonlyArray): InvokeMap2x2; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (method: (...args: any[]) => TResult, args: ReadonlyArray, collection: object | null | undefined): TResult[]; -} -interface InvokeMap1x1 { - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (): InvokeMap1x1; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (args: ReadonlyArray): InvokeMap1x2; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (args: ReadonlyArray, collection: object | null | undefined): any[]; -} -interface InvokeMap1x2 { - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (): InvokeMap1x2; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (collection: object | null | undefined): any[]; -} -interface InvokeMap2x1 { - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (): InvokeMap2x1; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (args: ReadonlyArray): InvokeMap2x2; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (args: ReadonlyArray, collection: object | null | undefined): TResult[]; -} -interface InvokeMap2x2 { - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (): InvokeMap2x2; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (collection: object | null | undefined): TResult[]; -} - -declare const invokeArgsMap: InvokeMap; +import { invokeArgsMap } from "../fp"; export = invokeArgsMap; diff --git a/types/lodash/fp/invokeMap.d.ts b/types/lodash/fp/invokeMap.d.ts index 3bb1072954..9f0aea9c11 100644 --- a/types/lodash/fp/invokeMap.d.ts +++ b/types/lodash/fp/invokeMap.d.ts @@ -1,103 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface InvokeMap { - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (): InvokeMap; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (methodName: string): InvokeMap1x1; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (methodName: string, collection: object | null | undefined): any[]; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (method: (...args: any[]) => TResult): InvokeMap2x1; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (method: (...args: any[]) => TResult, collection: object | null | undefined): TResult[]; -} -interface InvokeMap1x1 { - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (): InvokeMap1x1; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (collection: object | null | undefined): any[]; -} -interface InvokeMap2x1 { - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (): InvokeMap2x1; - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - (collection: object | null | undefined): TResult[]; -} - -declare const invokeMap: InvokeMap; +import { invokeMap } from "../fp"; export = invokeMap; diff --git a/types/lodash/fp/isArguments.d.ts b/types/lodash/fp/isArguments.d.ts index 53841e17fc..23c438c0a5 100644 --- a/types/lodash/fp/isArguments.d.ts +++ b/types/lodash/fp/isArguments.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsArguments = - /** - * Checks if value is classified as an arguments object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - (value: any) => value is IArguments; - -declare const isArguments: IsArguments; +import { isArguments } from "../fp"; export = isArguments; diff --git a/types/lodash/fp/isArray.d.ts b/types/lodash/fp/isArray.d.ts index 6f96cdbe55..dadecce65f 100644 --- a/types/lodash/fp/isArray.d.ts +++ b/types/lodash/fp/isArray.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsArray = - /** - * Checks if value is classified as an Array object. - * @param value The value to check. - * - * @return Returns true if value is correctly classified, else false. - */ - (value: any) => value is any[]; - -declare const isArray: IsArray; +import { isArray } from "../fp"; export = isArray; diff --git a/types/lodash/fp/isArrayBuffer.d.ts b/types/lodash/fp/isArrayBuffer.d.ts index a9fab817ec..32018346ba 100644 --- a/types/lodash/fp/isArrayBuffer.d.ts +++ b/types/lodash/fp/isArrayBuffer.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsArrayBuffer = - /** - * Checks if value is classified as an ArrayBuffer object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - (value: any) => value is ArrayBuffer; - -declare const isArrayBuffer: IsArrayBuffer; +import { isArrayBuffer } from "../fp"; export = isArrayBuffer; diff --git a/types/lodash/fp/isArrayLike.d.ts b/types/lodash/fp/isArrayLike.d.ts index 4d99172433..2be9b54c93 100644 --- a/types/lodash/fp/isArrayLike.d.ts +++ b/types/lodash/fp/isArrayLike.d.ts @@ -1,78 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface IsArrayLike { - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - (value: T & string & number): boolean; - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - (value: ((...args: any[]) => any) | null | undefined): value is never; - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - (value: any): value is { length: number }; -} - -declare const isArrayLike: IsArrayLike; +import { isArrayLike } from "../fp"; export = isArrayLike; diff --git a/types/lodash/fp/isArrayLikeObject.d.ts b/types/lodash/fp/isArrayLikeObject.d.ts index f21c1f6836..709f5135fe 100644 --- a/types/lodash/fp/isArrayLikeObject.d.ts +++ b/types/lodash/fp/isArrayLikeObject.d.ts @@ -1,77 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface IsArrayLikeObject { - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - (value: T & string & number): boolean; - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - // tslint:disable-next-line:ban-types (type guard doesn't seem to work correctly without the Function type) - (value: ((...args: any[]) => any) | Function | string | boolean | number | null | undefined): value is never; - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - // tslint:disable-next-line:ban-types (type guard doesn't seem to work correctly without the Function type) - (value: T | ((...args: any[]) => any) | Function | string | boolean | number | null | undefined): value is T & { length: number }; -} - -declare const isArrayLikeObject: IsArrayLikeObject; +import { isArrayLikeObject } from "../fp"; export = isArrayLikeObject; diff --git a/types/lodash/fp/isBoolean.d.ts b/types/lodash/fp/isBoolean.d.ts index 45aaa6d2f9..605cb2cb7e 100644 --- a/types/lodash/fp/isBoolean.d.ts +++ b/types/lodash/fp/isBoolean.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsBoolean = - /** - * 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. - */ - (value: any) => value is boolean; - -declare const isBoolean: IsBoolean; +import { isBoolean } from "../fp"; export = isBoolean; diff --git a/types/lodash/fp/isBuffer.d.ts b/types/lodash/fp/isBuffer.d.ts index a603cf2d68..3d06b548c1 100644 --- a/types/lodash/fp/isBuffer.d.ts +++ b/types/lodash/fp/isBuffer.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsBuffer = - /** - * Checks if value is a buffer. - * - * @param value The value to check. - * @return Returns true if value is a buffer, else false. - */ - (value: any) => boolean; - -declare const isBuffer: IsBuffer; +import { isBuffer } from "../fp"; export = isBuffer; diff --git a/types/lodash/fp/isDate.d.ts b/types/lodash/fp/isDate.d.ts index a602131f26..979594f995 100644 --- a/types/lodash/fp/isDate.d.ts +++ b/types/lodash/fp/isDate.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsDate = - /** - * Checks if value is classified as a Date object. - * @param value The value to check. - * - * @return Returns true if value is correctly classified, else false. - */ - (value: any) => value is Date; - -declare const isDate: IsDate; +import { isDate } from "../fp"; export = isDate; diff --git a/types/lodash/fp/isElement.d.ts b/types/lodash/fp/isElement.d.ts index 56fe27d3a6..26739ad952 100644 --- a/types/lodash/fp/isElement.d.ts +++ b/types/lodash/fp/isElement.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsElement = - /** - * Checks if value is a DOM element. - * - * @param value The value to check. - * @return Returns true if value is a DOM element, else false. - */ - (value: any) => boolean; - -declare const isElement: IsElement; +import { isElement } from "../fp"; export = isElement; diff --git a/types/lodash/fp/isEmpty.d.ts b/types/lodash/fp/isEmpty.d.ts index b24d33f88e..ed9b33f822 100644 --- a/types/lodash/fp/isEmpty.d.ts +++ b/types/lodash/fp/isEmpty.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsEmpty = - /** - * Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string, or - * jQuery-like collection with a length greater than 0 or an object with own enumerable properties. - * - * @param value The value to inspect. - * @return Returns true if value is empty, else false. - */ - (value: any) => boolean; - -declare const isEmpty: IsEmpty; +import { isEmpty } from "../fp"; export = isEmpty; diff --git a/types/lodash/fp/isEqual.d.ts b/types/lodash/fp/isEqual.d.ts index 225f90f914..0a51c5c80d 100644 --- a/types/lodash/fp/isEqual.d.ts +++ b/types/lodash/fp/isEqual.d.ts @@ -1,141 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface IsEqual { - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - (): IsEqual; - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - (value: any): IsEqual1x1; - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - (value: any, other: any): boolean; -} -interface IsEqual1x1 { - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - (): IsEqual1x1; - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - (other: any): boolean; -} - -declare const isEqual: IsEqual; +import { isEqual } from "../fp"; export = isEqual; diff --git a/types/lodash/fp/isEqualWith.d.ts b/types/lodash/fp/isEqualWith.d.ts index 832c80829c..27fa4414cb 100644 --- a/types/lodash/fp/isEqualWith.d.ts +++ b/types/lodash/fp/isEqualWith.d.ts @@ -1,285 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface IsEqualWith { - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - (): IsEqualWith; - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - (customizer: _.IsEqualCustomizer): IsEqualWith1x1; - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - (customizer: _.IsEqualCustomizer, value: any): IsEqualWith1x2; - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - (customizer: _.IsEqualCustomizer, value: any, other: any): boolean; -} -interface IsEqualWith1x1 { - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - (): IsEqualWith1x1; - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - (value: any): IsEqualWith1x2; - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - (value: any, other: any): boolean; -} -interface IsEqualWith1x2 { - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - (): IsEqualWith1x2; - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - (other: any): boolean; -} - -declare const isEqualWith: IsEqualWith; +import { isEqualWith } from "../fp"; export = isEqualWith; diff --git a/types/lodash/fp/isError.d.ts b/types/lodash/fp/isError.d.ts index 6c6f429fdf..4adb9885ca 100644 --- a/types/lodash/fp/isError.d.ts +++ b/types/lodash/fp/isError.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsError = - /** - * Checks if value is an Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, or URIError - * object. - * - * @param value The value to check. - * @return Returns true if value is an error object, else false. - */ - (value: any) => value is Error; - -declare const isError: IsError; +import { isError } from "../fp"; export = isError; diff --git a/types/lodash/fp/isFinite.d.ts b/types/lodash/fp/isFinite.d.ts index 544f4c3fd5..5641edc0ae 100644 --- a/types/lodash/fp/isFinite.d.ts +++ b/types/lodash/fp/isFinite.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsFinite = - /** - * Checks if value is a finite primitive number. - * - * Note: This method is based on Number.isFinite. - * - * @param value The value to check. - * @return Returns true if value is a finite number, else false. - */ - (value: any) => boolean; - -declare const isFinite: IsFinite; +import { isFinite } from "../fp"; export = isFinite; diff --git a/types/lodash/fp/isFunction.d.ts b/types/lodash/fp/isFunction.d.ts index 7a85054a1f..3404e74871 100644 --- a/types/lodash/fp/isFunction.d.ts +++ b/types/lodash/fp/isFunction.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsFunction = - /** - * Checks if value is a callable function. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - (value: any) => value is (...args: any[]) => any; - -declare const isFunction: IsFunction; +import { isFunction } from "../fp"; export = isFunction; diff --git a/types/lodash/fp/isInteger.d.ts b/types/lodash/fp/isInteger.d.ts index d04a6f5cce..310df93478 100644 --- a/types/lodash/fp/isInteger.d.ts +++ b/types/lodash/fp/isInteger.d.ts @@ -1,31 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsInteger = - /** - * Checks if `value` is an integer. - * - * **Note:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger). - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is an integer, else `false`. - * @example - * - * _.isInteger(3); - * // => true - * - * _.isInteger(Number.MIN_VALUE); - * // => false - * - * _.isInteger(Infinity); - * // => false - * - * _.isInteger('3'); - * // => false - */ - (value: any) => boolean; - -declare const isInteger: IsInteger; +import { isInteger } from "../fp"; export = isInteger; diff --git a/types/lodash/fp/isLength.d.ts b/types/lodash/fp/isLength.d.ts index a48a867820..3073b672b6 100644 --- a/types/lodash/fp/isLength.d.ts +++ b/types/lodash/fp/isLength.d.ts @@ -1,31 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsLength = - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - (value: any) => boolean; - -declare const isLength: IsLength; +import { isLength } from "../fp"; export = isLength; diff --git a/types/lodash/fp/isMap.d.ts b/types/lodash/fp/isMap.d.ts index 940cb8a4ad..e76745c1e2 100644 --- a/types/lodash/fp/isMap.d.ts +++ b/types/lodash/fp/isMap.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsMap = - /** - * Checks if value is classified as a Map object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - (value: any) => value is Map; - -declare const isMap: IsMap; +import { isMap } from "../fp"; export = isMap; diff --git a/types/lodash/fp/isMatch.d.ts b/types/lodash/fp/isMatch.d.ts index 231362c358..58a0a2db95 100644 --- a/types/lodash/fp/isMatch.d.ts +++ b/types/lodash/fp/isMatch.d.ts @@ -1,116 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface IsMatch { - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (): IsMatch; - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (source: object): IsMatch1x1; - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (source: object, object: object): boolean; -} -interface IsMatch1x1 { - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (): IsMatch1x1; - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (object: object): boolean; -} - -declare const isMatch: IsMatch; +import { isMatch } from "../fp"; export = isMatch; diff --git a/types/lodash/fp/isMatchWith.d.ts b/types/lodash/fp/isMatchWith.d.ts index 5345ad3863..40ff3a691b 100644 --- a/types/lodash/fp/isMatchWith.d.ts +++ b/types/lodash/fp/isMatchWith.d.ts @@ -1,285 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface IsMatchWith { - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - (): IsMatchWith; - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - (customizer: _.isMatchWithCustomizer): IsMatchWith1x1; - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - (customizer: _.isMatchWithCustomizer, source: object): IsMatchWith1x2; - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - (customizer: _.isMatchWithCustomizer, source: object, object: object): boolean; -} -interface IsMatchWith1x1 { - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - (): IsMatchWith1x1; - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - (source: object): IsMatchWith1x2; - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - (source: object, object: object): boolean; -} -interface IsMatchWith1x2 { - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - (): IsMatchWith1x2; - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - (object: object): boolean; -} - -declare const isMatchWith: IsMatchWith; +import { isMatchWith } from "../fp"; export = isMatchWith; diff --git a/types/lodash/fp/isNaN.d.ts b/types/lodash/fp/isNaN.d.ts index f227cd2061..2f92885d09 100644 --- a/types/lodash/fp/isNaN.d.ts +++ b/types/lodash/fp/isNaN.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsNaN = - /** - * Checks if value is NaN. - * - * Note: This method is not the same as isNaN which returns true for undefined and other non-numeric values. - * - * @param value The value to check. - * @return Returns true if value is NaN, else false. - */ - (value: any) => boolean; - -declare const isNaN: IsNaN; +import { isNaN } from "../fp"; export = isNaN; diff --git a/types/lodash/fp/isNative.d.ts b/types/lodash/fp/isNative.d.ts index 9dd6543388..6e189a8e52 100644 --- a/types/lodash/fp/isNative.d.ts +++ b/types/lodash/fp/isNative.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsNative = - /** - * Checks if value is a native function. - * @param value The value to check. - * - * @retrun Returns true if value is a native function, else false. - */ - (value: any) => value is (...args: any[]) => any; - -declare const isNative: IsNative; +import { isNative } from "../fp"; export = isNative; diff --git a/types/lodash/fp/isNil.d.ts b/types/lodash/fp/isNil.d.ts index 07005f1fa1..0baee7ff8b 100644 --- a/types/lodash/fp/isNil.d.ts +++ b/types/lodash/fp/isNil.d.ts @@ -1,26 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsNil = - /** - * Checks if `value` is `null` or `undefined`. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is nullish, else `false`. - * @example - * - * _.isNil(null); - * // => true - * - * _.isNil(void 0); - * // => true - * - * _.isNil(NaN); - * // => false - */ - (value: any) => value is null | undefined; - -declare const isNil: IsNil; +import { isNil } from "../fp"; export = isNil; diff --git a/types/lodash/fp/isNull.d.ts b/types/lodash/fp/isNull.d.ts index b1d5b53e0b..5e5fad5575 100644 --- a/types/lodash/fp/isNull.d.ts +++ b/types/lodash/fp/isNull.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsNull = - /** - * Checks if value is null. - * - * @param value The value to check. - * @return Returns true if value is null, else false. - */ - (value: any) => value is null; - -declare const isNull: IsNull; +import { isNull } from "../fp"; export = isNull; diff --git a/types/lodash/fp/isNumber.d.ts b/types/lodash/fp/isNumber.d.ts index fda5cca1b8..93368f1726 100644 --- a/types/lodash/fp/isNumber.d.ts +++ b/types/lodash/fp/isNumber.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsNumber = - /** - * Checks if value is classified as a Number primitive or object. - * - * Note: To exclude Infinity, -Infinity, and NaN, which are classified as numbers, use the _.isFinite method. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - (value: any) => value is number; - -declare const isNumber: IsNumber; +import { isNumber } from "../fp"; export = isNumber; diff --git a/types/lodash/fp/isObject.d.ts b/types/lodash/fp/isObject.d.ts index 9f55786107..7e9e2575ab 100644 --- a/types/lodash/fp/isObject.d.ts +++ b/types/lodash/fp/isObject.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsObject = - /** - * Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, new Number(0), - * and new String('')) - * - * @param value The value to check. - * @return Returns true if value is an object, else false. - */ - (value: any) => boolean; - -declare const isObject: IsObject; +import { isObject } from "../fp"; export = isObject; diff --git a/types/lodash/fp/isObjectLike.d.ts b/types/lodash/fp/isObjectLike.d.ts index 17fc948a2d..ba03ddc0f7 100644 --- a/types/lodash/fp/isObjectLike.d.ts +++ b/types/lodash/fp/isObjectLike.d.ts @@ -1,30 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsObjectLike = - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - (value: any) => boolean; - -declare const isObjectLike: IsObjectLike; +import { isObjectLike } from "../fp"; export = isObjectLike; diff --git a/types/lodash/fp/isPlainObject.d.ts b/types/lodash/fp/isPlainObject.d.ts index e4cadb9806..87da4bdb47 100644 --- a/types/lodash/fp/isPlainObject.d.ts +++ b/types/lodash/fp/isPlainObject.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsPlainObject = - /** - * Checks if value is a plain object, that is, an object created by the Object constructor or one with a - * [[Prototype]] of null. - * - * Note: This method assumes objects created by the Object constructor have no inherited enumerable properties. - * - * @param value The value to check. - * @return Returns true if value is a plain object, else false. - */ - (value: any) => boolean; - -declare const isPlainObject: IsPlainObject; +import { isPlainObject } from "../fp"; export = isPlainObject; diff --git a/types/lodash/fp/isRegExp.d.ts b/types/lodash/fp/isRegExp.d.ts index 98adef2e36..47edf50a1f 100644 --- a/types/lodash/fp/isRegExp.d.ts +++ b/types/lodash/fp/isRegExp.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsRegExp = - /** - * Checks if value is classified as a RegExp object. - * @param value The value to check. - * - * @return Returns true if value is correctly classified, else false. - */ - (value: any) => value is RegExp; - -declare const isRegExp: IsRegExp; +import { isRegExp } from "../fp"; export = isRegExp; diff --git a/types/lodash/fp/isSafeInteger.d.ts b/types/lodash/fp/isSafeInteger.d.ts index 60d49e1be8..a32b12cfd8 100644 --- a/types/lodash/fp/isSafeInteger.d.ts +++ b/types/lodash/fp/isSafeInteger.d.ts @@ -1,32 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsSafeInteger = - /** - * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 - * double precision number which isn't the result of a rounded unsafe integer. - * - * **Note:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is a safe integer, else `false`. - * @example - * - * _.isSafeInteger(3); - * // => true - * - * _.isSafeInteger(Number.MIN_VALUE); - * // => false - * - * _.isSafeInteger(Infinity); - * // => false - * - * _.isSafeInteger('3'); - * // => false - */ - (value: any) => boolean; - -declare const isSafeInteger: IsSafeInteger; +import { isSafeInteger } from "../fp"; export = isSafeInteger; diff --git a/types/lodash/fp/isSet.d.ts b/types/lodash/fp/isSet.d.ts index 7be7de7600..85e493338e 100644 --- a/types/lodash/fp/isSet.d.ts +++ b/types/lodash/fp/isSet.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsSet = - /** - * Checks if value is classified as a Set object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - (value: any) => value is Set; - -declare const isSet: IsSet; +import { isSet } from "../fp"; export = isSet; diff --git a/types/lodash/fp/isString.d.ts b/types/lodash/fp/isString.d.ts index fea109178e..9a2149451d 100644 --- a/types/lodash/fp/isString.d.ts +++ b/types/lodash/fp/isString.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsString = - /** - * Checks if value is classified as a String primitive or object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - (value: any) => value is string; - -declare const isString: IsString; +import { isString } from "../fp"; export = isString; diff --git a/types/lodash/fp/isSymbol.d.ts b/types/lodash/fp/isSymbol.d.ts index fe30bad576..3d82e9719c 100644 --- a/types/lodash/fp/isSymbol.d.ts +++ b/types/lodash/fp/isSymbol.d.ts @@ -1,23 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsSymbol = - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - (value: any) => boolean; - -declare const isSymbol: IsSymbol; +import { isSymbol } from "../fp"; export = isSymbol; diff --git a/types/lodash/fp/isTypedArray.d.ts b/types/lodash/fp/isTypedArray.d.ts index 076fb84e05..fce6c44a69 100644 --- a/types/lodash/fp/isTypedArray.d.ts +++ b/types/lodash/fp/isTypedArray.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsTypedArray = - /** - * Checks if value is classified as a typed array. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - (value: any) => boolean; - -declare const isTypedArray: IsTypedArray; +import { isTypedArray } from "../fp"; export = isTypedArray; diff --git a/types/lodash/fp/isUndefined.d.ts b/types/lodash/fp/isUndefined.d.ts index 3980dd5742..ccb010033b 100644 --- a/types/lodash/fp/isUndefined.d.ts +++ b/types/lodash/fp/isUndefined.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsUndefined = - /** - * Checks if value is undefined. - * - * @param value The value to check. - * @return Returns true if value is undefined, else false. - */ - (value: any) => value is undefined; - -declare const isUndefined: IsUndefined; +import { isUndefined } from "../fp"; export = isUndefined; diff --git a/types/lodash/fp/isWeakMap.d.ts b/types/lodash/fp/isWeakMap.d.ts index 9edb2fbb71..11edaab05d 100644 --- a/types/lodash/fp/isWeakMap.d.ts +++ b/types/lodash/fp/isWeakMap.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsWeakMap = - /** - * Checks if value is classified as a WeakMap object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - (value: any) => value is WeakMap; - -declare const isWeakMap: IsWeakMap; +import { isWeakMap } from "../fp"; export = isWeakMap; diff --git a/types/lodash/fp/isWeakSet.d.ts b/types/lodash/fp/isWeakSet.d.ts index cf7bd7cf01..6d877e9e23 100644 --- a/types/lodash/fp/isWeakSet.d.ts +++ b/types/lodash/fp/isWeakSet.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type IsWeakSet = - /** - * Checks if value is classified as a WeakSet object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - (value: any) => value is WeakSet; - -declare const isWeakSet: IsWeakSet; +import { isWeakSet } from "../fp"; export = isWeakSet; diff --git a/types/lodash/fp/iteratee.d.ts b/types/lodash/fp/iteratee.d.ts index 669d1d92d5..0ec2832c84 100644 --- a/types/lodash/fp/iteratee.d.ts +++ b/types/lodash/fp/iteratee.d.ts @@ -1,65 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Iteratee { - /** - * Creates a function that invokes `func` with the arguments of the created - * function. If `func` is a property name the created callback returns the - * property value for a given element. If `func` is an object the created - * callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`. - * - * @category Util - * @param [func=_.identity] The value to convert to a callback. - * @returns Returns the callback. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // create custom iteratee shorthands - * _.iteratee = _.wrap(_.iteratee, function(callback, func) { - * var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func); - * return !p ? callback(func) : function(object) { - * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]); - * }; - * }); - * - * _.filter(users, 'age > 36'); - * // => [{ 'user': 'fred', 'age': 40 }] - */ - any>(func: TFunction): TFunction; - /** - * Creates a function that invokes `func` with the arguments of the created - * function. If `func` is a property name the created callback returns the - * property value for a given element. If `func` is an object the created - * callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`. - * - * @category Util - * @param [func=_.identity] The value to convert to a callback. - * @returns Returns the callback. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // create custom iteratee shorthands - * _.iteratee = _.wrap(_.iteratee, function(callback, func) { - * var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func); - * return !p ? callback(func) : function(object) { - * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]); - * }; - * }); - * - * _.filter(users, 'age > 36'); - * // => [{ 'user': 'fred', 'age': 40 }] - */ - (func: string | object): (...args: any[]) => any; -} - -declare const iteratee: Iteratee; +import { iteratee } from "../fp"; export = iteratee; diff --git a/types/lodash/fp/join.d.ts b/types/lodash/fp/join.d.ts index 7b678d0738..beee04ccf5 100644 --- a/types/lodash/fp/join.d.ts +++ b/types/lodash/fp/join.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Join { - /** - * Converts all elements in `array` into a string separated by `separator`. - * - * @param array The array to convert. - * @param separator The element separator. - * @returns Returns the joined string. - */ - (): Join; - /** - * Converts all elements in `array` into a string separated by `separator`. - * - * @param array The array to convert. - * @param separator The element separator. - * @returns Returns the joined string. - */ - (separator: string): Join1x1; - /** - * Converts all elements in `array` into a string separated by `separator`. - * - * @param array The array to convert. - * @param separator The element separator. - * @returns Returns the joined string. - */ - (separator: string, array: _.List | null | undefined): string; -} -interface Join1x1 { - /** - * Converts all elements in `array` into a string separated by `separator`. - * - * @param array The array to convert. - * @param separator The element separator. - * @returns Returns the joined string. - */ - (): Join1x1; - /** - * Converts all elements in `array` into a string separated by `separator`. - * - * @param array The array to convert. - * @param separator The element separator. - * @returns Returns the joined string. - */ - (array: _.List | null | undefined): string; -} - -declare const join: Join; +import { join } from "../fp"; export = join; diff --git a/types/lodash/fp/juxt.d.ts b/types/lodash/fp/juxt.d.ts index 9131ad7914..5e972d4488 100644 --- a/types/lodash/fp/juxt.d.ts +++ b/types/lodash/fp/juxt.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Over = - /** - * Creates a function that invokes iteratees with the arguments provided to the created function and returns - * their results. - * - * @param iteratees The iteratees to invoke. - * @return Returns the new function. - */ - (iteratees: _.Many<(...args: any[]) => TResult>) => (...args: any[]) => TResult[]; - -declare const juxt: Over; +import { juxt } from "../fp"; export = juxt; diff --git a/types/lodash/fp/kebabCase.d.ts b/types/lodash/fp/kebabCase.d.ts index 6a46ada134..8231b1593a 100644 --- a/types/lodash/fp/kebabCase.d.ts +++ b/types/lodash/fp/kebabCase.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type KebabCase = - /** - * Converts string to kebab case. - * - * @param string The string to convert. - * @return Returns the kebab cased string. - */ - (string: string) => string; - -declare const kebabCase: KebabCase; +import { kebabCase } from "../fp"; export = kebabCase; diff --git a/types/lodash/fp/keyBy.d.ts b/types/lodash/fp/keyBy.d.ts index d9ebba52bf..e4b1381096 100644 --- a/types/lodash/fp/keyBy.d.ts +++ b/types/lodash/fp/keyBy.d.ts @@ -1,225 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface KeyBy { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): KeyBy; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: (value: string) => _.PropertyName): KeyBy1x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: (value: string) => _.PropertyName, collection: string | null | undefined): _.Dictionary; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIterateeCustom): KeyBy2x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIterateeCustom, collection: _.List | null | undefined): _.Dictionary; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (iteratee: _.ValueIterateeCustom, collection: T | null | undefined): _.Dictionary; -} -interface KeyBy1x1 { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): KeyBy1x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (collection: string | null | undefined): _.Dictionary; -} -interface KeyBy2x1 { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (): KeyBy2x1; - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - (collection: _.List | object | null | undefined): _.Dictionary; -} - -declare const keyBy: KeyBy; +import { keyBy } from "../fp"; export = keyBy; diff --git a/types/lodash/fp/keys.d.ts b/types/lodash/fp/keys.d.ts index 0cfa0ac21e..0323484453 100644 --- a/types/lodash/fp/keys.d.ts +++ b/types/lodash/fp/keys.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Keys = - /** - * Creates an array of the own enumerable property names of object. - * - * Note: Non-object values are coerced to objects. See the ES spec for more details. - * - * @param object The object to query. - * @return Returns the array of property names. - */ - (object: any) => string[]; - -declare const keys: Keys; +import { keys } from "../fp"; export = keys; diff --git a/types/lodash/fp/keysIn.d.ts b/types/lodash/fp/keysIn.d.ts index 827f1edbaa..f6f3482852 100644 --- a/types/lodash/fp/keysIn.d.ts +++ b/types/lodash/fp/keysIn.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type KeysIn = - /** - * Creates an array of the own and inherited enumerable property names of object. - * - * Note: Non-object values are coerced to objects. - * - * @param object The object to query. - * @return An array of property names. - */ - (object: any) => string[]; - -declare const keysIn: KeysIn; +import { keysIn } from "../fp"; export = keysIn; diff --git a/types/lodash/fp/last.d.ts b/types/lodash/fp/last.d.ts index 4473a221f9..f74171a309 100644 --- a/types/lodash/fp/last.d.ts +++ b/types/lodash/fp/last.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Last = - /** - * Gets the last element of array. - * - * @param array The array to query. - * @return Returns the last element of array. - */ - (array: _.List | null | undefined) => T | undefined; - -declare const last: Last; +import { last } from "../fp"; export = last; diff --git a/types/lodash/fp/lastIndexOf.d.ts b/types/lodash/fp/lastIndexOf.d.ts index a21af0a596..2d60e64837 100644 --- a/types/lodash/fp/lastIndexOf.d.ts +++ b/types/lodash/fp/lastIndexOf.d.ts @@ -1,58 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface LastIndexOf { - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (): LastIndexOf; - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (value: T): LastIndexOf1x1; - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (value: T, array: _.List | null | undefined): number; -} -interface LastIndexOf1x1 { - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (): LastIndexOf1x1; - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (array: _.List | null | undefined): number; -} - -declare const lastIndexOf: LastIndexOf; +import { lastIndexOf } from "../fp"; export = lastIndexOf; diff --git a/types/lodash/fp/lastIndexOfFrom.d.ts b/types/lodash/fp/lastIndexOfFrom.d.ts index 0bea8e22c7..7a2f23e5ae 100644 --- a/types/lodash/fp/lastIndexOfFrom.d.ts +++ b/types/lodash/fp/lastIndexOfFrom.d.ts @@ -1,96 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface LastIndexOf { - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (): LastIndexOf; - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (value: T): LastIndexOf1x1; - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (value: T, fromIndex: true|number): LastIndexOf1x2; - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (value: T, fromIndex: true|number, array: _.List | null | undefined): number; -} -interface LastIndexOf1x1 { - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (): LastIndexOf1x1; - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (fromIndex: true|number): LastIndexOf1x2; - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (fromIndex: true|number, array: _.List | null | undefined): number; -} -interface LastIndexOf1x2 { - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (): LastIndexOf1x2; - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - (array: _.List | null | undefined): number; -} - -declare const lastIndexOfFrom: LastIndexOf; +import { lastIndexOfFrom } from "../fp"; export = lastIndexOfFrom; diff --git a/types/lodash/fp/lowerCase.d.ts b/types/lodash/fp/lowerCase.d.ts index 628744e48b..1a5360fdbc 100644 --- a/types/lodash/fp/lowerCase.d.ts +++ b/types/lodash/fp/lowerCase.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type LowerCase = - /** - * Converts `string`, as space separated words, to lower case. - * - * @param string The string to convert. - * @return Returns the lower cased string. - */ - (string: string) => string; - -declare const lowerCase: LowerCase; +import { lowerCase } from "../fp"; export = lowerCase; diff --git a/types/lodash/fp/lowerFirst.d.ts b/types/lodash/fp/lowerFirst.d.ts index a88e572706..23ce92585d 100644 --- a/types/lodash/fp/lowerFirst.d.ts +++ b/types/lodash/fp/lowerFirst.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type LowerFirst = - /** - * Converts the first character of `string` to lower case. - * - * @param string The string to convert. - * @return Returns the converted string. - */ - (string: string) => string; - -declare const lowerFirst: LowerFirst; +import { lowerFirst } from "../fp"; export = lowerFirst; diff --git a/types/lodash/fp/lt.d.ts b/types/lodash/fp/lt.d.ts index 8259c6d845..a309bdce1a 100644 --- a/types/lodash/fp/lt.d.ts +++ b/types/lodash/fp/lt.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Lt { - /** - * Checks if value is less than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than other, else false. - */ - (): Lt; - /** - * Checks if value is less than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than other, else false. - */ - (value: any): Lt1x1; - /** - * Checks if value is less than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than other, else false. - */ - (value: any, other: any): boolean; -} -interface Lt1x1 { - /** - * Checks if value is less than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than other, else false. - */ - (): Lt1x1; - /** - * Checks if value is less than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than other, else false. - */ - (other: any): boolean; -} - -declare const lt: Lt; +import { lt } from "../fp"; export = lt; diff --git a/types/lodash/fp/lte.d.ts b/types/lodash/fp/lte.d.ts index e3ac6503f7..0d4af2cbe3 100644 --- a/types/lodash/fp/lte.d.ts +++ b/types/lodash/fp/lte.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Lte { - /** - * Checks if value is less than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than or equal to other, else false. - */ - (): Lte; - /** - * Checks if value is less than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than or equal to other, else false. - */ - (value: any): Lte1x1; - /** - * Checks if value is less than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than or equal to other, else false. - */ - (value: any, other: any): boolean; -} -interface Lte1x1 { - /** - * Checks if value is less than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than or equal to other, else false. - */ - (): Lte1x1; - /** - * Checks if value is less than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than or equal to other, else false. - */ - (other: any): boolean; -} - -declare const lte: Lte; +import { lte } from "../fp"; export = lte; diff --git a/types/lodash/fp/map.d.ts b/types/lodash/fp/map.d.ts index 900e11d0d0..17d014caf4 100644 --- a/types/lodash/fp/map.d.ts +++ b/types/lodash/fp/map.d.ts @@ -1,588 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Map { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: (value: T) => TResult): Map1x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: (value: T) => TResult, collection: T[] | _.List | null | undefined): TResult[]; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: (value: T[keyof T]) => TResult): Map3x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: (value: T[keyof T]) => TResult, collection: T | null | undefined): TResult[]; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: K): Map4x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: K, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): Array; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: string): Map5x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: string, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): any[]; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: object): Map6x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: object, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean[]; -} -interface Map1x1 { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map1x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (collection: T[] | _.List | null | undefined): TResult[]; -} -interface Map3x1 { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map3x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (collection: T | null | undefined): TResult[]; -} -interface Map4x1 { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map4x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): Array; -} -interface Map5x1 { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map5x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): any[]; -} -interface Map6x1 { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map6x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean[]; -} - -declare const map: Map; +import { map } from "../fp"; export = map; diff --git a/types/lodash/fp/mapKeys.d.ts b/types/lodash/fp/mapKeys.d.ts index 348fdff591..acc6d752d8 100644 --- a/types/lodash/fp/mapKeys.d.ts +++ b/types/lodash/fp/mapKeys.d.ts @@ -1,105 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface MapKeys { - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - (): MapKeys; - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - (iteratee: _.ValueIteratee): MapKeys1x1; - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - (iteratee: _.ValueIteratee, object: _.List | null | undefined): _.Dictionary; - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - (iteratee: _.ValueIteratee): MapKeys2x1; - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - (iteratee: _.ValueIteratee, object: T | null | undefined): _.Dictionary; -} -interface MapKeys1x1 { - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - (): MapKeys1x1; - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - (object: _.List | null | undefined): _.Dictionary; -} -interface MapKeys2x1 { - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - (): MapKeys2x1; - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - (object: T | null | undefined): _.Dictionary; -} - -declare const mapKeys: MapKeys; +import { mapKeys } from "../fp"; export = mapKeys; diff --git a/types/lodash/fp/mapValues.d.ts b/types/lodash/fp/mapValues.d.ts index ce44dda737..abef821aab 100644 --- a/types/lodash/fp/mapValues.d.ts +++ b/types/lodash/fp/mapValues.d.ts @@ -1,603 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface MapValues { - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (): MapValues; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (callback: (value: string) => TResult): MapValues1x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (callback: (value: string) => TResult, obj: string | null | undefined): _.NumericDictionary; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (callback: (value: T) => TResult): MapValues2x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (callback: (value: T) => TResult, obj: _.Dictionary | _.NumericDictionary | null | undefined): _.Dictionary; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (callback: (value: T[keyof T]) => TResult): MapValues3x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (callback: (value: T[keyof T]) => TResult, obj: T | null | undefined): { [P in keyof T]: TResult }; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (iteratee: object): MapValues4x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (iteratee: object, obj: _.Dictionary | _.NumericDictionary | null | undefined): _.Dictionary; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (iteratee: object, obj: T | null | undefined): { [P in keyof T]: boolean }; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (iteratee: TKey): MapValues6x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (iteratee: TKey, obj: _.Dictionary | _.NumericDictionary | null | undefined): _.Dictionary; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (iteratee: string): MapValues7x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (iteratee: string, obj: _.Dictionary | _.NumericDictionary | null | undefined): _.Dictionary; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (iteratee: string, obj: T | null | undefined): { [P in keyof T]: any }; -} -interface MapValues1x1 { - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (): MapValues1x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (obj: string | null | undefined): _.NumericDictionary; -} -interface MapValues2x1 { - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (): MapValues2x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (obj: _.Dictionary | _.NumericDictionary | null | undefined): _.Dictionary; -} -interface MapValues3x1 { - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (): MapValues3x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (obj: T | null | undefined): { [P in keyof T]: TResult }; -} -interface MapValues4x1 { - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (): MapValues4x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (obj: _.Dictionary | _.NumericDictionary | null | undefined): _.Dictionary; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (obj: T | null | undefined): { [P in keyof T]: boolean }; -} -interface MapValues6x1 { - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (): MapValues6x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (obj: _.Dictionary | _.NumericDictionary | null | undefined): _.Dictionary; -} -interface MapValues7x1 { - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (): MapValues7x1; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (obj: _.Dictionary | _.NumericDictionary | null | undefined): _.Dictionary; - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - (obj: T | null | undefined): { [P in keyof T]: any }; -} - -declare const mapValues: MapValues; +import { mapValues } from "../fp"; export = mapValues; diff --git a/types/lodash/fp/matches.d.ts b/types/lodash/fp/matches.d.ts index e197d6b711..e9796de4fb 100644 --- a/types/lodash/fp/matches.d.ts +++ b/types/lodash/fp/matches.d.ts @@ -1,116 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface IsMatch { - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (): IsMatch; - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (source: object): IsMatch1x1; - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (source: object, object: object): boolean; -} -interface IsMatch1x1 { - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (): IsMatch1x1; - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (object: object): boolean; -} - -declare const matches: IsMatch; +import { matches } from "../fp"; export = matches; diff --git a/types/lodash/fp/matchesProperty.d.ts b/types/lodash/fp/matchesProperty.d.ts index 8fec785733..81db8f75da 100644 --- a/types/lodash/fp/matchesProperty.d.ts +++ b/types/lodash/fp/matchesProperty.d.ts @@ -1,90 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface MatchesProperty { - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (): MatchesProperty; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (path: _.PropertyPath): MatchesProperty1x1; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (path: _.PropertyPath, srcValue: T): (value: any) => boolean; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (path: _.PropertyPath, srcValue: T): (value: V) => boolean; -} -interface MatchesProperty1x1 { - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (): MatchesProperty1x1; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (srcValue: T): (value: any) => boolean; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (srcValue: T): (value: V) => boolean; -} - -declare const matchesProperty: MatchesProperty; +import { matchesProperty } from "../fp"; export = matchesProperty; diff --git a/types/lodash/fp/max.d.ts b/types/lodash/fp/max.d.ts index 138dba542d..7b08dc52c6 100644 --- a/types/lodash/fp/max.d.ts +++ b/types/lodash/fp/max.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Max = - /** - * Computes the maximum value of `array`. If `array` is empty or falsey - * `undefined` is returned. - * - * @category Math - * @param array The array to iterate over. - * @returns Returns the maximum value. - */ - (collection: _.List | null | undefined) => T | undefined; - -declare const max: Max; +import { max } from "../fp"; export = max; diff --git a/types/lodash/fp/maxBy.d.ts b/types/lodash/fp/maxBy.d.ts index 44fb2ff7b1..68f30dd896 100644 --- a/types/lodash/fp/maxBy.d.ts +++ b/types/lodash/fp/maxBy.d.ts @@ -1,118 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface MaxBy { - /** - * This method is like `_.max` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the maximum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.maxBy(objects, function(o) { return o.a; }); - * // => { 'n': 2 } - * - * // using the `_.property` iteratee shorthand - * _.maxBy(objects, 'n'); - * // => { 'n': 2 } - */ - (): MaxBy; - /** - * This method is like `_.max` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the maximum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.maxBy(objects, function(o) { return o.a; }); - * // => { 'n': 2 } - * - * // using the `_.property` iteratee shorthand - * _.maxBy(objects, 'n'); - * // => { 'n': 2 } - */ - (iteratee: _.ValueIteratee): MaxBy1x1; - /** - * This method is like `_.max` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the maximum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.maxBy(objects, function(o) { return o.a; }); - * // => { 'n': 2 } - * - * // using the `_.property` iteratee shorthand - * _.maxBy(objects, 'n'); - * // => { 'n': 2 } - */ - (iteratee: _.ValueIteratee, collection: _.List | null | undefined): T | undefined; -} -interface MaxBy1x1 { - /** - * This method is like `_.max` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the maximum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.maxBy(objects, function(o) { return o.a; }); - * // => { 'n': 2 } - * - * // using the `_.property` iteratee shorthand - * _.maxBy(objects, 'n'); - * // => { 'n': 2 } - */ - (): MaxBy1x1; - /** - * This method is like `_.max` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the maximum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.maxBy(objects, function(o) { return o.a; }); - * // => { 'n': 2 } - * - * // using the `_.property` iteratee shorthand - * _.maxBy(objects, 'n'); - * // => { 'n': 2 } - */ - (collection: _.List | null | undefined): T | undefined; -} - -declare const maxBy: MaxBy; +import { maxBy } from "../fp"; export = maxBy; diff --git a/types/lodash/fp/mean.d.ts b/types/lodash/fp/mean.d.ts index 0e37afaeaf..a0b7e22e5b 100644 --- a/types/lodash/fp/mean.d.ts +++ b/types/lodash/fp/mean.d.ts @@ -1,22 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Mean = - /** - * Computes the mean of the values in `array`. - * - * @category Math - * @param array The array to iterate over. - * @returns Returns the mean. - * @example - * - * _.mean([4, 2, 8, 6]); - * // => 5 - */ - (collection: _.List | null | undefined) => number; - -declare const mean: Mean; +import { mean } from "../fp"; export = mean; diff --git a/types/lodash/fp/meanBy.d.ts b/types/lodash/fp/meanBy.d.ts index 7ae670a7b5..d76afd77c1 100644 --- a/types/lodash/fp/meanBy.d.ts +++ b/types/lodash/fp/meanBy.d.ts @@ -1,78 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface MeanBy { - /** - * Computes the mean of the provided propties of the objects in the `array` - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the mean. - * @example - * - * _.mean([{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }], 'n'); - * // => 5 - */ - (): MeanBy; - /** - * Computes the mean of the provided propties of the objects in the `array` - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the mean. - * @example - * - * _.mean([{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }], 'n'); - * // => 5 - */ - (iteratee: _.ValueIteratee): MeanBy1x1; - /** - * Computes the mean of the provided propties of the objects in the `array` - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the mean. - * @example - * - * _.mean([{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }], 'n'); - * // => 5 - */ - (iteratee: _.ValueIteratee, collection: _.List | null | undefined): number; -} -interface MeanBy1x1 { - /** - * Computes the mean of the provided propties of the objects in the `array` - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the mean. - * @example - * - * _.mean([{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }], 'n'); - * // => 5 - */ - (): MeanBy1x1; - /** - * Computes the mean of the provided propties of the objects in the `array` - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the mean. - * @example - * - * _.mean([{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }], 'n'); - * // => 5 - */ - (collection: _.List | null | undefined): number; -} - -declare const meanBy: MeanBy; +import { meanBy } from "../fp"; export = meanBy; diff --git a/types/lodash/fp/memoize.d.ts b/types/lodash/fp/memoize.d.ts index c694ae0909..a60b79cafa 100644 --- a/types/lodash/fp/memoize.d.ts +++ b/types/lodash/fp/memoize.d.ts @@ -1,21 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Memoize = - /** - * Creates a function that memoizes the result of func. If resolver is provided it determines the cache key for - * storing the result based on the arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is coerced to a string and used as the cache key. The func is invoked with - * the this binding of the memoized function. - * - * @param func The function to have its output memoized. - * @param resolver The function to resolve the cache key. - * @return Returns the new memoizing function. - */ - any>(func: T) => T & _.MemoizedFunction; - -declare const memoize: Memoize; +import { memoize } from "../fp"; export = memoize; diff --git a/types/lodash/fp/merge.d.ts b/types/lodash/fp/merge.d.ts index fe05c22488..f80117b7e9 100644 --- a/types/lodash/fp/merge.d.ts +++ b/types/lodash/fp/merge.d.ts @@ -1,151 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Merge { - /** - * Recursively merges own and inherited enumerable properties of source - * objects into the destination object, skipping source properties that resolve - * to `undefined`. Array and plain object properties are merged recursively. - * Other objects and value types are overridden by assignment. Source objects - * are applied from left to right. Subsequent sources overwrite property - * assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - */ - (): Merge; - /** - * Recursively merges own and inherited enumerable properties of source - * objects into the destination object, skipping source properties that resolve - * to `undefined`. Array and plain object properties are merged recursively. - * Other objects and value types are overridden by assignment. Source objects - * are applied from left to right. Subsequent sources overwrite property - * assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - */ - (object: TObject): Merge1x1; - /** - * Recursively merges own and inherited enumerable properties of source - * objects into the destination object, skipping source properties that resolve - * to `undefined`. Array and plain object properties are merged recursively. - * Other objects and value types are overridden by assignment. Source objects - * are applied from left to right. Subsequent sources overwrite property - * assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - */ - (object: TObject, source: TSource): TObject & TSource; -} -interface Merge1x1 { - /** - * Recursively merges own and inherited enumerable properties of source - * objects into the destination object, skipping source properties that resolve - * to `undefined`. Array and plain object properties are merged recursively. - * Other objects and value types are overridden by assignment. Source objects - * are applied from left to right. Subsequent sources overwrite property - * assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - */ - (): Merge1x1; - /** - * Recursively merges own and inherited enumerable properties of source - * objects into the destination object, skipping source properties that resolve - * to `undefined`. Array and plain object properties are merged recursively. - * Other objects and value types are overridden by assignment. Source objects - * are applied from left to right. Subsequent sources overwrite property - * assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - */ - (source: TSource): TObject & TSource; -} - -declare const merge: Merge; +import { merge } from "../fp"; export = merge; diff --git a/types/lodash/fp/mergeAll.d.ts b/types/lodash/fp/mergeAll.d.ts index 350ef6110c..6b462d85cb 100644 --- a/types/lodash/fp/mergeAll.d.ts +++ b/types/lodash/fp/mergeAll.d.ts @@ -1,36 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Merge = - /** - * Recursively merges own and inherited enumerable properties of source - * objects into the destination object, skipping source properties that resolve - * to `undefined`. Array and plain object properties are merged recursively. - * Other objects and value types are overridden by assignment. Source objects - * are applied from left to right. Subsequent sources overwrite property - * assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - */ - (object: ReadonlyArray) => any; - -declare const mergeAll: Merge; +import { mergeAll } from "../fp"; export = mergeAll; diff --git a/types/lodash/fp/mergeAllWith.d.ts b/types/lodash/fp/mergeAllWith.d.ts index 96be3f4db9..3d2f7f296e 100644 --- a/types/lodash/fp/mergeAllWith.d.ts +++ b/types/lodash/fp/mergeAllWith.d.ts @@ -1,183 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface MergeWith { - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (): MergeWith; - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (customizer: _.MergeWithCustomizer): MergeWith1x1; - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (customizer: _.MergeWithCustomizer, args: ReadonlyArray): any; -} -interface MergeWith1x1 { - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (): MergeWith1x1; - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (args: ReadonlyArray): any; -} - -declare const mergeAllWith: MergeWith; +import { mergeAllWith } from "../fp"; export = mergeAllWith; diff --git a/types/lodash/fp/mergeWith.d.ts b/types/lodash/fp/mergeWith.d.ts index 64556114df..d1f541e81b 100644 --- a/types/lodash/fp/mergeWith.d.ts +++ b/types/lodash/fp/mergeWith.d.ts @@ -1,321 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface MergeWith { - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (): MergeWith; - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (customizer: _.MergeWithCustomizer): MergeWith1x1; - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (customizer: _.MergeWithCustomizer, object: TObject): MergeWith1x2; - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (customizer: _.MergeWithCustomizer, object: TObject, source: TSource): TObject & TSource; -} -interface MergeWith1x1 { - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (): MergeWith1x1; - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (object: TObject): MergeWith1x2; - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (object: TObject, source: TSource): TObject & TSource; -} -interface MergeWith1x2 { - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (): MergeWith1x2; - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - (source: TSource): TObject & TSource; -} - -declare const mergeWith: MergeWith; +import { mergeWith } from "../fp"; export = mergeWith; diff --git a/types/lodash/fp/method.d.ts b/types/lodash/fp/method.d.ts index e44efd9f07..f9f2ee8795 100644 --- a/types/lodash/fp/method.d.ts +++ b/types/lodash/fp/method.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Method = - /** - * Creates a function that invokes the method at path on a given object. Any additional arguments are provided - * to the invoked method. - * - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - * @return Returns the new function. - */ - (path: _.PropertyPath) => (object: any) => any; - -declare const method: Method; +import { method } from "../fp"; export = method; diff --git a/types/lodash/fp/methodOf.d.ts b/types/lodash/fp/methodOf.d.ts index 6a1a908de7..a9e0e4fe14 100644 --- a/types/lodash/fp/methodOf.d.ts +++ b/types/lodash/fp/methodOf.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type MethodOf = - /** - * The opposite of _.method; this method creates a function that invokes the method at a given path on object. - * Any additional arguments are provided to the invoked method. - * - * @param object The object to query. - * @param args The arguments to invoke the method with. - * @return Returns the new function. - */ - (object: object) => (path: _.PropertyPath) => any; - -declare const methodOf: MethodOf; +import { methodOf } from "../fp"; export = methodOf; diff --git a/types/lodash/fp/min.d.ts b/types/lodash/fp/min.d.ts index f637f397ac..7c80ab0ff9 100644 --- a/types/lodash/fp/min.d.ts +++ b/types/lodash/fp/min.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Min = - /** - * Computes the minimum value of `array`. If `array` is empty or falsey - * `undefined` is returned. - * - * @category Math - * @param array The array to iterate over. - * @returns Returns the minimum value. - */ - (collection: _.List | null | undefined) => T | undefined; - -declare const min: Min; +import { min } from "../fp"; export = min; diff --git a/types/lodash/fp/minBy.d.ts b/types/lodash/fp/minBy.d.ts index b9bdebecd8..020a8f506c 100644 --- a/types/lodash/fp/minBy.d.ts +++ b/types/lodash/fp/minBy.d.ts @@ -1,118 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface MinBy { - /** - * This method is like `_.min` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the minimum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.minBy(objects, function(o) { return o.a; }); - * // => { 'n': 1 } - * - * // using the `_.property` iteratee shorthand - * _.minBy(objects, 'n'); - * // => { 'n': 1 } - */ - (): MinBy; - /** - * This method is like `_.min` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the minimum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.minBy(objects, function(o) { return o.a; }); - * // => { 'n': 1 } - * - * // using the `_.property` iteratee shorthand - * _.minBy(objects, 'n'); - * // => { 'n': 1 } - */ - (iteratee: _.ValueIteratee): MinBy1x1; - /** - * This method is like `_.min` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the minimum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.minBy(objects, function(o) { return o.a; }); - * // => { 'n': 1 } - * - * // using the `_.property` iteratee shorthand - * _.minBy(objects, 'n'); - * // => { 'n': 1 } - */ - (iteratee: _.ValueIteratee, collection: _.List | null | undefined): T | undefined; -} -interface MinBy1x1 { - /** - * This method is like `_.min` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the minimum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.minBy(objects, function(o) { return o.a; }); - * // => { 'n': 1 } - * - * // using the `_.property` iteratee shorthand - * _.minBy(objects, 'n'); - * // => { 'n': 1 } - */ - (): MinBy1x1; - /** - * This method is like `_.min` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the minimum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.minBy(objects, function(o) { return o.a; }); - * // => { 'n': 1 } - * - * // using the `_.property` iteratee shorthand - * _.minBy(objects, 'n'); - * // => { 'n': 1 } - */ - (collection: _.List | null | undefined): T | undefined; -} - -declare const minBy: MinBy; +import { minBy } from "../fp"; export = minBy; diff --git a/types/lodash/fp/multiply.d.ts b/types/lodash/fp/multiply.d.ts index a335372aac..b3e5f3abd9 100644 --- a/types/lodash/fp/multiply.d.ts +++ b/types/lodash/fp/multiply.d.ts @@ -1,46 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Multiply { - /** - * Multiply two numbers. - * @param multiplier The first number in a multiplication. - * @param multiplicand The second number in a multiplication. - * @returns Returns the product. - */ - (): Multiply; - /** - * Multiply two numbers. - * @param multiplier The first number in a multiplication. - * @param multiplicand The second number in a multiplication. - * @returns Returns the product. - */ - (multiplier: number): Multiply1x1; - /** - * Multiply two numbers. - * @param multiplier The first number in a multiplication. - * @param multiplicand The second number in a multiplication. - * @returns Returns the product. - */ - (multiplier: number, multiplicand: number): number; -} -interface Multiply1x1 { - /** - * Multiply two numbers. - * @param multiplier The first number in a multiplication. - * @param multiplicand The second number in a multiplication. - * @returns Returns the product. - */ - (): Multiply1x1; - /** - * Multiply two numbers. - * @param multiplier The first number in a multiplication. - * @param multiplicand The second number in a multiplication. - * @returns Returns the product. - */ - (multiplicand: number): number; -} - -declare const multiply: Multiply; +import { multiply } from "../fp"; export = multiply; diff --git a/types/lodash/fp/nAry.d.ts b/types/lodash/fp/nAry.d.ts index daede14899..882e4a37d6 100644 --- a/types/lodash/fp/nAry.d.ts +++ b/types/lodash/fp/nAry.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Ary { - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - (): Ary; - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - (n: number): Ary1x1; - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - (n: number, func: (...args: any[]) => any): (...args: any[]) => any; -} -interface Ary1x1 { - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - (): Ary1x1; - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - (func: (...args: any[]) => any): (...args: any[]) => any; -} - -declare const nAry: Ary; +import { nAry } from "../fp"; export = nAry; diff --git a/types/lodash/fp/negate.d.ts b/types/lodash/fp/negate.d.ts index 681c5be961..a7693c1928 100644 --- a/types/lodash/fp/negate.d.ts +++ b/types/lodash/fp/negate.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Negate = - /** - * 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. - */ - any>(predicate: T) => T; - -declare const negate: Negate; +import { negate } from "../fp"; export = negate; diff --git a/types/lodash/fp/noConflict.d.ts b/types/lodash/fp/noConflict.d.ts index 2b1a6c71c9..7694f5aa5a 100644 --- a/types/lodash/fp/noConflict.d.ts +++ b/types/lodash/fp/noConflict.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type NoConflict = - /** - * Reverts the _ variable to its previous value and returns a reference to the lodash function. - * - * @return Returns the lodash function. - */ - () => typeof _; - -declare const noConflict: NoConflict; +import { noConflict } from "../fp"; export = noConflict; diff --git a/types/lodash/fp/noop.d.ts b/types/lodash/fp/noop.d.ts index 29ce7267ea..5b6a27b61a 100644 --- a/types/lodash/fp/noop.d.ts +++ b/types/lodash/fp/noop.d.ts @@ -1,14 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Noop = - /** - * A no-operation function that returns undefined regardless of the arguments it receives. - * - * @return undefined - */ - (...args: any[]) => void; - -declare const noop: Noop; +import { noop } from "../fp"; export = noop; diff --git a/types/lodash/fp/now.d.ts b/types/lodash/fp/now.d.ts index d450c76116..fdbbd2bcf7 100644 --- a/types/lodash/fp/now.d.ts +++ b/types/lodash/fp/now.d.ts @@ -1,14 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Now = - /** - * Gets the number of milliseconds that have elapsed since the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @return The number of milliseconds. - */ - () => number; - -declare const now: Now; +import { now } from "../fp"; export = now; diff --git a/types/lodash/fp/nth.d.ts b/types/lodash/fp/nth.d.ts index a1fbedb1bf..e3987e17cb 100644 --- a/types/lodash/fp/nth.d.ts +++ b/types/lodash/fp/nth.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Nth { - /** - * Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned. - * - * @param array array The array to query. - * @param value The index of the element to return. - * @return Returns the nth element of `array`. - */ - (): Nth; - /** - * Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned. - * - * @param array array The array to query. - * @param value The index of the element to return. - * @return Returns the nth element of `array`. - */ - (n: number): Nth1x1; - /** - * Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned. - * - * @param array array The array to query. - * @param value The index of the element to return. - * @return Returns the nth element of `array`. - */ - (n: number, array: _.List | null | undefined): T | undefined; -} -interface Nth1x1 { - /** - * Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned. - * - * @param array array The array to query. - * @param value The index of the element to return. - * @return Returns the nth element of `array`. - */ - (): Nth1x1; - /** - * Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned. - * - * @param array array The array to query. - * @param value The index of the element to return. - * @return Returns the nth element of `array`. - */ - (array: _.List | null | undefined): T | undefined; -} - -declare const nth: Nth; +import { nth } from "../fp"; export = nth; diff --git a/types/lodash/fp/nthArg.d.ts b/types/lodash/fp/nthArg.d.ts index 5e8335943b..216c9bbab2 100644 --- a/types/lodash/fp/nthArg.d.ts +++ b/types/lodash/fp/nthArg.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type NthArg = - /** - * Creates a function that returns its nth argument. - * - * @param n The index of the argument to return. - * @return Returns the new function. - */ - (n: number) => (...args: any[]) => any; - -declare const nthArg: NthArg; +import { nthArg } from "../fp"; export = nthArg; diff --git a/types/lodash/fp/omit.d.ts b/types/lodash/fp/omit.d.ts index 5c7a553b9f..1cd1b7fcc3 100644 --- a/types/lodash/fp/omit.d.ts +++ b/types/lodash/fp/omit.d.ts @@ -1,132 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Omit { - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (): Omit; - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (paths: _.PropertyPath): Omit1x1; - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (paths: _.PropertyPath, object: T | null | undefined): T; - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (paths: _.PropertyPath, object: T | null | undefined): _.PartialObject; -} -interface Omit1x1 { - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (): Omit1x1; - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (object: T | null | undefined): T; - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (object: T | null | undefined): _.PartialObject; -} - -declare const omit: Omit; +import { omit } from "../fp"; export = omit; diff --git a/types/lodash/fp/omitAll.d.ts b/types/lodash/fp/omitAll.d.ts index a3aec48c5f..dab5cfa5fc 100644 --- a/types/lodash/fp/omitAll.d.ts +++ b/types/lodash/fp/omitAll.d.ts @@ -1,132 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Omit { - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (): Omit; - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (paths: _.PropertyPath): Omit1x1; - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (paths: _.PropertyPath, object: T | null | undefined): T; - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (paths: _.PropertyPath, object: T | null | undefined): _.PartialObject; -} -interface Omit1x1 { - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (): Omit1x1; - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (object: T | null | undefined): T; - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - (object: T | null | undefined): _.PartialObject; -} - -declare const omitAll: Omit; +import { omitAll } from "../fp"; export = omitAll; diff --git a/types/lodash/fp/omitBy.d.ts b/types/lodash/fp/omitBy.d.ts index b0bf665afc..8be4f5b40b 100644 --- a/types/lodash/fp/omitBy.d.ts +++ b/types/lodash/fp/omitBy.d.ts @@ -1,98 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface OmitBy { - /** - * The opposite of `_.pickBy`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that `predicate` - * doesn't return truthy for. - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } - */ - (): OmitBy; - /** - * The opposite of `_.pickBy`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that `predicate` - * doesn't return truthy for. - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } - */ - (predicate: _.ValueKeyIteratee): OmitBy1x1; - /** - * The opposite of `_.pickBy`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that `predicate` - * doesn't return truthy for. - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } - */ - (predicate: _.ValueKeyIteratee, object: T | null | undefined): _.PartialObject; -} -interface OmitBy1x1 { - /** - * The opposite of `_.pickBy`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that `predicate` - * doesn't return truthy for. - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } - */ - (): OmitBy1x1; - /** - * The opposite of `_.pickBy`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that `predicate` - * doesn't return truthy for. - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } - */ - (object: T1 | null | undefined): _.PartialObject; -} - -declare const omitBy: OmitBy; +import { omitBy } from "../fp"; export = omitBy; diff --git a/types/lodash/fp/once.d.ts b/types/lodash/fp/once.d.ts index f97a08a13e..24d859cc53 100644 --- a/types/lodash/fp/once.d.ts +++ b/types/lodash/fp/once.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Once = - /** - * Creates a function that is restricted to invoking func once. Repeat calls to the function return the value - * of the first call. The func is invoked with the this binding and arguments of the created function. - * - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - any>(func: T) => T; - -declare const once: Once; +import { once } from "../fp"; export = once; diff --git a/types/lodash/fp/orderBy.d.ts b/types/lodash/fp/orderBy.d.ts index 4cf7048978..9443fcfc22 100644 --- a/types/lodash/fp/orderBy.d.ts +++ b/types/lodash/fp/orderBy.d.ts @@ -1,461 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface OrderBy { - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (): OrderBy; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (iteratees: _.Many<(value: T) => _.NotVoid>): OrderBy1x1; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (iteratees: _.Many<(value: T) => _.NotVoid>, orders: _.Many): OrderBy1x2; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (iteratees: _.Many<(value: T) => _.NotVoid> | _.Many<_.ValueIteratee>, orders: _.Many, collection: _.List | null | undefined): T[]; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (iteratees: _.Many<_.ValueIteratee>): OrderBy2x1; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (iteratees: _.Many<_.ValueIteratee>, orders: _.Many): OrderBy2x2; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (iteratees: _.Many<(value: T[keyof T]) => _.NotVoid> | _.Many<_.ValueIteratee>, orders: _.Many, collection: T | null | undefined): Array; -} -interface OrderBy1x1 { - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (): OrderBy1x1; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (orders: _.Many): OrderBy1x2; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (orders: _.Many, collection: _.List | object | null | undefined): T[]; -} -interface OrderBy1x2 { - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (): OrderBy1x2; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (collection: _.List | object | null | undefined): T[]; -} -interface OrderBy2x1 { - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (): OrderBy2x1; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (orders: _.Many): OrderBy2x2; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (orders: _.Many, collection: _.List | object | null | undefined): T[]; -} -interface OrderBy2x2 { - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (): OrderBy2x2; - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (collection: _.List | object | null | undefined): T[]; -} - -declare const orderBy: OrderBy; +import { orderBy } from "../fp"; export = orderBy; diff --git a/types/lodash/fp/over.d.ts b/types/lodash/fp/over.d.ts index 4bd1803827..1bd2502fdc 100644 --- a/types/lodash/fp/over.d.ts +++ b/types/lodash/fp/over.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Over = - /** - * Creates a function that invokes iteratees with the arguments provided to the created function and returns - * their results. - * - * @param iteratees The iteratees to invoke. - * @return Returns the new function. - */ - (iteratees: _.Many<(...args: any[]) => TResult>) => (...args: any[]) => TResult[]; - -declare const over: Over; +import { over } from "../fp"; export = over; diff --git a/types/lodash/fp/overArgs.d.ts b/types/lodash/fp/overArgs.d.ts index 84241e3e58..c054c92707 100644 --- a/types/lodash/fp/overArgs.d.ts +++ b/types/lodash/fp/overArgs.d.ts @@ -1,58 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface OverArgs { - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - (): OverArgs; - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - (func: (...args: any[]) => any): OverArgs1x1; - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - (func: (...args: any[]) => any, transforms: _.Many<(...args: any[]) => any>): (...args: any[]) => any; -} -interface OverArgs1x1 { - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - (): OverArgs1x1; - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - (transforms: _.Many<(...args: any[]) => any>): (...args: any[]) => any; -} - -declare const overArgs: OverArgs; +import { overArgs } from "../fp"; export = overArgs; diff --git a/types/lodash/fp/overEvery.d.ts b/types/lodash/fp/overEvery.d.ts index 3ebf8e2abf..1cf8b4061b 100644 --- a/types/lodash/fp/overEvery.d.ts +++ b/types/lodash/fp/overEvery.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type OverEvery = - /** - * Creates a function that checks if all of the predicates return truthy when invoked with the arguments - * provided to the created function. - * - * @param predicates The predicates to check. - * @return Returns the new function. - */ - (predicates: _.Many<(...args: T[]) => boolean>) => (...args: T[]) => boolean; - -declare const overEvery: OverEvery; +import { overEvery } from "../fp"; export = overEvery; diff --git a/types/lodash/fp/overSome.d.ts b/types/lodash/fp/overSome.d.ts index 75315b07d0..6b098b73b3 100644 --- a/types/lodash/fp/overSome.d.ts +++ b/types/lodash/fp/overSome.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type OverSome = - /** - * Creates a function that checks if any of the predicates return truthy when invoked with the arguments - * provided to the created function. - * - * @param predicates The predicates to check. - * @return Returns the new function. - */ - (predicates: _.Many<(...args: T[]) => boolean>) => (...args: T[]) => boolean; - -declare const overSome: OverSome; +import { overSome } from "../fp"; export = overSome; diff --git a/types/lodash/fp/pad.d.ts b/types/lodash/fp/pad.d.ts index e6581046a2..a5519771dd 100644 --- a/types/lodash/fp/pad.d.ts +++ b/types/lodash/fp/pad.d.ts @@ -1,61 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Pad { - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): Pad; - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number): Pad1x1; - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number, string: string): string; -} -interface Pad1x1 { - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): Pad1x1; - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (string: string): string; -} - -declare const pad: Pad; +import { pad } from "../fp"; export = pad; diff --git a/types/lodash/fp/padChars.d.ts b/types/lodash/fp/padChars.d.ts index 11d797db06..74d1aabbbf 100644 --- a/types/lodash/fp/padChars.d.ts +++ b/types/lodash/fp/padChars.d.ts @@ -1,103 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Pad { - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): Pad; - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (chars: string): Pad1x1; - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (chars: string, length: number): Pad1x2; - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (chars: string, length: number, string: string): string; -} -interface Pad1x1 { - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): Pad1x1; - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number): Pad1x2; - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number, string: string): string; -} -interface Pad1x2 { - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): Pad1x2; - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (string: string): string; -} - -declare const padChars: Pad; +import { padChars } from "../fp"; export = padChars; diff --git a/types/lodash/fp/padCharsEnd.d.ts b/types/lodash/fp/padCharsEnd.d.ts index 01ec387810..3a468dc11f 100644 --- a/types/lodash/fp/padCharsEnd.d.ts +++ b/types/lodash/fp/padCharsEnd.d.ts @@ -1,103 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface PadEnd { - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): PadEnd; - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (chars: string): PadEnd1x1; - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (chars: string, length: number): PadEnd1x2; - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (chars: string, length: number, string: string): string; -} -interface PadEnd1x1 { - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): PadEnd1x1; - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number): PadEnd1x2; - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number, string: string): string; -} -interface PadEnd1x2 { - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): PadEnd1x2; - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (string: string): string; -} - -declare const padCharsEnd: PadEnd; +import { padCharsEnd } from "../fp"; export = padCharsEnd; diff --git a/types/lodash/fp/padCharsStart.d.ts b/types/lodash/fp/padCharsStart.d.ts index cc760b7d0a..a22523505f 100644 --- a/types/lodash/fp/padCharsStart.d.ts +++ b/types/lodash/fp/padCharsStart.d.ts @@ -1,103 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface PadStart { - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): PadStart; - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (chars: string): PadStart1x1; - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (chars: string, length: number): PadStart1x2; - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (chars: string, length: number, string: string): string; -} -interface PadStart1x1 { - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): PadStart1x1; - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number): PadStart1x2; - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number, string: string): string; -} -interface PadStart1x2 { - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): PadStart1x2; - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (string: string): string; -} - -declare const padCharsStart: PadStart; +import { padCharsStart } from "../fp"; export = padCharsStart; diff --git a/types/lodash/fp/padEnd.d.ts b/types/lodash/fp/padEnd.d.ts index aefc8b35ff..5c4e4d80ba 100644 --- a/types/lodash/fp/padEnd.d.ts +++ b/types/lodash/fp/padEnd.d.ts @@ -1,61 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface PadEnd { - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): PadEnd; - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number): PadEnd1x1; - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number, string: string): string; -} -interface PadEnd1x1 { - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): PadEnd1x1; - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (string: string): string; -} - -declare const padEnd: PadEnd; +import { padEnd } from "../fp"; export = padEnd; diff --git a/types/lodash/fp/padStart.d.ts b/types/lodash/fp/padStart.d.ts index a40e611e8c..a4fca5d1ec 100644 --- a/types/lodash/fp/padStart.d.ts +++ b/types/lodash/fp/padStart.d.ts @@ -1,61 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface PadStart { - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): PadStart; - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number): PadStart1x1; - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (length: number, string: string): string; -} -interface PadStart1x1 { - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (): PadStart1x1; - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - (string: string): string; -} - -declare const padStart: PadStart; +import { padStart } from "../fp"; export = padStart; diff --git a/types/lodash/fp/parseInt.d.ts b/types/lodash/fp/parseInt.d.ts index b4257213bd..47aff97b71 100644 --- a/types/lodash/fp/parseInt.d.ts +++ b/types/lodash/fp/parseInt.d.ts @@ -1,66 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface ParseInt { - /** - * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used - * unless value is a hexadecimal, in which case a radix of 16 is used. - * - * Note: This method aligns with the ES5 implementation of parseInt. - * - * @param string The string to convert. - * @param radix The radix to interpret value by. - * @return Returns the converted integer. - */ - (): ParseInt; - /** - * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used - * unless value is a hexadecimal, in which case a radix of 16 is used. - * - * Note: This method aligns with the ES5 implementation of parseInt. - * - * @param string The string to convert. - * @param radix The radix to interpret value by. - * @return Returns the converted integer. - */ - (radix: number): ParseInt1x1; - /** - * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used - * unless value is a hexadecimal, in which case a radix of 16 is used. - * - * Note: This method aligns with the ES5 implementation of parseInt. - * - * @param string The string to convert. - * @param radix The radix to interpret value by. - * @return Returns the converted integer. - */ - (radix: number, string: string): number; -} -interface ParseInt1x1 { - /** - * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used - * unless value is a hexadecimal, in which case a radix of 16 is used. - * - * Note: This method aligns with the ES5 implementation of parseInt. - * - * @param string The string to convert. - * @param radix The radix to interpret value by. - * @return Returns the converted integer. - */ - (): ParseInt1x1; - /** - * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used - * unless value is a hexadecimal, in which case a radix of 16 is used. - * - * Note: This method aligns with the ES5 implementation of parseInt. - * - * @param string The string to convert. - * @param radix The radix to interpret value by. - * @return Returns the converted integer. - */ - (string: string): number; -} - -declare const parseInt: ParseInt; +import { parseInt } from "../fp"; export = parseInt; diff --git a/types/lodash/fp/partial.d.ts b/types/lodash/fp/partial.d.ts index 37c796b0b8..f5ebd726e5 100644 --- a/types/lodash/fp/partial.d.ts +++ b/types/lodash/fp/partial.d.ts @@ -1,56 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Partial { - /** - * Creates a function that, when called, invokes func with any additional partial arguments - * prepended to those provided to the new function. This method is similar to _.bind except - * it does not alter the this binding. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - (): Partial; - /** - * Creates a function that, when called, invokes func with any additional partial arguments - * prepended to those provided to the new function. This method is similar to _.bind except - * it does not alter the this binding. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - (args: ReadonlyArray): Partial1x1; - /** - * Creates a function that, when called, invokes func with any additional partial arguments - * prepended to those provided to the new function. This method is similar to _.bind except - * it does not alter the this binding. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - (args: ReadonlyArray, func: (...args: any[]) => any): (...args: any[]) => any; -} -interface Partial1x1 { - /** - * Creates a function that, when called, invokes func with any additional partial arguments - * prepended to those provided to the new function. This method is similar to _.bind except - * it does not alter the this binding. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - (): Partial1x1; - /** - * Creates a function that, when called, invokes func with any additional partial arguments - * prepended to those provided to the new function. This method is similar to _.bind except - * it does not alter the this binding. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - (func: (...args: any[]) => any): (...args: any[]) => any; -} - -declare const partial: Partial; +import { partial } from "../fp"; export = partial; diff --git a/types/lodash/fp/partialRight.d.ts b/types/lodash/fp/partialRight.d.ts index d148198d3b..bc0fa1b9c6 100644 --- a/types/lodash/fp/partialRight.d.ts +++ b/types/lodash/fp/partialRight.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface PartialRight { - /** - * This method is like _.partial except that partial arguments are appended to those provided - * to the new function. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - (): PartialRight; - /** - * This method is like _.partial except that partial arguments are appended to those provided - * to the new function. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - (args: ReadonlyArray): PartialRight1x1; - /** - * This method is like _.partial except that partial arguments are appended to those provided - * to the new function. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - (args: ReadonlyArray, func: (...args: any[]) => any): (...args: any[]) => any; -} -interface PartialRight1x1 { - /** - * This method is like _.partial except that partial arguments are appended to those provided - * to the new function. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - (): PartialRight1x1; - /** - * This method is like _.partial except that partial arguments are appended to those provided - * to the new function. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - (func: (...args: any[]) => any): (...args: any[]) => any; -} - -declare const partialRight: PartialRight; +import { partialRight } from "../fp"; export = partialRight; diff --git a/types/lodash/fp/partition.d.ts b/types/lodash/fp/partition.d.ts index 5e97fd95de..6ad41cd7db 100644 --- a/types/lodash/fp/partition.d.ts +++ b/types/lodash/fp/partition.d.ts @@ -1,133 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Partition { - /** - * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, - * while the second of which contains elements predicate returns falsey for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback - * returns the property value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback - * returns true for elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns - * true for elements that have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the array of grouped elements. - **/ - (): Partition; - /** - * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, - * while the second of which contains elements predicate returns falsey for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback - * returns the property value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback - * returns true for elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns - * true for elements that have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the array of grouped elements. - **/ - (callback: _.ValueIteratee): Partition1x1; - /** - * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, - * while the second of which contains elements predicate returns falsey for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback - * returns the property value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback - * returns true for elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns - * true for elements that have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the array of grouped elements. - **/ - (callback: _.ValueIteratee, collection: _.List | null | undefined): [T[], T[]]; - /** - * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, - * while the second of which contains elements predicate returns falsey for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback - * returns the property value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback - * returns true for elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns - * true for elements that have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the array of grouped elements. - **/ - (callback: _.ValueIteratee, collection: T | null | undefined): [Array, Array]; -} -interface Partition1x1 { - /** - * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, - * while the second of which contains elements predicate returns falsey for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback - * returns the property value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback - * returns true for elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns - * true for elements that have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the array of grouped elements. - **/ - (): Partition1x1; - /** - * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, - * while the second of which contains elements predicate returns falsey for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback - * returns the property value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback - * returns true for elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns - * true for elements that have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the array of grouped elements. - **/ - (collection: _.List | object | null | undefined): [T[], T[]]; -} - -declare const partition: Partition; +import { partition } from "../fp"; export = partition; diff --git a/types/lodash/fp/path.d.ts b/types/lodash/fp/path.d.ts index cb8b94efaf..db86d6023d 100644 --- a/types/lodash/fp/path.d.ts +++ b/types/lodash/fp/path.d.ts @@ -1,207 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Get { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey]): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject): TObject[TKey]; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number): Get3x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary): T; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary | null | undefined): T | undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get5x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: null | undefined): undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: any): any; -} -interface Get1x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject): TObject[TKey]; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject | null | undefined): TObject[TKey] | undefined; -} -interface Get3x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get3x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary): T; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary | null | undefined): T | undefined; -} -interface Get5x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get5x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: null | undefined): undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: any): any; -} - -declare const path: Get; +import { path } from "../fp"; export = path; diff --git a/types/lodash/fp/pathEq.d.ts b/types/lodash/fp/pathEq.d.ts index 569fffabf8..9f328756c3 100644 --- a/types/lodash/fp/pathEq.d.ts +++ b/types/lodash/fp/pathEq.d.ts @@ -1,90 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface MatchesProperty { - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (): MatchesProperty; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (path: _.PropertyPath): MatchesProperty1x1; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (path: _.PropertyPath, srcValue: T): (value: any) => boolean; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (path: _.PropertyPath, srcValue: T): (value: V) => boolean; -} -interface MatchesProperty1x1 { - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (): MatchesProperty1x1; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (srcValue: T): (value: any) => boolean; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (srcValue: T): (value: V) => boolean; -} - -declare const pathEq: MatchesProperty; +import { pathEq } from "../fp"; export = pathEq; diff --git a/types/lodash/fp/pathOr.d.ts b/types/lodash/fp/pathOr.d.ts index a62252ce03..6cad6b1836 100644 --- a/types/lodash/fp/pathOr.d.ts +++ b/types/lodash/fp/pathOr.d.ts @@ -1,313 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Get { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: TKey | [TKey]): Get1x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: number): Get2x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: number, object: _.NumericDictionary | null | undefined): T | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: _.PropertyPath): Get3x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: _.PropertyPath, object: null | undefined): TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: any): Get4x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: any, path: _.PropertyPath): Get4x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: any, path: _.PropertyPath, object: any): any; -} -interface Get1x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey]): Get1x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number): Get2x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary | null | undefined): T | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get3x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: null | undefined): TDefault; -} -interface Get1x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject | null | undefined): TObject[TKey] | TDefault; -} -interface Get2x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get2x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary | null | undefined): T | TDefault; -} -interface Get3x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get3x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: null | undefined): TDefault; -} -interface Get4x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get4x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get4x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: any): any; -} -interface Get4x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get4x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: any): any; -} - -declare const pathOr: Get; +import { pathOr } from "../fp"; export = pathOr; diff --git a/types/lodash/fp/paths.d.ts b/types/lodash/fp/paths.d.ts index 6aa6bcb6e5..1e6eb8908f 100644 --- a/types/lodash/fp/paths.d.ts +++ b/types/lodash/fp/paths.d.ts @@ -1,96 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface At { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (): At; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.PropertyPath): At1x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.PropertyPath, object: _.List | _.Dictionary | _.NumericDictionary | null | undefined): T[]; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.Many): At2x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.Many, object: T | null | undefined): Array; -} -interface At1x1 { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (): At1x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (object: _.List | _.Dictionary | _.NumericDictionary | null | undefined): T[]; -} -interface At2x1 { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (): At2x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (object: T | null | undefined): Array; -} - -declare const paths: At; +import { paths } from "../fp"; export = paths; diff --git a/types/lodash/fp/pick.d.ts b/types/lodash/fp/pick.d.ts index d90def9925..4772ecacc3 100644 --- a/types/lodash/fp/pick.d.ts +++ b/types/lodash/fp/pick.d.ts @@ -1,159 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface LodashPick { - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (): LodashPick; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (props: _.Many): LodashPick1x1; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (props: _.Many, object: T): Pick; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (props: _.PropertyPath): LodashPick2x1; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (props: _.PropertyPath, object: T | null | undefined): _.PartialDeep; -} -interface LodashPick1x1 { - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (): LodashPick1x1; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (object: T): Pick; -} -interface LodashPick2x1 { - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (): LodashPick2x1; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (object: T | null | undefined): _.PartialDeep; -} - -declare const pick: LodashPick; +import { pick } from "../fp"; export = pick; diff --git a/types/lodash/fp/pickAll.d.ts b/types/lodash/fp/pickAll.d.ts index 0b103c02b7..38d2e3fe2b 100644 --- a/types/lodash/fp/pickAll.d.ts +++ b/types/lodash/fp/pickAll.d.ts @@ -1,159 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface LodashPick { - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (): LodashPick; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (props: _.Many): LodashPick1x1; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (props: _.Many, object: T): Pick; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (props: _.PropertyPath): LodashPick2x1; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (props: _.PropertyPath, object: T | null | undefined): _.PartialDeep; -} -interface LodashPick1x1 { - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (): LodashPick1x1; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (object: T): Pick; -} -interface LodashPick2x1 { - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (): LodashPick2x1; - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - (object: T | null | undefined): _.PartialDeep; -} - -declare const pickAll: LodashPick; +import { pickAll } from "../fp"; export = pickAll; diff --git a/types/lodash/fp/pickBy.d.ts b/types/lodash/fp/pickBy.d.ts index 189084f980..0b192629e0 100644 --- a/types/lodash/fp/pickBy.d.ts +++ b/types/lodash/fp/pickBy.d.ts @@ -1,93 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface PickBy { - /** - * Creates an object composed of the `object` properties `predicate` returns - * truthy for. The predicate is invoked with two arguments: (value, key). - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pickBy(object, _.isNumber); - * // => { 'a': 1, 'c': 3 } - */ - (): PickBy; - /** - * Creates an object composed of the `object` properties `predicate` returns - * truthy for. The predicate is invoked with two arguments: (value, key). - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pickBy(object, _.isNumber); - * // => { 'a': 1, 'c': 3 } - */ - (predicate: _.ValueKeyIteratee): PickBy1x1; - /** - * Creates an object composed of the `object` properties `predicate` returns - * truthy for. The predicate is invoked with two arguments: (value, key). - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pickBy(object, _.isNumber); - * // => { 'a': 1, 'c': 3 } - */ - (predicate: _.ValueKeyIteratee, object: T | null | undefined): _.PartialObject; -} -interface PickBy1x1 { - /** - * Creates an object composed of the `object` properties `predicate` returns - * truthy for. The predicate is invoked with two arguments: (value, key). - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pickBy(object, _.isNumber); - * // => { 'a': 1, 'c': 3 } - */ - (): PickBy1x1; - /** - * Creates an object composed of the `object` properties `predicate` returns - * truthy for. The predicate is invoked with two arguments: (value, key). - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pickBy(object, _.isNumber); - * // => { 'a': 1, 'c': 3 } - */ - (object: T1 | null | undefined): _.PartialObject; -} - -declare const pickBy: PickBy; +import { pickBy } from "../fp"; export = pickBy; diff --git a/types/lodash/fp/pipe.d.ts b/types/lodash/fp/pipe.d.ts index d5fae221ec..a53a04823b 100644 --- a/types/lodash/fp/pipe.d.ts +++ b/types/lodash/fp/pipe.d.ts @@ -1,355 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Flow { - /** - * 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. - */ - (f1: () => R1, f2: (a: R1) => R2): () => R2; - /** - * 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. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): () => R3; - /** - * 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. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): () => R4; - /** - * 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. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): () => R5; - /** - * 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. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): () => R6; - /** - * 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. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): () => R7; - /** - * 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. - */ - (f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): () => any; - /** - * 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. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2): (a1: A1) => R2; - /** - * 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. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1) => R3; - /** - * 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. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1) => R4; - /** - * 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. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1) => R5; - /** - * 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. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1) => R6; - /** - * 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. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1) => R7; - /** - * 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. - */ - (f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): (a1: A1) => any; - /** - * 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. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2) => R2; - /** - * 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. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2) => R3; - /** - * 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. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2) => R4; - /** - * 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. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2) => R5; - /** - * 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. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2) => R6; - /** - * 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. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2) => R7; - /** - * 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. - */ - (f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): (a1: A1, a2: A2) => any; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3) => R2; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3) => R3; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3) => R4; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3) => R5; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3) => R6; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3) => R7; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): (a1: A1, a2: A2, a3: A3) => any; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): (a1: A1, a2: A2, a3: A3, a4: A4) => any; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7; - /** - * 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. - */ - (f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any; - /** - * 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. - */ - (funcs: Array<_.Many<(...args: any[]) => any>>): (...args: any[]) => any; -} - -declare const pipe: Flow; +import { pipe } from "../fp"; export = pipe; diff --git a/types/lodash/fp/placeholder.d.ts b/types/lodash/fp/placeholder.d.ts new file mode 100644 index 0000000000..ddaed8ed1b --- /dev/null +++ b/types/lodash/fp/placeholder.d.ts @@ -0,0 +1,3 @@ +import _ = require("../index"); +declare const placeholder: _.__; +export = placeholder; diff --git a/types/lodash/fp/pluck.d.ts b/types/lodash/fp/pluck.d.ts index eec49c3f59..c5c916f814 100644 --- a/types/lodash/fp/pluck.d.ts +++ b/types/lodash/fp/pluck.d.ts @@ -1,588 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Map { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: (value: T) => TResult): Map1x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: (value: T) => TResult, collection: T[] | _.List | null | undefined): TResult[]; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: (value: T[keyof T]) => TResult): Map3x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: (value: T[keyof T]) => TResult, collection: T | null | undefined): TResult[]; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: K): Map4x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: K, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): Array; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: string): Map5x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: string, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): any[]; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: object): Map6x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (iteratee: object, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean[]; -} -interface Map1x1 { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map1x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (collection: T[] | _.List | null | undefined): TResult[]; -} -interface Map3x1 { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map3x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (collection: T | null | undefined): TResult[]; -} -interface Map4x1 { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map4x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): Array; -} -interface Map5x1 { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map5x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): any[]; -} -interface Map6x1 { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (): Map6x1; - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * _.Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): boolean[]; -} - -declare const pluck: Map; +import { pluck } from "../fp"; export = pluck; diff --git a/types/lodash/fp/prop.d.ts b/types/lodash/fp/prop.d.ts index c7d097d000..f2061e7d61 100644 --- a/types/lodash/fp/prop.d.ts +++ b/types/lodash/fp/prop.d.ts @@ -1,207 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Get { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey]): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject): TObject[TKey]; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number): Get3x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary): T; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary | null | undefined): T | undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get5x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: null | undefined): undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: any): any; -} -interface Get1x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject): TObject[TKey]; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject | null | undefined): TObject[TKey] | undefined; -} -interface Get3x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get3x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary): T; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary | null | undefined): T | undefined; -} -interface Get5x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get5x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: null | undefined): undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: any): any; -} - -declare const prop: Get; +import { prop } from "../fp"; export = prop; diff --git a/types/lodash/fp/propEq.d.ts b/types/lodash/fp/propEq.d.ts index 64175cc00a..5e3f4b413f 100644 --- a/types/lodash/fp/propEq.d.ts +++ b/types/lodash/fp/propEq.d.ts @@ -1,90 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface MatchesProperty { - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (): MatchesProperty; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (path: _.PropertyPath): MatchesProperty1x1; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (path: _.PropertyPath, srcValue: T): (value: any) => boolean; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (path: _.PropertyPath, srcValue: T): (value: V) => boolean; -} -interface MatchesProperty1x1 { - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (): MatchesProperty1x1; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (srcValue: T): (value: any) => boolean; - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - (srcValue: T): (value: V) => boolean; -} - -declare const propEq: MatchesProperty; +import { propEq } from "../fp"; export = propEq; diff --git a/types/lodash/fp/propOr.d.ts b/types/lodash/fp/propOr.d.ts index cfe67fc51c..feabcf6e95 100644 --- a/types/lodash/fp/propOr.d.ts +++ b/types/lodash/fp/propOr.d.ts @@ -1,313 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Get { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: TKey | [TKey]): Get1x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: number): Get2x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: number, object: _.NumericDictionary | null | undefined): T | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: _.PropertyPath): Get3x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: TDefault, path: _.PropertyPath, object: null | undefined): TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: any): Get4x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: any, path: _.PropertyPath): Get4x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (defaultValue: any, path: _.PropertyPath, object: any): any; -} -interface Get1x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey]): Get1x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number): Get2x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary | null | undefined): T | TDefault; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get3x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: null | undefined): TDefault; -} -interface Get1x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject | null | undefined): TObject[TKey] | TDefault; -} -interface Get2x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get2x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary | null | undefined): T | TDefault; -} -interface Get3x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get3x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: null | undefined): TDefault; -} -interface Get4x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get4x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get4x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: any): any; -} -interface Get4x2 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get4x2; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: any): any; -} - -declare const propOr: Get; +import { propOr } from "../fp"; export = propOr; diff --git a/types/lodash/fp/property.d.ts b/types/lodash/fp/property.d.ts index 47a4285028..aaa6c25711 100644 --- a/types/lodash/fp/property.d.ts +++ b/types/lodash/fp/property.d.ts @@ -1,207 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Get { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey]): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject): TObject[TKey]; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number): Get3x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary): T; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary | null | undefined): T | undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get5x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: null | undefined): undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: any): any; -} -interface Get1x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject): TObject[TKey]; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject | null | undefined): TObject[TKey] | undefined; -} -interface Get3x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get3x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary): T; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary | null | undefined): T | undefined; -} -interface Get5x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get5x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: null | undefined): undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: any): any; -} - -declare const property: Get; +import { property } from "../fp"; export = property; diff --git a/types/lodash/fp/propertyOf.d.ts b/types/lodash/fp/propertyOf.d.ts index 66e2afdaf8..a4d55130c6 100644 --- a/types/lodash/fp/propertyOf.d.ts +++ b/types/lodash/fp/propertyOf.d.ts @@ -1,207 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Get { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey]): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject): TObject[TKey]; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: TKey | [TKey], object: TObject | null | undefined): TObject[TKey] | undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number): Get3x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary): T; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: number, object: _.NumericDictionary | null | undefined): T | undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Get5x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: null | undefined): undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: any): any; -} -interface Get1x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get1x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject): TObject[TKey]; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: TObject | null | undefined): TObject[TKey] | undefined; -} -interface Get3x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get3x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary): T; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: _.NumericDictionary | null | undefined): T | undefined; -} -interface Get5x1 { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Get5x1; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: null | undefined): undefined; - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: any): any; -} - -declare const propertyOf: Get; +import { propertyOf } from "../fp"; export = propertyOf; diff --git a/types/lodash/fp/props.d.ts b/types/lodash/fp/props.d.ts index 2b22346229..46addba7ad 100644 --- a/types/lodash/fp/props.d.ts +++ b/types/lodash/fp/props.d.ts @@ -1,96 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface At { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (): At; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.PropertyPath): At1x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.PropertyPath, object: _.List | _.Dictionary | _.NumericDictionary | null | undefined): T[]; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.Many): At2x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (props: _.Many, object: T | null | undefined): Array; -} -interface At1x1 { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (): At1x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (object: _.List | _.Dictionary | _.NumericDictionary | null | undefined): T[]; -} -interface At2x1 { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (): At2x1; - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - (object: T | null | undefined): Array; -} - -declare const props: At; +import { props } from "../fp"; export = props; diff --git a/types/lodash/fp/pull.d.ts b/types/lodash/fp/pull.d.ts index 3ae9a76b4c..801cf33771 100644 --- a/types/lodash/fp/pull.d.ts +++ b/types/lodash/fp/pull.d.ts @@ -1,83 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Pull { - /** - * Removes all provided values from array using SameValueZero for equality comparisons. - * - * Note: Unlike _.without, this method mutates array. - * - * @param array The array to modify. - * @param values The values to remove. - * @return Returns array. - */ - (): Pull; - /** - * Removes all provided values from array using SameValueZero for equality comparisons. - * - * Note: Unlike _.without, this method mutates array. - * - * @param array The array to modify. - * @param values The values to remove. - * @return Returns array. - */ - (values: T): Pull1x1; - /** - * Removes all provided values from array using SameValueZero for equality comparisons. - * - * Note: Unlike _.without, this method mutates array. - * - * @param array The array to modify. - * @param values The values to remove. - * @return Returns array. - */ - (values: T, array: ReadonlyArray): T[]; - /** - * Removes all provided values from array using SameValueZero for equality comparisons. - * - * Note: Unlike _.without, this method mutates array. - * - * @param array The array to modify. - * @param values The values to remove. - * @return Returns array. - */ - (values: T, array: _.List): _.List; -} -interface Pull1x1 { - /** - * Removes all provided values from array using SameValueZero for equality comparisons. - * - * Note: Unlike _.without, this method mutates array. - * - * @param array The array to modify. - * @param values The values to remove. - * @return Returns array. - */ - (): Pull1x1; - /** - * Removes all provided values from array using SameValueZero for equality comparisons. - * - * Note: Unlike _.without, this method mutates array. - * - * @param array The array to modify. - * @param values The values to remove. - * @return Returns array. - */ - (array: ReadonlyArray): T[]; - /** - * Removes all provided values from array using SameValueZero for equality comparisons. - * - * Note: Unlike _.without, this method mutates array. - * - * @param array The array to modify. - * @param values The values to remove. - * @return Returns array. - */ - (array: _.List): _.List; -} - -declare const pull: Pull; +import { pull } from "../fp"; export = pull; diff --git a/types/lodash/fp/pullAll.d.ts b/types/lodash/fp/pullAll.d.ts index 6df0d3fbe6..042fe89ac1 100644 --- a/types/lodash/fp/pullAll.d.ts +++ b/types/lodash/fp/pullAll.d.ts @@ -1,139 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface PullAll { - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @returns Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, [2, 3]); - * console.log(array); - * // => [1, 1] - */ - (): PullAll; - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @returns Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, [2, 3]); - * console.log(array); - * // => [1, 1] - */ - (values: _.List): PullAll1x1; - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @returns Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, [2, 3]); - * console.log(array); - * // => [1, 1] - */ - (values: _.List, array: ReadonlyArray): T[]; - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @returns Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, [2, 3]); - * console.log(array); - * // => [1, 1] - */ - (values: _.List, array: _.List): _.List; -} -interface PullAll1x1 { - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @returns Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, [2, 3]); - * console.log(array); - * // => [1, 1] - */ - (): PullAll1x1; - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @returns Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, [2, 3]); - * console.log(array); - * // => [1, 1] - */ - (array: ReadonlyArray): T[]; - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @returns Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, [2, 3]); - * console.log(array); - * // => [1, 1] - */ - (array: _.List): _.List; -} - -declare const pullAll: PullAll; +import { pullAll } from "../fp"; export = pullAll; diff --git a/types/lodash/fp/pullAllBy.d.ts b/types/lodash/fp/pullAllBy.d.ts index 05a528de2d..5e5de1fc07 100644 --- a/types/lodash/fp/pullAllBy.d.ts +++ b/types/lodash/fp/pullAllBy.d.ts @@ -1,502 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface PullAllBy { - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (): PullAllBy; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee): PullAllBy1x1; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee, values: _.List): PullAllBy1x2; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee, values: _.List, array: ReadonlyArray): T[]; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee, values: _.List, array: _.List): _.List; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee): PullAllBy3x1; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee, values: _.List): PullAllBy3x2; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee, values: _.List, array: ReadonlyArray): T1[]; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee, values: _.List, array: _.List): _.List; -} -interface PullAllBy1x1 { - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (): PullAllBy1x1; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (values: _.List): PullAllBy1x2; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (values: _.List, array: ReadonlyArray): T[]; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (values: _.List, array: _.List): _.List; -} -interface PullAllBy1x2 { - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (): PullAllBy1x2; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (array: ReadonlyArray): T[]; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (array: _.List): _.List; -} -interface PullAllBy3x1 { - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (): PullAllBy3x1; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (values: _.List): PullAllBy3x2; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (values: _.List, array: ReadonlyArray): T1[]; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (values: _.List, array: _.List): _.List; -} -interface PullAllBy3x2 { - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (): PullAllBy3x2; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (array: ReadonlyArray): T1[]; - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - (array: _.List): _.List; -} - -declare const pullAllBy: PullAllBy; +import { pullAllBy } from "../fp"; export = pullAllBy; diff --git a/types/lodash/fp/pullAllWith.d.ts b/types/lodash/fp/pullAllWith.d.ts index 566eb5ae84..0c448bf8c8 100644 --- a/types/lodash/fp/pullAllWith.d.ts +++ b/types/lodash/fp/pullAllWith.d.ts @@ -1,502 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface PullAllWith { - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (): PullAllWith; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (comparator: _.Comparator): PullAllWith1x1; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (comparator: _.Comparator, values: _.List): PullAllWith1x2; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (comparator: _.Comparator, values: _.List, array: ReadonlyArray): T[]; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (comparator: _.Comparator, values: _.List, array: _.List): _.List; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (comparator: _.Comparator2): PullAllWith3x1; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (comparator: _.Comparator2, values: _.List): PullAllWith3x2; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (comparator: _.Comparator2, values: _.List, array: ReadonlyArray): T1[]; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (comparator: _.Comparator2, values: _.List, array: _.List): _.List; -} -interface PullAllWith1x1 { - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (): PullAllWith1x1; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (values: _.List): PullAllWith1x2; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (values: _.List, array: ReadonlyArray): T[]; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (values: _.List, array: _.List): _.List; -} -interface PullAllWith1x2 { - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (): PullAllWith1x2; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (array: ReadonlyArray): T[]; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (array: _.List): _.List; -} -interface PullAllWith3x1 { - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (): PullAllWith3x1; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (values: _.List): PullAllWith3x2; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (values: _.List, array: ReadonlyArray): T1[]; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (values: _.List, array: _.List): _.List; -} -interface PullAllWith3x2 { - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (): PullAllWith3x2; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (array: ReadonlyArray): T1[]; - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - (array: _.List): _.List; -} - -declare const pullAllWith: PullAllWith; +import { pullAllWith } from "../fp"; export = pullAllWith; diff --git a/types/lodash/fp/pullAt.d.ts b/types/lodash/fp/pullAt.d.ts index 61d6fd04f0..4bdffd993f 100644 --- a/types/lodash/fp/pullAt.d.ts +++ b/types/lodash/fp/pullAt.d.ts @@ -1,90 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface PullAt { - /** - * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. - * Indexes may be specified as an array of indexes or as individual arguments. - * - * Note: Unlike _.at, this method mutates array. - * - * @param array The array to modify. - * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. - * @return Returns the new array of removed elements. - */ - (): PullAt; - /** - * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. - * Indexes may be specified as an array of indexes or as individual arguments. - * - * Note: Unlike _.at, this method mutates array. - * - * @param array The array to modify. - * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. - * @return Returns the new array of removed elements. - */ - (indexes: _.Many): PullAt1x1; - /** - * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. - * Indexes may be specified as an array of indexes or as individual arguments. - * - * Note: Unlike _.at, this method mutates array. - * - * @param array The array to modify. - * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. - * @return Returns the new array of removed elements. - */ - (indexes: _.Many, array: ReadonlyArray): T[]; - /** - * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. - * Indexes may be specified as an array of indexes or as individual arguments. - * - * Note: Unlike _.at, this method mutates array. - * - * @param array The array to modify. - * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. - * @return Returns the new array of removed elements. - */ - (indexes: _.Many, array: _.List): _.List; -} -interface PullAt1x1 { - /** - * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. - * Indexes may be specified as an array of indexes or as individual arguments. - * - * Note: Unlike _.at, this method mutates array. - * - * @param array The array to modify. - * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. - * @return Returns the new array of removed elements. - */ - (): PullAt1x1; - /** - * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. - * Indexes may be specified as an array of indexes or as individual arguments. - * - * Note: Unlike _.at, this method mutates array. - * - * @param array The array to modify. - * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. - * @return Returns the new array of removed elements. - */ - (array: ReadonlyArray): T[]; - /** - * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. - * Indexes may be specified as an array of indexes or as individual arguments. - * - * Note: Unlike _.at, this method mutates array. - * - * @param array The array to modify. - * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. - * @return Returns the new array of removed elements. - */ - (array: _.List): _.List; -} - -declare const pullAt: PullAt; +import { pullAt } from "../fp"; export = pullAt; diff --git a/types/lodash/fp/random.d.ts b/types/lodash/fp/random.d.ts index 075b54b2e4..a69555ca16 100644 --- a/types/lodash/fp/random.d.ts +++ b/types/lodash/fp/random.d.ts @@ -1,66 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Random { - /** - * Produces a random number between min and max (inclusive). If only one argument is provided a number between - * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point - * number is returned instead of an integer. - * - * @param min The minimum possible value. - * @param max The maximum possible value. - * @param floating Specify returning a floating-point number. - * @return Returns the random number. - */ - (): Random; - /** - * Produces a random number between min and max (inclusive). If only one argument is provided a number between - * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point - * number is returned instead of an integer. - * - * @param min The minimum possible value. - * @param max The maximum possible value. - * @param floating Specify returning a floating-point number. - * @return Returns the random number. - */ - (maxOrMin: number): Random1x1; - /** - * Produces a random number between min and max (inclusive). If only one argument is provided a number between - * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point - * number is returned instead of an integer. - * - * @param min The minimum possible value. - * @param max The maximum possible value. - * @param floating Specify returning a floating-point number. - * @return Returns the random number. - */ - (maxOrMin: number, floatingOrMax: boolean | number): number; -} -interface Random1x1 { - /** - * Produces a random number between min and max (inclusive). If only one argument is provided a number between - * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point - * number is returned instead of an integer. - * - * @param min The minimum possible value. - * @param max The maximum possible value. - * @param floating Specify returning a floating-point number. - * @return Returns the random number. - */ - (): Random1x1; - /** - * Produces a random number between min and max (inclusive). If only one argument is provided a number between - * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point - * number is returned instead of an integer. - * - * @param min The minimum possible value. - * @param max The maximum possible value. - * @param floating Specify returning a floating-point number. - * @return Returns the random number. - */ - (floatingOrMax: boolean | number): number; -} - -declare const random: Random; +import { random } from "../fp"; export = random; diff --git a/types/lodash/fp/range.d.ts b/types/lodash/fp/range.d.ts index 7526d40e03..ace50ce46b 100644 --- a/types/lodash/fp/range.d.ts +++ b/types/lodash/fp/range.d.ts @@ -1,66 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Range { - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (): Range; - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (start: number): Range1x1; - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (start: number, end: number): number[]; -} -interface Range1x1 { - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (): Range1x1; - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (end: number): number[]; -} - -declare const range: Range; +import { range } from "../fp"; export = range; diff --git a/types/lodash/fp/rangeRight.d.ts b/types/lodash/fp/rangeRight.d.ts index 89337d055a..20c8baefaa 100644 --- a/types/lodash/fp/rangeRight.d.ts +++ b/types/lodash/fp/rangeRight.d.ts @@ -1,176 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface RangeRight { - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (): RangeRight; - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (start: number): RangeRight1x1; - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (start: number, end: number): number[]; -} -interface RangeRight1x1 { - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (): RangeRight1x1; - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (end: number): number[]; -} - -declare const rangeRight: RangeRight; +import { rangeRight } from "../fp"; export = rangeRight; diff --git a/types/lodash/fp/rangeStep.d.ts b/types/lodash/fp/rangeStep.d.ts index 1bd70ebf55..e5f4c891ce 100644 --- a/types/lodash/fp/rangeStep.d.ts +++ b/types/lodash/fp/rangeStep.d.ts @@ -1,112 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Range { - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (): Range; - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (start: number): Range1x1; - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (start: number, end: number): Range1x2; - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (start: number, end: number, step: number): number[]; -} -interface Range1x1 { - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (): Range1x1; - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (end: number): Range1x2; - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (end: number, step: number): number[]; -} -interface Range1x2 { - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (): Range1x2; - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - (step: number): number[]; -} - -declare const rangeStep: Range; +import { rangeStep } from "../fp"; export = rangeStep; diff --git a/types/lodash/fp/rangeStepRight.d.ts b/types/lodash/fp/rangeStepRight.d.ts index dcc223f569..6c7add468d 100644 --- a/types/lodash/fp/rangeStepRight.d.ts +++ b/types/lodash/fp/rangeStepRight.d.ts @@ -1,310 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface RangeRight { - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (): RangeRight; - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (start: number): RangeRight1x1; - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (start: number, end: number): RangeRight1x2; - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (start: number, end: number, step: number): number[]; -} -interface RangeRight1x1 { - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (): RangeRight1x1; - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (end: number): RangeRight1x2; - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (end: number, step: number): number[]; -} -interface RangeRight1x2 { - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (): RangeRight1x2; - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - (step: number): number[]; -} - -declare const rangeStepRight: RangeRight; +import { rangeStepRight } from "../fp"; export = rangeStepRight; diff --git a/types/lodash/fp/rearg.d.ts b/types/lodash/fp/rearg.d.ts index 9ff0dbccfb..5c407d13a4 100644 --- a/types/lodash/fp/rearg.d.ts +++ b/types/lodash/fp/rearg.d.ts @@ -1,58 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Rearg { - /** - * Creates a function that invokes func with arguments arranged according to the specified indexes where the - * argument value at the first index is provided as the first argument, the argument value at the second index - * is provided as the second argument, and so on. - * @param func The function to rearrange arguments for. - * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes. - * @return Returns the new function. - */ - (): Rearg; - /** - * Creates a function that invokes func with arguments arranged according to the specified indexes where the - * argument value at the first index is provided as the first argument, the argument value at the second index - * is provided as the second argument, and so on. - * @param func The function to rearrange arguments for. - * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes. - * @return Returns the new function. - */ - (indexes: _.Many): Rearg1x1; - /** - * Creates a function that invokes func with arguments arranged according to the specified indexes where the - * argument value at the first index is provided as the first argument, the argument value at the second index - * is provided as the second argument, and so on. - * @param func The function to rearrange arguments for. - * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes. - * @return Returns the new function. - */ - (indexes: _.Many, func: (...args: any[]) => any): (...args: any[]) => any; -} -interface Rearg1x1 { - /** - * Creates a function that invokes func with arguments arranged according to the specified indexes where the - * argument value at the first index is provided as the first argument, the argument value at the second index - * is provided as the second argument, and so on. - * @param func The function to rearrange arguments for. - * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes. - * @return Returns the new function. - */ - (): Rearg1x1; - /** - * Creates a function that invokes func with arguments arranged according to the specified indexes where the - * argument value at the first index is provided as the first argument, the argument value at the second index - * is provided as the second argument, and so on. - * @param func The function to rearrange arguments for. - * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes. - * @return Returns the new function. - */ - (func: (...args: any[]) => any): (...args: any[]) => any; -} - -declare const rearg: Rearg; +import { rearg } from "../fp"; export = rearg; diff --git a/types/lodash/fp/reduce.d.ts b/types/lodash/fp/reduce.d.ts index 70071a64e3..e262f39370 100644 --- a/types/lodash/fp/reduce.d.ts +++ b/types/lodash/fp/reduce.d.ts @@ -1,223 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Reduce { - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (): Reduce; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (callback: _.MemoIteratorCapped): Reduce1x1; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (callback: _.MemoIteratorCapped, accumulator: TResult): Reduce1x2; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (callback: _.MemoIteratorCapped, accumulator: TResult, collection: T[] | _.List | null | undefined): TResult; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (callback: _.MemoIteratorCapped): Reduce3x1; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (callback: _.MemoIteratorCapped, accumulator: TResult): Reduce3x2; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (callback: _.MemoIteratorCapped, accumulator: TResult, collection: T | null | undefined): TResult; -} -interface Reduce1x1 { - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (): Reduce1x1; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (accumulator: TResult): Reduce1x2; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (accumulator: TResult, collection: T[] | _.List | null | undefined): TResult; -} -interface Reduce1x2 { - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (): Reduce1x2; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (collection: T[] | _.List | null | undefined): TResult; -} -interface Reduce3x1 { - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (): Reduce3x1; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (accumulator: TResult): Reduce3x2; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (accumulator: TResult, collection: T | null | undefined): TResult; -} -interface Reduce3x2 { - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (): Reduce3x2; - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - (collection: T | null | undefined): TResult; -} - -declare const reduce: Reduce; +import { reduce } from "../fp"; export = reduce; diff --git a/types/lodash/fp/reduceRight.d.ts b/types/lodash/fp/reduceRight.d.ts index 0c8813aa01..fa54fa3a5e 100644 --- a/types/lodash/fp/reduceRight.d.ts +++ b/types/lodash/fp/reduceRight.d.ts @@ -1,172 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ReduceRight { - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (): ReduceRight; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (callback: _.MemoIteratorCappedRight): ReduceRight1x1; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (callback: _.MemoIteratorCappedRight, accumulator: TResult): ReduceRight1x2; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (callback: _.MemoIteratorCappedRight, accumulator: TResult, collection: T[] | _.List | null | undefined): TResult; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (callback: _.MemoIteratorCappedRight): ReduceRight3x1; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (callback: _.MemoIteratorCappedRight, accumulator: TResult): ReduceRight3x2; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (callback: _.MemoIteratorCappedRight, accumulator: TResult, collection: T | null | undefined): TResult; -} -interface ReduceRight1x1 { - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (): ReduceRight1x1; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (accumulator: TResult): ReduceRight1x2; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (accumulator: TResult, collection: T[] | _.List | null | undefined): TResult; -} -interface ReduceRight1x2 { - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (): ReduceRight1x2; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (collection: T[] | _.List | null | undefined): TResult; -} -interface ReduceRight3x1 { - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (): ReduceRight3x1; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (accumulator: TResult): ReduceRight3x2; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (accumulator: TResult, collection: T | null | undefined): TResult; -} -interface ReduceRight3x2 { - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (): ReduceRight3x2; - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - (collection: T | null | undefined): TResult; -} - -declare const reduceRight: ReduceRight; +import { reduceRight } from "../fp"; export = reduceRight; diff --git a/types/lodash/fp/reject.d.ts b/types/lodash/fp/reject.d.ts index 74a93c3783..d0a12af963 100644 --- a/types/lodash/fp/reject.d.ts +++ b/types/lodash/fp/reject.d.ts @@ -1,115 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Reject { - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (): Reject; - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: (value: string) => boolean): Reject1x1; - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: (value: string) => boolean, collection: string | null | undefined): string[]; - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: _.ValueIterateeCustom): Reject2x1; - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: _.ValueIterateeCustom, collection: _.List | null | undefined): T[]; - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (predicate: _.ValueIterateeCustom, collection: T | null | undefined): Array; -} -interface Reject1x1 { - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (): Reject1x1; - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (collection: string | null | undefined): string[]; -} -interface Reject2x1 { - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (): Reject2x1; - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - (collection: _.List | object | null | undefined): T[]; -} - -declare const reject: Reject; +import { reject } from "../fp"; export = reject; diff --git a/types/lodash/fp/remove.d.ts b/types/lodash/fp/remove.d.ts index 51ac8aecf8..e0da9b147c 100644 --- a/types/lodash/fp/remove.d.ts +++ b/types/lodash/fp/remove.d.ts @@ -1,118 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Remove { - /** - * Removes all elements from array that predicate returns truthy for and returns an array of the removed - * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * Note: Unlike _.filter, this method mutates array. - * - * @param array The array to modify. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new array of removed elements. - */ - (): Remove; - /** - * Removes all elements from array that predicate returns truthy for and returns an array of the removed - * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * Note: Unlike _.filter, this method mutates array. - * - * @param array The array to modify. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new array of removed elements. - */ - (predicate: _.ValueIteratee): Remove1x1; - /** - * Removes all elements from array that predicate returns truthy for and returns an array of the removed - * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * Note: Unlike _.filter, this method mutates array. - * - * @param array The array to modify. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new array of removed elements. - */ - (predicate: _.ValueIteratee, array: _.List): T[]; -} -interface Remove1x1 { - /** - * Removes all elements from array that predicate returns truthy for and returns an array of the removed - * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * Note: Unlike _.filter, this method mutates array. - * - * @param array The array to modify. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new array of removed elements. - */ - (): Remove1x1; - /** - * Removes all elements from array that predicate returns truthy for and returns an array of the removed - * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * Note: Unlike _.filter, this method mutates array. - * - * @param array The array to modify. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new array of removed elements. - */ - (array: _.List): T[]; -} - -declare const remove: Remove; +import { remove } from "../fp"; export = remove; diff --git a/types/lodash/fp/repeat.d.ts b/types/lodash/fp/repeat.d.ts index 4ba7cd4e17..1f757a2778 100644 --- a/types/lodash/fp/repeat.d.ts +++ b/types/lodash/fp/repeat.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Repeat { - /** - * Repeats the given string n times. - * - * @param string The string to repeat. - * @param n The number of times to repeat the string. - * @return Returns the repeated string. - */ - (): Repeat; - /** - * Repeats the given string n times. - * - * @param string The string to repeat. - * @param n The number of times to repeat the string. - * @return Returns the repeated string. - */ - (n: number): Repeat1x1; - /** - * Repeats the given string n times. - * - * @param string The string to repeat. - * @param n The number of times to repeat the string. - * @return Returns the repeated string. - */ - (n: number, string: string): string; -} -interface Repeat1x1 { - /** - * Repeats the given string n times. - * - * @param string The string to repeat. - * @param n The number of times to repeat the string. - * @return Returns the repeated string. - */ - (): Repeat1x1; - /** - * Repeats the given string n times. - * - * @param string The string to repeat. - * @param n The number of times to repeat the string. - * @return Returns the repeated string. - */ - (string: string): string; -} - -declare const repeat: Repeat; +import { repeat } from "../fp"; export = repeat; diff --git a/types/lodash/fp/replace.d.ts b/types/lodash/fp/replace.d.ts index 18e76a4388..c7a75d1fa1 100644 --- a/types/lodash/fp/replace.d.ts +++ b/types/lodash/fp/replace.d.ts @@ -1,87 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Replace { - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @return Returns the modified string. - */ - (): Replace; - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @return Returns the modified string. - */ - (pattern: RegExp | string): Replace1x1; - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @return Returns the modified string. - */ - (pattern: RegExp | string, replacement: _.ReplaceFunction | string): Replace1x2; - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @return Returns the modified string. - */ - (pattern: RegExp | string, replacement: _.ReplaceFunction | string, string: string): string; -} -interface Replace1x1 { - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @return Returns the modified string. - */ - (): Replace1x1; - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @return Returns the modified string. - */ - (replacement: _.ReplaceFunction | string): Replace1x2; - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @return Returns the modified string. - */ - (replacement: _.ReplaceFunction | string, string: string): string; -} -interface Replace1x2 { - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @return Returns the modified string. - */ - (): Replace1x2; - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @return Returns the modified string. - */ - (string: string): string; -} - -declare const replace: Replace; +import { replace } from "../fp"; export = replace; diff --git a/types/lodash/fp/rest.d.ts b/types/lodash/fp/rest.d.ts index b92f5adb85..b059d673e1 100644 --- a/types/lodash/fp/rest.d.ts +++ b/types/lodash/fp/rest.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Rest = - /** - * Creates a function that invokes func with the this binding of the created function and arguments from start - * and beyond provided as an array. - * - * Note: This method is based on the rest parameter. - * - * @param func The function to apply a rest parameter to. - * @param start The start position of the rest parameter. - * @return Returns the new function. - */ - (func: (...args: any[]) => any) => (...args: any[]) => any; - -declare const rest: Rest; +import { rest } from "../fp"; export = rest; diff --git a/types/lodash/fp/restFrom.d.ts b/types/lodash/fp/restFrom.d.ts index 3ca5389f0e..218edbd5a3 100644 --- a/types/lodash/fp/restFrom.d.ts +++ b/types/lodash/fp/restFrom.d.ts @@ -1,66 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Rest { - /** - * Creates a function that invokes func with the this binding of the created function and arguments from start - * and beyond provided as an array. - * - * Note: This method is based on the rest parameter. - * - * @param func The function to apply a rest parameter to. - * @param start The start position of the rest parameter. - * @return Returns the new function. - */ - (): Rest; - /** - * Creates a function that invokes func with the this binding of the created function and arguments from start - * and beyond provided as an array. - * - * Note: This method is based on the rest parameter. - * - * @param func The function to apply a rest parameter to. - * @param start The start position of the rest parameter. - * @return Returns the new function. - */ - (start: number): Rest1x1; - /** - * Creates a function that invokes func with the this binding of the created function and arguments from start - * and beyond provided as an array. - * - * Note: This method is based on the rest parameter. - * - * @param func The function to apply a rest parameter to. - * @param start The start position of the rest parameter. - * @return Returns the new function. - */ - (start: number, func: (...args: any[]) => any): (...args: any[]) => any; -} -interface Rest1x1 { - /** - * Creates a function that invokes func with the this binding of the created function and arguments from start - * and beyond provided as an array. - * - * Note: This method is based on the rest parameter. - * - * @param func The function to apply a rest parameter to. - * @param start The start position of the rest parameter. - * @return Returns the new function. - */ - (): Rest1x1; - /** - * Creates a function that invokes func with the this binding of the created function and arguments from start - * and beyond provided as an array. - * - * Note: This method is based on the rest parameter. - * - * @param func The function to apply a rest parameter to. - * @param start The start position of the rest parameter. - * @return Returns the new function. - */ - (func: (...args: any[]) => any): (...args: any[]) => any; -} - -declare const restFrom: Rest; +import { restFrom } from "../fp"; export = restFrom; diff --git a/types/lodash/fp/result.d.ts b/types/lodash/fp/result.d.ts index de99d91ff9..5a919dd455 100644 --- a/types/lodash/fp/result.d.ts +++ b/types/lodash/fp/result.d.ts @@ -1,63 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Result { - /** - * This method is like _.get except that if the resolved value is a function it’s invoked with the this binding - * of its parent object and its result is returned. - * - * @param object The object to query. - * @param path The path of the property to resolve. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Result; - /** - * This method is like _.get except that if the resolved value is a function it’s invoked with the this binding - * of its parent object and its result is returned. - * - * @param object The object to query. - * @param path The path of the property to resolve. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath): Result1x1; - /** - * This method is like _.get except that if the resolved value is a function it’s invoked with the this binding - * of its parent object and its result is returned. - * - * @param object The object to query. - * @param path The path of the property to resolve. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (path: _.PropertyPath, object: any): TResult; -} -interface Result1x1 { - /** - * This method is like _.get except that if the resolved value is a function it’s invoked with the this binding - * of its parent object and its result is returned. - * - * @param object The object to query. - * @param path The path of the property to resolve. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (): Result1x1; - /** - * This method is like _.get except that if the resolved value is a function it’s invoked with the this binding - * of its parent object and its result is returned. - * - * @param object The object to query. - * @param path The path of the property to resolve. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - (object: any): TResult; -} - -declare const result: Result; +import { result } from "../fp"; export = result; diff --git a/types/lodash/fp/reverse.d.ts b/types/lodash/fp/reverse.d.ts index 5aa826c5eb..f754d6aac6 100644 --- a/types/lodash/fp/reverse.d.ts +++ b/types/lodash/fp/reverse.d.ts @@ -1,30 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Reverse = - /** - * Reverses `array` so that the first element becomes the last, the second - * element becomes the second to last, and so on. - * - * **Note:** This method mutates `array` and is based on - * [`Array#reverse`](https://mdn.io/Array/reverse). - * - * @category Array - * @returns Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.reverse(array); - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - >(array: TList) => TList; - -declare const reverse: Reverse; +import { reverse } from "../fp"; export = reverse; diff --git a/types/lodash/fp/round.d.ts b/types/lodash/fp/round.d.ts index 359693f99e..02f4e6f300 100644 --- a/types/lodash/fp/round.d.ts +++ b/types/lodash/fp/round.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Round = - /** - * Calculates n rounded to precision. - * - * @param n The number to round. - * @param precision The precision to round to. - * @return Returns the rounded number. - */ - (n: number) => number; - -declare const round: Round; +import { round } from "../fp"; export = round; diff --git a/types/lodash/fp/runInContext.d.ts b/types/lodash/fp/runInContext.d.ts index a09369abec..6041db7053 100644 --- a/types/lodash/fp/runInContext.d.ts +++ b/types/lodash/fp/runInContext.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type RunInContext = - /** - * Create a new pristine lodash function using the given context object. - * - * @param context The context object. - * @return Returns a new lodash function. - */ - (context: object) => typeof _; - -declare const runInContext: RunInContext; +import { runInContext } from "../fp"; export = runInContext; diff --git a/types/lodash/fp/sample.d.ts b/types/lodash/fp/sample.d.ts index 3ba7c5b6e2..f2fcf1ac03 100644 --- a/types/lodash/fp/sample.d.ts +++ b/types/lodash/fp/sample.d.ts @@ -1,25 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Sample { - /** - * Gets a random element from collection. - * - * @param collection The collection to sample. - * @return Returns the random element. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): T | undefined; - /** - * Gets a random element from collection. - * - * @param collection The collection to sample. - * @return Returns the random element. - */ - (collection: T | null | undefined): T[keyof T] | undefined; -} - -declare const sample: Sample; +import { sample } from "../fp"; export = sample; diff --git a/types/lodash/fp/sampleSize.d.ts b/types/lodash/fp/sampleSize.d.ts index 17ec045353..41a3cabf92 100644 --- a/types/lodash/fp/sampleSize.d.ts +++ b/types/lodash/fp/sampleSize.d.ts @@ -1,69 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SampleSize { - /** - * Gets n random elements at unique keys from collection up to the size of collection. - * - * @param collection The collection to sample. - * @param n The number of elements to sample. - * @return Returns the random elements. - */ - (): SampleSize; - /** - * Gets n random elements at unique keys from collection up to the size of collection. - * - * @param collection The collection to sample. - * @param n The number of elements to sample. - * @return Returns the random elements. - */ - (n: number): SampleSize1x1; - /** - * Gets n random elements at unique keys from collection up to the size of collection. - * - * @param collection The collection to sample. - * @param n The number of elements to sample. - * @return Returns the random elements. - */ - (n: number, collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): T[]; - /** - * Gets n random elements at unique keys from collection up to the size of collection. - * - * @param collection The collection to sample. - * @param n The number of elements to sample. - * @return Returns the random elements. - */ - (n: number, collection: T | null | undefined): Array; -} -interface SampleSize1x1 { - /** - * Gets n random elements at unique keys from collection up to the size of collection. - * - * @param collection The collection to sample. - * @param n The number of elements to sample. - * @return Returns the random elements. - */ - (): SampleSize1x1; - /** - * Gets n random elements at unique keys from collection up to the size of collection. - * - * @param collection The collection to sample. - * @param n The number of elements to sample. - * @return Returns the random elements. - */ - (collection: _.List | _.Dictionary | _.NumericDictionary | null | undefined): T[]; - /** - * Gets n random elements at unique keys from collection up to the size of collection. - * - * @param collection The collection to sample. - * @param n The number of elements to sample. - * @return Returns the random elements. - */ - (collection: T | null | undefined): Array; -} - -declare const sampleSize: SampleSize; +import { sampleSize } from "../fp"; export = sampleSize; diff --git a/types/lodash/fp/set.d.ts b/types/lodash/fp/set.d.ts index ea13605dcc..57960cba78 100644 --- a/types/lodash/fp/set.d.ts +++ b/types/lodash/fp/set.d.ts @@ -1,147 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Set { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (): Set; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath): Set1x1; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath, value: any): Set1x2; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath, value: any, object: T): T; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (path: _.PropertyPath, value: any, object: object): TResult; -} -interface Set1x1 { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (): Set1x1; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (value: any): Set1x2; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (value: any, object: T): T; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (value: any, object: object): TResult; -} -interface Set1x2 { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (): Set1x2; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (object: T): T; - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - (object: object): TResult; -} - -declare const set: Set; +import { set } from "../fp"; export = set; diff --git a/types/lodash/fp/setWith.d.ts b/types/lodash/fp/setWith.d.ts index d26b1a88a1..800a49429c 100644 --- a/types/lodash/fp/setWith.d.ts +++ b/types/lodash/fp/setWith.d.ts @@ -1,233 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SetWith { - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (): SetWith; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (customizer: _.SetWithCustomizer): SetWith1x1; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (customizer: _.SetWithCustomizer, path: _.PropertyPath): SetWith1x2; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (customizer: _.SetWithCustomizer, path: _.PropertyPath, value: any): SetWith1x3; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (customizer: _.SetWithCustomizer, path: _.PropertyPath, value: any, object: T): T; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (customizer: _.SetWithCustomizer, path: _.PropertyPath, value: any, object: T): TResult; -} -interface SetWith1x1 { - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (): SetWith1x1; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (path: _.PropertyPath): SetWith1x2; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (path: _.PropertyPath, value: any): SetWith1x3; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (path: _.PropertyPath, value: any, object: T): T; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (path: _.PropertyPath, value: any, object: T): TResult; -} -interface SetWith1x2 { - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (): SetWith1x2; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (value: any): SetWith1x3; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (value: any, object: T): T; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (value: any, object: T): TResult; -} -interface SetWith1x3 { - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (): SetWith1x3; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (object: T): T; - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - (object: T): TResult; -} - -declare const setWith: SetWith; +import { setWith } from "../fp"; export = setWith; diff --git a/types/lodash/fp/shuffle.d.ts b/types/lodash/fp/shuffle.d.ts index b49c3d10dc..7f07282642 100644 --- a/types/lodash/fp/shuffle.d.ts +++ b/types/lodash/fp/shuffle.d.ts @@ -1,25 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Shuffle { - /** - * Creates an array of shuffled values, using a version of the Fisher-Yates shuffle. - * - * @param collection The collection to shuffle. - * @return Returns the new shuffled array. - */ - (collection: _.List | null | undefined): T[]; - /** - * Creates an array of shuffled values, using a version of the Fisher-Yates shuffle. - * - * @param collection The collection to shuffle. - * @return Returns the new shuffled array. - */ - (collection: T | null | undefined): Array; -} - -declare const shuffle: Shuffle; +import { shuffle } from "../fp"; export = shuffle; diff --git a/types/lodash/fp/size.d.ts b/types/lodash/fp/size.d.ts index cf4ca2d03b..657c8b7c20 100644 --- a/types/lodash/fp/size.d.ts +++ b/types/lodash/fp/size.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Size = - /** - * Gets the size of collection by returning its length for array-like values or the number of own enumerable - * properties for objects. - * - * @param collection The collection to inspect. - * @return Returns the size of collection. - */ - (collection: object | string | null | undefined) => number; - -declare const size: Size; +import { size } from "../fp"; export = size; diff --git a/types/lodash/fp/slice.d.ts b/types/lodash/fp/slice.d.ts index e602154fa1..fabbbe0eeb 100644 --- a/types/lodash/fp/slice.d.ts +++ b/types/lodash/fp/slice.d.ts @@ -1,96 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Slice { - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - (): Slice; - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - (start: number): Slice1x1; - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - (start: number, end: number): Slice1x2; - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - (start: number, end: number, array: _.List | null | undefined): T[]; -} -interface Slice1x1 { - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - (): Slice1x1; - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - (end: number): Slice1x2; - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - (end: number, array: _.List | null | undefined): T[]; -} -interface Slice1x2 { - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - (): Slice1x2; - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const slice: Slice; +import { slice } from "../fp"; export = slice; diff --git a/types/lodash/fp/snakeCase.d.ts b/types/lodash/fp/snakeCase.d.ts index ef35bad608..a06ac452fe 100644 --- a/types/lodash/fp/snakeCase.d.ts +++ b/types/lodash/fp/snakeCase.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type SnakeCase = - /** - * Converts string to snake case. - * - * @param string The string to convert. - * @return Returns the snake cased string. - */ - (string: string) => string; - -declare const snakeCase: SnakeCase; +import { snakeCase } from "../fp"; export = snakeCase; diff --git a/types/lodash/fp/some.d.ts b/types/lodash/fp/some.d.ts index f554e380c5..870b23160d 100644 --- a/types/lodash/fp/some.d.ts +++ b/types/lodash/fp/some.d.ts @@ -1,67 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Some { - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (): Some; - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom): Some1x1; - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom, collection: _.List | null | undefined): boolean; - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (predicate: _.ValueIterateeCustom, collection: T | null | undefined): boolean; -} -interface Some1x1 { - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (): Some1x1; - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - (collection: _.List | object | null | undefined): boolean; -} - -declare const some: Some; +import { some } from "../fp"; export = some; diff --git a/types/lodash/fp/sortBy.d.ts b/types/lodash/fp/sortBy.d.ts index 3b0a1c128c..72c5799b36 100644 --- a/types/lodash/fp/sortBy.d.ts +++ b/types/lodash/fp/sortBy.d.ts @@ -1,205 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SortBy { - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.sortBy(users, 'user', function(o) { - * return Math.floor(o.age / 10); - * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (): SortBy; - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.sortBy(users, 'user', function(o) { - * return Math.floor(o.age / 10); - * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (iteratees: _.Many<_.ValueIteratee>): SortBy1x1; - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.sortBy(users, 'user', function(o) { - * return Math.floor(o.age / 10); - * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (iteratees: _.Many<_.ValueIteratee>, collection: _.List | null | undefined): T[]; - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.sortBy(users, 'user', function(o) { - * return Math.floor(o.age / 10); - * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (iteratees: _.Many<_.ValueIteratee>, collection: T | null | undefined): Array; -} -interface SortBy1x1 { - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.sortBy(users, 'user', function(o) { - * return Math.floor(o.age / 10); - * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (): SortBy1x1; - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.sortBy(users, 'user', function(o) { - * return Math.floor(o.age / 10); - * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - (collection: _.List | object | null | undefined): T[]; -} - -declare const sortBy: SortBy; +import { sortBy } from "../fp"; export = sortBy; diff --git a/types/lodash/fp/sortedIndex.d.ts b/types/lodash/fp/sortedIndex.d.ts index c230bd6858..35b57feed2 100644 --- a/types/lodash/fp/sortedIndex.d.ts +++ b/types/lodash/fp/sortedIndex.d.ts @@ -1,98 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SortedIndex { - /** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 5], 4); - * // => 0 - */ - (): SortedIndex; - /** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 5], 4); - * // => 0 - */ - (value: T): SortedIndex1x1; - /** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 5], 4); - * // => 0 - */ - (value: T, array: _.List | null | undefined): number; -} -interface SortedIndex1x1 { - /** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 5], 4); - * // => 0 - */ - (): SortedIndex1x1; - /** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 5], 4); - * // => 0 - */ - (array: _.List | null | undefined): number; -} - -declare const sortedIndex: SortedIndex; +import { sortedIndex } from "../fp"; export = sortedIndex; diff --git a/types/lodash/fp/sortedIndexBy.d.ts b/types/lodash/fp/sortedIndexBy.d.ts index 02a1ffbae6..f6968df691 100644 --- a/types/lodash/fp/sortedIndexBy.d.ts +++ b/types/lodash/fp/sortedIndexBy.d.ts @@ -1,213 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SortedIndexBy { - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - (): SortedIndexBy; - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - (iteratee: _.ValueIteratee): SortedIndexBy1x1; - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - (iteratee: _.ValueIteratee, value: T): SortedIndexBy1x2; - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - (iteratee: _.ValueIteratee, value: T, array: _.List | null | undefined): number; -} -interface SortedIndexBy1x1 { - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - (): SortedIndexBy1x1; - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - (value: T): SortedIndexBy1x2; - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - (value: T, array: _.List | null | undefined): number; -} -interface SortedIndexBy1x2 { - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - (): SortedIndexBy1x2; - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - (array: _.List | null | undefined): number; -} - -declare const sortedIndexBy: SortedIndexBy; +import { sortedIndexBy } from "../fp"; export = sortedIndexBy; diff --git a/types/lodash/fp/sortedIndexOf.d.ts b/types/lodash/fp/sortedIndexOf.d.ts index 0b9f5503ab..beeb6db0ca 100644 --- a/types/lodash/fp/sortedIndexOf.d.ts +++ b/types/lodash/fp/sortedIndexOf.d.ts @@ -1,83 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SortedIndexOf { - /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedIndexOf([1, 1, 2, 2], 2); - * // => 2 - */ - (): SortedIndexOf; - /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedIndexOf([1, 1, 2, 2], 2); - * // => 2 - */ - (value: T): SortedIndexOf1x1; - /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedIndexOf([1, 1, 2, 2], 2); - * // => 2 - */ - (value: T, array: _.List | null | undefined): number; -} -interface SortedIndexOf1x1 { - /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedIndexOf([1, 1, 2, 2], 2); - * // => 2 - */ - (): SortedIndexOf1x1; - /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedIndexOf([1, 1, 2, 2], 2); - * // => 2 - */ - (array: _.List | null | undefined): number; -} - -declare const sortedIndexOf: SortedIndexOf; +import { sortedIndexOf } from "../fp"; export = sortedIndexOf; diff --git a/types/lodash/fp/sortedLastIndex.d.ts b/types/lodash/fp/sortedLastIndex.d.ts index 26b45fe1df..eea77a0382 100644 --- a/types/lodash/fp/sortedLastIndex.d.ts +++ b/types/lodash/fp/sortedLastIndex.d.ts @@ -1,88 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SortedLastIndex { - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedLastIndex([4, 5], 4); - * // => 1 - */ - (): SortedLastIndex; - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedLastIndex([4, 5], 4); - * // => 1 - */ - (value: T): SortedLastIndex1x1; - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedLastIndex([4, 5], 4); - * // => 1 - */ - (value: T, array: _.List | null | undefined): number; -} -interface SortedLastIndex1x1 { - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedLastIndex([4, 5], 4); - * // => 1 - */ - (): SortedLastIndex1x1; - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedLastIndex([4, 5], 4); - * // => 1 - */ - (array: _.List | null | undefined): number; -} - -declare const sortedLastIndex: SortedLastIndex; +import { sortedLastIndex } from "../fp"; export = sortedLastIndex; diff --git a/types/lodash/fp/sortedLastIndexBy.d.ts b/types/lodash/fp/sortedLastIndexBy.d.ts index 6f00b9c982..6c8e4ee545 100644 --- a/types/lodash/fp/sortedLastIndexBy.d.ts +++ b/types/lodash/fp/sortedLastIndexBy.d.ts @@ -1,168 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SortedLastIndexBy { - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - (): SortedLastIndexBy; - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - (iteratee: _.ValueIteratee): SortedLastIndexBy1x1; - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - (iteratee: _.ValueIteratee, value: T): SortedLastIndexBy1x2; - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - (iteratee: _.ValueIteratee, value: T, array: _.List | null | undefined): number; -} -interface SortedLastIndexBy1x1 { - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - (): SortedLastIndexBy1x1; - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - (value: T): SortedLastIndexBy1x2; - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - (value: T, array: _.List | null | undefined): number; -} -interface SortedLastIndexBy1x2 { - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - (): SortedLastIndexBy1x2; - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - (array: _.List | null | undefined): number; -} - -declare const sortedLastIndexBy: SortedLastIndexBy; +import { sortedLastIndexBy } from "../fp"; export = sortedLastIndexBy; diff --git a/types/lodash/fp/sortedLastIndexOf.d.ts b/types/lodash/fp/sortedLastIndexOf.d.ts index 3fb6d2d77b..a02caf3ce5 100644 --- a/types/lodash/fp/sortedLastIndexOf.d.ts +++ b/types/lodash/fp/sortedLastIndexOf.d.ts @@ -1,83 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SortedLastIndexOf { - /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedLastIndexOf([1, 1, 2, 2], 2); - * // => 3 - */ - (): SortedLastIndexOf; - /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedLastIndexOf([1, 1, 2, 2], 2); - * // => 3 - */ - (value: T): SortedLastIndexOf1x1; - /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedLastIndexOf([1, 1, 2, 2], 2); - * // => 3 - */ - (value: T, array: _.List | null | undefined): number; -} -interface SortedLastIndexOf1x1 { - /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedLastIndexOf([1, 1, 2, 2], 2); - * // => 3 - */ - (): SortedLastIndexOf1x1; - /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedLastIndexOf([1, 1, 2, 2], 2); - * // => 3 - */ - (array: _.List | null | undefined): number; -} - -declare const sortedLastIndexOf: SortedLastIndexOf; +import { sortedLastIndexOf } from "../fp"; export = sortedLastIndexOf; diff --git a/types/lodash/fp/sortedUniq.d.ts b/types/lodash/fp/sortedUniq.d.ts index ae5c6a826b..03d8e691e0 100644 --- a/types/lodash/fp/sortedUniq.d.ts +++ b/types/lodash/fp/sortedUniq.d.ts @@ -1,23 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type SortedUniq = - /** - * This method is like `_.uniq` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniq([1, 1, 2]); - * // => [1, 2] - */ - (array: _.List | null | undefined) => T[]; - -declare const sortedUniq: SortedUniq; +import { sortedUniq } from "../fp"; export = sortedUniq; diff --git a/types/lodash/fp/sortedUniqBy.d.ts b/types/lodash/fp/sortedUniqBy.d.ts index 9300e80b75..466981a264 100644 --- a/types/lodash/fp/sortedUniqBy.d.ts +++ b/types/lodash/fp/sortedUniqBy.d.ts @@ -1,141 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SortedUniqBy { - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @param [iteratee] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - (): SortedUniqBy; - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @param [iteratee] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - (iteratee: (value: string) => _.NotVoid): SortedUniqBy1x1; - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @param [iteratee] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - (iteratee: (value: string) => _.NotVoid, array: string | null | undefined): string[]; - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @param [iteratee] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - (iteratee: _.ValueIteratee): SortedUniqBy2x1; - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @param [iteratee] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - (iteratee: _.ValueIteratee, array: _.List | null | undefined): T[]; -} -interface SortedUniqBy1x1 { - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @param [iteratee] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - (): SortedUniqBy1x1; - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @param [iteratee] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - (array: string | null | undefined): string[]; -} -interface SortedUniqBy2x1 { - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @param [iteratee] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - (): SortedUniqBy2x1; - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @param [iteratee] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - (array: _.List | null | undefined): T[]; -} - -declare const sortedUniqBy: SortedUniqBy; +import { sortedUniqBy } from "../fp"; export = sortedUniqBy; diff --git a/types/lodash/fp/split.d.ts b/types/lodash/fp/split.d.ts index 50ad820360..8274d4081f 100644 --- a/types/lodash/fp/split.d.ts +++ b/types/lodash/fp/split.d.ts @@ -1,66 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Split { - /** - * Splits string by separator. - * - * Note: This method is based on String#split. - * - * @param string The string to trim. - * @param separator The separator pattern to split by. - * @param limit The length to truncate results to. - * @return Returns the new array of string segments. - */ - (): Split; - /** - * Splits string by separator. - * - * Note: This method is based on String#split. - * - * @param string The string to trim. - * @param separator The separator pattern to split by. - * @param limit The length to truncate results to. - * @return Returns the new array of string segments. - */ - (separator: RegExp|string): Split1x1; - /** - * Splits string by separator. - * - * Note: This method is based on String#split. - * - * @param string The string to trim. - * @param separator The separator pattern to split by. - * @param limit The length to truncate results to. - * @return Returns the new array of string segments. - */ - (separator: RegExp|string, string: string): string[]; -} -interface Split1x1 { - /** - * Splits string by separator. - * - * Note: This method is based on String#split. - * - * @param string The string to trim. - * @param separator The separator pattern to split by. - * @param limit The length to truncate results to. - * @return Returns the new array of string segments. - */ - (): Split1x1; - /** - * Splits string by separator. - * - * Note: This method is based on String#split. - * - * @param string The string to trim. - * @param separator The separator pattern to split by. - * @param limit The length to truncate results to. - * @return Returns the new array of string segments. - */ - (string: string): string[]; -} - -declare const split: Split; +import { split } from "../fp"; export = split; diff --git a/types/lodash/fp/spread.d.ts b/types/lodash/fp/spread.d.ts index 197c49278d..44eb90cd21 100644 --- a/types/lodash/fp/spread.d.ts +++ b/types/lodash/fp/spread.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Spread = - /** - * Creates a function that invokes func with the this binding of the created function and an array of arguments - * much like Function#apply. - * - * Note: This method is based on the spread operator. - * - * @param func The function to spread arguments over. - * @return Returns the new function. - */ - (func: (...args: any[]) => TResult) => (...args: any[]) => TResult; - -declare const spread: Spread; +import { spread } from "../fp"; export = spread; diff --git a/types/lodash/fp/spreadFrom.d.ts b/types/lodash/fp/spreadFrom.d.ts index 7ac31bc9fe..7eb840b036 100644 --- a/types/lodash/fp/spreadFrom.d.ts +++ b/types/lodash/fp/spreadFrom.d.ts @@ -1,61 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Spread { - /** - * Creates a function that invokes func with the this binding of the created function and an array of arguments - * much like Function#apply. - * - * Note: This method is based on the spread operator. - * - * @param func The function to spread arguments over. - * @return Returns the new function. - */ - (): Spread; - /** - * Creates a function that invokes func with the this binding of the created function and an array of arguments - * much like Function#apply. - * - * Note: This method is based on the spread operator. - * - * @param func The function to spread arguments over. - * @return Returns the new function. - */ - (start: number): Spread1x1; - /** - * Creates a function that invokes func with the this binding of the created function and an array of arguments - * much like Function#apply. - * - * Note: This method is based on the spread operator. - * - * @param func The function to spread arguments over. - * @return Returns the new function. - */ - (start: number, func: (...args: any[]) => TResult): (...args: any[]) => TResult; -} -interface Spread1x1 { - /** - * Creates a function that invokes func with the this binding of the created function and an array of arguments - * much like Function#apply. - * - * Note: This method is based on the spread operator. - * - * @param func The function to spread arguments over. - * @return Returns the new function. - */ - (): Spread1x1; - /** - * Creates a function that invokes func with the this binding of the created function and an array of arguments - * much like Function#apply. - * - * Note: This method is based on the spread operator. - * - * @param func The function to spread arguments over. - * @return Returns the new function. - */ - (func: (...args: any[]) => TResult): (...args: any[]) => TResult; -} - -declare const spreadFrom: Spread; +import { spreadFrom } from "../fp"; export = spreadFrom; diff --git a/types/lodash/fp/startCase.d.ts b/types/lodash/fp/startCase.d.ts index ca27b6b47f..4f580aa5d0 100644 --- a/types/lodash/fp/startCase.d.ts +++ b/types/lodash/fp/startCase.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type StartCase = - /** - * Converts string to start case. - * - * @param string The string to convert. - * @return Returns the start cased string. - */ - (string: string) => string; - -declare const startCase: StartCase; +import { startCase } from "../fp"; export = startCase; diff --git a/types/lodash/fp/startsWith.d.ts b/types/lodash/fp/startsWith.d.ts index 962f880742..f84397dc68 100644 --- a/types/lodash/fp/startsWith.d.ts +++ b/types/lodash/fp/startsWith.d.ts @@ -1,56 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface StartsWith { - /** - * Checks if string starts with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string starts with target, else false. - */ - (): StartsWith; - /** - * Checks if string starts with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string starts with target, else false. - */ - (target: string): StartsWith1x1; - /** - * Checks if string starts with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string starts with target, else false. - */ - (target: string, string: string): boolean; -} -interface StartsWith1x1 { - /** - * Checks if string starts with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string starts with target, else false. - */ - (): StartsWith1x1; - /** - * Checks if string starts with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string starts with target, else false. - */ - (string: string): boolean; -} - -declare const startsWith: StartsWith; +import { startsWith } from "../fp"; export = startsWith; diff --git a/types/lodash/fp/stubArray.d.ts b/types/lodash/fp/stubArray.d.ts index 1dd9667827..8ff910e591 100644 --- a/types/lodash/fp/stubArray.d.ts +++ b/types/lodash/fp/stubArray.d.ts @@ -1,14 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type StubArray = - /** - * This method returns a new empty array. - * - * @returns Returns the new empty array. - */ - () => any[]; - -declare const stubArray: StubArray; +import { stubArray } from "../fp"; export = stubArray; diff --git a/types/lodash/fp/stubFalse.d.ts b/types/lodash/fp/stubFalse.d.ts index abea160b5f..4cc041482d 100644 --- a/types/lodash/fp/stubFalse.d.ts +++ b/types/lodash/fp/stubFalse.d.ts @@ -1,14 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type StubFalse = - /** - * This method returns `false`. - * - * @returns Returns `false`. - */ - () => boolean; - -declare const stubFalse: StubFalse; +import { stubFalse } from "../fp"; export = stubFalse; diff --git a/types/lodash/fp/stubObject.d.ts b/types/lodash/fp/stubObject.d.ts index 6765c18b5a..d7c826997f 100644 --- a/types/lodash/fp/stubObject.d.ts +++ b/types/lodash/fp/stubObject.d.ts @@ -1,14 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type StubObject = - /** - * This method returns a new empty object. - * - * @returns Returns the new empty object. - */ - () => any; - -declare const stubObject: StubObject; +import { stubObject } from "../fp"; export = stubObject; diff --git a/types/lodash/fp/stubString.d.ts b/types/lodash/fp/stubString.d.ts index 66da9843e9..cbfa449758 100644 --- a/types/lodash/fp/stubString.d.ts +++ b/types/lodash/fp/stubString.d.ts @@ -1,14 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type StubString = - /** - * This method returns an empty string. - * - * @returns Returns the empty string. - */ - () => string; - -declare const stubString: StubString; +import { stubString } from "../fp"; export = stubString; diff --git a/types/lodash/fp/stubTrue.d.ts b/types/lodash/fp/stubTrue.d.ts index 25cba4fcde..0ed7e5b927 100644 --- a/types/lodash/fp/stubTrue.d.ts +++ b/types/lodash/fp/stubTrue.d.ts @@ -1,14 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type StubTrue = - /** - * This method returns `true`. - * - * @returns Returns `true`. - */ - () => boolean; - -declare const stubTrue: StubTrue; +import { stubTrue } from "../fp"; export = stubTrue; diff --git a/types/lodash/fp/subtract.d.ts b/types/lodash/fp/subtract.d.ts index b19ddb1f7e..201301b300 100644 --- a/types/lodash/fp/subtract.d.ts +++ b/types/lodash/fp/subtract.d.ts @@ -1,76 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Subtract { - /** - * Subtract two numbers. - * - * @category Math - * @param minuend The first number in a subtraction. - * @param subtrahend The second number in a subtraction. - * @returns Returns the difference. - * @example - * - * _.subtract(6, 4); - * // => 2 - */ - (): Subtract; - /** - * Subtract two numbers. - * - * @category Math - * @param minuend The first number in a subtraction. - * @param subtrahend The second number in a subtraction. - * @returns Returns the difference. - * @example - * - * _.subtract(6, 4); - * // => 2 - */ - (minuend: number): Subtract1x1; - /** - * Subtract two numbers. - * - * @category Math - * @param minuend The first number in a subtraction. - * @param subtrahend The second number in a subtraction. - * @returns Returns the difference. - * @example - * - * _.subtract(6, 4); - * // => 2 - */ - (minuend: number, subtrahend: number): number; -} -interface Subtract1x1 { - /** - * Subtract two numbers. - * - * @category Math - * @param minuend The first number in a subtraction. - * @param subtrahend The second number in a subtraction. - * @returns Returns the difference. - * @example - * - * _.subtract(6, 4); - * // => 2 - */ - (): Subtract1x1; - /** - * Subtract two numbers. - * - * @category Math - * @param minuend The first number in a subtraction. - * @param subtrahend The second number in a subtraction. - * @returns Returns the difference. - * @example - * - * _.subtract(6, 4); - * // => 2 - */ - (subtrahend: number): number; -} - -declare const subtract: Subtract; +import { subtract } from "../fp"; export = subtract; diff --git a/types/lodash/fp/sum.d.ts b/types/lodash/fp/sum.d.ts index 84f6849067..6d7d02026e 100644 --- a/types/lodash/fp/sum.d.ts +++ b/types/lodash/fp/sum.d.ts @@ -1,22 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Sum = - /** - * Computes the sum of the values in `array`. - * - * @category Math - * @param array The array to iterate over. - * @returns Returns the sum. - * @example - * - * _.sum([4, 2, 8, 6]); - * // => 20 - */ - (collection: _.List | null | undefined) => number; - -declare const sum: Sum; +import { sum } from "../fp"; export = sum; diff --git a/types/lodash/fp/sumBy.d.ts b/types/lodash/fp/sumBy.d.ts index 93d6be33f7..3f44c3f6c5 100644 --- a/types/lodash/fp/sumBy.d.ts +++ b/types/lodash/fp/sumBy.d.ts @@ -1,118 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface SumBy { - /** - * This method is like `_.sum` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the value to be summed. - * The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the sum. - * @example - * - * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; - * - * _.sumBy(objects, function(o) { return o.n; }); - * // => 20 - * - * // using the `_.property` iteratee shorthand - * _.sumBy(objects, 'n'); - * // => 20 - */ - (): SumBy; - /** - * This method is like `_.sum` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the value to be summed. - * The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the sum. - * @example - * - * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; - * - * _.sumBy(objects, function(o) { return o.n; }); - * // => 20 - * - * // using the `_.property` iteratee shorthand - * _.sumBy(objects, 'n'); - * // => 20 - */ - (iteratee: ((value: T) => number) | string): SumBy1x1; - /** - * This method is like `_.sum` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the value to be summed. - * The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the sum. - * @example - * - * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; - * - * _.sumBy(objects, function(o) { return o.n; }); - * // => 20 - * - * // using the `_.property` iteratee shorthand - * _.sumBy(objects, 'n'); - * // => 20 - */ - (iteratee: ((value: T) => number) | string, collection: _.List | null | undefined): number; -} -interface SumBy1x1 { - /** - * This method is like `_.sum` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the value to be summed. - * The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the sum. - * @example - * - * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; - * - * _.sumBy(objects, function(o) { return o.n; }); - * // => 20 - * - * // using the `_.property` iteratee shorthand - * _.sumBy(objects, 'n'); - * // => 20 - */ - (): SumBy1x1; - /** - * This method is like `_.sum` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the value to be summed. - * The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the sum. - * @example - * - * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; - * - * _.sumBy(objects, function(o) { return o.n; }); - * // => 20 - * - * // using the `_.property` iteratee shorthand - * _.sumBy(objects, 'n'); - * // => 20 - */ - (collection: _.List | null | undefined): number; -} - -declare const sumBy: SumBy; +import { sumBy } from "../fp"; export = sumBy; diff --git a/types/lodash/fp/symmetricDifference.d.ts b/types/lodash/fp/symmetricDifference.d.ts index 8d09e4f1a3..cba1d1f70d 100644 --- a/types/lodash/fp/symmetricDifference.d.ts +++ b/types/lodash/fp/symmetricDifference.d.ts @@ -1,48 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Xor { - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - (): Xor; - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - (arrays2: _.List | null | undefined): Xor1x1; - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - (arrays2: _.List | null | undefined, arrays: _.List | null | undefined): T[]; -} -interface Xor1x1 { - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - (): Xor1x1; - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - (arrays: _.List | null | undefined): T[]; -} - -declare const symmetricDifference: Xor; +import { symmetricDifference } from "../fp"; export = symmetricDifference; diff --git a/types/lodash/fp/symmetricDifferenceBy.d.ts b/types/lodash/fp/symmetricDifferenceBy.d.ts index 1bfeb6c6cd..8e9316cf42 100644 --- a/types/lodash/fp/symmetricDifferenceBy.d.ts +++ b/types/lodash/fp/symmetricDifferenceBy.d.ts @@ -1,186 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface XorBy { - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (): XorBy; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee): XorBy1x1; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee, arrays: _.List | null | undefined): XorBy1x2; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee, arrays: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface XorBy1x1 { - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (): XorBy1x1; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (arrays: _.List | null | undefined): XorBy1x2; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (arrays: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface XorBy1x2 { - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (): XorBy1x2; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (arrays2: _.List | null | undefined): T[]; -} - -declare const symmetricDifferenceBy: XorBy; +import { symmetricDifferenceBy } from "../fp"; export = symmetricDifferenceBy; diff --git a/types/lodash/fp/symmetricDifferenceWith.d.ts b/types/lodash/fp/symmetricDifferenceWith.d.ts index 0aa1d417fb..864ec01b50 100644 --- a/types/lodash/fp/symmetricDifferenceWith.d.ts +++ b/types/lodash/fp/symmetricDifferenceWith.d.ts @@ -1,177 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface XorWith { - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (): XorWith; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (comparator: _.Comparator): XorWith1x1; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (comparator: _.Comparator, arrays: _.List | null | undefined): XorWith1x2; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (comparator: _.Comparator, arrays: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface XorWith1x1 { - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (): XorWith1x1; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (arrays: _.List | null | undefined): XorWith1x2; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (arrays: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface XorWith1x2 { - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (): XorWith1x2; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (arrays2: _.List | null | undefined): T[]; -} - -declare const symmetricDifferenceWith: XorWith; +import { symmetricDifferenceWith } from "../fp"; export = symmetricDifferenceWith; diff --git a/types/lodash/fp/tail.d.ts b/types/lodash/fp/tail.d.ts index 1f4e5baea5..df9bcdcd57 100644 --- a/types/lodash/fp/tail.d.ts +++ b/types/lodash/fp/tail.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Tail = - /** - * Gets all but the first element of array. - * - * @param array The array to query. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined) => T[]; - -declare const tail: Tail; +import { tail } from "../fp"; export = tail; diff --git a/types/lodash/fp/take.d.ts b/types/lodash/fp/take.d.ts index 8c64452d27..ab46aca056 100644 --- a/types/lodash/fp/take.d.ts +++ b/types/lodash/fp/take.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Take { - /** - * Creates a slice of array with n elements taken from the beginning. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (): Take; - /** - * Creates a slice of array with n elements taken from the beginning. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (n: number): Take1x1; - /** - * Creates a slice of array with n elements taken from the beginning. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (n: number, array: _.List | null | undefined): T[]; -} -interface Take1x1 { - /** - * Creates a slice of array with n elements taken from the beginning. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (): Take1x1; - /** - * Creates a slice of array with n elements taken from the beginning. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const take: Take; +import { take } from "../fp"; export = take; diff --git a/types/lodash/fp/takeLast.d.ts b/types/lodash/fp/takeLast.d.ts index 6677d06e16..027dcda5ee 100644 --- a/types/lodash/fp/takeLast.d.ts +++ b/types/lodash/fp/takeLast.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface TakeRight { - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (): TakeRight; - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (n: number): TakeRight1x1; - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (n: number, array: _.List | null | undefined): T[]; -} -interface TakeRight1x1 { - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (): TakeRight1x1; - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const takeLast: TakeRight; +import { takeLast } from "../fp"; export = takeLast; diff --git a/types/lodash/fp/takeLastWhile.d.ts b/types/lodash/fp/takeLastWhile.d.ts index 4e2cd0a933..c6729c3529 100644 --- a/types/lodash/fp/takeLastWhile.d.ts +++ b/types/lodash/fp/takeLastWhile.d.ts @@ -1,108 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface TakeRightWhile { - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): TakeRightWhile; - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee): TakeRightWhile1x1; - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee, array: _.List | null | undefined): T[]; -} -interface TakeRightWhile1x1 { - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): TakeRightWhile1x1; - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const takeLastWhile: TakeRightWhile; +import { takeLastWhile } from "../fp"; export = takeLastWhile; diff --git a/types/lodash/fp/takeRight.d.ts b/types/lodash/fp/takeRight.d.ts index 385f447919..162c5166e4 100644 --- a/types/lodash/fp/takeRight.d.ts +++ b/types/lodash/fp/takeRight.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface TakeRight { - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (): TakeRight; - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (n: number): TakeRight1x1; - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (n: number, array: _.List | null | undefined): T[]; -} -interface TakeRight1x1 { - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (): TakeRight1x1; - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const takeRight: TakeRight; +import { takeRight } from "../fp"; export = takeRight; diff --git a/types/lodash/fp/takeRightWhile.d.ts b/types/lodash/fp/takeRightWhile.d.ts index b2a8934a14..b23f7a4608 100644 --- a/types/lodash/fp/takeRightWhile.d.ts +++ b/types/lodash/fp/takeRightWhile.d.ts @@ -1,108 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface TakeRightWhile { - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): TakeRightWhile; - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee): TakeRightWhile1x1; - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee, array: _.List | null | undefined): T[]; -} -interface TakeRightWhile1x1 { - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): TakeRightWhile1x1; - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const takeRightWhile: TakeRightWhile; +import { takeRightWhile } from "../fp"; export = takeRightWhile; diff --git a/types/lodash/fp/takeWhile.d.ts b/types/lodash/fp/takeWhile.d.ts index 3082de833b..b8cb517606 100644 --- a/types/lodash/fp/takeWhile.d.ts +++ b/types/lodash/fp/takeWhile.d.ts @@ -1,108 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface TakeWhile { - /** - * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): TakeWhile; - /** - * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee): TakeWhile1x1; - /** - * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (predicate: _.ValueIteratee, array: _.List | null | undefined): T[]; -} -interface TakeWhile1x1 { - /** - * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (): TakeWhile1x1; - /** - * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - (array: _.List | null | undefined): T[]; -} - -declare const takeWhile: TakeWhile; +import { takeWhile } from "../fp"; export = takeWhile; diff --git a/types/lodash/fp/tap.d.ts b/types/lodash/fp/tap.d.ts index 2091f9301a..8ffbbd7f23 100644 --- a/types/lodash/fp/tap.d.ts +++ b/types/lodash/fp/tap.d.ts @@ -1,66 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Tap { - /** - * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one - * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations - * on intermediate results within the chain. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @parem thisArg The this binding of interceptor. - * @return Returns value. - **/ - (): Tap; - /** - * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one - * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations - * on intermediate results within the chain. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @parem thisArg The this binding of interceptor. - * @return Returns value. - **/ - (interceptor: (value: T) => void): Tap1x1; - /** - * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one - * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations - * on intermediate results within the chain. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @parem thisArg The this binding of interceptor. - * @return Returns value. - **/ - (interceptor: (value: T) => void, value: T): T; -} -interface Tap1x1 { - /** - * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one - * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations - * on intermediate results within the chain. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @parem thisArg The this binding of interceptor. - * @return Returns value. - **/ - (): Tap1x1; - /** - * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one - * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations - * on intermediate results within the chain. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @parem thisArg The this binding of interceptor. - * @return Returns value. - **/ - (value: T): T; -} - -declare const tap: Tap; +import { tap } from "../fp"; export = tap; diff --git a/types/lodash/fp/template.d.ts b/types/lodash/fp/template.d.ts index f913171374..3a37ed1af7 100644 --- a/types/lodash/fp/template.d.ts +++ b/types/lodash/fp/template.d.ts @@ -1,37 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Template = - /** - * Creates a compiled template function that can interpolate data properties in "interpolate" delimiters, - * HTML-escape interpolated data properties in "escape" delimiters, and execute JavaScript in "evaluate" - * delimiters. Data properties may be accessed as free variables in the template. If a setting object is - * provided it takes precedence over _.templateSettings values. - * - * Note: In the development build _.template utilizes - * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier - * debugging. - * - * For more information on precompiling templates see - * [lodash's custom builds documentation](https://lodash.com/custom-builds). - * - * For more information on Chrome extension sandboxes see - * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). - * - * @param string The template string. - * @param options The options object. - * @param options.escape The HTML "escape" delimiter. - * @param options.evaluate The "evaluate" delimiter. - * @param options.imports An object to import into the template as free variables. - * @param options.interpolate The "interpolate" delimiter. - * @param options.sourceURL The sourceURL of the template's compiled source. - * @param options.variable The data object variable name. - * @return Returns the compiled template function. - */ - (string: string) => _.TemplateExecutor; - -declare const template: Template; +import { template } from "../fp"; export = template; diff --git a/types/lodash/fp/throttle.d.ts b/types/lodash/fp/throttle.d.ts index 7644c669e4..24d8b7f4ef 100644 --- a/types/lodash/fp/throttle.d.ts +++ b/types/lodash/fp/throttle.d.ts @@ -1,98 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Throttle { - /** - * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled - * function comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke - * them. Provide an options object to indicate that func should be invoked on the leading and/or trailing edge - * of the wait timeout. Subsequent calls to the throttled function return the result of the last func call. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if - * the the throttled function is invoked more than once during the wait timeout. - * - * @param func The function to throttle. - * @param wait The number of milliseconds to throttle invocations to. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new throttled function. - */ - (): Throttle; - /** - * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled - * function comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke - * them. Provide an options object to indicate that func should be invoked on the leading and/or trailing edge - * of the wait timeout. Subsequent calls to the throttled function return the result of the last func call. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if - * the the throttled function is invoked more than once during the wait timeout. - * - * @param func The function to throttle. - * @param wait The number of milliseconds to throttle invocations to. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new throttled function. - */ - (wait: number): Throttle1x1; - /** - * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled - * function comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke - * them. Provide an options object to indicate that func should be invoked on the leading and/or trailing edge - * of the wait timeout. Subsequent calls to the throttled function return the result of the last func call. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if - * the the throttled function is invoked more than once during the wait timeout. - * - * @param func The function to throttle. - * @param wait The number of milliseconds to throttle invocations to. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new throttled function. - */ - any>(wait: number, func: T): T & _.Cancelable; -} -interface Throttle1x1 { - /** - * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled - * function comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke - * them. Provide an options object to indicate that func should be invoked on the leading and/or trailing edge - * of the wait timeout. Subsequent calls to the throttled function return the result of the last func call. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if - * the the throttled function is invoked more than once during the wait timeout. - * - * @param func The function to throttle. - * @param wait The number of milliseconds to throttle invocations to. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new throttled function. - */ - (): Throttle1x1; - /** - * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled - * function comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke - * them. Provide an options object to indicate that func should be invoked on the leading and/or trailing edge - * of the wait timeout. Subsequent calls to the throttled function return the result of the last func call. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if - * the the throttled function is invoked more than once during the wait timeout. - * - * @param func The function to throttle. - * @param wait The number of milliseconds to throttle invocations to. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new throttled function. - */ - any>(func: T): T & _.Cancelable; -} - -declare const throttle: Throttle; +import { throttle } from "../fp"; export = throttle; diff --git a/types/lodash/fp/thru.d.ts b/types/lodash/fp/thru.d.ts index d7f60ba8d0..b9725820ad 100644 --- a/types/lodash/fp/thru.d.ts +++ b/types/lodash/fp/thru.d.ts @@ -1,56 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Thru { - /** - * This method is like _.tap except that it returns the result of interceptor. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @param thisArg The this binding of interceptor. - * @return Returns the result of interceptor. - */ - (): Thru; - /** - * This method is like _.tap except that it returns the result of interceptor. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @param thisArg The this binding of interceptor. - * @return Returns the result of interceptor. - */ - (interceptor: (value: T) => TResult): Thru1x1; - /** - * This method is like _.tap except that it returns the result of interceptor. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @param thisArg The this binding of interceptor. - * @return Returns the result of interceptor. - */ - (interceptor: (value: T) => TResult, value: T): TResult; -} -interface Thru1x1 { - /** - * This method is like _.tap except that it returns the result of interceptor. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @param thisArg The this binding of interceptor. - * @return Returns the result of interceptor. - */ - (): Thru1x1; - /** - * This method is like _.tap except that it returns the result of interceptor. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @param thisArg The this binding of interceptor. - * @return Returns the result of interceptor. - */ - (value: T): TResult; -} - -declare const thru: Thru; +import { thru } from "../fp"; export = thru; diff --git a/types/lodash/fp/times.d.ts b/types/lodash/fp/times.d.ts index 777f7423fc..3d9f0c6077 100644 --- a/types/lodash/fp/times.d.ts +++ b/types/lodash/fp/times.d.ts @@ -1,56 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Times { - /** - * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee - * is invoked with one argument; (index). - * - * @param n The number of times to invoke iteratee. - * @param iteratee The function invoked per iteration. - * @return Returns the array of results. - */ - (): Times; - /** - * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee - * is invoked with one argument; (index). - * - * @param n The number of times to invoke iteratee. - * @param iteratee The function invoked per iteration. - * @return Returns the array of results. - */ - (iteratee: (num: number) => TResult): Times1x1; - /** - * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee - * is invoked with one argument; (index). - * - * @param n The number of times to invoke iteratee. - * @param iteratee The function invoked per iteration. - * @return Returns the array of results. - */ - (iteratee: (num: number) => TResult, n: number): TResult[]; -} -interface Times1x1 { - /** - * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee - * is invoked with one argument; (index). - * - * @param n The number of times to invoke iteratee. - * @param iteratee The function invoked per iteration. - * @return Returns the array of results. - */ - (): Times1x1; - /** - * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee - * is invoked with one argument; (index). - * - * @param n The number of times to invoke iteratee. - * @param iteratee The function invoked per iteration. - * @return Returns the array of results. - */ - (n: number): TResult[]; -} - -declare const times: Times; +import { times } from "../fp"; export = times; diff --git a/types/lodash/fp/toArray.d.ts b/types/lodash/fp/toArray.d.ts index 78d50b3fe3..4b18ce6d55 100644 --- a/types/lodash/fp/toArray.d.ts +++ b/types/lodash/fp/toArray.d.ts @@ -1,32 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ToArray { - /** - * Converts value to an array. - * - * @param value The value to convert. - * @return Returns the converted array. - */ - (value: _.List | _.Dictionary | _.NumericDictionary | null | undefined): T[]; - /** - * Converts value to an array. - * - * @param value The value to convert. - * @return Returns the converted array. - */ - (value: T): Array; - /** - * Converts value to an array. - * - * @param value The value to convert. - * @return Returns the converted array. - */ - (): any[]; -} - -declare const toArray: ToArray; +import { toArray } from "../fp"; export = toArray; diff --git a/types/lodash/fp/toFinite.d.ts b/types/lodash/fp/toFinite.d.ts index 7f28cb70da..1d41996182 100644 --- a/types/lodash/fp/toFinite.d.ts +++ b/types/lodash/fp/toFinite.d.ts @@ -1,30 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type ToFinite = - /** - * Converts `value` to a finite number. - * - * @since 4.12.0 - * @category Lang - * @param value The value to convert. - * @returns Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ - (value: any) => number; - -declare const toFinite: ToFinite; +import { toFinite } from "../fp"; export = toFinite; diff --git a/types/lodash/fp/toInteger.d.ts b/types/lodash/fp/toInteger.d.ts index 7eb32253d7..46ccaf945b 100644 --- a/types/lodash/fp/toInteger.d.ts +++ b/types/lodash/fp/toInteger.d.ts @@ -1,31 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type ToInteger = - /** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @category Lang - * @param value The value to convert. - * @returns Returns the converted integer. - * @example - * - * _.toInteger(3); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3'); - * // => 3 - */ - (value: any) => number; - -declare const toInteger: ToInteger; +import { toInteger } from "../fp"; export = toInteger; diff --git a/types/lodash/fp/toLength.d.ts b/types/lodash/fp/toLength.d.ts index 9df6af979b..bb62924318 100644 --- a/types/lodash/fp/toLength.d.ts +++ b/types/lodash/fp/toLength.d.ts @@ -1,32 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type ToLength = - /** - * Converts `value` to an integer suitable for use as the length of an - * array-like object. - * - * **Note:** This method is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @category Lang - * @param value The value to convert. - * @return Returns the converted integer. - * @example - * - * _.toLength(3); - * // => 3 - * - * _.toLength(Number.MIN_VALUE); - * // => 0 - * - * _.toLength(Infinity); - * // => 4294967295 - * - * _.toLength('3'); - * // => 3 - */ - (value: any) => number; - -declare const toLength: ToLength; +import { toLength } from "../fp"; export = toLength; diff --git a/types/lodash/fp/toLower.d.ts b/types/lodash/fp/toLower.d.ts index 6423a579b2..64e6e364d0 100644 --- a/types/lodash/fp/toLower.d.ts +++ b/types/lodash/fp/toLower.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type ToLower = - /** - * Converts `string`, as a whole, to lower case. - * - * @param string The string to convert. - * @return Returns the lower cased string. - */ - (string: string) => string; - -declare const toLower: ToLower; +import { toLower } from "../fp"; export = toLower; diff --git a/types/lodash/fp/toNumber.d.ts b/types/lodash/fp/toNumber.d.ts index 346ded8778..262b91c52d 100644 --- a/types/lodash/fp/toNumber.d.ts +++ b/types/lodash/fp/toNumber.d.ts @@ -1,29 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type ToNumber = - /** - * Converts `value` to a number. - * - * @category Lang - * @param value The value to process. - * @returns Returns the number. - * @example - * - * _.toNumber(3); - * // => 3 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3'); - * // => 3 - */ - (value: any) => number; - -declare const toNumber: ToNumber; +import { toNumber } from "../fp"; export = toNumber; diff --git a/types/lodash/fp/toPairs.d.ts b/types/lodash/fp/toPairs.d.ts index 4097690ac8..89334fcb5d 100644 --- a/types/lodash/fp/toPairs.d.ts +++ b/types/lodash/fp/toPairs.d.ts @@ -1,25 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ToPairs { - /** - * Creates an array of own enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - (object: _.Dictionary | _.NumericDictionary): Array<[string, T]>; - /** - * Creates an array of own enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - (object: object): Array<[string, any]>; -} - -declare const toPairs: ToPairs; +import { toPairs } from "../fp"; export = toPairs; diff --git a/types/lodash/fp/toPairsIn.d.ts b/types/lodash/fp/toPairsIn.d.ts index 80859cc318..278ff0b1df 100644 --- a/types/lodash/fp/toPairsIn.d.ts +++ b/types/lodash/fp/toPairsIn.d.ts @@ -1,25 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ToPairsIn { - /** - * Creates an array of own and inherited enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - (object: _.Dictionary | _.NumericDictionary): Array<[string, T]>; - /** - * Creates an array of own and inherited enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - (object: object): Array<[string, any]>; -} - -declare const toPairsIn: ToPairsIn; +import { toPairsIn } from "../fp"; export = toPairsIn; diff --git a/types/lodash/fp/toPath.d.ts b/types/lodash/fp/toPath.d.ts index a501811e14..9f2287ceae 100644 --- a/types/lodash/fp/toPath.d.ts +++ b/types/lodash/fp/toPath.d.ts @@ -1,32 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type ToPath = - /** - * Converts `value` to a property path array. - * - * @category Util - * @param value The value to convert. - * @returns Returns the new property path array. - * @example - * - * _.toPath('a.b.c'); - * // => ['a', 'b', 'c'] - * - * _.toPath('a[0].b.c'); - * // => ['a', '0', 'b', 'c'] - * - * var path = ['a', 'b', 'c'], - * newPath = _.toPath(path); - * - * console.log(newPath); - * // => ['a', 'b', 'c'] - * - * console.log(path === newPath); - * // => false - */ - (value: any) => string[]; - -declare const toPath: ToPath; +import { toPath } from "../fp"; export = toPath; diff --git a/types/lodash/fp/toPlainObject.d.ts b/types/lodash/fp/toPlainObject.d.ts index 18b2eada62..22fa070387 100644 --- a/types/lodash/fp/toPlainObject.d.ts +++ b/types/lodash/fp/toPlainObject.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type ToPlainObject = - /** - * Converts value to a plain object flattening inherited enumerable properties of value to own properties - * of the plain object. - * - * @param value The value to convert. - * @return Returns the converted plain object. - */ - (value: any) => any; - -declare const toPlainObject: ToPlainObject; +import { toPlainObject } from "../fp"; export = toPlainObject; diff --git a/types/lodash/fp/toSafeInteger.d.ts b/types/lodash/fp/toSafeInteger.d.ts index 9ddc6a79a1..2f85078fcb 100644 --- a/types/lodash/fp/toSafeInteger.d.ts +++ b/types/lodash/fp/toSafeInteger.d.ts @@ -1,30 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type ToSafeInteger = - /** - * Converts `value` to a safe integer. A safe integer can be compared and - * represented correctly. - * - * @category Lang - * @param value The value to convert. - * @returns Returns the converted integer. - * @example - * - * _.toSafeInteger(3); - * // => 3 - * - * _.toSafeInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toSafeInteger(Infinity); - * // => 9007199254740991 - * - * _.toSafeInteger('3'); - * // => 3 - */ - (value: any) => number; - -declare const toSafeInteger: ToSafeInteger; +import { toSafeInteger } from "../fp"; export = toSafeInteger; diff --git a/types/lodash/fp/toString.d.ts b/types/lodash/fp/toString.d.ts index 0dcf51fecf..ee6703c068 100644 --- a/types/lodash/fp/toString.d.ts +++ b/types/lodash/fp/toString.d.ts @@ -1,27 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type ToString = - /** - * Converts `value` to a string if it's not one. An empty string is returned - * for `null` and `undefined` values. The sign of `-0` is preserved. - * - * @category Lang - * @param value The value to process. - * @returns Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ - (value: any) => string; - -declare const toString: ToString; +import { toString } from "../fp"; export = toString; diff --git a/types/lodash/fp/toUpper.d.ts b/types/lodash/fp/toUpper.d.ts index af46b1dba8..6bf21c1fce 100644 --- a/types/lodash/fp/toUpper.d.ts +++ b/types/lodash/fp/toUpper.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type ToUpper = - /** - * Converts `string`, as a whole, to upper case. - * - * @param string The string to convert. - * @return Returns the upper cased string. - */ - (string: string) => string; - -declare const toUpper: ToUpper; +import { toUpper } from "../fp"; export = toUpper; diff --git a/types/lodash/fp/transform.d.ts b/types/lodash/fp/transform.d.ts index 420258c514..ab0653cb7c 100644 --- a/types/lodash/fp/transform.d.ts +++ b/types/lodash/fp/transform.d.ts @@ -1,240 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Transform { - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (): Transform; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (iteratee: _.MemoVoidIteratorCapped): Transform1x1; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (iteratee: _.MemoVoidIteratorCapped, accumulator: ReadonlyArray): Transform1x2; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (iteratee: _.MemoVoidIteratorCapped, accumulator: ReadonlyArray, object: ReadonlyArray | _.Dictionary): TResult[]; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (iteratee: _.MemoVoidIteratorCapped>): Transform2x1; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (iteratee: _.MemoVoidIteratorCapped>, accumulator: _.Dictionary): Transform2x2; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (iteratee: _.MemoVoidIteratorCapped>, accumulator: _.Dictionary, object: ReadonlyArray | _.Dictionary): _.Dictionary; -} -interface Transform1x1 { - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (): Transform1x1; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (accumulator: ReadonlyArray): Transform1x2; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (accumulator: ReadonlyArray, object: ReadonlyArray | _.Dictionary): TResult[]; -} -interface Transform1x2 { - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (): Transform1x2; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (object: ReadonlyArray | _.Dictionary): TResult[]; -} -interface Transform2x1 { - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (): Transform2x1; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (accumulator: _.Dictionary): Transform2x2; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (accumulator: _.Dictionary, object: ReadonlyArray | _.Dictionary): _.Dictionary; -} -interface Transform2x2 { - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (): Transform2x2; - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - (object: ReadonlyArray | _.Dictionary): _.Dictionary; -} - -declare const transform: Transform; +import { transform } from "../fp"; export = transform; diff --git a/types/lodash/fp/trim.d.ts b/types/lodash/fp/trim.d.ts index 7b1c8696b4..f0f9b905d0 100644 --- a/types/lodash/fp/trim.d.ts +++ b/types/lodash/fp/trim.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Trim = - /** - * Removes leading and trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (string: string) => string; - -declare const trim: Trim; +import { trim } from "../fp"; export = trim; diff --git a/types/lodash/fp/trimChars.d.ts b/types/lodash/fp/trimChars.d.ts index 8c0a97e9f5..929a49300e 100644 --- a/types/lodash/fp/trimChars.d.ts +++ b/types/lodash/fp/trimChars.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Trim { - /** - * Removes leading and trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (): Trim; - /** - * Removes leading and trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (chars: string): Trim1x1; - /** - * Removes leading and trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (chars: string, string: string): string; -} -interface Trim1x1 { - /** - * Removes leading and trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (): Trim1x1; - /** - * Removes leading and trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (string: string): string; -} - -declare const trimChars: Trim; +import { trimChars } from "../fp"; export = trimChars; diff --git a/types/lodash/fp/trimCharsEnd.d.ts b/types/lodash/fp/trimCharsEnd.d.ts index f8b74c9c5a..2f5609ae2d 100644 --- a/types/lodash/fp/trimCharsEnd.d.ts +++ b/types/lodash/fp/trimCharsEnd.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface TrimEnd { - /** - * Removes trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (): TrimEnd; - /** - * Removes trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (chars: string): TrimEnd1x1; - /** - * Removes trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (chars: string, string: string): string; -} -interface TrimEnd1x1 { - /** - * Removes trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (): TrimEnd1x1; - /** - * Removes trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (string: string): string; -} - -declare const trimCharsEnd: TrimEnd; +import { trimCharsEnd } from "../fp"; export = trimCharsEnd; diff --git a/types/lodash/fp/trimCharsStart.d.ts b/types/lodash/fp/trimCharsStart.d.ts index 5b4da3996d..fb998f7e50 100644 --- a/types/lodash/fp/trimCharsStart.d.ts +++ b/types/lodash/fp/trimCharsStart.d.ts @@ -1,51 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface TrimStart { - /** - * Removes leading whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (): TrimStart; - /** - * Removes leading whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (chars: string): TrimStart1x1; - /** - * Removes leading whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (chars: string, string: string): string; -} -interface TrimStart1x1 { - /** - * Removes leading whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (): TrimStart1x1; - /** - * Removes leading whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (string: string): string; -} - -declare const trimCharsStart: TrimStart; +import { trimCharsStart } from "../fp"; export = trimCharsStart; diff --git a/types/lodash/fp/trimEnd.d.ts b/types/lodash/fp/trimEnd.d.ts index 02754779a2..b666494483 100644 --- a/types/lodash/fp/trimEnd.d.ts +++ b/types/lodash/fp/trimEnd.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type TrimEnd = - /** - * Removes trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (string: string) => string; - -declare const trimEnd: TrimEnd; +import { trimEnd } from "../fp"; export = trimEnd; diff --git a/types/lodash/fp/trimStart.d.ts b/types/lodash/fp/trimStart.d.ts index 567dc22e5e..988227ca74 100644 --- a/types/lodash/fp/trimStart.d.ts +++ b/types/lodash/fp/trimStart.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type TrimStart = - /** - * Removes leading whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - (string: string) => string; - -declare const trimStart: TrimStart; +import { trimStart } from "../fp"; export = trimStart; diff --git a/types/lodash/fp/truncate.d.ts b/types/lodash/fp/truncate.d.ts index 6645f41697..d38b7b18b6 100644 --- a/types/lodash/fp/truncate.d.ts +++ b/types/lodash/fp/truncate.d.ts @@ -1,58 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Truncate { - /** - * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated - * string are replaced with the omission string which defaults to "…". - * - * @param string The string to truncate. - * @param options The options object or maximum string length. - * @return Returns the truncated string. - */ - (): Truncate; - /** - * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated - * string are replaced with the omission string which defaults to "…". - * - * @param string The string to truncate. - * @param options The options object or maximum string length. - * @return Returns the truncated string. - */ - (options: _.TruncateOptions): Truncate1x1; - /** - * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated - * string are replaced with the omission string which defaults to "…". - * - * @param string The string to truncate. - * @param options The options object or maximum string length. - * @return Returns the truncated string. - */ - (options: _.TruncateOptions, string: string): string; -} -interface Truncate1x1 { - /** - * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated - * string are replaced with the omission string which defaults to "…". - * - * @param string The string to truncate. - * @param options The options object or maximum string length. - * @return Returns the truncated string. - */ - (): Truncate1x1; - /** - * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated - * string are replaced with the omission string which defaults to "…". - * - * @param string The string to truncate. - * @param options The options object or maximum string length. - * @return Returns the truncated string. - */ - (string: string): string; -} - -declare const truncate: Truncate; +import { truncate } from "../fp"; export = truncate; diff --git a/types/lodash/fp/unapply.d.ts b/types/lodash/fp/unapply.d.ts index 8bde142263..c59b6b2a19 100644 --- a/types/lodash/fp/unapply.d.ts +++ b/types/lodash/fp/unapply.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Rest = - /** - * Creates a function that invokes func with the this binding of the created function and arguments from start - * and beyond provided as an array. - * - * Note: This method is based on the rest parameter. - * - * @param func The function to apply a rest parameter to. - * @param start The start position of the rest parameter. - * @return Returns the new function. - */ - (func: (...args: any[]) => any) => (...args: any[]) => any; - -declare const unapply: Rest; +import { unapply } from "../fp"; export = unapply; diff --git a/types/lodash/fp/unary.d.ts b/types/lodash/fp/unary.d.ts index 19e2946e96..02e319576a 100644 --- a/types/lodash/fp/unary.d.ts +++ b/types/lodash/fp/unary.d.ts @@ -1,21 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Unary = - /** - * Creates a function that accepts up to one argument, ignoring any - * additional arguments. - * - * @category Function - * @param func The function to cap arguments for. - * @returns Returns the new function. - * @example - * - * _.map(['6', '8', '10'], _.unary(parseInt)); - * // => [6, 8, 10] - */ - (func: (arg1: T, ...args: any[]) => TResult) => (arg1: T) => TResult; - -declare const unary: Unary; +import { unary } from "../fp"; export = unary; diff --git a/types/lodash/fp/unescape.d.ts b/types/lodash/fp/unescape.d.ts index 20b602a298..efcccf2a51 100644 --- a/types/lodash/fp/unescape.d.ts +++ b/types/lodash/fp/unescape.d.ts @@ -1,19 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Unescape = - /** - * The inverse of _.escape; this method converts the HTML entities &, <, >, ", ', and ` - * in string to their corresponding characters. - * - * Note: No other HTML entities are unescaped. To unescape additional HTML entities use a third-party library - * like he. - * - * @param string The string to unescape. - * @return Returns the unescaped string. - */ - (string: string) => string; - -declare const unescape: Unescape; +import { unescape } from "../fp"; export = unescape; diff --git a/types/lodash/fp/union.d.ts b/types/lodash/fp/union.d.ts index 99c9e3d4ff..8e098ee7f6 100644 --- a/types/lodash/fp/union.d.ts +++ b/types/lodash/fp/union.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Union { - /** - * Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of combined values. - */ - (): Union; - /** - * Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of combined values. - */ - (arrays2: _.List | null | undefined): Union1x1; - /** - * Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of combined values. - */ - (arrays2: _.List | null | undefined, arrays: _.List | null | undefined): T[]; -} -interface Union1x1 { - /** - * Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of combined values. - */ - (): Union1x1; - /** - * Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of combined values. - */ - (arrays: _.List | null | undefined): T[]; -} - -declare const union: Union; +import { union } from "../fp"; export = union; diff --git a/types/lodash/fp/unionBy.d.ts b/types/lodash/fp/unionBy.d.ts index 42db2e6352..f3882c6b4a 100644 --- a/types/lodash/fp/unionBy.d.ts +++ b/types/lodash/fp/unionBy.d.ts @@ -1,105 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface UnionBy { - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - (): UnionBy; - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - (iteratee: _.ValueIteratee): UnionBy1x1; - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - (iteratee: _.ValueIteratee, arrays1: _.List | null | undefined): UnionBy1x2; - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - (iteratee: _.ValueIteratee, arrays1: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface UnionBy1x1 { - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - (): UnionBy1x1; - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - (arrays1: _.List | null | undefined): UnionBy1x2; - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - (arrays1: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface UnionBy1x2 { - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - (): UnionBy1x2; - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - (arrays2: _.List | null | undefined): T[]; -} - -declare const unionBy: UnionBy; +import { unionBy } from "../fp"; export = unionBy; diff --git a/types/lodash/fp/unionWith.d.ts b/types/lodash/fp/unionWith.d.ts index 89a5066ec0..46e19fd176 100644 --- a/types/lodash/fp/unionWith.d.ts +++ b/types/lodash/fp/unionWith.d.ts @@ -1,177 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface UnionWith { - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (): UnionWith; - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (comparator: _.Comparator): UnionWith1x1; - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (comparator: _.Comparator, arrays: _.List | null | undefined): UnionWith1x2; - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (comparator: _.Comparator, arrays: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface UnionWith1x1 { - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (): UnionWith1x1; - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (arrays: _.List | null | undefined): UnionWith1x2; - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (arrays: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface UnionWith1x2 { - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (): UnionWith1x2; - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (arrays2: _.List | null | undefined): T[]; -} - -declare const unionWith: UnionWith; +import { unionWith } from "../fp"; export = unionWith; diff --git a/types/lodash/fp/uniq.d.ts b/types/lodash/fp/uniq.d.ts index a627214680..877d0d94d9 100644 --- a/types/lodash/fp/uniq.d.ts +++ b/types/lodash/fp/uniq.d.ts @@ -1,25 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Uniq = - /** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurrence of each element - * is kept. - * - * @category Array - * @param array The array to inspect. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniq([2, 1, 2]); - * // => [2, 1] - */ - (array: _.List | null | undefined) => T[]; - -declare const uniq: Uniq; +import { uniq } from "../fp"; export = uniq; diff --git a/types/lodash/fp/uniqBy.d.ts b/types/lodash/fp/uniqBy.d.ts index d89b8908c5..0e6522d704 100644 --- a/types/lodash/fp/uniqBy.d.ts +++ b/types/lodash/fp/uniqBy.d.ts @@ -1,186 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface UniqBy { - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The array to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - (): UniqBy; - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The array to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - (iteratee: (value: string) => _.NotVoid): UniqBy1x1; - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The array to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - (iteratee: (value: string) => _.NotVoid, array: string | null | undefined): string[]; - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The array to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - (iteratee: _.ValueIteratee): UniqBy2x1; - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The array to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - (iteratee: _.ValueIteratee, array: _.List | null | undefined): T[]; -} -interface UniqBy1x1 { - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The array to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - (): UniqBy1x1; - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The array to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - (array: string | null | undefined): string[]; -} -interface UniqBy2x1 { - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The array to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - (): UniqBy2x1; - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The array to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - (array: _.List | null | undefined): T[]; -} - -declare const uniqBy: UniqBy; +import { uniqBy } from "../fp"; export = uniqBy; diff --git a/types/lodash/fp/uniqWith.d.ts b/types/lodash/fp/uniqWith.d.ts index f0e6de90ff..165f45f1e3 100644 --- a/types/lodash/fp/uniqWith.d.ts +++ b/types/lodash/fp/uniqWith.d.ts @@ -1,98 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface UniqWith { - /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param array The array to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] - */ - (): UniqWith; - /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param array The array to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] - */ - (comparator: _.Comparator): UniqWith1x1; - /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param array The array to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] - */ - (comparator: _.Comparator, array: _.List | null | undefined): T[]; -} -interface UniqWith1x1 { - /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param array The array to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] - */ - (): UniqWith1x1; - /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param array The array to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] - */ - (array: _.List | null | undefined): T[]; -} - -declare const uniqWith: UniqWith; +import { uniqWith } from "../fp"; export = uniqWith; diff --git a/types/lodash/fp/uniqueId.d.ts b/types/lodash/fp/uniqueId.d.ts index d9ba028d53..57736d9ccd 100644 --- a/types/lodash/fp/uniqueId.d.ts +++ b/types/lodash/fp/uniqueId.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type UniqueId = - /** - * Generates a unique ID. If prefix is provided the ID is appended to it. - * - * @param prefix The value to prefix the ID with. - * @return Returns the unique ID. - */ - (prefix: string) => string; - -declare const uniqueId: UniqueId; +import { uniqueId } from "../fp"; export = uniqueId; diff --git a/types/lodash/fp/unnest.d.ts b/types/lodash/fp/unnest.d.ts index fc05e923c5..852e9a1367 100644 --- a/types/lodash/fp/unnest.d.ts +++ b/types/lodash/fp/unnest.d.ts @@ -1,17 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Flatten = - /** - * Flattens `array` a single level deep. - * - * @param array The array to flatten. - * @return Returns the new flattened array. - */ - (array: _.List<_.Many> | null | undefined) => T[]; - -declare const unnest: Flatten; +import { unnest } from "../fp"; export = unnest; diff --git a/types/lodash/fp/unset.d.ts b/types/lodash/fp/unset.d.ts index 12199c061a..3e99247714 100644 --- a/types/lodash/fp/unset.d.ts +++ b/types/lodash/fp/unset.d.ts @@ -1,63 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Unset { - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (): Unset; - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (path: _.PropertyPath): Unset1x1; - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (path: _.PropertyPath, object: any): boolean; -} -interface Unset1x1 { - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (): Unset1x1; - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - (object: any): boolean; -} - -declare const unset: Unset; +import { unset } from "../fp"; export = unset; diff --git a/types/lodash/fp/unzip.d.ts b/types/lodash/fp/unzip.d.ts index e6ce334d48..ba9d4cd709 100644 --- a/types/lodash/fp/unzip.d.ts +++ b/types/lodash/fp/unzip.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Unzip = - /** - * This method is like _.zip except that it accepts an array of grouped elements and creates an array - * regrouping the elements to their pre-zip configuration. - * - * @param array The array of grouped elements to process. - * @return Returns the new array of regrouped elements. - */ - (array: T[][] | _.List<_.List> | null | undefined) => T[][]; - -declare const unzip: Unzip; +import { unzip } from "../fp"; export = unzip; diff --git a/types/lodash/fp/unzipWith.d.ts b/types/lodash/fp/unzipWith.d.ts index 36fd2e6bf0..599eadb355 100644 --- a/types/lodash/fp/unzipWith.d.ts +++ b/types/lodash/fp/unzipWith.d.ts @@ -1,68 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface UnzipWith { - /** - * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * - * @param array The array of grouped elements to process. - * @param iteratee The function to combine regrouped values. - * @param thisArg The this binding of iteratee. - * @return Returns the new array of regrouped elements. - */ - (): UnzipWith; - /** - * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * - * @param array The array of grouped elements to process. - * @param iteratee The function to combine regrouped values. - * @param thisArg The this binding of iteratee. - * @return Returns the new array of regrouped elements. - */ - (iteratee: (...values: T[]) => TResult): UnzipWith1x1; - /** - * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * - * @param array The array of grouped elements to process. - * @param iteratee The function to combine regrouped values. - * @param thisArg The this binding of iteratee. - * @return Returns the new array of regrouped elements. - */ - (iteratee: (...values: T[]) => TResult, array: _.List<_.List> | null | undefined): TResult[]; -} -interface UnzipWith1x1 { - /** - * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * - * @param array The array of grouped elements to process. - * @param iteratee The function to combine regrouped values. - * @param thisArg The this binding of iteratee. - * @return Returns the new array of regrouped elements. - */ - (): UnzipWith1x1; - /** - * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * - * @param array The array of grouped elements to process. - * @param iteratee The function to combine regrouped values. - * @param thisArg The this binding of iteratee. - * @return Returns the new array of regrouped elements. - */ - (array: _.List<_.List> | null | undefined): TResult[]; -} - -declare const unzipWith: UnzipWith; +import { unzipWith } from "../fp"; export = unzipWith; diff --git a/types/lodash/fp/update.d.ts b/types/lodash/fp/update.d.ts index 011a8ea61e..76dfe482f8 100644 --- a/types/lodash/fp/update.d.ts +++ b/types/lodash/fp/update.d.ts @@ -1,105 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Update { - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - (): Update; - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - (path: _.PropertyPath): Update1x1; - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - (path: _.PropertyPath, updater: (value: any) => any): Update1x2; - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - (path: _.PropertyPath, updater: (value: any) => any, object: object): any; -} -interface Update1x1 { - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - (): Update1x1; - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - (updater: (value: any) => any): Update1x2; - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - (updater: (value: any) => any, object: object): any; -} -interface Update1x2 { - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - (): Update1x2; - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - (object: object): any; -} - -declare const update: Update; +import { update } from "../fp"; export = update; diff --git a/types/lodash/fp/updateWith.d.ts b/types/lodash/fp/updateWith.d.ts index e26ed161d2..6d6331d1b5 100644 --- a/types/lodash/fp/updateWith.d.ts +++ b/types/lodash/fp/updateWith.d.ts @@ -1,431 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface UpdateWith { - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (): UpdateWith; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (customizer: _.SetWithCustomizer): UpdateWith1x1; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (customizer: _.SetWithCustomizer, path: _.PropertyPath): UpdateWith1x2; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (customizer: _.SetWithCustomizer, path: _.PropertyPath, updater: (oldValue: any) => any): UpdateWith1x3; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (customizer: _.SetWithCustomizer, path: _.PropertyPath, updater: (oldValue: any) => any, object: T): T; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (customizer: _.SetWithCustomizer, path: _.PropertyPath, updater: (oldValue: any) => any, object: T): TResult; -} -interface UpdateWith1x1 { - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (): UpdateWith1x1; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (path: _.PropertyPath): UpdateWith1x2; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (path: _.PropertyPath, updater: (oldValue: any) => any): UpdateWith1x3; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (path: _.PropertyPath, updater: (oldValue: any) => any, object: T): T; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (path: _.PropertyPath, updater: (oldValue: any) => any, object: T): TResult; -} -interface UpdateWith1x2 { - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (): UpdateWith1x2; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (updater: (oldValue: any) => any): UpdateWith1x3; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (updater: (oldValue: any) => any, object: T): T; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (updater: (oldValue: any) => any, object: T): TResult; -} -interface UpdateWith1x3 { - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (): UpdateWith1x3; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (object: T): T; - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - (object: T): TResult; -} - -declare const updateWith: UpdateWith; +import { updateWith } from "../fp"; export = updateWith; diff --git a/types/lodash/fp/upperCase.d.ts b/types/lodash/fp/upperCase.d.ts index 5e6cab91bf..10aadb28ec 100644 --- a/types/lodash/fp/upperCase.d.ts +++ b/types/lodash/fp/upperCase.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type UpperCase = - /** - * Converts `string`, as space separated words, to upper case. - * - * @param string The string to convert. - * @return Returns the upper cased string. - */ - (string: string) => string; - -declare const upperCase: UpperCase; +import { upperCase } from "../fp"; export = upperCase; diff --git a/types/lodash/fp/upperFirst.d.ts b/types/lodash/fp/upperFirst.d.ts index 54a442030e..e2c9adfd57 100644 --- a/types/lodash/fp/upperFirst.d.ts +++ b/types/lodash/fp/upperFirst.d.ts @@ -1,15 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type UpperFirst = - /** - * Converts the first character of `string` to upper case. - * - * @param string The string to convert. - * @return Returns the converted string. - */ - (string: string) => string; - -declare const upperFirst: UpperFirst; +import { upperFirst } from "../fp"; export = upperFirst; diff --git a/types/lodash/fp/useWith.d.ts b/types/lodash/fp/useWith.d.ts index 1196dfbade..991905a402 100644 --- a/types/lodash/fp/useWith.d.ts +++ b/types/lodash/fp/useWith.d.ts @@ -1,58 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface OverArgs { - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - (): OverArgs; - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - (func: (...args: any[]) => any): OverArgs1x1; - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - (func: (...args: any[]) => any, transforms: _.Many<(...args: any[]) => any>): (...args: any[]) => any; -} -interface OverArgs1x1 { - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - (): OverArgs1x1; - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - (transforms: _.Many<(...args: any[]) => any>): (...args: any[]) => any; -} - -declare const useWith: OverArgs; +import { useWith } from "../fp"; export = useWith; diff --git a/types/lodash/fp/values.d.ts b/types/lodash/fp/values.d.ts index ec0ef37c08..75ec6fb4e5 100644 --- a/types/lodash/fp/values.d.ts +++ b/types/lodash/fp/values.d.ts @@ -1,32 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Values { - /** - * Creates an array of the own enumerable property values of object. - * - * @param object The object to query. - * @return Returns an array of property values. - */ - (object: _.Dictionary | _.NumericDictionary | _.List | null | undefined): T[]; - /** - * Creates an array of the own enumerable property values of object. - * - * @param object The object to query. - * @return Returns an array of property values. - */ - (object: T | null | undefined): Array; - /** - * Creates an array of the own enumerable property values of object. - * - * @param object The object to query. - * @return Returns an array of property values. - */ - (object: any): any[]; -} - -declare const values: Values; +import { values } from "../fp"; export = values; diff --git a/types/lodash/fp/valuesIn.d.ts b/types/lodash/fp/valuesIn.d.ts index 35e9073535..6f4f3b43bb 100644 --- a/types/lodash/fp/valuesIn.d.ts +++ b/types/lodash/fp/valuesIn.d.ts @@ -1,25 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ValuesIn { - /** - * Creates an array of the own and inherited enumerable property values of object. - * - * @param object The object to query. - * @return Returns the array of property values. - */ - (object: _.Dictionary|_.NumericDictionary|_.List | null | undefined): T[]; - /** - * Creates an array of the own and inherited enumerable property values of object. - * - * @param object The object to query. - * @return Returns the array of property values. - */ - (object: T | null | undefined): Array; -} - -declare const valuesIn: ValuesIn; +import { valuesIn } from "../fp"; export = valuesIn; diff --git a/types/lodash/fp/where.d.ts b/types/lodash/fp/where.d.ts index 4270edf2e4..41e21ec8ac 100644 --- a/types/lodash/fp/where.d.ts +++ b/types/lodash/fp/where.d.ts @@ -1,48 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ConformsTo { - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (): ConformsTo; - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (source: _.ConformsPredicateObject): ConformsTo1x1; - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (source: _.ConformsPredicateObject, object: T): boolean; -} -interface ConformsTo1x1 { - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (): ConformsTo1x1; - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - (object: T): boolean; -} - -declare const where: ConformsTo; +import { where } from "../fp"; export = where; diff --git a/types/lodash/fp/whereEq.d.ts b/types/lodash/fp/whereEq.d.ts index 1a660655f8..893316d625 100644 --- a/types/lodash/fp/whereEq.d.ts +++ b/types/lodash/fp/whereEq.d.ts @@ -1,116 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface IsMatch { - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (): IsMatch; - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (source: object): IsMatch1x1; - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (source: object, object: object): boolean; -} -interface IsMatch1x1 { - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (): IsMatch1x1; - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - (object: object): boolean; -} - -declare const whereEq: IsMatch; +import { whereEq } from "../fp"; export = whereEq; diff --git a/types/lodash/fp/without.d.ts b/types/lodash/fp/without.d.ts index 9c30e47289..600890a400 100644 --- a/types/lodash/fp/without.d.ts +++ b/types/lodash/fp/without.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Without { - /** - * Creates an array excluding all provided values using SameValueZero for equality comparisons. - * - * @param array The array to filter. - * @param values The values to exclude. - * @return Returns the new array of filtered values. - */ - (): Without; - /** - * Creates an array excluding all provided values using SameValueZero for equality comparisons. - * - * @param array The array to filter. - * @param values The values to exclude. - * @return Returns the new array of filtered values. - */ - (values: ReadonlyArray): Without1x1; - /** - * Creates an array excluding all provided values using SameValueZero for equality comparisons. - * - * @param array The array to filter. - * @param values The values to exclude. - * @return Returns the new array of filtered values. - */ - (values: ReadonlyArray, array: _.List | null | undefined): T[]; -} -interface Without1x1 { - /** - * Creates an array excluding all provided values using SameValueZero for equality comparisons. - * - * @param array The array to filter. - * @param values The values to exclude. - * @return Returns the new array of filtered values. - */ - (): Without1x1; - /** - * Creates an array excluding all provided values using SameValueZero for equality comparisons. - * - * @param array The array to filter. - * @param values The values to exclude. - * @return Returns the new array of filtered values. - */ - (array: _.List | null | undefined): T[]; -} - -declare const without: Without; +import { without } from "../fp"; export = without; diff --git a/types/lodash/fp/words.d.ts b/types/lodash/fp/words.d.ts index c827eafb15..2b06b26368 100644 --- a/types/lodash/fp/words.d.ts +++ b/types/lodash/fp/words.d.ts @@ -1,16 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -type Words = - /** - * Splits `string` into an array of its words. - * - * @param string The string to inspect. - * @param pattern The pattern to match words. - * @return Returns the words of `string`. - */ - (string: string) => string[]; - -declare const words: Words; +import { words } from "../fp"; export = words; diff --git a/types/lodash/fp/wrap.d.ts b/types/lodash/fp/wrap.d.ts index a906abe0f2..d9c2a283e2 100644 --- a/types/lodash/fp/wrap.d.ts +++ b/types/lodash/fp/wrap.d.ts @@ -1,103 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -interface Wrap { - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - (): Wrap; - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - (wrapper: (value: T, ...args: TArgs[]) => TResult): Wrap1x1; - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - (wrapper: (value: T, ...args: TArgs[]) => TResult, value: T): (...args: TArgs[]) => TResult; - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - (wrapper: (value: T, ...args: any[]) => TResult): Wrap2x1; - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - (wrapper: (value: T, ...args: any[]) => TResult, value: T): (...args: any[]) => TResult; -} -interface Wrap1x1 { - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - (): Wrap1x1; - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - (value: T): (...args: TArgs[]) => TResult; -} -interface Wrap2x1 { - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - (): Wrap2x1; - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - (value: T): (...args: any[]) => TResult; -} - -declare const wrap: Wrap; +import { wrap } from "../fp"; export = wrap; diff --git a/types/lodash/fp/xor.d.ts b/types/lodash/fp/xor.d.ts index d3e250cb5a..ac69bde236 100644 --- a/types/lodash/fp/xor.d.ts +++ b/types/lodash/fp/xor.d.ts @@ -1,48 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Xor { - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - (): Xor; - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - (arrays2: _.List | null | undefined): Xor1x1; - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - (arrays2: _.List | null | undefined, arrays: _.List | null | undefined): T[]; -} -interface Xor1x1 { - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - (): Xor1x1; - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - (arrays: _.List | null | undefined): T[]; -} - -declare const xor: Xor; +import { xor } from "../fp"; export = xor; diff --git a/types/lodash/fp/xorBy.d.ts b/types/lodash/fp/xorBy.d.ts index 8d5b2fd05a..1232972323 100644 --- a/types/lodash/fp/xorBy.d.ts +++ b/types/lodash/fp/xorBy.d.ts @@ -1,186 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface XorBy { - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (): XorBy; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee): XorBy1x1; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee, arrays: _.List | null | undefined): XorBy1x2; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (iteratee: _.ValueIteratee, arrays: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface XorBy1x1 { - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (): XorBy1x1; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (arrays: _.List | null | undefined): XorBy1x2; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (arrays: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface XorBy1x2 { - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (): XorBy1x2; - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - (arrays2: _.List | null | undefined): T[]; -} - -declare const xorBy: XorBy; +import { xorBy } from "../fp"; export = xorBy; diff --git a/types/lodash/fp/xorWith.d.ts b/types/lodash/fp/xorWith.d.ts index 6bdcabdbd2..ec93e40b30 100644 --- a/types/lodash/fp/xorWith.d.ts +++ b/types/lodash/fp/xorWith.d.ts @@ -1,177 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface XorWith { - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (): XorWith; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (comparator: _.Comparator): XorWith1x1; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (comparator: _.Comparator, arrays: _.List | null | undefined): XorWith1x2; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (comparator: _.Comparator, arrays: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface XorWith1x1 { - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (): XorWith1x1; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (arrays: _.List | null | undefined): XorWith1x2; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (arrays: _.List | null | undefined, arrays2: _.List | null | undefined): T[]; -} -interface XorWith1x2 { - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (): XorWith1x2; - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - (arrays2: _.List | null | undefined): T[]; -} - -declare const xorWith: XorWith; +import { xorWith } from "../fp"; export = xorWith; diff --git a/types/lodash/fp/zip.d.ts b/types/lodash/fp/zip.d.ts index dd4e6a1e3c..2a83e733b6 100644 --- a/types/lodash/fp/zip.d.ts +++ b/types/lodash/fp/zip.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface Zip { - /** - * Creates an array of grouped elements, the first of which contains the first elements of the given arrays, - * the second of which contains the second elements of the given arrays, and so on. - * - * @param arrays The arrays to process. - * @return Returns the new array of grouped elements. - */ - (): Zip; - /** - * Creates an array of grouped elements, the first of which contains the first elements of the given arrays, - * the second of which contains the second elements of the given arrays, and so on. - * - * @param arrays The arrays to process. - * @return Returns the new array of grouped elements. - */ - (arrays1: _.List): Zip1x1; - /** - * Creates an array of grouped elements, the first of which contains the first elements of the given arrays, - * the second of which contains the second elements of the given arrays, and so on. - * - * @param arrays The arrays to process. - * @return Returns the new array of grouped elements. - */ - (arrays1: _.List, arrays2: _.List): Array<[T1 | undefined, T2 | undefined]>; -} -interface Zip1x1 { - /** - * Creates an array of grouped elements, the first of which contains the first elements of the given arrays, - * the second of which contains the second elements of the given arrays, and so on. - * - * @param arrays The arrays to process. - * @return Returns the new array of grouped elements. - */ - (): Zip1x1; - /** - * Creates an array of grouped elements, the first of which contains the first elements of the given arrays, - * the second of which contains the second elements of the given arrays, and so on. - * - * @param arrays The arrays to process. - * @return Returns the new array of grouped elements. - */ - (arrays2: _.List): Array<[T1 | undefined, T2 | undefined]>; -} - -declare const zip: Zip; +import { zip } from "../fp"; export = zip; diff --git a/types/lodash/fp/zipAll.d.ts b/types/lodash/fp/zipAll.d.ts index 62cf6eb647..af0b3ed3f5 100644 --- a/types/lodash/fp/zipAll.d.ts +++ b/types/lodash/fp/zipAll.d.ts @@ -1,18 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -type Zip = - /** - * Creates an array of grouped elements, the first of which contains the first elements of the given arrays, - * the second of which contains the second elements of the given arrays, and so on. - * - * @param arrays The arrays to process. - * @return Returns the new array of grouped elements. - */ - (arrays: ReadonlyArray<_.List | null | undefined>) => Array>; - -declare const zipAll: Zip; +import { zipAll } from "../fp"; export = zipAll; diff --git a/types/lodash/fp/zipObj.d.ts b/types/lodash/fp/zipObj.d.ts index 7b1c5bb91a..4f4c19a87d 100644 --- a/types/lodash/fp/zipObj.d.ts +++ b/types/lodash/fp/zipObj.d.ts @@ -1,58 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ZipObject { - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - (): ZipObject; - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - (props: _.List<_.PropertyName>): ZipObject1x1; - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - (props: _.List<_.PropertyName>, values: _.List): _.Dictionary; -} -interface ZipObject1x1 { - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - (): ZipObject1x1; - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - (values: _.List): _.Dictionary; -} - -declare const zipObj: ZipObject; +import { zipObj } from "../fp"; export = zipObj; diff --git a/types/lodash/fp/zipObject.d.ts b/types/lodash/fp/zipObject.d.ts index 61f5d04e79..f302d7b155 100644 --- a/types/lodash/fp/zipObject.d.ts +++ b/types/lodash/fp/zipObject.d.ts @@ -1,58 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ZipObject { - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - (): ZipObject; - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - (props: _.List<_.PropertyName>): ZipObject1x1; - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - (props: _.List<_.PropertyName>, values: _.List): _.Dictionary; -} -interface ZipObject1x1 { - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - (): ZipObject1x1; - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - (values: _.List): _.Dictionary; -} - -declare const zipObject: ZipObject; +import { zipObject } from "../fp"; export = zipObject; diff --git a/types/lodash/fp/zipObjectDeep.d.ts b/types/lodash/fp/zipObjectDeep.d.ts index 0fd3f218ab..601063489d 100644 --- a/types/lodash/fp/zipObjectDeep.d.ts +++ b/types/lodash/fp/zipObjectDeep.d.ts @@ -1,53 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ZipObjectDeep { - /** - * This method is like _.zipObject except that it supports property paths. - * - * @param paths The property names. - * @param values The property values. - * @return Returns the new object. - */ - (): ZipObjectDeep; - /** - * This method is like _.zipObject except that it supports property paths. - * - * @param paths The property names. - * @param values The property values. - * @return Returns the new object. - */ - (paths: _.List<_.PropertyPath>): ZipObjectDeep1x1; - /** - * This method is like _.zipObject except that it supports property paths. - * - * @param paths The property names. - * @param values The property values. - * @return Returns the new object. - */ - (paths: _.List<_.PropertyPath>, values: _.List): object; -} -interface ZipObjectDeep1x1 { - /** - * This method is like _.zipObject except that it supports property paths. - * - * @param paths The property names. - * @param values The property values. - * @return Returns the new object. - */ - (): ZipObjectDeep1x1; - /** - * This method is like _.zipObject except that it supports property paths. - * - * @param paths The property names. - * @param values The property values. - * @return Returns the new object. - */ - (values: _.List): object; -} - -declare const zipObjectDeep: ZipObjectDeep; +import { zipObjectDeep } from "../fp"; export = zipObjectDeep; diff --git a/types/lodash/fp/zipWith.d.ts b/types/lodash/fp/zipWith.d.ts index 36c02c053c..9faaf3c589 100644 --- a/types/lodash/fp/zipWith.d.ts +++ b/types/lodash/fp/zipWith.d.ts @@ -1,105 +1,2 @@ -// AUTO-GENERATED: do not modify this file directly. -// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp - -import _ = require("../index"); - -interface ZipWith { - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - (): ZipWith; - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - (iteratee: (value1: T1, value2: T2) => TResult): ZipWith1x1; - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - (iteratee: (value1: T1, value2: T2) => TResult, arrays1: _.List): ZipWith1x2; - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - (iteratee: (value1: T1, value2: T2) => TResult, arrays1: _.List, arrays2: _.List): TResult[]; -} -interface ZipWith1x1 { - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - (): ZipWith1x1; - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - (arrays1: _.List): ZipWith1x2; - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - (arrays1: _.List, arrays2: _.List): TResult[]; -} -interface ZipWith1x2 { - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - (): ZipWith1x2; - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - (arrays2: _.List): TResult[]; -} - -declare const zipWith: ZipWith; +import { zipWith } from "../fp"; export = zipWith; diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 28d2967c86..ee86770a2a 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -26,6 +26,10 @@ _.chain([1, 2, 3, 4]).splice(1); // $ExpectType LoDashExplicitWrapper _.chain([1, 2, 3, 4]).splice(1, 2, 5, 6); // $ExpectType LoDashExplicitWrapper _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper +/********* + * Array * + *********/ + // _.chunk { const list: _.List | null | undefined = anything; @@ -41,7 +45,7 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper _.curry(testCurry)("1"); // $ExpectType CurriedFunction2 _.curry(testCurry); // $ExpectType CurriedFunction3 + _.curry(testCurry)(_, 2, true)("1"); // $ExpectType [string, number, boolean] + _.curry(testCurry)(_.curry.placeholder, 2, true)("1"); // $ExpectType [string, number, boolean] + _.curry(testCurry)("1", _, true)(2); // $ExpectType [string, number, boolean] + _.curry(testCurry)(_, 2)("1", true); // $ExpectType [string, number, boolean] + _.curry(testCurry)(_.curry.placeholder, 2)("1", true); // $ExpectType [string, number, boolean] _(testCurry).curry(); // $ExpectType LoDashImplicitWrapper> _.chain(testCurry).curry(); // $ExpectType LoDashExplicitWrapper> @@ -3538,6 +3547,9 @@ fp.now(); // $ExpectType number fp.curry(testCurry)("1")(2); // $ExpectType CurriedFunction1 fp.curry(testCurry)("1"); // $ExpectType CurriedFunction2 fp.curry(testCurry); // $ExpectType CurriedFunction3 + fp.curry(testCurry)(fp.__, 2, true)("1"); // $ExpectType [string, number, boolean] + fp.curry(testCurry)(fp.curry.placeholder, 2, true)("1"); // $ExpectType [string, number, boolean] + fp.curryN(3)(testCurry)(fp.curryN.placeholder, 2, true)("1"); // $ExpectType [string, number, boolean] // _.curryRight _.curryRight(testCurry)("1", 2, true); // $ExpectType [string, number, boolean] @@ -3548,6 +3560,10 @@ fp.now(); // $ExpectType number _.curryRight(testCurry)(true)(2); // $ExpectType RightCurriedFunction1 _.curryRight(testCurry)(true); // $ExpectType RightCurriedFunction2 _.curryRight(testCurry); // $ExpectType RightCurriedFunction3 + _.curryRight(testCurry)("1", _, true)(2); // $ExpectType [string, number, boolean] + _.curryRight(testCurry)("1", _.curryRight.placeholder, true)(2); // $ExpectType [string, number, boolean] + _.curryRight(testCurry)(true)("1", _)(2); // $ExpectType [string, number, boolean] + _.curryRight(testCurry)(true)("1", _.curryRight.placeholder)(2); // $ExpectType [string, number, boolean] _(testCurry).curryRight(); // $ExpectType LoDashImplicitWrapper> _.chain(testCurry).curryRight(); // $ExpectType LoDashExplicitWrapper> @@ -3559,6 +3575,9 @@ fp.now(); // $ExpectType number fp.curryRight(testCurry)(true)(2); // $ExpectType RightCurriedFunction1 fp.curryRight(testCurry)(true); // $ExpectType RightCurriedFunction2 fp.curryRight(testCurry); // $ExpectType RightCurriedFunction3 + fp.curryRight(testCurry)("1", fp.__, true)(2); // $ExpectType [string, number, boolean] + fp.curryRight(testCurry)("1", fp.curryRight.placeholder, true)(2); // $ExpectType [string, number, boolean] + fp.curryRightN(3)(testCurry)("1", fp.curryRightN.placeholder, true)(2); // $ExpectType [string, number, boolean] } // _.debounce @@ -6960,7 +6979,7 @@ fp.now(); // $ExpectType number _.noConflict(); // $ExpectType LoDashStatic _(42).noConflict(); // $ExpectType LoDashStatic _.chain(42).noConflict(); // $ExpectType LoDashExplicitWrapper - fp.noConflict(); // $ExpectType LoDashStatic + fp.noConflict(); // $ExpectType LoDashFp } // _.noop @@ -7218,6 +7237,7 @@ _.templateSettings; // $ExpectType TemplateSettings _.partial(func2); // $ExpectType Function2 _.partial(func2, 42); // $ExpectType Function1 _.partial(func2, _, "foo"); // $ExpectType Function1 + _.partial(func2, _.partial.placeholder, "foo"); // $ExpectType Function1 _.partial(func2, 42, "foo"); // $ExpectType Function0 // with arity 3 function _.partial(func3, 42, _, true); @@ -7230,6 +7250,7 @@ _.templateSettings; // $ExpectType TemplateSettings // with arity 2 function _.partialRight(func2); // $ExpectType Function2 _.partialRight(func2, 42, _); // $ExpectType Function1 + _.partialRight(func2, 42, _.partialRight.placeholder); // $ExpectType Function1 _.partialRight(func2, "foo"); // $ExpectType Function1 _.partialRight(func2, 42, "foo"); // $ExpectType Function0 // with arity 3 function @@ -7238,6 +7259,8 @@ _.templateSettings; // $ExpectType TemplateSettings fp.partial([], func0); // $ExpectType (...args: any[]) => any fp.partial([])(func0); // $ExpectType (...args: any[]) => any fp.partial([42])(func1); // $ExpectType (...args: any[]) => any + fp.partial([fp.partial.placeholder, "foo"])(func2); fp.partialRight([])(func0); // $ExpectType (...args: any[]) => any fp.partialRight([42])(func1); // $ExpectType (...args: any[]) => any + fp.partialRight([fp.partialRight.placeholder, "foo"])(func2); } diff --git a/types/lodash/scripts/generate-fp.ts b/types/lodash/scripts/generate-fp.ts index bbe648c6cd..3b8320b59c 100644 --- a/types/lodash/scripts/generate-fp.ts +++ b/types/lodash/scripts/generate-fp.ts @@ -1,4 +1,4 @@ -// Script for converting the lodash types into unctional programming (FP) format. +// Script for converting the lodash types into functional programming (FP) format. // The convertion is done based on this guide: https://github.com/lodash/lodash/wiki/FP-Guide // Assumptions: @@ -17,12 +17,18 @@ import path from "path"; interface Definition { name: string; overloads: Overload[]; + constants: string[]; jsdoc: string; } +interface InterfaceGroup { + functionName: string; + interfaces: Interface[]; +} interface Interface { name: string; typeParams: TypeParam[]; overloads: Overload[]; + constants: string[]; } interface Overload { typeParams: TypeParam[]; @@ -46,9 +52,9 @@ async function main() { // Read each function definition and fp-ify it const subfolders = ["common"]; - const promises: Array> = []; + const promises: Array> = []; for (const subfolder of subfolders) { - promises.push(new Promise((resolve, reject) => { + promises.push(new Promise((resolve, reject) => { fs.readdir(path.join("..", subfolder), (err, files) => { if (err) { console.error(`failed to list directory contents for '${subfolder}': `, err); @@ -66,40 +72,55 @@ async function main() { })); } - let functionNames: string[]; + let interfaceGroups: InterfaceGroup[]; try { - functionNames = _.flatten(await Promise.all(promises)); + interfaceGroups = _.flatten(await Promise.all(promises)); } catch (err) { console.error("Failed to parse all functions: ", err); return; } - functionNames = _.sortedUniq(_.sortBy(functionNames, _.toLower)); + interfaceGroups = _.sortBy(interfaceGroups, g => _.toLower(g.functionName)); + for (const interfaceGroup of interfaceGroups) { + // Rename interfaces for different versions of the same function with different arity (to avoid name conflicts). + // Don't rename aliases - instead they will be removed from the output when interfaces are written. + const interfaceName = interfaceGroup.interfaces[0].name; + const conflicts = interfaceGroups.filter(g => g.interfaces[0].name === interfaceName); + if (conflicts.length > 1 && _.some(conflicts, c => !_.isEqual(c.interfaces, conflicts[0].interfaces))) { + for (const conflict of conflicts) { + const oldName = conflict.interfaces[0].name; + const newName = getInterfaceBaseName(conflict.functionName); + for (const interfaceDef of conflict.interfaces) { + interfaceDef.name = interfaceDef.name.replace(oldName, newName); + for (const overload of interfaceDef.overloads) + overload.returnType = overload.returnType.replace(oldName, newName); + } + } + } + } + const interfaces = _.uniqBy(_.flatMap(interfaceGroups, g => g.interfaces), i => i.name); + const commonTypeSearch = new RegExp(`\\b(${commonTypes.join("|")})\\b`, "g"); + const interfaceStrings = _(interfaces) + .map(i => tab(interfaceToString(i), 1)) + .join(lineBreak) + .replace(commonTypeSearch, match => `lodash.${match}`); const fpFile = [ "// AUTO-GENERATED: do not modify this file directly.", "// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do:", "// npm run fp", "", - ...functionNames.map(f => `import ${f} = require("./fp/${f}");`), + 'import lodash = require("./index");', "", "export = _;", "", "declare const _: _.LoDashFp;", "declare namespace _ {", - " interface LoDashFp {", - ...functionNames.map(f => ` ${f}: typeof ${f};`), - " }", - "}", + interfaceStrings, "", - "// Backward compatibility with --target es5", - "declare global {", - " // tslint:disable-next-line:no-empty-interface", - " interface Set { }", - " // tslint:disable-next-line:no-empty-interface", - " interface Map { }", - " // tslint:disable-next-line:no-empty-interface", - " interface WeakSet { }", - " // tslint:disable-next-line:no-empty-interface", - " interface WeakMap { }", + " interface LoDashFp {", + ...interfaceGroups.map(g => ` ${g.functionName}: ${g.interfaces[0].name};`), + " __: lodash.__;", + " placehodler: lodash.__;", + " }", "}", "", ].join(lineBreak); @@ -110,7 +131,8 @@ async function main() { // Make sure the generated files are listed in tsconfig.json, so they are included in the lint checks const tsconfig = tsconfigFile.split(lineBreak).filter(row => !row.includes("fp/") || row.includes("fp/convert.d.ts")); - const newRows = functionNames.map(f => ` "fp/${f}.d.ts",`); + const newRows = interfaceGroups.map(g => ` "fp/${g.functionName}.d.ts",`) + .concat(["__", "placeholder"].map(p => ` "fp/${p}.d.ts",`)); newRows[newRows.length - 1] = newRows[newRows.length - 1].replace(",", ""); const insertIndex = _.findLastIndex(tsconfig, row => row.trim() === "]"); // Assume "files" is the last array @@ -140,17 +162,17 @@ function readFile(filePath: string): Promise { }); } -async function processDefinitions(filePaths: string[], commonTypes: string[]): Promise { +async function processDefinitions(filePaths: string[], commonTypes: string[]): Promise { const builder: { [name: string]: (...args: number[][]) => () => Interface[] } = {}; const unconvertedBuilder: { [name: string]: (...args: number[][]) => () => Interface[] } = {}; for (const filePath of filePaths) { const definitions = await parseFile(filePath, commonTypes); for (const definition of definitions) { - if (definition.overloads.every(o => o.params.length <= 1 && o.returnType === "typeof _")) { + if (definition.overloads.every(o => o.params.length <= 1 && (o.returnType === "typeof _" || o.returnType === "LoDashStatic"))) { // Our convert technique doesn't work well on "typeof _" functions (or at least runInContext) // Plus, if there are 0-1 parameters, there's nothing to curry anyways. unconvertedBuilder[definition.name] = (...args: number[][]) => { - return () => curryOverloads(definition.overloads, definition.name, args[0] || [], -1, false); + return () => curryDefinition(definition, args[0] || [], -1, false); }; } else { builder[definition.name] = (...args: Array) => { @@ -177,7 +199,7 @@ async function processDefinitions(filePaths: string[], commonTypes: string[]): P args = _.sortBy(args as number[][], (a: number[]) => a[0]); } - return () => curryOverloads(definition.overloads, definition.name, _.flatten(args), spreadIndex, isFixed); + return () => curryDefinition(definition, _.flatten(args), spreadIndex, isFixed); }; } } @@ -188,31 +210,14 @@ async function processDefinitions(filePaths: string[], commonTypes: string[]): P _.defaults(builderFp, unconvertedBuilder); const functionNames = Object.keys(builderFp).filter(key => key !== "convert" && typeof builderFp[key] === "function"); - for (const functionName of functionNames) { + const interfaceGroups: InterfaceGroup[] = functionNames.map((functionName): InterfaceGroup => ({ + functionName, // Assuming the maximum arity is 4. Pass one more arg than the max arity so we can detect if arguments weren't fixed. - const outputFn: (...args: any[]) => Interface[] = builderFp[functionName]([0], [1], [2], [3], [4]); - const commonTypeSearch = new RegExp(`\\b(${commonTypes.join("|")})\\b`, "g"); - commonTypeSearch.lastIndex; - let importCommon = false; - let output = outputFn([0], [1], [2], [3], [4]) - .map(interfaceToString) - .join(lineBreak) - .replace(commonTypeSearch, match => { - importCommon = true; - return `_.${match}`; - }); - if (!importCommon && output.includes("typeof _")) - importCommon = true; - const interfaceNameMatch = output.match(/(?:interface|type) ([A-Za-z0-9]+)/); - const interfaceName = (interfaceNameMatch ? interfaceNameMatch[1] : undefined) || _.upperFirst(functionName); - output = [ - "// AUTO-GENERATED: do not modify this file directly.", - "// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do:", - "// npm run fp", - importCommon ? `${lineBreak}import _ = require("../index");${lineBreak}` : '', - output, - "", - `declare const ${functionName}: ${interfaceName};`, + interfaces: builderFp[functionName]([0], [1], [2], [3], [4])([0], [1], [2], [3], [4]), + })); + for (const functionName of functionNames) { + const output = [ + `import { ${functionName} } from "../fp";`, `export = ${functionName};`, "", ].join(lineBreak); @@ -222,12 +227,12 @@ async function processDefinitions(filePaths: string[], commonTypes: string[]): P console.error(`failed to write file: ${targetFile}`, err); }); } - return functionNames; + return interfaceGroups; } async function parseFile(filePath: string, commonTypes: string[]): Promise { const definitionString = await readFile(filePath); - const newCommonTypeRegExp = / (?:type|interface) ([A-Za-z0-9]+)/g; + const newCommonTypeRegExp = / (?:type|interface) ([A-Za-z0-9_]+)/g; let newCommonType = newCommonTypeRegExp.exec(definitionString); while (newCommonType) { if (!commonTypes.includes(newCommonType[1])) @@ -246,14 +251,16 @@ async function parseFile(filePath: string, commonTypes: string[]): Promise !_.isEmpty(d.constants)); return definitons; } function parseDefinitions(definitionString: string, startIndex: number, endIndex: number, filePath: string, commonTypes: string[], name?: string): Definition[] { + const parentName = name; const overloadRegExp = name ? / [<(]/g : / (\w+)[<(:]/g; overloadRegExp.lastIndex = startIndex; let overloadMatch = overloadRegExp.exec(definitionString); @@ -271,7 +278,7 @@ function parseDefinitions(definitionString: string, startIndex: number, endIndex if (!currentDefinition || name !== currentDefinition.name) { if (currentDefinition && !_.isEmpty(currentDefinition.overloads)) definitons.push(currentDefinition); - currentDefinition = { name, overloads: [], jsdoc: "" }; + currentDefinition = { name, overloads: [], constants: [], jsdoc: "" }; const jsdocStartIndex = definitionString.lastIndexOf("/**", overloadStartIndex); const jsdocEndIndex = definitionString.indexOf("*/", jsdocStartIndex); if (jsdocStartIndex !== -1 && jsdocStartIndex > startIndex && jsdocEndIndex !== -1 && jsdocEndIndex < overloadStartIndex) { @@ -382,31 +389,43 @@ function parseDefinitions(definitionString: string, startIndex: number, endIndex } const [definition] = parseDefinitions(definitionString, interfaceStartIndex, interfaceEndIndex, filePath, commonTypes, name); if (definition) { - for (const overload of definition.overloads) - overload.jsdoc = currentDefinition.jsdoc; + if (currentDefinition.jsdoc) + for (const overload of definition.overloads) + overload.jsdoc = currentDefinition.jsdoc; currentDefinition.overloads.push(...definition.overloads); + currentDefinition.constants.push(...definition.constants); } } } + if (parentName && currentDefinition) { + const constantRexExp = / (\w+): *([^()\r\n]+);[\r\n]/g; + constantRexExp.lastIndex = startIndex; + for (let constantMatch = constantRexExp.exec(definitionString); constantMatch && constantMatch.index < endIndex; constantMatch = constantRexExp.exec(definitionString)) { + currentDefinition.constants.push(`${constantMatch[1]}: ${constantMatch[2]}`); + } + } + if (currentDefinition && !_.isEmpty(currentDefinition.overloads)) definitons.push(currentDefinition); return definitons; } -function curryOverloads(overloads: Overload[], functionName: string, paramOrder: number[], spreadIndex: number, isFixed: boolean): Interface[] { - overloads = _.cloneDeep(overloads); - +function curryDefinition(definition: Definition, paramOrder: number[], spreadIndex: number, isFixed: boolean): Interface[] { + // Remove any duplicate/redundant overloads + let overloads = _.uniqWith(_.cloneDeep(definition.overloads), + (a, b) => _.isEqual(a.params, b.params) && _.isEqual(getUsedTypeParams(a.params, a.typeParams), getUsedTypeParams(b.params, b.typeParams))); + const functionName = definition.name; // Remove unused type parameters for (const overload of overloads) { for (let i = 0; i < overload.typeParams.length; ++i) { - const search = new RegExp(`\\b${overload.typeParams[i].name}\\b`); + const typeParam = overload.typeParams[i]; + const search = new RegExp(`\\b${typeParam.name}\\b`); if (overload.params.every(p => !search.test(p)) && !search.test(overload.returnType)) { + // overload.returnType = overload.returnType.replace(search, typeParam.extends || "any"); overload.typeParams.splice(i, 1); --i; } } - if (overloads.some(o => o !== overload && _.isEqual(o, overload))) - _.pull(overloads, overload); } if (!isFixed) { @@ -414,9 +433,10 @@ function curryOverloads(overloads: Overload[], functionName: string, paramOrder: for (const overload of overloads) overload.params = overload.params.map(p => p.replace(/\?:/g, ":")); // No optional parameters return [{ - name: _.upperFirst(functionName), + name: getInterfaceBaseName(functionName), typeParams: [], overloads, + constants: definition.constants, }]; } paramOrder = paramOrder.filter(p => typeof p === "number"); @@ -540,6 +560,7 @@ function curryOverloads(overloads: Overload[], functionName: string, paramOrder: } for (const interfaceDef of interfaces) interfaceDef.overloads = mergeSimilarOverloads(interfaceDef.overloads); + interfaces[0].constants = definition.constants; return interfaces; } @@ -552,6 +573,10 @@ function getParamType(param: string) { return index !== -1 ? param.substring(index + 1).trim() : "any"; } +function isPlaceholder(param: string) { + return param.endsWith("__"); +} + function preProcessOverload(overload: Overload, functionName: string, arity: number): void { overload.params = overload.params .slice(0, arity) @@ -601,41 +626,26 @@ function capCallback(parameter: string, functionName: string): string { } function curryOverload(overload: Overload, functionName: string, overloadId: number): Interface[] { - let baseName = _.upperFirst(functionName); - if (baseName === "Pick") // A type called "Pick" already exists, so rename to avoid conflicts - baseName = "Lodash" + baseName; + const baseName = getInterfaceBaseName(functionName); if (overload.params.length <= 1) { // Functions with 0 or 1 arguments are not curried. Just use a basic function type. return [{ name: baseName, overloads: [overload], typeParams: [], + constants: [], }]; } + // Create a separate interface for each possible combination of parameters that could be passed. + // i = binary representation of which parameters were passed to result in this interface (reversed), e.g. + // 1 = 0001 = 1st parameter was passed; 2nd-4th remain + // 6 = 1010 = 2nd and 4th parameters were passed; 1st and 3rd remain const interfaces: Interface[] = []; - let passTypeParams: TypeParam[] = []; - for (let i = 0; i < overload.params.length; ++i) { - const interfaceDef = { - name: getInterfaceName(baseName, overloadId, i, []), - typeParams: _.cloneDeep(passTypeParams), - overloads: curryParams( - overload.params.slice(i), - _.without(overload.typeParams, ...passTypeParams), - overload.returnType, - baseName, - passTypeParams, - overloadId, - i, - overload.jsdoc, - ), - }; + const interfaceCount = (1 << overload.params.length) - 1; + for (let i = 0; i < interfaceCount; ++i) { + const interfaceDef = curryParams(baseName, overloadId, overload, i); interfaces.push(interfaceDef); - const currentParams = overload.params.slice(0, i + 1); - const usedTypeParams = overload.typeParams.filter(tp => currentParams.some(p => new RegExp(`\\b${tp.name}\\b`).test(p))); - usedTypeParams.unshift(...overload.typeParams.filter(tp => !usedTypeParams.includes(tp) && usedTypeParams.some(tp2 => !!tp2.extends && new RegExp(`\\b${tp.name}\\b`).test(tp2.extends)))); - const unusedParams = overload.params.slice(i + 1).concat(overload.returnType); - passTypeParams = usedTypeParams.filter(tp => unusedParams.some(p => new RegExp(`\\b${tp.name}\\b`).test(p))); } // The T[keyof T] constraint doesn't work so well if it's the only constraint. Convert to a plain old T constraint so it can be merged with // other ValueIteratee overloads @@ -687,38 +697,87 @@ function curryOverload(overload: Overload, functionName: string, overloadId: num } function curryParams( - params: string[], - typeParams: TypeParam[], - returnType: string, baseName: string, - interfaceTypeParams: TypeParam[], - overloadId: number, - index: number, - jsdoc: string, -): Overload[] { - // Assume params.length >= 1 - const overloads: Overload[] = [{ + sourceOverloadId: number, + sourceOverload: Overload, + interfaceIndex: number, +): Interface { + const params = getInterfaceParams(sourceOverload, interfaceIndex); + const interfaceTypeParams = getInterfaceTypeParams(sourceOverload, interfaceIndex); + + const prevParams = _.without(sourceOverload.params, ...params); + const prevTypeParams = getUsedTypeParams(prevParams, sourceOverload.typeParams); + const typeParams = _.without(sourceOverload.typeParams, ...prevTypeParams); + // 1st overload takes no parameters and just returns the same interface (effectively a no-op) + // HACK: omit the parameterless overload because it's not very useful, and it causes the build to run out of memory + // This assumes params.length > 0, which is true because curryParams is only called when params.length >= 2. + /*const overloads: Overload[] = [{ typeParams: [], params: [], - returnType: getInterfaceName(baseName, overloadId, index, interfaceTypeParams), - jsdoc, - }]; - for (let i = 1; i <= params.length; ++i) { - const currentParams = params.slice(0, i); - const usedTypeParams = i < params.length ? typeParams.filter(tp => currentParams.some(p => new RegExp(`\\b${tp.name}\\b`).test(p))) : typeParams; - usedTypeParams.unshift(...typeParams.filter(tp => !usedTypeParams.includes(tp) && usedTypeParams.some(tp2 => !!tp2.extends && new RegExp(`\\b${tp.name}\\b`).test(tp2.extends)))); - const unusedParams = params.slice(i).concat(returnType); - const passTypeParams = usedTypeParams.concat(interfaceTypeParams).filter(tp => unusedParams.some(p => new RegExp(`\\b${tp.name}\\b`).test(p))); - const currentReturnType = i < params.length ? getInterfaceName(baseName, overloadId, index + i, passTypeParams) : returnType; + returnType: getInterfaceName(baseName, sourceOverloadId, interfaceIndex, interfaceTypeParams), + jsdoc: sourceOverload.jsdoc, + }];*/ + const overloads: Overload[] = []; + const lastOverload = (1 << params.length) - 1; + for (let i = 1; i <= lastOverload; ++i) { + // xxxx i = number of parameters used by this overload + // const totalCombinations = nCk(params.length, i); + // i = binary representation of which parameters are used for this overload (reversed), e.g. + // 1 = 0001 -> 1000 = 1st parameter + // 6 = 1010 -> 0101 = 2nd and 4th parameters + const currentParams = params.map((p, j) => (i & (1 << j)) ? p : `${getParamName(p)}: __`); + while (currentParams.length > 0 && _.last(currentParams)!.endsWith("__")) + currentParams.pop(); // There's no point in passing a placeholder as the last parameter, so don't allow it. + + const usedTypeParams = i < lastOverload ? getUsedTypeParams(currentParams, typeParams) : typeParams; + const combinedIndex = combineIndexes(interfaceIndex, i); + const passTypeParams = getInterfaceTypeParams(sourceOverload, combinedIndex); + const currentReturnType = i < lastOverload ? getInterfaceName(baseName, sourceOverloadId, combinedIndex, passTypeParams) : sourceOverload.returnType; overloads.push({ typeParams: _.cloneDeep(usedTypeParams), params: currentParams, returnType: currentReturnType, - jsdoc, + jsdoc: interfaceIndex === 0 ? sourceOverload.jsdoc : "", }); } - return overloads; + const interfaceDef: Interface = { + name: getInterfaceName(baseName, sourceOverloadId, interfaceIndex, []), + typeParams: _.cloneDeep(interfaceTypeParams), + overloads, + constants: [], + }; + // Remove the `extends` constraint from interface type parameters, because sometimes they extend things that aren't passed to the interface. + for (const typeParam of interfaceDef.typeParams) { + if (!_.startsWith(typeParam.extends, "keyof ")) // We need to keep `extends keyof` constraints, because they're needed for TObject[TKey] to work. + delete typeParam.extends; + } + return interfaceDef; +} + +function getInterfaceBaseName(functionName: string) { + return "Lodash" + _.upperFirst(functionName); +} + +function getInterfaceParams(overload: Overload, interfaceIndex: number) { + return overload.params.filter((p, j) => !(interfaceIndex & (1 << j))); +} + +function getUsedTypeParams(params: string[], typeParams: TypeParam[]) { + const usedTypeParams = typeParams.filter(tp => params.some(p => new RegExp(`\\b${tp.name}\\b`).test(p))); + usedTypeParams.unshift(...typeParams.filter(tp => + !usedTypeParams.includes(tp) && usedTypeParams.some(tp2 => !!tp2.extends && new RegExp(`\\b${tp.name}\\b`).test(tp2.extends)))); + return usedTypeParams; +} + +function getInterfaceTypeParams(overload: Overload, interfaceIndex: number) { + const currentParams = getInterfaceParams(overload, interfaceIndex); + const passedParams = _.without(overload.params, ...currentParams); + const passedTypeParams = getUsedTypeParams(passedParams, overload.typeParams); + const interfaceTypeParams = passedTypeParams.filter(tp => currentParams.concat(overload.returnType).some(p => new RegExp(`\\b${tp.name}\\b`).test(p))); + interfaceTypeParams.unshift(...overload.typeParams.filter(tp => + !interfaceTypeParams.includes(tp) && interfaceTypeParams.some(tp2 => !!tp2.extends && new RegExp(`^keyof ${tp.name}\\b`).test(tp2.extends)))); + return interfaceTypeParams; } function mergeInterfaces(interfaces: Interface[]): void { @@ -732,10 +791,12 @@ function mergeSimilarOverloads(overloads: Overload[]): Overload[] { const newOverloads = _.cloneDeep(overloads); for (const overload of newOverloads) { // We can merge if all param types are the same except one, and the return types are the same. + // Also, we can't merge a placeholder param with a non-placeholder. const others = newOverloads.filter(o2 => o2 !== overload && _.isEqual(overload.typeParams, o2.typeParams) && overload.params.length === o2.params.length && overload.params.length >= 1 + && overload.params.every((p, i) => isPlaceholder(p) === isPlaceholder(o2.params[i])) && overload.params.filter((p, i) => getParamType(p) !== getParamType(o2.params[i])).length <= 1 && overload.returnType === o2.returnType); if (_.isEmpty(others)) @@ -748,8 +809,8 @@ function mergeSimilarOverloads(overloads: Overload[]): Overload[] { .value(); if (differingParamIndexes.length > 1) continue; // Only one param is different, but it's a different param for some overloads, so we can't merge + const similarOverloads = [overload].concat(others); for (let i = 0; i < overload.params.length; ++i) { - const similarOverloads = [overload].concat(others); const paramNames = _.uniq(similarOverloads.map(o => getParamName(o.params[i]))); const newParamName = (paramNames.length > 1) ? `${paramNames[0]}Or${paramNames.slice(1).map(_.upperFirst).join("Or")}` : paramNames[0]; @@ -767,6 +828,19 @@ function mergeSimilarOverloads(overloads: Overload[]): Overload[] { return newOverloads; } +function combineIndexes(i1: number, i2: number): number { + let result = i1; + let resultMask = 1; + for (let i2mask = 1; i2mask <= i2; i2mask <<= 1) { + while (result & resultMask) + resultMask <<= 1; + if (i2 & i2mask) + result += resultMask; + resultMask <<= 1; + } + return result; +} + function getInterfaceName(baseName: string, overloadId: number, index: number, typeParams: TypeParam[]): string { let interfaceName = baseName; if (index > 0) @@ -775,25 +849,31 @@ function getInterfaceName(baseName: string, overloadId: number, index: number, t } function interfaceToString(interfaceDef: Interface): string { - if (interfaceDef.overloads.length === 0) { + if (_.isEmpty(interfaceDef.overloads)) { // No point in creating an empty interface return ""; - } else if (interfaceDef.overloads.length === 1) { + } else if (interfaceDef.overloads.length === 1 && _.isEmpty(interfaceDef.constants)) { // Don't create an interface for a single type. Instead use a basic type def. - let jsdoc = interfaceDef.overloads[0].jsdoc; - if (jsdoc) - jsdoc += lineBreak; - interfaceDef.overloads[0].jsdoc = ""; - return `type ${interfaceDef.name}${typeParamsToString(interfaceDef.typeParams)} =${lineBreak}${tab(jsdoc + overloadToString(interfaceDef.overloads[0], true), 1)}`; + const overload = interfaceDef.overloads[0]; + // HACK: omit jsdoc comments because they cause the build to run out of memory + // const jsdoc = overload.jsdoc; + const jsdoc = ""; + overload.jsdoc = ""; + let overloadString = overloadToString(overload, true); + overloadString = jsdoc ? lineBreak + tab(jsdoc + lineBreak + overloadString, 1) : " " + overloadString; + return `type ${interfaceDef.name}${typeParamsToString(interfaceDef.typeParams)} =${overloadString}`; } else { - const overloadStrings = interfaceDef.overloads.map(o => lineBreak + tab(overloadToString(o), 1)).join(""); + const overloadStrings = interfaceDef.overloads.map(o => lineBreak + tab(overloadToString(o), 1)).join("") + + interfaceDef.constants.map(c => `${lineBreak}${tab(c, 1)};`).join(""); return `interface ${interfaceDef.name}${typeParamsToString(interfaceDef.typeParams)} {${overloadStrings}${lineBreak}}`; } } function overloadToString(overload: Overload, arrowSyntax = false): string { const joinedParams = overload.params.join(", "); - let jsdoc = overload.jsdoc; + // HACK: omit jsdoc comments because they cause the build to run out of memory + // let jsdoc = overload.jsdoc; + let jsdoc = ""; if (jsdoc) jsdoc += lineBreak; if (overload.tslintDisable) @@ -825,7 +905,7 @@ function getLineNumber(fileContents: string, index: number) { function tab(s: string, count: number) { const prepend: string = " ".repeat(count * 4); - return prepend + s.replace(/(?:\r\n|\n|\r)(.)/g, `${lineBreak}${prepend}$1`); + return (s[0] === "\n" || s[0] === "\r" ? "" : prepend) + s.replace(/(?:\r\n|\n|\r)(.)/g, `${lineBreak}${prepend}$1`); } function indexOfAny(source: string, values: string[], position?: number): number { diff --git a/types/lodash/tsconfig.json b/types/lodash/tsconfig.json index 926c4217d7..60a2e8323c 100644 --- a/types/lodash/tsconfig.json +++ b/types/lodash/tsconfig.json @@ -19,7 +19,6 @@ }, "files": [ "index.d.ts", - "common/common.d.ts", "lodash-tests.ts", "add.d.ts", "after.d.ts", @@ -715,6 +714,8 @@ "fp/zipObj.d.ts", "fp/zipObject.d.ts", "fp/zipObjectDeep.d.ts", - "fp/zipWith.d.ts" + "fp/zipWith.d.ts", + "fp/__.d.ts", + "fp/placeholder.d.ts" ] } \ No newline at end of file From 7f0811ae8e865a8f2f9c1cdbbe4ba1ea9b82e250 Mon Sep 17 00:00:00 2001 From: Florent Cailhol Date: Sun, 15 Apr 2018 01:05:04 +0200 Subject: [PATCH 0664/2153] Fix tapable definition (#24996) --- types/tapable/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/tapable/index.d.ts b/types/tapable/index.d.ts index 502b408e9e..7fd0e6f08d 100644 --- a/types/tapable/index.d.ts +++ b/types/tapable/index.d.ts @@ -276,6 +276,7 @@ export class HookInterceptor { tap: (tap: Tap) => void; register: (tap: Tap) => Tap | undefined; context: boolean; + name: string; } /** A HookMap is a helper class for a Map with Hooks */ From 2053e1cb8c92f6079ed3bac7cb5d630b52db6a57 Mon Sep 17 00:00:00 2001 From: Sean Scally Date: Mon, 16 Apr 2018 05:37:41 -0700 Subject: [PATCH 0665/2153] Add new RenderProps-style Context from React 16.3 (#24509) * Add new RenderProps-style Context from React 16.3 React 16.3 has a new recommended API for Context, with new Context, Provider, and Consumer typings. * Add overload for createContext() to be called with no arguments * Fix syntax * Refactor out Props for Consumer & Provider --- types/react/index.d.ts | 23 +++++++++++++++++++++++ types/react/test/tsx.tsx | 3 +++ 2 files changed, 26 insertions(+) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 1083f4afe2..b766eee600 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -240,6 +240,29 @@ declare namespace React { props?: Partial

    & Attributes, ...children: ReactNode[]): ReactElement

    ; + // Context via RenderProps + interface ProviderProps { + value: T; + children?: ReactNode; + } + + interface ConsumerProps { + children: (value: T) => ReactNode; + unstable_observedBits?: number; + } + + type Provider = ComponentType>; + type Consumer = ComponentType>; + interface Context { + Provider: Provider; + Consumer: Consumer; + } + function createContext( + defaultValue: T, + calculateChangedBits?: (prev: T, next: T) => number + ): Context; + function createContext(): Context; + function isValidElement

    (object: {} | null | undefined): object is ReactElement

    ; const Children: ReactChildren; diff --git a/types/react/test/tsx.tsx b/types/react/test/tsx.tsx index 760a625cfd..dca7a1f814 100644 --- a/types/react/test/tsx.tsx +++ b/types/react/test/tsx.tsx @@ -75,6 +75,9 @@ const StatelessComponentWithoutProps: React.SFC = (props) => { }; ; +// React.createContext +const ContextWithRenderProps = React.createContext('defaultValue'); + // Fragments

    From 04b8281f8760bd2e416806115053dc35db972f43 Mon Sep 17 00:00:00 2001 From: leanazulyoro Date: Mon, 16 Apr 2018 10:28:18 -0300 Subject: [PATCH 0666/2153] Add definitions for restify's conditionalHandler plugin --- types/restify/index.d.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/types/restify/index.d.ts b/types/restify/index.d.ts index b5f6dd6fe5..30a5220022 100644 --- a/types/restify/index.d.ts +++ b/types/restify/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for restify 5.0 // Project: https://github.com/restify/node-restify -// Definitions by: Bret Little , Steve Hipwell +// Definitions by: Bret Little , Steve Hipwell , Leandro Almeida // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -946,6 +946,17 @@ export namespace plugins { */ function authorizationParser(options?: any): RequestHandler; + interface HandlerCandidate { + handler: RequestHandler | RequestHandler[]; + version?: string | string[]; + contentType?: string | string[]; + } + + /** + * Runs first handler that matches to the condition + */ + function conditionalHandler(candidates: HandlerCandidate | HandlerCandidate[]): RequestHandler[]; + /** * Conditional headers (If-*) */ From b130408774ba0622125682402446ede98f514a08 Mon Sep 17 00:00:00 2001 From: leanazulyoro Date: Mon, 16 Apr 2018 10:36:38 -0300 Subject: [PATCH 0667/2153] Changed: restify's version in header of definitions --- types/restify/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/restify/index.d.ts b/types/restify/index.d.ts index 30a5220022..8a07519121 100644 --- a/types/restify/index.d.ts +++ b/types/restify/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for restify 5.0 +// Type definitions for restify 7.1.1 // Project: https://github.com/restify/node-restify // Definitions by: Bret Little , Steve Hipwell , Leandro Almeida // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 74a624759ba410b6f941f01d47c9156f49199c62 Mon Sep 17 00:00:00 2001 From: leanazulyoro Date: Mon, 16 Apr 2018 16:46:00 -0300 Subject: [PATCH 0668/2153] reverted version --- types/restify/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/restify/index.d.ts b/types/restify/index.d.ts index 8a07519121..30a5220022 100644 --- a/types/restify/index.d.ts +++ b/types/restify/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for restify 7.1.1 +// Type definitions for restify 5.0 // Project: https://github.com/restify/node-restify // Definitions by: Bret Little , Steve Hipwell , Leandro Almeida // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From fe483b7d272a039fe5ebe3a0e7536a8713a1edb9 Mon Sep 17 00:00:00 2001 From: Vitya Date: Tue, 17 Apr 2018 01:12:27 +0300 Subject: [PATCH 0669/2153] [@types/grid-styled] unstrict typings for grid-styled (#25024) --- types/grid-styled/index.d.ts | 65 ++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/types/grid-styled/index.d.ts b/types/grid-styled/index.d.ts index dec3fd34f2..8cce111478 100644 --- a/types/grid-styled/index.d.ts +++ b/types/grid-styled/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for grid-styled 3.2 // Project: https://github.com/jxnblk/grid-styled // Definitions by: Anton Vasin +// Victor Orlov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -15,44 +16,44 @@ import { StyledComponentClass } from "styled-components"; export type ResponsiveProp = number | string | Array; export interface CommonProps { - width: ResponsiveProp; - fontSize: ResponsiveProp; - color: ResponsiveProp; - bg: ResponsiveProp; - m: ResponsiveProp; - mt: ResponsiveProp; - mr: ResponsiveProp; - mb: ResponsiveProp; - ml: ResponsiveProp; - mx: ResponsiveProp; - my: ResponsiveProp; - p: ResponsiveProp; - pt: ResponsiveProp; - pr: ResponsiveProp; - pb: ResponsiveProp; - pl: ResponsiveProp; - px: ResponsiveProp; - py: ResponsiveProp; - theme: any; + width?: ResponsiveProp; + fontSize?: ResponsiveProp; + color?: ResponsiveProp; + bg?: ResponsiveProp; + m?: ResponsiveProp; + mt?: ResponsiveProp; + mr?: ResponsiveProp; + mb?: ResponsiveProp; + ml?: ResponsiveProp; + mx?: ResponsiveProp; + my?: ResponsiveProp; + p?: ResponsiveProp; + pt?: ResponsiveProp; + pr?: ResponsiveProp; + pb?: ResponsiveProp; + pl?: ResponsiveProp; + px?: ResponsiveProp; + py?: ResponsiveProp; + theme?: any; } export interface BoxProps extends Omit, "width" | "wrap" | "is"> { - flex: ResponsiveProp; - order: ResponsiveProp; - is: string | ComponentClass; + flex?: ResponsiveProp; + order?: ResponsiveProp; + is?: string | ComponentClass; } export interface FlexProps extends BoxProps { - alignItems: ResponsiveProp; - justifyContent: ResponsiveProp; - flexDirection: ResponsiveProp; - flexWrap: ResponsiveProp; + alignItems?: ResponsiveProp; + justifyContent?: ResponsiveProp; + flexDirection?: ResponsiveProp; + flexWrap?: ResponsiveProp; // legacy aliases https://github.com/jxnblk/styled-system/releases/tag/v2.0.0 - justify: ResponsiveProp; - align: ResponsiveProp; - wrap: ResponsiveProp | boolean; + justify?: ResponsiveProp; + align?: ResponsiveProp; + wrap?: ResponsiveProp | boolean; } export type BoxComponent = StyledComponentClass< @@ -67,14 +68,14 @@ export type FlexComponent = StyledComponentClass< export interface Theme { breakpoints: string[]; - space: number[]; - fontSizes: number[]; + space?: number[]; + fontSizes?: number[]; } export const Box: BoxComponent; export const Flex: FlexComponent; export const theme: Theme; export type DivProps = Omit, "ref"> & { - innerRef: (el: HTMLDivElement) => any; + innerRef?: (el: HTMLDivElement) => any; }; export const div: ComponentClass; From b3cea7a6bbfad7520b5cc1da72887e0e5d45d0f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=98i=C4=8Da=C5=99?= Date: Tue, 17 Apr 2018 00:13:00 +0200 Subject: [PATCH 0670/2153] Add missing isCustomDate into Settings (#25042) --- types/daterangepicker/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/daterangepicker/index.d.ts b/types/daterangepicker/index.d.ts index 4d777b17b6..5a82950ca9 100644 --- a/types/daterangepicker/index.d.ts +++ b/types/daterangepicker/index.d.ts @@ -135,6 +135,10 @@ declare namespace daterangepicker { * A function that is passed each date in the two calendars before they are displayed, and may return true or false to indicate whether that date should be available for selection or not. */ isInvalidDate?(startDate: string | moment.Moment | Date, endDate?: string | moment.Moment | Date): boolean; + /** + * A function that is passed each date in the two calendars before they are displayed, and may return a string or array of CSS class names to apply to that date's calendar cell. + */ + isCustomDate?(date: string | moment.Moment | Date): string | string[] | undefined; /** * Indicates whether the date range picker should automatically update the value of an < input > element it's attached to at initialization and when the selected dates change. */ From 9de8070a6b684a425f238b2a00bff3485f70e1be Mon Sep 17 00:00:00 2001 From: DanRegazzi Date: Mon, 16 Apr 2018 18:13:56 -0400 Subject: [PATCH 0671/2153] Update type react-toastr: Allow JSX to be used for title and message content. (#24910) * Updated the typings to allow JSX elements in addition to strings for the toast message content. Refer to https://tomchentw.github.io/react-toastr/ * Update version number of react-toastr type definition. * Revert version number to match toastr's version number Change toast notify functions to use string or ReactNode types explicitly Revert change to options override type * ReactNode includes string. --- types/react-toastr/index.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/types/react-toastr/index.d.ts b/types/react-toastr/index.d.ts index 2ccc8452fe..8320244d7f 100644 --- a/types/react-toastr/index.d.ts +++ b/types/react-toastr/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for react-toastr 3.0 // Project: https://github.com/tomchentw/react-toastr -// Definitions by: Josh Holmer +// Definitions by: Josh Holmer , Dan Regazzi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -10,10 +10,10 @@ export class ToastContainer extends Component<{ toastMessageFactory: any; className?: string; }> { - error: (message: string, title: string, optionsOverride?: {}) => void; - info: (message: string, title: string, optionsOverride?: {}) => void; - success: (message: string, title: string, optionsOverride?: {}) => void; - warning: (message: string, title: string, optionsOverride?: {}) => void; + error: (message: React.ReactNode, title: React.ReactNode, optionsOverride?: {}) => void; + info: (message: React.ReactNode, title: React.ReactNode, optionsOverride?: {}) => void; + success: (message: React.ReactNode, title: React.ReactNode, optionsOverride?: {}) => void; + warning: (message: React.ReactNode, title: React.ReactNode, optionsOverride?: {}) => void; clear: () => void; } export const ToastMessageAnimated: keyof ReactHTML; From 4baec539b71a3fe5c099b2510fe807b7667b4b25 Mon Sep 17 00:00:00 2001 From: Henrik Raitasola Date: Tue, 17 Apr 2018 01:16:21 +0300 Subject: [PATCH 0672/2153] Add missing argument for Screen (react-native-navigation) (#25022) * Add missing prop to Screen * Use new prop in tests --- types/react-native-navigation/index.d.ts | 1 + types/react-native-navigation/react-native-navigation-tests.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/types/react-native-navigation/index.d.ts b/types/react-native-navigation/index.d.ts index 5541f207c7..86fee24d55 100644 --- a/types/react-native-navigation/index.d.ts +++ b/types/react-native-navigation/index.d.ts @@ -70,6 +70,7 @@ export interface Screen { title?: string; navigatorStyle?: NavigatorStyle; navigatorButtons?: NavigatorButtons; + overrideBackPress?: boolean; } export interface ModalScreen extends Screen { diff --git a/types/react-native-navigation/react-native-navigation-tests.tsx b/types/react-native-navigation/react-native-navigation-tests.tsx index 6feb7bc397..fb3e86cc65 100644 --- a/types/react-native-navigation/react-native-navigation-tests.tsx +++ b/types/react-native-navigation/react-native-navigation-tests.tsx @@ -10,7 +10,7 @@ class Screen1 extends React.Component Date: Tue, 17 Apr 2018 00:16:58 +0200 Subject: [PATCH 0673/2153] Activate strict null check in d3-format (#25015) --- types/d3-format/d3-format-tests.ts | 30 +++++++++++++++---- types/d3-format/index.d.ts | 46 ++++++++++++++++++------------ types/d3-format/tsconfig.json | 2 +- 3 files changed, 53 insertions(+), 25 deletions(-) diff --git a/types/d3-format/d3-format-tests.ts b/types/d3-format/d3-format-tests.ts index def8994b70..5ab53a45a7 100644 --- a/types/d3-format/d3-format-tests.ts +++ b/types/d3-format/d3-format-tests.ts @@ -12,6 +12,20 @@ import * as d3Format from 'd3-format'; // Preparatory Steps // ---------------------------------------------------------------------- +class NumCoercible { + a: number; + + constructor(a: number) { + this.a = a; + } + + valueOf() { + return this.a; + } +} + +const numeric: NumCoercible = new NumCoercible(10); + let num: number; let formatFn: (n: number) => string; @@ -30,6 +44,12 @@ formatFn = d3Format.format('.0%'); formatFn = d3Format.formatPrefix(',.0', 1e-6); +d3Format.format('.0%')(10); +d3Format.format('.0%')(numeric); + +d3Format.formatPrefix(',.0', 1e-6)(10); +d3Format.formatPrefix(',.0', 1e-6)(numeric); + // ---------------------------------------------------------------------- // Test Format Specifier // ---------------------------------------------------------------------- @@ -43,7 +63,7 @@ const symbol: '$' | '#' | '' = specifier.symbol; const zero: boolean = specifier.zero; const width: number | undefined = specifier.width; const comma: boolean = specifier.comma; -const precision: number = specifier.precision; +const precision: number | undefined = specifier.precision; const type: 'e' | 'f' | 'g' | 'r' | 's' | '%' | 'p' | 'b' | 'o' | 'd' | 'x' | 'X' | 'c' | '' | 'n' = specifier.type; const formatString: string = specifier.toString(); @@ -63,10 +83,10 @@ num = d3Format.precisionRound(0.0005, 3000); // ---------------------------------------------------------------------- localeDef = { - decimal: ',', - thousands: '.', - grouping: [3], - currency: ['EUR', ''] + decimal: ',', + thousands: '.', + grouping: [3], + currency: ['EUR', ''] }; localeDef = { diff --git a/types/d3-format/index.d.ts b/types/d3-format/index.d.ts index 6592756ef1..bb0473a4fb 100644 --- a/types/d3-format/index.d.ts +++ b/types/d3-format/index.d.ts @@ -1,6 +1,9 @@ // Type definitions for D3JS d3-format module 1.2 // Project: https://github.com/d3/d3-format/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov +// Definitions by: Tom Wanzek +// Alex Ford +// Boris Yankov +// denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Last module patch version validated against: 1.2.0 @@ -23,7 +26,7 @@ export interface FormatLocaleDefinition { */ grouping: number[]; /** - * The currency prefix and suffix (e.g., ["$", ""]) + * The currency prefix and suffix (e.g., ["$", ""]). */ currency: [string, string]; /** @@ -31,7 +34,7 @@ export interface FormatLocaleDefinition { */ numerals?: string[]; /** - * An optional symbol to replace the `percent` suffix; the percent suffix (defaults to "%") + * An optional symbol to replace the `percent` suffix; the percent suffix (defaults to "%"). */ percent?: string; } @@ -44,9 +47,10 @@ export interface FormatLocaleObject { * Returns a new format function for the given string specifier. The returned function * takes a number as the only argument, and returns a string representing the formatted number. * - * @param specifier A Specifier string + * @param specifier A Specifier string. + * @throws Error on invalid format specifier. */ - format(specifier: string): (n: number) => string; + format(specifier: string): (n: number | { valueOf(): number }) => string; /** * Returns a new format function for the given string specifier. The returned function @@ -54,10 +58,11 @@ export interface FormatLocaleObject { * The returned function will convert values to the units of the appropriate SI prefix for the * specified numeric reference value before formatting in fixed point notation. * - * @param specifier A Specifier string + * @param specifier A Specifier string. * @param value The reference value to determine the appropriate SI prefix. + * @throws Error on invalid format specifier. */ - formatPrefix(specifier: string, value: number): (n: number) => string; + formatPrefix(specifier: string, value: number): (n: number | { valueOf(): number }) => string; } /** @@ -71,7 +76,7 @@ export interface FormatSpecifier { */ fill: string; /** - * Alignment used for format, as set by choosing one of the following + * Alignment used for format, as set by choosing one of the following: * * '>' - Forces the field to be right-aligned within the available space. (Default behavior). * '<' - Forces the field to be left-aligned within the available space. @@ -83,9 +88,9 @@ export interface FormatSpecifier { * The sign can be: * * '-' - nothing for positive and a minus sign for negative. (Default behavior.) - * '+' - a plus sign for positive and a minus sign for negative. + * '+' - a plus sign for positive and a minus sign for negative. * '(' - nothing for positive and parentheses for negative. - * ' '(space) - a space for positive and a minus sign for negative. + * ' ' (space) - a space for positive and a minus sign for negative. * */ sign: '-' | '+' | '(' | ' '; @@ -94,7 +99,7 @@ export interface FormatSpecifier { * * '$' - apply currency symbols per the locale definition. * '#' - for binary, octal, or hexadecimal notation, prefix by 0b, 0o, or 0x, respectively. - * ''(none) - no symbol. + * '' (none) - no symbol. (Default behavior.) */ symbol: '$' | '#' | ''; /** @@ -116,9 +121,9 @@ export interface FormatSpecifier { * it defaults to 6 for all types except '' (none), which defaults to 12. * Precision is ignored for integer formats (types 'b', 'o', 'd', 'x', 'X' and 'c'). * - * See precisionFixed and precisionRound for help picking an appropriate precision + * See precisionFixed and precisionRound for help picking an appropriate precision. */ - precision: number; + precision: number | undefined; /** * The available type values are: * @@ -137,7 +142,7 @@ export interface FormatSpecifier { * 'c' - converts the integer to the corresponding unicode character before printing. * '' (none) - like g, but trim insignificant trailing zeros. * - * The type 'n' is also supported as shorthand for ',g'. For the 'g', 'n' and ''(none) types, + * The type 'n' is also supported as shorthand for ',g'. For the 'g', 'n' and '' (none) types, * decimal notation is used if the resulting string would have precision or fewer digits; otherwise, exponent notation is used. */ type: 'e' | 'f' | 'g' | 'r' | 's' | '%' | 'p' | 'b' | 'o' | 'd' | 'x' | 'X' | 'c' | '' | 'n'; @@ -173,9 +178,10 @@ export function formatDefaultLocale(defaultLocale: FormatLocaleDefinition): Form * The general form of a specifier is [[fill]align][sign][symbol][0][width][,][.precision][type]. * For reference, an explanation of the segments of the specifier string, refer to the FormatSpecifier interface properties. * - * @param specifier A Specifier string + * @param specifier A Specifier string. + * @throws Error on invalid format specifier. */ -export function format(specifier: string): (n: number) => string; +export function format(specifier: string): (n: number | { valueOf(): number }) => string; /** * Returns a new format function for the given string specifier. The returned function @@ -183,15 +189,16 @@ export function format(specifier: string): (n: number) => string; * The returned function will convert values to the units of the appropriate SI prefix for the * specified numeric reference value before formatting in fixed point notation. * - * Uses the current default locale. + * Uses the current default locale. * * The general form of a specifier is [[fill]align][sign][symbol][0][width][,][.precision][type]. * For reference, an explanation of the segments of the specifier string, refer to the FormatSpecifier interface properties. * - * @param specifier A Specifier string + * @param specifier A Specifier string. * @param value The reference value to determine the appropriate SI prefix. + * @throws Error on invalid format specifier. */ -export function formatPrefix(specifier: string, value: number): (n: number) => string; +export function formatPrefix(specifier: string, value: number): (n: number | { valueOf(): number }) => string; /** * Parses the specified specifier, returning an object with exposed fields that correspond to the @@ -201,6 +208,7 @@ export function formatPrefix(specifier: string, value: number): (n: number) => s * For reference, an explanation of the segments of the specifier string, refer to the FormatSpecifier interface properties. * * @param specifier A specifier string. + * @throws Error on invalid format specifier. */ export function formatSpecifier(specifier: string): FormatSpecifier; diff --git a/types/d3-format/tsconfig.json b/types/d3-format/tsconfig.json index 6017e0916f..078df0d2f2 100644 --- a/types/d3-format/tsconfig.json +++ b/types/d3-format/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ From c78f4617d82d8381d60ed96536a00cbdb972c353 Mon Sep 17 00:00:00 2001 From: Fabio Berta Date: Tue, 17 Apr 2018 00:17:14 +0200 Subject: [PATCH 0674/2153] narrow down some types and add more (#25007) --- types/react-map-gl/index.d.ts | 215 +++++++++++++++++++++++++++++----- 1 file changed, 187 insertions(+), 28 deletions(-) diff --git a/types/react-map-gl/index.d.ts b/types/react-map-gl/index.d.ts index 9f99433cfa..e0e78c6e75 100644 --- a/types/react-map-gl/index.d.ts +++ b/types/react-map-gl/index.d.ts @@ -8,19 +8,35 @@ import * as React from "react"; import * as MapboxGL from "mapbox-gl"; import * as GeoJSON from "geojson"; +export type EasingFunction = (t: number) => number; + export interface Viewport { - bearing: number; - isDragging: boolean; - latitude: number; - longitude: number; - pitch?: number; - startBearing?: number; - startDragLngLat?: number[]; - startPitch?: number; - zoom: number; + latitude: number; + longitude: number; + zoom: number; + isDragging?: boolean; + bearing?: number; + pitch?: number; + startBearing?: number; + startDragLngLat?: number[]; + startPitch?: number; + transitionDuration?: number; + transitionInterpolator?: TransitionInterpolator; + transitionInterruption?: number; + transitionEasing?: EasingFunction; } -export interface StaticMapProps { +export interface MapError { + message: string; +} + +export interface MapRequest { + url: string; + headers: {}; + credentials: string; +} + +export interface StaticMapProps extends Viewport { /** * Mapbox API access token for MapboxGL. * Required when using Mapbox vector tiles/styles Mapbox WebGL context creation option. @@ -29,7 +45,7 @@ export interface StaticMapProps { mapboxApiAccessToken: string; /** The Mapbox style. A string url or a MapboxGL style object (regular JS object or Immutable.Map). */ - mapStyle?: string; // TODO can also be immutable map + mapStyle?: string | {}; // TODO can also be immutable map /** The width of the map. */ width: number; @@ -37,16 +53,6 @@ export interface StaticMapProps { height: number; /** The latitude of the center of the map. */ - latitude: number; - /** The longitude of the center of the map. */ - longitude: number; - /** The tile zoom level of the map. Bounded implicitly by default minZoom and maxZoom of MapboxGL. */ - - zoom: number; - /** Specify the bearing of the viewport */ - bearing?: number; - /** Specify the pitch of the viewport */ - pitch?: number; /** Altitude of the viewport camera. Default 1.5 "screen heights" */ altitude?: number; // Note: Non-public API, see https://github.com/mapbox/mapbox-gl-js/issues/1137 @@ -95,7 +101,14 @@ export interface StaticMapProps { /** * A callback run when the map emits an error event. */ - onError?: () => void; + onError?: (e: MapError) => void; + + transformRequest?: () => MapRequest; +} + +export interface QueryRenderedFeaturesParams { + layers?: string[]; + filter?: any[]; } export class StaticMap extends React.Component { @@ -108,7 +121,17 @@ export class StaticMap extends React.Component { * Use Mapbox's queryRenderedFeatures API to find features at point or in a bounding box. * If the parameters argument is not specified, only queries the layers with the interactive property in the layer style. */ - queryRenderedFeatures(geometry?: MapboxGL.PointLike | MapboxGL.PointLike[], parameters?: { layers?: string[], filter?: any[] }): Array>; + queryRenderedFeatures(geometry?: MapboxGL.PointLike | MapboxGL.PointLike[], parameters?: QueryRenderedFeaturesParams): Array>; +} + +export interface InteractiveMapState { + isDragging: boolean; + isHovering: boolean; +} + +export interface MapEvent { + lngLat: [number, number]; + features: Array<{}>; } export interface InteractiveMapProps extends StaticMapProps { @@ -136,6 +159,18 @@ export interface InteractiveMapProps extends StaticMapProps { /** Radius to detect features around a clicked point */ clickRadius?: number; + mapControls?: { + events: string[]; + handleEvent: (event: MapEvent, context: any) => void; + }; + + visibilityConstraints?: { + minZoom: number; + maxZoom: number; + minPitch: number; + maxPitch: number; + }; + /** * Callback that is fired when the user interacted with the map. * The object passed to the callback contains viewport properties such as longitude, latitude, zoom etc. @@ -155,7 +190,7 @@ export interface InteractiveMapProps extends StaticMapProps { * layer style to `true`. See Mapbox's style spec * https://www.mapbox.com/mapbox-gl-style-spec/#layer-interactive */ - onHover?: (event: any, lngLat: number[], features: any) => void; + onHover?: (event: MapEvent, lngLat: number[], features: any) => void; /** * Called when the map is clicked. @@ -165,17 +200,25 @@ export interface InteractiveMapProps extends StaticMapProps { * layer style to `true`. See Mapbox's style spec * https://www.mapbox.com/mapbox-gl-style-spec/#layer-interactive */ - onClick?: (event: any, lngLat: number[], features: any) => void; + onClick?: (event: MapEvent, lngLat: number[], features: any) => void; /** Accessor that returns a cursor style to show interactive state */ - getCursor?: () => any; + getCursor?: (state: InteractiveMapState) => void; + + onTransitionStart?: () => void; + onTransitionInterrupt?: () => void; + onTransitionEnd?: () => void; } export class InteractiveMap extends React.Component { - _map: MapboxGL.Map; - /** Returns the Mapbox Map Instance */ getMap(): MapboxGL.Map; + + /** + * Use Mapbox's queryRenderedFeatures API to find features at point or in a bounding box. + * If the parameters argument is not specified, only queries the layers with the interactive property in the layer style. + */ + queryRenderedFeatures(geometry?: MapboxGL.PointLike | MapboxGL.PointLike[], parameters?: QueryRenderedFeaturesParams): Array>; } /** @@ -255,3 +298,119 @@ export interface SVGOverlayProps extends BaseControlProps { /** Additional css styles of the svg container. */ style?: React.CSSProperties; } + +export interface MarkerProps extends BaseControlProps { + className?: string; + longitude: number; + latitude: number; + offsetLeft?: number; + offsetTop?: number; + } + + export class Marker extends BaseControl {} + + export interface PopupProps extends BaseControlProps { + className?: string; + longitude: number; + latitude: number; + offsetLeft?: number; + offsetTop?: number; + tipSize?: number; + closeButton?: boolean; + closeOnClick?: boolean; + anchor?: 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'right'; + dynamicPosition?: boolean; + onClose?: () => void; + } + + export class Popup extends BaseControl {} + + export interface NavigationControlProps extends BaseControlProps { + onViewportChange: (viewport: Viewport) => void; + showZoom?: boolean; + showCompass?: boolean; + } + + export class NavigationControl extends BaseControl {} + + export class TransitionInterpolator {} + + export class LinearInterpolator extends TransitionInterpolator { + constructor(transitionProps?: string[]); + } + + export class FlyToInterpolator extends TransitionInterpolator {} + + export interface Center { + x: number; + y: number; + } + + export interface MapControlEvent { + type: string; + center: Center; + offsetCenter: Center; + target: any; + srcEvent: any; + key?: number; + leftButton?: boolean; + middleButton?: boolean; + rightButton?: boolean; + pointerType?: string; + delta?: number; + } + + export interface MapState { + width: number; + height: number; + latitude: number; + longitude: number; + zoom: number; + bearing?: number; + pitch?: number; + altitude?: number; + maxZoom?: number; + minZoom?: number; + maxPitch?: number; + minPitch?: number; + startPanLngLat?: [number, number]; + startZoomLngLat?: [number, number]; + startBearing?: number; + startPitch?: number; + startZoom?: number; + } + + export interface Options { + // TODO(deprecate): remove this when `onChangeViewport` gets deprecated + onChangeViewport?: (viewport: Viewport) => void; + // TODO(deprecate): remove this when `touchZoomRotate` gets deprecated + touchZoomRotate?: boolean; + onViewportChange?: (viewport: Viewport) => void; + onStateChange?: (state: MapState) => void; + eventManager?: any; + scrollZoom?: boolean; + dragPan?: boolean; + dragRotate?: boolean; + doubleClickZoom?: boolean; + touchZoom?: boolean; + touchRotate?: boolean; + keyboard?: boolean; + } + + export class MapControls { + events: string[]; + handleEvent: (event: MapControlEvent) => void; + getMapState(overrides: Partial): MapState; + setOptions(options: Options): void; + setState(newState: MapState): void; + updateViewport(newMapState: MapState, extraProps: any, extraState: InteractiveMapState): void; + } + + export function autobind(obj: any): void; + + export interface Experimental { + MapControls: MapControls; + autobind: typeof autobind; + } + + export const experimental: Experimental; From 9f0ef7e76e186c9a5aa5ccc0e6802dcf72bace5e Mon Sep 17 00:00:00 2001 From: Edo Rivai Date: Tue, 17 Apr 2018 00:17:54 +0200 Subject: [PATCH 0675/2153] [knex] Enable named bindings in *Raw methods (#25028) --- types/knex/index.d.ts | 5 +++-- types/knex/knex-tests.ts | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/types/knex/index.d.ts b/types/knex/index.d.ts index 9c07f69f9b..34715ec6cc 100644 --- a/types/knex/index.d.ts +++ b/types/knex/index.d.ts @@ -18,6 +18,7 @@ import Bluebird = require("bluebird"); type Callback = Function; type Client = Function; type Value = string | number | boolean | Date | Array | Array | Array | Array | Buffer | Knex.Raw; +type ValueMap = { [key: string]: Value }; type ColumnName = string | Knex.Raw | Knex.QueryBuilder | {[key: string]: string }; type TableName = string | Knex.Raw | Knex.QueryBuilder; @@ -338,7 +339,7 @@ declare namespace Knex { interface RawQueryBuilder { (sql: string, ...bindings: Value[]): QueryBuilder; - (sql: string, bindings: Value[]): QueryBuilder; + (sql: string, bindings: Value[] | ValueMap): QueryBuilder; (raw: Raw): QueryBuilder; } @@ -352,7 +353,7 @@ declare namespace Knex { (value: Value): Raw; (sql: string, ...bindings: Value[]): Raw; (sql: string, bindings: Value[]): Raw; - (sql: string, bindings: Object): Raw; + (sql: string, bindings: ValueMap): Raw; } // diff --git a/types/knex/knex-tests.ts b/types/knex/knex-tests.ts index 1afd65ef6d..112732a2e5 100644 --- a/types/knex/knex-tests.ts +++ b/types/knex/knex-tests.ts @@ -246,6 +246,7 @@ knex('users').whereBetween('votes', [1, 100]); knex('users').whereNotBetween('votes', [1, 100]); knex('users').whereRaw('id = ?', [1]); +knex('users').whereRaw('id = :id', { id: 1 }); // Join methods knex('users') From b74166a77223d320a8ef4687fe0fcc483aa3c85c Mon Sep 17 00:00:00 2001 From: Ferdi Armbruster Date: Tue, 17 Apr 2018 00:18:24 +0200 Subject: [PATCH 0676/2153] [@types/heremaps] Adding draggable property to AbstractMarker in heremaps (#25017) * Adding draggable property to AbstractMarker in heremaps * Fix jsdoc and optional for draggable property to AbstractMarker in heremaps * Fix jsdoc description for draggable property to AbstractMarker in heremaps --- types/heremaps/index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types/heremaps/index.d.ts b/types/heremaps/index.d.ts index 1fd1f3da29..918e464c09 100644 --- a/types/heremaps/index.d.ts +++ b/types/heremaps/index.d.ts @@ -2,6 +2,7 @@ // Project: https://developer.here.com/ // Definitions by: Joshua Efiong // Bernd Hacker +// Ferdinand Armbruster // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -1634,6 +1635,12 @@ declare namespace H { * @returns {H.map.AbstractMarker} - the marker itself */ setIcon(icon: (H.map.Icon | H.map.DomIcon)): H.map.AbstractMarker; + + /** + * @property draggable + * @description This property ensure that the marker can receive drag events. + */ + draggable?: boolean; } namespace AbstractMarker { From af9cce1db3939fdbcbdb0b1f920a7713237ad292 Mon Sep 17 00:00:00 2001 From: Anish Patel Date: Mon, 16 Apr 2018 23:18:47 +0100 Subject: [PATCH 0677/2153] @feathersjs/authentication-oauth2 - renamed OAuth2Verifier to Verifier to match source package (#25026) * renamed exported class from OAuth2Verifier to Verifier to match export in @feathersjs/authentication-oauth2 package * fixed linting --- .../feathersjs__authentication-oauth2-tests.ts | 8 +++++++- types/feathersjs__authentication-oauth2/index.d.ts | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/types/feathersjs__authentication-oauth2/feathersjs__authentication-oauth2-tests.ts b/types/feathersjs__authentication-oauth2/feathersjs__authentication-oauth2-tests.ts index f5ebaa4c1a..34dba17062 100644 --- a/types/feathersjs__authentication-oauth2/feathersjs__authentication-oauth2-tests.ts +++ b/types/feathersjs__authentication-oauth2/feathersjs__authentication-oauth2-tests.ts @@ -1,4 +1,10 @@ import feathers, { Application } from '@feathersjs/feathers'; -import feathersAuthenticationOAuth2 from '@feathersjs/authentication-oauth2'; +import feathersAuthenticationOAuth2, { Verifier } from '@feathersjs/authentication-oauth2'; const app: Application<{}> = feathers().configure(feathersAuthenticationOAuth2()); + +class CustomVerifier extends Verifier { + constructor(app: Application<{}>, options: any = {}) { + super(app, options); + } +} diff --git a/types/feathersjs__authentication-oauth2/index.d.ts b/types/feathersjs__authentication-oauth2/index.d.ts index 3037c1c47a..b2bf133c68 100644 --- a/types/feathersjs__authentication-oauth2/index.d.ts +++ b/types/feathersjs__authentication-oauth2/index.d.ts @@ -60,10 +60,10 @@ export interface FeathersAuthenticationOAuth2Options { /** * A Verifier class. Defaults to the built-in one but can be a custom one. See below for details. */ - Verifier: OAuth2Verifier; + Verifier: Verifier; } -export class OAuth2Verifier { +export class Verifier { constructor(app: Application, options: any) _updateEntity(entity: any, data: { profile: any, accessToken: string, refreshToken: string }): Promise; // updates an existing entity From 3e9fdd529c5cc6e5e239c398b4c85006f21c28e6 Mon Sep 17 00:00:00 2001 From: Sasha Koss Date: Tue, 17 Apr 2018 04:19:05 +0600 Subject: [PATCH 0678/2153] Fix a signature for @google-cloud/pubsub (#24995) Fix Publisher#publish signature, so that it returns a promise to messageId (string): https://cloud.google.com/nodejs/docs/reference/pubsub/0.18.x/Publisher#publish --- types/google-cloud__pubsub/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/google-cloud__pubsub/index.d.ts b/types/google-cloud__pubsub/index.d.ts index 7c9014b7d3..2cadd026cd 100644 --- a/types/google-cloud__pubsub/index.d.ts +++ b/types/google-cloud__pubsub/index.d.ts @@ -111,7 +111,7 @@ declare namespace PubSub { interface Publisher { publish(data: Buffer, callback: Publisher.PublishCallback): void; publish(data: Buffer, attributes: object, callback: Publisher.PublishCallback): void; - publish(data: Buffer, attributes?: object): Promise; + publish(data: Buffer, attributes?: object): Promise; } namespace Publisher { type PublishCallback = (error: Error | null, messageId: string) => void; From 3d822ec7e66be810e1b76a1cd56fdd5b3d9d7e48 Mon Sep 17 00:00:00 2001 From: Kyle Roach Date: Mon, 16 Apr 2018 18:21:28 -0400 Subject: [PATCH 0679/2153] Remove react-native-collapsible (#25011) --- notNeededPackages.json | 6 ++ types/react-native-collapsible/Accordion.d.ts | 64 --------------- types/react-native-collapsible/index.d.ts | 80 ------------------- .../react-native-collapsible-tests.tsx | 62 -------------- types/react-native-collapsible/tsconfig.json | 26 ------ types/react-native-collapsible/tslint.json | 7 -- 6 files changed, 6 insertions(+), 239 deletions(-) delete mode 100644 types/react-native-collapsible/Accordion.d.ts delete mode 100644 types/react-native-collapsible/index.d.ts delete mode 100644 types/react-native-collapsible/react-native-collapsible-tests.tsx delete mode 100644 types/react-native-collapsible/tsconfig.json delete mode 100644 types/react-native-collapsible/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 0f318582a8..2b9e1fcde0 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1152,6 +1152,12 @@ "sourceRepoURL": "https://github.com/react-ga/react-ga", "asOfVersion": "2.3.0" }, + { + "libraryName": "react-native-collapsible", + "typingsPackageName": "react-native-collapsible", + "sourceRepoURL": "https://github.com/oblador/react-native-collapsible", + "asOfVersion": "0.11.0" + }, { "libraryName": "react-native-elements", "typingsPackageName": "react-native-elements", diff --git a/types/react-native-collapsible/Accordion.d.ts b/types/react-native-collapsible/Accordion.d.ts deleted file mode 100644 index d4f3ae0dab..0000000000 --- a/types/react-native-collapsible/Accordion.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -import * as React from 'react'; -import { EasingMode } from './index'; - -export interface AccordionProps { - /** - * An array of sections passed to the render methods - */ - sections: any[]; - - /** - * A function that should return a renderable representing the header - */ - renderHeader(content: any, index: number, isActive: boolean): JSX.Element; - - /** - * A function that should return a renderable representing the content - */ - renderContent(content: any, index: number, isActive: boolean): JSX.Element; - - /** - * An optional function that is called when currently active section is changed, index === false when collapsed - */ - onChange?(index: number): void; - - /** - * Set which index in the sections array is initially open. Defaults to none. - */ - initiallyActiveSection?: number; - - /** - * Control which index in the sections array is currently open. Defaults to none. If false, closes all sections. - */ - activeSection?: boolean | number; - - /** - * The color of the underlay that will show through when tapping on headers. - * - * @default black - */ - underlayColor?: string; - - /** - * Alignment of the content when transitioning, can be top, center or bottom - * - * @default top - */ - align?: 'top' | 'center' | 'bottom'; - - /** - * Duration of transition in milliseconds - * - * @default 300 - */ - duration?: number; - - /** - * Function or function name from Easing (or tween-functions if < RN 0.8). Collapsible will try to combine Easing functions for you if you name them like tween-functions. - * - * @default easeOutCubic - */ - easing?: EasingMode | any; -} - -export default class Accordion extends React.Component {} diff --git a/types/react-native-collapsible/index.d.ts b/types/react-native-collapsible/index.d.ts deleted file mode 100644 index bc107f140a..0000000000 --- a/types/react-native-collapsible/index.d.ts +++ /dev/null @@ -1,80 +0,0 @@ -// Type definitions for react-native-collapsible 0.8 -// Project: https://github.com/oblador/react-native-collapsible -// Definitions by: Kyle Roach -// Umidbek Karimov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 - -import * as React from 'react'; - -export type EasingMode = -'linear' | -'easeInQuad' | -'easeOutQuad' | -'easeInOutQuad' | -'easeInCubic' | -'easeOutCubic' | -'easeInOutCubic' | -'easeInQuart' | -'easeOutQuart' | -'easeInOutQuart' | -'easeInQuint' | -'easeOutQuint' | -'easeInOutQuint' | -'easeInSine' | -'easeOutSine' | -'easeInOutSine' | -'easeInExpo' | -'easeOutExpo' | -'easeInOutExpo' | -'easeInCirc' | -'easeOutCirc' | -'easeInOutCirc' | -'easeInElastic' | -'easeOutElastic' | -'easeInOutElastic' | -'easeInBack' | -'easeOutBack' | -'easeInOutBack' | -'easeInBounce' | -'easeOutBounce' | -'easeInOutBounce'; - -export interface CollapsibleProps { - /** - * Alignment of the content when transitioning, can be top, center or bottom - * - * @default top - */ - align?: 'top' | 'center' | 'bottom'; - - /** - * Whether to show the child components or not - * - * @default true - */ - collapsed?: boolean; - - /** - * Which height should the component collapse to - * - * @default 0 - */ - collapsedHeight?: number; - - /** - * Duration of transition in milliseconds - * - * @default 300 - */ - duration?: number; - - /** - * Function or function name from Easing (or tween-functions if < RN 0.8). Collapsible will try to combine Easing functions for you if you name them like tween-functions - * - * @default easeOutCubic - */ - easing?: EasingMode | any; -} - -export default class Collapsible extends React.Component {} diff --git a/types/react-native-collapsible/react-native-collapsible-tests.tsx b/types/react-native-collapsible/react-native-collapsible-tests.tsx deleted file mode 100644 index 65dd0015b8..0000000000 --- a/types/react-native-collapsible/react-native-collapsible-tests.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import * as React from 'react'; -import { View } from 'react-native'; -import Collapsible from 'react-native-collapsible'; -import Accordion from 'react-native-collapsible/Accordion'; - -class CollapsibleTest extends React.Component { - render() { - return ( - - - - ); - } -} - -class AccordianTest extends React.Component { - _renderHeader() { - return ( - - ); - } - - _renderContent() { - return ( - - ); - } - - render() { - return ( - - ); - } -} - -class AccordionComplexTest extends React.Component { - _renderHeader() { - return ( - - ); - } - - _renderContent() { - return ( - - ); - } - - render() { - return ( - - ); - } -} diff --git a/types/react-native-collapsible/tsconfig.json b/types/react-native-collapsible/tsconfig.json deleted file mode 100644 index 7b0c98aa63..0000000000 --- a/types/react-native-collapsible/tsconfig.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "dom", - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true, - "jsx": "react" - }, - "files": [ - "index.d.ts", - "Accordion.d.ts", - "react-native-collapsible-tests.tsx" - ] -} diff --git a/types/react-native-collapsible/tslint.json b/types/react-native-collapsible/tslint.json deleted file mode 100644 index b1439230db..0000000000 --- a/types/react-native-collapsible/tslint.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - // TODO - "no-any-union": false - } -} From f6c0808e26fe78e52dc5f160f053422752fdc931 Mon Sep 17 00:00:00 2001 From: lincoln <37287480+lincoln2018@users.noreply.github.com> Date: Tue, 17 Apr 2018 06:23:39 +0800 Subject: [PATCH 0680/2153] update interface (#25014) * fix bugs with types * fixed type errors * more type errors fixed * fixed errors and added missing type definitions * fix all typos and added all missing ones * change inappropriate names * Updated names to be more accurate. * adds EnumDWT_ConvertMode to make compatible with the old enum * Remove type for sync use of ConvertToBase64 which isn't supported for now * adding new line at the end --- types/dwt/addon.pdf.d.ts | 9 +- types/dwt/index.d.ts | 207 +++++++++++++++++++++++++++------------ 2 files changed, 151 insertions(+), 65 deletions(-) diff --git a/types/dwt/addon.pdf.d.ts b/types/dwt/addon.pdf.d.ts index 87097471b0..2e7b1d5a84 100644 --- a/types/dwt/addon.pdf.d.ts +++ b/types/dwt/addon.pdf.d.ts @@ -14,6 +14,11 @@ declare enum EnumDWT_ConvertMode { CM_RENDERALL = 1 } +declare enum EnumDWT_ConverMode { + CM_DEFAULT = 0, + CM_RENDERALL = 1 +} + /** * @class */ @@ -43,10 +48,10 @@ interface PDF { /** * Set the image convert mode for PDF Rasterizer in Dynamic Web TWAIN. * @method Dynamsoft.WebTwain#SetConvertMode - * @param {EnumDWT_ConvertMode} convertMode Specifies the image convert mode. + * @param {EnumDWT_ConvertMode | EnumDWT_ConverMode} convertMode Specifies the image convert mode. * @return {boolean} */ - SetConvertMode(convertMode: EnumDWT_ConvertMode): boolean; + SetConvertMode(convertMode: EnumDWT_ConvertMode | EnumDWT_ConverMode): boolean; /** * Set the output resolution for the PDF Rasterizer in Dynamic Web TWAIN. diff --git a/types/dwt/index.d.ts b/types/dwt/index.d.ts index be362e680b..0656236f08 100644 --- a/types/dwt/index.d.ts +++ b/types/dwt/index.d.ts @@ -48,7 +48,7 @@ declare namespace Dynamsoft { bChrome: boolean, bEdge: boolean, bFileSystem: boolean, bFirefox: boolean, bIE: boolean, bLinux: boolean, bMac: boolean, bSafari: boolean, bWin: boolean, bWin64: boolean, basePath: string, iPluginLength: number, isX64: boolean, pathType: number, - strChromeVersion: number, strFirefoxVersion: string, strIEVersion: string + strChromeVersion: string, strFirefoxVersion: string, strIEVersion: string }; /*ignored @@ -103,8 +103,8 @@ declare namespace Dynamsoft { function ShowDialog(_dialogWidth: number, _dialogHeight: number, _strDialogMessageWithHtmlFormat: string, _bChangeImage: boolean, bHideCloseButton: boolean): void; let Trial: boolean; function Unload(): void; - let UseDefaultInstallUI: string; - let initQueue: number[]; + let UseDefaultInstallUI: boolean; + let initQueue: any[]; let inited: boolean; } } @@ -1372,13 +1372,48 @@ declare enum EnumDWT_UploadDataFormat { Base64 = 1 } -/** interface for a DWT container which basically defines a DIV on the page */ +/** + * interface for a DWT container which basically defines a DIV on the page + */ interface Container { ContainerId: string; Width: string | number; Height: string | number; } +/** + * interface for a base64 result + */ +interface Base64Result { + getLength(): number; + getData(offset: number, length: number): string; + getMD5(): string; +} + +/** + * Copied from lib.d.ts (Typescript) + */ +interface Blob { + readonly size: number; + readonly type: string; + msClose(): void; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; +} + +/** + * Details for each license + */ +interface LicenseDetailItem { + readonly Browser: string; + readonly EnumLicenseType: string; + readonly ExpireDate: string; + readonly LicenseType: string; + readonly OS: string; + readonly Trial: string; + readonly Version: string; +} + /** * @class */ @@ -1453,7 +1488,7 @@ interface WebTwain { * Returns the current deviation of the pixels in the image. * @type {number} */ - BlankImageCurrentStdDev: number; + readonly BlankImageCurrentStdDev: number; /** * Returns or sets the standard deviation of the pixels in the image. @@ -1507,7 +1542,7 @@ interface WebTwain { * Returns the index (0-based) of a list to indicate the Default Value when the value of the CapType property is TWON_ENUMERATION. If the data type of the capability is String, the list is in CapItemsString property. For other data types, the list is in CapItems property. This is a runtime, read-only property. * @type {number} */ - CapDefaultIndex: number; + readonly CapDefaultIndex: number; /** * Returns the default value in a range when the value of the CapType property is TWON_RANGE. This is a runtime, read-only property. @@ -1591,25 +1626,25 @@ interface WebTwain { * Returns the device name of current source. This is a runtime, read-only property. * @type {string} */ - CurrentSourceName: string; + readonly CurrentSourceName: string; /** * Returns the value indicating the data source status. This is a runtime, read-only property. * @type {number} */ - DataSourceStatus: number; + readonly DataSourceStatus: number; /** * Returns the device name of default source. This is a runtime, read-only property. * @type {string} */ - DefaultSourceName: string; + readonly DefaultSourceName: string; /** * Returns whether the source supports duplex. If so, it further returns the level of duplex the Source supports (one pass or two pass duplex). This is a runtime, read-only property. - * @type {number} + * @type {EnumDWT_DUPLEX} */ - Duplex: number; + readonly Duplex: EnumDWT_DUPLEX; /** * [Deprecated.] Returns or sets whether the user can zoom image using hot key. @@ -1621,13 +1656,13 @@ interface WebTwain { * Returns the error code. This is a runtime, read-only property. * @type {number} */ - ErrorCode: number; + readonly ErrorCode: number; /** * Returns the error string. This is a runtime, read-only property. * @type {string} */ - ErrorString: string; + readonly ErrorString: string; /** * Returns or sets the password used to log into the FTP server. @@ -1657,7 +1692,7 @@ interface WebTwain { * Returns the response string from the HTTP server if an error occurs for HTTPUploadThroughPost() method. This is a runtime, read-only property. * @type {string} */ - HTTPPostResponseString: string; + readonly HTTPPostResponseString: string; /** * Returns whether a HTTP request has credentials @@ -1675,7 +1710,7 @@ interface WebTwain { * Returns how many images are in buffer. This is a runtime, read-only property. * @type {number} */ - HowManyImagesInBuffer: number; + readonly HowManyImagesInBuffer: number; /** * Specifies the content type of a http upload. @@ -1783,7 +1818,7 @@ interface WebTwain { * Returns whether or not there are documents loaded in the Source's feeder when IfFeederEnabled and IfPaperDetectable are TRUE. This is a runtime, read-only property. * @type {boolean} */ - IfFeederLoaded: boolean; + readonly IfFeederLoaded: boolean; /** * Returns or sets whether to resize the image to fit the size of window when the view mode is set to -1 by -1. You can use SetViewMode method to set the view mode. @@ -1813,7 +1848,7 @@ interface WebTwain { * Returns the value whether the Source has a paper sensor that can detect documents on the ADF or Flatbed. This is a runtime, read-only property. * @type {boolean} */ - IfPaperDetectable: boolean; + readonly IfPaperDetectable: boolean; /** * Returns or sets whether SSL is used when uploading or downloading images. @@ -1879,7 +1914,7 @@ interface WebTwain { * Returns whether the Source supports acquisition with the UI (User Interface) disabled. If FALSE, indicates that this Source can only support acquisition with the UI enabled. This is a runtime, read-only property. * @type {boolean} */ - IfUIControllable: boolean; + readonly IfUIControllable: boolean; /** * Sets or returns whether Dynamic Web TWAIN uses the new TWAIN Data Source Manager (TWAINDSM.dll) when acquiring images from TWAIN devices. @@ -1927,43 +1962,43 @@ interface WebTwain { * Returns the document number of the current image. This is a runtime, read-only property. * @type {number} */ - ImageLayoutDocumentNumber: number; + readonly ImageLayoutDocumentNumber: number; /** * Returns the value of the bottom-most edge of the current image frame (in Unit). This is a read-only runtime property. * @type {number} */ - ImageLayoutFrameBottom: number; + readonly ImageLayoutFrameBottom: number; /** * Returns the value of the left-most edge of the current image frame (in Unit). This is a runtime, read-only property. * @type {number} */ - ImageLayoutFrameLeft: number; + readonly ImageLayoutFrameLeft: number; /** * Returns the frame number of the current image. This is a runtime, read-only property. * @type {number} */ - ImageLayoutFrameNumber: number; + readonly ImageLayoutFrameNumber: number; /** * Returns the value of the right-most edge of the current image frame (in Unit). This is a runtime, read-only property. * @type {number} */ - ImageLayoutFrameRight: number; + readonly ImageLayoutFrameRight: number; /** * Returns the value of the top-most edge of the current image frame (in Unit). This is a runtime, read-only property. * @type {number} */ - ImageLayoutFrameTop: number; + readonly ImageLayoutFrameTop: number; /** * Returns the page number of the current image. This is a runtime, read-only property. * @type {Long} */ - ImageLayoutPageNumber: number; + readonly ImageLayoutPageNumber: number; /** * [Deprecated.] Returns how tall/long, in pixels, the image is. This is a runtime, read-only property. @@ -1981,7 +2016,7 @@ interface WebTwain { * Returns the pixel type of the current image. This is a runtime, read-only property. Please note the property is only valid in OnPreTransfer and OnPostTransfer event. * @type {EnumDWT_PixelType} */ - ImagePixelType: EnumDWT_PixelType; + readonly ImagePixelType: EnumDWT_PixelType; /** * [Deprecated.] Returns how width, in pixels, the image is. This is a runtime, read-only property. @@ -2017,13 +2052,13 @@ interface WebTwain { * Return the magnetic data if the scanner support magnetic data recognition. * @type {string} */ - MagData: string; + readonly MagData: string; /** * Return the magnetic type if the scanner support magnetic data recognition. * @type {number} */ - MagType: number; + readonly MagType: number; /** * Sets or returns the manufacture string for the application identity. @@ -2059,13 +2094,13 @@ interface WebTwain { * Returns the X co-ordinate of the mouse. This is a runtime property. * @type {number} */ - MouseX: number; + readonly MouseX: number; /** * Returns the Y co-ordinate of the mouse. This is a runtime property. * @type {number} */ - MouseY: number; + readonly MouseY: number; /** * Returns or sets the name of the person who creates the PDF document. @@ -2129,15 +2164,15 @@ interface WebTwain { /** * Returns or sets the page size(s) the Source can/should use to acquire image data. This is a runtime property. - * @type {number} + * @type {EnumDWT_CapSupportedSizes} */ - PageSize: number; + PageSize: EnumDWT_CapSupportedSizes; /** * Returns the number of transfers the Source is ready to supply, upon demand. This is a runtime, read-only property. * @type {number} */ - PendingXfers: number; + readonly PendingXfers: number; /** * Returns or sets the pixel flavor for acquired images. This is a runtime property. @@ -2209,7 +2244,7 @@ interface WebTwain { * Returns how many sources are installed in the system. This is a runtime, read-only property. * @type {number} */ - SourceCount: number; + readonly SourceCount: number; /** * Returns or sets the compression type of TIFF files. This is a runtime property. @@ -2225,9 +2260,9 @@ interface WebTwain { /** * Returns or sets the unit of measure. This is a runtime property. - * @type {number} + * @type {EnumDWT_UnitType} */ - Unit: number; + Unit: EnumDWT_UnitType; /** * Specifies whether to show the vertical scroll bar @@ -2239,7 +2274,7 @@ interface WebTwain { * Sets or returns the version info string for the application identity. * @type {string} */ - VersionInfo: string; + readonly VersionInfo: string; /** * Returns or sets the width of the dwt object viewer @@ -2450,18 +2485,17 @@ interface WebTwain { CloseWorkingProcess(): boolean; /** - * Converts the images specified by the indices to base64. + * Converts the images specified by the indices to base64 synchronously. * @method WebTwain#ConvertToBase64 * @param {Array} indices indices specifies which images are to be converted to base64. * @param {EnumDWT_ImageType} enumImageType the image format in which the images are to be converted to base64. - * @param {function} asyncSuccessFunc the function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - ConvertToBase64(indices: number[], enumImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: (result: any) => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + * @return {Base64Result} + + ConvertToBase64(indices: number[], enumImageType: EnumDWT_ImageType): Base64Result; + */ /** - * Converts the images specified by the indices to base64. + * Converts the images specified by the indices to base64 asynchronously. * @method WebTwain#ConvertToBase64 * @param {Array} indices indices specifies which images are to be converted to base64. * @param {EnumDWT_ImageType} enumImageType the image format in which the images are to be converted to base64. @@ -2469,7 +2503,27 @@ interface WebTwain { * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. * @return {boolean} */ - ConvertToBlob(indices: number[], enumImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: (result: any) => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + ConvertToBase64(indices: number[], enumImageType: EnumDWT_ImageType, asyncSuccessFunc: (result: Base64Result) => void, asyncFailureFunc: (errorCode: number, errorString: string) => void): boolean; + + /** + * Converts the images specified by the indices to blob synchronously. + * @method WebTwain#ConvertToBlob + * @param {Array} indices indices specifies which images are to be converted to base64. + * @param {EnumDWT_ImageType} enumImageType the image format in which the images are to be converted to base64. + * @return {Blob} + */ + ConvertToBlob(indices: number[], enumImageType: EnumDWT_ImageType): Blob; + + /** + * Converts the images specified by the indices to blob asynchronously. + * @method WebTwain#ConvertToBlob + * @param {Array} indices indices specifies which images are to be converted to base64. + * @param {EnumDWT_ImageType} enumImageType the image format in which the images are to be converted to base64. + * @param {function} asyncSuccessFunc the function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + ConvertToBlob(indices: number[], enumImageType: EnumDWT_ImageType, asyncSuccessFunc: (result: any) => void, asyncFailureFunc: (errorCode: number, errorString: string) => void): boolean; /** * Changes a specified image to gray scale. @@ -2737,9 +2791,9 @@ interface WebTwain { /** * Gets custom DS data, the returned string is base64 encoded. * @method WebTwain#GetCustomDSDataEx - * @return {string} + * @return {string | boolean} */ - GetCustomDSDataEx(): string; + GetCustomDSDataEx(): string | boolean; // Get custom DS data, and save the data to the specified file /** @@ -2753,9 +2807,9 @@ interface WebTwain { /** * Retrieve the device type of the currently selected data source, it might be a scanner, a web camera, etc. * @method WebTwain#GetDeviceType - * @return {number} + * @return {number | boolean} */ - GetDeviceType(): number; + GetDeviceType(): number | boolean; /** * Returns the pixel bit depth of the selected image. @@ -2773,9 +2827,15 @@ interface WebTwain { */ GetImageHeight(sImageIndex: number): number; - /*work on - GetImagePartURL - */ + /** + * Returns the direct URL of an image specified by index, if iWidth and iHeight are not specified, you get the original image, otherwise you get the image with specified iWidth or iHeight while keeping the same aspect ratio. The returned string is like this 'dwt://dwt_trial_13000404/img?id=306159652&index=0&t=1502184632022' + * @method WebTwain#GetImagePartURL + * @param {number} index the index of the image. + * @param {number} iWidth the width of the image, it must be 150 or bigger + * @param {number} iHeight the height of the image, it must be 150 or bigger + * @return {string} + */ + GetImagePartURL(index: number, iWidth?: number, iHeight?: number): string; /** * Returns the file size of the new image resized from the image of a specified index in buffer. @@ -2791,10 +2851,10 @@ interface WebTwain { * Pre-calculate the file size of the local image file that is saved from an image of a specified index in buffer. * @method WebTwain#GetImageSizeWithSpecifiedType * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {number} sImageType specifies the type of an image file.. + * @param {EnumDWT_ImageType} sImageType specifies the type of an image file.. * @return {number} */ - GetImageSizeWithSpecifiedType(sImageIndex: number, sImageType: number): number; + GetImageSizeWithSpecifiedType(sImageIndex: number, sImageType: EnumDWT_ImageType): number; /** * Returns the direct URL of an image specified by index, if iWidth or iHeight is set to -1, you get the original image, otherwise you get the image with specified iWidth or iHeight while keeping the same aspect ratio. @@ -2834,7 +2894,7 @@ interface WebTwain { * Return the runtime license info. * @method WebTwain#GetLicenseInfo */ - GetLicenseInfo(): { Domain: string, Detail: any[] }; + GetLicenseInfo(): { Domain: string, Detail: LicenseDetailItem[] }; /** * Returns the index of the selected image. @@ -2847,10 +2907,10 @@ interface WebTwain { /** * Pre-calculate the file size of the local image file that is saved from the selected images in buffer. * @method WebTwain#GetSelectedImagesSize - * @param {number} iImageType specifies the type of an image file. + * @param {EnumDWT_ImageType} iImageType specifies the type of an image file. * @return {number} */ - GetSelectedImagesSize(iImageType: number): number; + GetSelectedImagesSize(iImageType: EnumDWT_ImageType): number; /** * Check the skew angle of an image by its index in buffer. @@ -2938,6 +2998,16 @@ interface WebTwain { */ HTTPDownloadThroughPost(HTTPServer: string, HTTPRemoteFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; + /** + * Uploads just a form created by SetHTTPFormField and SetHTTPHeader + * @method WebTwain#HTTPUpload + * @param {string} url the url where the images are sent in a POST request. + * @param {function} asyncSuccessFunc the function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + HTTPUpload(url: string, asyncSuccessFunc: (httppostresponsestring: string) => void, asyncFailureFunc: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; + /** * Uploads the images specified by the indices to the HTTP server. * @method WebTwain#HTTPUpload @@ -2949,7 +3019,7 @@ interface WebTwain { * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. * @return {boolean} */ - HTTPUpload(url: string, indices: number[], enumImageType: EnumDWT_ImageType, dataFormat: EnumDWT_UploadDataFormat, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; + HTTPUpload(url: string, indices: number[], enumImageType: EnumDWT_ImageType, dataFormat: EnumDWT_UploadDataFormat, asyncSuccessFunc: (httppostresponsestring: string) => void, asyncFailureFunc: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Uploads all images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page TIFF. @@ -3256,9 +3326,10 @@ interface WebTwain { /** * Shows the GUI of Image Printer. * @method WebTwain#Print + * @param {boolean} bUseSystemDefaultPrintUI specifies whether to use the system Print UI or not. * @return {boolean} */ - Print(): boolean; + Print(bUseSystemDefaultPrintUI: boolean): boolean; /** * Binds a specified function to an event, so that the function gets called whenever the event fires. @@ -3272,9 +3343,9 @@ interface WebTwain { /** * Removes all images in buffer. * @method WebTwain#RemoveAllImages - * @return {void} + * @return {boolean} */ - RemoveAllImages(): void; + RemoveAllImages(): boolean; /** * Removes selected images in buffer. @@ -3542,6 +3613,16 @@ interface WebTwain { */ SetHTTPFormField(FieldName: string, FieldValue: string): boolean; + /** + * Sets a text parameter as a filed in a web form. This form is maintained by the component itself (meaning it's not on the page). All fields in this form will be passed to the server when uploading images. + * @method WebTwain#SetHTTPFormField + * @param {string} FieldName specifies the name of the field which could later be used to retrieve the blob + * @param {Blob} blobValue specifies the blob to be put in the form. + * @param {string} optionalFileName specifies the file name for the blob + * @return {boolean} + */ + SetHTTPFormField(FieldName: string, blobValue: Blob, optionalFileName?: string): boolean; + /** * Sets a header for the current HTTP Post request. * @method WebTwain#SetHTTPHeader @@ -3604,9 +3685,9 @@ interface WebTwain { * @method WebTwain#SetSelectedImageIndex * @param {number} sSelectedIndex this is the index of an array that holds the indices of selected images. * @param {number} newVal specifies the index of an image that you want to select. - * @return {void} + * @return {boolean} */ - SetSelectedImageIndex(selectedIndex: number, newVal: number): void; + SetSelectedImageIndex(selectedIndex: number, newVal: number): boolean; /** * Sets a custom tiff tag. Currently you can set up to 32 tags. The string to be set in a tag can be encoded with base64. From ed2cf925b39b5bdca9527b41541696d8e4bf58fa Mon Sep 17 00:00:00 2001 From: Keagan McClelland Date: Mon, 16 Apr 2018 16:24:02 -0600 Subject: [PATCH 0681/2153] fixed ramda type inference errors (#24942) --- types/ramda/index.d.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index eb4b4569c6..017839933a 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -16,6 +16,7 @@ // Nikita Moshensky // Ethan Resnick // Jack Leigh +// Keagan McClelland // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -951,10 +952,11 @@ declare namespace R { * Returns a new list, constructed by applying the supplied function to every element of the supplied list. */ map(fn: (x: T) => U, list: ReadonlyArray): U[]; - map(fn: (x: T) => U, obj: Functor): Functor; // used in functors map(fn: (x: T) => U): (list: ReadonlyArray) => U[]; - map(fn: (x: T[keyof T]) => U[keyof T], obj: T): U; - map(fn: (x: T[keyof T]) => U[keyof T]): (obj: T) => U; + map(fn: (x: T[keyof T & keyof U]) => U[keyof T & keyof U], list: T): U; + map(fn: (x: T[keyof T & keyof U]) => U[keyof T & keyof U]): (list: T) => U; + map(fn: (x: T) => U, obj: Functor): Functor; // used in functors + map(fn: (x: T) => U): (obj: Functor) => Functor; // used in functors /** * The mapAccum function behaves like a combination of map and reduce. From a7f56fc5ce4255c9a456492aa72af41e1d692845 Mon Sep 17 00:00:00 2001 From: "James C. Davis" Date: Mon, 16 Apr 2018 18:24:28 -0400 Subject: [PATCH 0682/2153] Add Ember.CoreObject constructor with initial properties arg (#24997) --- types/ember/index.d.ts | 10 ++++++++-- types/ember/test/object.ts | 12 ++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index c825647e49..cd4ba0f85f 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -71,13 +71,13 @@ declare module 'ember' { * * Generally you would use `EmberClass.create()` instead of `new EmberClass()`. * - * The no-arg constructor is required by the typescript compiler. + * The single-arg constructor is required by the typescript compiler. * The multi-arg constructor is included for better ergonomics. * * Implementation is carefully chosen for the reasons described in * https://github.com/typed-ember/ember-typings/pull/29 */ - type EmberClassConstructor = (new () => T) & (new (...args: any[]) => T); + type EmberClassConstructor = (new (properties?: object) => T) & (new (...args: any[]) => T); type ComputedPropertyGetterFunction = (this: any, key: string) => T; @@ -761,6 +761,12 @@ declare module 'ember' { } const Copyable: Ember.Mixin; class CoreObject { + /** + * As of Ember 3.1, CoreObject constructor takes initial object properties as an argument. + * See: https://github.com/emberjs/ember.js/commit/4709935854d4c29b0d2c054614d53fa2c55309b1 + **/ + constructor(properties?: object); + _super(...args: any[]): any; /** diff --git a/types/ember/test/object.ts b/types/ember/test/object.ts index cfe2c9380f..e1eefb75e9 100755 --- a/types/ember/test/object.ts +++ b/types/ember/test/object.ts @@ -13,3 +13,15 @@ const LifetimeHooks = Ember.Object.extend({ this._super(); } }); + +class MyObject30 extends Ember.Object { + constructor() { + super(); + } +} + +class MyObject31 extends Ember.Object { + constructor(properties: object) { + super(properties); + } +} From 080eb8f130a06557437ed194a79c53b562ab9257 Mon Sep 17 00:00:00 2001 From: Mikhail Vasin Date: Tue, 17 Apr 2018 01:24:47 +0300 Subject: [PATCH 0683/2153] Change TransitionPlainStyle key type to string (#25003) According to https://github.com/chenglou/react-motion/blob/master/src/Types.js#L56 --- types/react-motion/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-motion/index.d.ts b/types/react-motion/index.d.ts index 2c2958a62e..f4f94095a8 100644 --- a/types/react-motion/index.d.ts +++ b/types/react-motion/index.d.ts @@ -94,7 +94,7 @@ interface TransitionStyle { * Default style for transition */ interface TransitionPlainStyle { - key: any; + key: string; data?: any; // same as TransitionStyle, passed as argument to style/children function style: PlainStyle; From 5c5ffcc7c9a84f884db5fdea7b36dda3d709c386 Mon Sep 17 00:00:00 2001 From: ufolux Date: Tue, 17 Apr 2018 06:25:09 +0800 Subject: [PATCH 0684/2153] add missing property for ReduxLoggerOptions (#24991) * add missing property for ReduxLoggerOptions add titleFormatter property type definition for ReduxLoggerOptions * fix ci error fix no-trailing-whitespace error --- types/redux-logger/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/redux-logger/index.d.ts b/types/redux-logger/index.d.ts index c8ca66eda0..0d4d1ec386 100644 --- a/types/redux-logger/index.d.ts +++ b/types/redux-logger/index.d.ts @@ -50,6 +50,7 @@ export interface ReduxLoggerOptions { duration?: boolean; timestamp?: boolean; colors?: ColorsObject | false; + titleFormatter?(formattedAction: any, formattedTime: string, took: number): string; logger?: any; logErrors?: boolean; collapsed?: boolean | LoggerPredicate; From 8030410d9be2dbdd2851ed0f199ed3c869bad61d Mon Sep 17 00:00:00 2001 From: heroboy Date: Tue, 17 Apr 2018 06:25:29 +0800 Subject: [PATCH 0685/2153] Update three-core.d.ts (#24989) add `optionalTarget` parameter --- types/three/three-core.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 2ec61c82cd..d08d7ad1db 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -6586,13 +6586,13 @@ export class Curve { * Returns a vector for point t of the curve where t is between 0 and 1 * getPoint(t: number): T; */ - getPoint(t: number): T; + getPoint(t: number, optionalTarget?: T): T; /** * Returns a vector for point at relative position in curve according to arc length * getPointAt(u: number): T; */ - getPointAt(u: number): T; + getPointAt(u: number, optionalTarget?: T): T; /** * Get sequence of points using getPoint( t ) From 57381ed4fe104217a15890551234a993d8609e0a Mon Sep 17 00:00:00 2001 From: Curtis Maddalozzo Date: Mon, 16 Apr 2018 23:26:17 +0100 Subject: [PATCH 0686/2153] raven: Add definitions for transports (#24918) * Add definitions for transports * Fix transport option. Add tests. * Bump version * Fix linting error --- types/raven/index.d.ts | 46 +++++++++++++++++++++++++++++++++----- types/raven/raven-tests.ts | 5 ++++- 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/types/raven/index.d.ts b/types/raven/index.d.ts index db59721513..5d478a496b 100644 --- a/types/raven/index.d.ts +++ b/types/raven/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for raven 2.1 +// Type definitions for raven 2.5 // Project: https://github.com/getsentry/raven-node // Definitions by: Scott Cooper // Dmitrii Sorin @@ -7,7 +7,9 @@ /// -import { IncomingMessage, ServerResponse } from 'http'; +import { + IncomingMessage, ServerResponse, OutgoingHttpHeaders, Agent, ClientRequest +} from 'http'; import { EventEmitter } from 'events'; // expose all methods of `Client` class since raven exposes a singleton instance @@ -81,7 +83,7 @@ export interface ConstructorOptions { sampleRate?: number; sendTimeout?: number; shouldSendCallback?: ShouldSendCallback; - transport?: TransportCallback; + transport?: transports.Transport; captureUnhandledRejections?: boolean; maxBreadcrumbs?: number; autoBreadcrumbs?: boolean | { [breadcrumbType: string]: boolean }; @@ -113,8 +115,6 @@ export type DataCallback = (data: { [key: string]: any }) => any; export type ShouldSendCallback = (data: { [key: string]: any }) => boolean; -export type TransportCallback = (options: { [key: string]: any }) => void; - export interface CaptureOptions { tags?: { [key: string]: string }; extra?: { [key: string]: any }; @@ -123,3 +123,39 @@ export interface CaptureOptions { req?: IncomingMessage; user?: any; } + +export namespace transports { + interface HTTPTransportOptions { + hostname?: string; + path?: string; + headers?: OutgoingHttpHeaders; + method?: 'POST' | 'GET'; + port?: number; + ca?: string; + agent?: Agent; + } + abstract class Transport extends EventEmitter { + abstract send( + client: Client, + message: any, + headers: OutgoingHttpHeaders, + eventId: string, + cb: CaptureCallback + ): void; + } + class HTTPTransport extends Transport { + defaultPort: string; + options: HTTPTransportOptions; + agent: Agent; + constructor(options?: HTTPTransportOptions); + send( + client: Client, + message: any, + headers: OutgoingHttpHeaders, + eventId: string, + cb: CaptureCallback + ): void; + } + class HTTPSTransport extends HTTPTransport { + } +} diff --git a/types/raven/raven-tests.ts b/types/raven/raven-tests.ts index 927125f84f..6191f8f89d 100644 --- a/types/raven/raven-tests.ts +++ b/types/raven/raven-tests.ts @@ -10,8 +10,11 @@ Raven.config(dsn, { }); console.log(Raven.version); +const transport = new Raven.transports.HTTPTransport(); + Raven.config({ - release: 'foobar' + release: 'foobar', + transport }); client.setContext({}); client.on('logged', () => { }); From 9840f8c2e4f43c40c6f5068e953b5ba4661b53c5 Mon Sep 17 00:00:00 2001 From: Jarom Loveridge Date: Mon, 16 Apr 2018 16:35:32 -0600 Subject: [PATCH 0687/2153] Add types for `muri` (#25039) * Add muri types. * Resolve linting issues. * Remove unnecessary TypeScript version specification. --- types/muri/index.d.ts | 31 +++++++++++++++++++++++++++++++ types/muri/muri-tests.ts | 20 ++++++++++++++++++++ types/muri/tsconfig.json | 23 +++++++++++++++++++++++ types/muri/tslint.json | 1 + 4 files changed, 75 insertions(+) create mode 100644 types/muri/index.d.ts create mode 100644 types/muri/muri-tests.ts create mode 100644 types/muri/tsconfig.json create mode 100644 types/muri/tslint.json diff --git a/types/muri/index.d.ts b/types/muri/index.d.ts new file mode 100644 index 0000000000..1e3658fa61 --- /dev/null +++ b/types/muri/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for muri 1.3 +// Project: https://github.com/aheckmann/muri +// Definitions by: jloveridge +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = Muri; + +declare function Muri(uri: string): Muri.ParsedUri; + +declare namespace Muri { + interface ParsedUri { + db: string; + hosts: Host[]; + options: any; + auth?: { + user: string; + pass?: string; + }; + } + + interface DefaultHost { + host: string; + port: number; + } + + interface SocketHost { + ipc: string; + } + + type Host = DefaultHost | SocketHost; +} diff --git a/types/muri/muri-tests.ts b/types/muri/muri-tests.ts new file mode 100644 index 0000000000..28c843bd36 --- /dev/null +++ b/types/muri/muri-tests.ts @@ -0,0 +1,20 @@ +import muri = require('muri'); + +const parsed = { + authenticated: { + default: muri('mongodb://admin@locahost'), + user: muri('mongodb://admin@localhost:27017/test'), + userAndPass: muri('mongodb://admin:password@localhost:27017/test'), + }, + replset: { + default: muri('mongodb://localhost:27017,localhost:27018,localhost:27019/test?replicaSet=replset'), + ssl: muri('mongodb://localhost:27017,localhost:27018,localhost:27019/test?replicaSet=replset&ssl=true'), + }, + simple: { + default: muri('mongodb://localhost'), + portSpecified: muri('mongodb://localhost:27017/test'), + }, + unixSocket: { + default: muri('mongodb://local.sock'), + }, +}; diff --git a/types/muri/tsconfig.json b/types/muri/tsconfig.json new file mode 100644 index 0000000000..737fc3a1f2 --- /dev/null +++ b/types/muri/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "muri-tests.ts" + ] +} \ No newline at end of file diff --git a/types/muri/tslint.json b/types/muri/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/muri/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From a67c35269ab4a94ea9278c7edf0d86ad426bc8c3 Mon Sep 17 00:00:00 2001 From: Tomislav Fabeta Date: Tue, 17 Apr 2018 00:38:18 +0200 Subject: [PATCH 0688/2153] Type for schema-registry (#25032) * added schema-registry types * added few more tests * cleaned * removed declare module --- types/schema-registry/index.d.ts | 56 ++++++++++ .../schema-registry/schema-registry-tests.ts | 102 ++++++++++++++++++ types/schema-registry/tsconfig.json | 23 ++++ types/schema-registry/tslint.json | 1 + 4 files changed, 182 insertions(+) create mode 100644 types/schema-registry/index.d.ts create mode 100644 types/schema-registry/schema-registry-tests.ts create mode 100644 types/schema-registry/tsconfig.json create mode 100644 types/schema-registry/tslint.json diff --git a/types/schema-registry/index.d.ts b/types/schema-registry/index.d.ts new file mode 100644 index 0000000000..0b37f6522f --- /dev/null +++ b/types/schema-registry/index.d.ts @@ -0,0 +1,56 @@ +// Type definitions for schema-registry 1.17 +// Project: https://github.com/nodefluent/schema-registry#readme +// Definitions by: Tomislav Fabeta +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// +export interface RegistryClientConfig { + host: string; + port: number; + protocol?: string; + logger?: object; + type?: string; +} + +export interface AvroSchemaResponseInterface { + subject: string; + version: number; + id: number; + schema: any; +} + +export type RegistryRequest = Promise; + +export class LivingAvroSchema extends RegistryClient { + fetch: (poll?: boolean) => RegistryRequest; + toBuffer: (object: object) => Buffer; + fromBuffer: (buffer: Buffer) => any; + on: (...args: any[]) => undefined; + removeListener: (...args: any[]) => undefined; + stop: () => undefined; + constructor(subject: string, version: string, config: RegistryClientConfig); +} + +export class RegistryClient { + host: string; + port: number; + protocol: string; + type: string; + logger: object; + + request: (options: object, expectedStatusCode: number) => RegistryRequest; + isAlive: () => RegistryRequest; + registerSubjectVersion: (subject: string, schema: object) => RegistryRequest; + getVersionsForSubject: (subject: string) => RegistryRequest; + getConfig: () => RegistryRequest; + setConfig: (config: object) => RegistryRequest; + setSubjectConfig: (subject: string, config: object) => RegistryRequest; + getSubjectConfig: (subject: string) => RegistryRequest; + getSchemaById: (id: number) => RegistryRequest; + getSubjects: () => RegistryRequest; + getSubjectSchemaForVersion: (subject: string, version: number) => RegistryRequest; + getLatestSubjectSchema: (subject: string) => RegistryRequest; + checkSubjectRegistration: (subject: string, schema: object) => RegistryRequest; + constructor(config: RegistryClientConfig); +} diff --git a/types/schema-registry/schema-registry-tests.ts b/types/schema-registry/schema-registry-tests.ts new file mode 100644 index 0000000000..fc20fd5bdc --- /dev/null +++ b/types/schema-registry/schema-registry-tests.ts @@ -0,0 +1,102 @@ +import { RegistryClient, RegistryRequest, LivingAvroSchema } from "schema-registry"; + +const config = { + host: "host", port: 2, +}; +const registryClient = new RegistryClient(config); +const livingAvroSchema = new LivingAvroSchema("subject", "version", { + host: "host", port: 2, +}); + +// $ExpectType Promise +registryClient.request({}, 2); +// $ExpectError +registryClient.request(); +// $ExpectError +registryClient.request({}); +// $ExpectError +registryClient.request('a'); +// $ExpectError +registryClient.request({}, 'a'); +// $ExpectError +registryClient.request({}, {}); + +// $ExpectType Promise +registryClient.isAlive(); + +// $ExpectType Promise +registryClient.registerSubjectVersion("string", {}); +// $ExpectError +registryClient.registerSubjectVersion(); +// $ExpectError +registryClient.registerSubjectVersion("string"); + +// $ExpectType Promise +registryClient.getVersionsForSubject("string"); +// $ExpectError +registryClient.getVersionsForSubject(); +// $ExpectError +registryClient.getVersionsForSubject({}); + +// $ExpectType Promise +registryClient.getConfig(); + +// $ExpectType Promise +registryClient.setConfig({}); +// $ExpectError +registryClient.setConfig(); +// $ExpectError +registryClient.setConfig("string"); + +// $ExpectType Promise +registryClient.setSubjectConfig("string", {}); +// $ExpectError +registryClient.setSubjectConfig(); +// $ExpectError +registryClient.setSubjectConfig("string"); + +// $ExpectType Promise +registryClient.getSubjectConfig("string"); +// $ExpectError +registryClient.getSubjectConfig(); +// $ExpectError +registryClient.getSubjectConfig({}); + +// $ExpectType Promise +registryClient.getSchemaById(2); +// $ExpectError +registryClient.getSchemaById(); +// $ExpectError +registryClient.getSchemaById('a'); +// $ExpectError +registryClient.getSchemaById({}); + +// $ExpectType Promise +registryClient.getSubjects(); + +// $ExpectType Promise +registryClient.getSubjectSchemaForVersion("string", 2); +// $ExpectError +registryClient.getSubjectSchemaForVersion("string", {}); +// $ExpectError +registryClient.getSubjectSchemaForVersion("string"); +// $ExpectError +registryClient.getSubjectSchemaForVersion({}); + +// $ExpectType Promise +registryClient.getLatestSubjectSchema("string"); +// $ExpectError +registryClient.getLatestSubjectSchema({}); +// $ExpectError +registryClient.getLatestSubjectSchema(2); +// $ExpectError +registryClient.getLatestSubjectSchema(); + +// $ExpectType Promise +registryClient.checkSubjectRegistration("string", {}); +// $ExpectError +registryClient.checkSubjectRegistration("string"); +// $ExpectError +registryClient.checkSubjectRegistration(2); +// $ExpectError +registryClient.checkSubjectRegistration(); diff --git a/types/schema-registry/tsconfig.json b/types/schema-registry/tsconfig.json new file mode 100644 index 0000000000..f8997b0fa3 --- /dev/null +++ b/types/schema-registry/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "schema-registry-tests.ts" + ] +} diff --git a/types/schema-registry/tslint.json b/types/schema-registry/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/schema-registry/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From bbca3b76faabe3ec8cc86ce5f9996251babd04bd Mon Sep 17 00:00:00 2001 From: anderswestberg Date: Tue, 17 Apr 2018 00:39:06 +0200 Subject: [PATCH 0689/2153] Added typings for network-interfaces (#25027) * Added typings for network-interfaces * Added typings for network-interfaces * Corrected build errors --- types/network-interfaces/index.d.ts | 10 ++++++++ .../network-interfaces-tests.ts | 22 ++++++++++++++++++ types/network-interfaces/tsconfig.json | 23 +++++++++++++++++++ types/network-interfaces/tslint.json | 1 + 4 files changed, 56 insertions(+) create mode 100644 types/network-interfaces/index.d.ts create mode 100644 types/network-interfaces/network-interfaces-tests.ts create mode 100644 types/network-interfaces/tsconfig.json create mode 100644 types/network-interfaces/tslint.json diff --git a/types/network-interfaces/index.d.ts b/types/network-interfaces/index.d.ts new file mode 100644 index 0000000000..99b58a23aa --- /dev/null +++ b/types/network-interfaces/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for network-interfaces 1.1 +// Project: https://github.com/Wizcorp/network-interfaces#readme +// Definitions by: Anders Westberg +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function toIp(interfaceName: string, options: {}): string; +export function toIps(interfaceName: string, options: {}): string[]; +export function fromIp(ip: string, options: {}): string; +export function getInterface(options: {}): string; +export function getInterfaces(options: {}): string[]; diff --git a/types/network-interfaces/network-interfaces-tests.ts b/types/network-interfaces/network-interfaces-tests.ts new file mode 100644 index 0000000000..a4cb71104a --- /dev/null +++ b/types/network-interfaces/network-interfaces-tests.ts @@ -0,0 +1,22 @@ +/// +import * as ni from "network-interfaces"; +import * as os from "os"; + +const options = { + internal: false, // boolean: only acknowledge internal or external addresses (undefined: both) + ipVersion: 4 // integer (4 or 6): only acknowledge addresses of this IP address family (undefined: both) +}; + +function test() { + try { + const ifcName = os.platform() !== "win32" ? "eth0" : "Ethernet"; + const ip = ni.toIp(ifcName, options); + const ipList = ni.toIps(ifcName, options); + let ifc = ni.getInterface(options); + const ifcList = ni.getInterfaces(ifcName); + ifc = ni.fromIp(ip, options); + } catch (e) { + } +} + +test(); diff --git a/types/network-interfaces/tsconfig.json b/types/network-interfaces/tsconfig.json new file mode 100644 index 0000000000..f7067486d8 --- /dev/null +++ b/types/network-interfaces/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "network-interfaces-tests.ts" + ] +} diff --git a/types/network-interfaces/tslint.json b/types/network-interfaces/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/network-interfaces/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 600f6819133666a347a147798cd7c5650313d0d0 Mon Sep 17 00:00:00 2001 From: Arne Schubert Date: Tue, 17 Apr 2018 00:50:56 +0200 Subject: [PATCH 0690/2153] Add type definition for is-ci (#25016) * Add type defintions for the is-ci package * Apply settings from generator * Merge changes from generator * Set strictFunctionChecks to true --- types/is-ci/index.d.ts | 8 ++++++++ types/is-ci/is-ci-tests.ts | 5 +++++ types/is-ci/tsconfig.json | 23 +++++++++++++++++++++++ types/is-ci/tslint.json | 1 + 4 files changed, 37 insertions(+) create mode 100644 types/is-ci/index.d.ts create mode 100644 types/is-ci/is-ci-tests.ts create mode 100644 types/is-ci/tsconfig.json create mode 100644 types/is-ci/tslint.json diff --git a/types/is-ci/index.d.ts b/types/is-ci/index.d.ts new file mode 100644 index 0000000000..6e9e3a7b5b --- /dev/null +++ b/types/is-ci/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for is-ci 1.1 +// Project: https://github.com/watson/is-ci +// Definitions by: Arne Schubert +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = is_ci; + +declare const is_ci: boolean; diff --git a/types/is-ci/is-ci-tests.ts b/types/is-ci/is-ci-tests.ts new file mode 100644 index 0000000000..a4f5a7c32c --- /dev/null +++ b/types/is-ci/is-ci-tests.ts @@ -0,0 +1,5 @@ +import isCi = require('is-ci'); + +let booleanValue: boolean; + +booleanValue = isCi; diff --git a/types/is-ci/tsconfig.json b/types/is-ci/tsconfig.json new file mode 100644 index 0000000000..5fed6d1779 --- /dev/null +++ b/types/is-ci/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "is-ci-tests.ts" + ] +} diff --git a/types/is-ci/tslint.json b/types/is-ci/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-ci/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 521725e9abe7bab8423b72d620c8665f086da4af Mon Sep 17 00:00:00 2001 From: Mtsg Date: Tue, 17 Apr 2018 07:51:24 +0900 Subject: [PATCH 0691/2153] Add type definitions for react-router-param-link. (#25004) * Add type definitions for react-router-param-link. * Declare TypeScript version. --- types/react-router-param-link/index.d.ts | 10 ++++++++ .../react-router-param-link-tests.tsx | 5 ++++ types/react-router-param-link/tsconfig.json | 25 +++++++++++++++++++ types/react-router-param-link/tslint.json | 3 +++ 4 files changed, 43 insertions(+) create mode 100644 types/react-router-param-link/index.d.ts create mode 100644 types/react-router-param-link/react-router-param-link-tests.tsx create mode 100644 types/react-router-param-link/tsconfig.json create mode 100644 types/react-router-param-link/tslint.json diff --git a/types/react-router-param-link/index.d.ts b/types/react-router-param-link/index.d.ts new file mode 100644 index 0000000000..1b168839f5 --- /dev/null +++ b/types/react-router-param-link/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for react-router-param-link 1.0 +// Project: https://github.com/mtsg/react-router-param-link +// Definitions by: Motosugi Murata +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from "react"; +import { LinkProps } from "react-router-dom"; + +export class ParamLink extends React.Component { } diff --git a/types/react-router-param-link/react-router-param-link-tests.tsx b/types/react-router-param-link/react-router-param-link-tests.tsx new file mode 100644 index 0000000000..6de0efaef9 --- /dev/null +++ b/types/react-router-param-link/react-router-param-link-tests.tsx @@ -0,0 +1,5 @@ +import * as React from "react"; +import { ParamLink } from "react-router-param-link"; + +; +; diff --git a/types/react-router-param-link/tsconfig.json b/types/react-router-param-link/tsconfig.json new file mode 100644 index 0000000000..372a4076a5 --- /dev/null +++ b/types/react-router-param-link/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "jsx": "react", + "strictNullChecks": true, + "strictFunctionTypes": true, + "noImplicitAny": true, + "noImplicitThis": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "react-router-param-link-tests.tsx" + ] +} diff --git a/types/react-router-param-link/tslint.json b/types/react-router-param-link/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/react-router-param-link/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From bca34de857ac0efcc4e52319a097bfe14c8d69bf Mon Sep 17 00:00:00 2001 From: Tareq El-Masri Date: Tue, 17 Apr 2018 00:52:31 +0200 Subject: [PATCH 0692/2153] [ADD] Typings for wix/detox (#25005) * [ADD] Wix Detox Types * [FIX] Detox Definiations lint error * [FIX] Lint issues --- types/detox/detox-tests.ts | 22 ++ types/detox/index.d.ts | 408 +++++++++++++++++++++++++++++++++++++ types/detox/tsconfig.json | 24 +++ types/detox/tslint.json | 3 + 4 files changed, 457 insertions(+) create mode 100644 types/detox/detox-tests.ts create mode 100644 types/detox/index.d.ts create mode 100644 types/detox/tsconfig.json create mode 100644 types/detox/tslint.json diff --git a/types/detox/detox-tests.ts b/types/detox/detox-tests.ts new file mode 100644 index 0000000000..82e3a62d3a --- /dev/null +++ b/types/detox/detox-tests.ts @@ -0,0 +1,22 @@ +declare var describe: (test: string, callback: () => void) => void; +declare var beforeAll: (callback: () => void) => void; +declare var afterAll: (callback: () => void) => void; +declare var test: (test: string, callback: () => void) => void; + +describe('Test', () => { + beforeAll(async () => { + await device.reloadReactNative(); + }); + + afterAll(async () => { + await element(by.id('element')).clearText(); + }); + + test('Test', async () => { + await element(by.id('element')).replaceText('text'); + await element(by.id('element')).tap(); + await expect(element(by.id('element')).atIndex(0)).toNotExist(); + + await waitFor(element(by.id('element'))).toBeVisible().withTimeout(2000); + }); +}); diff --git a/types/detox/index.d.ts b/types/detox/index.d.ts new file mode 100644 index 0000000000..f4479ff4db --- /dev/null +++ b/types/detox/index.d.ts @@ -0,0 +1,408 @@ +// Type definitions for detox 7.3 +// Project: https://github.com/wix/detox +// Definitions by: Tareq El-Masri +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare const detox: Detox.Detox; +declare const device: Detox.Device; +declare const element: Detox.Element; +declare const waitFor: Detox.WaitFor; +declare const expect: Detox.Expect>; +declare const by: Detox.Matchers; + +declare namespace Detox { + interface Detox { + /** + * The setup phase happens inside detox.init(). This is the phase where detox reads its configuration, starts a server, loads its expection library and starts a simulator + * @param config + * @param options + * @example const config = require('../package.json').detox; + * + * before(async () => { + * await detox.init(config); + * }); + */ + init(config: any, options: DetoxInitOptions): Promise; + /** + * Artifacts currently include only logs from the app process before each task + * @param args + */ + beforeEach(...args: any[]): Promise; + /** + * Artifacts currently include only logs from the app process after each task + * @param args + */ + afterEach(...args: any[]): Promise; + /** + * The cleanup phase should happen after all the tests have finished. This is the phase where detox-server shuts down. + * @example after(async () => { + * await detox.cleanup(); + * }); + */ + cleanup(): Promise; + } + interface Device { + /** + * Launch the app + * @param config + * @example // Terminate the app and launch it again. If set to false, the simulator will try to bring app from background, + * // if the app isn't running, it will launch a new instance. default is false + * await device.launchApp({newInstance: true}); + * // Grant or deny runtime permissions for your application. + * await device.launchApp({permissions: {calendar: 'YES'}}); + * // Mock opening the app from URL to test your app's deep link handling mechanism. + * await device.launchApp({url: url}); + */ + launchApp(config: DeviceLanchAppConfig): Promise; + /** + * By default, terminateApp() with no params will terminate the app + * To terminate another app, specify its bundle id + * @param bundle + * @example await device.terminateApp('other.bundle.id'); + */ + terminateApp(bundle?: string): Promise; + /** + * Send application to background by bringing com.apple.springboard to the foreground. + * Combining sendToHome() with launchApp({newInstance: false}) will simulate app coming back from background. + * @example await device.sendToHome(); + * await device.launchApp({newInstance: false}); + */ + sendToHome(): Promise; + /** + * If this is a React Native app, reload the React Native JS bundle. This action is much faster than device.launchApp(), and can be used if you just need to reset your React Native logic. + * @example await device.reloadReactNative() + */ + reloadReactNative(): Promise; + /** + * By default, installApp() with no params will install the app file defined in the current configuration. + * To install another app, specify its path + * @param path + * @example await device.installApp('path/to/other/app'); + */ + installApp(path?: any): Promise; + /** + * By default, uninstallApp() with no params will uninstall the app defined in the current configuration. + * To uninstall another app, specify its bundle id + * @param bundle + * @example await device.installApp('other.bundle.id'); + */ + uninstallApp(bundle?: string): Promise; + /** + * Mock opening the app from URL. sourceApp is an optional parameter to specify source application bundle id. + * @param url + */ + openURL(url: {url: string, sourceApp?: string}): Promise; + /** + * Mock handling of received user notification when app is in foreground. + * @param params + */ + sendUserNotification(...params: any[]): Promise; + /** + * Mock handling of received user activity when app is in foreground. + * @param params + */ + sendUserActivity(...params: any[]): Promise; + /** + * Takes "portrait" or "landscape" and rotates the device to the given orientation. Currently only available in the iOS Simulator. + * @param orientation + */ + setOrientation(orientation: Orientation): Promise; + /** + * Note: setLocation is dependent on fbsimctl. if fbsimctl is not installed, the command will fail, it must be installed. Sets the simulator location to the given latitude and longitude. + * @param lat + * @param lon + * @example await device.setLocation(32.0853, 34.7818); + */ + setLocation(lat: number, lon: number): Promise; + /** + * Disable EarlGrey's network synchronization mechanism on preffered endpoints. Usful if you want to on skip over synchronizing on certain URLs. + * @param urls + * @example await device.setURLBlacklist(['.*127.0.0.1.*']); + */ + setURLBlacklist(urls: string[]): Promise; + /** + * Enable EarlGrey's synchronization mechanism (enabled by default). This is being reset on every new instance of the app. + * @example await device.enableSynchronization(); + */ + enableSynchronization(): Promise; + /** + * Disable EarlGrey's synchronization mechanism (enabled by default) This is being reset on every new instance of the app. + * @example await device.disableSynchronization(); + */ + disableSynchronization(): Promise; + /** + * Resets the Simulator to clean state (like the Simulator > Reset Content and Settings... menu item), especially removing previously set permissions. + * @example await device.resetContentAndSettings(); + */ + resetContentAndSettings(): Promise; + /** + * Returns the current device, ios or android. + * @example if (device.getPlatform() === 'ios') { + * await expect(loopSwitch).toHaveValue('1'); + * } + */ + getPlatform(): "ios" | "android"; + /** + * Simulate shake (iOS Only) + */ + shake(): Promise; + } + + type DetoxAny = Element & Actions & WaitFor; + + interface Element { + (by: Matchers): DetoxAny; + + /** + * Select by parent element + * @param parent + * @example await element(by.id('Grandson883').withAncestor(by.id('Son883'))); + */ + withAncestor(parent: Element): DetoxAny; + /** + * Select by child element + * @param parent + * @example await element(by.id('Son883').withDescendant(by.id('Grandson883'))); + */ + withDescendant(child: Element): DetoxAny; + /** + * Choose from multiple elements matching the same matcher using index + * @param index + * @example await element(by.text('Product')).atIndex(2); + */ + atIndex(index: number): DetoxAny; + } + interface Matchers { + /** + * by.id will match an id that is given to the view via testID prop. + * @param id + * @example // In a React Native component add testID like so: + * + * // Then match with by.id: + * await element(by.id('tap_me')); + */ + id(id: string): Matchers; + /** + * Find an element by text, useful for text fields, buttons. + * @param text + * @example await element(by.text('Tap Me')); + */ + text(text: string): Matchers; + /** + * Find an element by accessibilityLabel on iOS, or by contentDescription on Android. + * @param label + * @example await element(by.label('Welcome')); + */ + label(label: string): Matchers; + /** + * Find an element by native view type. + * @param nativeViewType + * @example await element(by.type('RCTImageView')); + */ + type(nativeViewType: string): Matchers; + /** + * Find an element with an accessibility trait. (iOS only) + * @example await element(by.traits(['button'])); + */ + traits(traits: string[]): Matchers; + } + interface Expect { + (element: Element): Expect; + /** + * Expect the view to be at least 75% visible. + * @example await expect(element(by.id('UniqueId204'))).toBeVisible(); + */ + toBeVisible(): R; + /** + * Expect the view to not be visible. + * @example await expect(element(by.id('UniqueId205'))).toBeNotVisible(); + */ + toBeNotVisible(): R; + /** + * Expect the view to exist in the UI hierarchy. + * @example await expect(element(by.id('UniqueId205'))).toExist(); + */ + toExist(): R; + /** + * Expect the view to not exist in the UI hierarchy. + * @example await expect(element(by.id('RandomJunk959'))).toNotExist(); + */ + toNotExist(): R; + /** + * In React Native apps, expect UI component of type to have text. + * In native iOS apps, expect UI elements of type UIButton, UILabel, UITextField or UITextViewIn to have inputText with text. + * @param text + * @example await expect(element(by.id('UniqueId204'))).toHaveText('I contain some text'); + */ + toHaveText(text: string): R; + /** + * It searches by accessibilityLabel on iOS, or by contentDescription on Android. + * In React Native it can be set for both platforms by defining an accessibilityLabel on the view. + * @param label + * @example await expect(element(by.id('UniqueId204'))).toHaveLabel('Done'); + */ + toHaveLabel(label: string): R; + /** + * In React Native apps, expect UI component to have testID with that id. + * In native iOS apps, expect UI element to have accesibilityIdentifier with that id. + * @param id + * @example await expect(element(by.text('I contain some text'))).toHaveId('UniqueId204'); + */ + toHaveId(id: string): R; + /** + * Expect components like a Switch to have a value ('0' for off, '1' for on). + * @param value + * @example await expect(element(by.id('UniqueId533'))).toHaveValue('0'); + */ + toHaveValue(value: any): R; + } + interface WaitFor { + /** + * This API polls using the given expectation continuously until the expectation is met. Use manual synchronization with waitFor only as a last resort. + * NOTE: Every waitFor call must set a timeout using withTimeout(). Calling waitFor without setting a timeout will do nothing. + * @example await waitFor(element(by.id('UniqueId336'))).toExist().withTimeout(2000); + */ + (element: Element): Expect; + /** + * Waits for the condition to be met until the specified time (millis) have elapsed. + * @param millis number + * @example await waitFor(element(by.id('UniqueId336'))).toExist().withTimeout(2000); + */ + withTimeout(millis: number): Promise; + /** + * Performs the action repeatedly on the element until an expectation is met + * @param element + * @example await waitFor(element(by.text('Text5'))).toBeVisible().whileElement(by.id('ScrollView630')).scroll(50, 'down'); + */ + whileElement(by: Matchers): Element; + } + interface Actions { + /** + * Simulate tap on an element + * @example await element(by.id('tappable')).tap(); + */ + tap(): Promise>; + /** + * Simulate long press on an element + * @example await element(by.id('tappable')).longPress(); + */ + longPress(): Promise>; + /** + * Simulate multiple taps on an element. + * @param times number + * @example await element(by.id('tappable')).multiTap(3); + */ + multiTap(times: number): Promise>; + /** + * Simulate tap at a specific point on an element. + * Note: The point coordinates are relative to the matched element and the element size could changes on different devices or even when changing the device font size. + * @param point + * @example await element(by.id('tappable')).tapAtPoint({ x:5, y:10 }); + */ + tapAtPoint(point: { x: number, y: number }): Promise>; + /** + * Use the builtin keyboard to type text into a text field. + * @param text + * @example await element(by.id('textField')).typeText('passcode'); + */ + typeText(text: string): Promise>; + /** + * Paste text into a text field. + * @param text + * @example await element(by.id('textField')).replaceText('passcode again'); + */ + replaceText(text: string): Promise>; + /** + * Clear text from a text field. + * @example await element(by.id('textField')).clearText(); + */ + clearText(): Promise>; + /** + * + * @param pixels + * @param direction + * @example + * await element(by.id('scrollView')).scroll(100, 'down'); + * await element(by.id('scrollView')).scroll(100, 'up'); + */ + scroll(pixels: number, direction: Direction): Actions>; + /** + * Scroll to edge. + * @param edge + * @example await element(by.id('scrollView')).scrollTo('bottom'); + * await element(by.id('scrollView')).scrollTo('top'); + */ + scrollTo(edge: Direction): Actions>; + /** + * + * @param direction + * @param speed + * @param percentage + * @example await element(by.id('scrollView')).swipe('down'); + * await element(by.id('scrollView')).swipe('down', 'fast'); + * await element(by.id('scrollView')).swipe('down', 'fast', 0.5); + */ + swipe(direction: Direction, speed?: Speed, percentage?: number): Actions>; + /** + * (iOS Only) column - number of datepicker column (starts from 0) value - string value in setted column (must be correct) + * @param column + * @param value + * @example await expect(element(by.type('UIPickerView'))).toBeVisible(); + * await element(by.type('UIPickerView')).setColumnToValue(1,"6"); + * await element(by.type('UIPickerView')).setColumnToValue(2,"34"); + */ + setColumnToValue(column: number, value: string): Actions>; + } + + type Direction = "left" | "right" | "top" | "bottom" | "up" | "down"; + type Orientation = "portrait" | "landscape"; + type Speed = "fast" | "slow"; + + interface DetoxInitOptions { + /** + * Detox exports device, expect, element, by and waitFor as globals by default, if you want to control their initialization manually, set init detox with initGlobals set to false. + * This is useful when during E2E tests you also need to run regular expectations in node. jest Expect for instance, will not be overriden by Detox when this option is used. + */ + initGlobals?: boolean; + /** + * By default await detox.init(config); will launch the installed app. If you wish to control when your app is launched, add {launchApp: false} param to your init. + */ + launchApp?: boolean; + } + + interface DeviceLanchAppConfig { + /** + * Restart the app + * Terminate the app and launch it again. If set to false, the simulator will try to bring app from background, if the app isn't running, it will launch a new instance. default is false + */ + newInstance?: boolean; + /** + * Set runtime permissions + * Grant or deny runtime permissions for your application. + */ + permissions?: any; + /** + * Launch from URL + * Mock opening the app from URL to test your app's deep link handling mechanism. + */ + url?: any; + /** + * Launch with user notifications + */ + userNotification?: any; + /** + * Launch with user activity + */ + userActivity?: any; + /** + * Launch into a fresh installation + * A flag that enables relaunching into a fresh installation of the app (it will uninstall and install the binary again), default is false. + */ + delete?: boolean; + /** + * Detox can start the app with additional launch arguments + * The added launchArgs will be passed through the launch command to the device and be accessible via [[NSProcessInfo processInfo] arguments] + */ + launchArgs?: any; + } +} diff --git a/types/detox/tsconfig.json b/types/detox/tsconfig.json new file mode 100644 index 0000000000..2d1a22fb79 --- /dev/null +++ b/types/detox/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "target": "ES2015", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "detox-tests.ts" + ] +} diff --git a/types/detox/tslint.json b/types/detox/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/detox/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 228dd564c076177351aaaf783f5c90bf1e7856fb Mon Sep 17 00:00:00 2001 From: Pine Mizune Date: Tue, 17 Apr 2018 09:40:11 +0900 Subject: [PATCH 0693/2153] add `event-hooks-webpack-plugin` (#24998) --- .../event-hooks-webpack-plugin-tests.ts | 32 ++++++++++++++ types/event-hooks-webpack-plugin/index.d.ts | 42 +++++++++++++++++++ .../event-hooks-webpack-plugin/tsconfig.json | 23 ++++++++++ types/event-hooks-webpack-plugin/tslint.json | 1 + 4 files changed, 98 insertions(+) create mode 100644 types/event-hooks-webpack-plugin/event-hooks-webpack-plugin-tests.ts create mode 100644 types/event-hooks-webpack-plugin/index.d.ts create mode 100644 types/event-hooks-webpack-plugin/tsconfig.json create mode 100644 types/event-hooks-webpack-plugin/tslint.json diff --git a/types/event-hooks-webpack-plugin/event-hooks-webpack-plugin-tests.ts b/types/event-hooks-webpack-plugin/event-hooks-webpack-plugin-tests.ts new file mode 100644 index 0000000000..b55f55d85f --- /dev/null +++ b/types/event-hooks-webpack-plugin/event-hooks-webpack-plugin-tests.ts @@ -0,0 +1,32 @@ +import EventHooksPlugin = require('event-hooks-webpack-plugin'); + +new EventHooksPlugin({}); +new EventHooksPlugin({ + done: () => {}, +}); +new EventHooksPlugin({ + shouldEmit: () => {}, + done: () => {}, + additionalPass: () => {}, + beforeRun: () => {}, + run: () => {}, + emit: () => {}, + afterEmit: () => {}, + thisCompilation: () => {}, + compilation: () => {}, + normalModuleFactory: () => {}, + contextModuleFactory: () => {}, + beforeCompile: () => {}, + compile: () => {}, + make: () => {}, + afterCompile: () => {}, + watchRun: () => {}, + failed: () => {}, + invalid: () => {}, + watchClose: () => {}, + environment: () => {}, + afterEnvironment: () => {}, + afterPlugins: () => {}, + afterResolvers: () => {}, + entryOption: () => {}, +}); diff --git a/types/event-hooks-webpack-plugin/index.d.ts b/types/event-hooks-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..ceb78cd3e6 --- /dev/null +++ b/types/event-hooks-webpack-plugin/index.d.ts @@ -0,0 +1,42 @@ +// Type definitions for event-hooks-webpack-plugin 2.0 +// Project: https://github.com/cascornelissen/event-hooks-webpack-plugin +// Definitions by: Pine Mizune +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Plugin } from 'webpack'; + +export = EventHooksPlugin; + +declare namespace EventHooksPlugin { + interface Options { + shouldEmit?: () => void; + done?: () => void; + additionalPass?: () => void; + beforeRun?: () => void; + run?: () => void; + emit?: () => void; + afterEmit?: () => void; + thisCompilation?: () => void; + compilation?: () => void; + normalModuleFactory?: () => void; + contextModuleFactory?: () => void; + beforeCompile?: () => void; + compile?: () => void; + make?: () => void; + afterCompile?: () => void; + watchRun?: () => void; + failed?: () => void; + invalid?: () => void; + watchClose?: () => void; + environment?: () => void; + afterEnvironment?: () => void; + afterPlugins?: () => void; + afterResolvers?: () => void; + entryOption?: () => void; + } +} + +declare class EventHooksPlugin extends Plugin { + constructor(options?: EventHooksPlugin.Options); +} diff --git a/types/event-hooks-webpack-plugin/tsconfig.json b/types/event-hooks-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..51562ab223 --- /dev/null +++ b/types/event-hooks-webpack-plugin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "event-hooks-webpack-plugin-tests.ts" + ] +} diff --git a/types/event-hooks-webpack-plugin/tslint.json b/types/event-hooks-webpack-plugin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/event-hooks-webpack-plugin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 0bab723bac6ce966d1364b694029d74908851d9a Mon Sep 17 00:00:00 2001 From: Eugene Matseruk <36712576+ematseruk@users.noreply.github.com> Date: Tue, 17 Apr 2018 03:41:11 +0300 Subject: [PATCH 0694/2153] Implement typings for v4.2 of http://idangero.us/swiper (#24898) - Move typings for v3 to the separate v3 folder - Implement typings for v4.2 - Implement tests for typings --- types/swiper/index.d.ts | 670 +++++++++++++--------- types/swiper/swiper-tests.ts | 980 +++++++++++++++++++------------- types/swiper/tsconfig.json | 2 +- types/swiper/v3/index.d.ts | 339 +++++++++++ types/swiper/v3/swiper-tests.ts | 563 ++++++++++++++++++ types/swiper/v3/tsconfig.json | 33 ++ types/swiper/v3/tslint.json | 8 + 7 files changed, 1919 insertions(+), 676 deletions(-) create mode 100644 types/swiper/v3/index.d.ts create mode 100644 types/swiper/v3/swiper-tests.ts create mode 100644 types/swiper/v3/tsconfig.json create mode 100644 types/swiper/v3/tslint.json diff --git a/types/swiper/index.d.ts b/types/swiper/index.d.ts index 65872facd2..19c381fe28 100644 --- a/types/swiper/index.d.ts +++ b/types/swiper/index.d.ts @@ -1,12 +1,195 @@ -// Type definitions for Swiper 3.4 +// Type definitions for Swiper 4.2 // Project: https://github.com/nolimits4web/Swiper -// Definitions by: Sebastián Galiano , Luca Trazzi +// Definitions by: Sebastián Galiano , Luca Trazzi , Eugene Matseruk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.7 + +type CommonEvent = + | 'init' + | 'beforeDestroy' + | 'slideChange' + | 'slideChangeTransitionStart' + | 'slideChangeTransitionEnd' + | 'slideNextTransitionStart' + | 'slideNextTransitionEnd' + | 'slidePrevTransitionStart' + | 'slidePrevTransitionEnd' + | 'transitionStart' + | 'transitionEnd' + | 'touchStart' + | 'touchMove' + | 'touchMoveOpposite' + | 'sliderMove' + | 'touchEnd' + | 'click' + | 'tap' + | 'doubleTap' + | 'imagesReady' + | 'progress' + | 'reachBeginning' + | 'reachEnd' + | 'fromEdge' + | 'setTranslate' + | 'setTransition' + | 'resize'; + +type PaginationEvent = 'paginationRender' | 'paginationUpdate'; +type AutoplayEvent = 'autoplayStart' | 'autoplayStop' | 'autoplay'; +type LazyLoadingEvent = 'lazyImageLoad' | 'lazyImageReady'; + +type SwiperEvent = CommonEvent | PaginationEvent | AutoplayEvent | LazyLoadingEvent; + +interface NavigationOptions { + nextEl?: string | HTMLElement; + prevEl?: string | HTMLElement; + hideOnClick?: boolean; + disabledClass?: string; + hiddenClass?: string; +} + +interface PaginationOptions { + el?: string; + type?: 'bullets' | 'fraction' | 'progressbar' | 'custom'; + bulletElement?: string; + dynamicBullets?: boolean; + dynamicMainBullets?: number; + hideOnClick?: boolean; + clickable?: boolean; + progressbarOpposite?: boolean; + + bulletClass?: string; + bulletActiveClass?: string; + modifierClass?: string; + currentClass?: string; + totalClass?: string; + hiddenClass?: string; + progressbarFillClass?: string; + clickableClass?: string; + + renderBullet?: (index: number, className: string) => void; + renderFraction?: (currentClass: string, totalClass: string) => void; + renderProgressbar?: (progressbarFillClass: string) => void; + renderCustom?: (swiper: Swiper, current: number, total: number) => void; +} + +interface ScrollbarOptions { + el?: string | HTMLElement; + hide?: boolean; + draggable?: boolean; + snapOnRelease?: boolean; + dragSize?: 'auto' | number; + lockClass?: 'string'; + dragClass?: 'string'; +} + +interface AutoplayOptions { + delay?: number; + stopOnLastSlide?: boolean; + disableOnInteraction?: boolean; + reverseDirection?: boolean; + waitForTransition?: boolean; +} + +interface LazyLoadingOptions { + loadPrevNext?: string; + loadPrevNextAmount?: number; + loadOnTransitionStart?: boolean; + elementClass?: string; + loadingClass?: string; + loadedClass?: string; + preloaderClass?: string; +} + +interface FadeEffectOptions { + crossFade: boolean; +} + +interface CoverflowEffectOptions { + slideShadows?: boolean; + rotate?: number; + stretch?: number; + depth?: number; + modifier?: number; +} + +interface FlipEffectOptions { + slideShadows?: boolean; + limitRotation?: boolean; +} + +interface CubeEffectOptions { + slideShadows?: boolean; + shadow?: boolean; + shadowOffset: number; + shadowScale: number; +} + +interface ZoomOptions { + maxRatio?: number; + minRatio?: number; + toggle?: boolean; + containerClass?: string; + zoomedSlideClass?: string; +} + +interface KeyboardControlOptions { + enabled?: boolean; + onlyInViewport?: boolean; +} + +interface MouseWheelControlOptions { + forceToAxis?: boolean; + releaseOnEdges?: boolean; + invert?: boolean; + sensitivity?: number; + eventsTarged?: string | HTMLElement; +} + +interface VirtualSlidesRenderExternalData { + offset: number; + from: number; + to: number; + slides: any[]; +} + +interface VirtualSlidesOptions { + slides?: any[]; + cache?: boolean; + renderSlide?: (slide: any, index: number) => void; + renderExternal?: (data: VirtualSlidesRenderExternalData) => void; +} + +interface HashNavigationOptions { + watchState?: boolean; + replaceState?: boolean; +} + +interface HistoryNavigationOptions { + replaceState?: boolean; + key?: string; +} + +interface ControllerOptions { + control: Swiper; + inverse: boolean; + by: 'slide' | 'container'; +} + +interface AccessibilityOptions { + enabled?: boolean; + prevSlideMessage?: string; + nextSlideMessage?: string; + firstSlideMessage?: string; + lastSlideMessage?: string; + paginationBulletMessage?: string; + notificationClass?: string; +} interface SwiperOptions { + // General parameters + init?: boolean; initialSlide?: number; - direction?: string; + direction?: 'horizontal' | 'vertical'; speed?: number; setWrapperSize?: boolean; virtualTranslate?: boolean; @@ -15,15 +198,61 @@ interface SwiperOptions { autoHeight?: boolean; roundLengths?: boolean; nested?: boolean; + uniqueNavElements?: boolean; + effect?: 'slide' | 'fade' | 'cube' | 'coverflow' | 'flip'; + runCallbacksOnInit?: boolean; + watchOverflow?: boolean; + on?: {[key in SwiperEvent]?: () => void }; - // Autoplay - autoplay?: number; - autoplayStopOnLast?: boolean; - autoplayDisableOnInteraction?: boolean; + // Slides grid + spaceBetween?: number; + slidesPerView?: 'auto' | number; + slidesPerColumn?: number; + slidesPerColumnFill?: 'row' | 'column'; + slidesPerGroup?: number; + centeredSlides?: boolean; + slidesOffsetBefore?: number; + slidesOffsetAfter?: number; + normalizeSlideIndex?: boolean; - // Progress - watchSlidesProgress?: boolean; - watchSlidesVisibility?: boolean; + // Grab cursor + grabCursor?: boolean; + + // Touches + touchEventsTarget?: 'container' | 'wrapper'; + touchRatio?: number; + touchAngle?: number; + simulateTouch?: boolean; + shortSwipes?: boolean; + longSwipes?: boolean; + longSwipesRatio?: number; + longSwipesMs?: number; + followFinger?: boolean; + allowTouchMove?: boolean; + threshold?: number; + touchMoveStopPropagation?: boolean; + iOSEdgeSwipeDetection?: boolean; + iOSEdgeSwipeThreshold?: number; + touchReleaseOnEdges?: boolean; + passiveListeners?: boolean; + + // Touch Resistance + resistance?: boolean; + resistanceRatio?: number; + + // Swiping / No swiping + preventIntercationOnTransition?: boolean; + allowSlidePrev?: boolean; + allowSlideNext?: boolean; + noSwiping?: boolean; + noSwipingClass?: string; + noSwipingSelector?: string; + swipeHandler?: string | HTMLElement; + + // Clicks + preventClicks?: boolean; + preventClicksPropagation?: boolean; + slideToClickedSlide?: boolean; // Freemode freeMode?: boolean; @@ -35,305 +264,198 @@ interface SwiperOptions { freeModeMinimumVelocity?: number; freeModeSticky?: boolean; - // Effects - effect?: string; - fade?: {}; - cube?: {}; - coverflow?: {}; - flip?: {}; - - // Parallax - parallax?: boolean; - - // Slides grid - spaceBetween?: number; - slidesPerView?: number | string; - slidesPerColumn?: number; - slidesPerColumnFill?: string; - slidesPerGroup?: number; - centeredSlides?: boolean; - slidesOffsetBefore?: number; - slidesOffsetAfter?: number; - - // Grab Cursor - grabCursor?: boolean; - - // Touches - touchEventsTarget?: string; - touchRatio?: number; - touchAngle?: number; - simulateTouch?: boolean; - shortSwipes?: boolean; - longSwipes?: boolean; - longSwipesRatio?: number; - longSwipesMs?: number; - followFinger?: boolean; - onlyExternal?: boolean; - threshold?: number; - touchMoveStopPropagation?: boolean; - iOSEdgeSwipeDetection?: boolean; - iOSEdgeSwipeThreshold?: number; - - // Touch Resistance - resistance?: boolean; - resistanceRatio?: number; - - // Clicks - preventClicks?: boolean; - preventClicksPropagation?: boolean; - slideToClickedSlide?: boolean; - - // Swiping / No swiping - allowSwipeToPrev?: boolean; - allowSwipeToNext?: boolean; - noSwiping?: boolean; - noSwipingClass?: string; - swipeHandler?: string | Element; - - // Navigation Controls - uniqueNavElements?: boolean; - - // Pagination - pagination?: string | Element; - paginationType?: string; - paginationHide?: boolean; - paginationClickable?: boolean; - paginationElement?: string; - paginationBulletRender?(swiper: Swiper, index: number, className: string): void; - paginationFractionRender?(swiper: Swiper, currentClassName: string, totalClassName: string): void; - paginationProgressRender?(swiper: Swiper, progressbarClass: string): void; - paginationCustomRender?(swiper: Swiper, current: number, total: number): void; - - // Navigation Buttons - nextButton?: string | Element; - prevButton?: string | Element; - - // Scollbar - scrollbar?: string | Element | SwiperScrollbarOptions; - scrollbarHide?: boolean; - scrollbarDraggable?: boolean; - scrollbarSnapOnRelease?: boolean; - - // Accessibility - a11y?: boolean; - prevSlideMessage?: string; - nextSlideMessage?: string; - firstSlideMessage?: string; - lastSlideMessage?: string; - paginationBulletMessage?: string; - - // Keyboard / Mousewheel - keyboardControl?: boolean; - mousewheelControl?: boolean; - mousewheelForceToAxis?: boolean; - mousewheelReleaseOnEdges?: boolean; - mousewheelInvert?: boolean; - mousewheelSensitivity?: number; - - // Hash Navigation - hashnav?: boolean; - hashnavWatchState?: boolean; - history?: string; + // Progress + watchSlidesProgress?: boolean; + watchSlidesVisibility?: boolean; // Images preloadImages?: boolean; updateOnImagesReady?: boolean; - lazyLoading?: boolean; - lazyLoadingInPrevNext?: boolean; - lazyLoadingInPrevNextAmount?: number; - lazyLoadingOnTransitionStart?: boolean; - // Loop loop?: boolean; loopAdditionalSlides?: number; loopedSlides?: number; + loopFillGroupWithBlank?: boolean; - zoom?: boolean; - - // Controller - control?: Swiper; - controlInverse?: boolean; - controlBy?: string; + // Breakpoints + breakpoints?: { + // TODO: extract possible parameters for breakpoints to separate interface + [index: number]: any; + }; // Observer observer?: boolean; observeParents?: boolean; - // Breakpoints - breakpoints?: {}; - - // Callbacks - runCallbacksOnInit?: boolean; - onInit?(swiper: Swiper): void; - onSlideChangeStart?(swiper: Swiper): void; - onSlideChangeEnd?(swiper: Swiper): void; - onSlideNextStart?(swiper: Swiper): void; - onSlideNextEnd?(swiper: Swiper): void; - onSlidePrevStart?(swiper: Swiper): void; - onSlidePrevEnd?(swiper: Swiper): void; - onTransitionStart?(swiper: Swiper): void; - onTransitionEnd?(swiper: Swiper): void; - onTouchStart?(swiper: Swiper, event: Event): void; - onTouchMove?(swiper: Swiper, event: Event): void; - onTouchMoveOpposite?(swiper: Swiper, event: Event): void; - onSliderMove?(swiper: Swiper, event: Event): void; - onTouchEnd?(swiper: Swiper, event: Event): void; - onClick?(swiper: Swiper, event: Event): void; - onTap?(swiper: Swiper, event: Event): void; - onDoubleTap?(swiper: Swiper, event: Event): void; - onImagesReady?(swiper: Swiper): void; - onProgress?(swiper: Swiper, progress: number): void; - onReachBeginning?(swiper: Swiper): void; - onReachEnd?(swiper: Swiper): void; - onDestroy?(swiper: Swiper): void; - onSetTranslate?(swiper: Swiper, translate: any): void; - onSetTransition?(swiper: Swiper, transition: any): void; - onAutoplay?(swiper: Swiper): void; - onAutoplayStart?(swiper: Swiper): void; - onAutoplayStop?(swiper: Swiper): void; - onLazyImageLoad?(swiper: Swiper, slide: any, image: any): void; - onLazyImageReady?(swiper: Swiper, slide: any, image: any): void; - onPaginationRendered?(swiper: Swiper, paginationContainer: any): void; - onScroll?(swiper: Swiper, event: Event): void; - onBeforeResize?(swiper: Swiper): void; - onAfterResize?(swiper: Swiper): void; - onKeyPress?(swiper: Swiper, kc: any): void; - // Namespace + containerModifierClass?: string; slideClass?: string; slideActiveClass?: string; + slideDuplicatedActiveClass?: string; slideVisibleClass?: string; slideDuplicateClass?: string; slideNextClass?: string; + slideDuplicatedNextClass?: string; slidePrevClass?: string; + slideDuplicatedPrevClass?: string; wrapperClass?: string; - bulletClass?: string; - bulletActiveClass?: string; - paginationHiddenClass?: string; - paginationCurrentClass?: string; - paginationTotalClass?: string; - paginationProgressbarClass?: string; - buttonDisabledClass?: string; + + // Components + navigation?: NavigationOptions; + pagination?: PaginationOptions; + scrollbar?: ScrollbarOptions; + autoplay?: AutoplayOptions; + parallax?: boolean; + lazy?: LazyLoadingOptions | boolean; + fadeEffect?: FadeEffectOptions; + coverflowEffect?: CoverflowEffectOptions; + flipEffect?: FlipEffectOptions; + cubeEffect?: CubeEffectOptions; + zoom?: ZoomOptions | boolean; + keyboard?: KeyboardControlOptions | boolean; + mousewheel?: MouseWheelControlOptions | boolean; + virtual?: VirtualSlidesOptions; + hashNavigation?: HashNavigationOptions; + history?: HistoryNavigationOptions; + controller?: ControllerOptions; + a11y?: AccessibilityOptions; } -interface SwiperScrollbarOptions { - container: string; // Default: '.swiper-scrollbar' - draggable?: boolean; // Default: true - hide?: boolean; // Default: true - snapOnRelease?: boolean; // Default: false +interface Navigation { + nextEl: HTMLElement; + prevEl: HTMLElement; + update: () => void; +} +interface Pagination { + el: HTMLElement; + // TODO: dom7 like array + bullets: any[]; + + render: () => void; + update: () => void; } -declare class SwiperSlide { - append(): SwiperSlide; - clone(): SwiperSlide; - getWidth(): number; - getHeight(): number; - getOffset(): { top: number; left: number; }; - insertAfter(index: number): SwiperSlide; - prepend(): SwiperSlide; - remove(): void; +interface Scrollbar { + eL: HTMLElement; + dragEl: HTMLElement; + + updateSize: () => void; +} + +interface Autoplay { + running: boolean; + + start: () => void; + stop: () => void; +} + +interface LazyLoading { + load: () => void; + loadInSlide: (index: number) => void; +} + +interface Zoom { + enabled: boolean; + scale: number; + + enable: () => void; + disable: () => void; + in: () => void; + out: () => void; + toggle: () => void; +} + +// Keyboard and Mousewheel control +interface Control { + enabled: boolean; + + enable: () => void; + disable: () => void; +} + +interface VirtualSlides { + cache: any; + from: number; + to: number; + slides: any[]; + + appendSlide: (slide: any) => void; + prependSlide: (slide: any) => void; + update: () => void; +} + +interface Controller { + control: Swiper; } declare class Swiper { - constructor(container: string | Element, options?: SwiperOptions); + constructor(container: string | Element, parameters?: SwiperOptions); // Properties + params: SwiperOptions; + // TODO: dom7 element + $el: any; + // TODO: dom7 element + $wrapperEl: any; + slides: HTMLElement[]; width: number; height: number; - params: any; - positions: any; - wrapper: any; - virtualSize: number; - - // Feature detection - support: { - touch: boolean; - transforms: boolean; - transforms3d: boolean; - transitions: boolean; - }; - - // Browser detection - browser: { - ie8: boolean; - ie10: boolean; - }; - - // Navigation + translate: number; + progress: number; activeIndex: number; - activeLoopIndex: number; - activeLoaderIndex: number; + realIndex: number; previousIndex: number; - swipeNext(internal?: boolean): boolean; - swipePrev(internal?: boolean): boolean; - swipeReset(): boolean; - swipeTo(index: number, speed?: number, runCallbacks?: boolean): boolean; - activeSlide(): SwiperSlide; - updateActiveSlide(index: number): void; - - // Events - touches: any; - isTouched: boolean; - clickedSlideIndex: number; - clickedSlide: SwiperSlide; - wrapperTransitionEnd(callback: () => void, permanent: boolean): void; - - // Init/reset - destroy(deleteInstance: boolean, cleanupStyles: boolean): void; - reInit(forceCalcSlides?: boolean): void; - resizeFix(reInit?: boolean): void; - - // Autoplaying - autoplay: boolean; - startAutoplay(): void; - stopAutoplay(): void; - - // Other methods - getWrapperTranslate(axis: string): number; // 'x' or 'y' - setWrapperTranslate(x: number, y: number, z: number): void; - setWrapperTransition(duration: any): void; - - // Slides API - - slides: SwiperSlide[]; - - slidePrev(runCallbacks?: boolean, speed?: number): void; - slideNext(runCallbacks?: boolean, speed?: number): void; - slideTo(index: number, speed?: number, runCallbacks?: boolean): void; - update(updateTranslate?: boolean): void; - onResize(): void; - detachEvents(): void; - attachEvents(): void; - - appendSlide(slides: HTMLElement | string | string[]): void; - prependSlide(slides: HTMLElement | string | string[]): void; - removeSlide(slideIndex: number): void; - removeAllSlides(): void; - - lockSwipeToNext(): void; - unlockSwipeToNext(): void; - lockSwipeToPrev(): void; - unlockSwipeToPrev(): void; - lockSwipes(): void; - unlockSwipes(): void; - disableMousewheelControl(): void; - enableMousewheelControl(): void; - disableKeyboardControl(): void; - enableKeyboardControl(): void; - disableTouchControl(): void; - enableTouchControl(): void; - unsetGrabCursor(): void; - setGrabCursor(): void; - - plugins?: { - debugger?(swiper: any, params: any): void; + isBeginning: boolean; + isEnd: boolean; + animating: boolean; + touches: { + startX: number; + startY: number; + currentX: number; + currentY: number; + diff: number; }; + clickedIndex: number; + clickedSlide: HTMLElement; + allowSlideNext: boolean; + allowSlidePrev: boolean; + allowTouchMove: boolean; + + slideNext: (speed?: number, runCallbacks?: boolean) => void; + slidePrev: (speed?: number, runCallbacks?: boolean) => void; + slideTo: (index: number, speed?: number, runCallbacks?: boolean) => void; + slideToLoop: (index: number, speed?: number, runCallbacks?: boolean) => void; + slideReset: (speed?: number, runCallbacks?: boolean) => void; + slideToClosest: (speed?: number, runCallbacks?: boolean) => void; + updateAutoHeight: (speed?: number) => void; + update: () => void; + detachEvents: () => void; + attachEvents: () => void; + destroy: (deleteInstance?: boolean, cleanStyles?: boolean) => void; + appendSlide: (slides: Array<(HTMLElement | string)> | string | HTMLElement) => void; + prependSlide: (slides: Array<(HTMLElement | string)> | string | HTMLElement) => void; + removeSlide: (index: number) => void; + removeAllSlides: () => void; + setTranslate: (translate: number) => void; + getTranslate: () => void; + on: (event: SwiperEvent, handler: () => void) => void; + once: (event: SwiperEvent, handler: () => void) => void; + off: (event: SwiperEvent, handler?: () => void) => void; + unsetGrabCursor: () => void; + setGrabCursor: () => void; + + // components + navigation: Navigation; + pagination: Pagination; + scrollbar: Scrollbar; + autoplay: Autoplay; + zoom: Zoom; + keyboard: Control; + mousewheel: Control; + virtual: VirtualSlides; + controller: Controller; } -declare module "swiper" { - const swiper: { - new (element: Element | string, options?: SwiperOptions): Swiper; - }; - - export = swiper; +declare module 'swiper' { + export = Swiper; } diff --git a/types/swiper/swiper-tests.ts b/types/swiper/swiper-tests.ts index 9ba47c2aba..dfb7df8eb2 100644 --- a/types/swiper/swiper-tests.ts +++ b/types/swiper/swiper-tests.ts @@ -1,563 +1,741 @@ -/// +/** + * Main demos + * for more details, please see http://idangero.us/swiper/demos/ + * @author Eugene Matseruk + */ -// -// Main demos -// - -// 01-default.html +/** + * 010-default + */ function defaultDemo() { const swiper = new Swiper('.swiper-container'); } -// 02-responsive.html -function responsive() { +/** + * 020-navigation + */ +function navigation() { const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - paginationClickable: true + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, }); } -// 03-vertical.html -function vertical() { + +/** + * 030-pagination + */ +function pagination() { const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - paginationClickable: true, - direction: 'vertical' + pagination: { + el: '.swiper-pagination', + }, }); } -// 04-space-between.html -function spaceBetween() { + +/** + * 040-pagination-dynamic + */ +function paginationDynamic() { const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - paginationClickable: true, - spaceBetween: 30, + pagination: { + el: '.swiper-pagination', + dynamicBullets: true, + }, }); } -// 05-slides-per-view.html -function slidesPerView() { + +/** + * 050-progress-pagination + */ +function paginationProgress() { const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - slidesPerView: 3, - paginationClickable: true, - spaceBetween: 30 + pagination: { + el: '.swiper-pagination', + type: 'progressbar', + }, + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, }); } -// 06-slides-per-view-auto.html -function slidesPerViewAuto() { + +/** + * 060-pagination-fraction + */ +function paginationFraction() { const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - slidesPerView: 'auto', - paginationClickable: true, - spaceBetween: 30 + pagination: { + el: '.swiper-pagination', + type: 'fraction', + }, + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, }); } -// 07-centered.html -function centered() { + +/** + * 070-pagination-custom + */ +function paginationCustom() { const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - slidesPerView: 4, - centeredSlides: true, - paginationClickable: true, - spaceBetween: 30 + pagination: { + el: '.swiper-pagination', + clickable: true, + renderBullet: (index, className) => { + return `${index + 1}`; + }, + }, }); } -// 08-centered-auto.html -function centeredAuto() { - const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - slidesPerView: 'auto', - centeredSlides: true, - paginationClickable: true, - spaceBetween: 30 - }); -} -// 09-freemode.html -function freemode() { - const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - slidesPerView: 3, - paginationClickable: true, - spaceBetween: 30, - freeMode: true - }); -} -// 10-slides-per-column.html -function slidesPerColumn() { - const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - slidesPerView: 3, - slidesPerColumn: 2, - paginationClickable: true, - spaceBetween: 30 - }); -} -// 11-nested.html -function nested() { - const swiperH = new Swiper('.swiper-container-h', { - pagination: '.swiper-pagination-h', - paginationClickable: true, - spaceBetween: 50 - }); - const swiperV = new Swiper('.swiper-container-v', { - pagination: '.swiper-pagination-v', - paginationClickable: true, - direction: 'vertical', - spaceBetween: 50 - }); -} -// 12-grab-cursor.html -function grabCursor() { - const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - slidesPerView: 4, - centeredSlides: true, - paginationClickable: true, - spaceBetween: 30, - grabCursor: true - }); -} -// 13-scrollbar.html + +/** + * 080-scrollbar + */ function scrollbar() { const swiper = new Swiper('.swiper-container', { - scrollbar: '.swiper-scrollbar', - scrollbarHide: true, + scrollbar: { + el: '.swiper-scrollbar', + hide: true, + }, + }); +} + +/** + * Vertical Slider + */ +function verticalSlider() { + const swiper = new Swiper('.swiper-container', { + direction: 'vertical', + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + }); +} + +/** + * Space Between Slides + */ +function spaceBetween() { + const swiper = new Swiper('.swiper-container', { + spaceBetween: 30, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + }); +} + +/** + * Multiple Slides Per View + */ +function multipleSlidesPerView() { + const swiper = new Swiper('.swiper-container', { + slidesPerView: 3, + spaceBetween: 30, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + }); +} + +/** + * Auto Slides Per View / Carousel Mode + */ +function autoSlidesPerViewAndCarouserMode() { + const swiper = new Swiper('.swiper-container', { + slidesPerView: 'auto', + spaceBetween: 30, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + }); +} + +/** + * Centered Slides + */ +function centeredSlides() { + const swiper = new Swiper('.swiper-container', { + slidesPerView: 4, + spaceBetween: 30, + centeredSlides: true, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + }); +} + +/** + * Centered Slides + Auto Slides Per View + */ +function centeredSlidesAndAutoSlidesPerView() { + const swiper = new Swiper('.swiper-container', { slidesPerView: 'auto', centeredSlides: true, spaceBetween: 30, - grabCursor: true + pagination: { + el: '.swiper-pagination', + clickable: true, + }, }); } -// 14-nav-arrows.html -function navArrows() { + +/** + * Free Mode / No Fixed Positions + */ +function freeModeAndNoFixedPositions() { const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - paginationClickable: true, - nextButton: '.swiper-button-next', - prevButton: '.swiper-button-prev', - spaceBetween: 30 + slidesPerView: 3, + spaceBetween: 30, + freeMode: true, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, }); } -// 15-infinite-loop.html -function infiniteLoop() { + +/** + * Scroll Container + */ +function scrollContainer() { + const swiper = new Swiper('.swiper-container', { + direction: 'vertical', + slidesPerView: 'auto', + freeMode: true, + scrollbar: { + el: '.swiper-scrollbar', + }, + mousewheel: true, + }); +} + +/** + * Multi Row Slides Layout + */ +function multiRowSlides() { + const swiper = new Swiper('.swiper-container', { + slidesPerView: 3, + slidesPerColumn: 2, + spaceBetween: 30, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + }); +} + +/** + * Nested Swipers + */ +function nestedSwipers() { + const swiperH = new Swiper('.swiper-container-h', { + spaceBetween: 50, + pagination: { + el: '.swiper-pagination-h', + clickable: true, + }, + }); + const swiperV = new Swiper('.swiper-container-v', { + direction: 'vertical', + spaceBetween: 50, + pagination: { + el: '.swiper-pagination-v', + clickable: true, + }, + }); +} +/** + * Grab Cursor + */ +function grabCursor() { + const swiper = new Swiper('.swiper-container', { + slidesPerView: 4, + centeredSlides: true, + spaceBetween: 30, + grabCursor: true, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + }); +} + +/** + * Loop Mode / Infinite Loop + */ +function loopMode() { const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - nextButton: '.swiper-button-next', - prevButton: '.swiper-button-prev', slidesPerView: 1, - paginationClickable: true, spaceBetween: 30, - loop: true + loop: true, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, }); } -// 16-effect-fade.html -function effectFade() { + +/** + * Loop Mode with Multiple Slides Per Group + */ +function loopModeWithMultipleSlides() { const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - paginationClickable: true, - nextButton: '.swiper-button-next', - prevButton: '.swiper-button-prev', + slidesPerView: 3, spaceBetween: 30, - effect: 'fade' + slidesPerGroup: 3, + loop: true, + loopFillGroupWithBlank: true, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, }); } -// 17-effect-cube.html -function effectCube() { + +/** + * Fade Effect + */ +function fadeEffect() { + const swiper = new Swiper('.swiper-container', { + spaceBetween: 30, + effect: 'fade', + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, + }); +} + +/** + * 3D Cube Effect + */ +function cube3dEffect() { const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', effect: 'cube', grabCursor: true, - cube: { + cubeEffect: { shadow: true, slideShadows: true, shadowOffset: 20, - shadowScale: 0.94 - } + shadowScale: 0.94, + }, + pagination: { + el: '.swiper-pagination', + }, }); } -// 18-effect-coverflow.html -function effectCoverflow() { + +/** + * 3D Coverflow Effect + */ +function coverflow3dEffect() { const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', effect: 'coverflow', grabCursor: true, centeredSlides: true, slidesPerView: 'auto', - coverflow: { + coverflowEffect: { rotate: 50, stretch: 0, depth: 100, modifier: 1, - slideShadows: true - } + slideShadows: true, + }, + pagination: { + el: '.swiper-pagination', + }, }); } -// 19-keyboard-control.html + +/** + * 3D Flip Effect + */ +function flip3dEffect() { + const swiper = new Swiper('.swiper-container', { + effect: 'flip', + grabCursor: true, + pagination: { + el: '.swiper-pagination', + }, + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, + }); +} + +/** + * Keyboard Control (Open in new window) + */ function keyboardControl() { const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', slidesPerView: 1, - paginationClickable: true, spaceBetween: 30, - keyboardControl: true, - nextButton: '.swiper-button-next', - prevButton: '.swiper-button-prev', + keyboard: { + enabled: true, + }, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, }); } -// 20-mousewheel-control.html -function mousewheelControl() { + +/** + * Mousewheel Control + */ +function mouseWheelControl() { const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', direction: 'vertical', slidesPerView: 1, - paginationClickable: true, spaceBetween: 30, - mousewheelControl: true + mousewheel: true, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, }); } -// 21-autoplay.html + +/** + * Autoplay + */ function autoplay() { const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - nextButton: '.swiper-button-next', - prevButton: '.swiper-button-prev', - paginationClickable: true, spaceBetween: 30, centeredSlides: true, - autoplay: 2500, - autoplayDisableOnInteraction: false + autoplay: { + delay: 2500, + disableOnInteraction: false, + }, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, }); } -// 22-dynamic-slides.html + +/** + * Dynamic Slides + */ function dynamicSlides() { let appendNumber = 4; let prependNumber = 1; const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - nextButton: '.swiper-button-next', - prevButton: '.swiper-button-prev', slidesPerView: 3, centeredSlides: true, - paginationClickable: true, spaceBetween: 30, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, }); - document.querySelector('.prepend-2-slides').addEventListener('click', e => { + document.querySelector('.prepend-2-slides').addEventListener('click', (e) => { e.preventDefault(); swiper.prependSlide([ `
    Slide ${--prependNumber}
    `, - `
    Slide ${--prependNumber}
    ` + `
    Slide ${--prependNumber}
    `, ]); }); - document.querySelector('.prepend-slide').addEventListener('click', e => { + document.querySelector('.prepend-slide').addEventListener('click', (e) => { e.preventDefault(); swiper.prependSlide(`
    Slide ${--prependNumber}
    `); }); - document.querySelector('.append-slide').addEventListener('click', e => { + document.querySelector('.append-slide').addEventListener('click', (e) => { e.preventDefault(); - swiper.appendSlide(`
    Slide ${++appendNumber}
    `); + swiper.appendSlide(`
    Slide ${--appendNumber}
    `); }); - document.querySelector('.append-2-slides').addEventListener('click', e => { + document.querySelector('.append-2-slides').addEventListener('click', (e) => { e.preventDefault(); swiper.appendSlide([ - `
    Slide ${++appendNumber}
    `, - `
    Slide ${++appendNumber}
    ` + `
    Slide ${--appendNumber}
    `, + `
    Slide ${--appendNumber}
    ` ]); }); } -// 23-thumbs-gallery-loop.html -function thumbsGalleryLoop() { + +/** + * Thumbs Gallery With Two-way Control + */ +function thumbsGalleryWithTwoWayControl() { const galleryTop = new Swiper('.gallery-top', { - nextButton: '.swiper-button-next', - prevButton: '.swiper-button-prev', - spaceBetween: 10, - loop: true, - loopedSlides: 5, // looped slides should be the same - }); - const galleryThumbs = new Swiper('.gallery-thumbs', { - spaceBetween: 10, - slidesPerView: 4, - touchRatio: 0.2, - loop: true, - loopedSlides: 5, // looped slides should be the same - slideToClickedSlide: true - }); - galleryTop.params.control = galleryThumbs; - galleryThumbs.params.control = galleryTop; -} -// 23-thumbs-gallery.html -function thumbsGallery() { - const galleryTop = new Swiper('.gallery-top', { - nextButton: '.swiper-button-next', - prevButton: '.swiper-button-prev', spaceBetween: 10, + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, }); const galleryThumbs = new Swiper('.gallery-thumbs', { spaceBetween: 10, centeredSlides: true, slidesPerView: 'auto', touchRatio: 0.2, - slideToClickedSlide: true + slideToClickedSlide: true, }); - galleryTop.params.control = galleryThumbs; - galleryThumbs.params.control = galleryTop; + galleryTop.controller.control = galleryThumbs; + galleryThumbs.controller.control = galleryTop; } -// 24-multiple-swipers.html -function multipleSwipers() { - const swiper1 = new Swiper('.swiper1', { - pagination: '.swiper-pagination1', - paginationClickable: true, - spaceBetween: 30, - }); - const swiper2 = new Swiper('.swiper2', { - pagination: '.swiper-pagination2', - paginationClickable: true, - spaceBetween: 30, - }); - const swiper3 = new Swiper('.swiper3', { - pagination: '.swiper-pagination3', - paginationClickable: true, - spaceBetween: 30, - }); -} -// 25-hash-navigation.html + +/** + * Hash Navigation (Open in new window) + */ function hashNavigation() { const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - paginationClickable: true, - nextButton: '.swiper-button-next', - prevButton: '.swiper-button-prev', spaceBetween: 30, - hashnav: true, - hashnavWatchState: true + hashNavigation: { + watchState: true, + }, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, }); } -// 26-rtl.html -function rtl() { + +/** + * History API (Open in new window) + */ +function historyApi() { const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - paginationClickable: true, - nextButton: '.swiper-button-next', - prevButton: '.swiper-button-prev' + spaceBetween: 50, + slidesPerView: 1, + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, + pagination: { + el: '.swiper-pagination', + }, + history: { + key: 'slide', + }, }); } -// 27-jquery.html -function jquery() { + +/** + * RTL Layout + */ +function rtlLayout() { const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - paginationClickable: true, - nextButton: '.swiper-button-next', - prevButton: '.swiper-button-prev' + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, }); } -// 28-parallax.html + +/** + * Parallax + */ function parallax() { const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - paginationClickable: true, - nextButton: '.swiper-button-next', - prevButton: '.swiper-button-prev', - parallax: true, speed: 600, + parallax: true, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, }); } -// 29-custom-pagination.html -function customPagination() { + +/** + * Lazy Loading Images + */ +function lazyLoadingImages() { const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - paginationClickable: true, - paginationBulletRender(swiper, index, className) { - return `${index + 1}`; - } - }); -} -// 30-lazy-load-images.html -function lazyLoadImages() { - const swiper = new Swiper('.swiper-container', { - nextButton: '.swiper-button-next', - prevButton: '.swiper-button-prev', - pagination: '.swiper-pagination', - paginationClickable: true, - // Disable preloading of all images - preloadImages: false, // Enable lazy loading - lazyLoading: true - }); -} -// 31-custom-plugin.html -function customPlugin() { - /* ======== - Debugger plugin, simple demo plugin to console.log some of callbacks - ======== */ - Swiper.prototype.plugins.debugger = (swiper: any, params: any) => { - if (!params) return; - // Need to return object with properties that names are the same as callbacks - return { - onInit(swiper: any) { - console.log('onInit'); - }, - onClick(swiper: any, e: any) { - console.log('onClick'); - }, - onTap(swiper: any, e: any) { - console.log('onTap'); - }, - onDoubleTap(swiper: any, e: any) { - console.log('onDoubleTap'); - }, - onSliderMove(swiper: any, e: any) { - console.log('onSliderMove'); - }, - onSlideChangeStart(swiper: any) { - console.log('onSlideChangeStart'); - }, - onSlideChangeEnd(swiper: any) { - console.log('onSlideChangeEnd'); - }, - onTransitionStart(swiper: any) { - console.log('onTransitionStart'); - }, - onTransitionEnd(swiper: any) { - console.log('onTransitionEnd'); - }, - onReachBeginning(swiper: any) { - console.log('onReachBeginning'); - }, - onReachEnd(swiper: any) { - console.log('onReachEnd'); - } - }; - }; -} -// 32-scroll-container.html -function scrollContainer() { - const swiper = new Swiper('.swiper-container', { - scrollbar: '.swiper-scrollbar', - direction: 'vertical', - slidesPerView: 'auto', - mousewheelControl: true, - freeMode: true - }); -} -// 32-slideable-menu.html -function slideableMenu() { - const toggleMenu = () => { - if (swiper.previousIndex === 0) - swiper.slidePrev(); - }; - const menuButton = document.getElementsByClassName('menu-button')[0]; - const swiper = new Swiper('.swiper-container', { - slidesPerView: 'auto', - initialSlide: 1, - resistanceRatio: .00000000000001, - onSlideChangeStart: (slider) => { - if (slider.activeIndex === 0) { - menuButton.classList.add('cross'); - menuButton.removeEventListener('click', toggleMenu, false); - } else - menuButton.classList.remove('cross'); + lazy: true, + pagination: { + el: '.swiper-pagination', + clickable: true, }, - onSlideChangeEnd: (slider) => { - if (slider.activeIndex === 0) - menuButton.removeEventListener('click', toggleMenu, false); - else - menuButton.addEventListener('click', toggleMenu, false); + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', }, - slideToClickedSlide: true }); } -// 33-responsive-breakpoints.html + +/** + * Responsive Breakpoints + */ function responsiveBreakpoints() { const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - paginationClickable: true, slidesPerView: 5, spaceBetween: 50, + // init: false, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, breakpoints: { 1024: { slidesPerView: 4, - spaceBetween: 40 + spaceBetween: 40, }, 768: { slidesPerView: 3, - spaceBetween: 30 + spaceBetween: 30, }, 640: { slidesPerView: 2, - spaceBetween: 20 + spaceBetween: 20, }, 320: { slidesPerView: 1, - spaceBetween: 10 + spaceBetween: 10, } } }); } -// 34-autoheight.html -function autoheight() { + +/** + * Auto Height + */ +function autoHeight() { const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - paginationClickable: true, - nextButton: '.swiper-button-next', - prevButton: '.swiper-button-prev', autoHeight: true, // enable auto height + spaceBetween: 20, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, }); } -// 35-effect-flip.html -function effectFlip() { - const swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - effect: 'flip', - grabCursor: true, - nextButton: '.swiper-button-next', - prevButton: '.swiper-button-prev' - }); -} -// 36-pagination-fraction.html -function paginationFraction() { - const swiper = new Swiper('.swiper-container', { - nextButton: '.swiper-button-next', - prevButton: '.swiper-button-prev', - pagination: '.swiper-pagination', - paginationType: 'fraction' - }); -} -// 37-pagination-progress.html -function paginationProgress() { - const swiper = new Swiper('.swiper-container', { - nextButton: '.swiper-button-next', - prevButton: '.swiper-button-prev', - pagination: '.swiper-pagination', - paginationType: 'progress' - }); -} -// 38-history.html -function historyDemo() { - const swiper = new Swiper('.swiper-container', { - spaceBetween: 50, - slidesPerView: 2, - centeredSlides: true, - slideToClickedSlide: true, - grabCursor: true, - nextButton: '.swiper-button-next', - prevButton: '.swiper-button-prev', - scrollbar: '.swiper-scrollbar', - pagination: '.swiper-pagination', - history: 'slide', - }); -} -// 38-jquery-ie9-loop.html -function jqueryIe9Loop() { - const swiper = new Swiper('.swiper-container', { - loop: true, - pagination: '.swiper-pagination', - paginationClickable: true, - nextButton: '.swiper-button-next', - prevButton: '.swiper-button-prev' - }); -} -// 39-zoom.html + +/** + * Zoom + */ function zoom() { const swiper = new Swiper('.swiper-container', { zoom: true, - pagination: '.swiper-pagination', - nextButton: '.swiper-button-next', - prevButton: '.swiper-button-prev' + pagination: { + el: '.swiper-pagination', + }, + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, + }); +} + +/** + * Virtual Slides + */ +function virtualSlides() { + const slides = []; + for (let i = 0; i < 600; i += 1) { + slides.push('Slide ' + (i + 1)); + } + + const swiper = new Swiper('.swiper-container', { + slidesPerView: 3, + centeredSlides: true, + spaceBetween: 30, + pagination: { + el: '.swiper-pagination', + type: 'fraction', + }, + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, + virtual: { + slides + }, + }); + document.querySelector('.slide-1').addEventListener('click', (e) => { + e.preventDefault(); + swiper.slideTo(0, 0); + }); + document.querySelector('.slide-250').addEventListener('click', (e) => { + e.preventDefault(); + swiper.slideTo(249, 0); + }); + document.querySelector('.slide-500').addEventListener('click', (e) => { + e.preventDefault(); + swiper.slideTo(499, 0); + }); +} + +/** + * Slideable Navigation Drawer + */ +function slideableNavigation() { + const menuButton = document.querySelector('.menu-button'); + const swiper = new Swiper('.swiper-container', { + slidesPerView: 'auto', + initialSlide: 1, + resistanceRatio: 0, + slideToClickedSlide: true, + on: { + init: () => { + const slider = this; + menuButton.addEventListener('click', () => { + if (slider.activeIndex === 0) { + slider.slideNext(); + } else { + slider.slidePrev(); + } + }, true); + }, + slideChange: () => { + const slider = this; + if (slider.activeIndex === 0) { + menuButton.classList.add('cross'); + } else { + menuButton.classList.remove('cross'); + } + }, + } }); } diff --git a/types/swiper/tsconfig.json b/types/swiper/tsconfig.json index 8bde882886..2db3d1376f 100644 --- a/types/swiper/tsconfig.json +++ b/types/swiper/tsconfig.json @@ -21,4 +21,4 @@ "index.d.ts", "swiper-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/swiper/v3/index.d.ts b/types/swiper/v3/index.d.ts new file mode 100644 index 0000000000..65872facd2 --- /dev/null +++ b/types/swiper/v3/index.d.ts @@ -0,0 +1,339 @@ +// Type definitions for Swiper 3.4 +// Project: https://github.com/nolimits4web/Swiper +// Definitions by: Sebastián Galiano , Luca Trazzi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +interface SwiperOptions { + initialSlide?: number; + direction?: string; + speed?: number; + setWrapperSize?: boolean; + virtualTranslate?: boolean; + width?: number; + height?: number; + autoHeight?: boolean; + roundLengths?: boolean; + nested?: boolean; + + // Autoplay + autoplay?: number; + autoplayStopOnLast?: boolean; + autoplayDisableOnInteraction?: boolean; + + // Progress + watchSlidesProgress?: boolean; + watchSlidesVisibility?: boolean; + + // Freemode + freeMode?: boolean; + freeModeMomentum?: boolean; + freeModeMomentumRatio?: number; + freeModeMomentumVelocityRatio?: number; + freeModeMomentumBounce?: boolean; + freeModeMomentumBounceRatio?: number; + freeModeMinimumVelocity?: number; + freeModeSticky?: boolean; + + // Effects + effect?: string; + fade?: {}; + cube?: {}; + coverflow?: {}; + flip?: {}; + + // Parallax + parallax?: boolean; + + // Slides grid + spaceBetween?: number; + slidesPerView?: number | string; + slidesPerColumn?: number; + slidesPerColumnFill?: string; + slidesPerGroup?: number; + centeredSlides?: boolean; + slidesOffsetBefore?: number; + slidesOffsetAfter?: number; + + // Grab Cursor + grabCursor?: boolean; + + // Touches + touchEventsTarget?: string; + touchRatio?: number; + touchAngle?: number; + simulateTouch?: boolean; + shortSwipes?: boolean; + longSwipes?: boolean; + longSwipesRatio?: number; + longSwipesMs?: number; + followFinger?: boolean; + onlyExternal?: boolean; + threshold?: number; + touchMoveStopPropagation?: boolean; + iOSEdgeSwipeDetection?: boolean; + iOSEdgeSwipeThreshold?: number; + + // Touch Resistance + resistance?: boolean; + resistanceRatio?: number; + + // Clicks + preventClicks?: boolean; + preventClicksPropagation?: boolean; + slideToClickedSlide?: boolean; + + // Swiping / No swiping + allowSwipeToPrev?: boolean; + allowSwipeToNext?: boolean; + noSwiping?: boolean; + noSwipingClass?: string; + swipeHandler?: string | Element; + + // Navigation Controls + uniqueNavElements?: boolean; + + // Pagination + pagination?: string | Element; + paginationType?: string; + paginationHide?: boolean; + paginationClickable?: boolean; + paginationElement?: string; + paginationBulletRender?(swiper: Swiper, index: number, className: string): void; + paginationFractionRender?(swiper: Swiper, currentClassName: string, totalClassName: string): void; + paginationProgressRender?(swiper: Swiper, progressbarClass: string): void; + paginationCustomRender?(swiper: Swiper, current: number, total: number): void; + + // Navigation Buttons + nextButton?: string | Element; + prevButton?: string | Element; + + // Scollbar + scrollbar?: string | Element | SwiperScrollbarOptions; + scrollbarHide?: boolean; + scrollbarDraggable?: boolean; + scrollbarSnapOnRelease?: boolean; + + // Accessibility + a11y?: boolean; + prevSlideMessage?: string; + nextSlideMessage?: string; + firstSlideMessage?: string; + lastSlideMessage?: string; + paginationBulletMessage?: string; + + // Keyboard / Mousewheel + keyboardControl?: boolean; + mousewheelControl?: boolean; + mousewheelForceToAxis?: boolean; + mousewheelReleaseOnEdges?: boolean; + mousewheelInvert?: boolean; + mousewheelSensitivity?: number; + + // Hash Navigation + hashnav?: boolean; + hashnavWatchState?: boolean; + history?: string; + + // Images + preloadImages?: boolean; + updateOnImagesReady?: boolean; + lazyLoading?: boolean; + lazyLoadingInPrevNext?: boolean; + lazyLoadingInPrevNextAmount?: number; + lazyLoadingOnTransitionStart?: boolean; + + // Loop + loop?: boolean; + loopAdditionalSlides?: number; + loopedSlides?: number; + + zoom?: boolean; + + // Controller + control?: Swiper; + controlInverse?: boolean; + controlBy?: string; + + // Observer + observer?: boolean; + observeParents?: boolean; + + // Breakpoints + breakpoints?: {}; + + // Callbacks + runCallbacksOnInit?: boolean; + onInit?(swiper: Swiper): void; + onSlideChangeStart?(swiper: Swiper): void; + onSlideChangeEnd?(swiper: Swiper): void; + onSlideNextStart?(swiper: Swiper): void; + onSlideNextEnd?(swiper: Swiper): void; + onSlidePrevStart?(swiper: Swiper): void; + onSlidePrevEnd?(swiper: Swiper): void; + onTransitionStart?(swiper: Swiper): void; + onTransitionEnd?(swiper: Swiper): void; + onTouchStart?(swiper: Swiper, event: Event): void; + onTouchMove?(swiper: Swiper, event: Event): void; + onTouchMoveOpposite?(swiper: Swiper, event: Event): void; + onSliderMove?(swiper: Swiper, event: Event): void; + onTouchEnd?(swiper: Swiper, event: Event): void; + onClick?(swiper: Swiper, event: Event): void; + onTap?(swiper: Swiper, event: Event): void; + onDoubleTap?(swiper: Swiper, event: Event): void; + onImagesReady?(swiper: Swiper): void; + onProgress?(swiper: Swiper, progress: number): void; + onReachBeginning?(swiper: Swiper): void; + onReachEnd?(swiper: Swiper): void; + onDestroy?(swiper: Swiper): void; + onSetTranslate?(swiper: Swiper, translate: any): void; + onSetTransition?(swiper: Swiper, transition: any): void; + onAutoplay?(swiper: Swiper): void; + onAutoplayStart?(swiper: Swiper): void; + onAutoplayStop?(swiper: Swiper): void; + onLazyImageLoad?(swiper: Swiper, slide: any, image: any): void; + onLazyImageReady?(swiper: Swiper, slide: any, image: any): void; + onPaginationRendered?(swiper: Swiper, paginationContainer: any): void; + onScroll?(swiper: Swiper, event: Event): void; + onBeforeResize?(swiper: Swiper): void; + onAfterResize?(swiper: Swiper): void; + onKeyPress?(swiper: Swiper, kc: any): void; + + // Namespace + slideClass?: string; + slideActiveClass?: string; + slideVisibleClass?: string; + slideDuplicateClass?: string; + slideNextClass?: string; + slidePrevClass?: string; + wrapperClass?: string; + bulletClass?: string; + bulletActiveClass?: string; + paginationHiddenClass?: string; + paginationCurrentClass?: string; + paginationTotalClass?: string; + paginationProgressbarClass?: string; + buttonDisabledClass?: string; +} + +interface SwiperScrollbarOptions { + container: string; // Default: '.swiper-scrollbar' + draggable?: boolean; // Default: true + hide?: boolean; // Default: true + snapOnRelease?: boolean; // Default: false +} + +declare class SwiperSlide { + append(): SwiperSlide; + clone(): SwiperSlide; + getWidth(): number; + getHeight(): number; + getOffset(): { top: number; left: number; }; + insertAfter(index: number): SwiperSlide; + prepend(): SwiperSlide; + remove(): void; +} + +declare class Swiper { + constructor(container: string | Element, options?: SwiperOptions); + + // Properties + width: number; + height: number; + params: any; + positions: any; + wrapper: any; + virtualSize: number; + + // Feature detection + support: { + touch: boolean; + transforms: boolean; + transforms3d: boolean; + transitions: boolean; + }; + + // Browser detection + browser: { + ie8: boolean; + ie10: boolean; + }; + + // Navigation + activeIndex: number; + activeLoopIndex: number; + activeLoaderIndex: number; + previousIndex: number; + swipeNext(internal?: boolean): boolean; + swipePrev(internal?: boolean): boolean; + swipeReset(): boolean; + swipeTo(index: number, speed?: number, runCallbacks?: boolean): boolean; + activeSlide(): SwiperSlide; + updateActiveSlide(index: number): void; + + // Events + touches: any; + isTouched: boolean; + clickedSlideIndex: number; + clickedSlide: SwiperSlide; + wrapperTransitionEnd(callback: () => void, permanent: boolean): void; + + // Init/reset + destroy(deleteInstance: boolean, cleanupStyles: boolean): void; + reInit(forceCalcSlides?: boolean): void; + resizeFix(reInit?: boolean): void; + + // Autoplaying + autoplay: boolean; + startAutoplay(): void; + stopAutoplay(): void; + + // Other methods + getWrapperTranslate(axis: string): number; // 'x' or 'y' + setWrapperTranslate(x: number, y: number, z: number): void; + setWrapperTransition(duration: any): void; + + // Slides API + + slides: SwiperSlide[]; + + slidePrev(runCallbacks?: boolean, speed?: number): void; + slideNext(runCallbacks?: boolean, speed?: number): void; + slideTo(index: number, speed?: number, runCallbacks?: boolean): void; + update(updateTranslate?: boolean): void; + onResize(): void; + detachEvents(): void; + attachEvents(): void; + + appendSlide(slides: HTMLElement | string | string[]): void; + prependSlide(slides: HTMLElement | string | string[]): void; + removeSlide(slideIndex: number): void; + removeAllSlides(): void; + + lockSwipeToNext(): void; + unlockSwipeToNext(): void; + lockSwipeToPrev(): void; + unlockSwipeToPrev(): void; + lockSwipes(): void; + unlockSwipes(): void; + disableMousewheelControl(): void; + enableMousewheelControl(): void; + disableKeyboardControl(): void; + enableKeyboardControl(): void; + disableTouchControl(): void; + enableTouchControl(): void; + unsetGrabCursor(): void; + setGrabCursor(): void; + + plugins?: { + debugger?(swiper: any, params: any): void; + }; +} + +declare module "swiper" { + const swiper: { + new (element: Element | string, options?: SwiperOptions): Swiper; + }; + + export = swiper; +} diff --git a/types/swiper/v3/swiper-tests.ts b/types/swiper/v3/swiper-tests.ts new file mode 100644 index 0000000000..9ba47c2aba --- /dev/null +++ b/types/swiper/v3/swiper-tests.ts @@ -0,0 +1,563 @@ +/// + +// +// Main demos +// + +// 01-default.html +function defaultDemo() { + const swiper = new Swiper('.swiper-container'); +} +// 02-responsive.html +function responsive() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + paginationClickable: true + }); +} +// 03-vertical.html +function vertical() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + paginationClickable: true, + direction: 'vertical' + }); +} +// 04-space-between.html +function spaceBetween() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + paginationClickable: true, + spaceBetween: 30, + }); +} +// 05-slides-per-view.html +function slidesPerView() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + slidesPerView: 3, + paginationClickable: true, + spaceBetween: 30 + }); +} +// 06-slides-per-view-auto.html +function slidesPerViewAuto() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + slidesPerView: 'auto', + paginationClickable: true, + spaceBetween: 30 + }); +} +// 07-centered.html +function centered() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + slidesPerView: 4, + centeredSlides: true, + paginationClickable: true, + spaceBetween: 30 + }); +} +// 08-centered-auto.html +function centeredAuto() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + slidesPerView: 'auto', + centeredSlides: true, + paginationClickable: true, + spaceBetween: 30 + }); +} +// 09-freemode.html +function freemode() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + slidesPerView: 3, + paginationClickable: true, + spaceBetween: 30, + freeMode: true + }); +} +// 10-slides-per-column.html +function slidesPerColumn() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + slidesPerView: 3, + slidesPerColumn: 2, + paginationClickable: true, + spaceBetween: 30 + }); +} +// 11-nested.html +function nested() { + const swiperH = new Swiper('.swiper-container-h', { + pagination: '.swiper-pagination-h', + paginationClickable: true, + spaceBetween: 50 + }); + const swiperV = new Swiper('.swiper-container-v', { + pagination: '.swiper-pagination-v', + paginationClickable: true, + direction: 'vertical', + spaceBetween: 50 + }); +} +// 12-grab-cursor.html +function grabCursor() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + slidesPerView: 4, + centeredSlides: true, + paginationClickable: true, + spaceBetween: 30, + grabCursor: true + }); +} +// 13-scrollbar.html +function scrollbar() { + const swiper = new Swiper('.swiper-container', { + scrollbar: '.swiper-scrollbar', + scrollbarHide: true, + slidesPerView: 'auto', + centeredSlides: true, + spaceBetween: 30, + grabCursor: true + }); +} +// 14-nav-arrows.html +function navArrows() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + paginationClickable: true, + nextButton: '.swiper-button-next', + prevButton: '.swiper-button-prev', + spaceBetween: 30 + }); +} +// 15-infinite-loop.html +function infiniteLoop() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + nextButton: '.swiper-button-next', + prevButton: '.swiper-button-prev', + slidesPerView: 1, + paginationClickable: true, + spaceBetween: 30, + loop: true + }); +} +// 16-effect-fade.html +function effectFade() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + paginationClickable: true, + nextButton: '.swiper-button-next', + prevButton: '.swiper-button-prev', + spaceBetween: 30, + effect: 'fade' + }); +} +// 17-effect-cube.html +function effectCube() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + effect: 'cube', + grabCursor: true, + cube: { + shadow: true, + slideShadows: true, + shadowOffset: 20, + shadowScale: 0.94 + } + }); +} +// 18-effect-coverflow.html +function effectCoverflow() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + effect: 'coverflow', + grabCursor: true, + centeredSlides: true, + slidesPerView: 'auto', + coverflow: { + rotate: 50, + stretch: 0, + depth: 100, + modifier: 1, + slideShadows: true + } + }); +} +// 19-keyboard-control.html +function keyboardControl() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + slidesPerView: 1, + paginationClickable: true, + spaceBetween: 30, + keyboardControl: true, + nextButton: '.swiper-button-next', + prevButton: '.swiper-button-prev', + }); +} +// 20-mousewheel-control.html +function mousewheelControl() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + direction: 'vertical', + slidesPerView: 1, + paginationClickable: true, + spaceBetween: 30, + mousewheelControl: true + }); +} +// 21-autoplay.html +function autoplay() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + nextButton: '.swiper-button-next', + prevButton: '.swiper-button-prev', + paginationClickable: true, + spaceBetween: 30, + centeredSlides: true, + autoplay: 2500, + autoplayDisableOnInteraction: false + }); +} +// 22-dynamic-slides.html +function dynamicSlides() { + let appendNumber = 4; + let prependNumber = 1; + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + nextButton: '.swiper-button-next', + prevButton: '.swiper-button-prev', + slidesPerView: 3, + centeredSlides: true, + paginationClickable: true, + spaceBetween: 30, + }); + document.querySelector('.prepend-2-slides').addEventListener('click', e => { + e.preventDefault(); + swiper.prependSlide([ + `
    Slide ${--prependNumber}
    `, + `
    Slide ${--prependNumber}
    ` + ]); + }); + document.querySelector('.prepend-slide').addEventListener('click', e => { + e.preventDefault(); + swiper.prependSlide(`
    Slide ${--prependNumber}
    `); + }); + document.querySelector('.append-slide').addEventListener('click', e => { + e.preventDefault(); + swiper.appendSlide(`
    Slide ${++appendNumber}
    `); + }); + document.querySelector('.append-2-slides').addEventListener('click', e => { + e.preventDefault(); + swiper.appendSlide([ + `
    Slide ${++appendNumber}
    `, + `
    Slide ${++appendNumber}
    ` + ]); + }); +} +// 23-thumbs-gallery-loop.html +function thumbsGalleryLoop() { + const galleryTop = new Swiper('.gallery-top', { + nextButton: '.swiper-button-next', + prevButton: '.swiper-button-prev', + spaceBetween: 10, + loop: true, + loopedSlides: 5, // looped slides should be the same + }); + const galleryThumbs = new Swiper('.gallery-thumbs', { + spaceBetween: 10, + slidesPerView: 4, + touchRatio: 0.2, + loop: true, + loopedSlides: 5, // looped slides should be the same + slideToClickedSlide: true + }); + galleryTop.params.control = galleryThumbs; + galleryThumbs.params.control = galleryTop; +} +// 23-thumbs-gallery.html +function thumbsGallery() { + const galleryTop = new Swiper('.gallery-top', { + nextButton: '.swiper-button-next', + prevButton: '.swiper-button-prev', + spaceBetween: 10, + }); + const galleryThumbs = new Swiper('.gallery-thumbs', { + spaceBetween: 10, + centeredSlides: true, + slidesPerView: 'auto', + touchRatio: 0.2, + slideToClickedSlide: true + }); + galleryTop.params.control = galleryThumbs; + galleryThumbs.params.control = galleryTop; +} +// 24-multiple-swipers.html +function multipleSwipers() { + const swiper1 = new Swiper('.swiper1', { + pagination: '.swiper-pagination1', + paginationClickable: true, + spaceBetween: 30, + }); + const swiper2 = new Swiper('.swiper2', { + pagination: '.swiper-pagination2', + paginationClickable: true, + spaceBetween: 30, + }); + const swiper3 = new Swiper('.swiper3', { + pagination: '.swiper-pagination3', + paginationClickable: true, + spaceBetween: 30, + }); +} +// 25-hash-navigation.html +function hashNavigation() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + paginationClickable: true, + nextButton: '.swiper-button-next', + prevButton: '.swiper-button-prev', + spaceBetween: 30, + hashnav: true, + hashnavWatchState: true + }); +} +// 26-rtl.html +function rtl() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + paginationClickable: true, + nextButton: '.swiper-button-next', + prevButton: '.swiper-button-prev' + }); +} +// 27-jquery.html +function jquery() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + paginationClickable: true, + nextButton: '.swiper-button-next', + prevButton: '.swiper-button-prev' + }); +} +// 28-parallax.html +function parallax() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + paginationClickable: true, + nextButton: '.swiper-button-next', + prevButton: '.swiper-button-prev', + parallax: true, + speed: 600, + }); +} +// 29-custom-pagination.html +function customPagination() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + paginationClickable: true, + paginationBulletRender(swiper, index, className) { + return `${index + 1}`; + } + }); +} +// 30-lazy-load-images.html +function lazyLoadImages() { + const swiper = new Swiper('.swiper-container', { + nextButton: '.swiper-button-next', + prevButton: '.swiper-button-prev', + pagination: '.swiper-pagination', + paginationClickable: true, + // Disable preloading of all images + preloadImages: false, + // Enable lazy loading + lazyLoading: true + }); +} +// 31-custom-plugin.html +function customPlugin() { + /* ======== + Debugger plugin, simple demo plugin to console.log some of callbacks + ======== */ + Swiper.prototype.plugins.debugger = (swiper: any, params: any) => { + if (!params) return; + // Need to return object with properties that names are the same as callbacks + return { + onInit(swiper: any) { + console.log('onInit'); + }, + onClick(swiper: any, e: any) { + console.log('onClick'); + }, + onTap(swiper: any, e: any) { + console.log('onTap'); + }, + onDoubleTap(swiper: any, e: any) { + console.log('onDoubleTap'); + }, + onSliderMove(swiper: any, e: any) { + console.log('onSliderMove'); + }, + onSlideChangeStart(swiper: any) { + console.log('onSlideChangeStart'); + }, + onSlideChangeEnd(swiper: any) { + console.log('onSlideChangeEnd'); + }, + onTransitionStart(swiper: any) { + console.log('onTransitionStart'); + }, + onTransitionEnd(swiper: any) { + console.log('onTransitionEnd'); + }, + onReachBeginning(swiper: any) { + console.log('onReachBeginning'); + }, + onReachEnd(swiper: any) { + console.log('onReachEnd'); + } + }; + }; +} +// 32-scroll-container.html +function scrollContainer() { + const swiper = new Swiper('.swiper-container', { + scrollbar: '.swiper-scrollbar', + direction: 'vertical', + slidesPerView: 'auto', + mousewheelControl: true, + freeMode: true + }); +} +// 32-slideable-menu.html +function slideableMenu() { + const toggleMenu = () => { + if (swiper.previousIndex === 0) + swiper.slidePrev(); + }; + const menuButton = document.getElementsByClassName('menu-button')[0]; + const swiper = new Swiper('.swiper-container', { + slidesPerView: 'auto', + initialSlide: 1, + resistanceRatio: .00000000000001, + onSlideChangeStart: (slider) => { + if (slider.activeIndex === 0) { + menuButton.classList.add('cross'); + menuButton.removeEventListener('click', toggleMenu, false); + } else + menuButton.classList.remove('cross'); + }, + onSlideChangeEnd: (slider) => { + if (slider.activeIndex === 0) + menuButton.removeEventListener('click', toggleMenu, false); + else + menuButton.addEventListener('click', toggleMenu, false); + }, + slideToClickedSlide: true + }); +} +// 33-responsive-breakpoints.html +function responsiveBreakpoints() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + paginationClickable: true, + slidesPerView: 5, + spaceBetween: 50, + breakpoints: { + 1024: { + slidesPerView: 4, + spaceBetween: 40 + }, + 768: { + slidesPerView: 3, + spaceBetween: 30 + }, + 640: { + slidesPerView: 2, + spaceBetween: 20 + }, + 320: { + slidesPerView: 1, + spaceBetween: 10 + } + } + }); +} +// 34-autoheight.html +function autoheight() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + paginationClickable: true, + nextButton: '.swiper-button-next', + prevButton: '.swiper-button-prev', + autoHeight: true, // enable auto height + }); +} +// 35-effect-flip.html +function effectFlip() { + const swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + effect: 'flip', + grabCursor: true, + nextButton: '.swiper-button-next', + prevButton: '.swiper-button-prev' + }); +} +// 36-pagination-fraction.html +function paginationFraction() { + const swiper = new Swiper('.swiper-container', { + nextButton: '.swiper-button-next', + prevButton: '.swiper-button-prev', + pagination: '.swiper-pagination', + paginationType: 'fraction' + }); +} +// 37-pagination-progress.html +function paginationProgress() { + const swiper = new Swiper('.swiper-container', { + nextButton: '.swiper-button-next', + prevButton: '.swiper-button-prev', + pagination: '.swiper-pagination', + paginationType: 'progress' + }); +} +// 38-history.html +function historyDemo() { + const swiper = new Swiper('.swiper-container', { + spaceBetween: 50, + slidesPerView: 2, + centeredSlides: true, + slideToClickedSlide: true, + grabCursor: true, + nextButton: '.swiper-button-next', + prevButton: '.swiper-button-prev', + scrollbar: '.swiper-scrollbar', + pagination: '.swiper-pagination', + history: 'slide', + }); +} +// 38-jquery-ie9-loop.html +function jqueryIe9Loop() { + const swiper = new Swiper('.swiper-container', { + loop: true, + pagination: '.swiper-pagination', + paginationClickable: true, + nextButton: '.swiper-button-next', + prevButton: '.swiper-button-prev' + }); +} +// 39-zoom.html +function zoom() { + const swiper = new Swiper('.swiper-container', { + zoom: true, + pagination: '.swiper-pagination', + nextButton: '.swiper-button-next', + prevButton: '.swiper-button-prev' + }); +} diff --git a/types/swiper/v3/tsconfig.json b/types/swiper/v3/tsconfig.json new file mode 100644 index 0000000000..a06951e219 --- /dev/null +++ b/types/swiper/v3/tsconfig.json @@ -0,0 +1,33 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": false, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "swiper": [ + "swiper/v3" + ], + "swiper/*": [ + "swiper/v3/*" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "swiper-tests.ts" + ] +} diff --git a/types/swiper/v3/tslint.json b/types/swiper/v3/tslint.json new file mode 100644 index 0000000000..b236115191 --- /dev/null +++ b/types/swiper/v3/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // TODOs + "no-declare-current-package": false, + "no-single-declare-module": false + } +} From ed43fdd5b75c44831f29480243fe04ece531f0a2 Mon Sep 17 00:00:00 2001 From: Arne Schubert Date: Tue, 17 Apr 2018 02:43:33 +0200 Subject: [PATCH 0695/2153] Enhance definition for heapdump (#24927) * Enhance definition and according tests for heapdump * Add changes to fix the CI --- types/heapdump/heapdump-tests.ts | 23 +++++++++++++++++------ types/heapdump/index.d.ts | 4 +++- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/types/heapdump/heapdump-tests.ts b/types/heapdump/heapdump-tests.ts index 49019f83fc..80306b9d32 100644 --- a/types/heapdump/heapdump-tests.ts +++ b/types/heapdump/heapdump-tests.ts @@ -1,9 +1,20 @@ import * as heapdump from 'heapdump'; -heapdump.writeSnapshot('/tmp/myDump', (err) => { - if (err) { - console.log('Failed to dump heap: ' + err); - } else { - console.log('Successfully dumped heap!'); - } +let strValue = ""; +let errValue = new Error(strValue); +let nullValue = null; +let undefinedValue; + +heapdump.writeSnapshot(strValue, (err, filename) => { + errValue = err as Error; + nullValue = err as null; + strValue = filename as string; + undefinedValue = filename as undefined; +}); + +heapdump.writeSnapshot((err, filename) => { + errValue = err as Error; + nullValue = err as null; + strValue = filename as string; + undefinedValue = filename as undefined; }); diff --git a/types/heapdump/index.d.ts b/types/heapdump/index.d.ts index d4e0477a32..1473ebb70a 100644 --- a/types/heapdump/index.d.ts +++ b/types/heapdump/index.d.ts @@ -2,5 +2,7 @@ // Project: https://github.com/bnoordhuis/node-heapdump // Definitions by: weekens // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 -export function writeSnapshot(dumpFileName: string, callback: (err?: Error) => void): void; +export function writeSnapshot(dumpFileName?: string, callback?: (err: Error | null, filename: string | undefined) => void): void; +export function writeSnapshot(callback: (err: Error | null, filename: string | undefined) => void): void; From 23c8bbf227ffec759d835f29c126f25298dfb2b7 Mon Sep 17 00:00:00 2001 From: Evan Hahn Date: Mon, 16 Apr 2018 17:45:19 -0700 Subject: [PATCH 0696/2153] connect: Add `NextFunction` for `next`, fix `err` parameter (#24883) --- types/connect/connect-tests.ts | 19 +++++++++++++++++-- types/connect/index.d.ts | 7 +++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/types/connect/connect-tests.ts b/types/connect/connect-tests.ts index 5a7590a9a0..669a146a28 100644 --- a/types/connect/connect-tests.ts +++ b/types/connect/connect-tests.ts @@ -4,13 +4,23 @@ import connect = require("connect"); const app = connect(); // log all requests -app.use((req: http.IncomingMessage, res: http.ServerResponse, next: Function) => { +app.use((req: http.IncomingMessage, res: http.ServerResponse, next: connect.NextFunction) => { console.log(req, res); next(); }); +// "Throw" an Error +app.use((req: http.IncomingMessage, res: http.ServerResponse, next: connect.NextFunction) => { + next(new Error("Something went wrong!")); +}); + +// "Throw" a number +app.use((req: http.IncomingMessage, res: http.ServerResponse, next: connect.NextFunction) => { + next(404); +}); + // Stop on errors -app.use((err: Error, req: http.IncomingMessage, res: http.ServerResponse, next: Function) => { +app.use((err: any, req: http.IncomingMessage, res: http.ServerResponse, next: connect.NextFunction) => { if (err) { return res.end(`Error: ${err}`); } @@ -18,6 +28,11 @@ app.use((err: Error, req: http.IncomingMessage, res: http.ServerResponse, next: next(); }); +// Use legacy `Function` for `next` parameter. +app.use((req: http.IncomingMessage, res: http.ServerResponse, next: Function) => { + next(); +}); + // respond to all requests app.use((req: http.IncomingMessage, res: http.ServerResponse) => { res.end("Hello from Connect!\n"); diff --git a/types/connect/index.d.ts b/types/connect/index.d.ts index 8cebd6ba78..4efddb1e7f 100644 --- a/types/connect/index.d.ts +++ b/types/connect/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for connect v3.4.0 // Project: https://github.com/senchalabs/connect // Definitions by: Maxime LUCE +// Evan Hahn // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -17,9 +18,11 @@ declare function createServer(): createServer.Server; declare namespace createServer { export type ServerHandle = HandleFunction | http.Server; + type NextFunction = (err?: any) => void; + export type SimpleHandleFunction = (req: http.IncomingMessage, res: http.ServerResponse) => void; - export type NextHandleFunction = (req: http.IncomingMessage, res: http.ServerResponse, next: Function) => void; - export type ErrorHandleFunction = (err: Error, req: http.IncomingMessage, res: http.ServerResponse, next: Function) => void; + export type NextHandleFunction = (req: http.IncomingMessage, res: http.ServerResponse, next: NextFunction) => void; + export type ErrorHandleFunction = (err: any, req: http.IncomingMessage, res: http.ServerResponse, next: NextFunction) => void; export type HandleFunction = SimpleHandleFunction | NextHandleFunction | ErrorHandleFunction; export interface ServerStackItem { From 24805d40238fa5a3ff18f62b78e6096a8259bcc7 Mon Sep 17 00:00:00 2001 From: earshinov Date: Tue, 17 Apr 2018 03:55:15 +0300 Subject: [PATCH 0697/2153] [ckeditor] Various additions to the typings (#24856) * Declare that `CKEDITOR` has event subscription interface for global events like `"instanceCreated"`. Documentation link: https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR.html#Events * Declare `CKEDITOR.editor.getSelectedHtml` with overloads. Documentation link: https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.editor-method-getSelectedHtml * Declare some arguments as optional Documentation links: * https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dom.event-method-preventDefault * https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dom.range-method-createBookmark2 * https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_dom_node.html#method-getAddress * https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dom.range-method-getCommonAncestor * Fix typings of `createBookmark[s][2]`: * Properly declare methods `createBookmarks[2]` instead of `createBookmark[2]` on `CKEDITOR.dom.rangeList`. Documentation link: https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_dom_rangeList.html#method-createBookmarks * Use return type of `bookmark[]` for "intrusive bookmarks" everywhere as in `CKEDITOR.dom.range.createBookmark`. * Declare parameters of `CKEDITOR.dom.selection.createBoomarks[2]` as required `Object`'s to follow the documentation. Documentation link: https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_dom_selection.html#method-createBookmarks * Declare method `CKEDITOR.dom.node.remove` mistakenly named `move` in the typings. * Declare `CKEDITOR.dom.range.setEnd{Before,After}` in addition to `setStart{Before,After}`. Documentation links: * https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dom.range-method-setEndAfter * https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dom.range-method-setEndBefore * Declare some `CKEDITOR.tools` Documentation links: * https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.tools-method-copy * https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.tools-method-isArray * https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.tools-method-override * https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.tools-method-prototypedCopy * Declare `CKEDITOR.plugins.registered`. Documentation link: https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.resourceManager-property-registered * Declare `CKEDITOR.htmlParser.element.addClass` in addition to `removeClass` and `hasClass`. Documentation link: https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.htmlParser.element-method-addClass * Declare `CKEDITOR.htmlParser.{element,fragment}.forEach`. Documentation links: * https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.htmlParser.element-method-forEach * https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.htmlParser.fragment-method-forEach * Coding style: Convert to single quotes and spaces for indentation. * Make `fileName` parameter of `CKEDITOR.plugins.addExternal` optional. Documentation link: https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_plugins.html#method-addExternal * Make `editable` as a class and declare its constructor. Documentation link: https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_editable.html#method-constructor --- types/ckeditor/ckeditor-tests.ts | 116 ++++++++++++++++++++++++++----- types/ckeditor/index.d.ts | 50 +++++++++---- 2 files changed, 136 insertions(+), 30 deletions(-) diff --git a/types/ckeditor/ckeditor-tests.ts b/types/ckeditor/ckeditor-tests.ts index 03f8a1ab3e..1a906bc26e 100644 --- a/types/ckeditor/ckeditor-tests.ts +++ b/types/ckeditor/ckeditor-tests.ts @@ -37,6 +37,13 @@ function test_CKEDITOR() { CKEDITOR.replaceAll((textarea, config) => false); } +function test_CKEDITOR_events() { + CKEDITOR.on('instanceCreated', function(event) { + // $ExpectType editor + event.editor; + }); +} + function test_config() { var config1: CKEDITOR.config = { toolbar: 'basic', @@ -55,18 +62,18 @@ function test_config() { var config3: CKEDITOR.config = { toolbarGroups: [ { name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, - { name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] }, - { name: 'links', groups: [ 'links' ] }, - { name: 'insert', groups: [ 'insert' ] }, - { name: 'tools', groups: [ 'tools' ] }, - { name: 'document', groups: [ 'mode' ] }, - { name: 'about', groups: [ 'about' ] }, - '/', - { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, - { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'paragraph' ] }, - '/', - { name: 'styles', groups: [ 'styles' ] }, - { name: 'colors', groups: [ 'colors' ] }, + { name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] }, + { name: 'links', groups: [ 'links' ] }, + { name: 'insert', groups: [ 'insert' ] }, + { name: 'tools', groups: [ 'tools' ] }, + { name: 'document', groups: [ 'mode' ] }, + { name: 'about', groups: [ 'about' ] }, + '/', + { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, + { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'paragraph' ] }, + '/', + { name: 'styles', groups: [ 'styles' ] }, + { name: 'colors', groups: [ 'colors' ] }, ], } } @@ -211,7 +218,7 @@ function test_dom_event() { domEvent.getTarget().addClass('clicked'); }); element.on('click', ev=> { - var domEvent = ev.data; + var domEvent = ev.data as CKEDITOR.dom.event; domEvent.preventDefault(); }); } @@ -344,12 +351,14 @@ function test_adding_dialog_by_definition() { }); } -function test_adding_plugin() { +function test_plugins() { CKEDITOR.plugins.add( 'abbr', { init: function( editor: CKEDITOR.editor ) { // empty logic } }); + + console.log(CKEDITOR.plugins.registered['abbr']); } function test_adding_widget() { @@ -512,7 +521,80 @@ function test_editor_instance_event() { } function test_dtd() { - var brConsideredEmptyTag = CKEDITOR.dtd.$empty["br"]; - var spanCanContainText = CKEDITOR.dtd["span"]["#"]; - var divCanContainSpan = CKEDITOR.dtd["div"]["span"]; + var brConsideredEmptyTag = CKEDITOR.dtd.$empty['br']; + var spanCanContainText = CKEDITOR.dtd['span']['#']; + var divCanContainSpan = CKEDITOR.dtd['div']['span']; +} + +function test_getSelectedHtml() { + var textarea = document.createElement('textarea'); + var editor = CKEDITOR.replace(textarea); + + // $ExpectType documentFragment + var sel1 = editor.getSelectedHtml(); + console.log(sel1); + + // $ExpectType documentFragment + var sel2 = editor.getSelectedHtml(false); + console.log(sel2); + + // $ExpectType string + var sel3 = editor.getSelectedHtml(true); + console.log(sel3); + + // $ExpectType string | documentFragment + var sel4 = editor.getSelectedHtml(Math.random() > 0.5); + console.log(sel4); +} + +function test_element() { + var el = CKEDITOR.document.getById('myElement'); + el.addClass('class'); + console.log(el.hasClass('class')); + el.removeClass('class'); +} + +function test_selection() { + var editor = new CKEDITOR.editor(); + var testNode = CKEDITOR.document.getById('myElement'); + + var selection = editor.getSelection(); + var ranges = selection.getRanges(); + for (var i = 0, c = ranges.length; i < c; i++) { + var range = ranges[i]; + range.setStartBefore(testNode); + range.setStartAfter(testNode); + range.setEndBefore(testNode); + range.setEndAfter(testNode); + } +} + +function test_tools() { + var obj = { key: 'value' }; + CKEDITOR.tools.clone(obj); + CKEDITOR.tools.copy(obj); + CKEDITOR.tools.prototypedCopy(obj); + + console.log(CKEDITOR.tools.isArray([1])); // true + console.log(CKEDITOR.tools.isArray(obj)); // false + console.log(CKEDITOR.tools.isArray(null)); // false + console.log(CKEDITOR.tools.isArray(undefined)); // false + + CKEDITOR.tools.override(parseInt, function(_parseInt) { + return function(value: any, radix?: number) { + return _parseInt(value, radix); + }; + }); +} + +function test_htmlParser() { + var html = '
    text
    '; + var fragment = CKEDITOR.htmlParser.fragment.fromHtml(html); + fragment.forEach(function(node) { + if (node instanceof CKEDITOR.htmlParser.element) { + node.forEach(function(node) { + console.log(node); + }); + } + }, CKEDITOR.NODE_ELEMENT, true); } diff --git a/types/ckeditor/index.d.ts b/types/ckeditor/index.d.ts index e26abd16b4..3370479bff 100644 --- a/types/ckeditor/index.d.ts +++ b/types/ckeditor/index.d.ts @@ -80,7 +80,6 @@ declare namespace CKEDITOR { var version: string; var config: config; - // Methods function add(editor: editor): void; function addCss(css: string): void; @@ -101,6 +100,17 @@ declare namespace CKEDITOR { function replaceAll(className?: string): void; function replaceAll(assertionFunction: (textarea: HTMLTextAreaElement, config: config) => boolean): void; + // Event interface + function capture(): void; + function define(name: string, meta: Object): void; + function fire(eventName: string, data?: Object, editor?: editor): any; + function fireOnce(eventName: string, data?: Object, editor?: editor): any; + function hasListeners(eventName: string): boolean; + function on(eventName: string, listenerFunction: (eventInfo: eventInfo) => void, scopeObj?: Object, listenerData?: Object, priority?: number): void; + function once(eventName: string, listenerFunction: (eventInfo: eventInfo) => void, scopeObj?: Object, listenerData?: Object, priority?: number): void; + function removeAllListeners(): void; + function removeListener(eventName: string, listenerFunction: (eventInfo: eventInfo) => void): void; + type listenerRegistration = { removeListener: () => void; } @@ -321,11 +331,11 @@ declare namespace CKEDITOR { deleteContents(mergeThen?: boolean): void; extractContents(mergeThen?: boolean): documentFragment; createBookmark(serializable?: boolean): bookmark; - createBookmark2(normalized: boolean): Object; + createBookmark2(normalized?: boolean): Object; createIterator(): iterator; moveToBookmark(bookmark: Object): void; getBoundaryNodes(): { startNode: node; endNode: node; }; - getCommonAncestor(includeSelf: boolean, ignoreTextNode: boolean): element; + getCommonAncestor(includeSelf?: boolean, ignoreTextNode?: boolean): element; optimize(): void; optimizeBookmark(): void; trim(ignoreStart?: boolean, ignoreEnd?: boolean): void; @@ -337,6 +347,8 @@ declare namespace CKEDITOR { selectNodeContents(node: node): void; setStart(startNode: node, startOffset: number): void; setEnd(endNode: node, endOffset: number): void; + setEndAfter(node: node): void; + setEndBefore(node: node): void; setStartAfter(node: node): void; setStartBefore(node: node): void; setStartAt(node: node, position: number): void; @@ -380,8 +392,8 @@ declare namespace CKEDITOR { constructor(target: document); constructor(target: element); constructor(target: selection); - createBookmarks(serializable: Object): any[]; - createBookmarks2(normalized?: Object): any[]; + createBookmarks(serializable: Object): bookmark[]; + createBookmarks2(normalized: Object): Object[]; fake(element: element): void; getCommonAncestor(): element; getNative(): Object; @@ -406,8 +418,8 @@ declare namespace CKEDITOR { constructor(ranges: range[]); constructor(range: range); createIterator(): rangeListIterator; - createBokmark(serializable: boolean): Object[]; - createBookmark2(normalized: boolean): Object[]; + createBokmarks(serializable?: boolean): bookmark[]; + createBookmarks2(normalized?: boolean): Object[]; moveToBookmark(bookmarks: Object[]): void; } @@ -431,7 +443,7 @@ declare namespace CKEDITOR { insertAfter(node: node): node; insertBefore(node: node): node; insertBeforeMe(node: node): node; - getAddress(normalized: boolean): Object[]; + getAddress(normalized?: boolean): Object[]; getDocument(): document; getIndex(normalized?: boolean): number; getNextSourceNode(startFromSibling: Object, nodeType: Object, guard: Object): void; @@ -444,7 +456,7 @@ declare namespace CKEDITOR { getPosition(otherNode: Object): void; getAscendant(reference: string, includeSelf?: boolean): node; hasAscendant(name: Object, includeSelf: any): boolean; - move(preserveChildren?: boolean): node; + remove(preserveChildren?: boolean): node; replace(nodeToReplace: node): void; trim(): void; ltrim(): void; @@ -464,7 +476,7 @@ declare namespace CKEDITOR { constructor(domEvent: Event); getKey(): number; getKeystroke(): number; - preventDefault(stopPropagation: boolean): void; + preventDefault(stopPropagation?: boolean): void; stopPropagation(): void; getTarget(): node; getPhase(): number; @@ -878,7 +890,8 @@ declare namespace CKEDITOR { applyToRange(range: Range, editor: editor): void; } - interface editable extends dom.element { + class editable extends dom.element { + constructor(editor: editor, element: HTMLElement | dom.element); hasFocus: boolean; attachListener(obj: event | editable, eventName: string, listenerFunction: (ei: eventInfo) => void, scopeobj?: {}, listenerData?: any, priority?: number): listenerRegistration; @@ -1077,13 +1090,13 @@ declare namespace CKEDITOR { function add(name: string, definition: IPluginDefinition): void; function add(name: string): void; - function addExternal(name: string, path: string, fileName: string): void; + function addExternal(name: string, path: string, fileName?: string): void; function get(name: string): any; function getFilePath(name: string): string; function getPath(name: string): string; function load(name: string, callback: Function, scope?: Object): void; function setLang(pluginName: string, languageCode: string, languageEntries: any): void; - + var registered: {[key: string]: IPluginDefinition}; } interface IMenuItemDefinition { @@ -1155,6 +1168,9 @@ declare namespace CKEDITOR { getData(noEvents?: Object): string; getMenuItem(name: string): Object; getResizable(forContents: boolean): dom.element; + getSelectedHtml(toString?: false): dom.documentFragment; + getSelectedHtml(toString: true): string; + getSelectedHtml(toString?: boolean): CKEDITOR.dom.documentFragment | string; getSelection(forceRealSelection?: boolean): dom.selection; getSnapshot(): string; getStylesSet(callback: Function): void; @@ -1839,9 +1855,11 @@ declare namespace CKEDITOR { type: number; add(node: node): number; add(node: node, index: number): void; + addClass(className: string): void; clone(): element; filter(filter: filter): boolean; filterChildren(filter: filter): void; + forEach(callback: (node: node, type?: number) => void|false, type?: number, skipRoot?: boolean): void; writeHtml(writer: basicWriter, filter: filter): void; writeChildrenHtml(writer: basicWriter, filter: filter): void; replaceWithChildren(): void; @@ -1872,6 +1890,7 @@ declare namespace CKEDITOR { add(node: node, index?: number): void; filter(filter: filter): void; filterChildren(filter: filter, filterRoot?: boolean): void; + forEach(callback: (node: node, type?: number) => void|false, type?: number, skipRoot?: boolean): void; writeHtml(writer: basicWriter, filter?: filter): void; writeChildrenHtml(writer: basicWriter, filter?: filter, filterRoot?: boolean): void; forEach(callback: (node: node, type?: number) => boolean, type?: number, skipRoot?: boolean): void; @@ -1909,8 +1928,13 @@ declare namespace CKEDITOR { namespace tools { var callFunction: Function; + function clone(source: Object): Object; + function copy(source: Object): Object; function enableHtml5Elements(doc: Object, withAppend?: Boolean): void; + function isArray(object: any|null|undefined): object is T[]; + function override(originalFunction: T, functionBuilder: (originalFunction: T) => T): T; function parseCssText(styleText: string, normalize?: Boolean, nativeNormalize?: Boolean): { [key: string]: string } + function prototypedCopy(source: Object): Object; function writeCssText(style: { [key: string]: string }, sort?: Boolean): string; } From 92477a4d52a9675db636227c1934037355930191 Mon Sep 17 00:00:00 2001 From: Konrad Mattheis Date: Tue, 17 Apr 2018 02:56:24 +0200 Subject: [PATCH 0698/2153] fix functions that have a object with multiple return values like GetHyperCubeContinuousData (#25010) Signed-off-by: Konrad Mattheis --- types/qlik-engineapi/index.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/types/qlik-engineapi/index.d.ts b/types/qlik-engineapi/index.d.ts index 309a30f2b0..f0f95301c3 100644 --- a/types/qlik-engineapi/index.d.ts +++ b/types/qlik-engineapi/index.d.ts @@ -3007,7 +3007,7 @@ declare namespace EngineAPI { * @param qTable - Name of the table. This parameter must be set for XLS, XLSX, HTML and XML files. * @returns - return a Promise Array of DataField or String. */ - getFileTableFields(qConnectionId: string, qDataFormat: IFileDataFormat, qTable: string, qRelativePath?: string): Promise | Promise; + getFileTableFields(qConnectionId: string, qDataFormat: IFileDataFormat, qTable: string, qRelativePath?: string): Promise<{qFields: IDataField[], qFormatSpec: string}>; /** * Lists the values in a table for a folder connection. @@ -3017,7 +3017,7 @@ declare namespace EngineAPI { * @param qTable - Name of the table. This parameter must be set for XLS, XLSX, HTML and XML files. * @returns - return a Promise or . */ - getFileTablePreview(qConnectionId: string, qRelativePath: string, qDataFormat: IFileDataFormat, qTable: string): Promise | Promise; + getFileTablePreview(qConnectionId: string, qRelativePath: string, qDataFormat: IFileDataFormat, qTable: string): Promise<{qPreview: IDataRecord[], qFormatSpec: string}>; /** * Lists the tables and fields of a JSON or XML file for a folder connection. @@ -3111,7 +3111,7 @@ declare namespace EngineAPI { * Note: This method is deprecated (not recommended to use). Use GetLibraryContent method instead. * @returns - return a Promise Boolean or MediaList */ - getMediaList(): Promise | Promise; + getMediaList(): Promise; /** * Returns the handle of a measure. @@ -3193,7 +3193,7 @@ declare namespace EngineAPI { * @param qIncludeSysVars - If set to true, the system variables are included. * @returns - return a Promise or */ - getTablesAndKeys(qWindowSize: ISize, qNullSize: ISize, qCellHeight: number, qSyntheticMode: boolean, qIncludeSysVars: boolean): Promise | Promise; + getTablesAndKeys(qWindowSize: ISize, qNullSize: ISize, qCellHeight: number, qSyntheticMode: boolean, qIncludeSysVars: boolean): Promise<{qtr: ITableRecord[], qk: ISourceKeyRecord[]}>; /** * Fetches updated variables after a statement execution. @@ -5458,7 +5458,7 @@ declare namespace EngineAPI { * Options.MaxNbrTicks - maximum number of ticks. * @returns - A Promise or or */ - getHyperCubeContinuousData(qPath: string, qOptions: IContinuousDataOptions[]): Promise | Promise | Promise; + getHyperCubeContinuousData(qPath: string, qOptions: IContinuousDataOptions[]): Promise<{qDataPages: INxDataPage[], qAxisData: INxAxisData[]}>; /** * Retrieves the values of a chart, a table, or a scatter plot. It is possible to retrieve specific pages of data. @@ -5586,7 +5586,7 @@ declare namespace EngineAPI { * - Options.MaxNbrTicks - maximum number of ticks. * @returns - A data set Array of (NxDataPage) or (NxAxisData) */ - getListObjectContinuousData(qPath: string, qOptions: IContinuousDataOptions): Promise | Promise; + getListObjectContinuousData(qPath: string, qOptions: IContinuousDataOptions): Promise<{qDataPages: INxDataPage, qAxisData: INxAxisData[]}>; /** * Retrieves the values of a list object. From f929c81119f6103fe7e2ce8ee16102a3d6d832ee Mon Sep 17 00:00:00 2001 From: Juanjo Diaz Date: Tue, 17 Apr 2018 03:56:41 +0300 Subject: [PATCH 0699/2153] Add new unwindBlank to json2csv (#25043) --- types/json2csv/JSON2CSVBase.d.ts | 1 + types/json2csv/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/types/json2csv/JSON2CSVBase.d.ts b/types/json2csv/JSON2CSVBase.d.ts index d65a3cc297..c5f328db1f 100644 --- a/types/json2csv/JSON2CSVBase.d.ts +++ b/types/json2csv/JSON2CSVBase.d.ts @@ -13,6 +13,7 @@ export declare namespace json2csv { fields?: Array>; ndjson?: boolean; unwind?: string | Array; + unwindBlank?: boolean; flatten?: boolean; defaultValue?: string; quote?: string; diff --git a/types/json2csv/index.d.ts b/types/json2csv/index.d.ts index 159dec6eb1..55a1829625 100644 --- a/types/json2csv/index.d.ts +++ b/types/json2csv/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for json2csv 4.0 +// Type definitions for json2csv 4.1 // Project: https://github.com/zemirco/json2csv // Definitions by: Juanjo Diaz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 0b0483cf788fab26a93e907a0ef6c329cdcba20e Mon Sep 17 00:00:00 2001 From: Shayne Hartford Date: Tue, 17 Apr 2018 10:57:59 -0400 Subject: [PATCH 0700/2153] @types/snekfetch: Added optional Snekfetch.SnekfetchOptions (#24754) * Edited version * Because travis succ * Added friend's suggestions * Fixed * Upgraded typescript version --- types/snekfetch/index.d.ts | 78 +++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/types/snekfetch/index.d.ts b/types/snekfetch/index.d.ts index 71ef08d9a1..ac77f8a572 100644 --- a/types/snekfetch/index.d.ts +++ b/types/snekfetch/index.d.ts @@ -1,8 +1,10 @@ -// Type definitions for snekfetch 3.1 +// Type definitions for snekfetch 3.6 // Project: https://github.com/GusCaplan/snekfetch // Definitions by: Iker Pérez Brunelli +// Shayne Hartford +// Yukine // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.4 /// @@ -71,48 +73,48 @@ declare class Snekfetch extends Readable { constructor(method: Snekfetch.methods, url: string, opts?: Snekfetch.SnekfetchOptions); - static acl(url: string): Snekfetch; - static bind(url: string): Snekfetch; - static checkout(url: string): Snekfetch; - static connect(url: string): Snekfetch; - static copy(url: string): Snekfetch; - static delete(url: string): Snekfetch; - static get(url: string): Snekfetch; - static head(url: string): Snekfetch; - static link(url: string): Snekfetch; - static lock(url: string): Snekfetch; - static msearch(url: string): Snekfetch; - static merge(url: string): Snekfetch; - static mkactivity(url: string): Snekfetch; - static mkcalendar(url: string): Snekfetch; - static mkcol(url: string): Snekfetch; - static move(url: string): Snekfetch; - static notify(url: string): Snekfetch; - static options(url: string): Snekfetch; - static patch(url: string): Snekfetch; - static post(url: string): Snekfetch; - static propfind(url: string): Snekfetch; - static proppatch(url: string): Snekfetch; - static purge(url: string): Snekfetch; - static put(url: string): Snekfetch; - static rebind(url: string): Snekfetch; - static report(url: string): Snekfetch; - static search(url: string): Snekfetch; - static subscribe(url: string): Snekfetch; - static trace(url: string): Snekfetch; - static unbind(url: string): Snekfetch; - static unlink(url: string): Snekfetch; - static unlock(url: string): Snekfetch; - static unsubscribe(url: string): Snekfetch; - static brew(url: string): Snekfetch; + static acl(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static bind(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static checkout(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static connect(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static copy(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static delete(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static get(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static head(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static link(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static lock(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static msearch(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static merge(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static mkactivity(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static mkcalendar(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static mkcol(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static move(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static notify(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static options(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static patch(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static post(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static propfind(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static proppatch(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static purge(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static put(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static rebind(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static report(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static search(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static subscribe(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static trace(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static unbind(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static unlink(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static unlock(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static unsubscribe(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; + static brew(url: string, opts?: Snekfetch.SnekfetchOptions): Snekfetch; - query(name: string, value: string): Snekfetch; + query(name: string | { [key: string]: string | string[] }, value?: string): Snekfetch; set(name: string | { [key: string]: string | string[] }, value?: string | string[]): Snekfetch; attach(name: string, data: string | object | Buffer, filename?: string): Snekfetch; - send(data?: any): Snekfetch; + send(data?: string|Buffer|object): Snekfetch; then(): Promise; then(resolver: (res: Snekfetch.Result) => T, rejector?: (err: Error) => any): Promise; From 33babb4010b71099f0fe6b05bad7527eb35ad149 Mon Sep 17 00:00:00 2001 From: Aneil Mallavarapu Date: Tue, 17 Apr 2018 07:58:44 -0700 Subject: [PATCH 0701/2153] Add types/jsonwebtokens-promisified (#25038) * Add jsonwebtoken-promisified * Add types/jsonwebtoken-promisified * Remove tslint ignore statements & fix issues --- .github/CODEOWNERS | 1 + types/jsonwebtoken-promisified/index.d.ts | 188 ++++++++++++++++++ .../jsonwebtoken-promisified-tests.ts | 148 ++++++++++++++ types/jsonwebtoken-promisified/tsconfig.json | 23 +++ types/jsonwebtoken-promisified/tslint.json | 3 + 5 files changed, 363 insertions(+) create mode 100644 types/jsonwebtoken-promisified/index.d.ts create mode 100644 types/jsonwebtoken-promisified/jsonwebtoken-promisified-tests.ts create mode 100644 types/jsonwebtoken-promisified/tsconfig.json create mode 100644 types/jsonwebtoken-promisified/tslint.json diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f3343415f0..7f3c8671de 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1858,6 +1858,7 @@ /types/jsonstream/ @Bartvds /types/jsontoxml/ @benstevens48 /types/jsonwebtoken/ @SomaticIT @danielheim @brikou +/types/jsonwebtoken-promisified @aneilbaboo /types/jspdf/ @amberjs /types/jsqrcode/ @lordazzi /types/jsrender/ @zakki diff --git a/types/jsonwebtoken-promisified/index.d.ts b/types/jsonwebtoken-promisified/index.d.ts new file mode 100644 index 0000000000..80f28e6528 --- /dev/null +++ b/types/jsonwebtoken-promisified/index.d.ts @@ -0,0 +1,188 @@ +// Type definitions for jsonwebtoken-promisified 1.0 +// Project: https://github.com/joepie91/node-jsonwebtoken-promisified +// Definitions by: Maxime LUCE , +// Daniel Heim , +// Brice BERNARD +// Aneil Mallavarapu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +export class JsonWebTokenError extends Error { + inner: Error; + + constructor(message: string, error?: Error); +} + +export class TokenExpiredError extends JsonWebTokenError { + expiredAt: number; + + constructor(message: string, expiredAt: number); +} + +export class NotBeforeError extends JsonWebTokenError { + date: Date; + + constructor(message: string, date: Date); +} + +export interface SignOptions { + /** + * Signature algorithm. Could be one of these values : + * - HS256: HMAC using SHA-256 hash algorithm (default) + * - HS384: HMAC using SHA-384 hash algorithm + * - HS512: HMAC using SHA-512 hash algorithm + * - RS256: RSASSA using SHA-256 hash algorithm + * - RS384: RSASSA using SHA-384 hash algorithm + * - RS512: RSASSA using SHA-512 hash algorithm + * - ES256: ECDSA using P-256 curve and SHA-256 hash algorithm + * - ES384: ECDSA using P-384 curve and SHA-384 hash algorithm + * - ES512: ECDSA using P-521 curve and SHA-512 hash algorithm + * - none: No digital signature or MAC value included + */ + algorithm?: string; + keyid?: string; + /** {string} - expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms.js). Eg: 60, "2 days", "10h", "7d" */ + expiresIn?: string | number; + /** {string} - expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms.js). Eg: 60, "2 days", "10h", "7d" */ + notBefore?: string | number; + audience?: string | string[]; + subject?: string; + issuer?: string; + jwtid?: string; + noTimestamp?: boolean; + header?: object; + encoding?: string; +} + +export interface VerifyOptions { + algorithms?: string[]; + audience?: string | string[]; + clockTimestamp?: number; + clockTolerance?: number; + issuer?: string | string[]; + ignoreExpiration?: boolean; + ignoreNotBefore?: boolean; + jwtid?: string; + subject?: string; + /** + * @deprecated + * {string} - Max age of token + */ + maxAge?: string; +} + +export interface DecodeOptions { + complete?: boolean; + json?: boolean; +} + +export type VerifyCallback = ( + err: JsonWebTokenError | NotBeforeError | TokenExpiredError, + decoded: object | string +) => void; + +export type SignCallback = (err: Error, encoded: string) => void; + +export type Secret = string | Buffer | { key: string; passphrase: string }; + +/** + * Synchronously sign the given payload into a JSON Web Token string + * @param payload - Payload to sign, could be an literal, buffer or string + * @param secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA. + * @param [options] - Options for the signature + * @returns The JSON Web Token string + */ +export function sign( + payload: string | Buffer | object, + secretOrPrivateKey: Secret, + options?: SignOptions, +): string; + +/** + * Sign the given payload into a JSON Web Token string + * @param payload - Payload to sign, could be an literal, buffer or string + * @param secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA. + * @param options - Options for the signature + * @param callback - Callback to get the encoded token on + */ +export function sign( + payload: string | Buffer | object, + secretOrPrivateKey: Secret, + callback: SignCallback, +): void; +export function sign( + payload: string | Buffer | object, + secretOrPrivateKey: Secret, + options: SignOptions, + callback: SignCallback, +): void; + +/** + * Sign the given payload asynchronously into a JSON Web Token String + * @param payload - Payload to sign, could be an literal, buffer or string + * @param secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA. + * @param [options] - Options for the signature + * @returns A promise providing JSON Web Token string + */ +export function signAsync( + payload: string | Buffer | object, + secretOrPrivateKey: Secret, + options?: SignOptions +): Promise; + +/** + * Synchronously verify given token using a secret or a public key to get a decoded token + * @param token - JWT string to verify + * @param secretOrPublicKey - Either the secret for HMAC algorithms, or the PEM encoded public key for RSA and ECDSA. + * @param [options] - Options for the verification + * @returns The decoded token. + */ +export function verify( + token: string, + secretOrPublicKey: string | Buffer, + options?: VerifyOptions, +): object | string; + +/** + * Asynchronously verify given token using a secret or a public key to get a decoded token + * @param token - JWT string to verify + * @param secretOrPublicKey - Either the secret for HMAC algorithms, or the PEM encoded public key for RSA and ECDSA. + * @param options - Options for the verification + * @param callback - Callback to get the decoded token on + */ +export function verify( + token: string, + secretOrPublicKey: string | Buffer, + callback?: VerifyCallback +): void; +export function verify( + token: string, + secretOrPublicKey: string | Buffer, + options: VerifyOptions, + callback?: VerifyCallback +): void; + +/** + * Asynchronously verify given token using a secret or a public key to get a decoded token + * @param token - the JWT string to verify + * @param secretOrPublicKey - Either the secret for HMAC algorithms, or the PEM encoded public key for RSA and ECDSA. + * @returns - Promise returning the decoded token + */ +export function verifyAsync( + token: string, + secretOrPublicKey: string | Buffer, + options?: VerifyOptions +): Promise; + +/** + * Returns the decoded payload without verifying if the signature is valid. + * @param token - JWT string to decode + * @param [options] - Options for decoding + * @returns The decoded Token + */ +export function decode( + token: string, + options?: DecodeOptions, +): null | { [key: string]: any } | string; diff --git a/types/jsonwebtoken-promisified/jsonwebtoken-promisified-tests.ts b/types/jsonwebtoken-promisified/jsonwebtoken-promisified-tests.ts new file mode 100644 index 0000000000..bfa282bdee --- /dev/null +++ b/types/jsonwebtoken-promisified/jsonwebtoken-promisified-tests.ts @@ -0,0 +1,148 @@ +/** + * Test suite created by Maxime LUCE + * + * Created by using code samples from https://github.com/auth0/node-jsonwebtoken. + */ + +import jwt = require("jsonwebtoken-promisified"); +import fs = require("fs"); + +let token: string; +let cert: Buffer; + +interface TestObject { + foo: string; +} + +const testObject = { foo: "bar" }; + +/** + * jwt.sign + * https://github.com/auth0/node-jsonwebtoken#usage + */ +// sign with default (HMAC SHA256) +token = jwt.sign(testObject, "shhhhh"); + +// sign with default (HMAC SHA256) and single audience +token = jwt.sign(testObject, "shhhhh", { audience: "theAudience" }); + +// sign with default (HMAC SHA256) and multiple audiences +token = jwt.sign(testObject, "shhhhh", { + audience: ["audience1", "audience2"], +}); + +// sign with default (HMAC SHA256) and a keyid +token = jwt.sign(testObject, "shhhhh", { keyid: "theKeyId" }); + +// sign with RSA SHA256 +cert = fs.readFileSync("private.key"); // get private key +token = jwt.sign(testObject, cert, { algorithm: "RS256" }); + +// sign with encrypted RSA SHA256 private key (only PEM encoding is supported) +const privKey: Buffer = fs.readFileSync("encrypted_private.key"); // get private key +const secret = { key: privKey.toString(), passphrase: "keypwd" }; +token = jwt.sign(testObject, secret, { algorithm: "RS256" }); // the algorithm option is mandatory in this case + +// sign asynchronously +jwt.sign(testObject, cert, { algorithm: "RS256" }, ( + err: Error, + token: string, +) => { + console.log(token); +}); + +jwt.signAsync(testObject, cert, { algorithm: "RS256" }).then( + (token: string) => console.log(token) +); +/** + * jwt.verify + * https://github.com/auth0/node-jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback + */ +// verify a token symmetric +jwt.verify(token, "shhhhh", ( + err: jwt.JsonWebTokenError | jwt.NotBeforeError | jwt.TokenExpiredError, + decoded: object | string +) => { + const result = decoded as TestObject; + + console.log(result.foo); // bar +}); +jwt.verifyAsync(token, "shhhhh").then(decoded => { + const result = decoded as TestObject; + + console.log(result.foo); // bar +}); + +// use external time for verifying +jwt.verify(token, 'shhhhh', { clockTimestamp: 1 }, (err, decoded) => { + const result = decoded as TestObject; + + console.log(result.foo); // bar +}); +jwt.verifyAsync(token, 'shhhhh', { clockTimestamp: 1 }).then(decoded => { + const result = decoded as TestObject; + + console.log(result.foo); // bar +}); + +// invalid token +jwt.verify(token, "wrong-secret", (err, decoded) => { + // err + // decoded undefined +}); + +// verify a token asymmetric +cert = fs.readFileSync("public.pem"); // get public key +jwt.verify(token, cert, (err, decoded) => { + const result = decoded as TestObject; + + console.log(result.foo); // bar +}); + +jwt.verifyAsync(token, cert).then(decoded => { + const result = decoded as TestObject; + console.log(result.foo); // bar +}); + +// verify audience +cert = fs.readFileSync("public.pem"); // get public key +jwt.verify(token, cert, { audience: "urn:foo" }, (err, decoded) => { + // if audience mismatch, err == invalid audience +}); + +// verify issuer +cert = fs.readFileSync("public.pem"); // get public key +jwt.verify(token, cert, { audience: "urn:foo", issuer: "urn:issuer" }, ( + err, + decoded, +) => { + // if issuer mismatch, err == invalid issuer +}); + +// verify algorithm +cert = fs.readFileSync("public.pem"); // get public key +jwt.verify(token, cert, { algorithms: ["RS256"] }, (err, decoded) => { + // if algorithm mismatch, err == invalid algorithm +}); + +// verify without expiration check +cert = fs.readFileSync("public.pem"); // get public key +jwt.verify(token, cert, { ignoreExpiration: true }, (err, decoded) => { + // if ignoreExpration == false and token is expired, err == expired token +}); + +/** + * jwt.decode + * https://github.com/auth0/node-jsonwebtoken#jwtdecodetoken + */ +let decoded = jwt.decode(token); + +decoded = jwt.decode(token, { complete: false }); + +if (decoded !== null && typeof decoded === "object") { + console.log(decoded.foo); +} + +decoded = jwt.decode(token, { json: false }); + +decoded = jwt.decode(token, { complete: false, json: false }); diff --git a/types/jsonwebtoken-promisified/tsconfig.json b/types/jsonwebtoken-promisified/tsconfig.json new file mode 100644 index 0000000000..0b6053d82b --- /dev/null +++ b/types/jsonwebtoken-promisified/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jsonwebtoken-promisified-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jsonwebtoken-promisified/tslint.json b/types/jsonwebtoken-promisified/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/jsonwebtoken-promisified/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From f8b7232c91464659e706ad10f135dbb63423b6e8 Mon Sep 17 00:00:00 2001 From: Arne Schubert Date: Tue, 17 Apr 2018 16:59:02 +0200 Subject: [PATCH 0702/2153] Add new type definition for toobusy-js (#25019) * Add new definitions for toobusy-js * Change import according to the change-request --- types/toobusy-js/index.d.ts | 19 +++++++++++++++++++ types/toobusy-js/toobusy-js-tests.ts | 17 +++++++++++++++++ types/toobusy-js/tsconfig.json | 23 +++++++++++++++++++++++ types/toobusy-js/tslint.json | 1 + 4 files changed, 60 insertions(+) create mode 100644 types/toobusy-js/index.d.ts create mode 100644 types/toobusy-js/toobusy-js-tests.ts create mode 100644 types/toobusy-js/tsconfig.json create mode 100644 types/toobusy-js/tslint.json diff --git a/types/toobusy-js/index.d.ts b/types/toobusy-js/index.d.ts new file mode 100644 index 0000000000..bfa462228a --- /dev/null +++ b/types/toobusy-js/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for toobusy-js 0.5 +// Project: https://github.com/STRML/node-toobusy +// Definitions by: Arne Schubert +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = toobusy_js; + +declare function toobusy_js(): boolean; + +declare namespace toobusy_js { + function interval(newInterval: number): number; + function lag(): number; + function maxLag(newLag: number): number; + function smmothingFactor(newFactor: number): number; + function shutdown(): void; + function onLag(fn: (lag: number) => void, threshold?: number): void; + + function started(): boolean; +} diff --git a/types/toobusy-js/toobusy-js-tests.ts b/types/toobusy-js/toobusy-js-tests.ts new file mode 100644 index 0000000000..cf688a1911 --- /dev/null +++ b/types/toobusy-js/toobusy-js-tests.ts @@ -0,0 +1,17 @@ +import toobusy = require("toobusy-js"); + +let numberValue = 1; +let booleanValue = true; + +booleanValue = toobusy(); +booleanValue = toobusy.started(); + +numberValue = toobusy.interval(numberValue); +numberValue = toobusy.lag(); +numberValue = toobusy.maxLag(numberValue); +numberValue = toobusy.smmothingFactor(numberValue); + +toobusy.onLag((duration: number) => {}); +toobusy.onLag((duration: number) => {}, numberValue); + +toobusy.shutdown(); diff --git a/types/toobusy-js/tsconfig.json b/types/toobusy-js/tsconfig.json new file mode 100644 index 0000000000..061f0890c9 --- /dev/null +++ b/types/toobusy-js/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "toobusy-js-tests.ts" + ] +} diff --git a/types/toobusy-js/tslint.json b/types/toobusy-js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/toobusy-js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 1f555b0b4f8e1090da4fc59e7b50a58473b4e015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=98i=C4=8Da=C5=99?= Date: Tue, 17 Apr 2018 17:35:05 +0200 Subject: [PATCH 0703/2153] [react-virtualized] Grid - add onScrollbarPresenceChange to GridCoreProps (#25040) * Grid - add onScrollbarPresenceChange to GridCoreProps * Fix irregular whitespace --- types/react-virtualized/dist/es/Grid.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/types/react-virtualized/dist/es/Grid.d.ts b/types/react-virtualized/dist/es/Grid.d.ts index 86055132aa..593e594128 100644 --- a/types/react-virtualized/dist/es/Grid.d.ts +++ b/types/react-virtualized/dist/es/Grid.d.ts @@ -54,6 +54,11 @@ export type ScrollParams = { scrollTop: number; scrollWidth: number; }; +export type ScrollbarPresenceParams = { + horizontal: boolean; + size: number; + vertical: boolean; +}; export type SectionRenderedParams = RenderedSection; export type SCROLL_DIRECTION_HORIZONTAL = "horizontal"; export type SCROLL_DIRECTION_VERTICAL = "vertical"; @@ -237,6 +242,11 @@ export type GridCoreProps = { * ({ clientHeight, clientWidth, scrollHeight, scrollLeft, scrollTop, scrollWidth }): void */ onScroll?: (params: ScrollParams) => any; + /** + * Called whenever a horizontal or vertical scrollbar is added or removed. + * ({ horizontal: boolean, size: number, vertical: boolean }): void + */ + onScrollbarPresenceChange?: (params: ScrollbarPresenceParams) => any; /** * Callback invoked with information about the section of the Grid that was just rendered. * ({ columnStartIndex, columnStopIndex, rowStartIndex, rowStopIndex }): void From e460cfa0a3ac6d24a9a2ac9897054a71f1f1b04f Mon Sep 17 00:00:00 2001 From: Kyle Roach Date: Tue, 17 Apr 2018 11:35:25 -0400 Subject: [PATCH 0704/2153] (react-native) Adds SectionList scrollToLocation (#25050) --- types/react-native/index.d.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 288dfada20..4e48a85ba2 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -3736,6 +3736,14 @@ export interface SectionListData extends SectionBase { [key: string]: any; } +export interface SectionListScrollParams { + animated?: boolean; + itemIndex: number; + sectionIndex: number; + viewOffset?: number; + viewPosition?: number; +} + export interface SectionListProperties extends ScrollViewProperties { /** * Rendered in between adjacent Items within each section. @@ -3844,6 +3852,13 @@ export interface SectionListProperties extends ScrollViewProperties { * Only enabled by default on iOS because that is the platform standard there. */ stickySectionHeadersEnabled?: boolean; + + /** + * Scrolls to the item at the specified sectionIndex and itemIndex (within the section) + * positioned in the viewable area such that viewPosition 0 places it at the top + * (and may be covered by a sticky header), 1 at the bottom, and 0.5 centered in the middle. + */ + scrollToLocation?(params: SectionListScrollParams): void; } export interface SectionListStatic extends React.ComponentClass> {} From 2b5e8a5dd3d49bac33249726ba5b9cf5ea6b25cd Mon Sep 17 00:00:00 2001 From: Omar Diab Date: Tue, 17 Apr 2018 10:36:39 -0500 Subject: [PATCH 0705/2153] Fix missing splat in react-intl types (#25046) --- types/react-intl/index.d.ts | 2 +- types/react-intl/react-intl-tests.tsx | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/types/react-intl/index.d.ts b/types/react-intl/index.d.ts index 7da9dbd487..c6a06d39aa 100644 --- a/types/react-intl/index.d.ts +++ b/types/react-intl/index.d.ts @@ -142,7 +142,7 @@ declare namespace ReactIntl { interface Props extends MessageDescriptor { values?: {[key: string]: MessageValue | JSX.Element}; tagName?: string; - children?: (formattedMessage: string[]) => React.ReactNode; + children?: (...formattedMessage: string[]) => React.ReactNode; } } class FormattedMessage extends React.Component { } diff --git a/types/react-intl/react-intl-tests.tsx b/types/react-intl/react-intl-tests.tsx index 75490a5ca1..51d5065fe3 100644 --- a/types/react-intl/react-intl-tests.tsx +++ b/types/react-intl/react-intl-tests.tsx @@ -150,6 +150,20 @@ class SomeComponent extends React.Component
    {text}
    } + + {(text) => } + + + + {(...text) =>
      {text.map(t =>
    • {t}
    • )}
    } +
    + Date: Tue, 17 Apr 2018 08:37:05 -0700 Subject: [PATCH 0706/2153] express-winston: relax types on meta object (#25036) * express-winston: relax types on meta object * express-winston: change meta object type to --- types/express-winston/express-winston-tests.ts | 4 ++-- types/express-winston/index.d.ts | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/types/express-winston/express-winston-tests.ts b/types/express-winston/express-winston-tests.ts index 7fd41cfd5c..5671160de0 100644 --- a/types/express-winston/express-winston-tests.ts +++ b/types/express-winston/express-winston-tests.ts @@ -6,7 +6,7 @@ const app = express(); // Logger with all options app.use(expressWinston.logger({ - baseMeta: { foo: 'foo' }, + baseMeta: { foo: 'foo', nested: { bar: 'baz' } }, bodyBlacklist: ['foo'], bodyWhitelist: ['bar'], colorize: true, @@ -47,7 +47,7 @@ app.use(expressWinston.logger({ // Error Logger with all options app.use(expressWinston.errorLogger({ - baseMeta: { foo: 'foo' }, + baseMeta: { foo: 'foo', nested: { bar: 'baz' } }, dynamicMeta: (req, res, err) => ({ foo: 'bar' }), level: (req, res) => 'level', metaField: 'metaField', diff --git a/types/express-winston/index.d.ts b/types/express-winston/index.d.ts index 6dac70c1b6..e6184f64b9 100644 --- a/types/express-winston/index.d.ts +++ b/types/express-winston/index.d.ts @@ -7,18 +7,14 @@ import { ErrorRequestHandler, Handler, Request, Response } from 'express'; import { TransportInstance, Winston } from 'winston'; -export interface MetaObject { - [field: string]: string; -} - -export type DynamicMetaFunction = (req: Request, res: Response, err: Error) => MetaObject | undefined; +export type DynamicMetaFunction = (req: Request, res: Response, err: Error) => object; export type DynamicLevelFunction = (req: Request, res: Response, err: Error) => string; export type RequestFilter = (req: Request, propName: string) => boolean; export type ResponseFilter = (res: Response, propName: string) => boolean; export type RouteFilter = (req: Request, res: Response) => boolean; export interface BaseLoggerOptions { - baseMeta?: MetaObject; + baseMeta?: object; bodyBlacklist?: string[]; bodyWhitelist?: string[]; colorize?: boolean; @@ -55,7 +51,7 @@ export type LoggerOptions = LoggerOptionsWithTransports | LoggerOptionsWithWinst export function logger(options: LoggerOptions): Handler; export interface BaseErrorLoggerOptions { - baseMeta?: MetaObject; + baseMeta?: object; dynamicMeta?: DynamicMetaFunction; level?: string | DynamicLevelFunction; metaField?: string; From bb51a7bf5054a26aa91fbf7f94fe57781912204a Mon Sep 17 00:00:00 2001 From: Masahiko Okada Date: Wed, 18 Apr 2018 00:37:36 +0900 Subject: [PATCH 0707/2153] Fix JsonSchema.type definition in tv4 (#25020) --- types/tv4/index.d.ts | 2 +- types/tv4/tv4-tests.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/tv4/index.d.ts b/types/tv4/index.d.ts index 52b4121c67..924b7e586a 100644 --- a/types/tv4/index.d.ts +++ b/types/tv4/index.d.ts @@ -12,7 +12,7 @@ declare namespace tv4 { description?: string; // used for humans only, and not used for computation id?: string; $schema?: string; - type?: string; + type?: string | string[]; items?: any; properties?: any; patternProperties?: any; diff --git a/types/tv4/tv4-tests.ts b/types/tv4/tv4-tests.ts index f1cf61171c..e8bee67b5a 100644 --- a/types/tv4/tv4-tests.ts +++ b/types/tv4/tv4-tests.ts @@ -129,7 +129,7 @@ schema = { alert("data 2 error: " + JSON.stringify(validator.error, null, 4)); schema = { - "type": "array", + "type": ["array"], "items": {"$ref": "#"} }; } From 5544c3749b949c579198ff332c3a0b1f258225ca Mon Sep 17 00:00:00 2001 From: Keagan McClelland Date: Tue, 17 Apr 2018 09:38:44 -0600 Subject: [PATCH 0708/2153] [Ramda]: fixed pick and omit type signatures to reflect projections (#24936) * fixed pick and omit type signatures to be more helpful * changed pick to try and pass tests, tsnext still complaining * added CaptJakk to contributors * changed keyof index signatures to just strings * simplified Omit type signature --- types/ramda/index.d.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 017839933a..70200aae41 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -23,6 +23,9 @@ declare let R: R.Static; declare namespace R { + type Diff = ({[P in T]: P } & {[P in U]: never } & { [x: string]: never })[T]; + type Omit = Pick>; + type Ord = number | string | boolean; type Path = ReadonlyArray<(number | string)>; @@ -1174,8 +1177,8 @@ declare namespace R { /** * Returns a partial copy of an object omitting the keys specified. */ - omit(names: ReadonlyArray, obj: T): T; - omit(names: ReadonlyArray): (obj: T) => T; + omit(names: ReadonlyArray, obj: T): Omit; + omit(names: ReadonlyArray): (obj: T) => Omit; /** * Accepts a function fn and returns a function that guards invocation of fn such that fn can only ever be @@ -1285,8 +1288,8 @@ declare namespace R { * Returns a partial copy of an object containing only the keys specified. If the key does not exist, the * property is ignored. */ - pick(names: ReadonlyArray, obj: T): Pick; - pick(names: ReadonlyArray): (obj: T) => U; + pick(names: ReadonlyArray, obj: T): Pick>>; + pick(names: ReadonlyArray): (obj: T) => Pick>>; /** * Similar to `pick` except that this one includes a `key: undefined` pair for properties that don't exist. From d0e265975b52272e32e0cb94315b6ec378d93add Mon Sep 17 00:00:00 2001 From: Aankhen Date: Tue, 17 Apr 2018 22:09:52 +0530 Subject: [PATCH 0709/2153] Add `promise-timeout` types (#25062) --- types/promise-timeout/index.d.ts | 8 +++++++ .../promise-timeout/promise-timeout-tests.ts | 10 ++++++++ types/promise-timeout/tsconfig.json | 23 +++++++++++++++++++ types/promise-timeout/tslint.json | 1 + 4 files changed, 42 insertions(+) create mode 100644 types/promise-timeout/index.d.ts create mode 100644 types/promise-timeout/promise-timeout-tests.ts create mode 100644 types/promise-timeout/tsconfig.json create mode 100644 types/promise-timeout/tslint.json diff --git a/types/promise-timeout/index.d.ts b/types/promise-timeout/index.d.ts new file mode 100644 index 0000000000..1b49997edb --- /dev/null +++ b/types/promise-timeout/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for promise-timeout 1.3 +// Project: https://github.com/building5/promise-timeout#readme +// Definitions by: Aankhen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function timeout(promise: Promise, timeoutMillis: number): Promise; + +export class TimeoutError extends Error { } diff --git a/types/promise-timeout/promise-timeout-tests.ts b/types/promise-timeout/promise-timeout-tests.ts new file mode 100644 index 0000000000..60c4597a15 --- /dev/null +++ b/types/promise-timeout/promise-timeout-tests.ts @@ -0,0 +1,10 @@ +import { timeout, TimeoutError } from "promise-timeout"; + +function acceptError(e: Error) { } + +acceptError(new TimeoutError()); + +timeout(); // $ExpectError +timeout(new Promise(() => { })); // $ExpectError + +timeout(new Promise(() => { }), 1000); // $ExpectType Promise<{}> diff --git a/types/promise-timeout/tsconfig.json b/types/promise-timeout/tsconfig.json new file mode 100644 index 0000000000..08cb23a1da --- /dev/null +++ b/types/promise-timeout/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "promise-timeout-tests.ts" + ] +} diff --git a/types/promise-timeout/tslint.json b/types/promise-timeout/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/promise-timeout/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 3540de43f92dfdc42a8f4a91aad272bf6901c30d Mon Sep 17 00:00:00 2001 From: NN Date: Tue, 17 Apr 2018 19:43:25 +0300 Subject: [PATCH 0710/2153] Define ResourceType as type union. (#25060) --- types/chrome/index.d.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index 8c953aaca1..466f09107d 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -7236,6 +7236,9 @@ declare namespace chrome.webNavigation { * @since Chrome 17. */ declare namespace chrome.webRequest { + /** How the requested resource will be used. */ + export type ResourceType = "main_frame" | "sub_frame" | "stylesheet" | "script" | "image" | "font" | "object" | "xmlhttprequest" | "ping" | "csp_report" | "media" | "websocket" | "other"; + export interface AuthCredentials { username: string; password: string; @@ -7277,9 +7280,8 @@ declare namespace chrome.webRequest { tabId?: number; /** * A list of request types. Requests that cannot match any of the types will be filtered out. - * Each element one of: "main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", or "other" */ - types?: string[]; + types?: ResourceType[]; /** A list of URLs or URL patterns. Requests that cannot match any of the URLs will be filtered out. */ urls: string[]; @@ -7330,9 +7332,8 @@ declare namespace chrome.webRequest { tabId: number; /** * How the requested resource will be used. - * One of: "main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", or "other" */ - type: string; + type: ResourceType; /** The time when this signal is triggered, in milliseconds since the epoch. */ timeStamp: number; } From e4980869127654c4bebaefda8be8566c2d238016 Mon Sep 17 00:00:00 2001 From: Deyan Kamburov Date: Tue, 17 Apr 2018 19:45:59 +0300 Subject: [PATCH 0711/2153] [ignite-ui] Update Ignite UI typing to 18.1 release version (#24950) --- types/ignite-ui/index.d.ts | 25542 ++++++++++++++++++++++++++++------- 1 file changed, 20729 insertions(+), 4813 deletions(-) diff --git a/types/ignite-ui/index.d.ts b/types/ignite-ui/index.d.ts index bff55ec33d..a57a3606fe 100644 --- a/types/ignite-ui/index.d.ts +++ b/types/ignite-ui/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Ignite UI 17.2 +// Type definitions for Ignite UI 18.1 // Project: https://github.com/IgniteUI/ignite-ui // Definitions by: Ignite UI // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,12 +6,14 @@ interface DataSourceSettingsPaging { /** * Paging is not enabled by default + * */ enabled?: boolean; /** * Type for the paging operation * + * * Valid values: * "local" Data is paged client-side. * "remote" A remote request is done and URL params encoded @@ -20,26 +22,31 @@ interface DataSourceSettingsPaging { /** * Number of records on each page + * */ pageSize?: number; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested page size + * */ pageSizeUrlKey?: string; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested page index + * */ pageIndexUrlKey?: string; /** * Current page index + * */ pageIndex?: number; /** * Whether when a new page of data is requested we should append the new data to the existing data + * */ appendPage?: boolean; @@ -61,46 +68,55 @@ interface DataSourceSettingsFiltering { /** * Enables or disables case sensitive filtering on the data. Works only for local filtering + * */ caseSensitive?: boolean; /** * If the type of paging/sorting/filtering is local and applyToAllData is true, filtering will be performed on the whole data source that's present locally, otherwise only on the current dataView. if type is remote, this setting doesn't have any effect. + * */ applyToAllData?: boolean; /** * Can point to either a string or a function object. The parameters that are passed are 1) the data array to be filtered, 2) the filtering expression definitions. Should return an array of the filtered data + * */ customFunc?: any; /** * Url key that will be encoded in the request if remote filtering is performed. Default value of null implies OData-style URL encoding. Please see http://www.odata.org/developers/protocols/uri-conventions for details + * */ filterExprUrlKey?: string; /** * Url key that will be encoded in the request, specifying if the filtering logic will be AND or OR + * */ filterLogicUrlKey?: string; /** * Data will be initially filtered accordingly, directly after dataBind() + * */ defaultFields?: any[]; /** * A list of expression objects, containing the following key-value pairs: fieldName, expression (search string), condition , and logic (AND/OR) + * */ expressions?: any[]; /** * An "SQL-like' encoded expressions string. Takes precedence over "expressions". Example: col2 > 100; col2 LIKE %test% + * */ exprString?: string; /** * An object containing custom defined filtering conditions as objects. + * */ customConditions?: any; @@ -114,6 +130,7 @@ interface DataSourceSettingsSorting { /** * Sorting direction * + * * Valid values: * "none" * "asc" @@ -123,32 +140,38 @@ interface DataSourceSettingsSorting { /** * When defaultDirection is different than "none", and defaultFields is specified, data will be initially sorted accordingly, directly after dataBind() + * */ defaultFields?: any[]; /** * If the sorting type is local and applyToAllData is true, sorting will be performed on the whole data source that's present locally, otherwise only on the current dataView. If sorting type is remote, this setting doesn't have any effect. + * */ applyToAllData?: boolean; /** * Custom sorting function that can point to either a string or a function object. When the function is called, the following arguments are passed: data array, fields (array of field definitions) , direction ("asc" or "desc"). The function should return a sorted data array + * */ customFunc?: any; /** * Custom comparison sorting function. Accepts the following arguments: fields, schema, booleand value whether sorting is ascending , convert function(please check option for customConvertFunc) and returns a value 0 indicating that values are equal, 1 indicating that val1 > val2 and -1 indicating that val1 < val2 + * */ compareFunc?: any; /** * Custom data value conversion function(called from sorting function). Accepts a value of the data cell and column key and should return the converted value + * */ customConvertFunc?: any; /** * Specifies whether sorting will be applied locally or remotely (via a remote request) * + * * Valid values: * "remote" * "local" @@ -157,31 +180,37 @@ interface DataSourceSettingsSorting { /** * Specifies if sorting will be case sensitive or not. Works only for local sorting + * */ caseSensitive?: boolean; /** * URL param name which specifies how sorting expressions will be encoded in the URL. Default is null and uses OData conventions + * */ sortUrlKey?: string; /** * URL param value for ascending type of sorting. Default is null and uses OData conventions + * */ sortUrlAscValueKey?: string; /** * URL param value for descending type of sorting. Default is null and uses OData conventions + * */ sortUrlDescValueKey?: string; /** * A list of sorting expressions , consisting of the following keys (and their respective values): fieldName, direction and compareFunc (optional) + * */ expressions?: any[]; /** * Takes precedence over experssions, an "SQL-like" encoded expressions string : see sort(). Example col2 > 100 ORDER BY asc + * */ exprString?: string; @@ -194,28 +223,33 @@ interface DataSourceSettingsSorting { interface DataSourceSettingsGroupby { /** * Default collapse state + * */ defaultCollapseState?: boolean; /** * The name of the property that determines whether a record from the group data view is a group record. + * */ groupRecordKey?: string; /** * The name of the property that determines whether a record from the group data view is a summary group record. + * */ groupSummaryRecordKey?: string; /** * Array of objects containing the summaries for each field. * Each summary object has the following format { field:"fieldName", summaryFunctions: [] }, where the summaryFunctions arrays can contain either a summary name (avg, sum, count etc.) or a custom function for caclulating a custom summary. + * */ summaries?: any[]; /** * Specifies the postion for the summaries for each field inside each group. * + * * Valid values: * "top" One summary row will be displayed at the top for each group * "bottom" One summary row will be displayed at the bottom for each group @@ -226,6 +260,7 @@ interface DataSourceSettingsGroupby { /** * . Specifies how paging should be applied when there is at least one grouped column * + * * Valid values: * "allRecords" Paging is applied for all records - data and non-data records(like group-by records) * "dataRecordsOnly" Paging is applied ONLY for data records. Non-data records are disregarded in paging calculations. @@ -242,6 +277,7 @@ interface DataSourceSettingsSummaries { /** * Specifies whether summaries will be applied locally or remotely (via a remote request) * + * * Valid values: * "remote" A remote request is done and URL params encoded * "local" Data is paged client-side. @@ -250,17 +286,20 @@ interface DataSourceSettingsSummaries { /** * Url key for retrieving data from response - used only when summaries are remote + * */ summaryExprUrlKey?: string; /** * Key for retrieving data from the summaries response - used only when summaries are remote + * */ summariesResponseKey?: string; /** * Determines when the summary values are calculated * + * * Valid values: * "priortofilteringandpaging" * "afterfilteringbeforepaging" @@ -270,6 +309,7 @@ interface DataSourceSettingsSummaries { /** * A list of column settings that specifies custom summaries options per column basis + * */ columnSettings?: any[]; @@ -282,52 +322,62 @@ interface DataSourceSettingsSummaries { interface DataSourceSettings { /** * Setting this is only necessary when the data source is set to a table in string format. we need to create an invisible dummy data container in the body and append the table data to it + * */ id?: string; /** * This is the property in the dataView where actual resulting records will be put. (So the dataView will not be array but an object if this is defined), after the potential data source transformation + * */ outputResultsName?: string; /** * Callback function to call when data binding is complete + * */ callback?: Function; /** * Object on which to invoke the callback function + * */ callee?: any; /** * This is the normalized (transformed) resulting data, after it's fetched from the data source + * */ data?: any[]; /** * This is the source of data - non normalized. Can be an array, can be reference to some JSON object, can be a DOM element for a HTML TABLE, or a function + * */ dataSource?: any; /** * Client-side dataBinding event. Can be a string pointing to a function name, or an object pointing to a function + * */ dataBinding?: any; /** * Client-side dataBound event. Can be a string pointing to a function name, or an object pointing to a function + * */ dataBound?: any; /** * Specifies the HTTP verb to be used to issue the request + * */ requestType?: string; /** * Type of the data source * + * * Valid values: * "json" Specifies that the data source is an already evaluated JSON (JavaScript object/array) or a string that can be evaluated to JSON * "xml" Specifies that the data source is a XML Document object or a string that can be evaluated to XML @@ -347,27 +397,32 @@ interface DataSourceSettings { /** * A schema object that defines which fields from the data to bind to + * */ schema?: any; /** * The unique field identifier + * */ primaryKey?: string; /** * Property in the response which specifies the total number of records in the backend (this is needed for paging) + * */ responseTotalRecCountKey?: string; /** * Property in the response which specifies where the data records array will be held (if the response is wrapped) + * */ responseDataKey?: string; /** * Response type when a URL is set as the data source. See http://api.jquery.com/jQuery.ajax/ => dataType * + * * Valid values: * "json" * "xml" @@ -380,46 +435,55 @@ interface DataSourceSettings { /** * Content type of the response. See http://api.jquery.com/jQuery.ajax/ => contentType + * */ responseContentType?: string; /** * If set to false will disable transformations on schema, even if it is defined locally in the javascript code + * */ localSchemaTransform?: boolean; /** * Event that is fired before URL parameters are encoded. Can point to a function name or the function object itself + * */ urlParamsEncoding?: any; /** * Event that is fired after URL parameters are encoded (When a remote request is done). Can point to a function name or the function object itself + * */ urlParamsEncoded?: any; /** * Settings related to built-in paging functionality + * */ paging?: DataSourceSettingsPaging; /** * Settings related to built-in filtering functionality + * */ filtering?: DataSourceSettingsFiltering; /** * Settings related to built-in sorting functionality + * */ sorting?: DataSourceSettingsSorting; /** * Settings related to built-in group by functionality + * */ groupby?: DataSourceSettingsGroupby; /** * Settings related to built-in summaries functionality + * */ summaries?: DataSourceSettingsSummaries; @@ -427,11 +491,13 @@ interface DataSourceSettings { * *** IMPORTANT DEPRECATED *** * A list of field definitions specifying the schema of the data source. * Field objects description: {name, [type], [xpath]} + * */ fields?: any[]; /** * If true, will serialize the transaction log of updated values - if any - whenever commit is performed via a remote request. + * */ serializeTransactionLog?: boolean; @@ -440,16 +506,19 @@ interface DataSourceSettings { * if a new row is added, and then deleted, there will be no transaction added to the log * if an edit is made to a row or cell, then the value is brought back to its original value, the transaction should be removed * Note: This option takes effect only when autoCommit is set to false. + * */ aggregateTransactions?: boolean; /** * If auto commit is true, data will be automatically commited to the data source, once a value or a batch of values are updated via saveChanges() + * */ autoCommit?: boolean; /** * Specifies an update remote URL, to which an AJAX request will be made as soon as saveChages() is called. + * */ updateUrl?: string; @@ -459,6 +528,7 @@ interface DataSourceSettings { * Use item.row to obtain reference to the added row. * Use item.rowId to get the row ID. * Use dataSource to obtain reference to $.ig.DataSource. + * */ rowAdded?: Function; @@ -469,6 +539,7 @@ interface DataSourceSettings { * Use item.newRow to obtain reference to the updated row. * Use item.oldRow to obtain reference to the row that was updated. * Use dataSource to obtain reference to $.ig.DataSource. + * */ rowUpdated?: Function; @@ -479,6 +550,7 @@ interface DataSourceSettings { * Use item.rowId to get the row ID. * Use item.rowIndex to get the row index. * Use dataSource to obtain reference to $.ig.DataSource. + * */ rowInserted?: Function; @@ -488,6 +560,7 @@ interface DataSourceSettings { * Use item.rowId to get the row ID. * Use item.rowIndex to get the row index. * Use dataSource to obtain reference to $.ig.DataSource. + * */ rowDeleted?: Function; @@ -528,6 +601,8 @@ class DataSource { * 1. Before paging and filtering * 2. After filtering before paging * 3. After filtering and paging + * + * @param transformedExecution */ transformedData(transformedExecution: Object): Object; @@ -574,12 +649,15 @@ class DataSource { /** * Gets/sets the dataSource setting. If no parameter is specified, returns settings.dataSource + * + * @param ds */ dataSource(ds?: Object): Object; /** * Gets/sets the type of the dataSource. If no parameter is specified, returns settings.type * + * @param t * @return json|xml|unknown|array|function|htmlTableString|htmlTableId|htmlTableDom|invalid|remoteUrl|empty */ type(t?: Object): string; @@ -591,12 +669,13 @@ class DataSource { * @param ds the data source in which to search for the record. When not set it will use the current data source. * @param objPath Not used in $.ig.DataSource */ - findRecordByKey(key: string, ds?: string, objPath?: string): Object; + findRecordByKey(key: Object, ds?: string, objPath?: string): Object; /** * Removes a specific record denoted by the primaryKey of the passed key parameter from the data source * * @param key primary key of the record + * @param origDs */ removeRecordByKey(key: Object, origDs: Object): void; @@ -604,6 +683,7 @@ class DataSource { * Removes a record from the data source at specific index. * * @param index index of record + * @param origDs */ removeRecordByIndex(index: number, origDs: Object): void; @@ -816,6 +896,9 @@ class DataSource { * match the number of records that exists on the client * * @param count the total number of records + * @param key + * @param dsObj + * @param context */ totalRecordsCount(count?: number, key?: Object, dsObj?: Object, context?: Object): number; @@ -876,6 +959,8 @@ class DataSource { /** * For internal use + * + * @param dirty */ pageSizeDirty(dirty: Object): void; @@ -955,6 +1040,8 @@ class TypeParser { /** * L.A. 18 June 2012 Fixing bug #113265 Column 'date' shows empty values as 'NaN' + * + * @param obj */ toDate(obj: Object): void; toNumber(obj: Object): void; @@ -977,6 +1064,7 @@ interface DataSchemaSchemaFields { * bool * date * object + * */ type?: string|number|boolean|Date|Object; @@ -1018,6 +1106,11 @@ interface DataSchemaSchema { */ outputResultsName?: string; + /** + * This is the property (xpath) in the data source where the child records of a record are located. Used in XML binding. + */ + childDataProperty?: string; + /** * Option for DataSchemaSchema */ @@ -1091,6 +1184,8 @@ class RemoteDataSource { * 1. Before paging and filtering * 2. After filtering before paging * 3. After filtering and paging + * + * @param transformedExecution */ transformedData(transformedExecution: Object): Object; @@ -1137,12 +1232,15 @@ class RemoteDataSource { /** * Gets/sets the dataSource setting. If no parameter is specified, returns settings.dataSource + * + * @param ds */ dataSource(ds?: Object): Object; /** * Gets/sets the type of the dataSource. If no parameter is specified, returns settings.type * + * @param t * @return json|xml|unknown|array|function|htmlTableString|htmlTableId|htmlTableDom|invalid|remoteUrl|empty */ type(t?: Object): string; @@ -1154,12 +1252,13 @@ class RemoteDataSource { * @param ds the data source in which to search for the record. When not set it will use the current data source. * @param objPath Not used in $.ig.DataSource */ - findRecordByKey(key: string, ds?: string, objPath?: string): Object; + findRecordByKey(key: Object, ds?: string, objPath?: string): Object; /** * Removes a specific record denoted by the primaryKey of the passed key parameter from the data source * * @param key primary key of the record + * @param origDs */ removeRecordByKey(key: Object, origDs: Object): void; @@ -1167,6 +1266,7 @@ class RemoteDataSource { * Removes a record from the data source at specific index. * * @param index index of record + * @param origDs */ removeRecordByIndex(index: number, origDs: Object): void; @@ -1379,6 +1479,9 @@ class RemoteDataSource { * match the number of records that exists on the client * * @param count the total number of records + * @param key + * @param dsObj + * @param context */ totalRecordsCount(count?: number, key?: Object, dsObj?: Object, context?: Object): number; @@ -1439,6 +1542,8 @@ class RemoteDataSource { /** * For internal use + * + * @param dirty */ pageSizeDirty(dirty: Object): void; @@ -1555,6 +1660,8 @@ class JSONDataSource { * 1. Before paging and filtering * 2. After filtering before paging * 3. After filtering and paging + * + * @param transformedExecution */ transformedData(transformedExecution: Object): Object; @@ -1601,12 +1708,15 @@ class JSONDataSource { /** * Gets/sets the dataSource setting. If no parameter is specified, returns settings.dataSource + * + * @param ds */ dataSource(ds?: Object): Object; /** * Gets/sets the type of the dataSource. If no parameter is specified, returns settings.type * + * @param t * @return json|xml|unknown|array|function|htmlTableString|htmlTableId|htmlTableDom|invalid|remoteUrl|empty */ type(t?: Object): string; @@ -1618,12 +1728,13 @@ class JSONDataSource { * @param ds the data source in which to search for the record. When not set it will use the current data source. * @param objPath Not used in $.ig.DataSource */ - findRecordByKey(key: string, ds?: string, objPath?: string): Object; + findRecordByKey(key: Object, ds?: string, objPath?: string): Object; /** * Removes a specific record denoted by the primaryKey of the passed key parameter from the data source * * @param key primary key of the record + * @param origDs */ removeRecordByKey(key: Object, origDs: Object): void; @@ -1631,6 +1742,7 @@ class JSONDataSource { * Removes a record from the data source at specific index. * * @param index index of record + * @param origDs */ removeRecordByIndex(index: number, origDs: Object): void; @@ -1843,6 +1955,9 @@ class JSONDataSource { * match the number of records that exists on the client * * @param count the total number of records + * @param key + * @param dsObj + * @param context */ totalRecordsCount(count?: number, key?: Object, dsObj?: Object, context?: Object): number; @@ -1903,6 +2018,8 @@ class JSONDataSource { /** * For internal use + * + * @param dirty */ pageSizeDirty(dirty: Object): void; @@ -2097,6 +2214,9 @@ class RESTDataSource { /** * Posts to the restSettings urls using $.ajax, by serializing the changes as url params. + * + * @param success + * @param error */ saveChanges(success: Object, error: Object): void; @@ -2127,6 +2247,8 @@ class RESTDataSource { * 1. Before paging and filtering * 2. After filtering before paging * 3. After filtering and paging + * + * @param transformedExecution */ transformedData(transformedExecution: Object): Object; @@ -2173,12 +2295,15 @@ class RESTDataSource { /** * Gets/sets the dataSource setting. If no parameter is specified, returns settings.dataSource + * + * @param ds */ dataSource(ds?: Object): Object; /** * Gets/sets the type of the dataSource. If no parameter is specified, returns settings.type * + * @param t * @return json|xml|unknown|array|function|htmlTableString|htmlTableId|htmlTableDom|invalid|remoteUrl|empty */ type(t?: Object): string; @@ -2190,12 +2315,13 @@ class RESTDataSource { * @param ds the data source in which to search for the record. When not set it will use the current data source. * @param objPath Not used in $.ig.DataSource */ - findRecordByKey(key: string, ds?: string, objPath?: string): Object; + findRecordByKey(key: Object, ds?: string, objPath?: string): Object; /** * Removes a specific record denoted by the primaryKey of the passed key parameter from the data source * * @param key primary key of the record + * @param origDs */ removeRecordByKey(key: Object, origDs: Object): void; @@ -2203,6 +2329,7 @@ class RESTDataSource { * Removes a record from the data source at specific index. * * @param index index of record + * @param origDs */ removeRecordByIndex(index: number, origDs: Object): void; @@ -2407,6 +2534,9 @@ class RESTDataSource { * match the number of records that exists on the client * * @param count the total number of records + * @param key + * @param dsObj + * @param context */ totalRecordsCount(count?: number, key?: Object, dsObj?: Object, context?: Object): number; @@ -2467,6 +2597,8 @@ class RESTDataSource { /** * For internal use + * + * @param dirty */ pageSizeDirty(dirty: Object): void; @@ -2543,6 +2675,7 @@ RESTDataSource: typeof Infragistics.RESTDataSource; interface JSONPDataSourceSettings { /** * Override the callback function name in a jsonp request. Sets option jsonp in $.ajax functionbool Setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation + * */ jsonp?: string|boolean; @@ -2593,6 +2726,8 @@ class JSONPDataSource { * 1. Before paging and filtering * 2. After filtering before paging * 3. After filtering and paging + * + * @param transformedExecution */ transformedData(transformedExecution: Object): Object; @@ -2639,12 +2774,15 @@ class JSONPDataSource { /** * Gets/sets the dataSource setting. If no parameter is specified, returns settings.dataSource + * + * @param ds */ dataSource(ds?: Object): Object; /** * Gets/sets the type of the dataSource. If no parameter is specified, returns settings.type * + * @param t * @return json|xml|unknown|array|function|htmlTableString|htmlTableId|htmlTableDom|invalid|remoteUrl|empty */ type(t?: Object): string; @@ -2656,12 +2794,13 @@ class JSONPDataSource { * @param ds the data source in which to search for the record. When not set it will use the current data source. * @param objPath Not used in $.ig.DataSource */ - findRecordByKey(key: string, ds?: string, objPath?: string): Object; + findRecordByKey(key: Object, ds?: string, objPath?: string): Object; /** * Removes a specific record denoted by the primaryKey of the passed key parameter from the data source * * @param key primary key of the record + * @param origDs */ removeRecordByKey(key: Object, origDs: Object): void; @@ -2669,6 +2808,7 @@ class JSONPDataSource { * Removes a record from the data source at specific index. * * @param index index of record + * @param origDs */ removeRecordByIndex(index: number, origDs: Object): void; @@ -2881,6 +3021,9 @@ class JSONPDataSource { * match the number of records that exists on the client * * @param count the total number of records + * @param key + * @param dsObj + * @param context */ totalRecordsCount(count?: number, key?: Object, dsObj?: Object, context?: Object): number; @@ -2941,6 +3084,8 @@ class JSONPDataSource { /** * For internal use + * + * @param dirty */ pageSizeDirty(dirty: Object): void; @@ -3045,6 +3190,8 @@ class XmlDataSource { * 1. Before paging and filtering * 2. After filtering before paging * 3. After filtering and paging + * + * @param transformedExecution */ transformedData(transformedExecution: Object): Object; @@ -3091,12 +3238,15 @@ class XmlDataSource { /** * Gets/sets the dataSource setting. If no parameter is specified, returns settings.dataSource + * + * @param ds */ dataSource(ds?: Object): Object; /** * Gets/sets the type of the dataSource. If no parameter is specified, returns settings.type * + * @param t * @return json|xml|unknown|array|function|htmlTableString|htmlTableId|htmlTableDom|invalid|remoteUrl|empty */ type(t?: Object): string; @@ -3108,12 +3258,13 @@ class XmlDataSource { * @param ds the data source in which to search for the record. When not set it will use the current data source. * @param objPath Not used in $.ig.DataSource */ - findRecordByKey(key: string, ds?: string, objPath?: string): Object; + findRecordByKey(key: Object, ds?: string, objPath?: string): Object; /** * Removes a specific record denoted by the primaryKey of the passed key parameter from the data source * * @param key primary key of the record + * @param origDs */ removeRecordByKey(key: Object, origDs: Object): void; @@ -3121,6 +3272,7 @@ class XmlDataSource { * Removes a record from the data source at specific index. * * @param index index of record + * @param origDs */ removeRecordByIndex(index: number, origDs: Object): void; @@ -3333,6 +3485,9 @@ class XmlDataSource { * match the number of records that exists on the client * * @param count the total number of records + * @param key + * @param dsObj + * @param context */ totalRecordsCount(count?: number, key?: Object, dsObj?: Object, context?: Object): number; @@ -3393,6 +3548,8 @@ class XmlDataSource { /** * For internal use + * + * @param dirty */ pageSizeDirty(dirty: Object): void; @@ -3509,6 +3666,8 @@ class FunctionDataSource { * 1. Before paging and filtering * 2. After filtering before paging * 3. After filtering and paging + * + * @param transformedExecution */ transformedData(transformedExecution: Object): Object; @@ -3555,12 +3714,15 @@ class FunctionDataSource { /** * Gets/sets the dataSource setting. If no parameter is specified, returns settings.dataSource + * + * @param ds */ dataSource(ds?: Object): Object; /** * Gets/sets the type of the dataSource. If no parameter is specified, returns settings.type * + * @param t * @return json|xml|unknown|array|function|htmlTableString|htmlTableId|htmlTableDom|invalid|remoteUrl|empty */ type(t?: Object): string; @@ -3572,12 +3734,13 @@ class FunctionDataSource { * @param ds the data source in which to search for the record. When not set it will use the current data source. * @param objPath Not used in $.ig.DataSource */ - findRecordByKey(key: string, ds?: string, objPath?: string): Object; + findRecordByKey(key: Object, ds?: string, objPath?: string): Object; /** * Removes a specific record denoted by the primaryKey of the passed key parameter from the data source * * @param key primary key of the record + * @param origDs */ removeRecordByKey(key: Object, origDs: Object): void; @@ -3585,6 +3748,7 @@ class FunctionDataSource { * Removes a record from the data source at specific index. * * @param index index of record + * @param origDs */ removeRecordByIndex(index: number, origDs: Object): void; @@ -3797,6 +3961,9 @@ class FunctionDataSource { * match the number of records that exists on the client * * @param count the total number of records + * @param key + * @param dsObj + * @param context */ totalRecordsCount(count?: number, key?: Object, dsObj?: Object, context?: Object): number; @@ -3857,6 +4024,8 @@ class FunctionDataSource { /** * For internal use + * + * @param dirty */ pageSizeDirty(dirty: Object): void; @@ -3973,6 +4142,8 @@ class HtmlTableDataSource { * 1. Before paging and filtering * 2. After filtering before paging * 3. After filtering and paging + * + * @param transformedExecution */ transformedData(transformedExecution: Object): Object; @@ -4019,12 +4190,15 @@ class HtmlTableDataSource { /** * Gets/sets the dataSource setting. If no parameter is specified, returns settings.dataSource + * + * @param ds */ dataSource(ds?: Object): Object; /** * Gets/sets the type of the dataSource. If no parameter is specified, returns settings.type * + * @param t * @return json|xml|unknown|array|function|htmlTableString|htmlTableId|htmlTableDom|invalid|remoteUrl|empty */ type(t?: Object): string; @@ -4036,12 +4210,13 @@ class HtmlTableDataSource { * @param ds the data source in which to search for the record. When not set it will use the current data source. * @param objPath Not used in $.ig.DataSource */ - findRecordByKey(key: string, ds?: string, objPath?: string): Object; + findRecordByKey(key: Object, ds?: string, objPath?: string): Object; /** * Removes a specific record denoted by the primaryKey of the passed key parameter from the data source * * @param key primary key of the record + * @param origDs */ removeRecordByKey(key: Object, origDs: Object): void; @@ -4049,6 +4224,7 @@ class HtmlTableDataSource { * Removes a record from the data source at specific index. * * @param index index of record + * @param origDs */ removeRecordByIndex(index: number, origDs: Object): void; @@ -4261,6 +4437,9 @@ class HtmlTableDataSource { * match the number of records that exists on the client * * @param count the total number of records + * @param key + * @param dsObj + * @param context */ totalRecordsCount(count?: number, key?: Object, dsObj?: Object, context?: Object): number; @@ -4321,6 +4500,8 @@ class HtmlTableDataSource { /** * For internal use + * + * @param dirty */ pageSizeDirty(dirty: Object): void; @@ -4425,6 +4606,8 @@ class ArrayDataSource { * 1. Before paging and filtering * 2. After filtering before paging * 3. After filtering and paging + * + * @param transformedExecution */ transformedData(transformedExecution: Object): Object; @@ -4471,12 +4654,15 @@ class ArrayDataSource { /** * Gets/sets the dataSource setting. If no parameter is specified, returns settings.dataSource + * + * @param ds */ dataSource(ds?: Object): Object; /** * Gets/sets the type of the dataSource. If no parameter is specified, returns settings.type * + * @param t * @return json|xml|unknown|array|function|htmlTableString|htmlTableId|htmlTableDom|invalid|remoteUrl|empty */ type(t?: Object): string; @@ -4488,12 +4674,13 @@ class ArrayDataSource { * @param ds the data source in which to search for the record. When not set it will use the current data source. * @param objPath Not used in $.ig.DataSource */ - findRecordByKey(key: string, ds?: string, objPath?: string): Object; + findRecordByKey(key: Object, ds?: string, objPath?: string): Object; /** * Removes a specific record denoted by the primaryKey of the passed key parameter from the data source * * @param key primary key of the record + * @param origDs */ removeRecordByKey(key: Object, origDs: Object): void; @@ -4501,6 +4688,7 @@ class ArrayDataSource { * Removes a record from the data source at specific index. * * @param index index of record + * @param origDs */ removeRecordByIndex(index: number, origDs: Object): void; @@ -4713,6 +4901,9 @@ class ArrayDataSource { * match the number of records that exists on the client * * @param count the total number of records + * @param key + * @param dsObj + * @param context */ totalRecordsCount(count?: number, key?: Object, dsObj?: Object, context?: Object): number; @@ -4773,6 +4964,8 @@ class ArrayDataSource { /** * For internal use + * + * @param dirty */ pageSizeDirty(dirty: Object): void; @@ -4940,6 +5133,8 @@ class MashupDataSource { * 1. Before paging and filtering * 2. After filtering before paging * 3. After filtering and paging + * + * @param transformedExecution */ transformedData(transformedExecution: Object): Object; @@ -4986,12 +5181,15 @@ class MashupDataSource { /** * Gets/sets the dataSource setting. If no parameter is specified, returns settings.dataSource + * + * @param ds */ dataSource(ds?: Object): Object; /** * Gets/sets the type of the dataSource. If no parameter is specified, returns settings.type * + * @param t * @return json|xml|unknown|array|function|htmlTableString|htmlTableId|htmlTableDom|invalid|remoteUrl|empty */ type(t?: Object): string; @@ -5003,12 +5201,13 @@ class MashupDataSource { * @param ds the data source in which to search for the record. When not set it will use the current data source. * @param objPath Not used in $.ig.DataSource */ - findRecordByKey(key: string, ds?: string, objPath?: string): Object; + findRecordByKey(key: Object, ds?: string, objPath?: string): Object; /** * Removes a specific record denoted by the primaryKey of the passed key parameter from the data source * * @param key primary key of the record + * @param origDs */ removeRecordByKey(key: Object, origDs: Object): void; @@ -5016,6 +5215,7 @@ class MashupDataSource { * Removes a record from the data source at specific index. * * @param index index of record + * @param origDs */ removeRecordByIndex(index: number, origDs: Object): void; @@ -5167,6 +5367,9 @@ class MashupDataSource { * match the number of records that exists on the client * * @param count the total number of records + * @param key + * @param dsObj + * @param context */ totalRecordsCount(count?: number, key?: Object, dsObj?: Object, context?: Object): number; @@ -5227,6 +5430,8 @@ class MashupDataSource { /** * For internal use + * + * @param dirty */ pageSizeDirty(dirty: Object): void; @@ -5435,6 +5640,7 @@ interface TreeHierarchicalDataSourceSettingsTreeDSPaging { /** * When data flows to the next page there are a couple of different modes that can help communicate the context of a leaf level row. When mode option is 'rootLevelOnly' then the context row always shows the value of the contextRowRootText option. * + * * Valid values: * "none" Does not render the contextual row * "parent" Renders a read-only representation of the immediate parent row @@ -5513,16 +5719,19 @@ interface TreeHierarchicalDataSourceSettingsTreeDS { /** * If set to TRUE it is expected that the source of data is normalized and transformed(has set dataLevel and expansion state). The source of data is used as flatDataView. Usually used when the paging is remote and paging mode is allLevels, or features are remote(and the processing of the returned result should be made on the server) + * */ initialFlatDataView?: boolean; /** * Specifies a custom function to be called when requesting data to the server - usually when expanding/collapsing record. If set the function should return the encoded URL. It takes as parameters: data record(type: object), expand - (type: bool). + * */ customEncodeUrlFunc?: Function; /** * If true save expansion states in internal list and send it to the server. Applying to one of the main constraint of the REST architecture Stateless Interactions - client specific data(like expansion states) should NOT be stored on the server + * */ persistExpansionStates?: boolean; @@ -5764,6 +5973,7 @@ class TreeHierarchicalDataSource { * @param fieldExpressions a list of field expression definitions * @param boolLogic boolean logic. Accepted values are AND and OR. * @param keepFilterState if keepFilterState is set to true, it will not discard previous filtering expressions + * @param fieldExpressionsOnStrings */ filter(fieldExpressions: Object, boolLogic: Object, keepFilterState: boolean, fieldExpressionsOnStrings: Object): void; @@ -5796,6 +6006,8 @@ class TreeHierarchicalDataSource { /** * Gets the path of a record by the record or the record's key + * + * @param record */ getPathBy(record: Object): string; @@ -5812,6 +6024,7 @@ class TreeHierarchicalDataSource { * Removes a specific record denoted by the primaryKey of the passed key parameter from the data source * * @param key primary key of the record + * @param origDs */ removeRecordByKey(key: Object, origDs: Object): void; @@ -5869,6 +6082,8 @@ class TreeHierarchicalDataSource { * 1. Before paging and filtering * 2. After filtering before paging * 3. After filtering and paging + * + * @param transformedExecution */ transformedData(transformedExecution: Object): Object; @@ -5915,12 +6130,15 @@ class TreeHierarchicalDataSource { /** * Gets/sets the dataSource setting. If no parameter is specified, returns settings.dataSource + * + * @param ds */ dataSource(ds?: Object): Object; /** * Gets/sets the type of the dataSource. If no parameter is specified, returns settings.type * + * @param t * @return json|xml|unknown|array|function|htmlTableString|htmlTableId|htmlTableDom|invalid|remoteUrl|empty */ type(t?: Object): string; @@ -5929,6 +6147,7 @@ class TreeHierarchicalDataSource { * Removes a record from the data source at specific index. * * @param index index of record + * @param origDs */ removeRecordByIndex(index: number, origDs: Object): void; @@ -6063,6 +6282,9 @@ class TreeHierarchicalDataSource { * match the number of records that exists on the client * * @param count the total number of records + * @param key + * @param dsObj + * @param context */ totalRecordsCount(count?: number, key?: Object, dsObj?: Object, context?: Object): number; @@ -6113,6 +6335,8 @@ class TreeHierarchicalDataSource { /** * For internal use + * + * @param dirty */ pageSizeDirty(dirty: Object): void; @@ -6221,9 +6445,147 @@ interface IgniteUIStatic { SimpleTextMarkerTemplate: typeof Infragistics.SimpleTextMarkerTemplate; } +interface ShapeDataSourceSettings { + /** + * The unique identifier. + */ + id?: string; + + /** + * The Uri of the .shp portion of the Shapefile. + */ + shapefileSource?: string; + + /** + * The Uri of the .dbf portion of the Shapefile. + */ + databaseSource?: string; + + /** + * Callback function to call when data binding is complete. + */ + callback?: Function; + + /** + * Object on which to invoke the callback function. + */ + callee?: any; + + /** + * Callback function to call to allow shape records to be transformed. + * paramType="object" the shape record to be transformed. + */ + transformRecord?: Function; + + /** + * Callback function to call to allow points in the shape records to be transformed. + * paramType="object" the point to be transformed in place. The object will look like { x: value, y: value2 } + */ + transformPoint?: Function; + + /** + * Callback function to call to allow the bounds of the shape data source to be transformed. + * paramType="object" the bounds of the shape datasource to be transformed in place. The object will look like { top: value, left: value, width: value, height: value } + */ + transformBounds?: Function; + + /** + * Callback function to call when the import process has been completed + * paramType="object" the ShapeDataSource instance + */ + importCompleted?: Function; + + /** + * Option for ShapeDataSourceSettings + */ + [optionName: string]: any; +} + +declare namespace Infragistics { +class ShapeDataSource { + constructor(settings: ShapeDataSourceSettings); + + /** + * Loads to the current data source + */ + dataBind(): void; + + /** + * Returns true if data is loaded + */ + isBound(): boolean; + dataView(): void; + + /** + * Returns the current converter instance + */ + converter(): Object; +} +} +interface IgniteUIStatic { +ShapeDataSource: typeof Infragistics.ShapeDataSource; +} + +interface TriangulationDataSourceSettings { + /** + * The unique identifier. + */ + id?: string; + + /** + * A Uri specifying the location of the Itf file. + */ + source?: string; + + /** + * The TriangulationSource which is typically created after importing the Itf from the Source Uri. + */ + triangulationSource?: string; + + /** + * Callback function to call when data binding is complete + */ + callback?: Function; + + /** + * Object on which to invoke the callback function + */ + callee?: any; + + /** + * Option for TriangulationDataSourceSettings + */ + [optionName: string]: any; +} + +declare namespace Infragistics { +class TriangulationDataSource { + constructor(settings: TriangulationDataSourceSettings); + + /** + * Loads to the current data source + */ + dataBind(): void; + + /** + * Returns true if data is loaded + */ + isBound(): boolean; + dataView(): void; + + /** + * Returns the current converter instance + */ + converter(): Object; +} +} +interface IgniteUIStatic { +TriangulationDataSource: typeof Infragistics.TriangulationDataSource; +} + interface GridExcelExporterCallbacks { /** - * Set a callback that is fired after the cell is exported. + * A function to call after the cell is exported. * Function takes arguments sender and args. * Use args.columnKey to get the igGrid column key of the cell. * Use args.columnIndex to get the igGrid column index of the cell. @@ -6231,11 +6593,12 @@ interface GridExcelExporterCallbacks { * Use args.rowId to get key or index of row. * Use args.xlRow to get reference to the worksheet row. * Use args.grid to get reference to the igGrid widget. + * */ cellExported?: Function; /** - * Cancel="true" Set a callback that is fired before the cell exporting. + * Cancel="true" A function to call before the cell is exported. * Function takes arguments sender and args. * Use args.columnKey to get the igGrid column key of the cell. * Use args.columnIndex to get the igGrid column index of the cell. @@ -6243,96 +6606,113 @@ interface GridExcelExporterCallbacks { * Use args.rowId to get key or index of row. * Use args.xlRow to get reference to the worksheet row. * Use args.grid to get reference to the igGrid widget. + * Return false in order to cancel exporting the cell. + * */ cellExporting?: Function; /** - * Set a callback that is fired when exporting fails. - * Use error to get the reference of error object. + * A function to call when exporting fails. + * Use error to obtain reference of the error object. + * */ error?: Function; /** - * Cancel="true" Set a callback that is fired when export is ending, but the document is not saved. + * A function to call before the Excel file is downloaded. * Function takes arguments sender and args. * Use args.grid to get reference to the igGrid widget. - * Use args.workbook to get reference to the excel workbook. - * Use args.worksheet to get reference to the excel worksheet. + * Use args.workbook to get reference to the Excel workbook. + * Use args.worksheet to get reference to the Excel worksheet. + * Return false in order to cancel downloading the file. + * */ exportEnding?: Function; /** - * Cancel="true" Set a callback that is fired when the exporting has started. + * Cancel="true" A function to call before exporting starts. * Function takes arguments sender and args. * Use args.grid to get reference to igGrid widget. + * Return false in order to cancel exporting. + * */ exportStarting?: Function; /** - * Set a callback that is fired after the header cell is exported. + * A function to call after a header cell is exported. * Function takes arguments sender and args. - * Use args.headerText to get the igGrid column key of the header cell. - * Use args.columnKey to get the igGrid column key of the header cell. - * Use args.columnIndex to get the igGrid column index of the header cell. + * Use args.headerText to get the igGrid column header text. + * Use args.columnKey to get the igGrid column key. + * Use args.columnIndex to get the igGrid column index. + * */ headerCellExported?: Function; /** - * Cancel="true" Set a callback that is fired before the header cell exporting. + * A function to call before the header cell is exported. * Function takes arguments sender and args. - * Use args.headerText to get or set the igGrid column key of the header cell. - * Use args.columnKey to get the igGrid column key of the header cell. - * Use args.columnIndex to get the igGrid column index of the header cell. + * Use args.headerText to get or set the igGrid column header text. + * Use args.columnKey to get the igGrid column key. + * Use args.columnIndex to get the igGrid column index. + * Return false in order to cancel exporting the cell. + * */ headerCellExporting?: Function; /** - * Cancel="true" Set a callback that is fired after the row is exported. + * Cancel="true" A function to call after the row is exported. * Function takes arguments sender and args. * Use args.rowId to get key or index of row. * Use args.element to get row TR element. * Use args.xlRow to get reference to the worksheet row. * Use args.grid to get reference to the igGrid widget. - * Note: When exporting an igHierarchicalGrid this callback is available only for the root grid rows. + * Note: When exporting igHierarchicalGrid this callback is available only for the root grid rows. + * */ rowExported?: Function; /** - * Cancel="true" Set a callback that is fired before the row exporting. + * A function to call before the row is exported. * Function takes arguments sender and args. * Use args.rowId to get key or index of row. * Use args.element to get row TR element. * Use args.xlRow to get reference to the worksheet row. * Use args.grid to get reference to the igGrid widget. - * Note: When exporting an igHierarchicalGrid this callback is available only for the root grid rows. + * Return false in order to cancel exporting the row. + * Note: When exporting igHierarchicalGrid this callback is available only for the root grid rows. + * */ rowExporting?: Function; /** - * Set a callback that is fired when exporting is successful. + * A function to call when saving the file succeeds. * Use data to get the reference of saved object. + * */ success?: Function; /** - * Set a callback that is fired after the summary is exported. + * A function to call after the summary is exported. * Function takes arguments sender and args. * Use args.headerText to get the igGrid column header text. * Use args.columnKey to get the igGrid column key. * Use args.columnIndex to get the igGrid column index. * Use args.summary to get a reference to the summary object. - * Use args.xlRowIndex to get the worksheet row index. + * Use args.xlRowIndex to get the Excel worksheet row index. + * */ summaryExported?: Function; /** - * Cancel="true" Set a callback that is fired before the summary exporting. + * A function to call before the summary is exported. * Function takes arguments sender and args. * Use args.headerText to get the igGrid column header text. * Use args.columnKey to get the igGrid column key. * Use args.columnIndex to get the igGrid column index. * Use args.summary to get a reference to the summary object. * Use args.xlRowIndex to get reference to worksheet row index. + * Return false in order to cancel exporting the summary. + * */ summaryExporting?: Function; @@ -6346,6 +6726,7 @@ interface GridExcelExporterSettingsGridFeatureOptions { /** * Indicates whether fixed columns will be applied in the exported table. This is set to none by default, but will change to applied if column fixing feature is defined in the igGrid. * + * * Valid values: * "none" No column fixing will be applied in the excel document. * "applied" Column fixing will be applied in the excel document. @@ -6355,6 +6736,7 @@ interface GridExcelExporterSettingsGridFeatureOptions { /** * Indicates whether filtering will be applied in the exported table. this is set to none by default, but will change to applied if filtering feature is defined in the igGrid. * + * * Valid values: * "none" No filtering will be applied in the excel document. * "applied" Filtering will be applied in the excel document. @@ -6365,6 +6747,7 @@ interface GridExcelExporterSettingsGridFeatureOptions { /** * Indicates whether hidden columns will be removed from the exported table. This is set to none by default, but will change to applied if hiding feature is defined in the igGrid. * + * * Valid values: * "none" All hidden columns will be exported to the excel document. * "applied" Hidden columns will be exported as hidden in the excel document. @@ -6375,6 +6758,7 @@ interface GridExcelExporterSettingsGridFeatureOptions { /** * Indicates whether the rows on the current page or entire data will exported. * + * * Valid values: * "currentPage" Only current page will be exported to the excel document. * "allRows" All pages will be exported to the excel document. @@ -6384,6 +6768,7 @@ interface GridExcelExporterSettingsGridFeatureOptions { /** * Indicates whether sorting will be applied in the exported table. This is set_ to none by default, but will change to applied if sorting feature is defined in the igGrid. * + * * Valid values: * "none" No sorting will be applied in the excel document. * "applied" Sorting will be applied in the excel document. @@ -6393,6 +6778,7 @@ interface GridExcelExporterSettingsGridFeatureOptions { /** * Indicates whether summaries will be added in the exported table. This is set to none by default, but will change to applied if summaries feature is defined in the igGrid. * + * * Valid values: * "none" No summaries will be exported to the excel document. * "applied" Summaries will be exported to the excel document. @@ -6407,13 +6793,15 @@ interface GridExcelExporterSettingsGridFeatureOptions { interface GridExcelExporterSettings { /** - * List of strings containing the keys for the columns that will not be exported. + * An array of strings containing the keys for the columns that will not be exported. + * */ columnsToSkip?: any[]; /** * Indicates whether all sublevel data will be exported, or only data under expanded rows. * + * * Valid values: * "allRows" All sublevel data will be exported. * "expandedRows" Only data under expanded rows will be exported. @@ -6422,6 +6810,7 @@ interface GridExcelExporterSettings { /** * Specifies the name of the excel file that will be generated. + * */ fileName?: string; @@ -6433,6 +6822,7 @@ interface GridExcelExporterSettings { /** * Indicates whether excel table styles will be the same as grid styles. This is set to applied by default. Custom grid themes are not supported. * + * * Valid values: * "none" The styles from the grid are not applied to the table region. * "applied" The styles from the grid are applied to the table region. @@ -6441,20 +6831,22 @@ interface GridExcelExporterSettings { /** * List of strings containing the keys for the worksheet columns which will not be applied any filtering + * */ skipFilteringOn?: any[]; /** - * Specifies the excel table style region. - * You can set the following table style + * Specifies the excel table style region. The following table styles are available: * TableStyleMedium[1-28] * TableStyleLight[1-21] * TableStyleDark[1-11] + * */ tableStyle?: string; /** - * Specifies the name of workbook where the igGrid will be exported. + * Specifies the worksheet name where the igGrid will be exported. + * */ worksheetName?: string; @@ -6473,7 +6865,7 @@ class GridExcelExporter { /** * Exports the provided igGrid to Excel document. * - * @param grid Grid to be exported. + * @param grid jQuery element of the igGrid. * @param userSettings Settings for exporting the grid. * @param userCallbacks Callbacks for the events. */ @@ -6608,6 +7000,11 @@ interface OlapXmlaDataSourceOptions { */ mdxSettings?: OlapXmlaDataSourceOptionsMdxSettings; + /** + * Specifies if the data is to be served by a XMLA remote provider. + */ + isRemote?: boolean; + /** * Option for OlapXmlaDataSourceOptions */ @@ -7528,16 +7925,27 @@ class OlapResultView { /** * Creates a new $.ig.OlapResultView object with result object having the same structure as the original one and new visibleResult where the tuples which appear as children under specified tuple and member index are no longer present. + * + * @param axisName + * @param tupleIndex + * @param memberIndex */ collapseTupleMember(axisName: Object, tupleIndex: Object, memberIndex: Object): Object; /** * Creates a $.ig.OlapResultView view object with result object having the same structure as the original one and new visibleResult where the tuples which appear as children under specified tuple and member index are accessible as part of the visibleResult. + * + * @param axisName + * @param tupleIndex + * @param memberIndex */ expandTupleMember(axisName: Object, tupleIndex: Object, memberIndex: Object): Object; /** * Creates a new $.ig.OlapResultView object as the axis specified by axisName of the original result object is extended with the tuples of the same axis found into supplied partialResult object. + * + * @param partialResult + * @param axisName */ extend(partialResult: Object, axisName: Object): Object; } @@ -7767,21 +8175,29 @@ declare namespace Infragistics { class Catalog { /** * Returns the name of the catalog. + * + * @param value */ name(value: Object): string; /** * Returns the unique name of the catalog. + * + * @param value */ uniqueName(value: Object): string; /** * Returns the caption of the catalog used when displaying the name of the catalog to the user. + * + * @param value */ caption(value: Object): string; /** * Returns the description of the catalog which is a human-readable description of the catalog + * + * @param value */ description(value: Object): string; } @@ -7791,21 +8207,29 @@ declare namespace Infragistics { class Cube { /** * Returns the name of the cube. + * + * @param value */ name(value: Object): string; /** * Returns the unique name of the cube. + * + * @param value */ uniqueName(value: Object): string; /** * Returns the caption of the cube used when displaying the name of the cube to the user. + * + * @param value */ caption(value: Object): string; /** * Returns a user-friendly description of the cube. + * + * @param value */ description(value: Object): string; @@ -7815,16 +8239,22 @@ class Cube { * $.ig.CubeType.prototype.cube = 0; * $.ig.CubeType.prototype.dimension = 1; * $.ig.CubeType.prototype.unknown = 2; + * + * @param value */ cubeType(value: Object): number; /** * Returns the date and time on which the cube was last processed. + * + * @param value */ lastProcessed(value: Object): Object; /** * Returns the date and time on which the cube was last updated. + * + * @param value */ lastUpdated(value: Object): Object; } @@ -7834,21 +8264,29 @@ declare namespace Infragistics { class Dimension { /** * Returns the name of the dimension. + * + * @param value */ name(value: Object): string; /** * Returns the unique name of the dimension. + * + * @param value */ uniqueName(value: Object): string; /** * Returns the caption of the dimension used when displaying the name of the dimension to the user. + * + * @param value */ caption(value: Object): string; /** * Returns a user-friendly description of the dimension. + * + * @param value */ description(value: Object): string; @@ -7872,6 +8310,8 @@ class Dimension { * $.ig.DimensionType.prototype.organization = 15; * $.ig.DimensionType.prototype.billOfMaterials = 16; * $.ig.DimensionType.prototype.geography = 17; + * + * @param value */ dimensionType(value: Object): number; } @@ -7881,36 +8321,50 @@ declare namespace Infragistics { class Hierarchy { /** * Returns the name of the hierarchy. + * + * @param value */ name(value: Object): string; /** * Returns the unique name of the hierarchy. + * + * @param value */ uniqueName(value: Object): string; /** * Returns the caption of the hierarchy used when displaying the name of the hierarchy to the user. + * + * @param value */ caption(value: Object): string; /** * Returns a user-friendly description of the hierarchy. + * + * @param value */ description(value: Object): string; /** * Returns the unique name of the default member for the hierarchy. + * + * @param value */ defaultMember(value: Object): string; /** * Returns the unique name of the 'All' member for the hierarchy. + * + * @param value */ allMember(value: Object): string; /** * Returns the unique name of the dimension that contains the hierarchy. + * + * @param value */ dimensionUniqueName(value: Object): string; @@ -7925,12 +8379,16 @@ class Hierarchy { * * $.ig.HierarchyOrigin.prototype.systemInternal = 4; * Identifies attributes with no attribute . + * + * @param value */ hierarchyOrigin(value: Object): number; /** * Returns the hierarchy display folder path to be used when displaying the hierarchy in the user interface. * Folder names will be separated by a semicolon (;). Nested folders are indicated by a backslash (\). + * + * @param value */ hierarchyDisplayFolder(value: Object): string; } @@ -7940,26 +8398,36 @@ declare namespace Infragistics { class Measure { /** * Returns the name of the measure. + * + * @param value */ name(value: Object): string; /** * Returns the unique name of the measure. + * + * @param value */ uniqueName(value: Object): string; /** * Returns the caption of the measure used when displaying the name of the measure to the user. + * + * @param value */ caption(value: Object): string; /** * Returns a user-friendly description of the measure. + * + * @param value */ description(value: Object): string; /** * Returns the name of the measure group this measure belongs to. + * + * @param value */ measureGroupName(value: Object): string; @@ -8010,17 +8478,23 @@ class Measure { * * $.ig.AggregatorType.prototype.calculated = 127; * The aggregated function will returns the result derived from a formula. + * + * @param value */ aggregatorType(value: Object): number; /** * Returns the default format string for the measure. + * + * @param value */ defaultFormatString(value: Object): string; /** * Returns the measure display folder path to be used when displaying the measure in the user interface. * Folder names will be separated by a semicolon (;). Nested folders are indicated by a backslash (\). + * + * @param value */ measureDisplayFolder(value: Object): string; } @@ -8030,51 +8504,71 @@ declare namespace Infragistics { class Level { /** * Returns the name of the level. + * + * @param value */ name(value: Object): string; /** * Returns the unique name of the level. + * + * @param value */ uniqueName(value: Object): string; /** * Returns the caption of the level used when displaying the name of the level to the user. + * + * @param value */ caption(value: Object): string; /** * Returns a user-friendly description of the level. + * + * @param value */ description(value: Object): string; /** * Returns the distance of the level from the root of the level. Root level is zero (0) + * + * @param value */ depth(value: Object): number; /** * Returns the unique name of the hierarchy that contains the level. + * + * @param value */ hierarchyUniqueName(value: Object): string; /** * Returns the unique name of the dimension that contains the level. + * + * @param value */ dimensionUniqueName(value: Object): string; /** * Returns the count of all members in the level. + * + * @param value */ membersCount(value: Object): number; /** * Returns a value that defines how the level was sourced. + * + * @param value */ levelOrigin(value: Object): number; /** * Returns the ID of the attribute that the level is sorted on. + * + * @param value */ levelOrderingProperty(value: Object): number; } @@ -8084,26 +8578,36 @@ declare namespace Infragistics { class MeasureGroup { /** * Returns the name of the measure group. + * + * @param value */ name(value: Object): string; /** * Returns the caption of the measure group used when displaying the name of the measure group to the user. + * + * @param value */ caption(value: Object): string; /** * Returns a user-friendly description of the measure group. + * + * @param value */ description(value: Object): string; /** * Returns the name of the catalog to which this measure group belongs. + * + * @param value */ catalogName(value: Object): string; /** * Returns the name of the cube to which this measure group belongs + * + * @param value */ cubeName(value: Object): string; } @@ -8113,11 +8617,15 @@ declare namespace Infragistics { class MeasureList { /** * Returns the caption of the measure list used when displaying the name of the measure list to the user. + * + * @param value */ caption(value: Object): string; /** * Returns an array of $.ig.Measure objects this measure list is grouping. + * + * @param value */ measures(value: Object): any[]; } @@ -8127,16 +8635,22 @@ declare namespace Infragistics { class OlapResult { /** * Returns a value indicating whether the result object contains any data. + * + * @param value */ isEmpty(value: Object): boolean; /** * Returns an array of $.ig.OlapResultAxis objects this result is built on. + * + * @param value */ axes(value: Object): any[]; /** * Returns an array of $.ig.OlapResultCell objects which hold the result data. + * + * @param value */ cells(value: Object): any[]; } @@ -8208,51 +8722,71 @@ declare namespace Infragistics { class OlapResultAxisMember { /** * Returns the unique name of the axis member. + * + * @param value */ uniqueName(value: Object): string; /** * Returns the caption of the axis member used when displaying the name of the axis member to the user. + * + * @param value */ caption(value: Object): string; /** * Returns the unique name of the level this member belongs to. + * + * @param value */ levelUniqueName(value: Object): string; /** * Returns the unique name of the hierarchy that contains the level. + * + * @param value */ hierarchyUniqueName(value: Object): string; /** * Returns the distance of member parent level from the root of the level. Root level is zero (0) + * + * @param value */ levelNumber(value: Object): number; /** * A bitmap of the information projected by childCount, drilledDown and parentSameAsPrev properties. + * + * @param value */ displayInfo(value: Object): number; /** * Returns the count of children members this member has. + * + * @param value */ childCount(value: Object): number; /** * Returns a value that indicates whether at least one child of this member appears on the axis, immediately following all occurrences of that member. This can be used by applications to display a "+" or a "-" next to the member. + * + * @param value */ drilledDown(value: Object): boolean; /** * Returns a value that indicates whether the parent of this member is the same as the parent of the member preceding all occurrences of the current member. + * + * @param value */ parentSameAsPrev(value: Object): boolean; /** * Returns a key value map of the members' properties. By default only 'PARENT_UNIQUE_NAME' and 'CHILDREN_CARDINALITY' properties are available. + * + * @param value */ properties(value: Object): Object; } @@ -8262,11 +8796,15 @@ declare namespace Infragistics { class OlapResultCell { /** * Returns the position of the cell when cells are iterated row by row. + * + * @param value */ cellOrdinal(value: Object): number; /** * Returns a key value map of the cell's properties. Currently only 'Value' and 'FmtValue' properties are available. + * + * @param value */ properties(value: Object): Object; } @@ -9296,6 +9834,24 @@ interface IgBulletGraph { */ pixelScalingRatio?: number; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event which is raised when a label of the bullet graph is formatted. * Function takes first argument evt and second argument ui. @@ -9373,6 +9929,24 @@ interface IgBulletGraphMethods { * Re-polls the css styles for the widget. Use this method when the css styles have been modified. */ styleUpdated(): void; + + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ + changeLocale($container: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igBulletGraph"): IgBulletGraphMethods; @@ -9387,6 +9961,9 @@ interface JQuery { igBulletGraph(methodName: "flush"): void; igBulletGraph(methodName: "destroy"): void; igBulletGraph(methodName: "styleUpdated"): void; + igBulletGraph(methodName: "changeLocale", $container: Object): void; + igBulletGraph(methodName: "changeGlobalLanguage"): void; + igBulletGraph(methodName: "changeGlobalRegional"): void; /** * The width of the gauge. It can be set as a number in pixels, string (px) or percentage (%). @@ -10162,6 +10739,50 @@ interface JQuery { */ igBulletGraph(optionLiteral: 'option', optionName: "pixelScalingRatio", optionValue: number): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igBulletGraph(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igBulletGraph(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igBulletGraph(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igBulletGraph(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igBulletGraph(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igBulletGraph(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event which is raised when a label of the bullet graph is formatted. * Function takes first argument evt and second argument ui. @@ -10241,26 +10862,46 @@ interface SeriesRemovedEvent { interface SeriesRemovedEventUIParam {} +interface SeriesPointerEnterEvent { + (event: Event, ui: SeriesPointerEnterEventUIParam): void; +} + +interface SeriesPointerEnterEventUIParam {} + +interface SeriesPointerLeaveEvent { + (event: Event, ui: SeriesPointerLeaveEventUIParam): void; +} + +interface SeriesPointerLeaveEventUIParam {} + +interface SeriesPointerMoveEvent { + (event: Event, ui: SeriesPointerMoveEventUIParam): void; +} + +interface SeriesPointerMoveEventUIParam {} + +interface SeriesPointerDownEvent { + (event: Event, ui: SeriesPointerDownEventUIParam): void; +} + +interface SeriesPointerDownEventUIParam {} + +interface SeriesPointerUpEvent { + (event: Event, ui: SeriesPointerUpEventUIParam): void; +} + +interface SeriesPointerUpEventUIParam {} + interface IgCategoryChart { /** - * Gets or sets the data value corresponding to the minimum value of the Y-axis. + * Gets or sets the id of a template element to use for tooltips, or markup representing the tooltip template. */ - yAxisMinimumValue?: number; + tooltipTemplate?: any; /** - * Gets or sets the data value corresponding to the maximum value of the Y-axis. + * Gets or sets the names of tooltip templates */ - yAxisMaximumValue?: number; - - /** - * Gets or sets the distance between the X-axis and the bottom of the chart. - */ - xAxisExtent?: number; - - /** - * Gets or sets the distance between the Y-axis and the left edge of the chart. - */ - yAxisExtent?: number; + tooltipTemplates?: any; /** * Gets or sets the left margin of chart title @@ -10282,78 +10923,6 @@ interface IgCategoryChart { */ titleBottomMargin?: number; - /** - * Gets or sets the duration used for animating series plots when the chart is loading into view - */ - transitionInDuration?: number; - - /** - * Gets or sets the duration used for animating series plots when the data is changing - */ - transitionDuration?: number; - - /** - * Gets or sets the easing function used for animating series plots when the chart is loading into view - * This can be set to one of the known values "linear" or "cubic," or it can be set to an easing function which takes a single numeric parameter and returns a number. - */ - transitionInEasingFunction?: any; - - /** - * Gets or sets the easing function used for animating series plots when the data is changing. - * This can be set to one of the known values "linear" or "cubic," or it can be set to an easing function which takes a single numeric parameter and returns a number. - */ - transitionEasingFunction?: any; - - /** - * Gets or sets the left margin of labels on the X-axis - */ - xAxisLabelLeftMargin?: number; - - /** - * Gets or sets the top margin of labels on the X-axis - */ - xAxisLabelTopMargin?: number; - - /** - * Gets or sets the right margin of labels on the X-axis - */ - xAxisLabelRightMargin?: number; - - /** - * Gets or sets the bottom margin of labels on the X-axis - */ - xAxisLabelBottomMargin?: number; - - /** - * Gets or sets the left margin of labels on the Y-axis - */ - yAxisLabelLeftMargin?: number; - - /** - * Gets or sets the top margin of labels on the Y-axis - */ - yAxisLabelTopMargin?: number; - - /** - * Gets or sets the right margin of labels on the Y-axis - */ - yAxisLabelRightMargin?: number; - - /** - * Gets or sets the bottom margin of labels on the Y-axis - */ - yAxisLabelBottomMargin?: number; - - /** - * Gets or sets color of labels on the X-axis - */ - xAxisLabelTextColor?: string; - - /** - * Gets or sets color of labels on the Y-axis - */ - yAxisLabelTextColor?: string; - /** * Gets or sets the left margin of chart subtitle */ @@ -10404,6 +10973,273 @@ interface IgCategoryChart { */ bottomMargin?: number; + /** + * Gets or sets the duration used for animating series plots when the data is changing + */ + transitionDuration?: number; + + /** + * Gets or sets the easing function used for animating series plots when the data is changing. + * This can be set to one of the known values "linear" or "cubic," or it can be set to an easing function which takes a single numeric parameter and returns a number. + */ + transitionEasingFunction?: any; + + /** + * Gets or sets a function for creating wrapped tooltip + */ + createWrappedTooltip?: any; + + /** + * Gets or sets the widget of this control + */ + widget?: any; + + /** + * Gets or sets CSS font property for the chart subtitle + */ + subtitleTextStyle?: string; + + /** + * Gets or sets CSS font property for the chart title + */ + titleTextStyle?: string; + + /** + * Gets or sets a collection of data items used to generate the chart. + * The ItemsSource of this chart can be a list of objects containing one or more numeric properties. + * Additionally, if the objects in the list implement the IEnumerable interface, + * the Chart will attempt to delve into the sub-collections when reading through the data source. + * Databinding can be further configured by attributing the data item classes + * with the DataSeriesMemberIntentAttribute. + */ + itemsSource?: any; + + /** + * Gets or sets a set of property paths that should be included for consideration by the category chart, leaving the remainder excluded. If null, all properties will be considered. + */ + includedProperties?: any; + + /** + * Gets or sets a set of property paths that should be excluded from consideration by the category chart. + */ + excludedProperties?: any; + + /** + * Gets or sets the palette of brushes to use for coloring the chart series. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + brushes?: any; + + /** + * Gets or sets the palette of brushes to use for outlines on the chart series. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + outlines?: any; + + /** + * Gets or sets the legend to connect this chart to. + * When the legend property is set, the chart will use it to display information about its series. Legends can be shared by multiple chart controls. + */ + legend?: any; + + /** + * Gets or sets whether the chart can be horizontally zoomed through user interactions. + */ + isHorizontalZoomEnabled?: boolean; + + /** + * Gets or sets whether the chart can be vertically zoomed through user interactions. + */ + isVerticalZoomEnabled?: boolean; + + /** + * Gets or sets the rectangle representing the current scroll and zoom state of the chart. + * WindowRect is expressed as a Rectangle with coordinates and sizes between 0 and 1. + * The provided object should have numeric properties called left, top, width and height. + */ + windowRect?: any; + + /** + * Gets or sets text to display above the plot area. + */ + title?: string; + + /** + * Gets or sets text to display below the Title, above the plot area. + */ + subtitle?: string; + + /** + * Gets or sets horizontal alignment which determines the title position, relative to the left and right edges of the control. + * + * Valid values: + * "left" Align the item to the left + * "center" Center the item + * "right" Align the item to the right + * "stretch" Stretch the item to the full width + */ + titleAlignment?: string; + + /** + * Gets or sets horizontal alignment which determines the subtitle position, relative to the left and right edges of the control. + * + * Valid values: + * "left" Align the item to the left + * "center" Center the item + * "right" Align the item to the right + * "stretch" Stretch the item to the full width + */ + subtitleAlignment?: string; + + /** + * Gets or sets the behavior that determines how unknown values will be plotted on the chart.Null and Double.NaN are two examples of unknown values. + * + * + * Valid values: + * "linearInterpolate" Plot the unknown value as the midpoint between surrounding known values using linear interpolation. + * "dontPlot" Do not plot the unknown value on the chart. + */ + unknownValuePlotting?: string; + + /** + * Gets or sets the rendering resolution for all series in this chart. + * Where n = Resolution, for every n horizontal pixels, combine all items into a single datapoint. When Resolution = 0, all datapoints will be rendered as graphical objects. Charts with a higher resolution will have faster performance. + */ + resolution?: number; + + /** + * Gets or sets the thickness for all series in this chart. Depending on the ChartType, this can be the main brush used, or just the outline. + */ + thickness?: number; + + /** + * Gets or sets the marker shapes used for indicating location of data points in this chart. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + */ + markerTypes?: any; + + /** + * Gets or sets the palette of brushes used for rendering fill area of data point markers. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + markerBrushes?: any; + + /** + * Gets or sets the palette of brushes used for rendering outlines of data point markers. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + markerOutlines?: any; + + /** + * Gets or sets the maximum number of markers displyed in the plot area of the chart. + */ + markerMaxCount?: number; + + /** + * Gets or sets the palette of brushes to used for coloring trend lines in this chart. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + trendLineBrushes?: any; + + /** + * Gets or sets the formula used for calculating trend lines in this chart.This property applies only to these chart types: point, line, spline, and bubble + * + * + * Valid values: + * "none" No trend line will be displayed. + * "linearFit" Linear fit. + * "quadraticFit" Quadratic polynomial fit. + * "cubicFit" Cubic polynomial fit. + * "quarticFit" Quartic polynomial fit. + * "quinticFit" Quintic polynomial fit. + * "logarithmicFit" Logarithmic fit. + * "exponentialFit" Exponential fit. + * "powerLawFit" Powerlaw fit. + * "simpleAverage" Simple moving average. + * "exponentialAverage" Exponential moving average. + * "modifiedAverage" Modified moving average. + * "cumulativeAverage" Cumulative moving average. + * "weightedAverage" Weighted moving average. + */ + trendLineType?: string; + + /** + * Gets or sets the thickness of the trend lines in this chart. + * This property applies only to these chart types: point, line, spline, and bubble + */ + trendLineThickness?: number; + + /** + * Gets or sets a value indicating whether grid and tick lines are aligned to device pixels. + */ + alignsGridLinesToPixels?: boolean; + trendLinePeriod?: number; + + /** + * Gets or sets function which takes an context object and returns a formatted label for the X-axis. + */ + xAxisFormatLabel?: any; + + /** + * Gets or sets function which takes a context object and returns a formatted label for the Y-axis. + */ + yAxisFormatLabel?: any; + + /** + * Gets or sets the left margin of labels on the X-axis + */ + xAxisLabelLeftMargin?: number; + + /** + * Gets or sets the top margin of labels on the X-axis + */ + xAxisLabelTopMargin?: number; + + /** + * Gets or sets the right margin of labels on the X-axis + */ + xAxisLabelRightMargin?: number; + + /** + * Gets or sets the bottom margin of labels on the X-axis + */ + xAxisLabelBottomMargin?: number; + + /** + * Gets or sets the left margin of labels on the Y-axis + */ + yAxisLabelLeftMargin?: number; + + /** + * Gets or sets the top margin of labels on the Y-axis + */ + yAxisLabelTopMargin?: number; + + /** + * Gets or sets the right margin of labels on the Y-axis + */ + yAxisLabelRightMargin?: number; + + /** + * Gets or sets the bottom margin of labels on the Y-axis + */ + yAxisLabelBottomMargin?: number; + + /** + * Gets or sets color of labels on the X-axis + */ + xAxisLabelTextColor?: string; + + /** + * Gets or sets color of labels on the Y-axis + */ + yAxisLabelTextColor?: string; + /** * Gets or sets the margin around a title on the X-axis */ @@ -10463,34 +11299,6 @@ interface IgCategoryChart { * Gets or sets color of title on the Y-axis */ yAxisTitleTextColor?: string; - createWrappedTooltip?: any; - - /** - * Gets or sets the id of a template element to use for tooltips, or markup representing the tooltip template. - */ - tooltipTemplate?: string; - tooltipTemplates?: any; - - /** - * Gets or sets function which takes an context object and returns a formatted label for the X-axis. - */ - xAxisFormatLabel?: any; - - /** - * Gets or sets function which takes a context object and returns a formatted label for the Y-axis. - */ - yAxisFormatLabel?: any; - - /** - * Gets or sets CSS font property for title on X-axis - */ - xAxisTitleTextStyle?: string; - - /** - * Gets or sets CSS font property for title on Y-axis - */ - yAxisTitleTextStyle?: string; - widget?: any; /** * Gets or sets CSS font property for labels on X-axis @@ -10503,222 +11311,14 @@ interface IgCategoryChart { yAxisLabelTextStyle?: string; /** - * Gets or sets CSS font property for the chart subtitle + * Gets or sets CSS font property for title on X-axis */ - subtitleTextStyle?: string; + xAxisTitleTextStyle?: string; /** - * Gets or sets CSS font property for the chart title + * Gets or sets CSS font property for title on Y-axis */ - titleTextStyle?: string; - - /** - * Gets or sets a collection of data items used to generate the chart. - * Value of this property can be a list of objects containing one or more numeric properties. Additionally, if the objects in the list implement the IEnumerable interface, the Category Chart will attempt to delve into the sub-collections when reading through the data source. Databinding can be further configured by attributing the data item classes with the DataSeriesMemberIntentAttribute. - */ - itemsSource?: any; - - /** - * Gets or sets a set of property paths that should be included for consideration by the category chart, leaving the remaineder excluded. If null, all properties will be considered. - */ - includedProperties?: any; - - /** - * Gets or sets a set of property paths that should be excluded from consideration by the category chart. - */ - excludedProperties?: any; - - /** - * Gets or sets the type of chart series to generate from the data. - * - * Valid values: - * "line" Specifies category line series with markers at each data point - * "area" Specifies category area series - * "column" Specifies category column chart with vertical rectangles at each data point - * "point" Specifies category point chart with markers at each data point - * "stepLine" Specifies category step line chart - * "stepArea" Specifies category step area chart - * "spline" Specifies category spline line series with markers at each data point - * "splineArea" Specifies category spline area series - * "waterfall" Specifies category waterfall chart - * "auto" Specifies automatic selection of chart type based on suggestions from Data Adapter - */ - chartType?: string; - - /** - * Gets or sets the palette of brushes to use for coloring the chart series. The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection - * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. - */ - brushes?: any; - - /** - * Gets or sets the palette of brushes to use for outlines on the chart series. The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection - * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. - */ - outlines?: any; - - /** - * Sets the legend to connect this chart to. - * When the legend property is set, the chart will use it to display information about its series. Legends can be shared by multiple chart controls. - */ - legend?: any; - - /** - * Gets or sets whether the chart can be horizontally zoomed through user interaction. - */ - isHorizontalZoomEnabled?: boolean; - - /** - * Gets or sets whether the chart can be vertically zoomed through user interaction. - */ - isVerticalZoomEnabled?: boolean; - - /** - * Gets or sets the rectangle representing the current scroll and zoom state of the chart. - * WindowRect is expressed as a Rectangle with coordinates and sizes between 0 and 1. - * The provided object should have numeric properties called left, top, width and height. - */ - windowRect?: any; - - /** - * Gets or sets text to display above the plot area. - */ - title?: string; - - /** - * Gets or sets text to display below the chart Title, above the plot area. - */ - subtitle?: string; - - /** - * Gets or sets horizontal alignment which determines the title position, relative to the left and right edges of the chart. - * - * Valid values: - * "left" Align the item to the left - * "center" Center the item - * "right" Align the item to the right - * "stretch" Stretch the item to the full width - */ - titleAlignment?: string; - - /** - * Gets or sets horizontal alignment which determines the subtitle position, relative to the left and right edges of the chart. - * - * Valid values: - * "left" Align the item to the left - * "center" Center the item - * "right" Align the item to the right - * "stretch" Stretch the item to the full width - */ - subtitleAlignment?: string; - - /** - * Gets or sets the behavior that determines how unknown values will be plotted on the chart.Null and Double.NaN are two examples of unknown values. - * - * Valid values: - * "linearInterpolate" Plot the unknown value as the midpoint between surrounding known values using linear interpolation. - * "dontPlot" Do not plot the unknown value on the chart. - */ - unknownValuePlotting?: string; - - /** - * Gets or sets the behavior for markers in each series which are placed too close together for the current view, resulting in a collision. - * - * Valid values: - * "none" Collision avoidance is disabled. - * "omit" Items colliding with other items will be hidden from view. - */ - markerCollisionAvoidance?: string; - - /** - * Gets or sets whether animation of series plots is enabled when the chart is loading into view - */ - isTransitionInEnabled?: boolean; - - /** - * Gets or sets the method that determines how to animate series plots when the chart is loading into view - * - * Valid values: - * "auto" Series transitions in an automatically chosen based on type of series and its orientation - * "fromZero" Series transitions in from the reference value of the value axis. - * "sweepFromLeft" Series sweeps in from the left - * "sweepFromRight" Series sweeps in from the right - * "sweepFromTop" Series sweeps in from the top. - * "sweepFromBottom" Series sweeps in from the bottom. - * "sweepFromCenter" Series sweeps in from the center. - * "accordionFromLeft" Series accordions in from the left. - * "accordionFromRight" Series accordions in from the right. - * "accordionFromTop" Series accordions in from the top. - * "accordionFromBottom" Series accordions in from the bottom. - * "expand" Series expands from the value midpoints. - * "sweepFromCategoryAxisMinimum" Series sweeps in from the category axis minimum. - * "sweepFromCategoryAxisMaximum" Series sweeps in from the category axis maximum. - * "sweepFromValueAxisMinimum" Series sweeps in from the value axis minimum. - * "sweepFromValueAxisMaximum" Series sweeps in from the value axis maximum. - * "accordionFromCategoryAxisMinimum" Series accordions in from the category axis minimum. - * "accordionFromCategoryAxisMaximum" Series accordions in from the category axis maximum. - * "accordionFromValueAxisMinimum" Series accordions in from the value axis minimum. - * "accordionFromValueAxisMaximum" Series accordions in from the value axis maximum. - */ - transitionInMode?: string; - - /** - * Gets or sets the arrival speed used for animating series plots when the chart is loading into view - * - * Valid values: - * "auto" A speed type is automatically selected. - * "normal" All speeds are normal, data points will arrive at the same time. - * "valueScaled" Data points will arrive later if their value is further from the start point. - * "indexScaled" Data points will arrive later if their index is further from the axis origin. - * "random" Data points will arrive at random times. - */ - transitionInSpeedType?: string; - - /** - * Gets or sets the frequency of displayed labels along the X-axis. - * Gets or sets the set value is a factor that determines which labels will be hidden. For example, an interval of 2 will display every other label. - */ - xAxisInterval?: number; - - /** - * Gets or sets the frequency of displayed minor lines along the X-axis. - * Gets or sets the set value is a factor that determines how the minor lines will be displayed. - */ - xAxisMinorInterval?: number; - - /** - * Gets or sets the amount of space between adjacent categories for the X-axis. - * The gap is silently clamped to the range [0, 1] when used. - */ - xAxisGap?: number; - - /** - * Gets or sets the amount of overlap between adjacent categories for the X-axis. - * Gets or sets the overlap is silently clamped to the range [-1, 1] when used. - */ - xAxisOverlap?: number; - - /** - * Gets or sets the distance between each label and grid line along the Y-axis. - */ - yAxisInterval?: number; - - /** - * Gets or sets whether the Y-axis should use a logarithmic scale instead of a linear one. - * Since log(-1) is imaginary and log(0) is undefined, it is recommended to enable this property only when the Y-axis minimum is greater than zero. - */ - yAxisIsLogarithmic?: boolean; - - /** - * Gets or sets the base value to use in the log function when mapping the position of data items along the Y-axis. - * This property is effective only when YAxisIsLogarithmic is true. - */ - yAxisLogarithmBase?: number; - - /** - * Gets or sets the frequency of displayed minor lines along the Y-axis. - */ - yAxisMinorInterval?: number; + yAxisTitleTextStyle?: string; /** * Gets or sets the format for labels along the X-axis. @@ -10821,12 +11421,12 @@ interface IgCategoryChart { yAxisTickStrokeThickness?: number; /** - * Text to display below the X-axis. + * Gets or sets the Text to display below the X-axis. */ xAxisTitle?: string; /** - * Text to display to the left of the Y-axis. + * Gets or sets the Text to display to the left of the Y-axis. */ yAxisTitle?: string; @@ -10850,6 +11450,16 @@ interface IgCategoryChart { */ yAxisLabelAngle?: number; + /** + * Gets or sets the distance between the X-axis and the bottom of the chart. + */ + xAxisExtent?: number; + + /** + * Gets or sets the distance between the Y-axis and the left edge of the chart. + */ + yAxisExtent?: number; + /** * Gets or sets the angle of rotation for the X-axis title. */ @@ -10861,84 +11471,17 @@ interface IgCategoryChart { yAxisTitleAngle?: number; /** - * Gets or sets the rendering resolution for series in this chart. - * Where n = Resolution, for every n horizontal pixels, combine all items into a single datapoint. When Resolution = 0, all datapoints will be rendered as graphical objects. Charts with a higher resolution will have faster performance. - */ - resolution?: number; - - /** - * Gets or sets the palette of brushes to used for coloring trend lines in this chart. The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection - * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. - */ - trendLineBrushes?: any; - - /** - * Gets or sets the formula used for calculating trend lines in this chart. - * - * Valid values: - * "none" No trend line will be displayed. - * "linearFit" Linear fit. - * "quadraticFit" Quadratic polynomial fit. - * "cubicFit" Cubic polynomial fit. - * "quarticFit" Quartic polynomial fit. - * "quinticFit" Quintic polynomial fit. - * "logarithmicFit" Logarithmic fit. - * "exponentialFit" Exponential fit. - * "powerLawFit" Powerlaw fit. - * "simpleAverage" Simple moving average. - * "exponentialAverage" Exponential moving average. - * "modifiedAverage" Modified moving average. - * "cumulativeAverage" Cumulative moving average. - * "weightedAverage" Weighted moving average. - */ - trendLineType?: string; - - /** - * Gets or sets the thickness of the chart series. Depending on the ChartType, this can be the main brush used, or just the outline. - */ - thickness?: number; - - /** - * Gets or sets the collection of marker shapes used for representing data points of series in this chart. - * When MarkerTypes is null or empty, each series' marker type will be set to none or automatic, depending on the series type. - */ - markerTypes?: any; - - /** - * Gets or sets the palette of brushes used as the fill color for data point markers. - * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. - */ - markerBrushes?: any; - - /** - * Gets or sets the palette of brushes used for coloring outline of data point markers. - * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. - */ - markerOutlines?: any; - - /** - * Gets or sets the thickness of the trend lines in this chart. - */ - trendLineThickness?: number; - - /** - * Gets or sets whether the direction of the X-axis is inverted, placing the first data items on the right side instead of left side + * Gets or sets whether to invert the direction of the X-axis by placing the first data items on the right side of the chart. */ xAxisInverted?: boolean; /** - * Gets or sets whether the direction of the Y-axis is inverted, placing minimum numeric value at the top of the axis instead of bottom + * Gets or sets whether to invert the direction of the Y-axis by placing the minimum numeric value at the top of the chart. */ yAxisInverted?: boolean; /** - * Gets or sets the palette used for coloring negative items of Waterfall chart type. - * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. - */ - negativeBrushes?: any; - - /** - * Gets or sets the horizontal alignment of the X-axis title. + * Gets or sets Horizontal alignment of the X-axis title. * * Valid values: * "left" Align the item to the left @@ -10949,7 +11492,7 @@ interface IgCategoryChart { xAxisTitleAlignment?: string; /** - * Gets or sets the vertical alignment of the Y-axis title. + * Gets or sets Vertical alignment of the Y-axis title. * * Valid values: * "top" Align the item to the top @@ -10960,7 +11503,7 @@ interface IgCategoryChart { yAxisTitleAlignment?: string; /** - * Gets or sets the horizontal alignment of X-axis labels. + * Gets or sets Horizontal alignment of X-axis labels. * * Valid values: * "left" Align the item to the left @@ -10971,7 +11514,7 @@ interface IgCategoryChart { xAxisLabelHorizontalAlignment?: string; /** - * Gets or sets the horizontal alignment of Y-axis labels. + * Gets or sets Horizontal alignment of Y-axis labels. * * Valid values: * "left" Align the item to the left @@ -10982,7 +11525,7 @@ interface IgCategoryChart { yAxisLabelHorizontalAlignment?: string; /** - * Gets or sets the vertical alignment of X-axis labels. + * Gets or sets Vertical alignment of X-axis labels. * * Valid values: * "top" Align the item to the top @@ -10993,7 +11536,7 @@ interface IgCategoryChart { xAxisLabelVerticalAlignment?: string; /** - * Gets or sets the vertical alignment of Y-axis labels. + * Gets or sets Vertical alignment of Y-axis labels. * * Valid values: * "top" Align the item to the top @@ -11004,7 +11547,7 @@ interface IgCategoryChart { yAxisLabelVerticalAlignment?: string; /** - * Gets or sets the visibility of X-axis labels. + * Gets or sets Visibility of X-axis labels. * * Valid values: * "visible" Display the element. @@ -11013,7 +11556,7 @@ interface IgCategoryChart { xAxisLabelVisibility?: string; /** - * Gets or sets the visibility of Y-axis labels. + * Gets or sets Visibility of Y-axis labels. * * Valid values: * "visible" Display the element. @@ -11021,6 +11564,164 @@ interface IgCategoryChart { */ yAxisLabelVisibility?: string; + /** + * The location of Y-axis labels, relative to the plot area. + * + * Valid values: + * "outsideTop" Places the axis labels at the top, outside of the plotting area. + * "outsideBottom" Places the axis labels at the bottom, outside of the plotting area + * "outsideLeft" Places the axis labels to the left, outside of the plotting area. + * "outsideRight" Places the axis labels to the right, outside of the plotting area. + * "insideTop" Places the axis labels inside the plotting area above the axis line. + * "insideBottom" Places the axis labels inside the plotting area below the axis line. + * "insideLeft" Places the axis labels inside the plotting area and to the left of the axis line. + * "insideRight" Places the axis labels inside the plotting area and to the right of the axis line. + */ + yAxisLabelLocation?: string; + + /** + * Gets or sets the duration used for animating series plots when the chart is loading into view + */ + transitionInDuration?: number; + + /** + * Gets or sets the easing function used for animating series plots when the chart is loading into view + * This can be set to one of the known values "linear" or "cubic," or it can be set to an easing function which takes a single numeric parameter and returns a number. + */ + transitionInEasingFunction?: any; + + /** + * Gets or sets the type of chart series to generate from the data. + * + * Valid values: + * "line" Specifies category line series with markers at each data point + * "area" Specifies category area series + * "column" Specifies category column chart with vertical rectangles at each data point + * "point" Specifies category point chart with markers at each data point + * "stepLine" Specifies category step line chart + * "stepArea" Specifies category step area chart + * "spline" Specifies category spline line series with markers at each data point + * "splineArea" Specifies category spline area series + * "waterfall" Specifies category waterfall chart + * "auto" Specifies automatic selection of chart type based on suggestions from Data Adapter + */ + chartType?: string; + + /** + * Gets or sets the behavior for markers in each series which are placed too close together for the current view, resulting in a collision. + * + * Valid values: + * "none" Collision avoidance is disabled. + * "omit" Items colliding with other items will be hidden from view. + */ + markerCollisionAvoidance?: string; + + /** + * Gets or sets whether animation of series plots is enabled when the chart is loading into view + */ + isTransitionInEnabled?: boolean; + + /** + * Gets or sets the method that determines how to animate series plots when the chart is loading into view + * + * Valid values: + * "auto" Series transitions in an automatically chosen based on type of series and its orientation + * "fromZero" Series transitions in from the reference value of the value axis. + * "sweepFromLeft" Series sweeps in from the left + * "sweepFromRight" Series sweeps in from the right + * "sweepFromTop" Series sweeps in from the top. + * "sweepFromBottom" Series sweeps in from the bottom. + * "sweepFromCenter" Series sweeps in from the center. + * "accordionFromLeft" Series accordions in from the left. + * "accordionFromRight" Series accordions in from the right. + * "accordionFromTop" Series accordions in from the top. + * "accordionFromBottom" Series accordions in from the bottom. + * "expand" Series expands from the value midpoints. + * "sweepFromCategoryAxisMinimum" Series sweeps in from the category axis minimum. + * "sweepFromCategoryAxisMaximum" Series sweeps in from the category axis maximum. + * "sweepFromValueAxisMinimum" Series sweeps in from the value axis minimum. + * "sweepFromValueAxisMaximum" Series sweeps in from the value axis maximum. + * "accordionFromCategoryAxisMinimum" Series accordions in from the category axis minimum. + * "accordionFromCategoryAxisMaximum" Series accordions in from the category axis maximum. + * "accordionFromValueAxisMinimum" Series accordions in from the value axis minimum. + * "accordionFromValueAxisMaximum" Series accordions in from the value axis maximum. + */ + transitionInMode?: string; + + /** + * Gets or sets the arrival speed used for animating series plots when the chart is loading into view + * + * Valid values: + * "auto" A speed type is automatically selected. + * "normal" All speeds are normal, data points will arrive at the same time. + * "valueScaled" Data points will arrive later if their value is further from the start point. + * "indexScaled" Data points will arrive later if their index is further from the axis origin. + * "random" Data points will arrive at random times. + */ + transitionInSpeedType?: string; + + /** + * Gets or sets the frequency of displayed labels along the X-axis. + * Gets or sets the set value is a factor that determines which labels will be hidden. For example, an interval of 2 will display every other label. + */ + xAxisInterval?: number; + + /** + * Gets or sets the frequency of displayed minor lines along the X-axis. + * Gets or sets the set value is a factor that determines how the minor lines will be displayed. + */ + xAxisMinorInterval?: number; + + /** + * Gets or sets the amount of space between adjacent categories for the X-axis. + * The gap is silently clamped to the range [0, 1] when used. + */ + xAxisGap?: number; + + /** + * Gets or sets the amount of overlap between adjacent categories for the X-axis. + * Gets or sets the overlap is silently clamped to the range [-1, 1] when used. + */ + xAxisOverlap?: number; + + /** + * Gets or sets the distance between each label and grid line along the Y-axis. + */ + yAxisInterval?: number; + + /** + * Gets or sets whether the Y-axis should use a logarithmic scale instead of a linear one. + * Since log(-1) is imaginary and log(0) is undefined, it is recommended to enable this property only when the Y-axis minimum is greater than zero. + */ + yAxisIsLogarithmic?: boolean; + + /** + * Gets or sets the base value to use in the log function when mapping the position of data items along the Y-axis. + * This property is effective only when YAxisIsLogarithmic is true. + */ + yAxisLogarithmBase?: number; + + /** + * Gets or sets the data value corresponding to the minimum value of the Y-axis. + */ + yAxisMinimumValue?: number; + + /** + * Gets or sets the data value corresponding to the maximum value of the Y-axis. + */ + yAxisMaximumValue?: number; + + /** + * Gets or sets the frequency of displayed minor lines along the Y-axis. + */ + yAxisMinorInterval?: number; + + /** + * Gets or sets the palette used for coloring negative items of Waterfall chart type. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + negativeBrushes?: any; + /** * Brushes to use for drawing negative elements, when using a chart type with contextual coloring, such as Waterfall. * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. @@ -11028,9 +11729,14 @@ interface IgCategoryChart { negativeOutlines?: any; /** - * Gets or sets a value indicating whether grid and tick lines are aligned to device pixels. + * Gets or sets whether the series animations should be allowed when a range change has been detected on an axis. */ - alignsGridLinesToPixels?: boolean; + animateSeriesWhenAxisRangeChanges?: boolean; + + /** + * Gets or sets whether the large numbers on the Y-axis labels are abbreviated. + */ + yAxisAbbreviateLargeNumbers?: boolean; /** * The width of the chart. @@ -11075,20 +11781,45 @@ interface IgCategoryChart { responseDataKey?: string; /** - * Event raised when a property value is changed. + * Event raised when a property value is changed on this chart */ propertyChanged?: PropertyChangedEvent; /** - * Event raised when a series is initialized + * Event raised when a series is initialized and added to this chart. */ seriesAdded?: SeriesAddedEvent; /** - * Event raised when a series is removed from the CategoryChart + * Event raised when a series is removed from this chart. */ seriesRemoved?: SeriesRemovedEvent; + /** + * Occurs when the pointer enters a Series. + */ + seriesPointerEnter?: SeriesPointerEnterEvent; + + /** + * Occurs when the pointer leaves a Series. + */ + seriesPointerLeave?: SeriesPointerLeaveEvent; + + /** + * Occurs when the pointer moves over a Series. + */ + seriesPointerMove?: SeriesPointerMoveEvent; + + /** + * Occurs when the pointer is pressed down over a Series. + */ + seriesPointerDown?: SeriesPointerDownEvent; + + /** + * Occurs when the pointer is released over a Series. + */ + seriesPointerUp?: SeriesPointerUpEvent; + /** * Event which is raised before data binding. * Return false in order to cancel data binding. @@ -11266,52 +11997,28 @@ interface JQuery { igCategoryChart(methodName: "flush"): void; /** - * Gets the data value corresponding to the minimum value of the Y-axis. + * Gets the id of a template element to use for tooltips, or markup representing the tooltip template. */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisMinimumValue"): number; + igCategoryChart(optionLiteral: 'option', optionName: "tooltipTemplate"): any; /** - * Sets the data value corresponding to the minimum value of the Y-axis. + * Sets the id of a template element to use for tooltips, or markup representing the tooltip template. * * @optionValue New value to be set. */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisMinimumValue", optionValue: number): void; + igCategoryChart(optionLiteral: 'option', optionName: "tooltipTemplate", optionValue: any): void; /** - * Gets the data value corresponding to the maximum value of the Y-axis. + * Gets the names of tooltip templates */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisMaximumValue"): number; + igCategoryChart(optionLiteral: 'option', optionName: "tooltipTemplates"): any; /** - * Sets the data value corresponding to the maximum value of the Y-axis. + * Sets the names of tooltip templates * * @optionValue New value to be set. */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisMaximumValue", optionValue: number): void; - - /** - * Gets the distance between the X-axis and the bottom of the chart. - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisExtent"): number; - - /** - * Sets the distance between the X-axis and the bottom of the chart. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisExtent", optionValue: number): void; - - /** - * Gets the distance between the Y-axis and the left edge of the chart. - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisExtent"): number; - - /** - * Sets the distance between the Y-axis and the left edge of the chart. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisExtent", optionValue: number): void; + igCategoryChart(optionLiteral: 'option', optionName: "tooltipTemplates", optionValue: any): void; /** * Gets the left margin of chart title @@ -11361,178 +12068,6 @@ interface JQuery { */ igCategoryChart(optionLiteral: 'option', optionName: "titleBottomMargin", optionValue: number): void; - /** - * Gets the duration used for animating series plots when the chart is loading into view - */ - igCategoryChart(optionLiteral: 'option', optionName: "transitionInDuration"): number; - - /** - * Sets the duration used for animating series plots when the chart is loading into view - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "transitionInDuration", optionValue: number): void; - - /** - * Gets the duration used for animating series plots when the data is changing - */ - igCategoryChart(optionLiteral: 'option', optionName: "transitionDuration"): number; - - /** - * Sets the duration used for animating series plots when the data is changing - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "transitionDuration", optionValue: number): void; - - /** - * Gets the easing function used for animating series plots when the chart is loading into view - * This can be set to one of the known values "linear" or "cubic," or it can be set to an easing function which takes a single numeric parameter and returns a number. - */ - igCategoryChart(optionLiteral: 'option', optionName: "transitionInEasingFunction"): any; - - /** - * Sets the easing function used for animating series plots when the chart is loading into view - * This can be set to one of the known values "linear" or "cubic," or it can be set to an easing function which takes a single numeric parameter and returns a number. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "transitionInEasingFunction", optionValue: any): void; - - /** - * Gets the easing function used for animating series plots when the data is changing. - * This can be set to one of the known values "linear" or "cubic," or it can be set to an easing function which takes a single numeric parameter and returns a number. - */ - igCategoryChart(optionLiteral: 'option', optionName: "transitionEasingFunction"): any; - - /** - * Sets the easing function used for animating series plots when the data is changing. - * This can be set to one of the known values "linear" or "cubic," or it can be set to an easing function which takes a single numeric parameter and returns a number. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "transitionEasingFunction", optionValue: any): void; - - /** - * Gets the left margin of labels on the X-axis - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelLeftMargin"): number; - - /** - * Sets the left margin of labels on the X-axis - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelLeftMargin", optionValue: number): void; - - /** - * Gets the top margin of labels on the X-axis - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelTopMargin"): number; - - /** - * Sets the top margin of labels on the X-axis - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelTopMargin", optionValue: number): void; - - /** - * Gets the right margin of labels on the X-axis - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelRightMargin"): number; - - /** - * Sets the right margin of labels on the X-axis - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelRightMargin", optionValue: number): void; - - /** - * Gets the bottom margin of labels on the X-axis - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelBottomMargin"): number; - - /** - * Sets the bottom margin of labels on the X-axis - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelBottomMargin", optionValue: number): void; - - /** - * Gets the left margin of labels on the Y-axis - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelLeftMargin"): number; - - /** - * Sets the left margin of labels on the Y-axis - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelLeftMargin", optionValue: number): void; - - /** - * Gets the top margin of labels on the Y-axis - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelTopMargin"): number; - - /** - * Sets the top margin of labels on the Y-axis - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelTopMargin", optionValue: number): void; - - /** - * Gets the right margin of labels on the Y-axis - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelRightMargin"): number; - - /** - * Sets the right margin of labels on the Y-axis - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelRightMargin", optionValue: number): void; - - /** - * Gets the bottom margin of labels on the Y-axis - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelBottomMargin"): number; - - /** - * Sets the bottom margin of labels on the Y-axis - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelBottomMargin", optionValue: number): void; - - /** - * Gets color of labels on the X-axis - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelTextColor"): string; - - /** - * Sets color of labels on the X-axis - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelTextColor", optionValue: string): void; - - /** - * Gets color of labels on the Y-axis - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelTextColor"): string; - - /** - * Sets color of labels on the Y-axis - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelTextColor", optionValue: string): void; - /** * Gets the left margin of chart subtitle */ @@ -11653,6 +12188,568 @@ interface JQuery { */ igCategoryChart(optionLiteral: 'option', optionName: "bottomMargin", optionValue: number): void; + /** + * Gets the duration used for animating series plots when the data is changing + */ + igCategoryChart(optionLiteral: 'option', optionName: "transitionDuration"): number; + + /** + * Sets the duration used for animating series plots when the data is changing + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "transitionDuration", optionValue: number): void; + + /** + * Gets the easing function used for animating series plots when the data is changing. + * This can be set to one of the known values "linear" or "cubic," or it can be set to an easing function which takes a single numeric parameter and returns a number. + */ + igCategoryChart(optionLiteral: 'option', optionName: "transitionEasingFunction"): any; + + /** + * Sets the easing function used for animating series plots when the data is changing. + * This can be set to one of the known values "linear" or "cubic," or it can be set to an easing function which takes a single numeric parameter and returns a number. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "transitionEasingFunction", optionValue: any): void; + + /** + * Gets a function for creating wrapped tooltip + */ + igCategoryChart(optionLiteral: 'option', optionName: "createWrappedTooltip"): any; + + /** + * Sets a function for creating wrapped tooltip + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "createWrappedTooltip", optionValue: any): void; + + /** + * Gets the widget of this control + */ + igCategoryChart(optionLiteral: 'option', optionName: "widget"): any; + + /** + * Sets the widget of this control + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "widget", optionValue: any): void; + + /** + * Gets CSS font property for the chart subtitle + */ + igCategoryChart(optionLiteral: 'option', optionName: "subtitleTextStyle"): string; + + /** + * Sets CSS font property for the chart subtitle + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "subtitleTextStyle", optionValue: string): void; + + /** + * Gets CSS font property for the chart title + */ + igCategoryChart(optionLiteral: 'option', optionName: "titleTextStyle"): string; + + /** + * Sets CSS font property for the chart title + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "titleTextStyle", optionValue: string): void; + + /** + * Gets a collection of data items used to generate the chart. + * The ItemsSource of this chart can be a list of objects containing one or more numeric properties. + * Additionally, if the objects in the list implement the IEnumerable interface, + * the Chart will attempt to delve into the sub-collections when reading through the data source. + * Databinding can be further configured by attributing the data item classes + * with the DataSeriesMemberIntentAttribute. + */ + igCategoryChart(optionLiteral: 'option', optionName: "itemsSource"): any; + + /** + * Sets a collection of data items used to generate the chart. + * The ItemsSource of this chart can be a list of objects containing one or more numeric properties. + * Additionally, if the objects in the list implement the IEnumerable interface, + * the Chart will attempt to delve into the sub-collections when reading through the data source. + * Databinding can be further configured by attributing the data item classes + * with the DataSeriesMemberIntentAttribute. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "itemsSource", optionValue: any): void; + + /** + * Gets a set of property paths that should be included for consideration by the category chart, leaving the remainder excluded. If null, all properties will be considered. + */ + igCategoryChart(optionLiteral: 'option', optionName: "includedProperties"): any; + + /** + * Sets a set of property paths that should be included for consideration by the category chart, leaving the remainder excluded. If null, all properties will be considered. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "includedProperties", optionValue: any): void; + + /** + * Gets a set of property paths that should be excluded from consideration by the category chart. + */ + igCategoryChart(optionLiteral: 'option', optionName: "excludedProperties"): any; + + /** + * Sets a set of property paths that should be excluded from consideration by the category chart. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "excludedProperties", optionValue: any): void; + + /** + * Gets the palette of brushes to use for coloring the chart series. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igCategoryChart(optionLiteral: 'option', optionName: "brushes"): any; + + /** + * Sets the palette of brushes to use for coloring the chart series. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "brushes", optionValue: any): void; + + /** + * Gets the palette of brushes to use for outlines on the chart series. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igCategoryChart(optionLiteral: 'option', optionName: "outlines"): any; + + /** + * Sets the palette of brushes to use for outlines on the chart series. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "outlines", optionValue: any): void; + + /** + * Gets the legend to connect this chart to. + * When the legend property is set, the chart will use it to display information about its series. Legends can be shared by multiple chart controls. + */ + igCategoryChart(optionLiteral: 'option', optionName: "legend"): any; + + /** + * Sets the legend to connect this chart to. + * When the legend property is set, the chart will use it to display information about its series. Legends can be shared by multiple chart controls. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "legend", optionValue: any): void; + + /** + * Gets whether the chart can be horizontally zoomed through user interactions. + */ + igCategoryChart(optionLiteral: 'option', optionName: "isHorizontalZoomEnabled"): boolean; + + /** + * Sets whether the chart can be horizontally zoomed through user interactions. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "isHorizontalZoomEnabled", optionValue: boolean): void; + + /** + * Gets whether the chart can be vertically zoomed through user interactions. + */ + igCategoryChart(optionLiteral: 'option', optionName: "isVerticalZoomEnabled"): boolean; + + /** + * Sets whether the chart can be vertically zoomed through user interactions. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "isVerticalZoomEnabled", optionValue: boolean): void; + + /** + * Gets the rectangle representing the current scroll and zoom state of the chart. + * WindowRect is expressed as a Rectangle with coordinates and sizes between 0 and 1. + * The provided object should have numeric properties called left, top, width and height. + */ + igCategoryChart(optionLiteral: 'option', optionName: "windowRect"): any; + + /** + * Sets the rectangle representing the current scroll and zoom state of the chart. + * WindowRect is expressed as a Rectangle with coordinates and sizes between 0 and 1. + * The provided object should have numeric properties called left, top, width and height. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "windowRect", optionValue: any): void; + + /** + * Gets text to display above the plot area. + */ + igCategoryChart(optionLiteral: 'option', optionName: "title"): string; + + /** + * Sets text to display above the plot area. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "title", optionValue: string): void; + + /** + * Gets text to display below the Title, above the plot area. + */ + igCategoryChart(optionLiteral: 'option', optionName: "subtitle"): string; + + /** + * Sets text to display below the Title, above the plot area. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "subtitle", optionValue: string): void; + + /** + * Gets horizontal alignment which determines the title position, relative to the left and right edges of the control. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "titleAlignment"): string; + + /** + * Sets horizontal alignment which determines the title position, relative to the left and right edges of the control. + * + * @optionValue New value to be set. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "titleAlignment", optionValue: string): void; + + /** + * Gets horizontal alignment which determines the subtitle position, relative to the left and right edges of the control. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "subtitleAlignment"): string; + + /** + * Sets horizontal alignment which determines the subtitle position, relative to the left and right edges of the control. + * + * @optionValue New value to be set. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "subtitleAlignment", optionValue: string): void; + + /** + * Gets the behavior that determines how unknown values will be plotted on the chart.Null and Double.NaN are two examples of unknown values. + * + */ + + igCategoryChart(optionLiteral: 'option', optionName: "unknownValuePlotting"): string; + + /** + * Sets the behavior that determines how unknown values will be plotted on the chart.Null and Double.NaN are two examples of unknown values. + * + * + * @optionValue New value to be set. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "unknownValuePlotting", optionValue: string): void; + + /** + * Gets the rendering resolution for all series in this chart. + * Where n = Resolution, for every n horizontal pixels, combine all items into a single datapoint. When Resolution = 0, all datapoints will be rendered as graphical objects. Charts with a higher resolution will have faster performance. + */ + igCategoryChart(optionLiteral: 'option', optionName: "resolution"): number; + + /** + * Sets the rendering resolution for all series in this chart. + * Where n = Resolution, for every n horizontal pixels, combine all items into a single datapoint. When Resolution = 0, all datapoints will be rendered as graphical objects. Charts with a higher resolution will have faster performance. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "resolution", optionValue: number): void; + + /** + * Gets the thickness for all series in this chart. Depending on the ChartType, this can be the main brush used, or just the outline. + */ + igCategoryChart(optionLiteral: 'option', optionName: "thickness"): number; + + /** + * Sets the thickness for all series in this chart. Depending on the ChartType, this can be the main brush used, or just the outline. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "thickness", optionValue: number): void; + + /** + * Gets the marker shapes used for indicating location of data points in this chart. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + */ + igCategoryChart(optionLiteral: 'option', optionName: "markerTypes"): any; + + /** + * Sets the marker shapes used for indicating location of data points in this chart. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "markerTypes", optionValue: any): void; + + /** + * Gets the palette of brushes used for rendering fill area of data point markers. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igCategoryChart(optionLiteral: 'option', optionName: "markerBrushes"): any; + + /** + * Sets the palette of brushes used for rendering fill area of data point markers. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "markerBrushes", optionValue: any): void; + + /** + * Gets the palette of brushes used for rendering outlines of data point markers. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igCategoryChart(optionLiteral: 'option', optionName: "markerOutlines"): any; + + /** + * Sets the palette of brushes used for rendering outlines of data point markers. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "markerOutlines", optionValue: any): void; + + /** + * Gets the maximum number of markers displyed in the plot area of the chart. + */ + igCategoryChart(optionLiteral: 'option', optionName: "markerMaxCount"): number; + + /** + * Sets the maximum number of markers displyed in the plot area of the chart. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "markerMaxCount", optionValue: number): void; + + /** + * Gets the palette of brushes to used for coloring trend lines in this chart. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igCategoryChart(optionLiteral: 'option', optionName: "trendLineBrushes"): any; + + /** + * Sets the palette of brushes to used for coloring trend lines in this chart. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "trendLineBrushes", optionValue: any): void; + + /** + * Gets the formula used for calculating trend lines in this chart.This property applies only to these chart types: point, line, spline, and bubble + * + */ + + igCategoryChart(optionLiteral: 'option', optionName: "trendLineType"): string; + + /** + * Sets the formula used for calculating trend lines in this chart.This property applies only to these chart types: point, line, spline, and bubble + * + * + * @optionValue New value to be set. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "trendLineType", optionValue: string): void; + + /** + * Gets the thickness of the trend lines in this chart. + * This property applies only to these chart types: point, line, spline, and bubble + */ + igCategoryChart(optionLiteral: 'option', optionName: "trendLineThickness"): number; + + /** + * Sets the thickness of the trend lines in this chart. + * This property applies only to these chart types: point, line, spline, and bubble + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "trendLineThickness", optionValue: number): void; + + /** + * Gets a value indicating whether grid and tick lines are aligned to device pixels. + */ + igCategoryChart(optionLiteral: 'option', optionName: "alignsGridLinesToPixels"): boolean; + + /** + * Sets a value indicating whether grid and tick lines are aligned to device pixels. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "alignsGridLinesToPixels", optionValue: boolean): void; + igCategoryChart(optionLiteral: 'option', optionName: "trendLinePeriod"): number; + igCategoryChart(optionLiteral: 'option', optionName: "trendLinePeriod", optionValue: number): void; + + /** + * Gets function which takes an context object and returns a formatted label for the X-axis. + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisFormatLabel"): any; + + /** + * Sets function which takes an context object and returns a formatted label for the X-axis. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisFormatLabel", optionValue: any): void; + + /** + * Gets function which takes a context object and returns a formatted label for the Y-axis. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisFormatLabel"): any; + + /** + * Sets function which takes a context object and returns a formatted label for the Y-axis. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisFormatLabel", optionValue: any): void; + + /** + * Gets the left margin of labels on the X-axis + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelLeftMargin"): number; + + /** + * Sets the left margin of labels on the X-axis + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelLeftMargin", optionValue: number): void; + + /** + * Gets the top margin of labels on the X-axis + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelTopMargin"): number; + + /** + * Sets the top margin of labels on the X-axis + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelTopMargin", optionValue: number): void; + + /** + * Gets the right margin of labels on the X-axis + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelRightMargin"): number; + + /** + * Sets the right margin of labels on the X-axis + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelRightMargin", optionValue: number): void; + + /** + * Gets the bottom margin of labels on the X-axis + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelBottomMargin"): number; + + /** + * Sets the bottom margin of labels on the X-axis + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelBottomMargin", optionValue: number): void; + + /** + * Gets the left margin of labels on the Y-axis + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelLeftMargin"): number; + + /** + * Sets the left margin of labels on the Y-axis + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelLeftMargin", optionValue: number): void; + + /** + * Gets the top margin of labels on the Y-axis + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelTopMargin"): number; + + /** + * Sets the top margin of labels on the Y-axis + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelTopMargin", optionValue: number): void; + + /** + * Gets the right margin of labels on the Y-axis + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelRightMargin"): number; + + /** + * Sets the right margin of labels on the Y-axis + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelRightMargin", optionValue: number): void; + + /** + * Gets the bottom margin of labels on the Y-axis + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelBottomMargin"): number; + + /** + * Sets the bottom margin of labels on the Y-axis + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelBottomMargin", optionValue: number): void; + + /** + * Gets color of labels on the X-axis + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelTextColor"): string; + + /** + * Sets color of labels on the X-axis + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelTextColor", optionValue: string): void; + + /** + * Gets color of labels on the Y-axis + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelTextColor"): string; + + /** + * Sets color of labels on the Y-axis + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelTextColor", optionValue: string): void; + /** * Gets the margin around a title on the X-axis */ @@ -11796,72 +12893,6 @@ interface JQuery { * @optionValue New value to be set. */ igCategoryChart(optionLiteral: 'option', optionName: "yAxisTitleTextColor", optionValue: string): void; - igCategoryChart(optionLiteral: 'option', optionName: "createWrappedTooltip"): any; - igCategoryChart(optionLiteral: 'option', optionName: "createWrappedTooltip", optionValue: any): void; - - /** - * Gets the id of a template element to use for tooltips, or markup representing the tooltip template. - */ - igCategoryChart(optionLiteral: 'option', optionName: "tooltipTemplate"): string; - - /** - * Sets the id of a template element to use for tooltips, or markup representing the tooltip template. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "tooltipTemplate", optionValue: string): void; - igCategoryChart(optionLiteral: 'option', optionName: "tooltipTemplates"): any; - igCategoryChart(optionLiteral: 'option', optionName: "tooltipTemplates", optionValue: any): void; - - /** - * Gets function which takes an context object and returns a formatted label for the X-axis. - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisFormatLabel"): any; - - /** - * Sets function which takes an context object and returns a formatted label for the X-axis. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisFormatLabel", optionValue: any): void; - - /** - * Gets function which takes a context object and returns a formatted label for the Y-axis. - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisFormatLabel"): any; - - /** - * Sets function which takes a context object and returns a formatted label for the Y-axis. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisFormatLabel", optionValue: any): void; - - /** - * Gets CSS font property for title on X-axis - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisTitleTextStyle"): string; - - /** - * Sets CSS font property for title on X-axis - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisTitleTextStyle", optionValue: string): void; - - /** - * Gets CSS font property for title on Y-axis - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisTitleTextStyle"): string; - - /** - * Sets CSS font property for title on Y-axis - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisTitleTextStyle", optionValue: string): void; - igCategoryChart(optionLiteral: 'option', optionName: "widget"): any; - igCategoryChart(optionLiteral: 'option', optionName: "widget", optionValue: any): void; /** * Gets CSS font property for labels on X-axis @@ -11888,390 +12919,28 @@ interface JQuery { igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelTextStyle", optionValue: string): void; /** - * Gets CSS font property for the chart subtitle + * Gets CSS font property for title on X-axis */ - igCategoryChart(optionLiteral: 'option', optionName: "subtitleTextStyle"): string; + igCategoryChart(optionLiteral: 'option', optionName: "xAxisTitleTextStyle"): string; /** - * Sets CSS font property for the chart subtitle + * Sets CSS font property for title on X-axis * * @optionValue New value to be set. */ - igCategoryChart(optionLiteral: 'option', optionName: "subtitleTextStyle", optionValue: string): void; + igCategoryChart(optionLiteral: 'option', optionName: "xAxisTitleTextStyle", optionValue: string): void; /** - * Gets CSS font property for the chart title + * Gets CSS font property for title on Y-axis */ - igCategoryChart(optionLiteral: 'option', optionName: "titleTextStyle"): string; + igCategoryChart(optionLiteral: 'option', optionName: "yAxisTitleTextStyle"): string; /** - * Sets CSS font property for the chart title + * Sets CSS font property for title on Y-axis * * @optionValue New value to be set. */ - igCategoryChart(optionLiteral: 'option', optionName: "titleTextStyle", optionValue: string): void; - - /** - * Gets a collection of data items used to generate the chart. - * Value of this property can be a list of objects containing one or more numeric properties. Additionally, if the objects in the list implement the IEnumerable interface, the Category Chart will attempt to delve into the sub-collections when reading through the data source. Databinding can be further configured by attributing the data item classes with the DataSeriesMemberIntentAttribute. - */ - igCategoryChart(optionLiteral: 'option', optionName: "itemsSource"): any; - - /** - * Sets a collection of data items used to generate the chart. - * Value of this property can be a list of objects containing one or more numeric properties. Additionally, if the objects in the list implement the IEnumerable interface, the Category Chart will attempt to delve into the sub-collections when reading through the data source. Databinding can be further configured by attributing the data item classes with the DataSeriesMemberIntentAttribute. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "itemsSource", optionValue: any): void; - - /** - * Gets a set of property paths that should be included for consideration by the category chart, leaving the remaineder excluded. If null, all properties will be considered. - */ - igCategoryChart(optionLiteral: 'option', optionName: "includedProperties"): any; - - /** - * Sets a set of property paths that should be included for consideration by the category chart, leaving the remaineder excluded. If null, all properties will be considered. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "includedProperties", optionValue: any): void; - - /** - * Gets a set of property paths that should be excluded from consideration by the category chart. - */ - igCategoryChart(optionLiteral: 'option', optionName: "excludedProperties"): any; - - /** - * Sets a set of property paths that should be excluded from consideration by the category chart. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "excludedProperties", optionValue: any): void; - - /** - * Gets the type of chart series to generate from the data. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "chartType"): string; - - /** - * Sets the type of chart series to generate from the data. - * - * @optionValue New value to be set. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "chartType", optionValue: string): void; - - /** - * Gets the palette of brushes to use for coloring the chart series. The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection - * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. - */ - igCategoryChart(optionLiteral: 'option', optionName: "brushes"): any; - - /** - * Sets the palette of brushes to use for coloring the chart series. The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection - * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "brushes", optionValue: any): void; - - /** - * Gets the palette of brushes to use for outlines on the chart series. The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection - * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. - */ - igCategoryChart(optionLiteral: 'option', optionName: "outlines"): any; - - /** - * Sets the palette of brushes to use for outlines on the chart series. The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection - * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "outlines", optionValue: any): void; - - /** - * Sets the legend to connect this chart to. - * When the legend property is set, the chart will use it to display information about its series. Legends can be shared by multiple chart controls. - */ - igCategoryChart(optionLiteral: 'option', optionName: "legend"): any; - - /** - * Sets the legend to connect this chart to. - * When the legend property is set, the chart will use it to display information about its series. Legends can be shared by multiple chart controls. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "legend", optionValue: any): void; - - /** - * Gets whether the chart can be horizontally zoomed through user interaction. - */ - igCategoryChart(optionLiteral: 'option', optionName: "isHorizontalZoomEnabled"): boolean; - - /** - * Sets whether the chart can be horizontally zoomed through user interaction. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "isHorizontalZoomEnabled", optionValue: boolean): void; - - /** - * Gets whether the chart can be vertically zoomed through user interaction. - */ - igCategoryChart(optionLiteral: 'option', optionName: "isVerticalZoomEnabled"): boolean; - - /** - * Sets whether the chart can be vertically zoomed through user interaction. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "isVerticalZoomEnabled", optionValue: boolean): void; - - /** - * Gets the rectangle representing the current scroll and zoom state of the chart. - * WindowRect is expressed as a Rectangle with coordinates and sizes between 0 and 1. - * The provided object should have numeric properties called left, top, width and height. - */ - igCategoryChart(optionLiteral: 'option', optionName: "windowRect"): any; - - /** - * Sets the rectangle representing the current scroll and zoom state of the chart. - * WindowRect is expressed as a Rectangle with coordinates and sizes between 0 and 1. - * The provided object should have numeric properties called left, top, width and height. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "windowRect", optionValue: any): void; - - /** - * Gets text to display above the plot area. - */ - igCategoryChart(optionLiteral: 'option', optionName: "title"): string; - - /** - * Sets text to display above the plot area. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "title", optionValue: string): void; - - /** - * Gets text to display below the chart Title, above the plot area. - */ - igCategoryChart(optionLiteral: 'option', optionName: "subtitle"): string; - - /** - * Sets text to display below the chart Title, above the plot area. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "subtitle", optionValue: string): void; - - /** - * Gets horizontal alignment which determines the title position, relative to the left and right edges of the chart. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "titleAlignment"): string; - - /** - * Sets horizontal alignment which determines the title position, relative to the left and right edges of the chart. - * - * @optionValue New value to be set. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "titleAlignment", optionValue: string): void; - - /** - * Gets horizontal alignment which determines the subtitle position, relative to the left and right edges of the chart. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "subtitleAlignment"): string; - - /** - * Sets horizontal alignment which determines the subtitle position, relative to the left and right edges of the chart. - * - * @optionValue New value to be set. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "subtitleAlignment", optionValue: string): void; - - /** - * Gets the behavior that determines how unknown values will be plotted on the chart.Null and Double.NaN are two examples of unknown values. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "unknownValuePlotting"): string; - - /** - * Sets the behavior that determines how unknown values will be plotted on the chart.Null and Double.NaN are two examples of unknown values. - * - * @optionValue New value to be set. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "unknownValuePlotting", optionValue: string): void; - - /** - * Gets the behavior for markers in each series which are placed too close together for the current view, resulting in a collision. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "markerCollisionAvoidance"): string; - - /** - * Sets the behavior for markers in each series which are placed too close together for the current view, resulting in a collision. - * - * @optionValue New value to be set. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "markerCollisionAvoidance", optionValue: string): void; - - /** - * Gets whether animation of series plots is enabled when the chart is loading into view - */ - igCategoryChart(optionLiteral: 'option', optionName: "isTransitionInEnabled"): boolean; - - /** - * Sets whether animation of series plots is enabled when the chart is loading into view - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "isTransitionInEnabled", optionValue: boolean): void; - - /** - * Gets the method that determines how to animate series plots when the chart is loading into view - */ - - igCategoryChart(optionLiteral: 'option', optionName: "transitionInMode"): string; - - /** - * Sets the method that determines how to animate series plots when the chart is loading into view - * - * @optionValue New value to be set. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "transitionInMode", optionValue: string): void; - - /** - * Gets the arrival speed used for animating series plots when the chart is loading into view - */ - - igCategoryChart(optionLiteral: 'option', optionName: "transitionInSpeedType"): string; - - /** - * Sets the arrival speed used for animating series plots when the chart is loading into view - * - * @optionValue New value to be set. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "transitionInSpeedType", optionValue: string): void; - - /** - * Gets the frequency of displayed labels along the X-axis. - * Gets the set value is a factor that determines which labels will be hidden. For example, an interval of 2 will display every other label. - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisInterval"): number; - - /** - * Sets the frequency of displayed labels along the X-axis. - * sets the set value is a factor that determines which labels will be hidden. For example, an interval of 2 will display every other label. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisInterval", optionValue: number): void; - - /** - * Gets the frequency of displayed minor lines along the X-axis. - * Gets the set value is a factor that determines how the minor lines will be displayed. - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisMinorInterval"): number; - - /** - * Sets the frequency of displayed minor lines along the X-axis. - * sets the set value is a factor that determines how the minor lines will be displayed. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisMinorInterval", optionValue: number): void; - - /** - * Gets the amount of space between adjacent categories for the X-axis. - * The gap is silently clamped to the range [0, 1] when used. - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisGap"): number; - - /** - * Sets the amount of space between adjacent categories for the X-axis. - * The gap is silently clamped to the range [0, 1] when used. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisGap", optionValue: number): void; - - /** - * Gets the amount of overlap between adjacent categories for the X-axis. - * Gets the overlap is silently clamped to the range [-1, 1] when used. - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisOverlap"): number; - - /** - * Sets the amount of overlap between adjacent categories for the X-axis. - * sets the overlap is silently clamped to the range [-1, 1] when used. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "xAxisOverlap", optionValue: number): void; - - /** - * Gets the distance between each label and grid line along the Y-axis. - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisInterval"): number; - - /** - * Sets the distance between each label and grid line along the Y-axis. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisInterval", optionValue: number): void; - - /** - * Gets whether the Y-axis should use a logarithmic scale instead of a linear one. - * Since log(-1) is imaginary and log(0) is undefined, it is recommended to enable this property only when the Y-axis minimum is greater than zero. - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisIsLogarithmic"): boolean; - - /** - * Sets whether the Y-axis should use a logarithmic scale instead of a linear one. - * Since log(-1) is imaginary and log(0) is undefined, it is recommended to enable this property only when the Y-axis minimum is greater than zero. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisIsLogarithmic", optionValue: boolean): void; - - /** - * Gets the base value to use in the log function when mapping the position of data items along the Y-axis. - * This property is effective only when YAxisIsLogarithmic is true. - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisLogarithmBase"): number; - - /** - * Sets the base value to use in the log function when mapping the position of data items along the Y-axis. - * This property is effective only when YAxisIsLogarithmic is true. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisLogarithmBase", optionValue: number): void; - - /** - * Gets the frequency of displayed minor lines along the Y-axis. - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisMinorInterval"): number; - - /** - * Sets the frequency of displayed minor lines along the Y-axis. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "yAxisMinorInterval", optionValue: number): void; + igCategoryChart(optionLiteral: 'option', optionName: "yAxisTitleTextStyle", optionValue: string): void; /** * Gets the format for labels along the X-axis. @@ -12514,24 +13183,24 @@ interface JQuery { igCategoryChart(optionLiteral: 'option', optionName: "yAxisTickStrokeThickness", optionValue: number): void; /** - * Text to display below the X-axis. + * Gets the Text to display below the X-axis. */ igCategoryChart(optionLiteral: 'option', optionName: "xAxisTitle"): string; /** - * Text to display below the X-axis. + * Sets the Text to display below the X-axis. * * @optionValue New value to be set. */ igCategoryChart(optionLiteral: 'option', optionName: "xAxisTitle", optionValue: string): void; /** - * Text to display to the left of the Y-axis. + * Gets the Text to display to the left of the Y-axis. */ igCategoryChart(optionLiteral: 'option', optionName: "yAxisTitle"): string; /** - * Text to display to the left of the Y-axis. + * Sets the Text to display to the left of the Y-axis. * * @optionValue New value to be set. */ @@ -12585,6 +13254,30 @@ interface JQuery { */ igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelAngle", optionValue: number): void; + /** + * Gets the distance between the X-axis and the bottom of the chart. + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisExtent"): number; + + /** + * Sets the distance between the X-axis and the bottom of the chart. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisExtent", optionValue: number): void; + + /** + * Gets the distance between the Y-axis and the left edge of the chart. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisExtent"): number; + + /** + * Sets the distance between the Y-axis and the left edge of the chart. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisExtent", optionValue: number): void; + /** * Gets the angle of rotation for the X-axis title. */ @@ -12610,137 +13303,381 @@ interface JQuery { igCategoryChart(optionLiteral: 'option', optionName: "yAxisTitleAngle", optionValue: number): void; /** - * Gets the rendering resolution for series in this chart. - * Where n = Resolution, for every n horizontal pixels, combine all items into a single datapoint. When Resolution = 0, all datapoints will be rendered as graphical objects. Charts with a higher resolution will have faster performance. - */ - igCategoryChart(optionLiteral: 'option', optionName: "resolution"): number; - - /** - * Sets the rendering resolution for series in this chart. - * Where n = Resolution, for every n horizontal pixels, combine all items into a single datapoint. When Resolution = 0, all datapoints will be rendered as graphical objects. Charts with a higher resolution will have faster performance. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "resolution", optionValue: number): void; - - /** - * Gets the palette of brushes to used for coloring trend lines in this chart. The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection - * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. - */ - igCategoryChart(optionLiteral: 'option', optionName: "trendLineBrushes"): any; - - /** - * Sets the palette of brushes to used for coloring trend lines in this chart. The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection - * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "trendLineBrushes", optionValue: any): void; - - /** - * Gets the formula used for calculating trend lines in this chart. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "trendLineType"): string; - - /** - * Sets the formula used for calculating trend lines in this chart. - * - * @optionValue New value to be set. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "trendLineType", optionValue: string): void; - - /** - * Gets the thickness of the chart series. Depending on the ChartType, this can be the main brush used, or just the outline. - */ - igCategoryChart(optionLiteral: 'option', optionName: "thickness"): number; - - /** - * Sets the thickness of the chart series. Depending on the ChartType, this can be the main brush used, or just the outline. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "thickness", optionValue: number): void; - - /** - * Gets the collection of marker shapes used for representing data points of series in this chart. - * When MarkerTypes is null or empty, each series' marker type will be set to none or automatic, depending on the series type. - */ - igCategoryChart(optionLiteral: 'option', optionName: "markerTypes"): any; - - /** - * Sets the collection of marker shapes used for representing data points of series in this chart. - * When MarkerTypes is null or empty, each series' marker type will be set to none or automatic, depending on the series type. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "markerTypes", optionValue: any): void; - - /** - * Gets the palette of brushes used as the fill color for data point markers. - * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. - */ - igCategoryChart(optionLiteral: 'option', optionName: "markerBrushes"): any; - - /** - * Sets the palette of brushes used as the fill color for data point markers. - * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "markerBrushes", optionValue: any): void; - - /** - * Gets the palette of brushes used for coloring outline of data point markers. - * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. - */ - igCategoryChart(optionLiteral: 'option', optionName: "markerOutlines"): any; - - /** - * Sets the palette of brushes used for coloring outline of data point markers. - * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "markerOutlines", optionValue: any): void; - - /** - * Gets the thickness of the trend lines in this chart. - */ - igCategoryChart(optionLiteral: 'option', optionName: "trendLineThickness"): number; - - /** - * Sets the thickness of the trend lines in this chart. - * - * @optionValue New value to be set. - */ - igCategoryChart(optionLiteral: 'option', optionName: "trendLineThickness", optionValue: number): void; - - /** - * Gets whether the direction of the X-axis is inverted, placing the first data items on the right side instead of left side + * Gets whether to invert the direction of the X-axis by placing the first data items on the right side of the chart. */ igCategoryChart(optionLiteral: 'option', optionName: "xAxisInverted"): boolean; /** - * Sets whether the direction of the X-axis is inverted, placing the first data items on the right side instead of left side + * Sets whether to invert the direction of the X-axis by placing the first data items on the right side of the chart. * * @optionValue New value to be set. */ igCategoryChart(optionLiteral: 'option', optionName: "xAxisInverted", optionValue: boolean): void; /** - * Gets whether the direction of the Y-axis is inverted, placing minimum numeric value at the top of the axis instead of bottom + * Gets whether to invert the direction of the Y-axis by placing the minimum numeric value at the top of the chart. */ igCategoryChart(optionLiteral: 'option', optionName: "yAxisInverted"): boolean; /** - * Sets whether the direction of the Y-axis is inverted, placing minimum numeric value at the top of the axis instead of bottom + * Sets whether to invert the direction of the Y-axis by placing the minimum numeric value at the top of the chart. * * @optionValue New value to be set. */ igCategoryChart(optionLiteral: 'option', optionName: "yAxisInverted", optionValue: boolean): void; + /** + * Gets Horizontal alignment of the X-axis title. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "xAxisTitleAlignment"): string; + + /** + * Sets Horizontal alignment of the X-axis title. + * + * @optionValue New value to be set. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "xAxisTitleAlignment", optionValue: string): void; + + /** + * Gets Vertical alignment of the Y-axis title. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "yAxisTitleAlignment"): string; + + /** + * Sets Vertical alignment of the Y-axis title. + * + * @optionValue New value to be set. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "yAxisTitleAlignment", optionValue: string): void; + + /** + * Gets Horizontal alignment of X-axis labels. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelHorizontalAlignment"): string; + + /** + * Sets Horizontal alignment of X-axis labels. + * + * @optionValue New value to be set. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelHorizontalAlignment", optionValue: string): void; + + /** + * Gets Horizontal alignment of Y-axis labels. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelHorizontalAlignment"): string; + + /** + * Sets Horizontal alignment of Y-axis labels. + * + * @optionValue New value to be set. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelHorizontalAlignment", optionValue: string): void; + + /** + * Gets Vertical alignment of X-axis labels. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelVerticalAlignment"): string; + + /** + * Sets Vertical alignment of X-axis labels. + * + * @optionValue New value to be set. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelVerticalAlignment", optionValue: string): void; + + /** + * Gets Vertical alignment of Y-axis labels. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelVerticalAlignment"): string; + + /** + * Sets Vertical alignment of Y-axis labels. + * + * @optionValue New value to be set. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelVerticalAlignment", optionValue: string): void; + + /** + * Gets Visibility of X-axis labels. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelVisibility"): string; + + /** + * Sets Visibility of X-axis labels. + * + * @optionValue New value to be set. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelVisibility", optionValue: string): void; + + /** + * Gets Visibility of Y-axis labels. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelVisibility"): string; + + /** + * Sets Visibility of Y-axis labels. + * + * @optionValue New value to be set. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelVisibility", optionValue: string): void; + + /** + * The location of Y-axis labels, relative to the plot area. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelLocation"): string; + + /** + * The location of Y-axis labels, relative to the plot area. + * + * @optionValue New value to be set. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelLocation", optionValue: string): void; + + /** + * Gets the duration used for animating series plots when the chart is loading into view + */ + igCategoryChart(optionLiteral: 'option', optionName: "transitionInDuration"): number; + + /** + * Sets the duration used for animating series plots when the chart is loading into view + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "transitionInDuration", optionValue: number): void; + + /** + * Gets the easing function used for animating series plots when the chart is loading into view + * This can be set to one of the known values "linear" or "cubic," or it can be set to an easing function which takes a single numeric parameter and returns a number. + */ + igCategoryChart(optionLiteral: 'option', optionName: "transitionInEasingFunction"): any; + + /** + * Sets the easing function used for animating series plots when the chart is loading into view + * This can be set to one of the known values "linear" or "cubic," or it can be set to an easing function which takes a single numeric parameter and returns a number. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "transitionInEasingFunction", optionValue: any): void; + + /** + * Gets the type of chart series to generate from the data. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "chartType"): string; + + /** + * Sets the type of chart series to generate from the data. + * + * @optionValue New value to be set. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "chartType", optionValue: string): void; + + /** + * Gets the behavior for markers in each series which are placed too close together for the current view, resulting in a collision. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "markerCollisionAvoidance"): string; + + /** + * Sets the behavior for markers in each series which are placed too close together for the current view, resulting in a collision. + * + * @optionValue New value to be set. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "markerCollisionAvoidance", optionValue: string): void; + + /** + * Gets whether animation of series plots is enabled when the chart is loading into view + */ + igCategoryChart(optionLiteral: 'option', optionName: "isTransitionInEnabled"): boolean; + + /** + * Sets whether animation of series plots is enabled when the chart is loading into view + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "isTransitionInEnabled", optionValue: boolean): void; + + /** + * Gets the method that determines how to animate series plots when the chart is loading into view + */ + + igCategoryChart(optionLiteral: 'option', optionName: "transitionInMode"): string; + + /** + * Sets the method that determines how to animate series plots when the chart is loading into view + * + * @optionValue New value to be set. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "transitionInMode", optionValue: string): void; + + /** + * Gets the arrival speed used for animating series plots when the chart is loading into view + */ + + igCategoryChart(optionLiteral: 'option', optionName: "transitionInSpeedType"): string; + + /** + * Sets the arrival speed used for animating series plots when the chart is loading into view + * + * @optionValue New value to be set. + */ + + igCategoryChart(optionLiteral: 'option', optionName: "transitionInSpeedType", optionValue: string): void; + + /** + * Gets the frequency of displayed labels along the X-axis. + * Gets the set value is a factor that determines which labels will be hidden. For example, an interval of 2 will display every other label. + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisInterval"): number; + + /** + * Sets the frequency of displayed labels along the X-axis. + * sets the set value is a factor that determines which labels will be hidden. For example, an interval of 2 will display every other label. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisInterval", optionValue: number): void; + + /** + * Gets the frequency of displayed minor lines along the X-axis. + * Gets the set value is a factor that determines how the minor lines will be displayed. + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisMinorInterval"): number; + + /** + * Sets the frequency of displayed minor lines along the X-axis. + * sets the set value is a factor that determines how the minor lines will be displayed. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisMinorInterval", optionValue: number): void; + + /** + * Gets the amount of space between adjacent categories for the X-axis. + * The gap is silently clamped to the range [0, 1] when used. + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisGap"): number; + + /** + * Sets the amount of space between adjacent categories for the X-axis. + * The gap is silently clamped to the range [0, 1] when used. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisGap", optionValue: number): void; + + /** + * Gets the amount of overlap between adjacent categories for the X-axis. + * Gets the overlap is silently clamped to the range [-1, 1] when used. + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisOverlap"): number; + + /** + * Sets the amount of overlap between adjacent categories for the X-axis. + * sets the overlap is silently clamped to the range [-1, 1] when used. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "xAxisOverlap", optionValue: number): void; + + /** + * Gets the distance between each label and grid line along the Y-axis. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisInterval"): number; + + /** + * Sets the distance between each label and grid line along the Y-axis. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisInterval", optionValue: number): void; + + /** + * Gets whether the Y-axis should use a logarithmic scale instead of a linear one. + * Since log(-1) is imaginary and log(0) is undefined, it is recommended to enable this property only when the Y-axis minimum is greater than zero. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisIsLogarithmic"): boolean; + + /** + * Sets whether the Y-axis should use a logarithmic scale instead of a linear one. + * Since log(-1) is imaginary and log(0) is undefined, it is recommended to enable this property only when the Y-axis minimum is greater than zero. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisIsLogarithmic", optionValue: boolean): void; + + /** + * Gets the base value to use in the log function when mapping the position of data items along the Y-axis. + * This property is effective only when YAxisIsLogarithmic is true. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisLogarithmBase"): number; + + /** + * Sets the base value to use in the log function when mapping the position of data items along the Y-axis. + * This property is effective only when YAxisIsLogarithmic is true. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisLogarithmBase", optionValue: number): void; + + /** + * Gets the data value corresponding to the minimum value of the Y-axis. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisMinimumValue"): number; + + /** + * Sets the data value corresponding to the minimum value of the Y-axis. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisMinimumValue", optionValue: number): void; + + /** + * Gets the data value corresponding to the maximum value of the Y-axis. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisMaximumValue"): number; + + /** + * Sets the data value corresponding to the maximum value of the Y-axis. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisMaximumValue", optionValue: number): void; + + /** + * Gets the frequency of displayed minor lines along the Y-axis. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisMinorInterval"): number; + + /** + * Sets the frequency of displayed minor lines along the Y-axis. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisMinorInterval", optionValue: number): void; + /** * Gets the palette used for coloring negative items of Waterfall chart type. * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. @@ -12755,118 +13692,6 @@ interface JQuery { */ igCategoryChart(optionLiteral: 'option', optionName: "negativeBrushes", optionValue: any): void; - /** - * Gets the horizontal alignment of the X-axis title. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "xAxisTitleAlignment"): string; - - /** - * Sets the horizontal alignment of the X-axis title. - * - * @optionValue New value to be set. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "xAxisTitleAlignment", optionValue: string): void; - - /** - * Gets the vertical alignment of the Y-axis title. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "yAxisTitleAlignment"): string; - - /** - * Sets the vertical alignment of the Y-axis title. - * - * @optionValue New value to be set. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "yAxisTitleAlignment", optionValue: string): void; - - /** - * Gets the horizontal alignment of X-axis labels. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelHorizontalAlignment"): string; - - /** - * Sets the horizontal alignment of X-axis labels. - * - * @optionValue New value to be set. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelHorizontalAlignment", optionValue: string): void; - - /** - * Gets the horizontal alignment of Y-axis labels. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelHorizontalAlignment"): string; - - /** - * Sets the horizontal alignment of Y-axis labels. - * - * @optionValue New value to be set. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelHorizontalAlignment", optionValue: string): void; - - /** - * Gets the vertical alignment of X-axis labels. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelVerticalAlignment"): string; - - /** - * Sets the vertical alignment of X-axis labels. - * - * @optionValue New value to be set. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelVerticalAlignment", optionValue: string): void; - - /** - * Gets the vertical alignment of Y-axis labels. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelVerticalAlignment"): string; - - /** - * Sets the vertical alignment of Y-axis labels. - * - * @optionValue New value to be set. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelVerticalAlignment", optionValue: string): void; - - /** - * Gets the visibility of X-axis labels. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelVisibility"): string; - - /** - * Sets the visibility of X-axis labels. - * - * @optionValue New value to be set. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "xAxisLabelVisibility", optionValue: string): void; - - /** - * Gets the visibility of Y-axis labels. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelVisibility"): string; - - /** - * Sets the visibility of Y-axis labels. - * - * @optionValue New value to be set. - */ - - igCategoryChart(optionLiteral: 'option', optionName: "yAxisLabelVisibility", optionValue: string): void; - /** * Brushes to use for drawing negative elements, when using a chart type with contextual coloring, such as Waterfall. * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. @@ -12882,16 +13707,28 @@ interface JQuery { igCategoryChart(optionLiteral: 'option', optionName: "negativeOutlines", optionValue: any): void; /** - * Gets a value indicating whether grid and tick lines are aligned to device pixels. + * Gets whether the series animations should be allowed when a range change has been detected on an axis. */ - igCategoryChart(optionLiteral: 'option', optionName: "alignsGridLinesToPixels"): boolean; + igCategoryChart(optionLiteral: 'option', optionName: "animateSeriesWhenAxisRangeChanges"): boolean; /** - * Sets a value indicating whether grid and tick lines are aligned to device pixels. + * Sets whether the series animations should be allowed when a range change has been detected on an axis. * * @optionValue New value to be set. */ - igCategoryChart(optionLiteral: 'option', optionName: "alignsGridLinesToPixels", optionValue: boolean): void; + igCategoryChart(optionLiteral: 'option', optionName: "animateSeriesWhenAxisRangeChanges", optionValue: boolean): void; + + /** + * Gets whether the large numbers on the Y-axis labels are abbreviated. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisAbbreviateLargeNumbers"): boolean; + + /** + * Sets whether the large numbers on the Y-axis labels are abbreviated. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "yAxisAbbreviateLargeNumbers", optionValue: boolean): void; /** * The width of the chart. @@ -12994,41 +13831,101 @@ interface JQuery { igCategoryChart(optionLiteral: 'option', optionName: "responseDataKey", optionValue: string): void; /** - * Event raised when a property value is changed. + * Event raised when a property value is changed on this chart */ igCategoryChart(optionLiteral: 'option', optionName: "propertyChanged"): PropertyChangedEvent; /** - * Event raised when a property value is changed. + * Event raised when a property value is changed on this chart * * @optionValue Define event handler function. */ igCategoryChart(optionLiteral: 'option', optionName: "propertyChanged", optionValue: PropertyChangedEvent): void; /** - * Event raised when a series is initialized + * Event raised when a series is initialized and added to this chart. */ igCategoryChart(optionLiteral: 'option', optionName: "seriesAdded"): SeriesAddedEvent; /** - * Event raised when a series is initialized + * Event raised when a series is initialized and added to this chart. * * @optionValue Define event handler function. */ igCategoryChart(optionLiteral: 'option', optionName: "seriesAdded", optionValue: SeriesAddedEvent): void; /** - * Event raised when a series is removed from the CategoryChart + * Event raised when a series is removed from this chart. */ igCategoryChart(optionLiteral: 'option', optionName: "seriesRemoved"): SeriesRemovedEvent; /** - * Event raised when a series is removed from the CategoryChart + * Event raised when a series is removed from this chart. * * @optionValue Define event handler function. */ igCategoryChart(optionLiteral: 'option', optionName: "seriesRemoved", optionValue: SeriesRemovedEvent): void; + /** + * Occurs when the pointer enters a Series. + */ + igCategoryChart(optionLiteral: 'option', optionName: "seriesPointerEnter"): SeriesPointerEnterEvent; + + /** + * Occurs when the pointer enters a Series. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "seriesPointerEnter", optionValue: SeriesPointerEnterEvent): void; + + /** + * Occurs when the pointer leaves a Series. + */ + igCategoryChart(optionLiteral: 'option', optionName: "seriesPointerLeave"): SeriesPointerLeaveEvent; + + /** + * Occurs when the pointer leaves a Series. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "seriesPointerLeave", optionValue: SeriesPointerLeaveEvent): void; + + /** + * Occurs when the pointer moves over a Series. + */ + igCategoryChart(optionLiteral: 'option', optionName: "seriesPointerMove"): SeriesPointerMoveEvent; + + /** + * Occurs when the pointer moves over a Series. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "seriesPointerMove", optionValue: SeriesPointerMoveEvent): void; + + /** + * Occurs when the pointer is pressed down over a Series. + */ + igCategoryChart(optionLiteral: 'option', optionName: "seriesPointerDown"): SeriesPointerDownEvent; + + /** + * Occurs when the pointer is pressed down over a Series. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "seriesPointerDown", optionValue: SeriesPointerDownEvent): void; + + /** + * Occurs when the pointer is released over a Series. + */ + igCategoryChart(optionLiteral: 'option', optionName: "seriesPointerUp"): SeriesPointerUpEvent; + + /** + * Occurs when the pointer is released over a Series. + * + * @optionValue New value to be set. + */ + igCategoryChart(optionLiteral: 'option', optionName: "seriesPointerUp", optionValue: SeriesPointerUpEvent): void; + /** * Event which is raised before data binding. * Return false in order to cancel data binding. @@ -13167,6 +14064,7 @@ interface IgDataChartLegend { /** * The height of the legend.null will stretch vertically to fit data, no other height are defined. * + * * Valid values: * "null" */ @@ -13191,6 +14089,7 @@ interface IgDataChartAxes { * "categoryAngle" Specify the axis as category angle axis. Useful for displaying polar and radial categories. * "numericAngle" Specify the axis as numeric angle axis. Useful for displaying polar and radial series. * "numericRadius" Specify the axis as numeric radius axis. Useful for displaying polar and radial series. + * "time" Specify the axis as time X axis. Useful for displaying date based data with time breaks. */ type?: string; @@ -13375,6 +14274,7 @@ interface IgDataChartAxes { /** * Gets or sets the axis MinimumValue. * + * * Valid values: * "number" The minimum value can be set to be a number when the axis is of numeric type * "date" The minimum value can be set to be a date object when [type](ui.igDataChart#options:axes.type) option is set to "categoryDateTimeX" @@ -13384,6 +14284,7 @@ interface IgDataChartAxes { /** * Gets or sets the axis MaximumValue. * + * * Valid values: * "number" The maximum value can be set to be a number when the axis is of numeric type * "date" The maximum value can be set to be a date object when [type](ui.igDataChart#options:axes.type) option is set to "categoryDateTimeX" @@ -13604,6 +14505,7 @@ interface IgDataChartSeriesLegend { /** * The height of the legend.null will stretch vertically to fit data, no other height are defined * + * * Valid values: * "null" */ @@ -13633,19 +14535,77 @@ interface IgDataChartSeries { * "waterfall" Specify the series as Waterfall series. * "financial" Specify the series as Financial series. * "typicalPriceIndicator" Specify the series as Typical Price Indicator series. + * "point" Specify the series as Point series. + * "polarSplineArea" Specify the series as Polar Spline Area series. + * "polarSpline" Specify the series as Polar Spline series. * "polarArea" Specify the series as Polar Area series. * "polarLine" Specify the series as Polar Line series. * "polarScatter" Specify the series as Polar Scatter series. * "radialColumn" Specify the series as Radial Column series. * "radialLine" Specify the series as Radial Line series. * "radialPie" Specify the series as Radial Pie series. + * "radialArea" Specify the series as Radial Area series. * "scatter" Specify the series as Scatter series. * "scatterLine" Specify the series as Scatter Line series. + * "scatterSpline" Specify the series as Scatter Spline series. + * "scatterArea" Specify the series as Scatter Area series. + * "scatterContour" Specify the series as Scatter Contour series. + * "scatterPolygon" Specify the series as Scatter Polygon series. + * "scatterPolyline" Specify the series as Scatter Polyline series. * "bubble" Specify the series as Bubble series. * "absoluteVolumeOscillatorIndicator" Specify the series as Absolute Volume Oscillator Indicator series. * "averageTrueRangeIndicator" Specify the series as Average True Range Indicator series. * "accumulationDistributionIndicator" Specify the series as Accumulation Distribution Indicator series * "averageDirectionalIndexIndicator" Specify the series as Average Directional Index Indicator series. + * "bollingerBandWidthIndicator" Specify the series as Bollinger Band Width Indicator series. + * "chaikinOscillatorIndicator" Specify the series as Chaikin Oscillator Indicator series. + * "chaikinVolatilityIndicator" Specify the series as Chaikin Volitility Indicator series. + * "commodityChannelIndexIndicator" Specify the series as Commodity Channel Index Indicator series. + * "detrendedPriceOscillatorIndicator" Specify the series as Detrended Price Oscillator Indicator series. + * "easeOfMovementIndicator" Specify the series as Ease Of Movement Indicator series. + * "fastStochasticOscillatorIndicator" Specify the series as Fast Stochastic Oscillator Indicator series. + * "forceIndexIndicator" Specify the series as Force Index Indicator series. + * "fullStochasticOscillatorIndicator" Specify the series as Full Stochastic Oscillator Indicator series. + * "marketFacilitationIndexIndicator" Specify the series as Market Facilitation Index Indicator series. + * "massIndexIndicator" Specify the series as Mass Index Indicator series. + * "medianPriceIndicator" Specify the series as Median Price Indicator series. + * "moneyFlowIndexIndicator" Specify the series as Money Flow Index Indicator series. + * "movingAverageConvergenceDivergenceIndicator" Specify the series as Moving Average Convergence Divergence Indicator series. + * "negativeVolumeIndexIndicator" Specify the series as Negative Volume Index Indicator series. + * "onBalanceVolumeIndicator" Specify the series as On Balance Volume Indicator series. + * "percentagePriceOscillatorIndicator" Specify the series as Percentage Price Oscillator Indicator series. + * "percentageVolumeOscillatorIndicator" Specify the series as Percentage Volume Oscillator Indicator series. + * "positiveVolumeIndexIndicator" Specify the series as Positive Volume Index Indicator series. + * "priceVolumeTrendIndictor" Specify the series as Price Volume Trend Indictor series. + * "rateOfChangeAndMomentumIndicator" Specify the series as Rate Of Change And Momentum Indicator series. + * "relativeStrengthIndexIndicator" Specify the series as Relative Strength Index Indicator series. + * "slowStochasticOscillatorIndicator" Specify the series as Slow Stochastic Oscillator Indicator series. + * "standardDeviationIndicator" Specify the series as Standard Deviation Indicator series. + * "stochRSIIndicator" Specify the series as Stoch RSI Indicator series. + * "trixIndicator" Specify the series as Trix Indicator series. + * "ultimateOscillatorIndicator" Specify the series as Ultimate Oscillator Indicator series. + * "weightedCloseIndicator" Specify the series as Weighted Close Indicator series. + * "williamsPercentRIndicator" Specify the series as Williams Percent R Indicator series. + * "bollingerBandsOverlay" Specify the series as Bollinger Bands Overlay series. + * "priceChannelOverlay" Specify the series as Price Channel Overlay series. + * "customIndicator" Specify the series as Custom Indicator series. + * "stackedBar" Specify the series as Stacked Bar series. + * "stacked100Bar" Specify the series as Stacked 100 Bar series. + * "stackedArea" Specify the series as Stacked Area series. + * "stacked100Area" Specify the series as Stacked 100 Area series. + * "stackedColumn" Specify the series as Stacked Column series. + * "stacked100Column" Specify the series as Stacked 100 Column series. + * "stackedLine" Specify the series as Stacked Line series. + * "stacked100Line" Specify the series as Stacked 100 Line series. + * "stackedSpline" Specify the series as Stacked Spline series. + * "stacked100Spline" Specify the series as Stacked 100 Spline series. + * "stackedSplineArea" Specify the series as Stacked Spline Area series. + * "stacked100SplineArea" Specify the series as Stacked 100 Spline Area series. + * "crosshairLayer" Specify the series as a crosshair layer. + * "categoryHighlightLayer" Specify the series as a category highlight layer. + * "categoryItemHighlightLayer" Specify the series as a category item highlight layer. + * "itemToolTipLayer" Specify the series as an item tooltip layer. + * "categoryToolTipLayer" Specify the series as a category tooltip layer. */ type?: string; @@ -15138,6 +16098,7 @@ interface IgDataChart { /** * The response to user panning and zooming: whether to update the view immediately while the user action is happening, or to defer the update to after the user action is complete. The user action will be an action such as a mouse drag which causes panning and/or zooming to occur. * + * * Valid values: * "deferred" Defer the view update until after the user action is complete. * "immediate" Update the view immediately while the user action is happening. @@ -15583,6 +16544,24 @@ interface IgDataChart { */ theme?: string; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event fired when the mouse has hovered on a series and the tooltip is about to show * Function takes arguments evt and ui. @@ -16270,6 +17249,24 @@ interface IgDataChartMethods { * Clears the tile zoom tile cache so that new tiles will be generated. Only applies if the viewer is using a tile based zoom. */ clearTileZoomCache(): void; + + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ + changeLocale($container: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igDataChart"): IgDataChartMethods; @@ -16471,6 +17468,7 @@ interface IgPieChart { /** * Gets or sets the position of chart labels. * + * * Valid values: * "none" No labels will be displayed. * "center" Labels will be displayed in the center. @@ -16495,6 +17493,7 @@ interface IgPieChart { /** * Gets or sets the type of selection the pie chart allows. * + * * Valid values: * "single" A single slice is allowed to be selected. * "multiple" Multiple slices are allowed to be selected. @@ -16517,6 +17516,7 @@ interface IgPieChart { /** * Gets or sets whether the leader lines are visible. * + * * Valid values: * "visible" * "collapsed" @@ -16526,6 +17526,7 @@ interface IgPieChart { /** * Gets or sets what type of leader lines will be used for the outside end labels. * + * * Valid values: * "straight" * "arc" @@ -16634,6 +17635,7 @@ interface IgPieChart { /** * Gets or sets the rotational direction of the chart. * + * * Valid values: * "counterclockwise" * "clockwise" @@ -16685,6 +17687,24 @@ interface IgPieChart { */ theme?: string; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event fired when the mouse has hovered on an element long enough to display a tooltip * Function takes arguments evt and ui. @@ -16859,6 +17879,24 @@ interface IgPieChartMethods { * Forces any pending deferred work to render on the chart before continuing */ flush(): void; + + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ + changeLocale($container: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igPieChart"): IgPieChartMethods; @@ -16921,6 +17959,9 @@ interface JQuery { igDataChart(methodName: "startTiledZoomingIfNecessary"): void; igDataChart(methodName: "endTiledZoomingIfRunning"): void; igDataChart(methodName: "clearTileZoomCache"): void; + igDataChart(methodName: "changeLocale", $container: Object): void; + igDataChart(methodName: "changeGlobalLanguage"): void; + igDataChart(methodName: "changeGlobalRegional"): void; /** * Gets whether the series viewer can allow the page to pan if a control pan is not possible in the requested direction. @@ -17052,6 +18093,7 @@ interface JQuery { /** * The response to user panning and zooming: whether to update the view immediately while the user action is happening, or to defer the update to after the user action is complete. The user action will be an action such as a mouse drag which causes panning and/or zooming to occur. + * */ igDataChart(optionLiteral: 'option', optionName: "windowResponse"): string; @@ -17059,6 +18101,7 @@ interface JQuery { /** * The response to user panning and zooming: whether to update the view immediately while the user action is happening, or to defer the update to after the user action is complete. The user action will be an action such as a mouse drag which causes panning and/or zooming to occur. * + * * @optionValue New value to be set. */ @@ -18008,6 +19051,50 @@ interface JQuery { */ igDataChart(optionLiteral: 'option', optionName: "theme", optionValue: string): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igDataChart(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igDataChart(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igDataChart(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igDataChart(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igDataChart(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igDataChart(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event fired when the mouse has hovered on a series and the tooltip is about to show * Function takes arguments evt and ui. @@ -18561,6 +19648,9 @@ interface JQuery { igPieChart(methodName: "exportVisualData"): void; igPieChart(methodName: "getData"): Object; igPieChart(methodName: "flush"): void; + igPieChart(methodName: "changeLocale", $container: Object): void; + igPieChart(methodName: "changeGlobalLanguage"): void; + igPieChart(methodName: "changeGlobalRegional"): void; /** * The width of the chart. It can be set as a number in pixels, string (px) or percentage (%). @@ -18700,6 +19790,7 @@ interface JQuery { /** * Gets the position of chart labels. + * */ igPieChart(optionLiteral: 'option', optionName: "labelsPosition"): string; @@ -18707,6 +19798,7 @@ interface JQuery { /** * Sets the position of chart labels. * + * * @optionValue New value to be set. */ @@ -18742,6 +19834,7 @@ interface JQuery { /** * Gets the type of selection the pie chart allows. + * */ igPieChart(optionLiteral: 'option', optionName: "selectionMode"): string; @@ -18749,6 +19842,7 @@ interface JQuery { /** * Sets the type of selection the pie chart allows. * + * * @optionValue New value to be set. */ @@ -18784,6 +19878,7 @@ interface JQuery { /** * Gets whether the leader lines are visible. + * */ igPieChart(optionLiteral: 'option', optionName: "leaderLineVisibility"): string; @@ -18791,6 +19886,7 @@ interface JQuery { /** * Sets whether the leader lines are visible. * + * * @optionValue New value to be set. */ @@ -18798,6 +19894,7 @@ interface JQuery { /** * Gets what type of leader lines will be used for the outside end labels. + * */ igPieChart(optionLiteral: 'option', optionName: "leaderLineType"): string; @@ -18805,6 +19902,7 @@ interface JQuery { /** * Sets what type of leader lines will be used for the outside end labels. * + * * @optionValue New value to be set. */ @@ -19036,6 +20134,7 @@ interface JQuery { /** * Gets the rotational direction of the chart. + * */ igPieChart(optionLiteral: 'option', optionName: "sweepDirection"): string; @@ -19043,6 +20142,7 @@ interface JQuery { /** * Sets the rotational direction of the chart. * + * * @optionValue New value to be set. */ @@ -19152,6 +20252,50 @@ interface JQuery { */ igPieChart(optionLiteral: 'option', optionName: "theme", optionValue: string): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igPieChart(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igPieChart(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igPieChart(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igPieChart(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igPieChart(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igPieChart(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event fired when the mouse has hovered on an element long enough to display a tooltip * Function takes arguments evt and ui. @@ -19537,6 +20681,24 @@ interface IgChartLegend { */ theme?: string; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Occurs when the left mouse button is pressed while the mouse pointer is over an element of this legend. * Function takes arguments evt and ui. @@ -19607,6 +20769,24 @@ interface IgChartLegendMethods { * Returns the ID of the DOM element holding the legend. */ id(): string; + + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ + changeLocale($container: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igChartLegend"): IgChartLegendMethods; @@ -19617,6 +20797,9 @@ interface JQuery { igChartLegend(methodName: "destroy"): void; igChartLegend(methodName: "widget"): void; igChartLegend(methodName: "id"): string; + igChartLegend(methodName: "changeLocale", $container: Object): void; + igChartLegend(methodName: "changeGlobalLanguage"): void; + igChartLegend(methodName: "changeGlobalRegional"): void; /** * Type of the legend. @@ -19672,6 +20855,50 @@ interface JQuery { */ igChartLegend(optionLiteral: 'option', optionName: "theme", optionValue: string): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igChartLegend(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igChartLegend(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igChartLegend(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igChartLegend(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igChartLegend(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igChartLegend(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Occurs when the left mouse button is pressed while the mouse pointer is over an element of this legend. * Function takes arguments evt and ui. @@ -19796,12 +21023,14 @@ interface IgColorPicker { /** * Gets/Sets the default colors. Default colors are the ones displayed in the upper table of the color picker. * The array should contain arrays that contain the color values for every next row. + * */ colors?: string; /** * Gets/Sets the standard colors. Standard colors are the ones displayed in the color picker bottom, * visually separated from the default colors. The array should contain the color values. + * */ standardColors?: any[]; @@ -19869,6 +21098,7 @@ interface JQuery { /** * Gets/Sets the default colors. Default colors are the ones displayed in the upper table of the color picker. * The array should contain arrays that contain the color values for every next row. + * */ igColorPicker(optionLiteral: 'option', optionName: "colors"): string; @@ -19876,6 +21106,7 @@ interface JQuery { * /Sets the default colors. Default colors are the ones displayed in the upper table of the color picker. * The array should contain arrays that contain the color values for every next row. * + * * @optionValue New value to be set. */ igColorPicker(optionLiteral: 'option', optionName: "colors", optionValue: string): void; @@ -19883,6 +21114,7 @@ interface JQuery { /** * Gets/Sets the standard colors. Standard colors are the ones displayed in the color picker bottom, * visually separated from the default colors. The array should contain the color values. + * */ igColorPicker(optionLiteral: 'option', optionName: "standardColors"): any[]; @@ -19890,6 +21122,7 @@ interface JQuery { * /Sets the standard colors. Standard colors are the ones displayed in the color picker bottom, * visually separated from the default colors. The array should contain the color values. * + * * @optionValue New value to be set. */ igColorPicker(optionLiteral: 'option', optionName: "standardColors", optionValue: any[]): void; @@ -19975,26 +21208,31 @@ interface CollapsingEventUIParam { interface IgColorPickerSplitButton { /** * Button items. + * */ items?: any[]; /** * Gets/sets the button default color value. + * */ defaultColor?: string; /** * If this option is set to true, the igColorPickerSplitButton will be rendered with an icon. + * */ hasDefaultIcon?: boolean; /** * Default button item name. + * */ defaultItemName?: string; /** * Specifies whether the default button will be switched when another button is selected. + * */ swapDefaultEnabled?: boolean; @@ -20053,11 +21291,15 @@ interface IgColorPickerSplitButtonMethods { /** * Collapse the widget. + * + * @param e */ collapse(e: Object): Object; /** * Expands the widget. + * + * @param e */ expand(e: Object): Object; @@ -20096,60 +21338,70 @@ interface JQuery { /** * Button items. + * */ igColorPickerSplitButton(optionLiteral: 'option', optionName: "items"): any[]; /** * Button items. * + * * @optionValue New value to be set. */ igColorPickerSplitButton(optionLiteral: 'option', optionName: "items", optionValue: any[]): void; /** * Gets/ the button default color value. + * */ igColorPickerSplitButton(optionLiteral: 'option', optionName: "defaultColor"): string; /** * /sets the button default color value. * + * * @optionValue New value to be set. */ igColorPickerSplitButton(optionLiteral: 'option', optionName: "defaultColor", optionValue: string): void; /** * If this option is set to true, the igColorPickerSplitButton will be rendered with an icon. + * */ igColorPickerSplitButton(optionLiteral: 'option', optionName: "hasDefaultIcon"): boolean; /** * If this option is set to true, the igColorPickerSplitButton will be rendered with an icon. * + * * @optionValue New value to be set. */ igColorPickerSplitButton(optionLiteral: 'option', optionName: "hasDefaultIcon", optionValue: boolean): void; /** * Default button item name. + * */ igColorPickerSplitButton(optionLiteral: 'option', optionName: "defaultItemName"): string; /** * Default button item name. * + * * @optionValue New value to be set. */ igColorPickerSplitButton(optionLiteral: 'option', optionName: "defaultItemName", optionValue: string): void; /** * Gets whether the default button will be switched when another button is selected. + * */ igColorPickerSplitButton(optionLiteral: 'option', optionName: "swapDefaultEnabled"): boolean; /** * Sets whether the default button will be switched when another button is selected. * + * * @optionValue New value to be set. */ igColorPickerSplitButton(optionLiteral: 'option', optionName: "swapDefaultEnabled", optionValue: boolean): void; @@ -20252,21 +21504,25 @@ interface JQuery { interface IgComboLocale { /** * Gets/Sets text of list item for condition when [filteringType](ui.igcombo#options:filteringType) option is enabled and no match was found. + * */ noMatchFoundText?: any; /** * Gets/Sets title for html element which represent the drop-down button. + * */ dropDownButtonTitle?: any; /** * Gets/Sets title for html element which represent the clear button. + * */ clearButtonTitle?: any; /** * Gets/Sets value that is displayed when input field is empty. + * */ placeHolder?: any; @@ -20279,11 +21535,13 @@ interface IgComboLocale { interface IgComboLoadOnDemandSettings { /** * Gets/Sets option to enable load on demand. + * */ enabled?: boolean; /** * Gets/Sets number of records loaded on each request. + * */ pageSize?: number; @@ -20296,21 +21554,25 @@ interface IgComboLoadOnDemandSettings { interface IgComboMultiSelection { /** * Set enabled to true to turn multi selection on. Set to true by default when target element for the combo is a select with the multiple attribute set. + * */ enabled?: boolean; /** * Set addWithKeyModifier to true to disable the additive selection, then additive selection can be done by ctrl + mouse click / enter. + * */ addWithKeyModifier?: boolean; /** * Set showCheckboxes to true to render check boxes in front of each drop down item. + * */ showCheckboxes?: boolean; /** * Use itemSeparator to set what string to be rendered between items in field. + * */ itemSeparator?: string; @@ -20323,12 +21585,14 @@ interface IgComboMultiSelection { interface IgComboGrouping { /** * Gets/Sets name of column by which the records will be grouped. Setting this option enables the grouping. + * */ key?: string; /** * Specifies the sort order - ascending or descending. * + * * Valid values: * "asc" * "desc" @@ -20344,11 +21608,13 @@ interface IgComboGrouping { interface IgComboInitialSelectedItem { /** * Optional="true" Index of item in the list. The index should be greater than -1 and less than the count of the [items](ui.igcombo#methods:items) in the list (rows in dataSource). + * */ index?: number; /** * Optional="true" Value matching the [valueKey](ui.igcombo#options:valueKey) property of the item. + * */ value?: any; @@ -20547,17 +21813,20 @@ interface SelectionChangedEventUIParam { interface IgCombo { /** * Gets/Sets the width of combo. The numeric and string values (valid html units for size) are supported. It includes %, px, em and other units. + * */ width?: string|number; /** * Gets/Sets height of combo. The numeric and string values (valid html units for size) are supported. It includes %, px, em and other units. + * */ height?: string|number; /** * Gets/Sets the width of drop-down list in pixels. * + * * Valid values: * "string" The default drop-down list width can be set in pixels (px). * "number" The default drop-down list width can be set as a number. @@ -20567,33 +21836,39 @@ interface IgCombo { /** * Gets/Sets a valid data source accepted by [$.ig.DataSource](ig.datasource), or an instance of an [$.ig.DataSource](ig.datasource) itself. * Note: if it is set to string and [dataSourceType](ui.igcombo#options:dataSourceType) option is not set, then [$.ig.JSONDataSource](ig.jsondatasource) is used. + * */ dataSource?: any; /** * Sets data source type (such as "json", "xml", etc). Please refer to the documentation of [$.ig.DataSource](ig.datasource) and its [type](ig.datasource#options:settings.type) property. + * */ dataSourceType?: string; /** * Sets URL which is used for sending JSON on request for remote filtering (MVC for example). That option is required when [load on demand](ui.igcombo#options:loadOnDemandSettings) is * [enabled](ui.igcombo#options:loadOnDemandSettings.enabled) and its [type](ui.igcombo#options:filteringType) is remote. + * */ dataSourceUrl?: string; /** * See [$.ig.DataSource](ig.datasource) property in the response specifying the total number of records on the server. + * */ responseTotalRecCountKey?: string; /** * See [$.ig.DataSource](ig.datasource) This is basically the property in the response where data records are held, if the response is wrapped. + * */ responseDataKey?: string; /** * Response type when a URL is set as the data source. See http://api.jquery.com/jQuery.ajax/ => dataType. * + * * Valid values: * "json" * "xml" @@ -20606,32 +21881,38 @@ interface IgCombo { /** * Content type of the response. See http://api.jquery.com/jQuery.ajax/ => contentType. + * */ responseContentType?: string; /** * Specifies the HTTP verb to be used to issue the request. + * */ requestType?: string; /** * Gets/Sets name of column which contains the "value". If it is missing, then the name of first column will be used. + * */ valueKey?: string; /** * Gets/Sets name of column which contains the displayed text. If it is missing, then [valueKey](ui.igcombo#options:valueKey) option will be used. + * */ textKey?: string; /** * Gets/Sets a template used to render an item in list. The igCombo utilizes igTemplating for generating node content templates. * More info on the templating engine can be found here: http://www.igniteui.com/help/infragistics-templating-engine. + * */ itemTemplate?: string; /** * Gets/Sets template used to render a header in the drop-down list. The template is rendered inside of a DIV html element. + * */ headerTemplate?: string; @@ -20644,33 +21925,39 @@ interface IgCombo { * - {1}: Number of records in dataSource * - {2}: Number of (filtered) records on server * - {3}: Number of all records on server + * */ footerTemplate?: string; /** * Gets/Sets the name of a hidden INPUT element, which is used when submitting data. Its value will be set to the values of the selected items valueKeys separated by ',' character on any change in igCombo. If the combo element has 'name' attribute and this option is not set, the 'name' attribute will be used for the input name. + * */ inputName?: string; /** * Gets/Sets show drop-down list animation duration in milliseconds. + * */ animationShowDuration?: number; /** * Gets/Sets hide drop-down list animation duration in milliseconds. + * */ animationHideDuration?: number; /** * If set to true, the container of the drop-down list is appended to the body. * If set to false, it is appended to the parent element of the combo. + * */ dropDownAttachedToBody?: boolean; /** * Gets/Sets type of filtering.Note: option is set to "remote", then the "css.waitFiltering" is applied to combo and its drop-down list. * + * * Valid values: * "remote" filtering is performed by server * "local" filtering is performed by $.ig.DataSource @@ -20680,12 +21967,14 @@ interface IgCombo { /** * Gets/Sets URL key name that specifies how the remote filtering expressions will be encoded for remote requests, e.g. &filter('col') = startsWith. Default is OData. + * */ filterExprUrlKey?: string; /** * Gets/Sets condition used for filtering.Note: When [autoComplete](ui.igcombo#options:autoComplete) is enabled, the filtering condition is always "startsWith". * + * * Valid values: * "contains" * "doesNotContain" @@ -20703,6 +21992,7 @@ interface IgCombo { /** * Gets/Sets filtering logic. * + * * Valid values: * "OR" * "AND" @@ -20743,6 +22033,7 @@ interface IgCombo { * Notes: * That option has effect only when data is loaded remotely using [dataSourceUrl](ui.igcombo#options:dataSourceUrl). * Selection is supported only for already loaded items. + * */ loadOnDemandSettings?: IgComboLoadOnDemandSettings; @@ -20750,12 +22041,14 @@ interface IgCombo { * Gets/Sets how many items should be shown at once. * Notes: * This option is used for [virtualization](ui.igcombo#options:virtualization) in order to render initial list items. + * */ visibleItemsCount?: number; /** * Sets gets functionality mode. * + * * Valid values: * "editable" Allows to modify value by edit field and drop-down list. * "dropdown" Allows to modify value by drop-down list only. @@ -20767,28 +22060,33 @@ interface IgCombo { /** * Gets/Sets ability to use virtual rendering for drop-down list. Enable to boost performance when combo has lots of records. * If that option is enabled, then only visible items are created and the top edge of the first visible item in list is aligned to the top edge of list. + * */ virtualization?: boolean; /** * Gets/Sets object specifying multi selection feature options. Note showCheckboxes and itemSeparator has effect only if multi selection is enabled. + * */ multiSelection?: IgComboMultiSelection; /** * Gets/Sets object specifying grouping feature options. The option has key and dir properties. + * */ grouping?: IgComboGrouping; /** * Gets/Sets object which contains options supported by [igValidator](ui.igvalidator). * Notes: in order for validator to work, application should ensure that [igValidator](ui.igvalidator) is loaded (ig.ui.validator.js/css files). + * */ validatorOptions?: any; /** * Gets/Sets condition used for highlighting of matching parts in items of drop-down list. * + * * Valid values: * "multi" multiple matches in a single item are rendered * "contains" match at any position in item is rendered @@ -20800,17 +22098,20 @@ interface IgCombo { /** * If set to true, filtering and auto selection will be case-sensitive. + * */ caseSensitive?: boolean; /** * Gets/Sets whether the first matching item should be auto selected when typing in input. When [multiSelection](ui.igcombo#options:multiSelection) is enabled this option will instead put the active item on the matching element. + * */ autoSelectFirstMatch?: boolean; /** * Gets/Sets ability to autocomplete field from first matching item in list. * Note: When autoComplete option is enabled, then "startsWith" is used for [filteringCondition](ui.igcombo#options:filteringCondition). + * */ autoComplete?: boolean; @@ -20818,47 +22119,56 @@ interface IgCombo { * If set to true: * 1. Allows custom value input only with single selection. * 2. Custom values will be auto completed to the closest value if [autoComplete](ui.igcombo#options:autoComplete) is enabled. + * */ allowCustomValue?: boolean; /** * Gets/Sets ability to close drop-down list when control loses focus. + * */ closeDropDownOnBlur?: boolean; /** * Specifies the delay duration before processing the changes in the input. Useful to boost performance by lowering the count of selection, filtering, auto complete and highlighting operations executed on each input change. + * */ delayInputChangeProcessing?: number; /** * Gets/Sets tabIndex for the field of the combo. + * */ tabIndex?: number; /** * Gets/Sets ability to show the drop-down list when the combo is in focus. This option has effect only if the combo is in editable [mode](ui.igcombo#options:mode). + * */ dropDownOnFocus?: boolean; /** * Gets sets ability to close drop-down list when single item in the list is selected with mouse click or enter press. The default value when [multiSelection](ui.igcombo#options:multiSelection) is enabled will be false. This option will not close the drop down when [multiSelection](ui.igcombo#options:multiSelection) is enabled and additive selection is performed. + * */ closeDropDownOnSelect?: boolean; /** * Gets/Sets ability to select items by space button press. + * */ selectItemBySpaceKey?: boolean; /** * Gets/Sets list of items to be selected when the combo is initialized. It should contain array of objects with index or value property, then on initialization the matching items will be selected. If initialSelectedItems are not set, the combo is with single selection and it is in a dropdown, readonly or readonlylist [mode](ui.igcombo#options:mode), the first item will be automatically selected. * Note: Only items loaded on initialization can be selected. When using [load on demand](ui.igCombo#options:loadOnDemandSettings), selecting an item which is not loaded yet will fail. + * */ initialSelectedItems?: IgComboInitialSelectedItem[]; /** * Gets/Sets ability to prevent submitting form on enter key press. + * */ preventSubmitOnEnter?: boolean; @@ -20871,24 +22181,28 @@ interface IgCombo { * Custom values can be something like "currency", "percent", "dateLong", "time", "MMM-dd-yyyy H:mm tt", etc. * * Custom format strings should match the data type in "textKey" column. + * */ format?: string; /** * Gets/Sets whether the onscreen keyboard should be shown when the dropdown button is clicked (touch devices only). * Note: The keyboard will still show when the combo input is focused in editable mode. + * */ suppressKeyboard?: boolean; /** * Specifies whether the clear button should be rendered. * When the [mode](ui.igcombo#options:mode) is single selection, readonly or readonlylist this option will default to false. It can still be enabled when it is specifically set to true. + * */ enableClearButton?: boolean; /** * Gets/Sets drop-down list orientation when open button is clicked. * + * * Valid values: * "auto" if there is enough space, it positions the drop-down list below the combo input, otherwise - above the combo input * "bottom" below the combo input @@ -20896,6 +22210,18 @@ interface IgCombo { */ dropDownOrientation?: string; + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event which is raised after rendering of the combo completes. * @@ -21029,7 +22355,16 @@ interface IgCombo { [optionName: string]: any; } interface IgComboMethods { + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.igcombo#options:language) + * Note that this method is for rare scenarios, see [language](ui.igcombo#options:language) or [locale](ui.igcombo#options:locale) option setter + */ changeLocale(): void; + + /** + * Changes the the regional settings of widget element to the language specified in [options.regional](ui.igcombo#options:regional) + * Note that this method is for rare scenarios, use [regional](ui.igcombo#options:regional) option setter + */ changeRegional(): void; /** @@ -21354,6 +22689,16 @@ interface IgComboMethods { * Destroys the igCombo widget. */ destroy(): Object; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igCombo"): IgComboMethods; @@ -21403,9 +22748,12 @@ interface JQuery { igCombo(methodName: "dropDownOpened"): boolean; igCombo(methodName: "positionDropDown"): Object; igCombo(methodName: "destroy"): Object; + igCombo(methodName: "changeGlobalLanguage"): void; + igCombo(methodName: "changeGlobalRegional"): void; /** * Gets/Sets the width of combo. The numeric and string values (valid html units for size) are supported. It includes %, px, em and other units. + * */ igCombo(optionLiteral: 'option', optionName: "width"): string|number; @@ -21413,6 +22761,7 @@ interface JQuery { /** * /Sets the width of combo. The numeric and string values (valid html units for size) are supported. It includes %, px, em and other units. * + * * @optionValue New value to be set. */ @@ -21420,6 +22769,7 @@ interface JQuery { /** * Gets/Sets height of combo. The numeric and string values (valid html units for size) are supported. It includes %, px, em and other units. + * */ igCombo(optionLiteral: 'option', optionName: "height"): string|number; @@ -21427,6 +22777,7 @@ interface JQuery { /** * /Sets height of combo. The numeric and string values (valid html units for size) are supported. It includes %, px, em and other units. * + * * @optionValue New value to be set. */ @@ -21434,6 +22785,7 @@ interface JQuery { /** * Gets/Sets the width of drop-down list in pixels. + * */ igCombo(optionLiteral: 'option', optionName: "dropDownWidth"): string|number; @@ -21441,6 +22793,7 @@ interface JQuery { /** * /Sets the width of drop-down list in pixels. * + * * @optionValue New value to be set. */ @@ -21449,6 +22802,7 @@ interface JQuery { /** * Gets/Sets a valid data source accepted by [$.ig.DataSource](ig.datasource), or an instance of an [$.ig.DataSource](ig.datasource) itself. * Note: if it is set to string and [dataSourceType](ui.igcombo#options:dataSourceType) option is not set, then [$.ig.JSONDataSource](ig.jsondatasource) is used. + * */ igCombo(optionLiteral: 'option', optionName: "dataSource"): any; @@ -21456,18 +22810,21 @@ interface JQuery { * /Sets a valid data source accepted by [$.ig.DataSource](ig.datasource), or an instance of an [$.ig.DataSource](ig.datasource) itself. * Note: if it is set to string and [dataSourceType](ui.igcombo#options:dataSourceType) option is not set, then [$.ig.JSONDataSource](ig.jsondatasource) is used. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "dataSource", optionValue: any): void; /** * Sets data source type (such as "json", "xml", etc). Please refer to the documentation of [$.ig.DataSource](ig.datasource) and its [type](ig.datasource#options:settings.type) property. + * */ igCombo(optionLiteral: 'option', optionName: "dataSourceType"): string; /** * Sets data source type (such as "json", "xml", etc). Please refer to the documentation of [$.ig.DataSource](ig.datasource) and its [type](ig.datasource#options:settings.type) property. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "dataSourceType", optionValue: string): void; @@ -21475,6 +22832,7 @@ interface JQuery { /** * Sets URL which is used for sending JSON on request for remote filtering (MVC for example). That option is required when [load on demand](ui.igcombo#options:loadOnDemandSettings) is * [enabled](ui.igcombo#options:loadOnDemandSettings.enabled) and its [type](ui.igcombo#options:filteringType) is remote. + * */ igCombo(optionLiteral: 'option', optionName: "dataSourceUrl"): string; @@ -21482,36 +22840,42 @@ interface JQuery { * Sets URL which is used for sending JSON on request for remote filtering (MVC for example). That option is required when [load on demand](ui.igcombo#options:loadOnDemandSettings) is * [enabled](ui.igcombo#options:loadOnDemandSettings.enabled) and its [type](ui.igcombo#options:filteringType) is remote. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "dataSourceUrl", optionValue: string): void; /** * See [$.ig.DataSource](ig.datasource) property in the response specifying the total number of records on the server. + * */ igCombo(optionLiteral: 'option', optionName: "responseTotalRecCountKey"): string; /** * See [$.ig.DataSource](ig.datasource) property in the response specifying the total number of records on the server. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "responseTotalRecCountKey", optionValue: string): void; /** * See [$.ig.DataSource](ig.datasource) This is basically the property in the response where data records are held, if the response is wrapped. + * */ igCombo(optionLiteral: 'option', optionName: "responseDataKey"): string; /** * See [$.ig.DataSource](ig.datasource) This is basically the property in the response where data records are held, if the response is wrapped. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "responseDataKey", optionValue: string): void; /** * Response type when a URL is set as the data source. See http://api.jquery.com/jQuery.ajax/ => dataType. + * */ igCombo(optionLiteral: 'option', optionName: "responseDataType"): string; @@ -21519,6 +22883,7 @@ interface JQuery { /** * Response type when a URL is set as the data source. See http://api.jquery.com/jQuery.ajax/ => dataType. * + * * @optionValue New value to be set. */ @@ -21526,48 +22891,56 @@ interface JQuery { /** * Content type of the response. See http://api.jquery.com/jQuery.ajax/ => contentType. + * */ igCombo(optionLiteral: 'option', optionName: "responseContentType"): string; /** * Content type of the response. See http://api.jquery.com/jQuery.ajax/ => contentType. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "responseContentType", optionValue: string): void; /** * Specifies the HTTP verb to be used to issue the request. + * */ igCombo(optionLiteral: 'option', optionName: "requestType"): string; /** * Specifies the HTTP verb to be used to issue the request. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "requestType", optionValue: string): void; /** * Gets/Sets name of column which contains the "value". If it is missing, then the name of first column will be used. + * */ igCombo(optionLiteral: 'option', optionName: "valueKey"): string; /** * /Sets name of column which contains the "value". If it is missing, then the name of first column will be used. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "valueKey", optionValue: string): void; /** * Gets/Sets name of column which contains the displayed text. If it is missing, then [valueKey](ui.igcombo#options:valueKey) option will be used. + * */ igCombo(optionLiteral: 'option', optionName: "textKey"): string; /** * /Sets name of column which contains the displayed text. If it is missing, then [valueKey](ui.igcombo#options:valueKey) option will be used. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "textKey", optionValue: string): void; @@ -21575,6 +22948,7 @@ interface JQuery { /** * Gets/Sets a template used to render an item in list. The igCombo utilizes igTemplating for generating node content templates. * More info on the templating engine can be found here: http://www.igniteui.com/help/infragistics-templating-engine. + * */ igCombo(optionLiteral: 'option', optionName: "itemTemplate"): string; @@ -21582,18 +22956,21 @@ interface JQuery { * /Sets a template used to render an item in list. The igCombo utilizes igTemplating for generating node content templates. * More info on the templating engine can be found here: http://www.igniteui.com/help/infragistics-templating-engine. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "itemTemplate", optionValue: string): void; /** * Gets/Sets template used to render a header in the drop-down list. The template is rendered inside of a DIV html element. + * */ igCombo(optionLiteral: 'option', optionName: "headerTemplate"): string; /** * /Sets template used to render a header in the drop-down list. The template is rendered inside of a DIV html element. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "headerTemplate", optionValue: string): void; @@ -21607,6 +22984,7 @@ interface JQuery { * - {1}: Number of records in dataSource * - {2}: Number of (filtered) records on server * - {3}: Number of all records on server + * */ igCombo(optionLiteral: 'option', optionName: "footerTemplate"): string; @@ -21620,42 +22998,49 @@ interface JQuery { * - {2}: Number of (filtered) records on server * - {3}: Number of all records on server * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "footerTemplate", optionValue: string): void; /** * Gets/Sets the name of a hidden INPUT element, which is used when submitting data. Its value will be set to the values of the selected items valueKeys separated by ',' character on any change in igCombo. If the combo element has 'name' attribute and this option is not set, the 'name' attribute will be used for the input name. + * */ igCombo(optionLiteral: 'option', optionName: "inputName"): string; /** * /Sets the name of a hidden INPUT element, which is used when submitting data. Its value will be set to the values of the selected items valueKeys separated by ',' character on any change in igCombo. If the combo element has 'name' attribute and this option is not set, the 'name' attribute will be used for the input name. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "inputName", optionValue: string): void; /** * Gets/Sets show drop-down list animation duration in milliseconds. + * */ igCombo(optionLiteral: 'option', optionName: "animationShowDuration"): number; /** * /Sets show drop-down list animation duration in milliseconds. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "animationShowDuration", optionValue: number): void; /** * Gets/Sets hide drop-down list animation duration in milliseconds. + * */ igCombo(optionLiteral: 'option', optionName: "animationHideDuration"): number; /** * /Sets hide drop-down list animation duration in milliseconds. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "animationHideDuration", optionValue: number): void; @@ -21663,6 +23048,7 @@ interface JQuery { /** * If set to true, the container of the drop-down list is appended to the body. * If set to false, it is appended to the parent element of the combo. + * */ igCombo(optionLiteral: 'option', optionName: "dropDownAttachedToBody"): boolean; @@ -21670,12 +23056,14 @@ interface JQuery { * If set to true, the container of the drop-down list is appended to the body. * If set to false, it is appended to the parent element of the combo. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "dropDownAttachedToBody", optionValue: boolean): void; /** * Gets/Sets type of filtering.Note: option is set to "remote", then the "css.waitFiltering" is applied to combo and its drop-down list. + * */ igCombo(optionLiteral: 'option', optionName: "filteringType"): string; @@ -21683,6 +23071,7 @@ interface JQuery { /** * /Sets type of filtering.Note: option is set to "remote", then the "css.waitFiltering" is applied to combo and its drop-down list. * + * * @optionValue New value to be set. */ @@ -21690,18 +23079,21 @@ interface JQuery { /** * Gets/Sets URL key name that specifies how the remote filtering expressions will be encoded for remote requests, e.g. &filter('col') = startsWith. Default is OData. + * */ igCombo(optionLiteral: 'option', optionName: "filterExprUrlKey"): string; /** * /Sets URL key name that specifies how the remote filtering expressions will be encoded for remote requests, e.g. &filter('col') = startsWith. Default is OData. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "filterExprUrlKey", optionValue: string): void; /** * Gets/Sets condition used for filtering.Note: When [autoComplete](ui.igcombo#options:autoComplete) is enabled, the filtering condition is always "startsWith". + * */ igCombo(optionLiteral: 'option', optionName: "filteringCondition"): string; @@ -21709,6 +23101,7 @@ interface JQuery { /** * /Sets condition used for filtering.Note: When [autoComplete](ui.igcombo#options:autoComplete) is enabled, the filtering condition is always "startsWith". * + * * @optionValue New value to be set. */ @@ -21716,6 +23109,7 @@ interface JQuery { /** * Gets/Sets filtering logic. + * */ igCombo(optionLiteral: 'option', optionName: "filteringLogic"): string; @@ -21723,6 +23117,7 @@ interface JQuery { /** * /Sets filtering logic. * + * * @optionValue New value to be set. */ @@ -21799,6 +23194,7 @@ interface JQuery { * Notes: * That option has effect only when data is loaded remotely using [dataSourceUrl](ui.igcombo#options:dataSourceUrl). * Selection is supported only for already loaded items. + * */ igCombo(optionLiteral: 'option', optionName: "loadOnDemandSettings"): IgComboLoadOnDemandSettings; @@ -21808,6 +23204,7 @@ interface JQuery { * That option has effect only when data is loaded remotely using [dataSourceUrl](ui.igcombo#options:dataSourceUrl). * Selection is supported only for already loaded items. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "loadOnDemandSettings", optionValue: IgComboLoadOnDemandSettings): void; @@ -21816,6 +23213,7 @@ interface JQuery { * Gets/Sets how many items should be shown at once. * Notes: * This option is used for [virtualization](ui.igcombo#options:virtualization) in order to render initial list items. + * */ igCombo(optionLiteral: 'option', optionName: "visibleItemsCount"): number; @@ -21824,12 +23222,14 @@ interface JQuery { * Notes: * This option is used for [virtualization](ui.igcombo#options:virtualization) in order to render initial list items. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "visibleItemsCount", optionValue: number): void; /** * Sets gets functionality mode. + * */ igCombo(optionLiteral: 'option', optionName: "mode"): string; @@ -21837,6 +23237,7 @@ interface JQuery { /** * Sets gets functionality mode. * + * * @optionValue New value to be set. */ @@ -21845,6 +23246,7 @@ interface JQuery { /** * Gets/Sets ability to use virtual rendering for drop-down list. Enable to boost performance when combo has lots of records. * If that option is enabled, then only visible items are created and the top edge of the first visible item in list is aligned to the top edge of list. + * */ igCombo(optionLiteral: 'option', optionName: "virtualization"): boolean; @@ -21852,30 +23254,35 @@ interface JQuery { * /Sets ability to use virtual rendering for drop-down list. Enable to boost performance when combo has lots of records. * If that option is enabled, then only visible items are created and the top edge of the first visible item in list is aligned to the top edge of list. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "virtualization", optionValue: boolean): void; /** * Gets/Sets object specifying multi selection feature options. Note showCheckboxes and itemSeparator has effect only if multi selection is enabled. + * */ igCombo(optionLiteral: 'option', optionName: "multiSelection"): IgComboMultiSelection; /** * /Sets object specifying multi selection feature options. Note showCheckboxes and itemSeparator has effect only if multi selection is enabled. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "multiSelection", optionValue: IgComboMultiSelection): void; /** * Gets/Sets object specifying grouping feature options. The option has key and dir properties. + * */ igCombo(optionLiteral: 'option', optionName: "grouping"): IgComboGrouping; /** * /Sets object specifying grouping feature options. The option has key and dir properties. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "grouping", optionValue: IgComboGrouping): void; @@ -21883,6 +23290,7 @@ interface JQuery { /** * Gets/Sets object which contains options supported by [igValidator](ui.igvalidator). * Notes: in order for validator to work, application should ensure that [igValidator](ui.igvalidator) is loaded (ig.ui.validator.js/css files). + * */ igCombo(optionLiteral: 'option', optionName: "validatorOptions"): any; @@ -21890,12 +23298,14 @@ interface JQuery { * /Sets object which contains options supported by [igValidator](ui.igvalidator). * Notes: in order for validator to work, application should ensure that [igValidator](ui.igvalidator) is loaded (ig.ui.validator.js/css files). * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "validatorOptions", optionValue: any): void; /** * Gets/Sets condition used for highlighting of matching parts in items of drop-down list. + * */ igCombo(optionLiteral: 'option', optionName: "highlightMatchesMode"): string; @@ -21903,6 +23313,7 @@ interface JQuery { /** * /Sets condition used for highlighting of matching parts in items of drop-down list. * + * * @optionValue New value to be set. */ @@ -21910,24 +23321,28 @@ interface JQuery { /** * If set to true, filtering and auto selection will be case-sensitive. + * */ igCombo(optionLiteral: 'option', optionName: "caseSensitive"): boolean; /** * If set to true, filtering and auto selection will be case-sensitive. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "caseSensitive", optionValue: boolean): void; /** * Gets/Sets whether the first matching item should be auto selected when typing in input. When [multiSelection](ui.igcombo#options:multiSelection) is enabled this option will instead put the active item on the matching element. + * */ igCombo(optionLiteral: 'option', optionName: "autoSelectFirstMatch"): boolean; /** * /Sets whether the first matching item should be auto selected when typing in input. When [multiSelection](ui.igcombo#options:multiSelection) is enabled this option will instead put the active item on the matching element. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "autoSelectFirstMatch", optionValue: boolean): void; @@ -21935,6 +23350,7 @@ interface JQuery { /** * Gets/Sets ability to autocomplete field from first matching item in list. * Note: When autoComplete option is enabled, then "startsWith" is used for [filteringCondition](ui.igcombo#options:filteringCondition). + * */ igCombo(optionLiteral: 'option', optionName: "autoComplete"): boolean; @@ -21942,6 +23358,7 @@ interface JQuery { * /Sets ability to autocomplete field from first matching item in list. * Note: When autoComplete option is enabled, then "startsWith" is used for [filteringCondition](ui.igcombo#options:filteringCondition). * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "autoComplete", optionValue: boolean): void; @@ -21950,6 +23367,7 @@ interface JQuery { * If set to true: * 1. Allows custom value input only with single selection. * 2. Custom values will be auto completed to the closest value if [autoComplete](ui.igcombo#options:autoComplete) is enabled. + * */ igCombo(optionLiteral: 'option', optionName: "allowCustomValue"): boolean; @@ -21958,78 +23376,91 @@ interface JQuery { * 1. Allows custom value input only with single selection. * 2. Custom values will be auto completed to the closest value if [autoComplete](ui.igcombo#options:autoComplete) is enabled. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "allowCustomValue", optionValue: boolean): void; /** * Gets/Sets ability to close drop-down list when control loses focus. + * */ igCombo(optionLiteral: 'option', optionName: "closeDropDownOnBlur"): boolean; /** * /Sets ability to close drop-down list when control loses focus. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "closeDropDownOnBlur", optionValue: boolean): void; /** * Gets the delay duration before processing the changes in the input. Useful to boost performance by lowering the count of selection, filtering, auto complete and highlighting operations executed on each input change. + * */ igCombo(optionLiteral: 'option', optionName: "delayInputChangeProcessing"): number; /** * Sets the delay duration before processing the changes in the input. Useful to boost performance by lowering the count of selection, filtering, auto complete and highlighting operations executed on each input change. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "delayInputChangeProcessing", optionValue: number): void; /** * Gets/Sets tabIndex for the field of the combo. + * */ igCombo(optionLiteral: 'option', optionName: "tabIndex"): number; /** * /Sets tabIndex for the field of the combo. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "tabIndex", optionValue: number): void; /** * Gets/Sets ability to show the drop-down list when the combo is in focus. This option has effect only if the combo is in editable [mode](ui.igcombo#options:mode). + * */ igCombo(optionLiteral: 'option', optionName: "dropDownOnFocus"): boolean; /** * /Sets ability to show the drop-down list when the combo is in focus. This option has effect only if the combo is in editable [mode](ui.igcombo#options:mode). * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "dropDownOnFocus", optionValue: boolean): void; /** * Gets ability to close drop-down list when single item in the list is selected with mouse click or enter press. The default value when [multiSelection](ui.igcombo#options:multiSelection) is enabled will be false. This option will not close the drop down when [multiSelection](ui.igcombo#options:multiSelection) is enabled and additive selection is performed. + * */ igCombo(optionLiteral: 'option', optionName: "closeDropDownOnSelect"): boolean; /** * Sets ability to close drop-down list when single item in the list is selected with mouse click or enter press. The default value when [multiSelection](ui.igcombo#options:multiSelection) is enabled will be false. This option will not close the drop down when [multiSelection](ui.igcombo#options:multiSelection) is enabled and additive selection is performed. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "closeDropDownOnSelect", optionValue: boolean): void; /** * Gets/Sets ability to select items by space button press. + * */ igCombo(optionLiteral: 'option', optionName: "selectItemBySpaceKey"): boolean; /** * /Sets ability to select items by space button press. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "selectItemBySpaceKey", optionValue: boolean): void; @@ -22037,6 +23468,7 @@ interface JQuery { /** * Gets/Sets list of items to be selected when the combo is initialized. It should contain array of objects with index or value property, then on initialization the matching items will be selected. If initialSelectedItems are not set, the combo is with single selection and it is in a dropdown, readonly or readonlylist [mode](ui.igcombo#options:mode), the first item will be automatically selected. * Note: Only items loaded on initialization can be selected. When using [load on demand](ui.igCombo#options:loadOnDemandSettings), selecting an item which is not loaded yet will fail. + * */ igCombo(optionLiteral: 'option', optionName: "initialSelectedItems"): IgComboInitialSelectedItem[]; @@ -22044,18 +23476,21 @@ interface JQuery { * /Sets list of items to be selected when the combo is initialized. It should contain array of objects with index or value property, then on initialization the matching items will be selected. If initialSelectedItems are not set, the combo is with single selection and it is in a dropdown, readonly or readonlylist [mode](ui.igcombo#options:mode), the first item will be automatically selected. * Note: Only items loaded on initialization can be selected. When using [load on demand](ui.igCombo#options:loadOnDemandSettings), selecting an item which is not loaded yet will fail. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "initialSelectedItems", optionValue: IgComboInitialSelectedItem[]): void; /** * Gets/Sets ability to prevent submitting form on enter key press. + * */ igCombo(optionLiteral: 'option', optionName: "preventSubmitOnEnter"): boolean; /** * /Sets ability to prevent submitting form on enter key press. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "preventSubmitOnEnter", optionValue: boolean): void; @@ -22069,6 +23504,7 @@ interface JQuery { * Custom values can be something like "currency", "percent", "dateLong", "time", "MMM-dd-yyyy H:mm tt", etc. * * Custom format strings should match the data type in "textKey" column. + * */ igCombo(optionLiteral: 'option', optionName: "format"): string; @@ -22082,6 +23518,7 @@ interface JQuery { * * Custom format strings should match the data type in "textKey" column. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "format", optionValue: string): void; @@ -22089,6 +23526,7 @@ interface JQuery { /** * Gets/Sets whether the onscreen keyboard should be shown when the dropdown button is clicked (touch devices only). * Note: The keyboard will still show when the combo input is focused in editable mode. + * */ igCombo(optionLiteral: 'option', optionName: "suppressKeyboard"): boolean; @@ -22096,6 +23534,7 @@ interface JQuery { * /Sets whether the onscreen keyboard should be shown when the dropdown button is clicked (touch devices only). * Note: The keyboard will still show when the combo input is focused in editable mode. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "suppressKeyboard", optionValue: boolean): void; @@ -22103,6 +23542,7 @@ interface JQuery { /** * Gets whether the clear button should be rendered. * When the [mode](ui.igcombo#options:mode) is single selection, readonly or readonlylist this option will default to false. It can still be enabled when it is specifically set to true. + * */ igCombo(optionLiteral: 'option', optionName: "enableClearButton"): boolean; @@ -22110,12 +23550,14 @@ interface JQuery { * Sets whether the clear button should be rendered. * When the [mode](ui.igcombo#options:mode) is single selection, readonly or readonlylist this option will default to false. It can still be enabled when it is specifically set to true. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "enableClearButton", optionValue: boolean): void; /** * Gets/Sets drop-down list orientation when open button is clicked. + * */ igCombo(optionLiteral: 'option', optionName: "dropDownOrientation"): string; @@ -22123,11 +23565,42 @@ interface JQuery { /** * /Sets drop-down list orientation when open button is clicked. * + * * @optionValue New value to be set. */ igCombo(optionLiteral: 'option', optionName: "dropDownOrientation", optionValue: string): void; + /** + * Set/Get the locale language setting for the widget. + * + */ + igCombo(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igCombo(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igCombo(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igCombo(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event which is raised after rendering of the combo completes. * @@ -22416,31 +23889,37 @@ interface JQuery { interface IgDialogLocale { /** * Gets/Sets the title/tooltip for the close button in the dialog. + * */ closeButtonTitle?: string; /** * Gets/Sets the title/tooltip for the minimize button in the dialog. + * */ minimizeButtonTitle?: string; /** * Gets/Sets the title/tooltip for the maximize button in the dialog. + * */ maximizeButtonTitle?: string; /** * Gets/Sets the title/tooltip for the pin button in the dialog. + * */ pinButtonTitle?: string; /** * Gets/Sets the title/tooltip for the pin button in the dialog. + * */ unpinButtonTitle?: string; /** * Gets/Sets the title/tooltip for the restore button in the dialog. + * */ restoreButtonTitle?: string; @@ -22456,29 +23935,29 @@ interface StateChangingEvent { interface StateChangingEventUIParam { /** - * Used to obtain a reference to the igDialog. + * Gets a reference to the igDialog widget. */ owner?: any; /** - * Used ton to obtain the name of the button, which triggered the event. Note: if the state was modified from the code, then "button" is undefined. + * Gets the name of the button, which triggered the event. Note: if the state was modified from the code, then "button" is undefined. */ - button?: any; + button?: string; /** - * Used to obtain the old state of the dialog, which can be one of the following: "opened", "minimized", "maximized", "closed". + * Gets the old state of the dialog, which can be one of the following: "opened", "minimized", "maximized", "closed". */ - oldState?: any; + oldState?: string; /** - * Used to obtain the boolean value of the old pin state of the dialog. + * Gets the boolean value of the old pin state of the dialog. */ - oldPinned?: any; + oldPinned?: boolean; /** - * Used to obtain the name of the action. That can be one of the following: + * Gets the name of the action. That can be one of the following: "open" - request to open the dialog. "close" - request to close the dialog. "minimize" - request to minimize the dialog. "maximize" - request to maximize the dialog. "restore" - request to restore the dialog from minimized or maximized state. "pin" - request to pin the dialog. "unpin" - request to unpin the dialog. */ - action?: any; + action?: string; } interface StateChangedEvent { @@ -22487,29 +23966,29 @@ interface StateChangedEvent { interface StateChangedEventUIParam { /** - * Used to obtain a reference to the igDialog. + * Gets a reference to the igDialog widget. */ owner?: any; /** - * Used ton to obtain the name of the button, which triggered the event. Note: if the state was modified from the code, then "button" is undefined. + * Gets the name of the button, which triggered the event. Note: if the state was modified from the code, then "button" is undefined. */ - button?: any; + button?: string; /** - * Used to obtain the old state of the dialog, which can be one of the following: "opened", "minimized", "maximized", "closed". + * Gets the old state of the dialog, which can be one of the following: "opened", "minimized", "maximized", "closed". */ - oldState?: any; + oldState?: string; /** - * Used to obtain the boolean value of the old pin state of the dialog. + * Gets the boolean value of the old pin state of the dialog. */ - oldPinned?: any; + oldPinned?: boolean; /** - * Used to obtain the name of the action. That can be one of the following: + * Gets the name of the action. That can be one of the following: "open" - the dialog was opened. Note: the event is raised before a possible "openAnimation" started. "close" - the dialog was closed. Note: the event is raised before a possible "closeAnimation" started. "minimize" - the dialog was minimized. "maximize" - the dialog was maximized. "restore" - the dialog was restored from minimized or maximized state. "pin" - the dialog was pinned. "unpin" - the dialog was unpinned. */ - action?: any; + action?: string; } interface AnimationEndedEvent { @@ -22518,14 +23997,29 @@ interface AnimationEndedEvent { interface AnimationEndedEventUIParam { /** - * Used to obtain a reference to the igDialog. + * Gets a reference to the igDialog widget. */ owner?: any; /** - * Used to obtain the name of the action, which triggered the animation. + * Gets the name of the button, which triggered the event. Note: if the state was modified from the code, then "button" is undefined. */ - action?: any; + button?: string; + + /** + * Gets the old state of the dialog, which can be one of the following: "opened", "minimized", "maximized", "closed". + */ + oldState?: string; + + /** + * Gets the boolean value of the old pin state of the dialog. + */ + oldPinned?: boolean; + + /** + * Gets the name of the action, which triggered the animation. + */ + action?: string; } interface IgFocusEvent { @@ -22534,7 +24028,7 @@ interface IgFocusEvent { interface IgFocusEventUIParam { /** - * Used to obtain a reference to the igDialog. + * Gets a reference to the igDialog widget. */ owner?: any; } @@ -22545,7 +24039,7 @@ interface BlurEvent { interface BlurEventUIParam { /** - * Used to obtain a reference to the igDialog. + * Gets a reference to the igDialog widget. */ owner?: any; } @@ -22558,12 +24052,14 @@ interface IgDialog { * 2. It should not have parent. * 3. It should not contain attributes which might destroy layout or appearance of the dialog. * 4. Change of that option is not supported. + * */ mainElement?: Element; /** * Gets/Sets the state of the dialog.Note: when the dialog is modal, then pinned and minimized states are not supported, because that will trigger misbehavior. * + * * Valid values: * "opened" The dialog is opened. * "minimized" The dialog is minimized. @@ -22579,66 +24075,79 @@ interface IgDialog { * Notes: * 1. If the parent element of the original target-element is invisible, then the pinned dialog becomes invisible as well. * 2. Pinned state is not supported for modal dialog. + * */ pinned?: boolean; /** * Gets/Sets whether the dialog should close when Esc key is pressed. + * */ closeOnEscape?: boolean; /** * Gets/Sets whether the close button in the dialog header should be visible. + * */ showCloseButton?: boolean; /** * Gets/Sets whether the maximize button in the dialog header should be visible. + * */ showMaximizeButton?: boolean; /** * Gets/Sets whether the minimize button in the dialog header should be visible. + * */ showMinimizeButton?: boolean; /** * Gets/Sets whether the pin button in the dialog header should be visible. + * */ showPinButton?: boolean; /** * Gets/Sets whether the dialog will be pinned on minimize. + * */ pinOnMinimized?: boolean; /** * Gets the name of the css class which is applied to the SPAN element located on the left side of the header. + * */ imageClass?: string; /** * Gets/Sets the text which appears in the header of the dialog. + * */ headerText?: string; /** * Gets/Sets whether the dialog header should be visible. + * */ showHeader?: boolean; /** * Gets/Sets whether the dialog footer should be visible. + * */ showFooter?: boolean; /** * Gets/Sets the text which appears in the footer of the dialog. + * */ footerText?: string; /** * Gets the name of the css class which is applied to the main DIV element of the dialog. + * */ dialogClass?: string; @@ -22647,74 +24156,88 @@ interface IgDialog { * That can be reference to html element, jquery selector or jquery object. * By default the parent form of the original target element is used. If a form is not found, then the body is used. * Note: If the "position" of the container is not set or it is "static", then the position is set to "relative". + * */ container?: any; /** * Gets/Sets the initial height of the dialog in pixels for normal state.Besides numeric values, following units are supported: "px", "em" and "%". * In case of "%", the size of browser window is used and it has effect only on open action. + * */ height?: number|string; /** * Gets/Sets the initial width of the dialog in pixels for normal state.Besides numeric values, following units are supported: "px", "em" and "%". * In case of "%", the size of browser window is used and it has effect only on open action. + * */ width?: number|string; /** * Gets/Sets the minimal height of the dialog in normal state. + * */ minHeight?: number; /** * Gets/Sets the minimal width of the dialog in normal state. + * */ minWidth?: number; /** * Gets/Sets the maximal height of the dialog in normal state. Note: that option has effect only while resizing the dialog by the end user. + * */ maxHeight?: number; /** * Gets/Sets the maximal width of the dialog in normal state. Note: that option has effect only while resizing the dialog by the end user. + * */ maxWidth?: number; /** * Gets/Sets whether the dialog can be dragged by the user. + * */ draggable?: boolean; /** * Gets/Sets the initial position of the dialog. That should be an object, which contains "top" and "left" members or an object * supported by jquery.position(param) method. Examples: { left: 100, top: 200 }, { my: "left top", at: "left top", offset: "100 200" } + * */ position?: any; /** * Gets/Sets whether the dialog can be resized by the user. + * */ resizable?: boolean; /** * Gets/Sets the value for the tabIndex attribute applied to the main html element of the dialog. + * */ tabIndex?: number; /** * Gets/Sets the animation applied to the dialog when it is opened. That can be any object supported by the jquery show(param) method. + * */ openAnimation?: any; /** * Gets/Sets the animation applied to the dialog when it is closed. That can be any object supported by the jquery hide(param) method. + * */ closeAnimation?: any; /** * Gets/Sets the value of zIndex applied to the main html element of the dialog. If value is not set, then 1000 is used. + * */ zIndex?: number; @@ -22722,6 +24245,7 @@ interface IgDialog { * Gets/Sets the modal state of the dialog. * If there are more than 1 modal igDialog, then the last opened dialog wins and becomes on the top. * Note: the modal functionality is not supported when the dialog is minimized or pinned, because that will trigger misbehavior. + * */ modal?: boolean; @@ -22731,6 +24255,7 @@ interface IgDialog { * If that option is enabled, then focus and blur event handlers are added to all the child elements of the dialog. * If the dialog is modal or it can be maximized, then it is not recommended to disable that option. * If that option is modified after the igDialog was already created, then depending on current state of the dialog, it will be temporary closed-opened or opened-closed. + * */ trackFocus?: boolean; @@ -22773,11 +24298,13 @@ interface IgDialog { /** * Gets/Sets the temporary value for src, which is used while changing the parent of the base element if it is an instance of IFRAME. That allows getting around possible JavaScript exceptions under IE. + * */ temporaryUrl?: string; /** * Gets/Sets the ability to adjust the state of the header depending on focused and not-focused states. Note: the "trackFocus" option should be enabled. + * */ enableHeaderFocus?: boolean; @@ -22785,76 +24312,45 @@ interface IgDialog { * Gets/Sets the processing of the double-click on the dialog-header.If this option is not false and dialog was minimized, then its state will be set to normal. * If this option is set to "auto" and showMaximizeButton is enabled or if this option is set to true, then the dialog will be maximized when it was in normal state, * and dialog-state will be set to normal if it was maximized. + * */ enableDblclick?: any; /** - * Event which is raised before the state of dialog was changed. - * Return false in order to cancel action. + * Set/Get the locale language setting for the widget. * - * The function takes arguments "evt" and "ui". - * Use evt to obtain the browser event. That parameter can be null if the state was modified from the code. - * Use ui.owner to obtain a reference to the igDialog. - * Use ui.button to obtain the name of the button, which triggered the event. Note: if the state was modified from the code, then "button" is undefined. - * Use ui.oldState to obtain the old state of the dialog, which can be one of the following: "opened", "minimized", "maximized", "closed". - * Use ui.oldPinned to obtain the boolean value of the old pin state of the dialog. - * Use ui.action to obtain the name of the action. That can be one of the following: - * "open" - request to open the dialog - * "close" - request to close the dialog - * "minimize" - request to minimize the dialog - * "maximize" - request to maximize the dialog - * "restore" - request to restore the dialog from minimized or maximized state - * "pin" - request to pin the dialog - * "unpin" - request to unpin the dialog + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + + /** + * Event which is raised before the state of the dialog was changed. + * Return false in order to cancel the action. */ stateChanging?: StateChangingEvent; /** * Event which is raised after the state of the dialog was changed. - * - * The function takes arguments "evt" and "ui". - * Use evt to obtain the browser event. That parameter can be null if the state was modified from the code. - * Use ui.owner to obtain a reference to the igDialog. - * Use ui.button to obtain the name of the button, which triggered the event. Note: if the state was modified from the code, then "button" is undefined. - * Use ui.oldState to obtain the old state of the dialog, which can be one of the following: "opened", "minimized", "maximized", "closed". - * Use ui.oldPinned to obtain the boolean value of the old pin state of the dialog. - * Use ui.action to obtain the name of the action. That can be one of the following: - * "open" - the dialog was opened. Note: the event is raised before a possible "openAnimation" started. - * "close" - the dialog was closed. Note: the event is raised before a possible "closeAnimation" started. - * "minimize" - the dialog was minimized - * "maximize" - the dialog was maximized - * "restore" - the dialog was restored from minimized or maximized state - * "pin" - the dialog was pinned - * "unpin" - the dialog was unpinned */ stateChanged?: StateChangedEvent; /** - * Event which is raised after the end of the animation when the dialod was closed or opened. - * - * The function takes arguments "evt" and "ui". - * Use ui.owner to obtain a reference to the igDialog. - * Use ui.action to obtain the name of the action, which triggered the animation. - * "open" - the dialog was opened - * "close" - the dialog was closed + * Event which is raised after the end of the animation when the dialog was closed or opened. */ animationEnded?: AnimationEndedEvent; /** * Event which is raised when the dialog or its content gets focus. - * - * The function takes arguments "evt" and "ui". - * Use evt to obtain the browser event. - * Use ui.owner to obtain a reference to the igDialog. */ focus?: IgFocusEvent; /** * Event which is raised when the dialog or its content loses focus. - * - * The function takes arguments "evt" and "ui". - * Use evt to obtain the browser event. - * Use ui.owner to obtain a reference to the igDialog. */ blur?: BlurEvent; @@ -22957,7 +24453,22 @@ interface IgDialogMethods { * @param newContent The new html content provided as a string. If the parameter is provided then the method acts as a setter. */ content(newContent?: string): Object; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.igdialog#options:language) + * Note that this method is for rare scenarios, see [language](ui.igdialog#options:language) or [locale](ui.igdialog#options:locale) option setter + */ changeLocale(): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igDialog"): IgDialogMethods; @@ -22979,6 +24490,8 @@ interface JQuery { igDialog(methodName: "moveToTop", e?: Object): Object; igDialog(methodName: "content", newContent?: string): Object; igDialog(methodName: "changeLocale"): void; + igDialog(methodName: "changeGlobalLanguage"): void; + igDialog(methodName: "changeGlobalRegional"): void; /** * Gets the jquery DIV object which is used as the main container for the dialog. @@ -22987,6 +24500,7 @@ interface JQuery { * 2. It should not have parent. * 3. It should not contain attributes which might destroy layout or appearance of the dialog. * 4. Change of that option is not supported. + * */ igDialog(optionLiteral: 'option', optionName: "mainElement"): Element; @@ -22998,12 +24512,14 @@ interface JQuery { * 3. It should not contain attributes which might destroy layout or appearance of the dialog. * 4. Change of that option is not supported. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "mainElement", optionValue: Element): void; /** * Gets/Sets the state of the dialog.Note: when the dialog is modal, then pinned and minimized states are not supported, because that will trigger misbehavior. + * */ igDialog(optionLiteral: 'option', optionName: "state"): string; @@ -23011,6 +24527,7 @@ interface JQuery { /** * /Sets the state of the dialog.Note: when the dialog is modal, then pinned and minimized states are not supported, because that will trigger misbehavior. * + * * @optionValue New value to be set. */ @@ -23023,6 +24540,7 @@ interface JQuery { * Notes: * 1. If the parent element of the original target-element is invisible, then the pinned dialog becomes invisible as well. * 2. Pinned state is not supported for modal dialog. + * */ igDialog(optionLiteral: 'option', optionName: "pinned"): boolean; @@ -23034,150 +24552,175 @@ interface JQuery { * 1. If the parent element of the original target-element is invisible, then the pinned dialog becomes invisible as well. * 2. Pinned state is not supported for modal dialog. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "pinned", optionValue: boolean): void; /** * Gets/Sets whether the dialog should close when Esc key is pressed. + * */ igDialog(optionLiteral: 'option', optionName: "closeOnEscape"): boolean; /** * /Sets whether the dialog should close when Esc key is pressed. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "closeOnEscape", optionValue: boolean): void; /** * Gets/Sets whether the close button in the dialog header should be visible. + * */ igDialog(optionLiteral: 'option', optionName: "showCloseButton"): boolean; /** * /Sets whether the close button in the dialog header should be visible. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "showCloseButton", optionValue: boolean): void; /** * Gets/Sets whether the maximize button in the dialog header should be visible. + * */ igDialog(optionLiteral: 'option', optionName: "showMaximizeButton"): boolean; /** * /Sets whether the maximize button in the dialog header should be visible. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "showMaximizeButton", optionValue: boolean): void; /** * Gets/Sets whether the minimize button in the dialog header should be visible. + * */ igDialog(optionLiteral: 'option', optionName: "showMinimizeButton"): boolean; /** * /Sets whether the minimize button in the dialog header should be visible. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "showMinimizeButton", optionValue: boolean): void; /** * Gets/Sets whether the pin button in the dialog header should be visible. + * */ igDialog(optionLiteral: 'option', optionName: "showPinButton"): boolean; /** * /Sets whether the pin button in the dialog header should be visible. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "showPinButton", optionValue: boolean): void; /** * Gets/Sets whether the dialog will be pinned on minimize. + * */ igDialog(optionLiteral: 'option', optionName: "pinOnMinimized"): boolean; /** * /Sets whether the dialog will be pinned on minimize. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "pinOnMinimized", optionValue: boolean): void; /** * Gets the name of the css class which is applied to the SPAN element located on the left side of the header. + * */ igDialog(optionLiteral: 'option', optionName: "imageClass"): string; /** * The name of the css class which is applied to the SPAN element located on the left side of the header. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "imageClass", optionValue: string): void; /** * Gets/Sets the text which appears in the header of the dialog. + * */ igDialog(optionLiteral: 'option', optionName: "headerText"): string; /** * /Sets the text which appears in the header of the dialog. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "headerText", optionValue: string): void; /** * Gets/Sets whether the dialog header should be visible. + * */ igDialog(optionLiteral: 'option', optionName: "showHeader"): boolean; /** * /Sets whether the dialog header should be visible. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "showHeader", optionValue: boolean): void; /** * Gets/Sets whether the dialog footer should be visible. + * */ igDialog(optionLiteral: 'option', optionName: "showFooter"): boolean; /** * /Sets whether the dialog footer should be visible. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "showFooter", optionValue: boolean): void; /** * Gets/Sets the text which appears in the footer of the dialog. + * */ igDialog(optionLiteral: 'option', optionName: "footerText"): string; /** * /Sets the text which appears in the footer of the dialog. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "footerText", optionValue: string): void; /** * Gets the name of the css class which is applied to the main DIV element of the dialog. + * */ igDialog(optionLiteral: 'option', optionName: "dialogClass"): string; /** * The name of the css class which is applied to the main DIV element of the dialog. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "dialogClass", optionValue: string): void; @@ -23187,6 +24730,7 @@ interface JQuery { * That can be reference to html element, jquery selector or jquery object. * By default the parent form of the original target element is used. If a form is not found, then the body is used. * Note: If the "position" of the container is not set or it is "static", then the position is set to "relative". + * */ igDialog(optionLiteral: 'option', optionName: "container"): any; @@ -23196,6 +24740,7 @@ interface JQuery { * By default the parent form of the original target element is used. If a form is not found, then the body is used. * Note: If the "position" of the container is not set or it is "static", then the position is set to "relative". * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "container", optionValue: any): void; @@ -23203,6 +24748,7 @@ interface JQuery { /** * Gets/Sets the initial height of the dialog in pixels for normal state.Besides numeric values, following units are supported: "px", "em" and "%". * In case of "%", the size of browser window is used and it has effect only on open action. + * */ igDialog(optionLiteral: 'option', optionName: "height"): number|string; @@ -23211,6 +24757,7 @@ interface JQuery { * /Sets the initial height of the dialog in pixels for normal state.Besides numeric values, following units are supported: "px", "em" and "%". * In case of "%", the size of browser window is used and it has effect only on open action. * + * * @optionValue New value to be set. */ @@ -23219,6 +24766,7 @@ interface JQuery { /** * Gets/Sets the initial width of the dialog in pixels for normal state.Besides numeric values, following units are supported: "px", "em" and "%". * In case of "%", the size of browser window is used and it has effect only on open action. + * */ igDialog(optionLiteral: 'option', optionName: "width"): number|string; @@ -23227,6 +24775,7 @@ interface JQuery { * /Sets the initial width of the dialog in pixels for normal state.Besides numeric values, following units are supported: "px", "em" and "%". * In case of "%", the size of browser window is used and it has effect only on open action. * + * * @optionValue New value to be set. */ @@ -23234,60 +24783,70 @@ interface JQuery { /** * Gets/Sets the minimal height of the dialog in normal state. + * */ igDialog(optionLiteral: 'option', optionName: "minHeight"): number; /** * /Sets the minimal height of the dialog in normal state. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "minHeight", optionValue: number): void; /** * Gets/Sets the minimal width of the dialog in normal state. + * */ igDialog(optionLiteral: 'option', optionName: "minWidth"): number; /** * /Sets the minimal width of the dialog in normal state. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "minWidth", optionValue: number): void; /** * Gets/Sets the maximal height of the dialog in normal state. Note: that option has effect only while resizing the dialog by the end user. + * */ igDialog(optionLiteral: 'option', optionName: "maxHeight"): number; /** * /Sets the maximal height of the dialog in normal state. Note: that option has effect only while resizing the dialog by the end user. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "maxHeight", optionValue: number): void; /** * Gets/Sets the maximal width of the dialog in normal state. Note: that option has effect only while resizing the dialog by the end user. + * */ igDialog(optionLiteral: 'option', optionName: "maxWidth"): number; /** * /Sets the maximal width of the dialog in normal state. Note: that option has effect only while resizing the dialog by the end user. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "maxWidth", optionValue: number): void; /** * Gets/Sets whether the dialog can be dragged by the user. + * */ igDialog(optionLiteral: 'option', optionName: "draggable"): boolean; /** * /Sets whether the dialog can be dragged by the user. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "draggable", optionValue: boolean): void; @@ -23295,6 +24854,7 @@ interface JQuery { /** * Gets/Sets the initial position of the dialog. That should be an object, which contains "top" and "left" members or an object * supported by jquery.position(param) method. Examples: { left: 100, top: 200 }, { my: "left top", at: "left top", offset: "100 200" } + * */ igDialog(optionLiteral: 'option', optionName: "position"): any; @@ -23302,66 +24862,77 @@ interface JQuery { * /Sets the initial position of the dialog. That should be an object, which contains "top" and "left" members or an object * supported by jquery.position(param) method. Examples: { left: 100, top: 200 }, { my: "left top", at: "left top", offset: "100 200" } * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "position", optionValue: any): void; /** * Gets/Sets whether the dialog can be resized by the user. + * */ igDialog(optionLiteral: 'option', optionName: "resizable"): boolean; /** * /Sets whether the dialog can be resized by the user. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "resizable", optionValue: boolean): void; /** * Gets/Sets the value for the tabIndex attribute applied to the main html element of the dialog. + * */ igDialog(optionLiteral: 'option', optionName: "tabIndex"): number; /** * /Sets the value for the tabIndex attribute applied to the main html element of the dialog. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "tabIndex", optionValue: number): void; /** * Gets/Sets the animation applied to the dialog when it is opened. That can be any object supported by the jquery show(param) method. + * */ igDialog(optionLiteral: 'option', optionName: "openAnimation"): any; /** * /Sets the animation applied to the dialog when it is opened. That can be any object supported by the jquery show(param) method. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "openAnimation", optionValue: any): void; /** * Gets/Sets the animation applied to the dialog when it is closed. That can be any object supported by the jquery hide(param) method. + * */ igDialog(optionLiteral: 'option', optionName: "closeAnimation"): any; /** * /Sets the animation applied to the dialog when it is closed. That can be any object supported by the jquery hide(param) method. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "closeAnimation", optionValue: any): void; /** * Gets/Sets the value of zIndex applied to the main html element of the dialog. If value is not set, then 1000 is used. + * */ igDialog(optionLiteral: 'option', optionName: "zIndex"): number; /** * /Sets the value of zIndex applied to the main html element of the dialog. If value is not set, then 1000 is used. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "zIndex", optionValue: number): void; @@ -23370,6 +24941,7 @@ interface JQuery { * Gets/Sets the modal state of the dialog. * If there are more than 1 modal igDialog, then the last opened dialog wins and becomes on the top. * Note: the modal functionality is not supported when the dialog is minimized or pinned, because that will trigger misbehavior. + * */ igDialog(optionLiteral: 'option', optionName: "modal"): boolean; @@ -23378,6 +24950,7 @@ interface JQuery { * If there are more than 1 modal igDialog, then the last opened dialog wins and becomes on the top. * Note: the modal functionality is not supported when the dialog is minimized or pinned, because that will trigger misbehavior. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "modal", optionValue: boolean): void; @@ -23388,6 +24961,7 @@ interface JQuery { * If that option is enabled, then focus and blur event handlers are added to all the child elements of the dialog. * If the dialog is modal or it can be maximized, then it is not recommended to disable that option. * If that option is modified after the igDialog was already created, then depending on current state of the dialog, it will be temporary closed-opened or opened-closed. + * */ igDialog(optionLiteral: 'option', optionName: "trackFocus"): boolean; @@ -23398,6 +24972,7 @@ interface JQuery { * If the dialog is modal or it can be maximized, then it is not recommended to disable that option. * If that option is modified after the igDialog was already created, then depending on current state of the dialog, it will be temporary closed-opened or opened-closed. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "trackFocus", optionValue: boolean): void; @@ -23490,24 +25065,28 @@ interface JQuery { /** * Gets/Sets the temporary value for src, which is used while changing the parent of the base element if it is an instance of IFRAME. That allows getting around possible JavaScript exceptions under IE. + * */ igDialog(optionLiteral: 'option', optionName: "temporaryUrl"): string; /** * /Sets the temporary value for src, which is used while changing the parent of the base element if it is an instance of IFRAME. That allows getting around possible JavaScript exceptions under IE. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "temporaryUrl", optionValue: string): void; /** * Gets/Sets the ability to adjust the state of the header depending on focused and not-focused states. Note: the "trackFocus" option should be enabled. + * */ igDialog(optionLiteral: 'option', optionName: "enableHeaderFocus"): boolean; /** * /Sets the ability to adjust the state of the header depending on focused and not-focused states. Note: the "trackFocus" option should be enabled. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "enableHeaderFocus", optionValue: boolean): void; @@ -23516,6 +25095,7 @@ interface JQuery { * Gets/Sets the processing of the double-click on the dialog-header.If this option is not false and dialog was minimized, then its state will be set to normal. * If this option is set to "auto" and showMaximizeButton is enabled or if this option is set to true, then the dialog will be maximized when it was in normal state, * and dialog-state will be set to normal if it was maximized. + * */ igDialog(optionLiteral: 'option', optionName: "enableDblclick"): any; @@ -23524,49 +25104,50 @@ interface JQuery { * If this option is set to "auto" and showMaximizeButton is enabled or if this option is set to true, then the dialog will be maximized when it was in normal state, * and dialog-state will be set to normal if it was maximized. * + * * @optionValue New value to be set. */ igDialog(optionLiteral: 'option', optionName: "enableDblclick", optionValue: any): void; /** - * Event which is raised before the state of dialog was changed. - * Return false in order to cancel action. + * Set/Get the locale language setting for the widget. * - * The function takes arguments "evt" and "ui". - * Use evt to obtain the browser event. That parameter can be null if the state was modified from the code. - * Use ui.owner to obtain a reference to the igDialog. - * Use ui.button to obtain the name of the button, which triggered the event. Note: if the state was modified from the code, then "button" is undefined. - * Use ui.oldState to obtain the old state of the dialog, which can be one of the following: "opened", "minimized", "maximized", "closed". - * Use ui.oldPinned to obtain the boolean value of the old pin state of the dialog. - * Use ui.action to obtain the name of the action. That can be one of the following: - * "open" - request to open the dialog - * "close" - request to close the dialog - * "minimize" - request to minimize the dialog - * "maximize" - request to maximize the dialog - * "restore" - request to restore the dialog from minimized or maximized state - * "pin" - request to pin the dialog - * "unpin" - request to unpin the dialog + */ + igDialog(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igDialog(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igDialog(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igDialog(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + + /** + * Event which is raised before the state of the dialog was changed. + * Return false in order to cancel the action. */ igDialog(optionLiteral: 'option', optionName: "stateChanging"): StateChangingEvent; /** - * Event which is raised before the state of dialog was changed. - * Return false in order to cancel action. - * - * The function takes arguments "evt" and "ui". - * Use evt to obtain the browser event. That parameter can be null if the state was modified from the code. - * Use ui.owner to obtain a reference to the igDialog. - * Use ui.button to obtain the name of the button, which triggered the event. Note: if the state was modified from the code, then "button" is undefined. - * Use ui.oldState to obtain the old state of the dialog, which can be one of the following: "opened", "minimized", "maximized", "closed". - * Use ui.oldPinned to obtain the boolean value of the old pin state of the dialog. - * Use ui.action to obtain the name of the action. That can be one of the following: - * "open" - request to open the dialog - * "close" - request to close the dialog - * "minimize" - request to minimize the dialog - * "maximize" - request to maximize the dialog - * "restore" - request to restore the dialog from minimized or maximized state - * "pin" - request to pin the dialog - * "unpin" - request to unpin the dialog + * Event which is raised before the state of the dialog was changed. + * Return false in order to cancel the action. * * @optionValue Define event handler function. */ @@ -23574,65 +25155,23 @@ interface JQuery { /** * Event which is raised after the state of the dialog was changed. - * - * The function takes arguments "evt" and "ui". - * Use evt to obtain the browser event. That parameter can be null if the state was modified from the code. - * Use ui.owner to obtain a reference to the igDialog. - * Use ui.button to obtain the name of the button, which triggered the event. Note: if the state was modified from the code, then "button" is undefined. - * Use ui.oldState to obtain the old state of the dialog, which can be one of the following: "opened", "minimized", "maximized", "closed". - * Use ui.oldPinned to obtain the boolean value of the old pin state of the dialog. - * Use ui.action to obtain the name of the action. That can be one of the following: - * "open" - the dialog was opened. Note: the event is raised before a possible "openAnimation" started. - * "close" - the dialog was closed. Note: the event is raised before a possible "closeAnimation" started. - * "minimize" - the dialog was minimized - * "maximize" - the dialog was maximized - * "restore" - the dialog was restored from minimized or maximized state - * "pin" - the dialog was pinned - * "unpin" - the dialog was unpinned */ igDialog(optionLiteral: 'option', optionName: "stateChanged"): StateChangedEvent; /** * Event which is raised after the state of the dialog was changed. * - * The function takes arguments "evt" and "ui". - * Use evt to obtain the browser event. That parameter can be null if the state was modified from the code. - * Use ui.owner to obtain a reference to the igDialog. - * Use ui.button to obtain the name of the button, which triggered the event. Note: if the state was modified from the code, then "button" is undefined. - * Use ui.oldState to obtain the old state of the dialog, which can be one of the following: "opened", "minimized", "maximized", "closed". - * Use ui.oldPinned to obtain the boolean value of the old pin state of the dialog. - * Use ui.action to obtain the name of the action. That can be one of the following: - * "open" - the dialog was opened. Note: the event is raised before a possible "openAnimation" started. - * "close" - the dialog was closed. Note: the event is raised before a possible "closeAnimation" started. - * "minimize" - the dialog was minimized - * "maximize" - the dialog was maximized - * "restore" - the dialog was restored from minimized or maximized state - * "pin" - the dialog was pinned - * "unpin" - the dialog was unpinned - * * @optionValue Define event handler function. */ igDialog(optionLiteral: 'option', optionName: "stateChanged", optionValue: StateChangedEvent): void; /** - * Event which is raised after the end of the animation when the dialod was closed or opened. - * - * The function takes arguments "evt" and "ui". - * Use ui.owner to obtain a reference to the igDialog. - * Use ui.action to obtain the name of the action, which triggered the animation. - * "open" - the dialog was opened - * "close" - the dialog was closed + * Event which is raised after the end of the animation when the dialog was closed or opened. */ igDialog(optionLiteral: 'option', optionName: "animationEnded"): AnimationEndedEvent; /** - * Event which is raised after the end of the animation when the dialod was closed or opened. - * - * The function takes arguments "evt" and "ui". - * Use ui.owner to obtain a reference to the igDialog. - * Use ui.action to obtain the name of the action, which triggered the animation. - * "open" - the dialog was opened - * "close" - the dialog was closed + * Event which is raised after the end of the animation when the dialog was closed or opened. * * @optionValue Define event handler function. */ @@ -23640,40 +25179,24 @@ interface JQuery { /** * Event which is raised when the dialog or its content gets focus. - * - * The function takes arguments "evt" and "ui". - * Use evt to obtain the browser event. - * Use ui.owner to obtain a reference to the igDialog. */ igDialog(optionLiteral: 'option', optionName: "focus"): IgFocusEvent; /** * Event which is raised when the dialog or its content gets focus. * - * The function takes arguments "evt" and "ui". - * Use evt to obtain the browser event. - * Use ui.owner to obtain a reference to the igDialog. - * * @optionValue Define event handler function. */ igDialog(optionLiteral: 'option', optionName: "focus", optionValue: IgFocusEvent): void; /** * Event which is raised when the dialog or its content loses focus. - * - * The function takes arguments "evt" and "ui". - * Use evt to obtain the browser event. - * Use ui.owner to obtain a reference to the igDialog. */ igDialog(optionLiteral: 'option', optionName: "blur"): BlurEvent; /** * Event which is raised when the dialog or its content loses focus. * - * The function takes arguments "evt" and "ui". - * Use evt to obtain the browser event. - * Use ui.owner to obtain a reference to the igDialog. - * * @optionValue Define event handler function. */ igDialog(optionLiteral: 'option', optionName: "blur", optionValue: BlurEvent): void; @@ -23683,968 +25206,18 @@ interface JQuery { igDialog(optionLiteral: 'option', optionName: string, optionValue: any): JQuery; igDialog(methodName: string, ...methodParams: any[]): any; } -interface IgDoughnutChartSeries { - /** - * Gets or sets the current series type. - * - * Valid values: - * "flat" Series has flat 1-dimensional data. - */ - type?: string; - - /** - * Whether the series should render a tooltip. - */ - showTooltip?: boolean; - - /** - * The name of template or the template itself that chart tooltip will use to render. - */ - tooltipTemplate?: string; - - /** - * Gets or sets the data source for the chart. - */ - itemsSource?: any; - - /** - * Gets or Sets the property name that contains the values. - */ - valueMemberPath?: string; - - /** - * Gets or sets the property name that contains the labels. - */ - labelMemberPath?: string; - - /** - * Gets or sets the property name that contains the legend labels. - */ - legendLabelMemberPath?: string; - - /** - * Gets or sets the position of chart labels. - * - * Valid values: - * "none" No labels will be displayed. - * "center" Labels will be displayed in the center. - * "insideEnd" Labels will be displayed inside and by the edge of the container. - * "outsideEnd" Labels will be displayed outside the container. - * "bestFit" Labels will automatically decide their location. - */ - labelsPosition?: string; - - /** - * Gets or sets whether the leader lines are visible. - * - * Valid values: - * "visible" Display the element. - * "collapsed" Do not display the element. - */ - leaderLineVisibility?: string; - - /** - * Gets or sets the style for the leader lines. - */ - leaderLineStyle?: any; - - /** - * Gets or sets what type of leader lines will be used for the outside end labels. - * - * Valid values: - * "straight" A straight line is drawn between the slice and its label. - * "arc" A curved line is drawn between the slice and its label. The line follows makes a natural turn from the slice to the label. - * "spline" A curved line is drawn between the slice and its label. The line starts radially from the slice and then turns to the label. - */ - leaderLineType?: string; - - /** - * Gets or sets the margin between a label and its leader line. The default is 6 pixels. - */ - leaderLineMargin?: number; - - /** - * Gets or sets the threshold value that determines if slices are grouped into the Others slice. - */ - othersCategoryThreshold?: number; - - /** - * Gets or sets whether to use numeric or percent-based threshold value. - * - * Valid values: - * "number" Data value is compared directly to the value of OthersCategoryThreshold. - * "percent" Data value is compared to OthersCategoryThreshold as a percentage of the total. - */ - othersCategoryType?: string; - - /** - * Gets or sets the label of the Others slice. - */ - othersCategoryText?: string; - - /** - * Gets or sets the legend used for the current chart. - */ - legend?: any; - - /** - * Sets or gets a function which takes an object that produces a formatted label for displaying in the chart. - */ - formatLabel?: any; - - /** - * Sets or gets a function which takes an object that produces a formatted label for displaying in the chart's legend. - */ - formatLegendLabel?: any; - - /** - * Gets or sets the pixel amount by which the labels are offset from the edge of the slices. - */ - labelExtent?: number; - - /** - * Gets or sets the starting angle of the chart. - * The default zero value is equivalent to 3 o'clock. - */ - startAngle?: number; - - /** - * Gets or sets the style used when a slice is selected. - */ - selectedStyle?: any; - - /** - * Gets or sets the palette of brushes to use for coloring the slices. - * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. - */ - brushes?: any; - - /** - * Gets or sets the palette of brushes to use for outlines on the slices. - * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. - */ - outlines?: any; - - /** - * Gets or sets whether all surface interactions with the plot area should be disabled. - */ - isSurfaceInteractionDisabled?: any; - - /** - * Gets or sets the scaling factor of the chart's radius. Value between 0 and 1. - */ - radiusFactor?: number; - - /** - * Option for IgDoughnutChartSeries - */ - [optionName: string]: any; -} - -interface HoleDimensionsChangedEvent { - (event: Event, ui: HoleDimensionsChangedEventUIParam): void; -} - -interface HoleDimensionsChangedEventUIParam {} - -interface IgDoughnutChart { - /** - * The width of the chart. It can be set as a number in pixels, string (px) or percentage (%). - */ - width?: string|number; - - /** - * The height of the chart. It can be set as a number in pixels, string (px) or percentage (%). - */ - height?: string|number; - - /** - * An array of series objects. - */ - series?: IgDoughnutChartSeries[]; - - /** - * Gets or sets whether the slices can be selected. - */ - allowSliceSelection?: boolean; - - /** - * Gets or sets whether all surface interactions with the plot area should be disabled. - */ - isSurfaceInteractionDisabled?: any; - - /** - * Gets or sets whether the slices can be exploded. - */ - allowSliceExplosion?: boolean; - - /** - * Gets or sets the inner extent of the doughnut chart. It is percent from the outer ring's radius. - */ - innerExtent?: number; - - /** - * Gets or sets the style used when a slice is selected. - */ - selectedStyle?: any; - - /** - * Gets sets template for tooltip associated with chart item. - * Example: "Value: $(ValueMemberPathInDataSource)" - */ - tooltipTemplate?: string; - - /** - * Gets sets maximum number of displayed records in chart. - */ - maxRecCount?: number; - - /** - * Gets sets a valid data source. - * That can be instance of array or primitives, array of objects, instance of $.ig.DataSource, or any other data accepted by $.ig.DataSource. - * Note: if it is set to string and "dataSourceType" option is not set, then $.ig.JSONPDataSource is used. - */ - dataSource?: any; - - /** - * Gets sets data source type (such as "json", "xml", etc). Please refer to the documentation of $.ig.DataSource and its type property - */ - dataSourceType?: string; - - /** - * Gets sets url which is used for sending JSON on request for remote data. - */ - dataSourceUrl?: string; - - /** - * See $.ig.DataSource. property in the response specifying the total number of records on the server. - */ - responseTotalRecCountKey?: string; - - /** - * See $.ig.DataSource. This is basically the property in the responses where data records are held, if the response is wrapped. - */ - responseDataKey?: string; - - /** - * Event fired when the mouse has hovered on a series and the tooltip is about to show - * Function takes arguments evt and ui. - * Use ui.element to get reference to tooltip DOM element. - * Use ui.item to get reference to current series item object. - * Use ui.chart to get reference to chart object. - * Use ui.series to get reference to current series object. - * Use ui.actualItemBrush to get item brush. - * Use ui.actualSeriesBrush to get series brush. - */ - tooltipShowing?: TooltipShowingEvent; - - /** - * Event fired after a tooltip is shown - * Function takes arguments evt and ui. - * Use ui.element to get reference to tooltip DOM element. - * Use ui.item to get reference to current series item object. - * Use ui.chart to get reference to chart object. - * Use ui.series to get reference to current series object. - * Use ui.actualItemBrush to get item brush. - * Use ui.actualSeriesBrush to get series brush. - */ - tooltipShown?: TooltipShownEvent; - - /** - * Event fired when the mouse has left a series and the tooltip is about to hide - * Function takes arguments evt and ui. - * Use ui.element to get reference to tooltip DOM element. - * Use ui.item to get reference to current series item object. - * Use ui.chart to get reference to chart object. - * Use ui.series to get reference to current series object. - * Use ui.actualItemBrush to get item brush. - * Use ui.actualSeriesBrush to get series brush. - */ - tooltipHiding?: TooltipHidingEvent; - - /** - * Event fired after a tooltip is hidden - * Function takes arguments evt and ui. - * Use ui.element to get reference to tooltip DOM element. - * Use ui.item to get reference to current series item object. - * Use ui.chart to get reference to chart object. - * Use ui.series to get reference to current series object. - * Use ui.actualItemBrush to get item brush. - * Use ui.actualSeriesBrush to get series brush. - */ - tooltipHidden?: TooltipHiddenEvent; - - /** - * Event fired when the control is displayed on a non HTML5 compliant browser - */ - browserNotSupported?: BrowserNotSupportedEvent; - - /** - * Raised when the slice is clicked. - */ - sliceClick?: SliceClickEvent; - - /** - * Raised when the dimensions (center point or radius) of the doughnut hole change. - */ - holeDimensionsChanged?: HoleDimensionsChangedEvent; - - /** - * Event which is raised before data binding. - * Return false in order to cancel data binding. - * Function takes first argument null and second argument ui. - * Use ui.owner to obtain reference to chart widget. - * Use ui.dataSource to obtain reference to instance of $.ig.DataSource. - */ - dataBinding?: DataBindingEvent; - - /** - * Event which is raised after data binding. - * Function takes first argument null and second argument ui. - * Use ui.owner to obtain reference to chart widget. - * Use ui.data to obtain reference to array actual data which is displayed by chart. - * Use ui.dataSource to obtain reference to instance of $.ig.DataSource. - */ - dataBound?: DataBoundEvent; - - /** - * Event which is raised before tooltip is updated. - * Return false in order to cancel updating and hide tooltip. - * Function takes first argument null and second argument ui. - * Use ui.owner to obtain reference to chart widget. - * Use ui.text to obtain html of tooltip. Value of that member can be modified. If modified value is null or empty string, then current content of tooltip keeps old value. - * Use ui.item to obtain reference to item. Value of that member can be modified or replaced by custom item. - * Use ui.x to obtain left position of tooltip in pixels relative to widget. Value of that member can be modified. - * Use ui.y to obtain top position of tooltip in pixels relative to widget. Value of that member can be modified. - * Use ui.element to obtain reference to jquery object which represents tooltip. Value of that member can be replaced by custom element. - */ - updateTooltip?: UpdateTooltipEvent; - - /** - * Event which is raised before tooltip is hidden. - * Return false in order to cancel hiding and keep tooltip visible. - * Function takes first argument null and second argument ui. - * Use ui.owner to obtain reference to chart widget. - * Use ui.item to obtain reference to item. - * Use ui.element to obtain reference to jquery object which represents tooltip or value of ui.element from last updateTooltip event. Value of that member can be replaced by custom element. - */ - hideTooltip?: HideTooltipEvent; - - /** - * Option for igDoughnutChart - */ - [optionName: string]: any; -} -interface IgDoughnutChartMethods { - /** - * Adds a new series to the doughnut chart. - * - * @param seriesObj The series object to be added. - */ - addSeries(seriesObj: Object): void; - - /** - * Removes the specified series from the doughnut chart. - * - * @param seriesObj The series object identifying the series to be removed. - */ - removeSeries(seriesObj: Object): void; - - /** - * Updates the series with the specified name with the specified new property values. - * - * @param value The series object identifying the series to be updated. - */ - updateSeries(value: Object): void; - - /** - * Returns the center of the doughnut chart. - */ - getCenterCoordinates(): Object; - - /** - * Returns the radius of the chart's hole. - */ - getHoleRadius(): number; - - /** - * Returns information about how the doughnut chart is rendered. - */ - exportVisualData(): Object; - - /** - * Causes all of the series that have pending changes e.g. by changed property values to be rendered immediately. - */ - flush(): void; - - /** - * Destroys the widget. - */ - destroy(): void; - - /** - * Returns data source of the series. - * - * @param series Optional. The series name. If not provided an array of series data sources is returned. - */ - getData(series: string): Object; - - /** - * Find index of item within actual data used by chart. - * - * @param item The reference to item. - */ - findIndexOfItem(item: Object): number; - - /** - * Get item within actual data used by chart. That is similar to this.getData()[ index ]. - * - * @param index Index of data item. - */ - getDataItem(index: Object): Object; - - /** - * Adds a new item to the data source and notifies the chart. - * - * @param item The item that we want to add to the data source. - */ - addItem(item: Object): Object; - - /** - * Inserts a new item to the data source and notifies the chart. - * - * @param item the new item that we want to insert in the data source. - * @param index The index in the data source where the new item will be inserted. - */ - insertItem(item: Object, index: number): Object; - - /** - * Deletes an item from the data source and notifies the chart. - * - * @param index The index in the data source from where the item will be been removed. - */ - removeItem(index: number): Object; - - /** - * Updates an item in the data source and notifies the chart. - * - * @param index The index of the item in the data source that we want to change. - * @param item The new item object that will be set in the data source. - */ - setItem(index: number, item: Object): Object; - - /** - * Notifies the chart that an item has been set in an associated data source. - * - * @param dataSource The data source in which the change happened. - * @param index The index in the items source that has been changed. - * @param newItem the new item that has been set in the collection. - * @param oldItem the old item that has been overwritten in the collection. - */ - notifySetItem(dataSource: Object, index: number, newItem: Object, oldItem: Object): Object; - - /** - * Notifies the chart that the items have been cleared from an associated data source. - * It's not necessary to notify more than one target of a change if they share the same items source. - * - * @param dataSource The data source in which the change happened. - */ - notifyClearItems(dataSource: Object): Object; - - /** - * Notifies the target axis or series that an item has been inserted at the specified index in its data source. - * It's not necessary to notify more than one target of a change if they share the same items source. - * - * @param dataSource The data source in which the change happened. - * @param index The index in the items source where the new item has been inserted. - * @param newItem the new item that has been set in the collection. - */ - notifyInsertItem(dataSource: Object, index: number, newItem: Object): Object; - - /** - * Notifies the target axis or series that an item has been removed from the specified index in its data source. - * It's not necessary to notify more than one target of a change if they share the same items source. - * - * @param dataSource The data source in which the change happened. - * @param index The index in the items source from where the old item has been removed. - * @param oldItem the old item that has been removed from the collection. - */ - notifyRemoveItem(dataSource: Object, index: number, oldItem: Object): Object; - - /** - * Get reference to chart object. - */ - chart(): Object; - - /** - * Binds data to the chart - */ - dataBind(): void; -} -interface JQuery { - data(propertyName: "igDoughnutChart"): IgDoughnutChartMethods; -} - -interface JQuery { - igDoughnutChart(methodName: "addSeries", seriesObj: Object): void; - igDoughnutChart(methodName: "removeSeries", seriesObj: Object): void; - igDoughnutChart(methodName: "updateSeries", value: Object): void; - igDoughnutChart(methodName: "getCenterCoordinates"): Object; - igDoughnutChart(methodName: "getHoleRadius"): number; - igDoughnutChart(methodName: "exportVisualData"): Object; - igDoughnutChart(methodName: "flush"): void; - igDoughnutChart(methodName: "destroy"): void; - igDoughnutChart(methodName: "getData", series: string): Object; - igDoughnutChart(methodName: "findIndexOfItem", item: Object): number; - igDoughnutChart(methodName: "getDataItem", index: Object): Object; - igDoughnutChart(methodName: "addItem", item: Object): Object; - igDoughnutChart(methodName: "insertItem", item: Object, index: number): Object; - igDoughnutChart(methodName: "removeItem", index: number): Object; - igDoughnutChart(methodName: "setItem", index: number, item: Object): Object; - igDoughnutChart(methodName: "notifySetItem", dataSource: Object, index: number, newItem: Object, oldItem: Object): Object; - igDoughnutChart(methodName: "notifyClearItems", dataSource: Object): Object; - igDoughnutChart(methodName: "notifyInsertItem", dataSource: Object, index: number, newItem: Object): Object; - igDoughnutChart(methodName: "notifyRemoveItem", dataSource: Object, index: number, oldItem: Object): Object; - igDoughnutChart(methodName: "chart"): Object; - igDoughnutChart(methodName: "dataBind"): void; - - /** - * The width of the chart. It can be set as a number in pixels, string (px) or percentage (%). - */ - - igDoughnutChart(optionLiteral: 'option', optionName: "width"): string|number; - - /** - * The width of the chart. It can be set as a number in pixels, string (px) or percentage (%). - * - * @optionValue New value to be set. - */ - - igDoughnutChart(optionLiteral: 'option', optionName: "width", optionValue: string|number): void; - - /** - * The height of the chart. It can be set as a number in pixels, string (px) or percentage (%). - */ - - igDoughnutChart(optionLiteral: 'option', optionName: "height"): string|number; - - /** - * The height of the chart. It can be set as a number in pixels, string (px) or percentage (%). - * - * @optionValue New value to be set. - */ - - igDoughnutChart(optionLiteral: 'option', optionName: "height", optionValue: string|number): void; - - /** - * An array of series objects. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "series"): IgDoughnutChartSeries[]; - - /** - * An array of series objects. - * - * @optionValue New value to be set. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "series", optionValue: IgDoughnutChartSeries[]): void; - - /** - * Gets whether the slices can be selected. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "allowSliceSelection"): boolean; - - /** - * Sets whether the slices can be selected. - * - * @optionValue New value to be set. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "allowSliceSelection", optionValue: boolean): void; - - /** - * Gets whether all surface interactions with the plot area should be disabled. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "isSurfaceInteractionDisabled"): any; - - /** - * Sets whether all surface interactions with the plot area should be disabled. - * - * @optionValue New value to be set. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "isSurfaceInteractionDisabled", optionValue: any): void; - - /** - * Gets whether the slices can be exploded. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "allowSliceExplosion"): boolean; - - /** - * Sets whether the slices can be exploded. - * - * @optionValue New value to be set. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "allowSliceExplosion", optionValue: boolean): void; - - /** - * Gets the inner extent of the doughnut chart. It is percent from the outer ring's radius. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "innerExtent"): number; - - /** - * Sets the inner extent of the doughnut chart. It is percent from the outer ring's radius. - * - * @optionValue New value to be set. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "innerExtent", optionValue: number): void; - - /** - * Gets the style used when a slice is selected. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "selectedStyle"): any; - - /** - * Sets the style used when a slice is selected. - * - * @optionValue New value to be set. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "selectedStyle", optionValue: any): void; - - /** - * Gets template for tooltip associated with chart item. - * Example: "Value: $(ValueMemberPathInDataSource)" - */ - igDoughnutChart(optionLiteral: 'option', optionName: "tooltipTemplate"): string; - - /** - * Sets template for tooltip associated with chart item. - * Example: "Value: $(ValueMemberPathInDataSource)" - * - * @optionValue New value to be set. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "tooltipTemplate", optionValue: string): void; - - /** - * Gets maximum number of displayed records in chart. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "maxRecCount"): number; - - /** - * Sets maximum number of displayed records in chart. - * - * @optionValue New value to be set. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "maxRecCount", optionValue: number): void; - - /** - * Gets a valid data source. - * That can be instance of array or primitives, array of objects, instance of $.ig.DataSource, or any other data accepted by $.ig.DataSource. - * Note: if it is set to string and "dataSourceType" option is not set, then $.ig.JSONPDataSource is used. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "dataSource"): any; - - /** - * Sets a valid data source. - * That can be instance of array or primitives, array of objects, instance of $.ig.DataSource, or any other data accepted by $.ig.DataSource. - * Note: if it is set to string and "dataSourceType" option is not set, then $.ig.JSONPDataSource is used. - * - * @optionValue New value to be set. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "dataSource", optionValue: any): void; - - /** - * Gets data source type (such as "json", "xml", etc). Please refer to the documentation of $.ig.DataSource and its type property - */ - igDoughnutChart(optionLiteral: 'option', optionName: "dataSourceType"): string; - - /** - * Sets data source type (such as "json", "xml", etc). Please refer to the documentation of $.ig.DataSource and its type property - * - * @optionValue New value to be set. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "dataSourceType", optionValue: string): void; - - /** - * Gets url which is used for sending JSON on request for remote data. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "dataSourceUrl"): string; - - /** - * Sets url which is used for sending JSON on request for remote data. - * - * @optionValue New value to be set. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "dataSourceUrl", optionValue: string): void; - - /** - * See $.ig.DataSource. property in the response specifying the total number of records on the server. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "responseTotalRecCountKey"): string; - - /** - * See $.ig.DataSource. property in the response specifying the total number of records on the server. - * - * @optionValue New value to be set. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "responseTotalRecCountKey", optionValue: string): void; - - /** - * See $.ig.DataSource. This is basically the property in the responses where data records are held, if the response is wrapped. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "responseDataKey"): string; - - /** - * See $.ig.DataSource. This is basically the property in the responses where data records are held, if the response is wrapped. - * - * @optionValue New value to be set. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "responseDataKey", optionValue: string): void; - - /** - * Event fired when the mouse has hovered on a series and the tooltip is about to show - * Function takes arguments evt and ui. - * Use ui.element to get reference to tooltip DOM element. - * Use ui.item to get reference to current series item object. - * Use ui.chart to get reference to chart object. - * Use ui.series to get reference to current series object. - * Use ui.actualItemBrush to get item brush. - * Use ui.actualSeriesBrush to get series brush. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "tooltipShowing"): TooltipShowingEvent; - - /** - * Event fired when the mouse has hovered on a series and the tooltip is about to show - * Function takes arguments evt and ui. - * Use ui.element to get reference to tooltip DOM element. - * Use ui.item to get reference to current series item object. - * Use ui.chart to get reference to chart object. - * Use ui.series to get reference to current series object. - * Use ui.actualItemBrush to get item brush. - * Use ui.actualSeriesBrush to get series brush. - * - * @optionValue Define event handler function. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "tooltipShowing", optionValue: TooltipShowingEvent): void; - - /** - * Event fired after a tooltip is shown - * Function takes arguments evt and ui. - * Use ui.element to get reference to tooltip DOM element. - * Use ui.item to get reference to current series item object. - * Use ui.chart to get reference to chart object. - * Use ui.series to get reference to current series object. - * Use ui.actualItemBrush to get item brush. - * Use ui.actualSeriesBrush to get series brush. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "tooltipShown"): TooltipShownEvent; - - /** - * Event fired after a tooltip is shown - * Function takes arguments evt and ui. - * Use ui.element to get reference to tooltip DOM element. - * Use ui.item to get reference to current series item object. - * Use ui.chart to get reference to chart object. - * Use ui.series to get reference to current series object. - * Use ui.actualItemBrush to get item brush. - * Use ui.actualSeriesBrush to get series brush. - * - * @optionValue Define event handler function. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "tooltipShown", optionValue: TooltipShownEvent): void; - - /** - * Event fired when the mouse has left a series and the tooltip is about to hide - * Function takes arguments evt and ui. - * Use ui.element to get reference to tooltip DOM element. - * Use ui.item to get reference to current series item object. - * Use ui.chart to get reference to chart object. - * Use ui.series to get reference to current series object. - * Use ui.actualItemBrush to get item brush. - * Use ui.actualSeriesBrush to get series brush. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "tooltipHiding"): TooltipHidingEvent; - - /** - * Event fired when the mouse has left a series and the tooltip is about to hide - * Function takes arguments evt and ui. - * Use ui.element to get reference to tooltip DOM element. - * Use ui.item to get reference to current series item object. - * Use ui.chart to get reference to chart object. - * Use ui.series to get reference to current series object. - * Use ui.actualItemBrush to get item brush. - * Use ui.actualSeriesBrush to get series brush. - * - * @optionValue Define event handler function. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "tooltipHiding", optionValue: TooltipHidingEvent): void; - - /** - * Event fired after a tooltip is hidden - * Function takes arguments evt and ui. - * Use ui.element to get reference to tooltip DOM element. - * Use ui.item to get reference to current series item object. - * Use ui.chart to get reference to chart object. - * Use ui.series to get reference to current series object. - * Use ui.actualItemBrush to get item brush. - * Use ui.actualSeriesBrush to get series brush. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "tooltipHidden"): TooltipHiddenEvent; - - /** - * Event fired after a tooltip is hidden - * Function takes arguments evt and ui. - * Use ui.element to get reference to tooltip DOM element. - * Use ui.item to get reference to current series item object. - * Use ui.chart to get reference to chart object. - * Use ui.series to get reference to current series object. - * Use ui.actualItemBrush to get item brush. - * Use ui.actualSeriesBrush to get series brush. - * - * @optionValue Define event handler function. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "tooltipHidden", optionValue: TooltipHiddenEvent): void; - - /** - * Event fired when the control is displayed on a non HTML5 compliant browser - */ - igDoughnutChart(optionLiteral: 'option', optionName: "browserNotSupported"): BrowserNotSupportedEvent; - - /** - * Event fired when the control is displayed on a non HTML5 compliant browser - * - * @optionValue Define event handler function. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "browserNotSupported", optionValue: BrowserNotSupportedEvent): void; - - /** - * Raised when the slice is clicked. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "sliceClick"): SliceClickEvent; - - /** - * Raised when the slice is clicked. - * - * @optionValue New value to be set. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "sliceClick", optionValue: SliceClickEvent): void; - - /** - * Raised when the dimensions (center point or radius) of the doughnut hole change. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "holeDimensionsChanged"): HoleDimensionsChangedEvent; - - /** - * Raised when the dimensions (center point or radius) of the doughnut hole change. - * - * @optionValue New value to be set. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "holeDimensionsChanged", optionValue: HoleDimensionsChangedEvent): void; - - /** - * Event which is raised before data binding. - * Return false in order to cancel data binding. - * Function takes first argument null and second argument ui. - * Use ui.owner to obtain reference to chart widget. - * Use ui.dataSource to obtain reference to instance of $.ig.DataSource. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "dataBinding"): DataBindingEvent; - - /** - * Event which is raised before data binding. - * Return false in order to cancel data binding. - * Function takes first argument null and second argument ui. - * Use ui.owner to obtain reference to chart widget. - * Use ui.dataSource to obtain reference to instance of $.ig.DataSource. - * - * @optionValue Define event handler function. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "dataBinding", optionValue: DataBindingEvent): void; - - /** - * Event which is raised after data binding. - * Function takes first argument null and second argument ui. - * Use ui.owner to obtain reference to chart widget. - * Use ui.data to obtain reference to array actual data which is displayed by chart. - * Use ui.dataSource to obtain reference to instance of $.ig.DataSource. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "dataBound"): DataBoundEvent; - - /** - * Event which is raised after data binding. - * Function takes first argument null and second argument ui. - * Use ui.owner to obtain reference to chart widget. - * Use ui.data to obtain reference to array actual data which is displayed by chart. - * Use ui.dataSource to obtain reference to instance of $.ig.DataSource. - * - * @optionValue Define event handler function. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "dataBound", optionValue: DataBoundEvent): void; - - /** - * Event which is raised before tooltip is updated. - * Return false in order to cancel updating and hide tooltip. - * Function takes first argument null and second argument ui. - * Use ui.owner to obtain reference to chart widget. - * Use ui.text to obtain html of tooltip. Value of that member can be modified. If modified value is null or empty string, then current content of tooltip keeps old value. - * Use ui.item to obtain reference to item. Value of that member can be modified or replaced by custom item. - * Use ui.x to obtain left position of tooltip in pixels relative to widget. Value of that member can be modified. - * Use ui.y to obtain top position of tooltip in pixels relative to widget. Value of that member can be modified. - * Use ui.element to obtain reference to jquery object which represents tooltip. Value of that member can be replaced by custom element. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "updateTooltip"): UpdateTooltipEvent; - - /** - * Event which is raised before tooltip is updated. - * Return false in order to cancel updating and hide tooltip. - * Function takes first argument null and second argument ui. - * Use ui.owner to obtain reference to chart widget. - * Use ui.text to obtain html of tooltip. Value of that member can be modified. If modified value is null or empty string, then current content of tooltip keeps old value. - * Use ui.item to obtain reference to item. Value of that member can be modified or replaced by custom item. - * Use ui.x to obtain left position of tooltip in pixels relative to widget. Value of that member can be modified. - * Use ui.y to obtain top position of tooltip in pixels relative to widget. Value of that member can be modified. - * Use ui.element to obtain reference to jquery object which represents tooltip. Value of that member can be replaced by custom element. - * - * @optionValue Define event handler function. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "updateTooltip", optionValue: UpdateTooltipEvent): void; - - /** - * Event which is raised before tooltip is hidden. - * Return false in order to cancel hiding and keep tooltip visible. - * Function takes first argument null and second argument ui. - * Use ui.owner to obtain reference to chart widget. - * Use ui.item to obtain reference to item. - * Use ui.element to obtain reference to jquery object which represents tooltip or value of ui.element from last updateTooltip event. Value of that member can be replaced by custom element. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "hideTooltip"): HideTooltipEvent; - - /** - * Event which is raised before tooltip is hidden. - * Return false in order to cancel hiding and keep tooltip visible. - * Function takes first argument null and second argument ui. - * Use ui.owner to obtain reference to chart widget. - * Use ui.item to obtain reference to item. - * Use ui.element to obtain reference to jquery object which represents tooltip or value of ui.element from last updateTooltip event. Value of that member can be replaced by custom element. - * - * @optionValue Define event handler function. - */ - igDoughnutChart(optionLiteral: 'option', optionName: "hideTooltip", optionValue: HideTooltipEvent): void; - igDoughnutChart(options: IgDoughnutChart): JQuery; - igDoughnutChart(optionLiteral: 'option', optionName: string): any; - igDoughnutChart(optionLiteral: 'option', options: IgDoughnutChart): JQuery; - igDoughnutChart(optionLiteral: 'option', optionName: string, optionValue: any): JQuery; - igDoughnutChart(methodName: string, ...methodParams: any[]): any; -} interface RenderingEvent { (event: Event, ui: RenderingEventUIParam): void; } interface RenderingEventUIParam { /** - * Used to get a reference to the editor performing rendering. + * Gets a reference to the editor performing rendering. */ owner?: any; /** - * Used to get a reference to the editor element. + * Gets a reference to the editor element. */ element?: any; } @@ -24655,17 +25228,17 @@ interface MousedownEvent { interface MousedownEventUIParam { /** - * Used to obtain reference to igEditor. + * Gets a reference to the editor. */ owner?: any; /** - * Used to obtain a reference to the event target. + * Gets a reference to the event target. */ element?: any; /** - * Used torInput to get a reference to the editor field. + * Gets a reference to the editor input field. */ editorInput?: any; } @@ -24676,17 +25249,17 @@ interface MouseupEvent { interface MouseupEventUIParam { /** - * Used to obtain reference to igEditor. + * Gets a reference to the editor. */ owner?: any; /** - * Used to obtain a reference to the event target. + * Gets a reference to the event target. */ element?: any; /** - * Used torInput to get a reference to the editor field. + * Gets a reference to the editor input field. */ editorInput?: any; } @@ -24697,17 +25270,17 @@ interface MousemoveEvent { interface MousemoveEventUIParam { /** - * Used to obtain reference to igEditor. + * Gets a reference to the editor. */ owner?: any; /** - * Used to obtain a reference to the event target. + * Gets a reference to the event target. */ element?: any; /** - * Used torInput to get a reference to the editor field. + * Gets a reference to the editor input field. */ editorInput?: any; } @@ -24718,19 +25291,24 @@ interface MouseoverEvent { interface MouseoverEventUIParam { /** - * Used to obtain reference to igEditor. + * Gets a reference to the editor. */ owner?: any; /** - * Used to obtain a reference to the event target. + * Gets a reference to the event target. */ element?: any; /** - * Used torInput to get a reference to the editor field. + * Gets a reference to the editor input field. */ editorInput?: any; + + /** + * Gets a reference to the event object of the browser. + */ + originalEvent?: any; } interface MouseoutEvent { @@ -24739,19 +25317,24 @@ interface MouseoutEvent { interface MouseoutEventUIParam { /** - * Used to obtain reference to igEditor. + * Gets a reference to the editor. */ owner?: any; /** - * Used to obtain a reference to the event target. + * Gets a reference to the event target. */ element?: any; /** - * Used torInput to get a reference to the editor field. + * Gets a reference to the editor input field. */ editorInput?: any; + + /** + * Gets a reference to the event object of the browser. + */ + originalEvent?: any; } interface KeydownEvent { @@ -24760,12 +25343,22 @@ interface KeydownEvent { interface KeydownEventUIParam { /** - * Used to obtain reference to igEditor. + * Gets a reference to the editor. */ owner?: any; /** - * Used to obtain value of keyCode. + * Gets a reference to the event target. + */ + element?: any; + + /** + * Gets a reference to the editor input field. + */ + editorInput?: any; + + /** + * Gets the value of the keyCode. */ key?: any; } @@ -24776,14 +25369,29 @@ interface KeypressEvent { interface KeypressEventUIParam { /** - * Used to obtain reference to igEditor. + * Gets a reference to the editor. */ owner?: any; /** - * Used to obtain value of keyCode. + * Gets a reference to the event target. + */ + element?: any; + + /** + * Gets a reference to the editor input field. + */ + editorInput?: any; + + /** + * Gets the value of the keyCode. */ key?: any; + + /** + * Gets a reference to the event object of the browser. + */ + originalEvent?: any; } interface KeyupEvent { @@ -24792,14 +25400,29 @@ interface KeyupEvent { interface KeyupEventUIParam { /** - * Used to obtain reference to igEditor. + * Gets a reference to the editor. */ owner?: any; /** - * Used to obtain value of keyCode. + * Gets a reference to the event target. + */ + element?: any; + + /** + * Gets a reference to the editor input field. + */ + editorInput?: any; + + /** + * Gets the value of the keyCode. */ key?: any; + + /** + * Gets a reference to the event object of the browser. + */ + originalEvent?: any; } interface ValueChangingEvent { @@ -24808,24 +25431,24 @@ interface ValueChangingEvent { interface ValueChangingEventUIParam { /** - * Used to obtain reference to igEditor. + * Gets a reference to the editor. */ owner?: any; /** - * Used to obtain the new value. + * Gets the editor input. + */ + editorInput?: any; + + /** + * Gets the editor's new value. The argument type might differ depending on the editor type. */ newValue?: any; /** - * Used to obtain the old value. + * Gets the editor's old value. The argument type might differ depending on the editor type. */ oldValue?: any; - - /** - * Used torInput to obtain reference to the editor input. - */ - editorInput?: any; } interface ValueChangedEvent { @@ -24834,30 +25457,31 @@ interface ValueChangedEvent { interface ValueChangedEventUIParam { /** - * Used to obtain reference to igEditor. + * Gets a reference to the editor. */ owner?: any; /** - * Used to obtain the value entered from the user after internal formatting. + * Gets the editor input. + */ + editorInput?: any; + + /** + * Gets the value entered from the user after internal formatting. The argument type might differ depending on the editor type. */ newValue?: any; /** - * Used to obtain the value entered from the user before internal formatting. + * Gets the value entered from the user before internal formatting. The argument type might differ depending on the editor type. */ originalValue?: any; - - /** - * Used torInput to obtain reference to the editor input. - */ - editorInput?: any; } interface IgBaseEditor { /** * Gets/Sets the width of the control. * + * * Valid values: * "null" will stretch to fit data, if no other widths are defined. */ @@ -24866,6 +25490,7 @@ interface IgBaseEditor { /** * Gets/Sets the height of the control. * + * * Valid values: * "null" will fit the editor inside its parent container, if no other heights are defined. */ @@ -24873,37 +25498,44 @@ interface IgBaseEditor { /** * Gets/Sets value in editor. The effect of setting/getting that option depends on type of editor and on dataMode options for every type of editor. + * */ value?: any; /** * Gets/Sets tabIndex attribute for the editor input. + * */ tabIndex?: number; /** * Gets/Sets whether the editor value can become null. * If that option is false, and editor has no value, then value is set to an empty string. + * */ allowNullValue?: boolean; /** * Gets/Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string + * */ nullValue?: string|number; /** * Gets/Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. + * */ inputName?: string; /** * Gets/Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. + * */ readOnly?: boolean; /** * Gets/Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. + * */ disabled?: boolean; @@ -24911,151 +25543,99 @@ interface IgBaseEditor { * Gets/Sets options supported by the [igValidator](ui.igvalidator#options) widget. * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. + * */ validatorOptions?: any; /** * Set/Get the locale setting for the widget. + * */ locale?: any; /** * Set/Get the locale language setting for the widget. + * */ language?: string; /** * Set/Get the regional setting for the widget. + * */ regional?: string|Object; /** - * Event which is raised before rendering of the editor completes. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the editor performing rendering. - * Use ui.element to get a reference to the editor element. + * Fired before rendering of the editor has finished. */ rendering?: RenderingEvent; /** - * Event which is raised after rendering of the editor completes. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the editor performing rendering. - * Use ui.element to get a reference to the editor element. + * Fired after rendering of the editor has finished. */ rendered?: RenderedEvent; /** - * Event which is raised on mousedown event. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mousedown event. */ mousedown?: MousedownEvent; /** - * Event which is raised on mouseup event. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseup event. */ mouseup?: MouseupEvent; /** - * Event which is raised on mousemove at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mousemove at any part of editor including the drop-down list. */ mousemove?: MousemoveEvent; /** - * Event which is raised on mouseover at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseover at any part of editor including the drop-down list. */ mouseover?: MouseoverEvent; /** - * Event which is raised on mouseleave at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseleave at any part of editor including the drop-down list. */ mouseout?: MouseoutEvent; /** - * Event which is raised when input field of editor loses focus. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired when the input field of the editor loses focus. */ blur?: BlurEvent; /** - * Event which is raised when input field of editor gets focus. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired when the input field of the editor gets focus. */ focus?: IgFocusEvent; /** - * Event which is raised on keydown event. + * Fired on keydown event. * Return false in order to cancel key action. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. */ keydown?: KeydownEvent; /** - * Event which is raised on keypress event. + * Fired on keypress event. * Return false in order to cancel key action. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. */ keypress?: KeypressEvent; /** - * Event which is raised on keyup event. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. + * Fired on keyup event. */ keyup?: KeyupEvent; /** - * Event which is raised before the editor value is changed. + * Fired before changing the editor's value. * Return false in order to cancel change. * It can be raised after loosing focus or on spin events. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.newValue to obtain the new value. - * Use ui.oldValue to obtain the old value. - * Use ui.editorInput to obtain reference to the editor input. */ valueChanging?: ValueChangingEvent; /** - * Event which is raised after the editor value is changed. It can be raised after loosing focus or on spin events. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.newValue to obtain the value entered from the user after internal formatting. - * Use ui.originalValue to obtain the value entered from the user before internal formatting. - * Use ui.editorInput to obtain reference to the editor input. + * Fired after the editor value is changed. It can be raised after loosing focus or on spin events. */ valueChanged?: ValueChangedEvent; @@ -25124,8 +25704,23 @@ interface IgBaseEditorMethods { * Destroys the widget */ destroy(): void; + + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ changeLocale($container: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ changeGlobalRegional(): void; } interface JQuery { @@ -25138,17 +25733,22 @@ interface DropDownListOpeningEvent { interface DropDownListOpeningEventUIParam { /** - * Used to obtain reference to igEditor. + * Gets a reference to the editor. */ owner?: any; /** - * Used torInput to obtain reference to the editable input + * Gets a reference to the editor container. + */ + editor?: any; + + /** + * Gets a reference to the editable input. */ editorInput?: any; /** - * Used to obtain reference to the list contaier. + * Gets a reference to the list contaier. */ list?: any; } @@ -25159,17 +25759,17 @@ interface DropDownListOpenedEvent { interface DropDownListOpenedEventUIParam { /** - * Used to obtain reference to igEditor. + * Gets a reference to the editor. */ owner?: any; /** - * Used torInput to obtain reference to the editable input + * Gets a reference to the editable input. */ editorInput?: any; /** - * Used to obtain reference to the list contaier. + * Gets a reference to the list contaier. */ list?: any; } @@ -25180,17 +25780,22 @@ interface DropDownListClosingEvent { interface DropDownListClosingEventUIParam { /** - * Used to obtain reference to igEditor. + * Gets a reference to the editor. */ owner?: any; /** - * Used torInput to obtain reference to the editable input + * Gets a reference to the editor container. + */ + editor?: any; + + /** + * Gets a reference to the editable input. */ editorInput?: any; /** - * Used to obtain reference to the list contaier. + * Gets a reference to the list contaier. */ list?: any; } @@ -25201,17 +25806,22 @@ interface DropDownListClosedEvent { interface DropDownListClosedEventUIParam { /** - * Used to obtain reference to igEditor. + * Gets a reference to the editor. */ owner?: any; /** - * Used torInput to obtain reference to the editable input + * Gets a reference to the editor container. + */ + editor?: any; + + /** + * Gets a reference to the editable input. */ editorInput?: any; /** - * Used to obtain reference to the list contaier. + * Gets a reference to the list contaier. */ list?: any; } @@ -25222,22 +25832,27 @@ interface DropDownItemSelectingEvent { interface DropDownItemSelectingEventUIParam { /** - * Used to obtain reference to igEditor. + * Gets a reference to the editor. */ owner?: any; /** - * Used torInput to obtain reference to the editable input + * Gets a reference to the editor container. + */ + editor?: any; + + /** + * Gets a reference to the editable input. */ editorInput?: any; /** - * Used to obtain reference to the list contaier. + * Gets a reference to the list contaier. */ list?: any; /** - * Used to obtain reference to the list item which is about to be selected. + * Gets a reference to the list item which is about to be selected. */ item?: any; } @@ -25248,22 +25863,22 @@ interface DropDownItemSelectedEvent { interface DropDownItemSelectedEventUIParam { /** - * Used to obtain reference to igEditor. + * Gets a reference to the editor. */ owner?: any; /** - * Used torInput to obtain reference to the editable input + * Gets a reference to the editable input. */ editorInput?: any; /** - * Used to obtain reference to the list contaier. + * Gets a reference to the list contaier. */ list?: any; /** - * Used to obtain reference to the list item which is selected. + * Gets a reference to the list item which is selected. */ item?: any; } @@ -25274,25 +25889,26 @@ interface TextChangedEvent { interface TextChangedEventUIParam { /** - * Used to obtain reference to igEditor. + * Gets a reference to the editor. */ owner?: any; /** - * Used to obtain new text + * Gets a reference to the new text. */ - text?: any; + text?: string; /** - * Used to obtain the old text. + * Gets a reference to the old text. */ - oldText?: any; + oldText?: string; } interface IgTextEditor { /** * Gets visibility of the spin, clear and drop-down button. That option can be set only on initialization. Combinations like 'dropdown,spin' or 'spin,clear' are supported too.Note! This option can not be set runtime. * + * * Valid values: * "dropdown" A button to open/close the list is located on the right side of the editor. * "clear" A button to clear the value is located on the right side of the editor. @@ -25303,16 +25919,19 @@ interface IgTextEditor { /** * Gets/Sets list of items which are used as a source for the drop-down list. * Items in the list can be of type string. + * */ listItems?: any[]; /** * Gets/Sets custom width of the drop-down list in pixels. If the value is equal to 0 or negative, then the width of editor is set as a drop-down width. + * */ listWidth?: number; /** * Gets/Sets the hover/unhover animation duration of a drop-down list item. + * */ listItemHoverDuration?: number; @@ -25321,11 +25940,13 @@ interface IgTextEditor { * If the option is set to false the editor will attach the drop-down list element to the editor container * If the option is set to true the editor will attach its drop-down list to as a child of the body. * Note! This option can not be set runtime. + * */ dropDownAttachedToBody?: boolean; /** * Gets/Sets show/hide drop-down list animation duration in milliseconds. + * */ dropDownAnimationDuration?: number; @@ -25334,6 +25955,7 @@ interface IgTextEditor { * Notes: * This option is overwritten if the number of list items is less than the set value. In that case the drop-down list displays all the items. * This option can not be set runtime. + * */ visibleItemsCount?: number; @@ -25342,6 +25964,7 @@ interface IgTextEditor { * Notes: * If both "excludeKeys" and "includeKeys" options are used, then "excludeKeys" has priority and includeKeys options is not respected. * The option is case sensitive! If the option is set runtime it's not applied on the current value. + * */ includeKeys?: string; @@ -25350,12 +25973,14 @@ interface IgTextEditor { * Notes: * If both "excludeKeys" and "includeKeys" options are used, then "excludeKeys" has priority and includeKeys options is not respected. * The option is case sensitive! If the option is set runtime it's not applied on the current value. + * */ excludeKeys?: string; /** * Gets/Sets the horizontal alignment of the text in the editor. * + * * Valid values: * "left" The text into the input gets aligned to the left. * "right" The text into the input gets aligned to the right. @@ -25365,12 +25990,14 @@ interface IgTextEditor { /** * Gets/Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. + * */ placeHolder?: string; /** * Gets/Sets the action when the editor gets focused. The default value is selectAll. * + * * Valid values: * "selectAll" Setting this option will select all the text into the editor when the edit mode gets enetered. * "atStart" Setting this option will move the cursor at the begining the text into the editor when the edit mode gets enetered. @@ -25382,6 +26009,7 @@ interface IgTextEditor { /** * Gets the text mode of the editor such as: single-line text editor, password editor or multiline editor. That option has effect only on initialization. If based element (selector) is TEXTAREA, then it is used as input-field. * + * * Valid values: * "text" Single line text editor based on INPUT element is created. * "password" Editor based on INPUT element with type password is created. @@ -25391,27 +26019,32 @@ interface IgTextEditor { /** * Gets/Sets the ability of the editor to automatically move the dropdown list selection item from one end to the opposite side. When the last item is reached and spin down is performed, the first item gets selected and vice versa. This option has no effect there is no drop-down list. + * */ spinWrapAround?: boolean; /** * Gets/Sets if the editor should only allow values from the list of items. Matching is case-insensitive. + * */ isLimitedToListValues?: boolean; /** * Gets/Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. + * */ revertIfNotValid?: boolean; /** * Gets/Sets if the editor should prevent form submition when enter key is pressed. + * */ preventSubmitOnEnter?: boolean; /** * Gets/Sets the drop-down list opening orientation when the list gets open. If the option is set to auto the editor has priority to open the drop-down list bottom. If the space is not enough it tries to open the list top. If the space is not enough in both directions then the list gets opened at the bottom of the editor. * + * * Valid values: * "auto" If the option is set to auto the editor has priority to open the drop-down list bottom. If the space is not enough it tries to open the list top. If the space is not enough in both directions then the list gets opened at the bottom of the editor. * "bottom" The drop-down list is opened at the bottom of the editor. @@ -25422,6 +26055,7 @@ interface IgTextEditor { /** * Gets/Sets the maximum length of a text which can be entered by the user. * Negative values or 0 disables that behavior. If set at runtime the editor doesn't apply the option to the cuurent value. + * */ maxLength?: number; @@ -25429,23 +26063,27 @@ interface IgTextEditor { * Gets the ability to limit the editor to be used only as a dropdown list. When set to true the editor input is not editable. * Note! In case there are no list items - the editor will reamin readonly * Note! This option can not be set runtime. + * */ dropDownOnReadOnly?: boolean; /** * Gets/Sets the ability to convert the input characters to upper case (true) or keeps the characters as they are (false). The option has effect only while keyboard entries and paste. * Note! When the option is set at runtime the editor is not changing the current value. + * */ toUpper?: boolean; /** * Gets/Sets the ability to convert the input characters to lower case (true) or keeps the characters as they are (false). The option has effect only while keyboard entries and paste. * Note! When the option is set at runtime the editor is not changing the current value. + * */ toLower?: boolean; /** * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. + * */ suppressNotifications?: boolean; @@ -25453,12 +26091,14 @@ interface IgTextEditor { * Gets/Sets whether the onscreen keyboard (if available on device) should be shown when the dropdown button is clicked/tapped. This option prevents initial focus or removes it when the drop button is clicked/tapped. * Note: The option does not perform device detection so its behavior is always active if enabled. * Note: When drop down is opened the only way to close it will be using the drop down button. + * */ suppressKeyboard?: boolean; /** * Gets/Sets the width of the control. * + * * Valid values: * "null" will stretch to fit data, if no other widths are defined. */ @@ -25467,6 +26107,7 @@ interface IgTextEditor { /** * Gets/Sets the height of the control. * + * * Valid values: * "null" will fit the editor inside its parent container, if no other heights are defined. */ @@ -25474,37 +26115,44 @@ interface IgTextEditor { /** * Gets/Sets value in editor. The effect of setting/getting that option depends on type of editor and on dataMode options for every type of editor. + * */ value?: any; /** * Gets/Sets tabIndex attribute for the editor input. + * */ tabIndex?: number; /** * Gets/Sets whether the editor value can become null. * If that option is false, and editor has no value, then value is set to an empty string. + * */ allowNullValue?: boolean; /** * Gets/Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string + * */ nullValue?: string|number; /** * Gets/Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. + * */ inputName?: string; /** * Gets/Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. + * */ readOnly?: boolean; /** * Gets/Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. + * */ disabled?: boolean; @@ -25512,217 +26160,135 @@ interface IgTextEditor { * Gets/Sets options supported by the [igValidator](ui.igvalidator#options) widget. * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. + * */ validatorOptions?: any; /** * Set/Get the locale setting for the widget. + * */ locale?: any; /** * Set/Get the locale language setting for the widget. + * */ language?: string; /** * Set/Get the regional setting for the widget. + * */ regional?: string|Object; /** - * Event which is raised when the drop down is opening. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired when the drop down is opening. */ dropDownListOpening?: DropDownListOpeningEvent; /** - * Event which is raised after the drop down is opened. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired after the drop down is opened. */ dropDownListOpened?: DropDownListOpenedEvent; /** - * Event which is raised when the drop down is closing. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired when the drop down is closing. */ dropDownListClosing?: DropDownListClosingEvent; /** - * Event which is raised after the drop down is closed. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired after the drop down is closed. */ dropDownListClosed?: DropDownListClosedEvent; /** - * Event which is raised when an item in the drop down list is being selected. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. - * Use ui.item to obtain reference to the list item which is about to be selected. + * Fired when an item in the drop down list is being selected. */ dropDownItemSelecting?: DropDownItemSelectingEvent; /** - * Event which is raised after an item in the drop down list is selected. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. - * Use ui.item to obtain reference to the list item which is selected. + * Fired after an item in the drop down list is selected. */ dropDownItemSelected?: DropDownItemSelectedEvent; /** - * Event which is raised after text in the editor was changed. It can be raised when keyUp event occurs, + * Fired after the editor's text has been changed. It can be raised when keyUp event occurs, * when the clear button is clicked or when an item from a list is selected. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.text to obtain new text - * Use ui.oldText to obtain the old text. */ textChanged?: TextChangedEvent; /** - * Event which is raised before rendering of the editor completes. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the editor performing rendering. - * Use ui.element to get a reference to the editor element. + * Fired before rendering of the editor has finished. */ rendering?: RenderingEvent; /** - * Event which is raised after rendering of the editor completes. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the editor performing rendering. - * Use ui.element to get a reference to the editor element. + * Fired after rendering of the editor has finished. */ rendered?: RenderedEvent; /** - * Event which is raised on mousedown event. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mousedown event. */ mousedown?: MousedownEvent; /** - * Event which is raised on mouseup event. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseup event. */ mouseup?: MouseupEvent; /** - * Event which is raised on mousemove at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mousemove at any part of editor including the drop-down list. */ mousemove?: MousemoveEvent; /** - * Event which is raised on mouseover at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseover at any part of editor including the drop-down list. */ mouseover?: MouseoverEvent; /** - * Event which is raised on mouseleave at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseleave at any part of editor including the drop-down list. */ mouseout?: MouseoutEvent; /** - * Event which is raised when input field of editor loses focus. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired when the input field of the editor loses focus. */ blur?: BlurEvent; /** - * Event which is raised when input field of editor gets focus. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired when the input field of the editor gets focus. */ focus?: IgFocusEvent; /** - * Event which is raised on keydown event. + * Fired on keydown event. * Return false in order to cancel key action. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. */ keydown?: KeydownEvent; /** - * Event which is raised on keypress event. + * Fired on keypress event. * Return false in order to cancel key action. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. */ keypress?: KeypressEvent; /** - * Event which is raised on keyup event. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. + * Fired on keyup event. */ keyup?: KeyupEvent; /** - * Event which is raised before the editor value is changed. + * Fired before changing the editor's value. * Return false in order to cancel change. * It can be raised after loosing focus or on spin events. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.newValue to obtain the new value. - * Use ui.oldValue to obtain the old value. - * Use ui.editorInput to obtain reference to the editor input. */ valueChanging?: ValueChangingEvent; /** - * Event which is raised after the editor value is changed. It can be raised after loosing focus or on spin events. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.newValue to obtain the value entered from the user after internal formatting. - * Use ui.originalValue to obtain the value entered from the user before internal formatting. - * Use ui.editorInput to obtain reference to the editor input. + * Fired after the editor value is changed. It can be raised after loosing focus or on spin events. */ valueChanged?: ValueChangedEvent; @@ -25732,6 +26298,10 @@ interface IgTextEditor { [optionName: string]: any; } interface IgTextEditorMethods { + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.igtexteditor#options:language) + * Note that this method is for rare scenarios, see [language](ui.igtexteditor#options:language) or [locale](ui.igtexteditor#options:locale) option setter + */ changeLocale(): void; /** @@ -25908,6 +26478,7 @@ interface IgNumericEditor { /** * Gets/Sets list of items which are used as a source for the drop-down list. * Items in the list can be of type number. + * */ listItems?: any[]; @@ -25916,6 +26487,7 @@ interface IgNumericEditor { * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [groupSeparator](ui.igNumericEditor#options:groupSeparator) or [decimalSeparator](ui.igNumericEditor#options:decimalSeparator) options. + * */ negativeSign?: string; @@ -25923,6 +26495,7 @@ interface IgNumericEditor { * Gets/Sets the string, which is used as negative pattern. The "n" flag represents the value of number. The "-" and "()" flags are static part of pattern. * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. + * */ negativePattern?: string; @@ -25931,6 +26504,7 @@ interface IgNumericEditor { * Note: this option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [groupSeparator](ui.igNumericEditor#options:groupSeparator) or [negativeSign](ui.igNumericEditor#options:negativeSign) options. + * */ decimalSeparator?: string; @@ -25940,6 +26514,7 @@ interface IgNumericEditor { * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [decimalSeparator](ui.igNumericEditor#options:decimalSeparator) or [negativeSign](ui.igNumericEditor#options:negativeSign) options. + * */ groupSeparator?: string; @@ -25952,6 +26527,7 @@ interface IgNumericEditor { * Note: The numbers in the array must be positive integers. * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. + * */ groups?: any[]; @@ -25961,6 +26537,7 @@ interface IgNumericEditor { * Note: In case of min decimals value higher than max decimals - max decimals are equaled to min decimals property. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option supports values between 0 and 15, when dataMode is 'double' (default) and values between 0 and 7 in 'float' mode. + * */ maxDecimals?: number; @@ -25971,6 +26548,7 @@ interface IgNumericEditor { * Note: In case of min decimals value higher than max decimals - max decimals are equaled to min decimals property. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option supports values between 0 and 15, when dataMode is 'double' (default) and values between 0 and 7 in 'float' mode. + * */ minDecimals?: number; @@ -25978,12 +26556,14 @@ interface IgNumericEditor { * Gets/Sets whether the last decimal place will be rounded, when the maxDecimal option is defined and applied. * For example if the initial editor value is set to 123.4567, maxDecimals option is set to 3 and roundDecimals is enabled, * then editor will round the value and will display it as 123.457. If roundDecimals is disabled then editor value will be truncated to 123.456. + * */ roundDecimals?: boolean; /** * Gets/Sets the horizontal alignment of the text in the editor. * + * * Valid values: * "left" The text into the input gets aligned to the left. * "right" The text into the input gets aligned to the right. @@ -25996,6 +26576,7 @@ interface IgNumericEditor { * The range for the specific type follows the numeric type standards, e.g. in .NET Framework [floating-point](https://msdn.microsoft.com/en-us/library/9ahet949.aspx) types and [integral types](https://msdn.microsoft.com/en-us/library/exx3b86w.aspx). * In addition, the maximum value that can be set to [minDecimals](ui.igNumericEditor#options:minDecimals) and [maxDecimals](ui.igNumericEditor#options:maxDecimals) options can be 15, when editor is in 'double' mode and 7, when in 'float' mode. * + * * Valid values: * "double" the Number object is used with the limits of a double and if the value is not set, then the null or Number.NaN is used depending on the option [allowNullValue](ui.igNumericEditor#options:allowNullValue). Note: that is used as default. * "float" the Number object is used with the limits of a float and if the value is not set, then the null or Number.NaN is used depending on the option [allowNullValue](ui.igNumericEditor#options:allowNullValue). @@ -26012,22 +26593,26 @@ interface IgNumericEditor { /** * Gets/Sets the minimum value which can be entered in the editor by the end user. + * */ minValue?: number; /** * Gets/Sets the maximum value which can be entered in the editor by the end user. + * */ maxValue?: number; /** * Gets/Sets whether the editor value can become null. * If that option is disabled, and editor has no value, then value is set to 0 (or minValue/maxValue). + * */ allowNullValue?: boolean; /** * Gets/Sets the default delta-value which is used with "spin" [buttonType](ui.igNumericEditor#options:buttonType) or [spinUp](ui.igNumericEditor#methods:spinUp) and [spinDown](ui.igNumericEditor#methods:spinDown) methods to increment or decrement value in the editor. The value can not be negative. Non integer value is supported only for dataMode double and float. + * */ spinDelta?: number; @@ -26036,6 +26621,7 @@ interface IgNumericEditor { * If that option is set, then numeric value appears as a string with possible E-power flag. In edit mode the "E" or "e" character can be entered as well. * Notes: The "+" character is not supported in edit mode. * + * * Valid values: * "null" scientific format is disabled. * "E" scientific format is enabled and the "E" character is used. @@ -26048,11 +26634,13 @@ interface IgNumericEditor { /** * Gets/Set the ability of the editor to automatically set value in the editor to the opposite side of the limit, when the spin action reaches minimum or maximum limit. * This applies to [minValue](ui.%%WidgetNameLowered%%#options:minValue) and [maxValue](ui.%%WidgetNameLowered%%#options:maxValue) or cycling through list items if [isLimitedToListValues](ui.%%WidgetNameLowered%%#options:isLimitedToListValues) is enabled. + * */ spinWrapAround?: boolean; /** * Gets/Sets if the editor should only allow values from the list of items. Enabling this also causes spin actions to cycle through list items instead. + * */ isLimitedToListValues?: boolean; @@ -26086,12 +26674,14 @@ interface IgNumericEditor { /** * Gets/Sets value in editor. The effect of setting/getting that option depends on type of editor and on dataMode options for every type of editor. * + * */ value?: any; /** * Gets visibility of the spin, clear and drop-down button. That option can be set only on initialization. Combinations like 'dropdown,spin' or 'spin,clear' are supported too.Note! This option can not be set runtime. * + * * Valid values: * "dropdown" A button to open/close the list is located on the right side of the editor. * "clear" A button to clear the value is located on the right side of the editor. @@ -26101,11 +26691,13 @@ interface IgNumericEditor { /** * Gets/Sets custom width of the drop-down list in pixels. If the value is equal to 0 or negative, then the width of editor is set as a drop-down width. + * */ listWidth?: number; /** * Gets/Sets the hover/unhover animation duration of a drop-down list item. + * */ listItemHoverDuration?: number; @@ -26114,11 +26706,13 @@ interface IgNumericEditor { * If the option is set to false the editor will attach the drop-down list element to the editor container * If the option is set to true the editor will attach its drop-down list to as a child of the body. * Note! This option can not be set runtime. + * */ dropDownAttachedToBody?: boolean; /** * Gets/Sets show/hide drop-down list animation duration in milliseconds. + * */ dropDownAnimationDuration?: number; @@ -26127,17 +26721,20 @@ interface IgNumericEditor { * Notes: * This option is overwritten if the number of list items is less than the set value. In that case the drop-down list displays all the items. * This option can not be set runtime. + * */ visibleItemsCount?: number; /** * Gets/Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. + * */ placeHolder?: string; /** * Gets/Sets the action when the editor gets focused. The default value is selectAll. * + * * Valid values: * "selectAll" Setting this option will select all the text into the editor when the edit mode gets enetered. * "atStart" Setting this option will move the cursor at the begining the text into the editor when the edit mode gets enetered. @@ -26148,17 +26745,20 @@ interface IgNumericEditor { /** * Gets/Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. + * */ revertIfNotValid?: boolean; /** * Gets/Sets if the editor should prevent form submition when enter key is pressed. + * */ preventSubmitOnEnter?: boolean; /** * Gets/Sets the drop-down list opening orientation when the list gets open. If the option is set to auto the editor has priority to open the drop-down list bottom. If the space is not enough it tries to open the list top. If the space is not enough in both directions then the list gets opened at the bottom of the editor. * + * * Valid values: * "auto" If the option is set to auto the editor has priority to open the drop-down list bottom. If the space is not enough it tries to open the list top. If the space is not enough in both directions then the list gets opened at the bottom of the editor. * "bottom" The drop-down list is opened at the bottom of the editor. @@ -26170,11 +26770,13 @@ interface IgNumericEditor { * Gets the ability to limit the editor to be used only as a dropdown list. When set to true the editor input is not editable. * Note! In case there are no list items - the editor will reamin readonly * Note! This option can not be set runtime. + * */ dropDownOnReadOnly?: boolean; /** * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. + * */ suppressNotifications?: boolean; @@ -26182,12 +26784,14 @@ interface IgNumericEditor { * Gets/Sets whether the onscreen keyboard (if available on device) should be shown when the dropdown button is clicked/tapped. This option prevents initial focus or removes it when the drop button is clicked/tapped. * Note: The option does not perform device detection so its behavior is always active if enabled. * Note: When drop down is opened the only way to close it will be using the drop down button. + * */ suppressKeyboard?: boolean; /** * Gets/Sets the width of the control. * + * * Valid values: * "null" will stretch to fit data, if no other widths are defined. */ @@ -26196,6 +26800,7 @@ interface IgNumericEditor { /** * Gets/Sets the height of the control. * + * * Valid values: * "null" will fit the editor inside its parent container, if no other heights are defined. */ @@ -26203,26 +26808,31 @@ interface IgNumericEditor { /** * Gets/Sets tabIndex attribute for the editor input. + * */ tabIndex?: number; /** * Gets/Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string + * */ nullValue?: string|number; /** * Gets/Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. + * */ inputName?: string; /** * Gets/Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. + * */ readOnly?: boolean; /** * Gets/Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. + * */ disabled?: boolean; @@ -26230,87 +26840,61 @@ interface IgNumericEditor { * Gets/Sets options supported by the [igValidator](ui.igvalidator#options) widget. * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. + * */ validatorOptions?: any; /** * Set/Get the locale setting for the widget. + * */ locale?: any; /** * Set/Get the locale language setting for the widget. + * */ language?: string; /** * Set/Get the regional setting for the widget. + * */ regional?: string|Object; /** - * Event which is raised when the drop down is opening. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired when the drop down is opening. */ dropDownListOpening?: DropDownListOpeningEvent; /** - * Event which is raised after the drop down is opened. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired after the drop down is opened. */ dropDownListOpened?: DropDownListOpenedEvent; /** - * Event which is raised when the drop down is closing. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired when the drop down is closing. */ dropDownListClosing?: DropDownListClosingEvent; /** - * Event which is raised after the drop down is closed. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired after the drop down is closed. */ dropDownListClosed?: DropDownListClosedEvent; /** - * Event which is raised when an item in the drop down list is being selected. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. - * Use ui.item to obtain reference to the list item which is about to be selected. + * Fired when an item in the drop down list is being selected. */ dropDownItemSelecting?: DropDownItemSelectingEvent; /** - * Event which is raised after an item in the drop down list is selected. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. - * Use ui.item to obtain reference to the list item which is selected. + * Fired after an item in the drop down list is selected. */ dropDownItemSelected?: DropDownItemSelectedEvent; /** - * Event which is raised after text in the editor was changed. It can be raised when keyUp event occurs, + * Fired after the editor's text has been changed. It can be raised when keyUp event occurs, * when the clear button is clicked or when an item from a list is selected. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.text to obtain new text - * Use ui.oldText to obtain the old text. */ textChanged?: TextChangedEvent; @@ -26365,7 +26949,17 @@ interface IgNumericEditorMethods { * Gets current regional. */ getRegionalOption(): string; + + /** + * Changes the the regional settings of widget element to the language specified in [options.regional](ui.ignumericeditor#options:regional) + * Note that this method is for rare scenarios, use [regional](ui.ignumericeditor#options:regional) option setter + */ changeRegional(): void; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.igtexteditor#options:language) + * Note that this method is for rare scenarios, see [language](ui.igtexteditor#options:language) or [locale](ui.igtexteditor#options:locale) option setter + */ changeLocale(): void; /** @@ -26450,17 +27044,20 @@ interface IgCurrencyEditor { * Gets/Sets the string, which is used as positive pattern. The "n" flag represents the value of number. * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. + * */ positivePattern?: string; /** * Gets/Sets a string that is used as the currency symbol that is shown in display mode. + * */ currencySymbol?: string; /** * Gets/Sets list of items which are used as a source for the drop-down list. * Items in the list can be of type number. + * */ listItems?: any[]; @@ -26469,6 +27066,7 @@ interface IgCurrencyEditor { * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [groupSeparator](ui.igNumericEditor#options:groupSeparator) or [decimalSeparator](ui.igNumericEditor#options:decimalSeparator) options. + * */ negativeSign?: string; @@ -26476,6 +27074,7 @@ interface IgCurrencyEditor { * Gets/Sets the string, which is used as negative pattern. The "n" flag represents the value of number. The "-" and "()" flags are static part of pattern. * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. + * */ negativePattern?: string; @@ -26484,6 +27083,7 @@ interface IgCurrencyEditor { * Note: this option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [groupSeparator](ui.igNumericEditor#options:groupSeparator) or [negativeSign](ui.igNumericEditor#options:negativeSign) options. + * */ decimalSeparator?: string; @@ -26493,6 +27093,7 @@ interface IgCurrencyEditor { * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [decimalSeparator](ui.igNumericEditor#options:decimalSeparator) or [negativeSign](ui.igNumericEditor#options:negativeSign) options. + * */ groupSeparator?: string; @@ -26505,6 +27106,7 @@ interface IgCurrencyEditor { * Note: The numbers in the array must be positive integers. * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. + * */ groups?: any[]; @@ -26514,6 +27116,7 @@ interface IgCurrencyEditor { * Note: In case of min decimals value higher than max decimals - max decimals are equaled to min decimals property. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option supports values between 0 and 15, when dataMode is 'double' (default) and values between 0 and 7 in 'float' mode. + * */ maxDecimals?: number; @@ -26524,6 +27127,7 @@ interface IgCurrencyEditor { * Note: In case of min decimals value higher than max decimals - max decimals are equaled to min decimals property. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option supports values between 0 and 15, when dataMode is 'double' (default) and values between 0 and 7 in 'float' mode. + * */ minDecimals?: number; @@ -26531,12 +27135,14 @@ interface IgCurrencyEditor { * Gets/Sets whether the last decimal place will be rounded, when the maxDecimal option is defined and applied. * For example if the initial editor value is set to 123.4567, maxDecimals option is set to 3 and roundDecimals is enabled, * then editor will round the value and will display it as 123.457. If roundDecimals is disabled then editor value will be truncated to 123.456. + * */ roundDecimals?: boolean; /** * Gets/Sets the horizontal alignment of the text in the editor. * + * * Valid values: * "left" The text into the input gets aligned to the left. * "right" The text into the input gets aligned to the right. @@ -26549,6 +27155,7 @@ interface IgCurrencyEditor { * The range for the specific type follows the numeric type standards, e.g. in .NET Framework [floating-point](https://msdn.microsoft.com/en-us/library/9ahet949.aspx) types and [integral types](https://msdn.microsoft.com/en-us/library/exx3b86w.aspx). * In addition, the maximum value that can be set to [minDecimals](ui.igNumericEditor#options:minDecimals) and [maxDecimals](ui.igNumericEditor#options:maxDecimals) options can be 15, when editor is in 'double' mode and 7, when in 'float' mode. * + * * Valid values: * "double" the Number object is used with the limits of a double and if the value is not set, then the null or Number.NaN is used depending on the option [allowNullValue](ui.igNumericEditor#options:allowNullValue). Note: that is used as default. * "float" the Number object is used with the limits of a float and if the value is not set, then the null or Number.NaN is used depending on the option [allowNullValue](ui.igNumericEditor#options:allowNullValue). @@ -26565,22 +27172,26 @@ interface IgCurrencyEditor { /** * Gets/Sets the minimum value which can be entered in the editor by the end user. + * */ minValue?: number; /** * Gets/Sets the maximum value which can be entered in the editor by the end user. + * */ maxValue?: number; /** * Gets/Sets whether the editor value can become null. * If that option is disabled, and editor has no value, then value is set to 0 (or minValue/maxValue). + * */ allowNullValue?: boolean; /** * Gets/Sets the default delta-value which is used with "spin" [buttonType](ui.igNumericEditor#options:buttonType) or [spinUp](ui.igNumericEditor#methods:spinUp) and [spinDown](ui.igNumericEditor#methods:spinDown) methods to increment or decrement value in the editor. The value can not be negative. Non integer value is supported only for dataMode double and float. + * */ spinDelta?: number; @@ -26589,6 +27200,7 @@ interface IgCurrencyEditor { * If that option is set, then numeric value appears as a string with possible E-power flag. In edit mode the "E" or "e" character can be entered as well. * Notes: The "+" character is not supported in edit mode. * + * * Valid values: * "null" scientific format is disabled. * "E" scientific format is enabled and the "E" character is used. @@ -26601,11 +27213,13 @@ interface IgCurrencyEditor { /** * Gets/Set the ability of the editor to automatically set value in the editor to the opposite side of the limit, when the spin action reaches minimum or maximum limit. * This applies to [minValue](ui.%%WidgetNameLowered%%#options:minValue) and [maxValue](ui.%%WidgetNameLowered%%#options:maxValue) or cycling through list items if [isLimitedToListValues](ui.%%WidgetNameLowered%%#options:isLimitedToListValues) is enabled. + * */ spinWrapAround?: boolean; /** * Gets/Sets if the editor should only allow values from the list of items. Enabling this also causes spin actions to cycle through list items instead. + * */ isLimitedToListValues?: boolean; @@ -26639,12 +27253,14 @@ interface IgCurrencyEditor { /** * Gets/Sets value in editor. The effect of setting/getting that option depends on type of editor and on dataMode options for every type of editor. * + * */ value?: any; /** * Gets visibility of the spin, clear and drop-down button. That option can be set only on initialization. Combinations like 'dropdown,spin' or 'spin,clear' are supported too.Note! This option can not be set runtime. * + * * Valid values: * "dropdown" A button to open/close the list is located on the right side of the editor. * "clear" A button to clear the value is located on the right side of the editor. @@ -26654,11 +27270,13 @@ interface IgCurrencyEditor { /** * Gets/Sets custom width of the drop-down list in pixels. If the value is equal to 0 or negative, then the width of editor is set as a drop-down width. + * */ listWidth?: number; /** * Gets/Sets the hover/unhover animation duration of a drop-down list item. + * */ listItemHoverDuration?: number; @@ -26667,11 +27285,13 @@ interface IgCurrencyEditor { * If the option is set to false the editor will attach the drop-down list element to the editor container * If the option is set to true the editor will attach its drop-down list to as a child of the body. * Note! This option can not be set runtime. + * */ dropDownAttachedToBody?: boolean; /** * Gets/Sets show/hide drop-down list animation duration in milliseconds. + * */ dropDownAnimationDuration?: number; @@ -26680,17 +27300,20 @@ interface IgCurrencyEditor { * Notes: * This option is overwritten if the number of list items is less than the set value. In that case the drop-down list displays all the items. * This option can not be set runtime. + * */ visibleItemsCount?: number; /** * Gets/Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. + * */ placeHolder?: string; /** * Gets/Sets the action when the editor gets focused. The default value is selectAll. * + * * Valid values: * "selectAll" Setting this option will select all the text into the editor when the edit mode gets enetered. * "atStart" Setting this option will move the cursor at the begining the text into the editor when the edit mode gets enetered. @@ -26701,17 +27324,20 @@ interface IgCurrencyEditor { /** * Gets/Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. + * */ revertIfNotValid?: boolean; /** * Gets/Sets if the editor should prevent form submition when enter key is pressed. + * */ preventSubmitOnEnter?: boolean; /** * Gets/Sets the drop-down list opening orientation when the list gets open. If the option is set to auto the editor has priority to open the drop-down list bottom. If the space is not enough it tries to open the list top. If the space is not enough in both directions then the list gets opened at the bottom of the editor. * + * * Valid values: * "auto" If the option is set to auto the editor has priority to open the drop-down list bottom. If the space is not enough it tries to open the list top. If the space is not enough in both directions then the list gets opened at the bottom of the editor. * "bottom" The drop-down list is opened at the bottom of the editor. @@ -26723,11 +27349,13 @@ interface IgCurrencyEditor { * Gets the ability to limit the editor to be used only as a dropdown list. When set to true the editor input is not editable. * Note! In case there are no list items - the editor will reamin readonly * Note! This option can not be set runtime. + * */ dropDownOnReadOnly?: boolean; /** * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. + * */ suppressNotifications?: boolean; @@ -26735,12 +27363,14 @@ interface IgCurrencyEditor { * Gets/Sets whether the onscreen keyboard (if available on device) should be shown when the dropdown button is clicked/tapped. This option prevents initial focus or removes it when the drop button is clicked/tapped. * Note: The option does not perform device detection so its behavior is always active if enabled. * Note: When drop down is opened the only way to close it will be using the drop down button. + * */ suppressKeyboard?: boolean; /** * Gets/Sets the width of the control. * + * * Valid values: * "null" will stretch to fit data, if no other widths are defined. */ @@ -26749,6 +27379,7 @@ interface IgCurrencyEditor { /** * Gets/Sets the height of the control. * + * * Valid values: * "null" will fit the editor inside its parent container, if no other heights are defined. */ @@ -26756,26 +27387,31 @@ interface IgCurrencyEditor { /** * Gets/Sets tabIndex attribute for the editor input. + * */ tabIndex?: number; /** * Gets/Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string + * */ nullValue?: string|number; /** * Gets/Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. + * */ inputName?: string; /** * Gets/Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. + * */ readOnly?: boolean; /** * Gets/Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. + * */ disabled?: boolean; @@ -26783,21 +27419,25 @@ interface IgCurrencyEditor { * Gets/Sets options supported by the [igValidator](ui.igvalidator#options) widget. * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. + * */ validatorOptions?: any; /** * Set/Get the locale setting for the widget. + * */ locale?: any; /** * Set/Get the locale language setting for the widget. + * */ language?: string; /** * Set/Get the regional setting for the widget. + * */ regional?: string|Object; @@ -26859,6 +27499,11 @@ interface IgCurrencyEditorMethods { * Gets current regional. */ getRegionalOption(): string; + + /** + * Changes the the regional settings of widget element to the language specified in [options.regional](ui.ignumericeditor#options:regional) + * Note that this method is for rare scenarios, use [regional](ui.ignumericeditor#options:regional) option setter + */ changeRegional(): void; } interface JQuery { @@ -26870,12 +27515,14 @@ interface IgPercentEditor { * Gets/Sets the pattern for positive numeric values, which is used in display (no focus) state. * If you use the "en-US" culture the default value for "positivePattern" will be "n$" where the "$" flag represents the "numericSymbol" and the "n" flag represents the value of the number. * Note: this option has priority over possible regional settings. + * */ positivePattern?: string; /** * Gets/Sets the symbol, which is used in display (no focus) state. * Note: this option has priority over possible regional settings. + * */ percentSymbol?: string; @@ -26885,6 +27532,7 @@ interface IgPercentEditor { * For example, if the factor is 100 and the "value" is set to 0.123, then the editor will show string "12.3". * Possible values: 1 or 100. * Note: this option has priority over possible regional settings. + * */ displayFactor?: number; @@ -26893,6 +27541,7 @@ interface IgPercentEditor { * The range for the specific type follows the numeric type standards, e.g. in .NET Framework [floating-point](https://msdn.microsoft.com/en-us/library/9ahet949.aspx) types and [integral types](https://msdn.microsoft.com/en-us/library/exx3b86w.aspx). * In addition, the maximum value that can be set to [minDecimals](ui.igPercentEditor#options:minDecimals) and [maxDecimals](ui.igPercentEditor#options:maxDecimals) options can be 15, when editor is in 'double' mode and 7, when in 'float' mode. * + * * Valid values: * "double" the Number object is used with the limits of a double and if the value is not set, then the null or Number.NaN is used depending on the option [allowNullValue](ui.igpercenteditor#options:allowNullValue). Note: that is used as default. * "float" the Number object is used with the limits of a float and if the value is not set, then the null or Number.NaN is used depending on the option [allowNullValue](ui.igpercenteditor#options:allowNullValue). @@ -26909,12 +27558,14 @@ interface IgPercentEditor { /** * Gets/Sets the default delta-value which is used with "spin" [buttonType](ui.igpercenteditor#options:buttonType) or [spinUp](ui.igpercenteditor#methods:spinUp) and [spinDown](ui.igpercenteditor#methods:spinDown) methods to increment or decrement value in the editor. The value can not be negative. Non integer value is supported only for dataMode double and float. + * */ spinDelta?: number; /** * Gets/Sets list of items which are used as a source for the drop-down list. * Items in the list can be of type number. + * */ listItems?: any[]; @@ -26923,6 +27574,7 @@ interface IgPercentEditor { * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [groupSeparator](ui.igNumericEditor#options:groupSeparator) or [decimalSeparator](ui.igNumericEditor#options:decimalSeparator) options. + * */ negativeSign?: string; @@ -26930,6 +27582,7 @@ interface IgPercentEditor { * Gets/Sets the string, which is used as negative pattern. The "n" flag represents the value of number. The "-" and "()" flags are static part of pattern. * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. + * */ negativePattern?: string; @@ -26938,6 +27591,7 @@ interface IgPercentEditor { * Note: this option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [groupSeparator](ui.igNumericEditor#options:groupSeparator) or [negativeSign](ui.igNumericEditor#options:negativeSign) options. + * */ decimalSeparator?: string; @@ -26947,6 +27601,7 @@ interface IgPercentEditor { * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [decimalSeparator](ui.igNumericEditor#options:decimalSeparator) or [negativeSign](ui.igNumericEditor#options:negativeSign) options. + * */ groupSeparator?: string; @@ -26959,6 +27614,7 @@ interface IgPercentEditor { * Note: The numbers in the array must be positive integers. * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. + * */ groups?: any[]; @@ -26968,6 +27624,7 @@ interface IgPercentEditor { * Note: In case of min decimals value higher than max decimals - max decimals are equaled to min decimals property. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option supports values between 0 and 15, when dataMode is 'double' (default) and values between 0 and 7 in 'float' mode. + * */ maxDecimals?: number; @@ -26978,6 +27635,7 @@ interface IgPercentEditor { * Note: In case of min decimals value higher than max decimals - max decimals are equaled to min decimals property. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option supports values between 0 and 15, when dataMode is 'double' (default) and values between 0 and 7 in 'float' mode. + * */ minDecimals?: number; @@ -26985,12 +27643,14 @@ interface IgPercentEditor { * Gets/Sets whether the last decimal place will be rounded, when the maxDecimal option is defined and applied. * For example if the initial editor value is set to 123.4567, maxDecimals option is set to 3 and roundDecimals is enabled, * then editor will round the value and will display it as 123.457. If roundDecimals is disabled then editor value will be truncated to 123.456. + * */ roundDecimals?: boolean; /** * Gets/Sets the horizontal alignment of the text in the editor. * + * * Valid values: * "left" The text into the input gets aligned to the left. * "right" The text into the input gets aligned to the right. @@ -27000,17 +27660,20 @@ interface IgPercentEditor { /** * Gets/Sets the minimum value which can be entered in the editor by the end user. + * */ minValue?: number; /** * Gets/Sets the maximum value which can be entered in the editor by the end user. + * */ maxValue?: number; /** * Gets/Sets whether the editor value can become null. * If that option is disabled, and editor has no value, then value is set to 0 (or minValue/maxValue). + * */ allowNullValue?: boolean; @@ -27019,6 +27682,7 @@ interface IgPercentEditor { * If that option is set, then numeric value appears as a string with possible E-power flag. In edit mode the "E" or "e" character can be entered as well. * Notes: The "+" character is not supported in edit mode. * + * * Valid values: * "null" scientific format is disabled. * "E" scientific format is enabled and the "E" character is used. @@ -27031,11 +27695,13 @@ interface IgPercentEditor { /** * Gets/Set the ability of the editor to automatically set value in the editor to the opposite side of the limit, when the spin action reaches minimum or maximum limit. * This applies to [minValue](ui.%%WidgetNameLowered%%#options:minValue) and [maxValue](ui.%%WidgetNameLowered%%#options:maxValue) or cycling through list items if [isLimitedToListValues](ui.%%WidgetNameLowered%%#options:isLimitedToListValues) is enabled. + * */ spinWrapAround?: boolean; /** * Gets/Sets if the editor should only allow values from the list of items. Enabling this also causes spin actions to cycle through list items instead. + * */ isLimitedToListValues?: boolean; @@ -27069,12 +27735,14 @@ interface IgPercentEditor { /** * Gets/Sets value in editor. The effect of setting/getting that option depends on type of editor and on dataMode options for every type of editor. * + * */ value?: any; /** * Gets visibility of the spin, clear and drop-down button. That option can be set only on initialization. Combinations like 'dropdown,spin' or 'spin,clear' are supported too.Note! This option can not be set runtime. * + * * Valid values: * "dropdown" A button to open/close the list is located on the right side of the editor. * "clear" A button to clear the value is located on the right side of the editor. @@ -27084,11 +27752,13 @@ interface IgPercentEditor { /** * Gets/Sets custom width of the drop-down list in pixels. If the value is equal to 0 or negative, then the width of editor is set as a drop-down width. + * */ listWidth?: number; /** * Gets/Sets the hover/unhover animation duration of a drop-down list item. + * */ listItemHoverDuration?: number; @@ -27097,11 +27767,13 @@ interface IgPercentEditor { * If the option is set to false the editor will attach the drop-down list element to the editor container * If the option is set to true the editor will attach its drop-down list to as a child of the body. * Note! This option can not be set runtime. + * */ dropDownAttachedToBody?: boolean; /** * Gets/Sets show/hide drop-down list animation duration in milliseconds. + * */ dropDownAnimationDuration?: number; @@ -27110,17 +27782,20 @@ interface IgPercentEditor { * Notes: * This option is overwritten if the number of list items is less than the set value. In that case the drop-down list displays all the items. * This option can not be set runtime. + * */ visibleItemsCount?: number; /** * Gets/Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. + * */ placeHolder?: string; /** * Gets/Sets the action when the editor gets focused. The default value is selectAll. * + * * Valid values: * "selectAll" Setting this option will select all the text into the editor when the edit mode gets enetered. * "atStart" Setting this option will move the cursor at the begining the text into the editor when the edit mode gets enetered. @@ -27131,17 +27806,20 @@ interface IgPercentEditor { /** * Gets/Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. + * */ revertIfNotValid?: boolean; /** * Gets/Sets if the editor should prevent form submition when enter key is pressed. + * */ preventSubmitOnEnter?: boolean; /** * Gets/Sets the drop-down list opening orientation when the list gets open. If the option is set to auto the editor has priority to open the drop-down list bottom. If the space is not enough it tries to open the list top. If the space is not enough in both directions then the list gets opened at the bottom of the editor. * + * * Valid values: * "auto" If the option is set to auto the editor has priority to open the drop-down list bottom. If the space is not enough it tries to open the list top. If the space is not enough in both directions then the list gets opened at the bottom of the editor. * "bottom" The drop-down list is opened at the bottom of the editor. @@ -27153,11 +27831,13 @@ interface IgPercentEditor { * Gets the ability to limit the editor to be used only as a dropdown list. When set to true the editor input is not editable. * Note! In case there are no list items - the editor will reamin readonly * Note! This option can not be set runtime. + * */ dropDownOnReadOnly?: boolean; /** * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. + * */ suppressNotifications?: boolean; @@ -27165,12 +27845,14 @@ interface IgPercentEditor { * Gets/Sets whether the onscreen keyboard (if available on device) should be shown when the dropdown button is clicked/tapped. This option prevents initial focus or removes it when the drop button is clicked/tapped. * Note: The option does not perform device detection so its behavior is always active if enabled. * Note: When drop down is opened the only way to close it will be using the drop down button. + * */ suppressKeyboard?: boolean; /** * Gets/Sets the width of the control. * + * * Valid values: * "null" will stretch to fit data, if no other widths are defined. */ @@ -27179,6 +27861,7 @@ interface IgPercentEditor { /** * Gets/Sets the height of the control. * + * * Valid values: * "null" will fit the editor inside its parent container, if no other heights are defined. */ @@ -27186,26 +27869,31 @@ interface IgPercentEditor { /** * Gets/Sets tabIndex attribute for the editor input. + * */ tabIndex?: number; /** * Gets/Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string + * */ nullValue?: string|number; /** * Gets/Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. + * */ inputName?: string; /** * Gets/Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. + * */ readOnly?: boolean; /** * Gets/Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. + * */ disabled?: boolean; @@ -27213,21 +27901,25 @@ interface IgPercentEditor { * Gets/Sets options supported by the [igValidator](ui.igvalidator#options) widget. * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. + * */ validatorOptions?: any; /** * Set/Get the locale setting for the widget. + * */ locale?: any; /** * Set/Get the locale language setting for the widget. + * */ language?: string; /** * Set/Get the regional setting for the widget. + * */ regional?: string|Object; @@ -27297,6 +27989,11 @@ interface IgPercentEditorMethods { * Gets current regional. */ getRegionalOption(): string; + + /** + * Changes the the regional settings of widget element to the language specified in [options.regional](ui.ignumericeditor#options:regional) + * Note that this method is for rare scenarios, use [regional](ui.ignumericeditor#options:regional) option setter + */ changeRegional(): void; } interface JQuery { @@ -27307,6 +28004,7 @@ interface IgMaskEditor { /** * Gets visibility of the clear button. That option can be set only on initialization. * + * * Valid values: * "clear" A button to clear the value is located on the right side of the editor. */ @@ -27330,12 +28028,14 @@ interface IgMaskEditor { * >: all letters to the right are converted to the upper case. In order to disable conversion, the ">" flag should be used again. * <: all letters to the right are converted to the lower case. In order to disable conversion, the "<" flag should be used again. * Note! This option can not be set runtime. + * */ inputMask?: string; /** * It affects the value of the control (value method/option and submitted in forms). It defines what the value should contain from text, unfilled prompts and literals. The default is allText and when used value method/option returns the text entered, all prompts (positions) and literals. * + * * Valid values: * "rawText" only entered text. All unfilled prompts (positions) and literals are ignored (removed). * "rawTextWithRequiredPrompts" only entered text and required prompts (positions). All optional unfilled prompts and literals are ignored (removed) @@ -27348,16 +28048,19 @@ interface IgMaskEditor { /** * Gets character which is used as prompt in edit mode for available entry position. + * */ unfilledCharsPrompt?: string; /** * Gets/Sets character which is used as replacement of not-filled required position in mask when editor is in display mode (not focused). + * */ padChar?: string; /** * Gets/Sets character which is used as replacement of not-filled required position in mask when application calls get for the [value](ui.igmaskeditor#methods:value) methods. + * */ emptyChar?: string; @@ -27366,6 +28069,7 @@ interface IgMaskEditor { * Notes: * If "excludeKeys" option contains same characters as this option, then "excludeKeys" has priority. * Note! This option can not be se runtime. + * */ includeKeys?: string; @@ -27374,6 +28078,7 @@ interface IgMaskEditor { * Notes: * If a character is specified in "includeKeys" option also, then "excludeKeys" has priority. * Note! This option can not be se runtime. + * */ excludeKeys?: string; @@ -27440,6 +28145,7 @@ interface IgMaskEditor { /** * Gets/Sets value in editor. The effect of setting/getting that option depends on type of editor and on dataMode options for every type of editor. + * */ value?: any; suppressKeyboard?: boolean; @@ -27447,6 +28153,7 @@ interface IgMaskEditor { /** * Gets/Sets the horizontal alignment of the text in the editor. * + * * Valid values: * "left" The text into the input gets aligned to the left. * "right" The text into the input gets aligned to the right. @@ -27456,12 +28163,14 @@ interface IgMaskEditor { /** * Gets/Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. + * */ placeHolder?: string; /** * Gets/Sets the action when the editor gets focused. The default value is selectAll. * + * * Valid values: * "selectAll" Setting this option will select all the text into the editor when the edit mode gets enetered. * "atStart" Setting this option will move the cursor at the begining the text into the editor when the edit mode gets enetered. @@ -27472,34 +28181,40 @@ interface IgMaskEditor { /** * Gets/Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. + * */ revertIfNotValid?: boolean; /** * Gets/Sets if the editor should prevent form submition when enter key is pressed. + * */ preventSubmitOnEnter?: boolean; /** * Gets/Sets the ability to convert the input characters to upper case (true) or keeps the characters as they are (false). The option has effect only while keyboard entries and paste. * Note! When the option is set at runtime the editor is not changing the current value. + * */ toUpper?: boolean; /** * Gets/Sets the ability to convert the input characters to lower case (true) or keeps the characters as they are (false). The option has effect only while keyboard entries and paste. * Note! When the option is set at runtime the editor is not changing the current value. + * */ toLower?: boolean; /** * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. + * */ suppressNotifications?: boolean; /** * Gets/Sets the width of the control. * + * * Valid values: * "null" will stretch to fit data, if no other widths are defined. */ @@ -27508,6 +28223,7 @@ interface IgMaskEditor { /** * Gets/Sets the height of the control. * + * * Valid values: * "null" will fit the editor inside its parent container, if no other heights are defined. */ @@ -27515,32 +28231,38 @@ interface IgMaskEditor { /** * Gets/Sets tabIndex attribute for the editor input. + * */ tabIndex?: number; /** * Gets/Sets whether the editor value can become null. * If that option is false, and editor has no value, then value is set to an empty string. + * */ allowNullValue?: boolean; /** * Gets/Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string + * */ nullValue?: string|number; /** * Gets/Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. + * */ inputName?: string; /** * Gets/Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. + * */ readOnly?: boolean; /** * Gets/Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. + * */ disabled?: boolean; @@ -27548,21 +28270,25 @@ interface IgMaskEditor { * Gets/Sets options supported by the [igValidator](ui.igvalidator#options) widget. * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. + * */ validatorOptions?: any; /** * Set/Get the locale setting for the widget. + * */ locale?: any; /** * Set/Get the locale language setting for the widget. + * */ language?: string; /** * Set/Get the regional setting for the widget. + * */ regional?: string|Object; dropDownListOpening?: DropDownListOpeningEvent; @@ -27573,12 +28299,8 @@ interface IgMaskEditor { dropDownItemSelected?: DropDownItemSelectedEvent; /** - * Event which is raised after text in the editor was changed. It can be raised when keyUp event occurs, + * Fired after the editor's text has been changed. It can be raised when keyUp event occurs, * when the clear button is clicked or when an item from a list is selected. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.text to obtain new text - * Use ui.oldText to obtain the old text. */ textChanged?: TextChangedEvent; @@ -27611,6 +28333,11 @@ interface IgMaskEditorMethods { * Checks if the value in the editor is valid. Note: This function will not trigger automatic notifications. */ isValid(): boolean; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.igtexteditor#options:language) + * Note that this method is for rare scenarios, see [language](ui.igtexteditor#options:language) or [locale](ui.igtexteditor#options:locale) option setter + */ changeLocale(): void; /** @@ -27662,18 +28389,21 @@ interface IgDateEditor { /** * Gets/Sets the value of the editor. Date object can be set as value. String can be set and the editor will pass it to the Date object constructor and use the corresponding Date object as the value. MVC date format can be used too. * Note! This option doesn't use the dateInputFormat to extract the date. + * */ value?: Date; /** * Gets the minimum value which can be entered in editor by user. Date object can be set as value. String value can be passed and the editor will use the javascript Date object constructor to create date object and will use it for the comparison. MVC date format can be used too. * Note! This option doesn't use the dateInputFormat to extract the date. + * */ minValue?: Date; /** * Gets the maximum value which can be entered in editor by user. Date object can be set as value. String value can be passed and the editor will use the javascript Date object constructor to create date object and will use it for the comparison. MVC date format can be used too. * Note! This option doesn't use the dateInputFormat to extract the date. + * */ maxValue?: Date; @@ -27715,6 +28445,7 @@ interface IgDateEditor { * "f": milliseconds field in hundreds * "ff": milliseconds field in tenths * "fff": milliseconds field + * */ dateDisplayFormat?: string; @@ -27745,6 +28476,7 @@ interface IgDateEditor { * "ff": milliseconds field in tenths * "fff": milliseconds field * Note! This option can not be set runtime. + * */ dateInputFormat?: string; @@ -27754,6 +28486,7 @@ interface IgDateEditor { * For example 10:00 AM from a client with local offset of 5 hours ahead of GMT will be serialized as: * "2016-11-11T10:00:00+05:00" * + * * Valid values: * "date" The value method returns a Date object. When this mode is set the value sent to the server on submit is serialized as ISO 8061 string with local time and zone values by default. * "displayModeText" The "text" in display mode (no focus) format (pattern) is used to be send to the server and is returned from the value() method (returns a string object). @@ -27765,12 +28498,14 @@ interface IgDateEditor { * Gets/Sets time zone offset from UTC, in minutes. The client date values are displayed with this offset instead of the local one. * Note: It is recommended that this option is used with an UTC value (e.g. "2016-11-03T14:08:08.504Z") so the outcome is consistent. * Values with ambiguous time zone could map to unpredictable times depending on the user agent local zone. + * */ displayTimeOffset?: any; /** * Gets visibility of the spin and clear buttons. That option can be set only on initialization. Combinations like 'spin,clear' are supported too. * + * * Valid values: * "clear" A button to clear the value is located on the right side of the editor. * "spin" Spin buttons are located on the right side of the editor @@ -27792,6 +28527,7 @@ interface IgDateEditor { * } * Time periods that don't have values use 1 as default. * + * * Valid values: * "number" Value this value it is applied to all time periods - years, days, minutes, etc. * "object" A configuration object, which defines specific values for each time period. The option can accept the following format: @@ -27802,12 +28538,14 @@ interface IgDateEditor { * Gets/Sets ability to modify only 1 date field on spin events. * Value false enables changes of other date fields when incremented or decremented date-field reaches its limits. * Value true modifies only value of one field. + * */ limitSpinToCurrentField?: boolean; /** * Enables/Disables serializing client date as UTC ISO 8061 string instead of using the local time and zone values. * The option is only applied in "date" [dataMode](ui.%%WidgetNameLowered%%#options:dataMode). + * */ enableUTCDates?: boolean; @@ -27815,16 +28553,19 @@ interface IgDateEditor { * Gets/Sets year for auto detection of 20th and 21st centuries. * That option is used to automatically fill century when the user entered only 1 or 2 digits into the year field or when the date pattern contains only 1 or 2 year positions, e.g. "yy" or "y". * If user entered value larger than value of this option, then 20th century is used, otherwise the 21st. + * */ centuryThreshold?: number; /** * Gets/Set value used to increase/decrease year part of the date, in order to set difference between year in Gregorian calendar and displayed year. + * */ yearShift?: number; /** * Gets/Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string + * */ nullValue?: string|number|Date; @@ -27899,6 +28640,7 @@ interface IgDateEditor { * Notes: * If "excludeKeys" option contains same characters as this option, then "excludeKeys" has priority. * Note! This option can not be se runtime. + * */ includeKeys?: string; @@ -27907,6 +28649,7 @@ interface IgDateEditor { * Notes: * If a character is specified in "includeKeys" option also, then "excludeKeys" has priority. * Note! This option can not be se runtime. + * */ excludeKeys?: string; @@ -27938,6 +28681,7 @@ interface IgDateEditor { /** * Gets/Sets the horizontal alignment of the text in the editor. * + * * Valid values: * "left" The text into the input gets aligned to the left. * "right" The text into the input gets aligned to the right. @@ -27947,12 +28691,14 @@ interface IgDateEditor { /** * Gets/Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. + * */ placeHolder?: string; /** * Gets/Sets the action when the editor gets focused. The default value is selectAll. * + * * Valid values: * "selectAll" Setting this option will select all the text into the editor when the edit mode gets enetered. * "atStart" Setting this option will move the cursor at the begining the text into the editor when the edit mode gets enetered. @@ -27963,22 +28709,26 @@ interface IgDateEditor { /** * Gets/Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. + * */ revertIfNotValid?: boolean; /** * Gets/Sets if the editor should prevent form submition when enter key is pressed. + * */ preventSubmitOnEnter?: boolean; /** * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. + * */ suppressNotifications?: boolean; /** * Gets/Sets the width of the control. * + * * Valid values: * "null" will stretch to fit data, if no other widths are defined. */ @@ -27987,6 +28737,7 @@ interface IgDateEditor { /** * Gets/Sets the height of the control. * + * * Valid values: * "null" will fit the editor inside its parent container, if no other heights are defined. */ @@ -27994,27 +28745,32 @@ interface IgDateEditor { /** * Gets/Sets tabIndex attribute for the editor input. + * */ tabIndex?: number; /** * Gets/Sets whether the editor value can become null. * If that option is false, and editor has no value, then value is set to an empty string. + * */ allowNullValue?: boolean; /** * Gets/Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. + * */ inputName?: string; /** * Gets/Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. + * */ readOnly?: boolean; /** * Gets/Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. + * */ disabled?: boolean; @@ -28022,21 +28778,25 @@ interface IgDateEditor { * Gets/Sets options supported by the [igValidator](ui.igvalidator#options) widget. * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. + * */ validatorOptions?: any; /** * Set/Get the locale setting for the widget. + * */ locale?: any; /** * Set/Get the locale language setting for the widget. + * */ language?: string; /** * Set/Get the regional setting for the widget. + * */ regional?: string|Object; @@ -28076,6 +28836,10 @@ interface IgDateEditor { [optionName: string]: any; } interface IgDateEditorMethods { + /** + * Changes the the regional settings of widget element to the language specified in [options.regional](ui.igdateeditor#options:regional) + * Note that this method is for rare scenarios, use [regional](ui.igdateeditor#options:regional) option setter + */ changeRegional(): void; /** @@ -28096,6 +28860,8 @@ interface IgDateEditorMethods { /** * Sets selected date. This method can be used when dataMode is set as either displayModeText or editModeText. * In such cases the value() cannot accept a date object as a new value and getSelectedDate() can be used to replace that functionality. + * + * @param date */ selectDate(date: Date): void; @@ -28146,22 +28912,22 @@ interface ItemSelectedEvent { interface ItemSelectedEventUIParam { /** - * Used to obtain reference to igEditor. + * Gets a reference to the editor. */ owner?: any; /** - * Used to obtain reference to the date object which is selected. + * Gets a reference to the selected date object. */ dateFromPicker?: any; /** - * Used to obtain a referece to the selected html element from the calendar. + * Gets a reference to the selected html element from the calendar. */ item?: any; /** - * Used to obtain a reference to jQuery UI date picker, used as a calendar from the igDatePicker. + * Gets a reference to jQuery UI date picker widget, used as a calendar from the igDatePicker. */ calendar?: any; } @@ -28170,6 +28936,7 @@ interface IgDatePicker { /** * Gets visibility of the spin, clear and drop-down button. That option can be set only on initialization. Combinations like 'dropdown,spin' or 'spin,clear' are supported too. * + * * Valid values: * "dropdown" A button to open/close the list is located on the right side of the editor. * "clear" A button to clear the value is located on the right side of the editor. @@ -28179,12 +28946,14 @@ interface IgDatePicker { /** * Gets/Sets the options supported by the [jquery.ui.datepicker](http://api.jqueryui.com/datepicker/). Only options related to the drop-down calendar are supported. + * */ datepickerOptions?: any; /** * Gets the ability to limit igDatePicker to be used only as s calendar. When set to true the editor input is not editable. * Note! This option can not be set runtime. + * */ dropDownOnReadOnly?: boolean; @@ -28216,24 +28985,28 @@ interface IgDatePicker { /** * Gets/Sets whether the onscreen keyboard (if available on device) should be shown when the dropdown button is clicked/tapped. This option prevents initial focus or removes it when the drop button is clicked/tapped. * Note: The option does not perform device detection so its behavior is always active if enabled. + * */ suppressKeyboard?: boolean; /** * Gets/Sets the value of the editor. Date object can be set as value. String can be set and the editor will pass it to the Date object constructor and use the corresponding Date object as the value. MVC date format can be used too. * Note! This option doesn't use the dateInputFormat to extract the date. + * */ value?: Date; /** * Gets the minimum value which can be entered in editor by user. Date object can be set as value. String value can be passed and the editor will use the javascript Date object constructor to create date object and will use it for the comparison. MVC date format can be used too. * Note! This option doesn't use the dateInputFormat to extract the date. + * */ minValue?: Date; /** * Gets the maximum value which can be entered in editor by user. Date object can be set as value. String value can be passed and the editor will use the javascript Date object constructor to create date object and will use it for the comparison. MVC date format can be used too. * Note! This option doesn't use the dateInputFormat to extract the date. + * */ maxValue?: Date; @@ -28275,6 +29048,7 @@ interface IgDatePicker { * "f": milliseconds field in hundreds * "ff": milliseconds field in tenths * "fff": milliseconds field + * */ dateDisplayFormat?: string; @@ -28305,6 +29079,7 @@ interface IgDatePicker { * "ff": milliseconds field in tenths * "fff": milliseconds field * Note! This option can not be set runtime. + * */ dateInputFormat?: string; @@ -28314,6 +29089,7 @@ interface IgDatePicker { * For example 10:00 AM from a client with local offset of 5 hours ahead of GMT will be serialized as: * "2016-11-11T10:00:00+05:00" * + * * Valid values: * "date" The value method returns a Date object. When this mode is set the value sent to the server on submit is serialized as ISO 8061 string with local time and zone values by default. * "displayModeText" The "text" in display mode (no focus) format (pattern) is used to be send to the server and is returned from the value() method (returns a string object). @@ -28325,6 +29101,7 @@ interface IgDatePicker { * Gets/Sets time zone offset from UTC, in minutes. The client date values are displayed with this offset instead of the local one. * Note: It is recommended that this option is used with an UTC value (e.g. "2016-11-03T14:08:08.504Z") so the outcome is consistent. * Values with ambiguous time zone could map to unpredictable times depending on the user agent local zone. + * */ displayTimeOffset?: any; @@ -28343,6 +29120,7 @@ interface IgDatePicker { * } * Time periods that don't have values use 1 as default. * + * * Valid values: * "number" Value this value it is applied to all time periods - years, days, minutes, etc. * "object" A configuration object, which defines specific values for each time period. The option can accept the following format: @@ -28353,12 +29131,14 @@ interface IgDatePicker { * Gets/Sets ability to modify only 1 date field on spin events. * Value false enables changes of other date fields when incremented or decremented date-field reaches its limits. * Value true modifies only value of one field. + * */ limitSpinToCurrentField?: boolean; /** * Enables/Disables serializing client date as UTC ISO 8061 string instead of using the local time and zone values. * The option is only applied in "date" [dataMode](ui.%%WidgetNameLowered%%#options:dataMode). + * */ enableUTCDates?: boolean; @@ -28366,16 +29146,19 @@ interface IgDatePicker { * Gets/Sets year for auto detection of 20th and 21st centuries. * That option is used to automatically fill century when the user entered only 1 or 2 digits into the year field or when the date pattern contains only 1 or 2 year positions, e.g. "yy" or "y". * If user entered value larger than value of this option, then 20th century is used, otherwise the 21st. + * */ centuryThreshold?: number; /** * Gets/Set value used to increase/decrease year part of the date, in order to set difference between year in Gregorian calendar and displayed year. + * */ yearShift?: number; /** * Gets/Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string + * */ nullValue?: string|number|Date; @@ -28419,6 +29202,7 @@ interface IgDatePicker { * Notes: * If "excludeKeys" option contains same characters as this option, then "excludeKeys" has priority. * Note! This option can not be se runtime. + * */ includeKeys?: string; @@ -28427,6 +29211,7 @@ interface IgDatePicker { * Notes: * If a character is specified in "includeKeys" option also, then "excludeKeys" has priority. * Note! This option can not be se runtime. + * */ excludeKeys?: string; @@ -28458,6 +29243,7 @@ interface IgDatePicker { /** * Gets/Sets the horizontal alignment of the text in the editor. * + * * Valid values: * "left" The text into the input gets aligned to the left. * "right" The text into the input gets aligned to the right. @@ -28467,12 +29253,14 @@ interface IgDatePicker { /** * Gets/Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. + * */ placeHolder?: string; /** * Gets/Sets the action when the editor gets focused. The default value is selectAll. * + * * Valid values: * "selectAll" Setting this option will select all the text into the editor when the edit mode gets enetered. * "atStart" Setting this option will move the cursor at the begining the text into the editor when the edit mode gets enetered. @@ -28483,22 +29271,26 @@ interface IgDatePicker { /** * Gets/Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. + * */ revertIfNotValid?: boolean; /** * Gets/Sets if the editor should prevent form submition when enter key is pressed. + * */ preventSubmitOnEnter?: boolean; /** * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. + * */ suppressNotifications?: boolean; /** * Gets/Sets the width of the control. * + * * Valid values: * "null" will stretch to fit data, if no other widths are defined. */ @@ -28507,6 +29299,7 @@ interface IgDatePicker { /** * Gets/Sets the height of the control. * + * * Valid values: * "null" will fit the editor inside its parent container, if no other heights are defined. */ @@ -28514,27 +29307,32 @@ interface IgDatePicker { /** * Gets/Sets tabIndex attribute for the editor input. + * */ tabIndex?: number; /** * Gets/Sets whether the editor value can become null. * If that option is false, and editor has no value, then value is set to an empty string. + * */ allowNullValue?: boolean; /** * Gets/Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. + * */ inputName?: string; /** * Gets/Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. + * */ readOnly?: boolean; /** * Gets/Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. + * */ disabled?: boolean; @@ -28542,39 +29340,35 @@ interface IgDatePicker { * Gets/Sets options supported by the [igValidator](ui.igvalidator#options) widget. * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. + * */ validatorOptions?: any; /** * Set/Get the locale setting for the widget. + * */ locale?: any; /** * Set/Get the locale language setting for the widget. + * */ language?: string; /** * Set/Get the regional setting for the widget. + * */ regional?: string|Object; /** - * Event which is raised when the drop down is opening. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.calendar to obtain a reference to jQuery UI date picker widget, used as a calendar from the igDatePicker. + * Fired when the drop down is opening. */ dropDownListOpening?: DropDownListOpeningEvent; /** - * Event which is raised after the drop down is opened. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.calendar to obtain a reference to jQuery UI date picker widget, used as a calendar from the igDatePicker. + * Fired after the drop down is opened. */ dropDownListOpened?: DropDownListOpenedEvent; @@ -28589,11 +29383,7 @@ interface IgDatePicker { dropDownItemSelecting?: DropDownItemSelectingEvent; /** - * Event which is raised after the drop down (calendar) is closed. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.calendar to obtain a reference to jQuery UI date picker widget, used as a calendar from the igDatePicker. + * Fired after the drop down (calendar) is closed. */ dropDownListClosed?: DropDownListClosedEvent; @@ -28603,12 +29393,7 @@ interface IgDatePicker { dropDownItemSelected?: DropDownItemSelectedEvent; /** - * Event which is raised after a date selection in the calendar. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.dateFromPicker to obtain reference to the date object which is selected. - * Use ui.item to obtain a referece to the selected html element from the calendar. - * Use ui.calendar to obtain a reference to jQuery UI date picker, used as a calendar from the igDatePicker. + * Fired after a date selection in the calendar. */ itemSelected?: ItemSelectedEvent; @@ -28618,6 +29403,10 @@ interface IgDatePicker { [optionName: string]: any; } interface IgDatePickerMethods { + /** + * Changes the the regional settings of widget element to the language specified in [options.regional](ui.igdatepicker#options:regional) + * Note that this method is for rare scenarios, use [regional](ui.igdatepicker#options:regional) option setter + */ changeRegional(): void; /** @@ -28672,6 +29461,8 @@ interface IgDatePickerMethods { /** * Sets selected date. This method can be used when dataMode is set as either displayModeText or editModeText. * In such cases the value() cannot accept a date object as a new value and getSelectedDate() can be used to replace that functionality. + * + * @param date */ selectDate(date: Date): void; @@ -28711,12 +29502,14 @@ interface JQuery { interface IgCheckboxEditor { /** * Gets/Sets whether the checkbox is checked. + * */ checked?: boolean; /** * Gets/Sets size of the checkbox based on preset styles.For different sizes, define 'width' and 'height' options instead. * + * * Valid values: * "verysmall" The size of the Checkbox editor is very small. * "small" The size of the Checkbox editor is small. @@ -28728,16 +29521,19 @@ interface IgCheckboxEditor { /** * Gets/Sets a custom class on the checkbox. Custom image can be used this way. * The following jQuery classes can be used in addition http://api.jqueryui.com/theming/icons/ + * */ iconClass?: string; /** * Gets/Sets tabIndex attribute for the editor input. + * */ tabIndex?: number; /** * Gets/Sets the readonly attribute. Does not allow editing. Disables changing the checkbox state as an interaction, but it still can be changed programmatically. On submit the current value is sent into the request. + * */ readOnly?: boolean; allowNullValue?: boolean; @@ -28746,6 +29542,7 @@ interface IgCheckboxEditor { /** * Gets/Sets the width of the control. * + * * Valid values: * "null" will stretch to fit data, if no other widths are defined. */ @@ -28754,6 +29551,7 @@ interface IgCheckboxEditor { /** * Gets/Sets the height of the control. * + * * Valid values: * "null" will fit the editor inside its parent container, if no other heights are defined. */ @@ -28761,16 +29559,19 @@ interface IgCheckboxEditor { /** * Gets/Sets value in editor. The effect of setting/getting that option depends on type of editor and on dataMode options for every type of editor. + * */ value?: any; /** * Gets/Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. + * */ inputName?: string; /** * Gets/Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. + * */ disabled?: boolean; @@ -28778,154 +29579,98 @@ interface IgCheckboxEditor { * Gets/Sets options supported by the [igValidator](ui.igvalidator#options) widget. * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. + * */ validatorOptions?: any; /** * Set/Get the locale setting for the widget. + * */ locale?: any; /** * Set/Get the locale language setting for the widget. + * */ language?: string; /** * Set/Get the regional setting for the widget. + * */ regional?: string|Object; /** - * Event which is raised before value in editor was changed. + * Fired before changing the editor's value. * Return false in order to cancel change. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.newValue to obtain the new value. - * Use ui.newState to obtain the new state. - * Use ui.oldValue to obtain the old value. - * Use ui.oldState to obtain the old state. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput obtain reference to the editor element. */ valueChanging?: ValueChangingEvent; /** - * Event which is raised after value in editor was changed. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.newValue to obtain the new value. - * Use ui.newState to obtain the new state. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput obtain reference to the editor element. + * Fired after the editor's value has been changed. */ valueChanged?: ValueChangedEvent; /** - * Event which is raised before rendering of the editor completes. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the editor performing rendering. - * Use ui.element to get a reference to the editor element. + * Fired before rendering of the editor has finished. */ rendering?: RenderingEvent; /** - * Event which is raised after rendering of the editor completes. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the editor performing rendering. - * Use ui.element to get a reference to the editor element. + * Fired after rendering of the editor has finished. */ rendered?: RenderedEvent; /** - * Event which is raised on mousedown event. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mousedown event. */ mousedown?: MousedownEvent; /** - * Event which is raised on mouseup event. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseup event. */ mouseup?: MouseupEvent; /** - * Event which is raised on mousemove at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mousemove at any part of editor including the drop-down list. */ mousemove?: MousemoveEvent; /** - * Event which is raised on mouseover at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseover at any part of editor including the drop-down list. */ mouseover?: MouseoverEvent; /** - * Event which is raised on mouseleave at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseleave at any part of editor including the drop-down list. */ mouseout?: MouseoutEvent; /** - * Event which is raised when input field of editor loses focus. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired when the input field of the editor loses focus. */ blur?: BlurEvent; /** - * Event which is raised when input field of editor gets focus. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired when the input field of the editor gets focus. */ focus?: IgFocusEvent; /** - * Event which is raised on keydown event. + * Fired on keydown event. * Return false in order to cancel key action. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. */ keydown?: KeydownEvent; /** - * Event which is raised on keypress event. + * Fired on keypress event. * Return false in order to cancel key action. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. */ keypress?: KeypressEvent; /** - * Event which is raised on keyup event. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. + * Fired on keyup event. */ keyup?: KeyupEvent; @@ -28946,6 +29691,8 @@ interface IgCheckboxEditorMethods { * This option is used when the checkbox is intended to operate as a Boolean editor. In that case the return type is bool. * 2. If the [value](ui.igcheckboxeditor#options:value) option IS defined, then 'value' method will return the value that will be submitted when the editor is checked and the form is submitted. * To get checked state regardless of the 'value' option, use $(".selector").igCheckboxEditor("option", "checked"); + * + * @param newValue */ value(newValue: Object): string; @@ -29012,6 +29759,553 @@ interface JQuery { data(propertyName: "igCheckboxEditor"): IgCheckboxEditorMethods; } +interface IgTimePickerItemsDelta { + hours?: number; + minutes?: number; + + /** + * Option for IgTimePickerItemsDelta + */ + [optionName: string]: any; +} + +interface IgTimePicker { + /** + * Gets delta-value which is used to generate the drop-down items for the time picker. + * Accepted values for deltas are positive integer numbers, and the fractional portion of floating point numbers is ignored. + * + * object A configuration object, which defines specific values for each time period. The option can accept the following format: + * itemsDelta: { + * hours: 0, + * minutes: 30, + * } + * Time periods that don't have values use 0 as default for hours and 30 for minutes. + */ + itemsDelta?: IgTimePickerItemsDelta; + + /** + * Gets/Sets delta-value which is used to increment or decrement the editor time on spin actions.When not editing (focused) the delta is applied on the day if available in the input mask or the lowest available period. + * When in edit mode the time period, where the cursor is positioned, is incremented or decremented with the defined delta value. + * Accepted values for deltas are positive integer numbers, and the fractional portion of floating point numbers is ignored. + * spinDelta: { + * hours: 12, + * minutes: 15 + * } + * Default value is {hours: 1, minutes: 30}. + * + */ + spinDelta?: any; + + /** + * Gets format of time while timepicker has focus. + * Value of that option can be set to explicit time pattern or to a flag defined by regional settings. + * If value is set to explicit time pattern and pattern besides date-flags has explicit characters which match with time-flags or mask-flags, then the "escape" character should be used in front of them. + * If option is not set, then the "time" is used automatically. + * List of predefined regional flags: + * "time": the timePattern member of regional option is used + * List of explicit characters, which should have escape \\ character in front of them: C, &, a, A, ?, L, 9, 0, #, >, <, y, M, d, h, H, m, s, t, f. + * List of time-flags when explicit time pattern is used: + * "t": first character of string which represents AM/PM field + * "tt": 2 characters of string which represents AM/PM field + * "hh": hours field in 12-hours format with leading zero + * "HH": hours field in 24-hours format with leading zero + * "mm": minutes field with leading zero + * Note! This option can not be set runtime. + * + */ + timeInputFormat?: string; + + /** + * Gets/Sets format of time while timepicker has no focus. + * Value of that option can be set to a specific time pattern or to a flag defined by regional settings. + * If value is not set, then the timeInputFormat is used automatically. + * If value is set to explicit time pattern and pattern besides time-flags has explicit characters which match with time-flags or mask-flags, then the "escape" character should be used in front of them. + * List of predefined regional flags: + * "time": the timePattern member of regional option is used + * List of explicit characters, which should have escape \\ character in front of them: + * C, &, a, A, ?, L, 9, 0, #, >, <, y, M, d, h, H, m, s, t, f. + * List of time-flags when explicit time pattern is used: + * "t": first character of string which represents AM/PM field + * "tt": 2 characters of string which represents AM/PM field + * "h": hours field in 12-hours format without leading zero + * "hh": hours field in 12-hours format with leading zero + * "H": hours field in 24-hours format without leading zero + * "HH": hours field in 24-hours format with leading zero + * "m": minutes field without leading zero + * "mm": minutes field with leading zero + * + */ + timeDisplayFormat?: string; + + /** + * Gets/Sets if the editor should only allow values from the list of items. Matching is case-insensitive. + * + */ + isLimitedToListValues?: boolean; + + /** + * Gets/Sets whether the onscreen keyboard (if available on device) should be shown when the dropdown button is clicked/tapped. This option prevents initial focus or removes it when the drop button is clicked/tapped. + * Note: The option does not perform device detection so its behavior is always active if enabled. + * Note: When drop down is opened the only way to close it will be using the drop down button. + * + */ + suppressKeyboard?: boolean; + + /** + * Gets/Sets the drop-down list opening orientation when the list gets open. If the option is set to auto the timepicker has priority to open the drop-down list bottom. If the space is not enough it tries to open the list top. If the space is not enough in both directions then the list gets opened at the bottom of the editor. + * + * + * Valid values: + * "auto" If the option is set to auto the timepicker has priority to open the drop-down list bottom. If the space is not enough it tries to open the list top. If the space is not enough in both directions then the list gets opened at the bottom of the editor. + * "bottom" The drop-down list is opened at the bottom of the timepicker. + * "top" The drop-down list is opened at the top of the timepicker. + */ + dropDownOrientation?: string; + + /** + * Gets the number of the items to be shown at once when the drop-down list get opened. + * Notes: + * This option is overwritten if the number of list items is less than the set value. In that case the drop-down list displays all the items. + * This option can not be set runtime. + * + */ + visibleItemsCount?: number; + + /** + * Gets/Sets custom width of the drop-down list in pixels. If the value is equal to 0 or negative, then the width of timepicker is set as a drop-down width. + * + */ + listWidth?: number; + + /** + * Gets/Sets the hover/unhover animation duration of a drop-down list item. + * + */ + listItemHoverDuration?: number; + + /** + * Gets wheather the drop-down list element is attached to the body of the document, or to the timepicker container element. + * If the option is set to false the timepicker will attach the drop-down list element to the timepicker container + * If the option is set to true the timepicker will attach its drop-down list to as a child of the body. + * Note! This option can not be set runtime. + * + */ + dropDownAttachedToBody?: boolean; + + /** + * Gets/Sets show/hide drop-down list animation duration in milliseconds. + * + */ + dropDownAnimationDuration?: number; + + /** + * Gets visibility of the spin, clear and drop-down button. That option can be set only on initialization. Combinations like 'dropdown, clear' or 'spin, clear' are supported too.Note! This option can not be set runtime. + * Note! A combination like 'dropdown, spin' is not allowed. + * + * + * Valid values: + * "dropdown" A button to open/close the list is located on the right side of the editor. + * "clear" A button to clear the value is located on the right side of the editor. + * "spin" Spin buttons are located on the right side of the editor. + */ + buttonType?: string; + + /** + * Gets/Set the ability of the editor to automatically set value in the editor to the opposite side of the limit, when the spin action reaches minimum or maximum limit. + * This applies to [minValue](ui.%%WidgetNameLowered%%#options:minValue) and [maxValue](ui.%%WidgetNameLowered%%#options:maxValue) or cycling through list items if [isLimitedToListValues](ui.%%WidgetNameLowered%%#options:isLimitedToListValues) is enabled. + * + */ + spinWrapAround?: boolean; + + /** + * Removed from timepicker options + */ + dateDisplayFormat?: any; + + /** + * Removed from timepicker options + */ + dateInputFormat?: any; + + /** + * Removed from timepicker options + */ + yearShift?: any; + + /** + * Removed from timepicker options + */ + displayTimeOffset?: any; + + /** + * Gets/Sets the value of the editor. Date object can be set as value. String can be set and the editor will pass it to the Date object constructor and use the corresponding Date object as the value. MVC date format can be used too. + * Note! This option doesn't use the dateInputFormat to extract the date. + * + */ + value?: Date; + + /** + * Gets the minimum value which can be entered in editor by user. Date object can be set as value. String value can be passed and the editor will use the javascript Date object constructor to create date object and will use it for the comparison. MVC date format can be used too. + * Note! This option doesn't use the dateInputFormat to extract the date. + * + */ + minValue?: Date; + + /** + * Gets the maximum value which can be entered in editor by user. Date object can be set as value. String value can be passed and the editor will use the javascript Date object constructor to create date object and will use it for the comparison. MVC date format can be used too. + * Note! This option doesn't use the dateInputFormat to extract the date. + * + */ + maxValue?: Date; + + /** + * Gets the value type returned by the get of value() method and option. Also affects how the value is stored for form submit. + * The [enableUTCDates](ui.%%WidgetNameLowered%%#options:enableUTCDates) option can be used to output an UTC ISO string instead. + * For example 10:00 AM from a client with local offset of 5 hours ahead of GMT will be serialized as: + * "2016-11-11T10:00:00+05:00" + * + * + * Valid values: + * "date" The value method returns a Date object. When this mode is set the value sent to the server on submit is serialized as ISO 8061 string with local time and zone values by default. + * "displayModeText" The "text" in display mode (no focus) format (pattern) is used to be send to the server and is returned from the value() method (returns a string object). + * "editModeText" The "text" in edit mode (focus) format (pattern) is used to be send to the server and is returned from the value() method (returns a string object). + */ + dataMode?: string; + + /** + * Gets/Sets ability to modify only 1 date field on spin events. + * Value false enables changes of other date fields when incremented or decremented date-field reaches its limits. + * Value true modifies only value of one field. + * + */ + limitSpinToCurrentField?: boolean; + + /** + * Enables/Disables serializing client date as UTC ISO 8061 string instead of using the local time and zone values. + * The option is only applied in "date" [dataMode](ui.%%WidgetNameLowered%%#options:dataMode). + * + */ + enableUTCDates?: boolean; + + /** + * Gets/Sets year for auto detection of 20th and 21st centuries. + * That option is used to automatically fill century when the user entered only 1 or 2 digits into the year field or when the date pattern contains only 1 or 2 year positions, e.g. "yy" or "y". + * If user entered value larger than value of this option, then 20th century is used, otherwise the 21st. + * + */ + centuryThreshold?: number; + + /** + * Gets/Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string + * + */ + nullValue?: string|number|Date; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + */ + listItems?: any; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + */ + dropDownOnReadOnly?: boolean; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + */ + inputMask?: string; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + */ + unfilledCharsPrompt?: string; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + */ + padChar?: string; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + */ + emptyChar?: string; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + */ + toUpper?: boolean; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + */ + toLower?: boolean; + + /** + * Gets ability to enter only specific characters in input-field from keyboard and on paste. + * Notes: + * If "excludeKeys" option contains same characters as this option, then "excludeKeys" has priority. + * Note! This option can not be se runtime. + * + */ + includeKeys?: string; + + /** + * Gets ability to prevent entering specific characters from keyboard or on paste. + * Notes: + * If a character is specified in "includeKeys" option also, then "excludeKeys" has priority. + * Note! This option can not be se runtime. + * + */ + excludeKeys?: string; + + textMode?: any; + + /** + * This option is inherited from a parent widget and it's not applicable for igMaskEditor + */ + maxLength?: any; + + /** + * Gets/Sets the horizontal alignment of the text in the editor. + * + * + * Valid values: + * "left" The text into the input gets aligned to the left. + * "right" The text into the input gets aligned to the right. + * "center" The text into the input gets aligned to the center. + */ + textAlign?: string; + + /** + * Gets/Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. + * + */ + placeHolder?: string; + + /** + * Gets/Sets the action when the editor gets focused. The default value is selectAll. + * + * + * Valid values: + * "selectAll" Setting this option will select all the text into the editor when the edit mode gets enetered. + * "atStart" Setting this option will move the cursor at the begining the text into the editor when the edit mode gets enetered. + * "atEnd" Setting this option will move the cursor at the end the text into the editor when the edit mode gets enetered. + * "browserDefault" Setting this option won't do any extra logic, but proceed with the browser default behavior. + */ + selectionOnFocus?: string; + + /** + * Gets/Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. + * + */ + revertIfNotValid?: boolean; + + /** + * Gets/Sets if the editor should prevent form submition when enter key is pressed. + * + */ + preventSubmitOnEnter?: boolean; + + /** + * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. + * + */ + suppressNotifications?: boolean; + + /** + * Gets/Sets the width of the control. + * + * + * Valid values: + * "null" will stretch to fit data, if no other widths are defined. + */ + width?: string|number; + + /** + * Gets/Sets the height of the control. + * + * + * Valid values: + * "null" will fit the editor inside its parent container, if no other heights are defined. + */ + height?: string|number; + + /** + * Gets/Sets tabIndex attribute for the editor input. + * + */ + tabIndex?: number; + + /** + * Gets/Sets whether the editor value can become null. + * If that option is false, and editor has no value, then value is set to an empty string. + * + */ + allowNullValue?: boolean; + + /** + * Gets/Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. + * + */ + inputName?: string; + + /** + * Gets/Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. + * + */ + readOnly?: boolean; + + /** + * Gets/Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. + * + */ + disabled?: boolean; + + /** + * Gets/Sets options supported by the [igValidator](ui.igvalidator#options) widget. + * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, + * while the corresponding options of the editor prevent values violating the defined rules from being entered. + * + */ + validatorOptions?: any; + + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + + /** + * Fired when the drop down is opening. + */ + dropDownListOpening?: DropDownListOpeningEvent; + + /** + * Fired after the drop down is opened. + */ + dropDownListOpened?: DropDownListOpenedEvent; + + /** + * Fired when the drop down is closing. + */ + dropDownListClosing?: DropDownListClosingEvent; + + /** + * Fired after the drop down is closed. + */ + dropDownListClosed?: DropDownListClosedEvent; + + /** + * Fired when an item in the drop down list is being selected. + */ + dropDownItemSelecting?: DropDownItemSelectingEvent; + + /** + * Fired after an item in the drop down list is selected. + */ + dropDownItemSelected?: DropDownItemSelectedEvent; + + /** + * Option for igTimePicker + */ + [optionName: string]: any; +} +interface IgTimePickerMethods { + /** + * Gets the selected list item. + */ + getSelectedListItem(): string; + + /** + * Returns the visibility state of the calendar. + */ + dropDownVisible(): boolean; + + /** + * Returns a reference to the drop-down button UI element of the editor. + */ + dropDownButton(): string; + + /** + * Gets reference to jquery object which is used as container of drop-down list. + */ + dropDownContainer(): string; + + /** + * Finds index of list item by text that matches with the search parameters. + * + * @param text The text to search for in the drop down list. + * @param matchType The rule that is applied for searching the text. + */ + findListItemIndex(text: string, matchType?: Object): number; + + /** + * Gets the index of the selected list item. Sets selected item by index. + * + * @param index The index of the item that needs to be selected. + */ + selectedListIndex(index?: number): number; + value(newValue: Object): void; + selectDate(): void; + + /** + * Changes the the regional settings of widget element to the language specified in [options.regional](ui.igdateeditor#options:regional) + * Note that this method is for rare scenarios, use [regional](ui.igdateeditor#options:regional) option setter + */ + changeRegional(): void; + + /** + * Gets selected date as a date object. This method can be used when dataMode is set as either displayModeText or editModeText. + * In such cases the value() method will not return date object and getSelectedDate() can be used to replace that functionality. + */ + getSelectedDate(): Date; + + /** + * Increases the date or time period, depending on the current cursor position. + * + * @param delta The increase delta. + */ + spinUp(delta?: number): void; + + /** + * Decreases the date or time period, depending on the current cursor position. + * + * @param delta The decrease delta. + */ + spinDown(delta?: number): void; + + /** + * Returns a reference to the spin up UI element of the editor. + */ + spinUpButton(): string; + + /** + * Returns a reference to the spin down UI element of the editor. + */ + spinDownButton(): string; + + /** + * Checks if the value in the editor is valid. Note: This function will not trigger automatic notifications. + */ + isValid(): boolean; +} +interface JQuery { + data(propertyName: "igTimePicker"): IgTimePickerMethods; +} + interface JQuery { igBaseEditor(methodName: "inputName", newValue?: string): string; igBaseEditor(methodName: "value", newValue: Object): void; @@ -29031,6 +30325,7 @@ interface JQuery { /** * Gets/Sets the width of the control. + * */ igBaseEditor(optionLiteral: 'option', optionName: "width"): string|number; @@ -29038,6 +30333,7 @@ interface JQuery { /** * /Sets the width of the control. * + * * @optionValue New value to be set. */ @@ -29045,6 +30341,7 @@ interface JQuery { /** * Gets/Sets the height of the control. + * */ igBaseEditor(optionLiteral: 'option', optionName: "height"): string|number; @@ -29052,6 +30349,7 @@ interface JQuery { /** * /Sets the height of the control. * + * * @optionValue New value to be set. */ @@ -29059,24 +30357,28 @@ interface JQuery { /** * Gets/Sets value in editor. The effect of setting/getting that option depends on type of editor and on dataMode options for every type of editor. + * */ igBaseEditor(optionLiteral: 'option', optionName: "value"): any; /** * /Sets value in editor. The effect of setting/getting that option depends on type of editor and on dataMode options for every type of editor. * + * * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "value", optionValue: any): void; /** * Gets/Sets tabIndex attribute for the editor input. + * */ igBaseEditor(optionLiteral: 'option', optionName: "tabIndex"): number; /** * /Sets tabIndex attribute for the editor input. * + * * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "tabIndex", optionValue: number): void; @@ -29084,6 +30386,7 @@ interface JQuery { /** * Gets/Sets whether the editor value can become null. * If that option is false, and editor has no value, then value is set to an empty string. + * */ igBaseEditor(optionLiteral: 'option', optionName: "allowNullValue"): boolean; @@ -29091,12 +30394,14 @@ interface JQuery { * /Sets whether the editor value can become null. * If that option is false, and editor has no value, then value is set to an empty string. * + * * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "allowNullValue", optionValue: boolean): void; /** * Gets/Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string + * */ igBaseEditor(optionLiteral: 'option', optionName: "nullValue"): string|number; @@ -29104,6 +30409,7 @@ interface JQuery { /** * /Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string * + * * @optionValue New value to be set. */ @@ -29111,36 +30417,42 @@ interface JQuery { /** * Gets/Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. + * */ igBaseEditor(optionLiteral: 'option', optionName: "inputName"): string; /** * /Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. * + * * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "inputName", optionValue: string): void; /** * Gets/Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. + * */ igBaseEditor(optionLiteral: 'option', optionName: "readOnly"): boolean; /** * /Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. * + * * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "readOnly", optionValue: boolean): void; /** * Gets/Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. + * */ igBaseEditor(optionLiteral: 'option', optionName: "disabled"): boolean; /** * /Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. * + * * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "disabled", optionValue: boolean): void; @@ -29149,6 +30461,7 @@ interface JQuery { * Gets/Sets options supported by the [igValidator](ui.igvalidator#options) widget. * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. + * */ igBaseEditor(optionLiteral: 'option', optionName: "validatorOptions"): any; @@ -29157,36 +30470,42 @@ interface JQuery { * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. * + * * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "validatorOptions", optionValue: any): void; /** * Set/Get the locale setting for the widget. + * */ igBaseEditor(optionLiteral: 'option', optionName: "locale"): any; /** * Set/Get the locale setting for the widget. * + * * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "locale", optionValue: any): void; /** * Set/Get the locale language setting for the widget. + * */ igBaseEditor(optionLiteral: 'option', optionName: "language"): string; /** * Set/Get the locale language setting for the widget. * + * * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "language", optionValue: string): void; /** * Set/Get the regional setting for the widget. + * */ igBaseEditor(optionLiteral: 'option', optionName: "regional"): string|Object; @@ -29194,296 +30513,185 @@ interface JQuery { /** * Set/Get the regional setting for the widget. * + * * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; /** - * Event which is raised before rendering of the editor completes. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the editor performing rendering. - * Use ui.element to get a reference to the editor element. + * Fired before rendering of the editor has finished. */ igBaseEditor(optionLiteral: 'option', optionName: "rendering"): RenderingEvent; /** - * Event which is raised before rendering of the editor completes. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the editor performing rendering. - * Use ui.element to get a reference to the editor element. + * Fired before rendering of the editor has finished. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "rendering", optionValue: RenderingEvent): void; /** - * Event which is raised after rendering of the editor completes. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the editor performing rendering. - * Use ui.element to get a reference to the editor element. + * Fired after rendering of the editor has finished. */ igBaseEditor(optionLiteral: 'option', optionName: "rendered"): RenderedEvent; /** - * Event which is raised after rendering of the editor completes. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the editor performing rendering. - * Use ui.element to get a reference to the editor element. + * Fired after rendering of the editor has finished. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "rendered", optionValue: RenderedEvent): void; /** - * Event which is raised on mousedown event. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mousedown event. */ igBaseEditor(optionLiteral: 'option', optionName: "mousedown"): MousedownEvent; /** - * Event which is raised on mousedown event. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mousedown event. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "mousedown", optionValue: MousedownEvent): void; /** - * Event which is raised on mouseup event. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseup event. */ igBaseEditor(optionLiteral: 'option', optionName: "mouseup"): MouseupEvent; /** - * Event which is raised on mouseup event. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseup event. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "mouseup", optionValue: MouseupEvent): void; /** - * Event which is raised on mousemove at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mousemove at any part of editor including the drop-down list. */ igBaseEditor(optionLiteral: 'option', optionName: "mousemove"): MousemoveEvent; /** - * Event which is raised on mousemove at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mousemove at any part of editor including the drop-down list. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "mousemove", optionValue: MousemoveEvent): void; /** - * Event which is raised on mouseover at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseover at any part of editor including the drop-down list. */ igBaseEditor(optionLiteral: 'option', optionName: "mouseover"): MouseoverEvent; /** - * Event which is raised on mouseover at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseover at any part of editor including the drop-down list. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "mouseover", optionValue: MouseoverEvent): void; /** - * Event which is raised on mouseleave at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseleave at any part of editor including the drop-down list. */ igBaseEditor(optionLiteral: 'option', optionName: "mouseout"): MouseoutEvent; /** - * Event which is raised on mouseleave at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseleave at any part of editor including the drop-down list. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "mouseout", optionValue: MouseoutEvent): void; /** - * Event which is raised when input field of editor loses focus. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired when the input field of the editor loses focus. */ igBaseEditor(optionLiteral: 'option', optionName: "blur"): BlurEvent; /** - * Event which is raised when input field of editor loses focus. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired when the input field of the editor loses focus. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "blur", optionValue: BlurEvent): void; /** - * Event which is raised when input field of editor gets focus. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired when the input field of the editor gets focus. */ igBaseEditor(optionLiteral: 'option', optionName: "focus"): IgFocusEvent; /** - * Event which is raised when input field of editor gets focus. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired when the input field of the editor gets focus. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "focus", optionValue: IgFocusEvent): void; /** - * Event which is raised on keydown event. + * Fired on keydown event. * Return false in order to cancel key action. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. */ igBaseEditor(optionLiteral: 'option', optionName: "keydown"): KeydownEvent; /** - * Event which is raised on keydown event. + * Fired on keydown event. * Return false in order to cancel key action. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "keydown", optionValue: KeydownEvent): void; /** - * Event which is raised on keypress event. + * Fired on keypress event. * Return false in order to cancel key action. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. */ igBaseEditor(optionLiteral: 'option', optionName: "keypress"): KeypressEvent; /** - * Event which is raised on keypress event. + * Fired on keypress event. * Return false in order to cancel key action. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "keypress", optionValue: KeypressEvent): void; /** - * Event which is raised on keyup event. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. + * Fired on keyup event. */ igBaseEditor(optionLiteral: 'option', optionName: "keyup"): KeyupEvent; /** - * Event which is raised on keyup event. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. + * Fired on keyup event. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "keyup", optionValue: KeyupEvent): void; /** - * Event which is raised before the editor value is changed. + * Fired before changing the editor's value. * Return false in order to cancel change. * It can be raised after loosing focus or on spin events. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.newValue to obtain the new value. - * Use ui.oldValue to obtain the old value. - * Use ui.editorInput to obtain reference to the editor input. */ igBaseEditor(optionLiteral: 'option', optionName: "valueChanging"): ValueChangingEvent; /** - * Event which is raised before the editor value is changed. + * Fired before changing the editor's value. * Return false in order to cancel change. * It can be raised after loosing focus or on spin events. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.newValue to obtain the new value. - * Use ui.oldValue to obtain the old value. - * Use ui.editorInput to obtain reference to the editor input. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "valueChanging", optionValue: ValueChangingEvent): void; /** - * Event which is raised after the editor value is changed. It can be raised after loosing focus or on spin events. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.newValue to obtain the value entered from the user after internal formatting. - * Use ui.originalValue to obtain the value entered from the user before internal formatting. - * Use ui.editorInput to obtain reference to the editor input. + * Fired after the editor value is changed. It can be raised after loosing focus or on spin events. */ igBaseEditor(optionLiteral: 'option', optionName: "valueChanged"): ValueChangedEvent; /** - * Event which is raised after the editor value is changed. It can be raised after loosing focus or on spin events. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.newValue to obtain the value entered from the user after internal formatting. - * Use ui.originalValue to obtain the value entered from the user before internal formatting. - * Use ui.editorInput to obtain reference to the editor input. + * Fired after the editor value is changed. It can be raised after loosing focus or on spin events. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igBaseEditor(optionLiteral: 'option', optionName: "valueChanged", optionValue: ValueChangedEvent): void; igBaseEditor(options: IgBaseEditor): JQuery; @@ -29528,6 +30736,7 @@ interface JQuery { /** * Gets visibility of the spin, clear and drop-down button. That option can be set only on initialization. Combinations like 'dropdown,spin' or 'spin,clear' are supported too.Note! This option can not be set runtime. + * */ igTextEditor(optionLiteral: 'option', optionName: "buttonType"): string; @@ -29535,6 +30744,7 @@ interface JQuery { /** * Visibility of the spin, clear and drop-down button. That option can be set only on initialization. Combinations like 'dropdown,spin' or 'spin,clear' are supported too.Note! This option can not be set runtime. * + * * @optionValue New value to be set. */ @@ -29543,6 +30753,7 @@ interface JQuery { /** * Gets/Sets list of items which are used as a source for the drop-down list. * Items in the list can be of type string. + * */ igTextEditor(optionLiteral: 'option', optionName: "listItems"): any[]; @@ -29550,30 +30761,35 @@ interface JQuery { * /Sets list of items which are used as a source for the drop-down list. * Items in the list can be of type string. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "listItems", optionValue: any[]): void; /** * Gets/Sets custom width of the drop-down list in pixels. If the value is equal to 0 or negative, then the width of editor is set as a drop-down width. + * */ igTextEditor(optionLiteral: 'option', optionName: "listWidth"): number; /** * /Sets custom width of the drop-down list in pixels. If the value is equal to 0 or negative, then the width of editor is set as a drop-down width. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "listWidth", optionValue: number): void; /** * Gets/Sets the hover/unhover animation duration of a drop-down list item. + * */ igTextEditor(optionLiteral: 'option', optionName: "listItemHoverDuration"): number; /** * /Sets the hover/unhover animation duration of a drop-down list item. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "listItemHoverDuration", optionValue: number): void; @@ -29583,6 +30799,7 @@ interface JQuery { * If the option is set to false the editor will attach the drop-down list element to the editor container * If the option is set to true the editor will attach its drop-down list to as a child of the body. * Note! This option can not be set runtime. + * */ igTextEditor(optionLiteral: 'option', optionName: "dropDownAttachedToBody"): boolean; @@ -29592,18 +30809,21 @@ interface JQuery { * If the option is set to true the editor will attach its drop-down list to as a child of the body. * Note! This option can not be set runtime. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "dropDownAttachedToBody", optionValue: boolean): void; /** * Gets/Sets show/hide drop-down list animation duration in milliseconds. + * */ igTextEditor(optionLiteral: 'option', optionName: "dropDownAnimationDuration"): number; /** * /Sets show/hide drop-down list animation duration in milliseconds. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "dropDownAnimationDuration", optionValue: number): void; @@ -29613,6 +30833,7 @@ interface JQuery { * Notes: * This option is overwritten if the number of list items is less than the set value. In that case the drop-down list displays all the items. * This option can not be set runtime. + * */ igTextEditor(optionLiteral: 'option', optionName: "visibleItemsCount"): number; @@ -29622,6 +30843,7 @@ interface JQuery { * This option is overwritten if the number of list items is less than the set value. In that case the drop-down list displays all the items. * This option can not be set runtime. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "visibleItemsCount", optionValue: number): void; @@ -29631,6 +30853,7 @@ interface JQuery { * Notes: * If both "excludeKeys" and "includeKeys" options are used, then "excludeKeys" has priority and includeKeys options is not respected. * The option is case sensitive! If the option is set runtime it's not applied on the current value. + * */ igTextEditor(optionLiteral: 'option', optionName: "includeKeys"): string; @@ -29640,6 +30863,7 @@ interface JQuery { * If both "excludeKeys" and "includeKeys" options are used, then "excludeKeys" has priority and includeKeys options is not respected. * The option is case sensitive! If the option is set runtime it's not applied on the current value. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "includeKeys", optionValue: string): void; @@ -29649,6 +30873,7 @@ interface JQuery { * Notes: * If both "excludeKeys" and "includeKeys" options are used, then "excludeKeys" has priority and includeKeys options is not respected. * The option is case sensitive! If the option is set runtime it's not applied on the current value. + * */ igTextEditor(optionLiteral: 'option', optionName: "excludeKeys"): string; @@ -29658,12 +30883,14 @@ interface JQuery { * If both "excludeKeys" and "includeKeys" options are used, then "excludeKeys" has priority and includeKeys options is not respected. * The option is case sensitive! If the option is set runtime it's not applied on the current value. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "excludeKeys", optionValue: string): void; /** * Gets/Sets the horizontal alignment of the text in the editor. + * */ igTextEditor(optionLiteral: 'option', optionName: "textAlign"): string; @@ -29671,6 +30898,7 @@ interface JQuery { /** * /Sets the horizontal alignment of the text in the editor. * + * * @optionValue New value to be set. */ @@ -29678,18 +30906,21 @@ interface JQuery { /** * Gets/Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. + * */ igTextEditor(optionLiteral: 'option', optionName: "placeHolder"): string; /** * /Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "placeHolder", optionValue: string): void; /** * Gets/Sets the action when the editor gets focused. The default value is selectAll. + * */ igTextEditor(optionLiteral: 'option', optionName: "selectionOnFocus"): string; @@ -29697,6 +30928,7 @@ interface JQuery { /** * /Sets the action when the editor gets focused. The default value is selectAll. * + * * @optionValue New value to be set. */ @@ -29704,6 +30936,7 @@ interface JQuery { /** * Gets the text mode of the editor such as: single-line text editor, password editor or multiline editor. That option has effect only on initialization. If based element (selector) is TEXTAREA, then it is used as input-field. + * */ igTextEditor(optionLiteral: 'option', optionName: "textMode"): string; @@ -29711,6 +30944,7 @@ interface JQuery { /** * The text mode of the editor such as: single-line text editor, password editor or multiline editor. That option has effect only on initialization. If based element (selector) is TEXTAREA, then it is used as input-field. * + * * @optionValue New value to be set. */ @@ -29718,54 +30952,63 @@ interface JQuery { /** * Gets/Sets the ability of the editor to automatically move the dropdown list selection item from one end to the opposite side. When the last item is reached and spin down is performed, the first item gets selected and vice versa. This option has no effect there is no drop-down list. + * */ igTextEditor(optionLiteral: 'option', optionName: "spinWrapAround"): boolean; /** * /Sets the ability of the editor to automatically move the dropdown list selection item from one end to the opposite side. When the last item is reached and spin down is performed, the first item gets selected and vice versa. This option has no effect there is no drop-down list. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "spinWrapAround", optionValue: boolean): void; /** * Gets/Sets if the editor should only allow values from the list of items. Matching is case-insensitive. + * */ igTextEditor(optionLiteral: 'option', optionName: "isLimitedToListValues"): boolean; /** * /Sets if the editor should only allow values from the list of items. Matching is case-insensitive. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "isLimitedToListValues", optionValue: boolean): void; /** * Gets/Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. + * */ igTextEditor(optionLiteral: 'option', optionName: "revertIfNotValid"): boolean; /** * /Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "revertIfNotValid", optionValue: boolean): void; /** * Gets/Sets if the editor should prevent form submition when enter key is pressed. + * */ igTextEditor(optionLiteral: 'option', optionName: "preventSubmitOnEnter"): boolean; /** * /Sets if the editor should prevent form submition when enter key is pressed. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "preventSubmitOnEnter", optionValue: boolean): void; /** * Gets/Sets the drop-down list opening orientation when the list gets open. If the option is set to auto the editor has priority to open the drop-down list bottom. If the space is not enough it tries to open the list top. If the space is not enough in both directions then the list gets opened at the bottom of the editor. + * */ igTextEditor(optionLiteral: 'option', optionName: "dropDownOrientation"): string; @@ -29773,6 +31016,7 @@ interface JQuery { /** * /Sets the drop-down list opening orientation when the list gets open. If the option is set to auto the editor has priority to open the drop-down list bottom. If the space is not enough it tries to open the list top. If the space is not enough in both directions then the list gets opened at the bottom of the editor. * + * * @optionValue New value to be set. */ @@ -29781,6 +31025,7 @@ interface JQuery { /** * Gets/Sets the maximum length of a text which can be entered by the user. * Negative values or 0 disables that behavior. If set at runtime the editor doesn't apply the option to the cuurent value. + * */ igTextEditor(optionLiteral: 'option', optionName: "maxLength"): number; @@ -29788,6 +31033,7 @@ interface JQuery { * /Sets the maximum length of a text which can be entered by the user. * Negative values or 0 disables that behavior. If set at runtime the editor doesn't apply the option to the cuurent value. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "maxLength", optionValue: number): void; @@ -29796,6 +31042,7 @@ interface JQuery { * Gets the ability to limit the editor to be used only as a dropdown list. When set to true the editor input is not editable. * Note! In case there are no list items - the editor will reamin readonly * Note! This option can not be set runtime. + * */ igTextEditor(optionLiteral: 'option', optionName: "dropDownOnReadOnly"): boolean; @@ -29804,6 +31051,7 @@ interface JQuery { * Note! In case there are no list items - the editor will reamin readonly * Note! This option can not be set runtime. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "dropDownOnReadOnly", optionValue: boolean): void; @@ -29811,6 +31059,7 @@ interface JQuery { /** * Gets/Sets the ability to convert the input characters to upper case (true) or keeps the characters as they are (false). The option has effect only while keyboard entries and paste. * Note! When the option is set at runtime the editor is not changing the current value. + * */ igTextEditor(optionLiteral: 'option', optionName: "toUpper"): boolean; @@ -29818,6 +31067,7 @@ interface JQuery { * /Sets the ability to convert the input characters to upper case (true) or keeps the characters as they are (false). The option has effect only while keyboard entries and paste. * Note! When the option is set at runtime the editor is not changing the current value. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "toUpper", optionValue: boolean): void; @@ -29825,6 +31075,7 @@ interface JQuery { /** * Gets/Sets the ability to convert the input characters to lower case (true) or keeps the characters as they are (false). The option has effect only while keyboard entries and paste. * Note! When the option is set at runtime the editor is not changing the current value. + * */ igTextEditor(optionLiteral: 'option', optionName: "toLower"): boolean; @@ -29832,18 +31083,21 @@ interface JQuery { * /Sets the ability to convert the input characters to lower case (true) or keeps the characters as they are (false). The option has effect only while keyboard entries and paste. * Note! When the option is set at runtime the editor is not changing the current value. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "toLower", optionValue: boolean): void; /** * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. + * */ igTextEditor(optionLiteral: 'option', optionName: "suppressNotifications"): boolean; /** * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "suppressNotifications", optionValue: boolean): void; @@ -29852,6 +31106,7 @@ interface JQuery { * Gets/Sets whether the onscreen keyboard (if available on device) should be shown when the dropdown button is clicked/tapped. This option prevents initial focus or removes it when the drop button is clicked/tapped. * Note: The option does not perform device detection so its behavior is always active if enabled. * Note: When drop down is opened the only way to close it will be using the drop down button. + * */ igTextEditor(optionLiteral: 'option', optionName: "suppressKeyboard"): boolean; @@ -29860,12 +31115,14 @@ interface JQuery { * Note: The option does not perform device detection so its behavior is always active if enabled. * Note: When drop down is opened the only way to close it will be using the drop down button. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "suppressKeyboard", optionValue: boolean): void; /** * Gets/Sets the width of the control. + * */ igTextEditor(optionLiteral: 'option', optionName: "width"): string|number; @@ -29873,6 +31130,7 @@ interface JQuery { /** * /Sets the width of the control. * + * * @optionValue New value to be set. */ @@ -29880,6 +31138,7 @@ interface JQuery { /** * Gets/Sets the height of the control. + * */ igTextEditor(optionLiteral: 'option', optionName: "height"): string|number; @@ -29887,6 +31146,7 @@ interface JQuery { /** * /Sets the height of the control. * + * * @optionValue New value to be set. */ @@ -29894,24 +31154,28 @@ interface JQuery { /** * Gets/Sets value in editor. The effect of setting/getting that option depends on type of editor and on dataMode options for every type of editor. + * */ igTextEditor(optionLiteral: 'option', optionName: "value"): any; /** * /Sets value in editor. The effect of setting/getting that option depends on type of editor and on dataMode options for every type of editor. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "value", optionValue: any): void; /** * Gets/Sets tabIndex attribute for the editor input. + * */ igTextEditor(optionLiteral: 'option', optionName: "tabIndex"): number; /** * /Sets tabIndex attribute for the editor input. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "tabIndex", optionValue: number): void; @@ -29919,6 +31183,7 @@ interface JQuery { /** * Gets/Sets whether the editor value can become null. * If that option is false, and editor has no value, then value is set to an empty string. + * */ igTextEditor(optionLiteral: 'option', optionName: "allowNullValue"): boolean; @@ -29926,12 +31191,14 @@ interface JQuery { * /Sets whether the editor value can become null. * If that option is false, and editor has no value, then value is set to an empty string. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "allowNullValue", optionValue: boolean): void; /** * Gets/Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string + * */ igTextEditor(optionLiteral: 'option', optionName: "nullValue"): string|number; @@ -29939,6 +31206,7 @@ interface JQuery { /** * /Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string * + * * @optionValue New value to be set. */ @@ -29946,36 +31214,42 @@ interface JQuery { /** * Gets/Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. + * */ igTextEditor(optionLiteral: 'option', optionName: "inputName"): string; /** * /Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "inputName", optionValue: string): void; /** * Gets/Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. + * */ igTextEditor(optionLiteral: 'option', optionName: "readOnly"): boolean; /** * /Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "readOnly", optionValue: boolean): void; /** * Gets/Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. + * */ igTextEditor(optionLiteral: 'option', optionName: "disabled"): boolean; /** * /Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "disabled", optionValue: boolean): void; @@ -29984,6 +31258,7 @@ interface JQuery { * Gets/Sets options supported by the [igValidator](ui.igvalidator#options) widget. * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. + * */ igTextEditor(optionLiteral: 'option', optionName: "validatorOptions"): any; @@ -29992,36 +31267,42 @@ interface JQuery { * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "validatorOptions", optionValue: any): void; /** * Set/Get the locale setting for the widget. + * */ igTextEditor(optionLiteral: 'option', optionName: "locale"): any; /** * Set/Get the locale setting for the widget. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "locale", optionValue: any): void; /** * Set/Get the locale language setting for the widget. + * */ igTextEditor(optionLiteral: 'option', optionName: "language"): string; /** * Set/Get the locale language setting for the widget. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "language", optionValue: string): void; /** * Set/Get the regional setting for the widget. + * */ igTextEditor(optionLiteral: 'option', optionName: "regional"): string|Object; @@ -30029,442 +31310,271 @@ interface JQuery { /** * Set/Get the regional setting for the widget. * + * * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; /** - * Event which is raised when the drop down is opening. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired when the drop down is opening. */ igTextEditor(optionLiteral: 'option', optionName: "dropDownListOpening"): DropDownListOpeningEvent; /** - * Event which is raised when the drop down is opening. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired when the drop down is opening. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "dropDownListOpening", optionValue: DropDownListOpeningEvent): void; /** - * Event which is raised after the drop down is opened. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired after the drop down is opened. */ igTextEditor(optionLiteral: 'option', optionName: "dropDownListOpened"): DropDownListOpenedEvent; /** - * Event which is raised after the drop down is opened. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired after the drop down is opened. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "dropDownListOpened", optionValue: DropDownListOpenedEvent): void; /** - * Event which is raised when the drop down is closing. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired when the drop down is closing. */ igTextEditor(optionLiteral: 'option', optionName: "dropDownListClosing"): DropDownListClosingEvent; /** - * Event which is raised when the drop down is closing. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired when the drop down is closing. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "dropDownListClosing", optionValue: DropDownListClosingEvent): void; /** - * Event which is raised after the drop down is closed. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired after the drop down is closed. */ igTextEditor(optionLiteral: 'option', optionName: "dropDownListClosed"): DropDownListClosedEvent; /** - * Event which is raised after the drop down is closed. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired after the drop down is closed. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "dropDownListClosed", optionValue: DropDownListClosedEvent): void; /** - * Event which is raised when an item in the drop down list is being selected. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. - * Use ui.item to obtain reference to the list item which is about to be selected. + * Fired when an item in the drop down list is being selected. */ igTextEditor(optionLiteral: 'option', optionName: "dropDownItemSelecting"): DropDownItemSelectingEvent; /** - * Event which is raised when an item in the drop down list is being selected. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. - * Use ui.item to obtain reference to the list item which is about to be selected. + * Fired when an item in the drop down list is being selected. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "dropDownItemSelecting", optionValue: DropDownItemSelectingEvent): void; /** - * Event which is raised after an item in the drop down list is selected. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. - * Use ui.item to obtain reference to the list item which is selected. + * Fired after an item in the drop down list is selected. */ igTextEditor(optionLiteral: 'option', optionName: "dropDownItemSelected"): DropDownItemSelectedEvent; /** - * Event which is raised after an item in the drop down list is selected. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. - * Use ui.item to obtain reference to the list item which is selected. + * Fired after an item in the drop down list is selected. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "dropDownItemSelected", optionValue: DropDownItemSelectedEvent): void; /** - * Event which is raised after text in the editor was changed. It can be raised when keyUp event occurs, + * Fired after the editor's text has been changed. It can be raised when keyUp event occurs, * when the clear button is clicked or when an item from a list is selected. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.text to obtain new text - * Use ui.oldText to obtain the old text. */ igTextEditor(optionLiteral: 'option', optionName: "textChanged"): TextChangedEvent; /** - * Event which is raised after text in the editor was changed. It can be raised when keyUp event occurs, + * Fired after the editor's text has been changed. It can be raised when keyUp event occurs, * when the clear button is clicked or when an item from a list is selected. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.text to obtain new text - * Use ui.oldText to obtain the old text. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "textChanged", optionValue: TextChangedEvent): void; /** - * Event which is raised before rendering of the editor completes. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the editor performing rendering. - * Use ui.element to get a reference to the editor element. + * Fired before rendering of the editor has finished. */ igTextEditor(optionLiteral: 'option', optionName: "rendering"): RenderingEvent; /** - * Event which is raised before rendering of the editor completes. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the editor performing rendering. - * Use ui.element to get a reference to the editor element. + * Fired before rendering of the editor has finished. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "rendering", optionValue: RenderingEvent): void; /** - * Event which is raised after rendering of the editor completes. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the editor performing rendering. - * Use ui.element to get a reference to the editor element. + * Fired after rendering of the editor has finished. */ igTextEditor(optionLiteral: 'option', optionName: "rendered"): RenderedEvent; /** - * Event which is raised after rendering of the editor completes. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the editor performing rendering. - * Use ui.element to get a reference to the editor element. + * Fired after rendering of the editor has finished. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "rendered", optionValue: RenderedEvent): void; /** - * Event which is raised on mousedown event. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mousedown event. */ igTextEditor(optionLiteral: 'option', optionName: "mousedown"): MousedownEvent; /** - * Event which is raised on mousedown event. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mousedown event. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "mousedown", optionValue: MousedownEvent): void; /** - * Event which is raised on mouseup event. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseup event. */ igTextEditor(optionLiteral: 'option', optionName: "mouseup"): MouseupEvent; /** - * Event which is raised on mouseup event. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseup event. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "mouseup", optionValue: MouseupEvent): void; /** - * Event which is raised on mousemove at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mousemove at any part of editor including the drop-down list. */ igTextEditor(optionLiteral: 'option', optionName: "mousemove"): MousemoveEvent; /** - * Event which is raised on mousemove at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mousemove at any part of editor including the drop-down list. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "mousemove", optionValue: MousemoveEvent): void; /** - * Event which is raised on mouseover at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseover at any part of editor including the drop-down list. */ igTextEditor(optionLiteral: 'option', optionName: "mouseover"): MouseoverEvent; /** - * Event which is raised on mouseover at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseover at any part of editor including the drop-down list. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "mouseover", optionValue: MouseoverEvent): void; /** - * Event which is raised on mouseleave at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseleave at any part of editor including the drop-down list. */ igTextEditor(optionLiteral: 'option', optionName: "mouseout"): MouseoutEvent; /** - * Event which is raised on mouseleave at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseleave at any part of editor including the drop-down list. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "mouseout", optionValue: MouseoutEvent): void; /** - * Event which is raised when input field of editor loses focus. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired when the input field of the editor loses focus. */ igTextEditor(optionLiteral: 'option', optionName: "blur"): BlurEvent; /** - * Event which is raised when input field of editor loses focus. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired when the input field of the editor loses focus. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "blur", optionValue: BlurEvent): void; /** - * Event which is raised when input field of editor gets focus. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired when the input field of the editor gets focus. */ igTextEditor(optionLiteral: 'option', optionName: "focus"): IgFocusEvent; /** - * Event which is raised when input field of editor gets focus. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired when the input field of the editor gets focus. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "focus", optionValue: IgFocusEvent): void; /** - * Event which is raised on keydown event. + * Fired on keydown event. * Return false in order to cancel key action. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. */ igTextEditor(optionLiteral: 'option', optionName: "keydown"): KeydownEvent; /** - * Event which is raised on keydown event. + * Fired on keydown event. * Return false in order to cancel key action. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "keydown", optionValue: KeydownEvent): void; /** - * Event which is raised on keypress event. + * Fired on keypress event. * Return false in order to cancel key action. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. */ igTextEditor(optionLiteral: 'option', optionName: "keypress"): KeypressEvent; /** - * Event which is raised on keypress event. + * Fired on keypress event. * Return false in order to cancel key action. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "keypress", optionValue: KeypressEvent): void; /** - * Event which is raised on keyup event. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. + * Fired on keyup event. */ igTextEditor(optionLiteral: 'option', optionName: "keyup"): KeyupEvent; /** - * Event which is raised on keyup event. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. + * Fired on keyup event. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "keyup", optionValue: KeyupEvent): void; /** - * Event which is raised before the editor value is changed. + * Fired before changing the editor's value. * Return false in order to cancel change. * It can be raised after loosing focus or on spin events. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.newValue to obtain the new value. - * Use ui.oldValue to obtain the old value. - * Use ui.editorInput to obtain reference to the editor input. */ igTextEditor(optionLiteral: 'option', optionName: "valueChanging"): ValueChangingEvent; /** - * Event which is raised before the editor value is changed. + * Fired before changing the editor's value. * Return false in order to cancel change. * It can be raised after loosing focus or on spin events. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.newValue to obtain the new value. - * Use ui.oldValue to obtain the old value. - * Use ui.editorInput to obtain reference to the editor input. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "valueChanging", optionValue: ValueChangingEvent): void; /** - * Event which is raised after the editor value is changed. It can be raised after loosing focus or on spin events. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.newValue to obtain the value entered from the user after internal formatting. - * Use ui.originalValue to obtain the value entered from the user before internal formatting. - * Use ui.editorInput to obtain reference to the editor input. + * Fired after the editor value is changed. It can be raised after loosing focus or on spin events. */ igTextEditor(optionLiteral: 'option', optionName: "valueChanged"): ValueChangedEvent; /** - * Event which is raised after the editor value is changed. It can be raised after loosing focus or on spin events. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.newValue to obtain the value entered from the user after internal formatting. - * Use ui.originalValue to obtain the value entered from the user before internal formatting. - * Use ui.editorInput to obtain reference to the editor input. + * Fired after the editor value is changed. It can be raised after loosing focus or on spin events. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igTextEditor(optionLiteral: 'option', optionName: "valueChanged", optionValue: ValueChangedEvent): void; igTextEditor(options: IgTextEditor): JQuery; @@ -30503,6 +31613,7 @@ interface JQuery { /** * Gets/Sets list of items which are used as a source for the drop-down list. * Items in the list can be of type number. + * */ igNumericEditor(optionLiteral: 'option', optionName: "listItems"): any[]; @@ -30510,6 +31621,7 @@ interface JQuery { * /Sets list of items which are used as a source for the drop-down list. * Items in the list can be of type number. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "listItems", optionValue: any[]): void; @@ -30519,6 +31631,7 @@ interface JQuery { * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [groupSeparator](ui.igNumericEditor#options:groupSeparator) or [decimalSeparator](ui.igNumericEditor#options:decimalSeparator) options. + * */ igNumericEditor(optionLiteral: 'option', optionName: "negativeSign"): string; @@ -30528,6 +31641,7 @@ interface JQuery { * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [groupSeparator](ui.igNumericEditor#options:groupSeparator) or [decimalSeparator](ui.igNumericEditor#options:decimalSeparator) options. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "negativeSign", optionValue: string): void; @@ -30536,6 +31650,7 @@ interface JQuery { * Gets/Sets the string, which is used as negative pattern. The "n" flag represents the value of number. The "-" and "()" flags are static part of pattern. * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. + * */ igNumericEditor(optionLiteral: 'option', optionName: "negativePattern"): string; @@ -30544,6 +31659,7 @@ interface JQuery { * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "negativePattern", optionValue: string): void; @@ -30553,6 +31669,7 @@ interface JQuery { * Note: this option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [groupSeparator](ui.igNumericEditor#options:groupSeparator) or [negativeSign](ui.igNumericEditor#options:negativeSign) options. + * */ igNumericEditor(optionLiteral: 'option', optionName: "decimalSeparator"): string; @@ -30562,6 +31679,7 @@ interface JQuery { * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [groupSeparator](ui.igNumericEditor#options:groupSeparator) or [negativeSign](ui.igNumericEditor#options:negativeSign) options. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "decimalSeparator", optionValue: string): void; @@ -30572,6 +31690,7 @@ interface JQuery { * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [decimalSeparator](ui.igNumericEditor#options:decimalSeparator) or [negativeSign](ui.igNumericEditor#options:negativeSign) options. + * */ igNumericEditor(optionLiteral: 'option', optionName: "groupSeparator"): string; @@ -30582,6 +31701,7 @@ interface JQuery { * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [decimalSeparator](ui.igNumericEditor#options:decimalSeparator) or [negativeSign](ui.igNumericEditor#options:negativeSign) options. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "groupSeparator", optionValue: string): void; @@ -30595,6 +31715,7 @@ interface JQuery { * Note: The numbers in the array must be positive integers. * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. + * */ igNumericEditor(optionLiteral: 'option', optionName: "groups"): any[]; @@ -30608,6 +31729,7 @@ interface JQuery { * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "groups", optionValue: any[]): void; @@ -30618,6 +31740,7 @@ interface JQuery { * Note: In case of min decimals value higher than max decimals - max decimals are equaled to min decimals property. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option supports values between 0 and 15, when dataMode is 'double' (default) and values between 0 and 7 in 'float' mode. + * */ igNumericEditor(optionLiteral: 'option', optionName: "maxDecimals"): number; @@ -30628,6 +31751,7 @@ interface JQuery { * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option supports values between 0 and 15, when dataMode is 'double' (default) and values between 0 and 7 in 'float' mode. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "maxDecimals", optionValue: number): void; @@ -30639,6 +31763,7 @@ interface JQuery { * Note: In case of min decimals value higher than max decimals - max decimals are equaled to min decimals property. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option supports values between 0 and 15, when dataMode is 'double' (default) and values between 0 and 7 in 'float' mode. + * */ igNumericEditor(optionLiteral: 'option', optionName: "minDecimals"): number; @@ -30650,6 +31775,7 @@ interface JQuery { * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option supports values between 0 and 15, when dataMode is 'double' (default) and values between 0 and 7 in 'float' mode. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "minDecimals", optionValue: number): void; @@ -30658,6 +31784,7 @@ interface JQuery { * Gets/Sets whether the last decimal place will be rounded, when the maxDecimal option is defined and applied. * For example if the initial editor value is set to 123.4567, maxDecimals option is set to 3 and roundDecimals is enabled, * then editor will round the value and will display it as 123.457. If roundDecimals is disabled then editor value will be truncated to 123.456. + * */ igNumericEditor(optionLiteral: 'option', optionName: "roundDecimals"): boolean; @@ -30666,12 +31793,14 @@ interface JQuery { * For example if the initial editor value is set to 123.4567, maxDecimals option is set to 3 and roundDecimals is enabled, * then editor will round the value and will display it as 123.457. If roundDecimals is disabled then editor value will be truncated to 123.456. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "roundDecimals", optionValue: boolean): void; /** * Gets/Sets the horizontal alignment of the text in the editor. + * */ igNumericEditor(optionLiteral: 'option', optionName: "textAlign"): string; @@ -30679,6 +31808,7 @@ interface JQuery { /** * /Sets the horizontal alignment of the text in the editor. * + * * @optionValue New value to be set. */ @@ -30688,6 +31818,7 @@ interface JQuery { * Defines the range that editor's value can accept.This is achieved by setting the [minValue](ui.igNumericEditor#options:minValue) and [maxValue](ui.igNumericEditor#options:maxValue) editor's options, accordingly to the lowest and highest accepted values for the defined numeric mode. * The range for the specific type follows the numeric type standards, e.g. in .NET Framework [floating-point](https://msdn.microsoft.com/en-us/library/9ahet949.aspx) types and [integral types](https://msdn.microsoft.com/en-us/library/exx3b86w.aspx). * In addition, the maximum value that can be set to [minDecimals](ui.igNumericEditor#options:minDecimals) and [maxDecimals](ui.igNumericEditor#options:maxDecimals) options can be 15, when editor is in 'double' mode and 7, when in 'float' mode. + * */ igNumericEditor(optionLiteral: 'option', optionName: "dataMode"): string; @@ -30697,6 +31828,7 @@ interface JQuery { * The range for the specific type follows the numeric type standards, e.g. in .NET Framework [floating-point](https://msdn.microsoft.com/en-us/library/9ahet949.aspx) types and [integral types](https://msdn.microsoft.com/en-us/library/exx3b86w.aspx). * In addition, the maximum value that can be set to [minDecimals](ui.igNumericEditor#options:minDecimals) and [maxDecimals](ui.igNumericEditor#options:maxDecimals) options can be 15, when editor is in 'double' mode and 7, when in 'float' mode. * + * * @optionValue New value to be set. */ @@ -30704,24 +31836,28 @@ interface JQuery { /** * Gets/Sets the minimum value which can be entered in the editor by the end user. + * */ igNumericEditor(optionLiteral: 'option', optionName: "minValue"): number; /** * /Sets the minimum value which can be entered in the editor by the end user. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "minValue", optionValue: number): void; /** * Gets/Sets the maximum value which can be entered in the editor by the end user. + * */ igNumericEditor(optionLiteral: 'option', optionName: "maxValue"): number; /** * /Sets the maximum value which can be entered in the editor by the end user. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "maxValue", optionValue: number): void; @@ -30729,6 +31865,7 @@ interface JQuery { /** * Gets/Sets whether the editor value can become null. * If that option is disabled, and editor has no value, then value is set to 0 (or minValue/maxValue). + * */ igNumericEditor(optionLiteral: 'option', optionName: "allowNullValue"): boolean; @@ -30736,18 +31873,21 @@ interface JQuery { * /Sets whether the editor value can become null. * If that option is disabled, and editor has no value, then value is set to 0 (or minValue/maxValue). * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "allowNullValue", optionValue: boolean): void; /** * Gets/Sets the default delta-value which is used with "spin" [buttonType](ui.igNumericEditor#options:buttonType) or [spinUp](ui.igNumericEditor#methods:spinUp) and [spinDown](ui.igNumericEditor#methods:spinDown) methods to increment or decrement value in the editor. The value can not be negative. Non integer value is supported only for dataMode double and float. + * */ igNumericEditor(optionLiteral: 'option', optionName: "spinDelta"): number; /** * /Sets the default delta-value which is used with "spin" [buttonType](ui.igNumericEditor#options:buttonType) or [spinUp](ui.igNumericEditor#methods:spinUp) and [spinDown](ui.igNumericEditor#methods:spinDown) methods to increment or decrement value in the editor. The value can not be negative. Non integer value is supported only for dataMode double and float. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "spinDelta", optionValue: number): void; @@ -30756,6 +31896,7 @@ interface JQuery { * Gets/Sets support for scientific format. * If that option is set, then numeric value appears as a string with possible E-power flag. In edit mode the "E" or "e" character can be entered as well. * Notes: The "+" character is not supported in edit mode. + * */ igNumericEditor(optionLiteral: 'option', optionName: "scientificFormat"): string; @@ -30765,6 +31906,7 @@ interface JQuery { * If that option is set, then numeric value appears as a string with possible E-power flag. In edit mode the "E" or "e" character can be entered as well. * Notes: The "+" character is not supported in edit mode. * + * * @optionValue New value to be set. */ @@ -30773,6 +31915,7 @@ interface JQuery { /** * Gets/Set the ability of the editor to automatically set value in the editor to the opposite side of the limit, when the spin action reaches minimum or maximum limit. * This applies to [minValue](ui.%%WidgetNameLowered%%#options:minValue) and [maxValue](ui.%%WidgetNameLowered%%#options:maxValue) or cycling through list items if [isLimitedToListValues](ui.%%WidgetNameLowered%%#options:isLimitedToListValues) is enabled. + * */ igNumericEditor(optionLiteral: 'option', optionName: "spinWrapAround"): boolean; @@ -30780,18 +31923,21 @@ interface JQuery { * /Set the ability of the editor to automatically set value in the editor to the opposite side of the limit, when the spin action reaches minimum or maximum limit. * This applies to [minValue](ui.%%WidgetNameLowered%%#options:minValue) and [maxValue](ui.%%WidgetNameLowered%%#options:maxValue) or cycling through list items if [isLimitedToListValues](ui.%%WidgetNameLowered%%#options:isLimitedToListValues) is enabled. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "spinWrapAround", optionValue: boolean): void; /** * Gets/Sets if the editor should only allow values from the list of items. Enabling this also causes spin actions to cycle through list items instead. + * */ igNumericEditor(optionLiteral: 'option', optionName: "isLimitedToListValues"): boolean; /** * /Sets if the editor should only allow values from the list of items. Enabling this also causes spin actions to cycle through list items instead. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "isLimitedToListValues", optionValue: boolean): void; @@ -30863,6 +32009,7 @@ interface JQuery { /** * Gets/Sets value in editor. The effect of setting/getting that option depends on type of editor and on dataMode options for every type of editor. * + * */ igNumericEditor(optionLiteral: 'option', optionName: "value"): any; @@ -30870,12 +32017,14 @@ interface JQuery { * /Sets value in editor. The effect of setting/getting that option depends on type of editor and on dataMode options for every type of editor. * * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "value", optionValue: any): void; /** * Gets visibility of the spin, clear and drop-down button. That option can be set only on initialization. Combinations like 'dropdown,spin' or 'spin,clear' are supported too.Note! This option can not be set runtime. + * */ igNumericEditor(optionLiteral: 'option', optionName: "buttonType"): string; @@ -30883,6 +32032,7 @@ interface JQuery { /** * Visibility of the spin, clear and drop-down button. That option can be set only on initialization. Combinations like 'dropdown,spin' or 'spin,clear' are supported too.Note! This option can not be set runtime. * + * * @optionValue New value to be set. */ @@ -30890,24 +32040,28 @@ interface JQuery { /** * Gets/Sets custom width of the drop-down list in pixels. If the value is equal to 0 or negative, then the width of editor is set as a drop-down width. + * */ igNumericEditor(optionLiteral: 'option', optionName: "listWidth"): number; /** * /Sets custom width of the drop-down list in pixels. If the value is equal to 0 or negative, then the width of editor is set as a drop-down width. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "listWidth", optionValue: number): void; /** * Gets/Sets the hover/unhover animation duration of a drop-down list item. + * */ igNumericEditor(optionLiteral: 'option', optionName: "listItemHoverDuration"): number; /** * /Sets the hover/unhover animation duration of a drop-down list item. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "listItemHoverDuration", optionValue: number): void; @@ -30917,6 +32071,7 @@ interface JQuery { * If the option is set to false the editor will attach the drop-down list element to the editor container * If the option is set to true the editor will attach its drop-down list to as a child of the body. * Note! This option can not be set runtime. + * */ igNumericEditor(optionLiteral: 'option', optionName: "dropDownAttachedToBody"): boolean; @@ -30926,18 +32081,21 @@ interface JQuery { * If the option is set to true the editor will attach its drop-down list to as a child of the body. * Note! This option can not be set runtime. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "dropDownAttachedToBody", optionValue: boolean): void; /** * Gets/Sets show/hide drop-down list animation duration in milliseconds. + * */ igNumericEditor(optionLiteral: 'option', optionName: "dropDownAnimationDuration"): number; /** * /Sets show/hide drop-down list animation duration in milliseconds. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "dropDownAnimationDuration", optionValue: number): void; @@ -30947,6 +32105,7 @@ interface JQuery { * Notes: * This option is overwritten if the number of list items is less than the set value. In that case the drop-down list displays all the items. * This option can not be set runtime. + * */ igNumericEditor(optionLiteral: 'option', optionName: "visibleItemsCount"): number; @@ -30956,24 +32115,28 @@ interface JQuery { * This option is overwritten if the number of list items is less than the set value. In that case the drop-down list displays all the items. * This option can not be set runtime. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "visibleItemsCount", optionValue: number): void; /** * Gets/Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. + * */ igNumericEditor(optionLiteral: 'option', optionName: "placeHolder"): string; /** * /Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "placeHolder", optionValue: string): void; /** * Gets/Sets the action when the editor gets focused. The default value is selectAll. + * */ igNumericEditor(optionLiteral: 'option', optionName: "selectionOnFocus"): string; @@ -30981,6 +32144,7 @@ interface JQuery { /** * /Sets the action when the editor gets focused. The default value is selectAll. * + * * @optionValue New value to be set. */ @@ -30988,30 +32152,35 @@ interface JQuery { /** * Gets/Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. + * */ igNumericEditor(optionLiteral: 'option', optionName: "revertIfNotValid"): boolean; /** * /Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "revertIfNotValid", optionValue: boolean): void; /** * Gets/Sets if the editor should prevent form submition when enter key is pressed. + * */ igNumericEditor(optionLiteral: 'option', optionName: "preventSubmitOnEnter"): boolean; /** * /Sets if the editor should prevent form submition when enter key is pressed. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "preventSubmitOnEnter", optionValue: boolean): void; /** * Gets/Sets the drop-down list opening orientation when the list gets open. If the option is set to auto the editor has priority to open the drop-down list bottom. If the space is not enough it tries to open the list top. If the space is not enough in both directions then the list gets opened at the bottom of the editor. + * */ igNumericEditor(optionLiteral: 'option', optionName: "dropDownOrientation"): string; @@ -31019,6 +32188,7 @@ interface JQuery { /** * /Sets the drop-down list opening orientation when the list gets open. If the option is set to auto the editor has priority to open the drop-down list bottom. If the space is not enough it tries to open the list top. If the space is not enough in both directions then the list gets opened at the bottom of the editor. * + * * @optionValue New value to be set. */ @@ -31028,6 +32198,7 @@ interface JQuery { * Gets the ability to limit the editor to be used only as a dropdown list. When set to true the editor input is not editable. * Note! In case there are no list items - the editor will reamin readonly * Note! This option can not be set runtime. + * */ igNumericEditor(optionLiteral: 'option', optionName: "dropDownOnReadOnly"): boolean; @@ -31036,18 +32207,21 @@ interface JQuery { * Note! In case there are no list items - the editor will reamin readonly * Note! This option can not be set runtime. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "dropDownOnReadOnly", optionValue: boolean): void; /** * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. + * */ igNumericEditor(optionLiteral: 'option', optionName: "suppressNotifications"): boolean; /** * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "suppressNotifications", optionValue: boolean): void; @@ -31056,6 +32230,7 @@ interface JQuery { * Gets/Sets whether the onscreen keyboard (if available on device) should be shown when the dropdown button is clicked/tapped. This option prevents initial focus or removes it when the drop button is clicked/tapped. * Note: The option does not perform device detection so its behavior is always active if enabled. * Note: When drop down is opened the only way to close it will be using the drop down button. + * */ igNumericEditor(optionLiteral: 'option', optionName: "suppressKeyboard"): boolean; @@ -31064,12 +32239,14 @@ interface JQuery { * Note: The option does not perform device detection so its behavior is always active if enabled. * Note: When drop down is opened the only way to close it will be using the drop down button. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "suppressKeyboard", optionValue: boolean): void; /** * Gets/Sets the width of the control. + * */ igNumericEditor(optionLiteral: 'option', optionName: "width"): string|number; @@ -31077,6 +32254,7 @@ interface JQuery { /** * /Sets the width of the control. * + * * @optionValue New value to be set. */ @@ -31084,6 +32262,7 @@ interface JQuery { /** * Gets/Sets the height of the control. + * */ igNumericEditor(optionLiteral: 'option', optionName: "height"): string|number; @@ -31091,6 +32270,7 @@ interface JQuery { /** * /Sets the height of the control. * + * * @optionValue New value to be set. */ @@ -31098,18 +32278,21 @@ interface JQuery { /** * Gets/Sets tabIndex attribute for the editor input. + * */ igNumericEditor(optionLiteral: 'option', optionName: "tabIndex"): number; /** * /Sets tabIndex attribute for the editor input. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "tabIndex", optionValue: number): void; /** * Gets/Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string + * */ igNumericEditor(optionLiteral: 'option', optionName: "nullValue"): string|number; @@ -31117,6 +32300,7 @@ interface JQuery { /** * /Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string * + * * @optionValue New value to be set. */ @@ -31124,36 +32308,42 @@ interface JQuery { /** * Gets/Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. + * */ igNumericEditor(optionLiteral: 'option', optionName: "inputName"): string; /** * /Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "inputName", optionValue: string): void; /** * Gets/Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. + * */ igNumericEditor(optionLiteral: 'option', optionName: "readOnly"): boolean; /** * /Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "readOnly", optionValue: boolean): void; /** * Gets/Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. + * */ igNumericEditor(optionLiteral: 'option', optionName: "disabled"): boolean; /** * /Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "disabled", optionValue: boolean): void; @@ -31162,6 +32352,7 @@ interface JQuery { * Gets/Sets options supported by the [igValidator](ui.igvalidator#options) widget. * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. + * */ igNumericEditor(optionLiteral: 'option', optionName: "validatorOptions"): any; @@ -31170,36 +32361,42 @@ interface JQuery { * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "validatorOptions", optionValue: any): void; /** * Set/Get the locale setting for the widget. + * */ igNumericEditor(optionLiteral: 'option', optionName: "locale"): any; /** * Set/Get the locale setting for the widget. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "locale", optionValue: any): void; /** * Set/Get the locale language setting for the widget. + * */ igNumericEditor(optionLiteral: 'option', optionName: "language"): string; /** * Set/Get the locale language setting for the widget. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "language", optionValue: string): void; /** * Set/Get the regional setting for the widget. + * */ igNumericEditor(optionLiteral: 'option', optionName: "regional"): string|Object; @@ -31207,154 +32404,95 @@ interface JQuery { /** * Set/Get the regional setting for the widget. * + * * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; /** - * Event which is raised when the drop down is opening. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired when the drop down is opening. */ igNumericEditor(optionLiteral: 'option', optionName: "dropDownListOpening"): DropDownListOpeningEvent; /** - * Event which is raised when the drop down is opening. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired when the drop down is opening. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "dropDownListOpening", optionValue: DropDownListOpeningEvent): void; /** - * Event which is raised after the drop down is opened. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired after the drop down is opened. */ igNumericEditor(optionLiteral: 'option', optionName: "dropDownListOpened"): DropDownListOpenedEvent; /** - * Event which is raised after the drop down is opened. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired after the drop down is opened. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "dropDownListOpened", optionValue: DropDownListOpenedEvent): void; /** - * Event which is raised when the drop down is closing. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired when the drop down is closing. */ igNumericEditor(optionLiteral: 'option', optionName: "dropDownListClosing"): DropDownListClosingEvent; /** - * Event which is raised when the drop down is closing. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired when the drop down is closing. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "dropDownListClosing", optionValue: DropDownListClosingEvent): void; /** - * Event which is raised after the drop down is closed. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired after the drop down is closed. */ igNumericEditor(optionLiteral: 'option', optionName: "dropDownListClosed"): DropDownListClosedEvent; /** - * Event which is raised after the drop down is closed. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. + * Fired after the drop down is closed. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "dropDownListClosed", optionValue: DropDownListClosedEvent): void; /** - * Event which is raised when an item in the drop down list is being selected. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. - * Use ui.item to obtain reference to the list item which is about to be selected. + * Fired when an item in the drop down list is being selected. */ igNumericEditor(optionLiteral: 'option', optionName: "dropDownItemSelecting"): DropDownItemSelectingEvent; /** - * Event which is raised when an item in the drop down list is being selected. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. - * Use ui.item to obtain reference to the list item which is about to be selected. + * Fired when an item in the drop down list is being selected. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "dropDownItemSelecting", optionValue: DropDownItemSelectingEvent): void; /** - * Event which is raised after an item in the drop down list is selected. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. - * Use ui.item to obtain reference to the list item which is selected. + * Fired after an item in the drop down list is selected. */ igNumericEditor(optionLiteral: 'option', optionName: "dropDownItemSelected"): DropDownItemSelectedEvent; /** - * Event which is raised after an item in the drop down list is selected. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.list to obtain reference to the list contaier. - * Use ui.item to obtain reference to the list item which is selected. + * Fired after an item in the drop down list is selected. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "dropDownItemSelected", optionValue: DropDownItemSelectedEvent): void; /** - * Event which is raised after text in the editor was changed. It can be raised when keyUp event occurs, + * Fired after the editor's text has been changed. It can be raised when keyUp event occurs, * when the clear button is clicked or when an item from a list is selected. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.text to obtain new text - * Use ui.oldText to obtain the old text. */ igNumericEditor(optionLiteral: 'option', optionName: "textChanged"): TextChangedEvent; /** - * Event which is raised after text in the editor was changed. It can be raised when keyUp event occurs, + * Fired after the editor's text has been changed. It can be raised when keyUp event occurs, * when the clear button is clicked or when an item from a list is selected. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.text to obtain new text - * Use ui.oldText to obtain the old text. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igNumericEditor(optionLiteral: 'option', optionName: "textChanged", optionValue: TextChangedEvent): void; igNumericEditor(options: IgNumericEditor): JQuery; @@ -31381,6 +32519,7 @@ interface JQuery { * Gets/Sets the string, which is used as positive pattern. The "n" flag represents the value of number. * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "positivePattern"): string; @@ -31389,18 +32528,21 @@ interface JQuery { * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "positivePattern", optionValue: string): void; /** * Gets/Sets a string that is used as the currency symbol that is shown in display mode. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "currencySymbol"): string; /** * /Sets a string that is used as the currency symbol that is shown in display mode. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "currencySymbol", optionValue: string): void; @@ -31408,6 +32550,7 @@ interface JQuery { /** * Gets/Sets list of items which are used as a source for the drop-down list. * Items in the list can be of type number. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "listItems"): any[]; @@ -31415,6 +32558,7 @@ interface JQuery { * /Sets list of items which are used as a source for the drop-down list. * Items in the list can be of type number. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "listItems", optionValue: any[]): void; @@ -31424,6 +32568,7 @@ interface JQuery { * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [groupSeparator](ui.igNumericEditor#options:groupSeparator) or [decimalSeparator](ui.igNumericEditor#options:decimalSeparator) options. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "negativeSign"): string; @@ -31433,6 +32578,7 @@ interface JQuery { * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [groupSeparator](ui.igNumericEditor#options:groupSeparator) or [decimalSeparator](ui.igNumericEditor#options:decimalSeparator) options. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "negativeSign", optionValue: string): void; @@ -31441,6 +32587,7 @@ interface JQuery { * Gets/Sets the string, which is used as negative pattern. The "n" flag represents the value of number. The "-" and "()" flags are static part of pattern. * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "negativePattern"): string; @@ -31449,6 +32596,7 @@ interface JQuery { * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "negativePattern", optionValue: string): void; @@ -31458,6 +32606,7 @@ interface JQuery { * Note: this option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [groupSeparator](ui.igNumericEditor#options:groupSeparator) or [negativeSign](ui.igNumericEditor#options:negativeSign) options. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "decimalSeparator"): string; @@ -31467,6 +32616,7 @@ interface JQuery { * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [groupSeparator](ui.igNumericEditor#options:groupSeparator) or [negativeSign](ui.igNumericEditor#options:negativeSign) options. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "decimalSeparator", optionValue: string): void; @@ -31477,6 +32627,7 @@ interface JQuery { * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [decimalSeparator](ui.igNumericEditor#options:decimalSeparator) or [negativeSign](ui.igNumericEditor#options:negativeSign) options. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "groupSeparator"): string; @@ -31487,6 +32638,7 @@ interface JQuery { * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [decimalSeparator](ui.igNumericEditor#options:decimalSeparator) or [negativeSign](ui.igNumericEditor#options:negativeSign) options. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "groupSeparator", optionValue: string): void; @@ -31500,6 +32652,7 @@ interface JQuery { * Note: The numbers in the array must be positive integers. * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "groups"): any[]; @@ -31513,6 +32666,7 @@ interface JQuery { * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "groups", optionValue: any[]): void; @@ -31523,6 +32677,7 @@ interface JQuery { * Note: In case of min decimals value higher than max decimals - max decimals are equaled to min decimals property. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option supports values between 0 and 15, when dataMode is 'double' (default) and values between 0 and 7 in 'float' mode. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "maxDecimals"): number; @@ -31533,6 +32688,7 @@ interface JQuery { * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option supports values between 0 and 15, when dataMode is 'double' (default) and values between 0 and 7 in 'float' mode. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "maxDecimals", optionValue: number): void; @@ -31544,6 +32700,7 @@ interface JQuery { * Note: In case of min decimals value higher than max decimals - max decimals are equaled to min decimals property. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option supports values between 0 and 15, when dataMode is 'double' (default) and values between 0 and 7 in 'float' mode. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "minDecimals"): number; @@ -31555,6 +32712,7 @@ interface JQuery { * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option supports values between 0 and 15, when dataMode is 'double' (default) and values between 0 and 7 in 'float' mode. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "minDecimals", optionValue: number): void; @@ -31563,6 +32721,7 @@ interface JQuery { * Gets/Sets whether the last decimal place will be rounded, when the maxDecimal option is defined and applied. * For example if the initial editor value is set to 123.4567, maxDecimals option is set to 3 and roundDecimals is enabled, * then editor will round the value and will display it as 123.457. If roundDecimals is disabled then editor value will be truncated to 123.456. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "roundDecimals"): boolean; @@ -31571,12 +32730,14 @@ interface JQuery { * For example if the initial editor value is set to 123.4567, maxDecimals option is set to 3 and roundDecimals is enabled, * then editor will round the value and will display it as 123.457. If roundDecimals is disabled then editor value will be truncated to 123.456. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "roundDecimals", optionValue: boolean): void; /** * Gets/Sets the horizontal alignment of the text in the editor. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "textAlign"): string; @@ -31584,6 +32745,7 @@ interface JQuery { /** * /Sets the horizontal alignment of the text in the editor. * + * * @optionValue New value to be set. */ @@ -31593,6 +32755,7 @@ interface JQuery { * Defines the range that editor's value can accept.This is achieved by setting the [minValue](ui.igNumericEditor#options:minValue) and [maxValue](ui.igNumericEditor#options:maxValue) editor's options, accordingly to the lowest and highest accepted values for the defined numeric mode. * The range for the specific type follows the numeric type standards, e.g. in .NET Framework [floating-point](https://msdn.microsoft.com/en-us/library/9ahet949.aspx) types and [integral types](https://msdn.microsoft.com/en-us/library/exx3b86w.aspx). * In addition, the maximum value that can be set to [minDecimals](ui.igNumericEditor#options:minDecimals) and [maxDecimals](ui.igNumericEditor#options:maxDecimals) options can be 15, when editor is in 'double' mode and 7, when in 'float' mode. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "dataMode"): string; @@ -31602,6 +32765,7 @@ interface JQuery { * The range for the specific type follows the numeric type standards, e.g. in .NET Framework [floating-point](https://msdn.microsoft.com/en-us/library/9ahet949.aspx) types and [integral types](https://msdn.microsoft.com/en-us/library/exx3b86w.aspx). * In addition, the maximum value that can be set to [minDecimals](ui.igNumericEditor#options:minDecimals) and [maxDecimals](ui.igNumericEditor#options:maxDecimals) options can be 15, when editor is in 'double' mode and 7, when in 'float' mode. * + * * @optionValue New value to be set. */ @@ -31609,24 +32773,28 @@ interface JQuery { /** * Gets/Sets the minimum value which can be entered in the editor by the end user. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "minValue"): number; /** * /Sets the minimum value which can be entered in the editor by the end user. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "minValue", optionValue: number): void; /** * Gets/Sets the maximum value which can be entered in the editor by the end user. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "maxValue"): number; /** * /Sets the maximum value which can be entered in the editor by the end user. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "maxValue", optionValue: number): void; @@ -31634,6 +32802,7 @@ interface JQuery { /** * Gets/Sets whether the editor value can become null. * If that option is disabled, and editor has no value, then value is set to 0 (or minValue/maxValue). + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "allowNullValue"): boolean; @@ -31641,18 +32810,21 @@ interface JQuery { * /Sets whether the editor value can become null. * If that option is disabled, and editor has no value, then value is set to 0 (or minValue/maxValue). * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "allowNullValue", optionValue: boolean): void; /** * Gets/Sets the default delta-value which is used with "spin" [buttonType](ui.igNumericEditor#options:buttonType) or [spinUp](ui.igNumericEditor#methods:spinUp) and [spinDown](ui.igNumericEditor#methods:spinDown) methods to increment or decrement value in the editor. The value can not be negative. Non integer value is supported only for dataMode double and float. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "spinDelta"): number; /** * /Sets the default delta-value which is used with "spin" [buttonType](ui.igNumericEditor#options:buttonType) or [spinUp](ui.igNumericEditor#methods:spinUp) and [spinDown](ui.igNumericEditor#methods:spinDown) methods to increment or decrement value in the editor. The value can not be negative. Non integer value is supported only for dataMode double and float. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "spinDelta", optionValue: number): void; @@ -31661,6 +32833,7 @@ interface JQuery { * Gets/Sets support for scientific format. * If that option is set, then numeric value appears as a string with possible E-power flag. In edit mode the "E" or "e" character can be entered as well. * Notes: The "+" character is not supported in edit mode. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "scientificFormat"): string; @@ -31670,6 +32843,7 @@ interface JQuery { * If that option is set, then numeric value appears as a string with possible E-power flag. In edit mode the "E" or "e" character can be entered as well. * Notes: The "+" character is not supported in edit mode. * + * * @optionValue New value to be set. */ @@ -31678,6 +32852,7 @@ interface JQuery { /** * Gets/Set the ability of the editor to automatically set value in the editor to the opposite side of the limit, when the spin action reaches minimum or maximum limit. * This applies to [minValue](ui.%%WidgetNameLowered%%#options:minValue) and [maxValue](ui.%%WidgetNameLowered%%#options:maxValue) or cycling through list items if [isLimitedToListValues](ui.%%WidgetNameLowered%%#options:isLimitedToListValues) is enabled. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "spinWrapAround"): boolean; @@ -31685,18 +32860,21 @@ interface JQuery { * /Set the ability of the editor to automatically set value in the editor to the opposite side of the limit, when the spin action reaches minimum or maximum limit. * This applies to [minValue](ui.%%WidgetNameLowered%%#options:minValue) and [maxValue](ui.%%WidgetNameLowered%%#options:maxValue) or cycling through list items if [isLimitedToListValues](ui.%%WidgetNameLowered%%#options:isLimitedToListValues) is enabled. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "spinWrapAround", optionValue: boolean): void; /** * Gets/Sets if the editor should only allow values from the list of items. Enabling this also causes spin actions to cycle through list items instead. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "isLimitedToListValues"): boolean; /** * /Sets if the editor should only allow values from the list of items. Enabling this also causes spin actions to cycle through list items instead. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "isLimitedToListValues", optionValue: boolean): void; @@ -31768,6 +32946,7 @@ interface JQuery { /** * Gets/Sets value in editor. The effect of setting/getting that option depends on type of editor and on dataMode options for every type of editor. * + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "value"): any; @@ -31775,12 +32954,14 @@ interface JQuery { * /Sets value in editor. The effect of setting/getting that option depends on type of editor and on dataMode options for every type of editor. * * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "value", optionValue: any): void; /** * Gets visibility of the spin, clear and drop-down button. That option can be set only on initialization. Combinations like 'dropdown,spin' or 'spin,clear' are supported too.Note! This option can not be set runtime. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "buttonType"): string; @@ -31788,6 +32969,7 @@ interface JQuery { /** * Visibility of the spin, clear and drop-down button. That option can be set only on initialization. Combinations like 'dropdown,spin' or 'spin,clear' are supported too.Note! This option can not be set runtime. * + * * @optionValue New value to be set. */ @@ -31795,24 +32977,28 @@ interface JQuery { /** * Gets/Sets custom width of the drop-down list in pixels. If the value is equal to 0 or negative, then the width of editor is set as a drop-down width. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "listWidth"): number; /** * /Sets custom width of the drop-down list in pixels. If the value is equal to 0 or negative, then the width of editor is set as a drop-down width. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "listWidth", optionValue: number): void; /** * Gets/Sets the hover/unhover animation duration of a drop-down list item. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "listItemHoverDuration"): number; /** * /Sets the hover/unhover animation duration of a drop-down list item. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "listItemHoverDuration", optionValue: number): void; @@ -31822,6 +33008,7 @@ interface JQuery { * If the option is set to false the editor will attach the drop-down list element to the editor container * If the option is set to true the editor will attach its drop-down list to as a child of the body. * Note! This option can not be set runtime. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "dropDownAttachedToBody"): boolean; @@ -31831,18 +33018,21 @@ interface JQuery { * If the option is set to true the editor will attach its drop-down list to as a child of the body. * Note! This option can not be set runtime. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "dropDownAttachedToBody", optionValue: boolean): void; /** * Gets/Sets show/hide drop-down list animation duration in milliseconds. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "dropDownAnimationDuration"): number; /** * /Sets show/hide drop-down list animation duration in milliseconds. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "dropDownAnimationDuration", optionValue: number): void; @@ -31852,6 +33042,7 @@ interface JQuery { * Notes: * This option is overwritten if the number of list items is less than the set value. In that case the drop-down list displays all the items. * This option can not be set runtime. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "visibleItemsCount"): number; @@ -31861,24 +33052,28 @@ interface JQuery { * This option is overwritten if the number of list items is less than the set value. In that case the drop-down list displays all the items. * This option can not be set runtime. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "visibleItemsCount", optionValue: number): void; /** * Gets/Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "placeHolder"): string; /** * /Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "placeHolder", optionValue: string): void; /** * Gets/Sets the action when the editor gets focused. The default value is selectAll. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "selectionOnFocus"): string; @@ -31886,6 +33081,7 @@ interface JQuery { /** * /Sets the action when the editor gets focused. The default value is selectAll. * + * * @optionValue New value to be set. */ @@ -31893,30 +33089,35 @@ interface JQuery { /** * Gets/Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "revertIfNotValid"): boolean; /** * /Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "revertIfNotValid", optionValue: boolean): void; /** * Gets/Sets if the editor should prevent form submition when enter key is pressed. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "preventSubmitOnEnter"): boolean; /** * /Sets if the editor should prevent form submition when enter key is pressed. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "preventSubmitOnEnter", optionValue: boolean): void; /** * Gets/Sets the drop-down list opening orientation when the list gets open. If the option is set to auto the editor has priority to open the drop-down list bottom. If the space is not enough it tries to open the list top. If the space is not enough in both directions then the list gets opened at the bottom of the editor. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "dropDownOrientation"): string; @@ -31924,6 +33125,7 @@ interface JQuery { /** * /Sets the drop-down list opening orientation when the list gets open. If the option is set to auto the editor has priority to open the drop-down list bottom. If the space is not enough it tries to open the list top. If the space is not enough in both directions then the list gets opened at the bottom of the editor. * + * * @optionValue New value to be set. */ @@ -31933,6 +33135,7 @@ interface JQuery { * Gets the ability to limit the editor to be used only as a dropdown list. When set to true the editor input is not editable. * Note! In case there are no list items - the editor will reamin readonly * Note! This option can not be set runtime. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "dropDownOnReadOnly"): boolean; @@ -31941,18 +33144,21 @@ interface JQuery { * Note! In case there are no list items - the editor will reamin readonly * Note! This option can not be set runtime. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "dropDownOnReadOnly", optionValue: boolean): void; /** * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "suppressNotifications"): boolean; /** * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "suppressNotifications", optionValue: boolean): void; @@ -31961,6 +33167,7 @@ interface JQuery { * Gets/Sets whether the onscreen keyboard (if available on device) should be shown when the dropdown button is clicked/tapped. This option prevents initial focus or removes it when the drop button is clicked/tapped. * Note: The option does not perform device detection so its behavior is always active if enabled. * Note: When drop down is opened the only way to close it will be using the drop down button. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "suppressKeyboard"): boolean; @@ -31969,12 +33176,14 @@ interface JQuery { * Note: The option does not perform device detection so its behavior is always active if enabled. * Note: When drop down is opened the only way to close it will be using the drop down button. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "suppressKeyboard", optionValue: boolean): void; /** * Gets/Sets the width of the control. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "width"): string|number; @@ -31982,6 +33191,7 @@ interface JQuery { /** * /Sets the width of the control. * + * * @optionValue New value to be set. */ @@ -31989,6 +33199,7 @@ interface JQuery { /** * Gets/Sets the height of the control. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "height"): string|number; @@ -31996,6 +33207,7 @@ interface JQuery { /** * /Sets the height of the control. * + * * @optionValue New value to be set. */ @@ -32003,18 +33215,21 @@ interface JQuery { /** * Gets/Sets tabIndex attribute for the editor input. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "tabIndex"): number; /** * /Sets tabIndex attribute for the editor input. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "tabIndex", optionValue: number): void; /** * Gets/Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "nullValue"): string|number; @@ -32022,6 +33237,7 @@ interface JQuery { /** * /Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string * + * * @optionValue New value to be set. */ @@ -32029,36 +33245,42 @@ interface JQuery { /** * Gets/Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "inputName"): string; /** * /Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "inputName", optionValue: string): void; /** * Gets/Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "readOnly"): boolean; /** * /Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "readOnly", optionValue: boolean): void; /** * Gets/Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "disabled"): boolean; /** * /Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "disabled", optionValue: boolean): void; @@ -32067,6 +33289,7 @@ interface JQuery { * Gets/Sets options supported by the [igValidator](ui.igvalidator#options) widget. * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "validatorOptions"): any; @@ -32075,36 +33298,42 @@ interface JQuery { * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "validatorOptions", optionValue: any): void; /** * Set/Get the locale setting for the widget. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "locale"): any; /** * Set/Get the locale setting for the widget. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "locale", optionValue: any): void; /** * Set/Get the locale language setting for the widget. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "language"): string; /** * Set/Get the locale language setting for the widget. * + * * @optionValue New value to be set. */ igCurrencyEditor(optionLiteral: 'option', optionName: "language", optionValue: string): void; /** * Set/Get the regional setting for the widget. + * */ igCurrencyEditor(optionLiteral: 'option', optionName: "regional"): string|Object; @@ -32112,6 +33341,7 @@ interface JQuery { /** * Set/Get the regional setting for the widget. * + * * @optionValue New value to be set. */ @@ -32141,6 +33371,7 @@ interface JQuery { * Gets/Sets the pattern for positive numeric values, which is used in display (no focus) state. * If you use the "en-US" culture the default value for "positivePattern" will be "n$" where the "$" flag represents the "numericSymbol" and the "n" flag represents the value of the number. * Note: this option has priority over possible regional settings. + * */ igPercentEditor(optionLiteral: 'option', optionName: "positivePattern"): string; @@ -32149,6 +33380,7 @@ interface JQuery { * If you use the "en-US" culture the default value for "positivePattern" will be "n$" where the "$" flag represents the "numericSymbol" and the "n" flag represents the value of the number. * Note: this option has priority over possible regional settings. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "positivePattern", optionValue: string): void; @@ -32156,6 +33388,7 @@ interface JQuery { /** * Gets/Sets the symbol, which is used in display (no focus) state. * Note: this option has priority over possible regional settings. + * */ igPercentEditor(optionLiteral: 'option', optionName: "percentSymbol"): string; @@ -32163,6 +33396,7 @@ interface JQuery { * /Sets the symbol, which is used in display (no focus) state. * Note: this option has priority over possible regional settings. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "percentSymbol", optionValue: string): void; @@ -32173,6 +33407,7 @@ interface JQuery { * For example, if the factor is 100 and the "value" is set to 0.123, then the editor will show string "12.3". * Possible values: 1 or 100. * Note: this option has priority over possible regional settings. + * */ igPercentEditor(optionLiteral: 'option', optionName: "displayFactor"): number; @@ -32183,6 +33418,7 @@ interface JQuery { * Possible values: 1 or 100. * Note: this option has priority over possible regional settings. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "displayFactor", optionValue: number): void; @@ -32191,6 +33427,7 @@ interface JQuery { * Defines the range that editor's value can accept.This is achieved by setting the [minValue](ui.igPercentEditor#options:minValue) and [maxValue](ui.igPercentEditor#options:maxValue) editor's options, accordingly to the lowest and highest accepted values for the defined numeric mode. * The range for the specific type follows the numeric type standards, e.g. in .NET Framework [floating-point](https://msdn.microsoft.com/en-us/library/9ahet949.aspx) types and [integral types](https://msdn.microsoft.com/en-us/library/exx3b86w.aspx). * In addition, the maximum value that can be set to [minDecimals](ui.igPercentEditor#options:minDecimals) and [maxDecimals](ui.igPercentEditor#options:maxDecimals) options can be 15, when editor is in 'double' mode and 7, when in 'float' mode. + * */ igPercentEditor(optionLiteral: 'option', optionName: "dataMode"): string; @@ -32200,6 +33437,7 @@ interface JQuery { * The range for the specific type follows the numeric type standards, e.g. in .NET Framework [floating-point](https://msdn.microsoft.com/en-us/library/9ahet949.aspx) types and [integral types](https://msdn.microsoft.com/en-us/library/exx3b86w.aspx). * In addition, the maximum value that can be set to [minDecimals](ui.igPercentEditor#options:minDecimals) and [maxDecimals](ui.igPercentEditor#options:maxDecimals) options can be 15, when editor is in 'double' mode and 7, when in 'float' mode. * + * * @optionValue New value to be set. */ @@ -32207,12 +33445,14 @@ interface JQuery { /** * Gets/Sets the default delta-value which is used with "spin" [buttonType](ui.igpercenteditor#options:buttonType) or [spinUp](ui.igpercenteditor#methods:spinUp) and [spinDown](ui.igpercenteditor#methods:spinDown) methods to increment or decrement value in the editor. The value can not be negative. Non integer value is supported only for dataMode double and float. + * */ igPercentEditor(optionLiteral: 'option', optionName: "spinDelta"): number; /** * /Sets the default delta-value which is used with "spin" [buttonType](ui.igpercenteditor#options:buttonType) or [spinUp](ui.igpercenteditor#methods:spinUp) and [spinDown](ui.igpercenteditor#methods:spinDown) methods to increment or decrement value in the editor. The value can not be negative. Non integer value is supported only for dataMode double and float. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "spinDelta", optionValue: number): void; @@ -32220,6 +33460,7 @@ interface JQuery { /** * Gets/Sets list of items which are used as a source for the drop-down list. * Items in the list can be of type number. + * */ igPercentEditor(optionLiteral: 'option', optionName: "listItems"): any[]; @@ -32227,6 +33468,7 @@ interface JQuery { * /Sets list of items which are used as a source for the drop-down list. * Items in the list can be of type number. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "listItems", optionValue: any[]): void; @@ -32236,6 +33478,7 @@ interface JQuery { * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [groupSeparator](ui.igNumericEditor#options:groupSeparator) or [decimalSeparator](ui.igNumericEditor#options:decimalSeparator) options. + * */ igPercentEditor(optionLiteral: 'option', optionName: "negativeSign"): string; @@ -32245,6 +33488,7 @@ interface JQuery { * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [groupSeparator](ui.igNumericEditor#options:groupSeparator) or [decimalSeparator](ui.igNumericEditor#options:decimalSeparator) options. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "negativeSign", optionValue: string): void; @@ -32253,6 +33497,7 @@ interface JQuery { * Gets/Sets the string, which is used as negative pattern. The "n" flag represents the value of number. The "-" and "()" flags are static part of pattern. * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. + * */ igPercentEditor(optionLiteral: 'option', optionName: "negativePattern"): string; @@ -32261,6 +33506,7 @@ interface JQuery { * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "negativePattern", optionValue: string): void; @@ -32270,6 +33516,7 @@ interface JQuery { * Note: this option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [groupSeparator](ui.igNumericEditor#options:groupSeparator) or [negativeSign](ui.igNumericEditor#options:negativeSign) options. + * */ igPercentEditor(optionLiteral: 'option', optionName: "decimalSeparator"): string; @@ -32279,6 +33526,7 @@ interface JQuery { * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [groupSeparator](ui.igNumericEditor#options:groupSeparator) or [negativeSign](ui.igNumericEditor#options:negativeSign) options. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "decimalSeparator", optionValue: string): void; @@ -32289,6 +33537,7 @@ interface JQuery { * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [decimalSeparator](ui.igNumericEditor#options:decimalSeparator) or [negativeSign](ui.igNumericEditor#options:negativeSign) options. + * */ igPercentEditor(optionLiteral: 'option', optionName: "groupSeparator"): string; @@ -32299,6 +33548,7 @@ interface JQuery { * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option's value should not be equal to the value of [decimalSeparator](ui.igNumericEditor#options:decimalSeparator) or [negativeSign](ui.igNumericEditor#options:negativeSign) options. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "groupSeparator", optionValue: string): void; @@ -32312,6 +33562,7 @@ interface JQuery { * Note: The numbers in the array must be positive integers. * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. + * */ igPercentEditor(optionLiteral: 'option', optionName: "groups"): any[]; @@ -32325,6 +33576,7 @@ interface JQuery { * Note: This option has priority over possible regional settings. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "groups", optionValue: any[]): void; @@ -32335,6 +33587,7 @@ interface JQuery { * Note: In case of min decimals value higher than max decimals - max decimals are equaled to min decimals property. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option supports values between 0 and 15, when dataMode is 'double' (default) and values between 0 and 7 in 'float' mode. + * */ igPercentEditor(optionLiteral: 'option', optionName: "maxDecimals"): number; @@ -32345,6 +33598,7 @@ interface JQuery { * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option supports values between 0 and 15, when dataMode is 'double' (default) and values between 0 and 7 in 'float' mode. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "maxDecimals", optionValue: number): void; @@ -32356,6 +33610,7 @@ interface JQuery { * Note: In case of min decimals value higher than max decimals - max decimals are equaled to min decimals property. * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option supports values between 0 and 15, when dataMode is 'double' (default) and values between 0 and 7 in 'float' mode. + * */ igPercentEditor(optionLiteral: 'option', optionName: "minDecimals"): number; @@ -32367,6 +33622,7 @@ interface JQuery { * Note: Even if the default value is null - if internationalization file is provided and it contains default values for those properties the values are imlicitly set. * Note: This option supports values between 0 and 15, when dataMode is 'double' (default) and values between 0 and 7 in 'float' mode. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "minDecimals", optionValue: number): void; @@ -32375,6 +33631,7 @@ interface JQuery { * Gets/Sets whether the last decimal place will be rounded, when the maxDecimal option is defined and applied. * For example if the initial editor value is set to 123.4567, maxDecimals option is set to 3 and roundDecimals is enabled, * then editor will round the value and will display it as 123.457. If roundDecimals is disabled then editor value will be truncated to 123.456. + * */ igPercentEditor(optionLiteral: 'option', optionName: "roundDecimals"): boolean; @@ -32383,12 +33640,14 @@ interface JQuery { * For example if the initial editor value is set to 123.4567, maxDecimals option is set to 3 and roundDecimals is enabled, * then editor will round the value and will display it as 123.457. If roundDecimals is disabled then editor value will be truncated to 123.456. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "roundDecimals", optionValue: boolean): void; /** * Gets/Sets the horizontal alignment of the text in the editor. + * */ igPercentEditor(optionLiteral: 'option', optionName: "textAlign"): string; @@ -32396,6 +33655,7 @@ interface JQuery { /** * /Sets the horizontal alignment of the text in the editor. * + * * @optionValue New value to be set. */ @@ -32403,24 +33663,28 @@ interface JQuery { /** * Gets/Sets the minimum value which can be entered in the editor by the end user. + * */ igPercentEditor(optionLiteral: 'option', optionName: "minValue"): number; /** * /Sets the minimum value which can be entered in the editor by the end user. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "minValue", optionValue: number): void; /** * Gets/Sets the maximum value which can be entered in the editor by the end user. + * */ igPercentEditor(optionLiteral: 'option', optionName: "maxValue"): number; /** * /Sets the maximum value which can be entered in the editor by the end user. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "maxValue", optionValue: number): void; @@ -32428,6 +33692,7 @@ interface JQuery { /** * Gets/Sets whether the editor value can become null. * If that option is disabled, and editor has no value, then value is set to 0 (or minValue/maxValue). + * */ igPercentEditor(optionLiteral: 'option', optionName: "allowNullValue"): boolean; @@ -32435,6 +33700,7 @@ interface JQuery { * /Sets whether the editor value can become null. * If that option is disabled, and editor has no value, then value is set to 0 (or minValue/maxValue). * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "allowNullValue", optionValue: boolean): void; @@ -32443,6 +33709,7 @@ interface JQuery { * Gets/Sets support for scientific format. * If that option is set, then numeric value appears as a string with possible E-power flag. In edit mode the "E" or "e" character can be entered as well. * Notes: The "+" character is not supported in edit mode. + * */ igPercentEditor(optionLiteral: 'option', optionName: "scientificFormat"): string; @@ -32452,6 +33719,7 @@ interface JQuery { * If that option is set, then numeric value appears as a string with possible E-power flag. In edit mode the "E" or "e" character can be entered as well. * Notes: The "+" character is not supported in edit mode. * + * * @optionValue New value to be set. */ @@ -32460,6 +33728,7 @@ interface JQuery { /** * Gets/Set the ability of the editor to automatically set value in the editor to the opposite side of the limit, when the spin action reaches minimum or maximum limit. * This applies to [minValue](ui.%%WidgetNameLowered%%#options:minValue) and [maxValue](ui.%%WidgetNameLowered%%#options:maxValue) or cycling through list items if [isLimitedToListValues](ui.%%WidgetNameLowered%%#options:isLimitedToListValues) is enabled. + * */ igPercentEditor(optionLiteral: 'option', optionName: "spinWrapAround"): boolean; @@ -32467,18 +33736,21 @@ interface JQuery { * /Set the ability of the editor to automatically set value in the editor to the opposite side of the limit, when the spin action reaches minimum or maximum limit. * This applies to [minValue](ui.%%WidgetNameLowered%%#options:minValue) and [maxValue](ui.%%WidgetNameLowered%%#options:maxValue) or cycling through list items if [isLimitedToListValues](ui.%%WidgetNameLowered%%#options:isLimitedToListValues) is enabled. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "spinWrapAround", optionValue: boolean): void; /** * Gets/Sets if the editor should only allow values from the list of items. Enabling this also causes spin actions to cycle through list items instead. + * */ igPercentEditor(optionLiteral: 'option', optionName: "isLimitedToListValues"): boolean; /** * /Sets if the editor should only allow values from the list of items. Enabling this also causes spin actions to cycle through list items instead. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "isLimitedToListValues", optionValue: boolean): void; @@ -32550,6 +33822,7 @@ interface JQuery { /** * Gets/Sets value in editor. The effect of setting/getting that option depends on type of editor and on dataMode options for every type of editor. * + * */ igPercentEditor(optionLiteral: 'option', optionName: "value"): any; @@ -32557,12 +33830,14 @@ interface JQuery { * /Sets value in editor. The effect of setting/getting that option depends on type of editor and on dataMode options for every type of editor. * * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "value", optionValue: any): void; /** * Gets visibility of the spin, clear and drop-down button. That option can be set only on initialization. Combinations like 'dropdown,spin' or 'spin,clear' are supported too.Note! This option can not be set runtime. + * */ igPercentEditor(optionLiteral: 'option', optionName: "buttonType"): string; @@ -32570,6 +33845,7 @@ interface JQuery { /** * Visibility of the spin, clear and drop-down button. That option can be set only on initialization. Combinations like 'dropdown,spin' or 'spin,clear' are supported too.Note! This option can not be set runtime. * + * * @optionValue New value to be set. */ @@ -32577,24 +33853,28 @@ interface JQuery { /** * Gets/Sets custom width of the drop-down list in pixels. If the value is equal to 0 or negative, then the width of editor is set as a drop-down width. + * */ igPercentEditor(optionLiteral: 'option', optionName: "listWidth"): number; /** * /Sets custom width of the drop-down list in pixels. If the value is equal to 0 or negative, then the width of editor is set as a drop-down width. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "listWidth", optionValue: number): void; /** * Gets/Sets the hover/unhover animation duration of a drop-down list item. + * */ igPercentEditor(optionLiteral: 'option', optionName: "listItemHoverDuration"): number; /** * /Sets the hover/unhover animation duration of a drop-down list item. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "listItemHoverDuration", optionValue: number): void; @@ -32604,6 +33884,7 @@ interface JQuery { * If the option is set to false the editor will attach the drop-down list element to the editor container * If the option is set to true the editor will attach its drop-down list to as a child of the body. * Note! This option can not be set runtime. + * */ igPercentEditor(optionLiteral: 'option', optionName: "dropDownAttachedToBody"): boolean; @@ -32613,18 +33894,21 @@ interface JQuery { * If the option is set to true the editor will attach its drop-down list to as a child of the body. * Note! This option can not be set runtime. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "dropDownAttachedToBody", optionValue: boolean): void; /** * Gets/Sets show/hide drop-down list animation duration in milliseconds. + * */ igPercentEditor(optionLiteral: 'option', optionName: "dropDownAnimationDuration"): number; /** * /Sets show/hide drop-down list animation duration in milliseconds. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "dropDownAnimationDuration", optionValue: number): void; @@ -32634,6 +33918,7 @@ interface JQuery { * Notes: * This option is overwritten if the number of list items is less than the set value. In that case the drop-down list displays all the items. * This option can not be set runtime. + * */ igPercentEditor(optionLiteral: 'option', optionName: "visibleItemsCount"): number; @@ -32643,24 +33928,28 @@ interface JQuery { * This option is overwritten if the number of list items is less than the set value. In that case the drop-down list displays all the items. * This option can not be set runtime. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "visibleItemsCount", optionValue: number): void; /** * Gets/Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. + * */ igPercentEditor(optionLiteral: 'option', optionName: "placeHolder"): string; /** * /Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "placeHolder", optionValue: string): void; /** * Gets/Sets the action when the editor gets focused. The default value is selectAll. + * */ igPercentEditor(optionLiteral: 'option', optionName: "selectionOnFocus"): string; @@ -32668,6 +33957,7 @@ interface JQuery { /** * /Sets the action when the editor gets focused. The default value is selectAll. * + * * @optionValue New value to be set. */ @@ -32675,30 +33965,35 @@ interface JQuery { /** * Gets/Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. + * */ igPercentEditor(optionLiteral: 'option', optionName: "revertIfNotValid"): boolean; /** * /Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "revertIfNotValid", optionValue: boolean): void; /** * Gets/Sets if the editor should prevent form submition when enter key is pressed. + * */ igPercentEditor(optionLiteral: 'option', optionName: "preventSubmitOnEnter"): boolean; /** * /Sets if the editor should prevent form submition when enter key is pressed. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "preventSubmitOnEnter", optionValue: boolean): void; /** * Gets/Sets the drop-down list opening orientation when the list gets open. If the option is set to auto the editor has priority to open the drop-down list bottom. If the space is not enough it tries to open the list top. If the space is not enough in both directions then the list gets opened at the bottom of the editor. + * */ igPercentEditor(optionLiteral: 'option', optionName: "dropDownOrientation"): string; @@ -32706,6 +34001,7 @@ interface JQuery { /** * /Sets the drop-down list opening orientation when the list gets open. If the option is set to auto the editor has priority to open the drop-down list bottom. If the space is not enough it tries to open the list top. If the space is not enough in both directions then the list gets opened at the bottom of the editor. * + * * @optionValue New value to be set. */ @@ -32715,6 +34011,7 @@ interface JQuery { * Gets the ability to limit the editor to be used only as a dropdown list. When set to true the editor input is not editable. * Note! In case there are no list items - the editor will reamin readonly * Note! This option can not be set runtime. + * */ igPercentEditor(optionLiteral: 'option', optionName: "dropDownOnReadOnly"): boolean; @@ -32723,18 +34020,21 @@ interface JQuery { * Note! In case there are no list items - the editor will reamin readonly * Note! This option can not be set runtime. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "dropDownOnReadOnly", optionValue: boolean): void; /** * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. + * */ igPercentEditor(optionLiteral: 'option', optionName: "suppressNotifications"): boolean; /** * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "suppressNotifications", optionValue: boolean): void; @@ -32743,6 +34043,7 @@ interface JQuery { * Gets/Sets whether the onscreen keyboard (if available on device) should be shown when the dropdown button is clicked/tapped. This option prevents initial focus or removes it when the drop button is clicked/tapped. * Note: The option does not perform device detection so its behavior is always active if enabled. * Note: When drop down is opened the only way to close it will be using the drop down button. + * */ igPercentEditor(optionLiteral: 'option', optionName: "suppressKeyboard"): boolean; @@ -32751,12 +34052,14 @@ interface JQuery { * Note: The option does not perform device detection so its behavior is always active if enabled. * Note: When drop down is opened the only way to close it will be using the drop down button. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "suppressKeyboard", optionValue: boolean): void; /** * Gets/Sets the width of the control. + * */ igPercentEditor(optionLiteral: 'option', optionName: "width"): string|number; @@ -32764,6 +34067,7 @@ interface JQuery { /** * /Sets the width of the control. * + * * @optionValue New value to be set. */ @@ -32771,6 +34075,7 @@ interface JQuery { /** * Gets/Sets the height of the control. + * */ igPercentEditor(optionLiteral: 'option', optionName: "height"): string|number; @@ -32778,6 +34083,7 @@ interface JQuery { /** * /Sets the height of the control. * + * * @optionValue New value to be set. */ @@ -32785,18 +34091,21 @@ interface JQuery { /** * Gets/Sets tabIndex attribute for the editor input. + * */ igPercentEditor(optionLiteral: 'option', optionName: "tabIndex"): number; /** * /Sets tabIndex attribute for the editor input. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "tabIndex", optionValue: number): void; /** * Gets/Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string + * */ igPercentEditor(optionLiteral: 'option', optionName: "nullValue"): string|number; @@ -32804,6 +34113,7 @@ interface JQuery { /** * /Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string * + * * @optionValue New value to be set. */ @@ -32811,36 +34121,42 @@ interface JQuery { /** * Gets/Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. + * */ igPercentEditor(optionLiteral: 'option', optionName: "inputName"): string; /** * /Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "inputName", optionValue: string): void; /** * Gets/Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. + * */ igPercentEditor(optionLiteral: 'option', optionName: "readOnly"): boolean; /** * /Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "readOnly", optionValue: boolean): void; /** * Gets/Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. + * */ igPercentEditor(optionLiteral: 'option', optionName: "disabled"): boolean; /** * /Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "disabled", optionValue: boolean): void; @@ -32849,6 +34165,7 @@ interface JQuery { * Gets/Sets options supported by the [igValidator](ui.igvalidator#options) widget. * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. + * */ igPercentEditor(optionLiteral: 'option', optionName: "validatorOptions"): any; @@ -32857,36 +34174,42 @@ interface JQuery { * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "validatorOptions", optionValue: any): void; /** * Set/Get the locale setting for the widget. + * */ igPercentEditor(optionLiteral: 'option', optionName: "locale"): any; /** * Set/Get the locale setting for the widget. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "locale", optionValue: any): void; /** * Set/Get the locale language setting for the widget. + * */ igPercentEditor(optionLiteral: 'option', optionName: "language"): string; /** * Set/Get the locale language setting for the widget. * + * * @optionValue New value to be set. */ igPercentEditor(optionLiteral: 'option', optionName: "language", optionValue: string): void; /** * Set/Get the regional setting for the widget. + * */ igPercentEditor(optionLiteral: 'option', optionName: "regional"): string|Object; @@ -32894,6 +34217,7 @@ interface JQuery { /** * Set/Get the regional setting for the widget. * + * * @optionValue New value to be set. */ @@ -32930,6 +34254,7 @@ interface JQuery { /** * Gets visibility of the clear button. That option can be set only on initialization. + * */ igMaskEditor(optionLiteral: 'option', optionName: "buttonType"): string; @@ -32937,6 +34262,7 @@ interface JQuery { /** * Visibility of the clear button. That option can be set only on initialization. * + * * @optionValue New value to be set. */ @@ -32960,6 +34286,7 @@ interface JQuery { * >: all letters to the right are converted to the upper case. In order to disable conversion, the ">" flag should be used again. * <: all letters to the right are converted to the lower case. In order to disable conversion, the "<" flag should be used again. * Note! This option can not be set runtime. + * */ igMaskEditor(optionLiteral: 'option', optionName: "inputMask"): string; @@ -32982,12 +34309,14 @@ interface JQuery { * <: all letters to the right are converted to the lower case. In order to disable conversion, the "<" flag should be used again. * Note! This option can not be set runtime. * + * * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "inputMask", optionValue: string): void; /** * It affects the value of the control (value method/option and submitted in forms). It defines what the value should contain from text, unfilled prompts and literals. The default is allText and when used value method/option returns the text entered, all prompts (positions) and literals. + * */ igMaskEditor(optionLiteral: 'option', optionName: "dataMode"): string; @@ -32995,6 +34324,7 @@ interface JQuery { /** * It affects the value of the control (value method/option and submitted in forms). It defines what the value should contain from text, unfilled prompts and literals. The default is allText and when used value method/option returns the text entered, all prompts (positions) and literals. * + * * @optionValue New value to be set. */ @@ -33002,36 +34332,42 @@ interface JQuery { /** * Gets character which is used as prompt in edit mode for available entry position. + * */ igMaskEditor(optionLiteral: 'option', optionName: "unfilledCharsPrompt"): string; /** * Character which is used as prompt in edit mode for available entry position. * + * * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "unfilledCharsPrompt", optionValue: string): void; /** * Gets/Sets character which is used as replacement of not-filled required position in mask when editor is in display mode (not focused). + * */ igMaskEditor(optionLiteral: 'option', optionName: "padChar"): string; /** * /Sets character which is used as replacement of not-filled required position in mask when editor is in display mode (not focused). * + * * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "padChar", optionValue: string): void; /** * Gets/Sets character which is used as replacement of not-filled required position in mask when application calls get for the [value](ui.igmaskeditor#methods:value) methods. + * */ igMaskEditor(optionLiteral: 'option', optionName: "emptyChar"): string; /** * /Sets character which is used as replacement of not-filled required position in mask when application calls get for the [value](ui.igmaskeditor#methods:value) methods. * + * * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "emptyChar", optionValue: string): void; @@ -33041,6 +34377,7 @@ interface JQuery { * Notes: * If "excludeKeys" option contains same characters as this option, then "excludeKeys" has priority. * Note! This option can not be se runtime. + * */ igMaskEditor(optionLiteral: 'option', optionName: "includeKeys"): string; @@ -33050,6 +34387,7 @@ interface JQuery { * If "excludeKeys" option contains same characters as this option, then "excludeKeys" has priority. * Note! This option can not be se runtime. * + * * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "includeKeys", optionValue: string): void; @@ -33059,6 +34397,7 @@ interface JQuery { * Notes: * If a character is specified in "includeKeys" option also, then "excludeKeys" has priority. * Note! This option can not be se runtime. + * */ igMaskEditor(optionLiteral: 'option', optionName: "excludeKeys"): string; @@ -33068,6 +34407,7 @@ interface JQuery { * If a character is specified in "includeKeys" option also, then "excludeKeys" has priority. * Note! This option can not be se runtime. * + * * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "excludeKeys", optionValue: string): void; @@ -33218,12 +34558,14 @@ interface JQuery { /** * Gets/Sets value in editor. The effect of setting/getting that option depends on type of editor and on dataMode options for every type of editor. + * */ igMaskEditor(optionLiteral: 'option', optionName: "value"): any; /** * /Sets value in editor. The effect of setting/getting that option depends on type of editor and on dataMode options for every type of editor. * + * * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "value", optionValue: any): void; @@ -33232,6 +34574,7 @@ interface JQuery { /** * Gets/Sets the horizontal alignment of the text in the editor. + * */ igMaskEditor(optionLiteral: 'option', optionName: "textAlign"): string; @@ -33239,6 +34582,7 @@ interface JQuery { /** * /Sets the horizontal alignment of the text in the editor. * + * * @optionValue New value to be set. */ @@ -33246,18 +34590,21 @@ interface JQuery { /** * Gets/Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. + * */ igMaskEditor(optionLiteral: 'option', optionName: "placeHolder"): string; /** * /Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. * + * * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "placeHolder", optionValue: string): void; /** * Gets/Sets the action when the editor gets focused. The default value is selectAll. + * */ igMaskEditor(optionLiteral: 'option', optionName: "selectionOnFocus"): string; @@ -33265,6 +34612,7 @@ interface JQuery { /** * /Sets the action when the editor gets focused. The default value is selectAll. * + * * @optionValue New value to be set. */ @@ -33272,24 +34620,28 @@ interface JQuery { /** * Gets/Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. + * */ igMaskEditor(optionLiteral: 'option', optionName: "revertIfNotValid"): boolean; /** * /Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. * + * * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "revertIfNotValid", optionValue: boolean): void; /** * Gets/Sets if the editor should prevent form submition when enter key is pressed. + * */ igMaskEditor(optionLiteral: 'option', optionName: "preventSubmitOnEnter"): boolean; /** * /Sets if the editor should prevent form submition when enter key is pressed. * + * * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "preventSubmitOnEnter", optionValue: boolean): void; @@ -33297,6 +34649,7 @@ interface JQuery { /** * Gets/Sets the ability to convert the input characters to upper case (true) or keeps the characters as they are (false). The option has effect only while keyboard entries and paste. * Note! When the option is set at runtime the editor is not changing the current value. + * */ igMaskEditor(optionLiteral: 'option', optionName: "toUpper"): boolean; @@ -33304,6 +34657,7 @@ interface JQuery { * /Sets the ability to convert the input characters to upper case (true) or keeps the characters as they are (false). The option has effect only while keyboard entries and paste. * Note! When the option is set at runtime the editor is not changing the current value. * + * * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "toUpper", optionValue: boolean): void; @@ -33311,6 +34665,7 @@ interface JQuery { /** * Gets/Sets the ability to convert the input characters to lower case (true) or keeps the characters as they are (false). The option has effect only while keyboard entries and paste. * Note! When the option is set at runtime the editor is not changing the current value. + * */ igMaskEditor(optionLiteral: 'option', optionName: "toLower"): boolean; @@ -33318,24 +34673,28 @@ interface JQuery { * /Sets the ability to convert the input characters to lower case (true) or keeps the characters as they are (false). The option has effect only while keyboard entries and paste. * Note! When the option is set at runtime the editor is not changing the current value. * + * * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "toLower", optionValue: boolean): void; /** * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. + * */ igMaskEditor(optionLiteral: 'option', optionName: "suppressNotifications"): boolean; /** * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. * + * * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "suppressNotifications", optionValue: boolean): void; /** * Gets/Sets the width of the control. + * */ igMaskEditor(optionLiteral: 'option', optionName: "width"): string|number; @@ -33343,6 +34702,7 @@ interface JQuery { /** * /Sets the width of the control. * + * * @optionValue New value to be set. */ @@ -33350,6 +34710,7 @@ interface JQuery { /** * Gets/Sets the height of the control. + * */ igMaskEditor(optionLiteral: 'option', optionName: "height"): string|number; @@ -33357,6 +34718,7 @@ interface JQuery { /** * /Sets the height of the control. * + * * @optionValue New value to be set. */ @@ -33364,12 +34726,14 @@ interface JQuery { /** * Gets/Sets tabIndex attribute for the editor input. + * */ igMaskEditor(optionLiteral: 'option', optionName: "tabIndex"): number; /** * /Sets tabIndex attribute for the editor input. * + * * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "tabIndex", optionValue: number): void; @@ -33377,6 +34741,7 @@ interface JQuery { /** * Gets/Sets whether the editor value can become null. * If that option is false, and editor has no value, then value is set to an empty string. + * */ igMaskEditor(optionLiteral: 'option', optionName: "allowNullValue"): boolean; @@ -33384,12 +34749,14 @@ interface JQuery { * /Sets whether the editor value can become null. * If that option is false, and editor has no value, then value is set to an empty string. * + * * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "allowNullValue", optionValue: boolean): void; /** * Gets/Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string + * */ igMaskEditor(optionLiteral: 'option', optionName: "nullValue"): string|number; @@ -33397,6 +34764,7 @@ interface JQuery { /** * /Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string * + * * @optionValue New value to be set. */ @@ -33404,36 +34772,42 @@ interface JQuery { /** * Gets/Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. + * */ igMaskEditor(optionLiteral: 'option', optionName: "inputName"): string; /** * /Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. * + * * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "inputName", optionValue: string): void; /** * Gets/Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. + * */ igMaskEditor(optionLiteral: 'option', optionName: "readOnly"): boolean; /** * /Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. * + * * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "readOnly", optionValue: boolean): void; /** * Gets/Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. + * */ igMaskEditor(optionLiteral: 'option', optionName: "disabled"): boolean; /** * /Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. * + * * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "disabled", optionValue: boolean): void; @@ -33442,6 +34816,7 @@ interface JQuery { * Gets/Sets options supported by the [igValidator](ui.igvalidator#options) widget. * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. + * */ igMaskEditor(optionLiteral: 'option', optionName: "validatorOptions"): any; @@ -33450,36 +34825,42 @@ interface JQuery { * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. * + * * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "validatorOptions", optionValue: any): void; /** * Set/Get the locale setting for the widget. + * */ igMaskEditor(optionLiteral: 'option', optionName: "locale"): any; /** * Set/Get the locale setting for the widget. * + * * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "locale", optionValue: any): void; /** * Set/Get the locale language setting for the widget. + * */ igMaskEditor(optionLiteral: 'option', optionName: "language"): string; /** * Set/Get the locale language setting for the widget. * + * * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "language", optionValue: string): void; /** * Set/Get the regional setting for the widget. + * */ igMaskEditor(optionLiteral: 'option', optionName: "regional"): string|Object; @@ -33487,6 +34868,7 @@ interface JQuery { /** * Set/Get the regional setting for the widget. * + * * @optionValue New value to be set. */ @@ -33505,24 +34887,16 @@ interface JQuery { igMaskEditor(optionLiteral: 'option', optionName: "dropDownItemSelected", optionValue: DropDownItemSelectedEvent): void; /** - * Event which is raised after text in the editor was changed. It can be raised when keyUp event occurs, + * Fired after the editor's text has been changed. It can be raised when keyUp event occurs, * when the clear button is clicked or when an item from a list is selected. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.text to obtain new text - * Use ui.oldText to obtain the old text. */ igMaskEditor(optionLiteral: 'option', optionName: "textChanged"): TextChangedEvent; /** - * Event which is raised after text in the editor was changed. It can be raised when keyUp event occurs, + * Fired after the editor's text has been changed. It can be raised when keyUp event occurs, * when the clear button is clicked or when an item from a list is selected. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.text to obtain new text - * Use ui.oldText to obtain the old text. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igMaskEditor(optionLiteral: 'option', optionName: "textChanged", optionValue: TextChangedEvent): void; igMaskEditor(options: IgMaskEditor): JQuery; @@ -33553,6 +34927,7 @@ interface JQuery { /** * Gets/Sets the value of the editor. Date object can be set as value. String can be set and the editor will pass it to the Date object constructor and use the corresponding Date object as the value. MVC date format can be used too. * Note! This option doesn't use the dateInputFormat to extract the date. + * */ igDateEditor(optionLiteral: 'option', optionName: "value"): Date; @@ -33560,6 +34935,7 @@ interface JQuery { * /Sets the value of the editor. Date object can be set as value. String can be set and the editor will pass it to the Date object constructor and use the corresponding Date object as the value. MVC date format can be used too. * Note! This option doesn't use the dateInputFormat to extract the date. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "value", optionValue: Date): void; @@ -33567,6 +34943,7 @@ interface JQuery { /** * Gets the minimum value which can be entered in editor by user. Date object can be set as value. String value can be passed and the editor will use the javascript Date object constructor to create date object and will use it for the comparison. MVC date format can be used too. * Note! This option doesn't use the dateInputFormat to extract the date. + * */ igDateEditor(optionLiteral: 'option', optionName: "minValue"): Date; @@ -33574,6 +34951,7 @@ interface JQuery { * The minimum value which can be entered in editor by user. Date object can be set as value. String value can be passed and the editor will use the javascript Date object constructor to create date object and will use it for the comparison. MVC date format can be used too. * Note! This option doesn't use the dateInputFormat to extract the date. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "minValue", optionValue: Date): void; @@ -33581,6 +34959,7 @@ interface JQuery { /** * Gets the maximum value which can be entered in editor by user. Date object can be set as value. String value can be passed and the editor will use the javascript Date object constructor to create date object and will use it for the comparison. MVC date format can be used too. * Note! This option doesn't use the dateInputFormat to extract the date. + * */ igDateEditor(optionLiteral: 'option', optionName: "maxValue"): Date; @@ -33588,6 +34967,7 @@ interface JQuery { * The maximum value which can be entered in editor by user. Date object can be set as value. String value can be passed and the editor will use the javascript Date object constructor to create date object and will use it for the comparison. MVC date format can be used too. * Note! This option doesn't use the dateInputFormat to extract the date. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "maxValue", optionValue: Date): void; @@ -33630,6 +35010,7 @@ interface JQuery { * "f": milliseconds field in hundreds * "ff": milliseconds field in tenths * "fff": milliseconds field + * */ igDateEditor(optionLiteral: 'option', optionName: "dateDisplayFormat"): string; @@ -33672,6 +35053,7 @@ interface JQuery { * "ff": milliseconds field in tenths * "fff": milliseconds field * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "dateDisplayFormat", optionValue: string): void; @@ -33703,6 +35085,7 @@ interface JQuery { * "ff": milliseconds field in tenths * "fff": milliseconds field * Note! This option can not be set runtime. + * */ igDateEditor(optionLiteral: 'option', optionName: "dateInputFormat"): string; @@ -33734,6 +35117,7 @@ interface JQuery { * "fff": milliseconds field * Note! This option can not be set runtime. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "dateInputFormat", optionValue: string): void; @@ -33743,6 +35127,7 @@ interface JQuery { * The [enableUTCDates](ui.%%WidgetNameLowered%%#options:enableUTCDates) option can be used to output an UTC ISO string instead. * For example 10:00 AM from a client with local offset of 5 hours ahead of GMT will be serialized as: * "2016-11-11T10:00:00+05:00" + * */ igDateEditor(optionLiteral: 'option', optionName: "dataMode"): string; @@ -33753,6 +35138,7 @@ interface JQuery { * For example 10:00 AM from a client with local offset of 5 hours ahead of GMT will be serialized as: * "2016-11-11T10:00:00+05:00" * + * * @optionValue New value to be set. */ @@ -33762,6 +35148,7 @@ interface JQuery { * Gets/Sets time zone offset from UTC, in minutes. The client date values are displayed with this offset instead of the local one. * Note: It is recommended that this option is used with an UTC value (e.g. "2016-11-03T14:08:08.504Z") so the outcome is consistent. * Values with ambiguous time zone could map to unpredictable times depending on the user agent local zone. + * */ igDateEditor(optionLiteral: 'option', optionName: "displayTimeOffset"): any; @@ -33770,12 +35157,14 @@ interface JQuery { * Note: It is recommended that this option is used with an UTC value (e.g. "2016-11-03T14:08:08.504Z") so the outcome is consistent. * Values with ambiguous time zone could map to unpredictable times depending on the user agent local zone. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "displayTimeOffset", optionValue: any): void; /** * Gets visibility of the spin and clear buttons. That option can be set only on initialization. Combinations like 'spin,clear' are supported too. + * */ igDateEditor(optionLiteral: 'option', optionName: "buttonType"): string; @@ -33783,6 +35172,7 @@ interface JQuery { /** * Visibility of the spin and clear buttons. That option can be set only on initialization. Combinations like 'spin,clear' are supported too. * + * * @optionValue New value to be set. */ @@ -33802,6 +35192,7 @@ interface JQuery { * milliseconds: 100 * } * Time periods that don't have values use 1 as default. + * */ igDateEditor(optionLiteral: 'option', optionName: "spinDelta"): number|Object; @@ -33821,6 +35212,7 @@ interface JQuery { * } * Time periods that don't have values use 1 as default. * + * * @optionValue New value to be set. */ @@ -33830,6 +35222,7 @@ interface JQuery { * Gets/Sets ability to modify only 1 date field on spin events. * Value false enables changes of other date fields when incremented or decremented date-field reaches its limits. * Value true modifies only value of one field. + * */ igDateEditor(optionLiteral: 'option', optionName: "limitSpinToCurrentField"): boolean; @@ -33838,6 +35231,7 @@ interface JQuery { * Value false enables changes of other date fields when incremented or decremented date-field reaches its limits. * Value true modifies only value of one field. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "limitSpinToCurrentField", optionValue: boolean): void; @@ -33845,6 +35239,7 @@ interface JQuery { /** * Enables/Disables serializing client date as UTC ISO 8061 string instead of using the local time and zone values. * The option is only applied in "date" [dataMode](ui.%%WidgetNameLowered%%#options:dataMode). + * */ igDateEditor(optionLiteral: 'option', optionName: "enableUTCDates"): boolean; @@ -33852,6 +35247,7 @@ interface JQuery { * Enables/Disables serializing client date as UTC ISO 8061 string instead of using the local time and zone values. * The option is only applied in "date" [dataMode](ui.%%WidgetNameLowered%%#options:dataMode). * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "enableUTCDates", optionValue: boolean): void; @@ -33860,6 +35256,7 @@ interface JQuery { * Gets/Sets year for auto detection of 20th and 21st centuries. * That option is used to automatically fill century when the user entered only 1 or 2 digits into the year field or when the date pattern contains only 1 or 2 year positions, e.g. "yy" or "y". * If user entered value larger than value of this option, then 20th century is used, otherwise the 21st. + * */ igDateEditor(optionLiteral: 'option', optionName: "centuryThreshold"): number; @@ -33868,24 +35265,28 @@ interface JQuery { * That option is used to automatically fill century when the user entered only 1 or 2 digits into the year field or when the date pattern contains only 1 or 2 year positions, e.g. "yy" or "y". * If user entered value larger than value of this option, then 20th century is used, otherwise the 21st. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "centuryThreshold", optionValue: number): void; /** * Gets/Set value used to increase/decrease year part of the date, in order to set difference between year in Gregorian calendar and displayed year. + * */ igDateEditor(optionLiteral: 'option', optionName: "yearShift"): number; /** * /Set value used to increase/decrease year part of the date, in order to set difference between year in Gregorian calendar and displayed year. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "yearShift", optionValue: number): void; /** * Gets/Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string + * */ igDateEditor(optionLiteral: 'option', optionName: "nullValue"): string|number|Date; @@ -33893,6 +35294,7 @@ interface JQuery { /** * /Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string * + * * @optionValue New value to be set. */ @@ -34061,6 +35463,7 @@ interface JQuery { * Notes: * If "excludeKeys" option contains same characters as this option, then "excludeKeys" has priority. * Note! This option can not be se runtime. + * */ igDateEditor(optionLiteral: 'option', optionName: "includeKeys"): string; @@ -34070,6 +35473,7 @@ interface JQuery { * If "excludeKeys" option contains same characters as this option, then "excludeKeys" has priority. * Note! This option can not be se runtime. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "includeKeys", optionValue: string): void; @@ -34079,6 +35483,7 @@ interface JQuery { * Notes: * If a character is specified in "includeKeys" option also, then "excludeKeys" has priority. * Note! This option can not be se runtime. + * */ igDateEditor(optionLiteral: 'option', optionName: "excludeKeys"): string; @@ -34088,6 +35493,7 @@ interface JQuery { * If a character is specified in "includeKeys" option also, then "excludeKeys" has priority. * Note! This option can not be se runtime. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "excludeKeys", optionValue: string): void; @@ -34152,6 +35558,7 @@ interface JQuery { /** * Gets/Sets the horizontal alignment of the text in the editor. + * */ igDateEditor(optionLiteral: 'option', optionName: "textAlign"): string; @@ -34159,6 +35566,7 @@ interface JQuery { /** * /Sets the horizontal alignment of the text in the editor. * + * * @optionValue New value to be set. */ @@ -34166,18 +35574,21 @@ interface JQuery { /** * Gets/Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. + * */ igDateEditor(optionLiteral: 'option', optionName: "placeHolder"): string; /** * /Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "placeHolder", optionValue: string): void; /** * Gets/Sets the action when the editor gets focused. The default value is selectAll. + * */ igDateEditor(optionLiteral: 'option', optionName: "selectionOnFocus"): string; @@ -34185,6 +35596,7 @@ interface JQuery { /** * /Sets the action when the editor gets focused. The default value is selectAll. * + * * @optionValue New value to be set. */ @@ -34192,42 +35604,49 @@ interface JQuery { /** * Gets/Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. + * */ igDateEditor(optionLiteral: 'option', optionName: "revertIfNotValid"): boolean; /** * /Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "revertIfNotValid", optionValue: boolean): void; /** * Gets/Sets if the editor should prevent form submition when enter key is pressed. + * */ igDateEditor(optionLiteral: 'option', optionName: "preventSubmitOnEnter"): boolean; /** * /Sets if the editor should prevent form submition when enter key is pressed. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "preventSubmitOnEnter", optionValue: boolean): void; /** * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. + * */ igDateEditor(optionLiteral: 'option', optionName: "suppressNotifications"): boolean; /** * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "suppressNotifications", optionValue: boolean): void; /** * Gets/Sets the width of the control. + * */ igDateEditor(optionLiteral: 'option', optionName: "width"): string|number; @@ -34235,6 +35654,7 @@ interface JQuery { /** * /Sets the width of the control. * + * * @optionValue New value to be set. */ @@ -34242,6 +35662,7 @@ interface JQuery { /** * Gets/Sets the height of the control. + * */ igDateEditor(optionLiteral: 'option', optionName: "height"): string|number; @@ -34249,6 +35670,7 @@ interface JQuery { /** * /Sets the height of the control. * + * * @optionValue New value to be set. */ @@ -34256,12 +35678,14 @@ interface JQuery { /** * Gets/Sets tabIndex attribute for the editor input. + * */ igDateEditor(optionLiteral: 'option', optionName: "tabIndex"): number; /** * /Sets tabIndex attribute for the editor input. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "tabIndex", optionValue: number): void; @@ -34269,6 +35693,7 @@ interface JQuery { /** * Gets/Sets whether the editor value can become null. * If that option is false, and editor has no value, then value is set to an empty string. + * */ igDateEditor(optionLiteral: 'option', optionName: "allowNullValue"): boolean; @@ -34276,42 +35701,49 @@ interface JQuery { * /Sets whether the editor value can become null. * If that option is false, and editor has no value, then value is set to an empty string. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "allowNullValue", optionValue: boolean): void; /** * Gets/Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. + * */ igDateEditor(optionLiteral: 'option', optionName: "inputName"): string; /** * /Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "inputName", optionValue: string): void; /** * Gets/Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. + * */ igDateEditor(optionLiteral: 'option', optionName: "readOnly"): boolean; /** * /Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "readOnly", optionValue: boolean): void; /** * Gets/Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. + * */ igDateEditor(optionLiteral: 'option', optionName: "disabled"): boolean; /** * /Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "disabled", optionValue: boolean): void; @@ -34320,6 +35752,7 @@ interface JQuery { * Gets/Sets options supported by the [igValidator](ui.igvalidator#options) widget. * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. + * */ igDateEditor(optionLiteral: 'option', optionName: "validatorOptions"): any; @@ -34328,36 +35761,42 @@ interface JQuery { * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "validatorOptions", optionValue: any): void; /** * Set/Get the locale setting for the widget. + * */ igDateEditor(optionLiteral: 'option', optionName: "locale"): any; /** * Set/Get the locale setting for the widget. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "locale", optionValue: any): void; /** * Set/Get the locale language setting for the widget. + * */ igDateEditor(optionLiteral: 'option', optionName: "language"): string; /** * Set/Get the locale language setting for the widget. * + * * @optionValue New value to be set. */ igDateEditor(optionLiteral: 'option', optionName: "language", optionValue: string): void; /** * Set/Get the regional setting for the widget. + * */ igDateEditor(optionLiteral: 'option', optionName: "regional"): string|Object; @@ -34365,6 +35804,7 @@ interface JQuery { /** * Set/Get the regional setting for the widget. * + * * @optionValue New value to be set. */ @@ -34470,6 +35910,7 @@ interface JQuery { /** * Gets visibility of the spin, clear and drop-down button. That option can be set only on initialization. Combinations like 'dropdown,spin' or 'spin,clear' are supported too. + * */ igDatePicker(optionLiteral: 'option', optionName: "buttonType"): string; @@ -34477,6 +35918,7 @@ interface JQuery { /** * Visibility of the spin, clear and drop-down button. That option can be set only on initialization. Combinations like 'dropdown,spin' or 'spin,clear' are supported too. * + * * @optionValue New value to be set. */ @@ -34484,12 +35926,14 @@ interface JQuery { /** * Gets/Sets the options supported by the [jquery.ui.datepicker](http://api.jqueryui.com/datepicker/). Only options related to the drop-down calendar are supported. + * */ igDatePicker(optionLiteral: 'option', optionName: "datepickerOptions"): any; /** * /Sets the options supported by the [jquery.ui.datepicker](http://api.jqueryui.com/datepicker/). Only options related to the drop-down calendar are supported. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "datepickerOptions", optionValue: any): void; @@ -34497,6 +35941,7 @@ interface JQuery { /** * Gets the ability to limit igDatePicker to be used only as s calendar. When set to true the editor input is not editable. * Note! This option can not be set runtime. + * */ igDatePicker(optionLiteral: 'option', optionName: "dropDownOnReadOnly"): boolean; @@ -34504,6 +35949,7 @@ interface JQuery { * The ability to limit igDatePicker to be used only as s calendar. When set to true the editor input is not editable. * Note! This option can not be set runtime. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "dropDownOnReadOnly", optionValue: boolean): void; @@ -34571,6 +36017,7 @@ interface JQuery { /** * Gets/Sets whether the onscreen keyboard (if available on device) should be shown when the dropdown button is clicked/tapped. This option prevents initial focus or removes it when the drop button is clicked/tapped. * Note: The option does not perform device detection so its behavior is always active if enabled. + * */ igDatePicker(optionLiteral: 'option', optionName: "suppressKeyboard"): boolean; @@ -34578,6 +36025,7 @@ interface JQuery { * /Sets whether the onscreen keyboard (if available on device) should be shown when the dropdown button is clicked/tapped. This option prevents initial focus or removes it when the drop button is clicked/tapped. * Note: The option does not perform device detection so its behavior is always active if enabled. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "suppressKeyboard", optionValue: boolean): void; @@ -34585,6 +36033,7 @@ interface JQuery { /** * Gets/Sets the value of the editor. Date object can be set as value. String can be set and the editor will pass it to the Date object constructor and use the corresponding Date object as the value. MVC date format can be used too. * Note! This option doesn't use the dateInputFormat to extract the date. + * */ igDatePicker(optionLiteral: 'option', optionName: "value"): Date; @@ -34592,6 +36041,7 @@ interface JQuery { * /Sets the value of the editor. Date object can be set as value. String can be set and the editor will pass it to the Date object constructor and use the corresponding Date object as the value. MVC date format can be used too. * Note! This option doesn't use the dateInputFormat to extract the date. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "value", optionValue: Date): void; @@ -34599,6 +36049,7 @@ interface JQuery { /** * Gets the minimum value which can be entered in editor by user. Date object can be set as value. String value can be passed and the editor will use the javascript Date object constructor to create date object and will use it for the comparison. MVC date format can be used too. * Note! This option doesn't use the dateInputFormat to extract the date. + * */ igDatePicker(optionLiteral: 'option', optionName: "minValue"): Date; @@ -34606,6 +36057,7 @@ interface JQuery { * The minimum value which can be entered in editor by user. Date object can be set as value. String value can be passed and the editor will use the javascript Date object constructor to create date object and will use it for the comparison. MVC date format can be used too. * Note! This option doesn't use the dateInputFormat to extract the date. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "minValue", optionValue: Date): void; @@ -34613,6 +36065,7 @@ interface JQuery { /** * Gets the maximum value which can be entered in editor by user. Date object can be set as value. String value can be passed and the editor will use the javascript Date object constructor to create date object and will use it for the comparison. MVC date format can be used too. * Note! This option doesn't use the dateInputFormat to extract the date. + * */ igDatePicker(optionLiteral: 'option', optionName: "maxValue"): Date; @@ -34620,6 +36073,7 @@ interface JQuery { * The maximum value which can be entered in editor by user. Date object can be set as value. String value can be passed and the editor will use the javascript Date object constructor to create date object and will use it for the comparison. MVC date format can be used too. * Note! This option doesn't use the dateInputFormat to extract the date. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "maxValue", optionValue: Date): void; @@ -34662,6 +36116,7 @@ interface JQuery { * "f": milliseconds field in hundreds * "ff": milliseconds field in tenths * "fff": milliseconds field + * */ igDatePicker(optionLiteral: 'option', optionName: "dateDisplayFormat"): string; @@ -34704,6 +36159,7 @@ interface JQuery { * "ff": milliseconds field in tenths * "fff": milliseconds field * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "dateDisplayFormat", optionValue: string): void; @@ -34735,6 +36191,7 @@ interface JQuery { * "ff": milliseconds field in tenths * "fff": milliseconds field * Note! This option can not be set runtime. + * */ igDatePicker(optionLiteral: 'option', optionName: "dateInputFormat"): string; @@ -34766,6 +36223,7 @@ interface JQuery { * "fff": milliseconds field * Note! This option can not be set runtime. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "dateInputFormat", optionValue: string): void; @@ -34775,6 +36233,7 @@ interface JQuery { * The [enableUTCDates](ui.%%WidgetNameLowered%%#options:enableUTCDates) option can be used to output an UTC ISO string instead. * For example 10:00 AM from a client with local offset of 5 hours ahead of GMT will be serialized as: * "2016-11-11T10:00:00+05:00" + * */ igDatePicker(optionLiteral: 'option', optionName: "dataMode"): string; @@ -34785,6 +36244,7 @@ interface JQuery { * For example 10:00 AM from a client with local offset of 5 hours ahead of GMT will be serialized as: * "2016-11-11T10:00:00+05:00" * + * * @optionValue New value to be set. */ @@ -34794,6 +36254,7 @@ interface JQuery { * Gets/Sets time zone offset from UTC, in minutes. The client date values are displayed with this offset instead of the local one. * Note: It is recommended that this option is used with an UTC value (e.g. "2016-11-03T14:08:08.504Z") so the outcome is consistent. * Values with ambiguous time zone could map to unpredictable times depending on the user agent local zone. + * */ igDatePicker(optionLiteral: 'option', optionName: "displayTimeOffset"): any; @@ -34802,6 +36263,7 @@ interface JQuery { * Note: It is recommended that this option is used with an UTC value (e.g. "2016-11-03T14:08:08.504Z") so the outcome is consistent. * Values with ambiguous time zone could map to unpredictable times depending on the user agent local zone. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "displayTimeOffset", optionValue: any): void; @@ -34820,6 +36282,7 @@ interface JQuery { * milliseconds: 100 * } * Time periods that don't have values use 1 as default. + * */ igDatePicker(optionLiteral: 'option', optionName: "spinDelta"): number|Object; @@ -34839,6 +36302,7 @@ interface JQuery { * } * Time periods that don't have values use 1 as default. * + * * @optionValue New value to be set. */ @@ -34848,6 +36312,7 @@ interface JQuery { * Gets/Sets ability to modify only 1 date field on spin events. * Value false enables changes of other date fields when incremented or decremented date-field reaches its limits. * Value true modifies only value of one field. + * */ igDatePicker(optionLiteral: 'option', optionName: "limitSpinToCurrentField"): boolean; @@ -34856,6 +36321,7 @@ interface JQuery { * Value false enables changes of other date fields when incremented or decremented date-field reaches its limits. * Value true modifies only value of one field. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "limitSpinToCurrentField", optionValue: boolean): void; @@ -34863,6 +36329,7 @@ interface JQuery { /** * Enables/Disables serializing client date as UTC ISO 8061 string instead of using the local time and zone values. * The option is only applied in "date" [dataMode](ui.%%WidgetNameLowered%%#options:dataMode). + * */ igDatePicker(optionLiteral: 'option', optionName: "enableUTCDates"): boolean; @@ -34870,6 +36337,7 @@ interface JQuery { * Enables/Disables serializing client date as UTC ISO 8061 string instead of using the local time and zone values. * The option is only applied in "date" [dataMode](ui.%%WidgetNameLowered%%#options:dataMode). * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "enableUTCDates", optionValue: boolean): void; @@ -34878,6 +36346,7 @@ interface JQuery { * Gets/Sets year for auto detection of 20th and 21st centuries. * That option is used to automatically fill century when the user entered only 1 or 2 digits into the year field or when the date pattern contains only 1 or 2 year positions, e.g. "yy" or "y". * If user entered value larger than value of this option, then 20th century is used, otherwise the 21st. + * */ igDatePicker(optionLiteral: 'option', optionName: "centuryThreshold"): number; @@ -34886,24 +36355,28 @@ interface JQuery { * That option is used to automatically fill century when the user entered only 1 or 2 digits into the year field or when the date pattern contains only 1 or 2 year positions, e.g. "yy" or "y". * If user entered value larger than value of this option, then 20th century is used, otherwise the 21st. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "centuryThreshold", optionValue: number): void; /** * Gets/Set value used to increase/decrease year part of the date, in order to set difference between year in Gregorian calendar and displayed year. + * */ igDatePicker(optionLiteral: 'option', optionName: "yearShift"): number; /** * /Set value used to increase/decrease year part of the date, in order to set difference between year in Gregorian calendar and displayed year. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "yearShift", optionValue: number): void; /** * Gets/Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string + * */ igDatePicker(optionLiteral: 'option', optionName: "nullValue"): string|number|Date; @@ -34911,6 +36384,7 @@ interface JQuery { /** * /Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string * + * * @optionValue New value to be set. */ @@ -35005,6 +36479,7 @@ interface JQuery { * Notes: * If "excludeKeys" option contains same characters as this option, then "excludeKeys" has priority. * Note! This option can not be se runtime. + * */ igDatePicker(optionLiteral: 'option', optionName: "includeKeys"): string; @@ -35014,6 +36489,7 @@ interface JQuery { * If "excludeKeys" option contains same characters as this option, then "excludeKeys" has priority. * Note! This option can not be se runtime. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "includeKeys", optionValue: string): void; @@ -35023,6 +36499,7 @@ interface JQuery { * Notes: * If a character is specified in "includeKeys" option also, then "excludeKeys" has priority. * Note! This option can not be se runtime. + * */ igDatePicker(optionLiteral: 'option', optionName: "excludeKeys"): string; @@ -35032,6 +36509,7 @@ interface JQuery { * If a character is specified in "includeKeys" option also, then "excludeKeys" has priority. * Note! This option can not be se runtime. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "excludeKeys", optionValue: string): void; @@ -35096,6 +36574,7 @@ interface JQuery { /** * Gets/Sets the horizontal alignment of the text in the editor. + * */ igDatePicker(optionLiteral: 'option', optionName: "textAlign"): string; @@ -35103,6 +36582,7 @@ interface JQuery { /** * /Sets the horizontal alignment of the text in the editor. * + * * @optionValue New value to be set. */ @@ -35110,18 +36590,21 @@ interface JQuery { /** * Gets/Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. + * */ igDatePicker(optionLiteral: 'option', optionName: "placeHolder"): string; /** * /Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "placeHolder", optionValue: string): void; /** * Gets/Sets the action when the editor gets focused. The default value is selectAll. + * */ igDatePicker(optionLiteral: 'option', optionName: "selectionOnFocus"): string; @@ -35129,6 +36612,7 @@ interface JQuery { /** * /Sets the action when the editor gets focused. The default value is selectAll. * + * * @optionValue New value to be set. */ @@ -35136,42 +36620,49 @@ interface JQuery { /** * Gets/Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. + * */ igDatePicker(optionLiteral: 'option', optionName: "revertIfNotValid"): boolean; /** * /Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "revertIfNotValid", optionValue: boolean): void; /** * Gets/Sets if the editor should prevent form submition when enter key is pressed. + * */ igDatePicker(optionLiteral: 'option', optionName: "preventSubmitOnEnter"): boolean; /** * /Sets if the editor should prevent form submition when enter key is pressed. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "preventSubmitOnEnter", optionValue: boolean): void; /** * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. + * */ igDatePicker(optionLiteral: 'option', optionName: "suppressNotifications"): boolean; /** * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "suppressNotifications", optionValue: boolean): void; /** * Gets/Sets the width of the control. + * */ igDatePicker(optionLiteral: 'option', optionName: "width"): string|number; @@ -35179,6 +36670,7 @@ interface JQuery { /** * /Sets the width of the control. * + * * @optionValue New value to be set. */ @@ -35186,6 +36678,7 @@ interface JQuery { /** * Gets/Sets the height of the control. + * */ igDatePicker(optionLiteral: 'option', optionName: "height"): string|number; @@ -35193,6 +36686,7 @@ interface JQuery { /** * /Sets the height of the control. * + * * @optionValue New value to be set. */ @@ -35200,12 +36694,14 @@ interface JQuery { /** * Gets/Sets tabIndex attribute for the editor input. + * */ igDatePicker(optionLiteral: 'option', optionName: "tabIndex"): number; /** * /Sets tabIndex attribute for the editor input. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "tabIndex", optionValue: number): void; @@ -35213,6 +36709,7 @@ interface JQuery { /** * Gets/Sets whether the editor value can become null. * If that option is false, and editor has no value, then value is set to an empty string. + * */ igDatePicker(optionLiteral: 'option', optionName: "allowNullValue"): boolean; @@ -35220,42 +36717,49 @@ interface JQuery { * /Sets whether the editor value can become null. * If that option is false, and editor has no value, then value is set to an empty string. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "allowNullValue", optionValue: boolean): void; /** * Gets/Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. + * */ igDatePicker(optionLiteral: 'option', optionName: "inputName"): string; /** * /Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "inputName", optionValue: string): void; /** * Gets/Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. + * */ igDatePicker(optionLiteral: 'option', optionName: "readOnly"): boolean; /** * /Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "readOnly", optionValue: boolean): void; /** * Gets/Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. + * */ igDatePicker(optionLiteral: 'option', optionName: "disabled"): boolean; /** * /Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "disabled", optionValue: boolean): void; @@ -35264,6 +36768,7 @@ interface JQuery { * Gets/Sets options supported by the [igValidator](ui.igvalidator#options) widget. * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. + * */ igDatePicker(optionLiteral: 'option', optionName: "validatorOptions"): any; @@ -35272,36 +36777,42 @@ interface JQuery { * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "validatorOptions", optionValue: any): void; /** * Set/Get the locale setting for the widget. + * */ igDatePicker(optionLiteral: 'option', optionName: "locale"): any; /** * Set/Get the locale setting for the widget. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "locale", optionValue: any): void; /** * Set/Get the locale language setting for the widget. + * */ igDatePicker(optionLiteral: 'option', optionName: "language"): string; /** * Set/Get the locale language setting for the widget. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "language", optionValue: string): void; /** * Set/Get the regional setting for the widget. + * */ igDatePicker(optionLiteral: 'option', optionName: "regional"): string|Object; @@ -35309,48 +36820,33 @@ interface JQuery { /** * Set/Get the regional setting for the widget. * + * * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; /** - * Event which is raised when the drop down is opening. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.calendar to obtain a reference to jQuery UI date picker widget, used as a calendar from the igDatePicker. + * Fired when the drop down is opening. */ igDatePicker(optionLiteral: 'option', optionName: "dropDownListOpening"): DropDownListOpeningEvent; /** - * Event which is raised when the drop down is opening. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.calendar to obtain a reference to jQuery UI date picker widget, used as a calendar from the igDatePicker. + * Fired when the drop down is opening. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "dropDownListOpening", optionValue: DropDownListOpeningEvent): void; /** - * Event which is raised after the drop down is opened. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.calendar to obtain a reference to jQuery UI date picker widget, used as a calendar from the igDatePicker. + * Fired after the drop down is opened. */ igDatePicker(optionLiteral: 'option', optionName: "dropDownListOpened"): DropDownListOpenedEvent; /** - * Event which is raised after the drop down is opened. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.calendar to obtain a reference to jQuery UI date picker widget, used as a calendar from the igDatePicker. + * Fired after the drop down is opened. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "dropDownListOpened", optionValue: DropDownListOpenedEvent): void; @@ -35379,22 +36875,14 @@ interface JQuery { igDatePicker(optionLiteral: 'option', optionName: "dropDownItemSelecting", optionValue: DropDownItemSelectingEvent): void; /** - * Event which is raised after the drop down (calendar) is closed. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.calendar to obtain a reference to jQuery UI date picker widget, used as a calendar from the igDatePicker. + * Fired after the drop down (calendar) is closed. */ igDatePicker(optionLiteral: 'option', optionName: "dropDownListClosed"): DropDownListClosedEvent; /** - * Event which is raised after the drop down (calendar) is closed. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.editorInput to obtain reference to the editable input - * Use ui.calendar to obtain a reference to jQuery UI date picker widget, used as a calendar from the igDatePicker. + * Fired after the drop down (calendar) is closed. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "dropDownListClosed", optionValue: DropDownListClosedEvent): void; @@ -35411,24 +36899,14 @@ interface JQuery { igDatePicker(optionLiteral: 'option', optionName: "dropDownItemSelected", optionValue: DropDownItemSelectedEvent): void; /** - * Event which is raised after a date selection in the calendar. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.dateFromPicker to obtain reference to the date object which is selected. - * Use ui.item to obtain a referece to the selected html element from the calendar. - * Use ui.calendar to obtain a reference to jQuery UI date picker, used as a calendar from the igDatePicker. + * Fired after a date selection in the calendar. */ igDatePicker(optionLiteral: 'option', optionName: "itemSelected"): ItemSelectedEvent; /** - * Event which is raised after a date selection in the calendar. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.dateFromPicker to obtain reference to the date object which is selected. - * Use ui.item to obtain a referece to the selected html element from the calendar. - * Use ui.calendar to obtain a reference to jQuery UI date picker, used as a calendar from the igDatePicker. + * Fired after a date selection in the calendar. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igDatePicker(optionLiteral: 'option', optionName: "itemSelected", optionValue: ItemSelectedEvent): void; igDatePicker(options: IgDatePicker): JQuery; @@ -35454,18 +36932,21 @@ interface JQuery { /** * Gets/Sets whether the checkbox is checked. + * */ igCheckboxEditor(optionLiteral: 'option', optionName: "checked"): boolean; /** * /Sets whether the checkbox is checked. * + * * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "checked", optionValue: boolean): void; /** * Gets/Sets size of the checkbox based on preset styles.For different sizes, define 'width' and 'height' options instead. + * */ igCheckboxEditor(optionLiteral: 'option', optionName: "size"): string; @@ -35473,6 +36954,7 @@ interface JQuery { /** * /Sets size of the checkbox based on preset styles.For different sizes, define 'width' and 'height' options instead. * + * * @optionValue New value to be set. */ @@ -35481,6 +36963,7 @@ interface JQuery { /** * Gets/Sets a custom class on the checkbox. Custom image can be used this way. * The following jQuery classes can be used in addition http://api.jqueryui.com/theming/icons/ + * */ igCheckboxEditor(optionLiteral: 'option', optionName: "iconClass"): string; @@ -35488,30 +36971,35 @@ interface JQuery { * /Sets a custom class on the checkbox. Custom image can be used this way. * The following jQuery classes can be used in addition http://api.jqueryui.com/theming/icons/ * + * * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "iconClass", optionValue: string): void; /** * Gets/Sets tabIndex attribute for the editor input. + * */ igCheckboxEditor(optionLiteral: 'option', optionName: "tabIndex"): number; /** * /Sets tabIndex attribute for the editor input. * + * * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "tabIndex", optionValue: number): void; /** * Gets/Sets the readonly attribute. Does not allow editing. Disables changing the checkbox state as an interaction, but it still can be changed programmatically. On submit the current value is sent into the request. + * */ igCheckboxEditor(optionLiteral: 'option', optionName: "readOnly"): boolean; /** * /Sets the readonly attribute. Does not allow editing. Disables changing the checkbox state as an interaction, but it still can be changed programmatically. On submit the current value is sent into the request. * + * * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "readOnly", optionValue: boolean): void; @@ -35522,6 +37010,7 @@ interface JQuery { /** * Gets/Sets the width of the control. + * */ igCheckboxEditor(optionLiteral: 'option', optionName: "width"): string|number; @@ -35529,6 +37018,7 @@ interface JQuery { /** * /Sets the width of the control. * + * * @optionValue New value to be set. */ @@ -35536,6 +37026,7 @@ interface JQuery { /** * Gets/Sets the height of the control. + * */ igCheckboxEditor(optionLiteral: 'option', optionName: "height"): string|number; @@ -35543,6 +37034,7 @@ interface JQuery { /** * /Sets the height of the control. * + * * @optionValue New value to be set. */ @@ -35550,36 +37042,42 @@ interface JQuery { /** * Gets/Sets value in editor. The effect of setting/getting that option depends on type of editor and on dataMode options for every type of editor. + * */ igCheckboxEditor(optionLiteral: 'option', optionName: "value"): any; /** * /Sets value in editor. The effect of setting/getting that option depends on type of editor and on dataMode options for every type of editor. * + * * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "value", optionValue: any): void; /** * Gets/Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. + * */ igCheckboxEditor(optionLiteral: 'option', optionName: "inputName"): string; /** * /Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. * + * * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "inputName", optionValue: string): void; /** * Gets/Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. + * */ igCheckboxEditor(optionLiteral: 'option', optionName: "disabled"): boolean; /** * /Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. * + * * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "disabled", optionValue: boolean): void; @@ -35588,6 +37086,7 @@ interface JQuery { * Gets/Sets options supported by the [igValidator](ui.igvalidator#options) widget. * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. + * */ igCheckboxEditor(optionLiteral: 'option', optionName: "validatorOptions"): any; @@ -35596,36 +37095,42 @@ interface JQuery { * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, * while the corresponding options of the editor prevent values violating the defined rules from being entered. * + * * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "validatorOptions", optionValue: any): void; /** * Set/Get the locale setting for the widget. + * */ igCheckboxEditor(optionLiteral: 'option', optionName: "locale"): any; /** * Set/Get the locale setting for the widget. * + * * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "locale", optionValue: any): void; /** * Set/Get the locale language setting for the widget. + * */ igCheckboxEditor(optionLiteral: 'option', optionName: "language"): string; /** * Set/Get the locale language setting for the widget. * + * * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "language", optionValue: string): void; /** * Set/Get the regional setting for the widget. + * */ igCheckboxEditor(optionLiteral: 'option', optionName: "regional"): string|Object; @@ -35633,302 +37138,183 @@ interface JQuery { /** * Set/Get the regional setting for the widget. * + * * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; /** - * Event which is raised before value in editor was changed. + * Fired before changing the editor's value. * Return false in order to cancel change. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.newValue to obtain the new value. - * Use ui.newState to obtain the new state. - * Use ui.oldValue to obtain the old value. - * Use ui.oldState to obtain the old state. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput obtain reference to the editor element. */ igCheckboxEditor(optionLiteral: 'option', optionName: "valueChanging"): ValueChangingEvent; /** - * Event which is raised before value in editor was changed. + * Fired before changing the editor's value. * Return false in order to cancel change. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.newValue to obtain the new value. - * Use ui.newState to obtain the new state. - * Use ui.oldValue to obtain the old value. - * Use ui.oldState to obtain the old state. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput obtain reference to the editor element. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "valueChanging", optionValue: ValueChangingEvent): void; /** - * Event which is raised after value in editor was changed. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.newValue to obtain the new value. - * Use ui.newState to obtain the new state. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput obtain reference to the editor element. + * Fired after the editor's value has been changed. */ igCheckboxEditor(optionLiteral: 'option', optionName: "valueChanged"): ValueChangedEvent; /** - * Event which is raised after value in editor was changed. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.newValue to obtain the new value. - * Use ui.newState to obtain the new state. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput obtain reference to the editor element. + * Fired after the editor's value has been changed. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "valueChanged", optionValue: ValueChangedEvent): void; /** - * Event which is raised before rendering of the editor completes. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the editor performing rendering. - * Use ui.element to get a reference to the editor element. + * Fired before rendering of the editor has finished. */ igCheckboxEditor(optionLiteral: 'option', optionName: "rendering"): RenderingEvent; /** - * Event which is raised before rendering of the editor completes. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the editor performing rendering. - * Use ui.element to get a reference to the editor element. + * Fired before rendering of the editor has finished. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "rendering", optionValue: RenderingEvent): void; /** - * Event which is raised after rendering of the editor completes. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the editor performing rendering. - * Use ui.element to get a reference to the editor element. + * Fired after rendering of the editor has finished. */ igCheckboxEditor(optionLiteral: 'option', optionName: "rendered"): RenderedEvent; /** - * Event which is raised after rendering of the editor completes. - * Function takes arguments evt and ui. - * Use ui.owner to get a reference to the editor performing rendering. - * Use ui.element to get a reference to the editor element. + * Fired after rendering of the editor has finished. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "rendered", optionValue: RenderedEvent): void; /** - * Event which is raised on mousedown event. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mousedown event. */ igCheckboxEditor(optionLiteral: 'option', optionName: "mousedown"): MousedownEvent; /** - * Event which is raised on mousedown event. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mousedown event. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "mousedown", optionValue: MousedownEvent): void; /** - * Event which is raised on mouseup event. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseup event. */ igCheckboxEditor(optionLiteral: 'option', optionName: "mouseup"): MouseupEvent; /** - * Event which is raised on mouseup event. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseup event. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "mouseup", optionValue: MouseupEvent): void; /** - * Event which is raised on mousemove at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mousemove at any part of editor including the drop-down list. */ igCheckboxEditor(optionLiteral: 'option', optionName: "mousemove"): MousemoveEvent; /** - * Event which is raised on mousemove at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mousemove at any part of editor including the drop-down list. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "mousemove", optionValue: MousemoveEvent): void; /** - * Event which is raised on mouseover at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseover at any part of editor including the drop-down list. */ igCheckboxEditor(optionLiteral: 'option', optionName: "mouseover"): MouseoverEvent; /** - * Event which is raised on mouseover at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseover at any part of editor including the drop-down list. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "mouseover", optionValue: MouseoverEvent): void; /** - * Event which is raised on mouseleave at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseleave at any part of editor including the drop-down list. */ igCheckboxEditor(optionLiteral: 'option', optionName: "mouseout"): MouseoutEvent; /** - * Event which is raised on mouseleave at any part of editor including drop-down list. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired on mouseleave at any part of editor including the drop-down list. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "mouseout", optionValue: MouseoutEvent): void; /** - * Event which is raised when input field of editor loses focus. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired when the input field of the editor loses focus. */ igCheckboxEditor(optionLiteral: 'option', optionName: "blur"): BlurEvent; /** - * Event which is raised when input field of editor loses focus. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired when the input field of the editor loses focus. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "blur", optionValue: BlurEvent): void; /** - * Event which is raised when input field of editor gets focus. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired when the input field of the editor gets focus. */ igCheckboxEditor(optionLiteral: 'option', optionName: "focus"): IgFocusEvent; /** - * Event which is raised when input field of editor gets focus. - * Function takes arguments evt and ui. - * Use ui.owner to obtain reference to igEditor. - * Use ui.element to obtain a reference to the event target. - * Use ui.editorInput to get a reference to the editor field. + * Fired when the input field of the editor gets focus. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "focus", optionValue: IgFocusEvent): void; /** - * Event which is raised on keydown event. + * Fired on keydown event. * Return false in order to cancel key action. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. */ igCheckboxEditor(optionLiteral: 'option', optionName: "keydown"): KeydownEvent; /** - * Event which is raised on keydown event. + * Fired on keydown event. * Return false in order to cancel key action. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "keydown", optionValue: KeydownEvent): void; /** - * Event which is raised on keypress event. + * Fired on keypress event. * Return false in order to cancel key action. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. */ igCheckboxEditor(optionLiteral: 'option', optionName: "keypress"): KeypressEvent; /** - * Event which is raised on keypress event. + * Fired on keypress event. * Return false in order to cancel key action. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "keypress", optionValue: KeypressEvent): void; /** - * Event which is raised on keyup event. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. + * Fired on keyup event. */ igCheckboxEditor(optionLiteral: 'option', optionName: "keyup"): KeyupEvent; /** - * Event which is raised on keyup event. - * Function takes arguments evt and ui. - * Use evt.originalEvent to obtain reference to event of browser. - * Use ui.owner to obtain reference to igEditor. - * Use ui.key to obtain value of keyCode. + * Fired on keyup event. * - * @optionValue Define event handler function. + * @optionValue New value to be set. */ igCheckboxEditor(optionLiteral: 'option', optionName: "keyup", optionValue: KeyupEvent): void; igCheckboxEditor(options: IgCheckboxEditor): JQuery; @@ -35937,6 +37323,4447 @@ interface JQuery { igCheckboxEditor(optionLiteral: 'option', optionName: string, optionValue: any): JQuery; igCheckboxEditor(methodName: string, ...methodParams: any[]): any; } +interface JQuery { + igTimePicker(methodName: "getSelectedListItem"): string; + igTimePicker(methodName: "dropDownVisible"): boolean; + igTimePicker(methodName: "dropDownButton"): string; + igTimePicker(methodName: "dropDownContainer"): string; + igTimePicker(methodName: "findListItemIndex", text: string, matchType?: Object): number; + igTimePicker(methodName: "selectedListIndex", index?: number): number; + igTimePicker(methodName: "value", newValue: Object): void; + igTimePicker(methodName: "selectDate"): void; + igTimePicker(methodName: "changeRegional"): void; + igTimePicker(methodName: "getSelectedDate"): Date; + igTimePicker(methodName: "spinUp", delta?: number): void; + igTimePicker(methodName: "spinDown", delta?: number): void; + igTimePicker(methodName: "spinUpButton"): string; + igTimePicker(methodName: "spinDownButton"): string; + igTimePicker(methodName: "isValid"): boolean; + + /** + * Gets delta-value which is used to generate the drop-down items for the time picker. + * Accepted values for deltas are positive integer numbers, and the fractional portion of floating point numbers is ignored. + * + * object A configuration object, which defines specific values for each time period. The option can accept the following format: + * itemsDelta: { + * hours: 0, + * minutes: 30, + * } + * Time periods that don't have values use 0 as default for hours and 30 for minutes. + */ + igTimePicker(optionLiteral: 'option', optionName: "itemsDelta"): IgTimePickerItemsDelta; + + /** + * Delta-value which is used to generate the drop-down items for the time picker. + * Accepted values for deltas are positive integer numbers, and the fractional portion of floating point numbers is ignored. + * + * object A configuration object, which defines specific values for each time period. The option can accept the following format: + * itemsDelta: { + * hours: 0, + * minutes: 30, + * } + * Time periods that don't have values use 0 as default for hours and 30 for minutes. + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "itemsDelta", optionValue: IgTimePickerItemsDelta): void; + + /** + * Gets/Sets delta-value which is used to increment or decrement the editor time on spin actions.When not editing (focused) the delta is applied on the day if available in the input mask or the lowest available period. + * When in edit mode the time period, where the cursor is positioned, is incremented or decremented with the defined delta value. + * Accepted values for deltas are positive integer numbers, and the fractional portion of floating point numbers is ignored. + * spinDelta: { + * hours: 12, + * minutes: 15 + * } + * Default value is {hours: 1, minutes: 30}. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "spinDelta"): any; + + /** + * /Sets delta-value which is used to increment or decrement the editor time on spin actions.When not editing (focused) the delta is applied on the day if available in the input mask or the lowest available period. + * When in edit mode the time period, where the cursor is positioned, is incremented or decremented with the defined delta value. + * Accepted values for deltas are positive integer numbers, and the fractional portion of floating point numbers is ignored. + * spinDelta: { + * hours: 12, + * minutes: 15 + * } + * Default value is {hours: 1, minutes: 30}. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "spinDelta", optionValue: any): void; + + /** + * Gets format of time while timepicker has focus. + * Value of that option can be set to explicit time pattern or to a flag defined by regional settings. + * If value is set to explicit time pattern and pattern besides date-flags has explicit characters which match with time-flags or mask-flags, then the "escape" character should be used in front of them. + * If option is not set, then the "time" is used automatically. + * List of predefined regional flags: + * "time": the timePattern member of regional option is used + * List of explicit characters, which should have escape \\ character in front of them: C, &, a, A, ?, L, 9, 0, #, >, <, y, M, d, h, H, m, s, t, f. + * List of time-flags when explicit time pattern is used: + * "t": first character of string which represents AM/PM field + * "tt": 2 characters of string which represents AM/PM field + * "hh": hours field in 12-hours format with leading zero + * "HH": hours field in 24-hours format with leading zero + * "mm": minutes field with leading zero + * Note! This option can not be set runtime. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "timeInputFormat"): string; + + /** + * Format of time while timepicker has focus. + * Value of that option can be set to explicit time pattern or to a flag defined by regional settings. + * If value is set to explicit time pattern and pattern besides date-flags has explicit characters which match with time-flags or mask-flags, then the "escape" character should be used in front of them. + * If option is not set, then the "time" is used automatically. + * List of predefined regional flags: + * "time": the timePattern member of regional option is used + * List of explicit characters, which should have escape \\ character in front of them: C, &, a, A, ?, L, 9, 0, #, >, <, y, M, d, h, H, m, s, t, f. + * List of time-flags when explicit time pattern is used: + * "t": first character of string which represents AM/PM field + * "tt": 2 characters of string which represents AM/PM field + * "hh": hours field in 12-hours format with leading zero + * "HH": hours field in 24-hours format with leading zero + * "mm": minutes field with leading zero + * Note! This option can not be set runtime. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "timeInputFormat", optionValue: string): void; + + /** + * Gets/Sets format of time while timepicker has no focus. + * Value of that option can be set to a specific time pattern or to a flag defined by regional settings. + * If value is not set, then the timeInputFormat is used automatically. + * If value is set to explicit time pattern and pattern besides time-flags has explicit characters which match with time-flags or mask-flags, then the "escape" character should be used in front of them. + * List of predefined regional flags: + * "time": the timePattern member of regional option is used + * List of explicit characters, which should have escape \\ character in front of them: + * C, &, a, A, ?, L, 9, 0, #, >, <, y, M, d, h, H, m, s, t, f. + * List of time-flags when explicit time pattern is used: + * "t": first character of string which represents AM/PM field + * "tt": 2 characters of string which represents AM/PM field + * "h": hours field in 12-hours format without leading zero + * "hh": hours field in 12-hours format with leading zero + * "H": hours field in 24-hours format without leading zero + * "HH": hours field in 24-hours format with leading zero + * "m": minutes field without leading zero + * "mm": minutes field with leading zero + * + */ + igTimePicker(optionLiteral: 'option', optionName: "timeDisplayFormat"): string; + + /** + * /Sets format of time while timepicker has no focus. + * Value of that option can be set to a specific time pattern or to a flag defined by regional settings. + * If value is not set, then the timeInputFormat is used automatically. + * If value is set to explicit time pattern and pattern besides time-flags has explicit characters which match with time-flags or mask-flags, then the "escape" character should be used in front of them. + * List of predefined regional flags: + * "time": the timePattern member of regional option is used + * List of explicit characters, which should have escape \\ character in front of them: + * C, &, a, A, ?, L, 9, 0, #, >, <, y, M, d, h, H, m, s, t, f. + * List of time-flags when explicit time pattern is used: + * "t": first character of string which represents AM/PM field + * "tt": 2 characters of string which represents AM/PM field + * "h": hours field in 12-hours format without leading zero + * "hh": hours field in 12-hours format with leading zero + * "H": hours field in 24-hours format without leading zero + * "HH": hours field in 24-hours format with leading zero + * "m": minutes field without leading zero + * "mm": minutes field with leading zero + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "timeDisplayFormat", optionValue: string): void; + + /** + * Gets/Sets if the editor should only allow values from the list of items. Matching is case-insensitive. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "isLimitedToListValues"): boolean; + + /** + * /Sets if the editor should only allow values from the list of items. Matching is case-insensitive. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "isLimitedToListValues", optionValue: boolean): void; + + /** + * Gets/Sets whether the onscreen keyboard (if available on device) should be shown when the dropdown button is clicked/tapped. This option prevents initial focus or removes it when the drop button is clicked/tapped. + * Note: The option does not perform device detection so its behavior is always active if enabled. + * Note: When drop down is opened the only way to close it will be using the drop down button. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "suppressKeyboard"): boolean; + + /** + * /Sets whether the onscreen keyboard (if available on device) should be shown when the dropdown button is clicked/tapped. This option prevents initial focus or removes it when the drop button is clicked/tapped. + * Note: The option does not perform device detection so its behavior is always active if enabled. + * Note: When drop down is opened the only way to close it will be using the drop down button. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "suppressKeyboard", optionValue: boolean): void; + + /** + * Gets/Sets the drop-down list opening orientation when the list gets open. If the option is set to auto the timepicker has priority to open the drop-down list bottom. If the space is not enough it tries to open the list top. If the space is not enough in both directions then the list gets opened at the bottom of the editor. + * + */ + + igTimePicker(optionLiteral: 'option', optionName: "dropDownOrientation"): string; + + /** + * /Sets the drop-down list opening orientation when the list gets open. If the option is set to auto the timepicker has priority to open the drop-down list bottom. If the space is not enough it tries to open the list top. If the space is not enough in both directions then the list gets opened at the bottom of the editor. + * + * + * @optionValue New value to be set. + */ + + igTimePicker(optionLiteral: 'option', optionName: "dropDownOrientation", optionValue: string): void; + + /** + * Gets the number of the items to be shown at once when the drop-down list get opened. + * Notes: + * This option is overwritten if the number of list items is less than the set value. In that case the drop-down list displays all the items. + * This option can not be set runtime. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "visibleItemsCount"): number; + + /** + * The number of the items to be shown at once when the drop-down list get opened. + * Notes: + * This option is overwritten if the number of list items is less than the set value. In that case the drop-down list displays all the items. + * This option can not be set runtime. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "visibleItemsCount", optionValue: number): void; + + /** + * Gets/Sets custom width of the drop-down list in pixels. If the value is equal to 0 or negative, then the width of timepicker is set as a drop-down width. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "listWidth"): number; + + /** + * /Sets custom width of the drop-down list in pixels. If the value is equal to 0 or negative, then the width of timepicker is set as a drop-down width. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "listWidth", optionValue: number): void; + + /** + * Gets/Sets the hover/unhover animation duration of a drop-down list item. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "listItemHoverDuration"): number; + + /** + * /Sets the hover/unhover animation duration of a drop-down list item. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "listItemHoverDuration", optionValue: number): void; + + /** + * Gets wheather the drop-down list element is attached to the body of the document, or to the timepicker container element. + * If the option is set to false the timepicker will attach the drop-down list element to the timepicker container + * If the option is set to true the timepicker will attach its drop-down list to as a child of the body. + * Note! This option can not be set runtime. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "dropDownAttachedToBody"): boolean; + + /** + * Wheather the drop-down list element is attached to the body of the document, or to the timepicker container element. + * If the option is set to false the timepicker will attach the drop-down list element to the timepicker container + * If the option is set to true the timepicker will attach its drop-down list to as a child of the body. + * Note! This option can not be set runtime. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "dropDownAttachedToBody", optionValue: boolean): void; + + /** + * Gets/Sets show/hide drop-down list animation duration in milliseconds. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "dropDownAnimationDuration"): number; + + /** + * /Sets show/hide drop-down list animation duration in milliseconds. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "dropDownAnimationDuration", optionValue: number): void; + + /** + * Gets visibility of the spin, clear and drop-down button. That option can be set only on initialization. Combinations like 'dropdown, clear' or 'spin, clear' are supported too.Note! This option can not be set runtime. + * Note! A combination like 'dropdown, spin' is not allowed. + * + */ + + igTimePicker(optionLiteral: 'option', optionName: "buttonType"): string; + + /** + * Visibility of the spin, clear and drop-down button. That option can be set only on initialization. Combinations like 'dropdown, clear' or 'spin, clear' are supported too.Note! This option can not be set runtime. + * Note! A combination like 'dropdown, spin' is not allowed. + * + * + * @optionValue New value to be set. + */ + + igTimePicker(optionLiteral: 'option', optionName: "buttonType", optionValue: string): void; + + /** + * Gets/Set the ability of the editor to automatically set value in the editor to the opposite side of the limit, when the spin action reaches minimum or maximum limit. + * This applies to [minValue](ui.%%WidgetNameLowered%%#options:minValue) and [maxValue](ui.%%WidgetNameLowered%%#options:maxValue) or cycling through list items if [isLimitedToListValues](ui.%%WidgetNameLowered%%#options:isLimitedToListValues) is enabled. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "spinWrapAround"): boolean; + + /** + * /Set the ability of the editor to automatically set value in the editor to the opposite side of the limit, when the spin action reaches minimum or maximum limit. + * This applies to [minValue](ui.%%WidgetNameLowered%%#options:minValue) and [maxValue](ui.%%WidgetNameLowered%%#options:maxValue) or cycling through list items if [isLimitedToListValues](ui.%%WidgetNameLowered%%#options:isLimitedToListValues) is enabled. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "spinWrapAround", optionValue: boolean): void; + + /** + * Removed from timepicker options + */ + igTimePicker(optionLiteral: 'option', optionName: "dateDisplayFormat"): any; + + /** + * Removed from timepicker options + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "dateDisplayFormat", optionValue: any): void; + + /** + * Removed from timepicker options + */ + igTimePicker(optionLiteral: 'option', optionName: "dateInputFormat"): any; + + /** + * Removed from timepicker options + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "dateInputFormat", optionValue: any): void; + + /** + * Removed from timepicker options + */ + igTimePicker(optionLiteral: 'option', optionName: "yearShift"): any; + + /** + * Removed from timepicker options + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "yearShift", optionValue: any): void; + + /** + * Removed from timepicker options + */ + igTimePicker(optionLiteral: 'option', optionName: "displayTimeOffset"): any; + + /** + * Removed from timepicker options + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "displayTimeOffset", optionValue: any): void; + + /** + * Gets/Sets the value of the editor. Date object can be set as value. String can be set and the editor will pass it to the Date object constructor and use the corresponding Date object as the value. MVC date format can be used too. + * Note! This option doesn't use the dateInputFormat to extract the date. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "value"): Date; + + /** + * /Sets the value of the editor. Date object can be set as value. String can be set and the editor will pass it to the Date object constructor and use the corresponding Date object as the value. MVC date format can be used too. + * Note! This option doesn't use the dateInputFormat to extract the date. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "value", optionValue: Date): void; + + /** + * Gets the minimum value which can be entered in editor by user. Date object can be set as value. String value can be passed and the editor will use the javascript Date object constructor to create date object and will use it for the comparison. MVC date format can be used too. + * Note! This option doesn't use the dateInputFormat to extract the date. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "minValue"): Date; + + /** + * The minimum value which can be entered in editor by user. Date object can be set as value. String value can be passed and the editor will use the javascript Date object constructor to create date object and will use it for the comparison. MVC date format can be used too. + * Note! This option doesn't use the dateInputFormat to extract the date. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "minValue", optionValue: Date): void; + + /** + * Gets the maximum value which can be entered in editor by user. Date object can be set as value. String value can be passed and the editor will use the javascript Date object constructor to create date object and will use it for the comparison. MVC date format can be used too. + * Note! This option doesn't use the dateInputFormat to extract the date. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "maxValue"): Date; + + /** + * The maximum value which can be entered in editor by user. Date object can be set as value. String value can be passed and the editor will use the javascript Date object constructor to create date object and will use it for the comparison. MVC date format can be used too. + * Note! This option doesn't use the dateInputFormat to extract the date. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "maxValue", optionValue: Date): void; + + /** + * Gets the value type returned by the get of value() method and option. Also affects how the value is stored for form submit. + * The [enableUTCDates](ui.%%WidgetNameLowered%%#options:enableUTCDates) option can be used to output an UTC ISO string instead. + * For example 10:00 AM from a client with local offset of 5 hours ahead of GMT will be serialized as: + * "2016-11-11T10:00:00+05:00" + * + */ + + igTimePicker(optionLiteral: 'option', optionName: "dataMode"): string; + + /** + * The value type returned by the get of value() method and option. Also affects how the value is stored for form submit. + * The [enableUTCDates](ui.%%WidgetNameLowered%%#options:enableUTCDates) option can be used to output an UTC ISO string instead. + * For example 10:00 AM from a client with local offset of 5 hours ahead of GMT will be serialized as: + * "2016-11-11T10:00:00+05:00" + * + * + * @optionValue New value to be set. + */ + + igTimePicker(optionLiteral: 'option', optionName: "dataMode", optionValue: string): void; + + /** + * Gets/Sets ability to modify only 1 date field on spin events. + * Value false enables changes of other date fields when incremented or decremented date-field reaches its limits. + * Value true modifies only value of one field. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "limitSpinToCurrentField"): boolean; + + /** + * /Sets ability to modify only 1 date field on spin events. + * Value false enables changes of other date fields when incremented or decremented date-field reaches its limits. + * Value true modifies only value of one field. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "limitSpinToCurrentField", optionValue: boolean): void; + + /** + * Enables/Disables serializing client date as UTC ISO 8061 string instead of using the local time and zone values. + * The option is only applied in "date" [dataMode](ui.%%WidgetNameLowered%%#options:dataMode). + * + */ + igTimePicker(optionLiteral: 'option', optionName: "enableUTCDates"): boolean; + + /** + * Enables/Disables serializing client date as UTC ISO 8061 string instead of using the local time and zone values. + * The option is only applied in "date" [dataMode](ui.%%WidgetNameLowered%%#options:dataMode). + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "enableUTCDates", optionValue: boolean): void; + + /** + * Gets/Sets year for auto detection of 20th and 21st centuries. + * That option is used to automatically fill century when the user entered only 1 or 2 digits into the year field or when the date pattern contains only 1 or 2 year positions, e.g. "yy" or "y". + * If user entered value larger than value of this option, then 20th century is used, otherwise the 21st. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "centuryThreshold"): number; + + /** + * /Sets year for auto detection of 20th and 21st centuries. + * That option is used to automatically fill century when the user entered only 1 or 2 digits into the year field or when the date pattern contains only 1 or 2 year positions, e.g. "yy" or "y". + * If user entered value larger than value of this option, then 20th century is used, otherwise the 21st. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "centuryThreshold", optionValue: number): void; + + /** + * Gets/Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string + * + */ + + igTimePicker(optionLiteral: 'option', optionName: "nullValue"): string|number|Date; + + /** + * /Sets the representation of null value. In case of default the value for the input is set to null, which makes the input to hold an empty string + * + * + * @optionValue New value to be set. + */ + + igTimePicker(optionLiteral: 'option', optionName: "nullValue", optionValue: string|number|Date): void; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + */ + igTimePicker(optionLiteral: 'option', optionName: "listItems"): any; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "listItems", optionValue: any): void; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + */ + igTimePicker(optionLiteral: 'option', optionName: "dropDownOnReadOnly"): boolean; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "dropDownOnReadOnly", optionValue: boolean): void; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + */ + igTimePicker(optionLiteral: 'option', optionName: "inputMask"): string; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "inputMask", optionValue: string): void; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + */ + igTimePicker(optionLiteral: 'option', optionName: "unfilledCharsPrompt"): string; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "unfilledCharsPrompt", optionValue: string): void; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + */ + igTimePicker(optionLiteral: 'option', optionName: "padChar"): string; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "padChar", optionValue: string): void; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + */ + igTimePicker(optionLiteral: 'option', optionName: "emptyChar"): string; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "emptyChar", optionValue: string): void; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + */ + igTimePicker(optionLiteral: 'option', optionName: "toUpper"): boolean; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "toUpper", optionValue: boolean): void; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + */ + igTimePicker(optionLiteral: 'option', optionName: "toLower"): boolean; + + /** + * This option is inherited from a parent widget and it's not applicable for igDateEditor + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "toLower", optionValue: boolean): void; + + /** + * Gets ability to enter only specific characters in input-field from keyboard and on paste. + * Notes: + * If "excludeKeys" option contains same characters as this option, then "excludeKeys" has priority. + * Note! This option can not be se runtime. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "includeKeys"): string; + + /** + * Ability to enter only specific characters in input-field from keyboard and on paste. + * Notes: + * If "excludeKeys" option contains same characters as this option, then "excludeKeys" has priority. + * Note! This option can not be se runtime. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "includeKeys", optionValue: string): void; + + /** + * Gets ability to prevent entering specific characters from keyboard or on paste. + * Notes: + * If a character is specified in "includeKeys" option also, then "excludeKeys" has priority. + * Note! This option can not be se runtime. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "excludeKeys"): string; + + /** + * Ability to prevent entering specific characters from keyboard or on paste. + * Notes: + * If a character is specified in "includeKeys" option also, then "excludeKeys" has priority. + * Note! This option can not be se runtime. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "excludeKeys", optionValue: string): void; + + igTimePicker(optionLiteral: 'option', optionName: "textMode"): any; + + igTimePicker(optionLiteral: 'option', optionName: "textMode", optionValue: any): void; + + /** + * This option is inherited from a parent widget and it's not applicable for igMaskEditor + */ + igTimePicker(optionLiteral: 'option', optionName: "maxLength"): any; + + /** + * This option is inherited from a parent widget and it's not applicable for igMaskEditor + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "maxLength", optionValue: any): void; + + /** + * Gets/Sets the horizontal alignment of the text in the editor. + * + */ + + igTimePicker(optionLiteral: 'option', optionName: "textAlign"): string; + + /** + * /Sets the horizontal alignment of the text in the editor. + * + * + * @optionValue New value to be set. + */ + + igTimePicker(optionLiteral: 'option', optionName: "textAlign", optionValue: string): void; + + /** + * Gets/Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "placeHolder"): string; + + /** + * /Sets the text which appears in the editor when it has no focus and the "value" is null or empty string. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "placeHolder", optionValue: string): void; + + /** + * Gets/Sets the action when the editor gets focused. The default value is selectAll. + * + */ + + igTimePicker(optionLiteral: 'option', optionName: "selectionOnFocus"): string; + + /** + * /Sets the action when the editor gets focused. The default value is selectAll. + * + * + * @optionValue New value to be set. + */ + + igTimePicker(optionLiteral: 'option', optionName: "selectionOnFocus", optionValue: string): void; + + /** + * Gets/Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "revertIfNotValid"): boolean; + + /** + * /Sets if the editor should revert it's value to the previously valid value in case the value on blur, or enter key is not valid. If the opiton is set to false, editor calls clear functionality. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "revertIfNotValid", optionValue: boolean): void; + + /** + * Gets/Sets if the editor should prevent form submition when enter key is pressed. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "preventSubmitOnEnter"): boolean; + + /** + * /Sets if the editor should prevent form submition when enter key is pressed. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "preventSubmitOnEnter", optionValue: boolean): void; + + /** + * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "suppressNotifications"): boolean; + + /** + * Disables/Enables default notifications for basic validation scenarios built in the editors such as required list selection, value wrapping around or spin limits. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "suppressNotifications", optionValue: boolean): void; + + /** + * Gets/Sets the width of the control. + * + */ + + igTimePicker(optionLiteral: 'option', optionName: "width"): string|number; + + /** + * /Sets the width of the control. + * + * + * @optionValue New value to be set. + */ + + igTimePicker(optionLiteral: 'option', optionName: "width", optionValue: string|number): void; + + /** + * Gets/Sets the height of the control. + * + */ + + igTimePicker(optionLiteral: 'option', optionName: "height"): string|number; + + /** + * /Sets the height of the control. + * + * + * @optionValue New value to be set. + */ + + igTimePicker(optionLiteral: 'option', optionName: "height", optionValue: string|number): void; + + /** + * Gets/Sets tabIndex attribute for the editor input. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "tabIndex"): number; + + /** + * /Sets tabIndex attribute for the editor input. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "tabIndex", optionValue: number): void; + + /** + * Gets/Sets whether the editor value can become null. + * If that option is false, and editor has no value, then value is set to an empty string. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "allowNullValue"): boolean; + + /** + * /Sets whether the editor value can become null. + * If that option is false, and editor has no value, then value is set to an empty string. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "allowNullValue", optionValue: boolean): void; + + /** + * Gets/Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "inputName"): string; + + /** + * /Sets the name attribute of the value input. This input is used to sent the value to the server. In case the target element is input and it has name attribute, but the developer has set the inputName option, so this option overwrites the value input and removes the attribute from the element. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "inputName", optionValue: string): void; + + /** + * Gets/Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "readOnly"): boolean; + + /** + * /Sets the readonly attribute for the input. If set to true the input is readonly, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is submitted. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "readOnly", optionValue: boolean): void; + + /** + * Gets/Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "disabled"): boolean; + + /** + * /Sets the disabled attribute for the input. If set to true the input is disabled, and all buttons and interactions are disabled. On submitting the form the editor belongs to, the value is not submitted. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "disabled", optionValue: boolean): void; + + /** + * Gets/Sets options supported by the [igValidator](ui.igvalidator#options) widget. + * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, + * while the corresponding options of the editor prevent values violating the defined rules from being entered. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "validatorOptions"): any; + + /** + * /Sets options supported by the [igValidator](ui.igvalidator#options) widget. + * Note: Validation rules of [igValidator](ui.igvalidator#options), such as min and max value/length are applied separately triggering errors, + * while the corresponding options of the editor prevent values violating the defined rules from being entered. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "validatorOptions", optionValue: any): void; + + /** + * Set/Get the locale setting for the widget. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igTimePicker(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igTimePicker(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igTimePicker(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + + /** + * Fired when the drop down is opening. + */ + igTimePicker(optionLiteral: 'option', optionName: "dropDownListOpening"): DropDownListOpeningEvent; + + /** + * Fired when the drop down is opening. + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "dropDownListOpening", optionValue: DropDownListOpeningEvent): void; + + /** + * Fired after the drop down is opened. + */ + igTimePicker(optionLiteral: 'option', optionName: "dropDownListOpened"): DropDownListOpenedEvent; + + /** + * Fired after the drop down is opened. + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "dropDownListOpened", optionValue: DropDownListOpenedEvent): void; + + /** + * Fired when the drop down is closing. + */ + igTimePicker(optionLiteral: 'option', optionName: "dropDownListClosing"): DropDownListClosingEvent; + + /** + * Fired when the drop down is closing. + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "dropDownListClosing", optionValue: DropDownListClosingEvent): void; + + /** + * Fired after the drop down is closed. + */ + igTimePicker(optionLiteral: 'option', optionName: "dropDownListClosed"): DropDownListClosedEvent; + + /** + * Fired after the drop down is closed. + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "dropDownListClosed", optionValue: DropDownListClosedEvent): void; + + /** + * Fired when an item in the drop down list is being selected. + */ + igTimePicker(optionLiteral: 'option', optionName: "dropDownItemSelecting"): DropDownItemSelectingEvent; + + /** + * Fired when an item in the drop down list is being selected. + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "dropDownItemSelecting", optionValue: DropDownItemSelectingEvent): void; + + /** + * Fired after an item in the drop down list is selected. + */ + igTimePicker(optionLiteral: 'option', optionName: "dropDownItemSelected"): DropDownItemSelectedEvent; + + /** + * Fired after an item in the drop down list is selected. + * + * @optionValue New value to be set. + */ + igTimePicker(optionLiteral: 'option', optionName: "dropDownItemSelected", optionValue: DropDownItemSelectedEvent): void; + igTimePicker(options: IgTimePicker): JQuery; + igTimePicker(optionLiteral: 'option', optionName: string): any; + igTimePicker(optionLiteral: 'option', options: IgTimePicker): JQuery; + igTimePicker(optionLiteral: 'option', optionName: string, optionValue: any): JQuery; + igTimePicker(methodName: string, ...methodParams: any[]): any; +} +interface ApplyCustomIndicatorsEvent { + (event: Event, ui: ApplyCustomIndicatorsEventUIParam): void; +} + +interface ApplyCustomIndicatorsEventUIParam {} + +interface IgFinancialChart { + /** + * Gets or sets the id of a template element to use for tooltips, or markup representing the tooltip template. + */ + tooltipTemplate?: any; + + /** + * Gets or sets the names of tooltip templates + */ + tooltipTemplates?: any; + + /** + * Gets or sets the left margin of chart title + */ + titleLeftMargin?: number; + + /** + * Gets or sets the right margin of chart title + */ + titleRightMargin?: number; + + /** + * Gets or sets the top margin of chart title + */ + titleTopMargin?: number; + + /** + * Gets or sets the bottom margin of chart title + */ + titleBottomMargin?: number; + + /** + * Gets or sets the left margin of chart subtitle + */ + subtitleLeftMargin?: number; + + /** + * Gets or sets the top margin of chart subtitle + */ + subtitleTopMargin?: number; + + /** + * Gets or sets the right margin of chart subtitle + */ + subtitleRightMargin?: number; + + /** + * Gets or sets the bottom margin of chart subtitle + */ + subtitleBottomMargin?: number; + + /** + * Gets or sets color of chart subtitle + */ + subtitleTextColor?: string; + + /** + * Gets or sets color of chart title + */ + titleTextColor?: string; + + /** + * Gets or sets the left margin of the chart content. + */ + leftMargin?: number; + + /** + * Gets or sets the top margin of the chart content. + */ + topMargin?: number; + + /** + * Gets or sets the right margin of the chart content. + */ + rightMargin?: number; + + /** + * Gets or sets the bottom margin around the chart content. + */ + bottomMargin?: number; + + /** + * Gets or sets the duration used for animating series plots when the data is changing + */ + transitionDuration?: number; + + /** + * Gets or sets the easing function used for animating series plots when the data is changing. + * This can be set to one of the known values "linear" or "cubic," or it can be set to an easing function which takes a single numeric parameter and returns a number. + */ + transitionEasingFunction?: any; + + /** + * Gets or sets a function for creating wrapped tooltip + */ + createWrappedTooltip?: any; + + /** + * Gets or sets the widget of this control + */ + widget?: any; + + /** + * Gets or sets CSS font property for the chart subtitle + */ + subtitleTextStyle?: string; + + /** + * Gets or sets CSS font property for the chart title + */ + titleTextStyle?: string; + + /** + * Gets or sets a collection of data items used to generate the chart. + * The ItemsSource of this chart can be a list of objects containing one or more numeric properties. + * Additionally, if the objects in the list implement the IEnumerable interface, + * the Chart will attempt to delve into the sub-collections when reading through the data source. + * Databinding can be further configured by attributing the data item classes + * with the DataSeriesMemberIntentAttribute. + */ + itemsSource?: any; + + /** + * Gets or sets a set of property paths that should be included for consideration by the category chart, leaving the remainder excluded. If null, all properties will be considered. + */ + includedProperties?: any; + + /** + * Gets or sets a set of property paths that should be excluded from consideration by the category chart. + */ + excludedProperties?: any; + + /** + * Gets or sets the palette of brushes to use for coloring the chart series. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + brushes?: any; + + /** + * Gets or sets the palette of brushes to use for outlines on the chart series. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + outlines?: any; + + /** + * Gets or sets the legend to connect this chart to. + * When the legend property is set, the chart will use it to display information about its series. Legends can be shared by multiple chart controls. + */ + legend?: any; + + /** + * Gets or sets whether the chart can be horizontally zoomed through user interactions. + */ + isHorizontalZoomEnabled?: boolean; + + /** + * Gets or sets whether the chart can be vertically zoomed through user interactions. + */ + isVerticalZoomEnabled?: boolean; + + /** + * Gets or sets the rectangle representing the current scroll and zoom state of the chart. + * WindowRect is expressed as a Rectangle with coordinates and sizes between 0 and 1. + * The provided object should have numeric properties called left, top, width and height. + */ + windowRect?: any; + + /** + * Gets or sets text to display above the plot area. + */ + title?: string; + + /** + * Gets or sets text to display below the Title, above the plot area. + */ + subtitle?: string; + + /** + * Gets or sets horizontal alignment which determines the title position, relative to the left and right edges of the control. + * + * Valid values: + * "left" Align the item to the left + * "center" Center the item + * "right" Align the item to the right + * "stretch" Stretch the item to the full width + */ + titleAlignment?: string; + + /** + * Gets or sets horizontal alignment which determines the subtitle position, relative to the left and right edges of the control. + * + * Valid values: + * "left" Align the item to the left + * "center" Center the item + * "right" Align the item to the right + * "stretch" Stretch the item to the full width + */ + subtitleAlignment?: string; + + /** + * Gets or sets the behavior that determines how unknown values will be plotted on the chart.Null and Double.NaN are two examples of unknown values. + * + * + * Valid values: + * "linearInterpolate" Plot the unknown value as the midpoint between surrounding known values using linear interpolation. + * "dontPlot" Do not plot the unknown value on the chart. + */ + unknownValuePlotting?: string; + + /** + * Gets or sets the rendering resolution for all series in this chart. + * Where n = Resolution, for every n horizontal pixels, combine all items into a single datapoint. When Resolution = 0, all datapoints will be rendered as graphical objects. Charts with a higher resolution will have faster performance. + */ + resolution?: number; + + /** + * Gets or sets the thickness for all series in this chart. Depending on the ChartType, this can be the main brush used, or just the outline. + */ + thickness?: number; + + /** + * Gets or sets the marker shapes used for indicating location of data points in this chart. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + */ + markerTypes?: any; + + /** + * Gets or sets the palette of brushes used for rendering fill area of data point markers. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + markerBrushes?: any; + + /** + * Gets or sets the palette of brushes used for rendering outlines of data point markers. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + markerOutlines?: any; + + /** + * Gets or sets the maximum number of markers displyed in the plot area of the chart. + */ + markerMaxCount?: number; + + /** + * Gets or sets the palette of brushes to used for coloring trend lines in this chart. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + trendLineBrushes?: any; + + /** + * Gets or sets the formula used for calculating trend lines in this chart.This property applies only to these chart types: point, line, spline, and bubble + * + * + * Valid values: + * "none" No trend line will be displayed. + * "linearFit" Linear fit. + * "quadraticFit" Quadratic polynomial fit. + * "cubicFit" Cubic polynomial fit. + * "quarticFit" Quartic polynomial fit. + * "quinticFit" Quintic polynomial fit. + * "logarithmicFit" Logarithmic fit. + * "exponentialFit" Exponential fit. + * "powerLawFit" Powerlaw fit. + * "simpleAverage" Simple moving average. + * "exponentialAverage" Exponential moving average. + * "modifiedAverage" Modified moving average. + * "cumulativeAverage" Cumulative moving average. + * "weightedAverage" Weighted moving average. + */ + trendLineType?: string; + + /** + * Gets or sets the thickness of the trend lines in this chart. + * This property applies only to these chart types: point, line, spline, and bubble + */ + trendLineThickness?: number; + + /** + * Gets or sets a value indicating whether grid and tick lines are aligned to device pixels. + */ + alignsGridLinesToPixels?: boolean; + trendLinePeriod?: number; + + /** + * Gets or sets function which takes an context object and returns a formatted label for the X-axis. + */ + xAxisFormatLabel?: any; + + /** + * Gets or sets function which takes a context object and returns a formatted label for the Y-axis. + */ + yAxisFormatLabel?: any; + + /** + * Gets or sets the left margin of labels on the X-axis + */ + xAxisLabelLeftMargin?: number; + + /** + * Gets or sets the top margin of labels on the X-axis + */ + xAxisLabelTopMargin?: number; + + /** + * Gets or sets the right margin of labels on the X-axis + */ + xAxisLabelRightMargin?: number; + + /** + * Gets or sets the bottom margin of labels on the X-axis + */ + xAxisLabelBottomMargin?: number; + + /** + * Gets or sets the left margin of labels on the Y-axis + */ + yAxisLabelLeftMargin?: number; + + /** + * Gets or sets the top margin of labels on the Y-axis + */ + yAxisLabelTopMargin?: number; + + /** + * Gets or sets the right margin of labels on the Y-axis + */ + yAxisLabelRightMargin?: number; + + /** + * Gets or sets the bottom margin of labels on the Y-axis + */ + yAxisLabelBottomMargin?: number; + + /** + * Gets or sets color of labels on the X-axis + */ + xAxisLabelTextColor?: string; + + /** + * Gets or sets color of labels on the Y-axis + */ + yAxisLabelTextColor?: string; + + /** + * Gets or sets the margin around a title on the X-axis + */ + xAxisTitleMargin?: number; + + /** + * Gets or sets the margin around a title on the Y-axis + */ + yAxisTitleMargin?: number; + + /** + * Gets or sets the left margin of a title on the X-axis + */ + xAxisTitleLeftMargin?: number; + + /** + * Gets or sets the left margin of a title on the Y-axis + */ + yAxisTitleLeftMargin?: number; + + /** + * Gets or sets the top margin of a title on the X-axis + */ + xAxisTitleTopMargin?: number; + + /** + * Gets or sets the top margin of a title on the Y-axis + */ + yAxisTitleTopMargin?: number; + + /** + * Gets or sets the right margin of a title on the X-axis + */ + xAxisTitleRightMargin?: number; + + /** + * Gets or sets the right margin of a title on the Y-axis + */ + yAxisTitleRightMargin?: number; + + /** + * Gets or sets the bottom margin of a title on the X-axis + */ + xAxisTitleBottomMargin?: number; + + /** + * Gets or sets the bottom margin of a title on the Y-axis + */ + yAxisTitleBottomMargin?: number; + + /** + * Gets or sets color of title on the X-axis + */ + xAxisTitleTextColor?: string; + + /** + * Gets or sets color of title on the Y-axis + */ + yAxisTitleTextColor?: string; + + /** + * Gets or sets CSS font property for labels on X-axis + */ + xAxisLabelTextStyle?: string; + + /** + * Gets or sets CSS font property for labels on Y-axis + */ + yAxisLabelTextStyle?: string; + + /** + * Gets or sets CSS font property for title on X-axis + */ + xAxisTitleTextStyle?: string; + + /** + * Gets or sets CSS font property for title on Y-axis + */ + yAxisTitleTextStyle?: string; + + /** + * Gets or sets the format for labels along the X-axis. + */ + xAxisLabel?: any; + + /** + * Gets or sets the format for labels along the Y-axis. + */ + yAxisLabel?: any; + + /** + * Gets or sets the color to apply to major gridlines along the X-axis. + */ + xAxisMajorStroke?: string; + + /** + * Gets or sets the color to apply to major gridlines along the Y-axis. + */ + yAxisMajorStroke?: string; + + /** + * Gets or sets the thickness to apply to major gridlines along the X-axis. + */ + xAxisMajorStrokeThickness?: number; + + /** + * Gets or sets the thickness to apply to major gridlines along the Y-axis. + */ + yAxisMajorStrokeThickness?: number; + + /** + * Gets or sets the thickness to apply to minor gridlines along the X-axis. + */ + xAxisMinorStrokeThickness?: number; + + /** + * Gets or sets the thickness to apply to minor gridlines along the Y-axis. + */ + yAxisMinorStrokeThickness?: number; + + /** + * Gets or sets the color to apply to stripes along the X-axis. + */ + xAxisStrip?: string; + + /** + * Gets or sets the color to apply to stripes along the Y-axis. + */ + yAxisStrip?: string; + + /** + * Gets or sets the color to apply to the X-axis line. + */ + xAxisStroke?: string; + + /** + * Gets or sets the color to apply to the Y-axis line. + */ + yAxisStroke?: string; + + /** + * Gets or sets the thickness to apply to the X-axis line. + */ + xAxisStrokeThickness?: number; + + /** + * Gets or sets the thickness to apply to the Y-axis line. + */ + yAxisStrokeThickness?: number; + + /** + * Gets or sets the length of tickmarks along the X-axis. + */ + xAxisTickLength?: number; + + /** + * Gets or sets the length of tickmarks along the Y-axis. + */ + yAxisTickLength?: number; + + /** + * Gets or sets the color to apply to tickmarks along the X-axis. + */ + xAxisTickStroke?: string; + + /** + * Gets or sets the color to apply to tickmarks along the Y-axis. + */ + yAxisTickStroke?: string; + + /** + * Gets or sets the thickness to apply to tickmarks along the X-axis. + */ + xAxisTickStrokeThickness?: number; + + /** + * Gets or sets the thickness to apply to tickmarks along the Y-axis. + */ + yAxisTickStrokeThickness?: number; + + /** + * Gets or sets the Text to display below the X-axis. + */ + xAxisTitle?: string; + + /** + * Gets or sets the Text to display to the left of the Y-axis. + */ + yAxisTitle?: string; + + /** + * Gets or sets the color to apply to minor gridlines along the X-axis. + */ + xAxisMinorStroke?: string; + + /** + * Gets or sets the color to apply to minor gridlines along the Y-axis. + */ + yAxisMinorStroke?: string; + + /** + * Gets or sets the angle of rotation for labels along the X-axis. + */ + xAxisLabelAngle?: number; + + /** + * Gets or sets the angle of rotation for labels along the Y-axis. + */ + yAxisLabelAngle?: number; + + /** + * Gets or sets the distance between the X-axis and the bottom of the chart. + */ + xAxisExtent?: number; + + /** + * Gets or sets the distance between the Y-axis and the left edge of the chart. + */ + yAxisExtent?: number; + + /** + * Gets or sets the angle of rotation for the X-axis title. + */ + xAxisTitleAngle?: number; + + /** + * Gets or sets the angle of rotation for the Y-axis title. + */ + yAxisTitleAngle?: number; + + /** + * Gets or sets whether to invert the direction of the X-axis by placing the first data items on the right side of the chart. + */ + xAxisInverted?: boolean; + + /** + * Gets or sets whether to invert the direction of the Y-axis by placing the minimum numeric value at the top of the chart. + */ + yAxisInverted?: boolean; + + /** + * Gets or sets Horizontal alignment of the X-axis title. + * + * Valid values: + * "left" Align the item to the left + * "center" Center the item + * "right" Align the item to the right + * "stretch" Stretch the item to the full width + */ + xAxisTitleAlignment?: string; + + /** + * Gets or sets Vertical alignment of the Y-axis title. + * + * Valid values: + * "top" Align the item to the top + * "center" Center the item + * "bottom" Align the item to the bottom + * "stretch" Stretch the item to the full height + */ + yAxisTitleAlignment?: string; + + /** + * Gets or sets Horizontal alignment of X-axis labels. + * + * Valid values: + * "left" Align the item to the left + * "center" Center the item + * "right" Align the item to the right + * "stretch" Stretch the item to the full width + */ + xAxisLabelHorizontalAlignment?: string; + + /** + * Gets or sets Horizontal alignment of Y-axis labels. + * + * Valid values: + * "left" Align the item to the left + * "center" Center the item + * "right" Align the item to the right + * "stretch" Stretch the item to the full width + */ + yAxisLabelHorizontalAlignment?: string; + + /** + * Gets or sets Vertical alignment of X-axis labels. + * + * Valid values: + * "top" Align the item to the top + * "center" Center the item + * "bottom" Align the item to the bottom + * "stretch" Stretch the item to the full height + */ + xAxisLabelVerticalAlignment?: string; + + /** + * Gets or sets Vertical alignment of Y-axis labels. + * + * Valid values: + * "top" Align the item to the top + * "center" Center the item + * "bottom" Align the item to the bottom + * "stretch" Stretch the item to the full height + */ + yAxisLabelVerticalAlignment?: string; + + /** + * Gets or sets Visibility of X-axis labels. + * + * Valid values: + * "visible" Display the element. + * "collapsed" Do not display the element. + */ + xAxisLabelVisibility?: string; + + /** + * Gets or sets Visibility of Y-axis labels. + * + * Valid values: + * "visible" Display the element. + * "collapsed" Do not display the element. + */ + yAxisLabelVisibility?: string; + + /** + * The location of Y-axis labels, relative to the plot area. + * + * Valid values: + * "outsideTop" Places the axis labels at the top, outside of the plotting area. + * "outsideBottom" Places the axis labels at the bottom, outside of the plotting area + * "outsideLeft" Places the axis labels to the left, outside of the plotting area. + * "outsideRight" Places the axis labels to the right, outside of the plotting area. + * "insideTop" Places the axis labels inside the plotting area above the axis line. + * "insideBottom" Places the axis labels inside the plotting area below the axis line. + * "insideLeft" Places the axis labels inside the plotting area and to the left of the axis line. + * "insideRight" Places the axis labels inside the plotting area and to the right of the axis line. + */ + yAxisLabelLocation?: string; + rangeSelectorTemplate?: any; + toolbarTemplate?: any; + chartTypePickerTemplate?: any; + trendLineTypePickerTemplate?: any; + volumeTypePickerTemplate?: any; + indicatorPickerTemplate?: any; + overlayPickerTemplate?: any; + toolbarHeight?: number; + + /** + * Gets or sets whether the Y-axis should use a logarithmic scale instead of a linear one. + * Since log(-1) is imaginary and log(0) is undefined, it is recommended to enable this property only when the Y-axis minimum is greater than zero. + */ + yAxisIsLogarithmic?: boolean; + + /** + * Gets or sets the base value to use in the log function when mapping the position of data items along the Y-axis. + * This property is effective only when YAxisIsLogarithmic is true. + */ + yAxisLogarithmBase?: number; + + /** + * Gets or sets the distance between each label and grid line along the Y-axis. + */ + yAxisInterval?: number; + + /** + * Gets or sets the data value corresponding to the minimum value of the Y-axis. + */ + yAxisMinimumValue?: number; + + /** + * Gets or sets the data value corresponding to the maximum value of the Y-axis. + */ + yAxisMaximumValue?: number; + + /** + * Gets or sets the frequency of displayed minor lines along the Y-axis. + */ + yAxisMinorInterval?: number; + + /** + * The type of series to display in the volume pane. + * + * Valid values: + * "none" Do not display the volume pane. + * "column" Display column series in the volume pane. + * "line" Display line series in the volume pane. + * "area" Display area series in the volume pane. + */ + volumeType?: string; + + /** + * The scaling mode of the X-axis. + * + * Valid values: + * "ordinal" An ordinal scale with time labels. + * "time" A time scale. + */ + xAxisMode?: string; + + /** + * The scaling mode of the Y-axis. + * + * Valid values: + * "numeric" A linear or logarithmic numeric scale. + * "percentChange" A numeric scale where all values are scaled proportionally to a reference value. + */ + yAxisMode?: string; + + /** + * A boolean property controlling the visibility of the toolbar. + */ + isToolbarVisible?: boolean; + + /** + * The type of price series to display in the main chart. + * + * Valid values: + * "auto" Automatically determine the price series type to display in the main chart. + * "bar" Display financial bar series in the main chart. + * "candle" Display candlestick series in the main chart. + * "column" Display column series in the main chart. + * "line" Display line series in the main chart. + */ + chartType?: string; + + /** + * A boolean indicating whether the chart should automatically zoom in vertically on the currently visible range of data. + * When this property is set to true, panning and zooming along the X-axis will result in a corresponding zoom on the Y-axis, so that the visible range of data fills the zoom window as fully as possible. + */ + isWindowSyncedToVisibleRange?: boolean; + + /** + * A collection indicating what financial indicator types to display on the Financial Chart. + */ + indicatorTypes?: any; + + /** + * A collection indicating what financial overlay types to display on the Financial Chart. + */ + overlayTypes?: any; + + /** + * Gets or sets whether the large numbers on the Y-axis labels are abbreviated. + */ + yAxisAbbreviateLargeNumbers?: boolean; + + /** + * The type of series to display in the zoom slider pane. + * + * Valid values: + * "none" Do not display the zoom slider pane. + * "bar" Display financial bar series in the zoom slider pane. + * "candle" Display candle series in the zoom slider pane. + * "column" Display column series in the zoom slider pane. + * "line" Display line series in the zoom slider pane. + * "area" Display an area series in the zoom slider pane. + */ + zoomSliderType?: string; + + /** + * Gets or sets the palette used for coloring negative items of Waterfall chart type. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + negativeBrushes?: any; + + /** + * Brushes to use for drawing negative elements, when using a chart type with contextual coloring, such as Waterfall. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + negativeOutlines?: any; + + /** + * Brushes to use for filling financial overlays. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + overlayBrushes?: any; + + /** + * Brushes to use for outlining financial overlays. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + overlayOutlines?: any; + + /** + * Brushes to use for outlining volume series in the volume pane. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + volumeOutlines?: any; + + /** + * Brushes to use for filling volume series in the volume pane. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + volumeBrushes?: any; + + /** + * Brushes to use for negative elements in financial indicators. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + indicatorNegativeBrushes?: any; + + /** + * Brushes to use for financial indicators. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + indicatorBrushes?: any; + + /** + * The outline thickness of volume series in the volume pane. + */ + volumeThickness?: number; + + /** + * The outline thickness of financial overlays. + */ + overlayThickness?: number; + + /** + * The outline or stroke thickness of financial indicators. + */ + indicatorThickness?: number; + + /** + * The display types of financial indicators. + */ + indicatorDisplayTypes?: any; + + /** + * The period of financial indicators, where applicable. + */ + indicatorPeriod?: number; + + /** + * The multiplier of financial indicators, where applicable. + */ + indicatorMultiplier?: number; + + /** + * The smoothing period of financial indicators, where applicable. + */ + indicatorSmoothingPeriod?: number; + + /** + * The short period of financial indicators, where applicable. + */ + indicatorShortPeriod?: number; + + /** + * The long period of financial indicators, where applicable. + */ + indicatorLongPeriod?: number; + + /** + * The signal period of financial indicators, where applicable. + */ + indicatorSignalPeriod?: number; + + /** + * A FinancialChartRangeSelectorOptionCollection containing the available range selector options on the toolbar. + */ + rangeSelectorOptions?: any; + + /** + * A FinancialChartRangeSelectorOptionCollection containing the available range selector options on the toolbar. + * This will be the intersection of the user-defined range selector options, if any, and the range selector options which are automatically determined based on the range of data. + */ + actualRangeSelectorOptions?: any; + + /** + * The names of custom indicators to add to the chart. + * When CustomIndicatorNames is set, the ApplyCustomIndicators event will be raised for each custom indicator name. + */ + customIndicatorNames?: any; + + /** + * The width of the chart. + */ + width?: number; + + /** + * The height of the chart. + */ + height?: number; + + /** + * Gets sets maximum number of displayed records in chart. + */ + maxRecCount?: number; + + /** + * Gets sets a valid data source. + * That can be instance of array or primitives, array of objects, instance of $.ig.DataSource, or any other data accepted by $.ig.DataSource. + * Note: if it is set to string and "dataSourceType" option is not set, then $.ig.JSONPDataSource is used. + */ + dataSource?: any; + + /** + * Gets sets data source type (such as "json", "xml", etc). Please refer to the documentation of $.ig.DataSource and its type property + */ + dataSourceType?: string; + + /** + * Gets sets url which is used for sending JSON on request for remote data. + */ + dataSourceUrl?: string; + + /** + * See $.ig.DataSource. property in the response specifying the total number of records on the server. + */ + responseTotalRecCountKey?: string; + + /** + * See $.ig.DataSource. This is basically the property in the responses where data records are held, if the response is wrapped. + */ + responseDataKey?: string; + + /** + * Event raised when a property value is changed on this chart + */ + propertyChanged?: PropertyChangedEvent; + + /** + * Event raised when a series is initialized and added to this chart. + */ + seriesAdded?: SeriesAddedEvent; + + /** + * Event raised when a series is removed from this chart. + */ + seriesRemoved?: SeriesRemovedEvent; + + /** + * Occurs when the pointer enters a Series. + */ + seriesPointerEnter?: SeriesPointerEnterEvent; + + /** + * Occurs when the pointer leaves a Series. + */ + seriesPointerLeave?: SeriesPointerLeaveEvent; + + /** + * Occurs when the pointer moves over a Series. + */ + seriesPointerMove?: SeriesPointerMoveEvent; + + /** + * Occurs when the pointer is pressed down over a Series. + */ + seriesPointerDown?: SeriesPointerDownEvent; + + /** + * Occurs when the pointer is released over a Series. + */ + seriesPointerUp?: SeriesPointerUpEvent; + + /** + * Event raised by the chart when custom indicator data is needed from the application. + * During series rendering, event will be raised once for each value in the CustomIndicatorNames collection. + */ + applyCustomIndicators?: ApplyCustomIndicatorsEvent; + + /** + * Event which is raised before data binding. + * Return false in order to cancel data binding. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.dataSource to obtain reference to instance of $.ig.DataSource. + */ + dataBinding?: DataBindingEvent; + + /** + * Event which is raised after data binding. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.data to obtain reference to array actual data which is displayed by chart. + * Use ui.dataSource to obtain reference to instance of $.ig.DataSource. + */ + dataBound?: DataBoundEvent; + + /** + * Event which is raised before tooltip is updated. + * Return false in order to cancel updating and hide tooltip. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.text to obtain html of tooltip. Value of that member can be modified. If modified value is null or empty string, then current content of tooltip keeps old value. + * Use ui.item to obtain reference to item. Value of that member can be modified or replaced by custom item. + * Use ui.x to obtain left position of tooltip in pixels relative to widget. Value of that member can be modified. + * Use ui.y to obtain top position of tooltip in pixels relative to widget. Value of that member can be modified. + * Use ui.element to obtain reference to jquery object which represents tooltip. Value of that member can be replaced by custom element. + */ + updateTooltip?: UpdateTooltipEvent; + + /** + * Event which is raised before tooltip is hidden. + * Return false in order to cancel hiding and keep tooltip visible. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.item to obtain reference to item. + * Use ui.element to obtain reference to jquery object which represents tooltip or value of ui.element from last updateTooltip event. Value of that member can be replaced by custom element. + */ + hideTooltip?: HideTooltipEvent; + + /** + * Option for igFinancialChart + */ + [optionName: string]: any; +} +interface IgFinancialChartMethods { + destroy(): void; + id(): void; + exportVisualData(): void; + + /** + * Find index of item within actual data used by chart. + * + * @param item The reference to item. + */ + findIndexOfItem(item: Object): number; + + /** + * Get item within actual data used by chart. That is similar to this.getData()[ index ]. + * + * @param index Index of data item. + */ + getDataItem(index: Object): Object; + + /** + * Get reference of actual data used by chart. + */ + getData(): any[]; + + /** + * Adds a new item to the data source and notifies the chart. + * + * @param item The item that we want to add to the data source. + */ + addItem(item: Object): Object; + + /** + * Inserts a new item to the data source and notifies the chart. + * + * @param item the new item that we want to insert in the data source. + * @param index The index in the data source where the new item will be inserted. + */ + insertItem(item: Object, index: number): Object; + + /** + * Deletes an item from the data source and notifies the chart. + * + * @param index The index in the data source from where the item will be been removed. + */ + removeItem(index: number): Object; + + /** + * Updates an item in the data source and notifies the chart. + * + * @param index The index of the item in the data source that we want to change. + * @param item The new item object that will be set in the data source. + */ + setItem(index: number, item: Object): Object; + + /** + * Notifies the chart that an item has been set in an associated data source. + * + * @param dataSource The data source in which the change happened. + * @param index The index in the items source that has been changed. + * @param newItem the new item that has been set in the collection. + * @param oldItem the old item that has been overwritten in the collection. + */ + notifySetItem(dataSource: Object, index: number, newItem: Object, oldItem: Object): Object; + + /** + * Notifies the chart that the items have been cleared from an associated data source. + * It's not necessary to notify more than one target of a change if they share the same items source. + * + * @param dataSource The data source in which the change happened. + */ + notifyClearItems(dataSource: Object): Object; + + /** + * Notifies the target axis or series that an item has been inserted at the specified index in its data source. + * It's not necessary to notify more than one target of a change if they share the same items source. + * + * @param dataSource The data source in which the change happened. + * @param index The index in the items source where the new item has been inserted. + * @param newItem the new item that has been set in the collection. + */ + notifyInsertItem(dataSource: Object, index: number, newItem: Object): Object; + + /** + * Notifies the target axis or series that an item has been removed from the specified index in its data source. + * It's not necessary to notify more than one target of a change if they share the same items source. + * + * @param dataSource The data source in which the change happened. + * @param index The index in the items source from where the old item has been removed. + * @param oldItem the old item that has been removed from the collection. + */ + notifyRemoveItem(dataSource: Object, index: number, oldItem: Object): Object; + + /** + * Get reference to chart object. + */ + chart(): Object; + + /** + * Binds data to the chart + */ + dataBind(): void; + + /** + * Forces any pending deferred work to render on the chart before continuing + */ + flush(): void; +} +interface JQuery { + data(propertyName: "igFinancialChart"): IgFinancialChartMethods; +} + +interface JQuery { + igFinancialChart(methodName: "destroy"): void; + igFinancialChart(methodName: "id"): void; + igFinancialChart(methodName: "exportVisualData"): void; + igFinancialChart(methodName: "findIndexOfItem", item: Object): number; + igFinancialChart(methodName: "getDataItem", index: Object): Object; + igFinancialChart(methodName: "getData"): any[]; + igFinancialChart(methodName: "addItem", item: Object): Object; + igFinancialChart(methodName: "insertItem", item: Object, index: number): Object; + igFinancialChart(methodName: "removeItem", index: number): Object; + igFinancialChart(methodName: "setItem", index: number, item: Object): Object; + igFinancialChart(methodName: "notifySetItem", dataSource: Object, index: number, newItem: Object, oldItem: Object): Object; + igFinancialChart(methodName: "notifyClearItems", dataSource: Object): Object; + igFinancialChart(methodName: "notifyInsertItem", dataSource: Object, index: number, newItem: Object): Object; + igFinancialChart(methodName: "notifyRemoveItem", dataSource: Object, index: number, oldItem: Object): Object; + igFinancialChart(methodName: "chart"): Object; + igFinancialChart(methodName: "dataBind"): void; + igFinancialChart(methodName: "flush"): void; + + /** + * Gets the id of a template element to use for tooltips, or markup representing the tooltip template. + */ + igFinancialChart(optionLiteral: 'option', optionName: "tooltipTemplate"): any; + + /** + * Sets the id of a template element to use for tooltips, or markup representing the tooltip template. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "tooltipTemplate", optionValue: any): void; + + /** + * Gets the names of tooltip templates + */ + igFinancialChart(optionLiteral: 'option', optionName: "tooltipTemplates"): any; + + /** + * Sets the names of tooltip templates + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "tooltipTemplates", optionValue: any): void; + + /** + * Gets the left margin of chart title + */ + igFinancialChart(optionLiteral: 'option', optionName: "titleLeftMargin"): number; + + /** + * Sets the left margin of chart title + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "titleLeftMargin", optionValue: number): void; + + /** + * Gets the right margin of chart title + */ + igFinancialChart(optionLiteral: 'option', optionName: "titleRightMargin"): number; + + /** + * Sets the right margin of chart title + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "titleRightMargin", optionValue: number): void; + + /** + * Gets the top margin of chart title + */ + igFinancialChart(optionLiteral: 'option', optionName: "titleTopMargin"): number; + + /** + * Sets the top margin of chart title + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "titleTopMargin", optionValue: number): void; + + /** + * Gets the bottom margin of chart title + */ + igFinancialChart(optionLiteral: 'option', optionName: "titleBottomMargin"): number; + + /** + * Sets the bottom margin of chart title + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "titleBottomMargin", optionValue: number): void; + + /** + * Gets the left margin of chart subtitle + */ + igFinancialChart(optionLiteral: 'option', optionName: "subtitleLeftMargin"): number; + + /** + * Sets the left margin of chart subtitle + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "subtitleLeftMargin", optionValue: number): void; + + /** + * Gets the top margin of chart subtitle + */ + igFinancialChart(optionLiteral: 'option', optionName: "subtitleTopMargin"): number; + + /** + * Sets the top margin of chart subtitle + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "subtitleTopMargin", optionValue: number): void; + + /** + * Gets the right margin of chart subtitle + */ + igFinancialChart(optionLiteral: 'option', optionName: "subtitleRightMargin"): number; + + /** + * Sets the right margin of chart subtitle + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "subtitleRightMargin", optionValue: number): void; + + /** + * Gets the bottom margin of chart subtitle + */ + igFinancialChart(optionLiteral: 'option', optionName: "subtitleBottomMargin"): number; + + /** + * Sets the bottom margin of chart subtitle + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "subtitleBottomMargin", optionValue: number): void; + + /** + * Gets color of chart subtitle + */ + igFinancialChart(optionLiteral: 'option', optionName: "subtitleTextColor"): string; + + /** + * Sets color of chart subtitle + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "subtitleTextColor", optionValue: string): void; + + /** + * Gets color of chart title + */ + igFinancialChart(optionLiteral: 'option', optionName: "titleTextColor"): string; + + /** + * Sets color of chart title + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "titleTextColor", optionValue: string): void; + + /** + * Gets the left margin of the chart content. + */ + igFinancialChart(optionLiteral: 'option', optionName: "leftMargin"): number; + + /** + * Sets the left margin of the chart content. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "leftMargin", optionValue: number): void; + + /** + * Gets the top margin of the chart content. + */ + igFinancialChart(optionLiteral: 'option', optionName: "topMargin"): number; + + /** + * Sets the top margin of the chart content. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "topMargin", optionValue: number): void; + + /** + * Gets the right margin of the chart content. + */ + igFinancialChart(optionLiteral: 'option', optionName: "rightMargin"): number; + + /** + * Sets the right margin of the chart content. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "rightMargin", optionValue: number): void; + + /** + * Gets the bottom margin around the chart content. + */ + igFinancialChart(optionLiteral: 'option', optionName: "bottomMargin"): number; + + /** + * Sets the bottom margin around the chart content. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "bottomMargin", optionValue: number): void; + + /** + * Gets the duration used for animating series plots when the data is changing + */ + igFinancialChart(optionLiteral: 'option', optionName: "transitionDuration"): number; + + /** + * Sets the duration used for animating series plots when the data is changing + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "transitionDuration", optionValue: number): void; + + /** + * Gets the easing function used for animating series plots when the data is changing. + * This can be set to one of the known values "linear" or "cubic," or it can be set to an easing function which takes a single numeric parameter and returns a number. + */ + igFinancialChart(optionLiteral: 'option', optionName: "transitionEasingFunction"): any; + + /** + * Sets the easing function used for animating series plots when the data is changing. + * This can be set to one of the known values "linear" or "cubic," or it can be set to an easing function which takes a single numeric parameter and returns a number. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "transitionEasingFunction", optionValue: any): void; + + /** + * Gets a function for creating wrapped tooltip + */ + igFinancialChart(optionLiteral: 'option', optionName: "createWrappedTooltip"): any; + + /** + * Sets a function for creating wrapped tooltip + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "createWrappedTooltip", optionValue: any): void; + + /** + * Gets the widget of this control + */ + igFinancialChart(optionLiteral: 'option', optionName: "widget"): any; + + /** + * Sets the widget of this control + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "widget", optionValue: any): void; + + /** + * Gets CSS font property for the chart subtitle + */ + igFinancialChart(optionLiteral: 'option', optionName: "subtitleTextStyle"): string; + + /** + * Sets CSS font property for the chart subtitle + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "subtitleTextStyle", optionValue: string): void; + + /** + * Gets CSS font property for the chart title + */ + igFinancialChart(optionLiteral: 'option', optionName: "titleTextStyle"): string; + + /** + * Sets CSS font property for the chart title + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "titleTextStyle", optionValue: string): void; + + /** + * Gets a collection of data items used to generate the chart. + * The ItemsSource of this chart can be a list of objects containing one or more numeric properties. + * Additionally, if the objects in the list implement the IEnumerable interface, + * the Chart will attempt to delve into the sub-collections when reading through the data source. + * Databinding can be further configured by attributing the data item classes + * with the DataSeriesMemberIntentAttribute. + */ + igFinancialChart(optionLiteral: 'option', optionName: "itemsSource"): any; + + /** + * Sets a collection of data items used to generate the chart. + * The ItemsSource of this chart can be a list of objects containing one or more numeric properties. + * Additionally, if the objects in the list implement the IEnumerable interface, + * the Chart will attempt to delve into the sub-collections when reading through the data source. + * Databinding can be further configured by attributing the data item classes + * with the DataSeriesMemberIntentAttribute. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "itemsSource", optionValue: any): void; + + /** + * Gets a set of property paths that should be included for consideration by the category chart, leaving the remainder excluded. If null, all properties will be considered. + */ + igFinancialChart(optionLiteral: 'option', optionName: "includedProperties"): any; + + /** + * Sets a set of property paths that should be included for consideration by the category chart, leaving the remainder excluded. If null, all properties will be considered. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "includedProperties", optionValue: any): void; + + /** + * Gets a set of property paths that should be excluded from consideration by the category chart. + */ + igFinancialChart(optionLiteral: 'option', optionName: "excludedProperties"): any; + + /** + * Sets a set of property paths that should be excluded from consideration by the category chart. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "excludedProperties", optionValue: any): void; + + /** + * Gets the palette of brushes to use for coloring the chart series. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igFinancialChart(optionLiteral: 'option', optionName: "brushes"): any; + + /** + * Sets the palette of brushes to use for coloring the chart series. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "brushes", optionValue: any): void; + + /** + * Gets the palette of brushes to use for outlines on the chart series. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igFinancialChart(optionLiteral: 'option', optionName: "outlines"): any; + + /** + * Sets the palette of brushes to use for outlines on the chart series. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "outlines", optionValue: any): void; + + /** + * Gets the legend to connect this chart to. + * When the legend property is set, the chart will use it to display information about its series. Legends can be shared by multiple chart controls. + */ + igFinancialChart(optionLiteral: 'option', optionName: "legend"): any; + + /** + * Sets the legend to connect this chart to. + * When the legend property is set, the chart will use it to display information about its series. Legends can be shared by multiple chart controls. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "legend", optionValue: any): void; + + /** + * Gets whether the chart can be horizontally zoomed through user interactions. + */ + igFinancialChart(optionLiteral: 'option', optionName: "isHorizontalZoomEnabled"): boolean; + + /** + * Sets whether the chart can be horizontally zoomed through user interactions. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "isHorizontalZoomEnabled", optionValue: boolean): void; + + /** + * Gets whether the chart can be vertically zoomed through user interactions. + */ + igFinancialChart(optionLiteral: 'option', optionName: "isVerticalZoomEnabled"): boolean; + + /** + * Sets whether the chart can be vertically zoomed through user interactions. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "isVerticalZoomEnabled", optionValue: boolean): void; + + /** + * Gets the rectangle representing the current scroll and zoom state of the chart. + * WindowRect is expressed as a Rectangle with coordinates and sizes between 0 and 1. + * The provided object should have numeric properties called left, top, width and height. + */ + igFinancialChart(optionLiteral: 'option', optionName: "windowRect"): any; + + /** + * Sets the rectangle representing the current scroll and zoom state of the chart. + * WindowRect is expressed as a Rectangle with coordinates and sizes between 0 and 1. + * The provided object should have numeric properties called left, top, width and height. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "windowRect", optionValue: any): void; + + /** + * Gets text to display above the plot area. + */ + igFinancialChart(optionLiteral: 'option', optionName: "title"): string; + + /** + * Sets text to display above the plot area. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "title", optionValue: string): void; + + /** + * Gets text to display below the Title, above the plot area. + */ + igFinancialChart(optionLiteral: 'option', optionName: "subtitle"): string; + + /** + * Sets text to display below the Title, above the plot area. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "subtitle", optionValue: string): void; + + /** + * Gets horizontal alignment which determines the title position, relative to the left and right edges of the control. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "titleAlignment"): string; + + /** + * Sets horizontal alignment which determines the title position, relative to the left and right edges of the control. + * + * @optionValue New value to be set. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "titleAlignment", optionValue: string): void; + + /** + * Gets horizontal alignment which determines the subtitle position, relative to the left and right edges of the control. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "subtitleAlignment"): string; + + /** + * Sets horizontal alignment which determines the subtitle position, relative to the left and right edges of the control. + * + * @optionValue New value to be set. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "subtitleAlignment", optionValue: string): void; + + /** + * Gets the behavior that determines how unknown values will be plotted on the chart.Null and Double.NaN are two examples of unknown values. + * + */ + + igFinancialChart(optionLiteral: 'option', optionName: "unknownValuePlotting"): string; + + /** + * Sets the behavior that determines how unknown values will be plotted on the chart.Null and Double.NaN are two examples of unknown values. + * + * + * @optionValue New value to be set. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "unknownValuePlotting", optionValue: string): void; + + /** + * Gets the rendering resolution for all series in this chart. + * Where n = Resolution, for every n horizontal pixels, combine all items into a single datapoint. When Resolution = 0, all datapoints will be rendered as graphical objects. Charts with a higher resolution will have faster performance. + */ + igFinancialChart(optionLiteral: 'option', optionName: "resolution"): number; + + /** + * Sets the rendering resolution for all series in this chart. + * Where n = Resolution, for every n horizontal pixels, combine all items into a single datapoint. When Resolution = 0, all datapoints will be rendered as graphical objects. Charts with a higher resolution will have faster performance. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "resolution", optionValue: number): void; + + /** + * Gets the thickness for all series in this chart. Depending on the ChartType, this can be the main brush used, or just the outline. + */ + igFinancialChart(optionLiteral: 'option', optionName: "thickness"): number; + + /** + * Sets the thickness for all series in this chart. Depending on the ChartType, this can be the main brush used, or just the outline. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "thickness", optionValue: number): void; + + /** + * Gets the marker shapes used for indicating location of data points in this chart. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + */ + igFinancialChart(optionLiteral: 'option', optionName: "markerTypes"): any; + + /** + * Sets the marker shapes used for indicating location of data points in this chart. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "markerTypes", optionValue: any): void; + + /** + * Gets the palette of brushes used for rendering fill area of data point markers. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igFinancialChart(optionLiteral: 'option', optionName: "markerBrushes"): any; + + /** + * Sets the palette of brushes used for rendering fill area of data point markers. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "markerBrushes", optionValue: any): void; + + /** + * Gets the palette of brushes used for rendering outlines of data point markers. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igFinancialChart(optionLiteral: 'option', optionName: "markerOutlines"): any; + + /** + * Sets the palette of brushes used for rendering outlines of data point markers. + * This property applies only to these chart types: point, line, spline, bubble, and polygon + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "markerOutlines", optionValue: any): void; + + /** + * Gets the maximum number of markers displyed in the plot area of the chart. + */ + igFinancialChart(optionLiteral: 'option', optionName: "markerMaxCount"): number; + + /** + * Sets the maximum number of markers displyed in the plot area of the chart. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "markerMaxCount", optionValue: number): void; + + /** + * Gets the palette of brushes to used for coloring trend lines in this chart. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igFinancialChart(optionLiteral: 'option', optionName: "trendLineBrushes"): any; + + /** + * Sets the palette of brushes to used for coloring trend lines in this chart. + * The value provided should be an array of CSS color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "trendLineBrushes", optionValue: any): void; + + /** + * Gets the formula used for calculating trend lines in this chart.This property applies only to these chart types: point, line, spline, and bubble + * + */ + + igFinancialChart(optionLiteral: 'option', optionName: "trendLineType"): string; + + /** + * Sets the formula used for calculating trend lines in this chart.This property applies only to these chart types: point, line, spline, and bubble + * + * + * @optionValue New value to be set. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "trendLineType", optionValue: string): void; + + /** + * Gets the thickness of the trend lines in this chart. + * This property applies only to these chart types: point, line, spline, and bubble + */ + igFinancialChart(optionLiteral: 'option', optionName: "trendLineThickness"): number; + + /** + * Sets the thickness of the trend lines in this chart. + * This property applies only to these chart types: point, line, spline, and bubble + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "trendLineThickness", optionValue: number): void; + + /** + * Gets a value indicating whether grid and tick lines are aligned to device pixels. + */ + igFinancialChart(optionLiteral: 'option', optionName: "alignsGridLinesToPixels"): boolean; + + /** + * Sets a value indicating whether grid and tick lines are aligned to device pixels. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "alignsGridLinesToPixels", optionValue: boolean): void; + igFinancialChart(optionLiteral: 'option', optionName: "trendLinePeriod"): number; + igFinancialChart(optionLiteral: 'option', optionName: "trendLinePeriod", optionValue: number): void; + + /** + * Gets function which takes an context object and returns a formatted label for the X-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisFormatLabel"): any; + + /** + * Sets function which takes an context object and returns a formatted label for the X-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisFormatLabel", optionValue: any): void; + + /** + * Gets function which takes a context object and returns a formatted label for the Y-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisFormatLabel"): any; + + /** + * Sets function which takes a context object and returns a formatted label for the Y-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisFormatLabel", optionValue: any): void; + + /** + * Gets the left margin of labels on the X-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabelLeftMargin"): number; + + /** + * Sets the left margin of labels on the X-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabelLeftMargin", optionValue: number): void; + + /** + * Gets the top margin of labels on the X-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabelTopMargin"): number; + + /** + * Sets the top margin of labels on the X-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabelTopMargin", optionValue: number): void; + + /** + * Gets the right margin of labels on the X-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabelRightMargin"): number; + + /** + * Sets the right margin of labels on the X-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabelRightMargin", optionValue: number): void; + + /** + * Gets the bottom margin of labels on the X-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabelBottomMargin"): number; + + /** + * Sets the bottom margin of labels on the X-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabelBottomMargin", optionValue: number): void; + + /** + * Gets the left margin of labels on the Y-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelLeftMargin"): number; + + /** + * Sets the left margin of labels on the Y-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelLeftMargin", optionValue: number): void; + + /** + * Gets the top margin of labels on the Y-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelTopMargin"): number; + + /** + * Sets the top margin of labels on the Y-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelTopMargin", optionValue: number): void; + + /** + * Gets the right margin of labels on the Y-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelRightMargin"): number; + + /** + * Sets the right margin of labels on the Y-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelRightMargin", optionValue: number): void; + + /** + * Gets the bottom margin of labels on the Y-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelBottomMargin"): number; + + /** + * Sets the bottom margin of labels on the Y-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelBottomMargin", optionValue: number): void; + + /** + * Gets color of labels on the X-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabelTextColor"): string; + + /** + * Sets color of labels on the X-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabelTextColor", optionValue: string): void; + + /** + * Gets color of labels on the Y-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelTextColor"): string; + + /** + * Sets color of labels on the Y-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelTextColor", optionValue: string): void; + + /** + * Gets the margin around a title on the X-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTitleMargin"): number; + + /** + * Sets the margin around a title on the X-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTitleMargin", optionValue: number): void; + + /** + * Gets the margin around a title on the Y-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTitleMargin"): number; + + /** + * Sets the margin around a title on the Y-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTitleMargin", optionValue: number): void; + + /** + * Gets the left margin of a title on the X-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTitleLeftMargin"): number; + + /** + * Sets the left margin of a title on the X-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTitleLeftMargin", optionValue: number): void; + + /** + * Gets the left margin of a title on the Y-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTitleLeftMargin"): number; + + /** + * Sets the left margin of a title on the Y-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTitleLeftMargin", optionValue: number): void; + + /** + * Gets the top margin of a title on the X-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTitleTopMargin"): number; + + /** + * Sets the top margin of a title on the X-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTitleTopMargin", optionValue: number): void; + + /** + * Gets the top margin of a title on the Y-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTitleTopMargin"): number; + + /** + * Sets the top margin of a title on the Y-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTitleTopMargin", optionValue: number): void; + + /** + * Gets the right margin of a title on the X-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTitleRightMargin"): number; + + /** + * Sets the right margin of a title on the X-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTitleRightMargin", optionValue: number): void; + + /** + * Gets the right margin of a title on the Y-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTitleRightMargin"): number; + + /** + * Sets the right margin of a title on the Y-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTitleRightMargin", optionValue: number): void; + + /** + * Gets the bottom margin of a title on the X-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTitleBottomMargin"): number; + + /** + * Sets the bottom margin of a title on the X-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTitleBottomMargin", optionValue: number): void; + + /** + * Gets the bottom margin of a title on the Y-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTitleBottomMargin"): number; + + /** + * Sets the bottom margin of a title on the Y-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTitleBottomMargin", optionValue: number): void; + + /** + * Gets color of title on the X-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTitleTextColor"): string; + + /** + * Sets color of title on the X-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTitleTextColor", optionValue: string): void; + + /** + * Gets color of title on the Y-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTitleTextColor"): string; + + /** + * Sets color of title on the Y-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTitleTextColor", optionValue: string): void; + + /** + * Gets CSS font property for labels on X-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabelTextStyle"): string; + + /** + * Sets CSS font property for labels on X-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabelTextStyle", optionValue: string): void; + + /** + * Gets CSS font property for labels on Y-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelTextStyle"): string; + + /** + * Sets CSS font property for labels on Y-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelTextStyle", optionValue: string): void; + + /** + * Gets CSS font property for title on X-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTitleTextStyle"): string; + + /** + * Sets CSS font property for title on X-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTitleTextStyle", optionValue: string): void; + + /** + * Gets CSS font property for title on Y-axis + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTitleTextStyle"): string; + + /** + * Sets CSS font property for title on Y-axis + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTitleTextStyle", optionValue: string): void; + + /** + * Gets the format for labels along the X-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabel"): any; + + /** + * Sets the format for labels along the X-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabel", optionValue: any): void; + + /** + * Gets the format for labels along the Y-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabel"): any; + + /** + * Sets the format for labels along the Y-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabel", optionValue: any): void; + + /** + * Gets the color to apply to major gridlines along the X-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisMajorStroke"): string; + + /** + * Sets the color to apply to major gridlines along the X-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisMajorStroke", optionValue: string): void; + + /** + * Gets the color to apply to major gridlines along the Y-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisMajorStroke"): string; + + /** + * Sets the color to apply to major gridlines along the Y-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisMajorStroke", optionValue: string): void; + + /** + * Gets the thickness to apply to major gridlines along the X-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisMajorStrokeThickness"): number; + + /** + * Sets the thickness to apply to major gridlines along the X-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisMajorStrokeThickness", optionValue: number): void; + + /** + * Gets the thickness to apply to major gridlines along the Y-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisMajorStrokeThickness"): number; + + /** + * Sets the thickness to apply to major gridlines along the Y-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisMajorStrokeThickness", optionValue: number): void; + + /** + * Gets the thickness to apply to minor gridlines along the X-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisMinorStrokeThickness"): number; + + /** + * Sets the thickness to apply to minor gridlines along the X-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisMinorStrokeThickness", optionValue: number): void; + + /** + * Gets the thickness to apply to minor gridlines along the Y-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisMinorStrokeThickness"): number; + + /** + * Sets the thickness to apply to minor gridlines along the Y-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisMinorStrokeThickness", optionValue: number): void; + + /** + * Gets the color to apply to stripes along the X-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisStrip"): string; + + /** + * Sets the color to apply to stripes along the X-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisStrip", optionValue: string): void; + + /** + * Gets the color to apply to stripes along the Y-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisStrip"): string; + + /** + * Sets the color to apply to stripes along the Y-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisStrip", optionValue: string): void; + + /** + * Gets the color to apply to the X-axis line. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisStroke"): string; + + /** + * Sets the color to apply to the X-axis line. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisStroke", optionValue: string): void; + + /** + * Gets the color to apply to the Y-axis line. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisStroke"): string; + + /** + * Sets the color to apply to the Y-axis line. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisStroke", optionValue: string): void; + + /** + * Gets the thickness to apply to the X-axis line. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisStrokeThickness"): number; + + /** + * Sets the thickness to apply to the X-axis line. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisStrokeThickness", optionValue: number): void; + + /** + * Gets the thickness to apply to the Y-axis line. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisStrokeThickness"): number; + + /** + * Sets the thickness to apply to the Y-axis line. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisStrokeThickness", optionValue: number): void; + + /** + * Gets the length of tickmarks along the X-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTickLength"): number; + + /** + * Sets the length of tickmarks along the X-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTickLength", optionValue: number): void; + + /** + * Gets the length of tickmarks along the Y-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTickLength"): number; + + /** + * Sets the length of tickmarks along the Y-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTickLength", optionValue: number): void; + + /** + * Gets the color to apply to tickmarks along the X-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTickStroke"): string; + + /** + * Sets the color to apply to tickmarks along the X-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTickStroke", optionValue: string): void; + + /** + * Gets the color to apply to tickmarks along the Y-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTickStroke"): string; + + /** + * Sets the color to apply to tickmarks along the Y-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTickStroke", optionValue: string): void; + + /** + * Gets the thickness to apply to tickmarks along the X-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTickStrokeThickness"): number; + + /** + * Sets the thickness to apply to tickmarks along the X-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTickStrokeThickness", optionValue: number): void; + + /** + * Gets the thickness to apply to tickmarks along the Y-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTickStrokeThickness"): number; + + /** + * Sets the thickness to apply to tickmarks along the Y-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTickStrokeThickness", optionValue: number): void; + + /** + * Gets the Text to display below the X-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTitle"): string; + + /** + * Sets the Text to display below the X-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTitle", optionValue: string): void; + + /** + * Gets the Text to display to the left of the Y-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTitle"): string; + + /** + * Sets the Text to display to the left of the Y-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTitle", optionValue: string): void; + + /** + * Gets the color to apply to minor gridlines along the X-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisMinorStroke"): string; + + /** + * Sets the color to apply to minor gridlines along the X-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisMinorStroke", optionValue: string): void; + + /** + * Gets the color to apply to minor gridlines along the Y-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisMinorStroke"): string; + + /** + * Sets the color to apply to minor gridlines along the Y-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisMinorStroke", optionValue: string): void; + + /** + * Gets the angle of rotation for labels along the X-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabelAngle"): number; + + /** + * Sets the angle of rotation for labels along the X-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabelAngle", optionValue: number): void; + + /** + * Gets the angle of rotation for labels along the Y-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelAngle"): number; + + /** + * Sets the angle of rotation for labels along the Y-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelAngle", optionValue: number): void; + + /** + * Gets the distance between the X-axis and the bottom of the chart. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisExtent"): number; + + /** + * Sets the distance between the X-axis and the bottom of the chart. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisExtent", optionValue: number): void; + + /** + * Gets the distance between the Y-axis and the left edge of the chart. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisExtent"): number; + + /** + * Sets the distance between the Y-axis and the left edge of the chart. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisExtent", optionValue: number): void; + + /** + * Gets the angle of rotation for the X-axis title. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTitleAngle"): number; + + /** + * Sets the angle of rotation for the X-axis title. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTitleAngle", optionValue: number): void; + + /** + * Gets the angle of rotation for the Y-axis title. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTitleAngle"): number; + + /** + * Sets the angle of rotation for the Y-axis title. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTitleAngle", optionValue: number): void; + + /** + * Gets whether to invert the direction of the X-axis by placing the first data items on the right side of the chart. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisInverted"): boolean; + + /** + * Sets whether to invert the direction of the X-axis by placing the first data items on the right side of the chart. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "xAxisInverted", optionValue: boolean): void; + + /** + * Gets whether to invert the direction of the Y-axis by placing the minimum numeric value at the top of the chart. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisInverted"): boolean; + + /** + * Sets whether to invert the direction of the Y-axis by placing the minimum numeric value at the top of the chart. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisInverted", optionValue: boolean): void; + + /** + * Gets Horizontal alignment of the X-axis title. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTitleAlignment"): string; + + /** + * Sets Horizontal alignment of the X-axis title. + * + * @optionValue New value to be set. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "xAxisTitleAlignment", optionValue: string): void; + + /** + * Gets Vertical alignment of the Y-axis title. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTitleAlignment"): string; + + /** + * Sets Vertical alignment of the Y-axis title. + * + * @optionValue New value to be set. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "yAxisTitleAlignment", optionValue: string): void; + + /** + * Gets Horizontal alignment of X-axis labels. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabelHorizontalAlignment"): string; + + /** + * Sets Horizontal alignment of X-axis labels. + * + * @optionValue New value to be set. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabelHorizontalAlignment", optionValue: string): void; + + /** + * Gets Horizontal alignment of Y-axis labels. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelHorizontalAlignment"): string; + + /** + * Sets Horizontal alignment of Y-axis labels. + * + * @optionValue New value to be set. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelHorizontalAlignment", optionValue: string): void; + + /** + * Gets Vertical alignment of X-axis labels. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabelVerticalAlignment"): string; + + /** + * Sets Vertical alignment of X-axis labels. + * + * @optionValue New value to be set. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabelVerticalAlignment", optionValue: string): void; + + /** + * Gets Vertical alignment of Y-axis labels. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelVerticalAlignment"): string; + + /** + * Sets Vertical alignment of Y-axis labels. + * + * @optionValue New value to be set. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelVerticalAlignment", optionValue: string): void; + + /** + * Gets Visibility of X-axis labels. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabelVisibility"): string; + + /** + * Sets Visibility of X-axis labels. + * + * @optionValue New value to be set. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "xAxisLabelVisibility", optionValue: string): void; + + /** + * Gets Visibility of Y-axis labels. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelVisibility"): string; + + /** + * Sets Visibility of Y-axis labels. + * + * @optionValue New value to be set. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelVisibility", optionValue: string): void; + + /** + * The location of Y-axis labels, relative to the plot area. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelLocation"): string; + + /** + * The location of Y-axis labels, relative to the plot area. + * + * @optionValue New value to be set. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLabelLocation", optionValue: string): void; + igFinancialChart(optionLiteral: 'option', optionName: "rangeSelectorTemplate"): any; + igFinancialChart(optionLiteral: 'option', optionName: "rangeSelectorTemplate", optionValue: any): void; + igFinancialChart(optionLiteral: 'option', optionName: "toolbarTemplate"): any; + igFinancialChart(optionLiteral: 'option', optionName: "toolbarTemplate", optionValue: any): void; + igFinancialChart(optionLiteral: 'option', optionName: "chartTypePickerTemplate"): any; + igFinancialChart(optionLiteral: 'option', optionName: "chartTypePickerTemplate", optionValue: any): void; + igFinancialChart(optionLiteral: 'option', optionName: "trendLineTypePickerTemplate"): any; + igFinancialChart(optionLiteral: 'option', optionName: "trendLineTypePickerTemplate", optionValue: any): void; + igFinancialChart(optionLiteral: 'option', optionName: "volumeTypePickerTemplate"): any; + igFinancialChart(optionLiteral: 'option', optionName: "volumeTypePickerTemplate", optionValue: any): void; + igFinancialChart(optionLiteral: 'option', optionName: "indicatorPickerTemplate"): any; + igFinancialChart(optionLiteral: 'option', optionName: "indicatorPickerTemplate", optionValue: any): void; + igFinancialChart(optionLiteral: 'option', optionName: "overlayPickerTemplate"): any; + igFinancialChart(optionLiteral: 'option', optionName: "overlayPickerTemplate", optionValue: any): void; + igFinancialChart(optionLiteral: 'option', optionName: "toolbarHeight"): number; + igFinancialChart(optionLiteral: 'option', optionName: "toolbarHeight", optionValue: number): void; + + /** + * Gets whether the Y-axis should use a logarithmic scale instead of a linear one. + * Since log(-1) is imaginary and log(0) is undefined, it is recommended to enable this property only when the Y-axis minimum is greater than zero. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisIsLogarithmic"): boolean; + + /** + * Sets whether the Y-axis should use a logarithmic scale instead of a linear one. + * Since log(-1) is imaginary and log(0) is undefined, it is recommended to enable this property only when the Y-axis minimum is greater than zero. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisIsLogarithmic", optionValue: boolean): void; + + /** + * Gets the base value to use in the log function when mapping the position of data items along the Y-axis. + * This property is effective only when YAxisIsLogarithmic is true. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLogarithmBase"): number; + + /** + * Sets the base value to use in the log function when mapping the position of data items along the Y-axis. + * This property is effective only when YAxisIsLogarithmic is true. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisLogarithmBase", optionValue: number): void; + + /** + * Gets the distance between each label and grid line along the Y-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisInterval"): number; + + /** + * Sets the distance between each label and grid line along the Y-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisInterval", optionValue: number): void; + + /** + * Gets the data value corresponding to the minimum value of the Y-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisMinimumValue"): number; + + /** + * Sets the data value corresponding to the minimum value of the Y-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisMinimumValue", optionValue: number): void; + + /** + * Gets the data value corresponding to the maximum value of the Y-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisMaximumValue"): number; + + /** + * Sets the data value corresponding to the maximum value of the Y-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisMaximumValue", optionValue: number): void; + + /** + * Gets the frequency of displayed minor lines along the Y-axis. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisMinorInterval"): number; + + /** + * Sets the frequency of displayed minor lines along the Y-axis. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisMinorInterval", optionValue: number): void; + + /** + * The type of series to display in the volume pane. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "volumeType"): string; + + /** + * The type of series to display in the volume pane. + * + * @optionValue New value to be set. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "volumeType", optionValue: string): void; + + /** + * The scaling mode of the X-axis. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "xAxisMode"): string; + + /** + * The scaling mode of the X-axis. + * + * @optionValue New value to be set. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "xAxisMode", optionValue: string): void; + + /** + * The scaling mode of the Y-axis. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "yAxisMode"): string; + + /** + * The scaling mode of the Y-axis. + * + * @optionValue New value to be set. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "yAxisMode", optionValue: string): void; + + /** + * A boolean property controlling the visibility of the toolbar. + */ + igFinancialChart(optionLiteral: 'option', optionName: "isToolbarVisible"): boolean; + + /** + * A boolean property controlling the visibility of the toolbar. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "isToolbarVisible", optionValue: boolean): void; + + /** + * The type of price series to display in the main chart. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "chartType"): string; + + /** + * The type of price series to display in the main chart. + * + * @optionValue New value to be set. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "chartType", optionValue: string): void; + + /** + * A boolean indicating whether the chart should automatically zoom in vertically on the currently visible range of data. + * When this property is set to true, panning and zooming along the X-axis will result in a corresponding zoom on the Y-axis, so that the visible range of data fills the zoom window as fully as possible. + */ + igFinancialChart(optionLiteral: 'option', optionName: "isWindowSyncedToVisibleRange"): boolean; + + /** + * A boolean indicating whether the chart should automatically zoom in vertically on the currently visible range of data. + * When this property is set to true, panning and zooming along the X-axis will result in a corresponding zoom on the Y-axis, so that the visible range of data fills the zoom window as fully as possible. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "isWindowSyncedToVisibleRange", optionValue: boolean): void; + + /** + * A collection indicating what financial indicator types to display on the Financial Chart. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorTypes"): any; + + /** + * A collection indicating what financial indicator types to display on the Financial Chart. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorTypes", optionValue: any): void; + + /** + * A collection indicating what financial overlay types to display on the Financial Chart. + */ + igFinancialChart(optionLiteral: 'option', optionName: "overlayTypes"): any; + + /** + * A collection indicating what financial overlay types to display on the Financial Chart. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "overlayTypes", optionValue: any): void; + + /** + * Gets whether the large numbers on the Y-axis labels are abbreviated. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisAbbreviateLargeNumbers"): boolean; + + /** + * Sets whether the large numbers on the Y-axis labels are abbreviated. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "yAxisAbbreviateLargeNumbers", optionValue: boolean): void; + + /** + * The type of series to display in the zoom slider pane. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "zoomSliderType"): string; + + /** + * The type of series to display in the zoom slider pane. + * + * @optionValue New value to be set. + */ + + igFinancialChart(optionLiteral: 'option', optionName: "zoomSliderType", optionValue: string): void; + + /** + * Gets the palette used for coloring negative items of Waterfall chart type. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igFinancialChart(optionLiteral: 'option', optionName: "negativeBrushes"): any; + + /** + * Sets the palette used for coloring negative items of Waterfall chart type. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "negativeBrushes", optionValue: any): void; + + /** + * Brushes to use for drawing negative elements, when using a chart type with contextual coloring, such as Waterfall. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igFinancialChart(optionLiteral: 'option', optionName: "negativeOutlines"): any; + + /** + * Brushes to use for drawing negative elements, when using a chart type with contextual coloring, such as Waterfall. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "negativeOutlines", optionValue: any): void; + + /** + * Brushes to use for filling financial overlays. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igFinancialChart(optionLiteral: 'option', optionName: "overlayBrushes"): any; + + /** + * Brushes to use for filling financial overlays. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "overlayBrushes", optionValue: any): void; + + /** + * Brushes to use for outlining financial overlays. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igFinancialChart(optionLiteral: 'option', optionName: "overlayOutlines"): any; + + /** + * Brushes to use for outlining financial overlays. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "overlayOutlines", optionValue: any): void; + + /** + * Brushes to use for outlining volume series in the volume pane. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igFinancialChart(optionLiteral: 'option', optionName: "volumeOutlines"): any; + + /** + * Brushes to use for outlining volume series in the volume pane. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "volumeOutlines", optionValue: any): void; + + /** + * Brushes to use for filling volume series in the volume pane. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igFinancialChart(optionLiteral: 'option', optionName: "volumeBrushes"): any; + + /** + * Brushes to use for filling volume series in the volume pane. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "volumeBrushes", optionValue: any): void; + + /** + * Brushes to use for negative elements in financial indicators. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorNegativeBrushes"): any; + + /** + * Brushes to use for negative elements in financial indicators. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorNegativeBrushes", optionValue: any): void; + + /** + * Brushes to use for financial indicators. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorBrushes"): any; + + /** + * Brushes to use for financial indicators. + * The value provided should be an array of css color strings or JavaScript objects defining gradients. Optionally the first element can be a string reading "RGB" or "HSV" to specify the interpolation mode of the collection. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorBrushes", optionValue: any): void; + + /** + * The outline thickness of volume series in the volume pane. + */ + igFinancialChart(optionLiteral: 'option', optionName: "volumeThickness"): number; + + /** + * The outline thickness of volume series in the volume pane. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "volumeThickness", optionValue: number): void; + + /** + * The outline thickness of financial overlays. + */ + igFinancialChart(optionLiteral: 'option', optionName: "overlayThickness"): number; + + /** + * The outline thickness of financial overlays. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "overlayThickness", optionValue: number): void; + + /** + * The outline or stroke thickness of financial indicators. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorThickness"): number; + + /** + * The outline or stroke thickness of financial indicators. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorThickness", optionValue: number): void; + + /** + * The display types of financial indicators. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorDisplayTypes"): any; + + /** + * The display types of financial indicators. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorDisplayTypes", optionValue: any): void; + + /** + * The period of financial indicators, where applicable. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorPeriod"): number; + + /** + * The period of financial indicators, where applicable. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorPeriod", optionValue: number): void; + + /** + * The multiplier of financial indicators, where applicable. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorMultiplier"): number; + + /** + * The multiplier of financial indicators, where applicable. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorMultiplier", optionValue: number): void; + + /** + * The smoothing period of financial indicators, where applicable. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorSmoothingPeriod"): number; + + /** + * The smoothing period of financial indicators, where applicable. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorSmoothingPeriod", optionValue: number): void; + + /** + * The short period of financial indicators, where applicable. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorShortPeriod"): number; + + /** + * The short period of financial indicators, where applicable. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorShortPeriod", optionValue: number): void; + + /** + * The long period of financial indicators, where applicable. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorLongPeriod"): number; + + /** + * The long period of financial indicators, where applicable. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorLongPeriod", optionValue: number): void; + + /** + * The signal period of financial indicators, where applicable. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorSignalPeriod"): number; + + /** + * The signal period of financial indicators, where applicable. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "indicatorSignalPeriod", optionValue: number): void; + + /** + * A FinancialChartRangeSelectorOptionCollection containing the available range selector options on the toolbar. + */ + igFinancialChart(optionLiteral: 'option', optionName: "rangeSelectorOptions"): any; + + /** + * A FinancialChartRangeSelectorOptionCollection containing the available range selector options on the toolbar. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "rangeSelectorOptions", optionValue: any): void; + + /** + * A FinancialChartRangeSelectorOptionCollection containing the available range selector options on the toolbar. + * This will be the intersection of the user-defined range selector options, if any, and the range selector options which are automatically determined based on the range of data. + */ + igFinancialChart(optionLiteral: 'option', optionName: "actualRangeSelectorOptions"): any; + + /** + * A FinancialChartRangeSelectorOptionCollection containing the available range selector options on the toolbar. + * This will be the intersection of the user-defined range selector options, if any, and the range selector options which are automatically determined based on the range of data. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "actualRangeSelectorOptions", optionValue: any): void; + + /** + * The names of custom indicators to add to the chart. + * When CustomIndicatorNames is set, the ApplyCustomIndicators event will be raised for each custom indicator name. + */ + igFinancialChart(optionLiteral: 'option', optionName: "customIndicatorNames"): any; + + /** + * The names of custom indicators to add to the chart. + * When CustomIndicatorNames is set, the ApplyCustomIndicators event will be raised for each custom indicator name. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "customIndicatorNames", optionValue: any): void; + + /** + * The width of the chart. + */ + igFinancialChart(optionLiteral: 'option', optionName: "width"): number; + + /** + * The width of the chart. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "width", optionValue: number): void; + + /** + * The height of the chart. + */ + igFinancialChart(optionLiteral: 'option', optionName: "height"): number; + + /** + * The height of the chart. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "height", optionValue: number): void; + + /** + * Gets maximum number of displayed records in chart. + */ + igFinancialChart(optionLiteral: 'option', optionName: "maxRecCount"): number; + + /** + * Sets maximum number of displayed records in chart. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "maxRecCount", optionValue: number): void; + + /** + * Gets a valid data source. + * That can be instance of array or primitives, array of objects, instance of $.ig.DataSource, or any other data accepted by $.ig.DataSource. + * Note: if it is set to string and "dataSourceType" option is not set, then $.ig.JSONPDataSource is used. + */ + igFinancialChart(optionLiteral: 'option', optionName: "dataSource"): any; + + /** + * Sets a valid data source. + * That can be instance of array or primitives, array of objects, instance of $.ig.DataSource, or any other data accepted by $.ig.DataSource. + * Note: if it is set to string and "dataSourceType" option is not set, then $.ig.JSONPDataSource is used. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "dataSource", optionValue: any): void; + + /** + * Gets data source type (such as "json", "xml", etc). Please refer to the documentation of $.ig.DataSource and its type property + */ + igFinancialChart(optionLiteral: 'option', optionName: "dataSourceType"): string; + + /** + * Sets data source type (such as "json", "xml", etc). Please refer to the documentation of $.ig.DataSource and its type property + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "dataSourceType", optionValue: string): void; + + /** + * Gets url which is used for sending JSON on request for remote data. + */ + igFinancialChart(optionLiteral: 'option', optionName: "dataSourceUrl"): string; + + /** + * Sets url which is used for sending JSON on request for remote data. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "dataSourceUrl", optionValue: string): void; + + /** + * See $.ig.DataSource. property in the response specifying the total number of records on the server. + */ + igFinancialChart(optionLiteral: 'option', optionName: "responseTotalRecCountKey"): string; + + /** + * See $.ig.DataSource. property in the response specifying the total number of records on the server. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "responseTotalRecCountKey", optionValue: string): void; + + /** + * See $.ig.DataSource. This is basically the property in the responses where data records are held, if the response is wrapped. + */ + igFinancialChart(optionLiteral: 'option', optionName: "responseDataKey"): string; + + /** + * See $.ig.DataSource. This is basically the property in the responses where data records are held, if the response is wrapped. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "responseDataKey", optionValue: string): void; + + /** + * Event raised when a property value is changed on this chart + */ + igFinancialChart(optionLiteral: 'option', optionName: "propertyChanged"): PropertyChangedEvent; + + /** + * Event raised when a property value is changed on this chart + * + * @optionValue Define event handler function. + */ + igFinancialChart(optionLiteral: 'option', optionName: "propertyChanged", optionValue: PropertyChangedEvent): void; + + /** + * Event raised when a series is initialized and added to this chart. + */ + igFinancialChart(optionLiteral: 'option', optionName: "seriesAdded"): SeriesAddedEvent; + + /** + * Event raised when a series is initialized and added to this chart. + * + * @optionValue Define event handler function. + */ + igFinancialChart(optionLiteral: 'option', optionName: "seriesAdded", optionValue: SeriesAddedEvent): void; + + /** + * Event raised when a series is removed from this chart. + */ + igFinancialChart(optionLiteral: 'option', optionName: "seriesRemoved"): SeriesRemovedEvent; + + /** + * Event raised when a series is removed from this chart. + * + * @optionValue Define event handler function. + */ + igFinancialChart(optionLiteral: 'option', optionName: "seriesRemoved", optionValue: SeriesRemovedEvent): void; + + /** + * Occurs when the pointer enters a Series. + */ + igFinancialChart(optionLiteral: 'option', optionName: "seriesPointerEnter"): SeriesPointerEnterEvent; + + /** + * Occurs when the pointer enters a Series. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "seriesPointerEnter", optionValue: SeriesPointerEnterEvent): void; + + /** + * Occurs when the pointer leaves a Series. + */ + igFinancialChart(optionLiteral: 'option', optionName: "seriesPointerLeave"): SeriesPointerLeaveEvent; + + /** + * Occurs when the pointer leaves a Series. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "seriesPointerLeave", optionValue: SeriesPointerLeaveEvent): void; + + /** + * Occurs when the pointer moves over a Series. + */ + igFinancialChart(optionLiteral: 'option', optionName: "seriesPointerMove"): SeriesPointerMoveEvent; + + /** + * Occurs when the pointer moves over a Series. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "seriesPointerMove", optionValue: SeriesPointerMoveEvent): void; + + /** + * Occurs when the pointer is pressed down over a Series. + */ + igFinancialChart(optionLiteral: 'option', optionName: "seriesPointerDown"): SeriesPointerDownEvent; + + /** + * Occurs when the pointer is pressed down over a Series. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "seriesPointerDown", optionValue: SeriesPointerDownEvent): void; + + /** + * Occurs when the pointer is released over a Series. + */ + igFinancialChart(optionLiteral: 'option', optionName: "seriesPointerUp"): SeriesPointerUpEvent; + + /** + * Occurs when the pointer is released over a Series. + * + * @optionValue New value to be set. + */ + igFinancialChart(optionLiteral: 'option', optionName: "seriesPointerUp", optionValue: SeriesPointerUpEvent): void; + + /** + * Event raised by the chart when custom indicator data is needed from the application. + * During series rendering, event will be raised once for each value in the CustomIndicatorNames collection. + */ + igFinancialChart(optionLiteral: 'option', optionName: "applyCustomIndicators"): ApplyCustomIndicatorsEvent; + + /** + * Event raised by the chart when custom indicator data is needed from the application. + * During series rendering, event will be raised once for each value in the CustomIndicatorNames collection. + * + * @optionValue Define event handler function. + */ + igFinancialChart(optionLiteral: 'option', optionName: "applyCustomIndicators", optionValue: ApplyCustomIndicatorsEvent): void; + + /** + * Event which is raised before data binding. + * Return false in order to cancel data binding. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.dataSource to obtain reference to instance of $.ig.DataSource. + */ + igFinancialChart(optionLiteral: 'option', optionName: "dataBinding"): DataBindingEvent; + + /** + * Event which is raised before data binding. + * Return false in order to cancel data binding. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.dataSource to obtain reference to instance of $.ig.DataSource. + * + * @optionValue Define event handler function. + */ + igFinancialChart(optionLiteral: 'option', optionName: "dataBinding", optionValue: DataBindingEvent): void; + + /** + * Event which is raised after data binding. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.data to obtain reference to array actual data which is displayed by chart. + * Use ui.dataSource to obtain reference to instance of $.ig.DataSource. + */ + igFinancialChart(optionLiteral: 'option', optionName: "dataBound"): DataBoundEvent; + + /** + * Event which is raised after data binding. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.data to obtain reference to array actual data which is displayed by chart. + * Use ui.dataSource to obtain reference to instance of $.ig.DataSource. + * + * @optionValue Define event handler function. + */ + igFinancialChart(optionLiteral: 'option', optionName: "dataBound", optionValue: DataBoundEvent): void; + + /** + * Event which is raised before tooltip is updated. + * Return false in order to cancel updating and hide tooltip. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.text to obtain html of tooltip. Value of that member can be modified. If modified value is null or empty string, then current content of tooltip keeps old value. + * Use ui.item to obtain reference to item. Value of that member can be modified or replaced by custom item. + * Use ui.x to obtain left position of tooltip in pixels relative to widget. Value of that member can be modified. + * Use ui.y to obtain top position of tooltip in pixels relative to widget. Value of that member can be modified. + * Use ui.element to obtain reference to jquery object which represents tooltip. Value of that member can be replaced by custom element. + */ + igFinancialChart(optionLiteral: 'option', optionName: "updateTooltip"): UpdateTooltipEvent; + + /** + * Event which is raised before tooltip is updated. + * Return false in order to cancel updating and hide tooltip. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.text to obtain html of tooltip. Value of that member can be modified. If modified value is null or empty string, then current content of tooltip keeps old value. + * Use ui.item to obtain reference to item. Value of that member can be modified or replaced by custom item. + * Use ui.x to obtain left position of tooltip in pixels relative to widget. Value of that member can be modified. + * Use ui.y to obtain top position of tooltip in pixels relative to widget. Value of that member can be modified. + * Use ui.element to obtain reference to jquery object which represents tooltip. Value of that member can be replaced by custom element. + * + * @optionValue Define event handler function. + */ + igFinancialChart(optionLiteral: 'option', optionName: "updateTooltip", optionValue: UpdateTooltipEvent): void; + + /** + * Event which is raised before tooltip is hidden. + * Return false in order to cancel hiding and keep tooltip visible. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.item to obtain reference to item. + * Use ui.element to obtain reference to jquery object which represents tooltip or value of ui.element from last updateTooltip event. Value of that member can be replaced by custom element. + */ + igFinancialChart(optionLiteral: 'option', optionName: "hideTooltip"): HideTooltipEvent; + + /** + * Event which is raised before tooltip is hidden. + * Return false in order to cancel hiding and keep tooltip visible. + * Function takes first argument null and second argument ui. + * Use ui.owner to obtain reference to chart widget. + * Use ui.item to obtain reference to item. + * Use ui.element to obtain reference to jquery object which represents tooltip or value of ui.element from last updateTooltip event. Value of that member can be replaced by custom element. + * + * @optionValue Define event handler function. + */ + igFinancialChart(optionLiteral: 'option', optionName: "hideTooltip", optionValue: HideTooltipEvent): void; + igFinancialChart(options: IgFinancialChart): JQuery; + igFinancialChart(optionLiteral: 'option', optionName: string): any; + igFinancialChart(optionLiteral: 'option', options: IgFinancialChart): JQuery; + igFinancialChart(optionLiteral: 'option', optionName: string, optionValue: any): JQuery; + igFinancialChart(methodName: string, ...methodParams: any[]): any; +} interface SliceClickedEvent { (event: Event, ui: SliceClickedEventUIParam): void; } @@ -37104,6 +42931,7 @@ interface JQuery { interface IgGridAppendRowsOnDemandLocale { /** * Specifies caption text for the "load more data" button. + * */ loadMoreDataButtonText?: string; @@ -37164,6 +42992,7 @@ interface IgGridAppendRowsOnDemand { /** * Defines local or remote type of appending rows on demand in igGrid * + * * Valid values: * "remote" request data from the remote endpoint * "local" loading data on the client-side @@ -37172,37 +43001,44 @@ interface IgGridAppendRowsOnDemand { /** * Default number of records per chunk + * */ chunkSize?: number; /** * The property in the response that will hold the total number of records in the data source + * */ recordCountKey?: string; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested chunk size + * */ chunkSizeUrlKey?: string; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested chunk index + * */ chunkIndexUrlKey?: string; /** * Initial chunk index position + * */ defaultChunkIndex?: number; /** * Current chunk index position + * */ currentChunkIndex?: number; /** * denotes the append rows on demand request method * + * * Valid values: * "auto" new record will be appended to the grid while the user scrolls the scrollbar * "button" a button will be rendered at the bottom of the grid. The user should press it to load more rows @@ -37253,6 +43089,7 @@ interface JQuery { /** * Defines local or remote type of appending rows on demand in igGrid + * */ igGridAppendRowsOnDemand(optionLiteral: 'option', optionName: "type"): string; @@ -37260,6 +43097,7 @@ interface JQuery { /** * Defines local or remote type of appending rows on demand in igGrid * + * * @optionValue New value to be set. */ @@ -37267,78 +43105,91 @@ interface JQuery { /** * Default number of records per chunk + * */ igGridAppendRowsOnDemand(optionLiteral: 'option', optionName: "chunkSize"): number; /** * Default number of records per chunk * + * * @optionValue New value to be set. */ igGridAppendRowsOnDemand(optionLiteral: 'option', optionName: "chunkSize", optionValue: number): void; /** * The property in the response that will hold the total number of records in the data source + * */ igGridAppendRowsOnDemand(optionLiteral: 'option', optionName: "recordCountKey"): string; /** * The property in the response that will hold the total number of records in the data source * + * * @optionValue New value to be set. */ igGridAppendRowsOnDemand(optionLiteral: 'option', optionName: "recordCountKey", optionValue: string): void; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested chunk size + * */ igGridAppendRowsOnDemand(optionLiteral: 'option', optionName: "chunkSizeUrlKey"): string; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested chunk size * + * * @optionValue New value to be set. */ igGridAppendRowsOnDemand(optionLiteral: 'option', optionName: "chunkSizeUrlKey", optionValue: string): void; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested chunk index + * */ igGridAppendRowsOnDemand(optionLiteral: 'option', optionName: "chunkIndexUrlKey"): string; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested chunk index * + * * @optionValue New value to be set. */ igGridAppendRowsOnDemand(optionLiteral: 'option', optionName: "chunkIndexUrlKey", optionValue: string): void; /** * Initial chunk index position + * */ igGridAppendRowsOnDemand(optionLiteral: 'option', optionName: "defaultChunkIndex"): number; /** * Initial chunk index position * + * * @optionValue New value to be set. */ igGridAppendRowsOnDemand(optionLiteral: 'option', optionName: "defaultChunkIndex", optionValue: number): void; /** * Current chunk index position + * */ igGridAppendRowsOnDemand(optionLiteral: 'option', optionName: "currentChunkIndex"): number; /** * Current chunk index position * + * * @optionValue New value to be set. */ igGridAppendRowsOnDemand(optionLiteral: 'option', optionName: "currentChunkIndex", optionValue: number): void; /** * Denotes the append rows on demand request method + * */ igGridAppendRowsOnDemand(optionLiteral: 'option', optionName: "loadTrigger"): string; @@ -37346,6 +43197,7 @@ interface JQuery { /** * Denotes the append rows on demand request method * + * * @optionValue New value to be set. */ @@ -37401,17 +43253,20 @@ interface JQuery { interface IgGridCellMergingColumnSetting { /** * Column index. This is a required property in every column setting if columnKey is not set. + * */ columnIndex?: number; /** * Column key. This is a required property in every column setting if columnIndex is not set. + * */ columnKey?: string; /** * Defines when merging should be applied. * + * * Valid values: * "sorting" The column will only be merged when sorted * "always" The column will always be merged @@ -37422,6 +43277,7 @@ interface IgGridCellMergingColumnSetting { /** * Defines the rules merging is based on. * + * * Valid values: * "duplicate" Duplicate values in the column will be merged together. * "null" Merging will be applied for each subsequent null value after a non-null value. @@ -37525,6 +43381,7 @@ interface IgGridCellMerging { /** * Defines the type of merging. * + * * Valid values: * "visual" the grid cells will be merged only visually * "physical" the grid cell will be merged physically throughout rowspan @@ -37534,6 +43391,7 @@ interface IgGridCellMerging { /** * Defines when merging should be applied. * + * * Valid values: * "sorting" Only sorted columns will have merging applied * "always" Merging will be applied to all columns always @@ -37544,6 +43402,7 @@ interface IgGridCellMerging { /** * Defines the rules merging is based on. * + * * Valid values: * "duplicate" Duplicate values in the column will be merged together. * "null" Merging will be applied for each subsequent null value after a non-null value. @@ -37552,6 +43411,7 @@ interface IgGridCellMerging { /** * A list of column settings that specifies hiding options on a per column basis. + * */ columnSettings?: IgGridCellMergingColumnSetting[]; @@ -37560,6 +43420,24 @@ interface IgGridCellMerging { */ inherit?: boolean; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event fired before a new merged cells group is created. */ @@ -37572,6 +43450,9 @@ interface IgGridCellMerging { [optionName: string]: any; } interface IgGridCellMergingMethods { + changeGlobalLanguage(): void; + changeGlobalRegional(): void; + /** * Removes all igGridCellMerging UI changes and destroys the widget */ @@ -37598,19 +43479,31 @@ interface IgGridCellMergingMethods { * @param column The column index or column key to get the state for. */ isMerged(column: Object): boolean; + + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ + changeLocale($container: Object): void; } interface JQuery { data(propertyName: "igGridCellMerging"): IgGridCellMergingMethods; } interface JQuery { + igGridCellMerging(methodName: "changeGlobalLanguage"): void; + igGridCellMerging(methodName: "changeGlobalRegional"): void; igGridCellMerging(methodName: "destroy"): void; igGridCellMerging(methodName: "mergeColumn", column: Object, raiseEvents: boolean): string; igGridCellMerging(methodName: "unmergeColumn", column: Object): string; igGridCellMerging(methodName: "isMerged", column: Object): boolean; + igGridCellMerging(methodName: "changeLocale", $container: Object): void; /** * Defines the type of merging. + * */ igGridCellMerging(optionLiteral: 'option', optionName: "mergeType"): string; @@ -37618,6 +43511,7 @@ interface JQuery { /** * Defines the type of merging. * + * * @optionValue New value to be set. */ @@ -37625,6 +43519,7 @@ interface JQuery { /** * Defines when merging should be applied. + * */ igGridCellMerging(optionLiteral: 'option', optionName: "mergeOn"): string; @@ -37632,6 +43527,7 @@ interface JQuery { /** * Defines when merging should be applied. * + * * @optionValue New value to be set. */ @@ -37639,6 +43535,7 @@ interface JQuery { /** * Defines the rules merging is based on. + * */ igGridCellMerging(optionLiteral: 'option', optionName: "mergeStrategy"): string|Function; @@ -37646,6 +43543,7 @@ interface JQuery { /** * Defines the rules merging is based on. * + * * @optionValue New value to be set. */ @@ -37653,12 +43551,14 @@ interface JQuery { /** * A list of column settings that specifies hiding options on a per column basis. + * */ igGridCellMerging(optionLiteral: 'option', optionName: "columnSettings"): IgGridCellMergingColumnSetting[]; /** * A list of column settings that specifies hiding options on a per column basis. * + * * @optionValue New value to be set. */ igGridCellMerging(optionLiteral: 'option', optionName: "columnSettings", optionValue: IgGridCellMergingColumnSetting[]): void; @@ -37675,6 +43575,50 @@ interface JQuery { */ igGridCellMerging(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igGridCellMerging(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igGridCellMerging(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igGridCellMerging(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igGridCellMerging(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igGridCellMerging(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igGridCellMerging(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event fired before a new merged cells group is created. */ @@ -37697,53 +43641,25 @@ interface JQuery { interface IgGridColumnFixingLocale { /** * Specifies the tooltip text on the column fixing header icon when column is not fixed. - * ``` - * //Initialize - * $(".selector").%%ParentWidgetName%%({ - * features: [ - * { - * name : "ColumnFixing", - * locale: { headerFixButtonText : "Click to fix this column"} - * } - * ] - * }); * - * //Get - * var headerFixButtonText = $(".selector").%%WidgetName%%("option", "locale").headerFixButtonText; - * - * //Set - * $(".selector").%%WidgetName%%("option", "locale", { headerFixButtonText : "Click to fix this column"}); */ headerFixButtonText?: string; /** * Specifies the tooltip text on the column fixing header icon when column is not fixed. - * ``` - * //Initialize - * $(".selector").%%ParentWidgetName%%({ - * features: [ - * { - * name : "ColumnFixing", - * locale: { headerUnfixButtonText : "Click to unfix this column"} - * } - * ] - * }); * - * //Get - * var headerUnfixButtonText = $(".selector").%%WidgetName%%("option", "locale").headerUnfixButtonText; - * - * //Set - * $(".selector").%%WidgetName%%("option", "locale", { headerUnfixButtonText : "Click to unfix this column"}); */ headerUnfixButtonText?: string; /** * Text of the feature chooser button for fixing a currently unfixed column. + * */ featureChooserTextFixedColumn?: string; /** * Text of the feature chooser button for unfixing a currently fixed column. + * */ featureChooserTextUnfixedColumn?: string; @@ -37756,21 +43672,25 @@ interface IgGridColumnFixingLocale { interface IgGridColumnFixingColumnSetting { /** * Identifies the grid column by key. Either key or index must be set in every column setting. + * */ columnKey?: string; /** * Identifies the grid column by index. Either key or index must be set in every column setting. + * */ columnIndex?: number; /** * Specifies whether the column can be fixed or not. If allow fixing is false, then the fixing pin will not be rendered for the column. + * */ allowFixing?: boolean; /** * Specifies whether the column is initially fixed or not. Check [this topic](http://www.igniteui.com/help/iggrid-columnfixing-configuring#initial-state) out for more information. + * */ isFixed?: boolean; @@ -37944,22 +43864,26 @@ interface IgGridColumnFixing { /** * Specifies whether to show the column fixing buttons in header cells/feature chooser. + * */ showFixButtons?: boolean; /** * Enable row height sync for the fixed and unfixed portion of the grid. If you're observing row misalignment, please refer to [this article](http://www.igniteui.com/help/iggrid-known-issues#misalignment-ie9). + * */ syncRowHeights?: boolean; /** * Scroll delta in pixels when scrolling with the mouse wheel or the keyboard in the fixed columns area of the grid. + * */ scrollDelta?: number; /** * Configures which side the fixed columns of the grid will be rendered on. Check [this topic](http://www.igniteui.com/help/iggrid-columnfixing-configuring#direction) out of more information. * + * * Valid values: * "left" Fixed columns are rendered on the left side of the main grid. * "right" Fixed columns are rendered on the right side of the main grid. @@ -37968,12 +43892,14 @@ interface IgGridColumnFixing { /** * List of column settings that specifies custom column fixing options on a per column basis. + * */ columnSettings?: IgGridColumnFixingColumnSetting[]; /** * Minimal visible area in pixels for the unfixed columns. If the end user tries to fix a column(or columns), which causes the width of the fixed columns to grow such that the width of visible area of unfixed columns is less than this option then fixing will be canceled. Check [this topic](http://www.igniteui.com/help/iggrid-columnfixing-configuring#non-fixable-min-width) out for more information. * + * * Valid values: * "string" The width can be set in pixels (px) and percentage (%). * "number" The width can be set in pixels as a number. @@ -37982,6 +43908,7 @@ interface IgGridColumnFixing { /** * Specify initial fixing of all non data columns. Non-data columns are columns in the grid rendered for specific features, like the row selectors feature. The column containing the row numbering is such a column. This option is applicable when [fixingDirection](ui.iggridcolumnfixing#options:fixingDirection) is set to left. For a full column fixing configuration summary please refer to [this topic](http://www.igniteui.com/help/iggrid-columnfixing-configuring#configuration-summary). + * */ fixNondataColumns?: boolean; @@ -37990,6 +43917,18 @@ interface IgGridColumnFixing { */ populateDataRowsAttributes?: boolean; + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event which is fired when column fixing operation is initiated. */ @@ -38026,6 +43965,9 @@ interface IgGridColumnFixing { [optionName: string]: any; } interface IgGridColumnFixingMethods { + changeGlobalLanguage(): void; + changeGlobalRegional(): void; + /** * Unfixes a column by specified column identifier - column key or column index. * @@ -38047,6 +43989,11 @@ interface IgGridColumnFixingMethods { * @param clearRowsHeights Clears row heigths for all visible rows. */ syncHeights(check?: boolean, clearRowsHeights?: boolean): void; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.iggridcolumnfixing#options:language) + * Note that this method is for rare scenarios, see [language](ui.iggridcolumnfixing#options:language) or [locale](ui.iggridcolumnfixing#options:locale) option setter + */ changeLocale(): void; /** @@ -38131,6 +44078,8 @@ interface JQuery { } interface JQuery { + igGridColumnFixing(methodName: "changeGlobalLanguage"): void; + igGridColumnFixing(methodName: "changeGlobalRegional"): void; igGridColumnFixing(methodName: "unfixColumn", colIdentifier: Object, target?: string, after?: boolean): Object; igGridColumnFixing(methodName: "checkAndSyncHeights"): void; igGridColumnFixing(methodName: "syncHeights", check?: boolean, clearRowsHeights?: boolean): void; @@ -38208,42 +44157,49 @@ interface JQuery { /** * Gets whether to show the column fixing buttons in header cells/feature chooser. + * */ igGridColumnFixing(optionLiteral: 'option', optionName: "showFixButtons"): boolean; /** * Sets whether to show the column fixing buttons in header cells/feature chooser. * + * * @optionValue New value to be set. */ igGridColumnFixing(optionLiteral: 'option', optionName: "showFixButtons", optionValue: boolean): void; /** * Enable row height sync for the fixed and unfixed portion of the grid. If you're observing row misalignment, please refer to [this article](http://www.igniteui.com/help/iggrid-known-issues#misalignment-ie9). + * */ igGridColumnFixing(optionLiteral: 'option', optionName: "syncRowHeights"): boolean; /** * Enable row height sync for the fixed and unfixed portion of the grid. If you're observing row misalignment, please refer to [this article](http://www.igniteui.com/help/iggrid-known-issues#misalignment-ie9). * + * * @optionValue New value to be set. */ igGridColumnFixing(optionLiteral: 'option', optionName: "syncRowHeights", optionValue: boolean): void; /** * Scroll delta in pixels when scrolling with the mouse wheel or the keyboard in the fixed columns area of the grid. + * */ igGridColumnFixing(optionLiteral: 'option', optionName: "scrollDelta"): number; /** * Scroll delta in pixels when scrolling with the mouse wheel or the keyboard in the fixed columns area of the grid. * + * * @optionValue New value to be set. */ igGridColumnFixing(optionLiteral: 'option', optionName: "scrollDelta", optionValue: number): void; /** * Configures which side the fixed columns of the grid will be rendered on. Check [this topic](http://www.igniteui.com/help/iggrid-columnfixing-configuring#direction) out of more information. + * */ igGridColumnFixing(optionLiteral: 'option', optionName: "fixingDirection"): string; @@ -38251,6 +44207,7 @@ interface JQuery { /** * Configures which side the fixed columns of the grid will be rendered on. Check [this topic](http://www.igniteui.com/help/iggrid-columnfixing-configuring#direction) out of more information. * + * * @optionValue New value to be set. */ @@ -38258,18 +44215,21 @@ interface JQuery { /** * List of column settings that specifies custom column fixing options on a per column basis. + * */ igGridColumnFixing(optionLiteral: 'option', optionName: "columnSettings"): IgGridColumnFixingColumnSetting[]; /** * List of column settings that specifies custom column fixing options on a per column basis. * + * * @optionValue New value to be set. */ igGridColumnFixing(optionLiteral: 'option', optionName: "columnSettings", optionValue: IgGridColumnFixingColumnSetting[]): void; /** * Minimal visible area in pixels for the unfixed columns. If the end user tries to fix a column(or columns), which causes the width of the fixed columns to grow such that the width of visible area of unfixed columns is less than this option then fixing will be canceled. Check [this topic](http://www.igniteui.com/help/iggrid-columnfixing-configuring#non-fixable-min-width) out for more information. + * */ igGridColumnFixing(optionLiteral: 'option', optionName: "minimalVisibleAreaWidth"): string|number; @@ -38277,6 +44237,7 @@ interface JQuery { /** * Minimal visible area in pixels for the unfixed columns. If the end user tries to fix a column(or columns), which causes the width of the fixed columns to grow such that the width of visible area of unfixed columns is less than this option then fixing will be canceled. Check [this topic](http://www.igniteui.com/help/iggrid-columnfixing-configuring#non-fixable-min-width) out for more information. * + * * @optionValue New value to be set. */ @@ -38284,12 +44245,14 @@ interface JQuery { /** * Specify initial fixing of all non data columns. Non-data columns are columns in the grid rendered for specific features, like the row selectors feature. The column containing the row numbering is such a column. This option is applicable when [fixingDirection](ui.iggridcolumnfixing#options:fixingDirection) is set to left. For a full column fixing configuration summary please refer to [this topic](http://www.igniteui.com/help/iggrid-columnfixing-configuring#configuration-summary). + * */ igGridColumnFixing(optionLiteral: 'option', optionName: "fixNondataColumns"): boolean; /** * Specify initial fixing of all non data columns. Non-data columns are columns in the grid rendered for specific features, like the row selectors feature. The column containing the row numbering is such a column. This option is applicable when [fixingDirection](ui.iggridcolumnfixing#options:fixingDirection) is set to left. For a full column fixing configuration summary please refer to [this topic](http://www.igniteui.com/help/iggrid-columnfixing-configuring#configuration-summary). * + * * @optionValue New value to be set. */ igGridColumnFixing(optionLiteral: 'option', optionName: "fixNondataColumns", optionValue: boolean): void; @@ -38306,6 +44269,36 @@ interface JQuery { */ igGridColumnFixing(optionLiteral: 'option', optionName: "populateDataRowsAttributes", optionValue: boolean): void; + /** + * Set/Get the locale language setting for the widget. + * + */ + igGridColumnFixing(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igGridColumnFixing(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igGridColumnFixing(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igGridColumnFixing(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event which is fired when column fixing operation is initiated. */ @@ -38386,16 +44379,19 @@ interface JQuery { interface IgGridColumnMovingColumnSetting { /** * Column key. This is a required property in every column setting if columnIndex is not set. + * */ columnKey?: string; /** * Column index. Can be used in place of column key. The preferred way of populating a column setting is to always use the column keys as identifiers. + * */ columnIndex?: number; /** * Allows the column to be moved. + * */ allowMoving?: boolean; @@ -38408,71 +44404,85 @@ interface IgGridColumnMovingColumnSetting { interface IgGridColumnMovingLocale { /** * Specifies the apply button text. + * */ movingDialogButtonApplyText?: string; /** * Specifies the cancel button text. + * */ movingDialogButtonCancelText?: string; /** * Specifies caption for each move down button in the column moving dialog. + * */ movingDialogCaptionButtonDesc?: string; /** * Specifies caption for each move up button in the column moving dialog. + * */ movingDialogCaptionButtonAsc?: string; /** * Specifies caption text for the column moving dialog. + * */ movingDialogCaptionText?: string; /** * Specifies caption text for the feature chooser entry. + * */ movingDialogDisplayText?: string; /** * Specifies text for drop tooltip in column moving dialog. + * */ movingDialogDropTooltipText?: string; /** * Specifies title for close dialog button. + * */ movingDialogCloseButtonTitle?: string; /** * Specifies caption for the move left dropdown button. + * */ dropDownMoveLeftText?: string; /** * Specifies caption for the move right dropdown button. + * */ dropDownMoveRightText?: string; /** * Specifies caption for the move first dropdown button. + * */ dropDownMoveFirstText?: string; /** * Specifies caption for the move last dropdown button. + * */ dropDownMoveLastText?: string; /** * Specifies tooltip text for the move indicator. + * */ movingToolTipMove?: string; /** * Specifies caption text for the feature chooser submenu button. + * */ featureChooserSubmenuText?: string; @@ -38751,12 +44761,14 @@ interface MovingDialogDragColumnMovedEventUIParam { interface IgGridColumnMoving { /** * A list of column settings that specifies moving options on a per column basis. + * */ columnSettings?: IgGridColumnMovingColumnSetting[]; /** * Specify the drag-and-drop mode for the feature * + * * Valid values: * "immediate" Column headers will rearange as you drag with a space opening under the cursor for the header to be dropped on * "deferred" A clone of the header dragged will be created and indicators will be shown between columns to help navigate the drop. @@ -38766,6 +44778,7 @@ interface IgGridColumnMoving { /** * Specify the way columns will be rearranged * + * * Valid values: * "dom" Columns will be rearranged through dom manipulation * "render" Columns will not be rearranged but the grid will be rendered again with the new column order. Please note this option is incompatible with immediate move mode. @@ -38774,47 +44787,56 @@ interface IgGridColumnMoving { /** * Specifies if header cells should include an additional button that opens a moving helper dropdown. + * */ addMovingDropdown?: boolean; /** * Specifies width of column moving dialog + * */ movingDialogWidth?: number; /** * Specifies height of column moving dialog + * */ movingDialogHeight?: number; /** * Specifies time in milliseconds for animation duration to show/hide modal dialog + * */ movingDialogAnimationDuration?: number; /** * Specifies the length (in pixels) between the dragged column and the column edges below which the move operation is accepted + * */ movingAcceptanceTolerance?: number; /** * Specifies the length (in pixels) between the dragged column and the grid edges below which horizontal scrolling occurs + * */ movingScrollTolerance?: number; /** * Specifies a multiplier for the delay between subsequent scroll operations. The larger this number is, the slower scrolling will appear to be. + * */ scrollSpeedMultiplier?: number; /** * Specifies the length (in pixels) of each individual scroll operation + * */ scrollDelta?: number; /** * Specifies whether the contents of the column being dragged will get hidden. The option is only * relevant in immediate moving mode. + * */ hideHeaderContentsDuringDrag?: boolean; @@ -38822,6 +44844,7 @@ interface IgGridColumnMoving { * Specifies the opacity of the drag markup, while a column header is being dragged. * The value must be between 0 and 1. When GroupBy is enabled, the corresponding option in the GroupBy configuration * will be used with priority over this one. + * */ dragHelperOpacity?: number; @@ -38894,6 +44917,7 @@ interface IgGridColumnMoving { /** * Specifies markup for drop tooltip in column moving dialog + * */ movingDialogDropTooltipMarkup?: string; @@ -38907,6 +44931,7 @@ interface IgGridColumnMoving { /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. + * */ dialogWidget?: string; @@ -38915,6 +44940,18 @@ interface IgGridColumnMoving { */ inherit?: boolean; + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event which is fired when a drag operation begins on a column header */ @@ -39001,6 +45038,13 @@ interface IgGridColumnMoving { [optionName: string]: any; } interface IgGridColumnMovingMethods { + changeGlobalLanguage(): void; + changeGlobalRegional(): void; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.iggridcolumnmoving#options:language) + * Note that this method is for rare scenarios, see [language](ui.iggridcolumnmoving#options:language) or [locale](ui.iggridcolumnmoving#options:locale) option setter + */ changeLocale(): void; /** @@ -39025,24 +45069,29 @@ interface JQuery { } interface JQuery { + igGridColumnMoving(methodName: "changeGlobalLanguage"): void; + igGridColumnMoving(methodName: "changeGlobalRegional"): void; igGridColumnMoving(methodName: "changeLocale"): void; igGridColumnMoving(methodName: "destroy"): void; igGridColumnMoving(methodName: "moveColumn", column: Object, target: Object, after?: boolean, inDom?: boolean, callback?: Function): void; /** * A list of column settings that specifies moving options on a per column basis. + * */ igGridColumnMoving(optionLiteral: 'option', optionName: "columnSettings"): IgGridColumnMovingColumnSetting[]; /** * A list of column settings that specifies moving options on a per column basis. * + * * @optionValue New value to be set. */ igGridColumnMoving(optionLiteral: 'option', optionName: "columnSettings", optionValue: IgGridColumnMovingColumnSetting[]): void; /** * Specify the drag-and-drop mode for the feature + * */ igGridColumnMoving(optionLiteral: 'option', optionName: "mode"): string; @@ -39050,6 +45099,7 @@ interface JQuery { /** * Specify the drag-and-drop mode for the feature * + * * @optionValue New value to be set. */ @@ -39057,6 +45107,7 @@ interface JQuery { /** * Specify the way columns will be rearranged + * */ igGridColumnMoving(optionLiteral: 'option', optionName: "moveType"): string; @@ -39064,6 +45115,7 @@ interface JQuery { /** * Specify the way columns will be rearranged * + * * @optionValue New value to be set. */ @@ -39071,96 +45123,112 @@ interface JQuery { /** * Gets if header cells should include an additional button that opens a moving helper dropdown. + * */ igGridColumnMoving(optionLiteral: 'option', optionName: "addMovingDropdown"): boolean; /** * Sets if header cells should include an additional button that opens a moving helper dropdown. * + * * @optionValue New value to be set. */ igGridColumnMoving(optionLiteral: 'option', optionName: "addMovingDropdown", optionValue: boolean): void; /** * Gets width of column moving dialog + * */ igGridColumnMoving(optionLiteral: 'option', optionName: "movingDialogWidth"): number; /** * Sets width of column moving dialog * + * * @optionValue New value to be set. */ igGridColumnMoving(optionLiteral: 'option', optionName: "movingDialogWidth", optionValue: number): void; /** * Gets height of column moving dialog + * */ igGridColumnMoving(optionLiteral: 'option', optionName: "movingDialogHeight"): number; /** * Sets height of column moving dialog * + * * @optionValue New value to be set. */ igGridColumnMoving(optionLiteral: 'option', optionName: "movingDialogHeight", optionValue: number): void; /** * Gets time in milliseconds for animation duration to show/hide modal dialog + * */ igGridColumnMoving(optionLiteral: 'option', optionName: "movingDialogAnimationDuration"): number; /** * Sets time in milliseconds for animation duration to show/hide modal dialog * + * * @optionValue New value to be set. */ igGridColumnMoving(optionLiteral: 'option', optionName: "movingDialogAnimationDuration", optionValue: number): void; /** * Gets the length (in pixels) between the dragged column and the column edges below which the move operation is accepted + * */ igGridColumnMoving(optionLiteral: 'option', optionName: "movingAcceptanceTolerance"): number; /** * Sets the length (in pixels) between the dragged column and the column edges below which the move operation is accepted * + * * @optionValue New value to be set. */ igGridColumnMoving(optionLiteral: 'option', optionName: "movingAcceptanceTolerance", optionValue: number): void; /** * Gets the length (in pixels) between the dragged column and the grid edges below which horizontal scrolling occurs + * */ igGridColumnMoving(optionLiteral: 'option', optionName: "movingScrollTolerance"): number; /** * Sets the length (in pixels) between the dragged column and the grid edges below which horizontal scrolling occurs * + * * @optionValue New value to be set. */ igGridColumnMoving(optionLiteral: 'option', optionName: "movingScrollTolerance", optionValue: number): void; /** * Gets a multiplier for the delay between subsequent scroll operations. The larger this number is, the slower scrolling will appear to be. + * */ igGridColumnMoving(optionLiteral: 'option', optionName: "scrollSpeedMultiplier"): number; /** * Sets a multiplier for the delay between subsequent scroll operations. The larger this number is, the slower scrolling will appear to be. * + * * @optionValue New value to be set. */ igGridColumnMoving(optionLiteral: 'option', optionName: "scrollSpeedMultiplier", optionValue: number): void; /** * Gets the length (in pixels) of each individual scroll operation + * */ igGridColumnMoving(optionLiteral: 'option', optionName: "scrollDelta"): number; /** * Sets the length (in pixels) of each individual scroll operation * + * * @optionValue New value to be set. */ igGridColumnMoving(optionLiteral: 'option', optionName: "scrollDelta", optionValue: number): void; @@ -39168,6 +45236,7 @@ interface JQuery { /** * Gets whether the contents of the column being dragged will get hidden. The option is only * relevant in immediate moving mode. + * */ igGridColumnMoving(optionLiteral: 'option', optionName: "hideHeaderContentsDuringDrag"): boolean; @@ -39175,6 +45244,7 @@ interface JQuery { * Sets whether the contents of the column being dragged will get hidden. The option is only * relevant in immediate moving mode. * + * * @optionValue New value to be set. */ igGridColumnMoving(optionLiteral: 'option', optionName: "hideHeaderContentsDuringDrag", optionValue: boolean): void; @@ -39183,6 +45253,7 @@ interface JQuery { * Gets the opacity of the drag markup, while a column header is being dragged. * The value must be between 0 and 1. When GroupBy is enabled, the corresponding option in the GroupBy configuration * will be used with priority over this one. + * */ igGridColumnMoving(optionLiteral: 'option', optionName: "dragHelperOpacity"): number; @@ -39191,6 +45262,7 @@ interface JQuery { * The value must be between 0 and 1. When GroupBy is enabled, the corresponding option in the GroupBy configuration * will be used with priority over this one. * + * * @optionValue New value to be set. */ igGridColumnMoving(optionLiteral: 'option', optionName: "dragHelperOpacity", optionValue: number): void; @@ -39353,12 +45425,14 @@ interface JQuery { /** * Gets markup for drop tooltip in column moving dialog + * */ igGridColumnMoving(optionLiteral: 'option', optionName: "movingDialogDropTooltipMarkup"): string; /** * Sets markup for drop tooltip in column moving dialog * + * * @optionValue New value to be set. */ igGridColumnMoving(optionLiteral: 'option', optionName: "movingDialogDropTooltipMarkup", optionValue: string): void; @@ -39383,12 +45457,14 @@ interface JQuery { /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. + * */ igGridColumnMoving(optionLiteral: 'option', optionName: "dialogWidget"): string; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. * + * * @optionValue New value to be set. */ igGridColumnMoving(optionLiteral: 'option', optionName: "dialogWidget", optionValue: string): void; @@ -39405,6 +45481,36 @@ interface JQuery { */ igGridColumnMoving(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + /** + * Set/Get the locale language setting for the widget. + * + */ + igGridColumnMoving(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igGridColumnMoving(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igGridColumnMoving(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igGridColumnMoving(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event which is fired when a drag operation begins on a column header */ @@ -39732,6 +45838,7 @@ interface IgGridFeatureChooserPopover { /** * controls the direction in which the control shows relative to the target element * + * * Valid values: * "auto" lets the control show on the side where enough space is available with the priority specified by the [directionPriority](ui.%%WidgetNameLowered%%#options:directionPriority) property * "left" shows popover on the left side of the target element @@ -39744,12 +45851,14 @@ interface IgGridFeatureChooserPopover { /** * Controls the priority in which the control searches for space to show relative to the target element. * This property has effect only if the [direction](ui.%%WidgetNameLowered%%#options:direction) property value is "auto" or unset. + * */ directionPriority?: any[]; /** * controls the position of the popover according to the target element in case the popover is larger than the target on the side we want to position, if the popover is smaller it should always be in the middle of the visible area * + * * Valid values: * "auto" lets the control choose a position depending on available space with the following priority balanced > end > start * "balanced" the popover is positioned at the middle of the target element @@ -39760,37 +45869,44 @@ interface IgGridFeatureChooserPopover { /** * defines width for the popover. leave null for auto. + * */ width?: number|string; /** * defines height for the popover. leave null for auto + * */ height?: number|string; /** * defines width the popover won't go under the value even if no specific one is set. + * */ minWidth?: number|string; /** * defines width the popover won't exceed even if no specific one is set. + * */ maxWidth?: number|string; /** * defines height the popover won't exceed even if no specific one is set. + * */ maxHeight?: number|string; /** * Sets the time popover fades in and out when showing/hiding + * */ animationDuration?: number; /** * sets the content for the popover container. If left null the content will be get from the target. * + * * Valid values: * "string" String content of the popover container * "function" Function which is a callback that should return the content. Use the 'this' value to access the target DOM element. @@ -39799,17 +45915,20 @@ interface IgGridFeatureChooserPopover { /** * Selectors indicating which items should show popovers. The predefined value is [title]. Customize if you're using something other then the title attribute for the popover content, or if you need a different selector for event delegation. When changing this option, you likely need to also change the contentTemplate option + * */ selectors?: string; /** * Sets the content for the popover header + * */ headerTemplate?: IgPopoverHeaderTemplate; /** * sets the event on which the popover will be shown. Predefined values are "mouseenter", "click" and "focus" * + * * Valid values: * "mouseenter" the popover is shown on mouse enter in the target element * "click" the popover is shown on click on the target element @@ -39820,6 +45939,7 @@ interface IgGridFeatureChooserPopover { /** * Controls where the popover DOM should be attached to. * + * * Valid values: * "string" A valid jQuery selector for the element * "object" A reference to the parent jQuery object @@ -39957,6 +46077,24 @@ interface FeatureToggledEventUIParam {} interface IgGridFeatureChooser { dropDownWidth?: any; animationDuration?: number; + + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; featureChooserRendering?: FeatureChooserRenderingEvent; featureChooserRendered?: FeatureChooserRenderedEvent; featureChooserDropDownOpening?: FeatureChooserDropDownOpeningEvent; @@ -39972,6 +46110,11 @@ interface IgGridFeatureChooser { } interface IgGridFeatureChooserMethods { shouldShowFeatureIcon(key: Object): void; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.iggridfeaturechooser#options:language) + * Note that this method is for rare scenarios, see [language](ui.iggridfeaturechooser#options:language) or [locale](ui.iggridfeaturechooser#options:locale) option setter + */ changeLocale(): void; /** @@ -40002,6 +46145,16 @@ interface IgGridFeatureChooserMethods { */ toggleDropDown(columnKey: string): void; destroy(e: Object, args: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igGridFeatureChooser"): IgGridFeatureChooserMethods; @@ -40031,6 +46184,7 @@ interface JQuery { /** * Controls the direction in which the control shows relative to the target element + * */ igGridFeatureChooserPopover(optionLiteral: 'option', optionName: "direction"): string; @@ -40038,6 +46192,7 @@ interface JQuery { /** * Controls the direction in which the control shows relative to the target element * + * * @optionValue New value to be set. */ @@ -40046,6 +46201,7 @@ interface JQuery { /** * Controls the priority in which the control searches for space to show relative to the target element. * This property has effect only if the [direction](ui.%%WidgetNameLowered%%#options:direction) property value is "auto" or unset. + * */ igGridFeatureChooserPopover(optionLiteral: 'option', optionName: "directionPriority"): any[]; @@ -40053,12 +46209,14 @@ interface JQuery { * Controls the priority in which the control searches for space to show relative to the target element. * This property has effect only if the [direction](ui.%%WidgetNameLowered%%#options:direction) property value is "auto" or unset. * + * * @optionValue New value to be set. */ igGridFeatureChooserPopover(optionLiteral: 'option', optionName: "directionPriority", optionValue: any[]): void; /** * Controls the position of the popover according to the target element in case the popover is larger than the target on the side we want to position, if the popover is smaller it should always be in the middle of the visible area + * */ igGridFeatureChooserPopover(optionLiteral: 'option', optionName: "position"): string; @@ -40066,6 +46224,7 @@ interface JQuery { /** * Controls the position of the popover according to the target element in case the popover is larger than the target on the side we want to position, if the popover is smaller it should always be in the middle of the visible area * + * * @optionValue New value to be set. */ @@ -40073,6 +46232,7 @@ interface JQuery { /** * Defines width for the popover. leave null for auto. + * */ igGridFeatureChooserPopover(optionLiteral: 'option', optionName: "width"): number|string; @@ -40080,6 +46240,7 @@ interface JQuery { /** * Defines width for the popover. leave null for auto. * + * * @optionValue New value to be set. */ @@ -40087,6 +46248,7 @@ interface JQuery { /** * Defines height for the popover. leave null for auto + * */ igGridFeatureChooserPopover(optionLiteral: 'option', optionName: "height"): number|string; @@ -40094,6 +46256,7 @@ interface JQuery { /** * Defines height for the popover. leave null for auto * + * * @optionValue New value to be set. */ @@ -40101,6 +46264,7 @@ interface JQuery { /** * Defines width the popover won't go under the value even if no specific one is set. + * */ igGridFeatureChooserPopover(optionLiteral: 'option', optionName: "minWidth"): number|string; @@ -40108,6 +46272,7 @@ interface JQuery { /** * Defines width the popover won't go under the value even if no specific one is set. * + * * @optionValue New value to be set. */ @@ -40115,6 +46280,7 @@ interface JQuery { /** * Defines width the popover won't exceed even if no specific one is set. + * */ igGridFeatureChooserPopover(optionLiteral: 'option', optionName: "maxWidth"): number|string; @@ -40122,6 +46288,7 @@ interface JQuery { /** * Defines width the popover won't exceed even if no specific one is set. * + * * @optionValue New value to be set. */ @@ -40129,6 +46296,7 @@ interface JQuery { /** * Defines height the popover won't exceed even if no specific one is set. + * */ igGridFeatureChooserPopover(optionLiteral: 'option', optionName: "maxHeight"): number|string; @@ -40136,6 +46304,7 @@ interface JQuery { /** * Defines height the popover won't exceed even if no specific one is set. * + * * @optionValue New value to be set. */ @@ -40143,18 +46312,21 @@ interface JQuery { /** * The time popover fades in and out when showing/hiding + * */ igGridFeatureChooserPopover(optionLiteral: 'option', optionName: "animationDuration"): number; /** * Sets the time popover fades in and out when showing/hiding * + * * @optionValue New value to be set. */ igGridFeatureChooserPopover(optionLiteral: 'option', optionName: "animationDuration", optionValue: number): void; /** * The content for the popover container. If left null the content will be get from the target. + * */ igGridFeatureChooserPopover(optionLiteral: 'option', optionName: "contentTemplate"): string|Function; @@ -40162,6 +46334,7 @@ interface JQuery { /** * Sets the content for the popover container. If left null the content will be get from the target. * + * * @optionValue New value to be set. */ @@ -40169,30 +46342,35 @@ interface JQuery { /** * Selectors indicating which items should show popovers. The predefined value is [title]. Customize if you're using something other then the title attribute for the popover content, or if you need a different selector for event delegation. When changing this option, you likely need to also change the contentTemplate option + * */ igGridFeatureChooserPopover(optionLiteral: 'option', optionName: "selectors"): string; /** * Selectors indicating which items should show popovers. The predefined value is [title]. Customize if you're using something other then the title attribute for the popover content, or if you need a different selector for event delegation. When changing this option, you likely need to also change the contentTemplate option * + * * @optionValue New value to be set. */ igGridFeatureChooserPopover(optionLiteral: 'option', optionName: "selectors", optionValue: string): void; /** * The content for the popover header + * */ igGridFeatureChooserPopover(optionLiteral: 'option', optionName: "headerTemplate"): IgPopoverHeaderTemplate; /** * Sets the content for the popover header * + * * @optionValue New value to be set. */ igGridFeatureChooserPopover(optionLiteral: 'option', optionName: "headerTemplate", optionValue: IgPopoverHeaderTemplate): void; /** * The event on which the popover will be shown. Predefined values are "mouseenter", "click" and "focus" + * */ igGridFeatureChooserPopover(optionLiteral: 'option', optionName: "showOn"): string; @@ -40200,6 +46378,7 @@ interface JQuery { /** * Sets the event on which the popover will be shown. Predefined values are "mouseenter", "click" and "focus" * + * * @optionValue New value to be set. */ @@ -40207,6 +46386,7 @@ interface JQuery { /** * Controls where the popover DOM should be attached to. + * */ igGridFeatureChooserPopover(optionLiteral: 'option', optionName: "appendTo"): string|Object; @@ -40214,6 +46394,7 @@ interface JQuery { /** * Controls where the popover DOM should be attached to. * + * * @optionValue New value to be set. */ @@ -40280,10 +46461,56 @@ interface JQuery { igGridFeatureChooser(methodName: "getDropDownByColumnKey", columnKey: string): void; igGridFeatureChooser(methodName: "toggleDropDown", columnKey: string): void; igGridFeatureChooser(methodName: "destroy", e: Object, args: Object): void; + igGridFeatureChooser(methodName: "changeGlobalLanguage"): void; + igGridFeatureChooser(methodName: "changeGlobalRegional"): void; igGridFeatureChooser(optionLiteral: 'option', optionName: "dropDownWidth"): any; igGridFeatureChooser(optionLiteral: 'option', optionName: "dropDownWidth", optionValue: any): void; igGridFeatureChooser(optionLiteral: 'option', optionName: "animationDuration"): number; igGridFeatureChooser(optionLiteral: 'option', optionName: "animationDuration", optionValue: number): void; + + /** + * Set/Get the locale setting for the widget. + * + */ + igGridFeatureChooser(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igGridFeatureChooser(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igGridFeatureChooser(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igGridFeatureChooser(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igGridFeatureChooser(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igGridFeatureChooser(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; igGridFeatureChooser(optionLiteral: 'option', optionName: "featureChooserRendering"): FeatureChooserRenderingEvent; igGridFeatureChooser(optionLiteral: 'option', optionName: "featureChooserRendering", optionValue: FeatureChooserRenderingEvent): void; igGridFeatureChooser(optionLiteral: 'option', optionName: "featureChooserRendered"): FeatureChooserRenderedEvent; @@ -40314,22 +46541,26 @@ interface IgGridFilteringColumnSettingDefaultExpressions { interface IgGridFilteringColumnSetting { /** * Identifies the grid column by key. Either key or index must be set in every column setting. + * */ columnKey?: string; /** * Identifies the grid column by index. Either key or index must be set in every column setting. + * */ columnIndex?: number; /** * Enables/disables filtering for the column. + * */ allowFiltering?: boolean; /** * Initial filtering condition for the column. * + * * Valid values: * "empty" * "notEmpty" @@ -40364,11 +46595,13 @@ interface IgGridFilteringColumnSetting { /** * An array of strings that determine which [conditions](ui.iggridfiltering#options:columnSettings.condition) to display for this column. + * */ conditionList?: any[]; /** * Initial filtering expressions - if set they will be applied on initialization together with the preset [condition](ui.iggridfiltering#options:columnSettings.condition). + * */ defaultExpressions?: IgGridFilteringColumnSettingDefaultExpressions; @@ -40392,316 +46625,379 @@ interface IgGridFilteringColumnSetting { interface IgGridFilteringLocale { /** * StartsWith null text that will be used for the filter editors. + * */ startsWithNullText?: string; /** * EndsWith null text that will be used for the filter editors. + * */ endsWithNullText?: string; /** * Contains null text that will be used for the filter editors. + * */ containsNullText?: string; /** * Does not contain null text that will be used for the filter editors. + * */ doesNotContainNullText?: string; /** * Equals null text that will be used for the filter editors. + * */ equalsNullText?: string; /** * Does not equal null text that will be used for the filter editors. + * */ doesNotEqualNullText?: string; /** * Greater than null text that will be used for the filter editors. + * */ greaterThanNullText?: string; /** * Less than null text that will be used for the filter editors. + * */ lessThanNullText?: string; /** * Greater than or equal to null text that will be used for the filter editors. + * */ greaterThanOrEqualToNullText?: string; /** * Less than or equal to null text that will be used for the filter editors. + * */ lessThanOrEqualToNullText?: string; /** * On null text that will be used for the filter editors. + * */ onNullText?: string; /** * Not on null text that will be used for the filter editors. + * */ notOnNullText?: string; /** * After null text that will be used for the filter editors. + * */ afterNullText?: string; /** * Before null text that will be used for the filter editors. + * */ beforeNullText?: string; /** * Empty null text that will be used for the filter editors. + * */ emptyNullText?: string; /** * Not empty null text that will be used for the filter editors. + * */ notEmptyNullText?: string; /** * Not empty null text that will be used for the filter editors. + * */ nullNullText?: string; /** * Not empty null text that will be used for the filter editors. + * */ notNullNullText?: string; /** * 'Starts with' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ startsWithLabel?: string; /** * 'Starts with' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ endsWithLabel?: string; /** * 'Contains' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ containsLabel?: string; /** * 'Does not contain' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ doesNotContainLabel?: string; /** * 'Equals' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ equalsLabel?: string; /** * 'Does not Equal' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ doesNotEqualLabel?: string; /** * 'Greater Than' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ greaterThanLabel?: string; /** * 'Less Than' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ lessThanLabel?: string; /** * 'Greater Than or Equal' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ greaterThanOrEqualToLabel?: string; /** * 'Less Than or Equal' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ lessThanOrEqualToLabel?: string; /** * 'True' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ trueLabel?: string; /** * 'False' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ falseLabel?: string; /** * 'After' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ afterLabel?: string; /** * 'Before' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ beforeLabel?: string; /** * 'Today' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ todayLabel?: string; /** * 'Yesterday' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ yesterdayLabel?: string; /** * 'This Month' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ thisMonthLabel?: string; /** * 'Last Month' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ lastMonthLabel?: string; /** * 'Next Month' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ nextMonthLabel?: string; /** * 'This Year' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ thisYearLabel?: string; /** * 'Last Year' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ lastYearLabel?: string; /** * 'Next Year' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ nextYearLabel?: string; /** * 'Clear' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ clearLabel?: string; /** * 'No Filter' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ noFilterLabel?: string; /** * 'On' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ onLabel?: string; /** * 'Not On' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ notOnLabel?: string; /** * 'Advance Button' label that is used for the predefined filtering conditions in the filter dropdowns. + * */ advancedButtonLabel?: string; /** * Specifies the filter dialog caption label. + * */ filterDialogCaptionLabel?: string; /** * Specifies the filter condition label. + * */ filterDialogConditionLabel1?: string; /** * Specifies the filter condition label. + * */ filterDialogConditionLabel2?: string; /** * Specifies the filter condition drop-down label. + * */ filterDialogConditionDropDownLabel?: string; /** * Specifies the dialog's Ok button label. + * */ filterDialogOkLabel?: string; /** * Specifies the dialog's Cancel button label. + * */ filterDialogCancelLabel?: string; /** * Specifies the Any label for the filtering dialog. + * */ filterDialogAnyLabel?: string; /** * Specifies the All label for the filtering dialog. + * */ filterDialogAllLabel?: string; /** * Specifies the Add button label for the filtering dialog. + * */ filterDialogAddLabel?: string; /** * Specifies the Error label for the filtering dialog. + * */ filterDialogErrorLabel?: string; /** * Specifies the Close label for the filtering dialog. + * */ filterDialogCloseLabel?: string; /** * Specifies the Filtering summary title. + * */ filterSummaryTitleLabel?: string; /** * Specifies the summary template for the matching records. + * */ filterSummaryTemplate?: string; /** * Specifies clear all label in the filter dialog. + * */ filterDialogClearAllLabel?: string; /** * Custom tooltip template for the filter button, when a filter is applied. + * */ tooltipTemplate?: string; /** * Feature chooser text when filter is shown and filter [mode](ui.iggridfiltering#options:mode) is simple. + * */ featureChooserText?: string; /** * Feature chooser text when filter is hidden and filter [mode](ui.iggridfiltering#options:mode) is simple. + * */ featureChooserTextHide?: string; /** * Feature chooser text when filter [mode](ui.iggridfiltering#options:mode) is advanced. + * */ featureChooserTextAdvancedFilter?: string; @@ -40711,9 +47007,222 @@ interface IgGridFilteringLocale { [optionName: string]: any; } +interface DataFilteringEvent { + (event: Event, ui: DataFilteringEventUIParam): void; +} + +interface DataFilteringEventUIParam { + /** + * Gets reference to GridFiltering. + */ + owner?: any; + + /** + * Gets the column index. Applicable only when filtering mode is "simple". + */ + columnIndex?: number; + + /** + * Gets the column key. Applicable only when filtering mode is "simple". + */ + columnKey?: string; + + /** + * Gets the filtering expressions. Filtering expressions could be changed in this event handler and after that data binding is applied. In this way the user could control filtering more easily before applying data-binding. + */ + newExpressions?: any[]; +} + +interface DataFilteredEvent { + (event: Event, ui: DataFilteredEventUIParam): void; +} + +interface DataFilteredEventUIParam { + /** + * Gets reference to GridFiltering. + */ + owner?: any; + + /** + * Gets the column index. Applicable only when filtering mode is "simple". + */ + columnIndex?: number; + + /** + * Gets the column key. Applicable only when filtering mode is "simple". + */ + columnKey?: string; + + /** + * Gets the filtered expressions. + */ + expressions?: any[]; +} + +interface FilterDialogOpeningEvent { + (event: Event, ui: FilterDialogOpeningEventUIParam): void; +} + +interface FilterDialogOpeningEventUIParam { + /** + * Gets reference to GridFiltering. + */ + owner?: any; + + /** + * Gets reference to the filtering dialog DOM element. + */ + dialog?: string; +} + +interface FilterDialogOpenedEvent { + (event: Event, ui: FilterDialogOpenedEventUIParam): void; +} + +interface FilterDialogOpenedEventUIParam { + /** + * Gets reference to GridFiltering. + */ + owner?: any; + + /** + * Gets reference to the filtering dialog DOM element. + */ + dialog?: string; +} + +interface FilterDialogMovingEvent { + (event: Event, ui: FilterDialogMovingEventUIParam): void; +} + +interface FilterDialogMovingEventUIParam { + /** + * Gets reference to GridFiltering. + */ + owner?: any; + + /** + * Gets reference to filtering dialog DOM element. + */ + dialog?: string; + + /** + * Gets the original position of the groupby dialog div as { top, left } object, relative to the page. + */ + originalPosition?: any; + + /** + * Gets the current position of the groupby dialog div as { top, left } object, relative to the page. + */ + position?: any; +} + +interface FilterDialogFilterAddingEvent { + (event: Event, ui: FilterDialogFilterAddingEventUIParam): void; +} + +interface FilterDialogFilterAddingEventUIParam { + /** + * Gets reference to GridFiltering. + */ + owner?: any; + + /** + * Gets reference to filters table body DOM element. + */ + filtersTableBody?: string; +} + +interface FilterDialogFilterAddedEvent { + (event: Event, ui: FilterDialogFilterAddedEventUIParam): void; +} + +interface FilterDialogFilterAddedEventUIParam { + /** + * Gets reference to GridFiltering. + */ + owner?: any; + + /** + * Gets reference to the filters table row DOM element. + */ + filter?: string; +} + +interface FilterDialogClosingEvent { + (event: Event, ui: FilterDialogClosingEventUIParam): void; +} + +interface FilterDialogClosingEventUIParam { + /** + * Gets reference to GridFiltering. + */ + owner?: any; +} + +interface FilterDialogClosedEvent { + (event: Event, ui: FilterDialogClosedEventUIParam): void; +} + +interface FilterDialogClosedEventUIParam { + /** + * Gets reference to GridFiltering. + */ + owner?: any; +} + +interface FilterDialogContentsRenderingEvent { + (event: Event, ui: FilterDialogContentsRenderingEventUIParam): void; +} + +interface FilterDialogContentsRenderingEventUIParam { + /** + * Gets reference to GridFiltering. + */ + owner?: any; + + /** + * Gets reference to the filtering dialog DOM element. + */ + dialogElement?: string; +} + +interface FilterDialogContentsRenderedEvent { + (event: Event, ui: FilterDialogContentsRenderedEventUIParam): void; +} + +interface FilterDialogContentsRenderedEventUIParam { + /** + * Gets reference to GridFiltering. + */ + owner?: any; + + /** + * Gets reference to the filtering dialog DOM element. + */ + dialogElement?: string; +} + +interface FilterDialogFilteringEvent { + (event: Event, ui: FilterDialogFilteringEventUIParam): void; +} + +interface FilterDialogFilteringEventUIParam { + /** + * Gets reference to GridFiltering. + */ + owner?: any; + + /** + * Gets reference to filtering dialog DOM element. + */ + dialog?: string; +} + interface IgGridFiltering { /** * Enables or disables the filtering case sensitivity. Works only for local filtering. If true, it case sensitive filtering is performed. If false, filtering is case insensitive. + * */ caseSensitive?: boolean; @@ -40721,11 +47230,13 @@ interface IgGridFiltering { * Enable/disable footer visibility with summary info about the filter. * When false, the filter summary row (in the footer) will only be visible when paging is enabled (or some other feature that renders a footer). * When true, the filter summary row will only be visible when a filter is applied i.e. it's not visible by default. + * */ filterSummaryAlwaysVisible?: boolean; /** * Render in [Feature Chooser](http://www.igniteui.com/help/iggrid-feature-chooser) + * */ renderFC?: boolean; @@ -40738,6 +47249,7 @@ interface IgGridFiltering { /** * Type of animations for the column filter dropdowns. * + * * Valid values: * "linear" The column filtering drop downs are shown with a linear animation. * "none" No animation is used when showing the filtering drop downs. @@ -40746,12 +47258,14 @@ interface IgGridFiltering { /** * Animation duration in milliseconds for the [filterDropDownAnimations](ui.iggridfiltering#options:filterDropDownAnimations). + * */ filterDropDownAnimationDuration?: number; /** * Width of the column filter dropdowns. * + * * Valid values: * "string" The width in pixels (0px) * "number" The width in pixels as a number (0) @@ -40768,12 +47282,14 @@ interface IgGridFiltering { /** * URL key name that specifies how the filtering expressions will be encoded for remote requests, e.g. &filter('col') = startsWith. Default is OData. + * */ filterExprUrlKey?: string; /** * Enable/disable filter icons visibility. * + * * Valid values: * "true" All predefined filters in the filter dropdowns will have icons rendered in front of the text. * "false" No icons will be rendered. @@ -40782,12 +47298,14 @@ interface IgGridFiltering { /** * A list of column settings that specifies custom filtering options on a per column basis. + * */ columnSettings?: IgGridFilteringColumnSetting[]; /** * Type of filtering. Delegates all filtering functionality to the [$.ig.DataSource](ig.datasource). * + * * Valid values: * "remote" Filtering is performed by a remote end-point. * "local" Filtering is performed locally by the [$.ig.DataSource](ig.datasource). @@ -40796,12 +47314,14 @@ interface IgGridFiltering { /** * Time in milliseconds for which widget will wait between keystrokes before sending filtering requests. + * */ filterDelay?: number; /** * Default is 'simple' for non-virtualized grids, and 'advanced' when [virtualization](ui.iggrid#options:virtualization) is enabled. * + * * Valid values: * "simple" Renders just a filter row. * "advanced" Allows to configure multiple filters from a dialog - Excel style. @@ -40810,12 +47330,14 @@ interface IgGridFiltering { /** * Defines whether to render editors in advanced [mode](ui.iggridfiltering#options:mode). If false, no editors will be rendered in the advanced [mode](ui.iggridfiltering#options:mode). + * */ advancedModeEditorsVisible?: boolean; /** * Location of the advanced filtering button when [advancedModeEditorsVisible](ui.iggridfiltering#options:advancedModeEditorsVisible) is false (i.e. when the button is rendered in the header). * + * * Valid values: * "left" * "right" @@ -40825,6 +47347,7 @@ interface IgGridFiltering { /** * Default filter dialog width (used for Advanced filtering [mode](ui.iggridfiltering#options:mode)). * + * * Valid values: * "string" The dialog window width in pixels (370px). * "number" The dialog window width in pixels as a number (370). @@ -40834,6 +47357,7 @@ interface IgGridFiltering { /** * default filter dialog height (used for Advanced filtering [mode](ui.iggridfiltering#options:mode)). * + * * Valid values: * "string" The dialog window height in pixels (350px). * "number" The dialog window height in pixels as a number (350). @@ -40843,6 +47367,7 @@ interface IgGridFiltering { /** * Width of the filtering condition dropdowns in the advanced filter dialog. * + * * Valid values: * "string" The filtering condition dropdowns width in pixels (80px). * "number" The filtering condition dropdowns width in pixels as a number (80). @@ -40852,6 +47377,7 @@ interface IgGridFiltering { /** * Width of the filtering expression input boxes in the advanced filter dialog. * + * * Valid values: * "string" The filtering expression input boxes width in pixels (80px). * "number" The filtering expression input boxes width in pixels as a number (80). @@ -40861,6 +47387,7 @@ interface IgGridFiltering { /** * Width of the column chooser dropdowns in the advanced filter dialog. * + * * Valid values: * "string" The column chooser dropdowns width in pixels (80px). * "number" The column chooser dropdowns width in pixels as a number (80). @@ -40869,12 +47396,14 @@ interface IgGridFiltering { /** * Enable/disable filter button visibility. If false, no filter dropdown buttons will be rendered and a predefined list of filters will not be rendered for the columns. + * */ renderFilterButton?: boolean; /** * The filtering button for filter dropdowns can be rendered either on the left of the filter editor, or on the right. * + * * Valid values: * "left" The button is rendered on the left. * "right" The button is rendered on the right. @@ -40920,11 +47449,13 @@ interface IgGridFiltering { /** * Custom template for add condition area in the filter dialog. The default template is "
    ${label1}
    ${label2}
    ". + * */ filterDialogAddConditionTemplate?: string; /** * Custom template for options in dropdown in add condition area in the filter dialog. The default template is "". + * */ filterDialogAddConditionDropDownTemplate?: string; @@ -40934,17 +47465,20 @@ interface IgGridFiltering { * E.g.: DOM element used for selecting column has attribute "data-af-col", for selecting filter condition - "data-af-cond", for filter expression- "data-af-expr". * NOTE: The template is supported only with
    definition in the template. + * */ columnCssClass?: string; /** * This option is applicable only for columns with [dataType](ui.iggrid#options:columns.dataType) of object. Reference to a function, or the name of the function, that will be used for complex data extraction from the data records, whose return value will be used for all data operations associated with this column and will be displayed as cell value. [Here you can find more examples of how to setup a column mapper](http://www.igniteui.com/help/iggrid-columns-and-layout#defining-mapper) * + * * Valid values: * "string" The name of the mapper function. * "function" Reference to the mapper function. @@ -41731,26 +48761,31 @@ interface IgGridColumn { /** * Specifies the row index of the cell in a Multi-Row Layout configuration. All columns must have this property set for the multi-row-layout mode to be enabled. [Here you can find more about the Multi-Row Layout feature](http://www.igniteui.com/help/iggrid-multirowlayout) + * */ rowIndex?: number; /** * Specifies the column index of the cell in a Multi-Row Layout configuration. All columns must have this property set for the multi-row-layout mode to be enabled. [Here you can find more about the Multi-Row Layout feature](http://www.igniteui.com/help/iggrid-multirowlayout) + * */ columnIndex?: number; /** * Specifies the navigation index of the cell for the TAB sequence when the cells are in edit mode in a Multi-Row Layout grid. Has no effect otherwise. [Here you can find more about the Multi-Row Layout feature](http://www.igniteui.com/help/iggrid-multirowlayout) + * */ navigationIndex?: number; /** * Specifies the colSpan of the cell in a Multi-Row Layout configuration. colSpan 0 is not supported and will be changed to 1 by the grid. [Here you can find more about the Multi-Row Layout feature](http://www.igniteui.com/help/iggrid-multirowlayout) + * */ colSpan?: number; /** * Specifies the rowSpan of the cell in a Multi-Row Layout configuration. rowSpan 0 is not supported and will be changed to 1 by the grid. [Here you can find more about the Multi-Row Layout feature](http://www.igniteui.com/help/iggrid-multirowlayout). If multi-row-layout is not used but multi-column-header is set then this option is used to adjust span of header cell. + * */ rowSpan?: number; @@ -41775,16 +48810,19 @@ interface IgGridFeature { interface IgGridRestSettingsCreate { /** * Specifies a remote URL to which create requests will be sent. This will be used for both batch and non-batch, however if template is also set, this URL will only be used for batch requests. + * */ url?: string; /** * Specifies a remote URL template. Use ${id} in place of the resource id. + * */ template?: string; /** * Specifies whether create requests will be sent in batches + * */ batch?: boolean; @@ -41841,6 +48879,7 @@ interface IgGridRestSettingsRemove { interface IgGridRestSettings { /** * Settings for create requests + * */ create?: IgGridRestSettingsCreate; @@ -41861,11 +48900,13 @@ interface IgGridRestSettings { /** * Specifies a custom function to serialize content sent to the server. It should accept a single object or an array of objects and return a string. If not specified, JSON.stringify() will be used. + * */ contentSerializer?: Function; /** * Specifies the content type of the request. See http://api.jquery.com/jQuery.ajax/ => contentType + * */ contentType?: string; @@ -41878,41 +48919,49 @@ interface IgGridRestSettings { interface IgGridScrollSettings { /** * Sets gets current vertical position. + * */ scrollTop?: number; /** * Sets gets current horizontal position. + * */ scrollLeft?: number; /** * Sets gets the step of the default scrolling behavior when using the mouse wheel. + * */ wheelStep?: number; /** * Sets gets if smoother scrolling with small intertia should be used when using the mouse wheel. + * */ smoothing?: boolean; /** * Sets or gets the modifier for how many pixels will be scrolled when using the mouse wheel once. This is used only for the [smooth scrolling behavior](ui.iggrid#options:scrollSettings.smoothing). + * */ smoothingStep?: number; /** * Sets or gets the modifier for how long the scroll ‘animation’ lasts when using the mouse wheel once. This is used only for the [smooth scrolling behavior](ui.iggrid#options:scrollSettings.smoothing). + * */ smoothingDuration?: number; /** * Sets gets the modifier for how much the inertia scrolls on touch devices. Note: Value set to 0 would disable touch movements. Value set to -1 would invert them. + * */ inertiaStep?: number; /** * Sets gets the modifier for how long the inertia last on touch devices. + * */ inertiaDuration?: number; @@ -42231,9 +49280,16 @@ interface DestroyedEventUIParam { } interface IgGrid { + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + /** * Defines the grid width in pixels or percents. [Here you can find more info about setting igGrid width](http://www.igniteui.com/help/iggrid-columns-and-layout#width-height). * + * * Valid values: * "string" The widget width can be set in pixels (px) or percentage (%). Example values: "800px", "800" (defaults to pixels), "100%". * "number" The widget width can be set in pixels as a number. Example values: 800, 700. @@ -42244,6 +49300,7 @@ interface IgGrid { /** * This is the total height of the grid, including all UI elements - scroll container with data rows, header, footer, filter row - (if any), etc. [Here you can find more info about setting igGrid height](http://www.igniteui.com/help/iggrid-columns-and-layout#width-height). * + * * Valid values: * "string" The widget height can be set in pixels (px) and percentage (%). * "number" The widget height can be set as a number @@ -42253,12 +49310,14 @@ interface IgGrid { /** * If autoAdjustHeight is set to false, the [height](ui.iggrid#options:height) will be set only on the scrolling container, and all other UI elements such as paging footer / filter row / headers will add on top of that, so the total height of the grid will be more than this value - the height of the scroll container (content area) will not be dynamically calculated. Setting this option to false will usually result in a lot better initial rendering performance for large data sets ( > 1000 rows rendered at once, no [virtualization](ui.iggrid#options:virtualization) enabled), since no reflows will be made by browsers when accessing DOM properties such as offsetHeight. + * */ autoAdjustHeight?: boolean; /** * Used for [row virtualization](ui.iggrid#options:rowVirtualization) in [fixed mode](ui.iggrid#options:virtualizationMode). This is the average value in pixels (default) that will be used to calculate how many rows to render as the end user scrolls. Also all rows' height will be automatically set to this value. * + * * Valid values: * "string" The avarage row height can be set in pixels ("25px"). * "number" The avarage row height can be set in pixels as a number (25). @@ -42268,6 +49327,7 @@ interface IgGrid { /** * Used for [column virtualization](ui.iggrid#options:columnVirtualization) in [fixed mode](ui.iggrid#options:virtualizationMode). This is the average value in pixels for a column width. * + * * Valid values: * "string" The avarage column width can be set in pixels ("25px"). * "number" The avarage column width can be set in pixels as a number (25). @@ -42275,10 +49335,11 @@ interface IgGrid { avgColumnWidth?: string|number; /** - * Default column width that will be set for all columns, that don't have [column width](ui.iggrid#options:columns.width) defined. + * Default column width that will be set for all columns, that don't have [column width](ui.iggrid#options:columns.width) defined. Can also be set as '*', in which case the width auto-size based on the content of the column cells (including the header text). + * * * Valid values: - * "string" The default column width can be set in pixels ("100px"). + * "string" The default column width can be set in pixels ("100px") or as '*' in order to auto-size based on the cells and header content. * "number" The default column width can be set in pixels as a number (100). */ defaultColumnWidth?: string|number; @@ -42287,17 +49348,20 @@ interface IgGrid { * If no [columns](ui.iggrid#options:columns) collection is defined, and autoGenerateColumns is set to true, [columns](ui.iggrid#options:columns) will be inferred from the data source before the [dataRendering](ui.iggrid#events:dataRendering) event is fired. The inferred [columns](ui.iggrid#options:columns) collection will be available to the developer for modification at [dataRendering](ui.iggrid#events:dataRendering). If autoGenerateColumns is not explicitly set and [columns](ui.iggrid#options:columns) has at least one column defined then autoGenerateColumns is automatically set to false. * If autoGenerateColumns is true and there are columns defined auto-generated columns will render after the explicitly defined ones. * Since auto-generated columns don't have width defined consider setting [defaultColumnWidth](ui.iggrid#options:defaultColumnWidth) as well. + * */ autoGenerateColumns?: boolean; /** * Enables/disables column and row virtualization at the same time. Virtualization can greatly enhance rendering performance. If enabled, the number of actual rendered rows (DOM elements) will be constant and related to the visible viewport of the grid. As the end user scrolls, those DOM elements will be dynamically reused to render the new data. [Here you can find more info about the performance guidelines when using the igGrid](http://www.igniteui.com/help/iggrid-performance-guide) + * */ virtualization?: boolean; /** * Determines row virtualization mode. * + * * Valid values: * "fixed" Renders only the visible rows and/or columns in the grid. On scrolling the same rows and/or columns are updated with new data from the data source. Only fixed virtualization can work with column virtualization at the same time. Fixed virtualization is not supported by some grid features: Resizing, Group By, Responsive. * "continuous" renders a pre-defined number of rows in the grid. On scrolling the continuous virtualization loads another portion of rows and disposes the current one. @@ -42306,27 +49370,32 @@ interface IgGrid { /** * Enables virtualization for rows only. [Here you can find more info about igGrid row virtualization](http://www.igniteui.com/help/iggrid-virtualization-overview) + * */ rowVirtualization?: boolean; /** * Enables virtualization for columns only. Column virtualization can work only in combination with fixed row virtalization. Setting columnVirtualization to true will automatically set [virtualization](ui.iggrid#options:virtualization) to true and [virtualizationMode](ui.iggrid#options:virtualizationMode) to "fixed". + * */ columnVirtualization?: boolean; /** * Number of pixels to scroll the grid by, when virtualization is enabled, and mouse wheel scrolling is performed over the virtual grid area. If "null" the step will be equal to the [avgRowHeight](ui.iggrid#options:avgRowHeight). + * */ virtualizationMouseWheelStep?: number; /** * If this option is set to true, the height of the grid row will be calculated automatically based on the [avgRowHeight](ui.iggrid#options:avgRowHeight) and the visible virtual records. If no [avgRowHeight](ui.iggrid#options:avgRowHeight) is specified, it will be calculated automatically at runtime. + * */ adjustVirtualHeights?: boolean; /** * The templating engine that will be used to render the grid [column templates](ui.iggrid#options:columns.template). [Here you can find](http://www.infragistics.com/community/blogs/marina_stoyanova/archive/2014/05/30/using-different-template-engines-with-ignite-ui-controls.aspx) how to use templating engines other than igTemplating and jsRender. * + * * Valid values: * "infragistics" The grid will use the Infragistics Templating engine to render its [column templates](ui.iggrid#options:columns.template) and specific parts of the UI. * "jsRender" The grid will use jsRender to render its [column templates](ui.iggrid#options:columns.template) and specific parts of the UI. @@ -42335,12 +49404,14 @@ interface IgGrid { /** * An array of column objects. Checkout the [Columns and Layout](http://www.igniteui.com/help/iggrid-columns-and-layout#defining-columns) topic for details on configuring the columns array. + * */ columns?: IgGridColumn[]; /** * Can be any valid data source accepted by [$.ig.DataSource](ig.datasource), or an instance of an $.ig.DataSource itself * + * * Valid values: * "array" dataSource as an array * "object" ddataSource as an object @@ -42350,86 +49421,102 @@ interface IgGrid { /** * Specifies a remote URL as a data source, from which data will be retrieved using the [$.ig.DataSource](ig.datasource). + * */ dataSourceUrl?: string; /** * Explicitly set data source type (such as "json"). Please refer to the documentation of [$.ig.DataSource type](ig.datasource#options:settings.type). + * */ dataSourceType?: string; /** * See [$.ig.DataSource responseDataKey](ig.datasource#options:settings.responseDataKey). This is the property in the responses where data records are held, if the response is wrapped. + * */ responseDataKey?: string; /** - * See [$.ig.DataSource responseTotalRecCountKey](ig.datasource#options:settings.responseTotalRecCountKey). Property in the response specifying the total number of records on the server. + * This option has been deprecated. See [$.ig.DataSource responseTotalRecCountKey](ig.datasource#options:settings.responseTotalRecCountKey). Property in the response specifying the total number of records on the server. */ responseTotalRecCountKey?: string; /** * Specifies the HTTP verb to be used to issue the requests to a remote data source. + * */ requestType?: string; /** * Content type of the response. See http://api.jquery.com/jQuery.ajax/ => contentType + * */ responseContentType?: string; /** * Controls the visibility of the grid header. + * */ showHeader?: boolean; /** * Controls the visibility of the grid footer. + * */ showFooter?: boolean; /** * Headers will be fixed if this option is set to true, and only the grid data will be scrollable. If [virtualization](ui.iggrid#options:virtualization) is enabled, fixedHeaders will always act as if it's true, no matter which value is set. + * */ fixedHeaders?: boolean; /** * Footers will be fixed if this option is set to true, and only the grid data will be scrollable. If [virtualization](ui.iggrid#options:virtualization) is enabled, fixedFooters will always act as if it's true, no matter which value is set. + * */ fixedFooters?: boolean; /** * Caption text that will be shown above the grid header. + * */ caption?: string; /** * List of grid feature definitions: sorting, paging, etc. Each feature goes with its separate options that are documented for the feature accordingly. [Here you can find detailed documentation for all igGrid features](http://www.igniteui.com/help/iggrid-features-landing-page) + * */ features?: IgGridFeature[]; /** * Initial tabIndex attribute that will be set on all focusable elements. + * */ tabIndex?: number; /** * If this option is set to false, the data to which the grid is bound will be used "as is" with no additional transformations based on [columns](ui.iggrid#options:columns) defined. Otherwise only the subset of data properties used in the [columns](ui.iggrid#options:columns) defined will be extracted in a new object and used. + * */ localSchemaTransform?: boolean; /** * Key of the column containing unique identifiers for the data records. + * */ primaryKey?: string; /** * If true, the transaction log will always be sent in the request for remote data, by the data source. Also this means that if there are values in the log, a POST will be performed instead of GET. + * */ serializeTransactionLog?: boolean; /** * Automatically commits the transactions as rows/cells are being edited to the client data source. A [saveChanges](ui.iggrid#methods:saveChanges) call still needs to be performed in order to commit the transactions to a server-side data source. + * */ autoCommit?: boolean; @@ -42439,12 +49526,14 @@ interface IgGrid { * If a new row is added, edited, then deleted, there will be no transaction added to the log. * If several edits are made to a row or an individual cell, this should result in a single transaction. * Note: This option takes effect only when [autoCommit](ui.iggrid#options:autoCommit) is set to false. + * */ aggregateTransactions?: boolean; /** * Sets gets ability to automatically format text in cells for numeric and date columns. The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) * + * * Valid values: * "date" formats only Date columns * "number" formats only number columns @@ -42456,58 +49545,69 @@ interface IgGrid { /** * Gets sets ability to render checkboxes and use checkbox editor when dataType of a column is "bool". Checkboxes are not rendered for boolean values in columns with a [column template](ui.iggrid#options:columns.template). + * */ renderCheckboxes?: boolean; /** * URL to which updating requests will be made. + * */ updateUrl?: string; /** * Settings related to REST compliant update routines. + * */ restSettings?: IgGridRestSettings; /** * Enables/disables rendering of alternating row styles (odd and even rows receive different styling). + * */ alternateRowStyles?: boolean; /** * If set to true and all columns' widths are specified and their combined width is less than the grid width then the last column width will be automatically adjusted to fill the remaining empty space of the grid. + * */ autofitLastColumn?: boolean; /** * Enables/disables rendering of hover styles when the mouse is over a record. This can be useful in templating scenarios, for example, where we don't want to apply hover styling to templated content. + * */ enableHoverStyles?: boolean; /** * Enables/Disables serializing client date as UTC ISO 8061 string instead of using the local time and zone values. + * */ enableUTCDates?: boolean; /** * Merge unbound columns values inside data source when data source is remote. If true then the unbound columns are merged to the data source at runtime on the server. Note that data source is expanded with the new data and this could cause performance issues when the data is huge. If mergeUnboundColumns is false then the unbound data is sent and merged on the client. This option is used by the [igGrid MVC Helper](http://www.igniteui.com/help/iggrid-developing-asp-net-mvc-applications-with-iggrid). * Checkout [Populating Unbound Columns Remotely (igGrid)](http://www.igniteui.com/help/iggrid-unboundcolumns-populating-with-data-remotely) topic for more information. + * */ mergeUnboundColumns?: boolean; /** * When dataSource is a remote URL, defines whether to set the type of the remote data source to JSONP. + * */ jsonpRequest?: boolean; /** * Enables/disables grid adjusting its dimensions when its [width](ui.iggrid#options:width) and/or [height](ui.iggrid#options:height) is set in percent (%) and grid parent DOM container is resized. + * */ enableResizeContainerCheck?: boolean; /** * Configures how the feature chooser icon should display on header cells - e.g. to display as gear icon or not. * + * * Valid values: * "none" Always hide the feature chooser icon; The feature chooser is shown on tapping/clicking the column header. * "desktopOnly" Always show the icon on desktop but hide when touch device detected. @@ -42517,9 +49617,22 @@ interface IgGrid { /** * Settings related to content scrolling. + * */ scrollSettings?: IgGridScrollSettings; + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event fired when a cell is clicked. */ @@ -42658,6 +49771,11 @@ interface IgGridMethods { * Returns the element holding the data records */ widget(): void; + + /** + * Changes the the regional settings of widget element to the language specified in [options.regional](ui.iggrid#options:regional) + * Note that this method is for rare scenarios, use [regional](ui.iggrid#options:regional) option setter + */ changeRegional(): void; /** @@ -43001,6 +50119,8 @@ interface IgGridMethods { /** * Causes the grid to data bind to the data source (local or remote) , and re-render all of the data as well + * + * @param internal */ dataBind(internal: Object): void; @@ -43119,8 +50239,28 @@ interface IgGridMethods { * 1. Remove custom CSS classes that were added. * 2. Unwrap any wrapping elements such as scrolling divs and other containers. * 3. Unbind all events that were bound. + * + * @param notToCallDestroy */ destroy(notToCallDestroy: Object): void; + + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ + changeLocale($container: Object): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igGrid"): IgGridMethods; @@ -43199,9 +50339,27 @@ interface JQuery { igGrid(methodName: "virtualScrollTo", scrollerPosition: Object): void; igGrid(methodName: "getColumnByTD", $td: Object): Object; igGrid(methodName: "destroy", notToCallDestroy: Object): void; + igGrid(methodName: "changeLocale", $container: Object): void; + igGrid(methodName: "changeGlobalLanguage"): void; + igGrid(methodName: "changeGlobalRegional"): void; + + /** + * Set/Get the locale setting for the widget. + * + */ + igGrid(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igGrid(optionLiteral: 'option', optionName: "locale", optionValue: any): void; /** * Defines the grid width in pixels or percents. [Here you can find more info about setting igGrid width](http://www.igniteui.com/help/iggrid-columns-and-layout#width-height). + * */ igGrid(optionLiteral: 'option', optionName: "width"): string|number; @@ -43209,6 +50367,7 @@ interface JQuery { /** * Defines the grid width in pixels or percents. [Here you can find more info about setting igGrid width](http://www.igniteui.com/help/iggrid-columns-and-layout#width-height). * + * * @optionValue New value to be set. */ @@ -43216,6 +50375,7 @@ interface JQuery { /** * This is the total height of the grid, including all UI elements - scroll container with data rows, header, footer, filter row - (if any), etc. [Here you can find more info about setting igGrid height](http://www.igniteui.com/help/iggrid-columns-and-layout#width-height). + * */ igGrid(optionLiteral: 'option', optionName: "height"): string|number; @@ -43223,6 +50383,7 @@ interface JQuery { /** * This is the total height of the grid, including all UI elements - scroll container with data rows, header, footer, filter row - (if any), etc. [Here you can find more info about setting igGrid height](http://www.igniteui.com/help/iggrid-columns-and-layout#width-height). * + * * @optionValue New value to be set. */ @@ -43230,18 +50391,21 @@ interface JQuery { /** * If autoAdjustHeight is set to false, the [height](ui.iggrid#options:height) will be set only on the scrolling container, and all other UI elements such as paging footer / filter row / headers will add on top of that, so the total height of the grid will be more than this value - the height of the scroll container (content area) will not be dynamically calculated. Setting this option to false will usually result in a lot better initial rendering performance for large data ( > 1000 rows rendered at once, no [virtualization](ui.iggrid#options:virtualization) enabled), since no reflows will be made by browsers when accessing DOM properties such as offsetHeight. + * */ igGrid(optionLiteral: 'option', optionName: "autoAdjustHeight"): boolean; /** * If autoAdjustHeight is set to false, the [height](ui.iggrid#options:height) will be set only on the scrolling container, and all other UI elements such as paging footer / filter row / headers will add on top of that, so the total height of the grid will be more than this value - the height of the scroll container (content area) will not be dynamically calculated. Setting this option to false will usually result in a lot better initial rendering performance for large data sets ( > 1000 rows rendered at once, no [virtualization](ui.iggrid#options:virtualization) enabled), since no reflows will be made by browsers when accessing DOM properties such as offsetHeight. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "autoAdjustHeight", optionValue: boolean): void; /** * Used for [row virtualization](ui.iggrid#options:rowVirtualization) in [fixed mode](ui.iggrid#options:virtualizationMode). This is the average value in pixels (default) that will be used to calculate how many rows to render as the end user scrolls. Also all rows' height will be automatically set to this value. + * */ igGrid(optionLiteral: 'option', optionName: "avgRowHeight"): string|number; @@ -43249,6 +50413,7 @@ interface JQuery { /** * Used for [row virtualization](ui.iggrid#options:rowVirtualization) in [fixed mode](ui.iggrid#options:virtualizationMode). This is the average value in pixels (default) that will be used to calculate how many rows to render as the end user scrolls. Also all rows' height will be automatically set to this value. * + * * @optionValue New value to be set. */ @@ -43256,6 +50421,7 @@ interface JQuery { /** * Used for [column virtualization](ui.iggrid#options:columnVirtualization) in [fixed mode](ui.iggrid#options:virtualizationMode). This is the average value in pixels for a column width. + * */ igGrid(optionLiteral: 'option', optionName: "avgColumnWidth"): string|number; @@ -43263,19 +50429,22 @@ interface JQuery { /** * Used for [column virtualization](ui.iggrid#options:columnVirtualization) in [fixed mode](ui.iggrid#options:virtualizationMode). This is the average value in pixels for a column width. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "avgColumnWidth", optionValue: string|number): void; /** - * Default column width that will be set for all columns, that don't have [column width](ui.iggrid#options:columns.width) defined. + * Default column width that will be set for all columns, that don't have [column width](ui.iggrid#options:columns.width) defined. Can also be set as '*', in which case the width auto-size based on the content of the column cells (including the header text). + * */ igGrid(optionLiteral: 'option', optionName: "defaultColumnWidth"): string|number; /** - * Default column width that will be set for all columns, that don't have [column width](ui.iggrid#options:columns.width) defined. + * Default column width that will be set for all columns, that don't have [column width](ui.iggrid#options:columns.width) defined. Can also be set as '*', in which case the width auto-size based on the content of the column cells (including the header text). + * * * @optionValue New value to be set. */ @@ -43286,6 +50455,7 @@ interface JQuery { * If no [columns](ui.iggrid#options:columns) collection is defined, and autoGenerateColumns is set to true, [columns](ui.iggrid#options:columns) will be inferred from the data source before the [dataRendering](ui.iggrid#events:dataRendering) event is fired. The inferred [columns](ui.iggrid#options:columns) collection will be available to the developer for modification at [dataRendering](ui.iggrid#events:dataRendering). If autoGenerateColumns is not explicitly set and [columns](ui.iggrid#options:columns) has at least one column defined then autoGenerateColumns is automatically set to false. * If autoGenerateColumns is true and there are columns defined auto-generated columns will render after the explicitly defined ones. * Since auto-generated columns don't have width defined consider setting [defaultColumnWidth](ui.iggrid#options:defaultColumnWidth) as well. + * */ igGrid(optionLiteral: 'option', optionName: "autoGenerateColumns"): boolean; @@ -43294,24 +50464,28 @@ interface JQuery { * If autoGenerateColumns is true and there are columns defined auto-generated columns will render after the explicitly defined ones. * Since auto-generated columns don't have width defined consider setting [defaultColumnWidth](ui.iggrid#options:defaultColumnWidth) as well. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "autoGenerateColumns", optionValue: boolean): void; /** * Enables/disables column and row virtualization at the same time. Virtualization can greatly enhance rendering performance. If enabled, the number of actual rendered rows (DOM elements) will be constant and related to the visible viewport of the grid. As the end user scrolls, those DOM elements will be dynamically reused to render the new data. [Here you can find more info about the performance guidelines when using the igGrid](http://www.igniteui.com/help/iggrid-performance-guide) + * */ igGrid(optionLiteral: 'option', optionName: "virtualization"): boolean; /** * Enables/disables column and row virtualization at the same time. Virtualization can greatly enhance rendering performance. If enabled, the number of actual rendered rows (DOM elements) will be constant and related to the visible viewport of the grid. As the end user scrolls, those DOM elements will be dynamically reused to render the new data. [Here you can find more info about the performance guidelines when using the igGrid](http://www.igniteui.com/help/iggrid-performance-guide) * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "virtualization", optionValue: boolean): void; /** * Determines row virtualization mode. + * */ igGrid(optionLiteral: 'option', optionName: "virtualizationMode"): string; @@ -43319,6 +50493,7 @@ interface JQuery { /** * Determines row virtualization mode. * + * * @optionValue New value to be set. */ @@ -43326,54 +50501,63 @@ interface JQuery { /** * Enables virtualization for rows only. [Here you can find more info about igGrid row virtualization](http://www.igniteui.com/help/iggrid-virtualization-overview) + * */ igGrid(optionLiteral: 'option', optionName: "rowVirtualization"): boolean; /** * Enables virtualization for rows only. [Here you can find more info about igGrid row virtualization](http://www.igniteui.com/help/iggrid-virtualization-overview) * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "rowVirtualization", optionValue: boolean): void; /** * Enables virtualization for columns only. Column virtualization can work only in combination with fixed row virtalization. Setting columnVirtualization to true will automatically set [virtualization](ui.iggrid#options:virtualization) to true and [virtualizationMode](ui.iggrid#options:virtualizationMode) to "fixed". + * */ igGrid(optionLiteral: 'option', optionName: "columnVirtualization"): boolean; /** * Enables virtualization for columns only. Column virtualization can work only in combination with fixed row virtalization. Setting columnVirtualization to true will automatically set [virtualization](ui.iggrid#options:virtualization) to true and [virtualizationMode](ui.iggrid#options:virtualizationMode) to "fixed". * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "columnVirtualization", optionValue: boolean): void; /** * Number of pixels to scroll the grid by, when virtualization is enabled, and mouse wheel scrolling is performed over the virtual grid area. If "null" the step will be equal to the [avgRowHeight](ui.iggrid#options:avgRowHeight). + * */ igGrid(optionLiteral: 'option', optionName: "virtualizationMouseWheelStep"): number; /** * Number of pixels to scroll the grid by, when virtualization is enabled, and mouse wheel scrolling is performed over the virtual grid area. If "null" the step will be equal to the [avgRowHeight](ui.iggrid#options:avgRowHeight). * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "virtualizationMouseWheelStep", optionValue: number): void; /** * If this option is set to true, the height of the grid row will be calculated automatically based on the [avgRowHeight](ui.iggrid#options:avgRowHeight) and the visible virtual records. If no [avgRowHeight](ui.iggrid#options:avgRowHeight) is specified, it will be calculated automatically at runtime. + * */ igGrid(optionLiteral: 'option', optionName: "adjustVirtualHeights"): boolean; /** * If this option is set to true, the height of the grid row will be calculated automatically based on the [avgRowHeight](ui.iggrid#options:avgRowHeight) and the visible virtual records. If no [avgRowHeight](ui.iggrid#options:avgRowHeight) is specified, it will be calculated automatically at runtime. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "adjustVirtualHeights", optionValue: boolean): void; /** * The templating engine that will be used to render the grid [column templates](ui.iggrid#options:columns.template). [Here you can find](http://www.infragistics.com/community/blogs/marina_stoyanova/archive/2014/05/30/using-different-template-engines-with-ignite-ui-controls.aspx) how to use templating engines other than igTemplating and jsRender. + * */ igGrid(optionLiteral: 'option', optionName: "templatingEngine"): string; @@ -43381,6 +50565,7 @@ interface JQuery { /** * The templating engine that will be used to render the grid [column templates](ui.iggrid#options:columns.template). [Here you can find](http://www.infragistics.com/community/blogs/marina_stoyanova/archive/2014/05/30/using-different-template-engines-with-ignite-ui-controls.aspx) how to use templating engines other than igTemplating and jsRender. * + * * @optionValue New value to be set. */ @@ -43388,18 +50573,21 @@ interface JQuery { /** * An array of column objects. Checkout the [Columns and Layout](http://www.igniteui.com/help/iggrid-columns-and-layout#defining-columns) topic for details on configuring the columns array. + * */ igGrid(optionLiteral: 'option', optionName: "columns"): IgGridColumn[]; /** * An array of column objects. Checkout the [Columns and Layout](http://www.igniteui.com/help/iggrid-columns-and-layout#defining-columns) topic for details on configuring the columns array. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "columns", optionValue: IgGridColumn[]): void; /** * Can be any valid data source accepted by [$.ig.DataSource](ig.datasource), or an instance of an $.ig.DataSource itself + * */ igGrid(optionLiteral: 'option', optionName: "dataSource"): Array|Object|string; @@ -43407,6 +50595,7 @@ interface JQuery { /** * Can be any valid data source accepted by [$.ig.DataSource](ig.datasource), or an instance of an $.ig.DataSource itself * + * * @optionValue New value to be set. */ @@ -43414,47 +50603,53 @@ interface JQuery { /** * Gets a remote URL as a data source, from which data will be retrieved using the [$.ig.DataSource](ig.datasource). + * */ igGrid(optionLiteral: 'option', optionName: "dataSourceUrl"): string; /** * Sets a remote URL as a data source, from which data will be retrieved using the [$.ig.DataSource](ig.datasource). * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "dataSourceUrl", optionValue: string): void; /** * Explicitly set data source type (such as "json"). Please refer to the documentation of [$.ig.DataSource type](ig.datasource#options:settings.type). + * */ igGrid(optionLiteral: 'option', optionName: "dataSourceType"): string; /** * Explicitly set data source type (such as "json"). Please refer to the documentation of [$.ig.DataSource type](ig.datasource#options:settings.type). * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "dataSourceType", optionValue: string): void; /** * See [$.ig.DataSource responseDataKey](ig.datasource#options:settings.responseDataKey). This is the property in the responses where data records are held, if the response is wrapped. + * */ igGrid(optionLiteral: 'option', optionName: "responseDataKey"): string; /** * See [$.ig.DataSource responseDataKey](ig.datasource#options:settings.responseDataKey). This is the property in the responses where data records are held, if the response is wrapped. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "responseDataKey", optionValue: string): void; /** - * See [$.ig.DataSource responseTotalRecCountKey](ig.datasource#options:settings.responseTotalRecCountKey). Property in the response specifying the total number of records on the server. + * This option has been deprecated. See [$.ig.DataSource responseTotalRecCountKey](ig.datasource#options:settings.responseTotalRecCountKey). Property in the response specifying the total number of records on the server. */ igGrid(optionLiteral: 'option', optionName: "responseTotalRecCountKey"): string; /** - * See [$.ig.DataSource responseTotalRecCountKey](ig.datasource#options:settings.responseTotalRecCountKey). Property in the response specifying the total number of records on the server. + * This option has been deprecated. See [$.ig.DataSource responseTotalRecCountKey](ig.datasource#options:settings.responseTotalRecCountKey). Property in the response specifying the total number of records on the server. * * @optionValue New value to be set. */ @@ -43462,156 +50657,182 @@ interface JQuery { /** * Gets the HTTP verb to be used to issue the requests to a remote data source. + * */ igGrid(optionLiteral: 'option', optionName: "requestType"): string; /** * Sets the HTTP verb to be used to issue the requests to a remote data source. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "requestType", optionValue: string): void; /** * Content type of the response. See http://api.jquery.com/jQuery.ajax/ => contentType + * */ igGrid(optionLiteral: 'option', optionName: "responseContentType"): string; /** * Content type of the response. See http://api.jquery.com/jQuery.ajax/ => contentType * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "responseContentType", optionValue: string): void; /** * Controls the visibility of the grid header. + * */ igGrid(optionLiteral: 'option', optionName: "showHeader"): boolean; /** * Controls the visibility of the grid header. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "showHeader", optionValue: boolean): void; /** * Controls the visibility of the grid footer. + * */ igGrid(optionLiteral: 'option', optionName: "showFooter"): boolean; /** * Controls the visibility of the grid footer. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "showFooter", optionValue: boolean): void; /** * Headers will be fixed if this option is set to true, and only the grid data will be scrollable. If [virtualization](ui.iggrid#options:virtualization) is enabled, fixedHeaders will always act as if it's true, no matter which value is set. + * */ igGrid(optionLiteral: 'option', optionName: "fixedHeaders"): boolean; /** * Headers will be fixed if this option is set to true, and only the grid data will be scrollable. If [virtualization](ui.iggrid#options:virtualization) is enabled, fixedHeaders will always act as if it's true, no matter which value is set. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "fixedHeaders", optionValue: boolean): void; /** * Footers will be fixed if this option is set to true, and only the grid data will be scrollable. If [virtualization](ui.iggrid#options:virtualization) is enabled, fixedFooters will always act as if it's true, no matter which value is set. + * */ igGrid(optionLiteral: 'option', optionName: "fixedFooters"): boolean; /** * Footers will be fixed if this option is set to true, and only the grid data will be scrollable. If [virtualization](ui.iggrid#options:virtualization) is enabled, fixedFooters will always act as if it's true, no matter which value is set. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "fixedFooters", optionValue: boolean): void; /** * Caption text that will be shown above the grid header. + * */ igGrid(optionLiteral: 'option', optionName: "caption"): string; /** * Caption text that will be shown above the grid header. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "caption", optionValue: string): void; /** * List of grid feature definitions: sorting, paging, etc. Each feature goes with its separate options that are documented for the feature accordingly. [Here you can find detailed documentation for all igGrid features](http://www.igniteui.com/help/iggrid-features-landing-page) + * */ igGrid(optionLiteral: 'option', optionName: "features"): IgGridFeature[]; /** * List of grid feature definitions: sorting, paging, etc. Each feature goes with its separate options that are documented for the feature accordingly. [Here you can find detailed documentation for all igGrid features](http://www.igniteui.com/help/iggrid-features-landing-page) * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "features", optionValue: IgGridFeature[]): void; /** * Initial tabIndex attribute that will be set on all focusable elements. + * */ igGrid(optionLiteral: 'option', optionName: "tabIndex"): number; /** * Initial tabIndex attribute that will be set on all focusable elements. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "tabIndex", optionValue: number): void; /** * If this option is set to false, the data to which the grid is bound will be used "as is" with no additional transformations based on [columns](ui.iggrid#options:columns) defined. Otherwise only the subset of data properties used in the [columns](ui.iggrid#options:columns) defined will be extracted in a new object and used. + * */ igGrid(optionLiteral: 'option', optionName: "localSchemaTransform"): boolean; /** * If this option is set to false, the data to which the grid is bound will be used "as is" with no additional transformations based on [columns](ui.iggrid#options:columns) defined. Otherwise only the subset of data properties used in the [columns](ui.iggrid#options:columns) defined will be extracted in a new object and used. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "localSchemaTransform", optionValue: boolean): void; /** * Key of the column containing unique identifiers for the data records. + * */ igGrid(optionLiteral: 'option', optionName: "primaryKey"): string; /** * Key of the column containing unique identifiers for the data records. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "primaryKey", optionValue: string): void; /** * If true, the transaction log will always be sent in the request for remote data, by the data source. Also this means that if there are values in the log, a POST will be performed instead of GET. + * */ igGrid(optionLiteral: 'option', optionName: "serializeTransactionLog"): boolean; /** * If true, the transaction log will always be sent in the request for remote data, by the data source. Also this means that if there are values in the log, a POST will be performed instead of GET. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "serializeTransactionLog", optionValue: boolean): void; /** * Automatically commits the transactions as rows/cells are being edited to the client data source. A [saveChanges](ui.iggrid#methods:saveChanges) call still needs to be performed in order to commit the transactions to a server-side data source. + * */ igGrid(optionLiteral: 'option', optionName: "autoCommit"): boolean; /** * Automatically commits the transactions as rows/cells are being edited to the client data source. A [saveChanges](ui.iggrid#methods:saveChanges) call still needs to be performed in order to commit the transactions to a server-side data source. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "autoCommit", optionValue: boolean): void; @@ -43622,6 +50843,7 @@ interface JQuery { * If a new row is added, edited, then deleted, there will be no transaction added to the log. * If several edits are made to a row or an individual cell, this should result in a single transaction. * Note: This option takes effect only when [autoCommit](ui.iggrid#options:autoCommit) is set to false. + * */ igGrid(optionLiteral: 'option', optionName: "aggregateTransactions"): boolean; @@ -43632,12 +50854,14 @@ interface JQuery { * If several edits are made to a row or an individual cell, this should result in a single transaction. * Note: This option takes effect only when [autoCommit](ui.iggrid#options:autoCommit) is set to false. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "aggregateTransactions", optionValue: boolean): void; /** * Sets gets ability to automatically format text in cells for numeric and date columns. The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) + * */ igGrid(optionLiteral: 'option', optionName: "autoFormat"): string|boolean; @@ -43645,6 +50869,7 @@ interface JQuery { /** * Sets gets ability to automatically format text in cells for numeric and date columns. The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) * + * * @optionValue New value to be set. */ @@ -43652,84 +50877,98 @@ interface JQuery { /** * Gets ability to render checkboxes and use checkbox editor when dataType of a column is "bool". Checkboxes are not rendered for boolean values in columns with a [column template](ui.iggrid#options:columns.template). + * */ igGrid(optionLiteral: 'option', optionName: "renderCheckboxes"): boolean; /** * Sets ability to render checkboxes and use checkbox editor when dataType of a column is "bool". Checkboxes are not rendered for boolean values in columns with a [column template](ui.iggrid#options:columns.template). * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "renderCheckboxes", optionValue: boolean): void; /** * URL to which updating requests will be made. + * */ igGrid(optionLiteral: 'option', optionName: "updateUrl"): string; /** * URL to which updating requests will be made. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "updateUrl", optionValue: string): void; /** * Settings related to REST compliant update routines. + * */ igGrid(optionLiteral: 'option', optionName: "restSettings"): IgGridRestSettings; /** * Settings related to REST compliant update routines. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "restSettings", optionValue: IgGridRestSettings): void; /** * Enables/disables rendering of alternating row styles (odd and even rows receive different styling). + * */ igGrid(optionLiteral: 'option', optionName: "alternateRowStyles"): boolean; /** * Enables/disables rendering of alternating row styles (odd and even rows receive different styling). * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "alternateRowStyles", optionValue: boolean): void; /** * If set to true and all columns' widths are specified and their combined width is less than the grid width then the last column width will be automatically adjusted to fill the remaining empty space of the grid. + * */ igGrid(optionLiteral: 'option', optionName: "autofitLastColumn"): boolean; /** * If set to true and all columns' widths are specified and their combined width is less than the grid width then the last column width will be automatically adjusted to fill the remaining empty space of the grid. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "autofitLastColumn", optionValue: boolean): void; /** * Enables/disables rendering of hover styles when the mouse is over a record. This can be useful in templating scenarios, for example, where we don't want to apply hover styling to templated content. + * */ igGrid(optionLiteral: 'option', optionName: "enableHoverStyles"): boolean; /** * Enables/disables rendering of hover styles when the mouse is over a record. This can be useful in templating scenarios, for example, where we don't want to apply hover styling to templated content. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "enableHoverStyles", optionValue: boolean): void; /** * Enables/Disables serializing client date as UTC ISO 8061 string instead of using the local time and zone values. + * */ igGrid(optionLiteral: 'option', optionName: "enableUTCDates"): boolean; /** * Enables/Disables serializing client date as UTC ISO 8061 string instead of using the local time and zone values. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "enableUTCDates", optionValue: boolean): void; @@ -43737,6 +50976,7 @@ interface JQuery { /** * Merge unbound columns values inside data source when data source is remote. If true then the unbound columns are merged to the data source at runtime on the server. Note that data source is expanded with the new data and this could cause performance issues when the data is huge. If mergeUnboundColumns is false then the unbound data is sent and merged on the client. This option is used by the [igGrid MVC Helper](http://www.igniteui.com/help/iggrid-developing-asp-net-mvc-applications-with-iggrid). * Checkout [Populating Unbound Columns Remotely (igGrid)](http://www.igniteui.com/help/iggrid-unboundcolumns-populating-with-data-remotely) topic for more information. + * */ igGrid(optionLiteral: 'option', optionName: "mergeUnboundColumns"): boolean; @@ -43744,36 +50984,42 @@ interface JQuery { * Merge unbound columns values inside data source when data source is remote. If true then the unbound columns are merged to the data source at runtime on the server. Note that data source is expanded with the new data and this could cause performance issues when the data is huge. If mergeUnboundColumns is false then the unbound data is sent and merged on the client. This option is used by the [igGrid MVC Helper](http://www.igniteui.com/help/iggrid-developing-asp-net-mvc-applications-with-iggrid). * Checkout [Populating Unbound Columns Remotely (igGrid)](http://www.igniteui.com/help/iggrid-unboundcolumns-populating-with-data-remotely) topic for more information. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "mergeUnboundColumns", optionValue: boolean): void; /** * When dataSource is a remote URL, defines whether to set the type of the remote data source to JSONP. + * */ igGrid(optionLiteral: 'option', optionName: "jsonpRequest"): boolean; /** * When dataSource is a remote URL, defines whether to set the type of the remote data source to JSONP. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "jsonpRequest", optionValue: boolean): void; /** * Enables/disables grid adjusting its dimensions when its [width](ui.iggrid#options:width) and/or [height](ui.iggrid#options:height) is set in percent (%) and grid parent DOM container is resized. + * */ igGrid(optionLiteral: 'option', optionName: "enableResizeContainerCheck"): boolean; /** * Enables/disables grid adjusting its dimensions when its [width](ui.iggrid#options:width) and/or [height](ui.iggrid#options:height) is set in percent (%) and grid parent DOM container is resized. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "enableResizeContainerCheck", optionValue: boolean): void; /** * Configures how the feature chooser icon should display on header cells - e.g. to display as gear icon or not. + * */ igGrid(optionLiteral: 'option', optionName: "featureChooserIconDisplay"): string; @@ -43781,6 +51027,7 @@ interface JQuery { /** * Configures how the feature chooser icon should display on header cells - e.g. to display as gear icon or not. * + * * @optionValue New value to be set. */ @@ -43788,16 +51035,48 @@ interface JQuery { /** * Settings related to content scrolling. + * */ igGrid(optionLiteral: 'option', optionName: "scrollSettings"): IgGridScrollSettings; /** * Settings related to content scrolling. * + * * @optionValue New value to be set. */ igGrid(optionLiteral: 'option', optionName: "scrollSettings", optionValue: IgGridScrollSettings): void; + /** + * Set/Get the locale language setting for the widget. + * + */ + igGrid(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igGrid(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igGrid(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igGrid(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event fired when a cell is clicked. */ @@ -44111,16 +51390,19 @@ interface IgGridGroupByGroupedColumn { /** * sort order - ascending or descending + * */ dir?: any; /** * Key of the columnLayout, if the grid is hierarchical + * */ layout?: string; /** * [column](ui.iggrid#options:columns) object for the column that is grouped + * */ col?: any; @@ -44133,11 +51415,13 @@ interface IgGridGroupByGroupedColumn { interface IgGridGroupBySummarySettings { /** * Specifies the delimiter for multiple summaries. + * */ multiSummaryDelimiter?: string; /** * Format of the summary value. By default, two digits are shown after the decimal place. Checkout [Formatting Dates, Numbers and Strings](http://www.igniteui.com/help/formatting-dates-numbers-and-strings) for details on the valid formatting specifiers. + * */ summaryFormat?: string; @@ -44151,6 +51435,7 @@ interface IgGridGroupByColumnSettingsSummaries { /** * the summary function key * + * * Valid values: * "avg" average summary function * "min" minimum summary function @@ -44163,6 +51448,7 @@ interface IgGridGroupByColumnSettingsSummaries { /** * Specifies the summary text that will be shown before the value + * */ text?: string; @@ -44173,6 +51459,7 @@ interface IgGridGroupByColumnSettingsSummaries { * key - key of the grouped column, * allGroupData - array of data records for the group(for the whole data source - not only for the data view) * + * * Valid values: * "string" the name of the function as a string located in the global window object. * "function" which will be used for calculating the summary value. @@ -44188,11 +51475,13 @@ interface IgGridGroupByColumnSettingsSummaries { interface IgGridGroupByColumnSettings { /** * Enables/disables grouping a column from the UI. By default all columns can be grouped. + * */ allowGrouping?: boolean; /** * Specifies the initial column grouped state. + * */ isGroupBy?: boolean; @@ -44207,6 +51496,7 @@ interface IgGridGroupByColumnSettings { * 1 - indicating that val1 > val2 * -1 - indicating that val1 < val2 * + * * Valid values: * "string" the name of the function as a string located in the global window object. * "function" function which will be used for custom comparison. @@ -44221,6 +51511,7 @@ interface IgGridGroupByColumnSettings { /** * Reference/name of a function (string or function) which will be used for formatting the cell values. The function should accept a value from the grouped column and return the new formatted value in the label of the row. * + * * Valid values: * "string" the name of the function as a string located in the global window object. * "function" which will be used for formatting the cell values. @@ -44229,16 +51520,19 @@ interface IgGridGroupByColumnSettings { /** * Specifies the sort order - ascending or descending when the column is initially grouped ([isGroupBy](ui.iggridgroupby#options:columnSettings.isGroupBy) = true). + * */ dir?: any; /** * A list of aggregation functions to calculate on the column values for each group. When not specified the default aggregate function is "count". + * */ summaries?: IgGridGroupByColumnSettingsSummaries; /** * Enables/disables default summaries per group data island or specifies summaries that are applied to specific column no matter the group. + * */ groupSummaries?: any; @@ -44251,96 +51545,115 @@ interface IgGridGroupByColumnSettings { interface IgGridGroupByLocale { /** * Specifies the group by area text. + * */ emptyGroupByAreaContent?: string; /** * Specifies the text for the hyperlink which opens the GroupBy Dialog. + * */ emptyGroupByAreaContentSelectColumns?: string; /** * Specifies the caption for the hyperlink which opens the GroupBy Dialog. + * */ emptyGroupByAreaContentSelectColumnsCaption?: string; /** * Specifies the expand groups button tooltip. + * */ expandTooltip?: string; /** * Specifies the collapse groups button tooltip. + * */ collapseTooltip?: string; /** * Specifies the remove group button tooltip. + * */ removeButtonTooltip?: string; /** * Specifies caption for each descending sorted column in GroupBy Dialog. + * */ modalDialogCaptionButtonDesc?: string; /** * Specifies caption for each descending sorted column in GroupBy Dialog. + * */ modalDialogCaptionButtonAsc?: string; /** * Specifies caption for ungroup button in GroupBy Dialog. + * */ modalDialogCaptionButtonUngroup?: string; /** * Specifies text for group button in GroupBy Dialog. + * */ modalDialogGroupByButtonText?: string; /** * Specifies caption text for the GroupBy Dialog. + * */ modalDialogCaptionText?: string; /** * Specifies label for layouts dropdown in the GroupBy Dialog. + * */ modalDialogDropDownLabel?: string; /** * Specifies label for "Clear all" button in the GroupBy Dialog. + * */ modalDialogClearAllButtonLabel?: string; /** * Specifies name of the root layout which is shown for the layouts in the modal dialog tree. + * */ modalDialogRootLevelHierarchicalGrid?: string; /** * Specifies caption of layouts dropdown button in the GroupBy Dialog. + * */ modalDialogDropDownButtonCaption?: string; /** * Specifies text of button which apply changes in modal dialog. + * */ modalDialogButtonApplyText?: string; /** * Specifies text of button which cancel changes in modal dialog. + * */ modalDialogButtonCancelText?: string; /** * Specifies the summary row title. + * */ summaryRowTitle?: string; /** * Specifies the summary icon title. + * */ summaryIconTitle?: string; @@ -44720,6 +52033,7 @@ interface IgGridGroupBy { /** * Sets the place in the grid where the GroupBy area will be * + * * Valid values: * "top" the GroupBy area will be rendered above the grid headers * "hidden" the GroupBy area will not be rendered @@ -44729,12 +52043,14 @@ interface IgGridGroupBy { /** * Specifies if after grouping, the grouped rows will be initially expanded or collapsed. + * */ initialExpand?: boolean; /** * Specifies when paging is applied and there is at least one grouped column which records should be included in page processing. * + * * Valid values: * "allRecords" All records are included in page processing - data records and group-by metadata records * "dataRecordsOnly" Only data records are included in page processing(metadata group-by records are ignored) @@ -44743,27 +52059,32 @@ interface IgGridGroupBy { /** * Specifies if grouped rows will have an expander image that will allow end users to expand and collapse them. This option can be set only at initialization. + * */ expansionIndicatorVisibility?: boolean; /** * By default, the column width for the header is taken. If this is specified it's used for all headers. + * */ groupByLabelWidth?: number; /** * Specifies the opacity of the drag markup, while a column header is being dragged. The value must be between 0 and 1. + * */ labelDragHelperOpacity?: number; /** * Specifies the indentation for a grouped row. If several columns are grouped, the total indentation will grow + * */ indentation?: number; /** * default sort order - ascending or descending * + * * Valid values: * "asc" The group is sorted in ascending order. * "desc" The group is sorted in descending order. @@ -44772,22 +52093,26 @@ interface IgGridGroupBy { /** * Returns the list of currently grouped columns. The option is read-only and cannot be set at initialization or at runtime. + * */ groupedColumns?: IgGridGroupByGroupedColumn[]; /** * Specifies a key to get group by data from the remote response. + * */ resultResponseKey?: string; /** * Template for the grouped row's text. Variables available for the template are ${key}, ${val} and ${count}. + * */ groupedRowTextTemplate?: string; /** * Specifies whether the GroupBy operation takes place locally on client-side or remotely on server-side. * + * * Valid values: * "local" Execute the GroupBy operation locally on client-side. * "remote" Execute the GroupBy operation by a request to the server. @@ -44796,26 +52121,31 @@ interface IgGridGroupBy { /** * URL param name which specifies a GroupBy [expression](ig.datasource#options:settings.sorting.expressions). When groupByUrlKey, [groupByUrlKeyAscValue](ui.iggridgroupby#options:groupByUrlKeyAscValue) and [groupByUrlKeyDescValue](ui.iggridgroupby#options:groupByUrlKeyDescValue) are set the request looks like: ?()= (Example: ?groupby(col1)=asc). Otherwise the OData conventions for sorting params are used. + * */ groupByUrlKey?: string; /** * URL param value denoting ascending grouping. When [groupByUrlKey](ui.iggridgroupby#options:groupByUrlKey), groupByUrlKeyAscValue and [groupByUrlKeyDescValue](ui.iggridgroupby#options:groupByUrlKeyDescValue) are set the request looks like: ?()= (Example: ?groupby(col1)=asc). Otherwise the OData conventions for sorting params are used. + * */ groupByUrlKeyAscValue?: string; /** * URL param value denoting descending grouping. When [groupByUrlKey](ui.iggridgroupby#options:groupByUrlKey), [groupByUrlKeyAscValue](ui.iggridgroupby#options:groupByUrlKeyAscValue) and groupByUrlKeyDescValue are set the request looks like: ?()= (Example: ?groupby(col1)=asc). Otherwise the OData conventions for sorting params are used. + * */ groupByUrlKeyDescValue?: string; /** * Specifies the settings for GroupBy summaries. + * */ summarySettings?: IgGridGroupBySummarySettings; /** * Configures individual column settings. + * */ columnSettings?: IgGridGroupByColumnSettings; @@ -44912,27 +52242,32 @@ interface IgGridGroupBy { /** * Enables/disables immediate column grouping/ungrouping. When false operation is delayed until after "Apply" button is clicked by the user. + * */ modalDialogGroupByOnClick?: boolean; /** * Specifies width of layouts dropdown in the GroupBy Dialog + * */ modalDialogDropDownWidth?: number; /** * Specifies width of layouts dropdown in the GroupBy Dialog + * */ modalDialogDropDownAreaWidth?: number; /** * Specifies time in milliseconds for animation duration to show/hide modal dialog + * */ modalDialogAnimationDuration?: number; /** * Specifies width of the GroupBy Dialog * + * * Valid values: * "string" The dialog width can be set in pixels (px) or percentage (%). Example values: "800px", "800" (defaults to pixels), "100%". * "number" The dialog width can be set in pixels as a number. Example values: 800, 700. @@ -44942,6 +52277,7 @@ interface IgGridGroupBy { /** * Specifies height of the GroupBy Dialog * + * * Valid values: * "string" The dialog height can be set in pixels (px) or percentage (%). Example values: "800px", "800" (defaults to pixels), "100%". * "number" The dialog height can be set in pixels as a number. Example values: 800, 700. @@ -44950,17 +52286,20 @@ interface IgGridGroupBy { /** * Format grouped column using the formatter set in [igGrid.columns.formatter](ui.iggrid#options:columns.formatter) or [igGrid.columns.format](ui.iggrid#options:columns.format). + * */ useGridColumnFormatter?: boolean; /** * Enables / disables GroupBy persistence between states. Checkout the [GroupBy Persistence](http://www.igniteui.com/help/iggrid-groupby-overview#groupBy-persistence) topic for details. + * */ persist?: boolean; /** * Controls containment behavior for the GroupBy Dialog. * + * * Valid values: * "owner" The GroupBy Dialog will be draggable only in the grid area * "window" The GroupBy Dialog will be draggable in the whole window area @@ -44969,6 +52308,7 @@ interface IgGridGroupBy { /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. Checkout the [Extending igGrid Modal Dialog](http://www.igniteui.com/help/extending-iggrid-modal-dialog) topic for details. + * */ dialogWidget?: string; @@ -44980,12 +52320,14 @@ interface IgGridGroupBy { /** * Specifies default summaries that will appear when grouping by a column on the bottom of each group as a row.This option has a lower priority than the groupSummaries defined under columnSettings for each column. * All default summaries are defined under $.ig.util.defaultSummaryMethods + * */ groupSummaries?: any; /** * Specifies the groupSummaries postion inside each group. * + * * Valid values: * "top" One summary row will be displayed at the top for each group * "bottom" One summary row will be displayed at the bottom for each group @@ -44993,6 +52335,18 @@ interface IgGridGroupBy { */ groupSummariesPosition?: string; + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event which is fired when the grouped columns collection is about to change. This event is fired even when button OK is clicked from the modal dialog(after event modalDialogButtonApplyClick is fired) */ @@ -45079,7 +52433,19 @@ interface IgGridGroupBy { [optionName: string]: any; } interface IgGridGroupByMethods { + changeGlobalLanguage(): void; + changeGlobalRegional(): void; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.iggridgroupby#options:language) + * Note that this method is for rare scenarios, see [language](ui.iggridgroupby#options:language) or [locale](ui.iggridgroupby#options:locale) option setter + */ changeLocale(): void; + + /** + * Changes the the regional settings of widget element to the language specified in [options.regional](ui.iggridgroupby#options:regional) + * Note that this method is for rare scenarios, use [regional](ui.iggridgroupby#options:regional) option setter + */ changeRegional(): void; /** @@ -45175,6 +52541,8 @@ interface JQuery { } interface JQuery { + igGridGroupBy(methodName: "changeGlobalLanguage"): void; + igGridGroupBy(methodName: "changeGlobalRegional"): void; igGridGroupBy(methodName: "changeLocale"): void; igGridGroupBy(methodName: "changeRegional"): void; igGridGroupBy(methodName: "openGroupByDialog"): void; @@ -45194,6 +52562,7 @@ interface JQuery { /** * Sets the place in the grid where the GroupBy area will be + * */ igGridGroupBy(optionLiteral: 'option', optionName: "groupByAreaVisibility"): string; @@ -45201,6 +52570,7 @@ interface JQuery { /** * Sets the place in the grid where the GroupBy area will be * + * * @optionValue New value to be set. */ @@ -45208,18 +52578,21 @@ interface JQuery { /** * Gets if after grouping, the grouped rows will be initially expanded or collapsed. + * */ igGridGroupBy(optionLiteral: 'option', optionName: "initialExpand"): boolean; /** * Sets if after grouping, the grouped rows will be initially expanded or collapsed. * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "initialExpand", optionValue: boolean): void; /** * Gets when paging is applied and there is at least one grouped column which records should be included in page processing. + * */ igGridGroupBy(optionLiteral: 'option', optionName: "pagingMode"): string; @@ -45227,6 +52600,7 @@ interface JQuery { /** * Sets when paging is applied and there is at least one grouped column which records should be included in page processing. * + * * @optionValue New value to be set. */ @@ -45234,54 +52608,63 @@ interface JQuery { /** * Gets if grouped rows will have an expander image that will allow end users to expand and collapse them. This option can be set only at initialization. + * */ igGridGroupBy(optionLiteral: 'option', optionName: "expansionIndicatorVisibility"): boolean; /** * Sets if grouped rows will have an expander image that will allow end users to expand and collapse them. This option can be set only at initialization. * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "expansionIndicatorVisibility", optionValue: boolean): void; /** * By default, the column width for the header is taken. If this is specified it's used for all headers. + * */ igGridGroupBy(optionLiteral: 'option', optionName: "groupByLabelWidth"): number; /** * By default, the column width for the header is taken. If this is specified it's used for all headers. * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "groupByLabelWidth", optionValue: number): void; /** * Gets the opacity of the drag markup, while a column header is being dragged. The value must be between 0 and 1. + * */ igGridGroupBy(optionLiteral: 'option', optionName: "labelDragHelperOpacity"): number; /** * Sets the opacity of the drag markup, while a column header is being dragged. The value must be between 0 and 1. * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "labelDragHelperOpacity", optionValue: number): void; /** * Specifies the indentation for a grouped row. If several columns are grouped, the total indentation will grow + * */ igGridGroupBy(optionLiteral: 'option', optionName: "indentation"): number; /** * Specifies the indentation for a grouped row. If several columns are grouped, the total indentation will grow * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "indentation", optionValue: number): void; /** * Default sort order - ascending or descending + * */ igGridGroupBy(optionLiteral: 'option', optionName: "defaultSortingDirection"): string; @@ -45289,6 +52672,7 @@ interface JQuery { /** * Default sort order - ascending or descending * + * * @optionValue New value to be set. */ @@ -45296,42 +52680,49 @@ interface JQuery { /** * Returns the list of currently grouped columns. The option is read-only and cannot be set at initialization or at runtime. + * */ igGridGroupBy(optionLiteral: 'option', optionName: "groupedColumns"): IgGridGroupByGroupedColumn[]; /** * Returns the list of currently grouped columns. The option is read-only and cannot be set at initialization or at runtime. * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "groupedColumns", optionValue: IgGridGroupByGroupedColumn[]): void; /** * Gets a key to get group by data from the remote response. + * */ igGridGroupBy(optionLiteral: 'option', optionName: "resultResponseKey"): string; /** * Sets a key to get group by data from the remote response. * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "resultResponseKey", optionValue: string): void; /** * Template for the grouped row's text. Variables available for the template are ${key}, ${val} and ${count}. + * */ igGridGroupBy(optionLiteral: 'option', optionName: "groupedRowTextTemplate"): string; /** * Template for the grouped row's text. Variables available for the template are ${key}, ${val} and ${count}. * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "groupedRowTextTemplate", optionValue: string): void; /** * Gets whether the GroupBy operation takes place locally on client-side or remotely on server-side. + * */ igGridGroupBy(optionLiteral: 'option', optionName: "type"): string; @@ -45339,6 +52730,7 @@ interface JQuery { /** * Sets whether the GroupBy operation takes place locally on client-side or remotely on server-side. * + * * @optionValue New value to be set. */ @@ -45346,60 +52738,70 @@ interface JQuery { /** * URL param name which specifies a GroupBy [expression](ig.datasource#options:settings.sorting.expressions). When groupByUrlKey, [groupByUrlKeyAscValue](ui.iggridgroupby#options:groupByUrlKeyAscValue) and [groupByUrlKeyDescValue](ui.iggridgroupby#options:groupByUrlKeyDescValue) are set the request looks like: ?()= (Example: ?groupby(col1)=asc). Otherwise the OData conventions for sorting params are used. + * */ igGridGroupBy(optionLiteral: 'option', optionName: "groupByUrlKey"): string; /** * URL param name which specifies a GroupBy [expression](ig.datasource#options:settings.sorting.expressions). When groupByUrlKey, [groupByUrlKeyAscValue](ui.iggridgroupby#options:groupByUrlKeyAscValue) and [groupByUrlKeyDescValue](ui.iggridgroupby#options:groupByUrlKeyDescValue) are set the request looks like: ?()= (Example: ?groupby(col1)=asc). Otherwise the OData conventions for sorting params are used. * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "groupByUrlKey", optionValue: string): void; /** * URL param value denoting ascending grouping. When [groupByUrlKey](ui.iggridgroupby#options:groupByUrlKey), groupByUrlKeyAscValue and [groupByUrlKeyDescValue](ui.iggridgroupby#options:groupByUrlKeyDescValue) are set the request looks like: ?()= (Example: ?groupby(col1)=asc). Otherwise the OData conventions for sorting params are used. + * */ igGridGroupBy(optionLiteral: 'option', optionName: "groupByUrlKeyAscValue"): string; /** * URL param value denoting ascending grouping. When [groupByUrlKey](ui.iggridgroupby#options:groupByUrlKey), groupByUrlKeyAscValue and [groupByUrlKeyDescValue](ui.iggridgroupby#options:groupByUrlKeyDescValue) are set the request looks like: ?()= (Example: ?groupby(col1)=asc). Otherwise the OData conventions for sorting params are used. * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "groupByUrlKeyAscValue", optionValue: string): void; /** * URL param value denoting descending grouping. When [groupByUrlKey](ui.iggridgroupby#options:groupByUrlKey), [groupByUrlKeyAscValue](ui.iggridgroupby#options:groupByUrlKeyAscValue) and groupByUrlKeyDescValue are set the request looks like: ?()= (Example: ?groupby(col1)=asc). Otherwise the OData conventions for sorting params are used. + * */ igGridGroupBy(optionLiteral: 'option', optionName: "groupByUrlKeyDescValue"): string; /** * URL param value denoting descending grouping. When [groupByUrlKey](ui.iggridgroupby#options:groupByUrlKey), [groupByUrlKeyAscValue](ui.iggridgroupby#options:groupByUrlKeyAscValue) and groupByUrlKeyDescValue are set the request looks like: ?()= (Example: ?groupby(col1)=asc). Otherwise the OData conventions for sorting params are used. * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "groupByUrlKeyDescValue", optionValue: string): void; /** * Gets the settings for GroupBy summaries. + * */ igGridGroupBy(optionLiteral: 'option', optionName: "summarySettings"): IgGridGroupBySummarySettings; /** * Sets the settings for GroupBy summaries. * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "summarySettings", optionValue: IgGridGroupBySummarySettings): void; /** * Configures individual column settings. + * */ igGridGroupBy(optionLiteral: 'option', optionName: "columnSettings"): IgGridGroupByColumnSettings; /** * Configures individual column settings. * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "columnSettings", optionValue: IgGridGroupByColumnSettings): void; @@ -45618,54 +53020,63 @@ interface JQuery { /** * Enables/disables immediate column grouping/ungrouping. When false operation is delayed until after "Apply" button is clicked by the user. + * */ igGridGroupBy(optionLiteral: 'option', optionName: "modalDialogGroupByOnClick"): boolean; /** * Enables/disables immediate column grouping/ungrouping. When false operation is delayed until after "Apply" button is clicked by the user. * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "modalDialogGroupByOnClick", optionValue: boolean): void; /** * Gets width of layouts dropdown in the GroupBy Dialog + * */ igGridGroupBy(optionLiteral: 'option', optionName: "modalDialogDropDownWidth"): number; /** * Sets width of layouts dropdown in the GroupBy Dialog * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "modalDialogDropDownWidth", optionValue: number): void; /** * Gets width of layouts dropdown in the GroupBy Dialog + * */ igGridGroupBy(optionLiteral: 'option', optionName: "modalDialogDropDownAreaWidth"): number; /** * Sets width of layouts dropdown in the GroupBy Dialog * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "modalDialogDropDownAreaWidth", optionValue: number): void; /** * Gets time in milliseconds for animation duration to show/hide modal dialog + * */ igGridGroupBy(optionLiteral: 'option', optionName: "modalDialogAnimationDuration"): number; /** * Sets time in milliseconds for animation duration to show/hide modal dialog * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "modalDialogAnimationDuration", optionValue: number): void; /** * Gets width of the GroupBy Dialog + * */ igGridGroupBy(optionLiteral: 'option', optionName: "modalDialogWidth"): string|number; @@ -45673,6 +53084,7 @@ interface JQuery { /** * Sets width of the GroupBy Dialog * + * * @optionValue New value to be set. */ @@ -45680,6 +53092,7 @@ interface JQuery { /** * Gets height of the GroupBy Dialog + * */ igGridGroupBy(optionLiteral: 'option', optionName: "modalDialogHeight"): string|number; @@ -45687,6 +53100,7 @@ interface JQuery { /** * Sets height of the GroupBy Dialog * + * * @optionValue New value to be set. */ @@ -45694,30 +53108,35 @@ interface JQuery { /** * Format grouped column using the formatter set in [igGrid.columns.formatter](ui.iggrid#options:columns.formatter) or [igGrid.columns.format](ui.iggrid#options:columns.format). + * */ igGridGroupBy(optionLiteral: 'option', optionName: "useGridColumnFormatter"): boolean; /** * Format grouped column using the formatter set in [igGrid.columns.formatter](ui.iggrid#options:columns.formatter) or [igGrid.columns.format](ui.iggrid#options:columns.format). * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "useGridColumnFormatter", optionValue: boolean): void; /** * Enables / disables GroupBy persistence between states. Checkout the [GroupBy Persistence](http://www.igniteui.com/help/iggrid-groupby-overview#groupBy-persistence) topic for details. + * */ igGridGroupBy(optionLiteral: 'option', optionName: "persist"): boolean; /** * Enables / disables GroupBy persistence between states. Checkout the [GroupBy Persistence](http://www.igniteui.com/help/iggrid-groupby-overview#groupBy-persistence) topic for details. * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "persist", optionValue: boolean): void; /** * Controls containment behavior for the GroupBy Dialog. + * */ igGridGroupBy(optionLiteral: 'option', optionName: "groupByDialogContainment"): string; @@ -45725,6 +53144,7 @@ interface JQuery { /** * Controls containment behavior for the GroupBy Dialog. * + * * @optionValue New value to be set. */ @@ -45732,12 +53152,14 @@ interface JQuery { /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. Checkout the [Extending igGrid Modal Dialog](http://www.igniteui.com/help/extending-iggrid-modal-dialog) topic for details. + * */ igGridGroupBy(optionLiteral: 'option', optionName: "dialogWidget"): string; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. Checkout the [Extending igGrid Modal Dialog](http://www.igniteui.com/help/extending-iggrid-modal-dialog) topic for details. * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "dialogWidget", optionValue: string): void; @@ -45757,6 +53179,7 @@ interface JQuery { /** * Gets default summaries that will appear when grouping by a column on the bottom of each group as a row.This option has a lower priority than the groupSummaries defined under columnSettings for each column. * All default summaries are defined under $.ig.util.defaultSummaryMethods + * */ igGridGroupBy(optionLiteral: 'option', optionName: "groupSummaries"): any; @@ -45764,12 +53187,14 @@ interface JQuery { * Sets default summaries that will appear when grouping by a column on the bottom of each group as a row.This option has a lower priority than the groupSummaries defined under columnSettings for each column. * All default summaries are defined under $.ig.util.defaultSummaryMethods * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "groupSummaries", optionValue: any): void; /** * Gets the groupSummaries postion inside each group. + * */ igGridGroupBy(optionLiteral: 'option', optionName: "groupSummariesPosition"): string; @@ -45777,11 +53202,42 @@ interface JQuery { /** * Sets the groupSummaries postion inside each group. * + * * @optionValue New value to be set. */ igGridGroupBy(optionLiteral: 'option', optionName: "groupSummariesPosition", optionValue: string): void; + /** + * Set/Get the locale language setting for the widget. + * + */ + igGridGroupBy(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igGridGroupBy(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igGridGroupBy(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igGridGroupBy(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event which is fired when the grouped columns collection is about to change. This event is fired even when button OK is clicked from the modal dialog(after event modalDialogButtonApplyClick is fired) */ @@ -45982,21 +53438,25 @@ interface JQuery { interface IgGridHidingColumnSetting { /** * Column key. this is a required property in every column setting if columnIndex is not set. + * */ columnKey?: string; /** * Column index. Can be used in place of column key. the preferred way of populating a column setting is to always use the column keys as identifiers. + * */ columnIndex?: number; /** * Allows the column to be hidden. + * */ allowHiding?: boolean; /** * Sets the initial visibility of the column. + * */ hidden?: boolean; @@ -46009,56 +53469,67 @@ interface IgGridHidingColumnSetting { interface IgGridHidingLocale { /** * The text used in the drop down tools menu(Feature Chooser) to launch the column chooser dialog. + * */ columnChooserDisplayText?: string; /** * The text displayed in the tooltip of the hidden column indicator. + * */ hiddenColumnIndicatorTooltipText?: string; /** * The text used in the drop down tools menu(Feature Chooser) to hide a column. + * */ columnHideText?: string; /** * The caption of the column chooser dialog. + * */ columnChooserCaptionLabel?: string; /** * The close button tooltip of the column chooser dialog. + * */ columnChooserCloseButtonTooltip?: string; /** * Specifies the hiding column icon tooltip. + * */ hideColumnIconTooltip?: string; /** * The text used in the column chooser to show column. + * */ columnChooserShowText?: string; /** * The text used in the column chooser to hide column. + * */ columnChooserHideText?: string; /** * Text label for reset button. + * */ columnChooserResetButtonLabel?: string; /** * Specifies the text of the button which applies changes in the modal dialog. + * */ columnChooserButtonApplyText?: string; /** * Specifies the text of the button which cancels changes in the modal dialog. + * */ columnChooserButtonCancelText?: string; @@ -46367,11 +53838,13 @@ interface ColumnChooserButtonResetClickEventUIParam { interface IgGridHiding { /** * A list of column settings that specifies hiding options on a per column basis. + * */ columnSettings?: IgGridHidingColumnSetting[]; /** * The width in pixels of the hidden column indicator in the header. + * */ hiddenColumnIndicatorHeaderWidth?: number; @@ -46385,16 +53858,19 @@ interface IgGridHiding { /** * The default column chooser width. + * */ columnChooserWidth?: string; /** * The default column chooser height. + * */ columnChooserHeight?: string; /** * The duration of the dropdown animation in milliseconds. + * */ dropDownAnimationDuration?: number; @@ -46455,24 +53931,40 @@ interface IgGridHiding { /** * Specifies on click show/hide directly to be shown/hidden columns. If columnChooserHideOnClick is false then Apply and Cancel Buttons are shown on the bottom of modal dialog. Columns are Shown/Hidden after the Apply button is clicked + * */ columnChooserHideOnClick?: boolean; /** * Specifies time of milliseconds for animation duration to show/hide modal dialog + * */ columnChooserAnimationDuration?: number; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. + * */ dialogWidget?: string; /** * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. + * */ inherit?: boolean; + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event fired before a hiding operation is executed. */ @@ -46559,7 +54051,13 @@ interface IgGridHiding { [optionName: string]: any; } interface IgGridHidingMethods { + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.iggridhiding#options:language) + * Note that this method is for rare scenarios, see [language](ui.iggridhiding#options:language) or [locale](ui.iggridhiding#options:locale) option setter + */ changeLocale(): void; + changeGlobalLanguage(): void; + changeGlobalRegional(): void; /** * Destroys the hiding widget @@ -46638,6 +54136,8 @@ interface JQuery { interface JQuery { igGridHiding(methodName: "changeLocale"): void; + igGridHiding(methodName: "changeGlobalLanguage"): void; + igGridHiding(methodName: "changeGlobalRegional"): void; igGridHiding(methodName: "destroy"): void; igGridHiding(methodName: "showColumnChooser"): void; igGridHiding(methodName: "hideColumnChooser"): void; @@ -46652,24 +54152,28 @@ interface JQuery { /** * A list of column settings that specifies hiding options on a per column basis. + * */ igGridHiding(optionLiteral: 'option', optionName: "columnSettings"): IgGridHidingColumnSetting[]; /** * A list of column settings that specifies hiding options on a per column basis. * + * * @optionValue New value to be set. */ igGridHiding(optionLiteral: 'option', optionName: "columnSettings", optionValue: IgGridHidingColumnSetting[]): void; /** * The width in pixels of the hidden column indicator in the header. + * */ igGridHiding(optionLiteral: 'option', optionName: "hiddenColumnIndicatorHeaderWidth"): number; /** * The width in pixels of the hidden column indicator in the header. * + * * @optionValue New value to be set. */ igGridHiding(optionLiteral: 'option', optionName: "hiddenColumnIndicatorHeaderWidth", optionValue: number): void; @@ -46694,36 +54198,42 @@ interface JQuery { /** * The default column chooser width. + * */ igGridHiding(optionLiteral: 'option', optionName: "columnChooserWidth"): string; /** * The default column chooser width. * + * * @optionValue New value to be set. */ igGridHiding(optionLiteral: 'option', optionName: "columnChooserWidth", optionValue: string): void; /** * The default column chooser height. + * */ igGridHiding(optionLiteral: 'option', optionName: "columnChooserHeight"): string; /** * The default column chooser height. * + * * @optionValue New value to be set. */ igGridHiding(optionLiteral: 'option', optionName: "columnChooserHeight", optionValue: string): void; /** * The duration of the dropdown animation in milliseconds. + * */ igGridHiding(optionLiteral: 'option', optionName: "dropDownAnimationDuration"): number; /** * The duration of the dropdown animation in milliseconds. * + * * @optionValue New value to be set. */ igGridHiding(optionLiteral: 'option', optionName: "dropDownAnimationDuration", optionValue: number): void; @@ -46858,52 +54368,90 @@ interface JQuery { /** * Gets on click show/hide directly to be shown/hidden columns. If columnChooserHideOnClick is false then Apply and Cancel Buttons are shown on the bottom of modal dialog. Columns are Shown/Hidden after the Apply button is clicked + * */ igGridHiding(optionLiteral: 'option', optionName: "columnChooserHideOnClick"): boolean; /** * Sets on click show/hide directly to be shown/hidden columns. If columnChooserHideOnClick is false then Apply and Cancel Buttons are shown on the bottom of modal dialog. Columns are Shown/Hidden after the Apply button is clicked * + * * @optionValue New value to be set. */ igGridHiding(optionLiteral: 'option', optionName: "columnChooserHideOnClick", optionValue: boolean): void; /** * Gets time of milliseconds for animation duration to show/hide modal dialog + * */ igGridHiding(optionLiteral: 'option', optionName: "columnChooserAnimationDuration"): number; /** * Sets time of milliseconds for animation duration to show/hide modal dialog * + * * @optionValue New value to be set. */ igGridHiding(optionLiteral: 'option', optionName: "columnChooserAnimationDuration", optionValue: number): void; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. + * */ igGridHiding(optionLiteral: 'option', optionName: "dialogWidget"): string; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. * + * * @optionValue New value to be set. */ igGridHiding(optionLiteral: 'option', optionName: "dialogWidget", optionValue: string): void; /** * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. + * */ igGridHiding(optionLiteral: 'option', optionName: "inherit"): boolean; /** * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. * + * * @optionValue New value to be set. */ igGridHiding(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + /** + * Set/Get the locale language setting for the widget. + * + */ + igGridHiding(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igGridHiding(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igGridHiding(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igGridHiding(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event fired before a hiding operation is executed. */ @@ -47104,11 +54652,13 @@ interface JQuery { interface IgHierarchicalGridLocale { /** * Specifies the default tooltip applied to an expand column cell, that is currently collapsed. + * */ expandTooltip?: string; /** * Specifies the default tooltip applied to an expand column cell, that is currently expanded. + * */ collapseTooltip?: string; @@ -47143,17 +54693,20 @@ interface IgHierarchicalGridColumnLayout { interface IgHierarchicalGridColumnGroupOptions { /** * Sets whether the group is expanded or collapsed. Applied only if the allowGroupCollapsing is set to true. + * */ expanded?: boolean; /** * Sets whether expansion indicators are visible in the group header. + * */ allowGroupCollapsing?: boolean; /** * Sets when should the group be hidden. Applied only if the allowGroupCollapsing is set to true. * + * * Valid values: * "never" never hide the group * "always" always hide the group @@ -47171,17 +54724,20 @@ interface IgHierarchicalGridColumnGroupOptions { interface IgHierarchicalGridColumn { /** * Header text for the specified column. + * */ headerText?: string; /** * The property in the data source to which the column is bound. Also used to identify the column by, and find specific columns with API methods such as [columnByKey](ui.ighierarchicalgrid#methods:columnByKey). + * */ key?: string; /** * Reference to a function (string or function) which will be used for formatting the cell values. The function should accept a value and return the new formatted value. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) * + * * Valid values: * "string" The name of the function which will be used for formatting the cell values. * "function" Function which will be used for formatting the cell values. The function should accept a value and return the new formatted value. @@ -47202,12 +54758,21 @@ interface IgHierarchicalGridColumn { /** * Data type of the column cell values: string, number, bool, date, object. + * + * + * Valid values: + * "string" The data inside the column is of type string + * "number" The data inside the column is of type number + * "boolean" The data inside the column is of type boolean + * "date" The data inside the column is of type date + * "object" The data inside the column is of type object */ - dataType?: string|number|boolean|Date|Object; + dataType?: string; /** * Width of the column in pixels or percentage. Can also be set as '*', in which case the width auto-size based on the content of the column cells (including the header text).If width is not defined and [defaultColumnWidth](ui.ighierarchicalgrid#options:defaultColumnWidth) is set, it is assumed for all columns. * + * * Valid values: * "string" The column width can be set in pixels (px), percentage (%) or as '*' in order to auto-size based on the cells and header content. * "number" The column width can be set as a number @@ -47216,32 +54781,38 @@ interface IgHierarchicalGridColumn { /** * Initial visibility of the column. A column can be hidden without the Hiding feature being enabled but there will be no UI for unhiding it. Columns can be defined as hidden in the options of the Hiding feature as well and those definitions take precedence. + * */ hidden?: boolean; /** * Sets a template for an individual column. the contents of the template should be the HTML markup that goes inside the table cell, or the entire table cell markup. [Here's an example of creating a basic column template](http://www.igniteui.com/help/creating-a-basic-column-template-in-the-iggrid) + * */ template?: string; /** * Sets whether column data is derived from the datasource. If set to true, then the cells in this column are not bound to the data source. The data in this column is populated using [formula](ui.ighierarchicalgrid#options:columns.formula), or using [unboundValues](ui.ighierarchicalgrid#options:columns.unboundValues), or through the [setUnboundValues](ui.ighierarchicalgrid#methods:setUnboundValues) API method. [Here's an overview of the unbound columns feature](http://www.igniteui.com/help/iggrid-unboundcolumns-overview) + * */ unbound?: boolean; /** * Options used to configure collapsible column [groups](ui.ighierarchicalgrid#options:columns.group). + * */ groupOptions?: IgHierarchicalGridColumnGroupOptions; /** * Array of child column definitions. If the column has the property group than the grid has multi column headers. + * */ group?: any[]; /** * Determines the way in which dates will be displayed in the grid for this column. * + * * Valid values: * "local" The dates for this column will be rendered in the client's local timezone. * "utc" The dates for this column will be rendered in their UTC representation. @@ -47257,6 +54828,7 @@ interface IgHierarchicalGridColumn { /** * A reference to or the name of a JavaScript function, which will calculate the value of the current cell based on other cell values in the same row. Used with [unbound columns](ui.ighierarchicalgrid#options:columns.unbound). * + * * Valid values: * "string" The name of the JavaScript function. * "function" Reference to the JavaScript function. @@ -47265,22 +54837,26 @@ interface IgHierarchicalGridColumn { /** * Array of values which will be populated in the column cells at initialization, if the column is [unbound](ui.ighierarchicalgrid#options:columns.unbound). + * */ unboundValues?: any[]; /** * Space-separated list of CSS classes to be applied on the header cell of this column. + * */ headerCssClass?: string; /** * Space-separated list of CSS classes to be applied on the data cells of this column. The class is not applied if the column has a column [template](ui.ighierarchicalgrid#options:columns.template) defined, which contains full definition in the template. + * */ columnCssClass?: string; /** * This option is applicable only for columns with [dataType](ui.ighierarchicalgrid#options:columns.dataType) of object. Reference to a function, or the name of the function, that will be used for complex data extraction from the data records, whose return value will be used for all data operations associated with this column and will be displayed as cell value. [Here you can find more examples of how to setup a column mapper](http://www.igniteui.com/help/iggrid-columns-and-layout#defining-mapper) * + * * Valid values: * "string" The name of the mapper function. * "function" Reference to the mapper function. @@ -47289,26 +54865,31 @@ interface IgHierarchicalGridColumn { /** * Specifies the row index of the cell in a Multi-Row Layout configuration. All columns must have this property set for the multi-row-layout mode to be enabled. [Here you can find more about the Multi-Row Layout feature](http://www.igniteui.com/help/iggrid-multirowlayout) + * */ rowIndex?: number; /** * Specifies the column index of the cell in a Multi-Row Layout configuration. All columns must have this property set for the multi-row-layout mode to be enabled. [Here you can find more about the Multi-Row Layout feature](http://www.igniteui.com/help/iggrid-multirowlayout) + * */ columnIndex?: number; /** * Specifies the navigation index of the cell for the TAB sequence when the cells are in edit mode in a Multi-Row Layout grid. Has no effect otherwise. [Here you can find more about the Multi-Row Layout feature](http://www.igniteui.com/help/iggrid-multirowlayout) + * */ navigationIndex?: number; /** * Specifies the colSpan of the cell in a Multi-Row Layout configuration. colSpan 0 is not supported and will be changed to 1 by the grid. [Here you can find more about the Multi-Row Layout feature](http://www.igniteui.com/help/iggrid-multirowlayout) + * */ colSpan?: number; /** * Specifies the rowSpan of the cell in a Multi-Row Layout configuration. rowSpan 0 is not supported and will be changed to 1 by the grid. [Here you can find more about the Multi-Row Layout feature](http://www.igniteui.com/help/iggrid-multirowlayout). If multi-row-layout is not used but multi-column-header is set then this option is used to adjust span of header cell. + * */ rowSpan?: number; @@ -47333,16 +54914,19 @@ interface IgHierarchicalGridFeature { interface IgHierarchicalGridRestSettingsCreate { /** * Specifies a remote URL to which create requests will be sent. This will be used for both batch and non-batch, however if template is also set, this URL will only be used for batch requests. + * */ url?: string; /** * Specifies a remote URL template. Use ${id} in place of the resource id. + * */ template?: string; /** * Specifies whether create requests will be sent in batches + * */ batch?: boolean; @@ -47399,6 +54983,7 @@ interface IgHierarchicalGridRestSettingsRemove { interface IgHierarchicalGridRestSettings { /** * Settings for create requests + * */ create?: IgHierarchicalGridRestSettingsCreate; @@ -47419,11 +55004,13 @@ interface IgHierarchicalGridRestSettings { /** * Specifies a custom function to serialize content sent to the server. It should accept a single object or an array of objects and return a string. If not specified, JSON.stringify() will be used. + * */ contentSerializer?: Function; /** * Specifies the content type of the request. See http://api.jquery.com/jQuery.ajax/ => contentType + * */ contentType?: string; @@ -47436,41 +55023,49 @@ interface IgHierarchicalGridRestSettings { interface IgHierarchicalGridScrollSettings { /** * Sets gets current vertical position. + * */ scrollTop?: number; /** * Sets gets current horizontal position. + * */ scrollLeft?: number; /** * Sets gets the step of the default scrolling behavior when using the mouse wheel. + * */ wheelStep?: number; /** * Sets gets if smoother scrolling with small intertia should be used when using the mouse wheel. + * */ smoothing?: boolean; /** * Sets or gets the modifier for how many pixels will be scrolled when using the mouse wheel once. This is used only for the [smooth scrolling behavior](ui.ighierarchicalgrid#options:scrollSettings.smoothing). + * */ smoothingStep?: number; /** * Sets or gets the modifier for how long the scroll ‘animation’ lasts when using the mouse wheel once. This is used only for the [smooth scrolling behavior](ui.ighierarchicalgrid#options:scrollSettings.smoothing). + * */ smoothingDuration?: number; /** * Sets gets the modifier for how much the inertia scrolls on touch devices. Note: Value set to 0 would disable touch movements. Value set to -1 would invert them. + * */ inertiaStep?: number; /** * Sets gets the modifier for how long the inertia last on touch devices. + * */ inertiaDuration?: number; @@ -47621,59 +55216,70 @@ interface ChildGridCreatedEventUIParam {} interface IgHierarchicalGrid { /** - * Only the first level will be data-bound initially. Also serves as "render" depth, meaning that depending on this prop, the grid will + * Only the first level will be data-bound initially. Also serves as "render" depth, meaning that depending on this prop, the grid will render the child grids up to the specified level. + * */ initialDataBindDepth?: number; /** * No levels will be automatically expanded when the widget is instantiated for the first time + * */ initialExpandDepth?: number; /** * If true, encodes all requests using OData conventions and the $expand syntax + * */ odata?: boolean; /** * If true, load on demand will be achieved using REST compliant resource access with appropriate url-s for * the ajax GET calls. + * */ rest?: boolean; /** * Specifies the limit on the number of levels to bind to + * */ maxDataBindDepth?: number; /** * Specifies the default property in the response where children will be located + * */ defaultChildrenDataProperty?: string; /** * If true, will autogenerate all layouts assuming default values for "childrenDataProperty" * When autoGenerateLayouts is enabled, it will automatically generate all columns recursively. (all columns on all levels) + * */ autoGenerateLayouts?: boolean; /** * Applies a linear animation - either expanding or collapsing depending on the parent row state + * */ expandCollapseAnimations?: boolean; /** * Specifies the expand column width + * */ expandColWidth?: number; /** * Specifies the delimiter for constructing paths , for hierarchical lookup of data + * */ pathSeparator?: string; /** * The row expanding/collapsing animation duration in ms. + * */ animationDuration?: number; @@ -47692,12 +55298,14 @@ interface IgHierarchicalGrid { /** * List of columnLayout objects that specify the structure of the child grids. All options that are applicable to a flat grid are also applicable here + * */ columnLayouts?: IgHierarchicalGridColumnLayout[]; /** * Defines the grid width in pixels or percents. [Here you can find more info about setting igGrid width](http://www.igniteui.com/help/iggrid-columns-and-layout#width-height). * + * * Valid values: * "string" The widget width can be set in pixels (px) or percentage (%). Example values: "800px", "800" (defaults to pixels), "100%". * "number" The widget width can be set in pixels as a number. Example values: 800, 700. @@ -47708,6 +55316,7 @@ interface IgHierarchicalGrid { /** * This is the total height of the grid, including all UI elements - scroll container with data rows, header, footer, filter row - (if any), etc. [Here you can find more info about setting igGrid height](http://www.igniteui.com/help/iggrid-columns-and-layout#width-height). * + * * Valid values: * "string" The widget height can be set in pixels (px) and percentage (%). * "number" The widget height can be set as a number @@ -47717,12 +55326,14 @@ interface IgHierarchicalGrid { /** * If autoAdjustHeight is set to false, the [height](ui.ighierarchicalgrid#options:height) will be set only on the scrolling container, and all other UI elements such as paging footer / filter row / headers will add on top of that, so the total height of the grid will be more than this value - the height of the scroll container (content area) will not be dynamically calculated. Setting this option to false will usually result in a lot better initial rendering performance for large data sets ( > 1000 rows rendered at once, no [virtualization](ui.ighierarchicalgrid#options:virtualization) enabled), since no reflows will be made by browsers when accessing DOM properties such as offsetHeight. + * */ autoAdjustHeight?: boolean; /** * Used for [row virtualization](ui.ighierarchicalgrid#options:rowVirtualization) in [fixed mode](ui.ighierarchicalgrid#options:virtualizationMode). This is the average value in pixels (default) that will be used to calculate how many rows to render as the end user scrolls. Also all rows' height will be automatically set to this value. * + * * Valid values: * "string" The avarage row height can be set in pixels ("25px"). * "number" The avarage row height can be set in pixels as a number (25). @@ -47732,6 +55343,7 @@ interface IgHierarchicalGrid { /** * Used for [column virtualization](ui.ighierarchicalgrid#options:columnVirtualization) in [fixed mode](ui.ighierarchicalgrid#options:virtualizationMode). This is the average value in pixels for a column width. * + * * Valid values: * "string" The avarage column width can be set in pixels ("25px"). * "number" The avarage column width can be set in pixels as a number (25). @@ -47741,6 +55353,7 @@ interface IgHierarchicalGrid { /** * Default column width that will be set for all columns, that don't have [column width](ui.ighierarchicalgrid#options:columns.width) defined. * + * * Valid values: * "string" The default column width can be set in pixels ("100px"). * "number" The default column width can be set in pixels as a number (100). @@ -47751,17 +55364,20 @@ interface IgHierarchicalGrid { * If no [columns](ui.ighierarchicalgrid#options:columns) collection is defined, and autoGenerateColumns is set to true, [columns](ui.ighierarchicalgrid#options:columns) will be inferred from the data source before the [dataRendering](ui.iggrid#events:dataRendering) event is fired. The inferred [columns](ui.ighierarchicalgrid#options:columns) collection will be available to the developer for modification at [dataRendering](ui.iggrid#events:dataRendering). If autoGenerateColumns is not explicitly set and [columns](ui.ighierarchicalgrid#options:columns) has at least one column defined then autoGenerateColumns is automatically set to false. * If autoGenerateColumns is true and there are columns defined auto-generated columns will render after the explicitly defined ones. * Since auto-generated columns don't have width defined consider setting [defaultColumnWidth](ui.ighierarchicalgrid#options:defaultColumnWidth) as well. + * */ autoGenerateColumns?: boolean; /** * Enables/disables column and row virtualization at the same time. Virtualization can greatly enhance rendering performance. If enabled, the number of actual rendered rows (DOM elements) will be constant and related to the visible viewport of the grid. As the end user scrolls, those DOM elements will be dynamically reused to render the new data. [Here you can find more info about the performance guidelines when using the igGrid](http://www.igniteui.com/help/iggrid-performance-guide) + * */ virtualization?: boolean; /** * Determines row virtualization mode. * + * * Valid values: * "fixed" Renders only the visible rows and/or columns in the grid. On scrolling the same rows and/or columns are updated with new data from the data source. Only fixed virtualization can work with column virtualization at the same time. Fixed virtualization is not supported by some grid features: Resizing, Group By, Responsive. * "continuous" renders a pre-defined number of rows in the grid. On scrolling the continuous virtualization loads another portion of rows and disposes the current one. @@ -47770,27 +55386,32 @@ interface IgHierarchicalGrid { /** * Enables virtualization for rows only. [Here you can find more info about igGrid row virtualization](http://www.igniteui.com/help/iggrid-virtualization-overview) + * */ rowVirtualization?: boolean; /** * Enables virtualization for columns only. Column virtualization can work only in combination with fixed row virtalization. Setting columnVirtualization to true will automatically set [virtualization](ui.ighierarchicalgrid#options:virtualization) to true and [virtualizationMode](ui.ighierarchicalgrid#options:virtualizationMode) to "fixed". + * */ columnVirtualization?: boolean; /** * Number of pixels to scroll the grid by, when virtualization is enabled, and mouse wheel scrolling is performed over the virtual grid area. If "null" the step will be equal to the [avgRowHeight](ui.ighierarchicalgrid#options:avgRowHeight). + * */ virtualizationMouseWheelStep?: number; /** * If this option is set to true, the height of the grid row will be calculated automatically based on the [avgRowHeight](ui.ighierarchicalgrid#options:avgRowHeight) and the visible virtual records. If no [avgRowHeight](ui.ighierarchicalgrid#options:avgRowHeight) is specified, it will be calculated automatically at runtime. + * */ adjustVirtualHeights?: boolean; /** * The templating engine that will be used to render the grid [column templates](ui.ighierarchicalgrid#options:columns.template). [Here you can find](http://www.infragistics.com/community/blogs/marina_stoyanova/archive/2014/05/30/using-different-template-engines-with-ignite-ui-controls.aspx) how to use templating engines other than igTemplating and jsRender. * + * * Valid values: * "infragistics" The grid will use the Infragistics Templating engine to render its [column templates](ui.ighierarchicalgrid#options:columns.template) and specific parts of the UI. * "jsRender" The grid will use jsRender to render its [column templates](ui.ighierarchicalgrid#options:columns.template) and specific parts of the UI. @@ -47799,96 +55420,120 @@ interface IgHierarchicalGrid { /** * An array of column objects. Checkout the [Columns and Layout](http://www.igniteui.com/help/iggrid-columns-and-layout#defining-columns) topic for details on configuring the columns array. + * */ columns?: IgHierarchicalGridColumn[]; /** * Can be any valid data source accepted by [$.ig.DataSource](ig.datasource), or an instance of an $.ig.DataSource itself + * + * + * Valid values: + * "string" DataSource as a string. For example a Url. + * "array" DataSource as an array. + * "object" DataSource as an object. For example a JSON object */ - dataSource?: any; + dataSource?: string|Array|Object; /** * Specifies a remote URL as a data source, from which data will be retrieved using the [$.ig.DataSource](ig.datasource). + * */ dataSourceUrl?: string; /** * Explicitly set data source type (such as "json"). Please refer to the documentation of [$.ig.DataSource type](ig.datasource#options:settings.type). + * */ dataSourceType?: string; /** * See [$.ig.DataSource responseDataKey](ig.datasource#options:settings.responseDataKey). This is the property in the responses where data records are held, if the response is wrapped. + * */ responseDataKey?: string; /** * See [$.ig.DataSource responseTotalRecCountKey](ig.datasource#options:settings.responseTotalRecCountKey). Property in the response specifying the total number of records on the server. + * */ responseTotalRecCountKey?: string; /** * Specifies the HTTP verb to be used to issue the requests to a remote data source. + * */ requestType?: string; /** * Content type of the response. See http://api.jquery.com/jQuery.ajax/ => contentType + * */ responseContentType?: string; /** * Controls the visibility of the grid header. + * */ showHeader?: boolean; /** * Controls the visibility of the grid footer. + * */ showFooter?: boolean; /** * Headers will be fixed if this option is set to true, and only the grid data will be scrollable. If [virtualization](ui.ighierarchicalgrid#options:virtualization) is enabled, fixedHeaders will always act as if it's true, no matter which value is set. + * */ fixedHeaders?: boolean; /** * Footers will be fixed if this option is set to true, and only the grid data will be scrollable. If [virtualization](ui.ighierarchicalgrid#options:virtualization) is enabled, fixedFooters will always act as if it's true, no matter which value is set. + * */ fixedFooters?: boolean; /** * Caption text that will be shown above the grid header. + * */ caption?: string; /** * List of grid feature definitions: sorting, paging, etc. Each feature goes with its separate options that are documented for the feature accordingly. [Here you can find detailed documentation for all igGrid features](http://www.igniteui.com/help/iggrid-features-landing-page) + * */ features?: IgHierarchicalGridFeature[]; /** * Initial tabIndex attribute that will be set on all focusable elements. + * */ tabIndex?: number; /** * If this option is set to false, the data to which the grid is bound will be used "as is" with no additional transformations based on [columns](ui.ighierarchicalgrid#options:columns) defined. Otherwise only the subset of data properties used in the [columns](ui.ighierarchicalgrid#options:columns) defined will be extracted in a new object and used. + * */ localSchemaTransform?: boolean; /** * Key of the column containing unique identifiers for the data records. + * */ primaryKey?: string; /** * If true, the transaction log will always be sent in the request for remote data, by the data source. Also this means that if there are values in the log, a POST will be performed instead of GET. + * */ serializeTransactionLog?: boolean; /** * Automatically commits the transactions as rows/cells are being edited to the client data source. A [saveChanges](ui.ighierarchicalgrid#methods:saveChanges) call still needs to be performed in order to commit the transactions to a server-side data source. + * */ autoCommit?: boolean; @@ -47898,12 +55543,14 @@ interface IgHierarchicalGrid { * If a new row is added, edited, then deleted, there will be no transaction added to the log. * If several edits are made to a row or an individual cell, this should result in a single transaction. * Note: This option takes effect only when [autoCommit](ui.ighierarchicalgrid#options:autoCommit) is set to false. + * */ aggregateTransactions?: boolean; /** * Sets gets ability to automatically format text in cells for numeric and date columns. The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) * + * * Valid values: * "date" formats only Date columns * "number" formats only number columns @@ -47915,58 +55562,69 @@ interface IgHierarchicalGrid { /** * Gets sets ability to render checkboxes and use checkbox editor when dataType of a column is "bool". Checkboxes are not rendered for boolean values in columns with a [column template](ui.ighierarchicalgrid#options:columns.template). + * */ renderCheckboxes?: boolean; /** * URL to which updating requests will be made. + * */ updateUrl?: string; /** * Settings related to REST compliant update routines. + * */ restSettings?: IgHierarchicalGridRestSettings; /** * Enables/disables rendering of alternating row styles (odd and even rows receive different styling). + * */ alternateRowStyles?: boolean; /** * If set to true and all columns' widths are specified and their combined width is less than the grid width then the last column width will be automatically adjusted to fill the remaining empty space of the grid. + * */ autofitLastColumn?: boolean; /** * Enables/disables rendering of hover styles when the mouse is over a record. This can be useful in templating scenarios, for example, where we don't want to apply hover styling to templated content. + * */ enableHoverStyles?: boolean; /** * Nables/Disables serializing client date as UTC ISO 8061 string instead of using the local time and zone values. + * */ enableUTCDates?: boolean; /** * Merge unbound columns values inside data source when data source is remote. If true then the unbound columns are merged to the data source at runtime on the server. Note that data source is expanded with the new data and this could cause performance issues when the data is huge. If mergeUnboundColumns is false then the unbound data is sent and merged on the client. This option is used by the [igGrid MVC Helper](http://www.igniteui.com/help/iggrid-developing-asp-net-mvc-applications-with-iggrid). * Checkout [Populating Unbound Columns Remotely (igGrid)](http://www.igniteui.com/help/iggrid-unboundcolumns-populating-with-data-remotely) topic for more information. + * */ mergeUnboundColumns?: boolean; /** * When dataSource is a remote URL, defines whether to set the type of the remote data source to JSONP. + * */ jsonpRequest?: boolean; /** * Enables/disables grid adjusting its dimensions when its [width](ui.ighierarchicalgrid#options:width) and/or [height](ui.ighierarchicalgrid#options:height) is set in percent (%) and grid parent DOM container is resized. + * */ enableResizeContainerCheck?: boolean; /** * Configures how the feature chooser icon should display on header cells - e.g. to display as gear icon or not. * + * * Valid values: * "none" Always hide the feature chooser icon; The feature chooser is shown on tapping/clicking the column header. * "desktopOnly" Always show the icon on desktop but hide when touch device detected. @@ -47976,9 +55634,22 @@ interface IgHierarchicalGrid { /** * Settings related to content scrolling. + * */ scrollSettings?: IgHierarchicalGridScrollSettings; + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event which is fired when a hierarchical row is about to be expanded */ @@ -48158,7 +55829,16 @@ interface IgHierarchicalGrid { [optionName: string]: any; } interface IgHierarchicalGridMethods { + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.ighierarchicalgrid#options:language) + * Note that this method is for rare scenarios, see [language](ui.ighierarchicalgrid#options:language) or [locale](ui.ighierarchicalgrid#options:locale) option setter + */ changeLocale(): void; + + /** + * Changes the the regional settings of widget element to the language specified in [options.regional](ui.ighierarchicalgrid#options:regional) + * Note that this method is for rare scenarios, use [regional](ui.ighierarchicalgrid#options:regional) option setter + */ changeRegional(): void; /** @@ -48258,6 +55938,16 @@ interface IgHierarchicalGridMethods { * Destroys the hierarchical grid by recursively destroying all child grids */ destroy(): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igHierarchicalGrid"): IgHierarchicalGridMethods; @@ -48281,14 +55971,18 @@ interface JQuery { igHierarchicalGrid(methodName: "rollback", rebind?: boolean): void; igHierarchicalGrid(methodName: "saveChanges", success: Function, error: Function): void; igHierarchicalGrid(methodName: "destroy"): void; + igHierarchicalGrid(methodName: "changeGlobalLanguage"): void; + igHierarchicalGrid(methodName: "changeGlobalRegional"): void; /** - * Only the first level will be data-bound initially. Also serves as "render" depth, meaning that depending on this prop, the grid will + * Only the first level will be data-bound initially. Also serves as "render" depth, meaning that depending on this prop, the grid will render the child grids up to the specified level. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "initialDataBindDepth"): number; /** - * Only the first level will be data-bound initially. Also serves as "render" depth, meaning that depending on this prop, the grid will + * Only the first level will be data-bound initially. Also serves as "render" depth, meaning that depending on this prop, the grid will render the child grids up to the specified level. + * * * @optionValue New value to be set. */ @@ -48296,24 +55990,28 @@ interface JQuery { /** * No levels will be automatically expanded when the widget is instantiated for the first time + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "initialExpandDepth"): number; /** * No levels will be automatically expanded when the widget is instantiated for the first time * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "initialExpandDepth", optionValue: number): void; /** * If true, encodes all requests using OData conventions and the $expand syntax + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "odata"): boolean; /** * If true, encodes all requests using OData conventions and the $expand syntax * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "odata", optionValue: boolean): void; @@ -48321,6 +56019,7 @@ interface JQuery { /** * If true, load on demand will be achieved using REST compliant resource access with appropriate url-s for * the ajax GET calls. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "rest"): boolean; @@ -48328,30 +56027,35 @@ interface JQuery { * If true, load on demand will be achieved using REST compliant resource access with appropriate url-s for * the ajax GET calls. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "rest", optionValue: boolean): void; /** * Gets the limit on the number of levels to bind to + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "maxDataBindDepth"): number; /** * Sets the limit on the number of levels to bind to * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "maxDataBindDepth", optionValue: number): void; /** * Gets the default property in the response where children will be located + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "defaultChildrenDataProperty"): string; /** * Sets the default property in the response where children will be located * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "defaultChildrenDataProperty", optionValue: string): void; @@ -48359,6 +56063,7 @@ interface JQuery { /** * If true, will autogenerate all layouts assuming default values for "childrenDataProperty" * When autoGenerateLayouts is enabled, it will automatically generate all columns recursively. (all columns on all levels) + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "autoGenerateLayouts"): boolean; @@ -48366,54 +56071,63 @@ interface JQuery { * If true, will autogenerate all layouts assuming default values for "childrenDataProperty" * When autoGenerateLayouts is enabled, it will automatically generate all columns recursively. (all columns on all levels) * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "autoGenerateLayouts", optionValue: boolean): void; /** * Applies a linear animation - either expanding or collapsing depending on the parent row state + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "expandCollapseAnimations"): boolean; /** * Applies a linear animation - either expanding or collapsing depending on the parent row state * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "expandCollapseAnimations", optionValue: boolean): void; /** * Gets the expand column width + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "expandColWidth"): number; /** * Sets the expand column width * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "expandColWidth", optionValue: number): void; /** * Gets the delimiter for constructing paths , for hierarchical lookup of data + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "pathSeparator"): string; /** * Sets the delimiter for constructing paths , for hierarchical lookup of data * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "pathSeparator", optionValue: string): void; /** * The row expanding/collapsing animation duration in ms. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "animationDuration"): number; /** * The row expanding/collapsing animation duration in ms. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "animationDuration", optionValue: number): void; @@ -48450,18 +56164,21 @@ interface JQuery { /** * List of columnLayout objects that specify the structure of the child grids. All options that are applicable to a flat grid are also applicable here + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "columnLayouts"): IgHierarchicalGridColumnLayout[]; /** * List of columnLayout objects that specify the structure of the child grids. All options that are applicable to a flat grid are also applicable here * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "columnLayouts", optionValue: IgHierarchicalGridColumnLayout[]): void; /** * Defines the grid width in pixels or percents. [Here you can find more info about setting igGrid width](http://www.igniteui.com/help/iggrid-columns-and-layout#width-height). + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "width"): string|number; @@ -48469,6 +56186,7 @@ interface JQuery { /** * Defines the grid width in pixels or percents. [Here you can find more info about setting igGrid width](http://www.igniteui.com/help/iggrid-columns-and-layout#width-height). * + * * @optionValue New value to be set. */ @@ -48476,6 +56194,7 @@ interface JQuery { /** * This is the total height of the grid, including all UI elements - scroll container with data rows, header, footer, filter row - (if any), etc. [Here you can find more info about setting igGrid height](http://www.igniteui.com/help/iggrid-columns-and-layout#width-height). + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "height"): string|number; @@ -48483,6 +56202,7 @@ interface JQuery { /** * This is the total height of the grid, including all UI elements - scroll container with data rows, header, footer, filter row - (if any), etc. [Here you can find more info about setting igGrid height](http://www.igniteui.com/help/iggrid-columns-and-layout#width-height). * + * * @optionValue New value to be set. */ @@ -48490,18 +56210,21 @@ interface JQuery { /** * If autoAdjustHeight is set to false, the [height](ui.ighierarchicalgrid#options:height) will be set only on the scrolling container, and all other UI elements such as paging footer / filter row / headers will add on top of that, so the total height of the grid will be more than this value - the height of the scroll container (content area) will not be dynamically calculated. Setting this option to false will usually result in a lot better initial rendering performance for large data ( > 1000 rows rendered at once, no [virtualization](ui.ighierarchicalgrid#options:virtualization) enabled), since no reflows will be made by browsers when accessing DOM properties such as offsetHeight. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "autoAdjustHeight"): boolean; /** * If autoAdjustHeight is set to false, the [height](ui.ighierarchicalgrid#options:height) will be set only on the scrolling container, and all other UI elements such as paging footer / filter row / headers will add on top of that, so the total height of the grid will be more than this value - the height of the scroll container (content area) will not be dynamically calculated. Setting this option to false will usually result in a lot better initial rendering performance for large data sets ( > 1000 rows rendered at once, no [virtualization](ui.ighierarchicalgrid#options:virtualization) enabled), since no reflows will be made by browsers when accessing DOM properties such as offsetHeight. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "autoAdjustHeight", optionValue: boolean): void; /** * Used for [row virtualization](ui.ighierarchicalgrid#options:rowVirtualization) in [fixed mode](ui.ighierarchicalgrid#options:virtualizationMode). This is the average value in pixels (default) that will be used to calculate how many rows to render as the end user scrolls. Also all rows' height will be automatically set to this value. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "avgRowHeight"): string|number; @@ -48509,6 +56232,7 @@ interface JQuery { /** * Used for [row virtualization](ui.ighierarchicalgrid#options:rowVirtualization) in [fixed mode](ui.ighierarchicalgrid#options:virtualizationMode). This is the average value in pixels (default) that will be used to calculate how many rows to render as the end user scrolls. Also all rows' height will be automatically set to this value. * + * * @optionValue New value to be set. */ @@ -48516,6 +56240,7 @@ interface JQuery { /** * Used for [column virtualization](ui.ighierarchicalgrid#options:columnVirtualization) in [fixed mode](ui.ighierarchicalgrid#options:virtualizationMode). This is the average value in pixels for a column width. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "avgColumnWidth"): string|number; @@ -48523,6 +56248,7 @@ interface JQuery { /** * Used for [column virtualization](ui.ighierarchicalgrid#options:columnVirtualization) in [fixed mode](ui.ighierarchicalgrid#options:virtualizationMode). This is the average value in pixels for a column width. * + * * @optionValue New value to be set. */ @@ -48530,6 +56256,7 @@ interface JQuery { /** * Default column width that will be set for all columns, that don't have [column width](ui.ighierarchicalgrid#options:columns.width) defined. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "defaultColumnWidth"): string|number; @@ -48537,6 +56264,7 @@ interface JQuery { /** * Default column width that will be set for all columns, that don't have [column width](ui.ighierarchicalgrid#options:columns.width) defined. * + * * @optionValue New value to be set. */ @@ -48546,6 +56274,7 @@ interface JQuery { * If no [columns](ui.ighierarchicalgrid#options:columns) collection is defined, and autoGenerateColumns is set to true, [columns](ui.ighierarchicalgrid#options:columns) will be inferred from the data source before the [dataRendering](ui.iggrid#events:dataRendering) event is fired. The inferred [columns](ui.ighierarchicalgrid#options:columns) collection will be available to the developer for modification at [dataRendering](ui.iggrid#events:dataRendering). If autoGenerateColumns is not explicitly set and [columns](ui.ighierarchicalgrid#options:columns) has at least one column defined then autoGenerateColumns is automatically set to false. * If autoGenerateColumns is true and there are columns defined auto-generated columns will render after the explicitly defined ones. * Since auto-generated columns don't have width defined consider setting [defaultColumnWidth](ui.ighierarchicalgrid#options:defaultColumnWidth) as well. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "autoGenerateColumns"): boolean; @@ -48554,24 +56283,28 @@ interface JQuery { * If autoGenerateColumns is true and there are columns defined auto-generated columns will render after the explicitly defined ones. * Since auto-generated columns don't have width defined consider setting [defaultColumnWidth](ui.ighierarchicalgrid#options:defaultColumnWidth) as well. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "autoGenerateColumns", optionValue: boolean): void; /** * Enables/disables column and row virtualization at the same time. Virtualization can greatly enhance rendering performance. If enabled, the number of actual rendered rows (DOM elements) will be constant and related to the visible viewport of the grid. As the end user scrolls, those DOM elements will be dynamically reused to render the new data. [Here you can find more info about the performance guidelines when using the igGrid](http://www.igniteui.com/help/iggrid-performance-guide) + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "virtualization"): boolean; /** * Enables/disables column and row virtualization at the same time. Virtualization can greatly enhance rendering performance. If enabled, the number of actual rendered rows (DOM elements) will be constant and related to the visible viewport of the grid. As the end user scrolls, those DOM elements will be dynamically reused to render the new data. [Here you can find more info about the performance guidelines when using the igGrid](http://www.igniteui.com/help/iggrid-performance-guide) * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "virtualization", optionValue: boolean): void; /** * Determines row virtualization mode. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "virtualizationMode"): string; @@ -48579,6 +56312,7 @@ interface JQuery { /** * Determines row virtualization mode. * + * * @optionValue New value to be set. */ @@ -48586,54 +56320,63 @@ interface JQuery { /** * Enables virtualization for rows only. [Here you can find more info about igGrid row virtualization](http://www.igniteui.com/help/iggrid-virtualization-overview) + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "rowVirtualization"): boolean; /** * Enables virtualization for rows only. [Here you can find more info about igGrid row virtualization](http://www.igniteui.com/help/iggrid-virtualization-overview) * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "rowVirtualization", optionValue: boolean): void; /** * Enables virtualization for columns only. Column virtualization can work only in combination with fixed row virtalization. Setting columnVirtualization to true will automatically set [virtualization](ui.ighierarchicalgrid#options:virtualization) to true and [virtualizationMode](ui.ighierarchicalgrid#options:virtualizationMode) to "fixed". + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "columnVirtualization"): boolean; /** * Enables virtualization for columns only. Column virtualization can work only in combination with fixed row virtalization. Setting columnVirtualization to true will automatically set [virtualization](ui.ighierarchicalgrid#options:virtualization) to true and [virtualizationMode](ui.ighierarchicalgrid#options:virtualizationMode) to "fixed". * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "columnVirtualization", optionValue: boolean): void; /** * Number of pixels to scroll the grid by, when virtualization is enabled, and mouse wheel scrolling is performed over the virtual grid area. If "null" the step will be equal to the [avgRowHeight](ui.ighierarchicalgrid#options:avgRowHeight). + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "virtualizationMouseWheelStep"): number; /** * Number of pixels to scroll the grid by, when virtualization is enabled, and mouse wheel scrolling is performed over the virtual grid area. If "null" the step will be equal to the [avgRowHeight](ui.ighierarchicalgrid#options:avgRowHeight). * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "virtualizationMouseWheelStep", optionValue: number): void; /** * If this option is set to true, the height of the grid row will be calculated automatically based on the [avgRowHeight](ui.ighierarchicalgrid#options:avgRowHeight) and the visible virtual records. If no [avgRowHeight](ui.ighierarchicalgrid#options:avgRowHeight) is specified, it will be calculated automatically at runtime. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "adjustVirtualHeights"): boolean; /** * If this option is set to true, the height of the grid row will be calculated automatically based on the [avgRowHeight](ui.ighierarchicalgrid#options:avgRowHeight) and the visible virtual records. If no [avgRowHeight](ui.ighierarchicalgrid#options:avgRowHeight) is specified, it will be calculated automatically at runtime. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "adjustVirtualHeights", optionValue: boolean): void; /** * The templating engine that will be used to render the grid [column templates](ui.ighierarchicalgrid#options:columns.template). [Here you can find](http://www.infragistics.com/community/blogs/marina_stoyanova/archive/2014/05/30/using-different-template-engines-with-ignite-ui-controls.aspx) how to use templating engines other than igTemplating and jsRender. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "templatingEngine"): string; @@ -48641,6 +56384,7 @@ interface JQuery { /** * The templating engine that will be used to render the grid [column templates](ui.ighierarchicalgrid#options:columns.template). [Here you can find](http://www.infragistics.com/community/blogs/marina_stoyanova/archive/2014/05/30/using-different-template-engines-with-ignite-ui-controls.aspx) how to use templating engines other than igTemplating and jsRender. * + * * @optionValue New value to be set. */ @@ -48648,228 +56392,268 @@ interface JQuery { /** * An array of column objects. Checkout the [Columns and Layout](http://www.igniteui.com/help/iggrid-columns-and-layout#defining-columns) topic for details on configuring the columns array. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "columns"): IgHierarchicalGridColumn[]; /** * An array of column objects. Checkout the [Columns and Layout](http://www.igniteui.com/help/iggrid-columns-and-layout#defining-columns) topic for details on configuring the columns array. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "columns", optionValue: IgHierarchicalGridColumn[]): void; /** * Can be any valid data source accepted by [$.ig.DataSource](ig.datasource), or an instance of an $.ig.DataSource itself + * */ - igHierarchicalGrid(optionLiteral: 'option', optionName: "dataSource"): any; + + igHierarchicalGrid(optionLiteral: 'option', optionName: "dataSource"): string|Array|Object; /** * Can be any valid data source accepted by [$.ig.DataSource](ig.datasource), or an instance of an $.ig.DataSource itself * + * * @optionValue New value to be set. */ - igHierarchicalGrid(optionLiteral: 'option', optionName: "dataSource", optionValue: any): void; + + igHierarchicalGrid(optionLiteral: 'option', optionName: "dataSource", optionValue: string|Array|Object): void; /** * Gets a remote URL as a data source, from which data will be retrieved using the [$.ig.DataSource](ig.datasource). + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "dataSourceUrl"): string; /** * Sets a remote URL as a data source, from which data will be retrieved using the [$.ig.DataSource](ig.datasource). * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "dataSourceUrl", optionValue: string): void; /** * Explicitly set data source type (such as "json"). Please refer to the documentation of [$.ig.DataSource type](ig.datasource#options:settings.type). + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "dataSourceType"): string; /** * Explicitly set data source type (such as "json"). Please refer to the documentation of [$.ig.DataSource type](ig.datasource#options:settings.type). * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "dataSourceType", optionValue: string): void; /** * See [$.ig.DataSource responseDataKey](ig.datasource#options:settings.responseDataKey). This is the property in the responses where data records are held, if the response is wrapped. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "responseDataKey"): string; /** * See [$.ig.DataSource responseDataKey](ig.datasource#options:settings.responseDataKey). This is the property in the responses where data records are held, if the response is wrapped. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "responseDataKey", optionValue: string): void; /** * See [$.ig.DataSource responseTotalRecCountKey](ig.datasource#options:settings.responseTotalRecCountKey). Property in the response specifying the total number of records on the server. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "responseTotalRecCountKey"): string; /** * See [$.ig.DataSource responseTotalRecCountKey](ig.datasource#options:settings.responseTotalRecCountKey). Property in the response specifying the total number of records on the server. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "responseTotalRecCountKey", optionValue: string): void; /** * Gets the HTTP verb to be used to issue the requests to a remote data source. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "requestType"): string; /** * Sets the HTTP verb to be used to issue the requests to a remote data source. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "requestType", optionValue: string): void; /** * Content type of the response. See http://api.jquery.com/jQuery.ajax/ => contentType + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "responseContentType"): string; /** * Content type of the response. See http://api.jquery.com/jQuery.ajax/ => contentType * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "responseContentType", optionValue: string): void; /** * Controls the visibility of the grid header. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "showHeader"): boolean; /** * Controls the visibility of the grid header. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "showHeader", optionValue: boolean): void; /** * Controls the visibility of the grid footer. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "showFooter"): boolean; /** * Controls the visibility of the grid footer. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "showFooter", optionValue: boolean): void; /** * Headers will be fixed if this option is set to true, and only the grid data will be scrollable. If [virtualization](ui.ighierarchicalgrid#options:virtualization) is enabled, fixedHeaders will always act as if it's true, no matter which value is set. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "fixedHeaders"): boolean; /** * Headers will be fixed if this option is set to true, and only the grid data will be scrollable. If [virtualization](ui.ighierarchicalgrid#options:virtualization) is enabled, fixedHeaders will always act as if it's true, no matter which value is set. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "fixedHeaders", optionValue: boolean): void; /** * Footers will be fixed if this option is set to true, and only the grid data will be scrollable. If [virtualization](ui.ighierarchicalgrid#options:virtualization) is enabled, fixedFooters will always act as if it's true, no matter which value is set. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "fixedFooters"): boolean; /** * Footers will be fixed if this option is set to true, and only the grid data will be scrollable. If [virtualization](ui.ighierarchicalgrid#options:virtualization) is enabled, fixedFooters will always act as if it's true, no matter which value is set. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "fixedFooters", optionValue: boolean): void; /** * Caption text that will be shown above the grid header. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "caption"): string; /** * Caption text that will be shown above the grid header. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "caption", optionValue: string): void; /** * List of grid feature definitions: sorting, paging, etc. Each feature goes with its separate options that are documented for the feature accordingly. [Here you can find detailed documentation for all igGrid features](http://www.igniteui.com/help/iggrid-features-landing-page) + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "features"): IgHierarchicalGridFeature[]; /** * List of grid feature definitions: sorting, paging, etc. Each feature goes with its separate options that are documented for the feature accordingly. [Here you can find detailed documentation for all igGrid features](http://www.igniteui.com/help/iggrid-features-landing-page) * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "features", optionValue: IgHierarchicalGridFeature[]): void; /** * Initial tabIndex attribute that will be set on all focusable elements. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "tabIndex"): number; /** * Initial tabIndex attribute that will be set on all focusable elements. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "tabIndex", optionValue: number): void; /** * If this option is set to false, the data to which the grid is bound will be used "as is" with no additional transformations based on [columns](ui.ighierarchicalgrid#options:columns) defined. Otherwise only the subset of data properties used in the [columns](ui.ighierarchicalgrid#options:columns) defined will be extracted in a new object and used. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "localSchemaTransform"): boolean; /** * If this option is set to false, the data to which the grid is bound will be used "as is" with no additional transformations based on [columns](ui.ighierarchicalgrid#options:columns) defined. Otherwise only the subset of data properties used in the [columns](ui.ighierarchicalgrid#options:columns) defined will be extracted in a new object and used. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "localSchemaTransform", optionValue: boolean): void; /** * Key of the column containing unique identifiers for the data records. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "primaryKey"): string; /** * Key of the column containing unique identifiers for the data records. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "primaryKey", optionValue: string): void; /** * If true, the transaction log will always be sent in the request for remote data, by the data source. Also this means that if there are values in the log, a POST will be performed instead of GET. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "serializeTransactionLog"): boolean; /** * If true, the transaction log will always be sent in the request for remote data, by the data source. Also this means that if there are values in the log, a POST will be performed instead of GET. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "serializeTransactionLog", optionValue: boolean): void; /** * Automatically commits the transactions as rows/cells are being edited to the client data source. A [saveChanges](ui.ighierarchicalgrid#methods:saveChanges) call still needs to be performed in order to commit the transactions to a server-side data source. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "autoCommit"): boolean; /** * Automatically commits the transactions as rows/cells are being edited to the client data source. A [saveChanges](ui.ighierarchicalgrid#methods:saveChanges) call still needs to be performed in order to commit the transactions to a server-side data source. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "autoCommit", optionValue: boolean): void; @@ -48880,6 +56664,7 @@ interface JQuery { * If a new row is added, edited, then deleted, there will be no transaction added to the log. * If several edits are made to a row or an individual cell, this should result in a single transaction. * Note: This option takes effect only when [autoCommit](ui.ighierarchicalgrid#options:autoCommit) is set to false. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "aggregateTransactions"): boolean; @@ -48890,12 +56675,14 @@ interface JQuery { * If several edits are made to a row or an individual cell, this should result in a single transaction. * Note: This option takes effect only when [autoCommit](ui.ighierarchicalgrid#options:autoCommit) is set to false. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "aggregateTransactions", optionValue: boolean): void; /** * Sets gets ability to automatically format text in cells for numeric and date columns. The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "autoFormat"): string|boolean; @@ -48903,6 +56690,7 @@ interface JQuery { /** * Sets gets ability to automatically format text in cells for numeric and date columns. The format patterns and rules for numbers and dates are defined in $.ig.regional.defaults object. [Here column formatting is explained in details](http://www.igniteui.com/help/iggrid-columns-and-layout#column-formatting) * + * * @optionValue New value to be set. */ @@ -48910,84 +56698,98 @@ interface JQuery { /** * Gets ability to render checkboxes and use checkbox editor when dataType of a column is "bool". Checkboxes are not rendered for boolean values in columns with a [column template](ui.ighierarchicalgrid#options:columns.template). + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "renderCheckboxes"): boolean; /** * Sets ability to render checkboxes and use checkbox editor when dataType of a column is "bool". Checkboxes are not rendered for boolean values in columns with a [column template](ui.ighierarchicalgrid#options:columns.template). * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "renderCheckboxes", optionValue: boolean): void; /** * URL to which updating requests will be made. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "updateUrl"): string; /** * URL to which updating requests will be made. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "updateUrl", optionValue: string): void; /** * Settings related to REST compliant update routines. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "restSettings"): IgHierarchicalGridRestSettings; /** * Settings related to REST compliant update routines. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "restSettings", optionValue: IgHierarchicalGridRestSettings): void; /** * Enables/disables rendering of alternating row styles (odd and even rows receive different styling). + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "alternateRowStyles"): boolean; /** * Enables/disables rendering of alternating row styles (odd and even rows receive different styling). * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "alternateRowStyles", optionValue: boolean): void; /** * If set to true and all columns' widths are specified and their combined width is less than the grid width then the last column width will be automatically adjusted to fill the remaining empty space of the grid. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "autofitLastColumn"): boolean; /** * If set to true and all columns' widths are specified and their combined width is less than the grid width then the last column width will be automatically adjusted to fill the remaining empty space of the grid. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "autofitLastColumn", optionValue: boolean): void; /** * Enables/disables rendering of hover styles when the mouse is over a record. This can be useful in templating scenarios, for example, where we don't want to apply hover styling to templated content. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "enableHoverStyles"): boolean; /** * Enables/disables rendering of hover styles when the mouse is over a record. This can be useful in templating scenarios, for example, where we don't want to apply hover styling to templated content. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "enableHoverStyles", optionValue: boolean): void; /** * Nables/Disables serializing client date as UTC ISO 8061 string instead of using the local time and zone values. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "enableUTCDates"): boolean; /** * Nables/Disables serializing client date as UTC ISO 8061 string instead of using the local time and zone values. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "enableUTCDates", optionValue: boolean): void; @@ -48995,6 +56797,7 @@ interface JQuery { /** * Merge unbound columns values inside data source when data source is remote. If true then the unbound columns are merged to the data source at runtime on the server. Note that data source is expanded with the new data and this could cause performance issues when the data is huge. If mergeUnboundColumns is false then the unbound data is sent and merged on the client. This option is used by the [igGrid MVC Helper](http://www.igniteui.com/help/iggrid-developing-asp-net-mvc-applications-with-iggrid). * Checkout [Populating Unbound Columns Remotely (igGrid)](http://www.igniteui.com/help/iggrid-unboundcolumns-populating-with-data-remotely) topic for more information. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "mergeUnboundColumns"): boolean; @@ -49002,36 +56805,42 @@ interface JQuery { * Merge unbound columns values inside data source when data source is remote. If true then the unbound columns are merged to the data source at runtime on the server. Note that data source is expanded with the new data and this could cause performance issues when the data is huge. If mergeUnboundColumns is false then the unbound data is sent and merged on the client. This option is used by the [igGrid MVC Helper](http://www.igniteui.com/help/iggrid-developing-asp-net-mvc-applications-with-iggrid). * Checkout [Populating Unbound Columns Remotely (igGrid)](http://www.igniteui.com/help/iggrid-unboundcolumns-populating-with-data-remotely) topic for more information. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "mergeUnboundColumns", optionValue: boolean): void; /** * When dataSource is a remote URL, defines whether to set the type of the remote data source to JSONP. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "jsonpRequest"): boolean; /** * When dataSource is a remote URL, defines whether to set the type of the remote data source to JSONP. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "jsonpRequest", optionValue: boolean): void; /** * Enables/disables grid adjusting its dimensions when its [width](ui.ighierarchicalgrid#options:width) and/or [height](ui.ighierarchicalgrid#options:height) is set in percent (%) and grid parent DOM container is resized. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "enableResizeContainerCheck"): boolean; /** * Enables/disables grid adjusting its dimensions when its [width](ui.ighierarchicalgrid#options:width) and/or [height](ui.ighierarchicalgrid#options:height) is set in percent (%) and grid parent DOM container is resized. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "enableResizeContainerCheck", optionValue: boolean): void; /** * Configures how the feature chooser icon should display on header cells - e.g. to display as gear icon or not. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "featureChooserIconDisplay"): string; @@ -49039,6 +56848,7 @@ interface JQuery { /** * Configures how the feature chooser icon should display on header cells - e.g. to display as gear icon or not. * + * * @optionValue New value to be set. */ @@ -49046,16 +56856,48 @@ interface JQuery { /** * Settings related to content scrolling. + * */ igHierarchicalGrid(optionLiteral: 'option', optionName: "scrollSettings"): IgHierarchicalGridScrollSettings; /** * Settings related to content scrolling. * + * * @optionValue New value to be set. */ igHierarchicalGrid(optionLiteral: 'option', optionName: "scrollSettings", optionValue: IgHierarchicalGridScrollSettings): void; + /** + * Set/Get the locale language setting for the widget. + * + */ + igHierarchicalGrid(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igHierarchicalGrid(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igHierarchicalGrid(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igHierarchicalGrid(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event which is fired when a hierarchical row is about to be expanded */ @@ -49580,6 +57422,10 @@ interface IgGridMultiColumnHeaders { [optionName: string]: any; } interface IgGridMultiColumnHeadersMethods { + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.iggridmulticolumnheader#options:language) + * Note that this method is for rare scenarios, see [language](ui.iggridmulticolumnheader#options:language) or [locale](ui.iggridmulticolumnheader#options:locale) option setter + */ changeLocale(): void; /** @@ -49699,87 +57545,104 @@ interface JQuery { interface IgGridPagingLocale { /** * Text rendered in front of the page size dropdown, when [showPageSizeDropDown](ui.iggridpaging#options:showPageSizeDropDown) is set to true. + * */ pageSizeDropDownLabel?: string; /** * Trailing text for the page size dropdown, when [showPageSizeDropDown](ui.iggridpaging#options:showPageSizeDropDown) is set to true. + * */ pageSizeDropDownTrailingLabel?: string; /** * Text for the next page label. + * */ nextPageLabelText?: string; /** * Text for the previous page label. + * */ prevPageLabelText?: string; /** * Text for the first page label. + * */ firstPageLabelText?: string; /** * Text for the last page label. + * */ lastPageLabelText?: string; /** * Leading label text for the drop down from where the page index can be switched. + * */ currentPageDropDownLeadingLabel?: string; /** * Trailing label text for the drop down from where the page index can be switched. + * */ currentPageDropDownTrailingLabel?: string; /** * Tooltip text for the page index drop down. + * */ currentPageDropDownTooltip?: string; /** * Tooltip text for the page size drop down. + * */ pageSizeDropDownTooltip?: string; /** * Tooltip text for the pager records label. + * */ pagerRecordsLabelTooltip?: string; /** * Tooltip text for the previous page button. + * */ prevPageTooltip?: string; /** * Tooltip text for the next page button. + * */ nextPageTooltip?: string; /** * Tooltip text for the first page button. + * */ firstPageTooltip?: string; /** * Tooltip text for the last page button. + * */ lastPageTooltip?: string; /** * Tooltip text templates of buttons that navigate to a particular page. The format string follows the [igTemplating](http://www.igniteui.com/help/igtemplating-overview) style and syntax. * See also the [pageCountLimit](ui.iggridpaging#options:pageCountLimit) option. + * */ pageTooltipFormat?: string; /** * Custom pager records label template - in [igTemplating](http://www.igniteui.com/help/igtemplating-overview) style and syntax. + * */ pagerRecordsLabelTemplate?: string; @@ -49840,6 +57703,11 @@ interface PageSizeChangingEventUIParam { * Gets the current page size. */ currentPageSize?: number; + + /** + * Gets the new page size. + */ + newPageSize?: number; } interface PageSizeChangedEvent { @@ -49855,7 +57723,7 @@ interface PageSizeChangedEventUIParam { /** * Gets the current page size. */ - currentPageSize?: number; + pageSize?: number; } interface PagerRenderingEvent { @@ -49893,32 +57761,38 @@ interface PagerRenderedEventUIParam { interface IgGridPaging { /** * Number of records loaded and displayed per page. + * */ pageSize?: number; /** * The property in the response data, when using remote data source, that will hold the total number of records in the data source. + * */ recordCountKey?: string; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested page size. + * */ pageSizeUrlKey?: string; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested page index. + * */ pageIndexUrlKey?: string; /** * Current page index that's bound in the data source and rendered in the UI. + * */ currentPageIndex?: number; /** * Type of paging. Delegates all paging functionality to the [$.ig.DataSource](ig.datasource). * + * * Valid values: * "remote" Paging is performed by a remote end-point. * "local" Paging is performed locally by the [$.ig.DataSource](ig.datasource). @@ -49927,6 +57801,7 @@ interface IgGridPaging { /** * If false, a dropdown allowing to change the page size will not be rendered in the UI. + * */ showPageSizeDropDown?: boolean; @@ -50040,6 +57915,7 @@ interface IgGridPaging { /** * Page size dropdown location, when [showPageSizeDropDown](ui.iggridpaging#options:showPageSizeDropDown) is set to true. Can be rendered above the grid header or inside the pager, next to the page links. * + * * Valid values: * "above" The page size drop down will be rendered above the grid header. * "inpager" The page size drop down will be rendered next to page links. @@ -50048,54 +57924,76 @@ interface IgGridPaging { /** * Option specifying whether to show summary label for the currently rendered records or not. + * */ showPagerRecordsLabel?: boolean; /** * Option specifying whether to render the first and last page navigation buttons. + * */ showFirstLastPages?: boolean; /** * Option specifying whether to render the previous and next page navigation buttons. + * */ showPrevNextPages?: boolean; /** * Predefined page sizes that are available to the end user to switch their grid paging to, through a drop down in the grid header. + * */ pageSizeList?: any; /** * Sets/Gets the number of pages which if exceeded a drop down list of page indices is displayed. If the number of pages is less than or equal to this option then buttons for each page are displayed. + * */ pageCountLimit?: number; /** * Number of page buttons, adjacent to and including the [active page](ui.iggridpaging#options:currentPageIndex), that are constantly visible. For the invisible pages, previous and next buttons are used. + * */ visiblePageCount?: number; /** * Drop down width for the page size and page index drop downs. + * */ defaultDropDownWidth?: number; /** * Time in milliseconds for which page drop down will wait for keystrokes before changing the page. + * */ delayOnPageChanged?: number; /** * Enables/disables paging persistence between states. + * */ persist?: boolean; /** * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. + * */ inherit?: boolean; + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event fired before the page index is changed. * Return false in order to cancel page index changing. @@ -50110,7 +58008,6 @@ interface IgGridPaging { /** * Event fired when the page size is about to be changed from the page size dropdown. * Return false in order to cancel page size changing. - * Use ui.newPageSize to get new page size. */ pageSizeChanging?: PageSizeChangingEvent; @@ -50136,6 +58033,13 @@ interface IgGridPaging { [optionName: string]: any; } interface IgGridPagingMethods { + changeGlobalLanguage(): void; + changeGlobalRegional(): void; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.iggridpaging#options:language) + * Note that this method is for rare scenarios, see [language](ui.iggridpaging#options:language) or [locale](ui.iggridpaging#options:locale) option setter + */ changeLocale(): void; /** @@ -50162,6 +58066,8 @@ interface JQuery { } interface JQuery { + igGridPaging(methodName: "changeGlobalLanguage"): void; + igGridPaging(methodName: "changeGlobalRegional"): void; igGridPaging(methodName: "changeLocale"): void; igGridPaging(methodName: "pageIndex", index?: number): number; igGridPaging(methodName: "pageSize", size?: number): number; @@ -50169,66 +58075,77 @@ interface JQuery { /** * Number of records loaded and displayed per page. + * */ igGridPaging(optionLiteral: 'option', optionName: "pageSize"): number; /** * Number of records loaded and displayed per page. * + * * @optionValue New value to be set. */ igGridPaging(optionLiteral: 'option', optionName: "pageSize", optionValue: number): void; /** * The property in the response data, when using remote data source, that will hold the total number of records in the data source. + * */ igGridPaging(optionLiteral: 'option', optionName: "recordCountKey"): string; /** * The property in the response data, when using remote data source, that will hold the total number of records in the data source. * + * * @optionValue New value to be set. */ igGridPaging(optionLiteral: 'option', optionName: "recordCountKey", optionValue: string): void; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested page size. + * */ igGridPaging(optionLiteral: 'option', optionName: "pageSizeUrlKey"): string; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested page size. * + * * @optionValue New value to be set. */ igGridPaging(optionLiteral: 'option', optionName: "pageSizeUrlKey", optionValue: string): void; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested page index. + * */ igGridPaging(optionLiteral: 'option', optionName: "pageIndexUrlKey"): string; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested page index. * + * * @optionValue New value to be set. */ igGridPaging(optionLiteral: 'option', optionName: "pageIndexUrlKey", optionValue: string): void; /** * Current page index that's bound in the data source and rendered in the UI. + * */ igGridPaging(optionLiteral: 'option', optionName: "currentPageIndex"): number; /** * Current page index that's bound in the data source and rendered in the UI. * + * * @optionValue New value to be set. */ igGridPaging(optionLiteral: 'option', optionName: "currentPageIndex", optionValue: number): void; /** * Type of paging. Delegates all paging functionality to the [$.ig.DataSource](ig.datasource). + * */ igGridPaging(optionLiteral: 'option', optionName: "type"): string; @@ -50236,6 +58153,7 @@ interface JQuery { /** * Type of paging. Delegates all paging functionality to the [$.ig.DataSource](ig.datasource). * + * * @optionValue New value to be set. */ @@ -50243,12 +58161,14 @@ interface JQuery { /** * If false, a dropdown allowing to change the page size will not be rendered in the UI. + * */ igGridPaging(optionLiteral: 'option', optionName: "showPageSizeDropDown"): boolean; /** * If false, a dropdown allowing to change the page size will not be rendered in the UI. * + * * @optionValue New value to be set. */ igGridPaging(optionLiteral: 'option', optionName: "showPageSizeDropDown", optionValue: boolean): void; @@ -50503,6 +58423,7 @@ interface JQuery { /** * Page size dropdown location, when [showPageSizeDropDown](ui.iggridpaging#options:showPageSizeDropDown) is set to true. Can be rendered above the grid header or inside the pager, next to the page links. + * */ igGridPaging(optionLiteral: 'option', optionName: "pageSizeDropDownLocation"): string; @@ -50510,6 +58431,7 @@ interface JQuery { /** * Page size dropdown location, when [showPageSizeDropDown](ui.iggridpaging#options:showPageSizeDropDown) is set to true. Can be rendered above the grid header or inside the pager, next to the page links. * + * * @optionValue New value to be set. */ @@ -50517,124 +58439,174 @@ interface JQuery { /** * Option specifying whether to show summary label for the currently rendered records or not. + * */ igGridPaging(optionLiteral: 'option', optionName: "showPagerRecordsLabel"): boolean; /** * Option specifying whether to show summary label for the currently rendered records or not. * + * * @optionValue New value to be set. */ igGridPaging(optionLiteral: 'option', optionName: "showPagerRecordsLabel", optionValue: boolean): void; /** * Option specifying whether to render the first and last page navigation buttons. + * */ igGridPaging(optionLiteral: 'option', optionName: "showFirstLastPages"): boolean; /** * Option specifying whether to render the first and last page navigation buttons. * + * * @optionValue New value to be set. */ igGridPaging(optionLiteral: 'option', optionName: "showFirstLastPages", optionValue: boolean): void; /** * Option specifying whether to render the previous and next page navigation buttons. + * */ igGridPaging(optionLiteral: 'option', optionName: "showPrevNextPages"): boolean; /** * Option specifying whether to render the previous and next page navigation buttons. * + * * @optionValue New value to be set. */ igGridPaging(optionLiteral: 'option', optionName: "showPrevNextPages", optionValue: boolean): void; /** * Predefined page sizes that are available to the end user to switch their grid paging to, through a drop down in the grid header. + * */ igGridPaging(optionLiteral: 'option', optionName: "pageSizeList"): any; /** * Predefined page sizes that are available to the end user to switch their grid paging to, through a drop down in the grid header. * + * * @optionValue New value to be set. */ igGridPaging(optionLiteral: 'option', optionName: "pageSizeList", optionValue: any): void; /** * Sets/Gets the number of pages which if exceeded a drop down list of page indices is displayed. If the number of pages is less than or equal to this option then buttons for each page are displayed. + * */ igGridPaging(optionLiteral: 'option', optionName: "pageCountLimit"): number; /** * Sets/ the number of pages which if exceeded a drop down list of page indices is displayed. If the number of pages is less than or equal to this option then buttons for each page are displayed. * + * * @optionValue New value to be set. */ igGridPaging(optionLiteral: 'option', optionName: "pageCountLimit", optionValue: number): void; /** * Number of page buttons, adjacent to and including the [active page](ui.iggridpaging#options:currentPageIndex), that are constantly visible. For the invisible pages, previous and next buttons are used. + * */ igGridPaging(optionLiteral: 'option', optionName: "visiblePageCount"): number; /** * Number of page buttons, adjacent to and including the [active page](ui.iggridpaging#options:currentPageIndex), that are constantly visible. For the invisible pages, previous and next buttons are used. * + * * @optionValue New value to be set. */ igGridPaging(optionLiteral: 'option', optionName: "visiblePageCount", optionValue: number): void; /** * Drop down width for the page size and page index drop downs. + * */ igGridPaging(optionLiteral: 'option', optionName: "defaultDropDownWidth"): number; /** * Drop down width for the page size and page index drop downs. * + * * @optionValue New value to be set. */ igGridPaging(optionLiteral: 'option', optionName: "defaultDropDownWidth", optionValue: number): void; /** * Time in milliseconds for which page drop down will wait for keystrokes before changing the page. + * */ igGridPaging(optionLiteral: 'option', optionName: "delayOnPageChanged"): number; /** * Time in milliseconds for which page drop down will wait for keystrokes before changing the page. * + * * @optionValue New value to be set. */ igGridPaging(optionLiteral: 'option', optionName: "delayOnPageChanged", optionValue: number): void; /** * Enables/disables paging persistence between states. + * */ igGridPaging(optionLiteral: 'option', optionName: "persist"): boolean; /** * Enables/disables paging persistence between states. * + * * @optionValue New value to be set. */ igGridPaging(optionLiteral: 'option', optionName: "persist", optionValue: boolean): void; /** * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. + * */ igGridPaging(optionLiteral: 'option', optionName: "inherit"): boolean; /** * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. * + * * @optionValue New value to be set. */ igGridPaging(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + /** + * Set/Get the locale language setting for the widget. + * + */ + igGridPaging(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igGridPaging(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igGridPaging(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igGridPaging(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event fired before the page index is changed. * Return false in order to cancel page index changing. @@ -50664,14 +58636,12 @@ interface JQuery { /** * Event fired when the page size is about to be changed from the page size dropdown. * Return false in order to cancel page size changing. - * Use ui.newPageSize to get new page size. */ igGridPaging(optionLiteral: 'option', optionName: "pageSizeChanging"): PageSizeChangingEvent; /** * Event fired when the page size is about to be changed from the page size dropdown. * Return false in order to cancel page size changing. - * Use ui.newPageSize to get new page size. * * @optionValue Define event handler function. */ @@ -50723,26 +58693,31 @@ interface JQuery { interface IgGridResizingColumnSetting { /** * Column key. this is a required property in every column setting if columnIndex is not set. + * */ columnKey?: string; /** * Column index. Can be used in place of column key. the preferred way of populating a column setting is to always use the column keys as identifiers. + * */ columnIndex?: number; /** * Enables disables resizing for the column. + * */ allowResizing?: boolean; /** * Minimum column width in pixels or percents. + * */ minimumWidth?: string|number; /** * Maximum column width in pixels or percents. + * */ maximumWidth?: string|number; @@ -50838,21 +58813,25 @@ interface ColumnResizedEventUIParam { interface IgGridResizing { /** * Resize the column to the size of the longest currently visible cell value. + * */ allowDoubleClickToResize?: boolean; /** * Specifies whether the resizing should be deferred until the user finishes resizing or applied immediately. + * */ deferredResizing?: boolean; /** * A list of column settings that specifies resizing options on a per column basis. + * */ columnSettings?: IgGridResizingColumnSetting[]; /** * The width in pixels of the resizing handle which is position at the right side of each resizeable column header. + * */ handleThreshold?: number; @@ -50861,6 +58840,24 @@ interface IgGridResizing { */ inherit?: boolean; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event fired before a resizing operation is executed. */ @@ -50882,6 +58879,9 @@ interface IgGridResizing { [optionName: string]: any; } interface IgGridResizingMethods { + changeGlobalLanguage(): void; + changeGlobalRegional(): void; + /** * Destroys the resizing widget */ @@ -50894,59 +58894,78 @@ interface IgGridResizingMethods { * @param width Width of the column in pixels or percents. If no width or "*" is specified the column will be auto-sized to the width of the data in it (including header and footer cells). */ resize(column: Object, width?: Object): void; + + /** + * Changes the all locales contained into a specified container to the language specified in [options.language](ui.igwidget#options:language) + * Note that this method is for rare scenarios, use [language](ui.igwidget#options:language) or [locale](ui.igwidget#options:locale) option setter + * + * @param $container Optional parameter - if not set it would use the element of the widget as $container + */ + changeLocale($container: Object): void; } interface JQuery { data(propertyName: "igGridResizing"): IgGridResizingMethods; } interface JQuery { + igGridResizing(methodName: "changeGlobalLanguage"): void; + igGridResizing(methodName: "changeGlobalRegional"): void; igGridResizing(methodName: "destroy"): void; igGridResizing(methodName: "resize", column: Object, width?: Object): void; + igGridResizing(methodName: "changeLocale", $container: Object): void; /** * Resize the column to the size of the longest currently visible cell value. + * */ igGridResizing(optionLiteral: 'option', optionName: "allowDoubleClickToResize"): boolean; /** * Resize the column to the size of the longest currently visible cell value. * + * * @optionValue New value to be set. */ igGridResizing(optionLiteral: 'option', optionName: "allowDoubleClickToResize", optionValue: boolean): void; /** * Gets whether the resizing should be deferred until the user finishes resizing or applied immediately. + * */ igGridResizing(optionLiteral: 'option', optionName: "deferredResizing"): boolean; /** * Sets whether the resizing should be deferred until the user finishes resizing or applied immediately. * + * * @optionValue New value to be set. */ igGridResizing(optionLiteral: 'option', optionName: "deferredResizing", optionValue: boolean): void; /** * A list of column settings that specifies resizing options on a per column basis. + * */ igGridResizing(optionLiteral: 'option', optionName: "columnSettings"): IgGridResizingColumnSetting[]; /** * A list of column settings that specifies resizing options on a per column basis. * + * * @optionValue New value to be set. */ igGridResizing(optionLiteral: 'option', optionName: "columnSettings", optionValue: IgGridResizingColumnSetting[]): void; /** * The width in pixels of the resizing handle which is position at the right side of each resizeable column header. + * */ igGridResizing(optionLiteral: 'option', optionName: "handleThreshold"): number; /** * The width in pixels of the resizing handle which is position at the right side of each resizeable column header. * + * * @optionValue New value to be set. */ igGridResizing(optionLiteral: 'option', optionName: "handleThreshold", optionValue: number): void; @@ -50963,6 +58982,50 @@ interface JQuery { */ igGridResizing(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igGridResizing(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igGridResizing(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igGridResizing(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igGridResizing(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igGridResizing(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igGridResizing(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event fired before a resizing operation is executed. */ @@ -51007,21 +59070,25 @@ interface JQuery { interface IgGridResponsiveColumnSetting { /** * Column key. This is a required property in every column setting if columnIndex is not set. + * */ columnKey?: string; /** * Column index. Can be used in place of column key. The preferred way of populating a column setting is to always use the column keys as identifiers. + * */ columnIndex?: number; /** * A list of predefined classes to decide element's visibility on. + * */ classes?: string; /** * A configuration object to use for the responsive functionality. Uses the keys defined in the widget's responsiveModes object. The classes property is not used if this one is set. + * */ configuration?: any; @@ -51034,26 +59101,31 @@ interface IgGridResponsiveColumnSetting { interface IgGridResponsiveAllowedColumnWidthPerType { /** * Minimal width in pixels string columns can take before forcing vertical rendering + * */ string?: number; /** * Minimal width in pixels number columns can take before forcing vertical rendering + * */ number?: number; /** * Minimal width in pixels bool columns can take before forcing vertical rendering + * */ bool?: number; /** * Minimal width in pixels date columns can take before forcing vertical rendering + * */ date?: number; /** * Minimal width in pixels object columns can take before forcing vertical rendering + * */ object?: number; @@ -51171,37 +59243,44 @@ interface ResponsiveModeChangedEventUIParam { interface IgGridResponsive { /** * A list of column settings that specifies how columns will react based on the environment the grid is run on. + * */ columnSettings?: IgGridResponsiveColumnSetting[]; /** * If this option is set to true an igResponsiveContainer widget will be attached to the igGrid control which will notify the feature when changes in the width of the container occur. + * */ reactOnContainerWidthChanges?: boolean; /** * If this option is set to true the widget will ensure the grid's width is always set to 100%. + * */ forceResponsiveGridWidth?: boolean; /** * The amount of pixels the window needs to resize with for the grid to respond. + * */ responsiveSensitivity?: number; /** * The recognized types of environments and their configuration. + * */ responsiveModes?: any; /** * Enable or disable the responsive vertical rendering for the grid. + * */ enableVerticalRendering?: boolean; /** * The window's width under which the grid will render its contents vertically. * + * * Valid values: * "string" The width in a (px) string * "number" The width as a number @@ -51212,6 +59291,7 @@ interface IgGridResponsive { /** * The width of the properties column when vertical rendering is enabled * + * * Valid values: * "string" The width in a (%) string * "number" The width as a number in percents @@ -51221,6 +59301,7 @@ interface IgGridResponsive { /** * The width of the values column when vertical rendering is enabled * + * * Valid values: * "string" The width in a (%) string * "number" The width as a number in percents @@ -51230,11 +59311,13 @@ interface IgGridResponsive { /** * When windowWidthToRenderVertically is null, determine minimal widths columns can take before * forcing vertical rendering for the grid + * */ allowedColumnWidthPerType?: IgGridResponsiveAllowedColumnWidthPerType; /** * Specifies a template to render a record with in a list-view style layout per mode. + * */ singleColumnTemplate?: any; @@ -51356,78 +59439,91 @@ interface JQuery { /** * A list of column settings that specifies how columns will react based on the environment the grid is run on. + * */ igGridResponsive(optionLiteral: 'option', optionName: "columnSettings"): IgGridResponsiveColumnSetting[]; /** * A list of column settings that specifies how columns will react based on the environment the grid is run on. * + * * @optionValue New value to be set. */ igGridResponsive(optionLiteral: 'option', optionName: "columnSettings", optionValue: IgGridResponsiveColumnSetting[]): void; /** * If this option is set to true an igResponsiveContainer widget will be attached to the igGrid control which will notify the feature when changes in the width of the container occur. + * */ igGridResponsive(optionLiteral: 'option', optionName: "reactOnContainerWidthChanges"): boolean; /** * If this option is set to true an igResponsiveContainer widget will be attached to the igGrid control which will notify the feature when changes in the width of the container occur. * + * * @optionValue New value to be set. */ igGridResponsive(optionLiteral: 'option', optionName: "reactOnContainerWidthChanges", optionValue: boolean): void; /** * If this option is set to true the widget will ensure the grid's width is always set to 100%. + * */ igGridResponsive(optionLiteral: 'option', optionName: "forceResponsiveGridWidth"): boolean; /** * If this option is set to true the widget will ensure the grid's width is always set to 100%. * + * * @optionValue New value to be set. */ igGridResponsive(optionLiteral: 'option', optionName: "forceResponsiveGridWidth", optionValue: boolean): void; /** * The amount of pixels the window needs to resize with for the grid to respond. + * */ igGridResponsive(optionLiteral: 'option', optionName: "responsiveSensitivity"): number; /** * The amount of pixels the window needs to resize with for the grid to respond. * + * * @optionValue New value to be set. */ igGridResponsive(optionLiteral: 'option', optionName: "responsiveSensitivity", optionValue: number): void; /** * The recognized types of environments and their configuration. + * */ igGridResponsive(optionLiteral: 'option', optionName: "responsiveModes"): any; /** * The recognized types of environments and their configuration. * + * * @optionValue New value to be set. */ igGridResponsive(optionLiteral: 'option', optionName: "responsiveModes", optionValue: any): void; /** * Enable or disable the responsive vertical rendering for the grid. + * */ igGridResponsive(optionLiteral: 'option', optionName: "enableVerticalRendering"): boolean; /** * Enable or disable the responsive vertical rendering for the grid. * + * * @optionValue New value to be set. */ igGridResponsive(optionLiteral: 'option', optionName: "enableVerticalRendering", optionValue: boolean): void; /** * The window's width under which the grid will render its contents vertically. + * */ igGridResponsive(optionLiteral: 'option', optionName: "windowWidthToRenderVertically"): string|number; @@ -51435,6 +59531,7 @@ interface JQuery { /** * The window's width under which the grid will render its contents vertically. * + * * @optionValue New value to be set. */ @@ -51442,6 +59539,7 @@ interface JQuery { /** * The width of the properties column when vertical rendering is enabled + * */ igGridResponsive(optionLiteral: 'option', optionName: "propertiesColumnWidth"): string|number; @@ -51449,6 +59547,7 @@ interface JQuery { /** * The width of the properties column when vertical rendering is enabled * + * * @optionValue New value to be set. */ @@ -51456,6 +59555,7 @@ interface JQuery { /** * The width of the values column when vertical rendering is enabled + * */ igGridResponsive(optionLiteral: 'option', optionName: "valuesColumnWidth"): string|number; @@ -51463,6 +59563,7 @@ interface JQuery { /** * The width of the values column when vertical rendering is enabled * + * * @optionValue New value to be set. */ @@ -51471,6 +59572,7 @@ interface JQuery { /** * When windowWidthToRenderVertically is null, determine minimal widths columns can take before * forcing vertical rendering for the grid + * */ igGridResponsive(optionLiteral: 'option', optionName: "allowedColumnWidthPerType"): IgGridResponsiveAllowedColumnWidthPerType; @@ -51478,18 +59580,21 @@ interface JQuery { * When windowWidthToRenderVertically is null, determine minimal widths columns can take before * forcing vertical rendering for the grid * + * * @optionValue New value to be set. */ igGridResponsive(optionLiteral: 'option', optionName: "allowedColumnWidthPerType", optionValue: IgGridResponsiveAllowedColumnWidthPerType): void; /** * Gets a template to render a record with in a list-view style layout per mode. + * */ igGridResponsive(optionLiteral: 'option', optionName: "singleColumnTemplate"): any; /** * Sets a template to render a record with in a list-view style layout per mode. * + * * @optionValue New value to be set. */ igGridResponsive(optionLiteral: 'option', optionName: "singleColumnTemplate", optionValue: any): void; @@ -51574,21 +59679,25 @@ interface JQuery { interface IgGridRowSelectorsLocale { /** * Selected records text for the select/deselect all overlay. + * */ selectedRecordsText?: string; /** * Deselected records text for the select/deselect all overlay. + * */ deselectedRecordsText?: string; /** * Select all text for the select/deselect all overlay. + * */ selectAllText?: string; /** * Deselect all text for the select/deselect all overlay. + * */ deselectAllText?: string; @@ -51739,22 +59848,26 @@ interface CheckBoxStateChangedEventUIParam { interface IgGridRowSelectors { /** * Determines whether the row selectors column should contain row numbering + * */ enableRowNumbering?: boolean; /** * Determines whether the row selectors column should contain checkboxes + * */ enableCheckBoxes?: boolean; /** * The seed to be added to the default numbering + * */ rowNumberingSeed?: number; /** * defines width of the row selector`s column in pixels or percentage. * + * * Valid values: * "string" The row selector column width can be set in pixels (px) and percentage (%) * "number" The row selector width can be set as a number @@ -51766,11 +59879,13 @@ interface IgGridRowSelectors { * Determines whether the selection feature is required for the row selectors. If set to "false" * the widget will not check for Selection availability. If set to "true" an exception will be thrown if Selection is * not available. + * */ requireSelection?: boolean; /** * Determines whether checkboxes will be shown only if row selectors are on focus/selected. + * */ showCheckBoxesOnFocus?: boolean; @@ -51781,6 +59896,7 @@ interface IgGridRowSelectors { /** * Enables/disables showing an overlay after clicking on the header checkbox, which allows selecting all records from all pages. + * */ enableSelectAllForPaging?: boolean; @@ -51790,6 +59906,7 @@ interface IgGridRowSelectors { * Element with attribute data-rs-close-all is used for closing the overlay * The default template is "
    You have selected ${checked} records. Select all ${totalRecordsCount} records
    " * There is also ${allCheckedRecords} parameter which is not used in the default template, but it represents the checked records from all pages. + * */ selectAllForPagingTemplate?: string; @@ -51799,6 +59916,7 @@ interface IgGridRowSelectors { * Element with attribute data-rs-close-all is used for closing the overlay * The default template is "
    You have deselected ${unchecked} records. Deselect all ${totalRecordsCount} records
    " * There is also ${allCheckedRecords} parameter which is not used in the default template, but it represents the checked records from all pages. + * */ deselectAllForPagingTemplate?: string; locale?: IgGridRowSelectorsLocale; @@ -51825,6 +59943,11 @@ interface IgGridRowSelectors { } interface IgGridRowSelectorsMethods { destroy(): void; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.iggridrowselectors#options:language) + * Note that this method is for rare scenarios, see [language](ui.iggridrowselectors#options:language) or [locale](ui.iggridrowselectors#options:locale) option setter + */ changeLocale(): void; } interface JQuery { @@ -51837,42 +59960,49 @@ interface JQuery { /** * Determines whether the row selectors column should contain row numbering + * */ igGridRowSelectors(optionLiteral: 'option', optionName: "enableRowNumbering"): boolean; /** * Determines whether the row selectors column should contain row numbering * + * * @optionValue New value to be set. */ igGridRowSelectors(optionLiteral: 'option', optionName: "enableRowNumbering", optionValue: boolean): void; /** * Determines whether the row selectors column should contain checkboxes + * */ igGridRowSelectors(optionLiteral: 'option', optionName: "enableCheckBoxes"): boolean; /** * Determines whether the row selectors column should contain checkboxes * + * * @optionValue New value to be set. */ igGridRowSelectors(optionLiteral: 'option', optionName: "enableCheckBoxes", optionValue: boolean): void; /** * The seed to be added to the default numbering + * */ igGridRowSelectors(optionLiteral: 'option', optionName: "rowNumberingSeed"): number; /** * The seed to be added to the default numbering * + * * @optionValue New value to be set. */ igGridRowSelectors(optionLiteral: 'option', optionName: "rowNumberingSeed", optionValue: number): void; /** * Defines width of the row selector`s column in pixels or percentage. + * */ igGridRowSelectors(optionLiteral: 'option', optionName: "rowSelectorColumnWidth"): string|number; @@ -51880,6 +60010,7 @@ interface JQuery { /** * Defines width of the row selector`s column in pixels or percentage. * + * * @optionValue New value to be set. */ @@ -51889,6 +60020,7 @@ interface JQuery { * Determines whether the selection feature is required for the row selectors. If set to "false" * the widget will not check for Selection availability. If set to "true" an exception will be thrown if Selection is * not available. + * */ igGridRowSelectors(optionLiteral: 'option', optionName: "requireSelection"): boolean; @@ -51897,18 +60029,21 @@ interface JQuery { * the widget will not check for Selection availability. If set to "true" an exception will be thrown if Selection is * not available. * + * * @optionValue New value to be set. */ igGridRowSelectors(optionLiteral: 'option', optionName: "requireSelection", optionValue: boolean): void; /** * Determines whether checkboxes will be shown only if row selectors are on focus/selected. + * */ igGridRowSelectors(optionLiteral: 'option', optionName: "showCheckBoxesOnFocus"): boolean; /** * Determines whether checkboxes will be shown only if row selectors are on focus/selected. * + * * @optionValue New value to be set. */ igGridRowSelectors(optionLiteral: 'option', optionName: "showCheckBoxesOnFocus", optionValue: boolean): void; @@ -51927,12 +60062,14 @@ interface JQuery { /** * Enables/disables showing an overlay after clicking on the header checkbox, which allows selecting all records from all pages. + * */ igGridRowSelectors(optionLiteral: 'option', optionName: "enableSelectAllForPaging"): boolean; /** * Enables/disables showing an overlay after clicking on the header checkbox, which allows selecting all records from all pages. * + * * @optionValue New value to be set. */ igGridRowSelectors(optionLiteral: 'option', optionName: "enableSelectAllForPaging", optionValue: boolean): void; @@ -51943,6 +60080,7 @@ interface JQuery { * Element with attribute data-rs-close-all is used for closing the overlay * The default template is "
    You have selected ${checked} records. Select all ${totalRecordsCount} records
    " * There is also ${allCheckedRecords} parameter which is not used in the default template, but it represents the checked records from all pages. + * */ igGridRowSelectors(optionLiteral: 'option', optionName: "selectAllForPagingTemplate"): string; @@ -51953,6 +60091,7 @@ interface JQuery { * The default template is "
    You have selected ${checked} records. Select all ${totalRecordsCount} records
    " * There is also ${allCheckedRecords} parameter which is not used in the default template, but it represents the checked records from all pages. * + * * @optionValue New value to be set. */ igGridRowSelectors(optionLiteral: 'option', optionName: "selectAllForPagingTemplate", optionValue: string): void; @@ -51963,6 +60102,7 @@ interface JQuery { * Element with attribute data-rs-close-all is used for closing the overlay * The default template is "
    You have deselected ${unchecked} records. Deselect all ${totalRecordsCount} records
    " * There is also ${allCheckedRecords} parameter which is not used in the default template, but it represents the checked records from all pages. + * */ igGridRowSelectors(optionLiteral: 'option', optionName: "deselectAllForPagingTemplate"): string; @@ -51973,6 +60113,7 @@ interface JQuery { * The default template is "
    You have deselected ${unchecked} records. Deselect all ${totalRecordsCount} records
    " * There is also ${allCheckedRecords} parameter which is not used in the default template, but it represents the checked records from all pages. * + * * @optionValue New value to be set. */ igGridRowSelectors(optionLiteral: 'option', optionName: "deselectAllForPagingTemplate", optionValue: string): void; @@ -52201,17 +60342,20 @@ interface ActiveRowChangedEventUIParam { interface IgGridSelection { /** * Enables / Disables multiple selection of cells and rows - depending on the mode + * */ multipleSelection?: boolean; /** * Enables / disables selection via dragging with the mouse - only applicable for cell selection + * */ mouseDragSelect?: boolean; /** * Defines type of the selection. * + * * Valid values: * "row" Defines row selection mode. * "cell" Defines cell selection mode. @@ -52220,36 +60364,43 @@ interface IgGridSelection { /** * Enables / disables activation of rows and cells. Activation implies ability to perform navigating through cells and rows via the keyboard, and selecting rows and cells using CTRL / SHIFT - in the way cells/rows are selected in Ms Excel + * */ activation?: boolean; /** * If wrapAround is enabled and selection is on the first or last row or cell, then when the end user tries to go beyond that, the first/last row or cell will be selected + * */ wrapAround?: boolean; /** * If true will basically skip going into child grids with down / up / right / left arrow keys, when in the context of hierarchical grid + * */ skipChildren?: boolean; /** * If true multiple selection of cells is done as if CTRL is being held. the option is disregarded if mode is set to row. this option is useful for enabling multiple discountinued selection on touch environments. + * */ multipleCellSelectOnClick?: boolean; /** - * Enables / disables selection via continuous touch event - only applicable for cell selection and touch-supported environments + * Deprecated="true" Enables / disables selection via continuous touch event - only applicable for cell selection and touch-supported environments + * */ touchDragSelect?: boolean; /** * Enables / disables selection persistance between states. + * */ persist?: boolean; /** * Enables / disables the ability to ctrl drag multiple selection windows when selection mode is 'cell' + * */ allowMultipleRangeSelection?: boolean; @@ -52548,30 +60699,35 @@ interface JQuery { /** * Enables / Disables multiple selection of cells and rows - depending on the mode + * */ igGridSelection(optionLiteral: 'option', optionName: "multipleSelection"): boolean; /** * Enables / Disables multiple selection of cells and rows - depending on the mode * + * * @optionValue New value to be set. */ igGridSelection(optionLiteral: 'option', optionName: "multipleSelection", optionValue: boolean): void; /** * Enables / disables selection via dragging with the mouse - only applicable for cell selection + * */ igGridSelection(optionLiteral: 'option', optionName: "mouseDragSelect"): boolean; /** * Enables / disables selection via dragging with the mouse - only applicable for cell selection * + * * @optionValue New value to be set. */ igGridSelection(optionLiteral: 'option', optionName: "mouseDragSelect", optionValue: boolean): void; /** * Defines type of the selection. + * */ igGridSelection(optionLiteral: 'option', optionName: "mode"): string; @@ -52579,6 +60735,7 @@ interface JQuery { /** * Defines type of the selection. * + * * @optionValue New value to be set. */ @@ -52586,59 +60743,69 @@ interface JQuery { /** * Enables / disables activation of rows and cells. Activation implies ability to perform navigating through cells and rows via the keyboard, and selecting rows and cells using CTRL / SHIFT - in the way cells/rows are selected in Ms Excel + * */ igGridSelection(optionLiteral: 'option', optionName: "activation"): boolean; /** * Enables / disables activation of rows and cells. Activation implies ability to perform navigating through cells and rows via the keyboard, and selecting rows and cells using CTRL / SHIFT - in the way cells/rows are selected in Ms Excel * + * * @optionValue New value to be set. */ igGridSelection(optionLiteral: 'option', optionName: "activation", optionValue: boolean): void; /** * If wrapAround is enabled and selection is on the first or last row or cell, then when the end user tries to go beyond that, the first/last row or cell will be selected + * */ igGridSelection(optionLiteral: 'option', optionName: "wrapAround"): boolean; /** * If wrapAround is enabled and selection is on the first or last row or cell, then when the end user tries to go beyond that, the first/last row or cell will be selected * + * * @optionValue New value to be set. */ igGridSelection(optionLiteral: 'option', optionName: "wrapAround", optionValue: boolean): void; /** * If true will basically skip going into child grids with down / up / right / left arrow keys, when in the context of hierarchical grid + * */ igGridSelection(optionLiteral: 'option', optionName: "skipChildren"): boolean; /** * If true will basically skip going into child grids with down / up / right / left arrow keys, when in the context of hierarchical grid * + * * @optionValue New value to be set. */ igGridSelection(optionLiteral: 'option', optionName: "skipChildren", optionValue: boolean): void; /** * If true multiple selection of cells is done as if CTRL is being held. the option is disregarded if mode is set to row. this option is useful for enabling multiple discountinued selection on touch environments. + * */ igGridSelection(optionLiteral: 'option', optionName: "multipleCellSelectOnClick"): boolean; /** * If true multiple selection of cells is done as if CTRL is being held. the option is disregarded if mode is set to row. this option is useful for enabling multiple discountinued selection on touch environments. * + * * @optionValue New value to be set. */ igGridSelection(optionLiteral: 'option', optionName: "multipleCellSelectOnClick", optionValue: boolean): void; /** - * Enables / disables selection via continuous touch event - only applicable for cell selection and touch-supported environments + * Deprecated="true" Enables / disables selection via continuous touch event - only applicable for cell selection and touch-supported environments + * */ igGridSelection(optionLiteral: 'option', optionName: "touchDragSelect"): boolean; /** - * Enables / disables selection via continuous touch event - only applicable for cell selection and touch-supported environments + * Deprecated="true" Enables / disables selection via continuous touch event - only applicable for cell selection and touch-supported environments + * * * @optionValue New value to be set. */ @@ -52646,24 +60813,28 @@ interface JQuery { /** * Enables / disables selection persistance between states. + * */ igGridSelection(optionLiteral: 'option', optionName: "persist"): boolean; /** * Enables / disables selection persistance between states. * + * * @optionValue New value to be set. */ igGridSelection(optionLiteral: 'option', optionName: "persist", optionValue: boolean): void; /** * Enables / disables the ability to ctrl drag multiple selection windows when selection mode is 'cell' + * */ igGridSelection(optionLiteral: 'option', optionName: "allowMultipleRangeSelection"): boolean; /** * Enables / disables the ability to ctrl drag multiple selection windows when selection mode is 'cell' * + * * @optionValue New value to be set. */ igGridSelection(optionLiteral: 'option', optionName: "allowMultipleRangeSelection", optionValue: boolean): void; @@ -52833,6 +61004,24 @@ interface IgGridModalDialog { */ tabIndex?: number; + /** + * Set/Get the locale setting for the widget. + * + */ + locale?: any; + + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event fired before the modal dialog is opened. */ @@ -52888,12 +61077,27 @@ interface IgGridModalDialog { } interface IgGridModalDialogMethods { openModalDialog(): void; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.iggridmodaldialog#options:language) + * Note that this method is for rare scenarios, see [language](ui.iggridmodaldialog#options:language) or [locale](ui.iggridmodaldialog#options:locale) option setter + */ changeLocale(): void; closeModalDialog(accepted: Object, e: Object): void; getCaptionButtonContainer(): void; getFooter(): void; getContent(): void; destroy(): void; + + /** + * Changes the widget language to global language. Global language is the value in $.ig.util.language + */ + changeGlobalLanguage(): void; + + /** + * Changes the widget regional settins to global regional settings. Global regional settings are container in $.ig.util.regional + */ + changeGlobalRegional(): void; } interface JQuery { data(propertyName: "igGridModalDialog"): IgGridModalDialogMethods; @@ -52921,6 +61125,13 @@ declare namespace Infragistics { class EditorProvider { /** * Create handlers cache + * + * @param callbacks + * @param key + * @param editorOptions + * @param tabIndex + * @param format + * @param element */ createEditor(callbacks: Object, key: Object, editorOptions: Object, tabIndex: Object, format: Object, element: Object): void; keyDown(evt: Object, ui: Object): void; @@ -52944,6 +61155,13 @@ declare namespace Infragistics { class EditorProviderBase { /** * Call parent createEditor + * + * @param callbacks + * @param key + * @param editorOptions + * @param tabIndex + * @param format + * @param element */ createEditor(callbacks: Object, key: Object, editorOptions: Object, tabIndex: Object, format: Object, element: Object): void; textChanged(evt: Object, ui: Object): void; @@ -53152,6 +61370,10 @@ class SortingExpressionsManager { /** * Insert expr at the first position of the se (sorting expressions) if there are not any other expressions with flag group by * otherwise if there are such expressions inserts after the last + * + * @param se + * @param expr + * @param feature */ addSortingExpression(se: Object, expr: Object, feature: Object): void; setFormattersForSortingExprs(exprs: Object, grid: Object): void; @@ -53166,6 +61388,8 @@ interface JQuery { igGridModalDialog(methodName: "getFooter"): void; igGridModalDialog(methodName: "getContent"): void; igGridModalDialog(methodName: "destroy"): void; + igGridModalDialog(methodName: "changeGlobalLanguage"): void; + igGridModalDialog(methodName: "changeGlobalRegional"): void; /** * The default modal dialog width in pixels. @@ -53221,6 +61445,50 @@ interface JQuery { */ igGridModalDialog(optionLiteral: 'option', optionName: "tabIndex", optionValue: number): void; + /** + * Set/Get the locale setting for the widget. + * + */ + igGridModalDialog(optionLiteral: 'option', optionName: "locale"): any; + + /** + * Set/Get the locale setting for the widget. + * + * + * @optionValue New value to be set. + */ + igGridModalDialog(optionLiteral: 'option', optionName: "locale", optionValue: any): void; + + /** + * Set/Get the locale language setting for the widget. + * + */ + igGridModalDialog(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igGridModalDialog(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igGridModalDialog(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igGridModalDialog(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event fired before the modal dialog is opened. */ @@ -53356,76 +61624,91 @@ interface JQuery { interface IgGridSortingLocale { /** * Custom sorted column tooltip in [igTemplating](http://www.igniteui.com/help/igtemplating-overview) format. + * */ sortedColumnTooltipFormat?: string; /** * Unsorted column tooltip. + * */ unsortedColumnTooltip?: string; /** * Ascending text used for header title. + * */ ascending?: string; /** * Descending text used for header title. + * */ descending?: string; /** * Specifies sortby button text for each unsorted column in multiple sorting dialog. + * */ modalDialogSortByButtonText?: string; /** * Specifies reset button text in the modal dialog. + * */ modalDialogResetButton?: string; /** * Specifies caption for each descending sorted column in multiple sorting dialog. + * */ modalDialogCaptionButtonDesc?: string; /** * Specifies caption for each ascending sorted column in multiple sorting dialog. + * */ modalDialogCaptionButtonAsc?: string; /** * Specifies caption for unsort button in multiple sorting dialog. + * */ modalDialogCaptionButtonUnsort?: string; /** * Specifies the text of the feature chooser sorting button. + * */ featureChooserText?: string; /** * Specifies caption text for multiple sorting dialog. + * */ modalDialogCaptionText?: string; /** * Specifies text of button which applies changes in modal dialog. + * */ modalDialogButtonApplyText?: string; /** * Specifies text of button which cancels the changes in the advanced sorting modal dialog. + * */ modalDialogButtonCancelText?: string; /** * Specifies the text shown in the feature chooser item for sorting in ascending order (displayed only on touch environment). + * */ featureChooserSortAsc?: string; /** * Specifies the text shown in the feature chooser item for sorting in descending order (displayed only on touch environment). + * */ featureChooserSortDesc?: string; @@ -53438,17 +61721,20 @@ interface IgGridSortingLocale { interface IgGridSortingColumnSetting { /** * Identifies the grid column by key. Either key or index must be set in every column setting. + * */ columnKey?: string; /** * Identifies the grid column by index. Either key or index must be set in every column setting. + * */ columnIndex?: number; /** * This will be the first sort direction when the column hasn't been sorted before. * + * * Valid values: * "asc" The first sort of the column data will be in ascending order. * "desc" The first sort of the column data will be in descending order. @@ -53458,6 +61744,7 @@ interface IgGridSortingColumnSetting { /** * The current (or default) sort direction. If this setting is specified, the column will be rendered sorted according to this option. * + * * Valid values: * "asc" The initial sort of the column data will be in ascending order. * "desc" The initial sort of the column data will be in descending order. @@ -53466,6 +61753,7 @@ interface IgGridSortingColumnSetting { /** * Enables/disables sorting on the specified column. By default all columns are sortable. + * */ allowSorting?: boolean; @@ -53480,6 +61768,7 @@ interface IgGridSortingColumnSetting { * 1 - indicating that val1 > val2, * -1 - indicating that val1 < val2. * + * * Valid values: * "string" The name of the function as a string located in the global window object. * "function" Function which will be used for custom comparison. @@ -53616,6 +61905,7 @@ interface IgGridSorting { /** * Defines local or remote sorting operations. * + * * Valid values: * "remote" Sorting is performed remotely as a server-side operation. * "local" Sorting is performed locally by the [$.ig.DataSource](ig.datasource) component. @@ -53624,32 +61914,38 @@ interface IgGridSorting { /** * Enables or disables the case sensitivity of the sorting. Works only for [local](ui.iggridsorting#options:type) sorting. + * */ caseSensitive?: boolean; /** * Enables/disables special styling for sorted columns. If false, sorted column cells will not have any special sort-related styling. + * */ applySortedColumnCss?: boolean; /** * URL param name which specifies how sorting expressions will be encoded in the URL. Uses OData conventions. ex: ?sort(col1)=asc + * */ sortUrlKey?: string; /** * URL param value for ascending type of sorting. Uses OData conventions. Example: ?sort(col1)=asc + * */ sortUrlKeyAscValue?: string; /** * URL param value for descending type of sorting. Uses OData conventions. Example: ?sort(col1)=desc + * */ sortUrlKeyDescValue?: string; /** * Defines single column sorting or multiple column sorting. * + * * Valid values: * "single" Only a single column can be sorted. Previously sorted columns will not preserve their sorting upon sorting a new column. * "multi" If enabled, previous sorted state for columns won't be cleared @@ -53658,12 +61954,14 @@ interface IgGridSorting { /** * Custom sort function(or name of the function as a string) accepting three parameters - the data to be sorted, an array of data source field definitions, and the direction to sort with (optional). The function should return the sorted data array. + * */ customSortFunction?: Function; /** * Specifies which direction to use on the first click / keydown, if the column is sorted for the first time. * + * * Valid values: * "ascending" The first sort of the column data will be in ascending order. * "descending" The first sort of the column data will be in descending order. @@ -53672,6 +61970,7 @@ interface IgGridSorting { /** * Specifies whether sorting to be applied immediately when click sort/unsort columns when using the multiple sorting dialog. When it is false Apply button shows and sorting is applied when the button is clicked. + * */ modalDialogSortOnClick?: boolean; @@ -53763,6 +62062,7 @@ interface IgGridSorting { /** * Specifies width of multiple sorting dialog. * + * * Valid values: * "string" Specifies the width in pixels as a string ("300px"). * "number" Specifies the width in pixels as a number (300) @@ -53772,6 +62072,7 @@ interface IgGridSorting { /** * Specifies height of multiple sorting dialog. * + * * Valid values: * "string" The widget height can be set in pixels (px) and percentage (%). * "number" The widget height can be set in pixels as a number. @@ -53780,16 +62081,19 @@ interface IgGridSorting { /** * Specifies time of milliseconds for animation duration to show/hide modal dialog. + * */ modalDialogAnimationDuration?: number; /** * A list of custom column settings that specify custom sorting settings for a specific column (whether sorting is enabled / disabled, default sort direction, first sort direction, etc.). + * */ columnSettings?: IgGridSortingColumnSetting[]; /** * Enables/disables sorting persistence when the grid is rebound. + * */ persist?: boolean; @@ -53803,14 +62107,28 @@ interface IgGridSorting { /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. + * */ dialogWidget?: string; /** * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. + * */ inherit?: boolean; + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event fired before sorting is invoked for a certain column. * Return false in order to cancel column sorting. @@ -53888,6 +62206,13 @@ interface IgGridSorting { [optionName: string]: any; } interface IgGridSortingMethods { + changeGlobalLanguage(): void; + changeGlobalRegional(): void; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.iggridsorting#options:language) + * Note that this method is for rare scenarios, see [language](ui.iggridsorting#options:language) or [locale](ui.iggridsorting#options:locale) option setter + */ changeLocale(): void; /** @@ -53895,6 +62220,7 @@ interface IgGridSortingMethods { * * @param index Column key (string) or index (number) - for multi-row grid only column key can be used. Specifies the column which we want to sort. If the mode is multiple, previous sorting states are not cleared. * @param direction Specifies sorting direction (ascending or descending) + * @param header */ sortColumn(index: Object, direction: Object, header: Object): void; @@ -53935,6 +62261,8 @@ interface IgGridSortingMethods { /** * Renders content of multiple sorting dialog - sorted and unsorted columns. + * + * @param isToCallEvents */ renderMultipleSortingDialogContent(isToCallEvents: Object): void; @@ -53948,6 +62276,8 @@ interface JQuery { } interface JQuery { + igGridSorting(methodName: "changeGlobalLanguage"): void; + igGridSorting(methodName: "changeGlobalRegional"): void; igGridSorting(methodName: "changeLocale"): void; igGridSorting(methodName: "sortColumn", index: Object, direction: Object, header: Object): void; igGridSorting(methodName: "sortMultiple", exprs?: any[]): void; @@ -53961,6 +62291,7 @@ interface JQuery { /** * Defines local or remote sorting operations. + * */ igGridSorting(optionLiteral: 'option', optionName: "type"): string; @@ -53968,6 +62299,7 @@ interface JQuery { /** * Defines local or remote sorting operations. * + * * @optionValue New value to be set. */ @@ -53975,66 +62307,77 @@ interface JQuery { /** * Enables or disables the case sensitivity of the sorting. Works only for [local](ui.iggridsorting#options:type) sorting. + * */ igGridSorting(optionLiteral: 'option', optionName: "caseSensitive"): boolean; /** * Enables or disables the case sensitivity of the sorting. Works only for [local](ui.iggridsorting#options:type) sorting. * + * * @optionValue New value to be set. */ igGridSorting(optionLiteral: 'option', optionName: "caseSensitive", optionValue: boolean): void; /** * Enables/disables special styling for sorted columns. If false, sorted column cells will not have any special sort-related styling. + * */ igGridSorting(optionLiteral: 'option', optionName: "applySortedColumnCss"): boolean; /** * Enables/disables special styling for sorted columns. If false, sorted column cells will not have any special sort-related styling. * + * * @optionValue New value to be set. */ igGridSorting(optionLiteral: 'option', optionName: "applySortedColumnCss", optionValue: boolean): void; /** * URL param name which specifies how sorting expressions will be encoded in the URL. Uses OData conventions. ex: ?sort(col1)=asc + * */ igGridSorting(optionLiteral: 'option', optionName: "sortUrlKey"): string; /** * URL param name which specifies how sorting expressions will be encoded in the URL. Uses OData conventions. ex: ?sort(col1)=asc * + * * @optionValue New value to be set. */ igGridSorting(optionLiteral: 'option', optionName: "sortUrlKey", optionValue: string): void; /** * URL param value for ascending type of sorting. Uses OData conventions. Example: ?sort(col1)=asc + * */ igGridSorting(optionLiteral: 'option', optionName: "sortUrlKeyAscValue"): string; /** * URL param value for ascending type of sorting. Uses OData conventions. Example: ?sort(col1)=asc * + * * @optionValue New value to be set. */ igGridSorting(optionLiteral: 'option', optionName: "sortUrlKeyAscValue", optionValue: string): void; /** * URL param value for descending type of sorting. Uses OData conventions. Example: ?sort(col1)=desc + * */ igGridSorting(optionLiteral: 'option', optionName: "sortUrlKeyDescValue"): string; /** * URL param value for descending type of sorting. Uses OData conventions. Example: ?sort(col1)=desc * + * * @optionValue New value to be set. */ igGridSorting(optionLiteral: 'option', optionName: "sortUrlKeyDescValue", optionValue: string): void; /** * Defines single column sorting or multiple column sorting. + * */ igGridSorting(optionLiteral: 'option', optionName: "mode"): string; @@ -54042,6 +62385,7 @@ interface JQuery { /** * Defines single column sorting or multiple column sorting. * + * * @optionValue New value to be set. */ @@ -54049,18 +62393,21 @@ interface JQuery { /** * Custom sort function(or name of the function as a string) accepting three parameters - the data to be sorted, an array of data source field definitions, and the direction to sort with (optional). The function should return the sorted data array. + * */ igGridSorting(optionLiteral: 'option', optionName: "customSortFunction"): Function; /** * Custom sort function(or name of the function as a string) accepting three parameters - the data to be sorted, an array of data source field definitions, and the direction to sort with (optional). The function should return the sorted data array. * + * * @optionValue New value to be set. */ igGridSorting(optionLiteral: 'option', optionName: "customSortFunction", optionValue: Function): void; /** * Gets which direction to use on the first click / keydown, if the column is sorted for the first time. + * */ igGridSorting(optionLiteral: 'option', optionName: "firstSortDirection"): string; @@ -54068,6 +62415,7 @@ interface JQuery { /** * Sets which direction to use on the first click / keydown, if the column is sorted for the first time. * + * * @optionValue New value to be set. */ @@ -54075,12 +62423,14 @@ interface JQuery { /** * Gets whether sorting to be applied immediately when click sort/unsort columns when using the multiple sorting dialog. When it is false Apply button shows and sorting is applied when the button is clicked. + * */ igGridSorting(optionLiteral: 'option', optionName: "modalDialogSortOnClick"): boolean; /** * Sets whether sorting to be applied immediately when click sort/unsort columns when using the multiple sorting dialog. When it is false Apply button shows and sorting is applied when the button is clicked. * + * * @optionValue New value to be set. */ igGridSorting(optionLiteral: 'option', optionName: "modalDialogSortOnClick", optionValue: boolean): void; @@ -54281,6 +62631,7 @@ interface JQuery { /** * Gets width of multiple sorting dialog. + * */ igGridSorting(optionLiteral: 'option', optionName: "modalDialogWidth"): string|number; @@ -54288,6 +62639,7 @@ interface JQuery { /** * Sets width of multiple sorting dialog. * + * * @optionValue New value to be set. */ @@ -54295,6 +62647,7 @@ interface JQuery { /** * Gets height of multiple sorting dialog. + * */ igGridSorting(optionLiteral: 'option', optionName: "modalDialogHeight"): string|number; @@ -54302,6 +62655,7 @@ interface JQuery { /** * Sets height of multiple sorting dialog. * + * * @optionValue New value to be set. */ @@ -54309,36 +62663,42 @@ interface JQuery { /** * Gets time of milliseconds for animation duration to show/hide modal dialog. + * */ igGridSorting(optionLiteral: 'option', optionName: "modalDialogAnimationDuration"): number; /** * Sets time of milliseconds for animation duration to show/hide modal dialog. * + * * @optionValue New value to be set. */ igGridSorting(optionLiteral: 'option', optionName: "modalDialogAnimationDuration", optionValue: number): void; /** * A list of custom column settings that specify custom sorting settings for a specific column (whether sorting is enabled / disabled, default sort direction, first sort direction, etc.). + * */ igGridSorting(optionLiteral: 'option', optionName: "columnSettings"): IgGridSortingColumnSetting[]; /** * A list of custom column settings that specify custom sorting settings for a specific column (whether sorting is enabled / disabled, default sort direction, first sort direction, etc.). * + * * @optionValue New value to be set. */ igGridSorting(optionLiteral: 'option', optionName: "columnSettings", optionValue: IgGridSortingColumnSetting[]): void; /** * Enables/disables sorting persistence when the grid is rebound. + * */ igGridSorting(optionLiteral: 'option', optionName: "persist"): boolean; /** * Enables/disables sorting persistence when the grid is rebound. * + * * @optionValue New value to be set. */ igGridSorting(optionLiteral: 'option', optionName: "persist", optionValue: boolean): void; @@ -54363,28 +62723,62 @@ interface JQuery { /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. + * */ igGridSorting(optionLiteral: 'option', optionName: "dialogWidget"): string; /** * Name of the dialog widget to be used. It should inherit from $.ui.igGridModalDialog. * + * * @optionValue New value to be set. */ igGridSorting(optionLiteral: 'option', optionName: "dialogWidget", optionValue: string): void; /** * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. + * */ igGridSorting(optionLiteral: 'option', optionName: "inherit"): boolean; /** * Enables/disables feature inheritance for the child layouts. NOTE: It only applies for igHierarchicalGrid. * + * * @optionValue New value to be set. */ igGridSorting(optionLiteral: 'option', optionName: "inherit", optionValue: boolean): void; + /** + * Set/Get the locale language setting for the widget. + * + */ + igGridSorting(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igGridSorting(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igGridSorting(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igGridSorting(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event fired before sorting is invoked for a certain column. * Return false in order to cancel column sorting. @@ -54563,12 +62957,14 @@ interface JQuery { interface IgGridSummariesColumnSettingSummaryOperand { /** * Text of the summary method which is shown in summary cell + * */ rowDisplayLabel?: string; /** * Set type of summary operand * + * * Valid values: * "count" calculate count of result rows for the specified column * "min" calculate min of result rows for the specified column @@ -54581,16 +62977,19 @@ interface IgGridSummariesColumnSettingSummaryOperand { /** * If it is false the summary operand will be shown in dropdown but it will not be made calculation + * */ active?: boolean; /** * Name of the custom summary function which should be executed when type is custom + * */ summaryCalculator?: string; /** * Specifies the order of elements in dropdown. It is recommended to set order of custom operands and to be greater or equal to 5 + * */ order?: number; @@ -54599,6 +62998,7 @@ interface IgGridSummariesColumnSettingSummaryOperand { * When this option is not set, the [format](ui.iggrid#options:columns.format) of the column it is in will taken into account. * When this option and the column [format](ui.iggrid#options:columns.format) is not set, the regional settings will be taken depending on the [autoFormat](ui.iggrid#options:autoFormat) option. * If the column type is not specified in the [autoFormat](ui.iggrid#options:autoFormat) option and no format is set for both column and summary operand, no formatting is applied. + * */ format?: string; @@ -54611,21 +63011,25 @@ interface IgGridSummariesColumnSettingSummaryOperand { interface IgGridSummariesColumnSetting { /** * Enables disables summaries for the column + * */ allowSummaries?: boolean; /** * Column key. This is a required property in every column setting if columnIndex is not set + * */ columnKey?: string; /** * Column index. Can be used in place of column key. The preferred way of populating a column setting is to always use the column keys as identifiers + * */ columnIndex?: number; /** * Check defaultSummaryOperands + * */ summaryOperands?: IgGridSummariesColumnSettingSummaryOperand[]; @@ -54638,31 +63042,37 @@ interface IgGridSummariesColumnSetting { interface IgGridSummariesLocale { /** * Text of the button OK in the summaries dropdown + * */ dialogButtonOKText?: string; /** * Text of the button Cancel in the summaries dropdown + * */ dialogButtonCancelText?: string; /** * Get or set text that is shown in the feature chooser dropdown when summaries are hidden + * */ featureChooserText?: string; /** * Get or set text that is shown in the feauture chooser dropdown when summaries are shown + * */ featureChooserTextHide?: string; /** * Empty text template to be shown for empty cells + * */ emptyCellText?: string; /** * Tooltip text for header cell button + * */ summariesHeaderButtonTooltip?: string; @@ -54798,6 +63208,7 @@ interface IgGridSummaries { /** * type of summaries calculating. * + * * Valid values: * "remote" when it is remote summaries calculations are made on the server * "local" When it is local calculations are made on the client @@ -54849,6 +63260,7 @@ interface IgGridSummaries { /** * Specifies when calculations are made. * + * * Valid values: * "onselect" summaries are updated when checkbox is checked/unchecked * "okcancelbuttons" summaries are updated only when OK button is clicked @@ -54860,47 +63272,56 @@ interface IgGridSummaries { * When true indicates that the summaries may be rendered compactly, even mixing different summaries on the same line. * False ensures that each summary type is occupying a separate line. * Auto will use True if the maximum number of visible summaries is one or less and False otherwise. + * */ compactRenderingMode?: any; /** * Show header button icon in the header cell. On click - shows/hides summaries. If false then summary icon should not be shown in the feature chooser(if shown). + * */ showSummariesButton?: boolean; /** * Result key by which we get data from the result returned by remote data source. + * */ summariesResponseKey?: string; /** * Set key in GET Request for summaries - used only when type is remote + * */ summaryExprUrlKey?: string; /** * Function reference - it is called when data is retrieved from the data source + * */ callee?: Function; /** * Height of the dropdown in pixels + * */ dropDownHeight?: number; /** * Width of the dropdown in pixels + * */ dropDownWidth?: number; /** * Show/hide footer button(on click show/hide dropdown) + * */ showDropDownButton?: boolean; /** * Determines when the summary values are calculated when type is local * + * * Valid values: * "priortofilteringandpaging" summaries are calculated prior to filtering and paging * "afterfilteringbeforepaging" summaries are calculated after filtering and before paging @@ -54910,21 +63331,25 @@ interface IgGridSummaries { /** * Dropdown animation duration + * */ dropDownDialogAnimationDuration?: number; /** * Result template for summary result(shown in table cell) + * */ resultTemplate?: string; /** * a reference or name of a javascript function - renders summary cell in grid footer.(if not set it is used default render function) It takes 3 parameters - methodName(summary method), columnKey, data(summary data which should be rendered) + * */ renderSummaryCellFunc?: string|Object; /** * A list of column settings that specifies custom summaries options per column basis + * */ columnSettings?: IgGridSummariesColumnSetting[]; @@ -54934,6 +63359,18 @@ interface IgGridSummaries { inherit?: boolean; locale?: IgGridSummariesLocale; + /** + * Set/Get the locale language setting for the widget. + * + */ + language?: string; + + /** + * Set/Get the regional setting for the widget. + * + */ + regional?: string|Object; + /** * Event fired before drop down is opened for a specific column summary * Return false in order to cancel opening the drop down. @@ -54999,7 +63436,19 @@ interface IgGridSummaries { [optionName: string]: any; } interface IgGridSummariesMethods { + changeGlobalLanguage(): void; + changeGlobalRegional(): void; + + /** + * Changes the all locales into the widget element to the language specified in [options.language](ui.iggridsummaries#options:language) + * Note that this method is for rare scenarios, see [language](ui.iggridsummaries#options:language) or [locale](ui.iggridsummaries#options:locale) option setter + */ changeLocale(): void; + + /** + * Changes the the regional settings of widget element to the language specified in [options.regional](ui.iggridsummaries#options:regional) + * Note that this method is for rare scenarios, use [regional](ui.iggridsummaries#options:regional) option setter + */ changeRegional(): void; destroy(): void; @@ -55063,6 +63512,7 @@ interface IgGridSummariesMethods { * @param columnMethods Array of column methods objects * @param data Object which represents result * represents dataType for the current column + * @param dataType */ calculateSummaryColumn(ck: string, columnMethods: any[], data: Object, dataType: Object): void; @@ -55073,6 +63523,8 @@ interface IgGridSummariesMethods { /** * Return a JQUERY object which holds all summaries for column with the specified column key + * + * @param columnKey */ summariesFor(columnKey: Object): void; } @@ -55081,6 +63533,8 @@ interface JQuery { } interface JQuery { + igGridSummaries(methodName: "changeGlobalLanguage"): void; + igGridSummaries(methodName: "changeGlobalRegional"): void; igGridSummaries(methodName: "changeLocale"): void; igGridSummaries(methodName: "changeRegional"): void; igGridSummaries(methodName: "destroy"): void; @@ -55098,6 +63552,7 @@ interface JQuery { /** * Type of summaries calculating. + * */ igGridSummaries(optionLiteral: 'option', optionName: "type"): string; @@ -55105,6 +63560,7 @@ interface JQuery { /** * Type of summaries calculating. * + * * @optionValue New value to be set. */ @@ -55208,6 +63664,7 @@ interface JQuery { /** * Gets when calculations are made. + * */ igGridSummaries(optionLiteral: 'option', optionName: "calculateRenderMode"): string; @@ -55215,6 +63672,7 @@ interface JQuery { /** * Sets when calculations are made. * + * * @optionValue New value to be set. */ @@ -55225,6 +63683,7 @@ interface JQuery { * When true indicates that the summaries may be rendered compactly, even mixing different summaries on the same line. * False ensures that each summary type is occupying a separate line. * Auto will use True if the maximum number of visible summaries is one or less and False otherwise. + * */ igGridSummaries(optionLiteral: 'option', optionName: "compactRenderingMode"): any; @@ -55234,96 +63693,112 @@ interface JQuery { * False ensures that each summary type is occupying a separate line. * Auto will use True if the maximum number of visible summaries is one or less and False otherwise. * + * * @optionValue New value to be set. */ igGridSummaries(optionLiteral: 'option', optionName: "compactRenderingMode", optionValue: any): void; /** * Show header button icon in the header cell. On click - shows/hides summaries. If false then summary icon should not be shown in the feature chooser(if shown). + * */ igGridSummaries(optionLiteral: 'option', optionName: "showSummariesButton"): boolean; /** * Show header button icon in the header cell. On click - shows/hides summaries. If false then summary icon should not be shown in the feature chooser(if shown). * + * * @optionValue New value to be set. */ igGridSummaries(optionLiteral: 'option', optionName: "showSummariesButton", optionValue: boolean): void; /** * Result key by which we get data from the result returned by remote data source. + * */ igGridSummaries(optionLiteral: 'option', optionName: "summariesResponseKey"): string; /** * Result key by which we get data from the result returned by remote data source. * + * * @optionValue New value to be set. */ igGridSummaries(optionLiteral: 'option', optionName: "summariesResponseKey", optionValue: string): void; /** * Set key in GET Request for summaries - used only when type is remote + * */ igGridSummaries(optionLiteral: 'option', optionName: "summaryExprUrlKey"): string; /** * Set key in GET Request for summaries - used only when type is remote * + * * @optionValue New value to be set. */ igGridSummaries(optionLiteral: 'option', optionName: "summaryExprUrlKey", optionValue: string): void; /** * Function reference - it is called when data is retrieved from the data source + * */ igGridSummaries(optionLiteral: 'option', optionName: "callee"): Function; /** * Function reference - it is called when data is retrieved from the data source * + * * @optionValue New value to be set. */ igGridSummaries(optionLiteral: 'option', optionName: "callee", optionValue: Function): void; /** * Height of the dropdown in pixels + * */ igGridSummaries(optionLiteral: 'option', optionName: "dropDownHeight"): number; /** * Height of the dropdown in pixels * + * * @optionValue New value to be set. */ igGridSummaries(optionLiteral: 'option', optionName: "dropDownHeight", optionValue: number): void; /** * Width of the dropdown in pixels + * */ igGridSummaries(optionLiteral: 'option', optionName: "dropDownWidth"): number; /** * Width of the dropdown in pixels * + * * @optionValue New value to be set. */ igGridSummaries(optionLiteral: 'option', optionName: "dropDownWidth", optionValue: number): void; /** * Show/hide footer button(on click show/hide dropdown) + * */ igGridSummaries(optionLiteral: 'option', optionName: "showDropDownButton"): boolean; /** * Show/hide footer button(on click show/hide dropdown) * + * * @optionValue New value to be set. */ igGridSummaries(optionLiteral: 'option', optionName: "showDropDownButton", optionValue: boolean): void; /** * Determines when the summary values are calculated when type is local + * */ igGridSummaries(optionLiteral: 'option', optionName: "summaryExecution"): string; @@ -55331,6 +63806,7 @@ interface JQuery { /** * Determines when the summary values are calculated when type is local * + * * @optionValue New value to be set. */ @@ -55338,30 +63814,35 @@ interface JQuery { /** * Dropdown animation duration + * */ igGridSummaries(optionLiteral: 'option', optionName: "dropDownDialogAnimationDuration"): number; /** * Dropdown animation duration * + * * @optionValue New value to be set. */ igGridSummaries(optionLiteral: 'option', optionName: "dropDownDialogAnimationDuration", optionValue: number): void; /** * Result template for summary result(shown in table cell) + * */ igGridSummaries(optionLiteral: 'option', optionName: "resultTemplate"): string; /** * Result template for summary result(shown in table cell) * + * * @optionValue New value to be set. */ igGridSummaries(optionLiteral: 'option', optionName: "resultTemplate", optionValue: string): void; /** * A reference or name of a javascript function - renders summary cell in grid footer.(if not set it is used default render function) It takes 3 parameters - methodName(summary method), columnKey, data(summary data which should be rendered) + * */ igGridSummaries(optionLiteral: 'option', optionName: "renderSummaryCellFunc"): string|Object; @@ -55369,6 +63850,7 @@ interface JQuery { /** * A reference or name of a javascript function - renders summary cell in grid footer.(if not set it is used default render function) It takes 3 parameters - methodName(summary method), columnKey, data(summary data which should be rendered) * + * * @optionValue New value to be set. */ @@ -55376,12 +63858,14 @@ interface JQuery { /** * A list of column settings that specifies custom summaries options per column basis + * */ igGridSummaries(optionLiteral: 'option', optionName: "columnSettings"): IgGridSummariesColumnSetting[]; /** * A list of column settings that specifies custom summaries options per column basis * + * * @optionValue New value to be set. */ igGridSummaries(optionLiteral: 'option', optionName: "columnSettings", optionValue: IgGridSummariesColumnSetting[]): void; @@ -55400,6 +63884,36 @@ interface JQuery { igGridSummaries(optionLiteral: 'option', optionName: "locale"): IgGridSummariesLocale; igGridSummaries(optionLiteral: 'option', optionName: "locale", optionValue: IgGridSummariesLocale): void; + /** + * Set/Get the locale language setting for the widget. + * + */ + igGridSummaries(optionLiteral: 'option', optionName: "language"): string; + + /** + * Set/Get the locale language setting for the widget. + * + * + * @optionValue New value to be set. + */ + igGridSummaries(optionLiteral: 'option', optionName: "language", optionValue: string): void; + + /** + * Set/Get the regional setting for the widget. + * + */ + + igGridSummaries(optionLiteral: 'option', optionName: "regional"): string|Object; + + /** + * Set/Get the regional setting for the widget. + * + * + * @optionValue New value to be set. + */ + + igGridSummaries(optionLiteral: 'option', optionName: "regional", optionValue: string|Object): void; + /** * Event fired before drop down is opened for a specific column summary * Return false in order to cancel opening the drop down. @@ -55548,21 +64062,25 @@ interface JQuery { interface IgGridTooltipsColumnSettings { /** * Either key or index must be set in every column setting. + * */ columnKey?: string; /** * Either key or index must be set in every column setting. + * */ columnIndex?: number; /** * Enables / disables tooltips on the specified column. By default tooltips are displayed for each column. Note: This option is mandatory. + * */ allowTooltips?: boolean; /** * Specifies the maximum width (in pixels) of the tooltip when shown for the specified column. If unset the width of the column will be used instead. + * */ maxWidth?: number; @@ -55574,7 +64092,8 @@ interface IgGridTooltipsColumnSettings { interface IgGridTooltips { /** - * determines the tooltip visibility option + * Determines the tooltip visibility option + * * * Valid values: * "always" tooltips always show for hovered elements @@ -55584,7 +64103,8 @@ interface IgGridTooltips { visibility?: string; /** - * controls the tooltip's style + * Controls the tooltip's style + * * * Valid values: * "tooltip" The tooltip will be positioned according to the mouse cursor. Will render the tooltip content as plain text. @@ -55595,32 +64115,38 @@ interface IgGridTooltips { /** * The time in milliseconds after which tooltip will show when * mouse cursor is hovered over a cell. + * */ showDelay?: number; /** * Type="integer" The time in milliseconds after which tooltip hides when mouse * cursor gets outside of the cell. + * */ hideDelay?: number; /** * A list of custom column settings that specify custom tooltip settings for a specific column (whether tooltips are enabled / disabled) + * */ columnSettings?: IgGridTooltipsColumnSettings; /** * Sets the time tooltip fades in and out when showing/hiding + * */ fadeTimespan?: number; /** * Sets the left position of the tooltip relative to the mouse cursor + * */ cursorLeftOffset?: number; /** * Sets the top position of the tooltip relative to the mouse cursor + * */ cursorTopOffset?: number; @@ -55675,6 +64201,7 @@ interface JQuery { /** * Determines the tooltip visibility option + * */ igGridTooltips(optionLiteral: 'option', optionName: "visibility"): string; @@ -55682,6 +64209,7 @@ interface JQuery { /** * Determines the tooltip visibility option * + * * @optionValue New value to be set. */ @@ -55689,6 +64217,7 @@ interface JQuery { /** * Controls the tooltip's style + * */ igGridTooltips(optionLiteral: 'option', optionName: "style"): string; @@ -55696,6 +64225,7 @@ interface JQuery { /** * Controls the tooltip's style * + * * @optionValue New value to be set. */ @@ -55704,6 +64234,7 @@ interface JQuery { /** * The time in milliseconds after which tooltip will show when * mouse cursor is hovered over a cell. + * */ igGridTooltips(optionLiteral: 'option', optionName: "showDelay"): number; @@ -55711,6 +64242,7 @@ interface JQuery { * The time in milliseconds after which tooltip will show when * mouse cursor is hovered over a cell. * + * * @optionValue New value to be set. */ igGridTooltips(optionLiteral: 'option', optionName: "showDelay", optionValue: number): void; @@ -55718,6 +64250,7 @@ interface JQuery { /** * Type="integer" The time in milliseconds after which tooltip hides when mouse * cursor gets outside of the cell. + * */ igGridTooltips(optionLiteral: 'option', optionName: "hideDelay"): number; @@ -55725,54 +64258,63 @@ interface JQuery { * Type="integer" The time in milliseconds after which tooltip hides when mouse * cursor gets outside of the cell. * + * * @optionValue New value to be set. */ igGridTooltips(optionLiteral: 'option', optionName: "hideDelay", optionValue: number): void; /** * A list of custom column settings that specify custom tooltip settings for a specific column (whether tooltips are enabled / disabled) + * */ igGridTooltips(optionLiteral: 'option', optionName: "columnSettings"): IgGridTooltipsColumnSettings; /** * A list of custom column settings that specify custom tooltip settings for a specific column (whether tooltips are enabled / disabled) * + * * @optionValue New value to be set. */ igGridTooltips(optionLiteral: 'option', optionName: "columnSettings", optionValue: IgGridTooltipsColumnSettings): void; /** * The time tooltip fades in and out when showing/hiding + * */ igGridTooltips(optionLiteral: 'option', optionName: "fadeTimespan"): number; /** * Sets the time tooltip fades in and out when showing/hiding * + * * @optionValue New value to be set. */ igGridTooltips(optionLiteral: 'option', optionName: "fadeTimespan", optionValue: number): void; /** * The left position of the tooltip relative to the mouse cursor + * */ igGridTooltips(optionLiteral: 'option', optionName: "cursorLeftOffset"): number; /** * Sets the left position of the tooltip relative to the mouse cursor * + * * @optionValue New value to be set. */ igGridTooltips(optionLiteral: 'option', optionName: "cursorLeftOffset", optionValue: number): void; /** * The top position of the tooltip relative to the mouse cursor + * */ igGridTooltips(optionLiteral: 'option', optionName: "cursorTopOffset"): number; /** * Sets the top position of the tooltip relative to the mouse cursor * + * * @optionValue New value to be set. */ igGridTooltips(optionLiteral: 'option', optionName: "cursorTopOffset", optionValue: number): void; @@ -55845,12 +64387,14 @@ interface JQuery { interface IgGridUpdatingColumnSetting { /** * Identifies the grid column by key. + * */ columnKey?: string; /** * Specifies the type of editor to use for the column. * + * * Valid values: * "text" An igTextEditor will be created * "mask" An igMaskEditor will be created @@ -55883,31 +64427,37 @@ interface IgGridUpdatingColumnSetting { * validate: function (noLabel) {}, * isValid: function () {} * }); + * */ editorProvider?: any; /** * Specifies options to initialize the corresponding editor with. + * */ editorOptions?: any; /** * Specifies if the end-user will be allowed to leave the editor's value empty during edit mode or not. + * */ required?: boolean; /** * Specifies if the column is read-only. In 'cell' and 'row' [editMode](ui.iggridupdating#options:editMode) no editor will be created for read-only columns. In 'dialog' mode enabling [showReadonlyEditors](ui.iggridupdating#options:rowEditDialogOptions.showReadonlyEditors) will display disabled editors for such columns. + * */ readOnly?: boolean; /** * Specifies if the column's value should be validated or not. The validation is done based on the rules of the corresponding editor. + * */ validation?: boolean; /** * Specifies the default value for the column when adding new rows. When in edit mode for adding a row the value will be pre-filled in the column's editor (if the column is not read-only). The value should be of the type specified for the column in the grid's [columns](ui.iggrid#options:columns) collection. + * */ defaultValue?: any; @@ -55921,6 +64471,7 @@ interface IgGridUpdatingRowEditDialogOptions { /** * Controls the containment of the dialog's drag operation. * + * * Valid values: * "owner" The row edit dialog will be draggable only in the grid area. * "window" The row edit dialog will be draggable in the whole window area. @@ -55930,6 +64481,7 @@ interface IgGridUpdatingRowEditDialogOptions { /** * Controls the default row edit dialog width. * + * * Valid values: * "string" The dialog window width in pixels (400px). * "number" The dialog window width as a number (400). @@ -55939,6 +64491,7 @@ interface IgGridUpdatingRowEditDialogOptions { /** * Controls the default row edit dialog height. * + * * Valid values: * "string" The dialog window height in pixels (350px). * "number" The dialog window height as a number (350). @@ -55947,22 +64500,26 @@ interface IgGridUpdatingRowEditDialogOptions { /** * Specifies the animation duration for the opening and closing operations. + * */ animationDuration?: number; /** * Controls if editors should be rendered for read-only columns. If rendered, these editors will be disabled. + * */ showReadonlyEditors?: boolean; /** * Controls if editors should be rendered for hidden columns. + * */ showEditorsForHiddenColumns?: boolean; /** * Controls the width of the column containing the column names in the default row edit dialog. * + * * Valid values: * "string" The width of the column in pixels (100px) or percents (20%). * "number" The width of the column as a number (100) in pixels. @@ -55973,6 +64530,7 @@ interface IgGridUpdatingRowEditDialogOptions { /** * Controls the width of the column containing the editors in the default row edit dialog. * + * * Valid values: * "string" The width of the column in pixels (100px) or percents (20%). * "number" The width of the column as a number (100) in pixels. @@ -55983,28 +64541,33 @@ interface IgGridUpdatingRowEditDialogOptions { /** * Controls the visibility of the done and cancel buttons for the dialog. * If disabled the end-user will be able to stop editing only with the Enter and Esc keys. + * */ showDoneCancelButtons?: boolean; /** * Specifies a template to be rendered against the currently edited record (or up-to-date key-value pairs in the case of not yet created records). It may contain an element decorated with the 'data-render-tmpl' attribute to specify where the control should render the editors template specified in the [editorsTemplate](ui.iggridupdating#options:rowEditDialogOptions.editorsTemplate) option. For custom dialogs, the elements can be decorated with 'data-editor-for-' attributes where columnKey is the key of the column that editor or input will be used to edit. If both dialogTemplate and [dialogTemplateSelector](ui.iggridupdating#options:rowEditDialogOptions.dialogTemplateSelector) are specified, dialogTemplateSelector will be used.The default template is '
    '. + * */ dialogTemplate?: string; /** * Specifies a selector to a template rendered against the currently edited record (or up-to-date key-value pairs in the case of not yet created records). It may contain an element decorated with the 'data-render-tmpl' attribute to specify where the control should render the editors template specified in the [editorsTemplate](ui.iggridupdating#options:rowEditDialogOptions.editorsTemplate) option. For custom dialogs, the elements can be decorated with 'data-editor-for-' attributes where columnKey is the key of the column that editor or input will be used to edit. If both [dialogTemplate](ui.iggridupdating#options:rowEditDialogOptions.dialogTemplate) and dialogTemplateSelector are specified, dialogTemplateSelector will be used.The default template is '
    '. + * */ dialogTemplateSelector?: string; /** * Specifies a template to be executed for each column in the grid's column collection (or just the read-write columns if [showReadonlyEditors](ui.iggridupdating#options:rowEditDialogOptions.showReadonlyEditors) is false). Decorate the element to be used as an editor with 'data-editor-for-${key}'. The ${key} template tag should be replaced with the chosen templating engine's syntax for rendering values. If any editors for columns are specified in the dialog markup they will be exluded from the data the template will be rendered for. This property is ignored if [dialogTemplate](ui.iggridupdating#options:rowEditDialogOptions.dialogTemplate) does not include an element with the 'data-render-tmpl' attribute. If both editorsTemplate and [editorsTemplateSelector](ui.iggridupdating#options:rowEditDialogOptions.editorsTemplateSelector) are specified, editorsTemplateSelector will be used. * The default template is '
    ${headerText}
    ${headerText}